diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 92eb646f480..5de2bd87e63 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,7 +25,7 @@ Your pull request should: * Tests should include reasonable permutations of the target fix/change * Include baseline changes with your change * All changed code must have 100% code coverage -* Follow the code conventions descriped in [Coding guidlines](https://github.com/Microsoft/TypeScript/wiki/Coding-guidlines) +* Follow the code conventions descriped in [Coding guidelines](https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines) * To avoid line ending issues, set `autocrlf = input` and `whitespace = cr-at-eol` in your git configuration ## Running the Tests diff --git a/Jakefile b/Jakefile index 2efd973a021..dcda1b648f2 100644 --- a/Jakefile +++ b/Jakefile @@ -105,24 +105,6 @@ var serverSources = [ return path.join(serverDirectory, f); }); -var definitionsRoots = [ - "compiler/types.d.ts", - "compiler/scanner.d.ts", - "compiler/parser.d.ts", - "compiler/checker.d.ts", - "compiler/program.d.ts", - "compiler/commandLineParser.d.ts", - "services/services.d.ts", -]; - -var internalDefinitionsRoots = [ - "compiler/core.d.ts", - "compiler/sys.d.ts", - "compiler/utilities.d.ts", - "compiler/commandLineParser.d.ts", - "services/utilities.d.ts", -]; - var harnessSources = [ "harness.ts", "sourceMapRecorder.ts", @@ -354,60 +336,32 @@ var tscFile = path.join(builtLocalDirectory, compilerFilename); compileFile(tscFile, compilerSources, [builtLocalDirectory, copyright].concat(compilerSources), [copyright], /*useBuiltCompiler:*/ false); var servicesFile = path.join(builtLocalDirectory, "typescriptServices.js"); +var standaloneDefinitionsFile = path.join(builtLocalDirectory, "typescriptServices.d.ts"); var nodePackageFile = path.join(builtLocalDirectory, "typescript.js"); +var nodeDefinitionsFile = path.join(builtLocalDirectory, "typescript.d.ts"); + compileFile(servicesFile, servicesSources,[builtLocalDirectory, copyright].concat(servicesSources), /*prefixes*/ [copyright], /*useBuiltCompiler*/ true, /*noOutFile*/ false, - /*generateDeclarations*/ false, + /*generateDeclarations*/ true, /*outDir*/ undefined, /*preserveConstEnums*/ true, - /*keepComments*/ false, + /*keepComments*/ true, /*noResolve*/ false, - /*stripInternal*/ false, + /*stripInternal*/ true, /*callback*/ function () { jake.cpR(servicesFile, nodePackageFile, {silent: true}); + + prependFile(copyright, standaloneDefinitionsFile); + + // Create the node definition file by replacing 'ts' module with '"typescript"' as a module. + jake.cpR(standaloneDefinitionsFile, nodeDefinitionsFile, {silent: true}); + var definitionFileContents = fs.readFileSync(nodeDefinitionsFile).toString(); + definitionFileContents = definitionFileContents.replace(/declare module ts/g, 'declare module "typescript"'); + fs.writeFileSync(nodeDefinitionsFile, definitionFileContents); }); -var nodeDefinitionsFile = path.join(builtLocalDirectory, "typescript.d.ts"); -var standaloneDefinitionsFile = path.join(builtLocalDirectory, "typescriptServices.d.ts"); -var internalNodeDefinitionsFile = path.join(builtLocalDirectory, "typescript_internal.d.ts"); -var internalStandaloneDefinitionsFile = path.join(builtLocalDirectory, "typescriptServices_internal.d.ts"); -var tempDirPath = path.join(builtLocalDirectory, "temptempdir"); -compileFile(nodeDefinitionsFile, servicesSources,[builtLocalDirectory, copyright].concat(servicesSources), - /*prefixes*/ undefined, - /*useBuiltCompiler*/ true, - /*noOutFile*/ true, - /*generateDeclarations*/ true, - /*outDir*/ tempDirPath, - /*preserveConstEnums*/ true, - /*keepComments*/ true, - /*noResolve*/ true, - /*stripInternal*/ true, - /*callback*/ function () { - function makeDefinitionFiles(definitionsRoots, standaloneDefinitionsFile, nodeDefinitionsFile) { - // Create the standalone definition file - concatenateFiles(standaloneDefinitionsFile, definitionsRoots.map(function (f) { - return path.join(tempDirPath, f); - })); - prependFile(copyright, standaloneDefinitionsFile); - - // Create the node definition file by replacing 'ts' module with '"typescript"' as a module. - jake.cpR(standaloneDefinitionsFile, nodeDefinitionsFile, {silent: true}); - var definitionFileContents = fs.readFileSync(nodeDefinitionsFile).toString(); - definitionFileContents = definitionFileContents.replace(/declare module ts/g, 'declare module "typescript"'); - fs.writeFileSync(nodeDefinitionsFile, definitionFileContents); - } - - // Create the public definition files - makeDefinitionFiles(definitionsRoots, standaloneDefinitionsFile, nodeDefinitionsFile); - - // Create the internal definition files - makeDefinitionFiles(internalDefinitionsRoots, internalStandaloneDefinitionsFile, internalNodeDefinitionsFile); - - // Delete the temp dir - jake.rmRf(tempDirPath, {silent: true}); - }); var serverFile = path.join(builtLocalDirectory, "tsserver.js"); compileFile(serverFile, serverSources,[builtLocalDirectory, copyright].concat(serverSources), /*prefixes*/ [copyright], /*useBuiltCompiler*/ true); @@ -469,7 +423,7 @@ task("generate-spec", [specMd]) // Makes a new LKG. This target does not build anything, but errors if not all the outputs are present in the built/local directory desc("Makes a new LKG out of the built js files"); task("LKG", ["clean", "release", "local"].concat(libraryTargets), function() { - var expectedFiles = [tscFile, servicesFile, serverFile, nodePackageFile, nodeDefinitionsFile, standaloneDefinitionsFile, internalNodeDefinitionsFile, internalStandaloneDefinitionsFile].concat(libraryTargets); + var expectedFiles = [tscFile, servicesFile, serverFile, nodePackageFile, nodeDefinitionsFile, standaloneDefinitionsFile].concat(libraryTargets); var missingFiles = expectedFiles.filter(function (f) { return !fs.existsSync(f); }); diff --git a/bin/lib.core.d.ts b/bin/lib.core.d.ts index bc4225b0d82..8a2561af13a 100644 --- a/bin/lib.core.d.ts +++ b/bin/lib.core.d.ts @@ -838,7 +838,7 @@ interface RegExp { */ test(string: string): boolean; - /** Returns a copy of the text of the regular expression pattern. Read-only. The rgExp argument is a Regular expression object. It can be a variable name or a literal. */ + /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */ source: string; /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */ @@ -1183,4 +1183,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/bin/lib.core.es6.d.ts b/bin/lib.core.es6.d.ts index 97c1c7d1b40..0b963774071 100644 --- a/bin/lib.core.es6.d.ts +++ b/bin/lib.core.es6.d.ts @@ -838,7 +838,7 @@ interface RegExp { */ test(string: string): boolean; - /** Returns a copy of the text of the regular expression pattern. Read-only. The rgExp argument is a Regular expression object. It can be a variable name or a literal. */ + /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */ source: string; /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */ @@ -1183,7 +1183,7 @@ 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; declare type PropertyKey = string | number | symbol; interface Symbol { @@ -1236,26 +1236,21 @@ interface SymbolConstructor { */ isConcatSpreadable: symbol; - /** - * A Boolean value that if true indicates that an object may be used as a regular expression. - */ - isRegExp: symbol; - /** * A method that returns the default iterator for an object.Called by the semantics of the - * for-of statement. + * for-of statement. */ iterator: symbol; /** * A method that converts an object to a corresponding primitive value.Called by the ToPrimitive - * abstract operation. + * abstract operation. */ toPrimitive: symbol; /** - * A String value that is used in the creation of the default string description of an object. - * Called by the built- in method Object.prototype.toString. + * A String value that is used in the creation of the default string description of an object. + * Called by the built-in method Object.prototype.toString. */ toStringTag: symbol; @@ -1297,7 +1292,7 @@ interface ObjectConstructor { getOwnPropertySymbols(o: any): symbol[]; /** - * Returns true if the values are the same value, false otherwise. + * Returns true if the values are the same value, false otherwise. * @param value1 The first value. * @param value2 The second value. */ @@ -1784,8 +1779,6 @@ interface Math { } interface RegExp { - [Symbol.isRegExp]: boolean; - /** * Matches a string with a regular expression, and returns an array containing the results of * that search. @@ -1817,6 +1810,20 @@ interface RegExp { */ split(string: string, limit?: number): string[]; + /** + * Returns a string indicating the flags of the regular expression in question. This field is read-only. + * The characters in this string are sequenced and concatenated in the following order: + * + * - "g" for global + * - "i" for ignoreCase + * - "m" for multiline + * - "u" for unicode + * - "y" for sticky + * + * If no flags are set, the value is the empty string. + */ + flags: string; + /** * Returns a Boolean value indicating the state of the sticky flag (y) used with a regular * expression. Default is false. Read-only. @@ -4699,27 +4706,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/bin/lib.d.ts b/bin/lib.d.ts index e0fdf442967..5eaa933d164 100644 --- a/bin/lib.d.ts +++ b/bin/lib.d.ts @@ -838,7 +838,7 @@ interface RegExp { */ test(string: string): boolean; - /** Returns a copy of the text of the regular expression pattern. Read-only. The rgExp argument is a Regular expression object. It can be a variable name or a literal. */ + /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */ source: string; /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */ @@ -1183,7 +1183,7 @@ 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; ///////////////////////////// /// IE10 ECMAScript Extensions @@ -1207,38 +1207,216 @@ interface ArrayBuffer { slice(begin:number, end?:number): ArrayBuffer; } -declare var ArrayBuffer: { +interface ArrayBufferConstructor { prototype: ArrayBuffer; new (byteLength: number): ArrayBuffer; + isView(arg: any): boolean; } +declare var ArrayBuffer: ArrayBufferConstructor; interface ArrayBufferView { + /** + * The ArrayBuffer instance referenced by the array. + */ buffer: ArrayBuffer; - byteOffset: number; + + /** + * The length in bytes of the array. + */ byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; } /** - * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. */ -interface Int8Array extends ArrayBufferView { +interface Int8Array { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Int8Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Int8Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): Int8Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. */ - get(index: number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Int8Array; /** * Sets a value or an array of values. @@ -1254,49 +1432,256 @@ interface Int8Array extends ArrayBufferView { */ set(array: Int8Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Int8Array; /** - * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements at begin, inclusive, up to end, exclusive. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Int8Array; + + /** + * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Int8Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Int8Array: { +interface Int8ArrayConstructor { prototype: Int8Array; new (length: number): Int8Array; new (array: Int8Array): Int8Array; new (array: number[]): Int8Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Int8Array; +} +declare var Int8Array: Int8ArrayConstructor; + +/** + * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Uint8Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Uint8Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): Uint8Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint8Array; /** * Sets a value or an array of values. @@ -1312,49 +1697,257 @@ interface Uint8Array extends ArrayBufferView { */ set(array: Uint8Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Uint8Array; /** - * Gets a new Uint8Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Uint8Array; + + /** + * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Uint8Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Uint8Array: { + +interface Uint8ArrayConstructor { prototype: Uint8Array; new (length: number): Uint8Array; new (array: Uint8Array): Uint8Array; new (array: number[]): Uint8Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 16-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Int16Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint8Array; +} +declare var Uint8Array: Uint8ArrayConstructor; + +/** + * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int16Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Int16Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Int16Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): Int16Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Int16Array; /** * Sets a value or an array of values. @@ -1370,49 +1963,257 @@ interface Int16Array extends ArrayBufferView { */ set(array: Int16Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Int16Array; /** - * Gets a new Int16Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Int16Array; + + /** + * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Int16Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Int16Array: { + +interface Int16ArrayConstructor { prototype: Int16Array; new (length: number): Int16Array; new (array: Int16Array): Int16Array; new (array: number[]): Int16Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint16Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Int16Array; +} +declare var Int16Array: Int16ArrayConstructor; + +/** + * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint16Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Uint16Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Uint16Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): Uint16Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint16Array; /** * Sets a value or an array of values. @@ -1428,49 +2229,256 @@ interface Uint16Array extends ArrayBufferView { */ set(array: Uint16Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Uint16Array; /** - * Gets a new Uint16Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Uint16Array; + + /** + * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Uint16Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Uint16Array: { + +interface Uint16ArrayConstructor { prototype: Uint16Array; new (length: number): Uint16Array; new (array: Uint16Array): Uint16Array; new (array: number[]): Uint16Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 32-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Int32Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint16Array; +} +declare var Uint16Array: Uint16ArrayConstructor; +/** + * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int32Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Int32Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Int32Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): Int32Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Int32Array; /** * Sets a value or an array of values. @@ -1486,49 +2494,257 @@ interface Int32Array extends ArrayBufferView { */ set(array: Int32Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Int32Array; /** - * Gets a new Int32Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Int32Array; + + /** + * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Int32Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Int32Array: { + +interface Int32ArrayConstructor { prototype: Int32Array; new (length: number): Int32Array; new (array: Int32Array): Int32Array; new (array: number[]): Int32Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint32Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Int32Array; +} +declare var Int32Array: Int32ArrayConstructor; + +/** + * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint32Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Uint32Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Uint32Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): Uint32Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint32Array; /** * Sets a value or an array of values. @@ -1544,49 +2760,257 @@ interface Uint32Array extends ArrayBufferView { */ set(array: Uint32Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Uint32Array; /** - * Gets a new Int8Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Uint32Array; + + /** + * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Uint32Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Uint32Array: { + +interface Uint32ArrayConstructor { prototype: Uint32Array; new (length: number): Uint32Array; new (array: Uint32Array): Uint32Array; new (array: number[]): Uint32Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Float32Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint32Array; +} +declare var Uint32Array: Uint32ArrayConstructor; + +/** + * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number + * of bytes could not be allocated an exception is raised. + */ +interface Float32Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Float32Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Float32Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): Float32Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Float32Array; /** * Sets a value or an array of values. @@ -1602,49 +3026,257 @@ interface Float32Array extends ArrayBufferView { */ set(array: Float32Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Float32Array; /** - * Gets a new Float32Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Float32Array; + + /** + * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Float32Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Float32Array: { + +interface Float32ArrayConstructor { prototype: Float32Array; new (length: number): Float32Array; new (array: Float32Array): Float32Array; new (array: number[]): Float32Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 64-bit float values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Float64Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Float32Array; +} +declare var Float32Array: Float32ArrayConstructor; + +/** + * A typed array of 64-bit float values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Float64Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Float64Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Float64Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): Float64Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Float64Array; /** * Sets a value or an array of values. @@ -1660,191 +3292,70 @@ interface Float64Array extends ArrayBufferView { */ set(array: Float64Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Float64Array; /** - * Gets a new Float64Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Float64Array; + + /** + * Gets a new Float64Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Float64Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Float64Array: { + +interface Float64ArrayConstructor { prototype: Float64Array; new (length: number): Float64Array; new (array: Float64Array): Float64Array; new (array: number[]): Float64Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array; + + /** + * The size in bytes of each element in the array. + */ BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Float64Array; } - -/** - * You can use a DataView object to read and write the different kinds of binary data to any location in the ArrayBuffer. - */ -interface DataView extends ArrayBufferView { - /** - * Gets the Int8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt8(byteOffset: number): number; - - /** - * Gets the Uint8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint8(byteOffset: number): number; - - /** - * Gets the Int16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt16(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Uint16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint16(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Int32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Uint32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Float32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Float64 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat64(byteOffset: number, littleEndian?: boolean): number; - - /** - * Stores an Int8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setInt8(byteOffset: number, value: number): void; - - /** - * Stores an Uint8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setUint8(byteOffset: number, value: number): void; - - /** - * Stores an Int16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setInt16(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Uint16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setUint16(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Int32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setInt32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Uint32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setUint32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Float32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Float64 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void; -} -declare var DataView: { - prototype: DataView; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): DataView; -} - -///////////////////////////// -/// IE11 ECMAScript Extensions -///////////////////////////// - -interface Map { - clear(): void; - delete(key: K): boolean; - forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; - get(key: K): V; - has(key: K): boolean; - set(key: K, value: V): Map; - size: number; -} -declare var Map: { - new (): Map; - prototype: Map; -} - -interface WeakMap { - clear(): void; - delete(key: K): boolean; - get(key: K): V; - has(key: K): boolean; - set(key: K, value: V): WeakMap; -} -declare var WeakMap: { - new (): WeakMap; - prototype: WeakMap; -} - -interface Set { - add(value: T): Set; - clear(): void; - delete(value: T): boolean; - forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; - has(value: T): boolean; - size: number; -} -declare var Set: { - new (): Set; - prototype: Set; -} -///////////////////////////// +declare var Float64Array: Float64ArrayConstructor;///////////////////////////// /// ECMAScript Internationalization API ///////////////////////////// @@ -2012,36 +3523,99 @@ interface Date { toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string; } + ///////////////////////////// /// IE DOM APIs ///////////////////////////// - -interface PositionOptions { - enableHighAccuracy?: boolean; - timeout?: number; - maximumAge?: number; +interface Algorithm { + name?: string; } -interface ObjectURLOptions { - oneTimeOnly?: boolean; +interface AriaRequestEventInit extends EventInit { + attributeName?: string; + attributeValue?: string; } -interface StoreExceptionsInformation extends ExceptionInformation { - siteName?: string; - explanationString?: string; - detailURI?: string; +interface ClipboardEventInit extends EventInit { + data?: string; + dataType?: string; } -interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation { - arrayOfDomainStrings?: string[]; +interface CommandEventInit extends EventInit { + commandName?: string; + detail?: string; +} + +interface CompositionEventInit extends UIEventInit { + data?: string; } interface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation { arrayOfDomainStrings?: string[]; } -interface AlgorithmParameters { +interface CustomEventInit extends EventInit { + detail?: any; +} + +interface DeviceAccelerationDict { + x?: number; + y?: number; + z?: number; +} + +interface DeviceRotationRateDict { + alpha?: number; + beta?: number; + gamma?: number; +} + +interface EventInit { + bubbles?: boolean; + cancelable?: boolean; +} + +interface ExceptionInformation { + domain?: string; +} + +interface FocusEventInit extends UIEventInit { + relatedTarget?: EventTarget; +} + +interface HashChangeEventInit extends EventInit { + newURL?: string; + oldURL?: string; +} + +interface KeyAlgorithm { + name?: string; +} + +interface KeyboardEventInit extends SharedKeyboardAndMouseEventInit { + key?: string; + location?: number; + repeat?: boolean; +} + +interface MouseEventInit extends SharedKeyboardAndMouseEventInit { + screenX?: number; + screenY?: number; + clientX?: number; + clientY?: number; + button?: number; + buttons?: number; + relatedTarget?: EventTarget; +} + +interface MsZoomToOptions { + contentX?: number; + contentY?: number; + viewportX?: string; + viewportY?: string; + scaleFactor?: number; + animate?: string; } interface MutationObserverInit { @@ -2054,6 +3628,10 @@ interface MutationObserverInit { attributeFilter?: string[]; } +interface ObjectURLOptions { + oneTimeOnly?: boolean; +} + interface PointerEventInit extends MouseEventInit { pointerId?: number; width?: number; @@ -2065,52 +3643,43 @@ interface PointerEventInit extends MouseEventInit { isPrimary?: boolean; } -interface ExceptionInformation { - domain?: string; +interface PositionOptions { + enableHighAccuracy?: boolean; + timeout?: number; + maximumAge?: number; } -interface DeviceAccelerationDict { - x?: number; - y?: number; - z?: number; -} - -interface MsZoomToOptions { - contentX?: number; - contentY?: number; - viewportX?: string; - viewportY?: string; - scaleFactor?: number; - animate?: string; -} - -interface DeviceRotationRateDict { - alpha?: number; - beta?: number; - gamma?: number; -} - -interface Algorithm { - name?: string; - params?: AlgorithmParameters; -} - -interface MouseEventInit { - bubbles?: boolean; - cancelable?: boolean; - view?: Window; - detail?: number; - screenX?: number; - screenY?: number; - clientX?: number; - clientY?: number; +interface SharedKeyboardAndMouseEventInit extends UIEventInit { ctrlKey?: boolean; shiftKey?: boolean; altKey?: boolean; metaKey?: boolean; - button?: number; - buttons?: number; - relatedTarget?: EventTarget; + keyModifierStateAltGraph?: boolean; + keyModifierStateCapsLock?: boolean; + keyModifierStateFn?: boolean; + keyModifierStateFnLock?: boolean; + keyModifierStateHyper?: boolean; + keyModifierStateNumLock?: boolean; + keyModifierStateOS?: boolean; + keyModifierStateScrollLock?: boolean; + keyModifierStateSuper?: boolean; + keyModifierStateSymbol?: boolean; + keyModifierStateSymbolLock?: boolean; +} + +interface StoreExceptionsInformation extends ExceptionInformation { + siteName?: string; + explanationString?: string; + detailURI?: string; +} + +interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation { + arrayOfDomainStrings?: string[]; +} + +interface UIEventInit extends EventInit { + view?: Window; + detail?: number; } interface WebGLContextAttributes { @@ -2122,526 +3691,1863 @@ interface WebGLContextAttributes { preserveDrawingBuffer?: boolean; } -interface NodeListOf extends NodeList { - length: number; - item(index: number): TNode; - [index: number]: TNode; +interface WebGLContextEventInit extends EventInit { + statusMessage?: string; } -interface HTMLElement extends Element, ElementCSSInlineStyle, MSEventAttachmentTarget, MSNodeExtensions { - hidden: any; - readyState: any; - onmouseleave: (ev: MouseEvent) => any; - onbeforecut: (ev: DragEvent) => any; - onkeydown: (ev: KeyboardEvent) => any; - onmove: (ev: MSEventObj) => any; - onkeyup: (ev: KeyboardEvent) => any; - onreset: (ev: Event) => any; - onhelp: (ev: Event) => any; - ondragleave: (ev: DragEvent) => any; - className: string; - onfocusin: (ev: FocusEvent) => any; - onseeked: (ev: Event) => any; - recordNumber: any; - title: string; - parentTextEdit: Element; - outerHTML: string; - ondurationchange: (ev: Event) => any; - offsetHeight: number; - all: HTMLCollection; - onblur: (ev: FocusEvent) => any; - dir: string; - onemptied: (ev: Event) => any; - onseeking: (ev: Event) => any; - oncanplay: (ev: Event) => any; - ondeactivate: (ev: UIEvent) => any; - ondatasetchanged: (ev: MSEventObj) => any; - onrowsdelete: (ev: MSEventObj) => any; - sourceIndex: number; - onloadstart: (ev: Event) => any; - onlosecapture: (ev: MSEventObj) => any; - ondragenter: (ev: DragEvent) => any; - oncontrolselect: (ev: MSEventObj) => any; - onsubmit: (ev: Event) => any; - behaviorUrns: MSBehaviorUrnsCollection; - scopeName: string; - onchange: (ev: Event) => any; - id: string; - onlayoutcomplete: (ev: MSEventObj) => any; - uniqueID: string; - onbeforeactivate: (ev: UIEvent) => any; - oncanplaythrough: (ev: Event) => any; - onbeforeupdate: (ev: MSEventObj) => any; - onfilterchange: (ev: MSEventObj) => any; - offsetParent: Element; - ondatasetcomplete: (ev: MSEventObj) => any; - onsuspend: (ev: Event) => any; - onmouseenter: (ev: MouseEvent) => any; - innerText: string; - onerrorupdate: (ev: MSEventObj) => any; - onmouseout: (ev: MouseEvent) => any; - parentElement: HTMLElement; - onmousewheel: (ev: MouseWheelEvent) => any; - onvolumechange: (ev: Event) => any; - oncellchange: (ev: MSEventObj) => any; - onrowexit: (ev: MSEventObj) => any; - onrowsinserted: (ev: MSEventObj) => any; - onpropertychange: (ev: MSEventObj) => any; - filters: any; - children: HTMLCollection; - ondragend: (ev: DragEvent) => any; - onbeforepaste: (ev: DragEvent) => any; - ondragover: (ev: DragEvent) => any; - offsetTop: number; - onmouseup: (ev: MouseEvent) => any; - ondragstart: (ev: DragEvent) => any; - onbeforecopy: (ev: DragEvent) => any; - ondrag: (ev: DragEvent) => any; - innerHTML: string; - onmouseover: (ev: MouseEvent) => any; - lang: string; - uniqueNumber: number; - onpause: (ev: Event) => any; - tagUrn: string; - onmousedown: (ev: MouseEvent) => any; - onclick: (ev: MouseEvent) => any; - onwaiting: (ev: Event) => any; - onresizestart: (ev: MSEventObj) => any; - offsetLeft: number; - isTextEdit: boolean; - isDisabled: boolean; - onpaste: (ev: DragEvent) => any; - canHaveHTML: boolean; - onmoveend: (ev: MSEventObj) => any; - language: string; - onstalled: (ev: Event) => any; - onmousemove: (ev: MouseEvent) => any; - style: MSStyleCSSProperties; - isContentEditable: boolean; - onbeforeeditfocus: (ev: MSEventObj) => any; - onratechange: (ev: Event) => any; - contentEditable: string; - tabIndex: number; - document: Document; +interface WheelEventInit extends MouseEventInit { + deltaX?: number; + deltaY?: number; + deltaZ?: number; + deltaMode?: number; +} + +interface EventListener { + (evt: Event): void; +} + +interface ANGLE_instanced_arrays { + drawArraysInstancedANGLE(mode: number, first: number, count: number, primcount: number): void; + drawElementsInstancedANGLE(mode: number, count: number, type: number, offset: number, primcount: number): void; + vertexAttribDivisorANGLE(index: number, divisor: number): void; + VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; +} + +declare var ANGLE_instanced_arrays: { + prototype: ANGLE_instanced_arrays; + new(): ANGLE_instanced_arrays; + VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; +} + +interface AnalyserNode extends AudioNode { + fftSize: number; + frequencyBinCount: number; + maxDecibels: number; + minDecibels: number; + smoothingTimeConstant: number; + getByteFrequencyData(array: Uint8Array): void; + getByteTimeDomainData(array: Uint8Array): void; + getFloatFrequencyData(array: any): void; + getFloatTimeDomainData(array: any): void; +} + +declare var AnalyserNode: { + prototype: AnalyserNode; + new(): AnalyserNode; +} + +interface AnimationEvent extends Event { + animationName: string; + elapsedTime: number; + initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void; +} + +declare var AnimationEvent: { + prototype: AnimationEvent; + new(): AnimationEvent; +} + +interface ApplicationCache extends EventTarget { + oncached: (ev: Event) => any; + onchecking: (ev: Event) => any; + ondownloading: (ev: Event) => any; + onerror: (ev: Event) => any; + onnoupdate: (ev: Event) => any; + onobsolete: (ev: Event) => any; onprogress: (ev: ProgressEvent) => any; - ondblclick: (ev: MouseEvent) => any; - oncontextmenu: (ev: MouseEvent) => any; - onloadedmetadata: (ev: Event) => any; - onafterupdate: (ev: MSEventObj) => any; - onerror: (ev: ErrorEvent) => any; - onplay: (ev: Event) => any; - onresizeend: (ev: MSEventObj) => any; - onplaying: (ev: Event) => any; - isMultiLine: boolean; - onfocusout: (ev: FocusEvent) => any; - onabort: (ev: UIEvent) => any; - ondataavailable: (ev: MSEventObj) => any; - hideFocus: boolean; - onreadystatechange: (ev: Event) => any; - onkeypress: (ev: KeyboardEvent) => any; - onloadeddata: (ev: Event) => any; - onbeforedeactivate: (ev: UIEvent) => any; - outerText: string; - disabled: boolean; - onactivate: (ev: UIEvent) => any; - accessKey: string; - onmovestart: (ev: MSEventObj) => any; - onselectstart: (ev: Event) => any; - onfocus: (ev: FocusEvent) => any; - ontimeupdate: (ev: Event) => any; - onresize: (ev: UIEvent) => any; - oncut: (ev: DragEvent) => any; - onselect: (ev: UIEvent) => any; - ondrop: (ev: DragEvent) => any; - offsetWidth: number; - oncopy: (ev: DragEvent) => any; - onended: (ev: Event) => any; - onscroll: (ev: UIEvent) => any; - onrowenter: (ev: MSEventObj) => any; - onload: (ev: Event) => any; - canHaveChildren: boolean; - oninput: (ev: Event) => any; - onmscontentzoom: (ev: MSEventObj) => any; - oncuechange: (ev: Event) => any; - spellcheck: boolean; - classList: DOMTokenList; - onmsmanipulationstatechanged: (ev: any) => any; - draggable: boolean; - dataset: DOMStringMap; - dragDrop(): boolean; - scrollIntoView(top?: boolean): void; - addFilter(filter: any): void; - setCapture(containerCapture?: boolean): void; - focus(): void; - getAdjacentText(where: string): string; - insertAdjacentText(where: string, text: string): void; - getElementsByClassName(classNames: string): NodeList; - setActive(): void; - removeFilter(filter: any): void; - blur(): void; - clearAttributes(): void; - releaseCapture(): void; - createControlRange(): ControlRangeCollection; - removeBehavior(cookie: number): boolean; - contains(child: HTMLElement): boolean; - click(): void; - insertAdjacentElement(position: string, insertedElement: Element): Element; - mergeAttributes(source: HTMLElement, preserveIdentity?: boolean): void; - replaceAdjacentText(where: string, newText: string): string; - applyElement(apply: Element, where?: string): Element; - addBehavior(bstrUrl: string, factory?: any): number; - insertAdjacentHTML(where: string, html: string): void; - msGetInputContext(): MSInputMethodContext; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + onupdateready: (ev: Event) => any; + status: number; + abort(): void; + swapCache(): void; + update(): void; + CHECKING: number; + DOWNLOADING: number; + IDLE: number; + OBSOLETE: number; + UNCACHED: number; + UPDATEREADY: number; + addEventListener(type: "cached", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "checking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "downloading", listener: (ev: Event) => any, useCapture?: boolean): void; addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLElement: { - prototype: HTMLElement; - new(): HTMLElement; + addEventListener(type: "noupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "obsolete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "updateready", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface Document extends Node, NodeSelector, MSEventAttachmentTarget, DocumentEvent, MSResourceMetadata, MSNodeExtensions, MSDocumentExtensions, GlobalEventHandlers { +declare var ApplicationCache: { + prototype: ApplicationCache; + new(): ApplicationCache; + CHECKING: number; + DOWNLOADING: number; + IDLE: number; + OBSOLETE: number; + UNCACHED: number; + UPDATEREADY: number; +} + +interface AriaRequestEvent extends Event { + attributeName: string; + attributeValue: string; +} + +declare var AriaRequestEvent: { + prototype: AriaRequestEvent; + new(type: string, eventInitDict?: AriaRequestEventInit): AriaRequestEvent; +} + +interface Attr extends Node { + name: string; + ownerElement: Element; + specified: boolean; + value: string; +} + +declare var Attr: { + prototype: Attr; + new(): Attr; +} + +interface AudioBuffer { + duration: number; + length: number; + numberOfChannels: number; + sampleRate: number; + getChannelData(channel: number): any; +} + +declare var AudioBuffer: { + prototype: AudioBuffer; + new(): AudioBuffer; +} + +interface AudioBufferSourceNode extends AudioNode { + buffer: AudioBuffer; + loop: boolean; + loopEnd: number; + loopStart: number; + onended: (ev: Event) => any; + playbackRate: AudioParam; + start(when?: number, offset?: number, duration?: number): void; + stop(when?: number): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var AudioBufferSourceNode: { + prototype: AudioBufferSourceNode; + new(): AudioBufferSourceNode; +} + +interface AudioContext extends EventTarget { + currentTime: number; + destination: AudioDestinationNode; + listener: AudioListener; + sampleRate: number; + createAnalyser(): AnalyserNode; + createBiquadFilter(): BiquadFilterNode; + createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer; + createBufferSource(): AudioBufferSourceNode; + createChannelMerger(numberOfInputs?: number): ChannelMergerNode; + createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode; + createConvolver(): ConvolverNode; + createDelay(maxDelayTime?: number): DelayNode; + createDynamicsCompressor(): DynamicsCompressorNode; + createGain(): GainNode; + createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode; + createOscillator(): OscillatorNode; + createPanner(): PannerNode; + createPeriodicWave(real: any, imag: any): PeriodicWave; + createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode; + createStereoPanner(): StereoPannerNode; + createWaveShaper(): WaveShaperNode; + decodeAudioData(audioData: ArrayBuffer, successCallback: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): void; +} + +declare var AudioContext: { + prototype: AudioContext; + new(): AudioContext; +} + +interface AudioDestinationNode extends AudioNode { + maxChannelCount: number; +} + +declare var AudioDestinationNode: { + prototype: AudioDestinationNode; + new(): AudioDestinationNode; +} + +interface AudioListener { + dopplerFactor: number; + speedOfSound: number; + setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void; + setPosition(x: number, y: number, z: number): void; + setVelocity(x: number, y: number, z: number): void; +} + +declare var AudioListener: { + prototype: AudioListener; + new(): AudioListener; +} + +interface AudioNode extends EventTarget { + channelCount: number; + channelCountMode: string; + channelInterpretation: string; + context: AudioContext; + numberOfInputs: number; + numberOfOutputs: number; + connect(destination: AudioNode, output?: number, input?: number): void; + disconnect(output?: number): void; +} + +declare var AudioNode: { + prototype: AudioNode; + new(): AudioNode; +} + +interface AudioParam { + defaultValue: number; + value: number; + cancelScheduledValues(startTime: number): void; + exponentialRampToValueAtTime(value: number, endTime: number): void; + linearRampToValueAtTime(value: number, endTime: number): void; + setTargetAtTime(target: number, startTime: number, timeConstant: number): void; + setValueAtTime(value: number, startTime: number): void; + setValueCurveAtTime(values: any, startTime: number, duration: number): void; +} + +declare var AudioParam: { + prototype: AudioParam; + new(): AudioParam; +} + +interface AudioProcessingEvent extends Event { + inputBuffer: AudioBuffer; + outputBuffer: AudioBuffer; + playbackTime: number; +} + +declare var AudioProcessingEvent: { + prototype: AudioProcessingEvent; + new(): AudioProcessingEvent; +} + +interface AudioTrack { + enabled: boolean; + id: string; + kind: string; + label: string; + language: string; + sourceBuffer: SourceBuffer; +} + +declare var AudioTrack: { + prototype: AudioTrack; + new(): AudioTrack; +} + +interface AudioTrackList extends EventTarget { + length: number; + onaddtrack: (ev: TrackEvent) => any; + onchange: (ev: Event) => any; + onremovetrack: (ev: TrackEvent) => any; + getTrackById(id: string): AudioTrack; + item(index: number): AudioTrack; + addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "removetrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: AudioTrack; +} + +declare var AudioTrackList: { + prototype: AudioTrackList; + new(): AudioTrackList; +} + +interface BarProp { + visible: boolean; +} + +declare var BarProp: { + prototype: BarProp; + new(): BarProp; +} + +interface BeforeUnloadEvent extends Event { + returnValue: any; +} + +declare var BeforeUnloadEvent: { + prototype: BeforeUnloadEvent; + new(): BeforeUnloadEvent; +} + +interface BiquadFilterNode extends AudioNode { + Q: AudioParam; + detune: AudioParam; + frequency: AudioParam; + gain: AudioParam; + type: string; + getFrequencyResponse(frequencyHz: any, magResponse: any, phaseResponse: any): void; +} + +declare var BiquadFilterNode: { + prototype: BiquadFilterNode; + new(): BiquadFilterNode; +} + +interface Blob { + size: number; + type: string; + msClose(): void; + msDetachStream(): any; + slice(start?: number, end?: number, contentType?: string): Blob; +} + +declare var Blob: { + prototype: Blob; + new (blobParts?: any[], options?: BlobPropertyBag): Blob; +} + +interface CDATASection extends Text { +} + +declare var CDATASection: { + prototype: CDATASection; + new(): CDATASection; +} + +interface CSS { + supports(property: string, value?: string): boolean; +} +declare var CSS: CSS; + +interface CSSConditionRule extends CSSGroupingRule { + conditionText: string; +} + +declare var CSSConditionRule: { + prototype: CSSConditionRule; + new(): CSSConditionRule; +} + +interface CSSFontFaceRule extends CSSRule { + style: CSSStyleDeclaration; +} + +declare var CSSFontFaceRule: { + prototype: CSSFontFaceRule; + new(): CSSFontFaceRule; +} + +interface CSSGroupingRule extends CSSRule { + cssRules: CSSRuleList; + deleteRule(index?: number): void; + insertRule(rule: string, index?: number): number; +} + +declare var CSSGroupingRule: { + prototype: CSSGroupingRule; + new(): CSSGroupingRule; +} + +interface CSSImportRule extends CSSRule { + href: string; + media: MediaList; + styleSheet: CSSStyleSheet; +} + +declare var CSSImportRule: { + prototype: CSSImportRule; + new(): CSSImportRule; +} + +interface CSSKeyframeRule extends CSSRule { + keyText: string; + style: CSSStyleDeclaration; +} + +declare var CSSKeyframeRule: { + prototype: CSSKeyframeRule; + new(): CSSKeyframeRule; +} + +interface CSSKeyframesRule extends CSSRule { + cssRules: CSSRuleList; + name: string; + appendRule(rule: string): void; + deleteRule(rule: string): void; + findRule(rule: string): CSSKeyframeRule; +} + +declare var CSSKeyframesRule: { + prototype: CSSKeyframesRule; + new(): CSSKeyframesRule; +} + +interface CSSMediaRule extends CSSConditionRule { + media: MediaList; +} + +declare var CSSMediaRule: { + prototype: CSSMediaRule; + new(): CSSMediaRule; +} + +interface CSSNamespaceRule extends CSSRule { + namespaceURI: string; + prefix: string; +} + +declare var CSSNamespaceRule: { + prototype: CSSNamespaceRule; + new(): CSSNamespaceRule; +} + +interface CSSPageRule extends CSSRule { + pseudoClass: string; + selector: string; + selectorText: string; + style: CSSStyleDeclaration; +} + +declare var CSSPageRule: { + prototype: CSSPageRule; + new(): CSSPageRule; +} + +interface CSSRule { + cssText: string; + parentRule: CSSRule; + parentStyleSheet: CSSStyleSheet; + type: number; + CHARSET_RULE: number; + FONT_FACE_RULE: number; + IMPORT_RULE: number; + KEYFRAMES_RULE: number; + KEYFRAME_RULE: number; + MEDIA_RULE: number; + NAMESPACE_RULE: number; + PAGE_RULE: number; + STYLE_RULE: number; + SUPPORTS_RULE: number; + UNKNOWN_RULE: number; + VIEWPORT_RULE: number; +} + +declare var CSSRule: { + prototype: CSSRule; + new(): CSSRule; + CHARSET_RULE: number; + FONT_FACE_RULE: number; + IMPORT_RULE: number; + KEYFRAMES_RULE: number; + KEYFRAME_RULE: number; + MEDIA_RULE: number; + NAMESPACE_RULE: number; + PAGE_RULE: number; + STYLE_RULE: number; + SUPPORTS_RULE: number; + UNKNOWN_RULE: number; + VIEWPORT_RULE: number; +} + +interface CSSRuleList { + length: number; + item(index: number): CSSRule; + [index: number]: CSSRule; +} + +declare var CSSRuleList: { + prototype: CSSRuleList; + new(): CSSRuleList; +} + +interface CSSStyleDeclaration { + alignContent: string; + alignItems: string; + alignSelf: string; + alignmentBaseline: string; + animation: string; + animationDelay: string; + animationDirection: string; + animationDuration: string; + animationFillMode: string; + animationIterationCount: string; + animationName: string; + animationPlayState: string; + animationTimingFunction: string; + backfaceVisibility: string; + background: string; + backgroundAttachment: string; + backgroundClip: string; + backgroundColor: string; + backgroundImage: string; + backgroundOrigin: string; + backgroundPosition: string; + backgroundPositionX: string; + backgroundPositionY: string; + backgroundRepeat: string; + backgroundSize: string; + baselineShift: string; + border: string; + borderBottom: string; + borderBottomColor: string; + borderBottomLeftRadius: string; + borderBottomRightRadius: string; + borderBottomStyle: string; + borderBottomWidth: string; + borderCollapse: string; + borderColor: string; + borderImage: string; + borderImageOutset: string; + borderImageRepeat: string; + borderImageSlice: string; + borderImageSource: string; + borderImageWidth: string; + borderLeft: string; + borderLeftColor: string; + borderLeftStyle: string; + borderLeftWidth: string; + borderRadius: string; + borderRight: string; + borderRightColor: string; + borderRightStyle: string; + borderRightWidth: string; + borderSpacing: string; + borderStyle: string; + borderTop: string; + borderTopColor: string; + borderTopLeftRadius: string; + borderTopRightRadius: string; + borderTopStyle: string; + borderTopWidth: string; + borderWidth: string; + bottom: string; + boxShadow: string; + boxSizing: string; + breakAfter: string; + breakBefore: string; + breakInside: string; + captionSide: string; + clear: string; + clip: string; + clipPath: string; + clipRule: string; + color: string; + colorInterpolationFilters: string; + columnCount: any; + columnFill: string; + columnGap: any; + columnRule: string; + columnRuleColor: any; + columnRuleStyle: string; + columnRuleWidth: any; + columnSpan: string; + columnWidth: any; + columns: string; + content: string; + counterIncrement: string; + counterReset: string; + cssFloat: string; + cssText: string; + cursor: string; + direction: string; + display: string; + dominantBaseline: string; + emptyCells: string; + enableBackground: string; + fill: string; + fillOpacity: string; + fillRule: string; + filter: string; + flex: string; + flexBasis: string; + flexDirection: string; + flexFlow: string; + flexGrow: string; + flexShrink: string; + flexWrap: string; + floodColor: string; + floodOpacity: string; + font: string; + fontFamily: string; + fontFeatureSettings: string; + fontSize: string; + fontSizeAdjust: string; + fontStretch: string; + fontStyle: string; + fontVariant: string; + fontWeight: string; + glyphOrientationHorizontal: string; + glyphOrientationVertical: string; + height: string; + imeMode: string; + justifyContent: string; + kerning: string; + left: string; + length: number; + letterSpacing: string; + lightingColor: string; + lineHeight: string; + listStyle: string; + listStyleImage: string; + listStylePosition: string; + listStyleType: string; + margin: string; + marginBottom: string; + marginLeft: string; + marginRight: string; + marginTop: string; + marker: string; + markerEnd: string; + markerMid: string; + markerStart: string; + mask: string; + maxHeight: string; + maxWidth: string; + minHeight: string; + minWidth: string; + msContentZoomChaining: string; + msContentZoomLimit: string; + msContentZoomLimitMax: any; + msContentZoomLimitMin: any; + msContentZoomSnap: string; + msContentZoomSnapPoints: string; + msContentZoomSnapType: string; + msContentZooming: string; + msFlowFrom: string; + msFlowInto: string; + msFontFeatureSettings: string; + msGridColumn: any; + msGridColumnAlign: string; + msGridColumnSpan: any; + msGridColumns: string; + msGridRow: any; + msGridRowAlign: string; + msGridRowSpan: any; + msGridRows: string; + msHighContrastAdjust: string; + msHyphenateLimitChars: string; + msHyphenateLimitLines: any; + msHyphenateLimitZone: any; + msHyphens: string; + msImeAlign: string; + msOverflowStyle: string; + msScrollChaining: string; + msScrollLimit: string; + msScrollLimitXMax: any; + msScrollLimitXMin: any; + msScrollLimitYMax: any; + msScrollLimitYMin: any; + msScrollRails: string; + msScrollSnapPointsX: string; + msScrollSnapPointsY: string; + msScrollSnapType: string; + msScrollSnapX: string; + msScrollSnapY: string; + msScrollTranslation: string; + msTextCombineHorizontal: string; + msTextSizeAdjust: any; + msTouchAction: string; + msTouchSelect: string; + msUserSelect: string; + msWrapFlow: string; + msWrapMargin: any; + msWrapThrough: string; + opacity: string; + order: string; + orphans: string; + outline: string; + outlineColor: string; + outlineStyle: string; + outlineWidth: string; + overflow: string; + overflowX: string; + overflowY: string; + padding: string; + paddingBottom: string; + paddingLeft: string; + paddingRight: string; + paddingTop: string; + pageBreakAfter: string; + pageBreakBefore: string; + pageBreakInside: string; + parentRule: CSSRule; + perspective: string; + perspectiveOrigin: string; + pointerEvents: string; + position: string; + quotes: string; + right: string; + rubyAlign: string; + rubyOverhang: string; + rubyPosition: string; + stopColor: string; + stopOpacity: string; + stroke: string; + strokeDasharray: string; + strokeDashoffset: string; + strokeLinecap: string; + strokeLinejoin: string; + strokeMiterlimit: string; + strokeOpacity: string; + strokeWidth: string; + tableLayout: string; + textAlign: string; + textAlignLast: string; + textAnchor: string; + textDecoration: string; + textFillColor: string; + textIndent: string; + textJustify: string; + textKashida: string; + textKashidaSpace: string; + textOverflow: string; + textShadow: string; + textTransform: string; + textUnderlinePosition: string; + top: string; + touchAction: string; + transform: string; + transformOrigin: string; + transformStyle: string; + transition: string; + transitionDelay: string; + transitionDuration: string; + transitionProperty: string; + transitionTimingFunction: string; + unicodeBidi: string; + verticalAlign: string; + visibility: string; + webkitAlignContent: string; + webkitAlignItems: string; + webkitAlignSelf: string; + webkitAnimation: string; + webkitAnimationDelay: string; + webkitAnimationDirection: string; + webkitAnimationDuration: string; + webkitAnimationFillMode: string; + webkitAnimationIterationCount: string; + webkitAnimationName: string; + webkitAnimationPlayState: string; + webkitAnimationTimingFunction: string; + webkitAppearance: string; + webkitBackfaceVisibility: string; + webkitBackground: string; + webkitBackgroundAttachment: string; + webkitBackgroundClip: string; + webkitBackgroundColor: string; + webkitBackgroundImage: string; + webkitBackgroundOrigin: string; + webkitBackgroundPosition: string; + webkitBackgroundPositionX: string; + webkitBackgroundPositionY: string; + webkitBackgroundRepeat: string; + webkitBackgroundSize: string; + webkitBorderBottomLeftRadius: string; + webkitBorderBottomRightRadius: string; + webkitBorderImage: string; + webkitBorderImageOutset: string; + webkitBorderImageRepeat: string; + webkitBorderImageSlice: string; + webkitBorderImageSource: string; + webkitBorderImageWidth: string; + webkitBorderRadius: string; + webkitBorderTopLeftRadius: string; + webkitBorderTopRightRadius: string; + webkitBoxAlign: string; + webkitBoxDirection: string; + webkitBoxFlex: string; + webkitBoxOrdinalGroup: string; + webkitBoxOrient: string; + webkitBoxPack: string; + webkitBoxSizing: string; + webkitColumnBreakAfter: string; + webkitColumnBreakBefore: string; + webkitColumnBreakInside: string; + webkitColumnCount: any; + webkitColumnGap: any; + webkitColumnRule: string; + webkitColumnRuleColor: any; + webkitColumnRuleStyle: string; + webkitColumnRuleWidth: any; + webkitColumnSpan: string; + webkitColumnWidth: any; + webkitColumns: string; + webkitFilter: string; + webkitFlex: string; + webkitFlexBasis: string; + webkitFlexDirection: string; + webkitFlexFlow: string; + webkitFlexGrow: string; + webkitFlexShrink: string; + webkitFlexWrap: string; + webkitJustifyContent: string; + webkitOrder: string; + webkitPerspective: string; + webkitPerspectiveOrigin: string; + webkitTapHighlightColor: string; + webkitTextFillColor: string; + webkitTextSizeAdjust: any; + webkitTransform: string; + webkitTransformOrigin: string; + webkitTransformStyle: string; + webkitTransition: string; + webkitTransitionDelay: string; + webkitTransitionDuration: string; + webkitTransitionProperty: string; + webkitTransitionTimingFunction: string; + webkitUserSelect: string; + webkitWritingMode: string; + whiteSpace: string; + widows: string; + width: string; + wordBreak: string; + wordSpacing: string; + wordWrap: string; + writingMode: string; + zIndex: string; + zoom: string; + getPropertyPriority(propertyName: string): string; + getPropertyValue(propertyName: string): string; + item(index: number): string; + removeProperty(propertyName: string): string; + setProperty(propertyName: string, value: string, priority?: string): void; + [index: number]: string; +} + +declare var CSSStyleDeclaration: { + prototype: CSSStyleDeclaration; + new(): CSSStyleDeclaration; +} + +interface CSSStyleRule extends CSSRule { + readOnly: boolean; + selectorText: string; + style: CSSStyleDeclaration; +} + +declare var CSSStyleRule: { + prototype: CSSStyleRule; + new(): CSSStyleRule; +} + +interface CSSStyleSheet extends StyleSheet { + cssRules: CSSRuleList; + cssText: string; + href: string; + id: string; + imports: StyleSheetList; + isAlternate: boolean; + isPrefAlternate: boolean; + ownerRule: CSSRule; + owningElement: Element; + pages: StyleSheetPageList; + readOnly: boolean; + rules: CSSRuleList; + addImport(bstrURL: string, lIndex?: number): number; + addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; + addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number; + deleteRule(index?: number): void; + insertRule(rule: string, index?: number): number; + removeImport(lIndex: number): void; + removeRule(lIndex: number): void; +} + +declare var CSSStyleSheet: { + prototype: CSSStyleSheet; + new(): CSSStyleSheet; +} + +interface CSSSupportsRule extends CSSConditionRule { +} + +declare var CSSSupportsRule: { + prototype: CSSSupportsRule; + new(): CSSSupportsRule; +} + +interface CanvasGradient { + addColorStop(offset: number, color: string): void; +} + +declare var CanvasGradient: { + prototype: CanvasGradient; + new(): CanvasGradient; +} + +interface CanvasPattern { +} + +declare var CanvasPattern: { + prototype: CanvasPattern; + new(): CanvasPattern; +} + +interface CanvasRenderingContext2D { + canvas: HTMLCanvasElement; + fillStyle: any; + font: string; + globalAlpha: number; + globalCompositeOperation: string; + lineCap: string; + lineDashOffset: number; + lineJoin: string; + lineWidth: number; + miterLimit: number; + msFillRule: string; + msImageSmoothingEnabled: boolean; + shadowBlur: number; + shadowColor: string; + shadowOffsetX: number; + shadowOffsetY: number; + strokeStyle: any; + textAlign: string; + textBaseline: string; + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; + arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; + beginPath(): void; + bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; + clearRect(x: number, y: number, w: number, h: number): void; + clip(fillRule?: string): void; + closePath(): void; + createImageData(imageDataOrSw: number, sh?: number): ImageData; + createImageData(imageDataOrSw: ImageData, sh?: number): ImageData; + createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; + createPattern(image: HTMLImageElement, repetition: string): CanvasPattern; + createPattern(image: HTMLCanvasElement, repetition: string): CanvasPattern; + createPattern(image: HTMLVideoElement, repetition: string): CanvasPattern; + createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; + drawImage(image: HTMLImageElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; + drawImage(image: HTMLCanvasElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; + drawImage(image: HTMLVideoElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; + fill(fillRule?: string): void; + fillRect(x: number, y: number, w: number, h: number): void; + fillText(text: string, x: number, y: number, maxWidth?: number): void; + getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; + getLineDash(): number[]; + isPointInPath(x: number, y: number, fillRule?: string): boolean; + lineTo(x: number, y: number): void; + measureText(text: string): TextMetrics; + moveTo(x: number, y: number): void; + putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void; + quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; + rect(x: number, y: number, w: number, h: number): void; + restore(): void; + rotate(angle: number): void; + save(): void; + scale(x: number, y: number): void; + setLineDash(segments: number[]): void; + setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; + stroke(): void; + strokeRect(x: number, y: number, w: number, h: number): void; + strokeText(text: string, x: number, y: number, maxWidth?: number): void; + transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; + translate(x: number, y: number): void; +} + +declare var CanvasRenderingContext2D: { + prototype: CanvasRenderingContext2D; + new(): CanvasRenderingContext2D; +} + +interface ChannelMergerNode extends AudioNode { +} + +declare var ChannelMergerNode: { + prototype: ChannelMergerNode; + new(): ChannelMergerNode; +} + +interface ChannelSplitterNode extends AudioNode { +} + +declare var ChannelSplitterNode: { + prototype: ChannelSplitterNode; + new(): ChannelSplitterNode; +} + +interface CharacterData extends Node, ChildNode { + data: string; + length: number; + appendData(arg: string): void; + deleteData(offset: number, count: number): void; + insertData(offset: number, arg: string): void; + replaceData(offset: number, count: number, arg: string): void; + substringData(offset: number, count: number): string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var CharacterData: { + prototype: CharacterData; + new(): CharacterData; +} + +interface ClientRect { + bottom: number; + height: number; + left: number; + right: number; + top: number; + width: number; +} + +declare var ClientRect: { + prototype: ClientRect; + new(): ClientRect; +} + +interface ClientRectList { + length: number; + item(index: number): ClientRect; + [index: number]: ClientRect; +} + +declare var ClientRectList: { + prototype: ClientRectList; + new(): ClientRectList; +} + +interface ClipboardEvent extends Event { + clipboardData: DataTransfer; +} + +declare var ClipboardEvent: { + prototype: ClipboardEvent; + new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent; +} + +interface CloseEvent extends Event { + code: number; + reason: string; + wasClean: boolean; + initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; +} + +declare var CloseEvent: { + prototype: CloseEvent; + new(): CloseEvent; +} + +interface CommandEvent extends Event { + commandName: string; + detail: string; +} + +declare var CommandEvent: { + prototype: CommandEvent; + new(type: string, eventInitDict?: CommandEventInit): CommandEvent; +} + +interface Comment extends CharacterData { + text: string; +} + +declare var Comment: { + prototype: Comment; + new(): Comment; +} + +interface CompositionEvent extends UIEvent { + data: string; + locale: string; + initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void; +} + +declare var CompositionEvent: { + prototype: CompositionEvent; + new(typeArg: string, eventInitDict?: CompositionEventInit): CompositionEvent; +} + +interface Console { + assert(test?: boolean, message?: string, ...optionalParams: any[]): void; + clear(): void; + count(countTitle?: string): void; + debug(message?: string, ...optionalParams: any[]): void; + dir(value?: any, ...optionalParams: any[]): void; + dirxml(value: any): void; + error(message?: any, ...optionalParams: any[]): void; + group(groupTitle?: string): void; + groupCollapsed(groupTitle?: string): void; + groupEnd(): void; + info(message?: any, ...optionalParams: any[]): void; + log(message?: any, ...optionalParams: any[]): void; + msIsIndependentlyComposed(element: Element): boolean; + profile(reportName?: string): void; + profileEnd(): void; + select(element: Element): void; + time(timerName?: string): void; + timeEnd(timerName?: string): void; + trace(): void; + warn(message?: any, ...optionalParams: any[]): void; +} + +declare var Console: { + prototype: Console; + new(): Console; +} + +interface ConvolverNode extends AudioNode { + buffer: AudioBuffer; + normalize: boolean; +} + +declare var ConvolverNode: { + prototype: ConvolverNode; + new(): ConvolverNode; +} + +interface Coordinates { + accuracy: number; + altitude: number; + altitudeAccuracy: number; + heading: number; + latitude: number; + longitude: number; + speed: number; +} + +declare var Coordinates: { + prototype: Coordinates; + new(): Coordinates; +} + +interface Crypto extends Object, RandomSource { + subtle: SubtleCrypto; +} + +declare var Crypto: { + prototype: Crypto; + new(): Crypto; +} + +interface CryptoKey { + algorithm: KeyAlgorithm; + extractable: boolean; + type: string; + usages: string[]; +} + +declare var CryptoKey: { + prototype: CryptoKey; + new(): CryptoKey; +} + +interface CryptoKeyPair { + privateKey: CryptoKey; + publicKey: CryptoKey; +} + +declare var CryptoKeyPair: { + prototype: CryptoKeyPair; + new(): CryptoKeyPair; +} + +interface CustomEvent extends Event { + detail: any; + initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void; +} + +declare var CustomEvent: { + prototype: CustomEvent; + new(typeArg: string, eventInitDict?: CustomEventInit): CustomEvent; +} + +interface DOMError { + name: string; + toString(): string; +} + +declare var DOMError: { + prototype: DOMError; + new(): DOMError; +} + +interface DOMException { + code: number; + message: string; + name: string; + toString(): string; + ABORT_ERR: number; + DATA_CLONE_ERR: number; + DOMSTRING_SIZE_ERR: number; + HIERARCHY_REQUEST_ERR: number; + INDEX_SIZE_ERR: number; + INUSE_ATTRIBUTE_ERR: number; + INVALID_ACCESS_ERR: number; + INVALID_CHARACTER_ERR: number; + INVALID_MODIFICATION_ERR: number; + INVALID_NODE_TYPE_ERR: number; + INVALID_STATE_ERR: number; + NAMESPACE_ERR: number; + NETWORK_ERR: number; + NOT_FOUND_ERR: number; + NOT_SUPPORTED_ERR: number; + NO_DATA_ALLOWED_ERR: number; + NO_MODIFICATION_ALLOWED_ERR: number; + PARSE_ERR: number; + QUOTA_EXCEEDED_ERR: number; + SECURITY_ERR: number; + SERIALIZE_ERR: number; + SYNTAX_ERR: number; + TIMEOUT_ERR: number; + TYPE_MISMATCH_ERR: number; + URL_MISMATCH_ERR: number; + VALIDATION_ERR: number; + WRONG_DOCUMENT_ERR: number; +} + +declare var DOMException: { + prototype: DOMException; + new(): DOMException; + ABORT_ERR: number; + DATA_CLONE_ERR: number; + DOMSTRING_SIZE_ERR: number; + HIERARCHY_REQUEST_ERR: number; + INDEX_SIZE_ERR: number; + INUSE_ATTRIBUTE_ERR: number; + INVALID_ACCESS_ERR: number; + INVALID_CHARACTER_ERR: number; + INVALID_MODIFICATION_ERR: number; + INVALID_NODE_TYPE_ERR: number; + INVALID_STATE_ERR: number; + NAMESPACE_ERR: number; + NETWORK_ERR: number; + NOT_FOUND_ERR: number; + NOT_SUPPORTED_ERR: number; + NO_DATA_ALLOWED_ERR: number; + NO_MODIFICATION_ALLOWED_ERR: number; + PARSE_ERR: number; + QUOTA_EXCEEDED_ERR: number; + SECURITY_ERR: number; + SERIALIZE_ERR: number; + SYNTAX_ERR: number; + TIMEOUT_ERR: number; + TYPE_MISMATCH_ERR: number; + URL_MISMATCH_ERR: number; + VALIDATION_ERR: number; + WRONG_DOCUMENT_ERR: number; +} + +interface DOMImplementation { + createDocument(namespaceURI: string, qualifiedName: string, doctype: DocumentType): Document; + createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; + createHTMLDocument(title: string): Document; + hasFeature(feature: string, version: string): boolean; +} + +declare var DOMImplementation: { + prototype: DOMImplementation; + new(): DOMImplementation; +} + +interface DOMParser { + parseFromString(source: string, mimeType: string): Document; +} + +declare var DOMParser: { + prototype: DOMParser; + new(): DOMParser; +} + +interface DOMSettableTokenList extends DOMTokenList { + value: string; +} + +declare var DOMSettableTokenList: { + prototype: DOMSettableTokenList; + new(): DOMSettableTokenList; +} + +interface DOMStringList { + length: number; + contains(str: string): boolean; + item(index: number): string; + [index: number]: string; +} + +declare var DOMStringList: { + prototype: DOMStringList; + new(): DOMStringList; +} + +interface DOMStringMap { + [name: string]: string; +} + +declare var DOMStringMap: { + prototype: DOMStringMap; + new(): DOMStringMap; +} + +interface DOMTokenList { + length: number; + add(...token: string[]): void; + contains(token: string): boolean; + item(index: number): string; + remove(...token: string[]): void; + toString(): string; + toggle(token: string, force?: boolean): boolean; + [index: number]: string; +} + +declare var DOMTokenList: { + prototype: DOMTokenList; + new(): DOMTokenList; +} + +interface DataCue extends TextTrackCue { + data: ArrayBuffer; +} + +declare var DataCue: { + prototype: DataCue; + new(): DataCue; +} + +interface DataTransfer { + dropEffect: string; + effectAllowed: string; + files: FileList; + items: DataTransferItemList; + types: DOMStringList; + clearData(format?: string): boolean; + getData(format: string): string; + setData(format: string, data: string): boolean; +} + +declare var DataTransfer: { + prototype: DataTransfer; + new(): DataTransfer; +} + +interface DataTransferItem { + kind: string; + type: string; + getAsFile(): File; + getAsString(_callback: FunctionStringCallback): void; +} + +declare var DataTransferItem: { + prototype: DataTransferItem; + new(): DataTransferItem; +} + +interface DataTransferItemList { + length: number; + add(data: File): DataTransferItem; + clear(): void; + item(index: number): File; + remove(index: number): void; + [index: number]: File; +} + +declare var DataTransferItemList: { + prototype: DataTransferItemList; + new(): DataTransferItemList; +} + +interface DeferredPermissionRequest { + id: number; + type: string; + uri: string; + allow(): void; + deny(): void; +} + +declare var DeferredPermissionRequest: { + prototype: DeferredPermissionRequest; + new(): DeferredPermissionRequest; +} + +interface DelayNode extends AudioNode { + delayTime: AudioParam; +} + +declare var DelayNode: { + prototype: DelayNode; + new(): DelayNode; +} + +interface DeviceAcceleration { + x: number; + y: number; + z: number; +} + +declare var DeviceAcceleration: { + prototype: DeviceAcceleration; + new(): DeviceAcceleration; +} + +interface DeviceMotionEvent extends Event { + acceleration: DeviceAcceleration; + accelerationIncludingGravity: DeviceAcceleration; + interval: number; + rotationRate: DeviceRotationRate; + initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict, accelerationIncludingGravity: DeviceAccelerationDict, rotationRate: DeviceRotationRateDict, interval: number): void; +} + +declare var DeviceMotionEvent: { + prototype: DeviceMotionEvent; + new(): DeviceMotionEvent; +} + +interface DeviceOrientationEvent extends Event { + absolute: boolean; + alpha: number; + beta: number; + gamma: number; + initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number, beta: number, gamma: number, absolute: boolean): void; +} + +declare var DeviceOrientationEvent: { + prototype: DeviceOrientationEvent; + new(): DeviceOrientationEvent; +} + +interface DeviceRotationRate { + alpha: number; + beta: number; + gamma: number; +} + +declare var DeviceRotationRate: { + prototype: DeviceRotationRate; + new(): DeviceRotationRate; +} + +interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEvent { /** - * Gets a reference to the root node of the document. + * Sets or gets the URL for the current document. */ - documentElement: HTMLElement; + URL: string; /** - * Retrieves the collection of user agents and versions declared in the X-UA-Compatible + * Gets the URL for the document, stripped of any character encoding. */ - compatible: MSCompatibleInfoCollection; + URLUnencoded: string; /** - * Fires when the user presses a key. - * @param ev The keyboard event + * Gets the object that has the focus when the parent document has focus. */ - onkeydown: (ev: KeyboardEvent) => any; + activeElement: Element; /** - * Fires when the user releases a key. - * @param ev The keyboard event + * Sets or gets the color of all active links in the document. */ - onkeyup: (ev: KeyboardEvent) => any; - /** - * Gets the implementation object of the current document. - */ - implementation: DOMImplementation; - /** - * Fires when the user resets a form. - * @param ev The event. - */ - onreset: (ev: Event) => any; - /** - * Retrieves a collection of all script objects in the document. - */ - scripts: HTMLCollection; - /** - * Fires when the user presses the F1 key while the browser is the active window. - * @param ev The event. - */ - onhelp: (ev: Event) => any; - /** - * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. - * @param ev The drag event. - */ - ondragleave: (ev: DragEvent) => any; - /** - * Gets or sets the character set used to encode the object. - */ - charset: string; - /** - * Fires for an element just prior to setting focus on that element. - * @param ev The focus event - */ - onfocusin: (ev: FocusEvent) => any; - /** - * Sets or gets the color of the links that the user has visited. - */ - vlinkColor: string; - /** - * Occurs when the seek operation ends. - * @param ev The event. - */ - onseeked: (ev: Event) => any; - security: string; - /** - * Contains the title of the document. - */ - title: string; - /** - * Retrieves a collection of namespace objects. - */ - namespaces: MSNamespaceInfoCollection; - /** - * Gets the default character set from the current regional language settings. - */ - defaultCharset: string; - /** - * Retrieves a collection of all embed objects in the document. - */ - embeds: HTMLCollection; - /** - * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. - */ - styleSheets: StyleSheetList; - /** - * Retrieves a collection of all window objects defined by the given document or defined by the document associated with the given window. - */ - frames: Window; - /** - * Occurs when the duration attribute is updated. - * @param ev The event. - */ - ondurationchange: (ev: Event) => any; + alinkColor: string; /** * Returns a reference to the collection of elements contained by the object. */ all: HTMLCollection; + /** + * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. + */ + anchors: HTMLCollection; + /** + * Retrieves a collection of all applet objects in the document. + */ + applets: HTMLCollection; + /** + * Deprecated. Sets or retrieves a value that indicates the background color behind the object. + */ + bgColor: string; + /** + * Specifies the beginning and end of the document body. + */ + body: HTMLElement; + characterSet: string; + /** + * Gets or sets the character set used to encode the object. + */ + charset: string; + /** + * Gets a value that indicates whether standards-compliant mode is switched on for the object. + */ + compatMode: string; + cookie: string; + /** + * Gets the default character set from the current regional language settings. + */ + defaultCharset: string; + defaultView: Window; + /** + * Sets or gets a value that indicates whether the document can be edited. + */ + designMode: string; + /** + * Sets or retrieves a value that indicates the reading order of the object. + */ + dir: string; + /** + * Gets an object representing the document type declaration associated with the current document. + */ + doctype: DocumentType; + /** + * Gets a reference to the root node of the document. + */ + documentElement: HTMLElement; + /** + * Sets or gets the security domain of the document. + */ + domain: string; + /** + * Retrieves a collection of all embed objects in the document. + */ + embeds: HTMLCollection; + /** + * Sets or gets the foreground (text) color of the document. + */ + fgColor: string; /** * Retrieves a collection, in source order, of all form objects in the document. */ forms: HTMLCollection; + fullscreenElement: Element; + fullscreenEnabled: boolean; + head: HTMLHeadElement; + hidden: boolean; + /** + * Retrieves a collection, in source order, of img objects in the document. + */ + images: HTMLCollection; + /** + * Gets the implementation object of the current document. + */ + implementation: DOMImplementation; + /** + * Returns the character encoding used to create the webpage that is loaded into the document object. + */ + inputEncoding: string; + /** + * Gets the date that the page was last modified, if the page supplies one. + */ + lastModified: string; + /** + * Sets or gets the color of the document links. + */ + linkColor: string; + /** + * Retrieves a collection of all a objects that specify the href property and all area objects in the document. + */ + links: HTMLCollection; + /** + * Contains information about the current URL. + */ + location: Location; + media: string; + msCSSOMElementFloatMetrics: boolean; + msCapsLockWarningOff: boolean; + msHidden: boolean; + msVisibilityState: string; + /** + * Fires when the user aborts the download. + * @param ev The event. + */ + onabort: (ev: Event) => any; + /** + * Fires when the object is set as the active element. + * @param ev The event. + */ + onactivate: (ev: UIEvent) => any; + /** + * Fires immediately before the object is set as the active element. + * @param ev The event. + */ + onbeforeactivate: (ev: UIEvent) => any; + /** + * Fires immediately before the activeElement is changed from the current object to another object in the parent document. + * @param ev The event. + */ + onbeforedeactivate: (ev: UIEvent) => any; /** * Fires when the object loses the input focus. * @param ev The focus event. */ onblur: (ev: FocusEvent) => any; - /** - * Sets or retrieves a value that indicates the reading order of the object. - */ - dir: string; - /** - * Occurs when the media element is reset to its initial state. - * @param ev The event. - */ - onemptied: (ev: Event) => any; - /** - * Sets or gets a value that indicates whether the document can be edited. - */ - designMode: string; - /** - * Occurs when the current playback position is moved. - * @param ev The event. - */ - onseeking: (ev: Event) => any; - /** - * Fires when the activeElement is changed from the current object to another object in the parent document. - * @param ev The UI Event - */ - ondeactivate: (ev: UIEvent) => any; /** * Occurs when playback is possible, but would require further buffering. * @param ev The event. */ oncanplay: (ev: Event) => any; - /** - * Fires when the data set exposed by a data source object changes. - * @param ev The event. - */ - ondatasetchanged: (ev: MSEventObj) => any; - /** - * Fires when rows are about to be deleted from the recordset. - * @param ev The event - */ - onrowsdelete: (ev: MSEventObj) => any; - Script: MSScriptHost; - /** - * Occurs when Internet Explorer begins looking for media data. - * @param ev The event. - */ - onloadstart: (ev: Event) => any; - /** - * Gets the URL for the document, stripped of any character encoding. - */ - URLUnencoded: string; - defaultView: Window; - /** - * Fires when the user is about to make a control selection of the object. - * @param ev The event. - */ - oncontrolselect: (ev: MSEventObj) => any; - /** - * Fires on the target element when the user drags the object to a valid drop target. - * @param ev The drag event. - */ - ondragenter: (ev: DragEvent) => any; - onsubmit: (ev: Event) => any; - /** - * Returns the character encoding used to create the webpage that is loaded into the document object. - */ - inputEncoding: string; - /** - * Gets the object that has the focus when the parent document has focus. - */ - activeElement: Element; + oncanplaythrough: (ev: Event) => any; /** * Fires when the contents of the object or selection have changed. * @param ev The event. */ onchange: (ev: Event) => any; /** - * Retrieves a collection of all a objects that specify the href property and all area objects in the document. + * Fires when the user clicks the left mouse button on the object + * @param ev The mouse event. */ - links: HTMLCollection; + onclick: (ev: MouseEvent) => any; /** - * Retrieves an autogenerated, unique identifier for the object. + * Fires when the user clicks the right mouse button in the client area, opening the context menu. + * @param ev The mouse event. */ - uniqueID: string; + oncontextmenu: (ev: PointerEvent) => any; /** - * Sets or gets the URL for the current document. + * Fires when the user double-clicks the object. + * @param ev The mouse event. */ - URL: string; + ondblclick: (ev: MouseEvent) => any; /** - * Fires immediately before the object is set as the active element. + * Fires when the activeElement is changed from the current object to another object in the parent document. + * @param ev The UI Event + */ + ondeactivate: (ev: UIEvent) => any; + /** + * Fires on the source object continuously during a drag operation. * @param ev The event. */ - onbeforeactivate: (ev: UIEvent) => any; - head: HTMLHeadElement; - cookie: string; - xmlEncoding: string; - oncanplaythrough: (ev: Event) => any; - /** - * Retrieves the document compatibility mode of the document. - */ - documentMode: number; - characterSet: string; + ondrag: (ev: DragEvent) => any; /** - * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. - */ - anchors: HTMLCollection; - onbeforeupdate: (ev: MSEventObj) => any; - /** - * Fires to indicate that all data is available from the data source object. + * Fires on the source object when the user releases the mouse at the close of a drag operation. * @param ev The event. */ - ondatasetcomplete: (ev: MSEventObj) => any; - plugins: HTMLCollection; + ondragend: (ev: DragEvent) => any; + /** + * Fires on the target element when the user drags the object to a valid drop target. + * @param ev The drag event. + */ + ondragenter: (ev: DragEvent) => any; + /** + * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. + * @param ev The drag event. + */ + ondragleave: (ev: DragEvent) => any; + /** + * Fires on the target element continuously while the user drags the object over a valid drop target. + * @param ev The event. + */ + ondragover: (ev: DragEvent) => any; + /** + * Fires on the source object when the user starts to drag a text selection or selected object. + * @param ev The event. + */ + ondragstart: (ev: DragEvent) => any; + ondrop: (ev: DragEvent) => any; + /** + * Occurs when the duration attribute is updated. + * @param ev The event. + */ + ondurationchange: (ev: Event) => any; + /** + * Occurs when the media element is reset to its initial state. + * @param ev The event. + */ + onemptied: (ev: Event) => any; + /** + * Occurs when the end of playback is reached. + * @param ev The event + */ + onended: (ev: Event) => any; + /** + * Fires when an error occurs during object loading. + * @param ev The event. + */ + onerror: (ev: Event) => any; + /** + * Fires when the object receives focus. + * @param ev The event. + */ + onfocus: (ev: FocusEvent) => any; + onfullscreenchange: (ev: Event) => any; + onfullscreenerror: (ev: Event) => any; + oninput: (ev: Event) => any; + /** + * Fires when the user presses a key. + * @param ev The keyboard event + */ + onkeydown: (ev: KeyboardEvent) => any; + /** + * Fires when the user presses an alphanumeric key. + * @param ev The event. + */ + onkeypress: (ev: KeyboardEvent) => any; + /** + * Fires when the user releases a key. + * @param ev The keyboard event + */ + onkeyup: (ev: KeyboardEvent) => any; + /** + * Fires immediately after the browser loads the object. + * @param ev The event. + */ + onload: (ev: Event) => any; + /** + * Occurs when media data is loaded at the current playback position. + * @param ev The event. + */ + onloadeddata: (ev: Event) => any; + /** + * Occurs when the duration and dimensions of the media have been determined. + * @param ev The event. + */ + onloadedmetadata: (ev: Event) => any; + /** + * Occurs when Internet Explorer begins looking for media data. + * @param ev The event. + */ + onloadstart: (ev: Event) => any; + /** + * Fires when the user clicks the object with either mouse button. + * @param ev The mouse event. + */ + onmousedown: (ev: MouseEvent) => any; + /** + * Fires when the user moves the mouse over the object. + * @param ev The mouse event. + */ + onmousemove: (ev: MouseEvent) => any; + /** + * Fires when the user moves the mouse pointer outside the boundaries of the object. + * @param ev The mouse event. + */ + onmouseout: (ev: MouseEvent) => any; + /** + * Fires when the user moves the mouse pointer into the object. + * @param ev The mouse event. + */ + onmouseover: (ev: MouseEvent) => any; + /** + * Fires when the user releases a mouse button while the mouse is over the object. + * @param ev The mouse event. + */ + onmouseup: (ev: MouseEvent) => any; + /** + * Fires when the wheel button is rotated. + * @param ev The mouse event + */ + onmousewheel: (ev: MouseWheelEvent) => any; + onmscontentzoom: (ev: UIEvent) => any; + onmsgesturechange: (ev: MSGestureEvent) => any; + onmsgesturedoubletap: (ev: MSGestureEvent) => any; + onmsgestureend: (ev: MSGestureEvent) => any; + onmsgesturehold: (ev: MSGestureEvent) => any; + onmsgesturestart: (ev: MSGestureEvent) => any; + onmsgesturetap: (ev: MSGestureEvent) => any; + onmsinertiastart: (ev: MSGestureEvent) => any; + onmsmanipulationstatechanged: (ev: MSManipulationEvent) => any; + onmspointercancel: (ev: MSPointerEvent) => any; + onmspointerdown: (ev: MSPointerEvent) => any; + onmspointerenter: (ev: MSPointerEvent) => any; + onmspointerleave: (ev: MSPointerEvent) => any; + onmspointermove: (ev: MSPointerEvent) => any; + onmspointerout: (ev: MSPointerEvent) => any; + onmspointerover: (ev: MSPointerEvent) => any; + onmspointerup: (ev: MSPointerEvent) => any; + /** + * Occurs when an item is removed from a Jump List of a webpage running in Site Mode. + * @param ev The event. + */ + onmssitemodejumplistitemremoved: (ev: MSSiteModeEvent) => any; + /** + * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode. + * @param ev The event. + */ + onmsthumbnailclick: (ev: MSSiteModeEvent) => any; + /** + * Occurs when playback is paused. + * @param ev The event. + */ + onpause: (ev: Event) => any; + /** + * Occurs when the play method is requested. + * @param ev The event. + */ + onplay: (ev: Event) => any; + /** + * Occurs when the audio or video has started playing. + * @param ev The event. + */ + onplaying: (ev: Event) => any; + onpointerlockchange: (ev: Event) => any; + onpointerlockerror: (ev: Event) => any; + /** + * Occurs to indicate progress while downloading media data. + * @param ev The event. + */ + onprogress: (ev: ProgressEvent) => any; + /** + * Occurs when the playback rate is increased or decreased. + * @param ev The event. + */ + onratechange: (ev: Event) => any; + /** + * Fires when the state of the object has changed. + * @param ev The event + */ + onreadystatechange: (ev: ProgressEvent) => any; + /** + * Fires when the user resets a form. + * @param ev The event. + */ + onreset: (ev: Event) => any; + /** + * Fires when the user repositions the scroll box in the scroll bar on the object. + * @param ev The event. + */ + onscroll: (ev: UIEvent) => any; + /** + * Occurs when the seek operation ends. + * @param ev The event. + */ + onseeked: (ev: Event) => any; + /** + * Occurs when the current playback position is moved. + * @param ev The event. + */ + onseeking: (ev: Event) => any; + /** + * Fires when the current selection changes. + * @param ev The event. + */ + onselect: (ev: UIEvent) => any; + onselectstart: (ev: Event) => any; + /** + * Occurs when the download has stopped. + * @param ev The event. + */ + onstalled: (ev: Event) => any; + /** + * Fires when the user clicks the Stop button or leaves the Web page. + * @param ev The event. + */ + onstop: (ev: Event) => any; + onsubmit: (ev: Event) => any; /** * Occurs if the load operation has been intentionally halted. * @param ev The event. */ onsuspend: (ev: Event) => any; /** - * Gets the root svg element in the document hierarchy. + * Occurs to indicate the current playback position. + * @param ev The event. */ - rootElement: SVGSVGElement; + ontimeupdate: (ev: Event) => any; + ontouchcancel: (ev: TouchEvent) => any; + ontouchend: (ev: TouchEvent) => any; + ontouchmove: (ev: TouchEvent) => any; + ontouchstart: (ev: TouchEvent) => any; + /** + * Occurs when the volume is changed, or playback is muted or unmuted. + * @param ev The event. + */ + onvolumechange: (ev: Event) => any; + /** + * Occurs when playback stops because the next frame of a video resource is not available. + * @param ev The event. + */ + onwaiting: (ev: Event) => any; + onwebkitfullscreenchange: (ev: Event) => any; + onwebkitfullscreenerror: (ev: Event) => any; + plugins: HTMLCollection; + pointerLockElement: Element; /** * Retrieves a value that indicates the current state of the object. */ @@ -2651,390 +5557,60 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document */ referrer: string; /** - * Sets or gets the color of all active links in the document. + * Gets the root svg element in the document hierarchy. */ - alinkColor: string; + rootElement: SVGSVGElement; /** - * Fires on a databound object when an error occurs while updating the associated data in the data source object. - * @param ev The event. + * Retrieves a collection of all script objects in the document. */ - onerrorupdate: (ev: MSEventObj) => any; + scripts: HTMLCollection; + security: string; /** - * Gets a reference to the container object of the window. + * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. */ - parentWindow: Window; + styleSheets: StyleSheetList; /** - * Fires when the user moves the mouse pointer outside the boundaries of the object. - * @param ev The mouse event. + * Contains the title of the document. */ - onmouseout: (ev: MouseEvent) => any; - /** - * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode. - * @param ev The event. - */ - onmsthumbnailclick: (ev: MSSiteModeEvent) => any; - /** - * Fires when the wheel button is rotated. - * @param ev The mouse event - */ - onmousewheel: (ev: MouseWheelEvent) => any; - /** - * Occurs when the volume is changed, or playback is muted or unmuted. - * @param ev The event. - */ - onvolumechange: (ev: Event) => any; + title: string; + visibilityState: string; /** - * Fires when data changes in the data provider. - * @param ev The event. + * Sets or gets the color of the links that the user has visited. */ - oncellchange: (ev: MSEventObj) => any; - /** - * Fires just before the data source control changes the current row in the object. - * @param ev The event. - */ - onrowexit: (ev: MSEventObj) => any; - /** - * Fires just after new rows are inserted in the current recordset. - * @param ev The event. - */ - onrowsinserted: (ev: MSEventObj) => any; + vlinkColor: string; + webkitCurrentFullScreenElement: Element; + webkitFullscreenElement: Element; + webkitFullscreenEnabled: boolean; + webkitIsFullScreen: boolean; + xmlEncoding: string; + xmlStandalone: boolean; /** * Gets or sets the version attribute specified in the declaration of an XML document. */ xmlVersion: string; - msCapsLockWarningOff: boolean; - /** - * Fires when a property changes on the object. - * @param ev The event. - */ - onpropertychange: (ev: MSEventObj) => any; - /** - * Fires on the source object when the user releases the mouse at the close of a drag operation. - * @param ev The event. - */ - ondragend: (ev: DragEvent) => any; - /** - * Gets an object representing the document type declaration associated with the current document. - */ - doctype: DocumentType; - /** - * Fires on the target element continuously while the user drags the object over a valid drop target. - * @param ev The event. - */ - ondragover: (ev: DragEvent) => any; - /** - * Deprecated. Sets or retrieves a value that indicates the background color behind the object. - */ - bgColor: string; - /** - * Fires on the source object when the user starts to drag a text selection or selected object. - * @param ev The event. - */ - ondragstart: (ev: DragEvent) => any; - /** - * Fires when the user releases a mouse button while the mouse is over the object. - * @param ev The mouse event. - */ - onmouseup: (ev: MouseEvent) => any; - /** - * Fires on the source object continuously during a drag operation. - * @param ev The event. - */ - ondrag: (ev: DragEvent) => any; - /** - * Fires when the user moves the mouse pointer into the object. - * @param ev The mouse event. - */ - onmouseover: (ev: MouseEvent) => any; - /** - * Sets or gets the color of the document links. - */ - linkColor: string; - /** - * Occurs when playback is paused. - * @param ev The event. - */ - onpause: (ev: Event) => any; - /** - * Fires when the user clicks the object with either mouse button. - * @param ev The mouse event. - */ - onmousedown: (ev: MouseEvent) => any; - /** - * Fires when the user clicks the left mouse button on the object - * @param ev The mouse event. - */ - onclick: (ev: MouseEvent) => any; - /** - * Occurs when playback stops because the next frame of a video resource is not available. - * @param ev The event. - */ - onwaiting: (ev: Event) => any; - /** - * Fires when the user clicks the Stop button or leaves the Web page. - * @param ev The event. - */ - onstop: (ev: Event) => any; - /** - * Occurs when an item is removed from a Jump List of a webpage running in Site Mode. - * @param ev The event. - */ - onmssitemodejumplistitemremoved: (ev: MSSiteModeEvent) => any; - /** - * Retrieves a collection of all applet objects in the document. - */ - applets: HTMLCollection; - /** - * Specifies the beginning and end of the document body. - */ - body: HTMLElement; - /** - * Sets or gets the security domain of the document. - */ - domain: string; - xmlStandalone: boolean; - /** - * Represents the active selection, which is a highlighted block of text or other elements in the document that a user or a script can carry out some action on. - */ - selection: MSSelection; - /** - * Occurs when the download has stopped. - * @param ev The event. - */ - onstalled: (ev: Event) => any; - /** - * Fires when the user moves the mouse over the object. - * @param ev The mouse event. - */ - onmousemove: (ev: MouseEvent) => any; - /** - * Fires before an object contained in an editable element enters a UI-activated state or when an editable container object is control selected. - * @param ev The event. - */ - onbeforeeditfocus: (ev: MSEventObj) => any; - /** - * Occurs when the playback rate is increased or decreased. - * @param ev The event. - */ - onratechange: (ev: Event) => any; - /** - * Occurs to indicate progress while downloading media data. - * @param ev The event. - */ - onprogress: (ev: ProgressEvent) => any; - /** - * Fires when the user double-clicks the object. - * @param ev The mouse event. - */ - ondblclick: (ev: MouseEvent) => any; - /** - * Fires when the user clicks the right mouse button in the client area, opening the context menu. - * @param ev The mouse event. - */ - oncontextmenu: (ev: MouseEvent) => any; - /** - * Occurs when the duration and dimensions of the media have been determined. - * @param ev The event. - */ - onloadedmetadata: (ev: Event) => any; - media: string; - /** - * Fires when an error occurs during object loading. - * @param ev The event. - */ - onerror: (ev: ErrorEvent) => any; - /** - * Occurs when the play method is requested. - * @param ev The event. - */ - onplay: (ev: Event) => any; - onafterupdate: (ev: MSEventObj) => any; - /** - * Occurs when the audio or video has started playing. - * @param ev The event. - */ - onplaying: (ev: Event) => any; - /** - * Retrieves a collection, in source order, of img objects in the document. - */ - images: HTMLCollection; - /** - * Contains information about the current URL. - */ - location: Location; - /** - * Fires when the user aborts the download. - * @param ev The event. - */ - onabort: (ev: UIEvent) => any; - /** - * Fires for the current element with focus immediately after moving focus to another element. - * @param ev The event. - */ - onfocusout: (ev: FocusEvent) => any; - /** - * Fires when the selection state of a document changes. - * @param ev The event. - */ - onselectionchange: (ev: Event) => any; - /** - * Fires when a local DOM Storage area is written to disk. - * @param ev The event. - */ - onstoragecommit: (ev: StorageEvent) => any; - /** - * Fires periodically as data arrives from data source objects that asynchronously transmit their data. - * @param ev The event. - */ - ondataavailable: (ev: MSEventObj) => any; - /** - * Fires when the state of the object has changed. - * @param ev The event - */ - onreadystatechange: (ev: Event) => any; - /** - * Gets the date that the page was last modified, if the page supplies one. - */ - lastModified: string; - /** - * Fires when the user presses an alphanumeric key. - * @param ev The event. - */ - onkeypress: (ev: KeyboardEvent) => any; - /** - * Occurs when media data is loaded at the current playback position. - * @param ev The event. - */ - onloadeddata: (ev: Event) => any; - /** - * Fires immediately before the activeElement is changed from the current object to another object in the parent document. - * @param ev The event. - */ - onbeforedeactivate: (ev: UIEvent) => any; - /** - * Fires when the object is set as the active element. - * @param ev The event. - */ - onactivate: (ev: UIEvent) => any; - onselectstart: (ev: Event) => any; - /** - * Fires when the object receives focus. - * @param ev The event. - */ - onfocus: (ev: FocusEvent) => any; - /** - * Sets or gets the foreground (text) color of the document. - */ - fgColor: string; - /** - * Occurs to indicate the current playback position. - * @param ev The event. - */ - ontimeupdate: (ev: Event) => any; - /** - * Fires when the current selection changes. - * @param ev The event. - */ - onselect: (ev: UIEvent) => any; - ondrop: (ev: DragEvent) => any; - /** - * Occurs when the end of playback is reached. - * @param ev The event - */ - onended: (ev: Event) => any; - /** - * Gets a value that indicates whether standards-compliant mode is switched on for the object. - */ - compatMode: string; - /** - * Fires when the user repositions the scroll box in the scroll bar on the object. - * @param ev The event. - */ - onscroll: (ev: UIEvent) => any; - /** - * Fires to indicate that the current row has changed in the data source and new data values are available on the object. - * @param ev The event. - */ - onrowenter: (ev: MSEventObj) => any; - /** - * Fires immediately after the browser loads the object. - * @param ev The event. - */ - onload: (ev: Event) => any; - oninput: (ev: Event) => any; - onmspointerdown: (ev: any) => any; - msHidden: boolean; - msVisibilityState: string; - onmsgesturedoubletap: (ev: any) => any; - visibilityState: string; - onmsmanipulationstatechanged: (ev: any) => any; - onmspointerhover: (ev: any) => any; - onmscontentzoom: (ev: MSEventObj) => any; - onmspointermove: (ev: any) => any; - onmsgesturehold: (ev: any) => any; - onmsgesturechange: (ev: any) => any; - onmsgesturestart: (ev: any) => any; - onmspointercancel: (ev: any) => any; - onmsgestureend: (ev: any) => any; - onmsgesturetap: (ev: any) => any; - onmspointerout: (ev: any) => any; - onmsinertiastart: (ev: any) => any; - msCSSOMElementFloatMetrics: boolean; - onmspointerover: (ev: any) => any; - hidden: boolean; - onmspointerup: (ev: any) => any; - msFullscreenEnabled: boolean; - onmsfullscreenerror: (ev: any) => any; - onmspointerenter: (ev: any) => any; - msFullscreenElement: Element; - onmsfullscreenchange: (ev: any) => any; - onmspointerleave: (ev: any) => any; - /** - * Returns a reference to the first object with the specified value of the ID or NAME attribute. - * @param elementId String that specifies the ID value. Case-insensitive. - */ - getElementById(elementId: string): HTMLElement; - /** - * Returns the current value of the document, range, or current selection for the given command. - * @param commandId String that specifies a command identifier. - */ - queryCommandValue(commandId: string): string; adoptNode(source: Node): Node; + captureEvents(): void; + clear(): void; /** - * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. - * @param commandId String that specifies a command identifier. + * Closes an output stream and forces the sent data to display. */ - queryCommandIndeterm(commandId: string): boolean; - getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; - createProcessingInstruction(target: string, data: string): ProcessingInstruction; + close(): void; /** - * Executes a command on the current document, current selection, or the given range. - * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. - * @param showUI Display the user interface, defaults to false. - * @param value Value to assign. + * Creates an attribute object with a specified name. + * @param name String that sets the attribute object's name. */ - execCommand(commandId: string, showUI?: boolean, value?: any): boolean; - /** - * Returns the element for the specified x coordinate and the specified y coordinate. - * @param x The x-offset - * @param y The y-offset - */ - elementFromPoint(x: number, y: number): Element; + createAttribute(name: string): Attr; + createAttributeNS(namespaceURI: string, qualifiedName: string): Attr; createCDATASection(data: string): CDATASection; /** - * Retrieves the string associated with a command. - * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers. + * Creates a comment object with the specified data. + * @param data Sets the comment object's data. */ - queryCommandText(commandId: string): string; + createComment(data: string): Comment; /** - * Writes one or more HTML expressions to a document in the specified window. - * @param content Specifies the text and HTML tags to write. + * Creates a new document. */ - write(...content: string[]): void; - /** - * Allows updating the print settings for the page. - */ - updateSettings(): void; + createDocumentFragment(): DocumentFragment; /** * Creates an instance of the element for the specified tag. * @param tagName The name of an element. @@ -3045,14 +5621,11 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document createElement(tagName: "address"): HTMLBlockElement; createElement(tagName: "applet"): HTMLAppletElement; createElement(tagName: "area"): HTMLAreaElement; - createElement(tagName: "article"): HTMLElement; - createElement(tagName: "aside"): HTMLElement; createElement(tagName: "audio"): HTMLAudioElement; createElement(tagName: "b"): HTMLPhraseElement; createElement(tagName: "base"): HTMLBaseElement; createElement(tagName: "basefont"): HTMLBaseFontElement; createElement(tagName: "bdo"): HTMLPhraseElement; - createElement(tagName: "bgsound"): HTMLBGSoundElement; createElement(tagName: "big"): HTMLPhraseElement; createElement(tagName: "blockquote"): HTMLBlockElement; createElement(tagName: "body"): HTMLBodyElement; @@ -3076,10 +5649,7 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document createElement(tagName: "em"): HTMLPhraseElement; createElement(tagName: "embed"): HTMLEmbedElement; createElement(tagName: "fieldset"): HTMLFieldSetElement; - createElement(tagName: "figcaption"): HTMLElement; - createElement(tagName: "figure"): HTMLElement; createElement(tagName: "font"): HTMLFontElement; - createElement(tagName: "footer"): HTMLElement; createElement(tagName: "form"): HTMLFormElement; createElement(tagName: "frame"): HTMLFrameElement; createElement(tagName: "frameset"): HTMLFrameSetElement; @@ -3090,8 +5660,6 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document createElement(tagName: "h5"): HTMLHeadingElement; createElement(tagName: "h6"): HTMLHeadingElement; createElement(tagName: "head"): HTMLHeadElement; - createElement(tagName: "header"): HTMLElement; - createElement(tagName: "hgroup"): HTMLElement; createElement(tagName: "hr"): HTMLHRElement; createElement(tagName: "html"): HTMLHtmlElement; createElement(tagName: "i"): HTMLPhraseElement; @@ -3108,15 +5676,11 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document createElement(tagName: "link"): HTMLLinkElement; createElement(tagName: "listing"): HTMLBlockElement; createElement(tagName: "map"): HTMLMapElement; - createElement(tagName: "mark"): HTMLElement; createElement(tagName: "marquee"): HTMLMarqueeElement; createElement(tagName: "menu"): HTMLMenuElement; createElement(tagName: "meta"): HTMLMetaElement; - createElement(tagName: "nav"): HTMLElement; createElement(tagName: "nextid"): HTMLNextIdElement; createElement(tagName: "nobr"): HTMLPhraseElement; - createElement(tagName: "noframes"): HTMLElement; - createElement(tagName: "noscript"): HTMLElement; createElement(tagName: "object"): HTMLObjectElement; createElement(tagName: "ol"): HTMLOListElement; createElement(tagName: "optgroup"): HTMLOptGroupElement; @@ -3132,10 +5696,9 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document createElement(tagName: "s"): HTMLPhraseElement; createElement(tagName: "samp"): HTMLPhraseElement; createElement(tagName: "script"): HTMLScriptElement; - createElement(tagName: "section"): HTMLElement; createElement(tagName: "select"): HTMLSelectElement; createElement(tagName: "small"): HTMLPhraseElement; - createElement(tagName: "SOURCE"): HTMLSourceElement; + createElement(tagName: "source"): HTMLSourceElement; createElement(tagName: "span"): HTMLSpanElement; createElement(tagName: "strike"): HTMLPhraseElement; createElement(tagName: "strong"): HTMLPhraseElement; @@ -3157,33 +5720,32 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document createElement(tagName: "ul"): HTMLUListElement; createElement(tagName: "var"): HTMLPhraseElement; createElement(tagName: "video"): HTMLVideoElement; - createElement(tagName: "wbr"): HTMLElement; createElement(tagName: "x-ms-webview"): MSHTMLWebViewElement; createElement(tagName: "xmp"): HTMLBlockElement; createElement(tagName: string): HTMLElement; - /** - * Removes mouse capture from the object in the current document. - */ - releaseCapture(): void; - /** - * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. - * @param content The text and HTML tags to write. - */ - writeln(...content: string[]): void; createElementNS(namespaceURI: string, qualifiedName: string): Element; + createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; + createNSResolver(nodeResolver: Node): XPathNSResolver; /** - * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. - * @param url Specifies a MIME type for the document. - * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. - * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. - * @param replace Specifies whether the existing entry for the document is replaced in the history list. + * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list + * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. + * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. */ - open(url?: string, name?: string, features?: string, replace?: boolean): any; + createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): NodeIterator; + createProcessingInstruction(target: string, data: string): ProcessingInstruction; /** - * Returns a Boolean value that indicates whether the current command is supported on the current range. - * @param commandId Specifies a command identifier. + * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. */ - queryCommandSupported(commandId: string): boolean; + createRange(): Range; + /** + * Creates a text string from the specified value. + * @param data String that specifies the nodeValue property of the text node. + */ + createTextNode(data: string): Text; + createTouch(view: any, target: EventTarget, identifier: number, pageX: number, pageY: number, screenX: number, screenY: number): Touch; + createTouchList(...touches: Touch[]): TouchList; /** * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. * @param root The root element or node to start traversing on. @@ -3191,42 +5753,500 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document * @param filter A custom NodeFilter function to use. * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. */ - createTreeWalker(root: Node, whatToShow: number, filter: NodeFilter, entityReferenceExpansion: boolean): TreeWalker; - createAttributeNS(namespaceURI: string, qualifiedName: string): Attr; + createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): TreeWalker; + /** + * Returns the element for the specified x coordinate and the specified y coordinate. + * @param x The x-offset + * @param y The y-offset + */ + elementFromPoint(x: number, y: number): Element; + evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver, type: number, result: XPathResult): XPathResult; + /** + * Executes a command on the current document, current selection, or the given range. + * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. + * @param showUI Display the user interface, defaults to false. + * @param value Value to assign. + */ + execCommand(commandId: string, showUI?: boolean, value?: any): boolean; + /** + * Displays help information for the given command identifier. + * @param commandId Displays help information for the given command identifier. + */ + execCommandShowHelp(commandId: string): boolean; + exitFullscreen(): void; + exitPointerLock(): void; + /** + * Causes the element to receive the focus and executes the code specified by the onfocus event. + */ + focus(): void; + /** + * Returns a reference to the first object with the specified value of the ID or NAME attribute. + * @param elementId String that specifies the ID value. Case-insensitive. + */ + getElementById(elementId: string): HTMLElement; + getElementsByClassName(classNames: string): NodeList; + /** + * Gets a collection of objects based on the value of the NAME or ID attribute. + * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. + */ + getElementsByName(elementName: string): NodeList; + /** + * Retrieves a collection of objects based on the specified element name. + * @param name Specifies the name of an element. + */ + getElementsByTagName(tagname: "a"): NodeListOf; + getElementsByTagName(tagname: "abbr"): NodeListOf; + getElementsByTagName(tagname: "acronym"): NodeListOf; + getElementsByTagName(tagname: "address"): NodeListOf; + getElementsByTagName(tagname: "applet"): NodeListOf; + getElementsByTagName(tagname: "area"): NodeListOf; + getElementsByTagName(tagname: "article"): NodeListOf; + getElementsByTagName(tagname: "aside"): NodeListOf; + getElementsByTagName(tagname: "audio"): NodeListOf; + getElementsByTagName(tagname: "b"): NodeListOf; + getElementsByTagName(tagname: "base"): NodeListOf; + getElementsByTagName(tagname: "basefont"): NodeListOf; + getElementsByTagName(tagname: "bdo"): NodeListOf; + getElementsByTagName(tagname: "big"): NodeListOf; + getElementsByTagName(tagname: "blockquote"): NodeListOf; + getElementsByTagName(tagname: "body"): NodeListOf; + getElementsByTagName(tagname: "br"): NodeListOf; + getElementsByTagName(tagname: "button"): NodeListOf; + getElementsByTagName(tagname: "canvas"): NodeListOf; + getElementsByTagName(tagname: "caption"): NodeListOf; + getElementsByTagName(tagname: "center"): NodeListOf; + getElementsByTagName(tagname: "circle"): NodeListOf; + getElementsByTagName(tagname: "cite"): NodeListOf; + getElementsByTagName(tagname: "clippath"): NodeListOf; + getElementsByTagName(tagname: "code"): NodeListOf; + getElementsByTagName(tagname: "col"): NodeListOf; + getElementsByTagName(tagname: "colgroup"): NodeListOf; + getElementsByTagName(tagname: "datalist"): NodeListOf; + getElementsByTagName(tagname: "dd"): NodeListOf; + getElementsByTagName(tagname: "defs"): NodeListOf; + getElementsByTagName(tagname: "del"): NodeListOf; + getElementsByTagName(tagname: "desc"): NodeListOf; + getElementsByTagName(tagname: "dfn"): NodeListOf; + getElementsByTagName(tagname: "dir"): NodeListOf; + getElementsByTagName(tagname: "div"): NodeListOf; + getElementsByTagName(tagname: "dl"): NodeListOf; + getElementsByTagName(tagname: "dt"): NodeListOf; + getElementsByTagName(tagname: "ellipse"): NodeListOf; + getElementsByTagName(tagname: "em"): NodeListOf; + getElementsByTagName(tagname: "embed"): NodeListOf; + getElementsByTagName(tagname: "feblend"): NodeListOf; + getElementsByTagName(tagname: "fecolormatrix"): NodeListOf; + getElementsByTagName(tagname: "fecomponenttransfer"): NodeListOf; + getElementsByTagName(tagname: "fecomposite"): NodeListOf; + getElementsByTagName(tagname: "feconvolvematrix"): NodeListOf; + getElementsByTagName(tagname: "fediffuselighting"): NodeListOf; + getElementsByTagName(tagname: "fedisplacementmap"): NodeListOf; + getElementsByTagName(tagname: "fedistantlight"): NodeListOf; + getElementsByTagName(tagname: "feflood"): NodeListOf; + getElementsByTagName(tagname: "fefunca"): NodeListOf; + getElementsByTagName(tagname: "fefuncb"): NodeListOf; + getElementsByTagName(tagname: "fefuncg"): NodeListOf; + getElementsByTagName(tagname: "fefuncr"): NodeListOf; + getElementsByTagName(tagname: "fegaussianblur"): NodeListOf; + getElementsByTagName(tagname: "feimage"): NodeListOf; + getElementsByTagName(tagname: "femerge"): NodeListOf; + getElementsByTagName(tagname: "femergenode"): NodeListOf; + getElementsByTagName(tagname: "femorphology"): NodeListOf; + getElementsByTagName(tagname: "feoffset"): NodeListOf; + getElementsByTagName(tagname: "fepointlight"): NodeListOf; + getElementsByTagName(tagname: "fespecularlighting"): NodeListOf; + getElementsByTagName(tagname: "fespotlight"): NodeListOf; + getElementsByTagName(tagname: "fetile"): NodeListOf; + getElementsByTagName(tagname: "feturbulence"): NodeListOf; + getElementsByTagName(tagname: "fieldset"): NodeListOf; + getElementsByTagName(tagname: "figcaption"): NodeListOf; + getElementsByTagName(tagname: "figure"): NodeListOf; + getElementsByTagName(tagname: "filter"): NodeListOf; + getElementsByTagName(tagname: "font"): NodeListOf; + getElementsByTagName(tagname: "footer"): NodeListOf; + getElementsByTagName(tagname: "foreignobject"): NodeListOf; + getElementsByTagName(tagname: "form"): NodeListOf; + getElementsByTagName(tagname: "frame"): NodeListOf; + getElementsByTagName(tagname: "frameset"): NodeListOf; + getElementsByTagName(tagname: "g"): NodeListOf; + getElementsByTagName(tagname: "h1"): NodeListOf; + getElementsByTagName(tagname: "h2"): NodeListOf; + getElementsByTagName(tagname: "h3"): NodeListOf; + getElementsByTagName(tagname: "h4"): NodeListOf; + getElementsByTagName(tagname: "h5"): NodeListOf; + getElementsByTagName(tagname: "h6"): NodeListOf; + getElementsByTagName(tagname: "head"): NodeListOf; + getElementsByTagName(tagname: "header"): NodeListOf; + getElementsByTagName(tagname: "hgroup"): NodeListOf; + getElementsByTagName(tagname: "hr"): NodeListOf; + getElementsByTagName(tagname: "html"): NodeListOf; + getElementsByTagName(tagname: "i"): NodeListOf; + getElementsByTagName(tagname: "iframe"): NodeListOf; + getElementsByTagName(tagname: "image"): NodeListOf; + getElementsByTagName(tagname: "img"): NodeListOf; + getElementsByTagName(tagname: "input"): NodeListOf; + getElementsByTagName(tagname: "ins"): NodeListOf; + getElementsByTagName(tagname: "isindex"): NodeListOf; + getElementsByTagName(tagname: "kbd"): NodeListOf; + getElementsByTagName(tagname: "keygen"): NodeListOf; + getElementsByTagName(tagname: "label"): NodeListOf; + getElementsByTagName(tagname: "legend"): NodeListOf; + getElementsByTagName(tagname: "li"): NodeListOf; + getElementsByTagName(tagname: "line"): NodeListOf; + getElementsByTagName(tagname: "lineargradient"): NodeListOf; + getElementsByTagName(tagname: "link"): NodeListOf; + getElementsByTagName(tagname: "listing"): NodeListOf; + getElementsByTagName(tagname: "map"): NodeListOf; + getElementsByTagName(tagname: "mark"): NodeListOf; + getElementsByTagName(tagname: "marker"): NodeListOf; + getElementsByTagName(tagname: "marquee"): NodeListOf; + getElementsByTagName(tagname: "mask"): NodeListOf; + getElementsByTagName(tagname: "menu"): NodeListOf; + getElementsByTagName(tagname: "meta"): NodeListOf; + getElementsByTagName(tagname: "metadata"): NodeListOf; + getElementsByTagName(tagname: "nav"): NodeListOf; + getElementsByTagName(tagname: "nextid"): NodeListOf; + getElementsByTagName(tagname: "nobr"): NodeListOf; + getElementsByTagName(tagname: "noframes"): NodeListOf; + getElementsByTagName(tagname: "noscript"): NodeListOf; + getElementsByTagName(tagname: "object"): NodeListOf; + getElementsByTagName(tagname: "ol"): NodeListOf; + getElementsByTagName(tagname: "optgroup"): NodeListOf; + getElementsByTagName(tagname: "option"): NodeListOf; + getElementsByTagName(tagname: "p"): NodeListOf; + getElementsByTagName(tagname: "param"): NodeListOf; + getElementsByTagName(tagname: "path"): NodeListOf; + getElementsByTagName(tagname: "pattern"): NodeListOf; + getElementsByTagName(tagname: "plaintext"): NodeListOf; + getElementsByTagName(tagname: "polygon"): NodeListOf; + getElementsByTagName(tagname: "polyline"): NodeListOf; + getElementsByTagName(tagname: "pre"): NodeListOf; + getElementsByTagName(tagname: "progress"): NodeListOf; + getElementsByTagName(tagname: "q"): NodeListOf; + getElementsByTagName(tagname: "radialgradient"): NodeListOf; + getElementsByTagName(tagname: "rect"): NodeListOf; + getElementsByTagName(tagname: "rt"): NodeListOf; + getElementsByTagName(tagname: "ruby"): NodeListOf; + getElementsByTagName(tagname: "s"): NodeListOf; + getElementsByTagName(tagname: "samp"): NodeListOf; + getElementsByTagName(tagname: "script"): NodeListOf; + getElementsByTagName(tagname: "section"): NodeListOf; + getElementsByTagName(tagname: "select"): NodeListOf; + getElementsByTagName(tagname: "small"): NodeListOf; + getElementsByTagName(tagname: "source"): NodeListOf; + getElementsByTagName(tagname: "span"): NodeListOf; + getElementsByTagName(tagname: "stop"): NodeListOf; + getElementsByTagName(tagname: "strike"): NodeListOf; + getElementsByTagName(tagname: "strong"): NodeListOf; + getElementsByTagName(tagname: "style"): NodeListOf; + getElementsByTagName(tagname: "sub"): NodeListOf; + getElementsByTagName(tagname: "sup"): NodeListOf; + getElementsByTagName(tagname: "svg"): NodeListOf; + getElementsByTagName(tagname: "switch"): NodeListOf; + getElementsByTagName(tagname: "symbol"): NodeListOf; + getElementsByTagName(tagname: "table"): NodeListOf; + getElementsByTagName(tagname: "tbody"): NodeListOf; + getElementsByTagName(tagname: "td"): NodeListOf; + getElementsByTagName(tagname: "text"): NodeListOf; + getElementsByTagName(tagname: "textpath"): NodeListOf; + getElementsByTagName(tagname: "textarea"): NodeListOf; + getElementsByTagName(tagname: "tfoot"): NodeListOf; + getElementsByTagName(tagname: "th"): NodeListOf; + getElementsByTagName(tagname: "thead"): NodeListOf; + getElementsByTagName(tagname: "title"): NodeListOf; + getElementsByTagName(tagname: "tr"): NodeListOf; + getElementsByTagName(tagname: "track"): NodeListOf; + getElementsByTagName(tagname: "tspan"): NodeListOf; + getElementsByTagName(tagname: "tt"): NodeListOf; + getElementsByTagName(tagname: "u"): NodeListOf; + getElementsByTagName(tagname: "ul"): NodeListOf; + getElementsByTagName(tagname: "use"): NodeListOf; + getElementsByTagName(tagname: "var"): NodeListOf; + getElementsByTagName(tagname: "video"): NodeListOf; + getElementsByTagName(tagname: "view"): NodeListOf; + getElementsByTagName(tagname: "wbr"): NodeListOf; + getElementsByTagName(tagname: "x-ms-webview"): NodeListOf; + getElementsByTagName(tagname: "xmp"): NodeListOf; + getElementsByTagName(tagname: string): NodeList; + getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; + /** + * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. + */ + getSelection(): Selection; + /** + * Gets a value indicating whether the object currently has focus. + */ + hasFocus(): boolean; + importNode(importedNode: Node, deep: boolean): Node; + msElementsFromPoint(x: number, y: number): NodeList; + msElementsFromRect(left: number, top: number, width: number, height: number): NodeList; + msGetPrintDocumentForNamedFlow(flowName: string): Document; + msSetPrintDocumentUriForNamedFlow(flowName: string, uri: string): void; + /** + * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. + * @param url Specifies a MIME type for the document. + * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. + * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. + * @param replace Specifies whether the existing entry for the document is replaced in the history list. + */ + open(url?: string, name?: string, features?: string, replace?: boolean): Document | Window; /** * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document. * @param commandId Specifies a command identifier. */ queryCommandEnabled(commandId: string): boolean; /** - * Causes the element to receive the focus and executes the code specified by the onfocus event. + * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. + * @param commandId String that specifies a command identifier. */ - focus(): void; + queryCommandIndeterm(commandId: string): boolean; /** - * Closes an output stream and forces the sent data to display. + * Returns a Boolean value that indicates the current state of the command. + * @param commandId String that specifies a command identifier. */ - close(): void; - getElementsByClassName(classNames: string): NodeList; - importNode(importedNode: Node, deep: boolean): Node; + queryCommandState(commandId: string): boolean; /** - * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. + * Returns a Boolean value that indicates whether the current command is supported on the current range. + * @param commandId Specifies a command identifier. */ - createRange(): Range; + queryCommandSupported(commandId: string): boolean; /** - * Fires a specified event on the object. - * @param eventName Specifies the name of the event to fire. - * @param eventObj Object that specifies the event object from which to obtain event object properties. + * Retrieves the string associated with a command. + * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers. */ - fireEvent(eventName: string, eventObj?: any): boolean; + queryCommandText(commandId: string): string; /** - * Creates a comment object with the specified data. - * @param data Sets the comment object's data. + * Returns the current value of the document, range, or current selection for the given command. + * @param commandId String that specifies a command identifier. */ - createComment(data: string): Comment; + queryCommandValue(commandId: string): string; + releaseEvents(): void; /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. + * Allows updating the print settings for the page. */ + updateSettings(): void; + webkitCancelFullScreen(): void; + webkitExitFullscreen(): void; + /** + * Writes one or more HTML expressions to a document in the specified window. + * @param content Specifies the text and HTML tags to write. + */ + write(...content: string[]): void; + /** + * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. + * @param content The text and HTML tags to write. + */ + writeln(...content: string[]): void; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "fullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "fullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mssitemodejumplistitemremoved", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "msthumbnailclick", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerlockchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointerlockerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stop", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Document: { + prototype: Document; + new(): Document; +} + +interface DocumentFragment extends Node, NodeSelector { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var DocumentFragment: { + prototype: DocumentFragment; + new(): DocumentFragment; +} + +interface DocumentType extends Node, ChildNode { + entities: NamedNodeMap; + internalSubset: string; + name: string; + notations: NamedNodeMap; + publicId: string; + systemId: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var DocumentType: { + prototype: DocumentType; + new(): DocumentType; +} + +interface DragEvent extends MouseEvent { + dataTransfer: DataTransfer; + initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void; + msConvertURL(file: File, targetType: string, targetURL?: string): void; +} + +declare var DragEvent: { + prototype: DragEvent; + new(): DragEvent; +} + +interface DynamicsCompressorNode extends AudioNode { + attack: AudioParam; + knee: AudioParam; + ratio: AudioParam; + reduction: AudioParam; + release: AudioParam; + threshold: AudioParam; +} + +declare var DynamicsCompressorNode: { + prototype: DynamicsCompressorNode; + new(): DynamicsCompressorNode; +} + +interface EXT_texture_filter_anisotropic { + MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; + TEXTURE_MAX_ANISOTROPY_EXT: number; +} + +declare var EXT_texture_filter_anisotropic: { + prototype: EXT_texture_filter_anisotropic; + new(): EXT_texture_filter_anisotropic; + MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; + TEXTURE_MAX_ANISOTROPY_EXT: number; +} + +interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelector, ChildNode { + classList: DOMTokenList; + clientHeight: number; + clientLeft: number; + clientTop: number; + clientWidth: number; + msContentZoomFactor: number; + msRegionOverflow: string; + onariarequest: (ev: AriaRequestEvent) => any; + oncommand: (ev: CommandEvent) => any; + ongotpointercapture: (ev: PointerEvent) => any; + onlostpointercapture: (ev: PointerEvent) => any; + onmsgesturechange: (ev: MSGestureEvent) => any; + onmsgesturedoubletap: (ev: MSGestureEvent) => any; + onmsgestureend: (ev: MSGestureEvent) => any; + onmsgesturehold: (ev: MSGestureEvent) => any; + onmsgesturestart: (ev: MSGestureEvent) => any; + onmsgesturetap: (ev: MSGestureEvent) => any; + onmsgotpointercapture: (ev: MSPointerEvent) => any; + onmsinertiastart: (ev: MSGestureEvent) => any; + onmslostpointercapture: (ev: MSPointerEvent) => any; + onmspointercancel: (ev: MSPointerEvent) => any; + onmspointerdown: (ev: MSPointerEvent) => any; + onmspointerenter: (ev: MSPointerEvent) => any; + onmspointerleave: (ev: MSPointerEvent) => any; + onmspointermove: (ev: MSPointerEvent) => any; + onmspointerout: (ev: MSPointerEvent) => any; + onmspointerover: (ev: MSPointerEvent) => any; + onmspointerup: (ev: MSPointerEvent) => any; + ontouchcancel: (ev: TouchEvent) => any; + ontouchend: (ev: TouchEvent) => any; + ontouchmove: (ev: TouchEvent) => any; + ontouchstart: (ev: TouchEvent) => any; + onwebkitfullscreenchange: (ev: Event) => any; + onwebkitfullscreenerror: (ev: Event) => any; + scrollHeight: number; + scrollLeft: number; + scrollTop: number; + scrollWidth: number; + tagName: string; + getAttribute(name?: string): string; + getAttributeNS(namespaceURI: string, localName: string): string; + getAttributeNode(name: string): Attr; + getAttributeNodeNS(namespaceURI: string, localName: string): Attr; + getBoundingClientRect(): ClientRect; + getClientRects(): ClientRectList; getElementsByTagName(name: "a"): NodeListOf; getElementsByTagName(name: "abbr"): NodeListOf; getElementsByTagName(name: "acronym"): NodeListOf; @@ -3240,7 +6260,6 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "base"): NodeListOf; getElementsByTagName(name: "basefont"): NodeListOf; getElementsByTagName(name: "bdo"): NodeListOf; - getElementsByTagName(name: "bgsound"): NodeListOf; getElementsByTagName(name: "big"): NodeListOf; getElementsByTagName(name: "blockquote"): NodeListOf; getElementsByTagName(name: "body"): NodeListOf; @@ -3249,28 +6268,60 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "canvas"): NodeListOf; getElementsByTagName(name: "caption"): NodeListOf; getElementsByTagName(name: "center"): NodeListOf; + getElementsByTagName(name: "circle"): NodeListOf; getElementsByTagName(name: "cite"): NodeListOf; + getElementsByTagName(name: "clippath"): NodeListOf; getElementsByTagName(name: "code"): NodeListOf; getElementsByTagName(name: "col"): NodeListOf; getElementsByTagName(name: "colgroup"): NodeListOf; getElementsByTagName(name: "datalist"): NodeListOf; getElementsByTagName(name: "dd"): NodeListOf; + getElementsByTagName(name: "defs"): NodeListOf; getElementsByTagName(name: "del"): NodeListOf; + getElementsByTagName(name: "desc"): NodeListOf; getElementsByTagName(name: "dfn"): NodeListOf; getElementsByTagName(name: "dir"): NodeListOf; getElementsByTagName(name: "div"): NodeListOf; getElementsByTagName(name: "dl"): NodeListOf; getElementsByTagName(name: "dt"): NodeListOf; + getElementsByTagName(name: "ellipse"): NodeListOf; getElementsByTagName(name: "em"): NodeListOf; getElementsByTagName(name: "embed"): NodeListOf; + getElementsByTagName(name: "feblend"): NodeListOf; + getElementsByTagName(name: "fecolormatrix"): NodeListOf; + getElementsByTagName(name: "fecomponenttransfer"): NodeListOf; + getElementsByTagName(name: "fecomposite"): NodeListOf; + getElementsByTagName(name: "feconvolvematrix"): NodeListOf; + getElementsByTagName(name: "fediffuselighting"): NodeListOf; + getElementsByTagName(name: "fedisplacementmap"): NodeListOf; + getElementsByTagName(name: "fedistantlight"): NodeListOf; + getElementsByTagName(name: "feflood"): NodeListOf; + getElementsByTagName(name: "fefunca"): NodeListOf; + getElementsByTagName(name: "fefuncb"): NodeListOf; + getElementsByTagName(name: "fefuncg"): NodeListOf; + getElementsByTagName(name: "fefuncr"): NodeListOf; + getElementsByTagName(name: "fegaussianblur"): NodeListOf; + getElementsByTagName(name: "feimage"): NodeListOf; + getElementsByTagName(name: "femerge"): NodeListOf; + getElementsByTagName(name: "femergenode"): NodeListOf; + getElementsByTagName(name: "femorphology"): NodeListOf; + getElementsByTagName(name: "feoffset"): NodeListOf; + getElementsByTagName(name: "fepointlight"): NodeListOf; + getElementsByTagName(name: "fespecularlighting"): NodeListOf; + getElementsByTagName(name: "fespotlight"): NodeListOf; + getElementsByTagName(name: "fetile"): NodeListOf; + getElementsByTagName(name: "feturbulence"): NodeListOf; getElementsByTagName(name: "fieldset"): NodeListOf; getElementsByTagName(name: "figcaption"): NodeListOf; getElementsByTagName(name: "figure"): NodeListOf; + getElementsByTagName(name: "filter"): NodeListOf; getElementsByTagName(name: "font"): NodeListOf; getElementsByTagName(name: "footer"): NodeListOf; + getElementsByTagName(name: "foreignobject"): NodeListOf; getElementsByTagName(name: "form"): NodeListOf; getElementsByTagName(name: "frame"): NodeListOf; getElementsByTagName(name: "frameset"): NodeListOf; + getElementsByTagName(name: "g"): NodeListOf; getElementsByTagName(name: "h1"): NodeListOf; getElementsByTagName(name: "h2"): NodeListOf; getElementsByTagName(name: "h3"): NodeListOf; @@ -3284,6 +6335,7 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "html"): NodeListOf; getElementsByTagName(name: "i"): NodeListOf; getElementsByTagName(name: "iframe"): NodeListOf; + getElementsByTagName(name: "image"): NodeListOf; getElementsByTagName(name: "img"): NodeListOf; getElementsByTagName(name: "input"): NodeListOf; getElementsByTagName(name: "ins"): NodeListOf; @@ -3293,13 +6345,18 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "label"): NodeListOf; getElementsByTagName(name: "legend"): NodeListOf; getElementsByTagName(name: "li"): NodeListOf; + getElementsByTagName(name: "line"): NodeListOf; + getElementsByTagName(name: "lineargradient"): NodeListOf; getElementsByTagName(name: "link"): NodeListOf; getElementsByTagName(name: "listing"): NodeListOf; getElementsByTagName(name: "map"): NodeListOf; getElementsByTagName(name: "mark"): NodeListOf; + getElementsByTagName(name: "marker"): NodeListOf; getElementsByTagName(name: "marquee"): NodeListOf; + getElementsByTagName(name: "mask"): NodeListOf; getElementsByTagName(name: "menu"): NodeListOf; getElementsByTagName(name: "meta"): NodeListOf; + getElementsByTagName(name: "metadata"): NodeListOf; getElementsByTagName(name: "nav"): NodeListOf; getElementsByTagName(name: "nextid"): NodeListOf; getElementsByTagName(name: "nobr"): NodeListOf; @@ -3311,10 +6368,16 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "option"): NodeListOf; getElementsByTagName(name: "p"): NodeListOf; getElementsByTagName(name: "param"): NodeListOf; + getElementsByTagName(name: "path"): NodeListOf; + getElementsByTagName(name: "pattern"): NodeListOf; getElementsByTagName(name: "plaintext"): NodeListOf; + getElementsByTagName(name: "polygon"): NodeListOf; + getElementsByTagName(name: "polyline"): NodeListOf; getElementsByTagName(name: "pre"): NodeListOf; getElementsByTagName(name: "progress"): NodeListOf; getElementsByTagName(name: "q"): NodeListOf; + getElementsByTagName(name: "radialgradient"): NodeListOf; + getElementsByTagName(name: "rect"): NodeListOf; getElementsByTagName(name: "rt"): NodeListOf; getElementsByTagName(name: "ruby"): NodeListOf; getElementsByTagName(name: "s"): NodeListOf; @@ -3323,16 +6386,22 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "section"): NodeListOf; getElementsByTagName(name: "select"): NodeListOf; getElementsByTagName(name: "small"): NodeListOf; - getElementsByTagName(name: "SOURCE"): NodeListOf; + getElementsByTagName(name: "source"): NodeListOf; getElementsByTagName(name: "span"): NodeListOf; + getElementsByTagName(name: "stop"): NodeListOf; getElementsByTagName(name: "strike"): NodeListOf; getElementsByTagName(name: "strong"): NodeListOf; getElementsByTagName(name: "style"): NodeListOf; getElementsByTagName(name: "sub"): NodeListOf; getElementsByTagName(name: "sup"): NodeListOf; + getElementsByTagName(name: "svg"): NodeListOf; + getElementsByTagName(name: "switch"): NodeListOf; + getElementsByTagName(name: "symbol"): NodeListOf; getElementsByTagName(name: "table"): NodeListOf; getElementsByTagName(name: "tbody"): NodeListOf; getElementsByTagName(name: "td"): NodeListOf; + getElementsByTagName(name: "text"): NodeListOf; + getElementsByTagName(name: "textpath"): NodeListOf; getElementsByTagName(name: "textarea"): NodeListOf; getElementsByTagName(name: "tfoot"): NodeListOf; getElementsByTagName(name: "th"): NodeListOf; @@ -3340,546 +6409,837 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "title"): NodeListOf; getElementsByTagName(name: "tr"): NodeListOf; getElementsByTagName(name: "track"): NodeListOf; + getElementsByTagName(name: "tspan"): NodeListOf; getElementsByTagName(name: "tt"): NodeListOf; getElementsByTagName(name: "u"): NodeListOf; getElementsByTagName(name: "ul"): NodeListOf; + getElementsByTagName(name: "use"): NodeListOf; getElementsByTagName(name: "var"): NodeListOf; getElementsByTagName(name: "video"): NodeListOf; + getElementsByTagName(name: "view"): NodeListOf; getElementsByTagName(name: "wbr"): NodeListOf; getElementsByTagName(name: "x-ms-webview"): NodeListOf; getElementsByTagName(name: "xmp"): NodeListOf; getElementsByTagName(name: string): NodeList; - /** - * Creates a new document. - */ - createDocumentFragment(): DocumentFragment; - /** - * Creates a style sheet for the document. - * @param href Specifies how to add the style sheet to the document. If a file name is specified for the URL, the style information is added as a link object. If the URL contains style information, it is added to the style object. - * @param index Specifies the index that indicates where the new style sheet is inserted in the styleSheets collection. The default is to insert the new style sheet at the end of the collection. - */ - createStyleSheet(href?: string, index?: number): CSSStyleSheet; - /** - * Gets a collection of objects based on the value of the NAME or ID attribute. - * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. - */ - getElementsByName(elementName: string): NodeList; - /** - * Returns a Boolean value that indicates the current state of the command. - * @param commandId String that specifies a command identifier. - */ - queryCommandState(commandId: string): boolean; - /** - * Gets a value indicating whether the object currently has focus. - */ - hasFocus(): boolean; - /** - * Displays help information for the given command identifier. - * @param commandId Displays help information for the given command identifier. - */ - execCommandShowHelp(commandId: string): boolean; - /** - * Creates an attribute object with a specified name. - * @param name String that sets the attribute object's name. - */ - createAttribute(name: string): Attr; - /** - * Creates a text string from the specified value. - * @param data String that specifies the nodeValue property of the text node. - */ - createTextNode(data: string): Text; - /** - * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. - * @param root The root element or node to start traversing on. - * @param whatToShow The type of nodes or elements to appear in the node list - * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. - * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. - */ - createNodeIterator(root: Node, whatToShow: number, filter: NodeFilter, entityReferenceExpansion: boolean): NodeIterator; - /** - * Generates an event object to pass event context information when you use the fireEvent method. - * @param eventObj An object that specifies an existing event object on which to base the new object. - */ - createEventObject(eventObj?: any): MSEventObj; - /** - * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. - */ - getSelection(): Selection; - msElementsFromPoint(x: number, y: number): NodeList; - msElementsFromRect(left: number, top: number, width: number, height: number): NodeList; - clear(): void; - msExitFullscreen(): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; + hasAttribute(name: string): boolean; + hasAttributeNS(namespaceURI: string, localName: string): boolean; + msGetRegionContent(): MSRangeCollection; + msGetUntransformedBounds(): ClientRect; + msMatchesSelector(selectors: string): boolean; + msReleasePointerCapture(pointerId: number): void; + msSetPointerCapture(pointerId: number): void; + msZoomTo(args: MsZoomToOptions): void; + releasePointerCapture(pointerId: number): void; + removeAttribute(name?: string): void; + removeAttributeNS(namespaceURI: string, localName: string): void; + removeAttributeNode(oldAttr: Attr): Attr; + requestFullscreen(): void; + requestPointerLock(): void; + setAttribute(name?: string, value?: string): void; + setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; + setAttributeNode(newAttr: Attr): Attr; + setAttributeNodeNS(newAttr: Attr): Attr; + setPointerCapture(pointerId: number): void; + webkitMatchesSelector(selectors: string): boolean; + webkitRequestFullScreen(): void; + webkitRequestFullscreen(): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Element: { + prototype: Element; + new(): Element; +} + +interface ErrorEvent extends Event { + colno: number; + error: any; + filename: string; + lineno: number; + message: string; + initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; +} + +declare var ErrorEvent: { + prototype: ErrorEvent; + new(): ErrorEvent; +} + +interface Event { + bubbles: boolean; + cancelBubble: boolean; + cancelable: boolean; + currentTarget: EventTarget; + defaultPrevented: boolean; + eventPhase: number; + isTrusted: boolean; + returnValue: boolean; + srcElement: Element; + target: EventTarget; + timeStamp: number; + type: string; + initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; + preventDefault(): void; + stopImmediatePropagation(): void; + stopPropagation(): void; + AT_TARGET: number; + BUBBLING_PHASE: number; + CAPTURING_PHASE: number; +} + +declare var Event: { + prototype: Event; + new(type: string, eventInitDict?: EventInit): Event; + AT_TARGET: number; + BUBBLING_PHASE: number; + CAPTURING_PHASE: number; +} + +interface EventTarget { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + dispatchEvent(evt: Event): boolean; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var EventTarget: { + prototype: EventTarget; + new(): EventTarget; +} + +interface External { +} + +declare var External: { + prototype: External; + new(): External; +} + +interface File extends Blob { + lastModifiedDate: any; + name: string; +} + +declare var File: { + prototype: File; + new(): File; +} + +interface FileList { + length: number; + item(index: number): File; + [index: number]: File; +} + +declare var FileList: { + prototype: FileList; + new(): FileList; +} + +interface FileReader extends EventTarget, MSBaseReader { + error: DOMError; + readAsArrayBuffer(blob: Blob): void; + readAsBinaryString(blob: Blob): void; + readAsDataURL(blob: Blob): void; + readAsText(blob: Blob, encoding?: string): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var FileReader: { + prototype: FileReader; + new(): FileReader; +} + +interface FocusEvent extends UIEvent { + relatedTarget: EventTarget; + initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void; +} + +declare var FocusEvent: { + prototype: FocusEvent; + new(typeArg: string, eventInitDict?: FocusEventInit): FocusEvent; +} + +interface FormData { + append(name: any, value: any, blobName?: string): void; +} + +declare var FormData: { + prototype: FormData; + new(): FormData; +} + +interface GainNode extends AudioNode { + gain: AudioParam; +} + +declare var GainNode: { + prototype: GainNode; + new(): GainNode; +} + +interface Gamepad { + axes: number[]; + buttons: GamepadButton[]; + connected: boolean; + id: string; + index: number; + mapping: string; + timestamp: number; +} + +declare var Gamepad: { + prototype: Gamepad; + new(): Gamepad; +} + +interface GamepadButton { + pressed: boolean; + value: number; +} + +declare var GamepadButton: { + prototype: GamepadButton; + new(): GamepadButton; +} + +interface GamepadEvent extends Event { + gamepad: Gamepad; +} + +declare var GamepadEvent: { + prototype: GamepadEvent; + new(): GamepadEvent; +} + +interface Geolocation { + clearWatch(watchId: number): void; + getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void; + watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number; +} + +declare var Geolocation: { + prototype: Geolocation; + new(): Geolocation; +} + +interface HTMLAllCollection extends HTMLCollection { + namedItem(name: string): Element; +} + +declare var HTMLAllCollection: { + prototype: HTMLAllCollection; + new(): HTMLAllCollection; +} + +interface HTMLAnchorElement extends HTMLElement { + Methods: string; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Sets or retrieves the coordinates of the object. + */ + coords: string; + /** + * Contains the anchor portion of the URL including the hash sign (#). + */ + hash: string; + /** + * Contains the hostname and port values of the URL. + */ + host: string; + /** + * Contains the hostname of a URL. + */ + hostname: string; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or retrieves the language code of the object. + */ + hreflang: string; + mimeType: string; + /** + * Sets or retrieves the shape of the object. + */ + name: string; + nameProp: string; + /** + * Contains the pathname of the URL. + */ + pathname: string; + /** + * Sets or retrieves the port number associated with a URL. + */ + port: string; + /** + * Contains the protocol of the URL. + */ + protocol: string; + protocolLong: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rel: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rev: string; + /** + * Sets or retrieves the substring of the href property that follows the question mark. + */ + search: string; + /** + * Sets or retrieves the shape of the object. + */ + shape: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; + type: string; + urn: string; + /** + * Returns a string representation of an object. + */ + toString(): string; +} + +declare var HTMLAnchorElement: { + prototype: HTMLAnchorElement; + new(): HTMLAnchorElement; +} + +interface HTMLAppletElement extends HTMLElement { + /** + * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. + */ + BaseHref: string; + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Gets or sets the optional alternative HTML script to execute if the object fails to load. + */ + altHtml: string; + /** + * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. + */ + archive: string; + border: string; + code: string; + /** + * Sets or retrieves the URL of the component. + */ + codeBase: string; + /** + * Sets or retrieves the Internet media type for the code associated with the object. + */ + codeType: string; + /** + * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned. + */ + contentDocument: Document; + /** + * Sets or retrieves the URL that references the data of the object. + */ + data: string; + /** + * Sets or retrieves a character string that can be used to implement your own declare functionality for the object. + */ + declare: boolean; + form: HTMLFormElement; + /** + * Sets or retrieves the height of the object. + */ + height: string; + hspace: number; + /** + * Sets or retrieves the shape of the object. + */ + name: string; + object: string; + /** + * Sets or retrieves a message to be displayed while an object is loading. + */ + standby: string; + /** + * Returns the content type of the object. + */ + type: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + vspace: number; + width: number; +} + +declare var HTMLAppletElement: { + prototype: HTMLAppletElement; + new(): HTMLAppletElement; +} + +interface HTMLAreaElement extends HTMLElement { + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Sets or retrieves the coordinates of the object. + */ + coords: string; + /** + * Sets or retrieves the subsection of the href property that follows the number sign (#). + */ + hash: string; + /** + * Sets or retrieves the hostname and port number of the location or URL. + */ + host: string; + /** + * Sets or retrieves the host name part of the location or URL. + */ + hostname: string; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or gets whether clicks in this region cause action. + */ + noHref: boolean; + /** + * Sets or retrieves the file name or path specified by the object. + */ + pathname: string; + /** + * Sets or retrieves the port number associated with a URL. + */ + port: string; + /** + * Sets or retrieves the protocol portion of a URL. + */ + protocol: string; + rel: string; + /** + * Sets or retrieves the substring of the href property that follows the question mark. + */ + search: string; + /** + * Sets or retrieves the shape of the object. + */ + shape: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Returns a string representation of an object. + */ + toString(): string; +} + +declare var HTMLAreaElement: { + prototype: HTMLAreaElement; + new(): HTMLAreaElement; +} + +interface HTMLAreasCollection extends HTMLCollection { + /** + * Adds an element to the areas, controlRange, or options collection. + */ + add(element: HTMLElement, before?: HTMLElement): void; + add(element: HTMLElement, before?: number): void; + /** + * Removes an element from the collection. + */ + remove(index?: number): void; +} + +declare var HTMLAreasCollection: { + prototype: HTMLAreasCollection; + new(): HTMLAreasCollection; +} + +interface HTMLAudioElement extends HTMLMediaElement { +} + +declare var HTMLAudioElement: { + prototype: HTMLAudioElement; + new(): HTMLAudioElement; +} + +interface HTMLBRElement extends HTMLElement { + /** + * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document. + */ + clear: string; +} + +declare var HTMLBRElement: { + prototype: HTMLBRElement; + new(): HTMLBRElement; +} + +interface HTMLBaseElement extends HTMLElement { + /** + * Gets or sets the baseline URL on which relative links are based. + */ + href: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; +} + +declare var HTMLBaseElement: { + prototype: HTMLBaseElement; + new(): HTMLBaseElement; +} + +interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty { + /** + * Sets or retrieves the current typeface family. + */ + face: string; + /** + * Sets or retrieves the font size of the object. + */ + size: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLBaseFontElement: { + prototype: HTMLBaseFontElement; + new(): HTMLBaseFontElement; +} + +interface HTMLBlockElement extends HTMLElement { + /** + * Sets or retrieves reference information about the object. + */ + cite: string; + clear: string; + /** + * Sets or retrieves the width of the object. + */ + width: number; +} + +declare var HTMLBlockElement: { + prototype: HTMLBlockElement; + new(): HTMLBlockElement; +} + +interface HTMLBodyElement extends HTMLElement { + aLink: any; + background: string; + bgColor: any; + bgProperties: string; + link: any; + noWrap: boolean; + onafterprint: (ev: Event) => any; + onbeforeprint: (ev: Event) => any; + onbeforeunload: (ev: BeforeUnloadEvent) => any; + onblur: (ev: FocusEvent) => any; + onerror: (ev: Event) => any; + onfocus: (ev: FocusEvent) => any; + onhashchange: (ev: HashChangeEvent) => any; + onload: (ev: Event) => any; + onmessage: (ev: MessageEvent) => any; + onoffline: (ev: Event) => any; + ononline: (ev: Event) => any; + onorientationchange: (ev: Event) => any; + onpagehide: (ev: PageTransitionEvent) => any; + onpageshow: (ev: PageTransitionEvent) => any; + onpopstate: (ev: PopStateEvent) => any; + onresize: (ev: UIEvent) => any; + onstorage: (ev: StorageEvent) => any; + onunload: (ev: Event) => any; + text: any; + vLink: any; + createTextRange(): TextRange; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "msthumbnailclick", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stop", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mssitemodejumplistitemremoved", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectionchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "storagecommit", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msfullscreenerror", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msfullscreenchange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Document: { - prototype: Document; - new(): Document; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface Console { - info(message?: any, ...optionalParams: any[]): void; - warn(message?: any, ...optionalParams: any[]): void; - error(message?: any, ...optionalParams: any[]): void; - log(message?: any, ...optionalParams: any[]): void; - profile(reportName?: string): void; - assert(test?: boolean, message?: string, ...optionalParams: any[]): void; - msIsIndependentlyComposed(element: Element): boolean; - clear(): void; - dir(value?: any, ...optionalParams: any[]): void; - profileEnd(): void; - count(countTitle?: string): void; - groupEnd(): void; - time(timerName?: string): void; - timeEnd(timerName?: string): void; - trace(): void; - group(groupTitle?: string): void; - dirxml(value: any): void; - debug(message?: string, ...optionalParams: any[]): void; - groupCollapsed(groupTitle?: string): void; - select(element: Element): void; -} -declare var Console: { - prototype: Console; - new(): Console; +declare var HTMLBodyElement: { + prototype: HTMLBodyElement; + new(): HTMLBodyElement; } -interface MSEventObj extends Event { - nextPage: string; - keyCode: number; - toElement: Element; - returnValue: any; - dataFld: string; - y: number; - dataTransfer: DataTransfer; - propertyName: string; - url: string; - offsetX: number; - recordset: any; - screenX: number; - buttonID: number; - wheelDelta: number; - reason: number; - origin: string; - data: string; - srcFilter: any; - boundElements: HTMLCollection; - cancelBubble: boolean; - altLeft: boolean; - behaviorCookie: number; - bookmarks: BookmarkCollection; +interface HTMLButtonElement extends HTMLElement { + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Overrides the action attribute (where the data on a form is sent) on the parent form element. + */ + formAction: string; + /** + * Used to override the encoding (formEnctype attribute) specified on the form element. + */ + formEnctype: string; + /** + * Overrides the submit method attribute previously specified on a form element. + */ + formMethod: string; + /** + * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. + */ + formNoValidate: string; + /** + * Overrides the target attribute on a form element. + */ + formTarget: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + status: any; + /** + * Gets the classification and default behavior of the button. + */ type: string; - repeat: boolean; - srcElement: Element; - source: Window; - fromElement: Element; - offsetY: number; - x: number; - behaviorPart: number; - qualifier: string; - altKey: boolean; - ctrlKey: boolean; - clientY: number; - shiftKey: boolean; - shiftLeft: boolean; - contentOverflow: boolean; - screenY: number; - ctrlLeft: boolean; - button: number; - srcUrn: string; - clientX: number; - actionURL: string; - getAttribute(strAttributeName: string, lFlags?: number): any; - setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; - removeAttribute(strAttributeName: string, lFlags?: number): boolean; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Sets or retrieves the default or selected value of the control. + */ + value: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Creates a TextRange object for the element. + */ + createTextRange(): TextRange; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; } -declare var MSEventObj: { - prototype: MSEventObj; - new(): MSEventObj; + +declare var HTMLButtonElement: { + prototype: HTMLButtonElement; + new(): HTMLButtonElement; } interface HTMLCanvasElement extends HTMLElement { - /** - * Gets or sets the width of a canvas element on a document. - */ - width: number; /** * Gets or sets the height of a canvas element on a document. */ height: number; /** - * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. - * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); + * Gets or sets the width of a canvas element on a document. */ - getContext(contextId: "2d"): CanvasRenderingContext2D; + width: number; /** * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); */ - getContext(contextId: "experimental-webgl"): WebGLRenderingContext; + getContext(contextId: string, ...args: any[]): CanvasRenderingContext2D | WebGLRenderingContext; /** - * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. - * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); + * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. */ - getContext(contextId: string, ...args: any[]): any; + msToBlob(): Blob; /** * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element. * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image. */ toDataURL(type?: string, ...args: any[]): string; - /** - * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. - */ - msToBlob(): Blob; } + declare var HTMLCanvasElement: { prototype: HTMLCanvasElement; new(): HTMLCanvasElement; } -interface Window extends EventTarget, MSEventAttachmentTarget, WindowLocalStorage, MSWindowExtensions, WindowSessionStorage, WindowTimers, WindowBase64, IDBEnvironment, WindowConsole, GlobalEventHandlers { - ondragend: (ev: DragEvent) => any; - onkeydown: (ev: KeyboardEvent) => any; - ondragover: (ev: DragEvent) => any; - onkeyup: (ev: KeyboardEvent) => any; - onreset: (ev: Event) => any; - onmouseup: (ev: MouseEvent) => any; - ondragstart: (ev: DragEvent) => any; - ondrag: (ev: DragEvent) => any; - screenX: number; - onmouseover: (ev: MouseEvent) => any; - ondragleave: (ev: DragEvent) => any; - history: History; - pageXOffset: number; - name: string; - onafterprint: (ev: Event) => any; - onpause: (ev: Event) => any; - onbeforeprint: (ev: Event) => any; - top: Window; - onmousedown: (ev: MouseEvent) => any; - onseeked: (ev: Event) => any; - opener: Window; - onclick: (ev: MouseEvent) => any; - innerHeight: number; - onwaiting: (ev: Event) => any; - ononline: (ev: Event) => any; - ondurationchange: (ev: Event) => any; - frames: Window; - onblur: (ev: FocusEvent) => any; - onemptied: (ev: Event) => any; - onseeking: (ev: Event) => any; - oncanplay: (ev: Event) => any; - outerWidth: number; - onstalled: (ev: Event) => any; - onmousemove: (ev: MouseEvent) => any; - innerWidth: number; - onoffline: (ev: Event) => any; - length: number; - screen: Screen; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - onratechange: (ev: Event) => any; - onstorage: (ev: StorageEvent) => any; - onloadstart: (ev: Event) => any; - ondragenter: (ev: DragEvent) => any; - onsubmit: (ev: Event) => any; - self: Window; - document: Document; - onprogress: (ev: ProgressEvent) => any; - ondblclick: (ev: MouseEvent) => any; - pageYOffset: number; - oncontextmenu: (ev: MouseEvent) => any; - onchange: (ev: Event) => any; - onloadedmetadata: (ev: Event) => any; - onplay: (ev: Event) => any; - onerror: ErrorEventHandler; - onplaying: (ev: Event) => any; - parent: Window; - location: Location; - oncanplaythrough: (ev: Event) => any; - onabort: (ev: UIEvent) => any; - onreadystatechange: (ev: Event) => any; - outerHeight: number; - onkeypress: (ev: KeyboardEvent) => any; - frameElement: Element; - onloadeddata: (ev: Event) => any; - onsuspend: (ev: Event) => any; - window: Window; - onfocus: (ev: FocusEvent) => any; - onmessage: (ev: MessageEvent) => any; - ontimeupdate: (ev: Event) => any; - onresize: (ev: UIEvent) => any; - onselect: (ev: UIEvent) => any; - navigator: Navigator; - styleMedia: StyleMedia; - ondrop: (ev: DragEvent) => any; - onmouseout: (ev: MouseEvent) => any; - onended: (ev: Event) => any; - onhashchange: (ev: Event) => any; - onunload: (ev: Event) => any; - onscroll: (ev: UIEvent) => any; - screenY: number; - onmousewheel: (ev: MouseWheelEvent) => any; - onload: (ev: Event) => any; - onvolumechange: (ev: Event) => any; - oninput: (ev: Event) => any; - performance: Performance; - onmspointerdown: (ev: any) => any; - animationStartTime: number; - onmsgesturedoubletap: (ev: any) => any; - onmspointerhover: (ev: any) => any; - onmsgesturehold: (ev: any) => any; - onmspointermove: (ev: any) => any; - onmsgesturechange: (ev: any) => any; - onmsgesturestart: (ev: any) => any; - onmspointercancel: (ev: any) => any; - onmsgestureend: (ev: any) => any; - onmsgesturetap: (ev: any) => any; - onmspointerout: (ev: any) => any; - msAnimationStartTime: number; - applicationCache: ApplicationCache; - onmsinertiastart: (ev: any) => any; - onmspointerover: (ev: any) => any; - onpopstate: (ev: PopStateEvent) => any; - onmspointerup: (ev: any) => any; - onpageshow: (ev: PageTransitionEvent) => any; - ondevicemotion: (ev: DeviceMotionEvent) => any; - devicePixelRatio: number; - msCrypto: Crypto; - ondeviceorientation: (ev: DeviceOrientationEvent) => any; - doNotTrack: string; - onmspointerenter: (ev: any) => any; - onpagehide: (ev: PageTransitionEvent) => any; - onmspointerleave: (ev: any) => any; - alert(message?: any): void; - scroll(x?: number, y?: number): void; - focus(): void; - scrollTo(x?: number, y?: number): void; - print(): void; - prompt(message?: string, _default?: string): string; - toString(): string; - open(url?: string, target?: string, features?: string, replace?: boolean): Window; - scrollBy(x?: number, y?: number): void; - confirm(message?: string): boolean; - close(): void; - postMessage(message: any, targetOrigin: string, ports?: any): void; - showModalDialog(url?: string, argument?: any, options?: any): any; - blur(): void; - getSelection(): Selection; - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; - msCancelRequestAnimationFrame(handle: number): void; - matchMedia(mediaQuery: string): MediaQueryList; - cancelAnimationFrame(handle: number): void; - msIsStaticHTML(html: string): boolean; - msMatchMedia(mediaQuery: string): MediaQueryList; - requestAnimationFrame(callback: FrameRequestCallback): number; - msRequestAnimationFrame(callback: FrameRequestCallback): number; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Window: { - prototype: Window; - new(): Window; -} - -interface HTMLCollection extends MSHTMLCollectionExtensions { +interface HTMLCollection { /** * Sets or retrieves the number of objects in a collection. */ @@ -3892,1338 +7252,2371 @@ interface HTMLCollection extends MSHTMLCollectionExtensions { * Retrieves a select object or an object from an options collection. */ namedItem(name: string): Element; - // [name: string]: Element; [index: number]: Element; } + declare var HTMLCollection: { prototype: HTMLCollection; new(): HTMLCollection; } -interface BlobPropertyBag { - type?: string; - endings?: string; +interface HTMLDDElement extends HTMLElement { + /** + * Sets or retrieves whether the browser automatically performs wordwrap. + */ + noWrap: boolean; } -interface Blob { - type: string; - size: number; - msDetachStream(): any; - slice(start?: number, end?: number, contentType?: string): Blob; - msClose(): void; -} -declare var Blob: { - prototype: Blob; - new (blobParts?: any[], options?: BlobPropertyBag): Blob; +declare var HTMLDDElement: { + prototype: HTMLDDElement; + new(): HTMLDDElement; } -interface NavigatorID { - appVersion: string; - appName: string; - userAgent: string; - platform: string; - product: string; - vendor: string; +interface HTMLDListElement extends HTMLElement { + compact: boolean; } -interface HTMLTableElement extends HTMLElement, MSDataBindingTableExtensions, MSDataBindingExtensions, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorLight: any; - /** - * Sets or retrieves the amount of space between cells in a table. - */ - cellSpacing: string; - /** - * Retrieves the tFoot object of the table. - */ - tFoot: HTMLTableSectionElement; - /** - * Sets or retrieves the way the border frame around the table is displayed. - */ - frame: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: HTMLCollection; - /** - * Sets or retrieves which dividing lines (inner borders) are displayed. - */ - rules: string; - /** - * Sets or retrieves the number of columns in the table. - */ - cols: number; - /** - * Sets or retrieves a description and/or structure of the object. - */ - summary: string; - /** - * Retrieves the caption object of a table. - */ - caption: HTMLTableCaptionElement; - /** - * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order. - */ - tBodies: HTMLCollection; - /** - * Retrieves the tHead object of the table. - */ - tHead: HTMLTableSectionElement; - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; - /** - * Retrieves a collection of all cells in the table row or in the entire table. - */ - cells: HTMLCollection; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves the amount of space between the border of the cell and the content of the cell. - */ - cellPadding: string; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - border: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorDark: any; - /** - * Removes the specified row (tr) from the element and from the rows collection. - * @param index Number that specifies the zero-based position in the rows collection of the row to remove. - */ - deleteRow(index?: number): void; - /** - * Creates an empty tBody element in the table. - */ - createTBody(): HTMLElement; - /** - * Deletes the caption element and its contents from the table. - */ - deleteCaption(): void; - /** - * Creates a new row (tr) in the table, and adds the row to the rows collection. - * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. - */ - insertRow(index?: number): HTMLElement; - /** - * Deletes the tFoot element and its contents from the table. - */ - deleteTFoot(): void; - /** - * Returns the tHead element object if successful, or null otherwise. - */ - createTHead(): HTMLElement; - /** - * Deletes the tHead element and its contents from the table. - */ - deleteTHead(): void; - /** - * Creates an empty caption element in the table. - */ - createCaption(): HTMLElement; - /** - * Moves a table row to a new position. - * @param indexFrom Number that specifies the index in the rows collection of the table row that is moved. - * @param indexTo Number that specifies where the row is moved within the rows collection. - */ - moveRow(indexFrom?: number, indexTo?: number): any; - /** - * Creates an empty tFoot element in the table. - */ - createTFoot(): HTMLElement; -} -declare var HTMLTableElement: { - prototype: HTMLTableElement; - new(): HTMLTableElement; +declare var HTMLDListElement: { + prototype: HTMLDListElement; + new(): HTMLDListElement; } -interface TreeWalker { - whatToShow: number; - filter: NodeFilter; - root: Node; - currentNode: Node; - expandEntityReferences: boolean; - previousSibling(): Node; - lastChild(): Node; - nextSibling(): Node; - nextNode(): Node; - parentNode(): Node; - firstChild(): Node; - previousNode(): Node; -} -declare var TreeWalker: { - prototype: TreeWalker; - new(): TreeWalker; -} - -interface GetSVGDocument { - getSVGDocument(): Document; -} - -interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { - y: number; - y1: number; - x: number; - x1: number; -} -declare var SVGPathSegCurvetoQuadraticRel: { - prototype: SVGPathSegCurvetoQuadraticRel; - new(): SVGPathSegCurvetoQuadraticRel; -} - -interface Performance { - navigation: PerformanceNavigation; - timing: PerformanceTiming; - getEntriesByType(entryType: string): any; - toJSON(): any; - getMeasures(measureName?: string): any; - clearMarks(markName?: string): void; - getMarks(markName?: string): any; - clearResourceTimings(): void; - mark(markName: string): void; - measure(measureName: string, startMarkName?: string, endMarkName?: string): void; - getEntriesByName(name: string, entryType?: string): any; - getEntries(): any; - clearMeasures(measureName?: string): void; - setResourceTimingBufferSize(maxSize: number): void; - now(): number; -} -declare var Performance: { - prototype: Performance; - new(): Performance; -} - -interface MSDataBindingTableExtensions { - dataPageSize: number; - nextPage(): void; - firstPage(): void; - refresh(): void; - previousPage(): void; - lastPage(): void; -} - -interface CompositionEvent extends UIEvent { - data: string; - locale: string; - initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void; -} -declare var CompositionEvent: { - prototype: CompositionEvent; - new(): CompositionEvent; -} - -interface WindowTimers extends WindowTimersExtension { - clearTimeout(handle: number): void; - setTimeout(handler: any, timeout?: any, ...args: any[]): number; - clearInterval(handle: number): void; - setInterval(handler: any, timeout?: any, ...args: any[]): number; -} - -interface SVGMarkerElement extends SVGElement, SVGStylable, SVGLangSpace, SVGFitToViewBox, SVGExternalResourcesRequired { - orientType: SVGAnimatedEnumeration; - markerUnits: SVGAnimatedEnumeration; - markerWidth: SVGAnimatedLength; - markerHeight: SVGAnimatedLength; - orientAngle: SVGAnimatedAngle; - refY: SVGAnimatedLength; - refX: SVGAnimatedLength; - setOrientToAngle(angle: SVGAngle): void; - setOrientToAuto(): void; - SVG_MARKER_ORIENT_UNKNOWN: number; - SVG_MARKER_ORIENT_ANGLE: number; - SVG_MARKERUNITS_UNKNOWN: number; - SVG_MARKERUNITS_STROKEWIDTH: number; - SVG_MARKER_ORIENT_AUTO: number; - SVG_MARKERUNITS_USERSPACEONUSE: number; -} -declare var SVGMarkerElement: { - prototype: SVGMarkerElement; - new(): SVGMarkerElement; - SVG_MARKER_ORIENT_UNKNOWN: number; - SVG_MARKER_ORIENT_ANGLE: number; - SVG_MARKERUNITS_UNKNOWN: number; - SVG_MARKERUNITS_STROKEWIDTH: number; - SVG_MARKER_ORIENT_AUTO: number; - SVG_MARKERUNITS_USERSPACEONUSE: number; -} - -interface CSSStyleDeclaration { - backgroundAttachment: string; - visibility: string; - textAlignLast: string; - borderRightStyle: string; - counterIncrement: string; - orphans: string; - cssText: string; - borderStyle: string; - pointerEvents: string; - borderTopColor: string; - markerEnd: string; - textIndent: string; - listStyleImage: string; - cursor: string; - listStylePosition: string; - wordWrap: string; - borderTopStyle: string; - alignmentBaseline: string; - opacity: string; - direction: string; - strokeMiterlimit: string; - maxWidth: string; - color: string; - clip: string; - borderRightWidth: string; - verticalAlign: string; - overflow: string; - mask: string; - borderLeftStyle: string; - emptyCells: string; - stopOpacity: string; - paddingRight: string; - parentRule: CSSRule; - background: string; - boxSizing: string; - textJustify: string; - height: string; - paddingTop: string; - length: number; - right: string; - baselineShift: string; - borderLeft: string; - widows: string; - lineHeight: string; - left: string; - textUnderlinePosition: string; - glyphOrientationHorizontal: string; - display: string; - textAnchor: string; - cssFloat: string; - strokeDasharray: string; - rubyAlign: string; - fontSizeAdjust: string; - borderLeftColor: string; - backgroundImage: string; - listStyleType: string; - strokeWidth: string; - textOverflow: string; - fillRule: string; - borderBottomColor: string; - zIndex: string; - position: string; - listStyle: string; - msTransformOrigin: string; - dominantBaseline: string; - overflowY: string; - fill: string; - captionSide: string; - borderCollapse: string; - boxShadow: string; - quotes: string; - tableLayout: string; - unicodeBidi: string; - borderBottomWidth: string; - backgroundSize: string; - textDecoration: string; - strokeDashoffset: string; - fontSize: string; - border: string; - pageBreakBefore: string; - borderTopRightRadius: string; - msTransform: string; - borderBottomLeftRadius: string; - textTransform: string; - rubyPosition: string; - strokeLinejoin: string; - clipPath: string; - borderRightColor: string; - fontFamily: string; - clear: string; - content: string; - backgroundClip: string; - marginBottom: string; - counterReset: string; - outlineWidth: string; - marginRight: string; - paddingLeft: string; - borderBottom: string; - wordBreak: string; - marginTop: string; - top: string; - fontWeight: string; - borderRight: string; - width: string; - kerning: string; - pageBreakAfter: string; - borderBottomStyle: string; - fontStretch: string; - padding: string; - strokeOpacity: string; - markerStart: string; - bottom: string; - borderLeftWidth: string; - clipRule: string; - backgroundPosition: string; - backgroundColor: string; - pageBreakInside: string; - backgroundOrigin: string; - strokeLinecap: string; - borderTopWidth: string; - outlineStyle: string; - borderTop: string; - outlineColor: string; - paddingBottom: string; - marginLeft: string; - font: string; - outline: string; - wordSpacing: string; - maxHeight: string; - fillOpacity: string; - letterSpacing: string; - borderSpacing: string; - backgroundRepeat: string; - borderRadius: string; - borderWidth: string; - borderBottomRightRadius: string; - whiteSpace: string; - fontStyle: string; - minWidth: string; - stopColor: string; - borderTopLeftRadius: string; - borderColor: string; - marker: string; - glyphOrientationVertical: string; - markerMid: string; - fontVariant: string; - minHeight: string; - stroke: string; - rubyOverhang: string; - overflowX: string; - textAlign: string; - margin: string; - animationFillMode: string; - floodColor: string; - animationIterationCount: string; - textShadow: string; - backfaceVisibility: string; - msAnimationIterationCount: string; - animationDelay: string; - animationTimingFunction: string; - columnWidth: any; - msScrollSnapX: string; - columnRuleColor: any; - columnRuleWidth: any; - transitionDelay: string; - transition: string; - msFlowFrom: string; - msScrollSnapType: string; - msContentZoomSnapType: string; - msGridColumns: string; - msAnimationName: string; - msGridRowAlign: string; - msContentZoomChaining: string; - msGridColumn: any; - msHyphenateLimitZone: any; - msScrollRails: string; - msAnimationDelay: string; - enableBackground: string; - msWrapThrough: string; - columnRuleStyle: string; - msAnimation: string; - msFlexFlow: string; - msScrollSnapY: string; - msHyphenateLimitLines: any; - msTouchAction: string; - msScrollLimit: string; - animation: string; - transform: string; - filter: string; - colorInterpolationFilters: string; - transitionTimingFunction: string; - msBackfaceVisibility: string; - animationPlayState: string; - transformOrigin: string; - msScrollLimitYMin: any; - msFontFeatureSettings: string; - msContentZoomLimitMin: any; - columnGap: any; - transitionProperty: string; - msAnimationDuration: string; - msAnimationFillMode: string; - msFlexDirection: string; - msTransitionDuration: string; - fontFeatureSettings: string; - breakBefore: string; - msFlexWrap: string; - perspective: string; - msFlowInto: string; - msTransformStyle: string; - msScrollTranslation: string; - msTransitionProperty: string; - msUserSelect: string; - msOverflowStyle: string; - msScrollSnapPointsY: string; - animationDirection: string; - animationDuration: string; - msFlex: string; - msTransitionTimingFunction: string; - animationName: string; - columnRule: string; - msGridColumnSpan: any; - msFlexNegative: string; - columnFill: string; - msGridRow: any; - msFlexOrder: string; - msFlexItemAlign: string; - msFlexPositive: string; - msContentZoomLimitMax: any; - msScrollLimitYMax: any; - msGridColumnAlign: string; - perspectiveOrigin: string; - lightingColor: string; - columns: string; - msScrollChaining: string; - msHyphenateLimitChars: string; - msTouchSelect: string; - floodOpacity: string; - msAnimationDirection: string; - msAnimationPlayState: string; - columnSpan: string; - msContentZooming: string; - msPerspective: string; - msFlexPack: string; - msScrollSnapPointsX: string; - msContentZoomSnapPoints: string; - msGridRowSpan: any; - msContentZoomSnap: string; - msScrollLimitXMin: any; - breakInside: string; - msHighContrastAdjust: string; - msFlexLinePack: string; - msGridRows: string; - transitionDuration: string; - msHyphens: string; - breakAfter: string; - msTransition: string; - msPerspectiveOrigin: string; - msContentZoomLimit: string; - msScrollLimitXMax: any; - msFlexAlign: string; - msWrapMargin: any; - columnCount: any; - msAnimationTimingFunction: string; - msTransitionDelay: string; - transformStyle: string; - msWrapFlow: string; - msFlexPreferredSize: string; - alignItems: string; - borderImageSource: string; - flexBasis: string; - borderImageWidth: string; - borderImageRepeat: string; - order: string; - flex: string; - alignContent: string; - msImeAlign: string; - flexShrink: string; - flexGrow: string; - borderImageSlice: string; - flexWrap: string; - borderImageOutset: string; - flexDirection: string; - touchAction: string; - flexFlow: string; - borderImage: string; - justifyContent: string; - alignSelf: string; - msTextCombineHorizontal: string; - getPropertyPriority(propertyName: string): string; - getPropertyValue(propertyName: string): string; - removeProperty(propertyName: string): string; - item(index: number): string; - [index: number]: string; - setProperty(propertyName: string, value: string, priority?: string): void; -} -declare var CSSStyleDeclaration: { - prototype: CSSStyleDeclaration; - new(): CSSStyleDeclaration; -} - -interface SVGGElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGGElement: { - prototype: SVGGElement; - new(): SVGGElement; -} - -interface MSStyleCSSProperties extends MSCSSProperties { - pixelWidth: number; - posHeight: number; - posLeft: number; - pixelTop: number; - pixelBottom: number; - textDecorationNone: boolean; - pixelLeft: number; - posTop: number; - posBottom: number; - textDecorationOverline: boolean; - posWidth: number; - textDecorationLineThrough: boolean; - pixelHeight: number; - textDecorationBlink: boolean; - posRight: number; - pixelRight: number; - textDecorationUnderline: boolean; -} -declare var MSStyleCSSProperties: { - prototype: MSStyleCSSProperties; - new(): MSStyleCSSProperties; -} - -interface Navigator extends NavigatorID, NavigatorOnLine, NavigatorContentUtils, MSNavigatorExtensions, NavigatorGeolocation, MSNavigatorDoNotTrack, NavigatorStorageUtils, MSFileSaver { - msMaxTouchPoints: number; - msPointerEnabled: boolean; - msManipulationViewsEnabled: boolean; - pointerEnabled: boolean; - maxTouchPoints: number; - msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; -} -declare var Navigator: { - prototype: Navigator; - new(): Navigator; -} - -interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg { - y: number; - x2: number; - x: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicSmoothAbs: { - prototype: SVGPathSegCurvetoCubicSmoothAbs; - new(): SVGPathSegCurvetoCubicSmoothAbs; -} - -interface SVGZoomEvent extends UIEvent { - zoomRectScreen: SVGRect; - previousScale: number; - newScale: number; - previousTranslate: SVGPoint; - newTranslate: SVGPoint; -} -declare var SVGZoomEvent: { - prototype: SVGZoomEvent; - new(): SVGZoomEvent; -} - -interface NodeSelector { - querySelectorAll(selectors: string): NodeList; - querySelector(selectors: string): Element; -} - -interface HTMLTableDataCellElement extends HTMLTableCellElement { -} -declare var HTMLTableDataCellElement: { - prototype: HTMLTableDataCellElement; - new(): HTMLTableDataCellElement; -} - -interface HTMLBaseElement extends HTMLElement { +interface HTMLDTElement extends HTMLElement { /** - * Sets or retrieves the window or frame at which to target content. + * Sets or retrieves whether the browser automatically performs wordwrap. */ - target: string; - /** - * Gets or sets the baseline URL on which relative links are based. - */ - href: string; -} -declare var HTMLBaseElement: { - prototype: HTMLBaseElement; - new(): HTMLBaseElement; + noWrap: boolean; } -interface ClientRect { - left: number; - width: number; - right: number; - top: number; - bottom: number; - height: number; -} -declare var ClientRect: { - prototype: ClientRect; - new(): ClientRect; +declare var HTMLDTElement: { + prototype: HTMLDTElement; + new(): HTMLDTElement; } -interface PositionErrorCallback { - (error: PositionError): void; +interface HTMLDataListElement extends HTMLElement { + options: HTMLCollection; } -interface DOMImplementation { - createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; - createDocument(namespaceURI: string, qualifiedName: string, doctype: DocumentType): Document; - hasFeature(feature: string, version?: string): boolean; - createHTMLDocument(title: string): Document; -} -declare var DOMImplementation: { - prototype: DOMImplementation; - new(): DOMImplementation; +declare var HTMLDataListElement: { + prototype: HTMLDataListElement; + new(): HTMLDataListElement; } -interface SVGUnitTypes { - SVG_UNIT_TYPE_UNKNOWN: number; - SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; - SVG_UNIT_TYPE_USERSPACEONUSE: number; -} -declare var SVGUnitTypes: SVGUnitTypes; - -interface Element extends Node, NodeSelector, ElementTraversal, GlobalEventHandlers { - scrollTop: number; - clientLeft: number; - scrollLeft: number; - tagName: string; - clientWidth: number; - scrollWidth: number; - clientHeight: number; - clientTop: number; - scrollHeight: number; - msRegionOverflow: string; - onmspointerdown: (ev: any) => any; - onmsgotpointercapture: (ev: any) => any; - onmsgesturedoubletap: (ev: any) => any; - onmspointerhover: (ev: any) => any; - onmsgesturehold: (ev: any) => any; - onmspointermove: (ev: any) => any; - onmsgesturechange: (ev: any) => any; - onmsgesturestart: (ev: any) => any; - onmspointercancel: (ev: any) => any; - onmsgestureend: (ev: any) => any; - onmsgesturetap: (ev: any) => any; - onmspointerout: (ev: any) => any; - onmsinertiastart: (ev: any) => any; - onmslostpointercapture: (ev: any) => any; - onmspointerover: (ev: any) => any; - msContentZoomFactor: number; - onmspointerup: (ev: any) => any; - onlostpointercapture: (ev: PointerEvent) => any; - onmspointerenter: (ev: any) => any; - ongotpointercapture: (ev: PointerEvent) => any; - onmspointerleave: (ev: any) => any; - getAttribute(name?: string): string; - getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; - hasAttributeNS(namespaceURI: string, localName: string): boolean; - getBoundingClientRect(): ClientRect; - getAttributeNS(namespaceURI: string, localName: string): string; - getAttributeNodeNS(namespaceURI: string, localName: string): Attr; - setAttributeNodeNS(newAttr: Attr): Attr; - msMatchesSelector(selectors: string): boolean; - hasAttribute(name: string): boolean; - removeAttribute(name?: string): void; - setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; - getAttributeNode(name: string): Attr; - fireEvent(eventName: string, eventObj?: any): boolean; - getElementsByTagName(name: "a"): NodeListOf; - getElementsByTagName(name: "abbr"): NodeListOf; - getElementsByTagName(name: "acronym"): NodeListOf; - getElementsByTagName(name: "address"): NodeListOf; - getElementsByTagName(name: "applet"): NodeListOf; - getElementsByTagName(name: "area"): NodeListOf; - getElementsByTagName(name: "article"): NodeListOf; - getElementsByTagName(name: "aside"): NodeListOf; - getElementsByTagName(name: "audio"): NodeListOf; - getElementsByTagName(name: "b"): NodeListOf; - getElementsByTagName(name: "base"): NodeListOf; - getElementsByTagName(name: "basefont"): NodeListOf; - getElementsByTagName(name: "bdo"): NodeListOf; - getElementsByTagName(name: "bgsound"): NodeListOf; - getElementsByTagName(name: "big"): NodeListOf; - getElementsByTagName(name: "blockquote"): NodeListOf; - getElementsByTagName(name: "body"): NodeListOf; - getElementsByTagName(name: "br"): NodeListOf; - getElementsByTagName(name: "button"): NodeListOf; - getElementsByTagName(name: "canvas"): NodeListOf; - getElementsByTagName(name: "caption"): NodeListOf; - getElementsByTagName(name: "center"): NodeListOf; - getElementsByTagName(name: "cite"): NodeListOf; - getElementsByTagName(name: "code"): NodeListOf; - getElementsByTagName(name: "col"): NodeListOf; - getElementsByTagName(name: "colgroup"): NodeListOf; - getElementsByTagName(name: "datalist"): NodeListOf; - getElementsByTagName(name: "dd"): NodeListOf; - getElementsByTagName(name: "del"): NodeListOf; - getElementsByTagName(name: "dfn"): NodeListOf; - getElementsByTagName(name: "dir"): NodeListOf; - getElementsByTagName(name: "div"): NodeListOf; - getElementsByTagName(name: "dl"): NodeListOf; - getElementsByTagName(name: "dt"): NodeListOf; - getElementsByTagName(name: "em"): NodeListOf; - getElementsByTagName(name: "embed"): NodeListOf; - getElementsByTagName(name: "fieldset"): NodeListOf; - getElementsByTagName(name: "figcaption"): NodeListOf; - getElementsByTagName(name: "figure"): NodeListOf; - getElementsByTagName(name: "font"): NodeListOf; - getElementsByTagName(name: "footer"): NodeListOf; - getElementsByTagName(name: "form"): NodeListOf; - getElementsByTagName(name: "frame"): NodeListOf; - getElementsByTagName(name: "frameset"): NodeListOf; - getElementsByTagName(name: "h1"): NodeListOf; - getElementsByTagName(name: "h2"): NodeListOf; - getElementsByTagName(name: "h3"): NodeListOf; - getElementsByTagName(name: "h4"): NodeListOf; - getElementsByTagName(name: "h5"): NodeListOf; - getElementsByTagName(name: "h6"): NodeListOf; - getElementsByTagName(name: "head"): NodeListOf; - getElementsByTagName(name: "header"): NodeListOf; - getElementsByTagName(name: "hgroup"): NodeListOf; - getElementsByTagName(name: "hr"): NodeListOf; - getElementsByTagName(name: "html"): NodeListOf; - getElementsByTagName(name: "i"): NodeListOf; - getElementsByTagName(name: "iframe"): NodeListOf; - getElementsByTagName(name: "img"): NodeListOf; - getElementsByTagName(name: "input"): NodeListOf; - getElementsByTagName(name: "ins"): NodeListOf; - getElementsByTagName(name: "isindex"): NodeListOf; - getElementsByTagName(name: "kbd"): NodeListOf; - getElementsByTagName(name: "keygen"): NodeListOf; - getElementsByTagName(name: "label"): NodeListOf; - getElementsByTagName(name: "legend"): NodeListOf; - getElementsByTagName(name: "li"): NodeListOf; - getElementsByTagName(name: "link"): NodeListOf; - getElementsByTagName(name: "listing"): NodeListOf; - getElementsByTagName(name: "map"): NodeListOf; - getElementsByTagName(name: "mark"): NodeListOf; - getElementsByTagName(name: "marquee"): NodeListOf; - getElementsByTagName(name: "menu"): NodeListOf; - getElementsByTagName(name: "meta"): NodeListOf; - getElementsByTagName(name: "nav"): NodeListOf; - getElementsByTagName(name: "nextid"): NodeListOf; - getElementsByTagName(name: "nobr"): NodeListOf; - getElementsByTagName(name: "noframes"): NodeListOf; - getElementsByTagName(name: "noscript"): NodeListOf; - getElementsByTagName(name: "object"): NodeListOf; - getElementsByTagName(name: "ol"): NodeListOf; - getElementsByTagName(name: "optgroup"): NodeListOf; - getElementsByTagName(name: "option"): NodeListOf; - getElementsByTagName(name: "p"): NodeListOf; - getElementsByTagName(name: "param"): NodeListOf; - getElementsByTagName(name: "plaintext"): NodeListOf; - getElementsByTagName(name: "pre"): NodeListOf; - getElementsByTagName(name: "progress"): NodeListOf; - getElementsByTagName(name: "q"): NodeListOf; - getElementsByTagName(name: "rt"): NodeListOf; - getElementsByTagName(name: "ruby"): NodeListOf; - getElementsByTagName(name: "s"): NodeListOf; - getElementsByTagName(name: "samp"): NodeListOf; - getElementsByTagName(name: "script"): NodeListOf; - getElementsByTagName(name: "section"): NodeListOf; - getElementsByTagName(name: "select"): NodeListOf; - getElementsByTagName(name: "small"): NodeListOf; - getElementsByTagName(name: "SOURCE"): NodeListOf; - getElementsByTagName(name: "span"): NodeListOf; - getElementsByTagName(name: "strike"): NodeListOf; - getElementsByTagName(name: "strong"): NodeListOf; - getElementsByTagName(name: "style"): NodeListOf; - getElementsByTagName(name: "sub"): NodeListOf; - getElementsByTagName(name: "sup"): NodeListOf; - getElementsByTagName(name: "table"): NodeListOf; - getElementsByTagName(name: "tbody"): NodeListOf; - getElementsByTagName(name: "td"): NodeListOf; - getElementsByTagName(name: "textarea"): NodeListOf; - getElementsByTagName(name: "tfoot"): NodeListOf; - getElementsByTagName(name: "th"): NodeListOf; - getElementsByTagName(name: "thead"): NodeListOf; - getElementsByTagName(name: "title"): NodeListOf; - getElementsByTagName(name: "tr"): NodeListOf; - getElementsByTagName(name: "track"): NodeListOf; - getElementsByTagName(name: "tt"): NodeListOf; - getElementsByTagName(name: "u"): NodeListOf; - getElementsByTagName(name: "ul"): NodeListOf; - getElementsByTagName(name: "var"): NodeListOf; - getElementsByTagName(name: "video"): NodeListOf; - getElementsByTagName(name: "wbr"): NodeListOf; - getElementsByTagName(name: "x-ms-webview"): NodeListOf; - getElementsByTagName(name: "xmp"): NodeListOf; - getElementsByTagName(name: string): NodeList; - getClientRects(): ClientRectList; - setAttributeNode(newAttr: Attr): Attr; - removeAttributeNode(oldAttr: Attr): Attr; - setAttribute(name?: string, value?: string): void; - removeAttributeNS(namespaceURI: string, localName: string): void; - msGetRegionContent(): MSRangeCollection; - msReleasePointerCapture(pointerId: number): void; - msSetPointerCapture(pointerId: number): void; - msZoomTo(args: MsZoomToOptions): void; - setPointerCapture(pointerId: number): void; - msGetUntransformedBounds(): ClientRect; - releasePointerCapture(pointerId: number): void; - msRequestFullscreen(): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Element: { - prototype: Element; - new(): Element; +interface HTMLDirectoryElement extends HTMLElement { + compact: boolean; } -interface HTMLNextIdElement extends HTMLElement { - n: string; -} -declare var HTMLNextIdElement: { - prototype: HTMLNextIdElement; - new(): HTMLNextIdElement; +declare var HTMLDirectoryElement: { + prototype: HTMLDirectoryElement; + new(): HTMLDirectoryElement; } -interface SVGPathSegMovetoRel extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegMovetoRel: { - prototype: SVGPathSegMovetoRel; - new(): SVGPathSegMovetoRel; -} - -interface SVGLineElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - y1: SVGAnimatedLength; - x2: SVGAnimatedLength; - x1: SVGAnimatedLength; - y2: SVGAnimatedLength; -} -declare var SVGLineElement: { - prototype: SVGLineElement; - new(): SVGLineElement; -} - -interface HTMLParagraphElement extends HTMLElement, DOML2DeprecatedTextFlowControl { +interface HTMLDivElement extends HTMLElement { /** * Sets or retrieves how the object is aligned with adjacent text. */ align: string; -} -declare var HTMLParagraphElement: { - prototype: HTMLParagraphElement; - new(): HTMLParagraphElement; -} - -interface HTMLAreasCollection extends HTMLCollection { /** - * Removes an element from the collection. + * Sets or retrieves whether the browser automatically performs wordwrap. */ - remove(index?: number): void; - /** - * Adds an element to the areas, controlRange, or options collection. - */ - add(element: HTMLElement, before?: any): void; -} -declare var HTMLAreasCollection: { - prototype: HTMLAreasCollection; - new(): HTMLAreasCollection; + noWrap: boolean; } -interface SVGDescElement extends SVGElement, SVGStylable, SVGLangSpace { -} -declare var SVGDescElement: { - prototype: SVGDescElement; - new(): SVGDescElement; +declare var HTMLDivElement: { + prototype: HTMLDivElement; + new(): HTMLDivElement; } -interface Node extends EventTarget { - nodeType: number; - previousSibling: Node; - localName: string; - namespaceURI: string; - textContent: string; - parentNode: Node; - nextSibling: Node; - nodeValue: string; - lastChild: Node; - childNodes: NodeList; - nodeName: string; - ownerDocument: Document; - attributes: NamedNodeMap; - firstChild: Node; - prefix: string; - removeChild(oldChild: Node): Node; - appendChild(newChild: Node): Node; - isSupported(feature: string, version: string): boolean; - isEqualNode(arg: Node): boolean; - lookupPrefix(namespaceURI: string): string; - isDefaultNamespace(namespaceURI: string): boolean; - compareDocumentPosition(other: Node): number; - normalize(): void; - isSameNode(other: Node): boolean; - hasAttributes(): boolean; - lookupNamespaceURI(prefix: string): string; - cloneNode(deep?: boolean): Node; - hasChildNodes(): boolean; - replaceChild(newChild: Node, oldChild: Node): Node; - insertBefore(newChild: Node, refChild?: Node): Node; - ENTITY_REFERENCE_NODE: number; - ATTRIBUTE_NODE: number; - DOCUMENT_FRAGMENT_NODE: number; - TEXT_NODE: number; - ELEMENT_NODE: number; - COMMENT_NODE: number; - DOCUMENT_POSITION_DISCONNECTED: number; - DOCUMENT_POSITION_CONTAINED_BY: number; - DOCUMENT_POSITION_CONTAINS: number; - DOCUMENT_TYPE_NODE: number; - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - DOCUMENT_NODE: number; - ENTITY_NODE: number; - PROCESSING_INSTRUCTION_NODE: number; - CDATA_SECTION_NODE: number; - NOTATION_NODE: number; - DOCUMENT_POSITION_FOLLOWING: number; - DOCUMENT_POSITION_PRECEDING: number; -} -declare var Node: { - prototype: Node; - new(): Node; - ENTITY_REFERENCE_NODE: number; - ATTRIBUTE_NODE: number; - DOCUMENT_FRAGMENT_NODE: number; - TEXT_NODE: number; - ELEMENT_NODE: number; - COMMENT_NODE: number; - DOCUMENT_POSITION_DISCONNECTED: number; - DOCUMENT_POSITION_CONTAINED_BY: number; - DOCUMENT_POSITION_CONTAINS: number; - DOCUMENT_TYPE_NODE: number; - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - DOCUMENT_NODE: number; - ENTITY_NODE: number; - PROCESSING_INSTRUCTION_NODE: number; - CDATA_SECTION_NODE: number; - NOTATION_NODE: number; - DOCUMENT_POSITION_FOLLOWING: number; - DOCUMENT_POSITION_PRECEDING: number; +interface HTMLDocument extends Document { } -interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegCurvetoQuadraticSmoothRel: { - prototype: SVGPathSegCurvetoQuadraticSmoothRel; - new(): SVGPathSegCurvetoQuadraticSmoothRel; +declare var HTMLDocument: { + prototype: HTMLDocument; + new(): HTMLDocument; } -interface DOML2DeprecatedListSpaceReduction { - compact: boolean; +interface HTMLElement extends Element { + accessKey: string; + children: HTMLCollection; + className: string; + contentEditable: string; + dataset: DOMStringMap; + dir: string; + draggable: boolean; + hidden: boolean; + hideFocus: boolean; + id: string; + innerHTML: string; + innerText: string; + isContentEditable: boolean; + lang: string; + offsetHeight: number; + offsetLeft: number; + offsetParent: Element; + offsetTop: number; + offsetWidth: number; + onabort: (ev: Event) => any; + onactivate: (ev: UIEvent) => any; + onbeforeactivate: (ev: UIEvent) => any; + onbeforecopy: (ev: DragEvent) => any; + onbeforecut: (ev: DragEvent) => any; + onbeforedeactivate: (ev: UIEvent) => any; + onbeforepaste: (ev: DragEvent) => any; + onblur: (ev: FocusEvent) => any; + oncanplay: (ev: Event) => any; + oncanplaythrough: (ev: Event) => any; + onchange: (ev: Event) => any; + onclick: (ev: MouseEvent) => any; + oncontextmenu: (ev: PointerEvent) => any; + oncopy: (ev: DragEvent) => any; + oncuechange: (ev: Event) => any; + oncut: (ev: DragEvent) => any; + ondblclick: (ev: MouseEvent) => any; + ondeactivate: (ev: UIEvent) => any; + ondrag: (ev: DragEvent) => any; + ondragend: (ev: DragEvent) => any; + ondragenter: (ev: DragEvent) => any; + ondragleave: (ev: DragEvent) => any; + ondragover: (ev: DragEvent) => any; + ondragstart: (ev: DragEvent) => any; + ondrop: (ev: DragEvent) => any; + ondurationchange: (ev: Event) => any; + onemptied: (ev: Event) => any; + onended: (ev: Event) => any; + onerror: (ev: Event) => any; + onfocus: (ev: FocusEvent) => any; + oninput: (ev: Event) => any; + onkeydown: (ev: KeyboardEvent) => any; + onkeypress: (ev: KeyboardEvent) => any; + onkeyup: (ev: KeyboardEvent) => any; + onload: (ev: Event) => any; + onloadeddata: (ev: Event) => any; + onloadedmetadata: (ev: Event) => any; + onloadstart: (ev: Event) => any; + onmousedown: (ev: MouseEvent) => any; + onmouseenter: (ev: MouseEvent) => any; + onmouseleave: (ev: MouseEvent) => any; + onmousemove: (ev: MouseEvent) => any; + onmouseout: (ev: MouseEvent) => any; + onmouseover: (ev: MouseEvent) => any; + onmouseup: (ev: MouseEvent) => any; + onmousewheel: (ev: MouseWheelEvent) => any; + onmscontentzoom: (ev: UIEvent) => any; + onmsmanipulationstatechanged: (ev: MSManipulationEvent) => any; + onpaste: (ev: DragEvent) => any; + onpause: (ev: Event) => any; + onplay: (ev: Event) => any; + onplaying: (ev: Event) => any; + onprogress: (ev: ProgressEvent) => any; + onratechange: (ev: Event) => any; + onreset: (ev: Event) => any; + onscroll: (ev: UIEvent) => any; + onseeked: (ev: Event) => any; + onseeking: (ev: Event) => any; + onselect: (ev: UIEvent) => any; + onselectstart: (ev: Event) => any; + onstalled: (ev: Event) => any; + onsubmit: (ev: Event) => any; + onsuspend: (ev: Event) => any; + ontimeupdate: (ev: Event) => any; + onvolumechange: (ev: Event) => any; + onwaiting: (ev: Event) => any; + outerHTML: string; + outerText: string; + spellcheck: boolean; + style: CSSStyleDeclaration; + tabIndex: number; + title: string; + blur(): void; + click(): void; + contains(child: HTMLElement): boolean; + dragDrop(): boolean; + focus(): void; + getElementsByClassName(classNames: string): NodeList; + insertAdjacentElement(position: string, insertedElement: Element): Element; + insertAdjacentHTML(where: string, html: string): void; + insertAdjacentText(where: string, text: string): void; + msGetInputContext(): MSInputMethodContext; + scrollIntoView(top?: boolean): void; + setActive(): void; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface MSScriptHost { -} -declare var MSScriptHost: { - prototype: MSScriptHost; - new(): MSScriptHost; +declare var HTMLElement: { + prototype: HTMLElement; + new(): HTMLElement; } -interface SVGClipPathElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - clipPathUnits: SVGAnimatedEnumeration; -} -declare var SVGClipPathElement: { - prototype: SVGClipPathElement; - new(): SVGClipPathElement; -} - -interface MouseEvent extends UIEvent { - toElement: Element; - layerY: number; - fromElement: Element; - which: number; - pageX: number; - offsetY: number; - x: number; - y: number; - metaKey: boolean; - altKey: boolean; - ctrlKey: boolean; - offsetX: number; - screenX: number; - clientY: number; - shiftKey: boolean; - layerX: number; - screenY: number; - relatedTarget: EventTarget; - button: number; - pageY: number; - buttons: number; - clientX: number; - initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget): void; - getModifierState(keyArg: string): boolean; -} -declare var MouseEvent: { - prototype: MouseEvent; - new(): MouseEvent; -} - -interface RangeException { - code: number; - message: string; - name: string; - toString(): string; - INVALID_NODE_TYPE_ERR: number; - BAD_BOUNDARYPOINTS_ERR: number; -} -declare var RangeException: { - prototype: RangeException; - new(): RangeException; - INVALID_NODE_TYPE_ERR: number; - BAD_BOUNDARYPOINTS_ERR: number; -} - -interface SVGTextPositioningElement extends SVGTextContentElement { - y: SVGAnimatedLengthList; - rotate: SVGAnimatedNumberList; - dy: SVGAnimatedLengthList; - x: SVGAnimatedLengthList; - dx: SVGAnimatedLengthList; -} -declare var SVGTextPositioningElement: { - prototype: SVGTextPositioningElement; - new(): SVGTextPositioningElement; -} - -interface HTMLAppletElement extends HTMLElement, DOML2DeprecatedMarginStyle, DOML2DeprecatedBorderStyle, DOML2DeprecatedAlignmentStyle, MSDataBindingExtensions, MSDataBindingRecordSetExtensions { - width: number; - /** - * Sets or retrieves the Internet media type for the code associated with the object. - */ - codeType: string; - object: string; - form: HTMLFormElement; - code: string; - /** - * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. - */ - archive: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves a message to be displayed while an object is loading. - */ - standby: string; - /** - * Sets or retrieves the class identifier for the object. - */ - classid: string; - /** - * Sets or retrieves the shape of the object. - */ - name: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Sets or retrieves the URL that references the data of the object. - */ - data: string; +interface HTMLEmbedElement extends HTMLElement, GetSVGDocument { /** * Sets or retrieves the height of the object. */ height: string; + hidden: any; /** - * Gets or sets the optional alternative HTML script to execute if the object fails to load. + * Gets or sets whether the DLNA PlayTo device is available. */ - altHtml: string; + msPlayToDisabled: boolean; /** - * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned. + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. */ - contentDocument: Document; + msPlayToPreferredSourceUri: string; /** - * Sets or retrieves the URL of the component. + * Gets or sets the primary DLNA PlayTo device. */ - codeBase: string; + msPlayToPrimary: boolean; /** - * Sets or retrieves a character string that can be used to implement your own declare functionality for the object. + * Gets the source associated with the media element for use by the PlayToManager. */ - declare: boolean; - /** - * Returns the content type of the object. - */ - type: string; - /** - * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. - */ - BaseHref: string; -} -declare var HTMLAppletElement: { - prototype: HTMLAppletElement; - new(): HTMLAppletElement; -} - -interface TextMetrics { - width: number; -} -declare var TextMetrics: { - prototype: TextMetrics; - new(): TextMetrics; -} - -interface DocumentEvent { - createEvent(eventInterface: "AnimationEvent"): AnimationEvent; - createEvent(eventInterface: "CloseEvent"): CloseEvent; - createEvent(eventInterface: "CompositionEvent"): CompositionEvent; - createEvent(eventInterface: "CustomEvent"): CustomEvent; - createEvent(eventInterface: "DeviceMotionEvent"): DeviceMotionEvent; - createEvent(eventInterface: "DeviceOrientationEvent"): DeviceOrientationEvent; - createEvent(eventInterface: "DragEvent"): DragEvent; - createEvent(eventInterface: "ErrorEvent"): ErrorEvent; - createEvent(eventInterface: "Event"): Event; - createEvent(eventInterface: "Events"): Event; - createEvent(eventInterface: "FocusEvent"): FocusEvent; - createEvent(eventInterface: "HTMLEvents"): Event; - createEvent(eventInterface: "IDBVersionChangeEvent"): IDBVersionChangeEvent; - createEvent(eventInterface: "KeyboardEvent"): KeyboardEvent; - createEvent(eventInterface: "LongRunningScriptDetectedEvent"): LongRunningScriptDetectedEvent; - createEvent(eventInterface: "MessageEvent"): MessageEvent; - createEvent(eventInterface: "MouseEvent"): MouseEvent; - createEvent(eventInterface: "MouseEvents"): MouseEvent; - createEvent(eventInterface: "MouseWheelEvent"): MouseWheelEvent; - createEvent(eventInterface: "MSGestureEvent"): MSGestureEvent; - createEvent(eventInterface: "MSPointerEvent"): MSPointerEvent; - createEvent(eventInterface: "MutationEvent"): MutationEvent; - createEvent(eventInterface: "MutationEvents"): MutationEvent; - createEvent(eventInterface: "NavigationCompletedEvent"): NavigationCompletedEvent; - createEvent(eventInterface: "NavigationEvent"): NavigationEvent; - createEvent(eventInterface: "PageTransitionEvent"): PageTransitionEvent; - createEvent(eventInterface: "PointerEvent"): MSPointerEvent; - createEvent(eventInterface: "PopStateEvent"): PopStateEvent; - createEvent(eventInterface: "ProgressEvent"): ProgressEvent; - createEvent(eventInterface: "StorageEvent"): StorageEvent; - createEvent(eventInterface: "SVGZoomEvents"): SVGZoomEvent; - createEvent(eventInterface: "TextEvent"): TextEvent; - createEvent(eventInterface: "TrackEvent"): TrackEvent; - createEvent(eventInterface: "TransitionEvent"): TransitionEvent; - createEvent(eventInterface: "UIEvent"): UIEvent; - createEvent(eventInterface: "UIEvents"): UIEvent; - createEvent(eventInterface: "UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent; - createEvent(eventInterface: "WebGLContextEvent"): WebGLContextEvent; - createEvent(eventInterface: "WheelEvent"): WheelEvent; - createEvent(eventInterface: string): Event; -} - -interface HTMLOListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { - /** - * The starting number. - */ - start: number; -} -declare var HTMLOListElement: { - prototype: HTMLOListElement; - new(): HTMLOListElement; -} - -interface SVGPathSegLinetoVerticalRel extends SVGPathSeg { - y: number; -} -declare var SVGPathSegLinetoVerticalRel: { - prototype: SVGPathSegLinetoVerticalRel; - new(): SVGPathSegLinetoVerticalRel; -} - -interface SVGAnimatedString { - animVal: string; - baseVal: string; -} -declare var SVGAnimatedString: { - prototype: SVGAnimatedString; - new(): SVGAnimatedString; -} - -interface CDATASection extends Text { -} -declare var CDATASection: { - prototype: CDATASection; - new(): CDATASection; -} - -interface StyleMedia { - type: string; - matchMedium(mediaquery: string): boolean; -} -declare var StyleMedia: { - prototype: StyleMedia; - new(): StyleMedia; -} - -interface HTMLSelectElement extends HTMLElement, MSHTMLCollectionExtensions, MSDataBindingExtensions { - options: HTMLSelectElement; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; + msPlayToSource: any; /** * Sets or retrieves the name of the object. */ name: string; /** - * Sets or retrieves the number of rows in the list box. + * Retrieves the palette used for the embedded document. */ - size: number; + palette: string; + /** + * Retrieves the URL of the plug-in used to view an embedded document. + */ + pluginspage: string; + readyState: string; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the height and width units of the embed object. + */ + units: string; + /** + * Sets or retrieves the width of the object. + */ + width: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLEmbedElement: { + prototype: HTMLEmbedElement; + new(): HTMLEmbedElement; +} + +interface HTMLFieldSetElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; +} + +declare var HTMLFieldSetElement: { + prototype: HTMLFieldSetElement; + new(): HTMLFieldSetElement; +} + +interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { + /** + * Sets or retrieves the current typeface family. + */ + face: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLFontElement: { + prototype: HTMLFontElement; + new(): HTMLFontElement; +} + +interface HTMLFormElement extends HTMLElement { + /** + * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form. + */ + acceptCharset: string; + /** + * Sets or retrieves the URL to which the form content is sent for processing. + */ + action: string; + /** + * Specifies whether autocomplete is applied to an editable text field. + */ + autocomplete: string; + /** + * Retrieves a collection, in source order, of all controls in a given form. + */ + elements: HTMLCollection; + /** + * Sets or retrieves the MIME encoding for the form. + */ + encoding: string; + /** + * Sets or retrieves the encoding type for the form. + */ + enctype: string; /** * Sets or retrieves the number of objects in a collection. */ length: number; /** - * Sets or retrieves the index of the selected option in a select object. + * Sets or retrieves how to send the form data to the server. */ - selectedIndex: number; + method: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Designates a form that is not validated when submitted. + */ + noValidate: boolean; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Retrieves a form object or an object from an elements collection. + * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. + * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. + */ + item(name?: any, index?: any): any; + /** + * Retrieves a form object or an object from an elements collection. + */ + namedItem(name: string): any; + /** + * Fires when the user resets a form. + */ + reset(): void; + /** + * Fires when a FORM is about to be submitted. + */ + submit(): void; + [name: string]: any; +} + +declare var HTMLFormElement: { + prototype: HTMLFormElement; + new(): HTMLFormElement; +} + +interface HTMLFrameElement extends HTMLElement, GetSVGDocument { + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Retrieves the document object of the page or frame. + */ + contentDocument: Document; + /** + * Retrieves the object of the specified. + */ + contentWindow: Window; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + /** + * Sets or retrieves the height of the object. + */ + height: string | number; + /** + * Sets or retrieves a URI to a long description of the object. + */ + longDesc: string; + /** + * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. + */ + marginHeight: string; + /** + * Sets or retrieves the left and right margin widths before displaying the text in a frame. + */ + marginWidth: string; + /** + * Sets or retrieves the frame name. + */ + name: string; + /** + * Sets or retrieves whether the user can resize the frame. + */ + noResize: boolean; + /** + * Raised when the object has been completely received from the server. + */ + onload: (ev: Event) => any; + /** + * Sets or retrieves whether the frame can be scrolled. + */ + scrolling: string; + /** + * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. + */ + security: any; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the width of the object. + */ + width: string | number; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLFrameElement: { + prototype: HTMLFrameElement; + new(): HTMLFrameElement; +} + +interface HTMLFrameSetElement extends HTMLElement { + border: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Sets or retrieves the frame widths of the object. + */ + cols: string; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + name: string; + onafterprint: (ev: Event) => any; + onbeforeprint: (ev: Event) => any; + onbeforeunload: (ev: BeforeUnloadEvent) => any; + /** + * Fires when the object loses the input focus. + */ + onblur: (ev: FocusEvent) => any; + onerror: (ev: Event) => any; + /** + * Fires when the object receives focus. + */ + onfocus: (ev: FocusEvent) => any; + onhashchange: (ev: HashChangeEvent) => any; + onload: (ev: Event) => any; + onmessage: (ev: MessageEvent) => any; + onoffline: (ev: Event) => any; + ononline: (ev: Event) => any; + onorientationchange: (ev: Event) => any; + onpagehide: (ev: PageTransitionEvent) => any; + onpageshow: (ev: PageTransitionEvent) => any; + onresize: (ev: UIEvent) => any; + onstorage: (ev: StorageEvent) => any; + onunload: (ev: Event) => any; + /** + * Sets or retrieves the frame heights of the object. + */ + rows: string; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLFrameSetElement: { + prototype: HTMLFrameSetElement; + new(): HTMLFrameSetElement; +} + +interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves whether the horizontal rule is drawn with 3-D shading. + */ + noShade: boolean; + /** + * Sets or retrieves the width of the object. + */ + width: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLHRElement: { + prototype: HTMLHRElement; + new(): HTMLHRElement; +} + +interface HTMLHeadElement extends HTMLElement { + profile: string; +} + +declare var HTMLHeadElement: { + prototype: HTMLHeadElement; + new(): HTMLHeadElement; +} + +interface HTMLHeadingElement extends HTMLElement { + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; + clear: string; +} + +declare var HTMLHeadingElement: { + prototype: HTMLHeadingElement; + new(): HTMLHeadingElement; +} + +interface HTMLHtmlElement extends HTMLElement { + /** + * Sets or retrieves the DTD version that governs the current document. + */ + version: string; +} + +declare var HTMLHtmlElement: { + prototype: HTMLHtmlElement; + new(): HTMLHtmlElement; +} + +interface HTMLIFrameElement extends HTMLElement, GetSVGDocument { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + allowFullscreen: boolean; + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Retrieves the document object of the page or frame. + */ + contentDocument: Document; + /** + * Retrieves the object of the specified. + */ + contentWindow: Window; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Sets or retrieves the horizontal margin for the object. + */ + hspace: number; + /** + * Sets or retrieves a URI to a long description of the object. + */ + longDesc: string; + /** + * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. + */ + marginHeight: string; + /** + * Sets or retrieves the left and right margin widths before displaying the text in a frame. + */ + marginWidth: string; + /** + * Sets or retrieves the frame name. + */ + name: string; + /** + * Sets or retrieves whether the user can resize the frame. + */ + noResize: boolean; + /** + * Raised when the object has been completely received from the server. + */ + onload: (ev: Event) => any; + sandbox: DOMSettableTokenList; + /** + * Sets or retrieves whether the frame can be scrolled. + */ + scrolling: string; + /** + * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. + */ + security: any; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: string; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLIFrameElement: { + prototype: HTMLIFrameElement; + new(): HTMLIFrameElement; +} + +interface HTMLImageElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Retrieves whether the object is fully loaded. + */ + complete: boolean; + crossOrigin: string; + currentSrc: string; + /** + * Sets or retrieves the height of the object. + */ + height: number; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + hspace: number; + /** + * Sets or retrieves whether the image is a server-side image map. + */ + isMap: boolean; + /** + * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object. + */ + longDesc: string; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * The original height of the image resource before sizing. + */ + naturalHeight: number; + /** + * The original width of the image resource before sizing. + */ + naturalWidth: number; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + srcset: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: number; + x: number; + y: number; + msGetAsCastingSource(): any; +} + +declare var HTMLImageElement: { + prototype: HTMLImageElement; + new(): HTMLImageElement; + create(): HTMLImageElement; +} + +interface HTMLInputElement extends HTMLElement { + /** + * Sets or retrieves a comma-separated list of content types. + */ + accept: string; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Specifies whether autocomplete is applied to an editable text field. + */ + autocomplete: string; + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + border: string; + /** + * Sets or retrieves the state of the check box or radio button. + */ + checked: boolean; + /** + * Retrieves whether the object is fully loaded. + */ + complete: boolean; + /** + * Sets or retrieves the state of the check box or radio button. + */ + defaultChecked: boolean; + /** + * Sets or retrieves the initial contents of the object. + */ + defaultValue: string; + disabled: boolean; + /** + * Returns a FileList object on a file type input object. + */ + files: FileList; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Overrides the action attribute (where the data on a form is sent) on the parent form element. + */ + formAction: string; + /** + * Used to override the encoding (formEnctype attribute) specified on the form element. + */ + formEnctype: string; + /** + * Overrides the submit method attribute previously specified on a form element. + */ + formMethod: string; + /** + * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. + */ + formNoValidate: string; + /** + * Overrides the target attribute on a form element. + */ + formTarget: string; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + hspace: number; + indeterminate: boolean; + /** + * Specifies the ID of a pre-defined datalist of options for an input element. + */ + list: HTMLElement; + /** + * Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field. + */ + max: string; + /** + * Sets or retrieves the maximum number of characters that the user can enter in a text control. + */ + maxLength: number; + /** + * Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field. + */ + min: string; /** * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. */ multiple: boolean; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Gets or sets a string containing a regular expression that the user's input must match. + */ + pattern: string; + /** + * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. + */ + placeholder: string; + readOnly: boolean; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + /** + * Gets or sets the end position or offset of a text selection. + */ + selectionEnd: number; + /** + * Gets or sets the starting position or offset of a text selection. + */ + selectionStart: number; + size: number; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + status: boolean; + /** + * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field. + */ + step: string; + /** + * Returns the content type of the object. + */ + type: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Returns the value of the data at the cursor's current position. + */ + value: string; + valueAsDate: Date; + /** + * Returns the input field value as a number. + */ + valueAsNumber: number; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Creates a TextRange object for the element. + */ + createTextRange(): TextRange; + /** + * Makes the selection equal to the current object. + */ + select(): void; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + /** + * Sets the start and end positions of a selection in a text field. + * @param start The offset into the text field for the start of the selection. + * @param end The offset into the text field for the end of the selection. + */ + setSelectionRange(start: number, end: number): void; + /** + * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. + * @param n Value to decrement the value by. + */ + stepDown(n?: number): void; + /** + * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value. + * @param n Value to increment the value by. + */ + stepUp(n?: number): void; +} + +declare var HTMLInputElement: { + prototype: HTMLInputElement; + new(): HTMLInputElement; +} + +interface HTMLIsIndexElement extends HTMLElement { + /** + * Sets or retrieves the URL to which the form content is sent for processing. + */ + action: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + prompt: string; +} + +declare var HTMLIsIndexElement: { + prototype: HTMLIsIndexElement; + new(): HTMLIsIndexElement; +} + +interface HTMLLIElement extends HTMLElement { + type: string; + /** + * Sets or retrieves the value of a list item. + */ + value: number; +} + +declare var HTMLLIElement: { + prototype: HTMLLIElement; + new(): HTMLLIElement; +} + +interface HTMLLabelElement extends HTMLElement { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the object to which the given label object is assigned. + */ + htmlFor: string; +} + +declare var HTMLLabelElement: { + prototype: HTMLLabelElement; + new(): HTMLLabelElement; +} + +interface HTMLLegendElement extends HTMLElement { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + align: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; +} + +declare var HTMLLegendElement: { + prototype: HTMLLegendElement; + new(): HTMLLegendElement; +} + +interface HTMLLinkElement extends HTMLElement, LinkStyle { + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + disabled: boolean; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or retrieves the language code of the object. + */ + hreflang: string; + /** + * Sets or retrieves the media type. + */ + media: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rel: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rev: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Sets or retrieves the MIME type of the object. + */ + type: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLLinkElement: { + prototype: HTMLLinkElement; + new(): HTMLLinkElement; +} + +interface HTMLMapElement extends HTMLElement { + /** + * Retrieves a collection of the area objects defined for the given map object. + */ + areas: HTMLAreasCollection; + /** + * Sets or retrieves the name of the object. + */ + name: string; +} + +declare var HTMLMapElement: { + prototype: HTMLMapElement; + new(): HTMLMapElement; +} + +interface HTMLMarqueeElement extends HTMLElement { + behavior: string; + bgColor: any; + direction: string; + height: string; + hspace: number; + loop: number; + onbounce: (ev: Event) => any; + onfinish: (ev: Event) => any; + onstart: (ev: Event) => any; + scrollAmount: number; + scrollDelay: number; + trueSpeed: boolean; + vspace: number; + width: string; + start(): void; + stop(): void; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "bounce", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "finish", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "start", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMarqueeElement: { + prototype: HTMLMarqueeElement; + new(): HTMLMarqueeElement; +} + +interface HTMLMediaElement extends HTMLElement { + /** + * Returns an AudioTrackList object with the audio tracks for a given video element. + */ + audioTracks: AudioTrackList; + /** + * Gets or sets a value that indicates whether to start playing the media automatically. + */ + autoplay: boolean; + /** + * Gets a collection of buffered time ranges. + */ + buffered: TimeRanges; + /** + * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player). + */ + controls: boolean; + /** + * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement. + */ + currentSrc: string; + /** + * Gets or sets the current playback position, in seconds. + */ + currentTime: number; + defaultMuted: boolean; + /** + * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource. + */ + defaultPlaybackRate: number; + /** + * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming. + */ + duration: number; + /** + * Gets information about whether the playback has ended or not. + */ + ended: boolean; + /** + * Returns an object representing the current error state of the audio or video element. + */ + error: MediaError; + /** + * Gets or sets a flag to specify whether playback should restart after it completes. + */ + loop: boolean; + /** + * Specifies the purpose of the audio or video media, such as background audio or alerts. + */ + msAudioCategory: string; + /** + * Specifies the output device id that the audio will be sent to. + */ + msAudioDeviceType: string; + msGraphicsTrustStatus: MSGraphicsTrust; + /** + * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element. + */ + msKeys: MSMediaKeys; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; + /** + * Specifies whether or not to enable low-latency playback on the media element. + */ + msRealTime: boolean; + /** + * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted. + */ + muted: boolean; + /** + * Gets the current network activity for the element. + */ + networkState: number; + onmsneedkey: (ev: MSMediaKeyNeededEvent) => any; + /** + * Gets a flag that specifies whether playback is paused. + */ + paused: boolean; + /** + * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource. + */ + playbackRate: number; + /** + * Gets TimeRanges for the current media resource that has been played. + */ + played: TimeRanges; + /** + * Gets or sets the current playback position, in seconds. + */ + preload: string; + readyState: any; + /** + * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. + */ + seekable: TimeRanges; + /** + * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource. + */ + seeking: boolean; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + textTracks: TextTrackList; + videoTracks: VideoTrackList; + /** + * Gets or sets the volume level for audio portions of the media element. + */ + volume: number; + addTextTrack(kind: string, label?: string, language?: string): TextTrack; + /** + * Returns a string that specifies whether the client can play a given media resource type. + */ + canPlayType(type: string): string; + /** + * Fires immediately after the client loads the object. + */ + load(): void; + /** + * Clears all effects from the media pipeline. + */ + msClearEffects(): void; + msGetAsCastingSource(): any; + /** + * Inserts the specified audio effect into media pipeline. + */ + msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; + msSetMediaKeys(mediaKeys: MSMediaKeys): void; + /** + * Specifies the media protection manager for a given media pipeline. + */ + msSetMediaProtectionManager(mediaProtectionManager?: any): void; + /** + * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not. + */ + pause(): void; + /** + * Loads and starts playback of a media resource. + */ + play(): void; + HAVE_CURRENT_DATA: number; + HAVE_ENOUGH_DATA: number; + HAVE_FUTURE_DATA: number; + HAVE_METADATA: number; + HAVE_NOTHING: number; + NETWORK_EMPTY: number; + NETWORK_IDLE: number; + NETWORK_LOADING: number; + NETWORK_NO_SOURCE: number; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMediaElement: { + prototype: HTMLMediaElement; + new(): HTMLMediaElement; + HAVE_CURRENT_DATA: number; + HAVE_ENOUGH_DATA: number; + HAVE_FUTURE_DATA: number; + HAVE_METADATA: number; + HAVE_NOTHING: number; + NETWORK_EMPTY: number; + NETWORK_IDLE: number; + NETWORK_LOADING: number; + NETWORK_NO_SOURCE: number; +} + +interface HTMLMenuElement extends HTMLElement { + compact: boolean; + type: string; +} + +declare var HTMLMenuElement: { + prototype: HTMLMenuElement; + new(): HTMLMenuElement; +} + +interface HTMLMetaElement extends HTMLElement { + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Gets or sets meta-information to associate with httpEquiv or name. + */ + content: string; + /** + * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header. + */ + httpEquiv: string; + /** + * Sets or retrieves the value specified in the content attribute of the meta object. + */ + name: string; + /** + * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object. + */ + scheme: string; + /** + * Sets or retrieves the URL property that will be loaded after the specified time has elapsed. + */ + url: string; +} + +declare var HTMLMetaElement: { + prototype: HTMLMetaElement; + new(): HTMLMetaElement; +} + +interface HTMLModElement extends HTMLElement { + /** + * Sets or retrieves reference information about the object. + */ + cite: string; + /** + * Sets or retrieves the date and time of a modification to the object. + */ + dateTime: string; +} + +declare var HTMLModElement: { + prototype: HTMLModElement; + new(): HTMLModElement; +} + +interface HTMLNextIdElement extends HTMLElement { + n: string; +} + +declare var HTMLNextIdElement: { + prototype: HTMLNextIdElement; + new(): HTMLNextIdElement; +} + +interface HTMLOListElement extends HTMLElement { + compact: boolean; + /** + * The starting number. + */ + start: number; + type: string; +} + +declare var HTMLOListElement: { + prototype: HTMLOListElement; + new(): HTMLOListElement; +} + +interface HTMLObjectElement extends HTMLElement, GetSVGDocument { + /** + * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. + */ + BaseHref: string; + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Gets or sets the optional alternative HTML script to execute if the object fails to load. + */ + altHtml: string; + /** + * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. + */ + archive: string; + border: string; + /** + * Sets or retrieves the URL of the file containing the compiled Java class. + */ + code: string; + /** + * Sets or retrieves the URL of the component. + */ + codeBase: string; + /** + * Sets or retrieves the Internet media type for the code associated with the object. + */ + codeType: string; + /** + * Retrieves the document object of the page or frame. + */ + contentDocument: Document; + /** + * Sets or retrieves the URL that references the data of the object. + */ + data: string; + declare: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the height of the object. + */ + height: string; + hspace: number; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Retrieves the contained object. + */ + object: any; + readyState: number; + /** + * Sets or retrieves a message to be displayed while an object is loading. + */ + standby: string; + /** + * Sets or retrieves the MIME type of the object. + */ + type: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLObjectElement: { + prototype: HTMLObjectElement; + new(): HTMLObjectElement; +} + +interface HTMLOptGroupElement extends HTMLElement { + /** + * Sets or retrieves the status of an option. + */ + defaultSelected: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the ordinal position of an option in a list box. + */ + index: number; + /** + * Sets or retrieves a value that you can use to implement your own label functionality for the object. + */ + label: string; + /** + * Sets or retrieves whether the option in the list box is the default item. + */ + selected: boolean; + /** + * Sets or retrieves the text string specified by the option tag. + */ + text: string; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; +} + +declare var HTMLOptGroupElement: { + prototype: HTMLOptGroupElement; + new(): HTMLOptGroupElement; +} + +interface HTMLOptionElement extends HTMLElement { + /** + * Sets or retrieves the status of an option. + */ + defaultSelected: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the ordinal position of an option in a list box. + */ + index: number; + /** + * Sets or retrieves a value that you can use to implement your own label functionality for the object. + */ + label: string; + /** + * Sets or retrieves whether the option in the list box is the default item. + */ + selected: boolean; + /** + * Sets or retrieves the text string specified by the option tag. + */ + text: string; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; +} + +declare var HTMLOptionElement: { + prototype: HTMLOptionElement; + new(): HTMLOptionElement; + create(): HTMLOptionElement; +} + +interface HTMLParagraphElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + clear: string; +} + +declare var HTMLParagraphElement: { + prototype: HTMLParagraphElement; + new(): HTMLParagraphElement; +} + +interface HTMLParamElement extends HTMLElement { + /** + * Sets or retrieves the name of an input parameter for an element. + */ + name: string; + /** + * Sets or retrieves the content type of the resource designated by the value attribute. + */ + type: string; + /** + * Sets or retrieves the value of an input parameter for an element. + */ + value: string; + /** + * Sets or retrieves the data type of the value attribute. + */ + valueType: string; +} + +declare var HTMLParamElement: { + prototype: HTMLParamElement; + new(): HTMLParamElement; +} + +interface HTMLPhraseElement extends HTMLElement { + /** + * Sets or retrieves reference information about the object. + */ + cite: string; + /** + * Sets or retrieves the date and time of a modification to the object. + */ + dateTime: string; +} + +declare var HTMLPhraseElement: { + prototype: HTMLPhraseElement; + new(): HTMLPhraseElement; +} + +interface HTMLPreElement extends HTMLElement { + /** + * Indicates a citation by rendering text in italic type. + */ + cite: string; + clear: string; + /** + * Sets or gets a value that you can use to implement your own width functionality for the object. + */ + width: number; +} + +declare var HTMLPreElement: { + prototype: HTMLPreElement; + new(): HTMLPreElement; +} + +interface HTMLProgressElement extends HTMLElement { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Defines the maximum, or "done" value for a progress element. + */ + max: number; + /** + * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar). + */ + position: number; + /** + * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value. + */ + value: number; +} + +declare var HTMLProgressElement: { + prototype: HTMLProgressElement; + new(): HTMLProgressElement; +} + +interface HTMLQuoteElement extends HTMLElement { + /** + * Sets or retrieves reference information about the object. + */ + cite: string; + /** + * Sets or retrieves the date and time of a modification to the object. + */ + dateTime: string; +} + +declare var HTMLQuoteElement: { + prototype: HTMLQuoteElement; + new(): HTMLQuoteElement; +} + +interface HTMLScriptElement extends HTMLElement { + async: boolean; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Sets or retrieves the status of the script. + */ + defer: boolean; + /** + * Sets or retrieves the event for which the script is written. + */ + event: string; + /** + * Sets or retrieves the object that is bound to the event script. + */ + htmlFor: string; + /** + * Retrieves the URL to an external file that contains the source code or data. + */ + src: string; + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; + /** + * Sets or retrieves the MIME type for the associated scripting engine. + */ + type: string; +} + +declare var HTMLScriptElement: { + prototype: HTMLScriptElement; + new(): HTMLScriptElement; +} + +interface HTMLSelectElement extends HTMLElement { + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the number of objects in a collection. + */ + length: number; + /** + * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. + */ + multiple: boolean; + /** + * Sets or retrieves the name of the object. + */ + name: string; + options: HTMLSelectElement; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + /** + * Sets or retrieves the index of the selected option in a select object. + */ + selectedIndex: number; + /** + * Sets or retrieves the number of rows in the list box. + */ + size: number; /** * Retrieves the type of select control based on the value of the MULTIPLE attribute. */ @@ -5232,33 +9625,29 @@ interface HTMLSelectElement extends HTMLElement, MSHTMLCollectionExtensions, MSD * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. */ validationMessage: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; /** * Returns a ValidityState object that represents the validity states of an element. */ validity: ValidityState; /** - * When present, marks an element that can't be submitted without a value. + * Sets or retrieves the value which is returned to the server when the form control is submitted. */ - required: boolean; + value: string; /** * Returns whether an element will successfully validate based on forms validation rules and constraints. */ willValidate: boolean; - /** - * Removes an element from the collection. - * @param index Number that specifies the zero-based index of the element to remove from the collection. - */ - remove(index?: number): void; /** * Adds an element to the areas, controlRange, or options collection. * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection. * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection. */ - add(element: HTMLElement, before?: any): void; + add(element: HTMLElement, before?: HTMLElement): void; + add(element: HTMLElement, before?: number): void; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; /** * Retrieves a select object or an object from an options collection. * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. @@ -5270,373 +9659,68 @@ interface HTMLSelectElement extends HTMLElement, MSHTMLCollectionExtensions, MSD * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made. */ namedItem(name: string): any; - [name: string]: any; /** - * Returns whether a form will validate when it is submitted, without having to submit it. + * Removes an element from the collection. + * @param index Number that specifies the zero-based index of the element to remove from the collection. */ - checkValidity(): boolean; + remove(index?: number): void; /** * Sets a custom error message that is displayed when a form is submitted. * @param error Sets a custom error message that is displayed when a form is submitted. */ setCustomValidity(error: string): void; + [name: string]: any; } + declare var HTMLSelectElement: { prototype: HTMLSelectElement; new(): HTMLSelectElement; } -interface TextRange { - boundingLeft: number; - htmlText: string; - offsetLeft: number; - boundingWidth: number; - boundingHeight: number; - boundingTop: number; - text: string; - offsetTop: number; - moveToPoint(x: number, y: number): void; - queryCommandValue(cmdID: string): any; - getBookmark(): string; - move(unit: string, count?: number): number; - queryCommandIndeterm(cmdID: string): boolean; - scrollIntoView(fStart?: boolean): void; - findText(string: string, count?: number, flags?: number): boolean; - execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; - getBoundingClientRect(): ClientRect; - moveToBookmark(bookmark: string): boolean; - isEqual(range: TextRange): boolean; - duplicate(): TextRange; - collapse(start?: boolean): void; - queryCommandText(cmdID: string): string; - select(): void; - pasteHTML(html: string): void; - inRange(range: TextRange): boolean; - moveEnd(unit: string, count?: number): number; - getClientRects(): ClientRectList; - moveStart(unit: string, count?: number): number; - parentElement(): Element; - queryCommandState(cmdID: string): boolean; - compareEndPoints(how: string, sourceRange: TextRange): number; - execCommandShowHelp(cmdID: string): boolean; - moveToElementText(element: Element): void; - expand(Unit: string): boolean; - queryCommandSupported(cmdID: string): boolean; - setEndPoint(how: string, SourceRange: TextRange): void; - queryCommandEnabled(cmdID: string): boolean; -} -declare var TextRange: { - prototype: TextRange; - new(): TextRange; -} - -interface SVGTests { - requiredFeatures: SVGStringList; - requiredExtensions: SVGStringList; - systemLanguage: SVGStringList; - hasExtension(extension: string): boolean; -} - -interface HTMLBlockElement extends HTMLElement, DOML2DeprecatedTextFlowControl { +interface HTMLSourceElement extends HTMLElement { /** - * Sets or retrieves the width of the object. - */ - width: number; + * Gets or sets the intended media type of the media source. + */ + media: string; + msKeySystem: string; /** - * Sets or retrieves reference information about the object. + * The address or URL of the a media resource that is to be considered. */ - cite: string; -} -declare var HTMLBlockElement: { - prototype: HTMLBlockElement; - new(): HTMLBlockElement; -} - -interface CSSStyleSheet extends StyleSheet { - owningElement: Element; - imports: StyleSheetList; - isAlternate: boolean; - rules: MSCSSRuleList; - isPrefAlternate: boolean; - readOnly: boolean; - cssText: string; - ownerRule: CSSRule; - href: string; - cssRules: CSSRuleList; - id: string; - pages: StyleSheetPageList; - addImport(bstrURL: string, lIndex?: number): number; - addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; - insertRule(rule: string, index?: number): number; - removeRule(lIndex: number): void; - deleteRule(index?: number): void; - addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number; - removeImport(lIndex: number): void; -} -declare var CSSStyleSheet: { - prototype: CSSStyleSheet; - new(): CSSStyleSheet; -} - -interface MSSelection { - type: string; - typeDetail: string; - createRange(): TextRange; - clear(): void; - createRangeCollection(): TextRangeCollection; - empty(): void; -} -declare var MSSelection: { - prototype: MSSelection; - new(): MSSelection; -} - -interface HTMLMetaElement extends HTMLElement { + src: string; /** - * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header. - */ - httpEquiv: string; - /** - * Sets or retrieves the value specified in the content attribute of the meta object. - */ - name: string; - /** - * Gets or sets meta-information to associate with httpEquiv or name. - */ - content: string; - /** - * Sets or retrieves the URL property that will be loaded after the specified time has elapsed. - */ - url: string; - /** - * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object. - */ - scheme: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; -} -declare var HTMLMetaElement: { - prototype: HTMLMetaElement; - new(): HTMLMetaElement; -} - -interface SVGPatternElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGTests, SVGFitToViewBox, SVGExternalResourcesRequired, SVGURIReference { - patternUnits: SVGAnimatedEnumeration; - y: SVGAnimatedLength; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - patternContentUnits: SVGAnimatedEnumeration; - patternTransform: SVGAnimatedTransformList; - height: SVGAnimatedLength; -} -declare var SVGPatternElement: { - prototype: SVGPatternElement; - new(): SVGPatternElement; -} - -interface SVGAnimatedAngle { - animVal: SVGAngle; - baseVal: SVGAngle; -} -declare var SVGAnimatedAngle: { - prototype: SVGAnimatedAngle; - new(): SVGAnimatedAngle; -} - -interface Selection { - isCollapsed: boolean; - anchorNode: Node; - focusNode: Node; - anchorOffset: number; - focusOffset: number; - rangeCount: number; - addRange(range: Range): void; - collapseToEnd(): void; - toString(): string; - selectAllChildren(parentNode: Node): void; - getRangeAt(index: number): Range; - collapse(parentNode: Node, offset: number): void; - removeAllRanges(): void; - collapseToStart(): void; - deleteFromDocument(): void; - removeRange(range: Range): void; -} -declare var Selection: { - prototype: Selection; - new(): Selection; -} - -interface SVGScriptElement extends SVGElement, SVGExternalResourcesRequired, SVGURIReference { + * Gets or sets the MIME type of a media resource. + */ type: string; } -declare var SVGScriptElement: { - prototype: SVGScriptElement; - new(): SVGScriptElement; + +declare var HTMLSourceElement: { + prototype: HTMLSourceElement; + new(): HTMLSourceElement; } -interface HTMLDDElement extends HTMLElement { - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} -declare var HTMLDDElement: { - prototype: HTMLDDElement; - new(): HTMLDDElement; +interface HTMLSpanElement extends HTMLElement { } -interface MSDataBindingRecordSetReadonlyExtensions { - recordset: any; - namedRecordset(dataMember: string, hierarchy?: any): any; +declare var HTMLSpanElement: { + prototype: HTMLSpanElement; + new(): HTMLSpanElement; } -interface CSSStyleRule extends CSSRule { - selectorText: string; - style: MSStyleCSSProperties; - readOnly: boolean; -} -declare var CSSStyleRule: { - prototype: CSSStyleRule; - new(): CSSStyleRule; -} - -interface NodeIterator { - whatToShow: number; - filter: NodeFilter; - root: Node; - expandEntityReferences: boolean; - nextNode(): Node; - detach(): void; - previousNode(): Node; -} -declare var NodeIterator: { - prototype: NodeIterator; - new(): NodeIterator; -} - -interface SVGViewElement extends SVGElement, SVGZoomAndPan, SVGFitToViewBox, SVGExternalResourcesRequired { - viewTarget: SVGStringList; -} -declare var SVGViewElement: { - prototype: SVGViewElement; - new(): SVGViewElement; -} - -interface HTMLLinkElement extends HTMLElement, LinkStyle { - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rel: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; +interface HTMLStyleElement extends HTMLElement, LinkStyle { /** * Sets or retrieves the media type. */ media: string; /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rev: string; - /** - * Sets or retrieves the MIME type of the object. + * Retrieves the CSS language in which the style sheet is written. */ type: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the language code of the object. - */ - hreflang: string; -} -declare var HTMLLinkElement: { - prototype: HTMLLinkElement; - new(): HTMLLinkElement; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface SVGLocatable { - farthestViewportElement: SVGElement; - nearestViewportElement: SVGElement; - getBBox(): SVGRect; - getTransformToElement(element: SVGElement): SVGMatrix; - getCTM(): SVGMatrix; - getScreenCTM(): SVGMatrix; -} - -interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { - /** - * Sets or retrieves the current typeface family. - */ - face: string; -} -declare var HTMLFontElement: { - prototype: HTMLFontElement; - new(): HTMLFontElement; -} - -interface SVGTitleElement extends SVGElement, SVGStylable, SVGLangSpace { -} -declare var SVGTitleElement: { - prototype: SVGTitleElement; - new(): SVGTitleElement; -} - -interface ControlRangeCollection { - length: number; - queryCommandValue(cmdID: string): any; - remove(index: number): void; - add(item: Element): void; - queryCommandIndeterm(cmdID: string): boolean; - scrollIntoView(varargStart?: any): void; - item(index: number): Element; - [index: number]: Element; - execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; - addElement(item: Element): void; - queryCommandState(cmdID: string): boolean; - queryCommandSupported(cmdID: string): boolean; - queryCommandEnabled(cmdID: string): boolean; - queryCommandText(cmdID: string): string; - select(): void; -} -declare var ControlRangeCollection: { - prototype: ControlRangeCollection; - new(): ControlRangeCollection; -} - -interface MSNamespaceInfo extends MSEventAttachmentTarget { - urn: string; - onreadystatechange: (ev: Event) => any; - name: string; - readyState: string; - doImport(implementationUrl: string): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var MSNamespaceInfo: { - prototype: MSNamespaceInfo; - new(): MSNamespaceInfo; -} - -interface WindowSessionStorage { - sessionStorage: Storage; -} - -interface SVGAnimatedTransformList { - animVal: SVGTransformList; - baseVal: SVGTransformList; -} -declare var SVGAnimatedTransformList: { - prototype: SVGAnimatedTransformList; - new(): SVGAnimatedTransformList; +declare var HTMLStyleElement: { + prototype: HTMLStyleElement; + new(): HTMLStyleElement; } interface HTMLTableCaptionElement extends HTMLElement { @@ -5649,637 +9733,240 @@ interface HTMLTableCaptionElement extends HTMLElement { */ vAlign: string; } + declare var HTMLTableCaptionElement: { prototype: HTMLTableCaptionElement; new(): HTMLTableCaptionElement; } -interface HTMLOptionElement extends HTMLElement, MSDataBindingExtensions { +interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment { /** - * Sets or retrieves the ordinal position of an option in a list box. + * Sets or retrieves abbreviated text for the object. */ - index: number; - /** - * Sets or retrieves the status of an option. - */ - defaultSelected: boolean; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - /** - * Sets or retrieves the text string specified by the option tag. - */ - text: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves a value that you can use to implement your own label functionality for the object. - */ - label: string; - /** - * Sets or retrieves whether the option in the list box is the default item. - */ - selected: boolean; -} -declare var HTMLOptionElement: { - prototype: HTMLOptionElement; - new(): HTMLOptionElement; - create(): HTMLOptionElement; -} - -interface HTMLMapElement extends HTMLElement { - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Retrieves a collection of the area objects defined for the given map object. - */ - areas: HTMLAreasCollection; -} -declare var HTMLMapElement: { - prototype: HTMLMapElement; - new(): HTMLMapElement; -} - -interface HTMLMenuElement extends HTMLElement, DOML2DeprecatedListSpaceReduction { - type: string; -} -declare var HTMLMenuElement: { - prototype: HTMLMenuElement; - new(): HTMLMenuElement; -} - -interface MouseWheelEvent extends MouseEvent { - wheelDelta: number; - initMouseWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, wheelDeltaArg: number): void; -} -declare var MouseWheelEvent: { - prototype: MouseWheelEvent; - new(): MouseWheelEvent; -} - -interface SVGFitToViewBox { - viewBox: SVGAnimatedRect; - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; -} - -interface SVGPointList { - numberOfItems: number; - replaceItem(newItem: SVGPoint, index: number): SVGPoint; - getItem(index: number): SVGPoint; - clear(): void; - appendItem(newItem: SVGPoint): SVGPoint; - initialize(newItem: SVGPoint): SVGPoint; - removeItem(index: number): SVGPoint; - insertItemBefore(newItem: SVGPoint, index: number): SVGPoint; -} -declare var SVGPointList: { - prototype: SVGPointList; - new(): SVGPointList; -} - -interface SVGAnimatedLengthList { - animVal: SVGLengthList; - baseVal: SVGLengthList; -} -declare var SVGAnimatedLengthList: { - prototype: SVGAnimatedLengthList; - new(): SVGAnimatedLengthList; -} - -interface SVGAnimatedPreserveAspectRatio { - animVal: SVGPreserveAspectRatio; - baseVal: SVGPreserveAspectRatio; -} -declare var SVGAnimatedPreserveAspectRatio: { - prototype: SVGAnimatedPreserveAspectRatio; - new(): SVGAnimatedPreserveAspectRatio; -} - -interface MSSiteModeEvent extends Event { - buttonID: number; - actionURL: string; -} -declare var MSSiteModeEvent: { - prototype: MSSiteModeEvent; - new(): MSSiteModeEvent; -} - -interface DOML2DeprecatedTextFlowControl { - clear: string; -} - -interface StyleSheetPageList { - length: number; - item(index: number): CSSPageRule; - [index: number]: CSSPageRule; -} -declare var StyleSheetPageList: { - prototype: StyleSheetPageList; - new(): StyleSheetPageList; -} - -interface MSCSSProperties extends CSSStyleDeclaration { - scrollbarShadowColor: string; - scrollbarHighlightColor: string; - layoutGridChar: string; - layoutGridType: string; - textAutospace: string; - textKashidaSpace: string; - writingMode: string; - scrollbarFaceColor: string; - backgroundPositionY: string; - lineBreak: string; - imeMode: string; - msBlockProgression: string; - layoutGridLine: string; - scrollbarBaseColor: string; - layoutGrid: string; - layoutFlow: string; - textKashida: string; - filter: string; - zoom: string; - scrollbarArrowColor: string; - behavior: string; - backgroundPositionX: string; - accelerator: string; - layoutGridMode: string; - textJustifyTrim: string; - scrollbar3dLightColor: string; - msInterpolationMode: string; - scrollbarTrackColor: string; - scrollbarDarkShadowColor: string; - styleFloat: string; - getAttribute(attributeName: string, flags?: number): any; - setAttribute(attributeName: string, AttributeValue: any, flags?: number): void; - removeAttribute(attributeName: string, flags?: number): boolean; -} -declare var MSCSSProperties: { - prototype: MSCSSProperties; - new(): MSCSSProperties; -} - -interface SVGExternalResourcesRequired { - externalResourcesRequired: SVGAnimatedBoolean; -} - -interface HTMLImageElement extends HTMLElement, MSImageResourceExtensions, MSDataBindingExtensions, MSResourceMetadata { - /** - * Sets or retrieves the width of the object. - */ - width: number; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * The original height of the image resource before sizing. - */ - naturalHeight: number; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; + abbr: string; /** * Sets or retrieves how the object is aligned with adjacent text. */ align: string; /** - * The address or URL of the a media resource that is to be considered. + * Sets or retrieves a comma-delimited list of conceptual categories associated with the object. */ - src: string; + axis: string; + bgColor: any; /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + * Retrieves the position of the object in the cells collection of a row. */ - useMap: string; + cellIndex: number; /** - * The original width of the image resource before sizing. + * Sets or retrieves the number columns in the table that the object should span. */ - naturalWidth: number; + colSpan: number; /** - * Sets or retrieves the name of the object. + * Sets or retrieves a list of header cells that provide information for the object. */ - name: string; - /** - * Sets or retrieves the height of the object. - */ - height: number; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - hspace: number; - /** - * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object. - */ - longDesc: string; - /** - * Contains the hypertext reference (HREF) of the URL. - */ - href: string; - /** - * Sets or retrieves whether the image is a server-side image map. - */ - isMap: boolean; - /** - * Retrieves whether the object is fully loaded. - */ - complete: boolean; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; - crossOrigin: string; - msPlayToPreferredSourceUri: string; -} -declare var HTMLImageElement: { - prototype: HTMLImageElement; - new(): HTMLImageElement; - create(): HTMLImageElement; -} - -interface HTMLAreaElement extends HTMLElement { - /** - * Sets or retrieves the protocol portion of a URL. - */ - protocol: string; - /** - * Sets or retrieves the substring of the href property that follows the question mark. - */ - search: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves the coordinates of the object. - */ - coords: string; - /** - * Sets or retrieves the host name part of the location or URL. - */ - hostname: string; - /** - * Sets or retrieves the port number associated with a URL. - */ - port: string; - /** - * Sets or retrieves the file name or path specified by the object. - */ - pathname: string; - /** - * Sets or retrieves the hostname and port number of the location or URL. - */ - host: string; - /** - * Sets or retrieves the subsection of the href property that follows the number sign (#). - */ - hash: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or gets whether clicks in this region cause action. - */ - noHref: boolean; - /** - * Sets or retrieves the shape of the object. - */ - shape: string; - /** - * Returns a string representation of an object. - */ - toString(): string; -} -declare var HTMLAreaElement: { - prototype: HTMLAreaElement; - new(): HTMLAreaElement; -} - -interface EventTarget { - removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; - dispatchEvent(evt: Event): boolean; -} - -interface SVGAngle { - valueAsString: string; - valueInSpecifiedUnits: number; - value: number; - unitType: number; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - convertToSpecifiedUnits(unitType: number): void; - SVG_ANGLETYPE_RAD: number; - SVG_ANGLETYPE_UNKNOWN: number; - SVG_ANGLETYPE_UNSPECIFIED: number; - SVG_ANGLETYPE_DEG: number; - SVG_ANGLETYPE_GRAD: number; -} -declare var SVGAngle: { - prototype: SVGAngle; - new(): SVGAngle; - SVG_ANGLETYPE_RAD: number; - SVG_ANGLETYPE_UNKNOWN: number; - SVG_ANGLETYPE_UNSPECIFIED: number; - SVG_ANGLETYPE_DEG: number; - SVG_ANGLETYPE_GRAD: number; -} - -interface HTMLButtonElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the default or selected value of the control. - */ - value: string; - status: any; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Gets the classification and default behavior of the button. - */ - type: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Overrides the target attribute on a form element. - */ - formTarget: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Overrides the action attribute (where the data on a form is sent) on the parent form element. - */ - formAction: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. - */ - formNoValidate: string; - /** - * Used to override the encoding (formEnctype attribute) specified on the form element. - */ - formEnctype: string; - /** - * Overrides the submit method attribute previously specified on a form element. - */ - formMethod: string; - /** - * Creates a TextRange object for the element. - */ - createTextRange(): TextRange; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLButtonElement: { - prototype: HTMLButtonElement; - new(): HTMLButtonElement; -} - -interface HTMLSourceElement extends HTMLElement { - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - /** - * Gets or sets the intended media type of the media source. - */ - media: string; - /** - * Gets or sets the MIME type of a media resource. - */ - type: string; - msKeySystem: string; -} -declare var HTMLSourceElement: { - prototype: HTMLSourceElement; - new(): HTMLSourceElement; -} - -interface CanvasGradient { - addColorStop(offset: number, color: string): void; -} -declare var CanvasGradient: { - prototype: CanvasGradient; - new(): CanvasGradient; -} - -interface KeyboardEvent extends UIEvent { - location: number; - keyCode: number; - shiftKey: boolean; - which: number; - locale: string; - key: string; - altKey: boolean; - metaKey: boolean; - char: string; - ctrlKey: boolean; - repeat: boolean; - charCode: number; - getModifierState(keyArg: string): boolean; - initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; - DOM_KEY_LOCATION_RIGHT: number; - DOM_KEY_LOCATION_STANDARD: number; - DOM_KEY_LOCATION_LEFT: number; - DOM_KEY_LOCATION_NUMPAD: number; - DOM_KEY_LOCATION_JOYSTICK: number; - DOM_KEY_LOCATION_MOBILE: number; -} -declare var KeyboardEvent: { - prototype: KeyboardEvent; - new(): KeyboardEvent; - DOM_KEY_LOCATION_RIGHT: number; - DOM_KEY_LOCATION_STANDARD: number; - DOM_KEY_LOCATION_LEFT: number; - DOM_KEY_LOCATION_NUMPAD: number; - DOM_KEY_LOCATION_JOYSTICK: number; - DOM_KEY_LOCATION_MOBILE: number; -} - -interface MessageEvent extends Event { - source: Window; - origin: string; - data: any; - ports: any; - initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void; -} -declare var MessageEvent: { - prototype: MessageEvent; - new(): MessageEvent; -} - -interface SVGElement extends Element { - onmouseover: (ev: MouseEvent) => any; - viewportElement: SVGElement; - onmousemove: (ev: MouseEvent) => any; - onmouseout: (ev: MouseEvent) => any; - ondblclick: (ev: MouseEvent) => any; - onfocusout: (ev: FocusEvent) => any; - onfocusin: (ev: FocusEvent) => any; - xmlbase: string; - onmousedown: (ev: MouseEvent) => any; - onload: (ev: Event) => any; - onmouseup: (ev: MouseEvent) => any; - onclick: (ev: MouseEvent) => any; - ownerSVGElement: SVGSVGElement; - id: string; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var SVGElement: { - prototype: SVGElement; - new(): SVGElement; -} - -interface HTMLScriptElement extends HTMLElement { - /** - * Sets or retrieves the status of the script. - */ - defer: boolean; - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; - /** - * Retrieves the URL to an external file that contains the source code or data. - */ - src: string; - /** - * Sets or retrieves the object that is bound to the event script. - */ - htmlFor: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the MIME type for the associated scripting engine. - */ - type: string; - /** - * Sets or retrieves the event for which the script is written. - */ - event: string; - async: boolean; -} -declare var HTMLScriptElement: { - prototype: HTMLScriptElement; - new(): HTMLScriptElement; -} - -interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundColorStyle { - /** - * Retrieves the position of the object in the rows collection for the table. - */ - rowIndex: number; - /** - * Retrieves a collection of all cells in the table row. - */ - cells: HTMLCollection; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorLight: any; - /** - * Retrieves the position of the object in the collection. - */ - sectionRowIndex: number; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; + headers: string; /** * Sets or retrieves the height of the object. */ height: any; /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. + * Sets or retrieves whether the browser automatically performs wordwrap. */ - borderColorDark: any; + noWrap: boolean; + /** + * Sets or retrieves how many rows in a table the cell should span. + */ + rowSpan: number; + /** + * Sets or retrieves the group of cells in a table to which the object's information applies. + */ + scope: string; + /** + * Sets or retrieves the width of the object. + */ + width: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableCellElement: { + prototype: HTMLTableCellElement; + new(): HTMLTableCellElement; +} + +interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment { + /** + * Sets or retrieves the alignment of the object relative to the display or table. + */ + align: string; + /** + * Sets or retrieves the number of columns in the group. + */ + span: number; + /** + * Sets or retrieves the width of the object. + */ + width: any; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableColElement: { + prototype: HTMLTableColElement; + new(): HTMLTableColElement; +} + +interface HTMLTableDataCellElement extends HTMLTableCellElement { +} + +declare var HTMLTableDataCellElement: { + prototype: HTMLTableDataCellElement; + new(): HTMLTableDataCellElement; +} + +interface HTMLTableElement extends HTMLElement { + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; + bgColor: any; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + border: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Retrieves the caption object of a table. + */ + caption: HTMLTableCaptionElement; + /** + * Sets or retrieves the amount of space between the border of the cell and the content of the cell. + */ + cellPadding: string; + /** + * Sets or retrieves the amount of space between cells in a table. + */ + cellSpacing: string; + /** + * Sets or retrieves the number of columns in the table. + */ + cols: number; + /** + * Sets or retrieves the way the border frame around the table is displayed. + */ + frame: string; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Sets or retrieves the number of horizontal rows contained in the object. + */ + rows: HTMLCollection; + /** + * Sets or retrieves which dividing lines (inner borders) are displayed. + */ + rules: string; + /** + * Sets or retrieves a description and/or structure of the object. + */ + summary: string; + /** + * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order. + */ + tBodies: HTMLCollection; + /** + * Retrieves the tFoot object of the table. + */ + tFoot: HTMLTableSectionElement; + /** + * Retrieves the tHead object of the table. + */ + tHead: HTMLTableSectionElement; + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Creates an empty caption element in the table. + */ + createCaption(): HTMLElement; + /** + * Creates an empty tBody element in the table. + */ + createTBody(): HTMLElement; + /** + * Creates an empty tFoot element in the table. + */ + createTFoot(): HTMLElement; + /** + * Returns the tHead element object if successful, or null otherwise. + */ + createTHead(): HTMLElement; + /** + * Deletes the caption element and its contents from the table. + */ + deleteCaption(): void; + /** + * Removes the specified row (tr) from the element and from the rows collection. + * @param index Number that specifies the zero-based position in the rows collection of the row to remove. + */ + deleteRow(index?: number): void; + /** + * Deletes the tFoot element and its contents from the table. + */ + deleteTFoot(): void; + /** + * Deletes the tHead element and its contents from the table. + */ + deleteTHead(): void; + /** + * Creates a new row (tr) in the table, and adds the row to the rows collection. + * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. + */ + insertRow(index?: number): HTMLElement; +} + +declare var HTMLTableElement: { + prototype: HTMLTableElement; + new(): HTMLTableElement; +} + +interface HTMLTableHeaderCellElement extends HTMLTableCellElement { + /** + * Sets or retrieves the group of cells in a table to which the object's information applies. + */ + scope: string; +} + +declare var HTMLTableHeaderCellElement: { + prototype: HTMLTableHeaderCellElement; + new(): HTMLTableHeaderCellElement; +} + +interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + bgColor: any; + /** + * Retrieves a collection of all cells in the table row. + */ + cells: HTMLCollection; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Retrieves the position of the object in the rows collection for the table. + */ + rowIndex: number; + /** + * Retrieves the position of the object in the collection. + */ + sectionRowIndex: number; /** * Removes the specified cell from the table row, as well as from the cells collection. * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted. @@ -6290,1511 +9977,15 @@ interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment, DOML2Depr * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection. */ insertCell(index?: number): HTMLElement; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var HTMLTableRowElement: { prototype: HTMLTableRowElement; new(): HTMLTableRowElement; } -interface CanvasRenderingContext2D { - miterLimit: number; - font: string; - globalCompositeOperation: string; - msFillRule: string; - lineCap: string; - msImageSmoothingEnabled: boolean; - lineDashOffset: number; - shadowColor: string; - lineJoin: string; - shadowOffsetX: number; - lineWidth: number; - canvas: HTMLCanvasElement; - strokeStyle: any; - globalAlpha: number; - shadowOffsetY: number; - fillStyle: any; - shadowBlur: number; - textAlign: string; - textBaseline: string; - restore(): void; - setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - save(): void; - arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; - measureText(text: string): TextMetrics; - isPointInPath(x: number, y: number, fillRule?: string): boolean; - quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; - putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void; - rotate(angle: number): void; - fillText(text: string, x: number, y: number, maxWidth?: number): void; - translate(x: number, y: number): void; - scale(x: number, y: number): void; - createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; - lineTo(x: number, y: number): void; - getLineDash(): number[]; - fill(fillRule?: string): void; - createImageData(imageDataOrSw: any, sh?: number): ImageData; - createPattern(image: HTMLElement, repetition: string): CanvasPattern; - closePath(): void; - rect(x: number, y: number, w: number, h: number): void; - clip(fillRule?: string): void; - clearRect(x: number, y: number, w: number, h: number): void; - moveTo(x: number, y: number): void; - getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; - fillRect(x: number, y: number, w: number, h: number): void; - bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; - drawImage(image: HTMLElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; - transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - stroke(): void; - strokeRect(x: number, y: number, w: number, h: number): void; - setLineDash(segments: number[]): void; - strokeText(text: string, x: number, y: number, maxWidth?: number): void; - beginPath(): void; - arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; - createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; -} -declare var CanvasRenderingContext2D: { - prototype: CanvasRenderingContext2D; - new(): CanvasRenderingContext2D; -} - -interface MSCSSRuleList { - length: number; - item(index?: number): CSSStyleRule; - [index: number]: CSSStyleRule; -} -declare var MSCSSRuleList: { - prototype: MSCSSRuleList; - new(): MSCSSRuleList; -} - -interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg { - x: number; -} -declare var SVGPathSegLinetoHorizontalAbs: { - prototype: SVGPathSegLinetoHorizontalAbs; - new(): SVGPathSegLinetoHorizontalAbs; -} - -interface SVGPathSegArcAbs extends SVGPathSeg { - y: number; - sweepFlag: boolean; - r2: number; - x: number; - angle: number; - r1: number; - largeArcFlag: boolean; -} -declare var SVGPathSegArcAbs: { - prototype: SVGPathSegArcAbs; - new(): SVGPathSegArcAbs; -} - -interface SVGTransformList { - numberOfItems: number; - getItem(index: number): SVGTransform; - consolidate(): SVGTransform; - clear(): void; - appendItem(newItem: SVGTransform): SVGTransform; - initialize(newItem: SVGTransform): SVGTransform; - removeItem(index: number): SVGTransform; - insertItemBefore(newItem: SVGTransform, index: number): SVGTransform; - replaceItem(newItem: SVGTransform, index: number): SVGTransform; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; -} -declare var SVGTransformList: { - prototype: SVGTransformList; - new(): SVGTransformList; -} - -interface HTMLHtmlElement extends HTMLElement { - /** - * Sets or retrieves the DTD version that governs the current document. - */ - version: string; -} -declare var HTMLHtmlElement: { - prototype: HTMLHtmlElement; - new(): HTMLHtmlElement; -} - -interface SVGPathSegClosePath extends SVGPathSeg { -} -declare var SVGPathSegClosePath: { - prototype: SVGPathSegClosePath; - new(): SVGPathSegClosePath; -} - -interface HTMLFrameElement extends HTMLElement, GetSVGDocument, MSDataBindingExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: any; - /** - * Sets or retrieves whether the frame can be scrolled. - */ - scrolling: string; - /** - * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. - */ - marginHeight: string; - /** - * Sets or retrieves the left and right margin widths before displaying the text in a frame. - */ - marginWidth: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves whether the user can resize the frame. - */ - noResize: boolean; - /** - * Retrieves the object of the specified. - */ - contentWindow: Window; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the frame name. - */ - name: string; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Retrieves the document object of the page or frame. - */ - contentDocument: Document; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Sets or retrieves a URI to a long description of the object. - */ - longDesc: string; - /** - * Raised when the object has been completely received from the server. - */ - onload: (ev: Event) => any; - /** - * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. - */ - security: any; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLFrameElement: { - prototype: HTMLFrameElement; - new(): HTMLFrameElement; -} - -interface SVGAnimatedLength { - animVal: SVGLength; - baseVal: SVGLength; -} -declare var SVGAnimatedLength: { - prototype: SVGAnimatedLength; - new(): SVGAnimatedLength; -} - -interface SVGAnimatedPoints { - points: SVGPointList; - animatedPoints: SVGPointList; -} - -interface SVGDefsElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGDefsElement: { - prototype: SVGDefsElement; - new(): SVGDefsElement; -} - -interface HTMLQuoteElement extends HTMLElement { - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; - /** - * Sets or retrieves reference information about the object. - */ - cite: string; -} -declare var HTMLQuoteElement: { - prototype: HTMLQuoteElement; - new(): HTMLQuoteElement; -} - -interface CSSMediaRule extends CSSRule { - media: MediaList; - cssRules: CSSRuleList; - insertRule(rule: string, index?: number): number; - deleteRule(index?: number): void; -} -declare var CSSMediaRule: { - prototype: CSSMediaRule; - new(): CSSMediaRule; -} - -interface WindowModal { - dialogArguments: any; - returnValue: any; -} - -interface XMLHttpRequest extends EventTarget { - responseBody: any; - status: number; - readyState: number; - responseText: string; - responseXML: any; - ontimeout: (ev: Event) => any; - statusText: string; - onreadystatechange: (ev: Event) => any; - timeout: number; - onload: (ev: Event) => any; - response: any; - withCredentials: boolean; - onprogress: (ev: ProgressEvent) => any; - onabort: (ev: UIEvent) => any; - responseType: string; - onloadend: (ev: ProgressEvent) => any; - upload: XMLHttpRequestEventTarget; - onerror: (ev: ErrorEvent) => any; - onloadstart: (ev: Event) => any; - msCaching: string; - open(method: string, url: string, async?: boolean, user?: string, password?: string): void; - send(data?: any): void; - abort(): void; - getAllResponseHeaders(): string; - setRequestHeader(header: string, value: string): void; - getResponseHeader(header: string): string; - msCachingEnabled(): boolean; - overrideMimeType(mime: string): void; - LOADING: number; - DONE: number; - UNSENT: number; - OPENED: number; - HEADERS_RECEIVED: number; - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var XMLHttpRequest: { - prototype: XMLHttpRequest; - new(): XMLHttpRequest; - LOADING: number; - DONE: number; - UNSENT: number; - OPENED: number; - HEADERS_RECEIVED: number; - create(): XMLHttpRequest; -} - -interface HTMLTableHeaderCellElement extends HTMLTableCellElement { - /** - * Sets or retrieves the group of cells in a table to which the object's information applies. - */ - scope: string; -} -declare var HTMLTableHeaderCellElement: { - prototype: HTMLTableHeaderCellElement; - new(): HTMLTableHeaderCellElement; -} - -interface HTMLDListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction { -} -declare var HTMLDListElement: { - prototype: HTMLDListElement; - new(): HTMLDListElement; -} - -interface MSDataBindingExtensions { - dataSrc: string; - dataFormatAs: string; - dataFld: string; -} - -interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg { - x: number; -} -declare var SVGPathSegLinetoHorizontalRel: { - prototype: SVGPathSegLinetoHorizontalRel; - new(): SVGPathSegLinetoHorizontalRel; -} - -interface SVGEllipseElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - ry: SVGAnimatedLength; - cx: SVGAnimatedLength; - rx: SVGAnimatedLength; - cy: SVGAnimatedLength; -} -declare var SVGEllipseElement: { - prototype: SVGEllipseElement; - new(): SVGEllipseElement; -} - -interface SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { - target: SVGAnimatedString; -} -declare var SVGAElement: { - prototype: SVGAElement; - new(): SVGAElement; -} - -interface SVGStylable { - className: SVGAnimatedString; - style: CSSStyleDeclaration; -} - -interface SVGTransformable extends SVGLocatable { - transform: SVGAnimatedTransformList; -} - -interface HTMLFrameSetElement extends HTMLElement { - ononline: (ev: Event) => any; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the frame heights of the object. - */ - rows: string; - /** - * Sets or retrieves the frame widths of the object. - */ - cols: string; - /** - * Fires when the object loses the input focus. - */ - onblur: (ev: FocusEvent) => any; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Fires when the object receives focus. - */ - onfocus: (ev: FocusEvent) => any; - onmessage: (ev: MessageEvent) => any; - onerror: (ev: ErrorEvent) => any; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - onresize: (ev: UIEvent) => any; - name: string; - onafterprint: (ev: Event) => any; - onbeforeprint: (ev: Event) => any; - onoffline: (ev: Event) => any; - border: string; - onunload: (ev: Event) => any; - onhashchange: (ev: Event) => any; - onload: (ev: Event) => any; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - onstorage: (ev: StorageEvent) => any; - onpageshow: (ev: PageTransitionEvent) => any; - onpagehide: (ev: PageTransitionEvent) => any; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLFrameSetElement: { - prototype: HTMLFrameSetElement; - new(): HTMLFrameSetElement; -} - -interface Screen extends EventTarget { - width: number; - deviceXDPI: number; - fontSmoothingEnabled: boolean; - bufferDepth: number; - logicalXDPI: number; - systemXDPI: number; - availHeight: number; - height: number; - logicalYDPI: number; - systemYDPI: number; - updateInterval: number; - colorDepth: number; - availWidth: number; - deviceYDPI: number; - pixelDepth: number; - msOrientation: string; - onmsorientationchange: (ev: any) => any; - msLockOrientation(orientation: string): boolean; - msLockOrientation(orientations: string[]): boolean; - msUnlockOrientation(): void; - addEventListener(type: "msorientationchange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Screen: { - prototype: Screen; - new(): Screen; -} - -interface Coordinates { - altitudeAccuracy: number; - longitude: number; - latitude: number; - speed: number; - heading: number; - altitude: number; - accuracy: number; -} -declare var Coordinates: { - prototype: Coordinates; - new(): Coordinates; -} - -interface NavigatorGeolocation { - geolocation: Geolocation; -} - -interface NavigatorContentUtils { -} - -interface EventListener { - (evt: Event): void; -} - -interface SVGLangSpace { - xmllang: string; - xmlspace: string; -} - -interface DataTransfer { - effectAllowed: string; - dropEffect: string; - types: DOMStringList; - files: FileList; - clearData(format?: string): boolean; - setData(format: string, data: string): boolean; - getData(format: string): string; -} -declare var DataTransfer: { - prototype: DataTransfer; - new(): DataTransfer; -} - -interface FocusEvent extends UIEvent { - relatedTarget: EventTarget; - initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void; -} -declare var FocusEvent: { - prototype: FocusEvent; - new(): FocusEvent; -} - -interface Range { - startOffset: number; - collapsed: boolean; - endOffset: number; - startContainer: Node; - endContainer: Node; - commonAncestorContainer: Node; - setStart(refNode: Node, offset: number): void; - setEndBefore(refNode: Node): void; - setStartBefore(refNode: Node): void; - selectNode(refNode: Node): void; - detach(): void; - getBoundingClientRect(): ClientRect; - toString(): string; - compareBoundaryPoints(how: number, sourceRange: Range): number; - insertNode(newNode: Node): void; - collapse(toStart: boolean): void; - selectNodeContents(refNode: Node): void; - cloneContents(): DocumentFragment; - setEnd(refNode: Node, offset: number): void; - cloneRange(): Range; - getClientRects(): ClientRectList; - surroundContents(newParent: Node): void; - deleteContents(): void; - setStartAfter(refNode: Node): void; - extractContents(): DocumentFragment; - setEndAfter(refNode: Node): void; - createContextualFragment(fragment: string): DocumentFragment; - END_TO_END: number; - START_TO_START: number; - START_TO_END: number; - END_TO_START: number; -} -declare var Range: { - prototype: Range; - new(): Range; - END_TO_END: number; - START_TO_START: number; - START_TO_END: number; - END_TO_START: number; -} - -interface SVGPoint { - y: number; - x: number; - matrixTransform(matrix: SVGMatrix): SVGPoint; -} -declare var SVGPoint: { - prototype: SVGPoint; - new(): SVGPoint; -} - -interface MSPluginsCollection { - length: number; - refresh(reload?: boolean): void; -} -declare var MSPluginsCollection: { - prototype: MSPluginsCollection; - new(): MSPluginsCollection; -} - -interface SVGAnimatedNumberList { - animVal: SVGNumberList; - baseVal: SVGNumberList; -} -declare var SVGAnimatedNumberList: { - prototype: SVGAnimatedNumberList; - new(): SVGAnimatedNumberList; -} - -interface SVGSVGElement extends SVGElement, SVGStylable, SVGZoomAndPan, DocumentEvent, SVGLangSpace, SVGLocatable, SVGTests, SVGFitToViewBox, SVGExternalResourcesRequired { - width: SVGAnimatedLength; - x: SVGAnimatedLength; - contentStyleType: string; - onzoom: (ev: any) => any; - y: SVGAnimatedLength; - viewport: SVGRect; - onerror: (ev: ErrorEvent) => any; - pixelUnitToMillimeterY: number; - onresize: (ev: UIEvent) => any; - screenPixelToMillimeterY: number; - height: SVGAnimatedLength; - onabort: (ev: UIEvent) => any; - contentScriptType: string; - pixelUnitToMillimeterX: number; - currentTranslate: SVGPoint; - onunload: (ev: Event) => any; - currentScale: number; - onscroll: (ev: UIEvent) => any; - screenPixelToMillimeterX: number; - setCurrentTime(seconds: number): void; - createSVGLength(): SVGLength; - getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeList; - unpauseAnimations(): void; - createSVGRect(): SVGRect; - checkIntersection(element: SVGElement, rect: SVGRect): boolean; - unsuspendRedrawAll(): void; - pauseAnimations(): void; - suspendRedraw(maxWaitMilliseconds: number): number; - deselectAll(): void; - createSVGAngle(): SVGAngle; - getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeList; - createSVGTransform(): SVGTransform; - unsuspendRedraw(suspendHandleID: number): void; - forceRedraw(): void; - getCurrentTime(): number; - checkEnclosure(element: SVGElement, rect: SVGRect): boolean; - createSVGMatrix(): SVGMatrix; - createSVGPoint(): SVGPoint; - createSVGNumber(): SVGNumber; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; - getElementById(elementId: string): Element; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "zoom", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var SVGSVGElement: { - prototype: SVGSVGElement; - new(): SVGSVGElement; -} - -interface HTMLLabelElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the object to which the given label object is assigned. - */ - htmlFor: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; -} -declare var HTMLLabelElement: { - prototype: HTMLLabelElement; - new(): HTMLLabelElement; -} - -interface MSResourceMetadata { - protocol: string; - fileSize: string; - fileUpdatedDate: string; - nameProp: string; - fileCreatedDate: string; - fileModifiedDate: string; - mimeType: string; -} - -interface HTMLLegendElement extends HTMLElement, MSDataBindingExtensions { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - align: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; -} -declare var HTMLLegendElement: { - prototype: HTMLLegendElement; - new(): HTMLLegendElement; -} - -interface HTMLDirectoryElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { -} -declare var HTMLDirectoryElement: { - prototype: HTMLDirectoryElement; - new(): HTMLDirectoryElement; -} - -interface SVGAnimatedInteger { - animVal: number; - baseVal: number; -} -declare var SVGAnimatedInteger: { - prototype: SVGAnimatedInteger; - new(): SVGAnimatedInteger; -} - -interface SVGTextElement extends SVGTextPositioningElement, SVGTransformable { -} -declare var SVGTextElement: { - prototype: SVGTextElement; - new(): SVGTextElement; -} - -interface SVGTSpanElement extends SVGTextPositioningElement { -} -declare var SVGTSpanElement: { - prototype: SVGTSpanElement; - new(): SVGTSpanElement; -} - -interface HTMLLIElement extends HTMLElement, DOML2DeprecatedListNumberingAndBulletStyle { - /** - * Sets or retrieves the value of a list item. - */ - value: number; -} -declare var HTMLLIElement: { - prototype: HTMLLIElement; - new(): HTMLLIElement; -} - -interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg { - y: number; -} -declare var SVGPathSegLinetoVerticalAbs: { - prototype: SVGPathSegLinetoVerticalAbs; - new(): SVGPathSegLinetoVerticalAbs; -} - -interface MSStorageExtensions { - remainingSpace: number; -} - -interface SVGStyleElement extends SVGElement, SVGLangSpace { - media: string; - type: string; - title: string; -} -declare var SVGStyleElement: { - prototype: SVGStyleElement; - new(): SVGStyleElement; -} - -interface MSCurrentStyleCSSProperties extends MSCSSProperties { - blockDirection: string; - clipBottom: string; - clipLeft: string; - clipRight: string; - clipTop: string; - hasLayout: string; -} -declare var MSCurrentStyleCSSProperties: { - prototype: MSCurrentStyleCSSProperties; - new(): MSCurrentStyleCSSProperties; -} - -interface MSHTMLCollectionExtensions { - urns(urn: any): any; - tags(tagName: any): any; -} - -interface Storage extends MSStorageExtensions { - length: number; - getItem(key: string): any; - [key: string]: any; - setItem(key: string, data: string): void; - clear(): void; - removeItem(key: string): void; - key(index: number): string; - [index: number]: string; -} -declare var Storage: { - prototype: Storage; - new(): Storage; -} - -interface HTMLIFrameElement extends HTMLElement, GetSVGDocument, MSDataBindingExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Sets or retrieves whether the frame can be scrolled. - */ - scrolling: string; - /** - * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. - */ - marginHeight: string; - /** - * Sets or retrieves the left and right margin widths before displaying the text in a frame. - */ - marginWidth: string; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves whether the user can resize the frame. - */ - noResize: boolean; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Retrieves the object of the specified. - */ - contentWindow: Window; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the frame name. - */ - name: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Retrieves the document object of the page or frame. - */ - contentDocument: Document; - /** - * Sets or retrieves the horizontal margin for the object. - */ - hspace: number; - /** - * Sets or retrieves a URI to a long description of the object. - */ - longDesc: string; - /** - * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. - */ - security: any; - /** - * Raised when the object has been completely received from the server. - */ - onload: (ev: Event) => any; - sandbox: DOMSettableTokenList; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLIFrameElement: { - prototype: HTMLIFrameElement; - new(): HTMLIFrameElement; -} - -interface TextRangeCollection { - length: number; - item(index: number): TextRange; - [index: number]: TextRange; -} -declare var TextRangeCollection: { - prototype: TextRangeCollection; - new(): TextRangeCollection; -} - -interface HTMLBodyElement extends HTMLElement, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { - scroll: string; - ononline: (ev: Event) => any; - onblur: (ev: FocusEvent) => any; - noWrap: boolean; - onfocus: (ev: FocusEvent) => any; - onmessage: (ev: MessageEvent) => any; - text: any; - onerror: (ev: ErrorEvent) => any; - bgProperties: string; - onresize: (ev: UIEvent) => any; - link: any; - aLink: any; - bottomMargin: any; - topMargin: any; - onafterprint: (ev: Event) => any; - vLink: any; - onbeforeprint: (ev: Event) => any; - onoffline: (ev: Event) => any; - onunload: (ev: Event) => any; - onhashchange: (ev: Event) => any; - onload: (ev: Event) => any; - rightMargin: any; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - leftMargin: any; - onstorage: (ev: StorageEvent) => any; - onpopstate: (ev: PopStateEvent) => any; - onpageshow: (ev: PageTransitionEvent) => any; - onpagehide: (ev: PageTransitionEvent) => any; - createTextRange(): TextRange; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLBodyElement: { - prototype: HTMLBodyElement; - new(): HTMLBodyElement; -} - -interface DocumentType extends Node { - name: string; - notations: NamedNodeMap; - systemId: string; - internalSubset: string; - entities: NamedNodeMap; - publicId: string; -} -declare var DocumentType: { - prototype: DocumentType; - new(): DocumentType; -} - -interface SVGRadialGradientElement extends SVGGradientElement { - cx: SVGAnimatedLength; - r: SVGAnimatedLength; - cy: SVGAnimatedLength; - fx: SVGAnimatedLength; - fy: SVGAnimatedLength; -} -declare var SVGRadialGradientElement: { - prototype: SVGRadialGradientElement; - new(): SVGRadialGradientElement; -} - -interface MutationEvent extends Event { - newValue: string; - attrChange: number; - attrName: string; - prevValue: string; - relatedNode: Node; - initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; - MODIFICATION: number; - REMOVAL: number; - ADDITION: number; -} -declare var MutationEvent: { - prototype: MutationEvent; - new(): MutationEvent; - MODIFICATION: number; - REMOVAL: number; - ADDITION: number; -} - -interface DragEvent extends MouseEvent { - dataTransfer: DataTransfer; - initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void; - msConvertURL(file: File, targetType: string, targetURL?: string): void; -} -declare var DragEvent: { - prototype: DragEvent; - new(): DragEvent; -} - -interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundColorStyle { +interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment { /** * Sets or retrieves a value that indicates the table alignment. */ @@ -7808,650 +9999,125 @@ interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment, DOML2 * @param index Number that specifies the zero-based position in the rows collection of the row to remove. */ deleteRow(index?: number): void; - /** - * Moves a table row to a new position. - * @param indexFrom Number that specifies the index in the rows collection of the table row that is moved. - * @param indexTo Number that specifies where the row is moved within the rows collection. - */ - moveRow(indexFrom?: number, indexTo?: number): any; /** * Creates a new row (tr) in the table, and adds the row to the rows collection. * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. */ insertRow(index?: number): HTMLElement; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var HTMLTableSectionElement: { prototype: HTMLTableSectionElement; new(): HTMLTableSectionElement; } -interface DOML2DeprecatedListNumberingAndBulletStyle { - type: string; -} - -interface HTMLInputElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: string; - status: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Gets or sets the starting position or offset of a text selection. - */ - selectionStart: number; - indeterminate: boolean; - readOnly: boolean; - size: number; - loop: number; - /** - * Gets or sets the end position or offset of a text selection. - */ - selectionEnd: number; - /** - * Sets or retrieves the URL of the virtual reality modeling language (VRML) world to be displayed in the window. - */ - vrml: string; - /** - * Sets or retrieves a lower resolution image to display. - */ - lowsrc: string; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Sets or retrieves a comma-separated list of content types. - */ - accept: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves the state of the check box or radio button. - */ - defaultChecked: boolean; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Returns the value of the data at the cursor's current position. - */ - value: string; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - border: string; - dynsrc: string; - /** - * Sets or retrieves the state of the check box or radio button. - */ - checked: boolean; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - hspace: number; - /** - * Sets or retrieves the maximum number of characters that the user can enter in a text control. - */ - maxLength: number; - /** - * Returns the content type of the object. - */ - type: string; - /** - * Sets or retrieves the initial contents of the object. - */ - defaultValue: string; - /** - * Retrieves whether the object is fully loaded. - */ - complete: boolean; - start: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a FileList object on a file type input object. - */ - files: FileList; - /** - * Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field. - */ - max: string; - /** - * Overrides the target attribute on a form element. - */ - formTarget: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field. - */ - step: string; +interface HTMLTextAreaElement extends HTMLElement { /** * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. */ autofocus: boolean; /** - * When present, marks an element that can't be submitted without a value. + * Sets or retrieves the width of the object. */ - required: boolean; + cols: number; /** - * Used to override the encoding (formEnctype attribute) specified on the form element. + * Sets or retrieves the initial contents of the object. */ - formEnctype: string; + defaultValue: string; + disabled: boolean; /** - * Returns the input field value as a number. + * Retrieves a reference to the form that the object is embedded in. */ - valueAsNumber: number; + form: HTMLFormElement; + /** + * Sets or retrieves the maximum number of characters that the user can enter in a text control. + */ + maxLength: number; + /** + * Sets or retrieves the name of the object. + */ + name: string; /** * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. */ placeholder: string; /** - * Overrides the submit method attribute previously specified on a form element. + * Sets or retrieves the value indicated whether the content of the object is read-only. */ - formMethod: string; + readOnly: boolean; /** - * Specifies the ID of a pre-defined datalist of options for an input element. + * When present, marks an element that can't be submitted without a value. */ - list: HTMLElement; + required: boolean; /** - * Specifies whether autocomplete is applied to an editable text field. + * Sets or retrieves the number of horizontal rows contained in the object. */ - autocomplete: string; + rows: number; /** - * Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field. + * Gets or sets the end position or offset of a text selection. */ - min: string; + selectionEnd: number; /** - * Overrides the action attribute (where the data on a form is sent) on the parent form element. + * Gets or sets the starting position or offset of a text selection. */ - formAction: string; + selectionStart: number; /** - * Gets or sets a string containing a regular expression that the user's input must match. + * Sets or retrieves the value indicating whether the control is selected. */ - pattern: string; + status: any; + /** + * Retrieves the type of control. + */ + type: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; /** * Returns a ValidityState object that represents the validity states of an element. */ validity: ValidityState; /** - * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. + * Retrieves or sets the text in the entry field of the textArea element. */ - formNoValidate: string; + value: string; /** - * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. + * Returns whether an element will successfully validate based on forms validation rules and constraints. */ - multiple: boolean; + willValidate: boolean; + /** + * Sets or retrieves how to handle wordwrapping in the object. + */ + wrap: string; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; /** * Creates a TextRange object for the element. */ createTextRange(): TextRange; + /** + * Highlights the input area of a form element. + */ + select(): void; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; /** * Sets the start and end positions of a selection in a text field. * @param start The offset into the text field for the start of the selection. * @param end The offset into the text field for the end of the selection. */ setSelectionRange(start: number, end: number): void; - /** - * Makes the selection equal to the current object. - */ - select(): void; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. - * @param n Value to decrement the value by. - */ - stepDown(n?: number): void; - /** - * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value. - * @param n Value to increment the value by. - */ - stepUp(n?: number): void; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLInputElement: { - prototype: HTMLInputElement; - new(): HTMLInputElement; } -interface HTMLAnchorElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rel: string; - /** - * Contains the protocol of the URL. - */ - protocol: string; - /** - * Sets or retrieves the substring of the href property that follows the question mark. - */ - search: string; - /** - * Sets or retrieves the coordinates of the object. - */ - coords: string; - /** - * Contains the hostname of a URL. - */ - hostname: string; - /** - * Contains the pathname of the URL. - */ - pathname: string; - Methods: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - protocolLong: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or retrieves the shape of the object. - */ - name: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the language code of the object. - */ - hreflang: string; - /** - * Sets or retrieves the port number associated with a URL. - */ - port: string; - /** - * Contains the hostname and port values of the URL. - */ - host: string; - /** - * Contains the anchor portion of the URL including the hash sign (#). - */ - hash: string; - nameProp: string; - urn: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rev: string; - /** - * Sets or retrieves the shape of the object. - */ - shape: string; - type: string; - mimeType: string; - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; - /** - * Returns a string representation of an object. - */ - toString(): string; -} -declare var HTMLAnchorElement: { - prototype: HTMLAnchorElement; - new(): HTMLAnchorElement; -} - -interface HTMLParamElement extends HTMLElement { - /** - * Sets or retrieves the value of an input parameter for an element. - */ - value: string; - /** - * Sets or retrieves the name of an input parameter for an element. - */ - name: string; - /** - * Sets or retrieves the content type of the resource designated by the value attribute. - */ - type: string; - /** - * Sets or retrieves the data type of the value attribute. - */ - valueType: string; -} -declare var HTMLParamElement: { - prototype: HTMLParamElement; - new(): HTMLParamElement; -} - -interface SVGImageElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGImageElement: { - prototype: SVGImageElement; - new(): SVGImageElement; -} - -interface SVGAnimatedNumber { - animVal: number; - baseVal: number; -} -declare var SVGAnimatedNumber: { - prototype: SVGAnimatedNumber; - new(): SVGAnimatedNumber; -} - -interface PerformanceTiming { - redirectStart: number; - domainLookupEnd: number; - responseStart: number; - domComplete: number; - domainLookupStart: number; - loadEventStart: number; - msFirstPaint: number; - unloadEventEnd: number; - fetchStart: number; - requestStart: number; - domInteractive: number; - navigationStart: number; - connectEnd: number; - loadEventEnd: number; - connectStart: number; - responseEnd: number; - domLoading: number; - redirectEnd: number; - unloadEventStart: number; - domContentLoadedEventStart: number; - domContentLoadedEventEnd: number; - toJSON(): any; -} -declare var PerformanceTiming: { - prototype: PerformanceTiming; - new(): PerformanceTiming; -} - -interface HTMLPreElement extends HTMLElement, DOML2DeprecatedTextFlowControl { - /** - * Sets or gets a value that you can use to implement your own width functionality for the object. - */ - width: number; - /** - * Indicates a citation by rendering text in italic type. - */ - cite: string; -} -declare var HTMLPreElement: { - prototype: HTMLPreElement; - new(): HTMLPreElement; -} - -interface EventException { - code: number; - message: string; - name: string; - toString(): string; - DISPATCH_REQUEST_ERR: number; - UNSPECIFIED_EVENT_TYPE_ERR: number; -} -declare var EventException: { - prototype: EventException; - new(): EventException; - DISPATCH_REQUEST_ERR: number; - UNSPECIFIED_EVENT_TYPE_ERR: number; -} - -interface MSNavigatorDoNotTrack { - msDoNotTrack: string; - removeSiteSpecificTrackingException(args: ExceptionInformation): void; - removeWebWideTrackingException(args: ExceptionInformation): void; - storeWebWideTrackingException(args: StoreExceptionsInformation): void; - storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void; - confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean; - confirmWebWideTrackingException(args: ExceptionInformation): boolean; -} - -interface NavigatorOnLine { - onLine: boolean; -} - -interface WindowLocalStorage { - localStorage: Storage; -} - -interface SVGMetadataElement extends SVGElement { -} -declare var SVGMetadataElement: { - prototype: SVGMetadataElement; - new(): SVGMetadataElement; -} - -interface SVGPathSegArcRel extends SVGPathSeg { - y: number; - sweepFlag: boolean; - r2: number; - x: number; - angle: number; - r1: number; - largeArcFlag: boolean; -} -declare var SVGPathSegArcRel: { - prototype: SVGPathSegArcRel; - new(): SVGPathSegArcRel; -} - -interface SVGPathSegMovetoAbs extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegMovetoAbs: { - prototype: SVGPathSegMovetoAbs; - new(): SVGPathSegMovetoAbs; -} - -interface SVGStringList { - numberOfItems: number; - replaceItem(newItem: string, index: number): string; - getItem(index: number): string; - clear(): void; - appendItem(newItem: string): string; - initialize(newItem: string): string; - removeItem(index: number): string; - insertItemBefore(newItem: string, index: number): string; -} -declare var SVGStringList: { - prototype: SVGStringList; - new(): SVGStringList; -} - -interface XDomainRequest { - timeout: number; - onerror: (ev: ErrorEvent) => any; - onload: (ev: Event) => any; - onprogress: (ev: ProgressEvent) => any; - ontimeout: (ev: Event) => any; - responseText: string; - contentType: string; - open(method: string, url: string): void; - abort(): void; - send(data?: any): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var XDomainRequest: { - prototype: XDomainRequest; - new(): XDomainRequest; - create(): XDomainRequest; -} - -interface DOML2DeprecatedBackgroundColorStyle { - bgColor: any; -} - -interface ElementTraversal { - childElementCount: number; - previousElementSibling: Element; - lastElementChild: Element; - nextElementSibling: Element; - firstElementChild: Element; -} - -interface SVGLength { - valueAsString: string; - valueInSpecifiedUnits: number; - value: number; - unitType: number; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - convertToSpecifiedUnits(unitType: number): void; - SVG_LENGTHTYPE_NUMBER: number; - SVG_LENGTHTYPE_CM: number; - SVG_LENGTHTYPE_PC: number; - SVG_LENGTHTYPE_PERCENTAGE: number; - SVG_LENGTHTYPE_MM: number; - SVG_LENGTHTYPE_PT: number; - SVG_LENGTHTYPE_IN: number; - SVG_LENGTHTYPE_EMS: number; - SVG_LENGTHTYPE_PX: number; - SVG_LENGTHTYPE_UNKNOWN: number; - SVG_LENGTHTYPE_EXS: number; -} -declare var SVGLength: { - prototype: SVGLength; - new(): SVGLength; - SVG_LENGTHTYPE_NUMBER: number; - SVG_LENGTHTYPE_CM: number; - SVG_LENGTHTYPE_PC: number; - SVG_LENGTHTYPE_PERCENTAGE: number; - SVG_LENGTHTYPE_MM: number; - SVG_LENGTHTYPE_PT: number; - SVG_LENGTHTYPE_IN: number; - SVG_LENGTHTYPE_EMS: number; - SVG_LENGTHTYPE_PX: number; - SVG_LENGTHTYPE_UNKNOWN: number; - SVG_LENGTHTYPE_EXS: number; -} - -interface SVGPolygonElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGAnimatedPoints, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGPolygonElement: { - prototype: SVGPolygonElement; - new(): SVGPolygonElement; -} - -interface HTMLPhraseElement extends HTMLElement { - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; - /** - * Sets or retrieves reference information about the object. - */ - cite: string; -} -declare var HTMLPhraseElement: { - prototype: HTMLPhraseElement; - new(): HTMLPhraseElement; -} - -interface NavigatorStorageUtils { -} - -interface SVGPathSegCurvetoCubicRel extends SVGPathSeg { - y: number; - y1: number; - x2: number; - x: number; - x1: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicRel: { - prototype: SVGPathSegCurvetoCubicRel; - new(): SVGPathSegCurvetoCubicRel; -} - -interface SVGTextContentElement extends SVGElement, SVGStylable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - textLength: SVGAnimatedLength; - lengthAdjust: SVGAnimatedEnumeration; - getCharNumAtPosition(point: SVGPoint): number; - getStartPositionOfChar(charnum: number): SVGPoint; - getExtentOfChar(charnum: number): SVGRect; - getComputedTextLength(): number; - getSubStringLength(charnum: number, nchars: number): number; - selectSubString(charnum: number, nchars: number): void; - getNumberOfChars(): number; - getRotationOfChar(charnum: number): number; - getEndPositionOfChar(charnum: number): SVGPoint; - LENGTHADJUST_SPACING: number; - LENGTHADJUST_SPACINGANDGLYPHS: number; - LENGTHADJUST_UNKNOWN: number; -} -declare var SVGTextContentElement: { - prototype: SVGTextContentElement; - new(): SVGTextContentElement; - LENGTHADJUST_SPACING: number; - LENGTHADJUST_SPACINGANDGLYPHS: number; - LENGTHADJUST_UNKNOWN: number; -} - -interface DOML2DeprecatedColorProperty { - color: string; -} - -interface Location { - hash: string; - protocol: string; - search: string; - href: string; - hostname: string; - port: string; - pathname: string; - host: string; - reload(flag?: boolean): void; - replace(url: string): void; - assign(url: string): void; - toString(): string; -} -declare var Location: { - prototype: Location; - new(): Location; +declare var HTMLTextAreaElement: { + prototype: HTMLTextAreaElement; + new(): HTMLTextAreaElement; } interface HTMLTitleElement extends HTMLElement { @@ -8460,719 +10126,215 @@ interface HTMLTitleElement extends HTMLElement { */ text: string; } + declare var HTMLTitleElement: { prototype: HTMLTitleElement; new(): HTMLTitleElement; } -interface HTMLStyleElement extends HTMLElement, LinkStyle { - /** - * Sets or retrieves the media type. - */ - media: string; - /** - * Retrieves the CSS language in which the style sheet is written. - */ +interface HTMLTrackElement extends HTMLElement { + default: boolean; + kind: string; + label: string; + readyState: number; + src: string; + srclang: string; + track: TextTrack; + ERROR: number; + LOADED: number; + LOADING: number; + NONE: number; +} + +declare var HTMLTrackElement: { + prototype: HTMLTrackElement; + new(): HTMLTrackElement; + ERROR: number; + LOADED: number; + LOADING: number; + NONE: number; +} + +interface HTMLUListElement extends HTMLElement { + compact: boolean; type: string; } -declare var HTMLStyleElement: { - prototype: HTMLStyleElement; - new(): HTMLStyleElement; + +declare var HTMLUListElement: { + prototype: HTMLUListElement; + new(): HTMLUListElement; } -interface PerformanceEntry { - name: string; - startTime: number; - duration: number; - entryType: string; -} -declare var PerformanceEntry: { - prototype: PerformanceEntry; - new(): PerformanceEntry; +interface HTMLUnknownElement extends HTMLElement { } -interface SVGTransform { - type: number; - angle: number; - matrix: SVGMatrix; - setTranslate(tx: number, ty: number): void; - setScale(sx: number, sy: number): void; - setMatrix(matrix: SVGMatrix): void; - setSkewY(angle: number): void; - setRotate(angle: number, cx: number, cy: number): void; - setSkewX(angle: number): void; - SVG_TRANSFORM_SKEWX: number; - SVG_TRANSFORM_UNKNOWN: number; - SVG_TRANSFORM_SCALE: number; - SVG_TRANSFORM_TRANSLATE: number; - SVG_TRANSFORM_MATRIX: number; - SVG_TRANSFORM_ROTATE: number; - SVG_TRANSFORM_SKEWY: number; -} -declare var SVGTransform: { - prototype: SVGTransform; - new(): SVGTransform; - SVG_TRANSFORM_SKEWX: number; - SVG_TRANSFORM_UNKNOWN: number; - SVG_TRANSFORM_SCALE: number; - SVG_TRANSFORM_TRANSLATE: number; - SVG_TRANSFORM_MATRIX: number; - SVG_TRANSFORM_ROTATE: number; - SVG_TRANSFORM_SKEWY: number; -} - -interface UIEvent extends Event { - detail: number; - view: Window; - initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void; -} -declare var UIEvent: { - prototype: UIEvent; - new(): UIEvent; -} - -interface SVGURIReference { - href: SVGAnimatedString; -} - -interface SVGPathSeg { - pathSegType: number; - pathSegTypeAsLetter: string; - PATHSEG_MOVETO_REL: number; - PATHSEG_LINETO_VERTICAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - PATHSEG_CURVETO_QUADRATIC_REL: number; - PATHSEG_CURVETO_CUBIC_ABS: number; - PATHSEG_LINETO_HORIZONTAL_ABS: number; - PATHSEG_CURVETO_QUADRATIC_ABS: number; - PATHSEG_LINETO_ABS: number; - PATHSEG_CLOSEPATH: number; - PATHSEG_LINETO_HORIZONTAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - PATHSEG_LINETO_REL: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - PATHSEG_ARC_REL: number; - PATHSEG_CURVETO_CUBIC_REL: number; - PATHSEG_UNKNOWN: number; - PATHSEG_LINETO_VERTICAL_ABS: number; - PATHSEG_ARC_ABS: number; - PATHSEG_MOVETO_ABS: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; -} -declare var SVGPathSeg: { - prototype: SVGPathSeg; - new(): SVGPathSeg; - PATHSEG_MOVETO_REL: number; - PATHSEG_LINETO_VERTICAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - PATHSEG_CURVETO_QUADRATIC_REL: number; - PATHSEG_CURVETO_CUBIC_ABS: number; - PATHSEG_LINETO_HORIZONTAL_ABS: number; - PATHSEG_CURVETO_QUADRATIC_ABS: number; - PATHSEG_LINETO_ABS: number; - PATHSEG_CLOSEPATH: number; - PATHSEG_LINETO_HORIZONTAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - PATHSEG_LINETO_REL: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - PATHSEG_ARC_REL: number; - PATHSEG_CURVETO_CUBIC_REL: number; - PATHSEG_UNKNOWN: number; - PATHSEG_LINETO_VERTICAL_ABS: number; - PATHSEG_ARC_ABS: number; - PATHSEG_MOVETO_ABS: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; -} - -interface WheelEvent extends MouseEvent { - deltaZ: number; - deltaX: number; - deltaMode: number; - deltaY: number; - initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void; - getCurrentPoint(element: Element): void; - DOM_DELTA_PIXEL: number; - DOM_DELTA_LINE: number; - DOM_DELTA_PAGE: number; -} -declare var WheelEvent: { - prototype: WheelEvent; - new(): WheelEvent; - DOM_DELTA_PIXEL: number; - DOM_DELTA_LINE: number; - DOM_DELTA_PAGE: number; -} - -interface MSEventAttachmentTarget { - attachEvent(event: string, listener: EventListener): boolean; - detachEvent(event: string, listener: EventListener): void; -} - -interface SVGNumber { - value: number; -} -declare var SVGNumber: { - prototype: SVGNumber; - new(): SVGNumber; -} - -interface SVGPathElement extends SVGElement, SVGStylable, SVGAnimatedPathData, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - getPathSegAtLength(distance: number): number; - getPointAtLength(distance: number): SVGPoint; - createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs; - createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel; - createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel; - createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs; - createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs; - createSVGPathSegClosePath(): SVGPathSegClosePath; - createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel; - createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel; - createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel; - createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs; - createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs; - createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel; - createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel; - createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs; - createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel; - getTotalLength(): number; - createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel; - createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs; - createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs; - createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs; -} -declare var SVGPathElement: { - prototype: SVGPathElement; - new(): SVGPathElement; -} - -interface MSCompatibleInfo { - version: string; - userAgent: string; -} -declare var MSCompatibleInfo: { - prototype: MSCompatibleInfo; - new(): MSCompatibleInfo; -} - -interface Text extends CharacterData, MSNodeExtensions { - wholeText: string; - splitText(offset: number): Text; - replaceWholeText(content: string): Text; -} -declare var Text: { - prototype: Text; - new(): Text; -} - -interface SVGAnimatedRect { - animVal: SVGRect; - baseVal: SVGRect; -} -declare var SVGAnimatedRect: { - prototype: SVGAnimatedRect; - new(): SVGAnimatedRect; -} - -interface CSSNamespaceRule extends CSSRule { - namespaceURI: string; - prefix: string; -} -declare var CSSNamespaceRule: { - prototype: CSSNamespaceRule; - new(): CSSNamespaceRule; -} - -interface SVGPathSegList { - numberOfItems: number; - replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg; - getItem(index: number): SVGPathSeg; - clear(): void; - appendItem(newItem: SVGPathSeg): SVGPathSeg; - initialize(newItem: SVGPathSeg): SVGPathSeg; - removeItem(index: number): SVGPathSeg; - insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg; -} -declare var SVGPathSegList: { - prototype: SVGPathSegList; - new(): SVGPathSegList; -} - -interface HTMLUnknownElement extends HTMLElement, MSDataBindingRecordSetReadonlyExtensions { -} declare var HTMLUnknownElement: { prototype: HTMLUnknownElement; new(): HTMLUnknownElement; } -interface HTMLAudioElement extends HTMLMediaElement { -} -declare var HTMLAudioElement: { - prototype: HTMLAudioElement; - new(): HTMLAudioElement; -} - -interface MSImageResourceExtensions { - dynsrc: string; - vrml: string; - lowsrc: string; - start: string; - loop: number; -} - -interface PositionError { - code: number; - message: string; - toString(): string; - POSITION_UNAVAILABLE: number; - PERMISSION_DENIED: number; - TIMEOUT: number; -} -declare var PositionError: { - prototype: PositionError; - new(): PositionError; - POSITION_UNAVAILABLE: number; - PERMISSION_DENIED: number; - TIMEOUT: number; -} - -interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { +interface HTMLVideoElement extends HTMLMediaElement { /** - * Sets or retrieves the width of the object. + * Gets or sets the height of the video element. */ - width: number; - /** - * Sets or retrieves a list of header cells that provide information for the object. - */ - headers: string; - /** - * Retrieves the position of the object in the cells collection of a row. - */ - cellIndex: number; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorLight: any; - /** - * Sets or retrieves the number columns in the table that the object should span. - */ - colSpan: number; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves a comma-delimited list of conceptual categories associated with the object. - */ - axis: string; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; - /** - * Sets or retrieves abbreviated text for the object. - */ - abbr: string; - /** - * Sets or retrieves how many rows in a table the cell should span. - */ - rowSpan: number; - /** - * Sets or retrieves the group of cells in a table to which the object's information applies. - */ - scope: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorDark: any; -} -declare var HTMLTableCellElement: { - prototype: HTMLTableCellElement; - new(): HTMLTableCellElement; -} - -interface SVGElementInstance extends EventTarget { - previousSibling: SVGElementInstance; - parentNode: SVGElementInstance; - lastChild: SVGElementInstance; - nextSibling: SVGElementInstance; - childNodes: SVGElementInstanceList; - correspondingUseElement: SVGUseElement; - correspondingElement: SVGElement; - firstChild: SVGElementInstance; -} -declare var SVGElementInstance: { - prototype: SVGElementInstance; - new(): SVGElementInstance; -} - -interface MSNamespaceInfoCollection { - length: number; - add(namespace?: string, urn?: string, implementationUrl?: any): any; - item(index: any): any; - // [index: any]: any; -} -declare var MSNamespaceInfoCollection: { - prototype: MSNamespaceInfoCollection; - new(): MSNamespaceInfoCollection; -} - -interface SVGCircleElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - cx: SVGAnimatedLength; - r: SVGAnimatedLength; - cy: SVGAnimatedLength; -} -declare var SVGCircleElement: { - prototype: SVGCircleElement; - new(): SVGCircleElement; -} - -interface StyleSheetList { - length: number; - item(index?: number): StyleSheet; - [index: number]: StyleSheet; -} -declare var StyleSheetList: { - prototype: StyleSheetList; - new(): StyleSheetList; -} - -interface CSSImportRule extends CSSRule { - styleSheet: CSSStyleSheet; - href: string; - media: MediaList; -} -declare var CSSImportRule: { - prototype: CSSImportRule; - new(): CSSImportRule; -} - -interface CustomEvent extends Event { - detail: any; - initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void; -} -declare var CustomEvent: { - prototype: CustomEvent; - new(): CustomEvent; -} - -interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty { - /** - * Sets or retrieves the current typeface family. - */ - face: string; - /** - * Sets or retrieves the font size of the object. - */ - size: number; -} -declare var HTMLBaseFontElement: { - prototype: HTMLBaseFontElement; - new(): HTMLBaseFontElement; -} - -interface HTMLTextAreaElement extends HTMLElement, MSDataBindingExtensions { - /** - * Retrieves or sets the text in the entry field of the textArea element. - */ - value: string; - /** - * Sets or retrieves the value indicating whether the control is selected. - */ - status: any; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Gets or sets the starting position or offset of a text selection. - */ - selectionStart: number; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: number; - /** - * Sets or retrieves the width of the object. - */ - cols: number; - /** - * Sets or retrieves the value indicated whether the content of the object is read-only. - */ - readOnly: boolean; - /** - * Sets or retrieves how to handle wordwrapping in the object. - */ - wrap: string; - /** - * Gets or sets the end position or offset of a text selection. - */ - selectionEnd: number; - /** - * Retrieves the type of control. - */ - type: string; - /** - * Sets or retrieves the initial contents of the object. - */ - defaultValue: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - /** - * Sets or retrieves the maximum number of characters that the user can enter in a text control. - */ - maxLength: number; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. - */ - placeholder: string; - /** - * Creates a TextRange object for the element. - */ - createTextRange(): TextRange; - /** - * Sets the start and end positions of a selection in a text field. - * @param start The offset into the text field for the start of the selection. - * @param end The offset into the text field for the end of the selection. - */ - setSelectionRange(start: number, end: number): void; - /** - * Highlights the input area of a form element. - */ - select(): void; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLTextAreaElement: { - prototype: HTMLTextAreaElement; - new(): HTMLTextAreaElement; -} - -interface Geolocation { - clearWatch(watchId: number): void; - getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void; - watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number; -} -declare var Geolocation: { - prototype: Geolocation; - new(): Geolocation; -} - -interface DOML2DeprecatedMarginStyle { - vspace: number; - hspace: number; -} - -interface MSWindowModeless { - dialogTop: any; - dialogLeft: any; - dialogWidth: any; - dialogHeight: any; - menuArguments: any; -} - -interface DOML2DeprecatedAlignmentStyle { - align: string; -} - -interface HTMLMarqueeElement extends HTMLElement, MSDataBindingExtensions, DOML2DeprecatedBackgroundColorStyle { - width: string; - onbounce: (ev: Event) => any; - vspace: number; - trueSpeed: boolean; - scrollAmount: number; - scrollDelay: number; - behavior: string; - height: string; - loop: number; - direction: string; - hspace: number; - onstart: (ev: Event) => any; - onfinish: (ev: Event) => any; - stop(): void; - start(): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "bounce", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "start", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "finish", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLMarqueeElement: { - prototype: HTMLMarqueeElement; - new(): HTMLMarqueeElement; -} - -interface SVGRect { - y: number; - width: number; - x: number; height: number; -} -declare var SVGRect: { - prototype: SVGRect; - new(): SVGRect; + msHorizontalMirror: boolean; + msIsLayoutOptimalForPlayback: boolean; + msIsStereo3D: boolean; + msStereo3DPackingMode: string; + msStereo3DRenderMode: string; + msZoom: boolean; + onMSVideoFormatChanged: (ev: Event) => any; + onMSVideoFrameStepCompleted: (ev: Event) => any; + onMSVideoOptimalLayoutChanged: (ev: Event) => any; + /** + * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available. + */ + poster: string; + /** + * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known. + */ + videoHeight: number; + /** + * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known. + */ + videoWidth: number; + webkitDisplayingFullscreen: boolean; + webkitSupportsFullscreen: boolean; + /** + * Gets or sets the width of the video element. + */ + width: number; + getVideoPlaybackQuality(): VideoPlaybackQuality; + msFrameStep(forward: boolean): void; + msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; + msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void; + webkitEnterFullScreen(): void; + webkitEnterFullscreen(): void; + webkitExitFullScreen(): void; + webkitExitFullscreen(): void; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSVideoFormatChanged", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "MSVideoFrameStepCompleted", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "MSVideoOptimalLayoutChanged", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface MSNodeExtensions { - swapNode(otherNode: Node): Node; - removeNode(deep?: boolean): Node; - replaceNode(replacement: Node): Node; +declare var HTMLVideoElement: { + prototype: HTMLVideoElement; + new(): HTMLVideoElement; +} + +interface HashChangeEvent extends Event { + newURL: string; + oldURL: string; +} + +declare var HashChangeEvent: { + prototype: HashChangeEvent; + new(type: string, eventInitDict?: HashChangeEventInit): HashChangeEvent; } interface History { @@ -9181,2002 +10343,373 @@ interface History { back(distance?: any): void; forward(distance?: any): void; go(delta?: any): void; - replaceState(statedata: any, title: string, url?: string): void; - pushState(statedata: any, title: string, url?: string): void; + pushState(statedata: any, title?: string, url?: string): void; + replaceState(statedata: any, title?: string, url?: string): void; } + declare var History: { prototype: History; new(): History; } -interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg { - y: number; - y1: number; - x2: number; - x: number; - x1: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicAbs: { - prototype: SVGPathSegCurvetoCubicAbs; - new(): SVGPathSegCurvetoCubicAbs; +interface IDBCursor { + direction: string; + key: any; + primaryKey: any; + source: any; + advance(count: number): void; + continue(key?: any): void; + delete(): IDBRequest; + update(value: any): IDBRequest; + NEXT: string; + NEXT_NO_DUPLICATE: string; + PREV: string; + PREV_NO_DUPLICATE: string; } -interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg { - y: number; - y1: number; - x: number; - x1: number; -} -declare var SVGPathSegCurvetoQuadraticAbs: { - prototype: SVGPathSegCurvetoQuadraticAbs; - new(): SVGPathSegCurvetoQuadraticAbs; +declare var IDBCursor: { + prototype: IDBCursor; + new(): IDBCursor; + NEXT: string; + NEXT_NO_DUPLICATE: string; + PREV: string; + PREV_NO_DUPLICATE: string; } -interface TimeRanges { - length: number; - start(index: number): number; - end(index: number): number; -} -declare var TimeRanges: { - prototype: TimeRanges; - new(): TimeRanges; +interface IDBCursorWithValue extends IDBCursor { + value: any; } -interface CSSRule { - cssText: string; - parentStyleSheet: CSSStyleSheet; - parentRule: CSSRule; - type: number; - IMPORT_RULE: number; - MEDIA_RULE: number; - STYLE_RULE: number; - NAMESPACE_RULE: number; - PAGE_RULE: number; - UNKNOWN_RULE: number; - FONT_FACE_RULE: number; - CHARSET_RULE: number; - KEYFRAMES_RULE: number; - KEYFRAME_RULE: number; - VIEWPORT_RULE: number; -} -declare var CSSRule: { - prototype: CSSRule; - new(): CSSRule; - IMPORT_RULE: number; - MEDIA_RULE: number; - STYLE_RULE: number; - NAMESPACE_RULE: number; - PAGE_RULE: number; - UNKNOWN_RULE: number; - FONT_FACE_RULE: number; - CHARSET_RULE: number; - KEYFRAMES_RULE: number; - KEYFRAME_RULE: number; - VIEWPORT_RULE: number; +declare var IDBCursorWithValue: { + prototype: IDBCursorWithValue; + new(): IDBCursorWithValue; } -interface SVGPathSegLinetoAbs extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegLinetoAbs: { - prototype: SVGPathSegLinetoAbs; - new(): SVGPathSegLinetoAbs; +interface IDBDatabase extends EventTarget { + name: string; + objectStoreNames: DOMStringList; + onabort: (ev: Event) => any; + onerror: (ev: Event) => any; + version: string; + close(): void; + createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; + deleteObjectStore(name: string): void; + transaction(storeNames: any, mode?: string): IDBTransaction; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface HTMLModElement extends HTMLElement { - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; - /** - * Sets or retrieves reference information about the object. - */ - cite: string; -} -declare var HTMLModElement: { - prototype: HTMLModElement; - new(): HTMLModElement; +declare var IDBDatabase: { + prototype: IDBDatabase; + new(): IDBDatabase; } -interface SVGMatrix { - e: number; - c: number; - a: number; - b: number; - d: number; - f: number; - multiply(secondMatrix: SVGMatrix): SVGMatrix; - flipY(): SVGMatrix; - skewY(angle: number): SVGMatrix; - inverse(): SVGMatrix; - scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix; - rotate(angle: number): SVGMatrix; - flipX(): SVGMatrix; - translate(x: number, y: number): SVGMatrix; - scale(scaleFactor: number): SVGMatrix; - rotateFromVector(x: number, y: number): SVGMatrix; - skewX(angle: number): SVGMatrix; -} -declare var SVGMatrix: { - prototype: SVGMatrix; - new(): SVGMatrix; +interface IDBFactory { + cmp(first: any, second: any): number; + deleteDatabase(name: string): IDBOpenDBRequest; + open(name: string, version?: number): IDBOpenDBRequest; } -interface MSPopupWindow { - document: Document; - isOpen: boolean; - show(x: number, y: number, w: number, h: number, element?: any): void; - hide(): void; -} -declare var MSPopupWindow: { - prototype: MSPopupWindow; - new(): MSPopupWindow; +declare var IDBFactory: { + prototype: IDBFactory; + new(): IDBFactory; } -interface BeforeUnloadEvent extends Event { - returnValue: string; -} -declare var BeforeUnloadEvent: { - prototype: BeforeUnloadEvent; - new(): BeforeUnloadEvent; +interface IDBIndex { + keyPath: string; + name: string; + objectStore: IDBObjectStore; + unique: boolean; + count(key?: any): IDBRequest; + get(key: any): IDBRequest; + getKey(key: any): IDBRequest; + openCursor(range?: IDBKeyRange, direction?: string): IDBRequest; + openKeyCursor(range?: IDBKeyRange, direction?: string): IDBRequest; } -interface SVGUseElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - animatedInstanceRoot: SVGElementInstance; - instanceRoot: SVGElementInstance; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGUseElement: { - prototype: SVGUseElement; - new(): SVGUseElement; +declare var IDBIndex: { + prototype: IDBIndex; + new(): IDBIndex; } -interface Event { - timeStamp: number; - defaultPrevented: boolean; - isTrusted: boolean; - currentTarget: EventTarget; - cancelBubble: boolean; - target: EventTarget; - eventPhase: number; - cancelable: boolean; - type: string; - srcElement: Element; - bubbles: boolean; - initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; - stopPropagation(): void; - stopImmediatePropagation(): void; - preventDefault(): void; - CAPTURING_PHASE: number; - AT_TARGET: number; - BUBBLING_PHASE: number; +interface IDBKeyRange { + lower: any; + lowerOpen: boolean; + upper: any; + upperOpen: boolean; } -declare var Event: { - prototype: Event; - new(): Event; - CAPTURING_PHASE: number; - AT_TARGET: number; - BUBBLING_PHASE: number; + +declare var IDBKeyRange: { + prototype: IDBKeyRange; + new(): IDBKeyRange; + bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; + lowerBound(bound: any, open?: boolean): IDBKeyRange; + only(value: any): IDBKeyRange; + upperBound(bound: any, open?: boolean): IDBKeyRange; +} + +interface IDBObjectStore { + indexNames: DOMStringList; + keyPath: string; + name: string; + transaction: IDBTransaction; + add(value: any, key?: any): IDBRequest; + clear(): IDBRequest; + count(key?: any): IDBRequest; + createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; + delete(key: any): IDBRequest; + deleteIndex(indexName: string): void; + get(key: any): IDBRequest; + index(name: string): IDBIndex; + openCursor(range?: any, direction?: string): IDBRequest; + put(value: any, key?: any): IDBRequest; +} + +declare var IDBObjectStore: { + prototype: IDBObjectStore; + new(): IDBObjectStore; +} + +interface IDBOpenDBRequest extends IDBRequest { + onblocked: (ev: Event) => any; + onupgradeneeded: (ev: IDBVersionChangeEvent) => any; + addEventListener(type: "blocked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "upgradeneeded", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBOpenDBRequest: { + prototype: IDBOpenDBRequest; + new(): IDBOpenDBRequest; +} + +interface IDBRequest extends EventTarget { + error: DOMError; + onerror: (ev: Event) => any; + onsuccess: (ev: Event) => any; + readyState: string; + result: any; + source: any; + transaction: IDBTransaction; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBRequest: { + prototype: IDBRequest; + new(): IDBRequest; +} + +interface IDBTransaction extends EventTarget { + db: IDBDatabase; + error: DOMError; + mode: string; + onabort: (ev: Event) => any; + oncomplete: (ev: Event) => any; + onerror: (ev: Event) => any; + abort(): void; + objectStore(name: string): IDBObjectStore; + READ_ONLY: string; + READ_WRITE: string; + VERSION_CHANGE: string; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBTransaction: { + prototype: IDBTransaction; + new(): IDBTransaction; + READ_ONLY: string; + READ_WRITE: string; + VERSION_CHANGE: string; +} + +interface IDBVersionChangeEvent extends Event { + newVersion: number; + oldVersion: number; +} + +declare var IDBVersionChangeEvent: { + prototype: IDBVersionChangeEvent; + new(): IDBVersionChangeEvent; } interface ImageData { - width: number; data: number[]; height: number; + width: number; } + declare var ImageData: { prototype: ImageData; new(): ImageData; } -interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves the width of the object. - */ - width: any; - /** - * Sets or retrieves the alignment of the object relative to the display or table. - */ - align: string; - /** - * Sets or retrieves the number of columns in the group. - */ - span: number; -} -declare var HTMLTableColElement: { - prototype: HTMLTableColElement; - new(): HTMLTableColElement; -} - -interface SVGException { - code: number; - message: string; - name: string; - toString(): string; - SVG_MATRIX_NOT_INVERTABLE: number; - SVG_WRONG_TYPE_ERR: number; - SVG_INVALID_VALUE_ERR: number; -} -declare var SVGException: { - prototype: SVGException; - new(): SVGException; - SVG_MATRIX_NOT_INVERTABLE: number; - SVG_WRONG_TYPE_ERR: number; - SVG_INVALID_VALUE_ERR: number; -} - -interface SVGLinearGradientElement extends SVGGradientElement { - y1: SVGAnimatedLength; - x2: SVGAnimatedLength; - x1: SVGAnimatedLength; - y2: SVGAnimatedLength; -} -declare var SVGLinearGradientElement: { - prototype: SVGLinearGradientElement; - new(): SVGLinearGradientElement; -} - -interface HTMLTableAlignment { - /** - * Sets or retrieves a value that you can use to implement your own ch functionality for the object. - */ - ch: string; - /** - * Sets or retrieves how text and other content are vertically aligned within the object that contains them. - */ - vAlign: string; - /** - * Sets or retrieves a value that you can use to implement your own chOff functionality for the object. - */ - chOff: string; -} - -interface SVGAnimatedEnumeration { - animVal: number; - baseVal: number; -} -declare var SVGAnimatedEnumeration: { - prototype: SVGAnimatedEnumeration; - new(): SVGAnimatedEnumeration; -} - -interface DOML2DeprecatedSizeProperty { - size: number; -} - -interface HTMLUListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { -} -declare var HTMLUListElement: { - prototype: HTMLUListElement; - new(): HTMLUListElement; -} - -interface SVGRectElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - ry: SVGAnimatedLength; - rx: SVGAnimatedLength; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGRectElement: { - prototype: SVGRectElement; - new(): SVGRectElement; -} - -interface ErrorEventHandler { - (event: Event, source: string, fileno: number, columnNumber: number): void; -} - -interface HTMLDivElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} -declare var HTMLDivElement: { - prototype: HTMLDivElement; - new(): HTMLDivElement; -} - -interface DOML2DeprecatedBorderStyle { - border: string; -} - -interface NamedNodeMap { - length: number; - removeNamedItemNS(namespaceURI: string, localName: string): Attr; - item(index: number): Attr; - [index: number]: Attr; - removeNamedItem(name: string): Attr; - getNamedItem(name: string): Attr; - // [name: string]: Attr; - setNamedItem(arg: Attr): Attr; - getNamedItemNS(namespaceURI: string, localName: string): Attr; - setNamedItemNS(arg: Attr): Attr; -} -declare var NamedNodeMap: { - prototype: NamedNodeMap; - new(): NamedNodeMap; -} - -interface MediaList { - length: number; - mediaText: string; - deleteMedium(oldMedium: string): void; - appendMedium(newMedium: string): void; - item(index: number): string; - [index: number]: string; - toString(): string; -} -declare var MediaList: { - prototype: MediaList; - new(): MediaList; -} - -interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegCurvetoQuadraticSmoothAbs: { - prototype: SVGPathSegCurvetoQuadraticSmoothAbs; - new(): SVGPathSegCurvetoQuadraticSmoothAbs; -} - -interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { - y: number; - x2: number; - x: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicSmoothRel: { - prototype: SVGPathSegCurvetoCubicSmoothRel; - new(): SVGPathSegCurvetoCubicSmoothRel; -} - -interface SVGLengthList { - numberOfItems: number; - replaceItem(newItem: SVGLength, index: number): SVGLength; - getItem(index: number): SVGLength; - clear(): void; - appendItem(newItem: SVGLength): SVGLength; - initialize(newItem: SVGLength): SVGLength; - removeItem(index: number): SVGLength; - insertItemBefore(newItem: SVGLength, index: number): SVGLength; -} -declare var SVGLengthList: { - prototype: SVGLengthList; - new(): SVGLengthList; -} - -interface ProcessingInstruction extends Node { - target: string; - data: string; -} -declare var ProcessingInstruction: { - prototype: ProcessingInstruction; - new(): ProcessingInstruction; -} - -interface MSWindowExtensions { - status: string; - onmouseleave: (ev: MouseEvent) => any; - screenLeft: number; - offscreenBuffering: any; - maxConnectionsPerServer: number; - onmouseenter: (ev: MouseEvent) => any; - clipboardData: DataTransfer; - defaultStatus: string; - clientInformation: Navigator; - closed: boolean; - onhelp: (ev: Event) => any; - external: External; - event: MSEventObj; - onfocusout: (ev: FocusEvent) => any; - screenTop: number; - onfocusin: (ev: FocusEvent) => any; - showModelessDialog(url?: string, argument?: any, options?: any): Window; - navigate(url: string): void; - resizeBy(x?: number, y?: number): void; - item(index: any): any; - resizeTo(x?: number, y?: number): void; - createPopup(arguments?: any): MSPopupWindow; - toStaticHTML(html: string): string; - execScript(code: string, language?: string): any; - msWriteProfilerMark(profilerMarkName: string): void; - moveTo(x?: number, y?: number): void; - moveBy(x?: number, y?: number): void; - showHelp(url: string, helpArg?: any, features?: string): void; - captureEvents(): void; - releaseEvents(): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface MSBehaviorUrnsCollection { - length: number; - item(index: number): string; -} -declare var MSBehaviorUrnsCollection: { - prototype: MSBehaviorUrnsCollection; - new(): MSBehaviorUrnsCollection; -} - -interface CSSFontFaceRule extends CSSRule { - style: CSSStyleDeclaration; -} -declare var CSSFontFaceRule: { - prototype: CSSFontFaceRule; - new(): CSSFontFaceRule; -} - -interface DOML2DeprecatedBackgroundStyle { - background: string; -} - -interface TextEvent extends UIEvent { - inputMethod: number; - data: string; - locale: string; - initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void; - DOM_INPUT_METHOD_KEYBOARD: number; - DOM_INPUT_METHOD_DROP: number; - DOM_INPUT_METHOD_IME: number; - DOM_INPUT_METHOD_SCRIPT: number; - DOM_INPUT_METHOD_VOICE: number; - DOM_INPUT_METHOD_UNKNOWN: number; - DOM_INPUT_METHOD_PASTE: number; - DOM_INPUT_METHOD_HANDWRITING: number; - DOM_INPUT_METHOD_OPTION: number; - DOM_INPUT_METHOD_MULTIMODAL: number; -} -declare var TextEvent: { - prototype: TextEvent; - new(): TextEvent; - DOM_INPUT_METHOD_KEYBOARD: number; - DOM_INPUT_METHOD_DROP: number; - DOM_INPUT_METHOD_IME: number; - DOM_INPUT_METHOD_SCRIPT: number; - DOM_INPUT_METHOD_VOICE: number; - DOM_INPUT_METHOD_UNKNOWN: number; - DOM_INPUT_METHOD_PASTE: number; - DOM_INPUT_METHOD_HANDWRITING: number; - DOM_INPUT_METHOD_OPTION: number; - DOM_INPUT_METHOD_MULTIMODAL: number; -} - -interface DocumentFragment extends Node, NodeSelector, MSEventAttachmentTarget, MSNodeExtensions { -} -declare var DocumentFragment: { - prototype: DocumentFragment; - new(): DocumentFragment; -} - -interface SVGPolylineElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGAnimatedPoints, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGPolylineElement: { - prototype: SVGPolylineElement; - new(): SVGPolylineElement; -} - -interface SVGAnimatedPathData { - pathSegList: SVGPathSegList; -} - -interface Position { - timestamp: Date; - coords: Coordinates; -} -declare var Position: { - prototype: Position; - new(): Position; -} - -interface BookmarkCollection { - length: number; - item(index: number): any; - [index: number]: any; -} -declare var BookmarkCollection: { - prototype: BookmarkCollection; - new(): BookmarkCollection; -} - -interface PerformanceMark extends PerformanceEntry { -} -declare var PerformanceMark: { - prototype: PerformanceMark; - new(): PerformanceMark; -} - -interface CSSPageRule extends CSSRule { - pseudoClass: string; - selectorText: string; - selector: string; - style: CSSStyleDeclaration; -} -declare var CSSPageRule: { - prototype: CSSPageRule; - new(): CSSPageRule; -} - -interface HTMLBRElement extends HTMLElement { - /** - * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document. - */ - clear: string; -} -declare var HTMLBRElement: { - prototype: HTMLBRElement; - new(): HTMLBRElement; -} - -interface MSNavigatorExtensions { - userLanguage: string; - plugins: MSPluginsCollection; - cookieEnabled: boolean; - appCodeName: string; - cpuClass: string; - appMinorVersion: string; - connectionSpeed: number; - browserLanguage: string; - mimeTypes: MSMimeTypesCollection; - systemLanguage: string; - language: string; - javaEnabled(): boolean; - taintEnabled(): boolean; -} - -interface HTMLSpanElement extends HTMLElement, MSDataBindingExtensions { -} -declare var HTMLSpanElement: { - prototype: HTMLSpanElement; - new(): HTMLSpanElement; -} - -interface HTMLHeadElement extends HTMLElement { - profile: string; -} -declare var HTMLHeadElement: { - prototype: HTMLHeadElement; - new(): HTMLHeadElement; -} - -interface HTMLHeadingElement extends HTMLElement, DOML2DeprecatedTextFlowControl { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; -} -declare var HTMLHeadingElement: { - prototype: HTMLHeadingElement; - new(): HTMLHeadingElement; -} - -interface HTMLFormElement extends HTMLElement, MSHTMLCollectionExtensions { - /** - * Sets or retrieves the number of objects in a collection. - */ - length: number; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form. - */ - acceptCharset: string; - /** - * Sets or retrieves the encoding type for the form. - */ - enctype: string; - /** - * Retrieves a collection, in source order, of all controls in a given form. - */ - elements: HTMLCollection; - /** - * Sets or retrieves the URL to which the form content is sent for processing. - */ - action: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Sets or retrieves how to send the form data to the server. - */ - method: string; - /** - * Sets or retrieves the MIME encoding for the form. - */ - encoding: string; - /** - * Specifies whether autocomplete is applied to an editable text field. - */ - autocomplete: string; - /** - * Designates a form that is not validated when submitted. - */ - noValidate: boolean; - /** - * Fires when the user resets a form. - */ - reset(): void; - /** - * Retrieves a form object or an object from an elements collection. - * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. - * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. - */ - item(name?: any, index?: any): any; - /** - * Fires when a FORM is about to be submitted. - */ - submit(): void; - /** - * Retrieves a form object or an object from an elements collection. - */ - namedItem(name: string): any; - [name: string]: any; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; -} -declare var HTMLFormElement: { - prototype: HTMLFormElement; - new(): HTMLFormElement; -} - -interface SVGZoomAndPan { - zoomAndPan: number; - SVG_ZOOMANDPAN_MAGNIFY: number; - SVG_ZOOMANDPAN_UNKNOWN: number; - SVG_ZOOMANDPAN_DISABLE: number; -} -declare var SVGZoomAndPan: SVGZoomAndPan; - -interface HTMLMediaElement extends HTMLElement { - /** - * Gets the earliest possible position, in seconds, that the playback can begin. - */ - initialTime: number; - /** - * Gets TimeRanges for the current media resource that has been played. - */ - played: TimeRanges; - /** - * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement. - */ - currentSrc: string; - readyState: any; - /** - * The autobuffer element is not supported by Internet Explorer 9. Use the preload element instead. - */ - autobuffer: boolean; - /** - * Gets or sets a flag to specify whether playback should restart after it completes. - */ - loop: boolean; - /** - * Gets information about whether the playback has ended or not. - */ - ended: boolean; - /** - * Gets a collection of buffered time ranges. - */ - buffered: TimeRanges; - /** - * Returns an object representing the current error state of the audio or video element. - */ - error: MediaError; - /** - * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. - */ - seekable: TimeRanges; - /** - * Gets or sets a value that indicates whether to start playing the media automatically. - */ - autoplay: boolean; - /** - * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player). - */ - controls: boolean; - /** - * Gets or sets the volume level for audio portions of the media element. - */ - volume: number; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - /** - * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource. - */ - playbackRate: number; - /** - * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming. - */ - duration: number; - /** - * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted. - */ - muted: boolean; - /** - * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource. - */ - defaultPlaybackRate: number; - /** - * Gets a flag that specifies whether playback is paused. - */ - paused: boolean; - /** - * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource. - */ - seeking: boolean; - /** - * Gets or sets the current playback position, in seconds. - */ - currentTime: number; - /** - * Gets or sets the current playback position, in seconds. - */ - preload: string; - /** - * Gets the current network activity for the element. - */ - networkState: number; - /** - * Specifies the purpose of the audio or video media, such as background audio or alerts. - */ - msAudioCategory: string; - /** - * Specifies whether or not to enable low-latency playback on the media element. - */ - msRealTime: boolean; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - textTracks: TextTrackList; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Returns an AudioTrackList object with the audio tracks for a given video element. - */ - audioTracks: AudioTrackList; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; - /** - * Specifies the output device id that the audio will be sent to. - */ - msAudioDeviceType: string; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - onmsneedkey: (ev: MSMediaKeyNeededEvent) => any; - /** - * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element. - */ - msKeys: MSMediaKeys; - msGraphicsTrustStatus: MSGraphicsTrust; - /** - * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not. - */ - pause(): void; - /** - * Loads and starts playback of a media resource. - */ - play(): void; - /** - * Fires immediately after the client loads the object. - */ - load(): void; - /** - * Returns a string that specifies whether the client can play a given media resource type. - */ - canPlayType(type: string): string; - /** - * Clears all effects from the media pipeline. - */ - msClearEffects(): void; - /** - * Specifies the media protection manager for a given media pipeline. - */ - msSetMediaProtectionManager(mediaProtectionManager?: any): void; - /** - * Inserts the specified audio effect into media pipeline. - */ - msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; - msSetMediaKeys(mediaKeys: MSMediaKeys): void; - addTextTrack(kind: string, label?: string, language?: string): TextTrack; - HAVE_METADATA: number; - HAVE_CURRENT_DATA: number; - HAVE_NOTHING: number; - NETWORK_NO_SOURCE: number; - HAVE_ENOUGH_DATA: number; - NETWORK_EMPTY: number; - NETWORK_LOADING: number; - NETWORK_IDLE: number; - HAVE_FUTURE_DATA: number; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLMediaElement: { - prototype: HTMLMediaElement; - new(): HTMLMediaElement; - HAVE_METADATA: number; - HAVE_CURRENT_DATA: number; - HAVE_NOTHING: number; - NETWORK_NO_SOURCE: number; - HAVE_ENOUGH_DATA: number; - NETWORK_EMPTY: number; - NETWORK_LOADING: number; - NETWORK_IDLE: number; - HAVE_FUTURE_DATA: number; -} - -interface ElementCSSInlineStyle { - runtimeStyle: MSStyleCSSProperties; - currentStyle: MSCurrentStyleCSSProperties; - doScroll(component?: any): void; - componentFromPoint(x: number, y: number): string; -} - -interface DOMParser { - parseFromString(source: string, mimeType: string): Document; -} -declare var DOMParser: { - prototype: DOMParser; - new(): DOMParser; -} - -interface MSMimeTypesCollection { - length: number; -} -declare var MSMimeTypesCollection: { - prototype: MSMimeTypesCollection; - new(): MSMimeTypesCollection; -} - -interface StyleSheet { - disabled: boolean; - ownerNode: Node; - parentStyleSheet: StyleSheet; - href: string; - media: MediaList; - type: string; - title: string; -} -declare var StyleSheet: { - prototype: StyleSheet; - new(): StyleSheet; -} - -interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { - startOffset: SVGAnimatedLength; - method: SVGAnimatedEnumeration; - spacing: SVGAnimatedEnumeration; - TEXTPATH_SPACINGTYPE_EXACT: number; - TEXTPATH_METHODTYPE_STRETCH: number; - TEXTPATH_SPACINGTYPE_AUTO: number; - TEXTPATH_SPACINGTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_ALIGN: number; -} -declare var SVGTextPathElement: { - prototype: SVGTextPathElement; - new(): SVGTextPathElement; - TEXTPATH_SPACINGTYPE_EXACT: number; - TEXTPATH_METHODTYPE_STRETCH: number; - TEXTPATH_SPACINGTYPE_AUTO: number; - TEXTPATH_SPACINGTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_ALIGN: number; -} - -interface HTMLDTElement extends HTMLElement { - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} -declare var HTMLDTElement: { - prototype: HTMLDTElement; - new(): HTMLDTElement; -} - -interface NodeList { - length: number; - item(index: number): Node; - [index: number]: Node; -} -declare var NodeList: { - prototype: NodeList; - new(): NodeList; -} - -interface XMLSerializer { - serializeToString(target: Node): string; -} -declare var XMLSerializer: { - prototype: XMLSerializer; - new(): XMLSerializer; -} - -interface PerformanceMeasure extends PerformanceEntry { -} -declare var PerformanceMeasure: { - prototype: PerformanceMeasure; - new(): PerformanceMeasure; -} - -interface SVGGradientElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGExternalResourcesRequired, SVGURIReference { - spreadMethod: SVGAnimatedEnumeration; - gradientTransform: SVGAnimatedTransformList; - gradientUnits: SVGAnimatedEnumeration; - SVG_SPREADMETHOD_REFLECT: number; - SVG_SPREADMETHOD_PAD: number; - SVG_SPREADMETHOD_UNKNOWN: number; - SVG_SPREADMETHOD_REPEAT: number; -} -declare var SVGGradientElement: { - prototype: SVGGradientElement; - new(): SVGGradientElement; - SVG_SPREADMETHOD_REFLECT: number; - SVG_SPREADMETHOD_PAD: number; - SVG_SPREADMETHOD_UNKNOWN: number; - SVG_SPREADMETHOD_REPEAT: number; -} - -interface NodeFilter { - acceptNode(n: Node): number; - SHOW_ENTITY_REFERENCE: number; - SHOW_NOTATION: number; - SHOW_ENTITY: number; - SHOW_DOCUMENT: number; - SHOW_PROCESSING_INSTRUCTION: number; - FILTER_REJECT: number; - SHOW_CDATA_SECTION: number; - FILTER_ACCEPT: number; - SHOW_ALL: number; - SHOW_DOCUMENT_TYPE: number; - SHOW_TEXT: number; - SHOW_ELEMENT: number; - SHOW_COMMENT: number; - FILTER_SKIP: number; - SHOW_ATTRIBUTE: number; - SHOW_DOCUMENT_FRAGMENT: number; -} -declare var NodeFilter: NodeFilter; - -interface SVGNumberList { - numberOfItems: number; - replaceItem(newItem: SVGNumber, index: number): SVGNumber; - getItem(index: number): SVGNumber; - clear(): void; - appendItem(newItem: SVGNumber): SVGNumber; - initialize(newItem: SVGNumber): SVGNumber; - removeItem(index: number): SVGNumber; - insertItemBefore(newItem: SVGNumber, index: number): SVGNumber; -} -declare var SVGNumberList: { - prototype: SVGNumberList; - new(): SVGNumberList; -} - -interface MediaError { - code: number; - msExtendedCode: number; - MEDIA_ERR_ABORTED: number; - MEDIA_ERR_NETWORK: number; - MEDIA_ERR_SRC_NOT_SUPPORTED: number; - MEDIA_ERR_DECODE: number; - MS_MEDIA_ERR_ENCRYPTED: number; -} -declare var MediaError: { - prototype: MediaError; - new(): MediaError; - MEDIA_ERR_ABORTED: number; - MEDIA_ERR_NETWORK: number; - MEDIA_ERR_SRC_NOT_SUPPORTED: number; - MEDIA_ERR_DECODE: number; - MS_MEDIA_ERR_ENCRYPTED: number; -} - -interface HTMLFieldSetElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLFieldSetElement: { - prototype: HTMLFieldSetElement; - new(): HTMLFieldSetElement; -} - -interface HTMLBGSoundElement extends HTMLElement { - /** - * Sets or gets the value indicating how the volume of the background sound is divided between the left speaker and the right speaker. - */ - balance: any; - /** - * Sets or gets the volume setting for the sound. - */ - volume: any; - /** - * Sets or gets the URL of a sound to play. - */ - src: string; - /** - * Sets or retrieves the number of times a sound or video clip will loop when activated. - */ - loop: number; -} -declare var HTMLBGSoundElement: { - prototype: HTMLBGSoundElement; - new(): HTMLBGSoundElement; -} - -interface Comment extends CharacterData { - text: string; -} -declare var Comment: { - prototype: Comment; - new(): Comment; -} - -interface PerformanceResourceTiming extends PerformanceEntry { - redirectStart: number; - redirectEnd: number; - domainLookupEnd: number; - responseStart: number; - domainLookupStart: number; - fetchStart: number; - requestStart: number; - connectEnd: number; - connectStart: number; - initiatorType: string; - responseEnd: number; -} -declare var PerformanceResourceTiming: { - prototype: PerformanceResourceTiming; - new(): PerformanceResourceTiming; -} - -interface CanvasPattern { -} -declare var CanvasPattern: { - prototype: CanvasPattern; - new(): CanvasPattern; -} - -interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { - /** - * Sets or retrieves the width of the object. - */ - width: number; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves whether the horizontal rule is drawn with 3-D shading. - */ - noShade: boolean; -} -declare var HTMLHRElement: { - prototype: HTMLHRElement; - new(): HTMLHRElement; -} - -interface HTMLObjectElement extends HTMLElement, GetSVGDocument, DOML2DeprecatedMarginStyle, DOML2DeprecatedBorderStyle, DOML2DeprecatedAlignmentStyle, MSDataBindingExtensions, MSDataBindingRecordSetExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Sets or retrieves the Internet media type for the code associated with the object. - */ - codeType: string; - /** - * Retrieves the contained object. - */ - object: any; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the URL of the file containing the compiled Java class. - */ - code: string; - /** - * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. - */ - archive: string; - /** - * Sets or retrieves a message to be displayed while an object is loading. - */ - standby: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves the class identifier for the object. - */ - classid: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Sets or retrieves the URL that references the data of the object. - */ - data: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Retrieves the document object of the page or frame. - */ - contentDocument: Document; - /** - * Gets or sets the optional alternative HTML script to execute if the object fails to load. - */ - altHtml: string; - /** - * Sets or retrieves the URL of the component. - */ - codeBase: string; - declare: boolean; - /** - * Sets or retrieves the MIME type of the object. - */ - type: string; - /** - * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. - */ - BaseHref: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - readyState: number; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLObjectElement: { - prototype: HTMLObjectElement; - new(): HTMLObjectElement; -} - -interface HTMLEmbedElement extends HTMLElement, GetSVGDocument { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Retrieves the palette used for the embedded document. - */ - palette: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - hidden: string; - /** - * Retrieves the URL of the plug-in used to view an embedded document. - */ - pluginspage: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Sets or retrieves the height and width units of the embed object. - */ - units: string; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - readyState: string; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; -} -declare var HTMLEmbedElement: { - prototype: HTMLEmbedElement; - new(): HTMLEmbedElement; -} - -interface StorageEvent extends Event { - oldValue: any; - newValue: any; - url: string; - storageArea: Storage; +interface KeyboardEvent extends UIEvent { + altKey: boolean; + char: string; + charCode: number; + ctrlKey: boolean; key: string; - initStorageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, keyArg: string, oldValueArg: any, newValueArg: any, urlArg: string, storageAreaArg: Storage): void; -} -declare var StorageEvent: { - prototype: StorageEvent; - new(): StorageEvent; + keyCode: number; + locale: string; + location: number; + metaKey: boolean; + repeat: boolean; + shiftKey: boolean; + which: number; + getModifierState(keyArg: string): boolean; + initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; + DOM_KEY_LOCATION_JOYSTICK: number; + DOM_KEY_LOCATION_LEFT: number; + DOM_KEY_LOCATION_MOBILE: number; + DOM_KEY_LOCATION_NUMPAD: number; + DOM_KEY_LOCATION_RIGHT: number; + DOM_KEY_LOCATION_STANDARD: number; } -interface CharacterData extends Node { - length: number; - data: string; - deleteData(offset: number, count: number): void; - replaceData(offset: number, count: number, arg: string): void; - appendData(arg: string): void; - insertData(offset: number, arg: string): void; - substringData(offset: number, count: number): string; -} -declare var CharacterData: { - prototype: CharacterData; - new(): CharacterData; +declare var KeyboardEvent: { + prototype: KeyboardEvent; + new(typeArg: string, eventInitDict?: KeyboardEventInit): KeyboardEvent; + DOM_KEY_LOCATION_JOYSTICK: number; + DOM_KEY_LOCATION_LEFT: number; + DOM_KEY_LOCATION_MOBILE: number; + DOM_KEY_LOCATION_NUMPAD: number; + DOM_KEY_LOCATION_RIGHT: number; + DOM_KEY_LOCATION_STANDARD: number; } -interface HTMLOptGroupElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the ordinal position of an option in a list box. - */ - index: number; - /** - * Sets or retrieves the status of an option. - */ - defaultSelected: boolean; - /** - * Sets or retrieves the text string specified by the option tag. - */ - text: string; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves a value that you can use to implement your own label functionality for the object. - */ - label: string; - /** - * Sets or retrieves whether the option in the list box is the default item. - */ - selected: boolean; -} -declare var HTMLOptGroupElement: { - prototype: HTMLOptGroupElement; - new(): HTMLOptGroupElement; -} - -interface HTMLIsIndexElement extends HTMLElement { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the URL to which the form content is sent for processing. - */ - action: string; - prompt: string; -} -declare var HTMLIsIndexElement: { - prototype: HTMLIsIndexElement; - new(): HTMLIsIndexElement; -} - -interface SVGPathSegLinetoRel extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegLinetoRel: { - prototype: SVGPathSegLinetoRel; - new(): SVGPathSegLinetoRel; -} - -interface DOMException { - code: number; - message: string; - name: string; +interface Location { + hash: string; + host: string; + hostname: string; + href: string; + origin: string; + pathname: string; + port: string; + protocol: string; + search: string; + assign(url: string): void; + reload(forcedReload?: boolean): void; + replace(url: string): void; toString(): string; - HIERARCHY_REQUEST_ERR: number; - NO_MODIFICATION_ALLOWED_ERR: number; - INVALID_MODIFICATION_ERR: number; - NAMESPACE_ERR: number; - INVALID_CHARACTER_ERR: number; - TYPE_MISMATCH_ERR: number; - ABORT_ERR: number; - INVALID_STATE_ERR: number; - SECURITY_ERR: number; - NETWORK_ERR: number; - WRONG_DOCUMENT_ERR: number; - QUOTA_EXCEEDED_ERR: number; - INDEX_SIZE_ERR: number; - DOMSTRING_SIZE_ERR: number; - SYNTAX_ERR: number; - SERIALIZE_ERR: number; - VALIDATION_ERR: number; - NOT_FOUND_ERR: number; - URL_MISMATCH_ERR: number; - PARSE_ERR: number; - NO_DATA_ALLOWED_ERR: number; - NOT_SUPPORTED_ERR: number; - INVALID_ACCESS_ERR: number; - INUSE_ATTRIBUTE_ERR: number; - INVALID_NODE_TYPE_ERR: number; - DATA_CLONE_ERR: number; - TIMEOUT_ERR: number; -} -declare var DOMException: { - prototype: DOMException; - new(): DOMException; - HIERARCHY_REQUEST_ERR: number; - NO_MODIFICATION_ALLOWED_ERR: number; - INVALID_MODIFICATION_ERR: number; - NAMESPACE_ERR: number; - INVALID_CHARACTER_ERR: number; - TYPE_MISMATCH_ERR: number; - ABORT_ERR: number; - INVALID_STATE_ERR: number; - SECURITY_ERR: number; - NETWORK_ERR: number; - WRONG_DOCUMENT_ERR: number; - QUOTA_EXCEEDED_ERR: number; - INDEX_SIZE_ERR: number; - DOMSTRING_SIZE_ERR: number; - SYNTAX_ERR: number; - SERIALIZE_ERR: number; - VALIDATION_ERR: number; - NOT_FOUND_ERR: number; - URL_MISMATCH_ERR: number; - PARSE_ERR: number; - NO_DATA_ALLOWED_ERR: number; - NOT_SUPPORTED_ERR: number; - INVALID_ACCESS_ERR: number; - INUSE_ATTRIBUTE_ERR: number; - INVALID_NODE_TYPE_ERR: number; - DATA_CLONE_ERR: number; - TIMEOUT_ERR: number; } -interface SVGAnimatedBoolean { - animVal: boolean; - baseVal: boolean; -} -declare var SVGAnimatedBoolean: { - prototype: SVGAnimatedBoolean; - new(): SVGAnimatedBoolean; +declare var Location: { + prototype: Location; + new(): Location; } -interface MSCompatibleInfoCollection { - length: number; - item(index: number): MSCompatibleInfo; -} -declare var MSCompatibleInfoCollection: { - prototype: MSCompatibleInfoCollection; - new(): MSCompatibleInfoCollection; +interface LongRunningScriptDetectedEvent extends Event { + executionTime: number; + stopPageScriptExecution: boolean; } -interface SVGSwitchElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGSwitchElement: { - prototype: SVGSwitchElement; - new(): SVGSwitchElement; +declare var LongRunningScriptDetectedEvent: { + prototype: LongRunningScriptDetectedEvent; + new(): LongRunningScriptDetectedEvent; } -interface SVGPreserveAspectRatio { - align: number; - meetOrSlice: number; - SVG_PRESERVEASPECTRATIO_NONE: number; - SVG_PRESERVEASPECTRATIO_XMINYMID: number; - SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - SVG_MEETORSLICE_UNKNOWN: number; - SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - SVG_PRESERVEASPECTRATIO_XMINYMIN: number; - SVG_MEETORSLICE_MEET: number; - SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - SVG_MEETORSLICE_SLICE: number; - SVG_PRESERVEASPECTRATIO_UNKNOWN: number; -} -declare var SVGPreserveAspectRatio: { - prototype: SVGPreserveAspectRatio; - new(): SVGPreserveAspectRatio; - SVG_PRESERVEASPECTRATIO_NONE: number; - SVG_PRESERVEASPECTRATIO_XMINYMID: number; - SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - SVG_MEETORSLICE_UNKNOWN: number; - SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - SVG_PRESERVEASPECTRATIO_XMINYMIN: number; - SVG_MEETORSLICE_MEET: number; - SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - SVG_MEETORSLICE_SLICE: number; - SVG_PRESERVEASPECTRATIO_UNKNOWN: number; +interface MSApp { + clearTemporaryWebDataAsync(): MSAppAsyncOperation; + createBlobFromRandomAccessStream(type: string, seeker: any): Blob; + createDataPackage(object: any): any; + createDataPackageFromSelection(): any; + createFileFromStorageFile(storageFile: any): File; + createStreamFromInputStream(type: string, inputStream: any): MSStream; + execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; + execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; + getCurrentPriority(): string; + getHtmlPrintDocumentSourceAsync(htmlDoc: any): any; + getViewId(view: any): any; + isTaskScheduledAtPriorityOrHigher(priority: string): boolean; + pageHandlesAllApplicationActivations(enabled: boolean): void; + suppressSubdownloadCredentialPrompts(suppress: boolean): void; + terminateApp(exceptionObject: any): void; + CURRENT: string; + HIGH: string; + IDLE: string; + NORMAL: string; } +declare var MSApp: MSApp; -interface Attr extends Node { - expando: boolean; - specified: boolean; - ownerElement: Element; - value: string; - name: string; -} -declare var Attr: { - prototype: Attr; - new(): Attr; -} - -interface PerformanceNavigation { - redirectCount: number; - type: number; - toJSON(): any; - TYPE_RELOAD: number; - TYPE_RESERVED: number; - TYPE_BACK_FORWARD: number; - TYPE_NAVIGATE: number; -} -declare var PerformanceNavigation: { - prototype: PerformanceNavigation; - new(): PerformanceNavigation; - TYPE_RELOAD: number; - TYPE_RESERVED: number; - TYPE_BACK_FORWARD: number; - TYPE_NAVIGATE: number; -} - -interface SVGStopElement extends SVGElement, SVGStylable { - offset: SVGAnimatedNumber; -} -declare var SVGStopElement: { - prototype: SVGStopElement; - new(): SVGStopElement; -} - -interface PositionCallback { - (position: Position): void; -} - -interface SVGSymbolElement extends SVGElement, SVGStylable, SVGLangSpace, SVGFitToViewBox, SVGExternalResourcesRequired { -} -declare var SVGSymbolElement: { - prototype: SVGSymbolElement; - new(): SVGSymbolElement; -} - -interface SVGElementInstanceList { - length: number; - item(index: number): SVGElementInstance; -} -declare var SVGElementInstanceList: { - prototype: SVGElementInstanceList; - new(): SVGElementInstanceList; -} - -interface CSSRuleList { - length: number; - item(index: number): CSSRule; - [index: number]: CSSRule; -} -declare var CSSRuleList: { - prototype: CSSRuleList; - new(): CSSRuleList; -} - -interface MSDataBindingRecordSetExtensions { - recordset: any; - namedRecordset(dataMember: string, hierarchy?: any): any; -} - -interface LinkStyle { - styleSheet: StyleSheet; - sheet: StyleSheet; -} - -interface HTMLVideoElement extends HTMLMediaElement { - /** - * Gets or sets the width of the video element. - */ - width: number; - /** - * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known. - */ - videoWidth: number; - /** - * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known. - */ - videoHeight: number; - /** - * Gets or sets the height of the video element. - */ - height: number; - /** - * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available. - */ - poster: string; - msIsStereo3D: boolean; - msStereo3DPackingMode: string; - onMSVideoOptimalLayoutChanged: (ev: any) => any; - onMSVideoFrameStepCompleted: (ev: any) => any; - msStereo3DRenderMode: string; - msIsLayoutOptimalForPlayback: boolean; - msHorizontalMirror: boolean; - onMSVideoFormatChanged: (ev: any) => any; - msZoom: boolean; - msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; - msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void; - msFrameStep(forward: boolean): void; - getVideoPlaybackQuality(): VideoPlaybackQuality; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; +interface MSAppAsyncOperation extends EventTarget { + error: DOMError; + oncomplete: (ev: Event) => any; + onerror: (ev: Event) => any; + readyState: number; + result: any; + start(): void; + COMPLETED: number; + ERROR: number; + STARTED: number; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoOptimalLayoutChanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoFrameStepCompleted", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoFormatChanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLVideoElement: { - prototype: HTMLVideoElement; - new(): HTMLVideoElement; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface ClientRectList { - length: number; - item(index: number): ClientRect; - [index: number]: ClientRect; -} -declare var ClientRectList: { - prototype: ClientRectList; - new(): ClientRectList; +declare var MSAppAsyncOperation: { + prototype: MSAppAsyncOperation; + new(): MSAppAsyncOperation; + COMPLETED: number; + ERROR: number; + STARTED: number; } -interface SVGMaskElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - maskUnits: SVGAnimatedEnumeration; - maskContentUnits: SVGAnimatedEnumeration; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGMaskElement: { - prototype: SVGMaskElement; - new(): SVGMaskElement; +interface MSBlobBuilder { + append(data: any, endings?: string): void; + getBlob(contentType?: string): Blob; } -interface External { -} -declare var External: { - prototype: External; - new(): External; +declare var MSBlobBuilder: { + prototype: MSBlobBuilder; + new(): MSBlobBuilder; } -interface MSGestureEvent extends UIEvent { - offsetY: number; - translationY: number; - velocityExpansion: number; - velocityY: number; - velocityAngular: number; - translationX: number; - velocityX: number; - hwTimestamp: number; - offsetX: number; - screenX: number; - rotation: number; - expansion: number; - clientY: number; - screenY: number; - scale: number; - gestureObject: any; - clientX: number; - initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void; - MSGESTURE_FLAG_BEGIN: number; - MSGESTURE_FLAG_END: number; - MSGESTURE_FLAG_CANCEL: number; - MSGESTURE_FLAG_INERTIA: number; - MSGESTURE_FLAG_NONE: number; -} -declare var MSGestureEvent: { - prototype: MSGestureEvent; - new(): MSGestureEvent; - MSGESTURE_FLAG_BEGIN: number; - MSGESTURE_FLAG_END: number; - MSGESTURE_FLAG_CANCEL: number; - MSGESTURE_FLAG_INERTIA: number; - MSGESTURE_FLAG_NONE: number; +interface MSCSSMatrix { + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + m11: number; + m12: number; + m13: number; + m14: number; + m21: number; + m22: number; + m23: number; + m24: number; + m31: number; + m32: number; + m33: number; + m34: number; + m41: number; + m42: number; + m43: number; + m44: number; + inverse(): MSCSSMatrix; + multiply(secondMatrix: MSCSSMatrix): MSCSSMatrix; + rotate(angleX: number, angleY?: number, angleZ?: number): MSCSSMatrix; + rotateAxisAngle(x: number, y: number, z: number, angle: number): MSCSSMatrix; + scale(scaleX: number, scaleY?: number, scaleZ?: number): MSCSSMatrix; + setMatrixValue(value: string): void; + skewX(angle: number): MSCSSMatrix; + skewY(angle: number): MSCSSMatrix; + toString(): string; + translate(x: number, y: number, z?: number): MSCSSMatrix; } -interface ErrorEvent extends Event { - colno: number; - filename: string; - error: any; - lineno: number; - message: string; - initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; -} -declare var ErrorEvent: { - prototype: ErrorEvent; - new(): ErrorEvent; -} - -interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - filterResX: SVGAnimatedInteger; - filterUnits: SVGAnimatedEnumeration; - primitiveUnits: SVGAnimatedEnumeration; - x: SVGAnimatedLength; - height: SVGAnimatedLength; - filterResY: SVGAnimatedInteger; - setFilterRes(filterResX: number, filterResY: number): void; -} -declare var SVGFilterElement: { - prototype: SVGFilterElement; - new(): SVGFilterElement; -} - -interface TrackEvent extends Event { - track: any; -} -declare var TrackEvent: { - prototype: TrackEvent; - new(): TrackEvent; -} - -interface SVGFEMergeNodeElement extends SVGElement { - in1: SVGAnimatedString; -} -declare var SVGFEMergeNodeElement: { - prototype: SVGFEMergeNodeElement; - new(): SVGFEMergeNodeElement; -} - -interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { -} -declare var SVGFEFloodElement: { - prototype: SVGFEFloodElement; - new(): SVGFEFloodElement; +declare var MSCSSMatrix: { + prototype: MSCSSMatrix; + new(text?: string): MSCSSMatrix; } interface MSGesture { @@ -11184,118 +10717,472 @@ interface MSGesture { addPointer(pointerId: number): void; stop(): void; } + declare var MSGesture: { prototype: MSGesture; new(): MSGesture; } -interface TextTrackCue extends EventTarget { - onenter: (ev: Event) => any; - track: TextTrack; - endTime: number; - text: string; - pauseOnExit: boolean; - id: string; - startTime: number; - onexit: (ev: Event) => any; - getCueAsHTML(): DocumentFragment; - addEventListener(type: "enter", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "exit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var TextTrackCue: { - prototype: TextTrackCue; - new(startTime: number, endTime: number, text: string): TextTrackCue; +interface MSGestureEvent extends UIEvent { + clientX: number; + clientY: number; + expansion: number; + gestureObject: any; + hwTimestamp: number; + offsetX: number; + offsetY: number; + rotation: number; + scale: number; + screenX: number; + screenY: number; + translationX: number; + translationY: number; + velocityAngular: number; + velocityExpansion: number; + velocityX: number; + velocityY: number; + initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void; + MSGESTURE_FLAG_BEGIN: number; + MSGESTURE_FLAG_CANCEL: number; + MSGESTURE_FLAG_END: number; + MSGESTURE_FLAG_INERTIA: number; + MSGESTURE_FLAG_NONE: number; } -interface MSStreamReader extends MSBaseReader { +declare var MSGestureEvent: { + prototype: MSGestureEvent; + new(): MSGestureEvent; + MSGESTURE_FLAG_BEGIN: number; + MSGESTURE_FLAG_CANCEL: number; + MSGESTURE_FLAG_END: number; + MSGESTURE_FLAG_INERTIA: number; + MSGESTURE_FLAG_NONE: number; +} + +interface MSGraphicsTrust { + constrictionActive: boolean; + status: string; +} + +declare var MSGraphicsTrust: { + prototype: MSGraphicsTrust; + new(): MSGraphicsTrust; +} + +interface MSHTMLWebViewElement extends HTMLElement { + canGoBack: boolean; + canGoForward: boolean; + containsFullScreenElement: boolean; + documentTitle: string; + height: number; + settings: MSWebViewSettings; + src: string; + width: number; + addWebAllowedObject(name: string, applicationObject: any): void; + buildLocalStreamUri(contentIdentifier: string, relativePath: string): string; + capturePreviewToBlobAsync(): MSWebViewAsyncOperation; + captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation; + getDeferredPermissionRequestById(id: number): DeferredPermissionRequest; + getDeferredPermissionRequests(): DeferredPermissionRequest[]; + goBack(): void; + goForward(): void; + invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation; + navigate(uri: string): void; + navigateToLocalStreamUri(source: string, streamResolver: any): void; + navigateToString(contents: string): void; + navigateWithHttpRequestMessage(requestMessage: any): void; + refresh(): void; + stop(): void; +} + +declare var MSHTMLWebViewElement: { + prototype: MSHTMLWebViewElement; + new(): MSHTMLWebViewElement; +} + +interface MSHeaderFooter { + URL: string; + dateLong: string; + dateShort: string; + font: string; + htmlFoot: string; + htmlHead: string; + page: number; + pageTotal: number; + textFoot: string; + textHead: string; + timeLong: string; + timeShort: string; + title: string; +} + +declare var MSHeaderFooter: { + prototype: MSHeaderFooter; + new(): MSHeaderFooter; +} + +interface MSInputMethodContext extends EventTarget { + compositionEndOffset: number; + compositionStartOffset: number; + oncandidatewindowhide: (ev: Event) => any; + oncandidatewindowshow: (ev: Event) => any; + oncandidatewindowupdate: (ev: Event) => any; + target: HTMLElement; + getCandidateWindowClientRect(): ClientRect; + getCompositionAlternatives(): string[]; + hasComposition(): boolean; + isCandidateWindowVisible(): boolean; + addEventListener(type: "MSCandidateWindowHide", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "MSCandidateWindowShow", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "MSCandidateWindowUpdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSInputMethodContext: { + prototype: MSInputMethodContext; + new(): MSInputMethodContext; +} + +interface MSManipulationEvent extends UIEvent { + currentState: number; + inertiaDestinationX: number; + inertiaDestinationY: number; + lastState: number; + initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void; + MS_MANIPULATION_STATE_ACTIVE: number; + MS_MANIPULATION_STATE_CANCELLED: number; + MS_MANIPULATION_STATE_COMMITTED: number; + MS_MANIPULATION_STATE_DRAGGING: number; + MS_MANIPULATION_STATE_INERTIA: number; + MS_MANIPULATION_STATE_PRESELECT: number; + MS_MANIPULATION_STATE_SELECTING: number; + MS_MANIPULATION_STATE_STOPPED: number; +} + +declare var MSManipulationEvent: { + prototype: MSManipulationEvent; + new(): MSManipulationEvent; + MS_MANIPULATION_STATE_ACTIVE: number; + MS_MANIPULATION_STATE_CANCELLED: number; + MS_MANIPULATION_STATE_COMMITTED: number; + MS_MANIPULATION_STATE_DRAGGING: number; + MS_MANIPULATION_STATE_INERTIA: number; + MS_MANIPULATION_STATE_PRESELECT: number; + MS_MANIPULATION_STATE_SELECTING: number; + MS_MANIPULATION_STATE_STOPPED: number; +} + +interface MSMediaKeyError { + code: number; + systemCode: number; + MS_MEDIA_KEYERR_CLIENT: number; + MS_MEDIA_KEYERR_DOMAIN: number; + MS_MEDIA_KEYERR_HARDWARECHANGE: number; + MS_MEDIA_KEYERR_OUTPUT: number; + MS_MEDIA_KEYERR_SERVICE: number; + MS_MEDIA_KEYERR_UNKNOWN: number; +} + +declare var MSMediaKeyError: { + prototype: MSMediaKeyError; + new(): MSMediaKeyError; + MS_MEDIA_KEYERR_CLIENT: number; + MS_MEDIA_KEYERR_DOMAIN: number; + MS_MEDIA_KEYERR_HARDWARECHANGE: number; + MS_MEDIA_KEYERR_OUTPUT: number; + MS_MEDIA_KEYERR_SERVICE: number; + MS_MEDIA_KEYERR_UNKNOWN: number; +} + +interface MSMediaKeyMessageEvent extends Event { + destinationURL: string; + message: Uint8Array; +} + +declare var MSMediaKeyMessageEvent: { + prototype: MSMediaKeyMessageEvent; + new(): MSMediaKeyMessageEvent; +} + +interface MSMediaKeyNeededEvent extends Event { + initData: Uint8Array; +} + +declare var MSMediaKeyNeededEvent: { + prototype: MSMediaKeyNeededEvent; + new(): MSMediaKeyNeededEvent; +} + +interface MSMediaKeySession extends EventTarget { + error: MSMediaKeyError; + keySystem: string; + sessionId: string; + close(): void; + update(key: Uint8Array): void; +} + +declare var MSMediaKeySession: { + prototype: MSMediaKeySession; + new(): MSMediaKeySession; +} + +interface MSMediaKeys { + keySystem: string; + createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession; +} + +declare var MSMediaKeys: { + prototype: MSMediaKeys; + new(keySystem: string): MSMediaKeys; + isTypeSupported(keySystem: string, type?: string): boolean; +} + +interface MSMimeTypesCollection { + length: number; +} + +declare var MSMimeTypesCollection: { + prototype: MSMimeTypesCollection; + new(): MSMimeTypesCollection; +} + +interface MSPluginsCollection { + length: number; + refresh(reload?: boolean): void; +} + +declare var MSPluginsCollection: { + prototype: MSPluginsCollection; + new(): MSPluginsCollection; +} + +interface MSPointerEvent extends MouseEvent { + currentPoint: any; + height: number; + hwTimestamp: number; + intermediatePoints: any; + isPrimary: boolean; + pointerId: number; + pointerType: any; + pressure: number; + rotation: number; + tiltX: number; + tiltY: number; + width: number; + getCurrentPoint(element: Element): void; + getIntermediatePoints(element: Element): void; + initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; +} + +declare var MSPointerEvent: { + prototype: MSPointerEvent; + new(typeArg: string, eventInitDict?: PointerEventInit): MSPointerEvent; +} + +interface MSPrintManagerTemplatePrinter extends MSTemplatePrinter, EventTarget { + percentScale: number; + showHeaderFooter: boolean; + shrinkToFit: boolean; + drawPreviewPage(element: HTMLElement, pageNumber: number): void; + endPrint(): void; + getPrintTaskOptionValue(key: string): any; + invalidatePreview(): void; + setPageCount(pageCount: number): void; + startPrint(): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSPrintManagerTemplatePrinter: { + prototype: MSPrintManagerTemplatePrinter; + new(): MSPrintManagerTemplatePrinter; +} + +interface MSRangeCollection { + length: number; + item(index: number): Range; + [index: number]: Range; +} + +declare var MSRangeCollection: { + prototype: MSRangeCollection; + new(): MSRangeCollection; +} + +interface MSSiteModeEvent extends Event { + actionURL: string; + buttonID: number; +} + +declare var MSSiteModeEvent: { + prototype: MSSiteModeEvent; + new(): MSSiteModeEvent; +} + +interface MSStream { + type: string; + msClose(): void; + msDetachStream(): any; +} + +declare var MSStream: { + prototype: MSStream; + new(): MSStream; +} + +interface MSStreamReader extends EventTarget, MSBaseReader { error: DOMError; readAsArrayBuffer(stream: MSStream, size?: number): void; + readAsBinaryString(stream: MSStream, size?: number): void; readAsBlob(stream: MSStream, size?: number): void; readAsDataURL(stream: MSStream, size?: number): void; readAsText(stream: MSStream, encoding?: string, size?: number): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var MSStreamReader: { prototype: MSStreamReader; new(): MSStreamReader; } -interface DOMTokenList { +interface MSTemplatePrinter { + collate: boolean; + copies: number; + currentPage: boolean; + currentPageAvail: boolean; + duplex: boolean; + footer: string; + frameActive: boolean; + frameActiveEnabled: boolean; + frameAsShown: boolean; + framesetDocument: boolean; + header: string; + headerFooterFont: string; + marginBottom: number; + marginLeft: number; + marginRight: number; + marginTop: number; + orientation: string; + pageFrom: number; + pageHeight: number; + pageTo: number; + pageWidth: number; + selectedPages: boolean; + selection: boolean; + selectionEnabled: boolean; + unprintableBottom: number; + unprintableLeft: number; + unprintableRight: number; + unprintableTop: number; + usePrinterCopyCollate: boolean; + createHeaderFooter(): MSHeaderFooter; + deviceSupports(property: string): any; + ensurePrintDialogDefaults(): boolean; + getPageMarginBottom(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; + getPageMarginBottomImportant(pageRule: CSSPageRule): boolean; + getPageMarginLeft(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; + getPageMarginLeftImportant(pageRule: CSSPageRule): boolean; + getPageMarginRight(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; + getPageMarginRightImportant(pageRule: CSSPageRule): boolean; + getPageMarginTop(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; + getPageMarginTopImportant(pageRule: CSSPageRule): boolean; + printBlankPage(): void; + printNonNative(document: any): boolean; + printNonNativeFrames(document: any, activeFrame: boolean): void; + printPage(element: HTMLElement): void; + showPageSetupDialog(): boolean; + showPrintDialog(): boolean; + startDoc(title: string): boolean; + stopDoc(): void; + updatePageStatus(status: number): void; +} + +declare var MSTemplatePrinter: { + prototype: MSTemplatePrinter; + new(): MSTemplatePrinter; +} + +interface MSWebViewAsyncOperation extends EventTarget { + error: DOMError; + oncomplete: (ev: Event) => any; + onerror: (ev: Event) => any; + readyState: number; + result: any; + target: MSHTMLWebViewElement; + type: number; + start(): void; + COMPLETED: number; + ERROR: number; + STARTED: number; + TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; + TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; + TYPE_INVOKE_SCRIPT: number; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSWebViewAsyncOperation: { + prototype: MSWebViewAsyncOperation; + new(): MSWebViewAsyncOperation; + COMPLETED: number; + ERROR: number; + STARTED: number; + TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; + TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; + TYPE_INVOKE_SCRIPT: number; +} + +interface MSWebViewSettings { + isIndexedDBEnabled: boolean; + isJavaScriptEnabled: boolean; +} + +declare var MSWebViewSettings: { + prototype: MSWebViewSettings; + new(): MSWebViewSettings; +} + +interface MediaElementAudioSourceNode extends AudioNode { +} + +declare var MediaElementAudioSourceNode: { + prototype: MediaElementAudioSourceNode; + new(): MediaElementAudioSourceNode; +} + +interface MediaError { + code: number; + msExtendedCode: number; + MEDIA_ERR_ABORTED: number; + MEDIA_ERR_DECODE: number; + MEDIA_ERR_NETWORK: number; + MEDIA_ERR_SRC_NOT_SUPPORTED: number; + MS_MEDIA_ERR_ENCRYPTED: number; +} + +declare var MediaError: { + prototype: MediaError; + new(): MediaError; + MEDIA_ERR_ABORTED: number; + MEDIA_ERR_DECODE: number; + MEDIA_ERR_NETWORK: number; + MEDIA_ERR_SRC_NOT_SUPPORTED: number; + MS_MEDIA_ERR_ENCRYPTED: number; +} + +interface MediaList { length: number; - contains(token: string): boolean; - remove(token: string): void; - toggle(token: string): boolean; - add(token: string): void; + mediaText: string; + appendMedium(newMedium: string): void; + deleteMedium(oldMedium: string): void; item(index: number): string; - [index: number]: string; toString(): string; -} -declare var DOMTokenList: { - prototype: DOMTokenList; - new(): DOMTokenList; + [index: number]: string; } -interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncAElement: { - prototype: SVGFEFuncAElement; - new(): SVGFEFuncAElement; -} - -interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; -} -declare var SVGFETileElement: { - prototype: SVGFETileElement; - new(): SVGFETileElement; -} - -interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in2: SVGAnimatedString; - mode: SVGAnimatedEnumeration; - in1: SVGAnimatedString; - SVG_FEBLEND_MODE_DARKEN: number; - SVG_FEBLEND_MODE_UNKNOWN: number; - SVG_FEBLEND_MODE_MULTIPLY: number; - SVG_FEBLEND_MODE_NORMAL: number; - SVG_FEBLEND_MODE_SCREEN: number; - SVG_FEBLEND_MODE_LIGHTEN: number; -} -declare var SVGFEBlendElement: { - prototype: SVGFEBlendElement; - new(): SVGFEBlendElement; - SVG_FEBLEND_MODE_DARKEN: number; - SVG_FEBLEND_MODE_UNKNOWN: number; - SVG_FEBLEND_MODE_MULTIPLY: number; - SVG_FEBLEND_MODE_NORMAL: number; - SVG_FEBLEND_MODE_SCREEN: number; - SVG_FEBLEND_MODE_LIGHTEN: number; -} - -interface MessageChannel { - port2: MessagePort; - port1: MessagePort; -} -declare var MessageChannel: { - prototype: MessageChannel; - new(): MessageChannel; -} - -interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { -} -declare var SVGFEMergeElement: { - prototype: SVGFEMergeElement; - new(): SVGFEMergeElement; -} - -interface TransitionEvent extends Event { - propertyName: string; - elapsedTime: number; - initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void; -} -declare var TransitionEvent: { - prototype: TransitionEvent; - new(): TransitionEvent; +declare var MediaList: { + prototype: MediaList; + new(): MediaList; } interface MediaQueryList { @@ -11304,734 +11191,49 @@ interface MediaQueryList { addListener(listener: MediaQueryListListener): void; removeListener(listener: MediaQueryListListener): void; } + declare var MediaQueryList: { prototype: MediaQueryList; new(): MediaQueryList; } -interface DOMError { - name: string; - toString(): string; -} -declare var DOMError: { - prototype: DOMError; - new(): DOMError; -} - -interface CloseEvent extends Event { - wasClean: boolean; - reason: string; - code: number; - initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; -} -declare var CloseEvent: { - prototype: CloseEvent; - new(): CloseEvent; -} - -interface WebSocket extends EventTarget { - protocol: string; - readyState: number; - bufferedAmount: number; - onopen: (ev: Event) => any; - extensions: string; - onmessage: (ev: MessageEvent) => any; - onclose: (ev: CloseEvent) => any; - onerror: (ev: ErrorEvent) => any; - binaryType: string; - url: string; - close(code?: number, reason?: string): void; - send(data: any): void; - OPEN: number; - CLOSING: number; - CONNECTING: number; - CLOSED: number; - addEventListener(type: "open", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "close", listener: (ev: CloseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var WebSocket: { - prototype: WebSocket; - new(url: string, protocols?: string): WebSocket; - new(url: string, protocols?: string[]): WebSocket; - OPEN: number; - CLOSING: number; - CONNECTING: number; - CLOSED: number; -} - -interface SVGFEPointLightElement extends SVGElement { - y: SVGAnimatedNumber; - x: SVGAnimatedNumber; - z: SVGAnimatedNumber; -} -declare var SVGFEPointLightElement: { - prototype: SVGFEPointLightElement; - new(): SVGFEPointLightElement; -} - -interface ProgressEvent extends Event { - loaded: number; - lengthComputable: boolean; - total: number; - initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; -} -declare var ProgressEvent: { - prototype: ProgressEvent; - new(): ProgressEvent; -} - -interface IDBObjectStore { - indexNames: DOMStringList; - name: string; - transaction: IDBTransaction; - keyPath: string; - count(key?: any): IDBRequest; - add(value: any, key?: any): IDBRequest; - clear(): IDBRequest; - createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; - put(value: any, key?: any): IDBRequest; - openCursor(range?: any, direction?: string): IDBRequest; - deleteIndex(indexName: string): void; - index(name: string): IDBIndex; - get(key: any): IDBRequest; - delete(key: any): IDBRequest; -} -declare var IDBObjectStore: { - prototype: IDBObjectStore; - new(): IDBObjectStore; -} - -interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - stdDeviationX: SVGAnimatedNumber; - in1: SVGAnimatedString; - stdDeviationY: SVGAnimatedNumber; - setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; -} -declare var SVGFEGaussianBlurElement: { - prototype: SVGFEGaussianBlurElement; - new(): SVGFEGaussianBlurElement; -} - -interface SVGFilterPrimitiveStandardAttributes extends SVGStylable { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - height: SVGAnimatedLength; - result: SVGAnimatedString; -} - -interface IDBVersionChangeEvent extends Event { - newVersion: number; - oldVersion: number; -} -declare var IDBVersionChangeEvent: { - prototype: IDBVersionChangeEvent; - new(): IDBVersionChangeEvent; -} - -interface IDBIndex { - unique: boolean; - name: string; - keyPath: string; - objectStore: IDBObjectStore; - count(key?: any): IDBRequest; - getKey(key: any): IDBRequest; - openKeyCursor(range?: IDBKeyRange, direction?: string): IDBRequest; - get(key: any): IDBRequest; - openCursor(range?: IDBKeyRange, direction?: string): IDBRequest; -} -declare var IDBIndex: { - prototype: IDBIndex; - new(): IDBIndex; -} - -interface FileList { - length: number; - item(index: number): File; - [index: number]: File; -} -declare var FileList: { - prototype: FileList; - new(): FileList; -} - -interface IDBCursor { - source: any; - direction: string; - key: any; - primaryKey: any; - advance(count: number): void; - delete(): IDBRequest; - continue(key?: any): void; - update(value: any): IDBRequest; - PREV: string; - PREV_NO_DUPLICATE: string; - NEXT: string; - NEXT_NO_DUPLICATE: string; -} -declare var IDBCursor: { - prototype: IDBCursor; - new(): IDBCursor; - PREV: string; - PREV_NO_DUPLICATE: string; - NEXT: string; - NEXT_NO_DUPLICATE: string; -} - -interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - kernelUnitLengthY: SVGAnimatedNumber; - surfaceScale: SVGAnimatedNumber; - specularExponent: SVGAnimatedNumber; - in1: SVGAnimatedString; - kernelUnitLengthX: SVGAnimatedNumber; - specularConstant: SVGAnimatedNumber; -} -declare var SVGFESpecularLightingElement: { - prototype: SVGFESpecularLightingElement; - new(): SVGFESpecularLightingElement; -} - -interface File extends Blob { - lastModifiedDate: any; - name: string; -} -declare var File: { - prototype: File; - new(): File; -} - -interface URL { - revokeObjectURL(url: string): void; - createObjectURL(object: any, options?: ObjectURLOptions): string; -} -declare var URL: URL; - -interface IDBCursorWithValue extends IDBCursor { - value: any; -} -declare var IDBCursorWithValue: { - prototype: IDBCursorWithValue; - new(): IDBCursorWithValue; -} - -interface XMLHttpRequestEventTarget extends EventTarget { - onprogress: (ev: ProgressEvent) => any; - onerror: (ev: ErrorEvent) => any; - onload: (ev: Event) => any; - ontimeout: (ev: Event) => any; - onabort: (ev: UIEvent) => any; - onloadstart: (ev: Event) => any; - onloadend: (ev: ProgressEvent) => any; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var XMLHttpRequestEventTarget: { - prototype: XMLHttpRequestEventTarget; - new(): XMLHttpRequestEventTarget; -} - -interface IDBEnvironment { - msIndexedDB: IDBFactory; - indexedDB: IDBFactory; -} - -interface AudioTrackList extends EventTarget { - length: number; - onchange: (ev: Event) => any; - onaddtrack: (ev: TrackEvent) => any; - onremovetrack: (ev: any /*PluginArray*/) => any; - getTrackById(id: string): AudioTrack; - item(index: number): AudioTrack; - [index: number]: AudioTrack; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: "removetrack", listener: (ev: any /*PluginArray*/) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var AudioTrackList: { - prototype: AudioTrackList; - new(): AudioTrackList; -} - -interface MSBaseReader extends EventTarget { - onprogress: (ev: ProgressEvent) => any; - readyState: number; - onabort: (ev: UIEvent) => any; - onloadend: (ev: ProgressEvent) => any; - onerror: (ev: ErrorEvent) => any; - onload: (ev: Event) => any; - onloadstart: (ev: Event) => any; - result: any; - abort(): void; - LOADING: number; - EMPTY: number; - DONE: number; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - operator: SVGAnimatedEnumeration; - radiusX: SVGAnimatedNumber; - radiusY: SVGAnimatedNumber; - in1: SVGAnimatedString; - SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; - SVG_MORPHOLOGY_OPERATOR_ERODE: number; - SVG_MORPHOLOGY_OPERATOR_DILATE: number; -} -declare var SVGFEMorphologyElement: { - prototype: SVGFEMorphologyElement; - new(): SVGFEMorphologyElement; - SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; - SVG_MORPHOLOGY_OPERATOR_ERODE: number; - SVG_MORPHOLOGY_OPERATOR_DILATE: number; -} - -interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncRElement: { - prototype: SVGFEFuncRElement; - new(): SVGFEFuncRElement; -} - -interface WindowTimersExtension { - msSetImmediate(expression: any, ...args: any[]): number; - clearImmediate(handle: number): void; - msClearImmediate(handle: number): void; - setImmediate(expression: any, ...args: any[]): number; -} - -interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in2: SVGAnimatedString; - xChannelSelector: SVGAnimatedEnumeration; - yChannelSelector: SVGAnimatedEnumeration; - scale: SVGAnimatedNumber; - in1: SVGAnimatedString; - SVG_CHANNEL_B: number; - SVG_CHANNEL_R: number; - SVG_CHANNEL_G: number; - SVG_CHANNEL_UNKNOWN: number; - SVG_CHANNEL_A: number; -} -declare var SVGFEDisplacementMapElement: { - prototype: SVGFEDisplacementMapElement; - new(): SVGFEDisplacementMapElement; - SVG_CHANNEL_B: number; - SVG_CHANNEL_R: number; - SVG_CHANNEL_G: number; - SVG_CHANNEL_UNKNOWN: number; - SVG_CHANNEL_A: number; -} - -interface AnimationEvent extends Event { - animationName: string; - elapsedTime: number; - initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void; -} -declare var AnimationEvent: { - prototype: AnimationEvent; - new(): AnimationEvent; -} - -interface SVGComponentTransferFunctionElement extends SVGElement { - tableValues: SVGAnimatedNumberList; - slope: SVGAnimatedNumber; - type: SVGAnimatedEnumeration; - exponent: SVGAnimatedNumber; - amplitude: SVGAnimatedNumber; - intercept: SVGAnimatedNumber; - offset: SVGAnimatedNumber; - SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; - SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; -} -declare var SVGComponentTransferFunctionElement: { - prototype: SVGComponentTransferFunctionElement; - new(): SVGComponentTransferFunctionElement; - SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; - SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; -} - -interface MSRangeCollection { - length: number; - item(index: number): Range; - [index: number]: Range; -} -declare var MSRangeCollection: { - prototype: MSRangeCollection; - new(): MSRangeCollection; -} - -interface SVGFEDistantLightElement extends SVGElement { - azimuth: SVGAnimatedNumber; - elevation: SVGAnimatedNumber; -} -declare var SVGFEDistantLightElement: { - prototype: SVGFEDistantLightElement; - new(): SVGFEDistantLightElement; -} - -interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncBElement: { - prototype: SVGFEFuncBElement; - new(): SVGFEFuncBElement; -} - -interface IDBKeyRange { - upper: any; - upperOpen: boolean; - lower: any; - lowerOpen: boolean; -} -declare var IDBKeyRange: { - prototype: IDBKeyRange; - new(): IDBKeyRange; - bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; - only(value: any): IDBKeyRange; - lowerBound(bound: any, open?: boolean): IDBKeyRange; - upperBound(bound: any, open?: boolean): IDBKeyRange; -} - -interface WindowConsole { - console: Console; -} - -interface IDBTransaction extends EventTarget { - oncomplete: (ev: Event) => any; - db: IDBDatabase; - mode: string; - error: DOMError; - onerror: (ev: ErrorEvent) => any; - onabort: (ev: UIEvent) => any; - abort(): void; - objectStore(name: string): IDBObjectStore; - READ_ONLY: string; - VERSION_CHANGE: string; - READ_WRITE: string; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBTransaction: { - prototype: IDBTransaction; - new(): IDBTransaction; - READ_ONLY: string; - VERSION_CHANGE: string; - READ_WRITE: string; -} - -interface AudioTrack { - kind: string; - language: string; - id: string; - label: string; - enabled: boolean; - sourceBuffer: SourceBuffer; -} -declare var AudioTrack: { - prototype: AudioTrack; - new(): AudioTrack; -} - -interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - orderY: SVGAnimatedInteger; - kernelUnitLengthY: SVGAnimatedNumber; - orderX: SVGAnimatedInteger; - preserveAlpha: SVGAnimatedBoolean; - kernelMatrix: SVGAnimatedNumberList; - edgeMode: SVGAnimatedEnumeration; - kernelUnitLengthX: SVGAnimatedNumber; - bias: SVGAnimatedNumber; - targetX: SVGAnimatedInteger; - targetY: SVGAnimatedInteger; - divisor: SVGAnimatedNumber; - in1: SVGAnimatedString; - SVG_EDGEMODE_WRAP: number; - SVG_EDGEMODE_DUPLICATE: number; - SVG_EDGEMODE_UNKNOWN: number; - SVG_EDGEMODE_NONE: number; -} -declare var SVGFEConvolveMatrixElement: { - prototype: SVGFEConvolveMatrixElement; - new(): SVGFEConvolveMatrixElement; - SVG_EDGEMODE_WRAP: number; - SVG_EDGEMODE_DUPLICATE: number; - SVG_EDGEMODE_UNKNOWN: number; - SVG_EDGEMODE_NONE: number; -} - -interface TextTrackCueList { - length: number; - item(index: number): TextTrackCue; - [index: number]: TextTrackCue; - getCueById(id: string): TextTrackCue; -} -declare var TextTrackCueList: { - prototype: TextTrackCueList; - new(): TextTrackCueList; -} - -interface CSSKeyframesRule extends CSSRule { - name: string; - cssRules: CSSRuleList; - findRule(rule: string): CSSKeyframeRule; - deleteRule(rule: string): void; - appendRule(rule: string): void; -} -declare var CSSKeyframesRule: { - prototype: CSSKeyframesRule; - new(): CSSKeyframesRule; -} - -interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - baseFrequencyX: SVGAnimatedNumber; - numOctaves: SVGAnimatedInteger; - type: SVGAnimatedEnumeration; - baseFrequencyY: SVGAnimatedNumber; - stitchTiles: SVGAnimatedEnumeration; - seed: SVGAnimatedNumber; - SVG_STITCHTYPE_UNKNOWN: number; - SVG_STITCHTYPE_NOSTITCH: number; - SVG_TURBULENCE_TYPE_UNKNOWN: number; - SVG_TURBULENCE_TYPE_TURBULENCE: number; - SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - SVG_STITCHTYPE_STITCH: number; -} -declare var SVGFETurbulenceElement: { - prototype: SVGFETurbulenceElement; - new(): SVGFETurbulenceElement; - SVG_STITCHTYPE_UNKNOWN: number; - SVG_STITCHTYPE_NOSTITCH: number; - SVG_TURBULENCE_TYPE_UNKNOWN: number; - SVG_TURBULENCE_TYPE_TURBULENCE: number; - SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - SVG_STITCHTYPE_STITCH: number; -} - -interface TextTrackList extends EventTarget { - length: number; - onaddtrack: (ev: TrackEvent) => any; - item(index: number): TextTrack; - [index: number]: TextTrack; - addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var TextTrackList: { - prototype: TextTrackList; - new(): TextTrackList; -} - -interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncGElement: { - prototype: SVGFEFuncGElement; - new(): SVGFEFuncGElement; -} - -interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; - type: SVGAnimatedEnumeration; - values: SVGAnimatedNumberList; - SVG_FECOLORMATRIX_TYPE_SATURATE: number; - SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; - SVG_FECOLORMATRIX_TYPE_MATRIX: number; - SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; -} -declare var SVGFEColorMatrixElement: { - prototype: SVGFEColorMatrixElement; - new(): SVGFEColorMatrixElement; - SVG_FECOLORMATRIX_TYPE_SATURATE: number; - SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; - SVG_FECOLORMATRIX_TYPE_MATRIX: number; - SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; -} - -interface SVGFESpotLightElement extends SVGElement { - pointsAtY: SVGAnimatedNumber; - y: SVGAnimatedNumber; - limitingConeAngle: SVGAnimatedNumber; - specularExponent: SVGAnimatedNumber; - x: SVGAnimatedNumber; - pointsAtZ: SVGAnimatedNumber; - z: SVGAnimatedNumber; - pointsAtX: SVGAnimatedNumber; -} -declare var SVGFESpotLightElement: { - prototype: SVGFESpotLightElement; - new(): SVGFESpotLightElement; -} - -interface WindowBase64 { - btoa(rawString: string): string; - atob(encodedString: string): string; -} - -interface IDBDatabase extends EventTarget { - version: string; - name: string; - objectStoreNames: DOMStringList; - onerror: (ev: ErrorEvent) => any; - onabort: (ev: UIEvent) => any; - createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; - close(): void; - transaction(storeNames: any, mode?: string): IDBTransaction; - deleteObjectStore(name: string): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBDatabase: { - prototype: IDBDatabase; - new(): IDBDatabase; -} - -interface DOMStringList { - length: number; - contains(str: string): boolean; - item(index: number): string; - [index: number]: string; -} -declare var DOMStringList: { - prototype: DOMStringList; - new(): DOMStringList; -} - -interface IDBOpenDBRequest extends IDBRequest { - onupgradeneeded: (ev: IDBVersionChangeEvent) => any; - onblocked: (ev: Event) => any; - addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "upgradeneeded", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blocked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBOpenDBRequest: { - prototype: IDBOpenDBRequest; - new(): IDBOpenDBRequest; -} - -interface HTMLProgressElement extends HTMLElement { - /** - * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value. - */ - value: number; - /** - * Defines the maximum, or "done" value for a progress element. - */ - max: number; - /** - * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar). - */ - position: number; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; -} -declare var HTMLProgressElement: { - prototype: HTMLProgressElement; - new(): HTMLProgressElement; -} - -interface MSLaunchUriCallback { - (): void; -} - -interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - dy: SVGAnimatedNumber; - in1: SVGAnimatedString; - dx: SVGAnimatedNumber; -} -declare var SVGFEOffsetElement: { - prototype: SVGFEOffsetElement; - new(): SVGFEOffsetElement; -} - -interface MSUnsafeFunctionCallback { - (): any; -} - -interface TextTrack extends EventTarget { - language: string; - mode: any; - readyState: number; - activeCues: TextTrackCueList; - cues: TextTrackCueList; - oncuechange: (ev: Event) => any; - kind: string; - onload: (ev: Event) => any; - onerror: (ev: ErrorEvent) => any; - label: string; - addCue(cue: TextTrackCue): void; - removeCue(cue: TextTrackCue): void; - ERROR: number; - SHOWING: number; - LOADING: number; - LOADED: number; - NONE: number; - HIDDEN: number; - DISABLED: number; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var TextTrack: { - prototype: TextTrack; - new(): TextTrack; - ERROR: number; - SHOWING: number; - LOADING: number; - LOADED: number; - NONE: number; - HIDDEN: number; - DISABLED: number; -} - -interface MediaQueryListListener { - (mql: MediaQueryList): void; -} - -interface IDBRequest extends EventTarget { - source: any; - onsuccess: (ev: Event) => any; - error: DOMError; - transaction: IDBTransaction; - onerror: (ev: ErrorEvent) => any; +interface MediaSource extends EventTarget { + activeSourceBuffers: SourceBufferList; + duration: number; readyState: string; - result: any; - addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + sourceBuffers: SourceBufferList; + addSourceBuffer(type: string): SourceBuffer; + endOfStream(error?: string): void; + removeSourceBuffer(sourceBuffer: SourceBuffer): void; } -declare var IDBRequest: { - prototype: IDBRequest; - new(): IDBRequest; + +declare var MediaSource: { + prototype: MediaSource; + new(): MediaSource; + isTypeSupported(type: string): boolean; +} + +interface MessageChannel { + port1: MessagePort; + port2: MessagePort; +} + +declare var MessageChannel: { + prototype: MessageChannel; + new(): MessageChannel; +} + +interface MessageEvent extends Event { + data: any; + origin: string; + ports: any; + source: Window; + initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void; +} + +declare var MessageEvent: { + prototype: MessageEvent; + new(): MessageEvent; } interface MessagePort extends EventTarget { @@ -12040,2178 +11242,5250 @@ interface MessagePort extends EventTarget { postMessage(message?: any, ports?: any): void; start(): void; addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var MessagePort: { prototype: MessagePort; new(): MessagePort; } -interface FileReader extends MSBaseReader { - error: DOMError; - readAsArrayBuffer(blob: Blob): void; - readAsDataURL(blob: Blob): void; - readAsText(blob: Blob, encoding?: string): void; -} -declare var FileReader: { - prototype: FileReader; - new(): FileReader; +interface MimeType { + description: string; + enabledPlugin: Plugin; + suffixes: string; + type: string; } -interface ApplicationCache extends EventTarget { - status: number; - ondownloading: (ev: Event) => any; - onprogress: (ev: ProgressEvent) => any; - onupdateready: (ev: Event) => any; - oncached: (ev: Event) => any; - onobsolete: (ev: Event) => any; - onerror: (ev: ErrorEvent) => any; - onchecking: (ev: Event) => any; - onnoupdate: (ev: Event) => any; - swapCache(): void; - abort(): void; - update(): void; - CHECKING: number; - UNCACHED: number; - UPDATEREADY: number; - DOWNLOADING: number; - IDLE: number; - OBSOLETE: number; - addEventListener(type: "downloading", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "updateready", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cached", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "obsolete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "checking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "noupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var ApplicationCache: { - prototype: ApplicationCache; - new(): ApplicationCache; - CHECKING: number; - UNCACHED: number; - UPDATEREADY: number; - DOWNLOADING: number; - IDLE: number; - OBSOLETE: number; +declare var MimeType: { + prototype: MimeType; + new(): MimeType; } -interface FrameRequestCallback { - (time: number): void; +interface MimeTypeArray { + length: number; + item(index: number): Plugin; + namedItem(type: string): Plugin; + [index: number]: Plugin; +} + +declare var MimeTypeArray: { + prototype: MimeTypeArray; + new(): MimeTypeArray; +} + +interface MouseEvent extends UIEvent { + altKey: boolean; + button: number; + buttons: number; + clientX: number; + clientY: number; + ctrlKey: boolean; + fromElement: Element; + layerX: number; + layerY: number; + metaKey: boolean; + movementX: number; + movementY: number; + offsetX: number; + offsetY: number; + pageX: number; + pageY: number; + relatedTarget: EventTarget; + screenX: number; + screenY: number; + shiftKey: boolean; + toElement: Element; + which: number; + x: number; + y: number; + getModifierState(keyArg: string): boolean; + initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget): void; +} + +declare var MouseEvent: { + prototype: MouseEvent; + new(typeArg: string, eventInitDict?: MouseEventInit): MouseEvent; +} + +interface MouseWheelEvent extends MouseEvent { + wheelDelta: number; + wheelDeltaX: number; + wheelDeltaY: number; + initMouseWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, wheelDeltaArg: number): void; +} + +declare var MouseWheelEvent: { + prototype: MouseWheelEvent; + new(): MouseWheelEvent; +} + +interface MutationEvent extends Event { + attrChange: number; + attrName: string; + newValue: string; + prevValue: string; + relatedNode: Node; + initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; + ADDITION: number; + MODIFICATION: number; + REMOVAL: number; +} + +declare var MutationEvent: { + prototype: MutationEvent; + new(): MutationEvent; + ADDITION: number; + MODIFICATION: number; + REMOVAL: number; +} + +interface MutationObserver { + disconnect(): void; + observe(target: Node, options: MutationObserverInit): void; + takeRecords(): MutationRecord[]; +} + +declare var MutationObserver: { + prototype: MutationObserver; + new(callback: MutationCallback): MutationObserver; +} + +interface MutationRecord { + addedNodes: NodeList; + attributeName: string; + attributeNamespace: string; + nextSibling: Node; + oldValue: string; + previousSibling: Node; + removedNodes: NodeList; + target: Node; + type: string; +} + +declare var MutationRecord: { + prototype: MutationRecord; + new(): MutationRecord; +} + +interface NamedNodeMap { + length: number; + getNamedItem(name: string): Attr; + getNamedItemNS(namespaceURI: string, localName: string): Attr; + item(index: number): Attr; + removeNamedItem(name: string): Attr; + removeNamedItemNS(namespaceURI: string, localName: string): Attr; + setNamedItem(arg: Attr): Attr; + setNamedItemNS(arg: Attr): Attr; + [index: number]: Attr; +} + +declare var NamedNodeMap: { + prototype: NamedNodeMap; + new(): NamedNodeMap; +} + +interface NavigationCompletedEvent extends NavigationEvent { + isSuccess: boolean; + webErrorStatus: number; +} + +declare var NavigationCompletedEvent: { + prototype: NavigationCompletedEvent; + new(): NavigationCompletedEvent; +} + +interface NavigationEvent extends Event { + uri: string; +} + +declare var NavigationEvent: { + prototype: NavigationEvent; + new(): NavigationEvent; +} + +interface NavigationEventWithReferrer extends NavigationEvent { + referer: string; +} + +declare var NavigationEventWithReferrer: { + prototype: NavigationEventWithReferrer; + new(): NavigationEventWithReferrer; +} + +interface Navigator extends Object, NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, NavigatorGeolocation, MSNavigatorDoNotTrack, MSFileSaver { + appCodeName: string; + appMinorVersion: string; + browserLanguage: string; + connectionSpeed: number; + cookieEnabled: boolean; + cpuClass: string; + language: string; + maxTouchPoints: number; + mimeTypes: MSMimeTypesCollection; + msManipulationViewsEnabled: boolean; + msMaxTouchPoints: number; + msPointerEnabled: boolean; + plugins: MSPluginsCollection; + pointerEnabled: boolean; + systemLanguage: string; + userLanguage: string; + webdriver: boolean; + getGamepads(): Gamepad[]; + javaEnabled(): boolean; + msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Navigator: { + prototype: Navigator; + new(): Navigator; +} + +interface Node extends EventTarget { + attributes: NamedNodeMap; + baseURI: string; + childNodes: NodeList; + firstChild: Node; + lastChild: Node; + localName: string; + namespaceURI: string; + nextSibling: Node; + nodeName: string; + nodeType: number; + nodeValue: string; + ownerDocument: Document; + parentElement: HTMLElement; + parentNode: Node; + prefix: string; + previousSibling: Node; + textContent: string; + appendChild(newChild: Node): Node; + cloneNode(deep?: boolean): Node; + compareDocumentPosition(other: Node): number; + hasAttributes(): boolean; + hasChildNodes(): boolean; + insertBefore(newChild: Node, refChild?: Node): Node; + isDefaultNamespace(namespaceURI: string): boolean; + isEqualNode(arg: Node): boolean; + isSameNode(other: Node): boolean; + lookupNamespaceURI(prefix: string): string; + lookupPrefix(namespaceURI: string): string; + normalize(): void; + removeChild(oldChild: Node): Node; + replaceChild(newChild: Node, oldChild: Node): Node; + ATTRIBUTE_NODE: number; + CDATA_SECTION_NODE: number; + COMMENT_NODE: number; + DOCUMENT_FRAGMENT_NODE: number; + DOCUMENT_NODE: number; + DOCUMENT_POSITION_CONTAINED_BY: number; + DOCUMENT_POSITION_CONTAINS: number; + DOCUMENT_POSITION_DISCONNECTED: number; + DOCUMENT_POSITION_FOLLOWING: number; + DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; + DOCUMENT_POSITION_PRECEDING: number; + DOCUMENT_TYPE_NODE: number; + ELEMENT_NODE: number; + ENTITY_NODE: number; + ENTITY_REFERENCE_NODE: number; + NOTATION_NODE: number; + PROCESSING_INSTRUCTION_NODE: number; + TEXT_NODE: number; +} + +declare var Node: { + prototype: Node; + new(): Node; + ATTRIBUTE_NODE: number; + CDATA_SECTION_NODE: number; + COMMENT_NODE: number; + DOCUMENT_FRAGMENT_NODE: number; + DOCUMENT_NODE: number; + DOCUMENT_POSITION_CONTAINED_BY: number; + DOCUMENT_POSITION_CONTAINS: number; + DOCUMENT_POSITION_DISCONNECTED: number; + DOCUMENT_POSITION_FOLLOWING: number; + DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; + DOCUMENT_POSITION_PRECEDING: number; + DOCUMENT_TYPE_NODE: number; + ELEMENT_NODE: number; + ENTITY_NODE: number; + ENTITY_REFERENCE_NODE: number; + NOTATION_NODE: number; + PROCESSING_INSTRUCTION_NODE: number; + TEXT_NODE: number; +} + +interface NodeFilter { + FILTER_ACCEPT: number; + FILTER_REJECT: number; + FILTER_SKIP: number; + SHOW_ALL: number; + SHOW_ATTRIBUTE: number; + SHOW_CDATA_SECTION: number; + SHOW_COMMENT: number; + SHOW_DOCUMENT: number; + SHOW_DOCUMENT_FRAGMENT: number; + SHOW_DOCUMENT_TYPE: number; + SHOW_ELEMENT: number; + SHOW_ENTITY: number; + SHOW_ENTITY_REFERENCE: number; + SHOW_NOTATION: number; + SHOW_PROCESSING_INSTRUCTION: number; + SHOW_TEXT: number; +} +declare var NodeFilter: NodeFilter; + +interface NodeIterator { + expandEntityReferences: boolean; + filter: NodeFilter; + root: Node; + whatToShow: number; + detach(): void; + nextNode(): Node; + previousNode(): Node; +} + +declare var NodeIterator: { + prototype: NodeIterator; + new(): NodeIterator; +} + +interface NodeList { + length: number; + item(index: number): Node; + [index: number]: Node; +} + +declare var NodeList: { + prototype: NodeList; + new(): NodeList; +} + +interface OES_element_index_uint { +} + +declare var OES_element_index_uint: { + prototype: OES_element_index_uint; + new(): OES_element_index_uint; +} + +interface OES_standard_derivatives { + FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; +} + +declare var OES_standard_derivatives: { + prototype: OES_standard_derivatives; + new(): OES_standard_derivatives; + FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; +} + +interface OES_texture_float { +} + +declare var OES_texture_float: { + prototype: OES_texture_float; + new(): OES_texture_float; +} + +interface OES_texture_float_linear { +} + +declare var OES_texture_float_linear: { + prototype: OES_texture_float_linear; + new(): OES_texture_float_linear; +} + +interface OfflineAudioCompletionEvent extends Event { + renderedBuffer: AudioBuffer; +} + +declare var OfflineAudioCompletionEvent: { + prototype: OfflineAudioCompletionEvent; + new(): OfflineAudioCompletionEvent; +} + +interface OfflineAudioContext extends AudioContext { + oncomplete: (ev: Event) => any; + startRendering(): void; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var OfflineAudioContext: { + prototype: OfflineAudioContext; + new(numberOfChannels: number, length: number, sampleRate: number): OfflineAudioContext; +} + +interface OscillatorNode extends AudioNode { + detune: AudioParam; + frequency: AudioParam; + onended: (ev: Event) => any; + type: string; + setPeriodicWave(periodicWave: PeriodicWave): void; + start(when?: number): void; + stop(when?: number): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var OscillatorNode: { + prototype: OscillatorNode; + new(): OscillatorNode; +} + +interface PageTransitionEvent extends Event { + persisted: boolean; +} + +declare var PageTransitionEvent: { + prototype: PageTransitionEvent; + new(): PageTransitionEvent; +} + +interface PannerNode extends AudioNode { + coneInnerAngle: number; + coneOuterAngle: number; + coneOuterGain: number; + distanceModel: string; + maxDistance: number; + panningModel: string; + refDistance: number; + rolloffFactor: number; + setOrientation(x: number, y: number, z: number): void; + setPosition(x: number, y: number, z: number): void; + setVelocity(x: number, y: number, z: number): void; +} + +declare var PannerNode: { + prototype: PannerNode; + new(): PannerNode; +} + +interface PerfWidgetExternal { + activeNetworkRequestCount: number; + averageFrameTime: number; + averagePaintTime: number; + extraInformationEnabled: boolean; + independentRenderingEnabled: boolean; + irDisablingContentString: string; + irStatusAvailable: boolean; + maxCpuSpeed: number; + paintRequestsPerSecond: number; + performanceCounter: number; + performanceCounterFrequency: number; + addEventListener(eventType: string, callback: Function): void; + getMemoryUsage(): number; + getProcessCpuUsage(): number; + getRecentCpuUsage(last: number): any; + getRecentFrames(last: number): any; + getRecentMemoryUsage(last: number): any; + getRecentPaintRequests(last: number): any; + removeEventListener(eventType: string, callback: Function): void; + repositionWindow(x: number, y: number): void; + resizeWindow(width: number, height: number): void; +} + +declare var PerfWidgetExternal: { + prototype: PerfWidgetExternal; + new(): PerfWidgetExternal; +} + +interface Performance { + navigation: PerformanceNavigation; + timing: PerformanceTiming; + clearMarks(markName?: string): void; + clearMeasures(measureName?: string): void; + clearResourceTimings(): void; + getEntries(): any; + getEntriesByName(name: string, entryType?: string): any; + getEntriesByType(entryType: string): any; + getMarks(markName?: string): any; + getMeasures(measureName?: string): any; + mark(markName: string): void; + measure(measureName: string, startMarkName?: string, endMarkName?: string): void; + now(): number; + setResourceTimingBufferSize(maxSize: number): void; + toJSON(): any; +} + +declare var Performance: { + prototype: Performance; + new(): Performance; +} + +interface PerformanceEntry { + duration: number; + entryType: string; + name: string; + startTime: number; +} + +declare var PerformanceEntry: { + prototype: PerformanceEntry; + new(): PerformanceEntry; +} + +interface PerformanceMark extends PerformanceEntry { +} + +declare var PerformanceMark: { + prototype: PerformanceMark; + new(): PerformanceMark; +} + +interface PerformanceMeasure extends PerformanceEntry { +} + +declare var PerformanceMeasure: { + prototype: PerformanceMeasure; + new(): PerformanceMeasure; +} + +interface PerformanceNavigation { + redirectCount: number; + type: number; + toJSON(): any; + TYPE_BACK_FORWARD: number; + TYPE_NAVIGATE: number; + TYPE_RELOAD: number; + TYPE_RESERVED: number; +} + +declare var PerformanceNavigation: { + prototype: PerformanceNavigation; + new(): PerformanceNavigation; + TYPE_BACK_FORWARD: number; + TYPE_NAVIGATE: number; + TYPE_RELOAD: number; + TYPE_RESERVED: number; +} + +interface PerformanceNavigationTiming extends PerformanceEntry { + connectEnd: number; + connectStart: number; + domComplete: number; + domContentLoadedEventEnd: number; + domContentLoadedEventStart: number; + domInteractive: number; + domLoading: number; + domainLookupEnd: number; + domainLookupStart: number; + fetchStart: number; + loadEventEnd: number; + loadEventStart: number; + navigationStart: number; + redirectCount: number; + redirectEnd: number; + redirectStart: number; + requestStart: number; + responseEnd: number; + responseStart: number; + type: string; + unloadEventEnd: number; + unloadEventStart: number; +} + +declare var PerformanceNavigationTiming: { + prototype: PerformanceNavigationTiming; + new(): PerformanceNavigationTiming; +} + +interface PerformanceResourceTiming extends PerformanceEntry { + connectEnd: number; + connectStart: number; + domainLookupEnd: number; + domainLookupStart: number; + fetchStart: number; + initiatorType: string; + redirectEnd: number; + redirectStart: number; + requestStart: number; + responseEnd: number; + responseStart: number; +} + +declare var PerformanceResourceTiming: { + prototype: PerformanceResourceTiming; + new(): PerformanceResourceTiming; +} + +interface PerformanceTiming { + connectEnd: number; + connectStart: number; + domComplete: number; + domContentLoadedEventEnd: number; + domContentLoadedEventStart: number; + domInteractive: number; + domLoading: number; + domainLookupEnd: number; + domainLookupStart: number; + fetchStart: number; + loadEventEnd: number; + loadEventStart: number; + msFirstPaint: number; + navigationStart: number; + redirectEnd: number; + redirectStart: number; + requestStart: number; + responseEnd: number; + responseStart: number; + unloadEventEnd: number; + unloadEventStart: number; + toJSON(): any; +} + +declare var PerformanceTiming: { + prototype: PerformanceTiming; + new(): PerformanceTiming; +} + +interface PeriodicWave { +} + +declare var PeriodicWave: { + prototype: PeriodicWave; + new(): PeriodicWave; +} + +interface PermissionRequest extends DeferredPermissionRequest { + state: string; + defer(): void; +} + +declare var PermissionRequest: { + prototype: PermissionRequest; + new(): PermissionRequest; +} + +interface PermissionRequestedEvent extends Event { + permissionRequest: PermissionRequest; +} + +declare var PermissionRequestedEvent: { + prototype: PermissionRequestedEvent; + new(): PermissionRequestedEvent; +} + +interface Plugin { + description: string; + filename: string; + length: number; + name: string; + version: string; + item(index: number): MimeType; + namedItem(type: string): MimeType; + [index: number]: MimeType; +} + +declare var Plugin: { + prototype: Plugin; + new(): Plugin; +} + +interface PluginArray { + length: number; + item(index: number): Plugin; + namedItem(name: string): Plugin; + refresh(reload?: boolean): void; + [index: number]: Plugin; +} + +declare var PluginArray: { + prototype: PluginArray; + new(): PluginArray; +} + +interface PointerEvent extends MouseEvent { + currentPoint: any; + height: number; + hwTimestamp: number; + intermediatePoints: any; + isPrimary: boolean; + pointerId: number; + pointerType: any; + pressure: number; + rotation: number; + tiltX: number; + tiltY: number; + width: number; + getCurrentPoint(element: Element): void; + getIntermediatePoints(element: Element): void; + initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; +} + +declare var PointerEvent: { + prototype: PointerEvent; + new(typeArg: string, eventInitDict?: PointerEventInit): PointerEvent; } interface PopStateEvent extends Event { state: any; initPopStateEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, stateArg: any): void; } + declare var PopStateEvent: { prototype: PopStateEvent; new(): PopStateEvent; } -interface CSSKeyframeRule extends CSSRule { - keyText: string; - style: CSSStyleDeclaration; -} -declare var CSSKeyframeRule: { - prototype: CSSKeyframeRule; - new(): CSSKeyframeRule; +interface Position { + coords: Coordinates; + timestamp: Date; } -interface MSFileSaver { - msSaveBlob(blob: any, defaultName?: string): boolean; - msSaveOrOpenBlob(blob: any, defaultName?: string): boolean; +declare var Position: { + prototype: Position; + new(): Position; } -interface MSStream { - type: string; - msDetachStream(): any; - msClose(): void; -} -declare var MSStream: { - prototype: MSStream; - new(): MSStream; +interface PositionError { + code: number; + message: string; + toString(): string; + PERMISSION_DENIED: number; + POSITION_UNAVAILABLE: number; + TIMEOUT: number; } -interface MSBlobBuilder { - append(data: any, endings?: string): void; - getBlob(contentType?: string): Blob; -} -declare var MSBlobBuilder: { - prototype: MSBlobBuilder; - new(): MSBlobBuilder; +declare var PositionError: { + prototype: PositionError; + new(): PositionError; + PERMISSION_DENIED: number; + POSITION_UNAVAILABLE: number; + TIMEOUT: number; } -interface DOMSettableTokenList extends DOMTokenList { - value: string; -} -declare var DOMSettableTokenList: { - prototype: DOMSettableTokenList; - new(): DOMSettableTokenList; +interface ProcessingInstruction extends CharacterData { + target: string; } -interface IDBFactory { - open(name: string, version?: number): IDBOpenDBRequest; - cmp(first: any, second: any): number; - deleteDatabase(name: string): IDBOpenDBRequest; -} -declare var IDBFactory: { - prototype: IDBFactory; - new(): IDBFactory; +declare var ProcessingInstruction: { + prototype: ProcessingInstruction; + new(): ProcessingInstruction; } -interface MSPointerEvent extends MouseEvent { - width: number; - rotation: number; - pressure: number; - pointerType: any; - isPrimary: boolean; - tiltY: number; - height: number; - intermediatePoints: any; - currentPoint: any; - tiltX: number; - hwTimestamp: number; - pointerId: number; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; - MSPOINTER_TYPE_PEN: number; - MSPOINTER_TYPE_MOUSE: number; - MSPOINTER_TYPE_TOUCH: number; -} -declare var MSPointerEvent: { - prototype: MSPointerEvent; - new(): MSPointerEvent; - MSPOINTER_TYPE_PEN: number; - MSPOINTER_TYPE_MOUSE: number; - MSPOINTER_TYPE_TOUCH: number; +interface ProgressEvent extends Event { + lengthComputable: boolean; + loaded: number; + total: number; + initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; } -interface MSManipulationEvent extends UIEvent { - lastState: number; - currentState: number; - initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void; - MS_MANIPULATION_STATE_STOPPED: number; - MS_MANIPULATION_STATE_ACTIVE: number; - MS_MANIPULATION_STATE_INERTIA: number; - MS_MANIPULATION_STATE_SELECTING: number; - MS_MANIPULATION_STATE_COMMITTED: number; - MS_MANIPULATION_STATE_PRESELECT: number; - MS_MANIPULATION_STATE_DRAGGING: number; - MS_MANIPULATION_STATE_CANCELLED: number; -} -declare var MSManipulationEvent: { - prototype: MSManipulationEvent; - new(): MSManipulationEvent; - MS_MANIPULATION_STATE_STOPPED: number; - MS_MANIPULATION_STATE_ACTIVE: number; - MS_MANIPULATION_STATE_INERTIA: number; - MS_MANIPULATION_STATE_SELECTING: number; - MS_MANIPULATION_STATE_COMMITTED: number; - MS_MANIPULATION_STATE_PRESELECT: number; - MS_MANIPULATION_STATE_DRAGGING: number; - MS_MANIPULATION_STATE_CANCELLED: number; +declare var ProgressEvent: { + prototype: ProgressEvent; + new(): ProgressEvent; } -interface FormData { - append(name: any, value: any, blobName?: string): void; -} -declare var FormData: { - prototype: FormData; - new(): FormData; +interface Range { + collapsed: boolean; + commonAncestorContainer: Node; + endContainer: Node; + endOffset: number; + startContainer: Node; + startOffset: number; + cloneContents(): DocumentFragment; + cloneRange(): Range; + collapse(toStart: boolean): void; + compareBoundaryPoints(how: number, sourceRange: Range): number; + createContextualFragment(fragment: string): DocumentFragment; + deleteContents(): void; + detach(): void; + expand(Unit: string): boolean; + extractContents(): DocumentFragment; + getBoundingClientRect(): ClientRect; + getClientRects(): ClientRectList; + insertNode(newNode: Node): void; + selectNode(refNode: Node): void; + selectNodeContents(refNode: Node): void; + setEnd(refNode: Node, offset: number): void; + setEndAfter(refNode: Node): void; + setEndBefore(refNode: Node): void; + setStart(refNode: Node, offset: number): void; + setStartAfter(refNode: Node): void; + setStartBefore(refNode: Node): void; + surroundContents(newParent: Node): void; + toString(): string; + END_TO_END: number; + END_TO_START: number; + START_TO_END: number; + START_TO_START: number; } -interface HTMLDataListElement extends HTMLElement { - options: HTMLCollection; -} -declare var HTMLDataListElement: { - prototype: HTMLDataListElement; - new(): HTMLDataListElement; +declare var Range: { + prototype: Range; + new(): Range; + END_TO_END: number; + END_TO_START: number; + START_TO_END: number; + START_TO_START: number; } -interface SVGFEImageElement extends SVGElement, SVGLangSpace, SVGFilterPrimitiveStandardAttributes, SVGURIReference, SVGExternalResourcesRequired { - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; -} -declare var SVGFEImageElement: { - prototype: SVGFEImageElement; - new(): SVGFEImageElement; +interface SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { + target: SVGAnimatedString; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface AbstractWorker extends EventTarget { - onerror: (ev: ErrorEvent) => any; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +declare var SVGAElement: { + prototype: SVGAElement; + new(): SVGAElement; } -interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - operator: SVGAnimatedEnumeration; - in2: SVGAnimatedString; - k2: SVGAnimatedNumber; - k1: SVGAnimatedNumber; - k3: SVGAnimatedNumber; +interface SVGAngle { + unitType: number; + value: number; + valueAsString: string; + valueInSpecifiedUnits: number; + convertToSpecifiedUnits(unitType: number): void; + newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; + SVG_ANGLETYPE_DEG: number; + SVG_ANGLETYPE_GRAD: number; + SVG_ANGLETYPE_RAD: number; + SVG_ANGLETYPE_UNKNOWN: number; + SVG_ANGLETYPE_UNSPECIFIED: number; +} + +declare var SVGAngle: { + prototype: SVGAngle; + new(): SVGAngle; + SVG_ANGLETYPE_DEG: number; + SVG_ANGLETYPE_GRAD: number; + SVG_ANGLETYPE_RAD: number; + SVG_ANGLETYPE_UNKNOWN: number; + SVG_ANGLETYPE_UNSPECIFIED: number; +} + +interface SVGAnimatedAngle { + animVal: SVGAngle; + baseVal: SVGAngle; +} + +declare var SVGAnimatedAngle: { + prototype: SVGAnimatedAngle; + new(): SVGAnimatedAngle; +} + +interface SVGAnimatedBoolean { + animVal: boolean; + baseVal: boolean; +} + +declare var SVGAnimatedBoolean: { + prototype: SVGAnimatedBoolean; + new(): SVGAnimatedBoolean; +} + +interface SVGAnimatedEnumeration { + animVal: number; + baseVal: number; +} + +declare var SVGAnimatedEnumeration: { + prototype: SVGAnimatedEnumeration; + new(): SVGAnimatedEnumeration; +} + +interface SVGAnimatedInteger { + animVal: number; + baseVal: number; +} + +declare var SVGAnimatedInteger: { + prototype: SVGAnimatedInteger; + new(): SVGAnimatedInteger; +} + +interface SVGAnimatedLength { + animVal: SVGLength; + baseVal: SVGLength; +} + +declare var SVGAnimatedLength: { + prototype: SVGAnimatedLength; + new(): SVGAnimatedLength; +} + +interface SVGAnimatedLengthList { + animVal: SVGLengthList; + baseVal: SVGLengthList; +} + +declare var SVGAnimatedLengthList: { + prototype: SVGAnimatedLengthList; + new(): SVGAnimatedLengthList; +} + +interface SVGAnimatedNumber { + animVal: number; + baseVal: number; +} + +declare var SVGAnimatedNumber: { + prototype: SVGAnimatedNumber; + new(): SVGAnimatedNumber; +} + +interface SVGAnimatedNumberList { + animVal: SVGNumberList; + baseVal: SVGNumberList; +} + +declare var SVGAnimatedNumberList: { + prototype: SVGAnimatedNumberList; + new(): SVGAnimatedNumberList; +} + +interface SVGAnimatedPreserveAspectRatio { + animVal: SVGPreserveAspectRatio; + baseVal: SVGPreserveAspectRatio; +} + +declare var SVGAnimatedPreserveAspectRatio: { + prototype: SVGAnimatedPreserveAspectRatio; + new(): SVGAnimatedPreserveAspectRatio; +} + +interface SVGAnimatedRect { + animVal: SVGRect; + baseVal: SVGRect; +} + +declare var SVGAnimatedRect: { + prototype: SVGAnimatedRect; + new(): SVGAnimatedRect; +} + +interface SVGAnimatedString { + animVal: string; + baseVal: string; +} + +declare var SVGAnimatedString: { + prototype: SVGAnimatedString; + new(): SVGAnimatedString; +} + +interface SVGAnimatedTransformList { + animVal: SVGTransformList; + baseVal: SVGTransformList; +} + +declare var SVGAnimatedTransformList: { + prototype: SVGAnimatedTransformList; + new(): SVGAnimatedTransformList; +} + +interface SVGCircleElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + cx: SVGAnimatedLength; + cy: SVGAnimatedLength; + r: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGCircleElement: { + prototype: SVGCircleElement; + new(): SVGCircleElement; +} + +interface SVGClipPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes { + clipPathUnits: SVGAnimatedEnumeration; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGClipPathElement: { + prototype: SVGClipPathElement; + new(): SVGClipPathElement; +} + +interface SVGComponentTransferFunctionElement extends SVGElement { + amplitude: SVGAnimatedNumber; + exponent: SVGAnimatedNumber; + intercept: SVGAnimatedNumber; + offset: SVGAnimatedNumber; + slope: SVGAnimatedNumber; + tableValues: SVGAnimatedNumberList; + type: SVGAnimatedEnumeration; + SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; + SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; + SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; + SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; + SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; + SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; +} + +declare var SVGComponentTransferFunctionElement: { + prototype: SVGComponentTransferFunctionElement; + new(): SVGComponentTransferFunctionElement; + SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; + SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; + SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; + SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; + SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; + SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; +} + +interface SVGDefsElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGDefsElement: { + prototype: SVGDefsElement; + new(): SVGDefsElement; +} + +interface SVGDescElement extends SVGElement, SVGStylable, SVGLangSpace { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGDescElement: { + prototype: SVGDescElement; + new(): SVGDescElement; +} + +interface SVGElement extends Element { + id: string; + onclick: (ev: MouseEvent) => any; + ondblclick: (ev: MouseEvent) => any; + onfocusin: (ev: FocusEvent) => any; + onfocusout: (ev: FocusEvent) => any; + onload: (ev: Event) => any; + onmousedown: (ev: MouseEvent) => any; + onmousemove: (ev: MouseEvent) => any; + onmouseout: (ev: MouseEvent) => any; + onmouseover: (ev: MouseEvent) => any; + onmouseup: (ev: MouseEvent) => any; + ownerSVGElement: SVGSVGElement; + viewportElement: SVGElement; + xmlbase: string; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGElement: { + prototype: SVGElement; + new(): SVGElement; +} + +interface SVGElementInstance extends EventTarget { + childNodes: SVGElementInstanceList; + correspondingElement: SVGElement; + correspondingUseElement: SVGUseElement; + firstChild: SVGElementInstance; + lastChild: SVGElementInstance; + nextSibling: SVGElementInstance; + parentNode: SVGElementInstance; + previousSibling: SVGElementInstance; +} + +declare var SVGElementInstance: { + prototype: SVGElementInstance; + new(): SVGElementInstance; +} + +interface SVGElementInstanceList { + length: number; + item(index: number): SVGElementInstance; +} + +declare var SVGElementInstanceList: { + prototype: SVGElementInstanceList; + new(): SVGElementInstanceList; +} + +interface SVGEllipseElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + cx: SVGAnimatedLength; + cy: SVGAnimatedLength; + rx: SVGAnimatedLength; + ry: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGEllipseElement: { + prototype: SVGEllipseElement; + new(): SVGEllipseElement; +} + +interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { in1: SVGAnimatedString; - k4: SVGAnimatedNumber; - SVG_FECOMPOSITE_OPERATOR_OUT: number; - SVG_FECOMPOSITE_OPERATOR_OVER: number; - SVG_FECOMPOSITE_OPERATOR_XOR: number; - SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - SVG_FECOMPOSITE_OPERATOR_IN: number; - SVG_FECOMPOSITE_OPERATOR_ATOP: number; -} -declare var SVGFECompositeElement: { - prototype: SVGFECompositeElement; - new(): SVGFECompositeElement; - SVG_FECOMPOSITE_OPERATOR_OUT: number; - SVG_FECOMPOSITE_OPERATOR_OVER: number; - SVG_FECOMPOSITE_OPERATOR_XOR: number; - SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - SVG_FECOMPOSITE_OPERATOR_IN: number; - SVG_FECOMPOSITE_OPERATOR_ATOP: number; + in2: SVGAnimatedString; + mode: SVGAnimatedEnumeration; + SVG_FEBLEND_MODE_COLOR: number; + SVG_FEBLEND_MODE_COLOR_BURN: number; + SVG_FEBLEND_MODE_COLOR_DODGE: number; + SVG_FEBLEND_MODE_DARKEN: number; + SVG_FEBLEND_MODE_DIFFERENCE: number; + SVG_FEBLEND_MODE_EXCLUSION: number; + SVG_FEBLEND_MODE_HARD_LIGHT: number; + SVG_FEBLEND_MODE_HUE: number; + SVG_FEBLEND_MODE_LIGHTEN: number; + SVG_FEBLEND_MODE_LUMINOSITY: number; + SVG_FEBLEND_MODE_MULTIPLY: number; + SVG_FEBLEND_MODE_NORMAL: number; + SVG_FEBLEND_MODE_OVERLAY: number; + SVG_FEBLEND_MODE_SATURATION: number; + SVG_FEBLEND_MODE_SCREEN: number; + SVG_FEBLEND_MODE_SOFT_LIGHT: number; + SVG_FEBLEND_MODE_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface ValidityState { - customError: boolean; - valueMissing: boolean; - stepMismatch: boolean; - rangeUnderflow: boolean; - rangeOverflow: boolean; - typeMismatch: boolean; - patternMismatch: boolean; - tooLong: boolean; - valid: boolean; -} -declare var ValidityState: { - prototype: ValidityState; - new(): ValidityState; +declare var SVGFEBlendElement: { + prototype: SVGFEBlendElement; + new(): SVGFEBlendElement; + SVG_FEBLEND_MODE_COLOR: number; + SVG_FEBLEND_MODE_COLOR_BURN: number; + SVG_FEBLEND_MODE_COLOR_DODGE: number; + SVG_FEBLEND_MODE_DARKEN: number; + SVG_FEBLEND_MODE_DIFFERENCE: number; + SVG_FEBLEND_MODE_EXCLUSION: number; + SVG_FEBLEND_MODE_HARD_LIGHT: number; + SVG_FEBLEND_MODE_HUE: number; + SVG_FEBLEND_MODE_LIGHTEN: number; + SVG_FEBLEND_MODE_LUMINOSITY: number; + SVG_FEBLEND_MODE_MULTIPLY: number; + SVG_FEBLEND_MODE_NORMAL: number; + SVG_FEBLEND_MODE_OVERLAY: number; + SVG_FEBLEND_MODE_SATURATION: number; + SVG_FEBLEND_MODE_SCREEN: number; + SVG_FEBLEND_MODE_SOFT_LIGHT: number; + SVG_FEBLEND_MODE_UNKNOWN: number; } -interface HTMLTrackElement extends HTMLElement { - kind: string; - src: string; - srclang: string; - track: TextTrack; - label: string; - default: boolean; - readyState: number; - ERROR: number; - LOADING: number; - LOADED: number; - NONE: number; -} -declare var HTMLTrackElement: { - prototype: HTMLTrackElement; - new(): HTMLTrackElement; - ERROR: number; - LOADING: number; - LOADED: number; - NONE: number; +interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + type: SVGAnimatedEnumeration; + values: SVGAnimatedNumberList; + SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; + SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; + SVG_FECOLORMATRIX_TYPE_MATRIX: number; + SVG_FECOLORMATRIX_TYPE_SATURATE: number; + SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface MSApp { - createFileFromStorageFile(storageFile: any): File; - createBlobFromRandomAccessStream(type: string, seeker: any): Blob; - createStreamFromInputStream(type: string, inputStream: any): MSStream; - terminateApp(exceptionObject: any): void; - createDataPackage(object: any): any; - execUnsafeLocalFunction(unsafeFunction: MSUnsafeFunctionCallback): any; - getHtmlPrintDocumentSource(htmlDoc: any): any; - addPublicLocalApplicationUri(uri: string): void; - createDataPackageFromSelection(): any; - getViewOpener(): MSAppView; - suppressSubdownloadCredentialPrompts(suppress: boolean): void; - execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; - isTaskScheduledAtPriorityOrHigher(priority: string): boolean; - execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; - createNewView(uri: string): MSAppView; - getCurrentPriority(): string; - NORMAL: string; - HIGH: string; - IDLE: string; - CURRENT: string; +declare var SVGFEColorMatrixElement: { + prototype: SVGFEColorMatrixElement; + new(): SVGFEColorMatrixElement; + SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; + SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; + SVG_FECOLORMATRIX_TYPE_MATRIX: number; + SVG_FECOLORMATRIX_TYPE_SATURATE: number; + SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; } -declare var MSApp: MSApp; interface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { in1: SVGAnimatedString; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var SVGFEComponentTransferElement: { prototype: SVGFEComponentTransferElement; new(): SVGFEComponentTransferElement; } -interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { +interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + in2: SVGAnimatedString; + k1: SVGAnimatedNumber; + k2: SVGAnimatedNumber; + k3: SVGAnimatedNumber; + k4: SVGAnimatedNumber; + operator: SVGAnimatedEnumeration; + SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; + SVG_FECOMPOSITE_OPERATOR_ATOP: number; + SVG_FECOMPOSITE_OPERATOR_IN: number; + SVG_FECOMPOSITE_OPERATOR_OUT: number; + SVG_FECOMPOSITE_OPERATOR_OVER: number; + SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; + SVG_FECOMPOSITE_OPERATOR_XOR: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFECompositeElement: { + prototype: SVGFECompositeElement; + new(): SVGFECompositeElement; + SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; + SVG_FECOMPOSITE_OPERATOR_ATOP: number; + SVG_FECOMPOSITE_OPERATOR_IN: number; + SVG_FECOMPOSITE_OPERATOR_OUT: number; + SVG_FECOMPOSITE_OPERATOR_OVER: number; + SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; + SVG_FECOMPOSITE_OPERATOR_XOR: number; +} + +interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + bias: SVGAnimatedNumber; + divisor: SVGAnimatedNumber; + edgeMode: SVGAnimatedEnumeration; + in1: SVGAnimatedString; + kernelMatrix: SVGAnimatedNumberList; + kernelUnitLengthX: SVGAnimatedNumber; kernelUnitLengthY: SVGAnimatedNumber; - surfaceScale: SVGAnimatedNumber; + orderX: SVGAnimatedInteger; + orderY: SVGAnimatedInteger; + preserveAlpha: SVGAnimatedBoolean; + targetX: SVGAnimatedInteger; + targetY: SVGAnimatedInteger; + SVG_EDGEMODE_DUPLICATE: number; + SVG_EDGEMODE_NONE: number; + SVG_EDGEMODE_UNKNOWN: number; + SVG_EDGEMODE_WRAP: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEConvolveMatrixElement: { + prototype: SVGFEConvolveMatrixElement; + new(): SVGFEConvolveMatrixElement; + SVG_EDGEMODE_DUPLICATE: number; + SVG_EDGEMODE_NONE: number; + SVG_EDGEMODE_UNKNOWN: number; + SVG_EDGEMODE_WRAP: number; +} + +interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + diffuseConstant: SVGAnimatedNumber; in1: SVGAnimatedString; kernelUnitLengthX: SVGAnimatedNumber; - diffuseConstant: SVGAnimatedNumber; + kernelUnitLengthY: SVGAnimatedNumber; + surfaceScale: SVGAnimatedNumber; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var SVGFEDiffuseLightingElement: { prototype: SVGFEDiffuseLightingElement; new(): SVGFEDiffuseLightingElement; } -interface MSCSSMatrix { - m24: number; - m34: number; +interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + in2: SVGAnimatedString; + scale: SVGAnimatedNumber; + xChannelSelector: SVGAnimatedEnumeration; + yChannelSelector: SVGAnimatedEnumeration; + SVG_CHANNEL_A: number; + SVG_CHANNEL_B: number; + SVG_CHANNEL_G: number; + SVG_CHANNEL_R: number; + SVG_CHANNEL_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEDisplacementMapElement: { + prototype: SVGFEDisplacementMapElement; + new(): SVGFEDisplacementMapElement; + SVG_CHANNEL_A: number; + SVG_CHANNEL_B: number; + SVG_CHANNEL_G: number; + SVG_CHANNEL_R: number; + SVG_CHANNEL_UNKNOWN: number; +} + +interface SVGFEDistantLightElement extends SVGElement { + azimuth: SVGAnimatedNumber; + elevation: SVGAnimatedNumber; +} + +declare var SVGFEDistantLightElement: { + prototype: SVGFEDistantLightElement; + new(): SVGFEDistantLightElement; +} + +interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEFloodElement: { + prototype: SVGFEFloodElement; + new(): SVGFEFloodElement; +} + +interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { +} + +declare var SVGFEFuncAElement: { + prototype: SVGFEFuncAElement; + new(): SVGFEFuncAElement; +} + +interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { +} + +declare var SVGFEFuncBElement: { + prototype: SVGFEFuncBElement; + new(): SVGFEFuncBElement; +} + +interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { +} + +declare var SVGFEFuncGElement: { + prototype: SVGFEFuncGElement; + new(): SVGFEFuncGElement; +} + +interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { +} + +declare var SVGFEFuncRElement: { + prototype: SVGFEFuncRElement; + new(): SVGFEFuncRElement; +} + +interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + stdDeviationX: SVGAnimatedNumber; + stdDeviationY: SVGAnimatedNumber; + setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEGaussianBlurElement: { + prototype: SVGFEGaussianBlurElement; + new(): SVGFEGaussianBlurElement; +} + +interface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { + preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEImageElement: { + prototype: SVGFEImageElement; + new(): SVGFEImageElement; +} + +interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEMergeElement: { + prototype: SVGFEMergeElement; + new(): SVGFEMergeElement; +} + +interface SVGFEMergeNodeElement extends SVGElement { + in1: SVGAnimatedString; +} + +declare var SVGFEMergeNodeElement: { + prototype: SVGFEMergeNodeElement; + new(): SVGFEMergeNodeElement; +} + +interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + operator: SVGAnimatedEnumeration; + radiusX: SVGAnimatedNumber; + radiusY: SVGAnimatedNumber; + SVG_MORPHOLOGY_OPERATOR_DILATE: number; + SVG_MORPHOLOGY_OPERATOR_ERODE: number; + SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEMorphologyElement: { + prototype: SVGFEMorphologyElement; + new(): SVGFEMorphologyElement; + SVG_MORPHOLOGY_OPERATOR_DILATE: number; + SVG_MORPHOLOGY_OPERATOR_ERODE: number; + SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; +} + +interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + dx: SVGAnimatedNumber; + dy: SVGAnimatedNumber; + in1: SVGAnimatedString; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEOffsetElement: { + prototype: SVGFEOffsetElement; + new(): SVGFEOffsetElement; +} + +interface SVGFEPointLightElement extends SVGElement { + x: SVGAnimatedNumber; + y: SVGAnimatedNumber; + z: SVGAnimatedNumber; +} + +declare var SVGFEPointLightElement: { + prototype: SVGFEPointLightElement; + new(): SVGFEPointLightElement; +} + +interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + kernelUnitLengthX: SVGAnimatedNumber; + kernelUnitLengthY: SVGAnimatedNumber; + specularConstant: SVGAnimatedNumber; + specularExponent: SVGAnimatedNumber; + surfaceScale: SVGAnimatedNumber; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFESpecularLightingElement: { + prototype: SVGFESpecularLightingElement; + new(): SVGFESpecularLightingElement; +} + +interface SVGFESpotLightElement extends SVGElement { + limitingConeAngle: SVGAnimatedNumber; + pointsAtX: SVGAnimatedNumber; + pointsAtY: SVGAnimatedNumber; + pointsAtZ: SVGAnimatedNumber; + specularExponent: SVGAnimatedNumber; + x: SVGAnimatedNumber; + y: SVGAnimatedNumber; + z: SVGAnimatedNumber; +} + +declare var SVGFESpotLightElement: { + prototype: SVGFESpotLightElement; + new(): SVGFESpotLightElement; +} + +interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFETileElement: { + prototype: SVGFETileElement; + new(): SVGFETileElement; +} + +interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + baseFrequencyX: SVGAnimatedNumber; + baseFrequencyY: SVGAnimatedNumber; + numOctaves: SVGAnimatedInteger; + seed: SVGAnimatedNumber; + stitchTiles: SVGAnimatedEnumeration; + type: SVGAnimatedEnumeration; + SVG_STITCHTYPE_NOSTITCH: number; + SVG_STITCHTYPE_STITCH: number; + SVG_STITCHTYPE_UNKNOWN: number; + SVG_TURBULENCE_TYPE_FRACTALNOISE: number; + SVG_TURBULENCE_TYPE_TURBULENCE: number; + SVG_TURBULENCE_TYPE_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFETurbulenceElement: { + prototype: SVGFETurbulenceElement; + new(): SVGFETurbulenceElement; + SVG_STITCHTYPE_NOSTITCH: number; + SVG_STITCHTYPE_STITCH: number; + SVG_STITCHTYPE_UNKNOWN: number; + SVG_TURBULENCE_TYPE_FRACTALNOISE: number; + SVG_TURBULENCE_TYPE_TURBULENCE: number; + SVG_TURBULENCE_TYPE_UNKNOWN: number; +} + +interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { + filterResX: SVGAnimatedInteger; + filterResY: SVGAnimatedInteger; + filterUnits: SVGAnimatedEnumeration; + height: SVGAnimatedLength; + primitiveUnits: SVGAnimatedEnumeration; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + setFilterRes(filterResX: number, filterResY: number): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFilterElement: { + prototype: SVGFilterElement; + new(): SVGFilterElement; +} + +interface SVGForeignObjectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + height: SVGAnimatedLength; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGForeignObjectElement: { + prototype: SVGForeignObjectElement; + new(): SVGForeignObjectElement; +} + +interface SVGGElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGGElement: { + prototype: SVGGElement; + new(): SVGGElement; +} + +interface SVGGradientElement extends SVGElement, SVGStylable, SVGExternalResourcesRequired, SVGURIReference, SVGUnitTypes { + gradientTransform: SVGAnimatedTransformList; + gradientUnits: SVGAnimatedEnumeration; + spreadMethod: SVGAnimatedEnumeration; + SVG_SPREADMETHOD_PAD: number; + SVG_SPREADMETHOD_REFLECT: number; + SVG_SPREADMETHOD_REPEAT: number; + SVG_SPREADMETHOD_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGGradientElement: { + prototype: SVGGradientElement; + new(): SVGGradientElement; + SVG_SPREADMETHOD_PAD: number; + SVG_SPREADMETHOD_REFLECT: number; + SVG_SPREADMETHOD_REPEAT: number; + SVG_SPREADMETHOD_UNKNOWN: number; +} + +interface SVGImageElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { + height: SVGAnimatedLength; + preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGImageElement: { + prototype: SVGImageElement; + new(): SVGImageElement; +} + +interface SVGLength { + unitType: number; + value: number; + valueAsString: string; + valueInSpecifiedUnits: number; + convertToSpecifiedUnits(unitType: number): void; + newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; + SVG_LENGTHTYPE_CM: number; + SVG_LENGTHTYPE_EMS: number; + SVG_LENGTHTYPE_EXS: number; + SVG_LENGTHTYPE_IN: number; + SVG_LENGTHTYPE_MM: number; + SVG_LENGTHTYPE_NUMBER: number; + SVG_LENGTHTYPE_PC: number; + SVG_LENGTHTYPE_PERCENTAGE: number; + SVG_LENGTHTYPE_PT: number; + SVG_LENGTHTYPE_PX: number; + SVG_LENGTHTYPE_UNKNOWN: number; +} + +declare var SVGLength: { + prototype: SVGLength; + new(): SVGLength; + SVG_LENGTHTYPE_CM: number; + SVG_LENGTHTYPE_EMS: number; + SVG_LENGTHTYPE_EXS: number; + SVG_LENGTHTYPE_IN: number; + SVG_LENGTHTYPE_MM: number; + SVG_LENGTHTYPE_NUMBER: number; + SVG_LENGTHTYPE_PC: number; + SVG_LENGTHTYPE_PERCENTAGE: number; + SVG_LENGTHTYPE_PT: number; + SVG_LENGTHTYPE_PX: number; + SVG_LENGTHTYPE_UNKNOWN: number; +} + +interface SVGLengthList { + numberOfItems: number; + appendItem(newItem: SVGLength): SVGLength; + clear(): void; + getItem(index: number): SVGLength; + initialize(newItem: SVGLength): SVGLength; + insertItemBefore(newItem: SVGLength, index: number): SVGLength; + removeItem(index: number): SVGLength; + replaceItem(newItem: SVGLength, index: number): SVGLength; +} + +declare var SVGLengthList: { + prototype: SVGLengthList; + new(): SVGLengthList; +} + +interface SVGLineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + x1: SVGAnimatedLength; + x2: SVGAnimatedLength; + y1: SVGAnimatedLength; + y2: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGLineElement: { + prototype: SVGLineElement; + new(): SVGLineElement; +} + +interface SVGLinearGradientElement extends SVGGradientElement { + x1: SVGAnimatedLength; + x2: SVGAnimatedLength; + y1: SVGAnimatedLength; + y2: SVGAnimatedLength; +} + +declare var SVGLinearGradientElement: { + prototype: SVGLinearGradientElement; + new(): SVGLinearGradientElement; +} + +interface SVGMarkerElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox { + markerHeight: SVGAnimatedLength; + markerUnits: SVGAnimatedEnumeration; + markerWidth: SVGAnimatedLength; + orientAngle: SVGAnimatedAngle; + orientType: SVGAnimatedEnumeration; + refX: SVGAnimatedLength; + refY: SVGAnimatedLength; + setOrientToAngle(angle: SVGAngle): void; + setOrientToAuto(): void; + SVG_MARKERUNITS_STROKEWIDTH: number; + SVG_MARKERUNITS_UNKNOWN: number; + SVG_MARKERUNITS_USERSPACEONUSE: number; + SVG_MARKER_ORIENT_ANGLE: number; + SVG_MARKER_ORIENT_AUTO: number; + SVG_MARKER_ORIENT_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGMarkerElement: { + prototype: SVGMarkerElement; + new(): SVGMarkerElement; + SVG_MARKERUNITS_STROKEWIDTH: number; + SVG_MARKERUNITS_UNKNOWN: number; + SVG_MARKERUNITS_USERSPACEONUSE: number; + SVG_MARKER_ORIENT_ANGLE: number; + SVG_MARKER_ORIENT_AUTO: number; + SVG_MARKER_ORIENT_UNKNOWN: number; +} + +interface SVGMaskElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes { + height: SVGAnimatedLength; + maskContentUnits: SVGAnimatedEnumeration; + maskUnits: SVGAnimatedEnumeration; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGMaskElement: { + prototype: SVGMaskElement; + new(): SVGMaskElement; +} + +interface SVGMatrix { a: number; - d: number; - m32: number; - m41: number; - m11: number; - f: number; - e: number; - m23: number; - m14: number; - m33: number; - m22: number; - m21: number; - c: number; - m12: number; b: number; - m42: number; - m31: number; - m43: number; - m13: number; - m44: number; - multiply(secondMatrix: MSCSSMatrix): MSCSSMatrix; - skewY(angle: number): MSCSSMatrix; - setMatrixValue(value: string): void; - inverse(): MSCSSMatrix; - rotateAxisAngle(x: number, y: number, z: number, angle: number): MSCSSMatrix; - toString(): string; - rotate(angleX: number, angleY?: number, angleZ?: number): MSCSSMatrix; - translate(x: number, y: number, z?: number): MSCSSMatrix; - scale(scaleX: number, scaleY?: number, scaleZ?: number): MSCSSMatrix; - skewX(angle: number): MSCSSMatrix; -} -declare var MSCSSMatrix: { - prototype: MSCSSMatrix; - new(text?: string): MSCSSMatrix; + c: number; + d: number; + e: number; + f: number; + flipX(): SVGMatrix; + flipY(): SVGMatrix; + inverse(): SVGMatrix; + multiply(secondMatrix: SVGMatrix): SVGMatrix; + rotate(angle: number): SVGMatrix; + rotateFromVector(x: number, y: number): SVGMatrix; + scale(scaleFactor: number): SVGMatrix; + scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix; + skewX(angle: number): SVGMatrix; + skewY(angle: number): SVGMatrix; + translate(x: number, y: number): SVGMatrix; } -interface Worker extends AbstractWorker { - onmessage: (ev: MessageEvent) => any; - postMessage(message: any, ports?: any): void; - terminate(): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Worker: { - prototype: Worker; - new(stringUrl: string): Worker; +declare var SVGMatrix: { + prototype: SVGMatrix; + new(): SVGMatrix; } -interface MSExecAtPriorityFunctionCallback { - (...args: any[]): any; +interface SVGMetadataElement extends SVGElement { } -interface MSGraphicsTrust { - status: string; - constrictionActive: boolean; -} -declare var MSGraphicsTrust: { - prototype: MSGraphicsTrust; - new(): MSGraphicsTrust; +declare var SVGMetadataElement: { + prototype: SVGMetadataElement; + new(): SVGMetadataElement; } -interface SubtleCrypto { - unwrapKey(wrappedKey: ArrayBufferView, keyAlgorithm: any, keyEncryptionKey: Key, extractable?: boolean, keyUsages?: string[]): KeyOperation; - encrypt(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; - importKey(format: string, keyData: ArrayBufferView, algorithm: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; - wrapKey(key: Key, keyEncryptionKey: Key, keyWrappingAlgorithm: any): KeyOperation; - verify(algorithm: any, key: Key, signature: ArrayBufferView, buffer?: ArrayBufferView): CryptoOperation; - deriveKey(algorithm: any, baseKey: Key, derivedKeyType: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; - digest(algorithm: any, buffer?: ArrayBufferView): CryptoOperation; - exportKey(format: string, key: Key): KeyOperation; - generateKey(algorithm: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; - sign(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; - decrypt(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; -} -declare var SubtleCrypto: { - prototype: SubtleCrypto; - new(): SubtleCrypto; +interface SVGNumber { + value: number; } -interface Crypto extends RandomSource { - subtle: SubtleCrypto; -} -declare var Crypto: { - prototype: Crypto; - new(): Crypto; +declare var SVGNumber: { + prototype: SVGNumber; + new(): SVGNumber; } -interface VideoPlaybackQuality { - totalFrameDelay: number; - creationTime: number; - totalVideoFrames: number; - droppedVideoFrames: number; -} -declare var VideoPlaybackQuality: { - prototype: VideoPlaybackQuality; - new(): VideoPlaybackQuality; +interface SVGNumberList { + numberOfItems: number; + appendItem(newItem: SVGNumber): SVGNumber; + clear(): void; + getItem(index: number): SVGNumber; + initialize(newItem: SVGNumber): SVGNumber; + insertItemBefore(newItem: SVGNumber, index: number): SVGNumber; + removeItem(index: number): SVGNumber; + replaceItem(newItem: SVGNumber, index: number): SVGNumber; } -interface GlobalEventHandlers { - onpointerenter: (ev: PointerEvent) => any; - onpointerout: (ev: PointerEvent) => any; - onpointerdown: (ev: PointerEvent) => any; - onpointerup: (ev: PointerEvent) => any; - onpointercancel: (ev: PointerEvent) => any; - onpointerover: (ev: PointerEvent) => any; - onpointermove: (ev: PointerEvent) => any; - onpointerleave: (ev: PointerEvent) => any; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +declare var SVGNumberList: { + prototype: SVGNumberList; + new(): SVGNumberList; } -interface Key { - algorithm: Algorithm; - type: string; - extractable: boolean; - keyUsage: string[]; -} -declare var Key: { - prototype: Key; - new(): Key; +interface SVGPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPathData { + createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs; + createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel; + createSVGPathSegClosePath(): SVGPathSegClosePath; + createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs; + createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel; + createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs; + createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel; + createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs; + createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel; + createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs; + createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel; + createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs; + createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs; + createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel; + createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel; + createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs; + createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel; + createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs; + createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel; + getPathSegAtLength(distance: number): number; + getPointAtLength(distance: number): SVGPoint; + getTotalLength(): number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface DeviceAcceleration { - y: number; +declare var SVGPathElement: { + prototype: SVGPathElement; + new(): SVGPathElement; +} + +interface SVGPathSeg { + pathSegType: number; + pathSegTypeAsLetter: string; + PATHSEG_ARC_ABS: number; + PATHSEG_ARC_REL: number; + PATHSEG_CLOSEPATH: number; + PATHSEG_CURVETO_CUBIC_ABS: number; + PATHSEG_CURVETO_CUBIC_REL: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; + PATHSEG_CURVETO_QUADRATIC_ABS: number; + PATHSEG_CURVETO_QUADRATIC_REL: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; + PATHSEG_LINETO_ABS: number; + PATHSEG_LINETO_HORIZONTAL_ABS: number; + PATHSEG_LINETO_HORIZONTAL_REL: number; + PATHSEG_LINETO_REL: number; + PATHSEG_LINETO_VERTICAL_ABS: number; + PATHSEG_LINETO_VERTICAL_REL: number; + PATHSEG_MOVETO_ABS: number; + PATHSEG_MOVETO_REL: number; + PATHSEG_UNKNOWN: number; +} + +declare var SVGPathSeg: { + prototype: SVGPathSeg; + new(): SVGPathSeg; + PATHSEG_ARC_ABS: number; + PATHSEG_ARC_REL: number; + PATHSEG_CLOSEPATH: number; + PATHSEG_CURVETO_CUBIC_ABS: number; + PATHSEG_CURVETO_CUBIC_REL: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; + PATHSEG_CURVETO_QUADRATIC_ABS: number; + PATHSEG_CURVETO_QUADRATIC_REL: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; + PATHSEG_LINETO_ABS: number; + PATHSEG_LINETO_HORIZONTAL_ABS: number; + PATHSEG_LINETO_HORIZONTAL_REL: number; + PATHSEG_LINETO_REL: number; + PATHSEG_LINETO_VERTICAL_ABS: number; + PATHSEG_LINETO_VERTICAL_REL: number; + PATHSEG_MOVETO_ABS: number; + PATHSEG_MOVETO_REL: number; + PATHSEG_UNKNOWN: number; +} + +interface SVGPathSegArcAbs extends SVGPathSeg { + angle: number; + largeArcFlag: boolean; + r1: number; + r2: number; + sweepFlag: boolean; x: number; - z: number; -} -declare var DeviceAcceleration: { - prototype: DeviceAcceleration; - new(): DeviceAcceleration; + y: number; } -interface HTMLAllCollection extends HTMLCollection { - namedItem(name: string): Element; - // [name: string]: Element; -} -declare var HTMLAllCollection: { - prototype: HTMLAllCollection; - new(): HTMLAllCollection; +declare var SVGPathSegArcAbs: { + prototype: SVGPathSegArcAbs; + new(): SVGPathSegArcAbs; } -interface AesGcmEncryptResult { - ciphertext: ArrayBuffer; - tag: ArrayBuffer; -} -declare var AesGcmEncryptResult: { - prototype: AesGcmEncryptResult; - new(): AesGcmEncryptResult; +interface SVGPathSegArcRel extends SVGPathSeg { + angle: number; + largeArcFlag: boolean; + r1: number; + r2: number; + sweepFlag: boolean; + x: number; + y: number; } -interface NavigationCompletedEvent extends NavigationEvent { - webErrorStatus: number; - isSuccess: boolean; -} -declare var NavigationCompletedEvent: { - prototype: NavigationCompletedEvent; - new(): NavigationCompletedEvent; +declare var SVGPathSegArcRel: { + prototype: SVGPathSegArcRel; + new(): SVGPathSegArcRel; } -interface MutationRecord { - oldValue: string; - previousSibling: Node; - addedNodes: NodeList; - attributeName: string; - removedNodes: NodeList; - target: Node; - nextSibling: Node; - attributeNamespace: string; - type: string; -} -declare var MutationRecord: { - prototype: MutationRecord; - new(): MutationRecord; +interface SVGPathSegClosePath extends SVGPathSeg { } -interface MimeTypeArray { - length: number; - item(index: number): Plugin; - [index: number]: Plugin; - namedItem(type: string): Plugin; - // [type: string]: Plugin; -} -declare var MimeTypeArray: { - prototype: MimeTypeArray; - new(): MimeTypeArray; +declare var SVGPathSegClosePath: { + prototype: SVGPathSegClosePath; + new(): SVGPathSegClosePath; } -interface KeyOperation extends EventTarget { - oncomplete: (ev: Event) => any; - onerror: (ev: ErrorEvent) => any; - result: any; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var KeyOperation: { - prototype: KeyOperation; - new(): KeyOperation; +interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg { + x: number; + x1: number; + x2: number; + y: number; + y1: number; + y2: number; } -interface DOMStringMap { -} -declare var DOMStringMap: { - prototype: DOMStringMap; - new(): DOMStringMap; +declare var SVGPathSegCurvetoCubicAbs: { + prototype: SVGPathSegCurvetoCubicAbs; + new(): SVGPathSegCurvetoCubicAbs; } -interface DeviceOrientationEvent extends Event { - gamma: number; - alpha: number; - absolute: boolean; - beta: number; - initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number, beta: number, gamma: number, absolute: boolean): void; -} -declare var DeviceOrientationEvent: { - prototype: DeviceOrientationEvent; - new(): DeviceOrientationEvent; +interface SVGPathSegCurvetoCubicRel extends SVGPathSeg { + x: number; + x1: number; + x2: number; + y: number; + y1: number; + y2: number; } -interface MSMediaKeys { - keySystem: string; - createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession; -} -declare var MSMediaKeys: { - prototype: MSMediaKeys; - new(keySystem: string): MSMediaKeys; - isTypeSupported(keySystem: string, type?: string): boolean; +declare var SVGPathSegCurvetoCubicRel: { + prototype: SVGPathSegCurvetoCubicRel; + new(): SVGPathSegCurvetoCubicRel; } -interface MSMediaKeyMessageEvent extends Event { - destinationURL: string; - message: Uint8Array; -} -declare var MSMediaKeyMessageEvent: { - prototype: MSMediaKeyMessageEvent; - new(): MSMediaKeyMessageEvent; +interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg { + x: number; + x2: number; + y: number; + y2: number; } -interface MSHTMLWebViewElement extends HTMLElement { - documentTitle: string; - width: number; - src: string; - canGoForward: boolean; +declare var SVGPathSegCurvetoCubicSmoothAbs: { + prototype: SVGPathSegCurvetoCubicSmoothAbs; + new(): SVGPathSegCurvetoCubicSmoothAbs; +} + +interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { + x: number; + x2: number; + y: number; + y2: number; +} + +declare var SVGPathSegCurvetoCubicSmoothRel: { + prototype: SVGPathSegCurvetoCubicSmoothRel; + new(): SVGPathSegCurvetoCubicSmoothRel; +} + +interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg { + x: number; + x1: number; + y: number; + y1: number; +} + +declare var SVGPathSegCurvetoQuadraticAbs: { + prototype: SVGPathSegCurvetoQuadraticAbs; + new(): SVGPathSegCurvetoQuadraticAbs; +} + +interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { + x: number; + x1: number; + y: number; + y1: number; +} + +declare var SVGPathSegCurvetoQuadraticRel: { + prototype: SVGPathSegCurvetoQuadraticRel; + new(): SVGPathSegCurvetoQuadraticRel; +} + +interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegCurvetoQuadraticSmoothAbs: { + prototype: SVGPathSegCurvetoQuadraticSmoothAbs; + new(): SVGPathSegCurvetoQuadraticSmoothAbs; +} + +interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegCurvetoQuadraticSmoothRel: { + prototype: SVGPathSegCurvetoQuadraticSmoothRel; + new(): SVGPathSegCurvetoQuadraticSmoothRel; +} + +interface SVGPathSegLinetoAbs extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegLinetoAbs: { + prototype: SVGPathSegLinetoAbs; + new(): SVGPathSegLinetoAbs; +} + +interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg { + x: number; +} + +declare var SVGPathSegLinetoHorizontalAbs: { + prototype: SVGPathSegLinetoHorizontalAbs; + new(): SVGPathSegLinetoHorizontalAbs; +} + +interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg { + x: number; +} + +declare var SVGPathSegLinetoHorizontalRel: { + prototype: SVGPathSegLinetoHorizontalRel; + new(): SVGPathSegLinetoHorizontalRel; +} + +interface SVGPathSegLinetoRel extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegLinetoRel: { + prototype: SVGPathSegLinetoRel; + new(): SVGPathSegLinetoRel; +} + +interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg { + y: number; +} + +declare var SVGPathSegLinetoVerticalAbs: { + prototype: SVGPathSegLinetoVerticalAbs; + new(): SVGPathSegLinetoVerticalAbs; +} + +interface SVGPathSegLinetoVerticalRel extends SVGPathSeg { + y: number; +} + +declare var SVGPathSegLinetoVerticalRel: { + prototype: SVGPathSegLinetoVerticalRel; + new(): SVGPathSegLinetoVerticalRel; +} + +interface SVGPathSegList { + numberOfItems: number; + appendItem(newItem: SVGPathSeg): SVGPathSeg; + clear(): void; + getItem(index: number): SVGPathSeg; + initialize(newItem: SVGPathSeg): SVGPathSeg; + insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg; + removeItem(index: number): SVGPathSeg; + replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg; +} + +declare var SVGPathSegList: { + prototype: SVGPathSegList; + new(): SVGPathSegList; +} + +interface SVGPathSegMovetoAbs extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegMovetoAbs: { + prototype: SVGPathSegMovetoAbs; + new(): SVGPathSegMovetoAbs; +} + +interface SVGPathSegMovetoRel extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegMovetoRel: { + prototype: SVGPathSegMovetoRel; + new(): SVGPathSegMovetoRel; +} + +interface SVGPatternElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGURIReference, SVGUnitTypes { + height: SVGAnimatedLength; + patternContentUnits: SVGAnimatedEnumeration; + patternTransform: SVGAnimatedTransformList; + patternUnits: SVGAnimatedEnumeration; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPatternElement: { + prototype: SVGPatternElement; + new(): SVGPatternElement; +} + +interface SVGPoint { + x: number; + y: number; + matrixTransform(matrix: SVGMatrix): SVGPoint; +} + +declare var SVGPoint: { + prototype: SVGPoint; + new(): SVGPoint; +} + +interface SVGPointList { + numberOfItems: number; + appendItem(newItem: SVGPoint): SVGPoint; + clear(): void; + getItem(index: number): SVGPoint; + initialize(newItem: SVGPoint): SVGPoint; + insertItemBefore(newItem: SVGPoint, index: number): SVGPoint; + removeItem(index: number): SVGPoint; + replaceItem(newItem: SVGPoint, index: number): SVGPoint; +} + +declare var SVGPointList: { + prototype: SVGPointList; + new(): SVGPointList; +} + +interface SVGPolygonElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPolygonElement: { + prototype: SVGPolygonElement; + new(): SVGPolygonElement; +} + +interface SVGPolylineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPolylineElement: { + prototype: SVGPolylineElement; + new(): SVGPolylineElement; +} + +interface SVGPreserveAspectRatio { + align: number; + meetOrSlice: number; + SVG_MEETORSLICE_MEET: number; + SVG_MEETORSLICE_SLICE: number; + SVG_MEETORSLICE_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_NONE: number; + SVG_PRESERVEASPECTRATIO_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; + SVG_PRESERVEASPECTRATIO_XMAXYMID: number; + SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; + SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; + SVG_PRESERVEASPECTRATIO_XMIDYMID: number; + SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; + SVG_PRESERVEASPECTRATIO_XMINYMAX: number; + SVG_PRESERVEASPECTRATIO_XMINYMID: number; + SVG_PRESERVEASPECTRATIO_XMINYMIN: number; +} + +declare var SVGPreserveAspectRatio: { + prototype: SVGPreserveAspectRatio; + new(): SVGPreserveAspectRatio; + SVG_MEETORSLICE_MEET: number; + SVG_MEETORSLICE_SLICE: number; + SVG_MEETORSLICE_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_NONE: number; + SVG_PRESERVEASPECTRATIO_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; + SVG_PRESERVEASPECTRATIO_XMAXYMID: number; + SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; + SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; + SVG_PRESERVEASPECTRATIO_XMIDYMID: number; + SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; + SVG_PRESERVEASPECTRATIO_XMINYMAX: number; + SVG_PRESERVEASPECTRATIO_XMINYMID: number; + SVG_PRESERVEASPECTRATIO_XMINYMIN: number; +} + +interface SVGRadialGradientElement extends SVGGradientElement { + cx: SVGAnimatedLength; + cy: SVGAnimatedLength; + fx: SVGAnimatedLength; + fy: SVGAnimatedLength; + r: SVGAnimatedLength; +} + +declare var SVGRadialGradientElement: { + prototype: SVGRadialGradientElement; + new(): SVGRadialGradientElement; +} + +interface SVGRect { height: number; - canGoBack: boolean; - navigateWithHttpRequestMessage(requestMessage: any): void; - goBack(): void; - navigate(uri: string): void; - stop(): void; - navigateToString(contents: string): void; - captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation; - capturePreviewToBlobAsync(): MSWebViewAsyncOperation; - refresh(): void; - goForward(): void; - navigateToLocalStreamUri(source: string, streamResolver: any): void; - invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation; - buildLocalStreamUri(contentIdentifier: string, relativePath: string): string; -} -declare var MSHTMLWebViewElement: { - prototype: MSHTMLWebViewElement; - new(): MSHTMLWebViewElement; + width: number; + x: number; + y: number; } -interface NavigationEvent extends Event { - uri: string; -} -declare var NavigationEvent: { - prototype: NavigationEvent; - new(): NavigationEvent; +declare var SVGRect: { + prototype: SVGRect; + new(): SVGRect; } -interface RandomSource { - getRandomValues(array: ArrayBufferView): ArrayBufferView; +interface SVGRectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + height: SVGAnimatedLength; + rx: SVGAnimatedLength; + ry: SVGAnimatedLength; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGRectElement: { + prototype: SVGRectElement; + new(): SVGRectElement; +} + +interface SVGSVGElement extends SVGElement, DocumentEvent, SVGLocatable, SVGTests, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan { + contentScriptType: string; + contentStyleType: string; + currentScale: number; + currentTranslate: SVGPoint; + height: SVGAnimatedLength; + onabort: (ev: Event) => any; + onerror: (ev: Event) => any; + onresize: (ev: UIEvent) => any; + onscroll: (ev: UIEvent) => any; + onunload: (ev: Event) => any; + onzoom: (ev: SVGZoomEvent) => any; + pixelUnitToMillimeterX: number; + pixelUnitToMillimeterY: number; + screenPixelToMillimeterX: number; + screenPixelToMillimeterY: number; + viewport: SVGRect; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + checkEnclosure(element: SVGElement, rect: SVGRect): boolean; + checkIntersection(element: SVGElement, rect: SVGRect): boolean; + createSVGAngle(): SVGAngle; + createSVGLength(): SVGLength; + createSVGMatrix(): SVGMatrix; + createSVGNumber(): SVGNumber; + createSVGPoint(): SVGPoint; + createSVGRect(): SVGRect; + createSVGTransform(): SVGTransform; + createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; + deselectAll(): void; + forceRedraw(): void; + getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; + getCurrentTime(): number; + getElementById(elementId: string): Element; + getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeList; + getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeList; + pauseAnimations(): void; + setCurrentTime(seconds: number): void; + suspendRedraw(maxWaitMilliseconds: number): number; + unpauseAnimations(): void; + unsuspendRedraw(suspendHandleID: number): void; + unsuspendRedrawAll(): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "SVGAbort", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "SVGError", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "SVGUnload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "SVGZoom", listener: (ev: SVGZoomEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGSVGElement: { + prototype: SVGSVGElement; + new(): SVGSVGElement; +} + +interface SVGScriptElement extends SVGElement, SVGExternalResourcesRequired, SVGURIReference { + type: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGScriptElement: { + prototype: SVGScriptElement; + new(): SVGScriptElement; +} + +interface SVGStopElement extends SVGElement, SVGStylable { + offset: SVGAnimatedNumber; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGStopElement: { + prototype: SVGStopElement; + new(): SVGStopElement; +} + +interface SVGStringList { + numberOfItems: number; + appendItem(newItem: string): string; + clear(): void; + getItem(index: number): string; + initialize(newItem: string): string; + insertItemBefore(newItem: string, index: number): string; + removeItem(index: number): string; + replaceItem(newItem: string, index: number): string; +} + +declare var SVGStringList: { + prototype: SVGStringList; + new(): SVGStringList; +} + +interface SVGStyleElement extends SVGElement, SVGLangSpace { + media: string; + title: string; + type: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGStyleElement: { + prototype: SVGStyleElement; + new(): SVGStyleElement; +} + +interface SVGSwitchElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGSwitchElement: { + prototype: SVGSwitchElement; + new(): SVGSwitchElement; +} + +interface SVGSymbolElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGSymbolElement: { + prototype: SVGSymbolElement; + new(): SVGSymbolElement; +} + +interface SVGTSpanElement extends SVGTextPositioningElement { +} + +declare var SVGTSpanElement: { + prototype: SVGTSpanElement; + new(): SVGTSpanElement; +} + +interface SVGTextContentElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + lengthAdjust: SVGAnimatedEnumeration; + textLength: SVGAnimatedLength; + getCharNumAtPosition(point: SVGPoint): number; + getComputedTextLength(): number; + getEndPositionOfChar(charnum: number): SVGPoint; + getExtentOfChar(charnum: number): SVGRect; + getNumberOfChars(): number; + getRotationOfChar(charnum: number): number; + getStartPositionOfChar(charnum: number): SVGPoint; + getSubStringLength(charnum: number, nchars: number): number; + selectSubString(charnum: number, nchars: number): void; + LENGTHADJUST_SPACING: number; + LENGTHADJUST_SPACINGANDGLYPHS: number; + LENGTHADJUST_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTextContentElement: { + prototype: SVGTextContentElement; + new(): SVGTextContentElement; + LENGTHADJUST_SPACING: number; + LENGTHADJUST_SPACINGANDGLYPHS: number; + LENGTHADJUST_UNKNOWN: number; +} + +interface SVGTextElement extends SVGTextPositioningElement, SVGTransformable { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTextElement: { + prototype: SVGTextElement; + new(): SVGTextElement; +} + +interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { + method: SVGAnimatedEnumeration; + spacing: SVGAnimatedEnumeration; + startOffset: SVGAnimatedLength; + TEXTPATH_METHODTYPE_ALIGN: number; + TEXTPATH_METHODTYPE_STRETCH: number; + TEXTPATH_METHODTYPE_UNKNOWN: number; + TEXTPATH_SPACINGTYPE_AUTO: number; + TEXTPATH_SPACINGTYPE_EXACT: number; + TEXTPATH_SPACINGTYPE_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTextPathElement: { + prototype: SVGTextPathElement; + new(): SVGTextPathElement; + TEXTPATH_METHODTYPE_ALIGN: number; + TEXTPATH_METHODTYPE_STRETCH: number; + TEXTPATH_METHODTYPE_UNKNOWN: number; + TEXTPATH_SPACINGTYPE_AUTO: number; + TEXTPATH_SPACINGTYPE_EXACT: number; + TEXTPATH_SPACINGTYPE_UNKNOWN: number; +} + +interface SVGTextPositioningElement extends SVGTextContentElement { + dx: SVGAnimatedLengthList; + dy: SVGAnimatedLengthList; + rotate: SVGAnimatedNumberList; + x: SVGAnimatedLengthList; + y: SVGAnimatedLengthList; +} + +declare var SVGTextPositioningElement: { + prototype: SVGTextPositioningElement; + new(): SVGTextPositioningElement; +} + +interface SVGTitleElement extends SVGElement, SVGStylable, SVGLangSpace { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTitleElement: { + prototype: SVGTitleElement; + new(): SVGTitleElement; +} + +interface SVGTransform { + angle: number; + matrix: SVGMatrix; + type: number; + setMatrix(matrix: SVGMatrix): void; + setRotate(angle: number, cx: number, cy: number): void; + setScale(sx: number, sy: number): void; + setSkewX(angle: number): void; + setSkewY(angle: number): void; + setTranslate(tx: number, ty: number): void; + SVG_TRANSFORM_MATRIX: number; + SVG_TRANSFORM_ROTATE: number; + SVG_TRANSFORM_SCALE: number; + SVG_TRANSFORM_SKEWX: number; + SVG_TRANSFORM_SKEWY: number; + SVG_TRANSFORM_TRANSLATE: number; + SVG_TRANSFORM_UNKNOWN: number; +} + +declare var SVGTransform: { + prototype: SVGTransform; + new(): SVGTransform; + SVG_TRANSFORM_MATRIX: number; + SVG_TRANSFORM_ROTATE: number; + SVG_TRANSFORM_SCALE: number; + SVG_TRANSFORM_SKEWX: number; + SVG_TRANSFORM_SKEWY: number; + SVG_TRANSFORM_TRANSLATE: number; + SVG_TRANSFORM_UNKNOWN: number; +} + +interface SVGTransformList { + numberOfItems: number; + appendItem(newItem: SVGTransform): SVGTransform; + clear(): void; + consolidate(): SVGTransform; + createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; + getItem(index: number): SVGTransform; + initialize(newItem: SVGTransform): SVGTransform; + insertItemBefore(newItem: SVGTransform, index: number): SVGTransform; + removeItem(index: number): SVGTransform; + replaceItem(newItem: SVGTransform, index: number): SVGTransform; +} + +declare var SVGTransformList: { + prototype: SVGTransformList; + new(): SVGTransformList; +} + +interface SVGUnitTypes { + SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; + SVG_UNIT_TYPE_UNKNOWN: number; + SVG_UNIT_TYPE_USERSPACEONUSE: number; +} +declare var SVGUnitTypes: SVGUnitTypes; + +interface SVGUseElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { + animatedInstanceRoot: SVGElementInstance; + height: SVGAnimatedLength; + instanceRoot: SVGElementInstance; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGUseElement: { + prototype: SVGUseElement; + new(): SVGUseElement; +} + +interface SVGViewElement extends SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan { + viewTarget: SVGStringList; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGViewElement: { + prototype: SVGViewElement; + new(): SVGViewElement; +} + +interface SVGZoomAndPan { + SVG_ZOOMANDPAN_DISABLE: number; + SVG_ZOOMANDPAN_MAGNIFY: number; + SVG_ZOOMANDPAN_UNKNOWN: number; +} +declare var SVGZoomAndPan: SVGZoomAndPan; + +interface SVGZoomEvent extends UIEvent { + newScale: number; + newTranslate: SVGPoint; + previousScale: number; + previousTranslate: SVGPoint; + zoomRectScreen: SVGRect; +} + +declare var SVGZoomEvent: { + prototype: SVGZoomEvent; + new(): SVGZoomEvent; +} + +interface Screen extends EventTarget { + availHeight: number; + availWidth: number; + bufferDepth: number; + colorDepth: number; + deviceXDPI: number; + deviceYDPI: number; + fontSmoothingEnabled: boolean; + height: number; + logicalXDPI: number; + logicalYDPI: number; + msOrientation: string; + onmsorientationchange: (ev: Event) => any; + pixelDepth: number; + systemXDPI: number; + systemYDPI: number; + width: number; + msLockOrientation(orientations: string): boolean; + msLockOrientation(orientations: string[]): boolean; + msUnlockOrientation(): void; + addEventListener(type: "MSOrientationChange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Screen: { + prototype: Screen; + new(): Screen; +} + +interface ScriptNotifyEvent extends Event { + callingUri: string; + value: string; +} + +declare var ScriptNotifyEvent: { + prototype: ScriptNotifyEvent; + new(): ScriptNotifyEvent; +} + +interface ScriptProcessorNode extends AudioNode { + bufferSize: number; + onaudioprocess: (ev: AudioProcessingEvent) => any; + addEventListener(type: "audioprocess", listener: (ev: AudioProcessingEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var ScriptProcessorNode: { + prototype: ScriptProcessorNode; + new(): ScriptProcessorNode; +} + +interface Selection { + anchorNode: Node; + anchorOffset: number; + focusNode: Node; + focusOffset: number; + isCollapsed: boolean; + rangeCount: number; + type: string; + addRange(range: Range): void; + collapse(parentNode: Node, offset: number): void; + collapseToEnd(): void; + collapseToStart(): void; + containsNode(node: Node, partlyContained: boolean): boolean; + deleteFromDocument(): void; + empty(): void; + extend(newNode: Node, offset: number): void; + getRangeAt(index: number): Range; + removeAllRanges(): void; + removeRange(range: Range): void; + selectAllChildren(parentNode: Node): void; + setBaseAndExtent(baseNode: Node, baseOffset: number, extentNode: Node, extentOffset: number): void; + toString(): string; +} + +declare var Selection: { + prototype: Selection; + new(): Selection; } interface SourceBuffer extends EventTarget { - updating: boolean; - appendWindowStart: number; appendWindowEnd: number; - buffered: TimeRanges; - timestampOffset: number; + appendWindowStart: number; audioTracks: AudioTrackList; - appendBuffer(data: ArrayBuffer): void; - remove(start: number, end: number): void; + buffered: TimeRanges; + mode: string; + timestampOffset: number; + updating: boolean; + videoTracks: VideoTrackList; abort(): void; + appendBuffer(data: ArrayBuffer): void; + appendBuffer(data: ArrayBufferView): void; appendStream(stream: MSStream, maxSize?: number): void; + remove(start: number, end: number): void; } + declare var SourceBuffer: { prototype: SourceBuffer; new(): SourceBuffer; } -interface MSInputMethodContext extends EventTarget { - oncandidatewindowshow: (ev: any) => any; - target: HTMLElement; - compositionStartOffset: number; - oncandidatewindowhide: (ev: any) => any; - oncandidatewindowupdate: (ev: any) => any; - compositionEndOffset: number; - getCompositionAlternatives(): string[]; - getCandidateWindowClientRect(): ClientRect; - hasComposition(): boolean; - isCandidateWindowVisible(): boolean; - addEventListener(type: "candidatewindowshow", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "candidatewindowhide", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "candidatewindowupdate", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var MSInputMethodContext: { - prototype: MSInputMethodContext; - new(): MSInputMethodContext; -} - -interface DeviceRotationRate { - gamma: number; - alpha: number; - beta: number; -} -declare var DeviceRotationRate: { - prototype: DeviceRotationRate; - new(): DeviceRotationRate; -} - -interface PluginArray { - length: number; - refresh(reload?: boolean): void; - item(index: number): Plugin; - [index: number]: Plugin; - namedItem(name: string): Plugin; - // [name: string]: Plugin; -} -declare var PluginArray: { - prototype: PluginArray; - new(): PluginArray; -} - -interface MSMediaKeyError { - systemCode: number; - code: number; - MS_MEDIA_KEYERR_SERVICE: number; - MS_MEDIA_KEYERR_HARDWARECHANGE: number; - MS_MEDIA_KEYERR_OUTPUT: number; - MS_MEDIA_KEYERR_DOMAIN: number; - MS_MEDIA_KEYERR_UNKNOWN: number; - MS_MEDIA_KEYERR_CLIENT: number; -} -declare var MSMediaKeyError: { - prototype: MSMediaKeyError; - new(): MSMediaKeyError; - MS_MEDIA_KEYERR_SERVICE: number; - MS_MEDIA_KEYERR_HARDWARECHANGE: number; - MS_MEDIA_KEYERR_OUTPUT: number; - MS_MEDIA_KEYERR_DOMAIN: number; - MS_MEDIA_KEYERR_UNKNOWN: number; - MS_MEDIA_KEYERR_CLIENT: number; -} - -interface Plugin { - length: number; - filename: string; - version: string; - name: string; - description: string; - item(index: number): MimeType; - [index: number]: MimeType; - namedItem(type: string): MimeType; - // [type: string]: MimeType; -} -declare var Plugin: { - prototype: Plugin; - new(): Plugin; -} - -interface MediaSource extends EventTarget { - sourceBuffers: SourceBufferList; - duration: number; - readyState: string; - activeSourceBuffers: SourceBufferList; - addSourceBuffer(type: string): SourceBuffer; - endOfStream(error?: string): void; - removeSourceBuffer(sourceBuffer: SourceBuffer): void; -} -declare var MediaSource: { - prototype: MediaSource; - new(): MediaSource; - isTypeSupported(type: string): boolean; -} - interface SourceBufferList extends EventTarget { length: number; item(index: number): SourceBuffer; [index: number]: SourceBuffer; } + declare var SourceBufferList: { prototype: SourceBufferList; new(): SourceBufferList; } -interface XMLDocument extends Document { -} -declare var XMLDocument: { - prototype: XMLDocument; - new(): XMLDocument; +interface StereoPannerNode extends AudioNode { + pan: AudioParam; } -interface DeviceMotionEvent extends Event { - rotationRate: DeviceRotationRate; - acceleration: DeviceAcceleration; - interval: number; - accelerationIncludingGravity: DeviceAcceleration; - initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict, accelerationIncludingGravity: DeviceAccelerationDict, rotationRate: DeviceRotationRateDict, interval: number): void; -} -declare var DeviceMotionEvent: { - prototype: DeviceMotionEvent; - new(): DeviceMotionEvent; +declare var StereoPannerNode: { + prototype: StereoPannerNode; + new(): StereoPannerNode; } -interface MimeType { - enabledPlugin: Plugin; - suffixes: string; +interface Storage { + length: number; + clear(): void; + getItem(key: string): any; + key(index: number): string; + removeItem(key: string): void; + setItem(key: string, data: string): void; + [key: string]: any; + [index: number]: string; +} + +declare var Storage: { + prototype: Storage; + new(): Storage; +} + +interface StorageEvent extends Event { + key: string; + newValue: any; + oldValue: any; + storageArea: Storage; + url: string; + initStorageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, keyArg: string, oldValueArg: any, newValueArg: any, urlArg: string, storageAreaArg: Storage): void; +} + +declare var StorageEvent: { + prototype: StorageEvent; + new(): StorageEvent; +} + +interface StyleMedia { type: string; - description: string; -} -declare var MimeType: { - prototype: MimeType; - new(): MimeType; + matchMedium(mediaquery: string): boolean; } -interface PointerEvent extends MouseEvent { +declare var StyleMedia: { + prototype: StyleMedia; + new(): StyleMedia; +} + +interface StyleSheet { + disabled: boolean; + href: string; + media: MediaList; + ownerNode: Node; + parentStyleSheet: StyleSheet; + title: string; + type: string; +} + +declare var StyleSheet: { + prototype: StyleSheet; + new(): StyleSheet; +} + +interface StyleSheetList { + length: number; + item(index?: number): StyleSheet; + [index: number]: StyleSheet; +} + +declare var StyleSheetList: { + prototype: StyleSheetList; + new(): StyleSheetList; +} + +interface StyleSheetPageList { + length: number; + item(index: number): CSSPageRule; + [index: number]: CSSPageRule; +} + +declare var StyleSheetPageList: { + prototype: StyleSheetPageList; + new(): StyleSheetPageList; +} + +interface SubtleCrypto { + decrypt(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; + decrypt(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; + deriveBits(algorithm: string, baseKey: CryptoKey, length: number): any; + deriveBits(algorithm: Algorithm, baseKey: CryptoKey, length: number): any; + deriveKey(algorithm: string, baseKey: CryptoKey, derivedKeyType: string, extractable: boolean, keyUsages: string[]): any; + deriveKey(algorithm: string, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: boolean, keyUsages: string[]): any; + deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: string, extractable: boolean, keyUsages: string[]): any; + deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: boolean, keyUsages: string[]): any; + digest(algorithm: string, data: ArrayBufferView): any; + digest(algorithm: Algorithm, data: ArrayBufferView): any; + encrypt(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; + encrypt(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; + exportKey(format: string, key: CryptoKey): any; + generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): any; + generateKey(algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + importKey(format: string, keyData: ArrayBufferView, algorithm: string, extractable: boolean, keyUsages: string[]): any; + importKey(format: string, keyData: ArrayBufferView, algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + sign(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; + sign(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + verify(algorithm: string, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): any; + verify(algorithm: Algorithm, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): any; + wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string): any; + wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: Algorithm): any; +} + +declare var SubtleCrypto: { + prototype: SubtleCrypto; + new(): SubtleCrypto; +} + +interface Text extends CharacterData { + wholeText: string; + replaceWholeText(content: string): Text; + splitText(offset: number): Text; +} + +declare var Text: { + prototype: Text; + new(): Text; +} + +interface TextEvent extends UIEvent { + data: string; + inputMethod: number; + locale: string; + initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void; + DOM_INPUT_METHOD_DROP: number; + DOM_INPUT_METHOD_HANDWRITING: number; + DOM_INPUT_METHOD_IME: number; + DOM_INPUT_METHOD_KEYBOARD: number; + DOM_INPUT_METHOD_MULTIMODAL: number; + DOM_INPUT_METHOD_OPTION: number; + DOM_INPUT_METHOD_PASTE: number; + DOM_INPUT_METHOD_SCRIPT: number; + DOM_INPUT_METHOD_UNKNOWN: number; + DOM_INPUT_METHOD_VOICE: number; +} + +declare var TextEvent: { + prototype: TextEvent; + new(): TextEvent; + DOM_INPUT_METHOD_DROP: number; + DOM_INPUT_METHOD_HANDWRITING: number; + DOM_INPUT_METHOD_IME: number; + DOM_INPUT_METHOD_KEYBOARD: number; + DOM_INPUT_METHOD_MULTIMODAL: number; + DOM_INPUT_METHOD_OPTION: number; + DOM_INPUT_METHOD_PASTE: number; + DOM_INPUT_METHOD_SCRIPT: number; + DOM_INPUT_METHOD_UNKNOWN: number; + DOM_INPUT_METHOD_VOICE: number; +} + +interface TextMetrics { width: number; - rotation: number; - pressure: number; - pointerType: any; - isPrimary: boolean; - tiltY: number; - height: number; - intermediatePoints: any; - currentPoint: any; - tiltX: number; - hwTimestamp: number; - pointerId: number; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; -} -declare var PointerEvent: { - prototype: PointerEvent; - new(): PointerEvent; } -interface MSDocumentExtensions { - captureEvents(): void; - releaseEvents(): void; +declare var TextMetrics: { + prototype: TextMetrics; + new(): TextMetrics; } -interface MutationObserver { - observe(target: Node, options: MutationObserverInit): void; - takeRecords(): MutationRecord[]; - disconnect(): void; -} -declare var MutationObserver: { - prototype: MutationObserver; - new (callback: (arr: MutationRecord[], observer: MutationObserver)=>any): MutationObserver; +interface TextRange { + boundingHeight: number; + boundingLeft: number; + boundingTop: number; + boundingWidth: number; + htmlText: string; + offsetLeft: number; + offsetTop: number; + text: string; + collapse(start?: boolean): void; + compareEndPoints(how: string, sourceRange: TextRange): number; + duplicate(): TextRange; + execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; + execCommandShowHelp(cmdID: string): boolean; + expand(Unit: string): boolean; + findText(string: string, count?: number, flags?: number): boolean; + getBookmark(): string; + getBoundingClientRect(): ClientRect; + getClientRects(): ClientRectList; + inRange(range: TextRange): boolean; + isEqual(range: TextRange): boolean; + move(unit: string, count?: number): number; + moveEnd(unit: string, count?: number): number; + moveStart(unit: string, count?: number): number; + moveToBookmark(bookmark: string): boolean; + moveToElementText(element: Element): void; + moveToPoint(x: number, y: number): void; + parentElement(): Element; + pasteHTML(html: string): void; + queryCommandEnabled(cmdID: string): boolean; + queryCommandIndeterm(cmdID: string): boolean; + queryCommandState(cmdID: string): boolean; + queryCommandSupported(cmdID: string): boolean; + queryCommandText(cmdID: string): string; + queryCommandValue(cmdID: string): any; + scrollIntoView(fStart?: boolean): void; + select(): void; + setEndPoint(how: string, SourceRange: TextRange): void; } -interface MSWebViewAsyncOperation extends EventTarget { - target: MSHTMLWebViewElement; - oncomplete: (ev: Event) => any; - error: DOMError; - onerror: (ev: ErrorEvent) => any; +declare var TextRange: { + prototype: TextRange; + new(): TextRange; +} + +interface TextRangeCollection { + length: number; + item(index: number): TextRange; + [index: number]: TextRange; +} + +declare var TextRangeCollection: { + prototype: TextRangeCollection; + new(): TextRangeCollection; +} + +interface TextTrack extends EventTarget { + activeCues: TextTrackCueList; + cues: TextTrackCueList; + inBandMetadataTrackDispatchType: string; + kind: string; + label: string; + language: string; + mode: any; + oncuechange: (ev: Event) => any; + onerror: (ev: Event) => any; + onload: (ev: Event) => any; readyState: number; - type: number; - result: any; - start(): void; + addCue(cue: TextTrackCue): void; + removeCue(cue: TextTrackCue): void; + DISABLED: number; ERROR: number; - TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; - TYPE_INVOKE_SCRIPT: number; - COMPLETED: number; - TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; - STARTED: number; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + HIDDEN: number; + LOADED: number; + LOADING: number; + NONE: number; + SHOWING: number; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -declare var MSWebViewAsyncOperation: { - prototype: MSWebViewAsyncOperation; - new(): MSWebViewAsyncOperation; + +declare var TextTrack: { + prototype: TextTrack; + new(): TextTrack; + DISABLED: number; ERROR: number; - TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; - TYPE_INVOKE_SCRIPT: number; - COMPLETED: number; - TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; - STARTED: number; + HIDDEN: number; + LOADED: number; + LOADING: number; + NONE: number; + SHOWING: number; } -interface ScriptNotifyEvent extends Event { - value: string; - callingUri: string; -} -declare var ScriptNotifyEvent: { - prototype: ScriptNotifyEvent; - new(): ScriptNotifyEvent; +interface TextTrackCue extends EventTarget { + endTime: number; + id: string; + onenter: (ev: Event) => any; + onexit: (ev: Event) => any; + pauseOnExit: boolean; + startTime: number; + text: string; + track: TextTrack; + getCueAsHTML(): DocumentFragment; + addEventListener(type: "enter", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "exit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface PerformanceNavigationTiming extends PerformanceEntry { - redirectStart: number; - domainLookupEnd: number; - responseStart: number; - domComplete: number; - domainLookupStart: number; - loadEventStart: number; - unloadEventEnd: number; - fetchStart: number; - requestStart: number; - domInteractive: number; - navigationStart: number; - connectEnd: number; - loadEventEnd: number; - connectStart: number; - responseEnd: number; - domLoading: number; - redirectEnd: number; - redirectCount: number; - unloadEventStart: number; - domContentLoadedEventStart: number; - domContentLoadedEventEnd: number; - type: string; -} -declare var PerformanceNavigationTiming: { - prototype: PerformanceNavigationTiming; - new(): PerformanceNavigationTiming; +declare var TextTrackCue: { + prototype: TextTrackCue; + new(startTime: number, endTime: number, text: string): TextTrackCue; } -interface MSMediaKeyNeededEvent extends Event { - initData: Uint8Array; -} -declare var MSMediaKeyNeededEvent: { - prototype: MSMediaKeyNeededEvent; - new(): MSMediaKeyNeededEvent; +interface TextTrackCueList { + length: number; + getCueById(id: string): TextTrackCue; + item(index: number): TextTrackCue; + [index: number]: TextTrackCue; } -interface LongRunningScriptDetectedEvent extends Event { - stopPageScriptExecution: boolean; - executionTime: number; -} -declare var LongRunningScriptDetectedEvent: { - prototype: LongRunningScriptDetectedEvent; - new(): LongRunningScriptDetectedEvent; +declare var TextTrackCueList: { + prototype: TextTrackCueList; + new(): TextTrackCueList; } -interface MSAppView { - viewId: number; - close(): void; - postMessage(message: any, targetOrigin: string, ports?: any): void; -} -declare var MSAppView: { - prototype: MSAppView; - new(): MSAppView; +interface TextTrackList extends EventTarget { + length: number; + onaddtrack: (ev: TrackEvent) => any; + item(index: number): TextTrack; + addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: TextTrack; } -interface PerfWidgetExternal { - maxCpuSpeed: number; - independentRenderingEnabled: boolean; - irDisablingContentString: string; - irStatusAvailable: boolean; - performanceCounter: number; - averagePaintTime: number; - activeNetworkRequestCount: number; - paintRequestsPerSecond: number; - extraInformationEnabled: boolean; - performanceCounterFrequency: number; - averageFrameTime: number; - repositionWindow(x: number, y: number): void; - getRecentMemoryUsage(last: number): any; - getMemoryUsage(): number; - resizeWindow(width: number, height: number): void; - getProcessCpuUsage(): number; - removeEventListener(eventType: string, callback: (ev: any) => any): void; - getRecentCpuUsage(last: number): any; - addEventListener(eventType: string, callback: (ev: any) => any): void; - getRecentFrames(last: number): any; - getRecentPaintRequests(last: number): any; -} -declare var PerfWidgetExternal: { - prototype: PerfWidgetExternal; - new(): PerfWidgetExternal; +declare var TextTrackList: { + prototype: TextTrackList; + new(): TextTrackList; } -interface PageTransitionEvent extends Event { - persisted: boolean; -} -declare var PageTransitionEvent: { - prototype: PageTransitionEvent; - new(): PageTransitionEvent; +interface TimeRanges { + length: number; + end(index: number): number; + start(index: number): number; } -interface MutationCallback { - (mutations: MutationRecord[], observer: MutationObserver): void; +declare var TimeRanges: { + prototype: TimeRanges; + new(): TimeRanges; } -interface HTMLDocument extends Document { -} -declare var HTMLDocument: { - prototype: HTMLDocument; - new(): HTMLDocument; +interface Touch { + clientX: number; + clientY: number; + identifier: number; + pageX: number; + pageY: number; + screenX: number; + screenY: number; + target: EventTarget; } -interface KeyPair { - privateKey: Key; - publicKey: Key; -} -declare var KeyPair: { - prototype: KeyPair; - new(): KeyPair; +declare var Touch: { + prototype: Touch; + new(): Touch; } -interface MSMediaKeySession extends EventTarget { - sessionId: string; - error: MSMediaKeyError; - keySystem: string; - close(): void; - update(key: Uint8Array): void; -} -declare var MSMediaKeySession: { - prototype: MSMediaKeySession; - new(): MSMediaKeySession; +interface TouchEvent extends UIEvent { + altKey: boolean; + changedTouches: TouchList; + ctrlKey: boolean; + metaKey: boolean; + shiftKey: boolean; + targetTouches: TouchList; + touches: TouchList; } -interface UnviewableContentIdentifiedEvent extends NavigationEvent { - referrer: string; +declare var TouchEvent: { + prototype: TouchEvent; + new(): TouchEvent; } + +interface TouchList { + length: number; + item(index: number): Touch; + [index: number]: Touch; +} + +declare var TouchList: { + prototype: TouchList; + new(): TouchList; +} + +interface TrackEvent extends Event { + track: any; +} + +declare var TrackEvent: { + prototype: TrackEvent; + new(): TrackEvent; +} + +interface TransitionEvent extends Event { + elapsedTime: number; + propertyName: string; + initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void; +} + +declare var TransitionEvent: { + prototype: TransitionEvent; + new(): TransitionEvent; +} + +interface TreeWalker { + currentNode: Node; + expandEntityReferences: boolean; + filter: NodeFilter; + root: Node; + whatToShow: number; + firstChild(): Node; + lastChild(): Node; + nextNode(): Node; + nextSibling(): Node; + parentNode(): Node; + previousNode(): Node; + previousSibling(): Node; +} + +declare var TreeWalker: { + prototype: TreeWalker; + new(): TreeWalker; +} + +interface UIEvent extends Event { + detail: number; + view: Window; + initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void; +} + +declare var UIEvent: { + prototype: UIEvent; + new(type: string, eventInitDict?: UIEventInit): UIEvent; +} + +interface URL { + createObjectURL(object: any, options?: ObjectURLOptions): string; + revokeObjectURL(url: string): void; +} +declare var URL: URL; + +interface UnviewableContentIdentifiedEvent extends NavigationEventWithReferrer { + mediaType: string; +} + declare var UnviewableContentIdentifiedEvent: { prototype: UnviewableContentIdentifiedEvent; new(): UnviewableContentIdentifiedEvent; } -interface CryptoOperation extends EventTarget { - algorithm: Algorithm; - oncomplete: (ev: Event) => any; - onerror: (ev: ErrorEvent) => any; - onprogress: (ev: ProgressEvent) => any; - onabort: (ev: UIEvent) => any; - key: Key; - result: any; - abort(): void; - finish(): void; - process(buffer: ArrayBufferView): void; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var CryptoOperation: { - prototype: CryptoOperation; - new(): CryptoOperation; +interface ValidityState { + badInput: boolean; + customError: boolean; + patternMismatch: boolean; + rangeOverflow: boolean; + rangeUnderflow: boolean; + stepMismatch: boolean; + tooLong: boolean; + typeMismatch: boolean; + valid: boolean; + valueMissing: boolean; } -interface WebGLTexture extends WebGLObject { -} -declare var WebGLTexture: { - prototype: WebGLTexture; - new(): WebGLTexture; +declare var ValidityState: { + prototype: ValidityState; + new(): ValidityState; } -interface OES_texture_float { -} -declare var OES_texture_float: { - prototype: OES_texture_float; - new(): OES_texture_float; +interface VideoPlaybackQuality { + corruptedVideoFrames: number; + creationTime: number; + droppedVideoFrames: number; + totalFrameDelay: number; + totalVideoFrames: number; } -interface WebGLContextEvent extends Event { - statusMessage: string; -} -declare var WebGLContextEvent: { - prototype: WebGLContextEvent; - new(): WebGLContextEvent; +declare var VideoPlaybackQuality: { + prototype: VideoPlaybackQuality; + new(): VideoPlaybackQuality; } -interface WebGLRenderbuffer extends WebGLObject { -} -declare var WebGLRenderbuffer: { - prototype: WebGLRenderbuffer; - new(): WebGLRenderbuffer; +interface VideoTrack { + id: string; + kind: string; + label: string; + language: string; + selected: boolean; + sourceBuffer: SourceBuffer; } -interface WebGLUniformLocation { +declare var VideoTrack: { + prototype: VideoTrack; + new(): VideoTrack; } -declare var WebGLUniformLocation: { - prototype: WebGLUniformLocation; - new(): WebGLUniformLocation; + +interface VideoTrackList extends EventTarget { + length: number; + onaddtrack: (ev: TrackEvent) => any; + onchange: (ev: Event) => any; + onremovetrack: (ev: TrackEvent) => any; + selectedIndex: number; + getTrackById(id: string): VideoTrack; + item(index: number): VideoTrack; + addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "removetrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: VideoTrack; +} + +declare var VideoTrackList: { + prototype: VideoTrackList; + new(): VideoTrackList; +} + +interface WEBGL_compressed_texture_s3tc { + COMPRESSED_RGBA_S3TC_DXT1_EXT: number; + COMPRESSED_RGBA_S3TC_DXT3_EXT: number; + COMPRESSED_RGBA_S3TC_DXT5_EXT: number; + COMPRESSED_RGB_S3TC_DXT1_EXT: number; +} + +declare var WEBGL_compressed_texture_s3tc: { + prototype: WEBGL_compressed_texture_s3tc; + new(): WEBGL_compressed_texture_s3tc; + COMPRESSED_RGBA_S3TC_DXT1_EXT: number; + COMPRESSED_RGBA_S3TC_DXT3_EXT: number; + COMPRESSED_RGBA_S3TC_DXT5_EXT: number; + COMPRESSED_RGB_S3TC_DXT1_EXT: number; +} + +interface WEBGL_debug_renderer_info { + UNMASKED_RENDERER_WEBGL: number; + UNMASKED_VENDOR_WEBGL: number; +} + +declare var WEBGL_debug_renderer_info: { + prototype: WEBGL_debug_renderer_info; + new(): WEBGL_debug_renderer_info; + UNMASKED_RENDERER_WEBGL: number; + UNMASKED_VENDOR_WEBGL: number; +} + +interface WEBGL_depth_texture { + UNSIGNED_INT_24_8_WEBGL: number; +} + +declare var WEBGL_depth_texture: { + prototype: WEBGL_depth_texture; + new(): WEBGL_depth_texture; + UNSIGNED_INT_24_8_WEBGL: number; +} + +interface WaveShaperNode extends AudioNode { + curve: any; + oversample: string; +} + +declare var WaveShaperNode: { + prototype: WaveShaperNode; + new(): WaveShaperNode; } interface WebGLActiveInfo { name: string; - type: number; size: number; + type: number; } + declare var WebGLActiveInfo: { prototype: WebGLActiveInfo; new(): WebGLActiveInfo; } -interface WEBGL_compressed_texture_s3tc { - COMPRESSED_RGBA_S3TC_DXT1_EXT: number; - COMPRESSED_RGBA_S3TC_DXT5_EXT: number; - COMPRESSED_RGBA_S3TC_DXT3_EXT: number; - COMPRESSED_RGB_S3TC_DXT1_EXT: number; -} -declare var WEBGL_compressed_texture_s3tc: { - prototype: WEBGL_compressed_texture_s3tc; - new(): WEBGL_compressed_texture_s3tc; - COMPRESSED_RGBA_S3TC_DXT1_EXT: number; - COMPRESSED_RGBA_S3TC_DXT5_EXT: number; - COMPRESSED_RGBA_S3TC_DXT3_EXT: number; - COMPRESSED_RGB_S3TC_DXT1_EXT: number; -} - -interface WebGLRenderingContext { - drawingBufferWidth: number; - drawingBufferHeight: number; - canvas: HTMLCanvasElement; - getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation; - bindTexture(target: number, texture: WebGLTexture): void; - bufferData(target: number, data: ArrayBufferView, usage: number): void; - bufferData(target: number, data: ArrayBuffer, usage: number): void; - bufferData(target: number, size: number, usage: number): void; - depthMask(flag: boolean): void; - getUniform(program: WebGLProgram, location: WebGLUniformLocation): any; - vertexAttrib3fv(indx: number, values: number[]): void; - vertexAttrib3fv(indx: number, values: Float32Array): void; - linkProgram(program: WebGLProgram): void; - getSupportedExtensions(): string[]; - bufferSubData(target: number, offset: number, data: ArrayBuffer): void; - bufferSubData(target: number, offset: number, data: ArrayBufferView): void; - vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void; - polygonOffset(factor: number, units: number): void; - blendColor(red: number, green: number, blue: number, alpha: number): void; - createTexture(): WebGLTexture; - hint(target: number, mode: number): void; - getVertexAttrib(index: number, pname: number): any; - enableVertexAttribArray(index: number): void; - depthRange(zNear: number, zFar: number): void; - cullFace(mode: number): void; - createFramebuffer(): WebGLFramebuffer; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; - framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture, level: number): void; - deleteFramebuffer(framebuffer: WebGLFramebuffer): void; - colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; - compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; - getExtension(name: string): any; - createProgram(): WebGLProgram; - deleteShader(shader: WebGLShader): void; - getAttachedShaders(program: WebGLProgram): WebGLShader[]; - enable(cap: number): void; - blendEquation(mode: number): void; - texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels: ArrayBufferView): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, image: HTMLImageElement): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, canvas: HTMLCanvasElement): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, video: HTMLVideoElement): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageData): void; - createBuffer(): WebGLBuffer; - deleteTexture(texture: WebGLTexture): void; - useProgram(program: WebGLProgram): void; - vertexAttrib2fv(indx: number, values: number[]): void; - vertexAttrib2fv(indx: number, values: Float32Array): void; - checkFramebufferStatus(target: number): number; - frontFace(mode: number): void; - getBufferParameter(target: number, pname: number): any; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, image: HTMLImageElement): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, canvas: HTMLCanvasElement): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, video: HTMLVideoElement): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void; - copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; - getVertexAttribOffset(index: number, pname: number): number; - disableVertexAttribArray(index: number): void; - blendFunc(sfactor: number, dfactor: number): void; - drawElements(mode: number, count: number, type: number, offset: number): void; - isFramebuffer(framebuffer: WebGLFramebuffer): boolean; - uniform3iv(location: WebGLUniformLocation, v: number[]): void; - uniform3iv(location: WebGLUniformLocation, v: Int32Array): void; - lineWidth(width: number): void; - getShaderInfoLog(shader: WebGLShader): string; - getTexParameter(target: number, pname: number): any; - getParameter(pname: number): any; - getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat; - getContextAttributes(): WebGLContextAttributes; - vertexAttrib1f(indx: number, x: number): void; - bindFramebuffer(target: number, framebuffer: WebGLFramebuffer): void; - compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; - isContextLost(): boolean; - uniform1iv(location: WebGLUniformLocation, v: number[]): void; - uniform1iv(location: WebGLUniformLocation, v: Int32Array): void; - getRenderbufferParameter(target: number, pname: number): any; - uniform2fv(location: WebGLUniformLocation, v: number[]): void; - uniform2fv(location: WebGLUniformLocation, v: Float32Array): void; - isTexture(texture: WebGLTexture): boolean; - getError(): number; - shaderSource(shader: WebGLShader, source: string): void; - deleteRenderbuffer(renderbuffer: WebGLRenderbuffer): void; - stencilMask(mask: number): void; - bindBuffer(target: number, buffer: WebGLBuffer): void; - getAttribLocation(program: WebGLProgram, name: string): number; - uniform3i(location: WebGLUniformLocation, x: number, y: number, z: number): void; - blendEquationSeparate(modeRGB: number, modeAlpha: number): void; - clear(mask: number): void; - blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; - stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void; - readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; - scissor(x: number, y: number, width: number, height: number): void; - uniform2i(location: WebGLUniformLocation, x: number, y: number): void; - getActiveAttrib(program: WebGLProgram, index: number): WebGLActiveInfo; - getShaderSource(shader: WebGLShader): string; - generateMipmap(target: number): void; - bindAttribLocation(program: WebGLProgram, index: number, name: string): void; - uniform1fv(location: WebGLUniformLocation, v: number[]): void; - uniform1fv(location: WebGLUniformLocation, v: Float32Array): void; - uniform2iv(location: WebGLUniformLocation, v: number[]): void; - uniform2iv(location: WebGLUniformLocation, v: Int32Array): void; - stencilOp(fail: number, zfail: number, zpass: number): void; - uniform4fv(location: WebGLUniformLocation, v: number[]): void; - uniform4fv(location: WebGLUniformLocation, v: Float32Array): void; - vertexAttrib1fv(indx: number, values: number[]): void; - vertexAttrib1fv(indx: number, values: Float32Array): void; - flush(): void; - uniform4f(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; - deleteProgram(program: WebGLProgram): void; - isRenderbuffer(renderbuffer: WebGLRenderbuffer): boolean; - uniform1i(location: WebGLUniformLocation, x: number): void; - getProgramParameter(program: WebGLProgram, pname: number): any; - getActiveUniform(program: WebGLProgram, index: number): WebGLActiveInfo; - stencilFunc(func: number, ref: number, mask: number): void; - pixelStorei(pname: number, param: number): void; - disable(cap: number): void; - vertexAttrib4fv(indx: number, values: number[]): void; - vertexAttrib4fv(indx: number, values: Float32Array): void; - createRenderbuffer(): WebGLRenderbuffer; - isBuffer(buffer: WebGLBuffer): boolean; - stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; - getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any; - uniform4i(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; - sampleCoverage(value: number, invert: boolean): void; - depthFunc(func: number): void; - texParameterf(target: number, pname: number, param: number): void; - vertexAttrib3f(indx: number, x: number, y: number, z: number): void; - drawArrays(mode: number, first: number, count: number): void; - texParameteri(target: number, pname: number, param: number): void; - vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void; - getShaderParameter(shader: WebGLShader, pname: number): any; - clearDepth(depth: number): void; - activeTexture(texture: number): void; - viewport(x: number, y: number, width: number, height: number): void; - detachShader(program: WebGLProgram, shader: WebGLShader): void; - uniform1f(location: WebGLUniformLocation, x: number): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; - deleteBuffer(buffer: WebGLBuffer): void; - copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; - uniform3fv(location: WebGLUniformLocation, v: number[]): void; - uniform3fv(location: WebGLUniformLocation, v: Float32Array): void; - stencilMaskSeparate(face: number, mask: number): void; - attachShader(program: WebGLProgram, shader: WebGLShader): void; - compileShader(shader: WebGLShader): void; - clearColor(red: number, green: number, blue: number, alpha: number): void; - isShader(shader: WebGLShader): boolean; - clearStencil(s: number): void; - framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer): void; - finish(): void; - uniform2f(location: WebGLUniformLocation, x: number, y: number): void; - renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; - uniform3f(location: WebGLUniformLocation, x: number, y: number, z: number): void; - getProgramInfoLog(program: WebGLProgram): string; - validateProgram(program: WebGLProgram): void; - isEnabled(cap: number): boolean; - vertexAttrib2f(indx: number, x: number, y: number): void; - isProgram(program: WebGLProgram): boolean; - createShader(type: number): WebGLShader; - bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer): void; - uniform4iv(location: WebGLUniformLocation, v: number[]): void; - uniform4iv(location: WebGLUniformLocation, v: Int32Array): void; - DEPTH_FUNC: number; - DEPTH_COMPONENT16: number; - REPLACE: number; - REPEAT: number; - VERTEX_ATTRIB_ARRAY_ENABLED: number; - FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - STENCIL_BUFFER_BIT: number; - RENDERER: number; - STENCIL_BACK_REF: number; - TEXTURE26: number; - RGB565: number; - DITHER: number; - CONSTANT_COLOR: number; - GENERATE_MIPMAP_HINT: number; - POINTS: number; - DECR: number; - INT_VEC3: number; - TEXTURE28: number; - ONE_MINUS_CONSTANT_ALPHA: number; - BACK: number; - RENDERBUFFER_STENCIL_SIZE: number; - UNPACK_FLIP_Y_WEBGL: number; - BLEND: number; - TEXTURE9: number; - ARRAY_BUFFER_BINDING: number; - MAX_VIEWPORT_DIMS: number; - INVALID_FRAMEBUFFER_OPERATION: number; - TEXTURE: number; - TEXTURE0: number; - TEXTURE31: number; - TEXTURE24: number; - HIGH_INT: number; - RENDERBUFFER_BINDING: number; - BLEND_COLOR: number; - FASTEST: number; - STENCIL_WRITEMASK: number; - ALIASED_POINT_SIZE_RANGE: number; - TEXTURE12: number; - DST_ALPHA: number; - BLEND_EQUATION_RGB: number; - FRAMEBUFFER_COMPLETE: number; - NEAREST_MIPMAP_NEAREST: number; - VERTEX_ATTRIB_ARRAY_SIZE: number; - TEXTURE3: number; - DEPTH_WRITEMASK: number; - CONTEXT_LOST_WEBGL: number; - INVALID_VALUE: number; - TEXTURE_MAG_FILTER: number; - ONE_MINUS_CONSTANT_COLOR: number; - ONE_MINUS_SRC_ALPHA: number; - TEXTURE_CUBE_MAP_POSITIVE_Z: number; - NOTEQUAL: number; - ALPHA: number; - DEPTH_STENCIL: number; - MAX_VERTEX_UNIFORM_VECTORS: number; - DEPTH_COMPONENT: number; - RENDERBUFFER_RED_SIZE: number; - TEXTURE20: number; - RED_BITS: number; - RENDERBUFFER_BLUE_SIZE: number; - SCISSOR_BOX: number; - VENDOR: number; - FRONT_AND_BACK: number; - CONSTANT_ALPHA: number; - VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - NEAREST: number; - CULL_FACE: number; - ALIASED_LINE_WIDTH_RANGE: number; - TEXTURE19: number; - FRONT: number; - DEPTH_CLEAR_VALUE: number; - GREEN_BITS: number; - TEXTURE29: number; - TEXTURE23: number; - MAX_RENDERBUFFER_SIZE: number; - STENCIL_ATTACHMENT: number; - TEXTURE27: number; - BOOL_VEC2: number; - OUT_OF_MEMORY: number; - MIRRORED_REPEAT: number; - POLYGON_OFFSET_UNITS: number; - TEXTURE_MIN_FILTER: number; - STENCIL_BACK_PASS_DEPTH_PASS: number; - LINE_LOOP: number; - FLOAT_MAT3: number; - TEXTURE14: number; - LINEAR: number; - RGB5_A1: number; - ONE_MINUS_SRC_COLOR: number; - SAMPLE_COVERAGE_INVERT: number; - DONT_CARE: number; - FRAMEBUFFER_BINDING: number; - RENDERBUFFER_ALPHA_SIZE: number; - STENCIL_REF: number; - ZERO: number; - DECR_WRAP: number; - SAMPLE_COVERAGE: number; - STENCIL_BACK_FUNC: number; - TEXTURE30: number; - VIEWPORT: number; - STENCIL_BITS: number; - FLOAT: number; - COLOR_WRITEMASK: number; - SAMPLE_COVERAGE_VALUE: number; - TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - STENCIL_BACK_FAIL: number; - FLOAT_MAT4: number; - UNSIGNED_SHORT_4_4_4_4: number; - TEXTURE6: number; - RENDERBUFFER_WIDTH: number; - RGBA4: number; - ALWAYS: number; - BLEND_EQUATION_ALPHA: number; - COLOR_BUFFER_BIT: number; - TEXTURE_CUBE_MAP: number; - DEPTH_BUFFER_BIT: number; - STENCIL_CLEAR_VALUE: number; - BLEND_EQUATION: number; - RENDERBUFFER_GREEN_SIZE: number; - NEAREST_MIPMAP_LINEAR: number; - VERTEX_ATTRIB_ARRAY_TYPE: number; - INCR_WRAP: number; - ONE_MINUS_DST_COLOR: number; - HIGH_FLOAT: number; - BYTE: number; - FRONT_FACE: number; - SAMPLE_ALPHA_TO_COVERAGE: number; - CCW: number; - TEXTURE13: number; - MAX_VERTEX_ATTRIBS: number; - MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_WRAP_T: number; - UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - FLOAT_VEC2: number; - LUMINANCE: number; - GREATER: number; - INT_VEC2: number; - VALIDATE_STATUS: number; - FRAMEBUFFER: number; - FRAMEBUFFER_UNSUPPORTED: number; - TEXTURE5: number; - FUNC_SUBTRACT: number; - BLEND_DST_ALPHA: number; - SAMPLER_CUBE: number; - ONE_MINUS_DST_ALPHA: number; - LESS: number; - TEXTURE_CUBE_MAP_POSITIVE_X: number; - BLUE_BITS: number; - DEPTH_TEST: number; - VERTEX_ATTRIB_ARRAY_STRIDE: number; - DELETE_STATUS: number; - TEXTURE18: number; - POLYGON_OFFSET_FACTOR: number; - UNSIGNED_INT: number; - TEXTURE_2D: number; - DST_COLOR: number; - FLOAT_MAT2: number; - COMPRESSED_TEXTURE_FORMATS: number; - MAX_FRAGMENT_UNIFORM_VECTORS: number; - DEPTH_STENCIL_ATTACHMENT: number; - LUMINANCE_ALPHA: number; - CW: number; - VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - LINEAR_MIPMAP_LINEAR: number; - BUFFER_SIZE: number; - SAMPLE_BUFFERS: number; - TEXTURE15: number; - ACTIVE_TEXTURE: number; - VERTEX_SHADER: number; - TEXTURE22: number; - VERTEX_ATTRIB_ARRAY_POINTER: number; - INCR: number; - COMPILE_STATUS: number; - MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - TEXTURE7: number; - UNSIGNED_SHORT_5_5_5_1: number; - DEPTH_BITS: number; - RGBA: number; - TRIANGLE_STRIP: number; - COLOR_CLEAR_VALUE: number; - BROWSER_DEFAULT_WEBGL: number; - INVALID_ENUM: number; - SCISSOR_TEST: number; - LINE_STRIP: number; - FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - STENCIL_FUNC: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - RENDERBUFFER_HEIGHT: number; - TEXTURE8: number; - TRIANGLES: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - STENCIL_BACK_VALUE_MASK: number; - TEXTURE25: number; - RENDERBUFFER: number; - LEQUAL: number; - TEXTURE1: number; - STENCIL_INDEX8: number; - FUNC_ADD: number; - STENCIL_FAIL: number; - BLEND_SRC_ALPHA: number; - BOOL: number; - ALPHA_BITS: number; - LOW_INT: number; - TEXTURE10: number; - SRC_COLOR: number; - MAX_VARYING_VECTORS: number; - BLEND_DST_RGB: number; - TEXTURE_BINDING_CUBE_MAP: number; - STENCIL_INDEX: number; - TEXTURE_BINDING_2D: number; - MEDIUM_INT: number; - SHADER_TYPE: number; - POLYGON_OFFSET_FILL: number; - DYNAMIC_DRAW: number; - TEXTURE4: number; - STENCIL_BACK_PASS_DEPTH_FAIL: number; - STREAM_DRAW: number; - MAX_CUBE_MAP_TEXTURE_SIZE: number; - TEXTURE17: number; - TRIANGLE_FAN: number; - UNPACK_ALIGNMENT: number; - CURRENT_PROGRAM: number; - LINES: number; - INVALID_OPERATION: number; - FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - LINEAR_MIPMAP_NEAREST: number; - CLAMP_TO_EDGE: number; - RENDERBUFFER_DEPTH_SIZE: number; - TEXTURE_WRAP_S: number; - ELEMENT_ARRAY_BUFFER: number; - UNSIGNED_SHORT_5_6_5: number; - ACTIVE_UNIFORMS: number; - FLOAT_VEC3: number; - NO_ERROR: number; - ATTACHED_SHADERS: number; - DEPTH_ATTACHMENT: number; - TEXTURE11: number; - STENCIL_TEST: number; - ONE: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - STATIC_DRAW: number; - GEQUAL: number; - BOOL_VEC4: number; - COLOR_ATTACHMENT0: number; - PACK_ALIGNMENT: number; - MAX_TEXTURE_SIZE: number; - STENCIL_PASS_DEPTH_FAIL: number; - CULL_FACE_MODE: number; - TEXTURE16: number; - STENCIL_BACK_WRITEMASK: number; - SRC_ALPHA: number; - UNSIGNED_SHORT: number; - TEXTURE21: number; - FUNC_REVERSE_SUBTRACT: number; - SHADING_LANGUAGE_VERSION: number; - EQUAL: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - BOOL_VEC3: number; - SAMPLER_2D: number; - TEXTURE_CUBE_MAP_NEGATIVE_X: number; - MAX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_CUBE_MAP_POSITIVE_Y: number; - RENDERBUFFER_INTERNAL_FORMAT: number; - STENCIL_VALUE_MASK: number; - ELEMENT_ARRAY_BUFFER_BINDING: number; - ARRAY_BUFFER: number; - DEPTH_RANGE: number; - NICEST: number; - ACTIVE_ATTRIBUTES: number; - NEVER: number; - FLOAT_VEC4: number; - CURRENT_VERTEX_ATTRIB: number; - STENCIL_PASS_DEPTH_PASS: number; - INVERT: number; - LINK_STATUS: number; - RGB: number; - INT_VEC4: number; - TEXTURE2: number; - UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - MEDIUM_FLOAT: number; - SRC_ALPHA_SATURATE: number; - BUFFER_USAGE: number; - SHORT: number; - NONE: number; - UNSIGNED_BYTE: number; - INT: number; - SUBPIXEL_BITS: number; - KEEP: number; - SAMPLES: number; - FRAGMENT_SHADER: number; - LINE_WIDTH: number; - BLEND_SRC_RGB: number; - LOW_FLOAT: number; - VERSION: number; -} -declare var WebGLRenderingContext: { - prototype: WebGLRenderingContext; - new(): WebGLRenderingContext; - DEPTH_FUNC: number; - DEPTH_COMPONENT16: number; - REPLACE: number; - REPEAT: number; - VERTEX_ATTRIB_ARRAY_ENABLED: number; - FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - STENCIL_BUFFER_BIT: number; - RENDERER: number; - STENCIL_BACK_REF: number; - TEXTURE26: number; - RGB565: number; - DITHER: number; - CONSTANT_COLOR: number; - GENERATE_MIPMAP_HINT: number; - POINTS: number; - DECR: number; - INT_VEC3: number; - TEXTURE28: number; - ONE_MINUS_CONSTANT_ALPHA: number; - BACK: number; - RENDERBUFFER_STENCIL_SIZE: number; - UNPACK_FLIP_Y_WEBGL: number; - BLEND: number; - TEXTURE9: number; - ARRAY_BUFFER_BINDING: number; - MAX_VIEWPORT_DIMS: number; - INVALID_FRAMEBUFFER_OPERATION: number; - TEXTURE: number; - TEXTURE0: number; - TEXTURE31: number; - TEXTURE24: number; - HIGH_INT: number; - RENDERBUFFER_BINDING: number; - BLEND_COLOR: number; - FASTEST: number; - STENCIL_WRITEMASK: number; - ALIASED_POINT_SIZE_RANGE: number; - TEXTURE12: number; - DST_ALPHA: number; - BLEND_EQUATION_RGB: number; - FRAMEBUFFER_COMPLETE: number; - NEAREST_MIPMAP_NEAREST: number; - VERTEX_ATTRIB_ARRAY_SIZE: number; - TEXTURE3: number; - DEPTH_WRITEMASK: number; - CONTEXT_LOST_WEBGL: number; - INVALID_VALUE: number; - TEXTURE_MAG_FILTER: number; - ONE_MINUS_CONSTANT_COLOR: number; - ONE_MINUS_SRC_ALPHA: number; - TEXTURE_CUBE_MAP_POSITIVE_Z: number; - NOTEQUAL: number; - ALPHA: number; - DEPTH_STENCIL: number; - MAX_VERTEX_UNIFORM_VECTORS: number; - DEPTH_COMPONENT: number; - RENDERBUFFER_RED_SIZE: number; - TEXTURE20: number; - RED_BITS: number; - RENDERBUFFER_BLUE_SIZE: number; - SCISSOR_BOX: number; - VENDOR: number; - FRONT_AND_BACK: number; - CONSTANT_ALPHA: number; - VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - NEAREST: number; - CULL_FACE: number; - ALIASED_LINE_WIDTH_RANGE: number; - TEXTURE19: number; - FRONT: number; - DEPTH_CLEAR_VALUE: number; - GREEN_BITS: number; - TEXTURE29: number; - TEXTURE23: number; - MAX_RENDERBUFFER_SIZE: number; - STENCIL_ATTACHMENT: number; - TEXTURE27: number; - BOOL_VEC2: number; - OUT_OF_MEMORY: number; - MIRRORED_REPEAT: number; - POLYGON_OFFSET_UNITS: number; - TEXTURE_MIN_FILTER: number; - STENCIL_BACK_PASS_DEPTH_PASS: number; - LINE_LOOP: number; - FLOAT_MAT3: number; - TEXTURE14: number; - LINEAR: number; - RGB5_A1: number; - ONE_MINUS_SRC_COLOR: number; - SAMPLE_COVERAGE_INVERT: number; - DONT_CARE: number; - FRAMEBUFFER_BINDING: number; - RENDERBUFFER_ALPHA_SIZE: number; - STENCIL_REF: number; - ZERO: number; - DECR_WRAP: number; - SAMPLE_COVERAGE: number; - STENCIL_BACK_FUNC: number; - TEXTURE30: number; - VIEWPORT: number; - STENCIL_BITS: number; - FLOAT: number; - COLOR_WRITEMASK: number; - SAMPLE_COVERAGE_VALUE: number; - TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - STENCIL_BACK_FAIL: number; - FLOAT_MAT4: number; - UNSIGNED_SHORT_4_4_4_4: number; - TEXTURE6: number; - RENDERBUFFER_WIDTH: number; - RGBA4: number; - ALWAYS: number; - BLEND_EQUATION_ALPHA: number; - COLOR_BUFFER_BIT: number; - TEXTURE_CUBE_MAP: number; - DEPTH_BUFFER_BIT: number; - STENCIL_CLEAR_VALUE: number; - BLEND_EQUATION: number; - RENDERBUFFER_GREEN_SIZE: number; - NEAREST_MIPMAP_LINEAR: number; - VERTEX_ATTRIB_ARRAY_TYPE: number; - INCR_WRAP: number; - ONE_MINUS_DST_COLOR: number; - HIGH_FLOAT: number; - BYTE: number; - FRONT_FACE: number; - SAMPLE_ALPHA_TO_COVERAGE: number; - CCW: number; - TEXTURE13: number; - MAX_VERTEX_ATTRIBS: number; - MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_WRAP_T: number; - UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - FLOAT_VEC2: number; - LUMINANCE: number; - GREATER: number; - INT_VEC2: number; - VALIDATE_STATUS: number; - FRAMEBUFFER: number; - FRAMEBUFFER_UNSUPPORTED: number; - TEXTURE5: number; - FUNC_SUBTRACT: number; - BLEND_DST_ALPHA: number; - SAMPLER_CUBE: number; - ONE_MINUS_DST_ALPHA: number; - LESS: number; - TEXTURE_CUBE_MAP_POSITIVE_X: number; - BLUE_BITS: number; - DEPTH_TEST: number; - VERTEX_ATTRIB_ARRAY_STRIDE: number; - DELETE_STATUS: number; - TEXTURE18: number; - POLYGON_OFFSET_FACTOR: number; - UNSIGNED_INT: number; - TEXTURE_2D: number; - DST_COLOR: number; - FLOAT_MAT2: number; - COMPRESSED_TEXTURE_FORMATS: number; - MAX_FRAGMENT_UNIFORM_VECTORS: number; - DEPTH_STENCIL_ATTACHMENT: number; - LUMINANCE_ALPHA: number; - CW: number; - VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - LINEAR_MIPMAP_LINEAR: number; - BUFFER_SIZE: number; - SAMPLE_BUFFERS: number; - TEXTURE15: number; - ACTIVE_TEXTURE: number; - VERTEX_SHADER: number; - TEXTURE22: number; - VERTEX_ATTRIB_ARRAY_POINTER: number; - INCR: number; - COMPILE_STATUS: number; - MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - TEXTURE7: number; - UNSIGNED_SHORT_5_5_5_1: number; - DEPTH_BITS: number; - RGBA: number; - TRIANGLE_STRIP: number; - COLOR_CLEAR_VALUE: number; - BROWSER_DEFAULT_WEBGL: number; - INVALID_ENUM: number; - SCISSOR_TEST: number; - LINE_STRIP: number; - FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - STENCIL_FUNC: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - RENDERBUFFER_HEIGHT: number; - TEXTURE8: number; - TRIANGLES: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - STENCIL_BACK_VALUE_MASK: number; - TEXTURE25: number; - RENDERBUFFER: number; - LEQUAL: number; - TEXTURE1: number; - STENCIL_INDEX8: number; - FUNC_ADD: number; - STENCIL_FAIL: number; - BLEND_SRC_ALPHA: number; - BOOL: number; - ALPHA_BITS: number; - LOW_INT: number; - TEXTURE10: number; - SRC_COLOR: number; - MAX_VARYING_VECTORS: number; - BLEND_DST_RGB: number; - TEXTURE_BINDING_CUBE_MAP: number; - STENCIL_INDEX: number; - TEXTURE_BINDING_2D: number; - MEDIUM_INT: number; - SHADER_TYPE: number; - POLYGON_OFFSET_FILL: number; - DYNAMIC_DRAW: number; - TEXTURE4: number; - STENCIL_BACK_PASS_DEPTH_FAIL: number; - STREAM_DRAW: number; - MAX_CUBE_MAP_TEXTURE_SIZE: number; - TEXTURE17: number; - TRIANGLE_FAN: number; - UNPACK_ALIGNMENT: number; - CURRENT_PROGRAM: number; - LINES: number; - INVALID_OPERATION: number; - FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - LINEAR_MIPMAP_NEAREST: number; - CLAMP_TO_EDGE: number; - RENDERBUFFER_DEPTH_SIZE: number; - TEXTURE_WRAP_S: number; - ELEMENT_ARRAY_BUFFER: number; - UNSIGNED_SHORT_5_6_5: number; - ACTIVE_UNIFORMS: number; - FLOAT_VEC3: number; - NO_ERROR: number; - ATTACHED_SHADERS: number; - DEPTH_ATTACHMENT: number; - TEXTURE11: number; - STENCIL_TEST: number; - ONE: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - STATIC_DRAW: number; - GEQUAL: number; - BOOL_VEC4: number; - COLOR_ATTACHMENT0: number; - PACK_ALIGNMENT: number; - MAX_TEXTURE_SIZE: number; - STENCIL_PASS_DEPTH_FAIL: number; - CULL_FACE_MODE: number; - TEXTURE16: number; - STENCIL_BACK_WRITEMASK: number; - SRC_ALPHA: number; - UNSIGNED_SHORT: number; - TEXTURE21: number; - FUNC_REVERSE_SUBTRACT: number; - SHADING_LANGUAGE_VERSION: number; - EQUAL: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - BOOL_VEC3: number; - SAMPLER_2D: number; - TEXTURE_CUBE_MAP_NEGATIVE_X: number; - MAX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_CUBE_MAP_POSITIVE_Y: number; - RENDERBUFFER_INTERNAL_FORMAT: number; - STENCIL_VALUE_MASK: number; - ELEMENT_ARRAY_BUFFER_BINDING: number; - ARRAY_BUFFER: number; - DEPTH_RANGE: number; - NICEST: number; - ACTIVE_ATTRIBUTES: number; - NEVER: number; - FLOAT_VEC4: number; - CURRENT_VERTEX_ATTRIB: number; - STENCIL_PASS_DEPTH_PASS: number; - INVERT: number; - LINK_STATUS: number; - RGB: number; - INT_VEC4: number; - TEXTURE2: number; - UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - MEDIUM_FLOAT: number; - SRC_ALPHA_SATURATE: number; - BUFFER_USAGE: number; - SHORT: number; - NONE: number; - UNSIGNED_BYTE: number; - INT: number; - SUBPIXEL_BITS: number; - KEEP: number; - SAMPLES: number; - FRAGMENT_SHADER: number; - LINE_WIDTH: number; - BLEND_SRC_RGB: number; - LOW_FLOAT: number; - VERSION: number; -} - -interface WebGLProgram extends WebGLObject { -} -declare var WebGLProgram: { - prototype: WebGLProgram; - new(): WebGLProgram; -} - -interface OES_standard_derivatives { - FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; -} -declare var OES_standard_derivatives: { - prototype: OES_standard_derivatives; - new(): OES_standard_derivatives; - FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; -} - -interface WebGLFramebuffer extends WebGLObject { -} -declare var WebGLFramebuffer: { - prototype: WebGLFramebuffer; - new(): WebGLFramebuffer; -} - -interface WebGLShader extends WebGLObject { -} -declare var WebGLShader: { - prototype: WebGLShader; - new(): WebGLShader; -} - -interface OES_texture_float_linear { -} -declare var OES_texture_float_linear: { - prototype: OES_texture_float_linear; - new(): OES_texture_float_linear; -} - -interface WebGLObject { -} -declare var WebGLObject: { - prototype: WebGLObject; - new(): WebGLObject; -} - interface WebGLBuffer extends WebGLObject { } + declare var WebGLBuffer: { prototype: WebGLBuffer; new(): WebGLBuffer; } -interface WebGLShaderPrecisionFormat { - rangeMin: number; - rangeMax: number; - precision: number; +interface WebGLContextEvent extends Event { + statusMessage: string; } + +declare var WebGLContextEvent: { + prototype: WebGLContextEvent; + new(): WebGLContextEvent; +} + +interface WebGLFramebuffer extends WebGLObject { +} + +declare var WebGLFramebuffer: { + prototype: WebGLFramebuffer; + new(): WebGLFramebuffer; +} + +interface WebGLObject { +} + +declare var WebGLObject: { + prototype: WebGLObject; + new(): WebGLObject; +} + +interface WebGLProgram extends WebGLObject { +} + +declare var WebGLProgram: { + prototype: WebGLProgram; + new(): WebGLProgram; +} + +interface WebGLRenderbuffer extends WebGLObject { +} + +declare var WebGLRenderbuffer: { + prototype: WebGLRenderbuffer; + new(): WebGLRenderbuffer; +} + +interface WebGLRenderingContext { + canvas: HTMLCanvasElement; + drawingBufferHeight: number; + drawingBufferWidth: number; + activeTexture(texture: number): void; + attachShader(program: WebGLProgram, shader: WebGLShader): void; + bindAttribLocation(program: WebGLProgram, index: number, name: string): void; + bindBuffer(target: number, buffer: WebGLBuffer): void; + bindFramebuffer(target: number, framebuffer: WebGLFramebuffer): void; + bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer): void; + bindTexture(target: number, texture: WebGLTexture): void; + blendColor(red: number, green: number, blue: number, alpha: number): void; + blendEquation(mode: number): void; + blendEquationSeparate(modeRGB: number, modeAlpha: number): void; + blendFunc(sfactor: number, dfactor: number): void; + blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; + bufferData(target: number, size: number, usage: number): void; + bufferData(target: number, size: ArrayBufferView, usage: number): void; + bufferData(target: number, size: any, usage: number): void; + bufferSubData(target: number, offset: number, data: ArrayBufferView): void; + bufferSubData(target: number, offset: number, data: any): void; + checkFramebufferStatus(target: number): number; + clear(mask: number): void; + clearColor(red: number, green: number, blue: number, alpha: number): void; + clearDepth(depth: number): void; + clearStencil(s: number): void; + colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; + compileShader(shader: WebGLShader): void; + compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; + compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; + copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; + copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; + createBuffer(): WebGLBuffer; + createFramebuffer(): WebGLFramebuffer; + createProgram(): WebGLProgram; + createRenderbuffer(): WebGLRenderbuffer; + createShader(type: number): WebGLShader; + createTexture(): WebGLTexture; + cullFace(mode: number): void; + deleteBuffer(buffer: WebGLBuffer): void; + deleteFramebuffer(framebuffer: WebGLFramebuffer): void; + deleteProgram(program: WebGLProgram): void; + deleteRenderbuffer(renderbuffer: WebGLRenderbuffer): void; + deleteShader(shader: WebGLShader): void; + deleteTexture(texture: WebGLTexture): void; + depthFunc(func: number): void; + depthMask(flag: boolean): void; + depthRange(zNear: number, zFar: number): void; + detachShader(program: WebGLProgram, shader: WebGLShader): void; + disable(cap: number): void; + disableVertexAttribArray(index: number): void; + drawArrays(mode: number, first: number, count: number): void; + drawElements(mode: number, count: number, type: number, offset: number): void; + enable(cap: number): void; + enableVertexAttribArray(index: number): void; + finish(): void; + flush(): void; + framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer): void; + framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture, level: number): void; + frontFace(mode: number): void; + generateMipmap(target: number): void; + getActiveAttrib(program: WebGLProgram, index: number): WebGLActiveInfo; + getActiveUniform(program: WebGLProgram, index: number): WebGLActiveInfo; + getAttachedShaders(program: WebGLProgram): WebGLShader[]; + getAttribLocation(program: WebGLProgram, name: string): number; + getBufferParameter(target: number, pname: number): any; + getContextAttributes(): WebGLContextAttributes; + getError(): number; + getExtension(name: string): any; + getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any; + getParameter(pname: number): any; + getProgramInfoLog(program: WebGLProgram): string; + getProgramParameter(program: WebGLProgram, pname: number): any; + getRenderbufferParameter(target: number, pname: number): any; + getShaderInfoLog(shader: WebGLShader): string; + getShaderParameter(shader: WebGLShader, pname: number): any; + getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat; + getShaderSource(shader: WebGLShader): string; + getSupportedExtensions(): string[]; + getTexParameter(target: number, pname: number): any; + getUniform(program: WebGLProgram, location: WebGLUniformLocation): any; + getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation; + getVertexAttrib(index: number, pname: number): any; + getVertexAttribOffset(index: number, pname: number): number; + hint(target: number, mode: number): void; + isBuffer(buffer: WebGLBuffer): boolean; + isContextLost(): boolean; + isEnabled(cap: number): boolean; + isFramebuffer(framebuffer: WebGLFramebuffer): boolean; + isProgram(program: WebGLProgram): boolean; + isRenderbuffer(renderbuffer: WebGLRenderbuffer): boolean; + isShader(shader: WebGLShader): boolean; + isTexture(texture: WebGLTexture): boolean; + lineWidth(width: number): void; + linkProgram(program: WebGLProgram): void; + pixelStorei(pname: number, param: number): void; + polygonOffset(factor: number, units: number): void; + readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; + renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; + sampleCoverage(value: number, invert: boolean): void; + scissor(x: number, y: number, width: number, height: number): void; + shaderSource(shader: WebGLShader, source: string): void; + stencilFunc(func: number, ref: number, mask: number): void; + stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void; + stencilMask(mask: number): void; + stencilMaskSeparate(face: number, mask: number): void; + stencilOp(fail: number, zfail: number, zpass: number): void; + stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageData): void; + texParameterf(target: number, pname: number, param: number): void; + texParameteri(target: number, pname: number, param: number): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void; + uniform1f(location: WebGLUniformLocation, x: number): void; + uniform1fv(location: WebGLUniformLocation, v: any): void; + uniform1i(location: WebGLUniformLocation, x: number): void; + uniform1iv(location: WebGLUniformLocation, v: Int32Array): void; + uniform2f(location: WebGLUniformLocation, x: number, y: number): void; + uniform2fv(location: WebGLUniformLocation, v: any): void; + uniform2i(location: WebGLUniformLocation, x: number, y: number): void; + uniform2iv(location: WebGLUniformLocation, v: Int32Array): void; + uniform3f(location: WebGLUniformLocation, x: number, y: number, z: number): void; + uniform3fv(location: WebGLUniformLocation, v: any): void; + uniform3i(location: WebGLUniformLocation, x: number, y: number, z: number): void; + uniform3iv(location: WebGLUniformLocation, v: Int32Array): void; + uniform4f(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; + uniform4fv(location: WebGLUniformLocation, v: any): void; + uniform4i(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; + uniform4iv(location: WebGLUniformLocation, v: Int32Array): void; + uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: any): void; + uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: any): void; + uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: any): void; + useProgram(program: WebGLProgram): void; + validateProgram(program: WebGLProgram): void; + vertexAttrib1f(indx: number, x: number): void; + vertexAttrib1fv(indx: number, values: any): void; + vertexAttrib2f(indx: number, x: number, y: number): void; + vertexAttrib2fv(indx: number, values: any): void; + vertexAttrib3f(indx: number, x: number, y: number, z: number): void; + vertexAttrib3fv(indx: number, values: any): void; + vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void; + vertexAttrib4fv(indx: number, values: any): void; + vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void; + viewport(x: number, y: number, width: number, height: number): void; + ACTIVE_ATTRIBUTES: number; + ACTIVE_TEXTURE: number; + ACTIVE_UNIFORMS: number; + ALIASED_LINE_WIDTH_RANGE: number; + ALIASED_POINT_SIZE_RANGE: number; + ALPHA: number; + ALPHA_BITS: number; + ALWAYS: number; + ARRAY_BUFFER: number; + ARRAY_BUFFER_BINDING: number; + ATTACHED_SHADERS: number; + BACK: number; + BLEND: number; + BLEND_COLOR: number; + BLEND_DST_ALPHA: number; + BLEND_DST_RGB: number; + BLEND_EQUATION: number; + BLEND_EQUATION_ALPHA: number; + BLEND_EQUATION_RGB: number; + BLEND_SRC_ALPHA: number; + BLEND_SRC_RGB: number; + BLUE_BITS: number; + BOOL: number; + BOOL_VEC2: number; + BOOL_VEC3: number; + BOOL_VEC4: number; + BROWSER_DEFAULT_WEBGL: number; + BUFFER_SIZE: number; + BUFFER_USAGE: number; + BYTE: number; + CCW: number; + CLAMP_TO_EDGE: number; + COLOR_ATTACHMENT0: number; + COLOR_BUFFER_BIT: number; + COLOR_CLEAR_VALUE: number; + COLOR_WRITEMASK: number; + COMPILE_STATUS: number; + COMPRESSED_TEXTURE_FORMATS: number; + CONSTANT_ALPHA: number; + CONSTANT_COLOR: number; + CONTEXT_LOST_WEBGL: number; + CULL_FACE: number; + CULL_FACE_MODE: number; + CURRENT_PROGRAM: number; + CURRENT_VERTEX_ATTRIB: number; + CW: number; + DECR: number; + DECR_WRAP: number; + DELETE_STATUS: number; + DEPTH_ATTACHMENT: number; + DEPTH_BITS: number; + DEPTH_BUFFER_BIT: number; + DEPTH_CLEAR_VALUE: number; + DEPTH_COMPONENT: number; + DEPTH_COMPONENT16: number; + DEPTH_FUNC: number; + DEPTH_RANGE: number; + DEPTH_STENCIL: number; + DEPTH_STENCIL_ATTACHMENT: number; + DEPTH_TEST: number; + DEPTH_WRITEMASK: number; + DITHER: number; + DONT_CARE: number; + DST_ALPHA: number; + DST_COLOR: number; + DYNAMIC_DRAW: number; + ELEMENT_ARRAY_BUFFER: number; + ELEMENT_ARRAY_BUFFER_BINDING: number; + EQUAL: number; + FASTEST: number; + FLOAT: number; + FLOAT_MAT2: number; + FLOAT_MAT3: number; + FLOAT_MAT4: number; + FLOAT_VEC2: number; + FLOAT_VEC3: number; + FLOAT_VEC4: number; + FRAGMENT_SHADER: number; + FRAMEBUFFER: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; + FRAMEBUFFER_BINDING: number; + FRAMEBUFFER_COMPLETE: number; + FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; + FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; + FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; + FRAMEBUFFER_UNSUPPORTED: number; + FRONT: number; + FRONT_AND_BACK: number; + FRONT_FACE: number; + FUNC_ADD: number; + FUNC_REVERSE_SUBTRACT: number; + FUNC_SUBTRACT: number; + GENERATE_MIPMAP_HINT: number; + GEQUAL: number; + GREATER: number; + GREEN_BITS: number; + HIGH_FLOAT: number; + HIGH_INT: number; + IMPLEMENTATION_COLOR_READ_FORMAT: number; + IMPLEMENTATION_COLOR_READ_TYPE: number; + INCR: number; + INCR_WRAP: number; + INT: number; + INT_VEC2: number; + INT_VEC3: number; + INT_VEC4: number; + INVALID_ENUM: number; + INVALID_FRAMEBUFFER_OPERATION: number; + INVALID_OPERATION: number; + INVALID_VALUE: number; + INVERT: number; + KEEP: number; + LEQUAL: number; + LESS: number; + LINEAR: number; + LINEAR_MIPMAP_LINEAR: number; + LINEAR_MIPMAP_NEAREST: number; + LINES: number; + LINE_LOOP: number; + LINE_STRIP: number; + LINE_WIDTH: number; + LINK_STATUS: number; + LOW_FLOAT: number; + LOW_INT: number; + LUMINANCE: number; + LUMINANCE_ALPHA: number; + MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; + MAX_CUBE_MAP_TEXTURE_SIZE: number; + MAX_FRAGMENT_UNIFORM_VECTORS: number; + MAX_RENDERBUFFER_SIZE: number; + MAX_TEXTURE_IMAGE_UNITS: number; + MAX_TEXTURE_SIZE: number; + MAX_VARYING_VECTORS: number; + MAX_VERTEX_ATTRIBS: number; + MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; + MAX_VERTEX_UNIFORM_VECTORS: number; + MAX_VIEWPORT_DIMS: number; + MEDIUM_FLOAT: number; + MEDIUM_INT: number; + MIRRORED_REPEAT: number; + NEAREST: number; + NEAREST_MIPMAP_LINEAR: number; + NEAREST_MIPMAP_NEAREST: number; + NEVER: number; + NICEST: number; + NONE: number; + NOTEQUAL: number; + NO_ERROR: number; + ONE: number; + ONE_MINUS_CONSTANT_ALPHA: number; + ONE_MINUS_CONSTANT_COLOR: number; + ONE_MINUS_DST_ALPHA: number; + ONE_MINUS_DST_COLOR: number; + ONE_MINUS_SRC_ALPHA: number; + ONE_MINUS_SRC_COLOR: number; + OUT_OF_MEMORY: number; + PACK_ALIGNMENT: number; + POINTS: number; + POLYGON_OFFSET_FACTOR: number; + POLYGON_OFFSET_FILL: number; + POLYGON_OFFSET_UNITS: number; + RED_BITS: number; + RENDERBUFFER: number; + RENDERBUFFER_ALPHA_SIZE: number; + RENDERBUFFER_BINDING: number; + RENDERBUFFER_BLUE_SIZE: number; + RENDERBUFFER_DEPTH_SIZE: number; + RENDERBUFFER_GREEN_SIZE: number; + RENDERBUFFER_HEIGHT: number; + RENDERBUFFER_INTERNAL_FORMAT: number; + RENDERBUFFER_RED_SIZE: number; + RENDERBUFFER_STENCIL_SIZE: number; + RENDERBUFFER_WIDTH: number; + RENDERER: number; + REPEAT: number; + REPLACE: number; + RGB: number; + RGB565: number; + RGB5_A1: number; + RGBA: number; + RGBA4: number; + SAMPLER_2D: number; + SAMPLER_CUBE: number; + SAMPLES: number; + SAMPLE_ALPHA_TO_COVERAGE: number; + SAMPLE_BUFFERS: number; + SAMPLE_COVERAGE: number; + SAMPLE_COVERAGE_INVERT: number; + SAMPLE_COVERAGE_VALUE: number; + SCISSOR_BOX: number; + SCISSOR_TEST: number; + SHADER_TYPE: number; + SHADING_LANGUAGE_VERSION: number; + SHORT: number; + SRC_ALPHA: number; + SRC_ALPHA_SATURATE: number; + SRC_COLOR: number; + STATIC_DRAW: number; + STENCIL_ATTACHMENT: number; + STENCIL_BACK_FAIL: number; + STENCIL_BACK_FUNC: number; + STENCIL_BACK_PASS_DEPTH_FAIL: number; + STENCIL_BACK_PASS_DEPTH_PASS: number; + STENCIL_BACK_REF: number; + STENCIL_BACK_VALUE_MASK: number; + STENCIL_BACK_WRITEMASK: number; + STENCIL_BITS: number; + STENCIL_BUFFER_BIT: number; + STENCIL_CLEAR_VALUE: number; + STENCIL_FAIL: number; + STENCIL_FUNC: number; + STENCIL_INDEX: number; + STENCIL_INDEX8: number; + STENCIL_PASS_DEPTH_FAIL: number; + STENCIL_PASS_DEPTH_PASS: number; + STENCIL_REF: number; + STENCIL_TEST: number; + STENCIL_VALUE_MASK: number; + STENCIL_WRITEMASK: number; + STREAM_DRAW: number; + SUBPIXEL_BITS: number; + TEXTURE: number; + TEXTURE0: number; + TEXTURE1: number; + TEXTURE10: number; + TEXTURE11: number; + TEXTURE12: number; + TEXTURE13: number; + TEXTURE14: number; + TEXTURE15: number; + TEXTURE16: number; + TEXTURE17: number; + TEXTURE18: number; + TEXTURE19: number; + TEXTURE2: number; + TEXTURE20: number; + TEXTURE21: number; + TEXTURE22: number; + TEXTURE23: number; + TEXTURE24: number; + TEXTURE25: number; + TEXTURE26: number; + TEXTURE27: number; + TEXTURE28: number; + TEXTURE29: number; + TEXTURE3: number; + TEXTURE30: number; + TEXTURE31: number; + TEXTURE4: number; + TEXTURE5: number; + TEXTURE6: number; + TEXTURE7: number; + TEXTURE8: number; + TEXTURE9: number; + TEXTURE_2D: number; + TEXTURE_BINDING_2D: number; + TEXTURE_BINDING_CUBE_MAP: number; + TEXTURE_CUBE_MAP: number; + TEXTURE_CUBE_MAP_NEGATIVE_X: number; + TEXTURE_CUBE_MAP_NEGATIVE_Y: number; + TEXTURE_CUBE_MAP_NEGATIVE_Z: number; + TEXTURE_CUBE_MAP_POSITIVE_X: number; + TEXTURE_CUBE_MAP_POSITIVE_Y: number; + TEXTURE_CUBE_MAP_POSITIVE_Z: number; + TEXTURE_MAG_FILTER: number; + TEXTURE_MIN_FILTER: number; + TEXTURE_WRAP_S: number; + TEXTURE_WRAP_T: number; + TRIANGLES: number; + TRIANGLE_FAN: number; + TRIANGLE_STRIP: number; + UNPACK_ALIGNMENT: number; + UNPACK_COLORSPACE_CONVERSION_WEBGL: number; + UNPACK_FLIP_Y_WEBGL: number; + UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; + UNSIGNED_BYTE: number; + UNSIGNED_INT: number; + UNSIGNED_SHORT: number; + UNSIGNED_SHORT_4_4_4_4: number; + UNSIGNED_SHORT_5_5_5_1: number; + UNSIGNED_SHORT_5_6_5: number; + VALIDATE_STATUS: number; + VENDOR: number; + VERSION: number; + VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; + VERTEX_ATTRIB_ARRAY_ENABLED: number; + VERTEX_ATTRIB_ARRAY_NORMALIZED: number; + VERTEX_ATTRIB_ARRAY_POINTER: number; + VERTEX_ATTRIB_ARRAY_SIZE: number; + VERTEX_ATTRIB_ARRAY_STRIDE: number; + VERTEX_ATTRIB_ARRAY_TYPE: number; + VERTEX_SHADER: number; + VIEWPORT: number; + ZERO: number; +} + +declare var WebGLRenderingContext: { + prototype: WebGLRenderingContext; + new(): WebGLRenderingContext; + ACTIVE_ATTRIBUTES: number; + ACTIVE_TEXTURE: number; + ACTIVE_UNIFORMS: number; + ALIASED_LINE_WIDTH_RANGE: number; + ALIASED_POINT_SIZE_RANGE: number; + ALPHA: number; + ALPHA_BITS: number; + ALWAYS: number; + ARRAY_BUFFER: number; + ARRAY_BUFFER_BINDING: number; + ATTACHED_SHADERS: number; + BACK: number; + BLEND: number; + BLEND_COLOR: number; + BLEND_DST_ALPHA: number; + BLEND_DST_RGB: number; + BLEND_EQUATION: number; + BLEND_EQUATION_ALPHA: number; + BLEND_EQUATION_RGB: number; + BLEND_SRC_ALPHA: number; + BLEND_SRC_RGB: number; + BLUE_BITS: number; + BOOL: number; + BOOL_VEC2: number; + BOOL_VEC3: number; + BOOL_VEC4: number; + BROWSER_DEFAULT_WEBGL: number; + BUFFER_SIZE: number; + BUFFER_USAGE: number; + BYTE: number; + CCW: number; + CLAMP_TO_EDGE: number; + COLOR_ATTACHMENT0: number; + COLOR_BUFFER_BIT: number; + COLOR_CLEAR_VALUE: number; + COLOR_WRITEMASK: number; + COMPILE_STATUS: number; + COMPRESSED_TEXTURE_FORMATS: number; + CONSTANT_ALPHA: number; + CONSTANT_COLOR: number; + CONTEXT_LOST_WEBGL: number; + CULL_FACE: number; + CULL_FACE_MODE: number; + CURRENT_PROGRAM: number; + CURRENT_VERTEX_ATTRIB: number; + CW: number; + DECR: number; + DECR_WRAP: number; + DELETE_STATUS: number; + DEPTH_ATTACHMENT: number; + DEPTH_BITS: number; + DEPTH_BUFFER_BIT: number; + DEPTH_CLEAR_VALUE: number; + DEPTH_COMPONENT: number; + DEPTH_COMPONENT16: number; + DEPTH_FUNC: number; + DEPTH_RANGE: number; + DEPTH_STENCIL: number; + DEPTH_STENCIL_ATTACHMENT: number; + DEPTH_TEST: number; + DEPTH_WRITEMASK: number; + DITHER: number; + DONT_CARE: number; + DST_ALPHA: number; + DST_COLOR: number; + DYNAMIC_DRAW: number; + ELEMENT_ARRAY_BUFFER: number; + ELEMENT_ARRAY_BUFFER_BINDING: number; + EQUAL: number; + FASTEST: number; + FLOAT: number; + FLOAT_MAT2: number; + FLOAT_MAT3: number; + FLOAT_MAT4: number; + FLOAT_VEC2: number; + FLOAT_VEC3: number; + FLOAT_VEC4: number; + FRAGMENT_SHADER: number; + FRAMEBUFFER: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; + FRAMEBUFFER_BINDING: number; + FRAMEBUFFER_COMPLETE: number; + FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; + FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; + FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; + FRAMEBUFFER_UNSUPPORTED: number; + FRONT: number; + FRONT_AND_BACK: number; + FRONT_FACE: number; + FUNC_ADD: number; + FUNC_REVERSE_SUBTRACT: number; + FUNC_SUBTRACT: number; + GENERATE_MIPMAP_HINT: number; + GEQUAL: number; + GREATER: number; + GREEN_BITS: number; + HIGH_FLOAT: number; + HIGH_INT: number; + IMPLEMENTATION_COLOR_READ_FORMAT: number; + IMPLEMENTATION_COLOR_READ_TYPE: number; + INCR: number; + INCR_WRAP: number; + INT: number; + INT_VEC2: number; + INT_VEC3: number; + INT_VEC4: number; + INVALID_ENUM: number; + INVALID_FRAMEBUFFER_OPERATION: number; + INVALID_OPERATION: number; + INVALID_VALUE: number; + INVERT: number; + KEEP: number; + LEQUAL: number; + LESS: number; + LINEAR: number; + LINEAR_MIPMAP_LINEAR: number; + LINEAR_MIPMAP_NEAREST: number; + LINES: number; + LINE_LOOP: number; + LINE_STRIP: number; + LINE_WIDTH: number; + LINK_STATUS: number; + LOW_FLOAT: number; + LOW_INT: number; + LUMINANCE: number; + LUMINANCE_ALPHA: number; + MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; + MAX_CUBE_MAP_TEXTURE_SIZE: number; + MAX_FRAGMENT_UNIFORM_VECTORS: number; + MAX_RENDERBUFFER_SIZE: number; + MAX_TEXTURE_IMAGE_UNITS: number; + MAX_TEXTURE_SIZE: number; + MAX_VARYING_VECTORS: number; + MAX_VERTEX_ATTRIBS: number; + MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; + MAX_VERTEX_UNIFORM_VECTORS: number; + MAX_VIEWPORT_DIMS: number; + MEDIUM_FLOAT: number; + MEDIUM_INT: number; + MIRRORED_REPEAT: number; + NEAREST: number; + NEAREST_MIPMAP_LINEAR: number; + NEAREST_MIPMAP_NEAREST: number; + NEVER: number; + NICEST: number; + NONE: number; + NOTEQUAL: number; + NO_ERROR: number; + ONE: number; + ONE_MINUS_CONSTANT_ALPHA: number; + ONE_MINUS_CONSTANT_COLOR: number; + ONE_MINUS_DST_ALPHA: number; + ONE_MINUS_DST_COLOR: number; + ONE_MINUS_SRC_ALPHA: number; + ONE_MINUS_SRC_COLOR: number; + OUT_OF_MEMORY: number; + PACK_ALIGNMENT: number; + POINTS: number; + POLYGON_OFFSET_FACTOR: number; + POLYGON_OFFSET_FILL: number; + POLYGON_OFFSET_UNITS: number; + RED_BITS: number; + RENDERBUFFER: number; + RENDERBUFFER_ALPHA_SIZE: number; + RENDERBUFFER_BINDING: number; + RENDERBUFFER_BLUE_SIZE: number; + RENDERBUFFER_DEPTH_SIZE: number; + RENDERBUFFER_GREEN_SIZE: number; + RENDERBUFFER_HEIGHT: number; + RENDERBUFFER_INTERNAL_FORMAT: number; + RENDERBUFFER_RED_SIZE: number; + RENDERBUFFER_STENCIL_SIZE: number; + RENDERBUFFER_WIDTH: number; + RENDERER: number; + REPEAT: number; + REPLACE: number; + RGB: number; + RGB565: number; + RGB5_A1: number; + RGBA: number; + RGBA4: number; + SAMPLER_2D: number; + SAMPLER_CUBE: number; + SAMPLES: number; + SAMPLE_ALPHA_TO_COVERAGE: number; + SAMPLE_BUFFERS: number; + SAMPLE_COVERAGE: number; + SAMPLE_COVERAGE_INVERT: number; + SAMPLE_COVERAGE_VALUE: number; + SCISSOR_BOX: number; + SCISSOR_TEST: number; + SHADER_TYPE: number; + SHADING_LANGUAGE_VERSION: number; + SHORT: number; + SRC_ALPHA: number; + SRC_ALPHA_SATURATE: number; + SRC_COLOR: number; + STATIC_DRAW: number; + STENCIL_ATTACHMENT: number; + STENCIL_BACK_FAIL: number; + STENCIL_BACK_FUNC: number; + STENCIL_BACK_PASS_DEPTH_FAIL: number; + STENCIL_BACK_PASS_DEPTH_PASS: number; + STENCIL_BACK_REF: number; + STENCIL_BACK_VALUE_MASK: number; + STENCIL_BACK_WRITEMASK: number; + STENCIL_BITS: number; + STENCIL_BUFFER_BIT: number; + STENCIL_CLEAR_VALUE: number; + STENCIL_FAIL: number; + STENCIL_FUNC: number; + STENCIL_INDEX: number; + STENCIL_INDEX8: number; + STENCIL_PASS_DEPTH_FAIL: number; + STENCIL_PASS_DEPTH_PASS: number; + STENCIL_REF: number; + STENCIL_TEST: number; + STENCIL_VALUE_MASK: number; + STENCIL_WRITEMASK: number; + STREAM_DRAW: number; + SUBPIXEL_BITS: number; + TEXTURE: number; + TEXTURE0: number; + TEXTURE1: number; + TEXTURE10: number; + TEXTURE11: number; + TEXTURE12: number; + TEXTURE13: number; + TEXTURE14: number; + TEXTURE15: number; + TEXTURE16: number; + TEXTURE17: number; + TEXTURE18: number; + TEXTURE19: number; + TEXTURE2: number; + TEXTURE20: number; + TEXTURE21: number; + TEXTURE22: number; + TEXTURE23: number; + TEXTURE24: number; + TEXTURE25: number; + TEXTURE26: number; + TEXTURE27: number; + TEXTURE28: number; + TEXTURE29: number; + TEXTURE3: number; + TEXTURE30: number; + TEXTURE31: number; + TEXTURE4: number; + TEXTURE5: number; + TEXTURE6: number; + TEXTURE7: number; + TEXTURE8: number; + TEXTURE9: number; + TEXTURE_2D: number; + TEXTURE_BINDING_2D: number; + TEXTURE_BINDING_CUBE_MAP: number; + TEXTURE_CUBE_MAP: number; + TEXTURE_CUBE_MAP_NEGATIVE_X: number; + TEXTURE_CUBE_MAP_NEGATIVE_Y: number; + TEXTURE_CUBE_MAP_NEGATIVE_Z: number; + TEXTURE_CUBE_MAP_POSITIVE_X: number; + TEXTURE_CUBE_MAP_POSITIVE_Y: number; + TEXTURE_CUBE_MAP_POSITIVE_Z: number; + TEXTURE_MAG_FILTER: number; + TEXTURE_MIN_FILTER: number; + TEXTURE_WRAP_S: number; + TEXTURE_WRAP_T: number; + TRIANGLES: number; + TRIANGLE_FAN: number; + TRIANGLE_STRIP: number; + UNPACK_ALIGNMENT: number; + UNPACK_COLORSPACE_CONVERSION_WEBGL: number; + UNPACK_FLIP_Y_WEBGL: number; + UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; + UNSIGNED_BYTE: number; + UNSIGNED_INT: number; + UNSIGNED_SHORT: number; + UNSIGNED_SHORT_4_4_4_4: number; + UNSIGNED_SHORT_5_5_5_1: number; + UNSIGNED_SHORT_5_6_5: number; + VALIDATE_STATUS: number; + VENDOR: number; + VERSION: number; + VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; + VERTEX_ATTRIB_ARRAY_ENABLED: number; + VERTEX_ATTRIB_ARRAY_NORMALIZED: number; + VERTEX_ATTRIB_ARRAY_POINTER: number; + VERTEX_ATTRIB_ARRAY_SIZE: number; + VERTEX_ATTRIB_ARRAY_STRIDE: number; + VERTEX_ATTRIB_ARRAY_TYPE: number; + VERTEX_SHADER: number; + VIEWPORT: number; + ZERO: number; +} + +interface WebGLShader extends WebGLObject { +} + +declare var WebGLShader: { + prototype: WebGLShader; + new(): WebGLShader; +} + +interface WebGLShaderPrecisionFormat { + precision: number; + rangeMax: number; + rangeMin: number; +} + declare var WebGLShaderPrecisionFormat: { prototype: WebGLShaderPrecisionFormat; new(): WebGLShaderPrecisionFormat; } -interface EXT_texture_filter_anisotropic { - TEXTURE_MAX_ANISOTROPY_EXT: number; - MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; -} -declare var EXT_texture_filter_anisotropic: { - prototype: EXT_texture_filter_anisotropic; - new(): EXT_texture_filter_anisotropic; - TEXTURE_MAX_ANISOTROPY_EXT: number; - MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; +interface WebGLTexture extends WebGLObject { } -declare var Option: { new(text?: string, value?: string, defaultSelected?: boolean, selected?:boolean): HTMLOptionElement; }; -declare var Image: { new(width?: number, height?: number): HTMLImageElement; }; -declare var Audio: { new(src?: string): HTMLAudioElement; }; +declare var WebGLTexture: { + prototype: WebGLTexture; + new(): WebGLTexture; +} -declare var ondragend: (ev: DragEvent) => any; -declare var onkeydown: (ev: KeyboardEvent) => any; -declare var ondragover: (ev: DragEvent) => any; -declare var onkeyup: (ev: KeyboardEvent) => any; -declare var onreset: (ev: Event) => any; -declare var onmouseup: (ev: MouseEvent) => any; -declare var ondragstart: (ev: DragEvent) => any; -declare var ondrag: (ev: DragEvent) => any; -declare var screenX: number; -declare var onmouseover: (ev: MouseEvent) => any; -declare var ondragleave: (ev: DragEvent) => any; -declare var history: History; -declare var pageXOffset: number; -declare var name: string; -declare var onafterprint: (ev: Event) => any; -declare var onpause: (ev: Event) => any; -declare var onbeforeprint: (ev: Event) => any; -declare var top: Window; -declare var onmousedown: (ev: MouseEvent) => any; -declare var onseeked: (ev: Event) => any; -declare var opener: Window; -declare var onclick: (ev: MouseEvent) => any; -declare var innerHeight: number; -declare var onwaiting: (ev: Event) => any; -declare var ononline: (ev: Event) => any; -declare var ondurationchange: (ev: Event) => any; -declare var frames: Window; -declare var onblur: (ev: FocusEvent) => any; -declare var onemptied: (ev: Event) => any; -declare var onseeking: (ev: Event) => any; -declare var oncanplay: (ev: Event) => any; -declare var outerWidth: number; -declare var onstalled: (ev: Event) => any; -declare var onmousemove: (ev: MouseEvent) => any; -declare var innerWidth: number; -declare var onoffline: (ev: Event) => any; -declare var length: number; -declare var screen: Screen; -declare var onbeforeunload: (ev: BeforeUnloadEvent) => any; -declare var onratechange: (ev: Event) => any; -declare var onstorage: (ev: StorageEvent) => any; -declare var onloadstart: (ev: Event) => any; -declare var ondragenter: (ev: DragEvent) => any; -declare var onsubmit: (ev: Event) => any; -declare var self: Window; -declare var document: Document; -declare var onprogress: (ev: ProgressEvent) => any; -declare var ondblclick: (ev: MouseEvent) => any; -declare var pageYOffset: number; -declare var oncontextmenu: (ev: MouseEvent) => any; -declare var onchange: (ev: Event) => any; -declare var onloadedmetadata: (ev: Event) => any; -declare var onplay: (ev: Event) => any; -declare var onerror: ErrorEventHandler; -declare var onplaying: (ev: Event) => any; -declare var parent: Window; -declare var location: Location; -declare var oncanplaythrough: (ev: Event) => any; -declare var onabort: (ev: UIEvent) => any; -declare var onreadystatechange: (ev: Event) => any; -declare var outerHeight: number; -declare var onkeypress: (ev: KeyboardEvent) => any; -declare var frameElement: Element; -declare var onloadeddata: (ev: Event) => any; -declare var onsuspend: (ev: Event) => any; -declare var window: Window; -declare var onfocus: (ev: FocusEvent) => any; -declare var onmessage: (ev: MessageEvent) => any; -declare var ontimeupdate: (ev: Event) => any; -declare var onresize: (ev: UIEvent) => any; -declare var onselect: (ev: UIEvent) => any; -declare var navigator: Navigator; -declare var styleMedia: StyleMedia; -declare var ondrop: (ev: DragEvent) => any; -declare var onmouseout: (ev: MouseEvent) => any; -declare var onended: (ev: Event) => any; -declare var onhashchange: (ev: Event) => any; -declare var onunload: (ev: Event) => any; -declare var onscroll: (ev: UIEvent) => any; -declare var screenY: number; -declare var onmousewheel: (ev: MouseWheelEvent) => any; -declare var onload: (ev: Event) => any; -declare var onvolumechange: (ev: Event) => any; -declare var oninput: (ev: Event) => any; -declare var performance: Performance; -declare var onmspointerdown: (ev: any) => any; +interface WebGLUniformLocation { +} + +declare var WebGLUniformLocation: { + prototype: WebGLUniformLocation; + new(): WebGLUniformLocation; +} + +interface WebKitCSSMatrix { + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + m11: number; + m12: number; + m13: number; + m14: number; + m21: number; + m22: number; + m23: number; + m24: number; + m31: number; + m32: number; + m33: number; + m34: number; + m41: number; + m42: number; + m43: number; + m44: number; + inverse(): WebKitCSSMatrix; + multiply(secondMatrix: WebKitCSSMatrix): WebKitCSSMatrix; + rotate(angleX: number, angleY?: number, angleZ?: number): WebKitCSSMatrix; + rotateAxisAngle(x: number, y: number, z: number, angle: number): WebKitCSSMatrix; + scale(scaleX: number, scaleY?: number, scaleZ?: number): WebKitCSSMatrix; + setMatrixValue(value: string): void; + skewX(angle: number): WebKitCSSMatrix; + skewY(angle: number): WebKitCSSMatrix; + toString(): string; + translate(x: number, y: number, z?: number): WebKitCSSMatrix; +} + +declare var WebKitCSSMatrix: { + prototype: WebKitCSSMatrix; + new(text?: string): WebKitCSSMatrix; +} + +interface WebKitPoint { + x: number; + y: number; +} + +declare var WebKitPoint: { + prototype: WebKitPoint; + new(x?: number, y?: number): WebKitPoint; +} + +interface WebSocket extends EventTarget { + binaryType: string; + bufferedAmount: number; + extensions: string; + onclose: (ev: CloseEvent) => any; + onerror: (ev: Event) => any; + onmessage: (ev: MessageEvent) => any; + onopen: (ev: Event) => any; + protocol: string; + readyState: number; + url: string; + close(code?: number, reason?: string): void; + send(data: any): void; + CLOSED: number; + CLOSING: number; + CONNECTING: number; + OPEN: number; + addEventListener(type: "close", listener: (ev: CloseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "open", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var WebSocket: { + prototype: WebSocket; + new(url: string, protocols?: string): WebSocket; + new(url: string, protocols?: any): WebSocket; + CLOSED: number; + CLOSING: number; + CONNECTING: number; + OPEN: number; +} + +interface WheelEvent extends MouseEvent { + deltaMode: number; + deltaX: number; + deltaY: number; + deltaZ: number; + getCurrentPoint(element: Element): void; + initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void; + DOM_DELTA_LINE: number; + DOM_DELTA_PAGE: number; + DOM_DELTA_PIXEL: number; +} + +declare var WheelEvent: { + prototype: WheelEvent; + new(typeArg: string, eventInitDict?: WheelEventInit): WheelEvent; + DOM_DELTA_LINE: number; + DOM_DELTA_PAGE: number; + DOM_DELTA_PIXEL: number; +} + +interface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64 { + animationStartTime: number; + applicationCache: ApplicationCache; + clientInformation: Navigator; + closed: boolean; + crypto: Crypto; + defaultStatus: string; + devicePixelRatio: number; + doNotTrack: string; + document: Document; + event: Event; + external: External; + frameElement: Element; + frames: Window; + history: History; + innerHeight: number; + innerWidth: number; + length: number; + location: Location; + locationbar: BarProp; + menubar: BarProp; + msAnimationStartTime: number; + msTemplatePrinter: MSTemplatePrinter; + name: string; + navigator: Navigator; + offscreenBuffering: string | boolean; + onabort: (ev: Event) => any; + onafterprint: (ev: Event) => any; + onbeforeprint: (ev: Event) => any; + onbeforeunload: (ev: BeforeUnloadEvent) => any; + onblur: (ev: FocusEvent) => any; + oncanplay: (ev: Event) => any; + oncanplaythrough: (ev: Event) => any; + onchange: (ev: Event) => any; + onclick: (ev: MouseEvent) => any; + oncompassneedscalibration: (ev: Event) => any; + oncontextmenu: (ev: PointerEvent) => any; + ondblclick: (ev: MouseEvent) => any; + ondevicemotion: (ev: DeviceMotionEvent) => any; + ondeviceorientation: (ev: DeviceOrientationEvent) => any; + ondrag: (ev: DragEvent) => any; + ondragend: (ev: DragEvent) => any; + ondragenter: (ev: DragEvent) => any; + ondragleave: (ev: DragEvent) => any; + ondragover: (ev: DragEvent) => any; + ondragstart: (ev: DragEvent) => any; + ondrop: (ev: DragEvent) => any; + ondurationchange: (ev: Event) => any; + onemptied: (ev: Event) => any; + onended: (ev: Event) => any; + onerror: ErrorEventHandler; + onfocus: (ev: FocusEvent) => any; + onhashchange: (ev: HashChangeEvent) => any; + oninput: (ev: Event) => any; + onkeydown: (ev: KeyboardEvent) => any; + onkeypress: (ev: KeyboardEvent) => any; + onkeyup: (ev: KeyboardEvent) => any; + onload: (ev: Event) => any; + onloadeddata: (ev: Event) => any; + onloadedmetadata: (ev: Event) => any; + onloadstart: (ev: Event) => any; + onmessage: (ev: MessageEvent) => any; + onmousedown: (ev: MouseEvent) => any; + onmouseenter: (ev: MouseEvent) => any; + onmouseleave: (ev: MouseEvent) => any; + onmousemove: (ev: MouseEvent) => any; + onmouseout: (ev: MouseEvent) => any; + onmouseover: (ev: MouseEvent) => any; + onmouseup: (ev: MouseEvent) => any; + onmousewheel: (ev: MouseWheelEvent) => any; + onmsgesturechange: (ev: MSGestureEvent) => any; + onmsgesturedoubletap: (ev: MSGestureEvent) => any; + onmsgestureend: (ev: MSGestureEvent) => any; + onmsgesturehold: (ev: MSGestureEvent) => any; + onmsgesturestart: (ev: MSGestureEvent) => any; + onmsgesturetap: (ev: MSGestureEvent) => any; + onmsinertiastart: (ev: MSGestureEvent) => any; + onmspointercancel: (ev: MSPointerEvent) => any; + onmspointerdown: (ev: MSPointerEvent) => any; + onmspointerenter: (ev: MSPointerEvent) => any; + onmspointerleave: (ev: MSPointerEvent) => any; + onmspointermove: (ev: MSPointerEvent) => any; + onmspointerout: (ev: MSPointerEvent) => any; + onmspointerover: (ev: MSPointerEvent) => any; + onmspointerup: (ev: MSPointerEvent) => any; + onoffline: (ev: Event) => any; + ononline: (ev: Event) => any; + onorientationchange: (ev: Event) => any; + onpagehide: (ev: PageTransitionEvent) => any; + onpageshow: (ev: PageTransitionEvent) => any; + onpause: (ev: Event) => any; + onplay: (ev: Event) => any; + onplaying: (ev: Event) => any; + onpopstate: (ev: PopStateEvent) => any; + onprogress: (ev: ProgressEvent) => any; + onratechange: (ev: Event) => any; + onreadystatechange: (ev: ProgressEvent) => any; + onreset: (ev: Event) => any; + onresize: (ev: UIEvent) => any; + onscroll: (ev: UIEvent) => any; + onseeked: (ev: Event) => any; + onseeking: (ev: Event) => any; + onselect: (ev: UIEvent) => any; + onstalled: (ev: Event) => any; + onstorage: (ev: StorageEvent) => any; + onsubmit: (ev: Event) => any; + onsuspend: (ev: Event) => any; + ontimeupdate: (ev: Event) => any; + ontouchcancel: any; + ontouchend: any; + ontouchmove: any; + ontouchstart: any; + onunload: (ev: Event) => any; + onvolumechange: (ev: Event) => any; + onwaiting: (ev: Event) => any; + opener: Window; + orientation: string; + outerHeight: number; + outerWidth: number; + pageXOffset: number; + pageYOffset: number; + parent: Window; + performance: Performance; + personalbar: BarProp; + screen: Screen; + screenLeft: number; + screenTop: number; + screenX: number; + screenY: number; + scrollX: number; + scrollY: number; + scrollbars: BarProp; + self: Window; + status: string; + statusbar: BarProp; + styleMedia: StyleMedia; + toolbar: BarProp; + top: Window; + window: Window; + alert(message?: any): void; + blur(): void; + cancelAnimationFrame(handle: number): void; + captureEvents(): void; + close(): void; + confirm(message?: string): boolean; + focus(): void; + getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; + getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; + getSelection(): Selection; + matchMedia(mediaQuery: string): MediaQueryList; + moveBy(x?: number, y?: number): void; + moveTo(x?: number, y?: number): void; + msCancelRequestAnimationFrame(handle: number): void; + msMatchMedia(mediaQuery: string): MediaQueryList; + msRequestAnimationFrame(callback: FrameRequestCallback): number; + msWriteProfilerMark(profilerMarkName: string): void; + open(url?: string, target?: string, features?: string, replace?: boolean): any; + postMessage(message: any, targetOrigin: string, ports?: any): void; + print(): void; + prompt(message?: string, _default?: string): string; + releaseEvents(): void; + requestAnimationFrame(callback: FrameRequestCallback): number; + resizeBy(x?: number, y?: number): void; + resizeTo(x?: number, y?: number): void; + scroll(x?: number, y?: number): void; + scrollBy(x?: number, y?: number): void; + scrollTo(x?: number, y?: number): void; + webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; + webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "compassneedscalibration", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: Window; +} + +declare var Window: { + prototype: Window; + new(): Window; +} + +interface Worker extends EventTarget, AbstractWorker { + onmessage: (ev: MessageEvent) => any; + postMessage(message: any, ports?: any): void; + terminate(): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Worker: { + prototype: Worker; + new(stringUrl: string): Worker; +} + +interface XMLDocument extends Document { +} + +declare var XMLDocument: { + prototype: XMLDocument; + new(): XMLDocument; +} + +interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget { + msCaching: string; + onreadystatechange: (ev: ProgressEvent) => any; + readyState: number; + response: any; + responseBody: any; + responseText: string; + responseType: string; + responseXML: any; + status: number; + statusText: string; + timeout: number; + upload: XMLHttpRequestUpload; + withCredentials: boolean; + abort(): void; + getAllResponseHeaders(): string; + getResponseHeader(header: string): string; + msCachingEnabled(): boolean; + open(method: string, url: string, async?: boolean, user?: string, password?: string): void; + overrideMimeType(mime: string): void; + send(data?: Document): void; + send(data?: string): void; + setRequestHeader(header: string, value: string): void; + DONE: number; + HEADERS_RECEIVED: number; + LOADING: number; + OPENED: number; + UNSENT: number; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeout", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var XMLHttpRequest: { + prototype: XMLHttpRequest; + new(): XMLHttpRequest; + DONE: number; + HEADERS_RECEIVED: number; + LOADING: number; + OPENED: number; + UNSENT: number; + create(): XMLHttpRequest; +} + +interface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var XMLHttpRequestUpload: { + prototype: XMLHttpRequestUpload; + new(): XMLHttpRequestUpload; +} + +interface XMLSerializer { + serializeToString(target: Node): string; +} + +declare var XMLSerializer: { + prototype: XMLSerializer; + new(): XMLSerializer; +} + +interface XPathEvaluator { + createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; + createNSResolver(nodeResolver?: Node): XPathNSResolver; + evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver, type: number, result: XPathResult): XPathResult; +} + +declare var XPathEvaluator: { + prototype: XPathEvaluator; + new(): XPathEvaluator; +} + +interface XPathExpression { + evaluate(contextNode: Node, type: number, result: XPathResult): XPathExpression; +} + +declare var XPathExpression: { + prototype: XPathExpression; + new(): XPathExpression; +} + +interface XPathNSResolver { + lookupNamespaceURI(prefix: string): string; +} + +declare var XPathNSResolver: { + prototype: XPathNSResolver; + new(): XPathNSResolver; +} + +interface XPathResult { + booleanValue: boolean; + invalidIteratorState: boolean; + numberValue: number; + resultType: number; + singleNodeValue: Node; + snapshotLength: number; + stringValue: string; + iterateNext(): Node; + snapshotItem(index: number): Node; + ANY_TYPE: number; + ANY_UNORDERED_NODE_TYPE: number; + BOOLEAN_TYPE: number; + FIRST_ORDERED_NODE_TYPE: number; + NUMBER_TYPE: number; + ORDERED_NODE_ITERATOR_TYPE: number; + ORDERED_NODE_SNAPSHOT_TYPE: number; + STRING_TYPE: number; + UNORDERED_NODE_ITERATOR_TYPE: number; + UNORDERED_NODE_SNAPSHOT_TYPE: number; +} + +declare var XPathResult: { + prototype: XPathResult; + new(): XPathResult; + ANY_TYPE: number; + ANY_UNORDERED_NODE_TYPE: number; + BOOLEAN_TYPE: number; + FIRST_ORDERED_NODE_TYPE: number; + NUMBER_TYPE: number; + ORDERED_NODE_ITERATOR_TYPE: number; + ORDERED_NODE_SNAPSHOT_TYPE: number; + STRING_TYPE: number; + UNORDERED_NODE_ITERATOR_TYPE: number; + UNORDERED_NODE_SNAPSHOT_TYPE: number; +} + +interface XSLTProcessor { + clearParameters(): void; + getParameter(namespaceURI: string, localName: string): any; + importStylesheet(style: Node): void; + removeParameter(namespaceURI: string, localName: string): void; + reset(): void; + setParameter(namespaceURI: string, localName: string, value: any): void; + transformToDocument(source: Node): Document; + transformToFragment(source: Node, document: Document): DocumentFragment; +} + +declare var XSLTProcessor: { + prototype: XSLTProcessor; + new(): XSLTProcessor; +} + +interface AbstractWorker { + onerror: (ev: Event) => any; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface ChildNode { + remove(): void; +} + +interface DOML2DeprecatedColorProperty { + color: string; +} + +interface DOML2DeprecatedSizeProperty { + size: number; +} + +interface DocumentEvent { + createEvent(eventInterface:"AnimationEvent"): AnimationEvent; + createEvent(eventInterface:"AriaRequestEvent"): AriaRequestEvent; + createEvent(eventInterface:"AudioProcessingEvent"): AudioProcessingEvent; + createEvent(eventInterface:"BeforeUnloadEvent"): BeforeUnloadEvent; + createEvent(eventInterface:"CloseEvent"): CloseEvent; + createEvent(eventInterface:"CommandEvent"): CommandEvent; + createEvent(eventInterface:"CompositionEvent"): CompositionEvent; + createEvent(eventInterface:"DeviceMotionEvent"): DeviceMotionEvent; + createEvent(eventInterface:"DeviceOrientationEvent"): DeviceOrientationEvent; + createEvent(eventInterface:"DragEvent"): DragEvent; + createEvent(eventInterface:"ErrorEvent"): ErrorEvent; + createEvent(eventInterface:"Event"): Event; + createEvent(eventInterface:"FocusEvent"): FocusEvent; + createEvent(eventInterface:"GamepadEvent"): GamepadEvent; + createEvent(eventInterface:"HashChangeEvent"): HashChangeEvent; + createEvent(eventInterface:"IDBVersionChangeEvent"): IDBVersionChangeEvent; + createEvent(eventInterface:"KeyboardEvent"): KeyboardEvent; + createEvent(eventInterface:"LongRunningScriptDetectedEvent"): LongRunningScriptDetectedEvent; + createEvent(eventInterface:"MSGestureEvent"): MSGestureEvent; + createEvent(eventInterface:"MSManipulationEvent"): MSManipulationEvent; + createEvent(eventInterface:"MSMediaKeyMessageEvent"): MSMediaKeyMessageEvent; + createEvent(eventInterface:"MSMediaKeyNeededEvent"): MSMediaKeyNeededEvent; + createEvent(eventInterface:"MSPointerEvent"): MSPointerEvent; + createEvent(eventInterface:"MSSiteModeEvent"): MSSiteModeEvent; + createEvent(eventInterface:"MessageEvent"): MessageEvent; + createEvent(eventInterface:"MouseEvent"): MouseEvent; + createEvent(eventInterface:"MouseWheelEvent"): MouseWheelEvent; + createEvent(eventInterface:"MutationEvent"): MutationEvent; + createEvent(eventInterface:"NavigationCompletedEvent"): NavigationCompletedEvent; + createEvent(eventInterface:"NavigationEvent"): NavigationEvent; + createEvent(eventInterface:"NavigationEventWithReferrer"): NavigationEventWithReferrer; + createEvent(eventInterface:"OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent; + createEvent(eventInterface:"PageTransitionEvent"): PageTransitionEvent; + createEvent(eventInterface:"PermissionRequestedEvent"): PermissionRequestedEvent; + createEvent(eventInterface:"PointerEvent"): PointerEvent; + createEvent(eventInterface:"PopStateEvent"): PopStateEvent; + createEvent(eventInterface:"ProgressEvent"): ProgressEvent; + createEvent(eventInterface:"SVGZoomEvent"): SVGZoomEvent; + createEvent(eventInterface:"ScriptNotifyEvent"): ScriptNotifyEvent; + createEvent(eventInterface:"StorageEvent"): StorageEvent; + createEvent(eventInterface:"TextEvent"): TextEvent; + createEvent(eventInterface:"TouchEvent"): TouchEvent; + createEvent(eventInterface:"TrackEvent"): TrackEvent; + createEvent(eventInterface:"TransitionEvent"): TransitionEvent; + createEvent(eventInterface:"UIEvent"): UIEvent; + createEvent(eventInterface:"UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent; + createEvent(eventInterface:"WebGLContextEvent"): WebGLContextEvent; + createEvent(eventInterface:"WheelEvent"): WheelEvent; + createEvent(eventInterface: string): Event; +} + +interface ElementTraversal { + childElementCount: number; + firstElementChild: Element; + lastElementChild: Element; + nextElementSibling: Element; + previousElementSibling: Element; +} + +interface GetSVGDocument { + getSVGDocument(): Document; +} + +interface GlobalEventHandlers { + onpointercancel: (ev: PointerEvent) => any; + onpointerdown: (ev: PointerEvent) => any; + onpointerenter: (ev: PointerEvent) => any; + onpointerleave: (ev: PointerEvent) => any; + onpointermove: (ev: PointerEvent) => any; + onpointerout: (ev: PointerEvent) => any; + onpointerover: (ev: PointerEvent) => any; + onpointerup: (ev: PointerEvent) => any; + onwheel: (ev: WheelEvent) => any; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface HTMLTableAlignment { + /** + * Sets or retrieves a value that you can use to implement your own ch functionality for the object. + */ + ch: string; + /** + * Sets or retrieves a value that you can use to implement your own chOff functionality for the object. + */ + chOff: string; + /** + * Sets or retrieves how text and other content are vertically aligned within the object that contains them. + */ + vAlign: string; +} + +interface IDBEnvironment { + indexedDB: IDBFactory; + msIndexedDB: IDBFactory; +} + +interface LinkStyle { + sheet: StyleSheet; +} + +interface MSBaseReader { + onabort: (ev: Event) => any; + onerror: (ev: Event) => any; + onload: (ev: Event) => any; + onloadend: (ev: ProgressEvent) => any; + onloadstart: (ev: Event) => any; + onprogress: (ev: ProgressEvent) => any; + readyState: number; + result: any; + abort(): void; + DONE: number; + EMPTY: number; + LOADING: number; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface MSFileSaver { + msSaveBlob(blob: any, defaultName?: string): boolean; + msSaveOrOpenBlob(blob: any, defaultName?: string): boolean; +} + +interface MSNavigatorDoNotTrack { + confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean; + confirmWebWideTrackingException(args: ExceptionInformation): boolean; + removeSiteSpecificTrackingException(args: ExceptionInformation): void; + removeWebWideTrackingException(args: ExceptionInformation): void; + storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void; + storeWebWideTrackingException(args: StoreExceptionsInformation): void; +} + +interface NavigatorContentUtils { +} + +interface NavigatorGeolocation { + geolocation: Geolocation; +} + +interface NavigatorID { + appName: string; + appVersion: string; + platform: string; + product: string; + productSub: string; + userAgent: string; + vendor: string; + vendorSub: string; +} + +interface NavigatorOnLine { + onLine: boolean; +} + +interface NavigatorStorageUtils { +} + +interface NodeSelector { + querySelector(selectors: string): Element; + querySelectorAll(selectors: string): NodeList; +} + +interface RandomSource { + getRandomValues(array: ArrayBufferView): ArrayBufferView; +} + +interface SVGAnimatedPathData { + pathSegList: SVGPathSegList; +} + +interface SVGAnimatedPoints { + animatedPoints: SVGPointList; + points: SVGPointList; +} + +interface SVGExternalResourcesRequired { + externalResourcesRequired: SVGAnimatedBoolean; +} + +interface SVGFilterPrimitiveStandardAttributes extends SVGStylable { + height: SVGAnimatedLength; + result: SVGAnimatedString; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; +} + +interface SVGFitToViewBox { + preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + viewBox: SVGAnimatedRect; +} + +interface SVGLangSpace { + xmllang: string; + xmlspace: string; +} + +interface SVGLocatable { + farthestViewportElement: SVGElement; + nearestViewportElement: SVGElement; + getBBox(): SVGRect; + getCTM(): SVGMatrix; + getScreenCTM(): SVGMatrix; + getTransformToElement(element: SVGElement): SVGMatrix; +} + +interface SVGStylable { + className: SVGAnimatedString; + style: CSSStyleDeclaration; +} + +interface SVGTests { + requiredExtensions: SVGStringList; + requiredFeatures: SVGStringList; + systemLanguage: SVGStringList; + hasExtension(extension: string): boolean; +} + +interface SVGTransformable extends SVGLocatable { + transform: SVGAnimatedTransformList; +} + +interface SVGURIReference { + href: SVGAnimatedString; +} + +interface WindowBase64 { + atob(encodedString: string): string; + btoa(rawString: string): string; +} + +interface WindowConsole { + console: Console; +} + +interface WindowLocalStorage { + localStorage: Storage; +} + +interface WindowSessionStorage { + sessionStorage: Storage; +} + +interface WindowTimers extends Object, WindowTimersExtension { + clearInterval(handle: number): void; + clearTimeout(handle: number): void; + setInterval(handler: any, timeout?: any, ...args: any[]): number; + setTimeout(handler: any, timeout?: any, ...args: any[]): number; +} + +interface WindowTimersExtension { + clearImmediate(handle: number): void; + msClearImmediate(handle: number): void; + msSetImmediate(expression: any, ...args: any[]): number; + setImmediate(expression: any, ...args: any[]): number; +} + +interface XMLHttpRequestEventTarget { + onabort: (ev: Event) => any; + onerror: (ev: Event) => any; + onload: (ev: Event) => any; + onloadend: (ev: ProgressEvent) => any; + onloadstart: (ev: Event) => any; + onprogress: (ev: ProgressEvent) => any; + ontimeout: (ev: ProgressEvent) => any; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeout", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + + +interface NodeListOf extends NodeList { + length: number; + item(index: number): TNode; + [index: number]: TNode; +} + +interface BlobPropertyBag { + type?: string; + endings?: string; +} + +interface EventListenerObject { + handleEvent(evt: Event): void; +} + +declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; + +interface ErrorEventHandler { + (event: Event, source?: string, fileno?: number, columnNumber?: number): void; + (event: string, source?: string, fileno?: number, columnNumber?: number): void; +} +interface PositionCallback { + (position: Position): void; +} +interface PositionErrorCallback { + (error: PositionError): void; +} +interface MediaQueryListListener { + (mql: MediaQueryList): void; +} +interface MSLaunchUriCallback { + (): void; +} +interface FrameRequestCallback { + (time: number): void; +} +interface MSUnsafeFunctionCallback { + (): any; +} +interface MSExecAtPriorityFunctionCallback { + (...args: any[]): any; +} +interface MutationCallback { + (mutations: MutationRecord[], observer: MutationObserver): void; +} +interface DecodeSuccessCallback { + (decodedData: AudioBuffer): void; +} +interface DecodeErrorCallback { + (): void; +} +interface FunctionStringCallback { + (data: string): void; +} +declare var Audio: {new(src?: string): HTMLAudioElement; }; +declare var Image: {new(width?: number, height?: number): HTMLImageElement; }; +declare var Option: {new(text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement; }; declare var animationStartTime: number; -declare var onmsgesturedoubletap: (ev: any) => any; -declare var onmspointerhover: (ev: any) => any; -declare var onmsgesturehold: (ev: any) => any; -declare var onmspointermove: (ev: any) => any; -declare var onmsgesturechange: (ev: any) => any; -declare var onmsgesturestart: (ev: any) => any; -declare var onmspointercancel: (ev: any) => any; -declare var onmsgestureend: (ev: any) => any; -declare var onmsgesturetap: (ev: any) => any; -declare var onmspointerout: (ev: any) => any; -declare var msAnimationStartTime: number; declare var applicationCache: ApplicationCache; -declare var onmsinertiastart: (ev: any) => any; -declare var onmspointerover: (ev: any) => any; -declare var onpopstate: (ev: PopStateEvent) => any; -declare var onmspointerup: (ev: any) => any; -declare var onpageshow: (ev: PageTransitionEvent) => any; -declare var ondevicemotion: (ev: DeviceMotionEvent) => any; -declare var devicePixelRatio: number; -declare var msCrypto: Crypto; -declare var ondeviceorientation: (ev: DeviceOrientationEvent) => any; -declare var doNotTrack: string; -declare var onmspointerenter: (ev: any) => any; -declare var onpagehide: (ev: PageTransitionEvent) => any; -declare var onmspointerleave: (ev: any) => any; -declare function alert(message?: any): void; -declare function scroll(x?: number, y?: number): void; -declare function focus(): void; -declare function scrollTo(x?: number, y?: number): void; -declare function print(): void; -declare function prompt(message?: string, _default?: string): string; -declare function toString(): string; -declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window; -declare function scrollBy(x?: number, y?: number): void; -declare function confirm(message?: string): boolean; -declare function close(): void; -declare function postMessage(message: any, targetOrigin: string, ports?: any): void; -declare function showModalDialog(url?: string, argument?: any, options?: any): any; -declare function blur(): void; -declare function getSelection(): Selection; -declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; -declare function msCancelRequestAnimationFrame(handle: number): void; -declare function matchMedia(mediaQuery: string): MediaQueryList; -declare function cancelAnimationFrame(handle: number): void; -declare function msIsStaticHTML(html: string): boolean; -declare function msMatchMedia(mediaQuery: string): MediaQueryList; -declare function requestAnimationFrame(callback: FrameRequestCallback): number; -declare function msRequestAnimationFrame(callback: FrameRequestCallback): number; -declare function removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -declare function dispatchEvent(evt: Event): boolean; -declare function attachEvent(event: string, listener: EventListener): boolean; -declare function detachEvent(event: string, listener: EventListener): void; -declare var localStorage: Storage; -declare var status: string; -declare var onmouseleave: (ev: MouseEvent) => any; -declare var screenLeft: number; -declare var offscreenBuffering: any; -declare var maxConnectionsPerServer: number; -declare var onmouseenter: (ev: MouseEvent) => any; -declare var clipboardData: DataTransfer; -declare var defaultStatus: string; declare var clientInformation: Navigator; declare var closed: boolean; -declare var onhelp: (ev: Event) => any; +declare var crypto: Crypto; +declare var defaultStatus: string; +declare var devicePixelRatio: number; +declare var doNotTrack: string; +declare var document: Document; +declare var event: Event; declare var external: External; -declare var event: MSEventObj; -declare var onfocusout: (ev: FocusEvent) => any; +declare var frameElement: Element; +declare var frames: Window; +declare var history: History; +declare var innerHeight: number; +declare var innerWidth: number; +declare var length: number; +declare var location: Location; +declare var locationbar: BarProp; +declare var menubar: BarProp; +declare var msAnimationStartTime: number; +declare var msTemplatePrinter: MSTemplatePrinter; +declare var name: string; +declare var navigator: Navigator; +declare var offscreenBuffering: string | boolean; +declare var onabort: (ev: Event) => any; +declare var onafterprint: (ev: Event) => any; +declare var onbeforeprint: (ev: Event) => any; +declare var onbeforeunload: (ev: BeforeUnloadEvent) => any; +declare var onblur: (ev: FocusEvent) => any; +declare var oncanplay: (ev: Event) => any; +declare var oncanplaythrough: (ev: Event) => any; +declare var onchange: (ev: Event) => any; +declare var onclick: (ev: MouseEvent) => any; +declare var oncompassneedscalibration: (ev: Event) => any; +declare var oncontextmenu: (ev: PointerEvent) => any; +declare var ondblclick: (ev: MouseEvent) => any; +declare var ondevicemotion: (ev: DeviceMotionEvent) => any; +declare var ondeviceorientation: (ev: DeviceOrientationEvent) => any; +declare var ondrag: (ev: DragEvent) => any; +declare var ondragend: (ev: DragEvent) => any; +declare var ondragenter: (ev: DragEvent) => any; +declare var ondragleave: (ev: DragEvent) => any; +declare var ondragover: (ev: DragEvent) => any; +declare var ondragstart: (ev: DragEvent) => any; +declare var ondrop: (ev: DragEvent) => any; +declare var ondurationchange: (ev: Event) => any; +declare var onemptied: (ev: Event) => any; +declare var onended: (ev: Event) => any; +declare var onerror: ErrorEventHandler; +declare var onfocus: (ev: FocusEvent) => any; +declare var onhashchange: (ev: HashChangeEvent) => any; +declare var oninput: (ev: Event) => any; +declare var onkeydown: (ev: KeyboardEvent) => any; +declare var onkeypress: (ev: KeyboardEvent) => any; +declare var onkeyup: (ev: KeyboardEvent) => any; +declare var onload: (ev: Event) => any; +declare var onloadeddata: (ev: Event) => any; +declare var onloadedmetadata: (ev: Event) => any; +declare var onloadstart: (ev: Event) => any; +declare var onmessage: (ev: MessageEvent) => any; +declare var onmousedown: (ev: MouseEvent) => any; +declare var onmouseenter: (ev: MouseEvent) => any; +declare var onmouseleave: (ev: MouseEvent) => any; +declare var onmousemove: (ev: MouseEvent) => any; +declare var onmouseout: (ev: MouseEvent) => any; +declare var onmouseover: (ev: MouseEvent) => any; +declare var onmouseup: (ev: MouseEvent) => any; +declare var onmousewheel: (ev: MouseWheelEvent) => any; +declare var onmsgesturechange: (ev: MSGestureEvent) => any; +declare var onmsgesturedoubletap: (ev: MSGestureEvent) => any; +declare var onmsgestureend: (ev: MSGestureEvent) => any; +declare var onmsgesturehold: (ev: MSGestureEvent) => any; +declare var onmsgesturestart: (ev: MSGestureEvent) => any; +declare var onmsgesturetap: (ev: MSGestureEvent) => any; +declare var onmsinertiastart: (ev: MSGestureEvent) => any; +declare var onmspointercancel: (ev: MSPointerEvent) => any; +declare var onmspointerdown: (ev: MSPointerEvent) => any; +declare var onmspointerenter: (ev: MSPointerEvent) => any; +declare var onmspointerleave: (ev: MSPointerEvent) => any; +declare var onmspointermove: (ev: MSPointerEvent) => any; +declare var onmspointerout: (ev: MSPointerEvent) => any; +declare var onmspointerover: (ev: MSPointerEvent) => any; +declare var onmspointerup: (ev: MSPointerEvent) => any; +declare var onoffline: (ev: Event) => any; +declare var ononline: (ev: Event) => any; +declare var onorientationchange: (ev: Event) => any; +declare var onpagehide: (ev: PageTransitionEvent) => any; +declare var onpageshow: (ev: PageTransitionEvent) => any; +declare var onpause: (ev: Event) => any; +declare var onplay: (ev: Event) => any; +declare var onplaying: (ev: Event) => any; +declare var onpopstate: (ev: PopStateEvent) => any; +declare var onprogress: (ev: ProgressEvent) => any; +declare var onratechange: (ev: Event) => any; +declare var onreadystatechange: (ev: ProgressEvent) => any; +declare var onreset: (ev: Event) => any; +declare var onresize: (ev: UIEvent) => any; +declare var onscroll: (ev: UIEvent) => any; +declare var onseeked: (ev: Event) => any; +declare var onseeking: (ev: Event) => any; +declare var onselect: (ev: UIEvent) => any; +declare var onstalled: (ev: Event) => any; +declare var onstorage: (ev: StorageEvent) => any; +declare var onsubmit: (ev: Event) => any; +declare var onsuspend: (ev: Event) => any; +declare var ontimeupdate: (ev: Event) => any; +declare var ontouchcancel: any; +declare var ontouchend: any; +declare var ontouchmove: any; +declare var ontouchstart: any; +declare var onunload: (ev: Event) => any; +declare var onvolumechange: (ev: Event) => any; +declare var onwaiting: (ev: Event) => any; +declare var opener: Window; +declare var orientation: string; +declare var outerHeight: number; +declare var outerWidth: number; +declare var pageXOffset: number; +declare var pageYOffset: number; +declare var parent: Window; +declare var performance: Performance; +declare var personalbar: BarProp; +declare var screen: Screen; +declare var screenLeft: number; declare var screenTop: number; -declare var onfocusin: (ev: FocusEvent) => any; -declare function showModelessDialog(url?: string, argument?: any, options?: any): Window; -declare function navigate(url: string): void; -declare function resizeBy(x?: number, y?: number): void; -declare function item(index: any): any; -declare function resizeTo(x?: number, y?: number): void; -declare function createPopup(arguments?: any): MSPopupWindow; -declare function toStaticHTML(html: string): string; -declare function execScript(code: string, language?: string): any; -declare function msWriteProfilerMark(profilerMarkName: string): void; -declare function moveTo(x?: number, y?: number): void; -declare function moveBy(x?: number, y?: number): void; -declare function showHelp(url: string, helpArg?: any, features?: string): void; +declare var screenX: number; +declare var screenY: number; +declare var scrollX: number; +declare var scrollY: number; +declare var scrollbars: BarProp; +declare var self: Window; +declare var status: string; +declare var statusbar: BarProp; +declare var styleMedia: StyleMedia; +declare var toolbar: BarProp; +declare var top: Window; +declare var window: Window; +declare function alert(message?: any): void; +declare function blur(): void; +declare function cancelAnimationFrame(handle: number): void; declare function captureEvents(): void; +declare function close(): void; +declare function confirm(message?: string): boolean; +declare function focus(): void; +declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; +declare function getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; +declare function getSelection(): Selection; +declare function matchMedia(mediaQuery: string): MediaQueryList; +declare function moveBy(x?: number, y?: number): void; +declare function moveTo(x?: number, y?: number): void; +declare function msCancelRequestAnimationFrame(handle: number): void; +declare function msMatchMedia(mediaQuery: string): MediaQueryList; +declare function msRequestAnimationFrame(callback: FrameRequestCallback): number; +declare function msWriteProfilerMark(profilerMarkName: string): void; +declare function open(url?: string, target?: string, features?: string, replace?: boolean): any; +declare function postMessage(message: any, targetOrigin: string, ports?: any): void; +declare function print(): void; +declare function prompt(message?: string, _default?: string): string; declare function releaseEvents(): void; -declare var sessionStorage: Storage; -declare function clearTimeout(handle: number): void; -declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; +declare function requestAnimationFrame(callback: FrameRequestCallback): number; +declare function resizeBy(x?: number, y?: number): void; +declare function resizeTo(x?: number, y?: number): void; +declare function scroll(x?: number, y?: number): void; +declare function scrollBy(x?: number, y?: number): void; +declare function scrollTo(x?: number, y?: number): void; +declare function webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; +declare function webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; +declare function toString(): string; +declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +declare function dispatchEvent(evt: Event): boolean; +declare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; declare function clearInterval(handle: number): void; +declare function clearTimeout(handle: number): void; declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; -declare function msSetImmediate(expression: any, ...args: any[]): number; +declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; declare function clearImmediate(handle: number): void; declare function msClearImmediate(handle: number): void; +declare function msSetImmediate(expression: any, ...args: any[]): number; declare function setImmediate(expression: any, ...args: any[]): number; -declare function btoa(rawString: string): string; -declare function atob(encodedString: string): string; -declare var msIndexedDB: IDBFactory; -declare var indexedDB: IDBFactory; +declare var sessionStorage: Storage; +declare var localStorage: Storage; declare var console: Console; -declare var onpointerenter: (ev: PointerEvent) => any; -declare var onpointerout: (ev: PointerEvent) => any; -declare var onpointerdown: (ev: PointerEvent) => any; -declare var onpointerup: (ev: PointerEvent) => any; declare var onpointercancel: (ev: PointerEvent) => any; -declare var onpointerover: (ev: PointerEvent) => any; -declare var onpointermove: (ev: PointerEvent) => any; +declare var onpointerdown: (ev: PointerEvent) => any; +declare var onpointerenter: (ev: PointerEvent) => any; declare var onpointerleave: (ev: PointerEvent) => any; -declare function addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var onpointermove: (ev: PointerEvent) => any; +declare var onpointerout: (ev: PointerEvent) => any; +declare var onpointerover: (ev: PointerEvent) => any; +declare var onpointerup: (ev: PointerEvent) => any; +declare var onwheel: (ev: WheelEvent) => any; +declare var indexedDB: IDBFactory; +declare var msIndexedDB: IDBFactory; +declare function atob(encodedString: string): string; +declare function btoa(rawString: string): string; +declare function addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; declare function addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "compassneedscalibration", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; declare function addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; declare function addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; declare function addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; - +declare function addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; ///////////////////////////// /// WorkerGlobalScope APIs ///////////////////////////// @@ -14240,13 +16514,16 @@ 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. + * 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; } @@ -14256,10 +16533,12 @@ 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. */ @@ -14268,37 +16547,43 @@ interface TextStreamWriter extends TextStreamBase { interface TextStreamReader extends TextStreamBase { /** - * Returns a specified number of characters from an input stream, beginning at the current pointer position. + * Returns a specified number of characters from an input stream, starting 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. */ @@ -14307,85 +16592,180 @@ interface TextStreamReader extends TextStreamBase { 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). + * Outputs text to either a message box (under WScript.exe) or the command console window followed by + * a newline (under CScript.exe). */ 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 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; }; + +/** + * Allows enumerating over a COM collection, which may not have indexed item access. + */ +interface Enumerator { + /** + * Returns true if the current item is the last one in the collection, or the collection is empty, + * or the current item is undefined. + */ + atEnd(): boolean; + + /** + * Returns the current item in the collection + */ + item(): T; + + /** + * Resets the current item in the collection to the first item. If there are no items in the collection, + * the current item is set to undefined. + */ + moveFirst(): void; + + /** + * Moves the current item to the next item in the collection. If the enumerator is at the end of + * the collection or the collection is empty, the current item is set to undefined. + */ + moveNext(): void; +} + +interface EnumeratorConstructor { + new (collection: any): Enumerator; + new (collection: any): Enumerator; +} + +declare var Enumerator: EnumeratorConstructor; + +/** + * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions. + */ +interface VBArray { + /** + * Returns the number of dimensions (1-based). + */ + dimensions(): number; + + /** + * Takes an index for each dimension in the array, and returns the item at the corresponding location. + */ + getItem(dimension1Index: number, ...dimensionNIndexes: number[]): T; + + /** + * Returns the smallest available index for a given dimension. + * @param dimension 1-based dimension (defaults to 1) + */ + lbound(dimension?: number): number; + + /** + * Returns the largest available index for a given dimension. + * @param dimension 1-based dimension (defaults to 1) + */ + ubound(dimension?: number): number; + + /** + * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions, + * each successive dimension is appended to the end of the array. + * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6] + */ + toArray(): T[]; +} + +interface VBArrayConstructor { + new (safeArray: any): VBArray; + new (safeArray: any): VBArray; +} + +declare var VBArray: VBArrayConstructor; diff --git a/bin/lib.dom.d.ts b/bin/lib.dom.d.ts index 16f12be029a..2c970a1cf52 100644 --- a/bin/lib.dom.d.ts +++ b/bin/lib.dom.d.ts @@ -37,38 +37,216 @@ interface ArrayBuffer { slice(begin:number, end?:number): ArrayBuffer; } -declare var ArrayBuffer: { +interface ArrayBufferConstructor { prototype: ArrayBuffer; new (byteLength: number): ArrayBuffer; + isView(arg: any): boolean; } +declare var ArrayBuffer: ArrayBufferConstructor; interface ArrayBufferView { + /** + * The ArrayBuffer instance referenced by the array. + */ buffer: ArrayBuffer; - byteOffset: number; + + /** + * The length in bytes of the array. + */ byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; } /** - * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. */ -interface Int8Array extends ArrayBufferView { +interface Int8Array { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Int8Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Int8Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): Int8Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. */ - get(index: number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Int8Array; /** * Sets a value or an array of values. @@ -84,49 +262,256 @@ interface Int8Array extends ArrayBufferView { */ set(array: Int8Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Int8Array; /** - * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements at begin, inclusive, up to end, exclusive. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Int8Array; + + /** + * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Int8Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Int8Array: { +interface Int8ArrayConstructor { prototype: Int8Array; new (length: number): Int8Array; new (array: Int8Array): Int8Array; new (array: number[]): Int8Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Int8Array; +} +declare var Int8Array: Int8ArrayConstructor; + +/** + * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Uint8Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Uint8Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): Uint8Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint8Array; /** * Sets a value or an array of values. @@ -142,49 +527,257 @@ interface Uint8Array extends ArrayBufferView { */ set(array: Uint8Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Uint8Array; /** - * Gets a new Uint8Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Uint8Array; + + /** + * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Uint8Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Uint8Array: { + +interface Uint8ArrayConstructor { prototype: Uint8Array; new (length: number): Uint8Array; new (array: Uint8Array): Uint8Array; new (array: number[]): Uint8Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 16-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Int16Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint8Array; +} +declare var Uint8Array: Uint8ArrayConstructor; + +/** + * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int16Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Int16Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Int16Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): Int16Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Int16Array; /** * Sets a value or an array of values. @@ -200,49 +793,257 @@ interface Int16Array extends ArrayBufferView { */ set(array: Int16Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Int16Array; /** - * Gets a new Int16Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Int16Array; + + /** + * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Int16Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Int16Array: { + +interface Int16ArrayConstructor { prototype: Int16Array; new (length: number): Int16Array; new (array: Int16Array): Int16Array; new (array: number[]): Int16Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint16Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Int16Array; +} +declare var Int16Array: Int16ArrayConstructor; + +/** + * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint16Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Uint16Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Uint16Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): Uint16Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint16Array; /** * Sets a value or an array of values. @@ -258,49 +1059,256 @@ interface Uint16Array extends ArrayBufferView { */ set(array: Uint16Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Uint16Array; /** - * Gets a new Uint16Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Uint16Array; + + /** + * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Uint16Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Uint16Array: { + +interface Uint16ArrayConstructor { prototype: Uint16Array; new (length: number): Uint16Array; new (array: Uint16Array): Uint16Array; new (array: number[]): Uint16Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 32-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Int32Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint16Array; +} +declare var Uint16Array: Uint16ArrayConstructor; +/** + * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int32Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Int32Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Int32Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): Int32Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Int32Array; /** * Sets a value or an array of values. @@ -316,49 +1324,257 @@ interface Int32Array extends ArrayBufferView { */ set(array: Int32Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Int32Array; /** - * Gets a new Int32Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Int32Array; + + /** + * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Int32Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Int32Array: { + +interface Int32ArrayConstructor { prototype: Int32Array; new (length: number): Int32Array; new (array: Int32Array): Int32Array; new (array: number[]): Int32Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint32Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Int32Array; +} +declare var Int32Array: Int32ArrayConstructor; + +/** + * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint32Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Uint32Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Uint32Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): Uint32Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint32Array; /** * Sets a value or an array of values. @@ -374,49 +1590,257 @@ interface Uint32Array extends ArrayBufferView { */ set(array: Uint32Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Uint32Array; /** - * Gets a new Int8Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Uint32Array; + + /** + * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Uint32Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Uint32Array: { + +interface Uint32ArrayConstructor { prototype: Uint32Array; new (length: number): Uint32Array; new (array: Uint32Array): Uint32Array; new (array: number[]): Uint32Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Float32Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint32Array; +} +declare var Uint32Array: Uint32ArrayConstructor; + +/** + * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number + * of bytes could not be allocated an exception is raised. + */ +interface Float32Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Float32Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Float32Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): Float32Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Float32Array; /** * Sets a value or an array of values. @@ -432,49 +1856,257 @@ interface Float32Array extends ArrayBufferView { */ set(array: Float32Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Float32Array; /** - * Gets a new Float32Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Float32Array; + + /** + * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Float32Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Float32Array: { + +interface Float32ArrayConstructor { prototype: Float32Array; new (length: number): Float32Array; new (array: Float32Array): Float32Array; new (array: number[]): Float32Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 64-bit float values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Float64Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Float32Array; +} +declare var Float32Array: Float32ArrayConstructor; + +/** + * A typed array of 64-bit float values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Float64Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Float64Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Float64Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): Float64Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Float64Array; /** * Sets a value or an array of values. @@ -490,191 +2122,70 @@ interface Float64Array extends ArrayBufferView { */ set(array: Float64Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Float64Array; /** - * Gets a new Float64Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Float64Array; + + /** + * Gets a new Float64Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Float64Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Float64Array: { + +interface Float64ArrayConstructor { prototype: Float64Array; new (length: number): Float64Array; new (array: Float64Array): Float64Array; new (array: number[]): Float64Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array; + + /** + * The size in bytes of each element in the array. + */ BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Float64Array; } - -/** - * You can use a DataView object to read and write the different kinds of binary data to any location in the ArrayBuffer. - */ -interface DataView extends ArrayBufferView { - /** - * Gets the Int8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt8(byteOffset: number): number; - - /** - * Gets the Uint8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint8(byteOffset: number): number; - - /** - * Gets the Int16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt16(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Uint16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint16(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Int32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Uint32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Float32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Float64 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat64(byteOffset: number, littleEndian?: boolean): number; - - /** - * Stores an Int8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setInt8(byteOffset: number, value: number): void; - - /** - * Stores an Uint8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setUint8(byteOffset: number, value: number): void; - - /** - * Stores an Int16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setInt16(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Uint16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setUint16(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Int32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setInt32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Uint32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setUint32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Float32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Float64 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void; -} -declare var DataView: { - prototype: DataView; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): DataView; -} - -///////////////////////////// -/// IE11 ECMAScript Extensions -///////////////////////////// - -interface Map { - clear(): void; - delete(key: K): boolean; - forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; - get(key: K): V; - has(key: K): boolean; - set(key: K, value: V): Map; - size: number; -} -declare var Map: { - new (): Map; - prototype: Map; -} - -interface WeakMap { - clear(): void; - delete(key: K): boolean; - get(key: K): V; - has(key: K): boolean; - set(key: K, value: V): WeakMap; -} -declare var WeakMap: { - new (): WeakMap; - prototype: WeakMap; -} - -interface Set { - add(value: T): Set; - clear(): void; - delete(value: T): boolean; - forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; - has(value: T): boolean; - size: number; -} -declare var Set: { - new (): Set; - prototype: Set; -} -///////////////////////////// +declare var Float64Array: Float64ArrayConstructor;///////////////////////////// /// ECMAScript Internationalization API ///////////////////////////// @@ -842,36 +2353,99 @@ interface Date { toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string; } + ///////////////////////////// /// IE DOM APIs ///////////////////////////// - -interface PositionOptions { - enableHighAccuracy?: boolean; - timeout?: number; - maximumAge?: number; +interface Algorithm { + name?: string; } -interface ObjectURLOptions { - oneTimeOnly?: boolean; +interface AriaRequestEventInit extends EventInit { + attributeName?: string; + attributeValue?: string; } -interface StoreExceptionsInformation extends ExceptionInformation { - siteName?: string; - explanationString?: string; - detailURI?: string; +interface ClipboardEventInit extends EventInit { + data?: string; + dataType?: string; } -interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation { - arrayOfDomainStrings?: string[]; +interface CommandEventInit extends EventInit { + commandName?: string; + detail?: string; +} + +interface CompositionEventInit extends UIEventInit { + data?: string; } interface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation { arrayOfDomainStrings?: string[]; } -interface AlgorithmParameters { +interface CustomEventInit extends EventInit { + detail?: any; +} + +interface DeviceAccelerationDict { + x?: number; + y?: number; + z?: number; +} + +interface DeviceRotationRateDict { + alpha?: number; + beta?: number; + gamma?: number; +} + +interface EventInit { + bubbles?: boolean; + cancelable?: boolean; +} + +interface ExceptionInformation { + domain?: string; +} + +interface FocusEventInit extends UIEventInit { + relatedTarget?: EventTarget; +} + +interface HashChangeEventInit extends EventInit { + newURL?: string; + oldURL?: string; +} + +interface KeyAlgorithm { + name?: string; +} + +interface KeyboardEventInit extends SharedKeyboardAndMouseEventInit { + key?: string; + location?: number; + repeat?: boolean; +} + +interface MouseEventInit extends SharedKeyboardAndMouseEventInit { + screenX?: number; + screenY?: number; + clientX?: number; + clientY?: number; + button?: number; + buttons?: number; + relatedTarget?: EventTarget; +} + +interface MsZoomToOptions { + contentX?: number; + contentY?: number; + viewportX?: string; + viewportY?: string; + scaleFactor?: number; + animate?: string; } interface MutationObserverInit { @@ -884,6 +2458,10 @@ interface MutationObserverInit { attributeFilter?: string[]; } +interface ObjectURLOptions { + oneTimeOnly?: boolean; +} + interface PointerEventInit extends MouseEventInit { pointerId?: number; width?: number; @@ -895,52 +2473,43 @@ interface PointerEventInit extends MouseEventInit { isPrimary?: boolean; } -interface ExceptionInformation { - domain?: string; +interface PositionOptions { + enableHighAccuracy?: boolean; + timeout?: number; + maximumAge?: number; } -interface DeviceAccelerationDict { - x?: number; - y?: number; - z?: number; -} - -interface MsZoomToOptions { - contentX?: number; - contentY?: number; - viewportX?: string; - viewportY?: string; - scaleFactor?: number; - animate?: string; -} - -interface DeviceRotationRateDict { - alpha?: number; - beta?: number; - gamma?: number; -} - -interface Algorithm { - name?: string; - params?: AlgorithmParameters; -} - -interface MouseEventInit { - bubbles?: boolean; - cancelable?: boolean; - view?: Window; - detail?: number; - screenX?: number; - screenY?: number; - clientX?: number; - clientY?: number; +interface SharedKeyboardAndMouseEventInit extends UIEventInit { ctrlKey?: boolean; shiftKey?: boolean; altKey?: boolean; metaKey?: boolean; - button?: number; - buttons?: number; - relatedTarget?: EventTarget; + keyModifierStateAltGraph?: boolean; + keyModifierStateCapsLock?: boolean; + keyModifierStateFn?: boolean; + keyModifierStateFnLock?: boolean; + keyModifierStateHyper?: boolean; + keyModifierStateNumLock?: boolean; + keyModifierStateOS?: boolean; + keyModifierStateScrollLock?: boolean; + keyModifierStateSuper?: boolean; + keyModifierStateSymbol?: boolean; + keyModifierStateSymbolLock?: boolean; +} + +interface StoreExceptionsInformation extends ExceptionInformation { + siteName?: string; + explanationString?: string; + detailURI?: string; +} + +interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation { + arrayOfDomainStrings?: string[]; +} + +interface UIEventInit extends EventInit { + view?: Window; + detail?: number; } interface WebGLContextAttributes { @@ -952,526 +2521,1863 @@ interface WebGLContextAttributes { preserveDrawingBuffer?: boolean; } -interface NodeListOf extends NodeList { - length: number; - item(index: number): TNode; - [index: number]: TNode; +interface WebGLContextEventInit extends EventInit { + statusMessage?: string; } -interface HTMLElement extends Element, ElementCSSInlineStyle, MSEventAttachmentTarget, MSNodeExtensions { - hidden: any; - readyState: any; - onmouseleave: (ev: MouseEvent) => any; - onbeforecut: (ev: DragEvent) => any; - onkeydown: (ev: KeyboardEvent) => any; - onmove: (ev: MSEventObj) => any; - onkeyup: (ev: KeyboardEvent) => any; - onreset: (ev: Event) => any; - onhelp: (ev: Event) => any; - ondragleave: (ev: DragEvent) => any; - className: string; - onfocusin: (ev: FocusEvent) => any; - onseeked: (ev: Event) => any; - recordNumber: any; - title: string; - parentTextEdit: Element; - outerHTML: string; - ondurationchange: (ev: Event) => any; - offsetHeight: number; - all: HTMLCollection; - onblur: (ev: FocusEvent) => any; - dir: string; - onemptied: (ev: Event) => any; - onseeking: (ev: Event) => any; - oncanplay: (ev: Event) => any; - ondeactivate: (ev: UIEvent) => any; - ondatasetchanged: (ev: MSEventObj) => any; - onrowsdelete: (ev: MSEventObj) => any; - sourceIndex: number; - onloadstart: (ev: Event) => any; - onlosecapture: (ev: MSEventObj) => any; - ondragenter: (ev: DragEvent) => any; - oncontrolselect: (ev: MSEventObj) => any; - onsubmit: (ev: Event) => any; - behaviorUrns: MSBehaviorUrnsCollection; - scopeName: string; - onchange: (ev: Event) => any; - id: string; - onlayoutcomplete: (ev: MSEventObj) => any; - uniqueID: string; - onbeforeactivate: (ev: UIEvent) => any; - oncanplaythrough: (ev: Event) => any; - onbeforeupdate: (ev: MSEventObj) => any; - onfilterchange: (ev: MSEventObj) => any; - offsetParent: Element; - ondatasetcomplete: (ev: MSEventObj) => any; - onsuspend: (ev: Event) => any; - onmouseenter: (ev: MouseEvent) => any; - innerText: string; - onerrorupdate: (ev: MSEventObj) => any; - onmouseout: (ev: MouseEvent) => any; - parentElement: HTMLElement; - onmousewheel: (ev: MouseWheelEvent) => any; - onvolumechange: (ev: Event) => any; - oncellchange: (ev: MSEventObj) => any; - onrowexit: (ev: MSEventObj) => any; - onrowsinserted: (ev: MSEventObj) => any; - onpropertychange: (ev: MSEventObj) => any; - filters: any; - children: HTMLCollection; - ondragend: (ev: DragEvent) => any; - onbeforepaste: (ev: DragEvent) => any; - ondragover: (ev: DragEvent) => any; - offsetTop: number; - onmouseup: (ev: MouseEvent) => any; - ondragstart: (ev: DragEvent) => any; - onbeforecopy: (ev: DragEvent) => any; - ondrag: (ev: DragEvent) => any; - innerHTML: string; - onmouseover: (ev: MouseEvent) => any; - lang: string; - uniqueNumber: number; - onpause: (ev: Event) => any; - tagUrn: string; - onmousedown: (ev: MouseEvent) => any; - onclick: (ev: MouseEvent) => any; - onwaiting: (ev: Event) => any; - onresizestart: (ev: MSEventObj) => any; - offsetLeft: number; - isTextEdit: boolean; - isDisabled: boolean; - onpaste: (ev: DragEvent) => any; - canHaveHTML: boolean; - onmoveend: (ev: MSEventObj) => any; - language: string; - onstalled: (ev: Event) => any; - onmousemove: (ev: MouseEvent) => any; - style: MSStyleCSSProperties; - isContentEditable: boolean; - onbeforeeditfocus: (ev: MSEventObj) => any; - onratechange: (ev: Event) => any; - contentEditable: string; - tabIndex: number; - document: Document; +interface WheelEventInit extends MouseEventInit { + deltaX?: number; + deltaY?: number; + deltaZ?: number; + deltaMode?: number; +} + +interface EventListener { + (evt: Event): void; +} + +interface ANGLE_instanced_arrays { + drawArraysInstancedANGLE(mode: number, first: number, count: number, primcount: number): void; + drawElementsInstancedANGLE(mode: number, count: number, type: number, offset: number, primcount: number): void; + vertexAttribDivisorANGLE(index: number, divisor: number): void; + VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; +} + +declare var ANGLE_instanced_arrays: { + prototype: ANGLE_instanced_arrays; + new(): ANGLE_instanced_arrays; + VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; +} + +interface AnalyserNode extends AudioNode { + fftSize: number; + frequencyBinCount: number; + maxDecibels: number; + minDecibels: number; + smoothingTimeConstant: number; + getByteFrequencyData(array: Uint8Array): void; + getByteTimeDomainData(array: Uint8Array): void; + getFloatFrequencyData(array: any): void; + getFloatTimeDomainData(array: any): void; +} + +declare var AnalyserNode: { + prototype: AnalyserNode; + new(): AnalyserNode; +} + +interface AnimationEvent extends Event { + animationName: string; + elapsedTime: number; + initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void; +} + +declare var AnimationEvent: { + prototype: AnimationEvent; + new(): AnimationEvent; +} + +interface ApplicationCache extends EventTarget { + oncached: (ev: Event) => any; + onchecking: (ev: Event) => any; + ondownloading: (ev: Event) => any; + onerror: (ev: Event) => any; + onnoupdate: (ev: Event) => any; + onobsolete: (ev: Event) => any; onprogress: (ev: ProgressEvent) => any; - ondblclick: (ev: MouseEvent) => any; - oncontextmenu: (ev: MouseEvent) => any; - onloadedmetadata: (ev: Event) => any; - onafterupdate: (ev: MSEventObj) => any; - onerror: (ev: ErrorEvent) => any; - onplay: (ev: Event) => any; - onresizeend: (ev: MSEventObj) => any; - onplaying: (ev: Event) => any; - isMultiLine: boolean; - onfocusout: (ev: FocusEvent) => any; - onabort: (ev: UIEvent) => any; - ondataavailable: (ev: MSEventObj) => any; - hideFocus: boolean; - onreadystatechange: (ev: Event) => any; - onkeypress: (ev: KeyboardEvent) => any; - onloadeddata: (ev: Event) => any; - onbeforedeactivate: (ev: UIEvent) => any; - outerText: string; - disabled: boolean; - onactivate: (ev: UIEvent) => any; - accessKey: string; - onmovestart: (ev: MSEventObj) => any; - onselectstart: (ev: Event) => any; - onfocus: (ev: FocusEvent) => any; - ontimeupdate: (ev: Event) => any; - onresize: (ev: UIEvent) => any; - oncut: (ev: DragEvent) => any; - onselect: (ev: UIEvent) => any; - ondrop: (ev: DragEvent) => any; - offsetWidth: number; - oncopy: (ev: DragEvent) => any; - onended: (ev: Event) => any; - onscroll: (ev: UIEvent) => any; - onrowenter: (ev: MSEventObj) => any; - onload: (ev: Event) => any; - canHaveChildren: boolean; - oninput: (ev: Event) => any; - onmscontentzoom: (ev: MSEventObj) => any; - oncuechange: (ev: Event) => any; - spellcheck: boolean; - classList: DOMTokenList; - onmsmanipulationstatechanged: (ev: any) => any; - draggable: boolean; - dataset: DOMStringMap; - dragDrop(): boolean; - scrollIntoView(top?: boolean): void; - addFilter(filter: any): void; - setCapture(containerCapture?: boolean): void; - focus(): void; - getAdjacentText(where: string): string; - insertAdjacentText(where: string, text: string): void; - getElementsByClassName(classNames: string): NodeList; - setActive(): void; - removeFilter(filter: any): void; - blur(): void; - clearAttributes(): void; - releaseCapture(): void; - createControlRange(): ControlRangeCollection; - removeBehavior(cookie: number): boolean; - contains(child: HTMLElement): boolean; - click(): void; - insertAdjacentElement(position: string, insertedElement: Element): Element; - mergeAttributes(source: HTMLElement, preserveIdentity?: boolean): void; - replaceAdjacentText(where: string, newText: string): string; - applyElement(apply: Element, where?: string): Element; - addBehavior(bstrUrl: string, factory?: any): number; - insertAdjacentHTML(where: string, html: string): void; - msGetInputContext(): MSInputMethodContext; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + onupdateready: (ev: Event) => any; + status: number; + abort(): void; + swapCache(): void; + update(): void; + CHECKING: number; + DOWNLOADING: number; + IDLE: number; + OBSOLETE: number; + UNCACHED: number; + UPDATEREADY: number; + addEventListener(type: "cached", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "checking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "downloading", listener: (ev: Event) => any, useCapture?: boolean): void; addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLElement: { - prototype: HTMLElement; - new(): HTMLElement; + addEventListener(type: "noupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "obsolete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "updateready", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface Document extends Node, NodeSelector, MSEventAttachmentTarget, DocumentEvent, MSResourceMetadata, MSNodeExtensions, MSDocumentExtensions, GlobalEventHandlers { +declare var ApplicationCache: { + prototype: ApplicationCache; + new(): ApplicationCache; + CHECKING: number; + DOWNLOADING: number; + IDLE: number; + OBSOLETE: number; + UNCACHED: number; + UPDATEREADY: number; +} + +interface AriaRequestEvent extends Event { + attributeName: string; + attributeValue: string; +} + +declare var AriaRequestEvent: { + prototype: AriaRequestEvent; + new(type: string, eventInitDict?: AriaRequestEventInit): AriaRequestEvent; +} + +interface Attr extends Node { + name: string; + ownerElement: Element; + specified: boolean; + value: string; +} + +declare var Attr: { + prototype: Attr; + new(): Attr; +} + +interface AudioBuffer { + duration: number; + length: number; + numberOfChannels: number; + sampleRate: number; + getChannelData(channel: number): any; +} + +declare var AudioBuffer: { + prototype: AudioBuffer; + new(): AudioBuffer; +} + +interface AudioBufferSourceNode extends AudioNode { + buffer: AudioBuffer; + loop: boolean; + loopEnd: number; + loopStart: number; + onended: (ev: Event) => any; + playbackRate: AudioParam; + start(when?: number, offset?: number, duration?: number): void; + stop(when?: number): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var AudioBufferSourceNode: { + prototype: AudioBufferSourceNode; + new(): AudioBufferSourceNode; +} + +interface AudioContext extends EventTarget { + currentTime: number; + destination: AudioDestinationNode; + listener: AudioListener; + sampleRate: number; + createAnalyser(): AnalyserNode; + createBiquadFilter(): BiquadFilterNode; + createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer; + createBufferSource(): AudioBufferSourceNode; + createChannelMerger(numberOfInputs?: number): ChannelMergerNode; + createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode; + createConvolver(): ConvolverNode; + createDelay(maxDelayTime?: number): DelayNode; + createDynamicsCompressor(): DynamicsCompressorNode; + createGain(): GainNode; + createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode; + createOscillator(): OscillatorNode; + createPanner(): PannerNode; + createPeriodicWave(real: any, imag: any): PeriodicWave; + createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode; + createStereoPanner(): StereoPannerNode; + createWaveShaper(): WaveShaperNode; + decodeAudioData(audioData: ArrayBuffer, successCallback: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): void; +} + +declare var AudioContext: { + prototype: AudioContext; + new(): AudioContext; +} + +interface AudioDestinationNode extends AudioNode { + maxChannelCount: number; +} + +declare var AudioDestinationNode: { + prototype: AudioDestinationNode; + new(): AudioDestinationNode; +} + +interface AudioListener { + dopplerFactor: number; + speedOfSound: number; + setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void; + setPosition(x: number, y: number, z: number): void; + setVelocity(x: number, y: number, z: number): void; +} + +declare var AudioListener: { + prototype: AudioListener; + new(): AudioListener; +} + +interface AudioNode extends EventTarget { + channelCount: number; + channelCountMode: string; + channelInterpretation: string; + context: AudioContext; + numberOfInputs: number; + numberOfOutputs: number; + connect(destination: AudioNode, output?: number, input?: number): void; + disconnect(output?: number): void; +} + +declare var AudioNode: { + prototype: AudioNode; + new(): AudioNode; +} + +interface AudioParam { + defaultValue: number; + value: number; + cancelScheduledValues(startTime: number): void; + exponentialRampToValueAtTime(value: number, endTime: number): void; + linearRampToValueAtTime(value: number, endTime: number): void; + setTargetAtTime(target: number, startTime: number, timeConstant: number): void; + setValueAtTime(value: number, startTime: number): void; + setValueCurveAtTime(values: any, startTime: number, duration: number): void; +} + +declare var AudioParam: { + prototype: AudioParam; + new(): AudioParam; +} + +interface AudioProcessingEvent extends Event { + inputBuffer: AudioBuffer; + outputBuffer: AudioBuffer; + playbackTime: number; +} + +declare var AudioProcessingEvent: { + prototype: AudioProcessingEvent; + new(): AudioProcessingEvent; +} + +interface AudioTrack { + enabled: boolean; + id: string; + kind: string; + label: string; + language: string; + sourceBuffer: SourceBuffer; +} + +declare var AudioTrack: { + prototype: AudioTrack; + new(): AudioTrack; +} + +interface AudioTrackList extends EventTarget { + length: number; + onaddtrack: (ev: TrackEvent) => any; + onchange: (ev: Event) => any; + onremovetrack: (ev: TrackEvent) => any; + getTrackById(id: string): AudioTrack; + item(index: number): AudioTrack; + addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "removetrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: AudioTrack; +} + +declare var AudioTrackList: { + prototype: AudioTrackList; + new(): AudioTrackList; +} + +interface BarProp { + visible: boolean; +} + +declare var BarProp: { + prototype: BarProp; + new(): BarProp; +} + +interface BeforeUnloadEvent extends Event { + returnValue: any; +} + +declare var BeforeUnloadEvent: { + prototype: BeforeUnloadEvent; + new(): BeforeUnloadEvent; +} + +interface BiquadFilterNode extends AudioNode { + Q: AudioParam; + detune: AudioParam; + frequency: AudioParam; + gain: AudioParam; + type: string; + getFrequencyResponse(frequencyHz: any, magResponse: any, phaseResponse: any): void; +} + +declare var BiquadFilterNode: { + prototype: BiquadFilterNode; + new(): BiquadFilterNode; +} + +interface Blob { + size: number; + type: string; + msClose(): void; + msDetachStream(): any; + slice(start?: number, end?: number, contentType?: string): Blob; +} + +declare var Blob: { + prototype: Blob; + new (blobParts?: any[], options?: BlobPropertyBag): Blob; +} + +interface CDATASection extends Text { +} + +declare var CDATASection: { + prototype: CDATASection; + new(): CDATASection; +} + +interface CSS { + supports(property: string, value?: string): boolean; +} +declare var CSS: CSS; + +interface CSSConditionRule extends CSSGroupingRule { + conditionText: string; +} + +declare var CSSConditionRule: { + prototype: CSSConditionRule; + new(): CSSConditionRule; +} + +interface CSSFontFaceRule extends CSSRule { + style: CSSStyleDeclaration; +} + +declare var CSSFontFaceRule: { + prototype: CSSFontFaceRule; + new(): CSSFontFaceRule; +} + +interface CSSGroupingRule extends CSSRule { + cssRules: CSSRuleList; + deleteRule(index?: number): void; + insertRule(rule: string, index?: number): number; +} + +declare var CSSGroupingRule: { + prototype: CSSGroupingRule; + new(): CSSGroupingRule; +} + +interface CSSImportRule extends CSSRule { + href: string; + media: MediaList; + styleSheet: CSSStyleSheet; +} + +declare var CSSImportRule: { + prototype: CSSImportRule; + new(): CSSImportRule; +} + +interface CSSKeyframeRule extends CSSRule { + keyText: string; + style: CSSStyleDeclaration; +} + +declare var CSSKeyframeRule: { + prototype: CSSKeyframeRule; + new(): CSSKeyframeRule; +} + +interface CSSKeyframesRule extends CSSRule { + cssRules: CSSRuleList; + name: string; + appendRule(rule: string): void; + deleteRule(rule: string): void; + findRule(rule: string): CSSKeyframeRule; +} + +declare var CSSKeyframesRule: { + prototype: CSSKeyframesRule; + new(): CSSKeyframesRule; +} + +interface CSSMediaRule extends CSSConditionRule { + media: MediaList; +} + +declare var CSSMediaRule: { + prototype: CSSMediaRule; + new(): CSSMediaRule; +} + +interface CSSNamespaceRule extends CSSRule { + namespaceURI: string; + prefix: string; +} + +declare var CSSNamespaceRule: { + prototype: CSSNamespaceRule; + new(): CSSNamespaceRule; +} + +interface CSSPageRule extends CSSRule { + pseudoClass: string; + selector: string; + selectorText: string; + style: CSSStyleDeclaration; +} + +declare var CSSPageRule: { + prototype: CSSPageRule; + new(): CSSPageRule; +} + +interface CSSRule { + cssText: string; + parentRule: CSSRule; + parentStyleSheet: CSSStyleSheet; + type: number; + CHARSET_RULE: number; + FONT_FACE_RULE: number; + IMPORT_RULE: number; + KEYFRAMES_RULE: number; + KEYFRAME_RULE: number; + MEDIA_RULE: number; + NAMESPACE_RULE: number; + PAGE_RULE: number; + STYLE_RULE: number; + SUPPORTS_RULE: number; + UNKNOWN_RULE: number; + VIEWPORT_RULE: number; +} + +declare var CSSRule: { + prototype: CSSRule; + new(): CSSRule; + CHARSET_RULE: number; + FONT_FACE_RULE: number; + IMPORT_RULE: number; + KEYFRAMES_RULE: number; + KEYFRAME_RULE: number; + MEDIA_RULE: number; + NAMESPACE_RULE: number; + PAGE_RULE: number; + STYLE_RULE: number; + SUPPORTS_RULE: number; + UNKNOWN_RULE: number; + VIEWPORT_RULE: number; +} + +interface CSSRuleList { + length: number; + item(index: number): CSSRule; + [index: number]: CSSRule; +} + +declare var CSSRuleList: { + prototype: CSSRuleList; + new(): CSSRuleList; +} + +interface CSSStyleDeclaration { + alignContent: string; + alignItems: string; + alignSelf: string; + alignmentBaseline: string; + animation: string; + animationDelay: string; + animationDirection: string; + animationDuration: string; + animationFillMode: string; + animationIterationCount: string; + animationName: string; + animationPlayState: string; + animationTimingFunction: string; + backfaceVisibility: string; + background: string; + backgroundAttachment: string; + backgroundClip: string; + backgroundColor: string; + backgroundImage: string; + backgroundOrigin: string; + backgroundPosition: string; + backgroundPositionX: string; + backgroundPositionY: string; + backgroundRepeat: string; + backgroundSize: string; + baselineShift: string; + border: string; + borderBottom: string; + borderBottomColor: string; + borderBottomLeftRadius: string; + borderBottomRightRadius: string; + borderBottomStyle: string; + borderBottomWidth: string; + borderCollapse: string; + borderColor: string; + borderImage: string; + borderImageOutset: string; + borderImageRepeat: string; + borderImageSlice: string; + borderImageSource: string; + borderImageWidth: string; + borderLeft: string; + borderLeftColor: string; + borderLeftStyle: string; + borderLeftWidth: string; + borderRadius: string; + borderRight: string; + borderRightColor: string; + borderRightStyle: string; + borderRightWidth: string; + borderSpacing: string; + borderStyle: string; + borderTop: string; + borderTopColor: string; + borderTopLeftRadius: string; + borderTopRightRadius: string; + borderTopStyle: string; + borderTopWidth: string; + borderWidth: string; + bottom: string; + boxShadow: string; + boxSizing: string; + breakAfter: string; + breakBefore: string; + breakInside: string; + captionSide: string; + clear: string; + clip: string; + clipPath: string; + clipRule: string; + color: string; + colorInterpolationFilters: string; + columnCount: any; + columnFill: string; + columnGap: any; + columnRule: string; + columnRuleColor: any; + columnRuleStyle: string; + columnRuleWidth: any; + columnSpan: string; + columnWidth: any; + columns: string; + content: string; + counterIncrement: string; + counterReset: string; + cssFloat: string; + cssText: string; + cursor: string; + direction: string; + display: string; + dominantBaseline: string; + emptyCells: string; + enableBackground: string; + fill: string; + fillOpacity: string; + fillRule: string; + filter: string; + flex: string; + flexBasis: string; + flexDirection: string; + flexFlow: string; + flexGrow: string; + flexShrink: string; + flexWrap: string; + floodColor: string; + floodOpacity: string; + font: string; + fontFamily: string; + fontFeatureSettings: string; + fontSize: string; + fontSizeAdjust: string; + fontStretch: string; + fontStyle: string; + fontVariant: string; + fontWeight: string; + glyphOrientationHorizontal: string; + glyphOrientationVertical: string; + height: string; + imeMode: string; + justifyContent: string; + kerning: string; + left: string; + length: number; + letterSpacing: string; + lightingColor: string; + lineHeight: string; + listStyle: string; + listStyleImage: string; + listStylePosition: string; + listStyleType: string; + margin: string; + marginBottom: string; + marginLeft: string; + marginRight: string; + marginTop: string; + marker: string; + markerEnd: string; + markerMid: string; + markerStart: string; + mask: string; + maxHeight: string; + maxWidth: string; + minHeight: string; + minWidth: string; + msContentZoomChaining: string; + msContentZoomLimit: string; + msContentZoomLimitMax: any; + msContentZoomLimitMin: any; + msContentZoomSnap: string; + msContentZoomSnapPoints: string; + msContentZoomSnapType: string; + msContentZooming: string; + msFlowFrom: string; + msFlowInto: string; + msFontFeatureSettings: string; + msGridColumn: any; + msGridColumnAlign: string; + msGridColumnSpan: any; + msGridColumns: string; + msGridRow: any; + msGridRowAlign: string; + msGridRowSpan: any; + msGridRows: string; + msHighContrastAdjust: string; + msHyphenateLimitChars: string; + msHyphenateLimitLines: any; + msHyphenateLimitZone: any; + msHyphens: string; + msImeAlign: string; + msOverflowStyle: string; + msScrollChaining: string; + msScrollLimit: string; + msScrollLimitXMax: any; + msScrollLimitXMin: any; + msScrollLimitYMax: any; + msScrollLimitYMin: any; + msScrollRails: string; + msScrollSnapPointsX: string; + msScrollSnapPointsY: string; + msScrollSnapType: string; + msScrollSnapX: string; + msScrollSnapY: string; + msScrollTranslation: string; + msTextCombineHorizontal: string; + msTextSizeAdjust: any; + msTouchAction: string; + msTouchSelect: string; + msUserSelect: string; + msWrapFlow: string; + msWrapMargin: any; + msWrapThrough: string; + opacity: string; + order: string; + orphans: string; + outline: string; + outlineColor: string; + outlineStyle: string; + outlineWidth: string; + overflow: string; + overflowX: string; + overflowY: string; + padding: string; + paddingBottom: string; + paddingLeft: string; + paddingRight: string; + paddingTop: string; + pageBreakAfter: string; + pageBreakBefore: string; + pageBreakInside: string; + parentRule: CSSRule; + perspective: string; + perspectiveOrigin: string; + pointerEvents: string; + position: string; + quotes: string; + right: string; + rubyAlign: string; + rubyOverhang: string; + rubyPosition: string; + stopColor: string; + stopOpacity: string; + stroke: string; + strokeDasharray: string; + strokeDashoffset: string; + strokeLinecap: string; + strokeLinejoin: string; + strokeMiterlimit: string; + strokeOpacity: string; + strokeWidth: string; + tableLayout: string; + textAlign: string; + textAlignLast: string; + textAnchor: string; + textDecoration: string; + textFillColor: string; + textIndent: string; + textJustify: string; + textKashida: string; + textKashidaSpace: string; + textOverflow: string; + textShadow: string; + textTransform: string; + textUnderlinePosition: string; + top: string; + touchAction: string; + transform: string; + transformOrigin: string; + transformStyle: string; + transition: string; + transitionDelay: string; + transitionDuration: string; + transitionProperty: string; + transitionTimingFunction: string; + unicodeBidi: string; + verticalAlign: string; + visibility: string; + webkitAlignContent: string; + webkitAlignItems: string; + webkitAlignSelf: string; + webkitAnimation: string; + webkitAnimationDelay: string; + webkitAnimationDirection: string; + webkitAnimationDuration: string; + webkitAnimationFillMode: string; + webkitAnimationIterationCount: string; + webkitAnimationName: string; + webkitAnimationPlayState: string; + webkitAnimationTimingFunction: string; + webkitAppearance: string; + webkitBackfaceVisibility: string; + webkitBackground: string; + webkitBackgroundAttachment: string; + webkitBackgroundClip: string; + webkitBackgroundColor: string; + webkitBackgroundImage: string; + webkitBackgroundOrigin: string; + webkitBackgroundPosition: string; + webkitBackgroundPositionX: string; + webkitBackgroundPositionY: string; + webkitBackgroundRepeat: string; + webkitBackgroundSize: string; + webkitBorderBottomLeftRadius: string; + webkitBorderBottomRightRadius: string; + webkitBorderImage: string; + webkitBorderImageOutset: string; + webkitBorderImageRepeat: string; + webkitBorderImageSlice: string; + webkitBorderImageSource: string; + webkitBorderImageWidth: string; + webkitBorderRadius: string; + webkitBorderTopLeftRadius: string; + webkitBorderTopRightRadius: string; + webkitBoxAlign: string; + webkitBoxDirection: string; + webkitBoxFlex: string; + webkitBoxOrdinalGroup: string; + webkitBoxOrient: string; + webkitBoxPack: string; + webkitBoxSizing: string; + webkitColumnBreakAfter: string; + webkitColumnBreakBefore: string; + webkitColumnBreakInside: string; + webkitColumnCount: any; + webkitColumnGap: any; + webkitColumnRule: string; + webkitColumnRuleColor: any; + webkitColumnRuleStyle: string; + webkitColumnRuleWidth: any; + webkitColumnSpan: string; + webkitColumnWidth: any; + webkitColumns: string; + webkitFilter: string; + webkitFlex: string; + webkitFlexBasis: string; + webkitFlexDirection: string; + webkitFlexFlow: string; + webkitFlexGrow: string; + webkitFlexShrink: string; + webkitFlexWrap: string; + webkitJustifyContent: string; + webkitOrder: string; + webkitPerspective: string; + webkitPerspectiveOrigin: string; + webkitTapHighlightColor: string; + webkitTextFillColor: string; + webkitTextSizeAdjust: any; + webkitTransform: string; + webkitTransformOrigin: string; + webkitTransformStyle: string; + webkitTransition: string; + webkitTransitionDelay: string; + webkitTransitionDuration: string; + webkitTransitionProperty: string; + webkitTransitionTimingFunction: string; + webkitUserSelect: string; + webkitWritingMode: string; + whiteSpace: string; + widows: string; + width: string; + wordBreak: string; + wordSpacing: string; + wordWrap: string; + writingMode: string; + zIndex: string; + zoom: string; + getPropertyPriority(propertyName: string): string; + getPropertyValue(propertyName: string): string; + item(index: number): string; + removeProperty(propertyName: string): string; + setProperty(propertyName: string, value: string, priority?: string): void; + [index: number]: string; +} + +declare var CSSStyleDeclaration: { + prototype: CSSStyleDeclaration; + new(): CSSStyleDeclaration; +} + +interface CSSStyleRule extends CSSRule { + readOnly: boolean; + selectorText: string; + style: CSSStyleDeclaration; +} + +declare var CSSStyleRule: { + prototype: CSSStyleRule; + new(): CSSStyleRule; +} + +interface CSSStyleSheet extends StyleSheet { + cssRules: CSSRuleList; + cssText: string; + href: string; + id: string; + imports: StyleSheetList; + isAlternate: boolean; + isPrefAlternate: boolean; + ownerRule: CSSRule; + owningElement: Element; + pages: StyleSheetPageList; + readOnly: boolean; + rules: CSSRuleList; + addImport(bstrURL: string, lIndex?: number): number; + addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; + addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number; + deleteRule(index?: number): void; + insertRule(rule: string, index?: number): number; + removeImport(lIndex: number): void; + removeRule(lIndex: number): void; +} + +declare var CSSStyleSheet: { + prototype: CSSStyleSheet; + new(): CSSStyleSheet; +} + +interface CSSSupportsRule extends CSSConditionRule { +} + +declare var CSSSupportsRule: { + prototype: CSSSupportsRule; + new(): CSSSupportsRule; +} + +interface CanvasGradient { + addColorStop(offset: number, color: string): void; +} + +declare var CanvasGradient: { + prototype: CanvasGradient; + new(): CanvasGradient; +} + +interface CanvasPattern { +} + +declare var CanvasPattern: { + prototype: CanvasPattern; + new(): CanvasPattern; +} + +interface CanvasRenderingContext2D { + canvas: HTMLCanvasElement; + fillStyle: any; + font: string; + globalAlpha: number; + globalCompositeOperation: string; + lineCap: string; + lineDashOffset: number; + lineJoin: string; + lineWidth: number; + miterLimit: number; + msFillRule: string; + msImageSmoothingEnabled: boolean; + shadowBlur: number; + shadowColor: string; + shadowOffsetX: number; + shadowOffsetY: number; + strokeStyle: any; + textAlign: string; + textBaseline: string; + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; + arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; + beginPath(): void; + bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; + clearRect(x: number, y: number, w: number, h: number): void; + clip(fillRule?: string): void; + closePath(): void; + createImageData(imageDataOrSw: number, sh?: number): ImageData; + createImageData(imageDataOrSw: ImageData, sh?: number): ImageData; + createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; + createPattern(image: HTMLImageElement, repetition: string): CanvasPattern; + createPattern(image: HTMLCanvasElement, repetition: string): CanvasPattern; + createPattern(image: HTMLVideoElement, repetition: string): CanvasPattern; + createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; + drawImage(image: HTMLImageElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; + drawImage(image: HTMLCanvasElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; + drawImage(image: HTMLVideoElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; + fill(fillRule?: string): void; + fillRect(x: number, y: number, w: number, h: number): void; + fillText(text: string, x: number, y: number, maxWidth?: number): void; + getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; + getLineDash(): number[]; + isPointInPath(x: number, y: number, fillRule?: string): boolean; + lineTo(x: number, y: number): void; + measureText(text: string): TextMetrics; + moveTo(x: number, y: number): void; + putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void; + quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; + rect(x: number, y: number, w: number, h: number): void; + restore(): void; + rotate(angle: number): void; + save(): void; + scale(x: number, y: number): void; + setLineDash(segments: number[]): void; + setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; + stroke(): void; + strokeRect(x: number, y: number, w: number, h: number): void; + strokeText(text: string, x: number, y: number, maxWidth?: number): void; + transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; + translate(x: number, y: number): void; +} + +declare var CanvasRenderingContext2D: { + prototype: CanvasRenderingContext2D; + new(): CanvasRenderingContext2D; +} + +interface ChannelMergerNode extends AudioNode { +} + +declare var ChannelMergerNode: { + prototype: ChannelMergerNode; + new(): ChannelMergerNode; +} + +interface ChannelSplitterNode extends AudioNode { +} + +declare var ChannelSplitterNode: { + prototype: ChannelSplitterNode; + new(): ChannelSplitterNode; +} + +interface CharacterData extends Node, ChildNode { + data: string; + length: number; + appendData(arg: string): void; + deleteData(offset: number, count: number): void; + insertData(offset: number, arg: string): void; + replaceData(offset: number, count: number, arg: string): void; + substringData(offset: number, count: number): string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var CharacterData: { + prototype: CharacterData; + new(): CharacterData; +} + +interface ClientRect { + bottom: number; + height: number; + left: number; + right: number; + top: number; + width: number; +} + +declare var ClientRect: { + prototype: ClientRect; + new(): ClientRect; +} + +interface ClientRectList { + length: number; + item(index: number): ClientRect; + [index: number]: ClientRect; +} + +declare var ClientRectList: { + prototype: ClientRectList; + new(): ClientRectList; +} + +interface ClipboardEvent extends Event { + clipboardData: DataTransfer; +} + +declare var ClipboardEvent: { + prototype: ClipboardEvent; + new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent; +} + +interface CloseEvent extends Event { + code: number; + reason: string; + wasClean: boolean; + initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; +} + +declare var CloseEvent: { + prototype: CloseEvent; + new(): CloseEvent; +} + +interface CommandEvent extends Event { + commandName: string; + detail: string; +} + +declare var CommandEvent: { + prototype: CommandEvent; + new(type: string, eventInitDict?: CommandEventInit): CommandEvent; +} + +interface Comment extends CharacterData { + text: string; +} + +declare var Comment: { + prototype: Comment; + new(): Comment; +} + +interface CompositionEvent extends UIEvent { + data: string; + locale: string; + initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void; +} + +declare var CompositionEvent: { + prototype: CompositionEvent; + new(typeArg: string, eventInitDict?: CompositionEventInit): CompositionEvent; +} + +interface Console { + assert(test?: boolean, message?: string, ...optionalParams: any[]): void; + clear(): void; + count(countTitle?: string): void; + debug(message?: string, ...optionalParams: any[]): void; + dir(value?: any, ...optionalParams: any[]): void; + dirxml(value: any): void; + error(message?: any, ...optionalParams: any[]): void; + group(groupTitle?: string): void; + groupCollapsed(groupTitle?: string): void; + groupEnd(): void; + info(message?: any, ...optionalParams: any[]): void; + log(message?: any, ...optionalParams: any[]): void; + msIsIndependentlyComposed(element: Element): boolean; + profile(reportName?: string): void; + profileEnd(): void; + select(element: Element): void; + time(timerName?: string): void; + timeEnd(timerName?: string): void; + trace(): void; + warn(message?: any, ...optionalParams: any[]): void; +} + +declare var Console: { + prototype: Console; + new(): Console; +} + +interface ConvolverNode extends AudioNode { + buffer: AudioBuffer; + normalize: boolean; +} + +declare var ConvolverNode: { + prototype: ConvolverNode; + new(): ConvolverNode; +} + +interface Coordinates { + accuracy: number; + altitude: number; + altitudeAccuracy: number; + heading: number; + latitude: number; + longitude: number; + speed: number; +} + +declare var Coordinates: { + prototype: Coordinates; + new(): Coordinates; +} + +interface Crypto extends Object, RandomSource { + subtle: SubtleCrypto; +} + +declare var Crypto: { + prototype: Crypto; + new(): Crypto; +} + +interface CryptoKey { + algorithm: KeyAlgorithm; + extractable: boolean; + type: string; + usages: string[]; +} + +declare var CryptoKey: { + prototype: CryptoKey; + new(): CryptoKey; +} + +interface CryptoKeyPair { + privateKey: CryptoKey; + publicKey: CryptoKey; +} + +declare var CryptoKeyPair: { + prototype: CryptoKeyPair; + new(): CryptoKeyPair; +} + +interface CustomEvent extends Event { + detail: any; + initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void; +} + +declare var CustomEvent: { + prototype: CustomEvent; + new(typeArg: string, eventInitDict?: CustomEventInit): CustomEvent; +} + +interface DOMError { + name: string; + toString(): string; +} + +declare var DOMError: { + prototype: DOMError; + new(): DOMError; +} + +interface DOMException { + code: number; + message: string; + name: string; + toString(): string; + ABORT_ERR: number; + DATA_CLONE_ERR: number; + DOMSTRING_SIZE_ERR: number; + HIERARCHY_REQUEST_ERR: number; + INDEX_SIZE_ERR: number; + INUSE_ATTRIBUTE_ERR: number; + INVALID_ACCESS_ERR: number; + INVALID_CHARACTER_ERR: number; + INVALID_MODIFICATION_ERR: number; + INVALID_NODE_TYPE_ERR: number; + INVALID_STATE_ERR: number; + NAMESPACE_ERR: number; + NETWORK_ERR: number; + NOT_FOUND_ERR: number; + NOT_SUPPORTED_ERR: number; + NO_DATA_ALLOWED_ERR: number; + NO_MODIFICATION_ALLOWED_ERR: number; + PARSE_ERR: number; + QUOTA_EXCEEDED_ERR: number; + SECURITY_ERR: number; + SERIALIZE_ERR: number; + SYNTAX_ERR: number; + TIMEOUT_ERR: number; + TYPE_MISMATCH_ERR: number; + URL_MISMATCH_ERR: number; + VALIDATION_ERR: number; + WRONG_DOCUMENT_ERR: number; +} + +declare var DOMException: { + prototype: DOMException; + new(): DOMException; + ABORT_ERR: number; + DATA_CLONE_ERR: number; + DOMSTRING_SIZE_ERR: number; + HIERARCHY_REQUEST_ERR: number; + INDEX_SIZE_ERR: number; + INUSE_ATTRIBUTE_ERR: number; + INVALID_ACCESS_ERR: number; + INVALID_CHARACTER_ERR: number; + INVALID_MODIFICATION_ERR: number; + INVALID_NODE_TYPE_ERR: number; + INVALID_STATE_ERR: number; + NAMESPACE_ERR: number; + NETWORK_ERR: number; + NOT_FOUND_ERR: number; + NOT_SUPPORTED_ERR: number; + NO_DATA_ALLOWED_ERR: number; + NO_MODIFICATION_ALLOWED_ERR: number; + PARSE_ERR: number; + QUOTA_EXCEEDED_ERR: number; + SECURITY_ERR: number; + SERIALIZE_ERR: number; + SYNTAX_ERR: number; + TIMEOUT_ERR: number; + TYPE_MISMATCH_ERR: number; + URL_MISMATCH_ERR: number; + VALIDATION_ERR: number; + WRONG_DOCUMENT_ERR: number; +} + +interface DOMImplementation { + createDocument(namespaceURI: string, qualifiedName: string, doctype: DocumentType): Document; + createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; + createHTMLDocument(title: string): Document; + hasFeature(feature: string, version: string): boolean; +} + +declare var DOMImplementation: { + prototype: DOMImplementation; + new(): DOMImplementation; +} + +interface DOMParser { + parseFromString(source: string, mimeType: string): Document; +} + +declare var DOMParser: { + prototype: DOMParser; + new(): DOMParser; +} + +interface DOMSettableTokenList extends DOMTokenList { + value: string; +} + +declare var DOMSettableTokenList: { + prototype: DOMSettableTokenList; + new(): DOMSettableTokenList; +} + +interface DOMStringList { + length: number; + contains(str: string): boolean; + item(index: number): string; + [index: number]: string; +} + +declare var DOMStringList: { + prototype: DOMStringList; + new(): DOMStringList; +} + +interface DOMStringMap { + [name: string]: string; +} + +declare var DOMStringMap: { + prototype: DOMStringMap; + new(): DOMStringMap; +} + +interface DOMTokenList { + length: number; + add(...token: string[]): void; + contains(token: string): boolean; + item(index: number): string; + remove(...token: string[]): void; + toString(): string; + toggle(token: string, force?: boolean): boolean; + [index: number]: string; +} + +declare var DOMTokenList: { + prototype: DOMTokenList; + new(): DOMTokenList; +} + +interface DataCue extends TextTrackCue { + data: ArrayBuffer; +} + +declare var DataCue: { + prototype: DataCue; + new(): DataCue; +} + +interface DataTransfer { + dropEffect: string; + effectAllowed: string; + files: FileList; + items: DataTransferItemList; + types: DOMStringList; + clearData(format?: string): boolean; + getData(format: string): string; + setData(format: string, data: string): boolean; +} + +declare var DataTransfer: { + prototype: DataTransfer; + new(): DataTransfer; +} + +interface DataTransferItem { + kind: string; + type: string; + getAsFile(): File; + getAsString(_callback: FunctionStringCallback): void; +} + +declare var DataTransferItem: { + prototype: DataTransferItem; + new(): DataTransferItem; +} + +interface DataTransferItemList { + length: number; + add(data: File): DataTransferItem; + clear(): void; + item(index: number): File; + remove(index: number): void; + [index: number]: File; +} + +declare var DataTransferItemList: { + prototype: DataTransferItemList; + new(): DataTransferItemList; +} + +interface DeferredPermissionRequest { + id: number; + type: string; + uri: string; + allow(): void; + deny(): void; +} + +declare var DeferredPermissionRequest: { + prototype: DeferredPermissionRequest; + new(): DeferredPermissionRequest; +} + +interface DelayNode extends AudioNode { + delayTime: AudioParam; +} + +declare var DelayNode: { + prototype: DelayNode; + new(): DelayNode; +} + +interface DeviceAcceleration { + x: number; + y: number; + z: number; +} + +declare var DeviceAcceleration: { + prototype: DeviceAcceleration; + new(): DeviceAcceleration; +} + +interface DeviceMotionEvent extends Event { + acceleration: DeviceAcceleration; + accelerationIncludingGravity: DeviceAcceleration; + interval: number; + rotationRate: DeviceRotationRate; + initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict, accelerationIncludingGravity: DeviceAccelerationDict, rotationRate: DeviceRotationRateDict, interval: number): void; +} + +declare var DeviceMotionEvent: { + prototype: DeviceMotionEvent; + new(): DeviceMotionEvent; +} + +interface DeviceOrientationEvent extends Event { + absolute: boolean; + alpha: number; + beta: number; + gamma: number; + initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number, beta: number, gamma: number, absolute: boolean): void; +} + +declare var DeviceOrientationEvent: { + prototype: DeviceOrientationEvent; + new(): DeviceOrientationEvent; +} + +interface DeviceRotationRate { + alpha: number; + beta: number; + gamma: number; +} + +declare var DeviceRotationRate: { + prototype: DeviceRotationRate; + new(): DeviceRotationRate; +} + +interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEvent { /** - * Gets a reference to the root node of the document. + * Sets or gets the URL for the current document. */ - documentElement: HTMLElement; + URL: string; /** - * Retrieves the collection of user agents and versions declared in the X-UA-Compatible + * Gets the URL for the document, stripped of any character encoding. */ - compatible: MSCompatibleInfoCollection; + URLUnencoded: string; /** - * Fires when the user presses a key. - * @param ev The keyboard event + * Gets the object that has the focus when the parent document has focus. */ - onkeydown: (ev: KeyboardEvent) => any; + activeElement: Element; /** - * Fires when the user releases a key. - * @param ev The keyboard event + * Sets or gets the color of all active links in the document. */ - onkeyup: (ev: KeyboardEvent) => any; - /** - * Gets the implementation object of the current document. - */ - implementation: DOMImplementation; - /** - * Fires when the user resets a form. - * @param ev The event. - */ - onreset: (ev: Event) => any; - /** - * Retrieves a collection of all script objects in the document. - */ - scripts: HTMLCollection; - /** - * Fires when the user presses the F1 key while the browser is the active window. - * @param ev The event. - */ - onhelp: (ev: Event) => any; - /** - * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. - * @param ev The drag event. - */ - ondragleave: (ev: DragEvent) => any; - /** - * Gets or sets the character set used to encode the object. - */ - charset: string; - /** - * Fires for an element just prior to setting focus on that element. - * @param ev The focus event - */ - onfocusin: (ev: FocusEvent) => any; - /** - * Sets or gets the color of the links that the user has visited. - */ - vlinkColor: string; - /** - * Occurs when the seek operation ends. - * @param ev The event. - */ - onseeked: (ev: Event) => any; - security: string; - /** - * Contains the title of the document. - */ - title: string; - /** - * Retrieves a collection of namespace objects. - */ - namespaces: MSNamespaceInfoCollection; - /** - * Gets the default character set from the current regional language settings. - */ - defaultCharset: string; - /** - * Retrieves a collection of all embed objects in the document. - */ - embeds: HTMLCollection; - /** - * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. - */ - styleSheets: StyleSheetList; - /** - * Retrieves a collection of all window objects defined by the given document or defined by the document associated with the given window. - */ - frames: Window; - /** - * Occurs when the duration attribute is updated. - * @param ev The event. - */ - ondurationchange: (ev: Event) => any; + alinkColor: string; /** * Returns a reference to the collection of elements contained by the object. */ all: HTMLCollection; + /** + * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. + */ + anchors: HTMLCollection; + /** + * Retrieves a collection of all applet objects in the document. + */ + applets: HTMLCollection; + /** + * Deprecated. Sets or retrieves a value that indicates the background color behind the object. + */ + bgColor: string; + /** + * Specifies the beginning and end of the document body. + */ + body: HTMLElement; + characterSet: string; + /** + * Gets or sets the character set used to encode the object. + */ + charset: string; + /** + * Gets a value that indicates whether standards-compliant mode is switched on for the object. + */ + compatMode: string; + cookie: string; + /** + * Gets the default character set from the current regional language settings. + */ + defaultCharset: string; + defaultView: Window; + /** + * Sets or gets a value that indicates whether the document can be edited. + */ + designMode: string; + /** + * Sets or retrieves a value that indicates the reading order of the object. + */ + dir: string; + /** + * Gets an object representing the document type declaration associated with the current document. + */ + doctype: DocumentType; + /** + * Gets a reference to the root node of the document. + */ + documentElement: HTMLElement; + /** + * Sets or gets the security domain of the document. + */ + domain: string; + /** + * Retrieves a collection of all embed objects in the document. + */ + embeds: HTMLCollection; + /** + * Sets or gets the foreground (text) color of the document. + */ + fgColor: string; /** * Retrieves a collection, in source order, of all form objects in the document. */ forms: HTMLCollection; + fullscreenElement: Element; + fullscreenEnabled: boolean; + head: HTMLHeadElement; + hidden: boolean; + /** + * Retrieves a collection, in source order, of img objects in the document. + */ + images: HTMLCollection; + /** + * Gets the implementation object of the current document. + */ + implementation: DOMImplementation; + /** + * Returns the character encoding used to create the webpage that is loaded into the document object. + */ + inputEncoding: string; + /** + * Gets the date that the page was last modified, if the page supplies one. + */ + lastModified: string; + /** + * Sets or gets the color of the document links. + */ + linkColor: string; + /** + * Retrieves a collection of all a objects that specify the href property and all area objects in the document. + */ + links: HTMLCollection; + /** + * Contains information about the current URL. + */ + location: Location; + media: string; + msCSSOMElementFloatMetrics: boolean; + msCapsLockWarningOff: boolean; + msHidden: boolean; + msVisibilityState: string; + /** + * Fires when the user aborts the download. + * @param ev The event. + */ + onabort: (ev: Event) => any; + /** + * Fires when the object is set as the active element. + * @param ev The event. + */ + onactivate: (ev: UIEvent) => any; + /** + * Fires immediately before the object is set as the active element. + * @param ev The event. + */ + onbeforeactivate: (ev: UIEvent) => any; + /** + * Fires immediately before the activeElement is changed from the current object to another object in the parent document. + * @param ev The event. + */ + onbeforedeactivate: (ev: UIEvent) => any; /** * Fires when the object loses the input focus. * @param ev The focus event. */ onblur: (ev: FocusEvent) => any; - /** - * Sets or retrieves a value that indicates the reading order of the object. - */ - dir: string; - /** - * Occurs when the media element is reset to its initial state. - * @param ev The event. - */ - onemptied: (ev: Event) => any; - /** - * Sets or gets a value that indicates whether the document can be edited. - */ - designMode: string; - /** - * Occurs when the current playback position is moved. - * @param ev The event. - */ - onseeking: (ev: Event) => any; - /** - * Fires when the activeElement is changed from the current object to another object in the parent document. - * @param ev The UI Event - */ - ondeactivate: (ev: UIEvent) => any; /** * Occurs when playback is possible, but would require further buffering. * @param ev The event. */ oncanplay: (ev: Event) => any; - /** - * Fires when the data set exposed by a data source object changes. - * @param ev The event. - */ - ondatasetchanged: (ev: MSEventObj) => any; - /** - * Fires when rows are about to be deleted from the recordset. - * @param ev The event - */ - onrowsdelete: (ev: MSEventObj) => any; - Script: MSScriptHost; - /** - * Occurs when Internet Explorer begins looking for media data. - * @param ev The event. - */ - onloadstart: (ev: Event) => any; - /** - * Gets the URL for the document, stripped of any character encoding. - */ - URLUnencoded: string; - defaultView: Window; - /** - * Fires when the user is about to make a control selection of the object. - * @param ev The event. - */ - oncontrolselect: (ev: MSEventObj) => any; - /** - * Fires on the target element when the user drags the object to a valid drop target. - * @param ev The drag event. - */ - ondragenter: (ev: DragEvent) => any; - onsubmit: (ev: Event) => any; - /** - * Returns the character encoding used to create the webpage that is loaded into the document object. - */ - inputEncoding: string; - /** - * Gets the object that has the focus when the parent document has focus. - */ - activeElement: Element; + oncanplaythrough: (ev: Event) => any; /** * Fires when the contents of the object or selection have changed. * @param ev The event. */ onchange: (ev: Event) => any; /** - * Retrieves a collection of all a objects that specify the href property and all area objects in the document. + * Fires when the user clicks the left mouse button on the object + * @param ev The mouse event. */ - links: HTMLCollection; + onclick: (ev: MouseEvent) => any; /** - * Retrieves an autogenerated, unique identifier for the object. + * Fires when the user clicks the right mouse button in the client area, opening the context menu. + * @param ev The mouse event. */ - uniqueID: string; + oncontextmenu: (ev: PointerEvent) => any; /** - * Sets or gets the URL for the current document. + * Fires when the user double-clicks the object. + * @param ev The mouse event. */ - URL: string; + ondblclick: (ev: MouseEvent) => any; /** - * Fires immediately before the object is set as the active element. + * Fires when the activeElement is changed from the current object to another object in the parent document. + * @param ev The UI Event + */ + ondeactivate: (ev: UIEvent) => any; + /** + * Fires on the source object continuously during a drag operation. * @param ev The event. */ - onbeforeactivate: (ev: UIEvent) => any; - head: HTMLHeadElement; - cookie: string; - xmlEncoding: string; - oncanplaythrough: (ev: Event) => any; - /** - * Retrieves the document compatibility mode of the document. - */ - documentMode: number; - characterSet: string; + ondrag: (ev: DragEvent) => any; /** - * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. - */ - anchors: HTMLCollection; - onbeforeupdate: (ev: MSEventObj) => any; - /** - * Fires to indicate that all data is available from the data source object. + * Fires on the source object when the user releases the mouse at the close of a drag operation. * @param ev The event. */ - ondatasetcomplete: (ev: MSEventObj) => any; - plugins: HTMLCollection; + ondragend: (ev: DragEvent) => any; + /** + * Fires on the target element when the user drags the object to a valid drop target. + * @param ev The drag event. + */ + ondragenter: (ev: DragEvent) => any; + /** + * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. + * @param ev The drag event. + */ + ondragleave: (ev: DragEvent) => any; + /** + * Fires on the target element continuously while the user drags the object over a valid drop target. + * @param ev The event. + */ + ondragover: (ev: DragEvent) => any; + /** + * Fires on the source object when the user starts to drag a text selection or selected object. + * @param ev The event. + */ + ondragstart: (ev: DragEvent) => any; + ondrop: (ev: DragEvent) => any; + /** + * Occurs when the duration attribute is updated. + * @param ev The event. + */ + ondurationchange: (ev: Event) => any; + /** + * Occurs when the media element is reset to its initial state. + * @param ev The event. + */ + onemptied: (ev: Event) => any; + /** + * Occurs when the end of playback is reached. + * @param ev The event + */ + onended: (ev: Event) => any; + /** + * Fires when an error occurs during object loading. + * @param ev The event. + */ + onerror: (ev: Event) => any; + /** + * Fires when the object receives focus. + * @param ev The event. + */ + onfocus: (ev: FocusEvent) => any; + onfullscreenchange: (ev: Event) => any; + onfullscreenerror: (ev: Event) => any; + oninput: (ev: Event) => any; + /** + * Fires when the user presses a key. + * @param ev The keyboard event + */ + onkeydown: (ev: KeyboardEvent) => any; + /** + * Fires when the user presses an alphanumeric key. + * @param ev The event. + */ + onkeypress: (ev: KeyboardEvent) => any; + /** + * Fires when the user releases a key. + * @param ev The keyboard event + */ + onkeyup: (ev: KeyboardEvent) => any; + /** + * Fires immediately after the browser loads the object. + * @param ev The event. + */ + onload: (ev: Event) => any; + /** + * Occurs when media data is loaded at the current playback position. + * @param ev The event. + */ + onloadeddata: (ev: Event) => any; + /** + * Occurs when the duration and dimensions of the media have been determined. + * @param ev The event. + */ + onloadedmetadata: (ev: Event) => any; + /** + * Occurs when Internet Explorer begins looking for media data. + * @param ev The event. + */ + onloadstart: (ev: Event) => any; + /** + * Fires when the user clicks the object with either mouse button. + * @param ev The mouse event. + */ + onmousedown: (ev: MouseEvent) => any; + /** + * Fires when the user moves the mouse over the object. + * @param ev The mouse event. + */ + onmousemove: (ev: MouseEvent) => any; + /** + * Fires when the user moves the mouse pointer outside the boundaries of the object. + * @param ev The mouse event. + */ + onmouseout: (ev: MouseEvent) => any; + /** + * Fires when the user moves the mouse pointer into the object. + * @param ev The mouse event. + */ + onmouseover: (ev: MouseEvent) => any; + /** + * Fires when the user releases a mouse button while the mouse is over the object. + * @param ev The mouse event. + */ + onmouseup: (ev: MouseEvent) => any; + /** + * Fires when the wheel button is rotated. + * @param ev The mouse event + */ + onmousewheel: (ev: MouseWheelEvent) => any; + onmscontentzoom: (ev: UIEvent) => any; + onmsgesturechange: (ev: MSGestureEvent) => any; + onmsgesturedoubletap: (ev: MSGestureEvent) => any; + onmsgestureend: (ev: MSGestureEvent) => any; + onmsgesturehold: (ev: MSGestureEvent) => any; + onmsgesturestart: (ev: MSGestureEvent) => any; + onmsgesturetap: (ev: MSGestureEvent) => any; + onmsinertiastart: (ev: MSGestureEvent) => any; + onmsmanipulationstatechanged: (ev: MSManipulationEvent) => any; + onmspointercancel: (ev: MSPointerEvent) => any; + onmspointerdown: (ev: MSPointerEvent) => any; + onmspointerenter: (ev: MSPointerEvent) => any; + onmspointerleave: (ev: MSPointerEvent) => any; + onmspointermove: (ev: MSPointerEvent) => any; + onmspointerout: (ev: MSPointerEvent) => any; + onmspointerover: (ev: MSPointerEvent) => any; + onmspointerup: (ev: MSPointerEvent) => any; + /** + * Occurs when an item is removed from a Jump List of a webpage running in Site Mode. + * @param ev The event. + */ + onmssitemodejumplistitemremoved: (ev: MSSiteModeEvent) => any; + /** + * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode. + * @param ev The event. + */ + onmsthumbnailclick: (ev: MSSiteModeEvent) => any; + /** + * Occurs when playback is paused. + * @param ev The event. + */ + onpause: (ev: Event) => any; + /** + * Occurs when the play method is requested. + * @param ev The event. + */ + onplay: (ev: Event) => any; + /** + * Occurs when the audio or video has started playing. + * @param ev The event. + */ + onplaying: (ev: Event) => any; + onpointerlockchange: (ev: Event) => any; + onpointerlockerror: (ev: Event) => any; + /** + * Occurs to indicate progress while downloading media data. + * @param ev The event. + */ + onprogress: (ev: ProgressEvent) => any; + /** + * Occurs when the playback rate is increased or decreased. + * @param ev The event. + */ + onratechange: (ev: Event) => any; + /** + * Fires when the state of the object has changed. + * @param ev The event + */ + onreadystatechange: (ev: ProgressEvent) => any; + /** + * Fires when the user resets a form. + * @param ev The event. + */ + onreset: (ev: Event) => any; + /** + * Fires when the user repositions the scroll box in the scroll bar on the object. + * @param ev The event. + */ + onscroll: (ev: UIEvent) => any; + /** + * Occurs when the seek operation ends. + * @param ev The event. + */ + onseeked: (ev: Event) => any; + /** + * Occurs when the current playback position is moved. + * @param ev The event. + */ + onseeking: (ev: Event) => any; + /** + * Fires when the current selection changes. + * @param ev The event. + */ + onselect: (ev: UIEvent) => any; + onselectstart: (ev: Event) => any; + /** + * Occurs when the download has stopped. + * @param ev The event. + */ + onstalled: (ev: Event) => any; + /** + * Fires when the user clicks the Stop button or leaves the Web page. + * @param ev The event. + */ + onstop: (ev: Event) => any; + onsubmit: (ev: Event) => any; /** * Occurs if the load operation has been intentionally halted. * @param ev The event. */ onsuspend: (ev: Event) => any; /** - * Gets the root svg element in the document hierarchy. + * Occurs to indicate the current playback position. + * @param ev The event. */ - rootElement: SVGSVGElement; + ontimeupdate: (ev: Event) => any; + ontouchcancel: (ev: TouchEvent) => any; + ontouchend: (ev: TouchEvent) => any; + ontouchmove: (ev: TouchEvent) => any; + ontouchstart: (ev: TouchEvent) => any; + /** + * Occurs when the volume is changed, or playback is muted or unmuted. + * @param ev The event. + */ + onvolumechange: (ev: Event) => any; + /** + * Occurs when playback stops because the next frame of a video resource is not available. + * @param ev The event. + */ + onwaiting: (ev: Event) => any; + onwebkitfullscreenchange: (ev: Event) => any; + onwebkitfullscreenerror: (ev: Event) => any; + plugins: HTMLCollection; + pointerLockElement: Element; /** * Retrieves a value that indicates the current state of the object. */ @@ -1481,390 +4387,60 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document */ referrer: string; /** - * Sets or gets the color of all active links in the document. + * Gets the root svg element in the document hierarchy. */ - alinkColor: string; + rootElement: SVGSVGElement; /** - * Fires on a databound object when an error occurs while updating the associated data in the data source object. - * @param ev The event. + * Retrieves a collection of all script objects in the document. */ - onerrorupdate: (ev: MSEventObj) => any; + scripts: HTMLCollection; + security: string; /** - * Gets a reference to the container object of the window. + * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. */ - parentWindow: Window; + styleSheets: StyleSheetList; /** - * Fires when the user moves the mouse pointer outside the boundaries of the object. - * @param ev The mouse event. + * Contains the title of the document. */ - onmouseout: (ev: MouseEvent) => any; - /** - * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode. - * @param ev The event. - */ - onmsthumbnailclick: (ev: MSSiteModeEvent) => any; - /** - * Fires when the wheel button is rotated. - * @param ev The mouse event - */ - onmousewheel: (ev: MouseWheelEvent) => any; - /** - * Occurs when the volume is changed, or playback is muted or unmuted. - * @param ev The event. - */ - onvolumechange: (ev: Event) => any; + title: string; + visibilityState: string; /** - * Fires when data changes in the data provider. - * @param ev The event. + * Sets or gets the color of the links that the user has visited. */ - oncellchange: (ev: MSEventObj) => any; - /** - * Fires just before the data source control changes the current row in the object. - * @param ev The event. - */ - onrowexit: (ev: MSEventObj) => any; - /** - * Fires just after new rows are inserted in the current recordset. - * @param ev The event. - */ - onrowsinserted: (ev: MSEventObj) => any; + vlinkColor: string; + webkitCurrentFullScreenElement: Element; + webkitFullscreenElement: Element; + webkitFullscreenEnabled: boolean; + webkitIsFullScreen: boolean; + xmlEncoding: string; + xmlStandalone: boolean; /** * Gets or sets the version attribute specified in the declaration of an XML document. */ xmlVersion: string; - msCapsLockWarningOff: boolean; - /** - * Fires when a property changes on the object. - * @param ev The event. - */ - onpropertychange: (ev: MSEventObj) => any; - /** - * Fires on the source object when the user releases the mouse at the close of a drag operation. - * @param ev The event. - */ - ondragend: (ev: DragEvent) => any; - /** - * Gets an object representing the document type declaration associated with the current document. - */ - doctype: DocumentType; - /** - * Fires on the target element continuously while the user drags the object over a valid drop target. - * @param ev The event. - */ - ondragover: (ev: DragEvent) => any; - /** - * Deprecated. Sets or retrieves a value that indicates the background color behind the object. - */ - bgColor: string; - /** - * Fires on the source object when the user starts to drag a text selection or selected object. - * @param ev The event. - */ - ondragstart: (ev: DragEvent) => any; - /** - * Fires when the user releases a mouse button while the mouse is over the object. - * @param ev The mouse event. - */ - onmouseup: (ev: MouseEvent) => any; - /** - * Fires on the source object continuously during a drag operation. - * @param ev The event. - */ - ondrag: (ev: DragEvent) => any; - /** - * Fires when the user moves the mouse pointer into the object. - * @param ev The mouse event. - */ - onmouseover: (ev: MouseEvent) => any; - /** - * Sets or gets the color of the document links. - */ - linkColor: string; - /** - * Occurs when playback is paused. - * @param ev The event. - */ - onpause: (ev: Event) => any; - /** - * Fires when the user clicks the object with either mouse button. - * @param ev The mouse event. - */ - onmousedown: (ev: MouseEvent) => any; - /** - * Fires when the user clicks the left mouse button on the object - * @param ev The mouse event. - */ - onclick: (ev: MouseEvent) => any; - /** - * Occurs when playback stops because the next frame of a video resource is not available. - * @param ev The event. - */ - onwaiting: (ev: Event) => any; - /** - * Fires when the user clicks the Stop button or leaves the Web page. - * @param ev The event. - */ - onstop: (ev: Event) => any; - /** - * Occurs when an item is removed from a Jump List of a webpage running in Site Mode. - * @param ev The event. - */ - onmssitemodejumplistitemremoved: (ev: MSSiteModeEvent) => any; - /** - * Retrieves a collection of all applet objects in the document. - */ - applets: HTMLCollection; - /** - * Specifies the beginning and end of the document body. - */ - body: HTMLElement; - /** - * Sets or gets the security domain of the document. - */ - domain: string; - xmlStandalone: boolean; - /** - * Represents the active selection, which is a highlighted block of text or other elements in the document that a user or a script can carry out some action on. - */ - selection: MSSelection; - /** - * Occurs when the download has stopped. - * @param ev The event. - */ - onstalled: (ev: Event) => any; - /** - * Fires when the user moves the mouse over the object. - * @param ev The mouse event. - */ - onmousemove: (ev: MouseEvent) => any; - /** - * Fires before an object contained in an editable element enters a UI-activated state or when an editable container object is control selected. - * @param ev The event. - */ - onbeforeeditfocus: (ev: MSEventObj) => any; - /** - * Occurs when the playback rate is increased or decreased. - * @param ev The event. - */ - onratechange: (ev: Event) => any; - /** - * Occurs to indicate progress while downloading media data. - * @param ev The event. - */ - onprogress: (ev: ProgressEvent) => any; - /** - * Fires when the user double-clicks the object. - * @param ev The mouse event. - */ - ondblclick: (ev: MouseEvent) => any; - /** - * Fires when the user clicks the right mouse button in the client area, opening the context menu. - * @param ev The mouse event. - */ - oncontextmenu: (ev: MouseEvent) => any; - /** - * Occurs when the duration and dimensions of the media have been determined. - * @param ev The event. - */ - onloadedmetadata: (ev: Event) => any; - media: string; - /** - * Fires when an error occurs during object loading. - * @param ev The event. - */ - onerror: (ev: ErrorEvent) => any; - /** - * Occurs when the play method is requested. - * @param ev The event. - */ - onplay: (ev: Event) => any; - onafterupdate: (ev: MSEventObj) => any; - /** - * Occurs when the audio or video has started playing. - * @param ev The event. - */ - onplaying: (ev: Event) => any; - /** - * Retrieves a collection, in source order, of img objects in the document. - */ - images: HTMLCollection; - /** - * Contains information about the current URL. - */ - location: Location; - /** - * Fires when the user aborts the download. - * @param ev The event. - */ - onabort: (ev: UIEvent) => any; - /** - * Fires for the current element with focus immediately after moving focus to another element. - * @param ev The event. - */ - onfocusout: (ev: FocusEvent) => any; - /** - * Fires when the selection state of a document changes. - * @param ev The event. - */ - onselectionchange: (ev: Event) => any; - /** - * Fires when a local DOM Storage area is written to disk. - * @param ev The event. - */ - onstoragecommit: (ev: StorageEvent) => any; - /** - * Fires periodically as data arrives from data source objects that asynchronously transmit their data. - * @param ev The event. - */ - ondataavailable: (ev: MSEventObj) => any; - /** - * Fires when the state of the object has changed. - * @param ev The event - */ - onreadystatechange: (ev: Event) => any; - /** - * Gets the date that the page was last modified, if the page supplies one. - */ - lastModified: string; - /** - * Fires when the user presses an alphanumeric key. - * @param ev The event. - */ - onkeypress: (ev: KeyboardEvent) => any; - /** - * Occurs when media data is loaded at the current playback position. - * @param ev The event. - */ - onloadeddata: (ev: Event) => any; - /** - * Fires immediately before the activeElement is changed from the current object to another object in the parent document. - * @param ev The event. - */ - onbeforedeactivate: (ev: UIEvent) => any; - /** - * Fires when the object is set as the active element. - * @param ev The event. - */ - onactivate: (ev: UIEvent) => any; - onselectstart: (ev: Event) => any; - /** - * Fires when the object receives focus. - * @param ev The event. - */ - onfocus: (ev: FocusEvent) => any; - /** - * Sets or gets the foreground (text) color of the document. - */ - fgColor: string; - /** - * Occurs to indicate the current playback position. - * @param ev The event. - */ - ontimeupdate: (ev: Event) => any; - /** - * Fires when the current selection changes. - * @param ev The event. - */ - onselect: (ev: UIEvent) => any; - ondrop: (ev: DragEvent) => any; - /** - * Occurs when the end of playback is reached. - * @param ev The event - */ - onended: (ev: Event) => any; - /** - * Gets a value that indicates whether standards-compliant mode is switched on for the object. - */ - compatMode: string; - /** - * Fires when the user repositions the scroll box in the scroll bar on the object. - * @param ev The event. - */ - onscroll: (ev: UIEvent) => any; - /** - * Fires to indicate that the current row has changed in the data source and new data values are available on the object. - * @param ev The event. - */ - onrowenter: (ev: MSEventObj) => any; - /** - * Fires immediately after the browser loads the object. - * @param ev The event. - */ - onload: (ev: Event) => any; - oninput: (ev: Event) => any; - onmspointerdown: (ev: any) => any; - msHidden: boolean; - msVisibilityState: string; - onmsgesturedoubletap: (ev: any) => any; - visibilityState: string; - onmsmanipulationstatechanged: (ev: any) => any; - onmspointerhover: (ev: any) => any; - onmscontentzoom: (ev: MSEventObj) => any; - onmspointermove: (ev: any) => any; - onmsgesturehold: (ev: any) => any; - onmsgesturechange: (ev: any) => any; - onmsgesturestart: (ev: any) => any; - onmspointercancel: (ev: any) => any; - onmsgestureend: (ev: any) => any; - onmsgesturetap: (ev: any) => any; - onmspointerout: (ev: any) => any; - onmsinertiastart: (ev: any) => any; - msCSSOMElementFloatMetrics: boolean; - onmspointerover: (ev: any) => any; - hidden: boolean; - onmspointerup: (ev: any) => any; - msFullscreenEnabled: boolean; - onmsfullscreenerror: (ev: any) => any; - onmspointerenter: (ev: any) => any; - msFullscreenElement: Element; - onmsfullscreenchange: (ev: any) => any; - onmspointerleave: (ev: any) => any; - /** - * Returns a reference to the first object with the specified value of the ID or NAME attribute. - * @param elementId String that specifies the ID value. Case-insensitive. - */ - getElementById(elementId: string): HTMLElement; - /** - * Returns the current value of the document, range, or current selection for the given command. - * @param commandId String that specifies a command identifier. - */ - queryCommandValue(commandId: string): string; adoptNode(source: Node): Node; + captureEvents(): void; + clear(): void; /** - * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. - * @param commandId String that specifies a command identifier. + * Closes an output stream and forces the sent data to display. */ - queryCommandIndeterm(commandId: string): boolean; - getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; - createProcessingInstruction(target: string, data: string): ProcessingInstruction; + close(): void; /** - * Executes a command on the current document, current selection, or the given range. - * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. - * @param showUI Display the user interface, defaults to false. - * @param value Value to assign. + * Creates an attribute object with a specified name. + * @param name String that sets the attribute object's name. */ - execCommand(commandId: string, showUI?: boolean, value?: any): boolean; - /** - * Returns the element for the specified x coordinate and the specified y coordinate. - * @param x The x-offset - * @param y The y-offset - */ - elementFromPoint(x: number, y: number): Element; + createAttribute(name: string): Attr; + createAttributeNS(namespaceURI: string, qualifiedName: string): Attr; createCDATASection(data: string): CDATASection; /** - * Retrieves the string associated with a command. - * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers. + * Creates a comment object with the specified data. + * @param data Sets the comment object's data. */ - queryCommandText(commandId: string): string; + createComment(data: string): Comment; /** - * Writes one or more HTML expressions to a document in the specified window. - * @param content Specifies the text and HTML tags to write. + * Creates a new document. */ - write(...content: string[]): void; - /** - * Allows updating the print settings for the page. - */ - updateSettings(): void; + createDocumentFragment(): DocumentFragment; /** * Creates an instance of the element for the specified tag. * @param tagName The name of an element. @@ -1875,14 +4451,11 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document createElement(tagName: "address"): HTMLBlockElement; createElement(tagName: "applet"): HTMLAppletElement; createElement(tagName: "area"): HTMLAreaElement; - createElement(tagName: "article"): HTMLElement; - createElement(tagName: "aside"): HTMLElement; createElement(tagName: "audio"): HTMLAudioElement; createElement(tagName: "b"): HTMLPhraseElement; createElement(tagName: "base"): HTMLBaseElement; createElement(tagName: "basefont"): HTMLBaseFontElement; createElement(tagName: "bdo"): HTMLPhraseElement; - createElement(tagName: "bgsound"): HTMLBGSoundElement; createElement(tagName: "big"): HTMLPhraseElement; createElement(tagName: "blockquote"): HTMLBlockElement; createElement(tagName: "body"): HTMLBodyElement; @@ -1906,10 +4479,7 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document createElement(tagName: "em"): HTMLPhraseElement; createElement(tagName: "embed"): HTMLEmbedElement; createElement(tagName: "fieldset"): HTMLFieldSetElement; - createElement(tagName: "figcaption"): HTMLElement; - createElement(tagName: "figure"): HTMLElement; createElement(tagName: "font"): HTMLFontElement; - createElement(tagName: "footer"): HTMLElement; createElement(tagName: "form"): HTMLFormElement; createElement(tagName: "frame"): HTMLFrameElement; createElement(tagName: "frameset"): HTMLFrameSetElement; @@ -1920,8 +4490,6 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document createElement(tagName: "h5"): HTMLHeadingElement; createElement(tagName: "h6"): HTMLHeadingElement; createElement(tagName: "head"): HTMLHeadElement; - createElement(tagName: "header"): HTMLElement; - createElement(tagName: "hgroup"): HTMLElement; createElement(tagName: "hr"): HTMLHRElement; createElement(tagName: "html"): HTMLHtmlElement; createElement(tagName: "i"): HTMLPhraseElement; @@ -1938,15 +4506,11 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document createElement(tagName: "link"): HTMLLinkElement; createElement(tagName: "listing"): HTMLBlockElement; createElement(tagName: "map"): HTMLMapElement; - createElement(tagName: "mark"): HTMLElement; createElement(tagName: "marquee"): HTMLMarqueeElement; createElement(tagName: "menu"): HTMLMenuElement; createElement(tagName: "meta"): HTMLMetaElement; - createElement(tagName: "nav"): HTMLElement; createElement(tagName: "nextid"): HTMLNextIdElement; createElement(tagName: "nobr"): HTMLPhraseElement; - createElement(tagName: "noframes"): HTMLElement; - createElement(tagName: "noscript"): HTMLElement; createElement(tagName: "object"): HTMLObjectElement; createElement(tagName: "ol"): HTMLOListElement; createElement(tagName: "optgroup"): HTMLOptGroupElement; @@ -1962,10 +4526,9 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document createElement(tagName: "s"): HTMLPhraseElement; createElement(tagName: "samp"): HTMLPhraseElement; createElement(tagName: "script"): HTMLScriptElement; - createElement(tagName: "section"): HTMLElement; createElement(tagName: "select"): HTMLSelectElement; createElement(tagName: "small"): HTMLPhraseElement; - createElement(tagName: "SOURCE"): HTMLSourceElement; + createElement(tagName: "source"): HTMLSourceElement; createElement(tagName: "span"): HTMLSpanElement; createElement(tagName: "strike"): HTMLPhraseElement; createElement(tagName: "strong"): HTMLPhraseElement; @@ -1987,33 +4550,32 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document createElement(tagName: "ul"): HTMLUListElement; createElement(tagName: "var"): HTMLPhraseElement; createElement(tagName: "video"): HTMLVideoElement; - createElement(tagName: "wbr"): HTMLElement; createElement(tagName: "x-ms-webview"): MSHTMLWebViewElement; createElement(tagName: "xmp"): HTMLBlockElement; createElement(tagName: string): HTMLElement; - /** - * Removes mouse capture from the object in the current document. - */ - releaseCapture(): void; - /** - * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. - * @param content The text and HTML tags to write. - */ - writeln(...content: string[]): void; createElementNS(namespaceURI: string, qualifiedName: string): Element; + createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; + createNSResolver(nodeResolver: Node): XPathNSResolver; /** - * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. - * @param url Specifies a MIME type for the document. - * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. - * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. - * @param replace Specifies whether the existing entry for the document is replaced in the history list. + * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list + * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. + * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. */ - open(url?: string, name?: string, features?: string, replace?: boolean): any; + createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): NodeIterator; + createProcessingInstruction(target: string, data: string): ProcessingInstruction; /** - * Returns a Boolean value that indicates whether the current command is supported on the current range. - * @param commandId Specifies a command identifier. + * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. */ - queryCommandSupported(commandId: string): boolean; + createRange(): Range; + /** + * Creates a text string from the specified value. + * @param data String that specifies the nodeValue property of the text node. + */ + createTextNode(data: string): Text; + createTouch(view: any, target: EventTarget, identifier: number, pageX: number, pageY: number, screenX: number, screenY: number): Touch; + createTouchList(...touches: Touch[]): TouchList; /** * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. * @param root The root element or node to start traversing on. @@ -2021,42 +4583,500 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document * @param filter A custom NodeFilter function to use. * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. */ - createTreeWalker(root: Node, whatToShow: number, filter: NodeFilter, entityReferenceExpansion: boolean): TreeWalker; - createAttributeNS(namespaceURI: string, qualifiedName: string): Attr; + createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): TreeWalker; + /** + * Returns the element for the specified x coordinate and the specified y coordinate. + * @param x The x-offset + * @param y The y-offset + */ + elementFromPoint(x: number, y: number): Element; + evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver, type: number, result: XPathResult): XPathResult; + /** + * Executes a command on the current document, current selection, or the given range. + * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. + * @param showUI Display the user interface, defaults to false. + * @param value Value to assign. + */ + execCommand(commandId: string, showUI?: boolean, value?: any): boolean; + /** + * Displays help information for the given command identifier. + * @param commandId Displays help information for the given command identifier. + */ + execCommandShowHelp(commandId: string): boolean; + exitFullscreen(): void; + exitPointerLock(): void; + /** + * Causes the element to receive the focus and executes the code specified by the onfocus event. + */ + focus(): void; + /** + * Returns a reference to the first object with the specified value of the ID or NAME attribute. + * @param elementId String that specifies the ID value. Case-insensitive. + */ + getElementById(elementId: string): HTMLElement; + getElementsByClassName(classNames: string): NodeList; + /** + * Gets a collection of objects based on the value of the NAME or ID attribute. + * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. + */ + getElementsByName(elementName: string): NodeList; + /** + * Retrieves a collection of objects based on the specified element name. + * @param name Specifies the name of an element. + */ + getElementsByTagName(tagname: "a"): NodeListOf; + getElementsByTagName(tagname: "abbr"): NodeListOf; + getElementsByTagName(tagname: "acronym"): NodeListOf; + getElementsByTagName(tagname: "address"): NodeListOf; + getElementsByTagName(tagname: "applet"): NodeListOf; + getElementsByTagName(tagname: "area"): NodeListOf; + getElementsByTagName(tagname: "article"): NodeListOf; + getElementsByTagName(tagname: "aside"): NodeListOf; + getElementsByTagName(tagname: "audio"): NodeListOf; + getElementsByTagName(tagname: "b"): NodeListOf; + getElementsByTagName(tagname: "base"): NodeListOf; + getElementsByTagName(tagname: "basefont"): NodeListOf; + getElementsByTagName(tagname: "bdo"): NodeListOf; + getElementsByTagName(tagname: "big"): NodeListOf; + getElementsByTagName(tagname: "blockquote"): NodeListOf; + getElementsByTagName(tagname: "body"): NodeListOf; + getElementsByTagName(tagname: "br"): NodeListOf; + getElementsByTagName(tagname: "button"): NodeListOf; + getElementsByTagName(tagname: "canvas"): NodeListOf; + getElementsByTagName(tagname: "caption"): NodeListOf; + getElementsByTagName(tagname: "center"): NodeListOf; + getElementsByTagName(tagname: "circle"): NodeListOf; + getElementsByTagName(tagname: "cite"): NodeListOf; + getElementsByTagName(tagname: "clippath"): NodeListOf; + getElementsByTagName(tagname: "code"): NodeListOf; + getElementsByTagName(tagname: "col"): NodeListOf; + getElementsByTagName(tagname: "colgroup"): NodeListOf; + getElementsByTagName(tagname: "datalist"): NodeListOf; + getElementsByTagName(tagname: "dd"): NodeListOf; + getElementsByTagName(tagname: "defs"): NodeListOf; + getElementsByTagName(tagname: "del"): NodeListOf; + getElementsByTagName(tagname: "desc"): NodeListOf; + getElementsByTagName(tagname: "dfn"): NodeListOf; + getElementsByTagName(tagname: "dir"): NodeListOf; + getElementsByTagName(tagname: "div"): NodeListOf; + getElementsByTagName(tagname: "dl"): NodeListOf; + getElementsByTagName(tagname: "dt"): NodeListOf; + getElementsByTagName(tagname: "ellipse"): NodeListOf; + getElementsByTagName(tagname: "em"): NodeListOf; + getElementsByTagName(tagname: "embed"): NodeListOf; + getElementsByTagName(tagname: "feblend"): NodeListOf; + getElementsByTagName(tagname: "fecolormatrix"): NodeListOf; + getElementsByTagName(tagname: "fecomponenttransfer"): NodeListOf; + getElementsByTagName(tagname: "fecomposite"): NodeListOf; + getElementsByTagName(tagname: "feconvolvematrix"): NodeListOf; + getElementsByTagName(tagname: "fediffuselighting"): NodeListOf; + getElementsByTagName(tagname: "fedisplacementmap"): NodeListOf; + getElementsByTagName(tagname: "fedistantlight"): NodeListOf; + getElementsByTagName(tagname: "feflood"): NodeListOf; + getElementsByTagName(tagname: "fefunca"): NodeListOf; + getElementsByTagName(tagname: "fefuncb"): NodeListOf; + getElementsByTagName(tagname: "fefuncg"): NodeListOf; + getElementsByTagName(tagname: "fefuncr"): NodeListOf; + getElementsByTagName(tagname: "fegaussianblur"): NodeListOf; + getElementsByTagName(tagname: "feimage"): NodeListOf; + getElementsByTagName(tagname: "femerge"): NodeListOf; + getElementsByTagName(tagname: "femergenode"): NodeListOf; + getElementsByTagName(tagname: "femorphology"): NodeListOf; + getElementsByTagName(tagname: "feoffset"): NodeListOf; + getElementsByTagName(tagname: "fepointlight"): NodeListOf; + getElementsByTagName(tagname: "fespecularlighting"): NodeListOf; + getElementsByTagName(tagname: "fespotlight"): NodeListOf; + getElementsByTagName(tagname: "fetile"): NodeListOf; + getElementsByTagName(tagname: "feturbulence"): NodeListOf; + getElementsByTagName(tagname: "fieldset"): NodeListOf; + getElementsByTagName(tagname: "figcaption"): NodeListOf; + getElementsByTagName(tagname: "figure"): NodeListOf; + getElementsByTagName(tagname: "filter"): NodeListOf; + getElementsByTagName(tagname: "font"): NodeListOf; + getElementsByTagName(tagname: "footer"): NodeListOf; + getElementsByTagName(tagname: "foreignobject"): NodeListOf; + getElementsByTagName(tagname: "form"): NodeListOf; + getElementsByTagName(tagname: "frame"): NodeListOf; + getElementsByTagName(tagname: "frameset"): NodeListOf; + getElementsByTagName(tagname: "g"): NodeListOf; + getElementsByTagName(tagname: "h1"): NodeListOf; + getElementsByTagName(tagname: "h2"): NodeListOf; + getElementsByTagName(tagname: "h3"): NodeListOf; + getElementsByTagName(tagname: "h4"): NodeListOf; + getElementsByTagName(tagname: "h5"): NodeListOf; + getElementsByTagName(tagname: "h6"): NodeListOf; + getElementsByTagName(tagname: "head"): NodeListOf; + getElementsByTagName(tagname: "header"): NodeListOf; + getElementsByTagName(tagname: "hgroup"): NodeListOf; + getElementsByTagName(tagname: "hr"): NodeListOf; + getElementsByTagName(tagname: "html"): NodeListOf; + getElementsByTagName(tagname: "i"): NodeListOf; + getElementsByTagName(tagname: "iframe"): NodeListOf; + getElementsByTagName(tagname: "image"): NodeListOf; + getElementsByTagName(tagname: "img"): NodeListOf; + getElementsByTagName(tagname: "input"): NodeListOf; + getElementsByTagName(tagname: "ins"): NodeListOf; + getElementsByTagName(tagname: "isindex"): NodeListOf; + getElementsByTagName(tagname: "kbd"): NodeListOf; + getElementsByTagName(tagname: "keygen"): NodeListOf; + getElementsByTagName(tagname: "label"): NodeListOf; + getElementsByTagName(tagname: "legend"): NodeListOf; + getElementsByTagName(tagname: "li"): NodeListOf; + getElementsByTagName(tagname: "line"): NodeListOf; + getElementsByTagName(tagname: "lineargradient"): NodeListOf; + getElementsByTagName(tagname: "link"): NodeListOf; + getElementsByTagName(tagname: "listing"): NodeListOf; + getElementsByTagName(tagname: "map"): NodeListOf; + getElementsByTagName(tagname: "mark"): NodeListOf; + getElementsByTagName(tagname: "marker"): NodeListOf; + getElementsByTagName(tagname: "marquee"): NodeListOf; + getElementsByTagName(tagname: "mask"): NodeListOf; + getElementsByTagName(tagname: "menu"): NodeListOf; + getElementsByTagName(tagname: "meta"): NodeListOf; + getElementsByTagName(tagname: "metadata"): NodeListOf; + getElementsByTagName(tagname: "nav"): NodeListOf; + getElementsByTagName(tagname: "nextid"): NodeListOf; + getElementsByTagName(tagname: "nobr"): NodeListOf; + getElementsByTagName(tagname: "noframes"): NodeListOf; + getElementsByTagName(tagname: "noscript"): NodeListOf; + getElementsByTagName(tagname: "object"): NodeListOf; + getElementsByTagName(tagname: "ol"): NodeListOf; + getElementsByTagName(tagname: "optgroup"): NodeListOf; + getElementsByTagName(tagname: "option"): NodeListOf; + getElementsByTagName(tagname: "p"): NodeListOf; + getElementsByTagName(tagname: "param"): NodeListOf; + getElementsByTagName(tagname: "path"): NodeListOf; + getElementsByTagName(tagname: "pattern"): NodeListOf; + getElementsByTagName(tagname: "plaintext"): NodeListOf; + getElementsByTagName(tagname: "polygon"): NodeListOf; + getElementsByTagName(tagname: "polyline"): NodeListOf; + getElementsByTagName(tagname: "pre"): NodeListOf; + getElementsByTagName(tagname: "progress"): NodeListOf; + getElementsByTagName(tagname: "q"): NodeListOf; + getElementsByTagName(tagname: "radialgradient"): NodeListOf; + getElementsByTagName(tagname: "rect"): NodeListOf; + getElementsByTagName(tagname: "rt"): NodeListOf; + getElementsByTagName(tagname: "ruby"): NodeListOf; + getElementsByTagName(tagname: "s"): NodeListOf; + getElementsByTagName(tagname: "samp"): NodeListOf; + getElementsByTagName(tagname: "script"): NodeListOf; + getElementsByTagName(tagname: "section"): NodeListOf; + getElementsByTagName(tagname: "select"): NodeListOf; + getElementsByTagName(tagname: "small"): NodeListOf; + getElementsByTagName(tagname: "source"): NodeListOf; + getElementsByTagName(tagname: "span"): NodeListOf; + getElementsByTagName(tagname: "stop"): NodeListOf; + getElementsByTagName(tagname: "strike"): NodeListOf; + getElementsByTagName(tagname: "strong"): NodeListOf; + getElementsByTagName(tagname: "style"): NodeListOf; + getElementsByTagName(tagname: "sub"): NodeListOf; + getElementsByTagName(tagname: "sup"): NodeListOf; + getElementsByTagName(tagname: "svg"): NodeListOf; + getElementsByTagName(tagname: "switch"): NodeListOf; + getElementsByTagName(tagname: "symbol"): NodeListOf; + getElementsByTagName(tagname: "table"): NodeListOf; + getElementsByTagName(tagname: "tbody"): NodeListOf; + getElementsByTagName(tagname: "td"): NodeListOf; + getElementsByTagName(tagname: "text"): NodeListOf; + getElementsByTagName(tagname: "textpath"): NodeListOf; + getElementsByTagName(tagname: "textarea"): NodeListOf; + getElementsByTagName(tagname: "tfoot"): NodeListOf; + getElementsByTagName(tagname: "th"): NodeListOf; + getElementsByTagName(tagname: "thead"): NodeListOf; + getElementsByTagName(tagname: "title"): NodeListOf; + getElementsByTagName(tagname: "tr"): NodeListOf; + getElementsByTagName(tagname: "track"): NodeListOf; + getElementsByTagName(tagname: "tspan"): NodeListOf; + getElementsByTagName(tagname: "tt"): NodeListOf; + getElementsByTagName(tagname: "u"): NodeListOf; + getElementsByTagName(tagname: "ul"): NodeListOf; + getElementsByTagName(tagname: "use"): NodeListOf; + getElementsByTagName(tagname: "var"): NodeListOf; + getElementsByTagName(tagname: "video"): NodeListOf; + getElementsByTagName(tagname: "view"): NodeListOf; + getElementsByTagName(tagname: "wbr"): NodeListOf; + getElementsByTagName(tagname: "x-ms-webview"): NodeListOf; + getElementsByTagName(tagname: "xmp"): NodeListOf; + getElementsByTagName(tagname: string): NodeList; + getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; + /** + * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. + */ + getSelection(): Selection; + /** + * Gets a value indicating whether the object currently has focus. + */ + hasFocus(): boolean; + importNode(importedNode: Node, deep: boolean): Node; + msElementsFromPoint(x: number, y: number): NodeList; + msElementsFromRect(left: number, top: number, width: number, height: number): NodeList; + msGetPrintDocumentForNamedFlow(flowName: string): Document; + msSetPrintDocumentUriForNamedFlow(flowName: string, uri: string): void; + /** + * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. + * @param url Specifies a MIME type for the document. + * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. + * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. + * @param replace Specifies whether the existing entry for the document is replaced in the history list. + */ + open(url?: string, name?: string, features?: string, replace?: boolean): Document | Window; /** * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document. * @param commandId Specifies a command identifier. */ queryCommandEnabled(commandId: string): boolean; /** - * Causes the element to receive the focus and executes the code specified by the onfocus event. + * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. + * @param commandId String that specifies a command identifier. */ - focus(): void; + queryCommandIndeterm(commandId: string): boolean; /** - * Closes an output stream and forces the sent data to display. + * Returns a Boolean value that indicates the current state of the command. + * @param commandId String that specifies a command identifier. */ - close(): void; - getElementsByClassName(classNames: string): NodeList; - importNode(importedNode: Node, deep: boolean): Node; + queryCommandState(commandId: string): boolean; /** - * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. + * Returns a Boolean value that indicates whether the current command is supported on the current range. + * @param commandId Specifies a command identifier. */ - createRange(): Range; + queryCommandSupported(commandId: string): boolean; /** - * Fires a specified event on the object. - * @param eventName Specifies the name of the event to fire. - * @param eventObj Object that specifies the event object from which to obtain event object properties. + * Retrieves the string associated with a command. + * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers. */ - fireEvent(eventName: string, eventObj?: any): boolean; + queryCommandText(commandId: string): string; /** - * Creates a comment object with the specified data. - * @param data Sets the comment object's data. + * Returns the current value of the document, range, or current selection for the given command. + * @param commandId String that specifies a command identifier. */ - createComment(data: string): Comment; + queryCommandValue(commandId: string): string; + releaseEvents(): void; /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. + * Allows updating the print settings for the page. */ + updateSettings(): void; + webkitCancelFullScreen(): void; + webkitExitFullscreen(): void; + /** + * Writes one or more HTML expressions to a document in the specified window. + * @param content Specifies the text and HTML tags to write. + */ + write(...content: string[]): void; + /** + * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. + * @param content The text and HTML tags to write. + */ + writeln(...content: string[]): void; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "fullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "fullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mssitemodejumplistitemremoved", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "msthumbnailclick", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerlockchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointerlockerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stop", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Document: { + prototype: Document; + new(): Document; +} + +interface DocumentFragment extends Node, NodeSelector { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var DocumentFragment: { + prototype: DocumentFragment; + new(): DocumentFragment; +} + +interface DocumentType extends Node, ChildNode { + entities: NamedNodeMap; + internalSubset: string; + name: string; + notations: NamedNodeMap; + publicId: string; + systemId: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var DocumentType: { + prototype: DocumentType; + new(): DocumentType; +} + +interface DragEvent extends MouseEvent { + dataTransfer: DataTransfer; + initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void; + msConvertURL(file: File, targetType: string, targetURL?: string): void; +} + +declare var DragEvent: { + prototype: DragEvent; + new(): DragEvent; +} + +interface DynamicsCompressorNode extends AudioNode { + attack: AudioParam; + knee: AudioParam; + ratio: AudioParam; + reduction: AudioParam; + release: AudioParam; + threshold: AudioParam; +} + +declare var DynamicsCompressorNode: { + prototype: DynamicsCompressorNode; + new(): DynamicsCompressorNode; +} + +interface EXT_texture_filter_anisotropic { + MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; + TEXTURE_MAX_ANISOTROPY_EXT: number; +} + +declare var EXT_texture_filter_anisotropic: { + prototype: EXT_texture_filter_anisotropic; + new(): EXT_texture_filter_anisotropic; + MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; + TEXTURE_MAX_ANISOTROPY_EXT: number; +} + +interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelector, ChildNode { + classList: DOMTokenList; + clientHeight: number; + clientLeft: number; + clientTop: number; + clientWidth: number; + msContentZoomFactor: number; + msRegionOverflow: string; + onariarequest: (ev: AriaRequestEvent) => any; + oncommand: (ev: CommandEvent) => any; + ongotpointercapture: (ev: PointerEvent) => any; + onlostpointercapture: (ev: PointerEvent) => any; + onmsgesturechange: (ev: MSGestureEvent) => any; + onmsgesturedoubletap: (ev: MSGestureEvent) => any; + onmsgestureend: (ev: MSGestureEvent) => any; + onmsgesturehold: (ev: MSGestureEvent) => any; + onmsgesturestart: (ev: MSGestureEvent) => any; + onmsgesturetap: (ev: MSGestureEvent) => any; + onmsgotpointercapture: (ev: MSPointerEvent) => any; + onmsinertiastart: (ev: MSGestureEvent) => any; + onmslostpointercapture: (ev: MSPointerEvent) => any; + onmspointercancel: (ev: MSPointerEvent) => any; + onmspointerdown: (ev: MSPointerEvent) => any; + onmspointerenter: (ev: MSPointerEvent) => any; + onmspointerleave: (ev: MSPointerEvent) => any; + onmspointermove: (ev: MSPointerEvent) => any; + onmspointerout: (ev: MSPointerEvent) => any; + onmspointerover: (ev: MSPointerEvent) => any; + onmspointerup: (ev: MSPointerEvent) => any; + ontouchcancel: (ev: TouchEvent) => any; + ontouchend: (ev: TouchEvent) => any; + ontouchmove: (ev: TouchEvent) => any; + ontouchstart: (ev: TouchEvent) => any; + onwebkitfullscreenchange: (ev: Event) => any; + onwebkitfullscreenerror: (ev: Event) => any; + scrollHeight: number; + scrollLeft: number; + scrollTop: number; + scrollWidth: number; + tagName: string; + getAttribute(name?: string): string; + getAttributeNS(namespaceURI: string, localName: string): string; + getAttributeNode(name: string): Attr; + getAttributeNodeNS(namespaceURI: string, localName: string): Attr; + getBoundingClientRect(): ClientRect; + getClientRects(): ClientRectList; getElementsByTagName(name: "a"): NodeListOf; getElementsByTagName(name: "abbr"): NodeListOf; getElementsByTagName(name: "acronym"): NodeListOf; @@ -2070,7 +5090,6 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "base"): NodeListOf; getElementsByTagName(name: "basefont"): NodeListOf; getElementsByTagName(name: "bdo"): NodeListOf; - getElementsByTagName(name: "bgsound"): NodeListOf; getElementsByTagName(name: "big"): NodeListOf; getElementsByTagName(name: "blockquote"): NodeListOf; getElementsByTagName(name: "body"): NodeListOf; @@ -2079,28 +5098,60 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "canvas"): NodeListOf; getElementsByTagName(name: "caption"): NodeListOf; getElementsByTagName(name: "center"): NodeListOf; + getElementsByTagName(name: "circle"): NodeListOf; getElementsByTagName(name: "cite"): NodeListOf; + getElementsByTagName(name: "clippath"): NodeListOf; getElementsByTagName(name: "code"): NodeListOf; getElementsByTagName(name: "col"): NodeListOf; getElementsByTagName(name: "colgroup"): NodeListOf; getElementsByTagName(name: "datalist"): NodeListOf; getElementsByTagName(name: "dd"): NodeListOf; + getElementsByTagName(name: "defs"): NodeListOf; getElementsByTagName(name: "del"): NodeListOf; + getElementsByTagName(name: "desc"): NodeListOf; getElementsByTagName(name: "dfn"): NodeListOf; getElementsByTagName(name: "dir"): NodeListOf; getElementsByTagName(name: "div"): NodeListOf; getElementsByTagName(name: "dl"): NodeListOf; getElementsByTagName(name: "dt"): NodeListOf; + getElementsByTagName(name: "ellipse"): NodeListOf; getElementsByTagName(name: "em"): NodeListOf; getElementsByTagName(name: "embed"): NodeListOf; + getElementsByTagName(name: "feblend"): NodeListOf; + getElementsByTagName(name: "fecolormatrix"): NodeListOf; + getElementsByTagName(name: "fecomponenttransfer"): NodeListOf; + getElementsByTagName(name: "fecomposite"): NodeListOf; + getElementsByTagName(name: "feconvolvematrix"): NodeListOf; + getElementsByTagName(name: "fediffuselighting"): NodeListOf; + getElementsByTagName(name: "fedisplacementmap"): NodeListOf; + getElementsByTagName(name: "fedistantlight"): NodeListOf; + getElementsByTagName(name: "feflood"): NodeListOf; + getElementsByTagName(name: "fefunca"): NodeListOf; + getElementsByTagName(name: "fefuncb"): NodeListOf; + getElementsByTagName(name: "fefuncg"): NodeListOf; + getElementsByTagName(name: "fefuncr"): NodeListOf; + getElementsByTagName(name: "fegaussianblur"): NodeListOf; + getElementsByTagName(name: "feimage"): NodeListOf; + getElementsByTagName(name: "femerge"): NodeListOf; + getElementsByTagName(name: "femergenode"): NodeListOf; + getElementsByTagName(name: "femorphology"): NodeListOf; + getElementsByTagName(name: "feoffset"): NodeListOf; + getElementsByTagName(name: "fepointlight"): NodeListOf; + getElementsByTagName(name: "fespecularlighting"): NodeListOf; + getElementsByTagName(name: "fespotlight"): NodeListOf; + getElementsByTagName(name: "fetile"): NodeListOf; + getElementsByTagName(name: "feturbulence"): NodeListOf; getElementsByTagName(name: "fieldset"): NodeListOf; getElementsByTagName(name: "figcaption"): NodeListOf; getElementsByTagName(name: "figure"): NodeListOf; + getElementsByTagName(name: "filter"): NodeListOf; getElementsByTagName(name: "font"): NodeListOf; getElementsByTagName(name: "footer"): NodeListOf; + getElementsByTagName(name: "foreignobject"): NodeListOf; getElementsByTagName(name: "form"): NodeListOf; getElementsByTagName(name: "frame"): NodeListOf; getElementsByTagName(name: "frameset"): NodeListOf; + getElementsByTagName(name: "g"): NodeListOf; getElementsByTagName(name: "h1"): NodeListOf; getElementsByTagName(name: "h2"): NodeListOf; getElementsByTagName(name: "h3"): NodeListOf; @@ -2114,6 +5165,7 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "html"): NodeListOf; getElementsByTagName(name: "i"): NodeListOf; getElementsByTagName(name: "iframe"): NodeListOf; + getElementsByTagName(name: "image"): NodeListOf; getElementsByTagName(name: "img"): NodeListOf; getElementsByTagName(name: "input"): NodeListOf; getElementsByTagName(name: "ins"): NodeListOf; @@ -2123,13 +5175,18 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "label"): NodeListOf; getElementsByTagName(name: "legend"): NodeListOf; getElementsByTagName(name: "li"): NodeListOf; + getElementsByTagName(name: "line"): NodeListOf; + getElementsByTagName(name: "lineargradient"): NodeListOf; getElementsByTagName(name: "link"): NodeListOf; getElementsByTagName(name: "listing"): NodeListOf; getElementsByTagName(name: "map"): NodeListOf; getElementsByTagName(name: "mark"): NodeListOf; + getElementsByTagName(name: "marker"): NodeListOf; getElementsByTagName(name: "marquee"): NodeListOf; + getElementsByTagName(name: "mask"): NodeListOf; getElementsByTagName(name: "menu"): NodeListOf; getElementsByTagName(name: "meta"): NodeListOf; + getElementsByTagName(name: "metadata"): NodeListOf; getElementsByTagName(name: "nav"): NodeListOf; getElementsByTagName(name: "nextid"): NodeListOf; getElementsByTagName(name: "nobr"): NodeListOf; @@ -2141,10 +5198,16 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "option"): NodeListOf; getElementsByTagName(name: "p"): NodeListOf; getElementsByTagName(name: "param"): NodeListOf; + getElementsByTagName(name: "path"): NodeListOf; + getElementsByTagName(name: "pattern"): NodeListOf; getElementsByTagName(name: "plaintext"): NodeListOf; + getElementsByTagName(name: "polygon"): NodeListOf; + getElementsByTagName(name: "polyline"): NodeListOf; getElementsByTagName(name: "pre"): NodeListOf; getElementsByTagName(name: "progress"): NodeListOf; getElementsByTagName(name: "q"): NodeListOf; + getElementsByTagName(name: "radialgradient"): NodeListOf; + getElementsByTagName(name: "rect"): NodeListOf; getElementsByTagName(name: "rt"): NodeListOf; getElementsByTagName(name: "ruby"): NodeListOf; getElementsByTagName(name: "s"): NodeListOf; @@ -2153,16 +5216,22 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "section"): NodeListOf; getElementsByTagName(name: "select"): NodeListOf; getElementsByTagName(name: "small"): NodeListOf; - getElementsByTagName(name: "SOURCE"): NodeListOf; + getElementsByTagName(name: "source"): NodeListOf; getElementsByTagName(name: "span"): NodeListOf; + getElementsByTagName(name: "stop"): NodeListOf; getElementsByTagName(name: "strike"): NodeListOf; getElementsByTagName(name: "strong"): NodeListOf; getElementsByTagName(name: "style"): NodeListOf; getElementsByTagName(name: "sub"): NodeListOf; getElementsByTagName(name: "sup"): NodeListOf; + getElementsByTagName(name: "svg"): NodeListOf; + getElementsByTagName(name: "switch"): NodeListOf; + getElementsByTagName(name: "symbol"): NodeListOf; getElementsByTagName(name: "table"): NodeListOf; getElementsByTagName(name: "tbody"): NodeListOf; getElementsByTagName(name: "td"): NodeListOf; + getElementsByTagName(name: "text"): NodeListOf; + getElementsByTagName(name: "textpath"): NodeListOf; getElementsByTagName(name: "textarea"): NodeListOf; getElementsByTagName(name: "tfoot"): NodeListOf; getElementsByTagName(name: "th"): NodeListOf; @@ -2170,546 +5239,837 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "title"): NodeListOf; getElementsByTagName(name: "tr"): NodeListOf; getElementsByTagName(name: "track"): NodeListOf; + getElementsByTagName(name: "tspan"): NodeListOf; getElementsByTagName(name: "tt"): NodeListOf; getElementsByTagName(name: "u"): NodeListOf; getElementsByTagName(name: "ul"): NodeListOf; + getElementsByTagName(name: "use"): NodeListOf; getElementsByTagName(name: "var"): NodeListOf; getElementsByTagName(name: "video"): NodeListOf; + getElementsByTagName(name: "view"): NodeListOf; getElementsByTagName(name: "wbr"): NodeListOf; getElementsByTagName(name: "x-ms-webview"): NodeListOf; getElementsByTagName(name: "xmp"): NodeListOf; getElementsByTagName(name: string): NodeList; - /** - * Creates a new document. - */ - createDocumentFragment(): DocumentFragment; - /** - * Creates a style sheet for the document. - * @param href Specifies how to add the style sheet to the document. If a file name is specified for the URL, the style information is added as a link object. If the URL contains style information, it is added to the style object. - * @param index Specifies the index that indicates where the new style sheet is inserted in the styleSheets collection. The default is to insert the new style sheet at the end of the collection. - */ - createStyleSheet(href?: string, index?: number): CSSStyleSheet; - /** - * Gets a collection of objects based on the value of the NAME or ID attribute. - * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. - */ - getElementsByName(elementName: string): NodeList; - /** - * Returns a Boolean value that indicates the current state of the command. - * @param commandId String that specifies a command identifier. - */ - queryCommandState(commandId: string): boolean; - /** - * Gets a value indicating whether the object currently has focus. - */ - hasFocus(): boolean; - /** - * Displays help information for the given command identifier. - * @param commandId Displays help information for the given command identifier. - */ - execCommandShowHelp(commandId: string): boolean; - /** - * Creates an attribute object with a specified name. - * @param name String that sets the attribute object's name. - */ - createAttribute(name: string): Attr; - /** - * Creates a text string from the specified value. - * @param data String that specifies the nodeValue property of the text node. - */ - createTextNode(data: string): Text; - /** - * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. - * @param root The root element or node to start traversing on. - * @param whatToShow The type of nodes or elements to appear in the node list - * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. - * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. - */ - createNodeIterator(root: Node, whatToShow: number, filter: NodeFilter, entityReferenceExpansion: boolean): NodeIterator; - /** - * Generates an event object to pass event context information when you use the fireEvent method. - * @param eventObj An object that specifies an existing event object on which to base the new object. - */ - createEventObject(eventObj?: any): MSEventObj; - /** - * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. - */ - getSelection(): Selection; - msElementsFromPoint(x: number, y: number): NodeList; - msElementsFromRect(left: number, top: number, width: number, height: number): NodeList; - clear(): void; - msExitFullscreen(): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; + hasAttribute(name: string): boolean; + hasAttributeNS(namespaceURI: string, localName: string): boolean; + msGetRegionContent(): MSRangeCollection; + msGetUntransformedBounds(): ClientRect; + msMatchesSelector(selectors: string): boolean; + msReleasePointerCapture(pointerId: number): void; + msSetPointerCapture(pointerId: number): void; + msZoomTo(args: MsZoomToOptions): void; + releasePointerCapture(pointerId: number): void; + removeAttribute(name?: string): void; + removeAttributeNS(namespaceURI: string, localName: string): void; + removeAttributeNode(oldAttr: Attr): Attr; + requestFullscreen(): void; + requestPointerLock(): void; + setAttribute(name?: string, value?: string): void; + setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; + setAttributeNode(newAttr: Attr): Attr; + setAttributeNodeNS(newAttr: Attr): Attr; + setPointerCapture(pointerId: number): void; + webkitMatchesSelector(selectors: string): boolean; + webkitRequestFullScreen(): void; + webkitRequestFullscreen(): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Element: { + prototype: Element; + new(): Element; +} + +interface ErrorEvent extends Event { + colno: number; + error: any; + filename: string; + lineno: number; + message: string; + initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; +} + +declare var ErrorEvent: { + prototype: ErrorEvent; + new(): ErrorEvent; +} + +interface Event { + bubbles: boolean; + cancelBubble: boolean; + cancelable: boolean; + currentTarget: EventTarget; + defaultPrevented: boolean; + eventPhase: number; + isTrusted: boolean; + returnValue: boolean; + srcElement: Element; + target: EventTarget; + timeStamp: number; + type: string; + initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; + preventDefault(): void; + stopImmediatePropagation(): void; + stopPropagation(): void; + AT_TARGET: number; + BUBBLING_PHASE: number; + CAPTURING_PHASE: number; +} + +declare var Event: { + prototype: Event; + new(type: string, eventInitDict?: EventInit): Event; + AT_TARGET: number; + BUBBLING_PHASE: number; + CAPTURING_PHASE: number; +} + +interface EventTarget { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + dispatchEvent(evt: Event): boolean; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var EventTarget: { + prototype: EventTarget; + new(): EventTarget; +} + +interface External { +} + +declare var External: { + prototype: External; + new(): External; +} + +interface File extends Blob { + lastModifiedDate: any; + name: string; +} + +declare var File: { + prototype: File; + new(): File; +} + +interface FileList { + length: number; + item(index: number): File; + [index: number]: File; +} + +declare var FileList: { + prototype: FileList; + new(): FileList; +} + +interface FileReader extends EventTarget, MSBaseReader { + error: DOMError; + readAsArrayBuffer(blob: Blob): void; + readAsBinaryString(blob: Blob): void; + readAsDataURL(blob: Blob): void; + readAsText(blob: Blob, encoding?: string): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var FileReader: { + prototype: FileReader; + new(): FileReader; +} + +interface FocusEvent extends UIEvent { + relatedTarget: EventTarget; + initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void; +} + +declare var FocusEvent: { + prototype: FocusEvent; + new(typeArg: string, eventInitDict?: FocusEventInit): FocusEvent; +} + +interface FormData { + append(name: any, value: any, blobName?: string): void; +} + +declare var FormData: { + prototype: FormData; + new(): FormData; +} + +interface GainNode extends AudioNode { + gain: AudioParam; +} + +declare var GainNode: { + prototype: GainNode; + new(): GainNode; +} + +interface Gamepad { + axes: number[]; + buttons: GamepadButton[]; + connected: boolean; + id: string; + index: number; + mapping: string; + timestamp: number; +} + +declare var Gamepad: { + prototype: Gamepad; + new(): Gamepad; +} + +interface GamepadButton { + pressed: boolean; + value: number; +} + +declare var GamepadButton: { + prototype: GamepadButton; + new(): GamepadButton; +} + +interface GamepadEvent extends Event { + gamepad: Gamepad; +} + +declare var GamepadEvent: { + prototype: GamepadEvent; + new(): GamepadEvent; +} + +interface Geolocation { + clearWatch(watchId: number): void; + getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void; + watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number; +} + +declare var Geolocation: { + prototype: Geolocation; + new(): Geolocation; +} + +interface HTMLAllCollection extends HTMLCollection { + namedItem(name: string): Element; +} + +declare var HTMLAllCollection: { + prototype: HTMLAllCollection; + new(): HTMLAllCollection; +} + +interface HTMLAnchorElement extends HTMLElement { + Methods: string; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Sets or retrieves the coordinates of the object. + */ + coords: string; + /** + * Contains the anchor portion of the URL including the hash sign (#). + */ + hash: string; + /** + * Contains the hostname and port values of the URL. + */ + host: string; + /** + * Contains the hostname of a URL. + */ + hostname: string; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or retrieves the language code of the object. + */ + hreflang: string; + mimeType: string; + /** + * Sets or retrieves the shape of the object. + */ + name: string; + nameProp: string; + /** + * Contains the pathname of the URL. + */ + pathname: string; + /** + * Sets or retrieves the port number associated with a URL. + */ + port: string; + /** + * Contains the protocol of the URL. + */ + protocol: string; + protocolLong: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rel: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rev: string; + /** + * Sets or retrieves the substring of the href property that follows the question mark. + */ + search: string; + /** + * Sets or retrieves the shape of the object. + */ + shape: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; + type: string; + urn: string; + /** + * Returns a string representation of an object. + */ + toString(): string; +} + +declare var HTMLAnchorElement: { + prototype: HTMLAnchorElement; + new(): HTMLAnchorElement; +} + +interface HTMLAppletElement extends HTMLElement { + /** + * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. + */ + BaseHref: string; + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Gets or sets the optional alternative HTML script to execute if the object fails to load. + */ + altHtml: string; + /** + * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. + */ + archive: string; + border: string; + code: string; + /** + * Sets or retrieves the URL of the component. + */ + codeBase: string; + /** + * Sets or retrieves the Internet media type for the code associated with the object. + */ + codeType: string; + /** + * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned. + */ + contentDocument: Document; + /** + * Sets or retrieves the URL that references the data of the object. + */ + data: string; + /** + * Sets or retrieves a character string that can be used to implement your own declare functionality for the object. + */ + declare: boolean; + form: HTMLFormElement; + /** + * Sets or retrieves the height of the object. + */ + height: string; + hspace: number; + /** + * Sets or retrieves the shape of the object. + */ + name: string; + object: string; + /** + * Sets or retrieves a message to be displayed while an object is loading. + */ + standby: string; + /** + * Returns the content type of the object. + */ + type: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + vspace: number; + width: number; +} + +declare var HTMLAppletElement: { + prototype: HTMLAppletElement; + new(): HTMLAppletElement; +} + +interface HTMLAreaElement extends HTMLElement { + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Sets or retrieves the coordinates of the object. + */ + coords: string; + /** + * Sets or retrieves the subsection of the href property that follows the number sign (#). + */ + hash: string; + /** + * Sets or retrieves the hostname and port number of the location or URL. + */ + host: string; + /** + * Sets or retrieves the host name part of the location or URL. + */ + hostname: string; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or gets whether clicks in this region cause action. + */ + noHref: boolean; + /** + * Sets or retrieves the file name or path specified by the object. + */ + pathname: string; + /** + * Sets or retrieves the port number associated with a URL. + */ + port: string; + /** + * Sets or retrieves the protocol portion of a URL. + */ + protocol: string; + rel: string; + /** + * Sets or retrieves the substring of the href property that follows the question mark. + */ + search: string; + /** + * Sets or retrieves the shape of the object. + */ + shape: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Returns a string representation of an object. + */ + toString(): string; +} + +declare var HTMLAreaElement: { + prototype: HTMLAreaElement; + new(): HTMLAreaElement; +} + +interface HTMLAreasCollection extends HTMLCollection { + /** + * Adds an element to the areas, controlRange, or options collection. + */ + add(element: HTMLElement, before?: HTMLElement): void; + add(element: HTMLElement, before?: number): void; + /** + * Removes an element from the collection. + */ + remove(index?: number): void; +} + +declare var HTMLAreasCollection: { + prototype: HTMLAreasCollection; + new(): HTMLAreasCollection; +} + +interface HTMLAudioElement extends HTMLMediaElement { +} + +declare var HTMLAudioElement: { + prototype: HTMLAudioElement; + new(): HTMLAudioElement; +} + +interface HTMLBRElement extends HTMLElement { + /** + * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document. + */ + clear: string; +} + +declare var HTMLBRElement: { + prototype: HTMLBRElement; + new(): HTMLBRElement; +} + +interface HTMLBaseElement extends HTMLElement { + /** + * Gets or sets the baseline URL on which relative links are based. + */ + href: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; +} + +declare var HTMLBaseElement: { + prototype: HTMLBaseElement; + new(): HTMLBaseElement; +} + +interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty { + /** + * Sets or retrieves the current typeface family. + */ + face: string; + /** + * Sets or retrieves the font size of the object. + */ + size: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLBaseFontElement: { + prototype: HTMLBaseFontElement; + new(): HTMLBaseFontElement; +} + +interface HTMLBlockElement extends HTMLElement { + /** + * Sets or retrieves reference information about the object. + */ + cite: string; + clear: string; + /** + * Sets or retrieves the width of the object. + */ + width: number; +} + +declare var HTMLBlockElement: { + prototype: HTMLBlockElement; + new(): HTMLBlockElement; +} + +interface HTMLBodyElement extends HTMLElement { + aLink: any; + background: string; + bgColor: any; + bgProperties: string; + link: any; + noWrap: boolean; + onafterprint: (ev: Event) => any; + onbeforeprint: (ev: Event) => any; + onbeforeunload: (ev: BeforeUnloadEvent) => any; + onblur: (ev: FocusEvent) => any; + onerror: (ev: Event) => any; + onfocus: (ev: FocusEvent) => any; + onhashchange: (ev: HashChangeEvent) => any; + onload: (ev: Event) => any; + onmessage: (ev: MessageEvent) => any; + onoffline: (ev: Event) => any; + ononline: (ev: Event) => any; + onorientationchange: (ev: Event) => any; + onpagehide: (ev: PageTransitionEvent) => any; + onpageshow: (ev: PageTransitionEvent) => any; + onpopstate: (ev: PopStateEvent) => any; + onresize: (ev: UIEvent) => any; + onstorage: (ev: StorageEvent) => any; + onunload: (ev: Event) => any; + text: any; + vLink: any; + createTextRange(): TextRange; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "msthumbnailclick", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stop", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mssitemodejumplistitemremoved", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectionchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "storagecommit", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msfullscreenerror", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msfullscreenchange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Document: { - prototype: Document; - new(): Document; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface Console { - info(message?: any, ...optionalParams: any[]): void; - warn(message?: any, ...optionalParams: any[]): void; - error(message?: any, ...optionalParams: any[]): void; - log(message?: any, ...optionalParams: any[]): void; - profile(reportName?: string): void; - assert(test?: boolean, message?: string, ...optionalParams: any[]): void; - msIsIndependentlyComposed(element: Element): boolean; - clear(): void; - dir(value?: any, ...optionalParams: any[]): void; - profileEnd(): void; - count(countTitle?: string): void; - groupEnd(): void; - time(timerName?: string): void; - timeEnd(timerName?: string): void; - trace(): void; - group(groupTitle?: string): void; - dirxml(value: any): void; - debug(message?: string, ...optionalParams: any[]): void; - groupCollapsed(groupTitle?: string): void; - select(element: Element): void; -} -declare var Console: { - prototype: Console; - new(): Console; +declare var HTMLBodyElement: { + prototype: HTMLBodyElement; + new(): HTMLBodyElement; } -interface MSEventObj extends Event { - nextPage: string; - keyCode: number; - toElement: Element; - returnValue: any; - dataFld: string; - y: number; - dataTransfer: DataTransfer; - propertyName: string; - url: string; - offsetX: number; - recordset: any; - screenX: number; - buttonID: number; - wheelDelta: number; - reason: number; - origin: string; - data: string; - srcFilter: any; - boundElements: HTMLCollection; - cancelBubble: boolean; - altLeft: boolean; - behaviorCookie: number; - bookmarks: BookmarkCollection; +interface HTMLButtonElement extends HTMLElement { + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Overrides the action attribute (where the data on a form is sent) on the parent form element. + */ + formAction: string; + /** + * Used to override the encoding (formEnctype attribute) specified on the form element. + */ + formEnctype: string; + /** + * Overrides the submit method attribute previously specified on a form element. + */ + formMethod: string; + /** + * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. + */ + formNoValidate: string; + /** + * Overrides the target attribute on a form element. + */ + formTarget: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + status: any; + /** + * Gets the classification and default behavior of the button. + */ type: string; - repeat: boolean; - srcElement: Element; - source: Window; - fromElement: Element; - offsetY: number; - x: number; - behaviorPart: number; - qualifier: string; - altKey: boolean; - ctrlKey: boolean; - clientY: number; - shiftKey: boolean; - shiftLeft: boolean; - contentOverflow: boolean; - screenY: number; - ctrlLeft: boolean; - button: number; - srcUrn: string; - clientX: number; - actionURL: string; - getAttribute(strAttributeName: string, lFlags?: number): any; - setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; - removeAttribute(strAttributeName: string, lFlags?: number): boolean; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Sets or retrieves the default or selected value of the control. + */ + value: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Creates a TextRange object for the element. + */ + createTextRange(): TextRange; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; } -declare var MSEventObj: { - prototype: MSEventObj; - new(): MSEventObj; + +declare var HTMLButtonElement: { + prototype: HTMLButtonElement; + new(): HTMLButtonElement; } interface HTMLCanvasElement extends HTMLElement { - /** - * Gets or sets the width of a canvas element on a document. - */ - width: number; /** * Gets or sets the height of a canvas element on a document. */ height: number; /** - * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. - * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); + * Gets or sets the width of a canvas element on a document. */ - getContext(contextId: "2d"): CanvasRenderingContext2D; + width: number; /** * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); */ - getContext(contextId: "experimental-webgl"): WebGLRenderingContext; + getContext(contextId: string, ...args: any[]): CanvasRenderingContext2D | WebGLRenderingContext; /** - * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. - * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); + * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. */ - getContext(contextId: string, ...args: any[]): any; + msToBlob(): Blob; /** * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element. * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image. */ toDataURL(type?: string, ...args: any[]): string; - /** - * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. - */ - msToBlob(): Blob; } + declare var HTMLCanvasElement: { prototype: HTMLCanvasElement; new(): HTMLCanvasElement; } -interface Window extends EventTarget, MSEventAttachmentTarget, WindowLocalStorage, MSWindowExtensions, WindowSessionStorage, WindowTimers, WindowBase64, IDBEnvironment, WindowConsole, GlobalEventHandlers { - ondragend: (ev: DragEvent) => any; - onkeydown: (ev: KeyboardEvent) => any; - ondragover: (ev: DragEvent) => any; - onkeyup: (ev: KeyboardEvent) => any; - onreset: (ev: Event) => any; - onmouseup: (ev: MouseEvent) => any; - ondragstart: (ev: DragEvent) => any; - ondrag: (ev: DragEvent) => any; - screenX: number; - onmouseover: (ev: MouseEvent) => any; - ondragleave: (ev: DragEvent) => any; - history: History; - pageXOffset: number; - name: string; - onafterprint: (ev: Event) => any; - onpause: (ev: Event) => any; - onbeforeprint: (ev: Event) => any; - top: Window; - onmousedown: (ev: MouseEvent) => any; - onseeked: (ev: Event) => any; - opener: Window; - onclick: (ev: MouseEvent) => any; - innerHeight: number; - onwaiting: (ev: Event) => any; - ononline: (ev: Event) => any; - ondurationchange: (ev: Event) => any; - frames: Window; - onblur: (ev: FocusEvent) => any; - onemptied: (ev: Event) => any; - onseeking: (ev: Event) => any; - oncanplay: (ev: Event) => any; - outerWidth: number; - onstalled: (ev: Event) => any; - onmousemove: (ev: MouseEvent) => any; - innerWidth: number; - onoffline: (ev: Event) => any; - length: number; - screen: Screen; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - onratechange: (ev: Event) => any; - onstorage: (ev: StorageEvent) => any; - onloadstart: (ev: Event) => any; - ondragenter: (ev: DragEvent) => any; - onsubmit: (ev: Event) => any; - self: Window; - document: Document; - onprogress: (ev: ProgressEvent) => any; - ondblclick: (ev: MouseEvent) => any; - pageYOffset: number; - oncontextmenu: (ev: MouseEvent) => any; - onchange: (ev: Event) => any; - onloadedmetadata: (ev: Event) => any; - onplay: (ev: Event) => any; - onerror: ErrorEventHandler; - onplaying: (ev: Event) => any; - parent: Window; - location: Location; - oncanplaythrough: (ev: Event) => any; - onabort: (ev: UIEvent) => any; - onreadystatechange: (ev: Event) => any; - outerHeight: number; - onkeypress: (ev: KeyboardEvent) => any; - frameElement: Element; - onloadeddata: (ev: Event) => any; - onsuspend: (ev: Event) => any; - window: Window; - onfocus: (ev: FocusEvent) => any; - onmessage: (ev: MessageEvent) => any; - ontimeupdate: (ev: Event) => any; - onresize: (ev: UIEvent) => any; - onselect: (ev: UIEvent) => any; - navigator: Navigator; - styleMedia: StyleMedia; - ondrop: (ev: DragEvent) => any; - onmouseout: (ev: MouseEvent) => any; - onended: (ev: Event) => any; - onhashchange: (ev: Event) => any; - onunload: (ev: Event) => any; - onscroll: (ev: UIEvent) => any; - screenY: number; - onmousewheel: (ev: MouseWheelEvent) => any; - onload: (ev: Event) => any; - onvolumechange: (ev: Event) => any; - oninput: (ev: Event) => any; - performance: Performance; - onmspointerdown: (ev: any) => any; - animationStartTime: number; - onmsgesturedoubletap: (ev: any) => any; - onmspointerhover: (ev: any) => any; - onmsgesturehold: (ev: any) => any; - onmspointermove: (ev: any) => any; - onmsgesturechange: (ev: any) => any; - onmsgesturestart: (ev: any) => any; - onmspointercancel: (ev: any) => any; - onmsgestureend: (ev: any) => any; - onmsgesturetap: (ev: any) => any; - onmspointerout: (ev: any) => any; - msAnimationStartTime: number; - applicationCache: ApplicationCache; - onmsinertiastart: (ev: any) => any; - onmspointerover: (ev: any) => any; - onpopstate: (ev: PopStateEvent) => any; - onmspointerup: (ev: any) => any; - onpageshow: (ev: PageTransitionEvent) => any; - ondevicemotion: (ev: DeviceMotionEvent) => any; - devicePixelRatio: number; - msCrypto: Crypto; - ondeviceorientation: (ev: DeviceOrientationEvent) => any; - doNotTrack: string; - onmspointerenter: (ev: any) => any; - onpagehide: (ev: PageTransitionEvent) => any; - onmspointerleave: (ev: any) => any; - alert(message?: any): void; - scroll(x?: number, y?: number): void; - focus(): void; - scrollTo(x?: number, y?: number): void; - print(): void; - prompt(message?: string, _default?: string): string; - toString(): string; - open(url?: string, target?: string, features?: string, replace?: boolean): Window; - scrollBy(x?: number, y?: number): void; - confirm(message?: string): boolean; - close(): void; - postMessage(message: any, targetOrigin: string, ports?: any): void; - showModalDialog(url?: string, argument?: any, options?: any): any; - blur(): void; - getSelection(): Selection; - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; - msCancelRequestAnimationFrame(handle: number): void; - matchMedia(mediaQuery: string): MediaQueryList; - cancelAnimationFrame(handle: number): void; - msIsStaticHTML(html: string): boolean; - msMatchMedia(mediaQuery: string): MediaQueryList; - requestAnimationFrame(callback: FrameRequestCallback): number; - msRequestAnimationFrame(callback: FrameRequestCallback): number; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Window: { - prototype: Window; - new(): Window; -} - -interface HTMLCollection extends MSHTMLCollectionExtensions { +interface HTMLCollection { /** * Sets or retrieves the number of objects in a collection. */ @@ -2722,1338 +6082,2371 @@ interface HTMLCollection extends MSHTMLCollectionExtensions { * Retrieves a select object or an object from an options collection. */ namedItem(name: string): Element; - // [name: string]: Element; [index: number]: Element; } + declare var HTMLCollection: { prototype: HTMLCollection; new(): HTMLCollection; } -interface BlobPropertyBag { - type?: string; - endings?: string; +interface HTMLDDElement extends HTMLElement { + /** + * Sets or retrieves whether the browser automatically performs wordwrap. + */ + noWrap: boolean; } -interface Blob { - type: string; - size: number; - msDetachStream(): any; - slice(start?: number, end?: number, contentType?: string): Blob; - msClose(): void; -} -declare var Blob: { - prototype: Blob; - new (blobParts?: any[], options?: BlobPropertyBag): Blob; +declare var HTMLDDElement: { + prototype: HTMLDDElement; + new(): HTMLDDElement; } -interface NavigatorID { - appVersion: string; - appName: string; - userAgent: string; - platform: string; - product: string; - vendor: string; +interface HTMLDListElement extends HTMLElement { + compact: boolean; } -interface HTMLTableElement extends HTMLElement, MSDataBindingTableExtensions, MSDataBindingExtensions, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorLight: any; - /** - * Sets or retrieves the amount of space between cells in a table. - */ - cellSpacing: string; - /** - * Retrieves the tFoot object of the table. - */ - tFoot: HTMLTableSectionElement; - /** - * Sets or retrieves the way the border frame around the table is displayed. - */ - frame: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: HTMLCollection; - /** - * Sets or retrieves which dividing lines (inner borders) are displayed. - */ - rules: string; - /** - * Sets or retrieves the number of columns in the table. - */ - cols: number; - /** - * Sets or retrieves a description and/or structure of the object. - */ - summary: string; - /** - * Retrieves the caption object of a table. - */ - caption: HTMLTableCaptionElement; - /** - * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order. - */ - tBodies: HTMLCollection; - /** - * Retrieves the tHead object of the table. - */ - tHead: HTMLTableSectionElement; - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; - /** - * Retrieves a collection of all cells in the table row or in the entire table. - */ - cells: HTMLCollection; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves the amount of space between the border of the cell and the content of the cell. - */ - cellPadding: string; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - border: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorDark: any; - /** - * Removes the specified row (tr) from the element and from the rows collection. - * @param index Number that specifies the zero-based position in the rows collection of the row to remove. - */ - deleteRow(index?: number): void; - /** - * Creates an empty tBody element in the table. - */ - createTBody(): HTMLElement; - /** - * Deletes the caption element and its contents from the table. - */ - deleteCaption(): void; - /** - * Creates a new row (tr) in the table, and adds the row to the rows collection. - * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. - */ - insertRow(index?: number): HTMLElement; - /** - * Deletes the tFoot element and its contents from the table. - */ - deleteTFoot(): void; - /** - * Returns the tHead element object if successful, or null otherwise. - */ - createTHead(): HTMLElement; - /** - * Deletes the tHead element and its contents from the table. - */ - deleteTHead(): void; - /** - * Creates an empty caption element in the table. - */ - createCaption(): HTMLElement; - /** - * Moves a table row to a new position. - * @param indexFrom Number that specifies the index in the rows collection of the table row that is moved. - * @param indexTo Number that specifies where the row is moved within the rows collection. - */ - moveRow(indexFrom?: number, indexTo?: number): any; - /** - * Creates an empty tFoot element in the table. - */ - createTFoot(): HTMLElement; -} -declare var HTMLTableElement: { - prototype: HTMLTableElement; - new(): HTMLTableElement; +declare var HTMLDListElement: { + prototype: HTMLDListElement; + new(): HTMLDListElement; } -interface TreeWalker { - whatToShow: number; - filter: NodeFilter; - root: Node; - currentNode: Node; - expandEntityReferences: boolean; - previousSibling(): Node; - lastChild(): Node; - nextSibling(): Node; - nextNode(): Node; - parentNode(): Node; - firstChild(): Node; - previousNode(): Node; -} -declare var TreeWalker: { - prototype: TreeWalker; - new(): TreeWalker; -} - -interface GetSVGDocument { - getSVGDocument(): Document; -} - -interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { - y: number; - y1: number; - x: number; - x1: number; -} -declare var SVGPathSegCurvetoQuadraticRel: { - prototype: SVGPathSegCurvetoQuadraticRel; - new(): SVGPathSegCurvetoQuadraticRel; -} - -interface Performance { - navigation: PerformanceNavigation; - timing: PerformanceTiming; - getEntriesByType(entryType: string): any; - toJSON(): any; - getMeasures(measureName?: string): any; - clearMarks(markName?: string): void; - getMarks(markName?: string): any; - clearResourceTimings(): void; - mark(markName: string): void; - measure(measureName: string, startMarkName?: string, endMarkName?: string): void; - getEntriesByName(name: string, entryType?: string): any; - getEntries(): any; - clearMeasures(measureName?: string): void; - setResourceTimingBufferSize(maxSize: number): void; - now(): number; -} -declare var Performance: { - prototype: Performance; - new(): Performance; -} - -interface MSDataBindingTableExtensions { - dataPageSize: number; - nextPage(): void; - firstPage(): void; - refresh(): void; - previousPage(): void; - lastPage(): void; -} - -interface CompositionEvent extends UIEvent { - data: string; - locale: string; - initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void; -} -declare var CompositionEvent: { - prototype: CompositionEvent; - new(): CompositionEvent; -} - -interface WindowTimers extends WindowTimersExtension { - clearTimeout(handle: number): void; - setTimeout(handler: any, timeout?: any, ...args: any[]): number; - clearInterval(handle: number): void; - setInterval(handler: any, timeout?: any, ...args: any[]): number; -} - -interface SVGMarkerElement extends SVGElement, SVGStylable, SVGLangSpace, SVGFitToViewBox, SVGExternalResourcesRequired { - orientType: SVGAnimatedEnumeration; - markerUnits: SVGAnimatedEnumeration; - markerWidth: SVGAnimatedLength; - markerHeight: SVGAnimatedLength; - orientAngle: SVGAnimatedAngle; - refY: SVGAnimatedLength; - refX: SVGAnimatedLength; - setOrientToAngle(angle: SVGAngle): void; - setOrientToAuto(): void; - SVG_MARKER_ORIENT_UNKNOWN: number; - SVG_MARKER_ORIENT_ANGLE: number; - SVG_MARKERUNITS_UNKNOWN: number; - SVG_MARKERUNITS_STROKEWIDTH: number; - SVG_MARKER_ORIENT_AUTO: number; - SVG_MARKERUNITS_USERSPACEONUSE: number; -} -declare var SVGMarkerElement: { - prototype: SVGMarkerElement; - new(): SVGMarkerElement; - SVG_MARKER_ORIENT_UNKNOWN: number; - SVG_MARKER_ORIENT_ANGLE: number; - SVG_MARKERUNITS_UNKNOWN: number; - SVG_MARKERUNITS_STROKEWIDTH: number; - SVG_MARKER_ORIENT_AUTO: number; - SVG_MARKERUNITS_USERSPACEONUSE: number; -} - -interface CSSStyleDeclaration { - backgroundAttachment: string; - visibility: string; - textAlignLast: string; - borderRightStyle: string; - counterIncrement: string; - orphans: string; - cssText: string; - borderStyle: string; - pointerEvents: string; - borderTopColor: string; - markerEnd: string; - textIndent: string; - listStyleImage: string; - cursor: string; - listStylePosition: string; - wordWrap: string; - borderTopStyle: string; - alignmentBaseline: string; - opacity: string; - direction: string; - strokeMiterlimit: string; - maxWidth: string; - color: string; - clip: string; - borderRightWidth: string; - verticalAlign: string; - overflow: string; - mask: string; - borderLeftStyle: string; - emptyCells: string; - stopOpacity: string; - paddingRight: string; - parentRule: CSSRule; - background: string; - boxSizing: string; - textJustify: string; - height: string; - paddingTop: string; - length: number; - right: string; - baselineShift: string; - borderLeft: string; - widows: string; - lineHeight: string; - left: string; - textUnderlinePosition: string; - glyphOrientationHorizontal: string; - display: string; - textAnchor: string; - cssFloat: string; - strokeDasharray: string; - rubyAlign: string; - fontSizeAdjust: string; - borderLeftColor: string; - backgroundImage: string; - listStyleType: string; - strokeWidth: string; - textOverflow: string; - fillRule: string; - borderBottomColor: string; - zIndex: string; - position: string; - listStyle: string; - msTransformOrigin: string; - dominantBaseline: string; - overflowY: string; - fill: string; - captionSide: string; - borderCollapse: string; - boxShadow: string; - quotes: string; - tableLayout: string; - unicodeBidi: string; - borderBottomWidth: string; - backgroundSize: string; - textDecoration: string; - strokeDashoffset: string; - fontSize: string; - border: string; - pageBreakBefore: string; - borderTopRightRadius: string; - msTransform: string; - borderBottomLeftRadius: string; - textTransform: string; - rubyPosition: string; - strokeLinejoin: string; - clipPath: string; - borderRightColor: string; - fontFamily: string; - clear: string; - content: string; - backgroundClip: string; - marginBottom: string; - counterReset: string; - outlineWidth: string; - marginRight: string; - paddingLeft: string; - borderBottom: string; - wordBreak: string; - marginTop: string; - top: string; - fontWeight: string; - borderRight: string; - width: string; - kerning: string; - pageBreakAfter: string; - borderBottomStyle: string; - fontStretch: string; - padding: string; - strokeOpacity: string; - markerStart: string; - bottom: string; - borderLeftWidth: string; - clipRule: string; - backgroundPosition: string; - backgroundColor: string; - pageBreakInside: string; - backgroundOrigin: string; - strokeLinecap: string; - borderTopWidth: string; - outlineStyle: string; - borderTop: string; - outlineColor: string; - paddingBottom: string; - marginLeft: string; - font: string; - outline: string; - wordSpacing: string; - maxHeight: string; - fillOpacity: string; - letterSpacing: string; - borderSpacing: string; - backgroundRepeat: string; - borderRadius: string; - borderWidth: string; - borderBottomRightRadius: string; - whiteSpace: string; - fontStyle: string; - minWidth: string; - stopColor: string; - borderTopLeftRadius: string; - borderColor: string; - marker: string; - glyphOrientationVertical: string; - markerMid: string; - fontVariant: string; - minHeight: string; - stroke: string; - rubyOverhang: string; - overflowX: string; - textAlign: string; - margin: string; - animationFillMode: string; - floodColor: string; - animationIterationCount: string; - textShadow: string; - backfaceVisibility: string; - msAnimationIterationCount: string; - animationDelay: string; - animationTimingFunction: string; - columnWidth: any; - msScrollSnapX: string; - columnRuleColor: any; - columnRuleWidth: any; - transitionDelay: string; - transition: string; - msFlowFrom: string; - msScrollSnapType: string; - msContentZoomSnapType: string; - msGridColumns: string; - msAnimationName: string; - msGridRowAlign: string; - msContentZoomChaining: string; - msGridColumn: any; - msHyphenateLimitZone: any; - msScrollRails: string; - msAnimationDelay: string; - enableBackground: string; - msWrapThrough: string; - columnRuleStyle: string; - msAnimation: string; - msFlexFlow: string; - msScrollSnapY: string; - msHyphenateLimitLines: any; - msTouchAction: string; - msScrollLimit: string; - animation: string; - transform: string; - filter: string; - colorInterpolationFilters: string; - transitionTimingFunction: string; - msBackfaceVisibility: string; - animationPlayState: string; - transformOrigin: string; - msScrollLimitYMin: any; - msFontFeatureSettings: string; - msContentZoomLimitMin: any; - columnGap: any; - transitionProperty: string; - msAnimationDuration: string; - msAnimationFillMode: string; - msFlexDirection: string; - msTransitionDuration: string; - fontFeatureSettings: string; - breakBefore: string; - msFlexWrap: string; - perspective: string; - msFlowInto: string; - msTransformStyle: string; - msScrollTranslation: string; - msTransitionProperty: string; - msUserSelect: string; - msOverflowStyle: string; - msScrollSnapPointsY: string; - animationDirection: string; - animationDuration: string; - msFlex: string; - msTransitionTimingFunction: string; - animationName: string; - columnRule: string; - msGridColumnSpan: any; - msFlexNegative: string; - columnFill: string; - msGridRow: any; - msFlexOrder: string; - msFlexItemAlign: string; - msFlexPositive: string; - msContentZoomLimitMax: any; - msScrollLimitYMax: any; - msGridColumnAlign: string; - perspectiveOrigin: string; - lightingColor: string; - columns: string; - msScrollChaining: string; - msHyphenateLimitChars: string; - msTouchSelect: string; - floodOpacity: string; - msAnimationDirection: string; - msAnimationPlayState: string; - columnSpan: string; - msContentZooming: string; - msPerspective: string; - msFlexPack: string; - msScrollSnapPointsX: string; - msContentZoomSnapPoints: string; - msGridRowSpan: any; - msContentZoomSnap: string; - msScrollLimitXMin: any; - breakInside: string; - msHighContrastAdjust: string; - msFlexLinePack: string; - msGridRows: string; - transitionDuration: string; - msHyphens: string; - breakAfter: string; - msTransition: string; - msPerspectiveOrigin: string; - msContentZoomLimit: string; - msScrollLimitXMax: any; - msFlexAlign: string; - msWrapMargin: any; - columnCount: any; - msAnimationTimingFunction: string; - msTransitionDelay: string; - transformStyle: string; - msWrapFlow: string; - msFlexPreferredSize: string; - alignItems: string; - borderImageSource: string; - flexBasis: string; - borderImageWidth: string; - borderImageRepeat: string; - order: string; - flex: string; - alignContent: string; - msImeAlign: string; - flexShrink: string; - flexGrow: string; - borderImageSlice: string; - flexWrap: string; - borderImageOutset: string; - flexDirection: string; - touchAction: string; - flexFlow: string; - borderImage: string; - justifyContent: string; - alignSelf: string; - msTextCombineHorizontal: string; - getPropertyPriority(propertyName: string): string; - getPropertyValue(propertyName: string): string; - removeProperty(propertyName: string): string; - item(index: number): string; - [index: number]: string; - setProperty(propertyName: string, value: string, priority?: string): void; -} -declare var CSSStyleDeclaration: { - prototype: CSSStyleDeclaration; - new(): CSSStyleDeclaration; -} - -interface SVGGElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGGElement: { - prototype: SVGGElement; - new(): SVGGElement; -} - -interface MSStyleCSSProperties extends MSCSSProperties { - pixelWidth: number; - posHeight: number; - posLeft: number; - pixelTop: number; - pixelBottom: number; - textDecorationNone: boolean; - pixelLeft: number; - posTop: number; - posBottom: number; - textDecorationOverline: boolean; - posWidth: number; - textDecorationLineThrough: boolean; - pixelHeight: number; - textDecorationBlink: boolean; - posRight: number; - pixelRight: number; - textDecorationUnderline: boolean; -} -declare var MSStyleCSSProperties: { - prototype: MSStyleCSSProperties; - new(): MSStyleCSSProperties; -} - -interface Navigator extends NavigatorID, NavigatorOnLine, NavigatorContentUtils, MSNavigatorExtensions, NavigatorGeolocation, MSNavigatorDoNotTrack, NavigatorStorageUtils, MSFileSaver { - msMaxTouchPoints: number; - msPointerEnabled: boolean; - msManipulationViewsEnabled: boolean; - pointerEnabled: boolean; - maxTouchPoints: number; - msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; -} -declare var Navigator: { - prototype: Navigator; - new(): Navigator; -} - -interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg { - y: number; - x2: number; - x: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicSmoothAbs: { - prototype: SVGPathSegCurvetoCubicSmoothAbs; - new(): SVGPathSegCurvetoCubicSmoothAbs; -} - -interface SVGZoomEvent extends UIEvent { - zoomRectScreen: SVGRect; - previousScale: number; - newScale: number; - previousTranslate: SVGPoint; - newTranslate: SVGPoint; -} -declare var SVGZoomEvent: { - prototype: SVGZoomEvent; - new(): SVGZoomEvent; -} - -interface NodeSelector { - querySelectorAll(selectors: string): NodeList; - querySelector(selectors: string): Element; -} - -interface HTMLTableDataCellElement extends HTMLTableCellElement { -} -declare var HTMLTableDataCellElement: { - prototype: HTMLTableDataCellElement; - new(): HTMLTableDataCellElement; -} - -interface HTMLBaseElement extends HTMLElement { +interface HTMLDTElement extends HTMLElement { /** - * Sets or retrieves the window or frame at which to target content. + * Sets or retrieves whether the browser automatically performs wordwrap. */ - target: string; - /** - * Gets or sets the baseline URL on which relative links are based. - */ - href: string; -} -declare var HTMLBaseElement: { - prototype: HTMLBaseElement; - new(): HTMLBaseElement; + noWrap: boolean; } -interface ClientRect { - left: number; - width: number; - right: number; - top: number; - bottom: number; - height: number; -} -declare var ClientRect: { - prototype: ClientRect; - new(): ClientRect; +declare var HTMLDTElement: { + prototype: HTMLDTElement; + new(): HTMLDTElement; } -interface PositionErrorCallback { - (error: PositionError): void; +interface HTMLDataListElement extends HTMLElement { + options: HTMLCollection; } -interface DOMImplementation { - createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; - createDocument(namespaceURI: string, qualifiedName: string, doctype: DocumentType): Document; - hasFeature(feature: string, version?: string): boolean; - createHTMLDocument(title: string): Document; -} -declare var DOMImplementation: { - prototype: DOMImplementation; - new(): DOMImplementation; +declare var HTMLDataListElement: { + prototype: HTMLDataListElement; + new(): HTMLDataListElement; } -interface SVGUnitTypes { - SVG_UNIT_TYPE_UNKNOWN: number; - SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; - SVG_UNIT_TYPE_USERSPACEONUSE: number; -} -declare var SVGUnitTypes: SVGUnitTypes; - -interface Element extends Node, NodeSelector, ElementTraversal, GlobalEventHandlers { - scrollTop: number; - clientLeft: number; - scrollLeft: number; - tagName: string; - clientWidth: number; - scrollWidth: number; - clientHeight: number; - clientTop: number; - scrollHeight: number; - msRegionOverflow: string; - onmspointerdown: (ev: any) => any; - onmsgotpointercapture: (ev: any) => any; - onmsgesturedoubletap: (ev: any) => any; - onmspointerhover: (ev: any) => any; - onmsgesturehold: (ev: any) => any; - onmspointermove: (ev: any) => any; - onmsgesturechange: (ev: any) => any; - onmsgesturestart: (ev: any) => any; - onmspointercancel: (ev: any) => any; - onmsgestureend: (ev: any) => any; - onmsgesturetap: (ev: any) => any; - onmspointerout: (ev: any) => any; - onmsinertiastart: (ev: any) => any; - onmslostpointercapture: (ev: any) => any; - onmspointerover: (ev: any) => any; - msContentZoomFactor: number; - onmspointerup: (ev: any) => any; - onlostpointercapture: (ev: PointerEvent) => any; - onmspointerenter: (ev: any) => any; - ongotpointercapture: (ev: PointerEvent) => any; - onmspointerleave: (ev: any) => any; - getAttribute(name?: string): string; - getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; - hasAttributeNS(namespaceURI: string, localName: string): boolean; - getBoundingClientRect(): ClientRect; - getAttributeNS(namespaceURI: string, localName: string): string; - getAttributeNodeNS(namespaceURI: string, localName: string): Attr; - setAttributeNodeNS(newAttr: Attr): Attr; - msMatchesSelector(selectors: string): boolean; - hasAttribute(name: string): boolean; - removeAttribute(name?: string): void; - setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; - getAttributeNode(name: string): Attr; - fireEvent(eventName: string, eventObj?: any): boolean; - getElementsByTagName(name: "a"): NodeListOf; - getElementsByTagName(name: "abbr"): NodeListOf; - getElementsByTagName(name: "acronym"): NodeListOf; - getElementsByTagName(name: "address"): NodeListOf; - getElementsByTagName(name: "applet"): NodeListOf; - getElementsByTagName(name: "area"): NodeListOf; - getElementsByTagName(name: "article"): NodeListOf; - getElementsByTagName(name: "aside"): NodeListOf; - getElementsByTagName(name: "audio"): NodeListOf; - getElementsByTagName(name: "b"): NodeListOf; - getElementsByTagName(name: "base"): NodeListOf; - getElementsByTagName(name: "basefont"): NodeListOf; - getElementsByTagName(name: "bdo"): NodeListOf; - getElementsByTagName(name: "bgsound"): NodeListOf; - getElementsByTagName(name: "big"): NodeListOf; - getElementsByTagName(name: "blockquote"): NodeListOf; - getElementsByTagName(name: "body"): NodeListOf; - getElementsByTagName(name: "br"): NodeListOf; - getElementsByTagName(name: "button"): NodeListOf; - getElementsByTagName(name: "canvas"): NodeListOf; - getElementsByTagName(name: "caption"): NodeListOf; - getElementsByTagName(name: "center"): NodeListOf; - getElementsByTagName(name: "cite"): NodeListOf; - getElementsByTagName(name: "code"): NodeListOf; - getElementsByTagName(name: "col"): NodeListOf; - getElementsByTagName(name: "colgroup"): NodeListOf; - getElementsByTagName(name: "datalist"): NodeListOf; - getElementsByTagName(name: "dd"): NodeListOf; - getElementsByTagName(name: "del"): NodeListOf; - getElementsByTagName(name: "dfn"): NodeListOf; - getElementsByTagName(name: "dir"): NodeListOf; - getElementsByTagName(name: "div"): NodeListOf; - getElementsByTagName(name: "dl"): NodeListOf; - getElementsByTagName(name: "dt"): NodeListOf; - getElementsByTagName(name: "em"): NodeListOf; - getElementsByTagName(name: "embed"): NodeListOf; - getElementsByTagName(name: "fieldset"): NodeListOf; - getElementsByTagName(name: "figcaption"): NodeListOf; - getElementsByTagName(name: "figure"): NodeListOf; - getElementsByTagName(name: "font"): NodeListOf; - getElementsByTagName(name: "footer"): NodeListOf; - getElementsByTagName(name: "form"): NodeListOf; - getElementsByTagName(name: "frame"): NodeListOf; - getElementsByTagName(name: "frameset"): NodeListOf; - getElementsByTagName(name: "h1"): NodeListOf; - getElementsByTagName(name: "h2"): NodeListOf; - getElementsByTagName(name: "h3"): NodeListOf; - getElementsByTagName(name: "h4"): NodeListOf; - getElementsByTagName(name: "h5"): NodeListOf; - getElementsByTagName(name: "h6"): NodeListOf; - getElementsByTagName(name: "head"): NodeListOf; - getElementsByTagName(name: "header"): NodeListOf; - getElementsByTagName(name: "hgroup"): NodeListOf; - getElementsByTagName(name: "hr"): NodeListOf; - getElementsByTagName(name: "html"): NodeListOf; - getElementsByTagName(name: "i"): NodeListOf; - getElementsByTagName(name: "iframe"): NodeListOf; - getElementsByTagName(name: "img"): NodeListOf; - getElementsByTagName(name: "input"): NodeListOf; - getElementsByTagName(name: "ins"): NodeListOf; - getElementsByTagName(name: "isindex"): NodeListOf; - getElementsByTagName(name: "kbd"): NodeListOf; - getElementsByTagName(name: "keygen"): NodeListOf; - getElementsByTagName(name: "label"): NodeListOf; - getElementsByTagName(name: "legend"): NodeListOf; - getElementsByTagName(name: "li"): NodeListOf; - getElementsByTagName(name: "link"): NodeListOf; - getElementsByTagName(name: "listing"): NodeListOf; - getElementsByTagName(name: "map"): NodeListOf; - getElementsByTagName(name: "mark"): NodeListOf; - getElementsByTagName(name: "marquee"): NodeListOf; - getElementsByTagName(name: "menu"): NodeListOf; - getElementsByTagName(name: "meta"): NodeListOf; - getElementsByTagName(name: "nav"): NodeListOf; - getElementsByTagName(name: "nextid"): NodeListOf; - getElementsByTagName(name: "nobr"): NodeListOf; - getElementsByTagName(name: "noframes"): NodeListOf; - getElementsByTagName(name: "noscript"): NodeListOf; - getElementsByTagName(name: "object"): NodeListOf; - getElementsByTagName(name: "ol"): NodeListOf; - getElementsByTagName(name: "optgroup"): NodeListOf; - getElementsByTagName(name: "option"): NodeListOf; - getElementsByTagName(name: "p"): NodeListOf; - getElementsByTagName(name: "param"): NodeListOf; - getElementsByTagName(name: "plaintext"): NodeListOf; - getElementsByTagName(name: "pre"): NodeListOf; - getElementsByTagName(name: "progress"): NodeListOf; - getElementsByTagName(name: "q"): NodeListOf; - getElementsByTagName(name: "rt"): NodeListOf; - getElementsByTagName(name: "ruby"): NodeListOf; - getElementsByTagName(name: "s"): NodeListOf; - getElementsByTagName(name: "samp"): NodeListOf; - getElementsByTagName(name: "script"): NodeListOf; - getElementsByTagName(name: "section"): NodeListOf; - getElementsByTagName(name: "select"): NodeListOf; - getElementsByTagName(name: "small"): NodeListOf; - getElementsByTagName(name: "SOURCE"): NodeListOf; - getElementsByTagName(name: "span"): NodeListOf; - getElementsByTagName(name: "strike"): NodeListOf; - getElementsByTagName(name: "strong"): NodeListOf; - getElementsByTagName(name: "style"): NodeListOf; - getElementsByTagName(name: "sub"): NodeListOf; - getElementsByTagName(name: "sup"): NodeListOf; - getElementsByTagName(name: "table"): NodeListOf; - getElementsByTagName(name: "tbody"): NodeListOf; - getElementsByTagName(name: "td"): NodeListOf; - getElementsByTagName(name: "textarea"): NodeListOf; - getElementsByTagName(name: "tfoot"): NodeListOf; - getElementsByTagName(name: "th"): NodeListOf; - getElementsByTagName(name: "thead"): NodeListOf; - getElementsByTagName(name: "title"): NodeListOf; - getElementsByTagName(name: "tr"): NodeListOf; - getElementsByTagName(name: "track"): NodeListOf; - getElementsByTagName(name: "tt"): NodeListOf; - getElementsByTagName(name: "u"): NodeListOf; - getElementsByTagName(name: "ul"): NodeListOf; - getElementsByTagName(name: "var"): NodeListOf; - getElementsByTagName(name: "video"): NodeListOf; - getElementsByTagName(name: "wbr"): NodeListOf; - getElementsByTagName(name: "x-ms-webview"): NodeListOf; - getElementsByTagName(name: "xmp"): NodeListOf; - getElementsByTagName(name: string): NodeList; - getClientRects(): ClientRectList; - setAttributeNode(newAttr: Attr): Attr; - removeAttributeNode(oldAttr: Attr): Attr; - setAttribute(name?: string, value?: string): void; - removeAttributeNS(namespaceURI: string, localName: string): void; - msGetRegionContent(): MSRangeCollection; - msReleasePointerCapture(pointerId: number): void; - msSetPointerCapture(pointerId: number): void; - msZoomTo(args: MsZoomToOptions): void; - setPointerCapture(pointerId: number): void; - msGetUntransformedBounds(): ClientRect; - releasePointerCapture(pointerId: number): void; - msRequestFullscreen(): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Element: { - prototype: Element; - new(): Element; +interface HTMLDirectoryElement extends HTMLElement { + compact: boolean; } -interface HTMLNextIdElement extends HTMLElement { - n: string; -} -declare var HTMLNextIdElement: { - prototype: HTMLNextIdElement; - new(): HTMLNextIdElement; +declare var HTMLDirectoryElement: { + prototype: HTMLDirectoryElement; + new(): HTMLDirectoryElement; } -interface SVGPathSegMovetoRel extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegMovetoRel: { - prototype: SVGPathSegMovetoRel; - new(): SVGPathSegMovetoRel; -} - -interface SVGLineElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - y1: SVGAnimatedLength; - x2: SVGAnimatedLength; - x1: SVGAnimatedLength; - y2: SVGAnimatedLength; -} -declare var SVGLineElement: { - prototype: SVGLineElement; - new(): SVGLineElement; -} - -interface HTMLParagraphElement extends HTMLElement, DOML2DeprecatedTextFlowControl { +interface HTMLDivElement extends HTMLElement { /** * Sets or retrieves how the object is aligned with adjacent text. */ align: string; -} -declare var HTMLParagraphElement: { - prototype: HTMLParagraphElement; - new(): HTMLParagraphElement; -} - -interface HTMLAreasCollection extends HTMLCollection { /** - * Removes an element from the collection. + * Sets or retrieves whether the browser automatically performs wordwrap. */ - remove(index?: number): void; - /** - * Adds an element to the areas, controlRange, or options collection. - */ - add(element: HTMLElement, before?: any): void; -} -declare var HTMLAreasCollection: { - prototype: HTMLAreasCollection; - new(): HTMLAreasCollection; + noWrap: boolean; } -interface SVGDescElement extends SVGElement, SVGStylable, SVGLangSpace { -} -declare var SVGDescElement: { - prototype: SVGDescElement; - new(): SVGDescElement; +declare var HTMLDivElement: { + prototype: HTMLDivElement; + new(): HTMLDivElement; } -interface Node extends EventTarget { - nodeType: number; - previousSibling: Node; - localName: string; - namespaceURI: string; - textContent: string; - parentNode: Node; - nextSibling: Node; - nodeValue: string; - lastChild: Node; - childNodes: NodeList; - nodeName: string; - ownerDocument: Document; - attributes: NamedNodeMap; - firstChild: Node; - prefix: string; - removeChild(oldChild: Node): Node; - appendChild(newChild: Node): Node; - isSupported(feature: string, version: string): boolean; - isEqualNode(arg: Node): boolean; - lookupPrefix(namespaceURI: string): string; - isDefaultNamespace(namespaceURI: string): boolean; - compareDocumentPosition(other: Node): number; - normalize(): void; - isSameNode(other: Node): boolean; - hasAttributes(): boolean; - lookupNamespaceURI(prefix: string): string; - cloneNode(deep?: boolean): Node; - hasChildNodes(): boolean; - replaceChild(newChild: Node, oldChild: Node): Node; - insertBefore(newChild: Node, refChild?: Node): Node; - ENTITY_REFERENCE_NODE: number; - ATTRIBUTE_NODE: number; - DOCUMENT_FRAGMENT_NODE: number; - TEXT_NODE: number; - ELEMENT_NODE: number; - COMMENT_NODE: number; - DOCUMENT_POSITION_DISCONNECTED: number; - DOCUMENT_POSITION_CONTAINED_BY: number; - DOCUMENT_POSITION_CONTAINS: number; - DOCUMENT_TYPE_NODE: number; - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - DOCUMENT_NODE: number; - ENTITY_NODE: number; - PROCESSING_INSTRUCTION_NODE: number; - CDATA_SECTION_NODE: number; - NOTATION_NODE: number; - DOCUMENT_POSITION_FOLLOWING: number; - DOCUMENT_POSITION_PRECEDING: number; -} -declare var Node: { - prototype: Node; - new(): Node; - ENTITY_REFERENCE_NODE: number; - ATTRIBUTE_NODE: number; - DOCUMENT_FRAGMENT_NODE: number; - TEXT_NODE: number; - ELEMENT_NODE: number; - COMMENT_NODE: number; - DOCUMENT_POSITION_DISCONNECTED: number; - DOCUMENT_POSITION_CONTAINED_BY: number; - DOCUMENT_POSITION_CONTAINS: number; - DOCUMENT_TYPE_NODE: number; - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - DOCUMENT_NODE: number; - ENTITY_NODE: number; - PROCESSING_INSTRUCTION_NODE: number; - CDATA_SECTION_NODE: number; - NOTATION_NODE: number; - DOCUMENT_POSITION_FOLLOWING: number; - DOCUMENT_POSITION_PRECEDING: number; +interface HTMLDocument extends Document { } -interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegCurvetoQuadraticSmoothRel: { - prototype: SVGPathSegCurvetoQuadraticSmoothRel; - new(): SVGPathSegCurvetoQuadraticSmoothRel; +declare var HTMLDocument: { + prototype: HTMLDocument; + new(): HTMLDocument; } -interface DOML2DeprecatedListSpaceReduction { - compact: boolean; +interface HTMLElement extends Element { + accessKey: string; + children: HTMLCollection; + className: string; + contentEditable: string; + dataset: DOMStringMap; + dir: string; + draggable: boolean; + hidden: boolean; + hideFocus: boolean; + id: string; + innerHTML: string; + innerText: string; + isContentEditable: boolean; + lang: string; + offsetHeight: number; + offsetLeft: number; + offsetParent: Element; + offsetTop: number; + offsetWidth: number; + onabort: (ev: Event) => any; + onactivate: (ev: UIEvent) => any; + onbeforeactivate: (ev: UIEvent) => any; + onbeforecopy: (ev: DragEvent) => any; + onbeforecut: (ev: DragEvent) => any; + onbeforedeactivate: (ev: UIEvent) => any; + onbeforepaste: (ev: DragEvent) => any; + onblur: (ev: FocusEvent) => any; + oncanplay: (ev: Event) => any; + oncanplaythrough: (ev: Event) => any; + onchange: (ev: Event) => any; + onclick: (ev: MouseEvent) => any; + oncontextmenu: (ev: PointerEvent) => any; + oncopy: (ev: DragEvent) => any; + oncuechange: (ev: Event) => any; + oncut: (ev: DragEvent) => any; + ondblclick: (ev: MouseEvent) => any; + ondeactivate: (ev: UIEvent) => any; + ondrag: (ev: DragEvent) => any; + ondragend: (ev: DragEvent) => any; + ondragenter: (ev: DragEvent) => any; + ondragleave: (ev: DragEvent) => any; + ondragover: (ev: DragEvent) => any; + ondragstart: (ev: DragEvent) => any; + ondrop: (ev: DragEvent) => any; + ondurationchange: (ev: Event) => any; + onemptied: (ev: Event) => any; + onended: (ev: Event) => any; + onerror: (ev: Event) => any; + onfocus: (ev: FocusEvent) => any; + oninput: (ev: Event) => any; + onkeydown: (ev: KeyboardEvent) => any; + onkeypress: (ev: KeyboardEvent) => any; + onkeyup: (ev: KeyboardEvent) => any; + onload: (ev: Event) => any; + onloadeddata: (ev: Event) => any; + onloadedmetadata: (ev: Event) => any; + onloadstart: (ev: Event) => any; + onmousedown: (ev: MouseEvent) => any; + onmouseenter: (ev: MouseEvent) => any; + onmouseleave: (ev: MouseEvent) => any; + onmousemove: (ev: MouseEvent) => any; + onmouseout: (ev: MouseEvent) => any; + onmouseover: (ev: MouseEvent) => any; + onmouseup: (ev: MouseEvent) => any; + onmousewheel: (ev: MouseWheelEvent) => any; + onmscontentzoom: (ev: UIEvent) => any; + onmsmanipulationstatechanged: (ev: MSManipulationEvent) => any; + onpaste: (ev: DragEvent) => any; + onpause: (ev: Event) => any; + onplay: (ev: Event) => any; + onplaying: (ev: Event) => any; + onprogress: (ev: ProgressEvent) => any; + onratechange: (ev: Event) => any; + onreset: (ev: Event) => any; + onscroll: (ev: UIEvent) => any; + onseeked: (ev: Event) => any; + onseeking: (ev: Event) => any; + onselect: (ev: UIEvent) => any; + onselectstart: (ev: Event) => any; + onstalled: (ev: Event) => any; + onsubmit: (ev: Event) => any; + onsuspend: (ev: Event) => any; + ontimeupdate: (ev: Event) => any; + onvolumechange: (ev: Event) => any; + onwaiting: (ev: Event) => any; + outerHTML: string; + outerText: string; + spellcheck: boolean; + style: CSSStyleDeclaration; + tabIndex: number; + title: string; + blur(): void; + click(): void; + contains(child: HTMLElement): boolean; + dragDrop(): boolean; + focus(): void; + getElementsByClassName(classNames: string): NodeList; + insertAdjacentElement(position: string, insertedElement: Element): Element; + insertAdjacentHTML(where: string, html: string): void; + insertAdjacentText(where: string, text: string): void; + msGetInputContext(): MSInputMethodContext; + scrollIntoView(top?: boolean): void; + setActive(): void; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface MSScriptHost { -} -declare var MSScriptHost: { - prototype: MSScriptHost; - new(): MSScriptHost; +declare var HTMLElement: { + prototype: HTMLElement; + new(): HTMLElement; } -interface SVGClipPathElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - clipPathUnits: SVGAnimatedEnumeration; -} -declare var SVGClipPathElement: { - prototype: SVGClipPathElement; - new(): SVGClipPathElement; -} - -interface MouseEvent extends UIEvent { - toElement: Element; - layerY: number; - fromElement: Element; - which: number; - pageX: number; - offsetY: number; - x: number; - y: number; - metaKey: boolean; - altKey: boolean; - ctrlKey: boolean; - offsetX: number; - screenX: number; - clientY: number; - shiftKey: boolean; - layerX: number; - screenY: number; - relatedTarget: EventTarget; - button: number; - pageY: number; - buttons: number; - clientX: number; - initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget): void; - getModifierState(keyArg: string): boolean; -} -declare var MouseEvent: { - prototype: MouseEvent; - new(): MouseEvent; -} - -interface RangeException { - code: number; - message: string; - name: string; - toString(): string; - INVALID_NODE_TYPE_ERR: number; - BAD_BOUNDARYPOINTS_ERR: number; -} -declare var RangeException: { - prototype: RangeException; - new(): RangeException; - INVALID_NODE_TYPE_ERR: number; - BAD_BOUNDARYPOINTS_ERR: number; -} - -interface SVGTextPositioningElement extends SVGTextContentElement { - y: SVGAnimatedLengthList; - rotate: SVGAnimatedNumberList; - dy: SVGAnimatedLengthList; - x: SVGAnimatedLengthList; - dx: SVGAnimatedLengthList; -} -declare var SVGTextPositioningElement: { - prototype: SVGTextPositioningElement; - new(): SVGTextPositioningElement; -} - -interface HTMLAppletElement extends HTMLElement, DOML2DeprecatedMarginStyle, DOML2DeprecatedBorderStyle, DOML2DeprecatedAlignmentStyle, MSDataBindingExtensions, MSDataBindingRecordSetExtensions { - width: number; - /** - * Sets or retrieves the Internet media type for the code associated with the object. - */ - codeType: string; - object: string; - form: HTMLFormElement; - code: string; - /** - * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. - */ - archive: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves a message to be displayed while an object is loading. - */ - standby: string; - /** - * Sets or retrieves the class identifier for the object. - */ - classid: string; - /** - * Sets or retrieves the shape of the object. - */ - name: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Sets or retrieves the URL that references the data of the object. - */ - data: string; +interface HTMLEmbedElement extends HTMLElement, GetSVGDocument { /** * Sets or retrieves the height of the object. */ height: string; + hidden: any; /** - * Gets or sets the optional alternative HTML script to execute if the object fails to load. + * Gets or sets whether the DLNA PlayTo device is available. */ - altHtml: string; + msPlayToDisabled: boolean; /** - * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned. + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. */ - contentDocument: Document; + msPlayToPreferredSourceUri: string; /** - * Sets or retrieves the URL of the component. + * Gets or sets the primary DLNA PlayTo device. */ - codeBase: string; + msPlayToPrimary: boolean; /** - * Sets or retrieves a character string that can be used to implement your own declare functionality for the object. + * Gets the source associated with the media element for use by the PlayToManager. */ - declare: boolean; - /** - * Returns the content type of the object. - */ - type: string; - /** - * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. - */ - BaseHref: string; -} -declare var HTMLAppletElement: { - prototype: HTMLAppletElement; - new(): HTMLAppletElement; -} - -interface TextMetrics { - width: number; -} -declare var TextMetrics: { - prototype: TextMetrics; - new(): TextMetrics; -} - -interface DocumentEvent { - createEvent(eventInterface: "AnimationEvent"): AnimationEvent; - createEvent(eventInterface: "CloseEvent"): CloseEvent; - createEvent(eventInterface: "CompositionEvent"): CompositionEvent; - createEvent(eventInterface: "CustomEvent"): CustomEvent; - createEvent(eventInterface: "DeviceMotionEvent"): DeviceMotionEvent; - createEvent(eventInterface: "DeviceOrientationEvent"): DeviceOrientationEvent; - createEvent(eventInterface: "DragEvent"): DragEvent; - createEvent(eventInterface: "ErrorEvent"): ErrorEvent; - createEvent(eventInterface: "Event"): Event; - createEvent(eventInterface: "Events"): Event; - createEvent(eventInterface: "FocusEvent"): FocusEvent; - createEvent(eventInterface: "HTMLEvents"): Event; - createEvent(eventInterface: "IDBVersionChangeEvent"): IDBVersionChangeEvent; - createEvent(eventInterface: "KeyboardEvent"): KeyboardEvent; - createEvent(eventInterface: "LongRunningScriptDetectedEvent"): LongRunningScriptDetectedEvent; - createEvent(eventInterface: "MessageEvent"): MessageEvent; - createEvent(eventInterface: "MouseEvent"): MouseEvent; - createEvent(eventInterface: "MouseEvents"): MouseEvent; - createEvent(eventInterface: "MouseWheelEvent"): MouseWheelEvent; - createEvent(eventInterface: "MSGestureEvent"): MSGestureEvent; - createEvent(eventInterface: "MSPointerEvent"): MSPointerEvent; - createEvent(eventInterface: "MutationEvent"): MutationEvent; - createEvent(eventInterface: "MutationEvents"): MutationEvent; - createEvent(eventInterface: "NavigationCompletedEvent"): NavigationCompletedEvent; - createEvent(eventInterface: "NavigationEvent"): NavigationEvent; - createEvent(eventInterface: "PageTransitionEvent"): PageTransitionEvent; - createEvent(eventInterface: "PointerEvent"): MSPointerEvent; - createEvent(eventInterface: "PopStateEvent"): PopStateEvent; - createEvent(eventInterface: "ProgressEvent"): ProgressEvent; - createEvent(eventInterface: "StorageEvent"): StorageEvent; - createEvent(eventInterface: "SVGZoomEvents"): SVGZoomEvent; - createEvent(eventInterface: "TextEvent"): TextEvent; - createEvent(eventInterface: "TrackEvent"): TrackEvent; - createEvent(eventInterface: "TransitionEvent"): TransitionEvent; - createEvent(eventInterface: "UIEvent"): UIEvent; - createEvent(eventInterface: "UIEvents"): UIEvent; - createEvent(eventInterface: "UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent; - createEvent(eventInterface: "WebGLContextEvent"): WebGLContextEvent; - createEvent(eventInterface: "WheelEvent"): WheelEvent; - createEvent(eventInterface: string): Event; -} - -interface HTMLOListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { - /** - * The starting number. - */ - start: number; -} -declare var HTMLOListElement: { - prototype: HTMLOListElement; - new(): HTMLOListElement; -} - -interface SVGPathSegLinetoVerticalRel extends SVGPathSeg { - y: number; -} -declare var SVGPathSegLinetoVerticalRel: { - prototype: SVGPathSegLinetoVerticalRel; - new(): SVGPathSegLinetoVerticalRel; -} - -interface SVGAnimatedString { - animVal: string; - baseVal: string; -} -declare var SVGAnimatedString: { - prototype: SVGAnimatedString; - new(): SVGAnimatedString; -} - -interface CDATASection extends Text { -} -declare var CDATASection: { - prototype: CDATASection; - new(): CDATASection; -} - -interface StyleMedia { - type: string; - matchMedium(mediaquery: string): boolean; -} -declare var StyleMedia: { - prototype: StyleMedia; - new(): StyleMedia; -} - -interface HTMLSelectElement extends HTMLElement, MSHTMLCollectionExtensions, MSDataBindingExtensions { - options: HTMLSelectElement; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; + msPlayToSource: any; /** * Sets or retrieves the name of the object. */ name: string; /** - * Sets or retrieves the number of rows in the list box. + * Retrieves the palette used for the embedded document. */ - size: number; + palette: string; + /** + * Retrieves the URL of the plug-in used to view an embedded document. + */ + pluginspage: string; + readyState: string; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the height and width units of the embed object. + */ + units: string; + /** + * Sets or retrieves the width of the object. + */ + width: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLEmbedElement: { + prototype: HTMLEmbedElement; + new(): HTMLEmbedElement; +} + +interface HTMLFieldSetElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; +} + +declare var HTMLFieldSetElement: { + prototype: HTMLFieldSetElement; + new(): HTMLFieldSetElement; +} + +interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { + /** + * Sets or retrieves the current typeface family. + */ + face: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLFontElement: { + prototype: HTMLFontElement; + new(): HTMLFontElement; +} + +interface HTMLFormElement extends HTMLElement { + /** + * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form. + */ + acceptCharset: string; + /** + * Sets or retrieves the URL to which the form content is sent for processing. + */ + action: string; + /** + * Specifies whether autocomplete is applied to an editable text field. + */ + autocomplete: string; + /** + * Retrieves a collection, in source order, of all controls in a given form. + */ + elements: HTMLCollection; + /** + * Sets or retrieves the MIME encoding for the form. + */ + encoding: string; + /** + * Sets or retrieves the encoding type for the form. + */ + enctype: string; /** * Sets or retrieves the number of objects in a collection. */ length: number; /** - * Sets or retrieves the index of the selected option in a select object. + * Sets or retrieves how to send the form data to the server. */ - selectedIndex: number; + method: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Designates a form that is not validated when submitted. + */ + noValidate: boolean; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Retrieves a form object or an object from an elements collection. + * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. + * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. + */ + item(name?: any, index?: any): any; + /** + * Retrieves a form object or an object from an elements collection. + */ + namedItem(name: string): any; + /** + * Fires when the user resets a form. + */ + reset(): void; + /** + * Fires when a FORM is about to be submitted. + */ + submit(): void; + [name: string]: any; +} + +declare var HTMLFormElement: { + prototype: HTMLFormElement; + new(): HTMLFormElement; +} + +interface HTMLFrameElement extends HTMLElement, GetSVGDocument { + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Retrieves the document object of the page or frame. + */ + contentDocument: Document; + /** + * Retrieves the object of the specified. + */ + contentWindow: Window; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + /** + * Sets or retrieves the height of the object. + */ + height: string | number; + /** + * Sets or retrieves a URI to a long description of the object. + */ + longDesc: string; + /** + * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. + */ + marginHeight: string; + /** + * Sets or retrieves the left and right margin widths before displaying the text in a frame. + */ + marginWidth: string; + /** + * Sets or retrieves the frame name. + */ + name: string; + /** + * Sets or retrieves whether the user can resize the frame. + */ + noResize: boolean; + /** + * Raised when the object has been completely received from the server. + */ + onload: (ev: Event) => any; + /** + * Sets or retrieves whether the frame can be scrolled. + */ + scrolling: string; + /** + * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. + */ + security: any; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the width of the object. + */ + width: string | number; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLFrameElement: { + prototype: HTMLFrameElement; + new(): HTMLFrameElement; +} + +interface HTMLFrameSetElement extends HTMLElement { + border: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Sets or retrieves the frame widths of the object. + */ + cols: string; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + name: string; + onafterprint: (ev: Event) => any; + onbeforeprint: (ev: Event) => any; + onbeforeunload: (ev: BeforeUnloadEvent) => any; + /** + * Fires when the object loses the input focus. + */ + onblur: (ev: FocusEvent) => any; + onerror: (ev: Event) => any; + /** + * Fires when the object receives focus. + */ + onfocus: (ev: FocusEvent) => any; + onhashchange: (ev: HashChangeEvent) => any; + onload: (ev: Event) => any; + onmessage: (ev: MessageEvent) => any; + onoffline: (ev: Event) => any; + ononline: (ev: Event) => any; + onorientationchange: (ev: Event) => any; + onpagehide: (ev: PageTransitionEvent) => any; + onpageshow: (ev: PageTransitionEvent) => any; + onresize: (ev: UIEvent) => any; + onstorage: (ev: StorageEvent) => any; + onunload: (ev: Event) => any; + /** + * Sets or retrieves the frame heights of the object. + */ + rows: string; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLFrameSetElement: { + prototype: HTMLFrameSetElement; + new(): HTMLFrameSetElement; +} + +interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves whether the horizontal rule is drawn with 3-D shading. + */ + noShade: boolean; + /** + * Sets or retrieves the width of the object. + */ + width: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLHRElement: { + prototype: HTMLHRElement; + new(): HTMLHRElement; +} + +interface HTMLHeadElement extends HTMLElement { + profile: string; +} + +declare var HTMLHeadElement: { + prototype: HTMLHeadElement; + new(): HTMLHeadElement; +} + +interface HTMLHeadingElement extends HTMLElement { + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; + clear: string; +} + +declare var HTMLHeadingElement: { + prototype: HTMLHeadingElement; + new(): HTMLHeadingElement; +} + +interface HTMLHtmlElement extends HTMLElement { + /** + * Sets or retrieves the DTD version that governs the current document. + */ + version: string; +} + +declare var HTMLHtmlElement: { + prototype: HTMLHtmlElement; + new(): HTMLHtmlElement; +} + +interface HTMLIFrameElement extends HTMLElement, GetSVGDocument { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + allowFullscreen: boolean; + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Retrieves the document object of the page or frame. + */ + contentDocument: Document; + /** + * Retrieves the object of the specified. + */ + contentWindow: Window; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Sets or retrieves the horizontal margin for the object. + */ + hspace: number; + /** + * Sets or retrieves a URI to a long description of the object. + */ + longDesc: string; + /** + * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. + */ + marginHeight: string; + /** + * Sets or retrieves the left and right margin widths before displaying the text in a frame. + */ + marginWidth: string; + /** + * Sets or retrieves the frame name. + */ + name: string; + /** + * Sets or retrieves whether the user can resize the frame. + */ + noResize: boolean; + /** + * Raised when the object has been completely received from the server. + */ + onload: (ev: Event) => any; + sandbox: DOMSettableTokenList; + /** + * Sets or retrieves whether the frame can be scrolled. + */ + scrolling: string; + /** + * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. + */ + security: any; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: string; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLIFrameElement: { + prototype: HTMLIFrameElement; + new(): HTMLIFrameElement; +} + +interface HTMLImageElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Retrieves whether the object is fully loaded. + */ + complete: boolean; + crossOrigin: string; + currentSrc: string; + /** + * Sets or retrieves the height of the object. + */ + height: number; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + hspace: number; + /** + * Sets or retrieves whether the image is a server-side image map. + */ + isMap: boolean; + /** + * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object. + */ + longDesc: string; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * The original height of the image resource before sizing. + */ + naturalHeight: number; + /** + * The original width of the image resource before sizing. + */ + naturalWidth: number; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + srcset: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: number; + x: number; + y: number; + msGetAsCastingSource(): any; +} + +declare var HTMLImageElement: { + prototype: HTMLImageElement; + new(): HTMLImageElement; + create(): HTMLImageElement; +} + +interface HTMLInputElement extends HTMLElement { + /** + * Sets or retrieves a comma-separated list of content types. + */ + accept: string; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Specifies whether autocomplete is applied to an editable text field. + */ + autocomplete: string; + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + border: string; + /** + * Sets or retrieves the state of the check box or radio button. + */ + checked: boolean; + /** + * Retrieves whether the object is fully loaded. + */ + complete: boolean; + /** + * Sets or retrieves the state of the check box or radio button. + */ + defaultChecked: boolean; + /** + * Sets or retrieves the initial contents of the object. + */ + defaultValue: string; + disabled: boolean; + /** + * Returns a FileList object on a file type input object. + */ + files: FileList; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Overrides the action attribute (where the data on a form is sent) on the parent form element. + */ + formAction: string; + /** + * Used to override the encoding (formEnctype attribute) specified on the form element. + */ + formEnctype: string; + /** + * Overrides the submit method attribute previously specified on a form element. + */ + formMethod: string; + /** + * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. + */ + formNoValidate: string; + /** + * Overrides the target attribute on a form element. + */ + formTarget: string; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + hspace: number; + indeterminate: boolean; + /** + * Specifies the ID of a pre-defined datalist of options for an input element. + */ + list: HTMLElement; + /** + * Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field. + */ + max: string; + /** + * Sets or retrieves the maximum number of characters that the user can enter in a text control. + */ + maxLength: number; + /** + * Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field. + */ + min: string; /** * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. */ multiple: boolean; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Gets or sets a string containing a regular expression that the user's input must match. + */ + pattern: string; + /** + * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. + */ + placeholder: string; + readOnly: boolean; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + /** + * Gets or sets the end position or offset of a text selection. + */ + selectionEnd: number; + /** + * Gets or sets the starting position or offset of a text selection. + */ + selectionStart: number; + size: number; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + status: boolean; + /** + * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field. + */ + step: string; + /** + * Returns the content type of the object. + */ + type: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Returns the value of the data at the cursor's current position. + */ + value: string; + valueAsDate: Date; + /** + * Returns the input field value as a number. + */ + valueAsNumber: number; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Creates a TextRange object for the element. + */ + createTextRange(): TextRange; + /** + * Makes the selection equal to the current object. + */ + select(): void; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + /** + * Sets the start and end positions of a selection in a text field. + * @param start The offset into the text field for the start of the selection. + * @param end The offset into the text field for the end of the selection. + */ + setSelectionRange(start: number, end: number): void; + /** + * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. + * @param n Value to decrement the value by. + */ + stepDown(n?: number): void; + /** + * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value. + * @param n Value to increment the value by. + */ + stepUp(n?: number): void; +} + +declare var HTMLInputElement: { + prototype: HTMLInputElement; + new(): HTMLInputElement; +} + +interface HTMLIsIndexElement extends HTMLElement { + /** + * Sets or retrieves the URL to which the form content is sent for processing. + */ + action: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + prompt: string; +} + +declare var HTMLIsIndexElement: { + prototype: HTMLIsIndexElement; + new(): HTMLIsIndexElement; +} + +interface HTMLLIElement extends HTMLElement { + type: string; + /** + * Sets or retrieves the value of a list item. + */ + value: number; +} + +declare var HTMLLIElement: { + prototype: HTMLLIElement; + new(): HTMLLIElement; +} + +interface HTMLLabelElement extends HTMLElement { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the object to which the given label object is assigned. + */ + htmlFor: string; +} + +declare var HTMLLabelElement: { + prototype: HTMLLabelElement; + new(): HTMLLabelElement; +} + +interface HTMLLegendElement extends HTMLElement { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + align: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; +} + +declare var HTMLLegendElement: { + prototype: HTMLLegendElement; + new(): HTMLLegendElement; +} + +interface HTMLLinkElement extends HTMLElement, LinkStyle { + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + disabled: boolean; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or retrieves the language code of the object. + */ + hreflang: string; + /** + * Sets or retrieves the media type. + */ + media: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rel: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rev: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Sets or retrieves the MIME type of the object. + */ + type: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLLinkElement: { + prototype: HTMLLinkElement; + new(): HTMLLinkElement; +} + +interface HTMLMapElement extends HTMLElement { + /** + * Retrieves a collection of the area objects defined for the given map object. + */ + areas: HTMLAreasCollection; + /** + * Sets or retrieves the name of the object. + */ + name: string; +} + +declare var HTMLMapElement: { + prototype: HTMLMapElement; + new(): HTMLMapElement; +} + +interface HTMLMarqueeElement extends HTMLElement { + behavior: string; + bgColor: any; + direction: string; + height: string; + hspace: number; + loop: number; + onbounce: (ev: Event) => any; + onfinish: (ev: Event) => any; + onstart: (ev: Event) => any; + scrollAmount: number; + scrollDelay: number; + trueSpeed: boolean; + vspace: number; + width: string; + start(): void; + stop(): void; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "bounce", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "finish", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "start", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMarqueeElement: { + prototype: HTMLMarqueeElement; + new(): HTMLMarqueeElement; +} + +interface HTMLMediaElement extends HTMLElement { + /** + * Returns an AudioTrackList object with the audio tracks for a given video element. + */ + audioTracks: AudioTrackList; + /** + * Gets or sets a value that indicates whether to start playing the media automatically. + */ + autoplay: boolean; + /** + * Gets a collection of buffered time ranges. + */ + buffered: TimeRanges; + /** + * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player). + */ + controls: boolean; + /** + * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement. + */ + currentSrc: string; + /** + * Gets or sets the current playback position, in seconds. + */ + currentTime: number; + defaultMuted: boolean; + /** + * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource. + */ + defaultPlaybackRate: number; + /** + * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming. + */ + duration: number; + /** + * Gets information about whether the playback has ended or not. + */ + ended: boolean; + /** + * Returns an object representing the current error state of the audio or video element. + */ + error: MediaError; + /** + * Gets or sets a flag to specify whether playback should restart after it completes. + */ + loop: boolean; + /** + * Specifies the purpose of the audio or video media, such as background audio or alerts. + */ + msAudioCategory: string; + /** + * Specifies the output device id that the audio will be sent to. + */ + msAudioDeviceType: string; + msGraphicsTrustStatus: MSGraphicsTrust; + /** + * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element. + */ + msKeys: MSMediaKeys; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; + /** + * Specifies whether or not to enable low-latency playback on the media element. + */ + msRealTime: boolean; + /** + * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted. + */ + muted: boolean; + /** + * Gets the current network activity for the element. + */ + networkState: number; + onmsneedkey: (ev: MSMediaKeyNeededEvent) => any; + /** + * Gets a flag that specifies whether playback is paused. + */ + paused: boolean; + /** + * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource. + */ + playbackRate: number; + /** + * Gets TimeRanges for the current media resource that has been played. + */ + played: TimeRanges; + /** + * Gets or sets the current playback position, in seconds. + */ + preload: string; + readyState: any; + /** + * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. + */ + seekable: TimeRanges; + /** + * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource. + */ + seeking: boolean; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + textTracks: TextTrackList; + videoTracks: VideoTrackList; + /** + * Gets or sets the volume level for audio portions of the media element. + */ + volume: number; + addTextTrack(kind: string, label?: string, language?: string): TextTrack; + /** + * Returns a string that specifies whether the client can play a given media resource type. + */ + canPlayType(type: string): string; + /** + * Fires immediately after the client loads the object. + */ + load(): void; + /** + * Clears all effects from the media pipeline. + */ + msClearEffects(): void; + msGetAsCastingSource(): any; + /** + * Inserts the specified audio effect into media pipeline. + */ + msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; + msSetMediaKeys(mediaKeys: MSMediaKeys): void; + /** + * Specifies the media protection manager for a given media pipeline. + */ + msSetMediaProtectionManager(mediaProtectionManager?: any): void; + /** + * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not. + */ + pause(): void; + /** + * Loads and starts playback of a media resource. + */ + play(): void; + HAVE_CURRENT_DATA: number; + HAVE_ENOUGH_DATA: number; + HAVE_FUTURE_DATA: number; + HAVE_METADATA: number; + HAVE_NOTHING: number; + NETWORK_EMPTY: number; + NETWORK_IDLE: number; + NETWORK_LOADING: number; + NETWORK_NO_SOURCE: number; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMediaElement: { + prototype: HTMLMediaElement; + new(): HTMLMediaElement; + HAVE_CURRENT_DATA: number; + HAVE_ENOUGH_DATA: number; + HAVE_FUTURE_DATA: number; + HAVE_METADATA: number; + HAVE_NOTHING: number; + NETWORK_EMPTY: number; + NETWORK_IDLE: number; + NETWORK_LOADING: number; + NETWORK_NO_SOURCE: number; +} + +interface HTMLMenuElement extends HTMLElement { + compact: boolean; + type: string; +} + +declare var HTMLMenuElement: { + prototype: HTMLMenuElement; + new(): HTMLMenuElement; +} + +interface HTMLMetaElement extends HTMLElement { + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Gets or sets meta-information to associate with httpEquiv or name. + */ + content: string; + /** + * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header. + */ + httpEquiv: string; + /** + * Sets or retrieves the value specified in the content attribute of the meta object. + */ + name: string; + /** + * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object. + */ + scheme: string; + /** + * Sets or retrieves the URL property that will be loaded after the specified time has elapsed. + */ + url: string; +} + +declare var HTMLMetaElement: { + prototype: HTMLMetaElement; + new(): HTMLMetaElement; +} + +interface HTMLModElement extends HTMLElement { + /** + * Sets or retrieves reference information about the object. + */ + cite: string; + /** + * Sets or retrieves the date and time of a modification to the object. + */ + dateTime: string; +} + +declare var HTMLModElement: { + prototype: HTMLModElement; + new(): HTMLModElement; +} + +interface HTMLNextIdElement extends HTMLElement { + n: string; +} + +declare var HTMLNextIdElement: { + prototype: HTMLNextIdElement; + new(): HTMLNextIdElement; +} + +interface HTMLOListElement extends HTMLElement { + compact: boolean; + /** + * The starting number. + */ + start: number; + type: string; +} + +declare var HTMLOListElement: { + prototype: HTMLOListElement; + new(): HTMLOListElement; +} + +interface HTMLObjectElement extends HTMLElement, GetSVGDocument { + /** + * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. + */ + BaseHref: string; + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Gets or sets the optional alternative HTML script to execute if the object fails to load. + */ + altHtml: string; + /** + * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. + */ + archive: string; + border: string; + /** + * Sets or retrieves the URL of the file containing the compiled Java class. + */ + code: string; + /** + * Sets or retrieves the URL of the component. + */ + codeBase: string; + /** + * Sets or retrieves the Internet media type for the code associated with the object. + */ + codeType: string; + /** + * Retrieves the document object of the page or frame. + */ + contentDocument: Document; + /** + * Sets or retrieves the URL that references the data of the object. + */ + data: string; + declare: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the height of the object. + */ + height: string; + hspace: number; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Retrieves the contained object. + */ + object: any; + readyState: number; + /** + * Sets or retrieves a message to be displayed while an object is loading. + */ + standby: string; + /** + * Sets or retrieves the MIME type of the object. + */ + type: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLObjectElement: { + prototype: HTMLObjectElement; + new(): HTMLObjectElement; +} + +interface HTMLOptGroupElement extends HTMLElement { + /** + * Sets or retrieves the status of an option. + */ + defaultSelected: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the ordinal position of an option in a list box. + */ + index: number; + /** + * Sets or retrieves a value that you can use to implement your own label functionality for the object. + */ + label: string; + /** + * Sets or retrieves whether the option in the list box is the default item. + */ + selected: boolean; + /** + * Sets or retrieves the text string specified by the option tag. + */ + text: string; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; +} + +declare var HTMLOptGroupElement: { + prototype: HTMLOptGroupElement; + new(): HTMLOptGroupElement; +} + +interface HTMLOptionElement extends HTMLElement { + /** + * Sets or retrieves the status of an option. + */ + defaultSelected: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the ordinal position of an option in a list box. + */ + index: number; + /** + * Sets or retrieves a value that you can use to implement your own label functionality for the object. + */ + label: string; + /** + * Sets or retrieves whether the option in the list box is the default item. + */ + selected: boolean; + /** + * Sets or retrieves the text string specified by the option tag. + */ + text: string; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; +} + +declare var HTMLOptionElement: { + prototype: HTMLOptionElement; + new(): HTMLOptionElement; + create(): HTMLOptionElement; +} + +interface HTMLParagraphElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + clear: string; +} + +declare var HTMLParagraphElement: { + prototype: HTMLParagraphElement; + new(): HTMLParagraphElement; +} + +interface HTMLParamElement extends HTMLElement { + /** + * Sets or retrieves the name of an input parameter for an element. + */ + name: string; + /** + * Sets or retrieves the content type of the resource designated by the value attribute. + */ + type: string; + /** + * Sets or retrieves the value of an input parameter for an element. + */ + value: string; + /** + * Sets or retrieves the data type of the value attribute. + */ + valueType: string; +} + +declare var HTMLParamElement: { + prototype: HTMLParamElement; + new(): HTMLParamElement; +} + +interface HTMLPhraseElement extends HTMLElement { + /** + * Sets or retrieves reference information about the object. + */ + cite: string; + /** + * Sets or retrieves the date and time of a modification to the object. + */ + dateTime: string; +} + +declare var HTMLPhraseElement: { + prototype: HTMLPhraseElement; + new(): HTMLPhraseElement; +} + +interface HTMLPreElement extends HTMLElement { + /** + * Indicates a citation by rendering text in italic type. + */ + cite: string; + clear: string; + /** + * Sets or gets a value that you can use to implement your own width functionality for the object. + */ + width: number; +} + +declare var HTMLPreElement: { + prototype: HTMLPreElement; + new(): HTMLPreElement; +} + +interface HTMLProgressElement extends HTMLElement { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Defines the maximum, or "done" value for a progress element. + */ + max: number; + /** + * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar). + */ + position: number; + /** + * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value. + */ + value: number; +} + +declare var HTMLProgressElement: { + prototype: HTMLProgressElement; + new(): HTMLProgressElement; +} + +interface HTMLQuoteElement extends HTMLElement { + /** + * Sets or retrieves reference information about the object. + */ + cite: string; + /** + * Sets or retrieves the date and time of a modification to the object. + */ + dateTime: string; +} + +declare var HTMLQuoteElement: { + prototype: HTMLQuoteElement; + new(): HTMLQuoteElement; +} + +interface HTMLScriptElement extends HTMLElement { + async: boolean; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Sets or retrieves the status of the script. + */ + defer: boolean; + /** + * Sets or retrieves the event for which the script is written. + */ + event: string; + /** + * Sets or retrieves the object that is bound to the event script. + */ + htmlFor: string; + /** + * Retrieves the URL to an external file that contains the source code or data. + */ + src: string; + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; + /** + * Sets or retrieves the MIME type for the associated scripting engine. + */ + type: string; +} + +declare var HTMLScriptElement: { + prototype: HTMLScriptElement; + new(): HTMLScriptElement; +} + +interface HTMLSelectElement extends HTMLElement { + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the number of objects in a collection. + */ + length: number; + /** + * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. + */ + multiple: boolean; + /** + * Sets or retrieves the name of the object. + */ + name: string; + options: HTMLSelectElement; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + /** + * Sets or retrieves the index of the selected option in a select object. + */ + selectedIndex: number; + /** + * Sets or retrieves the number of rows in the list box. + */ + size: number; /** * Retrieves the type of select control based on the value of the MULTIPLE attribute. */ @@ -4062,33 +8455,29 @@ interface HTMLSelectElement extends HTMLElement, MSHTMLCollectionExtensions, MSD * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. */ validationMessage: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; /** * Returns a ValidityState object that represents the validity states of an element. */ validity: ValidityState; /** - * When present, marks an element that can't be submitted without a value. + * Sets or retrieves the value which is returned to the server when the form control is submitted. */ - required: boolean; + value: string; /** * Returns whether an element will successfully validate based on forms validation rules and constraints. */ willValidate: boolean; - /** - * Removes an element from the collection. - * @param index Number that specifies the zero-based index of the element to remove from the collection. - */ - remove(index?: number): void; /** * Adds an element to the areas, controlRange, or options collection. * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection. * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection. */ - add(element: HTMLElement, before?: any): void; + add(element: HTMLElement, before?: HTMLElement): void; + add(element: HTMLElement, before?: number): void; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; /** * Retrieves a select object or an object from an options collection. * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. @@ -4100,373 +8489,68 @@ interface HTMLSelectElement extends HTMLElement, MSHTMLCollectionExtensions, MSD * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made. */ namedItem(name: string): any; - [name: string]: any; /** - * Returns whether a form will validate when it is submitted, without having to submit it. + * Removes an element from the collection. + * @param index Number that specifies the zero-based index of the element to remove from the collection. */ - checkValidity(): boolean; + remove(index?: number): void; /** * Sets a custom error message that is displayed when a form is submitted. * @param error Sets a custom error message that is displayed when a form is submitted. */ setCustomValidity(error: string): void; + [name: string]: any; } + declare var HTMLSelectElement: { prototype: HTMLSelectElement; new(): HTMLSelectElement; } -interface TextRange { - boundingLeft: number; - htmlText: string; - offsetLeft: number; - boundingWidth: number; - boundingHeight: number; - boundingTop: number; - text: string; - offsetTop: number; - moveToPoint(x: number, y: number): void; - queryCommandValue(cmdID: string): any; - getBookmark(): string; - move(unit: string, count?: number): number; - queryCommandIndeterm(cmdID: string): boolean; - scrollIntoView(fStart?: boolean): void; - findText(string: string, count?: number, flags?: number): boolean; - execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; - getBoundingClientRect(): ClientRect; - moveToBookmark(bookmark: string): boolean; - isEqual(range: TextRange): boolean; - duplicate(): TextRange; - collapse(start?: boolean): void; - queryCommandText(cmdID: string): string; - select(): void; - pasteHTML(html: string): void; - inRange(range: TextRange): boolean; - moveEnd(unit: string, count?: number): number; - getClientRects(): ClientRectList; - moveStart(unit: string, count?: number): number; - parentElement(): Element; - queryCommandState(cmdID: string): boolean; - compareEndPoints(how: string, sourceRange: TextRange): number; - execCommandShowHelp(cmdID: string): boolean; - moveToElementText(element: Element): void; - expand(Unit: string): boolean; - queryCommandSupported(cmdID: string): boolean; - setEndPoint(how: string, SourceRange: TextRange): void; - queryCommandEnabled(cmdID: string): boolean; -} -declare var TextRange: { - prototype: TextRange; - new(): TextRange; -} - -interface SVGTests { - requiredFeatures: SVGStringList; - requiredExtensions: SVGStringList; - systemLanguage: SVGStringList; - hasExtension(extension: string): boolean; -} - -interface HTMLBlockElement extends HTMLElement, DOML2DeprecatedTextFlowControl { +interface HTMLSourceElement extends HTMLElement { /** - * Sets or retrieves the width of the object. - */ - width: number; + * Gets or sets the intended media type of the media source. + */ + media: string; + msKeySystem: string; /** - * Sets or retrieves reference information about the object. + * The address or URL of the a media resource that is to be considered. */ - cite: string; -} -declare var HTMLBlockElement: { - prototype: HTMLBlockElement; - new(): HTMLBlockElement; -} - -interface CSSStyleSheet extends StyleSheet { - owningElement: Element; - imports: StyleSheetList; - isAlternate: boolean; - rules: MSCSSRuleList; - isPrefAlternate: boolean; - readOnly: boolean; - cssText: string; - ownerRule: CSSRule; - href: string; - cssRules: CSSRuleList; - id: string; - pages: StyleSheetPageList; - addImport(bstrURL: string, lIndex?: number): number; - addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; - insertRule(rule: string, index?: number): number; - removeRule(lIndex: number): void; - deleteRule(index?: number): void; - addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number; - removeImport(lIndex: number): void; -} -declare var CSSStyleSheet: { - prototype: CSSStyleSheet; - new(): CSSStyleSheet; -} - -interface MSSelection { - type: string; - typeDetail: string; - createRange(): TextRange; - clear(): void; - createRangeCollection(): TextRangeCollection; - empty(): void; -} -declare var MSSelection: { - prototype: MSSelection; - new(): MSSelection; -} - -interface HTMLMetaElement extends HTMLElement { + src: string; /** - * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header. - */ - httpEquiv: string; - /** - * Sets or retrieves the value specified in the content attribute of the meta object. - */ - name: string; - /** - * Gets or sets meta-information to associate with httpEquiv or name. - */ - content: string; - /** - * Sets or retrieves the URL property that will be loaded after the specified time has elapsed. - */ - url: string; - /** - * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object. - */ - scheme: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; -} -declare var HTMLMetaElement: { - prototype: HTMLMetaElement; - new(): HTMLMetaElement; -} - -interface SVGPatternElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGTests, SVGFitToViewBox, SVGExternalResourcesRequired, SVGURIReference { - patternUnits: SVGAnimatedEnumeration; - y: SVGAnimatedLength; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - patternContentUnits: SVGAnimatedEnumeration; - patternTransform: SVGAnimatedTransformList; - height: SVGAnimatedLength; -} -declare var SVGPatternElement: { - prototype: SVGPatternElement; - new(): SVGPatternElement; -} - -interface SVGAnimatedAngle { - animVal: SVGAngle; - baseVal: SVGAngle; -} -declare var SVGAnimatedAngle: { - prototype: SVGAnimatedAngle; - new(): SVGAnimatedAngle; -} - -interface Selection { - isCollapsed: boolean; - anchorNode: Node; - focusNode: Node; - anchorOffset: number; - focusOffset: number; - rangeCount: number; - addRange(range: Range): void; - collapseToEnd(): void; - toString(): string; - selectAllChildren(parentNode: Node): void; - getRangeAt(index: number): Range; - collapse(parentNode: Node, offset: number): void; - removeAllRanges(): void; - collapseToStart(): void; - deleteFromDocument(): void; - removeRange(range: Range): void; -} -declare var Selection: { - prototype: Selection; - new(): Selection; -} - -interface SVGScriptElement extends SVGElement, SVGExternalResourcesRequired, SVGURIReference { + * Gets or sets the MIME type of a media resource. + */ type: string; } -declare var SVGScriptElement: { - prototype: SVGScriptElement; - new(): SVGScriptElement; + +declare var HTMLSourceElement: { + prototype: HTMLSourceElement; + new(): HTMLSourceElement; } -interface HTMLDDElement extends HTMLElement { - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} -declare var HTMLDDElement: { - prototype: HTMLDDElement; - new(): HTMLDDElement; +interface HTMLSpanElement extends HTMLElement { } -interface MSDataBindingRecordSetReadonlyExtensions { - recordset: any; - namedRecordset(dataMember: string, hierarchy?: any): any; +declare var HTMLSpanElement: { + prototype: HTMLSpanElement; + new(): HTMLSpanElement; } -interface CSSStyleRule extends CSSRule { - selectorText: string; - style: MSStyleCSSProperties; - readOnly: boolean; -} -declare var CSSStyleRule: { - prototype: CSSStyleRule; - new(): CSSStyleRule; -} - -interface NodeIterator { - whatToShow: number; - filter: NodeFilter; - root: Node; - expandEntityReferences: boolean; - nextNode(): Node; - detach(): void; - previousNode(): Node; -} -declare var NodeIterator: { - prototype: NodeIterator; - new(): NodeIterator; -} - -interface SVGViewElement extends SVGElement, SVGZoomAndPan, SVGFitToViewBox, SVGExternalResourcesRequired { - viewTarget: SVGStringList; -} -declare var SVGViewElement: { - prototype: SVGViewElement; - new(): SVGViewElement; -} - -interface HTMLLinkElement extends HTMLElement, LinkStyle { - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rel: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; +interface HTMLStyleElement extends HTMLElement, LinkStyle { /** * Sets or retrieves the media type. */ media: string; /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rev: string; - /** - * Sets or retrieves the MIME type of the object. + * Retrieves the CSS language in which the style sheet is written. */ type: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the language code of the object. - */ - hreflang: string; -} -declare var HTMLLinkElement: { - prototype: HTMLLinkElement; - new(): HTMLLinkElement; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface SVGLocatable { - farthestViewportElement: SVGElement; - nearestViewportElement: SVGElement; - getBBox(): SVGRect; - getTransformToElement(element: SVGElement): SVGMatrix; - getCTM(): SVGMatrix; - getScreenCTM(): SVGMatrix; -} - -interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { - /** - * Sets or retrieves the current typeface family. - */ - face: string; -} -declare var HTMLFontElement: { - prototype: HTMLFontElement; - new(): HTMLFontElement; -} - -interface SVGTitleElement extends SVGElement, SVGStylable, SVGLangSpace { -} -declare var SVGTitleElement: { - prototype: SVGTitleElement; - new(): SVGTitleElement; -} - -interface ControlRangeCollection { - length: number; - queryCommandValue(cmdID: string): any; - remove(index: number): void; - add(item: Element): void; - queryCommandIndeterm(cmdID: string): boolean; - scrollIntoView(varargStart?: any): void; - item(index: number): Element; - [index: number]: Element; - execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; - addElement(item: Element): void; - queryCommandState(cmdID: string): boolean; - queryCommandSupported(cmdID: string): boolean; - queryCommandEnabled(cmdID: string): boolean; - queryCommandText(cmdID: string): string; - select(): void; -} -declare var ControlRangeCollection: { - prototype: ControlRangeCollection; - new(): ControlRangeCollection; -} - -interface MSNamespaceInfo extends MSEventAttachmentTarget { - urn: string; - onreadystatechange: (ev: Event) => any; - name: string; - readyState: string; - doImport(implementationUrl: string): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var MSNamespaceInfo: { - prototype: MSNamespaceInfo; - new(): MSNamespaceInfo; -} - -interface WindowSessionStorage { - sessionStorage: Storage; -} - -interface SVGAnimatedTransformList { - animVal: SVGTransformList; - baseVal: SVGTransformList; -} -declare var SVGAnimatedTransformList: { - prototype: SVGAnimatedTransformList; - new(): SVGAnimatedTransformList; +declare var HTMLStyleElement: { + prototype: HTMLStyleElement; + new(): HTMLStyleElement; } interface HTMLTableCaptionElement extends HTMLElement { @@ -4479,637 +8563,240 @@ interface HTMLTableCaptionElement extends HTMLElement { */ vAlign: string; } + declare var HTMLTableCaptionElement: { prototype: HTMLTableCaptionElement; new(): HTMLTableCaptionElement; } -interface HTMLOptionElement extends HTMLElement, MSDataBindingExtensions { +interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment { /** - * Sets or retrieves the ordinal position of an option in a list box. + * Sets or retrieves abbreviated text for the object. */ - index: number; - /** - * Sets or retrieves the status of an option. - */ - defaultSelected: boolean; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - /** - * Sets or retrieves the text string specified by the option tag. - */ - text: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves a value that you can use to implement your own label functionality for the object. - */ - label: string; - /** - * Sets or retrieves whether the option in the list box is the default item. - */ - selected: boolean; -} -declare var HTMLOptionElement: { - prototype: HTMLOptionElement; - new(): HTMLOptionElement; - create(): HTMLOptionElement; -} - -interface HTMLMapElement extends HTMLElement { - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Retrieves a collection of the area objects defined for the given map object. - */ - areas: HTMLAreasCollection; -} -declare var HTMLMapElement: { - prototype: HTMLMapElement; - new(): HTMLMapElement; -} - -interface HTMLMenuElement extends HTMLElement, DOML2DeprecatedListSpaceReduction { - type: string; -} -declare var HTMLMenuElement: { - prototype: HTMLMenuElement; - new(): HTMLMenuElement; -} - -interface MouseWheelEvent extends MouseEvent { - wheelDelta: number; - initMouseWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, wheelDeltaArg: number): void; -} -declare var MouseWheelEvent: { - prototype: MouseWheelEvent; - new(): MouseWheelEvent; -} - -interface SVGFitToViewBox { - viewBox: SVGAnimatedRect; - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; -} - -interface SVGPointList { - numberOfItems: number; - replaceItem(newItem: SVGPoint, index: number): SVGPoint; - getItem(index: number): SVGPoint; - clear(): void; - appendItem(newItem: SVGPoint): SVGPoint; - initialize(newItem: SVGPoint): SVGPoint; - removeItem(index: number): SVGPoint; - insertItemBefore(newItem: SVGPoint, index: number): SVGPoint; -} -declare var SVGPointList: { - prototype: SVGPointList; - new(): SVGPointList; -} - -interface SVGAnimatedLengthList { - animVal: SVGLengthList; - baseVal: SVGLengthList; -} -declare var SVGAnimatedLengthList: { - prototype: SVGAnimatedLengthList; - new(): SVGAnimatedLengthList; -} - -interface SVGAnimatedPreserveAspectRatio { - animVal: SVGPreserveAspectRatio; - baseVal: SVGPreserveAspectRatio; -} -declare var SVGAnimatedPreserveAspectRatio: { - prototype: SVGAnimatedPreserveAspectRatio; - new(): SVGAnimatedPreserveAspectRatio; -} - -interface MSSiteModeEvent extends Event { - buttonID: number; - actionURL: string; -} -declare var MSSiteModeEvent: { - prototype: MSSiteModeEvent; - new(): MSSiteModeEvent; -} - -interface DOML2DeprecatedTextFlowControl { - clear: string; -} - -interface StyleSheetPageList { - length: number; - item(index: number): CSSPageRule; - [index: number]: CSSPageRule; -} -declare var StyleSheetPageList: { - prototype: StyleSheetPageList; - new(): StyleSheetPageList; -} - -interface MSCSSProperties extends CSSStyleDeclaration { - scrollbarShadowColor: string; - scrollbarHighlightColor: string; - layoutGridChar: string; - layoutGridType: string; - textAutospace: string; - textKashidaSpace: string; - writingMode: string; - scrollbarFaceColor: string; - backgroundPositionY: string; - lineBreak: string; - imeMode: string; - msBlockProgression: string; - layoutGridLine: string; - scrollbarBaseColor: string; - layoutGrid: string; - layoutFlow: string; - textKashida: string; - filter: string; - zoom: string; - scrollbarArrowColor: string; - behavior: string; - backgroundPositionX: string; - accelerator: string; - layoutGridMode: string; - textJustifyTrim: string; - scrollbar3dLightColor: string; - msInterpolationMode: string; - scrollbarTrackColor: string; - scrollbarDarkShadowColor: string; - styleFloat: string; - getAttribute(attributeName: string, flags?: number): any; - setAttribute(attributeName: string, AttributeValue: any, flags?: number): void; - removeAttribute(attributeName: string, flags?: number): boolean; -} -declare var MSCSSProperties: { - prototype: MSCSSProperties; - new(): MSCSSProperties; -} - -interface SVGExternalResourcesRequired { - externalResourcesRequired: SVGAnimatedBoolean; -} - -interface HTMLImageElement extends HTMLElement, MSImageResourceExtensions, MSDataBindingExtensions, MSResourceMetadata { - /** - * Sets or retrieves the width of the object. - */ - width: number; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * The original height of the image resource before sizing. - */ - naturalHeight: number; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; + abbr: string; /** * Sets or retrieves how the object is aligned with adjacent text. */ align: string; /** - * The address or URL of the a media resource that is to be considered. + * Sets or retrieves a comma-delimited list of conceptual categories associated with the object. */ - src: string; + axis: string; + bgColor: any; /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + * Retrieves the position of the object in the cells collection of a row. */ - useMap: string; + cellIndex: number; /** - * The original width of the image resource before sizing. + * Sets or retrieves the number columns in the table that the object should span. */ - naturalWidth: number; + colSpan: number; /** - * Sets or retrieves the name of the object. + * Sets or retrieves a list of header cells that provide information for the object. */ - name: string; - /** - * Sets or retrieves the height of the object. - */ - height: number; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - hspace: number; - /** - * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object. - */ - longDesc: string; - /** - * Contains the hypertext reference (HREF) of the URL. - */ - href: string; - /** - * Sets or retrieves whether the image is a server-side image map. - */ - isMap: boolean; - /** - * Retrieves whether the object is fully loaded. - */ - complete: boolean; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; - crossOrigin: string; - msPlayToPreferredSourceUri: string; -} -declare var HTMLImageElement: { - prototype: HTMLImageElement; - new(): HTMLImageElement; - create(): HTMLImageElement; -} - -interface HTMLAreaElement extends HTMLElement { - /** - * Sets or retrieves the protocol portion of a URL. - */ - protocol: string; - /** - * Sets or retrieves the substring of the href property that follows the question mark. - */ - search: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves the coordinates of the object. - */ - coords: string; - /** - * Sets or retrieves the host name part of the location or URL. - */ - hostname: string; - /** - * Sets or retrieves the port number associated with a URL. - */ - port: string; - /** - * Sets or retrieves the file name or path specified by the object. - */ - pathname: string; - /** - * Sets or retrieves the hostname and port number of the location or URL. - */ - host: string; - /** - * Sets or retrieves the subsection of the href property that follows the number sign (#). - */ - hash: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or gets whether clicks in this region cause action. - */ - noHref: boolean; - /** - * Sets or retrieves the shape of the object. - */ - shape: string; - /** - * Returns a string representation of an object. - */ - toString(): string; -} -declare var HTMLAreaElement: { - prototype: HTMLAreaElement; - new(): HTMLAreaElement; -} - -interface EventTarget { - removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; - dispatchEvent(evt: Event): boolean; -} - -interface SVGAngle { - valueAsString: string; - valueInSpecifiedUnits: number; - value: number; - unitType: number; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - convertToSpecifiedUnits(unitType: number): void; - SVG_ANGLETYPE_RAD: number; - SVG_ANGLETYPE_UNKNOWN: number; - SVG_ANGLETYPE_UNSPECIFIED: number; - SVG_ANGLETYPE_DEG: number; - SVG_ANGLETYPE_GRAD: number; -} -declare var SVGAngle: { - prototype: SVGAngle; - new(): SVGAngle; - SVG_ANGLETYPE_RAD: number; - SVG_ANGLETYPE_UNKNOWN: number; - SVG_ANGLETYPE_UNSPECIFIED: number; - SVG_ANGLETYPE_DEG: number; - SVG_ANGLETYPE_GRAD: number; -} - -interface HTMLButtonElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the default or selected value of the control. - */ - value: string; - status: any; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Gets the classification and default behavior of the button. - */ - type: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Overrides the target attribute on a form element. - */ - formTarget: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Overrides the action attribute (where the data on a form is sent) on the parent form element. - */ - formAction: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. - */ - formNoValidate: string; - /** - * Used to override the encoding (formEnctype attribute) specified on the form element. - */ - formEnctype: string; - /** - * Overrides the submit method attribute previously specified on a form element. - */ - formMethod: string; - /** - * Creates a TextRange object for the element. - */ - createTextRange(): TextRange; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLButtonElement: { - prototype: HTMLButtonElement; - new(): HTMLButtonElement; -} - -interface HTMLSourceElement extends HTMLElement { - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - /** - * Gets or sets the intended media type of the media source. - */ - media: string; - /** - * Gets or sets the MIME type of a media resource. - */ - type: string; - msKeySystem: string; -} -declare var HTMLSourceElement: { - prototype: HTMLSourceElement; - new(): HTMLSourceElement; -} - -interface CanvasGradient { - addColorStop(offset: number, color: string): void; -} -declare var CanvasGradient: { - prototype: CanvasGradient; - new(): CanvasGradient; -} - -interface KeyboardEvent extends UIEvent { - location: number; - keyCode: number; - shiftKey: boolean; - which: number; - locale: string; - key: string; - altKey: boolean; - metaKey: boolean; - char: string; - ctrlKey: boolean; - repeat: boolean; - charCode: number; - getModifierState(keyArg: string): boolean; - initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; - DOM_KEY_LOCATION_RIGHT: number; - DOM_KEY_LOCATION_STANDARD: number; - DOM_KEY_LOCATION_LEFT: number; - DOM_KEY_LOCATION_NUMPAD: number; - DOM_KEY_LOCATION_JOYSTICK: number; - DOM_KEY_LOCATION_MOBILE: number; -} -declare var KeyboardEvent: { - prototype: KeyboardEvent; - new(): KeyboardEvent; - DOM_KEY_LOCATION_RIGHT: number; - DOM_KEY_LOCATION_STANDARD: number; - DOM_KEY_LOCATION_LEFT: number; - DOM_KEY_LOCATION_NUMPAD: number; - DOM_KEY_LOCATION_JOYSTICK: number; - DOM_KEY_LOCATION_MOBILE: number; -} - -interface MessageEvent extends Event { - source: Window; - origin: string; - data: any; - ports: any; - initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void; -} -declare var MessageEvent: { - prototype: MessageEvent; - new(): MessageEvent; -} - -interface SVGElement extends Element { - onmouseover: (ev: MouseEvent) => any; - viewportElement: SVGElement; - onmousemove: (ev: MouseEvent) => any; - onmouseout: (ev: MouseEvent) => any; - ondblclick: (ev: MouseEvent) => any; - onfocusout: (ev: FocusEvent) => any; - onfocusin: (ev: FocusEvent) => any; - xmlbase: string; - onmousedown: (ev: MouseEvent) => any; - onload: (ev: Event) => any; - onmouseup: (ev: MouseEvent) => any; - onclick: (ev: MouseEvent) => any; - ownerSVGElement: SVGSVGElement; - id: string; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var SVGElement: { - prototype: SVGElement; - new(): SVGElement; -} - -interface HTMLScriptElement extends HTMLElement { - /** - * Sets or retrieves the status of the script. - */ - defer: boolean; - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; - /** - * Retrieves the URL to an external file that contains the source code or data. - */ - src: string; - /** - * Sets or retrieves the object that is bound to the event script. - */ - htmlFor: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the MIME type for the associated scripting engine. - */ - type: string; - /** - * Sets or retrieves the event for which the script is written. - */ - event: string; - async: boolean; -} -declare var HTMLScriptElement: { - prototype: HTMLScriptElement; - new(): HTMLScriptElement; -} - -interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundColorStyle { - /** - * Retrieves the position of the object in the rows collection for the table. - */ - rowIndex: number; - /** - * Retrieves a collection of all cells in the table row. - */ - cells: HTMLCollection; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorLight: any; - /** - * Retrieves the position of the object in the collection. - */ - sectionRowIndex: number; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; + headers: string; /** * Sets or retrieves the height of the object. */ height: any; /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. + * Sets or retrieves whether the browser automatically performs wordwrap. */ - borderColorDark: any; + noWrap: boolean; + /** + * Sets or retrieves how many rows in a table the cell should span. + */ + rowSpan: number; + /** + * Sets or retrieves the group of cells in a table to which the object's information applies. + */ + scope: string; + /** + * Sets or retrieves the width of the object. + */ + width: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableCellElement: { + prototype: HTMLTableCellElement; + new(): HTMLTableCellElement; +} + +interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment { + /** + * Sets or retrieves the alignment of the object relative to the display or table. + */ + align: string; + /** + * Sets or retrieves the number of columns in the group. + */ + span: number; + /** + * Sets or retrieves the width of the object. + */ + width: any; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableColElement: { + prototype: HTMLTableColElement; + new(): HTMLTableColElement; +} + +interface HTMLTableDataCellElement extends HTMLTableCellElement { +} + +declare var HTMLTableDataCellElement: { + prototype: HTMLTableDataCellElement; + new(): HTMLTableDataCellElement; +} + +interface HTMLTableElement extends HTMLElement { + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; + bgColor: any; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + border: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Retrieves the caption object of a table. + */ + caption: HTMLTableCaptionElement; + /** + * Sets or retrieves the amount of space between the border of the cell and the content of the cell. + */ + cellPadding: string; + /** + * Sets or retrieves the amount of space between cells in a table. + */ + cellSpacing: string; + /** + * Sets or retrieves the number of columns in the table. + */ + cols: number; + /** + * Sets or retrieves the way the border frame around the table is displayed. + */ + frame: string; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Sets or retrieves the number of horizontal rows contained in the object. + */ + rows: HTMLCollection; + /** + * Sets or retrieves which dividing lines (inner borders) are displayed. + */ + rules: string; + /** + * Sets or retrieves a description and/or structure of the object. + */ + summary: string; + /** + * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order. + */ + tBodies: HTMLCollection; + /** + * Retrieves the tFoot object of the table. + */ + tFoot: HTMLTableSectionElement; + /** + * Retrieves the tHead object of the table. + */ + tHead: HTMLTableSectionElement; + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Creates an empty caption element in the table. + */ + createCaption(): HTMLElement; + /** + * Creates an empty tBody element in the table. + */ + createTBody(): HTMLElement; + /** + * Creates an empty tFoot element in the table. + */ + createTFoot(): HTMLElement; + /** + * Returns the tHead element object if successful, or null otherwise. + */ + createTHead(): HTMLElement; + /** + * Deletes the caption element and its contents from the table. + */ + deleteCaption(): void; + /** + * Removes the specified row (tr) from the element and from the rows collection. + * @param index Number that specifies the zero-based position in the rows collection of the row to remove. + */ + deleteRow(index?: number): void; + /** + * Deletes the tFoot element and its contents from the table. + */ + deleteTFoot(): void; + /** + * Deletes the tHead element and its contents from the table. + */ + deleteTHead(): void; + /** + * Creates a new row (tr) in the table, and adds the row to the rows collection. + * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. + */ + insertRow(index?: number): HTMLElement; +} + +declare var HTMLTableElement: { + prototype: HTMLTableElement; + new(): HTMLTableElement; +} + +interface HTMLTableHeaderCellElement extends HTMLTableCellElement { + /** + * Sets or retrieves the group of cells in a table to which the object's information applies. + */ + scope: string; +} + +declare var HTMLTableHeaderCellElement: { + prototype: HTMLTableHeaderCellElement; + new(): HTMLTableHeaderCellElement; +} + +interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + bgColor: any; + /** + * Retrieves a collection of all cells in the table row. + */ + cells: HTMLCollection; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Retrieves the position of the object in the rows collection for the table. + */ + rowIndex: number; + /** + * Retrieves the position of the object in the collection. + */ + sectionRowIndex: number; /** * Removes the specified cell from the table row, as well as from the cells collection. * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted. @@ -5120,1511 +8807,15 @@ interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment, DOML2Depr * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection. */ insertCell(index?: number): HTMLElement; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var HTMLTableRowElement: { prototype: HTMLTableRowElement; new(): HTMLTableRowElement; } -interface CanvasRenderingContext2D { - miterLimit: number; - font: string; - globalCompositeOperation: string; - msFillRule: string; - lineCap: string; - msImageSmoothingEnabled: boolean; - lineDashOffset: number; - shadowColor: string; - lineJoin: string; - shadowOffsetX: number; - lineWidth: number; - canvas: HTMLCanvasElement; - strokeStyle: any; - globalAlpha: number; - shadowOffsetY: number; - fillStyle: any; - shadowBlur: number; - textAlign: string; - textBaseline: string; - restore(): void; - setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - save(): void; - arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; - measureText(text: string): TextMetrics; - isPointInPath(x: number, y: number, fillRule?: string): boolean; - quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; - putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void; - rotate(angle: number): void; - fillText(text: string, x: number, y: number, maxWidth?: number): void; - translate(x: number, y: number): void; - scale(x: number, y: number): void; - createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; - lineTo(x: number, y: number): void; - getLineDash(): number[]; - fill(fillRule?: string): void; - createImageData(imageDataOrSw: any, sh?: number): ImageData; - createPattern(image: HTMLElement, repetition: string): CanvasPattern; - closePath(): void; - rect(x: number, y: number, w: number, h: number): void; - clip(fillRule?: string): void; - clearRect(x: number, y: number, w: number, h: number): void; - moveTo(x: number, y: number): void; - getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; - fillRect(x: number, y: number, w: number, h: number): void; - bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; - drawImage(image: HTMLElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; - transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - stroke(): void; - strokeRect(x: number, y: number, w: number, h: number): void; - setLineDash(segments: number[]): void; - strokeText(text: string, x: number, y: number, maxWidth?: number): void; - beginPath(): void; - arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; - createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; -} -declare var CanvasRenderingContext2D: { - prototype: CanvasRenderingContext2D; - new(): CanvasRenderingContext2D; -} - -interface MSCSSRuleList { - length: number; - item(index?: number): CSSStyleRule; - [index: number]: CSSStyleRule; -} -declare var MSCSSRuleList: { - prototype: MSCSSRuleList; - new(): MSCSSRuleList; -} - -interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg { - x: number; -} -declare var SVGPathSegLinetoHorizontalAbs: { - prototype: SVGPathSegLinetoHorizontalAbs; - new(): SVGPathSegLinetoHorizontalAbs; -} - -interface SVGPathSegArcAbs extends SVGPathSeg { - y: number; - sweepFlag: boolean; - r2: number; - x: number; - angle: number; - r1: number; - largeArcFlag: boolean; -} -declare var SVGPathSegArcAbs: { - prototype: SVGPathSegArcAbs; - new(): SVGPathSegArcAbs; -} - -interface SVGTransformList { - numberOfItems: number; - getItem(index: number): SVGTransform; - consolidate(): SVGTransform; - clear(): void; - appendItem(newItem: SVGTransform): SVGTransform; - initialize(newItem: SVGTransform): SVGTransform; - removeItem(index: number): SVGTransform; - insertItemBefore(newItem: SVGTransform, index: number): SVGTransform; - replaceItem(newItem: SVGTransform, index: number): SVGTransform; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; -} -declare var SVGTransformList: { - prototype: SVGTransformList; - new(): SVGTransformList; -} - -interface HTMLHtmlElement extends HTMLElement { - /** - * Sets or retrieves the DTD version that governs the current document. - */ - version: string; -} -declare var HTMLHtmlElement: { - prototype: HTMLHtmlElement; - new(): HTMLHtmlElement; -} - -interface SVGPathSegClosePath extends SVGPathSeg { -} -declare var SVGPathSegClosePath: { - prototype: SVGPathSegClosePath; - new(): SVGPathSegClosePath; -} - -interface HTMLFrameElement extends HTMLElement, GetSVGDocument, MSDataBindingExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: any; - /** - * Sets or retrieves whether the frame can be scrolled. - */ - scrolling: string; - /** - * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. - */ - marginHeight: string; - /** - * Sets or retrieves the left and right margin widths before displaying the text in a frame. - */ - marginWidth: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves whether the user can resize the frame. - */ - noResize: boolean; - /** - * Retrieves the object of the specified. - */ - contentWindow: Window; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the frame name. - */ - name: string; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Retrieves the document object of the page or frame. - */ - contentDocument: Document; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Sets or retrieves a URI to a long description of the object. - */ - longDesc: string; - /** - * Raised when the object has been completely received from the server. - */ - onload: (ev: Event) => any; - /** - * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. - */ - security: any; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLFrameElement: { - prototype: HTMLFrameElement; - new(): HTMLFrameElement; -} - -interface SVGAnimatedLength { - animVal: SVGLength; - baseVal: SVGLength; -} -declare var SVGAnimatedLength: { - prototype: SVGAnimatedLength; - new(): SVGAnimatedLength; -} - -interface SVGAnimatedPoints { - points: SVGPointList; - animatedPoints: SVGPointList; -} - -interface SVGDefsElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGDefsElement: { - prototype: SVGDefsElement; - new(): SVGDefsElement; -} - -interface HTMLQuoteElement extends HTMLElement { - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; - /** - * Sets or retrieves reference information about the object. - */ - cite: string; -} -declare var HTMLQuoteElement: { - prototype: HTMLQuoteElement; - new(): HTMLQuoteElement; -} - -interface CSSMediaRule extends CSSRule { - media: MediaList; - cssRules: CSSRuleList; - insertRule(rule: string, index?: number): number; - deleteRule(index?: number): void; -} -declare var CSSMediaRule: { - prototype: CSSMediaRule; - new(): CSSMediaRule; -} - -interface WindowModal { - dialogArguments: any; - returnValue: any; -} - -interface XMLHttpRequest extends EventTarget { - responseBody: any; - status: number; - readyState: number; - responseText: string; - responseXML: any; - ontimeout: (ev: Event) => any; - statusText: string; - onreadystatechange: (ev: Event) => any; - timeout: number; - onload: (ev: Event) => any; - response: any; - withCredentials: boolean; - onprogress: (ev: ProgressEvent) => any; - onabort: (ev: UIEvent) => any; - responseType: string; - onloadend: (ev: ProgressEvent) => any; - upload: XMLHttpRequestEventTarget; - onerror: (ev: ErrorEvent) => any; - onloadstart: (ev: Event) => any; - msCaching: string; - open(method: string, url: string, async?: boolean, user?: string, password?: string): void; - send(data?: any): void; - abort(): void; - getAllResponseHeaders(): string; - setRequestHeader(header: string, value: string): void; - getResponseHeader(header: string): string; - msCachingEnabled(): boolean; - overrideMimeType(mime: string): void; - LOADING: number; - DONE: number; - UNSENT: number; - OPENED: number; - HEADERS_RECEIVED: number; - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var XMLHttpRequest: { - prototype: XMLHttpRequest; - new(): XMLHttpRequest; - LOADING: number; - DONE: number; - UNSENT: number; - OPENED: number; - HEADERS_RECEIVED: number; - create(): XMLHttpRequest; -} - -interface HTMLTableHeaderCellElement extends HTMLTableCellElement { - /** - * Sets or retrieves the group of cells in a table to which the object's information applies. - */ - scope: string; -} -declare var HTMLTableHeaderCellElement: { - prototype: HTMLTableHeaderCellElement; - new(): HTMLTableHeaderCellElement; -} - -interface HTMLDListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction { -} -declare var HTMLDListElement: { - prototype: HTMLDListElement; - new(): HTMLDListElement; -} - -interface MSDataBindingExtensions { - dataSrc: string; - dataFormatAs: string; - dataFld: string; -} - -interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg { - x: number; -} -declare var SVGPathSegLinetoHorizontalRel: { - prototype: SVGPathSegLinetoHorizontalRel; - new(): SVGPathSegLinetoHorizontalRel; -} - -interface SVGEllipseElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - ry: SVGAnimatedLength; - cx: SVGAnimatedLength; - rx: SVGAnimatedLength; - cy: SVGAnimatedLength; -} -declare var SVGEllipseElement: { - prototype: SVGEllipseElement; - new(): SVGEllipseElement; -} - -interface SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { - target: SVGAnimatedString; -} -declare var SVGAElement: { - prototype: SVGAElement; - new(): SVGAElement; -} - -interface SVGStylable { - className: SVGAnimatedString; - style: CSSStyleDeclaration; -} - -interface SVGTransformable extends SVGLocatable { - transform: SVGAnimatedTransformList; -} - -interface HTMLFrameSetElement extends HTMLElement { - ononline: (ev: Event) => any; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the frame heights of the object. - */ - rows: string; - /** - * Sets or retrieves the frame widths of the object. - */ - cols: string; - /** - * Fires when the object loses the input focus. - */ - onblur: (ev: FocusEvent) => any; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Fires when the object receives focus. - */ - onfocus: (ev: FocusEvent) => any; - onmessage: (ev: MessageEvent) => any; - onerror: (ev: ErrorEvent) => any; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - onresize: (ev: UIEvent) => any; - name: string; - onafterprint: (ev: Event) => any; - onbeforeprint: (ev: Event) => any; - onoffline: (ev: Event) => any; - border: string; - onunload: (ev: Event) => any; - onhashchange: (ev: Event) => any; - onload: (ev: Event) => any; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - onstorage: (ev: StorageEvent) => any; - onpageshow: (ev: PageTransitionEvent) => any; - onpagehide: (ev: PageTransitionEvent) => any; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLFrameSetElement: { - prototype: HTMLFrameSetElement; - new(): HTMLFrameSetElement; -} - -interface Screen extends EventTarget { - width: number; - deviceXDPI: number; - fontSmoothingEnabled: boolean; - bufferDepth: number; - logicalXDPI: number; - systemXDPI: number; - availHeight: number; - height: number; - logicalYDPI: number; - systemYDPI: number; - updateInterval: number; - colorDepth: number; - availWidth: number; - deviceYDPI: number; - pixelDepth: number; - msOrientation: string; - onmsorientationchange: (ev: any) => any; - msLockOrientation(orientation: string): boolean; - msLockOrientation(orientations: string[]): boolean; - msUnlockOrientation(): void; - addEventListener(type: "msorientationchange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Screen: { - prototype: Screen; - new(): Screen; -} - -interface Coordinates { - altitudeAccuracy: number; - longitude: number; - latitude: number; - speed: number; - heading: number; - altitude: number; - accuracy: number; -} -declare var Coordinates: { - prototype: Coordinates; - new(): Coordinates; -} - -interface NavigatorGeolocation { - geolocation: Geolocation; -} - -interface NavigatorContentUtils { -} - -interface EventListener { - (evt: Event): void; -} - -interface SVGLangSpace { - xmllang: string; - xmlspace: string; -} - -interface DataTransfer { - effectAllowed: string; - dropEffect: string; - types: DOMStringList; - files: FileList; - clearData(format?: string): boolean; - setData(format: string, data: string): boolean; - getData(format: string): string; -} -declare var DataTransfer: { - prototype: DataTransfer; - new(): DataTransfer; -} - -interface FocusEvent extends UIEvent { - relatedTarget: EventTarget; - initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void; -} -declare var FocusEvent: { - prototype: FocusEvent; - new(): FocusEvent; -} - -interface Range { - startOffset: number; - collapsed: boolean; - endOffset: number; - startContainer: Node; - endContainer: Node; - commonAncestorContainer: Node; - setStart(refNode: Node, offset: number): void; - setEndBefore(refNode: Node): void; - setStartBefore(refNode: Node): void; - selectNode(refNode: Node): void; - detach(): void; - getBoundingClientRect(): ClientRect; - toString(): string; - compareBoundaryPoints(how: number, sourceRange: Range): number; - insertNode(newNode: Node): void; - collapse(toStart: boolean): void; - selectNodeContents(refNode: Node): void; - cloneContents(): DocumentFragment; - setEnd(refNode: Node, offset: number): void; - cloneRange(): Range; - getClientRects(): ClientRectList; - surroundContents(newParent: Node): void; - deleteContents(): void; - setStartAfter(refNode: Node): void; - extractContents(): DocumentFragment; - setEndAfter(refNode: Node): void; - createContextualFragment(fragment: string): DocumentFragment; - END_TO_END: number; - START_TO_START: number; - START_TO_END: number; - END_TO_START: number; -} -declare var Range: { - prototype: Range; - new(): Range; - END_TO_END: number; - START_TO_START: number; - START_TO_END: number; - END_TO_START: number; -} - -interface SVGPoint { - y: number; - x: number; - matrixTransform(matrix: SVGMatrix): SVGPoint; -} -declare var SVGPoint: { - prototype: SVGPoint; - new(): SVGPoint; -} - -interface MSPluginsCollection { - length: number; - refresh(reload?: boolean): void; -} -declare var MSPluginsCollection: { - prototype: MSPluginsCollection; - new(): MSPluginsCollection; -} - -interface SVGAnimatedNumberList { - animVal: SVGNumberList; - baseVal: SVGNumberList; -} -declare var SVGAnimatedNumberList: { - prototype: SVGAnimatedNumberList; - new(): SVGAnimatedNumberList; -} - -interface SVGSVGElement extends SVGElement, SVGStylable, SVGZoomAndPan, DocumentEvent, SVGLangSpace, SVGLocatable, SVGTests, SVGFitToViewBox, SVGExternalResourcesRequired { - width: SVGAnimatedLength; - x: SVGAnimatedLength; - contentStyleType: string; - onzoom: (ev: any) => any; - y: SVGAnimatedLength; - viewport: SVGRect; - onerror: (ev: ErrorEvent) => any; - pixelUnitToMillimeterY: number; - onresize: (ev: UIEvent) => any; - screenPixelToMillimeterY: number; - height: SVGAnimatedLength; - onabort: (ev: UIEvent) => any; - contentScriptType: string; - pixelUnitToMillimeterX: number; - currentTranslate: SVGPoint; - onunload: (ev: Event) => any; - currentScale: number; - onscroll: (ev: UIEvent) => any; - screenPixelToMillimeterX: number; - setCurrentTime(seconds: number): void; - createSVGLength(): SVGLength; - getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeList; - unpauseAnimations(): void; - createSVGRect(): SVGRect; - checkIntersection(element: SVGElement, rect: SVGRect): boolean; - unsuspendRedrawAll(): void; - pauseAnimations(): void; - suspendRedraw(maxWaitMilliseconds: number): number; - deselectAll(): void; - createSVGAngle(): SVGAngle; - getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeList; - createSVGTransform(): SVGTransform; - unsuspendRedraw(suspendHandleID: number): void; - forceRedraw(): void; - getCurrentTime(): number; - checkEnclosure(element: SVGElement, rect: SVGRect): boolean; - createSVGMatrix(): SVGMatrix; - createSVGPoint(): SVGPoint; - createSVGNumber(): SVGNumber; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; - getElementById(elementId: string): Element; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "zoom", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var SVGSVGElement: { - prototype: SVGSVGElement; - new(): SVGSVGElement; -} - -interface HTMLLabelElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the object to which the given label object is assigned. - */ - htmlFor: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; -} -declare var HTMLLabelElement: { - prototype: HTMLLabelElement; - new(): HTMLLabelElement; -} - -interface MSResourceMetadata { - protocol: string; - fileSize: string; - fileUpdatedDate: string; - nameProp: string; - fileCreatedDate: string; - fileModifiedDate: string; - mimeType: string; -} - -interface HTMLLegendElement extends HTMLElement, MSDataBindingExtensions { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - align: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; -} -declare var HTMLLegendElement: { - prototype: HTMLLegendElement; - new(): HTMLLegendElement; -} - -interface HTMLDirectoryElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { -} -declare var HTMLDirectoryElement: { - prototype: HTMLDirectoryElement; - new(): HTMLDirectoryElement; -} - -interface SVGAnimatedInteger { - animVal: number; - baseVal: number; -} -declare var SVGAnimatedInteger: { - prototype: SVGAnimatedInteger; - new(): SVGAnimatedInteger; -} - -interface SVGTextElement extends SVGTextPositioningElement, SVGTransformable { -} -declare var SVGTextElement: { - prototype: SVGTextElement; - new(): SVGTextElement; -} - -interface SVGTSpanElement extends SVGTextPositioningElement { -} -declare var SVGTSpanElement: { - prototype: SVGTSpanElement; - new(): SVGTSpanElement; -} - -interface HTMLLIElement extends HTMLElement, DOML2DeprecatedListNumberingAndBulletStyle { - /** - * Sets or retrieves the value of a list item. - */ - value: number; -} -declare var HTMLLIElement: { - prototype: HTMLLIElement; - new(): HTMLLIElement; -} - -interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg { - y: number; -} -declare var SVGPathSegLinetoVerticalAbs: { - prototype: SVGPathSegLinetoVerticalAbs; - new(): SVGPathSegLinetoVerticalAbs; -} - -interface MSStorageExtensions { - remainingSpace: number; -} - -interface SVGStyleElement extends SVGElement, SVGLangSpace { - media: string; - type: string; - title: string; -} -declare var SVGStyleElement: { - prototype: SVGStyleElement; - new(): SVGStyleElement; -} - -interface MSCurrentStyleCSSProperties extends MSCSSProperties { - blockDirection: string; - clipBottom: string; - clipLeft: string; - clipRight: string; - clipTop: string; - hasLayout: string; -} -declare var MSCurrentStyleCSSProperties: { - prototype: MSCurrentStyleCSSProperties; - new(): MSCurrentStyleCSSProperties; -} - -interface MSHTMLCollectionExtensions { - urns(urn: any): any; - tags(tagName: any): any; -} - -interface Storage extends MSStorageExtensions { - length: number; - getItem(key: string): any; - [key: string]: any; - setItem(key: string, data: string): void; - clear(): void; - removeItem(key: string): void; - key(index: number): string; - [index: number]: string; -} -declare var Storage: { - prototype: Storage; - new(): Storage; -} - -interface HTMLIFrameElement extends HTMLElement, GetSVGDocument, MSDataBindingExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Sets or retrieves whether the frame can be scrolled. - */ - scrolling: string; - /** - * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. - */ - marginHeight: string; - /** - * Sets or retrieves the left and right margin widths before displaying the text in a frame. - */ - marginWidth: string; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves whether the user can resize the frame. - */ - noResize: boolean; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Retrieves the object of the specified. - */ - contentWindow: Window; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the frame name. - */ - name: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Retrieves the document object of the page or frame. - */ - contentDocument: Document; - /** - * Sets or retrieves the horizontal margin for the object. - */ - hspace: number; - /** - * Sets or retrieves a URI to a long description of the object. - */ - longDesc: string; - /** - * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. - */ - security: any; - /** - * Raised when the object has been completely received from the server. - */ - onload: (ev: Event) => any; - sandbox: DOMSettableTokenList; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLIFrameElement: { - prototype: HTMLIFrameElement; - new(): HTMLIFrameElement; -} - -interface TextRangeCollection { - length: number; - item(index: number): TextRange; - [index: number]: TextRange; -} -declare var TextRangeCollection: { - prototype: TextRangeCollection; - new(): TextRangeCollection; -} - -interface HTMLBodyElement extends HTMLElement, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { - scroll: string; - ononline: (ev: Event) => any; - onblur: (ev: FocusEvent) => any; - noWrap: boolean; - onfocus: (ev: FocusEvent) => any; - onmessage: (ev: MessageEvent) => any; - text: any; - onerror: (ev: ErrorEvent) => any; - bgProperties: string; - onresize: (ev: UIEvent) => any; - link: any; - aLink: any; - bottomMargin: any; - topMargin: any; - onafterprint: (ev: Event) => any; - vLink: any; - onbeforeprint: (ev: Event) => any; - onoffline: (ev: Event) => any; - onunload: (ev: Event) => any; - onhashchange: (ev: Event) => any; - onload: (ev: Event) => any; - rightMargin: any; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - leftMargin: any; - onstorage: (ev: StorageEvent) => any; - onpopstate: (ev: PopStateEvent) => any; - onpageshow: (ev: PageTransitionEvent) => any; - onpagehide: (ev: PageTransitionEvent) => any; - createTextRange(): TextRange; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLBodyElement: { - prototype: HTMLBodyElement; - new(): HTMLBodyElement; -} - -interface DocumentType extends Node { - name: string; - notations: NamedNodeMap; - systemId: string; - internalSubset: string; - entities: NamedNodeMap; - publicId: string; -} -declare var DocumentType: { - prototype: DocumentType; - new(): DocumentType; -} - -interface SVGRadialGradientElement extends SVGGradientElement { - cx: SVGAnimatedLength; - r: SVGAnimatedLength; - cy: SVGAnimatedLength; - fx: SVGAnimatedLength; - fy: SVGAnimatedLength; -} -declare var SVGRadialGradientElement: { - prototype: SVGRadialGradientElement; - new(): SVGRadialGradientElement; -} - -interface MutationEvent extends Event { - newValue: string; - attrChange: number; - attrName: string; - prevValue: string; - relatedNode: Node; - initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; - MODIFICATION: number; - REMOVAL: number; - ADDITION: number; -} -declare var MutationEvent: { - prototype: MutationEvent; - new(): MutationEvent; - MODIFICATION: number; - REMOVAL: number; - ADDITION: number; -} - -interface DragEvent extends MouseEvent { - dataTransfer: DataTransfer; - initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void; - msConvertURL(file: File, targetType: string, targetURL?: string): void; -} -declare var DragEvent: { - prototype: DragEvent; - new(): DragEvent; -} - -interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundColorStyle { +interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment { /** * Sets or retrieves a value that indicates the table alignment. */ @@ -6638,650 +8829,125 @@ interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment, DOML2 * @param index Number that specifies the zero-based position in the rows collection of the row to remove. */ deleteRow(index?: number): void; - /** - * Moves a table row to a new position. - * @param indexFrom Number that specifies the index in the rows collection of the table row that is moved. - * @param indexTo Number that specifies where the row is moved within the rows collection. - */ - moveRow(indexFrom?: number, indexTo?: number): any; /** * Creates a new row (tr) in the table, and adds the row to the rows collection. * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. */ insertRow(index?: number): HTMLElement; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var HTMLTableSectionElement: { prototype: HTMLTableSectionElement; new(): HTMLTableSectionElement; } -interface DOML2DeprecatedListNumberingAndBulletStyle { - type: string; -} - -interface HTMLInputElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: string; - status: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Gets or sets the starting position or offset of a text selection. - */ - selectionStart: number; - indeterminate: boolean; - readOnly: boolean; - size: number; - loop: number; - /** - * Gets or sets the end position or offset of a text selection. - */ - selectionEnd: number; - /** - * Sets or retrieves the URL of the virtual reality modeling language (VRML) world to be displayed in the window. - */ - vrml: string; - /** - * Sets or retrieves a lower resolution image to display. - */ - lowsrc: string; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Sets or retrieves a comma-separated list of content types. - */ - accept: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves the state of the check box or radio button. - */ - defaultChecked: boolean; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Returns the value of the data at the cursor's current position. - */ - value: string; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - border: string; - dynsrc: string; - /** - * Sets or retrieves the state of the check box or radio button. - */ - checked: boolean; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - hspace: number; - /** - * Sets or retrieves the maximum number of characters that the user can enter in a text control. - */ - maxLength: number; - /** - * Returns the content type of the object. - */ - type: string; - /** - * Sets or retrieves the initial contents of the object. - */ - defaultValue: string; - /** - * Retrieves whether the object is fully loaded. - */ - complete: boolean; - start: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a FileList object on a file type input object. - */ - files: FileList; - /** - * Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field. - */ - max: string; - /** - * Overrides the target attribute on a form element. - */ - formTarget: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field. - */ - step: string; +interface HTMLTextAreaElement extends HTMLElement { /** * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. */ autofocus: boolean; /** - * When present, marks an element that can't be submitted without a value. + * Sets or retrieves the width of the object. */ - required: boolean; + cols: number; /** - * Used to override the encoding (formEnctype attribute) specified on the form element. + * Sets or retrieves the initial contents of the object. */ - formEnctype: string; + defaultValue: string; + disabled: boolean; /** - * Returns the input field value as a number. + * Retrieves a reference to the form that the object is embedded in. */ - valueAsNumber: number; + form: HTMLFormElement; + /** + * Sets or retrieves the maximum number of characters that the user can enter in a text control. + */ + maxLength: number; + /** + * Sets or retrieves the name of the object. + */ + name: string; /** * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. */ placeholder: string; /** - * Overrides the submit method attribute previously specified on a form element. + * Sets or retrieves the value indicated whether the content of the object is read-only. */ - formMethod: string; + readOnly: boolean; /** - * Specifies the ID of a pre-defined datalist of options for an input element. + * When present, marks an element that can't be submitted without a value. */ - list: HTMLElement; + required: boolean; /** - * Specifies whether autocomplete is applied to an editable text field. + * Sets or retrieves the number of horizontal rows contained in the object. */ - autocomplete: string; + rows: number; /** - * Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field. + * Gets or sets the end position or offset of a text selection. */ - min: string; + selectionEnd: number; /** - * Overrides the action attribute (where the data on a form is sent) on the parent form element. + * Gets or sets the starting position or offset of a text selection. */ - formAction: string; + selectionStart: number; /** - * Gets or sets a string containing a regular expression that the user's input must match. + * Sets or retrieves the value indicating whether the control is selected. */ - pattern: string; + status: any; + /** + * Retrieves the type of control. + */ + type: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; /** * Returns a ValidityState object that represents the validity states of an element. */ validity: ValidityState; /** - * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. + * Retrieves or sets the text in the entry field of the textArea element. */ - formNoValidate: string; + value: string; /** - * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. + * Returns whether an element will successfully validate based on forms validation rules and constraints. */ - multiple: boolean; + willValidate: boolean; + /** + * Sets or retrieves how to handle wordwrapping in the object. + */ + wrap: string; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; /** * Creates a TextRange object for the element. */ createTextRange(): TextRange; + /** + * Highlights the input area of a form element. + */ + select(): void; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; /** * Sets the start and end positions of a selection in a text field. * @param start The offset into the text field for the start of the selection. * @param end The offset into the text field for the end of the selection. */ setSelectionRange(start: number, end: number): void; - /** - * Makes the selection equal to the current object. - */ - select(): void; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. - * @param n Value to decrement the value by. - */ - stepDown(n?: number): void; - /** - * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value. - * @param n Value to increment the value by. - */ - stepUp(n?: number): void; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLInputElement: { - prototype: HTMLInputElement; - new(): HTMLInputElement; } -interface HTMLAnchorElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rel: string; - /** - * Contains the protocol of the URL. - */ - protocol: string; - /** - * Sets or retrieves the substring of the href property that follows the question mark. - */ - search: string; - /** - * Sets or retrieves the coordinates of the object. - */ - coords: string; - /** - * Contains the hostname of a URL. - */ - hostname: string; - /** - * Contains the pathname of the URL. - */ - pathname: string; - Methods: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - protocolLong: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or retrieves the shape of the object. - */ - name: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the language code of the object. - */ - hreflang: string; - /** - * Sets or retrieves the port number associated with a URL. - */ - port: string; - /** - * Contains the hostname and port values of the URL. - */ - host: string; - /** - * Contains the anchor portion of the URL including the hash sign (#). - */ - hash: string; - nameProp: string; - urn: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rev: string; - /** - * Sets or retrieves the shape of the object. - */ - shape: string; - type: string; - mimeType: string; - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; - /** - * Returns a string representation of an object. - */ - toString(): string; -} -declare var HTMLAnchorElement: { - prototype: HTMLAnchorElement; - new(): HTMLAnchorElement; -} - -interface HTMLParamElement extends HTMLElement { - /** - * Sets or retrieves the value of an input parameter for an element. - */ - value: string; - /** - * Sets or retrieves the name of an input parameter for an element. - */ - name: string; - /** - * Sets or retrieves the content type of the resource designated by the value attribute. - */ - type: string; - /** - * Sets or retrieves the data type of the value attribute. - */ - valueType: string; -} -declare var HTMLParamElement: { - prototype: HTMLParamElement; - new(): HTMLParamElement; -} - -interface SVGImageElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGImageElement: { - prototype: SVGImageElement; - new(): SVGImageElement; -} - -interface SVGAnimatedNumber { - animVal: number; - baseVal: number; -} -declare var SVGAnimatedNumber: { - prototype: SVGAnimatedNumber; - new(): SVGAnimatedNumber; -} - -interface PerformanceTiming { - redirectStart: number; - domainLookupEnd: number; - responseStart: number; - domComplete: number; - domainLookupStart: number; - loadEventStart: number; - msFirstPaint: number; - unloadEventEnd: number; - fetchStart: number; - requestStart: number; - domInteractive: number; - navigationStart: number; - connectEnd: number; - loadEventEnd: number; - connectStart: number; - responseEnd: number; - domLoading: number; - redirectEnd: number; - unloadEventStart: number; - domContentLoadedEventStart: number; - domContentLoadedEventEnd: number; - toJSON(): any; -} -declare var PerformanceTiming: { - prototype: PerformanceTiming; - new(): PerformanceTiming; -} - -interface HTMLPreElement extends HTMLElement, DOML2DeprecatedTextFlowControl { - /** - * Sets or gets a value that you can use to implement your own width functionality for the object. - */ - width: number; - /** - * Indicates a citation by rendering text in italic type. - */ - cite: string; -} -declare var HTMLPreElement: { - prototype: HTMLPreElement; - new(): HTMLPreElement; -} - -interface EventException { - code: number; - message: string; - name: string; - toString(): string; - DISPATCH_REQUEST_ERR: number; - UNSPECIFIED_EVENT_TYPE_ERR: number; -} -declare var EventException: { - prototype: EventException; - new(): EventException; - DISPATCH_REQUEST_ERR: number; - UNSPECIFIED_EVENT_TYPE_ERR: number; -} - -interface MSNavigatorDoNotTrack { - msDoNotTrack: string; - removeSiteSpecificTrackingException(args: ExceptionInformation): void; - removeWebWideTrackingException(args: ExceptionInformation): void; - storeWebWideTrackingException(args: StoreExceptionsInformation): void; - storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void; - confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean; - confirmWebWideTrackingException(args: ExceptionInformation): boolean; -} - -interface NavigatorOnLine { - onLine: boolean; -} - -interface WindowLocalStorage { - localStorage: Storage; -} - -interface SVGMetadataElement extends SVGElement { -} -declare var SVGMetadataElement: { - prototype: SVGMetadataElement; - new(): SVGMetadataElement; -} - -interface SVGPathSegArcRel extends SVGPathSeg { - y: number; - sweepFlag: boolean; - r2: number; - x: number; - angle: number; - r1: number; - largeArcFlag: boolean; -} -declare var SVGPathSegArcRel: { - prototype: SVGPathSegArcRel; - new(): SVGPathSegArcRel; -} - -interface SVGPathSegMovetoAbs extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegMovetoAbs: { - prototype: SVGPathSegMovetoAbs; - new(): SVGPathSegMovetoAbs; -} - -interface SVGStringList { - numberOfItems: number; - replaceItem(newItem: string, index: number): string; - getItem(index: number): string; - clear(): void; - appendItem(newItem: string): string; - initialize(newItem: string): string; - removeItem(index: number): string; - insertItemBefore(newItem: string, index: number): string; -} -declare var SVGStringList: { - prototype: SVGStringList; - new(): SVGStringList; -} - -interface XDomainRequest { - timeout: number; - onerror: (ev: ErrorEvent) => any; - onload: (ev: Event) => any; - onprogress: (ev: ProgressEvent) => any; - ontimeout: (ev: Event) => any; - responseText: string; - contentType: string; - open(method: string, url: string): void; - abort(): void; - send(data?: any): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var XDomainRequest: { - prototype: XDomainRequest; - new(): XDomainRequest; - create(): XDomainRequest; -} - -interface DOML2DeprecatedBackgroundColorStyle { - bgColor: any; -} - -interface ElementTraversal { - childElementCount: number; - previousElementSibling: Element; - lastElementChild: Element; - nextElementSibling: Element; - firstElementChild: Element; -} - -interface SVGLength { - valueAsString: string; - valueInSpecifiedUnits: number; - value: number; - unitType: number; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - convertToSpecifiedUnits(unitType: number): void; - SVG_LENGTHTYPE_NUMBER: number; - SVG_LENGTHTYPE_CM: number; - SVG_LENGTHTYPE_PC: number; - SVG_LENGTHTYPE_PERCENTAGE: number; - SVG_LENGTHTYPE_MM: number; - SVG_LENGTHTYPE_PT: number; - SVG_LENGTHTYPE_IN: number; - SVG_LENGTHTYPE_EMS: number; - SVG_LENGTHTYPE_PX: number; - SVG_LENGTHTYPE_UNKNOWN: number; - SVG_LENGTHTYPE_EXS: number; -} -declare var SVGLength: { - prototype: SVGLength; - new(): SVGLength; - SVG_LENGTHTYPE_NUMBER: number; - SVG_LENGTHTYPE_CM: number; - SVG_LENGTHTYPE_PC: number; - SVG_LENGTHTYPE_PERCENTAGE: number; - SVG_LENGTHTYPE_MM: number; - SVG_LENGTHTYPE_PT: number; - SVG_LENGTHTYPE_IN: number; - SVG_LENGTHTYPE_EMS: number; - SVG_LENGTHTYPE_PX: number; - SVG_LENGTHTYPE_UNKNOWN: number; - SVG_LENGTHTYPE_EXS: number; -} - -interface SVGPolygonElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGAnimatedPoints, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGPolygonElement: { - prototype: SVGPolygonElement; - new(): SVGPolygonElement; -} - -interface HTMLPhraseElement extends HTMLElement { - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; - /** - * Sets or retrieves reference information about the object. - */ - cite: string; -} -declare var HTMLPhraseElement: { - prototype: HTMLPhraseElement; - new(): HTMLPhraseElement; -} - -interface NavigatorStorageUtils { -} - -interface SVGPathSegCurvetoCubicRel extends SVGPathSeg { - y: number; - y1: number; - x2: number; - x: number; - x1: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicRel: { - prototype: SVGPathSegCurvetoCubicRel; - new(): SVGPathSegCurvetoCubicRel; -} - -interface SVGTextContentElement extends SVGElement, SVGStylable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - textLength: SVGAnimatedLength; - lengthAdjust: SVGAnimatedEnumeration; - getCharNumAtPosition(point: SVGPoint): number; - getStartPositionOfChar(charnum: number): SVGPoint; - getExtentOfChar(charnum: number): SVGRect; - getComputedTextLength(): number; - getSubStringLength(charnum: number, nchars: number): number; - selectSubString(charnum: number, nchars: number): void; - getNumberOfChars(): number; - getRotationOfChar(charnum: number): number; - getEndPositionOfChar(charnum: number): SVGPoint; - LENGTHADJUST_SPACING: number; - LENGTHADJUST_SPACINGANDGLYPHS: number; - LENGTHADJUST_UNKNOWN: number; -} -declare var SVGTextContentElement: { - prototype: SVGTextContentElement; - new(): SVGTextContentElement; - LENGTHADJUST_SPACING: number; - LENGTHADJUST_SPACINGANDGLYPHS: number; - LENGTHADJUST_UNKNOWN: number; -} - -interface DOML2DeprecatedColorProperty { - color: string; -} - -interface Location { - hash: string; - protocol: string; - search: string; - href: string; - hostname: string; - port: string; - pathname: string; - host: string; - reload(flag?: boolean): void; - replace(url: string): void; - assign(url: string): void; - toString(): string; -} -declare var Location: { - prototype: Location; - new(): Location; +declare var HTMLTextAreaElement: { + prototype: HTMLTextAreaElement; + new(): HTMLTextAreaElement; } interface HTMLTitleElement extends HTMLElement { @@ -7290,719 +8956,215 @@ interface HTMLTitleElement extends HTMLElement { */ text: string; } + declare var HTMLTitleElement: { prototype: HTMLTitleElement; new(): HTMLTitleElement; } -interface HTMLStyleElement extends HTMLElement, LinkStyle { - /** - * Sets or retrieves the media type. - */ - media: string; - /** - * Retrieves the CSS language in which the style sheet is written. - */ +interface HTMLTrackElement extends HTMLElement { + default: boolean; + kind: string; + label: string; + readyState: number; + src: string; + srclang: string; + track: TextTrack; + ERROR: number; + LOADED: number; + LOADING: number; + NONE: number; +} + +declare var HTMLTrackElement: { + prototype: HTMLTrackElement; + new(): HTMLTrackElement; + ERROR: number; + LOADED: number; + LOADING: number; + NONE: number; +} + +interface HTMLUListElement extends HTMLElement { + compact: boolean; type: string; } -declare var HTMLStyleElement: { - prototype: HTMLStyleElement; - new(): HTMLStyleElement; + +declare var HTMLUListElement: { + prototype: HTMLUListElement; + new(): HTMLUListElement; } -interface PerformanceEntry { - name: string; - startTime: number; - duration: number; - entryType: string; -} -declare var PerformanceEntry: { - prototype: PerformanceEntry; - new(): PerformanceEntry; +interface HTMLUnknownElement extends HTMLElement { } -interface SVGTransform { - type: number; - angle: number; - matrix: SVGMatrix; - setTranslate(tx: number, ty: number): void; - setScale(sx: number, sy: number): void; - setMatrix(matrix: SVGMatrix): void; - setSkewY(angle: number): void; - setRotate(angle: number, cx: number, cy: number): void; - setSkewX(angle: number): void; - SVG_TRANSFORM_SKEWX: number; - SVG_TRANSFORM_UNKNOWN: number; - SVG_TRANSFORM_SCALE: number; - SVG_TRANSFORM_TRANSLATE: number; - SVG_TRANSFORM_MATRIX: number; - SVG_TRANSFORM_ROTATE: number; - SVG_TRANSFORM_SKEWY: number; -} -declare var SVGTransform: { - prototype: SVGTransform; - new(): SVGTransform; - SVG_TRANSFORM_SKEWX: number; - SVG_TRANSFORM_UNKNOWN: number; - SVG_TRANSFORM_SCALE: number; - SVG_TRANSFORM_TRANSLATE: number; - SVG_TRANSFORM_MATRIX: number; - SVG_TRANSFORM_ROTATE: number; - SVG_TRANSFORM_SKEWY: number; -} - -interface UIEvent extends Event { - detail: number; - view: Window; - initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void; -} -declare var UIEvent: { - prototype: UIEvent; - new(): UIEvent; -} - -interface SVGURIReference { - href: SVGAnimatedString; -} - -interface SVGPathSeg { - pathSegType: number; - pathSegTypeAsLetter: string; - PATHSEG_MOVETO_REL: number; - PATHSEG_LINETO_VERTICAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - PATHSEG_CURVETO_QUADRATIC_REL: number; - PATHSEG_CURVETO_CUBIC_ABS: number; - PATHSEG_LINETO_HORIZONTAL_ABS: number; - PATHSEG_CURVETO_QUADRATIC_ABS: number; - PATHSEG_LINETO_ABS: number; - PATHSEG_CLOSEPATH: number; - PATHSEG_LINETO_HORIZONTAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - PATHSEG_LINETO_REL: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - PATHSEG_ARC_REL: number; - PATHSEG_CURVETO_CUBIC_REL: number; - PATHSEG_UNKNOWN: number; - PATHSEG_LINETO_VERTICAL_ABS: number; - PATHSEG_ARC_ABS: number; - PATHSEG_MOVETO_ABS: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; -} -declare var SVGPathSeg: { - prototype: SVGPathSeg; - new(): SVGPathSeg; - PATHSEG_MOVETO_REL: number; - PATHSEG_LINETO_VERTICAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - PATHSEG_CURVETO_QUADRATIC_REL: number; - PATHSEG_CURVETO_CUBIC_ABS: number; - PATHSEG_LINETO_HORIZONTAL_ABS: number; - PATHSEG_CURVETO_QUADRATIC_ABS: number; - PATHSEG_LINETO_ABS: number; - PATHSEG_CLOSEPATH: number; - PATHSEG_LINETO_HORIZONTAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - PATHSEG_LINETO_REL: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - PATHSEG_ARC_REL: number; - PATHSEG_CURVETO_CUBIC_REL: number; - PATHSEG_UNKNOWN: number; - PATHSEG_LINETO_VERTICAL_ABS: number; - PATHSEG_ARC_ABS: number; - PATHSEG_MOVETO_ABS: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; -} - -interface WheelEvent extends MouseEvent { - deltaZ: number; - deltaX: number; - deltaMode: number; - deltaY: number; - initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void; - getCurrentPoint(element: Element): void; - DOM_DELTA_PIXEL: number; - DOM_DELTA_LINE: number; - DOM_DELTA_PAGE: number; -} -declare var WheelEvent: { - prototype: WheelEvent; - new(): WheelEvent; - DOM_DELTA_PIXEL: number; - DOM_DELTA_LINE: number; - DOM_DELTA_PAGE: number; -} - -interface MSEventAttachmentTarget { - attachEvent(event: string, listener: EventListener): boolean; - detachEvent(event: string, listener: EventListener): void; -} - -interface SVGNumber { - value: number; -} -declare var SVGNumber: { - prototype: SVGNumber; - new(): SVGNumber; -} - -interface SVGPathElement extends SVGElement, SVGStylable, SVGAnimatedPathData, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - getPathSegAtLength(distance: number): number; - getPointAtLength(distance: number): SVGPoint; - createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs; - createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel; - createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel; - createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs; - createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs; - createSVGPathSegClosePath(): SVGPathSegClosePath; - createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel; - createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel; - createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel; - createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs; - createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs; - createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel; - createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel; - createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs; - createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel; - getTotalLength(): number; - createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel; - createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs; - createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs; - createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs; -} -declare var SVGPathElement: { - prototype: SVGPathElement; - new(): SVGPathElement; -} - -interface MSCompatibleInfo { - version: string; - userAgent: string; -} -declare var MSCompatibleInfo: { - prototype: MSCompatibleInfo; - new(): MSCompatibleInfo; -} - -interface Text extends CharacterData, MSNodeExtensions { - wholeText: string; - splitText(offset: number): Text; - replaceWholeText(content: string): Text; -} -declare var Text: { - prototype: Text; - new(): Text; -} - -interface SVGAnimatedRect { - animVal: SVGRect; - baseVal: SVGRect; -} -declare var SVGAnimatedRect: { - prototype: SVGAnimatedRect; - new(): SVGAnimatedRect; -} - -interface CSSNamespaceRule extends CSSRule { - namespaceURI: string; - prefix: string; -} -declare var CSSNamespaceRule: { - prototype: CSSNamespaceRule; - new(): CSSNamespaceRule; -} - -interface SVGPathSegList { - numberOfItems: number; - replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg; - getItem(index: number): SVGPathSeg; - clear(): void; - appendItem(newItem: SVGPathSeg): SVGPathSeg; - initialize(newItem: SVGPathSeg): SVGPathSeg; - removeItem(index: number): SVGPathSeg; - insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg; -} -declare var SVGPathSegList: { - prototype: SVGPathSegList; - new(): SVGPathSegList; -} - -interface HTMLUnknownElement extends HTMLElement, MSDataBindingRecordSetReadonlyExtensions { -} declare var HTMLUnknownElement: { prototype: HTMLUnknownElement; new(): HTMLUnknownElement; } -interface HTMLAudioElement extends HTMLMediaElement { -} -declare var HTMLAudioElement: { - prototype: HTMLAudioElement; - new(): HTMLAudioElement; -} - -interface MSImageResourceExtensions { - dynsrc: string; - vrml: string; - lowsrc: string; - start: string; - loop: number; -} - -interface PositionError { - code: number; - message: string; - toString(): string; - POSITION_UNAVAILABLE: number; - PERMISSION_DENIED: number; - TIMEOUT: number; -} -declare var PositionError: { - prototype: PositionError; - new(): PositionError; - POSITION_UNAVAILABLE: number; - PERMISSION_DENIED: number; - TIMEOUT: number; -} - -interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { +interface HTMLVideoElement extends HTMLMediaElement { /** - * Sets or retrieves the width of the object. + * Gets or sets the height of the video element. */ - width: number; - /** - * Sets or retrieves a list of header cells that provide information for the object. - */ - headers: string; - /** - * Retrieves the position of the object in the cells collection of a row. - */ - cellIndex: number; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorLight: any; - /** - * Sets or retrieves the number columns in the table that the object should span. - */ - colSpan: number; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves a comma-delimited list of conceptual categories associated with the object. - */ - axis: string; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; - /** - * Sets or retrieves abbreviated text for the object. - */ - abbr: string; - /** - * Sets or retrieves how many rows in a table the cell should span. - */ - rowSpan: number; - /** - * Sets or retrieves the group of cells in a table to which the object's information applies. - */ - scope: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorDark: any; -} -declare var HTMLTableCellElement: { - prototype: HTMLTableCellElement; - new(): HTMLTableCellElement; -} - -interface SVGElementInstance extends EventTarget { - previousSibling: SVGElementInstance; - parentNode: SVGElementInstance; - lastChild: SVGElementInstance; - nextSibling: SVGElementInstance; - childNodes: SVGElementInstanceList; - correspondingUseElement: SVGUseElement; - correspondingElement: SVGElement; - firstChild: SVGElementInstance; -} -declare var SVGElementInstance: { - prototype: SVGElementInstance; - new(): SVGElementInstance; -} - -interface MSNamespaceInfoCollection { - length: number; - add(namespace?: string, urn?: string, implementationUrl?: any): any; - item(index: any): any; - // [index: any]: any; -} -declare var MSNamespaceInfoCollection: { - prototype: MSNamespaceInfoCollection; - new(): MSNamespaceInfoCollection; -} - -interface SVGCircleElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - cx: SVGAnimatedLength; - r: SVGAnimatedLength; - cy: SVGAnimatedLength; -} -declare var SVGCircleElement: { - prototype: SVGCircleElement; - new(): SVGCircleElement; -} - -interface StyleSheetList { - length: number; - item(index?: number): StyleSheet; - [index: number]: StyleSheet; -} -declare var StyleSheetList: { - prototype: StyleSheetList; - new(): StyleSheetList; -} - -interface CSSImportRule extends CSSRule { - styleSheet: CSSStyleSheet; - href: string; - media: MediaList; -} -declare var CSSImportRule: { - prototype: CSSImportRule; - new(): CSSImportRule; -} - -interface CustomEvent extends Event { - detail: any; - initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void; -} -declare var CustomEvent: { - prototype: CustomEvent; - new(): CustomEvent; -} - -interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty { - /** - * Sets or retrieves the current typeface family. - */ - face: string; - /** - * Sets or retrieves the font size of the object. - */ - size: number; -} -declare var HTMLBaseFontElement: { - prototype: HTMLBaseFontElement; - new(): HTMLBaseFontElement; -} - -interface HTMLTextAreaElement extends HTMLElement, MSDataBindingExtensions { - /** - * Retrieves or sets the text in the entry field of the textArea element. - */ - value: string; - /** - * Sets or retrieves the value indicating whether the control is selected. - */ - status: any; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Gets or sets the starting position or offset of a text selection. - */ - selectionStart: number; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: number; - /** - * Sets or retrieves the width of the object. - */ - cols: number; - /** - * Sets or retrieves the value indicated whether the content of the object is read-only. - */ - readOnly: boolean; - /** - * Sets or retrieves how to handle wordwrapping in the object. - */ - wrap: string; - /** - * Gets or sets the end position or offset of a text selection. - */ - selectionEnd: number; - /** - * Retrieves the type of control. - */ - type: string; - /** - * Sets or retrieves the initial contents of the object. - */ - defaultValue: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - /** - * Sets or retrieves the maximum number of characters that the user can enter in a text control. - */ - maxLength: number; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. - */ - placeholder: string; - /** - * Creates a TextRange object for the element. - */ - createTextRange(): TextRange; - /** - * Sets the start and end positions of a selection in a text field. - * @param start The offset into the text field for the start of the selection. - * @param end The offset into the text field for the end of the selection. - */ - setSelectionRange(start: number, end: number): void; - /** - * Highlights the input area of a form element. - */ - select(): void; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLTextAreaElement: { - prototype: HTMLTextAreaElement; - new(): HTMLTextAreaElement; -} - -interface Geolocation { - clearWatch(watchId: number): void; - getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void; - watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number; -} -declare var Geolocation: { - prototype: Geolocation; - new(): Geolocation; -} - -interface DOML2DeprecatedMarginStyle { - vspace: number; - hspace: number; -} - -interface MSWindowModeless { - dialogTop: any; - dialogLeft: any; - dialogWidth: any; - dialogHeight: any; - menuArguments: any; -} - -interface DOML2DeprecatedAlignmentStyle { - align: string; -} - -interface HTMLMarqueeElement extends HTMLElement, MSDataBindingExtensions, DOML2DeprecatedBackgroundColorStyle { - width: string; - onbounce: (ev: Event) => any; - vspace: number; - trueSpeed: boolean; - scrollAmount: number; - scrollDelay: number; - behavior: string; - height: string; - loop: number; - direction: string; - hspace: number; - onstart: (ev: Event) => any; - onfinish: (ev: Event) => any; - stop(): void; - start(): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "bounce", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "start", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "finish", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLMarqueeElement: { - prototype: HTMLMarqueeElement; - new(): HTMLMarqueeElement; -} - -interface SVGRect { - y: number; - width: number; - x: number; height: number; -} -declare var SVGRect: { - prototype: SVGRect; - new(): SVGRect; + msHorizontalMirror: boolean; + msIsLayoutOptimalForPlayback: boolean; + msIsStereo3D: boolean; + msStereo3DPackingMode: string; + msStereo3DRenderMode: string; + msZoom: boolean; + onMSVideoFormatChanged: (ev: Event) => any; + onMSVideoFrameStepCompleted: (ev: Event) => any; + onMSVideoOptimalLayoutChanged: (ev: Event) => any; + /** + * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available. + */ + poster: string; + /** + * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known. + */ + videoHeight: number; + /** + * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known. + */ + videoWidth: number; + webkitDisplayingFullscreen: boolean; + webkitSupportsFullscreen: boolean; + /** + * Gets or sets the width of the video element. + */ + width: number; + getVideoPlaybackQuality(): VideoPlaybackQuality; + msFrameStep(forward: boolean): void; + msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; + msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void; + webkitEnterFullScreen(): void; + webkitEnterFullscreen(): void; + webkitExitFullScreen(): void; + webkitExitFullscreen(): void; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSVideoFormatChanged", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "MSVideoFrameStepCompleted", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "MSVideoOptimalLayoutChanged", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface MSNodeExtensions { - swapNode(otherNode: Node): Node; - removeNode(deep?: boolean): Node; - replaceNode(replacement: Node): Node; +declare var HTMLVideoElement: { + prototype: HTMLVideoElement; + new(): HTMLVideoElement; +} + +interface HashChangeEvent extends Event { + newURL: string; + oldURL: string; +} + +declare var HashChangeEvent: { + prototype: HashChangeEvent; + new(type: string, eventInitDict?: HashChangeEventInit): HashChangeEvent; } interface History { @@ -8011,2002 +9173,373 @@ interface History { back(distance?: any): void; forward(distance?: any): void; go(delta?: any): void; - replaceState(statedata: any, title: string, url?: string): void; - pushState(statedata: any, title: string, url?: string): void; + pushState(statedata: any, title?: string, url?: string): void; + replaceState(statedata: any, title?: string, url?: string): void; } + declare var History: { prototype: History; new(): History; } -interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg { - y: number; - y1: number; - x2: number; - x: number; - x1: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicAbs: { - prototype: SVGPathSegCurvetoCubicAbs; - new(): SVGPathSegCurvetoCubicAbs; +interface IDBCursor { + direction: string; + key: any; + primaryKey: any; + source: any; + advance(count: number): void; + continue(key?: any): void; + delete(): IDBRequest; + update(value: any): IDBRequest; + NEXT: string; + NEXT_NO_DUPLICATE: string; + PREV: string; + PREV_NO_DUPLICATE: string; } -interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg { - y: number; - y1: number; - x: number; - x1: number; -} -declare var SVGPathSegCurvetoQuadraticAbs: { - prototype: SVGPathSegCurvetoQuadraticAbs; - new(): SVGPathSegCurvetoQuadraticAbs; +declare var IDBCursor: { + prototype: IDBCursor; + new(): IDBCursor; + NEXT: string; + NEXT_NO_DUPLICATE: string; + PREV: string; + PREV_NO_DUPLICATE: string; } -interface TimeRanges { - length: number; - start(index: number): number; - end(index: number): number; -} -declare var TimeRanges: { - prototype: TimeRanges; - new(): TimeRanges; +interface IDBCursorWithValue extends IDBCursor { + value: any; } -interface CSSRule { - cssText: string; - parentStyleSheet: CSSStyleSheet; - parentRule: CSSRule; - type: number; - IMPORT_RULE: number; - MEDIA_RULE: number; - STYLE_RULE: number; - NAMESPACE_RULE: number; - PAGE_RULE: number; - UNKNOWN_RULE: number; - FONT_FACE_RULE: number; - CHARSET_RULE: number; - KEYFRAMES_RULE: number; - KEYFRAME_RULE: number; - VIEWPORT_RULE: number; -} -declare var CSSRule: { - prototype: CSSRule; - new(): CSSRule; - IMPORT_RULE: number; - MEDIA_RULE: number; - STYLE_RULE: number; - NAMESPACE_RULE: number; - PAGE_RULE: number; - UNKNOWN_RULE: number; - FONT_FACE_RULE: number; - CHARSET_RULE: number; - KEYFRAMES_RULE: number; - KEYFRAME_RULE: number; - VIEWPORT_RULE: number; +declare var IDBCursorWithValue: { + prototype: IDBCursorWithValue; + new(): IDBCursorWithValue; } -interface SVGPathSegLinetoAbs extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegLinetoAbs: { - prototype: SVGPathSegLinetoAbs; - new(): SVGPathSegLinetoAbs; +interface IDBDatabase extends EventTarget { + name: string; + objectStoreNames: DOMStringList; + onabort: (ev: Event) => any; + onerror: (ev: Event) => any; + version: string; + close(): void; + createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; + deleteObjectStore(name: string): void; + transaction(storeNames: any, mode?: string): IDBTransaction; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface HTMLModElement extends HTMLElement { - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; - /** - * Sets or retrieves reference information about the object. - */ - cite: string; -} -declare var HTMLModElement: { - prototype: HTMLModElement; - new(): HTMLModElement; +declare var IDBDatabase: { + prototype: IDBDatabase; + new(): IDBDatabase; } -interface SVGMatrix { - e: number; - c: number; - a: number; - b: number; - d: number; - f: number; - multiply(secondMatrix: SVGMatrix): SVGMatrix; - flipY(): SVGMatrix; - skewY(angle: number): SVGMatrix; - inverse(): SVGMatrix; - scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix; - rotate(angle: number): SVGMatrix; - flipX(): SVGMatrix; - translate(x: number, y: number): SVGMatrix; - scale(scaleFactor: number): SVGMatrix; - rotateFromVector(x: number, y: number): SVGMatrix; - skewX(angle: number): SVGMatrix; -} -declare var SVGMatrix: { - prototype: SVGMatrix; - new(): SVGMatrix; +interface IDBFactory { + cmp(first: any, second: any): number; + deleteDatabase(name: string): IDBOpenDBRequest; + open(name: string, version?: number): IDBOpenDBRequest; } -interface MSPopupWindow { - document: Document; - isOpen: boolean; - show(x: number, y: number, w: number, h: number, element?: any): void; - hide(): void; -} -declare var MSPopupWindow: { - prototype: MSPopupWindow; - new(): MSPopupWindow; +declare var IDBFactory: { + prototype: IDBFactory; + new(): IDBFactory; } -interface BeforeUnloadEvent extends Event { - returnValue: string; -} -declare var BeforeUnloadEvent: { - prototype: BeforeUnloadEvent; - new(): BeforeUnloadEvent; +interface IDBIndex { + keyPath: string; + name: string; + objectStore: IDBObjectStore; + unique: boolean; + count(key?: any): IDBRequest; + get(key: any): IDBRequest; + getKey(key: any): IDBRequest; + openCursor(range?: IDBKeyRange, direction?: string): IDBRequest; + openKeyCursor(range?: IDBKeyRange, direction?: string): IDBRequest; } -interface SVGUseElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - animatedInstanceRoot: SVGElementInstance; - instanceRoot: SVGElementInstance; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGUseElement: { - prototype: SVGUseElement; - new(): SVGUseElement; +declare var IDBIndex: { + prototype: IDBIndex; + new(): IDBIndex; } -interface Event { - timeStamp: number; - defaultPrevented: boolean; - isTrusted: boolean; - currentTarget: EventTarget; - cancelBubble: boolean; - target: EventTarget; - eventPhase: number; - cancelable: boolean; - type: string; - srcElement: Element; - bubbles: boolean; - initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; - stopPropagation(): void; - stopImmediatePropagation(): void; - preventDefault(): void; - CAPTURING_PHASE: number; - AT_TARGET: number; - BUBBLING_PHASE: number; +interface IDBKeyRange { + lower: any; + lowerOpen: boolean; + upper: any; + upperOpen: boolean; } -declare var Event: { - prototype: Event; - new(): Event; - CAPTURING_PHASE: number; - AT_TARGET: number; - BUBBLING_PHASE: number; + +declare var IDBKeyRange: { + prototype: IDBKeyRange; + new(): IDBKeyRange; + bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; + lowerBound(bound: any, open?: boolean): IDBKeyRange; + only(value: any): IDBKeyRange; + upperBound(bound: any, open?: boolean): IDBKeyRange; +} + +interface IDBObjectStore { + indexNames: DOMStringList; + keyPath: string; + name: string; + transaction: IDBTransaction; + add(value: any, key?: any): IDBRequest; + clear(): IDBRequest; + count(key?: any): IDBRequest; + createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; + delete(key: any): IDBRequest; + deleteIndex(indexName: string): void; + get(key: any): IDBRequest; + index(name: string): IDBIndex; + openCursor(range?: any, direction?: string): IDBRequest; + put(value: any, key?: any): IDBRequest; +} + +declare var IDBObjectStore: { + prototype: IDBObjectStore; + new(): IDBObjectStore; +} + +interface IDBOpenDBRequest extends IDBRequest { + onblocked: (ev: Event) => any; + onupgradeneeded: (ev: IDBVersionChangeEvent) => any; + addEventListener(type: "blocked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "upgradeneeded", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBOpenDBRequest: { + prototype: IDBOpenDBRequest; + new(): IDBOpenDBRequest; +} + +interface IDBRequest extends EventTarget { + error: DOMError; + onerror: (ev: Event) => any; + onsuccess: (ev: Event) => any; + readyState: string; + result: any; + source: any; + transaction: IDBTransaction; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBRequest: { + prototype: IDBRequest; + new(): IDBRequest; +} + +interface IDBTransaction extends EventTarget { + db: IDBDatabase; + error: DOMError; + mode: string; + onabort: (ev: Event) => any; + oncomplete: (ev: Event) => any; + onerror: (ev: Event) => any; + abort(): void; + objectStore(name: string): IDBObjectStore; + READ_ONLY: string; + READ_WRITE: string; + VERSION_CHANGE: string; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBTransaction: { + prototype: IDBTransaction; + new(): IDBTransaction; + READ_ONLY: string; + READ_WRITE: string; + VERSION_CHANGE: string; +} + +interface IDBVersionChangeEvent extends Event { + newVersion: number; + oldVersion: number; +} + +declare var IDBVersionChangeEvent: { + prototype: IDBVersionChangeEvent; + new(): IDBVersionChangeEvent; } interface ImageData { - width: number; data: number[]; height: number; + width: number; } + declare var ImageData: { prototype: ImageData; new(): ImageData; } -interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves the width of the object. - */ - width: any; - /** - * Sets or retrieves the alignment of the object relative to the display or table. - */ - align: string; - /** - * Sets or retrieves the number of columns in the group. - */ - span: number; -} -declare var HTMLTableColElement: { - prototype: HTMLTableColElement; - new(): HTMLTableColElement; -} - -interface SVGException { - code: number; - message: string; - name: string; - toString(): string; - SVG_MATRIX_NOT_INVERTABLE: number; - SVG_WRONG_TYPE_ERR: number; - SVG_INVALID_VALUE_ERR: number; -} -declare var SVGException: { - prototype: SVGException; - new(): SVGException; - SVG_MATRIX_NOT_INVERTABLE: number; - SVG_WRONG_TYPE_ERR: number; - SVG_INVALID_VALUE_ERR: number; -} - -interface SVGLinearGradientElement extends SVGGradientElement { - y1: SVGAnimatedLength; - x2: SVGAnimatedLength; - x1: SVGAnimatedLength; - y2: SVGAnimatedLength; -} -declare var SVGLinearGradientElement: { - prototype: SVGLinearGradientElement; - new(): SVGLinearGradientElement; -} - -interface HTMLTableAlignment { - /** - * Sets or retrieves a value that you can use to implement your own ch functionality for the object. - */ - ch: string; - /** - * Sets or retrieves how text and other content are vertically aligned within the object that contains them. - */ - vAlign: string; - /** - * Sets or retrieves a value that you can use to implement your own chOff functionality for the object. - */ - chOff: string; -} - -interface SVGAnimatedEnumeration { - animVal: number; - baseVal: number; -} -declare var SVGAnimatedEnumeration: { - prototype: SVGAnimatedEnumeration; - new(): SVGAnimatedEnumeration; -} - -interface DOML2DeprecatedSizeProperty { - size: number; -} - -interface HTMLUListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { -} -declare var HTMLUListElement: { - prototype: HTMLUListElement; - new(): HTMLUListElement; -} - -interface SVGRectElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - ry: SVGAnimatedLength; - rx: SVGAnimatedLength; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGRectElement: { - prototype: SVGRectElement; - new(): SVGRectElement; -} - -interface ErrorEventHandler { - (event: Event, source: string, fileno: number, columnNumber: number): void; -} - -interface HTMLDivElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} -declare var HTMLDivElement: { - prototype: HTMLDivElement; - new(): HTMLDivElement; -} - -interface DOML2DeprecatedBorderStyle { - border: string; -} - -interface NamedNodeMap { - length: number; - removeNamedItemNS(namespaceURI: string, localName: string): Attr; - item(index: number): Attr; - [index: number]: Attr; - removeNamedItem(name: string): Attr; - getNamedItem(name: string): Attr; - // [name: string]: Attr; - setNamedItem(arg: Attr): Attr; - getNamedItemNS(namespaceURI: string, localName: string): Attr; - setNamedItemNS(arg: Attr): Attr; -} -declare var NamedNodeMap: { - prototype: NamedNodeMap; - new(): NamedNodeMap; -} - -interface MediaList { - length: number; - mediaText: string; - deleteMedium(oldMedium: string): void; - appendMedium(newMedium: string): void; - item(index: number): string; - [index: number]: string; - toString(): string; -} -declare var MediaList: { - prototype: MediaList; - new(): MediaList; -} - -interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegCurvetoQuadraticSmoothAbs: { - prototype: SVGPathSegCurvetoQuadraticSmoothAbs; - new(): SVGPathSegCurvetoQuadraticSmoothAbs; -} - -interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { - y: number; - x2: number; - x: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicSmoothRel: { - prototype: SVGPathSegCurvetoCubicSmoothRel; - new(): SVGPathSegCurvetoCubicSmoothRel; -} - -interface SVGLengthList { - numberOfItems: number; - replaceItem(newItem: SVGLength, index: number): SVGLength; - getItem(index: number): SVGLength; - clear(): void; - appendItem(newItem: SVGLength): SVGLength; - initialize(newItem: SVGLength): SVGLength; - removeItem(index: number): SVGLength; - insertItemBefore(newItem: SVGLength, index: number): SVGLength; -} -declare var SVGLengthList: { - prototype: SVGLengthList; - new(): SVGLengthList; -} - -interface ProcessingInstruction extends Node { - target: string; - data: string; -} -declare var ProcessingInstruction: { - prototype: ProcessingInstruction; - new(): ProcessingInstruction; -} - -interface MSWindowExtensions { - status: string; - onmouseleave: (ev: MouseEvent) => any; - screenLeft: number; - offscreenBuffering: any; - maxConnectionsPerServer: number; - onmouseenter: (ev: MouseEvent) => any; - clipboardData: DataTransfer; - defaultStatus: string; - clientInformation: Navigator; - closed: boolean; - onhelp: (ev: Event) => any; - external: External; - event: MSEventObj; - onfocusout: (ev: FocusEvent) => any; - screenTop: number; - onfocusin: (ev: FocusEvent) => any; - showModelessDialog(url?: string, argument?: any, options?: any): Window; - navigate(url: string): void; - resizeBy(x?: number, y?: number): void; - item(index: any): any; - resizeTo(x?: number, y?: number): void; - createPopup(arguments?: any): MSPopupWindow; - toStaticHTML(html: string): string; - execScript(code: string, language?: string): any; - msWriteProfilerMark(profilerMarkName: string): void; - moveTo(x?: number, y?: number): void; - moveBy(x?: number, y?: number): void; - showHelp(url: string, helpArg?: any, features?: string): void; - captureEvents(): void; - releaseEvents(): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface MSBehaviorUrnsCollection { - length: number; - item(index: number): string; -} -declare var MSBehaviorUrnsCollection: { - prototype: MSBehaviorUrnsCollection; - new(): MSBehaviorUrnsCollection; -} - -interface CSSFontFaceRule extends CSSRule { - style: CSSStyleDeclaration; -} -declare var CSSFontFaceRule: { - prototype: CSSFontFaceRule; - new(): CSSFontFaceRule; -} - -interface DOML2DeprecatedBackgroundStyle { - background: string; -} - -interface TextEvent extends UIEvent { - inputMethod: number; - data: string; - locale: string; - initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void; - DOM_INPUT_METHOD_KEYBOARD: number; - DOM_INPUT_METHOD_DROP: number; - DOM_INPUT_METHOD_IME: number; - DOM_INPUT_METHOD_SCRIPT: number; - DOM_INPUT_METHOD_VOICE: number; - DOM_INPUT_METHOD_UNKNOWN: number; - DOM_INPUT_METHOD_PASTE: number; - DOM_INPUT_METHOD_HANDWRITING: number; - DOM_INPUT_METHOD_OPTION: number; - DOM_INPUT_METHOD_MULTIMODAL: number; -} -declare var TextEvent: { - prototype: TextEvent; - new(): TextEvent; - DOM_INPUT_METHOD_KEYBOARD: number; - DOM_INPUT_METHOD_DROP: number; - DOM_INPUT_METHOD_IME: number; - DOM_INPUT_METHOD_SCRIPT: number; - DOM_INPUT_METHOD_VOICE: number; - DOM_INPUT_METHOD_UNKNOWN: number; - DOM_INPUT_METHOD_PASTE: number; - DOM_INPUT_METHOD_HANDWRITING: number; - DOM_INPUT_METHOD_OPTION: number; - DOM_INPUT_METHOD_MULTIMODAL: number; -} - -interface DocumentFragment extends Node, NodeSelector, MSEventAttachmentTarget, MSNodeExtensions { -} -declare var DocumentFragment: { - prototype: DocumentFragment; - new(): DocumentFragment; -} - -interface SVGPolylineElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGAnimatedPoints, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGPolylineElement: { - prototype: SVGPolylineElement; - new(): SVGPolylineElement; -} - -interface SVGAnimatedPathData { - pathSegList: SVGPathSegList; -} - -interface Position { - timestamp: Date; - coords: Coordinates; -} -declare var Position: { - prototype: Position; - new(): Position; -} - -interface BookmarkCollection { - length: number; - item(index: number): any; - [index: number]: any; -} -declare var BookmarkCollection: { - prototype: BookmarkCollection; - new(): BookmarkCollection; -} - -interface PerformanceMark extends PerformanceEntry { -} -declare var PerformanceMark: { - prototype: PerformanceMark; - new(): PerformanceMark; -} - -interface CSSPageRule extends CSSRule { - pseudoClass: string; - selectorText: string; - selector: string; - style: CSSStyleDeclaration; -} -declare var CSSPageRule: { - prototype: CSSPageRule; - new(): CSSPageRule; -} - -interface HTMLBRElement extends HTMLElement { - /** - * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document. - */ - clear: string; -} -declare var HTMLBRElement: { - prototype: HTMLBRElement; - new(): HTMLBRElement; -} - -interface MSNavigatorExtensions { - userLanguage: string; - plugins: MSPluginsCollection; - cookieEnabled: boolean; - appCodeName: string; - cpuClass: string; - appMinorVersion: string; - connectionSpeed: number; - browserLanguage: string; - mimeTypes: MSMimeTypesCollection; - systemLanguage: string; - language: string; - javaEnabled(): boolean; - taintEnabled(): boolean; -} - -interface HTMLSpanElement extends HTMLElement, MSDataBindingExtensions { -} -declare var HTMLSpanElement: { - prototype: HTMLSpanElement; - new(): HTMLSpanElement; -} - -interface HTMLHeadElement extends HTMLElement { - profile: string; -} -declare var HTMLHeadElement: { - prototype: HTMLHeadElement; - new(): HTMLHeadElement; -} - -interface HTMLHeadingElement extends HTMLElement, DOML2DeprecatedTextFlowControl { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; -} -declare var HTMLHeadingElement: { - prototype: HTMLHeadingElement; - new(): HTMLHeadingElement; -} - -interface HTMLFormElement extends HTMLElement, MSHTMLCollectionExtensions { - /** - * Sets or retrieves the number of objects in a collection. - */ - length: number; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form. - */ - acceptCharset: string; - /** - * Sets or retrieves the encoding type for the form. - */ - enctype: string; - /** - * Retrieves a collection, in source order, of all controls in a given form. - */ - elements: HTMLCollection; - /** - * Sets or retrieves the URL to which the form content is sent for processing. - */ - action: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Sets or retrieves how to send the form data to the server. - */ - method: string; - /** - * Sets or retrieves the MIME encoding for the form. - */ - encoding: string; - /** - * Specifies whether autocomplete is applied to an editable text field. - */ - autocomplete: string; - /** - * Designates a form that is not validated when submitted. - */ - noValidate: boolean; - /** - * Fires when the user resets a form. - */ - reset(): void; - /** - * Retrieves a form object or an object from an elements collection. - * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. - * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. - */ - item(name?: any, index?: any): any; - /** - * Fires when a FORM is about to be submitted. - */ - submit(): void; - /** - * Retrieves a form object or an object from an elements collection. - */ - namedItem(name: string): any; - [name: string]: any; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; -} -declare var HTMLFormElement: { - prototype: HTMLFormElement; - new(): HTMLFormElement; -} - -interface SVGZoomAndPan { - zoomAndPan: number; - SVG_ZOOMANDPAN_MAGNIFY: number; - SVG_ZOOMANDPAN_UNKNOWN: number; - SVG_ZOOMANDPAN_DISABLE: number; -} -declare var SVGZoomAndPan: SVGZoomAndPan; - -interface HTMLMediaElement extends HTMLElement { - /** - * Gets the earliest possible position, in seconds, that the playback can begin. - */ - initialTime: number; - /** - * Gets TimeRanges for the current media resource that has been played. - */ - played: TimeRanges; - /** - * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement. - */ - currentSrc: string; - readyState: any; - /** - * The autobuffer element is not supported by Internet Explorer 9. Use the preload element instead. - */ - autobuffer: boolean; - /** - * Gets or sets a flag to specify whether playback should restart after it completes. - */ - loop: boolean; - /** - * Gets information about whether the playback has ended or not. - */ - ended: boolean; - /** - * Gets a collection of buffered time ranges. - */ - buffered: TimeRanges; - /** - * Returns an object representing the current error state of the audio or video element. - */ - error: MediaError; - /** - * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. - */ - seekable: TimeRanges; - /** - * Gets or sets a value that indicates whether to start playing the media automatically. - */ - autoplay: boolean; - /** - * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player). - */ - controls: boolean; - /** - * Gets or sets the volume level for audio portions of the media element. - */ - volume: number; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - /** - * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource. - */ - playbackRate: number; - /** - * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming. - */ - duration: number; - /** - * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted. - */ - muted: boolean; - /** - * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource. - */ - defaultPlaybackRate: number; - /** - * Gets a flag that specifies whether playback is paused. - */ - paused: boolean; - /** - * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource. - */ - seeking: boolean; - /** - * Gets or sets the current playback position, in seconds. - */ - currentTime: number; - /** - * Gets or sets the current playback position, in seconds. - */ - preload: string; - /** - * Gets the current network activity for the element. - */ - networkState: number; - /** - * Specifies the purpose of the audio or video media, such as background audio or alerts. - */ - msAudioCategory: string; - /** - * Specifies whether or not to enable low-latency playback on the media element. - */ - msRealTime: boolean; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - textTracks: TextTrackList; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Returns an AudioTrackList object with the audio tracks for a given video element. - */ - audioTracks: AudioTrackList; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; - /** - * Specifies the output device id that the audio will be sent to. - */ - msAudioDeviceType: string; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - onmsneedkey: (ev: MSMediaKeyNeededEvent) => any; - /** - * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element. - */ - msKeys: MSMediaKeys; - msGraphicsTrustStatus: MSGraphicsTrust; - /** - * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not. - */ - pause(): void; - /** - * Loads and starts playback of a media resource. - */ - play(): void; - /** - * Fires immediately after the client loads the object. - */ - load(): void; - /** - * Returns a string that specifies whether the client can play a given media resource type. - */ - canPlayType(type: string): string; - /** - * Clears all effects from the media pipeline. - */ - msClearEffects(): void; - /** - * Specifies the media protection manager for a given media pipeline. - */ - msSetMediaProtectionManager(mediaProtectionManager?: any): void; - /** - * Inserts the specified audio effect into media pipeline. - */ - msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; - msSetMediaKeys(mediaKeys: MSMediaKeys): void; - addTextTrack(kind: string, label?: string, language?: string): TextTrack; - HAVE_METADATA: number; - HAVE_CURRENT_DATA: number; - HAVE_NOTHING: number; - NETWORK_NO_SOURCE: number; - HAVE_ENOUGH_DATA: number; - NETWORK_EMPTY: number; - NETWORK_LOADING: number; - NETWORK_IDLE: number; - HAVE_FUTURE_DATA: number; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLMediaElement: { - prototype: HTMLMediaElement; - new(): HTMLMediaElement; - HAVE_METADATA: number; - HAVE_CURRENT_DATA: number; - HAVE_NOTHING: number; - NETWORK_NO_SOURCE: number; - HAVE_ENOUGH_DATA: number; - NETWORK_EMPTY: number; - NETWORK_LOADING: number; - NETWORK_IDLE: number; - HAVE_FUTURE_DATA: number; -} - -interface ElementCSSInlineStyle { - runtimeStyle: MSStyleCSSProperties; - currentStyle: MSCurrentStyleCSSProperties; - doScroll(component?: any): void; - componentFromPoint(x: number, y: number): string; -} - -interface DOMParser { - parseFromString(source: string, mimeType: string): Document; -} -declare var DOMParser: { - prototype: DOMParser; - new(): DOMParser; -} - -interface MSMimeTypesCollection { - length: number; -} -declare var MSMimeTypesCollection: { - prototype: MSMimeTypesCollection; - new(): MSMimeTypesCollection; -} - -interface StyleSheet { - disabled: boolean; - ownerNode: Node; - parentStyleSheet: StyleSheet; - href: string; - media: MediaList; - type: string; - title: string; -} -declare var StyleSheet: { - prototype: StyleSheet; - new(): StyleSheet; -} - -interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { - startOffset: SVGAnimatedLength; - method: SVGAnimatedEnumeration; - spacing: SVGAnimatedEnumeration; - TEXTPATH_SPACINGTYPE_EXACT: number; - TEXTPATH_METHODTYPE_STRETCH: number; - TEXTPATH_SPACINGTYPE_AUTO: number; - TEXTPATH_SPACINGTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_ALIGN: number; -} -declare var SVGTextPathElement: { - prototype: SVGTextPathElement; - new(): SVGTextPathElement; - TEXTPATH_SPACINGTYPE_EXACT: number; - TEXTPATH_METHODTYPE_STRETCH: number; - TEXTPATH_SPACINGTYPE_AUTO: number; - TEXTPATH_SPACINGTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_ALIGN: number; -} - -interface HTMLDTElement extends HTMLElement { - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} -declare var HTMLDTElement: { - prototype: HTMLDTElement; - new(): HTMLDTElement; -} - -interface NodeList { - length: number; - item(index: number): Node; - [index: number]: Node; -} -declare var NodeList: { - prototype: NodeList; - new(): NodeList; -} - -interface XMLSerializer { - serializeToString(target: Node): string; -} -declare var XMLSerializer: { - prototype: XMLSerializer; - new(): XMLSerializer; -} - -interface PerformanceMeasure extends PerformanceEntry { -} -declare var PerformanceMeasure: { - prototype: PerformanceMeasure; - new(): PerformanceMeasure; -} - -interface SVGGradientElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGExternalResourcesRequired, SVGURIReference { - spreadMethod: SVGAnimatedEnumeration; - gradientTransform: SVGAnimatedTransformList; - gradientUnits: SVGAnimatedEnumeration; - SVG_SPREADMETHOD_REFLECT: number; - SVG_SPREADMETHOD_PAD: number; - SVG_SPREADMETHOD_UNKNOWN: number; - SVG_SPREADMETHOD_REPEAT: number; -} -declare var SVGGradientElement: { - prototype: SVGGradientElement; - new(): SVGGradientElement; - SVG_SPREADMETHOD_REFLECT: number; - SVG_SPREADMETHOD_PAD: number; - SVG_SPREADMETHOD_UNKNOWN: number; - SVG_SPREADMETHOD_REPEAT: number; -} - -interface NodeFilter { - acceptNode(n: Node): number; - SHOW_ENTITY_REFERENCE: number; - SHOW_NOTATION: number; - SHOW_ENTITY: number; - SHOW_DOCUMENT: number; - SHOW_PROCESSING_INSTRUCTION: number; - FILTER_REJECT: number; - SHOW_CDATA_SECTION: number; - FILTER_ACCEPT: number; - SHOW_ALL: number; - SHOW_DOCUMENT_TYPE: number; - SHOW_TEXT: number; - SHOW_ELEMENT: number; - SHOW_COMMENT: number; - FILTER_SKIP: number; - SHOW_ATTRIBUTE: number; - SHOW_DOCUMENT_FRAGMENT: number; -} -declare var NodeFilter: NodeFilter; - -interface SVGNumberList { - numberOfItems: number; - replaceItem(newItem: SVGNumber, index: number): SVGNumber; - getItem(index: number): SVGNumber; - clear(): void; - appendItem(newItem: SVGNumber): SVGNumber; - initialize(newItem: SVGNumber): SVGNumber; - removeItem(index: number): SVGNumber; - insertItemBefore(newItem: SVGNumber, index: number): SVGNumber; -} -declare var SVGNumberList: { - prototype: SVGNumberList; - new(): SVGNumberList; -} - -interface MediaError { - code: number; - msExtendedCode: number; - MEDIA_ERR_ABORTED: number; - MEDIA_ERR_NETWORK: number; - MEDIA_ERR_SRC_NOT_SUPPORTED: number; - MEDIA_ERR_DECODE: number; - MS_MEDIA_ERR_ENCRYPTED: number; -} -declare var MediaError: { - prototype: MediaError; - new(): MediaError; - MEDIA_ERR_ABORTED: number; - MEDIA_ERR_NETWORK: number; - MEDIA_ERR_SRC_NOT_SUPPORTED: number; - MEDIA_ERR_DECODE: number; - MS_MEDIA_ERR_ENCRYPTED: number; -} - -interface HTMLFieldSetElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLFieldSetElement: { - prototype: HTMLFieldSetElement; - new(): HTMLFieldSetElement; -} - -interface HTMLBGSoundElement extends HTMLElement { - /** - * Sets or gets the value indicating how the volume of the background sound is divided between the left speaker and the right speaker. - */ - balance: any; - /** - * Sets or gets the volume setting for the sound. - */ - volume: any; - /** - * Sets or gets the URL of a sound to play. - */ - src: string; - /** - * Sets or retrieves the number of times a sound or video clip will loop when activated. - */ - loop: number; -} -declare var HTMLBGSoundElement: { - prototype: HTMLBGSoundElement; - new(): HTMLBGSoundElement; -} - -interface Comment extends CharacterData { - text: string; -} -declare var Comment: { - prototype: Comment; - new(): Comment; -} - -interface PerformanceResourceTiming extends PerformanceEntry { - redirectStart: number; - redirectEnd: number; - domainLookupEnd: number; - responseStart: number; - domainLookupStart: number; - fetchStart: number; - requestStart: number; - connectEnd: number; - connectStart: number; - initiatorType: string; - responseEnd: number; -} -declare var PerformanceResourceTiming: { - prototype: PerformanceResourceTiming; - new(): PerformanceResourceTiming; -} - -interface CanvasPattern { -} -declare var CanvasPattern: { - prototype: CanvasPattern; - new(): CanvasPattern; -} - -interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { - /** - * Sets or retrieves the width of the object. - */ - width: number; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves whether the horizontal rule is drawn with 3-D shading. - */ - noShade: boolean; -} -declare var HTMLHRElement: { - prototype: HTMLHRElement; - new(): HTMLHRElement; -} - -interface HTMLObjectElement extends HTMLElement, GetSVGDocument, DOML2DeprecatedMarginStyle, DOML2DeprecatedBorderStyle, DOML2DeprecatedAlignmentStyle, MSDataBindingExtensions, MSDataBindingRecordSetExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Sets or retrieves the Internet media type for the code associated with the object. - */ - codeType: string; - /** - * Retrieves the contained object. - */ - object: any; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the URL of the file containing the compiled Java class. - */ - code: string; - /** - * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. - */ - archive: string; - /** - * Sets or retrieves a message to be displayed while an object is loading. - */ - standby: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves the class identifier for the object. - */ - classid: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Sets or retrieves the URL that references the data of the object. - */ - data: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Retrieves the document object of the page or frame. - */ - contentDocument: Document; - /** - * Gets or sets the optional alternative HTML script to execute if the object fails to load. - */ - altHtml: string; - /** - * Sets or retrieves the URL of the component. - */ - codeBase: string; - declare: boolean; - /** - * Sets or retrieves the MIME type of the object. - */ - type: string; - /** - * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. - */ - BaseHref: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - readyState: number; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLObjectElement: { - prototype: HTMLObjectElement; - new(): HTMLObjectElement; -} - -interface HTMLEmbedElement extends HTMLElement, GetSVGDocument { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Retrieves the palette used for the embedded document. - */ - palette: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - hidden: string; - /** - * Retrieves the URL of the plug-in used to view an embedded document. - */ - pluginspage: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Sets or retrieves the height and width units of the embed object. - */ - units: string; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - readyState: string; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; -} -declare var HTMLEmbedElement: { - prototype: HTMLEmbedElement; - new(): HTMLEmbedElement; -} - -interface StorageEvent extends Event { - oldValue: any; - newValue: any; - url: string; - storageArea: Storage; +interface KeyboardEvent extends UIEvent { + altKey: boolean; + char: string; + charCode: number; + ctrlKey: boolean; key: string; - initStorageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, keyArg: string, oldValueArg: any, newValueArg: any, urlArg: string, storageAreaArg: Storage): void; -} -declare var StorageEvent: { - prototype: StorageEvent; - new(): StorageEvent; + keyCode: number; + locale: string; + location: number; + metaKey: boolean; + repeat: boolean; + shiftKey: boolean; + which: number; + getModifierState(keyArg: string): boolean; + initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; + DOM_KEY_LOCATION_JOYSTICK: number; + DOM_KEY_LOCATION_LEFT: number; + DOM_KEY_LOCATION_MOBILE: number; + DOM_KEY_LOCATION_NUMPAD: number; + DOM_KEY_LOCATION_RIGHT: number; + DOM_KEY_LOCATION_STANDARD: number; } -interface CharacterData extends Node { - length: number; - data: string; - deleteData(offset: number, count: number): void; - replaceData(offset: number, count: number, arg: string): void; - appendData(arg: string): void; - insertData(offset: number, arg: string): void; - substringData(offset: number, count: number): string; -} -declare var CharacterData: { - prototype: CharacterData; - new(): CharacterData; +declare var KeyboardEvent: { + prototype: KeyboardEvent; + new(typeArg: string, eventInitDict?: KeyboardEventInit): KeyboardEvent; + DOM_KEY_LOCATION_JOYSTICK: number; + DOM_KEY_LOCATION_LEFT: number; + DOM_KEY_LOCATION_MOBILE: number; + DOM_KEY_LOCATION_NUMPAD: number; + DOM_KEY_LOCATION_RIGHT: number; + DOM_KEY_LOCATION_STANDARD: number; } -interface HTMLOptGroupElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the ordinal position of an option in a list box. - */ - index: number; - /** - * Sets or retrieves the status of an option. - */ - defaultSelected: boolean; - /** - * Sets or retrieves the text string specified by the option tag. - */ - text: string; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves a value that you can use to implement your own label functionality for the object. - */ - label: string; - /** - * Sets or retrieves whether the option in the list box is the default item. - */ - selected: boolean; -} -declare var HTMLOptGroupElement: { - prototype: HTMLOptGroupElement; - new(): HTMLOptGroupElement; -} - -interface HTMLIsIndexElement extends HTMLElement { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the URL to which the form content is sent for processing. - */ - action: string; - prompt: string; -} -declare var HTMLIsIndexElement: { - prototype: HTMLIsIndexElement; - new(): HTMLIsIndexElement; -} - -interface SVGPathSegLinetoRel extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegLinetoRel: { - prototype: SVGPathSegLinetoRel; - new(): SVGPathSegLinetoRel; -} - -interface DOMException { - code: number; - message: string; - name: string; +interface Location { + hash: string; + host: string; + hostname: string; + href: string; + origin: string; + pathname: string; + port: string; + protocol: string; + search: string; + assign(url: string): void; + reload(forcedReload?: boolean): void; + replace(url: string): void; toString(): string; - HIERARCHY_REQUEST_ERR: number; - NO_MODIFICATION_ALLOWED_ERR: number; - INVALID_MODIFICATION_ERR: number; - NAMESPACE_ERR: number; - INVALID_CHARACTER_ERR: number; - TYPE_MISMATCH_ERR: number; - ABORT_ERR: number; - INVALID_STATE_ERR: number; - SECURITY_ERR: number; - NETWORK_ERR: number; - WRONG_DOCUMENT_ERR: number; - QUOTA_EXCEEDED_ERR: number; - INDEX_SIZE_ERR: number; - DOMSTRING_SIZE_ERR: number; - SYNTAX_ERR: number; - SERIALIZE_ERR: number; - VALIDATION_ERR: number; - NOT_FOUND_ERR: number; - URL_MISMATCH_ERR: number; - PARSE_ERR: number; - NO_DATA_ALLOWED_ERR: number; - NOT_SUPPORTED_ERR: number; - INVALID_ACCESS_ERR: number; - INUSE_ATTRIBUTE_ERR: number; - INVALID_NODE_TYPE_ERR: number; - DATA_CLONE_ERR: number; - TIMEOUT_ERR: number; -} -declare var DOMException: { - prototype: DOMException; - new(): DOMException; - HIERARCHY_REQUEST_ERR: number; - NO_MODIFICATION_ALLOWED_ERR: number; - INVALID_MODIFICATION_ERR: number; - NAMESPACE_ERR: number; - INVALID_CHARACTER_ERR: number; - TYPE_MISMATCH_ERR: number; - ABORT_ERR: number; - INVALID_STATE_ERR: number; - SECURITY_ERR: number; - NETWORK_ERR: number; - WRONG_DOCUMENT_ERR: number; - QUOTA_EXCEEDED_ERR: number; - INDEX_SIZE_ERR: number; - DOMSTRING_SIZE_ERR: number; - SYNTAX_ERR: number; - SERIALIZE_ERR: number; - VALIDATION_ERR: number; - NOT_FOUND_ERR: number; - URL_MISMATCH_ERR: number; - PARSE_ERR: number; - NO_DATA_ALLOWED_ERR: number; - NOT_SUPPORTED_ERR: number; - INVALID_ACCESS_ERR: number; - INUSE_ATTRIBUTE_ERR: number; - INVALID_NODE_TYPE_ERR: number; - DATA_CLONE_ERR: number; - TIMEOUT_ERR: number; } -interface SVGAnimatedBoolean { - animVal: boolean; - baseVal: boolean; -} -declare var SVGAnimatedBoolean: { - prototype: SVGAnimatedBoolean; - new(): SVGAnimatedBoolean; +declare var Location: { + prototype: Location; + new(): Location; } -interface MSCompatibleInfoCollection { - length: number; - item(index: number): MSCompatibleInfo; -} -declare var MSCompatibleInfoCollection: { - prototype: MSCompatibleInfoCollection; - new(): MSCompatibleInfoCollection; +interface LongRunningScriptDetectedEvent extends Event { + executionTime: number; + stopPageScriptExecution: boolean; } -interface SVGSwitchElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGSwitchElement: { - prototype: SVGSwitchElement; - new(): SVGSwitchElement; +declare var LongRunningScriptDetectedEvent: { + prototype: LongRunningScriptDetectedEvent; + new(): LongRunningScriptDetectedEvent; } -interface SVGPreserveAspectRatio { - align: number; - meetOrSlice: number; - SVG_PRESERVEASPECTRATIO_NONE: number; - SVG_PRESERVEASPECTRATIO_XMINYMID: number; - SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - SVG_MEETORSLICE_UNKNOWN: number; - SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - SVG_PRESERVEASPECTRATIO_XMINYMIN: number; - SVG_MEETORSLICE_MEET: number; - SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - SVG_MEETORSLICE_SLICE: number; - SVG_PRESERVEASPECTRATIO_UNKNOWN: number; -} -declare var SVGPreserveAspectRatio: { - prototype: SVGPreserveAspectRatio; - new(): SVGPreserveAspectRatio; - SVG_PRESERVEASPECTRATIO_NONE: number; - SVG_PRESERVEASPECTRATIO_XMINYMID: number; - SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - SVG_MEETORSLICE_UNKNOWN: number; - SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - SVG_PRESERVEASPECTRATIO_XMINYMIN: number; - SVG_MEETORSLICE_MEET: number; - SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - SVG_MEETORSLICE_SLICE: number; - SVG_PRESERVEASPECTRATIO_UNKNOWN: number; +interface MSApp { + clearTemporaryWebDataAsync(): MSAppAsyncOperation; + createBlobFromRandomAccessStream(type: string, seeker: any): Blob; + createDataPackage(object: any): any; + createDataPackageFromSelection(): any; + createFileFromStorageFile(storageFile: any): File; + createStreamFromInputStream(type: string, inputStream: any): MSStream; + execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; + execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; + getCurrentPriority(): string; + getHtmlPrintDocumentSourceAsync(htmlDoc: any): any; + getViewId(view: any): any; + isTaskScheduledAtPriorityOrHigher(priority: string): boolean; + pageHandlesAllApplicationActivations(enabled: boolean): void; + suppressSubdownloadCredentialPrompts(suppress: boolean): void; + terminateApp(exceptionObject: any): void; + CURRENT: string; + HIGH: string; + IDLE: string; + NORMAL: string; } +declare var MSApp: MSApp; -interface Attr extends Node { - expando: boolean; - specified: boolean; - ownerElement: Element; - value: string; - name: string; -} -declare var Attr: { - prototype: Attr; - new(): Attr; -} - -interface PerformanceNavigation { - redirectCount: number; - type: number; - toJSON(): any; - TYPE_RELOAD: number; - TYPE_RESERVED: number; - TYPE_BACK_FORWARD: number; - TYPE_NAVIGATE: number; -} -declare var PerformanceNavigation: { - prototype: PerformanceNavigation; - new(): PerformanceNavigation; - TYPE_RELOAD: number; - TYPE_RESERVED: number; - TYPE_BACK_FORWARD: number; - TYPE_NAVIGATE: number; -} - -interface SVGStopElement extends SVGElement, SVGStylable { - offset: SVGAnimatedNumber; -} -declare var SVGStopElement: { - prototype: SVGStopElement; - new(): SVGStopElement; -} - -interface PositionCallback { - (position: Position): void; -} - -interface SVGSymbolElement extends SVGElement, SVGStylable, SVGLangSpace, SVGFitToViewBox, SVGExternalResourcesRequired { -} -declare var SVGSymbolElement: { - prototype: SVGSymbolElement; - new(): SVGSymbolElement; -} - -interface SVGElementInstanceList { - length: number; - item(index: number): SVGElementInstance; -} -declare var SVGElementInstanceList: { - prototype: SVGElementInstanceList; - new(): SVGElementInstanceList; -} - -interface CSSRuleList { - length: number; - item(index: number): CSSRule; - [index: number]: CSSRule; -} -declare var CSSRuleList: { - prototype: CSSRuleList; - new(): CSSRuleList; -} - -interface MSDataBindingRecordSetExtensions { - recordset: any; - namedRecordset(dataMember: string, hierarchy?: any): any; -} - -interface LinkStyle { - styleSheet: StyleSheet; - sheet: StyleSheet; -} - -interface HTMLVideoElement extends HTMLMediaElement { - /** - * Gets or sets the width of the video element. - */ - width: number; - /** - * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known. - */ - videoWidth: number; - /** - * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known. - */ - videoHeight: number; - /** - * Gets or sets the height of the video element. - */ - height: number; - /** - * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available. - */ - poster: string; - msIsStereo3D: boolean; - msStereo3DPackingMode: string; - onMSVideoOptimalLayoutChanged: (ev: any) => any; - onMSVideoFrameStepCompleted: (ev: any) => any; - msStereo3DRenderMode: string; - msIsLayoutOptimalForPlayback: boolean; - msHorizontalMirror: boolean; - onMSVideoFormatChanged: (ev: any) => any; - msZoom: boolean; - msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; - msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void; - msFrameStep(forward: boolean): void; - getVideoPlaybackQuality(): VideoPlaybackQuality; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; +interface MSAppAsyncOperation extends EventTarget { + error: DOMError; + oncomplete: (ev: Event) => any; + onerror: (ev: Event) => any; + readyState: number; + result: any; + start(): void; + COMPLETED: number; + ERROR: number; + STARTED: number; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoOptimalLayoutChanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoFrameStepCompleted", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoFormatChanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLVideoElement: { - prototype: HTMLVideoElement; - new(): HTMLVideoElement; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface ClientRectList { - length: number; - item(index: number): ClientRect; - [index: number]: ClientRect; -} -declare var ClientRectList: { - prototype: ClientRectList; - new(): ClientRectList; +declare var MSAppAsyncOperation: { + prototype: MSAppAsyncOperation; + new(): MSAppAsyncOperation; + COMPLETED: number; + ERROR: number; + STARTED: number; } -interface SVGMaskElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - maskUnits: SVGAnimatedEnumeration; - maskContentUnits: SVGAnimatedEnumeration; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGMaskElement: { - prototype: SVGMaskElement; - new(): SVGMaskElement; +interface MSBlobBuilder { + append(data: any, endings?: string): void; + getBlob(contentType?: string): Blob; } -interface External { -} -declare var External: { - prototype: External; - new(): External; +declare var MSBlobBuilder: { + prototype: MSBlobBuilder; + new(): MSBlobBuilder; } -interface MSGestureEvent extends UIEvent { - offsetY: number; - translationY: number; - velocityExpansion: number; - velocityY: number; - velocityAngular: number; - translationX: number; - velocityX: number; - hwTimestamp: number; - offsetX: number; - screenX: number; - rotation: number; - expansion: number; - clientY: number; - screenY: number; - scale: number; - gestureObject: any; - clientX: number; - initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void; - MSGESTURE_FLAG_BEGIN: number; - MSGESTURE_FLAG_END: number; - MSGESTURE_FLAG_CANCEL: number; - MSGESTURE_FLAG_INERTIA: number; - MSGESTURE_FLAG_NONE: number; -} -declare var MSGestureEvent: { - prototype: MSGestureEvent; - new(): MSGestureEvent; - MSGESTURE_FLAG_BEGIN: number; - MSGESTURE_FLAG_END: number; - MSGESTURE_FLAG_CANCEL: number; - MSGESTURE_FLAG_INERTIA: number; - MSGESTURE_FLAG_NONE: number; +interface MSCSSMatrix { + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + m11: number; + m12: number; + m13: number; + m14: number; + m21: number; + m22: number; + m23: number; + m24: number; + m31: number; + m32: number; + m33: number; + m34: number; + m41: number; + m42: number; + m43: number; + m44: number; + inverse(): MSCSSMatrix; + multiply(secondMatrix: MSCSSMatrix): MSCSSMatrix; + rotate(angleX: number, angleY?: number, angleZ?: number): MSCSSMatrix; + rotateAxisAngle(x: number, y: number, z: number, angle: number): MSCSSMatrix; + scale(scaleX: number, scaleY?: number, scaleZ?: number): MSCSSMatrix; + setMatrixValue(value: string): void; + skewX(angle: number): MSCSSMatrix; + skewY(angle: number): MSCSSMatrix; + toString(): string; + translate(x: number, y: number, z?: number): MSCSSMatrix; } -interface ErrorEvent extends Event { - colno: number; - filename: string; - error: any; - lineno: number; - message: string; - initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; -} -declare var ErrorEvent: { - prototype: ErrorEvent; - new(): ErrorEvent; -} - -interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - filterResX: SVGAnimatedInteger; - filterUnits: SVGAnimatedEnumeration; - primitiveUnits: SVGAnimatedEnumeration; - x: SVGAnimatedLength; - height: SVGAnimatedLength; - filterResY: SVGAnimatedInteger; - setFilterRes(filterResX: number, filterResY: number): void; -} -declare var SVGFilterElement: { - prototype: SVGFilterElement; - new(): SVGFilterElement; -} - -interface TrackEvent extends Event { - track: any; -} -declare var TrackEvent: { - prototype: TrackEvent; - new(): TrackEvent; -} - -interface SVGFEMergeNodeElement extends SVGElement { - in1: SVGAnimatedString; -} -declare var SVGFEMergeNodeElement: { - prototype: SVGFEMergeNodeElement; - new(): SVGFEMergeNodeElement; -} - -interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { -} -declare var SVGFEFloodElement: { - prototype: SVGFEFloodElement; - new(): SVGFEFloodElement; +declare var MSCSSMatrix: { + prototype: MSCSSMatrix; + new(text?: string): MSCSSMatrix; } interface MSGesture { @@ -10014,118 +9547,472 @@ interface MSGesture { addPointer(pointerId: number): void; stop(): void; } + declare var MSGesture: { prototype: MSGesture; new(): MSGesture; } -interface TextTrackCue extends EventTarget { - onenter: (ev: Event) => any; - track: TextTrack; - endTime: number; - text: string; - pauseOnExit: boolean; - id: string; - startTime: number; - onexit: (ev: Event) => any; - getCueAsHTML(): DocumentFragment; - addEventListener(type: "enter", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "exit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var TextTrackCue: { - prototype: TextTrackCue; - new(startTime: number, endTime: number, text: string): TextTrackCue; +interface MSGestureEvent extends UIEvent { + clientX: number; + clientY: number; + expansion: number; + gestureObject: any; + hwTimestamp: number; + offsetX: number; + offsetY: number; + rotation: number; + scale: number; + screenX: number; + screenY: number; + translationX: number; + translationY: number; + velocityAngular: number; + velocityExpansion: number; + velocityX: number; + velocityY: number; + initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void; + MSGESTURE_FLAG_BEGIN: number; + MSGESTURE_FLAG_CANCEL: number; + MSGESTURE_FLAG_END: number; + MSGESTURE_FLAG_INERTIA: number; + MSGESTURE_FLAG_NONE: number; } -interface MSStreamReader extends MSBaseReader { +declare var MSGestureEvent: { + prototype: MSGestureEvent; + new(): MSGestureEvent; + MSGESTURE_FLAG_BEGIN: number; + MSGESTURE_FLAG_CANCEL: number; + MSGESTURE_FLAG_END: number; + MSGESTURE_FLAG_INERTIA: number; + MSGESTURE_FLAG_NONE: number; +} + +interface MSGraphicsTrust { + constrictionActive: boolean; + status: string; +} + +declare var MSGraphicsTrust: { + prototype: MSGraphicsTrust; + new(): MSGraphicsTrust; +} + +interface MSHTMLWebViewElement extends HTMLElement { + canGoBack: boolean; + canGoForward: boolean; + containsFullScreenElement: boolean; + documentTitle: string; + height: number; + settings: MSWebViewSettings; + src: string; + width: number; + addWebAllowedObject(name: string, applicationObject: any): void; + buildLocalStreamUri(contentIdentifier: string, relativePath: string): string; + capturePreviewToBlobAsync(): MSWebViewAsyncOperation; + captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation; + getDeferredPermissionRequestById(id: number): DeferredPermissionRequest; + getDeferredPermissionRequests(): DeferredPermissionRequest[]; + goBack(): void; + goForward(): void; + invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation; + navigate(uri: string): void; + navigateToLocalStreamUri(source: string, streamResolver: any): void; + navigateToString(contents: string): void; + navigateWithHttpRequestMessage(requestMessage: any): void; + refresh(): void; + stop(): void; +} + +declare var MSHTMLWebViewElement: { + prototype: MSHTMLWebViewElement; + new(): MSHTMLWebViewElement; +} + +interface MSHeaderFooter { + URL: string; + dateLong: string; + dateShort: string; + font: string; + htmlFoot: string; + htmlHead: string; + page: number; + pageTotal: number; + textFoot: string; + textHead: string; + timeLong: string; + timeShort: string; + title: string; +} + +declare var MSHeaderFooter: { + prototype: MSHeaderFooter; + new(): MSHeaderFooter; +} + +interface MSInputMethodContext extends EventTarget { + compositionEndOffset: number; + compositionStartOffset: number; + oncandidatewindowhide: (ev: Event) => any; + oncandidatewindowshow: (ev: Event) => any; + oncandidatewindowupdate: (ev: Event) => any; + target: HTMLElement; + getCandidateWindowClientRect(): ClientRect; + getCompositionAlternatives(): string[]; + hasComposition(): boolean; + isCandidateWindowVisible(): boolean; + addEventListener(type: "MSCandidateWindowHide", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "MSCandidateWindowShow", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "MSCandidateWindowUpdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSInputMethodContext: { + prototype: MSInputMethodContext; + new(): MSInputMethodContext; +} + +interface MSManipulationEvent extends UIEvent { + currentState: number; + inertiaDestinationX: number; + inertiaDestinationY: number; + lastState: number; + initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void; + MS_MANIPULATION_STATE_ACTIVE: number; + MS_MANIPULATION_STATE_CANCELLED: number; + MS_MANIPULATION_STATE_COMMITTED: number; + MS_MANIPULATION_STATE_DRAGGING: number; + MS_MANIPULATION_STATE_INERTIA: number; + MS_MANIPULATION_STATE_PRESELECT: number; + MS_MANIPULATION_STATE_SELECTING: number; + MS_MANIPULATION_STATE_STOPPED: number; +} + +declare var MSManipulationEvent: { + prototype: MSManipulationEvent; + new(): MSManipulationEvent; + MS_MANIPULATION_STATE_ACTIVE: number; + MS_MANIPULATION_STATE_CANCELLED: number; + MS_MANIPULATION_STATE_COMMITTED: number; + MS_MANIPULATION_STATE_DRAGGING: number; + MS_MANIPULATION_STATE_INERTIA: number; + MS_MANIPULATION_STATE_PRESELECT: number; + MS_MANIPULATION_STATE_SELECTING: number; + MS_MANIPULATION_STATE_STOPPED: number; +} + +interface MSMediaKeyError { + code: number; + systemCode: number; + MS_MEDIA_KEYERR_CLIENT: number; + MS_MEDIA_KEYERR_DOMAIN: number; + MS_MEDIA_KEYERR_HARDWARECHANGE: number; + MS_MEDIA_KEYERR_OUTPUT: number; + MS_MEDIA_KEYERR_SERVICE: number; + MS_MEDIA_KEYERR_UNKNOWN: number; +} + +declare var MSMediaKeyError: { + prototype: MSMediaKeyError; + new(): MSMediaKeyError; + MS_MEDIA_KEYERR_CLIENT: number; + MS_MEDIA_KEYERR_DOMAIN: number; + MS_MEDIA_KEYERR_HARDWARECHANGE: number; + MS_MEDIA_KEYERR_OUTPUT: number; + MS_MEDIA_KEYERR_SERVICE: number; + MS_MEDIA_KEYERR_UNKNOWN: number; +} + +interface MSMediaKeyMessageEvent extends Event { + destinationURL: string; + message: Uint8Array; +} + +declare var MSMediaKeyMessageEvent: { + prototype: MSMediaKeyMessageEvent; + new(): MSMediaKeyMessageEvent; +} + +interface MSMediaKeyNeededEvent extends Event { + initData: Uint8Array; +} + +declare var MSMediaKeyNeededEvent: { + prototype: MSMediaKeyNeededEvent; + new(): MSMediaKeyNeededEvent; +} + +interface MSMediaKeySession extends EventTarget { + error: MSMediaKeyError; + keySystem: string; + sessionId: string; + close(): void; + update(key: Uint8Array): void; +} + +declare var MSMediaKeySession: { + prototype: MSMediaKeySession; + new(): MSMediaKeySession; +} + +interface MSMediaKeys { + keySystem: string; + createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession; +} + +declare var MSMediaKeys: { + prototype: MSMediaKeys; + new(keySystem: string): MSMediaKeys; + isTypeSupported(keySystem: string, type?: string): boolean; +} + +interface MSMimeTypesCollection { + length: number; +} + +declare var MSMimeTypesCollection: { + prototype: MSMimeTypesCollection; + new(): MSMimeTypesCollection; +} + +interface MSPluginsCollection { + length: number; + refresh(reload?: boolean): void; +} + +declare var MSPluginsCollection: { + prototype: MSPluginsCollection; + new(): MSPluginsCollection; +} + +interface MSPointerEvent extends MouseEvent { + currentPoint: any; + height: number; + hwTimestamp: number; + intermediatePoints: any; + isPrimary: boolean; + pointerId: number; + pointerType: any; + pressure: number; + rotation: number; + tiltX: number; + tiltY: number; + width: number; + getCurrentPoint(element: Element): void; + getIntermediatePoints(element: Element): void; + initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; +} + +declare var MSPointerEvent: { + prototype: MSPointerEvent; + new(typeArg: string, eventInitDict?: PointerEventInit): MSPointerEvent; +} + +interface MSPrintManagerTemplatePrinter extends MSTemplatePrinter, EventTarget { + percentScale: number; + showHeaderFooter: boolean; + shrinkToFit: boolean; + drawPreviewPage(element: HTMLElement, pageNumber: number): void; + endPrint(): void; + getPrintTaskOptionValue(key: string): any; + invalidatePreview(): void; + setPageCount(pageCount: number): void; + startPrint(): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSPrintManagerTemplatePrinter: { + prototype: MSPrintManagerTemplatePrinter; + new(): MSPrintManagerTemplatePrinter; +} + +interface MSRangeCollection { + length: number; + item(index: number): Range; + [index: number]: Range; +} + +declare var MSRangeCollection: { + prototype: MSRangeCollection; + new(): MSRangeCollection; +} + +interface MSSiteModeEvent extends Event { + actionURL: string; + buttonID: number; +} + +declare var MSSiteModeEvent: { + prototype: MSSiteModeEvent; + new(): MSSiteModeEvent; +} + +interface MSStream { + type: string; + msClose(): void; + msDetachStream(): any; +} + +declare var MSStream: { + prototype: MSStream; + new(): MSStream; +} + +interface MSStreamReader extends EventTarget, MSBaseReader { error: DOMError; readAsArrayBuffer(stream: MSStream, size?: number): void; + readAsBinaryString(stream: MSStream, size?: number): void; readAsBlob(stream: MSStream, size?: number): void; readAsDataURL(stream: MSStream, size?: number): void; readAsText(stream: MSStream, encoding?: string, size?: number): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var MSStreamReader: { prototype: MSStreamReader; new(): MSStreamReader; } -interface DOMTokenList { +interface MSTemplatePrinter { + collate: boolean; + copies: number; + currentPage: boolean; + currentPageAvail: boolean; + duplex: boolean; + footer: string; + frameActive: boolean; + frameActiveEnabled: boolean; + frameAsShown: boolean; + framesetDocument: boolean; + header: string; + headerFooterFont: string; + marginBottom: number; + marginLeft: number; + marginRight: number; + marginTop: number; + orientation: string; + pageFrom: number; + pageHeight: number; + pageTo: number; + pageWidth: number; + selectedPages: boolean; + selection: boolean; + selectionEnabled: boolean; + unprintableBottom: number; + unprintableLeft: number; + unprintableRight: number; + unprintableTop: number; + usePrinterCopyCollate: boolean; + createHeaderFooter(): MSHeaderFooter; + deviceSupports(property: string): any; + ensurePrintDialogDefaults(): boolean; + getPageMarginBottom(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; + getPageMarginBottomImportant(pageRule: CSSPageRule): boolean; + getPageMarginLeft(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; + getPageMarginLeftImportant(pageRule: CSSPageRule): boolean; + getPageMarginRight(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; + getPageMarginRightImportant(pageRule: CSSPageRule): boolean; + getPageMarginTop(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; + getPageMarginTopImportant(pageRule: CSSPageRule): boolean; + printBlankPage(): void; + printNonNative(document: any): boolean; + printNonNativeFrames(document: any, activeFrame: boolean): void; + printPage(element: HTMLElement): void; + showPageSetupDialog(): boolean; + showPrintDialog(): boolean; + startDoc(title: string): boolean; + stopDoc(): void; + updatePageStatus(status: number): void; +} + +declare var MSTemplatePrinter: { + prototype: MSTemplatePrinter; + new(): MSTemplatePrinter; +} + +interface MSWebViewAsyncOperation extends EventTarget { + error: DOMError; + oncomplete: (ev: Event) => any; + onerror: (ev: Event) => any; + readyState: number; + result: any; + target: MSHTMLWebViewElement; + type: number; + start(): void; + COMPLETED: number; + ERROR: number; + STARTED: number; + TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; + TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; + TYPE_INVOKE_SCRIPT: number; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSWebViewAsyncOperation: { + prototype: MSWebViewAsyncOperation; + new(): MSWebViewAsyncOperation; + COMPLETED: number; + ERROR: number; + STARTED: number; + TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; + TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; + TYPE_INVOKE_SCRIPT: number; +} + +interface MSWebViewSettings { + isIndexedDBEnabled: boolean; + isJavaScriptEnabled: boolean; +} + +declare var MSWebViewSettings: { + prototype: MSWebViewSettings; + new(): MSWebViewSettings; +} + +interface MediaElementAudioSourceNode extends AudioNode { +} + +declare var MediaElementAudioSourceNode: { + prototype: MediaElementAudioSourceNode; + new(): MediaElementAudioSourceNode; +} + +interface MediaError { + code: number; + msExtendedCode: number; + MEDIA_ERR_ABORTED: number; + MEDIA_ERR_DECODE: number; + MEDIA_ERR_NETWORK: number; + MEDIA_ERR_SRC_NOT_SUPPORTED: number; + MS_MEDIA_ERR_ENCRYPTED: number; +} + +declare var MediaError: { + prototype: MediaError; + new(): MediaError; + MEDIA_ERR_ABORTED: number; + MEDIA_ERR_DECODE: number; + MEDIA_ERR_NETWORK: number; + MEDIA_ERR_SRC_NOT_SUPPORTED: number; + MS_MEDIA_ERR_ENCRYPTED: number; +} + +interface MediaList { length: number; - contains(token: string): boolean; - remove(token: string): void; - toggle(token: string): boolean; - add(token: string): void; + mediaText: string; + appendMedium(newMedium: string): void; + deleteMedium(oldMedium: string): void; item(index: number): string; - [index: number]: string; toString(): string; -} -declare var DOMTokenList: { - prototype: DOMTokenList; - new(): DOMTokenList; + [index: number]: string; } -interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncAElement: { - prototype: SVGFEFuncAElement; - new(): SVGFEFuncAElement; -} - -interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; -} -declare var SVGFETileElement: { - prototype: SVGFETileElement; - new(): SVGFETileElement; -} - -interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in2: SVGAnimatedString; - mode: SVGAnimatedEnumeration; - in1: SVGAnimatedString; - SVG_FEBLEND_MODE_DARKEN: number; - SVG_FEBLEND_MODE_UNKNOWN: number; - SVG_FEBLEND_MODE_MULTIPLY: number; - SVG_FEBLEND_MODE_NORMAL: number; - SVG_FEBLEND_MODE_SCREEN: number; - SVG_FEBLEND_MODE_LIGHTEN: number; -} -declare var SVGFEBlendElement: { - prototype: SVGFEBlendElement; - new(): SVGFEBlendElement; - SVG_FEBLEND_MODE_DARKEN: number; - SVG_FEBLEND_MODE_UNKNOWN: number; - SVG_FEBLEND_MODE_MULTIPLY: number; - SVG_FEBLEND_MODE_NORMAL: number; - SVG_FEBLEND_MODE_SCREEN: number; - SVG_FEBLEND_MODE_LIGHTEN: number; -} - -interface MessageChannel { - port2: MessagePort; - port1: MessagePort; -} -declare var MessageChannel: { - prototype: MessageChannel; - new(): MessageChannel; -} - -interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { -} -declare var SVGFEMergeElement: { - prototype: SVGFEMergeElement; - new(): SVGFEMergeElement; -} - -interface TransitionEvent extends Event { - propertyName: string; - elapsedTime: number; - initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void; -} -declare var TransitionEvent: { - prototype: TransitionEvent; - new(): TransitionEvent; +declare var MediaList: { + prototype: MediaList; + new(): MediaList; } interface MediaQueryList { @@ -10134,734 +10021,49 @@ interface MediaQueryList { addListener(listener: MediaQueryListListener): void; removeListener(listener: MediaQueryListListener): void; } + declare var MediaQueryList: { prototype: MediaQueryList; new(): MediaQueryList; } -interface DOMError { - name: string; - toString(): string; -} -declare var DOMError: { - prototype: DOMError; - new(): DOMError; -} - -interface CloseEvent extends Event { - wasClean: boolean; - reason: string; - code: number; - initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; -} -declare var CloseEvent: { - prototype: CloseEvent; - new(): CloseEvent; -} - -interface WebSocket extends EventTarget { - protocol: string; - readyState: number; - bufferedAmount: number; - onopen: (ev: Event) => any; - extensions: string; - onmessage: (ev: MessageEvent) => any; - onclose: (ev: CloseEvent) => any; - onerror: (ev: ErrorEvent) => any; - binaryType: string; - url: string; - close(code?: number, reason?: string): void; - send(data: any): void; - OPEN: number; - CLOSING: number; - CONNECTING: number; - CLOSED: number; - addEventListener(type: "open", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "close", listener: (ev: CloseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var WebSocket: { - prototype: WebSocket; - new(url: string, protocols?: string): WebSocket; - new(url: string, protocols?: string[]): WebSocket; - OPEN: number; - CLOSING: number; - CONNECTING: number; - CLOSED: number; -} - -interface SVGFEPointLightElement extends SVGElement { - y: SVGAnimatedNumber; - x: SVGAnimatedNumber; - z: SVGAnimatedNumber; -} -declare var SVGFEPointLightElement: { - prototype: SVGFEPointLightElement; - new(): SVGFEPointLightElement; -} - -interface ProgressEvent extends Event { - loaded: number; - lengthComputable: boolean; - total: number; - initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; -} -declare var ProgressEvent: { - prototype: ProgressEvent; - new(): ProgressEvent; -} - -interface IDBObjectStore { - indexNames: DOMStringList; - name: string; - transaction: IDBTransaction; - keyPath: string; - count(key?: any): IDBRequest; - add(value: any, key?: any): IDBRequest; - clear(): IDBRequest; - createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; - put(value: any, key?: any): IDBRequest; - openCursor(range?: any, direction?: string): IDBRequest; - deleteIndex(indexName: string): void; - index(name: string): IDBIndex; - get(key: any): IDBRequest; - delete(key: any): IDBRequest; -} -declare var IDBObjectStore: { - prototype: IDBObjectStore; - new(): IDBObjectStore; -} - -interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - stdDeviationX: SVGAnimatedNumber; - in1: SVGAnimatedString; - stdDeviationY: SVGAnimatedNumber; - setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; -} -declare var SVGFEGaussianBlurElement: { - prototype: SVGFEGaussianBlurElement; - new(): SVGFEGaussianBlurElement; -} - -interface SVGFilterPrimitiveStandardAttributes extends SVGStylable { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - height: SVGAnimatedLength; - result: SVGAnimatedString; -} - -interface IDBVersionChangeEvent extends Event { - newVersion: number; - oldVersion: number; -} -declare var IDBVersionChangeEvent: { - prototype: IDBVersionChangeEvent; - new(): IDBVersionChangeEvent; -} - -interface IDBIndex { - unique: boolean; - name: string; - keyPath: string; - objectStore: IDBObjectStore; - count(key?: any): IDBRequest; - getKey(key: any): IDBRequest; - openKeyCursor(range?: IDBKeyRange, direction?: string): IDBRequest; - get(key: any): IDBRequest; - openCursor(range?: IDBKeyRange, direction?: string): IDBRequest; -} -declare var IDBIndex: { - prototype: IDBIndex; - new(): IDBIndex; -} - -interface FileList { - length: number; - item(index: number): File; - [index: number]: File; -} -declare var FileList: { - prototype: FileList; - new(): FileList; -} - -interface IDBCursor { - source: any; - direction: string; - key: any; - primaryKey: any; - advance(count: number): void; - delete(): IDBRequest; - continue(key?: any): void; - update(value: any): IDBRequest; - PREV: string; - PREV_NO_DUPLICATE: string; - NEXT: string; - NEXT_NO_DUPLICATE: string; -} -declare var IDBCursor: { - prototype: IDBCursor; - new(): IDBCursor; - PREV: string; - PREV_NO_DUPLICATE: string; - NEXT: string; - NEXT_NO_DUPLICATE: string; -} - -interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - kernelUnitLengthY: SVGAnimatedNumber; - surfaceScale: SVGAnimatedNumber; - specularExponent: SVGAnimatedNumber; - in1: SVGAnimatedString; - kernelUnitLengthX: SVGAnimatedNumber; - specularConstant: SVGAnimatedNumber; -} -declare var SVGFESpecularLightingElement: { - prototype: SVGFESpecularLightingElement; - new(): SVGFESpecularLightingElement; -} - -interface File extends Blob { - lastModifiedDate: any; - name: string; -} -declare var File: { - prototype: File; - new(): File; -} - -interface URL { - revokeObjectURL(url: string): void; - createObjectURL(object: any, options?: ObjectURLOptions): string; -} -declare var URL: URL; - -interface IDBCursorWithValue extends IDBCursor { - value: any; -} -declare var IDBCursorWithValue: { - prototype: IDBCursorWithValue; - new(): IDBCursorWithValue; -} - -interface XMLHttpRequestEventTarget extends EventTarget { - onprogress: (ev: ProgressEvent) => any; - onerror: (ev: ErrorEvent) => any; - onload: (ev: Event) => any; - ontimeout: (ev: Event) => any; - onabort: (ev: UIEvent) => any; - onloadstart: (ev: Event) => any; - onloadend: (ev: ProgressEvent) => any; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var XMLHttpRequestEventTarget: { - prototype: XMLHttpRequestEventTarget; - new(): XMLHttpRequestEventTarget; -} - -interface IDBEnvironment { - msIndexedDB: IDBFactory; - indexedDB: IDBFactory; -} - -interface AudioTrackList extends EventTarget { - length: number; - onchange: (ev: Event) => any; - onaddtrack: (ev: TrackEvent) => any; - onremovetrack: (ev: any /*PluginArray*/) => any; - getTrackById(id: string): AudioTrack; - item(index: number): AudioTrack; - [index: number]: AudioTrack; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: "removetrack", listener: (ev: any /*PluginArray*/) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var AudioTrackList: { - prototype: AudioTrackList; - new(): AudioTrackList; -} - -interface MSBaseReader extends EventTarget { - onprogress: (ev: ProgressEvent) => any; - readyState: number; - onabort: (ev: UIEvent) => any; - onloadend: (ev: ProgressEvent) => any; - onerror: (ev: ErrorEvent) => any; - onload: (ev: Event) => any; - onloadstart: (ev: Event) => any; - result: any; - abort(): void; - LOADING: number; - EMPTY: number; - DONE: number; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - operator: SVGAnimatedEnumeration; - radiusX: SVGAnimatedNumber; - radiusY: SVGAnimatedNumber; - in1: SVGAnimatedString; - SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; - SVG_MORPHOLOGY_OPERATOR_ERODE: number; - SVG_MORPHOLOGY_OPERATOR_DILATE: number; -} -declare var SVGFEMorphologyElement: { - prototype: SVGFEMorphologyElement; - new(): SVGFEMorphologyElement; - SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; - SVG_MORPHOLOGY_OPERATOR_ERODE: number; - SVG_MORPHOLOGY_OPERATOR_DILATE: number; -} - -interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncRElement: { - prototype: SVGFEFuncRElement; - new(): SVGFEFuncRElement; -} - -interface WindowTimersExtension { - msSetImmediate(expression: any, ...args: any[]): number; - clearImmediate(handle: number): void; - msClearImmediate(handle: number): void; - setImmediate(expression: any, ...args: any[]): number; -} - -interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in2: SVGAnimatedString; - xChannelSelector: SVGAnimatedEnumeration; - yChannelSelector: SVGAnimatedEnumeration; - scale: SVGAnimatedNumber; - in1: SVGAnimatedString; - SVG_CHANNEL_B: number; - SVG_CHANNEL_R: number; - SVG_CHANNEL_G: number; - SVG_CHANNEL_UNKNOWN: number; - SVG_CHANNEL_A: number; -} -declare var SVGFEDisplacementMapElement: { - prototype: SVGFEDisplacementMapElement; - new(): SVGFEDisplacementMapElement; - SVG_CHANNEL_B: number; - SVG_CHANNEL_R: number; - SVG_CHANNEL_G: number; - SVG_CHANNEL_UNKNOWN: number; - SVG_CHANNEL_A: number; -} - -interface AnimationEvent extends Event { - animationName: string; - elapsedTime: number; - initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void; -} -declare var AnimationEvent: { - prototype: AnimationEvent; - new(): AnimationEvent; -} - -interface SVGComponentTransferFunctionElement extends SVGElement { - tableValues: SVGAnimatedNumberList; - slope: SVGAnimatedNumber; - type: SVGAnimatedEnumeration; - exponent: SVGAnimatedNumber; - amplitude: SVGAnimatedNumber; - intercept: SVGAnimatedNumber; - offset: SVGAnimatedNumber; - SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; - SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; -} -declare var SVGComponentTransferFunctionElement: { - prototype: SVGComponentTransferFunctionElement; - new(): SVGComponentTransferFunctionElement; - SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; - SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; -} - -interface MSRangeCollection { - length: number; - item(index: number): Range; - [index: number]: Range; -} -declare var MSRangeCollection: { - prototype: MSRangeCollection; - new(): MSRangeCollection; -} - -interface SVGFEDistantLightElement extends SVGElement { - azimuth: SVGAnimatedNumber; - elevation: SVGAnimatedNumber; -} -declare var SVGFEDistantLightElement: { - prototype: SVGFEDistantLightElement; - new(): SVGFEDistantLightElement; -} - -interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncBElement: { - prototype: SVGFEFuncBElement; - new(): SVGFEFuncBElement; -} - -interface IDBKeyRange { - upper: any; - upperOpen: boolean; - lower: any; - lowerOpen: boolean; -} -declare var IDBKeyRange: { - prototype: IDBKeyRange; - new(): IDBKeyRange; - bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; - only(value: any): IDBKeyRange; - lowerBound(bound: any, open?: boolean): IDBKeyRange; - upperBound(bound: any, open?: boolean): IDBKeyRange; -} - -interface WindowConsole { - console: Console; -} - -interface IDBTransaction extends EventTarget { - oncomplete: (ev: Event) => any; - db: IDBDatabase; - mode: string; - error: DOMError; - onerror: (ev: ErrorEvent) => any; - onabort: (ev: UIEvent) => any; - abort(): void; - objectStore(name: string): IDBObjectStore; - READ_ONLY: string; - VERSION_CHANGE: string; - READ_WRITE: string; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBTransaction: { - prototype: IDBTransaction; - new(): IDBTransaction; - READ_ONLY: string; - VERSION_CHANGE: string; - READ_WRITE: string; -} - -interface AudioTrack { - kind: string; - language: string; - id: string; - label: string; - enabled: boolean; - sourceBuffer: SourceBuffer; -} -declare var AudioTrack: { - prototype: AudioTrack; - new(): AudioTrack; -} - -interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - orderY: SVGAnimatedInteger; - kernelUnitLengthY: SVGAnimatedNumber; - orderX: SVGAnimatedInteger; - preserveAlpha: SVGAnimatedBoolean; - kernelMatrix: SVGAnimatedNumberList; - edgeMode: SVGAnimatedEnumeration; - kernelUnitLengthX: SVGAnimatedNumber; - bias: SVGAnimatedNumber; - targetX: SVGAnimatedInteger; - targetY: SVGAnimatedInteger; - divisor: SVGAnimatedNumber; - in1: SVGAnimatedString; - SVG_EDGEMODE_WRAP: number; - SVG_EDGEMODE_DUPLICATE: number; - SVG_EDGEMODE_UNKNOWN: number; - SVG_EDGEMODE_NONE: number; -} -declare var SVGFEConvolveMatrixElement: { - prototype: SVGFEConvolveMatrixElement; - new(): SVGFEConvolveMatrixElement; - SVG_EDGEMODE_WRAP: number; - SVG_EDGEMODE_DUPLICATE: number; - SVG_EDGEMODE_UNKNOWN: number; - SVG_EDGEMODE_NONE: number; -} - -interface TextTrackCueList { - length: number; - item(index: number): TextTrackCue; - [index: number]: TextTrackCue; - getCueById(id: string): TextTrackCue; -} -declare var TextTrackCueList: { - prototype: TextTrackCueList; - new(): TextTrackCueList; -} - -interface CSSKeyframesRule extends CSSRule { - name: string; - cssRules: CSSRuleList; - findRule(rule: string): CSSKeyframeRule; - deleteRule(rule: string): void; - appendRule(rule: string): void; -} -declare var CSSKeyframesRule: { - prototype: CSSKeyframesRule; - new(): CSSKeyframesRule; -} - -interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - baseFrequencyX: SVGAnimatedNumber; - numOctaves: SVGAnimatedInteger; - type: SVGAnimatedEnumeration; - baseFrequencyY: SVGAnimatedNumber; - stitchTiles: SVGAnimatedEnumeration; - seed: SVGAnimatedNumber; - SVG_STITCHTYPE_UNKNOWN: number; - SVG_STITCHTYPE_NOSTITCH: number; - SVG_TURBULENCE_TYPE_UNKNOWN: number; - SVG_TURBULENCE_TYPE_TURBULENCE: number; - SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - SVG_STITCHTYPE_STITCH: number; -} -declare var SVGFETurbulenceElement: { - prototype: SVGFETurbulenceElement; - new(): SVGFETurbulenceElement; - SVG_STITCHTYPE_UNKNOWN: number; - SVG_STITCHTYPE_NOSTITCH: number; - SVG_TURBULENCE_TYPE_UNKNOWN: number; - SVG_TURBULENCE_TYPE_TURBULENCE: number; - SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - SVG_STITCHTYPE_STITCH: number; -} - -interface TextTrackList extends EventTarget { - length: number; - onaddtrack: (ev: TrackEvent) => any; - item(index: number): TextTrack; - [index: number]: TextTrack; - addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var TextTrackList: { - prototype: TextTrackList; - new(): TextTrackList; -} - -interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncGElement: { - prototype: SVGFEFuncGElement; - new(): SVGFEFuncGElement; -} - -interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; - type: SVGAnimatedEnumeration; - values: SVGAnimatedNumberList; - SVG_FECOLORMATRIX_TYPE_SATURATE: number; - SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; - SVG_FECOLORMATRIX_TYPE_MATRIX: number; - SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; -} -declare var SVGFEColorMatrixElement: { - prototype: SVGFEColorMatrixElement; - new(): SVGFEColorMatrixElement; - SVG_FECOLORMATRIX_TYPE_SATURATE: number; - SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; - SVG_FECOLORMATRIX_TYPE_MATRIX: number; - SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; -} - -interface SVGFESpotLightElement extends SVGElement { - pointsAtY: SVGAnimatedNumber; - y: SVGAnimatedNumber; - limitingConeAngle: SVGAnimatedNumber; - specularExponent: SVGAnimatedNumber; - x: SVGAnimatedNumber; - pointsAtZ: SVGAnimatedNumber; - z: SVGAnimatedNumber; - pointsAtX: SVGAnimatedNumber; -} -declare var SVGFESpotLightElement: { - prototype: SVGFESpotLightElement; - new(): SVGFESpotLightElement; -} - -interface WindowBase64 { - btoa(rawString: string): string; - atob(encodedString: string): string; -} - -interface IDBDatabase extends EventTarget { - version: string; - name: string; - objectStoreNames: DOMStringList; - onerror: (ev: ErrorEvent) => any; - onabort: (ev: UIEvent) => any; - createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; - close(): void; - transaction(storeNames: any, mode?: string): IDBTransaction; - deleteObjectStore(name: string): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBDatabase: { - prototype: IDBDatabase; - new(): IDBDatabase; -} - -interface DOMStringList { - length: number; - contains(str: string): boolean; - item(index: number): string; - [index: number]: string; -} -declare var DOMStringList: { - prototype: DOMStringList; - new(): DOMStringList; -} - -interface IDBOpenDBRequest extends IDBRequest { - onupgradeneeded: (ev: IDBVersionChangeEvent) => any; - onblocked: (ev: Event) => any; - addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "upgradeneeded", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blocked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBOpenDBRequest: { - prototype: IDBOpenDBRequest; - new(): IDBOpenDBRequest; -} - -interface HTMLProgressElement extends HTMLElement { - /** - * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value. - */ - value: number; - /** - * Defines the maximum, or "done" value for a progress element. - */ - max: number; - /** - * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar). - */ - position: number; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; -} -declare var HTMLProgressElement: { - prototype: HTMLProgressElement; - new(): HTMLProgressElement; -} - -interface MSLaunchUriCallback { - (): void; -} - -interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - dy: SVGAnimatedNumber; - in1: SVGAnimatedString; - dx: SVGAnimatedNumber; -} -declare var SVGFEOffsetElement: { - prototype: SVGFEOffsetElement; - new(): SVGFEOffsetElement; -} - -interface MSUnsafeFunctionCallback { - (): any; -} - -interface TextTrack extends EventTarget { - language: string; - mode: any; - readyState: number; - activeCues: TextTrackCueList; - cues: TextTrackCueList; - oncuechange: (ev: Event) => any; - kind: string; - onload: (ev: Event) => any; - onerror: (ev: ErrorEvent) => any; - label: string; - addCue(cue: TextTrackCue): void; - removeCue(cue: TextTrackCue): void; - ERROR: number; - SHOWING: number; - LOADING: number; - LOADED: number; - NONE: number; - HIDDEN: number; - DISABLED: number; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var TextTrack: { - prototype: TextTrack; - new(): TextTrack; - ERROR: number; - SHOWING: number; - LOADING: number; - LOADED: number; - NONE: number; - HIDDEN: number; - DISABLED: number; -} - -interface MediaQueryListListener { - (mql: MediaQueryList): void; -} - -interface IDBRequest extends EventTarget { - source: any; - onsuccess: (ev: Event) => any; - error: DOMError; - transaction: IDBTransaction; - onerror: (ev: ErrorEvent) => any; +interface MediaSource extends EventTarget { + activeSourceBuffers: SourceBufferList; + duration: number; readyState: string; - result: any; - addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + sourceBuffers: SourceBufferList; + addSourceBuffer(type: string): SourceBuffer; + endOfStream(error?: string): void; + removeSourceBuffer(sourceBuffer: SourceBuffer): void; } -declare var IDBRequest: { - prototype: IDBRequest; - new(): IDBRequest; + +declare var MediaSource: { + prototype: MediaSource; + new(): MediaSource; + isTypeSupported(type: string): boolean; +} + +interface MessageChannel { + port1: MessagePort; + port2: MessagePort; +} + +declare var MessageChannel: { + prototype: MessageChannel; + new(): MessageChannel; +} + +interface MessageEvent extends Event { + data: any; + origin: string; + ports: any; + source: Window; + initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void; +} + +declare var MessageEvent: { + prototype: MessageEvent; + new(): MessageEvent; } interface MessagePort extends EventTarget { @@ -10870,2174 +10072,5247 @@ interface MessagePort extends EventTarget { postMessage(message?: any, ports?: any): void; start(): void; addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var MessagePort: { prototype: MessagePort; new(): MessagePort; } -interface FileReader extends MSBaseReader { - error: DOMError; - readAsArrayBuffer(blob: Blob): void; - readAsDataURL(blob: Blob): void; - readAsText(blob: Blob, encoding?: string): void; -} -declare var FileReader: { - prototype: FileReader; - new(): FileReader; +interface MimeType { + description: string; + enabledPlugin: Plugin; + suffixes: string; + type: string; } -interface ApplicationCache extends EventTarget { - status: number; - ondownloading: (ev: Event) => any; - onprogress: (ev: ProgressEvent) => any; - onupdateready: (ev: Event) => any; - oncached: (ev: Event) => any; - onobsolete: (ev: Event) => any; - onerror: (ev: ErrorEvent) => any; - onchecking: (ev: Event) => any; - onnoupdate: (ev: Event) => any; - swapCache(): void; - abort(): void; - update(): void; - CHECKING: number; - UNCACHED: number; - UPDATEREADY: number; - DOWNLOADING: number; - IDLE: number; - OBSOLETE: number; - addEventListener(type: "downloading", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "updateready", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cached", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "obsolete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "checking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "noupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var ApplicationCache: { - prototype: ApplicationCache; - new(): ApplicationCache; - CHECKING: number; - UNCACHED: number; - UPDATEREADY: number; - DOWNLOADING: number; - IDLE: number; - OBSOLETE: number; +declare var MimeType: { + prototype: MimeType; + new(): MimeType; } -interface FrameRequestCallback { - (time: number): void; +interface MimeTypeArray { + length: number; + item(index: number): Plugin; + namedItem(type: string): Plugin; + [index: number]: Plugin; +} + +declare var MimeTypeArray: { + prototype: MimeTypeArray; + new(): MimeTypeArray; +} + +interface MouseEvent extends UIEvent { + altKey: boolean; + button: number; + buttons: number; + clientX: number; + clientY: number; + ctrlKey: boolean; + fromElement: Element; + layerX: number; + layerY: number; + metaKey: boolean; + movementX: number; + movementY: number; + offsetX: number; + offsetY: number; + pageX: number; + pageY: number; + relatedTarget: EventTarget; + screenX: number; + screenY: number; + shiftKey: boolean; + toElement: Element; + which: number; + x: number; + y: number; + getModifierState(keyArg: string): boolean; + initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget): void; +} + +declare var MouseEvent: { + prototype: MouseEvent; + new(typeArg: string, eventInitDict?: MouseEventInit): MouseEvent; +} + +interface MouseWheelEvent extends MouseEvent { + wheelDelta: number; + wheelDeltaX: number; + wheelDeltaY: number; + initMouseWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, wheelDeltaArg: number): void; +} + +declare var MouseWheelEvent: { + prototype: MouseWheelEvent; + new(): MouseWheelEvent; +} + +interface MutationEvent extends Event { + attrChange: number; + attrName: string; + newValue: string; + prevValue: string; + relatedNode: Node; + initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; + ADDITION: number; + MODIFICATION: number; + REMOVAL: number; +} + +declare var MutationEvent: { + prototype: MutationEvent; + new(): MutationEvent; + ADDITION: number; + MODIFICATION: number; + REMOVAL: number; +} + +interface MutationObserver { + disconnect(): void; + observe(target: Node, options: MutationObserverInit): void; + takeRecords(): MutationRecord[]; +} + +declare var MutationObserver: { + prototype: MutationObserver; + new(callback: MutationCallback): MutationObserver; +} + +interface MutationRecord { + addedNodes: NodeList; + attributeName: string; + attributeNamespace: string; + nextSibling: Node; + oldValue: string; + previousSibling: Node; + removedNodes: NodeList; + target: Node; + type: string; +} + +declare var MutationRecord: { + prototype: MutationRecord; + new(): MutationRecord; +} + +interface NamedNodeMap { + length: number; + getNamedItem(name: string): Attr; + getNamedItemNS(namespaceURI: string, localName: string): Attr; + item(index: number): Attr; + removeNamedItem(name: string): Attr; + removeNamedItemNS(namespaceURI: string, localName: string): Attr; + setNamedItem(arg: Attr): Attr; + setNamedItemNS(arg: Attr): Attr; + [index: number]: Attr; +} + +declare var NamedNodeMap: { + prototype: NamedNodeMap; + new(): NamedNodeMap; +} + +interface NavigationCompletedEvent extends NavigationEvent { + isSuccess: boolean; + webErrorStatus: number; +} + +declare var NavigationCompletedEvent: { + prototype: NavigationCompletedEvent; + new(): NavigationCompletedEvent; +} + +interface NavigationEvent extends Event { + uri: string; +} + +declare var NavigationEvent: { + prototype: NavigationEvent; + new(): NavigationEvent; +} + +interface NavigationEventWithReferrer extends NavigationEvent { + referer: string; +} + +declare var NavigationEventWithReferrer: { + prototype: NavigationEventWithReferrer; + new(): NavigationEventWithReferrer; +} + +interface Navigator extends Object, NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, NavigatorGeolocation, MSNavigatorDoNotTrack, MSFileSaver { + appCodeName: string; + appMinorVersion: string; + browserLanguage: string; + connectionSpeed: number; + cookieEnabled: boolean; + cpuClass: string; + language: string; + maxTouchPoints: number; + mimeTypes: MSMimeTypesCollection; + msManipulationViewsEnabled: boolean; + msMaxTouchPoints: number; + msPointerEnabled: boolean; + plugins: MSPluginsCollection; + pointerEnabled: boolean; + systemLanguage: string; + userLanguage: string; + webdriver: boolean; + getGamepads(): Gamepad[]; + javaEnabled(): boolean; + msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Navigator: { + prototype: Navigator; + new(): Navigator; +} + +interface Node extends EventTarget { + attributes: NamedNodeMap; + baseURI: string; + childNodes: NodeList; + firstChild: Node; + lastChild: Node; + localName: string; + namespaceURI: string; + nextSibling: Node; + nodeName: string; + nodeType: number; + nodeValue: string; + ownerDocument: Document; + parentElement: HTMLElement; + parentNode: Node; + prefix: string; + previousSibling: Node; + textContent: string; + appendChild(newChild: Node): Node; + cloneNode(deep?: boolean): Node; + compareDocumentPosition(other: Node): number; + hasAttributes(): boolean; + hasChildNodes(): boolean; + insertBefore(newChild: Node, refChild?: Node): Node; + isDefaultNamespace(namespaceURI: string): boolean; + isEqualNode(arg: Node): boolean; + isSameNode(other: Node): boolean; + lookupNamespaceURI(prefix: string): string; + lookupPrefix(namespaceURI: string): string; + normalize(): void; + removeChild(oldChild: Node): Node; + replaceChild(newChild: Node, oldChild: Node): Node; + ATTRIBUTE_NODE: number; + CDATA_SECTION_NODE: number; + COMMENT_NODE: number; + DOCUMENT_FRAGMENT_NODE: number; + DOCUMENT_NODE: number; + DOCUMENT_POSITION_CONTAINED_BY: number; + DOCUMENT_POSITION_CONTAINS: number; + DOCUMENT_POSITION_DISCONNECTED: number; + DOCUMENT_POSITION_FOLLOWING: number; + DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; + DOCUMENT_POSITION_PRECEDING: number; + DOCUMENT_TYPE_NODE: number; + ELEMENT_NODE: number; + ENTITY_NODE: number; + ENTITY_REFERENCE_NODE: number; + NOTATION_NODE: number; + PROCESSING_INSTRUCTION_NODE: number; + TEXT_NODE: number; +} + +declare var Node: { + prototype: Node; + new(): Node; + ATTRIBUTE_NODE: number; + CDATA_SECTION_NODE: number; + COMMENT_NODE: number; + DOCUMENT_FRAGMENT_NODE: number; + DOCUMENT_NODE: number; + DOCUMENT_POSITION_CONTAINED_BY: number; + DOCUMENT_POSITION_CONTAINS: number; + DOCUMENT_POSITION_DISCONNECTED: number; + DOCUMENT_POSITION_FOLLOWING: number; + DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; + DOCUMENT_POSITION_PRECEDING: number; + DOCUMENT_TYPE_NODE: number; + ELEMENT_NODE: number; + ENTITY_NODE: number; + ENTITY_REFERENCE_NODE: number; + NOTATION_NODE: number; + PROCESSING_INSTRUCTION_NODE: number; + TEXT_NODE: number; +} + +interface NodeFilter { + FILTER_ACCEPT: number; + FILTER_REJECT: number; + FILTER_SKIP: number; + SHOW_ALL: number; + SHOW_ATTRIBUTE: number; + SHOW_CDATA_SECTION: number; + SHOW_COMMENT: number; + SHOW_DOCUMENT: number; + SHOW_DOCUMENT_FRAGMENT: number; + SHOW_DOCUMENT_TYPE: number; + SHOW_ELEMENT: number; + SHOW_ENTITY: number; + SHOW_ENTITY_REFERENCE: number; + SHOW_NOTATION: number; + SHOW_PROCESSING_INSTRUCTION: number; + SHOW_TEXT: number; +} +declare var NodeFilter: NodeFilter; + +interface NodeIterator { + expandEntityReferences: boolean; + filter: NodeFilter; + root: Node; + whatToShow: number; + detach(): void; + nextNode(): Node; + previousNode(): Node; +} + +declare var NodeIterator: { + prototype: NodeIterator; + new(): NodeIterator; +} + +interface NodeList { + length: number; + item(index: number): Node; + [index: number]: Node; +} + +declare var NodeList: { + prototype: NodeList; + new(): NodeList; +} + +interface OES_element_index_uint { +} + +declare var OES_element_index_uint: { + prototype: OES_element_index_uint; + new(): OES_element_index_uint; +} + +interface OES_standard_derivatives { + FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; +} + +declare var OES_standard_derivatives: { + prototype: OES_standard_derivatives; + new(): OES_standard_derivatives; + FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; +} + +interface OES_texture_float { +} + +declare var OES_texture_float: { + prototype: OES_texture_float; + new(): OES_texture_float; +} + +interface OES_texture_float_linear { +} + +declare var OES_texture_float_linear: { + prototype: OES_texture_float_linear; + new(): OES_texture_float_linear; +} + +interface OfflineAudioCompletionEvent extends Event { + renderedBuffer: AudioBuffer; +} + +declare var OfflineAudioCompletionEvent: { + prototype: OfflineAudioCompletionEvent; + new(): OfflineAudioCompletionEvent; +} + +interface OfflineAudioContext extends AudioContext { + oncomplete: (ev: Event) => any; + startRendering(): void; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var OfflineAudioContext: { + prototype: OfflineAudioContext; + new(numberOfChannels: number, length: number, sampleRate: number): OfflineAudioContext; +} + +interface OscillatorNode extends AudioNode { + detune: AudioParam; + frequency: AudioParam; + onended: (ev: Event) => any; + type: string; + setPeriodicWave(periodicWave: PeriodicWave): void; + start(when?: number): void; + stop(when?: number): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var OscillatorNode: { + prototype: OscillatorNode; + new(): OscillatorNode; +} + +interface PageTransitionEvent extends Event { + persisted: boolean; +} + +declare var PageTransitionEvent: { + prototype: PageTransitionEvent; + new(): PageTransitionEvent; +} + +interface PannerNode extends AudioNode { + coneInnerAngle: number; + coneOuterAngle: number; + coneOuterGain: number; + distanceModel: string; + maxDistance: number; + panningModel: string; + refDistance: number; + rolloffFactor: number; + setOrientation(x: number, y: number, z: number): void; + setPosition(x: number, y: number, z: number): void; + setVelocity(x: number, y: number, z: number): void; +} + +declare var PannerNode: { + prototype: PannerNode; + new(): PannerNode; +} + +interface PerfWidgetExternal { + activeNetworkRequestCount: number; + averageFrameTime: number; + averagePaintTime: number; + extraInformationEnabled: boolean; + independentRenderingEnabled: boolean; + irDisablingContentString: string; + irStatusAvailable: boolean; + maxCpuSpeed: number; + paintRequestsPerSecond: number; + performanceCounter: number; + performanceCounterFrequency: number; + addEventListener(eventType: string, callback: Function): void; + getMemoryUsage(): number; + getProcessCpuUsage(): number; + getRecentCpuUsage(last: number): any; + getRecentFrames(last: number): any; + getRecentMemoryUsage(last: number): any; + getRecentPaintRequests(last: number): any; + removeEventListener(eventType: string, callback: Function): void; + repositionWindow(x: number, y: number): void; + resizeWindow(width: number, height: number): void; +} + +declare var PerfWidgetExternal: { + prototype: PerfWidgetExternal; + new(): PerfWidgetExternal; +} + +interface Performance { + navigation: PerformanceNavigation; + timing: PerformanceTiming; + clearMarks(markName?: string): void; + clearMeasures(measureName?: string): void; + clearResourceTimings(): void; + getEntries(): any; + getEntriesByName(name: string, entryType?: string): any; + getEntriesByType(entryType: string): any; + getMarks(markName?: string): any; + getMeasures(measureName?: string): any; + mark(markName: string): void; + measure(measureName: string, startMarkName?: string, endMarkName?: string): void; + now(): number; + setResourceTimingBufferSize(maxSize: number): void; + toJSON(): any; +} + +declare var Performance: { + prototype: Performance; + new(): Performance; +} + +interface PerformanceEntry { + duration: number; + entryType: string; + name: string; + startTime: number; +} + +declare var PerformanceEntry: { + prototype: PerformanceEntry; + new(): PerformanceEntry; +} + +interface PerformanceMark extends PerformanceEntry { +} + +declare var PerformanceMark: { + prototype: PerformanceMark; + new(): PerformanceMark; +} + +interface PerformanceMeasure extends PerformanceEntry { +} + +declare var PerformanceMeasure: { + prototype: PerformanceMeasure; + new(): PerformanceMeasure; +} + +interface PerformanceNavigation { + redirectCount: number; + type: number; + toJSON(): any; + TYPE_BACK_FORWARD: number; + TYPE_NAVIGATE: number; + TYPE_RELOAD: number; + TYPE_RESERVED: number; +} + +declare var PerformanceNavigation: { + prototype: PerformanceNavigation; + new(): PerformanceNavigation; + TYPE_BACK_FORWARD: number; + TYPE_NAVIGATE: number; + TYPE_RELOAD: number; + TYPE_RESERVED: number; +} + +interface PerformanceNavigationTiming extends PerformanceEntry { + connectEnd: number; + connectStart: number; + domComplete: number; + domContentLoadedEventEnd: number; + domContentLoadedEventStart: number; + domInteractive: number; + domLoading: number; + domainLookupEnd: number; + domainLookupStart: number; + fetchStart: number; + loadEventEnd: number; + loadEventStart: number; + navigationStart: number; + redirectCount: number; + redirectEnd: number; + redirectStart: number; + requestStart: number; + responseEnd: number; + responseStart: number; + type: string; + unloadEventEnd: number; + unloadEventStart: number; +} + +declare var PerformanceNavigationTiming: { + prototype: PerformanceNavigationTiming; + new(): PerformanceNavigationTiming; +} + +interface PerformanceResourceTiming extends PerformanceEntry { + connectEnd: number; + connectStart: number; + domainLookupEnd: number; + domainLookupStart: number; + fetchStart: number; + initiatorType: string; + redirectEnd: number; + redirectStart: number; + requestStart: number; + responseEnd: number; + responseStart: number; +} + +declare var PerformanceResourceTiming: { + prototype: PerformanceResourceTiming; + new(): PerformanceResourceTiming; +} + +interface PerformanceTiming { + connectEnd: number; + connectStart: number; + domComplete: number; + domContentLoadedEventEnd: number; + domContentLoadedEventStart: number; + domInteractive: number; + domLoading: number; + domainLookupEnd: number; + domainLookupStart: number; + fetchStart: number; + loadEventEnd: number; + loadEventStart: number; + msFirstPaint: number; + navigationStart: number; + redirectEnd: number; + redirectStart: number; + requestStart: number; + responseEnd: number; + responseStart: number; + unloadEventEnd: number; + unloadEventStart: number; + toJSON(): any; +} + +declare var PerformanceTiming: { + prototype: PerformanceTiming; + new(): PerformanceTiming; +} + +interface PeriodicWave { +} + +declare var PeriodicWave: { + prototype: PeriodicWave; + new(): PeriodicWave; +} + +interface PermissionRequest extends DeferredPermissionRequest { + state: string; + defer(): void; +} + +declare var PermissionRequest: { + prototype: PermissionRequest; + new(): PermissionRequest; +} + +interface PermissionRequestedEvent extends Event { + permissionRequest: PermissionRequest; +} + +declare var PermissionRequestedEvent: { + prototype: PermissionRequestedEvent; + new(): PermissionRequestedEvent; +} + +interface Plugin { + description: string; + filename: string; + length: number; + name: string; + version: string; + item(index: number): MimeType; + namedItem(type: string): MimeType; + [index: number]: MimeType; +} + +declare var Plugin: { + prototype: Plugin; + new(): Plugin; +} + +interface PluginArray { + length: number; + item(index: number): Plugin; + namedItem(name: string): Plugin; + refresh(reload?: boolean): void; + [index: number]: Plugin; +} + +declare var PluginArray: { + prototype: PluginArray; + new(): PluginArray; +} + +interface PointerEvent extends MouseEvent { + currentPoint: any; + height: number; + hwTimestamp: number; + intermediatePoints: any; + isPrimary: boolean; + pointerId: number; + pointerType: any; + pressure: number; + rotation: number; + tiltX: number; + tiltY: number; + width: number; + getCurrentPoint(element: Element): void; + getIntermediatePoints(element: Element): void; + initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; +} + +declare var PointerEvent: { + prototype: PointerEvent; + new(typeArg: string, eventInitDict?: PointerEventInit): PointerEvent; } interface PopStateEvent extends Event { state: any; initPopStateEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, stateArg: any): void; } + declare var PopStateEvent: { prototype: PopStateEvent; new(): PopStateEvent; } -interface CSSKeyframeRule extends CSSRule { - keyText: string; - style: CSSStyleDeclaration; -} -declare var CSSKeyframeRule: { - prototype: CSSKeyframeRule; - new(): CSSKeyframeRule; +interface Position { + coords: Coordinates; + timestamp: Date; } -interface MSFileSaver { - msSaveBlob(blob: any, defaultName?: string): boolean; - msSaveOrOpenBlob(blob: any, defaultName?: string): boolean; +declare var Position: { + prototype: Position; + new(): Position; } -interface MSStream { - type: string; - msDetachStream(): any; - msClose(): void; -} -declare var MSStream: { - prototype: MSStream; - new(): MSStream; +interface PositionError { + code: number; + message: string; + toString(): string; + PERMISSION_DENIED: number; + POSITION_UNAVAILABLE: number; + TIMEOUT: number; } -interface MSBlobBuilder { - append(data: any, endings?: string): void; - getBlob(contentType?: string): Blob; -} -declare var MSBlobBuilder: { - prototype: MSBlobBuilder; - new(): MSBlobBuilder; +declare var PositionError: { + prototype: PositionError; + new(): PositionError; + PERMISSION_DENIED: number; + POSITION_UNAVAILABLE: number; + TIMEOUT: number; } -interface DOMSettableTokenList extends DOMTokenList { - value: string; -} -declare var DOMSettableTokenList: { - prototype: DOMSettableTokenList; - new(): DOMSettableTokenList; +interface ProcessingInstruction extends CharacterData { + target: string; } -interface IDBFactory { - open(name: string, version?: number): IDBOpenDBRequest; - cmp(first: any, second: any): number; - deleteDatabase(name: string): IDBOpenDBRequest; -} -declare var IDBFactory: { - prototype: IDBFactory; - new(): IDBFactory; +declare var ProcessingInstruction: { + prototype: ProcessingInstruction; + new(): ProcessingInstruction; } -interface MSPointerEvent extends MouseEvent { - width: number; - rotation: number; - pressure: number; - pointerType: any; - isPrimary: boolean; - tiltY: number; - height: number; - intermediatePoints: any; - currentPoint: any; - tiltX: number; - hwTimestamp: number; - pointerId: number; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; - MSPOINTER_TYPE_PEN: number; - MSPOINTER_TYPE_MOUSE: number; - MSPOINTER_TYPE_TOUCH: number; -} -declare var MSPointerEvent: { - prototype: MSPointerEvent; - new(): MSPointerEvent; - MSPOINTER_TYPE_PEN: number; - MSPOINTER_TYPE_MOUSE: number; - MSPOINTER_TYPE_TOUCH: number; +interface ProgressEvent extends Event { + lengthComputable: boolean; + loaded: number; + total: number; + initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; } -interface MSManipulationEvent extends UIEvent { - lastState: number; - currentState: number; - initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void; - MS_MANIPULATION_STATE_STOPPED: number; - MS_MANIPULATION_STATE_ACTIVE: number; - MS_MANIPULATION_STATE_INERTIA: number; - MS_MANIPULATION_STATE_SELECTING: number; - MS_MANIPULATION_STATE_COMMITTED: number; - MS_MANIPULATION_STATE_PRESELECT: number; - MS_MANIPULATION_STATE_DRAGGING: number; - MS_MANIPULATION_STATE_CANCELLED: number; -} -declare var MSManipulationEvent: { - prototype: MSManipulationEvent; - new(): MSManipulationEvent; - MS_MANIPULATION_STATE_STOPPED: number; - MS_MANIPULATION_STATE_ACTIVE: number; - MS_MANIPULATION_STATE_INERTIA: number; - MS_MANIPULATION_STATE_SELECTING: number; - MS_MANIPULATION_STATE_COMMITTED: number; - MS_MANIPULATION_STATE_PRESELECT: number; - MS_MANIPULATION_STATE_DRAGGING: number; - MS_MANIPULATION_STATE_CANCELLED: number; +declare var ProgressEvent: { + prototype: ProgressEvent; + new(): ProgressEvent; } -interface FormData { - append(name: any, value: any, blobName?: string): void; -} -declare var FormData: { - prototype: FormData; - new(): FormData; +interface Range { + collapsed: boolean; + commonAncestorContainer: Node; + endContainer: Node; + endOffset: number; + startContainer: Node; + startOffset: number; + cloneContents(): DocumentFragment; + cloneRange(): Range; + collapse(toStart: boolean): void; + compareBoundaryPoints(how: number, sourceRange: Range): number; + createContextualFragment(fragment: string): DocumentFragment; + deleteContents(): void; + detach(): void; + expand(Unit: string): boolean; + extractContents(): DocumentFragment; + getBoundingClientRect(): ClientRect; + getClientRects(): ClientRectList; + insertNode(newNode: Node): void; + selectNode(refNode: Node): void; + selectNodeContents(refNode: Node): void; + setEnd(refNode: Node, offset: number): void; + setEndAfter(refNode: Node): void; + setEndBefore(refNode: Node): void; + setStart(refNode: Node, offset: number): void; + setStartAfter(refNode: Node): void; + setStartBefore(refNode: Node): void; + surroundContents(newParent: Node): void; + toString(): string; + END_TO_END: number; + END_TO_START: number; + START_TO_END: number; + START_TO_START: number; } -interface HTMLDataListElement extends HTMLElement { - options: HTMLCollection; -} -declare var HTMLDataListElement: { - prototype: HTMLDataListElement; - new(): HTMLDataListElement; +declare var Range: { + prototype: Range; + new(): Range; + END_TO_END: number; + END_TO_START: number; + START_TO_END: number; + START_TO_START: number; } -interface SVGFEImageElement extends SVGElement, SVGLangSpace, SVGFilterPrimitiveStandardAttributes, SVGURIReference, SVGExternalResourcesRequired { - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; -} -declare var SVGFEImageElement: { - prototype: SVGFEImageElement; - new(): SVGFEImageElement; +interface SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { + target: SVGAnimatedString; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface AbstractWorker extends EventTarget { - onerror: (ev: ErrorEvent) => any; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +declare var SVGAElement: { + prototype: SVGAElement; + new(): SVGAElement; } -interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - operator: SVGAnimatedEnumeration; - in2: SVGAnimatedString; - k2: SVGAnimatedNumber; - k1: SVGAnimatedNumber; - k3: SVGAnimatedNumber; +interface SVGAngle { + unitType: number; + value: number; + valueAsString: string; + valueInSpecifiedUnits: number; + convertToSpecifiedUnits(unitType: number): void; + newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; + SVG_ANGLETYPE_DEG: number; + SVG_ANGLETYPE_GRAD: number; + SVG_ANGLETYPE_RAD: number; + SVG_ANGLETYPE_UNKNOWN: number; + SVG_ANGLETYPE_UNSPECIFIED: number; +} + +declare var SVGAngle: { + prototype: SVGAngle; + new(): SVGAngle; + SVG_ANGLETYPE_DEG: number; + SVG_ANGLETYPE_GRAD: number; + SVG_ANGLETYPE_RAD: number; + SVG_ANGLETYPE_UNKNOWN: number; + SVG_ANGLETYPE_UNSPECIFIED: number; +} + +interface SVGAnimatedAngle { + animVal: SVGAngle; + baseVal: SVGAngle; +} + +declare var SVGAnimatedAngle: { + prototype: SVGAnimatedAngle; + new(): SVGAnimatedAngle; +} + +interface SVGAnimatedBoolean { + animVal: boolean; + baseVal: boolean; +} + +declare var SVGAnimatedBoolean: { + prototype: SVGAnimatedBoolean; + new(): SVGAnimatedBoolean; +} + +interface SVGAnimatedEnumeration { + animVal: number; + baseVal: number; +} + +declare var SVGAnimatedEnumeration: { + prototype: SVGAnimatedEnumeration; + new(): SVGAnimatedEnumeration; +} + +interface SVGAnimatedInteger { + animVal: number; + baseVal: number; +} + +declare var SVGAnimatedInteger: { + prototype: SVGAnimatedInteger; + new(): SVGAnimatedInteger; +} + +interface SVGAnimatedLength { + animVal: SVGLength; + baseVal: SVGLength; +} + +declare var SVGAnimatedLength: { + prototype: SVGAnimatedLength; + new(): SVGAnimatedLength; +} + +interface SVGAnimatedLengthList { + animVal: SVGLengthList; + baseVal: SVGLengthList; +} + +declare var SVGAnimatedLengthList: { + prototype: SVGAnimatedLengthList; + new(): SVGAnimatedLengthList; +} + +interface SVGAnimatedNumber { + animVal: number; + baseVal: number; +} + +declare var SVGAnimatedNumber: { + prototype: SVGAnimatedNumber; + new(): SVGAnimatedNumber; +} + +interface SVGAnimatedNumberList { + animVal: SVGNumberList; + baseVal: SVGNumberList; +} + +declare var SVGAnimatedNumberList: { + prototype: SVGAnimatedNumberList; + new(): SVGAnimatedNumberList; +} + +interface SVGAnimatedPreserveAspectRatio { + animVal: SVGPreserveAspectRatio; + baseVal: SVGPreserveAspectRatio; +} + +declare var SVGAnimatedPreserveAspectRatio: { + prototype: SVGAnimatedPreserveAspectRatio; + new(): SVGAnimatedPreserveAspectRatio; +} + +interface SVGAnimatedRect { + animVal: SVGRect; + baseVal: SVGRect; +} + +declare var SVGAnimatedRect: { + prototype: SVGAnimatedRect; + new(): SVGAnimatedRect; +} + +interface SVGAnimatedString { + animVal: string; + baseVal: string; +} + +declare var SVGAnimatedString: { + prototype: SVGAnimatedString; + new(): SVGAnimatedString; +} + +interface SVGAnimatedTransformList { + animVal: SVGTransformList; + baseVal: SVGTransformList; +} + +declare var SVGAnimatedTransformList: { + prototype: SVGAnimatedTransformList; + new(): SVGAnimatedTransformList; +} + +interface SVGCircleElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + cx: SVGAnimatedLength; + cy: SVGAnimatedLength; + r: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGCircleElement: { + prototype: SVGCircleElement; + new(): SVGCircleElement; +} + +interface SVGClipPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes { + clipPathUnits: SVGAnimatedEnumeration; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGClipPathElement: { + prototype: SVGClipPathElement; + new(): SVGClipPathElement; +} + +interface SVGComponentTransferFunctionElement extends SVGElement { + amplitude: SVGAnimatedNumber; + exponent: SVGAnimatedNumber; + intercept: SVGAnimatedNumber; + offset: SVGAnimatedNumber; + slope: SVGAnimatedNumber; + tableValues: SVGAnimatedNumberList; + type: SVGAnimatedEnumeration; + SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; + SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; + SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; + SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; + SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; + SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; +} + +declare var SVGComponentTransferFunctionElement: { + prototype: SVGComponentTransferFunctionElement; + new(): SVGComponentTransferFunctionElement; + SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; + SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; + SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; + SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; + SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; + SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; +} + +interface SVGDefsElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGDefsElement: { + prototype: SVGDefsElement; + new(): SVGDefsElement; +} + +interface SVGDescElement extends SVGElement, SVGStylable, SVGLangSpace { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGDescElement: { + prototype: SVGDescElement; + new(): SVGDescElement; +} + +interface SVGElement extends Element { + id: string; + onclick: (ev: MouseEvent) => any; + ondblclick: (ev: MouseEvent) => any; + onfocusin: (ev: FocusEvent) => any; + onfocusout: (ev: FocusEvent) => any; + onload: (ev: Event) => any; + onmousedown: (ev: MouseEvent) => any; + onmousemove: (ev: MouseEvent) => any; + onmouseout: (ev: MouseEvent) => any; + onmouseover: (ev: MouseEvent) => any; + onmouseup: (ev: MouseEvent) => any; + ownerSVGElement: SVGSVGElement; + viewportElement: SVGElement; + xmlbase: string; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGElement: { + prototype: SVGElement; + new(): SVGElement; +} + +interface SVGElementInstance extends EventTarget { + childNodes: SVGElementInstanceList; + correspondingElement: SVGElement; + correspondingUseElement: SVGUseElement; + firstChild: SVGElementInstance; + lastChild: SVGElementInstance; + nextSibling: SVGElementInstance; + parentNode: SVGElementInstance; + previousSibling: SVGElementInstance; +} + +declare var SVGElementInstance: { + prototype: SVGElementInstance; + new(): SVGElementInstance; +} + +interface SVGElementInstanceList { + length: number; + item(index: number): SVGElementInstance; +} + +declare var SVGElementInstanceList: { + prototype: SVGElementInstanceList; + new(): SVGElementInstanceList; +} + +interface SVGEllipseElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + cx: SVGAnimatedLength; + cy: SVGAnimatedLength; + rx: SVGAnimatedLength; + ry: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGEllipseElement: { + prototype: SVGEllipseElement; + new(): SVGEllipseElement; +} + +interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { in1: SVGAnimatedString; - k4: SVGAnimatedNumber; - SVG_FECOMPOSITE_OPERATOR_OUT: number; - SVG_FECOMPOSITE_OPERATOR_OVER: number; - SVG_FECOMPOSITE_OPERATOR_XOR: number; - SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - SVG_FECOMPOSITE_OPERATOR_IN: number; - SVG_FECOMPOSITE_OPERATOR_ATOP: number; -} -declare var SVGFECompositeElement: { - prototype: SVGFECompositeElement; - new(): SVGFECompositeElement; - SVG_FECOMPOSITE_OPERATOR_OUT: number; - SVG_FECOMPOSITE_OPERATOR_OVER: number; - SVG_FECOMPOSITE_OPERATOR_XOR: number; - SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - SVG_FECOMPOSITE_OPERATOR_IN: number; - SVG_FECOMPOSITE_OPERATOR_ATOP: number; + in2: SVGAnimatedString; + mode: SVGAnimatedEnumeration; + SVG_FEBLEND_MODE_COLOR: number; + SVG_FEBLEND_MODE_COLOR_BURN: number; + SVG_FEBLEND_MODE_COLOR_DODGE: number; + SVG_FEBLEND_MODE_DARKEN: number; + SVG_FEBLEND_MODE_DIFFERENCE: number; + SVG_FEBLEND_MODE_EXCLUSION: number; + SVG_FEBLEND_MODE_HARD_LIGHT: number; + SVG_FEBLEND_MODE_HUE: number; + SVG_FEBLEND_MODE_LIGHTEN: number; + SVG_FEBLEND_MODE_LUMINOSITY: number; + SVG_FEBLEND_MODE_MULTIPLY: number; + SVG_FEBLEND_MODE_NORMAL: number; + SVG_FEBLEND_MODE_OVERLAY: number; + SVG_FEBLEND_MODE_SATURATION: number; + SVG_FEBLEND_MODE_SCREEN: number; + SVG_FEBLEND_MODE_SOFT_LIGHT: number; + SVG_FEBLEND_MODE_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface ValidityState { - customError: boolean; - valueMissing: boolean; - stepMismatch: boolean; - rangeUnderflow: boolean; - rangeOverflow: boolean; - typeMismatch: boolean; - patternMismatch: boolean; - tooLong: boolean; - valid: boolean; -} -declare var ValidityState: { - prototype: ValidityState; - new(): ValidityState; +declare var SVGFEBlendElement: { + prototype: SVGFEBlendElement; + new(): SVGFEBlendElement; + SVG_FEBLEND_MODE_COLOR: number; + SVG_FEBLEND_MODE_COLOR_BURN: number; + SVG_FEBLEND_MODE_COLOR_DODGE: number; + SVG_FEBLEND_MODE_DARKEN: number; + SVG_FEBLEND_MODE_DIFFERENCE: number; + SVG_FEBLEND_MODE_EXCLUSION: number; + SVG_FEBLEND_MODE_HARD_LIGHT: number; + SVG_FEBLEND_MODE_HUE: number; + SVG_FEBLEND_MODE_LIGHTEN: number; + SVG_FEBLEND_MODE_LUMINOSITY: number; + SVG_FEBLEND_MODE_MULTIPLY: number; + SVG_FEBLEND_MODE_NORMAL: number; + SVG_FEBLEND_MODE_OVERLAY: number; + SVG_FEBLEND_MODE_SATURATION: number; + SVG_FEBLEND_MODE_SCREEN: number; + SVG_FEBLEND_MODE_SOFT_LIGHT: number; + SVG_FEBLEND_MODE_UNKNOWN: number; } -interface HTMLTrackElement extends HTMLElement { - kind: string; - src: string; - srclang: string; - track: TextTrack; - label: string; - default: boolean; - readyState: number; - ERROR: number; - LOADING: number; - LOADED: number; - NONE: number; -} -declare var HTMLTrackElement: { - prototype: HTMLTrackElement; - new(): HTMLTrackElement; - ERROR: number; - LOADING: number; - LOADED: number; - NONE: number; +interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + type: SVGAnimatedEnumeration; + values: SVGAnimatedNumberList; + SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; + SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; + SVG_FECOLORMATRIX_TYPE_MATRIX: number; + SVG_FECOLORMATRIX_TYPE_SATURATE: number; + SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface MSApp { - createFileFromStorageFile(storageFile: any): File; - createBlobFromRandomAccessStream(type: string, seeker: any): Blob; - createStreamFromInputStream(type: string, inputStream: any): MSStream; - terminateApp(exceptionObject: any): void; - createDataPackage(object: any): any; - execUnsafeLocalFunction(unsafeFunction: MSUnsafeFunctionCallback): any; - getHtmlPrintDocumentSource(htmlDoc: any): any; - addPublicLocalApplicationUri(uri: string): void; - createDataPackageFromSelection(): any; - getViewOpener(): MSAppView; - suppressSubdownloadCredentialPrompts(suppress: boolean): void; - execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; - isTaskScheduledAtPriorityOrHigher(priority: string): boolean; - execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; - createNewView(uri: string): MSAppView; - getCurrentPriority(): string; - NORMAL: string; - HIGH: string; - IDLE: string; - CURRENT: string; +declare var SVGFEColorMatrixElement: { + prototype: SVGFEColorMatrixElement; + new(): SVGFEColorMatrixElement; + SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; + SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; + SVG_FECOLORMATRIX_TYPE_MATRIX: number; + SVG_FECOLORMATRIX_TYPE_SATURATE: number; + SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; } -declare var MSApp: MSApp; interface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { in1: SVGAnimatedString; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var SVGFEComponentTransferElement: { prototype: SVGFEComponentTransferElement; new(): SVGFEComponentTransferElement; } -interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { +interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + in2: SVGAnimatedString; + k1: SVGAnimatedNumber; + k2: SVGAnimatedNumber; + k3: SVGAnimatedNumber; + k4: SVGAnimatedNumber; + operator: SVGAnimatedEnumeration; + SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; + SVG_FECOMPOSITE_OPERATOR_ATOP: number; + SVG_FECOMPOSITE_OPERATOR_IN: number; + SVG_FECOMPOSITE_OPERATOR_OUT: number; + SVG_FECOMPOSITE_OPERATOR_OVER: number; + SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; + SVG_FECOMPOSITE_OPERATOR_XOR: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFECompositeElement: { + prototype: SVGFECompositeElement; + new(): SVGFECompositeElement; + SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; + SVG_FECOMPOSITE_OPERATOR_ATOP: number; + SVG_FECOMPOSITE_OPERATOR_IN: number; + SVG_FECOMPOSITE_OPERATOR_OUT: number; + SVG_FECOMPOSITE_OPERATOR_OVER: number; + SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; + SVG_FECOMPOSITE_OPERATOR_XOR: number; +} + +interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + bias: SVGAnimatedNumber; + divisor: SVGAnimatedNumber; + edgeMode: SVGAnimatedEnumeration; + in1: SVGAnimatedString; + kernelMatrix: SVGAnimatedNumberList; + kernelUnitLengthX: SVGAnimatedNumber; kernelUnitLengthY: SVGAnimatedNumber; - surfaceScale: SVGAnimatedNumber; + orderX: SVGAnimatedInteger; + orderY: SVGAnimatedInteger; + preserveAlpha: SVGAnimatedBoolean; + targetX: SVGAnimatedInteger; + targetY: SVGAnimatedInteger; + SVG_EDGEMODE_DUPLICATE: number; + SVG_EDGEMODE_NONE: number; + SVG_EDGEMODE_UNKNOWN: number; + SVG_EDGEMODE_WRAP: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEConvolveMatrixElement: { + prototype: SVGFEConvolveMatrixElement; + new(): SVGFEConvolveMatrixElement; + SVG_EDGEMODE_DUPLICATE: number; + SVG_EDGEMODE_NONE: number; + SVG_EDGEMODE_UNKNOWN: number; + SVG_EDGEMODE_WRAP: number; +} + +interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + diffuseConstant: SVGAnimatedNumber; in1: SVGAnimatedString; kernelUnitLengthX: SVGAnimatedNumber; - diffuseConstant: SVGAnimatedNumber; + kernelUnitLengthY: SVGAnimatedNumber; + surfaceScale: SVGAnimatedNumber; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var SVGFEDiffuseLightingElement: { prototype: SVGFEDiffuseLightingElement; new(): SVGFEDiffuseLightingElement; } -interface MSCSSMatrix { - m24: number; - m34: number; +interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + in2: SVGAnimatedString; + scale: SVGAnimatedNumber; + xChannelSelector: SVGAnimatedEnumeration; + yChannelSelector: SVGAnimatedEnumeration; + SVG_CHANNEL_A: number; + SVG_CHANNEL_B: number; + SVG_CHANNEL_G: number; + SVG_CHANNEL_R: number; + SVG_CHANNEL_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEDisplacementMapElement: { + prototype: SVGFEDisplacementMapElement; + new(): SVGFEDisplacementMapElement; + SVG_CHANNEL_A: number; + SVG_CHANNEL_B: number; + SVG_CHANNEL_G: number; + SVG_CHANNEL_R: number; + SVG_CHANNEL_UNKNOWN: number; +} + +interface SVGFEDistantLightElement extends SVGElement { + azimuth: SVGAnimatedNumber; + elevation: SVGAnimatedNumber; +} + +declare var SVGFEDistantLightElement: { + prototype: SVGFEDistantLightElement; + new(): SVGFEDistantLightElement; +} + +interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEFloodElement: { + prototype: SVGFEFloodElement; + new(): SVGFEFloodElement; +} + +interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { +} + +declare var SVGFEFuncAElement: { + prototype: SVGFEFuncAElement; + new(): SVGFEFuncAElement; +} + +interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { +} + +declare var SVGFEFuncBElement: { + prototype: SVGFEFuncBElement; + new(): SVGFEFuncBElement; +} + +interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { +} + +declare var SVGFEFuncGElement: { + prototype: SVGFEFuncGElement; + new(): SVGFEFuncGElement; +} + +interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { +} + +declare var SVGFEFuncRElement: { + prototype: SVGFEFuncRElement; + new(): SVGFEFuncRElement; +} + +interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + stdDeviationX: SVGAnimatedNumber; + stdDeviationY: SVGAnimatedNumber; + setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEGaussianBlurElement: { + prototype: SVGFEGaussianBlurElement; + new(): SVGFEGaussianBlurElement; +} + +interface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { + preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEImageElement: { + prototype: SVGFEImageElement; + new(): SVGFEImageElement; +} + +interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEMergeElement: { + prototype: SVGFEMergeElement; + new(): SVGFEMergeElement; +} + +interface SVGFEMergeNodeElement extends SVGElement { + in1: SVGAnimatedString; +} + +declare var SVGFEMergeNodeElement: { + prototype: SVGFEMergeNodeElement; + new(): SVGFEMergeNodeElement; +} + +interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + operator: SVGAnimatedEnumeration; + radiusX: SVGAnimatedNumber; + radiusY: SVGAnimatedNumber; + SVG_MORPHOLOGY_OPERATOR_DILATE: number; + SVG_MORPHOLOGY_OPERATOR_ERODE: number; + SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEMorphologyElement: { + prototype: SVGFEMorphologyElement; + new(): SVGFEMorphologyElement; + SVG_MORPHOLOGY_OPERATOR_DILATE: number; + SVG_MORPHOLOGY_OPERATOR_ERODE: number; + SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; +} + +interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + dx: SVGAnimatedNumber; + dy: SVGAnimatedNumber; + in1: SVGAnimatedString; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEOffsetElement: { + prototype: SVGFEOffsetElement; + new(): SVGFEOffsetElement; +} + +interface SVGFEPointLightElement extends SVGElement { + x: SVGAnimatedNumber; + y: SVGAnimatedNumber; + z: SVGAnimatedNumber; +} + +declare var SVGFEPointLightElement: { + prototype: SVGFEPointLightElement; + new(): SVGFEPointLightElement; +} + +interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + kernelUnitLengthX: SVGAnimatedNumber; + kernelUnitLengthY: SVGAnimatedNumber; + specularConstant: SVGAnimatedNumber; + specularExponent: SVGAnimatedNumber; + surfaceScale: SVGAnimatedNumber; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFESpecularLightingElement: { + prototype: SVGFESpecularLightingElement; + new(): SVGFESpecularLightingElement; +} + +interface SVGFESpotLightElement extends SVGElement { + limitingConeAngle: SVGAnimatedNumber; + pointsAtX: SVGAnimatedNumber; + pointsAtY: SVGAnimatedNumber; + pointsAtZ: SVGAnimatedNumber; + specularExponent: SVGAnimatedNumber; + x: SVGAnimatedNumber; + y: SVGAnimatedNumber; + z: SVGAnimatedNumber; +} + +declare var SVGFESpotLightElement: { + prototype: SVGFESpotLightElement; + new(): SVGFESpotLightElement; +} + +interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFETileElement: { + prototype: SVGFETileElement; + new(): SVGFETileElement; +} + +interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + baseFrequencyX: SVGAnimatedNumber; + baseFrequencyY: SVGAnimatedNumber; + numOctaves: SVGAnimatedInteger; + seed: SVGAnimatedNumber; + stitchTiles: SVGAnimatedEnumeration; + type: SVGAnimatedEnumeration; + SVG_STITCHTYPE_NOSTITCH: number; + SVG_STITCHTYPE_STITCH: number; + SVG_STITCHTYPE_UNKNOWN: number; + SVG_TURBULENCE_TYPE_FRACTALNOISE: number; + SVG_TURBULENCE_TYPE_TURBULENCE: number; + SVG_TURBULENCE_TYPE_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFETurbulenceElement: { + prototype: SVGFETurbulenceElement; + new(): SVGFETurbulenceElement; + SVG_STITCHTYPE_NOSTITCH: number; + SVG_STITCHTYPE_STITCH: number; + SVG_STITCHTYPE_UNKNOWN: number; + SVG_TURBULENCE_TYPE_FRACTALNOISE: number; + SVG_TURBULENCE_TYPE_TURBULENCE: number; + SVG_TURBULENCE_TYPE_UNKNOWN: number; +} + +interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { + filterResX: SVGAnimatedInteger; + filterResY: SVGAnimatedInteger; + filterUnits: SVGAnimatedEnumeration; + height: SVGAnimatedLength; + primitiveUnits: SVGAnimatedEnumeration; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + setFilterRes(filterResX: number, filterResY: number): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFilterElement: { + prototype: SVGFilterElement; + new(): SVGFilterElement; +} + +interface SVGForeignObjectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + height: SVGAnimatedLength; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGForeignObjectElement: { + prototype: SVGForeignObjectElement; + new(): SVGForeignObjectElement; +} + +interface SVGGElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGGElement: { + prototype: SVGGElement; + new(): SVGGElement; +} + +interface SVGGradientElement extends SVGElement, SVGStylable, SVGExternalResourcesRequired, SVGURIReference, SVGUnitTypes { + gradientTransform: SVGAnimatedTransformList; + gradientUnits: SVGAnimatedEnumeration; + spreadMethod: SVGAnimatedEnumeration; + SVG_SPREADMETHOD_PAD: number; + SVG_SPREADMETHOD_REFLECT: number; + SVG_SPREADMETHOD_REPEAT: number; + SVG_SPREADMETHOD_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGGradientElement: { + prototype: SVGGradientElement; + new(): SVGGradientElement; + SVG_SPREADMETHOD_PAD: number; + SVG_SPREADMETHOD_REFLECT: number; + SVG_SPREADMETHOD_REPEAT: number; + SVG_SPREADMETHOD_UNKNOWN: number; +} + +interface SVGImageElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { + height: SVGAnimatedLength; + preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGImageElement: { + prototype: SVGImageElement; + new(): SVGImageElement; +} + +interface SVGLength { + unitType: number; + value: number; + valueAsString: string; + valueInSpecifiedUnits: number; + convertToSpecifiedUnits(unitType: number): void; + newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; + SVG_LENGTHTYPE_CM: number; + SVG_LENGTHTYPE_EMS: number; + SVG_LENGTHTYPE_EXS: number; + SVG_LENGTHTYPE_IN: number; + SVG_LENGTHTYPE_MM: number; + SVG_LENGTHTYPE_NUMBER: number; + SVG_LENGTHTYPE_PC: number; + SVG_LENGTHTYPE_PERCENTAGE: number; + SVG_LENGTHTYPE_PT: number; + SVG_LENGTHTYPE_PX: number; + SVG_LENGTHTYPE_UNKNOWN: number; +} + +declare var SVGLength: { + prototype: SVGLength; + new(): SVGLength; + SVG_LENGTHTYPE_CM: number; + SVG_LENGTHTYPE_EMS: number; + SVG_LENGTHTYPE_EXS: number; + SVG_LENGTHTYPE_IN: number; + SVG_LENGTHTYPE_MM: number; + SVG_LENGTHTYPE_NUMBER: number; + SVG_LENGTHTYPE_PC: number; + SVG_LENGTHTYPE_PERCENTAGE: number; + SVG_LENGTHTYPE_PT: number; + SVG_LENGTHTYPE_PX: number; + SVG_LENGTHTYPE_UNKNOWN: number; +} + +interface SVGLengthList { + numberOfItems: number; + appendItem(newItem: SVGLength): SVGLength; + clear(): void; + getItem(index: number): SVGLength; + initialize(newItem: SVGLength): SVGLength; + insertItemBefore(newItem: SVGLength, index: number): SVGLength; + removeItem(index: number): SVGLength; + replaceItem(newItem: SVGLength, index: number): SVGLength; +} + +declare var SVGLengthList: { + prototype: SVGLengthList; + new(): SVGLengthList; +} + +interface SVGLineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + x1: SVGAnimatedLength; + x2: SVGAnimatedLength; + y1: SVGAnimatedLength; + y2: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGLineElement: { + prototype: SVGLineElement; + new(): SVGLineElement; +} + +interface SVGLinearGradientElement extends SVGGradientElement { + x1: SVGAnimatedLength; + x2: SVGAnimatedLength; + y1: SVGAnimatedLength; + y2: SVGAnimatedLength; +} + +declare var SVGLinearGradientElement: { + prototype: SVGLinearGradientElement; + new(): SVGLinearGradientElement; +} + +interface SVGMarkerElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox { + markerHeight: SVGAnimatedLength; + markerUnits: SVGAnimatedEnumeration; + markerWidth: SVGAnimatedLength; + orientAngle: SVGAnimatedAngle; + orientType: SVGAnimatedEnumeration; + refX: SVGAnimatedLength; + refY: SVGAnimatedLength; + setOrientToAngle(angle: SVGAngle): void; + setOrientToAuto(): void; + SVG_MARKERUNITS_STROKEWIDTH: number; + SVG_MARKERUNITS_UNKNOWN: number; + SVG_MARKERUNITS_USERSPACEONUSE: number; + SVG_MARKER_ORIENT_ANGLE: number; + SVG_MARKER_ORIENT_AUTO: number; + SVG_MARKER_ORIENT_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGMarkerElement: { + prototype: SVGMarkerElement; + new(): SVGMarkerElement; + SVG_MARKERUNITS_STROKEWIDTH: number; + SVG_MARKERUNITS_UNKNOWN: number; + SVG_MARKERUNITS_USERSPACEONUSE: number; + SVG_MARKER_ORIENT_ANGLE: number; + SVG_MARKER_ORIENT_AUTO: number; + SVG_MARKER_ORIENT_UNKNOWN: number; +} + +interface SVGMaskElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes { + height: SVGAnimatedLength; + maskContentUnits: SVGAnimatedEnumeration; + maskUnits: SVGAnimatedEnumeration; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGMaskElement: { + prototype: SVGMaskElement; + new(): SVGMaskElement; +} + +interface SVGMatrix { a: number; - d: number; - m32: number; - m41: number; - m11: number; - f: number; - e: number; - m23: number; - m14: number; - m33: number; - m22: number; - m21: number; - c: number; - m12: number; b: number; - m42: number; - m31: number; - m43: number; - m13: number; - m44: number; - multiply(secondMatrix: MSCSSMatrix): MSCSSMatrix; - skewY(angle: number): MSCSSMatrix; - setMatrixValue(value: string): void; - inverse(): MSCSSMatrix; - rotateAxisAngle(x: number, y: number, z: number, angle: number): MSCSSMatrix; - toString(): string; - rotate(angleX: number, angleY?: number, angleZ?: number): MSCSSMatrix; - translate(x: number, y: number, z?: number): MSCSSMatrix; - scale(scaleX: number, scaleY?: number, scaleZ?: number): MSCSSMatrix; - skewX(angle: number): MSCSSMatrix; -} -declare var MSCSSMatrix: { - prototype: MSCSSMatrix; - new(text?: string): MSCSSMatrix; + c: number; + d: number; + e: number; + f: number; + flipX(): SVGMatrix; + flipY(): SVGMatrix; + inverse(): SVGMatrix; + multiply(secondMatrix: SVGMatrix): SVGMatrix; + rotate(angle: number): SVGMatrix; + rotateFromVector(x: number, y: number): SVGMatrix; + scale(scaleFactor: number): SVGMatrix; + scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix; + skewX(angle: number): SVGMatrix; + skewY(angle: number): SVGMatrix; + translate(x: number, y: number): SVGMatrix; } -interface Worker extends AbstractWorker { - onmessage: (ev: MessageEvent) => any; - postMessage(message: any, ports?: any): void; - terminate(): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Worker: { - prototype: Worker; - new(stringUrl: string): Worker; +declare var SVGMatrix: { + prototype: SVGMatrix; + new(): SVGMatrix; } -interface MSExecAtPriorityFunctionCallback { - (...args: any[]): any; +interface SVGMetadataElement extends SVGElement { } -interface MSGraphicsTrust { - status: string; - constrictionActive: boolean; -} -declare var MSGraphicsTrust: { - prototype: MSGraphicsTrust; - new(): MSGraphicsTrust; +declare var SVGMetadataElement: { + prototype: SVGMetadataElement; + new(): SVGMetadataElement; } -interface SubtleCrypto { - unwrapKey(wrappedKey: ArrayBufferView, keyAlgorithm: any, keyEncryptionKey: Key, extractable?: boolean, keyUsages?: string[]): KeyOperation; - encrypt(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; - importKey(format: string, keyData: ArrayBufferView, algorithm: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; - wrapKey(key: Key, keyEncryptionKey: Key, keyWrappingAlgorithm: any): KeyOperation; - verify(algorithm: any, key: Key, signature: ArrayBufferView, buffer?: ArrayBufferView): CryptoOperation; - deriveKey(algorithm: any, baseKey: Key, derivedKeyType: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; - digest(algorithm: any, buffer?: ArrayBufferView): CryptoOperation; - exportKey(format: string, key: Key): KeyOperation; - generateKey(algorithm: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; - sign(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; - decrypt(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; -} -declare var SubtleCrypto: { - prototype: SubtleCrypto; - new(): SubtleCrypto; +interface SVGNumber { + value: number; } -interface Crypto extends RandomSource { - subtle: SubtleCrypto; -} -declare var Crypto: { - prototype: Crypto; - new(): Crypto; +declare var SVGNumber: { + prototype: SVGNumber; + new(): SVGNumber; } -interface VideoPlaybackQuality { - totalFrameDelay: number; - creationTime: number; - totalVideoFrames: number; - droppedVideoFrames: number; -} -declare var VideoPlaybackQuality: { - prototype: VideoPlaybackQuality; - new(): VideoPlaybackQuality; +interface SVGNumberList { + numberOfItems: number; + appendItem(newItem: SVGNumber): SVGNumber; + clear(): void; + getItem(index: number): SVGNumber; + initialize(newItem: SVGNumber): SVGNumber; + insertItemBefore(newItem: SVGNumber, index: number): SVGNumber; + removeItem(index: number): SVGNumber; + replaceItem(newItem: SVGNumber, index: number): SVGNumber; } -interface GlobalEventHandlers { - onpointerenter: (ev: PointerEvent) => any; - onpointerout: (ev: PointerEvent) => any; - onpointerdown: (ev: PointerEvent) => any; - onpointerup: (ev: PointerEvent) => any; - onpointercancel: (ev: PointerEvent) => any; - onpointerover: (ev: PointerEvent) => any; - onpointermove: (ev: PointerEvent) => any; - onpointerleave: (ev: PointerEvent) => any; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +declare var SVGNumberList: { + prototype: SVGNumberList; + new(): SVGNumberList; } -interface Key { - algorithm: Algorithm; - type: string; - extractable: boolean; - keyUsage: string[]; -} -declare var Key: { - prototype: Key; - new(): Key; +interface SVGPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPathData { + createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs; + createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel; + createSVGPathSegClosePath(): SVGPathSegClosePath; + createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs; + createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel; + createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs; + createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel; + createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs; + createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel; + createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs; + createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel; + createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs; + createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs; + createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel; + createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel; + createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs; + createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel; + createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs; + createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel; + getPathSegAtLength(distance: number): number; + getPointAtLength(distance: number): SVGPoint; + getTotalLength(): number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface DeviceAcceleration { - y: number; +declare var SVGPathElement: { + prototype: SVGPathElement; + new(): SVGPathElement; +} + +interface SVGPathSeg { + pathSegType: number; + pathSegTypeAsLetter: string; + PATHSEG_ARC_ABS: number; + PATHSEG_ARC_REL: number; + PATHSEG_CLOSEPATH: number; + PATHSEG_CURVETO_CUBIC_ABS: number; + PATHSEG_CURVETO_CUBIC_REL: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; + PATHSEG_CURVETO_QUADRATIC_ABS: number; + PATHSEG_CURVETO_QUADRATIC_REL: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; + PATHSEG_LINETO_ABS: number; + PATHSEG_LINETO_HORIZONTAL_ABS: number; + PATHSEG_LINETO_HORIZONTAL_REL: number; + PATHSEG_LINETO_REL: number; + PATHSEG_LINETO_VERTICAL_ABS: number; + PATHSEG_LINETO_VERTICAL_REL: number; + PATHSEG_MOVETO_ABS: number; + PATHSEG_MOVETO_REL: number; + PATHSEG_UNKNOWN: number; +} + +declare var SVGPathSeg: { + prototype: SVGPathSeg; + new(): SVGPathSeg; + PATHSEG_ARC_ABS: number; + PATHSEG_ARC_REL: number; + PATHSEG_CLOSEPATH: number; + PATHSEG_CURVETO_CUBIC_ABS: number; + PATHSEG_CURVETO_CUBIC_REL: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; + PATHSEG_CURVETO_QUADRATIC_ABS: number; + PATHSEG_CURVETO_QUADRATIC_REL: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; + PATHSEG_LINETO_ABS: number; + PATHSEG_LINETO_HORIZONTAL_ABS: number; + PATHSEG_LINETO_HORIZONTAL_REL: number; + PATHSEG_LINETO_REL: number; + PATHSEG_LINETO_VERTICAL_ABS: number; + PATHSEG_LINETO_VERTICAL_REL: number; + PATHSEG_MOVETO_ABS: number; + PATHSEG_MOVETO_REL: number; + PATHSEG_UNKNOWN: number; +} + +interface SVGPathSegArcAbs extends SVGPathSeg { + angle: number; + largeArcFlag: boolean; + r1: number; + r2: number; + sweepFlag: boolean; x: number; - z: number; -} -declare var DeviceAcceleration: { - prototype: DeviceAcceleration; - new(): DeviceAcceleration; + y: number; } -interface HTMLAllCollection extends HTMLCollection { - namedItem(name: string): Element; - // [name: string]: Element; -} -declare var HTMLAllCollection: { - prototype: HTMLAllCollection; - new(): HTMLAllCollection; +declare var SVGPathSegArcAbs: { + prototype: SVGPathSegArcAbs; + new(): SVGPathSegArcAbs; } -interface AesGcmEncryptResult { - ciphertext: ArrayBuffer; - tag: ArrayBuffer; -} -declare var AesGcmEncryptResult: { - prototype: AesGcmEncryptResult; - new(): AesGcmEncryptResult; +interface SVGPathSegArcRel extends SVGPathSeg { + angle: number; + largeArcFlag: boolean; + r1: number; + r2: number; + sweepFlag: boolean; + x: number; + y: number; } -interface NavigationCompletedEvent extends NavigationEvent { - webErrorStatus: number; - isSuccess: boolean; -} -declare var NavigationCompletedEvent: { - prototype: NavigationCompletedEvent; - new(): NavigationCompletedEvent; +declare var SVGPathSegArcRel: { + prototype: SVGPathSegArcRel; + new(): SVGPathSegArcRel; } -interface MutationRecord { - oldValue: string; - previousSibling: Node; - addedNodes: NodeList; - attributeName: string; - removedNodes: NodeList; - target: Node; - nextSibling: Node; - attributeNamespace: string; - type: string; -} -declare var MutationRecord: { - prototype: MutationRecord; - new(): MutationRecord; +interface SVGPathSegClosePath extends SVGPathSeg { } -interface MimeTypeArray { - length: number; - item(index: number): Plugin; - [index: number]: Plugin; - namedItem(type: string): Plugin; - // [type: string]: Plugin; -} -declare var MimeTypeArray: { - prototype: MimeTypeArray; - new(): MimeTypeArray; +declare var SVGPathSegClosePath: { + prototype: SVGPathSegClosePath; + new(): SVGPathSegClosePath; } -interface KeyOperation extends EventTarget { - oncomplete: (ev: Event) => any; - onerror: (ev: ErrorEvent) => any; - result: any; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var KeyOperation: { - prototype: KeyOperation; - new(): KeyOperation; +interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg { + x: number; + x1: number; + x2: number; + y: number; + y1: number; + y2: number; } -interface DOMStringMap { -} -declare var DOMStringMap: { - prototype: DOMStringMap; - new(): DOMStringMap; +declare var SVGPathSegCurvetoCubicAbs: { + prototype: SVGPathSegCurvetoCubicAbs; + new(): SVGPathSegCurvetoCubicAbs; } -interface DeviceOrientationEvent extends Event { - gamma: number; - alpha: number; - absolute: boolean; - beta: number; - initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number, beta: number, gamma: number, absolute: boolean): void; -} -declare var DeviceOrientationEvent: { - prototype: DeviceOrientationEvent; - new(): DeviceOrientationEvent; +interface SVGPathSegCurvetoCubicRel extends SVGPathSeg { + x: number; + x1: number; + x2: number; + y: number; + y1: number; + y2: number; } -interface MSMediaKeys { - keySystem: string; - createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession; -} -declare var MSMediaKeys: { - prototype: MSMediaKeys; - new(keySystem: string): MSMediaKeys; - isTypeSupported(keySystem: string, type?: string): boolean; +declare var SVGPathSegCurvetoCubicRel: { + prototype: SVGPathSegCurvetoCubicRel; + new(): SVGPathSegCurvetoCubicRel; } -interface MSMediaKeyMessageEvent extends Event { - destinationURL: string; - message: Uint8Array; -} -declare var MSMediaKeyMessageEvent: { - prototype: MSMediaKeyMessageEvent; - new(): MSMediaKeyMessageEvent; +interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg { + x: number; + x2: number; + y: number; + y2: number; } -interface MSHTMLWebViewElement extends HTMLElement { - documentTitle: string; - width: number; - src: string; - canGoForward: boolean; +declare var SVGPathSegCurvetoCubicSmoothAbs: { + prototype: SVGPathSegCurvetoCubicSmoothAbs; + new(): SVGPathSegCurvetoCubicSmoothAbs; +} + +interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { + x: number; + x2: number; + y: number; + y2: number; +} + +declare var SVGPathSegCurvetoCubicSmoothRel: { + prototype: SVGPathSegCurvetoCubicSmoothRel; + new(): SVGPathSegCurvetoCubicSmoothRel; +} + +interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg { + x: number; + x1: number; + y: number; + y1: number; +} + +declare var SVGPathSegCurvetoQuadraticAbs: { + prototype: SVGPathSegCurvetoQuadraticAbs; + new(): SVGPathSegCurvetoQuadraticAbs; +} + +interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { + x: number; + x1: number; + y: number; + y1: number; +} + +declare var SVGPathSegCurvetoQuadraticRel: { + prototype: SVGPathSegCurvetoQuadraticRel; + new(): SVGPathSegCurvetoQuadraticRel; +} + +interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegCurvetoQuadraticSmoothAbs: { + prototype: SVGPathSegCurvetoQuadraticSmoothAbs; + new(): SVGPathSegCurvetoQuadraticSmoothAbs; +} + +interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegCurvetoQuadraticSmoothRel: { + prototype: SVGPathSegCurvetoQuadraticSmoothRel; + new(): SVGPathSegCurvetoQuadraticSmoothRel; +} + +interface SVGPathSegLinetoAbs extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegLinetoAbs: { + prototype: SVGPathSegLinetoAbs; + new(): SVGPathSegLinetoAbs; +} + +interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg { + x: number; +} + +declare var SVGPathSegLinetoHorizontalAbs: { + prototype: SVGPathSegLinetoHorizontalAbs; + new(): SVGPathSegLinetoHorizontalAbs; +} + +interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg { + x: number; +} + +declare var SVGPathSegLinetoHorizontalRel: { + prototype: SVGPathSegLinetoHorizontalRel; + new(): SVGPathSegLinetoHorizontalRel; +} + +interface SVGPathSegLinetoRel extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegLinetoRel: { + prototype: SVGPathSegLinetoRel; + new(): SVGPathSegLinetoRel; +} + +interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg { + y: number; +} + +declare var SVGPathSegLinetoVerticalAbs: { + prototype: SVGPathSegLinetoVerticalAbs; + new(): SVGPathSegLinetoVerticalAbs; +} + +interface SVGPathSegLinetoVerticalRel extends SVGPathSeg { + y: number; +} + +declare var SVGPathSegLinetoVerticalRel: { + prototype: SVGPathSegLinetoVerticalRel; + new(): SVGPathSegLinetoVerticalRel; +} + +interface SVGPathSegList { + numberOfItems: number; + appendItem(newItem: SVGPathSeg): SVGPathSeg; + clear(): void; + getItem(index: number): SVGPathSeg; + initialize(newItem: SVGPathSeg): SVGPathSeg; + insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg; + removeItem(index: number): SVGPathSeg; + replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg; +} + +declare var SVGPathSegList: { + prototype: SVGPathSegList; + new(): SVGPathSegList; +} + +interface SVGPathSegMovetoAbs extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegMovetoAbs: { + prototype: SVGPathSegMovetoAbs; + new(): SVGPathSegMovetoAbs; +} + +interface SVGPathSegMovetoRel extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegMovetoRel: { + prototype: SVGPathSegMovetoRel; + new(): SVGPathSegMovetoRel; +} + +interface SVGPatternElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGURIReference, SVGUnitTypes { + height: SVGAnimatedLength; + patternContentUnits: SVGAnimatedEnumeration; + patternTransform: SVGAnimatedTransformList; + patternUnits: SVGAnimatedEnumeration; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPatternElement: { + prototype: SVGPatternElement; + new(): SVGPatternElement; +} + +interface SVGPoint { + x: number; + y: number; + matrixTransform(matrix: SVGMatrix): SVGPoint; +} + +declare var SVGPoint: { + prototype: SVGPoint; + new(): SVGPoint; +} + +interface SVGPointList { + numberOfItems: number; + appendItem(newItem: SVGPoint): SVGPoint; + clear(): void; + getItem(index: number): SVGPoint; + initialize(newItem: SVGPoint): SVGPoint; + insertItemBefore(newItem: SVGPoint, index: number): SVGPoint; + removeItem(index: number): SVGPoint; + replaceItem(newItem: SVGPoint, index: number): SVGPoint; +} + +declare var SVGPointList: { + prototype: SVGPointList; + new(): SVGPointList; +} + +interface SVGPolygonElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPolygonElement: { + prototype: SVGPolygonElement; + new(): SVGPolygonElement; +} + +interface SVGPolylineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPolylineElement: { + prototype: SVGPolylineElement; + new(): SVGPolylineElement; +} + +interface SVGPreserveAspectRatio { + align: number; + meetOrSlice: number; + SVG_MEETORSLICE_MEET: number; + SVG_MEETORSLICE_SLICE: number; + SVG_MEETORSLICE_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_NONE: number; + SVG_PRESERVEASPECTRATIO_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; + SVG_PRESERVEASPECTRATIO_XMAXYMID: number; + SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; + SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; + SVG_PRESERVEASPECTRATIO_XMIDYMID: number; + SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; + SVG_PRESERVEASPECTRATIO_XMINYMAX: number; + SVG_PRESERVEASPECTRATIO_XMINYMID: number; + SVG_PRESERVEASPECTRATIO_XMINYMIN: number; +} + +declare var SVGPreserveAspectRatio: { + prototype: SVGPreserveAspectRatio; + new(): SVGPreserveAspectRatio; + SVG_MEETORSLICE_MEET: number; + SVG_MEETORSLICE_SLICE: number; + SVG_MEETORSLICE_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_NONE: number; + SVG_PRESERVEASPECTRATIO_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; + SVG_PRESERVEASPECTRATIO_XMAXYMID: number; + SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; + SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; + SVG_PRESERVEASPECTRATIO_XMIDYMID: number; + SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; + SVG_PRESERVEASPECTRATIO_XMINYMAX: number; + SVG_PRESERVEASPECTRATIO_XMINYMID: number; + SVG_PRESERVEASPECTRATIO_XMINYMIN: number; +} + +interface SVGRadialGradientElement extends SVGGradientElement { + cx: SVGAnimatedLength; + cy: SVGAnimatedLength; + fx: SVGAnimatedLength; + fy: SVGAnimatedLength; + r: SVGAnimatedLength; +} + +declare var SVGRadialGradientElement: { + prototype: SVGRadialGradientElement; + new(): SVGRadialGradientElement; +} + +interface SVGRect { height: number; - canGoBack: boolean; - navigateWithHttpRequestMessage(requestMessage: any): void; - goBack(): void; - navigate(uri: string): void; - stop(): void; - navigateToString(contents: string): void; - captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation; - capturePreviewToBlobAsync(): MSWebViewAsyncOperation; - refresh(): void; - goForward(): void; - navigateToLocalStreamUri(source: string, streamResolver: any): void; - invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation; - buildLocalStreamUri(contentIdentifier: string, relativePath: string): string; -} -declare var MSHTMLWebViewElement: { - prototype: MSHTMLWebViewElement; - new(): MSHTMLWebViewElement; + width: number; + x: number; + y: number; } -interface NavigationEvent extends Event { - uri: string; -} -declare var NavigationEvent: { - prototype: NavigationEvent; - new(): NavigationEvent; +declare var SVGRect: { + prototype: SVGRect; + new(): SVGRect; } -interface RandomSource { - getRandomValues(array: ArrayBufferView): ArrayBufferView; +interface SVGRectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + height: SVGAnimatedLength; + rx: SVGAnimatedLength; + ry: SVGAnimatedLength; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGRectElement: { + prototype: SVGRectElement; + new(): SVGRectElement; +} + +interface SVGSVGElement extends SVGElement, DocumentEvent, SVGLocatable, SVGTests, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan { + contentScriptType: string; + contentStyleType: string; + currentScale: number; + currentTranslate: SVGPoint; + height: SVGAnimatedLength; + onabort: (ev: Event) => any; + onerror: (ev: Event) => any; + onresize: (ev: UIEvent) => any; + onscroll: (ev: UIEvent) => any; + onunload: (ev: Event) => any; + onzoom: (ev: SVGZoomEvent) => any; + pixelUnitToMillimeterX: number; + pixelUnitToMillimeterY: number; + screenPixelToMillimeterX: number; + screenPixelToMillimeterY: number; + viewport: SVGRect; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + checkEnclosure(element: SVGElement, rect: SVGRect): boolean; + checkIntersection(element: SVGElement, rect: SVGRect): boolean; + createSVGAngle(): SVGAngle; + createSVGLength(): SVGLength; + createSVGMatrix(): SVGMatrix; + createSVGNumber(): SVGNumber; + createSVGPoint(): SVGPoint; + createSVGRect(): SVGRect; + createSVGTransform(): SVGTransform; + createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; + deselectAll(): void; + forceRedraw(): void; + getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; + getCurrentTime(): number; + getElementById(elementId: string): Element; + getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeList; + getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeList; + pauseAnimations(): void; + setCurrentTime(seconds: number): void; + suspendRedraw(maxWaitMilliseconds: number): number; + unpauseAnimations(): void; + unsuspendRedraw(suspendHandleID: number): void; + unsuspendRedrawAll(): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "SVGAbort", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "SVGError", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "SVGUnload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "SVGZoom", listener: (ev: SVGZoomEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGSVGElement: { + prototype: SVGSVGElement; + new(): SVGSVGElement; +} + +interface SVGScriptElement extends SVGElement, SVGExternalResourcesRequired, SVGURIReference { + type: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGScriptElement: { + prototype: SVGScriptElement; + new(): SVGScriptElement; +} + +interface SVGStopElement extends SVGElement, SVGStylable { + offset: SVGAnimatedNumber; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGStopElement: { + prototype: SVGStopElement; + new(): SVGStopElement; +} + +interface SVGStringList { + numberOfItems: number; + appendItem(newItem: string): string; + clear(): void; + getItem(index: number): string; + initialize(newItem: string): string; + insertItemBefore(newItem: string, index: number): string; + removeItem(index: number): string; + replaceItem(newItem: string, index: number): string; +} + +declare var SVGStringList: { + prototype: SVGStringList; + new(): SVGStringList; +} + +interface SVGStyleElement extends SVGElement, SVGLangSpace { + media: string; + title: string; + type: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGStyleElement: { + prototype: SVGStyleElement; + new(): SVGStyleElement; +} + +interface SVGSwitchElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGSwitchElement: { + prototype: SVGSwitchElement; + new(): SVGSwitchElement; +} + +interface SVGSymbolElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGSymbolElement: { + prototype: SVGSymbolElement; + new(): SVGSymbolElement; +} + +interface SVGTSpanElement extends SVGTextPositioningElement { +} + +declare var SVGTSpanElement: { + prototype: SVGTSpanElement; + new(): SVGTSpanElement; +} + +interface SVGTextContentElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + lengthAdjust: SVGAnimatedEnumeration; + textLength: SVGAnimatedLength; + getCharNumAtPosition(point: SVGPoint): number; + getComputedTextLength(): number; + getEndPositionOfChar(charnum: number): SVGPoint; + getExtentOfChar(charnum: number): SVGRect; + getNumberOfChars(): number; + getRotationOfChar(charnum: number): number; + getStartPositionOfChar(charnum: number): SVGPoint; + getSubStringLength(charnum: number, nchars: number): number; + selectSubString(charnum: number, nchars: number): void; + LENGTHADJUST_SPACING: number; + LENGTHADJUST_SPACINGANDGLYPHS: number; + LENGTHADJUST_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTextContentElement: { + prototype: SVGTextContentElement; + new(): SVGTextContentElement; + LENGTHADJUST_SPACING: number; + LENGTHADJUST_SPACINGANDGLYPHS: number; + LENGTHADJUST_UNKNOWN: number; +} + +interface SVGTextElement extends SVGTextPositioningElement, SVGTransformable { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTextElement: { + prototype: SVGTextElement; + new(): SVGTextElement; +} + +interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { + method: SVGAnimatedEnumeration; + spacing: SVGAnimatedEnumeration; + startOffset: SVGAnimatedLength; + TEXTPATH_METHODTYPE_ALIGN: number; + TEXTPATH_METHODTYPE_STRETCH: number; + TEXTPATH_METHODTYPE_UNKNOWN: number; + TEXTPATH_SPACINGTYPE_AUTO: number; + TEXTPATH_SPACINGTYPE_EXACT: number; + TEXTPATH_SPACINGTYPE_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTextPathElement: { + prototype: SVGTextPathElement; + new(): SVGTextPathElement; + TEXTPATH_METHODTYPE_ALIGN: number; + TEXTPATH_METHODTYPE_STRETCH: number; + TEXTPATH_METHODTYPE_UNKNOWN: number; + TEXTPATH_SPACINGTYPE_AUTO: number; + TEXTPATH_SPACINGTYPE_EXACT: number; + TEXTPATH_SPACINGTYPE_UNKNOWN: number; +} + +interface SVGTextPositioningElement extends SVGTextContentElement { + dx: SVGAnimatedLengthList; + dy: SVGAnimatedLengthList; + rotate: SVGAnimatedNumberList; + x: SVGAnimatedLengthList; + y: SVGAnimatedLengthList; +} + +declare var SVGTextPositioningElement: { + prototype: SVGTextPositioningElement; + new(): SVGTextPositioningElement; +} + +interface SVGTitleElement extends SVGElement, SVGStylable, SVGLangSpace { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTitleElement: { + prototype: SVGTitleElement; + new(): SVGTitleElement; +} + +interface SVGTransform { + angle: number; + matrix: SVGMatrix; + type: number; + setMatrix(matrix: SVGMatrix): void; + setRotate(angle: number, cx: number, cy: number): void; + setScale(sx: number, sy: number): void; + setSkewX(angle: number): void; + setSkewY(angle: number): void; + setTranslate(tx: number, ty: number): void; + SVG_TRANSFORM_MATRIX: number; + SVG_TRANSFORM_ROTATE: number; + SVG_TRANSFORM_SCALE: number; + SVG_TRANSFORM_SKEWX: number; + SVG_TRANSFORM_SKEWY: number; + SVG_TRANSFORM_TRANSLATE: number; + SVG_TRANSFORM_UNKNOWN: number; +} + +declare var SVGTransform: { + prototype: SVGTransform; + new(): SVGTransform; + SVG_TRANSFORM_MATRIX: number; + SVG_TRANSFORM_ROTATE: number; + SVG_TRANSFORM_SCALE: number; + SVG_TRANSFORM_SKEWX: number; + SVG_TRANSFORM_SKEWY: number; + SVG_TRANSFORM_TRANSLATE: number; + SVG_TRANSFORM_UNKNOWN: number; +} + +interface SVGTransformList { + numberOfItems: number; + appendItem(newItem: SVGTransform): SVGTransform; + clear(): void; + consolidate(): SVGTransform; + createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; + getItem(index: number): SVGTransform; + initialize(newItem: SVGTransform): SVGTransform; + insertItemBefore(newItem: SVGTransform, index: number): SVGTransform; + removeItem(index: number): SVGTransform; + replaceItem(newItem: SVGTransform, index: number): SVGTransform; +} + +declare var SVGTransformList: { + prototype: SVGTransformList; + new(): SVGTransformList; +} + +interface SVGUnitTypes { + SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; + SVG_UNIT_TYPE_UNKNOWN: number; + SVG_UNIT_TYPE_USERSPACEONUSE: number; +} +declare var SVGUnitTypes: SVGUnitTypes; + +interface SVGUseElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { + animatedInstanceRoot: SVGElementInstance; + height: SVGAnimatedLength; + instanceRoot: SVGElementInstance; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGUseElement: { + prototype: SVGUseElement; + new(): SVGUseElement; +} + +interface SVGViewElement extends SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan { + viewTarget: SVGStringList; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGViewElement: { + prototype: SVGViewElement; + new(): SVGViewElement; +} + +interface SVGZoomAndPan { + SVG_ZOOMANDPAN_DISABLE: number; + SVG_ZOOMANDPAN_MAGNIFY: number; + SVG_ZOOMANDPAN_UNKNOWN: number; +} +declare var SVGZoomAndPan: SVGZoomAndPan; + +interface SVGZoomEvent extends UIEvent { + newScale: number; + newTranslate: SVGPoint; + previousScale: number; + previousTranslate: SVGPoint; + zoomRectScreen: SVGRect; +} + +declare var SVGZoomEvent: { + prototype: SVGZoomEvent; + new(): SVGZoomEvent; +} + +interface Screen extends EventTarget { + availHeight: number; + availWidth: number; + bufferDepth: number; + colorDepth: number; + deviceXDPI: number; + deviceYDPI: number; + fontSmoothingEnabled: boolean; + height: number; + logicalXDPI: number; + logicalYDPI: number; + msOrientation: string; + onmsorientationchange: (ev: Event) => any; + pixelDepth: number; + systemXDPI: number; + systemYDPI: number; + width: number; + msLockOrientation(orientations: string): boolean; + msLockOrientation(orientations: string[]): boolean; + msUnlockOrientation(): void; + addEventListener(type: "MSOrientationChange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Screen: { + prototype: Screen; + new(): Screen; +} + +interface ScriptNotifyEvent extends Event { + callingUri: string; + value: string; +} + +declare var ScriptNotifyEvent: { + prototype: ScriptNotifyEvent; + new(): ScriptNotifyEvent; +} + +interface ScriptProcessorNode extends AudioNode { + bufferSize: number; + onaudioprocess: (ev: AudioProcessingEvent) => any; + addEventListener(type: "audioprocess", listener: (ev: AudioProcessingEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var ScriptProcessorNode: { + prototype: ScriptProcessorNode; + new(): ScriptProcessorNode; +} + +interface Selection { + anchorNode: Node; + anchorOffset: number; + focusNode: Node; + focusOffset: number; + isCollapsed: boolean; + rangeCount: number; + type: string; + addRange(range: Range): void; + collapse(parentNode: Node, offset: number): void; + collapseToEnd(): void; + collapseToStart(): void; + containsNode(node: Node, partlyContained: boolean): boolean; + deleteFromDocument(): void; + empty(): void; + extend(newNode: Node, offset: number): void; + getRangeAt(index: number): Range; + removeAllRanges(): void; + removeRange(range: Range): void; + selectAllChildren(parentNode: Node): void; + setBaseAndExtent(baseNode: Node, baseOffset: number, extentNode: Node, extentOffset: number): void; + toString(): string; +} + +declare var Selection: { + prototype: Selection; + new(): Selection; } interface SourceBuffer extends EventTarget { - updating: boolean; - appendWindowStart: number; appendWindowEnd: number; - buffered: TimeRanges; - timestampOffset: number; + appendWindowStart: number; audioTracks: AudioTrackList; - appendBuffer(data: ArrayBuffer): void; - remove(start: number, end: number): void; + buffered: TimeRanges; + mode: string; + timestampOffset: number; + updating: boolean; + videoTracks: VideoTrackList; abort(): void; + appendBuffer(data: ArrayBuffer): void; + appendBuffer(data: ArrayBufferView): void; appendStream(stream: MSStream, maxSize?: number): void; + remove(start: number, end: number): void; } + declare var SourceBuffer: { prototype: SourceBuffer; new(): SourceBuffer; } -interface MSInputMethodContext extends EventTarget { - oncandidatewindowshow: (ev: any) => any; - target: HTMLElement; - compositionStartOffset: number; - oncandidatewindowhide: (ev: any) => any; - oncandidatewindowupdate: (ev: any) => any; - compositionEndOffset: number; - getCompositionAlternatives(): string[]; - getCandidateWindowClientRect(): ClientRect; - hasComposition(): boolean; - isCandidateWindowVisible(): boolean; - addEventListener(type: "candidatewindowshow", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "candidatewindowhide", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "candidatewindowupdate", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var MSInputMethodContext: { - prototype: MSInputMethodContext; - new(): MSInputMethodContext; -} - -interface DeviceRotationRate { - gamma: number; - alpha: number; - beta: number; -} -declare var DeviceRotationRate: { - prototype: DeviceRotationRate; - new(): DeviceRotationRate; -} - -interface PluginArray { - length: number; - refresh(reload?: boolean): void; - item(index: number): Plugin; - [index: number]: Plugin; - namedItem(name: string): Plugin; - // [name: string]: Plugin; -} -declare var PluginArray: { - prototype: PluginArray; - new(): PluginArray; -} - -interface MSMediaKeyError { - systemCode: number; - code: number; - MS_MEDIA_KEYERR_SERVICE: number; - MS_MEDIA_KEYERR_HARDWARECHANGE: number; - MS_MEDIA_KEYERR_OUTPUT: number; - MS_MEDIA_KEYERR_DOMAIN: number; - MS_MEDIA_KEYERR_UNKNOWN: number; - MS_MEDIA_KEYERR_CLIENT: number; -} -declare var MSMediaKeyError: { - prototype: MSMediaKeyError; - new(): MSMediaKeyError; - MS_MEDIA_KEYERR_SERVICE: number; - MS_MEDIA_KEYERR_HARDWARECHANGE: number; - MS_MEDIA_KEYERR_OUTPUT: number; - MS_MEDIA_KEYERR_DOMAIN: number; - MS_MEDIA_KEYERR_UNKNOWN: number; - MS_MEDIA_KEYERR_CLIENT: number; -} - -interface Plugin { - length: number; - filename: string; - version: string; - name: string; - description: string; - item(index: number): MimeType; - [index: number]: MimeType; - namedItem(type: string): MimeType; - // [type: string]: MimeType; -} -declare var Plugin: { - prototype: Plugin; - new(): Plugin; -} - -interface MediaSource extends EventTarget { - sourceBuffers: SourceBufferList; - duration: number; - readyState: string; - activeSourceBuffers: SourceBufferList; - addSourceBuffer(type: string): SourceBuffer; - endOfStream(error?: string): void; - removeSourceBuffer(sourceBuffer: SourceBuffer): void; -} -declare var MediaSource: { - prototype: MediaSource; - new(): MediaSource; - isTypeSupported(type: string): boolean; -} - interface SourceBufferList extends EventTarget { length: number; item(index: number): SourceBuffer; [index: number]: SourceBuffer; } + declare var SourceBufferList: { prototype: SourceBufferList; new(): SourceBufferList; } -interface XMLDocument extends Document { -} -declare var XMLDocument: { - prototype: XMLDocument; - new(): XMLDocument; +interface StereoPannerNode extends AudioNode { + pan: AudioParam; } -interface DeviceMotionEvent extends Event { - rotationRate: DeviceRotationRate; - acceleration: DeviceAcceleration; - interval: number; - accelerationIncludingGravity: DeviceAcceleration; - initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict, accelerationIncludingGravity: DeviceAccelerationDict, rotationRate: DeviceRotationRateDict, interval: number): void; -} -declare var DeviceMotionEvent: { - prototype: DeviceMotionEvent; - new(): DeviceMotionEvent; +declare var StereoPannerNode: { + prototype: StereoPannerNode; + new(): StereoPannerNode; } -interface MimeType { - enabledPlugin: Plugin; - suffixes: string; +interface Storage { + length: number; + clear(): void; + getItem(key: string): any; + key(index: number): string; + removeItem(key: string): void; + setItem(key: string, data: string): void; + [key: string]: any; + [index: number]: string; +} + +declare var Storage: { + prototype: Storage; + new(): Storage; +} + +interface StorageEvent extends Event { + key: string; + newValue: any; + oldValue: any; + storageArea: Storage; + url: string; + initStorageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, keyArg: string, oldValueArg: any, newValueArg: any, urlArg: string, storageAreaArg: Storage): void; +} + +declare var StorageEvent: { + prototype: StorageEvent; + new(): StorageEvent; +} + +interface StyleMedia { type: string; - description: string; -} -declare var MimeType: { - prototype: MimeType; - new(): MimeType; + matchMedium(mediaquery: string): boolean; } -interface PointerEvent extends MouseEvent { +declare var StyleMedia: { + prototype: StyleMedia; + new(): StyleMedia; +} + +interface StyleSheet { + disabled: boolean; + href: string; + media: MediaList; + ownerNode: Node; + parentStyleSheet: StyleSheet; + title: string; + type: string; +} + +declare var StyleSheet: { + prototype: StyleSheet; + new(): StyleSheet; +} + +interface StyleSheetList { + length: number; + item(index?: number): StyleSheet; + [index: number]: StyleSheet; +} + +declare var StyleSheetList: { + prototype: StyleSheetList; + new(): StyleSheetList; +} + +interface StyleSheetPageList { + length: number; + item(index: number): CSSPageRule; + [index: number]: CSSPageRule; +} + +declare var StyleSheetPageList: { + prototype: StyleSheetPageList; + new(): StyleSheetPageList; +} + +interface SubtleCrypto { + decrypt(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; + decrypt(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; + deriveBits(algorithm: string, baseKey: CryptoKey, length: number): any; + deriveBits(algorithm: Algorithm, baseKey: CryptoKey, length: number): any; + deriveKey(algorithm: string, baseKey: CryptoKey, derivedKeyType: string, extractable: boolean, keyUsages: string[]): any; + deriveKey(algorithm: string, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: boolean, keyUsages: string[]): any; + deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: string, extractable: boolean, keyUsages: string[]): any; + deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: boolean, keyUsages: string[]): any; + digest(algorithm: string, data: ArrayBufferView): any; + digest(algorithm: Algorithm, data: ArrayBufferView): any; + encrypt(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; + encrypt(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; + exportKey(format: string, key: CryptoKey): any; + generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): any; + generateKey(algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + importKey(format: string, keyData: ArrayBufferView, algorithm: string, extractable: boolean, keyUsages: string[]): any; + importKey(format: string, keyData: ArrayBufferView, algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + sign(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; + sign(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + verify(algorithm: string, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): any; + verify(algorithm: Algorithm, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): any; + wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string): any; + wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: Algorithm): any; +} + +declare var SubtleCrypto: { + prototype: SubtleCrypto; + new(): SubtleCrypto; +} + +interface Text extends CharacterData { + wholeText: string; + replaceWholeText(content: string): Text; + splitText(offset: number): Text; +} + +declare var Text: { + prototype: Text; + new(): Text; +} + +interface TextEvent extends UIEvent { + data: string; + inputMethod: number; + locale: string; + initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void; + DOM_INPUT_METHOD_DROP: number; + DOM_INPUT_METHOD_HANDWRITING: number; + DOM_INPUT_METHOD_IME: number; + DOM_INPUT_METHOD_KEYBOARD: number; + DOM_INPUT_METHOD_MULTIMODAL: number; + DOM_INPUT_METHOD_OPTION: number; + DOM_INPUT_METHOD_PASTE: number; + DOM_INPUT_METHOD_SCRIPT: number; + DOM_INPUT_METHOD_UNKNOWN: number; + DOM_INPUT_METHOD_VOICE: number; +} + +declare var TextEvent: { + prototype: TextEvent; + new(): TextEvent; + DOM_INPUT_METHOD_DROP: number; + DOM_INPUT_METHOD_HANDWRITING: number; + DOM_INPUT_METHOD_IME: number; + DOM_INPUT_METHOD_KEYBOARD: number; + DOM_INPUT_METHOD_MULTIMODAL: number; + DOM_INPUT_METHOD_OPTION: number; + DOM_INPUT_METHOD_PASTE: number; + DOM_INPUT_METHOD_SCRIPT: number; + DOM_INPUT_METHOD_UNKNOWN: number; + DOM_INPUT_METHOD_VOICE: number; +} + +interface TextMetrics { width: number; - rotation: number; - pressure: number; - pointerType: any; - isPrimary: boolean; - tiltY: number; - height: number; - intermediatePoints: any; - currentPoint: any; - tiltX: number; - hwTimestamp: number; - pointerId: number; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; -} -declare var PointerEvent: { - prototype: PointerEvent; - new(): PointerEvent; } -interface MSDocumentExtensions { - captureEvents(): void; - releaseEvents(): void; +declare var TextMetrics: { + prototype: TextMetrics; + new(): TextMetrics; } -interface MutationObserver { - observe(target: Node, options: MutationObserverInit): void; - takeRecords(): MutationRecord[]; - disconnect(): void; -} -declare var MutationObserver: { - prototype: MutationObserver; - new (callback: (arr: MutationRecord[], observer: MutationObserver)=>any): MutationObserver; +interface TextRange { + boundingHeight: number; + boundingLeft: number; + boundingTop: number; + boundingWidth: number; + htmlText: string; + offsetLeft: number; + offsetTop: number; + text: string; + collapse(start?: boolean): void; + compareEndPoints(how: string, sourceRange: TextRange): number; + duplicate(): TextRange; + execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; + execCommandShowHelp(cmdID: string): boolean; + expand(Unit: string): boolean; + findText(string: string, count?: number, flags?: number): boolean; + getBookmark(): string; + getBoundingClientRect(): ClientRect; + getClientRects(): ClientRectList; + inRange(range: TextRange): boolean; + isEqual(range: TextRange): boolean; + move(unit: string, count?: number): number; + moveEnd(unit: string, count?: number): number; + moveStart(unit: string, count?: number): number; + moveToBookmark(bookmark: string): boolean; + moveToElementText(element: Element): void; + moveToPoint(x: number, y: number): void; + parentElement(): Element; + pasteHTML(html: string): void; + queryCommandEnabled(cmdID: string): boolean; + queryCommandIndeterm(cmdID: string): boolean; + queryCommandState(cmdID: string): boolean; + queryCommandSupported(cmdID: string): boolean; + queryCommandText(cmdID: string): string; + queryCommandValue(cmdID: string): any; + scrollIntoView(fStart?: boolean): void; + select(): void; + setEndPoint(how: string, SourceRange: TextRange): void; } -interface MSWebViewAsyncOperation extends EventTarget { - target: MSHTMLWebViewElement; - oncomplete: (ev: Event) => any; - error: DOMError; - onerror: (ev: ErrorEvent) => any; +declare var TextRange: { + prototype: TextRange; + new(): TextRange; +} + +interface TextRangeCollection { + length: number; + item(index: number): TextRange; + [index: number]: TextRange; +} + +declare var TextRangeCollection: { + prototype: TextRangeCollection; + new(): TextRangeCollection; +} + +interface TextTrack extends EventTarget { + activeCues: TextTrackCueList; + cues: TextTrackCueList; + inBandMetadataTrackDispatchType: string; + kind: string; + label: string; + language: string; + mode: any; + oncuechange: (ev: Event) => any; + onerror: (ev: Event) => any; + onload: (ev: Event) => any; readyState: number; - type: number; - result: any; - start(): void; + addCue(cue: TextTrackCue): void; + removeCue(cue: TextTrackCue): void; + DISABLED: number; ERROR: number; - TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; - TYPE_INVOKE_SCRIPT: number; - COMPLETED: number; - TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; - STARTED: number; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + HIDDEN: number; + LOADED: number; + LOADING: number; + NONE: number; + SHOWING: number; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -declare var MSWebViewAsyncOperation: { - prototype: MSWebViewAsyncOperation; - new(): MSWebViewAsyncOperation; + +declare var TextTrack: { + prototype: TextTrack; + new(): TextTrack; + DISABLED: number; ERROR: number; - TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; - TYPE_INVOKE_SCRIPT: number; - COMPLETED: number; - TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; - STARTED: number; + HIDDEN: number; + LOADED: number; + LOADING: number; + NONE: number; + SHOWING: number; } -interface ScriptNotifyEvent extends Event { - value: string; - callingUri: string; -} -declare var ScriptNotifyEvent: { - prototype: ScriptNotifyEvent; - new(): ScriptNotifyEvent; +interface TextTrackCue extends EventTarget { + endTime: number; + id: string; + onenter: (ev: Event) => any; + onexit: (ev: Event) => any; + pauseOnExit: boolean; + startTime: number; + text: string; + track: TextTrack; + getCueAsHTML(): DocumentFragment; + addEventListener(type: "enter", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "exit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface PerformanceNavigationTiming extends PerformanceEntry { - redirectStart: number; - domainLookupEnd: number; - responseStart: number; - domComplete: number; - domainLookupStart: number; - loadEventStart: number; - unloadEventEnd: number; - fetchStart: number; - requestStart: number; - domInteractive: number; - navigationStart: number; - connectEnd: number; - loadEventEnd: number; - connectStart: number; - responseEnd: number; - domLoading: number; - redirectEnd: number; - redirectCount: number; - unloadEventStart: number; - domContentLoadedEventStart: number; - domContentLoadedEventEnd: number; - type: string; -} -declare var PerformanceNavigationTiming: { - prototype: PerformanceNavigationTiming; - new(): PerformanceNavigationTiming; +declare var TextTrackCue: { + prototype: TextTrackCue; + new(startTime: number, endTime: number, text: string): TextTrackCue; } -interface MSMediaKeyNeededEvent extends Event { - initData: Uint8Array; -} -declare var MSMediaKeyNeededEvent: { - prototype: MSMediaKeyNeededEvent; - new(): MSMediaKeyNeededEvent; +interface TextTrackCueList { + length: number; + getCueById(id: string): TextTrackCue; + item(index: number): TextTrackCue; + [index: number]: TextTrackCue; } -interface LongRunningScriptDetectedEvent extends Event { - stopPageScriptExecution: boolean; - executionTime: number; -} -declare var LongRunningScriptDetectedEvent: { - prototype: LongRunningScriptDetectedEvent; - new(): LongRunningScriptDetectedEvent; +declare var TextTrackCueList: { + prototype: TextTrackCueList; + new(): TextTrackCueList; } -interface MSAppView { - viewId: number; - close(): void; - postMessage(message: any, targetOrigin: string, ports?: any): void; -} -declare var MSAppView: { - prototype: MSAppView; - new(): MSAppView; +interface TextTrackList extends EventTarget { + length: number; + onaddtrack: (ev: TrackEvent) => any; + item(index: number): TextTrack; + addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: TextTrack; } -interface PerfWidgetExternal { - maxCpuSpeed: number; - independentRenderingEnabled: boolean; - irDisablingContentString: string; - irStatusAvailable: boolean; - performanceCounter: number; - averagePaintTime: number; - activeNetworkRequestCount: number; - paintRequestsPerSecond: number; - extraInformationEnabled: boolean; - performanceCounterFrequency: number; - averageFrameTime: number; - repositionWindow(x: number, y: number): void; - getRecentMemoryUsage(last: number): any; - getMemoryUsage(): number; - resizeWindow(width: number, height: number): void; - getProcessCpuUsage(): number; - removeEventListener(eventType: string, callback: (ev: any) => any): void; - getRecentCpuUsage(last: number): any; - addEventListener(eventType: string, callback: (ev: any) => any): void; - getRecentFrames(last: number): any; - getRecentPaintRequests(last: number): any; -} -declare var PerfWidgetExternal: { - prototype: PerfWidgetExternal; - new(): PerfWidgetExternal; +declare var TextTrackList: { + prototype: TextTrackList; + new(): TextTrackList; } -interface PageTransitionEvent extends Event { - persisted: boolean; -} -declare var PageTransitionEvent: { - prototype: PageTransitionEvent; - new(): PageTransitionEvent; +interface TimeRanges { + length: number; + end(index: number): number; + start(index: number): number; } -interface MutationCallback { - (mutations: MutationRecord[], observer: MutationObserver): void; +declare var TimeRanges: { + prototype: TimeRanges; + new(): TimeRanges; } -interface HTMLDocument extends Document { -} -declare var HTMLDocument: { - prototype: HTMLDocument; - new(): HTMLDocument; +interface Touch { + clientX: number; + clientY: number; + identifier: number; + pageX: number; + pageY: number; + screenX: number; + screenY: number; + target: EventTarget; } -interface KeyPair { - privateKey: Key; - publicKey: Key; -} -declare var KeyPair: { - prototype: KeyPair; - new(): KeyPair; +declare var Touch: { + prototype: Touch; + new(): Touch; } -interface MSMediaKeySession extends EventTarget { - sessionId: string; - error: MSMediaKeyError; - keySystem: string; - close(): void; - update(key: Uint8Array): void; -} -declare var MSMediaKeySession: { - prototype: MSMediaKeySession; - new(): MSMediaKeySession; +interface TouchEvent extends UIEvent { + altKey: boolean; + changedTouches: TouchList; + ctrlKey: boolean; + metaKey: boolean; + shiftKey: boolean; + targetTouches: TouchList; + touches: TouchList; } -interface UnviewableContentIdentifiedEvent extends NavigationEvent { - referrer: string; +declare var TouchEvent: { + prototype: TouchEvent; + new(): TouchEvent; } + +interface TouchList { + length: number; + item(index: number): Touch; + [index: number]: Touch; +} + +declare var TouchList: { + prototype: TouchList; + new(): TouchList; +} + +interface TrackEvent extends Event { + track: any; +} + +declare var TrackEvent: { + prototype: TrackEvent; + new(): TrackEvent; +} + +interface TransitionEvent extends Event { + elapsedTime: number; + propertyName: string; + initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void; +} + +declare var TransitionEvent: { + prototype: TransitionEvent; + new(): TransitionEvent; +} + +interface TreeWalker { + currentNode: Node; + expandEntityReferences: boolean; + filter: NodeFilter; + root: Node; + whatToShow: number; + firstChild(): Node; + lastChild(): Node; + nextNode(): Node; + nextSibling(): Node; + parentNode(): Node; + previousNode(): Node; + previousSibling(): Node; +} + +declare var TreeWalker: { + prototype: TreeWalker; + new(): TreeWalker; +} + +interface UIEvent extends Event { + detail: number; + view: Window; + initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void; +} + +declare var UIEvent: { + prototype: UIEvent; + new(type: string, eventInitDict?: UIEventInit): UIEvent; +} + +interface URL { + createObjectURL(object: any, options?: ObjectURLOptions): string; + revokeObjectURL(url: string): void; +} +declare var URL: URL; + +interface UnviewableContentIdentifiedEvent extends NavigationEventWithReferrer { + mediaType: string; +} + declare var UnviewableContentIdentifiedEvent: { prototype: UnviewableContentIdentifiedEvent; new(): UnviewableContentIdentifiedEvent; } -interface CryptoOperation extends EventTarget { - algorithm: Algorithm; - oncomplete: (ev: Event) => any; - onerror: (ev: ErrorEvent) => any; - onprogress: (ev: ProgressEvent) => any; - onabort: (ev: UIEvent) => any; - key: Key; - result: any; - abort(): void; - finish(): void; - process(buffer: ArrayBufferView): void; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var CryptoOperation: { - prototype: CryptoOperation; - new(): CryptoOperation; +interface ValidityState { + badInput: boolean; + customError: boolean; + patternMismatch: boolean; + rangeOverflow: boolean; + rangeUnderflow: boolean; + stepMismatch: boolean; + tooLong: boolean; + typeMismatch: boolean; + valid: boolean; + valueMissing: boolean; } -interface WebGLTexture extends WebGLObject { -} -declare var WebGLTexture: { - prototype: WebGLTexture; - new(): WebGLTexture; +declare var ValidityState: { + prototype: ValidityState; + new(): ValidityState; } -interface OES_texture_float { -} -declare var OES_texture_float: { - prototype: OES_texture_float; - new(): OES_texture_float; +interface VideoPlaybackQuality { + corruptedVideoFrames: number; + creationTime: number; + droppedVideoFrames: number; + totalFrameDelay: number; + totalVideoFrames: number; } -interface WebGLContextEvent extends Event { - statusMessage: string; -} -declare var WebGLContextEvent: { - prototype: WebGLContextEvent; - new(): WebGLContextEvent; +declare var VideoPlaybackQuality: { + prototype: VideoPlaybackQuality; + new(): VideoPlaybackQuality; } -interface WebGLRenderbuffer extends WebGLObject { -} -declare var WebGLRenderbuffer: { - prototype: WebGLRenderbuffer; - new(): WebGLRenderbuffer; +interface VideoTrack { + id: string; + kind: string; + label: string; + language: string; + selected: boolean; + sourceBuffer: SourceBuffer; } -interface WebGLUniformLocation { +declare var VideoTrack: { + prototype: VideoTrack; + new(): VideoTrack; } -declare var WebGLUniformLocation: { - prototype: WebGLUniformLocation; - new(): WebGLUniformLocation; + +interface VideoTrackList extends EventTarget { + length: number; + onaddtrack: (ev: TrackEvent) => any; + onchange: (ev: Event) => any; + onremovetrack: (ev: TrackEvent) => any; + selectedIndex: number; + getTrackById(id: string): VideoTrack; + item(index: number): VideoTrack; + addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "removetrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: VideoTrack; +} + +declare var VideoTrackList: { + prototype: VideoTrackList; + new(): VideoTrackList; +} + +interface WEBGL_compressed_texture_s3tc { + COMPRESSED_RGBA_S3TC_DXT1_EXT: number; + COMPRESSED_RGBA_S3TC_DXT3_EXT: number; + COMPRESSED_RGBA_S3TC_DXT5_EXT: number; + COMPRESSED_RGB_S3TC_DXT1_EXT: number; +} + +declare var WEBGL_compressed_texture_s3tc: { + prototype: WEBGL_compressed_texture_s3tc; + new(): WEBGL_compressed_texture_s3tc; + COMPRESSED_RGBA_S3TC_DXT1_EXT: number; + COMPRESSED_RGBA_S3TC_DXT3_EXT: number; + COMPRESSED_RGBA_S3TC_DXT5_EXT: number; + COMPRESSED_RGB_S3TC_DXT1_EXT: number; +} + +interface WEBGL_debug_renderer_info { + UNMASKED_RENDERER_WEBGL: number; + UNMASKED_VENDOR_WEBGL: number; +} + +declare var WEBGL_debug_renderer_info: { + prototype: WEBGL_debug_renderer_info; + new(): WEBGL_debug_renderer_info; + UNMASKED_RENDERER_WEBGL: number; + UNMASKED_VENDOR_WEBGL: number; +} + +interface WEBGL_depth_texture { + UNSIGNED_INT_24_8_WEBGL: number; +} + +declare var WEBGL_depth_texture: { + prototype: WEBGL_depth_texture; + new(): WEBGL_depth_texture; + UNSIGNED_INT_24_8_WEBGL: number; +} + +interface WaveShaperNode extends AudioNode { + curve: any; + oversample: string; +} + +declare var WaveShaperNode: { + prototype: WaveShaperNode; + new(): WaveShaperNode; } interface WebGLActiveInfo { name: string; - type: number; size: number; + type: number; } + declare var WebGLActiveInfo: { prototype: WebGLActiveInfo; new(): WebGLActiveInfo; } -interface WEBGL_compressed_texture_s3tc { - COMPRESSED_RGBA_S3TC_DXT1_EXT: number; - COMPRESSED_RGBA_S3TC_DXT5_EXT: number; - COMPRESSED_RGBA_S3TC_DXT3_EXT: number; - COMPRESSED_RGB_S3TC_DXT1_EXT: number; -} -declare var WEBGL_compressed_texture_s3tc: { - prototype: WEBGL_compressed_texture_s3tc; - new(): WEBGL_compressed_texture_s3tc; - COMPRESSED_RGBA_S3TC_DXT1_EXT: number; - COMPRESSED_RGBA_S3TC_DXT5_EXT: number; - COMPRESSED_RGBA_S3TC_DXT3_EXT: number; - COMPRESSED_RGB_S3TC_DXT1_EXT: number; -} - -interface WebGLRenderingContext { - drawingBufferWidth: number; - drawingBufferHeight: number; - canvas: HTMLCanvasElement; - getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation; - bindTexture(target: number, texture: WebGLTexture): void; - bufferData(target: number, data: ArrayBufferView, usage: number): void; - bufferData(target: number, data: ArrayBuffer, usage: number): void; - bufferData(target: number, size: number, usage: number): void; - depthMask(flag: boolean): void; - getUniform(program: WebGLProgram, location: WebGLUniformLocation): any; - vertexAttrib3fv(indx: number, values: number[]): void; - vertexAttrib3fv(indx: number, values: Float32Array): void; - linkProgram(program: WebGLProgram): void; - getSupportedExtensions(): string[]; - bufferSubData(target: number, offset: number, data: ArrayBuffer): void; - bufferSubData(target: number, offset: number, data: ArrayBufferView): void; - vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void; - polygonOffset(factor: number, units: number): void; - blendColor(red: number, green: number, blue: number, alpha: number): void; - createTexture(): WebGLTexture; - hint(target: number, mode: number): void; - getVertexAttrib(index: number, pname: number): any; - enableVertexAttribArray(index: number): void; - depthRange(zNear: number, zFar: number): void; - cullFace(mode: number): void; - createFramebuffer(): WebGLFramebuffer; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; - framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture, level: number): void; - deleteFramebuffer(framebuffer: WebGLFramebuffer): void; - colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; - compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; - getExtension(name: string): any; - createProgram(): WebGLProgram; - deleteShader(shader: WebGLShader): void; - getAttachedShaders(program: WebGLProgram): WebGLShader[]; - enable(cap: number): void; - blendEquation(mode: number): void; - texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels: ArrayBufferView): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, image: HTMLImageElement): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, canvas: HTMLCanvasElement): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, video: HTMLVideoElement): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageData): void; - createBuffer(): WebGLBuffer; - deleteTexture(texture: WebGLTexture): void; - useProgram(program: WebGLProgram): void; - vertexAttrib2fv(indx: number, values: number[]): void; - vertexAttrib2fv(indx: number, values: Float32Array): void; - checkFramebufferStatus(target: number): number; - frontFace(mode: number): void; - getBufferParameter(target: number, pname: number): any; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, image: HTMLImageElement): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, canvas: HTMLCanvasElement): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, video: HTMLVideoElement): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void; - copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; - getVertexAttribOffset(index: number, pname: number): number; - disableVertexAttribArray(index: number): void; - blendFunc(sfactor: number, dfactor: number): void; - drawElements(mode: number, count: number, type: number, offset: number): void; - isFramebuffer(framebuffer: WebGLFramebuffer): boolean; - uniform3iv(location: WebGLUniformLocation, v: number[]): void; - uniform3iv(location: WebGLUniformLocation, v: Int32Array): void; - lineWidth(width: number): void; - getShaderInfoLog(shader: WebGLShader): string; - getTexParameter(target: number, pname: number): any; - getParameter(pname: number): any; - getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat; - getContextAttributes(): WebGLContextAttributes; - vertexAttrib1f(indx: number, x: number): void; - bindFramebuffer(target: number, framebuffer: WebGLFramebuffer): void; - compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; - isContextLost(): boolean; - uniform1iv(location: WebGLUniformLocation, v: number[]): void; - uniform1iv(location: WebGLUniformLocation, v: Int32Array): void; - getRenderbufferParameter(target: number, pname: number): any; - uniform2fv(location: WebGLUniformLocation, v: number[]): void; - uniform2fv(location: WebGLUniformLocation, v: Float32Array): void; - isTexture(texture: WebGLTexture): boolean; - getError(): number; - shaderSource(shader: WebGLShader, source: string): void; - deleteRenderbuffer(renderbuffer: WebGLRenderbuffer): void; - stencilMask(mask: number): void; - bindBuffer(target: number, buffer: WebGLBuffer): void; - getAttribLocation(program: WebGLProgram, name: string): number; - uniform3i(location: WebGLUniformLocation, x: number, y: number, z: number): void; - blendEquationSeparate(modeRGB: number, modeAlpha: number): void; - clear(mask: number): void; - blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; - stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void; - readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; - scissor(x: number, y: number, width: number, height: number): void; - uniform2i(location: WebGLUniformLocation, x: number, y: number): void; - getActiveAttrib(program: WebGLProgram, index: number): WebGLActiveInfo; - getShaderSource(shader: WebGLShader): string; - generateMipmap(target: number): void; - bindAttribLocation(program: WebGLProgram, index: number, name: string): void; - uniform1fv(location: WebGLUniformLocation, v: number[]): void; - uniform1fv(location: WebGLUniformLocation, v: Float32Array): void; - uniform2iv(location: WebGLUniformLocation, v: number[]): void; - uniform2iv(location: WebGLUniformLocation, v: Int32Array): void; - stencilOp(fail: number, zfail: number, zpass: number): void; - uniform4fv(location: WebGLUniformLocation, v: number[]): void; - uniform4fv(location: WebGLUniformLocation, v: Float32Array): void; - vertexAttrib1fv(indx: number, values: number[]): void; - vertexAttrib1fv(indx: number, values: Float32Array): void; - flush(): void; - uniform4f(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; - deleteProgram(program: WebGLProgram): void; - isRenderbuffer(renderbuffer: WebGLRenderbuffer): boolean; - uniform1i(location: WebGLUniformLocation, x: number): void; - getProgramParameter(program: WebGLProgram, pname: number): any; - getActiveUniform(program: WebGLProgram, index: number): WebGLActiveInfo; - stencilFunc(func: number, ref: number, mask: number): void; - pixelStorei(pname: number, param: number): void; - disable(cap: number): void; - vertexAttrib4fv(indx: number, values: number[]): void; - vertexAttrib4fv(indx: number, values: Float32Array): void; - createRenderbuffer(): WebGLRenderbuffer; - isBuffer(buffer: WebGLBuffer): boolean; - stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; - getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any; - uniform4i(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; - sampleCoverage(value: number, invert: boolean): void; - depthFunc(func: number): void; - texParameterf(target: number, pname: number, param: number): void; - vertexAttrib3f(indx: number, x: number, y: number, z: number): void; - drawArrays(mode: number, first: number, count: number): void; - texParameteri(target: number, pname: number, param: number): void; - vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void; - getShaderParameter(shader: WebGLShader, pname: number): any; - clearDepth(depth: number): void; - activeTexture(texture: number): void; - viewport(x: number, y: number, width: number, height: number): void; - detachShader(program: WebGLProgram, shader: WebGLShader): void; - uniform1f(location: WebGLUniformLocation, x: number): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; - deleteBuffer(buffer: WebGLBuffer): void; - copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; - uniform3fv(location: WebGLUniformLocation, v: number[]): void; - uniform3fv(location: WebGLUniformLocation, v: Float32Array): void; - stencilMaskSeparate(face: number, mask: number): void; - attachShader(program: WebGLProgram, shader: WebGLShader): void; - compileShader(shader: WebGLShader): void; - clearColor(red: number, green: number, blue: number, alpha: number): void; - isShader(shader: WebGLShader): boolean; - clearStencil(s: number): void; - framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer): void; - finish(): void; - uniform2f(location: WebGLUniformLocation, x: number, y: number): void; - renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; - uniform3f(location: WebGLUniformLocation, x: number, y: number, z: number): void; - getProgramInfoLog(program: WebGLProgram): string; - validateProgram(program: WebGLProgram): void; - isEnabled(cap: number): boolean; - vertexAttrib2f(indx: number, x: number, y: number): void; - isProgram(program: WebGLProgram): boolean; - createShader(type: number): WebGLShader; - bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer): void; - uniform4iv(location: WebGLUniformLocation, v: number[]): void; - uniform4iv(location: WebGLUniformLocation, v: Int32Array): void; - DEPTH_FUNC: number; - DEPTH_COMPONENT16: number; - REPLACE: number; - REPEAT: number; - VERTEX_ATTRIB_ARRAY_ENABLED: number; - FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - STENCIL_BUFFER_BIT: number; - RENDERER: number; - STENCIL_BACK_REF: number; - TEXTURE26: number; - RGB565: number; - DITHER: number; - CONSTANT_COLOR: number; - GENERATE_MIPMAP_HINT: number; - POINTS: number; - DECR: number; - INT_VEC3: number; - TEXTURE28: number; - ONE_MINUS_CONSTANT_ALPHA: number; - BACK: number; - RENDERBUFFER_STENCIL_SIZE: number; - UNPACK_FLIP_Y_WEBGL: number; - BLEND: number; - TEXTURE9: number; - ARRAY_BUFFER_BINDING: number; - MAX_VIEWPORT_DIMS: number; - INVALID_FRAMEBUFFER_OPERATION: number; - TEXTURE: number; - TEXTURE0: number; - TEXTURE31: number; - TEXTURE24: number; - HIGH_INT: number; - RENDERBUFFER_BINDING: number; - BLEND_COLOR: number; - FASTEST: number; - STENCIL_WRITEMASK: number; - ALIASED_POINT_SIZE_RANGE: number; - TEXTURE12: number; - DST_ALPHA: number; - BLEND_EQUATION_RGB: number; - FRAMEBUFFER_COMPLETE: number; - NEAREST_MIPMAP_NEAREST: number; - VERTEX_ATTRIB_ARRAY_SIZE: number; - TEXTURE3: number; - DEPTH_WRITEMASK: number; - CONTEXT_LOST_WEBGL: number; - INVALID_VALUE: number; - TEXTURE_MAG_FILTER: number; - ONE_MINUS_CONSTANT_COLOR: number; - ONE_MINUS_SRC_ALPHA: number; - TEXTURE_CUBE_MAP_POSITIVE_Z: number; - NOTEQUAL: number; - ALPHA: number; - DEPTH_STENCIL: number; - MAX_VERTEX_UNIFORM_VECTORS: number; - DEPTH_COMPONENT: number; - RENDERBUFFER_RED_SIZE: number; - TEXTURE20: number; - RED_BITS: number; - RENDERBUFFER_BLUE_SIZE: number; - SCISSOR_BOX: number; - VENDOR: number; - FRONT_AND_BACK: number; - CONSTANT_ALPHA: number; - VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - NEAREST: number; - CULL_FACE: number; - ALIASED_LINE_WIDTH_RANGE: number; - TEXTURE19: number; - FRONT: number; - DEPTH_CLEAR_VALUE: number; - GREEN_BITS: number; - TEXTURE29: number; - TEXTURE23: number; - MAX_RENDERBUFFER_SIZE: number; - STENCIL_ATTACHMENT: number; - TEXTURE27: number; - BOOL_VEC2: number; - OUT_OF_MEMORY: number; - MIRRORED_REPEAT: number; - POLYGON_OFFSET_UNITS: number; - TEXTURE_MIN_FILTER: number; - STENCIL_BACK_PASS_DEPTH_PASS: number; - LINE_LOOP: number; - FLOAT_MAT3: number; - TEXTURE14: number; - LINEAR: number; - RGB5_A1: number; - ONE_MINUS_SRC_COLOR: number; - SAMPLE_COVERAGE_INVERT: number; - DONT_CARE: number; - FRAMEBUFFER_BINDING: number; - RENDERBUFFER_ALPHA_SIZE: number; - STENCIL_REF: number; - ZERO: number; - DECR_WRAP: number; - SAMPLE_COVERAGE: number; - STENCIL_BACK_FUNC: number; - TEXTURE30: number; - VIEWPORT: number; - STENCIL_BITS: number; - FLOAT: number; - COLOR_WRITEMASK: number; - SAMPLE_COVERAGE_VALUE: number; - TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - STENCIL_BACK_FAIL: number; - FLOAT_MAT4: number; - UNSIGNED_SHORT_4_4_4_4: number; - TEXTURE6: number; - RENDERBUFFER_WIDTH: number; - RGBA4: number; - ALWAYS: number; - BLEND_EQUATION_ALPHA: number; - COLOR_BUFFER_BIT: number; - TEXTURE_CUBE_MAP: number; - DEPTH_BUFFER_BIT: number; - STENCIL_CLEAR_VALUE: number; - BLEND_EQUATION: number; - RENDERBUFFER_GREEN_SIZE: number; - NEAREST_MIPMAP_LINEAR: number; - VERTEX_ATTRIB_ARRAY_TYPE: number; - INCR_WRAP: number; - ONE_MINUS_DST_COLOR: number; - HIGH_FLOAT: number; - BYTE: number; - FRONT_FACE: number; - SAMPLE_ALPHA_TO_COVERAGE: number; - CCW: number; - TEXTURE13: number; - MAX_VERTEX_ATTRIBS: number; - MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_WRAP_T: number; - UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - FLOAT_VEC2: number; - LUMINANCE: number; - GREATER: number; - INT_VEC2: number; - VALIDATE_STATUS: number; - FRAMEBUFFER: number; - FRAMEBUFFER_UNSUPPORTED: number; - TEXTURE5: number; - FUNC_SUBTRACT: number; - BLEND_DST_ALPHA: number; - SAMPLER_CUBE: number; - ONE_MINUS_DST_ALPHA: number; - LESS: number; - TEXTURE_CUBE_MAP_POSITIVE_X: number; - BLUE_BITS: number; - DEPTH_TEST: number; - VERTEX_ATTRIB_ARRAY_STRIDE: number; - DELETE_STATUS: number; - TEXTURE18: number; - POLYGON_OFFSET_FACTOR: number; - UNSIGNED_INT: number; - TEXTURE_2D: number; - DST_COLOR: number; - FLOAT_MAT2: number; - COMPRESSED_TEXTURE_FORMATS: number; - MAX_FRAGMENT_UNIFORM_VECTORS: number; - DEPTH_STENCIL_ATTACHMENT: number; - LUMINANCE_ALPHA: number; - CW: number; - VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - LINEAR_MIPMAP_LINEAR: number; - BUFFER_SIZE: number; - SAMPLE_BUFFERS: number; - TEXTURE15: number; - ACTIVE_TEXTURE: number; - VERTEX_SHADER: number; - TEXTURE22: number; - VERTEX_ATTRIB_ARRAY_POINTER: number; - INCR: number; - COMPILE_STATUS: number; - MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - TEXTURE7: number; - UNSIGNED_SHORT_5_5_5_1: number; - DEPTH_BITS: number; - RGBA: number; - TRIANGLE_STRIP: number; - COLOR_CLEAR_VALUE: number; - BROWSER_DEFAULT_WEBGL: number; - INVALID_ENUM: number; - SCISSOR_TEST: number; - LINE_STRIP: number; - FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - STENCIL_FUNC: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - RENDERBUFFER_HEIGHT: number; - TEXTURE8: number; - TRIANGLES: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - STENCIL_BACK_VALUE_MASK: number; - TEXTURE25: number; - RENDERBUFFER: number; - LEQUAL: number; - TEXTURE1: number; - STENCIL_INDEX8: number; - FUNC_ADD: number; - STENCIL_FAIL: number; - BLEND_SRC_ALPHA: number; - BOOL: number; - ALPHA_BITS: number; - LOW_INT: number; - TEXTURE10: number; - SRC_COLOR: number; - MAX_VARYING_VECTORS: number; - BLEND_DST_RGB: number; - TEXTURE_BINDING_CUBE_MAP: number; - STENCIL_INDEX: number; - TEXTURE_BINDING_2D: number; - MEDIUM_INT: number; - SHADER_TYPE: number; - POLYGON_OFFSET_FILL: number; - DYNAMIC_DRAW: number; - TEXTURE4: number; - STENCIL_BACK_PASS_DEPTH_FAIL: number; - STREAM_DRAW: number; - MAX_CUBE_MAP_TEXTURE_SIZE: number; - TEXTURE17: number; - TRIANGLE_FAN: number; - UNPACK_ALIGNMENT: number; - CURRENT_PROGRAM: number; - LINES: number; - INVALID_OPERATION: number; - FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - LINEAR_MIPMAP_NEAREST: number; - CLAMP_TO_EDGE: number; - RENDERBUFFER_DEPTH_SIZE: number; - TEXTURE_WRAP_S: number; - ELEMENT_ARRAY_BUFFER: number; - UNSIGNED_SHORT_5_6_5: number; - ACTIVE_UNIFORMS: number; - FLOAT_VEC3: number; - NO_ERROR: number; - ATTACHED_SHADERS: number; - DEPTH_ATTACHMENT: number; - TEXTURE11: number; - STENCIL_TEST: number; - ONE: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - STATIC_DRAW: number; - GEQUAL: number; - BOOL_VEC4: number; - COLOR_ATTACHMENT0: number; - PACK_ALIGNMENT: number; - MAX_TEXTURE_SIZE: number; - STENCIL_PASS_DEPTH_FAIL: number; - CULL_FACE_MODE: number; - TEXTURE16: number; - STENCIL_BACK_WRITEMASK: number; - SRC_ALPHA: number; - UNSIGNED_SHORT: number; - TEXTURE21: number; - FUNC_REVERSE_SUBTRACT: number; - SHADING_LANGUAGE_VERSION: number; - EQUAL: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - BOOL_VEC3: number; - SAMPLER_2D: number; - TEXTURE_CUBE_MAP_NEGATIVE_X: number; - MAX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_CUBE_MAP_POSITIVE_Y: number; - RENDERBUFFER_INTERNAL_FORMAT: number; - STENCIL_VALUE_MASK: number; - ELEMENT_ARRAY_BUFFER_BINDING: number; - ARRAY_BUFFER: number; - DEPTH_RANGE: number; - NICEST: number; - ACTIVE_ATTRIBUTES: number; - NEVER: number; - FLOAT_VEC4: number; - CURRENT_VERTEX_ATTRIB: number; - STENCIL_PASS_DEPTH_PASS: number; - INVERT: number; - LINK_STATUS: number; - RGB: number; - INT_VEC4: number; - TEXTURE2: number; - UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - MEDIUM_FLOAT: number; - SRC_ALPHA_SATURATE: number; - BUFFER_USAGE: number; - SHORT: number; - NONE: number; - UNSIGNED_BYTE: number; - INT: number; - SUBPIXEL_BITS: number; - KEEP: number; - SAMPLES: number; - FRAGMENT_SHADER: number; - LINE_WIDTH: number; - BLEND_SRC_RGB: number; - LOW_FLOAT: number; - VERSION: number; -} -declare var WebGLRenderingContext: { - prototype: WebGLRenderingContext; - new(): WebGLRenderingContext; - DEPTH_FUNC: number; - DEPTH_COMPONENT16: number; - REPLACE: number; - REPEAT: number; - VERTEX_ATTRIB_ARRAY_ENABLED: number; - FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - STENCIL_BUFFER_BIT: number; - RENDERER: number; - STENCIL_BACK_REF: number; - TEXTURE26: number; - RGB565: number; - DITHER: number; - CONSTANT_COLOR: number; - GENERATE_MIPMAP_HINT: number; - POINTS: number; - DECR: number; - INT_VEC3: number; - TEXTURE28: number; - ONE_MINUS_CONSTANT_ALPHA: number; - BACK: number; - RENDERBUFFER_STENCIL_SIZE: number; - UNPACK_FLIP_Y_WEBGL: number; - BLEND: number; - TEXTURE9: number; - ARRAY_BUFFER_BINDING: number; - MAX_VIEWPORT_DIMS: number; - INVALID_FRAMEBUFFER_OPERATION: number; - TEXTURE: number; - TEXTURE0: number; - TEXTURE31: number; - TEXTURE24: number; - HIGH_INT: number; - RENDERBUFFER_BINDING: number; - BLEND_COLOR: number; - FASTEST: number; - STENCIL_WRITEMASK: number; - ALIASED_POINT_SIZE_RANGE: number; - TEXTURE12: number; - DST_ALPHA: number; - BLEND_EQUATION_RGB: number; - FRAMEBUFFER_COMPLETE: number; - NEAREST_MIPMAP_NEAREST: number; - VERTEX_ATTRIB_ARRAY_SIZE: number; - TEXTURE3: number; - DEPTH_WRITEMASK: number; - CONTEXT_LOST_WEBGL: number; - INVALID_VALUE: number; - TEXTURE_MAG_FILTER: number; - ONE_MINUS_CONSTANT_COLOR: number; - ONE_MINUS_SRC_ALPHA: number; - TEXTURE_CUBE_MAP_POSITIVE_Z: number; - NOTEQUAL: number; - ALPHA: number; - DEPTH_STENCIL: number; - MAX_VERTEX_UNIFORM_VECTORS: number; - DEPTH_COMPONENT: number; - RENDERBUFFER_RED_SIZE: number; - TEXTURE20: number; - RED_BITS: number; - RENDERBUFFER_BLUE_SIZE: number; - SCISSOR_BOX: number; - VENDOR: number; - FRONT_AND_BACK: number; - CONSTANT_ALPHA: number; - VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - NEAREST: number; - CULL_FACE: number; - ALIASED_LINE_WIDTH_RANGE: number; - TEXTURE19: number; - FRONT: number; - DEPTH_CLEAR_VALUE: number; - GREEN_BITS: number; - TEXTURE29: number; - TEXTURE23: number; - MAX_RENDERBUFFER_SIZE: number; - STENCIL_ATTACHMENT: number; - TEXTURE27: number; - BOOL_VEC2: number; - OUT_OF_MEMORY: number; - MIRRORED_REPEAT: number; - POLYGON_OFFSET_UNITS: number; - TEXTURE_MIN_FILTER: number; - STENCIL_BACK_PASS_DEPTH_PASS: number; - LINE_LOOP: number; - FLOAT_MAT3: number; - TEXTURE14: number; - LINEAR: number; - RGB5_A1: number; - ONE_MINUS_SRC_COLOR: number; - SAMPLE_COVERAGE_INVERT: number; - DONT_CARE: number; - FRAMEBUFFER_BINDING: number; - RENDERBUFFER_ALPHA_SIZE: number; - STENCIL_REF: number; - ZERO: number; - DECR_WRAP: number; - SAMPLE_COVERAGE: number; - STENCIL_BACK_FUNC: number; - TEXTURE30: number; - VIEWPORT: number; - STENCIL_BITS: number; - FLOAT: number; - COLOR_WRITEMASK: number; - SAMPLE_COVERAGE_VALUE: number; - TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - STENCIL_BACK_FAIL: number; - FLOAT_MAT4: number; - UNSIGNED_SHORT_4_4_4_4: number; - TEXTURE6: number; - RENDERBUFFER_WIDTH: number; - RGBA4: number; - ALWAYS: number; - BLEND_EQUATION_ALPHA: number; - COLOR_BUFFER_BIT: number; - TEXTURE_CUBE_MAP: number; - DEPTH_BUFFER_BIT: number; - STENCIL_CLEAR_VALUE: number; - BLEND_EQUATION: number; - RENDERBUFFER_GREEN_SIZE: number; - NEAREST_MIPMAP_LINEAR: number; - VERTEX_ATTRIB_ARRAY_TYPE: number; - INCR_WRAP: number; - ONE_MINUS_DST_COLOR: number; - HIGH_FLOAT: number; - BYTE: number; - FRONT_FACE: number; - SAMPLE_ALPHA_TO_COVERAGE: number; - CCW: number; - TEXTURE13: number; - MAX_VERTEX_ATTRIBS: number; - MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_WRAP_T: number; - UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - FLOAT_VEC2: number; - LUMINANCE: number; - GREATER: number; - INT_VEC2: number; - VALIDATE_STATUS: number; - FRAMEBUFFER: number; - FRAMEBUFFER_UNSUPPORTED: number; - TEXTURE5: number; - FUNC_SUBTRACT: number; - BLEND_DST_ALPHA: number; - SAMPLER_CUBE: number; - ONE_MINUS_DST_ALPHA: number; - LESS: number; - TEXTURE_CUBE_MAP_POSITIVE_X: number; - BLUE_BITS: number; - DEPTH_TEST: number; - VERTEX_ATTRIB_ARRAY_STRIDE: number; - DELETE_STATUS: number; - TEXTURE18: number; - POLYGON_OFFSET_FACTOR: number; - UNSIGNED_INT: number; - TEXTURE_2D: number; - DST_COLOR: number; - FLOAT_MAT2: number; - COMPRESSED_TEXTURE_FORMATS: number; - MAX_FRAGMENT_UNIFORM_VECTORS: number; - DEPTH_STENCIL_ATTACHMENT: number; - LUMINANCE_ALPHA: number; - CW: number; - VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - LINEAR_MIPMAP_LINEAR: number; - BUFFER_SIZE: number; - SAMPLE_BUFFERS: number; - TEXTURE15: number; - ACTIVE_TEXTURE: number; - VERTEX_SHADER: number; - TEXTURE22: number; - VERTEX_ATTRIB_ARRAY_POINTER: number; - INCR: number; - COMPILE_STATUS: number; - MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - TEXTURE7: number; - UNSIGNED_SHORT_5_5_5_1: number; - DEPTH_BITS: number; - RGBA: number; - TRIANGLE_STRIP: number; - COLOR_CLEAR_VALUE: number; - BROWSER_DEFAULT_WEBGL: number; - INVALID_ENUM: number; - SCISSOR_TEST: number; - LINE_STRIP: number; - FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - STENCIL_FUNC: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - RENDERBUFFER_HEIGHT: number; - TEXTURE8: number; - TRIANGLES: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - STENCIL_BACK_VALUE_MASK: number; - TEXTURE25: number; - RENDERBUFFER: number; - LEQUAL: number; - TEXTURE1: number; - STENCIL_INDEX8: number; - FUNC_ADD: number; - STENCIL_FAIL: number; - BLEND_SRC_ALPHA: number; - BOOL: number; - ALPHA_BITS: number; - LOW_INT: number; - TEXTURE10: number; - SRC_COLOR: number; - MAX_VARYING_VECTORS: number; - BLEND_DST_RGB: number; - TEXTURE_BINDING_CUBE_MAP: number; - STENCIL_INDEX: number; - TEXTURE_BINDING_2D: number; - MEDIUM_INT: number; - SHADER_TYPE: number; - POLYGON_OFFSET_FILL: number; - DYNAMIC_DRAW: number; - TEXTURE4: number; - STENCIL_BACK_PASS_DEPTH_FAIL: number; - STREAM_DRAW: number; - MAX_CUBE_MAP_TEXTURE_SIZE: number; - TEXTURE17: number; - TRIANGLE_FAN: number; - UNPACK_ALIGNMENT: number; - CURRENT_PROGRAM: number; - LINES: number; - INVALID_OPERATION: number; - FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - LINEAR_MIPMAP_NEAREST: number; - CLAMP_TO_EDGE: number; - RENDERBUFFER_DEPTH_SIZE: number; - TEXTURE_WRAP_S: number; - ELEMENT_ARRAY_BUFFER: number; - UNSIGNED_SHORT_5_6_5: number; - ACTIVE_UNIFORMS: number; - FLOAT_VEC3: number; - NO_ERROR: number; - ATTACHED_SHADERS: number; - DEPTH_ATTACHMENT: number; - TEXTURE11: number; - STENCIL_TEST: number; - ONE: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - STATIC_DRAW: number; - GEQUAL: number; - BOOL_VEC4: number; - COLOR_ATTACHMENT0: number; - PACK_ALIGNMENT: number; - MAX_TEXTURE_SIZE: number; - STENCIL_PASS_DEPTH_FAIL: number; - CULL_FACE_MODE: number; - TEXTURE16: number; - STENCIL_BACK_WRITEMASK: number; - SRC_ALPHA: number; - UNSIGNED_SHORT: number; - TEXTURE21: number; - FUNC_REVERSE_SUBTRACT: number; - SHADING_LANGUAGE_VERSION: number; - EQUAL: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - BOOL_VEC3: number; - SAMPLER_2D: number; - TEXTURE_CUBE_MAP_NEGATIVE_X: number; - MAX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_CUBE_MAP_POSITIVE_Y: number; - RENDERBUFFER_INTERNAL_FORMAT: number; - STENCIL_VALUE_MASK: number; - ELEMENT_ARRAY_BUFFER_BINDING: number; - ARRAY_BUFFER: number; - DEPTH_RANGE: number; - NICEST: number; - ACTIVE_ATTRIBUTES: number; - NEVER: number; - FLOAT_VEC4: number; - CURRENT_VERTEX_ATTRIB: number; - STENCIL_PASS_DEPTH_PASS: number; - INVERT: number; - LINK_STATUS: number; - RGB: number; - INT_VEC4: number; - TEXTURE2: number; - UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - MEDIUM_FLOAT: number; - SRC_ALPHA_SATURATE: number; - BUFFER_USAGE: number; - SHORT: number; - NONE: number; - UNSIGNED_BYTE: number; - INT: number; - SUBPIXEL_BITS: number; - KEEP: number; - SAMPLES: number; - FRAGMENT_SHADER: number; - LINE_WIDTH: number; - BLEND_SRC_RGB: number; - LOW_FLOAT: number; - VERSION: number; -} - -interface WebGLProgram extends WebGLObject { -} -declare var WebGLProgram: { - prototype: WebGLProgram; - new(): WebGLProgram; -} - -interface OES_standard_derivatives { - FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; -} -declare var OES_standard_derivatives: { - prototype: OES_standard_derivatives; - new(): OES_standard_derivatives; - FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; -} - -interface WebGLFramebuffer extends WebGLObject { -} -declare var WebGLFramebuffer: { - prototype: WebGLFramebuffer; - new(): WebGLFramebuffer; -} - -interface WebGLShader extends WebGLObject { -} -declare var WebGLShader: { - prototype: WebGLShader; - new(): WebGLShader; -} - -interface OES_texture_float_linear { -} -declare var OES_texture_float_linear: { - prototype: OES_texture_float_linear; - new(): OES_texture_float_linear; -} - -interface WebGLObject { -} -declare var WebGLObject: { - prototype: WebGLObject; - new(): WebGLObject; -} - interface WebGLBuffer extends WebGLObject { } + declare var WebGLBuffer: { prototype: WebGLBuffer; new(): WebGLBuffer; } -interface WebGLShaderPrecisionFormat { - rangeMin: number; - rangeMax: number; - precision: number; +interface WebGLContextEvent extends Event { + statusMessage: string; } + +declare var WebGLContextEvent: { + prototype: WebGLContextEvent; + new(): WebGLContextEvent; +} + +interface WebGLFramebuffer extends WebGLObject { +} + +declare var WebGLFramebuffer: { + prototype: WebGLFramebuffer; + new(): WebGLFramebuffer; +} + +interface WebGLObject { +} + +declare var WebGLObject: { + prototype: WebGLObject; + new(): WebGLObject; +} + +interface WebGLProgram extends WebGLObject { +} + +declare var WebGLProgram: { + prototype: WebGLProgram; + new(): WebGLProgram; +} + +interface WebGLRenderbuffer extends WebGLObject { +} + +declare var WebGLRenderbuffer: { + prototype: WebGLRenderbuffer; + new(): WebGLRenderbuffer; +} + +interface WebGLRenderingContext { + canvas: HTMLCanvasElement; + drawingBufferHeight: number; + drawingBufferWidth: number; + activeTexture(texture: number): void; + attachShader(program: WebGLProgram, shader: WebGLShader): void; + bindAttribLocation(program: WebGLProgram, index: number, name: string): void; + bindBuffer(target: number, buffer: WebGLBuffer): void; + bindFramebuffer(target: number, framebuffer: WebGLFramebuffer): void; + bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer): void; + bindTexture(target: number, texture: WebGLTexture): void; + blendColor(red: number, green: number, blue: number, alpha: number): void; + blendEquation(mode: number): void; + blendEquationSeparate(modeRGB: number, modeAlpha: number): void; + blendFunc(sfactor: number, dfactor: number): void; + blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; + bufferData(target: number, size: number, usage: number): void; + bufferData(target: number, size: ArrayBufferView, usage: number): void; + bufferData(target: number, size: any, usage: number): void; + bufferSubData(target: number, offset: number, data: ArrayBufferView): void; + bufferSubData(target: number, offset: number, data: any): void; + checkFramebufferStatus(target: number): number; + clear(mask: number): void; + clearColor(red: number, green: number, blue: number, alpha: number): void; + clearDepth(depth: number): void; + clearStencil(s: number): void; + colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; + compileShader(shader: WebGLShader): void; + compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; + compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; + copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; + copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; + createBuffer(): WebGLBuffer; + createFramebuffer(): WebGLFramebuffer; + createProgram(): WebGLProgram; + createRenderbuffer(): WebGLRenderbuffer; + createShader(type: number): WebGLShader; + createTexture(): WebGLTexture; + cullFace(mode: number): void; + deleteBuffer(buffer: WebGLBuffer): void; + deleteFramebuffer(framebuffer: WebGLFramebuffer): void; + deleteProgram(program: WebGLProgram): void; + deleteRenderbuffer(renderbuffer: WebGLRenderbuffer): void; + deleteShader(shader: WebGLShader): void; + deleteTexture(texture: WebGLTexture): void; + depthFunc(func: number): void; + depthMask(flag: boolean): void; + depthRange(zNear: number, zFar: number): void; + detachShader(program: WebGLProgram, shader: WebGLShader): void; + disable(cap: number): void; + disableVertexAttribArray(index: number): void; + drawArrays(mode: number, first: number, count: number): void; + drawElements(mode: number, count: number, type: number, offset: number): void; + enable(cap: number): void; + enableVertexAttribArray(index: number): void; + finish(): void; + flush(): void; + framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer): void; + framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture, level: number): void; + frontFace(mode: number): void; + generateMipmap(target: number): void; + getActiveAttrib(program: WebGLProgram, index: number): WebGLActiveInfo; + getActiveUniform(program: WebGLProgram, index: number): WebGLActiveInfo; + getAttachedShaders(program: WebGLProgram): WebGLShader[]; + getAttribLocation(program: WebGLProgram, name: string): number; + getBufferParameter(target: number, pname: number): any; + getContextAttributes(): WebGLContextAttributes; + getError(): number; + getExtension(name: string): any; + getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any; + getParameter(pname: number): any; + getProgramInfoLog(program: WebGLProgram): string; + getProgramParameter(program: WebGLProgram, pname: number): any; + getRenderbufferParameter(target: number, pname: number): any; + getShaderInfoLog(shader: WebGLShader): string; + getShaderParameter(shader: WebGLShader, pname: number): any; + getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat; + getShaderSource(shader: WebGLShader): string; + getSupportedExtensions(): string[]; + getTexParameter(target: number, pname: number): any; + getUniform(program: WebGLProgram, location: WebGLUniformLocation): any; + getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation; + getVertexAttrib(index: number, pname: number): any; + getVertexAttribOffset(index: number, pname: number): number; + hint(target: number, mode: number): void; + isBuffer(buffer: WebGLBuffer): boolean; + isContextLost(): boolean; + isEnabled(cap: number): boolean; + isFramebuffer(framebuffer: WebGLFramebuffer): boolean; + isProgram(program: WebGLProgram): boolean; + isRenderbuffer(renderbuffer: WebGLRenderbuffer): boolean; + isShader(shader: WebGLShader): boolean; + isTexture(texture: WebGLTexture): boolean; + lineWidth(width: number): void; + linkProgram(program: WebGLProgram): void; + pixelStorei(pname: number, param: number): void; + polygonOffset(factor: number, units: number): void; + readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; + renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; + sampleCoverage(value: number, invert: boolean): void; + scissor(x: number, y: number, width: number, height: number): void; + shaderSource(shader: WebGLShader, source: string): void; + stencilFunc(func: number, ref: number, mask: number): void; + stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void; + stencilMask(mask: number): void; + stencilMaskSeparate(face: number, mask: number): void; + stencilOp(fail: number, zfail: number, zpass: number): void; + stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageData): void; + texParameterf(target: number, pname: number, param: number): void; + texParameteri(target: number, pname: number, param: number): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void; + uniform1f(location: WebGLUniformLocation, x: number): void; + uniform1fv(location: WebGLUniformLocation, v: any): void; + uniform1i(location: WebGLUniformLocation, x: number): void; + uniform1iv(location: WebGLUniformLocation, v: Int32Array): void; + uniform2f(location: WebGLUniformLocation, x: number, y: number): void; + uniform2fv(location: WebGLUniformLocation, v: any): void; + uniform2i(location: WebGLUniformLocation, x: number, y: number): void; + uniform2iv(location: WebGLUniformLocation, v: Int32Array): void; + uniform3f(location: WebGLUniformLocation, x: number, y: number, z: number): void; + uniform3fv(location: WebGLUniformLocation, v: any): void; + uniform3i(location: WebGLUniformLocation, x: number, y: number, z: number): void; + uniform3iv(location: WebGLUniformLocation, v: Int32Array): void; + uniform4f(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; + uniform4fv(location: WebGLUniformLocation, v: any): void; + uniform4i(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; + uniform4iv(location: WebGLUniformLocation, v: Int32Array): void; + uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: any): void; + uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: any): void; + uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: any): void; + useProgram(program: WebGLProgram): void; + validateProgram(program: WebGLProgram): void; + vertexAttrib1f(indx: number, x: number): void; + vertexAttrib1fv(indx: number, values: any): void; + vertexAttrib2f(indx: number, x: number, y: number): void; + vertexAttrib2fv(indx: number, values: any): void; + vertexAttrib3f(indx: number, x: number, y: number, z: number): void; + vertexAttrib3fv(indx: number, values: any): void; + vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void; + vertexAttrib4fv(indx: number, values: any): void; + vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void; + viewport(x: number, y: number, width: number, height: number): void; + ACTIVE_ATTRIBUTES: number; + ACTIVE_TEXTURE: number; + ACTIVE_UNIFORMS: number; + ALIASED_LINE_WIDTH_RANGE: number; + ALIASED_POINT_SIZE_RANGE: number; + ALPHA: number; + ALPHA_BITS: number; + ALWAYS: number; + ARRAY_BUFFER: number; + ARRAY_BUFFER_BINDING: number; + ATTACHED_SHADERS: number; + BACK: number; + BLEND: number; + BLEND_COLOR: number; + BLEND_DST_ALPHA: number; + BLEND_DST_RGB: number; + BLEND_EQUATION: number; + BLEND_EQUATION_ALPHA: number; + BLEND_EQUATION_RGB: number; + BLEND_SRC_ALPHA: number; + BLEND_SRC_RGB: number; + BLUE_BITS: number; + BOOL: number; + BOOL_VEC2: number; + BOOL_VEC3: number; + BOOL_VEC4: number; + BROWSER_DEFAULT_WEBGL: number; + BUFFER_SIZE: number; + BUFFER_USAGE: number; + BYTE: number; + CCW: number; + CLAMP_TO_EDGE: number; + COLOR_ATTACHMENT0: number; + COLOR_BUFFER_BIT: number; + COLOR_CLEAR_VALUE: number; + COLOR_WRITEMASK: number; + COMPILE_STATUS: number; + COMPRESSED_TEXTURE_FORMATS: number; + CONSTANT_ALPHA: number; + CONSTANT_COLOR: number; + CONTEXT_LOST_WEBGL: number; + CULL_FACE: number; + CULL_FACE_MODE: number; + CURRENT_PROGRAM: number; + CURRENT_VERTEX_ATTRIB: number; + CW: number; + DECR: number; + DECR_WRAP: number; + DELETE_STATUS: number; + DEPTH_ATTACHMENT: number; + DEPTH_BITS: number; + DEPTH_BUFFER_BIT: number; + DEPTH_CLEAR_VALUE: number; + DEPTH_COMPONENT: number; + DEPTH_COMPONENT16: number; + DEPTH_FUNC: number; + DEPTH_RANGE: number; + DEPTH_STENCIL: number; + DEPTH_STENCIL_ATTACHMENT: number; + DEPTH_TEST: number; + DEPTH_WRITEMASK: number; + DITHER: number; + DONT_CARE: number; + DST_ALPHA: number; + DST_COLOR: number; + DYNAMIC_DRAW: number; + ELEMENT_ARRAY_BUFFER: number; + ELEMENT_ARRAY_BUFFER_BINDING: number; + EQUAL: number; + FASTEST: number; + FLOAT: number; + FLOAT_MAT2: number; + FLOAT_MAT3: number; + FLOAT_MAT4: number; + FLOAT_VEC2: number; + FLOAT_VEC3: number; + FLOAT_VEC4: number; + FRAGMENT_SHADER: number; + FRAMEBUFFER: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; + FRAMEBUFFER_BINDING: number; + FRAMEBUFFER_COMPLETE: number; + FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; + FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; + FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; + FRAMEBUFFER_UNSUPPORTED: number; + FRONT: number; + FRONT_AND_BACK: number; + FRONT_FACE: number; + FUNC_ADD: number; + FUNC_REVERSE_SUBTRACT: number; + FUNC_SUBTRACT: number; + GENERATE_MIPMAP_HINT: number; + GEQUAL: number; + GREATER: number; + GREEN_BITS: number; + HIGH_FLOAT: number; + HIGH_INT: number; + IMPLEMENTATION_COLOR_READ_FORMAT: number; + IMPLEMENTATION_COLOR_READ_TYPE: number; + INCR: number; + INCR_WRAP: number; + INT: number; + INT_VEC2: number; + INT_VEC3: number; + INT_VEC4: number; + INVALID_ENUM: number; + INVALID_FRAMEBUFFER_OPERATION: number; + INVALID_OPERATION: number; + INVALID_VALUE: number; + INVERT: number; + KEEP: number; + LEQUAL: number; + LESS: number; + LINEAR: number; + LINEAR_MIPMAP_LINEAR: number; + LINEAR_MIPMAP_NEAREST: number; + LINES: number; + LINE_LOOP: number; + LINE_STRIP: number; + LINE_WIDTH: number; + LINK_STATUS: number; + LOW_FLOAT: number; + LOW_INT: number; + LUMINANCE: number; + LUMINANCE_ALPHA: number; + MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; + MAX_CUBE_MAP_TEXTURE_SIZE: number; + MAX_FRAGMENT_UNIFORM_VECTORS: number; + MAX_RENDERBUFFER_SIZE: number; + MAX_TEXTURE_IMAGE_UNITS: number; + MAX_TEXTURE_SIZE: number; + MAX_VARYING_VECTORS: number; + MAX_VERTEX_ATTRIBS: number; + MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; + MAX_VERTEX_UNIFORM_VECTORS: number; + MAX_VIEWPORT_DIMS: number; + MEDIUM_FLOAT: number; + MEDIUM_INT: number; + MIRRORED_REPEAT: number; + NEAREST: number; + NEAREST_MIPMAP_LINEAR: number; + NEAREST_MIPMAP_NEAREST: number; + NEVER: number; + NICEST: number; + NONE: number; + NOTEQUAL: number; + NO_ERROR: number; + ONE: number; + ONE_MINUS_CONSTANT_ALPHA: number; + ONE_MINUS_CONSTANT_COLOR: number; + ONE_MINUS_DST_ALPHA: number; + ONE_MINUS_DST_COLOR: number; + ONE_MINUS_SRC_ALPHA: number; + ONE_MINUS_SRC_COLOR: number; + OUT_OF_MEMORY: number; + PACK_ALIGNMENT: number; + POINTS: number; + POLYGON_OFFSET_FACTOR: number; + POLYGON_OFFSET_FILL: number; + POLYGON_OFFSET_UNITS: number; + RED_BITS: number; + RENDERBUFFER: number; + RENDERBUFFER_ALPHA_SIZE: number; + RENDERBUFFER_BINDING: number; + RENDERBUFFER_BLUE_SIZE: number; + RENDERBUFFER_DEPTH_SIZE: number; + RENDERBUFFER_GREEN_SIZE: number; + RENDERBUFFER_HEIGHT: number; + RENDERBUFFER_INTERNAL_FORMAT: number; + RENDERBUFFER_RED_SIZE: number; + RENDERBUFFER_STENCIL_SIZE: number; + RENDERBUFFER_WIDTH: number; + RENDERER: number; + REPEAT: number; + REPLACE: number; + RGB: number; + RGB565: number; + RGB5_A1: number; + RGBA: number; + RGBA4: number; + SAMPLER_2D: number; + SAMPLER_CUBE: number; + SAMPLES: number; + SAMPLE_ALPHA_TO_COVERAGE: number; + SAMPLE_BUFFERS: number; + SAMPLE_COVERAGE: number; + SAMPLE_COVERAGE_INVERT: number; + SAMPLE_COVERAGE_VALUE: number; + SCISSOR_BOX: number; + SCISSOR_TEST: number; + SHADER_TYPE: number; + SHADING_LANGUAGE_VERSION: number; + SHORT: number; + SRC_ALPHA: number; + SRC_ALPHA_SATURATE: number; + SRC_COLOR: number; + STATIC_DRAW: number; + STENCIL_ATTACHMENT: number; + STENCIL_BACK_FAIL: number; + STENCIL_BACK_FUNC: number; + STENCIL_BACK_PASS_DEPTH_FAIL: number; + STENCIL_BACK_PASS_DEPTH_PASS: number; + STENCIL_BACK_REF: number; + STENCIL_BACK_VALUE_MASK: number; + STENCIL_BACK_WRITEMASK: number; + STENCIL_BITS: number; + STENCIL_BUFFER_BIT: number; + STENCIL_CLEAR_VALUE: number; + STENCIL_FAIL: number; + STENCIL_FUNC: number; + STENCIL_INDEX: number; + STENCIL_INDEX8: number; + STENCIL_PASS_DEPTH_FAIL: number; + STENCIL_PASS_DEPTH_PASS: number; + STENCIL_REF: number; + STENCIL_TEST: number; + STENCIL_VALUE_MASK: number; + STENCIL_WRITEMASK: number; + STREAM_DRAW: number; + SUBPIXEL_BITS: number; + TEXTURE: number; + TEXTURE0: number; + TEXTURE1: number; + TEXTURE10: number; + TEXTURE11: number; + TEXTURE12: number; + TEXTURE13: number; + TEXTURE14: number; + TEXTURE15: number; + TEXTURE16: number; + TEXTURE17: number; + TEXTURE18: number; + TEXTURE19: number; + TEXTURE2: number; + TEXTURE20: number; + TEXTURE21: number; + TEXTURE22: number; + TEXTURE23: number; + TEXTURE24: number; + TEXTURE25: number; + TEXTURE26: number; + TEXTURE27: number; + TEXTURE28: number; + TEXTURE29: number; + TEXTURE3: number; + TEXTURE30: number; + TEXTURE31: number; + TEXTURE4: number; + TEXTURE5: number; + TEXTURE6: number; + TEXTURE7: number; + TEXTURE8: number; + TEXTURE9: number; + TEXTURE_2D: number; + TEXTURE_BINDING_2D: number; + TEXTURE_BINDING_CUBE_MAP: number; + TEXTURE_CUBE_MAP: number; + TEXTURE_CUBE_MAP_NEGATIVE_X: number; + TEXTURE_CUBE_MAP_NEGATIVE_Y: number; + TEXTURE_CUBE_MAP_NEGATIVE_Z: number; + TEXTURE_CUBE_MAP_POSITIVE_X: number; + TEXTURE_CUBE_MAP_POSITIVE_Y: number; + TEXTURE_CUBE_MAP_POSITIVE_Z: number; + TEXTURE_MAG_FILTER: number; + TEXTURE_MIN_FILTER: number; + TEXTURE_WRAP_S: number; + TEXTURE_WRAP_T: number; + TRIANGLES: number; + TRIANGLE_FAN: number; + TRIANGLE_STRIP: number; + UNPACK_ALIGNMENT: number; + UNPACK_COLORSPACE_CONVERSION_WEBGL: number; + UNPACK_FLIP_Y_WEBGL: number; + UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; + UNSIGNED_BYTE: number; + UNSIGNED_INT: number; + UNSIGNED_SHORT: number; + UNSIGNED_SHORT_4_4_4_4: number; + UNSIGNED_SHORT_5_5_5_1: number; + UNSIGNED_SHORT_5_6_5: number; + VALIDATE_STATUS: number; + VENDOR: number; + VERSION: number; + VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; + VERTEX_ATTRIB_ARRAY_ENABLED: number; + VERTEX_ATTRIB_ARRAY_NORMALIZED: number; + VERTEX_ATTRIB_ARRAY_POINTER: number; + VERTEX_ATTRIB_ARRAY_SIZE: number; + VERTEX_ATTRIB_ARRAY_STRIDE: number; + VERTEX_ATTRIB_ARRAY_TYPE: number; + VERTEX_SHADER: number; + VIEWPORT: number; + ZERO: number; +} + +declare var WebGLRenderingContext: { + prototype: WebGLRenderingContext; + new(): WebGLRenderingContext; + ACTIVE_ATTRIBUTES: number; + ACTIVE_TEXTURE: number; + ACTIVE_UNIFORMS: number; + ALIASED_LINE_WIDTH_RANGE: number; + ALIASED_POINT_SIZE_RANGE: number; + ALPHA: number; + ALPHA_BITS: number; + ALWAYS: number; + ARRAY_BUFFER: number; + ARRAY_BUFFER_BINDING: number; + ATTACHED_SHADERS: number; + BACK: number; + BLEND: number; + BLEND_COLOR: number; + BLEND_DST_ALPHA: number; + BLEND_DST_RGB: number; + BLEND_EQUATION: number; + BLEND_EQUATION_ALPHA: number; + BLEND_EQUATION_RGB: number; + BLEND_SRC_ALPHA: number; + BLEND_SRC_RGB: number; + BLUE_BITS: number; + BOOL: number; + BOOL_VEC2: number; + BOOL_VEC3: number; + BOOL_VEC4: number; + BROWSER_DEFAULT_WEBGL: number; + BUFFER_SIZE: number; + BUFFER_USAGE: number; + BYTE: number; + CCW: number; + CLAMP_TO_EDGE: number; + COLOR_ATTACHMENT0: number; + COLOR_BUFFER_BIT: number; + COLOR_CLEAR_VALUE: number; + COLOR_WRITEMASK: number; + COMPILE_STATUS: number; + COMPRESSED_TEXTURE_FORMATS: number; + CONSTANT_ALPHA: number; + CONSTANT_COLOR: number; + CONTEXT_LOST_WEBGL: number; + CULL_FACE: number; + CULL_FACE_MODE: number; + CURRENT_PROGRAM: number; + CURRENT_VERTEX_ATTRIB: number; + CW: number; + DECR: number; + DECR_WRAP: number; + DELETE_STATUS: number; + DEPTH_ATTACHMENT: number; + DEPTH_BITS: number; + DEPTH_BUFFER_BIT: number; + DEPTH_CLEAR_VALUE: number; + DEPTH_COMPONENT: number; + DEPTH_COMPONENT16: number; + DEPTH_FUNC: number; + DEPTH_RANGE: number; + DEPTH_STENCIL: number; + DEPTH_STENCIL_ATTACHMENT: number; + DEPTH_TEST: number; + DEPTH_WRITEMASK: number; + DITHER: number; + DONT_CARE: number; + DST_ALPHA: number; + DST_COLOR: number; + DYNAMIC_DRAW: number; + ELEMENT_ARRAY_BUFFER: number; + ELEMENT_ARRAY_BUFFER_BINDING: number; + EQUAL: number; + FASTEST: number; + FLOAT: number; + FLOAT_MAT2: number; + FLOAT_MAT3: number; + FLOAT_MAT4: number; + FLOAT_VEC2: number; + FLOAT_VEC3: number; + FLOAT_VEC4: number; + FRAGMENT_SHADER: number; + FRAMEBUFFER: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; + FRAMEBUFFER_BINDING: number; + FRAMEBUFFER_COMPLETE: number; + FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; + FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; + FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; + FRAMEBUFFER_UNSUPPORTED: number; + FRONT: number; + FRONT_AND_BACK: number; + FRONT_FACE: number; + FUNC_ADD: number; + FUNC_REVERSE_SUBTRACT: number; + FUNC_SUBTRACT: number; + GENERATE_MIPMAP_HINT: number; + GEQUAL: number; + GREATER: number; + GREEN_BITS: number; + HIGH_FLOAT: number; + HIGH_INT: number; + IMPLEMENTATION_COLOR_READ_FORMAT: number; + IMPLEMENTATION_COLOR_READ_TYPE: number; + INCR: number; + INCR_WRAP: number; + INT: number; + INT_VEC2: number; + INT_VEC3: number; + INT_VEC4: number; + INVALID_ENUM: number; + INVALID_FRAMEBUFFER_OPERATION: number; + INVALID_OPERATION: number; + INVALID_VALUE: number; + INVERT: number; + KEEP: number; + LEQUAL: number; + LESS: number; + LINEAR: number; + LINEAR_MIPMAP_LINEAR: number; + LINEAR_MIPMAP_NEAREST: number; + LINES: number; + LINE_LOOP: number; + LINE_STRIP: number; + LINE_WIDTH: number; + LINK_STATUS: number; + LOW_FLOAT: number; + LOW_INT: number; + LUMINANCE: number; + LUMINANCE_ALPHA: number; + MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; + MAX_CUBE_MAP_TEXTURE_SIZE: number; + MAX_FRAGMENT_UNIFORM_VECTORS: number; + MAX_RENDERBUFFER_SIZE: number; + MAX_TEXTURE_IMAGE_UNITS: number; + MAX_TEXTURE_SIZE: number; + MAX_VARYING_VECTORS: number; + MAX_VERTEX_ATTRIBS: number; + MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; + MAX_VERTEX_UNIFORM_VECTORS: number; + MAX_VIEWPORT_DIMS: number; + MEDIUM_FLOAT: number; + MEDIUM_INT: number; + MIRRORED_REPEAT: number; + NEAREST: number; + NEAREST_MIPMAP_LINEAR: number; + NEAREST_MIPMAP_NEAREST: number; + NEVER: number; + NICEST: number; + NONE: number; + NOTEQUAL: number; + NO_ERROR: number; + ONE: number; + ONE_MINUS_CONSTANT_ALPHA: number; + ONE_MINUS_CONSTANT_COLOR: number; + ONE_MINUS_DST_ALPHA: number; + ONE_MINUS_DST_COLOR: number; + ONE_MINUS_SRC_ALPHA: number; + ONE_MINUS_SRC_COLOR: number; + OUT_OF_MEMORY: number; + PACK_ALIGNMENT: number; + POINTS: number; + POLYGON_OFFSET_FACTOR: number; + POLYGON_OFFSET_FILL: number; + POLYGON_OFFSET_UNITS: number; + RED_BITS: number; + RENDERBUFFER: number; + RENDERBUFFER_ALPHA_SIZE: number; + RENDERBUFFER_BINDING: number; + RENDERBUFFER_BLUE_SIZE: number; + RENDERBUFFER_DEPTH_SIZE: number; + RENDERBUFFER_GREEN_SIZE: number; + RENDERBUFFER_HEIGHT: number; + RENDERBUFFER_INTERNAL_FORMAT: number; + RENDERBUFFER_RED_SIZE: number; + RENDERBUFFER_STENCIL_SIZE: number; + RENDERBUFFER_WIDTH: number; + RENDERER: number; + REPEAT: number; + REPLACE: number; + RGB: number; + RGB565: number; + RGB5_A1: number; + RGBA: number; + RGBA4: number; + SAMPLER_2D: number; + SAMPLER_CUBE: number; + SAMPLES: number; + SAMPLE_ALPHA_TO_COVERAGE: number; + SAMPLE_BUFFERS: number; + SAMPLE_COVERAGE: number; + SAMPLE_COVERAGE_INVERT: number; + SAMPLE_COVERAGE_VALUE: number; + SCISSOR_BOX: number; + SCISSOR_TEST: number; + SHADER_TYPE: number; + SHADING_LANGUAGE_VERSION: number; + SHORT: number; + SRC_ALPHA: number; + SRC_ALPHA_SATURATE: number; + SRC_COLOR: number; + STATIC_DRAW: number; + STENCIL_ATTACHMENT: number; + STENCIL_BACK_FAIL: number; + STENCIL_BACK_FUNC: number; + STENCIL_BACK_PASS_DEPTH_FAIL: number; + STENCIL_BACK_PASS_DEPTH_PASS: number; + STENCIL_BACK_REF: number; + STENCIL_BACK_VALUE_MASK: number; + STENCIL_BACK_WRITEMASK: number; + STENCIL_BITS: number; + STENCIL_BUFFER_BIT: number; + STENCIL_CLEAR_VALUE: number; + STENCIL_FAIL: number; + STENCIL_FUNC: number; + STENCIL_INDEX: number; + STENCIL_INDEX8: number; + STENCIL_PASS_DEPTH_FAIL: number; + STENCIL_PASS_DEPTH_PASS: number; + STENCIL_REF: number; + STENCIL_TEST: number; + STENCIL_VALUE_MASK: number; + STENCIL_WRITEMASK: number; + STREAM_DRAW: number; + SUBPIXEL_BITS: number; + TEXTURE: number; + TEXTURE0: number; + TEXTURE1: number; + TEXTURE10: number; + TEXTURE11: number; + TEXTURE12: number; + TEXTURE13: number; + TEXTURE14: number; + TEXTURE15: number; + TEXTURE16: number; + TEXTURE17: number; + TEXTURE18: number; + TEXTURE19: number; + TEXTURE2: number; + TEXTURE20: number; + TEXTURE21: number; + TEXTURE22: number; + TEXTURE23: number; + TEXTURE24: number; + TEXTURE25: number; + TEXTURE26: number; + TEXTURE27: number; + TEXTURE28: number; + TEXTURE29: number; + TEXTURE3: number; + TEXTURE30: number; + TEXTURE31: number; + TEXTURE4: number; + TEXTURE5: number; + TEXTURE6: number; + TEXTURE7: number; + TEXTURE8: number; + TEXTURE9: number; + TEXTURE_2D: number; + TEXTURE_BINDING_2D: number; + TEXTURE_BINDING_CUBE_MAP: number; + TEXTURE_CUBE_MAP: number; + TEXTURE_CUBE_MAP_NEGATIVE_X: number; + TEXTURE_CUBE_MAP_NEGATIVE_Y: number; + TEXTURE_CUBE_MAP_NEGATIVE_Z: number; + TEXTURE_CUBE_MAP_POSITIVE_X: number; + TEXTURE_CUBE_MAP_POSITIVE_Y: number; + TEXTURE_CUBE_MAP_POSITIVE_Z: number; + TEXTURE_MAG_FILTER: number; + TEXTURE_MIN_FILTER: number; + TEXTURE_WRAP_S: number; + TEXTURE_WRAP_T: number; + TRIANGLES: number; + TRIANGLE_FAN: number; + TRIANGLE_STRIP: number; + UNPACK_ALIGNMENT: number; + UNPACK_COLORSPACE_CONVERSION_WEBGL: number; + UNPACK_FLIP_Y_WEBGL: number; + UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; + UNSIGNED_BYTE: number; + UNSIGNED_INT: number; + UNSIGNED_SHORT: number; + UNSIGNED_SHORT_4_4_4_4: number; + UNSIGNED_SHORT_5_5_5_1: number; + UNSIGNED_SHORT_5_6_5: number; + VALIDATE_STATUS: number; + VENDOR: number; + VERSION: number; + VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; + VERTEX_ATTRIB_ARRAY_ENABLED: number; + VERTEX_ATTRIB_ARRAY_NORMALIZED: number; + VERTEX_ATTRIB_ARRAY_POINTER: number; + VERTEX_ATTRIB_ARRAY_SIZE: number; + VERTEX_ATTRIB_ARRAY_STRIDE: number; + VERTEX_ATTRIB_ARRAY_TYPE: number; + VERTEX_SHADER: number; + VIEWPORT: number; + ZERO: number; +} + +interface WebGLShader extends WebGLObject { +} + +declare var WebGLShader: { + prototype: WebGLShader; + new(): WebGLShader; +} + +interface WebGLShaderPrecisionFormat { + precision: number; + rangeMax: number; + rangeMin: number; +} + declare var WebGLShaderPrecisionFormat: { prototype: WebGLShaderPrecisionFormat; new(): WebGLShaderPrecisionFormat; } -interface EXT_texture_filter_anisotropic { - TEXTURE_MAX_ANISOTROPY_EXT: number; - MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; -} -declare var EXT_texture_filter_anisotropic: { - prototype: EXT_texture_filter_anisotropic; - new(): EXT_texture_filter_anisotropic; - TEXTURE_MAX_ANISOTROPY_EXT: number; - MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; +interface WebGLTexture extends WebGLObject { } -declare var Option: { new(text?: string, value?: string, defaultSelected?: boolean, selected?:boolean): HTMLOptionElement; }; -declare var Image: { new(width?: number, height?: number): HTMLImageElement; }; -declare var Audio: { new(src?: string): HTMLAudioElement; }; +declare var WebGLTexture: { + prototype: WebGLTexture; + new(): WebGLTexture; +} -declare var ondragend: (ev: DragEvent) => any; -declare var onkeydown: (ev: KeyboardEvent) => any; -declare var ondragover: (ev: DragEvent) => any; -declare var onkeyup: (ev: KeyboardEvent) => any; -declare var onreset: (ev: Event) => any; -declare var onmouseup: (ev: MouseEvent) => any; -declare var ondragstart: (ev: DragEvent) => any; -declare var ondrag: (ev: DragEvent) => any; -declare var screenX: number; -declare var onmouseover: (ev: MouseEvent) => any; -declare var ondragleave: (ev: DragEvent) => any; -declare var history: History; -declare var pageXOffset: number; -declare var name: string; -declare var onafterprint: (ev: Event) => any; -declare var onpause: (ev: Event) => any; -declare var onbeforeprint: (ev: Event) => any; -declare var top: Window; -declare var onmousedown: (ev: MouseEvent) => any; -declare var onseeked: (ev: Event) => any; -declare var opener: Window; -declare var onclick: (ev: MouseEvent) => any; -declare var innerHeight: number; -declare var onwaiting: (ev: Event) => any; -declare var ononline: (ev: Event) => any; -declare var ondurationchange: (ev: Event) => any; -declare var frames: Window; -declare var onblur: (ev: FocusEvent) => any; -declare var onemptied: (ev: Event) => any; -declare var onseeking: (ev: Event) => any; -declare var oncanplay: (ev: Event) => any; -declare var outerWidth: number; -declare var onstalled: (ev: Event) => any; -declare var onmousemove: (ev: MouseEvent) => any; -declare var innerWidth: number; -declare var onoffline: (ev: Event) => any; -declare var length: number; -declare var screen: Screen; -declare var onbeforeunload: (ev: BeforeUnloadEvent) => any; -declare var onratechange: (ev: Event) => any; -declare var onstorage: (ev: StorageEvent) => any; -declare var onloadstart: (ev: Event) => any; -declare var ondragenter: (ev: DragEvent) => any; -declare var onsubmit: (ev: Event) => any; -declare var self: Window; -declare var document: Document; -declare var onprogress: (ev: ProgressEvent) => any; -declare var ondblclick: (ev: MouseEvent) => any; -declare var pageYOffset: number; -declare var oncontextmenu: (ev: MouseEvent) => any; -declare var onchange: (ev: Event) => any; -declare var onloadedmetadata: (ev: Event) => any; -declare var onplay: (ev: Event) => any; -declare var onerror: ErrorEventHandler; -declare var onplaying: (ev: Event) => any; -declare var parent: Window; -declare var location: Location; -declare var oncanplaythrough: (ev: Event) => any; -declare var onabort: (ev: UIEvent) => any; -declare var onreadystatechange: (ev: Event) => any; -declare var outerHeight: number; -declare var onkeypress: (ev: KeyboardEvent) => any; -declare var frameElement: Element; -declare var onloadeddata: (ev: Event) => any; -declare var onsuspend: (ev: Event) => any; -declare var window: Window; -declare var onfocus: (ev: FocusEvent) => any; -declare var onmessage: (ev: MessageEvent) => any; -declare var ontimeupdate: (ev: Event) => any; -declare var onresize: (ev: UIEvent) => any; -declare var onselect: (ev: UIEvent) => any; -declare var navigator: Navigator; -declare var styleMedia: StyleMedia; -declare var ondrop: (ev: DragEvent) => any; -declare var onmouseout: (ev: MouseEvent) => any; -declare var onended: (ev: Event) => any; -declare var onhashchange: (ev: Event) => any; -declare var onunload: (ev: Event) => any; -declare var onscroll: (ev: UIEvent) => any; -declare var screenY: number; -declare var onmousewheel: (ev: MouseWheelEvent) => any; -declare var onload: (ev: Event) => any; -declare var onvolumechange: (ev: Event) => any; -declare var oninput: (ev: Event) => any; -declare var performance: Performance; -declare var onmspointerdown: (ev: any) => any; +interface WebGLUniformLocation { +} + +declare var WebGLUniformLocation: { + prototype: WebGLUniformLocation; + new(): WebGLUniformLocation; +} + +interface WebKitCSSMatrix { + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + m11: number; + m12: number; + m13: number; + m14: number; + m21: number; + m22: number; + m23: number; + m24: number; + m31: number; + m32: number; + m33: number; + m34: number; + m41: number; + m42: number; + m43: number; + m44: number; + inverse(): WebKitCSSMatrix; + multiply(secondMatrix: WebKitCSSMatrix): WebKitCSSMatrix; + rotate(angleX: number, angleY?: number, angleZ?: number): WebKitCSSMatrix; + rotateAxisAngle(x: number, y: number, z: number, angle: number): WebKitCSSMatrix; + scale(scaleX: number, scaleY?: number, scaleZ?: number): WebKitCSSMatrix; + setMatrixValue(value: string): void; + skewX(angle: number): WebKitCSSMatrix; + skewY(angle: number): WebKitCSSMatrix; + toString(): string; + translate(x: number, y: number, z?: number): WebKitCSSMatrix; +} + +declare var WebKitCSSMatrix: { + prototype: WebKitCSSMatrix; + new(text?: string): WebKitCSSMatrix; +} + +interface WebKitPoint { + x: number; + y: number; +} + +declare var WebKitPoint: { + prototype: WebKitPoint; + new(x?: number, y?: number): WebKitPoint; +} + +interface WebSocket extends EventTarget { + binaryType: string; + bufferedAmount: number; + extensions: string; + onclose: (ev: CloseEvent) => any; + onerror: (ev: Event) => any; + onmessage: (ev: MessageEvent) => any; + onopen: (ev: Event) => any; + protocol: string; + readyState: number; + url: string; + close(code?: number, reason?: string): void; + send(data: any): void; + CLOSED: number; + CLOSING: number; + CONNECTING: number; + OPEN: number; + addEventListener(type: "close", listener: (ev: CloseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "open", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var WebSocket: { + prototype: WebSocket; + new(url: string, protocols?: string): WebSocket; + new(url: string, protocols?: any): WebSocket; + CLOSED: number; + CLOSING: number; + CONNECTING: number; + OPEN: number; +} + +interface WheelEvent extends MouseEvent { + deltaMode: number; + deltaX: number; + deltaY: number; + deltaZ: number; + getCurrentPoint(element: Element): void; + initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void; + DOM_DELTA_LINE: number; + DOM_DELTA_PAGE: number; + DOM_DELTA_PIXEL: number; +} + +declare var WheelEvent: { + prototype: WheelEvent; + new(typeArg: string, eventInitDict?: WheelEventInit): WheelEvent; + DOM_DELTA_LINE: number; + DOM_DELTA_PAGE: number; + DOM_DELTA_PIXEL: number; +} + +interface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64 { + animationStartTime: number; + applicationCache: ApplicationCache; + clientInformation: Navigator; + closed: boolean; + crypto: Crypto; + defaultStatus: string; + devicePixelRatio: number; + doNotTrack: string; + document: Document; + event: Event; + external: External; + frameElement: Element; + frames: Window; + history: History; + innerHeight: number; + innerWidth: number; + length: number; + location: Location; + locationbar: BarProp; + menubar: BarProp; + msAnimationStartTime: number; + msTemplatePrinter: MSTemplatePrinter; + name: string; + navigator: Navigator; + offscreenBuffering: string | boolean; + onabort: (ev: Event) => any; + onafterprint: (ev: Event) => any; + onbeforeprint: (ev: Event) => any; + onbeforeunload: (ev: BeforeUnloadEvent) => any; + onblur: (ev: FocusEvent) => any; + oncanplay: (ev: Event) => any; + oncanplaythrough: (ev: Event) => any; + onchange: (ev: Event) => any; + onclick: (ev: MouseEvent) => any; + oncompassneedscalibration: (ev: Event) => any; + oncontextmenu: (ev: PointerEvent) => any; + ondblclick: (ev: MouseEvent) => any; + ondevicemotion: (ev: DeviceMotionEvent) => any; + ondeviceorientation: (ev: DeviceOrientationEvent) => any; + ondrag: (ev: DragEvent) => any; + ondragend: (ev: DragEvent) => any; + ondragenter: (ev: DragEvent) => any; + ondragleave: (ev: DragEvent) => any; + ondragover: (ev: DragEvent) => any; + ondragstart: (ev: DragEvent) => any; + ondrop: (ev: DragEvent) => any; + ondurationchange: (ev: Event) => any; + onemptied: (ev: Event) => any; + onended: (ev: Event) => any; + onerror: ErrorEventHandler; + onfocus: (ev: FocusEvent) => any; + onhashchange: (ev: HashChangeEvent) => any; + oninput: (ev: Event) => any; + onkeydown: (ev: KeyboardEvent) => any; + onkeypress: (ev: KeyboardEvent) => any; + onkeyup: (ev: KeyboardEvent) => any; + onload: (ev: Event) => any; + onloadeddata: (ev: Event) => any; + onloadedmetadata: (ev: Event) => any; + onloadstart: (ev: Event) => any; + onmessage: (ev: MessageEvent) => any; + onmousedown: (ev: MouseEvent) => any; + onmouseenter: (ev: MouseEvent) => any; + onmouseleave: (ev: MouseEvent) => any; + onmousemove: (ev: MouseEvent) => any; + onmouseout: (ev: MouseEvent) => any; + onmouseover: (ev: MouseEvent) => any; + onmouseup: (ev: MouseEvent) => any; + onmousewheel: (ev: MouseWheelEvent) => any; + onmsgesturechange: (ev: MSGestureEvent) => any; + onmsgesturedoubletap: (ev: MSGestureEvent) => any; + onmsgestureend: (ev: MSGestureEvent) => any; + onmsgesturehold: (ev: MSGestureEvent) => any; + onmsgesturestart: (ev: MSGestureEvent) => any; + onmsgesturetap: (ev: MSGestureEvent) => any; + onmsinertiastart: (ev: MSGestureEvent) => any; + onmspointercancel: (ev: MSPointerEvent) => any; + onmspointerdown: (ev: MSPointerEvent) => any; + onmspointerenter: (ev: MSPointerEvent) => any; + onmspointerleave: (ev: MSPointerEvent) => any; + onmspointermove: (ev: MSPointerEvent) => any; + onmspointerout: (ev: MSPointerEvent) => any; + onmspointerover: (ev: MSPointerEvent) => any; + onmspointerup: (ev: MSPointerEvent) => any; + onoffline: (ev: Event) => any; + ononline: (ev: Event) => any; + onorientationchange: (ev: Event) => any; + onpagehide: (ev: PageTransitionEvent) => any; + onpageshow: (ev: PageTransitionEvent) => any; + onpause: (ev: Event) => any; + onplay: (ev: Event) => any; + onplaying: (ev: Event) => any; + onpopstate: (ev: PopStateEvent) => any; + onprogress: (ev: ProgressEvent) => any; + onratechange: (ev: Event) => any; + onreadystatechange: (ev: ProgressEvent) => any; + onreset: (ev: Event) => any; + onresize: (ev: UIEvent) => any; + onscroll: (ev: UIEvent) => any; + onseeked: (ev: Event) => any; + onseeking: (ev: Event) => any; + onselect: (ev: UIEvent) => any; + onstalled: (ev: Event) => any; + onstorage: (ev: StorageEvent) => any; + onsubmit: (ev: Event) => any; + onsuspend: (ev: Event) => any; + ontimeupdate: (ev: Event) => any; + ontouchcancel: any; + ontouchend: any; + ontouchmove: any; + ontouchstart: any; + onunload: (ev: Event) => any; + onvolumechange: (ev: Event) => any; + onwaiting: (ev: Event) => any; + opener: Window; + orientation: string; + outerHeight: number; + outerWidth: number; + pageXOffset: number; + pageYOffset: number; + parent: Window; + performance: Performance; + personalbar: BarProp; + screen: Screen; + screenLeft: number; + screenTop: number; + screenX: number; + screenY: number; + scrollX: number; + scrollY: number; + scrollbars: BarProp; + self: Window; + status: string; + statusbar: BarProp; + styleMedia: StyleMedia; + toolbar: BarProp; + top: Window; + window: Window; + alert(message?: any): void; + blur(): void; + cancelAnimationFrame(handle: number): void; + captureEvents(): void; + close(): void; + confirm(message?: string): boolean; + focus(): void; + getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; + getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; + getSelection(): Selection; + matchMedia(mediaQuery: string): MediaQueryList; + moveBy(x?: number, y?: number): void; + moveTo(x?: number, y?: number): void; + msCancelRequestAnimationFrame(handle: number): void; + msMatchMedia(mediaQuery: string): MediaQueryList; + msRequestAnimationFrame(callback: FrameRequestCallback): number; + msWriteProfilerMark(profilerMarkName: string): void; + open(url?: string, target?: string, features?: string, replace?: boolean): any; + postMessage(message: any, targetOrigin: string, ports?: any): void; + print(): void; + prompt(message?: string, _default?: string): string; + releaseEvents(): void; + requestAnimationFrame(callback: FrameRequestCallback): number; + resizeBy(x?: number, y?: number): void; + resizeTo(x?: number, y?: number): void; + scroll(x?: number, y?: number): void; + scrollBy(x?: number, y?: number): void; + scrollTo(x?: number, y?: number): void; + webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; + webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "compassneedscalibration", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: Window; +} + +declare var Window: { + prototype: Window; + new(): Window; +} + +interface Worker extends EventTarget, AbstractWorker { + onmessage: (ev: MessageEvent) => any; + postMessage(message: any, ports?: any): void; + terminate(): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Worker: { + prototype: Worker; + new(stringUrl: string): Worker; +} + +interface XMLDocument extends Document { +} + +declare var XMLDocument: { + prototype: XMLDocument; + new(): XMLDocument; +} + +interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget { + msCaching: string; + onreadystatechange: (ev: ProgressEvent) => any; + readyState: number; + response: any; + responseBody: any; + responseText: string; + responseType: string; + responseXML: any; + status: number; + statusText: string; + timeout: number; + upload: XMLHttpRequestUpload; + withCredentials: boolean; + abort(): void; + getAllResponseHeaders(): string; + getResponseHeader(header: string): string; + msCachingEnabled(): boolean; + open(method: string, url: string, async?: boolean, user?: string, password?: string): void; + overrideMimeType(mime: string): void; + send(data?: Document): void; + send(data?: string): void; + setRequestHeader(header: string, value: string): void; + DONE: number; + HEADERS_RECEIVED: number; + LOADING: number; + OPENED: number; + UNSENT: number; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeout", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var XMLHttpRequest: { + prototype: XMLHttpRequest; + new(): XMLHttpRequest; + DONE: number; + HEADERS_RECEIVED: number; + LOADING: number; + OPENED: number; + UNSENT: number; + create(): XMLHttpRequest; +} + +interface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var XMLHttpRequestUpload: { + prototype: XMLHttpRequestUpload; + new(): XMLHttpRequestUpload; +} + +interface XMLSerializer { + serializeToString(target: Node): string; +} + +declare var XMLSerializer: { + prototype: XMLSerializer; + new(): XMLSerializer; +} + +interface XPathEvaluator { + createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; + createNSResolver(nodeResolver?: Node): XPathNSResolver; + evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver, type: number, result: XPathResult): XPathResult; +} + +declare var XPathEvaluator: { + prototype: XPathEvaluator; + new(): XPathEvaluator; +} + +interface XPathExpression { + evaluate(contextNode: Node, type: number, result: XPathResult): XPathExpression; +} + +declare var XPathExpression: { + prototype: XPathExpression; + new(): XPathExpression; +} + +interface XPathNSResolver { + lookupNamespaceURI(prefix: string): string; +} + +declare var XPathNSResolver: { + prototype: XPathNSResolver; + new(): XPathNSResolver; +} + +interface XPathResult { + booleanValue: boolean; + invalidIteratorState: boolean; + numberValue: number; + resultType: number; + singleNodeValue: Node; + snapshotLength: number; + stringValue: string; + iterateNext(): Node; + snapshotItem(index: number): Node; + ANY_TYPE: number; + ANY_UNORDERED_NODE_TYPE: number; + BOOLEAN_TYPE: number; + FIRST_ORDERED_NODE_TYPE: number; + NUMBER_TYPE: number; + ORDERED_NODE_ITERATOR_TYPE: number; + ORDERED_NODE_SNAPSHOT_TYPE: number; + STRING_TYPE: number; + UNORDERED_NODE_ITERATOR_TYPE: number; + UNORDERED_NODE_SNAPSHOT_TYPE: number; +} + +declare var XPathResult: { + prototype: XPathResult; + new(): XPathResult; + ANY_TYPE: number; + ANY_UNORDERED_NODE_TYPE: number; + BOOLEAN_TYPE: number; + FIRST_ORDERED_NODE_TYPE: number; + NUMBER_TYPE: number; + ORDERED_NODE_ITERATOR_TYPE: number; + ORDERED_NODE_SNAPSHOT_TYPE: number; + STRING_TYPE: number; + UNORDERED_NODE_ITERATOR_TYPE: number; + UNORDERED_NODE_SNAPSHOT_TYPE: number; +} + +interface XSLTProcessor { + clearParameters(): void; + getParameter(namespaceURI: string, localName: string): any; + importStylesheet(style: Node): void; + removeParameter(namespaceURI: string, localName: string): void; + reset(): void; + setParameter(namespaceURI: string, localName: string, value: any): void; + transformToDocument(source: Node): Document; + transformToFragment(source: Node, document: Document): DocumentFragment; +} + +declare var XSLTProcessor: { + prototype: XSLTProcessor; + new(): XSLTProcessor; +} + +interface AbstractWorker { + onerror: (ev: Event) => any; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface ChildNode { + remove(): void; +} + +interface DOML2DeprecatedColorProperty { + color: string; +} + +interface DOML2DeprecatedSizeProperty { + size: number; +} + +interface DocumentEvent { + createEvent(eventInterface:"AnimationEvent"): AnimationEvent; + createEvent(eventInterface:"AriaRequestEvent"): AriaRequestEvent; + createEvent(eventInterface:"AudioProcessingEvent"): AudioProcessingEvent; + createEvent(eventInterface:"BeforeUnloadEvent"): BeforeUnloadEvent; + createEvent(eventInterface:"CloseEvent"): CloseEvent; + createEvent(eventInterface:"CommandEvent"): CommandEvent; + createEvent(eventInterface:"CompositionEvent"): CompositionEvent; + createEvent(eventInterface:"DeviceMotionEvent"): DeviceMotionEvent; + createEvent(eventInterface:"DeviceOrientationEvent"): DeviceOrientationEvent; + createEvent(eventInterface:"DragEvent"): DragEvent; + createEvent(eventInterface:"ErrorEvent"): ErrorEvent; + createEvent(eventInterface:"Event"): Event; + createEvent(eventInterface:"FocusEvent"): FocusEvent; + createEvent(eventInterface:"GamepadEvent"): GamepadEvent; + createEvent(eventInterface:"HashChangeEvent"): HashChangeEvent; + createEvent(eventInterface:"IDBVersionChangeEvent"): IDBVersionChangeEvent; + createEvent(eventInterface:"KeyboardEvent"): KeyboardEvent; + createEvent(eventInterface:"LongRunningScriptDetectedEvent"): LongRunningScriptDetectedEvent; + createEvent(eventInterface:"MSGestureEvent"): MSGestureEvent; + createEvent(eventInterface:"MSManipulationEvent"): MSManipulationEvent; + createEvent(eventInterface:"MSMediaKeyMessageEvent"): MSMediaKeyMessageEvent; + createEvent(eventInterface:"MSMediaKeyNeededEvent"): MSMediaKeyNeededEvent; + createEvent(eventInterface:"MSPointerEvent"): MSPointerEvent; + createEvent(eventInterface:"MSSiteModeEvent"): MSSiteModeEvent; + createEvent(eventInterface:"MessageEvent"): MessageEvent; + createEvent(eventInterface:"MouseEvent"): MouseEvent; + createEvent(eventInterface:"MouseWheelEvent"): MouseWheelEvent; + createEvent(eventInterface:"MutationEvent"): MutationEvent; + createEvent(eventInterface:"NavigationCompletedEvent"): NavigationCompletedEvent; + createEvent(eventInterface:"NavigationEvent"): NavigationEvent; + createEvent(eventInterface:"NavigationEventWithReferrer"): NavigationEventWithReferrer; + createEvent(eventInterface:"OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent; + createEvent(eventInterface:"PageTransitionEvent"): PageTransitionEvent; + createEvent(eventInterface:"PermissionRequestedEvent"): PermissionRequestedEvent; + createEvent(eventInterface:"PointerEvent"): PointerEvent; + createEvent(eventInterface:"PopStateEvent"): PopStateEvent; + createEvent(eventInterface:"ProgressEvent"): ProgressEvent; + createEvent(eventInterface:"SVGZoomEvent"): SVGZoomEvent; + createEvent(eventInterface:"ScriptNotifyEvent"): ScriptNotifyEvent; + createEvent(eventInterface:"StorageEvent"): StorageEvent; + createEvent(eventInterface:"TextEvent"): TextEvent; + createEvent(eventInterface:"TouchEvent"): TouchEvent; + createEvent(eventInterface:"TrackEvent"): TrackEvent; + createEvent(eventInterface:"TransitionEvent"): TransitionEvent; + createEvent(eventInterface:"UIEvent"): UIEvent; + createEvent(eventInterface:"UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent; + createEvent(eventInterface:"WebGLContextEvent"): WebGLContextEvent; + createEvent(eventInterface:"WheelEvent"): WheelEvent; + createEvent(eventInterface: string): Event; +} + +interface ElementTraversal { + childElementCount: number; + firstElementChild: Element; + lastElementChild: Element; + nextElementSibling: Element; + previousElementSibling: Element; +} + +interface GetSVGDocument { + getSVGDocument(): Document; +} + +interface GlobalEventHandlers { + onpointercancel: (ev: PointerEvent) => any; + onpointerdown: (ev: PointerEvent) => any; + onpointerenter: (ev: PointerEvent) => any; + onpointerleave: (ev: PointerEvent) => any; + onpointermove: (ev: PointerEvent) => any; + onpointerout: (ev: PointerEvent) => any; + onpointerover: (ev: PointerEvent) => any; + onpointerup: (ev: PointerEvent) => any; + onwheel: (ev: WheelEvent) => any; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface HTMLTableAlignment { + /** + * Sets or retrieves a value that you can use to implement your own ch functionality for the object. + */ + ch: string; + /** + * Sets or retrieves a value that you can use to implement your own chOff functionality for the object. + */ + chOff: string; + /** + * Sets or retrieves how text and other content are vertically aligned within the object that contains them. + */ + vAlign: string; +} + +interface IDBEnvironment { + indexedDB: IDBFactory; + msIndexedDB: IDBFactory; +} + +interface LinkStyle { + sheet: StyleSheet; +} + +interface MSBaseReader { + onabort: (ev: Event) => any; + onerror: (ev: Event) => any; + onload: (ev: Event) => any; + onloadend: (ev: ProgressEvent) => any; + onloadstart: (ev: Event) => any; + onprogress: (ev: ProgressEvent) => any; + readyState: number; + result: any; + abort(): void; + DONE: number; + EMPTY: number; + LOADING: number; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface MSFileSaver { + msSaveBlob(blob: any, defaultName?: string): boolean; + msSaveOrOpenBlob(blob: any, defaultName?: string): boolean; +} + +interface MSNavigatorDoNotTrack { + confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean; + confirmWebWideTrackingException(args: ExceptionInformation): boolean; + removeSiteSpecificTrackingException(args: ExceptionInformation): void; + removeWebWideTrackingException(args: ExceptionInformation): void; + storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void; + storeWebWideTrackingException(args: StoreExceptionsInformation): void; +} + +interface NavigatorContentUtils { +} + +interface NavigatorGeolocation { + geolocation: Geolocation; +} + +interface NavigatorID { + appName: string; + appVersion: string; + platform: string; + product: string; + productSub: string; + userAgent: string; + vendor: string; + vendorSub: string; +} + +interface NavigatorOnLine { + onLine: boolean; +} + +interface NavigatorStorageUtils { +} + +interface NodeSelector { + querySelector(selectors: string): Element; + querySelectorAll(selectors: string): NodeList; +} + +interface RandomSource { + getRandomValues(array: ArrayBufferView): ArrayBufferView; +} + +interface SVGAnimatedPathData { + pathSegList: SVGPathSegList; +} + +interface SVGAnimatedPoints { + animatedPoints: SVGPointList; + points: SVGPointList; +} + +interface SVGExternalResourcesRequired { + externalResourcesRequired: SVGAnimatedBoolean; +} + +interface SVGFilterPrimitiveStandardAttributes extends SVGStylable { + height: SVGAnimatedLength; + result: SVGAnimatedString; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; +} + +interface SVGFitToViewBox { + preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + viewBox: SVGAnimatedRect; +} + +interface SVGLangSpace { + xmllang: string; + xmlspace: string; +} + +interface SVGLocatable { + farthestViewportElement: SVGElement; + nearestViewportElement: SVGElement; + getBBox(): SVGRect; + getCTM(): SVGMatrix; + getScreenCTM(): SVGMatrix; + getTransformToElement(element: SVGElement): SVGMatrix; +} + +interface SVGStylable { + className: SVGAnimatedString; + style: CSSStyleDeclaration; +} + +interface SVGTests { + requiredExtensions: SVGStringList; + requiredFeatures: SVGStringList; + systemLanguage: SVGStringList; + hasExtension(extension: string): boolean; +} + +interface SVGTransformable extends SVGLocatable { + transform: SVGAnimatedTransformList; +} + +interface SVGURIReference { + href: SVGAnimatedString; +} + +interface WindowBase64 { + atob(encodedString: string): string; + btoa(rawString: string): string; +} + +interface WindowConsole { + console: Console; +} + +interface WindowLocalStorage { + localStorage: Storage; +} + +interface WindowSessionStorage { + sessionStorage: Storage; +} + +interface WindowTimers extends Object, WindowTimersExtension { + clearInterval(handle: number): void; + clearTimeout(handle: number): void; + setInterval(handler: any, timeout?: any, ...args: any[]): number; + setTimeout(handler: any, timeout?: any, ...args: any[]): number; +} + +interface WindowTimersExtension { + clearImmediate(handle: number): void; + msClearImmediate(handle: number): void; + msSetImmediate(expression: any, ...args: any[]): number; + setImmediate(expression: any, ...args: any[]): number; +} + +interface XMLHttpRequestEventTarget { + onabort: (ev: Event) => any; + onerror: (ev: Event) => any; + onload: (ev: Event) => any; + onloadend: (ev: ProgressEvent) => any; + onloadstart: (ev: Event) => any; + onprogress: (ev: ProgressEvent) => any; + ontimeout: (ev: ProgressEvent) => any; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeout", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + + +interface NodeListOf extends NodeList { + length: number; + item(index: number): TNode; + [index: number]: TNode; +} + +interface BlobPropertyBag { + type?: string; + endings?: string; +} + +interface EventListenerObject { + handleEvent(evt: Event): void; +} + +declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; + +interface ErrorEventHandler { + (event: Event, source?: string, fileno?: number, columnNumber?: number): void; + (event: string, source?: string, fileno?: number, columnNumber?: number): void; +} +interface PositionCallback { + (position: Position): void; +} +interface PositionErrorCallback { + (error: PositionError): void; +} +interface MediaQueryListListener { + (mql: MediaQueryList): void; +} +interface MSLaunchUriCallback { + (): void; +} +interface FrameRequestCallback { + (time: number): void; +} +interface MSUnsafeFunctionCallback { + (): any; +} +interface MSExecAtPriorityFunctionCallback { + (...args: any[]): any; +} +interface MutationCallback { + (mutations: MutationRecord[], observer: MutationObserver): void; +} +interface DecodeSuccessCallback { + (decodedData: AudioBuffer): void; +} +interface DecodeErrorCallback { + (): void; +} +interface FunctionStringCallback { + (data: string): void; +} +declare var Audio: {new(src?: string): HTMLAudioElement; }; +declare var Image: {new(width?: number, height?: number): HTMLImageElement; }; +declare var Option: {new(text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement; }; declare var animationStartTime: number; -declare var onmsgesturedoubletap: (ev: any) => any; -declare var onmspointerhover: (ev: any) => any; -declare var onmsgesturehold: (ev: any) => any; -declare var onmspointermove: (ev: any) => any; -declare var onmsgesturechange: (ev: any) => any; -declare var onmsgesturestart: (ev: any) => any; -declare var onmspointercancel: (ev: any) => any; -declare var onmsgestureend: (ev: any) => any; -declare var onmsgesturetap: (ev: any) => any; -declare var onmspointerout: (ev: any) => any; -declare var msAnimationStartTime: number; declare var applicationCache: ApplicationCache; -declare var onmsinertiastart: (ev: any) => any; -declare var onmspointerover: (ev: any) => any; -declare var onpopstate: (ev: PopStateEvent) => any; -declare var onmspointerup: (ev: any) => any; -declare var onpageshow: (ev: PageTransitionEvent) => any; -declare var ondevicemotion: (ev: DeviceMotionEvent) => any; -declare var devicePixelRatio: number; -declare var msCrypto: Crypto; -declare var ondeviceorientation: (ev: DeviceOrientationEvent) => any; -declare var doNotTrack: string; -declare var onmspointerenter: (ev: any) => any; -declare var onpagehide: (ev: PageTransitionEvent) => any; -declare var onmspointerleave: (ev: any) => any; -declare function alert(message?: any): void; -declare function scroll(x?: number, y?: number): void; -declare function focus(): void; -declare function scrollTo(x?: number, y?: number): void; -declare function print(): void; -declare function prompt(message?: string, _default?: string): string; -declare function toString(): string; -declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window; -declare function scrollBy(x?: number, y?: number): void; -declare function confirm(message?: string): boolean; -declare function close(): void; -declare function postMessage(message: any, targetOrigin: string, ports?: any): void; -declare function showModalDialog(url?: string, argument?: any, options?: any): any; -declare function blur(): void; -declare function getSelection(): Selection; -declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; -declare function msCancelRequestAnimationFrame(handle: number): void; -declare function matchMedia(mediaQuery: string): MediaQueryList; -declare function cancelAnimationFrame(handle: number): void; -declare function msIsStaticHTML(html: string): boolean; -declare function msMatchMedia(mediaQuery: string): MediaQueryList; -declare function requestAnimationFrame(callback: FrameRequestCallback): number; -declare function msRequestAnimationFrame(callback: FrameRequestCallback): number; -declare function removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -declare function dispatchEvent(evt: Event): boolean; -declare function attachEvent(event: string, listener: EventListener): boolean; -declare function detachEvent(event: string, listener: EventListener): void; -declare var localStorage: Storage; -declare var status: string; -declare var onmouseleave: (ev: MouseEvent) => any; -declare var screenLeft: number; -declare var offscreenBuffering: any; -declare var maxConnectionsPerServer: number; -declare var onmouseenter: (ev: MouseEvent) => any; -declare var clipboardData: DataTransfer; -declare var defaultStatus: string; declare var clientInformation: Navigator; declare var closed: boolean; -declare var onhelp: (ev: Event) => any; +declare var crypto: Crypto; +declare var defaultStatus: string; +declare var devicePixelRatio: number; +declare var doNotTrack: string; +declare var document: Document; +declare var event: Event; declare var external: External; -declare var event: MSEventObj; -declare var onfocusout: (ev: FocusEvent) => any; +declare var frameElement: Element; +declare var frames: Window; +declare var history: History; +declare var innerHeight: number; +declare var innerWidth: number; +declare var length: number; +declare var location: Location; +declare var locationbar: BarProp; +declare var menubar: BarProp; +declare var msAnimationStartTime: number; +declare var msTemplatePrinter: MSTemplatePrinter; +declare var name: string; +declare var navigator: Navigator; +declare var offscreenBuffering: string | boolean; +declare var onabort: (ev: Event) => any; +declare var onafterprint: (ev: Event) => any; +declare var onbeforeprint: (ev: Event) => any; +declare var onbeforeunload: (ev: BeforeUnloadEvent) => any; +declare var onblur: (ev: FocusEvent) => any; +declare var oncanplay: (ev: Event) => any; +declare var oncanplaythrough: (ev: Event) => any; +declare var onchange: (ev: Event) => any; +declare var onclick: (ev: MouseEvent) => any; +declare var oncompassneedscalibration: (ev: Event) => any; +declare var oncontextmenu: (ev: PointerEvent) => any; +declare var ondblclick: (ev: MouseEvent) => any; +declare var ondevicemotion: (ev: DeviceMotionEvent) => any; +declare var ondeviceorientation: (ev: DeviceOrientationEvent) => any; +declare var ondrag: (ev: DragEvent) => any; +declare var ondragend: (ev: DragEvent) => any; +declare var ondragenter: (ev: DragEvent) => any; +declare var ondragleave: (ev: DragEvent) => any; +declare var ondragover: (ev: DragEvent) => any; +declare var ondragstart: (ev: DragEvent) => any; +declare var ondrop: (ev: DragEvent) => any; +declare var ondurationchange: (ev: Event) => any; +declare var onemptied: (ev: Event) => any; +declare var onended: (ev: Event) => any; +declare var onerror: ErrorEventHandler; +declare var onfocus: (ev: FocusEvent) => any; +declare var onhashchange: (ev: HashChangeEvent) => any; +declare var oninput: (ev: Event) => any; +declare var onkeydown: (ev: KeyboardEvent) => any; +declare var onkeypress: (ev: KeyboardEvent) => any; +declare var onkeyup: (ev: KeyboardEvent) => any; +declare var onload: (ev: Event) => any; +declare var onloadeddata: (ev: Event) => any; +declare var onloadedmetadata: (ev: Event) => any; +declare var onloadstart: (ev: Event) => any; +declare var onmessage: (ev: MessageEvent) => any; +declare var onmousedown: (ev: MouseEvent) => any; +declare var onmouseenter: (ev: MouseEvent) => any; +declare var onmouseleave: (ev: MouseEvent) => any; +declare var onmousemove: (ev: MouseEvent) => any; +declare var onmouseout: (ev: MouseEvent) => any; +declare var onmouseover: (ev: MouseEvent) => any; +declare var onmouseup: (ev: MouseEvent) => any; +declare var onmousewheel: (ev: MouseWheelEvent) => any; +declare var onmsgesturechange: (ev: MSGestureEvent) => any; +declare var onmsgesturedoubletap: (ev: MSGestureEvent) => any; +declare var onmsgestureend: (ev: MSGestureEvent) => any; +declare var onmsgesturehold: (ev: MSGestureEvent) => any; +declare var onmsgesturestart: (ev: MSGestureEvent) => any; +declare var onmsgesturetap: (ev: MSGestureEvent) => any; +declare var onmsinertiastart: (ev: MSGestureEvent) => any; +declare var onmspointercancel: (ev: MSPointerEvent) => any; +declare var onmspointerdown: (ev: MSPointerEvent) => any; +declare var onmspointerenter: (ev: MSPointerEvent) => any; +declare var onmspointerleave: (ev: MSPointerEvent) => any; +declare var onmspointermove: (ev: MSPointerEvent) => any; +declare var onmspointerout: (ev: MSPointerEvent) => any; +declare var onmspointerover: (ev: MSPointerEvent) => any; +declare var onmspointerup: (ev: MSPointerEvent) => any; +declare var onoffline: (ev: Event) => any; +declare var ononline: (ev: Event) => any; +declare var onorientationchange: (ev: Event) => any; +declare var onpagehide: (ev: PageTransitionEvent) => any; +declare var onpageshow: (ev: PageTransitionEvent) => any; +declare var onpause: (ev: Event) => any; +declare var onplay: (ev: Event) => any; +declare var onplaying: (ev: Event) => any; +declare var onpopstate: (ev: PopStateEvent) => any; +declare var onprogress: (ev: ProgressEvent) => any; +declare var onratechange: (ev: Event) => any; +declare var onreadystatechange: (ev: ProgressEvent) => any; +declare var onreset: (ev: Event) => any; +declare var onresize: (ev: UIEvent) => any; +declare var onscroll: (ev: UIEvent) => any; +declare var onseeked: (ev: Event) => any; +declare var onseeking: (ev: Event) => any; +declare var onselect: (ev: UIEvent) => any; +declare var onstalled: (ev: Event) => any; +declare var onstorage: (ev: StorageEvent) => any; +declare var onsubmit: (ev: Event) => any; +declare var onsuspend: (ev: Event) => any; +declare var ontimeupdate: (ev: Event) => any; +declare var ontouchcancel: any; +declare var ontouchend: any; +declare var ontouchmove: any; +declare var ontouchstart: any; +declare var onunload: (ev: Event) => any; +declare var onvolumechange: (ev: Event) => any; +declare var onwaiting: (ev: Event) => any; +declare var opener: Window; +declare var orientation: string; +declare var outerHeight: number; +declare var outerWidth: number; +declare var pageXOffset: number; +declare var pageYOffset: number; +declare var parent: Window; +declare var performance: Performance; +declare var personalbar: BarProp; +declare var screen: Screen; +declare var screenLeft: number; declare var screenTop: number; -declare var onfocusin: (ev: FocusEvent) => any; -declare function showModelessDialog(url?: string, argument?: any, options?: any): Window; -declare function navigate(url: string): void; -declare function resizeBy(x?: number, y?: number): void; -declare function item(index: any): any; -declare function resizeTo(x?: number, y?: number): void; -declare function createPopup(arguments?: any): MSPopupWindow; -declare function toStaticHTML(html: string): string; -declare function execScript(code: string, language?: string): any; -declare function msWriteProfilerMark(profilerMarkName: string): void; -declare function moveTo(x?: number, y?: number): void; -declare function moveBy(x?: number, y?: number): void; -declare function showHelp(url: string, helpArg?: any, features?: string): void; +declare var screenX: number; +declare var screenY: number; +declare var scrollX: number; +declare var scrollY: number; +declare var scrollbars: BarProp; +declare var self: Window; +declare var status: string; +declare var statusbar: BarProp; +declare var styleMedia: StyleMedia; +declare var toolbar: BarProp; +declare var top: Window; +declare var window: Window; +declare function alert(message?: any): void; +declare function blur(): void; +declare function cancelAnimationFrame(handle: number): void; declare function captureEvents(): void; +declare function close(): void; +declare function confirm(message?: string): boolean; +declare function focus(): void; +declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; +declare function getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; +declare function getSelection(): Selection; +declare function matchMedia(mediaQuery: string): MediaQueryList; +declare function moveBy(x?: number, y?: number): void; +declare function moveTo(x?: number, y?: number): void; +declare function msCancelRequestAnimationFrame(handle: number): void; +declare function msMatchMedia(mediaQuery: string): MediaQueryList; +declare function msRequestAnimationFrame(callback: FrameRequestCallback): number; +declare function msWriteProfilerMark(profilerMarkName: string): void; +declare function open(url?: string, target?: string, features?: string, replace?: boolean): any; +declare function postMessage(message: any, targetOrigin: string, ports?: any): void; +declare function print(): void; +declare function prompt(message?: string, _default?: string): string; declare function releaseEvents(): void; -declare var sessionStorage: Storage; -declare function clearTimeout(handle: number): void; -declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; +declare function requestAnimationFrame(callback: FrameRequestCallback): number; +declare function resizeBy(x?: number, y?: number): void; +declare function resizeTo(x?: number, y?: number): void; +declare function scroll(x?: number, y?: number): void; +declare function scrollBy(x?: number, y?: number): void; +declare function scrollTo(x?: number, y?: number): void; +declare function webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; +declare function webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; +declare function toString(): string; +declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +declare function dispatchEvent(evt: Event): boolean; +declare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; declare function clearInterval(handle: number): void; +declare function clearTimeout(handle: number): void; declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; -declare function msSetImmediate(expression: any, ...args: any[]): number; +declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; declare function clearImmediate(handle: number): void; declare function msClearImmediate(handle: number): void; +declare function msSetImmediate(expression: any, ...args: any[]): number; declare function setImmediate(expression: any, ...args: any[]): number; -declare function btoa(rawString: string): string; -declare function atob(encodedString: string): string; -declare var msIndexedDB: IDBFactory; -declare var indexedDB: IDBFactory; +declare var sessionStorage: Storage; +declare var localStorage: Storage; declare var console: Console; -declare var onpointerenter: (ev: PointerEvent) => any; -declare var onpointerout: (ev: PointerEvent) => any; -declare var onpointerdown: (ev: PointerEvent) => any; -declare var onpointerup: (ev: PointerEvent) => any; declare var onpointercancel: (ev: PointerEvent) => any; -declare var onpointerover: (ev: PointerEvent) => any; -declare var onpointermove: (ev: PointerEvent) => any; +declare var onpointerdown: (ev: PointerEvent) => any; +declare var onpointerenter: (ev: PointerEvent) => any; declare var onpointerleave: (ev: PointerEvent) => any; -declare function addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var onpointermove: (ev: PointerEvent) => any; +declare var onpointerout: (ev: PointerEvent) => any; +declare var onpointerover: (ev: PointerEvent) => any; +declare var onpointerup: (ev: PointerEvent) => any; +declare var onwheel: (ev: WheelEvent) => any; +declare var indexedDB: IDBFactory; +declare var msIndexedDB: IDBFactory; +declare function atob(encodedString: string): string; +declare function btoa(rawString: string): string; +declare function addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; declare function addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "compassneedscalibration", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; declare function addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; declare function addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; declare function addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +declare function addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; \ No newline at end of file diff --git a/bin/lib.es6.d.ts b/bin/lib.es6.d.ts index edc51cad7cc..297cac973e3 100644 --- a/bin/lib.es6.d.ts +++ b/bin/lib.es6.d.ts @@ -838,7 +838,7 @@ interface RegExp { */ test(string: string): boolean; - /** Returns a copy of the text of the regular expression pattern. Read-only. The rgExp argument is a Regular expression object. It can be a variable name or a literal. */ + /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */ source: string; /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */ @@ -1183,7 +1183,7 @@ 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; declare type PropertyKey = string | number | symbol; interface Symbol { @@ -1236,26 +1236,21 @@ interface SymbolConstructor { */ isConcatSpreadable: symbol; - /** - * A Boolean value that if true indicates that an object may be used as a regular expression. - */ - isRegExp: symbol; - /** * A method that returns the default iterator for an object.Called by the semantics of the - * for-of statement. + * for-of statement. */ iterator: symbol; /** * A method that converts an object to a corresponding primitive value.Called by the ToPrimitive - * abstract operation. + * abstract operation. */ toPrimitive: symbol; /** - * A String value that is used in the creation of the default string description of an object. - * Called by the built- in method Object.prototype.toString. + * A String value that is used in the creation of the default string description of an object. + * Called by the built-in method Object.prototype.toString. */ toStringTag: symbol; @@ -1297,7 +1292,7 @@ interface ObjectConstructor { getOwnPropertySymbols(o: any): symbol[]; /** - * Returns true if the values are the same value, false otherwise. + * Returns true if the values are the same value, false otherwise. * @param value1 The first value. * @param value2 The second value. */ @@ -1784,8 +1779,6 @@ interface Math { } interface RegExp { - [Symbol.isRegExp]: boolean; - /** * Matches a string with a regular expression, and returns an array containing the results of * that search. @@ -1817,6 +1810,20 @@ interface RegExp { */ split(string: string, limit?: number): string[]; + /** + * Returns a string indicating the flags of the regular expression in question. This field is read-only. + * The characters in this string are sequenced and concatenated in the following order: + * + * - "g" for global + * - "i" for ignoreCase + * - "m" for multiline + * - "u" for unicode + * - "y" for sticky + * + * If no flags are set, the value is the empty string. + */ + flags: string; + /** * Returns a Boolean value indicating the state of the sticky flag (y) used with a regular * expression. Default is false. Read-only. @@ -4699,27 +4706,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 @@ -4994,36 +5001,99 @@ interface Date { toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string; } + ///////////////////////////// /// IE DOM APIs ///////////////////////////// - -interface PositionOptions { - enableHighAccuracy?: boolean; - timeout?: number; - maximumAge?: number; +interface Algorithm { + name?: string; } -interface ObjectURLOptions { - oneTimeOnly?: boolean; +interface AriaRequestEventInit extends EventInit { + attributeName?: string; + attributeValue?: string; } -interface StoreExceptionsInformation extends ExceptionInformation { - siteName?: string; - explanationString?: string; - detailURI?: string; +interface ClipboardEventInit extends EventInit { + data?: string; + dataType?: string; } -interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation { - arrayOfDomainStrings?: string[]; +interface CommandEventInit extends EventInit { + commandName?: string; + detail?: string; +} + +interface CompositionEventInit extends UIEventInit { + data?: string; } interface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation { arrayOfDomainStrings?: string[]; } -interface AlgorithmParameters { +interface CustomEventInit extends EventInit { + detail?: any; +} + +interface DeviceAccelerationDict { + x?: number; + y?: number; + z?: number; +} + +interface DeviceRotationRateDict { + alpha?: number; + beta?: number; + gamma?: number; +} + +interface EventInit { + bubbles?: boolean; + cancelable?: boolean; +} + +interface ExceptionInformation { + domain?: string; +} + +interface FocusEventInit extends UIEventInit { + relatedTarget?: EventTarget; +} + +interface HashChangeEventInit extends EventInit { + newURL?: string; + oldURL?: string; +} + +interface KeyAlgorithm { + name?: string; +} + +interface KeyboardEventInit extends SharedKeyboardAndMouseEventInit { + key?: string; + location?: number; + repeat?: boolean; +} + +interface MouseEventInit extends SharedKeyboardAndMouseEventInit { + screenX?: number; + screenY?: number; + clientX?: number; + clientY?: number; + button?: number; + buttons?: number; + relatedTarget?: EventTarget; +} + +interface MsZoomToOptions { + contentX?: number; + contentY?: number; + viewportX?: string; + viewportY?: string; + scaleFactor?: number; + animate?: string; } interface MutationObserverInit { @@ -5036,6 +5106,10 @@ interface MutationObserverInit { attributeFilter?: string[]; } +interface ObjectURLOptions { + oneTimeOnly?: boolean; +} + interface PointerEventInit extends MouseEventInit { pointerId?: number; width?: number; @@ -5047,52 +5121,43 @@ interface PointerEventInit extends MouseEventInit { isPrimary?: boolean; } -interface ExceptionInformation { - domain?: string; +interface PositionOptions { + enableHighAccuracy?: boolean; + timeout?: number; + maximumAge?: number; } -interface DeviceAccelerationDict { - x?: number; - y?: number; - z?: number; -} - -interface MsZoomToOptions { - contentX?: number; - contentY?: number; - viewportX?: string; - viewportY?: string; - scaleFactor?: number; - animate?: string; -} - -interface DeviceRotationRateDict { - alpha?: number; - beta?: number; - gamma?: number; -} - -interface Algorithm { - name?: string; - params?: AlgorithmParameters; -} - -interface MouseEventInit { - bubbles?: boolean; - cancelable?: boolean; - view?: Window; - detail?: number; - screenX?: number; - screenY?: number; - clientX?: number; - clientY?: number; +interface SharedKeyboardAndMouseEventInit extends UIEventInit { ctrlKey?: boolean; shiftKey?: boolean; altKey?: boolean; metaKey?: boolean; - button?: number; - buttons?: number; - relatedTarget?: EventTarget; + keyModifierStateAltGraph?: boolean; + keyModifierStateCapsLock?: boolean; + keyModifierStateFn?: boolean; + keyModifierStateFnLock?: boolean; + keyModifierStateHyper?: boolean; + keyModifierStateNumLock?: boolean; + keyModifierStateOS?: boolean; + keyModifierStateScrollLock?: boolean; + keyModifierStateSuper?: boolean; + keyModifierStateSymbol?: boolean; + keyModifierStateSymbolLock?: boolean; +} + +interface StoreExceptionsInformation extends ExceptionInformation { + siteName?: string; + explanationString?: string; + detailURI?: string; +} + +interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation { + arrayOfDomainStrings?: string[]; +} + +interface UIEventInit extends EventInit { + view?: Window; + detail?: number; } interface WebGLContextAttributes { @@ -5104,526 +5169,1863 @@ interface WebGLContextAttributes { preserveDrawingBuffer?: boolean; } -interface NodeListOf extends NodeList { - length: number; - item(index: number): TNode; - [index: number]: TNode; +interface WebGLContextEventInit extends EventInit { + statusMessage?: string; } -interface HTMLElement extends Element, ElementCSSInlineStyle, MSEventAttachmentTarget, MSNodeExtensions { - hidden: any; - readyState: any; - onmouseleave: (ev: MouseEvent) => any; - onbeforecut: (ev: DragEvent) => any; - onkeydown: (ev: KeyboardEvent) => any; - onmove: (ev: MSEventObj) => any; - onkeyup: (ev: KeyboardEvent) => any; - onreset: (ev: Event) => any; - onhelp: (ev: Event) => any; - ondragleave: (ev: DragEvent) => any; - className: string; - onfocusin: (ev: FocusEvent) => any; - onseeked: (ev: Event) => any; - recordNumber: any; - title: string; - parentTextEdit: Element; - outerHTML: string; - ondurationchange: (ev: Event) => any; - offsetHeight: number; - all: HTMLCollection; - onblur: (ev: FocusEvent) => any; - dir: string; - onemptied: (ev: Event) => any; - onseeking: (ev: Event) => any; - oncanplay: (ev: Event) => any; - ondeactivate: (ev: UIEvent) => any; - ondatasetchanged: (ev: MSEventObj) => any; - onrowsdelete: (ev: MSEventObj) => any; - sourceIndex: number; - onloadstart: (ev: Event) => any; - onlosecapture: (ev: MSEventObj) => any; - ondragenter: (ev: DragEvent) => any; - oncontrolselect: (ev: MSEventObj) => any; - onsubmit: (ev: Event) => any; - behaviorUrns: MSBehaviorUrnsCollection; - scopeName: string; - onchange: (ev: Event) => any; - id: string; - onlayoutcomplete: (ev: MSEventObj) => any; - uniqueID: string; - onbeforeactivate: (ev: UIEvent) => any; - oncanplaythrough: (ev: Event) => any; - onbeforeupdate: (ev: MSEventObj) => any; - onfilterchange: (ev: MSEventObj) => any; - offsetParent: Element; - ondatasetcomplete: (ev: MSEventObj) => any; - onsuspend: (ev: Event) => any; - onmouseenter: (ev: MouseEvent) => any; - innerText: string; - onerrorupdate: (ev: MSEventObj) => any; - onmouseout: (ev: MouseEvent) => any; - parentElement: HTMLElement; - onmousewheel: (ev: MouseWheelEvent) => any; - onvolumechange: (ev: Event) => any; - oncellchange: (ev: MSEventObj) => any; - onrowexit: (ev: MSEventObj) => any; - onrowsinserted: (ev: MSEventObj) => any; - onpropertychange: (ev: MSEventObj) => any; - filters: any; - children: HTMLCollection; - ondragend: (ev: DragEvent) => any; - onbeforepaste: (ev: DragEvent) => any; - ondragover: (ev: DragEvent) => any; - offsetTop: number; - onmouseup: (ev: MouseEvent) => any; - ondragstart: (ev: DragEvent) => any; - onbeforecopy: (ev: DragEvent) => any; - ondrag: (ev: DragEvent) => any; - innerHTML: string; - onmouseover: (ev: MouseEvent) => any; - lang: string; - uniqueNumber: number; - onpause: (ev: Event) => any; - tagUrn: string; - onmousedown: (ev: MouseEvent) => any; - onclick: (ev: MouseEvent) => any; - onwaiting: (ev: Event) => any; - onresizestart: (ev: MSEventObj) => any; - offsetLeft: number; - isTextEdit: boolean; - isDisabled: boolean; - onpaste: (ev: DragEvent) => any; - canHaveHTML: boolean; - onmoveend: (ev: MSEventObj) => any; - language: string; - onstalled: (ev: Event) => any; - onmousemove: (ev: MouseEvent) => any; - style: MSStyleCSSProperties; - isContentEditable: boolean; - onbeforeeditfocus: (ev: MSEventObj) => any; - onratechange: (ev: Event) => any; - contentEditable: string; - tabIndex: number; - document: Document; +interface WheelEventInit extends MouseEventInit { + deltaX?: number; + deltaY?: number; + deltaZ?: number; + deltaMode?: number; +} + +interface EventListener { + (evt: Event): void; +} + +interface ANGLE_instanced_arrays { + drawArraysInstancedANGLE(mode: number, first: number, count: number, primcount: number): void; + drawElementsInstancedANGLE(mode: number, count: number, type: number, offset: number, primcount: number): void; + vertexAttribDivisorANGLE(index: number, divisor: number): void; + VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; +} + +declare var ANGLE_instanced_arrays: { + prototype: ANGLE_instanced_arrays; + new(): ANGLE_instanced_arrays; + VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; +} + +interface AnalyserNode extends AudioNode { + fftSize: number; + frequencyBinCount: number; + maxDecibels: number; + minDecibels: number; + smoothingTimeConstant: number; + getByteFrequencyData(array: Uint8Array): void; + getByteTimeDomainData(array: Uint8Array): void; + getFloatFrequencyData(array: any): void; + getFloatTimeDomainData(array: any): void; +} + +declare var AnalyserNode: { + prototype: AnalyserNode; + new(): AnalyserNode; +} + +interface AnimationEvent extends Event { + animationName: string; + elapsedTime: number; + initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void; +} + +declare var AnimationEvent: { + prototype: AnimationEvent; + new(): AnimationEvent; +} + +interface ApplicationCache extends EventTarget { + oncached: (ev: Event) => any; + onchecking: (ev: Event) => any; + ondownloading: (ev: Event) => any; + onerror: (ev: Event) => any; + onnoupdate: (ev: Event) => any; + onobsolete: (ev: Event) => any; onprogress: (ev: ProgressEvent) => any; - ondblclick: (ev: MouseEvent) => any; - oncontextmenu: (ev: MouseEvent) => any; - onloadedmetadata: (ev: Event) => any; - onafterupdate: (ev: MSEventObj) => any; - onerror: (ev: ErrorEvent) => any; - onplay: (ev: Event) => any; - onresizeend: (ev: MSEventObj) => any; - onplaying: (ev: Event) => any; - isMultiLine: boolean; - onfocusout: (ev: FocusEvent) => any; - onabort: (ev: UIEvent) => any; - ondataavailable: (ev: MSEventObj) => any; - hideFocus: boolean; - onreadystatechange: (ev: Event) => any; - onkeypress: (ev: KeyboardEvent) => any; - onloadeddata: (ev: Event) => any; - onbeforedeactivate: (ev: UIEvent) => any; - outerText: string; - disabled: boolean; - onactivate: (ev: UIEvent) => any; - accessKey: string; - onmovestart: (ev: MSEventObj) => any; - onselectstart: (ev: Event) => any; - onfocus: (ev: FocusEvent) => any; - ontimeupdate: (ev: Event) => any; - onresize: (ev: UIEvent) => any; - oncut: (ev: DragEvent) => any; - onselect: (ev: UIEvent) => any; - ondrop: (ev: DragEvent) => any; - offsetWidth: number; - oncopy: (ev: DragEvent) => any; - onended: (ev: Event) => any; - onscroll: (ev: UIEvent) => any; - onrowenter: (ev: MSEventObj) => any; - onload: (ev: Event) => any; - canHaveChildren: boolean; - oninput: (ev: Event) => any; - onmscontentzoom: (ev: MSEventObj) => any; - oncuechange: (ev: Event) => any; - spellcheck: boolean; - classList: DOMTokenList; - onmsmanipulationstatechanged: (ev: any) => any; - draggable: boolean; - dataset: DOMStringMap; - dragDrop(): boolean; - scrollIntoView(top?: boolean): void; - addFilter(filter: any): void; - setCapture(containerCapture?: boolean): void; - focus(): void; - getAdjacentText(where: string): string; - insertAdjacentText(where: string, text: string): void; - getElementsByClassName(classNames: string): NodeList; - setActive(): void; - removeFilter(filter: any): void; - blur(): void; - clearAttributes(): void; - releaseCapture(): void; - createControlRange(): ControlRangeCollection; - removeBehavior(cookie: number): boolean; - contains(child: HTMLElement): boolean; - click(): void; - insertAdjacentElement(position: string, insertedElement: Element): Element; - mergeAttributes(source: HTMLElement, preserveIdentity?: boolean): void; - replaceAdjacentText(where: string, newText: string): string; - applyElement(apply: Element, where?: string): Element; - addBehavior(bstrUrl: string, factory?: any): number; - insertAdjacentHTML(where: string, html: string): void; - msGetInputContext(): MSInputMethodContext; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + onupdateready: (ev: Event) => any; + status: number; + abort(): void; + swapCache(): void; + update(): void; + CHECKING: number; + DOWNLOADING: number; + IDLE: number; + OBSOLETE: number; + UNCACHED: number; + UPDATEREADY: number; + addEventListener(type: "cached", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "checking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "downloading", listener: (ev: Event) => any, useCapture?: boolean): void; addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLElement: { - prototype: HTMLElement; - new(): HTMLElement; + addEventListener(type: "noupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "obsolete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "updateready", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface Document extends Node, NodeSelector, MSEventAttachmentTarget, DocumentEvent, MSResourceMetadata, MSNodeExtensions, MSDocumentExtensions, GlobalEventHandlers { +declare var ApplicationCache: { + prototype: ApplicationCache; + new(): ApplicationCache; + CHECKING: number; + DOWNLOADING: number; + IDLE: number; + OBSOLETE: number; + UNCACHED: number; + UPDATEREADY: number; +} + +interface AriaRequestEvent extends Event { + attributeName: string; + attributeValue: string; +} + +declare var AriaRequestEvent: { + prototype: AriaRequestEvent; + new(type: string, eventInitDict?: AriaRequestEventInit): AriaRequestEvent; +} + +interface Attr extends Node { + name: string; + ownerElement: Element; + specified: boolean; + value: string; +} + +declare var Attr: { + prototype: Attr; + new(): Attr; +} + +interface AudioBuffer { + duration: number; + length: number; + numberOfChannels: number; + sampleRate: number; + getChannelData(channel: number): any; +} + +declare var AudioBuffer: { + prototype: AudioBuffer; + new(): AudioBuffer; +} + +interface AudioBufferSourceNode extends AudioNode { + buffer: AudioBuffer; + loop: boolean; + loopEnd: number; + loopStart: number; + onended: (ev: Event) => any; + playbackRate: AudioParam; + start(when?: number, offset?: number, duration?: number): void; + stop(when?: number): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var AudioBufferSourceNode: { + prototype: AudioBufferSourceNode; + new(): AudioBufferSourceNode; +} + +interface AudioContext extends EventTarget { + currentTime: number; + destination: AudioDestinationNode; + listener: AudioListener; + sampleRate: number; + createAnalyser(): AnalyserNode; + createBiquadFilter(): BiquadFilterNode; + createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer; + createBufferSource(): AudioBufferSourceNode; + createChannelMerger(numberOfInputs?: number): ChannelMergerNode; + createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode; + createConvolver(): ConvolverNode; + createDelay(maxDelayTime?: number): DelayNode; + createDynamicsCompressor(): DynamicsCompressorNode; + createGain(): GainNode; + createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode; + createOscillator(): OscillatorNode; + createPanner(): PannerNode; + createPeriodicWave(real: any, imag: any): PeriodicWave; + createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode; + createStereoPanner(): StereoPannerNode; + createWaveShaper(): WaveShaperNode; + decodeAudioData(audioData: ArrayBuffer, successCallback: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): void; +} + +declare var AudioContext: { + prototype: AudioContext; + new(): AudioContext; +} + +interface AudioDestinationNode extends AudioNode { + maxChannelCount: number; +} + +declare var AudioDestinationNode: { + prototype: AudioDestinationNode; + new(): AudioDestinationNode; +} + +interface AudioListener { + dopplerFactor: number; + speedOfSound: number; + setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void; + setPosition(x: number, y: number, z: number): void; + setVelocity(x: number, y: number, z: number): void; +} + +declare var AudioListener: { + prototype: AudioListener; + new(): AudioListener; +} + +interface AudioNode extends EventTarget { + channelCount: number; + channelCountMode: string; + channelInterpretation: string; + context: AudioContext; + numberOfInputs: number; + numberOfOutputs: number; + connect(destination: AudioNode, output?: number, input?: number): void; + disconnect(output?: number): void; +} + +declare var AudioNode: { + prototype: AudioNode; + new(): AudioNode; +} + +interface AudioParam { + defaultValue: number; + value: number; + cancelScheduledValues(startTime: number): void; + exponentialRampToValueAtTime(value: number, endTime: number): void; + linearRampToValueAtTime(value: number, endTime: number): void; + setTargetAtTime(target: number, startTime: number, timeConstant: number): void; + setValueAtTime(value: number, startTime: number): void; + setValueCurveAtTime(values: any, startTime: number, duration: number): void; +} + +declare var AudioParam: { + prototype: AudioParam; + new(): AudioParam; +} + +interface AudioProcessingEvent extends Event { + inputBuffer: AudioBuffer; + outputBuffer: AudioBuffer; + playbackTime: number; +} + +declare var AudioProcessingEvent: { + prototype: AudioProcessingEvent; + new(): AudioProcessingEvent; +} + +interface AudioTrack { + enabled: boolean; + id: string; + kind: string; + label: string; + language: string; + sourceBuffer: SourceBuffer; +} + +declare var AudioTrack: { + prototype: AudioTrack; + new(): AudioTrack; +} + +interface AudioTrackList extends EventTarget { + length: number; + onaddtrack: (ev: TrackEvent) => any; + onchange: (ev: Event) => any; + onremovetrack: (ev: TrackEvent) => any; + getTrackById(id: string): AudioTrack; + item(index: number): AudioTrack; + addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "removetrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: AudioTrack; +} + +declare var AudioTrackList: { + prototype: AudioTrackList; + new(): AudioTrackList; +} + +interface BarProp { + visible: boolean; +} + +declare var BarProp: { + prototype: BarProp; + new(): BarProp; +} + +interface BeforeUnloadEvent extends Event { + returnValue: any; +} + +declare var BeforeUnloadEvent: { + prototype: BeforeUnloadEvent; + new(): BeforeUnloadEvent; +} + +interface BiquadFilterNode extends AudioNode { + Q: AudioParam; + detune: AudioParam; + frequency: AudioParam; + gain: AudioParam; + type: string; + getFrequencyResponse(frequencyHz: any, magResponse: any, phaseResponse: any): void; +} + +declare var BiquadFilterNode: { + prototype: BiquadFilterNode; + new(): BiquadFilterNode; +} + +interface Blob { + size: number; + type: string; + msClose(): void; + msDetachStream(): any; + slice(start?: number, end?: number, contentType?: string): Blob; +} + +declare var Blob: { + prototype: Blob; + new (blobParts?: any[], options?: BlobPropertyBag): Blob; +} + +interface CDATASection extends Text { +} + +declare var CDATASection: { + prototype: CDATASection; + new(): CDATASection; +} + +interface CSS { + supports(property: string, value?: string): boolean; +} +declare var CSS: CSS; + +interface CSSConditionRule extends CSSGroupingRule { + conditionText: string; +} + +declare var CSSConditionRule: { + prototype: CSSConditionRule; + new(): CSSConditionRule; +} + +interface CSSFontFaceRule extends CSSRule { + style: CSSStyleDeclaration; +} + +declare var CSSFontFaceRule: { + prototype: CSSFontFaceRule; + new(): CSSFontFaceRule; +} + +interface CSSGroupingRule extends CSSRule { + cssRules: CSSRuleList; + deleteRule(index?: number): void; + insertRule(rule: string, index?: number): number; +} + +declare var CSSGroupingRule: { + prototype: CSSGroupingRule; + new(): CSSGroupingRule; +} + +interface CSSImportRule extends CSSRule { + href: string; + media: MediaList; + styleSheet: CSSStyleSheet; +} + +declare var CSSImportRule: { + prototype: CSSImportRule; + new(): CSSImportRule; +} + +interface CSSKeyframeRule extends CSSRule { + keyText: string; + style: CSSStyleDeclaration; +} + +declare var CSSKeyframeRule: { + prototype: CSSKeyframeRule; + new(): CSSKeyframeRule; +} + +interface CSSKeyframesRule extends CSSRule { + cssRules: CSSRuleList; + name: string; + appendRule(rule: string): void; + deleteRule(rule: string): void; + findRule(rule: string): CSSKeyframeRule; +} + +declare var CSSKeyframesRule: { + prototype: CSSKeyframesRule; + new(): CSSKeyframesRule; +} + +interface CSSMediaRule extends CSSConditionRule { + media: MediaList; +} + +declare var CSSMediaRule: { + prototype: CSSMediaRule; + new(): CSSMediaRule; +} + +interface CSSNamespaceRule extends CSSRule { + namespaceURI: string; + prefix: string; +} + +declare var CSSNamespaceRule: { + prototype: CSSNamespaceRule; + new(): CSSNamespaceRule; +} + +interface CSSPageRule extends CSSRule { + pseudoClass: string; + selector: string; + selectorText: string; + style: CSSStyleDeclaration; +} + +declare var CSSPageRule: { + prototype: CSSPageRule; + new(): CSSPageRule; +} + +interface CSSRule { + cssText: string; + parentRule: CSSRule; + parentStyleSheet: CSSStyleSheet; + type: number; + CHARSET_RULE: number; + FONT_FACE_RULE: number; + IMPORT_RULE: number; + KEYFRAMES_RULE: number; + KEYFRAME_RULE: number; + MEDIA_RULE: number; + NAMESPACE_RULE: number; + PAGE_RULE: number; + STYLE_RULE: number; + SUPPORTS_RULE: number; + UNKNOWN_RULE: number; + VIEWPORT_RULE: number; +} + +declare var CSSRule: { + prototype: CSSRule; + new(): CSSRule; + CHARSET_RULE: number; + FONT_FACE_RULE: number; + IMPORT_RULE: number; + KEYFRAMES_RULE: number; + KEYFRAME_RULE: number; + MEDIA_RULE: number; + NAMESPACE_RULE: number; + PAGE_RULE: number; + STYLE_RULE: number; + SUPPORTS_RULE: number; + UNKNOWN_RULE: number; + VIEWPORT_RULE: number; +} + +interface CSSRuleList { + length: number; + item(index: number): CSSRule; + [index: number]: CSSRule; +} + +declare var CSSRuleList: { + prototype: CSSRuleList; + new(): CSSRuleList; +} + +interface CSSStyleDeclaration { + alignContent: string; + alignItems: string; + alignSelf: string; + alignmentBaseline: string; + animation: string; + animationDelay: string; + animationDirection: string; + animationDuration: string; + animationFillMode: string; + animationIterationCount: string; + animationName: string; + animationPlayState: string; + animationTimingFunction: string; + backfaceVisibility: string; + background: string; + backgroundAttachment: string; + backgroundClip: string; + backgroundColor: string; + backgroundImage: string; + backgroundOrigin: string; + backgroundPosition: string; + backgroundPositionX: string; + backgroundPositionY: string; + backgroundRepeat: string; + backgroundSize: string; + baselineShift: string; + border: string; + borderBottom: string; + borderBottomColor: string; + borderBottomLeftRadius: string; + borderBottomRightRadius: string; + borderBottomStyle: string; + borderBottomWidth: string; + borderCollapse: string; + borderColor: string; + borderImage: string; + borderImageOutset: string; + borderImageRepeat: string; + borderImageSlice: string; + borderImageSource: string; + borderImageWidth: string; + borderLeft: string; + borderLeftColor: string; + borderLeftStyle: string; + borderLeftWidth: string; + borderRadius: string; + borderRight: string; + borderRightColor: string; + borderRightStyle: string; + borderRightWidth: string; + borderSpacing: string; + borderStyle: string; + borderTop: string; + borderTopColor: string; + borderTopLeftRadius: string; + borderTopRightRadius: string; + borderTopStyle: string; + borderTopWidth: string; + borderWidth: string; + bottom: string; + boxShadow: string; + boxSizing: string; + breakAfter: string; + breakBefore: string; + breakInside: string; + captionSide: string; + clear: string; + clip: string; + clipPath: string; + clipRule: string; + color: string; + colorInterpolationFilters: string; + columnCount: any; + columnFill: string; + columnGap: any; + columnRule: string; + columnRuleColor: any; + columnRuleStyle: string; + columnRuleWidth: any; + columnSpan: string; + columnWidth: any; + columns: string; + content: string; + counterIncrement: string; + counterReset: string; + cssFloat: string; + cssText: string; + cursor: string; + direction: string; + display: string; + dominantBaseline: string; + emptyCells: string; + enableBackground: string; + fill: string; + fillOpacity: string; + fillRule: string; + filter: string; + flex: string; + flexBasis: string; + flexDirection: string; + flexFlow: string; + flexGrow: string; + flexShrink: string; + flexWrap: string; + floodColor: string; + floodOpacity: string; + font: string; + fontFamily: string; + fontFeatureSettings: string; + fontSize: string; + fontSizeAdjust: string; + fontStretch: string; + fontStyle: string; + fontVariant: string; + fontWeight: string; + glyphOrientationHorizontal: string; + glyphOrientationVertical: string; + height: string; + imeMode: string; + justifyContent: string; + kerning: string; + left: string; + length: number; + letterSpacing: string; + lightingColor: string; + lineHeight: string; + listStyle: string; + listStyleImage: string; + listStylePosition: string; + listStyleType: string; + margin: string; + marginBottom: string; + marginLeft: string; + marginRight: string; + marginTop: string; + marker: string; + markerEnd: string; + markerMid: string; + markerStart: string; + mask: string; + maxHeight: string; + maxWidth: string; + minHeight: string; + minWidth: string; + msContentZoomChaining: string; + msContentZoomLimit: string; + msContentZoomLimitMax: any; + msContentZoomLimitMin: any; + msContentZoomSnap: string; + msContentZoomSnapPoints: string; + msContentZoomSnapType: string; + msContentZooming: string; + msFlowFrom: string; + msFlowInto: string; + msFontFeatureSettings: string; + msGridColumn: any; + msGridColumnAlign: string; + msGridColumnSpan: any; + msGridColumns: string; + msGridRow: any; + msGridRowAlign: string; + msGridRowSpan: any; + msGridRows: string; + msHighContrastAdjust: string; + msHyphenateLimitChars: string; + msHyphenateLimitLines: any; + msHyphenateLimitZone: any; + msHyphens: string; + msImeAlign: string; + msOverflowStyle: string; + msScrollChaining: string; + msScrollLimit: string; + msScrollLimitXMax: any; + msScrollLimitXMin: any; + msScrollLimitYMax: any; + msScrollLimitYMin: any; + msScrollRails: string; + msScrollSnapPointsX: string; + msScrollSnapPointsY: string; + msScrollSnapType: string; + msScrollSnapX: string; + msScrollSnapY: string; + msScrollTranslation: string; + msTextCombineHorizontal: string; + msTextSizeAdjust: any; + msTouchAction: string; + msTouchSelect: string; + msUserSelect: string; + msWrapFlow: string; + msWrapMargin: any; + msWrapThrough: string; + opacity: string; + order: string; + orphans: string; + outline: string; + outlineColor: string; + outlineStyle: string; + outlineWidth: string; + overflow: string; + overflowX: string; + overflowY: string; + padding: string; + paddingBottom: string; + paddingLeft: string; + paddingRight: string; + paddingTop: string; + pageBreakAfter: string; + pageBreakBefore: string; + pageBreakInside: string; + parentRule: CSSRule; + perspective: string; + perspectiveOrigin: string; + pointerEvents: string; + position: string; + quotes: string; + right: string; + rubyAlign: string; + rubyOverhang: string; + rubyPosition: string; + stopColor: string; + stopOpacity: string; + stroke: string; + strokeDasharray: string; + strokeDashoffset: string; + strokeLinecap: string; + strokeLinejoin: string; + strokeMiterlimit: string; + strokeOpacity: string; + strokeWidth: string; + tableLayout: string; + textAlign: string; + textAlignLast: string; + textAnchor: string; + textDecoration: string; + textFillColor: string; + textIndent: string; + textJustify: string; + textKashida: string; + textKashidaSpace: string; + textOverflow: string; + textShadow: string; + textTransform: string; + textUnderlinePosition: string; + top: string; + touchAction: string; + transform: string; + transformOrigin: string; + transformStyle: string; + transition: string; + transitionDelay: string; + transitionDuration: string; + transitionProperty: string; + transitionTimingFunction: string; + unicodeBidi: string; + verticalAlign: string; + visibility: string; + webkitAlignContent: string; + webkitAlignItems: string; + webkitAlignSelf: string; + webkitAnimation: string; + webkitAnimationDelay: string; + webkitAnimationDirection: string; + webkitAnimationDuration: string; + webkitAnimationFillMode: string; + webkitAnimationIterationCount: string; + webkitAnimationName: string; + webkitAnimationPlayState: string; + webkitAnimationTimingFunction: string; + webkitAppearance: string; + webkitBackfaceVisibility: string; + webkitBackground: string; + webkitBackgroundAttachment: string; + webkitBackgroundClip: string; + webkitBackgroundColor: string; + webkitBackgroundImage: string; + webkitBackgroundOrigin: string; + webkitBackgroundPosition: string; + webkitBackgroundPositionX: string; + webkitBackgroundPositionY: string; + webkitBackgroundRepeat: string; + webkitBackgroundSize: string; + webkitBorderBottomLeftRadius: string; + webkitBorderBottomRightRadius: string; + webkitBorderImage: string; + webkitBorderImageOutset: string; + webkitBorderImageRepeat: string; + webkitBorderImageSlice: string; + webkitBorderImageSource: string; + webkitBorderImageWidth: string; + webkitBorderRadius: string; + webkitBorderTopLeftRadius: string; + webkitBorderTopRightRadius: string; + webkitBoxAlign: string; + webkitBoxDirection: string; + webkitBoxFlex: string; + webkitBoxOrdinalGroup: string; + webkitBoxOrient: string; + webkitBoxPack: string; + webkitBoxSizing: string; + webkitColumnBreakAfter: string; + webkitColumnBreakBefore: string; + webkitColumnBreakInside: string; + webkitColumnCount: any; + webkitColumnGap: any; + webkitColumnRule: string; + webkitColumnRuleColor: any; + webkitColumnRuleStyle: string; + webkitColumnRuleWidth: any; + webkitColumnSpan: string; + webkitColumnWidth: any; + webkitColumns: string; + webkitFilter: string; + webkitFlex: string; + webkitFlexBasis: string; + webkitFlexDirection: string; + webkitFlexFlow: string; + webkitFlexGrow: string; + webkitFlexShrink: string; + webkitFlexWrap: string; + webkitJustifyContent: string; + webkitOrder: string; + webkitPerspective: string; + webkitPerspectiveOrigin: string; + webkitTapHighlightColor: string; + webkitTextFillColor: string; + webkitTextSizeAdjust: any; + webkitTransform: string; + webkitTransformOrigin: string; + webkitTransformStyle: string; + webkitTransition: string; + webkitTransitionDelay: string; + webkitTransitionDuration: string; + webkitTransitionProperty: string; + webkitTransitionTimingFunction: string; + webkitUserSelect: string; + webkitWritingMode: string; + whiteSpace: string; + widows: string; + width: string; + wordBreak: string; + wordSpacing: string; + wordWrap: string; + writingMode: string; + zIndex: string; + zoom: string; + getPropertyPriority(propertyName: string): string; + getPropertyValue(propertyName: string): string; + item(index: number): string; + removeProperty(propertyName: string): string; + setProperty(propertyName: string, value: string, priority?: string): void; + [index: number]: string; +} + +declare var CSSStyleDeclaration: { + prototype: CSSStyleDeclaration; + new(): CSSStyleDeclaration; +} + +interface CSSStyleRule extends CSSRule { + readOnly: boolean; + selectorText: string; + style: CSSStyleDeclaration; +} + +declare var CSSStyleRule: { + prototype: CSSStyleRule; + new(): CSSStyleRule; +} + +interface CSSStyleSheet extends StyleSheet { + cssRules: CSSRuleList; + cssText: string; + href: string; + id: string; + imports: StyleSheetList; + isAlternate: boolean; + isPrefAlternate: boolean; + ownerRule: CSSRule; + owningElement: Element; + pages: StyleSheetPageList; + readOnly: boolean; + rules: CSSRuleList; + addImport(bstrURL: string, lIndex?: number): number; + addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; + addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number; + deleteRule(index?: number): void; + insertRule(rule: string, index?: number): number; + removeImport(lIndex: number): void; + removeRule(lIndex: number): void; +} + +declare var CSSStyleSheet: { + prototype: CSSStyleSheet; + new(): CSSStyleSheet; +} + +interface CSSSupportsRule extends CSSConditionRule { +} + +declare var CSSSupportsRule: { + prototype: CSSSupportsRule; + new(): CSSSupportsRule; +} + +interface CanvasGradient { + addColorStop(offset: number, color: string): void; +} + +declare var CanvasGradient: { + prototype: CanvasGradient; + new(): CanvasGradient; +} + +interface CanvasPattern { +} + +declare var CanvasPattern: { + prototype: CanvasPattern; + new(): CanvasPattern; +} + +interface CanvasRenderingContext2D { + canvas: HTMLCanvasElement; + fillStyle: any; + font: string; + globalAlpha: number; + globalCompositeOperation: string; + lineCap: string; + lineDashOffset: number; + lineJoin: string; + lineWidth: number; + miterLimit: number; + msFillRule: string; + msImageSmoothingEnabled: boolean; + shadowBlur: number; + shadowColor: string; + shadowOffsetX: number; + shadowOffsetY: number; + strokeStyle: any; + textAlign: string; + textBaseline: string; + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; + arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; + beginPath(): void; + bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; + clearRect(x: number, y: number, w: number, h: number): void; + clip(fillRule?: string): void; + closePath(): void; + createImageData(imageDataOrSw: number, sh?: number): ImageData; + createImageData(imageDataOrSw: ImageData, sh?: number): ImageData; + createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; + createPattern(image: HTMLImageElement, repetition: string): CanvasPattern; + createPattern(image: HTMLCanvasElement, repetition: string): CanvasPattern; + createPattern(image: HTMLVideoElement, repetition: string): CanvasPattern; + createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; + drawImage(image: HTMLImageElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; + drawImage(image: HTMLCanvasElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; + drawImage(image: HTMLVideoElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; + fill(fillRule?: string): void; + fillRect(x: number, y: number, w: number, h: number): void; + fillText(text: string, x: number, y: number, maxWidth?: number): void; + getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; + getLineDash(): number[]; + isPointInPath(x: number, y: number, fillRule?: string): boolean; + lineTo(x: number, y: number): void; + measureText(text: string): TextMetrics; + moveTo(x: number, y: number): void; + putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void; + quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; + rect(x: number, y: number, w: number, h: number): void; + restore(): void; + rotate(angle: number): void; + save(): void; + scale(x: number, y: number): void; + setLineDash(segments: number[]): void; + setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; + stroke(): void; + strokeRect(x: number, y: number, w: number, h: number): void; + strokeText(text: string, x: number, y: number, maxWidth?: number): void; + transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; + translate(x: number, y: number): void; +} + +declare var CanvasRenderingContext2D: { + prototype: CanvasRenderingContext2D; + new(): CanvasRenderingContext2D; +} + +interface ChannelMergerNode extends AudioNode { +} + +declare var ChannelMergerNode: { + prototype: ChannelMergerNode; + new(): ChannelMergerNode; +} + +interface ChannelSplitterNode extends AudioNode { +} + +declare var ChannelSplitterNode: { + prototype: ChannelSplitterNode; + new(): ChannelSplitterNode; +} + +interface CharacterData extends Node, ChildNode { + data: string; + length: number; + appendData(arg: string): void; + deleteData(offset: number, count: number): void; + insertData(offset: number, arg: string): void; + replaceData(offset: number, count: number, arg: string): void; + substringData(offset: number, count: number): string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var CharacterData: { + prototype: CharacterData; + new(): CharacterData; +} + +interface ClientRect { + bottom: number; + height: number; + left: number; + right: number; + top: number; + width: number; +} + +declare var ClientRect: { + prototype: ClientRect; + new(): ClientRect; +} + +interface ClientRectList { + length: number; + item(index: number): ClientRect; + [index: number]: ClientRect; +} + +declare var ClientRectList: { + prototype: ClientRectList; + new(): ClientRectList; +} + +interface ClipboardEvent extends Event { + clipboardData: DataTransfer; +} + +declare var ClipboardEvent: { + prototype: ClipboardEvent; + new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent; +} + +interface CloseEvent extends Event { + code: number; + reason: string; + wasClean: boolean; + initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; +} + +declare var CloseEvent: { + prototype: CloseEvent; + new(): CloseEvent; +} + +interface CommandEvent extends Event { + commandName: string; + detail: string; +} + +declare var CommandEvent: { + prototype: CommandEvent; + new(type: string, eventInitDict?: CommandEventInit): CommandEvent; +} + +interface Comment extends CharacterData { + text: string; +} + +declare var Comment: { + prototype: Comment; + new(): Comment; +} + +interface CompositionEvent extends UIEvent { + data: string; + locale: string; + initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void; +} + +declare var CompositionEvent: { + prototype: CompositionEvent; + new(typeArg: string, eventInitDict?: CompositionEventInit): CompositionEvent; +} + +interface Console { + assert(test?: boolean, message?: string, ...optionalParams: any[]): void; + clear(): void; + count(countTitle?: string): void; + debug(message?: string, ...optionalParams: any[]): void; + dir(value?: any, ...optionalParams: any[]): void; + dirxml(value: any): void; + error(message?: any, ...optionalParams: any[]): void; + group(groupTitle?: string): void; + groupCollapsed(groupTitle?: string): void; + groupEnd(): void; + info(message?: any, ...optionalParams: any[]): void; + log(message?: any, ...optionalParams: any[]): void; + msIsIndependentlyComposed(element: Element): boolean; + profile(reportName?: string): void; + profileEnd(): void; + select(element: Element): void; + time(timerName?: string): void; + timeEnd(timerName?: string): void; + trace(): void; + warn(message?: any, ...optionalParams: any[]): void; +} + +declare var Console: { + prototype: Console; + new(): Console; +} + +interface ConvolverNode extends AudioNode { + buffer: AudioBuffer; + normalize: boolean; +} + +declare var ConvolverNode: { + prototype: ConvolverNode; + new(): ConvolverNode; +} + +interface Coordinates { + accuracy: number; + altitude: number; + altitudeAccuracy: number; + heading: number; + latitude: number; + longitude: number; + speed: number; +} + +declare var Coordinates: { + prototype: Coordinates; + new(): Coordinates; +} + +interface Crypto extends Object, RandomSource { + subtle: SubtleCrypto; +} + +declare var Crypto: { + prototype: Crypto; + new(): Crypto; +} + +interface CryptoKey { + algorithm: KeyAlgorithm; + extractable: boolean; + type: string; + usages: string[]; +} + +declare var CryptoKey: { + prototype: CryptoKey; + new(): CryptoKey; +} + +interface CryptoKeyPair { + privateKey: CryptoKey; + publicKey: CryptoKey; +} + +declare var CryptoKeyPair: { + prototype: CryptoKeyPair; + new(): CryptoKeyPair; +} + +interface CustomEvent extends Event { + detail: any; + initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void; +} + +declare var CustomEvent: { + prototype: CustomEvent; + new(typeArg: string, eventInitDict?: CustomEventInit): CustomEvent; +} + +interface DOMError { + name: string; + toString(): string; +} + +declare var DOMError: { + prototype: DOMError; + new(): DOMError; +} + +interface DOMException { + code: number; + message: string; + name: string; + toString(): string; + ABORT_ERR: number; + DATA_CLONE_ERR: number; + DOMSTRING_SIZE_ERR: number; + HIERARCHY_REQUEST_ERR: number; + INDEX_SIZE_ERR: number; + INUSE_ATTRIBUTE_ERR: number; + INVALID_ACCESS_ERR: number; + INVALID_CHARACTER_ERR: number; + INVALID_MODIFICATION_ERR: number; + INVALID_NODE_TYPE_ERR: number; + INVALID_STATE_ERR: number; + NAMESPACE_ERR: number; + NETWORK_ERR: number; + NOT_FOUND_ERR: number; + NOT_SUPPORTED_ERR: number; + NO_DATA_ALLOWED_ERR: number; + NO_MODIFICATION_ALLOWED_ERR: number; + PARSE_ERR: number; + QUOTA_EXCEEDED_ERR: number; + SECURITY_ERR: number; + SERIALIZE_ERR: number; + SYNTAX_ERR: number; + TIMEOUT_ERR: number; + TYPE_MISMATCH_ERR: number; + URL_MISMATCH_ERR: number; + VALIDATION_ERR: number; + WRONG_DOCUMENT_ERR: number; +} + +declare var DOMException: { + prototype: DOMException; + new(): DOMException; + ABORT_ERR: number; + DATA_CLONE_ERR: number; + DOMSTRING_SIZE_ERR: number; + HIERARCHY_REQUEST_ERR: number; + INDEX_SIZE_ERR: number; + INUSE_ATTRIBUTE_ERR: number; + INVALID_ACCESS_ERR: number; + INVALID_CHARACTER_ERR: number; + INVALID_MODIFICATION_ERR: number; + INVALID_NODE_TYPE_ERR: number; + INVALID_STATE_ERR: number; + NAMESPACE_ERR: number; + NETWORK_ERR: number; + NOT_FOUND_ERR: number; + NOT_SUPPORTED_ERR: number; + NO_DATA_ALLOWED_ERR: number; + NO_MODIFICATION_ALLOWED_ERR: number; + PARSE_ERR: number; + QUOTA_EXCEEDED_ERR: number; + SECURITY_ERR: number; + SERIALIZE_ERR: number; + SYNTAX_ERR: number; + TIMEOUT_ERR: number; + TYPE_MISMATCH_ERR: number; + URL_MISMATCH_ERR: number; + VALIDATION_ERR: number; + WRONG_DOCUMENT_ERR: number; +} + +interface DOMImplementation { + createDocument(namespaceURI: string, qualifiedName: string, doctype: DocumentType): Document; + createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; + createHTMLDocument(title: string): Document; + hasFeature(feature: string, version: string): boolean; +} + +declare var DOMImplementation: { + prototype: DOMImplementation; + new(): DOMImplementation; +} + +interface DOMParser { + parseFromString(source: string, mimeType: string): Document; +} + +declare var DOMParser: { + prototype: DOMParser; + new(): DOMParser; +} + +interface DOMSettableTokenList extends DOMTokenList { + value: string; +} + +declare var DOMSettableTokenList: { + prototype: DOMSettableTokenList; + new(): DOMSettableTokenList; +} + +interface DOMStringList { + length: number; + contains(str: string): boolean; + item(index: number): string; + [index: number]: string; +} + +declare var DOMStringList: { + prototype: DOMStringList; + new(): DOMStringList; +} + +interface DOMStringMap { + [name: string]: string; +} + +declare var DOMStringMap: { + prototype: DOMStringMap; + new(): DOMStringMap; +} + +interface DOMTokenList { + length: number; + add(...token: string[]): void; + contains(token: string): boolean; + item(index: number): string; + remove(...token: string[]): void; + toString(): string; + toggle(token: string, force?: boolean): boolean; + [index: number]: string; +} + +declare var DOMTokenList: { + prototype: DOMTokenList; + new(): DOMTokenList; +} + +interface DataCue extends TextTrackCue { + data: ArrayBuffer; +} + +declare var DataCue: { + prototype: DataCue; + new(): DataCue; +} + +interface DataTransfer { + dropEffect: string; + effectAllowed: string; + files: FileList; + items: DataTransferItemList; + types: DOMStringList; + clearData(format?: string): boolean; + getData(format: string): string; + setData(format: string, data: string): boolean; +} + +declare var DataTransfer: { + prototype: DataTransfer; + new(): DataTransfer; +} + +interface DataTransferItem { + kind: string; + type: string; + getAsFile(): File; + getAsString(_callback: FunctionStringCallback): void; +} + +declare var DataTransferItem: { + prototype: DataTransferItem; + new(): DataTransferItem; +} + +interface DataTransferItemList { + length: number; + add(data: File): DataTransferItem; + clear(): void; + item(index: number): File; + remove(index: number): void; + [index: number]: File; +} + +declare var DataTransferItemList: { + prototype: DataTransferItemList; + new(): DataTransferItemList; +} + +interface DeferredPermissionRequest { + id: number; + type: string; + uri: string; + allow(): void; + deny(): void; +} + +declare var DeferredPermissionRequest: { + prototype: DeferredPermissionRequest; + new(): DeferredPermissionRequest; +} + +interface DelayNode extends AudioNode { + delayTime: AudioParam; +} + +declare var DelayNode: { + prototype: DelayNode; + new(): DelayNode; +} + +interface DeviceAcceleration { + x: number; + y: number; + z: number; +} + +declare var DeviceAcceleration: { + prototype: DeviceAcceleration; + new(): DeviceAcceleration; +} + +interface DeviceMotionEvent extends Event { + acceleration: DeviceAcceleration; + accelerationIncludingGravity: DeviceAcceleration; + interval: number; + rotationRate: DeviceRotationRate; + initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict, accelerationIncludingGravity: DeviceAccelerationDict, rotationRate: DeviceRotationRateDict, interval: number): void; +} + +declare var DeviceMotionEvent: { + prototype: DeviceMotionEvent; + new(): DeviceMotionEvent; +} + +interface DeviceOrientationEvent extends Event { + absolute: boolean; + alpha: number; + beta: number; + gamma: number; + initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number, beta: number, gamma: number, absolute: boolean): void; +} + +declare var DeviceOrientationEvent: { + prototype: DeviceOrientationEvent; + new(): DeviceOrientationEvent; +} + +interface DeviceRotationRate { + alpha: number; + beta: number; + gamma: number; +} + +declare var DeviceRotationRate: { + prototype: DeviceRotationRate; + new(): DeviceRotationRate; +} + +interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEvent { /** - * Gets a reference to the root node of the document. + * Sets or gets the URL for the current document. */ - documentElement: HTMLElement; + URL: string; /** - * Retrieves the collection of user agents and versions declared in the X-UA-Compatible + * Gets the URL for the document, stripped of any character encoding. */ - compatible: MSCompatibleInfoCollection; + URLUnencoded: string; /** - * Fires when the user presses a key. - * @param ev The keyboard event + * Gets the object that has the focus when the parent document has focus. */ - onkeydown: (ev: KeyboardEvent) => any; + activeElement: Element; /** - * Fires when the user releases a key. - * @param ev The keyboard event + * Sets or gets the color of all active links in the document. */ - onkeyup: (ev: KeyboardEvent) => any; - /** - * Gets the implementation object of the current document. - */ - implementation: DOMImplementation; - /** - * Fires when the user resets a form. - * @param ev The event. - */ - onreset: (ev: Event) => any; - /** - * Retrieves a collection of all script objects in the document. - */ - scripts: HTMLCollection; - /** - * Fires when the user presses the F1 key while the browser is the active window. - * @param ev The event. - */ - onhelp: (ev: Event) => any; - /** - * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. - * @param ev The drag event. - */ - ondragleave: (ev: DragEvent) => any; - /** - * Gets or sets the character set used to encode the object. - */ - charset: string; - /** - * Fires for an element just prior to setting focus on that element. - * @param ev The focus event - */ - onfocusin: (ev: FocusEvent) => any; - /** - * Sets or gets the color of the links that the user has visited. - */ - vlinkColor: string; - /** - * Occurs when the seek operation ends. - * @param ev The event. - */ - onseeked: (ev: Event) => any; - security: string; - /** - * Contains the title of the document. - */ - title: string; - /** - * Retrieves a collection of namespace objects. - */ - namespaces: MSNamespaceInfoCollection; - /** - * Gets the default character set from the current regional language settings. - */ - defaultCharset: string; - /** - * Retrieves a collection of all embed objects in the document. - */ - embeds: HTMLCollection; - /** - * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. - */ - styleSheets: StyleSheetList; - /** - * Retrieves a collection of all window objects defined by the given document or defined by the document associated with the given window. - */ - frames: Window; - /** - * Occurs when the duration attribute is updated. - * @param ev The event. - */ - ondurationchange: (ev: Event) => any; + alinkColor: string; /** * Returns a reference to the collection of elements contained by the object. */ all: HTMLCollection; + /** + * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. + */ + anchors: HTMLCollection; + /** + * Retrieves a collection of all applet objects in the document. + */ + applets: HTMLCollection; + /** + * Deprecated. Sets or retrieves a value that indicates the background color behind the object. + */ + bgColor: string; + /** + * Specifies the beginning and end of the document body. + */ + body: HTMLElement; + characterSet: string; + /** + * Gets or sets the character set used to encode the object. + */ + charset: string; + /** + * Gets a value that indicates whether standards-compliant mode is switched on for the object. + */ + compatMode: string; + cookie: string; + /** + * Gets the default character set from the current regional language settings. + */ + defaultCharset: string; + defaultView: Window; + /** + * Sets or gets a value that indicates whether the document can be edited. + */ + designMode: string; + /** + * Sets or retrieves a value that indicates the reading order of the object. + */ + dir: string; + /** + * Gets an object representing the document type declaration associated with the current document. + */ + doctype: DocumentType; + /** + * Gets a reference to the root node of the document. + */ + documentElement: HTMLElement; + /** + * Sets or gets the security domain of the document. + */ + domain: string; + /** + * Retrieves a collection of all embed objects in the document. + */ + embeds: HTMLCollection; + /** + * Sets or gets the foreground (text) color of the document. + */ + fgColor: string; /** * Retrieves a collection, in source order, of all form objects in the document. */ forms: HTMLCollection; + fullscreenElement: Element; + fullscreenEnabled: boolean; + head: HTMLHeadElement; + hidden: boolean; + /** + * Retrieves a collection, in source order, of img objects in the document. + */ + images: HTMLCollection; + /** + * Gets the implementation object of the current document. + */ + implementation: DOMImplementation; + /** + * Returns the character encoding used to create the webpage that is loaded into the document object. + */ + inputEncoding: string; + /** + * Gets the date that the page was last modified, if the page supplies one. + */ + lastModified: string; + /** + * Sets or gets the color of the document links. + */ + linkColor: string; + /** + * Retrieves a collection of all a objects that specify the href property and all area objects in the document. + */ + links: HTMLCollection; + /** + * Contains information about the current URL. + */ + location: Location; + media: string; + msCSSOMElementFloatMetrics: boolean; + msCapsLockWarningOff: boolean; + msHidden: boolean; + msVisibilityState: string; + /** + * Fires when the user aborts the download. + * @param ev The event. + */ + onabort: (ev: Event) => any; + /** + * Fires when the object is set as the active element. + * @param ev The event. + */ + onactivate: (ev: UIEvent) => any; + /** + * Fires immediately before the object is set as the active element. + * @param ev The event. + */ + onbeforeactivate: (ev: UIEvent) => any; + /** + * Fires immediately before the activeElement is changed from the current object to another object in the parent document. + * @param ev The event. + */ + onbeforedeactivate: (ev: UIEvent) => any; /** * Fires when the object loses the input focus. * @param ev The focus event. */ onblur: (ev: FocusEvent) => any; - /** - * Sets or retrieves a value that indicates the reading order of the object. - */ - dir: string; - /** - * Occurs when the media element is reset to its initial state. - * @param ev The event. - */ - onemptied: (ev: Event) => any; - /** - * Sets or gets a value that indicates whether the document can be edited. - */ - designMode: string; - /** - * Occurs when the current playback position is moved. - * @param ev The event. - */ - onseeking: (ev: Event) => any; - /** - * Fires when the activeElement is changed from the current object to another object in the parent document. - * @param ev The UI Event - */ - ondeactivate: (ev: UIEvent) => any; /** * Occurs when playback is possible, but would require further buffering. * @param ev The event. */ oncanplay: (ev: Event) => any; - /** - * Fires when the data set exposed by a data source object changes. - * @param ev The event. - */ - ondatasetchanged: (ev: MSEventObj) => any; - /** - * Fires when rows are about to be deleted from the recordset. - * @param ev The event - */ - onrowsdelete: (ev: MSEventObj) => any; - Script: MSScriptHost; - /** - * Occurs when Internet Explorer begins looking for media data. - * @param ev The event. - */ - onloadstart: (ev: Event) => any; - /** - * Gets the URL for the document, stripped of any character encoding. - */ - URLUnencoded: string; - defaultView: Window; - /** - * Fires when the user is about to make a control selection of the object. - * @param ev The event. - */ - oncontrolselect: (ev: MSEventObj) => any; - /** - * Fires on the target element when the user drags the object to a valid drop target. - * @param ev The drag event. - */ - ondragenter: (ev: DragEvent) => any; - onsubmit: (ev: Event) => any; - /** - * Returns the character encoding used to create the webpage that is loaded into the document object. - */ - inputEncoding: string; - /** - * Gets the object that has the focus when the parent document has focus. - */ - activeElement: Element; + oncanplaythrough: (ev: Event) => any; /** * Fires when the contents of the object or selection have changed. * @param ev The event. */ onchange: (ev: Event) => any; /** - * Retrieves a collection of all a objects that specify the href property and all area objects in the document. + * Fires when the user clicks the left mouse button on the object + * @param ev The mouse event. */ - links: HTMLCollection; + onclick: (ev: MouseEvent) => any; /** - * Retrieves an autogenerated, unique identifier for the object. + * Fires when the user clicks the right mouse button in the client area, opening the context menu. + * @param ev The mouse event. */ - uniqueID: string; + oncontextmenu: (ev: PointerEvent) => any; /** - * Sets or gets the URL for the current document. + * Fires when the user double-clicks the object. + * @param ev The mouse event. */ - URL: string; + ondblclick: (ev: MouseEvent) => any; /** - * Fires immediately before the object is set as the active element. + * Fires when the activeElement is changed from the current object to another object in the parent document. + * @param ev The UI Event + */ + ondeactivate: (ev: UIEvent) => any; + /** + * Fires on the source object continuously during a drag operation. * @param ev The event. */ - onbeforeactivate: (ev: UIEvent) => any; - head: HTMLHeadElement; - cookie: string; - xmlEncoding: string; - oncanplaythrough: (ev: Event) => any; - /** - * Retrieves the document compatibility mode of the document. - */ - documentMode: number; - characterSet: string; + ondrag: (ev: DragEvent) => any; /** - * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. - */ - anchors: HTMLCollection; - onbeforeupdate: (ev: MSEventObj) => any; - /** - * Fires to indicate that all data is available from the data source object. + * Fires on the source object when the user releases the mouse at the close of a drag operation. * @param ev The event. */ - ondatasetcomplete: (ev: MSEventObj) => any; - plugins: HTMLCollection; + ondragend: (ev: DragEvent) => any; + /** + * Fires on the target element when the user drags the object to a valid drop target. + * @param ev The drag event. + */ + ondragenter: (ev: DragEvent) => any; + /** + * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. + * @param ev The drag event. + */ + ondragleave: (ev: DragEvent) => any; + /** + * Fires on the target element continuously while the user drags the object over a valid drop target. + * @param ev The event. + */ + ondragover: (ev: DragEvent) => any; + /** + * Fires on the source object when the user starts to drag a text selection or selected object. + * @param ev The event. + */ + ondragstart: (ev: DragEvent) => any; + ondrop: (ev: DragEvent) => any; + /** + * Occurs when the duration attribute is updated. + * @param ev The event. + */ + ondurationchange: (ev: Event) => any; + /** + * Occurs when the media element is reset to its initial state. + * @param ev The event. + */ + onemptied: (ev: Event) => any; + /** + * Occurs when the end of playback is reached. + * @param ev The event + */ + onended: (ev: Event) => any; + /** + * Fires when an error occurs during object loading. + * @param ev The event. + */ + onerror: (ev: Event) => any; + /** + * Fires when the object receives focus. + * @param ev The event. + */ + onfocus: (ev: FocusEvent) => any; + onfullscreenchange: (ev: Event) => any; + onfullscreenerror: (ev: Event) => any; + oninput: (ev: Event) => any; + /** + * Fires when the user presses a key. + * @param ev The keyboard event + */ + onkeydown: (ev: KeyboardEvent) => any; + /** + * Fires when the user presses an alphanumeric key. + * @param ev The event. + */ + onkeypress: (ev: KeyboardEvent) => any; + /** + * Fires when the user releases a key. + * @param ev The keyboard event + */ + onkeyup: (ev: KeyboardEvent) => any; + /** + * Fires immediately after the browser loads the object. + * @param ev The event. + */ + onload: (ev: Event) => any; + /** + * Occurs when media data is loaded at the current playback position. + * @param ev The event. + */ + onloadeddata: (ev: Event) => any; + /** + * Occurs when the duration and dimensions of the media have been determined. + * @param ev The event. + */ + onloadedmetadata: (ev: Event) => any; + /** + * Occurs when Internet Explorer begins looking for media data. + * @param ev The event. + */ + onloadstart: (ev: Event) => any; + /** + * Fires when the user clicks the object with either mouse button. + * @param ev The mouse event. + */ + onmousedown: (ev: MouseEvent) => any; + /** + * Fires when the user moves the mouse over the object. + * @param ev The mouse event. + */ + onmousemove: (ev: MouseEvent) => any; + /** + * Fires when the user moves the mouse pointer outside the boundaries of the object. + * @param ev The mouse event. + */ + onmouseout: (ev: MouseEvent) => any; + /** + * Fires when the user moves the mouse pointer into the object. + * @param ev The mouse event. + */ + onmouseover: (ev: MouseEvent) => any; + /** + * Fires when the user releases a mouse button while the mouse is over the object. + * @param ev The mouse event. + */ + onmouseup: (ev: MouseEvent) => any; + /** + * Fires when the wheel button is rotated. + * @param ev The mouse event + */ + onmousewheel: (ev: MouseWheelEvent) => any; + onmscontentzoom: (ev: UIEvent) => any; + onmsgesturechange: (ev: MSGestureEvent) => any; + onmsgesturedoubletap: (ev: MSGestureEvent) => any; + onmsgestureend: (ev: MSGestureEvent) => any; + onmsgesturehold: (ev: MSGestureEvent) => any; + onmsgesturestart: (ev: MSGestureEvent) => any; + onmsgesturetap: (ev: MSGestureEvent) => any; + onmsinertiastart: (ev: MSGestureEvent) => any; + onmsmanipulationstatechanged: (ev: MSManipulationEvent) => any; + onmspointercancel: (ev: MSPointerEvent) => any; + onmspointerdown: (ev: MSPointerEvent) => any; + onmspointerenter: (ev: MSPointerEvent) => any; + onmspointerleave: (ev: MSPointerEvent) => any; + onmspointermove: (ev: MSPointerEvent) => any; + onmspointerout: (ev: MSPointerEvent) => any; + onmspointerover: (ev: MSPointerEvent) => any; + onmspointerup: (ev: MSPointerEvent) => any; + /** + * Occurs when an item is removed from a Jump List of a webpage running in Site Mode. + * @param ev The event. + */ + onmssitemodejumplistitemremoved: (ev: MSSiteModeEvent) => any; + /** + * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode. + * @param ev The event. + */ + onmsthumbnailclick: (ev: MSSiteModeEvent) => any; + /** + * Occurs when playback is paused. + * @param ev The event. + */ + onpause: (ev: Event) => any; + /** + * Occurs when the play method is requested. + * @param ev The event. + */ + onplay: (ev: Event) => any; + /** + * Occurs when the audio or video has started playing. + * @param ev The event. + */ + onplaying: (ev: Event) => any; + onpointerlockchange: (ev: Event) => any; + onpointerlockerror: (ev: Event) => any; + /** + * Occurs to indicate progress while downloading media data. + * @param ev The event. + */ + onprogress: (ev: ProgressEvent) => any; + /** + * Occurs when the playback rate is increased or decreased. + * @param ev The event. + */ + onratechange: (ev: Event) => any; + /** + * Fires when the state of the object has changed. + * @param ev The event + */ + onreadystatechange: (ev: ProgressEvent) => any; + /** + * Fires when the user resets a form. + * @param ev The event. + */ + onreset: (ev: Event) => any; + /** + * Fires when the user repositions the scroll box in the scroll bar on the object. + * @param ev The event. + */ + onscroll: (ev: UIEvent) => any; + /** + * Occurs when the seek operation ends. + * @param ev The event. + */ + onseeked: (ev: Event) => any; + /** + * Occurs when the current playback position is moved. + * @param ev The event. + */ + onseeking: (ev: Event) => any; + /** + * Fires when the current selection changes. + * @param ev The event. + */ + onselect: (ev: UIEvent) => any; + onselectstart: (ev: Event) => any; + /** + * Occurs when the download has stopped. + * @param ev The event. + */ + onstalled: (ev: Event) => any; + /** + * Fires when the user clicks the Stop button or leaves the Web page. + * @param ev The event. + */ + onstop: (ev: Event) => any; + onsubmit: (ev: Event) => any; /** * Occurs if the load operation has been intentionally halted. * @param ev The event. */ onsuspend: (ev: Event) => any; /** - * Gets the root svg element in the document hierarchy. + * Occurs to indicate the current playback position. + * @param ev The event. */ - rootElement: SVGSVGElement; + ontimeupdate: (ev: Event) => any; + ontouchcancel: (ev: TouchEvent) => any; + ontouchend: (ev: TouchEvent) => any; + ontouchmove: (ev: TouchEvent) => any; + ontouchstart: (ev: TouchEvent) => any; + /** + * Occurs when the volume is changed, or playback is muted or unmuted. + * @param ev The event. + */ + onvolumechange: (ev: Event) => any; + /** + * Occurs when playback stops because the next frame of a video resource is not available. + * @param ev The event. + */ + onwaiting: (ev: Event) => any; + onwebkitfullscreenchange: (ev: Event) => any; + onwebkitfullscreenerror: (ev: Event) => any; + plugins: HTMLCollection; + pointerLockElement: Element; /** * Retrieves a value that indicates the current state of the object. */ @@ -5633,390 +7035,60 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document */ referrer: string; /** - * Sets or gets the color of all active links in the document. + * Gets the root svg element in the document hierarchy. */ - alinkColor: string; + rootElement: SVGSVGElement; /** - * Fires on a databound object when an error occurs while updating the associated data in the data source object. - * @param ev The event. + * Retrieves a collection of all script objects in the document. */ - onerrorupdate: (ev: MSEventObj) => any; + scripts: HTMLCollection; + security: string; /** - * Gets a reference to the container object of the window. + * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. */ - parentWindow: Window; + styleSheets: StyleSheetList; /** - * Fires when the user moves the mouse pointer outside the boundaries of the object. - * @param ev The mouse event. + * Contains the title of the document. */ - onmouseout: (ev: MouseEvent) => any; - /** - * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode. - * @param ev The event. - */ - onmsthumbnailclick: (ev: MSSiteModeEvent) => any; - /** - * Fires when the wheel button is rotated. - * @param ev The mouse event - */ - onmousewheel: (ev: MouseWheelEvent) => any; - /** - * Occurs when the volume is changed, or playback is muted or unmuted. - * @param ev The event. - */ - onvolumechange: (ev: Event) => any; + title: string; + visibilityState: string; /** - * Fires when data changes in the data provider. - * @param ev The event. + * Sets or gets the color of the links that the user has visited. */ - oncellchange: (ev: MSEventObj) => any; - /** - * Fires just before the data source control changes the current row in the object. - * @param ev The event. - */ - onrowexit: (ev: MSEventObj) => any; - /** - * Fires just after new rows are inserted in the current recordset. - * @param ev The event. - */ - onrowsinserted: (ev: MSEventObj) => any; + vlinkColor: string; + webkitCurrentFullScreenElement: Element; + webkitFullscreenElement: Element; + webkitFullscreenEnabled: boolean; + webkitIsFullScreen: boolean; + xmlEncoding: string; + xmlStandalone: boolean; /** * Gets or sets the version attribute specified in the declaration of an XML document. */ xmlVersion: string; - msCapsLockWarningOff: boolean; - /** - * Fires when a property changes on the object. - * @param ev The event. - */ - onpropertychange: (ev: MSEventObj) => any; - /** - * Fires on the source object when the user releases the mouse at the close of a drag operation. - * @param ev The event. - */ - ondragend: (ev: DragEvent) => any; - /** - * Gets an object representing the document type declaration associated with the current document. - */ - doctype: DocumentType; - /** - * Fires on the target element continuously while the user drags the object over a valid drop target. - * @param ev The event. - */ - ondragover: (ev: DragEvent) => any; - /** - * Deprecated. Sets or retrieves a value that indicates the background color behind the object. - */ - bgColor: string; - /** - * Fires on the source object when the user starts to drag a text selection or selected object. - * @param ev The event. - */ - ondragstart: (ev: DragEvent) => any; - /** - * Fires when the user releases a mouse button while the mouse is over the object. - * @param ev The mouse event. - */ - onmouseup: (ev: MouseEvent) => any; - /** - * Fires on the source object continuously during a drag operation. - * @param ev The event. - */ - ondrag: (ev: DragEvent) => any; - /** - * Fires when the user moves the mouse pointer into the object. - * @param ev The mouse event. - */ - onmouseover: (ev: MouseEvent) => any; - /** - * Sets or gets the color of the document links. - */ - linkColor: string; - /** - * Occurs when playback is paused. - * @param ev The event. - */ - onpause: (ev: Event) => any; - /** - * Fires when the user clicks the object with either mouse button. - * @param ev The mouse event. - */ - onmousedown: (ev: MouseEvent) => any; - /** - * Fires when the user clicks the left mouse button on the object - * @param ev The mouse event. - */ - onclick: (ev: MouseEvent) => any; - /** - * Occurs when playback stops because the next frame of a video resource is not available. - * @param ev The event. - */ - onwaiting: (ev: Event) => any; - /** - * Fires when the user clicks the Stop button or leaves the Web page. - * @param ev The event. - */ - onstop: (ev: Event) => any; - /** - * Occurs when an item is removed from a Jump List of a webpage running in Site Mode. - * @param ev The event. - */ - onmssitemodejumplistitemremoved: (ev: MSSiteModeEvent) => any; - /** - * Retrieves a collection of all applet objects in the document. - */ - applets: HTMLCollection; - /** - * Specifies the beginning and end of the document body. - */ - body: HTMLElement; - /** - * Sets or gets the security domain of the document. - */ - domain: string; - xmlStandalone: boolean; - /** - * Represents the active selection, which is a highlighted block of text or other elements in the document that a user or a script can carry out some action on. - */ - selection: MSSelection; - /** - * Occurs when the download has stopped. - * @param ev The event. - */ - onstalled: (ev: Event) => any; - /** - * Fires when the user moves the mouse over the object. - * @param ev The mouse event. - */ - onmousemove: (ev: MouseEvent) => any; - /** - * Fires before an object contained in an editable element enters a UI-activated state or when an editable container object is control selected. - * @param ev The event. - */ - onbeforeeditfocus: (ev: MSEventObj) => any; - /** - * Occurs when the playback rate is increased or decreased. - * @param ev The event. - */ - onratechange: (ev: Event) => any; - /** - * Occurs to indicate progress while downloading media data. - * @param ev The event. - */ - onprogress: (ev: ProgressEvent) => any; - /** - * Fires when the user double-clicks the object. - * @param ev The mouse event. - */ - ondblclick: (ev: MouseEvent) => any; - /** - * Fires when the user clicks the right mouse button in the client area, opening the context menu. - * @param ev The mouse event. - */ - oncontextmenu: (ev: MouseEvent) => any; - /** - * Occurs when the duration and dimensions of the media have been determined. - * @param ev The event. - */ - onloadedmetadata: (ev: Event) => any; - media: string; - /** - * Fires when an error occurs during object loading. - * @param ev The event. - */ - onerror: (ev: ErrorEvent) => any; - /** - * Occurs when the play method is requested. - * @param ev The event. - */ - onplay: (ev: Event) => any; - onafterupdate: (ev: MSEventObj) => any; - /** - * Occurs when the audio or video has started playing. - * @param ev The event. - */ - onplaying: (ev: Event) => any; - /** - * Retrieves a collection, in source order, of img objects in the document. - */ - images: HTMLCollection; - /** - * Contains information about the current URL. - */ - location: Location; - /** - * Fires when the user aborts the download. - * @param ev The event. - */ - onabort: (ev: UIEvent) => any; - /** - * Fires for the current element with focus immediately after moving focus to another element. - * @param ev The event. - */ - onfocusout: (ev: FocusEvent) => any; - /** - * Fires when the selection state of a document changes. - * @param ev The event. - */ - onselectionchange: (ev: Event) => any; - /** - * Fires when a local DOM Storage area is written to disk. - * @param ev The event. - */ - onstoragecommit: (ev: StorageEvent) => any; - /** - * Fires periodically as data arrives from data source objects that asynchronously transmit their data. - * @param ev The event. - */ - ondataavailable: (ev: MSEventObj) => any; - /** - * Fires when the state of the object has changed. - * @param ev The event - */ - onreadystatechange: (ev: Event) => any; - /** - * Gets the date that the page was last modified, if the page supplies one. - */ - lastModified: string; - /** - * Fires when the user presses an alphanumeric key. - * @param ev The event. - */ - onkeypress: (ev: KeyboardEvent) => any; - /** - * Occurs when media data is loaded at the current playback position. - * @param ev The event. - */ - onloadeddata: (ev: Event) => any; - /** - * Fires immediately before the activeElement is changed from the current object to another object in the parent document. - * @param ev The event. - */ - onbeforedeactivate: (ev: UIEvent) => any; - /** - * Fires when the object is set as the active element. - * @param ev The event. - */ - onactivate: (ev: UIEvent) => any; - onselectstart: (ev: Event) => any; - /** - * Fires when the object receives focus. - * @param ev The event. - */ - onfocus: (ev: FocusEvent) => any; - /** - * Sets or gets the foreground (text) color of the document. - */ - fgColor: string; - /** - * Occurs to indicate the current playback position. - * @param ev The event. - */ - ontimeupdate: (ev: Event) => any; - /** - * Fires when the current selection changes. - * @param ev The event. - */ - onselect: (ev: UIEvent) => any; - ondrop: (ev: DragEvent) => any; - /** - * Occurs when the end of playback is reached. - * @param ev The event - */ - onended: (ev: Event) => any; - /** - * Gets a value that indicates whether standards-compliant mode is switched on for the object. - */ - compatMode: string; - /** - * Fires when the user repositions the scroll box in the scroll bar on the object. - * @param ev The event. - */ - onscroll: (ev: UIEvent) => any; - /** - * Fires to indicate that the current row has changed in the data source and new data values are available on the object. - * @param ev The event. - */ - onrowenter: (ev: MSEventObj) => any; - /** - * Fires immediately after the browser loads the object. - * @param ev The event. - */ - onload: (ev: Event) => any; - oninput: (ev: Event) => any; - onmspointerdown: (ev: any) => any; - msHidden: boolean; - msVisibilityState: string; - onmsgesturedoubletap: (ev: any) => any; - visibilityState: string; - onmsmanipulationstatechanged: (ev: any) => any; - onmspointerhover: (ev: any) => any; - onmscontentzoom: (ev: MSEventObj) => any; - onmspointermove: (ev: any) => any; - onmsgesturehold: (ev: any) => any; - onmsgesturechange: (ev: any) => any; - onmsgesturestart: (ev: any) => any; - onmspointercancel: (ev: any) => any; - onmsgestureend: (ev: any) => any; - onmsgesturetap: (ev: any) => any; - onmspointerout: (ev: any) => any; - onmsinertiastart: (ev: any) => any; - msCSSOMElementFloatMetrics: boolean; - onmspointerover: (ev: any) => any; - hidden: boolean; - onmspointerup: (ev: any) => any; - msFullscreenEnabled: boolean; - onmsfullscreenerror: (ev: any) => any; - onmspointerenter: (ev: any) => any; - msFullscreenElement: Element; - onmsfullscreenchange: (ev: any) => any; - onmspointerleave: (ev: any) => any; - /** - * Returns a reference to the first object with the specified value of the ID or NAME attribute. - * @param elementId String that specifies the ID value. Case-insensitive. - */ - getElementById(elementId: string): HTMLElement; - /** - * Returns the current value of the document, range, or current selection for the given command. - * @param commandId String that specifies a command identifier. - */ - queryCommandValue(commandId: string): string; adoptNode(source: Node): Node; + captureEvents(): void; + clear(): void; /** - * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. - * @param commandId String that specifies a command identifier. + * Closes an output stream and forces the sent data to display. */ - queryCommandIndeterm(commandId: string): boolean; - getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; - createProcessingInstruction(target: string, data: string): ProcessingInstruction; + close(): void; /** - * Executes a command on the current document, current selection, or the given range. - * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. - * @param showUI Display the user interface, defaults to false. - * @param value Value to assign. + * Creates an attribute object with a specified name. + * @param name String that sets the attribute object's name. */ - execCommand(commandId: string, showUI?: boolean, value?: any): boolean; - /** - * Returns the element for the specified x coordinate and the specified y coordinate. - * @param x The x-offset - * @param y The y-offset - */ - elementFromPoint(x: number, y: number): Element; + createAttribute(name: string): Attr; + createAttributeNS(namespaceURI: string, qualifiedName: string): Attr; createCDATASection(data: string): CDATASection; /** - * Retrieves the string associated with a command. - * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers. + * Creates a comment object with the specified data. + * @param data Sets the comment object's data. */ - queryCommandText(commandId: string): string; + createComment(data: string): Comment; /** - * Writes one or more HTML expressions to a document in the specified window. - * @param content Specifies the text and HTML tags to write. + * Creates a new document. */ - write(...content: string[]): void; - /** - * Allows updating the print settings for the page. - */ - updateSettings(): void; + createDocumentFragment(): DocumentFragment; /** * Creates an instance of the element for the specified tag. * @param tagName The name of an element. @@ -6027,14 +7099,11 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document createElement(tagName: "address"): HTMLBlockElement; createElement(tagName: "applet"): HTMLAppletElement; createElement(tagName: "area"): HTMLAreaElement; - createElement(tagName: "article"): HTMLElement; - createElement(tagName: "aside"): HTMLElement; createElement(tagName: "audio"): HTMLAudioElement; createElement(tagName: "b"): HTMLPhraseElement; createElement(tagName: "base"): HTMLBaseElement; createElement(tagName: "basefont"): HTMLBaseFontElement; createElement(tagName: "bdo"): HTMLPhraseElement; - createElement(tagName: "bgsound"): HTMLBGSoundElement; createElement(tagName: "big"): HTMLPhraseElement; createElement(tagName: "blockquote"): HTMLBlockElement; createElement(tagName: "body"): HTMLBodyElement; @@ -6058,10 +7127,7 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document createElement(tagName: "em"): HTMLPhraseElement; createElement(tagName: "embed"): HTMLEmbedElement; createElement(tagName: "fieldset"): HTMLFieldSetElement; - createElement(tagName: "figcaption"): HTMLElement; - createElement(tagName: "figure"): HTMLElement; createElement(tagName: "font"): HTMLFontElement; - createElement(tagName: "footer"): HTMLElement; createElement(tagName: "form"): HTMLFormElement; createElement(tagName: "frame"): HTMLFrameElement; createElement(tagName: "frameset"): HTMLFrameSetElement; @@ -6072,8 +7138,6 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document createElement(tagName: "h5"): HTMLHeadingElement; createElement(tagName: "h6"): HTMLHeadingElement; createElement(tagName: "head"): HTMLHeadElement; - createElement(tagName: "header"): HTMLElement; - createElement(tagName: "hgroup"): HTMLElement; createElement(tagName: "hr"): HTMLHRElement; createElement(tagName: "html"): HTMLHtmlElement; createElement(tagName: "i"): HTMLPhraseElement; @@ -6090,15 +7154,11 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document createElement(tagName: "link"): HTMLLinkElement; createElement(tagName: "listing"): HTMLBlockElement; createElement(tagName: "map"): HTMLMapElement; - createElement(tagName: "mark"): HTMLElement; createElement(tagName: "marquee"): HTMLMarqueeElement; createElement(tagName: "menu"): HTMLMenuElement; createElement(tagName: "meta"): HTMLMetaElement; - createElement(tagName: "nav"): HTMLElement; createElement(tagName: "nextid"): HTMLNextIdElement; createElement(tagName: "nobr"): HTMLPhraseElement; - createElement(tagName: "noframes"): HTMLElement; - createElement(tagName: "noscript"): HTMLElement; createElement(tagName: "object"): HTMLObjectElement; createElement(tagName: "ol"): HTMLOListElement; createElement(tagName: "optgroup"): HTMLOptGroupElement; @@ -6114,10 +7174,9 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document createElement(tagName: "s"): HTMLPhraseElement; createElement(tagName: "samp"): HTMLPhraseElement; createElement(tagName: "script"): HTMLScriptElement; - createElement(tagName: "section"): HTMLElement; createElement(tagName: "select"): HTMLSelectElement; createElement(tagName: "small"): HTMLPhraseElement; - createElement(tagName: "SOURCE"): HTMLSourceElement; + createElement(tagName: "source"): HTMLSourceElement; createElement(tagName: "span"): HTMLSpanElement; createElement(tagName: "strike"): HTMLPhraseElement; createElement(tagName: "strong"): HTMLPhraseElement; @@ -6139,33 +7198,32 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document createElement(tagName: "ul"): HTMLUListElement; createElement(tagName: "var"): HTMLPhraseElement; createElement(tagName: "video"): HTMLVideoElement; - createElement(tagName: "wbr"): HTMLElement; createElement(tagName: "x-ms-webview"): MSHTMLWebViewElement; createElement(tagName: "xmp"): HTMLBlockElement; createElement(tagName: string): HTMLElement; - /** - * Removes mouse capture from the object in the current document. - */ - releaseCapture(): void; - /** - * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. - * @param content The text and HTML tags to write. - */ - writeln(...content: string[]): void; createElementNS(namespaceURI: string, qualifiedName: string): Element; + createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; + createNSResolver(nodeResolver: Node): XPathNSResolver; /** - * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. - * @param url Specifies a MIME type for the document. - * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. - * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. - * @param replace Specifies whether the existing entry for the document is replaced in the history list. + * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list + * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. + * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. */ - open(url?: string, name?: string, features?: string, replace?: boolean): any; + createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): NodeIterator; + createProcessingInstruction(target: string, data: string): ProcessingInstruction; /** - * Returns a Boolean value that indicates whether the current command is supported on the current range. - * @param commandId Specifies a command identifier. + * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. */ - queryCommandSupported(commandId: string): boolean; + createRange(): Range; + /** + * Creates a text string from the specified value. + * @param data String that specifies the nodeValue property of the text node. + */ + createTextNode(data: string): Text; + createTouch(view: any, target: EventTarget, identifier: number, pageX: number, pageY: number, screenX: number, screenY: number): Touch; + createTouchList(...touches: Touch[]): TouchList; /** * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. * @param root The root element or node to start traversing on. @@ -6173,42 +7231,500 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document * @param filter A custom NodeFilter function to use. * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. */ - createTreeWalker(root: Node, whatToShow: number, filter: NodeFilter, entityReferenceExpansion: boolean): TreeWalker; - createAttributeNS(namespaceURI: string, qualifiedName: string): Attr; + createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): TreeWalker; + /** + * Returns the element for the specified x coordinate and the specified y coordinate. + * @param x The x-offset + * @param y The y-offset + */ + elementFromPoint(x: number, y: number): Element; + evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver, type: number, result: XPathResult): XPathResult; + /** + * Executes a command on the current document, current selection, or the given range. + * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. + * @param showUI Display the user interface, defaults to false. + * @param value Value to assign. + */ + execCommand(commandId: string, showUI?: boolean, value?: any): boolean; + /** + * Displays help information for the given command identifier. + * @param commandId Displays help information for the given command identifier. + */ + execCommandShowHelp(commandId: string): boolean; + exitFullscreen(): void; + exitPointerLock(): void; + /** + * Causes the element to receive the focus and executes the code specified by the onfocus event. + */ + focus(): void; + /** + * Returns a reference to the first object with the specified value of the ID or NAME attribute. + * @param elementId String that specifies the ID value. Case-insensitive. + */ + getElementById(elementId: string): HTMLElement; + getElementsByClassName(classNames: string): NodeList; + /** + * Gets a collection of objects based on the value of the NAME or ID attribute. + * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. + */ + getElementsByName(elementName: string): NodeList; + /** + * Retrieves a collection of objects based on the specified element name. + * @param name Specifies the name of an element. + */ + getElementsByTagName(tagname: "a"): NodeListOf; + getElementsByTagName(tagname: "abbr"): NodeListOf; + getElementsByTagName(tagname: "acronym"): NodeListOf; + getElementsByTagName(tagname: "address"): NodeListOf; + getElementsByTagName(tagname: "applet"): NodeListOf; + getElementsByTagName(tagname: "area"): NodeListOf; + getElementsByTagName(tagname: "article"): NodeListOf; + getElementsByTagName(tagname: "aside"): NodeListOf; + getElementsByTagName(tagname: "audio"): NodeListOf; + getElementsByTagName(tagname: "b"): NodeListOf; + getElementsByTagName(tagname: "base"): NodeListOf; + getElementsByTagName(tagname: "basefont"): NodeListOf; + getElementsByTagName(tagname: "bdo"): NodeListOf; + getElementsByTagName(tagname: "big"): NodeListOf; + getElementsByTagName(tagname: "blockquote"): NodeListOf; + getElementsByTagName(tagname: "body"): NodeListOf; + getElementsByTagName(tagname: "br"): NodeListOf; + getElementsByTagName(tagname: "button"): NodeListOf; + getElementsByTagName(tagname: "canvas"): NodeListOf; + getElementsByTagName(tagname: "caption"): NodeListOf; + getElementsByTagName(tagname: "center"): NodeListOf; + getElementsByTagName(tagname: "circle"): NodeListOf; + getElementsByTagName(tagname: "cite"): NodeListOf; + getElementsByTagName(tagname: "clippath"): NodeListOf; + getElementsByTagName(tagname: "code"): NodeListOf; + getElementsByTagName(tagname: "col"): NodeListOf; + getElementsByTagName(tagname: "colgroup"): NodeListOf; + getElementsByTagName(tagname: "datalist"): NodeListOf; + getElementsByTagName(tagname: "dd"): NodeListOf; + getElementsByTagName(tagname: "defs"): NodeListOf; + getElementsByTagName(tagname: "del"): NodeListOf; + getElementsByTagName(tagname: "desc"): NodeListOf; + getElementsByTagName(tagname: "dfn"): NodeListOf; + getElementsByTagName(tagname: "dir"): NodeListOf; + getElementsByTagName(tagname: "div"): NodeListOf; + getElementsByTagName(tagname: "dl"): NodeListOf; + getElementsByTagName(tagname: "dt"): NodeListOf; + getElementsByTagName(tagname: "ellipse"): NodeListOf; + getElementsByTagName(tagname: "em"): NodeListOf; + getElementsByTagName(tagname: "embed"): NodeListOf; + getElementsByTagName(tagname: "feblend"): NodeListOf; + getElementsByTagName(tagname: "fecolormatrix"): NodeListOf; + getElementsByTagName(tagname: "fecomponenttransfer"): NodeListOf; + getElementsByTagName(tagname: "fecomposite"): NodeListOf; + getElementsByTagName(tagname: "feconvolvematrix"): NodeListOf; + getElementsByTagName(tagname: "fediffuselighting"): NodeListOf; + getElementsByTagName(tagname: "fedisplacementmap"): NodeListOf; + getElementsByTagName(tagname: "fedistantlight"): NodeListOf; + getElementsByTagName(tagname: "feflood"): NodeListOf; + getElementsByTagName(tagname: "fefunca"): NodeListOf; + getElementsByTagName(tagname: "fefuncb"): NodeListOf; + getElementsByTagName(tagname: "fefuncg"): NodeListOf; + getElementsByTagName(tagname: "fefuncr"): NodeListOf; + getElementsByTagName(tagname: "fegaussianblur"): NodeListOf; + getElementsByTagName(tagname: "feimage"): NodeListOf; + getElementsByTagName(tagname: "femerge"): NodeListOf; + getElementsByTagName(tagname: "femergenode"): NodeListOf; + getElementsByTagName(tagname: "femorphology"): NodeListOf; + getElementsByTagName(tagname: "feoffset"): NodeListOf; + getElementsByTagName(tagname: "fepointlight"): NodeListOf; + getElementsByTagName(tagname: "fespecularlighting"): NodeListOf; + getElementsByTagName(tagname: "fespotlight"): NodeListOf; + getElementsByTagName(tagname: "fetile"): NodeListOf; + getElementsByTagName(tagname: "feturbulence"): NodeListOf; + getElementsByTagName(tagname: "fieldset"): NodeListOf; + getElementsByTagName(tagname: "figcaption"): NodeListOf; + getElementsByTagName(tagname: "figure"): NodeListOf; + getElementsByTagName(tagname: "filter"): NodeListOf; + getElementsByTagName(tagname: "font"): NodeListOf; + getElementsByTagName(tagname: "footer"): NodeListOf; + getElementsByTagName(tagname: "foreignobject"): NodeListOf; + getElementsByTagName(tagname: "form"): NodeListOf; + getElementsByTagName(tagname: "frame"): NodeListOf; + getElementsByTagName(tagname: "frameset"): NodeListOf; + getElementsByTagName(tagname: "g"): NodeListOf; + getElementsByTagName(tagname: "h1"): NodeListOf; + getElementsByTagName(tagname: "h2"): NodeListOf; + getElementsByTagName(tagname: "h3"): NodeListOf; + getElementsByTagName(tagname: "h4"): NodeListOf; + getElementsByTagName(tagname: "h5"): NodeListOf; + getElementsByTagName(tagname: "h6"): NodeListOf; + getElementsByTagName(tagname: "head"): NodeListOf; + getElementsByTagName(tagname: "header"): NodeListOf; + getElementsByTagName(tagname: "hgroup"): NodeListOf; + getElementsByTagName(tagname: "hr"): NodeListOf; + getElementsByTagName(tagname: "html"): NodeListOf; + getElementsByTagName(tagname: "i"): NodeListOf; + getElementsByTagName(tagname: "iframe"): NodeListOf; + getElementsByTagName(tagname: "image"): NodeListOf; + getElementsByTagName(tagname: "img"): NodeListOf; + getElementsByTagName(tagname: "input"): NodeListOf; + getElementsByTagName(tagname: "ins"): NodeListOf; + getElementsByTagName(tagname: "isindex"): NodeListOf; + getElementsByTagName(tagname: "kbd"): NodeListOf; + getElementsByTagName(tagname: "keygen"): NodeListOf; + getElementsByTagName(tagname: "label"): NodeListOf; + getElementsByTagName(tagname: "legend"): NodeListOf; + getElementsByTagName(tagname: "li"): NodeListOf; + getElementsByTagName(tagname: "line"): NodeListOf; + getElementsByTagName(tagname: "lineargradient"): NodeListOf; + getElementsByTagName(tagname: "link"): NodeListOf; + getElementsByTagName(tagname: "listing"): NodeListOf; + getElementsByTagName(tagname: "map"): NodeListOf; + getElementsByTagName(tagname: "mark"): NodeListOf; + getElementsByTagName(tagname: "marker"): NodeListOf; + getElementsByTagName(tagname: "marquee"): NodeListOf; + getElementsByTagName(tagname: "mask"): NodeListOf; + getElementsByTagName(tagname: "menu"): NodeListOf; + getElementsByTagName(tagname: "meta"): NodeListOf; + getElementsByTagName(tagname: "metadata"): NodeListOf; + getElementsByTagName(tagname: "nav"): NodeListOf; + getElementsByTagName(tagname: "nextid"): NodeListOf; + getElementsByTagName(tagname: "nobr"): NodeListOf; + getElementsByTagName(tagname: "noframes"): NodeListOf; + getElementsByTagName(tagname: "noscript"): NodeListOf; + getElementsByTagName(tagname: "object"): NodeListOf; + getElementsByTagName(tagname: "ol"): NodeListOf; + getElementsByTagName(tagname: "optgroup"): NodeListOf; + getElementsByTagName(tagname: "option"): NodeListOf; + getElementsByTagName(tagname: "p"): NodeListOf; + getElementsByTagName(tagname: "param"): NodeListOf; + getElementsByTagName(tagname: "path"): NodeListOf; + getElementsByTagName(tagname: "pattern"): NodeListOf; + getElementsByTagName(tagname: "plaintext"): NodeListOf; + getElementsByTagName(tagname: "polygon"): NodeListOf; + getElementsByTagName(tagname: "polyline"): NodeListOf; + getElementsByTagName(tagname: "pre"): NodeListOf; + getElementsByTagName(tagname: "progress"): NodeListOf; + getElementsByTagName(tagname: "q"): NodeListOf; + getElementsByTagName(tagname: "radialgradient"): NodeListOf; + getElementsByTagName(tagname: "rect"): NodeListOf; + getElementsByTagName(tagname: "rt"): NodeListOf; + getElementsByTagName(tagname: "ruby"): NodeListOf; + getElementsByTagName(tagname: "s"): NodeListOf; + getElementsByTagName(tagname: "samp"): NodeListOf; + getElementsByTagName(tagname: "script"): NodeListOf; + getElementsByTagName(tagname: "section"): NodeListOf; + getElementsByTagName(tagname: "select"): NodeListOf; + getElementsByTagName(tagname: "small"): NodeListOf; + getElementsByTagName(tagname: "source"): NodeListOf; + getElementsByTagName(tagname: "span"): NodeListOf; + getElementsByTagName(tagname: "stop"): NodeListOf; + getElementsByTagName(tagname: "strike"): NodeListOf; + getElementsByTagName(tagname: "strong"): NodeListOf; + getElementsByTagName(tagname: "style"): NodeListOf; + getElementsByTagName(tagname: "sub"): NodeListOf; + getElementsByTagName(tagname: "sup"): NodeListOf; + getElementsByTagName(tagname: "svg"): NodeListOf; + getElementsByTagName(tagname: "switch"): NodeListOf; + getElementsByTagName(tagname: "symbol"): NodeListOf; + getElementsByTagName(tagname: "table"): NodeListOf; + getElementsByTagName(tagname: "tbody"): NodeListOf; + getElementsByTagName(tagname: "td"): NodeListOf; + getElementsByTagName(tagname: "text"): NodeListOf; + getElementsByTagName(tagname: "textpath"): NodeListOf; + getElementsByTagName(tagname: "textarea"): NodeListOf; + getElementsByTagName(tagname: "tfoot"): NodeListOf; + getElementsByTagName(tagname: "th"): NodeListOf; + getElementsByTagName(tagname: "thead"): NodeListOf; + getElementsByTagName(tagname: "title"): NodeListOf; + getElementsByTagName(tagname: "tr"): NodeListOf; + getElementsByTagName(tagname: "track"): NodeListOf; + getElementsByTagName(tagname: "tspan"): NodeListOf; + getElementsByTagName(tagname: "tt"): NodeListOf; + getElementsByTagName(tagname: "u"): NodeListOf; + getElementsByTagName(tagname: "ul"): NodeListOf; + getElementsByTagName(tagname: "use"): NodeListOf; + getElementsByTagName(tagname: "var"): NodeListOf; + getElementsByTagName(tagname: "video"): NodeListOf; + getElementsByTagName(tagname: "view"): NodeListOf; + getElementsByTagName(tagname: "wbr"): NodeListOf; + getElementsByTagName(tagname: "x-ms-webview"): NodeListOf; + getElementsByTagName(tagname: "xmp"): NodeListOf; + getElementsByTagName(tagname: string): NodeList; + getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; + /** + * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. + */ + getSelection(): Selection; + /** + * Gets a value indicating whether the object currently has focus. + */ + hasFocus(): boolean; + importNode(importedNode: Node, deep: boolean): Node; + msElementsFromPoint(x: number, y: number): NodeList; + msElementsFromRect(left: number, top: number, width: number, height: number): NodeList; + msGetPrintDocumentForNamedFlow(flowName: string): Document; + msSetPrintDocumentUriForNamedFlow(flowName: string, uri: string): void; + /** + * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. + * @param url Specifies a MIME type for the document. + * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. + * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. + * @param replace Specifies whether the existing entry for the document is replaced in the history list. + */ + open(url?: string, name?: string, features?: string, replace?: boolean): Document | Window; /** * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document. * @param commandId Specifies a command identifier. */ queryCommandEnabled(commandId: string): boolean; /** - * Causes the element to receive the focus and executes the code specified by the onfocus event. + * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. + * @param commandId String that specifies a command identifier. */ - focus(): void; + queryCommandIndeterm(commandId: string): boolean; /** - * Closes an output stream and forces the sent data to display. + * Returns a Boolean value that indicates the current state of the command. + * @param commandId String that specifies a command identifier. */ - close(): void; - getElementsByClassName(classNames: string): NodeList; - importNode(importedNode: Node, deep: boolean): Node; + queryCommandState(commandId: string): boolean; /** - * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. + * Returns a Boolean value that indicates whether the current command is supported on the current range. + * @param commandId Specifies a command identifier. */ - createRange(): Range; + queryCommandSupported(commandId: string): boolean; /** - * Fires a specified event on the object. - * @param eventName Specifies the name of the event to fire. - * @param eventObj Object that specifies the event object from which to obtain event object properties. + * Retrieves the string associated with a command. + * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers. */ - fireEvent(eventName: string, eventObj?: any): boolean; + queryCommandText(commandId: string): string; /** - * Creates a comment object with the specified data. - * @param data Sets the comment object's data. + * Returns the current value of the document, range, or current selection for the given command. + * @param commandId String that specifies a command identifier. */ - createComment(data: string): Comment; + queryCommandValue(commandId: string): string; + releaseEvents(): void; /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. + * Allows updating the print settings for the page. */ + updateSettings(): void; + webkitCancelFullScreen(): void; + webkitExitFullscreen(): void; + /** + * Writes one or more HTML expressions to a document in the specified window. + * @param content Specifies the text and HTML tags to write. + */ + write(...content: string[]): void; + /** + * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. + * @param content The text and HTML tags to write. + */ + writeln(...content: string[]): void; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "fullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "fullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mssitemodejumplistitemremoved", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "msthumbnailclick", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerlockchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointerlockerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stop", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Document: { + prototype: Document; + new(): Document; +} + +interface DocumentFragment extends Node, NodeSelector { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var DocumentFragment: { + prototype: DocumentFragment; + new(): DocumentFragment; +} + +interface DocumentType extends Node, ChildNode { + entities: NamedNodeMap; + internalSubset: string; + name: string; + notations: NamedNodeMap; + publicId: string; + systemId: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var DocumentType: { + prototype: DocumentType; + new(): DocumentType; +} + +interface DragEvent extends MouseEvent { + dataTransfer: DataTransfer; + initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void; + msConvertURL(file: File, targetType: string, targetURL?: string): void; +} + +declare var DragEvent: { + prototype: DragEvent; + new(): DragEvent; +} + +interface DynamicsCompressorNode extends AudioNode { + attack: AudioParam; + knee: AudioParam; + ratio: AudioParam; + reduction: AudioParam; + release: AudioParam; + threshold: AudioParam; +} + +declare var DynamicsCompressorNode: { + prototype: DynamicsCompressorNode; + new(): DynamicsCompressorNode; +} + +interface EXT_texture_filter_anisotropic { + MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; + TEXTURE_MAX_ANISOTROPY_EXT: number; +} + +declare var EXT_texture_filter_anisotropic: { + prototype: EXT_texture_filter_anisotropic; + new(): EXT_texture_filter_anisotropic; + MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; + TEXTURE_MAX_ANISOTROPY_EXT: number; +} + +interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelector, ChildNode { + classList: DOMTokenList; + clientHeight: number; + clientLeft: number; + clientTop: number; + clientWidth: number; + msContentZoomFactor: number; + msRegionOverflow: string; + onariarequest: (ev: AriaRequestEvent) => any; + oncommand: (ev: CommandEvent) => any; + ongotpointercapture: (ev: PointerEvent) => any; + onlostpointercapture: (ev: PointerEvent) => any; + onmsgesturechange: (ev: MSGestureEvent) => any; + onmsgesturedoubletap: (ev: MSGestureEvent) => any; + onmsgestureend: (ev: MSGestureEvent) => any; + onmsgesturehold: (ev: MSGestureEvent) => any; + onmsgesturestart: (ev: MSGestureEvent) => any; + onmsgesturetap: (ev: MSGestureEvent) => any; + onmsgotpointercapture: (ev: MSPointerEvent) => any; + onmsinertiastart: (ev: MSGestureEvent) => any; + onmslostpointercapture: (ev: MSPointerEvent) => any; + onmspointercancel: (ev: MSPointerEvent) => any; + onmspointerdown: (ev: MSPointerEvent) => any; + onmspointerenter: (ev: MSPointerEvent) => any; + onmspointerleave: (ev: MSPointerEvent) => any; + onmspointermove: (ev: MSPointerEvent) => any; + onmspointerout: (ev: MSPointerEvent) => any; + onmspointerover: (ev: MSPointerEvent) => any; + onmspointerup: (ev: MSPointerEvent) => any; + ontouchcancel: (ev: TouchEvent) => any; + ontouchend: (ev: TouchEvent) => any; + ontouchmove: (ev: TouchEvent) => any; + ontouchstart: (ev: TouchEvent) => any; + onwebkitfullscreenchange: (ev: Event) => any; + onwebkitfullscreenerror: (ev: Event) => any; + scrollHeight: number; + scrollLeft: number; + scrollTop: number; + scrollWidth: number; + tagName: string; + getAttribute(name?: string): string; + getAttributeNS(namespaceURI: string, localName: string): string; + getAttributeNode(name: string): Attr; + getAttributeNodeNS(namespaceURI: string, localName: string): Attr; + getBoundingClientRect(): ClientRect; + getClientRects(): ClientRectList; getElementsByTagName(name: "a"): NodeListOf; getElementsByTagName(name: "abbr"): NodeListOf; getElementsByTagName(name: "acronym"): NodeListOf; @@ -6222,7 +7738,6 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "base"): NodeListOf; getElementsByTagName(name: "basefont"): NodeListOf; getElementsByTagName(name: "bdo"): NodeListOf; - getElementsByTagName(name: "bgsound"): NodeListOf; getElementsByTagName(name: "big"): NodeListOf; getElementsByTagName(name: "blockquote"): NodeListOf; getElementsByTagName(name: "body"): NodeListOf; @@ -6231,28 +7746,60 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "canvas"): NodeListOf; getElementsByTagName(name: "caption"): NodeListOf; getElementsByTagName(name: "center"): NodeListOf; + getElementsByTagName(name: "circle"): NodeListOf; getElementsByTagName(name: "cite"): NodeListOf; + getElementsByTagName(name: "clippath"): NodeListOf; getElementsByTagName(name: "code"): NodeListOf; getElementsByTagName(name: "col"): NodeListOf; getElementsByTagName(name: "colgroup"): NodeListOf; getElementsByTagName(name: "datalist"): NodeListOf; getElementsByTagName(name: "dd"): NodeListOf; + getElementsByTagName(name: "defs"): NodeListOf; getElementsByTagName(name: "del"): NodeListOf; + getElementsByTagName(name: "desc"): NodeListOf; getElementsByTagName(name: "dfn"): NodeListOf; getElementsByTagName(name: "dir"): NodeListOf; getElementsByTagName(name: "div"): NodeListOf; getElementsByTagName(name: "dl"): NodeListOf; getElementsByTagName(name: "dt"): NodeListOf; + getElementsByTagName(name: "ellipse"): NodeListOf; getElementsByTagName(name: "em"): NodeListOf; getElementsByTagName(name: "embed"): NodeListOf; + getElementsByTagName(name: "feblend"): NodeListOf; + getElementsByTagName(name: "fecolormatrix"): NodeListOf; + getElementsByTagName(name: "fecomponenttransfer"): NodeListOf; + getElementsByTagName(name: "fecomposite"): NodeListOf; + getElementsByTagName(name: "feconvolvematrix"): NodeListOf; + getElementsByTagName(name: "fediffuselighting"): NodeListOf; + getElementsByTagName(name: "fedisplacementmap"): NodeListOf; + getElementsByTagName(name: "fedistantlight"): NodeListOf; + getElementsByTagName(name: "feflood"): NodeListOf; + getElementsByTagName(name: "fefunca"): NodeListOf; + getElementsByTagName(name: "fefuncb"): NodeListOf; + getElementsByTagName(name: "fefuncg"): NodeListOf; + getElementsByTagName(name: "fefuncr"): NodeListOf; + getElementsByTagName(name: "fegaussianblur"): NodeListOf; + getElementsByTagName(name: "feimage"): NodeListOf; + getElementsByTagName(name: "femerge"): NodeListOf; + getElementsByTagName(name: "femergenode"): NodeListOf; + getElementsByTagName(name: "femorphology"): NodeListOf; + getElementsByTagName(name: "feoffset"): NodeListOf; + getElementsByTagName(name: "fepointlight"): NodeListOf; + getElementsByTagName(name: "fespecularlighting"): NodeListOf; + getElementsByTagName(name: "fespotlight"): NodeListOf; + getElementsByTagName(name: "fetile"): NodeListOf; + getElementsByTagName(name: "feturbulence"): NodeListOf; getElementsByTagName(name: "fieldset"): NodeListOf; getElementsByTagName(name: "figcaption"): NodeListOf; getElementsByTagName(name: "figure"): NodeListOf; + getElementsByTagName(name: "filter"): NodeListOf; getElementsByTagName(name: "font"): NodeListOf; getElementsByTagName(name: "footer"): NodeListOf; + getElementsByTagName(name: "foreignobject"): NodeListOf; getElementsByTagName(name: "form"): NodeListOf; getElementsByTagName(name: "frame"): NodeListOf; getElementsByTagName(name: "frameset"): NodeListOf; + getElementsByTagName(name: "g"): NodeListOf; getElementsByTagName(name: "h1"): NodeListOf; getElementsByTagName(name: "h2"): NodeListOf; getElementsByTagName(name: "h3"): NodeListOf; @@ -6266,6 +7813,7 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "html"): NodeListOf; getElementsByTagName(name: "i"): NodeListOf; getElementsByTagName(name: "iframe"): NodeListOf; + getElementsByTagName(name: "image"): NodeListOf; getElementsByTagName(name: "img"): NodeListOf; getElementsByTagName(name: "input"): NodeListOf; getElementsByTagName(name: "ins"): NodeListOf; @@ -6275,13 +7823,18 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "label"): NodeListOf; getElementsByTagName(name: "legend"): NodeListOf; getElementsByTagName(name: "li"): NodeListOf; + getElementsByTagName(name: "line"): NodeListOf; + getElementsByTagName(name: "lineargradient"): NodeListOf; getElementsByTagName(name: "link"): NodeListOf; getElementsByTagName(name: "listing"): NodeListOf; getElementsByTagName(name: "map"): NodeListOf; getElementsByTagName(name: "mark"): NodeListOf; + getElementsByTagName(name: "marker"): NodeListOf; getElementsByTagName(name: "marquee"): NodeListOf; + getElementsByTagName(name: "mask"): NodeListOf; getElementsByTagName(name: "menu"): NodeListOf; getElementsByTagName(name: "meta"): NodeListOf; + getElementsByTagName(name: "metadata"): NodeListOf; getElementsByTagName(name: "nav"): NodeListOf; getElementsByTagName(name: "nextid"): NodeListOf; getElementsByTagName(name: "nobr"): NodeListOf; @@ -6293,10 +7846,16 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "option"): NodeListOf; getElementsByTagName(name: "p"): NodeListOf; getElementsByTagName(name: "param"): NodeListOf; + getElementsByTagName(name: "path"): NodeListOf; + getElementsByTagName(name: "pattern"): NodeListOf; getElementsByTagName(name: "plaintext"): NodeListOf; + getElementsByTagName(name: "polygon"): NodeListOf; + getElementsByTagName(name: "polyline"): NodeListOf; getElementsByTagName(name: "pre"): NodeListOf; getElementsByTagName(name: "progress"): NodeListOf; getElementsByTagName(name: "q"): NodeListOf; + getElementsByTagName(name: "radialgradient"): NodeListOf; + getElementsByTagName(name: "rect"): NodeListOf; getElementsByTagName(name: "rt"): NodeListOf; getElementsByTagName(name: "ruby"): NodeListOf; getElementsByTagName(name: "s"): NodeListOf; @@ -6305,16 +7864,22 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "section"): NodeListOf; getElementsByTagName(name: "select"): NodeListOf; getElementsByTagName(name: "small"): NodeListOf; - getElementsByTagName(name: "SOURCE"): NodeListOf; + getElementsByTagName(name: "source"): NodeListOf; getElementsByTagName(name: "span"): NodeListOf; + getElementsByTagName(name: "stop"): NodeListOf; getElementsByTagName(name: "strike"): NodeListOf; getElementsByTagName(name: "strong"): NodeListOf; getElementsByTagName(name: "style"): NodeListOf; getElementsByTagName(name: "sub"): NodeListOf; getElementsByTagName(name: "sup"): NodeListOf; + getElementsByTagName(name: "svg"): NodeListOf; + getElementsByTagName(name: "switch"): NodeListOf; + getElementsByTagName(name: "symbol"): NodeListOf; getElementsByTagName(name: "table"): NodeListOf; getElementsByTagName(name: "tbody"): NodeListOf; getElementsByTagName(name: "td"): NodeListOf; + getElementsByTagName(name: "text"): NodeListOf; + getElementsByTagName(name: "textpath"): NodeListOf; getElementsByTagName(name: "textarea"): NodeListOf; getElementsByTagName(name: "tfoot"): NodeListOf; getElementsByTagName(name: "th"): NodeListOf; @@ -6322,546 +7887,837 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "title"): NodeListOf; getElementsByTagName(name: "tr"): NodeListOf; getElementsByTagName(name: "track"): NodeListOf; + getElementsByTagName(name: "tspan"): NodeListOf; getElementsByTagName(name: "tt"): NodeListOf; getElementsByTagName(name: "u"): NodeListOf; getElementsByTagName(name: "ul"): NodeListOf; + getElementsByTagName(name: "use"): NodeListOf; getElementsByTagName(name: "var"): NodeListOf; getElementsByTagName(name: "video"): NodeListOf; + getElementsByTagName(name: "view"): NodeListOf; getElementsByTagName(name: "wbr"): NodeListOf; getElementsByTagName(name: "x-ms-webview"): NodeListOf; getElementsByTagName(name: "xmp"): NodeListOf; getElementsByTagName(name: string): NodeList; - /** - * Creates a new document. - */ - createDocumentFragment(): DocumentFragment; - /** - * Creates a style sheet for the document. - * @param href Specifies how to add the style sheet to the document. If a file name is specified for the URL, the style information is added as a link object. If the URL contains style information, it is added to the style object. - * @param index Specifies the index that indicates where the new style sheet is inserted in the styleSheets collection. The default is to insert the new style sheet at the end of the collection. - */ - createStyleSheet(href?: string, index?: number): CSSStyleSheet; - /** - * Gets a collection of objects based on the value of the NAME or ID attribute. - * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. - */ - getElementsByName(elementName: string): NodeList; - /** - * Returns a Boolean value that indicates the current state of the command. - * @param commandId String that specifies a command identifier. - */ - queryCommandState(commandId: string): boolean; - /** - * Gets a value indicating whether the object currently has focus. - */ - hasFocus(): boolean; - /** - * Displays help information for the given command identifier. - * @param commandId Displays help information for the given command identifier. - */ - execCommandShowHelp(commandId: string): boolean; - /** - * Creates an attribute object with a specified name. - * @param name String that sets the attribute object's name. - */ - createAttribute(name: string): Attr; - /** - * Creates a text string from the specified value. - * @param data String that specifies the nodeValue property of the text node. - */ - createTextNode(data: string): Text; - /** - * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. - * @param root The root element or node to start traversing on. - * @param whatToShow The type of nodes or elements to appear in the node list - * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. - * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. - */ - createNodeIterator(root: Node, whatToShow: number, filter: NodeFilter, entityReferenceExpansion: boolean): NodeIterator; - /** - * Generates an event object to pass event context information when you use the fireEvent method. - * @param eventObj An object that specifies an existing event object on which to base the new object. - */ - createEventObject(eventObj?: any): MSEventObj; - /** - * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. - */ - getSelection(): Selection; - msElementsFromPoint(x: number, y: number): NodeList; - msElementsFromRect(left: number, top: number, width: number, height: number): NodeList; - clear(): void; - msExitFullscreen(): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; + hasAttribute(name: string): boolean; + hasAttributeNS(namespaceURI: string, localName: string): boolean; + msGetRegionContent(): MSRangeCollection; + msGetUntransformedBounds(): ClientRect; + msMatchesSelector(selectors: string): boolean; + msReleasePointerCapture(pointerId: number): void; + msSetPointerCapture(pointerId: number): void; + msZoomTo(args: MsZoomToOptions): void; + releasePointerCapture(pointerId: number): void; + removeAttribute(name?: string): void; + removeAttributeNS(namespaceURI: string, localName: string): void; + removeAttributeNode(oldAttr: Attr): Attr; + requestFullscreen(): void; + requestPointerLock(): void; + setAttribute(name?: string, value?: string): void; + setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; + setAttributeNode(newAttr: Attr): Attr; + setAttributeNodeNS(newAttr: Attr): Attr; + setPointerCapture(pointerId: number): void; + webkitMatchesSelector(selectors: string): boolean; + webkitRequestFullScreen(): void; + webkitRequestFullscreen(): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Element: { + prototype: Element; + new(): Element; +} + +interface ErrorEvent extends Event { + colno: number; + error: any; + filename: string; + lineno: number; + message: string; + initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; +} + +declare var ErrorEvent: { + prototype: ErrorEvent; + new(): ErrorEvent; +} + +interface Event { + bubbles: boolean; + cancelBubble: boolean; + cancelable: boolean; + currentTarget: EventTarget; + defaultPrevented: boolean; + eventPhase: number; + isTrusted: boolean; + returnValue: boolean; + srcElement: Element; + target: EventTarget; + timeStamp: number; + type: string; + initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; + preventDefault(): void; + stopImmediatePropagation(): void; + stopPropagation(): void; + AT_TARGET: number; + BUBBLING_PHASE: number; + CAPTURING_PHASE: number; +} + +declare var Event: { + prototype: Event; + new(type: string, eventInitDict?: EventInit): Event; + AT_TARGET: number; + BUBBLING_PHASE: number; + CAPTURING_PHASE: number; +} + +interface EventTarget { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + dispatchEvent(evt: Event): boolean; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var EventTarget: { + prototype: EventTarget; + new(): EventTarget; +} + +interface External { +} + +declare var External: { + prototype: External; + new(): External; +} + +interface File extends Blob { + lastModifiedDate: any; + name: string; +} + +declare var File: { + prototype: File; + new(): File; +} + +interface FileList { + length: number; + item(index: number): File; + [index: number]: File; +} + +declare var FileList: { + prototype: FileList; + new(): FileList; +} + +interface FileReader extends EventTarget, MSBaseReader { + error: DOMError; + readAsArrayBuffer(blob: Blob): void; + readAsBinaryString(blob: Blob): void; + readAsDataURL(blob: Blob): void; + readAsText(blob: Blob, encoding?: string): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var FileReader: { + prototype: FileReader; + new(): FileReader; +} + +interface FocusEvent extends UIEvent { + relatedTarget: EventTarget; + initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void; +} + +declare var FocusEvent: { + prototype: FocusEvent; + new(typeArg: string, eventInitDict?: FocusEventInit): FocusEvent; +} + +interface FormData { + append(name: any, value: any, blobName?: string): void; +} + +declare var FormData: { + prototype: FormData; + new(): FormData; +} + +interface GainNode extends AudioNode { + gain: AudioParam; +} + +declare var GainNode: { + prototype: GainNode; + new(): GainNode; +} + +interface Gamepad { + axes: number[]; + buttons: GamepadButton[]; + connected: boolean; + id: string; + index: number; + mapping: string; + timestamp: number; +} + +declare var Gamepad: { + prototype: Gamepad; + new(): Gamepad; +} + +interface GamepadButton { + pressed: boolean; + value: number; +} + +declare var GamepadButton: { + prototype: GamepadButton; + new(): GamepadButton; +} + +interface GamepadEvent extends Event { + gamepad: Gamepad; +} + +declare var GamepadEvent: { + prototype: GamepadEvent; + new(): GamepadEvent; +} + +interface Geolocation { + clearWatch(watchId: number): void; + getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void; + watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number; +} + +declare var Geolocation: { + prototype: Geolocation; + new(): Geolocation; +} + +interface HTMLAllCollection extends HTMLCollection { + namedItem(name: string): Element; +} + +declare var HTMLAllCollection: { + prototype: HTMLAllCollection; + new(): HTMLAllCollection; +} + +interface HTMLAnchorElement extends HTMLElement { + Methods: string; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Sets or retrieves the coordinates of the object. + */ + coords: string; + /** + * Contains the anchor portion of the URL including the hash sign (#). + */ + hash: string; + /** + * Contains the hostname and port values of the URL. + */ + host: string; + /** + * Contains the hostname of a URL. + */ + hostname: string; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or retrieves the language code of the object. + */ + hreflang: string; + mimeType: string; + /** + * Sets or retrieves the shape of the object. + */ + name: string; + nameProp: string; + /** + * Contains the pathname of the URL. + */ + pathname: string; + /** + * Sets or retrieves the port number associated with a URL. + */ + port: string; + /** + * Contains the protocol of the URL. + */ + protocol: string; + protocolLong: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rel: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rev: string; + /** + * Sets or retrieves the substring of the href property that follows the question mark. + */ + search: string; + /** + * Sets or retrieves the shape of the object. + */ + shape: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; + type: string; + urn: string; + /** + * Returns a string representation of an object. + */ + toString(): string; +} + +declare var HTMLAnchorElement: { + prototype: HTMLAnchorElement; + new(): HTMLAnchorElement; +} + +interface HTMLAppletElement extends HTMLElement { + /** + * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. + */ + BaseHref: string; + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Gets or sets the optional alternative HTML script to execute if the object fails to load. + */ + altHtml: string; + /** + * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. + */ + archive: string; + border: string; + code: string; + /** + * Sets or retrieves the URL of the component. + */ + codeBase: string; + /** + * Sets or retrieves the Internet media type for the code associated with the object. + */ + codeType: string; + /** + * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned. + */ + contentDocument: Document; + /** + * Sets or retrieves the URL that references the data of the object. + */ + data: string; + /** + * Sets or retrieves a character string that can be used to implement your own declare functionality for the object. + */ + declare: boolean; + form: HTMLFormElement; + /** + * Sets or retrieves the height of the object. + */ + height: string; + hspace: number; + /** + * Sets or retrieves the shape of the object. + */ + name: string; + object: string; + /** + * Sets or retrieves a message to be displayed while an object is loading. + */ + standby: string; + /** + * Returns the content type of the object. + */ + type: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + vspace: number; + width: number; +} + +declare var HTMLAppletElement: { + prototype: HTMLAppletElement; + new(): HTMLAppletElement; +} + +interface HTMLAreaElement extends HTMLElement { + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Sets or retrieves the coordinates of the object. + */ + coords: string; + /** + * Sets or retrieves the subsection of the href property that follows the number sign (#). + */ + hash: string; + /** + * Sets or retrieves the hostname and port number of the location or URL. + */ + host: string; + /** + * Sets or retrieves the host name part of the location or URL. + */ + hostname: string; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or gets whether clicks in this region cause action. + */ + noHref: boolean; + /** + * Sets or retrieves the file name or path specified by the object. + */ + pathname: string; + /** + * Sets or retrieves the port number associated with a URL. + */ + port: string; + /** + * Sets or retrieves the protocol portion of a URL. + */ + protocol: string; + rel: string; + /** + * Sets or retrieves the substring of the href property that follows the question mark. + */ + search: string; + /** + * Sets or retrieves the shape of the object. + */ + shape: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Returns a string representation of an object. + */ + toString(): string; +} + +declare var HTMLAreaElement: { + prototype: HTMLAreaElement; + new(): HTMLAreaElement; +} + +interface HTMLAreasCollection extends HTMLCollection { + /** + * Adds an element to the areas, controlRange, or options collection. + */ + add(element: HTMLElement, before?: HTMLElement): void; + add(element: HTMLElement, before?: number): void; + /** + * Removes an element from the collection. + */ + remove(index?: number): void; +} + +declare var HTMLAreasCollection: { + prototype: HTMLAreasCollection; + new(): HTMLAreasCollection; +} + +interface HTMLAudioElement extends HTMLMediaElement { +} + +declare var HTMLAudioElement: { + prototype: HTMLAudioElement; + new(): HTMLAudioElement; +} + +interface HTMLBRElement extends HTMLElement { + /** + * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document. + */ + clear: string; +} + +declare var HTMLBRElement: { + prototype: HTMLBRElement; + new(): HTMLBRElement; +} + +interface HTMLBaseElement extends HTMLElement { + /** + * Gets or sets the baseline URL on which relative links are based. + */ + href: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; +} + +declare var HTMLBaseElement: { + prototype: HTMLBaseElement; + new(): HTMLBaseElement; +} + +interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty { + /** + * Sets or retrieves the current typeface family. + */ + face: string; + /** + * Sets or retrieves the font size of the object. + */ + size: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLBaseFontElement: { + prototype: HTMLBaseFontElement; + new(): HTMLBaseFontElement; +} + +interface HTMLBlockElement extends HTMLElement { + /** + * Sets or retrieves reference information about the object. + */ + cite: string; + clear: string; + /** + * Sets or retrieves the width of the object. + */ + width: number; +} + +declare var HTMLBlockElement: { + prototype: HTMLBlockElement; + new(): HTMLBlockElement; +} + +interface HTMLBodyElement extends HTMLElement { + aLink: any; + background: string; + bgColor: any; + bgProperties: string; + link: any; + noWrap: boolean; + onafterprint: (ev: Event) => any; + onbeforeprint: (ev: Event) => any; + onbeforeunload: (ev: BeforeUnloadEvent) => any; + onblur: (ev: FocusEvent) => any; + onerror: (ev: Event) => any; + onfocus: (ev: FocusEvent) => any; + onhashchange: (ev: HashChangeEvent) => any; + onload: (ev: Event) => any; + onmessage: (ev: MessageEvent) => any; + onoffline: (ev: Event) => any; + ononline: (ev: Event) => any; + onorientationchange: (ev: Event) => any; + onpagehide: (ev: PageTransitionEvent) => any; + onpageshow: (ev: PageTransitionEvent) => any; + onpopstate: (ev: PopStateEvent) => any; + onresize: (ev: UIEvent) => any; + onstorage: (ev: StorageEvent) => any; + onunload: (ev: Event) => any; + text: any; + vLink: any; + createTextRange(): TextRange; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "msthumbnailclick", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stop", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mssitemodejumplistitemremoved", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectionchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "storagecommit", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msfullscreenerror", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msfullscreenchange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Document: { - prototype: Document; - new(): Document; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface Console { - info(message?: any, ...optionalParams: any[]): void; - warn(message?: any, ...optionalParams: any[]): void; - error(message?: any, ...optionalParams: any[]): void; - log(message?: any, ...optionalParams: any[]): void; - profile(reportName?: string): void; - assert(test?: boolean, message?: string, ...optionalParams: any[]): void; - msIsIndependentlyComposed(element: Element): boolean; - clear(): void; - dir(value?: any, ...optionalParams: any[]): void; - profileEnd(): void; - count(countTitle?: string): void; - groupEnd(): void; - time(timerName?: string): void; - timeEnd(timerName?: string): void; - trace(): void; - group(groupTitle?: string): void; - dirxml(value: any): void; - debug(message?: string, ...optionalParams: any[]): void; - groupCollapsed(groupTitle?: string): void; - select(element: Element): void; -} -declare var Console: { - prototype: Console; - new(): Console; +declare var HTMLBodyElement: { + prototype: HTMLBodyElement; + new(): HTMLBodyElement; } -interface MSEventObj extends Event { - nextPage: string; - keyCode: number; - toElement: Element; - returnValue: any; - dataFld: string; - y: number; - dataTransfer: DataTransfer; - propertyName: string; - url: string; - offsetX: number; - recordset: any; - screenX: number; - buttonID: number; - wheelDelta: number; - reason: number; - origin: string; - data: string; - srcFilter: any; - boundElements: HTMLCollection; - cancelBubble: boolean; - altLeft: boolean; - behaviorCookie: number; - bookmarks: BookmarkCollection; +interface HTMLButtonElement extends HTMLElement { + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Overrides the action attribute (where the data on a form is sent) on the parent form element. + */ + formAction: string; + /** + * Used to override the encoding (formEnctype attribute) specified on the form element. + */ + formEnctype: string; + /** + * Overrides the submit method attribute previously specified on a form element. + */ + formMethod: string; + /** + * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. + */ + formNoValidate: string; + /** + * Overrides the target attribute on a form element. + */ + formTarget: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + status: any; + /** + * Gets the classification and default behavior of the button. + */ type: string; - repeat: boolean; - srcElement: Element; - source: Window; - fromElement: Element; - offsetY: number; - x: number; - behaviorPart: number; - qualifier: string; - altKey: boolean; - ctrlKey: boolean; - clientY: number; - shiftKey: boolean; - shiftLeft: boolean; - contentOverflow: boolean; - screenY: number; - ctrlLeft: boolean; - button: number; - srcUrn: string; - clientX: number; - actionURL: string; - getAttribute(strAttributeName: string, lFlags?: number): any; - setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; - removeAttribute(strAttributeName: string, lFlags?: number): boolean; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Sets or retrieves the default or selected value of the control. + */ + value: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Creates a TextRange object for the element. + */ + createTextRange(): TextRange; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; } -declare var MSEventObj: { - prototype: MSEventObj; - new(): MSEventObj; + +declare var HTMLButtonElement: { + prototype: HTMLButtonElement; + new(): HTMLButtonElement; } interface HTMLCanvasElement extends HTMLElement { - /** - * Gets or sets the width of a canvas element on a document. - */ - width: number; /** * Gets or sets the height of a canvas element on a document. */ height: number; /** - * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. - * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); + * Gets or sets the width of a canvas element on a document. */ - getContext(contextId: "2d"): CanvasRenderingContext2D; + width: number; /** * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); */ - getContext(contextId: "experimental-webgl"): WebGLRenderingContext; + getContext(contextId: string, ...args: any[]): CanvasRenderingContext2D | WebGLRenderingContext; /** - * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. - * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); + * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. */ - getContext(contextId: string, ...args: any[]): any; + msToBlob(): Blob; /** * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element. * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image. */ toDataURL(type?: string, ...args: any[]): string; - /** - * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. - */ - msToBlob(): Blob; } + declare var HTMLCanvasElement: { prototype: HTMLCanvasElement; new(): HTMLCanvasElement; } -interface Window extends EventTarget, MSEventAttachmentTarget, WindowLocalStorage, MSWindowExtensions, WindowSessionStorage, WindowTimers, WindowBase64, IDBEnvironment, WindowConsole, GlobalEventHandlers { - ondragend: (ev: DragEvent) => any; - onkeydown: (ev: KeyboardEvent) => any; - ondragover: (ev: DragEvent) => any; - onkeyup: (ev: KeyboardEvent) => any; - onreset: (ev: Event) => any; - onmouseup: (ev: MouseEvent) => any; - ondragstart: (ev: DragEvent) => any; - ondrag: (ev: DragEvent) => any; - screenX: number; - onmouseover: (ev: MouseEvent) => any; - ondragleave: (ev: DragEvent) => any; - history: History; - pageXOffset: number; - name: string; - onafterprint: (ev: Event) => any; - onpause: (ev: Event) => any; - onbeforeprint: (ev: Event) => any; - top: Window; - onmousedown: (ev: MouseEvent) => any; - onseeked: (ev: Event) => any; - opener: Window; - onclick: (ev: MouseEvent) => any; - innerHeight: number; - onwaiting: (ev: Event) => any; - ononline: (ev: Event) => any; - ondurationchange: (ev: Event) => any; - frames: Window; - onblur: (ev: FocusEvent) => any; - onemptied: (ev: Event) => any; - onseeking: (ev: Event) => any; - oncanplay: (ev: Event) => any; - outerWidth: number; - onstalled: (ev: Event) => any; - onmousemove: (ev: MouseEvent) => any; - innerWidth: number; - onoffline: (ev: Event) => any; - length: number; - screen: Screen; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - onratechange: (ev: Event) => any; - onstorage: (ev: StorageEvent) => any; - onloadstart: (ev: Event) => any; - ondragenter: (ev: DragEvent) => any; - onsubmit: (ev: Event) => any; - self: Window; - document: Document; - onprogress: (ev: ProgressEvent) => any; - ondblclick: (ev: MouseEvent) => any; - pageYOffset: number; - oncontextmenu: (ev: MouseEvent) => any; - onchange: (ev: Event) => any; - onloadedmetadata: (ev: Event) => any; - onplay: (ev: Event) => any; - onerror: ErrorEventHandler; - onplaying: (ev: Event) => any; - parent: Window; - location: Location; - oncanplaythrough: (ev: Event) => any; - onabort: (ev: UIEvent) => any; - onreadystatechange: (ev: Event) => any; - outerHeight: number; - onkeypress: (ev: KeyboardEvent) => any; - frameElement: Element; - onloadeddata: (ev: Event) => any; - onsuspend: (ev: Event) => any; - window: Window; - onfocus: (ev: FocusEvent) => any; - onmessage: (ev: MessageEvent) => any; - ontimeupdate: (ev: Event) => any; - onresize: (ev: UIEvent) => any; - onselect: (ev: UIEvent) => any; - navigator: Navigator; - styleMedia: StyleMedia; - ondrop: (ev: DragEvent) => any; - onmouseout: (ev: MouseEvent) => any; - onended: (ev: Event) => any; - onhashchange: (ev: Event) => any; - onunload: (ev: Event) => any; - onscroll: (ev: UIEvent) => any; - screenY: number; - onmousewheel: (ev: MouseWheelEvent) => any; - onload: (ev: Event) => any; - onvolumechange: (ev: Event) => any; - oninput: (ev: Event) => any; - performance: Performance; - onmspointerdown: (ev: any) => any; - animationStartTime: number; - onmsgesturedoubletap: (ev: any) => any; - onmspointerhover: (ev: any) => any; - onmsgesturehold: (ev: any) => any; - onmspointermove: (ev: any) => any; - onmsgesturechange: (ev: any) => any; - onmsgesturestart: (ev: any) => any; - onmspointercancel: (ev: any) => any; - onmsgestureend: (ev: any) => any; - onmsgesturetap: (ev: any) => any; - onmspointerout: (ev: any) => any; - msAnimationStartTime: number; - applicationCache: ApplicationCache; - onmsinertiastart: (ev: any) => any; - onmspointerover: (ev: any) => any; - onpopstate: (ev: PopStateEvent) => any; - onmspointerup: (ev: any) => any; - onpageshow: (ev: PageTransitionEvent) => any; - ondevicemotion: (ev: DeviceMotionEvent) => any; - devicePixelRatio: number; - msCrypto: Crypto; - ondeviceorientation: (ev: DeviceOrientationEvent) => any; - doNotTrack: string; - onmspointerenter: (ev: any) => any; - onpagehide: (ev: PageTransitionEvent) => any; - onmspointerleave: (ev: any) => any; - alert(message?: any): void; - scroll(x?: number, y?: number): void; - focus(): void; - scrollTo(x?: number, y?: number): void; - print(): void; - prompt(message?: string, _default?: string): string; - toString(): string; - open(url?: string, target?: string, features?: string, replace?: boolean): Window; - scrollBy(x?: number, y?: number): void; - confirm(message?: string): boolean; - close(): void; - postMessage(message: any, targetOrigin: string, ports?: any): void; - showModalDialog(url?: string, argument?: any, options?: any): any; - blur(): void; - getSelection(): Selection; - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; - msCancelRequestAnimationFrame(handle: number): void; - matchMedia(mediaQuery: string): MediaQueryList; - cancelAnimationFrame(handle: number): void; - msIsStaticHTML(html: string): boolean; - msMatchMedia(mediaQuery: string): MediaQueryList; - requestAnimationFrame(callback: FrameRequestCallback): number; - msRequestAnimationFrame(callback: FrameRequestCallback): number; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Window: { - prototype: Window; - new(): Window; -} - -interface HTMLCollection extends MSHTMLCollectionExtensions { +interface HTMLCollection { /** * Sets or retrieves the number of objects in a collection. */ @@ -6874,1338 +8730,2371 @@ interface HTMLCollection extends MSHTMLCollectionExtensions { * Retrieves a select object or an object from an options collection. */ namedItem(name: string): Element; - // [name: string]: Element; [index: number]: Element; } + declare var HTMLCollection: { prototype: HTMLCollection; new(): HTMLCollection; } -interface BlobPropertyBag { - type?: string; - endings?: string; +interface HTMLDDElement extends HTMLElement { + /** + * Sets or retrieves whether the browser automatically performs wordwrap. + */ + noWrap: boolean; } -interface Blob { - type: string; - size: number; - msDetachStream(): any; - slice(start?: number, end?: number, contentType?: string): Blob; - msClose(): void; -} -declare var Blob: { - prototype: Blob; - new (blobParts?: any[], options?: BlobPropertyBag): Blob; +declare var HTMLDDElement: { + prototype: HTMLDDElement; + new(): HTMLDDElement; } -interface NavigatorID { - appVersion: string; - appName: string; - userAgent: string; - platform: string; - product: string; - vendor: string; +interface HTMLDListElement extends HTMLElement { + compact: boolean; } -interface HTMLTableElement extends HTMLElement, MSDataBindingTableExtensions, MSDataBindingExtensions, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorLight: any; - /** - * Sets or retrieves the amount of space between cells in a table. - */ - cellSpacing: string; - /** - * Retrieves the tFoot object of the table. - */ - tFoot: HTMLTableSectionElement; - /** - * Sets or retrieves the way the border frame around the table is displayed. - */ - frame: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: HTMLCollection; - /** - * Sets or retrieves which dividing lines (inner borders) are displayed. - */ - rules: string; - /** - * Sets or retrieves the number of columns in the table. - */ - cols: number; - /** - * Sets or retrieves a description and/or structure of the object. - */ - summary: string; - /** - * Retrieves the caption object of a table. - */ - caption: HTMLTableCaptionElement; - /** - * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order. - */ - tBodies: HTMLCollection; - /** - * Retrieves the tHead object of the table. - */ - tHead: HTMLTableSectionElement; - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; - /** - * Retrieves a collection of all cells in the table row or in the entire table. - */ - cells: HTMLCollection; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves the amount of space between the border of the cell and the content of the cell. - */ - cellPadding: string; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - border: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorDark: any; - /** - * Removes the specified row (tr) from the element and from the rows collection. - * @param index Number that specifies the zero-based position in the rows collection of the row to remove. - */ - deleteRow(index?: number): void; - /** - * Creates an empty tBody element in the table. - */ - createTBody(): HTMLElement; - /** - * Deletes the caption element and its contents from the table. - */ - deleteCaption(): void; - /** - * Creates a new row (tr) in the table, and adds the row to the rows collection. - * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. - */ - insertRow(index?: number): HTMLElement; - /** - * Deletes the tFoot element and its contents from the table. - */ - deleteTFoot(): void; - /** - * Returns the tHead element object if successful, or null otherwise. - */ - createTHead(): HTMLElement; - /** - * Deletes the tHead element and its contents from the table. - */ - deleteTHead(): void; - /** - * Creates an empty caption element in the table. - */ - createCaption(): HTMLElement; - /** - * Moves a table row to a new position. - * @param indexFrom Number that specifies the index in the rows collection of the table row that is moved. - * @param indexTo Number that specifies where the row is moved within the rows collection. - */ - moveRow(indexFrom?: number, indexTo?: number): any; - /** - * Creates an empty tFoot element in the table. - */ - createTFoot(): HTMLElement; -} -declare var HTMLTableElement: { - prototype: HTMLTableElement; - new(): HTMLTableElement; +declare var HTMLDListElement: { + prototype: HTMLDListElement; + new(): HTMLDListElement; } -interface TreeWalker { - whatToShow: number; - filter: NodeFilter; - root: Node; - currentNode: Node; - expandEntityReferences: boolean; - previousSibling(): Node; - lastChild(): Node; - nextSibling(): Node; - nextNode(): Node; - parentNode(): Node; - firstChild(): Node; - previousNode(): Node; -} -declare var TreeWalker: { - prototype: TreeWalker; - new(): TreeWalker; -} - -interface GetSVGDocument { - getSVGDocument(): Document; -} - -interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { - y: number; - y1: number; - x: number; - x1: number; -} -declare var SVGPathSegCurvetoQuadraticRel: { - prototype: SVGPathSegCurvetoQuadraticRel; - new(): SVGPathSegCurvetoQuadraticRel; -} - -interface Performance { - navigation: PerformanceNavigation; - timing: PerformanceTiming; - getEntriesByType(entryType: string): any; - toJSON(): any; - getMeasures(measureName?: string): any; - clearMarks(markName?: string): void; - getMarks(markName?: string): any; - clearResourceTimings(): void; - mark(markName: string): void; - measure(measureName: string, startMarkName?: string, endMarkName?: string): void; - getEntriesByName(name: string, entryType?: string): any; - getEntries(): any; - clearMeasures(measureName?: string): void; - setResourceTimingBufferSize(maxSize: number): void; - now(): number; -} -declare var Performance: { - prototype: Performance; - new(): Performance; -} - -interface MSDataBindingTableExtensions { - dataPageSize: number; - nextPage(): void; - firstPage(): void; - refresh(): void; - previousPage(): void; - lastPage(): void; -} - -interface CompositionEvent extends UIEvent { - data: string; - locale: string; - initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void; -} -declare var CompositionEvent: { - prototype: CompositionEvent; - new(): CompositionEvent; -} - -interface WindowTimers extends WindowTimersExtension { - clearTimeout(handle: number): void; - setTimeout(handler: any, timeout?: any, ...args: any[]): number; - clearInterval(handle: number): void; - setInterval(handler: any, timeout?: any, ...args: any[]): number; -} - -interface SVGMarkerElement extends SVGElement, SVGStylable, SVGLangSpace, SVGFitToViewBox, SVGExternalResourcesRequired { - orientType: SVGAnimatedEnumeration; - markerUnits: SVGAnimatedEnumeration; - markerWidth: SVGAnimatedLength; - markerHeight: SVGAnimatedLength; - orientAngle: SVGAnimatedAngle; - refY: SVGAnimatedLength; - refX: SVGAnimatedLength; - setOrientToAngle(angle: SVGAngle): void; - setOrientToAuto(): void; - SVG_MARKER_ORIENT_UNKNOWN: number; - SVG_MARKER_ORIENT_ANGLE: number; - SVG_MARKERUNITS_UNKNOWN: number; - SVG_MARKERUNITS_STROKEWIDTH: number; - SVG_MARKER_ORIENT_AUTO: number; - SVG_MARKERUNITS_USERSPACEONUSE: number; -} -declare var SVGMarkerElement: { - prototype: SVGMarkerElement; - new(): SVGMarkerElement; - SVG_MARKER_ORIENT_UNKNOWN: number; - SVG_MARKER_ORIENT_ANGLE: number; - SVG_MARKERUNITS_UNKNOWN: number; - SVG_MARKERUNITS_STROKEWIDTH: number; - SVG_MARKER_ORIENT_AUTO: number; - SVG_MARKERUNITS_USERSPACEONUSE: number; -} - -interface CSSStyleDeclaration { - backgroundAttachment: string; - visibility: string; - textAlignLast: string; - borderRightStyle: string; - counterIncrement: string; - orphans: string; - cssText: string; - borderStyle: string; - pointerEvents: string; - borderTopColor: string; - markerEnd: string; - textIndent: string; - listStyleImage: string; - cursor: string; - listStylePosition: string; - wordWrap: string; - borderTopStyle: string; - alignmentBaseline: string; - opacity: string; - direction: string; - strokeMiterlimit: string; - maxWidth: string; - color: string; - clip: string; - borderRightWidth: string; - verticalAlign: string; - overflow: string; - mask: string; - borderLeftStyle: string; - emptyCells: string; - stopOpacity: string; - paddingRight: string; - parentRule: CSSRule; - background: string; - boxSizing: string; - textJustify: string; - height: string; - paddingTop: string; - length: number; - right: string; - baselineShift: string; - borderLeft: string; - widows: string; - lineHeight: string; - left: string; - textUnderlinePosition: string; - glyphOrientationHorizontal: string; - display: string; - textAnchor: string; - cssFloat: string; - strokeDasharray: string; - rubyAlign: string; - fontSizeAdjust: string; - borderLeftColor: string; - backgroundImage: string; - listStyleType: string; - strokeWidth: string; - textOverflow: string; - fillRule: string; - borderBottomColor: string; - zIndex: string; - position: string; - listStyle: string; - msTransformOrigin: string; - dominantBaseline: string; - overflowY: string; - fill: string; - captionSide: string; - borderCollapse: string; - boxShadow: string; - quotes: string; - tableLayout: string; - unicodeBidi: string; - borderBottomWidth: string; - backgroundSize: string; - textDecoration: string; - strokeDashoffset: string; - fontSize: string; - border: string; - pageBreakBefore: string; - borderTopRightRadius: string; - msTransform: string; - borderBottomLeftRadius: string; - textTransform: string; - rubyPosition: string; - strokeLinejoin: string; - clipPath: string; - borderRightColor: string; - fontFamily: string; - clear: string; - content: string; - backgroundClip: string; - marginBottom: string; - counterReset: string; - outlineWidth: string; - marginRight: string; - paddingLeft: string; - borderBottom: string; - wordBreak: string; - marginTop: string; - top: string; - fontWeight: string; - borderRight: string; - width: string; - kerning: string; - pageBreakAfter: string; - borderBottomStyle: string; - fontStretch: string; - padding: string; - strokeOpacity: string; - markerStart: string; - bottom: string; - borderLeftWidth: string; - clipRule: string; - backgroundPosition: string; - backgroundColor: string; - pageBreakInside: string; - backgroundOrigin: string; - strokeLinecap: string; - borderTopWidth: string; - outlineStyle: string; - borderTop: string; - outlineColor: string; - paddingBottom: string; - marginLeft: string; - font: string; - outline: string; - wordSpacing: string; - maxHeight: string; - fillOpacity: string; - letterSpacing: string; - borderSpacing: string; - backgroundRepeat: string; - borderRadius: string; - borderWidth: string; - borderBottomRightRadius: string; - whiteSpace: string; - fontStyle: string; - minWidth: string; - stopColor: string; - borderTopLeftRadius: string; - borderColor: string; - marker: string; - glyphOrientationVertical: string; - markerMid: string; - fontVariant: string; - minHeight: string; - stroke: string; - rubyOverhang: string; - overflowX: string; - textAlign: string; - margin: string; - animationFillMode: string; - floodColor: string; - animationIterationCount: string; - textShadow: string; - backfaceVisibility: string; - msAnimationIterationCount: string; - animationDelay: string; - animationTimingFunction: string; - columnWidth: any; - msScrollSnapX: string; - columnRuleColor: any; - columnRuleWidth: any; - transitionDelay: string; - transition: string; - msFlowFrom: string; - msScrollSnapType: string; - msContentZoomSnapType: string; - msGridColumns: string; - msAnimationName: string; - msGridRowAlign: string; - msContentZoomChaining: string; - msGridColumn: any; - msHyphenateLimitZone: any; - msScrollRails: string; - msAnimationDelay: string; - enableBackground: string; - msWrapThrough: string; - columnRuleStyle: string; - msAnimation: string; - msFlexFlow: string; - msScrollSnapY: string; - msHyphenateLimitLines: any; - msTouchAction: string; - msScrollLimit: string; - animation: string; - transform: string; - filter: string; - colorInterpolationFilters: string; - transitionTimingFunction: string; - msBackfaceVisibility: string; - animationPlayState: string; - transformOrigin: string; - msScrollLimitYMin: any; - msFontFeatureSettings: string; - msContentZoomLimitMin: any; - columnGap: any; - transitionProperty: string; - msAnimationDuration: string; - msAnimationFillMode: string; - msFlexDirection: string; - msTransitionDuration: string; - fontFeatureSettings: string; - breakBefore: string; - msFlexWrap: string; - perspective: string; - msFlowInto: string; - msTransformStyle: string; - msScrollTranslation: string; - msTransitionProperty: string; - msUserSelect: string; - msOverflowStyle: string; - msScrollSnapPointsY: string; - animationDirection: string; - animationDuration: string; - msFlex: string; - msTransitionTimingFunction: string; - animationName: string; - columnRule: string; - msGridColumnSpan: any; - msFlexNegative: string; - columnFill: string; - msGridRow: any; - msFlexOrder: string; - msFlexItemAlign: string; - msFlexPositive: string; - msContentZoomLimitMax: any; - msScrollLimitYMax: any; - msGridColumnAlign: string; - perspectiveOrigin: string; - lightingColor: string; - columns: string; - msScrollChaining: string; - msHyphenateLimitChars: string; - msTouchSelect: string; - floodOpacity: string; - msAnimationDirection: string; - msAnimationPlayState: string; - columnSpan: string; - msContentZooming: string; - msPerspective: string; - msFlexPack: string; - msScrollSnapPointsX: string; - msContentZoomSnapPoints: string; - msGridRowSpan: any; - msContentZoomSnap: string; - msScrollLimitXMin: any; - breakInside: string; - msHighContrastAdjust: string; - msFlexLinePack: string; - msGridRows: string; - transitionDuration: string; - msHyphens: string; - breakAfter: string; - msTransition: string; - msPerspectiveOrigin: string; - msContentZoomLimit: string; - msScrollLimitXMax: any; - msFlexAlign: string; - msWrapMargin: any; - columnCount: any; - msAnimationTimingFunction: string; - msTransitionDelay: string; - transformStyle: string; - msWrapFlow: string; - msFlexPreferredSize: string; - alignItems: string; - borderImageSource: string; - flexBasis: string; - borderImageWidth: string; - borderImageRepeat: string; - order: string; - flex: string; - alignContent: string; - msImeAlign: string; - flexShrink: string; - flexGrow: string; - borderImageSlice: string; - flexWrap: string; - borderImageOutset: string; - flexDirection: string; - touchAction: string; - flexFlow: string; - borderImage: string; - justifyContent: string; - alignSelf: string; - msTextCombineHorizontal: string; - getPropertyPriority(propertyName: string): string; - getPropertyValue(propertyName: string): string; - removeProperty(propertyName: string): string; - item(index: number): string; - [index: number]: string; - setProperty(propertyName: string, value: string, priority?: string): void; -} -declare var CSSStyleDeclaration: { - prototype: CSSStyleDeclaration; - new(): CSSStyleDeclaration; -} - -interface SVGGElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGGElement: { - prototype: SVGGElement; - new(): SVGGElement; -} - -interface MSStyleCSSProperties extends MSCSSProperties { - pixelWidth: number; - posHeight: number; - posLeft: number; - pixelTop: number; - pixelBottom: number; - textDecorationNone: boolean; - pixelLeft: number; - posTop: number; - posBottom: number; - textDecorationOverline: boolean; - posWidth: number; - textDecorationLineThrough: boolean; - pixelHeight: number; - textDecorationBlink: boolean; - posRight: number; - pixelRight: number; - textDecorationUnderline: boolean; -} -declare var MSStyleCSSProperties: { - prototype: MSStyleCSSProperties; - new(): MSStyleCSSProperties; -} - -interface Navigator extends NavigatorID, NavigatorOnLine, NavigatorContentUtils, MSNavigatorExtensions, NavigatorGeolocation, MSNavigatorDoNotTrack, NavigatorStorageUtils, MSFileSaver { - msMaxTouchPoints: number; - msPointerEnabled: boolean; - msManipulationViewsEnabled: boolean; - pointerEnabled: boolean; - maxTouchPoints: number; - msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; -} -declare var Navigator: { - prototype: Navigator; - new(): Navigator; -} - -interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg { - y: number; - x2: number; - x: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicSmoothAbs: { - prototype: SVGPathSegCurvetoCubicSmoothAbs; - new(): SVGPathSegCurvetoCubicSmoothAbs; -} - -interface SVGZoomEvent extends UIEvent { - zoomRectScreen: SVGRect; - previousScale: number; - newScale: number; - previousTranslate: SVGPoint; - newTranslate: SVGPoint; -} -declare var SVGZoomEvent: { - prototype: SVGZoomEvent; - new(): SVGZoomEvent; -} - -interface NodeSelector { - querySelectorAll(selectors: string): NodeList; - querySelector(selectors: string): Element; -} - -interface HTMLTableDataCellElement extends HTMLTableCellElement { -} -declare var HTMLTableDataCellElement: { - prototype: HTMLTableDataCellElement; - new(): HTMLTableDataCellElement; -} - -interface HTMLBaseElement extends HTMLElement { +interface HTMLDTElement extends HTMLElement { /** - * Sets or retrieves the window or frame at which to target content. + * Sets or retrieves whether the browser automatically performs wordwrap. */ - target: string; - /** - * Gets or sets the baseline URL on which relative links are based. - */ - href: string; -} -declare var HTMLBaseElement: { - prototype: HTMLBaseElement; - new(): HTMLBaseElement; + noWrap: boolean; } -interface ClientRect { - left: number; - width: number; - right: number; - top: number; - bottom: number; - height: number; -} -declare var ClientRect: { - prototype: ClientRect; - new(): ClientRect; +declare var HTMLDTElement: { + prototype: HTMLDTElement; + new(): HTMLDTElement; } -interface PositionErrorCallback { - (error: PositionError): void; +interface HTMLDataListElement extends HTMLElement { + options: HTMLCollection; } -interface DOMImplementation { - createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; - createDocument(namespaceURI: string, qualifiedName: string, doctype: DocumentType): Document; - hasFeature(feature: string, version?: string): boolean; - createHTMLDocument(title: string): Document; -} -declare var DOMImplementation: { - prototype: DOMImplementation; - new(): DOMImplementation; +declare var HTMLDataListElement: { + prototype: HTMLDataListElement; + new(): HTMLDataListElement; } -interface SVGUnitTypes { - SVG_UNIT_TYPE_UNKNOWN: number; - SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; - SVG_UNIT_TYPE_USERSPACEONUSE: number; -} -declare var SVGUnitTypes: SVGUnitTypes; - -interface Element extends Node, NodeSelector, ElementTraversal, GlobalEventHandlers { - scrollTop: number; - clientLeft: number; - scrollLeft: number; - tagName: string; - clientWidth: number; - scrollWidth: number; - clientHeight: number; - clientTop: number; - scrollHeight: number; - msRegionOverflow: string; - onmspointerdown: (ev: any) => any; - onmsgotpointercapture: (ev: any) => any; - onmsgesturedoubletap: (ev: any) => any; - onmspointerhover: (ev: any) => any; - onmsgesturehold: (ev: any) => any; - onmspointermove: (ev: any) => any; - onmsgesturechange: (ev: any) => any; - onmsgesturestart: (ev: any) => any; - onmspointercancel: (ev: any) => any; - onmsgestureend: (ev: any) => any; - onmsgesturetap: (ev: any) => any; - onmspointerout: (ev: any) => any; - onmsinertiastart: (ev: any) => any; - onmslostpointercapture: (ev: any) => any; - onmspointerover: (ev: any) => any; - msContentZoomFactor: number; - onmspointerup: (ev: any) => any; - onlostpointercapture: (ev: PointerEvent) => any; - onmspointerenter: (ev: any) => any; - ongotpointercapture: (ev: PointerEvent) => any; - onmspointerleave: (ev: any) => any; - getAttribute(name?: string): string; - getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; - hasAttributeNS(namespaceURI: string, localName: string): boolean; - getBoundingClientRect(): ClientRect; - getAttributeNS(namespaceURI: string, localName: string): string; - getAttributeNodeNS(namespaceURI: string, localName: string): Attr; - setAttributeNodeNS(newAttr: Attr): Attr; - msMatchesSelector(selectors: string): boolean; - hasAttribute(name: string): boolean; - removeAttribute(name?: string): void; - setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; - getAttributeNode(name: string): Attr; - fireEvent(eventName: string, eventObj?: any): boolean; - getElementsByTagName(name: "a"): NodeListOf; - getElementsByTagName(name: "abbr"): NodeListOf; - getElementsByTagName(name: "acronym"): NodeListOf; - getElementsByTagName(name: "address"): NodeListOf; - getElementsByTagName(name: "applet"): NodeListOf; - getElementsByTagName(name: "area"): NodeListOf; - getElementsByTagName(name: "article"): NodeListOf; - getElementsByTagName(name: "aside"): NodeListOf; - getElementsByTagName(name: "audio"): NodeListOf; - getElementsByTagName(name: "b"): NodeListOf; - getElementsByTagName(name: "base"): NodeListOf; - getElementsByTagName(name: "basefont"): NodeListOf; - getElementsByTagName(name: "bdo"): NodeListOf; - getElementsByTagName(name: "bgsound"): NodeListOf; - getElementsByTagName(name: "big"): NodeListOf; - getElementsByTagName(name: "blockquote"): NodeListOf; - getElementsByTagName(name: "body"): NodeListOf; - getElementsByTagName(name: "br"): NodeListOf; - getElementsByTagName(name: "button"): NodeListOf; - getElementsByTagName(name: "canvas"): NodeListOf; - getElementsByTagName(name: "caption"): NodeListOf; - getElementsByTagName(name: "center"): NodeListOf; - getElementsByTagName(name: "cite"): NodeListOf; - getElementsByTagName(name: "code"): NodeListOf; - getElementsByTagName(name: "col"): NodeListOf; - getElementsByTagName(name: "colgroup"): NodeListOf; - getElementsByTagName(name: "datalist"): NodeListOf; - getElementsByTagName(name: "dd"): NodeListOf; - getElementsByTagName(name: "del"): NodeListOf; - getElementsByTagName(name: "dfn"): NodeListOf; - getElementsByTagName(name: "dir"): NodeListOf; - getElementsByTagName(name: "div"): NodeListOf; - getElementsByTagName(name: "dl"): NodeListOf; - getElementsByTagName(name: "dt"): NodeListOf; - getElementsByTagName(name: "em"): NodeListOf; - getElementsByTagName(name: "embed"): NodeListOf; - getElementsByTagName(name: "fieldset"): NodeListOf; - getElementsByTagName(name: "figcaption"): NodeListOf; - getElementsByTagName(name: "figure"): NodeListOf; - getElementsByTagName(name: "font"): NodeListOf; - getElementsByTagName(name: "footer"): NodeListOf; - getElementsByTagName(name: "form"): NodeListOf; - getElementsByTagName(name: "frame"): NodeListOf; - getElementsByTagName(name: "frameset"): NodeListOf; - getElementsByTagName(name: "h1"): NodeListOf; - getElementsByTagName(name: "h2"): NodeListOf; - getElementsByTagName(name: "h3"): NodeListOf; - getElementsByTagName(name: "h4"): NodeListOf; - getElementsByTagName(name: "h5"): NodeListOf; - getElementsByTagName(name: "h6"): NodeListOf; - getElementsByTagName(name: "head"): NodeListOf; - getElementsByTagName(name: "header"): NodeListOf; - getElementsByTagName(name: "hgroup"): NodeListOf; - getElementsByTagName(name: "hr"): NodeListOf; - getElementsByTagName(name: "html"): NodeListOf; - getElementsByTagName(name: "i"): NodeListOf; - getElementsByTagName(name: "iframe"): NodeListOf; - getElementsByTagName(name: "img"): NodeListOf; - getElementsByTagName(name: "input"): NodeListOf; - getElementsByTagName(name: "ins"): NodeListOf; - getElementsByTagName(name: "isindex"): NodeListOf; - getElementsByTagName(name: "kbd"): NodeListOf; - getElementsByTagName(name: "keygen"): NodeListOf; - getElementsByTagName(name: "label"): NodeListOf; - getElementsByTagName(name: "legend"): NodeListOf; - getElementsByTagName(name: "li"): NodeListOf; - getElementsByTagName(name: "link"): NodeListOf; - getElementsByTagName(name: "listing"): NodeListOf; - getElementsByTagName(name: "map"): NodeListOf; - getElementsByTagName(name: "mark"): NodeListOf; - getElementsByTagName(name: "marquee"): NodeListOf; - getElementsByTagName(name: "menu"): NodeListOf; - getElementsByTagName(name: "meta"): NodeListOf; - getElementsByTagName(name: "nav"): NodeListOf; - getElementsByTagName(name: "nextid"): NodeListOf; - getElementsByTagName(name: "nobr"): NodeListOf; - getElementsByTagName(name: "noframes"): NodeListOf; - getElementsByTagName(name: "noscript"): NodeListOf; - getElementsByTagName(name: "object"): NodeListOf; - getElementsByTagName(name: "ol"): NodeListOf; - getElementsByTagName(name: "optgroup"): NodeListOf; - getElementsByTagName(name: "option"): NodeListOf; - getElementsByTagName(name: "p"): NodeListOf; - getElementsByTagName(name: "param"): NodeListOf; - getElementsByTagName(name: "plaintext"): NodeListOf; - getElementsByTagName(name: "pre"): NodeListOf; - getElementsByTagName(name: "progress"): NodeListOf; - getElementsByTagName(name: "q"): NodeListOf; - getElementsByTagName(name: "rt"): NodeListOf; - getElementsByTagName(name: "ruby"): NodeListOf; - getElementsByTagName(name: "s"): NodeListOf; - getElementsByTagName(name: "samp"): NodeListOf; - getElementsByTagName(name: "script"): NodeListOf; - getElementsByTagName(name: "section"): NodeListOf; - getElementsByTagName(name: "select"): NodeListOf; - getElementsByTagName(name: "small"): NodeListOf; - getElementsByTagName(name: "SOURCE"): NodeListOf; - getElementsByTagName(name: "span"): NodeListOf; - getElementsByTagName(name: "strike"): NodeListOf; - getElementsByTagName(name: "strong"): NodeListOf; - getElementsByTagName(name: "style"): NodeListOf; - getElementsByTagName(name: "sub"): NodeListOf; - getElementsByTagName(name: "sup"): NodeListOf; - getElementsByTagName(name: "table"): NodeListOf; - getElementsByTagName(name: "tbody"): NodeListOf; - getElementsByTagName(name: "td"): NodeListOf; - getElementsByTagName(name: "textarea"): NodeListOf; - getElementsByTagName(name: "tfoot"): NodeListOf; - getElementsByTagName(name: "th"): NodeListOf; - getElementsByTagName(name: "thead"): NodeListOf; - getElementsByTagName(name: "title"): NodeListOf; - getElementsByTagName(name: "tr"): NodeListOf; - getElementsByTagName(name: "track"): NodeListOf; - getElementsByTagName(name: "tt"): NodeListOf; - getElementsByTagName(name: "u"): NodeListOf; - getElementsByTagName(name: "ul"): NodeListOf; - getElementsByTagName(name: "var"): NodeListOf; - getElementsByTagName(name: "video"): NodeListOf; - getElementsByTagName(name: "wbr"): NodeListOf; - getElementsByTagName(name: "x-ms-webview"): NodeListOf; - getElementsByTagName(name: "xmp"): NodeListOf; - getElementsByTagName(name: string): NodeList; - getClientRects(): ClientRectList; - setAttributeNode(newAttr: Attr): Attr; - removeAttributeNode(oldAttr: Attr): Attr; - setAttribute(name?: string, value?: string): void; - removeAttributeNS(namespaceURI: string, localName: string): void; - msGetRegionContent(): MSRangeCollection; - msReleasePointerCapture(pointerId: number): void; - msSetPointerCapture(pointerId: number): void; - msZoomTo(args: MsZoomToOptions): void; - setPointerCapture(pointerId: number): void; - msGetUntransformedBounds(): ClientRect; - releasePointerCapture(pointerId: number): void; - msRequestFullscreen(): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Element: { - prototype: Element; - new(): Element; +interface HTMLDirectoryElement extends HTMLElement { + compact: boolean; } -interface HTMLNextIdElement extends HTMLElement { - n: string; -} -declare var HTMLNextIdElement: { - prototype: HTMLNextIdElement; - new(): HTMLNextIdElement; +declare var HTMLDirectoryElement: { + prototype: HTMLDirectoryElement; + new(): HTMLDirectoryElement; } -interface SVGPathSegMovetoRel extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegMovetoRel: { - prototype: SVGPathSegMovetoRel; - new(): SVGPathSegMovetoRel; -} - -interface SVGLineElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - y1: SVGAnimatedLength; - x2: SVGAnimatedLength; - x1: SVGAnimatedLength; - y2: SVGAnimatedLength; -} -declare var SVGLineElement: { - prototype: SVGLineElement; - new(): SVGLineElement; -} - -interface HTMLParagraphElement extends HTMLElement, DOML2DeprecatedTextFlowControl { +interface HTMLDivElement extends HTMLElement { /** * Sets or retrieves how the object is aligned with adjacent text. */ align: string; -} -declare var HTMLParagraphElement: { - prototype: HTMLParagraphElement; - new(): HTMLParagraphElement; -} - -interface HTMLAreasCollection extends HTMLCollection { /** - * Removes an element from the collection. + * Sets or retrieves whether the browser automatically performs wordwrap. */ - remove(index?: number): void; - /** - * Adds an element to the areas, controlRange, or options collection. - */ - add(element: HTMLElement, before?: any): void; -} -declare var HTMLAreasCollection: { - prototype: HTMLAreasCollection; - new(): HTMLAreasCollection; + noWrap: boolean; } -interface SVGDescElement extends SVGElement, SVGStylable, SVGLangSpace { -} -declare var SVGDescElement: { - prototype: SVGDescElement; - new(): SVGDescElement; +declare var HTMLDivElement: { + prototype: HTMLDivElement; + new(): HTMLDivElement; } -interface Node extends EventTarget { - nodeType: number; - previousSibling: Node; - localName: string; - namespaceURI: string; - textContent: string; - parentNode: Node; - nextSibling: Node; - nodeValue: string; - lastChild: Node; - childNodes: NodeList; - nodeName: string; - ownerDocument: Document; - attributes: NamedNodeMap; - firstChild: Node; - prefix: string; - removeChild(oldChild: Node): Node; - appendChild(newChild: Node): Node; - isSupported(feature: string, version: string): boolean; - isEqualNode(arg: Node): boolean; - lookupPrefix(namespaceURI: string): string; - isDefaultNamespace(namespaceURI: string): boolean; - compareDocumentPosition(other: Node): number; - normalize(): void; - isSameNode(other: Node): boolean; - hasAttributes(): boolean; - lookupNamespaceURI(prefix: string): string; - cloneNode(deep?: boolean): Node; - hasChildNodes(): boolean; - replaceChild(newChild: Node, oldChild: Node): Node; - insertBefore(newChild: Node, refChild?: Node): Node; - ENTITY_REFERENCE_NODE: number; - ATTRIBUTE_NODE: number; - DOCUMENT_FRAGMENT_NODE: number; - TEXT_NODE: number; - ELEMENT_NODE: number; - COMMENT_NODE: number; - DOCUMENT_POSITION_DISCONNECTED: number; - DOCUMENT_POSITION_CONTAINED_BY: number; - DOCUMENT_POSITION_CONTAINS: number; - DOCUMENT_TYPE_NODE: number; - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - DOCUMENT_NODE: number; - ENTITY_NODE: number; - PROCESSING_INSTRUCTION_NODE: number; - CDATA_SECTION_NODE: number; - NOTATION_NODE: number; - DOCUMENT_POSITION_FOLLOWING: number; - DOCUMENT_POSITION_PRECEDING: number; -} -declare var Node: { - prototype: Node; - new(): Node; - ENTITY_REFERENCE_NODE: number; - ATTRIBUTE_NODE: number; - DOCUMENT_FRAGMENT_NODE: number; - TEXT_NODE: number; - ELEMENT_NODE: number; - COMMENT_NODE: number; - DOCUMENT_POSITION_DISCONNECTED: number; - DOCUMENT_POSITION_CONTAINED_BY: number; - DOCUMENT_POSITION_CONTAINS: number; - DOCUMENT_TYPE_NODE: number; - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - DOCUMENT_NODE: number; - ENTITY_NODE: number; - PROCESSING_INSTRUCTION_NODE: number; - CDATA_SECTION_NODE: number; - NOTATION_NODE: number; - DOCUMENT_POSITION_FOLLOWING: number; - DOCUMENT_POSITION_PRECEDING: number; +interface HTMLDocument extends Document { } -interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegCurvetoQuadraticSmoothRel: { - prototype: SVGPathSegCurvetoQuadraticSmoothRel; - new(): SVGPathSegCurvetoQuadraticSmoothRel; +declare var HTMLDocument: { + prototype: HTMLDocument; + new(): HTMLDocument; } -interface DOML2DeprecatedListSpaceReduction { - compact: boolean; +interface HTMLElement extends Element { + accessKey: string; + children: HTMLCollection; + className: string; + contentEditable: string; + dataset: DOMStringMap; + dir: string; + draggable: boolean; + hidden: boolean; + hideFocus: boolean; + id: string; + innerHTML: string; + innerText: string; + isContentEditable: boolean; + lang: string; + offsetHeight: number; + offsetLeft: number; + offsetParent: Element; + offsetTop: number; + offsetWidth: number; + onabort: (ev: Event) => any; + onactivate: (ev: UIEvent) => any; + onbeforeactivate: (ev: UIEvent) => any; + onbeforecopy: (ev: DragEvent) => any; + onbeforecut: (ev: DragEvent) => any; + onbeforedeactivate: (ev: UIEvent) => any; + onbeforepaste: (ev: DragEvent) => any; + onblur: (ev: FocusEvent) => any; + oncanplay: (ev: Event) => any; + oncanplaythrough: (ev: Event) => any; + onchange: (ev: Event) => any; + onclick: (ev: MouseEvent) => any; + oncontextmenu: (ev: PointerEvent) => any; + oncopy: (ev: DragEvent) => any; + oncuechange: (ev: Event) => any; + oncut: (ev: DragEvent) => any; + ondblclick: (ev: MouseEvent) => any; + ondeactivate: (ev: UIEvent) => any; + ondrag: (ev: DragEvent) => any; + ondragend: (ev: DragEvent) => any; + ondragenter: (ev: DragEvent) => any; + ondragleave: (ev: DragEvent) => any; + ondragover: (ev: DragEvent) => any; + ondragstart: (ev: DragEvent) => any; + ondrop: (ev: DragEvent) => any; + ondurationchange: (ev: Event) => any; + onemptied: (ev: Event) => any; + onended: (ev: Event) => any; + onerror: (ev: Event) => any; + onfocus: (ev: FocusEvent) => any; + oninput: (ev: Event) => any; + onkeydown: (ev: KeyboardEvent) => any; + onkeypress: (ev: KeyboardEvent) => any; + onkeyup: (ev: KeyboardEvent) => any; + onload: (ev: Event) => any; + onloadeddata: (ev: Event) => any; + onloadedmetadata: (ev: Event) => any; + onloadstart: (ev: Event) => any; + onmousedown: (ev: MouseEvent) => any; + onmouseenter: (ev: MouseEvent) => any; + onmouseleave: (ev: MouseEvent) => any; + onmousemove: (ev: MouseEvent) => any; + onmouseout: (ev: MouseEvent) => any; + onmouseover: (ev: MouseEvent) => any; + onmouseup: (ev: MouseEvent) => any; + onmousewheel: (ev: MouseWheelEvent) => any; + onmscontentzoom: (ev: UIEvent) => any; + onmsmanipulationstatechanged: (ev: MSManipulationEvent) => any; + onpaste: (ev: DragEvent) => any; + onpause: (ev: Event) => any; + onplay: (ev: Event) => any; + onplaying: (ev: Event) => any; + onprogress: (ev: ProgressEvent) => any; + onratechange: (ev: Event) => any; + onreset: (ev: Event) => any; + onscroll: (ev: UIEvent) => any; + onseeked: (ev: Event) => any; + onseeking: (ev: Event) => any; + onselect: (ev: UIEvent) => any; + onselectstart: (ev: Event) => any; + onstalled: (ev: Event) => any; + onsubmit: (ev: Event) => any; + onsuspend: (ev: Event) => any; + ontimeupdate: (ev: Event) => any; + onvolumechange: (ev: Event) => any; + onwaiting: (ev: Event) => any; + outerHTML: string; + outerText: string; + spellcheck: boolean; + style: CSSStyleDeclaration; + tabIndex: number; + title: string; + blur(): void; + click(): void; + contains(child: HTMLElement): boolean; + dragDrop(): boolean; + focus(): void; + getElementsByClassName(classNames: string): NodeList; + insertAdjacentElement(position: string, insertedElement: Element): Element; + insertAdjacentHTML(where: string, html: string): void; + insertAdjacentText(where: string, text: string): void; + msGetInputContext(): MSInputMethodContext; + scrollIntoView(top?: boolean): void; + setActive(): void; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface MSScriptHost { -} -declare var MSScriptHost: { - prototype: MSScriptHost; - new(): MSScriptHost; +declare var HTMLElement: { + prototype: HTMLElement; + new(): HTMLElement; } -interface SVGClipPathElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - clipPathUnits: SVGAnimatedEnumeration; -} -declare var SVGClipPathElement: { - prototype: SVGClipPathElement; - new(): SVGClipPathElement; -} - -interface MouseEvent extends UIEvent { - toElement: Element; - layerY: number; - fromElement: Element; - which: number; - pageX: number; - offsetY: number; - x: number; - y: number; - metaKey: boolean; - altKey: boolean; - ctrlKey: boolean; - offsetX: number; - screenX: number; - clientY: number; - shiftKey: boolean; - layerX: number; - screenY: number; - relatedTarget: EventTarget; - button: number; - pageY: number; - buttons: number; - clientX: number; - initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget): void; - getModifierState(keyArg: string): boolean; -} -declare var MouseEvent: { - prototype: MouseEvent; - new(): MouseEvent; -} - -interface RangeException { - code: number; - message: string; - name: string; - toString(): string; - INVALID_NODE_TYPE_ERR: number; - BAD_BOUNDARYPOINTS_ERR: number; -} -declare var RangeException: { - prototype: RangeException; - new(): RangeException; - INVALID_NODE_TYPE_ERR: number; - BAD_BOUNDARYPOINTS_ERR: number; -} - -interface SVGTextPositioningElement extends SVGTextContentElement { - y: SVGAnimatedLengthList; - rotate: SVGAnimatedNumberList; - dy: SVGAnimatedLengthList; - x: SVGAnimatedLengthList; - dx: SVGAnimatedLengthList; -} -declare var SVGTextPositioningElement: { - prototype: SVGTextPositioningElement; - new(): SVGTextPositioningElement; -} - -interface HTMLAppletElement extends HTMLElement, DOML2DeprecatedMarginStyle, DOML2DeprecatedBorderStyle, DOML2DeprecatedAlignmentStyle, MSDataBindingExtensions, MSDataBindingRecordSetExtensions { - width: number; - /** - * Sets or retrieves the Internet media type for the code associated with the object. - */ - codeType: string; - object: string; - form: HTMLFormElement; - code: string; - /** - * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. - */ - archive: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves a message to be displayed while an object is loading. - */ - standby: string; - /** - * Sets or retrieves the class identifier for the object. - */ - classid: string; - /** - * Sets or retrieves the shape of the object. - */ - name: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Sets or retrieves the URL that references the data of the object. - */ - data: string; +interface HTMLEmbedElement extends HTMLElement, GetSVGDocument { /** * Sets or retrieves the height of the object. */ height: string; + hidden: any; /** - * Gets or sets the optional alternative HTML script to execute if the object fails to load. + * Gets or sets whether the DLNA PlayTo device is available. */ - altHtml: string; + msPlayToDisabled: boolean; /** - * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned. + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. */ - contentDocument: Document; + msPlayToPreferredSourceUri: string; /** - * Sets or retrieves the URL of the component. + * Gets or sets the primary DLNA PlayTo device. */ - codeBase: string; + msPlayToPrimary: boolean; /** - * Sets or retrieves a character string that can be used to implement your own declare functionality for the object. + * Gets the source associated with the media element for use by the PlayToManager. */ - declare: boolean; - /** - * Returns the content type of the object. - */ - type: string; - /** - * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. - */ - BaseHref: string; -} -declare var HTMLAppletElement: { - prototype: HTMLAppletElement; - new(): HTMLAppletElement; -} - -interface TextMetrics { - width: number; -} -declare var TextMetrics: { - prototype: TextMetrics; - new(): TextMetrics; -} - -interface DocumentEvent { - createEvent(eventInterface: "AnimationEvent"): AnimationEvent; - createEvent(eventInterface: "CloseEvent"): CloseEvent; - createEvent(eventInterface: "CompositionEvent"): CompositionEvent; - createEvent(eventInterface: "CustomEvent"): CustomEvent; - createEvent(eventInterface: "DeviceMotionEvent"): DeviceMotionEvent; - createEvent(eventInterface: "DeviceOrientationEvent"): DeviceOrientationEvent; - createEvent(eventInterface: "DragEvent"): DragEvent; - createEvent(eventInterface: "ErrorEvent"): ErrorEvent; - createEvent(eventInterface: "Event"): Event; - createEvent(eventInterface: "Events"): Event; - createEvent(eventInterface: "FocusEvent"): FocusEvent; - createEvent(eventInterface: "HTMLEvents"): Event; - createEvent(eventInterface: "IDBVersionChangeEvent"): IDBVersionChangeEvent; - createEvent(eventInterface: "KeyboardEvent"): KeyboardEvent; - createEvent(eventInterface: "LongRunningScriptDetectedEvent"): LongRunningScriptDetectedEvent; - createEvent(eventInterface: "MessageEvent"): MessageEvent; - createEvent(eventInterface: "MouseEvent"): MouseEvent; - createEvent(eventInterface: "MouseEvents"): MouseEvent; - createEvent(eventInterface: "MouseWheelEvent"): MouseWheelEvent; - createEvent(eventInterface: "MSGestureEvent"): MSGestureEvent; - createEvent(eventInterface: "MSPointerEvent"): MSPointerEvent; - createEvent(eventInterface: "MutationEvent"): MutationEvent; - createEvent(eventInterface: "MutationEvents"): MutationEvent; - createEvent(eventInterface: "NavigationCompletedEvent"): NavigationCompletedEvent; - createEvent(eventInterface: "NavigationEvent"): NavigationEvent; - createEvent(eventInterface: "PageTransitionEvent"): PageTransitionEvent; - createEvent(eventInterface: "PointerEvent"): MSPointerEvent; - createEvent(eventInterface: "PopStateEvent"): PopStateEvent; - createEvent(eventInterface: "ProgressEvent"): ProgressEvent; - createEvent(eventInterface: "StorageEvent"): StorageEvent; - createEvent(eventInterface: "SVGZoomEvents"): SVGZoomEvent; - createEvent(eventInterface: "TextEvent"): TextEvent; - createEvent(eventInterface: "TrackEvent"): TrackEvent; - createEvent(eventInterface: "TransitionEvent"): TransitionEvent; - createEvent(eventInterface: "UIEvent"): UIEvent; - createEvent(eventInterface: "UIEvents"): UIEvent; - createEvent(eventInterface: "UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent; - createEvent(eventInterface: "WebGLContextEvent"): WebGLContextEvent; - createEvent(eventInterface: "WheelEvent"): WheelEvent; - createEvent(eventInterface: string): Event; -} - -interface HTMLOListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { - /** - * The starting number. - */ - start: number; -} -declare var HTMLOListElement: { - prototype: HTMLOListElement; - new(): HTMLOListElement; -} - -interface SVGPathSegLinetoVerticalRel extends SVGPathSeg { - y: number; -} -declare var SVGPathSegLinetoVerticalRel: { - prototype: SVGPathSegLinetoVerticalRel; - new(): SVGPathSegLinetoVerticalRel; -} - -interface SVGAnimatedString { - animVal: string; - baseVal: string; -} -declare var SVGAnimatedString: { - prototype: SVGAnimatedString; - new(): SVGAnimatedString; -} - -interface CDATASection extends Text { -} -declare var CDATASection: { - prototype: CDATASection; - new(): CDATASection; -} - -interface StyleMedia { - type: string; - matchMedium(mediaquery: string): boolean; -} -declare var StyleMedia: { - prototype: StyleMedia; - new(): StyleMedia; -} - -interface HTMLSelectElement extends HTMLElement, MSHTMLCollectionExtensions, MSDataBindingExtensions { - options: HTMLSelectElement; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; + msPlayToSource: any; /** * Sets or retrieves the name of the object. */ name: string; /** - * Sets or retrieves the number of rows in the list box. + * Retrieves the palette used for the embedded document. */ - size: number; + palette: string; + /** + * Retrieves the URL of the plug-in used to view an embedded document. + */ + pluginspage: string; + readyState: string; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the height and width units of the embed object. + */ + units: string; + /** + * Sets or retrieves the width of the object. + */ + width: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLEmbedElement: { + prototype: HTMLEmbedElement; + new(): HTMLEmbedElement; +} + +interface HTMLFieldSetElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; +} + +declare var HTMLFieldSetElement: { + prototype: HTMLFieldSetElement; + new(): HTMLFieldSetElement; +} + +interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { + /** + * Sets or retrieves the current typeface family. + */ + face: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLFontElement: { + prototype: HTMLFontElement; + new(): HTMLFontElement; +} + +interface HTMLFormElement extends HTMLElement { + /** + * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form. + */ + acceptCharset: string; + /** + * Sets or retrieves the URL to which the form content is sent for processing. + */ + action: string; + /** + * Specifies whether autocomplete is applied to an editable text field. + */ + autocomplete: string; + /** + * Retrieves a collection, in source order, of all controls in a given form. + */ + elements: HTMLCollection; + /** + * Sets or retrieves the MIME encoding for the form. + */ + encoding: string; + /** + * Sets or retrieves the encoding type for the form. + */ + enctype: string; /** * Sets or retrieves the number of objects in a collection. */ length: number; /** - * Sets or retrieves the index of the selected option in a select object. + * Sets or retrieves how to send the form data to the server. */ - selectedIndex: number; + method: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Designates a form that is not validated when submitted. + */ + noValidate: boolean; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Retrieves a form object or an object from an elements collection. + * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. + * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. + */ + item(name?: any, index?: any): any; + /** + * Retrieves a form object or an object from an elements collection. + */ + namedItem(name: string): any; + /** + * Fires when the user resets a form. + */ + reset(): void; + /** + * Fires when a FORM is about to be submitted. + */ + submit(): void; + [name: string]: any; +} + +declare var HTMLFormElement: { + prototype: HTMLFormElement; + new(): HTMLFormElement; +} + +interface HTMLFrameElement extends HTMLElement, GetSVGDocument { + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Retrieves the document object of the page or frame. + */ + contentDocument: Document; + /** + * Retrieves the object of the specified. + */ + contentWindow: Window; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + /** + * Sets or retrieves the height of the object. + */ + height: string | number; + /** + * Sets or retrieves a URI to a long description of the object. + */ + longDesc: string; + /** + * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. + */ + marginHeight: string; + /** + * Sets or retrieves the left and right margin widths before displaying the text in a frame. + */ + marginWidth: string; + /** + * Sets or retrieves the frame name. + */ + name: string; + /** + * Sets or retrieves whether the user can resize the frame. + */ + noResize: boolean; + /** + * Raised when the object has been completely received from the server. + */ + onload: (ev: Event) => any; + /** + * Sets or retrieves whether the frame can be scrolled. + */ + scrolling: string; + /** + * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. + */ + security: any; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the width of the object. + */ + width: string | number; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLFrameElement: { + prototype: HTMLFrameElement; + new(): HTMLFrameElement; +} + +interface HTMLFrameSetElement extends HTMLElement { + border: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Sets or retrieves the frame widths of the object. + */ + cols: string; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + name: string; + onafterprint: (ev: Event) => any; + onbeforeprint: (ev: Event) => any; + onbeforeunload: (ev: BeforeUnloadEvent) => any; + /** + * Fires when the object loses the input focus. + */ + onblur: (ev: FocusEvent) => any; + onerror: (ev: Event) => any; + /** + * Fires when the object receives focus. + */ + onfocus: (ev: FocusEvent) => any; + onhashchange: (ev: HashChangeEvent) => any; + onload: (ev: Event) => any; + onmessage: (ev: MessageEvent) => any; + onoffline: (ev: Event) => any; + ononline: (ev: Event) => any; + onorientationchange: (ev: Event) => any; + onpagehide: (ev: PageTransitionEvent) => any; + onpageshow: (ev: PageTransitionEvent) => any; + onresize: (ev: UIEvent) => any; + onstorage: (ev: StorageEvent) => any; + onunload: (ev: Event) => any; + /** + * Sets or retrieves the frame heights of the object. + */ + rows: string; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLFrameSetElement: { + prototype: HTMLFrameSetElement; + new(): HTMLFrameSetElement; +} + +interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves whether the horizontal rule is drawn with 3-D shading. + */ + noShade: boolean; + /** + * Sets or retrieves the width of the object. + */ + width: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLHRElement: { + prototype: HTMLHRElement; + new(): HTMLHRElement; +} + +interface HTMLHeadElement extends HTMLElement { + profile: string; +} + +declare var HTMLHeadElement: { + prototype: HTMLHeadElement; + new(): HTMLHeadElement; +} + +interface HTMLHeadingElement extends HTMLElement { + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; + clear: string; +} + +declare var HTMLHeadingElement: { + prototype: HTMLHeadingElement; + new(): HTMLHeadingElement; +} + +interface HTMLHtmlElement extends HTMLElement { + /** + * Sets or retrieves the DTD version that governs the current document. + */ + version: string; +} + +declare var HTMLHtmlElement: { + prototype: HTMLHtmlElement; + new(): HTMLHtmlElement; +} + +interface HTMLIFrameElement extends HTMLElement, GetSVGDocument { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + allowFullscreen: boolean; + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Retrieves the document object of the page or frame. + */ + contentDocument: Document; + /** + * Retrieves the object of the specified. + */ + contentWindow: Window; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Sets or retrieves the horizontal margin for the object. + */ + hspace: number; + /** + * Sets or retrieves a URI to a long description of the object. + */ + longDesc: string; + /** + * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. + */ + marginHeight: string; + /** + * Sets or retrieves the left and right margin widths before displaying the text in a frame. + */ + marginWidth: string; + /** + * Sets or retrieves the frame name. + */ + name: string; + /** + * Sets or retrieves whether the user can resize the frame. + */ + noResize: boolean; + /** + * Raised when the object has been completely received from the server. + */ + onload: (ev: Event) => any; + sandbox: DOMSettableTokenList; + /** + * Sets or retrieves whether the frame can be scrolled. + */ + scrolling: string; + /** + * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. + */ + security: any; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: string; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLIFrameElement: { + prototype: HTMLIFrameElement; + new(): HTMLIFrameElement; +} + +interface HTMLImageElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Retrieves whether the object is fully loaded. + */ + complete: boolean; + crossOrigin: string; + currentSrc: string; + /** + * Sets or retrieves the height of the object. + */ + height: number; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + hspace: number; + /** + * Sets or retrieves whether the image is a server-side image map. + */ + isMap: boolean; + /** + * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object. + */ + longDesc: string; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * The original height of the image resource before sizing. + */ + naturalHeight: number; + /** + * The original width of the image resource before sizing. + */ + naturalWidth: number; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + srcset: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: number; + x: number; + y: number; + msGetAsCastingSource(): any; +} + +declare var HTMLImageElement: { + prototype: HTMLImageElement; + new(): HTMLImageElement; + create(): HTMLImageElement; +} + +interface HTMLInputElement extends HTMLElement { + /** + * Sets or retrieves a comma-separated list of content types. + */ + accept: string; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Specifies whether autocomplete is applied to an editable text field. + */ + autocomplete: string; + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + border: string; + /** + * Sets or retrieves the state of the check box or radio button. + */ + checked: boolean; + /** + * Retrieves whether the object is fully loaded. + */ + complete: boolean; + /** + * Sets or retrieves the state of the check box or radio button. + */ + defaultChecked: boolean; + /** + * Sets or retrieves the initial contents of the object. + */ + defaultValue: string; + disabled: boolean; + /** + * Returns a FileList object on a file type input object. + */ + files: FileList; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Overrides the action attribute (where the data on a form is sent) on the parent form element. + */ + formAction: string; + /** + * Used to override the encoding (formEnctype attribute) specified on the form element. + */ + formEnctype: string; + /** + * Overrides the submit method attribute previously specified on a form element. + */ + formMethod: string; + /** + * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. + */ + formNoValidate: string; + /** + * Overrides the target attribute on a form element. + */ + formTarget: string; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + hspace: number; + indeterminate: boolean; + /** + * Specifies the ID of a pre-defined datalist of options for an input element. + */ + list: HTMLElement; + /** + * Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field. + */ + max: string; + /** + * Sets or retrieves the maximum number of characters that the user can enter in a text control. + */ + maxLength: number; + /** + * Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field. + */ + min: string; /** * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. */ multiple: boolean; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Gets or sets a string containing a regular expression that the user's input must match. + */ + pattern: string; + /** + * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. + */ + placeholder: string; + readOnly: boolean; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + /** + * Gets or sets the end position or offset of a text selection. + */ + selectionEnd: number; + /** + * Gets or sets the starting position or offset of a text selection. + */ + selectionStart: number; + size: number; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + status: boolean; + /** + * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field. + */ + step: string; + /** + * Returns the content type of the object. + */ + type: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Returns the value of the data at the cursor's current position. + */ + value: string; + valueAsDate: Date; + /** + * Returns the input field value as a number. + */ + valueAsNumber: number; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Creates a TextRange object for the element. + */ + createTextRange(): TextRange; + /** + * Makes the selection equal to the current object. + */ + select(): void; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + /** + * Sets the start and end positions of a selection in a text field. + * @param start The offset into the text field for the start of the selection. + * @param end The offset into the text field for the end of the selection. + */ + setSelectionRange(start: number, end: number): void; + /** + * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. + * @param n Value to decrement the value by. + */ + stepDown(n?: number): void; + /** + * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value. + * @param n Value to increment the value by. + */ + stepUp(n?: number): void; +} + +declare var HTMLInputElement: { + prototype: HTMLInputElement; + new(): HTMLInputElement; +} + +interface HTMLIsIndexElement extends HTMLElement { + /** + * Sets or retrieves the URL to which the form content is sent for processing. + */ + action: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + prompt: string; +} + +declare var HTMLIsIndexElement: { + prototype: HTMLIsIndexElement; + new(): HTMLIsIndexElement; +} + +interface HTMLLIElement extends HTMLElement { + type: string; + /** + * Sets or retrieves the value of a list item. + */ + value: number; +} + +declare var HTMLLIElement: { + prototype: HTMLLIElement; + new(): HTMLLIElement; +} + +interface HTMLLabelElement extends HTMLElement { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the object to which the given label object is assigned. + */ + htmlFor: string; +} + +declare var HTMLLabelElement: { + prototype: HTMLLabelElement; + new(): HTMLLabelElement; +} + +interface HTMLLegendElement extends HTMLElement { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + align: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; +} + +declare var HTMLLegendElement: { + prototype: HTMLLegendElement; + new(): HTMLLegendElement; +} + +interface HTMLLinkElement extends HTMLElement, LinkStyle { + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + disabled: boolean; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or retrieves the language code of the object. + */ + hreflang: string; + /** + * Sets or retrieves the media type. + */ + media: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rel: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rev: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Sets or retrieves the MIME type of the object. + */ + type: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLLinkElement: { + prototype: HTMLLinkElement; + new(): HTMLLinkElement; +} + +interface HTMLMapElement extends HTMLElement { + /** + * Retrieves a collection of the area objects defined for the given map object. + */ + areas: HTMLAreasCollection; + /** + * Sets or retrieves the name of the object. + */ + name: string; +} + +declare var HTMLMapElement: { + prototype: HTMLMapElement; + new(): HTMLMapElement; +} + +interface HTMLMarqueeElement extends HTMLElement { + behavior: string; + bgColor: any; + direction: string; + height: string; + hspace: number; + loop: number; + onbounce: (ev: Event) => any; + onfinish: (ev: Event) => any; + onstart: (ev: Event) => any; + scrollAmount: number; + scrollDelay: number; + trueSpeed: boolean; + vspace: number; + width: string; + start(): void; + stop(): void; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "bounce", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "finish", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "start", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMarqueeElement: { + prototype: HTMLMarqueeElement; + new(): HTMLMarqueeElement; +} + +interface HTMLMediaElement extends HTMLElement { + /** + * Returns an AudioTrackList object with the audio tracks for a given video element. + */ + audioTracks: AudioTrackList; + /** + * Gets or sets a value that indicates whether to start playing the media automatically. + */ + autoplay: boolean; + /** + * Gets a collection of buffered time ranges. + */ + buffered: TimeRanges; + /** + * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player). + */ + controls: boolean; + /** + * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement. + */ + currentSrc: string; + /** + * Gets or sets the current playback position, in seconds. + */ + currentTime: number; + defaultMuted: boolean; + /** + * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource. + */ + defaultPlaybackRate: number; + /** + * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming. + */ + duration: number; + /** + * Gets information about whether the playback has ended or not. + */ + ended: boolean; + /** + * Returns an object representing the current error state of the audio or video element. + */ + error: MediaError; + /** + * Gets or sets a flag to specify whether playback should restart after it completes. + */ + loop: boolean; + /** + * Specifies the purpose of the audio or video media, such as background audio or alerts. + */ + msAudioCategory: string; + /** + * Specifies the output device id that the audio will be sent to. + */ + msAudioDeviceType: string; + msGraphicsTrustStatus: MSGraphicsTrust; + /** + * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element. + */ + msKeys: MSMediaKeys; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; + /** + * Specifies whether or not to enable low-latency playback on the media element. + */ + msRealTime: boolean; + /** + * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted. + */ + muted: boolean; + /** + * Gets the current network activity for the element. + */ + networkState: number; + onmsneedkey: (ev: MSMediaKeyNeededEvent) => any; + /** + * Gets a flag that specifies whether playback is paused. + */ + paused: boolean; + /** + * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource. + */ + playbackRate: number; + /** + * Gets TimeRanges for the current media resource that has been played. + */ + played: TimeRanges; + /** + * Gets or sets the current playback position, in seconds. + */ + preload: string; + readyState: any; + /** + * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. + */ + seekable: TimeRanges; + /** + * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource. + */ + seeking: boolean; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + textTracks: TextTrackList; + videoTracks: VideoTrackList; + /** + * Gets or sets the volume level for audio portions of the media element. + */ + volume: number; + addTextTrack(kind: string, label?: string, language?: string): TextTrack; + /** + * Returns a string that specifies whether the client can play a given media resource type. + */ + canPlayType(type: string): string; + /** + * Fires immediately after the client loads the object. + */ + load(): void; + /** + * Clears all effects from the media pipeline. + */ + msClearEffects(): void; + msGetAsCastingSource(): any; + /** + * Inserts the specified audio effect into media pipeline. + */ + msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; + msSetMediaKeys(mediaKeys: MSMediaKeys): void; + /** + * Specifies the media protection manager for a given media pipeline. + */ + msSetMediaProtectionManager(mediaProtectionManager?: any): void; + /** + * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not. + */ + pause(): void; + /** + * Loads and starts playback of a media resource. + */ + play(): void; + HAVE_CURRENT_DATA: number; + HAVE_ENOUGH_DATA: number; + HAVE_FUTURE_DATA: number; + HAVE_METADATA: number; + HAVE_NOTHING: number; + NETWORK_EMPTY: number; + NETWORK_IDLE: number; + NETWORK_LOADING: number; + NETWORK_NO_SOURCE: number; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMediaElement: { + prototype: HTMLMediaElement; + new(): HTMLMediaElement; + HAVE_CURRENT_DATA: number; + HAVE_ENOUGH_DATA: number; + HAVE_FUTURE_DATA: number; + HAVE_METADATA: number; + HAVE_NOTHING: number; + NETWORK_EMPTY: number; + NETWORK_IDLE: number; + NETWORK_LOADING: number; + NETWORK_NO_SOURCE: number; +} + +interface HTMLMenuElement extends HTMLElement { + compact: boolean; + type: string; +} + +declare var HTMLMenuElement: { + prototype: HTMLMenuElement; + new(): HTMLMenuElement; +} + +interface HTMLMetaElement extends HTMLElement { + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Gets or sets meta-information to associate with httpEquiv or name. + */ + content: string; + /** + * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header. + */ + httpEquiv: string; + /** + * Sets or retrieves the value specified in the content attribute of the meta object. + */ + name: string; + /** + * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object. + */ + scheme: string; + /** + * Sets or retrieves the URL property that will be loaded after the specified time has elapsed. + */ + url: string; +} + +declare var HTMLMetaElement: { + prototype: HTMLMetaElement; + new(): HTMLMetaElement; +} + +interface HTMLModElement extends HTMLElement { + /** + * Sets or retrieves reference information about the object. + */ + cite: string; + /** + * Sets or retrieves the date and time of a modification to the object. + */ + dateTime: string; +} + +declare var HTMLModElement: { + prototype: HTMLModElement; + new(): HTMLModElement; +} + +interface HTMLNextIdElement extends HTMLElement { + n: string; +} + +declare var HTMLNextIdElement: { + prototype: HTMLNextIdElement; + new(): HTMLNextIdElement; +} + +interface HTMLOListElement extends HTMLElement { + compact: boolean; + /** + * The starting number. + */ + start: number; + type: string; +} + +declare var HTMLOListElement: { + prototype: HTMLOListElement; + new(): HTMLOListElement; +} + +interface HTMLObjectElement extends HTMLElement, GetSVGDocument { + /** + * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. + */ + BaseHref: string; + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Gets or sets the optional alternative HTML script to execute if the object fails to load. + */ + altHtml: string; + /** + * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. + */ + archive: string; + border: string; + /** + * Sets or retrieves the URL of the file containing the compiled Java class. + */ + code: string; + /** + * Sets or retrieves the URL of the component. + */ + codeBase: string; + /** + * Sets or retrieves the Internet media type for the code associated with the object. + */ + codeType: string; + /** + * Retrieves the document object of the page or frame. + */ + contentDocument: Document; + /** + * Sets or retrieves the URL that references the data of the object. + */ + data: string; + declare: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the height of the object. + */ + height: string; + hspace: number; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Retrieves the contained object. + */ + object: any; + readyState: number; + /** + * Sets or retrieves a message to be displayed while an object is loading. + */ + standby: string; + /** + * Sets or retrieves the MIME type of the object. + */ + type: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLObjectElement: { + prototype: HTMLObjectElement; + new(): HTMLObjectElement; +} + +interface HTMLOptGroupElement extends HTMLElement { + /** + * Sets or retrieves the status of an option. + */ + defaultSelected: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the ordinal position of an option in a list box. + */ + index: number; + /** + * Sets or retrieves a value that you can use to implement your own label functionality for the object. + */ + label: string; + /** + * Sets or retrieves whether the option in the list box is the default item. + */ + selected: boolean; + /** + * Sets or retrieves the text string specified by the option tag. + */ + text: string; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; +} + +declare var HTMLOptGroupElement: { + prototype: HTMLOptGroupElement; + new(): HTMLOptGroupElement; +} + +interface HTMLOptionElement extends HTMLElement { + /** + * Sets or retrieves the status of an option. + */ + defaultSelected: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the ordinal position of an option in a list box. + */ + index: number; + /** + * Sets or retrieves a value that you can use to implement your own label functionality for the object. + */ + label: string; + /** + * Sets or retrieves whether the option in the list box is the default item. + */ + selected: boolean; + /** + * Sets or retrieves the text string specified by the option tag. + */ + text: string; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; +} + +declare var HTMLOptionElement: { + prototype: HTMLOptionElement; + new(): HTMLOptionElement; + create(): HTMLOptionElement; +} + +interface HTMLParagraphElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + clear: string; +} + +declare var HTMLParagraphElement: { + prototype: HTMLParagraphElement; + new(): HTMLParagraphElement; +} + +interface HTMLParamElement extends HTMLElement { + /** + * Sets or retrieves the name of an input parameter for an element. + */ + name: string; + /** + * Sets or retrieves the content type of the resource designated by the value attribute. + */ + type: string; + /** + * Sets or retrieves the value of an input parameter for an element. + */ + value: string; + /** + * Sets or retrieves the data type of the value attribute. + */ + valueType: string; +} + +declare var HTMLParamElement: { + prototype: HTMLParamElement; + new(): HTMLParamElement; +} + +interface HTMLPhraseElement extends HTMLElement { + /** + * Sets or retrieves reference information about the object. + */ + cite: string; + /** + * Sets or retrieves the date and time of a modification to the object. + */ + dateTime: string; +} + +declare var HTMLPhraseElement: { + prototype: HTMLPhraseElement; + new(): HTMLPhraseElement; +} + +interface HTMLPreElement extends HTMLElement { + /** + * Indicates a citation by rendering text in italic type. + */ + cite: string; + clear: string; + /** + * Sets or gets a value that you can use to implement your own width functionality for the object. + */ + width: number; +} + +declare var HTMLPreElement: { + prototype: HTMLPreElement; + new(): HTMLPreElement; +} + +interface HTMLProgressElement extends HTMLElement { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Defines the maximum, or "done" value for a progress element. + */ + max: number; + /** + * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar). + */ + position: number; + /** + * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value. + */ + value: number; +} + +declare var HTMLProgressElement: { + prototype: HTMLProgressElement; + new(): HTMLProgressElement; +} + +interface HTMLQuoteElement extends HTMLElement { + /** + * Sets or retrieves reference information about the object. + */ + cite: string; + /** + * Sets or retrieves the date and time of a modification to the object. + */ + dateTime: string; +} + +declare var HTMLQuoteElement: { + prototype: HTMLQuoteElement; + new(): HTMLQuoteElement; +} + +interface HTMLScriptElement extends HTMLElement { + async: boolean; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Sets or retrieves the status of the script. + */ + defer: boolean; + /** + * Sets or retrieves the event for which the script is written. + */ + event: string; + /** + * Sets or retrieves the object that is bound to the event script. + */ + htmlFor: string; + /** + * Retrieves the URL to an external file that contains the source code or data. + */ + src: string; + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; + /** + * Sets or retrieves the MIME type for the associated scripting engine. + */ + type: string; +} + +declare var HTMLScriptElement: { + prototype: HTMLScriptElement; + new(): HTMLScriptElement; +} + +interface HTMLSelectElement extends HTMLElement { + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the number of objects in a collection. + */ + length: number; + /** + * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. + */ + multiple: boolean; + /** + * Sets or retrieves the name of the object. + */ + name: string; + options: HTMLSelectElement; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + /** + * Sets or retrieves the index of the selected option in a select object. + */ + selectedIndex: number; + /** + * Sets or retrieves the number of rows in the list box. + */ + size: number; /** * Retrieves the type of select control based on the value of the MULTIPLE attribute. */ @@ -8214,33 +11103,29 @@ interface HTMLSelectElement extends HTMLElement, MSHTMLCollectionExtensions, MSD * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. */ validationMessage: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; /** * Returns a ValidityState object that represents the validity states of an element. */ validity: ValidityState; /** - * When present, marks an element that can't be submitted without a value. + * Sets or retrieves the value which is returned to the server when the form control is submitted. */ - required: boolean; + value: string; /** * Returns whether an element will successfully validate based on forms validation rules and constraints. */ willValidate: boolean; - /** - * Removes an element from the collection. - * @param index Number that specifies the zero-based index of the element to remove from the collection. - */ - remove(index?: number): void; /** * Adds an element to the areas, controlRange, or options collection. * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection. * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection. */ - add(element: HTMLElement, before?: any): void; + add(element: HTMLElement, before?: HTMLElement): void; + add(element: HTMLElement, before?: number): void; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; /** * Retrieves a select object or an object from an options collection. * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. @@ -8252,373 +11137,68 @@ interface HTMLSelectElement extends HTMLElement, MSHTMLCollectionExtensions, MSD * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made. */ namedItem(name: string): any; - [name: string]: any; /** - * Returns whether a form will validate when it is submitted, without having to submit it. + * Removes an element from the collection. + * @param index Number that specifies the zero-based index of the element to remove from the collection. */ - checkValidity(): boolean; + remove(index?: number): void; /** * Sets a custom error message that is displayed when a form is submitted. * @param error Sets a custom error message that is displayed when a form is submitted. */ setCustomValidity(error: string): void; + [name: string]: any; } + declare var HTMLSelectElement: { prototype: HTMLSelectElement; new(): HTMLSelectElement; } -interface TextRange { - boundingLeft: number; - htmlText: string; - offsetLeft: number; - boundingWidth: number; - boundingHeight: number; - boundingTop: number; - text: string; - offsetTop: number; - moveToPoint(x: number, y: number): void; - queryCommandValue(cmdID: string): any; - getBookmark(): string; - move(unit: string, count?: number): number; - queryCommandIndeterm(cmdID: string): boolean; - scrollIntoView(fStart?: boolean): void; - findText(string: string, count?: number, flags?: number): boolean; - execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; - getBoundingClientRect(): ClientRect; - moveToBookmark(bookmark: string): boolean; - isEqual(range: TextRange): boolean; - duplicate(): TextRange; - collapse(start?: boolean): void; - queryCommandText(cmdID: string): string; - select(): void; - pasteHTML(html: string): void; - inRange(range: TextRange): boolean; - moveEnd(unit: string, count?: number): number; - getClientRects(): ClientRectList; - moveStart(unit: string, count?: number): number; - parentElement(): Element; - queryCommandState(cmdID: string): boolean; - compareEndPoints(how: string, sourceRange: TextRange): number; - execCommandShowHelp(cmdID: string): boolean; - moveToElementText(element: Element): void; - expand(Unit: string): boolean; - queryCommandSupported(cmdID: string): boolean; - setEndPoint(how: string, SourceRange: TextRange): void; - queryCommandEnabled(cmdID: string): boolean; -} -declare var TextRange: { - prototype: TextRange; - new(): TextRange; -} - -interface SVGTests { - requiredFeatures: SVGStringList; - requiredExtensions: SVGStringList; - systemLanguage: SVGStringList; - hasExtension(extension: string): boolean; -} - -interface HTMLBlockElement extends HTMLElement, DOML2DeprecatedTextFlowControl { +interface HTMLSourceElement extends HTMLElement { /** - * Sets or retrieves the width of the object. - */ - width: number; + * Gets or sets the intended media type of the media source. + */ + media: string; + msKeySystem: string; /** - * Sets or retrieves reference information about the object. + * The address or URL of the a media resource that is to be considered. */ - cite: string; -} -declare var HTMLBlockElement: { - prototype: HTMLBlockElement; - new(): HTMLBlockElement; -} - -interface CSSStyleSheet extends StyleSheet { - owningElement: Element; - imports: StyleSheetList; - isAlternate: boolean; - rules: MSCSSRuleList; - isPrefAlternate: boolean; - readOnly: boolean; - cssText: string; - ownerRule: CSSRule; - href: string; - cssRules: CSSRuleList; - id: string; - pages: StyleSheetPageList; - addImport(bstrURL: string, lIndex?: number): number; - addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; - insertRule(rule: string, index?: number): number; - removeRule(lIndex: number): void; - deleteRule(index?: number): void; - addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number; - removeImport(lIndex: number): void; -} -declare var CSSStyleSheet: { - prototype: CSSStyleSheet; - new(): CSSStyleSheet; -} - -interface MSSelection { - type: string; - typeDetail: string; - createRange(): TextRange; - clear(): void; - createRangeCollection(): TextRangeCollection; - empty(): void; -} -declare var MSSelection: { - prototype: MSSelection; - new(): MSSelection; -} - -interface HTMLMetaElement extends HTMLElement { + src: string; /** - * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header. - */ - httpEquiv: string; - /** - * Sets or retrieves the value specified in the content attribute of the meta object. - */ - name: string; - /** - * Gets or sets meta-information to associate with httpEquiv or name. - */ - content: string; - /** - * Sets or retrieves the URL property that will be loaded after the specified time has elapsed. - */ - url: string; - /** - * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object. - */ - scheme: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; -} -declare var HTMLMetaElement: { - prototype: HTMLMetaElement; - new(): HTMLMetaElement; -} - -interface SVGPatternElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGTests, SVGFitToViewBox, SVGExternalResourcesRequired, SVGURIReference { - patternUnits: SVGAnimatedEnumeration; - y: SVGAnimatedLength; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - patternContentUnits: SVGAnimatedEnumeration; - patternTransform: SVGAnimatedTransformList; - height: SVGAnimatedLength; -} -declare var SVGPatternElement: { - prototype: SVGPatternElement; - new(): SVGPatternElement; -} - -interface SVGAnimatedAngle { - animVal: SVGAngle; - baseVal: SVGAngle; -} -declare var SVGAnimatedAngle: { - prototype: SVGAnimatedAngle; - new(): SVGAnimatedAngle; -} - -interface Selection { - isCollapsed: boolean; - anchorNode: Node; - focusNode: Node; - anchorOffset: number; - focusOffset: number; - rangeCount: number; - addRange(range: Range): void; - collapseToEnd(): void; - toString(): string; - selectAllChildren(parentNode: Node): void; - getRangeAt(index: number): Range; - collapse(parentNode: Node, offset: number): void; - removeAllRanges(): void; - collapseToStart(): void; - deleteFromDocument(): void; - removeRange(range: Range): void; -} -declare var Selection: { - prototype: Selection; - new(): Selection; -} - -interface SVGScriptElement extends SVGElement, SVGExternalResourcesRequired, SVGURIReference { + * Gets or sets the MIME type of a media resource. + */ type: string; } -declare var SVGScriptElement: { - prototype: SVGScriptElement; - new(): SVGScriptElement; + +declare var HTMLSourceElement: { + prototype: HTMLSourceElement; + new(): HTMLSourceElement; } -interface HTMLDDElement extends HTMLElement { - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} -declare var HTMLDDElement: { - prototype: HTMLDDElement; - new(): HTMLDDElement; +interface HTMLSpanElement extends HTMLElement { } -interface MSDataBindingRecordSetReadonlyExtensions { - recordset: any; - namedRecordset(dataMember: string, hierarchy?: any): any; +declare var HTMLSpanElement: { + prototype: HTMLSpanElement; + new(): HTMLSpanElement; } -interface CSSStyleRule extends CSSRule { - selectorText: string; - style: MSStyleCSSProperties; - readOnly: boolean; -} -declare var CSSStyleRule: { - prototype: CSSStyleRule; - new(): CSSStyleRule; -} - -interface NodeIterator { - whatToShow: number; - filter: NodeFilter; - root: Node; - expandEntityReferences: boolean; - nextNode(): Node; - detach(): void; - previousNode(): Node; -} -declare var NodeIterator: { - prototype: NodeIterator; - new(): NodeIterator; -} - -interface SVGViewElement extends SVGElement, SVGZoomAndPan, SVGFitToViewBox, SVGExternalResourcesRequired { - viewTarget: SVGStringList; -} -declare var SVGViewElement: { - prototype: SVGViewElement; - new(): SVGViewElement; -} - -interface HTMLLinkElement extends HTMLElement, LinkStyle { - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rel: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; +interface HTMLStyleElement extends HTMLElement, LinkStyle { /** * Sets or retrieves the media type. */ media: string; /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rev: string; - /** - * Sets or retrieves the MIME type of the object. + * Retrieves the CSS language in which the style sheet is written. */ type: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the language code of the object. - */ - hreflang: string; -} -declare var HTMLLinkElement: { - prototype: HTMLLinkElement; - new(): HTMLLinkElement; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface SVGLocatable { - farthestViewportElement: SVGElement; - nearestViewportElement: SVGElement; - getBBox(): SVGRect; - getTransformToElement(element: SVGElement): SVGMatrix; - getCTM(): SVGMatrix; - getScreenCTM(): SVGMatrix; -} - -interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { - /** - * Sets or retrieves the current typeface family. - */ - face: string; -} -declare var HTMLFontElement: { - prototype: HTMLFontElement; - new(): HTMLFontElement; -} - -interface SVGTitleElement extends SVGElement, SVGStylable, SVGLangSpace { -} -declare var SVGTitleElement: { - prototype: SVGTitleElement; - new(): SVGTitleElement; -} - -interface ControlRangeCollection { - length: number; - queryCommandValue(cmdID: string): any; - remove(index: number): void; - add(item: Element): void; - queryCommandIndeterm(cmdID: string): boolean; - scrollIntoView(varargStart?: any): void; - item(index: number): Element; - [index: number]: Element; - execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; - addElement(item: Element): void; - queryCommandState(cmdID: string): boolean; - queryCommandSupported(cmdID: string): boolean; - queryCommandEnabled(cmdID: string): boolean; - queryCommandText(cmdID: string): string; - select(): void; -} -declare var ControlRangeCollection: { - prototype: ControlRangeCollection; - new(): ControlRangeCollection; -} - -interface MSNamespaceInfo extends MSEventAttachmentTarget { - urn: string; - onreadystatechange: (ev: Event) => any; - name: string; - readyState: string; - doImport(implementationUrl: string): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var MSNamespaceInfo: { - prototype: MSNamespaceInfo; - new(): MSNamespaceInfo; -} - -interface WindowSessionStorage { - sessionStorage: Storage; -} - -interface SVGAnimatedTransformList { - animVal: SVGTransformList; - baseVal: SVGTransformList; -} -declare var SVGAnimatedTransformList: { - prototype: SVGAnimatedTransformList; - new(): SVGAnimatedTransformList; +declare var HTMLStyleElement: { + prototype: HTMLStyleElement; + new(): HTMLStyleElement; } interface HTMLTableCaptionElement extends HTMLElement { @@ -8631,637 +11211,240 @@ interface HTMLTableCaptionElement extends HTMLElement { */ vAlign: string; } + declare var HTMLTableCaptionElement: { prototype: HTMLTableCaptionElement; new(): HTMLTableCaptionElement; } -interface HTMLOptionElement extends HTMLElement, MSDataBindingExtensions { +interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment { /** - * Sets or retrieves the ordinal position of an option in a list box. + * Sets or retrieves abbreviated text for the object. */ - index: number; - /** - * Sets or retrieves the status of an option. - */ - defaultSelected: boolean; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - /** - * Sets or retrieves the text string specified by the option tag. - */ - text: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves a value that you can use to implement your own label functionality for the object. - */ - label: string; - /** - * Sets or retrieves whether the option in the list box is the default item. - */ - selected: boolean; -} -declare var HTMLOptionElement: { - prototype: HTMLOptionElement; - new(): HTMLOptionElement; - create(): HTMLOptionElement; -} - -interface HTMLMapElement extends HTMLElement { - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Retrieves a collection of the area objects defined for the given map object. - */ - areas: HTMLAreasCollection; -} -declare var HTMLMapElement: { - prototype: HTMLMapElement; - new(): HTMLMapElement; -} - -interface HTMLMenuElement extends HTMLElement, DOML2DeprecatedListSpaceReduction { - type: string; -} -declare var HTMLMenuElement: { - prototype: HTMLMenuElement; - new(): HTMLMenuElement; -} - -interface MouseWheelEvent extends MouseEvent { - wheelDelta: number; - initMouseWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, wheelDeltaArg: number): void; -} -declare var MouseWheelEvent: { - prototype: MouseWheelEvent; - new(): MouseWheelEvent; -} - -interface SVGFitToViewBox { - viewBox: SVGAnimatedRect; - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; -} - -interface SVGPointList { - numberOfItems: number; - replaceItem(newItem: SVGPoint, index: number): SVGPoint; - getItem(index: number): SVGPoint; - clear(): void; - appendItem(newItem: SVGPoint): SVGPoint; - initialize(newItem: SVGPoint): SVGPoint; - removeItem(index: number): SVGPoint; - insertItemBefore(newItem: SVGPoint, index: number): SVGPoint; -} -declare var SVGPointList: { - prototype: SVGPointList; - new(): SVGPointList; -} - -interface SVGAnimatedLengthList { - animVal: SVGLengthList; - baseVal: SVGLengthList; -} -declare var SVGAnimatedLengthList: { - prototype: SVGAnimatedLengthList; - new(): SVGAnimatedLengthList; -} - -interface SVGAnimatedPreserveAspectRatio { - animVal: SVGPreserveAspectRatio; - baseVal: SVGPreserveAspectRatio; -} -declare var SVGAnimatedPreserveAspectRatio: { - prototype: SVGAnimatedPreserveAspectRatio; - new(): SVGAnimatedPreserveAspectRatio; -} - -interface MSSiteModeEvent extends Event { - buttonID: number; - actionURL: string; -} -declare var MSSiteModeEvent: { - prototype: MSSiteModeEvent; - new(): MSSiteModeEvent; -} - -interface DOML2DeprecatedTextFlowControl { - clear: string; -} - -interface StyleSheetPageList { - length: number; - item(index: number): CSSPageRule; - [index: number]: CSSPageRule; -} -declare var StyleSheetPageList: { - prototype: StyleSheetPageList; - new(): StyleSheetPageList; -} - -interface MSCSSProperties extends CSSStyleDeclaration { - scrollbarShadowColor: string; - scrollbarHighlightColor: string; - layoutGridChar: string; - layoutGridType: string; - textAutospace: string; - textKashidaSpace: string; - writingMode: string; - scrollbarFaceColor: string; - backgroundPositionY: string; - lineBreak: string; - imeMode: string; - msBlockProgression: string; - layoutGridLine: string; - scrollbarBaseColor: string; - layoutGrid: string; - layoutFlow: string; - textKashida: string; - filter: string; - zoom: string; - scrollbarArrowColor: string; - behavior: string; - backgroundPositionX: string; - accelerator: string; - layoutGridMode: string; - textJustifyTrim: string; - scrollbar3dLightColor: string; - msInterpolationMode: string; - scrollbarTrackColor: string; - scrollbarDarkShadowColor: string; - styleFloat: string; - getAttribute(attributeName: string, flags?: number): any; - setAttribute(attributeName: string, AttributeValue: any, flags?: number): void; - removeAttribute(attributeName: string, flags?: number): boolean; -} -declare var MSCSSProperties: { - prototype: MSCSSProperties; - new(): MSCSSProperties; -} - -interface SVGExternalResourcesRequired { - externalResourcesRequired: SVGAnimatedBoolean; -} - -interface HTMLImageElement extends HTMLElement, MSImageResourceExtensions, MSDataBindingExtensions, MSResourceMetadata { - /** - * Sets or retrieves the width of the object. - */ - width: number; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * The original height of the image resource before sizing. - */ - naturalHeight: number; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; + abbr: string; /** * Sets or retrieves how the object is aligned with adjacent text. */ align: string; /** - * The address or URL of the a media resource that is to be considered. + * Sets or retrieves a comma-delimited list of conceptual categories associated with the object. */ - src: string; + axis: string; + bgColor: any; /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + * Retrieves the position of the object in the cells collection of a row. */ - useMap: string; + cellIndex: number; /** - * The original width of the image resource before sizing. + * Sets or retrieves the number columns in the table that the object should span. */ - naturalWidth: number; + colSpan: number; /** - * Sets or retrieves the name of the object. + * Sets or retrieves a list of header cells that provide information for the object. */ - name: string; - /** - * Sets or retrieves the height of the object. - */ - height: number; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - hspace: number; - /** - * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object. - */ - longDesc: string; - /** - * Contains the hypertext reference (HREF) of the URL. - */ - href: string; - /** - * Sets or retrieves whether the image is a server-side image map. - */ - isMap: boolean; - /** - * Retrieves whether the object is fully loaded. - */ - complete: boolean; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; - crossOrigin: string; - msPlayToPreferredSourceUri: string; -} -declare var HTMLImageElement: { - prototype: HTMLImageElement; - new(): HTMLImageElement; - create(): HTMLImageElement; -} - -interface HTMLAreaElement extends HTMLElement { - /** - * Sets or retrieves the protocol portion of a URL. - */ - protocol: string; - /** - * Sets or retrieves the substring of the href property that follows the question mark. - */ - search: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves the coordinates of the object. - */ - coords: string; - /** - * Sets or retrieves the host name part of the location or URL. - */ - hostname: string; - /** - * Sets or retrieves the port number associated with a URL. - */ - port: string; - /** - * Sets or retrieves the file name or path specified by the object. - */ - pathname: string; - /** - * Sets or retrieves the hostname and port number of the location or URL. - */ - host: string; - /** - * Sets or retrieves the subsection of the href property that follows the number sign (#). - */ - hash: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or gets whether clicks in this region cause action. - */ - noHref: boolean; - /** - * Sets or retrieves the shape of the object. - */ - shape: string; - /** - * Returns a string representation of an object. - */ - toString(): string; -} -declare var HTMLAreaElement: { - prototype: HTMLAreaElement; - new(): HTMLAreaElement; -} - -interface EventTarget { - removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; - dispatchEvent(evt: Event): boolean; -} - -interface SVGAngle { - valueAsString: string; - valueInSpecifiedUnits: number; - value: number; - unitType: number; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - convertToSpecifiedUnits(unitType: number): void; - SVG_ANGLETYPE_RAD: number; - SVG_ANGLETYPE_UNKNOWN: number; - SVG_ANGLETYPE_UNSPECIFIED: number; - SVG_ANGLETYPE_DEG: number; - SVG_ANGLETYPE_GRAD: number; -} -declare var SVGAngle: { - prototype: SVGAngle; - new(): SVGAngle; - SVG_ANGLETYPE_RAD: number; - SVG_ANGLETYPE_UNKNOWN: number; - SVG_ANGLETYPE_UNSPECIFIED: number; - SVG_ANGLETYPE_DEG: number; - SVG_ANGLETYPE_GRAD: number; -} - -interface HTMLButtonElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the default or selected value of the control. - */ - value: string; - status: any; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Gets the classification and default behavior of the button. - */ - type: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Overrides the target attribute on a form element. - */ - formTarget: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Overrides the action attribute (where the data on a form is sent) on the parent form element. - */ - formAction: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. - */ - formNoValidate: string; - /** - * Used to override the encoding (formEnctype attribute) specified on the form element. - */ - formEnctype: string; - /** - * Overrides the submit method attribute previously specified on a form element. - */ - formMethod: string; - /** - * Creates a TextRange object for the element. - */ - createTextRange(): TextRange; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLButtonElement: { - prototype: HTMLButtonElement; - new(): HTMLButtonElement; -} - -interface HTMLSourceElement extends HTMLElement { - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - /** - * Gets or sets the intended media type of the media source. - */ - media: string; - /** - * Gets or sets the MIME type of a media resource. - */ - type: string; - msKeySystem: string; -} -declare var HTMLSourceElement: { - prototype: HTMLSourceElement; - new(): HTMLSourceElement; -} - -interface CanvasGradient { - addColorStop(offset: number, color: string): void; -} -declare var CanvasGradient: { - prototype: CanvasGradient; - new(): CanvasGradient; -} - -interface KeyboardEvent extends UIEvent { - location: number; - keyCode: number; - shiftKey: boolean; - which: number; - locale: string; - key: string; - altKey: boolean; - metaKey: boolean; - char: string; - ctrlKey: boolean; - repeat: boolean; - charCode: number; - getModifierState(keyArg: string): boolean; - initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; - DOM_KEY_LOCATION_RIGHT: number; - DOM_KEY_LOCATION_STANDARD: number; - DOM_KEY_LOCATION_LEFT: number; - DOM_KEY_LOCATION_NUMPAD: number; - DOM_KEY_LOCATION_JOYSTICK: number; - DOM_KEY_LOCATION_MOBILE: number; -} -declare var KeyboardEvent: { - prototype: KeyboardEvent; - new(): KeyboardEvent; - DOM_KEY_LOCATION_RIGHT: number; - DOM_KEY_LOCATION_STANDARD: number; - DOM_KEY_LOCATION_LEFT: number; - DOM_KEY_LOCATION_NUMPAD: number; - DOM_KEY_LOCATION_JOYSTICK: number; - DOM_KEY_LOCATION_MOBILE: number; -} - -interface MessageEvent extends Event { - source: Window; - origin: string; - data: any; - ports: any; - initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void; -} -declare var MessageEvent: { - prototype: MessageEvent; - new(): MessageEvent; -} - -interface SVGElement extends Element { - onmouseover: (ev: MouseEvent) => any; - viewportElement: SVGElement; - onmousemove: (ev: MouseEvent) => any; - onmouseout: (ev: MouseEvent) => any; - ondblclick: (ev: MouseEvent) => any; - onfocusout: (ev: FocusEvent) => any; - onfocusin: (ev: FocusEvent) => any; - xmlbase: string; - onmousedown: (ev: MouseEvent) => any; - onload: (ev: Event) => any; - onmouseup: (ev: MouseEvent) => any; - onclick: (ev: MouseEvent) => any; - ownerSVGElement: SVGSVGElement; - id: string; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var SVGElement: { - prototype: SVGElement; - new(): SVGElement; -} - -interface HTMLScriptElement extends HTMLElement { - /** - * Sets or retrieves the status of the script. - */ - defer: boolean; - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; - /** - * Retrieves the URL to an external file that contains the source code or data. - */ - src: string; - /** - * Sets or retrieves the object that is bound to the event script. - */ - htmlFor: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the MIME type for the associated scripting engine. - */ - type: string; - /** - * Sets or retrieves the event for which the script is written. - */ - event: string; - async: boolean; -} -declare var HTMLScriptElement: { - prototype: HTMLScriptElement; - new(): HTMLScriptElement; -} - -interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundColorStyle { - /** - * Retrieves the position of the object in the rows collection for the table. - */ - rowIndex: number; - /** - * Retrieves a collection of all cells in the table row. - */ - cells: HTMLCollection; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorLight: any; - /** - * Retrieves the position of the object in the collection. - */ - sectionRowIndex: number; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; + headers: string; /** * Sets or retrieves the height of the object. */ height: any; /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. + * Sets or retrieves whether the browser automatically performs wordwrap. */ - borderColorDark: any; + noWrap: boolean; + /** + * Sets or retrieves how many rows in a table the cell should span. + */ + rowSpan: number; + /** + * Sets or retrieves the group of cells in a table to which the object's information applies. + */ + scope: string; + /** + * Sets or retrieves the width of the object. + */ + width: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableCellElement: { + prototype: HTMLTableCellElement; + new(): HTMLTableCellElement; +} + +interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment { + /** + * Sets or retrieves the alignment of the object relative to the display or table. + */ + align: string; + /** + * Sets or retrieves the number of columns in the group. + */ + span: number; + /** + * Sets or retrieves the width of the object. + */ + width: any; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableColElement: { + prototype: HTMLTableColElement; + new(): HTMLTableColElement; +} + +interface HTMLTableDataCellElement extends HTMLTableCellElement { +} + +declare var HTMLTableDataCellElement: { + prototype: HTMLTableDataCellElement; + new(): HTMLTableDataCellElement; +} + +interface HTMLTableElement extends HTMLElement { + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; + bgColor: any; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + border: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Retrieves the caption object of a table. + */ + caption: HTMLTableCaptionElement; + /** + * Sets or retrieves the amount of space between the border of the cell and the content of the cell. + */ + cellPadding: string; + /** + * Sets or retrieves the amount of space between cells in a table. + */ + cellSpacing: string; + /** + * Sets or retrieves the number of columns in the table. + */ + cols: number; + /** + * Sets or retrieves the way the border frame around the table is displayed. + */ + frame: string; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Sets or retrieves the number of horizontal rows contained in the object. + */ + rows: HTMLCollection; + /** + * Sets or retrieves which dividing lines (inner borders) are displayed. + */ + rules: string; + /** + * Sets or retrieves a description and/or structure of the object. + */ + summary: string; + /** + * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order. + */ + tBodies: HTMLCollection; + /** + * Retrieves the tFoot object of the table. + */ + tFoot: HTMLTableSectionElement; + /** + * Retrieves the tHead object of the table. + */ + tHead: HTMLTableSectionElement; + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Creates an empty caption element in the table. + */ + createCaption(): HTMLElement; + /** + * Creates an empty tBody element in the table. + */ + createTBody(): HTMLElement; + /** + * Creates an empty tFoot element in the table. + */ + createTFoot(): HTMLElement; + /** + * Returns the tHead element object if successful, or null otherwise. + */ + createTHead(): HTMLElement; + /** + * Deletes the caption element and its contents from the table. + */ + deleteCaption(): void; + /** + * Removes the specified row (tr) from the element and from the rows collection. + * @param index Number that specifies the zero-based position in the rows collection of the row to remove. + */ + deleteRow(index?: number): void; + /** + * Deletes the tFoot element and its contents from the table. + */ + deleteTFoot(): void; + /** + * Deletes the tHead element and its contents from the table. + */ + deleteTHead(): void; + /** + * Creates a new row (tr) in the table, and adds the row to the rows collection. + * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. + */ + insertRow(index?: number): HTMLElement; +} + +declare var HTMLTableElement: { + prototype: HTMLTableElement; + new(): HTMLTableElement; +} + +interface HTMLTableHeaderCellElement extends HTMLTableCellElement { + /** + * Sets or retrieves the group of cells in a table to which the object's information applies. + */ + scope: string; +} + +declare var HTMLTableHeaderCellElement: { + prototype: HTMLTableHeaderCellElement; + new(): HTMLTableHeaderCellElement; +} + +interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + bgColor: any; + /** + * Retrieves a collection of all cells in the table row. + */ + cells: HTMLCollection; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Retrieves the position of the object in the rows collection for the table. + */ + rowIndex: number; + /** + * Retrieves the position of the object in the collection. + */ + sectionRowIndex: number; /** * Removes the specified cell from the table row, as well as from the cells collection. * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted. @@ -9272,1511 +11455,15 @@ interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment, DOML2Depr * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection. */ insertCell(index?: number): HTMLElement; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var HTMLTableRowElement: { prototype: HTMLTableRowElement; new(): HTMLTableRowElement; } -interface CanvasRenderingContext2D { - miterLimit: number; - font: string; - globalCompositeOperation: string; - msFillRule: string; - lineCap: string; - msImageSmoothingEnabled: boolean; - lineDashOffset: number; - shadowColor: string; - lineJoin: string; - shadowOffsetX: number; - lineWidth: number; - canvas: HTMLCanvasElement; - strokeStyle: any; - globalAlpha: number; - shadowOffsetY: number; - fillStyle: any; - shadowBlur: number; - textAlign: string; - textBaseline: string; - restore(): void; - setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - save(): void; - arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; - measureText(text: string): TextMetrics; - isPointInPath(x: number, y: number, fillRule?: string): boolean; - quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; - putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void; - rotate(angle: number): void; - fillText(text: string, x: number, y: number, maxWidth?: number): void; - translate(x: number, y: number): void; - scale(x: number, y: number): void; - createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; - lineTo(x: number, y: number): void; - getLineDash(): number[]; - fill(fillRule?: string): void; - createImageData(imageDataOrSw: any, sh?: number): ImageData; - createPattern(image: HTMLElement, repetition: string): CanvasPattern; - closePath(): void; - rect(x: number, y: number, w: number, h: number): void; - clip(fillRule?: string): void; - clearRect(x: number, y: number, w: number, h: number): void; - moveTo(x: number, y: number): void; - getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; - fillRect(x: number, y: number, w: number, h: number): void; - bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; - drawImage(image: HTMLElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; - transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - stroke(): void; - strokeRect(x: number, y: number, w: number, h: number): void; - setLineDash(segments: number[]): void; - strokeText(text: string, x: number, y: number, maxWidth?: number): void; - beginPath(): void; - arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; - createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; -} -declare var CanvasRenderingContext2D: { - prototype: CanvasRenderingContext2D; - new(): CanvasRenderingContext2D; -} - -interface MSCSSRuleList { - length: number; - item(index?: number): CSSStyleRule; - [index: number]: CSSStyleRule; -} -declare var MSCSSRuleList: { - prototype: MSCSSRuleList; - new(): MSCSSRuleList; -} - -interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg { - x: number; -} -declare var SVGPathSegLinetoHorizontalAbs: { - prototype: SVGPathSegLinetoHorizontalAbs; - new(): SVGPathSegLinetoHorizontalAbs; -} - -interface SVGPathSegArcAbs extends SVGPathSeg { - y: number; - sweepFlag: boolean; - r2: number; - x: number; - angle: number; - r1: number; - largeArcFlag: boolean; -} -declare var SVGPathSegArcAbs: { - prototype: SVGPathSegArcAbs; - new(): SVGPathSegArcAbs; -} - -interface SVGTransformList { - numberOfItems: number; - getItem(index: number): SVGTransform; - consolidate(): SVGTransform; - clear(): void; - appendItem(newItem: SVGTransform): SVGTransform; - initialize(newItem: SVGTransform): SVGTransform; - removeItem(index: number): SVGTransform; - insertItemBefore(newItem: SVGTransform, index: number): SVGTransform; - replaceItem(newItem: SVGTransform, index: number): SVGTransform; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; -} -declare var SVGTransformList: { - prototype: SVGTransformList; - new(): SVGTransformList; -} - -interface HTMLHtmlElement extends HTMLElement { - /** - * Sets or retrieves the DTD version that governs the current document. - */ - version: string; -} -declare var HTMLHtmlElement: { - prototype: HTMLHtmlElement; - new(): HTMLHtmlElement; -} - -interface SVGPathSegClosePath extends SVGPathSeg { -} -declare var SVGPathSegClosePath: { - prototype: SVGPathSegClosePath; - new(): SVGPathSegClosePath; -} - -interface HTMLFrameElement extends HTMLElement, GetSVGDocument, MSDataBindingExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: any; - /** - * Sets or retrieves whether the frame can be scrolled. - */ - scrolling: string; - /** - * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. - */ - marginHeight: string; - /** - * Sets or retrieves the left and right margin widths before displaying the text in a frame. - */ - marginWidth: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves whether the user can resize the frame. - */ - noResize: boolean; - /** - * Retrieves the object of the specified. - */ - contentWindow: Window; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the frame name. - */ - name: string; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Retrieves the document object of the page or frame. - */ - contentDocument: Document; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Sets or retrieves a URI to a long description of the object. - */ - longDesc: string; - /** - * Raised when the object has been completely received from the server. - */ - onload: (ev: Event) => any; - /** - * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. - */ - security: any; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLFrameElement: { - prototype: HTMLFrameElement; - new(): HTMLFrameElement; -} - -interface SVGAnimatedLength { - animVal: SVGLength; - baseVal: SVGLength; -} -declare var SVGAnimatedLength: { - prototype: SVGAnimatedLength; - new(): SVGAnimatedLength; -} - -interface SVGAnimatedPoints { - points: SVGPointList; - animatedPoints: SVGPointList; -} - -interface SVGDefsElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGDefsElement: { - prototype: SVGDefsElement; - new(): SVGDefsElement; -} - -interface HTMLQuoteElement extends HTMLElement { - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; - /** - * Sets or retrieves reference information about the object. - */ - cite: string; -} -declare var HTMLQuoteElement: { - prototype: HTMLQuoteElement; - new(): HTMLQuoteElement; -} - -interface CSSMediaRule extends CSSRule { - media: MediaList; - cssRules: CSSRuleList; - insertRule(rule: string, index?: number): number; - deleteRule(index?: number): void; -} -declare var CSSMediaRule: { - prototype: CSSMediaRule; - new(): CSSMediaRule; -} - -interface WindowModal { - dialogArguments: any; - returnValue: any; -} - -interface XMLHttpRequest extends EventTarget { - responseBody: any; - status: number; - readyState: number; - responseText: string; - responseXML: any; - ontimeout: (ev: Event) => any; - statusText: string; - onreadystatechange: (ev: Event) => any; - timeout: number; - onload: (ev: Event) => any; - response: any; - withCredentials: boolean; - onprogress: (ev: ProgressEvent) => any; - onabort: (ev: UIEvent) => any; - responseType: string; - onloadend: (ev: ProgressEvent) => any; - upload: XMLHttpRequestEventTarget; - onerror: (ev: ErrorEvent) => any; - onloadstart: (ev: Event) => any; - msCaching: string; - open(method: string, url: string, async?: boolean, user?: string, password?: string): void; - send(data?: any): void; - abort(): void; - getAllResponseHeaders(): string; - setRequestHeader(header: string, value: string): void; - getResponseHeader(header: string): string; - msCachingEnabled(): boolean; - overrideMimeType(mime: string): void; - LOADING: number; - DONE: number; - UNSENT: number; - OPENED: number; - HEADERS_RECEIVED: number; - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var XMLHttpRequest: { - prototype: XMLHttpRequest; - new(): XMLHttpRequest; - LOADING: number; - DONE: number; - UNSENT: number; - OPENED: number; - HEADERS_RECEIVED: number; - create(): XMLHttpRequest; -} - -interface HTMLTableHeaderCellElement extends HTMLTableCellElement { - /** - * Sets or retrieves the group of cells in a table to which the object's information applies. - */ - scope: string; -} -declare var HTMLTableHeaderCellElement: { - prototype: HTMLTableHeaderCellElement; - new(): HTMLTableHeaderCellElement; -} - -interface HTMLDListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction { -} -declare var HTMLDListElement: { - prototype: HTMLDListElement; - new(): HTMLDListElement; -} - -interface MSDataBindingExtensions { - dataSrc: string; - dataFormatAs: string; - dataFld: string; -} - -interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg { - x: number; -} -declare var SVGPathSegLinetoHorizontalRel: { - prototype: SVGPathSegLinetoHorizontalRel; - new(): SVGPathSegLinetoHorizontalRel; -} - -interface SVGEllipseElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - ry: SVGAnimatedLength; - cx: SVGAnimatedLength; - rx: SVGAnimatedLength; - cy: SVGAnimatedLength; -} -declare var SVGEllipseElement: { - prototype: SVGEllipseElement; - new(): SVGEllipseElement; -} - -interface SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { - target: SVGAnimatedString; -} -declare var SVGAElement: { - prototype: SVGAElement; - new(): SVGAElement; -} - -interface SVGStylable { - className: SVGAnimatedString; - style: CSSStyleDeclaration; -} - -interface SVGTransformable extends SVGLocatable { - transform: SVGAnimatedTransformList; -} - -interface HTMLFrameSetElement extends HTMLElement { - ononline: (ev: Event) => any; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the frame heights of the object. - */ - rows: string; - /** - * Sets or retrieves the frame widths of the object. - */ - cols: string; - /** - * Fires when the object loses the input focus. - */ - onblur: (ev: FocusEvent) => any; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Fires when the object receives focus. - */ - onfocus: (ev: FocusEvent) => any; - onmessage: (ev: MessageEvent) => any; - onerror: (ev: ErrorEvent) => any; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - onresize: (ev: UIEvent) => any; - name: string; - onafterprint: (ev: Event) => any; - onbeforeprint: (ev: Event) => any; - onoffline: (ev: Event) => any; - border: string; - onunload: (ev: Event) => any; - onhashchange: (ev: Event) => any; - onload: (ev: Event) => any; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - onstorage: (ev: StorageEvent) => any; - onpageshow: (ev: PageTransitionEvent) => any; - onpagehide: (ev: PageTransitionEvent) => any; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLFrameSetElement: { - prototype: HTMLFrameSetElement; - new(): HTMLFrameSetElement; -} - -interface Screen extends EventTarget { - width: number; - deviceXDPI: number; - fontSmoothingEnabled: boolean; - bufferDepth: number; - logicalXDPI: number; - systemXDPI: number; - availHeight: number; - height: number; - logicalYDPI: number; - systemYDPI: number; - updateInterval: number; - colorDepth: number; - availWidth: number; - deviceYDPI: number; - pixelDepth: number; - msOrientation: string; - onmsorientationchange: (ev: any) => any; - msLockOrientation(orientation: string): boolean; - msLockOrientation(orientations: string[]): boolean; - msUnlockOrientation(): void; - addEventListener(type: "msorientationchange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Screen: { - prototype: Screen; - new(): Screen; -} - -interface Coordinates { - altitudeAccuracy: number; - longitude: number; - latitude: number; - speed: number; - heading: number; - altitude: number; - accuracy: number; -} -declare var Coordinates: { - prototype: Coordinates; - new(): Coordinates; -} - -interface NavigatorGeolocation { - geolocation: Geolocation; -} - -interface NavigatorContentUtils { -} - -interface EventListener { - (evt: Event): void; -} - -interface SVGLangSpace { - xmllang: string; - xmlspace: string; -} - -interface DataTransfer { - effectAllowed: string; - dropEffect: string; - types: DOMStringList; - files: FileList; - clearData(format?: string): boolean; - setData(format: string, data: string): boolean; - getData(format: string): string; -} -declare var DataTransfer: { - prototype: DataTransfer; - new(): DataTransfer; -} - -interface FocusEvent extends UIEvent { - relatedTarget: EventTarget; - initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void; -} -declare var FocusEvent: { - prototype: FocusEvent; - new(): FocusEvent; -} - -interface Range { - startOffset: number; - collapsed: boolean; - endOffset: number; - startContainer: Node; - endContainer: Node; - commonAncestorContainer: Node; - setStart(refNode: Node, offset: number): void; - setEndBefore(refNode: Node): void; - setStartBefore(refNode: Node): void; - selectNode(refNode: Node): void; - detach(): void; - getBoundingClientRect(): ClientRect; - toString(): string; - compareBoundaryPoints(how: number, sourceRange: Range): number; - insertNode(newNode: Node): void; - collapse(toStart: boolean): void; - selectNodeContents(refNode: Node): void; - cloneContents(): DocumentFragment; - setEnd(refNode: Node, offset: number): void; - cloneRange(): Range; - getClientRects(): ClientRectList; - surroundContents(newParent: Node): void; - deleteContents(): void; - setStartAfter(refNode: Node): void; - extractContents(): DocumentFragment; - setEndAfter(refNode: Node): void; - createContextualFragment(fragment: string): DocumentFragment; - END_TO_END: number; - START_TO_START: number; - START_TO_END: number; - END_TO_START: number; -} -declare var Range: { - prototype: Range; - new(): Range; - END_TO_END: number; - START_TO_START: number; - START_TO_END: number; - END_TO_START: number; -} - -interface SVGPoint { - y: number; - x: number; - matrixTransform(matrix: SVGMatrix): SVGPoint; -} -declare var SVGPoint: { - prototype: SVGPoint; - new(): SVGPoint; -} - -interface MSPluginsCollection { - length: number; - refresh(reload?: boolean): void; -} -declare var MSPluginsCollection: { - prototype: MSPluginsCollection; - new(): MSPluginsCollection; -} - -interface SVGAnimatedNumberList { - animVal: SVGNumberList; - baseVal: SVGNumberList; -} -declare var SVGAnimatedNumberList: { - prototype: SVGAnimatedNumberList; - new(): SVGAnimatedNumberList; -} - -interface SVGSVGElement extends SVGElement, SVGStylable, SVGZoomAndPan, DocumentEvent, SVGLangSpace, SVGLocatable, SVGTests, SVGFitToViewBox, SVGExternalResourcesRequired { - width: SVGAnimatedLength; - x: SVGAnimatedLength; - contentStyleType: string; - onzoom: (ev: any) => any; - y: SVGAnimatedLength; - viewport: SVGRect; - onerror: (ev: ErrorEvent) => any; - pixelUnitToMillimeterY: number; - onresize: (ev: UIEvent) => any; - screenPixelToMillimeterY: number; - height: SVGAnimatedLength; - onabort: (ev: UIEvent) => any; - contentScriptType: string; - pixelUnitToMillimeterX: number; - currentTranslate: SVGPoint; - onunload: (ev: Event) => any; - currentScale: number; - onscroll: (ev: UIEvent) => any; - screenPixelToMillimeterX: number; - setCurrentTime(seconds: number): void; - createSVGLength(): SVGLength; - getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeList; - unpauseAnimations(): void; - createSVGRect(): SVGRect; - checkIntersection(element: SVGElement, rect: SVGRect): boolean; - unsuspendRedrawAll(): void; - pauseAnimations(): void; - suspendRedraw(maxWaitMilliseconds: number): number; - deselectAll(): void; - createSVGAngle(): SVGAngle; - getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeList; - createSVGTransform(): SVGTransform; - unsuspendRedraw(suspendHandleID: number): void; - forceRedraw(): void; - getCurrentTime(): number; - checkEnclosure(element: SVGElement, rect: SVGRect): boolean; - createSVGMatrix(): SVGMatrix; - createSVGPoint(): SVGPoint; - createSVGNumber(): SVGNumber; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; - getElementById(elementId: string): Element; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "zoom", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var SVGSVGElement: { - prototype: SVGSVGElement; - new(): SVGSVGElement; -} - -interface HTMLLabelElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the object to which the given label object is assigned. - */ - htmlFor: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; -} -declare var HTMLLabelElement: { - prototype: HTMLLabelElement; - new(): HTMLLabelElement; -} - -interface MSResourceMetadata { - protocol: string; - fileSize: string; - fileUpdatedDate: string; - nameProp: string; - fileCreatedDate: string; - fileModifiedDate: string; - mimeType: string; -} - -interface HTMLLegendElement extends HTMLElement, MSDataBindingExtensions { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - align: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; -} -declare var HTMLLegendElement: { - prototype: HTMLLegendElement; - new(): HTMLLegendElement; -} - -interface HTMLDirectoryElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { -} -declare var HTMLDirectoryElement: { - prototype: HTMLDirectoryElement; - new(): HTMLDirectoryElement; -} - -interface SVGAnimatedInteger { - animVal: number; - baseVal: number; -} -declare var SVGAnimatedInteger: { - prototype: SVGAnimatedInteger; - new(): SVGAnimatedInteger; -} - -interface SVGTextElement extends SVGTextPositioningElement, SVGTransformable { -} -declare var SVGTextElement: { - prototype: SVGTextElement; - new(): SVGTextElement; -} - -interface SVGTSpanElement extends SVGTextPositioningElement { -} -declare var SVGTSpanElement: { - prototype: SVGTSpanElement; - new(): SVGTSpanElement; -} - -interface HTMLLIElement extends HTMLElement, DOML2DeprecatedListNumberingAndBulletStyle { - /** - * Sets or retrieves the value of a list item. - */ - value: number; -} -declare var HTMLLIElement: { - prototype: HTMLLIElement; - new(): HTMLLIElement; -} - -interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg { - y: number; -} -declare var SVGPathSegLinetoVerticalAbs: { - prototype: SVGPathSegLinetoVerticalAbs; - new(): SVGPathSegLinetoVerticalAbs; -} - -interface MSStorageExtensions { - remainingSpace: number; -} - -interface SVGStyleElement extends SVGElement, SVGLangSpace { - media: string; - type: string; - title: string; -} -declare var SVGStyleElement: { - prototype: SVGStyleElement; - new(): SVGStyleElement; -} - -interface MSCurrentStyleCSSProperties extends MSCSSProperties { - blockDirection: string; - clipBottom: string; - clipLeft: string; - clipRight: string; - clipTop: string; - hasLayout: string; -} -declare var MSCurrentStyleCSSProperties: { - prototype: MSCurrentStyleCSSProperties; - new(): MSCurrentStyleCSSProperties; -} - -interface MSHTMLCollectionExtensions { - urns(urn: any): any; - tags(tagName: any): any; -} - -interface Storage extends MSStorageExtensions { - length: number; - getItem(key: string): any; - [key: string]: any; - setItem(key: string, data: string): void; - clear(): void; - removeItem(key: string): void; - key(index: number): string; - [index: number]: string; -} -declare var Storage: { - prototype: Storage; - new(): Storage; -} - -interface HTMLIFrameElement extends HTMLElement, GetSVGDocument, MSDataBindingExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Sets or retrieves whether the frame can be scrolled. - */ - scrolling: string; - /** - * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. - */ - marginHeight: string; - /** - * Sets or retrieves the left and right margin widths before displaying the text in a frame. - */ - marginWidth: string; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves whether the user can resize the frame. - */ - noResize: boolean; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Retrieves the object of the specified. - */ - contentWindow: Window; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the frame name. - */ - name: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Retrieves the document object of the page or frame. - */ - contentDocument: Document; - /** - * Sets or retrieves the horizontal margin for the object. - */ - hspace: number; - /** - * Sets or retrieves a URI to a long description of the object. - */ - longDesc: string; - /** - * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. - */ - security: any; - /** - * Raised when the object has been completely received from the server. - */ - onload: (ev: Event) => any; - sandbox: DOMSettableTokenList; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLIFrameElement: { - prototype: HTMLIFrameElement; - new(): HTMLIFrameElement; -} - -interface TextRangeCollection { - length: number; - item(index: number): TextRange; - [index: number]: TextRange; -} -declare var TextRangeCollection: { - prototype: TextRangeCollection; - new(): TextRangeCollection; -} - -interface HTMLBodyElement extends HTMLElement, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { - scroll: string; - ononline: (ev: Event) => any; - onblur: (ev: FocusEvent) => any; - noWrap: boolean; - onfocus: (ev: FocusEvent) => any; - onmessage: (ev: MessageEvent) => any; - text: any; - onerror: (ev: ErrorEvent) => any; - bgProperties: string; - onresize: (ev: UIEvent) => any; - link: any; - aLink: any; - bottomMargin: any; - topMargin: any; - onafterprint: (ev: Event) => any; - vLink: any; - onbeforeprint: (ev: Event) => any; - onoffline: (ev: Event) => any; - onunload: (ev: Event) => any; - onhashchange: (ev: Event) => any; - onload: (ev: Event) => any; - rightMargin: any; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - leftMargin: any; - onstorage: (ev: StorageEvent) => any; - onpopstate: (ev: PopStateEvent) => any; - onpageshow: (ev: PageTransitionEvent) => any; - onpagehide: (ev: PageTransitionEvent) => any; - createTextRange(): TextRange; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLBodyElement: { - prototype: HTMLBodyElement; - new(): HTMLBodyElement; -} - -interface DocumentType extends Node { - name: string; - notations: NamedNodeMap; - systemId: string; - internalSubset: string; - entities: NamedNodeMap; - publicId: string; -} -declare var DocumentType: { - prototype: DocumentType; - new(): DocumentType; -} - -interface SVGRadialGradientElement extends SVGGradientElement { - cx: SVGAnimatedLength; - r: SVGAnimatedLength; - cy: SVGAnimatedLength; - fx: SVGAnimatedLength; - fy: SVGAnimatedLength; -} -declare var SVGRadialGradientElement: { - prototype: SVGRadialGradientElement; - new(): SVGRadialGradientElement; -} - -interface MutationEvent extends Event { - newValue: string; - attrChange: number; - attrName: string; - prevValue: string; - relatedNode: Node; - initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; - MODIFICATION: number; - REMOVAL: number; - ADDITION: number; -} -declare var MutationEvent: { - prototype: MutationEvent; - new(): MutationEvent; - MODIFICATION: number; - REMOVAL: number; - ADDITION: number; -} - -interface DragEvent extends MouseEvent { - dataTransfer: DataTransfer; - initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void; - msConvertURL(file: File, targetType: string, targetURL?: string): void; -} -declare var DragEvent: { - prototype: DragEvent; - new(): DragEvent; -} - -interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundColorStyle { +interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment { /** * Sets or retrieves a value that indicates the table alignment. */ @@ -10790,650 +11477,125 @@ interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment, DOML2 * @param index Number that specifies the zero-based position in the rows collection of the row to remove. */ deleteRow(index?: number): void; - /** - * Moves a table row to a new position. - * @param indexFrom Number that specifies the index in the rows collection of the table row that is moved. - * @param indexTo Number that specifies where the row is moved within the rows collection. - */ - moveRow(indexFrom?: number, indexTo?: number): any; /** * Creates a new row (tr) in the table, and adds the row to the rows collection. * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. */ insertRow(index?: number): HTMLElement; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var HTMLTableSectionElement: { prototype: HTMLTableSectionElement; new(): HTMLTableSectionElement; } -interface DOML2DeprecatedListNumberingAndBulletStyle { - type: string; -} - -interface HTMLInputElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: string; - status: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Gets or sets the starting position or offset of a text selection. - */ - selectionStart: number; - indeterminate: boolean; - readOnly: boolean; - size: number; - loop: number; - /** - * Gets or sets the end position or offset of a text selection. - */ - selectionEnd: number; - /** - * Sets or retrieves the URL of the virtual reality modeling language (VRML) world to be displayed in the window. - */ - vrml: string; - /** - * Sets or retrieves a lower resolution image to display. - */ - lowsrc: string; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Sets or retrieves a comma-separated list of content types. - */ - accept: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves the state of the check box or radio button. - */ - defaultChecked: boolean; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Returns the value of the data at the cursor's current position. - */ - value: string; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - border: string; - dynsrc: string; - /** - * Sets or retrieves the state of the check box or radio button. - */ - checked: boolean; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - hspace: number; - /** - * Sets or retrieves the maximum number of characters that the user can enter in a text control. - */ - maxLength: number; - /** - * Returns the content type of the object. - */ - type: string; - /** - * Sets or retrieves the initial contents of the object. - */ - defaultValue: string; - /** - * Retrieves whether the object is fully loaded. - */ - complete: boolean; - start: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a FileList object on a file type input object. - */ - files: FileList; - /** - * Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field. - */ - max: string; - /** - * Overrides the target attribute on a form element. - */ - formTarget: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field. - */ - step: string; +interface HTMLTextAreaElement extends HTMLElement { /** * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. */ autofocus: boolean; /** - * When present, marks an element that can't be submitted without a value. + * Sets or retrieves the width of the object. */ - required: boolean; + cols: number; /** - * Used to override the encoding (formEnctype attribute) specified on the form element. + * Sets or retrieves the initial contents of the object. */ - formEnctype: string; + defaultValue: string; + disabled: boolean; /** - * Returns the input field value as a number. + * Retrieves a reference to the form that the object is embedded in. */ - valueAsNumber: number; + form: HTMLFormElement; + /** + * Sets or retrieves the maximum number of characters that the user can enter in a text control. + */ + maxLength: number; + /** + * Sets or retrieves the name of the object. + */ + name: string; /** * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. */ placeholder: string; /** - * Overrides the submit method attribute previously specified on a form element. + * Sets or retrieves the value indicated whether the content of the object is read-only. */ - formMethod: string; + readOnly: boolean; /** - * Specifies the ID of a pre-defined datalist of options for an input element. + * When present, marks an element that can't be submitted without a value. */ - list: HTMLElement; + required: boolean; /** - * Specifies whether autocomplete is applied to an editable text field. + * Sets or retrieves the number of horizontal rows contained in the object. */ - autocomplete: string; + rows: number; /** - * Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field. + * Gets or sets the end position or offset of a text selection. */ - min: string; + selectionEnd: number; /** - * Overrides the action attribute (where the data on a form is sent) on the parent form element. + * Gets or sets the starting position or offset of a text selection. */ - formAction: string; + selectionStart: number; /** - * Gets or sets a string containing a regular expression that the user's input must match. + * Sets or retrieves the value indicating whether the control is selected. */ - pattern: string; + status: any; + /** + * Retrieves the type of control. + */ + type: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; /** * Returns a ValidityState object that represents the validity states of an element. */ validity: ValidityState; /** - * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. + * Retrieves or sets the text in the entry field of the textArea element. */ - formNoValidate: string; + value: string; /** - * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. + * Returns whether an element will successfully validate based on forms validation rules and constraints. */ - multiple: boolean; + willValidate: boolean; + /** + * Sets or retrieves how to handle wordwrapping in the object. + */ + wrap: string; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; /** * Creates a TextRange object for the element. */ createTextRange(): TextRange; + /** + * Highlights the input area of a form element. + */ + select(): void; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; /** * Sets the start and end positions of a selection in a text field. * @param start The offset into the text field for the start of the selection. * @param end The offset into the text field for the end of the selection. */ setSelectionRange(start: number, end: number): void; - /** - * Makes the selection equal to the current object. - */ - select(): void; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. - * @param n Value to decrement the value by. - */ - stepDown(n?: number): void; - /** - * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value. - * @param n Value to increment the value by. - */ - stepUp(n?: number): void; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLInputElement: { - prototype: HTMLInputElement; - new(): HTMLInputElement; } -interface HTMLAnchorElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rel: string; - /** - * Contains the protocol of the URL. - */ - protocol: string; - /** - * Sets or retrieves the substring of the href property that follows the question mark. - */ - search: string; - /** - * Sets or retrieves the coordinates of the object. - */ - coords: string; - /** - * Contains the hostname of a URL. - */ - hostname: string; - /** - * Contains the pathname of the URL. - */ - pathname: string; - Methods: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - protocolLong: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or retrieves the shape of the object. - */ - name: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the language code of the object. - */ - hreflang: string; - /** - * Sets or retrieves the port number associated with a URL. - */ - port: string; - /** - * Contains the hostname and port values of the URL. - */ - host: string; - /** - * Contains the anchor portion of the URL including the hash sign (#). - */ - hash: string; - nameProp: string; - urn: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rev: string; - /** - * Sets or retrieves the shape of the object. - */ - shape: string; - type: string; - mimeType: string; - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; - /** - * Returns a string representation of an object. - */ - toString(): string; -} -declare var HTMLAnchorElement: { - prototype: HTMLAnchorElement; - new(): HTMLAnchorElement; -} - -interface HTMLParamElement extends HTMLElement { - /** - * Sets or retrieves the value of an input parameter for an element. - */ - value: string; - /** - * Sets or retrieves the name of an input parameter for an element. - */ - name: string; - /** - * Sets or retrieves the content type of the resource designated by the value attribute. - */ - type: string; - /** - * Sets or retrieves the data type of the value attribute. - */ - valueType: string; -} -declare var HTMLParamElement: { - prototype: HTMLParamElement; - new(): HTMLParamElement; -} - -interface SVGImageElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGImageElement: { - prototype: SVGImageElement; - new(): SVGImageElement; -} - -interface SVGAnimatedNumber { - animVal: number; - baseVal: number; -} -declare var SVGAnimatedNumber: { - prototype: SVGAnimatedNumber; - new(): SVGAnimatedNumber; -} - -interface PerformanceTiming { - redirectStart: number; - domainLookupEnd: number; - responseStart: number; - domComplete: number; - domainLookupStart: number; - loadEventStart: number; - msFirstPaint: number; - unloadEventEnd: number; - fetchStart: number; - requestStart: number; - domInteractive: number; - navigationStart: number; - connectEnd: number; - loadEventEnd: number; - connectStart: number; - responseEnd: number; - domLoading: number; - redirectEnd: number; - unloadEventStart: number; - domContentLoadedEventStart: number; - domContentLoadedEventEnd: number; - toJSON(): any; -} -declare var PerformanceTiming: { - prototype: PerformanceTiming; - new(): PerformanceTiming; -} - -interface HTMLPreElement extends HTMLElement, DOML2DeprecatedTextFlowControl { - /** - * Sets or gets a value that you can use to implement your own width functionality for the object. - */ - width: number; - /** - * Indicates a citation by rendering text in italic type. - */ - cite: string; -} -declare var HTMLPreElement: { - prototype: HTMLPreElement; - new(): HTMLPreElement; -} - -interface EventException { - code: number; - message: string; - name: string; - toString(): string; - DISPATCH_REQUEST_ERR: number; - UNSPECIFIED_EVENT_TYPE_ERR: number; -} -declare var EventException: { - prototype: EventException; - new(): EventException; - DISPATCH_REQUEST_ERR: number; - UNSPECIFIED_EVENT_TYPE_ERR: number; -} - -interface MSNavigatorDoNotTrack { - msDoNotTrack: string; - removeSiteSpecificTrackingException(args: ExceptionInformation): void; - removeWebWideTrackingException(args: ExceptionInformation): void; - storeWebWideTrackingException(args: StoreExceptionsInformation): void; - storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void; - confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean; - confirmWebWideTrackingException(args: ExceptionInformation): boolean; -} - -interface NavigatorOnLine { - onLine: boolean; -} - -interface WindowLocalStorage { - localStorage: Storage; -} - -interface SVGMetadataElement extends SVGElement { -} -declare var SVGMetadataElement: { - prototype: SVGMetadataElement; - new(): SVGMetadataElement; -} - -interface SVGPathSegArcRel extends SVGPathSeg { - y: number; - sweepFlag: boolean; - r2: number; - x: number; - angle: number; - r1: number; - largeArcFlag: boolean; -} -declare var SVGPathSegArcRel: { - prototype: SVGPathSegArcRel; - new(): SVGPathSegArcRel; -} - -interface SVGPathSegMovetoAbs extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegMovetoAbs: { - prototype: SVGPathSegMovetoAbs; - new(): SVGPathSegMovetoAbs; -} - -interface SVGStringList { - numberOfItems: number; - replaceItem(newItem: string, index: number): string; - getItem(index: number): string; - clear(): void; - appendItem(newItem: string): string; - initialize(newItem: string): string; - removeItem(index: number): string; - insertItemBefore(newItem: string, index: number): string; -} -declare var SVGStringList: { - prototype: SVGStringList; - new(): SVGStringList; -} - -interface XDomainRequest { - timeout: number; - onerror: (ev: ErrorEvent) => any; - onload: (ev: Event) => any; - onprogress: (ev: ProgressEvent) => any; - ontimeout: (ev: Event) => any; - responseText: string; - contentType: string; - open(method: string, url: string): void; - abort(): void; - send(data?: any): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var XDomainRequest: { - prototype: XDomainRequest; - new(): XDomainRequest; - create(): XDomainRequest; -} - -interface DOML2DeprecatedBackgroundColorStyle { - bgColor: any; -} - -interface ElementTraversal { - childElementCount: number; - previousElementSibling: Element; - lastElementChild: Element; - nextElementSibling: Element; - firstElementChild: Element; -} - -interface SVGLength { - valueAsString: string; - valueInSpecifiedUnits: number; - value: number; - unitType: number; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - convertToSpecifiedUnits(unitType: number): void; - SVG_LENGTHTYPE_NUMBER: number; - SVG_LENGTHTYPE_CM: number; - SVG_LENGTHTYPE_PC: number; - SVG_LENGTHTYPE_PERCENTAGE: number; - SVG_LENGTHTYPE_MM: number; - SVG_LENGTHTYPE_PT: number; - SVG_LENGTHTYPE_IN: number; - SVG_LENGTHTYPE_EMS: number; - SVG_LENGTHTYPE_PX: number; - SVG_LENGTHTYPE_UNKNOWN: number; - SVG_LENGTHTYPE_EXS: number; -} -declare var SVGLength: { - prototype: SVGLength; - new(): SVGLength; - SVG_LENGTHTYPE_NUMBER: number; - SVG_LENGTHTYPE_CM: number; - SVG_LENGTHTYPE_PC: number; - SVG_LENGTHTYPE_PERCENTAGE: number; - SVG_LENGTHTYPE_MM: number; - SVG_LENGTHTYPE_PT: number; - SVG_LENGTHTYPE_IN: number; - SVG_LENGTHTYPE_EMS: number; - SVG_LENGTHTYPE_PX: number; - SVG_LENGTHTYPE_UNKNOWN: number; - SVG_LENGTHTYPE_EXS: number; -} - -interface SVGPolygonElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGAnimatedPoints, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGPolygonElement: { - prototype: SVGPolygonElement; - new(): SVGPolygonElement; -} - -interface HTMLPhraseElement extends HTMLElement { - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; - /** - * Sets or retrieves reference information about the object. - */ - cite: string; -} -declare var HTMLPhraseElement: { - prototype: HTMLPhraseElement; - new(): HTMLPhraseElement; -} - -interface NavigatorStorageUtils { -} - -interface SVGPathSegCurvetoCubicRel extends SVGPathSeg { - y: number; - y1: number; - x2: number; - x: number; - x1: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicRel: { - prototype: SVGPathSegCurvetoCubicRel; - new(): SVGPathSegCurvetoCubicRel; -} - -interface SVGTextContentElement extends SVGElement, SVGStylable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - textLength: SVGAnimatedLength; - lengthAdjust: SVGAnimatedEnumeration; - getCharNumAtPosition(point: SVGPoint): number; - getStartPositionOfChar(charnum: number): SVGPoint; - getExtentOfChar(charnum: number): SVGRect; - getComputedTextLength(): number; - getSubStringLength(charnum: number, nchars: number): number; - selectSubString(charnum: number, nchars: number): void; - getNumberOfChars(): number; - getRotationOfChar(charnum: number): number; - getEndPositionOfChar(charnum: number): SVGPoint; - LENGTHADJUST_SPACING: number; - LENGTHADJUST_SPACINGANDGLYPHS: number; - LENGTHADJUST_UNKNOWN: number; -} -declare var SVGTextContentElement: { - prototype: SVGTextContentElement; - new(): SVGTextContentElement; - LENGTHADJUST_SPACING: number; - LENGTHADJUST_SPACINGANDGLYPHS: number; - LENGTHADJUST_UNKNOWN: number; -} - -interface DOML2DeprecatedColorProperty { - color: string; -} - -interface Location { - hash: string; - protocol: string; - search: string; - href: string; - hostname: string; - port: string; - pathname: string; - host: string; - reload(flag?: boolean): void; - replace(url: string): void; - assign(url: string): void; - toString(): string; -} -declare var Location: { - prototype: Location; - new(): Location; +declare var HTMLTextAreaElement: { + prototype: HTMLTextAreaElement; + new(): HTMLTextAreaElement; } interface HTMLTitleElement extends HTMLElement { @@ -11442,719 +11604,215 @@ interface HTMLTitleElement extends HTMLElement { */ text: string; } + declare var HTMLTitleElement: { prototype: HTMLTitleElement; new(): HTMLTitleElement; } -interface HTMLStyleElement extends HTMLElement, LinkStyle { - /** - * Sets or retrieves the media type. - */ - media: string; - /** - * Retrieves the CSS language in which the style sheet is written. - */ +interface HTMLTrackElement extends HTMLElement { + default: boolean; + kind: string; + label: string; + readyState: number; + src: string; + srclang: string; + track: TextTrack; + ERROR: number; + LOADED: number; + LOADING: number; + NONE: number; +} + +declare var HTMLTrackElement: { + prototype: HTMLTrackElement; + new(): HTMLTrackElement; + ERROR: number; + LOADED: number; + LOADING: number; + NONE: number; +} + +interface HTMLUListElement extends HTMLElement { + compact: boolean; type: string; } -declare var HTMLStyleElement: { - prototype: HTMLStyleElement; - new(): HTMLStyleElement; + +declare var HTMLUListElement: { + prototype: HTMLUListElement; + new(): HTMLUListElement; } -interface PerformanceEntry { - name: string; - startTime: number; - duration: number; - entryType: string; -} -declare var PerformanceEntry: { - prototype: PerformanceEntry; - new(): PerformanceEntry; +interface HTMLUnknownElement extends HTMLElement { } -interface SVGTransform { - type: number; - angle: number; - matrix: SVGMatrix; - setTranslate(tx: number, ty: number): void; - setScale(sx: number, sy: number): void; - setMatrix(matrix: SVGMatrix): void; - setSkewY(angle: number): void; - setRotate(angle: number, cx: number, cy: number): void; - setSkewX(angle: number): void; - SVG_TRANSFORM_SKEWX: number; - SVG_TRANSFORM_UNKNOWN: number; - SVG_TRANSFORM_SCALE: number; - SVG_TRANSFORM_TRANSLATE: number; - SVG_TRANSFORM_MATRIX: number; - SVG_TRANSFORM_ROTATE: number; - SVG_TRANSFORM_SKEWY: number; -} -declare var SVGTransform: { - prototype: SVGTransform; - new(): SVGTransform; - SVG_TRANSFORM_SKEWX: number; - SVG_TRANSFORM_UNKNOWN: number; - SVG_TRANSFORM_SCALE: number; - SVG_TRANSFORM_TRANSLATE: number; - SVG_TRANSFORM_MATRIX: number; - SVG_TRANSFORM_ROTATE: number; - SVG_TRANSFORM_SKEWY: number; -} - -interface UIEvent extends Event { - detail: number; - view: Window; - initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void; -} -declare var UIEvent: { - prototype: UIEvent; - new(): UIEvent; -} - -interface SVGURIReference { - href: SVGAnimatedString; -} - -interface SVGPathSeg { - pathSegType: number; - pathSegTypeAsLetter: string; - PATHSEG_MOVETO_REL: number; - PATHSEG_LINETO_VERTICAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - PATHSEG_CURVETO_QUADRATIC_REL: number; - PATHSEG_CURVETO_CUBIC_ABS: number; - PATHSEG_LINETO_HORIZONTAL_ABS: number; - PATHSEG_CURVETO_QUADRATIC_ABS: number; - PATHSEG_LINETO_ABS: number; - PATHSEG_CLOSEPATH: number; - PATHSEG_LINETO_HORIZONTAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - PATHSEG_LINETO_REL: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - PATHSEG_ARC_REL: number; - PATHSEG_CURVETO_CUBIC_REL: number; - PATHSEG_UNKNOWN: number; - PATHSEG_LINETO_VERTICAL_ABS: number; - PATHSEG_ARC_ABS: number; - PATHSEG_MOVETO_ABS: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; -} -declare var SVGPathSeg: { - prototype: SVGPathSeg; - new(): SVGPathSeg; - PATHSEG_MOVETO_REL: number; - PATHSEG_LINETO_VERTICAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - PATHSEG_CURVETO_QUADRATIC_REL: number; - PATHSEG_CURVETO_CUBIC_ABS: number; - PATHSEG_LINETO_HORIZONTAL_ABS: number; - PATHSEG_CURVETO_QUADRATIC_ABS: number; - PATHSEG_LINETO_ABS: number; - PATHSEG_CLOSEPATH: number; - PATHSEG_LINETO_HORIZONTAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - PATHSEG_LINETO_REL: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - PATHSEG_ARC_REL: number; - PATHSEG_CURVETO_CUBIC_REL: number; - PATHSEG_UNKNOWN: number; - PATHSEG_LINETO_VERTICAL_ABS: number; - PATHSEG_ARC_ABS: number; - PATHSEG_MOVETO_ABS: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; -} - -interface WheelEvent extends MouseEvent { - deltaZ: number; - deltaX: number; - deltaMode: number; - deltaY: number; - initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void; - getCurrentPoint(element: Element): void; - DOM_DELTA_PIXEL: number; - DOM_DELTA_LINE: number; - DOM_DELTA_PAGE: number; -} -declare var WheelEvent: { - prototype: WheelEvent; - new(): WheelEvent; - DOM_DELTA_PIXEL: number; - DOM_DELTA_LINE: number; - DOM_DELTA_PAGE: number; -} - -interface MSEventAttachmentTarget { - attachEvent(event: string, listener: EventListener): boolean; - detachEvent(event: string, listener: EventListener): void; -} - -interface SVGNumber { - value: number; -} -declare var SVGNumber: { - prototype: SVGNumber; - new(): SVGNumber; -} - -interface SVGPathElement extends SVGElement, SVGStylable, SVGAnimatedPathData, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - getPathSegAtLength(distance: number): number; - getPointAtLength(distance: number): SVGPoint; - createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs; - createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel; - createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel; - createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs; - createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs; - createSVGPathSegClosePath(): SVGPathSegClosePath; - createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel; - createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel; - createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel; - createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs; - createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs; - createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel; - createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel; - createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs; - createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel; - getTotalLength(): number; - createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel; - createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs; - createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs; - createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs; -} -declare var SVGPathElement: { - prototype: SVGPathElement; - new(): SVGPathElement; -} - -interface MSCompatibleInfo { - version: string; - userAgent: string; -} -declare var MSCompatibleInfo: { - prototype: MSCompatibleInfo; - new(): MSCompatibleInfo; -} - -interface Text extends CharacterData, MSNodeExtensions { - wholeText: string; - splitText(offset: number): Text; - replaceWholeText(content: string): Text; -} -declare var Text: { - prototype: Text; - new(): Text; -} - -interface SVGAnimatedRect { - animVal: SVGRect; - baseVal: SVGRect; -} -declare var SVGAnimatedRect: { - prototype: SVGAnimatedRect; - new(): SVGAnimatedRect; -} - -interface CSSNamespaceRule extends CSSRule { - namespaceURI: string; - prefix: string; -} -declare var CSSNamespaceRule: { - prototype: CSSNamespaceRule; - new(): CSSNamespaceRule; -} - -interface SVGPathSegList { - numberOfItems: number; - replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg; - getItem(index: number): SVGPathSeg; - clear(): void; - appendItem(newItem: SVGPathSeg): SVGPathSeg; - initialize(newItem: SVGPathSeg): SVGPathSeg; - removeItem(index: number): SVGPathSeg; - insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg; -} -declare var SVGPathSegList: { - prototype: SVGPathSegList; - new(): SVGPathSegList; -} - -interface HTMLUnknownElement extends HTMLElement, MSDataBindingRecordSetReadonlyExtensions { -} declare var HTMLUnknownElement: { prototype: HTMLUnknownElement; new(): HTMLUnknownElement; } -interface HTMLAudioElement extends HTMLMediaElement { -} -declare var HTMLAudioElement: { - prototype: HTMLAudioElement; - new(): HTMLAudioElement; -} - -interface MSImageResourceExtensions { - dynsrc: string; - vrml: string; - lowsrc: string; - start: string; - loop: number; -} - -interface PositionError { - code: number; - message: string; - toString(): string; - POSITION_UNAVAILABLE: number; - PERMISSION_DENIED: number; - TIMEOUT: number; -} -declare var PositionError: { - prototype: PositionError; - new(): PositionError; - POSITION_UNAVAILABLE: number; - PERMISSION_DENIED: number; - TIMEOUT: number; -} - -interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { +interface HTMLVideoElement extends HTMLMediaElement { /** - * Sets or retrieves the width of the object. + * Gets or sets the height of the video element. */ - width: number; - /** - * Sets or retrieves a list of header cells that provide information for the object. - */ - headers: string; - /** - * Retrieves the position of the object in the cells collection of a row. - */ - cellIndex: number; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorLight: any; - /** - * Sets or retrieves the number columns in the table that the object should span. - */ - colSpan: number; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves a comma-delimited list of conceptual categories associated with the object. - */ - axis: string; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; - /** - * Sets or retrieves abbreviated text for the object. - */ - abbr: string; - /** - * Sets or retrieves how many rows in a table the cell should span. - */ - rowSpan: number; - /** - * Sets or retrieves the group of cells in a table to which the object's information applies. - */ - scope: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorDark: any; -} -declare var HTMLTableCellElement: { - prototype: HTMLTableCellElement; - new(): HTMLTableCellElement; -} - -interface SVGElementInstance extends EventTarget { - previousSibling: SVGElementInstance; - parentNode: SVGElementInstance; - lastChild: SVGElementInstance; - nextSibling: SVGElementInstance; - childNodes: SVGElementInstanceList; - correspondingUseElement: SVGUseElement; - correspondingElement: SVGElement; - firstChild: SVGElementInstance; -} -declare var SVGElementInstance: { - prototype: SVGElementInstance; - new(): SVGElementInstance; -} - -interface MSNamespaceInfoCollection { - length: number; - add(namespace?: string, urn?: string, implementationUrl?: any): any; - item(index: any): any; - // [index: any]: any; -} -declare var MSNamespaceInfoCollection: { - prototype: MSNamespaceInfoCollection; - new(): MSNamespaceInfoCollection; -} - -interface SVGCircleElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - cx: SVGAnimatedLength; - r: SVGAnimatedLength; - cy: SVGAnimatedLength; -} -declare var SVGCircleElement: { - prototype: SVGCircleElement; - new(): SVGCircleElement; -} - -interface StyleSheetList { - length: number; - item(index?: number): StyleSheet; - [index: number]: StyleSheet; -} -declare var StyleSheetList: { - prototype: StyleSheetList; - new(): StyleSheetList; -} - -interface CSSImportRule extends CSSRule { - styleSheet: CSSStyleSheet; - href: string; - media: MediaList; -} -declare var CSSImportRule: { - prototype: CSSImportRule; - new(): CSSImportRule; -} - -interface CustomEvent extends Event { - detail: any; - initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void; -} -declare var CustomEvent: { - prototype: CustomEvent; - new(): CustomEvent; -} - -interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty { - /** - * Sets or retrieves the current typeface family. - */ - face: string; - /** - * Sets or retrieves the font size of the object. - */ - size: number; -} -declare var HTMLBaseFontElement: { - prototype: HTMLBaseFontElement; - new(): HTMLBaseFontElement; -} - -interface HTMLTextAreaElement extends HTMLElement, MSDataBindingExtensions { - /** - * Retrieves or sets the text in the entry field of the textArea element. - */ - value: string; - /** - * Sets or retrieves the value indicating whether the control is selected. - */ - status: any; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Gets or sets the starting position or offset of a text selection. - */ - selectionStart: number; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: number; - /** - * Sets or retrieves the width of the object. - */ - cols: number; - /** - * Sets or retrieves the value indicated whether the content of the object is read-only. - */ - readOnly: boolean; - /** - * Sets or retrieves how to handle wordwrapping in the object. - */ - wrap: string; - /** - * Gets or sets the end position or offset of a text selection. - */ - selectionEnd: number; - /** - * Retrieves the type of control. - */ - type: string; - /** - * Sets or retrieves the initial contents of the object. - */ - defaultValue: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - /** - * Sets or retrieves the maximum number of characters that the user can enter in a text control. - */ - maxLength: number; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. - */ - placeholder: string; - /** - * Creates a TextRange object for the element. - */ - createTextRange(): TextRange; - /** - * Sets the start and end positions of a selection in a text field. - * @param start The offset into the text field for the start of the selection. - * @param end The offset into the text field for the end of the selection. - */ - setSelectionRange(start: number, end: number): void; - /** - * Highlights the input area of a form element. - */ - select(): void; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLTextAreaElement: { - prototype: HTMLTextAreaElement; - new(): HTMLTextAreaElement; -} - -interface Geolocation { - clearWatch(watchId: number): void; - getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void; - watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number; -} -declare var Geolocation: { - prototype: Geolocation; - new(): Geolocation; -} - -interface DOML2DeprecatedMarginStyle { - vspace: number; - hspace: number; -} - -interface MSWindowModeless { - dialogTop: any; - dialogLeft: any; - dialogWidth: any; - dialogHeight: any; - menuArguments: any; -} - -interface DOML2DeprecatedAlignmentStyle { - align: string; -} - -interface HTMLMarqueeElement extends HTMLElement, MSDataBindingExtensions, DOML2DeprecatedBackgroundColorStyle { - width: string; - onbounce: (ev: Event) => any; - vspace: number; - trueSpeed: boolean; - scrollAmount: number; - scrollDelay: number; - behavior: string; - height: string; - loop: number; - direction: string; - hspace: number; - onstart: (ev: Event) => any; - onfinish: (ev: Event) => any; - stop(): void; - start(): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "bounce", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "start", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "finish", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLMarqueeElement: { - prototype: HTMLMarqueeElement; - new(): HTMLMarqueeElement; -} - -interface SVGRect { - y: number; - width: number; - x: number; height: number; -} -declare var SVGRect: { - prototype: SVGRect; - new(): SVGRect; + msHorizontalMirror: boolean; + msIsLayoutOptimalForPlayback: boolean; + msIsStereo3D: boolean; + msStereo3DPackingMode: string; + msStereo3DRenderMode: string; + msZoom: boolean; + onMSVideoFormatChanged: (ev: Event) => any; + onMSVideoFrameStepCompleted: (ev: Event) => any; + onMSVideoOptimalLayoutChanged: (ev: Event) => any; + /** + * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available. + */ + poster: string; + /** + * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known. + */ + videoHeight: number; + /** + * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known. + */ + videoWidth: number; + webkitDisplayingFullscreen: boolean; + webkitSupportsFullscreen: boolean; + /** + * Gets or sets the width of the video element. + */ + width: number; + getVideoPlaybackQuality(): VideoPlaybackQuality; + msFrameStep(forward: boolean): void; + msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; + msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void; + webkitEnterFullScreen(): void; + webkitEnterFullscreen(): void; + webkitExitFullScreen(): void; + webkitExitFullscreen(): void; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSVideoFormatChanged", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "MSVideoFrameStepCompleted", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "MSVideoOptimalLayoutChanged", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface MSNodeExtensions { - swapNode(otherNode: Node): Node; - removeNode(deep?: boolean): Node; - replaceNode(replacement: Node): Node; +declare var HTMLVideoElement: { + prototype: HTMLVideoElement; + new(): HTMLVideoElement; +} + +interface HashChangeEvent extends Event { + newURL: string; + oldURL: string; +} + +declare var HashChangeEvent: { + prototype: HashChangeEvent; + new(type: string, eventInitDict?: HashChangeEventInit): HashChangeEvent; } interface History { @@ -12163,2002 +11821,373 @@ interface History { back(distance?: any): void; forward(distance?: any): void; go(delta?: any): void; - replaceState(statedata: any, title: string, url?: string): void; - pushState(statedata: any, title: string, url?: string): void; + pushState(statedata: any, title?: string, url?: string): void; + replaceState(statedata: any, title?: string, url?: string): void; } + declare var History: { prototype: History; new(): History; } -interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg { - y: number; - y1: number; - x2: number; - x: number; - x1: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicAbs: { - prototype: SVGPathSegCurvetoCubicAbs; - new(): SVGPathSegCurvetoCubicAbs; +interface IDBCursor { + direction: string; + key: any; + primaryKey: any; + source: any; + advance(count: number): void; + continue(key?: any): void; + delete(): IDBRequest; + update(value: any): IDBRequest; + NEXT: string; + NEXT_NO_DUPLICATE: string; + PREV: string; + PREV_NO_DUPLICATE: string; } -interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg { - y: number; - y1: number; - x: number; - x1: number; -} -declare var SVGPathSegCurvetoQuadraticAbs: { - prototype: SVGPathSegCurvetoQuadraticAbs; - new(): SVGPathSegCurvetoQuadraticAbs; +declare var IDBCursor: { + prototype: IDBCursor; + new(): IDBCursor; + NEXT: string; + NEXT_NO_DUPLICATE: string; + PREV: string; + PREV_NO_DUPLICATE: string; } -interface TimeRanges { - length: number; - start(index: number): number; - end(index: number): number; -} -declare var TimeRanges: { - prototype: TimeRanges; - new(): TimeRanges; +interface IDBCursorWithValue extends IDBCursor { + value: any; } -interface CSSRule { - cssText: string; - parentStyleSheet: CSSStyleSheet; - parentRule: CSSRule; - type: number; - IMPORT_RULE: number; - MEDIA_RULE: number; - STYLE_RULE: number; - NAMESPACE_RULE: number; - PAGE_RULE: number; - UNKNOWN_RULE: number; - FONT_FACE_RULE: number; - CHARSET_RULE: number; - KEYFRAMES_RULE: number; - KEYFRAME_RULE: number; - VIEWPORT_RULE: number; -} -declare var CSSRule: { - prototype: CSSRule; - new(): CSSRule; - IMPORT_RULE: number; - MEDIA_RULE: number; - STYLE_RULE: number; - NAMESPACE_RULE: number; - PAGE_RULE: number; - UNKNOWN_RULE: number; - FONT_FACE_RULE: number; - CHARSET_RULE: number; - KEYFRAMES_RULE: number; - KEYFRAME_RULE: number; - VIEWPORT_RULE: number; +declare var IDBCursorWithValue: { + prototype: IDBCursorWithValue; + new(): IDBCursorWithValue; } -interface SVGPathSegLinetoAbs extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegLinetoAbs: { - prototype: SVGPathSegLinetoAbs; - new(): SVGPathSegLinetoAbs; +interface IDBDatabase extends EventTarget { + name: string; + objectStoreNames: DOMStringList; + onabort: (ev: Event) => any; + onerror: (ev: Event) => any; + version: string; + close(): void; + createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; + deleteObjectStore(name: string): void; + transaction(storeNames: any, mode?: string): IDBTransaction; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface HTMLModElement extends HTMLElement { - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; - /** - * Sets or retrieves reference information about the object. - */ - cite: string; -} -declare var HTMLModElement: { - prototype: HTMLModElement; - new(): HTMLModElement; +declare var IDBDatabase: { + prototype: IDBDatabase; + new(): IDBDatabase; } -interface SVGMatrix { - e: number; - c: number; - a: number; - b: number; - d: number; - f: number; - multiply(secondMatrix: SVGMatrix): SVGMatrix; - flipY(): SVGMatrix; - skewY(angle: number): SVGMatrix; - inverse(): SVGMatrix; - scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix; - rotate(angle: number): SVGMatrix; - flipX(): SVGMatrix; - translate(x: number, y: number): SVGMatrix; - scale(scaleFactor: number): SVGMatrix; - rotateFromVector(x: number, y: number): SVGMatrix; - skewX(angle: number): SVGMatrix; -} -declare var SVGMatrix: { - prototype: SVGMatrix; - new(): SVGMatrix; +interface IDBFactory { + cmp(first: any, second: any): number; + deleteDatabase(name: string): IDBOpenDBRequest; + open(name: string, version?: number): IDBOpenDBRequest; } -interface MSPopupWindow { - document: Document; - isOpen: boolean; - show(x: number, y: number, w: number, h: number, element?: any): void; - hide(): void; -} -declare var MSPopupWindow: { - prototype: MSPopupWindow; - new(): MSPopupWindow; +declare var IDBFactory: { + prototype: IDBFactory; + new(): IDBFactory; } -interface BeforeUnloadEvent extends Event { - returnValue: string; -} -declare var BeforeUnloadEvent: { - prototype: BeforeUnloadEvent; - new(): BeforeUnloadEvent; +interface IDBIndex { + keyPath: string; + name: string; + objectStore: IDBObjectStore; + unique: boolean; + count(key?: any): IDBRequest; + get(key: any): IDBRequest; + getKey(key: any): IDBRequest; + openCursor(range?: IDBKeyRange, direction?: string): IDBRequest; + openKeyCursor(range?: IDBKeyRange, direction?: string): IDBRequest; } -interface SVGUseElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - animatedInstanceRoot: SVGElementInstance; - instanceRoot: SVGElementInstance; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGUseElement: { - prototype: SVGUseElement; - new(): SVGUseElement; +declare var IDBIndex: { + prototype: IDBIndex; + new(): IDBIndex; } -interface Event { - timeStamp: number; - defaultPrevented: boolean; - isTrusted: boolean; - currentTarget: EventTarget; - cancelBubble: boolean; - target: EventTarget; - eventPhase: number; - cancelable: boolean; - type: string; - srcElement: Element; - bubbles: boolean; - initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; - stopPropagation(): void; - stopImmediatePropagation(): void; - preventDefault(): void; - CAPTURING_PHASE: number; - AT_TARGET: number; - BUBBLING_PHASE: number; +interface IDBKeyRange { + lower: any; + lowerOpen: boolean; + upper: any; + upperOpen: boolean; } -declare var Event: { - prototype: Event; - new(): Event; - CAPTURING_PHASE: number; - AT_TARGET: number; - BUBBLING_PHASE: number; + +declare var IDBKeyRange: { + prototype: IDBKeyRange; + new(): IDBKeyRange; + bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; + lowerBound(bound: any, open?: boolean): IDBKeyRange; + only(value: any): IDBKeyRange; + upperBound(bound: any, open?: boolean): IDBKeyRange; +} + +interface IDBObjectStore { + indexNames: DOMStringList; + keyPath: string; + name: string; + transaction: IDBTransaction; + add(value: any, key?: any): IDBRequest; + clear(): IDBRequest; + count(key?: any): IDBRequest; + createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; + delete(key: any): IDBRequest; + deleteIndex(indexName: string): void; + get(key: any): IDBRequest; + index(name: string): IDBIndex; + openCursor(range?: any, direction?: string): IDBRequest; + put(value: any, key?: any): IDBRequest; +} + +declare var IDBObjectStore: { + prototype: IDBObjectStore; + new(): IDBObjectStore; +} + +interface IDBOpenDBRequest extends IDBRequest { + onblocked: (ev: Event) => any; + onupgradeneeded: (ev: IDBVersionChangeEvent) => any; + addEventListener(type: "blocked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "upgradeneeded", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBOpenDBRequest: { + prototype: IDBOpenDBRequest; + new(): IDBOpenDBRequest; +} + +interface IDBRequest extends EventTarget { + error: DOMError; + onerror: (ev: Event) => any; + onsuccess: (ev: Event) => any; + readyState: string; + result: any; + source: any; + transaction: IDBTransaction; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBRequest: { + prototype: IDBRequest; + new(): IDBRequest; +} + +interface IDBTransaction extends EventTarget { + db: IDBDatabase; + error: DOMError; + mode: string; + onabort: (ev: Event) => any; + oncomplete: (ev: Event) => any; + onerror: (ev: Event) => any; + abort(): void; + objectStore(name: string): IDBObjectStore; + READ_ONLY: string; + READ_WRITE: string; + VERSION_CHANGE: string; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBTransaction: { + prototype: IDBTransaction; + new(): IDBTransaction; + READ_ONLY: string; + READ_WRITE: string; + VERSION_CHANGE: string; +} + +interface IDBVersionChangeEvent extends Event { + newVersion: number; + oldVersion: number; +} + +declare var IDBVersionChangeEvent: { + prototype: IDBVersionChangeEvent; + new(): IDBVersionChangeEvent; } interface ImageData { - width: number; data: number[]; height: number; + width: number; } + declare var ImageData: { prototype: ImageData; new(): ImageData; } -interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves the width of the object. - */ - width: any; - /** - * Sets or retrieves the alignment of the object relative to the display or table. - */ - align: string; - /** - * Sets or retrieves the number of columns in the group. - */ - span: number; -} -declare var HTMLTableColElement: { - prototype: HTMLTableColElement; - new(): HTMLTableColElement; -} - -interface SVGException { - code: number; - message: string; - name: string; - toString(): string; - SVG_MATRIX_NOT_INVERTABLE: number; - SVG_WRONG_TYPE_ERR: number; - SVG_INVALID_VALUE_ERR: number; -} -declare var SVGException: { - prototype: SVGException; - new(): SVGException; - SVG_MATRIX_NOT_INVERTABLE: number; - SVG_WRONG_TYPE_ERR: number; - SVG_INVALID_VALUE_ERR: number; -} - -interface SVGLinearGradientElement extends SVGGradientElement { - y1: SVGAnimatedLength; - x2: SVGAnimatedLength; - x1: SVGAnimatedLength; - y2: SVGAnimatedLength; -} -declare var SVGLinearGradientElement: { - prototype: SVGLinearGradientElement; - new(): SVGLinearGradientElement; -} - -interface HTMLTableAlignment { - /** - * Sets or retrieves a value that you can use to implement your own ch functionality for the object. - */ - ch: string; - /** - * Sets or retrieves how text and other content are vertically aligned within the object that contains them. - */ - vAlign: string; - /** - * Sets or retrieves a value that you can use to implement your own chOff functionality for the object. - */ - chOff: string; -} - -interface SVGAnimatedEnumeration { - animVal: number; - baseVal: number; -} -declare var SVGAnimatedEnumeration: { - prototype: SVGAnimatedEnumeration; - new(): SVGAnimatedEnumeration; -} - -interface DOML2DeprecatedSizeProperty { - size: number; -} - -interface HTMLUListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { -} -declare var HTMLUListElement: { - prototype: HTMLUListElement; - new(): HTMLUListElement; -} - -interface SVGRectElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - ry: SVGAnimatedLength; - rx: SVGAnimatedLength; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGRectElement: { - prototype: SVGRectElement; - new(): SVGRectElement; -} - -interface ErrorEventHandler { - (event: Event, source: string, fileno: number, columnNumber: number): void; -} - -interface HTMLDivElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} -declare var HTMLDivElement: { - prototype: HTMLDivElement; - new(): HTMLDivElement; -} - -interface DOML2DeprecatedBorderStyle { - border: string; -} - -interface NamedNodeMap { - length: number; - removeNamedItemNS(namespaceURI: string, localName: string): Attr; - item(index: number): Attr; - [index: number]: Attr; - removeNamedItem(name: string): Attr; - getNamedItem(name: string): Attr; - // [name: string]: Attr; - setNamedItem(arg: Attr): Attr; - getNamedItemNS(namespaceURI: string, localName: string): Attr; - setNamedItemNS(arg: Attr): Attr; -} -declare var NamedNodeMap: { - prototype: NamedNodeMap; - new(): NamedNodeMap; -} - -interface MediaList { - length: number; - mediaText: string; - deleteMedium(oldMedium: string): void; - appendMedium(newMedium: string): void; - item(index: number): string; - [index: number]: string; - toString(): string; -} -declare var MediaList: { - prototype: MediaList; - new(): MediaList; -} - -interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegCurvetoQuadraticSmoothAbs: { - prototype: SVGPathSegCurvetoQuadraticSmoothAbs; - new(): SVGPathSegCurvetoQuadraticSmoothAbs; -} - -interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { - y: number; - x2: number; - x: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicSmoothRel: { - prototype: SVGPathSegCurvetoCubicSmoothRel; - new(): SVGPathSegCurvetoCubicSmoothRel; -} - -interface SVGLengthList { - numberOfItems: number; - replaceItem(newItem: SVGLength, index: number): SVGLength; - getItem(index: number): SVGLength; - clear(): void; - appendItem(newItem: SVGLength): SVGLength; - initialize(newItem: SVGLength): SVGLength; - removeItem(index: number): SVGLength; - insertItemBefore(newItem: SVGLength, index: number): SVGLength; -} -declare var SVGLengthList: { - prototype: SVGLengthList; - new(): SVGLengthList; -} - -interface ProcessingInstruction extends Node { - target: string; - data: string; -} -declare var ProcessingInstruction: { - prototype: ProcessingInstruction; - new(): ProcessingInstruction; -} - -interface MSWindowExtensions { - status: string; - onmouseleave: (ev: MouseEvent) => any; - screenLeft: number; - offscreenBuffering: any; - maxConnectionsPerServer: number; - onmouseenter: (ev: MouseEvent) => any; - clipboardData: DataTransfer; - defaultStatus: string; - clientInformation: Navigator; - closed: boolean; - onhelp: (ev: Event) => any; - external: External; - event: MSEventObj; - onfocusout: (ev: FocusEvent) => any; - screenTop: number; - onfocusin: (ev: FocusEvent) => any; - showModelessDialog(url?: string, argument?: any, options?: any): Window; - navigate(url: string): void; - resizeBy(x?: number, y?: number): void; - item(index: any): any; - resizeTo(x?: number, y?: number): void; - createPopup(arguments?: any): MSPopupWindow; - toStaticHTML(html: string): string; - execScript(code: string, language?: string): any; - msWriteProfilerMark(profilerMarkName: string): void; - moveTo(x?: number, y?: number): void; - moveBy(x?: number, y?: number): void; - showHelp(url: string, helpArg?: any, features?: string): void; - captureEvents(): void; - releaseEvents(): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface MSBehaviorUrnsCollection { - length: number; - item(index: number): string; -} -declare var MSBehaviorUrnsCollection: { - prototype: MSBehaviorUrnsCollection; - new(): MSBehaviorUrnsCollection; -} - -interface CSSFontFaceRule extends CSSRule { - style: CSSStyleDeclaration; -} -declare var CSSFontFaceRule: { - prototype: CSSFontFaceRule; - new(): CSSFontFaceRule; -} - -interface DOML2DeprecatedBackgroundStyle { - background: string; -} - -interface TextEvent extends UIEvent { - inputMethod: number; - data: string; - locale: string; - initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void; - DOM_INPUT_METHOD_KEYBOARD: number; - DOM_INPUT_METHOD_DROP: number; - DOM_INPUT_METHOD_IME: number; - DOM_INPUT_METHOD_SCRIPT: number; - DOM_INPUT_METHOD_VOICE: number; - DOM_INPUT_METHOD_UNKNOWN: number; - DOM_INPUT_METHOD_PASTE: number; - DOM_INPUT_METHOD_HANDWRITING: number; - DOM_INPUT_METHOD_OPTION: number; - DOM_INPUT_METHOD_MULTIMODAL: number; -} -declare var TextEvent: { - prototype: TextEvent; - new(): TextEvent; - DOM_INPUT_METHOD_KEYBOARD: number; - DOM_INPUT_METHOD_DROP: number; - DOM_INPUT_METHOD_IME: number; - DOM_INPUT_METHOD_SCRIPT: number; - DOM_INPUT_METHOD_VOICE: number; - DOM_INPUT_METHOD_UNKNOWN: number; - DOM_INPUT_METHOD_PASTE: number; - DOM_INPUT_METHOD_HANDWRITING: number; - DOM_INPUT_METHOD_OPTION: number; - DOM_INPUT_METHOD_MULTIMODAL: number; -} - -interface DocumentFragment extends Node, NodeSelector, MSEventAttachmentTarget, MSNodeExtensions { -} -declare var DocumentFragment: { - prototype: DocumentFragment; - new(): DocumentFragment; -} - -interface SVGPolylineElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGAnimatedPoints, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGPolylineElement: { - prototype: SVGPolylineElement; - new(): SVGPolylineElement; -} - -interface SVGAnimatedPathData { - pathSegList: SVGPathSegList; -} - -interface Position { - timestamp: Date; - coords: Coordinates; -} -declare var Position: { - prototype: Position; - new(): Position; -} - -interface BookmarkCollection { - length: number; - item(index: number): any; - [index: number]: any; -} -declare var BookmarkCollection: { - prototype: BookmarkCollection; - new(): BookmarkCollection; -} - -interface PerformanceMark extends PerformanceEntry { -} -declare var PerformanceMark: { - prototype: PerformanceMark; - new(): PerformanceMark; -} - -interface CSSPageRule extends CSSRule { - pseudoClass: string; - selectorText: string; - selector: string; - style: CSSStyleDeclaration; -} -declare var CSSPageRule: { - prototype: CSSPageRule; - new(): CSSPageRule; -} - -interface HTMLBRElement extends HTMLElement { - /** - * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document. - */ - clear: string; -} -declare var HTMLBRElement: { - prototype: HTMLBRElement; - new(): HTMLBRElement; -} - -interface MSNavigatorExtensions { - userLanguage: string; - plugins: MSPluginsCollection; - cookieEnabled: boolean; - appCodeName: string; - cpuClass: string; - appMinorVersion: string; - connectionSpeed: number; - browserLanguage: string; - mimeTypes: MSMimeTypesCollection; - systemLanguage: string; - language: string; - javaEnabled(): boolean; - taintEnabled(): boolean; -} - -interface HTMLSpanElement extends HTMLElement, MSDataBindingExtensions { -} -declare var HTMLSpanElement: { - prototype: HTMLSpanElement; - new(): HTMLSpanElement; -} - -interface HTMLHeadElement extends HTMLElement { - profile: string; -} -declare var HTMLHeadElement: { - prototype: HTMLHeadElement; - new(): HTMLHeadElement; -} - -interface HTMLHeadingElement extends HTMLElement, DOML2DeprecatedTextFlowControl { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; -} -declare var HTMLHeadingElement: { - prototype: HTMLHeadingElement; - new(): HTMLHeadingElement; -} - -interface HTMLFormElement extends HTMLElement, MSHTMLCollectionExtensions { - /** - * Sets or retrieves the number of objects in a collection. - */ - length: number; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form. - */ - acceptCharset: string; - /** - * Sets or retrieves the encoding type for the form. - */ - enctype: string; - /** - * Retrieves a collection, in source order, of all controls in a given form. - */ - elements: HTMLCollection; - /** - * Sets or retrieves the URL to which the form content is sent for processing. - */ - action: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Sets or retrieves how to send the form data to the server. - */ - method: string; - /** - * Sets or retrieves the MIME encoding for the form. - */ - encoding: string; - /** - * Specifies whether autocomplete is applied to an editable text field. - */ - autocomplete: string; - /** - * Designates a form that is not validated when submitted. - */ - noValidate: boolean; - /** - * Fires when the user resets a form. - */ - reset(): void; - /** - * Retrieves a form object or an object from an elements collection. - * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. - * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. - */ - item(name?: any, index?: any): any; - /** - * Fires when a FORM is about to be submitted. - */ - submit(): void; - /** - * Retrieves a form object or an object from an elements collection. - */ - namedItem(name: string): any; - [name: string]: any; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; -} -declare var HTMLFormElement: { - prototype: HTMLFormElement; - new(): HTMLFormElement; -} - -interface SVGZoomAndPan { - zoomAndPan: number; - SVG_ZOOMANDPAN_MAGNIFY: number; - SVG_ZOOMANDPAN_UNKNOWN: number; - SVG_ZOOMANDPAN_DISABLE: number; -} -declare var SVGZoomAndPan: SVGZoomAndPan; - -interface HTMLMediaElement extends HTMLElement { - /** - * Gets the earliest possible position, in seconds, that the playback can begin. - */ - initialTime: number; - /** - * Gets TimeRanges for the current media resource that has been played. - */ - played: TimeRanges; - /** - * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement. - */ - currentSrc: string; - readyState: any; - /** - * The autobuffer element is not supported by Internet Explorer 9. Use the preload element instead. - */ - autobuffer: boolean; - /** - * Gets or sets a flag to specify whether playback should restart after it completes. - */ - loop: boolean; - /** - * Gets information about whether the playback has ended or not. - */ - ended: boolean; - /** - * Gets a collection of buffered time ranges. - */ - buffered: TimeRanges; - /** - * Returns an object representing the current error state of the audio or video element. - */ - error: MediaError; - /** - * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. - */ - seekable: TimeRanges; - /** - * Gets or sets a value that indicates whether to start playing the media automatically. - */ - autoplay: boolean; - /** - * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player). - */ - controls: boolean; - /** - * Gets or sets the volume level for audio portions of the media element. - */ - volume: number; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - /** - * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource. - */ - playbackRate: number; - /** - * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming. - */ - duration: number; - /** - * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted. - */ - muted: boolean; - /** - * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource. - */ - defaultPlaybackRate: number; - /** - * Gets a flag that specifies whether playback is paused. - */ - paused: boolean; - /** - * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource. - */ - seeking: boolean; - /** - * Gets or sets the current playback position, in seconds. - */ - currentTime: number; - /** - * Gets or sets the current playback position, in seconds. - */ - preload: string; - /** - * Gets the current network activity for the element. - */ - networkState: number; - /** - * Specifies the purpose of the audio or video media, such as background audio or alerts. - */ - msAudioCategory: string; - /** - * Specifies whether or not to enable low-latency playback on the media element. - */ - msRealTime: boolean; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - textTracks: TextTrackList; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Returns an AudioTrackList object with the audio tracks for a given video element. - */ - audioTracks: AudioTrackList; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; - /** - * Specifies the output device id that the audio will be sent to. - */ - msAudioDeviceType: string; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - onmsneedkey: (ev: MSMediaKeyNeededEvent) => any; - /** - * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element. - */ - msKeys: MSMediaKeys; - msGraphicsTrustStatus: MSGraphicsTrust; - /** - * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not. - */ - pause(): void; - /** - * Loads and starts playback of a media resource. - */ - play(): void; - /** - * Fires immediately after the client loads the object. - */ - load(): void; - /** - * Returns a string that specifies whether the client can play a given media resource type. - */ - canPlayType(type: string): string; - /** - * Clears all effects from the media pipeline. - */ - msClearEffects(): void; - /** - * Specifies the media protection manager for a given media pipeline. - */ - msSetMediaProtectionManager(mediaProtectionManager?: any): void; - /** - * Inserts the specified audio effect into media pipeline. - */ - msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; - msSetMediaKeys(mediaKeys: MSMediaKeys): void; - addTextTrack(kind: string, label?: string, language?: string): TextTrack; - HAVE_METADATA: number; - HAVE_CURRENT_DATA: number; - HAVE_NOTHING: number; - NETWORK_NO_SOURCE: number; - HAVE_ENOUGH_DATA: number; - NETWORK_EMPTY: number; - NETWORK_LOADING: number; - NETWORK_IDLE: number; - HAVE_FUTURE_DATA: number; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLMediaElement: { - prototype: HTMLMediaElement; - new(): HTMLMediaElement; - HAVE_METADATA: number; - HAVE_CURRENT_DATA: number; - HAVE_NOTHING: number; - NETWORK_NO_SOURCE: number; - HAVE_ENOUGH_DATA: number; - NETWORK_EMPTY: number; - NETWORK_LOADING: number; - NETWORK_IDLE: number; - HAVE_FUTURE_DATA: number; -} - -interface ElementCSSInlineStyle { - runtimeStyle: MSStyleCSSProperties; - currentStyle: MSCurrentStyleCSSProperties; - doScroll(component?: any): void; - componentFromPoint(x: number, y: number): string; -} - -interface DOMParser { - parseFromString(source: string, mimeType: string): Document; -} -declare var DOMParser: { - prototype: DOMParser; - new(): DOMParser; -} - -interface MSMimeTypesCollection { - length: number; -} -declare var MSMimeTypesCollection: { - prototype: MSMimeTypesCollection; - new(): MSMimeTypesCollection; -} - -interface StyleSheet { - disabled: boolean; - ownerNode: Node; - parentStyleSheet: StyleSheet; - href: string; - media: MediaList; - type: string; - title: string; -} -declare var StyleSheet: { - prototype: StyleSheet; - new(): StyleSheet; -} - -interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { - startOffset: SVGAnimatedLength; - method: SVGAnimatedEnumeration; - spacing: SVGAnimatedEnumeration; - TEXTPATH_SPACINGTYPE_EXACT: number; - TEXTPATH_METHODTYPE_STRETCH: number; - TEXTPATH_SPACINGTYPE_AUTO: number; - TEXTPATH_SPACINGTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_ALIGN: number; -} -declare var SVGTextPathElement: { - prototype: SVGTextPathElement; - new(): SVGTextPathElement; - TEXTPATH_SPACINGTYPE_EXACT: number; - TEXTPATH_METHODTYPE_STRETCH: number; - TEXTPATH_SPACINGTYPE_AUTO: number; - TEXTPATH_SPACINGTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_ALIGN: number; -} - -interface HTMLDTElement extends HTMLElement { - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} -declare var HTMLDTElement: { - prototype: HTMLDTElement; - new(): HTMLDTElement; -} - -interface NodeList { - length: number; - item(index: number): Node; - [index: number]: Node; -} -declare var NodeList: { - prototype: NodeList; - new(): NodeList; -} - -interface XMLSerializer { - serializeToString(target: Node): string; -} -declare var XMLSerializer: { - prototype: XMLSerializer; - new(): XMLSerializer; -} - -interface PerformanceMeasure extends PerformanceEntry { -} -declare var PerformanceMeasure: { - prototype: PerformanceMeasure; - new(): PerformanceMeasure; -} - -interface SVGGradientElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGExternalResourcesRequired, SVGURIReference { - spreadMethod: SVGAnimatedEnumeration; - gradientTransform: SVGAnimatedTransformList; - gradientUnits: SVGAnimatedEnumeration; - SVG_SPREADMETHOD_REFLECT: number; - SVG_SPREADMETHOD_PAD: number; - SVG_SPREADMETHOD_UNKNOWN: number; - SVG_SPREADMETHOD_REPEAT: number; -} -declare var SVGGradientElement: { - prototype: SVGGradientElement; - new(): SVGGradientElement; - SVG_SPREADMETHOD_REFLECT: number; - SVG_SPREADMETHOD_PAD: number; - SVG_SPREADMETHOD_UNKNOWN: number; - SVG_SPREADMETHOD_REPEAT: number; -} - -interface NodeFilter { - acceptNode(n: Node): number; - SHOW_ENTITY_REFERENCE: number; - SHOW_NOTATION: number; - SHOW_ENTITY: number; - SHOW_DOCUMENT: number; - SHOW_PROCESSING_INSTRUCTION: number; - FILTER_REJECT: number; - SHOW_CDATA_SECTION: number; - FILTER_ACCEPT: number; - SHOW_ALL: number; - SHOW_DOCUMENT_TYPE: number; - SHOW_TEXT: number; - SHOW_ELEMENT: number; - SHOW_COMMENT: number; - FILTER_SKIP: number; - SHOW_ATTRIBUTE: number; - SHOW_DOCUMENT_FRAGMENT: number; -} -declare var NodeFilter: NodeFilter; - -interface SVGNumberList { - numberOfItems: number; - replaceItem(newItem: SVGNumber, index: number): SVGNumber; - getItem(index: number): SVGNumber; - clear(): void; - appendItem(newItem: SVGNumber): SVGNumber; - initialize(newItem: SVGNumber): SVGNumber; - removeItem(index: number): SVGNumber; - insertItemBefore(newItem: SVGNumber, index: number): SVGNumber; -} -declare var SVGNumberList: { - prototype: SVGNumberList; - new(): SVGNumberList; -} - -interface MediaError { - code: number; - msExtendedCode: number; - MEDIA_ERR_ABORTED: number; - MEDIA_ERR_NETWORK: number; - MEDIA_ERR_SRC_NOT_SUPPORTED: number; - MEDIA_ERR_DECODE: number; - MS_MEDIA_ERR_ENCRYPTED: number; -} -declare var MediaError: { - prototype: MediaError; - new(): MediaError; - MEDIA_ERR_ABORTED: number; - MEDIA_ERR_NETWORK: number; - MEDIA_ERR_SRC_NOT_SUPPORTED: number; - MEDIA_ERR_DECODE: number; - MS_MEDIA_ERR_ENCRYPTED: number; -} - -interface HTMLFieldSetElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLFieldSetElement: { - prototype: HTMLFieldSetElement; - new(): HTMLFieldSetElement; -} - -interface HTMLBGSoundElement extends HTMLElement { - /** - * Sets or gets the value indicating how the volume of the background sound is divided between the left speaker and the right speaker. - */ - balance: any; - /** - * Sets or gets the volume setting for the sound. - */ - volume: any; - /** - * Sets or gets the URL of a sound to play. - */ - src: string; - /** - * Sets or retrieves the number of times a sound or video clip will loop when activated. - */ - loop: number; -} -declare var HTMLBGSoundElement: { - prototype: HTMLBGSoundElement; - new(): HTMLBGSoundElement; -} - -interface Comment extends CharacterData { - text: string; -} -declare var Comment: { - prototype: Comment; - new(): Comment; -} - -interface PerformanceResourceTiming extends PerformanceEntry { - redirectStart: number; - redirectEnd: number; - domainLookupEnd: number; - responseStart: number; - domainLookupStart: number; - fetchStart: number; - requestStart: number; - connectEnd: number; - connectStart: number; - initiatorType: string; - responseEnd: number; -} -declare var PerformanceResourceTiming: { - prototype: PerformanceResourceTiming; - new(): PerformanceResourceTiming; -} - -interface CanvasPattern { -} -declare var CanvasPattern: { - prototype: CanvasPattern; - new(): CanvasPattern; -} - -interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { - /** - * Sets or retrieves the width of the object. - */ - width: number; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves whether the horizontal rule is drawn with 3-D shading. - */ - noShade: boolean; -} -declare var HTMLHRElement: { - prototype: HTMLHRElement; - new(): HTMLHRElement; -} - -interface HTMLObjectElement extends HTMLElement, GetSVGDocument, DOML2DeprecatedMarginStyle, DOML2DeprecatedBorderStyle, DOML2DeprecatedAlignmentStyle, MSDataBindingExtensions, MSDataBindingRecordSetExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Sets or retrieves the Internet media type for the code associated with the object. - */ - codeType: string; - /** - * Retrieves the contained object. - */ - object: any; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the URL of the file containing the compiled Java class. - */ - code: string; - /** - * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. - */ - archive: string; - /** - * Sets or retrieves a message to be displayed while an object is loading. - */ - standby: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves the class identifier for the object. - */ - classid: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Sets or retrieves the URL that references the data of the object. - */ - data: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Retrieves the document object of the page or frame. - */ - contentDocument: Document; - /** - * Gets or sets the optional alternative HTML script to execute if the object fails to load. - */ - altHtml: string; - /** - * Sets or retrieves the URL of the component. - */ - codeBase: string; - declare: boolean; - /** - * Sets or retrieves the MIME type of the object. - */ - type: string; - /** - * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. - */ - BaseHref: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - readyState: number; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLObjectElement: { - prototype: HTMLObjectElement; - new(): HTMLObjectElement; -} - -interface HTMLEmbedElement extends HTMLElement, GetSVGDocument { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Retrieves the palette used for the embedded document. - */ - palette: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - hidden: string; - /** - * Retrieves the URL of the plug-in used to view an embedded document. - */ - pluginspage: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Sets or retrieves the height and width units of the embed object. - */ - units: string; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - readyState: string; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; -} -declare var HTMLEmbedElement: { - prototype: HTMLEmbedElement; - new(): HTMLEmbedElement; -} - -interface StorageEvent extends Event { - oldValue: any; - newValue: any; - url: string; - storageArea: Storage; +interface KeyboardEvent extends UIEvent { + altKey: boolean; + char: string; + charCode: number; + ctrlKey: boolean; key: string; - initStorageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, keyArg: string, oldValueArg: any, newValueArg: any, urlArg: string, storageAreaArg: Storage): void; -} -declare var StorageEvent: { - prototype: StorageEvent; - new(): StorageEvent; + keyCode: number; + locale: string; + location: number; + metaKey: boolean; + repeat: boolean; + shiftKey: boolean; + which: number; + getModifierState(keyArg: string): boolean; + initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; + DOM_KEY_LOCATION_JOYSTICK: number; + DOM_KEY_LOCATION_LEFT: number; + DOM_KEY_LOCATION_MOBILE: number; + DOM_KEY_LOCATION_NUMPAD: number; + DOM_KEY_LOCATION_RIGHT: number; + DOM_KEY_LOCATION_STANDARD: number; } -interface CharacterData extends Node { - length: number; - data: string; - deleteData(offset: number, count: number): void; - replaceData(offset: number, count: number, arg: string): void; - appendData(arg: string): void; - insertData(offset: number, arg: string): void; - substringData(offset: number, count: number): string; -} -declare var CharacterData: { - prototype: CharacterData; - new(): CharacterData; +declare var KeyboardEvent: { + prototype: KeyboardEvent; + new(typeArg: string, eventInitDict?: KeyboardEventInit): KeyboardEvent; + DOM_KEY_LOCATION_JOYSTICK: number; + DOM_KEY_LOCATION_LEFT: number; + DOM_KEY_LOCATION_MOBILE: number; + DOM_KEY_LOCATION_NUMPAD: number; + DOM_KEY_LOCATION_RIGHT: number; + DOM_KEY_LOCATION_STANDARD: number; } -interface HTMLOptGroupElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the ordinal position of an option in a list box. - */ - index: number; - /** - * Sets or retrieves the status of an option. - */ - defaultSelected: boolean; - /** - * Sets or retrieves the text string specified by the option tag. - */ - text: string; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves a value that you can use to implement your own label functionality for the object. - */ - label: string; - /** - * Sets or retrieves whether the option in the list box is the default item. - */ - selected: boolean; -} -declare var HTMLOptGroupElement: { - prototype: HTMLOptGroupElement; - new(): HTMLOptGroupElement; -} - -interface HTMLIsIndexElement extends HTMLElement { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the URL to which the form content is sent for processing. - */ - action: string; - prompt: string; -} -declare var HTMLIsIndexElement: { - prototype: HTMLIsIndexElement; - new(): HTMLIsIndexElement; -} - -interface SVGPathSegLinetoRel extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegLinetoRel: { - prototype: SVGPathSegLinetoRel; - new(): SVGPathSegLinetoRel; -} - -interface DOMException { - code: number; - message: string; - name: string; +interface Location { + hash: string; + host: string; + hostname: string; + href: string; + origin: string; + pathname: string; + port: string; + protocol: string; + search: string; + assign(url: string): void; + reload(forcedReload?: boolean): void; + replace(url: string): void; toString(): string; - HIERARCHY_REQUEST_ERR: number; - NO_MODIFICATION_ALLOWED_ERR: number; - INVALID_MODIFICATION_ERR: number; - NAMESPACE_ERR: number; - INVALID_CHARACTER_ERR: number; - TYPE_MISMATCH_ERR: number; - ABORT_ERR: number; - INVALID_STATE_ERR: number; - SECURITY_ERR: number; - NETWORK_ERR: number; - WRONG_DOCUMENT_ERR: number; - QUOTA_EXCEEDED_ERR: number; - INDEX_SIZE_ERR: number; - DOMSTRING_SIZE_ERR: number; - SYNTAX_ERR: number; - SERIALIZE_ERR: number; - VALIDATION_ERR: number; - NOT_FOUND_ERR: number; - URL_MISMATCH_ERR: number; - PARSE_ERR: number; - NO_DATA_ALLOWED_ERR: number; - NOT_SUPPORTED_ERR: number; - INVALID_ACCESS_ERR: number; - INUSE_ATTRIBUTE_ERR: number; - INVALID_NODE_TYPE_ERR: number; - DATA_CLONE_ERR: number; - TIMEOUT_ERR: number; -} -declare var DOMException: { - prototype: DOMException; - new(): DOMException; - HIERARCHY_REQUEST_ERR: number; - NO_MODIFICATION_ALLOWED_ERR: number; - INVALID_MODIFICATION_ERR: number; - NAMESPACE_ERR: number; - INVALID_CHARACTER_ERR: number; - TYPE_MISMATCH_ERR: number; - ABORT_ERR: number; - INVALID_STATE_ERR: number; - SECURITY_ERR: number; - NETWORK_ERR: number; - WRONG_DOCUMENT_ERR: number; - QUOTA_EXCEEDED_ERR: number; - INDEX_SIZE_ERR: number; - DOMSTRING_SIZE_ERR: number; - SYNTAX_ERR: number; - SERIALIZE_ERR: number; - VALIDATION_ERR: number; - NOT_FOUND_ERR: number; - URL_MISMATCH_ERR: number; - PARSE_ERR: number; - NO_DATA_ALLOWED_ERR: number; - NOT_SUPPORTED_ERR: number; - INVALID_ACCESS_ERR: number; - INUSE_ATTRIBUTE_ERR: number; - INVALID_NODE_TYPE_ERR: number; - DATA_CLONE_ERR: number; - TIMEOUT_ERR: number; } -interface SVGAnimatedBoolean { - animVal: boolean; - baseVal: boolean; -} -declare var SVGAnimatedBoolean: { - prototype: SVGAnimatedBoolean; - new(): SVGAnimatedBoolean; +declare var Location: { + prototype: Location; + new(): Location; } -interface MSCompatibleInfoCollection { - length: number; - item(index: number): MSCompatibleInfo; -} -declare var MSCompatibleInfoCollection: { - prototype: MSCompatibleInfoCollection; - new(): MSCompatibleInfoCollection; +interface LongRunningScriptDetectedEvent extends Event { + executionTime: number; + stopPageScriptExecution: boolean; } -interface SVGSwitchElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGSwitchElement: { - prototype: SVGSwitchElement; - new(): SVGSwitchElement; +declare var LongRunningScriptDetectedEvent: { + prototype: LongRunningScriptDetectedEvent; + new(): LongRunningScriptDetectedEvent; } -interface SVGPreserveAspectRatio { - align: number; - meetOrSlice: number; - SVG_PRESERVEASPECTRATIO_NONE: number; - SVG_PRESERVEASPECTRATIO_XMINYMID: number; - SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - SVG_MEETORSLICE_UNKNOWN: number; - SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - SVG_PRESERVEASPECTRATIO_XMINYMIN: number; - SVG_MEETORSLICE_MEET: number; - SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - SVG_MEETORSLICE_SLICE: number; - SVG_PRESERVEASPECTRATIO_UNKNOWN: number; -} -declare var SVGPreserveAspectRatio: { - prototype: SVGPreserveAspectRatio; - new(): SVGPreserveAspectRatio; - SVG_PRESERVEASPECTRATIO_NONE: number; - SVG_PRESERVEASPECTRATIO_XMINYMID: number; - SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - SVG_MEETORSLICE_UNKNOWN: number; - SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - SVG_PRESERVEASPECTRATIO_XMINYMIN: number; - SVG_MEETORSLICE_MEET: number; - SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - SVG_MEETORSLICE_SLICE: number; - SVG_PRESERVEASPECTRATIO_UNKNOWN: number; +interface MSApp { + clearTemporaryWebDataAsync(): MSAppAsyncOperation; + createBlobFromRandomAccessStream(type: string, seeker: any): Blob; + createDataPackage(object: any): any; + createDataPackageFromSelection(): any; + createFileFromStorageFile(storageFile: any): File; + createStreamFromInputStream(type: string, inputStream: any): MSStream; + execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; + execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; + getCurrentPriority(): string; + getHtmlPrintDocumentSourceAsync(htmlDoc: any): any; + getViewId(view: any): any; + isTaskScheduledAtPriorityOrHigher(priority: string): boolean; + pageHandlesAllApplicationActivations(enabled: boolean): void; + suppressSubdownloadCredentialPrompts(suppress: boolean): void; + terminateApp(exceptionObject: any): void; + CURRENT: string; + HIGH: string; + IDLE: string; + NORMAL: string; } +declare var MSApp: MSApp; -interface Attr extends Node { - expando: boolean; - specified: boolean; - ownerElement: Element; - value: string; - name: string; -} -declare var Attr: { - prototype: Attr; - new(): Attr; -} - -interface PerformanceNavigation { - redirectCount: number; - type: number; - toJSON(): any; - TYPE_RELOAD: number; - TYPE_RESERVED: number; - TYPE_BACK_FORWARD: number; - TYPE_NAVIGATE: number; -} -declare var PerformanceNavigation: { - prototype: PerformanceNavigation; - new(): PerformanceNavigation; - TYPE_RELOAD: number; - TYPE_RESERVED: number; - TYPE_BACK_FORWARD: number; - TYPE_NAVIGATE: number; -} - -interface SVGStopElement extends SVGElement, SVGStylable { - offset: SVGAnimatedNumber; -} -declare var SVGStopElement: { - prototype: SVGStopElement; - new(): SVGStopElement; -} - -interface PositionCallback { - (position: Position): void; -} - -interface SVGSymbolElement extends SVGElement, SVGStylable, SVGLangSpace, SVGFitToViewBox, SVGExternalResourcesRequired { -} -declare var SVGSymbolElement: { - prototype: SVGSymbolElement; - new(): SVGSymbolElement; -} - -interface SVGElementInstanceList { - length: number; - item(index: number): SVGElementInstance; -} -declare var SVGElementInstanceList: { - prototype: SVGElementInstanceList; - new(): SVGElementInstanceList; -} - -interface CSSRuleList { - length: number; - item(index: number): CSSRule; - [index: number]: CSSRule; -} -declare var CSSRuleList: { - prototype: CSSRuleList; - new(): CSSRuleList; -} - -interface MSDataBindingRecordSetExtensions { - recordset: any; - namedRecordset(dataMember: string, hierarchy?: any): any; -} - -interface LinkStyle { - styleSheet: StyleSheet; - sheet: StyleSheet; -} - -interface HTMLVideoElement extends HTMLMediaElement { - /** - * Gets or sets the width of the video element. - */ - width: number; - /** - * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known. - */ - videoWidth: number; - /** - * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known. - */ - videoHeight: number; - /** - * Gets or sets the height of the video element. - */ - height: number; - /** - * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available. - */ - poster: string; - msIsStereo3D: boolean; - msStereo3DPackingMode: string; - onMSVideoOptimalLayoutChanged: (ev: any) => any; - onMSVideoFrameStepCompleted: (ev: any) => any; - msStereo3DRenderMode: string; - msIsLayoutOptimalForPlayback: boolean; - msHorizontalMirror: boolean; - onMSVideoFormatChanged: (ev: any) => any; - msZoom: boolean; - msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; - msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void; - msFrameStep(forward: boolean): void; - getVideoPlaybackQuality(): VideoPlaybackQuality; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; +interface MSAppAsyncOperation extends EventTarget { + error: DOMError; + oncomplete: (ev: Event) => any; + onerror: (ev: Event) => any; + readyState: number; + result: any; + start(): void; + COMPLETED: number; + ERROR: number; + STARTED: number; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoOptimalLayoutChanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoFrameStepCompleted", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoFormatChanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLVideoElement: { - prototype: HTMLVideoElement; - new(): HTMLVideoElement; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface ClientRectList { - length: number; - item(index: number): ClientRect; - [index: number]: ClientRect; -} -declare var ClientRectList: { - prototype: ClientRectList; - new(): ClientRectList; +declare var MSAppAsyncOperation: { + prototype: MSAppAsyncOperation; + new(): MSAppAsyncOperation; + COMPLETED: number; + ERROR: number; + STARTED: number; } -interface SVGMaskElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - maskUnits: SVGAnimatedEnumeration; - maskContentUnits: SVGAnimatedEnumeration; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGMaskElement: { - prototype: SVGMaskElement; - new(): SVGMaskElement; +interface MSBlobBuilder { + append(data: any, endings?: string): void; + getBlob(contentType?: string): Blob; } -interface External { -} -declare var External: { - prototype: External; - new(): External; +declare var MSBlobBuilder: { + prototype: MSBlobBuilder; + new(): MSBlobBuilder; } -interface MSGestureEvent extends UIEvent { - offsetY: number; - translationY: number; - velocityExpansion: number; - velocityY: number; - velocityAngular: number; - translationX: number; - velocityX: number; - hwTimestamp: number; - offsetX: number; - screenX: number; - rotation: number; - expansion: number; - clientY: number; - screenY: number; - scale: number; - gestureObject: any; - clientX: number; - initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void; - MSGESTURE_FLAG_BEGIN: number; - MSGESTURE_FLAG_END: number; - MSGESTURE_FLAG_CANCEL: number; - MSGESTURE_FLAG_INERTIA: number; - MSGESTURE_FLAG_NONE: number; -} -declare var MSGestureEvent: { - prototype: MSGestureEvent; - new(): MSGestureEvent; - MSGESTURE_FLAG_BEGIN: number; - MSGESTURE_FLAG_END: number; - MSGESTURE_FLAG_CANCEL: number; - MSGESTURE_FLAG_INERTIA: number; - MSGESTURE_FLAG_NONE: number; +interface MSCSSMatrix { + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + m11: number; + m12: number; + m13: number; + m14: number; + m21: number; + m22: number; + m23: number; + m24: number; + m31: number; + m32: number; + m33: number; + m34: number; + m41: number; + m42: number; + m43: number; + m44: number; + inverse(): MSCSSMatrix; + multiply(secondMatrix: MSCSSMatrix): MSCSSMatrix; + rotate(angleX: number, angleY?: number, angleZ?: number): MSCSSMatrix; + rotateAxisAngle(x: number, y: number, z: number, angle: number): MSCSSMatrix; + scale(scaleX: number, scaleY?: number, scaleZ?: number): MSCSSMatrix; + setMatrixValue(value: string): void; + skewX(angle: number): MSCSSMatrix; + skewY(angle: number): MSCSSMatrix; + toString(): string; + translate(x: number, y: number, z?: number): MSCSSMatrix; } -interface ErrorEvent extends Event { - colno: number; - filename: string; - error: any; - lineno: number; - message: string; - initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; -} -declare var ErrorEvent: { - prototype: ErrorEvent; - new(): ErrorEvent; -} - -interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - filterResX: SVGAnimatedInteger; - filterUnits: SVGAnimatedEnumeration; - primitiveUnits: SVGAnimatedEnumeration; - x: SVGAnimatedLength; - height: SVGAnimatedLength; - filterResY: SVGAnimatedInteger; - setFilterRes(filterResX: number, filterResY: number): void; -} -declare var SVGFilterElement: { - prototype: SVGFilterElement; - new(): SVGFilterElement; -} - -interface TrackEvent extends Event { - track: any; -} -declare var TrackEvent: { - prototype: TrackEvent; - new(): TrackEvent; -} - -interface SVGFEMergeNodeElement extends SVGElement { - in1: SVGAnimatedString; -} -declare var SVGFEMergeNodeElement: { - prototype: SVGFEMergeNodeElement; - new(): SVGFEMergeNodeElement; -} - -interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { -} -declare var SVGFEFloodElement: { - prototype: SVGFEFloodElement; - new(): SVGFEFloodElement; +declare var MSCSSMatrix: { + prototype: MSCSSMatrix; + new(text?: string): MSCSSMatrix; } interface MSGesture { @@ -14166,118 +12195,472 @@ interface MSGesture { addPointer(pointerId: number): void; stop(): void; } + declare var MSGesture: { prototype: MSGesture; new(): MSGesture; } -interface TextTrackCue extends EventTarget { - onenter: (ev: Event) => any; - track: TextTrack; - endTime: number; - text: string; - pauseOnExit: boolean; - id: string; - startTime: number; - onexit: (ev: Event) => any; - getCueAsHTML(): DocumentFragment; - addEventListener(type: "enter", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "exit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var TextTrackCue: { - prototype: TextTrackCue; - new(startTime: number, endTime: number, text: string): TextTrackCue; +interface MSGestureEvent extends UIEvent { + clientX: number; + clientY: number; + expansion: number; + gestureObject: any; + hwTimestamp: number; + offsetX: number; + offsetY: number; + rotation: number; + scale: number; + screenX: number; + screenY: number; + translationX: number; + translationY: number; + velocityAngular: number; + velocityExpansion: number; + velocityX: number; + velocityY: number; + initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void; + MSGESTURE_FLAG_BEGIN: number; + MSGESTURE_FLAG_CANCEL: number; + MSGESTURE_FLAG_END: number; + MSGESTURE_FLAG_INERTIA: number; + MSGESTURE_FLAG_NONE: number; } -interface MSStreamReader extends MSBaseReader { +declare var MSGestureEvent: { + prototype: MSGestureEvent; + new(): MSGestureEvent; + MSGESTURE_FLAG_BEGIN: number; + MSGESTURE_FLAG_CANCEL: number; + MSGESTURE_FLAG_END: number; + MSGESTURE_FLAG_INERTIA: number; + MSGESTURE_FLAG_NONE: number; +} + +interface MSGraphicsTrust { + constrictionActive: boolean; + status: string; +} + +declare var MSGraphicsTrust: { + prototype: MSGraphicsTrust; + new(): MSGraphicsTrust; +} + +interface MSHTMLWebViewElement extends HTMLElement { + canGoBack: boolean; + canGoForward: boolean; + containsFullScreenElement: boolean; + documentTitle: string; + height: number; + settings: MSWebViewSettings; + src: string; + width: number; + addWebAllowedObject(name: string, applicationObject: any): void; + buildLocalStreamUri(contentIdentifier: string, relativePath: string): string; + capturePreviewToBlobAsync(): MSWebViewAsyncOperation; + captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation; + getDeferredPermissionRequestById(id: number): DeferredPermissionRequest; + getDeferredPermissionRequests(): DeferredPermissionRequest[]; + goBack(): void; + goForward(): void; + invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation; + navigate(uri: string): void; + navigateToLocalStreamUri(source: string, streamResolver: any): void; + navigateToString(contents: string): void; + navigateWithHttpRequestMessage(requestMessage: any): void; + refresh(): void; + stop(): void; +} + +declare var MSHTMLWebViewElement: { + prototype: MSHTMLWebViewElement; + new(): MSHTMLWebViewElement; +} + +interface MSHeaderFooter { + URL: string; + dateLong: string; + dateShort: string; + font: string; + htmlFoot: string; + htmlHead: string; + page: number; + pageTotal: number; + textFoot: string; + textHead: string; + timeLong: string; + timeShort: string; + title: string; +} + +declare var MSHeaderFooter: { + prototype: MSHeaderFooter; + new(): MSHeaderFooter; +} + +interface MSInputMethodContext extends EventTarget { + compositionEndOffset: number; + compositionStartOffset: number; + oncandidatewindowhide: (ev: Event) => any; + oncandidatewindowshow: (ev: Event) => any; + oncandidatewindowupdate: (ev: Event) => any; + target: HTMLElement; + getCandidateWindowClientRect(): ClientRect; + getCompositionAlternatives(): string[]; + hasComposition(): boolean; + isCandidateWindowVisible(): boolean; + addEventListener(type: "MSCandidateWindowHide", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "MSCandidateWindowShow", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "MSCandidateWindowUpdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSInputMethodContext: { + prototype: MSInputMethodContext; + new(): MSInputMethodContext; +} + +interface MSManipulationEvent extends UIEvent { + currentState: number; + inertiaDestinationX: number; + inertiaDestinationY: number; + lastState: number; + initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void; + MS_MANIPULATION_STATE_ACTIVE: number; + MS_MANIPULATION_STATE_CANCELLED: number; + MS_MANIPULATION_STATE_COMMITTED: number; + MS_MANIPULATION_STATE_DRAGGING: number; + MS_MANIPULATION_STATE_INERTIA: number; + MS_MANIPULATION_STATE_PRESELECT: number; + MS_MANIPULATION_STATE_SELECTING: number; + MS_MANIPULATION_STATE_STOPPED: number; +} + +declare var MSManipulationEvent: { + prototype: MSManipulationEvent; + new(): MSManipulationEvent; + MS_MANIPULATION_STATE_ACTIVE: number; + MS_MANIPULATION_STATE_CANCELLED: number; + MS_MANIPULATION_STATE_COMMITTED: number; + MS_MANIPULATION_STATE_DRAGGING: number; + MS_MANIPULATION_STATE_INERTIA: number; + MS_MANIPULATION_STATE_PRESELECT: number; + MS_MANIPULATION_STATE_SELECTING: number; + MS_MANIPULATION_STATE_STOPPED: number; +} + +interface MSMediaKeyError { + code: number; + systemCode: number; + MS_MEDIA_KEYERR_CLIENT: number; + MS_MEDIA_KEYERR_DOMAIN: number; + MS_MEDIA_KEYERR_HARDWARECHANGE: number; + MS_MEDIA_KEYERR_OUTPUT: number; + MS_MEDIA_KEYERR_SERVICE: number; + MS_MEDIA_KEYERR_UNKNOWN: number; +} + +declare var MSMediaKeyError: { + prototype: MSMediaKeyError; + new(): MSMediaKeyError; + MS_MEDIA_KEYERR_CLIENT: number; + MS_MEDIA_KEYERR_DOMAIN: number; + MS_MEDIA_KEYERR_HARDWARECHANGE: number; + MS_MEDIA_KEYERR_OUTPUT: number; + MS_MEDIA_KEYERR_SERVICE: number; + MS_MEDIA_KEYERR_UNKNOWN: number; +} + +interface MSMediaKeyMessageEvent extends Event { + destinationURL: string; + message: Uint8Array; +} + +declare var MSMediaKeyMessageEvent: { + prototype: MSMediaKeyMessageEvent; + new(): MSMediaKeyMessageEvent; +} + +interface MSMediaKeyNeededEvent extends Event { + initData: Uint8Array; +} + +declare var MSMediaKeyNeededEvent: { + prototype: MSMediaKeyNeededEvent; + new(): MSMediaKeyNeededEvent; +} + +interface MSMediaKeySession extends EventTarget { + error: MSMediaKeyError; + keySystem: string; + sessionId: string; + close(): void; + update(key: Uint8Array): void; +} + +declare var MSMediaKeySession: { + prototype: MSMediaKeySession; + new(): MSMediaKeySession; +} + +interface MSMediaKeys { + keySystem: string; + createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession; +} + +declare var MSMediaKeys: { + prototype: MSMediaKeys; + new(keySystem: string): MSMediaKeys; + isTypeSupported(keySystem: string, type?: string): boolean; +} + +interface MSMimeTypesCollection { + length: number; +} + +declare var MSMimeTypesCollection: { + prototype: MSMimeTypesCollection; + new(): MSMimeTypesCollection; +} + +interface MSPluginsCollection { + length: number; + refresh(reload?: boolean): void; +} + +declare var MSPluginsCollection: { + prototype: MSPluginsCollection; + new(): MSPluginsCollection; +} + +interface MSPointerEvent extends MouseEvent { + currentPoint: any; + height: number; + hwTimestamp: number; + intermediatePoints: any; + isPrimary: boolean; + pointerId: number; + pointerType: any; + pressure: number; + rotation: number; + tiltX: number; + tiltY: number; + width: number; + getCurrentPoint(element: Element): void; + getIntermediatePoints(element: Element): void; + initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; +} + +declare var MSPointerEvent: { + prototype: MSPointerEvent; + new(typeArg: string, eventInitDict?: PointerEventInit): MSPointerEvent; +} + +interface MSPrintManagerTemplatePrinter extends MSTemplatePrinter, EventTarget { + percentScale: number; + showHeaderFooter: boolean; + shrinkToFit: boolean; + drawPreviewPage(element: HTMLElement, pageNumber: number): void; + endPrint(): void; + getPrintTaskOptionValue(key: string): any; + invalidatePreview(): void; + setPageCount(pageCount: number): void; + startPrint(): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSPrintManagerTemplatePrinter: { + prototype: MSPrintManagerTemplatePrinter; + new(): MSPrintManagerTemplatePrinter; +} + +interface MSRangeCollection { + length: number; + item(index: number): Range; + [index: number]: Range; +} + +declare var MSRangeCollection: { + prototype: MSRangeCollection; + new(): MSRangeCollection; +} + +interface MSSiteModeEvent extends Event { + actionURL: string; + buttonID: number; +} + +declare var MSSiteModeEvent: { + prototype: MSSiteModeEvent; + new(): MSSiteModeEvent; +} + +interface MSStream { + type: string; + msClose(): void; + msDetachStream(): any; +} + +declare var MSStream: { + prototype: MSStream; + new(): MSStream; +} + +interface MSStreamReader extends EventTarget, MSBaseReader { error: DOMError; readAsArrayBuffer(stream: MSStream, size?: number): void; + readAsBinaryString(stream: MSStream, size?: number): void; readAsBlob(stream: MSStream, size?: number): void; readAsDataURL(stream: MSStream, size?: number): void; readAsText(stream: MSStream, encoding?: string, size?: number): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var MSStreamReader: { prototype: MSStreamReader; new(): MSStreamReader; } -interface DOMTokenList { +interface MSTemplatePrinter { + collate: boolean; + copies: number; + currentPage: boolean; + currentPageAvail: boolean; + duplex: boolean; + footer: string; + frameActive: boolean; + frameActiveEnabled: boolean; + frameAsShown: boolean; + framesetDocument: boolean; + header: string; + headerFooterFont: string; + marginBottom: number; + marginLeft: number; + marginRight: number; + marginTop: number; + orientation: string; + pageFrom: number; + pageHeight: number; + pageTo: number; + pageWidth: number; + selectedPages: boolean; + selection: boolean; + selectionEnabled: boolean; + unprintableBottom: number; + unprintableLeft: number; + unprintableRight: number; + unprintableTop: number; + usePrinterCopyCollate: boolean; + createHeaderFooter(): MSHeaderFooter; + deviceSupports(property: string): any; + ensurePrintDialogDefaults(): boolean; + getPageMarginBottom(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; + getPageMarginBottomImportant(pageRule: CSSPageRule): boolean; + getPageMarginLeft(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; + getPageMarginLeftImportant(pageRule: CSSPageRule): boolean; + getPageMarginRight(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; + getPageMarginRightImportant(pageRule: CSSPageRule): boolean; + getPageMarginTop(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; + getPageMarginTopImportant(pageRule: CSSPageRule): boolean; + printBlankPage(): void; + printNonNative(document: any): boolean; + printNonNativeFrames(document: any, activeFrame: boolean): void; + printPage(element: HTMLElement): void; + showPageSetupDialog(): boolean; + showPrintDialog(): boolean; + startDoc(title: string): boolean; + stopDoc(): void; + updatePageStatus(status: number): void; +} + +declare var MSTemplatePrinter: { + prototype: MSTemplatePrinter; + new(): MSTemplatePrinter; +} + +interface MSWebViewAsyncOperation extends EventTarget { + error: DOMError; + oncomplete: (ev: Event) => any; + onerror: (ev: Event) => any; + readyState: number; + result: any; + target: MSHTMLWebViewElement; + type: number; + start(): void; + COMPLETED: number; + ERROR: number; + STARTED: number; + TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; + TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; + TYPE_INVOKE_SCRIPT: number; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSWebViewAsyncOperation: { + prototype: MSWebViewAsyncOperation; + new(): MSWebViewAsyncOperation; + COMPLETED: number; + ERROR: number; + STARTED: number; + TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; + TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; + TYPE_INVOKE_SCRIPT: number; +} + +interface MSWebViewSettings { + isIndexedDBEnabled: boolean; + isJavaScriptEnabled: boolean; +} + +declare var MSWebViewSettings: { + prototype: MSWebViewSettings; + new(): MSWebViewSettings; +} + +interface MediaElementAudioSourceNode extends AudioNode { +} + +declare var MediaElementAudioSourceNode: { + prototype: MediaElementAudioSourceNode; + new(): MediaElementAudioSourceNode; +} + +interface MediaError { + code: number; + msExtendedCode: number; + MEDIA_ERR_ABORTED: number; + MEDIA_ERR_DECODE: number; + MEDIA_ERR_NETWORK: number; + MEDIA_ERR_SRC_NOT_SUPPORTED: number; + MS_MEDIA_ERR_ENCRYPTED: number; +} + +declare var MediaError: { + prototype: MediaError; + new(): MediaError; + MEDIA_ERR_ABORTED: number; + MEDIA_ERR_DECODE: number; + MEDIA_ERR_NETWORK: number; + MEDIA_ERR_SRC_NOT_SUPPORTED: number; + MS_MEDIA_ERR_ENCRYPTED: number; +} + +interface MediaList { length: number; - contains(token: string): boolean; - remove(token: string): void; - toggle(token: string): boolean; - add(token: string): void; + mediaText: string; + appendMedium(newMedium: string): void; + deleteMedium(oldMedium: string): void; item(index: number): string; - [index: number]: string; toString(): string; -} -declare var DOMTokenList: { - prototype: DOMTokenList; - new(): DOMTokenList; + [index: number]: string; } -interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncAElement: { - prototype: SVGFEFuncAElement; - new(): SVGFEFuncAElement; -} - -interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; -} -declare var SVGFETileElement: { - prototype: SVGFETileElement; - new(): SVGFETileElement; -} - -interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in2: SVGAnimatedString; - mode: SVGAnimatedEnumeration; - in1: SVGAnimatedString; - SVG_FEBLEND_MODE_DARKEN: number; - SVG_FEBLEND_MODE_UNKNOWN: number; - SVG_FEBLEND_MODE_MULTIPLY: number; - SVG_FEBLEND_MODE_NORMAL: number; - SVG_FEBLEND_MODE_SCREEN: number; - SVG_FEBLEND_MODE_LIGHTEN: number; -} -declare var SVGFEBlendElement: { - prototype: SVGFEBlendElement; - new(): SVGFEBlendElement; - SVG_FEBLEND_MODE_DARKEN: number; - SVG_FEBLEND_MODE_UNKNOWN: number; - SVG_FEBLEND_MODE_MULTIPLY: number; - SVG_FEBLEND_MODE_NORMAL: number; - SVG_FEBLEND_MODE_SCREEN: number; - SVG_FEBLEND_MODE_LIGHTEN: number; -} - -interface MessageChannel { - port2: MessagePort; - port1: MessagePort; -} -declare var MessageChannel: { - prototype: MessageChannel; - new(): MessageChannel; -} - -interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { -} -declare var SVGFEMergeElement: { - prototype: SVGFEMergeElement; - new(): SVGFEMergeElement; -} - -interface TransitionEvent extends Event { - propertyName: string; - elapsedTime: number; - initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void; -} -declare var TransitionEvent: { - prototype: TransitionEvent; - new(): TransitionEvent; +declare var MediaList: { + prototype: MediaList; + new(): MediaList; } interface MediaQueryList { @@ -14286,734 +12669,49 @@ interface MediaQueryList { addListener(listener: MediaQueryListListener): void; removeListener(listener: MediaQueryListListener): void; } + declare var MediaQueryList: { prototype: MediaQueryList; new(): MediaQueryList; } -interface DOMError { - name: string; - toString(): string; -} -declare var DOMError: { - prototype: DOMError; - new(): DOMError; -} - -interface CloseEvent extends Event { - wasClean: boolean; - reason: string; - code: number; - initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; -} -declare var CloseEvent: { - prototype: CloseEvent; - new(): CloseEvent; -} - -interface WebSocket extends EventTarget { - protocol: string; - readyState: number; - bufferedAmount: number; - onopen: (ev: Event) => any; - extensions: string; - onmessage: (ev: MessageEvent) => any; - onclose: (ev: CloseEvent) => any; - onerror: (ev: ErrorEvent) => any; - binaryType: string; - url: string; - close(code?: number, reason?: string): void; - send(data: any): void; - OPEN: number; - CLOSING: number; - CONNECTING: number; - CLOSED: number; - addEventListener(type: "open", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "close", listener: (ev: CloseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var WebSocket: { - prototype: WebSocket; - new(url: string, protocols?: string): WebSocket; - new(url: string, protocols?: string[]): WebSocket; - OPEN: number; - CLOSING: number; - CONNECTING: number; - CLOSED: number; -} - -interface SVGFEPointLightElement extends SVGElement { - y: SVGAnimatedNumber; - x: SVGAnimatedNumber; - z: SVGAnimatedNumber; -} -declare var SVGFEPointLightElement: { - prototype: SVGFEPointLightElement; - new(): SVGFEPointLightElement; -} - -interface ProgressEvent extends Event { - loaded: number; - lengthComputable: boolean; - total: number; - initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; -} -declare var ProgressEvent: { - prototype: ProgressEvent; - new(): ProgressEvent; -} - -interface IDBObjectStore { - indexNames: DOMStringList; - name: string; - transaction: IDBTransaction; - keyPath: string; - count(key?: any): IDBRequest; - add(value: any, key?: any): IDBRequest; - clear(): IDBRequest; - createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; - put(value: any, key?: any): IDBRequest; - openCursor(range?: any, direction?: string): IDBRequest; - deleteIndex(indexName: string): void; - index(name: string): IDBIndex; - get(key: any): IDBRequest; - delete(key: any): IDBRequest; -} -declare var IDBObjectStore: { - prototype: IDBObjectStore; - new(): IDBObjectStore; -} - -interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - stdDeviationX: SVGAnimatedNumber; - in1: SVGAnimatedString; - stdDeviationY: SVGAnimatedNumber; - setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; -} -declare var SVGFEGaussianBlurElement: { - prototype: SVGFEGaussianBlurElement; - new(): SVGFEGaussianBlurElement; -} - -interface SVGFilterPrimitiveStandardAttributes extends SVGStylable { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - height: SVGAnimatedLength; - result: SVGAnimatedString; -} - -interface IDBVersionChangeEvent extends Event { - newVersion: number; - oldVersion: number; -} -declare var IDBVersionChangeEvent: { - prototype: IDBVersionChangeEvent; - new(): IDBVersionChangeEvent; -} - -interface IDBIndex { - unique: boolean; - name: string; - keyPath: string; - objectStore: IDBObjectStore; - count(key?: any): IDBRequest; - getKey(key: any): IDBRequest; - openKeyCursor(range?: IDBKeyRange, direction?: string): IDBRequest; - get(key: any): IDBRequest; - openCursor(range?: IDBKeyRange, direction?: string): IDBRequest; -} -declare var IDBIndex: { - prototype: IDBIndex; - new(): IDBIndex; -} - -interface FileList { - length: number; - item(index: number): File; - [index: number]: File; -} -declare var FileList: { - prototype: FileList; - new(): FileList; -} - -interface IDBCursor { - source: any; - direction: string; - key: any; - primaryKey: any; - advance(count: number): void; - delete(): IDBRequest; - continue(key?: any): void; - update(value: any): IDBRequest; - PREV: string; - PREV_NO_DUPLICATE: string; - NEXT: string; - NEXT_NO_DUPLICATE: string; -} -declare var IDBCursor: { - prototype: IDBCursor; - new(): IDBCursor; - PREV: string; - PREV_NO_DUPLICATE: string; - NEXT: string; - NEXT_NO_DUPLICATE: string; -} - -interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - kernelUnitLengthY: SVGAnimatedNumber; - surfaceScale: SVGAnimatedNumber; - specularExponent: SVGAnimatedNumber; - in1: SVGAnimatedString; - kernelUnitLengthX: SVGAnimatedNumber; - specularConstant: SVGAnimatedNumber; -} -declare var SVGFESpecularLightingElement: { - prototype: SVGFESpecularLightingElement; - new(): SVGFESpecularLightingElement; -} - -interface File extends Blob { - lastModifiedDate: any; - name: string; -} -declare var File: { - prototype: File; - new(): File; -} - -interface URL { - revokeObjectURL(url: string): void; - createObjectURL(object: any, options?: ObjectURLOptions): string; -} -declare var URL: URL; - -interface IDBCursorWithValue extends IDBCursor { - value: any; -} -declare var IDBCursorWithValue: { - prototype: IDBCursorWithValue; - new(): IDBCursorWithValue; -} - -interface XMLHttpRequestEventTarget extends EventTarget { - onprogress: (ev: ProgressEvent) => any; - onerror: (ev: ErrorEvent) => any; - onload: (ev: Event) => any; - ontimeout: (ev: Event) => any; - onabort: (ev: UIEvent) => any; - onloadstart: (ev: Event) => any; - onloadend: (ev: ProgressEvent) => any; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var XMLHttpRequestEventTarget: { - prototype: XMLHttpRequestEventTarget; - new(): XMLHttpRequestEventTarget; -} - -interface IDBEnvironment { - msIndexedDB: IDBFactory; - indexedDB: IDBFactory; -} - -interface AudioTrackList extends EventTarget { - length: number; - onchange: (ev: Event) => any; - onaddtrack: (ev: TrackEvent) => any; - onremovetrack: (ev: any /*PluginArray*/) => any; - getTrackById(id: string): AudioTrack; - item(index: number): AudioTrack; - [index: number]: AudioTrack; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: "removetrack", listener: (ev: any /*PluginArray*/) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var AudioTrackList: { - prototype: AudioTrackList; - new(): AudioTrackList; -} - -interface MSBaseReader extends EventTarget { - onprogress: (ev: ProgressEvent) => any; - readyState: number; - onabort: (ev: UIEvent) => any; - onloadend: (ev: ProgressEvent) => any; - onerror: (ev: ErrorEvent) => any; - onload: (ev: Event) => any; - onloadstart: (ev: Event) => any; - result: any; - abort(): void; - LOADING: number; - EMPTY: number; - DONE: number; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - operator: SVGAnimatedEnumeration; - radiusX: SVGAnimatedNumber; - radiusY: SVGAnimatedNumber; - in1: SVGAnimatedString; - SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; - SVG_MORPHOLOGY_OPERATOR_ERODE: number; - SVG_MORPHOLOGY_OPERATOR_DILATE: number; -} -declare var SVGFEMorphologyElement: { - prototype: SVGFEMorphologyElement; - new(): SVGFEMorphologyElement; - SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; - SVG_MORPHOLOGY_OPERATOR_ERODE: number; - SVG_MORPHOLOGY_OPERATOR_DILATE: number; -} - -interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncRElement: { - prototype: SVGFEFuncRElement; - new(): SVGFEFuncRElement; -} - -interface WindowTimersExtension { - msSetImmediate(expression: any, ...args: any[]): number; - clearImmediate(handle: number): void; - msClearImmediate(handle: number): void; - setImmediate(expression: any, ...args: any[]): number; -} - -interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in2: SVGAnimatedString; - xChannelSelector: SVGAnimatedEnumeration; - yChannelSelector: SVGAnimatedEnumeration; - scale: SVGAnimatedNumber; - in1: SVGAnimatedString; - SVG_CHANNEL_B: number; - SVG_CHANNEL_R: number; - SVG_CHANNEL_G: number; - SVG_CHANNEL_UNKNOWN: number; - SVG_CHANNEL_A: number; -} -declare var SVGFEDisplacementMapElement: { - prototype: SVGFEDisplacementMapElement; - new(): SVGFEDisplacementMapElement; - SVG_CHANNEL_B: number; - SVG_CHANNEL_R: number; - SVG_CHANNEL_G: number; - SVG_CHANNEL_UNKNOWN: number; - SVG_CHANNEL_A: number; -} - -interface AnimationEvent extends Event { - animationName: string; - elapsedTime: number; - initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void; -} -declare var AnimationEvent: { - prototype: AnimationEvent; - new(): AnimationEvent; -} - -interface SVGComponentTransferFunctionElement extends SVGElement { - tableValues: SVGAnimatedNumberList; - slope: SVGAnimatedNumber; - type: SVGAnimatedEnumeration; - exponent: SVGAnimatedNumber; - amplitude: SVGAnimatedNumber; - intercept: SVGAnimatedNumber; - offset: SVGAnimatedNumber; - SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; - SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; -} -declare var SVGComponentTransferFunctionElement: { - prototype: SVGComponentTransferFunctionElement; - new(): SVGComponentTransferFunctionElement; - SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; - SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; -} - -interface MSRangeCollection { - length: number; - item(index: number): Range; - [index: number]: Range; -} -declare var MSRangeCollection: { - prototype: MSRangeCollection; - new(): MSRangeCollection; -} - -interface SVGFEDistantLightElement extends SVGElement { - azimuth: SVGAnimatedNumber; - elevation: SVGAnimatedNumber; -} -declare var SVGFEDistantLightElement: { - prototype: SVGFEDistantLightElement; - new(): SVGFEDistantLightElement; -} - -interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncBElement: { - prototype: SVGFEFuncBElement; - new(): SVGFEFuncBElement; -} - -interface IDBKeyRange { - upper: any; - upperOpen: boolean; - lower: any; - lowerOpen: boolean; -} -declare var IDBKeyRange: { - prototype: IDBKeyRange; - new(): IDBKeyRange; - bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; - only(value: any): IDBKeyRange; - lowerBound(bound: any, open?: boolean): IDBKeyRange; - upperBound(bound: any, open?: boolean): IDBKeyRange; -} - -interface WindowConsole { - console: Console; -} - -interface IDBTransaction extends EventTarget { - oncomplete: (ev: Event) => any; - db: IDBDatabase; - mode: string; - error: DOMError; - onerror: (ev: ErrorEvent) => any; - onabort: (ev: UIEvent) => any; - abort(): void; - objectStore(name: string): IDBObjectStore; - READ_ONLY: string; - VERSION_CHANGE: string; - READ_WRITE: string; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBTransaction: { - prototype: IDBTransaction; - new(): IDBTransaction; - READ_ONLY: string; - VERSION_CHANGE: string; - READ_WRITE: string; -} - -interface AudioTrack { - kind: string; - language: string; - id: string; - label: string; - enabled: boolean; - sourceBuffer: SourceBuffer; -} -declare var AudioTrack: { - prototype: AudioTrack; - new(): AudioTrack; -} - -interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - orderY: SVGAnimatedInteger; - kernelUnitLengthY: SVGAnimatedNumber; - orderX: SVGAnimatedInteger; - preserveAlpha: SVGAnimatedBoolean; - kernelMatrix: SVGAnimatedNumberList; - edgeMode: SVGAnimatedEnumeration; - kernelUnitLengthX: SVGAnimatedNumber; - bias: SVGAnimatedNumber; - targetX: SVGAnimatedInteger; - targetY: SVGAnimatedInteger; - divisor: SVGAnimatedNumber; - in1: SVGAnimatedString; - SVG_EDGEMODE_WRAP: number; - SVG_EDGEMODE_DUPLICATE: number; - SVG_EDGEMODE_UNKNOWN: number; - SVG_EDGEMODE_NONE: number; -} -declare var SVGFEConvolveMatrixElement: { - prototype: SVGFEConvolveMatrixElement; - new(): SVGFEConvolveMatrixElement; - SVG_EDGEMODE_WRAP: number; - SVG_EDGEMODE_DUPLICATE: number; - SVG_EDGEMODE_UNKNOWN: number; - SVG_EDGEMODE_NONE: number; -} - -interface TextTrackCueList { - length: number; - item(index: number): TextTrackCue; - [index: number]: TextTrackCue; - getCueById(id: string): TextTrackCue; -} -declare var TextTrackCueList: { - prototype: TextTrackCueList; - new(): TextTrackCueList; -} - -interface CSSKeyframesRule extends CSSRule { - name: string; - cssRules: CSSRuleList; - findRule(rule: string): CSSKeyframeRule; - deleteRule(rule: string): void; - appendRule(rule: string): void; -} -declare var CSSKeyframesRule: { - prototype: CSSKeyframesRule; - new(): CSSKeyframesRule; -} - -interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - baseFrequencyX: SVGAnimatedNumber; - numOctaves: SVGAnimatedInteger; - type: SVGAnimatedEnumeration; - baseFrequencyY: SVGAnimatedNumber; - stitchTiles: SVGAnimatedEnumeration; - seed: SVGAnimatedNumber; - SVG_STITCHTYPE_UNKNOWN: number; - SVG_STITCHTYPE_NOSTITCH: number; - SVG_TURBULENCE_TYPE_UNKNOWN: number; - SVG_TURBULENCE_TYPE_TURBULENCE: number; - SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - SVG_STITCHTYPE_STITCH: number; -} -declare var SVGFETurbulenceElement: { - prototype: SVGFETurbulenceElement; - new(): SVGFETurbulenceElement; - SVG_STITCHTYPE_UNKNOWN: number; - SVG_STITCHTYPE_NOSTITCH: number; - SVG_TURBULENCE_TYPE_UNKNOWN: number; - SVG_TURBULENCE_TYPE_TURBULENCE: number; - SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - SVG_STITCHTYPE_STITCH: number; -} - -interface TextTrackList extends EventTarget { - length: number; - onaddtrack: (ev: TrackEvent) => any; - item(index: number): TextTrack; - [index: number]: TextTrack; - addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var TextTrackList: { - prototype: TextTrackList; - new(): TextTrackList; -} - -interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncGElement: { - prototype: SVGFEFuncGElement; - new(): SVGFEFuncGElement; -} - -interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; - type: SVGAnimatedEnumeration; - values: SVGAnimatedNumberList; - SVG_FECOLORMATRIX_TYPE_SATURATE: number; - SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; - SVG_FECOLORMATRIX_TYPE_MATRIX: number; - SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; -} -declare var SVGFEColorMatrixElement: { - prototype: SVGFEColorMatrixElement; - new(): SVGFEColorMatrixElement; - SVG_FECOLORMATRIX_TYPE_SATURATE: number; - SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; - SVG_FECOLORMATRIX_TYPE_MATRIX: number; - SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; -} - -interface SVGFESpotLightElement extends SVGElement { - pointsAtY: SVGAnimatedNumber; - y: SVGAnimatedNumber; - limitingConeAngle: SVGAnimatedNumber; - specularExponent: SVGAnimatedNumber; - x: SVGAnimatedNumber; - pointsAtZ: SVGAnimatedNumber; - z: SVGAnimatedNumber; - pointsAtX: SVGAnimatedNumber; -} -declare var SVGFESpotLightElement: { - prototype: SVGFESpotLightElement; - new(): SVGFESpotLightElement; -} - -interface WindowBase64 { - btoa(rawString: string): string; - atob(encodedString: string): string; -} - -interface IDBDatabase extends EventTarget { - version: string; - name: string; - objectStoreNames: DOMStringList; - onerror: (ev: ErrorEvent) => any; - onabort: (ev: UIEvent) => any; - createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; - close(): void; - transaction(storeNames: any, mode?: string): IDBTransaction; - deleteObjectStore(name: string): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBDatabase: { - prototype: IDBDatabase; - new(): IDBDatabase; -} - -interface DOMStringList { - length: number; - contains(str: string): boolean; - item(index: number): string; - [index: number]: string; -} -declare var DOMStringList: { - prototype: DOMStringList; - new(): DOMStringList; -} - -interface IDBOpenDBRequest extends IDBRequest { - onupgradeneeded: (ev: IDBVersionChangeEvent) => any; - onblocked: (ev: Event) => any; - addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "upgradeneeded", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blocked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBOpenDBRequest: { - prototype: IDBOpenDBRequest; - new(): IDBOpenDBRequest; -} - -interface HTMLProgressElement extends HTMLElement { - /** - * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value. - */ - value: number; - /** - * Defines the maximum, or "done" value for a progress element. - */ - max: number; - /** - * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar). - */ - position: number; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; -} -declare var HTMLProgressElement: { - prototype: HTMLProgressElement; - new(): HTMLProgressElement; -} - -interface MSLaunchUriCallback { - (): void; -} - -interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - dy: SVGAnimatedNumber; - in1: SVGAnimatedString; - dx: SVGAnimatedNumber; -} -declare var SVGFEOffsetElement: { - prototype: SVGFEOffsetElement; - new(): SVGFEOffsetElement; -} - -interface MSUnsafeFunctionCallback { - (): any; -} - -interface TextTrack extends EventTarget { - language: string; - mode: any; - readyState: number; - activeCues: TextTrackCueList; - cues: TextTrackCueList; - oncuechange: (ev: Event) => any; - kind: string; - onload: (ev: Event) => any; - onerror: (ev: ErrorEvent) => any; - label: string; - addCue(cue: TextTrackCue): void; - removeCue(cue: TextTrackCue): void; - ERROR: number; - SHOWING: number; - LOADING: number; - LOADED: number; - NONE: number; - HIDDEN: number; - DISABLED: number; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var TextTrack: { - prototype: TextTrack; - new(): TextTrack; - ERROR: number; - SHOWING: number; - LOADING: number; - LOADED: number; - NONE: number; - HIDDEN: number; - DISABLED: number; -} - -interface MediaQueryListListener { - (mql: MediaQueryList): void; -} - -interface IDBRequest extends EventTarget { - source: any; - onsuccess: (ev: Event) => any; - error: DOMError; - transaction: IDBTransaction; - onerror: (ev: ErrorEvent) => any; +interface MediaSource extends EventTarget { + activeSourceBuffers: SourceBufferList; + duration: number; readyState: string; - result: any; - addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + sourceBuffers: SourceBufferList; + addSourceBuffer(type: string): SourceBuffer; + endOfStream(error?: string): void; + removeSourceBuffer(sourceBuffer: SourceBuffer): void; } -declare var IDBRequest: { - prototype: IDBRequest; - new(): IDBRequest; + +declare var MediaSource: { + prototype: MediaSource; + new(): MediaSource; + isTypeSupported(type: string): boolean; +} + +interface MessageChannel { + port1: MessagePort; + port2: MessagePort; +} + +declare var MessageChannel: { + prototype: MessageChannel; + new(): MessageChannel; +} + +interface MessageEvent extends Event { + data: any; + origin: string; + ports: any; + source: Window; + initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void; +} + +declare var MessageEvent: { + prototype: MessageEvent; + new(): MessageEvent; } interface MessagePort extends EventTarget { @@ -15022,2178 +12720,5250 @@ interface MessagePort extends EventTarget { postMessage(message?: any, ports?: any): void; start(): void; addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var MessagePort: { prototype: MessagePort; new(): MessagePort; } -interface FileReader extends MSBaseReader { - error: DOMError; - readAsArrayBuffer(blob: Blob): void; - readAsDataURL(blob: Blob): void; - readAsText(blob: Blob, encoding?: string): void; -} -declare var FileReader: { - prototype: FileReader; - new(): FileReader; +interface MimeType { + description: string; + enabledPlugin: Plugin; + suffixes: string; + type: string; } -interface ApplicationCache extends EventTarget { - status: number; - ondownloading: (ev: Event) => any; - onprogress: (ev: ProgressEvent) => any; - onupdateready: (ev: Event) => any; - oncached: (ev: Event) => any; - onobsolete: (ev: Event) => any; - onerror: (ev: ErrorEvent) => any; - onchecking: (ev: Event) => any; - onnoupdate: (ev: Event) => any; - swapCache(): void; - abort(): void; - update(): void; - CHECKING: number; - UNCACHED: number; - UPDATEREADY: number; - DOWNLOADING: number; - IDLE: number; - OBSOLETE: number; - addEventListener(type: "downloading", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "updateready", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cached", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "obsolete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "checking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "noupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var ApplicationCache: { - prototype: ApplicationCache; - new(): ApplicationCache; - CHECKING: number; - UNCACHED: number; - UPDATEREADY: number; - DOWNLOADING: number; - IDLE: number; - OBSOLETE: number; +declare var MimeType: { + prototype: MimeType; + new(): MimeType; } -interface FrameRequestCallback { - (time: number): void; +interface MimeTypeArray { + length: number; + item(index: number): Plugin; + namedItem(type: string): Plugin; + [index: number]: Plugin; +} + +declare var MimeTypeArray: { + prototype: MimeTypeArray; + new(): MimeTypeArray; +} + +interface MouseEvent extends UIEvent { + altKey: boolean; + button: number; + buttons: number; + clientX: number; + clientY: number; + ctrlKey: boolean; + fromElement: Element; + layerX: number; + layerY: number; + metaKey: boolean; + movementX: number; + movementY: number; + offsetX: number; + offsetY: number; + pageX: number; + pageY: number; + relatedTarget: EventTarget; + screenX: number; + screenY: number; + shiftKey: boolean; + toElement: Element; + which: number; + x: number; + y: number; + getModifierState(keyArg: string): boolean; + initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget): void; +} + +declare var MouseEvent: { + prototype: MouseEvent; + new(typeArg: string, eventInitDict?: MouseEventInit): MouseEvent; +} + +interface MouseWheelEvent extends MouseEvent { + wheelDelta: number; + wheelDeltaX: number; + wheelDeltaY: number; + initMouseWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, wheelDeltaArg: number): void; +} + +declare var MouseWheelEvent: { + prototype: MouseWheelEvent; + new(): MouseWheelEvent; +} + +interface MutationEvent extends Event { + attrChange: number; + attrName: string; + newValue: string; + prevValue: string; + relatedNode: Node; + initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; + ADDITION: number; + MODIFICATION: number; + REMOVAL: number; +} + +declare var MutationEvent: { + prototype: MutationEvent; + new(): MutationEvent; + ADDITION: number; + MODIFICATION: number; + REMOVAL: number; +} + +interface MutationObserver { + disconnect(): void; + observe(target: Node, options: MutationObserverInit): void; + takeRecords(): MutationRecord[]; +} + +declare var MutationObserver: { + prototype: MutationObserver; + new(callback: MutationCallback): MutationObserver; +} + +interface MutationRecord { + addedNodes: NodeList; + attributeName: string; + attributeNamespace: string; + nextSibling: Node; + oldValue: string; + previousSibling: Node; + removedNodes: NodeList; + target: Node; + type: string; +} + +declare var MutationRecord: { + prototype: MutationRecord; + new(): MutationRecord; +} + +interface NamedNodeMap { + length: number; + getNamedItem(name: string): Attr; + getNamedItemNS(namespaceURI: string, localName: string): Attr; + item(index: number): Attr; + removeNamedItem(name: string): Attr; + removeNamedItemNS(namespaceURI: string, localName: string): Attr; + setNamedItem(arg: Attr): Attr; + setNamedItemNS(arg: Attr): Attr; + [index: number]: Attr; +} + +declare var NamedNodeMap: { + prototype: NamedNodeMap; + new(): NamedNodeMap; +} + +interface NavigationCompletedEvent extends NavigationEvent { + isSuccess: boolean; + webErrorStatus: number; +} + +declare var NavigationCompletedEvent: { + prototype: NavigationCompletedEvent; + new(): NavigationCompletedEvent; +} + +interface NavigationEvent extends Event { + uri: string; +} + +declare var NavigationEvent: { + prototype: NavigationEvent; + new(): NavigationEvent; +} + +interface NavigationEventWithReferrer extends NavigationEvent { + referer: string; +} + +declare var NavigationEventWithReferrer: { + prototype: NavigationEventWithReferrer; + new(): NavigationEventWithReferrer; +} + +interface Navigator extends Object, NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, NavigatorGeolocation, MSNavigatorDoNotTrack, MSFileSaver { + appCodeName: string; + appMinorVersion: string; + browserLanguage: string; + connectionSpeed: number; + cookieEnabled: boolean; + cpuClass: string; + language: string; + maxTouchPoints: number; + mimeTypes: MSMimeTypesCollection; + msManipulationViewsEnabled: boolean; + msMaxTouchPoints: number; + msPointerEnabled: boolean; + plugins: MSPluginsCollection; + pointerEnabled: boolean; + systemLanguage: string; + userLanguage: string; + webdriver: boolean; + getGamepads(): Gamepad[]; + javaEnabled(): boolean; + msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Navigator: { + prototype: Navigator; + new(): Navigator; +} + +interface Node extends EventTarget { + attributes: NamedNodeMap; + baseURI: string; + childNodes: NodeList; + firstChild: Node; + lastChild: Node; + localName: string; + namespaceURI: string; + nextSibling: Node; + nodeName: string; + nodeType: number; + nodeValue: string; + ownerDocument: Document; + parentElement: HTMLElement; + parentNode: Node; + prefix: string; + previousSibling: Node; + textContent: string; + appendChild(newChild: Node): Node; + cloneNode(deep?: boolean): Node; + compareDocumentPosition(other: Node): number; + hasAttributes(): boolean; + hasChildNodes(): boolean; + insertBefore(newChild: Node, refChild?: Node): Node; + isDefaultNamespace(namespaceURI: string): boolean; + isEqualNode(arg: Node): boolean; + isSameNode(other: Node): boolean; + lookupNamespaceURI(prefix: string): string; + lookupPrefix(namespaceURI: string): string; + normalize(): void; + removeChild(oldChild: Node): Node; + replaceChild(newChild: Node, oldChild: Node): Node; + ATTRIBUTE_NODE: number; + CDATA_SECTION_NODE: number; + COMMENT_NODE: number; + DOCUMENT_FRAGMENT_NODE: number; + DOCUMENT_NODE: number; + DOCUMENT_POSITION_CONTAINED_BY: number; + DOCUMENT_POSITION_CONTAINS: number; + DOCUMENT_POSITION_DISCONNECTED: number; + DOCUMENT_POSITION_FOLLOWING: number; + DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; + DOCUMENT_POSITION_PRECEDING: number; + DOCUMENT_TYPE_NODE: number; + ELEMENT_NODE: number; + ENTITY_NODE: number; + ENTITY_REFERENCE_NODE: number; + NOTATION_NODE: number; + PROCESSING_INSTRUCTION_NODE: number; + TEXT_NODE: number; +} + +declare var Node: { + prototype: Node; + new(): Node; + ATTRIBUTE_NODE: number; + CDATA_SECTION_NODE: number; + COMMENT_NODE: number; + DOCUMENT_FRAGMENT_NODE: number; + DOCUMENT_NODE: number; + DOCUMENT_POSITION_CONTAINED_BY: number; + DOCUMENT_POSITION_CONTAINS: number; + DOCUMENT_POSITION_DISCONNECTED: number; + DOCUMENT_POSITION_FOLLOWING: number; + DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; + DOCUMENT_POSITION_PRECEDING: number; + DOCUMENT_TYPE_NODE: number; + ELEMENT_NODE: number; + ENTITY_NODE: number; + ENTITY_REFERENCE_NODE: number; + NOTATION_NODE: number; + PROCESSING_INSTRUCTION_NODE: number; + TEXT_NODE: number; +} + +interface NodeFilter { + FILTER_ACCEPT: number; + FILTER_REJECT: number; + FILTER_SKIP: number; + SHOW_ALL: number; + SHOW_ATTRIBUTE: number; + SHOW_CDATA_SECTION: number; + SHOW_COMMENT: number; + SHOW_DOCUMENT: number; + SHOW_DOCUMENT_FRAGMENT: number; + SHOW_DOCUMENT_TYPE: number; + SHOW_ELEMENT: number; + SHOW_ENTITY: number; + SHOW_ENTITY_REFERENCE: number; + SHOW_NOTATION: number; + SHOW_PROCESSING_INSTRUCTION: number; + SHOW_TEXT: number; +} +declare var NodeFilter: NodeFilter; + +interface NodeIterator { + expandEntityReferences: boolean; + filter: NodeFilter; + root: Node; + whatToShow: number; + detach(): void; + nextNode(): Node; + previousNode(): Node; +} + +declare var NodeIterator: { + prototype: NodeIterator; + new(): NodeIterator; +} + +interface NodeList { + length: number; + item(index: number): Node; + [index: number]: Node; +} + +declare var NodeList: { + prototype: NodeList; + new(): NodeList; +} + +interface OES_element_index_uint { +} + +declare var OES_element_index_uint: { + prototype: OES_element_index_uint; + new(): OES_element_index_uint; +} + +interface OES_standard_derivatives { + FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; +} + +declare var OES_standard_derivatives: { + prototype: OES_standard_derivatives; + new(): OES_standard_derivatives; + FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; +} + +interface OES_texture_float { +} + +declare var OES_texture_float: { + prototype: OES_texture_float; + new(): OES_texture_float; +} + +interface OES_texture_float_linear { +} + +declare var OES_texture_float_linear: { + prototype: OES_texture_float_linear; + new(): OES_texture_float_linear; +} + +interface OfflineAudioCompletionEvent extends Event { + renderedBuffer: AudioBuffer; +} + +declare var OfflineAudioCompletionEvent: { + prototype: OfflineAudioCompletionEvent; + new(): OfflineAudioCompletionEvent; +} + +interface OfflineAudioContext extends AudioContext { + oncomplete: (ev: Event) => any; + startRendering(): void; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var OfflineAudioContext: { + prototype: OfflineAudioContext; + new(numberOfChannels: number, length: number, sampleRate: number): OfflineAudioContext; +} + +interface OscillatorNode extends AudioNode { + detune: AudioParam; + frequency: AudioParam; + onended: (ev: Event) => any; + type: string; + setPeriodicWave(periodicWave: PeriodicWave): void; + start(when?: number): void; + stop(when?: number): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var OscillatorNode: { + prototype: OscillatorNode; + new(): OscillatorNode; +} + +interface PageTransitionEvent extends Event { + persisted: boolean; +} + +declare var PageTransitionEvent: { + prototype: PageTransitionEvent; + new(): PageTransitionEvent; +} + +interface PannerNode extends AudioNode { + coneInnerAngle: number; + coneOuterAngle: number; + coneOuterGain: number; + distanceModel: string; + maxDistance: number; + panningModel: string; + refDistance: number; + rolloffFactor: number; + setOrientation(x: number, y: number, z: number): void; + setPosition(x: number, y: number, z: number): void; + setVelocity(x: number, y: number, z: number): void; +} + +declare var PannerNode: { + prototype: PannerNode; + new(): PannerNode; +} + +interface PerfWidgetExternal { + activeNetworkRequestCount: number; + averageFrameTime: number; + averagePaintTime: number; + extraInformationEnabled: boolean; + independentRenderingEnabled: boolean; + irDisablingContentString: string; + irStatusAvailable: boolean; + maxCpuSpeed: number; + paintRequestsPerSecond: number; + performanceCounter: number; + performanceCounterFrequency: number; + addEventListener(eventType: string, callback: Function): void; + getMemoryUsage(): number; + getProcessCpuUsage(): number; + getRecentCpuUsage(last: number): any; + getRecentFrames(last: number): any; + getRecentMemoryUsage(last: number): any; + getRecentPaintRequests(last: number): any; + removeEventListener(eventType: string, callback: Function): void; + repositionWindow(x: number, y: number): void; + resizeWindow(width: number, height: number): void; +} + +declare var PerfWidgetExternal: { + prototype: PerfWidgetExternal; + new(): PerfWidgetExternal; +} + +interface Performance { + navigation: PerformanceNavigation; + timing: PerformanceTiming; + clearMarks(markName?: string): void; + clearMeasures(measureName?: string): void; + clearResourceTimings(): void; + getEntries(): any; + getEntriesByName(name: string, entryType?: string): any; + getEntriesByType(entryType: string): any; + getMarks(markName?: string): any; + getMeasures(measureName?: string): any; + mark(markName: string): void; + measure(measureName: string, startMarkName?: string, endMarkName?: string): void; + now(): number; + setResourceTimingBufferSize(maxSize: number): void; + toJSON(): any; +} + +declare var Performance: { + prototype: Performance; + new(): Performance; +} + +interface PerformanceEntry { + duration: number; + entryType: string; + name: string; + startTime: number; +} + +declare var PerformanceEntry: { + prototype: PerformanceEntry; + new(): PerformanceEntry; +} + +interface PerformanceMark extends PerformanceEntry { +} + +declare var PerformanceMark: { + prototype: PerformanceMark; + new(): PerformanceMark; +} + +interface PerformanceMeasure extends PerformanceEntry { +} + +declare var PerformanceMeasure: { + prototype: PerformanceMeasure; + new(): PerformanceMeasure; +} + +interface PerformanceNavigation { + redirectCount: number; + type: number; + toJSON(): any; + TYPE_BACK_FORWARD: number; + TYPE_NAVIGATE: number; + TYPE_RELOAD: number; + TYPE_RESERVED: number; +} + +declare var PerformanceNavigation: { + prototype: PerformanceNavigation; + new(): PerformanceNavigation; + TYPE_BACK_FORWARD: number; + TYPE_NAVIGATE: number; + TYPE_RELOAD: number; + TYPE_RESERVED: number; +} + +interface PerformanceNavigationTiming extends PerformanceEntry { + connectEnd: number; + connectStart: number; + domComplete: number; + domContentLoadedEventEnd: number; + domContentLoadedEventStart: number; + domInteractive: number; + domLoading: number; + domainLookupEnd: number; + domainLookupStart: number; + fetchStart: number; + loadEventEnd: number; + loadEventStart: number; + navigationStart: number; + redirectCount: number; + redirectEnd: number; + redirectStart: number; + requestStart: number; + responseEnd: number; + responseStart: number; + type: string; + unloadEventEnd: number; + unloadEventStart: number; +} + +declare var PerformanceNavigationTiming: { + prototype: PerformanceNavigationTiming; + new(): PerformanceNavigationTiming; +} + +interface PerformanceResourceTiming extends PerformanceEntry { + connectEnd: number; + connectStart: number; + domainLookupEnd: number; + domainLookupStart: number; + fetchStart: number; + initiatorType: string; + redirectEnd: number; + redirectStart: number; + requestStart: number; + responseEnd: number; + responseStart: number; +} + +declare var PerformanceResourceTiming: { + prototype: PerformanceResourceTiming; + new(): PerformanceResourceTiming; +} + +interface PerformanceTiming { + connectEnd: number; + connectStart: number; + domComplete: number; + domContentLoadedEventEnd: number; + domContentLoadedEventStart: number; + domInteractive: number; + domLoading: number; + domainLookupEnd: number; + domainLookupStart: number; + fetchStart: number; + loadEventEnd: number; + loadEventStart: number; + msFirstPaint: number; + navigationStart: number; + redirectEnd: number; + redirectStart: number; + requestStart: number; + responseEnd: number; + responseStart: number; + unloadEventEnd: number; + unloadEventStart: number; + toJSON(): any; +} + +declare var PerformanceTiming: { + prototype: PerformanceTiming; + new(): PerformanceTiming; +} + +interface PeriodicWave { +} + +declare var PeriodicWave: { + prototype: PeriodicWave; + new(): PeriodicWave; +} + +interface PermissionRequest extends DeferredPermissionRequest { + state: string; + defer(): void; +} + +declare var PermissionRequest: { + prototype: PermissionRequest; + new(): PermissionRequest; +} + +interface PermissionRequestedEvent extends Event { + permissionRequest: PermissionRequest; +} + +declare var PermissionRequestedEvent: { + prototype: PermissionRequestedEvent; + new(): PermissionRequestedEvent; +} + +interface Plugin { + description: string; + filename: string; + length: number; + name: string; + version: string; + item(index: number): MimeType; + namedItem(type: string): MimeType; + [index: number]: MimeType; +} + +declare var Plugin: { + prototype: Plugin; + new(): Plugin; +} + +interface PluginArray { + length: number; + item(index: number): Plugin; + namedItem(name: string): Plugin; + refresh(reload?: boolean): void; + [index: number]: Plugin; +} + +declare var PluginArray: { + prototype: PluginArray; + new(): PluginArray; +} + +interface PointerEvent extends MouseEvent { + currentPoint: any; + height: number; + hwTimestamp: number; + intermediatePoints: any; + isPrimary: boolean; + pointerId: number; + pointerType: any; + pressure: number; + rotation: number; + tiltX: number; + tiltY: number; + width: number; + getCurrentPoint(element: Element): void; + getIntermediatePoints(element: Element): void; + initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; +} + +declare var PointerEvent: { + prototype: PointerEvent; + new(typeArg: string, eventInitDict?: PointerEventInit): PointerEvent; } interface PopStateEvent extends Event { state: any; initPopStateEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, stateArg: any): void; } + declare var PopStateEvent: { prototype: PopStateEvent; new(): PopStateEvent; } -interface CSSKeyframeRule extends CSSRule { - keyText: string; - style: CSSStyleDeclaration; -} -declare var CSSKeyframeRule: { - prototype: CSSKeyframeRule; - new(): CSSKeyframeRule; +interface Position { + coords: Coordinates; + timestamp: Date; } -interface MSFileSaver { - msSaveBlob(blob: any, defaultName?: string): boolean; - msSaveOrOpenBlob(blob: any, defaultName?: string): boolean; +declare var Position: { + prototype: Position; + new(): Position; } -interface MSStream { - type: string; - msDetachStream(): any; - msClose(): void; -} -declare var MSStream: { - prototype: MSStream; - new(): MSStream; +interface PositionError { + code: number; + message: string; + toString(): string; + PERMISSION_DENIED: number; + POSITION_UNAVAILABLE: number; + TIMEOUT: number; } -interface MSBlobBuilder { - append(data: any, endings?: string): void; - getBlob(contentType?: string): Blob; -} -declare var MSBlobBuilder: { - prototype: MSBlobBuilder; - new(): MSBlobBuilder; +declare var PositionError: { + prototype: PositionError; + new(): PositionError; + PERMISSION_DENIED: number; + POSITION_UNAVAILABLE: number; + TIMEOUT: number; } -interface DOMSettableTokenList extends DOMTokenList { - value: string; -} -declare var DOMSettableTokenList: { - prototype: DOMSettableTokenList; - new(): DOMSettableTokenList; +interface ProcessingInstruction extends CharacterData { + target: string; } -interface IDBFactory { - open(name: string, version?: number): IDBOpenDBRequest; - cmp(first: any, second: any): number; - deleteDatabase(name: string): IDBOpenDBRequest; -} -declare var IDBFactory: { - prototype: IDBFactory; - new(): IDBFactory; +declare var ProcessingInstruction: { + prototype: ProcessingInstruction; + new(): ProcessingInstruction; } -interface MSPointerEvent extends MouseEvent { - width: number; - rotation: number; - pressure: number; - pointerType: any; - isPrimary: boolean; - tiltY: number; - height: number; - intermediatePoints: any; - currentPoint: any; - tiltX: number; - hwTimestamp: number; - pointerId: number; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; - MSPOINTER_TYPE_PEN: number; - MSPOINTER_TYPE_MOUSE: number; - MSPOINTER_TYPE_TOUCH: number; -} -declare var MSPointerEvent: { - prototype: MSPointerEvent; - new(): MSPointerEvent; - MSPOINTER_TYPE_PEN: number; - MSPOINTER_TYPE_MOUSE: number; - MSPOINTER_TYPE_TOUCH: number; +interface ProgressEvent extends Event { + lengthComputable: boolean; + loaded: number; + total: number; + initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; } -interface MSManipulationEvent extends UIEvent { - lastState: number; - currentState: number; - initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void; - MS_MANIPULATION_STATE_STOPPED: number; - MS_MANIPULATION_STATE_ACTIVE: number; - MS_MANIPULATION_STATE_INERTIA: number; - MS_MANIPULATION_STATE_SELECTING: number; - MS_MANIPULATION_STATE_COMMITTED: number; - MS_MANIPULATION_STATE_PRESELECT: number; - MS_MANIPULATION_STATE_DRAGGING: number; - MS_MANIPULATION_STATE_CANCELLED: number; -} -declare var MSManipulationEvent: { - prototype: MSManipulationEvent; - new(): MSManipulationEvent; - MS_MANIPULATION_STATE_STOPPED: number; - MS_MANIPULATION_STATE_ACTIVE: number; - MS_MANIPULATION_STATE_INERTIA: number; - MS_MANIPULATION_STATE_SELECTING: number; - MS_MANIPULATION_STATE_COMMITTED: number; - MS_MANIPULATION_STATE_PRESELECT: number; - MS_MANIPULATION_STATE_DRAGGING: number; - MS_MANIPULATION_STATE_CANCELLED: number; +declare var ProgressEvent: { + prototype: ProgressEvent; + new(): ProgressEvent; } -interface FormData { - append(name: any, value: any, blobName?: string): void; -} -declare var FormData: { - prototype: FormData; - new(): FormData; +interface Range { + collapsed: boolean; + commonAncestorContainer: Node; + endContainer: Node; + endOffset: number; + startContainer: Node; + startOffset: number; + cloneContents(): DocumentFragment; + cloneRange(): Range; + collapse(toStart: boolean): void; + compareBoundaryPoints(how: number, sourceRange: Range): number; + createContextualFragment(fragment: string): DocumentFragment; + deleteContents(): void; + detach(): void; + expand(Unit: string): boolean; + extractContents(): DocumentFragment; + getBoundingClientRect(): ClientRect; + getClientRects(): ClientRectList; + insertNode(newNode: Node): void; + selectNode(refNode: Node): void; + selectNodeContents(refNode: Node): void; + setEnd(refNode: Node, offset: number): void; + setEndAfter(refNode: Node): void; + setEndBefore(refNode: Node): void; + setStart(refNode: Node, offset: number): void; + setStartAfter(refNode: Node): void; + setStartBefore(refNode: Node): void; + surroundContents(newParent: Node): void; + toString(): string; + END_TO_END: number; + END_TO_START: number; + START_TO_END: number; + START_TO_START: number; } -interface HTMLDataListElement extends HTMLElement { - options: HTMLCollection; -} -declare var HTMLDataListElement: { - prototype: HTMLDataListElement; - new(): HTMLDataListElement; +declare var Range: { + prototype: Range; + new(): Range; + END_TO_END: number; + END_TO_START: number; + START_TO_END: number; + START_TO_START: number; } -interface SVGFEImageElement extends SVGElement, SVGLangSpace, SVGFilterPrimitiveStandardAttributes, SVGURIReference, SVGExternalResourcesRequired { - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; -} -declare var SVGFEImageElement: { - prototype: SVGFEImageElement; - new(): SVGFEImageElement; +interface SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { + target: SVGAnimatedString; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface AbstractWorker extends EventTarget { - onerror: (ev: ErrorEvent) => any; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +declare var SVGAElement: { + prototype: SVGAElement; + new(): SVGAElement; } -interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - operator: SVGAnimatedEnumeration; - in2: SVGAnimatedString; - k2: SVGAnimatedNumber; - k1: SVGAnimatedNumber; - k3: SVGAnimatedNumber; +interface SVGAngle { + unitType: number; + value: number; + valueAsString: string; + valueInSpecifiedUnits: number; + convertToSpecifiedUnits(unitType: number): void; + newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; + SVG_ANGLETYPE_DEG: number; + SVG_ANGLETYPE_GRAD: number; + SVG_ANGLETYPE_RAD: number; + SVG_ANGLETYPE_UNKNOWN: number; + SVG_ANGLETYPE_UNSPECIFIED: number; +} + +declare var SVGAngle: { + prototype: SVGAngle; + new(): SVGAngle; + SVG_ANGLETYPE_DEG: number; + SVG_ANGLETYPE_GRAD: number; + SVG_ANGLETYPE_RAD: number; + SVG_ANGLETYPE_UNKNOWN: number; + SVG_ANGLETYPE_UNSPECIFIED: number; +} + +interface SVGAnimatedAngle { + animVal: SVGAngle; + baseVal: SVGAngle; +} + +declare var SVGAnimatedAngle: { + prototype: SVGAnimatedAngle; + new(): SVGAnimatedAngle; +} + +interface SVGAnimatedBoolean { + animVal: boolean; + baseVal: boolean; +} + +declare var SVGAnimatedBoolean: { + prototype: SVGAnimatedBoolean; + new(): SVGAnimatedBoolean; +} + +interface SVGAnimatedEnumeration { + animVal: number; + baseVal: number; +} + +declare var SVGAnimatedEnumeration: { + prototype: SVGAnimatedEnumeration; + new(): SVGAnimatedEnumeration; +} + +interface SVGAnimatedInteger { + animVal: number; + baseVal: number; +} + +declare var SVGAnimatedInteger: { + prototype: SVGAnimatedInteger; + new(): SVGAnimatedInteger; +} + +interface SVGAnimatedLength { + animVal: SVGLength; + baseVal: SVGLength; +} + +declare var SVGAnimatedLength: { + prototype: SVGAnimatedLength; + new(): SVGAnimatedLength; +} + +interface SVGAnimatedLengthList { + animVal: SVGLengthList; + baseVal: SVGLengthList; +} + +declare var SVGAnimatedLengthList: { + prototype: SVGAnimatedLengthList; + new(): SVGAnimatedLengthList; +} + +interface SVGAnimatedNumber { + animVal: number; + baseVal: number; +} + +declare var SVGAnimatedNumber: { + prototype: SVGAnimatedNumber; + new(): SVGAnimatedNumber; +} + +interface SVGAnimatedNumberList { + animVal: SVGNumberList; + baseVal: SVGNumberList; +} + +declare var SVGAnimatedNumberList: { + prototype: SVGAnimatedNumberList; + new(): SVGAnimatedNumberList; +} + +interface SVGAnimatedPreserveAspectRatio { + animVal: SVGPreserveAspectRatio; + baseVal: SVGPreserveAspectRatio; +} + +declare var SVGAnimatedPreserveAspectRatio: { + prototype: SVGAnimatedPreserveAspectRatio; + new(): SVGAnimatedPreserveAspectRatio; +} + +interface SVGAnimatedRect { + animVal: SVGRect; + baseVal: SVGRect; +} + +declare var SVGAnimatedRect: { + prototype: SVGAnimatedRect; + new(): SVGAnimatedRect; +} + +interface SVGAnimatedString { + animVal: string; + baseVal: string; +} + +declare var SVGAnimatedString: { + prototype: SVGAnimatedString; + new(): SVGAnimatedString; +} + +interface SVGAnimatedTransformList { + animVal: SVGTransformList; + baseVal: SVGTransformList; +} + +declare var SVGAnimatedTransformList: { + prototype: SVGAnimatedTransformList; + new(): SVGAnimatedTransformList; +} + +interface SVGCircleElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + cx: SVGAnimatedLength; + cy: SVGAnimatedLength; + r: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGCircleElement: { + prototype: SVGCircleElement; + new(): SVGCircleElement; +} + +interface SVGClipPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes { + clipPathUnits: SVGAnimatedEnumeration; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGClipPathElement: { + prototype: SVGClipPathElement; + new(): SVGClipPathElement; +} + +interface SVGComponentTransferFunctionElement extends SVGElement { + amplitude: SVGAnimatedNumber; + exponent: SVGAnimatedNumber; + intercept: SVGAnimatedNumber; + offset: SVGAnimatedNumber; + slope: SVGAnimatedNumber; + tableValues: SVGAnimatedNumberList; + type: SVGAnimatedEnumeration; + SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; + SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; + SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; + SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; + SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; + SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; +} + +declare var SVGComponentTransferFunctionElement: { + prototype: SVGComponentTransferFunctionElement; + new(): SVGComponentTransferFunctionElement; + SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; + SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; + SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; + SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; + SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; + SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; +} + +interface SVGDefsElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGDefsElement: { + prototype: SVGDefsElement; + new(): SVGDefsElement; +} + +interface SVGDescElement extends SVGElement, SVGStylable, SVGLangSpace { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGDescElement: { + prototype: SVGDescElement; + new(): SVGDescElement; +} + +interface SVGElement extends Element { + id: string; + onclick: (ev: MouseEvent) => any; + ondblclick: (ev: MouseEvent) => any; + onfocusin: (ev: FocusEvent) => any; + onfocusout: (ev: FocusEvent) => any; + onload: (ev: Event) => any; + onmousedown: (ev: MouseEvent) => any; + onmousemove: (ev: MouseEvent) => any; + onmouseout: (ev: MouseEvent) => any; + onmouseover: (ev: MouseEvent) => any; + onmouseup: (ev: MouseEvent) => any; + ownerSVGElement: SVGSVGElement; + viewportElement: SVGElement; + xmlbase: string; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGElement: { + prototype: SVGElement; + new(): SVGElement; +} + +interface SVGElementInstance extends EventTarget { + childNodes: SVGElementInstanceList; + correspondingElement: SVGElement; + correspondingUseElement: SVGUseElement; + firstChild: SVGElementInstance; + lastChild: SVGElementInstance; + nextSibling: SVGElementInstance; + parentNode: SVGElementInstance; + previousSibling: SVGElementInstance; +} + +declare var SVGElementInstance: { + prototype: SVGElementInstance; + new(): SVGElementInstance; +} + +interface SVGElementInstanceList { + length: number; + item(index: number): SVGElementInstance; +} + +declare var SVGElementInstanceList: { + prototype: SVGElementInstanceList; + new(): SVGElementInstanceList; +} + +interface SVGEllipseElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + cx: SVGAnimatedLength; + cy: SVGAnimatedLength; + rx: SVGAnimatedLength; + ry: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGEllipseElement: { + prototype: SVGEllipseElement; + new(): SVGEllipseElement; +} + +interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { in1: SVGAnimatedString; - k4: SVGAnimatedNumber; - SVG_FECOMPOSITE_OPERATOR_OUT: number; - SVG_FECOMPOSITE_OPERATOR_OVER: number; - SVG_FECOMPOSITE_OPERATOR_XOR: number; - SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - SVG_FECOMPOSITE_OPERATOR_IN: number; - SVG_FECOMPOSITE_OPERATOR_ATOP: number; -} -declare var SVGFECompositeElement: { - prototype: SVGFECompositeElement; - new(): SVGFECompositeElement; - SVG_FECOMPOSITE_OPERATOR_OUT: number; - SVG_FECOMPOSITE_OPERATOR_OVER: number; - SVG_FECOMPOSITE_OPERATOR_XOR: number; - SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - SVG_FECOMPOSITE_OPERATOR_IN: number; - SVG_FECOMPOSITE_OPERATOR_ATOP: number; + in2: SVGAnimatedString; + mode: SVGAnimatedEnumeration; + SVG_FEBLEND_MODE_COLOR: number; + SVG_FEBLEND_MODE_COLOR_BURN: number; + SVG_FEBLEND_MODE_COLOR_DODGE: number; + SVG_FEBLEND_MODE_DARKEN: number; + SVG_FEBLEND_MODE_DIFFERENCE: number; + SVG_FEBLEND_MODE_EXCLUSION: number; + SVG_FEBLEND_MODE_HARD_LIGHT: number; + SVG_FEBLEND_MODE_HUE: number; + SVG_FEBLEND_MODE_LIGHTEN: number; + SVG_FEBLEND_MODE_LUMINOSITY: number; + SVG_FEBLEND_MODE_MULTIPLY: number; + SVG_FEBLEND_MODE_NORMAL: number; + SVG_FEBLEND_MODE_OVERLAY: number; + SVG_FEBLEND_MODE_SATURATION: number; + SVG_FEBLEND_MODE_SCREEN: number; + SVG_FEBLEND_MODE_SOFT_LIGHT: number; + SVG_FEBLEND_MODE_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface ValidityState { - customError: boolean; - valueMissing: boolean; - stepMismatch: boolean; - rangeUnderflow: boolean; - rangeOverflow: boolean; - typeMismatch: boolean; - patternMismatch: boolean; - tooLong: boolean; - valid: boolean; -} -declare var ValidityState: { - prototype: ValidityState; - new(): ValidityState; +declare var SVGFEBlendElement: { + prototype: SVGFEBlendElement; + new(): SVGFEBlendElement; + SVG_FEBLEND_MODE_COLOR: number; + SVG_FEBLEND_MODE_COLOR_BURN: number; + SVG_FEBLEND_MODE_COLOR_DODGE: number; + SVG_FEBLEND_MODE_DARKEN: number; + SVG_FEBLEND_MODE_DIFFERENCE: number; + SVG_FEBLEND_MODE_EXCLUSION: number; + SVG_FEBLEND_MODE_HARD_LIGHT: number; + SVG_FEBLEND_MODE_HUE: number; + SVG_FEBLEND_MODE_LIGHTEN: number; + SVG_FEBLEND_MODE_LUMINOSITY: number; + SVG_FEBLEND_MODE_MULTIPLY: number; + SVG_FEBLEND_MODE_NORMAL: number; + SVG_FEBLEND_MODE_OVERLAY: number; + SVG_FEBLEND_MODE_SATURATION: number; + SVG_FEBLEND_MODE_SCREEN: number; + SVG_FEBLEND_MODE_SOFT_LIGHT: number; + SVG_FEBLEND_MODE_UNKNOWN: number; } -interface HTMLTrackElement extends HTMLElement { - kind: string; - src: string; - srclang: string; - track: TextTrack; - label: string; - default: boolean; - readyState: number; - ERROR: number; - LOADING: number; - LOADED: number; - NONE: number; -} -declare var HTMLTrackElement: { - prototype: HTMLTrackElement; - new(): HTMLTrackElement; - ERROR: number; - LOADING: number; - LOADED: number; - NONE: number; +interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + type: SVGAnimatedEnumeration; + values: SVGAnimatedNumberList; + SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; + SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; + SVG_FECOLORMATRIX_TYPE_MATRIX: number; + SVG_FECOLORMATRIX_TYPE_SATURATE: number; + SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface MSApp { - createFileFromStorageFile(storageFile: any): File; - createBlobFromRandomAccessStream(type: string, seeker: any): Blob; - createStreamFromInputStream(type: string, inputStream: any): MSStream; - terminateApp(exceptionObject: any): void; - createDataPackage(object: any): any; - execUnsafeLocalFunction(unsafeFunction: MSUnsafeFunctionCallback): any; - getHtmlPrintDocumentSource(htmlDoc: any): any; - addPublicLocalApplicationUri(uri: string): void; - createDataPackageFromSelection(): any; - getViewOpener(): MSAppView; - suppressSubdownloadCredentialPrompts(suppress: boolean): void; - execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; - isTaskScheduledAtPriorityOrHigher(priority: string): boolean; - execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; - createNewView(uri: string): MSAppView; - getCurrentPriority(): string; - NORMAL: string; - HIGH: string; - IDLE: string; - CURRENT: string; +declare var SVGFEColorMatrixElement: { + prototype: SVGFEColorMatrixElement; + new(): SVGFEColorMatrixElement; + SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; + SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; + SVG_FECOLORMATRIX_TYPE_MATRIX: number; + SVG_FECOLORMATRIX_TYPE_SATURATE: number; + SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; } -declare var MSApp: MSApp; interface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { in1: SVGAnimatedString; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var SVGFEComponentTransferElement: { prototype: SVGFEComponentTransferElement; new(): SVGFEComponentTransferElement; } -interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { +interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + in2: SVGAnimatedString; + k1: SVGAnimatedNumber; + k2: SVGAnimatedNumber; + k3: SVGAnimatedNumber; + k4: SVGAnimatedNumber; + operator: SVGAnimatedEnumeration; + SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; + SVG_FECOMPOSITE_OPERATOR_ATOP: number; + SVG_FECOMPOSITE_OPERATOR_IN: number; + SVG_FECOMPOSITE_OPERATOR_OUT: number; + SVG_FECOMPOSITE_OPERATOR_OVER: number; + SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; + SVG_FECOMPOSITE_OPERATOR_XOR: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFECompositeElement: { + prototype: SVGFECompositeElement; + new(): SVGFECompositeElement; + SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; + SVG_FECOMPOSITE_OPERATOR_ATOP: number; + SVG_FECOMPOSITE_OPERATOR_IN: number; + SVG_FECOMPOSITE_OPERATOR_OUT: number; + SVG_FECOMPOSITE_OPERATOR_OVER: number; + SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; + SVG_FECOMPOSITE_OPERATOR_XOR: number; +} + +interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + bias: SVGAnimatedNumber; + divisor: SVGAnimatedNumber; + edgeMode: SVGAnimatedEnumeration; + in1: SVGAnimatedString; + kernelMatrix: SVGAnimatedNumberList; + kernelUnitLengthX: SVGAnimatedNumber; kernelUnitLengthY: SVGAnimatedNumber; - surfaceScale: SVGAnimatedNumber; + orderX: SVGAnimatedInteger; + orderY: SVGAnimatedInteger; + preserveAlpha: SVGAnimatedBoolean; + targetX: SVGAnimatedInteger; + targetY: SVGAnimatedInteger; + SVG_EDGEMODE_DUPLICATE: number; + SVG_EDGEMODE_NONE: number; + SVG_EDGEMODE_UNKNOWN: number; + SVG_EDGEMODE_WRAP: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEConvolveMatrixElement: { + prototype: SVGFEConvolveMatrixElement; + new(): SVGFEConvolveMatrixElement; + SVG_EDGEMODE_DUPLICATE: number; + SVG_EDGEMODE_NONE: number; + SVG_EDGEMODE_UNKNOWN: number; + SVG_EDGEMODE_WRAP: number; +} + +interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + diffuseConstant: SVGAnimatedNumber; in1: SVGAnimatedString; kernelUnitLengthX: SVGAnimatedNumber; - diffuseConstant: SVGAnimatedNumber; + kernelUnitLengthY: SVGAnimatedNumber; + surfaceScale: SVGAnimatedNumber; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var SVGFEDiffuseLightingElement: { prototype: SVGFEDiffuseLightingElement; new(): SVGFEDiffuseLightingElement; } -interface MSCSSMatrix { - m24: number; - m34: number; +interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + in2: SVGAnimatedString; + scale: SVGAnimatedNumber; + xChannelSelector: SVGAnimatedEnumeration; + yChannelSelector: SVGAnimatedEnumeration; + SVG_CHANNEL_A: number; + SVG_CHANNEL_B: number; + SVG_CHANNEL_G: number; + SVG_CHANNEL_R: number; + SVG_CHANNEL_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEDisplacementMapElement: { + prototype: SVGFEDisplacementMapElement; + new(): SVGFEDisplacementMapElement; + SVG_CHANNEL_A: number; + SVG_CHANNEL_B: number; + SVG_CHANNEL_G: number; + SVG_CHANNEL_R: number; + SVG_CHANNEL_UNKNOWN: number; +} + +interface SVGFEDistantLightElement extends SVGElement { + azimuth: SVGAnimatedNumber; + elevation: SVGAnimatedNumber; +} + +declare var SVGFEDistantLightElement: { + prototype: SVGFEDistantLightElement; + new(): SVGFEDistantLightElement; +} + +interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEFloodElement: { + prototype: SVGFEFloodElement; + new(): SVGFEFloodElement; +} + +interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { +} + +declare var SVGFEFuncAElement: { + prototype: SVGFEFuncAElement; + new(): SVGFEFuncAElement; +} + +interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { +} + +declare var SVGFEFuncBElement: { + prototype: SVGFEFuncBElement; + new(): SVGFEFuncBElement; +} + +interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { +} + +declare var SVGFEFuncGElement: { + prototype: SVGFEFuncGElement; + new(): SVGFEFuncGElement; +} + +interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { +} + +declare var SVGFEFuncRElement: { + prototype: SVGFEFuncRElement; + new(): SVGFEFuncRElement; +} + +interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + stdDeviationX: SVGAnimatedNumber; + stdDeviationY: SVGAnimatedNumber; + setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEGaussianBlurElement: { + prototype: SVGFEGaussianBlurElement; + new(): SVGFEGaussianBlurElement; +} + +interface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { + preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEImageElement: { + prototype: SVGFEImageElement; + new(): SVGFEImageElement; +} + +interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEMergeElement: { + prototype: SVGFEMergeElement; + new(): SVGFEMergeElement; +} + +interface SVGFEMergeNodeElement extends SVGElement { + in1: SVGAnimatedString; +} + +declare var SVGFEMergeNodeElement: { + prototype: SVGFEMergeNodeElement; + new(): SVGFEMergeNodeElement; +} + +interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + operator: SVGAnimatedEnumeration; + radiusX: SVGAnimatedNumber; + radiusY: SVGAnimatedNumber; + SVG_MORPHOLOGY_OPERATOR_DILATE: number; + SVG_MORPHOLOGY_OPERATOR_ERODE: number; + SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEMorphologyElement: { + prototype: SVGFEMorphologyElement; + new(): SVGFEMorphologyElement; + SVG_MORPHOLOGY_OPERATOR_DILATE: number; + SVG_MORPHOLOGY_OPERATOR_ERODE: number; + SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; +} + +interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + dx: SVGAnimatedNumber; + dy: SVGAnimatedNumber; + in1: SVGAnimatedString; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEOffsetElement: { + prototype: SVGFEOffsetElement; + new(): SVGFEOffsetElement; +} + +interface SVGFEPointLightElement extends SVGElement { + x: SVGAnimatedNumber; + y: SVGAnimatedNumber; + z: SVGAnimatedNumber; +} + +declare var SVGFEPointLightElement: { + prototype: SVGFEPointLightElement; + new(): SVGFEPointLightElement; +} + +interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + kernelUnitLengthX: SVGAnimatedNumber; + kernelUnitLengthY: SVGAnimatedNumber; + specularConstant: SVGAnimatedNumber; + specularExponent: SVGAnimatedNumber; + surfaceScale: SVGAnimatedNumber; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFESpecularLightingElement: { + prototype: SVGFESpecularLightingElement; + new(): SVGFESpecularLightingElement; +} + +interface SVGFESpotLightElement extends SVGElement { + limitingConeAngle: SVGAnimatedNumber; + pointsAtX: SVGAnimatedNumber; + pointsAtY: SVGAnimatedNumber; + pointsAtZ: SVGAnimatedNumber; + specularExponent: SVGAnimatedNumber; + x: SVGAnimatedNumber; + y: SVGAnimatedNumber; + z: SVGAnimatedNumber; +} + +declare var SVGFESpotLightElement: { + prototype: SVGFESpotLightElement; + new(): SVGFESpotLightElement; +} + +interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFETileElement: { + prototype: SVGFETileElement; + new(): SVGFETileElement; +} + +interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + baseFrequencyX: SVGAnimatedNumber; + baseFrequencyY: SVGAnimatedNumber; + numOctaves: SVGAnimatedInteger; + seed: SVGAnimatedNumber; + stitchTiles: SVGAnimatedEnumeration; + type: SVGAnimatedEnumeration; + SVG_STITCHTYPE_NOSTITCH: number; + SVG_STITCHTYPE_STITCH: number; + SVG_STITCHTYPE_UNKNOWN: number; + SVG_TURBULENCE_TYPE_FRACTALNOISE: number; + SVG_TURBULENCE_TYPE_TURBULENCE: number; + SVG_TURBULENCE_TYPE_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFETurbulenceElement: { + prototype: SVGFETurbulenceElement; + new(): SVGFETurbulenceElement; + SVG_STITCHTYPE_NOSTITCH: number; + SVG_STITCHTYPE_STITCH: number; + SVG_STITCHTYPE_UNKNOWN: number; + SVG_TURBULENCE_TYPE_FRACTALNOISE: number; + SVG_TURBULENCE_TYPE_TURBULENCE: number; + SVG_TURBULENCE_TYPE_UNKNOWN: number; +} + +interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { + filterResX: SVGAnimatedInteger; + filterResY: SVGAnimatedInteger; + filterUnits: SVGAnimatedEnumeration; + height: SVGAnimatedLength; + primitiveUnits: SVGAnimatedEnumeration; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + setFilterRes(filterResX: number, filterResY: number): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFilterElement: { + prototype: SVGFilterElement; + new(): SVGFilterElement; +} + +interface SVGForeignObjectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + height: SVGAnimatedLength; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGForeignObjectElement: { + prototype: SVGForeignObjectElement; + new(): SVGForeignObjectElement; +} + +interface SVGGElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGGElement: { + prototype: SVGGElement; + new(): SVGGElement; +} + +interface SVGGradientElement extends SVGElement, SVGStylable, SVGExternalResourcesRequired, SVGURIReference, SVGUnitTypes { + gradientTransform: SVGAnimatedTransformList; + gradientUnits: SVGAnimatedEnumeration; + spreadMethod: SVGAnimatedEnumeration; + SVG_SPREADMETHOD_PAD: number; + SVG_SPREADMETHOD_REFLECT: number; + SVG_SPREADMETHOD_REPEAT: number; + SVG_SPREADMETHOD_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGGradientElement: { + prototype: SVGGradientElement; + new(): SVGGradientElement; + SVG_SPREADMETHOD_PAD: number; + SVG_SPREADMETHOD_REFLECT: number; + SVG_SPREADMETHOD_REPEAT: number; + SVG_SPREADMETHOD_UNKNOWN: number; +} + +interface SVGImageElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { + height: SVGAnimatedLength; + preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGImageElement: { + prototype: SVGImageElement; + new(): SVGImageElement; +} + +interface SVGLength { + unitType: number; + value: number; + valueAsString: string; + valueInSpecifiedUnits: number; + convertToSpecifiedUnits(unitType: number): void; + newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; + SVG_LENGTHTYPE_CM: number; + SVG_LENGTHTYPE_EMS: number; + SVG_LENGTHTYPE_EXS: number; + SVG_LENGTHTYPE_IN: number; + SVG_LENGTHTYPE_MM: number; + SVG_LENGTHTYPE_NUMBER: number; + SVG_LENGTHTYPE_PC: number; + SVG_LENGTHTYPE_PERCENTAGE: number; + SVG_LENGTHTYPE_PT: number; + SVG_LENGTHTYPE_PX: number; + SVG_LENGTHTYPE_UNKNOWN: number; +} + +declare var SVGLength: { + prototype: SVGLength; + new(): SVGLength; + SVG_LENGTHTYPE_CM: number; + SVG_LENGTHTYPE_EMS: number; + SVG_LENGTHTYPE_EXS: number; + SVG_LENGTHTYPE_IN: number; + SVG_LENGTHTYPE_MM: number; + SVG_LENGTHTYPE_NUMBER: number; + SVG_LENGTHTYPE_PC: number; + SVG_LENGTHTYPE_PERCENTAGE: number; + SVG_LENGTHTYPE_PT: number; + SVG_LENGTHTYPE_PX: number; + SVG_LENGTHTYPE_UNKNOWN: number; +} + +interface SVGLengthList { + numberOfItems: number; + appendItem(newItem: SVGLength): SVGLength; + clear(): void; + getItem(index: number): SVGLength; + initialize(newItem: SVGLength): SVGLength; + insertItemBefore(newItem: SVGLength, index: number): SVGLength; + removeItem(index: number): SVGLength; + replaceItem(newItem: SVGLength, index: number): SVGLength; +} + +declare var SVGLengthList: { + prototype: SVGLengthList; + new(): SVGLengthList; +} + +interface SVGLineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + x1: SVGAnimatedLength; + x2: SVGAnimatedLength; + y1: SVGAnimatedLength; + y2: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGLineElement: { + prototype: SVGLineElement; + new(): SVGLineElement; +} + +interface SVGLinearGradientElement extends SVGGradientElement { + x1: SVGAnimatedLength; + x2: SVGAnimatedLength; + y1: SVGAnimatedLength; + y2: SVGAnimatedLength; +} + +declare var SVGLinearGradientElement: { + prototype: SVGLinearGradientElement; + new(): SVGLinearGradientElement; +} + +interface SVGMarkerElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox { + markerHeight: SVGAnimatedLength; + markerUnits: SVGAnimatedEnumeration; + markerWidth: SVGAnimatedLength; + orientAngle: SVGAnimatedAngle; + orientType: SVGAnimatedEnumeration; + refX: SVGAnimatedLength; + refY: SVGAnimatedLength; + setOrientToAngle(angle: SVGAngle): void; + setOrientToAuto(): void; + SVG_MARKERUNITS_STROKEWIDTH: number; + SVG_MARKERUNITS_UNKNOWN: number; + SVG_MARKERUNITS_USERSPACEONUSE: number; + SVG_MARKER_ORIENT_ANGLE: number; + SVG_MARKER_ORIENT_AUTO: number; + SVG_MARKER_ORIENT_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGMarkerElement: { + prototype: SVGMarkerElement; + new(): SVGMarkerElement; + SVG_MARKERUNITS_STROKEWIDTH: number; + SVG_MARKERUNITS_UNKNOWN: number; + SVG_MARKERUNITS_USERSPACEONUSE: number; + SVG_MARKER_ORIENT_ANGLE: number; + SVG_MARKER_ORIENT_AUTO: number; + SVG_MARKER_ORIENT_UNKNOWN: number; +} + +interface SVGMaskElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes { + height: SVGAnimatedLength; + maskContentUnits: SVGAnimatedEnumeration; + maskUnits: SVGAnimatedEnumeration; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGMaskElement: { + prototype: SVGMaskElement; + new(): SVGMaskElement; +} + +interface SVGMatrix { a: number; - d: number; - m32: number; - m41: number; - m11: number; - f: number; - e: number; - m23: number; - m14: number; - m33: number; - m22: number; - m21: number; - c: number; - m12: number; b: number; - m42: number; - m31: number; - m43: number; - m13: number; - m44: number; - multiply(secondMatrix: MSCSSMatrix): MSCSSMatrix; - skewY(angle: number): MSCSSMatrix; - setMatrixValue(value: string): void; - inverse(): MSCSSMatrix; - rotateAxisAngle(x: number, y: number, z: number, angle: number): MSCSSMatrix; - toString(): string; - rotate(angleX: number, angleY?: number, angleZ?: number): MSCSSMatrix; - translate(x: number, y: number, z?: number): MSCSSMatrix; - scale(scaleX: number, scaleY?: number, scaleZ?: number): MSCSSMatrix; - skewX(angle: number): MSCSSMatrix; -} -declare var MSCSSMatrix: { - prototype: MSCSSMatrix; - new(text?: string): MSCSSMatrix; + c: number; + d: number; + e: number; + f: number; + flipX(): SVGMatrix; + flipY(): SVGMatrix; + inverse(): SVGMatrix; + multiply(secondMatrix: SVGMatrix): SVGMatrix; + rotate(angle: number): SVGMatrix; + rotateFromVector(x: number, y: number): SVGMatrix; + scale(scaleFactor: number): SVGMatrix; + scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix; + skewX(angle: number): SVGMatrix; + skewY(angle: number): SVGMatrix; + translate(x: number, y: number): SVGMatrix; } -interface Worker extends AbstractWorker { - onmessage: (ev: MessageEvent) => any; - postMessage(message: any, ports?: any): void; - terminate(): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Worker: { - prototype: Worker; - new(stringUrl: string): Worker; +declare var SVGMatrix: { + prototype: SVGMatrix; + new(): SVGMatrix; } -interface MSExecAtPriorityFunctionCallback { - (...args: any[]): any; +interface SVGMetadataElement extends SVGElement { } -interface MSGraphicsTrust { - status: string; - constrictionActive: boolean; -} -declare var MSGraphicsTrust: { - prototype: MSGraphicsTrust; - new(): MSGraphicsTrust; +declare var SVGMetadataElement: { + prototype: SVGMetadataElement; + new(): SVGMetadataElement; } -interface SubtleCrypto { - unwrapKey(wrappedKey: ArrayBufferView, keyAlgorithm: any, keyEncryptionKey: Key, extractable?: boolean, keyUsages?: string[]): KeyOperation; - encrypt(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; - importKey(format: string, keyData: ArrayBufferView, algorithm: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; - wrapKey(key: Key, keyEncryptionKey: Key, keyWrappingAlgorithm: any): KeyOperation; - verify(algorithm: any, key: Key, signature: ArrayBufferView, buffer?: ArrayBufferView): CryptoOperation; - deriveKey(algorithm: any, baseKey: Key, derivedKeyType: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; - digest(algorithm: any, buffer?: ArrayBufferView): CryptoOperation; - exportKey(format: string, key: Key): KeyOperation; - generateKey(algorithm: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; - sign(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; - decrypt(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; -} -declare var SubtleCrypto: { - prototype: SubtleCrypto; - new(): SubtleCrypto; +interface SVGNumber { + value: number; } -interface Crypto extends RandomSource { - subtle: SubtleCrypto; -} -declare var Crypto: { - prototype: Crypto; - new(): Crypto; +declare var SVGNumber: { + prototype: SVGNumber; + new(): SVGNumber; } -interface VideoPlaybackQuality { - totalFrameDelay: number; - creationTime: number; - totalVideoFrames: number; - droppedVideoFrames: number; -} -declare var VideoPlaybackQuality: { - prototype: VideoPlaybackQuality; - new(): VideoPlaybackQuality; +interface SVGNumberList { + numberOfItems: number; + appendItem(newItem: SVGNumber): SVGNumber; + clear(): void; + getItem(index: number): SVGNumber; + initialize(newItem: SVGNumber): SVGNumber; + insertItemBefore(newItem: SVGNumber, index: number): SVGNumber; + removeItem(index: number): SVGNumber; + replaceItem(newItem: SVGNumber, index: number): SVGNumber; } -interface GlobalEventHandlers { - onpointerenter: (ev: PointerEvent) => any; - onpointerout: (ev: PointerEvent) => any; - onpointerdown: (ev: PointerEvent) => any; - onpointerup: (ev: PointerEvent) => any; - onpointercancel: (ev: PointerEvent) => any; - onpointerover: (ev: PointerEvent) => any; - onpointermove: (ev: PointerEvent) => any; - onpointerleave: (ev: PointerEvent) => any; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +declare var SVGNumberList: { + prototype: SVGNumberList; + new(): SVGNumberList; } -interface Key { - algorithm: Algorithm; - type: string; - extractable: boolean; - keyUsage: string[]; -} -declare var Key: { - prototype: Key; - new(): Key; +interface SVGPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPathData { + createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs; + createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel; + createSVGPathSegClosePath(): SVGPathSegClosePath; + createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs; + createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel; + createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs; + createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel; + createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs; + createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel; + createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs; + createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel; + createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs; + createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs; + createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel; + createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel; + createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs; + createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel; + createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs; + createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel; + getPathSegAtLength(distance: number): number; + getPointAtLength(distance: number): SVGPoint; + getTotalLength(): number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface DeviceAcceleration { - y: number; +declare var SVGPathElement: { + prototype: SVGPathElement; + new(): SVGPathElement; +} + +interface SVGPathSeg { + pathSegType: number; + pathSegTypeAsLetter: string; + PATHSEG_ARC_ABS: number; + PATHSEG_ARC_REL: number; + PATHSEG_CLOSEPATH: number; + PATHSEG_CURVETO_CUBIC_ABS: number; + PATHSEG_CURVETO_CUBIC_REL: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; + PATHSEG_CURVETO_QUADRATIC_ABS: number; + PATHSEG_CURVETO_QUADRATIC_REL: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; + PATHSEG_LINETO_ABS: number; + PATHSEG_LINETO_HORIZONTAL_ABS: number; + PATHSEG_LINETO_HORIZONTAL_REL: number; + PATHSEG_LINETO_REL: number; + PATHSEG_LINETO_VERTICAL_ABS: number; + PATHSEG_LINETO_VERTICAL_REL: number; + PATHSEG_MOVETO_ABS: number; + PATHSEG_MOVETO_REL: number; + PATHSEG_UNKNOWN: number; +} + +declare var SVGPathSeg: { + prototype: SVGPathSeg; + new(): SVGPathSeg; + PATHSEG_ARC_ABS: number; + PATHSEG_ARC_REL: number; + PATHSEG_CLOSEPATH: number; + PATHSEG_CURVETO_CUBIC_ABS: number; + PATHSEG_CURVETO_CUBIC_REL: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; + PATHSEG_CURVETO_QUADRATIC_ABS: number; + PATHSEG_CURVETO_QUADRATIC_REL: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; + PATHSEG_LINETO_ABS: number; + PATHSEG_LINETO_HORIZONTAL_ABS: number; + PATHSEG_LINETO_HORIZONTAL_REL: number; + PATHSEG_LINETO_REL: number; + PATHSEG_LINETO_VERTICAL_ABS: number; + PATHSEG_LINETO_VERTICAL_REL: number; + PATHSEG_MOVETO_ABS: number; + PATHSEG_MOVETO_REL: number; + PATHSEG_UNKNOWN: number; +} + +interface SVGPathSegArcAbs extends SVGPathSeg { + angle: number; + largeArcFlag: boolean; + r1: number; + r2: number; + sweepFlag: boolean; x: number; - z: number; -} -declare var DeviceAcceleration: { - prototype: DeviceAcceleration; - new(): DeviceAcceleration; + y: number; } -interface HTMLAllCollection extends HTMLCollection { - namedItem(name: string): Element; - // [name: string]: Element; -} -declare var HTMLAllCollection: { - prototype: HTMLAllCollection; - new(): HTMLAllCollection; +declare var SVGPathSegArcAbs: { + prototype: SVGPathSegArcAbs; + new(): SVGPathSegArcAbs; } -interface AesGcmEncryptResult { - ciphertext: ArrayBuffer; - tag: ArrayBuffer; -} -declare var AesGcmEncryptResult: { - prototype: AesGcmEncryptResult; - new(): AesGcmEncryptResult; +interface SVGPathSegArcRel extends SVGPathSeg { + angle: number; + largeArcFlag: boolean; + r1: number; + r2: number; + sweepFlag: boolean; + x: number; + y: number; } -interface NavigationCompletedEvent extends NavigationEvent { - webErrorStatus: number; - isSuccess: boolean; -} -declare var NavigationCompletedEvent: { - prototype: NavigationCompletedEvent; - new(): NavigationCompletedEvent; +declare var SVGPathSegArcRel: { + prototype: SVGPathSegArcRel; + new(): SVGPathSegArcRel; } -interface MutationRecord { - oldValue: string; - previousSibling: Node; - addedNodes: NodeList; - attributeName: string; - removedNodes: NodeList; - target: Node; - nextSibling: Node; - attributeNamespace: string; - type: string; -} -declare var MutationRecord: { - prototype: MutationRecord; - new(): MutationRecord; +interface SVGPathSegClosePath extends SVGPathSeg { } -interface MimeTypeArray { - length: number; - item(index: number): Plugin; - [index: number]: Plugin; - namedItem(type: string): Plugin; - // [type: string]: Plugin; -} -declare var MimeTypeArray: { - prototype: MimeTypeArray; - new(): MimeTypeArray; +declare var SVGPathSegClosePath: { + prototype: SVGPathSegClosePath; + new(): SVGPathSegClosePath; } -interface KeyOperation extends EventTarget { - oncomplete: (ev: Event) => any; - onerror: (ev: ErrorEvent) => any; - result: any; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var KeyOperation: { - prototype: KeyOperation; - new(): KeyOperation; +interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg { + x: number; + x1: number; + x2: number; + y: number; + y1: number; + y2: number; } -interface DOMStringMap { -} -declare var DOMStringMap: { - prototype: DOMStringMap; - new(): DOMStringMap; +declare var SVGPathSegCurvetoCubicAbs: { + prototype: SVGPathSegCurvetoCubicAbs; + new(): SVGPathSegCurvetoCubicAbs; } -interface DeviceOrientationEvent extends Event { - gamma: number; - alpha: number; - absolute: boolean; - beta: number; - initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number, beta: number, gamma: number, absolute: boolean): void; -} -declare var DeviceOrientationEvent: { - prototype: DeviceOrientationEvent; - new(): DeviceOrientationEvent; +interface SVGPathSegCurvetoCubicRel extends SVGPathSeg { + x: number; + x1: number; + x2: number; + y: number; + y1: number; + y2: number; } -interface MSMediaKeys { - keySystem: string; - createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession; -} -declare var MSMediaKeys: { - prototype: MSMediaKeys; - new(keySystem: string): MSMediaKeys; - isTypeSupported(keySystem: string, type?: string): boolean; +declare var SVGPathSegCurvetoCubicRel: { + prototype: SVGPathSegCurvetoCubicRel; + new(): SVGPathSegCurvetoCubicRel; } -interface MSMediaKeyMessageEvent extends Event { - destinationURL: string; - message: Uint8Array; -} -declare var MSMediaKeyMessageEvent: { - prototype: MSMediaKeyMessageEvent; - new(): MSMediaKeyMessageEvent; +interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg { + x: number; + x2: number; + y: number; + y2: number; } -interface MSHTMLWebViewElement extends HTMLElement { - documentTitle: string; - width: number; - src: string; - canGoForward: boolean; +declare var SVGPathSegCurvetoCubicSmoothAbs: { + prototype: SVGPathSegCurvetoCubicSmoothAbs; + new(): SVGPathSegCurvetoCubicSmoothAbs; +} + +interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { + x: number; + x2: number; + y: number; + y2: number; +} + +declare var SVGPathSegCurvetoCubicSmoothRel: { + prototype: SVGPathSegCurvetoCubicSmoothRel; + new(): SVGPathSegCurvetoCubicSmoothRel; +} + +interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg { + x: number; + x1: number; + y: number; + y1: number; +} + +declare var SVGPathSegCurvetoQuadraticAbs: { + prototype: SVGPathSegCurvetoQuadraticAbs; + new(): SVGPathSegCurvetoQuadraticAbs; +} + +interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { + x: number; + x1: number; + y: number; + y1: number; +} + +declare var SVGPathSegCurvetoQuadraticRel: { + prototype: SVGPathSegCurvetoQuadraticRel; + new(): SVGPathSegCurvetoQuadraticRel; +} + +interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegCurvetoQuadraticSmoothAbs: { + prototype: SVGPathSegCurvetoQuadraticSmoothAbs; + new(): SVGPathSegCurvetoQuadraticSmoothAbs; +} + +interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegCurvetoQuadraticSmoothRel: { + prototype: SVGPathSegCurvetoQuadraticSmoothRel; + new(): SVGPathSegCurvetoQuadraticSmoothRel; +} + +interface SVGPathSegLinetoAbs extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegLinetoAbs: { + prototype: SVGPathSegLinetoAbs; + new(): SVGPathSegLinetoAbs; +} + +interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg { + x: number; +} + +declare var SVGPathSegLinetoHorizontalAbs: { + prototype: SVGPathSegLinetoHorizontalAbs; + new(): SVGPathSegLinetoHorizontalAbs; +} + +interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg { + x: number; +} + +declare var SVGPathSegLinetoHorizontalRel: { + prototype: SVGPathSegLinetoHorizontalRel; + new(): SVGPathSegLinetoHorizontalRel; +} + +interface SVGPathSegLinetoRel extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegLinetoRel: { + prototype: SVGPathSegLinetoRel; + new(): SVGPathSegLinetoRel; +} + +interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg { + y: number; +} + +declare var SVGPathSegLinetoVerticalAbs: { + prototype: SVGPathSegLinetoVerticalAbs; + new(): SVGPathSegLinetoVerticalAbs; +} + +interface SVGPathSegLinetoVerticalRel extends SVGPathSeg { + y: number; +} + +declare var SVGPathSegLinetoVerticalRel: { + prototype: SVGPathSegLinetoVerticalRel; + new(): SVGPathSegLinetoVerticalRel; +} + +interface SVGPathSegList { + numberOfItems: number; + appendItem(newItem: SVGPathSeg): SVGPathSeg; + clear(): void; + getItem(index: number): SVGPathSeg; + initialize(newItem: SVGPathSeg): SVGPathSeg; + insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg; + removeItem(index: number): SVGPathSeg; + replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg; +} + +declare var SVGPathSegList: { + prototype: SVGPathSegList; + new(): SVGPathSegList; +} + +interface SVGPathSegMovetoAbs extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegMovetoAbs: { + prototype: SVGPathSegMovetoAbs; + new(): SVGPathSegMovetoAbs; +} + +interface SVGPathSegMovetoRel extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegMovetoRel: { + prototype: SVGPathSegMovetoRel; + new(): SVGPathSegMovetoRel; +} + +interface SVGPatternElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGURIReference, SVGUnitTypes { + height: SVGAnimatedLength; + patternContentUnits: SVGAnimatedEnumeration; + patternTransform: SVGAnimatedTransformList; + patternUnits: SVGAnimatedEnumeration; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPatternElement: { + prototype: SVGPatternElement; + new(): SVGPatternElement; +} + +interface SVGPoint { + x: number; + y: number; + matrixTransform(matrix: SVGMatrix): SVGPoint; +} + +declare var SVGPoint: { + prototype: SVGPoint; + new(): SVGPoint; +} + +interface SVGPointList { + numberOfItems: number; + appendItem(newItem: SVGPoint): SVGPoint; + clear(): void; + getItem(index: number): SVGPoint; + initialize(newItem: SVGPoint): SVGPoint; + insertItemBefore(newItem: SVGPoint, index: number): SVGPoint; + removeItem(index: number): SVGPoint; + replaceItem(newItem: SVGPoint, index: number): SVGPoint; +} + +declare var SVGPointList: { + prototype: SVGPointList; + new(): SVGPointList; +} + +interface SVGPolygonElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPolygonElement: { + prototype: SVGPolygonElement; + new(): SVGPolygonElement; +} + +interface SVGPolylineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPolylineElement: { + prototype: SVGPolylineElement; + new(): SVGPolylineElement; +} + +interface SVGPreserveAspectRatio { + align: number; + meetOrSlice: number; + SVG_MEETORSLICE_MEET: number; + SVG_MEETORSLICE_SLICE: number; + SVG_MEETORSLICE_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_NONE: number; + SVG_PRESERVEASPECTRATIO_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; + SVG_PRESERVEASPECTRATIO_XMAXYMID: number; + SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; + SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; + SVG_PRESERVEASPECTRATIO_XMIDYMID: number; + SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; + SVG_PRESERVEASPECTRATIO_XMINYMAX: number; + SVG_PRESERVEASPECTRATIO_XMINYMID: number; + SVG_PRESERVEASPECTRATIO_XMINYMIN: number; +} + +declare var SVGPreserveAspectRatio: { + prototype: SVGPreserveAspectRatio; + new(): SVGPreserveAspectRatio; + SVG_MEETORSLICE_MEET: number; + SVG_MEETORSLICE_SLICE: number; + SVG_MEETORSLICE_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_NONE: number; + SVG_PRESERVEASPECTRATIO_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; + SVG_PRESERVEASPECTRATIO_XMAXYMID: number; + SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; + SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; + SVG_PRESERVEASPECTRATIO_XMIDYMID: number; + SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; + SVG_PRESERVEASPECTRATIO_XMINYMAX: number; + SVG_PRESERVEASPECTRATIO_XMINYMID: number; + SVG_PRESERVEASPECTRATIO_XMINYMIN: number; +} + +interface SVGRadialGradientElement extends SVGGradientElement { + cx: SVGAnimatedLength; + cy: SVGAnimatedLength; + fx: SVGAnimatedLength; + fy: SVGAnimatedLength; + r: SVGAnimatedLength; +} + +declare var SVGRadialGradientElement: { + prototype: SVGRadialGradientElement; + new(): SVGRadialGradientElement; +} + +interface SVGRect { height: number; - canGoBack: boolean; - navigateWithHttpRequestMessage(requestMessage: any): void; - goBack(): void; - navigate(uri: string): void; - stop(): void; - navigateToString(contents: string): void; - captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation; - capturePreviewToBlobAsync(): MSWebViewAsyncOperation; - refresh(): void; - goForward(): void; - navigateToLocalStreamUri(source: string, streamResolver: any): void; - invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation; - buildLocalStreamUri(contentIdentifier: string, relativePath: string): string; -} -declare var MSHTMLWebViewElement: { - prototype: MSHTMLWebViewElement; - new(): MSHTMLWebViewElement; + width: number; + x: number; + y: number; } -interface NavigationEvent extends Event { - uri: string; -} -declare var NavigationEvent: { - prototype: NavigationEvent; - new(): NavigationEvent; +declare var SVGRect: { + prototype: SVGRect; + new(): SVGRect; } -interface RandomSource { - getRandomValues(array: ArrayBufferView): ArrayBufferView; +interface SVGRectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + height: SVGAnimatedLength; + rx: SVGAnimatedLength; + ry: SVGAnimatedLength; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGRectElement: { + prototype: SVGRectElement; + new(): SVGRectElement; +} + +interface SVGSVGElement extends SVGElement, DocumentEvent, SVGLocatable, SVGTests, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan { + contentScriptType: string; + contentStyleType: string; + currentScale: number; + currentTranslate: SVGPoint; + height: SVGAnimatedLength; + onabort: (ev: Event) => any; + onerror: (ev: Event) => any; + onresize: (ev: UIEvent) => any; + onscroll: (ev: UIEvent) => any; + onunload: (ev: Event) => any; + onzoom: (ev: SVGZoomEvent) => any; + pixelUnitToMillimeterX: number; + pixelUnitToMillimeterY: number; + screenPixelToMillimeterX: number; + screenPixelToMillimeterY: number; + viewport: SVGRect; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + checkEnclosure(element: SVGElement, rect: SVGRect): boolean; + checkIntersection(element: SVGElement, rect: SVGRect): boolean; + createSVGAngle(): SVGAngle; + createSVGLength(): SVGLength; + createSVGMatrix(): SVGMatrix; + createSVGNumber(): SVGNumber; + createSVGPoint(): SVGPoint; + createSVGRect(): SVGRect; + createSVGTransform(): SVGTransform; + createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; + deselectAll(): void; + forceRedraw(): void; + getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; + getCurrentTime(): number; + getElementById(elementId: string): Element; + getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeList; + getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeList; + pauseAnimations(): void; + setCurrentTime(seconds: number): void; + suspendRedraw(maxWaitMilliseconds: number): number; + unpauseAnimations(): void; + unsuspendRedraw(suspendHandleID: number): void; + unsuspendRedrawAll(): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "SVGAbort", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "SVGError", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "SVGUnload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "SVGZoom", listener: (ev: SVGZoomEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGSVGElement: { + prototype: SVGSVGElement; + new(): SVGSVGElement; +} + +interface SVGScriptElement extends SVGElement, SVGExternalResourcesRequired, SVGURIReference { + type: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGScriptElement: { + prototype: SVGScriptElement; + new(): SVGScriptElement; +} + +interface SVGStopElement extends SVGElement, SVGStylable { + offset: SVGAnimatedNumber; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGStopElement: { + prototype: SVGStopElement; + new(): SVGStopElement; +} + +interface SVGStringList { + numberOfItems: number; + appendItem(newItem: string): string; + clear(): void; + getItem(index: number): string; + initialize(newItem: string): string; + insertItemBefore(newItem: string, index: number): string; + removeItem(index: number): string; + replaceItem(newItem: string, index: number): string; +} + +declare var SVGStringList: { + prototype: SVGStringList; + new(): SVGStringList; +} + +interface SVGStyleElement extends SVGElement, SVGLangSpace { + media: string; + title: string; + type: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGStyleElement: { + prototype: SVGStyleElement; + new(): SVGStyleElement; +} + +interface SVGSwitchElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGSwitchElement: { + prototype: SVGSwitchElement; + new(): SVGSwitchElement; +} + +interface SVGSymbolElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGSymbolElement: { + prototype: SVGSymbolElement; + new(): SVGSymbolElement; +} + +interface SVGTSpanElement extends SVGTextPositioningElement { +} + +declare var SVGTSpanElement: { + prototype: SVGTSpanElement; + new(): SVGTSpanElement; +} + +interface SVGTextContentElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + lengthAdjust: SVGAnimatedEnumeration; + textLength: SVGAnimatedLength; + getCharNumAtPosition(point: SVGPoint): number; + getComputedTextLength(): number; + getEndPositionOfChar(charnum: number): SVGPoint; + getExtentOfChar(charnum: number): SVGRect; + getNumberOfChars(): number; + getRotationOfChar(charnum: number): number; + getStartPositionOfChar(charnum: number): SVGPoint; + getSubStringLength(charnum: number, nchars: number): number; + selectSubString(charnum: number, nchars: number): void; + LENGTHADJUST_SPACING: number; + LENGTHADJUST_SPACINGANDGLYPHS: number; + LENGTHADJUST_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTextContentElement: { + prototype: SVGTextContentElement; + new(): SVGTextContentElement; + LENGTHADJUST_SPACING: number; + LENGTHADJUST_SPACINGANDGLYPHS: number; + LENGTHADJUST_UNKNOWN: number; +} + +interface SVGTextElement extends SVGTextPositioningElement, SVGTransformable { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTextElement: { + prototype: SVGTextElement; + new(): SVGTextElement; +} + +interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { + method: SVGAnimatedEnumeration; + spacing: SVGAnimatedEnumeration; + startOffset: SVGAnimatedLength; + TEXTPATH_METHODTYPE_ALIGN: number; + TEXTPATH_METHODTYPE_STRETCH: number; + TEXTPATH_METHODTYPE_UNKNOWN: number; + TEXTPATH_SPACINGTYPE_AUTO: number; + TEXTPATH_SPACINGTYPE_EXACT: number; + TEXTPATH_SPACINGTYPE_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTextPathElement: { + prototype: SVGTextPathElement; + new(): SVGTextPathElement; + TEXTPATH_METHODTYPE_ALIGN: number; + TEXTPATH_METHODTYPE_STRETCH: number; + TEXTPATH_METHODTYPE_UNKNOWN: number; + TEXTPATH_SPACINGTYPE_AUTO: number; + TEXTPATH_SPACINGTYPE_EXACT: number; + TEXTPATH_SPACINGTYPE_UNKNOWN: number; +} + +interface SVGTextPositioningElement extends SVGTextContentElement { + dx: SVGAnimatedLengthList; + dy: SVGAnimatedLengthList; + rotate: SVGAnimatedNumberList; + x: SVGAnimatedLengthList; + y: SVGAnimatedLengthList; +} + +declare var SVGTextPositioningElement: { + prototype: SVGTextPositioningElement; + new(): SVGTextPositioningElement; +} + +interface SVGTitleElement extends SVGElement, SVGStylable, SVGLangSpace { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTitleElement: { + prototype: SVGTitleElement; + new(): SVGTitleElement; +} + +interface SVGTransform { + angle: number; + matrix: SVGMatrix; + type: number; + setMatrix(matrix: SVGMatrix): void; + setRotate(angle: number, cx: number, cy: number): void; + setScale(sx: number, sy: number): void; + setSkewX(angle: number): void; + setSkewY(angle: number): void; + setTranslate(tx: number, ty: number): void; + SVG_TRANSFORM_MATRIX: number; + SVG_TRANSFORM_ROTATE: number; + SVG_TRANSFORM_SCALE: number; + SVG_TRANSFORM_SKEWX: number; + SVG_TRANSFORM_SKEWY: number; + SVG_TRANSFORM_TRANSLATE: number; + SVG_TRANSFORM_UNKNOWN: number; +} + +declare var SVGTransform: { + prototype: SVGTransform; + new(): SVGTransform; + SVG_TRANSFORM_MATRIX: number; + SVG_TRANSFORM_ROTATE: number; + SVG_TRANSFORM_SCALE: number; + SVG_TRANSFORM_SKEWX: number; + SVG_TRANSFORM_SKEWY: number; + SVG_TRANSFORM_TRANSLATE: number; + SVG_TRANSFORM_UNKNOWN: number; +} + +interface SVGTransformList { + numberOfItems: number; + appendItem(newItem: SVGTransform): SVGTransform; + clear(): void; + consolidate(): SVGTransform; + createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; + getItem(index: number): SVGTransform; + initialize(newItem: SVGTransform): SVGTransform; + insertItemBefore(newItem: SVGTransform, index: number): SVGTransform; + removeItem(index: number): SVGTransform; + replaceItem(newItem: SVGTransform, index: number): SVGTransform; +} + +declare var SVGTransformList: { + prototype: SVGTransformList; + new(): SVGTransformList; +} + +interface SVGUnitTypes { + SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; + SVG_UNIT_TYPE_UNKNOWN: number; + SVG_UNIT_TYPE_USERSPACEONUSE: number; +} +declare var SVGUnitTypes: SVGUnitTypes; + +interface SVGUseElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { + animatedInstanceRoot: SVGElementInstance; + height: SVGAnimatedLength; + instanceRoot: SVGElementInstance; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGUseElement: { + prototype: SVGUseElement; + new(): SVGUseElement; +} + +interface SVGViewElement extends SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan { + viewTarget: SVGStringList; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGViewElement: { + prototype: SVGViewElement; + new(): SVGViewElement; +} + +interface SVGZoomAndPan { + SVG_ZOOMANDPAN_DISABLE: number; + SVG_ZOOMANDPAN_MAGNIFY: number; + SVG_ZOOMANDPAN_UNKNOWN: number; +} +declare var SVGZoomAndPan: SVGZoomAndPan; + +interface SVGZoomEvent extends UIEvent { + newScale: number; + newTranslate: SVGPoint; + previousScale: number; + previousTranslate: SVGPoint; + zoomRectScreen: SVGRect; +} + +declare var SVGZoomEvent: { + prototype: SVGZoomEvent; + new(): SVGZoomEvent; +} + +interface Screen extends EventTarget { + availHeight: number; + availWidth: number; + bufferDepth: number; + colorDepth: number; + deviceXDPI: number; + deviceYDPI: number; + fontSmoothingEnabled: boolean; + height: number; + logicalXDPI: number; + logicalYDPI: number; + msOrientation: string; + onmsorientationchange: (ev: Event) => any; + pixelDepth: number; + systemXDPI: number; + systemYDPI: number; + width: number; + msLockOrientation(orientations: string): boolean; + msLockOrientation(orientations: string[]): boolean; + msUnlockOrientation(): void; + addEventListener(type: "MSOrientationChange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Screen: { + prototype: Screen; + new(): Screen; +} + +interface ScriptNotifyEvent extends Event { + callingUri: string; + value: string; +} + +declare var ScriptNotifyEvent: { + prototype: ScriptNotifyEvent; + new(): ScriptNotifyEvent; +} + +interface ScriptProcessorNode extends AudioNode { + bufferSize: number; + onaudioprocess: (ev: AudioProcessingEvent) => any; + addEventListener(type: "audioprocess", listener: (ev: AudioProcessingEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var ScriptProcessorNode: { + prototype: ScriptProcessorNode; + new(): ScriptProcessorNode; +} + +interface Selection { + anchorNode: Node; + anchorOffset: number; + focusNode: Node; + focusOffset: number; + isCollapsed: boolean; + rangeCount: number; + type: string; + addRange(range: Range): void; + collapse(parentNode: Node, offset: number): void; + collapseToEnd(): void; + collapseToStart(): void; + containsNode(node: Node, partlyContained: boolean): boolean; + deleteFromDocument(): void; + empty(): void; + extend(newNode: Node, offset: number): void; + getRangeAt(index: number): Range; + removeAllRanges(): void; + removeRange(range: Range): void; + selectAllChildren(parentNode: Node): void; + setBaseAndExtent(baseNode: Node, baseOffset: number, extentNode: Node, extentOffset: number): void; + toString(): string; +} + +declare var Selection: { + prototype: Selection; + new(): Selection; } interface SourceBuffer extends EventTarget { - updating: boolean; - appendWindowStart: number; appendWindowEnd: number; - buffered: TimeRanges; - timestampOffset: number; + appendWindowStart: number; audioTracks: AudioTrackList; - appendBuffer(data: ArrayBuffer): void; - remove(start: number, end: number): void; + buffered: TimeRanges; + mode: string; + timestampOffset: number; + updating: boolean; + videoTracks: VideoTrackList; abort(): void; + appendBuffer(data: ArrayBuffer): void; + appendBuffer(data: ArrayBufferView): void; appendStream(stream: MSStream, maxSize?: number): void; + remove(start: number, end: number): void; } + declare var SourceBuffer: { prototype: SourceBuffer; new(): SourceBuffer; } -interface MSInputMethodContext extends EventTarget { - oncandidatewindowshow: (ev: any) => any; - target: HTMLElement; - compositionStartOffset: number; - oncandidatewindowhide: (ev: any) => any; - oncandidatewindowupdate: (ev: any) => any; - compositionEndOffset: number; - getCompositionAlternatives(): string[]; - getCandidateWindowClientRect(): ClientRect; - hasComposition(): boolean; - isCandidateWindowVisible(): boolean; - addEventListener(type: "candidatewindowshow", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "candidatewindowhide", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "candidatewindowupdate", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var MSInputMethodContext: { - prototype: MSInputMethodContext; - new(): MSInputMethodContext; -} - -interface DeviceRotationRate { - gamma: number; - alpha: number; - beta: number; -} -declare var DeviceRotationRate: { - prototype: DeviceRotationRate; - new(): DeviceRotationRate; -} - -interface PluginArray { - length: number; - refresh(reload?: boolean): void; - item(index: number): Plugin; - [index: number]: Plugin; - namedItem(name: string): Plugin; - // [name: string]: Plugin; -} -declare var PluginArray: { - prototype: PluginArray; - new(): PluginArray; -} - -interface MSMediaKeyError { - systemCode: number; - code: number; - MS_MEDIA_KEYERR_SERVICE: number; - MS_MEDIA_KEYERR_HARDWARECHANGE: number; - MS_MEDIA_KEYERR_OUTPUT: number; - MS_MEDIA_KEYERR_DOMAIN: number; - MS_MEDIA_KEYERR_UNKNOWN: number; - MS_MEDIA_KEYERR_CLIENT: number; -} -declare var MSMediaKeyError: { - prototype: MSMediaKeyError; - new(): MSMediaKeyError; - MS_MEDIA_KEYERR_SERVICE: number; - MS_MEDIA_KEYERR_HARDWARECHANGE: number; - MS_MEDIA_KEYERR_OUTPUT: number; - MS_MEDIA_KEYERR_DOMAIN: number; - MS_MEDIA_KEYERR_UNKNOWN: number; - MS_MEDIA_KEYERR_CLIENT: number; -} - -interface Plugin { - length: number; - filename: string; - version: string; - name: string; - description: string; - item(index: number): MimeType; - [index: number]: MimeType; - namedItem(type: string): MimeType; - // [type: string]: MimeType; -} -declare var Plugin: { - prototype: Plugin; - new(): Plugin; -} - -interface MediaSource extends EventTarget { - sourceBuffers: SourceBufferList; - duration: number; - readyState: string; - activeSourceBuffers: SourceBufferList; - addSourceBuffer(type: string): SourceBuffer; - endOfStream(error?: string): void; - removeSourceBuffer(sourceBuffer: SourceBuffer): void; -} -declare var MediaSource: { - prototype: MediaSource; - new(): MediaSource; - isTypeSupported(type: string): boolean; -} - interface SourceBufferList extends EventTarget { length: number; item(index: number): SourceBuffer; [index: number]: SourceBuffer; } + declare var SourceBufferList: { prototype: SourceBufferList; new(): SourceBufferList; } -interface XMLDocument extends Document { -} -declare var XMLDocument: { - prototype: XMLDocument; - new(): XMLDocument; +interface StereoPannerNode extends AudioNode { + pan: AudioParam; } -interface DeviceMotionEvent extends Event { - rotationRate: DeviceRotationRate; - acceleration: DeviceAcceleration; - interval: number; - accelerationIncludingGravity: DeviceAcceleration; - initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict, accelerationIncludingGravity: DeviceAccelerationDict, rotationRate: DeviceRotationRateDict, interval: number): void; -} -declare var DeviceMotionEvent: { - prototype: DeviceMotionEvent; - new(): DeviceMotionEvent; +declare var StereoPannerNode: { + prototype: StereoPannerNode; + new(): StereoPannerNode; } -interface MimeType { - enabledPlugin: Plugin; - suffixes: string; +interface Storage { + length: number; + clear(): void; + getItem(key: string): any; + key(index: number): string; + removeItem(key: string): void; + setItem(key: string, data: string): void; + [key: string]: any; + [index: number]: string; +} + +declare var Storage: { + prototype: Storage; + new(): Storage; +} + +interface StorageEvent extends Event { + key: string; + newValue: any; + oldValue: any; + storageArea: Storage; + url: string; + initStorageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, keyArg: string, oldValueArg: any, newValueArg: any, urlArg: string, storageAreaArg: Storage): void; +} + +declare var StorageEvent: { + prototype: StorageEvent; + new(): StorageEvent; +} + +interface StyleMedia { type: string; - description: string; -} -declare var MimeType: { - prototype: MimeType; - new(): MimeType; + matchMedium(mediaquery: string): boolean; } -interface PointerEvent extends MouseEvent { +declare var StyleMedia: { + prototype: StyleMedia; + new(): StyleMedia; +} + +interface StyleSheet { + disabled: boolean; + href: string; + media: MediaList; + ownerNode: Node; + parentStyleSheet: StyleSheet; + title: string; + type: string; +} + +declare var StyleSheet: { + prototype: StyleSheet; + new(): StyleSheet; +} + +interface StyleSheetList { + length: number; + item(index?: number): StyleSheet; + [index: number]: StyleSheet; +} + +declare var StyleSheetList: { + prototype: StyleSheetList; + new(): StyleSheetList; +} + +interface StyleSheetPageList { + length: number; + item(index: number): CSSPageRule; + [index: number]: CSSPageRule; +} + +declare var StyleSheetPageList: { + prototype: StyleSheetPageList; + new(): StyleSheetPageList; +} + +interface SubtleCrypto { + decrypt(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; + decrypt(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; + deriveBits(algorithm: string, baseKey: CryptoKey, length: number): any; + deriveBits(algorithm: Algorithm, baseKey: CryptoKey, length: number): any; + deriveKey(algorithm: string, baseKey: CryptoKey, derivedKeyType: string, extractable: boolean, keyUsages: string[]): any; + deriveKey(algorithm: string, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: boolean, keyUsages: string[]): any; + deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: string, extractable: boolean, keyUsages: string[]): any; + deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: boolean, keyUsages: string[]): any; + digest(algorithm: string, data: ArrayBufferView): any; + digest(algorithm: Algorithm, data: ArrayBufferView): any; + encrypt(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; + encrypt(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; + exportKey(format: string, key: CryptoKey): any; + generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): any; + generateKey(algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + importKey(format: string, keyData: ArrayBufferView, algorithm: string, extractable: boolean, keyUsages: string[]): any; + importKey(format: string, keyData: ArrayBufferView, algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + sign(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; + sign(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + verify(algorithm: string, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): any; + verify(algorithm: Algorithm, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): any; + wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string): any; + wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: Algorithm): any; +} + +declare var SubtleCrypto: { + prototype: SubtleCrypto; + new(): SubtleCrypto; +} + +interface Text extends CharacterData { + wholeText: string; + replaceWholeText(content: string): Text; + splitText(offset: number): Text; +} + +declare var Text: { + prototype: Text; + new(): Text; +} + +interface TextEvent extends UIEvent { + data: string; + inputMethod: number; + locale: string; + initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void; + DOM_INPUT_METHOD_DROP: number; + DOM_INPUT_METHOD_HANDWRITING: number; + DOM_INPUT_METHOD_IME: number; + DOM_INPUT_METHOD_KEYBOARD: number; + DOM_INPUT_METHOD_MULTIMODAL: number; + DOM_INPUT_METHOD_OPTION: number; + DOM_INPUT_METHOD_PASTE: number; + DOM_INPUT_METHOD_SCRIPT: number; + DOM_INPUT_METHOD_UNKNOWN: number; + DOM_INPUT_METHOD_VOICE: number; +} + +declare var TextEvent: { + prototype: TextEvent; + new(): TextEvent; + DOM_INPUT_METHOD_DROP: number; + DOM_INPUT_METHOD_HANDWRITING: number; + DOM_INPUT_METHOD_IME: number; + DOM_INPUT_METHOD_KEYBOARD: number; + DOM_INPUT_METHOD_MULTIMODAL: number; + DOM_INPUT_METHOD_OPTION: number; + DOM_INPUT_METHOD_PASTE: number; + DOM_INPUT_METHOD_SCRIPT: number; + DOM_INPUT_METHOD_UNKNOWN: number; + DOM_INPUT_METHOD_VOICE: number; +} + +interface TextMetrics { width: number; - rotation: number; - pressure: number; - pointerType: any; - isPrimary: boolean; - tiltY: number; - height: number; - intermediatePoints: any; - currentPoint: any; - tiltX: number; - hwTimestamp: number; - pointerId: number; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; -} -declare var PointerEvent: { - prototype: PointerEvent; - new(): PointerEvent; } -interface MSDocumentExtensions { - captureEvents(): void; - releaseEvents(): void; +declare var TextMetrics: { + prototype: TextMetrics; + new(): TextMetrics; } -interface MutationObserver { - observe(target: Node, options: MutationObserverInit): void; - takeRecords(): MutationRecord[]; - disconnect(): void; -} -declare var MutationObserver: { - prototype: MutationObserver; - new (callback: (arr: MutationRecord[], observer: MutationObserver)=>any): MutationObserver; +interface TextRange { + boundingHeight: number; + boundingLeft: number; + boundingTop: number; + boundingWidth: number; + htmlText: string; + offsetLeft: number; + offsetTop: number; + text: string; + collapse(start?: boolean): void; + compareEndPoints(how: string, sourceRange: TextRange): number; + duplicate(): TextRange; + execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; + execCommandShowHelp(cmdID: string): boolean; + expand(Unit: string): boolean; + findText(string: string, count?: number, flags?: number): boolean; + getBookmark(): string; + getBoundingClientRect(): ClientRect; + getClientRects(): ClientRectList; + inRange(range: TextRange): boolean; + isEqual(range: TextRange): boolean; + move(unit: string, count?: number): number; + moveEnd(unit: string, count?: number): number; + moveStart(unit: string, count?: number): number; + moveToBookmark(bookmark: string): boolean; + moveToElementText(element: Element): void; + moveToPoint(x: number, y: number): void; + parentElement(): Element; + pasteHTML(html: string): void; + queryCommandEnabled(cmdID: string): boolean; + queryCommandIndeterm(cmdID: string): boolean; + queryCommandState(cmdID: string): boolean; + queryCommandSupported(cmdID: string): boolean; + queryCommandText(cmdID: string): string; + queryCommandValue(cmdID: string): any; + scrollIntoView(fStart?: boolean): void; + select(): void; + setEndPoint(how: string, SourceRange: TextRange): void; } -interface MSWebViewAsyncOperation extends EventTarget { - target: MSHTMLWebViewElement; - oncomplete: (ev: Event) => any; - error: DOMError; - onerror: (ev: ErrorEvent) => any; +declare var TextRange: { + prototype: TextRange; + new(): TextRange; +} + +interface TextRangeCollection { + length: number; + item(index: number): TextRange; + [index: number]: TextRange; +} + +declare var TextRangeCollection: { + prototype: TextRangeCollection; + new(): TextRangeCollection; +} + +interface TextTrack extends EventTarget { + activeCues: TextTrackCueList; + cues: TextTrackCueList; + inBandMetadataTrackDispatchType: string; + kind: string; + label: string; + language: string; + mode: any; + oncuechange: (ev: Event) => any; + onerror: (ev: Event) => any; + onload: (ev: Event) => any; readyState: number; - type: number; - result: any; - start(): void; + addCue(cue: TextTrackCue): void; + removeCue(cue: TextTrackCue): void; + DISABLED: number; ERROR: number; - TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; - TYPE_INVOKE_SCRIPT: number; - COMPLETED: number; - TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; - STARTED: number; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + HIDDEN: number; + LOADED: number; + LOADING: number; + NONE: number; + SHOWING: number; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -declare var MSWebViewAsyncOperation: { - prototype: MSWebViewAsyncOperation; - new(): MSWebViewAsyncOperation; + +declare var TextTrack: { + prototype: TextTrack; + new(): TextTrack; + DISABLED: number; ERROR: number; - TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; - TYPE_INVOKE_SCRIPT: number; - COMPLETED: number; - TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; - STARTED: number; + HIDDEN: number; + LOADED: number; + LOADING: number; + NONE: number; + SHOWING: number; } -interface ScriptNotifyEvent extends Event { - value: string; - callingUri: string; -} -declare var ScriptNotifyEvent: { - prototype: ScriptNotifyEvent; - new(): ScriptNotifyEvent; +interface TextTrackCue extends EventTarget { + endTime: number; + id: string; + onenter: (ev: Event) => any; + onexit: (ev: Event) => any; + pauseOnExit: boolean; + startTime: number; + text: string; + track: TextTrack; + getCueAsHTML(): DocumentFragment; + addEventListener(type: "enter", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "exit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface PerformanceNavigationTiming extends PerformanceEntry { - redirectStart: number; - domainLookupEnd: number; - responseStart: number; - domComplete: number; - domainLookupStart: number; - loadEventStart: number; - unloadEventEnd: number; - fetchStart: number; - requestStart: number; - domInteractive: number; - navigationStart: number; - connectEnd: number; - loadEventEnd: number; - connectStart: number; - responseEnd: number; - domLoading: number; - redirectEnd: number; - redirectCount: number; - unloadEventStart: number; - domContentLoadedEventStart: number; - domContentLoadedEventEnd: number; - type: string; -} -declare var PerformanceNavigationTiming: { - prototype: PerformanceNavigationTiming; - new(): PerformanceNavigationTiming; +declare var TextTrackCue: { + prototype: TextTrackCue; + new(startTime: number, endTime: number, text: string): TextTrackCue; } -interface MSMediaKeyNeededEvent extends Event { - initData: Uint8Array; -} -declare var MSMediaKeyNeededEvent: { - prototype: MSMediaKeyNeededEvent; - new(): MSMediaKeyNeededEvent; +interface TextTrackCueList { + length: number; + getCueById(id: string): TextTrackCue; + item(index: number): TextTrackCue; + [index: number]: TextTrackCue; } -interface LongRunningScriptDetectedEvent extends Event { - stopPageScriptExecution: boolean; - executionTime: number; -} -declare var LongRunningScriptDetectedEvent: { - prototype: LongRunningScriptDetectedEvent; - new(): LongRunningScriptDetectedEvent; +declare var TextTrackCueList: { + prototype: TextTrackCueList; + new(): TextTrackCueList; } -interface MSAppView { - viewId: number; - close(): void; - postMessage(message: any, targetOrigin: string, ports?: any): void; -} -declare var MSAppView: { - prototype: MSAppView; - new(): MSAppView; +interface TextTrackList extends EventTarget { + length: number; + onaddtrack: (ev: TrackEvent) => any; + item(index: number): TextTrack; + addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: TextTrack; } -interface PerfWidgetExternal { - maxCpuSpeed: number; - independentRenderingEnabled: boolean; - irDisablingContentString: string; - irStatusAvailable: boolean; - performanceCounter: number; - averagePaintTime: number; - activeNetworkRequestCount: number; - paintRequestsPerSecond: number; - extraInformationEnabled: boolean; - performanceCounterFrequency: number; - averageFrameTime: number; - repositionWindow(x: number, y: number): void; - getRecentMemoryUsage(last: number): any; - getMemoryUsage(): number; - resizeWindow(width: number, height: number): void; - getProcessCpuUsage(): number; - removeEventListener(eventType: string, callback: (ev: any) => any): void; - getRecentCpuUsage(last: number): any; - addEventListener(eventType: string, callback: (ev: any) => any): void; - getRecentFrames(last: number): any; - getRecentPaintRequests(last: number): any; -} -declare var PerfWidgetExternal: { - prototype: PerfWidgetExternal; - new(): PerfWidgetExternal; +declare var TextTrackList: { + prototype: TextTrackList; + new(): TextTrackList; } -interface PageTransitionEvent extends Event { - persisted: boolean; -} -declare var PageTransitionEvent: { - prototype: PageTransitionEvent; - new(): PageTransitionEvent; +interface TimeRanges { + length: number; + end(index: number): number; + start(index: number): number; } -interface MutationCallback { - (mutations: MutationRecord[], observer: MutationObserver): void; +declare var TimeRanges: { + prototype: TimeRanges; + new(): TimeRanges; } -interface HTMLDocument extends Document { -} -declare var HTMLDocument: { - prototype: HTMLDocument; - new(): HTMLDocument; +interface Touch { + clientX: number; + clientY: number; + identifier: number; + pageX: number; + pageY: number; + screenX: number; + screenY: number; + target: EventTarget; } -interface KeyPair { - privateKey: Key; - publicKey: Key; -} -declare var KeyPair: { - prototype: KeyPair; - new(): KeyPair; +declare var Touch: { + prototype: Touch; + new(): Touch; } -interface MSMediaKeySession extends EventTarget { - sessionId: string; - error: MSMediaKeyError; - keySystem: string; - close(): void; - update(key: Uint8Array): void; -} -declare var MSMediaKeySession: { - prototype: MSMediaKeySession; - new(): MSMediaKeySession; +interface TouchEvent extends UIEvent { + altKey: boolean; + changedTouches: TouchList; + ctrlKey: boolean; + metaKey: boolean; + shiftKey: boolean; + targetTouches: TouchList; + touches: TouchList; } -interface UnviewableContentIdentifiedEvent extends NavigationEvent { - referrer: string; +declare var TouchEvent: { + prototype: TouchEvent; + new(): TouchEvent; } + +interface TouchList { + length: number; + item(index: number): Touch; + [index: number]: Touch; +} + +declare var TouchList: { + prototype: TouchList; + new(): TouchList; +} + +interface TrackEvent extends Event { + track: any; +} + +declare var TrackEvent: { + prototype: TrackEvent; + new(): TrackEvent; +} + +interface TransitionEvent extends Event { + elapsedTime: number; + propertyName: string; + initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void; +} + +declare var TransitionEvent: { + prototype: TransitionEvent; + new(): TransitionEvent; +} + +interface TreeWalker { + currentNode: Node; + expandEntityReferences: boolean; + filter: NodeFilter; + root: Node; + whatToShow: number; + firstChild(): Node; + lastChild(): Node; + nextNode(): Node; + nextSibling(): Node; + parentNode(): Node; + previousNode(): Node; + previousSibling(): Node; +} + +declare var TreeWalker: { + prototype: TreeWalker; + new(): TreeWalker; +} + +interface UIEvent extends Event { + detail: number; + view: Window; + initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void; +} + +declare var UIEvent: { + prototype: UIEvent; + new(type: string, eventInitDict?: UIEventInit): UIEvent; +} + +interface URL { + createObjectURL(object: any, options?: ObjectURLOptions): string; + revokeObjectURL(url: string): void; +} +declare var URL: URL; + +interface UnviewableContentIdentifiedEvent extends NavigationEventWithReferrer { + mediaType: string; +} + declare var UnviewableContentIdentifiedEvent: { prototype: UnviewableContentIdentifiedEvent; new(): UnviewableContentIdentifiedEvent; } -interface CryptoOperation extends EventTarget { - algorithm: Algorithm; - oncomplete: (ev: Event) => any; - onerror: (ev: ErrorEvent) => any; - onprogress: (ev: ProgressEvent) => any; - onabort: (ev: UIEvent) => any; - key: Key; - result: any; - abort(): void; - finish(): void; - process(buffer: ArrayBufferView): void; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var CryptoOperation: { - prototype: CryptoOperation; - new(): CryptoOperation; +interface ValidityState { + badInput: boolean; + customError: boolean; + patternMismatch: boolean; + rangeOverflow: boolean; + rangeUnderflow: boolean; + stepMismatch: boolean; + tooLong: boolean; + typeMismatch: boolean; + valid: boolean; + valueMissing: boolean; } -interface WebGLTexture extends WebGLObject { -} -declare var WebGLTexture: { - prototype: WebGLTexture; - new(): WebGLTexture; +declare var ValidityState: { + prototype: ValidityState; + new(): ValidityState; } -interface OES_texture_float { -} -declare var OES_texture_float: { - prototype: OES_texture_float; - new(): OES_texture_float; +interface VideoPlaybackQuality { + corruptedVideoFrames: number; + creationTime: number; + droppedVideoFrames: number; + totalFrameDelay: number; + totalVideoFrames: number; } -interface WebGLContextEvent extends Event { - statusMessage: string; -} -declare var WebGLContextEvent: { - prototype: WebGLContextEvent; - new(): WebGLContextEvent; +declare var VideoPlaybackQuality: { + prototype: VideoPlaybackQuality; + new(): VideoPlaybackQuality; } -interface WebGLRenderbuffer extends WebGLObject { -} -declare var WebGLRenderbuffer: { - prototype: WebGLRenderbuffer; - new(): WebGLRenderbuffer; +interface VideoTrack { + id: string; + kind: string; + label: string; + language: string; + selected: boolean; + sourceBuffer: SourceBuffer; } -interface WebGLUniformLocation { +declare var VideoTrack: { + prototype: VideoTrack; + new(): VideoTrack; } -declare var WebGLUniformLocation: { - prototype: WebGLUniformLocation; - new(): WebGLUniformLocation; + +interface VideoTrackList extends EventTarget { + length: number; + onaddtrack: (ev: TrackEvent) => any; + onchange: (ev: Event) => any; + onremovetrack: (ev: TrackEvent) => any; + selectedIndex: number; + getTrackById(id: string): VideoTrack; + item(index: number): VideoTrack; + addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "removetrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: VideoTrack; +} + +declare var VideoTrackList: { + prototype: VideoTrackList; + new(): VideoTrackList; +} + +interface WEBGL_compressed_texture_s3tc { + COMPRESSED_RGBA_S3TC_DXT1_EXT: number; + COMPRESSED_RGBA_S3TC_DXT3_EXT: number; + COMPRESSED_RGBA_S3TC_DXT5_EXT: number; + COMPRESSED_RGB_S3TC_DXT1_EXT: number; +} + +declare var WEBGL_compressed_texture_s3tc: { + prototype: WEBGL_compressed_texture_s3tc; + new(): WEBGL_compressed_texture_s3tc; + COMPRESSED_RGBA_S3TC_DXT1_EXT: number; + COMPRESSED_RGBA_S3TC_DXT3_EXT: number; + COMPRESSED_RGBA_S3TC_DXT5_EXT: number; + COMPRESSED_RGB_S3TC_DXT1_EXT: number; +} + +interface WEBGL_debug_renderer_info { + UNMASKED_RENDERER_WEBGL: number; + UNMASKED_VENDOR_WEBGL: number; +} + +declare var WEBGL_debug_renderer_info: { + prototype: WEBGL_debug_renderer_info; + new(): WEBGL_debug_renderer_info; + UNMASKED_RENDERER_WEBGL: number; + UNMASKED_VENDOR_WEBGL: number; +} + +interface WEBGL_depth_texture { + UNSIGNED_INT_24_8_WEBGL: number; +} + +declare var WEBGL_depth_texture: { + prototype: WEBGL_depth_texture; + new(): WEBGL_depth_texture; + UNSIGNED_INT_24_8_WEBGL: number; +} + +interface WaveShaperNode extends AudioNode { + curve: any; + oversample: string; +} + +declare var WaveShaperNode: { + prototype: WaveShaperNode; + new(): WaveShaperNode; } interface WebGLActiveInfo { name: string; - type: number; size: number; + type: number; } + declare var WebGLActiveInfo: { prototype: WebGLActiveInfo; new(): WebGLActiveInfo; } -interface WEBGL_compressed_texture_s3tc { - COMPRESSED_RGBA_S3TC_DXT1_EXT: number; - COMPRESSED_RGBA_S3TC_DXT5_EXT: number; - COMPRESSED_RGBA_S3TC_DXT3_EXT: number; - COMPRESSED_RGB_S3TC_DXT1_EXT: number; -} -declare var WEBGL_compressed_texture_s3tc: { - prototype: WEBGL_compressed_texture_s3tc; - new(): WEBGL_compressed_texture_s3tc; - COMPRESSED_RGBA_S3TC_DXT1_EXT: number; - COMPRESSED_RGBA_S3TC_DXT5_EXT: number; - COMPRESSED_RGBA_S3TC_DXT3_EXT: number; - COMPRESSED_RGB_S3TC_DXT1_EXT: number; -} - -interface WebGLRenderingContext { - drawingBufferWidth: number; - drawingBufferHeight: number; - canvas: HTMLCanvasElement; - getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation; - bindTexture(target: number, texture: WebGLTexture): void; - bufferData(target: number, data: ArrayBufferView, usage: number): void; - bufferData(target: number, data: ArrayBuffer, usage: number): void; - bufferData(target: number, size: number, usage: number): void; - depthMask(flag: boolean): void; - getUniform(program: WebGLProgram, location: WebGLUniformLocation): any; - vertexAttrib3fv(indx: number, values: number[]): void; - vertexAttrib3fv(indx: number, values: Float32Array): void; - linkProgram(program: WebGLProgram): void; - getSupportedExtensions(): string[]; - bufferSubData(target: number, offset: number, data: ArrayBuffer): void; - bufferSubData(target: number, offset: number, data: ArrayBufferView): void; - vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void; - polygonOffset(factor: number, units: number): void; - blendColor(red: number, green: number, blue: number, alpha: number): void; - createTexture(): WebGLTexture; - hint(target: number, mode: number): void; - getVertexAttrib(index: number, pname: number): any; - enableVertexAttribArray(index: number): void; - depthRange(zNear: number, zFar: number): void; - cullFace(mode: number): void; - createFramebuffer(): WebGLFramebuffer; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; - framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture, level: number): void; - deleteFramebuffer(framebuffer: WebGLFramebuffer): void; - colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; - compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; - getExtension(name: string): any; - createProgram(): WebGLProgram; - deleteShader(shader: WebGLShader): void; - getAttachedShaders(program: WebGLProgram): WebGLShader[]; - enable(cap: number): void; - blendEquation(mode: number): void; - texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels: ArrayBufferView): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, image: HTMLImageElement): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, canvas: HTMLCanvasElement): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, video: HTMLVideoElement): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageData): void; - createBuffer(): WebGLBuffer; - deleteTexture(texture: WebGLTexture): void; - useProgram(program: WebGLProgram): void; - vertexAttrib2fv(indx: number, values: number[]): void; - vertexAttrib2fv(indx: number, values: Float32Array): void; - checkFramebufferStatus(target: number): number; - frontFace(mode: number): void; - getBufferParameter(target: number, pname: number): any; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, image: HTMLImageElement): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, canvas: HTMLCanvasElement): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, video: HTMLVideoElement): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void; - copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; - getVertexAttribOffset(index: number, pname: number): number; - disableVertexAttribArray(index: number): void; - blendFunc(sfactor: number, dfactor: number): void; - drawElements(mode: number, count: number, type: number, offset: number): void; - isFramebuffer(framebuffer: WebGLFramebuffer): boolean; - uniform3iv(location: WebGLUniformLocation, v: number[]): void; - uniform3iv(location: WebGLUniformLocation, v: Int32Array): void; - lineWidth(width: number): void; - getShaderInfoLog(shader: WebGLShader): string; - getTexParameter(target: number, pname: number): any; - getParameter(pname: number): any; - getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat; - getContextAttributes(): WebGLContextAttributes; - vertexAttrib1f(indx: number, x: number): void; - bindFramebuffer(target: number, framebuffer: WebGLFramebuffer): void; - compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; - isContextLost(): boolean; - uniform1iv(location: WebGLUniformLocation, v: number[]): void; - uniform1iv(location: WebGLUniformLocation, v: Int32Array): void; - getRenderbufferParameter(target: number, pname: number): any; - uniform2fv(location: WebGLUniformLocation, v: number[]): void; - uniform2fv(location: WebGLUniformLocation, v: Float32Array): void; - isTexture(texture: WebGLTexture): boolean; - getError(): number; - shaderSource(shader: WebGLShader, source: string): void; - deleteRenderbuffer(renderbuffer: WebGLRenderbuffer): void; - stencilMask(mask: number): void; - bindBuffer(target: number, buffer: WebGLBuffer): void; - getAttribLocation(program: WebGLProgram, name: string): number; - uniform3i(location: WebGLUniformLocation, x: number, y: number, z: number): void; - blendEquationSeparate(modeRGB: number, modeAlpha: number): void; - clear(mask: number): void; - blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; - stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void; - readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; - scissor(x: number, y: number, width: number, height: number): void; - uniform2i(location: WebGLUniformLocation, x: number, y: number): void; - getActiveAttrib(program: WebGLProgram, index: number): WebGLActiveInfo; - getShaderSource(shader: WebGLShader): string; - generateMipmap(target: number): void; - bindAttribLocation(program: WebGLProgram, index: number, name: string): void; - uniform1fv(location: WebGLUniformLocation, v: number[]): void; - uniform1fv(location: WebGLUniformLocation, v: Float32Array): void; - uniform2iv(location: WebGLUniformLocation, v: number[]): void; - uniform2iv(location: WebGLUniformLocation, v: Int32Array): void; - stencilOp(fail: number, zfail: number, zpass: number): void; - uniform4fv(location: WebGLUniformLocation, v: number[]): void; - uniform4fv(location: WebGLUniformLocation, v: Float32Array): void; - vertexAttrib1fv(indx: number, values: number[]): void; - vertexAttrib1fv(indx: number, values: Float32Array): void; - flush(): void; - uniform4f(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; - deleteProgram(program: WebGLProgram): void; - isRenderbuffer(renderbuffer: WebGLRenderbuffer): boolean; - uniform1i(location: WebGLUniformLocation, x: number): void; - getProgramParameter(program: WebGLProgram, pname: number): any; - getActiveUniform(program: WebGLProgram, index: number): WebGLActiveInfo; - stencilFunc(func: number, ref: number, mask: number): void; - pixelStorei(pname: number, param: number): void; - disable(cap: number): void; - vertexAttrib4fv(indx: number, values: number[]): void; - vertexAttrib4fv(indx: number, values: Float32Array): void; - createRenderbuffer(): WebGLRenderbuffer; - isBuffer(buffer: WebGLBuffer): boolean; - stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; - getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any; - uniform4i(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; - sampleCoverage(value: number, invert: boolean): void; - depthFunc(func: number): void; - texParameterf(target: number, pname: number, param: number): void; - vertexAttrib3f(indx: number, x: number, y: number, z: number): void; - drawArrays(mode: number, first: number, count: number): void; - texParameteri(target: number, pname: number, param: number): void; - vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void; - getShaderParameter(shader: WebGLShader, pname: number): any; - clearDepth(depth: number): void; - activeTexture(texture: number): void; - viewport(x: number, y: number, width: number, height: number): void; - detachShader(program: WebGLProgram, shader: WebGLShader): void; - uniform1f(location: WebGLUniformLocation, x: number): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; - deleteBuffer(buffer: WebGLBuffer): void; - copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; - uniform3fv(location: WebGLUniformLocation, v: number[]): void; - uniform3fv(location: WebGLUniformLocation, v: Float32Array): void; - stencilMaskSeparate(face: number, mask: number): void; - attachShader(program: WebGLProgram, shader: WebGLShader): void; - compileShader(shader: WebGLShader): void; - clearColor(red: number, green: number, blue: number, alpha: number): void; - isShader(shader: WebGLShader): boolean; - clearStencil(s: number): void; - framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer): void; - finish(): void; - uniform2f(location: WebGLUniformLocation, x: number, y: number): void; - renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; - uniform3f(location: WebGLUniformLocation, x: number, y: number, z: number): void; - getProgramInfoLog(program: WebGLProgram): string; - validateProgram(program: WebGLProgram): void; - isEnabled(cap: number): boolean; - vertexAttrib2f(indx: number, x: number, y: number): void; - isProgram(program: WebGLProgram): boolean; - createShader(type: number): WebGLShader; - bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer): void; - uniform4iv(location: WebGLUniformLocation, v: number[]): void; - uniform4iv(location: WebGLUniformLocation, v: Int32Array): void; - DEPTH_FUNC: number; - DEPTH_COMPONENT16: number; - REPLACE: number; - REPEAT: number; - VERTEX_ATTRIB_ARRAY_ENABLED: number; - FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - STENCIL_BUFFER_BIT: number; - RENDERER: number; - STENCIL_BACK_REF: number; - TEXTURE26: number; - RGB565: number; - DITHER: number; - CONSTANT_COLOR: number; - GENERATE_MIPMAP_HINT: number; - POINTS: number; - DECR: number; - INT_VEC3: number; - TEXTURE28: number; - ONE_MINUS_CONSTANT_ALPHA: number; - BACK: number; - RENDERBUFFER_STENCIL_SIZE: number; - UNPACK_FLIP_Y_WEBGL: number; - BLEND: number; - TEXTURE9: number; - ARRAY_BUFFER_BINDING: number; - MAX_VIEWPORT_DIMS: number; - INVALID_FRAMEBUFFER_OPERATION: number; - TEXTURE: number; - TEXTURE0: number; - TEXTURE31: number; - TEXTURE24: number; - HIGH_INT: number; - RENDERBUFFER_BINDING: number; - BLEND_COLOR: number; - FASTEST: number; - STENCIL_WRITEMASK: number; - ALIASED_POINT_SIZE_RANGE: number; - TEXTURE12: number; - DST_ALPHA: number; - BLEND_EQUATION_RGB: number; - FRAMEBUFFER_COMPLETE: number; - NEAREST_MIPMAP_NEAREST: number; - VERTEX_ATTRIB_ARRAY_SIZE: number; - TEXTURE3: number; - DEPTH_WRITEMASK: number; - CONTEXT_LOST_WEBGL: number; - INVALID_VALUE: number; - TEXTURE_MAG_FILTER: number; - ONE_MINUS_CONSTANT_COLOR: number; - ONE_MINUS_SRC_ALPHA: number; - TEXTURE_CUBE_MAP_POSITIVE_Z: number; - NOTEQUAL: number; - ALPHA: number; - DEPTH_STENCIL: number; - MAX_VERTEX_UNIFORM_VECTORS: number; - DEPTH_COMPONENT: number; - RENDERBUFFER_RED_SIZE: number; - TEXTURE20: number; - RED_BITS: number; - RENDERBUFFER_BLUE_SIZE: number; - SCISSOR_BOX: number; - VENDOR: number; - FRONT_AND_BACK: number; - CONSTANT_ALPHA: number; - VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - NEAREST: number; - CULL_FACE: number; - ALIASED_LINE_WIDTH_RANGE: number; - TEXTURE19: number; - FRONT: number; - DEPTH_CLEAR_VALUE: number; - GREEN_BITS: number; - TEXTURE29: number; - TEXTURE23: number; - MAX_RENDERBUFFER_SIZE: number; - STENCIL_ATTACHMENT: number; - TEXTURE27: number; - BOOL_VEC2: number; - OUT_OF_MEMORY: number; - MIRRORED_REPEAT: number; - POLYGON_OFFSET_UNITS: number; - TEXTURE_MIN_FILTER: number; - STENCIL_BACK_PASS_DEPTH_PASS: number; - LINE_LOOP: number; - FLOAT_MAT3: number; - TEXTURE14: number; - LINEAR: number; - RGB5_A1: number; - ONE_MINUS_SRC_COLOR: number; - SAMPLE_COVERAGE_INVERT: number; - DONT_CARE: number; - FRAMEBUFFER_BINDING: number; - RENDERBUFFER_ALPHA_SIZE: number; - STENCIL_REF: number; - ZERO: number; - DECR_WRAP: number; - SAMPLE_COVERAGE: number; - STENCIL_BACK_FUNC: number; - TEXTURE30: number; - VIEWPORT: number; - STENCIL_BITS: number; - FLOAT: number; - COLOR_WRITEMASK: number; - SAMPLE_COVERAGE_VALUE: number; - TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - STENCIL_BACK_FAIL: number; - FLOAT_MAT4: number; - UNSIGNED_SHORT_4_4_4_4: number; - TEXTURE6: number; - RENDERBUFFER_WIDTH: number; - RGBA4: number; - ALWAYS: number; - BLEND_EQUATION_ALPHA: number; - COLOR_BUFFER_BIT: number; - TEXTURE_CUBE_MAP: number; - DEPTH_BUFFER_BIT: number; - STENCIL_CLEAR_VALUE: number; - BLEND_EQUATION: number; - RENDERBUFFER_GREEN_SIZE: number; - NEAREST_MIPMAP_LINEAR: number; - VERTEX_ATTRIB_ARRAY_TYPE: number; - INCR_WRAP: number; - ONE_MINUS_DST_COLOR: number; - HIGH_FLOAT: number; - BYTE: number; - FRONT_FACE: number; - SAMPLE_ALPHA_TO_COVERAGE: number; - CCW: number; - TEXTURE13: number; - MAX_VERTEX_ATTRIBS: number; - MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_WRAP_T: number; - UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - FLOAT_VEC2: number; - LUMINANCE: number; - GREATER: number; - INT_VEC2: number; - VALIDATE_STATUS: number; - FRAMEBUFFER: number; - FRAMEBUFFER_UNSUPPORTED: number; - TEXTURE5: number; - FUNC_SUBTRACT: number; - BLEND_DST_ALPHA: number; - SAMPLER_CUBE: number; - ONE_MINUS_DST_ALPHA: number; - LESS: number; - TEXTURE_CUBE_MAP_POSITIVE_X: number; - BLUE_BITS: number; - DEPTH_TEST: number; - VERTEX_ATTRIB_ARRAY_STRIDE: number; - DELETE_STATUS: number; - TEXTURE18: number; - POLYGON_OFFSET_FACTOR: number; - UNSIGNED_INT: number; - TEXTURE_2D: number; - DST_COLOR: number; - FLOAT_MAT2: number; - COMPRESSED_TEXTURE_FORMATS: number; - MAX_FRAGMENT_UNIFORM_VECTORS: number; - DEPTH_STENCIL_ATTACHMENT: number; - LUMINANCE_ALPHA: number; - CW: number; - VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - LINEAR_MIPMAP_LINEAR: number; - BUFFER_SIZE: number; - SAMPLE_BUFFERS: number; - TEXTURE15: number; - ACTIVE_TEXTURE: number; - VERTEX_SHADER: number; - TEXTURE22: number; - VERTEX_ATTRIB_ARRAY_POINTER: number; - INCR: number; - COMPILE_STATUS: number; - MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - TEXTURE7: number; - UNSIGNED_SHORT_5_5_5_1: number; - DEPTH_BITS: number; - RGBA: number; - TRIANGLE_STRIP: number; - COLOR_CLEAR_VALUE: number; - BROWSER_DEFAULT_WEBGL: number; - INVALID_ENUM: number; - SCISSOR_TEST: number; - LINE_STRIP: number; - FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - STENCIL_FUNC: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - RENDERBUFFER_HEIGHT: number; - TEXTURE8: number; - TRIANGLES: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - STENCIL_BACK_VALUE_MASK: number; - TEXTURE25: number; - RENDERBUFFER: number; - LEQUAL: number; - TEXTURE1: number; - STENCIL_INDEX8: number; - FUNC_ADD: number; - STENCIL_FAIL: number; - BLEND_SRC_ALPHA: number; - BOOL: number; - ALPHA_BITS: number; - LOW_INT: number; - TEXTURE10: number; - SRC_COLOR: number; - MAX_VARYING_VECTORS: number; - BLEND_DST_RGB: number; - TEXTURE_BINDING_CUBE_MAP: number; - STENCIL_INDEX: number; - TEXTURE_BINDING_2D: number; - MEDIUM_INT: number; - SHADER_TYPE: number; - POLYGON_OFFSET_FILL: number; - DYNAMIC_DRAW: number; - TEXTURE4: number; - STENCIL_BACK_PASS_DEPTH_FAIL: number; - STREAM_DRAW: number; - MAX_CUBE_MAP_TEXTURE_SIZE: number; - TEXTURE17: number; - TRIANGLE_FAN: number; - UNPACK_ALIGNMENT: number; - CURRENT_PROGRAM: number; - LINES: number; - INVALID_OPERATION: number; - FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - LINEAR_MIPMAP_NEAREST: number; - CLAMP_TO_EDGE: number; - RENDERBUFFER_DEPTH_SIZE: number; - TEXTURE_WRAP_S: number; - ELEMENT_ARRAY_BUFFER: number; - UNSIGNED_SHORT_5_6_5: number; - ACTIVE_UNIFORMS: number; - FLOAT_VEC3: number; - NO_ERROR: number; - ATTACHED_SHADERS: number; - DEPTH_ATTACHMENT: number; - TEXTURE11: number; - STENCIL_TEST: number; - ONE: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - STATIC_DRAW: number; - GEQUAL: number; - BOOL_VEC4: number; - COLOR_ATTACHMENT0: number; - PACK_ALIGNMENT: number; - MAX_TEXTURE_SIZE: number; - STENCIL_PASS_DEPTH_FAIL: number; - CULL_FACE_MODE: number; - TEXTURE16: number; - STENCIL_BACK_WRITEMASK: number; - SRC_ALPHA: number; - UNSIGNED_SHORT: number; - TEXTURE21: number; - FUNC_REVERSE_SUBTRACT: number; - SHADING_LANGUAGE_VERSION: number; - EQUAL: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - BOOL_VEC3: number; - SAMPLER_2D: number; - TEXTURE_CUBE_MAP_NEGATIVE_X: number; - MAX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_CUBE_MAP_POSITIVE_Y: number; - RENDERBUFFER_INTERNAL_FORMAT: number; - STENCIL_VALUE_MASK: number; - ELEMENT_ARRAY_BUFFER_BINDING: number; - ARRAY_BUFFER: number; - DEPTH_RANGE: number; - NICEST: number; - ACTIVE_ATTRIBUTES: number; - NEVER: number; - FLOAT_VEC4: number; - CURRENT_VERTEX_ATTRIB: number; - STENCIL_PASS_DEPTH_PASS: number; - INVERT: number; - LINK_STATUS: number; - RGB: number; - INT_VEC4: number; - TEXTURE2: number; - UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - MEDIUM_FLOAT: number; - SRC_ALPHA_SATURATE: number; - BUFFER_USAGE: number; - SHORT: number; - NONE: number; - UNSIGNED_BYTE: number; - INT: number; - SUBPIXEL_BITS: number; - KEEP: number; - SAMPLES: number; - FRAGMENT_SHADER: number; - LINE_WIDTH: number; - BLEND_SRC_RGB: number; - LOW_FLOAT: number; - VERSION: number; -} -declare var WebGLRenderingContext: { - prototype: WebGLRenderingContext; - new(): WebGLRenderingContext; - DEPTH_FUNC: number; - DEPTH_COMPONENT16: number; - REPLACE: number; - REPEAT: number; - VERTEX_ATTRIB_ARRAY_ENABLED: number; - FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - STENCIL_BUFFER_BIT: number; - RENDERER: number; - STENCIL_BACK_REF: number; - TEXTURE26: number; - RGB565: number; - DITHER: number; - CONSTANT_COLOR: number; - GENERATE_MIPMAP_HINT: number; - POINTS: number; - DECR: number; - INT_VEC3: number; - TEXTURE28: number; - ONE_MINUS_CONSTANT_ALPHA: number; - BACK: number; - RENDERBUFFER_STENCIL_SIZE: number; - UNPACK_FLIP_Y_WEBGL: number; - BLEND: number; - TEXTURE9: number; - ARRAY_BUFFER_BINDING: number; - MAX_VIEWPORT_DIMS: number; - INVALID_FRAMEBUFFER_OPERATION: number; - TEXTURE: number; - TEXTURE0: number; - TEXTURE31: number; - TEXTURE24: number; - HIGH_INT: number; - RENDERBUFFER_BINDING: number; - BLEND_COLOR: number; - FASTEST: number; - STENCIL_WRITEMASK: number; - ALIASED_POINT_SIZE_RANGE: number; - TEXTURE12: number; - DST_ALPHA: number; - BLEND_EQUATION_RGB: number; - FRAMEBUFFER_COMPLETE: number; - NEAREST_MIPMAP_NEAREST: number; - VERTEX_ATTRIB_ARRAY_SIZE: number; - TEXTURE3: number; - DEPTH_WRITEMASK: number; - CONTEXT_LOST_WEBGL: number; - INVALID_VALUE: number; - TEXTURE_MAG_FILTER: number; - ONE_MINUS_CONSTANT_COLOR: number; - ONE_MINUS_SRC_ALPHA: number; - TEXTURE_CUBE_MAP_POSITIVE_Z: number; - NOTEQUAL: number; - ALPHA: number; - DEPTH_STENCIL: number; - MAX_VERTEX_UNIFORM_VECTORS: number; - DEPTH_COMPONENT: number; - RENDERBUFFER_RED_SIZE: number; - TEXTURE20: number; - RED_BITS: number; - RENDERBUFFER_BLUE_SIZE: number; - SCISSOR_BOX: number; - VENDOR: number; - FRONT_AND_BACK: number; - CONSTANT_ALPHA: number; - VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - NEAREST: number; - CULL_FACE: number; - ALIASED_LINE_WIDTH_RANGE: number; - TEXTURE19: number; - FRONT: number; - DEPTH_CLEAR_VALUE: number; - GREEN_BITS: number; - TEXTURE29: number; - TEXTURE23: number; - MAX_RENDERBUFFER_SIZE: number; - STENCIL_ATTACHMENT: number; - TEXTURE27: number; - BOOL_VEC2: number; - OUT_OF_MEMORY: number; - MIRRORED_REPEAT: number; - POLYGON_OFFSET_UNITS: number; - TEXTURE_MIN_FILTER: number; - STENCIL_BACK_PASS_DEPTH_PASS: number; - LINE_LOOP: number; - FLOAT_MAT3: number; - TEXTURE14: number; - LINEAR: number; - RGB5_A1: number; - ONE_MINUS_SRC_COLOR: number; - SAMPLE_COVERAGE_INVERT: number; - DONT_CARE: number; - FRAMEBUFFER_BINDING: number; - RENDERBUFFER_ALPHA_SIZE: number; - STENCIL_REF: number; - ZERO: number; - DECR_WRAP: number; - SAMPLE_COVERAGE: number; - STENCIL_BACK_FUNC: number; - TEXTURE30: number; - VIEWPORT: number; - STENCIL_BITS: number; - FLOAT: number; - COLOR_WRITEMASK: number; - SAMPLE_COVERAGE_VALUE: number; - TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - STENCIL_BACK_FAIL: number; - FLOAT_MAT4: number; - UNSIGNED_SHORT_4_4_4_4: number; - TEXTURE6: number; - RENDERBUFFER_WIDTH: number; - RGBA4: number; - ALWAYS: number; - BLEND_EQUATION_ALPHA: number; - COLOR_BUFFER_BIT: number; - TEXTURE_CUBE_MAP: number; - DEPTH_BUFFER_BIT: number; - STENCIL_CLEAR_VALUE: number; - BLEND_EQUATION: number; - RENDERBUFFER_GREEN_SIZE: number; - NEAREST_MIPMAP_LINEAR: number; - VERTEX_ATTRIB_ARRAY_TYPE: number; - INCR_WRAP: number; - ONE_MINUS_DST_COLOR: number; - HIGH_FLOAT: number; - BYTE: number; - FRONT_FACE: number; - SAMPLE_ALPHA_TO_COVERAGE: number; - CCW: number; - TEXTURE13: number; - MAX_VERTEX_ATTRIBS: number; - MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_WRAP_T: number; - UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - FLOAT_VEC2: number; - LUMINANCE: number; - GREATER: number; - INT_VEC2: number; - VALIDATE_STATUS: number; - FRAMEBUFFER: number; - FRAMEBUFFER_UNSUPPORTED: number; - TEXTURE5: number; - FUNC_SUBTRACT: number; - BLEND_DST_ALPHA: number; - SAMPLER_CUBE: number; - ONE_MINUS_DST_ALPHA: number; - LESS: number; - TEXTURE_CUBE_MAP_POSITIVE_X: number; - BLUE_BITS: number; - DEPTH_TEST: number; - VERTEX_ATTRIB_ARRAY_STRIDE: number; - DELETE_STATUS: number; - TEXTURE18: number; - POLYGON_OFFSET_FACTOR: number; - UNSIGNED_INT: number; - TEXTURE_2D: number; - DST_COLOR: number; - FLOAT_MAT2: number; - COMPRESSED_TEXTURE_FORMATS: number; - MAX_FRAGMENT_UNIFORM_VECTORS: number; - DEPTH_STENCIL_ATTACHMENT: number; - LUMINANCE_ALPHA: number; - CW: number; - VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - LINEAR_MIPMAP_LINEAR: number; - BUFFER_SIZE: number; - SAMPLE_BUFFERS: number; - TEXTURE15: number; - ACTIVE_TEXTURE: number; - VERTEX_SHADER: number; - TEXTURE22: number; - VERTEX_ATTRIB_ARRAY_POINTER: number; - INCR: number; - COMPILE_STATUS: number; - MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - TEXTURE7: number; - UNSIGNED_SHORT_5_5_5_1: number; - DEPTH_BITS: number; - RGBA: number; - TRIANGLE_STRIP: number; - COLOR_CLEAR_VALUE: number; - BROWSER_DEFAULT_WEBGL: number; - INVALID_ENUM: number; - SCISSOR_TEST: number; - LINE_STRIP: number; - FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - STENCIL_FUNC: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - RENDERBUFFER_HEIGHT: number; - TEXTURE8: number; - TRIANGLES: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - STENCIL_BACK_VALUE_MASK: number; - TEXTURE25: number; - RENDERBUFFER: number; - LEQUAL: number; - TEXTURE1: number; - STENCIL_INDEX8: number; - FUNC_ADD: number; - STENCIL_FAIL: number; - BLEND_SRC_ALPHA: number; - BOOL: number; - ALPHA_BITS: number; - LOW_INT: number; - TEXTURE10: number; - SRC_COLOR: number; - MAX_VARYING_VECTORS: number; - BLEND_DST_RGB: number; - TEXTURE_BINDING_CUBE_MAP: number; - STENCIL_INDEX: number; - TEXTURE_BINDING_2D: number; - MEDIUM_INT: number; - SHADER_TYPE: number; - POLYGON_OFFSET_FILL: number; - DYNAMIC_DRAW: number; - TEXTURE4: number; - STENCIL_BACK_PASS_DEPTH_FAIL: number; - STREAM_DRAW: number; - MAX_CUBE_MAP_TEXTURE_SIZE: number; - TEXTURE17: number; - TRIANGLE_FAN: number; - UNPACK_ALIGNMENT: number; - CURRENT_PROGRAM: number; - LINES: number; - INVALID_OPERATION: number; - FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - LINEAR_MIPMAP_NEAREST: number; - CLAMP_TO_EDGE: number; - RENDERBUFFER_DEPTH_SIZE: number; - TEXTURE_WRAP_S: number; - ELEMENT_ARRAY_BUFFER: number; - UNSIGNED_SHORT_5_6_5: number; - ACTIVE_UNIFORMS: number; - FLOAT_VEC3: number; - NO_ERROR: number; - ATTACHED_SHADERS: number; - DEPTH_ATTACHMENT: number; - TEXTURE11: number; - STENCIL_TEST: number; - ONE: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - STATIC_DRAW: number; - GEQUAL: number; - BOOL_VEC4: number; - COLOR_ATTACHMENT0: number; - PACK_ALIGNMENT: number; - MAX_TEXTURE_SIZE: number; - STENCIL_PASS_DEPTH_FAIL: number; - CULL_FACE_MODE: number; - TEXTURE16: number; - STENCIL_BACK_WRITEMASK: number; - SRC_ALPHA: number; - UNSIGNED_SHORT: number; - TEXTURE21: number; - FUNC_REVERSE_SUBTRACT: number; - SHADING_LANGUAGE_VERSION: number; - EQUAL: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - BOOL_VEC3: number; - SAMPLER_2D: number; - TEXTURE_CUBE_MAP_NEGATIVE_X: number; - MAX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_CUBE_MAP_POSITIVE_Y: number; - RENDERBUFFER_INTERNAL_FORMAT: number; - STENCIL_VALUE_MASK: number; - ELEMENT_ARRAY_BUFFER_BINDING: number; - ARRAY_BUFFER: number; - DEPTH_RANGE: number; - NICEST: number; - ACTIVE_ATTRIBUTES: number; - NEVER: number; - FLOAT_VEC4: number; - CURRENT_VERTEX_ATTRIB: number; - STENCIL_PASS_DEPTH_PASS: number; - INVERT: number; - LINK_STATUS: number; - RGB: number; - INT_VEC4: number; - TEXTURE2: number; - UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - MEDIUM_FLOAT: number; - SRC_ALPHA_SATURATE: number; - BUFFER_USAGE: number; - SHORT: number; - NONE: number; - UNSIGNED_BYTE: number; - INT: number; - SUBPIXEL_BITS: number; - KEEP: number; - SAMPLES: number; - FRAGMENT_SHADER: number; - LINE_WIDTH: number; - BLEND_SRC_RGB: number; - LOW_FLOAT: number; - VERSION: number; -} - -interface WebGLProgram extends WebGLObject { -} -declare var WebGLProgram: { - prototype: WebGLProgram; - new(): WebGLProgram; -} - -interface OES_standard_derivatives { - FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; -} -declare var OES_standard_derivatives: { - prototype: OES_standard_derivatives; - new(): OES_standard_derivatives; - FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; -} - -interface WebGLFramebuffer extends WebGLObject { -} -declare var WebGLFramebuffer: { - prototype: WebGLFramebuffer; - new(): WebGLFramebuffer; -} - -interface WebGLShader extends WebGLObject { -} -declare var WebGLShader: { - prototype: WebGLShader; - new(): WebGLShader; -} - -interface OES_texture_float_linear { -} -declare var OES_texture_float_linear: { - prototype: OES_texture_float_linear; - new(): OES_texture_float_linear; -} - -interface WebGLObject { -} -declare var WebGLObject: { - prototype: WebGLObject; - new(): WebGLObject; -} - interface WebGLBuffer extends WebGLObject { } + declare var WebGLBuffer: { prototype: WebGLBuffer; new(): WebGLBuffer; } -interface WebGLShaderPrecisionFormat { - rangeMin: number; - rangeMax: number; - precision: number; +interface WebGLContextEvent extends Event { + statusMessage: string; } + +declare var WebGLContextEvent: { + prototype: WebGLContextEvent; + new(): WebGLContextEvent; +} + +interface WebGLFramebuffer extends WebGLObject { +} + +declare var WebGLFramebuffer: { + prototype: WebGLFramebuffer; + new(): WebGLFramebuffer; +} + +interface WebGLObject { +} + +declare var WebGLObject: { + prototype: WebGLObject; + new(): WebGLObject; +} + +interface WebGLProgram extends WebGLObject { +} + +declare var WebGLProgram: { + prototype: WebGLProgram; + new(): WebGLProgram; +} + +interface WebGLRenderbuffer extends WebGLObject { +} + +declare var WebGLRenderbuffer: { + prototype: WebGLRenderbuffer; + new(): WebGLRenderbuffer; +} + +interface WebGLRenderingContext { + canvas: HTMLCanvasElement; + drawingBufferHeight: number; + drawingBufferWidth: number; + activeTexture(texture: number): void; + attachShader(program: WebGLProgram, shader: WebGLShader): void; + bindAttribLocation(program: WebGLProgram, index: number, name: string): void; + bindBuffer(target: number, buffer: WebGLBuffer): void; + bindFramebuffer(target: number, framebuffer: WebGLFramebuffer): void; + bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer): void; + bindTexture(target: number, texture: WebGLTexture): void; + blendColor(red: number, green: number, blue: number, alpha: number): void; + blendEquation(mode: number): void; + blendEquationSeparate(modeRGB: number, modeAlpha: number): void; + blendFunc(sfactor: number, dfactor: number): void; + blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; + bufferData(target: number, size: number, usage: number): void; + bufferData(target: number, size: ArrayBufferView, usage: number): void; + bufferData(target: number, size: any, usage: number): void; + bufferSubData(target: number, offset: number, data: ArrayBufferView): void; + bufferSubData(target: number, offset: number, data: any): void; + checkFramebufferStatus(target: number): number; + clear(mask: number): void; + clearColor(red: number, green: number, blue: number, alpha: number): void; + clearDepth(depth: number): void; + clearStencil(s: number): void; + colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; + compileShader(shader: WebGLShader): void; + compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; + compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; + copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; + copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; + createBuffer(): WebGLBuffer; + createFramebuffer(): WebGLFramebuffer; + createProgram(): WebGLProgram; + createRenderbuffer(): WebGLRenderbuffer; + createShader(type: number): WebGLShader; + createTexture(): WebGLTexture; + cullFace(mode: number): void; + deleteBuffer(buffer: WebGLBuffer): void; + deleteFramebuffer(framebuffer: WebGLFramebuffer): void; + deleteProgram(program: WebGLProgram): void; + deleteRenderbuffer(renderbuffer: WebGLRenderbuffer): void; + deleteShader(shader: WebGLShader): void; + deleteTexture(texture: WebGLTexture): void; + depthFunc(func: number): void; + depthMask(flag: boolean): void; + depthRange(zNear: number, zFar: number): void; + detachShader(program: WebGLProgram, shader: WebGLShader): void; + disable(cap: number): void; + disableVertexAttribArray(index: number): void; + drawArrays(mode: number, first: number, count: number): void; + drawElements(mode: number, count: number, type: number, offset: number): void; + enable(cap: number): void; + enableVertexAttribArray(index: number): void; + finish(): void; + flush(): void; + framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer): void; + framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture, level: number): void; + frontFace(mode: number): void; + generateMipmap(target: number): void; + getActiveAttrib(program: WebGLProgram, index: number): WebGLActiveInfo; + getActiveUniform(program: WebGLProgram, index: number): WebGLActiveInfo; + getAttachedShaders(program: WebGLProgram): WebGLShader[]; + getAttribLocation(program: WebGLProgram, name: string): number; + getBufferParameter(target: number, pname: number): any; + getContextAttributes(): WebGLContextAttributes; + getError(): number; + getExtension(name: string): any; + getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any; + getParameter(pname: number): any; + getProgramInfoLog(program: WebGLProgram): string; + getProgramParameter(program: WebGLProgram, pname: number): any; + getRenderbufferParameter(target: number, pname: number): any; + getShaderInfoLog(shader: WebGLShader): string; + getShaderParameter(shader: WebGLShader, pname: number): any; + getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat; + getShaderSource(shader: WebGLShader): string; + getSupportedExtensions(): string[]; + getTexParameter(target: number, pname: number): any; + getUniform(program: WebGLProgram, location: WebGLUniformLocation): any; + getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation; + getVertexAttrib(index: number, pname: number): any; + getVertexAttribOffset(index: number, pname: number): number; + hint(target: number, mode: number): void; + isBuffer(buffer: WebGLBuffer): boolean; + isContextLost(): boolean; + isEnabled(cap: number): boolean; + isFramebuffer(framebuffer: WebGLFramebuffer): boolean; + isProgram(program: WebGLProgram): boolean; + isRenderbuffer(renderbuffer: WebGLRenderbuffer): boolean; + isShader(shader: WebGLShader): boolean; + isTexture(texture: WebGLTexture): boolean; + lineWidth(width: number): void; + linkProgram(program: WebGLProgram): void; + pixelStorei(pname: number, param: number): void; + polygonOffset(factor: number, units: number): void; + readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; + renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; + sampleCoverage(value: number, invert: boolean): void; + scissor(x: number, y: number, width: number, height: number): void; + shaderSource(shader: WebGLShader, source: string): void; + stencilFunc(func: number, ref: number, mask: number): void; + stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void; + stencilMask(mask: number): void; + stencilMaskSeparate(face: number, mask: number): void; + stencilOp(fail: number, zfail: number, zpass: number): void; + stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageData): void; + texParameterf(target: number, pname: number, param: number): void; + texParameteri(target: number, pname: number, param: number): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void; + uniform1f(location: WebGLUniformLocation, x: number): void; + uniform1fv(location: WebGLUniformLocation, v: any): void; + uniform1i(location: WebGLUniformLocation, x: number): void; + uniform1iv(location: WebGLUniformLocation, v: Int32Array): void; + uniform2f(location: WebGLUniformLocation, x: number, y: number): void; + uniform2fv(location: WebGLUniformLocation, v: any): void; + uniform2i(location: WebGLUniformLocation, x: number, y: number): void; + uniform2iv(location: WebGLUniformLocation, v: Int32Array): void; + uniform3f(location: WebGLUniformLocation, x: number, y: number, z: number): void; + uniform3fv(location: WebGLUniformLocation, v: any): void; + uniform3i(location: WebGLUniformLocation, x: number, y: number, z: number): void; + uniform3iv(location: WebGLUniformLocation, v: Int32Array): void; + uniform4f(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; + uniform4fv(location: WebGLUniformLocation, v: any): void; + uniform4i(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; + uniform4iv(location: WebGLUniformLocation, v: Int32Array): void; + uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: any): void; + uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: any): void; + uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: any): void; + useProgram(program: WebGLProgram): void; + validateProgram(program: WebGLProgram): void; + vertexAttrib1f(indx: number, x: number): void; + vertexAttrib1fv(indx: number, values: any): void; + vertexAttrib2f(indx: number, x: number, y: number): void; + vertexAttrib2fv(indx: number, values: any): void; + vertexAttrib3f(indx: number, x: number, y: number, z: number): void; + vertexAttrib3fv(indx: number, values: any): void; + vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void; + vertexAttrib4fv(indx: number, values: any): void; + vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void; + viewport(x: number, y: number, width: number, height: number): void; + ACTIVE_ATTRIBUTES: number; + ACTIVE_TEXTURE: number; + ACTIVE_UNIFORMS: number; + ALIASED_LINE_WIDTH_RANGE: number; + ALIASED_POINT_SIZE_RANGE: number; + ALPHA: number; + ALPHA_BITS: number; + ALWAYS: number; + ARRAY_BUFFER: number; + ARRAY_BUFFER_BINDING: number; + ATTACHED_SHADERS: number; + BACK: number; + BLEND: number; + BLEND_COLOR: number; + BLEND_DST_ALPHA: number; + BLEND_DST_RGB: number; + BLEND_EQUATION: number; + BLEND_EQUATION_ALPHA: number; + BLEND_EQUATION_RGB: number; + BLEND_SRC_ALPHA: number; + BLEND_SRC_RGB: number; + BLUE_BITS: number; + BOOL: number; + BOOL_VEC2: number; + BOOL_VEC3: number; + BOOL_VEC4: number; + BROWSER_DEFAULT_WEBGL: number; + BUFFER_SIZE: number; + BUFFER_USAGE: number; + BYTE: number; + CCW: number; + CLAMP_TO_EDGE: number; + COLOR_ATTACHMENT0: number; + COLOR_BUFFER_BIT: number; + COLOR_CLEAR_VALUE: number; + COLOR_WRITEMASK: number; + COMPILE_STATUS: number; + COMPRESSED_TEXTURE_FORMATS: number; + CONSTANT_ALPHA: number; + CONSTANT_COLOR: number; + CONTEXT_LOST_WEBGL: number; + CULL_FACE: number; + CULL_FACE_MODE: number; + CURRENT_PROGRAM: number; + CURRENT_VERTEX_ATTRIB: number; + CW: number; + DECR: number; + DECR_WRAP: number; + DELETE_STATUS: number; + DEPTH_ATTACHMENT: number; + DEPTH_BITS: number; + DEPTH_BUFFER_BIT: number; + DEPTH_CLEAR_VALUE: number; + DEPTH_COMPONENT: number; + DEPTH_COMPONENT16: number; + DEPTH_FUNC: number; + DEPTH_RANGE: number; + DEPTH_STENCIL: number; + DEPTH_STENCIL_ATTACHMENT: number; + DEPTH_TEST: number; + DEPTH_WRITEMASK: number; + DITHER: number; + DONT_CARE: number; + DST_ALPHA: number; + DST_COLOR: number; + DYNAMIC_DRAW: number; + ELEMENT_ARRAY_BUFFER: number; + ELEMENT_ARRAY_BUFFER_BINDING: number; + EQUAL: number; + FASTEST: number; + FLOAT: number; + FLOAT_MAT2: number; + FLOAT_MAT3: number; + FLOAT_MAT4: number; + FLOAT_VEC2: number; + FLOAT_VEC3: number; + FLOAT_VEC4: number; + FRAGMENT_SHADER: number; + FRAMEBUFFER: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; + FRAMEBUFFER_BINDING: number; + FRAMEBUFFER_COMPLETE: number; + FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; + FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; + FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; + FRAMEBUFFER_UNSUPPORTED: number; + FRONT: number; + FRONT_AND_BACK: number; + FRONT_FACE: number; + FUNC_ADD: number; + FUNC_REVERSE_SUBTRACT: number; + FUNC_SUBTRACT: number; + GENERATE_MIPMAP_HINT: number; + GEQUAL: number; + GREATER: number; + GREEN_BITS: number; + HIGH_FLOAT: number; + HIGH_INT: number; + IMPLEMENTATION_COLOR_READ_FORMAT: number; + IMPLEMENTATION_COLOR_READ_TYPE: number; + INCR: number; + INCR_WRAP: number; + INT: number; + INT_VEC2: number; + INT_VEC3: number; + INT_VEC4: number; + INVALID_ENUM: number; + INVALID_FRAMEBUFFER_OPERATION: number; + INVALID_OPERATION: number; + INVALID_VALUE: number; + INVERT: number; + KEEP: number; + LEQUAL: number; + LESS: number; + LINEAR: number; + LINEAR_MIPMAP_LINEAR: number; + LINEAR_MIPMAP_NEAREST: number; + LINES: number; + LINE_LOOP: number; + LINE_STRIP: number; + LINE_WIDTH: number; + LINK_STATUS: number; + LOW_FLOAT: number; + LOW_INT: number; + LUMINANCE: number; + LUMINANCE_ALPHA: number; + MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; + MAX_CUBE_MAP_TEXTURE_SIZE: number; + MAX_FRAGMENT_UNIFORM_VECTORS: number; + MAX_RENDERBUFFER_SIZE: number; + MAX_TEXTURE_IMAGE_UNITS: number; + MAX_TEXTURE_SIZE: number; + MAX_VARYING_VECTORS: number; + MAX_VERTEX_ATTRIBS: number; + MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; + MAX_VERTEX_UNIFORM_VECTORS: number; + MAX_VIEWPORT_DIMS: number; + MEDIUM_FLOAT: number; + MEDIUM_INT: number; + MIRRORED_REPEAT: number; + NEAREST: number; + NEAREST_MIPMAP_LINEAR: number; + NEAREST_MIPMAP_NEAREST: number; + NEVER: number; + NICEST: number; + NONE: number; + NOTEQUAL: number; + NO_ERROR: number; + ONE: number; + ONE_MINUS_CONSTANT_ALPHA: number; + ONE_MINUS_CONSTANT_COLOR: number; + ONE_MINUS_DST_ALPHA: number; + ONE_MINUS_DST_COLOR: number; + ONE_MINUS_SRC_ALPHA: number; + ONE_MINUS_SRC_COLOR: number; + OUT_OF_MEMORY: number; + PACK_ALIGNMENT: number; + POINTS: number; + POLYGON_OFFSET_FACTOR: number; + POLYGON_OFFSET_FILL: number; + POLYGON_OFFSET_UNITS: number; + RED_BITS: number; + RENDERBUFFER: number; + RENDERBUFFER_ALPHA_SIZE: number; + RENDERBUFFER_BINDING: number; + RENDERBUFFER_BLUE_SIZE: number; + RENDERBUFFER_DEPTH_SIZE: number; + RENDERBUFFER_GREEN_SIZE: number; + RENDERBUFFER_HEIGHT: number; + RENDERBUFFER_INTERNAL_FORMAT: number; + RENDERBUFFER_RED_SIZE: number; + RENDERBUFFER_STENCIL_SIZE: number; + RENDERBUFFER_WIDTH: number; + RENDERER: number; + REPEAT: number; + REPLACE: number; + RGB: number; + RGB565: number; + RGB5_A1: number; + RGBA: number; + RGBA4: number; + SAMPLER_2D: number; + SAMPLER_CUBE: number; + SAMPLES: number; + SAMPLE_ALPHA_TO_COVERAGE: number; + SAMPLE_BUFFERS: number; + SAMPLE_COVERAGE: number; + SAMPLE_COVERAGE_INVERT: number; + SAMPLE_COVERAGE_VALUE: number; + SCISSOR_BOX: number; + SCISSOR_TEST: number; + SHADER_TYPE: number; + SHADING_LANGUAGE_VERSION: number; + SHORT: number; + SRC_ALPHA: number; + SRC_ALPHA_SATURATE: number; + SRC_COLOR: number; + STATIC_DRAW: number; + STENCIL_ATTACHMENT: number; + STENCIL_BACK_FAIL: number; + STENCIL_BACK_FUNC: number; + STENCIL_BACK_PASS_DEPTH_FAIL: number; + STENCIL_BACK_PASS_DEPTH_PASS: number; + STENCIL_BACK_REF: number; + STENCIL_BACK_VALUE_MASK: number; + STENCIL_BACK_WRITEMASK: number; + STENCIL_BITS: number; + STENCIL_BUFFER_BIT: number; + STENCIL_CLEAR_VALUE: number; + STENCIL_FAIL: number; + STENCIL_FUNC: number; + STENCIL_INDEX: number; + STENCIL_INDEX8: number; + STENCIL_PASS_DEPTH_FAIL: number; + STENCIL_PASS_DEPTH_PASS: number; + STENCIL_REF: number; + STENCIL_TEST: number; + STENCIL_VALUE_MASK: number; + STENCIL_WRITEMASK: number; + STREAM_DRAW: number; + SUBPIXEL_BITS: number; + TEXTURE: number; + TEXTURE0: number; + TEXTURE1: number; + TEXTURE10: number; + TEXTURE11: number; + TEXTURE12: number; + TEXTURE13: number; + TEXTURE14: number; + TEXTURE15: number; + TEXTURE16: number; + TEXTURE17: number; + TEXTURE18: number; + TEXTURE19: number; + TEXTURE2: number; + TEXTURE20: number; + TEXTURE21: number; + TEXTURE22: number; + TEXTURE23: number; + TEXTURE24: number; + TEXTURE25: number; + TEXTURE26: number; + TEXTURE27: number; + TEXTURE28: number; + TEXTURE29: number; + TEXTURE3: number; + TEXTURE30: number; + TEXTURE31: number; + TEXTURE4: number; + TEXTURE5: number; + TEXTURE6: number; + TEXTURE7: number; + TEXTURE8: number; + TEXTURE9: number; + TEXTURE_2D: number; + TEXTURE_BINDING_2D: number; + TEXTURE_BINDING_CUBE_MAP: number; + TEXTURE_CUBE_MAP: number; + TEXTURE_CUBE_MAP_NEGATIVE_X: number; + TEXTURE_CUBE_MAP_NEGATIVE_Y: number; + TEXTURE_CUBE_MAP_NEGATIVE_Z: number; + TEXTURE_CUBE_MAP_POSITIVE_X: number; + TEXTURE_CUBE_MAP_POSITIVE_Y: number; + TEXTURE_CUBE_MAP_POSITIVE_Z: number; + TEXTURE_MAG_FILTER: number; + TEXTURE_MIN_FILTER: number; + TEXTURE_WRAP_S: number; + TEXTURE_WRAP_T: number; + TRIANGLES: number; + TRIANGLE_FAN: number; + TRIANGLE_STRIP: number; + UNPACK_ALIGNMENT: number; + UNPACK_COLORSPACE_CONVERSION_WEBGL: number; + UNPACK_FLIP_Y_WEBGL: number; + UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; + UNSIGNED_BYTE: number; + UNSIGNED_INT: number; + UNSIGNED_SHORT: number; + UNSIGNED_SHORT_4_4_4_4: number; + UNSIGNED_SHORT_5_5_5_1: number; + UNSIGNED_SHORT_5_6_5: number; + VALIDATE_STATUS: number; + VENDOR: number; + VERSION: number; + VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; + VERTEX_ATTRIB_ARRAY_ENABLED: number; + VERTEX_ATTRIB_ARRAY_NORMALIZED: number; + VERTEX_ATTRIB_ARRAY_POINTER: number; + VERTEX_ATTRIB_ARRAY_SIZE: number; + VERTEX_ATTRIB_ARRAY_STRIDE: number; + VERTEX_ATTRIB_ARRAY_TYPE: number; + VERTEX_SHADER: number; + VIEWPORT: number; + ZERO: number; +} + +declare var WebGLRenderingContext: { + prototype: WebGLRenderingContext; + new(): WebGLRenderingContext; + ACTIVE_ATTRIBUTES: number; + ACTIVE_TEXTURE: number; + ACTIVE_UNIFORMS: number; + ALIASED_LINE_WIDTH_RANGE: number; + ALIASED_POINT_SIZE_RANGE: number; + ALPHA: number; + ALPHA_BITS: number; + ALWAYS: number; + ARRAY_BUFFER: number; + ARRAY_BUFFER_BINDING: number; + ATTACHED_SHADERS: number; + BACK: number; + BLEND: number; + BLEND_COLOR: number; + BLEND_DST_ALPHA: number; + BLEND_DST_RGB: number; + BLEND_EQUATION: number; + BLEND_EQUATION_ALPHA: number; + BLEND_EQUATION_RGB: number; + BLEND_SRC_ALPHA: number; + BLEND_SRC_RGB: number; + BLUE_BITS: number; + BOOL: number; + BOOL_VEC2: number; + BOOL_VEC3: number; + BOOL_VEC4: number; + BROWSER_DEFAULT_WEBGL: number; + BUFFER_SIZE: number; + BUFFER_USAGE: number; + BYTE: number; + CCW: number; + CLAMP_TO_EDGE: number; + COLOR_ATTACHMENT0: number; + COLOR_BUFFER_BIT: number; + COLOR_CLEAR_VALUE: number; + COLOR_WRITEMASK: number; + COMPILE_STATUS: number; + COMPRESSED_TEXTURE_FORMATS: number; + CONSTANT_ALPHA: number; + CONSTANT_COLOR: number; + CONTEXT_LOST_WEBGL: number; + CULL_FACE: number; + CULL_FACE_MODE: number; + CURRENT_PROGRAM: number; + CURRENT_VERTEX_ATTRIB: number; + CW: number; + DECR: number; + DECR_WRAP: number; + DELETE_STATUS: number; + DEPTH_ATTACHMENT: number; + DEPTH_BITS: number; + DEPTH_BUFFER_BIT: number; + DEPTH_CLEAR_VALUE: number; + DEPTH_COMPONENT: number; + DEPTH_COMPONENT16: number; + DEPTH_FUNC: number; + DEPTH_RANGE: number; + DEPTH_STENCIL: number; + DEPTH_STENCIL_ATTACHMENT: number; + DEPTH_TEST: number; + DEPTH_WRITEMASK: number; + DITHER: number; + DONT_CARE: number; + DST_ALPHA: number; + DST_COLOR: number; + DYNAMIC_DRAW: number; + ELEMENT_ARRAY_BUFFER: number; + ELEMENT_ARRAY_BUFFER_BINDING: number; + EQUAL: number; + FASTEST: number; + FLOAT: number; + FLOAT_MAT2: number; + FLOAT_MAT3: number; + FLOAT_MAT4: number; + FLOAT_VEC2: number; + FLOAT_VEC3: number; + FLOAT_VEC4: number; + FRAGMENT_SHADER: number; + FRAMEBUFFER: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; + FRAMEBUFFER_BINDING: number; + FRAMEBUFFER_COMPLETE: number; + FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; + FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; + FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; + FRAMEBUFFER_UNSUPPORTED: number; + FRONT: number; + FRONT_AND_BACK: number; + FRONT_FACE: number; + FUNC_ADD: number; + FUNC_REVERSE_SUBTRACT: number; + FUNC_SUBTRACT: number; + GENERATE_MIPMAP_HINT: number; + GEQUAL: number; + GREATER: number; + GREEN_BITS: number; + HIGH_FLOAT: number; + HIGH_INT: number; + IMPLEMENTATION_COLOR_READ_FORMAT: number; + IMPLEMENTATION_COLOR_READ_TYPE: number; + INCR: number; + INCR_WRAP: number; + INT: number; + INT_VEC2: number; + INT_VEC3: number; + INT_VEC4: number; + INVALID_ENUM: number; + INVALID_FRAMEBUFFER_OPERATION: number; + INVALID_OPERATION: number; + INVALID_VALUE: number; + INVERT: number; + KEEP: number; + LEQUAL: number; + LESS: number; + LINEAR: number; + LINEAR_MIPMAP_LINEAR: number; + LINEAR_MIPMAP_NEAREST: number; + LINES: number; + LINE_LOOP: number; + LINE_STRIP: number; + LINE_WIDTH: number; + LINK_STATUS: number; + LOW_FLOAT: number; + LOW_INT: number; + LUMINANCE: number; + LUMINANCE_ALPHA: number; + MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; + MAX_CUBE_MAP_TEXTURE_SIZE: number; + MAX_FRAGMENT_UNIFORM_VECTORS: number; + MAX_RENDERBUFFER_SIZE: number; + MAX_TEXTURE_IMAGE_UNITS: number; + MAX_TEXTURE_SIZE: number; + MAX_VARYING_VECTORS: number; + MAX_VERTEX_ATTRIBS: number; + MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; + MAX_VERTEX_UNIFORM_VECTORS: number; + MAX_VIEWPORT_DIMS: number; + MEDIUM_FLOAT: number; + MEDIUM_INT: number; + MIRRORED_REPEAT: number; + NEAREST: number; + NEAREST_MIPMAP_LINEAR: number; + NEAREST_MIPMAP_NEAREST: number; + NEVER: number; + NICEST: number; + NONE: number; + NOTEQUAL: number; + NO_ERROR: number; + ONE: number; + ONE_MINUS_CONSTANT_ALPHA: number; + ONE_MINUS_CONSTANT_COLOR: number; + ONE_MINUS_DST_ALPHA: number; + ONE_MINUS_DST_COLOR: number; + ONE_MINUS_SRC_ALPHA: number; + ONE_MINUS_SRC_COLOR: number; + OUT_OF_MEMORY: number; + PACK_ALIGNMENT: number; + POINTS: number; + POLYGON_OFFSET_FACTOR: number; + POLYGON_OFFSET_FILL: number; + POLYGON_OFFSET_UNITS: number; + RED_BITS: number; + RENDERBUFFER: number; + RENDERBUFFER_ALPHA_SIZE: number; + RENDERBUFFER_BINDING: number; + RENDERBUFFER_BLUE_SIZE: number; + RENDERBUFFER_DEPTH_SIZE: number; + RENDERBUFFER_GREEN_SIZE: number; + RENDERBUFFER_HEIGHT: number; + RENDERBUFFER_INTERNAL_FORMAT: number; + RENDERBUFFER_RED_SIZE: number; + RENDERBUFFER_STENCIL_SIZE: number; + RENDERBUFFER_WIDTH: number; + RENDERER: number; + REPEAT: number; + REPLACE: number; + RGB: number; + RGB565: number; + RGB5_A1: number; + RGBA: number; + RGBA4: number; + SAMPLER_2D: number; + SAMPLER_CUBE: number; + SAMPLES: number; + SAMPLE_ALPHA_TO_COVERAGE: number; + SAMPLE_BUFFERS: number; + SAMPLE_COVERAGE: number; + SAMPLE_COVERAGE_INVERT: number; + SAMPLE_COVERAGE_VALUE: number; + SCISSOR_BOX: number; + SCISSOR_TEST: number; + SHADER_TYPE: number; + SHADING_LANGUAGE_VERSION: number; + SHORT: number; + SRC_ALPHA: number; + SRC_ALPHA_SATURATE: number; + SRC_COLOR: number; + STATIC_DRAW: number; + STENCIL_ATTACHMENT: number; + STENCIL_BACK_FAIL: number; + STENCIL_BACK_FUNC: number; + STENCIL_BACK_PASS_DEPTH_FAIL: number; + STENCIL_BACK_PASS_DEPTH_PASS: number; + STENCIL_BACK_REF: number; + STENCIL_BACK_VALUE_MASK: number; + STENCIL_BACK_WRITEMASK: number; + STENCIL_BITS: number; + STENCIL_BUFFER_BIT: number; + STENCIL_CLEAR_VALUE: number; + STENCIL_FAIL: number; + STENCIL_FUNC: number; + STENCIL_INDEX: number; + STENCIL_INDEX8: number; + STENCIL_PASS_DEPTH_FAIL: number; + STENCIL_PASS_DEPTH_PASS: number; + STENCIL_REF: number; + STENCIL_TEST: number; + STENCIL_VALUE_MASK: number; + STENCIL_WRITEMASK: number; + STREAM_DRAW: number; + SUBPIXEL_BITS: number; + TEXTURE: number; + TEXTURE0: number; + TEXTURE1: number; + TEXTURE10: number; + TEXTURE11: number; + TEXTURE12: number; + TEXTURE13: number; + TEXTURE14: number; + TEXTURE15: number; + TEXTURE16: number; + TEXTURE17: number; + TEXTURE18: number; + TEXTURE19: number; + TEXTURE2: number; + TEXTURE20: number; + TEXTURE21: number; + TEXTURE22: number; + TEXTURE23: number; + TEXTURE24: number; + TEXTURE25: number; + TEXTURE26: number; + TEXTURE27: number; + TEXTURE28: number; + TEXTURE29: number; + TEXTURE3: number; + TEXTURE30: number; + TEXTURE31: number; + TEXTURE4: number; + TEXTURE5: number; + TEXTURE6: number; + TEXTURE7: number; + TEXTURE8: number; + TEXTURE9: number; + TEXTURE_2D: number; + TEXTURE_BINDING_2D: number; + TEXTURE_BINDING_CUBE_MAP: number; + TEXTURE_CUBE_MAP: number; + TEXTURE_CUBE_MAP_NEGATIVE_X: number; + TEXTURE_CUBE_MAP_NEGATIVE_Y: number; + TEXTURE_CUBE_MAP_NEGATIVE_Z: number; + TEXTURE_CUBE_MAP_POSITIVE_X: number; + TEXTURE_CUBE_MAP_POSITIVE_Y: number; + TEXTURE_CUBE_MAP_POSITIVE_Z: number; + TEXTURE_MAG_FILTER: number; + TEXTURE_MIN_FILTER: number; + TEXTURE_WRAP_S: number; + TEXTURE_WRAP_T: number; + TRIANGLES: number; + TRIANGLE_FAN: number; + TRIANGLE_STRIP: number; + UNPACK_ALIGNMENT: number; + UNPACK_COLORSPACE_CONVERSION_WEBGL: number; + UNPACK_FLIP_Y_WEBGL: number; + UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; + UNSIGNED_BYTE: number; + UNSIGNED_INT: number; + UNSIGNED_SHORT: number; + UNSIGNED_SHORT_4_4_4_4: number; + UNSIGNED_SHORT_5_5_5_1: number; + UNSIGNED_SHORT_5_6_5: number; + VALIDATE_STATUS: number; + VENDOR: number; + VERSION: number; + VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; + VERTEX_ATTRIB_ARRAY_ENABLED: number; + VERTEX_ATTRIB_ARRAY_NORMALIZED: number; + VERTEX_ATTRIB_ARRAY_POINTER: number; + VERTEX_ATTRIB_ARRAY_SIZE: number; + VERTEX_ATTRIB_ARRAY_STRIDE: number; + VERTEX_ATTRIB_ARRAY_TYPE: number; + VERTEX_SHADER: number; + VIEWPORT: number; + ZERO: number; +} + +interface WebGLShader extends WebGLObject { +} + +declare var WebGLShader: { + prototype: WebGLShader; + new(): WebGLShader; +} + +interface WebGLShaderPrecisionFormat { + precision: number; + rangeMax: number; + rangeMin: number; +} + declare var WebGLShaderPrecisionFormat: { prototype: WebGLShaderPrecisionFormat; new(): WebGLShaderPrecisionFormat; } -interface EXT_texture_filter_anisotropic { - TEXTURE_MAX_ANISOTROPY_EXT: number; - MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; -} -declare var EXT_texture_filter_anisotropic: { - prototype: EXT_texture_filter_anisotropic; - new(): EXT_texture_filter_anisotropic; - TEXTURE_MAX_ANISOTROPY_EXT: number; - MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; +interface WebGLTexture extends WebGLObject { } -declare var Option: { new(text?: string, value?: string, defaultSelected?: boolean, selected?:boolean): HTMLOptionElement; }; -declare var Image: { new(width?: number, height?: number): HTMLImageElement; }; -declare var Audio: { new(src?: string): HTMLAudioElement; }; +declare var WebGLTexture: { + prototype: WebGLTexture; + new(): WebGLTexture; +} -declare var ondragend: (ev: DragEvent) => any; -declare var onkeydown: (ev: KeyboardEvent) => any; -declare var ondragover: (ev: DragEvent) => any; -declare var onkeyup: (ev: KeyboardEvent) => any; -declare var onreset: (ev: Event) => any; -declare var onmouseup: (ev: MouseEvent) => any; -declare var ondragstart: (ev: DragEvent) => any; -declare var ondrag: (ev: DragEvent) => any; -declare var screenX: number; -declare var onmouseover: (ev: MouseEvent) => any; -declare var ondragleave: (ev: DragEvent) => any; -declare var history: History; -declare var pageXOffset: number; -declare var name: string; -declare var onafterprint: (ev: Event) => any; -declare var onpause: (ev: Event) => any; -declare var onbeforeprint: (ev: Event) => any; -declare var top: Window; -declare var onmousedown: (ev: MouseEvent) => any; -declare var onseeked: (ev: Event) => any; -declare var opener: Window; -declare var onclick: (ev: MouseEvent) => any; -declare var innerHeight: number; -declare var onwaiting: (ev: Event) => any; -declare var ononline: (ev: Event) => any; -declare var ondurationchange: (ev: Event) => any; -declare var frames: Window; -declare var onblur: (ev: FocusEvent) => any; -declare var onemptied: (ev: Event) => any; -declare var onseeking: (ev: Event) => any; -declare var oncanplay: (ev: Event) => any; -declare var outerWidth: number; -declare var onstalled: (ev: Event) => any; -declare var onmousemove: (ev: MouseEvent) => any; -declare var innerWidth: number; -declare var onoffline: (ev: Event) => any; -declare var length: number; -declare var screen: Screen; -declare var onbeforeunload: (ev: BeforeUnloadEvent) => any; -declare var onratechange: (ev: Event) => any; -declare var onstorage: (ev: StorageEvent) => any; -declare var onloadstart: (ev: Event) => any; -declare var ondragenter: (ev: DragEvent) => any; -declare var onsubmit: (ev: Event) => any; -declare var self: Window; -declare var document: Document; -declare var onprogress: (ev: ProgressEvent) => any; -declare var ondblclick: (ev: MouseEvent) => any; -declare var pageYOffset: number; -declare var oncontextmenu: (ev: MouseEvent) => any; -declare var onchange: (ev: Event) => any; -declare var onloadedmetadata: (ev: Event) => any; -declare var onplay: (ev: Event) => any; -declare var onerror: ErrorEventHandler; -declare var onplaying: (ev: Event) => any; -declare var parent: Window; -declare var location: Location; -declare var oncanplaythrough: (ev: Event) => any; -declare var onabort: (ev: UIEvent) => any; -declare var onreadystatechange: (ev: Event) => any; -declare var outerHeight: number; -declare var onkeypress: (ev: KeyboardEvent) => any; -declare var frameElement: Element; -declare var onloadeddata: (ev: Event) => any; -declare var onsuspend: (ev: Event) => any; -declare var window: Window; -declare var onfocus: (ev: FocusEvent) => any; -declare var onmessage: (ev: MessageEvent) => any; -declare var ontimeupdate: (ev: Event) => any; -declare var onresize: (ev: UIEvent) => any; -declare var onselect: (ev: UIEvent) => any; -declare var navigator: Navigator; -declare var styleMedia: StyleMedia; -declare var ondrop: (ev: DragEvent) => any; -declare var onmouseout: (ev: MouseEvent) => any; -declare var onended: (ev: Event) => any; -declare var onhashchange: (ev: Event) => any; -declare var onunload: (ev: Event) => any; -declare var onscroll: (ev: UIEvent) => any; -declare var screenY: number; -declare var onmousewheel: (ev: MouseWheelEvent) => any; -declare var onload: (ev: Event) => any; -declare var onvolumechange: (ev: Event) => any; -declare var oninput: (ev: Event) => any; -declare var performance: Performance; -declare var onmspointerdown: (ev: any) => any; +interface WebGLUniformLocation { +} + +declare var WebGLUniformLocation: { + prototype: WebGLUniformLocation; + new(): WebGLUniformLocation; +} + +interface WebKitCSSMatrix { + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + m11: number; + m12: number; + m13: number; + m14: number; + m21: number; + m22: number; + m23: number; + m24: number; + m31: number; + m32: number; + m33: number; + m34: number; + m41: number; + m42: number; + m43: number; + m44: number; + inverse(): WebKitCSSMatrix; + multiply(secondMatrix: WebKitCSSMatrix): WebKitCSSMatrix; + rotate(angleX: number, angleY?: number, angleZ?: number): WebKitCSSMatrix; + rotateAxisAngle(x: number, y: number, z: number, angle: number): WebKitCSSMatrix; + scale(scaleX: number, scaleY?: number, scaleZ?: number): WebKitCSSMatrix; + setMatrixValue(value: string): void; + skewX(angle: number): WebKitCSSMatrix; + skewY(angle: number): WebKitCSSMatrix; + toString(): string; + translate(x: number, y: number, z?: number): WebKitCSSMatrix; +} + +declare var WebKitCSSMatrix: { + prototype: WebKitCSSMatrix; + new(text?: string): WebKitCSSMatrix; +} + +interface WebKitPoint { + x: number; + y: number; +} + +declare var WebKitPoint: { + prototype: WebKitPoint; + new(x?: number, y?: number): WebKitPoint; +} + +interface WebSocket extends EventTarget { + binaryType: string; + bufferedAmount: number; + extensions: string; + onclose: (ev: CloseEvent) => any; + onerror: (ev: Event) => any; + onmessage: (ev: MessageEvent) => any; + onopen: (ev: Event) => any; + protocol: string; + readyState: number; + url: string; + close(code?: number, reason?: string): void; + send(data: any): void; + CLOSED: number; + CLOSING: number; + CONNECTING: number; + OPEN: number; + addEventListener(type: "close", listener: (ev: CloseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "open", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var WebSocket: { + prototype: WebSocket; + new(url: string, protocols?: string): WebSocket; + new(url: string, protocols?: any): WebSocket; + CLOSED: number; + CLOSING: number; + CONNECTING: number; + OPEN: number; +} + +interface WheelEvent extends MouseEvent { + deltaMode: number; + deltaX: number; + deltaY: number; + deltaZ: number; + getCurrentPoint(element: Element): void; + initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void; + DOM_DELTA_LINE: number; + DOM_DELTA_PAGE: number; + DOM_DELTA_PIXEL: number; +} + +declare var WheelEvent: { + prototype: WheelEvent; + new(typeArg: string, eventInitDict?: WheelEventInit): WheelEvent; + DOM_DELTA_LINE: number; + DOM_DELTA_PAGE: number; + DOM_DELTA_PIXEL: number; +} + +interface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64 { + animationStartTime: number; + applicationCache: ApplicationCache; + clientInformation: Navigator; + closed: boolean; + crypto: Crypto; + defaultStatus: string; + devicePixelRatio: number; + doNotTrack: string; + document: Document; + event: Event; + external: External; + frameElement: Element; + frames: Window; + history: History; + innerHeight: number; + innerWidth: number; + length: number; + location: Location; + locationbar: BarProp; + menubar: BarProp; + msAnimationStartTime: number; + msTemplatePrinter: MSTemplatePrinter; + name: string; + navigator: Navigator; + offscreenBuffering: string | boolean; + onabort: (ev: Event) => any; + onafterprint: (ev: Event) => any; + onbeforeprint: (ev: Event) => any; + onbeforeunload: (ev: BeforeUnloadEvent) => any; + onblur: (ev: FocusEvent) => any; + oncanplay: (ev: Event) => any; + oncanplaythrough: (ev: Event) => any; + onchange: (ev: Event) => any; + onclick: (ev: MouseEvent) => any; + oncompassneedscalibration: (ev: Event) => any; + oncontextmenu: (ev: PointerEvent) => any; + ondblclick: (ev: MouseEvent) => any; + ondevicemotion: (ev: DeviceMotionEvent) => any; + ondeviceorientation: (ev: DeviceOrientationEvent) => any; + ondrag: (ev: DragEvent) => any; + ondragend: (ev: DragEvent) => any; + ondragenter: (ev: DragEvent) => any; + ondragleave: (ev: DragEvent) => any; + ondragover: (ev: DragEvent) => any; + ondragstart: (ev: DragEvent) => any; + ondrop: (ev: DragEvent) => any; + ondurationchange: (ev: Event) => any; + onemptied: (ev: Event) => any; + onended: (ev: Event) => any; + onerror: ErrorEventHandler; + onfocus: (ev: FocusEvent) => any; + onhashchange: (ev: HashChangeEvent) => any; + oninput: (ev: Event) => any; + onkeydown: (ev: KeyboardEvent) => any; + onkeypress: (ev: KeyboardEvent) => any; + onkeyup: (ev: KeyboardEvent) => any; + onload: (ev: Event) => any; + onloadeddata: (ev: Event) => any; + onloadedmetadata: (ev: Event) => any; + onloadstart: (ev: Event) => any; + onmessage: (ev: MessageEvent) => any; + onmousedown: (ev: MouseEvent) => any; + onmouseenter: (ev: MouseEvent) => any; + onmouseleave: (ev: MouseEvent) => any; + onmousemove: (ev: MouseEvent) => any; + onmouseout: (ev: MouseEvent) => any; + onmouseover: (ev: MouseEvent) => any; + onmouseup: (ev: MouseEvent) => any; + onmousewheel: (ev: MouseWheelEvent) => any; + onmsgesturechange: (ev: MSGestureEvent) => any; + onmsgesturedoubletap: (ev: MSGestureEvent) => any; + onmsgestureend: (ev: MSGestureEvent) => any; + onmsgesturehold: (ev: MSGestureEvent) => any; + onmsgesturestart: (ev: MSGestureEvent) => any; + onmsgesturetap: (ev: MSGestureEvent) => any; + onmsinertiastart: (ev: MSGestureEvent) => any; + onmspointercancel: (ev: MSPointerEvent) => any; + onmspointerdown: (ev: MSPointerEvent) => any; + onmspointerenter: (ev: MSPointerEvent) => any; + onmspointerleave: (ev: MSPointerEvent) => any; + onmspointermove: (ev: MSPointerEvent) => any; + onmspointerout: (ev: MSPointerEvent) => any; + onmspointerover: (ev: MSPointerEvent) => any; + onmspointerup: (ev: MSPointerEvent) => any; + onoffline: (ev: Event) => any; + ononline: (ev: Event) => any; + onorientationchange: (ev: Event) => any; + onpagehide: (ev: PageTransitionEvent) => any; + onpageshow: (ev: PageTransitionEvent) => any; + onpause: (ev: Event) => any; + onplay: (ev: Event) => any; + onplaying: (ev: Event) => any; + onpopstate: (ev: PopStateEvent) => any; + onprogress: (ev: ProgressEvent) => any; + onratechange: (ev: Event) => any; + onreadystatechange: (ev: ProgressEvent) => any; + onreset: (ev: Event) => any; + onresize: (ev: UIEvent) => any; + onscroll: (ev: UIEvent) => any; + onseeked: (ev: Event) => any; + onseeking: (ev: Event) => any; + onselect: (ev: UIEvent) => any; + onstalled: (ev: Event) => any; + onstorage: (ev: StorageEvent) => any; + onsubmit: (ev: Event) => any; + onsuspend: (ev: Event) => any; + ontimeupdate: (ev: Event) => any; + ontouchcancel: any; + ontouchend: any; + ontouchmove: any; + ontouchstart: any; + onunload: (ev: Event) => any; + onvolumechange: (ev: Event) => any; + onwaiting: (ev: Event) => any; + opener: Window; + orientation: string; + outerHeight: number; + outerWidth: number; + pageXOffset: number; + pageYOffset: number; + parent: Window; + performance: Performance; + personalbar: BarProp; + screen: Screen; + screenLeft: number; + screenTop: number; + screenX: number; + screenY: number; + scrollX: number; + scrollY: number; + scrollbars: BarProp; + self: Window; + status: string; + statusbar: BarProp; + styleMedia: StyleMedia; + toolbar: BarProp; + top: Window; + window: Window; + alert(message?: any): void; + blur(): void; + cancelAnimationFrame(handle: number): void; + captureEvents(): void; + close(): void; + confirm(message?: string): boolean; + focus(): void; + getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; + getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; + getSelection(): Selection; + matchMedia(mediaQuery: string): MediaQueryList; + moveBy(x?: number, y?: number): void; + moveTo(x?: number, y?: number): void; + msCancelRequestAnimationFrame(handle: number): void; + msMatchMedia(mediaQuery: string): MediaQueryList; + msRequestAnimationFrame(callback: FrameRequestCallback): number; + msWriteProfilerMark(profilerMarkName: string): void; + open(url?: string, target?: string, features?: string, replace?: boolean): any; + postMessage(message: any, targetOrigin: string, ports?: any): void; + print(): void; + prompt(message?: string, _default?: string): string; + releaseEvents(): void; + requestAnimationFrame(callback: FrameRequestCallback): number; + resizeBy(x?: number, y?: number): void; + resizeTo(x?: number, y?: number): void; + scroll(x?: number, y?: number): void; + scrollBy(x?: number, y?: number): void; + scrollTo(x?: number, y?: number): void; + webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; + webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "compassneedscalibration", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: Window; +} + +declare var Window: { + prototype: Window; + new(): Window; +} + +interface Worker extends EventTarget, AbstractWorker { + onmessage: (ev: MessageEvent) => any; + postMessage(message: any, ports?: any): void; + terminate(): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Worker: { + prototype: Worker; + new(stringUrl: string): Worker; +} + +interface XMLDocument extends Document { +} + +declare var XMLDocument: { + prototype: XMLDocument; + new(): XMLDocument; +} + +interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget { + msCaching: string; + onreadystatechange: (ev: ProgressEvent) => any; + readyState: number; + response: any; + responseBody: any; + responseText: string; + responseType: string; + responseXML: any; + status: number; + statusText: string; + timeout: number; + upload: XMLHttpRequestUpload; + withCredentials: boolean; + abort(): void; + getAllResponseHeaders(): string; + getResponseHeader(header: string): string; + msCachingEnabled(): boolean; + open(method: string, url: string, async?: boolean, user?: string, password?: string): void; + overrideMimeType(mime: string): void; + send(data?: Document): void; + send(data?: string): void; + setRequestHeader(header: string, value: string): void; + DONE: number; + HEADERS_RECEIVED: number; + LOADING: number; + OPENED: number; + UNSENT: number; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeout", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var XMLHttpRequest: { + prototype: XMLHttpRequest; + new(): XMLHttpRequest; + DONE: number; + HEADERS_RECEIVED: number; + LOADING: number; + OPENED: number; + UNSENT: number; + create(): XMLHttpRequest; +} + +interface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var XMLHttpRequestUpload: { + prototype: XMLHttpRequestUpload; + new(): XMLHttpRequestUpload; +} + +interface XMLSerializer { + serializeToString(target: Node): string; +} + +declare var XMLSerializer: { + prototype: XMLSerializer; + new(): XMLSerializer; +} + +interface XPathEvaluator { + createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; + createNSResolver(nodeResolver?: Node): XPathNSResolver; + evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver, type: number, result: XPathResult): XPathResult; +} + +declare var XPathEvaluator: { + prototype: XPathEvaluator; + new(): XPathEvaluator; +} + +interface XPathExpression { + evaluate(contextNode: Node, type: number, result: XPathResult): XPathExpression; +} + +declare var XPathExpression: { + prototype: XPathExpression; + new(): XPathExpression; +} + +interface XPathNSResolver { + lookupNamespaceURI(prefix: string): string; +} + +declare var XPathNSResolver: { + prototype: XPathNSResolver; + new(): XPathNSResolver; +} + +interface XPathResult { + booleanValue: boolean; + invalidIteratorState: boolean; + numberValue: number; + resultType: number; + singleNodeValue: Node; + snapshotLength: number; + stringValue: string; + iterateNext(): Node; + snapshotItem(index: number): Node; + ANY_TYPE: number; + ANY_UNORDERED_NODE_TYPE: number; + BOOLEAN_TYPE: number; + FIRST_ORDERED_NODE_TYPE: number; + NUMBER_TYPE: number; + ORDERED_NODE_ITERATOR_TYPE: number; + ORDERED_NODE_SNAPSHOT_TYPE: number; + STRING_TYPE: number; + UNORDERED_NODE_ITERATOR_TYPE: number; + UNORDERED_NODE_SNAPSHOT_TYPE: number; +} + +declare var XPathResult: { + prototype: XPathResult; + new(): XPathResult; + ANY_TYPE: number; + ANY_UNORDERED_NODE_TYPE: number; + BOOLEAN_TYPE: number; + FIRST_ORDERED_NODE_TYPE: number; + NUMBER_TYPE: number; + ORDERED_NODE_ITERATOR_TYPE: number; + ORDERED_NODE_SNAPSHOT_TYPE: number; + STRING_TYPE: number; + UNORDERED_NODE_ITERATOR_TYPE: number; + UNORDERED_NODE_SNAPSHOT_TYPE: number; +} + +interface XSLTProcessor { + clearParameters(): void; + getParameter(namespaceURI: string, localName: string): any; + importStylesheet(style: Node): void; + removeParameter(namespaceURI: string, localName: string): void; + reset(): void; + setParameter(namespaceURI: string, localName: string, value: any): void; + transformToDocument(source: Node): Document; + transformToFragment(source: Node, document: Document): DocumentFragment; +} + +declare var XSLTProcessor: { + prototype: XSLTProcessor; + new(): XSLTProcessor; +} + +interface AbstractWorker { + onerror: (ev: Event) => any; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface ChildNode { + remove(): void; +} + +interface DOML2DeprecatedColorProperty { + color: string; +} + +interface DOML2DeprecatedSizeProperty { + size: number; +} + +interface DocumentEvent { + createEvent(eventInterface:"AnimationEvent"): AnimationEvent; + createEvent(eventInterface:"AriaRequestEvent"): AriaRequestEvent; + createEvent(eventInterface:"AudioProcessingEvent"): AudioProcessingEvent; + createEvent(eventInterface:"BeforeUnloadEvent"): BeforeUnloadEvent; + createEvent(eventInterface:"CloseEvent"): CloseEvent; + createEvent(eventInterface:"CommandEvent"): CommandEvent; + createEvent(eventInterface:"CompositionEvent"): CompositionEvent; + createEvent(eventInterface:"DeviceMotionEvent"): DeviceMotionEvent; + createEvent(eventInterface:"DeviceOrientationEvent"): DeviceOrientationEvent; + createEvent(eventInterface:"DragEvent"): DragEvent; + createEvent(eventInterface:"ErrorEvent"): ErrorEvent; + createEvent(eventInterface:"Event"): Event; + createEvent(eventInterface:"FocusEvent"): FocusEvent; + createEvent(eventInterface:"GamepadEvent"): GamepadEvent; + createEvent(eventInterface:"HashChangeEvent"): HashChangeEvent; + createEvent(eventInterface:"IDBVersionChangeEvent"): IDBVersionChangeEvent; + createEvent(eventInterface:"KeyboardEvent"): KeyboardEvent; + createEvent(eventInterface:"LongRunningScriptDetectedEvent"): LongRunningScriptDetectedEvent; + createEvent(eventInterface:"MSGestureEvent"): MSGestureEvent; + createEvent(eventInterface:"MSManipulationEvent"): MSManipulationEvent; + createEvent(eventInterface:"MSMediaKeyMessageEvent"): MSMediaKeyMessageEvent; + createEvent(eventInterface:"MSMediaKeyNeededEvent"): MSMediaKeyNeededEvent; + createEvent(eventInterface:"MSPointerEvent"): MSPointerEvent; + createEvent(eventInterface:"MSSiteModeEvent"): MSSiteModeEvent; + createEvent(eventInterface:"MessageEvent"): MessageEvent; + createEvent(eventInterface:"MouseEvent"): MouseEvent; + createEvent(eventInterface:"MouseWheelEvent"): MouseWheelEvent; + createEvent(eventInterface:"MutationEvent"): MutationEvent; + createEvent(eventInterface:"NavigationCompletedEvent"): NavigationCompletedEvent; + createEvent(eventInterface:"NavigationEvent"): NavigationEvent; + createEvent(eventInterface:"NavigationEventWithReferrer"): NavigationEventWithReferrer; + createEvent(eventInterface:"OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent; + createEvent(eventInterface:"PageTransitionEvent"): PageTransitionEvent; + createEvent(eventInterface:"PermissionRequestedEvent"): PermissionRequestedEvent; + createEvent(eventInterface:"PointerEvent"): PointerEvent; + createEvent(eventInterface:"PopStateEvent"): PopStateEvent; + createEvent(eventInterface:"ProgressEvent"): ProgressEvent; + createEvent(eventInterface:"SVGZoomEvent"): SVGZoomEvent; + createEvent(eventInterface:"ScriptNotifyEvent"): ScriptNotifyEvent; + createEvent(eventInterface:"StorageEvent"): StorageEvent; + createEvent(eventInterface:"TextEvent"): TextEvent; + createEvent(eventInterface:"TouchEvent"): TouchEvent; + createEvent(eventInterface:"TrackEvent"): TrackEvent; + createEvent(eventInterface:"TransitionEvent"): TransitionEvent; + createEvent(eventInterface:"UIEvent"): UIEvent; + createEvent(eventInterface:"UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent; + createEvent(eventInterface:"WebGLContextEvent"): WebGLContextEvent; + createEvent(eventInterface:"WheelEvent"): WheelEvent; + createEvent(eventInterface: string): Event; +} + +interface ElementTraversal { + childElementCount: number; + firstElementChild: Element; + lastElementChild: Element; + nextElementSibling: Element; + previousElementSibling: Element; +} + +interface GetSVGDocument { + getSVGDocument(): Document; +} + +interface GlobalEventHandlers { + onpointercancel: (ev: PointerEvent) => any; + onpointerdown: (ev: PointerEvent) => any; + onpointerenter: (ev: PointerEvent) => any; + onpointerleave: (ev: PointerEvent) => any; + onpointermove: (ev: PointerEvent) => any; + onpointerout: (ev: PointerEvent) => any; + onpointerover: (ev: PointerEvent) => any; + onpointerup: (ev: PointerEvent) => any; + onwheel: (ev: WheelEvent) => any; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface HTMLTableAlignment { + /** + * Sets or retrieves a value that you can use to implement your own ch functionality for the object. + */ + ch: string; + /** + * Sets or retrieves a value that you can use to implement your own chOff functionality for the object. + */ + chOff: string; + /** + * Sets or retrieves how text and other content are vertically aligned within the object that contains them. + */ + vAlign: string; +} + +interface IDBEnvironment { + indexedDB: IDBFactory; + msIndexedDB: IDBFactory; +} + +interface LinkStyle { + sheet: StyleSheet; +} + +interface MSBaseReader { + onabort: (ev: Event) => any; + onerror: (ev: Event) => any; + onload: (ev: Event) => any; + onloadend: (ev: ProgressEvent) => any; + onloadstart: (ev: Event) => any; + onprogress: (ev: ProgressEvent) => any; + readyState: number; + result: any; + abort(): void; + DONE: number; + EMPTY: number; + LOADING: number; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface MSFileSaver { + msSaveBlob(blob: any, defaultName?: string): boolean; + msSaveOrOpenBlob(blob: any, defaultName?: string): boolean; +} + +interface MSNavigatorDoNotTrack { + confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean; + confirmWebWideTrackingException(args: ExceptionInformation): boolean; + removeSiteSpecificTrackingException(args: ExceptionInformation): void; + removeWebWideTrackingException(args: ExceptionInformation): void; + storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void; + storeWebWideTrackingException(args: StoreExceptionsInformation): void; +} + +interface NavigatorContentUtils { +} + +interface NavigatorGeolocation { + geolocation: Geolocation; +} + +interface NavigatorID { + appName: string; + appVersion: string; + platform: string; + product: string; + productSub: string; + userAgent: string; + vendor: string; + vendorSub: string; +} + +interface NavigatorOnLine { + onLine: boolean; +} + +interface NavigatorStorageUtils { +} + +interface NodeSelector { + querySelector(selectors: string): Element; + querySelectorAll(selectors: string): NodeList; +} + +interface RandomSource { + getRandomValues(array: ArrayBufferView): ArrayBufferView; +} + +interface SVGAnimatedPathData { + pathSegList: SVGPathSegList; +} + +interface SVGAnimatedPoints { + animatedPoints: SVGPointList; + points: SVGPointList; +} + +interface SVGExternalResourcesRequired { + externalResourcesRequired: SVGAnimatedBoolean; +} + +interface SVGFilterPrimitiveStandardAttributes extends SVGStylable { + height: SVGAnimatedLength; + result: SVGAnimatedString; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; +} + +interface SVGFitToViewBox { + preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + viewBox: SVGAnimatedRect; +} + +interface SVGLangSpace { + xmllang: string; + xmlspace: string; +} + +interface SVGLocatable { + farthestViewportElement: SVGElement; + nearestViewportElement: SVGElement; + getBBox(): SVGRect; + getCTM(): SVGMatrix; + getScreenCTM(): SVGMatrix; + getTransformToElement(element: SVGElement): SVGMatrix; +} + +interface SVGStylable { + className: SVGAnimatedString; + style: CSSStyleDeclaration; +} + +interface SVGTests { + requiredExtensions: SVGStringList; + requiredFeatures: SVGStringList; + systemLanguage: SVGStringList; + hasExtension(extension: string): boolean; +} + +interface SVGTransformable extends SVGLocatable { + transform: SVGAnimatedTransformList; +} + +interface SVGURIReference { + href: SVGAnimatedString; +} + +interface WindowBase64 { + atob(encodedString: string): string; + btoa(rawString: string): string; +} + +interface WindowConsole { + console: Console; +} + +interface WindowLocalStorage { + localStorage: Storage; +} + +interface WindowSessionStorage { + sessionStorage: Storage; +} + +interface WindowTimers extends Object, WindowTimersExtension { + clearInterval(handle: number): void; + clearTimeout(handle: number): void; + setInterval(handler: any, timeout?: any, ...args: any[]): number; + setTimeout(handler: any, timeout?: any, ...args: any[]): number; +} + +interface WindowTimersExtension { + clearImmediate(handle: number): void; + msClearImmediate(handle: number): void; + msSetImmediate(expression: any, ...args: any[]): number; + setImmediate(expression: any, ...args: any[]): number; +} + +interface XMLHttpRequestEventTarget { + onabort: (ev: Event) => any; + onerror: (ev: Event) => any; + onload: (ev: Event) => any; + onloadend: (ev: ProgressEvent) => any; + onloadstart: (ev: Event) => any; + onprogress: (ev: ProgressEvent) => any; + ontimeout: (ev: ProgressEvent) => any; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeout", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + + +interface NodeListOf extends NodeList { + length: number; + item(index: number): TNode; + [index: number]: TNode; +} + +interface BlobPropertyBag { + type?: string; + endings?: string; +} + +interface EventListenerObject { + handleEvent(evt: Event): void; +} + +declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; + +interface ErrorEventHandler { + (event: Event, source?: string, fileno?: number, columnNumber?: number): void; + (event: string, source?: string, fileno?: number, columnNumber?: number): void; +} +interface PositionCallback { + (position: Position): void; +} +interface PositionErrorCallback { + (error: PositionError): void; +} +interface MediaQueryListListener { + (mql: MediaQueryList): void; +} +interface MSLaunchUriCallback { + (): void; +} +interface FrameRequestCallback { + (time: number): void; +} +interface MSUnsafeFunctionCallback { + (): any; +} +interface MSExecAtPriorityFunctionCallback { + (...args: any[]): any; +} +interface MutationCallback { + (mutations: MutationRecord[], observer: MutationObserver): void; +} +interface DecodeSuccessCallback { + (decodedData: AudioBuffer): void; +} +interface DecodeErrorCallback { + (): void; +} +interface FunctionStringCallback { + (data: string): void; +} +declare var Audio: {new(src?: string): HTMLAudioElement; }; +declare var Image: {new(width?: number, height?: number): HTMLImageElement; }; +declare var Option: {new(text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement; }; declare var animationStartTime: number; -declare var onmsgesturedoubletap: (ev: any) => any; -declare var onmspointerhover: (ev: any) => any; -declare var onmsgesturehold: (ev: any) => any; -declare var onmspointermove: (ev: any) => any; -declare var onmsgesturechange: (ev: any) => any; -declare var onmsgesturestart: (ev: any) => any; -declare var onmspointercancel: (ev: any) => any; -declare var onmsgestureend: (ev: any) => any; -declare var onmsgesturetap: (ev: any) => any; -declare var onmspointerout: (ev: any) => any; -declare var msAnimationStartTime: number; declare var applicationCache: ApplicationCache; -declare var onmsinertiastart: (ev: any) => any; -declare var onmspointerover: (ev: any) => any; -declare var onpopstate: (ev: PopStateEvent) => any; -declare var onmspointerup: (ev: any) => any; -declare var onpageshow: (ev: PageTransitionEvent) => any; -declare var ondevicemotion: (ev: DeviceMotionEvent) => any; -declare var devicePixelRatio: number; -declare var msCrypto: Crypto; -declare var ondeviceorientation: (ev: DeviceOrientationEvent) => any; -declare var doNotTrack: string; -declare var onmspointerenter: (ev: any) => any; -declare var onpagehide: (ev: PageTransitionEvent) => any; -declare var onmspointerleave: (ev: any) => any; -declare function alert(message?: any): void; -declare function scroll(x?: number, y?: number): void; -declare function focus(): void; -declare function scrollTo(x?: number, y?: number): void; -declare function print(): void; -declare function prompt(message?: string, _default?: string): string; -declare function toString(): string; -declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window; -declare function scrollBy(x?: number, y?: number): void; -declare function confirm(message?: string): boolean; -declare function close(): void; -declare function postMessage(message: any, targetOrigin: string, ports?: any): void; -declare function showModalDialog(url?: string, argument?: any, options?: any): any; -declare function blur(): void; -declare function getSelection(): Selection; -declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; -declare function msCancelRequestAnimationFrame(handle: number): void; -declare function matchMedia(mediaQuery: string): MediaQueryList; -declare function cancelAnimationFrame(handle: number): void; -declare function msIsStaticHTML(html: string): boolean; -declare function msMatchMedia(mediaQuery: string): MediaQueryList; -declare function requestAnimationFrame(callback: FrameRequestCallback): number; -declare function msRequestAnimationFrame(callback: FrameRequestCallback): number; -declare function removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -declare function dispatchEvent(evt: Event): boolean; -declare function attachEvent(event: string, listener: EventListener): boolean; -declare function detachEvent(event: string, listener: EventListener): void; -declare var localStorage: Storage; -declare var status: string; -declare var onmouseleave: (ev: MouseEvent) => any; -declare var screenLeft: number; -declare var offscreenBuffering: any; -declare var maxConnectionsPerServer: number; -declare var onmouseenter: (ev: MouseEvent) => any; -declare var clipboardData: DataTransfer; -declare var defaultStatus: string; declare var clientInformation: Navigator; declare var closed: boolean; -declare var onhelp: (ev: Event) => any; +declare var crypto: Crypto; +declare var defaultStatus: string; +declare var devicePixelRatio: number; +declare var doNotTrack: string; +declare var document: Document; +declare var event: Event; declare var external: External; -declare var event: MSEventObj; -declare var onfocusout: (ev: FocusEvent) => any; +declare var frameElement: Element; +declare var frames: Window; +declare var history: History; +declare var innerHeight: number; +declare var innerWidth: number; +declare var length: number; +declare var location: Location; +declare var locationbar: BarProp; +declare var menubar: BarProp; +declare var msAnimationStartTime: number; +declare var msTemplatePrinter: MSTemplatePrinter; +declare var name: string; +declare var navigator: Navigator; +declare var offscreenBuffering: string | boolean; +declare var onabort: (ev: Event) => any; +declare var onafterprint: (ev: Event) => any; +declare var onbeforeprint: (ev: Event) => any; +declare var onbeforeunload: (ev: BeforeUnloadEvent) => any; +declare var onblur: (ev: FocusEvent) => any; +declare var oncanplay: (ev: Event) => any; +declare var oncanplaythrough: (ev: Event) => any; +declare var onchange: (ev: Event) => any; +declare var onclick: (ev: MouseEvent) => any; +declare var oncompassneedscalibration: (ev: Event) => any; +declare var oncontextmenu: (ev: PointerEvent) => any; +declare var ondblclick: (ev: MouseEvent) => any; +declare var ondevicemotion: (ev: DeviceMotionEvent) => any; +declare var ondeviceorientation: (ev: DeviceOrientationEvent) => any; +declare var ondrag: (ev: DragEvent) => any; +declare var ondragend: (ev: DragEvent) => any; +declare var ondragenter: (ev: DragEvent) => any; +declare var ondragleave: (ev: DragEvent) => any; +declare var ondragover: (ev: DragEvent) => any; +declare var ondragstart: (ev: DragEvent) => any; +declare var ondrop: (ev: DragEvent) => any; +declare var ondurationchange: (ev: Event) => any; +declare var onemptied: (ev: Event) => any; +declare var onended: (ev: Event) => any; +declare var onerror: ErrorEventHandler; +declare var onfocus: (ev: FocusEvent) => any; +declare var onhashchange: (ev: HashChangeEvent) => any; +declare var oninput: (ev: Event) => any; +declare var onkeydown: (ev: KeyboardEvent) => any; +declare var onkeypress: (ev: KeyboardEvent) => any; +declare var onkeyup: (ev: KeyboardEvent) => any; +declare var onload: (ev: Event) => any; +declare var onloadeddata: (ev: Event) => any; +declare var onloadedmetadata: (ev: Event) => any; +declare var onloadstart: (ev: Event) => any; +declare var onmessage: (ev: MessageEvent) => any; +declare var onmousedown: (ev: MouseEvent) => any; +declare var onmouseenter: (ev: MouseEvent) => any; +declare var onmouseleave: (ev: MouseEvent) => any; +declare var onmousemove: (ev: MouseEvent) => any; +declare var onmouseout: (ev: MouseEvent) => any; +declare var onmouseover: (ev: MouseEvent) => any; +declare var onmouseup: (ev: MouseEvent) => any; +declare var onmousewheel: (ev: MouseWheelEvent) => any; +declare var onmsgesturechange: (ev: MSGestureEvent) => any; +declare var onmsgesturedoubletap: (ev: MSGestureEvent) => any; +declare var onmsgestureend: (ev: MSGestureEvent) => any; +declare var onmsgesturehold: (ev: MSGestureEvent) => any; +declare var onmsgesturestart: (ev: MSGestureEvent) => any; +declare var onmsgesturetap: (ev: MSGestureEvent) => any; +declare var onmsinertiastart: (ev: MSGestureEvent) => any; +declare var onmspointercancel: (ev: MSPointerEvent) => any; +declare var onmspointerdown: (ev: MSPointerEvent) => any; +declare var onmspointerenter: (ev: MSPointerEvent) => any; +declare var onmspointerleave: (ev: MSPointerEvent) => any; +declare var onmspointermove: (ev: MSPointerEvent) => any; +declare var onmspointerout: (ev: MSPointerEvent) => any; +declare var onmspointerover: (ev: MSPointerEvent) => any; +declare var onmspointerup: (ev: MSPointerEvent) => any; +declare var onoffline: (ev: Event) => any; +declare var ononline: (ev: Event) => any; +declare var onorientationchange: (ev: Event) => any; +declare var onpagehide: (ev: PageTransitionEvent) => any; +declare var onpageshow: (ev: PageTransitionEvent) => any; +declare var onpause: (ev: Event) => any; +declare var onplay: (ev: Event) => any; +declare var onplaying: (ev: Event) => any; +declare var onpopstate: (ev: PopStateEvent) => any; +declare var onprogress: (ev: ProgressEvent) => any; +declare var onratechange: (ev: Event) => any; +declare var onreadystatechange: (ev: ProgressEvent) => any; +declare var onreset: (ev: Event) => any; +declare var onresize: (ev: UIEvent) => any; +declare var onscroll: (ev: UIEvent) => any; +declare var onseeked: (ev: Event) => any; +declare var onseeking: (ev: Event) => any; +declare var onselect: (ev: UIEvent) => any; +declare var onstalled: (ev: Event) => any; +declare var onstorage: (ev: StorageEvent) => any; +declare var onsubmit: (ev: Event) => any; +declare var onsuspend: (ev: Event) => any; +declare var ontimeupdate: (ev: Event) => any; +declare var ontouchcancel: any; +declare var ontouchend: any; +declare var ontouchmove: any; +declare var ontouchstart: any; +declare var onunload: (ev: Event) => any; +declare var onvolumechange: (ev: Event) => any; +declare var onwaiting: (ev: Event) => any; +declare var opener: Window; +declare var orientation: string; +declare var outerHeight: number; +declare var outerWidth: number; +declare var pageXOffset: number; +declare var pageYOffset: number; +declare var parent: Window; +declare var performance: Performance; +declare var personalbar: BarProp; +declare var screen: Screen; +declare var screenLeft: number; declare var screenTop: number; -declare var onfocusin: (ev: FocusEvent) => any; -declare function showModelessDialog(url?: string, argument?: any, options?: any): Window; -declare function navigate(url: string): void; -declare function resizeBy(x?: number, y?: number): void; -declare function item(index: any): any; -declare function resizeTo(x?: number, y?: number): void; -declare function createPopup(arguments?: any): MSPopupWindow; -declare function toStaticHTML(html: string): string; -declare function execScript(code: string, language?: string): any; -declare function msWriteProfilerMark(profilerMarkName: string): void; -declare function moveTo(x?: number, y?: number): void; -declare function moveBy(x?: number, y?: number): void; -declare function showHelp(url: string, helpArg?: any, features?: string): void; +declare var screenX: number; +declare var screenY: number; +declare var scrollX: number; +declare var scrollY: number; +declare var scrollbars: BarProp; +declare var self: Window; +declare var status: string; +declare var statusbar: BarProp; +declare var styleMedia: StyleMedia; +declare var toolbar: BarProp; +declare var top: Window; +declare var window: Window; +declare function alert(message?: any): void; +declare function blur(): void; +declare function cancelAnimationFrame(handle: number): void; declare function captureEvents(): void; +declare function close(): void; +declare function confirm(message?: string): boolean; +declare function focus(): void; +declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; +declare function getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; +declare function getSelection(): Selection; +declare function matchMedia(mediaQuery: string): MediaQueryList; +declare function moveBy(x?: number, y?: number): void; +declare function moveTo(x?: number, y?: number): void; +declare function msCancelRequestAnimationFrame(handle: number): void; +declare function msMatchMedia(mediaQuery: string): MediaQueryList; +declare function msRequestAnimationFrame(callback: FrameRequestCallback): number; +declare function msWriteProfilerMark(profilerMarkName: string): void; +declare function open(url?: string, target?: string, features?: string, replace?: boolean): any; +declare function postMessage(message: any, targetOrigin: string, ports?: any): void; +declare function print(): void; +declare function prompt(message?: string, _default?: string): string; declare function releaseEvents(): void; -declare var sessionStorage: Storage; -declare function clearTimeout(handle: number): void; -declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; +declare function requestAnimationFrame(callback: FrameRequestCallback): number; +declare function resizeBy(x?: number, y?: number): void; +declare function resizeTo(x?: number, y?: number): void; +declare function scroll(x?: number, y?: number): void; +declare function scrollBy(x?: number, y?: number): void; +declare function scrollTo(x?: number, y?: number): void; +declare function webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; +declare function webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; +declare function toString(): string; +declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +declare function dispatchEvent(evt: Event): boolean; +declare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; declare function clearInterval(handle: number): void; +declare function clearTimeout(handle: number): void; declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; -declare function msSetImmediate(expression: any, ...args: any[]): number; +declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; declare function clearImmediate(handle: number): void; declare function msClearImmediate(handle: number): void; +declare function msSetImmediate(expression: any, ...args: any[]): number; declare function setImmediate(expression: any, ...args: any[]): number; -declare function btoa(rawString: string): string; -declare function atob(encodedString: string): string; -declare var msIndexedDB: IDBFactory; -declare var indexedDB: IDBFactory; +declare var sessionStorage: Storage; +declare var localStorage: Storage; declare var console: Console; -declare var onpointerenter: (ev: PointerEvent) => any; -declare var onpointerout: (ev: PointerEvent) => any; -declare var onpointerdown: (ev: PointerEvent) => any; -declare var onpointerup: (ev: PointerEvent) => any; declare var onpointercancel: (ev: PointerEvent) => any; -declare var onpointerover: (ev: PointerEvent) => any; -declare var onpointermove: (ev: PointerEvent) => any; +declare var onpointerdown: (ev: PointerEvent) => any; +declare var onpointerenter: (ev: PointerEvent) => any; declare var onpointerleave: (ev: PointerEvent) => any; -declare function addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var onpointermove: (ev: PointerEvent) => any; +declare var onpointerout: (ev: PointerEvent) => any; +declare var onpointerover: (ev: PointerEvent) => any; +declare var onpointerup: (ev: PointerEvent) => any; +declare var onwheel: (ev: WheelEvent) => any; +declare var indexedDB: IDBFactory; +declare var msIndexedDB: IDBFactory; +declare function atob(encodedString: string): string; +declare function btoa(rawString: string): string; +declare function addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; declare function addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "compassneedscalibration", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; declare function addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; declare function addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; declare function addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; - +declare function addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; ///////////////////////////// /// WorkerGlobalScope APIs ///////////////////////////// @@ -17222,13 +17992,16 @@ 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. + * 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; } @@ -17238,10 +18011,12 @@ 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. */ @@ -17250,37 +18025,43 @@ interface TextStreamWriter extends TextStreamBase { interface TextStreamReader extends TextStreamBase { /** - * Returns a specified number of characters from an input stream, beginning at the current pointer position. + * Returns a specified number of characters from an input stream, starting 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. */ @@ -17289,85 +18070,180 @@ interface TextStreamReader extends TextStreamBase { 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). + * Outputs text to either a message box (under WScript.exe) or the command console window followed by + * a newline (under CScript.exe). */ 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 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; }; + +/** + * Allows enumerating over a COM collection, which may not have indexed item access. + */ +interface Enumerator { + /** + * Returns true if the current item is the last one in the collection, or the collection is empty, + * or the current item is undefined. + */ + atEnd(): boolean; + + /** + * Returns the current item in the collection + */ + item(): T; + + /** + * Resets the current item in the collection to the first item. If there are no items in the collection, + * the current item is set to undefined. + */ + moveFirst(): void; + + /** + * Moves the current item to the next item in the collection. If the enumerator is at the end of + * the collection or the collection is empty, the current item is set to undefined. + */ + moveNext(): void; +} + +interface EnumeratorConstructor { + new (collection: any): Enumerator; + new (collection: any): Enumerator; +} + +declare var Enumerator: EnumeratorConstructor; + +/** + * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions. + */ +interface VBArray { + /** + * Returns the number of dimensions (1-based). + */ + dimensions(): number; + + /** + * Takes an index for each dimension in the array, and returns the item at the corresponding location. + */ + getItem(dimension1Index: number, ...dimensionNIndexes: number[]): T; + + /** + * Returns the smallest available index for a given dimension. + * @param dimension 1-based dimension (defaults to 1) + */ + lbound(dimension?: number): number; + + /** + * Returns the largest available index for a given dimension. + * @param dimension 1-based dimension (defaults to 1) + */ + ubound(dimension?: number): number; + + /** + * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions, + * each successive dimension is appended to the end of the array. + * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6] + */ + toArray(): T[]; +} + +interface VBArrayConstructor { + new (safeArray: any): VBArray; + new (safeArray: any): VBArray; +} + +declare var VBArray: VBArrayConstructor; diff --git a/bin/lib.scriptHost.d.ts b/bin/lib.scriptHost.d.ts index 17b1fe956a2..12e04fb4144 100644 --- a/bin/lib.scriptHost.d.ts +++ b/bin/lib.scriptHost.d.ts @@ -37,13 +37,16 @@ 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. + * 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; } @@ -53,10 +56,12 @@ 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. */ @@ -65,37 +70,43 @@ interface TextStreamWriter extends TextStreamBase { interface TextStreamReader extends TextStreamBase { /** - * Returns a specified number of characters from an input stream, beginning at the current pointer position. + * Returns a specified number of characters from an input stream, starting 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. */ @@ -104,85 +115,180 @@ interface TextStreamReader extends TextStreamBase { 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). + * Outputs text to either a message box (under WScript.exe) or the command console window followed by + * a newline (under CScript.exe). */ 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 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; }; + +/** + * Allows enumerating over a COM collection, which may not have indexed item access. + */ +interface Enumerator { + /** + * Returns true if the current item is the last one in the collection, or the collection is empty, + * or the current item is undefined. + */ + atEnd(): boolean; + + /** + * Returns the current item in the collection + */ + item(): T; + + /** + * Resets the current item in the collection to the first item. If there are no items in the collection, + * the current item is set to undefined. + */ + moveFirst(): void; + + /** + * Moves the current item to the next item in the collection. If the enumerator is at the end of + * the collection or the collection is empty, the current item is set to undefined. + */ + moveNext(): void; +} + +interface EnumeratorConstructor { + new (collection: any): Enumerator; + new (collection: any): Enumerator; +} + +declare var Enumerator: EnumeratorConstructor; + +/** + * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions. + */ +interface VBArray { + /** + * Returns the number of dimensions (1-based). + */ + dimensions(): number; + + /** + * Takes an index for each dimension in the array, and returns the item at the corresponding location. + */ + getItem(dimension1Index: number, ...dimensionNIndexes: number[]): T; + + /** + * Returns the smallest available index for a given dimension. + * @param dimension 1-based dimension (defaults to 1) + */ + lbound(dimension?: number): number; + + /** + * Returns the largest available index for a given dimension. + * @param dimension 1-based dimension (defaults to 1) + */ + ubound(dimension?: number): number; + + /** + * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions, + * each successive dimension is appended to the end of the array. + * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6] + */ + toArray(): T[]; +} + +interface VBArrayConstructor { + new (safeArray: any): VBArray; + new (safeArray: any): VBArray; +} + +declare var VBArray: VBArrayConstructor; diff --git a/bin/lib.webworker.d.ts b/bin/lib.webworker.d.ts index fb993074398..740ebe94fa6 100644 --- a/bin/lib.webworker.d.ts +++ b/bin/lib.webworker.d.ts @@ -37,38 +37,216 @@ interface ArrayBuffer { slice(begin:number, end?:number): ArrayBuffer; } -declare var ArrayBuffer: { +interface ArrayBufferConstructor { prototype: ArrayBuffer; new (byteLength: number): ArrayBuffer; + isView(arg: any): boolean; } +declare var ArrayBuffer: ArrayBufferConstructor; interface ArrayBufferView { + /** + * The ArrayBuffer instance referenced by the array. + */ buffer: ArrayBuffer; - byteOffset: number; + + /** + * The length in bytes of the array. + */ byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; } /** - * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. */ -interface Int8Array extends ArrayBufferView { +interface Int8Array { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Int8Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Int8Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): Int8Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. */ - get(index: number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Int8Array; /** * Sets a value or an array of values. @@ -84,49 +262,256 @@ interface Int8Array extends ArrayBufferView { */ set(array: Int8Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Int8Array; /** - * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements at begin, inclusive, up to end, exclusive. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Int8Array; + + /** + * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Int8Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Int8Array: { +interface Int8ArrayConstructor { prototype: Int8Array; new (length: number): Int8Array; new (array: Int8Array): Int8Array; new (array: number[]): Int8Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Int8Array; +} +declare var Int8Array: Int8ArrayConstructor; + +/** + * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Uint8Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Uint8Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): Uint8Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint8Array; /** * Sets a value or an array of values. @@ -142,49 +527,257 @@ interface Uint8Array extends ArrayBufferView { */ set(array: Uint8Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Uint8Array; /** - * Gets a new Uint8Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Uint8Array; + + /** + * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Uint8Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Uint8Array: { + +interface Uint8ArrayConstructor { prototype: Uint8Array; new (length: number): Uint8Array; new (array: Uint8Array): Uint8Array; new (array: number[]): Uint8Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 16-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Int16Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint8Array; +} +declare var Uint8Array: Uint8ArrayConstructor; + +/** + * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int16Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Int16Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Int16Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): Int16Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Int16Array; /** * Sets a value or an array of values. @@ -200,49 +793,257 @@ interface Int16Array extends ArrayBufferView { */ set(array: Int16Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Int16Array; /** - * Gets a new Int16Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Int16Array; + + /** + * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Int16Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Int16Array: { + +interface Int16ArrayConstructor { prototype: Int16Array; new (length: number): Int16Array; new (array: Int16Array): Int16Array; new (array: number[]): Int16Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint16Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Int16Array; +} +declare var Int16Array: Int16ArrayConstructor; + +/** + * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint16Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Uint16Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Uint16Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): Uint16Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint16Array; /** * Sets a value or an array of values. @@ -258,49 +1059,256 @@ interface Uint16Array extends ArrayBufferView { */ set(array: Uint16Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Uint16Array; /** - * Gets a new Uint16Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Uint16Array; + + /** + * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Uint16Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Uint16Array: { + +interface Uint16ArrayConstructor { prototype: Uint16Array; new (length: number): Uint16Array; new (array: Uint16Array): Uint16Array; new (array: number[]): Uint16Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 32-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Int32Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint16Array; +} +declare var Uint16Array: Uint16ArrayConstructor; +/** + * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int32Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Int32Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Int32Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): Int32Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Int32Array; /** * Sets a value or an array of values. @@ -316,49 +1324,257 @@ interface Int32Array extends ArrayBufferView { */ set(array: Int32Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Int32Array; /** - * Gets a new Int32Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Int32Array; + + /** + * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Int32Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Int32Array: { + +interface Int32ArrayConstructor { prototype: Int32Array; new (length: number): Int32Array; new (array: Int32Array): Int32Array; new (array: number[]): Int32Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint32Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Int32Array; +} +declare var Int32Array: Int32ArrayConstructor; + +/** + * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint32Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Uint32Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Uint32Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): Uint32Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint32Array; /** * Sets a value or an array of values. @@ -374,49 +1590,257 @@ interface Uint32Array extends ArrayBufferView { */ set(array: Uint32Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Uint32Array; /** - * Gets a new Int8Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Uint32Array; + + /** + * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Uint32Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Uint32Array: { + +interface Uint32ArrayConstructor { prototype: Uint32Array; new (length: number): Uint32Array; new (array: Uint32Array): Uint32Array; new (array: number[]): Uint32Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Float32Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint32Array; +} +declare var Uint32Array: Uint32ArrayConstructor; + +/** + * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number + * of bytes could not be allocated an exception is raised. + */ +interface Float32Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Float32Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Float32Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): Float32Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Float32Array; /** * Sets a value or an array of values. @@ -432,49 +1856,257 @@ interface Float32Array extends ArrayBufferView { */ set(array: Float32Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Float32Array; /** - * Gets a new Float32Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Float32Array; + + /** + * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Float32Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Float32Array: { + +interface Float32ArrayConstructor { prototype: Float32Array; new (length: number): Float32Array; new (array: Float32Array): Float32Array; new (array: number[]): Float32Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 64-bit float values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Float64Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Float32Array; +} +declare var Float32Array: Float32ArrayConstructor; + +/** + * A typed array of 64-bit float values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Float64Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Float64Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Float64Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): Float64Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Float64Array; /** * Sets a value or an array of values. @@ -490,191 +2122,70 @@ interface Float64Array extends ArrayBufferView { */ set(array: Float64Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Float64Array; /** - * Gets a new Float64Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Float64Array; + + /** + * Gets a new Float64Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Float64Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Float64Array: { + +interface Float64ArrayConstructor { prototype: Float64Array; new (length: number): Float64Array; new (array: Float64Array): Float64Array; new (array: number[]): Float64Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array; + + /** + * The size in bytes of each element in the array. + */ BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Float64Array; } - -/** - * You can use a DataView object to read and write the different kinds of binary data to any location in the ArrayBuffer. - */ -interface DataView extends ArrayBufferView { - /** - * Gets the Int8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt8(byteOffset: number): number; - - /** - * Gets the Uint8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint8(byteOffset: number): number; - - /** - * Gets the Int16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt16(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Uint16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint16(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Int32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Uint32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Float32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Float64 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat64(byteOffset: number, littleEndian?: boolean): number; - - /** - * Stores an Int8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setInt8(byteOffset: number, value: number): void; - - /** - * Stores an Uint8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setUint8(byteOffset: number, value: number): void; - - /** - * Stores an Int16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setInt16(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Uint16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setUint16(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Int32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setInt32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Uint32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setUint32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Float32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Float64 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void; -} -declare var DataView: { - prototype: DataView; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): DataView; -} - -///////////////////////////// -/// IE11 ECMAScript Extensions -///////////////////////////// - -interface Map { - clear(): void; - delete(key: K): boolean; - forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; - get(key: K): V; - has(key: K): boolean; - set(key: K, value: V): Map; - size: number; -} -declare var Map: { - new (): Map; - prototype: Map; -} - -interface WeakMap { - clear(): void; - delete(key: K): boolean; - get(key: K): V; - has(key: K): boolean; - set(key: K, value: V): WeakMap; -} -declare var WeakMap: { - new (): WeakMap; - prototype: WeakMap; -} - -interface Set { - add(value: T): Set; - clear(): void; - delete(value: T): boolean; - forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; - has(value: T): boolean; - size: number; -} -declare var Set: { - new (): Set; - prototype: Set; -} -///////////////////////////// +declare var Float64Array: Float64ArrayConstructor;///////////////////////////// /// ECMAScript Internationalization API ///////////////////////////// @@ -842,179 +2353,76 @@ interface Date { toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string; } + ///////////////////////////// /// IE Worker APIs ///////////////////////////// - -interface Console { - info(message?: any, ...optionalParams: any[]): void; - warn(message?: any, ...optionalParams: any[]): void; - error(message?: any, ...optionalParams: any[]): void; - log(message?: any, ...optionalParams: any[]): void; - profile(reportName?: string): void; - assert(test?: boolean, message?: string, ...optionalParams: any[]): void; - msIsIndependentlyComposed(element: any): boolean; - clear(): void; - dir(value?: any, ...optionalParams: any[]): void; - profileEnd(): void; - count(countTitle?: string): void; - groupEnd(): void; - time(timerName?: string): void; - timeEnd(timerName?: string): void; - trace(): void; - group(groupTitle?: string): void; - dirxml(value: any): void; - debug(message?: string, ...optionalParams: any[]): void; - groupCollapsed(groupTitle?: string): void; - select(element: any): void; -} -declare var Console: { - prototype: Console; - new(): Console; -} - -interface NavigatorID { - appVersion: string; - appName: string; - userAgent: string; - platform: string; - product: string; - vendor: string; -} - -interface EventTarget { - removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; - dispatchEvent(evt: Event): boolean; -} - -interface MessageEvent extends Event { - source: any; - origin: string; - data: any; - ports: any; - initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: any): void; -} -declare var MessageEvent: { - prototype: MessageEvent; - new(): MessageEvent; -} - -interface XMLHttpRequest extends EventTarget { - responseBody: any; - status: number; - readyState: number; - responseText: string; - responseXML: any; - ontimeout: (ev: Event) => any; - statusText: string; - onreadystatechange: (ev: Event) => any; - timeout: number; - onload: (ev: Event) => any; - response: any; - withCredentials: boolean; - onprogress: (ev: ProgressEvent) => any; - onabort: (ev: any) => any; - responseType: string; - onloadend: (ev: ProgressEvent) => any; - upload: XMLHttpRequestEventTarget; - onerror: (ev: ErrorEvent) => any; - onloadstart: (ev: Event) => any; - msCaching: string; - open(method: string, url: string, async?: boolean, user?: string, password?: string): void; - send(data?: any): void; - abort(): void; - getAllResponseHeaders(): string; - setRequestHeader(header: string, value: string): void; - getResponseHeader(header: string): string; - msCachingEnabled(): boolean; - overrideMimeType(mime: string): void; - LOADING: number; - DONE: number; - UNSENT: number; - OPENED: number; - HEADERS_RECEIVED: number; - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var XMLHttpRequest: { - prototype: XMLHttpRequest; - new(): XMLHttpRequest; - LOADING: number; - DONE: number; - UNSENT: number; - OPENED: number; - HEADERS_RECEIVED: number; - create(): XMLHttpRequest; -} - interface EventListener { (evt: Event): void; } -interface EventException { +interface Blob { + size: number; + type: string; + msClose(): void; + msDetachStream(): any; + slice(start?: number, end?: number, contentType?: string): Blob; +} + +declare var Blob: { + prototype: Blob; + new (blobParts?: any[], options?: BlobPropertyBag): Blob; +} + +interface CloseEvent extends Event { code: number; - message: string; + reason: string; + wasClean: boolean; + initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; +} + +declare var CloseEvent: { + prototype: CloseEvent; + new(): CloseEvent; +} + +interface Console { + assert(test?: boolean, message?: string, ...optionalParams: any[]): void; + clear(): void; + count(countTitle?: string): void; + debug(message?: string, ...optionalParams: any[]): void; + dir(value?: any, ...optionalParams: any[]): void; + dirxml(value: any): void; + error(message?: any, ...optionalParams: any[]): void; + group(groupTitle?: string): void; + groupCollapsed(groupTitle?: string): void; + groupEnd(): void; + info(message?: any, ...optionalParams: any[]): void; + log(message?: any, ...optionalParams: any[]): void; + msIsIndependentlyComposed(element: any): boolean; + profile(reportName?: string): void; + profileEnd(): void; + select(element: any): void; + time(timerName?: string): void; + timeEnd(timerName?: string): void; + trace(): void; + warn(message?: any, ...optionalParams: any[]): void; +} + +declare var Console: { + prototype: Console; + new(): Console; +} + +interface DOMError { name: string; toString(): string; - DISPATCH_REQUEST_ERR: number; - UNSPECIFIED_EVENT_TYPE_ERR: number; -} -declare var EventException: { - prototype: EventException; - new(): EventException; - DISPATCH_REQUEST_ERR: number; - UNSPECIFIED_EVENT_TYPE_ERR: number; } -interface NavigatorOnLine { - onLine: boolean; -} - -interface Event { - timeStamp: number; - defaultPrevented: boolean; - isTrusted: boolean; - currentTarget: EventTarget; - cancelBubble: boolean; - target: EventTarget; - eventPhase: number; - cancelable: boolean; - type: string; - srcElement: any; - bubbles: boolean; - initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; - stopPropagation(): void; - stopImmediatePropagation(): void; - preventDefault(): void; - CAPTURING_PHASE: number; - AT_TARGET: number; - BUBBLING_PHASE: number; -} -declare var Event: { - prototype: Event; - new(): Event; - CAPTURING_PHASE: number; - AT_TARGET: number; - BUBBLING_PHASE: number; -} - -interface ImageData { - width: number; - data: number[]; - height: number; -} -declare var ImageData: { - prototype: ImageData; - new(): ImageData; +declare var DOMError: { + prototype: DOMError; + new(): DOMError; } interface DOMException { @@ -1022,370 +2430,65 @@ interface DOMException { message: string; name: string; toString(): string; - HIERARCHY_REQUEST_ERR: number; - NO_MODIFICATION_ALLOWED_ERR: number; - INVALID_MODIFICATION_ERR: number; - NAMESPACE_ERR: number; - INVALID_CHARACTER_ERR: number; - TYPE_MISMATCH_ERR: number; ABORT_ERR: number; - INVALID_STATE_ERR: number; - SECURITY_ERR: number; - NETWORK_ERR: number; - WRONG_DOCUMENT_ERR: number; - QUOTA_EXCEEDED_ERR: number; - INDEX_SIZE_ERR: number; - DOMSTRING_SIZE_ERR: number; - SYNTAX_ERR: number; - SERIALIZE_ERR: number; - VALIDATION_ERR: number; - NOT_FOUND_ERR: number; - URL_MISMATCH_ERR: number; - PARSE_ERR: number; - NO_DATA_ALLOWED_ERR: number; - NOT_SUPPORTED_ERR: number; - INVALID_ACCESS_ERR: number; - INUSE_ATTRIBUTE_ERR: number; - INVALID_NODE_TYPE_ERR: number; DATA_CLONE_ERR: number; + DOMSTRING_SIZE_ERR: number; + HIERARCHY_REQUEST_ERR: number; + INDEX_SIZE_ERR: number; + INUSE_ATTRIBUTE_ERR: number; + INVALID_ACCESS_ERR: number; + INVALID_CHARACTER_ERR: number; + INVALID_MODIFICATION_ERR: number; + INVALID_NODE_TYPE_ERR: number; + INVALID_STATE_ERR: number; + NAMESPACE_ERR: number; + NETWORK_ERR: number; + NOT_FOUND_ERR: number; + NOT_SUPPORTED_ERR: number; + NO_DATA_ALLOWED_ERR: number; + NO_MODIFICATION_ALLOWED_ERR: number; + PARSE_ERR: number; + QUOTA_EXCEEDED_ERR: number; + SECURITY_ERR: number; + SERIALIZE_ERR: number; + SYNTAX_ERR: number; TIMEOUT_ERR: number; + TYPE_MISMATCH_ERR: number; + URL_MISMATCH_ERR: number; + VALIDATION_ERR: number; + WRONG_DOCUMENT_ERR: number; } + declare var DOMException: { prototype: DOMException; new(): DOMException; - HIERARCHY_REQUEST_ERR: number; - NO_MODIFICATION_ALLOWED_ERR: number; - INVALID_MODIFICATION_ERR: number; - NAMESPACE_ERR: number; - INVALID_CHARACTER_ERR: number; - TYPE_MISMATCH_ERR: number; ABORT_ERR: number; - INVALID_STATE_ERR: number; - SECURITY_ERR: number; - NETWORK_ERR: number; - WRONG_DOCUMENT_ERR: number; - QUOTA_EXCEEDED_ERR: number; - INDEX_SIZE_ERR: number; - DOMSTRING_SIZE_ERR: number; - SYNTAX_ERR: number; - SERIALIZE_ERR: number; - VALIDATION_ERR: number; - NOT_FOUND_ERR: number; - URL_MISMATCH_ERR: number; - PARSE_ERR: number; - NO_DATA_ALLOWED_ERR: number; - NOT_SUPPORTED_ERR: number; - INVALID_ACCESS_ERR: number; - INUSE_ATTRIBUTE_ERR: number; - INVALID_NODE_TYPE_ERR: number; DATA_CLONE_ERR: number; + DOMSTRING_SIZE_ERR: number; + HIERARCHY_REQUEST_ERR: number; + INDEX_SIZE_ERR: number; + INUSE_ATTRIBUTE_ERR: number; + INVALID_ACCESS_ERR: number; + INVALID_CHARACTER_ERR: number; + INVALID_MODIFICATION_ERR: number; + INVALID_NODE_TYPE_ERR: number; + INVALID_STATE_ERR: number; + NAMESPACE_ERR: number; + NETWORK_ERR: number; + NOT_FOUND_ERR: number; + NOT_SUPPORTED_ERR: number; + NO_DATA_ALLOWED_ERR: number; + NO_MODIFICATION_ALLOWED_ERR: number; + PARSE_ERR: number; + QUOTA_EXCEEDED_ERR: number; + SECURITY_ERR: number; + SERIALIZE_ERR: number; + SYNTAX_ERR: number; TIMEOUT_ERR: number; -} - -interface ErrorEvent extends Event { - colno: number; - filename: string; - error: any; - lineno: number; - message: string; - initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; -} -declare var ErrorEvent: { - prototype: ErrorEvent; - new(): ErrorEvent; -} - -interface MSStreamReader extends MSBaseReader { - error: DOMError; - readAsArrayBuffer(stream: MSStream, size?: number): void; - readAsBlob(stream: MSStream, size?: number): void; - readAsDataURL(stream: MSStream, size?: number): void; - readAsText(stream: MSStream, encoding?: string, size?: number): void; -} -declare var MSStreamReader: { - prototype: MSStreamReader; - new(): MSStreamReader; -} - -interface MessageChannel { - port2: MessagePort; - port1: MessagePort; -} -declare var MessageChannel: { - prototype: MessageChannel; - new(): MessageChannel; -} - -interface DOMError { - name: string; - toString(): string; -} -declare var DOMError: { - prototype: DOMError; - new(): DOMError; -} - -interface CloseEvent extends Event { - wasClean: boolean; - reason: string; - code: number; - initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; -} -declare var CloseEvent: { - prototype: CloseEvent; - new(): CloseEvent; -} - -interface WebSocket extends EventTarget { - protocol: string; - readyState: number; - bufferedAmount: number; - onopen: (ev: Event) => any; - extensions: string; - onmessage: (ev: MessageEvent) => any; - onclose: (ev: CloseEvent) => any; - onerror: (ev: ErrorEvent) => any; - binaryType: string; - url: string; - close(code?: number, reason?: string): void; - send(data: any): void; - OPEN: number; - CLOSING: number; - CONNECTING: number; - CLOSED: number; - addEventListener(type: "open", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "close", listener: (ev: CloseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var WebSocket: { - prototype: WebSocket; - new(url: string, protocols?: string): WebSocket; - new(url: string, protocols?: string[]): WebSocket; - OPEN: number; - CLOSING: number; - CONNECTING: number; - CLOSED: number; -} - -interface ProgressEvent extends Event { - loaded: number; - lengthComputable: boolean; - total: number; - initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; -} -declare var ProgressEvent: { - prototype: ProgressEvent; - new(): ProgressEvent; -} - -interface IDBObjectStore { - indexNames: DOMStringList; - name: string; - transaction: IDBTransaction; - keyPath: string; - count(key?: any): IDBRequest; - add(value: any, key?: any): IDBRequest; - clear(): IDBRequest; - createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; - put(value: any, key?: any): IDBRequest; - openCursor(range?: any, direction?: string): IDBRequest; - deleteIndex(indexName: string): void; - index(name: string): IDBIndex; - get(key: any): IDBRequest; - delete(key: any): IDBRequest; -} -declare var IDBObjectStore: { - prototype: IDBObjectStore; - new(): IDBObjectStore; -} - -interface IDBVersionChangeEvent extends Event { - newVersion: number; - oldVersion: number; -} -declare var IDBVersionChangeEvent: { - prototype: IDBVersionChangeEvent; - new(): IDBVersionChangeEvent; -} - -interface IDBIndex { - unique: boolean; - name: string; - keyPath: string; - objectStore: IDBObjectStore; - count(key?: any): IDBRequest; - getKey(key: any): IDBRequest; - openKeyCursor(range?: IDBKeyRange, direction?: string): IDBRequest; - get(key: any): IDBRequest; - openCursor(range?: IDBKeyRange, direction?: string): IDBRequest; -} -declare var IDBIndex: { - prototype: IDBIndex; - new(): IDBIndex; -} - -interface FileList { - length: number; - item(index: number): File; - [index: number]: File; -} -declare var FileList: { - prototype: FileList; - new(): FileList; -} - -interface IDBCursor { - source: any; - direction: string; - key: any; - primaryKey: any; - advance(count: number): void; - delete(): IDBRequest; - continue(key?: any): void; - update(value: any): IDBRequest; - PREV: string; - PREV_NO_DUPLICATE: string; - NEXT: string; - NEXT_NO_DUPLICATE: string; -} -declare var IDBCursor: { - prototype: IDBCursor; - new(): IDBCursor; - PREV: string; - PREV_NO_DUPLICATE: string; - NEXT: string; - NEXT_NO_DUPLICATE: string; -} - -interface File extends Blob { - lastModifiedDate: any; - name: string; -} -declare var File: { - prototype: File; - new(): File; -} - -interface IDBCursorWithValue extends IDBCursor { - value: any; -} -declare var IDBCursorWithValue: { - prototype: IDBCursorWithValue; - new(): IDBCursorWithValue; -} - -interface XMLHttpRequestEventTarget extends EventTarget { - onprogress: (ev: ProgressEvent) => any; - onerror: (ev: ErrorEvent) => any; - onload: (ev: Event) => any; - ontimeout: (ev: Event) => any; - onabort: (ev: any) => any; - onloadstart: (ev: Event) => any; - onloadend: (ev: ProgressEvent) => any; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var XMLHttpRequestEventTarget: { - prototype: XMLHttpRequestEventTarget; - new(): XMLHttpRequestEventTarget; -} - -interface MSBaseReader extends EventTarget { - onprogress: (ev: ProgressEvent) => any; - readyState: number; - onabort: (ev: any) => any; - onloadend: (ev: ProgressEvent) => any; - onerror: (ev: ErrorEvent) => any; - onload: (ev: Event) => any; - onloadstart: (ev: Event) => any; - result: any; - abort(): void; - LOADING: number; - EMPTY: number; - DONE: number; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface IDBKeyRange { - upper: any; - upperOpen: boolean; - lower: any; - lowerOpen: boolean; -} -declare var IDBKeyRange: { - prototype: IDBKeyRange; - new(): IDBKeyRange; - bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; - only(value: any): IDBKeyRange; - lowerBound(bound: any, open?: boolean): IDBKeyRange; - upperBound(bound: any, open?: boolean): IDBKeyRange; -} - -interface WindowConsole { - console: Console; -} - -interface IDBTransaction extends EventTarget { - oncomplete: (ev: Event) => any; - db: IDBDatabase; - mode: string; - error: DOMError; - onerror: (ev: ErrorEvent) => any; - onabort: (ev: any) => any; - abort(): void; - objectStore(name: string): IDBObjectStore; - READ_ONLY: string; - VERSION_CHANGE: string; - READ_WRITE: string; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBTransaction: { - prototype: IDBTransaction; - new(): IDBTransaction; - READ_ONLY: string; - VERSION_CHANGE: string; - READ_WRITE: string; -} - -interface WindowBase64 { - btoa(rawString: string): string; - atob(encodedString: string): string; -} - -interface IDBDatabase extends EventTarget { - version: string; - name: string; - objectStoreNames: DOMStringList; - onerror: (ev: ErrorEvent) => any; - onabort: (ev: any) => any; - createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; - close(): void; - transaction(storeNames: any, mode?: string): IDBTransaction; - deleteObjectStore(name: string): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBDatabase: { - prototype: IDBDatabase; - new(): IDBDatabase; + TYPE_MISMATCH_ERR: number; + URL_MISMATCH_ERR: number; + VALIDATION_ERR: number; + WRONG_DOCUMENT_ERR: number; } interface DOMStringList { @@ -1394,68 +2497,657 @@ interface DOMStringList { item(index: number): string; [index: number]: string; } + declare var DOMStringList: { prototype: DOMStringList; new(): DOMStringList; } -interface IDBOpenDBRequest extends IDBRequest { - onupgradeneeded: (ev: IDBVersionChangeEvent) => any; - onblocked: (ev: Event) => any; - addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "upgradeneeded", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blocked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +interface ErrorEvent extends Event { + colno: number; + error: any; + filename: string; + lineno: number; + message: string; + initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; } + +declare var ErrorEvent: { + prototype: ErrorEvent; + new(): ErrorEvent; +} + +interface Event { + bubbles: boolean; + cancelBubble: boolean; + cancelable: boolean; + currentTarget: EventTarget; + defaultPrevented: boolean; + eventPhase: number; + isTrusted: boolean; + returnValue: boolean; + srcElement: any; + target: EventTarget; + timeStamp: number; + type: string; + initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; + preventDefault(): void; + stopImmediatePropagation(): void; + stopPropagation(): void; + AT_TARGET: number; + BUBBLING_PHASE: number; + CAPTURING_PHASE: number; +} + +declare var Event: { + prototype: Event; + new(type: string, eventInitDict?: EventInit): Event; + AT_TARGET: number; + BUBBLING_PHASE: number; + CAPTURING_PHASE: number; +} + +interface EventTarget { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + dispatchEvent(evt: Event): boolean; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var EventTarget: { + prototype: EventTarget; + new(): EventTarget; +} + +interface File extends Blob { + lastModifiedDate: any; + name: string; +} + +declare var File: { + prototype: File; + new(): File; +} + +interface FileList { + length: number; + item(index: number): File; + [index: number]: File; +} + +declare var FileList: { + prototype: FileList; + new(): FileList; +} + +interface FileReader extends EventTarget, MSBaseReader { + error: DOMError; + readAsArrayBuffer(blob: Blob): void; + readAsBinaryString(blob: Blob): void; + readAsDataURL(blob: Blob): void; + readAsText(blob: Blob, encoding?: string): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var FileReader: { + prototype: FileReader; + new(): FileReader; +} + +interface IDBCursor { + direction: string; + key: any; + primaryKey: any; + source: any; + advance(count: number): void; + continue(key?: any): void; + delete(): IDBRequest; + update(value: any): IDBRequest; + NEXT: string; + NEXT_NO_DUPLICATE: string; + PREV: string; + PREV_NO_DUPLICATE: string; +} + +declare var IDBCursor: { + prototype: IDBCursor; + new(): IDBCursor; + NEXT: string; + NEXT_NO_DUPLICATE: string; + PREV: string; + PREV_NO_DUPLICATE: string; +} + +interface IDBCursorWithValue extends IDBCursor { + value: any; +} + +declare var IDBCursorWithValue: { + prototype: IDBCursorWithValue; + new(): IDBCursorWithValue; +} + +interface IDBDatabase extends EventTarget { + name: string; + objectStoreNames: DOMStringList; + onabort: (ev: Event) => any; + onerror: (ev: Event) => any; + version: string; + close(): void; + createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; + deleteObjectStore(name: string): void; + transaction(storeNames: any, mode?: string): IDBTransaction; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBDatabase: { + prototype: IDBDatabase; + new(): IDBDatabase; +} + +interface IDBFactory { + cmp(first: any, second: any): number; + deleteDatabase(name: string): IDBOpenDBRequest; + open(name: string, version?: number): IDBOpenDBRequest; +} + +declare var IDBFactory: { + prototype: IDBFactory; + new(): IDBFactory; +} + +interface IDBIndex { + keyPath: string; + name: string; + objectStore: IDBObjectStore; + unique: boolean; + count(key?: any): IDBRequest; + get(key: any): IDBRequest; + getKey(key: any): IDBRequest; + openCursor(range?: IDBKeyRange, direction?: string): IDBRequest; + openKeyCursor(range?: IDBKeyRange, direction?: string): IDBRequest; +} + +declare var IDBIndex: { + prototype: IDBIndex; + new(): IDBIndex; +} + +interface IDBKeyRange { + lower: any; + lowerOpen: boolean; + upper: any; + upperOpen: boolean; +} + +declare var IDBKeyRange: { + prototype: IDBKeyRange; + new(): IDBKeyRange; + bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; + lowerBound(bound: any, open?: boolean): IDBKeyRange; + only(value: any): IDBKeyRange; + upperBound(bound: any, open?: boolean): IDBKeyRange; +} + +interface IDBObjectStore { + indexNames: DOMStringList; + keyPath: string; + name: string; + transaction: IDBTransaction; + add(value: any, key?: any): IDBRequest; + clear(): IDBRequest; + count(key?: any): IDBRequest; + createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; + delete(key: any): IDBRequest; + deleteIndex(indexName: string): void; + get(key: any): IDBRequest; + index(name: string): IDBIndex; + openCursor(range?: any, direction?: string): IDBRequest; + put(value: any, key?: any): IDBRequest; +} + +declare var IDBObjectStore: { + prototype: IDBObjectStore; + new(): IDBObjectStore; +} + +interface IDBOpenDBRequest extends IDBRequest { + onblocked: (ev: Event) => any; + onupgradeneeded: (ev: IDBVersionChangeEvent) => any; + addEventListener(type: "blocked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "upgradeneeded", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + declare var IDBOpenDBRequest: { prototype: IDBOpenDBRequest; new(): IDBOpenDBRequest; } -interface MSUnsafeFunctionCallback { - (): any; -} - interface IDBRequest extends EventTarget { - source: any; - onsuccess: (ev: Event) => any; error: DOMError; - transaction: IDBTransaction; - onerror: (ev: ErrorEvent) => any; + onerror: (ev: Event) => any; + onsuccess: (ev: Event) => any; readyState: string; result: any; - addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; + source: any; + transaction: IDBTransaction; addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var IDBRequest: { prototype: IDBRequest; new(): IDBRequest; } +interface IDBTransaction extends EventTarget { + db: IDBDatabase; + error: DOMError; + mode: string; + onabort: (ev: Event) => any; + oncomplete: (ev: Event) => any; + onerror: (ev: Event) => any; + abort(): void; + objectStore(name: string): IDBObjectStore; + READ_ONLY: string; + READ_WRITE: string; + VERSION_CHANGE: string; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBTransaction: { + prototype: IDBTransaction; + new(): IDBTransaction; + READ_ONLY: string; + READ_WRITE: string; + VERSION_CHANGE: string; +} + +interface IDBVersionChangeEvent extends Event { + newVersion: number; + oldVersion: number; +} + +declare var IDBVersionChangeEvent: { + prototype: IDBVersionChangeEvent; + new(): IDBVersionChangeEvent; +} + +interface ImageData { + data: number[]; + height: number; + width: number; +} + +declare var ImageData: { + prototype: ImageData; + new(): ImageData; +} + +interface MSApp { + clearTemporaryWebDataAsync(): MSAppAsyncOperation; + createBlobFromRandomAccessStream(type: string, seeker: any): Blob; + createDataPackage(object: any): any; + createDataPackageFromSelection(): any; + createFileFromStorageFile(storageFile: any): File; + createStreamFromInputStream(type: string, inputStream: any): MSStream; + execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; + execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; + getCurrentPriority(): string; + getHtmlPrintDocumentSourceAsync(htmlDoc: any): any; + getViewId(view: any): any; + isTaskScheduledAtPriorityOrHigher(priority: string): boolean; + pageHandlesAllApplicationActivations(enabled: boolean): void; + suppressSubdownloadCredentialPrompts(suppress: boolean): void; + terminateApp(exceptionObject: any): void; + CURRENT: string; + HIGH: string; + IDLE: string; + NORMAL: string; +} +declare var MSApp: MSApp; + +interface MSBlobBuilder { + append(data: any, endings?: string): void; + getBlob(contentType?: string): Blob; +} + +declare var MSBlobBuilder: { + prototype: MSBlobBuilder; + new(): MSBlobBuilder; +} + +interface MSStream { + type: string; + msClose(): void; + msDetachStream(): any; +} + +declare var MSStream: { + prototype: MSStream; + new(): MSStream; +} + +interface MSStreamReader extends EventTarget, MSBaseReader { + error: DOMError; + readAsArrayBuffer(stream: MSStream, size?: number): void; + readAsBinaryString(stream: MSStream, size?: number): void; + readAsBlob(stream: MSStream, size?: number): void; + readAsDataURL(stream: MSStream, size?: number): void; + readAsText(stream: MSStream, encoding?: string, size?: number): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSStreamReader: { + prototype: MSStreamReader; + new(): MSStreamReader; +} + +interface MessageChannel { + port1: MessagePort; + port2: MessagePort; +} + +declare var MessageChannel: { + prototype: MessageChannel; + new(): MessageChannel; +} + +interface MessageEvent extends Event { + data: any; + origin: string; + ports: any; + source: any; + initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: any): void; +} + +declare var MessageEvent: { + prototype: MessageEvent; + new(): MessageEvent; +} + interface MessagePort extends EventTarget { onmessage: (ev: MessageEvent) => any; close(): void; postMessage(message?: any, ports?: any): void; start(): void; addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var MessagePort: { prototype: MessagePort; new(): MessagePort; } -interface FileReader extends MSBaseReader { - error: DOMError; - readAsArrayBuffer(blob: Blob): void; - readAsDataURL(blob: Blob): void; - readAsText(blob: Blob, encoding?: string): void; +interface ProgressEvent extends Event { + lengthComputable: boolean; + loaded: number; + total: number; + initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; } -declare var FileReader: { - prototype: FileReader; - new(): FileReader; + +declare var ProgressEvent: { + prototype: ProgressEvent; + new(): ProgressEvent; +} + +interface WebSocket extends EventTarget { + binaryType: string; + bufferedAmount: number; + extensions: string; + onclose: (ev: CloseEvent) => any; + onerror: (ev: Event) => any; + onmessage: (ev: MessageEvent) => any; + onopen: (ev: Event) => any; + protocol: string; + readyState: number; + url: string; + close(code?: number, reason?: string): void; + send(data: any): void; + CLOSED: number; + CLOSING: number; + CONNECTING: number; + OPEN: number; + addEventListener(type: "close", listener: (ev: CloseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "open", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var WebSocket: { + prototype: WebSocket; + new(url: string, protocols?: string): WebSocket; + new(url: string, protocols?: any): WebSocket; + CLOSED: number; + CLOSING: number; + CONNECTING: number; + OPEN: number; +} + +interface Worker extends EventTarget, AbstractWorker { + onmessage: (ev: MessageEvent) => any; + postMessage(message: any, ports?: any): void; + terminate(): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Worker: { + prototype: Worker; + new(stringUrl: string): Worker; +} + +interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget { + msCaching: string; + onreadystatechange: (ev: ProgressEvent) => any; + readyState: number; + response: any; + responseBody: any; + responseText: string; + responseType: string; + responseXML: any; + status: number; + statusText: string; + timeout: number; + upload: XMLHttpRequestUpload; + withCredentials: boolean; + abort(): void; + getAllResponseHeaders(): string; + getResponseHeader(header: string): string; + msCachingEnabled(): boolean; + open(method: string, url: string, async?: boolean, user?: string, password?: string): void; + overrideMimeType(mime: string): void; + send(data?: string): void; + send(data?: any): void; + setRequestHeader(header: string, value: string): void; + DONE: number; + HEADERS_RECEIVED: number; + LOADING: number; + OPENED: number; + UNSENT: number; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeout", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var XMLHttpRequest: { + prototype: XMLHttpRequest; + new(): XMLHttpRequest; + DONE: number; + HEADERS_RECEIVED: number; + LOADING: number; + OPENED: number; + UNSENT: number; + create(): XMLHttpRequest; +} + +interface AbstractWorker { + onerror: (ev: Event) => any; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface MSBaseReader { + onabort: (ev: Event) => any; + onerror: (ev: Event) => any; + onload: (ev: Event) => any; + onloadend: (ev: ProgressEvent) => any; + onloadstart: (ev: Event) => any; + onprogress: (ev: ProgressEvent) => any; + readyState: number; + result: any; + abort(): void; + DONE: number; + EMPTY: number; + LOADING: number; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface NavigatorID { + appName: string; + appVersion: string; + platform: string; + product: string; + productSub: string; + userAgent: string; + vendor: string; + vendorSub: string; +} + +interface NavigatorOnLine { + onLine: boolean; +} + +interface WindowBase64 { + atob(encodedString: string): string; + btoa(rawString: string): string; +} + +interface WindowConsole { + console: Console; +} + +interface XMLHttpRequestEventTarget { + onabort: (ev: Event) => any; + onerror: (ev: Event) => any; + onload: (ev: Event) => any; + onloadend: (ev: ProgressEvent) => any; + onloadstart: (ev: Event) => any; + onprogress: (ev: ProgressEvent) => any; + ontimeout: (ev: ProgressEvent) => any; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeout", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface FileReaderSync { + readAsArrayBuffer(blob: Blob): any; + readAsBinaryString(blob: Blob): void; + readAsDataURL(blob: Blob): string; + readAsText(blob: Blob, encoding?: string): string; +} + +declare var FileReaderSync: { + prototype: FileReaderSync; + new(): FileReaderSync; +} + +interface WorkerGlobalScope extends EventTarget, WorkerUtils, DedicatedWorkerGlobalScope, WindowConsole { + location: WorkerLocation; + onerror: (ev: Event) => any; + self: WorkerGlobalScope; + close(): void; + msWriteProfilerMark(profilerMarkName: string): void; + toString(): string; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var WorkerGlobalScope: { + prototype: WorkerGlobalScope; + new(): WorkerGlobalScope; +} + +interface WorkerLocation { + hash: string; + host: string; + hostname: string; + href: string; + pathname: string; + port: string; + protocol: string; + search: string; + toString(): string; +} + +declare var WorkerLocation: { + prototype: WorkerLocation; + new(): WorkerLocation; +} + +interface WorkerNavigator extends Object, NavigatorID, NavigatorOnLine { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var WorkerNavigator: { + prototype: WorkerNavigator; + new(): WorkerNavigator; +} + +interface DedicatedWorkerGlobalScope { + onmessage: (ev: MessageEvent) => any; + postMessage(data: any): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface WorkerUtils extends Object, WindowBase64 { + indexedDB: IDBFactory; + msIndexedDB: IDBFactory; + navigator: WorkerNavigator; + clearImmediate(handle: number): void; + clearInterval(handle: number): void; + clearTimeout(handle: number): void; + importScripts(...urls: string[]): void; + setImmediate(handler: any, ...args: any[]): number; + setInterval(handler: any, timeout?: any, ...args: any[]): number; + setTimeout(handler: any, timeout?: any, ...args: any[]): number; +} + + +interface NodeListOf extends NodeList { + length: number; + item(index: number): TNode; + [index: number]: TNode; } interface BlobPropertyBag { @@ -1463,190 +3155,67 @@ interface BlobPropertyBag { endings?: string; } -interface Blob { - type: string; - size: number; - msDetachStream(): any; - slice(start?: number, end?: number, contentType?: string): Blob; - msClose(): void; -} -declare var Blob: { - prototype: Blob; - new (blobParts?: any[], options?: BlobPropertyBag): Blob; +interface EventListenerObject { + handleEvent(evt: Event): void; } -interface MSStream { - type: string; - msDetachStream(): any; - msClose(): void; -} -declare var MSStream: { - prototype: MSStream; - new(): MSStream; -} +declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; -interface MSBlobBuilder { - append(data: any, endings?: string): void; - getBlob(contentType?: string): Blob; +interface ErrorEventHandler { + (event: Event, source?: string, fileno?: number, columnNumber?: number): void; + (event: string, source?: string, fileno?: number, columnNumber?: number): void; } -declare var MSBlobBuilder: { - prototype: MSBlobBuilder; - new(): MSBlobBuilder; +interface PositionCallback { + (position: Position): void; } - -interface IDBFactory { - open(name: string, version?: number): IDBOpenDBRequest; - cmp(first: any, second: any): number; - deleteDatabase(name: string): IDBOpenDBRequest; +interface PositionErrorCallback { + (error: PositionError): void; } -declare var IDBFactory: { - prototype: IDBFactory; - new(): IDBFactory; +interface MediaQueryListListener { + (mql: MediaQueryList): void; } - -interface AbstractWorker extends EventTarget { - onerror: (ev: ErrorEvent) => any; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +interface MSLaunchUriCallback { + (): void; } - -interface MSApp { - createFileFromStorageFile(storageFile: any): File; - createBlobFromRandomAccessStream(type: string, seeker: any): Blob; - createStreamFromInputStream(type: string, inputStream: any): MSStream; - terminateApp(exceptionObject: any): void; - createDataPackage(object: any): any; - execUnsafeLocalFunction(unsafeFunction: MSUnsafeFunctionCallback): any; - getHtmlPrintDocumentSource(htmlDoc: any): any; - addPublicLocalApplicationUri(uri: string): void; - createDataPackageFromSelection(): any; - getViewOpener(): MSAppView; - suppressSubdownloadCredentialPrompts(suppress: boolean): void; - execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; - isTaskScheduledAtPriorityOrHigher(priority: string): boolean; - execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; - createNewView(uri: string): MSAppView; - getCurrentPriority(): string; - NORMAL: string; - HIGH: string; - IDLE: string; - CURRENT: string; +interface FrameRequestCallback { + (time: number): void; } -declare var MSApp: MSApp; - -interface Worker extends AbstractWorker { - onmessage: (ev: MessageEvent) => any; - postMessage(message: any, ports?: any): void; - terminate(): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +interface MutationCallback { + (mutations: MutationRecord[], observer: MutationObserver): void; } -declare var Worker: { - prototype: Worker; - new(stringUrl: string): Worker; +interface DecodeSuccessCallback { + (decodedData: AudioBuffer): void; } - -interface MSExecAtPriorityFunctionCallback { - (...args: any[]): any; +interface DecodeErrorCallback { + (): void; } - -interface MSAppView { - viewId: number; - close(): void; - postMessage(message: any, targetOrigin: string, ports?: any): void; +interface FunctionStringCallback { + (data: string): void; } -declare var MSAppView: { - prototype: MSAppView; - new(): MSAppView; -} - -interface WorkerLocation { - hash: string; - protocol: string; - search: string; - href: string; - hostname: string; - port: string; - pathname: string; - host: string; - toString(): string; -} -declare var WorkerLocation: { - prototype: WorkerLocation; - new(): WorkerLocation; -} - -interface FileReaderSync { - readAsArrayBuffer(blob: Blob): any; - readAsDataURL(blob: Blob): string; - readAsText(blob: Blob, encoding?: string): string; -} -declare var FileReaderSync: { - prototype: FileReaderSync; - new(): FileReaderSync; -} - -interface WorkerGlobalScope extends EventTarget, DedicatedWorkerGlobalScope, WindowConsole, WorkerUtils { - location: WorkerLocation; - self: WorkerGlobalScope; - onerror: (ev: ErrorEvent) => any; - msWriteProfilerMark(profilerMarkName: string): void; - close(): void; - toString(): string; -} -declare var WorkerGlobalScope: { - prototype: WorkerGlobalScope; - new(): WorkerGlobalScope; -} - -interface DedicatedWorkerGlobalScope { - onmessage: (ev: MessageEvent) => any; - postMessage(data: any): void; -} - -interface WorkerNavigator extends NavigatorID, NavigatorOnLine { -} -declare var WorkerNavigator: { - prototype: WorkerNavigator; - new(): WorkerNavigator; -} - -interface WorkerUtils extends WindowBase64 { - navigator: WorkerNavigator; - msIndexedDB: IDBFactory; - indexedDB: IDBFactory; - clearImmediate(handle: number): void; - importScripts(...urls: string[]): void; - clearTimeout(handle: number): void; - setImmediate(handler: any, ...args: any[]): number; - setTimeout(handler: any, timeout?: any, ...args: any[]): number; - clearInterval(handle: number): void; - setInterval(handler: any, timeout?: any, ...args: any[]): number; -} - - declare var location: WorkerLocation; +declare var onerror: (ev: Event) => any; declare var self: WorkerGlobalScope; -declare var onerror: (ev: ErrorEvent) => any; -declare function msWriteProfilerMark(profilerMarkName: string): void; declare function close(): void; +declare function msWriteProfilerMark(profilerMarkName: string): void; declare function toString(): string; -declare function removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -declare function addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; declare function dispatchEvent(evt: Event): boolean; +declare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +declare var indexedDB: IDBFactory; +declare var msIndexedDB: IDBFactory; +declare var navigator: WorkerNavigator; +declare function clearImmediate(handle: number): void; +declare function clearInterval(handle: number): void; +declare function clearTimeout(handle: number): void; +declare function importScripts(...urls: string[]): void; +declare function setImmediate(handler: any, ...args: any[]): number; +declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; +declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; +declare function atob(encodedString: string): string; +declare function btoa(rawString: string): string; declare var onmessage: (ev: MessageEvent) => any; declare function postMessage(data: any): void; declare var console: Console; -declare var navigator: WorkerNavigator; -declare var msIndexedDB: IDBFactory; -declare var indexedDB: IDBFactory; -declare function clearImmediate(handle: number): void; -declare function importScripts(...urls: string[]): void; -declare function clearTimeout(handle: number): void; -declare function setImmediate(handler: any, ...args: any[]): number; -declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; -declare function clearInterval(handle: number): void; -declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; -declare function btoa(rawString: string): string; -declare function atob(encodedString: string): string; +declare function addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; \ No newline at end of file diff --git a/bin/tsc.js b/bin/tsc.js index 79785150cce..230e4864c84 100644 --- a/bin/tsc.js +++ b/bin/tsc.js @@ -420,6 +420,9 @@ var ts; return 3; return 2; } + var idx = path.indexOf('://'); + if (idx !== -1) + return idx + 3; return 0; } ts.getRootLength = getRootLength; @@ -597,10 +600,6 @@ var ts; "\u2029": "\\u2029", "\u0085": "\\u0085" }; - function getDefaultLibFileName(options) { - return options.target === 2 ? "lib.es6.d.ts" : "lib.d.ts"; - } - ts.getDefaultLibFileName = getDefaultLibFileName; function Symbol(flags, name) { this.flags = flags; this.name = name; @@ -1063,7 +1062,6 @@ var ts; 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." }, @@ -1072,6 +1070,14 @@ var ts; 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." }, + Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: ts.DiagnosticCategory.Error, key: "Invalid use of '{0}'. Class definitions are automatically in strict mode." }, + A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A class declaration without the 'default' modifier must have a name" }, + Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode" }, + Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1213, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, + Identifier_expected_0_is_a_reserved_word_in_strict_mode_External_Module_is_automatically_in_strict_mode: { code: 1214, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. External Module is automatically in strict mode." }, + Type_expected_0_is_a_reserved_word_in_strict_mode: { code: 1215, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode" }, + Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1216, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, + Type_expected_0_is_a_reserved_word_in_strict_mode_Module_is_automatically_in_strict_mode: { code: 1217, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Module is automatically in strict mode." }, 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." }, @@ -1247,19 +1253,20 @@ var ts; 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." }, + Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: ts.DiagnosticCategory.Error, key: "Type must have a '[Symbol.iterator]()' method that returns an iterator." }, + An_iterator_must_have_a_next_method: { code: 2489, category: ts.DiagnosticCategory.Error, key: "An iterator 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." }, + The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression: { code: 2496, category: ts.DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression." }, External_module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct: { code: 2497, category: ts.DiagnosticCategory.Error, key: "External module '{0}' resolves to a non-module entity and cannot be imported using this construct." }, External_module_0_uses_export_and_cannot_be_used_with_export_Asterisk: { code: 2498, category: ts.DiagnosticCategory.Error, key: "External module '{0}' uses 'export =' and cannot be used with 'export *'." }, An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments: { code: 2499, category: ts.DiagnosticCategory.Error, key: "An interface can only extend an identifier/qualified-name with optional type arguments." }, A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments: { code: 2500, category: ts.DiagnosticCategory.Error, key: "A class can only implement an identifier/qualified-name with optional type arguments." }, + A_rest_element_cannot_contain_a_binding_pattern: { code: 2501, category: ts.DiagnosticCategory.Error, key: "A rest element cannot contain a binding pattern." }, 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}'." }, @@ -1410,6 +1417,22 @@ var 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: 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." }, + import_can_only_be_used_in_a_ts_file: { code: 8002, category: ts.DiagnosticCategory.Error, key: "'import ... =' can only be used in a .ts file." }, + export_can_only_be_used_in_a_ts_file: { code: 8003, category: ts.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: ts.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: ts.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: ts.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: ts.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: ts.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: ts.DiagnosticCategory.Error, key: "'{0}' can only be used in a .ts file." }, + types_can_only_be_used_in_a_ts_file: { code: 8010, category: ts.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: ts.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: ts.DiagnosticCategory.Error, key: "'parameter modifiers' can only be used in a .ts file." }, + can_only_be_used_in_a_ts_file: { code: 8013, category: ts.DiagnosticCategory.Error, key: "'?' can only be used in a .ts file." }, + property_declarations_can_only_be_used_in_a_ts_file: { code: 8014, category: ts.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: ts.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: ts.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: ts.DiagnosticCategory.Error, key: "'decorators' can only be used in a .ts file." }, 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." }, @@ -1423,7 +1446,7 @@ var ts; (function (ts) { var textToToken = { "any": 112, - "as": 102, + "as": 111, "boolean": 113, "break": 66, "case": 67, @@ -1448,24 +1471,24 @@ var ts; "function": 83, "get": 116, "if": 84, - "implements": 103, + "implements": 102, "import": 85, "in": 86, "instanceof": 87, - "interface": 104, - "let": 105, + "interface": 103, + "let": 104, "module": 117, "new": 88, "null": 89, "number": 119, - "package": 106, - "private": 107, - "protected": 108, - "public": 109, + "package": 105, + "private": 106, + "protected": 107, + "public": 108, "require": 118, "return": 90, "set": 120, - "static": 110, + "static": 109, "string": 121, "super": 91, "switch": 92, @@ -1480,7 +1503,7 @@ var ts; "void": 99, "while": 100, "with": 101, - "yield": 111, + "yield": 110, "of": 125, "{": 14, "}": 15, @@ -1816,6 +1839,7 @@ var ts; var nextChar = text.charCodeAt(pos + 1); var hasTrailingNewLine = false; if (nextChar === 47 || nextChar === 42) { + var kind = nextChar === 47 ? 2 : 3; var startPos = pos; pos += 2; if (nextChar === 47) { @@ -1840,7 +1864,7 @@ var ts; if (!result) { result = []; } - result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine }); + result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine, kind: kind }); } continue; } @@ -1878,9 +1902,9 @@ var ts; ch > 127 && isUnicodeIdentifierPart(ch, languageVersion); } ts.isIdentifierPart = isIdentifierPart; - function createScanner(languageVersion, skipTrivia, text, onError) { + function createScanner(languageVersion, skipTrivia, text, onError, start, length) { var pos; - var len; + var end; var startPos; var tokenPos; var token; @@ -1888,6 +1912,30 @@ var ts; var precedingLineBreak; var hasExtendedUnicodeEscape; var tokenIsUnterminated; + setText(text, start, length); + 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 === 65 || token > 101; }, + isReservedWord: function () { return token >= 66 && token <= 101; }, + isUnterminated: function () { return tokenIsUnterminated; }, + reScanGreaterToken: reScanGreaterToken, + reScanSlashToken: reScanSlashToken, + reScanTemplateToken: reScanTemplateToken, + scan: scan, + setText: setText, + setScriptTarget: setScriptTarget, + setOnError: setOnError, + setTextPos: setTextPos, + tryScan: tryScan, + lookAhead: lookAhead + }; function error(message, length) { if (onError) { onError(message, length || 0); @@ -1972,7 +2020,7 @@ var ts; var result = ""; var start = pos; while (true) { - if (pos >= len) { + if (pos >= end) { result += text.substring(start, pos); tokenIsUnterminated = true; error(ts.Diagnostics.Unterminated_string_literal); @@ -2007,7 +2055,7 @@ var ts; var contents = ""; var resultingToken; while (true) { - if (pos >= len) { + if (pos >= end) { contents += text.substring(start, pos); tokenIsUnterminated = true; error(ts.Diagnostics.Unterminated_template_literal); @@ -2021,7 +2069,7 @@ var ts; resultingToken = startedWithBacktick ? 10 : 13; break; } - if (currChar === 36 && pos + 1 < len && text.charCodeAt(pos + 1) === 123) { + if (currChar === 36 && pos + 1 < end && text.charCodeAt(pos + 1) === 123) { contents += text.substring(start, pos); pos += 2; resultingToken = startedWithBacktick ? 11 : 12; @@ -2036,7 +2084,7 @@ var ts; if (currChar === 13) { contents += text.substring(start, pos); pos++; - if (pos < len && text.charCodeAt(pos) === 10) { + if (pos < end && text.charCodeAt(pos) === 10) { pos++; } contents += "\n"; @@ -2051,7 +2099,7 @@ var ts; } function scanEscapeSequence() { pos++; - if (pos >= len) { + if (pos >= end) { error(ts.Diagnostics.Unexpected_end_of_text); return ""; } @@ -2076,7 +2124,7 @@ var ts; case 34: return "\""; case 117: - if (pos < len && text.charCodeAt(pos) === 123) { + if (pos < end && text.charCodeAt(pos) === 123) { hasExtendedUnicodeEscape = true; pos++; return scanExtendedUnicodeEscape(); @@ -2085,7 +2133,7 @@ var ts; case 120: return scanHexadecimalEscape(2); case 13: - if (pos < len && text.charCodeAt(pos) === 10) { + if (pos < end && text.charCodeAt(pos) === 10) { pos++; } case 10: @@ -2117,7 +2165,7 @@ var ts; error(ts.Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive); isInvalidExtendedEscape = true; } - if (pos >= len) { + if (pos >= end) { error(ts.Diagnostics.Unexpected_end_of_text); isInvalidExtendedEscape = true; } @@ -2143,11 +2191,11 @@ var ts; return String.fromCharCode(codeUnit1, codeUnit2); } function peekUnicodeEscape() { - if (pos + 5 < len && text.charCodeAt(pos + 1) === 117) { - var start = pos; + if (pos + 5 < end && text.charCodeAt(pos + 1) === 117) { + var start_1 = pos; pos += 2; var value = scanExactNumberOfHexDigits(4); - pos = start; + pos = start_1; return value; } return -1; @@ -2155,7 +2203,7 @@ var ts; function scanIdentifierParts() { var result = ""; var start = pos; - while (pos < len) { + while (pos < end) { var ch = text.charCodeAt(pos); if (isIdentifierPart(ch)) { pos++; @@ -2213,7 +2261,7 @@ var ts; tokenIsUnterminated = false; while (true) { tokenPos = pos; - if (pos >= len) { + if (pos >= end) { return token = 1; } var ch = text.charCodeAt(pos); @@ -2226,7 +2274,7 @@ var ts; continue; } else { - if (ch === 13 && pos + 1 < len && text.charCodeAt(pos + 1) === 10) { + if (ch === 13 && pos + 1 < end && text.charCodeAt(pos + 1) === 10) { pos += 2; } else { @@ -2243,7 +2291,7 @@ var ts; continue; } else { - while (pos < len && isWhiteSpace(text.charCodeAt(pos))) { + while (pos < end && isWhiteSpace(text.charCodeAt(pos))) { pos++; } return token = 5; @@ -2314,7 +2362,7 @@ var ts; case 47: if (text.charCodeAt(pos + 1) === 47) { pos += 2; - while (pos < len) { + while (pos < end) { if (isLineBreak(text.charCodeAt(pos))) { break; } @@ -2330,7 +2378,7 @@ var ts; if (text.charCodeAt(pos + 1) === 42) { pos += 2; var commentClosed = false; - while (pos < len) { + while (pos < end) { var ch_2 = text.charCodeAt(pos); if (ch_2 === 42 && text.charCodeAt(pos + 1) === 47) { pos += 2; @@ -2358,7 +2406,7 @@ var ts; } return pos++, token = 36; case 48: - if (pos + 2 < len && (text.charCodeAt(pos + 1) === 88 || text.charCodeAt(pos + 1) === 120)) { + if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 || text.charCodeAt(pos + 1) === 120)) { pos += 2; var value = scanMinimumNumberOfHexDigits(1); if (value < 0) { @@ -2368,7 +2416,7 @@ var ts; tokenValue = "" + value; return token = 7; } - else if (pos + 2 < len && (text.charCodeAt(pos + 1) === 66 || text.charCodeAt(pos + 1) === 98)) { + else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 66 || text.charCodeAt(pos + 1) === 98)) { pos += 2; var value = scanBinaryOrOctalDigits(2); if (value < 0) { @@ -2378,7 +2426,7 @@ var ts; tokenValue = "" + value; return token = 7; } - else if (pos + 2 < len && (text.charCodeAt(pos + 1) === 79 || text.charCodeAt(pos + 1) === 111)) { + else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 79 || text.charCodeAt(pos + 1) === 111)) { pos += 2; var value = scanBinaryOrOctalDigits(8); if (value < 0) { @@ -2388,7 +2436,7 @@ var ts; tokenValue = "" + value; return token = 7; } - if (pos + 1 < len && isOctalDigit(text.charCodeAt(pos + 1))) { + if (pos + 1 < end && isOctalDigit(text.charCodeAt(pos + 1))) { tokenValue = "" + scanOctalDigits(); return token = 7; } @@ -2497,7 +2545,7 @@ var ts; default: if (isIdentifierStart(ch)) { pos++; - while (pos < len && isIdentifierPart(ch = text.charCodeAt(pos))) + while (pos < end && isIdentifierPart(ch = text.charCodeAt(pos))) pos++; tokenValue = text.substring(tokenPos, pos); if (ch === 92) { @@ -2545,7 +2593,7 @@ var ts; var inEscape = false; var inCharacterClass = false; while (true) { - if (p >= len) { + if (p >= end) { tokenIsUnterminated = true; error(ts.Diagnostics.Unterminated_regular_expression_literal); break; @@ -2574,7 +2622,7 @@ var ts; } p++; } - while (p < len && isIdentifierPart(text.charCodeAt(p))) { + while (p < end && isIdentifierPart(text.charCodeAt(p))) { p++; } pos = p; @@ -2612,40 +2660,28 @@ var ts; function tryScan(callback) { return speculationHelper(callback, false); } - function setText(newText) { + function setText(newText, start, length) { text = newText || ""; - len = text.length; - setTextPos(0); + end = length === undefined ? text.length : start + length; + setTextPos(start || 0); + } + function setOnError(errorCallback) { + onError = errorCallback; + } + function setScriptTarget(scriptTarget) { + languageVersion = scriptTarget; } function setTextPos(textPos) { + ts.Debug.assert(textPos >= 0); pos = textPos; startPos = textPos; tokenPos = textPos; token = 0; precedingLineBreak = false; + tokenValue = undefined; + hasExtendedUnicodeEscape = false; + tokenIsUnterminated = false; } - 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 === 65 || token > 101; }, - isReservedWord: function () { return token >= 66 && token <= 101; }, - isUnterminated: function () { return tokenIsUnterminated; }, - reScanGreaterToken: reScanGreaterToken, - reScanSlashToken: reScanSlashToken, - reScanTemplateToken: reScanTemplateToken, - scan: scan, - setText: setText, - setTextPos: setTextPos, - tryScan: tryScan, - lookAhead: lookAhead - }; } ts.createScanner = createScanner; })(ts || (ts = {})); @@ -2965,23 +3001,26 @@ var ts; function bindCatchVariableDeclaration(node) { bindChildren(node, 0, true); } - function bindBlockScopedVariableDeclaration(node) { + function bindBlockScopedDeclaration(node, symbolKind, symbolExcludes) { switch (blockScopeContainer.kind) { case 205: - declareModuleMember(node, 2, 107455); + declareModuleMember(node, symbolKind, symbolExcludes); break; case 227: if (ts.isExternalModule(container)) { - declareModuleMember(node, 2, 107455); + declareModuleMember(node, symbolKind, symbolExcludes); break; } default: if (!blockScopeContainer.locals) { blockScopeContainer.locals = {}; } - declareSymbol(blockScopeContainer.locals, undefined, node, 2, 107455); + declareSymbol(blockScopeContainer.locals, undefined, node, symbolKind, symbolExcludes); } - bindChildren(node, 2, false); + bindChildren(node, symbolKind, false); + } + function bindBlockScopedVariableDeclaration(node) { + bindBlockScopedDeclaration(node, 2, 107455); } function getDestructuringParameterName(node) { return "__" + ts.indexOf(node.parent.parameters, node); @@ -3060,7 +3099,7 @@ var ts; bindCatchVariableDeclaration(node); break; case 201: - bindDeclaration(node, 32, 899583, false); + bindBlockScopedDeclaration(node, 32, 899583); break; case 202: bindDeclaration(node, 64, 792992, false); @@ -3100,7 +3139,7 @@ var ts; bindChildren(node, 0, false); break; case 214: - if (node.expression && node.expression.kind === 65) { + if (node.expression.kind === 65) { declareSymbol(container.symbol.exports, container.symbol, node, 8388608, 107455 | 8388608); } else { @@ -3257,6 +3296,13 @@ var ts; return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); } ts.getTokenPosOfNode = getTokenPosOfNode; + function getNonDecoratorTokenPosOfNode(node, sourceFile) { + if (nodeIsMissing(node) || !node.decorators) { + return getTokenPosOfNode(node, sourceFile); + } + return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.decorators.end); + } + ts.getNonDecoratorTokenPosOfNode = getNonDecoratorTokenPosOfNode; function getSourceTextOfNodeFromSourceFile(sourceFile, node) { if (nodeIsMissing(node)) { return ""; @@ -3294,7 +3340,7 @@ var ts; } ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function getEnclosingBlockScopeContainer(node) { - var current = node; + var current = node.parent; while (current) { if (isFunctionLike(current)) { return current; @@ -3348,11 +3394,10 @@ var ts; } ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain; function getSpanOfTokenAtPosition(sourceFile, pos) { - var scanner = ts.createScanner(sourceFile.languageVersion, true, sourceFile.text); - scanner.setTextPos(pos); + var scanner = ts.createScanner(sourceFile.languageVersion, true, sourceFile.text, undefined, pos); scanner.scan(); var start = scanner.getTokenPos(); - return createTextSpanFromBounds(start, scanner.getTextPos()); + return ts.createTextSpanFromBounds(start, scanner.getTextPos()); } ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForNode(sourceFile, node) { @@ -3361,7 +3406,7 @@ var ts; case 227: var pos_1 = ts.skipTrivia(sourceFile.text, 0, false); if (pos_1 === sourceFile.text.length) { - return createTextSpan(0, 0); + return ts.createTextSpan(0, 0); } return getSpanOfTokenAtPosition(sourceFile, pos_1); case 198: @@ -3383,7 +3428,7 @@ var ts; var pos = nodeIsMissing(errorNode) ? errorNode.pos : ts.skipTrivia(sourceFile.text, errorNode.pos); - return createTextSpanFromBounds(pos, errorNode.end); + return ts.createTextSpanFromBounds(pos, errorNode.end); } ts.getErrorSpanForNode = getErrorSpanForNode; function isExternalModule(file) { @@ -3494,6 +3539,17 @@ var ts; return false; } ts.isVariableLike = isVariableLike; + function isAccessor(node) { + if (node) { + switch (node.kind) { + case 136: + case 137: + return true; + } + } + return false; + } + ts.isAccessor = isAccessor; function isFunctionLike(node) { if (node) { switch (node.kind) { @@ -3549,6 +3605,14 @@ var ts; } node = node.parent; break; + case 130: + if (node.parent.kind === 129 && isClassElement(node.parent.parent)) { + node = node.parent.parent; + } + else if (isClassElement(node.parent)) { + node = node.parent; + } + break; case 163: if (!includeArrowFunctions) { continue; @@ -3582,6 +3646,14 @@ var ts; } node = node.parent; break; + case 130: + if (node.parent.kind === 129 && isClassElement(node.parent.parent)) { + node = node.parent.parent; + } + else if (isClassElement(node.parent)) { + node = node.parent; + } + break; case 200: case 162: case 163: @@ -3746,6 +3818,8 @@ var ts; return node === parent_1.expression; case 127: return node === parent_1.expression; + case 130: + return true; default: if (isExpression(parent_1)) { return true; @@ -3909,6 +3983,7 @@ var ts; case 134: case 136: case 137: + case 133: case 140: return true; default: @@ -3947,7 +4022,7 @@ var ts; } ts.getClassExtendsHeritageClauseElement = getClassExtendsHeritageClauseElement; function getClassImplementsHeritageClauseElements(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 103); + var heritageClause = getHeritageClause(node.heritageClauses, 102); return heritageClause ? heritageClause.types : undefined; } ts.getClassImplementsHeritageClauseElements = getClassImplementsHeritageClauseElements; @@ -4062,10 +4137,10 @@ var ts; ts.isESSymbolIdentifier = isESSymbolIdentifier; function isModifier(token) { switch (token) { - case 109: - case 107: case 108: - case 110: + case 106: + case 107: + case 109: case 78: case 115: case 70: @@ -4075,115 +4150,6 @@ var ts; return false; } ts.isModifier = isModifier; - function textSpanEnd(span) { - return span.start + span.length; - } - ts.textSpanEnd = textSpanEnd; - function textSpanIsEmpty(span) { - return span.length === 0; - } - ts.textSpanIsEmpty = textSpanIsEmpty; - function textSpanContainsPosition(span, position) { - return position >= span.start && position < textSpanEnd(span); - } - ts.textSpanContainsPosition = textSpanContainsPosition; - function textSpanContainsTextSpan(span, other) { - return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span); - } - ts.textSpanContainsTextSpan = textSpanContainsTextSpan; - function textSpanOverlapsWith(span, other) { - var overlapStart = Math.max(span.start, other.start); - var overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other)); - return overlapStart < overlapEnd; - } - ts.textSpanOverlapsWith = textSpanOverlapsWith; - function textSpanOverlap(span1, span2) { - var overlapStart = Math.max(span1.start, span2.start); - var overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); - if (overlapStart < overlapEnd) { - return createTextSpanFromBounds(overlapStart, overlapEnd); - } - return undefined; - } - ts.textSpanOverlap = textSpanOverlap; - function textSpanIntersectsWithTextSpan(span, other) { - return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start; - } - ts.textSpanIntersectsWithTextSpan = textSpanIntersectsWithTextSpan; - function textSpanIntersectsWith(span, start, length) { - var end = start + length; - return start <= textSpanEnd(span) && end >= span.start; - } - ts.textSpanIntersectsWith = textSpanIntersectsWith; - function textSpanIntersectsWithPosition(span, position) { - return position <= textSpanEnd(span) && position >= span.start; - } - ts.textSpanIntersectsWithPosition = textSpanIntersectsWithPosition; - function textSpanIntersection(span1, span2) { - var intersectStart = Math.max(span1.start, span2.start); - var intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); - if (intersectStart <= intersectEnd) { - return createTextSpanFromBounds(intersectStart, intersectEnd); - } - return undefined; - } - ts.textSpanIntersection = textSpanIntersection; - function createTextSpan(start, length) { - if (start < 0) { - throw new Error("start < 0"); - } - if (length < 0) { - throw new Error("length < 0"); - } - return { start: start, length: length }; - } - ts.createTextSpan = createTextSpan; - function createTextSpanFromBounds(start, end) { - return createTextSpan(start, end - start); - } - ts.createTextSpanFromBounds = createTextSpanFromBounds; - function textChangeRangeNewSpan(range) { - return createTextSpan(range.span.start, range.newLength); - } - ts.textChangeRangeNewSpan = textChangeRangeNewSpan; - function textChangeRangeIsUnchanged(range) { - return textSpanIsEmpty(range.span) && range.newLength === 0; - } - ts.textChangeRangeIsUnchanged = textChangeRangeIsUnchanged; - function createTextChangeRange(span, newLength) { - if (newLength < 0) { - throw new Error("newLength < 0"); - } - return { span: span, newLength: newLength }; - } - ts.createTextChangeRange = createTextChangeRange; - ts.unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0); - function collapseTextChangeRangesAcrossMultipleVersions(changes) { - if (changes.length === 0) { - return ts.unchangedTextChangeRange; - } - if (changes.length === 1) { - return changes[0]; - } - var change0 = changes[0]; - var oldStartN = change0.span.start; - var oldEndN = textSpanEnd(change0.span); - var newEndN = oldStartN + change0.newLength; - for (var i = 1; i < changes.length; i++) { - var nextChange = changes[i]; - var oldStart1 = oldStartN; - var oldEnd1 = oldEndN; - var newEnd1 = newEndN; - var oldStart2 = nextChange.span.start; - var oldEnd2 = textSpanEnd(nextChange.span); - var newEnd2 = oldStart2 + nextChange.newLength; - oldStartN = Math.min(oldStart1, oldStart2); - oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)); - newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)); - } - return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), newEndN - oldStartN); - } - ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function nodeStartsNewLexicalEnvironment(n) { return isFunctionLike(n) || n.kind === 205 || n.kind === 227; } @@ -4200,6 +4166,13 @@ var ts; return node; } ts.createSynthesizedNode = createSynthesizedNode; + function createSynthesizedNodeArray() { + var array = []; + array.pos = -1; + array.end = -1; + return array; + } + ts.createSynthesizedNodeArray = createSynthesizedNodeArray; function createDiagnosticCollection() { var nonFileDiagnostics = []; var fileDiagnostics = {}; @@ -4555,6 +4528,54 @@ var ts; } } ts.writeCommentRange = writeCommentRange; + function modifierToFlag(token) { + switch (token) { + case 109: return 128; + case 108: return 16; + case 107: return 64; + case 106: return 32; + case 78: return 1; + case 115: return 2; + case 70: return 8192; + case 73: return 256; + } + return 0; + } + ts.modifierToFlag = modifierToFlag; + function isLeftHandSideExpression(expr) { + if (expr) { + switch (expr.kind) { + case 155: + case 156: + case 158: + case 157: + case 159: + case 153: + case 161: + case 154: + case 174: + case 162: + case 65: + case 9: + case 7: + case 8: + case 10: + case 171: + case 80: + case 89: + case 93: + case 95: + case 91: + return true; + } + } + return false; + } + ts.isLeftHandSideExpression = isLeftHandSideExpression; + function isAssignmentOperator(token) { + return token >= 53 && token <= 64; + } + ts.isAssignmentOperator = isAssignmentOperator; function isSupportedHeritageClauseElement(node) { return isSupportedHeritageClauseElementExpression(node.expression); } @@ -4580,6 +4601,122 @@ var ts; } ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; })(ts || (ts = {})); +var ts; +(function (ts) { + function getDefaultLibFileName(options) { + return options.target === 2 ? "lib.es6.d.ts" : "lib.d.ts"; + } + ts.getDefaultLibFileName = getDefaultLibFileName; + function textSpanEnd(span) { + return span.start + span.length; + } + ts.textSpanEnd = textSpanEnd; + function textSpanIsEmpty(span) { + return span.length === 0; + } + ts.textSpanIsEmpty = textSpanIsEmpty; + function textSpanContainsPosition(span, position) { + return position >= span.start && position < textSpanEnd(span); + } + ts.textSpanContainsPosition = textSpanContainsPosition; + function textSpanContainsTextSpan(span, other) { + return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span); + } + ts.textSpanContainsTextSpan = textSpanContainsTextSpan; + function textSpanOverlapsWith(span, other) { + var overlapStart = Math.max(span.start, other.start); + var overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other)); + return overlapStart < overlapEnd; + } + ts.textSpanOverlapsWith = textSpanOverlapsWith; + function textSpanOverlap(span1, span2) { + var overlapStart = Math.max(span1.start, span2.start); + var overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); + if (overlapStart < overlapEnd) { + return createTextSpanFromBounds(overlapStart, overlapEnd); + } + return undefined; + } + ts.textSpanOverlap = textSpanOverlap; + function textSpanIntersectsWithTextSpan(span, other) { + return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start; + } + ts.textSpanIntersectsWithTextSpan = textSpanIntersectsWithTextSpan; + function textSpanIntersectsWith(span, start, length) { + var end = start + length; + return start <= textSpanEnd(span) && end >= span.start; + } + ts.textSpanIntersectsWith = textSpanIntersectsWith; + function textSpanIntersectsWithPosition(span, position) { + return position <= textSpanEnd(span) && position >= span.start; + } + ts.textSpanIntersectsWithPosition = textSpanIntersectsWithPosition; + function textSpanIntersection(span1, span2) { + var intersectStart = Math.max(span1.start, span2.start); + var intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); + if (intersectStart <= intersectEnd) { + return createTextSpanFromBounds(intersectStart, intersectEnd); + } + return undefined; + } + ts.textSpanIntersection = textSpanIntersection; + function createTextSpan(start, length) { + if (start < 0) { + throw new Error("start < 0"); + } + if (length < 0) { + throw new Error("length < 0"); + } + return { start: start, length: length }; + } + ts.createTextSpan = createTextSpan; + function createTextSpanFromBounds(start, end) { + return createTextSpan(start, end - start); + } + ts.createTextSpanFromBounds = createTextSpanFromBounds; + function textChangeRangeNewSpan(range) { + return createTextSpan(range.span.start, range.newLength); + } + ts.textChangeRangeNewSpan = textChangeRangeNewSpan; + function textChangeRangeIsUnchanged(range) { + return textSpanIsEmpty(range.span) && range.newLength === 0; + } + ts.textChangeRangeIsUnchanged = textChangeRangeIsUnchanged; + function createTextChangeRange(span, newLength) { + if (newLength < 0) { + throw new Error("newLength < 0"); + } + return { span: span, newLength: newLength }; + } + ts.createTextChangeRange = createTextChangeRange; + ts.unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0); + function collapseTextChangeRangesAcrossMultipleVersions(changes) { + if (changes.length === 0) { + return ts.unchangedTextChangeRange; + } + if (changes.length === 1) { + return changes[0]; + } + var change0 = changes[0]; + var oldStartN = change0.span.start; + var oldEndN = textSpanEnd(change0.span); + var newEndN = oldStartN + change0.newLength; + for (var i = 1; i < changes.length; i++) { + var nextChange = changes[i]; + var oldStart1 = oldStartN; + var oldEnd1 = oldEndN; + var newEnd1 = newEndN; + var oldStart2 = nextChange.span.start; + var oldEnd2 = textSpanEnd(nextChange.span); + var newEnd2 = oldStart2 + nextChange.newLength; + oldStartN = Math.min(oldStart1, oldStart2); + oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)); + newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)); + } + return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), newEndN - oldStartN); + } + ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; +})(ts || (ts = {})); /// /// var ts; @@ -4871,8 +5008,7 @@ var ts; case 214: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.type); + visitNode(cbNode, node.expression); case 171: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); case 176: @@ -4891,388 +5027,97 @@ var ts; } } 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.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 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) { - // 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; - forEachChild(n, visitNode); - parent = saveParent; - } - } - } - function shouldCheckNode(node) { - switch (node.kind) { - case 8: - case 7: - case 65: - return true; - } - return false; - } - function moveElementEntirelyPastChangeRange(element, isArray, delta, oldText, newText, aggressiveChecks) { - if (isArray) { - visitArray(element); - } - else { - visitNode(element); - } - return; - function visitNode(node) { - if (aggressiveChecks && shouldCheckNode(node)) { - var text = oldText.substring(node.pos, node.end); - } - node._children = undefined; - node.pos += delta; - node.end += delta; - if (aggressiveChecks && shouldCheckNode(node)) { - ts.Debug.assert(text === newText.substring(node.pos, node.end)); - } - forEachChild(node, visitNode, visitArray); - checkNodePositions(node, aggressiveChecks); - } - function visitArray(array) { - array._children = undefined; - array.pos += delta; - array.end += delta; - for (var _i = 0; _i < array.length; _i++) { - var node = array[_i]; - visitNode(node); - } - } - } - function adjustIntersectingElement(element, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta) { - ts.Debug.assert(element.end >= changeStart, "Adjusting an element that was entirely before the change range"); - ts.Debug.assert(element.pos <= changeRangeOldEnd, "Adjusting an element that was entirely after the change range"); - ts.Debug.assert(element.pos <= element.end); - element.pos = Math.min(element.pos, changeRangeNewEnd); - if (element.end >= changeRangeOldEnd) { - element.end += delta; - } - else { - element.end = Math.min(element.end, changeRangeNewEnd); - } - ts.Debug.assert(element.pos <= element.end); - if (element.parent) { - ts.Debug.assert(element.pos >= element.parent.pos); - ts.Debug.assert(element.end <= element.parent.end); - } - } - function checkNodePositions(node, aggressiveChecks) { - if (aggressiveChecks) { - var pos = node.pos; - forEachChild(node, function (child) { - ts.Debug.assert(child.pos >= pos); - pos = child.end; - }); - ts.Debug.assert(pos <= node.end); - } - } - function updateTokenPositionsAndMarkElements(sourceFile, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta, oldText, newText, aggressiveChecks) { - visitNode(sourceFile); - return; - function visitNode(child) { - ts.Debug.assert(child.pos <= child.end); - if (child.pos > changeRangeOldEnd) { - moveElementEntirelyPastChangeRange(child, false, delta, oldText, newText, aggressiveChecks); - return; - } - var fullEnd = child.end; - if (fullEnd >= changeStart) { - child.intersectsChange = true; - child._children = undefined; - adjustIntersectingElement(child, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - forEachChild(child, visitNode, visitArray); - checkNodePositions(child, aggressiveChecks); - return; - } - ts.Debug.assert(fullEnd < changeStart); - } - function visitArray(array) { - ts.Debug.assert(array.pos <= array.end); - if (array.pos > changeRangeOldEnd) { - moveElementEntirelyPastChangeRange(array, true, delta, oldText, newText, aggressiveChecks); - return; - } - var fullEnd = array.end; - if (fullEnd >= changeStart) { - array.intersectsChange = true; - array._children = undefined; - adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - for (var _i = 0; _i < array.length; _i++) { - var node = array[_i]; - visitNode(node); - } - return; - } - ts.Debug.assert(fullEnd < changeStart); - } - } - function extendToAffectedRange(sourceFile, changeRange) { - var maxLookahead = 1; - var start = changeRange.span.start; - for (var i = 0; start > 0 && i <= maxLookahead; i++) { - var nearestNode = findNearestNodeStartingBeforeOrAtPosition(sourceFile, start); - ts.Debug.assert(nearestNode.pos <= start); - var position = nearestNode.pos; - start = Math.max(0, position - 1); - } - var finalSpan = ts.createTextSpanFromBounds(start, ts.textSpanEnd(changeRange.span)); - var finalLength = changeRange.newLength + (changeRange.span.start - start); - return ts.createTextChangeRange(finalSpan, finalLength); - } - function findNearestNodeStartingBeforeOrAtPosition(sourceFile, position) { - var bestResult = sourceFile; - var lastNodeEntirelyBeforePosition; - forEachChild(sourceFile, visit); - if (lastNodeEntirelyBeforePosition) { - var lastChildOfLastEntireNodeBeforePosition = getLastChild(lastNodeEntirelyBeforePosition); - if (lastChildOfLastEntireNodeBeforePosition.pos > bestResult.pos) { - bestResult = lastChildOfLastEntireNodeBeforePosition; - } - } - return bestResult; - function getLastChild(node) { - while (true) { - var lastChild = getLastChildWorker(node); - if (lastChild) { - node = lastChild; - } - else { - return node; - } - } - } - function getLastChildWorker(node) { - var last = undefined; - forEachChild(node, function (child) { - if (ts.nodeIsPresent(child)) { - last = child; - } - }); - return last; - } - function visit(child) { - if (ts.nodeIsMissing(child)) { - return; - } - if (child.pos <= position) { - if (child.pos >= bestResult.pos) { - bestResult = child; - } - if (position < child.end) { - forEachChild(child, visit); - return true; - } - else { - ts.Debug.assert(child.end <= position); - lastNodeEntirelyBeforePosition = child; - } - } - else { - ts.Debug.assert(child.pos > position); - return true; - } - } - } - function checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks) { - var oldText = sourceFile.text; - if (textChangeRange) { - ts.Debug.assert((oldText.length - textChangeRange.span.length + textChangeRange.newLength) === newText.length); - if (aggressiveChecks || ts.Debug.shouldAssert(3)) { - var oldTextPrefix = oldText.substr(0, textChangeRange.span.start); - var newTextPrefix = newText.substr(0, textChangeRange.span.start); - ts.Debug.assert(oldTextPrefix === newTextPrefix); - var oldTextSuffix = oldText.substring(ts.textSpanEnd(textChangeRange.span), oldText.length); - var newTextSuffix = newText.substring(ts.textSpanEnd(ts.textChangeRangeNewSpan(textChangeRange)), newText.length); - ts.Debug.assert(oldTextSuffix === newTextSuffix); - } - } - } - function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks) { - aggressiveChecks = aggressiveChecks || ts.Debug.shouldAssert(2); - checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks); - if (ts.textChangeRangeIsUnchanged(textChangeRange)) { - return sourceFile; - } - if (sourceFile.statements.length === 0) { - return parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, undefined, true); - } - var incrementalSourceFile = sourceFile; - ts.Debug.assert(!incrementalSourceFile.hasBeenIncrementallyParsed); - incrementalSourceFile.hasBeenIncrementallyParsed = true; - var oldText = sourceFile.text; - var syntaxCursor = createSyntaxCursor(sourceFile); - var changeRange = extendToAffectedRange(sourceFile, textChangeRange); - checkChangeRange(sourceFile, newText, changeRange, aggressiveChecks); - ts.Debug.assert(changeRange.span.start <= textChangeRange.span.start); - ts.Debug.assert(ts.textSpanEnd(changeRange.span) === ts.textSpanEnd(textChangeRange.span)); - ts.Debug.assert(ts.textSpanEnd(ts.textChangeRangeNewSpan(changeRange)) === ts.textSpanEnd(ts.textChangeRangeNewSpan(textChangeRange))); - var delta = ts.textChangeRangeNewSpan(changeRange).length - changeRange.span.length; - updateTokenPositionsAndMarkElements(incrementalSourceFile, changeRange.span.start, ts.textSpanEnd(changeRange.span), ts.textSpanEnd(ts.textChangeRangeNewSpan(changeRange)), delta, oldText, newText, aggressiveChecks); - var result = parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, true); - return result; - } - ts.updateSourceFile = updateSourceFile; - function isEvalOrArgumentsIdentifier(node) { - return node.kind === 65 && - (node.text === "eval" || node.text === "arguments"); - } - ts.isEvalOrArgumentsIdentifier = isEvalOrArgumentsIdentifier; - function isUseStrictPrologueDirective(sourceFile, node) { - ts.Debug.assert(ts.isPrologueDirective(node)); - var nodeText = ts.getSourceTextOfNodeFromSourceFile(sourceFile, node.expression); - return nodeText === '"use strict"' || nodeText === "'use strict'"; - } - function createSyntaxCursor(sourceFile) { - var currentArray = sourceFile.statements; - var currentArrayIndex = 0; - ts.Debug.assert(currentArrayIndex < currentArray.length); - var current = currentArray[currentArrayIndex]; - var lastQueriedPosition = -1; - return { - currentNode: function (position) { - if (position !== lastQueriedPosition) { - if (current && current.end === position && currentArrayIndex < (currentArray.length - 1)) { - currentArrayIndex++; - current = currentArray[currentArrayIndex]; - } - if (!current || current.pos !== position) { - findHighestListElementThatStartsAtPosition(position); - } - } - lastQueriedPosition = position; - ts.Debug.assert(!current || current.pos === position); - return current; - } - }; - function findHighestListElementThatStartsAtPosition(position) { - currentArray = undefined; - currentArrayIndex = -1; - current = undefined; - forEachChild(sourceFile, visitNode, visitArray); - return; - function visitNode(node) { - if (position >= node.pos && position < node.end) { - forEachChild(node, visitNode, visitArray); - return true; - } - return false; - } - function visitArray(array) { - if (position >= array.pos && position < array.end) { - for (var i = 0, n = array.length; i < n; i++) { - var child = array[i]; - if (child) { - if (child.pos === position) { - currentArray = array; - currentArrayIndex = i; - current = child; - return true; - } - else { - if (child.pos < position && position < child.end) { - forEachChild(child, visitNode, visitArray); - return true; - } - } - } - } - } - return false; - } - } - } function createSourceFile(fileName, sourceText, languageVersion, setParentNodes) { if (setParentNodes === void 0) { setParentNodes = false; } var start = new Date().getTime(); - var result = parseSourceFile(fileName, sourceText, languageVersion, undefined, setParentNodes); + var result = Parser.parseSourceFile(fileName, sourceText, languageVersion, undefined, setParentNodes); ts.parseTime += new Date().getTime() - start; return result; } ts.createSourceFile = createSourceFile; - function parseSourceFile(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes) { - if (setParentNodes === void 0) { setParentNodes = false; } + function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks) { + return IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks); + } + ts.updateSourceFile = updateSourceFile; + var Parser; + (function (Parser) { + var scanner = ts.createScanner(2, true); var disallowInAndDecoratorContext = 2 | 16; - var parsingContext = 0; - var identifiers = {}; - var identifierCount = 0; - var nodeCount = 0; + var sourceFile; + var syntaxCursor; var token; - var sourceFile = createNode(227, 0); - sourceFile.pos = 0; - sourceFile.end = sourceText.length; - sourceFile.text = sourceText; - sourceFile.parseDiagnostics = []; - sourceFile.bindDiagnostics = []; - sourceFile.languageVersion = languageVersion; - sourceFile.fileName = ts.normalizePath(fileName); - sourceFile.flags = ts.fileExtensionIs(sourceFile.fileName, ".d.ts") ? 2048 : 0; + var sourceText; + var nodeCount; + var identifiers; + var identifierCount; + var parsingContext; var contextFlags = 0; var parseErrorBeforeNextFinishedNode = false; - var scanner = ts.createScanner(languageVersion, true, sourceText, scanError); - token = nextToken(); - processReferenceComments(sourceFile); - sourceFile.statements = parseList(0, true, parseSourceElement); - ts.Debug.assert(token === 1); - sourceFile.endOfFileToken = parseTokenNode(); - setExternalModuleIndicator(sourceFile); - sourceFile.nodeCount = nodeCount; - sourceFile.identifierCount = identifierCount; - sourceFile.identifiers = identifiers; - if (setParentNodes) { - fixupParentReferences(sourceFile); + function parseSourceFile(fileName, _sourceText, languageVersion, _syntaxCursor, setParentNodes) { + sourceText = _sourceText; + syntaxCursor = _syntaxCursor; + parsingContext = 0; + identifiers = {}; + identifierCount = 0; + nodeCount = 0; + contextFlags = 0; + parseErrorBeforeNextFinishedNode = false; + createSourceFile(fileName, languageVersion); + scanner.setText(sourceText); + scanner.setOnError(scanError); + scanner.setScriptTarget(languageVersion); + token = nextToken(); + processReferenceComments(sourceFile); + sourceFile.statements = parseList(0, true, parseSourceElement); + ts.Debug.assert(token === 1); + sourceFile.endOfFileToken = parseTokenNode(); + setExternalModuleIndicator(sourceFile); + sourceFile.nodeCount = nodeCount; + sourceFile.identifierCount = identifierCount; + sourceFile.identifiers = identifiers; + if (setParentNodes) { + fixupParentReferences(sourceFile); + } + syntaxCursor = undefined; + scanner.setText(""); + scanner.setOnError(undefined); + var result = sourceFile; + sourceFile = undefined; + identifiers = undefined; + syntaxCursor = undefined; + sourceText = undefined; + return result; + } + Parser.parseSourceFile = parseSourceFile; + function fixupParentReferences(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; + forEachChild(n, visitNode); + parent = saveParent; + } + } + } + function createSourceFile(fileName, languageVersion) { + sourceFile = createNode(227, 0); + sourceFile.pos = 0; + sourceFile.end = sourceText.length; + sourceFile.text = sourceText; + sourceFile.parseDiagnostics = []; + sourceFile.bindDiagnostics = []; + sourceFile.languageVersion = languageVersion; + sourceFile.fileName = ts.normalizePath(fileName); + sourceFile.flags = ts.fileExtensionIs(sourceFile.fileName, ".d.ts") ? 2048 : 0; } - syntaxCursor = undefined; - return sourceFile; function setContextFlag(val, flag) { if (val) { contextFlags |= flag; @@ -5429,10 +5274,10 @@ var ts; if (token === 65) { return true; } - if (token === 111 && inYieldContext()) { + if (token === 110 && inYieldContext()) { return false; } - return inStrictModeContext() ? token > 111 : token > 101; + return token > 101; } function parseExpected(kind, diagnosticMessage) { if (token === kind) { @@ -5526,6 +5371,9 @@ var ts; identifierCount++; if (isIdentifier) { var node = createNode(65); + if (token !== 65) { + node.originalKeywordKind = token; + } node.text = internIdentifier(scanner.getTokenValue()); nextToken(); return finishNode(node); @@ -5662,7 +5510,7 @@ var ts; ts.Debug.assert(token === 14); if (nextToken() === 15) { var next = nextToken(); - return next === 23 || next === 14 || next === 79 || next === 103; + return next === 23 || next === 14 || next === 79 || next === 102; } return true; } @@ -5671,7 +5519,7 @@ var ts; return isIdentifier(); } function isHeritageClauseExtendsOrImplementsKeyword() { - if (token === 103 || + if (token === 102 || token === 79) { return lookAhead(nextTokenIsStartOfExpression); } @@ -5699,11 +5547,11 @@ var ts; case 4: return token === 15 || token === 67 || token === 73; case 8: - return token === 14 || token === 79 || token === 103; + return token === 14 || token === 79 || token === 102; case 9: return isVariableDeclaratorListTerminator(); case 16: - return token === 25 || token === 16 || token === 14 || token === 79 || token === 103; + return token === 25 || token === 16 || token === 14 || token === 79 || token === 102; case 12: return token === 17 || token === 22; case 14: @@ -5772,6 +5620,11 @@ var ts; parsingContext = saveParsingContext; return result; } + function isUseStrictPrologueDirective(sourceFile, node) { + ts.Debug.assert(ts.isPrologueDirective(node)); + var nodeText = ts.getSourceTextOfNodeFromSourceFile(sourceFile, node.expression); + return nodeText === '"use strict"' || nodeText === "'use strict'"; + } function parseListElement(parsingContext, parseElement) { var node = currentNode(parsingContext); if (node) { @@ -5947,6 +5800,32 @@ var ts; nextToken(); return false; } + 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.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 parseDelimitedList(kind, parseElement, considerSemicolonAsDelimeter) { var saveParsingContext = parsingContext; parsingContext |= 1 << kind; @@ -6507,7 +6386,7 @@ var ts; case 38: case 39: case 24: - case 111: + case 110: return true; default: if (isBinaryOperator()) { @@ -6571,13 +6450,13 @@ var ts; if (expr.kind === 65 && token === 32) { return parseSimpleArrowFunctionExpression(expr); } - if (isLeftHandSideExpression(expr) && isAssignmentOperator(reScanGreaterToken())) { + if (ts.isLeftHandSideExpression(expr) && ts.isAssignmentOperator(reScanGreaterToken())) { return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher()); } return parseConditionalExpressionRest(expr); } function isYieldExpression() { - if (token === 111) { + if (token === 110) { if (inYieldContext()) { return true; } @@ -6665,6 +6544,9 @@ var ts; return 0; } } + if (second === 18 || second === 14) { + return 2; + } if (second === 21) { return 1; } @@ -6843,7 +6725,7 @@ var ts; } function parsePostfixExpressionOrHigher() { var expression = parseLeftHandSideExpressionOrHigher(); - ts.Debug.assert(isLeftHandSideExpression(expression)); + ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token === 38 || token === 39) && !scanner.hasPrecedingLineBreak()) { var node = createNode(168, expression.pos); node.operand = expression; @@ -7199,7 +7081,7 @@ var ts; parseExpected(16); var initializer = undefined; if (token !== 22) { - if (token === 98 || token === 105 || token === 70) { + if (token === 98 || token === 104 || token === 70) { initializer = parseVariableDeclarationList(true); } else { @@ -7360,7 +7242,7 @@ var ts; return !inErrorRecovery; case 14: case 98: - case 105: + case 104: case 83: case 69: case 84: @@ -7381,17 +7263,17 @@ var ts; case 70: var isConstEnum = lookAhead(nextTokenIsEnumKeyword); return !isConstEnum; - case 104: + case 103: case 117: case 77: case 123: if (isDeclarationStart()) { return false; } - case 109: - case 107: case 108: - case 110: + case 106: + case 107: + case 109: if (lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine)) { return false; } @@ -7446,7 +7328,7 @@ var ts; return parseTryStatement(); case 72: return parseDebuggerStatement(); - case 105: + case 104: if (isLetDeclaration()) { return parseVariableStatement(scanner.getStartPos(), undefined, undefined); } @@ -7471,7 +7353,7 @@ var ts; return undefined; } return parseVariableStatement(start, decorators, modifiers); - case 105: + case 104: if (!isLetDeclaration()) { return undefined; } @@ -7504,13 +7386,14 @@ var ts; } function parseObjectBindingElement() { var node = createNode(152); - var id = parsePropertyName(); - if (id.kind === 65 && token !== 51) { - node.name = id; + var tokenIsIdentifier = isIdentifier(); + var propertyName = parsePropertyName(); + if (tokenIsIdentifier && token !== 51) { + node.name = propertyName; } else { parseExpected(51); - node.propertyName = id; + node.propertyName = propertyName; node.name = parseIdentifierOrPattern(); } node.initializer = parseInitializer(false); @@ -7556,7 +7439,7 @@ var ts; switch (token) { case 98: break; - case 105: + case 104: node.flags |= 4096; break; case 70: @@ -7653,6 +7536,17 @@ var ts; node.body = parseFunctionBlockOrSemicolon(false); return finishNode(node); } + function isClassMemberModifier(idToken) { + switch (idToken) { + case 108: + case 106: + case 107: + case 109: + return true; + default: + return false; + } + } function isClassMemberStart() { var idToken; if (token === 52) { @@ -7660,6 +7554,9 @@ var ts; } while (ts.isModifier(token)) { idToken = token; + if (isClassMemberModifier(idToken)) { + return true; + } nextToken(); } if (token === 35) { @@ -7722,7 +7619,7 @@ var ts; modifiers = []; modifiers.pos = modifierStart; } - flags |= modifierToFlag(modifierKind); + flags |= ts.modifierToFlag(modifierKind); modifiers.push(finishNode(createNode(modifierKind, modifierStart))); } if (modifiers) { @@ -7771,14 +7668,12 @@ var ts; } function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) { var savedStrictModeContext = inStrictModeContext(); - if (languageVersion >= 2) { - setStrictModeContext(true); - } + setStrictModeContext(true); var node = createNode(kind, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(69); - node.name = node.flags & 256 ? parseOptionalIdentifier() : parseIdentifier(); + node.name = parseOptionalIdentifier(); node.typeParameters = parseTypeParameters(); node.heritageClauses = parseHeritageClauses(true); if (parseExpected(14)) { @@ -7809,7 +7704,7 @@ var ts; return parseList(19, false, parseHeritageClause); } function parseHeritageClause() { - if (token === 79 || token === 103) { + if (token === 79 || token === 102) { var node = createNode(222); node.token = token; nextToken(); @@ -7827,7 +7722,7 @@ var ts; return finishNode(node); } function isHeritageClause() { - return token === 79 || token === 103; + return token === 79 || token === 102; } function parseClassMembers() { return parseList(6, false, parseClassElement); @@ -7836,7 +7731,7 @@ var ts; var node = createNode(202, fullStart); node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(104); + parseExpected(103); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); node.heritageClauses = parseHeritageClauses(false); @@ -7993,7 +7888,7 @@ var ts; function parseNamespaceImport() { var namespaceImport = createNode(211); parseExpected(35); - parseExpected(102); + parseExpected(111); namespaceImport.name = parseIdentifier(); return finishNode(namespaceImport); } @@ -8014,9 +7909,9 @@ var ts; var checkIdentifierStart = scanner.getTokenPos(); var checkIdentifierEnd = scanner.getTextPos(); var identifierName = parseIdentifierName(); - if (token === 102) { + if (token === 111) { node.propertyName = identifierName; - parseExpected(102); + parseExpected(111); checkIdentifierIsKeyword = ts.isKeyword(token) && !isIdentifier(); checkIdentifierStart = scanner.getTokenPos(); checkIdentifierEnd = scanner.getTextPos(); @@ -8053,17 +7948,11 @@ var ts; setModifiers(node, modifiers); if (parseOptional(53)) { node.isExportEquals = true; - node.expression = parseAssignmentExpressionOrHigher(); } else { parseExpected(73); - if (parseOptional(51)) { - node.type = parseType(); - } - else { - node.expression = parseAssignmentExpressionOrHigher(); - } } + node.expression = parseAssignmentExpressionOrHigher(); parseSemicolon(); return finishNode(node); } @@ -8076,10 +7965,10 @@ var ts; case 70: case 83: return true; - case 105: + case 104: return isLetDeclaration(); case 69: - case 104: + case 103: case 77: case 123: return lookAhead(nextTokenIsIdentifierOrKeyword); @@ -8090,10 +7979,10 @@ var ts; case 78: return lookAhead(nextTokenCanFollowExportKeyword); case 115: - case 109: - case 107: case 108: - case 110: + case 106: + case 107: + case 109: return lookAhead(nextTokenIsDeclarationStart); case 52: return !followsModifier; @@ -8125,7 +8014,7 @@ var ts; return isDeclarationStart(true); } function nextTokenIsAsKeyword() { - return nextToken() === 102; + return nextToken() === 111; } function parseDeclaration() { var fullStart = getNodePos(); @@ -8142,14 +8031,14 @@ var ts; } switch (token) { case 98: - case 105: + case 104: case 70: return parseVariableStatement(fullStart, decorators, modifiers); case 83: return parseFunctionDeclaration(fullStart, decorators, modifiers); case 69: return parseClassDeclaration(fullStart, decorators, modifiers); - case 104: + case 103: return parseInterfaceDeclaration(fullStart, decorators, modifiers); case 123: return parseTypeAliasDeclaration(fullStart, decorators, modifiers); @@ -8197,7 +8086,7 @@ var ts; if (kind !== 2) { break; } - var range = { pos: triviaScanner.getTokenPos(), end: triviaScanner.getTextPos() }; + var range = { pos: triviaScanner.getTokenPos(), end: triviaScanner.getTextPos(), kind: triviaScanner.getToken() }; var comment = sourceText.substring(range.pos, range.end); var referencePathMatchResult = ts.getFileReferenceFromReferencePath(comment, range); if (referencePathMatchResult) { @@ -8249,41 +8138,282 @@ var ts; : undefined; }); } - } - function isLeftHandSideExpression(expr) { - if (expr) { - switch (expr.kind) { - case 155: - case 156: - case 158: - case 157: - case 159: - case 153: - case 161: - case 154: - case 174: - case 162: - case 65: - case 9: - case 7: - case 8: - case 10: - case 171: - case 80: - case 89: - case 93: - case 95: - case 91: - return true; + })(Parser || (Parser = {})); + var IncrementalParser; + (function (IncrementalParser) { + function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks) { + aggressiveChecks = aggressiveChecks || ts.Debug.shouldAssert(2); + checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks); + if (ts.textChangeRangeIsUnchanged(textChangeRange)) { + return sourceFile; + } + if (sourceFile.statements.length === 0) { + return Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, undefined, true); + } + var incrementalSourceFile = sourceFile; + ts.Debug.assert(!incrementalSourceFile.hasBeenIncrementallyParsed); + incrementalSourceFile.hasBeenIncrementallyParsed = true; + var oldText = sourceFile.text; + var syntaxCursor = createSyntaxCursor(sourceFile); + var changeRange = extendToAffectedRange(sourceFile, textChangeRange); + checkChangeRange(sourceFile, newText, changeRange, aggressiveChecks); + ts.Debug.assert(changeRange.span.start <= textChangeRange.span.start); + ts.Debug.assert(ts.textSpanEnd(changeRange.span) === ts.textSpanEnd(textChangeRange.span)); + ts.Debug.assert(ts.textSpanEnd(ts.textChangeRangeNewSpan(changeRange)) === ts.textSpanEnd(ts.textChangeRangeNewSpan(textChangeRange))); + var delta = ts.textChangeRangeNewSpan(changeRange).length - changeRange.span.length; + updateTokenPositionsAndMarkElements(incrementalSourceFile, changeRange.span.start, ts.textSpanEnd(changeRange.span), ts.textSpanEnd(ts.textChangeRangeNewSpan(changeRange)), delta, oldText, newText, aggressiveChecks); + var result = Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, true); + return result; + } + IncrementalParser.updateSourceFile = updateSourceFile; + function moveElementEntirelyPastChangeRange(element, isArray, delta, oldText, newText, aggressiveChecks) { + if (isArray) { + visitArray(element); + } + else { + visitNode(element); + } + return; + function visitNode(node) { + if (aggressiveChecks && shouldCheckNode(node)) { + var text = oldText.substring(node.pos, node.end); + } + node._children = undefined; + node.pos += delta; + node.end += delta; + if (aggressiveChecks && shouldCheckNode(node)) { + ts.Debug.assert(text === newText.substring(node.pos, node.end)); + } + forEachChild(node, visitNode, visitArray); + checkNodePositions(node, aggressiveChecks); + } + function visitArray(array) { + array._children = undefined; + array.pos += delta; + array.end += delta; + for (var _i = 0; _i < array.length; _i++) { + var node = array[_i]; + visitNode(node); + } } } - return false; - } - ts.isLeftHandSideExpression = isLeftHandSideExpression; - function isAssignmentOperator(token) { - return token >= 53 && token <= 64; - } - ts.isAssignmentOperator = isAssignmentOperator; + function shouldCheckNode(node) { + switch (node.kind) { + case 8: + case 7: + case 65: + return true; + } + return false; + } + function adjustIntersectingElement(element, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta) { + ts.Debug.assert(element.end >= changeStart, "Adjusting an element that was entirely before the change range"); + ts.Debug.assert(element.pos <= changeRangeOldEnd, "Adjusting an element that was entirely after the change range"); + ts.Debug.assert(element.pos <= element.end); + element.pos = Math.min(element.pos, changeRangeNewEnd); + if (element.end >= changeRangeOldEnd) { + element.end += delta; + } + else { + element.end = Math.min(element.end, changeRangeNewEnd); + } + ts.Debug.assert(element.pos <= element.end); + if (element.parent) { + ts.Debug.assert(element.pos >= element.parent.pos); + ts.Debug.assert(element.end <= element.parent.end); + } + } + function checkNodePositions(node, aggressiveChecks) { + if (aggressiveChecks) { + var pos = node.pos; + forEachChild(node, function (child) { + ts.Debug.assert(child.pos >= pos); + pos = child.end; + }); + ts.Debug.assert(pos <= node.end); + } + } + function updateTokenPositionsAndMarkElements(sourceFile, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta, oldText, newText, aggressiveChecks) { + visitNode(sourceFile); + return; + function visitNode(child) { + ts.Debug.assert(child.pos <= child.end); + if (child.pos > changeRangeOldEnd) { + moveElementEntirelyPastChangeRange(child, false, delta, oldText, newText, aggressiveChecks); + return; + } + var fullEnd = child.end; + if (fullEnd >= changeStart) { + child.intersectsChange = true; + child._children = undefined; + adjustIntersectingElement(child, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); + forEachChild(child, visitNode, visitArray); + checkNodePositions(child, aggressiveChecks); + return; + } + ts.Debug.assert(fullEnd < changeStart); + } + function visitArray(array) { + ts.Debug.assert(array.pos <= array.end); + if (array.pos > changeRangeOldEnd) { + moveElementEntirelyPastChangeRange(array, true, delta, oldText, newText, aggressiveChecks); + return; + } + var fullEnd = array.end; + if (fullEnd >= changeStart) { + array.intersectsChange = true; + array._children = undefined; + adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); + for (var _i = 0; _i < array.length; _i++) { + var node = array[_i]; + visitNode(node); + } + return; + } + ts.Debug.assert(fullEnd < changeStart); + } + } + function extendToAffectedRange(sourceFile, changeRange) { + var maxLookahead = 1; + var start = changeRange.span.start; + for (var i = 0; start > 0 && i <= maxLookahead; i++) { + var nearestNode = findNearestNodeStartingBeforeOrAtPosition(sourceFile, start); + ts.Debug.assert(nearestNode.pos <= start); + var position = nearestNode.pos; + start = Math.max(0, position - 1); + } + var finalSpan = ts.createTextSpanFromBounds(start, ts.textSpanEnd(changeRange.span)); + var finalLength = changeRange.newLength + (changeRange.span.start - start); + return ts.createTextChangeRange(finalSpan, finalLength); + } + function findNearestNodeStartingBeforeOrAtPosition(sourceFile, position) { + var bestResult = sourceFile; + var lastNodeEntirelyBeforePosition; + forEachChild(sourceFile, visit); + if (lastNodeEntirelyBeforePosition) { + var lastChildOfLastEntireNodeBeforePosition = getLastChild(lastNodeEntirelyBeforePosition); + if (lastChildOfLastEntireNodeBeforePosition.pos > bestResult.pos) { + bestResult = lastChildOfLastEntireNodeBeforePosition; + } + } + return bestResult; + function getLastChild(node) { + while (true) { + var lastChild = getLastChildWorker(node); + if (lastChild) { + node = lastChild; + } + else { + return node; + } + } + } + function getLastChildWorker(node) { + var last = undefined; + forEachChild(node, function (child) { + if (ts.nodeIsPresent(child)) { + last = child; + } + }); + return last; + } + function visit(child) { + if (ts.nodeIsMissing(child)) { + return; + } + if (child.pos <= position) { + if (child.pos >= bestResult.pos) { + bestResult = child; + } + if (position < child.end) { + forEachChild(child, visit); + return true; + } + else { + ts.Debug.assert(child.end <= position); + lastNodeEntirelyBeforePosition = child; + } + } + else { + ts.Debug.assert(child.pos > position); + return true; + } + } + } + function checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks) { + var oldText = sourceFile.text; + if (textChangeRange) { + ts.Debug.assert((oldText.length - textChangeRange.span.length + textChangeRange.newLength) === newText.length); + if (aggressiveChecks || ts.Debug.shouldAssert(3)) { + var oldTextPrefix = oldText.substr(0, textChangeRange.span.start); + var newTextPrefix = newText.substr(0, textChangeRange.span.start); + ts.Debug.assert(oldTextPrefix === newTextPrefix); + var oldTextSuffix = oldText.substring(ts.textSpanEnd(textChangeRange.span), oldText.length); + var newTextSuffix = newText.substring(ts.textSpanEnd(ts.textChangeRangeNewSpan(textChangeRange)), newText.length); + ts.Debug.assert(oldTextSuffix === newTextSuffix); + } + } + } + function createSyntaxCursor(sourceFile) { + var currentArray = sourceFile.statements; + var currentArrayIndex = 0; + ts.Debug.assert(currentArrayIndex < currentArray.length); + var current = currentArray[currentArrayIndex]; + var lastQueriedPosition = -1; + return { + currentNode: function (position) { + if (position !== lastQueriedPosition) { + if (current && current.end === position && currentArrayIndex < (currentArray.length - 1)) { + currentArrayIndex++; + current = currentArray[currentArrayIndex]; + } + if (!current || current.pos !== position) { + findHighestListElementThatStartsAtPosition(position); + } + } + lastQueriedPosition = position; + ts.Debug.assert(!current || current.pos === position); + return current; + } + }; + function findHighestListElementThatStartsAtPosition(position) { + currentArray = undefined; + currentArrayIndex = -1; + current = undefined; + forEachChild(sourceFile, visitNode, visitArray); + return; + function visitNode(node) { + if (position >= node.pos && position < node.end) { + forEachChild(node, visitNode, visitArray); + return true; + } + return false; + } + function visitArray(array) { + if (position >= array.pos && position < array.end) { + for (var i = 0, n = array.length; i < n; i++) { + var child = array[i]; + if (child) { + if (child.pos === position) { + currentArray = array; + currentArrayIndex = i; + current = child; + return true; + } + else { + if (child.pos < position && position < child.end) { + forEachChild(child, visitNode, visitArray); + return true; + } + } + } + } + } + return false; + } + } + } + })(IncrementalParser || (IncrementalParser = {})); })(ts || (ts = {})); /// var ts; @@ -8351,7 +8481,7 @@ var ts; isImplementationOfOverload: isImplementationOfOverload, getAliasedSymbol: resolveAlias, getEmitResolver: getEmitResolver, - getExportsOfExternalModule: getExportsOfExternalModule + getExportsOfModule: getExportsOfModuleAsArray }; var unknownSymbol = createSymbol(4 | 67108864, "unknown"); var resolvingSymbol = createSymbol(67108864, "__resolving__"); @@ -8394,6 +8524,7 @@ var ts; var stringLiteralTypes = {}; var emitExtends = false; var emitDecorate = false; + var emitParam = false; var mergedSymbols = []; var symbolLinks = []; var nodeLinks = []; @@ -8611,7 +8742,8 @@ var ts; } result = undefined; } - else if (location.kind === 227) { + else if (location.kind === 227 || + (location.kind === 205 && location.name.kind === 8)) { result = getSymbol(getSymbolOfNode(location).exports, "default", meaning & 8914931); var localSymbol = ts.getLocalSymbolForExportDefault(result); if (result && (result.flags & meaning) && localSymbol && localSymbol.name === name) { @@ -8789,7 +8921,7 @@ var ts; if (moduleSymbol.flags & 3) { var typeAnnotation = moduleSymbol.valueDeclaration.type; if (typeAnnotation) { - return getPropertyOfType(getTypeFromTypeNodeOrHeritageClauseElement(typeAnnotation), name); + return getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name); } } } @@ -8820,7 +8952,7 @@ var ts; if (symbol.flags & 3) { var typeAnnotation = symbol.valueDeclaration.type; if (typeAnnotation) { - return resolveSymbol(getPropertyOfType(getTypeFromTypeNodeOrHeritageClauseElement(typeAnnotation), name)); + return resolveSymbol(getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name)); } } } @@ -8851,7 +8983,7 @@ var ts; resolveEntityName(node.propertyName || node.name, 107455 | 793056 | 1536); } function getTargetOfExportAssignment(node) { - return node.expression && resolveEntityName(node.expression, 107455 | 793056 | 1536); + return resolveEntityName(node.expression, 107455 | 793056 | 1536); } function getTargetOfAliasDeclaration(node) { switch (node.kind) { @@ -8907,7 +9039,7 @@ var ts; if (!links.referenced) { links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); - if (node.kind === 214 && node.expression) { + if (node.kind === 214) { checkExpressionCached(node.expression); } else if (node.kind === 217) { @@ -9022,6 +9154,9 @@ var ts; function getExportAssignmentSymbol(moduleSymbol) { return moduleSymbol.exports["export="]; } + function getExportsOfModuleAsArray(moduleSymbol) { + return symbolsToArray(getExportsOfModule(moduleSymbol)); + } function getExportsOfSymbol(symbol) { return symbol.flags & 1536 ? getExportsOfModule(symbol) : symbol.exports || emptySymbols; } @@ -9042,7 +9177,7 @@ var ts; visit(moduleSymbol); return result || moduleSymbol.exports; function visit(symbol) { - if (symbol.flags & 1952 && !ts.contains(visitedSymbols, symbol)) { + if (symbol && symbol.flags & 1952 && !ts.contains(visitedSymbols, symbol)) { visitedSymbols.push(symbol); if (symbol !== moduleSymbol) { if (!result) { @@ -9953,13 +10088,15 @@ var ts; } } else { - if (!isArrayLikeType(parentType)) { - error(pattern, ts.Diagnostics.Type_0_is_not_an_array_type, typeToString(parentType)); - return unknownType; - } + var elementType = checkIteratedTypeOrElementType(parentType, pattern, false); if (!declaration.dotDotDotToken) { + if (elementType.flags & 1) { + return elementType; + } var propName = "" + ts.indexOf(pattern.elements, declaration); - type = isTupleLikeType(parentType) ? getTypeOfPropertyOfType(parentType, propName) : getIndexTypeOfType(parentType, 1); + type = isTupleLikeType(parentType) + ? getTypeOfPropertyOfType(parentType, propName) + : elementType; if (!type) { if (isTupleType(parentType)) { error(declaration, ts.Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2, typeToString(parentType), parentType.elementTypes.length, pattern.elements.length); @@ -9971,7 +10108,7 @@ var ts; } } else { - type = createArrayType(getIndexTypeOfType(parentType, 1)); + type = createArrayType(elementType); } } return type; @@ -9987,7 +10124,7 @@ var ts; return getTypeForBindingElement(declaration); } if (declaration.type) { - return getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); + return getTypeFromTypeNode(declaration.type); } if (declaration.kind === 129) { var func = declaration.parent; @@ -10039,7 +10176,14 @@ var ts; hasSpreadElement = true; } }); - return !elementTypes.length ? anyArrayType : hasSpreadElement ? createArrayType(getUnionType(elementTypes)) : createTupleType(elementTypes); + if (!elementTypes.length) { + return languageVersion >= 2 ? createIterableType(anyType) : anyArrayType; + } + else if (hasSpreadElement) { + var unionOfElements = getUnionType(elementTypes); + return languageVersion >= 2 ? createIterableType(unionOfElements) : createArrayType(unionOfElements); + } + return createTupleType(elementTypes); } function getTypeFromBindingPattern(pattern) { return pattern.kind === 150 @@ -10077,16 +10221,7 @@ var ts; return links.type = anyType; } 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; - } + return links.type = checkExpression(declaration.expression); } links.type = resolvingType; var type = getWidenedTypeForVariableLikeDeclaration(declaration, true); @@ -10111,11 +10246,11 @@ var ts; function getAnnotatedAccessorType(accessor) { if (accessor) { if (accessor.kind === 136) { - return accessor.type && getTypeFromTypeNodeOrHeritageClauseElement(accessor.type); + return accessor.type && getTypeFromTypeNode(accessor.type); } else { var setterTypeAnnotation = getSetAccessorTypeAnnotationNode(accessor); - return setterTypeAnnotation && getTypeFromTypeNodeOrHeritageClauseElement(setterTypeAnnotation); + return setterTypeAnnotation && getTypeFromTypeNode(setterTypeAnnotation); } } return undefined; @@ -10221,7 +10356,7 @@ var ts; return check(type); function check(type) { var target = getTargetType(type); - return target === checkBase || ts.forEach(target.baseTypes, check); + return target === checkBase || ts.forEach(getBaseTypes(target), check); } } function getTypeParametersOfClassOrInterface(symbol) { @@ -10244,6 +10379,67 @@ var ts; }); return result; } + function getBaseTypes(type) { + var typeWithBaseTypes = type; + if (!typeWithBaseTypes.baseTypes) { + if (type.symbol.flags & 32) { + resolveBaseTypesOfClass(typeWithBaseTypes); + } + else if (type.symbol.flags & 64) { + resolveBaseTypesOfInterface(typeWithBaseTypes); + } + else { + ts.Debug.fail("type must be class or interface"); + } + } + return typeWithBaseTypes.baseTypes; + } + function resolveBaseTypesOfClass(type) { + type.baseTypes = []; + var declaration = ts.getDeclarationOfKind(type.symbol, 201); + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(declaration); + if (baseTypeNode) { + var baseType = getTypeFromHeritageClauseElement(baseTypeNode); + if (baseType !== unknownType) { + if (getTargetType(baseType).flags & 1024) { + if (type !== baseType && !hasBaseType(baseType, type)) { + type.baseTypes.push(baseType); + } + else { + error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1)); + } + } + else { + error(baseTypeNode, ts.Diagnostics.A_class_may_only_extend_another_class); + } + } + } + } + function resolveBaseTypesOfInterface(type) { + type.baseTypes = []; + for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + if (declaration.kind === 202 && ts.getInterfaceBaseTypeNodes(declaration)) { + for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { + var node = _c[_b]; + var baseType = getTypeFromHeritageClauseElement(node); + if (baseType !== unknownType) { + if (getTargetType(baseType).flags & (1024 | 2048)) { + if (type !== baseType && !hasBaseType(baseType, type)) { + type.baseTypes.push(baseType); + } + else { + error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1)); + } + } + else { + error(node, ts.Diagnostics.An_interface_may_only_extend_a_class_or_another_interface); + } + } + } + } + } + } function getDeclaredTypeOfClass(symbol) { var links = getSymbolLinks(symbol); if (!links.declaredType) { @@ -10257,25 +10453,6 @@ var ts; type.target = type; type.typeArguments = type.typeParameters; } - type.baseTypes = []; - var declaration = ts.getDeclarationOfKind(symbol, 201); - var baseTypeNode = ts.getClassExtendsHeritageClauseElement(declaration); - if (baseTypeNode) { - var baseType = getTypeFromHeritageClauseElement(baseTypeNode); - if (baseType !== unknownType) { - if (getTargetType(baseType).flags & 1024) { - if (type !== baseType && !hasBaseType(baseType, type)) { - type.baseTypes.push(baseType); - } - else { - error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1)); - } - } - else { - error(baseTypeNode, ts.Diagnostics.A_class_may_only_extend_another_class); - } - } - } type.declaredProperties = getNamedMembers(symbol.members); type.declaredCallSignatures = emptyArray; type.declaredConstructSignatures = emptyArray; @@ -10297,27 +10474,6 @@ var ts; type.target = type; type.typeArguments = type.typeParameters; } - type.baseTypes = []; - ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 202 && ts.getInterfaceBaseTypeNodes(declaration)) { - ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), function (node) { - var baseType = getTypeFromHeritageClauseElement(node); - if (baseType !== unknownType) { - if (getTargetType(baseType).flags & (1024 | 2048)) { - if (type !== baseType && !hasBaseType(baseType, type)) { - type.baseTypes.push(baseType); - } - else { - error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1)); - } - } - else { - error(node, ts.Diagnostics.An_interface_may_only_extend_a_class_or_another_interface); - } - } - }); - } - }); type.declaredProperties = getNamedMembers(symbol.members); type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]); type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]); @@ -10331,7 +10487,7 @@ var ts; if (!links.declaredType) { links.declaredType = resolvingType; var declaration = ts.getDeclarationOfKind(symbol, 203); - var type = getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); + var type = getTypeFromTypeNode(declaration.type); if (links.declaredType === resolvingType) { links.declaredType = type; } @@ -10431,15 +10587,17 @@ var ts; var constructSignatures = type.declaredConstructSignatures; var stringIndexType = type.declaredStringIndexType; var numberIndexType = type.declaredNumberIndexType; - if (type.baseTypes.length) { + var baseTypes = getBaseTypes(type); + if (baseTypes.length) { members = createSymbolTable(type.declaredProperties); - ts.forEach(type.baseTypes, function (baseType) { + for (var _i = 0; _i < baseTypes.length; _i++) { + var baseType = baseTypes[_i]; addInheritedMembers(members, getPropertiesOfObjectType(baseType)); callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(baseType, 0)); constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(baseType, 1)); stringIndexType = stringIndexType || getIndexTypeOfType(baseType, 0); numberIndexType = numberIndexType || getIndexTypeOfType(baseType, 1); - }); + } } setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } @@ -10451,7 +10609,7 @@ var ts; var constructSignatures = instantiateList(target.declaredConstructSignatures, mapper, instantiateSignature); var stringIndexType = target.declaredStringIndexType ? instantiateType(target.declaredStringIndexType, mapper) : undefined; var numberIndexType = target.declaredNumberIndexType ? instantiateType(target.declaredNumberIndexType, mapper) : undefined; - ts.forEach(target.baseTypes, function (baseType) { + ts.forEach(getBaseTypes(target), function (baseType) { var instantiatedBaseType = instantiateType(baseType, mapper); addInheritedMembers(members, getPropertiesOfObjectType(instantiatedBaseType)); callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, 0)); @@ -10476,8 +10634,9 @@ var ts; return createSignature(sig.declaration, sig.typeParameters, sig.parameters, sig.resolvedReturnType, sig.minArgumentCount, sig.hasRestParameter, sig.hasStringLiterals); } function getDefaultConstructSignatures(classType) { - if (classType.baseTypes.length) { - var baseType = classType.baseTypes[0]; + var baseTypes = getBaseTypes(classType); + if (baseTypes.length) { + var baseType = baseTypes[0]; var baseSignatures = getSignaturesOfType(getTypeOfSymbol(baseType.symbol), 1); return ts.map(baseSignatures, function (baseSignature) { var signature = baseType.flags & 4096 ? @@ -10586,9 +10745,10 @@ var ts; if (!constructSignatures.length) { constructSignatures = getDefaultConstructSignatures(classType); } - if (classType.baseTypes.length) { + var baseTypes = getBaseTypes(classType); + if (baseTypes.length) { members = createSymbolTable(getNamedMembers(members)); - addInheritedMembers(members, getPropertiesOfObjectType(getTypeOfSymbol(classType.baseTypes[0].symbol))); + addInheritedMembers(members, getPropertiesOfObjectType(getTypeOfSymbol(baseTypes[0].symbol))); } } stringIndexType = undefined; @@ -10644,12 +10804,13 @@ var ts; return result; } function getPropertiesOfType(type) { - if (type.flags & 16384) { - return getPropertiesOfUnionType(type); - } - return getPropertiesOfObjectType(getApparentType(type)); + type = getApparentType(type); + return type.flags & 16384 ? getPropertiesOfUnionType(type) : getPropertiesOfObjectType(type); } function getApparentType(type) { + if (type.flags & 16384) { + type = getReducedTypeOfUnionType(type); + } if (type.flags & 512) { do { type = getConstraintOfTypeParameter(type); @@ -10718,28 +10879,27 @@ var ts; return property; } function getPropertyOfType(type, name) { + type = getApparentType(type); + if (type.flags & 48128) { + var resolved = resolveObjectOrUnionTypeMembers(type); + if (ts.hasProperty(resolved.members, name)) { + var symbol = resolved.members[name]; + if (symbolIsValue(symbol)) { + return symbol; + } + } + if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { + var symbol = getPropertyOfObjectType(globalFunctionType, name); + if (symbol) { + return symbol; + } + } + return getPropertyOfObjectType(globalObjectType, name); + } if (type.flags & 16384) { return getPropertyOfUnionType(type, name); } - if (!(type.flags & 48128)) { - type = getApparentType(type); - if (!(type.flags & 48128)) { - return undefined; - } - } - var resolved = resolveObjectOrUnionTypeMembers(type); - if (ts.hasProperty(resolved.members, name)) { - var symbol = resolved.members[name]; - if (symbolIsValue(symbol)) { - return symbol; - } - } - if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { - var symbol = getPropertyOfObjectType(globalFunctionType, name); - if (symbol) - return symbol; - } - return getPropertyOfObjectType(globalObjectType, name); + return undefined; } function getSignaturesOfObjectOrUnionType(type, kind) { if (type.flags & (48128 | 16384)) { @@ -10751,6 +10911,15 @@ var ts; function getSignaturesOfType(type, kind) { return getSignaturesOfObjectOrUnionType(getApparentType(type), kind); } + function typeHasCallOrConstructSignatures(type) { + var apparentType = getApparentType(type); + if (apparentType.flags & (48128 | 16384)) { + var resolved = resolveObjectOrUnionTypeMembers(type); + return resolved.callSignatures.length > 0 + || resolved.constructSignatures.length > 0; + } + return false; + } function getIndexTypeOfObjectOrUnionType(type, kind) { if (type.flags & (48128 | 16384)) { var resolved = resolveObjectOrUnionTypeMembers(type); @@ -10779,16 +10948,6 @@ var ts; } return result; } - function getExportsOfExternalModule(node) { - if (!node.moduleSpecifier) { - return emptyArray; - } - var module = resolveExternalModuleName(node, node.moduleSpecifier); - if (!module) { - return emptyArray; - } - return symbolsToArray(getExportsOfModule(module)); - } function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { @@ -10818,7 +10977,7 @@ var ts; returnType = classType; } else if (declaration.type) { - returnType = getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); + returnType = getTypeFromTypeNode(declaration.type); } else { if (declaration.kind === 136 && !ts.hasDynamicName(declaration)) { @@ -10956,7 +11115,7 @@ var ts; function getIndexTypeOfSymbol(symbol, kind) { var declaration = getIndexDeclarationOfSymbol(symbol, kind); return declaration - ? declaration.type ? getTypeFromTypeNodeOrHeritageClauseElement(declaration.type) : anyType + ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType : undefined; } function getConstraintOfTypeParameter(type) { @@ -10966,7 +11125,7 @@ var ts; type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNodeOrHeritageClauseElement(ts.getDeclarationOfKind(type.symbol, 128).constraint); + type.constraint = getTypeFromTypeNode(ts.getDeclarationOfKind(type.symbol, 128).constraint); } } return type.constraint === noConstraintType ? undefined : type.constraint; @@ -11065,7 +11224,7 @@ var ts; 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)); + 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); @@ -11135,6 +11294,9 @@ var ts; function getGlobalESSymbolConstructorSymbol() { return globalESSymbolConstructorSymbol || (globalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol")); } + function createIterableType(elementType) { + return globalIterableType !== emptyObjectType ? createTypeReference(globalIterableType, [elementType]) : emptyObjectType; + } function createArrayType(elementType) { var arrayType = globalArrayType || getDeclaredTypeOfSymbol(globalArraySymbol); return arrayType !== emptyObjectType ? createTypeReference(arrayType, [elementType]) : emptyObjectType; @@ -11142,7 +11304,7 @@ var ts; function getTypeFromArrayTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createArrayType(getTypeFromTypeNodeOrHeritageClauseElement(node.elementType)); + links.resolvedType = createArrayType(getTypeFromTypeNode(node.elementType)); } return links.resolvedType; } @@ -11158,7 +11320,7 @@ var ts; function getTypeFromTupleTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createTupleType(ts.map(node.elementTypes, getTypeFromTypeNodeOrHeritageClauseElement)); + links.resolvedType = createTupleType(ts.map(node.elementTypes, getTypeFromTypeNode)); } return links.resolvedType; } @@ -11243,13 +11405,20 @@ var ts; if (!type) { type = unionTypes[id] = createObjectType(16384 | getWideningFlagsOfTypes(sortedTypes)); type.types = sortedTypes; + type.reducedType = noSubtypeReduction ? undefined : type; } return type; } + function getReducedTypeOfUnionType(type) { + if (!type.reducedType) { + type.reducedType = getUnionType(type.types, false); + } + return type.reducedType; + } function getTypeFromUnionTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNodeOrHeritageClauseElement), true); + links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNode), true); } return links.resolvedType; } @@ -11275,7 +11444,7 @@ var ts; } return links.resolvedType; } - function getTypeFromTypeNodeOrHeritageClauseElement(node) { + function getTypeFromTypeNode(node) { switch (node.kind) { case 112: return anyType; @@ -11304,7 +11473,7 @@ var ts; case 148: return getTypeFromUnionTypeNode(node); case 149: - return getTypeFromTypeNodeOrHeritageClauseElement(node.type); + return getTypeFromTypeNode(node.type); case 142: case 143: case 145: @@ -11580,6 +11749,7 @@ var ts; return -1; } } + var saveErrorInfo = errorInfo; if (source.flags & 16384 || target.flags & 16384) { if (relation === identityRelation) { if (source.flags & 16384 && target.flags & 16384) { @@ -11618,21 +11788,25 @@ var ts; 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; - } + else if (source.flags & 4096 && target.flags & 4096 && source.target === target.target) { + 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))) { + } + var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; + var sourceOrApparentType = relation === identityRelation ? source : getApparentType(source); + if (sourceOrApparentType.flags & 48128 && target.flags & 48128) { + if (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors)) { errorInfo = saveErrorInfo; return result; } } + else if (source.flags & 512 && sourceOrApparentType.flags & 16384) { + errorInfo = saveErrorInfo; + if (result = isRelatedTo(sourceOrApparentType, target, reportErrors)) { + return result; + } + } if (reportErrors) { headMessage = headMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1; var sourceType = typeToString(source); @@ -12786,8 +12960,8 @@ var ts; } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); - 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 === argumentsSymbol && ts.getContainingFunction(node).kind === 163 && languageVersion < 2) { + error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } if (symbol.flags & 8388608 && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { markAliasSymbolAsReferenced(symbol); @@ -12897,7 +13071,8 @@ var ts; var baseClass; if (enclosingClass && ts.getClassExtendsHeritageClauseElement(enclosingClass)) { var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); - baseClass = classType.baseTypes.length && classType.baseTypes[0]; + var baseTypes = getBaseTypes(classType); + baseClass = baseTypes.length && baseTypes[0]; } if (!baseClass) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_a_derived_class); @@ -12914,7 +13089,7 @@ var ts; needToCaptureLexicalThis = false; while (container && container.kind === 163) { container = ts.getSuperContainer(container, true); - needToCaptureLexicalThis = true; + needToCaptureLexicalThis = languageVersion < 2; } if (container && container.parent && container.parent.kind === 201) { if (container.flags & 128) { @@ -12956,7 +13131,7 @@ var ts; return returnType; } } - if (container.kind === 127) { + if (container && container.kind === 127) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { @@ -12992,7 +13167,7 @@ var ts; var declaration = node.parent; if (node === declaration.initializer) { if (declaration.type) { - return getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); + return getTypeFromTypeNode(declaration.type); } if (declaration.kind === 129) { var type = getContextuallyTypedParameterType(declaration); @@ -13150,7 +13325,7 @@ var ts; case 158: return getContextualTypeForArgument(parent, node); case 160: - return getTypeFromTypeNodeOrHeritageClauseElement(parent.type); + return getTypeFromTypeNode(parent.type); case 169: return getContextualTypeForBinaryOperand(node); case 224: @@ -13239,12 +13414,8 @@ var ts; return false; } function checkSpreadElementExpression(node, contextualMapper) { - var type = checkExpressionCached(node.expression, contextualMapper); - if (!isArrayLikeType(type)) { - error(node.expression, ts.Diagnostics.Type_0_is_not_an_array_type, typeToString(type)); - return unknownType; - } - return type; + var arrayOrIterableType = checkExpressionCached(node.expression, contextualMapper); + return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, false); } function checkArrayLiteral(node, contextualMapper) { var elements = node.elements; @@ -13253,19 +13424,26 @@ var ts; } var hasSpreadElement = false; var elementTypes = []; - ts.forEach(elements, function (e) { - var type = checkExpression(e, contextualMapper); - if (e.kind === 173) { - elementTypes.push(getIndexTypeOfType(type, 1) || anyType); - hasSpreadElement = true; + var inDestructuringPattern = isAssignmentTarget(node); + for (var _i = 0; _i < elements.length; _i++) { + var e = elements[_i]; + if (inDestructuringPattern && e.kind === 173) { + var restArrayType = checkExpression(e.expression, contextualMapper); + var restElementType = getIndexTypeOfType(restArrayType, 1) || + (languageVersion >= 2 ? checkIteratedType(restArrayType, undefined) : undefined); + if (restElementType) { + elementTypes.push(restElementType); + } } else { + var type = checkExpression(e, contextualMapper); elementTypes.push(type); } - }); + hasSpreadElement = hasSpreadElement || e.kind === 173; + } if (!hasSpreadElement) { var contextualType = getContextualType(node); - if (contextualType && contextualTypeIsTupleLikeType(contextualType) || isAssignmentTarget(node)) { + if (contextualType && contextualTypeIsTupleLikeType(contextualType) || inDestructuringPattern) { return createTupleType(elementTypes); } } @@ -13314,9 +13492,7 @@ var ts; } else { ts.Debug.assert(memberDecl.kind === 225); - type = memberDecl.name.kind === 127 - ? unknownType - : checkExpression(memberDecl.name, contextualMapper); + type = checkExpression(memberDecl.name, contextualMapper); } typeFlags |= type.flags; var prop = createSymbol(4 | 67108864 | member.flags, member.name); @@ -13685,7 +13861,7 @@ var ts; for (var i = 0; i < args.length; i++) { var arg = args[i]; if (arg.kind !== 175) { - var paramType = getTypeAtPosition(signature, arg.kind === 173 ? -1 : i); + var paramType = getTypeAtPosition(signature, i); var argType = void 0; if (i === 0 && args[i].parent.kind === 159) { argType = globalTemplateStringsArrayType; @@ -13701,7 +13877,7 @@ var ts; 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); + var paramType = getTypeAtPosition(signature, i); inferTypes(context, checkExpressionWithContextualType(arg, paramType, inferenceMapper), paramType); } } @@ -13713,7 +13889,7 @@ var ts; var typeArgumentsAreAssignable = true; for (var i = 0; i < typeParameters.length; i++) { var typeArgNode = typeArguments[i]; - var typeArgument = getTypeFromTypeNodeOrHeritageClauseElement(typeArgNode); + var typeArgument = getTypeFromTypeNode(typeArgNode); typeArgumentResultTypes[i] = typeArgument; if (typeArgumentsAreAssignable) { var constraint = getConstraintOfTypeParameter(typeParameters[i]); @@ -13728,10 +13904,12 @@ var ts; for (var i = 0; i < args.length; i++) { var arg = args[i]; 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); + var paramType = getTypeAtPosition(signature, 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; } @@ -14016,7 +14194,7 @@ var ts; } function checkTypeAssertion(node) { var exprType = checkExpression(node.expression); - var targetType = getTypeFromTypeNodeOrHeritageClauseElement(node.type); + var targetType = getTypeFromTypeNode(node.type); if (produceDiagnostics && targetType !== unknownType) { var widenedType = getWidenedType(exprType); if (!(isTypeAssignableTo(targetType, widenedType))) { @@ -14026,14 +14204,9 @@ var ts; return targetType; } 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 ? - getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]) : - anyArrayType; + pos < signature.parameters.length - 1 ? getTypeOfSymbol(signature.parameters[pos]) : getRestTypeOfSignature(signature) : + pos < signature.parameters.length ? getTypeOfSymbol(signature.parameters[pos]) : anyType; } function assignContextualParameterTypes(signature, context, mapper) { var len = signature.parameters.length - (signature.hasRestParameter ? 1 : 0); @@ -14115,7 +14288,7 @@ var ts; } function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) { ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); - var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); + var hasGrammarError = checkGrammarDeclarationNameInStrictMode(node) || checkGrammarFunctionLikeDeclaration(node); if (!hasGrammarError && node.kind === 162) { checkGrammarFunctionName(node.name) || checkGrammarForGenerator(node); } @@ -14152,8 +14325,8 @@ var ts; } function checkFunctionExpressionOrObjectLiteralMethodBody(node) { ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); - if (node.type) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type)); + if (node.type && !node.asteriskToken) { + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); } if (node.body) { if (node.body.kind === 179) { @@ -14162,7 +14335,7 @@ var ts; else { var exprType = checkExpression(node.body); if (node.type) { - checkTypeAssignableTo(exprType, getTypeFromTypeNodeOrHeritageClauseElement(node.type), node.body, undefined); + checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, undefined); } checkFunctionExpressionBodies(node.body); } @@ -14360,10 +14533,7 @@ var ts; return sourceType; } function checkArrayLiteralAssignment(node, sourceType, contextualMapper) { - if (!isArrayLikeType(sourceType)) { - error(node, ts.Diagnostics.Type_0_is_not_an_array_type, typeToString(sourceType)); - return sourceType; - } + var elementType = checkIteratedTypeOrElementType(sourceType, node, false) || unknownType; var elements = node.elements; for (var i = 0; i < elements.length; i++) { var e = elements[i]; @@ -14371,8 +14541,9 @@ var ts; if (e.kind !== 173) { var propName = "" + i; var type = sourceType.flags & 1 ? sourceType : - isTupleLikeType(sourceType) ? getTypeOfPropertyOfType(sourceType, propName) : - getIndexTypeOfType(sourceType, 1); + isTupleLikeType(sourceType) + ? getTypeOfPropertyOfType(sourceType, propName) + : elementType; if (type) { checkDestructuringAssignment(e, type, contextualMapper); } @@ -14386,11 +14557,17 @@ var ts; } } else { - if (i === elements.length - 1) { - checkReferenceAssignment(e.expression, sourceType, contextualMapper); + if (i < elements.length - 1) { + error(e, ts.Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); } else { - error(e, ts.Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); + var restExpression = e.expression; + if (restExpression.kind === 169 && restExpression.operatorToken.kind === 53) { + error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); + } + else { + checkDestructuringAssignment(restExpression, createArrayType(elementType), contextualMapper); + } } } } @@ -14625,6 +14802,7 @@ var ts; return type; } function checkExpression(node, contextualMapper) { + checkGrammarIdentifierInStrictMode(node); return checkExpressionOrQualifiedName(node, contextualMapper); } function checkExpressionOrQualifiedName(node, contextualMapper) { @@ -14647,7 +14825,7 @@ var ts; return type; } function checkNumericLiteral(node) { - checkGrammarNumbericLiteral(node); + checkGrammarNumericLiteral(node); return numberType; } function checkExpressionWorker(node, contextualMapper) { @@ -14719,6 +14897,7 @@ var ts; return unknownType; } function checkTypeParameter(node) { + checkGrammarDeclarationNameInStrictMode(node); if (node.expression) { grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected); } @@ -14747,10 +14926,8 @@ var ts; if (node.questionToken && ts.isBindingPattern(node.name) && func.body) { error(node, ts.Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature); } - if (node.dotDotDotToken) { - if (!isArrayType(getTypeOfSymbol(node.symbol))) { - error(node, ts.Diagnostics.A_rest_parameter_must_be_of_an_array_type); - } + if (node.dotDotDotToken && !ts.isBindingPattern(node.name) && !isArrayType(getTypeOfSymbol(node.symbol))) { + error(node, ts.Diagnostics.A_rest_parameter_must_be_of_an_array_type); } } function checkSignatureDeclaration(node) { @@ -14921,9 +15098,11 @@ var ts; checkDecorators(node); } function checkTypeReferenceNode(node) { + checkGrammarTypeReferenceInStrictMode(node.typeName); return checkTypeReferenceOrHeritageClauseElement(node); } function checkHeritageClauseElement(node) { + checkGrammarHeritageClauseElementInStrictMode(node.expression); return checkTypeReferenceOrHeritageClauseElement(node); } function checkTypeReferenceOrHeritageClauseElement(node) { @@ -15246,21 +15425,71 @@ var ts; break; } } + function checkTypeNodeAsExpression(node) { + if (node && node.kind === 141) { + var type = getTypeFromTypeNode(node); + var shouldCheckIfUnknownType = type === unknownType && compilerOptions.separateCompilation; + if (!type || (!shouldCheckIfUnknownType && type.flags & (1048703 | 132 | 258))) { + return; + } + if (shouldCheckIfUnknownType || type.symbol.valueDeclaration) { + checkExpressionOrQualifiedName(node.typeName); + } + } + } + function checkTypeAnnotationAsExpression(node) { + switch (node.kind) { + case 132: + checkTypeNodeAsExpression(node.type); + break; + case 129: + checkTypeNodeAsExpression(node.type); + break; + case 134: + checkTypeNodeAsExpression(node.type); + break; + case 136: + checkTypeNodeAsExpression(node.type); + break; + case 137: + checkTypeNodeAsExpression(getSetAccessorTypeAnnotationNode(node)); + break; + } + } + function checkParameterTypeAnnotationsAsExpressions(node) { + for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { + var parameter = _a[_i]; + checkTypeAnnotationAsExpression(parameter); + } + } 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; + if (!ts.nodeCanBeDecorated(node)) { + return; + } + if (compilerOptions.emitDecoratorMetadata) { + switch (node.kind) { + case 201: + var constructor = ts.getFirstConstructorWithBody(node); + if (constructor) { + checkParameterTypeAnnotationsAsExpressions(constructor); + } + break; + case 134: + checkParameterTypeAnnotationsAsExpressions(node); + case 137: + case 136: + case 132: + case 129: + checkTypeAnnotationAsExpression(node); + break; + } + } + emitDecorate = true; + if (node.kind === 129) { + emitParam = true; } ts.forEach(node.decorators, checkDecorator); } @@ -15276,6 +15505,7 @@ var ts; } } function checkFunctionLikeDeclaration(node) { + checkGrammarDeclarationNameInStrictMode(node); checkDecorators(node); checkSignatureDeclaration(node); if (node.name && node.name.kind === 127) { @@ -15295,8 +15525,8 @@ var ts; } } checkSourceElement(node.body); - if (node.type && !isAccessor(node.kind)) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type)); + if (node.type && !isAccessor(node.kind) && !node.asteriskToken) { + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); } if (compilerOptions.noImplicitAny && ts.nodeIsMissing(node.body) && !node.type && !isPrivateWithinAmbient(node)) { reportImplicitAnyError(node, anyType); @@ -15461,6 +15691,7 @@ var ts; } } function checkVariableLikeDeclaration(node) { + checkGrammarDeclarationNameInStrictMode(node); checkDecorators(node); checkSourceElement(node.type); if (node.name.kind === 127) { @@ -15635,21 +15866,35 @@ var ts; } function checkRightHandSideOfForOf(rhsExpression) { var expressionType = getTypeOfExpression(rhsExpression); - return languageVersion >= 2 - ? checkIteratedType(expressionType, rhsExpression) - : checkElementTypeOfArrayOrString(expressionType, rhsExpression); + return checkIteratedTypeOrElementType(expressionType, rhsExpression, true); } - function checkIteratedType(iterable, expressionForError) { + function checkIteratedTypeOrElementType(inputType, errorNode, allowStringInput) { + if (inputType.flags & 1) { + return inputType; + } + if (languageVersion >= 2) { + return checkIteratedType(inputType, errorNode) || anyType; + } + if (allowStringInput) { + return checkElementTypeOfArrayOrString(inputType, errorNode); + } + if (isArrayLikeType(inputType)) { + var indexType = getIndexTypeOfType(inputType, 1); + if (indexType) { + return indexType; + } + } + error(errorNode, ts.Diagnostics.Type_0_is_not_an_array_type, typeToString(inputType)); + return unknownType; + } + function checkIteratedType(iterable, errorNode) { ts.Debug.assert(languageVersion >= 2); - var iteratedType = getIteratedType(iterable, expressionForError); - if (expressionForError && iteratedType) { - var completeIterableType = globalIterableType !== emptyObjectType - ? createTypeReference(globalIterableType, [iteratedType]) - : emptyObjectType; - checkTypeAssignableTo(iterable, completeIterableType, expressionForError); + var iteratedType = getIteratedType(iterable, errorNode); + if (errorNode && iteratedType) { + checkTypeAssignableTo(iterable, createIterableType(iteratedType), errorNode); } return iteratedType; - function getIteratedType(iterable, expressionForError) { + function getIteratedType(iterable, errorNode) { // 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): // @@ -15678,14 +15923,17 @@ var ts; if (allConstituentTypesHaveKind(iterable, 1)) { return undefined; } + if ((iterable.flags & 4096) && iterable.target === globalIterableType) { + return iterable.typeArguments[0]; + } var iteratorFunction = getTypeOfPropertyOfType(iterable, ts.getPropertyNameForKnownSymbolName("iterator")); if (iteratorFunction && allConstituentTypesHaveKind(iteratorFunction, 1)) { return undefined; } var iteratorFunctionSignatures = iteratorFunction ? getSignaturesOfType(iteratorFunction, 0) : emptyArray; if (iteratorFunctionSignatures.length === 0) { - if (expressionForError) { - error(expressionForError, ts.Diagnostics.The_right_hand_side_of_a_for_of_statement_must_have_a_Symbol_iterator_method_that_returns_an_iterator); + if (errorNode) { + error(errorNode, ts.Diagnostics.Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator); } return undefined; } @@ -15699,8 +15947,8 @@ var ts; } var iteratorNextFunctionSignatures = iteratorNextFunction ? getSignaturesOfType(iteratorNextFunction, 0) : emptyArray; if (iteratorNextFunctionSignatures.length === 0) { - if (expressionForError) { - error(expressionForError, ts.Diagnostics.The_iterator_returned_by_the_right_hand_side_of_a_for_of_statement_must_have_a_next_method); + if (errorNode) { + error(errorNode, ts.Diagnostics.An_iterator_must_have_a_next_method); } return undefined; } @@ -15710,22 +15958,22 @@ var ts; } var iteratorNextValue = getTypeOfPropertyOfType(iteratorNextResult, "value"); if (!iteratorNextValue) { - if (expressionForError) { - error(expressionForError, ts.Diagnostics.The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property); + if (errorNode) { + error(errorNode, ts.Diagnostics.The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property); } return undefined; } return iteratorNextValue; } } - function checkElementTypeOfArrayOrString(arrayOrStringType, expressionForError) { + function checkElementTypeOfArrayOrString(arrayOrStringType, errorNode) { ts.Debug.assert(languageVersion < 2); var arrayType = removeTypesFromUnionType(arrayOrStringType, 258, true, true); var hasStringConstituent = arrayOrStringType !== arrayType; var reportedError = false; if (hasStringConstituent) { if (languageVersion < 1) { - error(expressionForError, ts.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); + error(errorNode, ts.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); reportedError = true; } if (arrayType === emptyObjectType) { @@ -15737,7 +15985,7 @@ var ts; 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)); + error(errorNode, diagnostic, typeToString(arrayType)); } return hasStringConstituent ? stringType : unknownType; } @@ -15908,7 +16156,7 @@ 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(getBaseTypes(type), function (base) { return getIndexTypeOfType(base, 0) && getIndexTypeOfType(base, 1); }); errorNode = someBaseTypeHasBothIndexers ? undefined : type.symbol.declarations[0]; } } @@ -15930,7 +16178,7 @@ var ts; errorNode = indexDeclaration; } else if (containingType.flags & 2048) { - var someBaseClassHasBothPropertyAndIndexer = ts.forEach(containingType.baseTypes, function (base) { return getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind); }); + var someBaseClassHasBothPropertyAndIndexer = ts.forEach(getBaseTypes(containingType), function (base) { return getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind); }); errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : containingType.symbol.declarations[0]; } if (errorNode && !isTypeAssignableTo(propertyType, indexType)) { @@ -15973,9 +16221,13 @@ var ts; return unknownType; } function checkClassDeclaration(node) { + checkGrammarDeclarationNameInStrictMode(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); } + if (!node.name && !(node.flags & 256)) { + grammarErrorOnFirstToken(node, ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name); + } checkGrammarClassDeclarationHeritageClauses(node); checkDecorators(node); if (node.name) { @@ -15996,9 +16248,10 @@ var ts; emitExtends = emitExtends || !ts.isInAmbientContext(node); checkHeritageClauseElement(baseTypeNode); } - if (type.baseTypes.length) { + var baseTypes = getBaseTypes(type); + if (baseTypes.length) { if (produceDiagnostics) { - var baseType = type.baseTypes[0]; + var baseType = baseTypes[0]; 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); @@ -16008,7 +16261,7 @@ var ts; checkKindsOfPropertyMemberOverrides(type, baseType); } } - if (type.baseTypes.length || (baseTypeNode && compilerOptions.separateCompilation)) { + if (baseTypes.length || (baseTypeNode && compilerOptions.separateCompilation)) { checkExpressionOrQualifiedName(baseTypeNode.expression); } var implementedTypeNodes = ts.getClassImplementsHeritageClauseElements(node); @@ -16120,24 +16373,25 @@ var ts; if (!tp1.constraint || !tp2.constraint) { return false; } - if (!isTypeIdenticalTo(getTypeFromTypeNodeOrHeritageClauseElement(tp1.constraint), getTypeFromTypeNodeOrHeritageClauseElement(tp2.constraint))) { + if (!isTypeIdenticalTo(getTypeFromTypeNode(tp1.constraint), getTypeFromTypeNode(tp2.constraint))) { return false; } } return true; } function checkInheritedPropertiesAreIdentical(type, typeNode) { - if (!type.baseTypes.length || type.baseTypes.length === 1) { + var baseTypes = getBaseTypes(type); + if (baseTypes.length < 2) { return true; } 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; _i < _a.length; _i++) { - var base = _a[_i]; + for (var _i = 0; _i < baseTypes.length; _i++) { + var base = baseTypes[_i]; var properties = getPropertiesOfObjectType(base); - for (var _b = 0; _b < properties.length; _b++) { - var prop = properties[_b]; + for (var _a = 0; _a < properties.length; _a++) { + var prop = properties[_a]; if (!ts.hasProperty(seen, prop.name)) { seen[prop.name] = { prop: prop, containingType: base }; } @@ -16158,7 +16412,7 @@ var ts; return ok; } function checkInterfaceDeclaration(node) { - checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarInterfaceDeclaration(node); + checkGrammarDeclarationNameInStrictMode(node) || checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarInterfaceDeclaration(node); checkTypeParameters(node.typeParameters); if (produceDiagnostics) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); @@ -16173,7 +16427,7 @@ var ts; if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); if (checkInheritedPropertiesAreIdentical(type, node.name)) { - ts.forEach(type.baseTypes, function (baseType) { + ts.forEach(getBaseTypes(type), function (baseType) { checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1); }); checkIndexConstraints(type); @@ -16344,7 +16598,7 @@ var ts; if (!produceDiagnostics) { return; } - checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarEnumDeclaration(node); + checkGrammarDeclarationNameInStrictMode(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); @@ -16389,15 +16643,30 @@ var ts; var declarations = symbol.declarations; for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; - if ((declaration.kind === 201 || (declaration.kind === 200 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { + if ((declaration.kind === 201 || + (declaration.kind === 200 && ts.nodeIsPresent(declaration.body))) && + !ts.isInAmbientContext(declaration)) { return declaration; } } return undefined; } + function inSameLexicalScope(node1, node2) { + var container1 = ts.getEnclosingBlockScopeContainer(node1); + var container2 = ts.getEnclosingBlockScopeContainer(node2); + if (isGlobalSourceFile(container1)) { + return isGlobalSourceFile(container2); + } + else if (isGlobalSourceFile(container2)) { + return false; + } + else { + return container1 === container2; + } + } function checkModuleDeclaration(node) { if (produceDiagnostics) { - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node)) { + if (!checkGrammarDeclarationNameInStrictMode(node) && !checkGrammarDecorators(node) && !checkGrammarModifiers(node)) { if (!ts.isInAmbientContext(node) && node.name.kind === 8) { grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names); } @@ -16410,15 +16679,20 @@ var ts; && 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)) { + var firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); + if (firstNonAmbientClassOrFunc) { + if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(firstNonAmbientClassOrFunc)) { error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); } - else if (node.pos < classOrFunc.pos) { + else if (node.pos < firstNonAmbientClassOrFunc.pos) { error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); } } + var mergedClass = ts.getDeclarationOfKind(symbol, 201); + if (mergedClass && + inSameLexicalScope(node, mergedClass)) { + getNodeLinks(node).flags |= 2048; + } } if (node.name.kind === 8) { if (!isGlobalSourceFile(node.parent)) { @@ -16486,7 +16760,7 @@ var ts; checkAliasSymbol(node); } function checkImportDeclaration(node) { - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) { + if (!checkGrammarImportDeclarationNameInStrictMode(node) && !checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_import_declaration_cannot_have_modifiers); } if (checkExternalImportOrExportDeclaration(node)) { @@ -16507,7 +16781,7 @@ var ts; } } function checkImportEqualsDeclaration(node) { - checkGrammarDecorators(node) || checkGrammarModifiers(node); + checkGrammarDeclarationNameInStrictMode(node) || checkGrammarDecorators(node) || checkGrammarModifiers(node); if (ts.isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) { checkImportBinding(node); if (node.flags & 1) { @@ -16569,19 +16843,11 @@ var ts; if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_assignment_cannot_have_modifiers); } - if (node.expression) { - if (node.expression.kind === 65) { - markExportAsReferenced(node); - } - else { - checkExpressionCached(node.expression); - } + if (node.expression.kind === 65) { + markExportAsReferenced(node); } - 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); - } + else { + checkExpressionCached(node.expression); } checkExternalModuleExports(container); if (node.isExportEquals && languageVersion >= 2) { @@ -16816,6 +17082,8 @@ var ts; if (!(links.flags & 1)) { checkGrammarSourceFile(node); emitExtends = false; + emitDecorate = false; + emitParam = false; potentialThisCollisions.length = 0; ts.forEach(node.statements, checkSourceElement); checkFunctionExpressionBodies(node); @@ -16832,6 +17100,9 @@ var ts; if (emitDecorate) { links.flags |= 512; } + if (emitParam) { + links.flags |= 1024; + } links.flags |= 1; } } @@ -16986,7 +17257,7 @@ var ts; } return node.parent && node.parent.kind === 177; } - function isTypeNodeOrHeritageClauseElement(node) { + function isTypeNode(node) { if (141 <= node.kind && node.kind <= 149) { return true; } @@ -17178,8 +17449,8 @@ var ts; if (isInsideWithStatementBody(node)) { return unknownType; } - if (isTypeNodeOrHeritageClauseElement(node)) { - return getTypeFromTypeNodeOrHeritageClauseElement(node); + if (isTypeNode(node)) { + return getTypeFromTypeNode(node); } if (ts.isExpression(node)) { return getTypeOfExpression(node); @@ -17252,7 +17523,14 @@ var ts; var node = getDeclarationOfAliasSymbol(symbol); if (node) { if (node.kind === 210) { - return getGeneratedNameForNode(node.parent) + ".default"; + var defaultKeyword; + if (languageVersion === 0) { + defaultKeyword = "[\"default\"]"; + } + else { + defaultKeyword = ".default"; + } + return getGeneratedNameForNode(node.parent) + defaultKeyword; } if (node.kind === 213) { var moduleName = getGeneratedNameForNode(node.parent.parent.parent); @@ -17365,6 +17643,150 @@ var ts; } return undefined; } + function serializeEntityName(node, getGeneratedNameForNode, fallbackPath) { + if (node.kind === 65) { + 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; + } + } + } + function serializeTypeReferenceNode(node, getGeneratedNameForNode) { + var type = getTypeFromTypeReference(node); + if (type.flags & 16) { + return "void 0"; + } + else if (type.flags & 8) { + return "Boolean"; + } + else if (type.flags & 132) { + return "Number"; + } + else if (type.flags & 258) { + return "String"; + } + else if (type.flags & 8192) { + return "Array"; + } + else if (type.flags & 1048576) { + return "Symbol"; + } + else if (type === unknownType) { + var fallbackPath = []; + 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"; + } + function serializeTypeNode(node, getGeneratedNameForNode) { + if (node) { + switch (node.kind) { + case 99: + return "void 0"; + case 149: + return serializeTypeNode(node.type, getGeneratedNameForNode); + case 142: + case 143: + return "Function"; + case 146: + case 147: + return "Array"; + case 113: + return "Boolean"; + case 121: + case 8: + return "String"; + case 119: + return "Number"; + case 141: + return serializeTypeReferenceNode(node, getGeneratedNameForNode); + case 144: + case 145: + case 148: + case 112: + break; + default: + ts.Debug.fail("Cannot serialize unexpected type node."); + break; + } + } + return "Object"; + } + function serializeTypeOfNode(node, getGeneratedNameForNode) { + switch (node.kind) { + case 201: return "Function"; + case 132: return serializeTypeNode(node.type, getGeneratedNameForNode); + case 129: return serializeTypeNode(node.type, getGeneratedNameForNode); + case 136: return serializeTypeNode(node.type, getGeneratedNameForNode); + case 137: return serializeTypeNode(getSetAccessorTypeAnnotationNode(node), getGeneratedNameForNode); + } + if (ts.isFunctionLike(node)) { + return "Function"; + } + return "void 0"; + } + function serializeParameterTypesOfNode(node, getGeneratedNameForNode) { + if (node) { + var valueDeclaration; + if (node.kind === 201) { + valueDeclaration = ts.getFirstConstructorWithBody(node); + } + else if (ts.isFunctionLike(node) && ts.nodeIsPresent(node.body)) { + valueDeclaration = node; + } + if (valueDeclaration) { + var result; + 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 === 146) { + parameterType = parameterType.elementType; + } + else if (parameterType.kind === 141 && 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; + } + function serializeReturnTypeOfNode(node, getGeneratedNameForNode) { + if (node && ts.isFunctionLike(node)) { + return serializeTypeNode(node.type, getGeneratedNameForNode); + } + return "void 0"; + } function writeTypeOfDeclaration(declaration, enclosingDeclaration, flags, writer) { var symbol = getSymbolOfNode(declaration); var type = symbol && !(symbol.flags & (2048 | 131072)) @@ -17431,7 +17853,10 @@ var ts; getConstantValue: getConstantValue, resolvesToSomeValue: resolvesToSomeValue, collectLinkedAliases: collectLinkedAliases, - getBlockScopedVariableId: getBlockScopedVariableId + getBlockScopedVariableId: getBlockScopedVariableId, + serializeTypeOfNode: serializeTypeOfNode, + serializeParameterTypesOfNode: serializeParameterTypesOfNode, + serializeReturnTypeOfNode: serializeReturnTypeOfNode }; } function initializeTypeChecker() { @@ -17473,20 +17898,119 @@ var ts; } anyArrayType = createArrayType(anyType); } + function isReservedWordInStrictMode(node) { + return (node.parserContextFlags & 1) && + (node.originalKeywordKind >= 102 && node.originalKeywordKind <= 110); + } + function reportStrictModeGrammarErrorInClassDeclaration(identifier, message, arg0, arg1, arg2) { + if (ts.getAncestor(identifier, 201) || ts.getAncestor(identifier, 174)) { + return grammarErrorOnNode(identifier, message, arg0); + } + return false; + } + function checkGrammarImportDeclarationNameInStrictMode(node) { + if (node.importClause) { + var impotClause = node.importClause; + if (impotClause.namedBindings) { + var nameBindings = impotClause.namedBindings; + if (nameBindings.kind === 211) { + var name_11 = nameBindings.name; + if (name_11.originalKeywordKind) { + var nameText = ts.declarationNameToString(name_11); + return grammarErrorOnNode(name_11, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); + } + } + else if (nameBindings.kind === 212) { + var reportError = false; + for (var _i = 0, _a = nameBindings.elements; _i < _a.length; _i++) { + var element = _a[_i]; + var name_12 = element.name; + if (name_12.originalKeywordKind) { + var nameText = ts.declarationNameToString(name_12); + reportError = reportError || grammarErrorOnNode(name_12, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); + } + } + return reportError; + } + } + } + return false; + } + function checkGrammarDeclarationNameInStrictMode(node) { + var name = node.name; + if (name && name.kind === 65 && isReservedWordInStrictMode(name)) { + var nameText = ts.declarationNameToString(name); + switch (node.kind) { + case 129: + case 198: + case 200: + case 128: + case 152: + case 202: + case 203: + case 204: + return checkGrammarIdentifierInStrictMode(name); + case 201: + return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText); + case 205: + return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); + case 208: + return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); + } + } + return false; + } + function checkGrammarTypeReferenceInStrictMode(typeName) { + if (typeName.kind === 65) { + checkGrammarTypeNameInStrictMode(typeName); + } + else if (typeName.kind === 126) { + checkGrammarTypeNameInStrictMode(typeName.right); + checkGrammarTypeReferenceInStrictMode(typeName.left); + } + } + function checkGrammarHeritageClauseElementInStrictMode(expression) { + if (expression && expression.kind === 65) { + return checkGrammarIdentifierInStrictMode(expression); + } + else if (expression && expression.kind === 155) { + checkGrammarHeritageClauseElementInStrictMode(expression.expression); + } + } + function checkGrammarIdentifierInStrictMode(node, nameText) { + if (node && node.kind === 65 && isReservedWordInStrictMode(node)) { + if (!nameText) { + nameText = ts.declarationNameToString(node); + } + var errorReport = reportStrictModeGrammarErrorInClassDeclaration(node, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText) || + grammarErrorOnNode(node, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); + return errorReport; + } + return false; + } + function checkGrammarTypeNameInStrictMode(node) { + if (node && node.kind === 65 && isReservedWordInStrictMode(node)) { + var nameText = ts.declarationNameToString(node); + var errorReport = reportStrictModeGrammarErrorInClassDeclaration(node, ts.Diagnostics.Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText) || + grammarErrorOnNode(node, ts.Diagnostics.Type_expected_0_is_a_reserved_word_in_strict_mode, nameText); + return errorReport; + } + return false; + } function checkGrammarDecorators(node) { if (!node.decorators) { return false; } if (!ts.nodeCanBeDecorated(node)) { - return grammarErrorOnNode(node, ts.Diagnostics.Decorators_are_not_valid_here); + return grammarErrorOnFirstToken(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); + return grammarErrorOnFirstToken(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 grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); } } return false; @@ -17525,14 +18049,14 @@ var ts; 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 === 109) { + if (modifier.kind === 108) { text = "public"; } - else if (modifier.kind === 108) { + else if (modifier.kind === 107) { text = "protected"; lastProtected = modifier; } @@ -17551,7 +18075,7 @@ var ts; } flags |= ts.modifierToFlag(modifier.kind); break; - case 110: + case 109: if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static"); } @@ -17648,6 +18172,9 @@ var ts; if (i !== (parameterCount - 1)) { return grammarErrorOnNode(parameter.dotDotDotToken, ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); } + if (ts.isBindingPattern(parameter.name)) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); + } if (parameter.questionToken) { return grammarErrorOnNode(parameter.questionToken, ts.Diagnostics.A_rest_parameter_cannot_be_optional); } @@ -17781,7 +18308,7 @@ var ts; seenExtendsClause = true; } else { - ts.Debug.assert(heritageClause.token === 103); + ts.Debug.assert(heritageClause.token === 102); if (seenImplementsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.implements_clause_already_seen); } @@ -17803,7 +18330,7 @@ var ts; seenExtendsClause = true; } else { - ts.Debug.assert(heritageClause.token === 103); + ts.Debug.assert(heritageClause.token === 102); return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.Interface_declaration_cannot_have_implements_clause); } checkGrammarHeritageClause(heritageClause); @@ -17842,17 +18369,17 @@ var ts; var inStrictMode = (node.parserContextFlags & 1) !== 0; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - var name_11 = prop.name; + var name_13 = prop.name; if (prop.kind === 175 || - name_11.kind === 127) { - checkGrammarComputedPropertyName(name_11); + name_13.kind === 127) { + checkGrammarComputedPropertyName(name_13); continue; } var currentKind = void 0; if (prop.kind === 224 || prop.kind === 225) { checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); - if (name_11.kind === 7) { - checkGrammarNumbericLiteral(name_11); + if (name_13.kind === 7) { + checkGrammarNumericLiteral(name_13); } currentKind = Property; } @@ -17868,26 +18395,26 @@ var ts; else { ts.Debug.fail("Unexpected syntax kind:" + prop.kind); } - if (!ts.hasProperty(seen, name_11.text)) { - seen[name_11.text] = currentKind; + if (!ts.hasProperty(seen, name_13.text)) { + seen[name_13.text] = currentKind; } else { - var existingKind = seen[name_11.text]; + var existingKind = seen[name_13.text]; if (currentKind === Property && existingKind === Property) { if (inStrictMode) { - grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); + grammarErrorOnNode(name_13, 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_11.text] = currentKind | existingKind; + seen[name_13.text] = currentKind | existingKind; } else { - return grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + return grammarErrorOnNode(name_13, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); } } else { - return grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + return grammarErrorOnNode(name_13, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); } } } @@ -18062,6 +18589,9 @@ var ts; if (node !== elements[elements.length - 1]) { return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); } + if (node.name.kind === 151 || node.name.kind === 150) { + return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); + } if (node.initializer) { return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.initializer.pos - 1, 1, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } @@ -18099,7 +18629,9 @@ var ts; var elements = name.elements; for (var _i = 0; _i < elements.length; _i++) { var element = elements[_i]; - checkGrammarNameInLetOrConstDeclarations(element.name); + if (element.kind !== 175) { + checkGrammarNameInLetOrConstDeclarations(element.name); + } } } } @@ -18202,12 +18734,20 @@ var ts; function checkGrammarEvalOrArgumentsInStrictMode(contextNode, name) { if (name && name.kind === 65) { var identifier = name; - if (contextNode && (contextNode.parserContextFlags & 1) && ts.isEvalOrArgumentsIdentifier(identifier)) { + if (contextNode && (contextNode.parserContextFlags & 1) && isEvalOrArgumentsIdentifier(identifier)) { var nameText = ts.declarationNameToString(identifier); - return grammarErrorOnNode(identifier, ts.Diagnostics.Invalid_use_of_0_in_strict_mode, nameText); + var reportErrorInClassDeclaration = reportStrictModeGrammarErrorInClassDeclaration(identifier, ts.Diagnostics.Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode, nameText); + if (!reportErrorInClassDeclaration) { + return grammarErrorOnNode(identifier, ts.Diagnostics.Invalid_use_of_0_in_strict_mode, nameText); + } + return reportErrorInClassDeclaration; } } } + function isEvalOrArgumentsIdentifier(node) { + return node.kind === 65 && + (node.text === "eval" || node.text === "arguments"); + } function checkGrammarConstructorTypeParameters(node) { if (node.typeParameters) { return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); @@ -18283,7 +18823,7 @@ var ts; } } } - function checkGrammarNumbericLiteral(node) { + function checkGrammarNumericLiteral(node) { if (node.flags & 16384) { if (node.parserContextFlags & 1) { return grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode); @@ -18646,20 +19186,35 @@ var ts; enclosingDeclaration = node; emitLines(node.statements); } + function getExportDefaultTempVariableName() { + var baseName = "_default"; + if (!ts.hasProperty(currentSourceFile.identifiers, baseName)) { + return baseName; + } + var count = 0; + while (true) { + var name_14 = baseName + "_" + (++count); + if (!ts.hasProperty(currentSourceFile.identifiers, name_14)) { + return name_14; + } + } + } function emitExportAssignment(node) { - write(node.isExportEquals ? "export = " : "export default "); if (node.expression.kind === 65) { + write(node.isExportEquals ? "export = " : "export default "); writeTextOfNode(currentSourceFile, node.expression); } else { + var tempVarName = getExportDefaultTempVariableName(); + write("declare var "); + write(tempVarName); write(": "); - if (node.type) { - emitType(node.type); - } - else { - writer.getSymbolAccessibilityDiagnostic = getDefaultExportAccessibilityDiagnostic; - resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, 2, writer); - } + writer.getSymbolAccessibilityDiagnostic = getDefaultExportAccessibilityDiagnostic; + resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, 2, writer); + write(";"); + writeLine(); + write(node.isExportEquals ? "export = " : "export default "); + write(tempVarName); } write(";"); writeLine(); @@ -19600,6 +20155,10 @@ var ts; } ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; function emitFiles(resolver, host, targetSourceFile) { + var extendsHelper = "\nvar __extends = this.__extends || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n __.prototype = b.prototype;\n d.prototype = new __();\n};"; + var decorateHelper = "\nvar __decorate = this.__decorate || (typeof Reflect === \"object\" && Reflect.decorate) || function (decorators, target, key, desc) {\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};"; + var metadataHelper = "\nvar __metadata = this.__metadata || (typeof Reflect === \"object\" && Reflect.metadata) || function () { };"; + var paramHelper = "\nvar __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } };"; var compilerOptions = host.getCompilerOptions(); var languageVersion = compilerOptions.target || 0; var sourceMapDataList = compilerOptions.sourceMap ? [] : undefined; @@ -19663,6 +20222,7 @@ var ts; var computedPropertyNamesToGeneratedNames; var extendsEmitted = false; var decorateEmitted = false; + var paramEmitted = false; var tempFlags = 0; var tempVariables; var tempParameters; @@ -19717,9 +20277,9 @@ var ts; 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; + var name_15 = count < 26 ? "_" + String.fromCharCode(97 + count) : "_" + (count - 26); + if (isUniqueName(name_15)) { + return name_15; } } } @@ -19747,8 +20307,8 @@ var ts; } 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)); + var name_16 = node.name.text; + assignGeneratedName(node, isUniqueLocalName(name_16, node) ? name_16 : makeUniqueName(name_16)); } } function generateNameForImportOrExportDeclaration(node) { @@ -19776,6 +20336,7 @@ var ts; switch (node.kind) { case 200: case 201: + case 174: generateNameForFunctionOrClassDeclaration(node); break; case 205: @@ -19927,8 +20488,8 @@ var ts; if (scopeName) { var parentIndex = getSourceMapNameIndex(); if (parentIndex !== -1) { - var name_14 = node.name; - if (!name_14 || name_14.kind !== 127) { + var name_17 = node.name; + if (!name_17 || name_17.kind !== 127) { scopeName = "." + scopeName; } scopeName = sourceMapData.sourceMapNames[parentIndex] + scopeName; @@ -19955,9 +20516,9 @@ var ts; node.kind === 201 || node.kind === 204) { if (node.name) { - var name_15 = node.name; - scopeName = name_15.kind === 127 - ? ts.getTextOfNode(name_15) + var name_18 = node.name; + scopeName = name_18.kind === 127 + ? ts.getTextOfNode(name_18) : node.name.text; } recordScopeNameStart(scopeName); @@ -20159,27 +20720,32 @@ var ts; writeLine(); } } - function emitList(nodes, start, count, multiLine, trailingComma) { + function emitList(nodes, start, count, multiLine, trailingComma, leadingComma, noTrailingNewLine, emitNode) { + if (!emitNode) { + emitNode = emit; + } for (var 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) { if (nodes) { @@ -20365,6 +20931,7 @@ var ts; default: return -1; } + case 172: case 170: return -1; default: @@ -20386,15 +20953,13 @@ var ts; if (!computedPropertyNamesToGeneratedNames) { computedPropertyNamesToGeneratedNames = []; } - var generatedName = computedPropertyNamesToGeneratedNames[node.id]; + var generatedName = computedPropertyNamesToGeneratedNames[ts.getNodeId(node)]; if (generatedName) { write(generatedName); return; } - var generatedVariable = createTempVariable(0); - generatedName = generatedVariable.text; - recordTempDeclaration(generatedVariable); - computedPropertyNamesToGeneratedNames[node.id] = generatedName; + generatedName = createAndRecordTempVariable(0).text; + computedPropertyNamesToGeneratedNames[ts.getNodeId(node)] = generatedName; write(generatedName); write(" = "); } @@ -20538,6 +21103,16 @@ var ts; write("..."); emit(node.expression); } + function emitYieldExpression(node) { + write(ts.tokenToString(110)); + if (node.asteriskToken) { + write("*"); + } + if (node.expression) { + write(" "); + emit(node.expression); + } + } function needsParenthesisForPropertyAccessOrInvocation(node) { switch (node.kind) { case 65: @@ -20606,147 +21181,133 @@ var ts; emitListWithSpread(elements, (node.flags & 512) !== 0, elements.hasTrailingComma); } } - function emitDownlevelObjectLiteralWithComputedProperties(node, firstComputedPropertyIndex) { - var parenthesizedObjectLiteral = createDownlevelObjectLiteralWithComputedProperties(node, firstComputedPropertyIndex); - return emit(parenthesizedObjectLiteral); - } - function createDownlevelObjectLiteralWithComputedProperties(originalObjectLiteral, firstComputedPropertyIndex) { - var tempVar = createAndRecordTempVariable(0); - var initialObjectLiteral = ts.createSynthesizedNode(154); - initialObjectLiteral.properties = originalObjectLiteral.properties.slice(0, firstComputedPropertyIndex); - initialObjectLiteral.flags |= 512; - var propertyPatches = createBinaryExpression(tempVar, 53, initialObjectLiteral); - ts.forEach(originalObjectLiteral.properties, function (property) { - var patchedProperty = tryCreatePatchingPropertyAssignment(originalObjectLiteral, tempVar, property); - if (patchedProperty) { - propertyPatches = createBinaryExpression(propertyPatches, 23, patchedProperty); + function emitObjectLiteralBody(node, numElements) { + if (numElements === 0) { + write("{}"); + return; + } + write("{"); + if (numElements > 0) { + var properties = node.properties; + if (numElements === properties.length) { + emitLinePreservingList(node, properties, languageVersion >= 1, true); } - }); - propertyPatches = createBinaryExpression(propertyPatches, 23, createIdentifier(tempVar.text, true)); - var result = createParenthesizedExpression(propertyPatches); - return result; - } - function addCommentsToSynthesizedNode(node, leadingCommentRanges, trailingCommentRanges) { - node.leadingCommentRanges = leadingCommentRanges; - node.trailingCommentRanges = trailingCommentRanges; - } - function tryCreatePatchingPropertyAssignment(objectLiteral, tempVar, property) { - var leftHandSide = createMemberAccessForPropertyName(tempVar, property.name); - var maybeRightHandSide = tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral, property); - return maybeRightHandSide && createBinaryExpression(leftHandSide, 53, maybeRightHandSide, true); - } - function tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral, property) { - switch (property.kind) { - case 224: - return property.initializer; - case 225: - return createIdentifier(resolver.getExpressionNameSubstitution(property.name, getGeneratedNameForNode)); - case 134: - 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; + else { + var multiLine = (node.flags & 512) !== 0; + if (!multiLine) { + write(" "); } - var propertyDescriptor = ts.createSynthesizedNode(154); - var descriptorProperties = []; - if (getAccessor) { - var getProperty_1 = createPropertyAssignment(createIdentifier("get"), createFunctionExpression(getAccessor.parameters, getAccessor.body)); - descriptorProperties.push(getProperty_1); + else { + increaseIndent(); } - if (setAccessor) { - var setProperty = createPropertyAssignment(createIdentifier("set"), createFunctionExpression(setAccessor.parameters, setAccessor.body)); - descriptorProperties.push(setProperty); + emitList(properties, 0, numElements, multiLine, false); + if (!multiLine) { + write(" "); } - var trueExpr = ts.createSynthesizedNode(95); - var enumerableTrue = createPropertyAssignment(createIdentifier("enumerable"), trueExpr); - descriptorProperties.push(enumerableTrue); - var configurableTrue = createPropertyAssignment(createIdentifier("configurable"), trueExpr); - descriptorProperties.push(configurableTrue); - propertyDescriptor.properties = descriptorProperties; - var objectDotDefineProperty = createPropertyAccessExpression(createIdentifier("Object"), createIdentifier("defineProperty")); - return createCallExpression(objectDotDefineProperty, createNodeArray(propertyDescriptor)); - default: - ts.Debug.fail("ObjectLiteralElement kind " + property.kind + " not accounted for."); + else { + decreaseIndent(); + } + } } + write("}"); } - function createParenthesizedExpression(expression) { - var result = ts.createSynthesizedNode(161); - result.expression = expression; - return result; - } - function createNodeArray() { - var elements = []; - for (var _a = 0; _a < arguments.length; _a++) { - elements[_a - 0] = arguments[_a]; + function emitDownlevelObjectLiteralWithComputedProperties(node, firstComputedPropertyIndex) { + var multiLine = (node.flags & 512) !== 0; + var properties = node.properties; + write("("); + if (multiLine) { + increaseIndent(); } - var result = elements; - result.pos = -1; - result.end = -1; - return result; - } - function createBinaryExpression(left, operator, right, 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(182); - result.expression = expression; - return result; - } - function createMemberAccessForPropertyName(expression, memberName) { - if (memberName.kind === 65) { - return createPropertyAccessExpression(expression, memberName); + var tempVar = createAndRecordTempVariable(0); + emit(tempVar); + write(" = "); + emitObjectLiteralBody(node, firstComputedPropertyIndex); + for (var i = firstComputedPropertyIndex, n = properties.length; i < n; i++) { + writeComma(); + var property = properties[i]; + emitStart(property); + if (property.kind === 136 || property.kind === 137) { + var accessors = ts.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); + write(" = "); + if (property.kind === 224) { + emit(property.initializer); + } + else if (property.kind === 225) { + emitExpressionIdentifier(property.name); + } + else if (property.kind === 134) { + emitFunctionDeclaration(property); + } + else { + ts.Debug.fail("ObjectLiteralElement type not accounted for: " + property.kind); + } + } + emitEnd(property); } - else if (memberName.kind === 8 || memberName.kind === 7) { - return createElementAccessExpression(expression, memberName); + writeComma(); + emit(tempVar); + if (multiLine) { + decreaseIndent(); + writeLine(); } - else if (memberName.kind === 127) { - return createElementAccessExpression(expression, memberName.expression); + write(")"); + function writeComma() { + if (multiLine) { + write(","); + writeLine(); + } + else { + write(", "); + } } - else { - ts.Debug.fail("Kind '" + memberName.kind + "' not accounted for."); - } - } - function createPropertyAssignment(name, initializer) { - var result = ts.createSynthesizedNode(224); - result.name = name; - result.initializer = initializer; - return result; - } - function createFunctionExpression(parameters, body) { - var result = ts.createSynthesizedNode(162); - result.parameters = parameters; - result.body = body; - return result; - } - function createPropertyAccessExpression(expression, name) { - 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(156); - result.expression = expression; - result.argumentExpression = argumentExpression; - return result; - } - function createIdentifier(name, startsOnNewLine) { - var result = ts.createSynthesizedNode(65, startsOnNewLine); - result.text = name; - return result; - } - function createCallExpression(invokedExpression, arguments) { - var result = ts.createSynthesizedNode(157); - result.expression = invokedExpression; - result.arguments = arguments; - return result; } function emitObjectLiteral(node) { var properties = node.properties; @@ -20765,11 +21326,35 @@ var ts; return; } } - write("{"); - if (properties.length) { - emitLinePreservingList(node, properties, languageVersion >= 1, true); + emitObjectLiteralBody(node, properties.length); + } + function createBinaryExpression(left, operator, right, startsOnNewLine) { + var result = ts.createSynthesizedNode(169, startsOnNewLine); + result.operatorToken = ts.createSynthesizedNode(operator); + result.left = left; + result.right = right; + return result; + } + function createPropertyAccessExpression(expression, name) { + var result = ts.createSynthesizedNode(155); + result.expression = parenthesizeForAccess(expression); + result.dotToken = ts.createSynthesizedNode(20); + result.name = name; + return result; + } + function createElementAccessExpression(expression, argumentExpression) { + var result = ts.createSynthesizedNode(156); + result.expression = parenthesizeForAccess(expression); + result.argumentExpression = argumentExpression; + return result; + } + function parenthesizeForAccess(expr) { + if (ts.isLeftHandSideExpression(expr) && expr.kind !== 158 && expr.kind !== 7) { + return expr; } - write("}"); + var node = ts.createSynthesizedNode(161); + node.expression = expr; + return node; } function emitComputedPropertyName(node) { write("["); @@ -20777,6 +21362,9 @@ var ts; write("]"); } function emitMethod(node) { + if (languageVersion >= 2 && node.asteriskToken) { + write("*"); + } emit(node.name, false); if (languageVersion < 2) { write(": function "); @@ -21148,7 +21736,7 @@ var ts; var tokenKind = 98; if (decl && languageVersion >= 2) { if (ts.isLet(decl)) { - tokenKind = 105; + tokenKind = 104; } else if (ts.isConst(decl)) { tokenKind = 70; @@ -21161,7 +21749,7 @@ var ts; switch (tokenKind) { case 98: return write("var "); - case 105: + case 104: return write("let "); case 70: return write("const "); @@ -21299,7 +21887,7 @@ var ts; else { var assignmentExpression = createBinaryExpression(node.initializer, 53, rhsIterationValue, false); if (node.initializer.kind === 153 || node.initializer.kind === 154) { - emitDestructuring(assignmentExpression, true, undefined, node); + emitDestructuring(assignmentExpression, true, undefined); } else { emitNodeWithoutSourceMap(assignmentExpression); @@ -21453,7 +22041,12 @@ var ts; writeLine(); emitStart(node); if (node.flags & 256) { - write("exports.default"); + if (languageVersion === 0) { + write("exports[\"default\"]"); + } + else { + write("exports.default"); + } } else { emitModuleMemberName(node); @@ -21480,7 +22073,7 @@ var ts; } } } - function emitDestructuring(root, isAssignmentExpressionStatement, value, lowestNonSynthesizedAncestor) { + function emitDestructuring(root, isAssignmentExpressionStatement, value) { var emitCount = 0; var isDeclaration = (root.kind === 198 && !(ts.getCombinedNodeFlags(root) & 1)) || root.kind === 129; if (root.kind === 169) { @@ -21537,25 +22130,20 @@ var ts; node.text = "" + value; return node; } - function parenthesizeForAccess(expr) { - if (expr.kind === 65 || expr.kind === 155 || expr.kind === 156) { - return expr; - } - var node = ts.createSynthesizedNode(161); - node.expression = expr; - return node; - } - function createPropertyAccess(object, propName) { + function createPropertyAccessForDestructuringProperty(object, propName) { if (propName.kind !== 65) { - return createElementAccess(object, propName); + return createElementAccessExpression(object, propName); } - return createPropertyAccessExpression(parenthesizeForAccess(object), propName); + return createPropertyAccessExpression(object, propName); } - function createElementAccess(object, index) { - var node = ts.createSynthesizedNode(156); - node.expression = parenthesizeForAccess(object); - node.argumentExpression = index; - return node; + function createSliceCall(value, sliceIndex) { + var call = ts.createSynthesizedNode(157); + var sliceIdentifier = ts.createSynthesizedNode(65); + sliceIdentifier.text = "slice"; + call.expression = createPropertyAccessExpression(value, sliceIdentifier); + call.arguments = ts.createSynthesizedNodeArray(); + call.arguments[0] = createNumericLiteral(sliceIndex); + return call; } function emitObjectLiteralAssignment(target, value) { var properties = target.properties; @@ -21566,7 +22154,7 @@ var ts; var p = properties[_a]; if (p.kind === 224 || p.kind === 225) { var propName = (p.name); - emitDestructuringAssignment(p.initializer || propName, createPropertyAccess(value, propName)); + emitDestructuringAssignment(p.initializer || propName, createPropertyAccessForDestructuringProperty(value, propName)); } } } @@ -21579,14 +22167,10 @@ var ts; var e = elements[i]; if (e.kind !== 175) { if (e.kind !== 173) { - emitDestructuringAssignment(e, createElementAccess(value, createNumericLiteral(i))); + emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i))); } - else { - if (i === elements.length - 1) { - value = ensureIdentifier(value); - emitAssignment(e.expression, value); - write(".slice(" + i + ")"); - } + else if (i === elements.length - 1) { + emitDestructuringAssignment(e.expression, createSliceCall(value, i)); } } } @@ -21642,18 +22226,14 @@ var ts; var element = elements[i]; if (pattern.kind === 150) { var propName = element.propertyName || element.name; - emitBindingElement(element, createPropertyAccess(value, propName)); + emitBindingElement(element, createPropertyAccessForDestructuringProperty(value, propName)); } else if (element.kind !== 175) { if (!element.dotDotDotToken) { - emitBindingElement(element, createElementAccess(value, createNumericLiteral(i))); + emitBindingElement(element, createElementAccessExpression(value, createNumericLiteral(i))); } - else { - if (i === elements.length - 1) { - value = ensureIdentifier(value); - emitAssignment(element.name, value); - write(".slice(" + i + ")"); - } + else if (i === elements.length - 1) { + emitBindingElement(element, createSliceCall(value, i)); } } } @@ -21762,12 +22342,12 @@ var ts; function emitParameter(node) { if (languageVersion < 2) { if (ts.isBindingPattern(node.name)) { - var name_16 = createTempVariable(0); + var name_19 = createTempVariable(0); if (!tempParameters) { tempParameters = []; } - tempParameters.push(name_16); - emit(name_16); + tempParameters.push(name_19); + emit(name_19); } else { emit(node.name); @@ -21785,6 +22365,9 @@ var ts; if (languageVersion < 2) { var tempIndex = 0; ts.forEach(node.parameters, function (p) { + if (p.dotDotDotToken) { + return; + } if (ts.isBindingPattern(p.name)) { writeLine(); write("var "); @@ -21814,6 +22397,9 @@ var ts; if (languageVersion < 2 && ts.hasRestParameters(node)) { var restIndex = node.parameters.length - 1; var restParam = node.parameters[restIndex]; + if (ts.isBindingPattern(restParam.name)) { + return; + } var tempName = createTempVariable(268435456).text; writeLine(); emitLeadingComments(restParam); @@ -21886,7 +22472,11 @@ var ts; write("default "); } } - write("function "); + write("function"); + if (languageVersion >= 2 && node.asteriskToken) { + write("*"); + } + write(" "); } if (shouldEmitFunctionName(node)) { emitDeclarationName(node); @@ -22083,28 +22673,47 @@ var ts; emitNodeWithoutSourceMap(memberName); } } - function emitMemberAssignments(node, staticFlag) { - ts.forEach(node.members, function (member) { - if (member.kind === 132 && (member.flags & 128) === 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, static) { + var properties = []; + for (var _a = 0, _b = node.members; _a < _b.length; _a++) { + var member = _b[_a]; + if (member.kind === 132 && static === ((member.flags & 128) !== 0) && member.initializer) { + properties.push(member); } - }); + } + return properties; + } + function emitPropertyDeclarations(node, properties) { + for (var _a = 0; _a < properties.length; _a++) { + var property = properties[_a]; + emitPropertyDeclaration(node, property); + } + } + function emitPropertyDeclaration(node, property, receiver, isExpression) { + writeLine(); + emitLeadingComments(property); + emitStart(property); + emitStart(property.name); + if (receiver) { + emit(receiver); + } + else { + if (property.flags & 128) { + 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) { ts.forEach(node.members, function (member) { @@ -22199,6 +22808,9 @@ var ts; else if (member.kind === 137) { write("set "); } + if (member.asteriskToken) { + write("*"); + } emit(member.name); emitSignatureAndBody(member); emitEnd(member); @@ -22217,6 +22829,12 @@ var ts; tempFlags = 0; tempVariables = undefined; tempParameters = undefined; + emitConstructorWorker(node, baseTypeElement); + tempFlags = saveTempFlags; + tempVariables = saveTempVariables; + tempParameters = saveTempParameters; + } + function emitConstructorWorker(node, baseTypeElement) { var hasInstancePropertyWithInitializer = false; ts.forEach(node.members, function (member) { if (member.kind === 135 && !member.body) { @@ -22285,7 +22903,7 @@ var ts; emitEnd(baseTypeElement); } } - emitMemberAssignments(node, 0); + emitPropertyDeclarations(node, getInitializedProperties(node, false)); if (ctor) { var statements = ctor.body.statements; if (superCall) { @@ -22305,9 +22923,6 @@ var ts; if (ctor) { emitTrailingComments(ctor); } - tempFlags = saveTempFlags; - tempVariables = saveTempVariables; - tempParameters = saveTempParameters; } function emitClassExpression(node) { return emitClassLikeDeclaration(node); @@ -22341,6 +22956,16 @@ var ts; } } } + var staticProperties = getInitializedProperties(node, true); + var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 174; + var tempVariable; + if (isClassExpressionWithStaticProperties) { + tempVariable = createAndRecordTempVariable(0); + write("("); + increaseIndent(); + emit(tempVariable); + write(" = "); + } write("class"); if ((node.name || !(node.flags & 256)) && !thisNodeIsDecorated) { write(" "); @@ -22373,9 +22998,24 @@ var ts; writeLine(); } } - writeLine(); - emitMemberAssignments(node, 128); - emitDecoratorsOfClass(node); + if (isClassExpressionWithStaticProperties) { + for (var _a = 0; _a < staticProperties.length; _a++) { + var property = staticProperties[_a]; + write(","); + writeLine(); + emitPropertyDeclaration(node, property, tempVariable, true); + } + write(","); + writeLine(); + emit(tempVariable); + decreaseIndent(); + write(")"); + } + else { + writeLine(); + emitPropertyDeclarations(node, staticProperties); + emitDecoratorsOfClass(node); + } if (!isES6ExportedDeclaration(node) && (node.flags & 1)) { writeLine(); emitStart(node); @@ -22425,7 +23065,7 @@ var ts; writeLine(); emitConstructor(node, baseTypeNode); emitMemberFunctionsForES5AndLower(node); - emitMemberAssignments(node, 128); + emitPropertyDeclarations(node, getInitializedProperties(node, true)); writeLine(); emitDecoratorsOfClass(node); writeLine(); @@ -22472,56 +23112,64 @@ var ts; emitDecoratorsOfConstructor(node); } function emitDecoratorsOfConstructor(node) { + var decorators = node.decorators; var constructor = ts.getFirstConstructorWithBody(node); - if (constructor) { - emitDecoratorsOfParameters(node, constructor); - } - if (!ts.nodeIsDecorated(node)) { + var hasDecoratedParameters = constructor && ts.forEach(constructor.parameters, ts.nodeIsDecorated); + if (!decorators && !hasDecoratedParameters) { return; } writeLine(); emitStart(node); emitDeclarationName(node); - write(" = "); - emitDecorateStart(node.decorators); + write(" = __decorate(["); + increaseIndent(); + writeLine(); + var decoratorCount = decorators ? decorators.length : 0; + var argumentsWritten = emitList(decorators, 0, decoratorCount, true, false, false, true, function (decorator) { + emitStart(decorator); + emit(decorator.expression); + emitEnd(decorator); + }); + argumentsWritten += emitDecoratorsOfParameters(constructor, argumentsWritten > 0); + emitSerializedTypeMetadata(node, argumentsWritten >= 0); + decreaseIndent(); + writeLine(); + write("], "); emitDeclarationName(node); write(");"); emitEnd(node); writeLine(); } function emitDecoratorsOfMembers(node, staticFlag) { - ts.forEach(node.members, function (member) { + for (var _a = 0, _b = node.members; _a < _b.length; _a++) { + var member = _b[_a]; if ((member.flags & 128) !== staticFlag) { - return; + continue; } - 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 (!ts.nodeCanBeDecorated(member)) { + continue; } - if (!decorators) { - return; + if (!ts.nodeOrChildIsDecorated(member)) { + continue; + } + var decorators = void 0; + var functionLikeMember = void 0; + if (ts.isAccessor(member)) { + var accessors = ts.getAllAccessorDeclarations(node.members, member); + if (member !== accessors.firstAccessor) { + continue; + } + decorators = accessors.firstAccessor.decorators; + if (!decorators && accessors.secondAccessor) { + decorators = accessors.secondAccessor.decorators; + } + functionLikeMember = accessors.setAccessor; + } + else { + decorators = member.decorators; + if (member.kind === 134) { + functionLikeMember = member; + } } writeLine(); emitStart(member); @@ -22532,9 +23180,24 @@ var ts; write(", "); emitExpressionForPropertyName(member.name); emitEnd(member.name); - write(", "); + write(","); + increaseIndent(); + writeLine(); } - emitDecorateStart(decorators); + write("__decorate(["); + increaseIndent(); + writeLine(); + var decoratorCount = decorators ? decorators.length : 0; + var argumentsWritten = emitList(decorators, 0, decoratorCount, true, false, false, true, function (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(", "); @@ -22548,51 +23211,131 @@ var ts; emitExpressionForPropertyName(member.name); emitEnd(member.name); write("))"); + decreaseIndent(); } 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 emitDecoratorsOfParameters(node, leadingComma) { + var argumentsWritten = 0; + if (node) { + var parameterIndex = 0; + for (var _a = 0, _b = node.parameters; _a < _b.length; _a++) { + var parameter = _b[_a]; + if (ts.nodeIsDecorated(parameter)) { + var decorators = parameter.decorators; + argumentsWritten += emitList(decorators, 0, decorators.length, true, false, leadingComma, true, function (decorator) { + emitStart(decorator); + write("__param(" + parameterIndex + ", "); + emit(decorator.expression); + write(")"); + emitEnd(decorator); + }); + leadingComma = true; + } + ++parameterIndex; + } + } + return argumentsWritten; + } + function shouldEmitTypeMetadata(node) { + switch (node.kind) { + case 134: + case 136: + case 137: + case 132: + return true; + } + return false; + } + function shouldEmitReturnTypeMetadata(node) { + switch (node.kind) { + case 134: + return true; + } + return false; + } + function shouldEmitParamTypesMetadata(node) { + switch (node.kind) { + case 201: + case 134: + case 137: + return true; + } + return false; + } + function emitSerializedTypeMetadata(node, writeComma) { + var 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, path, index) { + switch (index) { + case 0: + return "typeof " + path[index] + " !== 'undefined' && " + path[index]; + case 1: + return serializeTypeNameSegment(location, path, index - 1) + "." + path[index]; + default: + var temp = createAndRecordTempVariable(0).text; + return "(" + temp + " = " + serializeTypeNameSegment(location, path, index - 1) + ") && " + temp + "." + path[index]; + } + } + function emitSerializedType(location, name) { + if (typeof name === "string") { + write(name); + return; + } + else { + ts.Debug.assert(name.length > 0, "Invalid serialized type name"); + write("(" + serializeTypeNameSegment(location, name, name.length - 1) + ") || Object"); + } } function emitInterfaceDeclaration(node) { emitOnlyPinnedOrTripleSlashComments(node); @@ -22686,20 +23429,25 @@ var ts; function shouldEmitModuleDeclaration(node) { return ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation); } + function isModuleMergedWithES6Class(node) { + return languageVersion === 2 && !!(resolver.getNodeCheckFlags(node) & 2048); + } function emitModuleDeclaration(node) { var shouldEmit = shouldEmitModuleDeclaration(node); if (!shouldEmit) { return emitOnlyPinnedOrTripleSlashComments(node); } - emitStart(node); - if (isES6ExportedDeclaration(node)) { - write("export "); + if (!isModuleMergedWithES6Class(node)) { + emitStart(node); + if (isES6ExportedDeclaration(node)) { + write("export "); + } + write("var "); + emit(node.name); + write(";"); + emitEnd(node); + writeLine(); } - write("var "); - emit(node.name); - write(";"); - emitEnd(node); - writeLine(); emitStart(node); write("(function ("); emitStart(node.name); @@ -22994,7 +23742,12 @@ var ts; writeLine(); emitStart(node); emitContainingModuleName(node); - write(".default = "); + if (languageVersion === 0) { + write("[\"default\"] = "); + } + else { + write(".default = "); + } emit(node.expression); write(";"); emitEnd(node); @@ -23033,8 +23786,8 @@ var ts; 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); + var name_20 = (specifier.propertyName || specifier.name).text; + (exportSpecifiers[name_20] || (exportSpecifiers[name_20] = [])).push(specifier); } } break; @@ -23046,19 +23799,6 @@ var ts; } } } - function sortAMDModules(amdModules) { - return amdModules.sort(function (moduleA, moduleB) { - if (moduleA.name === moduleB.name) { - return 0; - } - else if (!moduleA.name) { - return 1; - } - else { - return -1; - } - }); - } function emitExportStarHelper() { if (hasExportStars) { writeLine(); @@ -23073,48 +23813,60 @@ var ts; } function emitAMDModule(node, startIndex) { collectExternalModuleInfo(node); + var aliasedModuleNames = []; + var unaliasedModuleNames = []; + var importAliasNames = []; + for (var _a = 0, _b = node.amdDependencies; _a < _b.length; _a++) { + var amdDependency = _b[_a]; + if (amdDependency.name) { + aliasedModuleNames.push("\"" + amdDependency.path + "\""); + importAliasNames.push(amdDependency.name); + } + else { + unaliasedModuleNames.push("\"" + amdDependency.path + "\""); + } + } + for (var _c = 0; _c < externalImports.length; _c++) { + var importNode = externalImports[_c]; + var externalModuleName = ""; + var moduleName = ts.getExternalModuleName(importNode); + if (moduleName.kind === 8) { + externalModuleName = getLiteralText(moduleName); + } + var importAliasName = void 0; + var namespaceDeclaration = getNamespaceDeclarationNode(importNode); + if (namespaceDeclaration && !isDefaultImport(importNode)) { + importAliasName = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, namespaceDeclaration.name); + } + else { + importAliasName = getGeneratedNameForNode(importNode); + } + if (importAliasName) { + aliasedModuleNames.push(externalModuleName); + importAliasNames.push(importAliasName); + } + else { + unaliasedModuleNames.push(externalModuleName); + } + } writeLine(); write("define("); - sortAMDModules(node.amdDependencies); if (node.amdModuleName) { write("\"" + node.amdModuleName + "\", "); } write("[\"require\", \"exports\""); - for (var _a = 0; _a < externalImports.length; _a++) { - var importNode = externalImports[_a]; + if (aliasedModuleNames.length) { write(", "); - var moduleName = ts.getExternalModuleName(importNode); - if (moduleName.kind === 8) { - emitLiteral(moduleName); - } - else { - write("\"\""); - } + write(aliasedModuleNames.join(", ")); } - for (var _b = 0, _c = node.amdDependencies; _b < _c.length; _b++) { - var amdDependency = _c[_b]; - var text = "\"" + amdDependency.path + "\""; + if (unaliasedModuleNames.length) { write(", "); - write(text); + write(unaliasedModuleNames.join(", ")); } write("], function (require, exports"); - for (var _d = 0; _d < externalImports.length; _d++) { - var importNode = externalImports[_d]; + if (importAliasNames.length) { write(", "); - var namespaceDeclaration = getNamespaceDeclarationNode(importNode); - if (namespaceDeclaration && !isDefaultImport(importNode)) { - emit(namespaceDeclaration.name); - } - else { - write(getGeneratedNameForNode(importNode)); - } - } - for (var _e = 0, _f = node.amdDependencies; _e < _f.length; _e++) { - var amdDependency = _f[_e]; - if (amdDependency.name) { - write(", "); - write(amdDependency.name); - } + write(importAliasNames.join(", ")); } write(") {"); increaseIndent(); @@ -23168,7 +23920,7 @@ var ts; } return statements.length; } - function writeHelper(text) { + function writeLines(text) { var lines = text.split(/\r\n|\r|\n/g); for (var i = 0; i < lines.length; ++i) { var line = lines[i]; @@ -23183,26 +23935,20 @@ var ts; emitDetachedComments(node); var startIndex = emitDirectivePrologues(node.statements, false); if ((languageVersion < 2) && (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8)) { - 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) & 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};"); + writeLines(decorateHelper); + if (compilerOptions.emitDecoratorMetadata) { + writeLines(metadataHelper); + } decorateEmitted = true; } + if (!paramEmitted && resolver.getNodeCheckFlags(node) & 1024) { + writeLines(paramHelper); + paramEmitted = true; + } if (ts.isExternalModule(node)) { if (languageVersion >= 2) { emitES6Module(node, startIndex); @@ -23351,6 +24097,8 @@ var ts; return emitConditionalExpression(node); case 173: return emitSpreadElementExpression(node); + case 172: + return emitYieldExpression(node); case 175: return; case 179: @@ -23693,7 +24441,7 @@ var ts; getDiagnosticsProducingTypeChecker: getDiagnosticsProducingTypeChecker, getCommonSourceDirectory: function () { return commonSourceDirectory; }, emit: emit, - getCurrentDirectory: host.getCurrentDirectory, + getCurrentDirectory: function () { return host.getCurrentDirectory(); }, getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); }, getIdentifierCount: function () { return getDiagnosticsProducingTypeChecker().getIdentifierCount(); }, getSymbolCount: function () { return getDiagnosticsProducingTypeChecker().getSymbolCount(); }, @@ -23702,14 +24450,14 @@ var ts; return program; function getEmitHost(writeFileCallback) { return { - getCanonicalFileName: host.getCanonicalFileName, + getCanonicalFileName: function (fileName) { return host.getCanonicalFileName(fileName); }, getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, - getCurrentDirectory: host.getCurrentDirectory, - getNewLine: host.getNewLine, + getCurrentDirectory: function () { return host.getCurrentDirectory(); }, + getNewLine: function () { return host.getNewLine(); }, getSourceFile: program.getSourceFile, getSourceFiles: program.getSourceFiles, - writeFile: writeFileCallback || host.writeFile + writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError) { return host.writeFile(fileName, data, writeByteOrderMark, onError); }) }; } function getDiagnosticsProducingTypeChecker() { @@ -24162,6 +24910,11 @@ var ts; shortName: "w", type: "boolean", description: ts.Diagnostics.Watch_input_files + }, + { + name: "emitDecoratorMetadata", + type: "boolean", + experimental: true } ]; function parseCommandLine(commandLine) { diff --git a/bin/tsserver.js b/bin/tsserver.js index 7fe3b3efe77..0721b0b21a1 100644 --- a/bin/tsserver.js +++ b/bin/tsserver.js @@ -84,9 +84,9 @@ var ts; if (array) { result = []; for (var _i = 0; _i < array.length; _i++) { - var item_1 = array[_i]; - if (f(item_1)) { - result.push(item_1); + var item = array[_i]; + if (f(item)) { + result.push(item); } } } @@ -118,9 +118,9 @@ var ts; if (array) { result = []; for (var _i = 0; _i < array.length; _i++) { - var item_2 = array[_i]; - if (!contains(result, item_2)) { - result.push(item_2); + var item = array[_i]; + if (!contains(result, item)) { + result.push(item); } } } @@ -420,6 +420,9 @@ var ts; return 3; return 2; } + var idx = path.indexOf('://'); + if (idx !== -1) + return idx + 3; return 0; } ts.getRootLength = getRootLength; @@ -597,10 +600,6 @@ var ts; "\u2029": "\\u2029", "\u0085": "\\u0085" }; - function getDefaultLibFileName(options) { - return options.target === 2 ? "lib.es6.d.ts" : "lib.d.ts"; - } - ts.getDefaultLibFileName = getDefaultLibFileName; function Symbol(flags, name) { this.flags = flags; this.name = name; @@ -1063,7 +1062,6 @@ var ts; 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." }, @@ -1072,6 +1070,14 @@ var ts; 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." }, + Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: ts.DiagnosticCategory.Error, key: "Invalid use of '{0}'. Class definitions are automatically in strict mode." }, + A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A class declaration without the 'default' modifier must have a name" }, + Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode" }, + Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1213, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, + Identifier_expected_0_is_a_reserved_word_in_strict_mode_External_Module_is_automatically_in_strict_mode: { code: 1214, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. External Module is automatically in strict mode." }, + Type_expected_0_is_a_reserved_word_in_strict_mode: { code: 1215, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode" }, + Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1216, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, + Type_expected_0_is_a_reserved_word_in_strict_mode_Module_is_automatically_in_strict_mode: { code: 1217, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Module is automatically in strict mode." }, 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." }, @@ -1247,19 +1253,20 @@ var ts; 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." }, + Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: ts.DiagnosticCategory.Error, key: "Type must have a '[Symbol.iterator]()' method that returns an iterator." }, + An_iterator_must_have_a_next_method: { code: 2489, category: ts.DiagnosticCategory.Error, key: "An iterator 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." }, + The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression: { code: 2496, category: ts.DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression." }, External_module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct: { code: 2497, category: ts.DiagnosticCategory.Error, key: "External module '{0}' resolves to a non-module entity and cannot be imported using this construct." }, External_module_0_uses_export_and_cannot_be_used_with_export_Asterisk: { code: 2498, category: ts.DiagnosticCategory.Error, key: "External module '{0}' uses 'export =' and cannot be used with 'export *'." }, An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments: { code: 2499, category: ts.DiagnosticCategory.Error, key: "An interface can only extend an identifier/qualified-name with optional type arguments." }, A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments: { code: 2500, category: ts.DiagnosticCategory.Error, key: "A class can only implement an identifier/qualified-name with optional type arguments." }, + A_rest_element_cannot_contain_a_binding_pattern: { code: 2501, category: ts.DiagnosticCategory.Error, key: "A rest element cannot contain a binding pattern." }, 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}'." }, @@ -1410,6 +1417,22 @@ var 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: 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." }, + import_can_only_be_used_in_a_ts_file: { code: 8002, category: ts.DiagnosticCategory.Error, key: "'import ... =' can only be used in a .ts file." }, + export_can_only_be_used_in_a_ts_file: { code: 8003, category: ts.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: ts.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: ts.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: ts.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: ts.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: ts.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: ts.DiagnosticCategory.Error, key: "'{0}' can only be used in a .ts file." }, + types_can_only_be_used_in_a_ts_file: { code: 8010, category: ts.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: ts.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: ts.DiagnosticCategory.Error, key: "'parameter modifiers' can only be used in a .ts file." }, + can_only_be_used_in_a_ts_file: { code: 8013, category: ts.DiagnosticCategory.Error, key: "'?' can only be used in a .ts file." }, + property_declarations_can_only_be_used_in_a_ts_file: { code: 8014, category: ts.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: ts.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: ts.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: ts.DiagnosticCategory.Error, key: "'decorators' can only be used in a .ts file." }, 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." }, @@ -1423,7 +1446,7 @@ var ts; (function (ts) { var textToToken = { "any": 112, - "as": 102, + "as": 111, "boolean": 113, "break": 66, "case": 67, @@ -1448,24 +1471,24 @@ var ts; "function": 83, "get": 116, "if": 84, - "implements": 103, + "implements": 102, "import": 85, "in": 86, "instanceof": 87, - "interface": 104, - "let": 105, + "interface": 103, + "let": 104, "module": 117, "new": 88, "null": 89, "number": 119, - "package": 106, - "private": 107, - "protected": 108, - "public": 109, + "package": 105, + "private": 106, + "protected": 107, + "public": 108, "require": 118, "return": 90, "set": 120, - "static": 110, + "static": 109, "string": 121, "super": 91, "switch": 92, @@ -1480,7 +1503,7 @@ var ts; "void": 99, "while": 100, "with": 101, - "yield": 111, + "yield": 110, "of": 125, "{": 14, "}": 15, @@ -1816,6 +1839,7 @@ var ts; var nextChar = text.charCodeAt(pos + 1); var hasTrailingNewLine = false; if (nextChar === 47 || nextChar === 42) { + var kind = nextChar === 47 ? 2 : 3; var startPos = pos; pos += 2; if (nextChar === 47) { @@ -1840,7 +1864,7 @@ var ts; if (!result) { result = []; } - result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine }); + result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine, kind: kind }); } continue; } @@ -1878,9 +1902,9 @@ var ts; ch > 127 && isUnicodeIdentifierPart(ch, languageVersion); } ts.isIdentifierPart = isIdentifierPart; - function createScanner(languageVersion, skipTrivia, text, onError) { + function createScanner(languageVersion, skipTrivia, text, onError, start, length) { var pos; - var len; + var end; var startPos; var tokenPos; var token; @@ -1888,6 +1912,30 @@ var ts; var precedingLineBreak; var hasExtendedUnicodeEscape; var tokenIsUnterminated; + setText(text, start, length); + 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 === 65 || token > 101; }, + isReservedWord: function () { return token >= 66 && token <= 101; }, + isUnterminated: function () { return tokenIsUnterminated; }, + reScanGreaterToken: reScanGreaterToken, + reScanSlashToken: reScanSlashToken, + reScanTemplateToken: reScanTemplateToken, + scan: scan, + setText: setText, + setScriptTarget: setScriptTarget, + setOnError: setOnError, + setTextPos: setTextPos, + tryScan: tryScan, + lookAhead: lookAhead + }; function error(message, length) { if (onError) { onError(message, length || 0); @@ -1972,7 +2020,7 @@ var ts; var result = ""; var start = pos; while (true) { - if (pos >= len) { + if (pos >= end) { result += text.substring(start, pos); tokenIsUnterminated = true; error(ts.Diagnostics.Unterminated_string_literal); @@ -2007,7 +2055,7 @@ var ts; var contents = ""; var resultingToken; while (true) { - if (pos >= len) { + if (pos >= end) { contents += text.substring(start, pos); tokenIsUnterminated = true; error(ts.Diagnostics.Unterminated_template_literal); @@ -2021,7 +2069,7 @@ var ts; resultingToken = startedWithBacktick ? 10 : 13; break; } - if (currChar === 36 && pos + 1 < len && text.charCodeAt(pos + 1) === 123) { + if (currChar === 36 && pos + 1 < end && text.charCodeAt(pos + 1) === 123) { contents += text.substring(start, pos); pos += 2; resultingToken = startedWithBacktick ? 11 : 12; @@ -2036,7 +2084,7 @@ var ts; if (currChar === 13) { contents += text.substring(start, pos); pos++; - if (pos < len && text.charCodeAt(pos) === 10) { + if (pos < end && text.charCodeAt(pos) === 10) { pos++; } contents += "\n"; @@ -2051,7 +2099,7 @@ var ts; } function scanEscapeSequence() { pos++; - if (pos >= len) { + if (pos >= end) { error(ts.Diagnostics.Unexpected_end_of_text); return ""; } @@ -2076,7 +2124,7 @@ var ts; case 34: return "\""; case 117: - if (pos < len && text.charCodeAt(pos) === 123) { + if (pos < end && text.charCodeAt(pos) === 123) { hasExtendedUnicodeEscape = true; pos++; return scanExtendedUnicodeEscape(); @@ -2085,7 +2133,7 @@ var ts; case 120: return scanHexadecimalEscape(2); case 13: - if (pos < len && text.charCodeAt(pos) === 10) { + if (pos < end && text.charCodeAt(pos) === 10) { pos++; } case 10: @@ -2117,7 +2165,7 @@ var ts; error(ts.Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive); isInvalidExtendedEscape = true; } - if (pos >= len) { + if (pos >= end) { error(ts.Diagnostics.Unexpected_end_of_text); isInvalidExtendedEscape = true; } @@ -2143,11 +2191,11 @@ var ts; return String.fromCharCode(codeUnit1, codeUnit2); } function peekUnicodeEscape() { - if (pos + 5 < len && text.charCodeAt(pos + 1) === 117) { - var start = pos; + if (pos + 5 < end && text.charCodeAt(pos + 1) === 117) { + var start_1 = pos; pos += 2; var value = scanExactNumberOfHexDigits(4); - pos = start; + pos = start_1; return value; } return -1; @@ -2155,7 +2203,7 @@ var ts; function scanIdentifierParts() { var result = ""; var start = pos; - while (pos < len) { + while (pos < end) { var ch = text.charCodeAt(pos); if (isIdentifierPart(ch)) { pos++; @@ -2213,7 +2261,7 @@ var ts; tokenIsUnterminated = false; while (true) { tokenPos = pos; - if (pos >= len) { + if (pos >= end) { return token = 1; } var ch = text.charCodeAt(pos); @@ -2226,7 +2274,7 @@ var ts; continue; } else { - if (ch === 13 && pos + 1 < len && text.charCodeAt(pos + 1) === 10) { + if (ch === 13 && pos + 1 < end && text.charCodeAt(pos + 1) === 10) { pos += 2; } else { @@ -2243,7 +2291,7 @@ var ts; continue; } else { - while (pos < len && isWhiteSpace(text.charCodeAt(pos))) { + while (pos < end && isWhiteSpace(text.charCodeAt(pos))) { pos++; } return token = 5; @@ -2314,7 +2362,7 @@ var ts; case 47: if (text.charCodeAt(pos + 1) === 47) { pos += 2; - while (pos < len) { + while (pos < end) { if (isLineBreak(text.charCodeAt(pos))) { break; } @@ -2330,7 +2378,7 @@ var ts; if (text.charCodeAt(pos + 1) === 42) { pos += 2; var commentClosed = false; - while (pos < len) { + while (pos < end) { var ch_2 = text.charCodeAt(pos); if (ch_2 === 42 && text.charCodeAt(pos + 1) === 47) { pos += 2; @@ -2358,7 +2406,7 @@ var ts; } return pos++, token = 36; case 48: - if (pos + 2 < len && (text.charCodeAt(pos + 1) === 88 || text.charCodeAt(pos + 1) === 120)) { + if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 || text.charCodeAt(pos + 1) === 120)) { pos += 2; var value = scanMinimumNumberOfHexDigits(1); if (value < 0) { @@ -2368,7 +2416,7 @@ var ts; tokenValue = "" + value; return token = 7; } - else if (pos + 2 < len && (text.charCodeAt(pos + 1) === 66 || text.charCodeAt(pos + 1) === 98)) { + else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 66 || text.charCodeAt(pos + 1) === 98)) { pos += 2; var value = scanBinaryOrOctalDigits(2); if (value < 0) { @@ -2378,7 +2426,7 @@ var ts; tokenValue = "" + value; return token = 7; } - else if (pos + 2 < len && (text.charCodeAt(pos + 1) === 79 || text.charCodeAt(pos + 1) === 111)) { + else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 79 || text.charCodeAt(pos + 1) === 111)) { pos += 2; var value = scanBinaryOrOctalDigits(8); if (value < 0) { @@ -2388,7 +2436,7 @@ var ts; tokenValue = "" + value; return token = 7; } - if (pos + 1 < len && isOctalDigit(text.charCodeAt(pos + 1))) { + if (pos + 1 < end && isOctalDigit(text.charCodeAt(pos + 1))) { tokenValue = "" + scanOctalDigits(); return token = 7; } @@ -2497,7 +2545,7 @@ var ts; default: if (isIdentifierStart(ch)) { pos++; - while (pos < len && isIdentifierPart(ch = text.charCodeAt(pos))) + while (pos < end && isIdentifierPart(ch = text.charCodeAt(pos))) pos++; tokenValue = text.substring(tokenPos, pos); if (ch === 92) { @@ -2545,7 +2593,7 @@ var ts; var inEscape = false; var inCharacterClass = false; while (true) { - if (p >= len) { + if (p >= end) { tokenIsUnterminated = true; error(ts.Diagnostics.Unterminated_regular_expression_literal); break; @@ -2574,7 +2622,7 @@ var ts; } p++; } - while (p < len && isIdentifierPart(text.charCodeAt(p))) { + while (p < end && isIdentifierPart(text.charCodeAt(p))) { p++; } pos = p; @@ -2612,40 +2660,28 @@ var ts; function tryScan(callback) { return speculationHelper(callback, false); } - function setText(newText) { + function setText(newText, start, length) { text = newText || ""; - len = text.length; - setTextPos(0); + end = length === undefined ? text.length : start + length; + setTextPos(start || 0); + } + function setOnError(errorCallback) { + onError = errorCallback; + } + function setScriptTarget(scriptTarget) { + languageVersion = scriptTarget; } function setTextPos(textPos) { + ts.Debug.assert(textPos >= 0); pos = textPos; startPos = textPos; tokenPos = textPos; token = 0; precedingLineBreak = false; + tokenValue = undefined; + hasExtendedUnicodeEscape = false; + tokenIsUnterminated = false; } - 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 === 65 || token > 101; }, - isReservedWord: function () { return token >= 66 && token <= 101; }, - isUnterminated: function () { return tokenIsUnterminated; }, - reScanGreaterToken: reScanGreaterToken, - reScanSlashToken: reScanSlashToken, - reScanTemplateToken: reScanTemplateToken, - scan: scan, - setText: setText, - setTextPos: setTextPos, - tryScan: tryScan, - lookAhead: lookAhead - }; } ts.createScanner = createScanner; })(ts || (ts = {})); @@ -2806,6 +2842,11 @@ var ts; shortName: "w", type: "boolean", description: ts.Diagnostics.Watch_input_files + }, + { + name: "emitDecoratorMetadata", + type: "boolean", + experimental: true } ]; function parseCommandLine(commandLine) { @@ -3089,6 +3130,13 @@ var ts; return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); } ts.getTokenPosOfNode = getTokenPosOfNode; + function getNonDecoratorTokenPosOfNode(node, sourceFile) { + if (nodeIsMissing(node) || !node.decorators) { + return getTokenPosOfNode(node, sourceFile); + } + return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.decorators.end); + } + ts.getNonDecoratorTokenPosOfNode = getNonDecoratorTokenPosOfNode; function getSourceTextOfNodeFromSourceFile(sourceFile, node) { if (nodeIsMissing(node)) { return ""; @@ -3126,7 +3174,7 @@ var ts; } ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function getEnclosingBlockScopeContainer(node) { - var current = node; + var current = node.parent; while (current) { if (isFunctionLike(current)) { return current; @@ -3180,11 +3228,10 @@ var ts; } ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain; function getSpanOfTokenAtPosition(sourceFile, pos) { - var scanner = ts.createScanner(sourceFile.languageVersion, true, sourceFile.text); - scanner.setTextPos(pos); + var scanner = ts.createScanner(sourceFile.languageVersion, true, sourceFile.text, undefined, pos); scanner.scan(); var start = scanner.getTokenPos(); - return createTextSpanFromBounds(start, scanner.getTextPos()); + return ts.createTextSpanFromBounds(start, scanner.getTextPos()); } ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForNode(sourceFile, node) { @@ -3193,7 +3240,7 @@ var ts; case 227: var pos_1 = ts.skipTrivia(sourceFile.text, 0, false); if (pos_1 === sourceFile.text.length) { - return createTextSpan(0, 0); + return ts.createTextSpan(0, 0); } return getSpanOfTokenAtPosition(sourceFile, pos_1); case 198: @@ -3215,7 +3262,7 @@ var ts; var pos = nodeIsMissing(errorNode) ? errorNode.pos : ts.skipTrivia(sourceFile.text, errorNode.pos); - return createTextSpanFromBounds(pos, errorNode.end); + return ts.createTextSpanFromBounds(pos, errorNode.end); } ts.getErrorSpanForNode = getErrorSpanForNode; function isExternalModule(file) { @@ -3326,6 +3373,17 @@ var ts; return false; } ts.isVariableLike = isVariableLike; + function isAccessor(node) { + if (node) { + switch (node.kind) { + case 136: + case 137: + return true; + } + } + return false; + } + ts.isAccessor = isAccessor; function isFunctionLike(node) { if (node) { switch (node.kind) { @@ -3381,6 +3439,14 @@ var ts; } node = node.parent; break; + case 130: + if (node.parent.kind === 129 && isClassElement(node.parent.parent)) { + node = node.parent.parent; + } + else if (isClassElement(node.parent)) { + node = node.parent; + } + break; case 163: if (!includeArrowFunctions) { continue; @@ -3414,6 +3480,14 @@ var ts; } node = node.parent; break; + case 130: + if (node.parent.kind === 129 && isClassElement(node.parent.parent)) { + node = node.parent.parent; + } + else if (isClassElement(node.parent)) { + node = node.parent; + } + break; case 200: case 162: case 163: @@ -3578,6 +3652,8 @@ var ts; return node === parent_1.expression; case 127: return node === parent_1.expression; + case 130: + return true; default: if (isExpression(parent_1)) { return true; @@ -3741,6 +3817,7 @@ var ts; case 134: case 136: case 137: + case 133: case 140: return true; default: @@ -3779,7 +3856,7 @@ var ts; } ts.getClassExtendsHeritageClauseElement = getClassExtendsHeritageClauseElement; function getClassImplementsHeritageClauseElements(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 103); + var heritageClause = getHeritageClause(node.heritageClauses, 102); return heritageClause ? heritageClause.types : undefined; } ts.getClassImplementsHeritageClauseElements = getClassImplementsHeritageClauseElements; @@ -3894,10 +3971,10 @@ var ts; ts.isESSymbolIdentifier = isESSymbolIdentifier; function isModifier(token) { switch (token) { - case 109: - case 107: case 108: - case 110: + case 106: + case 107: + case 109: case 78: case 115: case 70: @@ -3907,115 +3984,6 @@ var ts; return false; } ts.isModifier = isModifier; - function textSpanEnd(span) { - return span.start + span.length; - } - ts.textSpanEnd = textSpanEnd; - function textSpanIsEmpty(span) { - return span.length === 0; - } - ts.textSpanIsEmpty = textSpanIsEmpty; - function textSpanContainsPosition(span, position) { - return position >= span.start && position < textSpanEnd(span); - } - ts.textSpanContainsPosition = textSpanContainsPosition; - function textSpanContainsTextSpan(span, other) { - return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span); - } - ts.textSpanContainsTextSpan = textSpanContainsTextSpan; - function textSpanOverlapsWith(span, other) { - var overlapStart = Math.max(span.start, other.start); - var overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other)); - return overlapStart < overlapEnd; - } - ts.textSpanOverlapsWith = textSpanOverlapsWith; - function textSpanOverlap(span1, span2) { - var overlapStart = Math.max(span1.start, span2.start); - var overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); - if (overlapStart < overlapEnd) { - return createTextSpanFromBounds(overlapStart, overlapEnd); - } - return undefined; - } - ts.textSpanOverlap = textSpanOverlap; - function textSpanIntersectsWithTextSpan(span, other) { - return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start; - } - ts.textSpanIntersectsWithTextSpan = textSpanIntersectsWithTextSpan; - function textSpanIntersectsWith(span, start, length) { - var end = start + length; - return start <= textSpanEnd(span) && end >= span.start; - } - ts.textSpanIntersectsWith = textSpanIntersectsWith; - function textSpanIntersectsWithPosition(span, position) { - return position <= textSpanEnd(span) && position >= span.start; - } - ts.textSpanIntersectsWithPosition = textSpanIntersectsWithPosition; - function textSpanIntersection(span1, span2) { - var intersectStart = Math.max(span1.start, span2.start); - var intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); - if (intersectStart <= intersectEnd) { - return createTextSpanFromBounds(intersectStart, intersectEnd); - } - return undefined; - } - ts.textSpanIntersection = textSpanIntersection; - function createTextSpan(start, length) { - if (start < 0) { - throw new Error("start < 0"); - } - if (length < 0) { - throw new Error("length < 0"); - } - return { start: start, length: length }; - } - ts.createTextSpan = createTextSpan; - function createTextSpanFromBounds(start, end) { - return createTextSpan(start, end - start); - } - ts.createTextSpanFromBounds = createTextSpanFromBounds; - function textChangeRangeNewSpan(range) { - return createTextSpan(range.span.start, range.newLength); - } - ts.textChangeRangeNewSpan = textChangeRangeNewSpan; - function textChangeRangeIsUnchanged(range) { - return textSpanIsEmpty(range.span) && range.newLength === 0; - } - ts.textChangeRangeIsUnchanged = textChangeRangeIsUnchanged; - function createTextChangeRange(span, newLength) { - if (newLength < 0) { - throw new Error("newLength < 0"); - } - return { span: span, newLength: newLength }; - } - ts.createTextChangeRange = createTextChangeRange; - ts.unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0); - function collapseTextChangeRangesAcrossMultipleVersions(changes) { - if (changes.length === 0) { - return ts.unchangedTextChangeRange; - } - if (changes.length === 1) { - return changes[0]; - } - var change0 = changes[0]; - var oldStartN = change0.span.start; - var oldEndN = textSpanEnd(change0.span); - var newEndN = oldStartN + change0.newLength; - for (var i = 1; i < changes.length; i++) { - var nextChange = changes[i]; - var oldStart1 = oldStartN; - var oldEnd1 = oldEndN; - var newEnd1 = newEndN; - var oldStart2 = nextChange.span.start; - var oldEnd2 = textSpanEnd(nextChange.span); - var newEnd2 = oldStart2 + nextChange.newLength; - oldStartN = Math.min(oldStart1, oldStart2); - oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)); - newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)); - } - return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), newEndN - oldStartN); - } - ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function nodeStartsNewLexicalEnvironment(n) { return isFunctionLike(n) || n.kind === 205 || n.kind === 227; } @@ -4032,6 +4000,13 @@ var ts; return node; } ts.createSynthesizedNode = createSynthesizedNode; + function createSynthesizedNodeArray() { + var array = []; + array.pos = -1; + array.end = -1; + return array; + } + ts.createSynthesizedNodeArray = createSynthesizedNodeArray; function createDiagnosticCollection() { var nonFileDiagnostics = []; var fileDiagnostics = {}; @@ -4387,6 +4362,54 @@ var ts; } } ts.writeCommentRange = writeCommentRange; + function modifierToFlag(token) { + switch (token) { + case 109: return 128; + case 108: return 16; + case 107: return 64; + case 106: return 32; + case 78: return 1; + case 115: return 2; + case 70: return 8192; + case 73: return 256; + } + return 0; + } + ts.modifierToFlag = modifierToFlag; + function isLeftHandSideExpression(expr) { + if (expr) { + switch (expr.kind) { + case 155: + case 156: + case 158: + case 157: + case 159: + case 153: + case 161: + case 154: + case 174: + case 162: + case 65: + case 9: + case 7: + case 8: + case 10: + case 171: + case 80: + case 89: + case 93: + case 95: + case 91: + return true; + } + } + return false; + } + ts.isLeftHandSideExpression = isLeftHandSideExpression; + function isAssignmentOperator(token) { + return token >= 53 && token <= 64; + } + ts.isAssignmentOperator = isAssignmentOperator; function isSupportedHeritageClauseElement(node) { return isSupportedHeritageClauseElementExpression(node.expression); } @@ -4412,6 +4435,122 @@ var ts; } ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; })(ts || (ts = {})); +var ts; +(function (ts) { + function getDefaultLibFileName(options) { + return options.target === 2 ? "lib.es6.d.ts" : "lib.d.ts"; + } + ts.getDefaultLibFileName = getDefaultLibFileName; + function textSpanEnd(span) { + return span.start + span.length; + } + ts.textSpanEnd = textSpanEnd; + function textSpanIsEmpty(span) { + return span.length === 0; + } + ts.textSpanIsEmpty = textSpanIsEmpty; + function textSpanContainsPosition(span, position) { + return position >= span.start && position < textSpanEnd(span); + } + ts.textSpanContainsPosition = textSpanContainsPosition; + function textSpanContainsTextSpan(span, other) { + return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span); + } + ts.textSpanContainsTextSpan = textSpanContainsTextSpan; + function textSpanOverlapsWith(span, other) { + var overlapStart = Math.max(span.start, other.start); + var overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other)); + return overlapStart < overlapEnd; + } + ts.textSpanOverlapsWith = textSpanOverlapsWith; + function textSpanOverlap(span1, span2) { + var overlapStart = Math.max(span1.start, span2.start); + var overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); + if (overlapStart < overlapEnd) { + return createTextSpanFromBounds(overlapStart, overlapEnd); + } + return undefined; + } + ts.textSpanOverlap = textSpanOverlap; + function textSpanIntersectsWithTextSpan(span, other) { + return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start; + } + ts.textSpanIntersectsWithTextSpan = textSpanIntersectsWithTextSpan; + function textSpanIntersectsWith(span, start, length) { + var end = start + length; + return start <= textSpanEnd(span) && end >= span.start; + } + ts.textSpanIntersectsWith = textSpanIntersectsWith; + function textSpanIntersectsWithPosition(span, position) { + return position <= textSpanEnd(span) && position >= span.start; + } + ts.textSpanIntersectsWithPosition = textSpanIntersectsWithPosition; + function textSpanIntersection(span1, span2) { + var intersectStart = Math.max(span1.start, span2.start); + var intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); + if (intersectStart <= intersectEnd) { + return createTextSpanFromBounds(intersectStart, intersectEnd); + } + return undefined; + } + ts.textSpanIntersection = textSpanIntersection; + function createTextSpan(start, length) { + if (start < 0) { + throw new Error("start < 0"); + } + if (length < 0) { + throw new Error("length < 0"); + } + return { start: start, length: length }; + } + ts.createTextSpan = createTextSpan; + function createTextSpanFromBounds(start, end) { + return createTextSpan(start, end - start); + } + ts.createTextSpanFromBounds = createTextSpanFromBounds; + function textChangeRangeNewSpan(range) { + return createTextSpan(range.span.start, range.newLength); + } + ts.textChangeRangeNewSpan = textChangeRangeNewSpan; + function textChangeRangeIsUnchanged(range) { + return textSpanIsEmpty(range.span) && range.newLength === 0; + } + ts.textChangeRangeIsUnchanged = textChangeRangeIsUnchanged; + function createTextChangeRange(span, newLength) { + if (newLength < 0) { + throw new Error("newLength < 0"); + } + return { span: span, newLength: newLength }; + } + ts.createTextChangeRange = createTextChangeRange; + ts.unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0); + function collapseTextChangeRangesAcrossMultipleVersions(changes) { + if (changes.length === 0) { + return ts.unchangedTextChangeRange; + } + if (changes.length === 1) { + return changes[0]; + } + var change0 = changes[0]; + var oldStartN = change0.span.start; + var oldEndN = textSpanEnd(change0.span); + var newEndN = oldStartN + change0.newLength; + for (var i = 1; i < changes.length; i++) { + var nextChange = changes[i]; + var oldStart1 = oldStartN; + var oldEnd1 = oldEndN; + var newEnd1 = newEndN; + var oldStart2 = nextChange.span.start; + var oldEnd2 = textSpanEnd(nextChange.span); + var newEnd2 = oldStart2 + nextChange.newLength; + oldStartN = Math.min(oldStart1, oldStart2); + oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)); + newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)); + } + return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), newEndN - oldStartN); + } + ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; +})(ts || (ts = {})); /// /// var ts; @@ -4703,8 +4842,7 @@ var ts; case 214: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.type); + visitNode(cbNode, node.expression); case 171: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); case 176: @@ -4723,388 +4861,97 @@ var ts; } } 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.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 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) { - // 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; - forEachChild(n, visitNode); - parent = saveParent; - } - } - } - function shouldCheckNode(node) { - switch (node.kind) { - case 8: - case 7: - case 65: - return true; - } - return false; - } - function moveElementEntirelyPastChangeRange(element, isArray, delta, oldText, newText, aggressiveChecks) { - if (isArray) { - visitArray(element); - } - else { - visitNode(element); - } - return; - function visitNode(node) { - if (aggressiveChecks && shouldCheckNode(node)) { - var text = oldText.substring(node.pos, node.end); - } - node._children = undefined; - node.pos += delta; - node.end += delta; - if (aggressiveChecks && shouldCheckNode(node)) { - ts.Debug.assert(text === newText.substring(node.pos, node.end)); - } - forEachChild(node, visitNode, visitArray); - checkNodePositions(node, aggressiveChecks); - } - function visitArray(array) { - array._children = undefined; - array.pos += delta; - array.end += delta; - for (var _i = 0; _i < array.length; _i++) { - var node = array[_i]; - visitNode(node); - } - } - } - function adjustIntersectingElement(element, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta) { - ts.Debug.assert(element.end >= changeStart, "Adjusting an element that was entirely before the change range"); - ts.Debug.assert(element.pos <= changeRangeOldEnd, "Adjusting an element that was entirely after the change range"); - ts.Debug.assert(element.pos <= element.end); - element.pos = Math.min(element.pos, changeRangeNewEnd); - if (element.end >= changeRangeOldEnd) { - element.end += delta; - } - else { - element.end = Math.min(element.end, changeRangeNewEnd); - } - ts.Debug.assert(element.pos <= element.end); - if (element.parent) { - ts.Debug.assert(element.pos >= element.parent.pos); - ts.Debug.assert(element.end <= element.parent.end); - } - } - function checkNodePositions(node, aggressiveChecks) { - if (aggressiveChecks) { - var pos = node.pos; - forEachChild(node, function (child) { - ts.Debug.assert(child.pos >= pos); - pos = child.end; - }); - ts.Debug.assert(pos <= node.end); - } - } - function updateTokenPositionsAndMarkElements(sourceFile, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta, oldText, newText, aggressiveChecks) { - visitNode(sourceFile); - return; - function visitNode(child) { - ts.Debug.assert(child.pos <= child.end); - if (child.pos > changeRangeOldEnd) { - moveElementEntirelyPastChangeRange(child, false, delta, oldText, newText, aggressiveChecks); - return; - } - var fullEnd = child.end; - if (fullEnd >= changeStart) { - child.intersectsChange = true; - child._children = undefined; - adjustIntersectingElement(child, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - forEachChild(child, visitNode, visitArray); - checkNodePositions(child, aggressiveChecks); - return; - } - ts.Debug.assert(fullEnd < changeStart); - } - function visitArray(array) { - ts.Debug.assert(array.pos <= array.end); - if (array.pos > changeRangeOldEnd) { - moveElementEntirelyPastChangeRange(array, true, delta, oldText, newText, aggressiveChecks); - return; - } - var fullEnd = array.end; - if (fullEnd >= changeStart) { - array.intersectsChange = true; - array._children = undefined; - adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - for (var _i = 0; _i < array.length; _i++) { - var node = array[_i]; - visitNode(node); - } - return; - } - ts.Debug.assert(fullEnd < changeStart); - } - } - function extendToAffectedRange(sourceFile, changeRange) { - var maxLookahead = 1; - var start = changeRange.span.start; - for (var i = 0; start > 0 && i <= maxLookahead; i++) { - var nearestNode = findNearestNodeStartingBeforeOrAtPosition(sourceFile, start); - ts.Debug.assert(nearestNode.pos <= start); - var position = nearestNode.pos; - start = Math.max(0, position - 1); - } - var finalSpan = ts.createTextSpanFromBounds(start, ts.textSpanEnd(changeRange.span)); - var finalLength = changeRange.newLength + (changeRange.span.start - start); - return ts.createTextChangeRange(finalSpan, finalLength); - } - function findNearestNodeStartingBeforeOrAtPosition(sourceFile, position) { - var bestResult = sourceFile; - var lastNodeEntirelyBeforePosition; - forEachChild(sourceFile, visit); - if (lastNodeEntirelyBeforePosition) { - var lastChildOfLastEntireNodeBeforePosition = getLastChild(lastNodeEntirelyBeforePosition); - if (lastChildOfLastEntireNodeBeforePosition.pos > bestResult.pos) { - bestResult = lastChildOfLastEntireNodeBeforePosition; - } - } - return bestResult; - function getLastChild(node) { - while (true) { - var lastChild = getLastChildWorker(node); - if (lastChild) { - node = lastChild; - } - else { - return node; - } - } - } - function getLastChildWorker(node) { - var last = undefined; - forEachChild(node, function (child) { - if (ts.nodeIsPresent(child)) { - last = child; - } - }); - return last; - } - function visit(child) { - if (ts.nodeIsMissing(child)) { - return; - } - if (child.pos <= position) { - if (child.pos >= bestResult.pos) { - bestResult = child; - } - if (position < child.end) { - forEachChild(child, visit); - return true; - } - else { - ts.Debug.assert(child.end <= position); - lastNodeEntirelyBeforePosition = child; - } - } - else { - ts.Debug.assert(child.pos > position); - return true; - } - } - } - function checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks) { - var oldText = sourceFile.text; - if (textChangeRange) { - ts.Debug.assert((oldText.length - textChangeRange.span.length + textChangeRange.newLength) === newText.length); - if (aggressiveChecks || ts.Debug.shouldAssert(3)) { - var oldTextPrefix = oldText.substr(0, textChangeRange.span.start); - var newTextPrefix = newText.substr(0, textChangeRange.span.start); - ts.Debug.assert(oldTextPrefix === newTextPrefix); - var oldTextSuffix = oldText.substring(ts.textSpanEnd(textChangeRange.span), oldText.length); - var newTextSuffix = newText.substring(ts.textSpanEnd(ts.textChangeRangeNewSpan(textChangeRange)), newText.length); - ts.Debug.assert(oldTextSuffix === newTextSuffix); - } - } - } - function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks) { - aggressiveChecks = aggressiveChecks || ts.Debug.shouldAssert(2); - checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks); - if (ts.textChangeRangeIsUnchanged(textChangeRange)) { - return sourceFile; - } - if (sourceFile.statements.length === 0) { - return parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, undefined, true); - } - var incrementalSourceFile = sourceFile; - ts.Debug.assert(!incrementalSourceFile.hasBeenIncrementallyParsed); - incrementalSourceFile.hasBeenIncrementallyParsed = true; - var oldText = sourceFile.text; - var syntaxCursor = createSyntaxCursor(sourceFile); - var changeRange = extendToAffectedRange(sourceFile, textChangeRange); - checkChangeRange(sourceFile, newText, changeRange, aggressiveChecks); - ts.Debug.assert(changeRange.span.start <= textChangeRange.span.start); - ts.Debug.assert(ts.textSpanEnd(changeRange.span) === ts.textSpanEnd(textChangeRange.span)); - ts.Debug.assert(ts.textSpanEnd(ts.textChangeRangeNewSpan(changeRange)) === ts.textSpanEnd(ts.textChangeRangeNewSpan(textChangeRange))); - var delta = ts.textChangeRangeNewSpan(changeRange).length - changeRange.span.length; - updateTokenPositionsAndMarkElements(incrementalSourceFile, changeRange.span.start, ts.textSpanEnd(changeRange.span), ts.textSpanEnd(ts.textChangeRangeNewSpan(changeRange)), delta, oldText, newText, aggressiveChecks); - var result = parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, true); - return result; - } - ts.updateSourceFile = updateSourceFile; - function isEvalOrArgumentsIdentifier(node) { - return node.kind === 65 && - (node.text === "eval" || node.text === "arguments"); - } - ts.isEvalOrArgumentsIdentifier = isEvalOrArgumentsIdentifier; - function isUseStrictPrologueDirective(sourceFile, node) { - ts.Debug.assert(ts.isPrologueDirective(node)); - var nodeText = ts.getSourceTextOfNodeFromSourceFile(sourceFile, node.expression); - return nodeText === '"use strict"' || nodeText === "'use strict'"; - } - function createSyntaxCursor(sourceFile) { - var currentArray = sourceFile.statements; - var currentArrayIndex = 0; - ts.Debug.assert(currentArrayIndex < currentArray.length); - var current = currentArray[currentArrayIndex]; - var lastQueriedPosition = -1; - return { - currentNode: function (position) { - if (position !== lastQueriedPosition) { - if (current && current.end === position && currentArrayIndex < (currentArray.length - 1)) { - currentArrayIndex++; - current = currentArray[currentArrayIndex]; - } - if (!current || current.pos !== position) { - findHighestListElementThatStartsAtPosition(position); - } - } - lastQueriedPosition = position; - ts.Debug.assert(!current || current.pos === position); - return current; - } - }; - function findHighestListElementThatStartsAtPosition(position) { - currentArray = undefined; - currentArrayIndex = -1; - current = undefined; - forEachChild(sourceFile, visitNode, visitArray); - return; - function visitNode(node) { - if (position >= node.pos && position < node.end) { - forEachChild(node, visitNode, visitArray); - return true; - } - return false; - } - function visitArray(array) { - if (position >= array.pos && position < array.end) { - for (var i = 0, n = array.length; i < n; i++) { - var child = array[i]; - if (child) { - if (child.pos === position) { - currentArray = array; - currentArrayIndex = i; - current = child; - return true; - } - else { - if (child.pos < position && position < child.end) { - forEachChild(child, visitNode, visitArray); - return true; - } - } - } - } - } - return false; - } - } - } function createSourceFile(fileName, sourceText, languageVersion, setParentNodes) { if (setParentNodes === void 0) { setParentNodes = false; } var start = new Date().getTime(); - var result = parseSourceFile(fileName, sourceText, languageVersion, undefined, setParentNodes); + var result = Parser.parseSourceFile(fileName, sourceText, languageVersion, undefined, setParentNodes); ts.parseTime += new Date().getTime() - start; return result; } ts.createSourceFile = createSourceFile; - function parseSourceFile(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes) { - if (setParentNodes === void 0) { setParentNodes = false; } + function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks) { + return IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks); + } + ts.updateSourceFile = updateSourceFile; + var Parser; + (function (Parser) { + var scanner = ts.createScanner(2, true); var disallowInAndDecoratorContext = 2 | 16; - var parsingContext = 0; - var identifiers = {}; - var identifierCount = 0; - var nodeCount = 0; + var sourceFile; + var syntaxCursor; var token; - var sourceFile = createNode(227, 0); - sourceFile.pos = 0; - sourceFile.end = sourceText.length; - sourceFile.text = sourceText; - sourceFile.parseDiagnostics = []; - sourceFile.bindDiagnostics = []; - sourceFile.languageVersion = languageVersion; - sourceFile.fileName = ts.normalizePath(fileName); - sourceFile.flags = ts.fileExtensionIs(sourceFile.fileName, ".d.ts") ? 2048 : 0; + var sourceText; + var nodeCount; + var identifiers; + var identifierCount; + var parsingContext; var contextFlags = 0; var parseErrorBeforeNextFinishedNode = false; - var scanner = ts.createScanner(languageVersion, true, sourceText, scanError); - token = nextToken(); - processReferenceComments(sourceFile); - sourceFile.statements = parseList(0, true, parseSourceElement); - ts.Debug.assert(token === 1); - sourceFile.endOfFileToken = parseTokenNode(); - setExternalModuleIndicator(sourceFile); - sourceFile.nodeCount = nodeCount; - sourceFile.identifierCount = identifierCount; - sourceFile.identifiers = identifiers; - if (setParentNodes) { - fixupParentReferences(sourceFile); + function parseSourceFile(fileName, _sourceText, languageVersion, _syntaxCursor, setParentNodes) { + sourceText = _sourceText; + syntaxCursor = _syntaxCursor; + parsingContext = 0; + identifiers = {}; + identifierCount = 0; + nodeCount = 0; + contextFlags = 0; + parseErrorBeforeNextFinishedNode = false; + createSourceFile(fileName, languageVersion); + scanner.setText(sourceText); + scanner.setOnError(scanError); + scanner.setScriptTarget(languageVersion); + token = nextToken(); + processReferenceComments(sourceFile); + sourceFile.statements = parseList(0, true, parseSourceElement); + ts.Debug.assert(token === 1); + sourceFile.endOfFileToken = parseTokenNode(); + setExternalModuleIndicator(sourceFile); + sourceFile.nodeCount = nodeCount; + sourceFile.identifierCount = identifierCount; + sourceFile.identifiers = identifiers; + if (setParentNodes) { + fixupParentReferences(sourceFile); + } + syntaxCursor = undefined; + scanner.setText(""); + scanner.setOnError(undefined); + var result = sourceFile; + sourceFile = undefined; + identifiers = undefined; + syntaxCursor = undefined; + sourceText = undefined; + return result; + } + Parser.parseSourceFile = parseSourceFile; + function fixupParentReferences(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; + forEachChild(n, visitNode); + parent = saveParent; + } + } + } + function createSourceFile(fileName, languageVersion) { + sourceFile = createNode(227, 0); + sourceFile.pos = 0; + sourceFile.end = sourceText.length; + sourceFile.text = sourceText; + sourceFile.parseDiagnostics = []; + sourceFile.bindDiagnostics = []; + sourceFile.languageVersion = languageVersion; + sourceFile.fileName = ts.normalizePath(fileName); + sourceFile.flags = ts.fileExtensionIs(sourceFile.fileName, ".d.ts") ? 2048 : 0; } - syntaxCursor = undefined; - return sourceFile; function setContextFlag(val, flag) { if (val) { contextFlags |= flag; @@ -5261,10 +5108,10 @@ var ts; if (token === 65) { return true; } - if (token === 111 && inYieldContext()) { + if (token === 110 && inYieldContext()) { return false; } - return inStrictModeContext() ? token > 111 : token > 101; + return token > 101; } function parseExpected(kind, diagnosticMessage) { if (token === kind) { @@ -5358,6 +5205,9 @@ var ts; identifierCount++; if (isIdentifier) { var node = createNode(65); + if (token !== 65) { + node.originalKeywordKind = token; + } node.text = internIdentifier(scanner.getTokenValue()); nextToken(); return finishNode(node); @@ -5494,7 +5344,7 @@ var ts; ts.Debug.assert(token === 14); if (nextToken() === 15) { var next = nextToken(); - return next === 23 || next === 14 || next === 79 || next === 103; + return next === 23 || next === 14 || next === 79 || next === 102; } return true; } @@ -5503,7 +5353,7 @@ var ts; return isIdentifier(); } function isHeritageClauseExtendsOrImplementsKeyword() { - if (token === 103 || + if (token === 102 || token === 79) { return lookAhead(nextTokenIsStartOfExpression); } @@ -5531,11 +5381,11 @@ var ts; case 4: return token === 15 || token === 67 || token === 73; case 8: - return token === 14 || token === 79 || token === 103; + return token === 14 || token === 79 || token === 102; case 9: return isVariableDeclaratorListTerminator(); case 16: - return token === 25 || token === 16 || token === 14 || token === 79 || token === 103; + return token === 25 || token === 16 || token === 14 || token === 79 || token === 102; case 12: return token === 17 || token === 22; case 14: @@ -5604,6 +5454,11 @@ var ts; parsingContext = saveParsingContext; return result; } + function isUseStrictPrologueDirective(sourceFile, node) { + ts.Debug.assert(ts.isPrologueDirective(node)); + var nodeText = ts.getSourceTextOfNodeFromSourceFile(sourceFile, node.expression); + return nodeText === '"use strict"' || nodeText === "'use strict'"; + } function parseListElement(parsingContext, parseElement) { var node = currentNode(parsingContext); if (node) { @@ -5779,6 +5634,32 @@ var ts; nextToken(); return false; } + 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.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 parseDelimitedList(kind, parseElement, considerSemicolonAsDelimeter) { var saveParsingContext = parsingContext; parsingContext |= 1 << kind; @@ -6339,7 +6220,7 @@ var ts; case 38: case 39: case 24: - case 111: + case 110: return true; default: if (isBinaryOperator()) { @@ -6403,13 +6284,13 @@ var ts; if (expr.kind === 65 && token === 32) { return parseSimpleArrowFunctionExpression(expr); } - if (isLeftHandSideExpression(expr) && isAssignmentOperator(reScanGreaterToken())) { + if (ts.isLeftHandSideExpression(expr) && ts.isAssignmentOperator(reScanGreaterToken())) { return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher()); } return parseConditionalExpressionRest(expr); } function isYieldExpression() { - if (token === 111) { + if (token === 110) { if (inYieldContext()) { return true; } @@ -6497,6 +6378,9 @@ var ts; return 0; } } + if (second === 18 || second === 14) { + return 2; + } if (second === 21) { return 1; } @@ -6675,7 +6559,7 @@ var ts; } function parsePostfixExpressionOrHigher() { var expression = parseLeftHandSideExpressionOrHigher(); - ts.Debug.assert(isLeftHandSideExpression(expression)); + ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token === 38 || token === 39) && !scanner.hasPrecedingLineBreak()) { var node = createNode(168, expression.pos); node.operand = expression; @@ -7031,7 +6915,7 @@ var ts; parseExpected(16); var initializer = undefined; if (token !== 22) { - if (token === 98 || token === 105 || token === 70) { + if (token === 98 || token === 104 || token === 70) { initializer = parseVariableDeclarationList(true); } else { @@ -7192,7 +7076,7 @@ var ts; return !inErrorRecovery; case 14: case 98: - case 105: + case 104: case 83: case 69: case 84: @@ -7213,17 +7097,17 @@ var ts; case 70: var isConstEnum = lookAhead(nextTokenIsEnumKeyword); return !isConstEnum; - case 104: + case 103: case 117: case 77: case 123: if (isDeclarationStart()) { return false; } - case 109: - case 107: case 108: - case 110: + case 106: + case 107: + case 109: if (lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine)) { return false; } @@ -7278,7 +7162,7 @@ var ts; return parseTryStatement(); case 72: return parseDebuggerStatement(); - case 105: + case 104: if (isLetDeclaration()) { return parseVariableStatement(scanner.getStartPos(), undefined, undefined); } @@ -7303,7 +7187,7 @@ var ts; return undefined; } return parseVariableStatement(start, decorators, modifiers); - case 105: + case 104: if (!isLetDeclaration()) { return undefined; } @@ -7336,13 +7220,14 @@ var ts; } function parseObjectBindingElement() { var node = createNode(152); - var id = parsePropertyName(); - if (id.kind === 65 && token !== 51) { - node.name = id; + var tokenIsIdentifier = isIdentifier(); + var propertyName = parsePropertyName(); + if (tokenIsIdentifier && token !== 51) { + node.name = propertyName; } else { parseExpected(51); - node.propertyName = id; + node.propertyName = propertyName; node.name = parseIdentifierOrPattern(); } node.initializer = parseInitializer(false); @@ -7388,7 +7273,7 @@ var ts; switch (token) { case 98: break; - case 105: + case 104: node.flags |= 4096; break; case 70: @@ -7485,6 +7370,17 @@ var ts; node.body = parseFunctionBlockOrSemicolon(false); return finishNode(node); } + function isClassMemberModifier(idToken) { + switch (idToken) { + case 108: + case 106: + case 107: + case 109: + return true; + default: + return false; + } + } function isClassMemberStart() { var idToken; if (token === 52) { @@ -7492,6 +7388,9 @@ var ts; } while (ts.isModifier(token)) { idToken = token; + if (isClassMemberModifier(idToken)) { + return true; + } nextToken(); } if (token === 35) { @@ -7554,7 +7453,7 @@ var ts; modifiers = []; modifiers.pos = modifierStart; } - flags |= modifierToFlag(modifierKind); + flags |= ts.modifierToFlag(modifierKind); modifiers.push(finishNode(createNode(modifierKind, modifierStart))); } if (modifiers) { @@ -7603,14 +7502,12 @@ var ts; } function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) { var savedStrictModeContext = inStrictModeContext(); - if (languageVersion >= 2) { - setStrictModeContext(true); - } + setStrictModeContext(true); var node = createNode(kind, fullStart); node.decorators = decorators; setModifiers(node, modifiers); parseExpected(69); - node.name = node.flags & 256 ? parseOptionalIdentifier() : parseIdentifier(); + node.name = parseOptionalIdentifier(); node.typeParameters = parseTypeParameters(); node.heritageClauses = parseHeritageClauses(true); if (parseExpected(14)) { @@ -7641,7 +7538,7 @@ var ts; return parseList(19, false, parseHeritageClause); } function parseHeritageClause() { - if (token === 79 || token === 103) { + if (token === 79 || token === 102) { var node = createNode(222); node.token = token; nextToken(); @@ -7659,7 +7556,7 @@ var ts; return finishNode(node); } function isHeritageClause() { - return token === 79 || token === 103; + return token === 79 || token === 102; } function parseClassMembers() { return parseList(6, false, parseClassElement); @@ -7668,7 +7565,7 @@ var ts; var node = createNode(202, fullStart); node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(104); + parseExpected(103); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); node.heritageClauses = parseHeritageClauses(false); @@ -7825,7 +7722,7 @@ var ts; function parseNamespaceImport() { var namespaceImport = createNode(211); parseExpected(35); - parseExpected(102); + parseExpected(111); namespaceImport.name = parseIdentifier(); return finishNode(namespaceImport); } @@ -7846,9 +7743,9 @@ var ts; var checkIdentifierStart = scanner.getTokenPos(); var checkIdentifierEnd = scanner.getTextPos(); var identifierName = parseIdentifierName(); - if (token === 102) { + if (token === 111) { node.propertyName = identifierName; - parseExpected(102); + parseExpected(111); checkIdentifierIsKeyword = ts.isKeyword(token) && !isIdentifier(); checkIdentifierStart = scanner.getTokenPos(); checkIdentifierEnd = scanner.getTextPos(); @@ -7885,17 +7782,11 @@ var ts; setModifiers(node, modifiers); if (parseOptional(53)) { node.isExportEquals = true; - node.expression = parseAssignmentExpressionOrHigher(); } else { parseExpected(73); - if (parseOptional(51)) { - node.type = parseType(); - } - else { - node.expression = parseAssignmentExpressionOrHigher(); - } } + node.expression = parseAssignmentExpressionOrHigher(); parseSemicolon(); return finishNode(node); } @@ -7908,10 +7799,10 @@ var ts; case 70: case 83: return true; - case 105: + case 104: return isLetDeclaration(); case 69: - case 104: + case 103: case 77: case 123: return lookAhead(nextTokenIsIdentifierOrKeyword); @@ -7922,10 +7813,10 @@ var ts; case 78: return lookAhead(nextTokenCanFollowExportKeyword); case 115: - case 109: - case 107: case 108: - case 110: + case 106: + case 107: + case 109: return lookAhead(nextTokenIsDeclarationStart); case 52: return !followsModifier; @@ -7957,7 +7848,7 @@ var ts; return isDeclarationStart(true); } function nextTokenIsAsKeyword() { - return nextToken() === 102; + return nextToken() === 111; } function parseDeclaration() { var fullStart = getNodePos(); @@ -7974,14 +7865,14 @@ var ts; } switch (token) { case 98: - case 105: + case 104: case 70: return parseVariableStatement(fullStart, decorators, modifiers); case 83: return parseFunctionDeclaration(fullStart, decorators, modifiers); case 69: return parseClassDeclaration(fullStart, decorators, modifiers); - case 104: + case 103: return parseInterfaceDeclaration(fullStart, decorators, modifiers); case 123: return parseTypeAliasDeclaration(fullStart, decorators, modifiers); @@ -8029,7 +7920,7 @@ var ts; if (kind !== 2) { break; } - var range = { pos: triviaScanner.getTokenPos(), end: triviaScanner.getTextPos() }; + var range = { pos: triviaScanner.getTokenPos(), end: triviaScanner.getTextPos(), kind: triviaScanner.getToken() }; var comment = sourceText.substring(range.pos, range.end); var referencePathMatchResult = ts.getFileReferenceFromReferencePath(comment, range); if (referencePathMatchResult) { @@ -8081,41 +7972,282 @@ var ts; : undefined; }); } - } - function isLeftHandSideExpression(expr) { - if (expr) { - switch (expr.kind) { - case 155: - case 156: - case 158: - case 157: - case 159: - case 153: - case 161: - case 154: - case 174: - case 162: - case 65: - case 9: - case 7: - case 8: - case 10: - case 171: - case 80: - case 89: - case 93: - case 95: - case 91: - return true; + })(Parser || (Parser = {})); + var IncrementalParser; + (function (IncrementalParser) { + function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks) { + aggressiveChecks = aggressiveChecks || ts.Debug.shouldAssert(2); + checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks); + if (ts.textChangeRangeIsUnchanged(textChangeRange)) { + return sourceFile; + } + if (sourceFile.statements.length === 0) { + return Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, undefined, true); + } + var incrementalSourceFile = sourceFile; + ts.Debug.assert(!incrementalSourceFile.hasBeenIncrementallyParsed); + incrementalSourceFile.hasBeenIncrementallyParsed = true; + var oldText = sourceFile.text; + var syntaxCursor = createSyntaxCursor(sourceFile); + var changeRange = extendToAffectedRange(sourceFile, textChangeRange); + checkChangeRange(sourceFile, newText, changeRange, aggressiveChecks); + ts.Debug.assert(changeRange.span.start <= textChangeRange.span.start); + ts.Debug.assert(ts.textSpanEnd(changeRange.span) === ts.textSpanEnd(textChangeRange.span)); + ts.Debug.assert(ts.textSpanEnd(ts.textChangeRangeNewSpan(changeRange)) === ts.textSpanEnd(ts.textChangeRangeNewSpan(textChangeRange))); + var delta = ts.textChangeRangeNewSpan(changeRange).length - changeRange.span.length; + updateTokenPositionsAndMarkElements(incrementalSourceFile, changeRange.span.start, ts.textSpanEnd(changeRange.span), ts.textSpanEnd(ts.textChangeRangeNewSpan(changeRange)), delta, oldText, newText, aggressiveChecks); + var result = Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, true); + return result; + } + IncrementalParser.updateSourceFile = updateSourceFile; + function moveElementEntirelyPastChangeRange(element, isArray, delta, oldText, newText, aggressiveChecks) { + if (isArray) { + visitArray(element); + } + else { + visitNode(element); + } + return; + function visitNode(node) { + if (aggressiveChecks && shouldCheckNode(node)) { + var text = oldText.substring(node.pos, node.end); + } + node._children = undefined; + node.pos += delta; + node.end += delta; + if (aggressiveChecks && shouldCheckNode(node)) { + ts.Debug.assert(text === newText.substring(node.pos, node.end)); + } + forEachChild(node, visitNode, visitArray); + checkNodePositions(node, aggressiveChecks); + } + function visitArray(array) { + array._children = undefined; + array.pos += delta; + array.end += delta; + for (var _i = 0; _i < array.length; _i++) { + var node = array[_i]; + visitNode(node); + } } } - return false; - } - ts.isLeftHandSideExpression = isLeftHandSideExpression; - function isAssignmentOperator(token) { - return token >= 53 && token <= 64; - } - ts.isAssignmentOperator = isAssignmentOperator; + function shouldCheckNode(node) { + switch (node.kind) { + case 8: + case 7: + case 65: + return true; + } + return false; + } + function adjustIntersectingElement(element, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta) { + ts.Debug.assert(element.end >= changeStart, "Adjusting an element that was entirely before the change range"); + ts.Debug.assert(element.pos <= changeRangeOldEnd, "Adjusting an element that was entirely after the change range"); + ts.Debug.assert(element.pos <= element.end); + element.pos = Math.min(element.pos, changeRangeNewEnd); + if (element.end >= changeRangeOldEnd) { + element.end += delta; + } + else { + element.end = Math.min(element.end, changeRangeNewEnd); + } + ts.Debug.assert(element.pos <= element.end); + if (element.parent) { + ts.Debug.assert(element.pos >= element.parent.pos); + ts.Debug.assert(element.end <= element.parent.end); + } + } + function checkNodePositions(node, aggressiveChecks) { + if (aggressiveChecks) { + var pos = node.pos; + forEachChild(node, function (child) { + ts.Debug.assert(child.pos >= pos); + pos = child.end; + }); + ts.Debug.assert(pos <= node.end); + } + } + function updateTokenPositionsAndMarkElements(sourceFile, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta, oldText, newText, aggressiveChecks) { + visitNode(sourceFile); + return; + function visitNode(child) { + ts.Debug.assert(child.pos <= child.end); + if (child.pos > changeRangeOldEnd) { + moveElementEntirelyPastChangeRange(child, false, delta, oldText, newText, aggressiveChecks); + return; + } + var fullEnd = child.end; + if (fullEnd >= changeStart) { + child.intersectsChange = true; + child._children = undefined; + adjustIntersectingElement(child, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); + forEachChild(child, visitNode, visitArray); + checkNodePositions(child, aggressiveChecks); + return; + } + ts.Debug.assert(fullEnd < changeStart); + } + function visitArray(array) { + ts.Debug.assert(array.pos <= array.end); + if (array.pos > changeRangeOldEnd) { + moveElementEntirelyPastChangeRange(array, true, delta, oldText, newText, aggressiveChecks); + return; + } + var fullEnd = array.end; + if (fullEnd >= changeStart) { + array.intersectsChange = true; + array._children = undefined; + adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); + for (var _i = 0; _i < array.length; _i++) { + var node = array[_i]; + visitNode(node); + } + return; + } + ts.Debug.assert(fullEnd < changeStart); + } + } + function extendToAffectedRange(sourceFile, changeRange) { + var maxLookahead = 1; + var start = changeRange.span.start; + for (var i = 0; start > 0 && i <= maxLookahead; i++) { + var nearestNode = findNearestNodeStartingBeforeOrAtPosition(sourceFile, start); + ts.Debug.assert(nearestNode.pos <= start); + var position = nearestNode.pos; + start = Math.max(0, position - 1); + } + var finalSpan = ts.createTextSpanFromBounds(start, ts.textSpanEnd(changeRange.span)); + var finalLength = changeRange.newLength + (changeRange.span.start - start); + return ts.createTextChangeRange(finalSpan, finalLength); + } + function findNearestNodeStartingBeforeOrAtPosition(sourceFile, position) { + var bestResult = sourceFile; + var lastNodeEntirelyBeforePosition; + forEachChild(sourceFile, visit); + if (lastNodeEntirelyBeforePosition) { + var lastChildOfLastEntireNodeBeforePosition = getLastChild(lastNodeEntirelyBeforePosition); + if (lastChildOfLastEntireNodeBeforePosition.pos > bestResult.pos) { + bestResult = lastChildOfLastEntireNodeBeforePosition; + } + } + return bestResult; + function getLastChild(node) { + while (true) { + var lastChild = getLastChildWorker(node); + if (lastChild) { + node = lastChild; + } + else { + return node; + } + } + } + function getLastChildWorker(node) { + var last = undefined; + forEachChild(node, function (child) { + if (ts.nodeIsPresent(child)) { + last = child; + } + }); + return last; + } + function visit(child) { + if (ts.nodeIsMissing(child)) { + return; + } + if (child.pos <= position) { + if (child.pos >= bestResult.pos) { + bestResult = child; + } + if (position < child.end) { + forEachChild(child, visit); + return true; + } + else { + ts.Debug.assert(child.end <= position); + lastNodeEntirelyBeforePosition = child; + } + } + else { + ts.Debug.assert(child.pos > position); + return true; + } + } + } + function checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks) { + var oldText = sourceFile.text; + if (textChangeRange) { + ts.Debug.assert((oldText.length - textChangeRange.span.length + textChangeRange.newLength) === newText.length); + if (aggressiveChecks || ts.Debug.shouldAssert(3)) { + var oldTextPrefix = oldText.substr(0, textChangeRange.span.start); + var newTextPrefix = newText.substr(0, textChangeRange.span.start); + ts.Debug.assert(oldTextPrefix === newTextPrefix); + var oldTextSuffix = oldText.substring(ts.textSpanEnd(textChangeRange.span), oldText.length); + var newTextSuffix = newText.substring(ts.textSpanEnd(ts.textChangeRangeNewSpan(textChangeRange)), newText.length); + ts.Debug.assert(oldTextSuffix === newTextSuffix); + } + } + } + function createSyntaxCursor(sourceFile) { + var currentArray = sourceFile.statements; + var currentArrayIndex = 0; + ts.Debug.assert(currentArrayIndex < currentArray.length); + var current = currentArray[currentArrayIndex]; + var lastQueriedPosition = -1; + return { + currentNode: function (position) { + if (position !== lastQueriedPosition) { + if (current && current.end === position && currentArrayIndex < (currentArray.length - 1)) { + currentArrayIndex++; + current = currentArray[currentArrayIndex]; + } + if (!current || current.pos !== position) { + findHighestListElementThatStartsAtPosition(position); + } + } + lastQueriedPosition = position; + ts.Debug.assert(!current || current.pos === position); + return current; + } + }; + function findHighestListElementThatStartsAtPosition(position) { + currentArray = undefined; + currentArrayIndex = -1; + current = undefined; + forEachChild(sourceFile, visitNode, visitArray); + return; + function visitNode(node) { + if (position >= node.pos && position < node.end) { + forEachChild(node, visitNode, visitArray); + return true; + } + return false; + } + function visitArray(array) { + if (position >= array.pos && position < array.end) { + for (var i = 0, n = array.length; i < n; i++) { + var child = array[i]; + if (child) { + if (child.pos === position) { + currentArray = array; + currentArrayIndex = i; + current = child; + return true; + } + else { + if (child.pos < position && position < child.end) { + forEachChild(child, visitNode, visitArray); + return true; + } + } + } + } + } + return false; + } + } + } + })(IncrementalParser || (IncrementalParser = {})); })(ts || (ts = {})); /// var ts; @@ -8433,23 +8565,26 @@ var ts; function bindCatchVariableDeclaration(node) { bindChildren(node, 0, true); } - function bindBlockScopedVariableDeclaration(node) { + function bindBlockScopedDeclaration(node, symbolKind, symbolExcludes) { switch (blockScopeContainer.kind) { case 205: - declareModuleMember(node, 2, 107455); + declareModuleMember(node, symbolKind, symbolExcludes); break; case 227: if (ts.isExternalModule(container)) { - declareModuleMember(node, 2, 107455); + declareModuleMember(node, symbolKind, symbolExcludes); break; } default: if (!blockScopeContainer.locals) { blockScopeContainer.locals = {}; } - declareSymbol(blockScopeContainer.locals, undefined, node, 2, 107455); + declareSymbol(blockScopeContainer.locals, undefined, node, symbolKind, symbolExcludes); } - bindChildren(node, 2, false); + bindChildren(node, symbolKind, false); + } + function bindBlockScopedVariableDeclaration(node) { + bindBlockScopedDeclaration(node, 2, 107455); } function getDestructuringParameterName(node) { return "__" + ts.indexOf(node.parent.parameters, node); @@ -8528,7 +8663,7 @@ var ts; bindCatchVariableDeclaration(node); break; case 201: - bindDeclaration(node, 32, 899583, false); + bindBlockScopedDeclaration(node, 32, 899583); break; case 202: bindDeclaration(node, 64, 792992, false); @@ -8568,7 +8703,7 @@ var ts; bindChildren(node, 0, false); break; case 214: - if (node.expression && node.expression.kind === 65) { + if (node.expression.kind === 65) { declareSymbol(container.symbol.exports, container.symbol, node, 8388608, 107455 | 8388608); } else { @@ -8689,7 +8824,7 @@ var ts; isImplementationOfOverload: isImplementationOfOverload, getAliasedSymbol: resolveAlias, getEmitResolver: getEmitResolver, - getExportsOfExternalModule: getExportsOfExternalModule + getExportsOfModule: getExportsOfModuleAsArray }; var unknownSymbol = createSymbol(4 | 67108864, "unknown"); var resolvingSymbol = createSymbol(67108864, "__resolving__"); @@ -8732,6 +8867,7 @@ var ts; var stringLiteralTypes = {}; var emitExtends = false; var emitDecorate = false; + var emitParam = false; var mergedSymbols = []; var symbolLinks = []; var nodeLinks = []; @@ -8949,7 +9085,8 @@ var ts; } result = undefined; } - else if (location.kind === 227) { + else if (location.kind === 227 || + (location.kind === 205 && location.name.kind === 8)) { result = getSymbol(getSymbolOfNode(location).exports, "default", meaning & 8914931); var localSymbol = ts.getLocalSymbolForExportDefault(result); if (result && (result.flags & meaning) && localSymbol && localSymbol.name === name) { @@ -9127,7 +9264,7 @@ var ts; if (moduleSymbol.flags & 3) { var typeAnnotation = moduleSymbol.valueDeclaration.type; if (typeAnnotation) { - return getPropertyOfType(getTypeFromTypeNodeOrHeritageClauseElement(typeAnnotation), name); + return getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name); } } } @@ -9158,7 +9295,7 @@ var ts; if (symbol.flags & 3) { var typeAnnotation = symbol.valueDeclaration.type; if (typeAnnotation) { - return resolveSymbol(getPropertyOfType(getTypeFromTypeNodeOrHeritageClauseElement(typeAnnotation), name)); + return resolveSymbol(getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name)); } } } @@ -9189,7 +9326,7 @@ var ts; resolveEntityName(node.propertyName || node.name, 107455 | 793056 | 1536); } function getTargetOfExportAssignment(node) { - return node.expression && resolveEntityName(node.expression, 107455 | 793056 | 1536); + return resolveEntityName(node.expression, 107455 | 793056 | 1536); } function getTargetOfAliasDeclaration(node) { switch (node.kind) { @@ -9245,7 +9382,7 @@ var ts; if (!links.referenced) { links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); - if (node.kind === 214 && node.expression) { + if (node.kind === 214) { checkExpressionCached(node.expression); } else if (node.kind === 217) { @@ -9360,6 +9497,9 @@ var ts; function getExportAssignmentSymbol(moduleSymbol) { return moduleSymbol.exports["export="]; } + function getExportsOfModuleAsArray(moduleSymbol) { + return symbolsToArray(getExportsOfModule(moduleSymbol)); + } function getExportsOfSymbol(symbol) { return symbol.flags & 1536 ? getExportsOfModule(symbol) : symbol.exports || emptySymbols; } @@ -9380,7 +9520,7 @@ var ts; visit(moduleSymbol); return result || moduleSymbol.exports; function visit(symbol) { - if (symbol.flags & 1952 && !ts.contains(visitedSymbols, symbol)) { + if (symbol && symbol.flags & 1952 && !ts.contains(visitedSymbols, symbol)) { visitedSymbols.push(symbol); if (symbol !== moduleSymbol) { if (!result) { @@ -10291,13 +10431,15 @@ var ts; } } else { - if (!isArrayLikeType(parentType)) { - error(pattern, ts.Diagnostics.Type_0_is_not_an_array_type, typeToString(parentType)); - return unknownType; - } + var elementType = checkIteratedTypeOrElementType(parentType, pattern, false); if (!declaration.dotDotDotToken) { + if (elementType.flags & 1) { + return elementType; + } var propName = "" + ts.indexOf(pattern.elements, declaration); - type = isTupleLikeType(parentType) ? getTypeOfPropertyOfType(parentType, propName) : getIndexTypeOfType(parentType, 1); + type = isTupleLikeType(parentType) + ? getTypeOfPropertyOfType(parentType, propName) + : elementType; if (!type) { if (isTupleType(parentType)) { error(declaration, ts.Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2, typeToString(parentType), parentType.elementTypes.length, pattern.elements.length); @@ -10309,7 +10451,7 @@ var ts; } } else { - type = createArrayType(getIndexTypeOfType(parentType, 1)); + type = createArrayType(elementType); } } return type; @@ -10325,7 +10467,7 @@ var ts; return getTypeForBindingElement(declaration); } if (declaration.type) { - return getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); + return getTypeFromTypeNode(declaration.type); } if (declaration.kind === 129) { var func = declaration.parent; @@ -10377,7 +10519,14 @@ var ts; hasSpreadElement = true; } }); - return !elementTypes.length ? anyArrayType : hasSpreadElement ? createArrayType(getUnionType(elementTypes)) : createTupleType(elementTypes); + if (!elementTypes.length) { + return languageVersion >= 2 ? createIterableType(anyType) : anyArrayType; + } + else if (hasSpreadElement) { + var unionOfElements = getUnionType(elementTypes); + return languageVersion >= 2 ? createIterableType(unionOfElements) : createArrayType(unionOfElements); + } + return createTupleType(elementTypes); } function getTypeFromBindingPattern(pattern) { return pattern.kind === 150 @@ -10415,16 +10564,7 @@ var ts; return links.type = anyType; } 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; - } + return links.type = checkExpression(declaration.expression); } links.type = resolvingType; var type = getWidenedTypeForVariableLikeDeclaration(declaration, true); @@ -10449,11 +10589,11 @@ var ts; function getAnnotatedAccessorType(accessor) { if (accessor) { if (accessor.kind === 136) { - return accessor.type && getTypeFromTypeNodeOrHeritageClauseElement(accessor.type); + return accessor.type && getTypeFromTypeNode(accessor.type); } else { var setterTypeAnnotation = getSetAccessorTypeAnnotationNode(accessor); - return setterTypeAnnotation && getTypeFromTypeNodeOrHeritageClauseElement(setterTypeAnnotation); + return setterTypeAnnotation && getTypeFromTypeNode(setterTypeAnnotation); } } return undefined; @@ -10559,7 +10699,7 @@ var ts; return check(type); function check(type) { var target = getTargetType(type); - return target === checkBase || ts.forEach(target.baseTypes, check); + return target === checkBase || ts.forEach(getBaseTypes(target), check); } } function getTypeParametersOfClassOrInterface(symbol) { @@ -10582,6 +10722,67 @@ var ts; }); return result; } + function getBaseTypes(type) { + var typeWithBaseTypes = type; + if (!typeWithBaseTypes.baseTypes) { + if (type.symbol.flags & 32) { + resolveBaseTypesOfClass(typeWithBaseTypes); + } + else if (type.symbol.flags & 64) { + resolveBaseTypesOfInterface(typeWithBaseTypes); + } + else { + ts.Debug.fail("type must be class or interface"); + } + } + return typeWithBaseTypes.baseTypes; + } + function resolveBaseTypesOfClass(type) { + type.baseTypes = []; + var declaration = ts.getDeclarationOfKind(type.symbol, 201); + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(declaration); + if (baseTypeNode) { + var baseType = getTypeFromHeritageClauseElement(baseTypeNode); + if (baseType !== unknownType) { + if (getTargetType(baseType).flags & 1024) { + if (type !== baseType && !hasBaseType(baseType, type)) { + type.baseTypes.push(baseType); + } + else { + error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1)); + } + } + else { + error(baseTypeNode, ts.Diagnostics.A_class_may_only_extend_another_class); + } + } + } + } + function resolveBaseTypesOfInterface(type) { + type.baseTypes = []; + for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + if (declaration.kind === 202 && ts.getInterfaceBaseTypeNodes(declaration)) { + for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { + var node = _c[_b]; + var baseType = getTypeFromHeritageClauseElement(node); + if (baseType !== unknownType) { + if (getTargetType(baseType).flags & (1024 | 2048)) { + if (type !== baseType && !hasBaseType(baseType, type)) { + type.baseTypes.push(baseType); + } + else { + error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1)); + } + } + else { + error(node, ts.Diagnostics.An_interface_may_only_extend_a_class_or_another_interface); + } + } + } + } + } + } function getDeclaredTypeOfClass(symbol) { var links = getSymbolLinks(symbol); if (!links.declaredType) { @@ -10595,25 +10796,6 @@ var ts; type.target = type; type.typeArguments = type.typeParameters; } - type.baseTypes = []; - var declaration = ts.getDeclarationOfKind(symbol, 201); - var baseTypeNode = ts.getClassExtendsHeritageClauseElement(declaration); - if (baseTypeNode) { - var baseType = getTypeFromHeritageClauseElement(baseTypeNode); - if (baseType !== unknownType) { - if (getTargetType(baseType).flags & 1024) { - if (type !== baseType && !hasBaseType(baseType, type)) { - type.baseTypes.push(baseType); - } - else { - error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1)); - } - } - else { - error(baseTypeNode, ts.Diagnostics.A_class_may_only_extend_another_class); - } - } - } type.declaredProperties = getNamedMembers(symbol.members); type.declaredCallSignatures = emptyArray; type.declaredConstructSignatures = emptyArray; @@ -10635,27 +10817,6 @@ var ts; type.target = type; type.typeArguments = type.typeParameters; } - type.baseTypes = []; - ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 202 && ts.getInterfaceBaseTypeNodes(declaration)) { - ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), function (node) { - var baseType = getTypeFromHeritageClauseElement(node); - if (baseType !== unknownType) { - if (getTargetType(baseType).flags & (1024 | 2048)) { - if (type !== baseType && !hasBaseType(baseType, type)) { - type.baseTypes.push(baseType); - } - else { - error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1)); - } - } - else { - error(node, ts.Diagnostics.An_interface_may_only_extend_a_class_or_another_interface); - } - } - }); - } - }); type.declaredProperties = getNamedMembers(symbol.members); type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]); type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]); @@ -10669,7 +10830,7 @@ var ts; if (!links.declaredType) { links.declaredType = resolvingType; var declaration = ts.getDeclarationOfKind(symbol, 203); - var type = getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); + var type = getTypeFromTypeNode(declaration.type); if (links.declaredType === resolvingType) { links.declaredType = type; } @@ -10769,15 +10930,17 @@ var ts; var constructSignatures = type.declaredConstructSignatures; var stringIndexType = type.declaredStringIndexType; var numberIndexType = type.declaredNumberIndexType; - if (type.baseTypes.length) { + var baseTypes = getBaseTypes(type); + if (baseTypes.length) { members = createSymbolTable(type.declaredProperties); - ts.forEach(type.baseTypes, function (baseType) { + for (var _i = 0; _i < baseTypes.length; _i++) { + var baseType = baseTypes[_i]; addInheritedMembers(members, getPropertiesOfObjectType(baseType)); callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(baseType, 0)); constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(baseType, 1)); stringIndexType = stringIndexType || getIndexTypeOfType(baseType, 0); numberIndexType = numberIndexType || getIndexTypeOfType(baseType, 1); - }); + } } setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } @@ -10789,7 +10952,7 @@ var ts; var constructSignatures = instantiateList(target.declaredConstructSignatures, mapper, instantiateSignature); var stringIndexType = target.declaredStringIndexType ? instantiateType(target.declaredStringIndexType, mapper) : undefined; var numberIndexType = target.declaredNumberIndexType ? instantiateType(target.declaredNumberIndexType, mapper) : undefined; - ts.forEach(target.baseTypes, function (baseType) { + ts.forEach(getBaseTypes(target), function (baseType) { var instantiatedBaseType = instantiateType(baseType, mapper); addInheritedMembers(members, getPropertiesOfObjectType(instantiatedBaseType)); callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, 0)); @@ -10814,8 +10977,9 @@ var ts; return createSignature(sig.declaration, sig.typeParameters, sig.parameters, sig.resolvedReturnType, sig.minArgumentCount, sig.hasRestParameter, sig.hasStringLiterals); } function getDefaultConstructSignatures(classType) { - if (classType.baseTypes.length) { - var baseType = classType.baseTypes[0]; + var baseTypes = getBaseTypes(classType); + if (baseTypes.length) { + var baseType = baseTypes[0]; var baseSignatures = getSignaturesOfType(getTypeOfSymbol(baseType.symbol), 1); return ts.map(baseSignatures, function (baseSignature) { var signature = baseType.flags & 4096 ? @@ -10924,9 +11088,10 @@ var ts; if (!constructSignatures.length) { constructSignatures = getDefaultConstructSignatures(classType); } - if (classType.baseTypes.length) { + var baseTypes = getBaseTypes(classType); + if (baseTypes.length) { members = createSymbolTable(getNamedMembers(members)); - addInheritedMembers(members, getPropertiesOfObjectType(getTypeOfSymbol(classType.baseTypes[0].symbol))); + addInheritedMembers(members, getPropertiesOfObjectType(getTypeOfSymbol(baseTypes[0].symbol))); } } stringIndexType = undefined; @@ -10982,12 +11147,13 @@ var ts; return result; } function getPropertiesOfType(type) { - if (type.flags & 16384) { - return getPropertiesOfUnionType(type); - } - return getPropertiesOfObjectType(getApparentType(type)); + type = getApparentType(type); + return type.flags & 16384 ? getPropertiesOfUnionType(type) : getPropertiesOfObjectType(type); } function getApparentType(type) { + if (type.flags & 16384) { + type = getReducedTypeOfUnionType(type); + } if (type.flags & 512) { do { type = getConstraintOfTypeParameter(type); @@ -11056,28 +11222,27 @@ var ts; return property; } function getPropertyOfType(type, name) { + type = getApparentType(type); + if (type.flags & 48128) { + var resolved = resolveObjectOrUnionTypeMembers(type); + if (ts.hasProperty(resolved.members, name)) { + var symbol = resolved.members[name]; + if (symbolIsValue(symbol)) { + return symbol; + } + } + if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { + var symbol = getPropertyOfObjectType(globalFunctionType, name); + if (symbol) { + return symbol; + } + } + return getPropertyOfObjectType(globalObjectType, name); + } if (type.flags & 16384) { return getPropertyOfUnionType(type, name); } - if (!(type.flags & 48128)) { - type = getApparentType(type); - if (!(type.flags & 48128)) { - return undefined; - } - } - var resolved = resolveObjectOrUnionTypeMembers(type); - if (ts.hasProperty(resolved.members, name)) { - var symbol = resolved.members[name]; - if (symbolIsValue(symbol)) { - return symbol; - } - } - if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { - var symbol = getPropertyOfObjectType(globalFunctionType, name); - if (symbol) - return symbol; - } - return getPropertyOfObjectType(globalObjectType, name); + return undefined; } function getSignaturesOfObjectOrUnionType(type, kind) { if (type.flags & (48128 | 16384)) { @@ -11089,6 +11254,15 @@ var ts; function getSignaturesOfType(type, kind) { return getSignaturesOfObjectOrUnionType(getApparentType(type), kind); } + function typeHasCallOrConstructSignatures(type) { + var apparentType = getApparentType(type); + if (apparentType.flags & (48128 | 16384)) { + var resolved = resolveObjectOrUnionTypeMembers(type); + return resolved.callSignatures.length > 0 + || resolved.constructSignatures.length > 0; + } + return false; + } function getIndexTypeOfObjectOrUnionType(type, kind) { if (type.flags & (48128 | 16384)) { var resolved = resolveObjectOrUnionTypeMembers(type); @@ -11117,16 +11291,6 @@ var ts; } return result; } - function getExportsOfExternalModule(node) { - if (!node.moduleSpecifier) { - return emptyArray; - } - var module = resolveExternalModuleName(node, node.moduleSpecifier); - if (!module) { - return emptyArray; - } - return symbolsToArray(getExportsOfModule(module)); - } function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { @@ -11156,7 +11320,7 @@ var ts; returnType = classType; } else if (declaration.type) { - returnType = getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); + returnType = getTypeFromTypeNode(declaration.type); } else { if (declaration.kind === 136 && !ts.hasDynamicName(declaration)) { @@ -11294,7 +11458,7 @@ var ts; function getIndexTypeOfSymbol(symbol, kind) { var declaration = getIndexDeclarationOfSymbol(symbol, kind); return declaration - ? declaration.type ? getTypeFromTypeNodeOrHeritageClauseElement(declaration.type) : anyType + ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType : undefined; } function getConstraintOfTypeParameter(type) { @@ -11304,7 +11468,7 @@ var ts; type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNodeOrHeritageClauseElement(ts.getDeclarationOfKind(type.symbol, 128).constraint); + type.constraint = getTypeFromTypeNode(ts.getDeclarationOfKind(type.symbol, 128).constraint); } } return type.constraint === noConstraintType ? undefined : type.constraint; @@ -11403,7 +11567,7 @@ var ts; 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)); + 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); @@ -11473,6 +11637,9 @@ var ts; function getGlobalESSymbolConstructorSymbol() { return globalESSymbolConstructorSymbol || (globalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol")); } + function createIterableType(elementType) { + return globalIterableType !== emptyObjectType ? createTypeReference(globalIterableType, [elementType]) : emptyObjectType; + } function createArrayType(elementType) { var arrayType = globalArrayType || getDeclaredTypeOfSymbol(globalArraySymbol); return arrayType !== emptyObjectType ? createTypeReference(arrayType, [elementType]) : emptyObjectType; @@ -11480,7 +11647,7 @@ var ts; function getTypeFromArrayTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createArrayType(getTypeFromTypeNodeOrHeritageClauseElement(node.elementType)); + links.resolvedType = createArrayType(getTypeFromTypeNode(node.elementType)); } return links.resolvedType; } @@ -11496,7 +11663,7 @@ var ts; function getTypeFromTupleTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createTupleType(ts.map(node.elementTypes, getTypeFromTypeNodeOrHeritageClauseElement)); + links.resolvedType = createTupleType(ts.map(node.elementTypes, getTypeFromTypeNode)); } return links.resolvedType; } @@ -11581,13 +11748,20 @@ var ts; if (!type) { type = unionTypes[id] = createObjectType(16384 | getWideningFlagsOfTypes(sortedTypes)); type.types = sortedTypes; + type.reducedType = noSubtypeReduction ? undefined : type; } return type; } + function getReducedTypeOfUnionType(type) { + if (!type.reducedType) { + type.reducedType = getUnionType(type.types, false); + } + return type.reducedType; + } function getTypeFromUnionTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNodeOrHeritageClauseElement), true); + links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNode), true); } return links.resolvedType; } @@ -11613,7 +11787,7 @@ var ts; } return links.resolvedType; } - function getTypeFromTypeNodeOrHeritageClauseElement(node) { + function getTypeFromTypeNode(node) { switch (node.kind) { case 112: return anyType; @@ -11642,7 +11816,7 @@ var ts; case 148: return getTypeFromUnionTypeNode(node); case 149: - return getTypeFromTypeNodeOrHeritageClauseElement(node.type); + return getTypeFromTypeNode(node.type); case 142: case 143: case 145: @@ -11918,6 +12092,7 @@ var ts; return -1; } } + var saveErrorInfo = errorInfo; if (source.flags & 16384 || target.flags & 16384) { if (relation === identityRelation) { if (source.flags & 16384 && target.flags & 16384) { @@ -11956,21 +12131,25 @@ var ts; 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; - } + else if (source.flags & 4096 && target.flags & 4096 && source.target === target.target) { + 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))) { + } + var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; + var sourceOrApparentType = relation === identityRelation ? source : getApparentType(source); + if (sourceOrApparentType.flags & 48128 && target.flags & 48128) { + if (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors)) { errorInfo = saveErrorInfo; return result; } } + else if (source.flags & 512 && sourceOrApparentType.flags & 16384) { + errorInfo = saveErrorInfo; + if (result = isRelatedTo(sourceOrApparentType, target, reportErrors)) { + return result; + } + } if (reportErrors) { headMessage = headMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1; var sourceType = typeToString(source); @@ -13124,8 +13303,8 @@ var ts; } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); - 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 === argumentsSymbol && ts.getContainingFunction(node).kind === 163 && languageVersion < 2) { + error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } if (symbol.flags & 8388608 && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { markAliasSymbolAsReferenced(symbol); @@ -13235,7 +13414,8 @@ var ts; var baseClass; if (enclosingClass && ts.getClassExtendsHeritageClauseElement(enclosingClass)) { var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); - baseClass = classType.baseTypes.length && classType.baseTypes[0]; + var baseTypes = getBaseTypes(classType); + baseClass = baseTypes.length && baseTypes[0]; } if (!baseClass) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_a_derived_class); @@ -13252,7 +13432,7 @@ var ts; needToCaptureLexicalThis = false; while (container && container.kind === 163) { container = ts.getSuperContainer(container, true); - needToCaptureLexicalThis = true; + needToCaptureLexicalThis = languageVersion < 2; } if (container && container.parent && container.parent.kind === 201) { if (container.flags & 128) { @@ -13294,7 +13474,7 @@ var ts; return returnType; } } - if (container.kind === 127) { + if (container && container.kind === 127) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { @@ -13330,7 +13510,7 @@ var ts; var declaration = node.parent; if (node === declaration.initializer) { if (declaration.type) { - return getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); + return getTypeFromTypeNode(declaration.type); } if (declaration.kind === 129) { var type = getContextuallyTypedParameterType(declaration); @@ -13488,7 +13668,7 @@ var ts; case 158: return getContextualTypeForArgument(parent, node); case 160: - return getTypeFromTypeNodeOrHeritageClauseElement(parent.type); + return getTypeFromTypeNode(parent.type); case 169: return getContextualTypeForBinaryOperand(node); case 224: @@ -13577,12 +13757,8 @@ var ts; return false; } function checkSpreadElementExpression(node, contextualMapper) { - var type = checkExpressionCached(node.expression, contextualMapper); - if (!isArrayLikeType(type)) { - error(node.expression, ts.Diagnostics.Type_0_is_not_an_array_type, typeToString(type)); - return unknownType; - } - return type; + var arrayOrIterableType = checkExpressionCached(node.expression, contextualMapper); + return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, false); } function checkArrayLiteral(node, contextualMapper) { var elements = node.elements; @@ -13591,19 +13767,26 @@ var ts; } var hasSpreadElement = false; var elementTypes = []; - ts.forEach(elements, function (e) { - var type = checkExpression(e, contextualMapper); - if (e.kind === 173) { - elementTypes.push(getIndexTypeOfType(type, 1) || anyType); - hasSpreadElement = true; + var inDestructuringPattern = isAssignmentTarget(node); + for (var _i = 0; _i < elements.length; _i++) { + var e = elements[_i]; + if (inDestructuringPattern && e.kind === 173) { + var restArrayType = checkExpression(e.expression, contextualMapper); + var restElementType = getIndexTypeOfType(restArrayType, 1) || + (languageVersion >= 2 ? checkIteratedType(restArrayType, undefined) : undefined); + if (restElementType) { + elementTypes.push(restElementType); + } } else { + var type = checkExpression(e, contextualMapper); elementTypes.push(type); } - }); + hasSpreadElement = hasSpreadElement || e.kind === 173; + } if (!hasSpreadElement) { var contextualType = getContextualType(node); - if (contextualType && contextualTypeIsTupleLikeType(contextualType) || isAssignmentTarget(node)) { + if (contextualType && contextualTypeIsTupleLikeType(contextualType) || inDestructuringPattern) { return createTupleType(elementTypes); } } @@ -13652,9 +13835,7 @@ var ts; } else { ts.Debug.assert(memberDecl.kind === 225); - type = memberDecl.name.kind === 127 - ? unknownType - : checkExpression(memberDecl.name, contextualMapper); + type = checkExpression(memberDecl.name, contextualMapper); } typeFlags |= type.flags; var prop = createSymbol(4 | 67108864 | member.flags, member.name); @@ -14023,7 +14204,7 @@ var ts; for (var i = 0; i < args.length; i++) { var arg = args[i]; if (arg.kind !== 175) { - var paramType = getTypeAtPosition(signature, arg.kind === 173 ? -1 : i); + var paramType = getTypeAtPosition(signature, i); var argType = void 0; if (i === 0 && args[i].parent.kind === 159) { argType = globalTemplateStringsArrayType; @@ -14039,7 +14220,7 @@ var ts; 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); + var paramType = getTypeAtPosition(signature, i); inferTypes(context, checkExpressionWithContextualType(arg, paramType, inferenceMapper), paramType); } } @@ -14051,7 +14232,7 @@ var ts; var typeArgumentsAreAssignable = true; for (var i = 0; i < typeParameters.length; i++) { var typeArgNode = typeArguments[i]; - var typeArgument = getTypeFromTypeNodeOrHeritageClauseElement(typeArgNode); + var typeArgument = getTypeFromTypeNode(typeArgNode); typeArgumentResultTypes[i] = typeArgument; if (typeArgumentsAreAssignable) { var constraint = getConstraintOfTypeParameter(typeParameters[i]); @@ -14066,10 +14247,12 @@ var ts; for (var i = 0; i < args.length; i++) { var arg = args[i]; 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); + var paramType = getTypeAtPosition(signature, 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; } @@ -14354,7 +14537,7 @@ var ts; } function checkTypeAssertion(node) { var exprType = checkExpression(node.expression); - var targetType = getTypeFromTypeNodeOrHeritageClauseElement(node.type); + var targetType = getTypeFromTypeNode(node.type); if (produceDiagnostics && targetType !== unknownType) { var widenedType = getWidenedType(exprType); if (!(isTypeAssignableTo(targetType, widenedType))) { @@ -14364,14 +14547,9 @@ var ts; return targetType; } 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 ? - getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]) : - anyArrayType; + pos < signature.parameters.length - 1 ? getTypeOfSymbol(signature.parameters[pos]) : getRestTypeOfSignature(signature) : + pos < signature.parameters.length ? getTypeOfSymbol(signature.parameters[pos]) : anyType; } function assignContextualParameterTypes(signature, context, mapper) { var len = signature.parameters.length - (signature.hasRestParameter ? 1 : 0); @@ -14453,7 +14631,7 @@ var ts; } function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) { ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); - var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); + var hasGrammarError = checkGrammarDeclarationNameInStrictMode(node) || checkGrammarFunctionLikeDeclaration(node); if (!hasGrammarError && node.kind === 162) { checkGrammarFunctionName(node.name) || checkGrammarForGenerator(node); } @@ -14490,8 +14668,8 @@ var ts; } function checkFunctionExpressionOrObjectLiteralMethodBody(node) { ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); - if (node.type) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type)); + if (node.type && !node.asteriskToken) { + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); } if (node.body) { if (node.body.kind === 179) { @@ -14500,7 +14678,7 @@ var ts; else { var exprType = checkExpression(node.body); if (node.type) { - checkTypeAssignableTo(exprType, getTypeFromTypeNodeOrHeritageClauseElement(node.type), node.body, undefined); + checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, undefined); } checkFunctionExpressionBodies(node.body); } @@ -14698,10 +14876,7 @@ var ts; return sourceType; } function checkArrayLiteralAssignment(node, sourceType, contextualMapper) { - if (!isArrayLikeType(sourceType)) { - error(node, ts.Diagnostics.Type_0_is_not_an_array_type, typeToString(sourceType)); - return sourceType; - } + var elementType = checkIteratedTypeOrElementType(sourceType, node, false) || unknownType; var elements = node.elements; for (var i = 0; i < elements.length; i++) { var e = elements[i]; @@ -14709,8 +14884,9 @@ var ts; if (e.kind !== 173) { var propName = "" + i; var type = sourceType.flags & 1 ? sourceType : - isTupleLikeType(sourceType) ? getTypeOfPropertyOfType(sourceType, propName) : - getIndexTypeOfType(sourceType, 1); + isTupleLikeType(sourceType) + ? getTypeOfPropertyOfType(sourceType, propName) + : elementType; if (type) { checkDestructuringAssignment(e, type, contextualMapper); } @@ -14724,11 +14900,17 @@ var ts; } } else { - if (i === elements.length - 1) { - checkReferenceAssignment(e.expression, sourceType, contextualMapper); + if (i < elements.length - 1) { + error(e, ts.Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); } else { - error(e, ts.Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); + var restExpression = e.expression; + if (restExpression.kind === 169 && restExpression.operatorToken.kind === 53) { + error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); + } + else { + checkDestructuringAssignment(restExpression, createArrayType(elementType), contextualMapper); + } } } } @@ -14963,6 +15145,7 @@ var ts; return type; } function checkExpression(node, contextualMapper) { + checkGrammarIdentifierInStrictMode(node); return checkExpressionOrQualifiedName(node, contextualMapper); } function checkExpressionOrQualifiedName(node, contextualMapper) { @@ -14985,7 +15168,7 @@ var ts; return type; } function checkNumericLiteral(node) { - checkGrammarNumbericLiteral(node); + checkGrammarNumericLiteral(node); return numberType; } function checkExpressionWorker(node, contextualMapper) { @@ -15057,6 +15240,7 @@ var ts; return unknownType; } function checkTypeParameter(node) { + checkGrammarDeclarationNameInStrictMode(node); if (node.expression) { grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected); } @@ -15085,10 +15269,8 @@ var ts; if (node.questionToken && ts.isBindingPattern(node.name) && func.body) { error(node, ts.Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature); } - if (node.dotDotDotToken) { - if (!isArrayType(getTypeOfSymbol(node.symbol))) { - error(node, ts.Diagnostics.A_rest_parameter_must_be_of_an_array_type); - } + if (node.dotDotDotToken && !ts.isBindingPattern(node.name) && !isArrayType(getTypeOfSymbol(node.symbol))) { + error(node, ts.Diagnostics.A_rest_parameter_must_be_of_an_array_type); } } function checkSignatureDeclaration(node) { @@ -15259,9 +15441,11 @@ var ts; checkDecorators(node); } function checkTypeReferenceNode(node) { + checkGrammarTypeReferenceInStrictMode(node.typeName); return checkTypeReferenceOrHeritageClauseElement(node); } function checkHeritageClauseElement(node) { + checkGrammarHeritageClauseElementInStrictMode(node.expression); return checkTypeReferenceOrHeritageClauseElement(node); } function checkTypeReferenceOrHeritageClauseElement(node) { @@ -15584,21 +15768,71 @@ var ts; break; } } + function checkTypeNodeAsExpression(node) { + if (node && node.kind === 141) { + var type = getTypeFromTypeNode(node); + var shouldCheckIfUnknownType = type === unknownType && compilerOptions.separateCompilation; + if (!type || (!shouldCheckIfUnknownType && type.flags & (1048703 | 132 | 258))) { + return; + } + if (shouldCheckIfUnknownType || type.symbol.valueDeclaration) { + checkExpressionOrQualifiedName(node.typeName); + } + } + } + function checkTypeAnnotationAsExpression(node) { + switch (node.kind) { + case 132: + checkTypeNodeAsExpression(node.type); + break; + case 129: + checkTypeNodeAsExpression(node.type); + break; + case 134: + checkTypeNodeAsExpression(node.type); + break; + case 136: + checkTypeNodeAsExpression(node.type); + break; + case 137: + checkTypeNodeAsExpression(getSetAccessorTypeAnnotationNode(node)); + break; + } + } + function checkParameterTypeAnnotationsAsExpressions(node) { + for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { + var parameter = _a[_i]; + checkTypeAnnotationAsExpression(parameter); + } + } 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; + if (!ts.nodeCanBeDecorated(node)) { + return; + } + if (compilerOptions.emitDecoratorMetadata) { + switch (node.kind) { + case 201: + var constructor = ts.getFirstConstructorWithBody(node); + if (constructor) { + checkParameterTypeAnnotationsAsExpressions(constructor); + } + break; + case 134: + checkParameterTypeAnnotationsAsExpressions(node); + case 137: + case 136: + case 132: + case 129: + checkTypeAnnotationAsExpression(node); + break; + } + } + emitDecorate = true; + if (node.kind === 129) { + emitParam = true; } ts.forEach(node.decorators, checkDecorator); } @@ -15614,6 +15848,7 @@ var ts; } } function checkFunctionLikeDeclaration(node) { + checkGrammarDeclarationNameInStrictMode(node); checkDecorators(node); checkSignatureDeclaration(node); if (node.name && node.name.kind === 127) { @@ -15633,8 +15868,8 @@ var ts; } } checkSourceElement(node.body); - if (node.type && !isAccessor(node.kind)) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type)); + if (node.type && !isAccessor(node.kind) && !node.asteriskToken) { + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); } if (compilerOptions.noImplicitAny && ts.nodeIsMissing(node.body) && !node.type && !isPrivateWithinAmbient(node)) { reportImplicitAnyError(node, anyType); @@ -15799,6 +16034,7 @@ var ts; } } function checkVariableLikeDeclaration(node) { + checkGrammarDeclarationNameInStrictMode(node); checkDecorators(node); checkSourceElement(node.type); if (node.name.kind === 127) { @@ -15973,21 +16209,35 @@ var ts; } function checkRightHandSideOfForOf(rhsExpression) { var expressionType = getTypeOfExpression(rhsExpression); - return languageVersion >= 2 - ? checkIteratedType(expressionType, rhsExpression) - : checkElementTypeOfArrayOrString(expressionType, rhsExpression); + return checkIteratedTypeOrElementType(expressionType, rhsExpression, true); } - function checkIteratedType(iterable, expressionForError) { + function checkIteratedTypeOrElementType(inputType, errorNode, allowStringInput) { + if (inputType.flags & 1) { + return inputType; + } + if (languageVersion >= 2) { + return checkIteratedType(inputType, errorNode) || anyType; + } + if (allowStringInput) { + return checkElementTypeOfArrayOrString(inputType, errorNode); + } + if (isArrayLikeType(inputType)) { + var indexType = getIndexTypeOfType(inputType, 1); + if (indexType) { + return indexType; + } + } + error(errorNode, ts.Diagnostics.Type_0_is_not_an_array_type, typeToString(inputType)); + return unknownType; + } + function checkIteratedType(iterable, errorNode) { ts.Debug.assert(languageVersion >= 2); - var iteratedType = getIteratedType(iterable, expressionForError); - if (expressionForError && iteratedType) { - var completeIterableType = globalIterableType !== emptyObjectType - ? createTypeReference(globalIterableType, [iteratedType]) - : emptyObjectType; - checkTypeAssignableTo(iterable, completeIterableType, expressionForError); + var iteratedType = getIteratedType(iterable, errorNode); + if (errorNode && iteratedType) { + checkTypeAssignableTo(iterable, createIterableType(iteratedType), errorNode); } return iteratedType; - function getIteratedType(iterable, expressionForError) { + function getIteratedType(iterable, errorNode) { // 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): // @@ -16016,14 +16266,17 @@ var ts; if (allConstituentTypesHaveKind(iterable, 1)) { return undefined; } + if ((iterable.flags & 4096) && iterable.target === globalIterableType) { + return iterable.typeArguments[0]; + } var iteratorFunction = getTypeOfPropertyOfType(iterable, ts.getPropertyNameForKnownSymbolName("iterator")); if (iteratorFunction && allConstituentTypesHaveKind(iteratorFunction, 1)) { return undefined; } var iteratorFunctionSignatures = iteratorFunction ? getSignaturesOfType(iteratorFunction, 0) : emptyArray; if (iteratorFunctionSignatures.length === 0) { - if (expressionForError) { - error(expressionForError, ts.Diagnostics.The_right_hand_side_of_a_for_of_statement_must_have_a_Symbol_iterator_method_that_returns_an_iterator); + if (errorNode) { + error(errorNode, ts.Diagnostics.Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator); } return undefined; } @@ -16037,8 +16290,8 @@ var ts; } var iteratorNextFunctionSignatures = iteratorNextFunction ? getSignaturesOfType(iteratorNextFunction, 0) : emptyArray; if (iteratorNextFunctionSignatures.length === 0) { - if (expressionForError) { - error(expressionForError, ts.Diagnostics.The_iterator_returned_by_the_right_hand_side_of_a_for_of_statement_must_have_a_next_method); + if (errorNode) { + error(errorNode, ts.Diagnostics.An_iterator_must_have_a_next_method); } return undefined; } @@ -16048,22 +16301,22 @@ var ts; } var iteratorNextValue = getTypeOfPropertyOfType(iteratorNextResult, "value"); if (!iteratorNextValue) { - if (expressionForError) { - error(expressionForError, ts.Diagnostics.The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property); + if (errorNode) { + error(errorNode, ts.Diagnostics.The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property); } return undefined; } return iteratorNextValue; } } - function checkElementTypeOfArrayOrString(arrayOrStringType, expressionForError) { + function checkElementTypeOfArrayOrString(arrayOrStringType, errorNode) { ts.Debug.assert(languageVersion < 2); var arrayType = removeTypesFromUnionType(arrayOrStringType, 258, true, true); var hasStringConstituent = arrayOrStringType !== arrayType; var reportedError = false; if (hasStringConstituent) { if (languageVersion < 1) { - error(expressionForError, ts.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); + error(errorNode, ts.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); reportedError = true; } if (arrayType === emptyObjectType) { @@ -16075,7 +16328,7 @@ var ts; 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)); + error(errorNode, diagnostic, typeToString(arrayType)); } return hasStringConstituent ? stringType : unknownType; } @@ -16246,7 +16499,7 @@ 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(getBaseTypes(type), function (base) { return getIndexTypeOfType(base, 0) && getIndexTypeOfType(base, 1); }); errorNode = someBaseTypeHasBothIndexers ? undefined : type.symbol.declarations[0]; } } @@ -16268,7 +16521,7 @@ var ts; errorNode = indexDeclaration; } else if (containingType.flags & 2048) { - var someBaseClassHasBothPropertyAndIndexer = ts.forEach(containingType.baseTypes, function (base) { return getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind); }); + var someBaseClassHasBothPropertyAndIndexer = ts.forEach(getBaseTypes(containingType), function (base) { return getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind); }); errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : containingType.symbol.declarations[0]; } if (errorNode && !isTypeAssignableTo(propertyType, indexType)) { @@ -16311,9 +16564,13 @@ var ts; return unknownType; } function checkClassDeclaration(node) { + checkGrammarDeclarationNameInStrictMode(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); } + if (!node.name && !(node.flags & 256)) { + grammarErrorOnFirstToken(node, ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name); + } checkGrammarClassDeclarationHeritageClauses(node); checkDecorators(node); if (node.name) { @@ -16334,9 +16591,10 @@ var ts; emitExtends = emitExtends || !ts.isInAmbientContext(node); checkHeritageClauseElement(baseTypeNode); } - if (type.baseTypes.length) { + var baseTypes = getBaseTypes(type); + if (baseTypes.length) { if (produceDiagnostics) { - var baseType = type.baseTypes[0]; + var baseType = baseTypes[0]; 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); @@ -16346,7 +16604,7 @@ var ts; checkKindsOfPropertyMemberOverrides(type, baseType); } } - if (type.baseTypes.length || (baseTypeNode && compilerOptions.separateCompilation)) { + if (baseTypes.length || (baseTypeNode && compilerOptions.separateCompilation)) { checkExpressionOrQualifiedName(baseTypeNode.expression); } var implementedTypeNodes = ts.getClassImplementsHeritageClauseElements(node); @@ -16458,24 +16716,25 @@ var ts; if (!tp1.constraint || !tp2.constraint) { return false; } - if (!isTypeIdenticalTo(getTypeFromTypeNodeOrHeritageClauseElement(tp1.constraint), getTypeFromTypeNodeOrHeritageClauseElement(tp2.constraint))) { + if (!isTypeIdenticalTo(getTypeFromTypeNode(tp1.constraint), getTypeFromTypeNode(tp2.constraint))) { return false; } } return true; } function checkInheritedPropertiesAreIdentical(type, typeNode) { - if (!type.baseTypes.length || type.baseTypes.length === 1) { + var baseTypes = getBaseTypes(type); + if (baseTypes.length < 2) { return true; } 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; _i < _a.length; _i++) { - var base = _a[_i]; + for (var _i = 0; _i < baseTypes.length; _i++) { + var base = baseTypes[_i]; var properties = getPropertiesOfObjectType(base); - for (var _b = 0; _b < properties.length; _b++) { - var prop = properties[_b]; + for (var _a = 0; _a < properties.length; _a++) { + var prop = properties[_a]; if (!ts.hasProperty(seen, prop.name)) { seen[prop.name] = { prop: prop, containingType: base }; } @@ -16496,7 +16755,7 @@ var ts; return ok; } function checkInterfaceDeclaration(node) { - checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarInterfaceDeclaration(node); + checkGrammarDeclarationNameInStrictMode(node) || checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarInterfaceDeclaration(node); checkTypeParameters(node.typeParameters); if (produceDiagnostics) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); @@ -16511,7 +16770,7 @@ var ts; if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); if (checkInheritedPropertiesAreIdentical(type, node.name)) { - ts.forEach(type.baseTypes, function (baseType) { + ts.forEach(getBaseTypes(type), function (baseType) { checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1); }); checkIndexConstraints(type); @@ -16682,7 +16941,7 @@ var ts; if (!produceDiagnostics) { return; } - checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarEnumDeclaration(node); + checkGrammarDeclarationNameInStrictMode(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); @@ -16727,15 +16986,30 @@ var ts; var declarations = symbol.declarations; for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; - if ((declaration.kind === 201 || (declaration.kind === 200 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { + if ((declaration.kind === 201 || + (declaration.kind === 200 && ts.nodeIsPresent(declaration.body))) && + !ts.isInAmbientContext(declaration)) { return declaration; } } return undefined; } + function inSameLexicalScope(node1, node2) { + var container1 = ts.getEnclosingBlockScopeContainer(node1); + var container2 = ts.getEnclosingBlockScopeContainer(node2); + if (isGlobalSourceFile(container1)) { + return isGlobalSourceFile(container2); + } + else if (isGlobalSourceFile(container2)) { + return false; + } + else { + return container1 === container2; + } + } function checkModuleDeclaration(node) { if (produceDiagnostics) { - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node)) { + if (!checkGrammarDeclarationNameInStrictMode(node) && !checkGrammarDecorators(node) && !checkGrammarModifiers(node)) { if (!ts.isInAmbientContext(node) && node.name.kind === 8) { grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names); } @@ -16748,15 +17022,20 @@ var ts; && 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)) { + var firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); + if (firstNonAmbientClassOrFunc) { + if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(firstNonAmbientClassOrFunc)) { error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); } - else if (node.pos < classOrFunc.pos) { + else if (node.pos < firstNonAmbientClassOrFunc.pos) { error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); } } + var mergedClass = ts.getDeclarationOfKind(symbol, 201); + if (mergedClass && + inSameLexicalScope(node, mergedClass)) { + getNodeLinks(node).flags |= 2048; + } } if (node.name.kind === 8) { if (!isGlobalSourceFile(node.parent)) { @@ -16824,7 +17103,7 @@ var ts; checkAliasSymbol(node); } function checkImportDeclaration(node) { - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) { + if (!checkGrammarImportDeclarationNameInStrictMode(node) && !checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_import_declaration_cannot_have_modifiers); } if (checkExternalImportOrExportDeclaration(node)) { @@ -16845,7 +17124,7 @@ var ts; } } function checkImportEqualsDeclaration(node) { - checkGrammarDecorators(node) || checkGrammarModifiers(node); + checkGrammarDeclarationNameInStrictMode(node) || checkGrammarDecorators(node) || checkGrammarModifiers(node); if (ts.isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) { checkImportBinding(node); if (node.flags & 1) { @@ -16907,19 +17186,11 @@ var ts; if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_assignment_cannot_have_modifiers); } - if (node.expression) { - if (node.expression.kind === 65) { - markExportAsReferenced(node); - } - else { - checkExpressionCached(node.expression); - } + if (node.expression.kind === 65) { + markExportAsReferenced(node); } - 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); - } + else { + checkExpressionCached(node.expression); } checkExternalModuleExports(container); if (node.isExportEquals && languageVersion >= 2) { @@ -17154,6 +17425,8 @@ var ts; if (!(links.flags & 1)) { checkGrammarSourceFile(node); emitExtends = false; + emitDecorate = false; + emitParam = false; potentialThisCollisions.length = 0; ts.forEach(node.statements, checkSourceElement); checkFunctionExpressionBodies(node); @@ -17170,6 +17443,9 @@ var ts; if (emitDecorate) { links.flags |= 512; } + if (emitParam) { + links.flags |= 1024; + } links.flags |= 1; } } @@ -17324,7 +17600,7 @@ var ts; } return node.parent && node.parent.kind === 177; } - function isTypeNodeOrHeritageClauseElement(node) { + function isTypeNode(node) { if (141 <= node.kind && node.kind <= 149) { return true; } @@ -17516,8 +17792,8 @@ var ts; if (isInsideWithStatementBody(node)) { return unknownType; } - if (isTypeNodeOrHeritageClauseElement(node)) { - return getTypeFromTypeNodeOrHeritageClauseElement(node); + if (isTypeNode(node)) { + return getTypeFromTypeNode(node); } if (ts.isExpression(node)) { return getTypeOfExpression(node); @@ -17590,7 +17866,14 @@ var ts; var node = getDeclarationOfAliasSymbol(symbol); if (node) { if (node.kind === 210) { - return getGeneratedNameForNode(node.parent) + ".default"; + var defaultKeyword; + if (languageVersion === 0) { + defaultKeyword = "[\"default\"]"; + } + else { + defaultKeyword = ".default"; + } + return getGeneratedNameForNode(node.parent) + defaultKeyword; } if (node.kind === 213) { var moduleName = getGeneratedNameForNode(node.parent.parent.parent); @@ -17703,6 +17986,150 @@ var ts; } return undefined; } + function serializeEntityName(node, getGeneratedNameForNode, fallbackPath) { + if (node.kind === 65) { + 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; + } + } + } + function serializeTypeReferenceNode(node, getGeneratedNameForNode) { + var type = getTypeFromTypeReference(node); + if (type.flags & 16) { + return "void 0"; + } + else if (type.flags & 8) { + return "Boolean"; + } + else if (type.flags & 132) { + return "Number"; + } + else if (type.flags & 258) { + return "String"; + } + else if (type.flags & 8192) { + return "Array"; + } + else if (type.flags & 1048576) { + return "Symbol"; + } + else if (type === unknownType) { + var fallbackPath = []; + 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"; + } + function serializeTypeNode(node, getGeneratedNameForNode) { + if (node) { + switch (node.kind) { + case 99: + return "void 0"; + case 149: + return serializeTypeNode(node.type, getGeneratedNameForNode); + case 142: + case 143: + return "Function"; + case 146: + case 147: + return "Array"; + case 113: + return "Boolean"; + case 121: + case 8: + return "String"; + case 119: + return "Number"; + case 141: + return serializeTypeReferenceNode(node, getGeneratedNameForNode); + case 144: + case 145: + case 148: + case 112: + break; + default: + ts.Debug.fail("Cannot serialize unexpected type node."); + break; + } + } + return "Object"; + } + function serializeTypeOfNode(node, getGeneratedNameForNode) { + switch (node.kind) { + case 201: return "Function"; + case 132: return serializeTypeNode(node.type, getGeneratedNameForNode); + case 129: return serializeTypeNode(node.type, getGeneratedNameForNode); + case 136: return serializeTypeNode(node.type, getGeneratedNameForNode); + case 137: return serializeTypeNode(getSetAccessorTypeAnnotationNode(node), getGeneratedNameForNode); + } + if (ts.isFunctionLike(node)) { + return "Function"; + } + return "void 0"; + } + function serializeParameterTypesOfNode(node, getGeneratedNameForNode) { + if (node) { + var valueDeclaration; + if (node.kind === 201) { + valueDeclaration = ts.getFirstConstructorWithBody(node); + } + else if (ts.isFunctionLike(node) && ts.nodeIsPresent(node.body)) { + valueDeclaration = node; + } + if (valueDeclaration) { + var result; + 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 === 146) { + parameterType = parameterType.elementType; + } + else if (parameterType.kind === 141 && 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; + } + function serializeReturnTypeOfNode(node, getGeneratedNameForNode) { + if (node && ts.isFunctionLike(node)) { + return serializeTypeNode(node.type, getGeneratedNameForNode); + } + return "void 0"; + } function writeTypeOfDeclaration(declaration, enclosingDeclaration, flags, writer) { var symbol = getSymbolOfNode(declaration); var type = symbol && !(symbol.flags & (2048 | 131072)) @@ -17769,7 +18196,10 @@ var ts; getConstantValue: getConstantValue, resolvesToSomeValue: resolvesToSomeValue, collectLinkedAliases: collectLinkedAliases, - getBlockScopedVariableId: getBlockScopedVariableId + getBlockScopedVariableId: getBlockScopedVariableId, + serializeTypeOfNode: serializeTypeOfNode, + serializeParameterTypesOfNode: serializeParameterTypesOfNode, + serializeReturnTypeOfNode: serializeReturnTypeOfNode }; } function initializeTypeChecker() { @@ -17811,20 +18241,119 @@ var ts; } anyArrayType = createArrayType(anyType); } + function isReservedWordInStrictMode(node) { + return (node.parserContextFlags & 1) && + (node.originalKeywordKind >= 102 && node.originalKeywordKind <= 110); + } + function reportStrictModeGrammarErrorInClassDeclaration(identifier, message, arg0, arg1, arg2) { + if (ts.getAncestor(identifier, 201) || ts.getAncestor(identifier, 174)) { + return grammarErrorOnNode(identifier, message, arg0); + } + return false; + } + function checkGrammarImportDeclarationNameInStrictMode(node) { + if (node.importClause) { + var impotClause = node.importClause; + if (impotClause.namedBindings) { + var nameBindings = impotClause.namedBindings; + if (nameBindings.kind === 211) { + var name_11 = nameBindings.name; + if (name_11.originalKeywordKind) { + var nameText = ts.declarationNameToString(name_11); + return grammarErrorOnNode(name_11, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); + } + } + else if (nameBindings.kind === 212) { + var reportError = false; + for (var _i = 0, _a = nameBindings.elements; _i < _a.length; _i++) { + var element = _a[_i]; + var name_12 = element.name; + if (name_12.originalKeywordKind) { + var nameText = ts.declarationNameToString(name_12); + reportError = reportError || grammarErrorOnNode(name_12, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); + } + } + return reportError; + } + } + } + return false; + } + function checkGrammarDeclarationNameInStrictMode(node) { + var name = node.name; + if (name && name.kind === 65 && isReservedWordInStrictMode(name)) { + var nameText = ts.declarationNameToString(name); + switch (node.kind) { + case 129: + case 198: + case 200: + case 128: + case 152: + case 202: + case 203: + case 204: + return checkGrammarIdentifierInStrictMode(name); + case 201: + return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText); + case 205: + return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); + case 208: + return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); + } + } + return false; + } + function checkGrammarTypeReferenceInStrictMode(typeName) { + if (typeName.kind === 65) { + checkGrammarTypeNameInStrictMode(typeName); + } + else if (typeName.kind === 126) { + checkGrammarTypeNameInStrictMode(typeName.right); + checkGrammarTypeReferenceInStrictMode(typeName.left); + } + } + function checkGrammarHeritageClauseElementInStrictMode(expression) { + if (expression && expression.kind === 65) { + return checkGrammarIdentifierInStrictMode(expression); + } + else if (expression && expression.kind === 155) { + checkGrammarHeritageClauseElementInStrictMode(expression.expression); + } + } + function checkGrammarIdentifierInStrictMode(node, nameText) { + if (node && node.kind === 65 && isReservedWordInStrictMode(node)) { + if (!nameText) { + nameText = ts.declarationNameToString(node); + } + var errorReport = reportStrictModeGrammarErrorInClassDeclaration(node, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText) || + grammarErrorOnNode(node, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); + return errorReport; + } + return false; + } + function checkGrammarTypeNameInStrictMode(node) { + if (node && node.kind === 65 && isReservedWordInStrictMode(node)) { + var nameText = ts.declarationNameToString(node); + var errorReport = reportStrictModeGrammarErrorInClassDeclaration(node, ts.Diagnostics.Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText) || + grammarErrorOnNode(node, ts.Diagnostics.Type_expected_0_is_a_reserved_word_in_strict_mode, nameText); + return errorReport; + } + return false; + } function checkGrammarDecorators(node) { if (!node.decorators) { return false; } if (!ts.nodeCanBeDecorated(node)) { - return grammarErrorOnNode(node, ts.Diagnostics.Decorators_are_not_valid_here); + return grammarErrorOnFirstToken(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); + return grammarErrorOnFirstToken(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 grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); } } return false; @@ -17863,14 +18392,14 @@ var ts; 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 === 109) { + if (modifier.kind === 108) { text = "public"; } - else if (modifier.kind === 108) { + else if (modifier.kind === 107) { text = "protected"; lastProtected = modifier; } @@ -17889,7 +18418,7 @@ var ts; } flags |= ts.modifierToFlag(modifier.kind); break; - case 110: + case 109: if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static"); } @@ -17986,6 +18515,9 @@ var ts; if (i !== (parameterCount - 1)) { return grammarErrorOnNode(parameter.dotDotDotToken, ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); } + if (ts.isBindingPattern(parameter.name)) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); + } if (parameter.questionToken) { return grammarErrorOnNode(parameter.questionToken, ts.Diagnostics.A_rest_parameter_cannot_be_optional); } @@ -18119,7 +18651,7 @@ var ts; seenExtendsClause = true; } else { - ts.Debug.assert(heritageClause.token === 103); + ts.Debug.assert(heritageClause.token === 102); if (seenImplementsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.implements_clause_already_seen); } @@ -18141,7 +18673,7 @@ var ts; seenExtendsClause = true; } else { - ts.Debug.assert(heritageClause.token === 103); + ts.Debug.assert(heritageClause.token === 102); return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.Interface_declaration_cannot_have_implements_clause); } checkGrammarHeritageClause(heritageClause); @@ -18180,17 +18712,17 @@ var ts; var inStrictMode = (node.parserContextFlags & 1) !== 0; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - var name_11 = prop.name; + var name_13 = prop.name; if (prop.kind === 175 || - name_11.kind === 127) { - checkGrammarComputedPropertyName(name_11); + name_13.kind === 127) { + checkGrammarComputedPropertyName(name_13); continue; } var currentKind = void 0; if (prop.kind === 224 || prop.kind === 225) { checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); - if (name_11.kind === 7) { - checkGrammarNumbericLiteral(name_11); + if (name_13.kind === 7) { + checkGrammarNumericLiteral(name_13); } currentKind = Property; } @@ -18206,26 +18738,26 @@ var ts; else { ts.Debug.fail("Unexpected syntax kind:" + prop.kind); } - if (!ts.hasProperty(seen, name_11.text)) { - seen[name_11.text] = currentKind; + if (!ts.hasProperty(seen, name_13.text)) { + seen[name_13.text] = currentKind; } else { - var existingKind = seen[name_11.text]; + var existingKind = seen[name_13.text]; if (currentKind === Property && existingKind === Property) { if (inStrictMode) { - grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); + grammarErrorOnNode(name_13, 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_11.text] = currentKind | existingKind; + seen[name_13.text] = currentKind | existingKind; } else { - return grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + return grammarErrorOnNode(name_13, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); } } else { - return grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + return grammarErrorOnNode(name_13, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); } } } @@ -18400,6 +18932,9 @@ var ts; if (node !== elements[elements.length - 1]) { return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); } + if (node.name.kind === 151 || node.name.kind === 150) { + return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); + } if (node.initializer) { return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.initializer.pos - 1, 1, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } @@ -18437,7 +18972,9 @@ var ts; var elements = name.elements; for (var _i = 0; _i < elements.length; _i++) { var element = elements[_i]; - checkGrammarNameInLetOrConstDeclarations(element.name); + if (element.kind !== 175) { + checkGrammarNameInLetOrConstDeclarations(element.name); + } } } } @@ -18540,12 +19077,20 @@ var ts; function checkGrammarEvalOrArgumentsInStrictMode(contextNode, name) { if (name && name.kind === 65) { var identifier = name; - if (contextNode && (contextNode.parserContextFlags & 1) && ts.isEvalOrArgumentsIdentifier(identifier)) { + if (contextNode && (contextNode.parserContextFlags & 1) && isEvalOrArgumentsIdentifier(identifier)) { var nameText = ts.declarationNameToString(identifier); - return grammarErrorOnNode(identifier, ts.Diagnostics.Invalid_use_of_0_in_strict_mode, nameText); + var reportErrorInClassDeclaration = reportStrictModeGrammarErrorInClassDeclaration(identifier, ts.Diagnostics.Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode, nameText); + if (!reportErrorInClassDeclaration) { + return grammarErrorOnNode(identifier, ts.Diagnostics.Invalid_use_of_0_in_strict_mode, nameText); + } + return reportErrorInClassDeclaration; } } } + function isEvalOrArgumentsIdentifier(node) { + return node.kind === 65 && + (node.text === "eval" || node.text === "arguments"); + } function checkGrammarConstructorTypeParameters(node) { if (node.typeParameters) { return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); @@ -18621,7 +19166,7 @@ var ts; } } } - function checkGrammarNumbericLiteral(node) { + function checkGrammarNumericLiteral(node) { if (node.flags & 16384) { if (node.parserContextFlags & 1) { return grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode); @@ -18984,20 +19529,35 @@ var ts; enclosingDeclaration = node; emitLines(node.statements); } + function getExportDefaultTempVariableName() { + var baseName = "_default"; + if (!ts.hasProperty(currentSourceFile.identifiers, baseName)) { + return baseName; + } + var count = 0; + while (true) { + var name_14 = baseName + "_" + (++count); + if (!ts.hasProperty(currentSourceFile.identifiers, name_14)) { + return name_14; + } + } + } function emitExportAssignment(node) { - write(node.isExportEquals ? "export = " : "export default "); if (node.expression.kind === 65) { + write(node.isExportEquals ? "export = " : "export default "); writeTextOfNode(currentSourceFile, node.expression); } else { + var tempVarName = getExportDefaultTempVariableName(); + write("declare var "); + write(tempVarName); write(": "); - if (node.type) { - emitType(node.type); - } - else { - writer.getSymbolAccessibilityDiagnostic = getDefaultExportAccessibilityDiagnostic; - resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, 2, writer); - } + writer.getSymbolAccessibilityDiagnostic = getDefaultExportAccessibilityDiagnostic; + resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, 2, writer); + write(";"); + writeLine(); + write(node.isExportEquals ? "export = " : "export default "); + write(tempVarName); } write(";"); writeLine(); @@ -19938,6 +20498,10 @@ var ts; } ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; function emitFiles(resolver, host, targetSourceFile) { + var extendsHelper = "\nvar __extends = this.__extends || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n __.prototype = b.prototype;\n d.prototype = new __();\n};"; + var decorateHelper = "\nvar __decorate = this.__decorate || (typeof Reflect === \"object\" && Reflect.decorate) || function (decorators, target, key, desc) {\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};"; + var metadataHelper = "\nvar __metadata = this.__metadata || (typeof Reflect === \"object\" && Reflect.metadata) || function () { };"; + var paramHelper = "\nvar __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } };"; var compilerOptions = host.getCompilerOptions(); var languageVersion = compilerOptions.target || 0; var sourceMapDataList = compilerOptions.sourceMap ? [] : undefined; @@ -20001,6 +20565,7 @@ var ts; var computedPropertyNamesToGeneratedNames; var extendsEmitted = false; var decorateEmitted = false; + var paramEmitted = false; var tempFlags = 0; var tempVariables; var tempParameters; @@ -20055,9 +20620,9 @@ var ts; 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; + var name_15 = count < 26 ? "_" + String.fromCharCode(97 + count) : "_" + (count - 26); + if (isUniqueName(name_15)) { + return name_15; } } } @@ -20085,8 +20650,8 @@ var ts; } 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)); + var name_16 = node.name.text; + assignGeneratedName(node, isUniqueLocalName(name_16, node) ? name_16 : makeUniqueName(name_16)); } } function generateNameForImportOrExportDeclaration(node) { @@ -20114,6 +20679,7 @@ var ts; switch (node.kind) { case 200: case 201: + case 174: generateNameForFunctionOrClassDeclaration(node); break; case 205: @@ -20265,8 +20831,8 @@ var ts; if (scopeName) { var parentIndex = getSourceMapNameIndex(); if (parentIndex !== -1) { - var name_14 = node.name; - if (!name_14 || name_14.kind !== 127) { + var name_17 = node.name; + if (!name_17 || name_17.kind !== 127) { scopeName = "." + scopeName; } scopeName = sourceMapData.sourceMapNames[parentIndex] + scopeName; @@ -20293,9 +20859,9 @@ var ts; node.kind === 201 || node.kind === 204) { if (node.name) { - var name_15 = node.name; - scopeName = name_15.kind === 127 - ? ts.getTextOfNode(name_15) + var name_18 = node.name; + scopeName = name_18.kind === 127 + ? ts.getTextOfNode(name_18) : node.name.text; } recordScopeNameStart(scopeName); @@ -20497,27 +21063,32 @@ var ts; writeLine(); } } - function emitList(nodes, start, count, multiLine, trailingComma) { + function emitList(nodes, start, count, multiLine, trailingComma, leadingComma, noTrailingNewLine, emitNode) { + if (!emitNode) { + emitNode = emit; + } for (var 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) { if (nodes) { @@ -20703,6 +21274,7 @@ var ts; default: return -1; } + case 172: case 170: return -1; default: @@ -20724,15 +21296,13 @@ var ts; if (!computedPropertyNamesToGeneratedNames) { computedPropertyNamesToGeneratedNames = []; } - var generatedName = computedPropertyNamesToGeneratedNames[node.id]; + var generatedName = computedPropertyNamesToGeneratedNames[ts.getNodeId(node)]; if (generatedName) { write(generatedName); return; } - var generatedVariable = createTempVariable(0); - generatedName = generatedVariable.text; - recordTempDeclaration(generatedVariable); - computedPropertyNamesToGeneratedNames[node.id] = generatedName; + generatedName = createAndRecordTempVariable(0).text; + computedPropertyNamesToGeneratedNames[ts.getNodeId(node)] = generatedName; write(generatedName); write(" = "); } @@ -20876,6 +21446,16 @@ var ts; write("..."); emit(node.expression); } + function emitYieldExpression(node) { + write(ts.tokenToString(110)); + if (node.asteriskToken) { + write("*"); + } + if (node.expression) { + write(" "); + emit(node.expression); + } + } function needsParenthesisForPropertyAccessOrInvocation(node) { switch (node.kind) { case 65: @@ -20944,147 +21524,133 @@ var ts; emitListWithSpread(elements, (node.flags & 512) !== 0, elements.hasTrailingComma); } } - function emitDownlevelObjectLiteralWithComputedProperties(node, firstComputedPropertyIndex) { - var parenthesizedObjectLiteral = createDownlevelObjectLiteralWithComputedProperties(node, firstComputedPropertyIndex); - return emit(parenthesizedObjectLiteral); - } - function createDownlevelObjectLiteralWithComputedProperties(originalObjectLiteral, firstComputedPropertyIndex) { - var tempVar = createAndRecordTempVariable(0); - var initialObjectLiteral = ts.createSynthesizedNode(154); - initialObjectLiteral.properties = originalObjectLiteral.properties.slice(0, firstComputedPropertyIndex); - initialObjectLiteral.flags |= 512; - var propertyPatches = createBinaryExpression(tempVar, 53, initialObjectLiteral); - ts.forEach(originalObjectLiteral.properties, function (property) { - var patchedProperty = tryCreatePatchingPropertyAssignment(originalObjectLiteral, tempVar, property); - if (patchedProperty) { - propertyPatches = createBinaryExpression(propertyPatches, 23, patchedProperty); + function emitObjectLiteralBody(node, numElements) { + if (numElements === 0) { + write("{}"); + return; + } + write("{"); + if (numElements > 0) { + var properties = node.properties; + if (numElements === properties.length) { + emitLinePreservingList(node, properties, languageVersion >= 1, true); } - }); - propertyPatches = createBinaryExpression(propertyPatches, 23, createIdentifier(tempVar.text, true)); - var result = createParenthesizedExpression(propertyPatches); - return result; - } - function addCommentsToSynthesizedNode(node, leadingCommentRanges, trailingCommentRanges) { - node.leadingCommentRanges = leadingCommentRanges; - node.trailingCommentRanges = trailingCommentRanges; - } - function tryCreatePatchingPropertyAssignment(objectLiteral, tempVar, property) { - var leftHandSide = createMemberAccessForPropertyName(tempVar, property.name); - var maybeRightHandSide = tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral, property); - return maybeRightHandSide && createBinaryExpression(leftHandSide, 53, maybeRightHandSide, true); - } - function tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral, property) { - switch (property.kind) { - case 224: - return property.initializer; - case 225: - return createIdentifier(resolver.getExpressionNameSubstitution(property.name, getGeneratedNameForNode)); - case 134: - 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; + else { + var multiLine = (node.flags & 512) !== 0; + if (!multiLine) { + write(" "); } - var propertyDescriptor = ts.createSynthesizedNode(154); - var descriptorProperties = []; - if (getAccessor) { - var getProperty_1 = createPropertyAssignment(createIdentifier("get"), createFunctionExpression(getAccessor.parameters, getAccessor.body)); - descriptorProperties.push(getProperty_1); + else { + increaseIndent(); } - if (setAccessor) { - var setProperty = createPropertyAssignment(createIdentifier("set"), createFunctionExpression(setAccessor.parameters, setAccessor.body)); - descriptorProperties.push(setProperty); + emitList(properties, 0, numElements, multiLine, false); + if (!multiLine) { + write(" "); } - var trueExpr = ts.createSynthesizedNode(95); - var enumerableTrue = createPropertyAssignment(createIdentifier("enumerable"), trueExpr); - descriptorProperties.push(enumerableTrue); - var configurableTrue = createPropertyAssignment(createIdentifier("configurable"), trueExpr); - descriptorProperties.push(configurableTrue); - propertyDescriptor.properties = descriptorProperties; - var objectDotDefineProperty = createPropertyAccessExpression(createIdentifier("Object"), createIdentifier("defineProperty")); - return createCallExpression(objectDotDefineProperty, createNodeArray(propertyDescriptor)); - default: - ts.Debug.fail("ObjectLiteralElement kind " + property.kind + " not accounted for."); + else { + decreaseIndent(); + } + } } + write("}"); } - function createParenthesizedExpression(expression) { - var result = ts.createSynthesizedNode(161); - result.expression = expression; - return result; - } - function createNodeArray() { - var elements = []; - for (var _a = 0; _a < arguments.length; _a++) { - elements[_a - 0] = arguments[_a]; + function emitDownlevelObjectLiteralWithComputedProperties(node, firstComputedPropertyIndex) { + var multiLine = (node.flags & 512) !== 0; + var properties = node.properties; + write("("); + if (multiLine) { + increaseIndent(); } - var result = elements; - result.pos = -1; - result.end = -1; - return result; - } - function createBinaryExpression(left, operator, right, 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(182); - result.expression = expression; - return result; - } - function createMemberAccessForPropertyName(expression, memberName) { - if (memberName.kind === 65) { - return createPropertyAccessExpression(expression, memberName); + var tempVar = createAndRecordTempVariable(0); + emit(tempVar); + write(" = "); + emitObjectLiteralBody(node, firstComputedPropertyIndex); + for (var i = firstComputedPropertyIndex, n = properties.length; i < n; i++) { + writeComma(); + var property = properties[i]; + emitStart(property); + if (property.kind === 136 || property.kind === 137) { + var accessors = ts.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); + write(" = "); + if (property.kind === 224) { + emit(property.initializer); + } + else if (property.kind === 225) { + emitExpressionIdentifier(property.name); + } + else if (property.kind === 134) { + emitFunctionDeclaration(property); + } + else { + ts.Debug.fail("ObjectLiteralElement type not accounted for: " + property.kind); + } + } + emitEnd(property); } - else if (memberName.kind === 8 || memberName.kind === 7) { - return createElementAccessExpression(expression, memberName); + writeComma(); + emit(tempVar); + if (multiLine) { + decreaseIndent(); + writeLine(); } - else if (memberName.kind === 127) { - return createElementAccessExpression(expression, memberName.expression); + write(")"); + function writeComma() { + if (multiLine) { + write(","); + writeLine(); + } + else { + write(", "); + } } - else { - ts.Debug.fail("Kind '" + memberName.kind + "' not accounted for."); - } - } - function createPropertyAssignment(name, initializer) { - var result = ts.createSynthesizedNode(224); - result.name = name; - result.initializer = initializer; - return result; - } - function createFunctionExpression(parameters, body) { - var result = ts.createSynthesizedNode(162); - result.parameters = parameters; - result.body = body; - return result; - } - function createPropertyAccessExpression(expression, name) { - 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(156); - result.expression = expression; - result.argumentExpression = argumentExpression; - return result; - } - function createIdentifier(name, startsOnNewLine) { - var result = ts.createSynthesizedNode(65, startsOnNewLine); - result.text = name; - return result; - } - function createCallExpression(invokedExpression, arguments) { - var result = ts.createSynthesizedNode(157); - result.expression = invokedExpression; - result.arguments = arguments; - return result; } function emitObjectLiteral(node) { var properties = node.properties; @@ -21103,11 +21669,35 @@ var ts; return; } } - write("{"); - if (properties.length) { - emitLinePreservingList(node, properties, languageVersion >= 1, true); + emitObjectLiteralBody(node, properties.length); + } + function createBinaryExpression(left, operator, right, startsOnNewLine) { + var result = ts.createSynthesizedNode(169, startsOnNewLine); + result.operatorToken = ts.createSynthesizedNode(operator); + result.left = left; + result.right = right; + return result; + } + function createPropertyAccessExpression(expression, name) { + var result = ts.createSynthesizedNode(155); + result.expression = parenthesizeForAccess(expression); + result.dotToken = ts.createSynthesizedNode(20); + result.name = name; + return result; + } + function createElementAccessExpression(expression, argumentExpression) { + var result = ts.createSynthesizedNode(156); + result.expression = parenthesizeForAccess(expression); + result.argumentExpression = argumentExpression; + return result; + } + function parenthesizeForAccess(expr) { + if (ts.isLeftHandSideExpression(expr) && expr.kind !== 158 && expr.kind !== 7) { + return expr; } - write("}"); + var node = ts.createSynthesizedNode(161); + node.expression = expr; + return node; } function emitComputedPropertyName(node) { write("["); @@ -21115,6 +21705,9 @@ var ts; write("]"); } function emitMethod(node) { + if (languageVersion >= 2 && node.asteriskToken) { + write("*"); + } emit(node.name, false); if (languageVersion < 2) { write(": function "); @@ -21486,7 +22079,7 @@ var ts; var tokenKind = 98; if (decl && languageVersion >= 2) { if (ts.isLet(decl)) { - tokenKind = 105; + tokenKind = 104; } else if (ts.isConst(decl)) { tokenKind = 70; @@ -21499,7 +22092,7 @@ var ts; switch (tokenKind) { case 98: return write("var "); - case 105: + case 104: return write("let "); case 70: return write("const "); @@ -21637,7 +22230,7 @@ var ts; else { var assignmentExpression = createBinaryExpression(node.initializer, 53, rhsIterationValue, false); if (node.initializer.kind === 153 || node.initializer.kind === 154) { - emitDestructuring(assignmentExpression, true, undefined, node); + emitDestructuring(assignmentExpression, true, undefined); } else { emitNodeWithoutSourceMap(assignmentExpression); @@ -21791,7 +22384,12 @@ var ts; writeLine(); emitStart(node); if (node.flags & 256) { - write("exports.default"); + if (languageVersion === 0) { + write("exports[\"default\"]"); + } + else { + write("exports.default"); + } } else { emitModuleMemberName(node); @@ -21818,7 +22416,7 @@ var ts; } } } - function emitDestructuring(root, isAssignmentExpressionStatement, value, lowestNonSynthesizedAncestor) { + function emitDestructuring(root, isAssignmentExpressionStatement, value) { var emitCount = 0; var isDeclaration = (root.kind === 198 && !(ts.getCombinedNodeFlags(root) & 1)) || root.kind === 129; if (root.kind === 169) { @@ -21875,25 +22473,20 @@ var ts; node.text = "" + value; return node; } - function parenthesizeForAccess(expr) { - if (expr.kind === 65 || expr.kind === 155 || expr.kind === 156) { - return expr; - } - var node = ts.createSynthesizedNode(161); - node.expression = expr; - return node; - } - function createPropertyAccess(object, propName) { + function createPropertyAccessForDestructuringProperty(object, propName) { if (propName.kind !== 65) { - return createElementAccess(object, propName); + return createElementAccessExpression(object, propName); } - return createPropertyAccessExpression(parenthesizeForAccess(object), propName); + return createPropertyAccessExpression(object, propName); } - function createElementAccess(object, index) { - var node = ts.createSynthesizedNode(156); - node.expression = parenthesizeForAccess(object); - node.argumentExpression = index; - return node; + function createSliceCall(value, sliceIndex) { + var call = ts.createSynthesizedNode(157); + var sliceIdentifier = ts.createSynthesizedNode(65); + sliceIdentifier.text = "slice"; + call.expression = createPropertyAccessExpression(value, sliceIdentifier); + call.arguments = ts.createSynthesizedNodeArray(); + call.arguments[0] = createNumericLiteral(sliceIndex); + return call; } function emitObjectLiteralAssignment(target, value) { var properties = target.properties; @@ -21904,7 +22497,7 @@ var ts; var p = properties[_a]; if (p.kind === 224 || p.kind === 225) { var propName = (p.name); - emitDestructuringAssignment(p.initializer || propName, createPropertyAccess(value, propName)); + emitDestructuringAssignment(p.initializer || propName, createPropertyAccessForDestructuringProperty(value, propName)); } } } @@ -21917,14 +22510,10 @@ var ts; var e = elements[i]; if (e.kind !== 175) { if (e.kind !== 173) { - emitDestructuringAssignment(e, createElementAccess(value, createNumericLiteral(i))); + emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i))); } - else { - if (i === elements.length - 1) { - value = ensureIdentifier(value); - emitAssignment(e.expression, value); - write(".slice(" + i + ")"); - } + else if (i === elements.length - 1) { + emitDestructuringAssignment(e.expression, createSliceCall(value, i)); } } } @@ -21980,18 +22569,14 @@ var ts; var element = elements[i]; if (pattern.kind === 150) { var propName = element.propertyName || element.name; - emitBindingElement(element, createPropertyAccess(value, propName)); + emitBindingElement(element, createPropertyAccessForDestructuringProperty(value, propName)); } else if (element.kind !== 175) { if (!element.dotDotDotToken) { - emitBindingElement(element, createElementAccess(value, createNumericLiteral(i))); + emitBindingElement(element, createElementAccessExpression(value, createNumericLiteral(i))); } - else { - if (i === elements.length - 1) { - value = ensureIdentifier(value); - emitAssignment(element.name, value); - write(".slice(" + i + ")"); - } + else if (i === elements.length - 1) { + emitBindingElement(element, createSliceCall(value, i)); } } } @@ -22100,12 +22685,12 @@ var ts; function emitParameter(node) { if (languageVersion < 2) { if (ts.isBindingPattern(node.name)) { - var name_16 = createTempVariable(0); + var name_19 = createTempVariable(0); if (!tempParameters) { tempParameters = []; } - tempParameters.push(name_16); - emit(name_16); + tempParameters.push(name_19); + emit(name_19); } else { emit(node.name); @@ -22123,6 +22708,9 @@ var ts; if (languageVersion < 2) { var tempIndex = 0; ts.forEach(node.parameters, function (p) { + if (p.dotDotDotToken) { + return; + } if (ts.isBindingPattern(p.name)) { writeLine(); write("var "); @@ -22152,6 +22740,9 @@ var ts; if (languageVersion < 2 && ts.hasRestParameters(node)) { var restIndex = node.parameters.length - 1; var restParam = node.parameters[restIndex]; + if (ts.isBindingPattern(restParam.name)) { + return; + } var tempName = createTempVariable(268435456).text; writeLine(); emitLeadingComments(restParam); @@ -22224,7 +22815,11 @@ var ts; write("default "); } } - write("function "); + write("function"); + if (languageVersion >= 2 && node.asteriskToken) { + write("*"); + } + write(" "); } if (shouldEmitFunctionName(node)) { emitDeclarationName(node); @@ -22421,28 +23016,47 @@ var ts; emitNodeWithoutSourceMap(memberName); } } - function emitMemberAssignments(node, staticFlag) { - ts.forEach(node.members, function (member) { - if (member.kind === 132 && (member.flags & 128) === 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, static) { + var properties = []; + for (var _a = 0, _b = node.members; _a < _b.length; _a++) { + var member = _b[_a]; + if (member.kind === 132 && static === ((member.flags & 128) !== 0) && member.initializer) { + properties.push(member); } - }); + } + return properties; + } + function emitPropertyDeclarations(node, properties) { + for (var _a = 0; _a < properties.length; _a++) { + var property = properties[_a]; + emitPropertyDeclaration(node, property); + } + } + function emitPropertyDeclaration(node, property, receiver, isExpression) { + writeLine(); + emitLeadingComments(property); + emitStart(property); + emitStart(property.name); + if (receiver) { + emit(receiver); + } + else { + if (property.flags & 128) { + 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) { ts.forEach(node.members, function (member) { @@ -22537,6 +23151,9 @@ var ts; else if (member.kind === 137) { write("set "); } + if (member.asteriskToken) { + write("*"); + } emit(member.name); emitSignatureAndBody(member); emitEnd(member); @@ -22555,6 +23172,12 @@ var ts; tempFlags = 0; tempVariables = undefined; tempParameters = undefined; + emitConstructorWorker(node, baseTypeElement); + tempFlags = saveTempFlags; + tempVariables = saveTempVariables; + tempParameters = saveTempParameters; + } + function emitConstructorWorker(node, baseTypeElement) { var hasInstancePropertyWithInitializer = false; ts.forEach(node.members, function (member) { if (member.kind === 135 && !member.body) { @@ -22623,7 +23246,7 @@ var ts; emitEnd(baseTypeElement); } } - emitMemberAssignments(node, 0); + emitPropertyDeclarations(node, getInitializedProperties(node, false)); if (ctor) { var statements = ctor.body.statements; if (superCall) { @@ -22643,9 +23266,6 @@ var ts; if (ctor) { emitTrailingComments(ctor); } - tempFlags = saveTempFlags; - tempVariables = saveTempVariables; - tempParameters = saveTempParameters; } function emitClassExpression(node) { return emitClassLikeDeclaration(node); @@ -22679,6 +23299,16 @@ var ts; } } } + var staticProperties = getInitializedProperties(node, true); + var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 174; + var tempVariable; + if (isClassExpressionWithStaticProperties) { + tempVariable = createAndRecordTempVariable(0); + write("("); + increaseIndent(); + emit(tempVariable); + write(" = "); + } write("class"); if ((node.name || !(node.flags & 256)) && !thisNodeIsDecorated) { write(" "); @@ -22711,9 +23341,24 @@ var ts; writeLine(); } } - writeLine(); - emitMemberAssignments(node, 128); - emitDecoratorsOfClass(node); + if (isClassExpressionWithStaticProperties) { + for (var _a = 0; _a < staticProperties.length; _a++) { + var property = staticProperties[_a]; + write(","); + writeLine(); + emitPropertyDeclaration(node, property, tempVariable, true); + } + write(","); + writeLine(); + emit(tempVariable); + decreaseIndent(); + write(")"); + } + else { + writeLine(); + emitPropertyDeclarations(node, staticProperties); + emitDecoratorsOfClass(node); + } if (!isES6ExportedDeclaration(node) && (node.flags & 1)) { writeLine(); emitStart(node); @@ -22763,7 +23408,7 @@ var ts; writeLine(); emitConstructor(node, baseTypeNode); emitMemberFunctionsForES5AndLower(node); - emitMemberAssignments(node, 128); + emitPropertyDeclarations(node, getInitializedProperties(node, true)); writeLine(); emitDecoratorsOfClass(node); writeLine(); @@ -22810,56 +23455,64 @@ var ts; emitDecoratorsOfConstructor(node); } function emitDecoratorsOfConstructor(node) { + var decorators = node.decorators; var constructor = ts.getFirstConstructorWithBody(node); - if (constructor) { - emitDecoratorsOfParameters(node, constructor); - } - if (!ts.nodeIsDecorated(node)) { + var hasDecoratedParameters = constructor && ts.forEach(constructor.parameters, ts.nodeIsDecorated); + if (!decorators && !hasDecoratedParameters) { return; } writeLine(); emitStart(node); emitDeclarationName(node); - write(" = "); - emitDecorateStart(node.decorators); + write(" = __decorate(["); + increaseIndent(); + writeLine(); + var decoratorCount = decorators ? decorators.length : 0; + var argumentsWritten = emitList(decorators, 0, decoratorCount, true, false, false, true, function (decorator) { + emitStart(decorator); + emit(decorator.expression); + emitEnd(decorator); + }); + argumentsWritten += emitDecoratorsOfParameters(constructor, argumentsWritten > 0); + emitSerializedTypeMetadata(node, argumentsWritten >= 0); + decreaseIndent(); + writeLine(); + write("], "); emitDeclarationName(node); write(");"); emitEnd(node); writeLine(); } function emitDecoratorsOfMembers(node, staticFlag) { - ts.forEach(node.members, function (member) { + for (var _a = 0, _b = node.members; _a < _b.length; _a++) { + var member = _b[_a]; if ((member.flags & 128) !== staticFlag) { - return; + continue; } - 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 (!ts.nodeCanBeDecorated(member)) { + continue; } - if (!decorators) { - return; + if (!ts.nodeOrChildIsDecorated(member)) { + continue; + } + var decorators = void 0; + var functionLikeMember = void 0; + if (ts.isAccessor(member)) { + var accessors = ts.getAllAccessorDeclarations(node.members, member); + if (member !== accessors.firstAccessor) { + continue; + } + decorators = accessors.firstAccessor.decorators; + if (!decorators && accessors.secondAccessor) { + decorators = accessors.secondAccessor.decorators; + } + functionLikeMember = accessors.setAccessor; + } + else { + decorators = member.decorators; + if (member.kind === 134) { + functionLikeMember = member; + } } writeLine(); emitStart(member); @@ -22870,9 +23523,24 @@ var ts; write(", "); emitExpressionForPropertyName(member.name); emitEnd(member.name); - write(", "); + write(","); + increaseIndent(); + writeLine(); } - emitDecorateStart(decorators); + write("__decorate(["); + increaseIndent(); + writeLine(); + var decoratorCount = decorators ? decorators.length : 0; + var argumentsWritten = emitList(decorators, 0, decoratorCount, true, false, false, true, function (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(", "); @@ -22886,51 +23554,131 @@ var ts; emitExpressionForPropertyName(member.name); emitEnd(member.name); write("))"); + decreaseIndent(); } 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 emitDecoratorsOfParameters(node, leadingComma) { + var argumentsWritten = 0; + if (node) { + var parameterIndex = 0; + for (var _a = 0, _b = node.parameters; _a < _b.length; _a++) { + var parameter = _b[_a]; + if (ts.nodeIsDecorated(parameter)) { + var decorators = parameter.decorators; + argumentsWritten += emitList(decorators, 0, decorators.length, true, false, leadingComma, true, function (decorator) { + emitStart(decorator); + write("__param(" + parameterIndex + ", "); + emit(decorator.expression); + write(")"); + emitEnd(decorator); + }); + leadingComma = true; + } + ++parameterIndex; + } + } + return argumentsWritten; + } + function shouldEmitTypeMetadata(node) { + switch (node.kind) { + case 134: + case 136: + case 137: + case 132: + return true; + } + return false; + } + function shouldEmitReturnTypeMetadata(node) { + switch (node.kind) { + case 134: + return true; + } + return false; + } + function shouldEmitParamTypesMetadata(node) { + switch (node.kind) { + case 201: + case 134: + case 137: + return true; + } + return false; + } + function emitSerializedTypeMetadata(node, writeComma) { + var 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, path, index) { + switch (index) { + case 0: + return "typeof " + path[index] + " !== 'undefined' && " + path[index]; + case 1: + return serializeTypeNameSegment(location, path, index - 1) + "." + path[index]; + default: + var temp = createAndRecordTempVariable(0).text; + return "(" + temp + " = " + serializeTypeNameSegment(location, path, index - 1) + ") && " + temp + "." + path[index]; + } + } + function emitSerializedType(location, name) { + if (typeof name === "string") { + write(name); + return; + } + else { + ts.Debug.assert(name.length > 0, "Invalid serialized type name"); + write("(" + serializeTypeNameSegment(location, name, name.length - 1) + ") || Object"); + } } function emitInterfaceDeclaration(node) { emitOnlyPinnedOrTripleSlashComments(node); @@ -23024,20 +23772,25 @@ var ts; function shouldEmitModuleDeclaration(node) { return ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation); } + function isModuleMergedWithES6Class(node) { + return languageVersion === 2 && !!(resolver.getNodeCheckFlags(node) & 2048); + } function emitModuleDeclaration(node) { var shouldEmit = shouldEmitModuleDeclaration(node); if (!shouldEmit) { return emitOnlyPinnedOrTripleSlashComments(node); } - emitStart(node); - if (isES6ExportedDeclaration(node)) { - write("export "); + if (!isModuleMergedWithES6Class(node)) { + emitStart(node); + if (isES6ExportedDeclaration(node)) { + write("export "); + } + write("var "); + emit(node.name); + write(";"); + emitEnd(node); + writeLine(); } - write("var "); - emit(node.name); - write(";"); - emitEnd(node); - writeLine(); emitStart(node); write("(function ("); emitStart(node.name); @@ -23332,7 +24085,12 @@ var ts; writeLine(); emitStart(node); emitContainingModuleName(node); - write(".default = "); + if (languageVersion === 0) { + write("[\"default\"] = "); + } + else { + write(".default = "); + } emit(node.expression); write(";"); emitEnd(node); @@ -23371,8 +24129,8 @@ var ts; 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); + var name_20 = (specifier.propertyName || specifier.name).text; + (exportSpecifiers[name_20] || (exportSpecifiers[name_20] = [])).push(specifier); } } break; @@ -23384,19 +24142,6 @@ var ts; } } } - function sortAMDModules(amdModules) { - return amdModules.sort(function (moduleA, moduleB) { - if (moduleA.name === moduleB.name) { - return 0; - } - else if (!moduleA.name) { - return 1; - } - else { - return -1; - } - }); - } function emitExportStarHelper() { if (hasExportStars) { writeLine(); @@ -23411,48 +24156,60 @@ var ts; } function emitAMDModule(node, startIndex) { collectExternalModuleInfo(node); + var aliasedModuleNames = []; + var unaliasedModuleNames = []; + var importAliasNames = []; + for (var _a = 0, _b = node.amdDependencies; _a < _b.length; _a++) { + var amdDependency = _b[_a]; + if (amdDependency.name) { + aliasedModuleNames.push("\"" + amdDependency.path + "\""); + importAliasNames.push(amdDependency.name); + } + else { + unaliasedModuleNames.push("\"" + amdDependency.path + "\""); + } + } + for (var _c = 0; _c < externalImports.length; _c++) { + var importNode = externalImports[_c]; + var externalModuleName = ""; + var moduleName = ts.getExternalModuleName(importNode); + if (moduleName.kind === 8) { + externalModuleName = getLiteralText(moduleName); + } + var importAliasName = void 0; + var namespaceDeclaration = getNamespaceDeclarationNode(importNode); + if (namespaceDeclaration && !isDefaultImport(importNode)) { + importAliasName = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, namespaceDeclaration.name); + } + else { + importAliasName = getGeneratedNameForNode(importNode); + } + if (importAliasName) { + aliasedModuleNames.push(externalModuleName); + importAliasNames.push(importAliasName); + } + else { + unaliasedModuleNames.push(externalModuleName); + } + } writeLine(); write("define("); - sortAMDModules(node.amdDependencies); if (node.amdModuleName) { write("\"" + node.amdModuleName + "\", "); } write("[\"require\", \"exports\""); - for (var _a = 0; _a < externalImports.length; _a++) { - var importNode = externalImports[_a]; + if (aliasedModuleNames.length) { write(", "); - var moduleName = ts.getExternalModuleName(importNode); - if (moduleName.kind === 8) { - emitLiteral(moduleName); - } - else { - write("\"\""); - } + write(aliasedModuleNames.join(", ")); } - for (var _b = 0, _c = node.amdDependencies; _b < _c.length; _b++) { - var amdDependency = _c[_b]; - var text = "\"" + amdDependency.path + "\""; + if (unaliasedModuleNames.length) { write(", "); - write(text); + write(unaliasedModuleNames.join(", ")); } write("], function (require, exports"); - for (var _d = 0; _d < externalImports.length; _d++) { - var importNode = externalImports[_d]; + if (importAliasNames.length) { write(", "); - var namespaceDeclaration = getNamespaceDeclarationNode(importNode); - if (namespaceDeclaration && !isDefaultImport(importNode)) { - emit(namespaceDeclaration.name); - } - else { - write(getGeneratedNameForNode(importNode)); - } - } - for (var _e = 0, _f = node.amdDependencies; _e < _f.length; _e++) { - var amdDependency = _f[_e]; - if (amdDependency.name) { - write(", "); - write(amdDependency.name); - } + write(importAliasNames.join(", ")); } write(") {"); increaseIndent(); @@ -23506,7 +24263,7 @@ var ts; } return statements.length; } - function writeHelper(text) { + function writeLines(text) { var lines = text.split(/\r\n|\r|\n/g); for (var i = 0; i < lines.length; ++i) { var line = lines[i]; @@ -23521,26 +24278,20 @@ var ts; emitDetachedComments(node); var startIndex = emitDirectivePrologues(node.statements, false); if ((languageVersion < 2) && (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8)) { - 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) & 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};"); + writeLines(decorateHelper); + if (compilerOptions.emitDecoratorMetadata) { + writeLines(metadataHelper); + } decorateEmitted = true; } + if (!paramEmitted && resolver.getNodeCheckFlags(node) & 1024) { + writeLines(paramHelper); + paramEmitted = true; + } if (ts.isExternalModule(node)) { if (languageVersion >= 2) { emitES6Module(node, startIndex); @@ -23689,6 +24440,8 @@ var ts; return emitConditionalExpression(node); case 173: return emitSpreadElementExpression(node); + case 172: + return emitYieldExpression(node); case 175: return; case 179: @@ -24031,7 +24784,7 @@ var ts; getDiagnosticsProducingTypeChecker: getDiagnosticsProducingTypeChecker, getCommonSourceDirectory: function () { return commonSourceDirectory; }, emit: emit, - getCurrentDirectory: host.getCurrentDirectory, + getCurrentDirectory: function () { return host.getCurrentDirectory(); }, getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); }, getIdentifierCount: function () { return getDiagnosticsProducingTypeChecker().getIdentifierCount(); }, getSymbolCount: function () { return getDiagnosticsProducingTypeChecker().getSymbolCount(); }, @@ -24040,14 +24793,14 @@ var ts; return program; function getEmitHost(writeFileCallback) { return { - getCanonicalFileName: host.getCanonicalFileName, + getCanonicalFileName: function (fileName) { return host.getCanonicalFileName(fileName); }, getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, - getCurrentDirectory: host.getCurrentDirectory, - getNewLine: host.getNewLine, + getCurrentDirectory: function () { return host.getCurrentDirectory(); }, + getNewLine: function () { return host.getNewLine(); }, getSourceFile: program.getSourceFile, getSourceFiles: program.getSourceFiles, - writeFile: writeFileCallback || host.writeFile + writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError) { return host.writeFile(fileName, data, writeByteOrderMark, onError); }) }; } function getDiagnosticsProducingTypeChecker() { @@ -24455,9 +25208,6 @@ var ts; case 195: return textSpan(node, node.expression); case 214: - if (!node.expression) { - return undefined; - } return textSpan(node, node.expression); case 208: return textSpan(node, node.moduleReference); @@ -24710,20 +25460,6 @@ 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; @@ -24742,6 +25478,55 @@ var ts; elements.push(span); } } + function addOutliningSpanComments(commentSpan, autoCollapse) { + if (commentSpan) { + var span = { + textSpan: ts.createTextSpanFromBounds(commentSpan.pos, commentSpan.end), + hintSpan: ts.createTextSpanFromBounds(commentSpan.pos, commentSpan.end), + bannerText: collapseText, + autoCollapse: autoCollapse + }; + elements.push(span); + } + } + function addOutliningForLeadingCommentsForNode(n) { + var comments = ts.getLeadingCommentRangesOfNode(n, sourceFile); + if (comments) { + var firstSingleLineCommentStart = -1; + var lastSingleLineCommentEnd = -1; + var isFirstSingleLineComment = true; + var singleLineCommentCount = 0; + for (var _i = 0; _i < comments.length; _i++) { + var currentComment = comments[_i]; + if (currentComment.kind === 2) { + if (isFirstSingleLineComment) { + firstSingleLineCommentStart = currentComment.pos; + } + isFirstSingleLineComment = false; + lastSingleLineCommentEnd = currentComment.end; + singleLineCommentCount++; + } + else if (currentComment.kind === 3) { + combineAndAddMultipleSingleLineComments(singleLineCommentCount, firstSingleLineCommentStart, lastSingleLineCommentEnd); + addOutliningSpanComments(currentComment, false); + singleLineCommentCount = 0; + lastSingleLineCommentEnd = -1; + isFirstSingleLineComment = true; + } + } + combineAndAddMultipleSingleLineComments(singleLineCommentCount, firstSingleLineCommentStart, lastSingleLineCommentEnd); + } + } + function combineAndAddMultipleSingleLineComments(count, start, end) { + if (count > 1) { + var multipleSingleLineComments = { + pos: start, + end: end, + kind: 2 + }; + addOutliningSpanComments(multipleSingleLineComments, false); + } + } function autoCollapse(node) { return ts.isFunctionBlock(node) && node.parent.kind !== 163; } @@ -24751,6 +25536,9 @@ var ts; if (depth > maxDepth) { return; } + if (ts.isDeclaration(n)) { + addOutliningForLeadingCommentsForNode(n); + } switch (n.kind) { case 179: if (!ts.isFunctionBlock(n)) { @@ -24832,28 +25620,30 @@ var ts; var rawItems = []; ts.forEach(program.getSourceFiles(), function (sourceFile) { cancellationToken.throwIfCancellationRequested(); - var declarations = sourceFile.getNamedDeclarations(); - for (var _i = 0; _i < declarations.length; _i++) { - var declaration = declarations[_i]; - var name = getDeclarationName(declaration); - if (name !== undefined) { - var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name); + var nameToDeclarations = sourceFile.getNamedDeclarations(); + for (var name_21 in nameToDeclarations) { + var declarations = ts.getProperty(nameToDeclarations, name_21); + if (declarations) { + var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_21); if (!matches) { continue; } - if (patternMatcher.patternContainsDots) { - var containers = getContainers(declaration); - if (!containers) { - return undefined; - } - matches = patternMatcher.getMatches(containers, name); - if (!matches) { - continue; + for (var _i = 0; _i < declarations.length; _i++) { + var declaration = declarations[_i]; + if (patternMatcher.patternContainsDots) { + var containers = getContainers(declaration); + if (!containers) { + return undefined; + } + matches = patternMatcher.getMatches(containers, name_21); + if (!matches) { + continue; + } } + var fileName = sourceFile.fileName; + var matchKind = bestMatchKind(matches); + rawItems.push({ name: name_21, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); } - var fileName = sourceFile.fileName; - var matchKind = bestMatchKind(matches); - rawItems.push({ name: name, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); } } }); @@ -24873,25 +25663,13 @@ var ts; } return true; } - function getDeclarationName(declaration) { - var result = getTextOfIdentifierOrLiteral(declaration.name); - if (result !== undefined) { - return result; - } - if (declaration.name.kind === 127) { - var expr = declaration.name.expression; - if (expr.kind === 155) { - return expr.name.text; - } - return getTextOfIdentifierOrLiteral(expr); - } - return undefined; - } function getTextOfIdentifierOrLiteral(node) { - if (node.kind === 65 || - node.kind === 8 || - node.kind === 7) { - return node.text; + if (node) { + if (node.kind === 65 || + node.kind === 8 || + node.kind === 7) { + return node.text; + } } return undefined; } @@ -25125,17 +25903,17 @@ var ts; var keyToItem = {}; for (var _i = 0; _i < nodes.length; _i++) { var child = nodes[_i]; - 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 item = createItem(child); + if (item !== undefined) { + if (item.text.length > 0) { + var key = item.text + "-" + item.kind + "-" + item.indent; var itemWithSameName = keyToItem[key]; if (itemWithSameName) { - merge(itemWithSameName, item_3); + merge(itemWithSameName, item); } else { - keyToItem[key] = item_3; - items.push(item_3); + keyToItem[key] = item; + items.push(item); } } } @@ -25194,9 +25972,9 @@ var ts; case 198: case 152: var variableDeclarationNode; - var name_18; + var name_22; if (node.kind === 152) { - name_18 = node.name; + name_22 = node.name; variableDeclarationNode = node; while (variableDeclarationNode && variableDeclarationNode.kind !== 198) { variableDeclarationNode = variableDeclarationNode.parent; @@ -25206,16 +25984,16 @@ var ts; else { ts.Debug.assert(!ts.isBindingPattern(node.name)); variableDeclarationNode = node; - name_18 = node.name; + name_22 = node.name; } if (ts.isConst(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_18), ts.ScriptElementKind.constElement); + return createItem(node, getTextOfNode(name_22), ts.ScriptElementKind.constElement); } else if (ts.isLet(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_18), ts.ScriptElementKind.letElement); + return createItem(node, getTextOfNode(name_22), ts.ScriptElementKind.letElement); } else { - return createItem(node, getTextOfNode(name_18), ts.ScriptElementKind.variableElement); + return createItem(node, getTextOfNode(name_22), ts.ScriptElementKind.variableElement); } case 135: return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); @@ -25285,9 +26063,9 @@ var ts; return getNavigationBarItem(moduleName, ts.ScriptElementKind.moduleElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } function createFunctionItem(node) { - if ((node.name || node.flags & 256) && node.body && node.body.kind === 179) { + if (node.body && node.body.kind === 179) { var childItems = getItemsWorker(sortNodes(node.body.statements), createChildItem); - return getNavigationBarItem((!node.name && node.flags & 256) ? "default" : node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); + return getNavigationBarItem(!node.name ? "default" : node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } return undefined; } @@ -25314,7 +26092,7 @@ var ts; } childItems = getItemsWorker(sortNodes(nodes), createChildItem); } - var nodeName = !node.name && (node.flags & 256) ? "default" : node.name.text; + var nodeName = !node.name ? "default" : node.name.text; return getNavigationBarItem(nodeName, ts.ScriptElementKind.classElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } function createEnumItem(node) { @@ -25807,7 +26585,8 @@ var ts; var SignatureHelp; (function (SignatureHelp) { var emptyArray = []; - function getSignatureHelpItems(sourceFile, position, typeInfoResolver, cancellationToken) { + function getSignatureHelpItems(program, sourceFile, position, cancellationToken) { + var typeChecker = program.getTypeChecker(); var startingToken = ts.findTokenOnLeftOfPosition(sourceFile, position); if (!startingToken) { return undefined; @@ -25819,12 +26598,51 @@ var ts; } var call = argumentInfo.invocation; var candidates = []; - var resolvedSignature = typeInfoResolver.getResolvedSignature(call, candidates); + var resolvedSignature = typeChecker.getResolvedSignature(call, candidates); cancellationToken.throwIfCancellationRequested(); if (!candidates.length) { + if (ts.isJavaScript(sourceFile.fileName)) { + return createJavaScriptSignatureHelpItems(argumentInfo); + } return undefined; } return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo); + function createJavaScriptSignatureHelpItems(argumentInfo) { + if (argumentInfo.invocation.kind !== 157) { + return undefined; + } + var callExpression = argumentInfo.invocation; + var expression = callExpression.expression; + var name = expression.kind === 65 + ? expression + : expression.kind === 155 + ? expression.name + : undefined; + if (!name || !name.text) { + return undefined; + } + var typeChecker = program.getTypeChecker(); + for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { + var sourceFile_1 = _a[_i]; + var nameToDeclarations = sourceFile_1.getNamedDeclarations(); + var declarations = ts.getProperty(nameToDeclarations, name.text); + if (declarations) { + for (var _b = 0; _b < declarations.length; _b++) { + var declaration = declarations[_b]; + var symbol = declaration.symbol; + if (symbol) { + var type = typeChecker.getTypeOfSymbolAtLocation(symbol, declaration); + if (type) { + var callSignatures = type.getCallSignatures(); + if (callSignatures && callSignatures.length) { + return createSignatureHelpItems(callSignatures, callSignatures[0], argumentInfo); + } + } + } + } + } + } + } function getImmediatelyContainingArgumentInfo(node) { if (node.parent.kind === 157 || node.parent.kind === 158) { var callExpression = node.parent; @@ -25986,8 +26804,8 @@ var ts; var isTypeParameterList = argumentListInfo.kind === 0; var invocation = argumentListInfo.invocation; var callTarget = ts.getInvokedExpression(invocation); - var callTargetSymbol = typeInfoResolver.getSymbolAtLocation(callTarget); - var callTargetDisplayParts = callTargetSymbol && ts.symbolToDisplayParts(typeInfoResolver, callTargetSymbol, undefined, undefined); + var callTargetSymbol = typeChecker.getSymbolAtLocation(callTarget); + var callTargetDisplayParts = callTargetSymbol && ts.symbolToDisplayParts(typeChecker, callTargetSymbol, undefined, undefined); var items = ts.map(candidates, function (candidateSignature) { var signatureHelpParameters; var prefixDisplayParts = []; @@ -26001,13 +26819,13 @@ var ts; signatureHelpParameters = typeParameters && typeParameters.length > 0 ? ts.map(typeParameters, createSignatureHelpParameterForTypeParameter) : emptyArray; suffixDisplayParts.push(ts.punctuationPart(25)); var parameterParts = ts.mapToDisplayParts(function (writer) { - return typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, invocation); + return typeChecker.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, invocation); }); suffixDisplayParts.push.apply(suffixDisplayParts, parameterParts); } else { var typeParameterParts = ts.mapToDisplayParts(function (writer) { - return typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation); + return typeChecker.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation); }); prefixDisplayParts.push.apply(prefixDisplayParts, typeParameterParts); prefixDisplayParts.push(ts.punctuationPart(16)); @@ -26016,7 +26834,7 @@ var ts; suffixDisplayParts.push(ts.punctuationPart(17)); } var returnTypeParts = ts.mapToDisplayParts(function (writer) { - return typeInfoResolver.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation); + return typeChecker.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation); }); suffixDisplayParts.push.apply(suffixDisplayParts, returnTypeParts); return { @@ -26044,7 +26862,7 @@ var ts; }; function createSignatureHelpParameterForParameter(parameter) { var displayParts = ts.mapToDisplayParts(function (writer) { - return typeInfoResolver.getSymbolDisplayBuilder().buildParameterDisplay(parameter, writer, invocation); + return typeChecker.getSymbolDisplayBuilder().buildParameterDisplay(parameter, writer, invocation); }); var isOptional = ts.hasQuestionToken(parameter.valueDeclaration); return { @@ -26056,7 +26874,7 @@ var ts; } function createSignatureHelpParameterForTypeParameter(typeParameter) { var displayParts = ts.mapToDisplayParts(function (writer) { - return typeInfoResolver.getSymbolDisplayBuilder().buildTypeParameterDisplay(typeParameter, writer, invocation); + return typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(typeParameter, writer, invocation); }); return { name: typeParameter.symbol.name, @@ -26442,9 +27260,9 @@ var ts; ts.isInsideTemplateLiteral = isInsideTemplateLiteral; function isAccessibilityModifier(kind) { switch (kind) { - case 109: - case 107: case 108: + case 106: + case 107: return true; } return false; @@ -26634,6 +27452,10 @@ var ts; }); } ts.signatureToDisplayParts = signatureToDisplayParts; + function isJavaScript(fileName) { + return ts.fileExtensionIs(fileName, ".js"); + } + ts.isJavaScript = isJavaScript; })(ts || (ts = {})); /// /// @@ -26686,7 +27508,7 @@ var ts; break; } scanner.scan(); - var item_4 = { + var item = { pos: pos, end: scanner.getStartPos(), kind: t_2 @@ -26695,7 +27517,7 @@ var ts; if (!leadingTrivia) { leadingTrivia = []; } - leadingTrivia.push(item_4); + leadingTrivia.push(item); } savedPos = scanner.getStartPos(); } @@ -26812,20 +27634,6 @@ 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) { @@ -26905,35 +27713,7 @@ 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) { @@ -26956,35 +27736,7 @@ 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) { @@ -27016,35 +27768,7 @@ 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) { @@ -27073,20 +27797,6 @@ 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) { @@ -27121,20 +27831,6 @@ 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) { @@ -27188,7 +27884,7 @@ var ts; 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([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.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([104, 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(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)); @@ -27201,8 +27897,8 @@ var ts; this.SpaceAfterBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryKeywordOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); this.NoSpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(114, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([117, 118]), 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([69, 115, 77, 78, 79, 116, 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.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([69, 115, 77, 78, 79, 116, 102, 85, 103, 117, 106, 108, 120, 109]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); + this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([79, 102])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(8, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2)); this.SpaceAfterArrow = new formatting.Rule(formatting.RuleDescriptor.create3(32, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); this.NoSpaceAfterEllipsis = new formatting.Rule(formatting.RuleDescriptor.create1(21, 65), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); @@ -27213,6 +27909,9 @@ var ts; this.NoSpaceBeforeCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 25), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); this.NoSpaceAfterCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(25, formatting.Shared.TokenRange.FromTokens([16, 18, 25, 23])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(14, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectTypeContext), 8)); + this.SpaceBeforeAt = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 52), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); + this.NoSpaceAfterAt = new formatting.Rule(formatting.RuleDescriptor.create3(52, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); + this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([65, 78, 73, 69, 109, 108, 106, 107, 116, 120, 18, 35])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2)); this.HighPriorityCommonRules = [ this.IgnoreBeforeComment, this.IgnoreAfterLineComment, @@ -27247,7 +27946,10 @@ var ts; this.NoSpaceBetweenCloseParenAndAngularBracket, this.NoSpaceAfterOpenAngularBracket, this.NoSpaceBeforeCloseAngularBracket, - this.NoSpaceAfterCloseAngularBracket + this.NoSpaceAfterCloseAngularBracket, + this.SpaceBeforeAt, + this.NoSpaceAfterAt, + this.SpaceAfterDecorator, ]; this.LowPriorityCommonRules = [ @@ -27283,9 +27985,9 @@ var ts; } Rules.prototype.getRuleName = function (rule) { var o = this; - for (var name_19 in o) { - if (o[name_19] === rule) { - return name_19; + for (var name_23 in o) { + if (o[name_23] === rule) { + return name_23; } } throw new Error("Unknown rule"); @@ -27448,6 +28150,18 @@ var ts; Rules.IsSameLineTokenContext = function (context) { return context.TokensAreOnSameLine(); }; + Rules.IsEndOfDecoratorContextOnSameLine = function (context) { + return context.TokensAreOnSameLine() && + context.contextNode.decorators && + Rules.NodeIsInDecoratorContext(context.currentTokenParent) && + !Rules.NodeIsInDecoratorContext(context.nextTokenParent); + }; + Rules.NodeIsInDecoratorContext = function (node) { + while (ts.isExpression(node)) { + node = node.parent; + } + return node.kind === 130; + }; Rules.IsStartOfVariableDeclarationList = function (context) { return context.currentTokenParent.kind === 199 && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; @@ -27495,20 +28209,6 @@ var ts; 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) { @@ -27646,20 +28346,6 @@ 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) { @@ -27775,20 +28461,6 @@ var ts; })(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. -// /// /// /// @@ -27801,20 +28473,6 @@ var 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) { @@ -28077,8 +28735,12 @@ var ts; formattingScanner.advance(); if (formattingScanner.isOnToken()) { var startLine = sourceFile.getLineAndCharacterOfPosition(enclosingNode.getStart(sourceFile)).line; + var undecoratedStartLine = startLine; + if (enclosingNode.decorators) { + undecoratedStartLine = sourceFile.getLineAndCharacterOfPosition(ts.getNonDecoratorTokenPosOfNode(enclosingNode, sourceFile)).line; + } var delta = getOwnOrInheritedDelta(enclosingNode, options, sourceFile); - processNode(enclosingNode, enclosingNode, startLine, initialIndentation, delta); + processNode(enclosingNode, enclosingNode, startLine, undecoratedStartLine, initialIndentation, delta); } formattingScanner.close(); return edits; @@ -28137,7 +28799,7 @@ var ts; } switch (node.kind) { case 201: return 69; - case 202: return 104; + case 202: return 103; case 200: return 83; case 204: return 204; case 136: return 116; @@ -28200,14 +28862,14 @@ var ts; } }; } - function processNode(node, contextNode, nodeStartLine, indentation, delta) { + function processNode(node, contextNode, nodeStartLine, undecoratedNodeStartLine, indentation, delta) { if (!ts.rangeOverlapsWithStartEnd(originalRange, node.getStart(sourceFile), node.getEnd())) { return; } var nodeDynamicIndentation = getDynamicIndentation(node, nodeStartLine, indentation, delta); var childContextNode = contextNode; ts.forEachChild(node, function (child) { - processChildNode(child, -1, node, nodeDynamicIndentation, nodeStartLine, false); + processChildNode(child, -1, node, nodeDynamicIndentation, nodeStartLine, undecoratedNodeStartLine, false); }, function (nodes) { processChildNodes(nodes, node, nodeStartLine, nodeDynamicIndentation); }); @@ -28218,9 +28880,13 @@ var ts; } consumeTokenAndAdvanceScanner(tokenInfo, node, nodeDynamicIndentation); } - function processChildNode(child, inheritedIndentation, parent, parentDynamicIndentation, parentStartLine, isListItem) { + function processChildNode(child, inheritedIndentation, parent, parentDynamicIndentation, parentStartLine, undecoratedParentStartLine, isListItem) { var childStartPos = child.getStart(sourceFile); - var childStart = sourceFile.getLineAndCharacterOfPosition(childStartPos); + var childStartLine = sourceFile.getLineAndCharacterOfPosition(childStartPos).line; + var undecoratedChildStartLine = childStartLine; + if (child.decorators) { + undecoratedChildStartLine = sourceFile.getLineAndCharacterOfPosition(ts.getNonDecoratorTokenPosOfNode(child, sourceFile)).line; + } var childIndentationAmount = -1; if (isListItem) { childIndentationAmount = tryComputeIndentationForListItem(childStartPos, child.end, parentStartLine, originalRange, inheritedIndentation); @@ -28250,8 +28916,9 @@ var ts; consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); return inheritedIndentation; } - var childIndentation = computeIndentation(child, childStart.line, childIndentationAmount, node, parentDynamicIndentation, parentStartLine); - processNode(child, childContextNode, childStart.line, childIndentation.indentation, childIndentation.delta); + var effectiveParentStartLine = child.kind === 130 ? childStartLine : undecoratedParentStartLine; + var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); + processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); childContextNode = node; return inheritedIndentation; } @@ -28280,7 +28947,7 @@ var ts; var inheritedIndentation = -1; 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, startLine, true); } if (listEndToken !== 0) { if (formattingScanner.isOnToken()) { @@ -29446,101 +30113,138 @@ var ts; }; SourceFileObject.prototype.getNamedDeclarations = function () { if (!this.namedDeclarations) { - var sourceFile = this; - var namedDeclarations = []; - ts.forEachChild(sourceFile, function visit(node) { - switch (node.kind) { - case 200: - case 134: - case 133: - var functionDeclaration = node; - if (functionDeclaration.name && functionDeclaration.name.getFullWidth() > 0) { - var lastDeclaration = namedDeclarations.length > 0 ? - namedDeclarations[namedDeclarations.length - 1] : - undefined; - if (lastDeclaration && functionDeclaration.symbol === lastDeclaration.symbol) { - if (functionDeclaration.body && !lastDeclaration.body) { - namedDeclarations[namedDeclarations.length - 1] = functionDeclaration; - } - } - else { - namedDeclarations.push(functionDeclaration); - } - ts.forEachChild(node, visit); - } - break; - case 201: - case 202: - case 203: - case 204: - case 205: - case 208: - case 217: - case 213: - case 208: - case 210: - case 211: - case 136: - case 137: - case 145: - if (node.name) { - namedDeclarations.push(node); - } - case 135: - case 180: - case 199: - case 150: - case 151: - case 206: - ts.forEachChild(node, visit); - break; - case 179: - if (ts.isFunctionBlock(node)) { - ts.forEachChild(node, visit); - } - break; - case 129: - if (!(node.flags & 112)) { - break; - } - case 198: - case 152: - if (ts.isBindingPattern(node.name)) { - ts.forEachChild(node.name, visit); - break; - } - case 226: - case 132: - case 131: - namedDeclarations.push(node); - break; - case 215: - if (node.exportClause) { - ts.forEach(node.exportClause.elements, visit); - } - break; - case 209: - var importClause = node.importClause; - if (importClause) { - if (importClause.name) { - namedDeclarations.push(importClause); - } - if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 211) { - namedDeclarations.push(importClause.namedBindings); - } - else { - ts.forEach(importClause.namedBindings.elements, visit); - } - } - } - break; - } - }); - this.namedDeclarations = namedDeclarations; + this.namedDeclarations = this.computeNamedDeclarations(); } return this.namedDeclarations; }; + SourceFileObject.prototype.computeNamedDeclarations = function () { + var result = {}; + ts.forEachChild(this, visit); + return result; + function addDeclaration(declaration) { + var name = getDeclarationName(declaration); + if (name) { + var declarations = getDeclarations(name); + declarations.push(declaration); + } + } + function getDeclarations(name) { + return ts.getProperty(result, name) || (result[name] = []); + } + function getDeclarationName(declaration) { + if (declaration.name) { + var result_2 = getTextOfIdentifierOrLiteral(declaration.name); + if (result_2 !== undefined) { + return result_2; + } + if (declaration.name.kind === 127) { + var expr = declaration.name.expression; + if (expr.kind === 155) { + return expr.name.text; + } + return getTextOfIdentifierOrLiteral(expr); + } + } + return undefined; + } + function getTextOfIdentifierOrLiteral(node) { + if (node) { + if (node.kind === 65 || + node.kind === 8 || + node.kind === 7) { + return node.text; + } + } + return undefined; + } + function visit(node) { + switch (node.kind) { + case 200: + case 134: + case 133: + var functionDeclaration = node; + var declarationName = getDeclarationName(functionDeclaration); + if (declarationName) { + var declarations = getDeclarations(declarationName); + var lastDeclaration = ts.lastOrUndefined(declarations); + if (lastDeclaration && functionDeclaration.parent === lastDeclaration.parent && functionDeclaration.symbol === lastDeclaration.symbol) { + if (functionDeclaration.body && !lastDeclaration.body) { + declarations[declarations.length - 1] = functionDeclaration; + } + } + else { + declarations.push(functionDeclaration); + } + ts.forEachChild(node, visit); + } + break; + case 201: + case 202: + case 203: + case 204: + case 205: + case 208: + case 217: + case 213: + case 208: + case 210: + case 211: + case 136: + case 137: + case 145: + addDeclaration(node); + case 135: + case 180: + case 199: + case 150: + case 151: + case 206: + ts.forEachChild(node, visit); + break; + case 179: + if (ts.isFunctionBlock(node)) { + ts.forEachChild(node, visit); + } + break; + case 129: + if (!(node.flags & 112)) { + break; + } + case 198: + case 152: + if (ts.isBindingPattern(node.name)) { + ts.forEachChild(node.name, visit); + break; + } + case 226: + case 132: + case 131: + addDeclaration(node); + break; + case 215: + if (node.exportClause) { + ts.forEach(node.exportClause.elements, visit); + } + break; + case 209: + var importClause = node.importClause; + if (importClause) { + if (importClause.name) { + addDeclaration(importClause); + } + if (importClause.namedBindings) { + if (importClause.namedBindings.kind === 211) { + addDeclaration(importClause.namedBindings); + } + else { + ts.forEach(importClause.namedBindings.elements, visit); + } + } + } + break; + } + } + }; return SourceFileObject; })(NodeObject); var TextChange = (function () { @@ -29549,6 +30253,13 @@ var ts; return TextChange; })(); ts.TextChange = TextChange; + var HighlightSpanKind; + (function (HighlightSpanKind) { + HighlightSpanKind.none = "none"; + HighlightSpanKind.definition = "definition"; + HighlightSpanKind.reference = "reference"; + HighlightSpanKind.writtenReference = "writtenReference"; + })(HighlightSpanKind = ts.HighlightSpanKind || (ts.HighlightSpanKind = {})); (function (SymbolDisplayPartKind) { SymbolDisplayPartKind[SymbolDisplayPartKind["aliasName"] = 0] = "aliasName"; SymbolDisplayPartKind[SymbolDisplayPartKind["className"] = 1] = "className"; @@ -29586,10 +30297,10 @@ var ts; TokenClass[TokenClass["RegExpLiteral"] = 8] = "RegExpLiteral"; })(ts.TokenClass || (ts.TokenClass = {})); var TokenClass = ts.TokenClass; - var ScriptElementKind = (function () { - function ScriptElementKind() { - } + var ScriptElementKind; + (function (ScriptElementKind) { ScriptElementKind.unknown = ""; + ScriptElementKind.warning = "warning"; ScriptElementKind.keyword = "keyword"; ScriptElementKind.scriptElement = "script"; ScriptElementKind.moduleElement = "module"; @@ -29616,12 +30327,9 @@ var ts; ScriptElementKind.alias = "alias"; ScriptElementKind.constElement = "const"; ScriptElementKind.letElement = "let"; - return ScriptElementKind; - })(); - ts.ScriptElementKind = ScriptElementKind; - var ScriptElementKindModifier = (function () { - function ScriptElementKindModifier() { - } + })(ScriptElementKind = ts.ScriptElementKind || (ts.ScriptElementKind = {})); + var ScriptElementKindModifier; + (function (ScriptElementKindModifier) { ScriptElementKindModifier.none = ""; ScriptElementKindModifier.publicMemberModifier = "public"; ScriptElementKindModifier.privateMemberModifier = "private"; @@ -29629,9 +30337,7 @@ var ts; ScriptElementKindModifier.exportedModifier = "export"; ScriptElementKindModifier.ambientModifier = "declare"; ScriptElementKindModifier.staticModifier = "static"; - return ScriptElementKindModifier; - })(); - ts.ScriptElementKindModifier = ScriptElementKindModifier; + })(ScriptElementKindModifier = ts.ScriptElementKindModifier || (ts.ScriptElementKindModifier = {})); var ClassificationTypeNames = (function () { function ClassificationTypeNames() { } @@ -29817,7 +30523,7 @@ var ts; useCaseSensitiveFileNames: function () { return false; }, getCanonicalFileName: function (fileName) { return fileName; }, getCurrentDirectory: function () { return ""; }, - getNewLine: function () { return "\r\n"; } + getNewLine: function () { return (ts.sys && ts.sys.newLine) || "\r\n"; } }; var program = ts.createProgram([inputFileName], options, compilerHost); if (diagnostics) { @@ -30014,7 +30720,7 @@ var ts; } else if (token === 35) { token = scanner.scan(); - if (token === 102) { + if (token === 111) { token = scanner.scan(); if (token === 65) { token = scanner.scan(); @@ -30181,7 +30887,8 @@ var ts; keywordCompletions.push({ name: ts.tokenToString(i), kind: ScriptElementKind.keyword, - kindModifiers: ScriptElementKindModifier.none + kindModifiers: ScriptElementKindModifier.none, + sortText: "0" }); } function getContainerNode(node) { @@ -30251,7 +30958,6 @@ var ts; var syntaxTreeCache = new SyntaxTreeCache(host); var ruleProvider; var program; - var typeInfoResolver; var useCaseSensitivefileNames = false; var cancellationToken = new CancellationTokenObject(host.getCancellationToken && host.getCancellationToken()); if (!ts.localizedDiagnosticMessages && host.getLocalizedDiagnosticMessages) { @@ -30309,7 +31015,7 @@ var ts; } } program = newProgram; - typeInfoResolver = program.getTypeChecker(); + program.getTypeChecker(); return; function getOrCreateSourceFile(fileName) { var hostFileInformation = hostCache.getOrCreateEntry(fileName); @@ -30349,9 +31055,6 @@ var ts; return program; } function cleanupSemanticCache() { - if (program) { - typeInfoResolver = program.getTypeChecker(); - } } function dispose() { if (program) { @@ -30367,6 +31070,9 @@ var ts; function getSemanticDiagnostics(fileName) { synchronizeHostData(); var targetSourceFile = getValidSourceFile(fileName); + if (ts.isJavaScript(fileName)) { + return getJavaScriptSemanticDiagnostics(targetSourceFile); + } var semanticDiagnostics = program.getSemanticDiagnostics(targetSourceFile); if (!program.getCompilerOptions().declaration) { return semanticDiagnostics; @@ -30374,26 +31080,176 @@ var ts; var declarationDiagnostics = program.getDeclarationDiagnostics(targetSourceFile); return ts.concatenate(semanticDiagnostics, declarationDiagnostics); } + function getJavaScriptSemanticDiagnostics(sourceFile) { + var diagnostics = []; + walk(sourceFile); + return diagnostics; + function walk(node) { + if (!node) { + return false; + } + switch (node.kind) { + case 208: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); + return true; + case 214: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); + return true; + case 201: + var classDeclaration = node; + if (checkModifiers(classDeclaration.modifiers) || + checkTypeParameters(classDeclaration.typeParameters)) { + return true; + } + break; + case 222: + var heritageClause = node; + if (heritageClause.token === 102) { + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); + return true; + } + break; + case 202: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 205: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 203: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); + return true; + case 134: + case 133: + case 135: + case 136: + case 137: + case 162: + case 200: + case 163: + case 200: + var functionDeclaration = node; + if (checkModifiers(functionDeclaration.modifiers) || + checkTypeParameters(functionDeclaration.typeParameters) || + checkTypeAnnotation(functionDeclaration.type)) { + return true; + } + break; + case 180: + var variableStatement = node; + if (checkModifiers(variableStatement.modifiers)) { + return true; + } + break; + case 198: + var variableDeclaration = node; + if (checkTypeAnnotation(variableDeclaration.type)) { + return true; + } + break; + case 157: + case 158: + var expression = node; + if (expression.typeArguments && expression.typeArguments.length > 0) { + var start = expression.typeArguments.pos; + diagnostics.push(ts.createFileDiagnostic(sourceFile, start, expression.typeArguments.end - start, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); + return true; + } + break; + case 129: + var parameter = node; + if (parameter.modifiers) { + var start = parameter.modifiers.pos; + diagnostics.push(ts.createFileDiagnostic(sourceFile, start, parameter.modifiers.end - start, ts.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)); + return true; + } + if (parameter.questionToken) { + diagnostics.push(ts.createDiagnosticForNode(parameter.questionToken, ts.Diagnostics.can_only_be_used_in_a_ts_file)); + return true; + } + if (parameter.type) { + diagnostics.push(ts.createDiagnosticForNode(parameter.type, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); + return true; + } + break; + case 132: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.property_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 204: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 160: + var typeAssertionExpression = node; + diagnostics.push(ts.createDiagnosticForNode(typeAssertionExpression.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); + return true; + case 130: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.decorators_can_only_be_used_in_a_ts_file)); + return true; + } + return ts.forEachChild(node, walk); + } + function checkTypeParameters(typeParameters) { + if (typeParameters) { + var start = typeParameters.pos; + diagnostics.push(ts.createFileDiagnostic(sourceFile, start, typeParameters.end - start, ts.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)); + return true; + } + return false; + } + function checkTypeAnnotation(type) { + if (type) { + diagnostics.push(ts.createDiagnosticForNode(type, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); + return true; + } + return false; + } + function checkModifiers(modifiers) { + if (modifiers) { + for (var _i = 0; _i < modifiers.length; _i++) { + var modifier = modifiers[_i]; + switch (modifier.kind) { + case 108: + case 106: + case 107: + case 115: + diagnostics.push(ts.createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind))); + return true; + case 109: + case 78: + case 70: + case 73: + } + } + } + return false; + } + } function getCompilerOptionsDiagnostics() { synchronizeHostData(); return program.getGlobalDiagnostics(); } - function getCompletionEntryDisplayName(symbol, target, performCharacterChecks) { + function getCompletionEntryDisplayNameForSymbol(symbol, target, performCharacterChecks) { var displayName = symbol.getName(); + if (displayName) { + if (displayName === "default") { + var localSymbol = ts.getLocalSymbolForExportDefault(symbol); + if (localSymbol && localSymbol.name) { + displayName = symbol.valueDeclaration.localSymbol.name; + } + } + var firstCharCode = displayName.charCodeAt(0); + if ((symbol.flags & 1536) && (firstCharCode === 39 || firstCharCode === 34)) { + return undefined; + } + } + return getCompletionEntryDisplayName(displayName, target, performCharacterChecks); + } + function getCompletionEntryDisplayName(displayName, target, performCharacterChecks) { if (!displayName) { return undefined; } - if (displayName === "default") { - var localSymbol = ts.getLocalSymbolForExportDefault(symbol); - if (localSymbol && localSymbol.name) { - displayName = symbol.valueDeclaration.localSymbol.name; - } - } 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) && + if (displayName.length >= 2 && + firstCharCode === displayName.charCodeAt(displayName.length - 1) && (firstCharCode === 39 || firstCharCode === 34)) { displayName = displayName.substring(1, displayName.length - 1); } @@ -30412,18 +31268,8 @@ var ts; } return ts.unescapeIdentifier(displayName); } - function createCompletionEntry(symbol, typeChecker, location) { - var displayName = getCompletionEntryDisplayName(symbol, program.getCompilerOptions().target, true); - if (!displayName) { - return undefined; - } - return { - name: displayName, - kind: getSymbolKind(symbol, typeChecker, location), - kindModifiers: getSymbolModifiers(symbol) - }; - } function getCompletionData(fileName, position) { + var typeChecker = program.getTypeChecker(); var syntacticStart = new Date().getTime(); var sourceFile = getValidSourceFile(fileName); var start = new Date().getTime(); @@ -30441,9 +31287,9 @@ var ts; 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(); + var start_2 = new Date().getTime(); contextToken = ts.findPrecedingToken(contextToken.getFullStart(), sourceFile); - log("getCompletionData: Get previous token 2: " + (new Date().getTime() - start_1)); + log("getCompletionData: Get previous token 2: " + (new Date().getTime() - start_2)); } if (contextToken && isCompletionListBlocker(contextToken)) { log("Returning an empty list because completion was requested in an invalid position."); @@ -30464,43 +31310,53 @@ var ts; var semanticStart = new Date().getTime(); var isMemberCompletion; var isNewIdentifierLocation; - var symbols; + var symbols = []; if (isRightOfDot) { - symbols = []; + getTypeScriptMemberSymbols(); + } + else { + if (!tryGetGlobalSymbols()) { + return undefined; + } + } + log("getCompletionData: Semantic work: " + (new Date().getTime() - semanticStart)); + return { symbols: symbols, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, location: location, isRightOfDot: isRightOfDot }; + function getTypeScriptMemberSymbols() { isMemberCompletion = true; isNewIdentifierLocation = false; if (node.kind === 65 || node.kind === 126 || node.kind === 155) { - var symbol = typeInfoResolver.getSymbolAtLocation(node); + var symbol = typeChecker.getSymbolAtLocation(node); if (symbol && symbol.flags & 8388608) { - symbol = typeInfoResolver.getAliasedSymbol(symbol); + symbol = typeChecker.getAliasedSymbol(symbol); } if (symbol && symbol.flags & 1952) { - ts.forEachValue(symbol.exports, function (symbol) { - if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) { + var exportedSymbols = typeChecker.getExportsOfModule(symbol); + ts.forEach(exportedSymbols, function (symbol) { + if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) { symbols.push(symbol); } }); } } - var type = typeInfoResolver.getTypeAtLocation(node); + var type = typeChecker.getTypeAtLocation(node); if (type) { ts.forEach(type.getApparentProperties(), function (symbol) { - if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) { + if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) { symbols.push(symbol); } }); } } - else { + function tryGetGlobalSymbols() { var containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion(contextToken); if (containingObjectLiteral) { isMemberCompletion = true; isNewIdentifierLocation = true; - var contextualType = typeInfoResolver.getContextualType(containingObjectLiteral); + var contextualType = typeChecker.getContextualType(containingObjectLiteral); if (!contextualType) { - return undefined; + return false; } - var contextualTypeMembers = typeInfoResolver.getPropertiesOfType(contextualType); + var contextualTypeMembers = typeChecker.getPropertiesOfType(contextualType); if (contextualTypeMembers && contextualTypeMembers.length > 0) { symbols = filterContextualMembersList(contextualTypeMembers, containingObjectLiteral.properties); } @@ -30511,8 +31367,14 @@ var ts; if (showCompletionsInImportsClause(contextToken)) { var importDeclaration = ts.getAncestor(contextToken, 209); ts.Debug.assert(importDeclaration !== undefined); - var exports_2 = typeInfoResolver.getExportsOfExternalModule(importDeclaration); - symbols = filterModuleExports(exports_2, importDeclaration); + var exports_2; + if (importDeclaration.moduleSpecifier) { + var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(importDeclaration.moduleSpecifier); + if (moduleSpecifierSymbol) { + exports_2 = typeChecker.getExportsOfModule(moduleSpecifierSymbol); + } + } + symbols = exports_2 ? filterModuleExports(exports_2, importDeclaration) : emptyArray; } } else { @@ -30526,11 +31388,10 @@ var ts; position; var scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile; var symbolMeanings = 793056 | 107455 | 1536 | 8388608; - symbols = typeInfoResolver.getSymbolsInScope(scopeNode, symbolMeanings); + symbols = typeChecker.getSymbolsInScope(scopeNode, symbolMeanings); } + return true; } - 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)) { @@ -30584,9 +31445,9 @@ var ts; return containingNodeKind === 171; case 12: return containingNodeKind === 176; - case 109: - case 107: case 108: + case 106: + case 107: return containingNodeKind === 132; } switch (previousToken.getText()) { @@ -30602,9 +31463,9 @@ var ts; if (previousToken.kind === 8 || previousToken.kind === 9 || ts.isTemplateLiteralKind(previousToken.kind)) { - var start_2 = previousToken.getStart(); + var start_3 = previousToken.getStart(); var end = previousToken.getEnd(); - if (start_2 < position && position < end) { + if (start_3 < position && position < end) { return true; } else if (position === end) { @@ -30673,6 +31534,7 @@ var ts; containingNodeKind === 150; case 22: return containingNodeKind === 131 && + previousToken.parent && previousToken.parent.parent && (previousToken.parent.parent.kind === 202 || previousToken.parent.parent.kind === 145); case 24: @@ -30680,27 +31542,28 @@ var ts; containingNodeKind === 200 || containingNodeKind === 202 || isFunction(containingNodeKind); - case 110: + case 109: return containingNodeKind === 132; case 21: return containingNodeKind === 129 || containingNodeKind === 135 || - (previousToken.parent.parent.kind === 151); - case 109: - case 107: + (previousToken.parent && previousToken.parent.parent && + previousToken.parent.parent.kind === 151); case 108: + case 106: + case 107: return containingNodeKind === 129; case 69: case 77: - case 104: + case 103: case 83: case 98: case 116: case 120: case 85: - case 105: + case 104: case 70: - case 111: + case 110: return true; } switch (previousToken.getText()) { @@ -30771,27 +31634,73 @@ var ts; 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 symbols = completionData.symbols, isMemberCompletion = completionData.isMemberCompletion, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, isRightOfDot = completionData.isRightOfDot; + var entries; + if (isRightOfDot && ts.isJavaScript(fileName)) { + entries = getCompletionEntriesFromSymbols(symbols); + ts.addRange(entries, getJavaScriptCompletionEntries()); + } + else { + if (!symbols || symbols.length === 0) { + return undefined; + } + entries = getCompletionEntriesFromSymbols(symbols); } - var entries = getCompletionEntriesFromSymbols(symbols); if (!isMemberCompletion) { ts.addRange(entries, keywordCompletions); } return { isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; + function getJavaScriptCompletionEntries() { + var entries = []; + var allNames = {}; + var target = program.getCompilerOptions().target; + for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { + var sourceFile = _a[_i]; + var nameTable = getNameTable(sourceFile); + for (var name_24 in nameTable) { + if (!allNames[name_24]) { + allNames[name_24] = name_24; + var displayName = getCompletionEntryDisplayName(name_24, target, true); + if (displayName) { + var entry = { + name: displayName, + kind: ScriptElementKind.warning, + kindModifiers: "", + sortText: "1" + }; + entries.push(entry); + } + } + } + } + return entries; + } + function createCompletionEntry(symbol, location) { + var displayName = getCompletionEntryDisplayNameForSymbol(symbol, program.getCompilerOptions().target, true); + if (!displayName) { + return undefined; + } + return { + name: displayName, + kind: getSymbolKind(symbol, location), + kindModifiers: getSymbolModifiers(symbol), + sortText: "0" + }; + } 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; + if (symbols) { + var nameToSymbol = {}; + for (var _i = 0; _i < symbols.length; _i++) { + var symbol = symbols[_i]; + var entry = createCompletionEntry(symbol, location); + if (entry) { + var id = ts.escapeIdentifier(entry.name); + if (!ts.lookUp(nameToSymbol, id)) { + entries.push(entry); + nameToSymbol[id] = symbol; + } } } } @@ -30805,9 +31714,9 @@ var ts; 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; }); + var symbol = ts.forEach(symbols, function (s) { return getCompletionEntryDisplayNameForSymbol(s, target, false) === entryName ? s : undefined; }); if (symbol) { - var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location_2, typeInfoResolver, location_2, 7); + var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location_2, location_2, 7); return { name: entryName, kind: displayPartsDocumentationsAndSymbolKind.symbolKind, @@ -30829,7 +31738,7 @@ var ts; } return undefined; } - function getSymbolKind(symbol, typeResolver, location) { + function getSymbolKind(symbol, location) { var flags = symbol.getFlags(); if (flags & 32) return ScriptElementKind.classElement; @@ -30841,7 +31750,7 @@ var ts; return ScriptElementKind.interfaceElement; if (flags & 262144) return ScriptElementKind.typeParameterElement; - var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver, location); + var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, location); if (result === ScriptElementKind.unknown) { if (flags & 262144) return ScriptElementKind.typeParameterElement; @@ -30854,11 +31763,12 @@ var ts; } return result; } - function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver, location) { - if (typeResolver.isUndefinedSymbol(symbol)) { + function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, location) { + var typeChecker = program.getTypeChecker(); + if (typeChecker.isUndefinedSymbol(symbol)) { return ScriptElementKind.variableElement; } - if (typeResolver.isArgumentsSymbol(symbol)) { + if (typeChecker.isArgumentsSymbol(symbol)) { return ScriptElementKind.localVariableElement; } if (flags & 3) { @@ -30885,7 +31795,7 @@ var ts; return ScriptElementKind.constructorImplementationElement; if (flags & 4) { if (flags & 268435456) { - var unionPropertyKind = ts.forEach(typeInfoResolver.getRootSymbols(symbol), function (rootSymbol) { + var unionPropertyKind = ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) { var rootSymbolFlags = rootSymbol.getFlags(); if (rootSymbolFlags & (98308 | 3)) { return ScriptElementKind.memberVariableElement; @@ -30893,7 +31803,7 @@ var ts; ts.Debug.assert(!!(rootSymbolFlags & 8192)); }); if (!unionPropertyKind) { - var typeOfUnionProperty = typeInfoResolver.getTypeOfSymbolAtLocation(symbol, location); + var typeOfUnionProperty = typeChecker.getTypeOfSymbolAtLocation(symbol, location); if (typeOfUnionProperty.getCallSignatures().length) { return ScriptElementKind.memberFunctionElement; } @@ -30926,12 +31836,13 @@ var ts; ? ts.getNodeModifiers(symbol.declarations[0]) : ScriptElementKindModifier.none; } - function getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, enclosingDeclaration, typeResolver, location, semanticMeaning) { + function getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, enclosingDeclaration, location, semanticMeaning) { if (semanticMeaning === void 0) { semanticMeaning = getMeaningFromLocation(location); } + var typeChecker = program.getTypeChecker(); var displayParts = []; var documentation; var symbolFlags = symbol.flags; - var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, typeResolver, location); + var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, location); var hasAddedSymbolInfo; var type; if (symbolKind !== ScriptElementKind.unknown || symbolFlags & 32 || symbolFlags & 8388608) { @@ -30939,7 +31850,7 @@ var ts; symbolKind = ScriptElementKind.memberVariableElement; } var signature; - type = typeResolver.getTypeOfSymbolAtLocation(symbol, location); + type = typeChecker.getTypeOfSymbolAtLocation(symbol, location); if (type) { if (location.parent && location.parent.kind === 155) { var right = location.parent.name; @@ -30956,7 +31867,7 @@ var ts; } if (callExpression) { var candidateSignatures = []; - signature = typeResolver.getResolvedSignature(callExpression, candidateSignatures); + signature = typeChecker.getResolvedSignature(callExpression, candidateSignatures); if (!signature && candidateSignatures.length) { signature = candidateSignatures[0]; } @@ -30997,7 +31908,7 @@ var ts; displayParts.push(ts.spacePart()); } if (!(type.flags & 32768)) { - displayParts.push.apply(displayParts, ts.symbolToDisplayParts(typeResolver, type.symbol, enclosingDeclaration, undefined, 1)); + displayParts.push.apply(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, undefined, 1)); } addSignatureDisplayParts(signature, allSignatures, 8); break; @@ -31011,8 +31922,8 @@ var ts; (location.kind === 114 && location.parent.kind === 135)) { var functionDeclaration = location.parent; var allSignatures = functionDeclaration.kind === 135 ? type.getConstructSignatures() : type.getCallSignatures(); - if (!typeResolver.isImplementationOfOverload(functionDeclaration)) { - signature = typeResolver.getSignatureFromDeclaration(functionDeclaration); + if (!typeChecker.isImplementationOfOverload(functionDeclaration)) { + signature = typeChecker.getSignatureFromDeclaration(functionDeclaration); } else { signature = allSignatures[0]; @@ -31038,7 +31949,7 @@ var ts; } if ((symbolFlags & 64) && (semanticMeaning & 2)) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(104)); + displayParts.push(ts.keywordPart(103)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); @@ -31051,7 +31962,7 @@ var ts; displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(53)); displayParts.push(ts.spacePart()); - displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeResolver, typeResolver.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration)); + displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration)); } if (symbolFlags & 384) { addNewLineIfDisplayPartsExist(); @@ -31085,7 +31996,7 @@ var ts; } else { var signatureDeclaration = ts.getDeclarationOfKind(symbol, 128).parent; - var signature = typeResolver.getSignatureFromDeclaration(signatureDeclaration); + var signature = typeChecker.getSignatureFromDeclaration(signatureDeclaration); if (signatureDeclaration.kind === 139) { displayParts.push(ts.keywordPart(88)); displayParts.push(ts.spacePart()); @@ -31093,14 +32004,14 @@ var ts; 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(typeChecker, signature, sourceFile, 32)); } } if (symbolFlags & 8) { addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; if (declaration.kind === 226) { - var constantValue = typeResolver.getConstantValue(declaration); + var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(53)); @@ -31127,7 +32038,7 @@ var ts; displayParts.push(ts.punctuationPart(17)); } else { - var internalAliasSymbol = typeResolver.getSymbolAtLocation(importEqualsDeclaration.moduleReference); + var internalAliasSymbol = typeChecker.getSymbolAtLocation(importEqualsDeclaration.moduleReference); if (internalAliasSymbol) { displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(53)); @@ -31150,12 +32061,12 @@ var ts; displayParts.push(ts.spacePart()); if (type.symbol && type.symbol.flags & 262144) { var typeParameterParts = ts.mapToDisplayParts(function (writer) { - typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration); + typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration); }); displayParts.push.apply(displayParts, typeParameterParts); } else { - displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeResolver, type, enclosingDeclaration)); + displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeChecker, type, enclosingDeclaration)); } } else if (symbolFlags & 16 || @@ -31170,7 +32081,7 @@ var ts; } } else { - symbolKind = getSymbolKind(symbol, typeResolver, location); + symbolKind = getSymbolKind(symbol, location); } } if (!documentation) { @@ -31183,7 +32094,7 @@ var ts; } } function addFullSymbolName(symbol, enclosingDeclaration) { - var fullSymbolDisplayParts = ts.symbolToDisplayParts(typeResolver, symbol, enclosingDeclaration || sourceFile, undefined, 1 | 2); + var fullSymbolDisplayParts = ts.symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration || sourceFile, undefined, 1 | 2); displayParts.push.apply(displayParts, fullSymbolDisplayParts); } function addPrefixForAnyFunctionOrVar(symbol, symbolKind) { @@ -31211,7 +32122,7 @@ var ts; } } function addSignatureDisplayParts(signature, allSignatures, flags) { - displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeResolver, signature, enclosingDeclaration, flags | 32)); + displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | 32)); if (allSignatures.length > 1) { displayParts.push(ts.spacePart()); displayParts.push(ts.punctuationPart(16)); @@ -31225,7 +32136,7 @@ var ts; } function writeTypeParametersOfSymbol(symbol, enclosingDeclaration) { var typeParameterParts = ts.mapToDisplayParts(function (writer) { - typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration); + typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration); }); displayParts.push.apply(displayParts, typeParameterParts); } @@ -31237,7 +32148,11 @@ var ts; if (!node) { return undefined; } - var symbol = typeInfoResolver.getSymbolAtLocation(node); + if (isLabelName(node)) { + return undefined; + } + var typeChecker = program.getTypeChecker(); + var symbol = typeChecker.getSymbolAtLocation(node); if (!symbol) { switch (node.kind) { case 65: @@ -31245,20 +32160,20 @@ var ts; case 126: case 93: case 91: - var type = typeInfoResolver.getTypeAtLocation(node); + var type = typeChecker.getTypeAtLocation(node); if (type) { return { kind: ScriptElementKind.unknown, kindModifiers: ScriptElementKindModifier.none, textSpan: ts.createTextSpan(node.getStart(), node.getWidth()), - displayParts: ts.typeToDisplayParts(typeInfoResolver, type, getContainerNode(node)), + displayParts: ts.typeToDisplayParts(typeChecker, type, getContainerNode(node)), documentation: type.symbol ? type.symbol.getDocumentationComment() : undefined }; } } return undefined; } - var displayPartsDocumentationsAndKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, getContainerNode(node), typeInfoResolver, node); + var displayPartsDocumentationsAndKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, getContainerNode(node), node); return { kind: displayPartsDocumentationsAndKind.symbolKind, kindModifiers: getSymbolModifiers(symbol), @@ -31304,33 +32219,34 @@ var ts; } return undefined; } - var symbol = typeInfoResolver.getSymbolAtLocation(node); + var typeChecker = program.getTypeChecker(); + var symbol = typeChecker.getSymbolAtLocation(node); if (!symbol) { return undefined; } if (symbol.flags & 8388608) { var declaration = symbol.declarations[0]; if (node.kind === 65 && node.parent === declaration) { - symbol = typeInfoResolver.getAliasedSymbol(symbol); + symbol = typeChecker.getAliasedSymbol(symbol); } } if (node.parent.kind === 225) { - var shorthandSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); + var shorthandSymbol = typeChecker.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); + var shorthandSymbolKind = getSymbolKind(shorthandSymbol, node); + var shorthandSymbolName = typeChecker.symbolToString(shorthandSymbol); + var shorthandContainerName = typeChecker.symbolToString(symbol.parent, node); return ts.map(shorthandDeclarations, function (declaration) { return createDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName); }); } var result = []; var declarations = symbol.getDeclarations(); - var symbolName = typeInfoResolver.symbolToString(symbol); - var symbolKind = getSymbolKind(symbol, typeInfoResolver, node); + var symbolName = typeChecker.symbolToString(symbol); + var symbolKind = getSymbolKind(symbol, node); var containerSymbol = symbol.parent; - var containerName = containerSymbol ? typeInfoResolver.symbolToString(containerSymbol, node) : ""; + var containerName = containerSymbol ? typeChecker.symbolToString(containerSymbol, node) : ""; if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { ts.forEach(declarations, function (declaration) { @@ -31380,430 +32296,505 @@ var ts; 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 + "."); - }); + results = ts.filter(results, function (r) { return getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile; }); } return results; } - function getOccurrencesAtPositionCore(fileName, position) { + function getDocumentHighlights(fileName, position, filesToSearch) { synchronizeHostData(); + filesToSearch = ts.map(filesToSearch, ts.normalizeSlashes); + var sourceFilesToSearch = ts.filter(program.getSourceFiles(), function (f) { return ts.contains(filesToSearch, f.fileName); }); var sourceFile = getValidSourceFile(fileName); var node = ts.getTouchingWord(sourceFile, position); if (!node) { return undefined; } - if (node.kind === 65 || node.kind === 93 || node.kind === 91 || - isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { - return convertReferences(getReferencesForNode(node, [sourceFile], true, false, false)); + return getSemanticDocumentHighlights(node) || getSyntacticDocumentHighlights(node); + function getHighlightSpanForNode(node) { + var start = node.getStart(); + var end = node.getEnd(); + return { + fileName: sourceFile.fileName, + textSpan: ts.createTextSpanFromBounds(start, end), + kind: HighlightSpanKind.none + }; } - switch (node.kind) { - case 84: - case 76: - if (hasKind(node.parent, 183)) { - return getIfElseOccurrences(node.parent); - } - break; - case 90: - if (hasKind(node.parent, 191)) { - return getReturnOccurrences(node.parent); - } - break; - case 94: - if (hasKind(node.parent, 195)) { - return getThrowOccurrences(node.parent); - } - break; - case 68: - if (hasKind(parent(parent(node)), 196)) { - return getTryCatchFinallyOccurrences(node.parent.parent); - } - break; - case 96: - case 81: - if (hasKind(parent(node), 196)) { - return getTryCatchFinallyOccurrences(node.parent); - } - break; - case 92: - if (hasKind(node.parent, 193)) { - return getSwitchCaseDefaultOccurrences(node.parent); - } - break; - case 67: - case 73: - if (hasKind(parent(parent(parent(node))), 193)) { - return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); - } - break; - case 66: - case 71: - if (hasKind(node.parent, 190) || hasKind(node.parent, 189)) { - return getBreakOrContinueStatementOccurences(node.parent); - } - break; - case 82: - if (hasKind(node.parent, 186) || - hasKind(node.parent, 187) || - hasKind(node.parent, 188)) { - return getLoopBreakContinueOccurrences(node.parent); - } - break; - case 100: - case 75: - if (hasKind(node.parent, 185) || hasKind(node.parent, 184)) { - return getLoopBreakContinueOccurrences(node.parent); - } - break; - case 114: - if (hasKind(node.parent, 135)) { - return getConstructorOccurrences(node.parent); - } - break; - 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 === 180)) { - return getModifierOccurrences(node.kind, node.parent); - } - } - return undefined; - function getIfElseOccurrences(ifStatement) { - var keywords = []; - while (hasKind(ifStatement.parent, 183) && ifStatement.parent.elseStatement === ifStatement) { - ifStatement = ifStatement.parent; + function getSemanticDocumentHighlights(node) { + if (node.kind === 65 || + node.kind === 93 || + node.kind === 91 || + isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || + isNameOfExternalModuleImportOrDeclaration(node)) { + var referencedSymbols = getReferencedSymbolsForNodes(node, sourceFilesToSearch, false, false); + return convertReferencedSymbols(referencedSymbols); } - while (ifStatement) { - var children = ifStatement.getChildren(); - pushKeywordIf(keywords, children[0], 84); - for (var i = children.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, children[i], 76)) { - break; + return undefined; + function convertReferencedSymbols(referencedSymbols) { + if (!referencedSymbols) { + return undefined; + } + var fileNameToDocumentHighlights = {}; + var result = []; + for (var _i = 0; _i < referencedSymbols.length; _i++) { + var referencedSymbol = referencedSymbols[_i]; + for (var _a = 0, _b = referencedSymbol.references; _a < _b.length; _a++) { + var referenceEntry = _b[_a]; + var fileName_1 = referenceEntry.fileName; + var documentHighlights = ts.getProperty(fileNameToDocumentHighlights, fileName_1); + if (!documentHighlights) { + documentHighlights = { fileName: fileName_1, highlightSpans: [] }; + fileNameToDocumentHighlights[fileName_1] = documentHighlights; + result.push(documentHighlights); + } + documentHighlights.highlightSpans.push({ + textSpan: referenceEntry.textSpan, + kind: referenceEntry.isWriteAccess ? HighlightSpanKind.writtenReference : HighlightSpanKind.reference + }); } } - if (!hasKind(ifStatement.elseStatement, 183)) { - break; - } - ifStatement = ifStatement.elseStatement; + return result; } - var result = []; - 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))) { - shouldHighlightNextKeyword = false; + } + function getSyntacticDocumentHighlights(node) { + var fileName = sourceFile.fileName; + var highlightSpans = getHighlightSpans(node); + if (!highlightSpans || highlightSpans.length === 0) { + return undefined; + } + return [{ fileName: fileName, highlightSpans: highlightSpans }]; + function hasKind(node, kind) { + return node !== undefined && node.kind === kind; + } + function parent(node) { + return node && node.parent; + } + function getHighlightSpans(node) { + if (node) { + switch (node.kind) { + case 84: + case 76: + if (hasKind(node.parent, 183)) { + return getIfElseOccurrences(node.parent); + } break; + case 90: + if (hasKind(node.parent, 191)) { + return getReturnOccurrences(node.parent); + } + break; + case 94: + if (hasKind(node.parent, 195)) { + return getThrowOccurrences(node.parent); + } + break; + case 68: + if (hasKind(parent(parent(node)), 196)) { + return getTryCatchFinallyOccurrences(node.parent.parent); + } + break; + case 96: + case 81: + if (hasKind(parent(node), 196)) { + return getTryCatchFinallyOccurrences(node.parent); + } + break; + case 92: + if (hasKind(node.parent, 193)) { + return getSwitchCaseDefaultOccurrences(node.parent); + } + break; + case 67: + case 73: + if (hasKind(parent(parent(parent(node))), 193)) { + return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); + } + break; + case 66: + case 71: + if (hasKind(node.parent, 190) || hasKind(node.parent, 189)) { + return getBreakOrContinueStatementOccurences(node.parent); + } + break; + case 82: + if (hasKind(node.parent, 186) || + hasKind(node.parent, 187) || + hasKind(node.parent, 188)) { + return getLoopBreakContinueOccurrences(node.parent); + } + break; + case 100: + case 75: + if (hasKind(node.parent, 185) || hasKind(node.parent, 184)) { + return getLoopBreakContinueOccurrences(node.parent); + } + break; + case 114: + if (hasKind(node.parent, 135)) { + return getConstructorOccurrences(node.parent); + } + break; + 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 === 180)) { + return getModifierOccurrences(node.kind, node.parent); + } + } + } + return undefined; + } + function aggregateOwnedThrowStatements(node) { + var statementAccumulator = []; + aggregate(node); + return statementAccumulator; + function aggregate(node) { + if (node.kind === 195) { + statementAccumulator.push(node); + } + else if (node.kind === 196) { + var tryStatement = node; + if (tryStatement.catchClause) { + aggregate(tryStatement.catchClause); + } + else { + aggregate(tryStatement.tryBlock); + } + if (tryStatement.finallyBlock) { + aggregate(tryStatement.finallyBlock); } } - if (shouldHighlightNextKeyword) { - result.push({ - fileName: fileName, - textSpan: ts.createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), - isWriteAccess: false - }); - i++; - continue; + else if (!ts.isFunctionLike(node)) { + ts.forEachChild(node, aggregate); } } - result.push(getReferenceEntryFromNode(keywords[i])); + ; } - return result; - } - function getReturnOccurrences(returnStatement) { - var func = ts.getContainingFunction(returnStatement); - if (!(func && hasKind(func.body, 179))) { + function getThrowStatementOwner(throwStatement) { + var child = throwStatement; + while (child.parent) { + var parent_9 = child.parent; + if (ts.isFunctionBlock(parent_9) || parent_9.kind === 227) { + return parent_9; + } + if (parent_9.kind === 196) { + var tryStatement = parent_9; + if (tryStatement.tryBlock === child && tryStatement.catchClause) { + return child; + } + } + child = parent_9; + } return undefined; } - var keywords = []; - ts.forEachReturnStatement(func.body, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 90); - }); - ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 94); - }); - return ts.map(keywords, getReferenceEntryFromNode); - } - function getThrowOccurrences(throwStatement) { - var owner = getThrowStatementOwner(throwStatement); - if (!owner) { + function aggregateAllBreakAndContinueStatements(node) { + var statementAccumulator = []; + aggregate(node); + return statementAccumulator; + function aggregate(node) { + if (node.kind === 190 || node.kind === 189) { + statementAccumulator.push(node); + } + else if (!ts.isFunctionLike(node)) { + ts.forEachChild(node, aggregate); + } + } + ; + } + function ownsBreakOrContinueStatement(owner, statement) { + var actualOwner = getBreakOrContinueOwner(statement); + return actualOwner && actualOwner === owner; + } + function getBreakOrContinueOwner(statement) { + for (var node_1 = statement.parent; node_1; node_1 = node_1.parent) { + switch (node_1.kind) { + case 193: + if (statement.kind === 189) { + continue; + } + 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_1)) { + return undefined; + } + break; + } + } return undefined; } - var keywords = []; - ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 94); - }); - if (ts.isFunctionBlock(owner)) { - ts.forEachReturnStatement(owner, function (returnStatement) { + function getModifierOccurrences(modifier, declaration) { + var container = declaration.parent; + if (ts.isAccessibilityModifier(modifier)) { + if (!(container.kind === 201 || + (declaration.kind === 129 && hasKind(container, 135)))) { + return undefined; + } + } + else if (modifier === 109) { + if (container.kind !== 201) { + return undefined; + } + } + else if (modifier === 78 || modifier === 115) { + if (!(container.kind === 206 || container.kind === 227)) { + return undefined; + } + } + else { + return undefined; + } + var keywords = []; + var modifierFlag = getFlagFromModifier(modifier); + var nodes; + switch (container.kind) { + case 206: + case 227: + nodes = container.statements; + break; + case 135: + nodes = container.parameters.concat(container.parent.members); + break; + case 201: + nodes = container.members; + if (modifierFlag & 112) { + var constructor = ts.forEach(container.members, function (member) { + return member.kind === 135 && member; + }); + if (constructor) { + nodes = nodes.concat(constructor.parameters); + } + } + break; + default: + ts.Debug.fail("Invalid container kind."); + } + ts.forEach(nodes, function (node) { + if (node.modifiers && node.flags & modifierFlag) { + ts.forEach(node.modifiers, function (child) { return pushKeywordIf(keywords, child, modifier); }); + } + }); + return ts.map(keywords, getHighlightSpanForNode); + function getFlagFromModifier(modifier) { + switch (modifier) { + case 108: + return 16; + case 106: + return 32; + case 107: + return 64; + case 109: + return 128; + case 78: + return 1; + case 115: + return 2; + default: + ts.Debug.fail(); + } + } + } + function pushKeywordIf(keywordList, token) { + var expected = []; + for (var _i = 2; _i < arguments.length; _i++) { + expected[_i - 2] = arguments[_i]; + } + if (token && ts.contains(expected, token.kind)) { + keywordList.push(token); + return true; + } + return false; + } + function getGetAndSetOccurrences(accessorDeclaration) { + var keywords = []; + tryPushAccessorKeyword(accessorDeclaration.symbol, 136); + tryPushAccessorKeyword(accessorDeclaration.symbol, 137); + return ts.map(keywords, getHighlightSpanForNode); + function tryPushAccessorKeyword(accessorSymbol, accessorKind) { + var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); + if (accessor) { + ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 116, 120); }); + } + } + } + function getConstructorOccurrences(constructorDeclaration) { + var declarations = constructorDeclaration.symbol.getDeclarations(); + var keywords = []; + ts.forEach(declarations, function (declaration) { + ts.forEach(declaration.getChildren(), function (token) { + return pushKeywordIf(keywords, token, 114); + }); + }); + return ts.map(keywords, getHighlightSpanForNode); + } + function getLoopBreakContinueOccurrences(loopNode) { + var keywords = []; + 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], 100)) { + break; + } + } + } + } + var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); + ts.forEach(breaksAndContinues, function (statement) { + if (ownsBreakOrContinueStatement(loopNode, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), 66, 71); + } + }); + return ts.map(keywords, getHighlightSpanForNode); + } + function getBreakOrContinueStatementOccurences(breakOrContinueStatement) { + var owner = getBreakOrContinueOwner(breakOrContinueStatement); + if (owner) { + switch (owner.kind) { + case 186: + case 187: + case 188: + case 184: + case 185: + return getLoopBreakContinueOccurrences(owner); + case 193: + return getSwitchCaseDefaultOccurrences(owner); + } + } + return undefined; + } + function getSwitchCaseDefaultOccurrences(switchStatement) { + var keywords = []; + pushKeywordIf(keywords, switchStatement.getFirstToken(), 92); + ts.forEach(switchStatement.caseBlock.clauses, function (clause) { + pushKeywordIf(keywords, clause.getFirstToken(), 67, 73); + var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); + ts.forEach(breaksAndContinues, function (statement) { + if (ownsBreakOrContinueStatement(switchStatement, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), 66); + } + }); + }); + return ts.map(keywords, getHighlightSpanForNode); + } + function getTryCatchFinallyOccurrences(tryStatement) { + var keywords = []; + pushKeywordIf(keywords, tryStatement.getFirstToken(), 96); + if (tryStatement.catchClause) { + pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 68); + } + if (tryStatement.finallyBlock) { + var finallyKeyword = ts.findChildOfKind(tryStatement, 81, sourceFile); + pushKeywordIf(keywords, finallyKeyword, 81); + } + return ts.map(keywords, getHighlightSpanForNode); + } + function getThrowOccurrences(throwStatement) { + var owner = getThrowStatementOwner(throwStatement); + if (!owner) { + return undefined; + } + var keywords = []; + ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { + pushKeywordIf(keywords, throwStatement.getFirstToken(), 94); + }); + if (ts.isFunctionBlock(owner)) { + ts.forEachReturnStatement(owner, function (returnStatement) { + pushKeywordIf(keywords, returnStatement.getFirstToken(), 90); + }); + } + return ts.map(keywords, getHighlightSpanForNode); + } + function getReturnOccurrences(returnStatement) { + var func = ts.getContainingFunction(returnStatement); + if (!(func && hasKind(func.body, 179))) { + return undefined; + } + var keywords = []; + ts.forEachReturnStatement(func.body, function (returnStatement) { pushKeywordIf(keywords, returnStatement.getFirstToken(), 90); }); + ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { + pushKeywordIf(keywords, throwStatement.getFirstToken(), 94); + }); + return ts.map(keywords, getHighlightSpanForNode); } - return ts.map(keywords, getReferenceEntryFromNode); - } - function aggregateOwnedThrowStatements(node) { - var statementAccumulator = []; - aggregate(node); - return statementAccumulator; - function aggregate(node) { - if (node.kind === 195) { - statementAccumulator.push(node); + function getIfElseOccurrences(ifStatement) { + var keywords = []; + while (hasKind(ifStatement.parent, 183) && ifStatement.parent.elseStatement === ifStatement) { + ifStatement = ifStatement.parent; } - else if (node.kind === 196) { - var tryStatement = node; - if (tryStatement.catchClause) { - aggregate(tryStatement.catchClause); - } - else { - aggregate(tryStatement.tryBlock); - } - if (tryStatement.finallyBlock) { - aggregate(tryStatement.finallyBlock); - } - } - else if (!ts.isFunctionLike(node)) { - ts.forEachChild(node, aggregate); - } - } - ; - } - function getThrowStatementOwner(throwStatement) { - var child = throwStatement; - while (child.parent) { - var parent_9 = child.parent; - if (ts.isFunctionBlock(parent_9) || parent_9.kind === 227) { - return parent_9; - } - if (parent_9.kind === 196) { - var tryStatement = parent_9; - if (tryStatement.tryBlock === child && tryStatement.catchClause) { - return child; - } - } - child = parent_9; - } - return undefined; - } - function getTryCatchFinallyOccurrences(tryStatement) { - var keywords = []; - pushKeywordIf(keywords, tryStatement.getFirstToken(), 96); - if (tryStatement.catchClause) { - pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 68); - } - if (tryStatement.finallyBlock) { - 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(), 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], 100)) { + while (ifStatement) { + var children = ifStatement.getChildren(); + pushKeywordIf(keywords, children[0], 84); + for (var i = children.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, children[i], 76)) { break; } } - } - } - var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); - ts.forEach(breaksAndContinues, function (statement) { - if (ownsBreakOrContinueStatement(loopNode, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 66, 71); - } - }); - return ts.map(keywords, getReferenceEntryFromNode); - } - function getSwitchCaseDefaultOccurrences(switchStatement) { - var keywords = []; - pushKeywordIf(keywords, switchStatement.getFirstToken(), 92); - ts.forEach(switchStatement.caseBlock.clauses, function (clause) { - pushKeywordIf(keywords, clause.getFirstToken(), 67, 73); - var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); - ts.forEach(breaksAndContinues, function (statement) { - if (ownsBreakOrContinueStatement(switchStatement, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 66); + if (!hasKind(ifStatement.elseStatement, 183)) { + break; } - }); - }); - return ts.map(keywords, getReferenceEntryFromNode); - } - function getBreakOrContinueStatementOccurences(breakOrContinueStatement) { - var owner = getBreakOrContinueOwner(breakOrContinueStatement); - if (owner) { - switch (owner.kind) { - case 186: - case 187: - case 188: - case 184: - case 185: - return getLoopBreakContinueOccurrences(owner); - case 193: - return getSwitchCaseDefaultOccurrences(owner); + ifStatement = ifStatement.elseStatement; } - } - return undefined; - } - function aggregateAllBreakAndContinueStatements(node) { - var statementAccumulator = []; - aggregate(node); - return statementAccumulator; - function aggregate(node) { - if (node.kind === 190 || node.kind === 189) { - statementAccumulator.push(node); - } - else if (!ts.isFunctionLike(node)) { - ts.forEachChild(node, aggregate); - } - } - ; - } - function ownsBreakOrContinueStatement(owner, statement) { - var actualOwner = getBreakOrContinueOwner(statement); - return actualOwner && actualOwner === owner; - } - function getBreakOrContinueOwner(statement) { - for (var node_1 = statement.parent; node_1; node_1 = node_1.parent) { - switch (node_1.kind) { - case 193: - if (statement.kind === 189) { + var result = []; + 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 shouldCombindElseAndIf = true; + for (var j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { + if (!ts.isWhiteSpace(sourceFile.text.charCodeAt(j))) { + shouldCombindElseAndIf = false; + break; + } + } + if (shouldCombindElseAndIf) { + result.push({ + fileName: fileName, + textSpan: ts.createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), + kind: HighlightSpanKind.reference + }); + i++; continue; } - 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_1)) { - return undefined; - } - break; - } - } - return undefined; - } - function getConstructorOccurrences(constructorDeclaration) { - var declarations = constructorDeclaration.symbol.getDeclarations(); - var keywords = []; - ts.forEach(declarations, function (declaration) { - ts.forEach(declaration.getChildren(), function (token) { - return pushKeywordIf(keywords, token, 114); - }); - }); - return ts.map(keywords, getReferenceEntryFromNode); - } - function getGetAndSetOccurrences(accessorDeclaration) { - var keywords = []; - 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, 116, 120); }); + } + result.push(getHighlightSpanForNode(keywords[i])); } + return result; } } - function getModifierOccurrences(modifier, declaration) { - var container = declaration.parent; - if (ts.isAccessibilityModifier(modifier)) { - if (!(container.kind === 201 || - (declaration.kind === 129 && hasKind(container, 135)))) { - return undefined; - } - } - else if (modifier === 110) { - if (container.kind !== 201) { - return undefined; - } - } - else if (modifier === 78 || modifier === 115) { - if (!(container.kind === 206 || container.kind === 227)) { - return undefined; - } - } - else { + } + function getOccurrencesAtPositionCore(fileName, position) { + synchronizeHostData(); + return convertDocumentHighlights(getDocumentHighlights(fileName, position, [fileName])); + function convertDocumentHighlights(documentHighlights) { + if (!documentHighlights) { return undefined; } - var keywords = []; - var modifierFlag = getFlagFromModifier(modifier); - var nodes; - switch (container.kind) { - case 206: - case 227: - nodes = container.statements; - break; - case 135: - nodes = container.parameters.concat(container.parent.members); - break; - case 201: - nodes = container.members; - if (modifierFlag & 112) { - var constructor = ts.forEach(container.members, function (member) { - return member.kind === 135 && member; - }); - if (constructor) { - nodes = nodes.concat(constructor.parameters); - } - } - break; - default: - ts.Debug.fail("Invalid container kind."); - } - ts.forEach(nodes, function (node) { - if (node.modifiers && node.flags & modifierFlag) { - ts.forEach(node.modifiers, function (child) { return pushKeywordIf(keywords, child, modifier); }); - } - }); - return ts.map(keywords, getReferenceEntryFromNode); - function getFlagFromModifier(modifier) { - switch (modifier) { - case 109: - return 16; - case 107: - return 32; - case 108: - return 64; - case 110: - return 128; - case 78: - return 1; - case 115: - return 2; - default: - ts.Debug.fail(); + var result = []; + for (var _i = 0; _i < documentHighlights.length; _i++) { + var entry = documentHighlights[_i]; + for (var _a = 0, _b = entry.highlightSpans; _a < _b.length; _a++) { + var highlightSpan = _b[_a]; + result.push({ + fileName: entry.fileName, + textSpan: highlightSpan.textSpan, + isWriteAccess: highlightSpan.kind === HighlightSpanKind.writtenReference + }); } } - } - function hasKind(node, kind) { - return node !== undefined && node.kind === kind; - } - function parent(node) { - return node && node.parent; - } - function pushKeywordIf(keywordList, token) { - var expected = []; - for (var _i = 2; _i < arguments.length; _i++) { - expected[_i - 2] = arguments[_i]; - } - if (token && ts.contains(expected, token.kind)) { - keywordList.push(token); - return true; - } - return false; + return result; } } function convertReferences(referenceSymbols) { @@ -31842,9 +32833,10 @@ var ts; return undefined; } ts.Debug.assert(node.kind === 65 || node.kind === 7 || node.kind === 8); - return getReferencesForNode(node, program.getSourceFiles(), false, findInStrings, findInComments); + return getReferencedSymbolsForNodes(node, program.getSourceFiles(), findInStrings, findInComments); } - function getReferencesForNode(node, sourceFiles, searchOnlyInCurrentFile, findInStrings, findInComments) { + function getReferencedSymbolsForNodes(node, sourceFiles, findInStrings, findInComments) { + var typeChecker = program.getTypeChecker(); if (isLabelName(node)) { if (isJumpStatementTarget(node)) { var labelDefinition = getTargetLabel(node.parent, node.text); @@ -31860,7 +32852,7 @@ var ts; if (node.kind === 91) { return getReferencesForSuperKeyword(node); } - var symbol = typeInfoResolver.getSymbolAtLocation(node); + var symbol = typeChecker.getSymbolAtLocation(node); if (!symbol) { return undefined; } @@ -31878,26 +32870,20 @@ var ts; 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, symbolToIndex); - } - else { - var internedName = getInternedName(symbol, node, declarations); - ts.forEach(sourceFiles, function (sourceFile) { - cancellationToken.throwIfCancellationRequested(); - var nameTable = getNameTable(sourceFile); - if (ts.lookUp(nameTable, internedName)) { - result = result || []; - getReferencesInNode(sourceFile, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); - } - }); + var internedName = getInternedName(symbol, node, declarations); + for (var _i = 0; _i < sourceFiles.length; _i++) { + var sourceFile = sourceFiles[_i]; + cancellationToken.throwIfCancellationRequested(); + var nameTable = getNameTable(sourceFile); + if (ts.lookUp(nameTable, internedName)) { + result = 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 info = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, node.getSourceFile(), getContainerNode(node), node); var name = ts.map(info.displayParts, function (p) { return p.text; }).join(""); var declarations = symbol.declarations; if (!declarations || declarations.length === 0) { @@ -31931,7 +32917,7 @@ var ts; if (isImportOrExportSpecifierName(location)) { return location.getText(); } - name = typeInfoResolver.symbolToString(symbol); + name = typeChecker.symbolToString(symbol); return stripQuotes(name); } function getInternedName(symbol, location, declarations) { @@ -32079,10 +33065,10 @@ var ts; if (!(getMeaningFromLocation(referenceLocation) & searchMeaning)) { return; } - var referenceSymbol = typeInfoResolver.getSymbolAtLocation(referenceLocation); + var referenceSymbol = typeChecker.getSymbolAtLocation(referenceLocation); if (referenceSymbol) { var referenceSymbolDeclaration = referenceSymbol.valueDeclaration; - var shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration); + var shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration); var relatedSymbol = getRelatedSymbol(searchSymbols, referenceSymbol, referenceLocation); if (relatedSymbol) { var referencedSymbol = getReferencedSymbol(relatedSymbol); @@ -32255,18 +33241,18 @@ var ts; function populateSearchSymbolSet(symbol, location) { var result = [symbol]; if (isImportOrExportSpecifierImportSymbol(symbol)) { - result.push(typeInfoResolver.getAliasedSymbol(symbol)); + result.push(typeChecker.getAliasedSymbol(symbol)); } if (isNameOfPropertyAssignment(location)) { ts.forEach(getPropertySymbolsFromContextualType(location), function (contextualSymbol) { - result.push.apply(result, typeInfoResolver.getRootSymbols(contextualSymbol)); + result.push.apply(result, typeChecker.getRootSymbols(contextualSymbol)); }); - var shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(location.parent); + var shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(location.parent); if (shorthandValueSymbol) { result.push(shorthandValueSymbol); } } - ts.forEach(typeInfoResolver.getRootSymbols(symbol), function (rootSymbol) { + ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) { if (rootSymbol !== symbol) { result.push(rootSymbol); } @@ -32291,9 +33277,9 @@ var ts; return; function getPropertySymbolFromTypeReference(typeReference) { if (typeReference) { - var type = typeInfoResolver.getTypeAtLocation(typeReference); + var type = typeChecker.getTypeAtLocation(typeReference); if (type) { - var propertySymbol = typeInfoResolver.getPropertyOfType(type, propertyName); + var propertySymbol = typeChecker.getPropertyOfType(type, propertyName); if (propertySymbol) { result.push(propertySymbol); } @@ -32307,24 +33293,24 @@ var ts; return referenceSymbol; } if (isImportOrExportSpecifierImportSymbol(referenceSymbol)) { - var aliasedSymbol = typeInfoResolver.getAliasedSymbol(referenceSymbol); + var aliasedSymbol = typeChecker.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 ? s : undefined; }); + return ts.forEach(typeChecker.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); }); } - return ts.forEach(typeInfoResolver.getRootSymbols(referenceSymbol), function (rootSymbol) { + return ts.forEach(typeChecker.getRootSymbols(referenceSymbol), function (rootSymbol) { if (searchSymbols.indexOf(rootSymbol) >= 0) { return rootSymbol; } if (rootSymbol.parent && rootSymbol.parent.flags & (32 | 64)) { - var result_2 = []; - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_2); - return ts.forEach(result_2, function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); + var result_3 = []; + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_3); + return ts.forEach(result_3, function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); } return undefined; }); @@ -32332,27 +33318,27 @@ var ts; function getPropertySymbolsFromContextualType(node) { if (isNameOfPropertyAssignment(node)) { var objectLiteral = node.parent.parent; - var contextualType = typeInfoResolver.getContextualType(objectLiteral); - var name_20 = node.text; + var contextualType = typeChecker.getContextualType(objectLiteral); + var name_25 = node.text; if (contextualType) { if (contextualType.flags & 16384) { - var unionProperty = contextualType.getProperty(name_20); + var unionProperty = contextualType.getProperty(name_25); if (unionProperty) { return [unionProperty]; } else { - var result_3 = []; + var result_4 = []; ts.forEach(contextualType.types, function (t) { - var symbol = t.getProperty(name_20); + var symbol = t.getProperty(name_25); if (symbol) { - result_3.push(symbol); + result_4.push(symbol); } }); - return result_3; + return result_4; } } else { - var symbol_1 = contextualType.getProperty(name_20); + var symbol_1 = contextualType.getProperty(name_25); if (symbol_1) { return [symbol_1]; } @@ -32502,7 +33488,7 @@ var ts; } 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) || + return (decl.kind === 201 && root.parent.parent.token === 102) || (decl.kind === 202 && root.parent.parent.token === 79); } return false; @@ -32556,7 +33542,7 @@ var ts; function getSignatureHelpItems(fileName, position) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); - return ts.SignatureHelp.getSignatureHelpItems(sourceFile, position, typeInfoResolver, cancellationToken); + return ts.SignatureHelp.getSignatureHelpItems(program, sourceFile, position, cancellationToken); } function getSourceFile(fileName) { return syntaxTreeCache.getCurrentSourceFile(fileName); @@ -32612,6 +33598,7 @@ var ts; function getSemanticClassifications(fileName, span) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); + var typeChecker = program.getTypeChecker(); var result = []; processNode(sourceFile); return result; @@ -32650,7 +33637,7 @@ var ts; function processNode(node) { if (node && ts.textSpanIntersectsWith(span, node.getStart(), node.getWidth())) { if (node.kind === 65 && node.getWidth() > 0) { - var symbol = typeInfoResolver.getSymbolAtLocation(node); + var symbol = typeChecker.getSymbolAtLocation(node); if (symbol) { var type = classifySymbol(symbol, getMeaningFromLocation(node)); if (type) { @@ -32974,9 +33961,10 @@ var ts; function getRenameInfo(fileName, position) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); + var typeChecker = program.getTypeChecker(); var node = ts.getTouchingWord(sourceFile, position); if (node && node.kind === 65) { - var symbol = typeInfoResolver.getSymbolAtLocation(node); + var symbol = typeChecker.getSymbolAtLocation(node); if (symbol) { var declarations = symbol.getDeclarations(); if (declarations && declarations.length > 0) { @@ -32984,19 +33972,19 @@ var ts; if (defaultLibFileName) { for (var _i = 0; _i < declarations.length; _i++) { var current = declarations[_i]; - var sourceFile_1 = current.getSourceFile(); - if (sourceFile_1 && getCanonicalFileName(ts.normalizePath(sourceFile_1.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) { + var sourceFile_2 = current.getSourceFile(); + if (sourceFile_2 && getCanonicalFileName(ts.normalizePath(sourceFile_2.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) { return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library.key)); } } } - var kind = getSymbolKind(symbol, typeInfoResolver, node); + var kind = getSymbolKind(symbol, node); if (kind) { return { canRename: true, localizedErrorMessage: undefined, displayName: symbol.name, - fullDisplayName: typeInfoResolver.getFullyQualifiedName(symbol), + fullDisplayName: typeChecker.getFullyQualifiedName(symbol), kind: kind, kindModifiers: getSymbolModifiers(symbol), triggerSpan: ts.createTextSpan(node.getStart(), node.getWidth()) @@ -33034,6 +34022,7 @@ var ts; getReferencesAtPosition: getReferencesAtPosition, findReferences: findReferences, getOccurrencesAtPosition: getOccurrencesAtPosition, + getDocumentHighlights: getDocumentHighlights, getNameOrDottedNameSpan: getNameOrDottedNameSpan, getBreakpointStatementAtPosition: getBreakpointStatementAtPosition, getNavigateToItems: getNavigateToItems, @@ -33109,7 +34098,7 @@ var ts; if (keyword2 === 116 || keyword2 === 120 || keyword2 === 114 || - keyword2 === 110) { + keyword2 === 109) { return true; } return false; @@ -33453,25 +34442,27 @@ var ts; } var CommandNames; (function (CommandNames) { + CommandNames.Brace = "brace"; CommandNames.Change = "change"; CommandNames.Close = "close"; CommandNames.Completions = "completions"; CommandNames.CompletionDetails = "completionEntryDetails"; - CommandNames.SignatureHelp = "signatureHelp"; CommandNames.Configure = "configure"; CommandNames.Definition = "definition"; + CommandNames.Exit = "exit"; CommandNames.Format = "format"; CommandNames.Formatonkey = "formatonkey"; CommandNames.Geterr = "geterr"; CommandNames.NavBar = "navbar"; CommandNames.Navto = "navto"; + CommandNames.Occurrences = "occurrences"; CommandNames.Open = "open"; CommandNames.Quickinfo = "quickinfo"; CommandNames.References = "references"; CommandNames.Reload = "reload"; CommandNames.Rename = "rename"; CommandNames.Saveto = "saveto"; - CommandNames.Brace = "brace"; + CommandNames.SignatureHelp = "signatureHelp"; CommandNames.Unknown = "unknown"; })(CommandNames = server.CommandNames || (server.CommandNames = {})); var Errors; @@ -33643,6 +34634,30 @@ var ts; end: compilerService.host.positionToLineOffset(def.fileName, ts.textSpanEnd(def.textSpan)) }); }); }; + Session.prototype.getOccurrences = function (line, offset, fileName) { + fileName = ts.normalizePath(fileName); + var project = this.projectService.getProjectForFile(fileName); + if (!project) { + throw Errors.NoProject; + } + var compilerService = project.compilerService; + var position = compilerService.host.lineOffsetToPosition(fileName, line, offset); + var occurrences = compilerService.languageService.getOccurrencesAtPosition(fileName, position); + if (!occurrences) { + return undefined; + } + return occurrences.map(function (occurrence) { + var fileName = occurrence.fileName, isWriteAccess = occurrence.isWriteAccess, textSpan = occurrence.textSpan; + var start = compilerService.host.positionToLineOffset(fileName, textSpan.start); + var end = compilerService.host.positionToLineOffset(fileName, ts.textSpanEnd(textSpan)); + return { + start: start, + end: end, + file: fileName, + isWriteAccess: isWriteAccess + }; + }); + }; Session.prototype.getRenameLocations = function (line, offset, fileName, findInComments, findInStrings) { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); @@ -34049,6 +35064,8 @@ var ts; end: compilerService.host.positionToLineOffset(file, span.start + span.length) }); }); }; + Session.prototype.exit = function () { + }; Session.prototype.onMessage = function (message) { if (this.logger.isVerbose()) { this.logger.info("request: " + message); @@ -34060,6 +35077,11 @@ var ts; var errorMessage; 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); @@ -34164,6 +35186,11 @@ var ts; response = this.getNavigationBarItems(navBarArgs.file); break; } + case CommandNames.Occurrences: { + var _a = request.arguments, line = _a.line, offset = _a.offset, fileName = _a.file; + response = this.getOccurrences(line, offset, fileName); + break; + } default: { this.projectService.log("Unrecognized JSON command: " + message); this.output(undefined, CommandNames.Unknown, request.seq, "Unrecognized JSON command: " + request.command); @@ -34551,7 +35578,7 @@ var ts; 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 { @@ -34872,6 +35899,9 @@ var ts; } }; ProjectService.prototype.printProjects = function () { + if (!this.psLogger.isVerbose()) { + return; + } this.psLogger.startGroup(); for (var i = 0, len = this.inferredProjects.length; i < len; i++) { var project = this.inferredProjects[i]; @@ -35403,6 +36433,9 @@ var ts; } return accum; }; + LineIndex.prototype.getLength = function () { + return this.root.charCount(); + }; LineIndex.prototype.every = function (f, rangeStart, rangeEnd) { if (!rangeEnd) { rangeEnd = this.root.charCount(); @@ -35969,6 +37002,11 @@ var ts; function IOSession(host, logger) { _super.call(this, host, logger); } + IOSession.prototype.exit = function () { + this.projectService.log("Exiting...", "Info"); + this.projectService.closeLog(); + process.exit(0); + }; IOSession.prototype.listen = function () { var _this = this; rl.on('line', function (input) { @@ -35976,9 +37014,7 @@ var ts; _this.onMessage(message); }); rl.on('close', function () { - _this.projectService.log("Exiting..."); - _this.projectService.closeLog(); - process.exit(0); + _this.exit(); }); }; return IOSession; diff --git a/bin/typescript.d.ts b/bin/typescript.d.ts index e817dfb54ae..2ce77b9fb70 100644 --- a/bin/typescript.d.ts +++ b/bin/typescript.d.ts @@ -124,16 +124,16 @@ declare module "typescript" { 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, + ImplementsKeyword = 102, + InterfaceKeyword = 103, + LetKeyword = 104, + PackageKeyword = 105, + PrivateKeyword = 106, + ProtectedKeyword = 107, + PublicKeyword = 108, + StaticKeyword = 109, + YieldKeyword = 110, + AsKeyword = 111, AnyKeyword = 112, BooleanKeyword = 113, ConstructorKeyword = 114, @@ -258,8 +258,8 @@ declare module "typescript" { LastReservedWord = 101, FirstKeyword = 66, LastKeyword = 125, - FirstFutureReservedWord = 103, - LastFutureReservedWord = 111, + FirstFutureReservedWord = 102, + LastFutureReservedWord = 110, FirstTypeNode = 141, LastTypeNode = 149, FirstPunctuation = 14, @@ -295,34 +295,12 @@ declare module "typescript" { 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; @@ -332,6 +310,7 @@ declare module "typescript" { } interface Identifier extends PrimaryExpression { text: string; + originalKeywordKind?: SyntaxKind; } interface QualifiedName extends Node { left: EntityName; @@ -473,7 +452,8 @@ declare module "typescript" { interface ParenthesizedTypeNode extends TypeNode { type: TypeNode; } - interface StringLiteralTypeNode extends LiteralExpression, TypeNode { + interface StringLiteral extends LiteralExpression, TypeNode { + _stringLiteralBrand: any; } interface Expression extends Node { _expressionBrand: any; @@ -539,9 +519,6 @@ declare module "typescript" { isUnterminated?: boolean; hasExtendedUnicodeEscape?: boolean; } - interface StringLiteralExpression extends LiteralExpression { - _stringLiteralExpressionBrand: any; - } interface TemplateExpression extends PrimaryExpression { head: LiteralExpression; templateSpans: NodeArray; @@ -576,7 +553,7 @@ declare module "typescript" { typeArguments?: NodeArray; arguments: NodeArray; } - interface HeritageClauseElement extends Node { + interface HeritageClauseElement extends TypeNode { expression: LeftHandSideExpression; typeArguments?: NodeArray; } @@ -723,7 +700,7 @@ declare module "typescript" { interface ExternalModuleReference extends Node { expression?: Expression; } - interface ImportDeclaration extends Statement, ModuleElement { + interface ImportDeclaration extends ModuleElement { importClause?: ImportClause; moduleSpecifier: Expression; } @@ -751,14 +728,14 @@ declare module "typescript" { type ExportSpecifier = ImportOrExportSpecifier; interface ExportAssignment extends Declaration, ModuleElement { isExportEquals?: boolean; - expression?: Expression; - type?: TypeNode; + expression: Expression; } interface FileReference extends TextRange { fileName: string; } interface CommentRange extends TextRange { hasTrailingNewLine?: boolean; + kind: SyntaxKind; } interface SourceFile extends Declaration { statements: NodeArray; @@ -772,9 +749,7 @@ declare module "typescript" { amdModuleName: string; referencedFiles: FileReference[]; hasNoDefaultLib: boolean; - externalModuleIndicator: Node; languageVersion: ScriptTarget; - identifiers: Map; } interface ScriptReferenceHost { getCompilerOptions(): CompilerOptions; @@ -785,6 +760,9 @@ declare module "typescript" { (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; } interface Program extends ScriptReferenceHost { + /** + * Get a list of files in the program + */ getSourceFiles(): SourceFile[]; /** * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then @@ -801,15 +779,23 @@ declare module "typescript" { getGlobalDiagnostics(): Diagnostic[]; getSemanticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; getDeclarationDiagnostics(sourceFile?: SourceFile): Diagnostic[]; + /** + * Gets a type checker that can be used to semantically analyze source fils in the program. + */ getTypeChecker(): TypeChecker; - getCommonSourceDirectory(): string; } interface SourceMapSpan { + /** Line number in the .js file. */ emittedLine: number; + /** Column number in the .js file. */ emittedColumn: number; + /** Line number in the .ts file. */ sourceLine: number; + /** Column number in the .ts file. */ sourceColumn: number; + /** Optional name (index into names array) associated with this span. */ nameIndex?: number; + /** .ts file (index into sources array) associated with this span */ sourceIndex: number; } interface SourceMapData { @@ -823,6 +809,7 @@ declare module "typescript" { sourceMapMappings: string; sourceMapDecodedMappings: SourceMapSpan[]; } + /** Return code used by getEmitOutput function to indicate status of the function */ enum ExitStatus { Success = 0, DiagnosticsPresent_OutputsSkipped = 1, @@ -831,7 +818,6 @@ declare module "typescript" { interface EmitResult { emitSkipped: boolean; diagnostics: Diagnostic[]; - sourceMaps: SourceMapData[]; } interface TypeCheckerHost { getCompilerOptions(): CompilerOptions; @@ -865,7 +851,7 @@ declare module "typescript" { 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[]; } interface SymbolDisplayBuilder { buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; @@ -908,40 +894,6 @@ declare module "typescript" { 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 | Expression, 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, @@ -1011,57 +963,14 @@ declare module "typescript" { 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, @@ -1079,26 +988,16 @@ declare module "typescript" { 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; } @@ -1106,19 +1005,20 @@ declare module "typescript" { } interface InterfaceType extends ObjectType { typeParameters: TypeParameter[]; - baseTypes: ObjectType[]; declaredProperties: Symbol[]; declaredCallSignatures: Signature[]; declaredConstructSignatures: Signature[]; declaredStringIndexType: Type; declaredNumberIndexType: Type; } + interface InterfaceTypeWithBaseTypes extends InterfaceType { + baseTypes: ObjectType[]; + } interface TypeReference extends ObjectType { target: GenericType; typeArguments: Type[]; } interface GenericType extends InterfaceType, TypeReference { - instantiations: Map; } interface TupleType extends ObjectType { elementTypes: Type[]; @@ -1126,20 +1026,9 @@ declare module "typescript" { } 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, @@ -1149,28 +1038,22 @@ declare module "typescript" { 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; } + /** + * A linked list of formatted diagnostic messages to be used as part of a multiline message. + * It is built from the bottom up, leaving the head to be the "main" diagnostic. + * While it seems that DiagnosticMessageChain is structurally similar to DiagnosticMessage, + * the difference is that messages are all preformatted in DMC. + */ interface DiagnosticMessageChain { messageText: string; category: DiagnosticCategory; @@ -1219,6 +1102,7 @@ declare module "typescript" { version?: boolean; watch?: boolean; separateCompilation?: boolean; + emitDecoratorMetadata?: boolean; [option: string]: string | number | boolean; } const enum ModuleKind { @@ -1241,142 +1125,6 @@ declare module "typescript" { 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; } @@ -1400,67 +1148,78 @@ declare module "typescript" { } } declare module "typescript" { - interface ErrorCallback { - (message: DiagnosticMessage, length: number): void; + interface System { + args: string[]; + newLine: string; + useCaseSensitiveFileNames: boolean; + write(s: string): void; + readFile(path: string, encoding?: string): string; + writeFile(path: string, data: string, writeByteOrderMark?: boolean): void; + watchFile?(path: string, callback: (path: string) => void): FileWatcher; + resolvePath(path: string): string; + fileExists(path: string): boolean; + directoryExists(path: string): boolean; + createDirectory(path: string): void; + getExecutingFilePath(): string; + getCurrentDirectory(): string; + readDirectory(path: string, extension?: string): string[]; + getMemoryUsage?(): number; + exit(exitCode?: 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; + interface FileWatcher { + close(): void; } + var sys: System; +} +declare module "typescript" { 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 getDefaultLibFileName(options: CompilerOptions): string; + function textSpanEnd(span: TextSpan): number; + function textSpanIsEmpty(span: TextSpan): boolean; + function textSpanContainsPosition(span: TextSpan, position: number): boolean; + function textSpanContainsTextSpan(span: TextSpan, other: TextSpan): boolean; + function textSpanOverlapsWith(span: TextSpan, other: TextSpan): boolean; + function textSpanOverlap(span1: TextSpan, span2: TextSpan): TextSpan; + function textSpanIntersectsWithTextSpan(span: TextSpan, other: TextSpan): boolean; + function textSpanIntersectsWith(span: TextSpan, start: number, length: number): boolean; + function textSpanIntersectsWithPosition(span: TextSpan, position: number): boolean; + function textSpanIntersection(span1: TextSpan, span2: TextSpan): TextSpan; + function createTextSpan(start: number, length: number): TextSpan; + function createTextSpanFromBounds(start: number, end: number): TextSpan; + function textChangeRangeNewSpan(range: TextChangeRange): TextSpan; + function textChangeRangeIsUnchanged(range: TextChangeRange): boolean; + function createTextChangeRange(span: TextSpan, newLength: number): TextChangeRange; + let unchangedTextChangeRange: TextChangeRange; + /** + * Called to merge all the changes that occurred across several versions of a script snapshot + * into a single change. i.e. if a user keeps making successive edits to a script we will + * have a text change from V1 to V2, V2 to V3, ..., Vn. + * + * This function will then merge those changes into a single change range valid between V1 and + * Vn. + */ + function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange; } 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; + function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; } declare module "typescript" { /** The version of the TypeScript compiler release */ - let version: string; + const version: string; function findConfigFile(searchPath: string): string; function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; function getPreEmitDiagnostics(program: Program): Diagnostic[]; @@ -1468,6 +1227,7 @@ declare module "typescript" { function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; } declare module "typescript" { + function parseCommandLine(commandLine: string[]): ParsedCommandLine; /** * Read tsconfig.json file * @param fileName The path to the config file @@ -1525,7 +1285,6 @@ declare module "typescript" { getDocumentationComment(): SymbolDisplayPart[]; } interface SourceFile { - getNamedDeclarations(): Declaration[]; getLineAndCharacterOfPosition(pos: number): LineAndCharacter; getLineStarts(): number[]; getPositionOfLineAndCharacter(line: number, character: number): number; @@ -1589,8 +1348,10 @@ declare module "typescript" { 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[]; + getDocumentHighlights(fileName: string, position: number, filesToSearch: string[]): DocumentHighlights[]; + /** @deprecated */ + getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; getNavigationBarItems(fileName: string): NavigationBarItem[]; getOutliningSpans(fileName: string): OutliningSpan[]; @@ -1641,6 +1402,20 @@ declare module "typescript" { fileName: string; isWriteAccess: boolean; } + interface DocumentHighlights { + fileName: string; + highlightSpans: HighlightSpan[]; + } + module HighlightSpanKind { + const none: string; + const definition: string; + const reference: string; + const writtenReference: string; + } + interface HighlightSpan { + textSpan: TextSpan; + kind: string; + } interface NavigateToItem { name: string; kind: string; @@ -1765,6 +1540,7 @@ declare module "typescript" { name: string; kind: string; kindModifiers: string; + sortText: string; } interface CompletionEntryDetails { name: string; @@ -1905,43 +1681,44 @@ declare module "typescript" { */ 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; + module ScriptElementKind { + const unknown: string; + const warning: string; + const keyword: string; + const scriptElement: string; + const moduleElement: string; + const classElement: string; + const interfaceElement: string; + const typeElement: string; + const enumElement: string; + const variableElement: string; + const localVariableElement: string; + const functionElement: string; + const localFunctionElement: string; + const memberFunctionElement: string; + const memberGetAccessorElement: string; + const memberSetAccessorElement: string; + const memberVariableElement: string; + const constructorImplementationElement: string; + const callSignatureElement: string; + const indexSignatureElement: string; + const constructSignatureElement: string; + const parameterElement: string; + const typeParameterElement: string; + const primitiveType: string; + const label: string; + const alias: string; + const constElement: string; + const 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; + module ScriptElementKindModifier { + const none: string; + const publicMemberModifier: string; + const privateMemberModifier: string; + const protectedMemberModifier: string; + const exportedModifier: string; + const ambientModifier: string; + const staticModifier: string; } class ClassificationTypeNames { static comment: string; diff --git a/bin/typescript.js b/bin/typescript.js index 75de01a630e..0165995c56d 100644 --- a/bin/typescript.js +++ b/bin/typescript.js @@ -15,6 +15,7 @@ and limitations under the License. var ts; (function (ts) { + // token > SyntaxKind.Identifer => token is a keyword (function (SyntaxKind) { SyntaxKind[SyntaxKind["Unknown"] = 0] = "Unknown"; SyntaxKind[SyntaxKind["EndOfFileToken"] = 1] = "EndOfFileToken"; @@ -22,14 +23,19 @@ var ts; SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 3] = "MultiLineCommentTrivia"; SyntaxKind[SyntaxKind["NewLineTrivia"] = 4] = "NewLineTrivia"; SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 5] = "WhitespaceTrivia"; + // We detect and provide better error recovery when we encounter a git merge marker. This + // allows us to edit files with git-conflict markers in them in a much more pleasant manner. SyntaxKind[SyntaxKind["ConflictMarkerTrivia"] = 6] = "ConflictMarkerTrivia"; + // Literals SyntaxKind[SyntaxKind["NumericLiteral"] = 7] = "NumericLiteral"; SyntaxKind[SyntaxKind["StringLiteral"] = 8] = "StringLiteral"; SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 9] = "RegularExpressionLiteral"; SyntaxKind[SyntaxKind["NoSubstitutionTemplateLiteral"] = 10] = "NoSubstitutionTemplateLiteral"; + // Pseudo-literals SyntaxKind[SyntaxKind["TemplateHead"] = 11] = "TemplateHead"; SyntaxKind[SyntaxKind["TemplateMiddle"] = 12] = "TemplateMiddle"; SyntaxKind[SyntaxKind["TemplateTail"] = 13] = "TemplateTail"; + // Punctuation SyntaxKind[SyntaxKind["OpenBraceToken"] = 14] = "OpenBraceToken"; SyntaxKind[SyntaxKind["CloseBraceToken"] = 15] = "CloseBraceToken"; SyntaxKind[SyntaxKind["OpenParenToken"] = 16] = "OpenParenToken"; @@ -69,6 +75,7 @@ var ts; SyntaxKind[SyntaxKind["QuestionToken"] = 50] = "QuestionToken"; SyntaxKind[SyntaxKind["ColonToken"] = 51] = "ColonToken"; SyntaxKind[SyntaxKind["AtToken"] = 52] = "AtToken"; + // Assignments SyntaxKind[SyntaxKind["EqualsToken"] = 53] = "EqualsToken"; SyntaxKind[SyntaxKind["PlusEqualsToken"] = 54] = "PlusEqualsToken"; SyntaxKind[SyntaxKind["MinusEqualsToken"] = 55] = "MinusEqualsToken"; @@ -81,7 +88,9 @@ var ts; SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 62] = "AmpersandEqualsToken"; SyntaxKind[SyntaxKind["BarEqualsToken"] = 63] = "BarEqualsToken"; SyntaxKind[SyntaxKind["CaretEqualsToken"] = 64] = "CaretEqualsToken"; + // Identifiers SyntaxKind[SyntaxKind["Identifier"] = 65] = "Identifier"; + // Reserved words SyntaxKind[SyntaxKind["BreakKeyword"] = 66] = "BreakKeyword"; SyntaxKind[SyntaxKind["CaseKeyword"] = 67] = "CaseKeyword"; SyntaxKind[SyntaxKind["CatchKeyword"] = 68] = "CatchKeyword"; @@ -118,16 +127,18 @@ var ts; 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"; + // Strict mode reserved words + 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"; + // Contextual keywords + SyntaxKind[SyntaxKind["AsKeyword"] = 111] = "AsKeyword"; SyntaxKind[SyntaxKind["AnyKeyword"] = 112] = "AnyKeyword"; SyntaxKind[SyntaxKind["BooleanKeyword"] = 113] = "BooleanKeyword"; SyntaxKind[SyntaxKind["ConstructorKeyword"] = 114] = "ConstructorKeyword"; @@ -142,11 +153,15 @@ var ts; SyntaxKind[SyntaxKind["TypeKeyword"] = 123] = "TypeKeyword"; SyntaxKind[SyntaxKind["FromKeyword"] = 124] = "FromKeyword"; SyntaxKind[SyntaxKind["OfKeyword"] = 125] = "OfKeyword"; + // Parse tree nodes + // Names SyntaxKind[SyntaxKind["QualifiedName"] = 126] = "QualifiedName"; SyntaxKind[SyntaxKind["ComputedPropertyName"] = 127] = "ComputedPropertyName"; + // Signature elements SyntaxKind[SyntaxKind["TypeParameter"] = 128] = "TypeParameter"; SyntaxKind[SyntaxKind["Parameter"] = 129] = "Parameter"; SyntaxKind[SyntaxKind["Decorator"] = 130] = "Decorator"; + // TypeMember SyntaxKind[SyntaxKind["PropertySignature"] = 131] = "PropertySignature"; SyntaxKind[SyntaxKind["PropertyDeclaration"] = 132] = "PropertyDeclaration"; SyntaxKind[SyntaxKind["MethodSignature"] = 133] = "MethodSignature"; @@ -157,6 +172,7 @@ var ts; SyntaxKind[SyntaxKind["CallSignature"] = 138] = "CallSignature"; SyntaxKind[SyntaxKind["ConstructSignature"] = 139] = "ConstructSignature"; SyntaxKind[SyntaxKind["IndexSignature"] = 140] = "IndexSignature"; + // Type SyntaxKind[SyntaxKind["TypeReference"] = 141] = "TypeReference"; SyntaxKind[SyntaxKind["FunctionType"] = 142] = "FunctionType"; SyntaxKind[SyntaxKind["ConstructorType"] = 143] = "ConstructorType"; @@ -166,9 +182,11 @@ var ts; SyntaxKind[SyntaxKind["TupleType"] = 147] = "TupleType"; SyntaxKind[SyntaxKind["UnionType"] = 148] = "UnionType"; SyntaxKind[SyntaxKind["ParenthesizedType"] = 149] = "ParenthesizedType"; + // Binding patterns SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 150] = "ObjectBindingPattern"; SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 151] = "ArrayBindingPattern"; SyntaxKind[SyntaxKind["BindingElement"] = 152] = "BindingElement"; + // Expression SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 153] = "ArrayLiteralExpression"; SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 154] = "ObjectLiteralExpression"; SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 155] = "PropertyAccessExpression"; @@ -192,9 +210,11 @@ var ts; SyntaxKind[SyntaxKind["SpreadElementExpression"] = 173] = "SpreadElementExpression"; SyntaxKind[SyntaxKind["ClassExpression"] = 174] = "ClassExpression"; SyntaxKind[SyntaxKind["OmittedExpression"] = 175] = "OmittedExpression"; + // Misc SyntaxKind[SyntaxKind["TemplateSpan"] = 176] = "TemplateSpan"; SyntaxKind[SyntaxKind["HeritageClauseElement"] = 177] = "HeritageClauseElement"; SyntaxKind[SyntaxKind["SemicolonClassElement"] = 178] = "SemicolonClassElement"; + // Element SyntaxKind[SyntaxKind["Block"] = 179] = "Block"; SyntaxKind[SyntaxKind["VariableStatement"] = 180] = "VariableStatement"; SyntaxKind[SyntaxKind["EmptyStatement"] = 181] = "EmptyStatement"; @@ -235,25 +255,33 @@ var ts; SyntaxKind[SyntaxKind["NamedExports"] = 216] = "NamedExports"; SyntaxKind[SyntaxKind["ExportSpecifier"] = 217] = "ExportSpecifier"; SyntaxKind[SyntaxKind["MissingDeclaration"] = 218] = "MissingDeclaration"; + // Module references SyntaxKind[SyntaxKind["ExternalModuleReference"] = 219] = "ExternalModuleReference"; + // Clauses SyntaxKind[SyntaxKind["CaseClause"] = 220] = "CaseClause"; SyntaxKind[SyntaxKind["DefaultClause"] = 221] = "DefaultClause"; SyntaxKind[SyntaxKind["HeritageClause"] = 222] = "HeritageClause"; SyntaxKind[SyntaxKind["CatchClause"] = 223] = "CatchClause"; + // Property assignments SyntaxKind[SyntaxKind["PropertyAssignment"] = 224] = "PropertyAssignment"; SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 225] = "ShorthandPropertyAssignment"; + // Enum SyntaxKind[SyntaxKind["EnumMember"] = 226] = "EnumMember"; + // Top-level nodes SyntaxKind[SyntaxKind["SourceFile"] = 227] = "SourceFile"; + // Synthesized list SyntaxKind[SyntaxKind["SyntaxList"] = 228] = "SyntaxList"; + // Enum value count SyntaxKind[SyntaxKind["Count"] = 229] = "Count"; + // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 53] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 64] = "LastAssignment"; SyntaxKind[SyntaxKind["FirstReservedWord"] = 66] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 101] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 66] = "FirstKeyword"; SyntaxKind[SyntaxKind["LastKeyword"] = 125] = "LastKeyword"; - SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 103] = "FirstFutureReservedWord"; - SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 111] = "LastFutureReservedWord"; + SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 102] = "FirstFutureReservedWord"; + SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 110] = "LastFutureReservedWord"; SyntaxKind[SyntaxKind["FirstTypeNode"] = 141] = "FirstTypeNode"; SyntaxKind[SyntaxKind["LastTypeNode"] = 149] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 14] = "FirstPunctuation"; @@ -291,27 +319,49 @@ var ts; NodeFlags[NodeFlags["BlockScoped"] = 12288] = "BlockScoped"; })(ts.NodeFlags || (ts.NodeFlags = {})); var NodeFlags = ts.NodeFlags; + /* @internal */ (function (ParserContextFlags) { + // Set if this node was parsed in strict mode. Used for grammar error checks, as well as + // checking if the node can be reused in incremental settings. ParserContextFlags[ParserContextFlags["StrictMode"] = 1] = "StrictMode"; + // If this node was parsed in a context where 'in-expressions' are not allowed. ParserContextFlags[ParserContextFlags["DisallowIn"] = 2] = "DisallowIn"; + // If this node was parsed in the 'yield' context created when parsing a generator. ParserContextFlags[ParserContextFlags["Yield"] = 4] = "Yield"; + // If this node was parsed in the parameters of a generator. ParserContextFlags[ParserContextFlags["GeneratorParameter"] = 8] = "GeneratorParameter"; + // If this node was parsed as part of a decorator ParserContextFlags[ParserContextFlags["Decorator"] = 16] = "Decorator"; + // If the parser encountered an error when parsing the code that created this node. Note + // the parser only sets this directly on the node it creates right after encountering the + // error. ParserContextFlags[ParserContextFlags["ThisNodeHasError"] = 32] = "ThisNodeHasError"; + // Context flags set directly by the parser. ParserContextFlags[ParserContextFlags["ParserGeneratedFlags"] = 63] = "ParserGeneratedFlags"; + // Context flags computed by aggregating child flags upwards. + // Used during incremental parsing to determine if this node or any of its children had an + // error. Computed only once and then cached. ParserContextFlags[ParserContextFlags["ThisNodeOrAnySubNodesHasError"] = 64] = "ThisNodeOrAnySubNodesHasError"; + // Used to know if we've computed data from children and cached it in this node. ParserContextFlags[ParserContextFlags["HasAggregatedChildData"] = 128] = "HasAggregatedChildData"; })(ts.ParserContextFlags || (ts.ParserContextFlags = {})); var ParserContextFlags = ts.ParserContextFlags; + /* @internal */ (function (RelationComparisonResult) { RelationComparisonResult[RelationComparisonResult["Succeeded"] = 1] = "Succeeded"; RelationComparisonResult[RelationComparisonResult["Failed"] = 2] = "Failed"; RelationComparisonResult[RelationComparisonResult["FailedAndReported"] = 3] = "FailedAndReported"; })(ts.RelationComparisonResult || (ts.RelationComparisonResult = {})); var RelationComparisonResult = ts.RelationComparisonResult; + /** Return code used by getEmitOutput function to indicate status of the function */ (function (ExitStatus) { + // Compiler ran successfully. Either this was a simple do-nothing compilation (for example, + // when -version or -help was provided, or this was a normal compilation, no diagnostics + // were produced, and all outputs were generated successfully. ExitStatus[ExitStatus["Success"] = 0] = "Success"; + // Diagnostics were produced and because of them no code was generated. ExitStatus[ExitStatus["DiagnosticsPresent_OutputsSkipped"] = 1] = "DiagnosticsPresent_OutputsSkipped"; + // Diagnostics were produced and outputs were generated in spite of them. ExitStatus[ExitStatus["DiagnosticsPresent_OutputsGenerated"] = 2] = "DiagnosticsPresent_OutputsGenerated"; })(ts.ExitStatus || (ts.ExitStatus = {})); var ExitStatus = ts.ExitStatus; @@ -329,10 +379,18 @@ var ts; var TypeFormatFlags = ts.TypeFormatFlags; (function (SymbolFormatFlags) { SymbolFormatFlags[SymbolFormatFlags["None"] = 0] = "None"; + // Write symbols's type argument if it is instantiated symbol + // eg. class C { p: T } <-- Show p as C.p here + // var a: C; + // var p = a.p; <--- Here p is property of C so show it as C.p instead of just C.p SymbolFormatFlags[SymbolFormatFlags["WriteTypeParametersOrArguments"] = 1] = "WriteTypeParametersOrArguments"; + // Use only external alias information to get the symbol name in the given context + // eg. module m { export class c { } } import x = m.c; + // When this flag is specified m.c will be used to refer to the class instead of alias symbol x SymbolFormatFlags[SymbolFormatFlags["UseOnlyExternalAliasing"] = 2] = "UseOnlyExternalAliasing"; })(ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {})); var SymbolFormatFlags = ts.SymbolFormatFlags; + /* @internal */ (function (SymbolAccessibility) { SymbolAccessibility[SymbolAccessibility["Accessible"] = 0] = "Accessible"; SymbolAccessibility[SymbolAccessibility["NotAccessible"] = 1] = "NotAccessible"; @@ -378,7 +436,11 @@ var ts; SymbolFlags[SymbolFlags["Namespace"] = 1536] = "Namespace"; SymbolFlags[SymbolFlags["Module"] = 1536] = "Module"; SymbolFlags[SymbolFlags["Accessor"] = 98304] = "Accessor"; + // Variables can be redeclared, but can not redeclare a block-scoped declaration with the + // same name, or any other value that is not a variable, e.g. ValueModule or Class SymbolFlags[SymbolFlags["FunctionScopedVariableExcludes"] = 107454] = "FunctionScopedVariableExcludes"; + // Block-scoped declarations are not allowed to be re-declared + // they can not merge with anything in the value space SymbolFlags[SymbolFlags["BlockScopedVariableExcludes"] = 107455] = "BlockScopedVariableExcludes"; SymbolFlags[SymbolFlags["ParameterExcludes"] = 107455] = "ParameterExcludes"; SymbolFlags[SymbolFlags["PropertyExcludes"] = 107455] = "PropertyExcludes"; @@ -406,6 +468,7 @@ var ts; SymbolFlags[SymbolFlags["Export"] = 7340032] = "Export"; })(ts.SymbolFlags || (ts.SymbolFlags = {})); var SymbolFlags = ts.SymbolFlags; + /* @internal */ (function (NodeCheckFlags) { NodeCheckFlags[NodeCheckFlags["TypeChecked"] = 1] = "TypeChecked"; NodeCheckFlags[NodeCheckFlags["LexicalThis"] = 2] = "LexicalThis"; @@ -414,9 +477,12 @@ var ts; NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 16] = "SuperInstance"; NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 32] = "SuperStatic"; NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 64] = "ContextChecked"; + // Values for enum members have been computed, and any errors have been reported for them. NodeCheckFlags[NodeCheckFlags["EnumValuesComputed"] = 128] = "EnumValuesComputed"; NodeCheckFlags[NodeCheckFlags["BlockScopedBindingInLoop"] = 256] = "BlockScopedBindingInLoop"; NodeCheckFlags[NodeCheckFlags["EmitDecorate"] = 512] = "EmitDecorate"; + NodeCheckFlags[NodeCheckFlags["EmitParam"] = 1024] = "EmitParam"; + NodeCheckFlags[NodeCheckFlags["LexicalModuleMergesWithClass"] = 2048] = "LexicalModuleMergesWithClass"; })(ts.NodeCheckFlags || (ts.NodeCheckFlags = {})); var NodeCheckFlags = ts.NodeCheckFlags; (function (TypeFlags) { @@ -436,16 +502,22 @@ var ts; TypeFlags[TypeFlags["Tuple"] = 8192] = "Tuple"; TypeFlags[TypeFlags["Union"] = 16384] = "Union"; TypeFlags[TypeFlags["Anonymous"] = 32768] = "Anonymous"; + /* @internal */ TypeFlags[TypeFlags["FromSignature"] = 65536] = "FromSignature"; TypeFlags[TypeFlags["ObjectLiteral"] = 131072] = "ObjectLiteral"; + /* @internal */ TypeFlags[TypeFlags["ContainsUndefinedOrNull"] = 262144] = "ContainsUndefinedOrNull"; + /* @internal */ TypeFlags[TypeFlags["ContainsObjectLiteral"] = 524288] = "ContainsObjectLiteral"; TypeFlags[TypeFlags["ESSymbol"] = 1048576] = "ESSymbol"; + /* @internal */ TypeFlags[TypeFlags["Intrinsic"] = 1048703] = "Intrinsic"; + /* @internal */ TypeFlags[TypeFlags["Primitive"] = 1049086] = "Primitive"; TypeFlags[TypeFlags["StringLike"] = 258] = "StringLike"; TypeFlags[TypeFlags["NumberLike"] = 132] = "NumberLike"; TypeFlags[TypeFlags["ObjectType"] = 48128] = "ObjectType"; + /* @internal */ TypeFlags[TypeFlags["RequiresWidening"] = 786432] = "RequiresWidening"; })(ts.TypeFlags || (ts.TypeFlags = {})); var TypeFlags = ts.TypeFlags; @@ -478,6 +550,7 @@ var ts; ScriptTarget[ScriptTarget["Latest"] = 2] = "Latest"; })(ts.ScriptTarget || (ts.ScriptTarget = {})); var ScriptTarget = ts.ScriptTarget; + /* @internal */ (function (CharacterCodes) { CharacterCodes[CharacterCodes["nullCharacter"] = 0] = "nullCharacter"; CharacterCodes[CharacterCodes["maxAsciiCharacter"] = 127] = "maxAsciiCharacter"; @@ -486,6 +559,7 @@ var ts; CharacterCodes[CharacterCodes["lineSeparator"] = 8232] = "lineSeparator"; CharacterCodes[CharacterCodes["paragraphSeparator"] = 8233] = "paragraphSeparator"; CharacterCodes[CharacterCodes["nextLine"] = 133] = "nextLine"; + // Unicode 3.0 space characters CharacterCodes[CharacterCodes["space"] = 32] = "space"; CharacterCodes[CharacterCodes["nonBreakingSpace"] = 160] = "nonBreakingSpace"; CharacterCodes[CharacterCodes["enQuad"] = 8192] = "enQuad"; @@ -607,8 +681,16 @@ var ts; var CharacterCodes = ts.CharacterCodes; })(ts || (ts = {})); /// +/* @internal */ var ts; (function (ts) { + // Ternary values are defined such that + // x & y is False if either x or y is False. + // x & y is Maybe if either x or y is Maybe, but neither x or y is False. + // x & y is True if both x and y are True. + // x | y is False if both x and y are False. + // x | y is Maybe if either x or y is Maybe, but neither x or y is True. + // x | y is True if either x or y is True. (function (Ternary) { Ternary[Ternary["False"] = 0] = "False"; Ternary[Ternary["Maybe"] = 1] = "Maybe"; @@ -674,9 +756,9 @@ var ts; if (array) { result = []; for (var _i = 0; _i < array.length; _i++) { - var item_1 = array[_i]; - if (f(item_1)) { - result.push(item_1); + var item = array[_i]; + if (f(item)) { + result.push(item); } } } @@ -708,9 +790,9 @@ var ts; if (array) { result = []; for (var _i = 0; _i < array.length; _i++) { - var item_2 = array[_i]; - if (!contains(result, item_2)) { - result.push(item_2); + var item = array[_i]; + if (!contains(result, item)) { + result.push(item); } } } @@ -735,6 +817,9 @@ var ts; } } ts.addRange = addRange; + /** + * Returns the last element of an array if non-empty, undefined otherwise. + */ function lastOrUndefined(array) { if (array.length === 0) { return undefined; @@ -857,6 +942,16 @@ var ts; } } ts.copyMap = copyMap; + /** + * Creates a map from the elements of an array. + * + * @param array the array of input elements. + * @param makeKey a function that produces a key for a given element. + * + * This function makes no effort to avoid collisions; if any two elements produce + * the same key with the given 'makeKey' function, then the element with the higher + * index in the array will be the one associated with the produced key. + */ function arrayToMap(array, makeKey) { var result = {}; forEach(array, function (value) { @@ -932,12 +1027,12 @@ var ts; ts.concatenateDiagnosticMessageChains = concatenateDiagnosticMessageChains; function compareValues(a, b) { if (a === b) - return 0; + return 0 /* EqualTo */; if (a === undefined) - return -1; + return -1 /* LessThan */; if (b === undefined) - return 1; - return a < b ? -1 : 1; + return 1 /* GreaterThan */; + return a < b ? -1 /* LessThan */ : 1 /* GreaterThan */; } ts.compareValues = compareValues; function getDiagnosticFileName(diagnostic) { @@ -949,11 +1044,12 @@ var ts; compareValues(d1.length, d2.length) || compareValues(d1.code, d2.code) || compareMessageText(d1.messageText, d2.messageText) || - 0; + 0 /* EqualTo */; } ts.compareDiagnostics = compareDiagnostics; function compareMessageText(text1, text2) { while (text1 && text2) { + // We still have both chains. var string1 = typeof text1 === "string" ? text1 : text1.messageText; var string2 = typeof text2 === "string" ? text2 : text2.messageText; var res = compareValues(string1, string2); @@ -964,9 +1060,11 @@ var ts; text2 = typeof text2 === "string" ? undefined : text2.next; } if (!text1 && !text2) { - return 0; + // if the chains are done, then these messages are the same. + return 0 /* EqualTo */; } - return text1 ? 1 : -1; + // We still have one chain remaining. The shorter chain should come first. + return text1 ? 1 /* GreaterThan */ : -1 /* LessThan */; } function sortAndDeduplicateDiagnostics(diagnostics) { return deduplicateSortedDiagnostics(diagnostics.sort(compareDiagnostics)); @@ -980,7 +1078,7 @@ var ts; var previousDiagnostic = diagnostics[0]; for (var i = 1; i < diagnostics.length; i++) { var currentDiagnostic = diagnostics[i]; - var isDupe = compareDiagnostics(currentDiagnostic, previousDiagnostic) === 0; + var isDupe = compareDiagnostics(currentDiagnostic, previousDiagnostic) === 0 /* EqualTo */; if (!isDupe) { newDiagnostics.push(currentDiagnostic); previousDiagnostic = currentDiagnostic; @@ -993,9 +1091,10 @@ var ts; return path.replace(/\\/g, "/"); } ts.normalizeSlashes = normalizeSlashes; + // Returns length of path root (i.e. length of "/", "x:/", "//server/share/, file:///user/files") function getRootLength(path) { - if (path.charCodeAt(0) === 47) { - if (path.charCodeAt(1) !== 47) + if (path.charCodeAt(0) === 47 /* slash */) { + if (path.charCodeAt(1) !== 47 /* slash */) return 1; var p1 = path.indexOf("/", 2); if (p1 < 0) @@ -1005,11 +1104,14 @@ var ts; return p1 + 1; return p2 + 1; } - if (path.charCodeAt(1) === 58) { - if (path.charCodeAt(2) === 47) + if (path.charCodeAt(1) === 58 /* colon */) { + if (path.charCodeAt(2) === 47 /* slash */) return 3; return 2; } + var idx = path.indexOf('://'); + if (idx !== -1) + return idx + 3; return 0; } ts.getRootLength = getRootLength; @@ -1024,6 +1126,8 @@ var ts; normalized.pop(); } else { + // A part may be an empty string (which is 'falsy') if the path had consecutive slashes, + // e.g. "path//file.ts". Drop these before re-joining the parts. if (part) { normalized.push(part); } @@ -1059,6 +1163,7 @@ var ts; path = normalizeSlashes(path); var rootLength = getRootLength(path); if (rootLength == 0) { + // If the path is not rooted it is relative to current directory path = combinePaths(normalizeSlashes(currentDirectory), path); rootLength = getRootLength(path); } @@ -1080,24 +1185,36 @@ var ts; // In this example the root is: http://www.website.com/ // normalized path components should be ["http://www.website.com/", "folder1", "folder2"] var urlLength = url.length; + // Initial root length is http:// part var rootLength = url.indexOf("://") + "://".length; while (rootLength < urlLength) { - if (url.charCodeAt(rootLength) === 47) { + // Consume all immediate slashes in the protocol + // eg.initial rootlength is just file:// but it needs to consume another "/" in file:/// + if (url.charCodeAt(rootLength) === 47 /* slash */) { rootLength++; } else { + // non slash character means we continue proceeding to next component of root search break; } } + // there are no parts after http:// just return current string as the pathComponent if (rootLength === urlLength) { return [url]; } + // Find the index of "/" after website.com so the root can be http://www.website.com/ (from existing http://) var indexOfNextSlash = url.indexOf(ts.directorySeparator, rootLength); if (indexOfNextSlash !== -1) { + // Found the "/" after the website.com so the root is length of http://www.website.com/ + // and get components afetr the root normally like any other folder components rootLength = indexOfNextSlash + 1; return normalizedPathComponents(url, rootLength); } else { + // Can't find the host assume the rest of the string as component + // but make sure we append "/" to it as root is not joined using "/" + // eg. if url passed in was http://website.com we want to use root as [http://website.com/] + // so that other path manipulations will be correct and it can be merged with relative paths correctly return [url + ts.directorySeparator]; } } @@ -1113,13 +1230,17 @@ var ts; var pathComponents = getNormalizedPathOrUrlComponents(relativeOrAbsolutePath, currentDirectory); var directoryComponents = getNormalizedPathOrUrlComponents(directoryPathOrUrl, currentDirectory); if (directoryComponents.length > 1 && directoryComponents[directoryComponents.length - 1] === "") { + // If the directory path given was of type test/cases/ then we really need components of directory to be only till its name + // that is ["test", "cases", ""] needs to be actually ["test", "cases"] directoryComponents.length--; } + // Find the component that differs for (var joinStartIndex = 0; joinStartIndex < pathComponents.length && joinStartIndex < directoryComponents.length; joinStartIndex++) { if (getCanonicalFileName(directoryComponents[joinStartIndex]) !== getCanonicalFileName(pathComponents[joinStartIndex])) { break; } } + // Get the relative path if (joinStartIndex) { var relativePath = ""; var relativePathComponents = pathComponents.slice(joinStartIndex, pathComponents.length); @@ -1130,6 +1251,7 @@ var ts; } return relativePath + relativePathComponents.join(ts.directorySeparator); } + // Cant find the relative path, get the absolute path var absolutePath = getNormalizedPathFromPathComponents(pathComponents); if (isAbsolutePathAnUrl && isRootedDiskPath(absolutePath)) { absolutePath = "file:///" + absolutePath; @@ -1185,12 +1307,8 @@ var ts; "\"": "\\\"", "\u2028": "\\u2028", "\u2029": "\\u2029", - "\u0085": "\\u0085" + "\u0085": "\\u0085" // nextLine }; - function getDefaultLibFileName(options) { - return options.target === 2 ? "lib.es6.d.ts" : "lib.d.ts"; - } - ts.getDefaultLibFileName = getDefaultLibFileName; function Symbol(flags, name) { this.flags = flags; this.name = name; @@ -1227,7 +1345,7 @@ var ts; var AssertionLevel = ts.AssertionLevel; var Debug; (function (Debug) { - var currentAssertionLevel = 0; + var currentAssertionLevel = 0 /* None */; function shouldAssert(level) { return currentAssertionLevel >= level; } @@ -1255,9 +1373,9 @@ var ts; function getWScriptSystem() { var fso = new ActiveXObject("Scripting.FileSystemObject"); var fileStream = new ActiveXObject("ADODB.Stream"); - fileStream.Type = 2; + fileStream.Type = 2 /*text*/; var binaryStream = new ActiveXObject("ADODB.Stream"); - binaryStream.Type = 1; + binaryStream.Type = 1 /*binary*/; var args = []; for (var i = 0; i < WScript.Arguments.length; i++) { args[i] = WScript.Arguments.Item(i); @@ -1273,12 +1391,16 @@ var ts; fileStream.LoadFromFile(fileName); } else { + // Load file and read the first two bytes into a string with no interpretation fileStream.Charset = "x-ansi"; fileStream.LoadFromFile(fileName); var bom = fileStream.ReadText(2) || ""; + // Position must be at 0 before encoding can be changed fileStream.Position = 0; + // [0xFF,0xFE] and [0xFE,0xFF] mean utf-16 (little or big endian), otherwise default to utf-8 fileStream.Charset = bom.length >= 2 && (bom.charCodeAt(0) === 0xFF && bom.charCodeAt(1) === 0xFE || bom.charCodeAt(0) === 0xFE && bom.charCodeAt(1) === 0xFF) ? "unicode" : "utf-8"; } + // ReadText method always strips byte order mark from resulting string return fileStream.ReadText(); } catch (e) { @@ -1292,8 +1414,11 @@ var ts; fileStream.Open(); binaryStream.Open(); try { + // Write characters in UTF-8 encoding fileStream.Charset = "utf-8"; fileStream.WriteText(data); + // If we don't want the BOM, then skip it by setting the starting location to 3 (size of BOM). + // If not, start from position 0, as the BOM will be added automatically when charset==utf8. if (writeByteOrderMark) { fileStream.Position = 0; } @@ -1301,7 +1426,7 @@ var ts; fileStream.Position = 3; } fileStream.CopyTo(binaryStream); - binaryStream.SaveToFile(fileName, 2); + binaryStream.SaveToFile(fileName, 2 /*overwrite*/); } finally { binaryStream.Close(); @@ -1379,6 +1504,7 @@ var ts; var _path = require("path"); var _os = require('os'); var platform = _os.platform(); + // win32\win64 are case insensitive platforms, MacOS (darwin) by default is also case insensitive var useCaseSensitiveFileNames = platform !== "win32" && platform !== "win64" && platform !== "darwin"; function readFile(fileName, encoding) { if (!_fs.existsSync(fileName)) { @@ -1387,6 +1513,8 @@ var ts; var buffer = _fs.readFileSync(fileName); var len = buffer.length; if (len >= 2 && buffer[0] === 0xFE && buffer[1] === 0xFF) { + // Big endian UTF-16 byte order mark detected. Since big endian is not supported by node.js, + // flip all byte pairs and treat as little endian. len &= ~1; for (var i = 0; i < len; i += 2) { var temp = buffer[i]; @@ -1396,14 +1524,18 @@ var ts; return buffer.toString("utf16le", 2); } if (len >= 2 && buffer[0] === 0xFF && buffer[1] === 0xFE) { + // Little endian UTF-16 byte order mark detected return buffer.toString("utf16le", 2); } if (len >= 3 && buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) { + // UTF-8 byte order mark detected return buffer.toString("utf8", 3); } + // Default is UTF-8 with no byte order mark return buffer.toString("utf8"); } function writeFile(fileName, data, writeByteOrderMark) { + // If a BOM is required, emit one if (writeByteOrderMark) { data = '\uFEFF' + data; } @@ -1440,11 +1572,13 @@ var ts; newLine: _os.EOL, useCaseSensitiveFileNames: useCaseSensitiveFileNames, write: function (s) { + // 1 is a standard descriptor for stdout _fs.writeSync(1, s); }, readFile: readFile, writeFile: writeFile, watchFile: function (fileName, callback) { + // watchFile polls a file every 250ms, picking up file notifications. _fs.watchFile(fileName, { persistent: true, interval: 250 }, fileChanged); return { close: function () { _fs.unwatchFile(fileName, fileChanged); } @@ -1496,11 +1630,13 @@ var ts; return getNodeSystem(); } else { - return undefined; + return undefined; // Unsupported host } })(); })(ts || (ts = {})); +// /// +/* @internal */ var ts; (function (ts) { ts.Diagnostics = { @@ -1660,7 +1796,6 @@ var ts; 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." }, @@ -1669,6 +1804,14 @@ var ts; 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." }, + Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: ts.DiagnosticCategory.Error, key: "Invalid use of '{0}'. Class definitions are automatically in strict mode." }, + A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A class declaration without the 'default' modifier must have a name" }, + Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode" }, + Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1213, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, + Identifier_expected_0_is_a_reserved_word_in_strict_mode_External_Module_is_automatically_in_strict_mode: { code: 1214, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. External Module is automatically in strict mode." }, + Type_expected_0_is_a_reserved_word_in_strict_mode: { code: 1215, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode" }, + Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1216, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, + Type_expected_0_is_a_reserved_word_in_strict_mode_Module_is_automatically_in_strict_mode: { code: 1217, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Module is automatically in strict mode." }, 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." }, @@ -1844,19 +1987,20 @@ var ts; 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." }, + Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: ts.DiagnosticCategory.Error, key: "Type must have a '[Symbol.iterator]()' method that returns an iterator." }, + An_iterator_must_have_a_next_method: { code: 2489, category: ts.DiagnosticCategory.Error, key: "An iterator 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." }, + The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression: { code: 2496, category: ts.DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression." }, External_module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct: { code: 2497, category: ts.DiagnosticCategory.Error, key: "External module '{0}' resolves to a non-module entity and cannot be imported using this construct." }, External_module_0_uses_export_and_cannot_be_used_with_export_Asterisk: { code: 2498, category: ts.DiagnosticCategory.Error, key: "External module '{0}' uses 'export =' and cannot be used with 'export *'." }, An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments: { code: 2499, category: ts.DiagnosticCategory.Error, key: "An interface can only extend an identifier/qualified-name with optional type arguments." }, A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments: { code: 2500, category: ts.DiagnosticCategory.Error, key: "A class can only implement an identifier/qualified-name with optional type arguments." }, + A_rest_element_cannot_contain_a_binding_pattern: { code: 2501, category: ts.DiagnosticCategory.Error, key: "A rest element cannot contain a binding pattern." }, 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}'." }, @@ -2007,6 +2151,22 @@ var 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: 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." }, + import_can_only_be_used_in_a_ts_file: { code: 8002, category: ts.DiagnosticCategory.Error, key: "'import ... =' can only be used in a .ts file." }, + export_can_only_be_used_in_a_ts_file: { code: 8003, category: ts.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: ts.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: ts.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: ts.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: ts.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: ts.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: ts.DiagnosticCategory.Error, key: "'{0}' can only be used in a .ts file." }, + types_can_only_be_used_in_a_ts_file: { code: 8010, category: ts.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: ts.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: ts.DiagnosticCategory.Error, key: "'parameter modifiers' can only be used in a .ts file." }, + can_only_be_used_in_a_ts_file: { code: 8013, category: ts.DiagnosticCategory.Error, key: "'?' can only be used in a .ts file." }, + property_declarations_can_only_be_used_in_a_ts_file: { code: 8014, category: ts.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: ts.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: ts.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: ts.DiagnosticCategory.Error, key: "'decorators' can only be used in a .ts file." }, 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." }, @@ -2019,131 +2179,176 @@ var ts; var ts; (function (ts) { var textToToken = { - "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, - ")": 17, - "[": 18, - "]": 19, - ".": 20, - "...": 21, - ";": 22, - ",": 23, - "<": 24, - ">": 25, - "<=": 26, - ">=": 27, - "==": 28, - "!=": 29, - "===": 30, - "!==": 31, - "=>": 32, - "+": 33, - "-": 34, - "*": 35, - "/": 36, - "%": 37, - "++": 38, - "--": 39, - "<<": 40, - ">>": 41, - ">>>": 42, - "&": 43, - "|": 44, - "^": 45, - "!": 46, - "~": 47, - "&&": 48, - "||": 49, - "?": 50, - ":": 51, - "=": 53, - "+=": 54, - "-=": 55, - "*=": 56, - "/=": 57, - "%=": 58, - "<<=": 59, - ">>=": 60, - ">>>=": 61, - "&=": 62, - "|=": 63, - "^=": 64, - "@": 52 + "any": 112 /* AnyKeyword */, + "as": 111 /* AsKeyword */, + "boolean": 113 /* BooleanKeyword */, + "break": 66 /* BreakKeyword */, + "case": 67 /* CaseKeyword */, + "catch": 68 /* CatchKeyword */, + "class": 69 /* ClassKeyword */, + "continue": 71 /* ContinueKeyword */, + "const": 70 /* ConstKeyword */, + "constructor": 114 /* ConstructorKeyword */, + "debugger": 72 /* DebuggerKeyword */, + "declare": 115 /* DeclareKeyword */, + "default": 73 /* DefaultKeyword */, + "delete": 74 /* DeleteKeyword */, + "do": 75 /* DoKeyword */, + "else": 76 /* ElseKeyword */, + "enum": 77 /* EnumKeyword */, + "export": 78 /* ExportKeyword */, + "extends": 79 /* ExtendsKeyword */, + "false": 80 /* FalseKeyword */, + "finally": 81 /* FinallyKeyword */, + "for": 82 /* ForKeyword */, + "from": 124 /* FromKeyword */, + "function": 83 /* FunctionKeyword */, + "get": 116 /* GetKeyword */, + "if": 84 /* IfKeyword */, + "implements": 102 /* ImplementsKeyword */, + "import": 85 /* ImportKeyword */, + "in": 86 /* InKeyword */, + "instanceof": 87 /* InstanceOfKeyword */, + "interface": 103 /* InterfaceKeyword */, + "let": 104 /* LetKeyword */, + "module": 117 /* ModuleKeyword */, + "new": 88 /* NewKeyword */, + "null": 89 /* NullKeyword */, + "number": 119 /* NumberKeyword */, + "package": 105 /* PackageKeyword */, + "private": 106 /* PrivateKeyword */, + "protected": 107 /* ProtectedKeyword */, + "public": 108 /* PublicKeyword */, + "require": 118 /* RequireKeyword */, + "return": 90 /* ReturnKeyword */, + "set": 120 /* SetKeyword */, + "static": 109 /* StaticKeyword */, + "string": 121 /* StringKeyword */, + "super": 91 /* SuperKeyword */, + "switch": 92 /* SwitchKeyword */, + "symbol": 122 /* SymbolKeyword */, + "this": 93 /* ThisKeyword */, + "throw": 94 /* ThrowKeyword */, + "true": 95 /* TrueKeyword */, + "try": 96 /* TryKeyword */, + "type": 123 /* TypeKeyword */, + "typeof": 97 /* TypeOfKeyword */, + "var": 98 /* VarKeyword */, + "void": 99 /* VoidKeyword */, + "while": 100 /* WhileKeyword */, + "with": 101 /* WithKeyword */, + "yield": 110 /* YieldKeyword */, + "of": 125 /* OfKeyword */, + "{": 14 /* OpenBraceToken */, + "}": 15 /* CloseBraceToken */, + "(": 16 /* OpenParenToken */, + ")": 17 /* CloseParenToken */, + "[": 18 /* OpenBracketToken */, + "]": 19 /* CloseBracketToken */, + ".": 20 /* DotToken */, + "...": 21 /* DotDotDotToken */, + ";": 22 /* SemicolonToken */, + ",": 23 /* CommaToken */, + "<": 24 /* LessThanToken */, + ">": 25 /* GreaterThanToken */, + "<=": 26 /* LessThanEqualsToken */, + ">=": 27 /* GreaterThanEqualsToken */, + "==": 28 /* EqualsEqualsToken */, + "!=": 29 /* ExclamationEqualsToken */, + "===": 30 /* EqualsEqualsEqualsToken */, + "!==": 31 /* ExclamationEqualsEqualsToken */, + "=>": 32 /* EqualsGreaterThanToken */, + "+": 33 /* PlusToken */, + "-": 34 /* MinusToken */, + "*": 35 /* AsteriskToken */, + "/": 36 /* SlashToken */, + "%": 37 /* PercentToken */, + "++": 38 /* PlusPlusToken */, + "--": 39 /* MinusMinusToken */, + "<<": 40 /* LessThanLessThanToken */, + ">>": 41 /* GreaterThanGreaterThanToken */, + ">>>": 42 /* GreaterThanGreaterThanGreaterThanToken */, + "&": 43 /* AmpersandToken */, + "|": 44 /* BarToken */, + "^": 45 /* CaretToken */, + "!": 46 /* ExclamationToken */, + "~": 47 /* TildeToken */, + "&&": 48 /* AmpersandAmpersandToken */, + "||": 49 /* BarBarToken */, + "?": 50 /* QuestionToken */, + ":": 51 /* ColonToken */, + "=": 53 /* EqualsToken */, + "+=": 54 /* PlusEqualsToken */, + "-=": 55 /* MinusEqualsToken */, + "*=": 56 /* AsteriskEqualsToken */, + "/=": 57 /* SlashEqualsToken */, + "%=": 58 /* PercentEqualsToken */, + "<<=": 59 /* LessThanLessThanEqualsToken */, + ">>=": 60 /* GreaterThanGreaterThanEqualsToken */, + ">>>=": 61 /* GreaterThanGreaterThanGreaterThanEqualsToken */, + "&=": 62 /* AmpersandEqualsToken */, + "|=": 63 /* BarEqualsToken */, + "^=": 64 /* CaretEqualsToken */, + "@": 52 /* AtToken */ }; + /* + As per ECMAScript Language Specification 3th Edition, Section 7.6: Identifiers + IdentifierStart :: + Can contain Unicode 3.0.0 categories: + Uppercase letter (Lu), + Lowercase letter (Ll), + Titlecase letter (Lt), + Modifier letter (Lm), + Other letter (Lo), or + Letter number (Nl). + IdentifierPart :: = + Can contain IdentifierStart + Unicode 3.0.0 categories: + Non-spacing mark (Mn), + Combining spacing mark (Mc), + Decimal number (Nd), or + Connector punctuation (Pc). + + Codepoint ranges for ES3 Identifiers are extracted from the Unicode 3.0.0 specification at: + http://www.unicode.org/Public/3.0-Update/UnicodeData-3.0.0.txt + */ 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,]; + /* + As per ECMAScript Language Specification 5th Edition, Section 7.6: ISyntaxToken Names and Identifiers + IdentifierStart :: + Can contain Unicode 6.2 categories: + Uppercase letter (Lu), + Lowercase letter (Ll), + Titlecase letter (Lt), + Modifier letter (Lm), + Other letter (Lo), or + Letter number (Nl). + IdentifierPart :: + Can contain IdentifierStart + Unicode 6.2 categories: + Non-spacing mark (Mn), + Combining spacing mark (Mc), + Decimal number (Nd), + Connector punctuation (Pc), + , or + . + + Codepoint ranges for ES5 Identifiers are extracted from the Unicode 6.2 specification at: + http://www.unicode.org/Public/6.2.0/ucd/UnicodeData.txt + */ 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) { + // Bail out quickly if it couldn't possibly be in the map. if (code < map[0]) { return false; } + // Perform binary search in one of the Unicode range maps var lo = 0; var hi = map.length; var mid; while (lo + 1 < hi) { mid = lo + (hi - lo) / 2; + // mid has to be even to catch a range's beginning mid -= mid % 2; if (map[mid] <= code && code <= map[mid + 1]) { return true; @@ -2157,14 +2362,14 @@ var ts; } return false; } - function isUnicodeIdentifierStart(code, languageVersion) { - return languageVersion >= 1 ? + /* @internal */ function isUnicodeIdentifierStart(code, languageVersion) { + return languageVersion >= 1 /* ES5 */ ? lookupInUnicodeMap(code, unicodeES5IdentifierStart) : lookupInUnicodeMap(code, unicodeES3IdentifierStart); } ts.isUnicodeIdentifierStart = isUnicodeIdentifierStart; function isUnicodeIdentifierPart(code, languageVersion) { - return languageVersion >= 1 ? + return languageVersion >= 1 /* ES5 */ ? lookupInUnicodeMap(code, unicodeES5IdentifierPart) : lookupInUnicodeMap(code, unicodeES3IdentifierPart); } @@ -2182,10 +2387,12 @@ var ts; return tokenStrings[t]; } ts.tokenToString = tokenToString; + /* @internal */ function stringToToken(s) { return textToToken[s]; } ts.stringToToken = stringToToken; + /* @internal */ function computeLineStarts(text) { var result = new Array(); var pos = 0; @@ -2193,16 +2400,16 @@ var ts; while (pos < text.length) { var ch = text.charCodeAt(pos++); switch (ch) { - case 13: - if (text.charCodeAt(pos) === 10) { + case 13 /* carriageReturn */: + if (text.charCodeAt(pos) === 10 /* lineFeed */) { pos++; } - case 10: + case 10 /* lineFeed */: result.push(lineStart); lineStart = pos; break; default: - if (ch > 127 && isLineBreak(ch)) { + if (ch > 127 /* maxAsciiCharacter */ && isLineBreak(ch)) { result.push(lineStart); lineStart = pos; } @@ -2217,18 +2424,25 @@ var ts; return computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character); } ts.getPositionOfLineAndCharacter = getPositionOfLineAndCharacter; + /* @internal */ function computePositionOfLineAndCharacter(lineStarts, line, character) { ts.Debug.assert(line >= 0 && line < lineStarts.length); return lineStarts[line] + character; } ts.computePositionOfLineAndCharacter = computePositionOfLineAndCharacter; + /* @internal */ function getLineStarts(sourceFile) { return sourceFile.lineMap || (sourceFile.lineMap = computeLineStarts(sourceFile.text)); } ts.getLineStarts = getLineStarts; + /* @internal */ function computeLineAndCharacterOfPosition(lineStarts, position) { var lineNumber = ts.binarySearch(lineStarts, position); if (lineNumber < 0) { + // If the actual position was not found, + // the binary search returns the negative value of the next line start + // e.g. if the line starts at [5, 10, 23, 80] and the position requested was 20 + // then the search will return -2 lineNumber = ~lineNumber - 1; } return { @@ -2243,18 +2457,20 @@ 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 === 133 || - ch === 5760 || - ch >= 8192 && ch <= 8203 || - ch === 8239 || - ch === 8287 || - ch === 12288 || - ch === 65279; + // Note: nextLine is in the Zs space, and should be considered to be a whitespace. + // It is explicitly not a line-break as it isn't in the exact set specified by EcmaScript. + return ch === 32 /* space */ || + ch === 9 /* tab */ || + ch === 11 /* verticalTab */ || + ch === 12 /* formFeed */ || + ch === 160 /* nonBreakingSpace */ || + ch === 133 /* nextLine */ || + ch === 5760 /* ogham */ || + ch >= 8192 /* enQuad */ && ch <= 8203 /* zeroWidthSpace */ || + ch === 8239 /* narrowNoBreakSpace */ || + ch === 8287 /* mathematicalSpace */ || + ch === 12288 /* ideographicSpace */ || + ch === 65279 /* byteOrderMark */; } ts.isWhiteSpace = isWhiteSpace; function isLineBreak(ch) { @@ -2268,41 +2484,43 @@ var ts; // \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; + return ch === 10 /* lineFeed */ || + ch === 13 /* carriageReturn */ || + ch === 8232 /* lineSeparator */ || + ch === 8233 /* paragraphSeparator */; } ts.isLineBreak = isLineBreak; function isDigit(ch) { - return ch >= 48 && ch <= 57; + return ch >= 48 /* _0 */ && ch <= 57 /* _9 */; } + /* @internal */ function isOctalDigit(ch) { - return ch >= 48 && ch <= 55; + return ch >= 48 /* _0 */ && ch <= 55 /* _7 */; } ts.isOctalDigit = isOctalDigit; + /* @internal */ function skipTrivia(text, pos, stopAfterLineBreak) { while (true) { var ch = text.charCodeAt(pos); switch (ch) { - case 13: - if (text.charCodeAt(pos + 1) === 10) { + case 13 /* carriageReturn */: + if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) { pos++; } - case 10: + case 10 /* lineFeed */: pos++; if (stopAfterLineBreak) { return pos; } continue; - case 9: - case 11: - case 12: - case 32: + case 9 /* tab */: + case 11 /* verticalTab */: + case 12 /* formFeed */: + case 32 /* space */: pos++; continue; - case 47: - if (text.charCodeAt(pos + 1) === 47) { + case 47 /* slash */: + if (text.charCodeAt(pos + 1) === 47 /* slash */) { pos += 2; while (pos < text.length) { if (isLineBreak(text.charCodeAt(pos))) { @@ -2312,10 +2530,10 @@ var ts; } continue; } - if (text.charCodeAt(pos + 1) === 42) { + if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { pos += 2; while (pos < text.length) { - if (text.charCodeAt(pos) === 42 && text.charCodeAt(pos + 1) === 47) { + if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { pos += 2; break; } @@ -2324,16 +2542,16 @@ var ts; continue; } break; - case 60: - case 61: - case 62: + case 60 /* lessThan */: + case 61 /* equals */: + case 62 /* greaterThan */: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos); continue; } break; default: - if (ch > 127 && (isWhiteSpace(ch) || isLineBreak(ch))) { + if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpace(ch) || isLineBreak(ch))) { pos++; continue; } @@ -2343,9 +2561,12 @@ var ts; } } ts.skipTrivia = skipTrivia; + // All conflict markers consist of the same character repeated seven times. If it is + // a <<<<<<< or >>>>>>> marker then it is also followd by a space. var mergeConflictMarkerLength = "<<<<<<<".length; function isConflictMarkerTrivia(text, pos) { ts.Debug.assert(pos >= 0); + // Conflict markers must be at the start of a line. if (pos === 0 || isLineBreak(text.charCodeAt(pos - 1))) { var ch = text.charCodeAt(pos); if ((pos + mergeConflictMarkerLength) < text.length) { @@ -2354,8 +2575,8 @@ var ts; return false; } } - return ch === 61 || - text.charCodeAt(pos + mergeConflictMarkerLength) === 32; + return ch === 61 /* equals */ || + text.charCodeAt(pos + mergeConflictMarkerLength) === 32 /* space */; } } return false; @@ -2366,16 +2587,18 @@ var ts; } var ch = text.charCodeAt(pos); var len = text.length; - if (ch === 60 || ch === 62) { + if (ch === 60 /* lessThan */ || ch === 62 /* greaterThan */) { while (pos < len && !isLineBreak(text.charCodeAt(pos))) { pos++; } } else { - ts.Debug.assert(ch === 61); + ts.Debug.assert(ch === 61 /* equals */); + // Consume everything from the start of the mid-conlict marker to the start of the next + // end-conflict marker. while (pos < len) { var ch_1 = text.charCodeAt(pos); - if (ch_1 === 62 && isConflictMarkerTrivia(text, pos)) { + if (ch_1 === 62 /* greaterThan */ && isConflictMarkerTrivia(text, pos)) { break; } pos++; @@ -2383,17 +2606,24 @@ var ts; } return pos; } + // Extract comments from the given source text starting at the given position. If trailing is + // false, whitespace is skipped until the first line break and comments between that location + // and the next token are returned.If trailing is true, comments occurring between the given + // position and the next line break are returned.The return value is an array containing a + // TextRange for each comment. Single-line comment ranges include the beginning '//' characters + // but not the ending line break. Multi - line comment ranges include the beginning '/* and + // ending '*/' characters.The return value is undefined if no comments were found. function getCommentRanges(text, pos, trailing) { var result; var collecting = trailing || pos === 0; while (true) { var ch = text.charCodeAt(pos); switch (ch) { - case 13: - if (text.charCodeAt(pos + 1) === 10) { + case 13 /* carriageReturn */: + if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) { pos++; } - case 10: + case 10 /* lineFeed */: pos++; if (trailing) { return result; @@ -2403,19 +2633,20 @@ var ts; result[result.length - 1].hasTrailingNewLine = true; } continue; - case 9: - case 11: - case 12: - case 32: + case 9 /* tab */: + case 11 /* verticalTab */: + case 12 /* formFeed */: + case 32 /* space */: pos++; continue; - case 47: + case 47 /* slash */: var nextChar = text.charCodeAt(pos + 1); var hasTrailingNewLine = false; - if (nextChar === 47 || nextChar === 42) { + if (nextChar === 47 /* slash */ || nextChar === 42 /* asterisk */) { + var kind = nextChar === 47 /* slash */ ? 2 /* SingleLineCommentTrivia */ : 3 /* MultiLineCommentTrivia */; var startPos = pos; pos += 2; - if (nextChar === 47) { + if (nextChar === 47 /* slash */) { while (pos < text.length) { if (isLineBreak(text.charCodeAt(pos))) { hasTrailingNewLine = true; @@ -2426,7 +2657,7 @@ var ts; } else { while (pos < text.length) { - if (text.charCodeAt(pos) === 42 && text.charCodeAt(pos + 1) === 47) { + if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { pos += 2; break; } @@ -2437,13 +2668,13 @@ var ts; if (!result) { result = []; } - result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine }); + result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine, kind: kind }); } continue; } break; default: - if (ch > 127 && (isWhiteSpace(ch) || isLineBreak(ch))) { + if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpace(ch) || isLineBreak(ch))) { if (result && result.length && isLineBreak(ch)) { result[result.length - 1].hasTrailingNewLine = true; } @@ -2464,55 +2695,81 @@ 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 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || + ch === 36 /* $ */ || ch === 95 /* _ */ || + ch > 127 /* maxAsciiCharacter */ && 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 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || + ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || + ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); } ts.isIdentifierPart = isIdentifierPart; - function createScanner(languageVersion, skipTrivia, text, onError) { - var pos; - var len; - var startPos; - var tokenPos; + // Creates a scanner over a (possibly unspecified) range of a piece of text. + /* @internal */ + function createScanner(languageVersion, skipTrivia, text, onError, start, length) { + var pos; // Current position (end position of text of current token) + var end; // end of text + var startPos; // Start position of whitespace before current token + var tokenPos; // Start position of text of current token var token; var tokenValue; var precedingLineBreak; var hasExtendedUnicodeEscape; var tokenIsUnterminated; + setText(text, start, length); + 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 === 65 /* Identifier */ || token > 101 /* LastReservedWord */; }, + isReservedWord: function () { return token >= 66 /* FirstReservedWord */ && token <= 101 /* LastReservedWord */; }, + isUnterminated: function () { return tokenIsUnterminated; }, + reScanGreaterToken: reScanGreaterToken, + reScanSlashToken: reScanSlashToken, + reScanTemplateToken: reScanTemplateToken, + scan: scan, + setText: setText, + setScriptTarget: setScriptTarget, + setOnError: setOnError, + setTextPos: setTextPos, + tryScan: tryScan, + lookAhead: lookAhead + }; function error(message, length) { if (onError) { onError(message, length || 0); } } function isIdentifierStart(ch) { - return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || - ch === 36 || ch === 95 || - ch > 127 && isUnicodeIdentifierStart(ch, languageVersion); + return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || + ch === 36 /* $ */ || ch === 95 /* _ */ || + ch > 127 /* maxAsciiCharacter */ && 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 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || + ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || + ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); } function scanNumber() { var start = pos; while (isDigit(text.charCodeAt(pos))) pos++; - if (text.charCodeAt(pos) === 46) { + if (text.charCodeAt(pos) === 46 /* dot */) { pos++; while (isDigit(text.charCodeAt(pos))) pos++; } var end = pos; - if (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101) { + if (text.charCodeAt(pos) === 69 /* E */ || text.charCodeAt(pos) === 101 /* e */) { pos++; - if (text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) + if (text.charCodeAt(pos) === 43 /* plus */ || text.charCodeAt(pos) === 45 /* minus */) pos++; if (isDigit(text.charCodeAt(pos))) { pos++; @@ -2533,9 +2790,17 @@ var ts; } return +(text.substring(start, pos)); } + /** + * Scans the given number of hexadecimal digits in the text, + * returning -1 if the given number is unavailable. + */ function scanExactNumberOfHexDigits(count) { return scanHexDigits(count, false); } + /** + * Scans as many hexadecimal digits as are available in the text, + * returning -1 if the given number of digits was unavailable. + */ function scanMinimumNumberOfHexDigits(count) { return scanHexDigits(count, true); } @@ -2544,14 +2809,14 @@ var ts; var value = 0; while (digits < minCount || scanAsManyAsPossible) { var ch = text.charCodeAt(pos); - if (ch >= 48 && ch <= 57) { - value = value * 16 + ch - 48; + if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) { + value = value * 16 + ch - 48 /* _0 */; } - else if (ch >= 65 && ch <= 70) { - value = value * 16 + ch - 65 + 10; + else if (ch >= 65 /* A */ && ch <= 70 /* F */) { + value = value * 16 + ch - 65 /* A */ + 10; } - else if (ch >= 97 && ch <= 102) { - value = value * 16 + ch - 97 + 10; + else if (ch >= 97 /* a */ && ch <= 102 /* f */) { + value = value * 16 + ch - 97 /* a */ + 10; } else { break; @@ -2569,7 +2834,7 @@ var ts; var result = ""; var start = pos; while (true) { - if (pos >= len) { + if (pos >= end) { result += text.substring(start, pos); tokenIsUnterminated = true; error(ts.Diagnostics.Unterminated_string_literal); @@ -2581,7 +2846,7 @@ var ts; pos++; break; } - if (ch === 92) { + if (ch === 92 /* backslash */) { result += text.substring(start, pos); result += scanEscapeSequence(); start = pos; @@ -2597,43 +2862,52 @@ var ts; } return result; } + /** + * Sets the current 'tokenValue' and returns a NoSubstitutionTemplateLiteral or + * a literal component of a TemplateExpression. + */ function scanTemplateAndSetTokenValue() { - var startedWithBacktick = text.charCodeAt(pos) === 96; + var startedWithBacktick = text.charCodeAt(pos) === 96 /* backtick */; pos++; var start = pos; var contents = ""; var resultingToken; while (true) { - if (pos >= len) { + if (pos >= end) { contents += text.substring(start, pos); tokenIsUnterminated = true; error(ts.Diagnostics.Unterminated_template_literal); - resultingToken = startedWithBacktick ? 10 : 13; + resultingToken = startedWithBacktick ? 10 /* NoSubstitutionTemplateLiteral */ : 13 /* TemplateTail */; break; } var currChar = text.charCodeAt(pos); - if (currChar === 96) { + // '`' + if (currChar === 96 /* backtick */) { contents += text.substring(start, pos); pos++; - resultingToken = startedWithBacktick ? 10 : 13; + resultingToken = startedWithBacktick ? 10 /* NoSubstitutionTemplateLiteral */ : 13 /* TemplateTail */; break; } - if (currChar === 36 && pos + 1 < len && text.charCodeAt(pos + 1) === 123) { + // '${' + if (currChar === 36 /* $ */ && pos + 1 < end && text.charCodeAt(pos + 1) === 123 /* openBrace */) { contents += text.substring(start, pos); pos += 2; - resultingToken = startedWithBacktick ? 11 : 12; + resultingToken = startedWithBacktick ? 11 /* TemplateHead */ : 12 /* TemplateMiddle */; break; } - if (currChar === 92) { + // Escape character + if (currChar === 92 /* backslash */) { contents += text.substring(start, pos); contents += scanEscapeSequence(); start = pos; continue; } - if (currChar === 13) { + // Speculated ECMAScript 6 Spec 11.8.6.1: + // and LineTerminatorSequences are normalized to for Template Values + if (currChar === 13 /* carriageReturn */) { contents += text.substring(start, pos); pos++; - if (pos < len && text.charCodeAt(pos) === 10) { + if (pos < end && text.charCodeAt(pos) === 10 /* lineFeed */) { pos++; } contents += "\n"; @@ -2648,46 +2922,52 @@ var ts; } function scanEscapeSequence() { pos++; - if (pos >= len) { + if (pos >= end) { error(ts.Diagnostics.Unexpected_end_of_text); return ""; } var ch = text.charCodeAt(pos++); switch (ch) { - case 48: + case 48 /* _0 */: return "\0"; - case 98: + case 98 /* b */: return "\b"; - case 116: + case 116 /* t */: return "\t"; - case 110: + case 110 /* n */: return "\n"; - case 118: + case 118 /* v */: return "\v"; - case 102: + case 102 /* f */: return "\f"; - case 114: + case 114 /* r */: return "\r"; - case 39: + case 39 /* singleQuote */: return "\'"; - case 34: + case 34 /* doubleQuote */: return "\""; - case 117: - if (pos < len && text.charCodeAt(pos) === 123) { + case 117 /* u */: + // '\u{DDDDDDDD}' + if (pos < end && text.charCodeAt(pos) === 123 /* openBrace */) { hasExtendedUnicodeEscape = true; pos++; return scanExtendedUnicodeEscape(); } + // '\uDDDD' return scanHexadecimalEscape(4); - case 120: + case 120 /* x */: + // '\xDD' return scanHexadecimalEscape(2); - case 13: - if (pos < len && text.charCodeAt(pos) === 10) { + // when encountering a LineContinuation (i.e. a backslash and a line terminator sequence), + // the line terminator is interpreted to be "the empty code unit sequence". + case 13 /* carriageReturn */: + if (pos < end && text.charCodeAt(pos) === 10 /* lineFeed */) { pos++; } - case 10: - case 8232: - case 8233: + // fall through + case 10 /* lineFeed */: + case 8232 /* lineSeparator */: + case 8233 /* paragraphSeparator */: return ""; default: return String.fromCharCode(ch); @@ -2706,6 +2986,7 @@ var ts; function scanExtendedUnicodeEscape() { var escapedValue = scanMinimumNumberOfHexDigits(1); var isInvalidExtendedEscape = false; + // Validate the value of the digit if (escapedValue < 0) { error(ts.Diagnostics.Hexadecimal_digit_expected); isInvalidExtendedEscape = true; @@ -2714,11 +2995,12 @@ var ts; error(ts.Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive); isInvalidExtendedEscape = true; } - if (pos >= len) { + if (pos >= end) { error(ts.Diagnostics.Unexpected_end_of_text); isInvalidExtendedEscape = true; } - else if (text.charCodeAt(pos) == 125) { + else if (text.charCodeAt(pos) == 125 /* closeBrace */) { + // Only swallow the following character up if it's a '}'. pos++; } else { @@ -2730,6 +3012,7 @@ var ts; } return utf16EncodeAsString(escapedValue); } + // Derived from the 10.1.1 UTF16Encoding of the ES6 Spec. function utf16EncodeAsString(codePoint) { ts.Debug.assert(0x0 <= codePoint && codePoint <= 0x10FFFF); if (codePoint <= 65535) { @@ -2739,12 +3022,14 @@ var ts; var codeUnit2 = ((codePoint - 65536) % 1024) + 0xDC00; return String.fromCharCode(codeUnit1, codeUnit2); } + // Current character is known to be a backslash. Check for Unicode escape of the form '\uXXXX' + // and return code point value if valid Unicode escape is found. Otherwise return -1. function peekUnicodeEscape() { - if (pos + 5 < len && text.charCodeAt(pos + 1) === 117) { - var start = pos; + if (pos + 5 < end && text.charCodeAt(pos + 1) === 117 /* u */) { + var start_1 = pos; pos += 2; var value = scanExactNumberOfHexDigits(4); - pos = start; + pos = start_1; return value; } return -1; @@ -2752,18 +3037,19 @@ var ts; function scanIdentifierParts() { var result = ""; var start = pos; - while (pos < len) { + while (pos < end) { var ch = text.charCodeAt(pos); if (isIdentifierPart(ch)) { pos++; } - else if (ch === 92) { + else if (ch === 92 /* backslash */) { ch = peekUnicodeEscape(); if (!(ch >= 0 && isIdentifierPart(ch))) { break; } result += text.substring(start, pos); result += String.fromCharCode(ch); + // Valid Unicode escape is always six characters pos += 6; start = pos; } @@ -2775,22 +3061,25 @@ var ts; return result; } function getIdentifierToken() { + // Reserved words are between 2 and 11 characters long and start with a lowercase letter var len = tokenValue.length; if (len >= 2 && len <= 11) { var ch = tokenValue.charCodeAt(0); - if (ch >= 97 && ch <= 122 && hasOwnProperty.call(textToToken, tokenValue)) { + if (ch >= 97 /* a */ && ch <= 122 /* z */ && hasOwnProperty.call(textToToken, tokenValue)) { return token = textToToken[tokenValue]; } } - return token = 65; + return token = 65 /* Identifier */; } function scanBinaryOrOctalDigits(base) { ts.Debug.assert(base !== 2 || base !== 8, "Expected either base 2 or base 8"); var value = 0; + // For counting number of digits; Valid binaryIntegerLiteral must have at least one binary digit following B or b. + // Similarly valid octalIntegerLiteral must have at least one octal digit following o or O. var numberOfDigits = 0; while (true) { var ch = text.charCodeAt(pos); - var valueOfCh = ch - 48; + var valueOfCh = ch - 48 /* _0 */; if (!isDigit(ch) || valueOfCh >= base) { break; } @@ -2798,6 +3087,7 @@ var ts; pos++; numberOfDigits++; } + // Invalid binaryIntegerLiteral or octalIntegerLiteral if (numberOfDigits === 0) { return -1; } @@ -2810,108 +3100,110 @@ var ts; tokenIsUnterminated = false; while (true) { tokenPos = pos; - if (pos >= len) { - return token = 1; + if (pos >= end) { + return token = 1 /* EndOfFileToken */; } var ch = text.charCodeAt(pos); switch (ch) { - case 10: - case 13: + case 10 /* lineFeed */: + case 13 /* carriageReturn */: precedingLineBreak = true; if (skipTrivia) { pos++; continue; } else { - if (ch === 13 && pos + 1 < len && text.charCodeAt(pos + 1) === 10) { + if (ch === 13 /* carriageReturn */ && pos + 1 < end && text.charCodeAt(pos + 1) === 10 /* lineFeed */) { + // consume both CR and LF pos += 2; } else { pos++; } - return token = 4; + return token = 4 /* NewLineTrivia */; } - case 9: - case 11: - case 12: - case 32: + case 9 /* tab */: + case 11 /* verticalTab */: + case 12 /* formFeed */: + case 32 /* space */: if (skipTrivia) { pos++; continue; } else { - while (pos < len && isWhiteSpace(text.charCodeAt(pos))) { + while (pos < end && isWhiteSpace(text.charCodeAt(pos))) { pos++; } - return token = 5; + return token = 5 /* WhitespaceTrivia */; } - case 33: - if (text.charCodeAt(pos + 1) === 61) { - if (text.charCodeAt(pos + 2) === 61) { - return pos += 3, token = 31; + case 33 /* exclamation */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 31 /* ExclamationEqualsEqualsToken */; } - return pos += 2, token = 29; + return pos += 2, token = 29 /* ExclamationEqualsToken */; } - return pos++, token = 46; - case 34: - case 39: + return pos++, token = 46 /* ExclamationToken */; + case 34 /* doubleQuote */: + case 39 /* singleQuote */: tokenValue = scanString(); - return token = 8; - case 96: + return token = 8 /* StringLiteral */; + case 96 /* backtick */: return token = scanTemplateAndSetTokenValue(); - case 37: - if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 58; + case 37 /* percent */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 58 /* PercentEqualsToken */; } - return pos++, token = 37; - case 38: - if (text.charCodeAt(pos + 1) === 38) { - return pos += 2, token = 48; + return pos++, token = 37 /* PercentToken */; + case 38 /* ampersand */: + if (text.charCodeAt(pos + 1) === 38 /* ampersand */) { + return pos += 2, token = 48 /* AmpersandAmpersandToken */; } - if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 62; + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 62 /* AmpersandEqualsToken */; } - return pos++, token = 43; - case 40: - return pos++, token = 16; - case 41: - return pos++, token = 17; - case 42: - if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 56; + return pos++, token = 43 /* AmpersandToken */; + case 40 /* openParen */: + return pos++, token = 16 /* OpenParenToken */; + case 41 /* closeParen */: + return pos++, token = 17 /* CloseParenToken */; + case 42 /* asterisk */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 56 /* AsteriskEqualsToken */; } - return pos++, token = 35; - case 43: - if (text.charCodeAt(pos + 1) === 43) { - return pos += 2, token = 38; + return pos++, token = 35 /* AsteriskToken */; + case 43 /* plus */: + if (text.charCodeAt(pos + 1) === 43 /* plus */) { + return pos += 2, token = 38 /* PlusPlusToken */; } - if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 54; + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 54 /* PlusEqualsToken */; } - return pos++, token = 33; - case 44: - return pos++, token = 23; - case 45: - if (text.charCodeAt(pos + 1) === 45) { - return pos += 2, token = 39; + return pos++, token = 33 /* PlusToken */; + case 44 /* comma */: + return pos++, token = 23 /* CommaToken */; + case 45 /* minus */: + if (text.charCodeAt(pos + 1) === 45 /* minus */) { + return pos += 2, token = 39 /* MinusMinusToken */; } - if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 55; + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 55 /* MinusEqualsToken */; } - return pos++, token = 34; - case 46: + return pos++, token = 34 /* MinusToken */; + case 46 /* dot */: if (isDigit(text.charCodeAt(pos + 1))) { tokenValue = "" + scanNumber(); - return token = 7; + return token = 7 /* NumericLiteral */; } - if (text.charCodeAt(pos + 1) === 46 && text.charCodeAt(pos + 2) === 46) { - return pos += 3, token = 21; + if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) { + return pos += 3, token = 21 /* DotDotDotToken */; } - return pos++, token = 20; - case 47: - if (text.charCodeAt(pos + 1) === 47) { + return pos++, token = 20 /* DotToken */; + case 47 /* slash */: + // Single-line comment + if (text.charCodeAt(pos + 1) === 47 /* slash */) { pos += 2; - while (pos < len) { + while (pos < end) { if (isLineBreak(text.charCodeAt(pos))) { break; } @@ -2921,15 +3213,16 @@ var ts; continue; } else { - return token = 2; + return token = 2 /* SingleLineCommentTrivia */; } } - if (text.charCodeAt(pos + 1) === 42) { + // Multi-line comment + if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { pos += 2; var commentClosed = false; - while (pos < len) { + while (pos < end) { var ch_2 = text.charCodeAt(pos); - if (ch_2 === 42 && text.charCodeAt(pos + 1) === 47) { + if (ch_2 === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { pos += 2; commentClosed = true; break; @@ -2947,15 +3240,15 @@ var ts; } else { tokenIsUnterminated = !commentClosed; - return token = 3; + return token = 3 /* MultiLineCommentTrivia */; } } - if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 57; + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 57 /* SlashEqualsToken */; } - return pos++, token = 36; - case 48: - if (pos + 2 < len && (text.charCodeAt(pos + 1) === 88 || text.charCodeAt(pos + 1) === 120)) { + return pos++, token = 36 /* SlashToken */; + case 48 /* _0 */: + if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 /* X */ || text.charCodeAt(pos + 1) === 120 /* x */)) { pos += 2; var value = scanMinimumNumberOfHexDigits(1); if (value < 0) { @@ -2963,9 +3256,9 @@ var ts; value = 0; } tokenValue = "" + value; - return token = 7; + return token = 7 /* NumericLiteral */; } - else if (pos + 2 < len && (text.charCodeAt(pos + 1) === 66 || text.charCodeAt(pos + 1) === 98)) { + else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 66 /* B */ || text.charCodeAt(pos + 1) === 98 /* b */)) { pos += 2; var value = scanBinaryOrOctalDigits(2); if (value < 0) { @@ -2973,9 +3266,9 @@ var ts; value = 0; } tokenValue = "" + value; - return token = 7; + return token = 7 /* NumericLiteral */; } - else if (pos + 2 < len && (text.charCodeAt(pos + 1) === 79 || text.charCodeAt(pos + 1) === 111)) { + else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 79 /* O */ || text.charCodeAt(pos + 1) === 111 /* o */)) { pos += 2; var value = scanBinaryOrOctalDigits(8); if (value < 0) { @@ -2983,106 +3276,110 @@ var ts; value = 0; } tokenValue = "" + value; - return token = 7; + return token = 7 /* NumericLiteral */; } - if (pos + 1 < len && isOctalDigit(text.charCodeAt(pos + 1))) { + // Try to parse as an octal + if (pos + 1 < end && isOctalDigit(text.charCodeAt(pos + 1))) { tokenValue = "" + scanOctalDigits(); - return token = 7; + return token = 7 /* NumericLiteral */; } - case 49: - case 50: - case 51: - case 52: - case 53: - case 54: - case 55: - case 56: - case 57: + // This fall-through is a deviation from the EcmaScript grammar. The grammar says that a leading zero + // can only be followed by an octal digit, a dot, or the end of the number literal. However, we are being + // permissive and allowing decimal digits of the form 08* and 09* (which many browsers also do). + case 49 /* _1 */: + case 50 /* _2 */: + case 51 /* _3 */: + case 52 /* _4 */: + case 53 /* _5 */: + case 54 /* _6 */: + case 55 /* _7 */: + case 56 /* _8 */: + case 57 /* _9 */: tokenValue = "" + scanNumber(); - return token = 7; - case 58: - return pos++, token = 51; - case 59: - return pos++, token = 22; - case 60: + return token = 7 /* NumericLiteral */; + case 58 /* colon */: + return pos++, token = 51 /* ColonToken */; + case 59 /* semicolon */: + return pos++, token = 22 /* SemicolonToken */; + case 60 /* lessThan */: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); if (skipTrivia) { continue; } else { - return token = 6; + return token = 6 /* ConflictMarkerTrivia */; } } - if (text.charCodeAt(pos + 1) === 60) { - if (text.charCodeAt(pos + 2) === 61) { - return pos += 3, token = 59; + if (text.charCodeAt(pos + 1) === 60 /* lessThan */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 59 /* LessThanLessThanEqualsToken */; } - return pos += 2, token = 40; + return pos += 2, token = 40 /* LessThanLessThanToken */; } - if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 26; + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 26 /* LessThanEqualsToken */; } - return pos++, token = 24; - case 61: + return pos++, token = 24 /* LessThanToken */; + case 61 /* equals */: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); if (skipTrivia) { continue; } else { - return token = 6; + return token = 6 /* ConflictMarkerTrivia */; } } - if (text.charCodeAt(pos + 1) === 61) { - if (text.charCodeAt(pos + 2) === 61) { - return pos += 3, token = 30; + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 30 /* EqualsEqualsEqualsToken */; } - return pos += 2, token = 28; + return pos += 2, token = 28 /* EqualsEqualsToken */; } - if (text.charCodeAt(pos + 1) === 62) { - return pos += 2, token = 32; + if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { + return pos += 2, token = 32 /* EqualsGreaterThanToken */; } - return pos++, token = 53; - case 62: + return pos++, token = 53 /* EqualsToken */; + case 62 /* greaterThan */: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); if (skipTrivia) { continue; } else { - return token = 6; + return token = 6 /* ConflictMarkerTrivia */; } } - return pos++, token = 25; - case 63: - return pos++, token = 50; - case 91: - return pos++, token = 18; - case 93: - return pos++, token = 19; - case 94: - if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 64; + return pos++, token = 25 /* GreaterThanToken */; + case 63 /* question */: + return pos++, token = 50 /* QuestionToken */; + case 91 /* openBracket */: + return pos++, token = 18 /* OpenBracketToken */; + case 93 /* closeBracket */: + return pos++, token = 19 /* CloseBracketToken */; + case 94 /* caret */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 64 /* CaretEqualsToken */; } - return pos++, token = 45; - case 123: - return pos++, token = 14; - case 124: - if (text.charCodeAt(pos + 1) === 124) { - return pos += 2, token = 49; + return pos++, token = 45 /* CaretToken */; + case 123 /* openBrace */: + return pos++, token = 14 /* OpenBraceToken */; + case 124 /* bar */: + if (text.charCodeAt(pos + 1) === 124 /* bar */) { + return pos += 2, token = 49 /* BarBarToken */; } - if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 63; + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 63 /* BarEqualsToken */; } - return pos++, token = 44; - case 125: - return pos++, token = 15; - case 126: - return pos++, token = 47; - case 64: - return pos++, token = 52; - case 92: + return pos++, token = 44 /* BarToken */; + case 125 /* closeBrace */: + return pos++, token = 15 /* CloseBraceToken */; + case 126 /* tilde */: + return pos++, token = 47 /* TildeToken */; + case 64 /* at */: + return pos++, token = 52 /* AtToken */; + case 92 /* backslash */: var cookedChar = peekUnicodeEscape(); if (cookedChar >= 0 && isIdentifierStart(cookedChar)) { pos += 6; @@ -3090,14 +3387,14 @@ var ts; return token = getIdentifierToken(); } error(ts.Diagnostics.Invalid_character); - return pos++, token = 0; + return pos++, token = 0 /* Unknown */; default: if (isIdentifierStart(ch)) { pos++; - while (pos < len && isIdentifierPart(ch = text.charCodeAt(pos))) + while (pos < end && isIdentifierPart(ch = text.charCodeAt(pos))) pos++; tokenValue = text.substring(tokenPos, pos); - if (ch === 92) { + if (ch === 92 /* backslash */) { tokenValue += scanIdentifierParts(); } return token = getIdentifierToken(); @@ -3112,37 +3409,39 @@ var ts; continue; } error(ts.Diagnostics.Invalid_character); - return pos++, token = 0; + return pos++, token = 0 /* Unknown */; } } } function reScanGreaterToken() { - if (token === 25) { - if (text.charCodeAt(pos) === 62) { - if (text.charCodeAt(pos + 1) === 62) { - if (text.charCodeAt(pos + 2) === 61) { - return pos += 3, token = 61; + if (token === 25 /* GreaterThanToken */) { + if (text.charCodeAt(pos) === 62 /* greaterThan */) { + if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 61 /* GreaterThanGreaterThanGreaterThanEqualsToken */; } - return pos += 2, token = 42; + return pos += 2, token = 42 /* GreaterThanGreaterThanGreaterThanToken */; } - if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 60; + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 60 /* GreaterThanGreaterThanEqualsToken */; } - return pos++, token = 41; + return pos++, token = 41 /* GreaterThanGreaterThanToken */; } - if (text.charCodeAt(pos) === 61) { - return pos++, token = 27; + if (text.charCodeAt(pos) === 61 /* equals */) { + return pos++, token = 27 /* GreaterThanEqualsToken */; } } return token; } function reScanSlashToken() { - if (token === 36 || token === 57) { + if (token === 36 /* SlashToken */ || token === 57 /* SlashEqualsToken */) { var p = tokenPos + 1; var inEscape = false; var inCharacterClass = false; while (true) { - if (p >= len) { + // If we reach the end of a file, or hit a newline, then this is an unterminated + // regex. Report error and return what we have so far. + if (p >= end) { tokenIsUnterminated = true; error(ts.Diagnostics.Unterminated_regular_expression_literal); break; @@ -3154,34 +3453,41 @@ var ts; break; } if (inEscape) { + // Parsing an escape character; + // reset the flag and just advance to the next char. inEscape = false; } - else if (ch === 47 && !inCharacterClass) { + else if (ch === 47 /* slash */ && !inCharacterClass) { + // A slash within a character class is permissible, + // but in general it signals the end of the regexp literal. p++; break; } - else if (ch === 91) { + else if (ch === 91 /* openBracket */) { inCharacterClass = true; } - else if (ch === 92) { + else if (ch === 92 /* backslash */) { inEscape = true; } - else if (ch === 93) { + else if (ch === 93 /* closeBracket */) { inCharacterClass = false; } p++; } - while (p < len && isIdentifierPart(text.charCodeAt(p))) { + while (p < end && isIdentifierPart(text.charCodeAt(p))) { p++; } pos = p; tokenValue = text.substring(tokenPos, pos); - token = 9; + token = 9 /* RegularExpressionLiteral */; } return token; } + /** + * Unconditionally back up and scan a template expression portion. + */ function reScanTemplateToken() { - ts.Debug.assert(token === 15, "'reScanTemplateToken' should only be called on a '}'"); + ts.Debug.assert(token === 15 /* CloseBraceToken */, "'reScanTemplateToken' should only be called on a '}'"); pos = tokenPos; return token = scanTemplateAndSetTokenValue(); } @@ -3193,6 +3499,8 @@ var ts; var saveTokenValue = tokenValue; var savePrecedingLineBreak = precedingLineBreak; var result = callback(); + // If our callback returned something 'falsy' or we're just looking ahead, + // then unconditionally restore us to where we were. if (!result || isLookahead) { pos = savePos; startPos = saveStartPos; @@ -3209,44 +3517,33 @@ var ts; function tryScan(callback) { return speculationHelper(callback, false); } - function setText(newText) { + function setText(newText, start, length) { text = newText || ""; - len = text.length; - setTextPos(0); + end = length === undefined ? text.length : start + length; + setTextPos(start || 0); + } + function setOnError(errorCallback) { + onError = errorCallback; + } + function setScriptTarget(scriptTarget) { + languageVersion = scriptTarget; } function setTextPos(textPos) { + ts.Debug.assert(textPos >= 0); pos = textPos; startPos = textPos; tokenPos = textPos; - token = 0; + token = 0 /* Unknown */; precedingLineBreak = false; + tokenValue = undefined; + hasExtendedUnicodeEscape = false; + tokenIsUnterminated = false; } - 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 === 65 || token > 101; }, - isReservedWord: function () { return token >= 66 && token <= 101; }, - isUnterminated: function () { return tokenIsUnterminated; }, - reScanGreaterToken: reScanGreaterToken, - reScanSlashToken: reScanSlashToken, - reScanTemplateToken: reScanTemplateToken, - scan: scan, - setText: setText, - setTextPos: setTextPos, - tryScan: tryScan, - lookAhead: lookAhead - }; } ts.createScanner = createScanner; })(ts || (ts = {})); /// +/* @internal */ var ts; (function (ts) { ts.bindTime = 0; @@ -3257,36 +3554,41 @@ var ts; })(ts.ModuleInstanceState || (ts.ModuleInstanceState = {})); var ModuleInstanceState = ts.ModuleInstanceState; function getModuleInstanceState(node) { - if (node.kind === 202 || node.kind === 203) { - return 0; + // A module is uninstantiated if it contains only + // 1. interface declarations, type alias declarations + if (node.kind === 202 /* InterfaceDeclaration */ || node.kind === 203 /* TypeAliasDeclaration */) { + return 0 /* NonInstantiated */; } else if (ts.isConstEnumDeclaration(node)) { - return 2; + return 2 /* ConstEnumOnly */; } - else if ((node.kind === 209 || node.kind === 208) && !(node.flags & 1)) { - return 0; + else if ((node.kind === 209 /* ImportDeclaration */ || node.kind === 208 /* ImportEqualsDeclaration */) && !(node.flags & 1 /* Export */)) { + return 0 /* NonInstantiated */; } - else if (node.kind === 206) { - var state = 0; + else if (node.kind === 206 /* ModuleBlock */) { + var state = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { switch (getModuleInstanceState(n)) { - case 0: + case 0 /* NonInstantiated */: + // child is non-instantiated - continue searching return false; - case 2: - state = 2; + case 2 /* ConstEnumOnly */: + // child is const enum only - record state and continue searching + state = 2 /* ConstEnumOnly */; return false; - case 1: - state = 1; + case 1 /* Instantiated */: + // child is instantiated - record state and stop + state = 1 /* Instantiated */; return true; } }); return state; } - else if (node.kind === 205) { + else if (node.kind === 205 /* ModuleDeclaration */) { return getModuleInstanceState(node.body); } else { - return 1; + return 1 /* Instantiated */; } } ts.getModuleInstanceState = getModuleInstanceState; @@ -3325,20 +3627,22 @@ var ts; if (!symbol.declarations) symbol.declarations = []; symbol.declarations.push(node); - if (symbolKind & 1952 && !symbol.exports) + if (symbolKind & 1952 /* HasExports */ && !symbol.exports) symbol.exports = {}; - if (symbolKind & 6240 && !symbol.members) + if (symbolKind & 6240 /* HasMembers */ && !symbol.members) symbol.members = {}; node.symbol = symbol; - if (symbolKind & 107455 && !symbol.valueDeclaration) + if (symbolKind & 107455 /* Value */ && !symbol.valueDeclaration) symbol.valueDeclaration = node; } + // Should not be called on a declaration with a computed property name, + // unless it is a well known Symbol. function getDeclarationName(node) { if (node.name) { - if (node.kind === 205 && node.name.kind === 8) { + if (node.kind === 205 /* ModuleDeclaration */ && node.name.kind === 8 /* StringLiteral */) { return '"' + node.name.text + '"'; } - if (node.name.kind === 127) { + if (node.name.kind === 127 /* ComputedPropertyName */) { var nameExpression = node.name.expression; ts.Debug.assert(ts.isWellKnownSymbolSyntactically(nameExpression)); return ts.getPropertyNameForKnownSymbolName(nameExpression.name.text); @@ -3346,23 +3650,23 @@ var ts; return node.name.text; } switch (node.kind) { - case 143: - case 135: + case 143 /* ConstructorType */: + case 135 /* Constructor */: return "__constructor"; - case 142: - case 138: + case 142 /* FunctionType */: + case 138 /* CallSignature */: return "__call"; - case 139: + case 139 /* ConstructSignature */: return "__new"; - case 140: + case 140 /* IndexSignature */: return "__index"; - case 215: + case 215 /* ExportDeclaration */: return "__export"; - case 214: + case 214 /* ExportAssignment */: return node.isExportEquals ? "export=" : "default"; - case 200: - case 201: - return node.flags & 256 ? "default" : undefined; + case 200 /* FunctionDeclaration */: + case 201 /* ClassDeclaration */: + return node.flags & 256 /* Default */ ? "default" : undefined; } } function getDisplayName(node) { @@ -3370,7 +3674,8 @@ var ts; } function declareSymbol(symbols, parent, node, includes, excludes) { ts.Debug.assert(!ts.hasDynamicName(node)); - var name = node.flags & 256 && parent ? "default" : getDeclarationName(node); + // The exported symbol for an export default function/class node is always named "default" + var name = node.flags & 256 /* Default */ && parent ? "default" : getDeclarationName(node); var symbol; if (name !== undefined) { symbol = ts.hasProperty(symbols, name) ? symbols[name] : (symbols[name] = createSymbol(0, name)); @@ -3378,7 +3683,9 @@ var ts; if (node.name) { node.name.parent = node; } - var message = symbol.flags & 2 + // Report errors every position with duplicate declaration + // Report errors on previous encountered declarations + var message = symbol.flags & 2 /* BlockScopedVariable */ ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(symbol.declarations, function (declaration) { @@ -3393,8 +3700,12 @@ var ts; } addDeclarationToSymbol(symbol, node, includes); symbol.parent = parent; - if ((node.kind === 201 || node.kind === 174) && symbol.exports) { - var prototypeSymbol = createSymbol(4 | 134217728, "prototype"); + if ((node.kind === 201 /* ClassDeclaration */ || node.kind === 174 /* 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. + // It is an error to explicitly declare a static property member with the name 'prototype'. + var prototypeSymbol = createSymbol(4 /* Property */ | 134217728 /* Prototype */, "prototype"); if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { if (node.name) { node.name.parent = node; @@ -3407,9 +3718,9 @@ var ts; return symbol; } function declareModuleMember(node, symbolKind, symbolExcludes) { - var hasExportModifier = ts.getCombinedNodeFlags(node) & 1; - if (symbolKind & 8388608) { - if (node.kind === 217 || (node.kind === 208 && hasExportModifier)) { + var hasExportModifier = ts.getCombinedNodeFlags(node) & 1 /* Export */; + if (symbolKind & 8388608 /* Alias */) { + if (node.kind === 217 /* ExportSpecifier */ || (node.kind === 208 /* ImportEqualsDeclaration */ && hasExportModifier)) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); } else { @@ -3417,10 +3728,21 @@ var ts; } } else { - if (hasExportModifier || container.flags & 32768) { - var exportKind = (symbolKind & 107455 ? 1048576 : 0) | - (symbolKind & 793056 ? 2097152 : 0) | - (symbolKind & 1536 ? 4194304 : 0); + // Exported module members are given 2 symbols: A local symbol that is classified with an ExportValue, + // ExportType, or ExportContainer flag, and an associated export symbol with all the correct flags set + // on it. There are 2 main reasons: + // + // 1. We treat locals and exports of the same name as mutually exclusive within a container. + // That means the binder will issue a Duplicate Identifier error if you mix locals and exports + // with the same name in the same container. + // TODO: Make this a more specific error and decouple it from the exclusion logic. + // 2. When we checkIdentifier in the checker, we set its resolved symbol to the local symbol, + // but return the export symbol (by calling getExportSymbolOfValueSymbolIfExported). That way + // when the emitter comes back to it, it knows not to qualify the name if it was found in a containing scope. + if (hasExportModifier || container.flags & 32768 /* ExportContext */) { + var exportKind = (symbolKind & 107455 /* Value */ ? 1048576 /* ExportValue */ : 0) | + (symbolKind & 793056 /* Type */ ? 2097152 /* ExportType */ : 0) | + (symbolKind & 1536 /* Namespace */ ? 4194304 /* ExportNamespace */ : 0); var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); node.localSymbol = local; @@ -3430,15 +3752,17 @@ var ts; } } } + // All container nodes are kept on a linked list in declaration order. This list is used by the getLocalNameOfContainer function + // in the type checker to validate that the local name used for a container is unique. function bindChildren(node, symbolKind, isBlockScopeContainer) { - if (symbolKind & 255504) { + if (symbolKind & 255504 /* HasLocals */) { node.locals = {}; } var saveParent = parent; var saveContainer = container; var savedBlockScopeContainer = blockScopeContainer; parent = node; - if (symbolKind & 262128) { + if (symbolKind & 262128 /* IsContainer */) { container = node; if (lastContainer) { lastContainer.nextContainer = container; @@ -3446,7 +3770,13 @@ var ts; lastContainer = container; } if (isBlockScopeContainer) { - setBlockScopeContainer(node, (symbolKind & 255504) === 0 && node.kind !== 227); + // in incremental scenarios we might reuse nodes that already have locals being allocated + // during the bind step these locals should be dropped to prevent using stale data. + // locals should always be dropped unless they were previously initialized by the binder + // these cases are: + // - node has locals (symbolKind & HasLocals) !== 0 + // - node is a source file + setBlockScopeContainer(node, (symbolKind & 255504 /* HasLocals */) === 0 && node.kind !== 227 /* SourceFile */); } ts.forEachChild(node, bind); container = saveContainer; @@ -3455,41 +3785,41 @@ var ts; } function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) { switch (container.kind) { - case 205: + case 205 /* ModuleDeclaration */: declareModuleMember(node, symbolKind, symbolExcludes); break; - case 227: + case 227 /* SourceFile */: 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: + case 142 /* FunctionType */: + case 143 /* ConstructorType */: + case 138 /* CallSignature */: + case 139 /* ConstructSignature */: + case 140 /* IndexSignature */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 135 /* Constructor */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); break; - case 174: - case 201: - if (node.flags & 128) { + case 174 /* ClassExpression */: + case 201 /* ClassDeclaration */: + if (node.flags & 128 /* Static */) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } - case 145: - case 154: - case 202: + case 145 /* TypeLiteral */: + case 154 /* ObjectLiteralExpression */: + case 202 /* InterfaceDeclaration */: declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); break; - case 204: + case 204 /* EnumDeclaration */: declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } @@ -3497,18 +3827,18 @@ var ts; } function isAmbientContext(node) { while (node) { - if (node.flags & 2) + if (node.flags & 2 /* Ambient */) 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) { + var body = node.kind === 227 /* SourceFile */ ? node : node.body; + if (body.kind === 227 /* SourceFile */ || body.kind === 206 /* ModuleBlock */) { for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { var stat = _a[_i]; - if (stat.kind === 215 || stat.kind === 214) { + if (stat.kind === 215 /* ExportDeclaration */ || stat.kind === 214 /* ExportAssignment */) { return true; } } @@ -3516,30 +3846,34 @@ var ts; return false; } function setExportContextFlag(node) { + // A declaration source file or ambient module declaration that contains no export declarations (but possibly regular + // declarations with export modifiers) is an export context in which declarations are implicitly exported. if (isAmbientContext(node) && !hasExportDeclarations(node)) { - node.flags |= 32768; + node.flags |= 32768 /* ExportContext */; } else { - node.flags &= ~32768; + node.flags &= ~32768 /* ExportContext */; } } function bindModuleDeclaration(node) { setExportContextFlag(node); - if (node.name.kind === 8) { - bindDeclaration(node, 512, 106639, true); + if (node.name.kind === 8 /* StringLiteral */) { + bindDeclaration(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */, true); } else { var state = getModuleInstanceState(node); - if (state === 0) { - bindDeclaration(node, 1024, 0, true); + if (state === 0 /* NonInstantiated */) { + bindDeclaration(node, 1024 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */, true); } else { - bindDeclaration(node, 512, 106639, true); - var currentModuleIsConstEnumOnly = state === 2; + bindDeclaration(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */, true); + var currentModuleIsConstEnumOnly = state === 2 /* ConstEnumOnly */; if (node.symbol.constEnumOnlyModule === undefined) { + // non-merged case - use the current state node.symbol.constEnumOnlyModule = currentModuleIsConstEnumOnly; } else { + // merged case: module is const enum only if all its pieces are non-instantiated or const enum node.symbol.constEnumOnlyModule = node.symbol.constEnumOnlyModule && currentModuleIsConstEnumOnly; } } @@ -3552,13 +3886,13 @@ var ts; // 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); + var symbol = createSymbol(131072 /* Signature */, getDeclarationName(node)); + addDeclarationToSymbol(symbol, node, 131072 /* Signature */); + bindChildren(node, 131072 /* Signature */, false); + var typeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type"); + addDeclarationToSymbol(typeLiteralSymbol, node, 2048 /* TypeLiteral */); typeLiteralSymbol.members = {}; - typeLiteralSymbol.members[node.kind === 142 ? "__call" : "__new"] = symbol; + typeLiteralSymbol.members[node.kind === 142 /* FunctionType */ ? "__call" : "__new"] = symbol; } function bindAnonymousDeclaration(node, symbolKind, name, isBlockScopeContainer) { var symbol = createSymbol(symbolKind, name); @@ -3568,23 +3902,27 @@ var ts; function bindCatchVariableDeclaration(node) { bindChildren(node, 0, true); } - function bindBlockScopedVariableDeclaration(node) { + function bindBlockScopedDeclaration(node, symbolKind, symbolExcludes) { switch (blockScopeContainer.kind) { - case 205: - declareModuleMember(node, 2, 107455); + case 205 /* ModuleDeclaration */: + declareModuleMember(node, symbolKind, symbolExcludes); break; - case 227: + case 227 /* SourceFile */: if (ts.isExternalModule(container)) { - declareModuleMember(node, 2, 107455); + declareModuleMember(node, symbolKind, symbolExcludes); break; } + // fall through. default: if (!blockScopeContainer.locals) { blockScopeContainer.locals = {}; } - declareSymbol(blockScopeContainer.locals, undefined, node, 2, 107455); + declareSymbol(blockScopeContainer.locals, undefined, node, symbolKind, symbolExcludes); } - bindChildren(node, 2, false); + bindChildren(node, symbolKind, false); + } + function bindBlockScopedVariableDeclaration(node) { + bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); } function getDestructuringParameterName(node) { return "__" + ts.indexOf(node.parent.parameters, node); @@ -3592,14 +3930,14 @@ var ts; function bind(node) { node.parent = parent; switch (node.kind) { - case 128: - bindDeclaration(node, 262144, 530912, false); + case 128 /* TypeParameter */: + bindDeclaration(node, 262144 /* TypeParameter */, 530912 /* TypeParameterExcludes */, false); break; - case 129: + case 129 /* Parameter */: bindParameter(node); break; - case 198: - case 152: + case 198 /* VariableDeclaration */: + case 152 /* BindingElement */: if (ts.isBindingPattern(node.name)) { bindChildren(node, 0, false); } @@ -3607,124 +3945,139 @@ var ts; bindBlockScopedVariableDeclaration(node); } else { - bindDeclaration(node, 1, 107454, false); + bindDeclaration(node, 1 /* FunctionScopedVariable */, 107454 /* FunctionScopedVariableExcludes */, false); } break; - case 132: - case 131: - bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 107455, false); + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + bindPropertyOrMethodOrAccessor(node, 4 /* Property */ | (node.questionToken ? 536870912 /* Optional */ : 0), 107455 /* PropertyExcludes */, false); break; - case 224: - case 225: - bindPropertyOrMethodOrAccessor(node, 4, 107455, false); + case 224 /* PropertyAssignment */: + case 225 /* ShorthandPropertyAssignment */: + bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 107455 /* PropertyExcludes */, false); break; - case 226: - bindPropertyOrMethodOrAccessor(node, 8, 107455, false); + case 226 /* EnumMember */: + bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 107455 /* EnumMemberExcludes */, false); break; - case 138: - case 139: - case 140: - bindDeclaration(node, 131072, 0, false); + case 138 /* CallSignature */: + case 139 /* ConstructSignature */: + case 140 /* IndexSignature */: + bindDeclaration(node, 131072 /* Signature */, 0, false); break; - case 134: - case 133: - bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 107455 : 99263, true); + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + // If this is an ObjectLiteralExpression method, then it sits in the same space + // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes + // so that it will conflict with any other object literal members with the same + // name. + bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 536870912 /* Optional */ : 0), ts.isObjectLiteralMethod(node) ? 107455 /* PropertyExcludes */ : 99263 /* MethodExcludes */, true); break; - case 200: - bindDeclaration(node, 16, 106927, true); + case 200 /* FunctionDeclaration */: + bindDeclaration(node, 16 /* Function */, 106927 /* FunctionExcludes */, true); break; - case 135: - bindDeclaration(node, 16384, 0, true); + case 135 /* Constructor */: + bindDeclaration(node, 16384 /* Constructor */, 0, true); break; - case 136: - bindPropertyOrMethodOrAccessor(node, 32768, 41919, true); + case 136 /* GetAccessor */: + bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 41919 /* GetAccessorExcludes */, true); break; - case 137: - bindPropertyOrMethodOrAccessor(node, 65536, 74687, true); + case 137 /* SetAccessor */: + bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 74687 /* SetAccessorExcludes */, true); break; - case 142: - case 143: + case 142 /* FunctionType */: + case 143 /* ConstructorType */: bindFunctionOrConstructorType(node); break; - case 145: - bindAnonymousDeclaration(node, 2048, "__type", false); + case 145 /* TypeLiteral */: + bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type", false); break; - case 154: - bindAnonymousDeclaration(node, 4096, "__object", false); + case 154 /* ObjectLiteralExpression */: + bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object", false); break; - case 162: - case 163: - bindAnonymousDeclaration(node, 16, "__function", true); + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: + bindAnonymousDeclaration(node, 16 /* Function */, "__function", true); break; - case 174: - bindAnonymousDeclaration(node, 32, "__class", false); + case 174 /* ClassExpression */: + bindAnonymousDeclaration(node, 32 /* Class */, "__class", false); break; - case 223: + case 223 /* CatchClause */: bindCatchVariableDeclaration(node); break; - case 201: - bindDeclaration(node, 32, 899583, false); + case 201 /* ClassDeclaration */: + bindBlockScopedDeclaration(node, 32 /* Class */, 899583 /* ClassExcludes */); break; - case 202: - bindDeclaration(node, 64, 792992, false); + case 202 /* InterfaceDeclaration */: + bindDeclaration(node, 64 /* Interface */, 792992 /* InterfaceExcludes */, false); break; - case 203: - bindDeclaration(node, 524288, 793056, false); + case 203 /* TypeAliasDeclaration */: + bindDeclaration(node, 524288 /* TypeAlias */, 793056 /* TypeAliasExcludes */, false); break; - case 204: + case 204 /* EnumDeclaration */: if (ts.isConst(node)) { - bindDeclaration(node, 128, 899967, false); + bindDeclaration(node, 128 /* ConstEnum */, 899967 /* ConstEnumExcludes */, false); } else { - bindDeclaration(node, 256, 899327, false); + bindDeclaration(node, 256 /* RegularEnum */, 899327 /* RegularEnumExcludes */, false); } break; - case 205: + case 205 /* ModuleDeclaration */: bindModuleDeclaration(node); break; - case 208: - case 211: - case 213: - case 217: - bindDeclaration(node, 8388608, 8388608, false); + case 208 /* ImportEqualsDeclaration */: + case 211 /* NamespaceImport */: + case 213 /* ImportSpecifier */: + case 217 /* ExportSpecifier */: + bindDeclaration(node, 8388608 /* Alias */, 8388608 /* AliasExcludes */, false); break; - case 210: + case 210 /* ImportClause */: if (node.name) { - bindDeclaration(node, 8388608, 8388608, false); + bindDeclaration(node, 8388608 /* Alias */, 8388608 /* AliasExcludes */, false); } else { bindChildren(node, 0, false); } break; - case 215: + case 215 /* ExportDeclaration */: if (!node.exportClause) { - declareSymbol(container.symbol.exports, container.symbol, node, 1073741824, 0); + // All export * declarations are collected in an __export symbol + declareSymbol(container.symbol.exports, container.symbol, node, 1073741824 /* ExportStar */, 0); } bindChildren(node, 0, false); break; - case 214: - if (node.expression && node.expression.kind === 65) { - declareSymbol(container.symbol.exports, container.symbol, node, 8388608, 107455 | 8388608); + case 214 /* ExportAssignment */: + if (node.expression.kind === 65 /* Identifier */) { + // An export default clause with an identifier exports all meanings of that identifier + declareSymbol(container.symbol.exports, container.symbol, node, 8388608 /* Alias */, 107455 /* PropertyExcludes */ | 8388608 /* AliasExcludes */); } else { - declareSymbol(container.symbol.exports, container.symbol, node, 4, 107455 | 8388608); + // An export default clause with an expression exports a value + declareSymbol(container.symbol.exports, container.symbol, node, 4 /* Property */, 107455 /* PropertyExcludes */ | 8388608 /* AliasExcludes */); } bindChildren(node, 0, false); break; - case 227: + case 227 /* SourceFile */: setExportContextFlag(node); if (ts.isExternalModule(node)) { - bindAnonymousDeclaration(node, 512, '"' + ts.removeFileExtension(node.fileName) + '"', true); + bindAnonymousDeclaration(node, 512 /* ValueModule */, '"' + ts.removeFileExtension(node.fileName) + '"', true); break; } - case 179: + case 179 /* Block */: + // do not treat function block a block-scope container + // all block-scope locals that reside in this block should go to the function locals. + // Otherwise this won't be considered as redeclaration of a block scoped local: + // function foo() { + // let x; + // let x; + // } + // 'let x' will be placed into the function locals and 'let x' - into the locals of the block bindChildren(node, 0, !ts.isFunctionLike(node.parent)); break; - case 223: - case 186: - case 187: - case 188: - case 207: + case 223 /* CatchClause */: + case 186 /* ForStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: + case 207 /* CaseBlock */: bindChildren(node, 0, true); break; default: @@ -3736,16 +4089,18 @@ var ts; } function bindParameter(node) { if (ts.isBindingPattern(node.name)) { - bindAnonymousDeclaration(node, 1, getDestructuringParameterName(node), false); + bindAnonymousDeclaration(node, 1 /* FunctionScopedVariable */, getDestructuringParameterName(node), false); } else { - bindDeclaration(node, 1, 107455, false); + bindDeclaration(node, 1 /* FunctionScopedVariable */, 107455 /* ParameterExcludes */, false); } - if (node.flags & 112 && - node.parent.kind === 135 && - (node.parent.parent.kind === 201 || node.parent.parent.kind === 174)) { + // If this is a property-parameter, then also declare the property symbol into the + // containing class. + if (node.flags & 112 /* AccessibilityModifier */ && + node.parent.kind === 135 /* Constructor */ && + (node.parent.parent.kind === 201 /* ClassDeclaration */ || node.parent.parent.kind === 174 /* ClassExpression */)) { var classDeclaration = node.parent.parent; - declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4, 107455); + declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 /* Property */, 107455 /* PropertyExcludes */); } } function bindPropertyOrMethodOrAccessor(node, symbolKind, symbolExcludes, isBlockScopeContainer) { @@ -3759,6 +4114,7 @@ var ts; } })(ts || (ts = {})); /// +/* @internal */ var ts; (function (ts) { function getDeclarationOfKind(symbol, kind) { @@ -3772,6 +4128,7 @@ var ts; return undefined; } ts.getDeclarationOfKind = getDeclarationOfKind; + // Pool writers to avoid needing to allocate them for every symbol we write. var stringWriters = []; function getSingleLineStringWriter() { if (stringWriters.length == 0) { @@ -3786,6 +4143,8 @@ var ts; writeStringLiteral: writeText, writeParameter: writeText, writeSymbol: writeText, + // Completely ignore indentation for string writers. And map newlines to + // a single space. writeLine: function () { return str += " "; }, increaseIndent: function () { }, decreaseIndent: function () { }, @@ -3805,23 +4164,31 @@ var ts; return node.end - node.pos; } ts.getFullWidth = getFullWidth; + // Returns true if this node contains a parse error anywhere underneath it. function containsParseError(node) { aggregateChildData(node); - return (node.parserContextFlags & 64) !== 0; + return (node.parserContextFlags & 64 /* ThisNodeOrAnySubNodesHasError */) !== 0; } ts.containsParseError = containsParseError; function aggregateChildData(node) { - if (!(node.parserContextFlags & 128)) { - var thisNodeOrAnySubNodesHasError = ((node.parserContextFlags & 32) !== 0) || + if (!(node.parserContextFlags & 128 /* HasAggregatedChildData */)) { + // A node is considered to contain a parse error if: + // a) the parser explicitly marked that it had an error + // b) any of it's children reported that it had an error. + var thisNodeOrAnySubNodesHasError = ((node.parserContextFlags & 32 /* ThisNodeHasError */) !== 0) || ts.forEachChild(node, containsParseError); + // If so, mark ourselves accordingly. if (thisNodeOrAnySubNodesHasError) { - node.parserContextFlags |= 64; + node.parserContextFlags |= 64 /* ThisNodeOrAnySubNodesHasError */; } - node.parserContextFlags |= 128; + // Also mark that we've propogated the child information to this node. This way we can + // always consult the bit directly on this node without needing to check its children + // again. + node.parserContextFlags |= 128 /* HasAggregatedChildData */; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 227) { + while (node && node.kind !== 227 /* SourceFile */) { node = node.parent; } return node; @@ -3832,6 +4199,7 @@ var ts; return ts.getLineStarts(sourceFile)[line]; } ts.getStartPositionOfLine = getStartPositionOfLine; + // This is a useful function for debugging purposes. function nodePosToString(node) { var file = getSourceFileOfNode(node); var loc = ts.getLineAndCharacterOfPosition(file, node.pos); @@ -3842,11 +4210,23 @@ var ts; return node.pos; } ts.getStartPosOfNode = getStartPosOfNode; + // Returns true if this node is missing from the actual source code. 'missing' is different + // from 'undefined/defined'. When a node is undefined (which can happen for optional nodes + // in the tree), it is definitel missing. HOwever, a node may be defined, but still be + // missing. This happens whenever the parser knows it needs to parse something, but can't + // get anything in the source code that it expects at that location. For example: + // + // let a: ; + // + // Here, the Type in the Type-Annotation is not-optional (as there is a colon in the source + // code). So the parser will attempt to parse out a type, and will create an actual node. + // However, this node will be 'missing' in the sense that no actual source-code/tokens are + // contained within it. function nodeIsMissing(node) { if (!node) { return true; } - return node.pos === node.end && node.kind !== 1; + return node.pos === node.end && node.kind !== 1 /* EndOfFileToken */; } ts.nodeIsMissing = nodeIsMissing; function nodeIsPresent(node) { @@ -3854,12 +4234,21 @@ var ts; } ts.nodeIsPresent = nodeIsPresent; function getTokenPosOfNode(node, sourceFile) { + // With nodes that have no width (i.e. 'Missing' nodes), we actually *don't* + // want to skip trivia because this will launch us forward to the next token. if (nodeIsMissing(node)) { return node.pos; } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); } ts.getTokenPosOfNode = getTokenPosOfNode; + function getNonDecoratorTokenPosOfNode(node, sourceFile) { + if (nodeIsMissing(node) || !node.decorators) { + return getTokenPosOfNode(node, sourceFile); + } + return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.decorators.end); + } + ts.getNonDecoratorTokenPosOfNode = getNonDecoratorTokenPosOfNode; function getSourceTextOfNodeFromSourceFile(sourceFile, node) { if (nodeIsMissing(node)) { return ""; @@ -3879,39 +4268,47 @@ var ts; return getSourceTextOfNodeFromSourceFile(getSourceFileOfNode(node), node); } ts.getTextOfNode = getTextOfNode; + // Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like '__proto__' function escapeIdentifier(identifier) { - return identifier.length >= 2 && identifier.charCodeAt(0) === 95 && identifier.charCodeAt(1) === 95 ? "_" + identifier : identifier; + return identifier.length >= 2 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ ? "_" + identifier : identifier; } ts.escapeIdentifier = escapeIdentifier; + // Remove extra underscore from escaped identifier function unescapeIdentifier(identifier) { - return identifier.length >= 3 && identifier.charCodeAt(0) === 95 && identifier.charCodeAt(1) === 95 && identifier.charCodeAt(2) === 95 ? identifier.substr(1) : identifier; + return identifier.length >= 3 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ && identifier.charCodeAt(2) === 95 /* _ */ ? identifier.substr(1) : identifier; } ts.unescapeIdentifier = unescapeIdentifier; + // Make an identifier from an external module name by extracting the string after the last "/" and replacing + // all non-alphanumeric characters with underscores function makeIdentifierFromModuleName(moduleName) { return ts.getBaseFileName(moduleName).replace(/\W/g, "_"); } ts.makeIdentifierFromModuleName = makeIdentifierFromModuleName; function isBlockOrCatchScoped(declaration) { - return (getCombinedNodeFlags(declaration) & 12288) !== 0 || + return (getCombinedNodeFlags(declaration) & 12288 /* BlockScoped */) !== 0 || isCatchClauseVariableDeclaration(declaration); } ts.isBlockOrCatchScoped = isBlockOrCatchScoped; + // Gets the nearest enclosing block scope container that has the provided node + // as a descendant, that is not the provided node. function getEnclosingBlockScopeContainer(node) { - var current = node; + var current = node.parent; while (current) { if (isFunctionLike(current)) { return current; } switch (current.kind) { - case 227: - case 207: - case 223: - case 205: - case 186: - case 187: - case 188: + case 227 /* SourceFile */: + case 207 /* CaseBlock */: + case 223 /* CatchClause */: + case 205 /* ModuleDeclaration */: + case 186 /* ForStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: return current; - case 179: + case 179 /* Block */: + // function block is not considered block-scope container + // see comment in binder.ts: bind(...), case for SyntaxKind.Block if (!isFunctionLike(current.parent)) { return current; } @@ -3922,11 +4319,14 @@ var ts; ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; function isCatchClauseVariableDeclaration(declaration) { return declaration && - declaration.kind === 198 && + declaration.kind === 198 /* VariableDeclaration */ && declaration.parent && - declaration.parent.kind === 223; + declaration.parent.kind === 223 /* CatchClause */; } ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration; + // Return display name of an identifier + // Computed property names will just be emitted as "[]", where is the source + // text of the expression in the computed property. function declarationNameToString(name) { return getFullWidth(name) === 0 ? "(Missing)" : getTextOfNode(name); } @@ -3951,42 +4351,46 @@ var ts; } ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain; function getSpanOfTokenAtPosition(sourceFile, pos) { - var scanner = ts.createScanner(sourceFile.languageVersion, true, sourceFile.text); - scanner.setTextPos(pos); + var scanner = ts.createScanner(sourceFile.languageVersion, true, sourceFile.text, undefined, pos); scanner.scan(); var start = scanner.getTokenPos(); - return createTextSpanFromBounds(start, scanner.getTextPos()); + return ts.createTextSpanFromBounds(start, scanner.getTextPos()); } ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 227: + case 227 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, false); if (pos_1 === sourceFile.text.length) { - return createTextSpan(0, 0); + // file is empty - return span for the beginning of the file + return ts.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 162: + // This list is a work in progress. Add missing node kinds to improve their error + // spans. + case 198 /* VariableDeclaration */: + case 152 /* BindingElement */: + case 201 /* ClassDeclaration */: + case 174 /* ClassExpression */: + case 202 /* InterfaceDeclaration */: + case 205 /* ModuleDeclaration */: + case 204 /* EnumDeclaration */: + case 226 /* EnumMember */: + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: 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. return getSpanOfTokenAtPosition(sourceFile, node.pos); } var pos = nodeIsMissing(errorNode) ? errorNode.pos : ts.skipTrivia(sourceFile.text, errorNode.pos); - return createTextSpanFromBounds(pos, errorNode.end); + return ts.createTextSpanFromBounds(pos, errorNode.end); } ts.getErrorSpanForNode = getErrorSpanForNode; function isExternalModule(file) { @@ -3994,49 +4398,61 @@ var ts; } ts.isExternalModule = isExternalModule; function isDeclarationFile(file) { - return (file.flags & 2048) !== 0; + return (file.flags & 2048 /* DeclarationFile */) !== 0; } ts.isDeclarationFile = isDeclarationFile; function isConstEnumDeclaration(node) { - return node.kind === 204 && isConst(node); + return node.kind === 204 /* EnumDeclaration */ && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 152 || isBindingPattern(node))) { + while (node && (node.kind === 152 /* BindingElement */ || isBindingPattern(node))) { node = node.parent; } return node; } + // Returns the node flags for this node and all relevant parent nodes. This is done so that + // nodes like variable declarations and binding elements can returned a view of their flags + // that includes the modifiers from their container. i.e. flags like export/declare aren't + // stored on the variable declaration directly, but on the containing variable statement + // (if it has one). Similarly, flags for let/const are store on the variable declaration + // list. By calling this function, all those flags are combined so that the client can treat + // the node as if it actually had those flags. function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 198) { + if (node.kind === 198 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 199) { + if (node && node.kind === 199 /* VariableDeclarationList */) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 180) { + if (node && node.kind === 180 /* VariableStatement */) { flags |= node.flags; } return flags; } ts.getCombinedNodeFlags = getCombinedNodeFlags; function isConst(node) { - return !!(getCombinedNodeFlags(node) & 8192); + return !!(getCombinedNodeFlags(node) & 8192 /* Const */); } ts.isConst = isConst; function isLet(node) { - return !!(getCombinedNodeFlags(node) & 4096); + return !!(getCombinedNodeFlags(node) & 4096 /* Let */); } ts.isLet = isLet; function isPrologueDirective(node) { - return node.kind === 182 && node.expression.kind === 8; + return node.kind === 182 /* ExpressionStatement */ && node.expression.kind === 8 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { - if (node.kind === 129 || node.kind === 128) { + // If parameter/type parameter, the prev token trailing comments are part of this node too + if (node.kind === 129 /* Parameter */ || node.kind === 128 /* TypeParameter */) { + // e.g. (/** blah */ a, /** blah */ b); + // e.g.: ( + // /** blah */ a, + // /** blah */ b); return ts.concatenate(ts.getTrailingCommentRanges(sourceFileOfNode.text, node.pos), ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos)); } else { @@ -4047,34 +4463,37 @@ 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; + // True if the comment starts with '/**' but not if it is '/**/' + return sourceFileOfNode.text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && + sourceFileOfNode.text.charCodeAt(comment.pos + 2) === 42 /* asterisk */ && + sourceFileOfNode.text.charCodeAt(comment.pos + 3) !== 47 /* slash */; } } ts.getJsDocComments = getJsDocComments; ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; + // Warning: This has the same semantics as the forEach family of functions, + // in that traversal terminates in the event that 'visitor' supplies a truthy value. function forEachReturnStatement(body, visitor) { return traverse(body); function traverse(node) { switch (node.kind) { - case 191: + case 191 /* ReturnStatement */: return visitor(node); - case 207: - case 179: - case 183: - case 184: - case 185: - case 186: - case 187: - case 188: - case 192: - case 193: - case 220: - case 221: - case 194: - case 196: - case 223: + case 207 /* CaseBlock */: + case 179 /* Block */: + case 183 /* IfStatement */: + case 184 /* DoStatement */: + case 185 /* WhileStatement */: + case 186 /* ForStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: + case 192 /* WithStatement */: + case 193 /* SwitchStatement */: + case 220 /* CaseClause */: + case 221 /* DefaultClause */: + case 194 /* LabeledStatement */: + case 196 /* TryStatement */: + case 223 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -4083,39 +4502,50 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 152: - case 226: - case 129: - case 224: - case 132: - case 131: - case 225: - case 198: + case 152 /* BindingElement */: + case 226 /* EnumMember */: + case 129 /* Parameter */: + case 224 /* PropertyAssignment */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 225 /* ShorthandPropertyAssignment */: + case 198 /* VariableDeclaration */: return true; } } return false; } ts.isVariableLike = isVariableLike; + function isAccessor(node) { + if (node) { + switch (node.kind) { + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + return true; + } + } + return false; + } + ts.isAccessor = isAccessor; function isFunctionLike(node) { if (node) { switch (node.kind) { - case 135: - case 162: - case 200: - case 163: - case 134: - case 133: - case 136: - case 137: - case 138: - case 139: - case 140: - case 142: - case 143: - case 162: - case 163: - case 200: + case 135 /* Constructor */: + case 162 /* FunctionExpression */: + case 200 /* FunctionDeclaration */: + case 163 /* ArrowFunction */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 138 /* CallSignature */: + case 139 /* ConstructSignature */: + case 140 /* IndexSignature */: + case 142 /* FunctionType */: + case 143 /* ConstructorType */: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: + case 200 /* FunctionDeclaration */: return true; } } @@ -4123,11 +4553,11 @@ var ts; } ts.isFunctionLike = isFunctionLike; function isFunctionBlock(node) { - return node && node.kind === 179 && isFunctionLike(node.parent); + return node && node.kind === 179 /* Block */ && isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 134 && node.parent.kind === 154; + return node && node.kind === 134 /* MethodDeclaration */ && node.parent.kind === 154 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function getContainingFunction(node) { @@ -4146,28 +4576,51 @@ var ts; return undefined; } switch (node.kind) { - case 127: - if (node.parent.parent.kind === 201) { + case 127 /* ComputedPropertyName */: + // If the grandparent node is an object literal (as opposed to a class), + // then the computed property is not a 'this' container. + // A computed property name in a class needs to be a this container + // so that we can error on it. + if (node.parent.parent.kind === 201 /* ClassDeclaration */) { return node; } + // If this is a computed property, then the parent should not + // make it a this container. The parent might be a property + // in an object literal, like a method or accessor. But in order for + // such a parent to be a this container, the reference must be in + // the *body* of the container. node = node.parent; break; - case 163: + case 130 /* Decorator */: + // Decorators are always applied outside of the body of a class or method. + if (node.parent.kind === 129 /* Parameter */ && isClassElement(node.parent.parent)) { + // If 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 163 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } - case 200: - case 162: - case 205: - case 132: - case 131: - case 134: - case 133: - case 135: - case 136: - case 137: - case 204: - case 227: + // Fall through + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: + case 205 /* ModuleDeclaration */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 135 /* Constructor */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 204 /* EnumDeclaration */: + case 227 /* SourceFile */: return node; } } @@ -4179,73 +4632,100 @@ var ts; if (!node) return node; switch (node.kind) { - case 127: - if (node.parent.parent.kind === 201) { + case 127 /* ComputedPropertyName */: + // If the grandparent node is an object literal (as opposed to a class), + // then the computed property is not a 'super' container. + // A computed property name in a class needs to be a super container + // so that we can error on it. + if (node.parent.parent.kind === 201 /* ClassDeclaration */) { return node; } + // If this is a computed property, then the parent should not + // make it a super container. The parent might be a property + // in an object literal, like a method or accessor. But in order for + // such a parent to be a super container, the reference must be in + // the *body* of the container. node = node.parent; break; - case 200: - case 162: - case 163: + case 130 /* Decorator */: + // Decorators are always applied outside of the body of a class or method. + if (node.parent.kind === 129 /* Parameter */ && isClassElement(node.parent.parent)) { + // If 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 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: if (!includeFunctions) { continue; } - case 132: - case 131: - case 134: - case 133: - case 135: - case 136: - case 137: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 135 /* Constructor */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: return node; } } } ts.getSuperContainer = getSuperContainer; function getInvokedExpression(node) { - if (node.kind === 159) { + if (node.kind === 159 /* TaggedTemplateExpression */) { return node.tag; } + // Will either be a CallExpression or NewExpression. return node.expression; } ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node) { switch (node.kind) { - case 201: + case 201 /* ClassDeclaration */: + // classes are valid targets 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; + case 132 /* PropertyDeclaration */: + // property declarations are valid if their parent is a class declaration. + return node.parent.kind === 201 /* ClassDeclaration */; + case 129 /* Parameter */: + // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; + return node.parent.body && node.parent.parent.kind === 201 /* ClassDeclaration */; + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 134 /* MethodDeclaration */: + // if this method has a body and its parent is a class declaration, this is a valid target. + return node.body && node.parent.kind === 201 /* ClassDeclaration */; } return false; } ts.nodeCanBeDecorated = nodeCanBeDecorated; function nodeIsDecorated(node) { switch (node.kind) { - case 201: + case 201 /* ClassDeclaration */: if (node.decorators) { return true; } return false; - case 132: - case 129: + case 132 /* PropertyDeclaration */: + case 129 /* Parameter */: if (node.decorators) { return true; } return false; - case 136: + case 136 /* GetAccessor */: if (node.body && node.decorators) { return true; } return false; - case 134: - case 137: + case 134 /* MethodDeclaration */: + case 137 /* SetAccessor */: if (node.body && node.decorators) { return true; } @@ -4256,10 +4736,10 @@ var ts; ts.nodeIsDecorated = nodeIsDecorated; function childIsDecorated(node) { switch (node.kind) { - case 201: + case 201 /* ClassDeclaration */: return ts.forEach(node.members, nodeOrChildIsDecorated); - case 134: - case 137: + case 134 /* MethodDeclaration */: + case 137 /* SetAccessor */: return ts.forEach(node.parameters, nodeIsDecorated); } return false; @@ -4271,84 +4751,87 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function isExpression(node) { switch (node.kind) { - case 93: - case 91: - case 89: - case 95: - case 80: - case 9: - case 153: - case 154: - case 155: - case 156: - case 157: - case 158: - case 159: - case 160: - case 161: - case 162: - case 174: - case 163: - case 166: - case 164: - case 165: - case 167: - case 168: - case 169: - case 170: - case 173: - case 171: - case 10: - case 175: + case 93 /* ThisKeyword */: + case 91 /* SuperKeyword */: + case 89 /* NullKeyword */: + case 95 /* TrueKeyword */: + case 80 /* FalseKeyword */: + case 9 /* RegularExpressionLiteral */: + case 153 /* ArrayLiteralExpression */: + case 154 /* ObjectLiteralExpression */: + case 155 /* PropertyAccessExpression */: + case 156 /* ElementAccessExpression */: + case 157 /* CallExpression */: + case 158 /* NewExpression */: + case 159 /* TaggedTemplateExpression */: + case 160 /* TypeAssertionExpression */: + case 161 /* ParenthesizedExpression */: + case 162 /* FunctionExpression */: + case 174 /* ClassExpression */: + case 163 /* ArrowFunction */: + case 166 /* VoidExpression */: + case 164 /* DeleteExpression */: + case 165 /* TypeOfExpression */: + case 167 /* PrefixUnaryExpression */: + case 168 /* PostfixUnaryExpression */: + case 169 /* BinaryExpression */: + case 170 /* ConditionalExpression */: + case 173 /* SpreadElementExpression */: + case 171 /* TemplateExpression */: + case 10 /* NoSubstitutionTemplateLiteral */: + case 175 /* OmittedExpression */: return true; - case 126: - while (node.parent.kind === 126) { + case 126 /* QualifiedName */: + while (node.parent.kind === 126 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 144; - case 65: - if (node.parent.kind === 144) { + return node.parent.kind === 144 /* TypeQuery */; + case 65 /* Identifier */: + if (node.parent.kind === 144 /* TypeQuery */) { return true; } - case 7: - case 8: + // fall through + case 7 /* NumericLiteral */: + case 8 /* StringLiteral */: var parent_1 = node.parent; switch (parent_1.kind) { - case 198: - case 129: - case 132: - case 131: - case 226: - case 224: - case 152: + case 198 /* VariableDeclaration */: + case 129 /* Parameter */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 226 /* EnumMember */: + case 224 /* PropertyAssignment */: + case 152 /* BindingElement */: return parent_1.initializer === node; - case 182: - case 183: - case 184: - case 185: - case 191: - case 192: - case 193: - case 220: - case 195: - case 193: + case 182 /* ExpressionStatement */: + case 183 /* IfStatement */: + case 184 /* DoStatement */: + case 185 /* WhileStatement */: + case 191 /* ReturnStatement */: + case 192 /* WithStatement */: + case 193 /* SwitchStatement */: + case 220 /* CaseClause */: + case 195 /* ThrowStatement */: + case 193 /* SwitchStatement */: return parent_1.expression === node; - case 186: + case 186 /* ForStatement */: var forStatement = parent_1; - return (forStatement.initializer === node && forStatement.initializer.kind !== 199) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 199 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.iterator === node; - case 187: - case 188: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: var forInStatement = parent_1; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 199) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 199 /* VariableDeclarationList */) || forInStatement.expression === node; - case 160: + case 160 /* TypeAssertionExpression */: return node === parent_1.expression; - case 176: + case 176 /* TemplateSpan */: return node === parent_1.expression; - case 127: + case 127 /* ComputedPropertyName */: return node === parent_1.expression; + case 130 /* Decorator */: + return true; default: if (isExpression(parent_1)) { return true; @@ -4360,12 +4843,12 @@ var ts; ts.isExpression = isExpression; function isInstantiatedModule(node, preserveConstEnums) { var moduleState = ts.getModuleInstanceState(node); - return moduleState === 1 || - (preserveConstEnums && moduleState === 2); + return moduleState === 1 /* Instantiated */ || + (preserveConstEnums && moduleState === 2 /* ConstEnumOnly */); } ts.isInstantiatedModule = isInstantiatedModule; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 208 && node.moduleReference.kind === 219; + return node.kind === 208 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 219 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -4374,40 +4857,40 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 208 && node.moduleReference.kind !== 219; + return node.kind === 208 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 219 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function getExternalModuleName(node) { - if (node.kind === 209) { + if (node.kind === 209 /* ImportDeclaration */) { return node.moduleSpecifier; } - if (node.kind === 208) { + if (node.kind === 208 /* ImportEqualsDeclaration */) { var reference = node.moduleReference; - if (reference.kind === 219) { + if (reference.kind === 219 /* ExternalModuleReference */) { return reference.expression; } } - if (node.kind === 215) { + if (node.kind === 215 /* ExportDeclaration */) { return node.moduleSpecifier; } } ts.getExternalModuleName = getExternalModuleName; function hasDotDotDotToken(node) { - return node && node.kind === 129 && node.dotDotDotToken !== undefined; + return node && node.kind === 129 /* Parameter */ && node.dotDotDotToken !== undefined; } ts.hasDotDotDotToken = hasDotDotDotToken; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 129: + case 129 /* Parameter */: return node.questionToken !== undefined; - case 134: - case 133: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: return node.questionToken !== undefined; - case 225: - case 224: - case 132: - case 131: + case 225 /* ShorthandPropertyAssignment */: + case 224 /* PropertyAssignment */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -4419,24 +4902,24 @@ var ts; } ts.hasRestParameters = hasRestParameters; function isLiteralKind(kind) { - return 7 <= kind && kind <= 10; + return 7 /* FirstLiteralToken */ <= kind && kind <= 10 /* LastLiteralToken */; } ts.isLiteralKind = isLiteralKind; function isTextualLiteralKind(kind) { - return kind === 8 || kind === 10; + return kind === 8 /* StringLiteral */ || kind === 10 /* NoSubstitutionTemplateLiteral */; } ts.isTextualLiteralKind = isTextualLiteralKind; function isTemplateLiteralKind(kind) { - return 10 <= kind && kind <= 13; + return 10 /* FirstTemplateToken */ <= kind && kind <= 13 /* LastTemplateToken */; } ts.isTemplateLiteralKind = isTemplateLiteralKind; function isBindingPattern(node) { - return !!node && (node.kind === 151 || node.kind === 150); + return !!node && (node.kind === 151 /* ArrayBindingPattern */ || node.kind === 150 /* ObjectBindingPattern */); } ts.isBindingPattern = isBindingPattern; function isInAmbientContext(node) { while (node) { - if (node.flags & (2 | 2048)) { + if (node.flags & (2 /* Ambient */ | 2048 /* DeclarationFile */)) { return true; } node = node.parent; @@ -4446,33 +4929,33 @@ var ts; ts.isInAmbientContext = isInAmbientContext; function isDeclaration(node) { switch (node.kind) { - case 163: - case 152: - case 201: - case 135: - case 204: - case 226: - case 217: - case 200: - case 162: - case 136: - case 210: - case 208: - case 213: - case 202: - case 134: - case 133: - case 205: - case 211: - case 129: - case 224: - case 132: - case 131: - case 137: - case 225: - case 203: - case 128: - case 198: + case 163 /* ArrowFunction */: + case 152 /* BindingElement */: + case 201 /* ClassDeclaration */: + case 135 /* Constructor */: + case 204 /* EnumDeclaration */: + case 226 /* EnumMember */: + case 217 /* ExportSpecifier */: + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: + case 136 /* GetAccessor */: + case 210 /* ImportClause */: + case 208 /* ImportEqualsDeclaration */: + case 213 /* ImportSpecifier */: + case 202 /* InterfaceDeclaration */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 205 /* ModuleDeclaration */: + case 211 /* NamespaceImport */: + case 129 /* Parameter */: + case 224 /* PropertyAssignment */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 137 /* SetAccessor */: + case 225 /* ShorthandPropertyAssignment */: + case 203 /* TypeAliasDeclaration */: + case 128 /* TypeParameter */: + case 198 /* VariableDeclaration */: return true; } return false; @@ -4480,25 +4963,25 @@ var ts; ts.isDeclaration = isDeclaration; function isStatement(n) { switch (n.kind) { - case 190: - case 189: - case 197: - case 184: - case 182: - case 181: - case 187: - case 188: - case 186: - case 183: - case 194: - case 191: - case 193: - case 94: - case 196: - case 180: - case 185: - case 192: - case 214: + case 190 /* BreakStatement */: + case 189 /* ContinueStatement */: + case 197 /* DebuggerStatement */: + case 184 /* DoStatement */: + case 182 /* ExpressionStatement */: + case 181 /* EmptyStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: + case 186 /* ForStatement */: + case 183 /* IfStatement */: + case 194 /* LabeledStatement */: + case 191 /* ReturnStatement */: + case 193 /* SwitchStatement */: + case 94 /* ThrowKeyword */: + case 196 /* TryStatement */: + case 180 /* VariableStatement */: + case 185 /* WhileStatement */: + case 192 /* WithStatement */: + case 214 /* ExportAssignment */: return true; default: return false; @@ -4507,24 +4990,26 @@ var ts; ts.isStatement = isStatement; function isClassElement(n) { switch (n.kind) { - case 135: - case 132: - case 134: - case 136: - case 137: - case 140: + case 135 /* Constructor */: + case 132 /* PropertyDeclaration */: + case 134 /* MethodDeclaration */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 133 /* MethodSignature */: + case 140 /* IndexSignature */: return true; default: return false; } } ts.isClassElement = isClassElement; + // True if the given identifier, string literal, or number literal is the name of a declaration node function isDeclarationName(name) { - if (name.kind !== 65 && name.kind !== 8 && name.kind !== 7) { + if (name.kind !== 65 /* Identifier */ && name.kind !== 8 /* StringLiteral */ && name.kind !== 7 /* NumericLiteral */) { return false; } var parent = name.parent; - if (parent.kind === 213 || parent.kind === 217) { + if (parent.kind === 213 /* ImportSpecifier */ || parent.kind === 217 /* ExportSpecifier */) { if (parent.propertyName) { return true; } @@ -4535,27 +5020,35 @@ var ts; return false; } ts.isDeclarationName = isDeclarationName; + // An alias symbol is created by one of the following declarations: + // import = ... + // import from ... + // import * as from ... + // import { x as } from ... + // export { x as } from ... + // export = ... + // export default ... function isAliasSymbolDeclaration(node) { - return node.kind === 208 || - node.kind === 210 && !!node.name || - node.kind === 211 || - node.kind === 213 || - node.kind === 217 || - node.kind === 214 && node.expression.kind === 65; + return node.kind === 208 /* ImportEqualsDeclaration */ || + node.kind === 210 /* ImportClause */ && !!node.name || + node.kind === 211 /* NamespaceImport */ || + node.kind === 213 /* ImportSpecifier */ || + node.kind === 217 /* ExportSpecifier */ || + node.kind === 214 /* ExportAssignment */ && node.expression.kind === 65 /* Identifier */; } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getClassExtendsHeritageClauseElement(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 79); + var heritageClause = getHeritageClause(node.heritageClauses, 79 /* ExtendsKeyword */); return heritageClause && heritageClause.types.length > 0 ? heritageClause.types[0] : undefined; } ts.getClassExtendsHeritageClauseElement = getClassExtendsHeritageClauseElement; function getClassImplementsHeritageClauseElements(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 103); + var heritageClause = getHeritageClause(node.heritageClauses, 102 /* ImplementsKeyword */); return heritageClause ? heritageClause.types : undefined; } ts.getClassImplementsHeritageClauseElements = getClassImplementsHeritageClauseElements; function getInterfaceBaseTypeNodes(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 79); + var heritageClause = getHeritageClause(node.heritageClauses, 79 /* ExtendsKeyword */); return heritageClause ? heritageClause.types : undefined; } ts.getInterfaceBaseTypeNodes = getInterfaceBaseTypeNodes; @@ -4624,28 +5117,40 @@ var ts; } ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; function isKeyword(token) { - return 66 <= token && token <= 125; + return 66 /* FirstKeyword */ <= token && token <= 125 /* LastKeyword */; } ts.isKeyword = isKeyword; function isTrivia(token) { - return 2 <= token && token <= 6; + return 2 /* FirstTriviaToken */ <= token && token <= 6 /* LastTriviaToken */; } ts.isTrivia = isTrivia; + /** + * A declaration has a dynamic name if both of the following are true: + * 1. The declaration has a computed property name + * 2. The computed name is *not* expressed as Symbol., where name + * is a property of the Symbol constructor that denotes a built in + * Symbol. + */ function hasDynamicName(declaration) { return declaration.name && - declaration.name.kind === 127 && + declaration.name.kind === 127 /* ComputedPropertyName */ && !isWellKnownSymbolSyntactically(declaration.name.expression); } ts.hasDynamicName = hasDynamicName; + /** + * Checks if the expression is of the form: + * Symbol.name + * where Symbol is literally the word "Symbol", and name is any identifierName + */ function isWellKnownSymbolSyntactically(node) { - return node.kind === 155 && isESSymbolIdentifier(node.expression); + return node.kind === 155 /* PropertyAccessExpression */ && isESSymbolIdentifier(node.expression); } ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically; function getPropertyNameForPropertyNameNode(name) { - if (name.kind === 65 || name.kind === 8 || name.kind === 7) { + if (name.kind === 65 /* Identifier */ || name.kind === 8 /* StringLiteral */ || name.kind === 7 /* NumericLiteral */) { return name.text; } - if (name.kind === 127) { + if (name.kind === 127 /* ComputedPropertyName */) { var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { var rightHandSideName = nameExpression.name.text; @@ -4659,136 +5164,30 @@ var ts; return "__@" + symbolName; } ts.getPropertyNameForKnownSymbolName = getPropertyNameForKnownSymbolName; + /** + * Includes the word "Symbol" with unicode escapes + */ function isESSymbolIdentifier(node) { - return node.kind === 65 && node.text === "Symbol"; + return node.kind === 65 /* Identifier */ && node.text === "Symbol"; } ts.isESSymbolIdentifier = isESSymbolIdentifier; function isModifier(token) { switch (token) { - case 109: - case 107: - case 108: - case 110: - case 78: - case 115: - case 70: - case 73: + case 108 /* PublicKeyword */: + case 106 /* PrivateKeyword */: + case 107 /* ProtectedKeyword */: + case 109 /* StaticKeyword */: + case 78 /* ExportKeyword */: + case 115 /* DeclareKeyword */: + case 70 /* ConstKeyword */: + case 73 /* DefaultKeyword */: return true; } return false; } ts.isModifier = isModifier; - function textSpanEnd(span) { - return span.start + span.length; - } - ts.textSpanEnd = textSpanEnd; - function textSpanIsEmpty(span) { - return span.length === 0; - } - ts.textSpanIsEmpty = textSpanIsEmpty; - function textSpanContainsPosition(span, position) { - return position >= span.start && position < textSpanEnd(span); - } - ts.textSpanContainsPosition = textSpanContainsPosition; - function textSpanContainsTextSpan(span, other) { - return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span); - } - ts.textSpanContainsTextSpan = textSpanContainsTextSpan; - function textSpanOverlapsWith(span, other) { - var overlapStart = Math.max(span.start, other.start); - var overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other)); - return overlapStart < overlapEnd; - } - ts.textSpanOverlapsWith = textSpanOverlapsWith; - function textSpanOverlap(span1, span2) { - var overlapStart = Math.max(span1.start, span2.start); - var overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); - if (overlapStart < overlapEnd) { - return createTextSpanFromBounds(overlapStart, overlapEnd); - } - return undefined; - } - ts.textSpanOverlap = textSpanOverlap; - function textSpanIntersectsWithTextSpan(span, other) { - return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start; - } - ts.textSpanIntersectsWithTextSpan = textSpanIntersectsWithTextSpan; - function textSpanIntersectsWith(span, start, length) { - var end = start + length; - return start <= textSpanEnd(span) && end >= span.start; - } - ts.textSpanIntersectsWith = textSpanIntersectsWith; - function textSpanIntersectsWithPosition(span, position) { - return position <= textSpanEnd(span) && position >= span.start; - } - ts.textSpanIntersectsWithPosition = textSpanIntersectsWithPosition; - function textSpanIntersection(span1, span2) { - var intersectStart = Math.max(span1.start, span2.start); - var intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); - if (intersectStart <= intersectEnd) { - return createTextSpanFromBounds(intersectStart, intersectEnd); - } - return undefined; - } - ts.textSpanIntersection = textSpanIntersection; - function createTextSpan(start, length) { - if (start < 0) { - throw new Error("start < 0"); - } - if (length < 0) { - throw new Error("length < 0"); - } - return { start: start, length: length }; - } - ts.createTextSpan = createTextSpan; - function createTextSpanFromBounds(start, end) { - return createTextSpan(start, end - start); - } - ts.createTextSpanFromBounds = createTextSpanFromBounds; - function textChangeRangeNewSpan(range) { - return createTextSpan(range.span.start, range.newLength); - } - ts.textChangeRangeNewSpan = textChangeRangeNewSpan; - function textChangeRangeIsUnchanged(range) { - return textSpanIsEmpty(range.span) && range.newLength === 0; - } - ts.textChangeRangeIsUnchanged = textChangeRangeIsUnchanged; - function createTextChangeRange(span, newLength) { - if (newLength < 0) { - throw new Error("newLength < 0"); - } - return { span: span, newLength: newLength }; - } - ts.createTextChangeRange = createTextChangeRange; - ts.unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0); - function collapseTextChangeRangesAcrossMultipleVersions(changes) { - if (changes.length === 0) { - return ts.unchangedTextChangeRange; - } - if (changes.length === 1) { - return changes[0]; - } - var change0 = changes[0]; - var oldStartN = change0.span.start; - var oldEndN = textSpanEnd(change0.span); - var newEndN = oldStartN + change0.newLength; - for (var i = 1; i < changes.length; i++) { - var nextChange = changes[i]; - var oldStart1 = oldStartN; - var oldEnd1 = oldEndN; - var newEnd1 = newEndN; - var oldStart2 = nextChange.span.start; - var oldEnd2 = textSpanEnd(nextChange.span); - var newEnd2 = oldStart2 + nextChange.newLength; - oldStartN = Math.min(oldStart1, oldStart2); - oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)); - newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)); - } - return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), newEndN - oldStartN); - } - ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function nodeStartsNewLexicalEnvironment(n) { - return isFunctionLike(n) || n.kind === 205 || n.kind === 227; + return isFunctionLike(n) || n.kind === 205 /* ModuleDeclaration */ || n.kind === 227 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(node) { @@ -4803,6 +5202,13 @@ var ts; return node; } ts.createSynthesizedNode = createSynthesizedNode; + function createSynthesizedNodeArray() { + var array = []; + array.pos = -1; + array.end = -1; + return array; + } + ts.createSynthesizedNodeArray = createSynthesizedNodeArray; function createDiagnosticCollection() { var nonFileDiagnostics = []; var fileDiagnostics = {}; @@ -4868,6 +5274,11 @@ var ts; } } ts.createDiagnosticCollection = createDiagnosticCollection; + // This consists of the first 19 unprintable ASCII characters, canonical escapes, lineSeparator, + // paragraphSeparator, and nextLine. The latter three are just desirable to suppress new lines in + // the language service. These characters should be escaped when printing, and if any characters are added, + // the map below must be updated. Note that this regexp *does not* include the 'delete' character. + // There is no reason for this other than that JSON.stringify does not handle it either. var escapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; var escapedCharsMap = { "\0": "\\0", @@ -4881,8 +5292,13 @@ var ts; "\"": "\\\"", "\u2028": "\\u2028", "\u2029": "\\u2029", - "\u0085": "\\u0085" + "\u0085": "\\u0085" // nextLine }; + /** + * 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) + * Note that this doesn't actually wrap the input in double quotes. + */ function escapeString(s) { s = escapedCharsRegExp.test(s) ? s.replace(escapedCharsRegExp, getReplacement) : s; return s; @@ -4898,6 +5314,8 @@ var ts; } var nonAsciiCharacters = /[^\u0000-\u007F]/g; function escapeNonAsciiCharacters(s) { + // Replace non-ASCII characters with '\uNNNN' escapes if any exist. + // Otherwise just return the original string. return nonAsciiCharacters.test(s) ? s.replace(nonAsciiCharacters, function (c) { return get16BitUnicodeEscapeSequence(c.charCodeAt(0)); }) : s; @@ -5005,7 +5423,7 @@ var ts; ts.getLineOfLocalPosition = getLineOfLocalPosition; function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 135 && nodeIsPresent(member.body)) { + if (member.kind === 135 /* Constructor */ && nodeIsPresent(member.body)) { return member; } }); @@ -5028,10 +5446,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 136) { + if (accessor.kind === 136 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 137) { + else if (accessor.kind === 137 /* SetAccessor */) { setAccessor = accessor; } else { @@ -5040,8 +5458,8 @@ var ts; } else { ts.forEach(declarations, function (member) { - if ((member.kind === 136 || member.kind === 137) - && (member.flags & 128) === (accessor.flags & 128)) { + if ((member.kind === 136 /* GetAccessor */ || member.kind === 137 /* SetAccessor */) + && (member.flags & 128 /* Static */) === (accessor.flags & 128 /* Static */)) { var memberName = getPropertyNameForPropertyNameNode(member.name); var accessorName = getPropertyNameForPropertyNameNode(accessor.name); if (memberName === accessorName) { @@ -5051,10 +5469,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 136 && !getAccessor) { + if (member.kind === 136 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 137 && !setAccessor) { + if (member.kind === 137 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -5070,6 +5488,7 @@ var ts; } ts.getAllAccessorDeclarations = getAllAccessorDeclarations; function emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments) { + // If the leading comments start on different line than the start of node, write new line if (leadingComments && leadingComments.length && node.pos !== leadingComments[0].pos && getLineOfLocalPosition(currentSourceFile, node.pos) !== getLineOfLocalPosition(currentSourceFile, leadingComments[0].pos)) { writer.writeLine(); @@ -5091,13 +5510,14 @@ var ts; writer.write(" "); } else { + // Emit leading space to separate comment during next comment emit emitLeadingSpace = true; } }); } ts.emitComments = emitComments; function writeCommentRange(currentSourceFile, writer, comment, newLine) { - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42) { + if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42 /* asterisk */) { var firstCommentLineAndCharacter = ts.getLineAndCharacterOfPosition(currentSourceFile, comment.pos); var lineCount = ts.getLineStarts(currentSourceFile).length; var firstCommentLineIndent; @@ -5106,51 +5526,76 @@ var ts; ? currentSourceFile.text.length + 1 : getStartPositionOfLine(currentLine + 1, currentSourceFile); if (pos !== comment.pos) { + // If we are not emitting first line, we need to write the spaces to adjust the alignment if (firstCommentLineIndent === undefined) { firstCommentLineIndent = calculateIndent(getStartPositionOfLine(firstCommentLineAndCharacter.line, currentSourceFile), comment.pos); } + // These are number of spaces writer is going to write at current indent var currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); + // Number of spaces we want to be writing + // eg: Assume writer indent + // module m { + // /* starts at character 9 this is line 1 + // * starts at character pos 4 line --1 = 8 - 8 + 3 + // More left indented comment */ --2 = 8 - 8 + 2 + // class c { } + // } + // module m { + // /* this is line 1 -- Assume current writer indent 8 + // * line --3 = 8 - 4 + 5 + // More right indented comment */ --4 = 8 - 4 + 11 + // class c { } + // } var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(pos, nextLineStart); if (spacesToEmit > 0) { var numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); var indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); + // Write indent size string ( in eg 1: = "", 2: "" , 3: string with 8 spaces 4: string with 12 spaces writer.rawWrite(indentSizeSpaceString); + // Emit the single spaces (in eg: 1: 3 spaces, 2: 2 spaces, 3: 1 space, 4: 3 spaces) while (numberOfSingleSpacesToEmit) { writer.rawWrite(" "); numberOfSingleSpacesToEmit--; } } else { + // No spaces to emit write empty string writer.rawWrite(""); } } + // Write the comment line text writeTrimmedCurrentLine(pos, nextLineStart); pos = nextLineStart; } } else { + // Single line comment of style //.... 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) { + // trimmed forward and ending spaces text writer.write(currentLineText); if (end !== comment.end) { writer.writeLine(); } } else { + // Empty string - make sure we write empty line 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) { + if (currentSourceFile.text.charCodeAt(pos) === 9 /* tab */) { + // Tabs = TabSize = indent size and go to next tabStop currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); } else { + // Single space currentLineIndent++; } } @@ -5158,15 +5603,65 @@ var ts; } } ts.writeCommentRange = writeCommentRange; + function modifierToFlag(token) { + switch (token) { + case 109 /* StaticKeyword */: return 128 /* Static */; + case 108 /* PublicKeyword */: return 16 /* Public */; + case 107 /* ProtectedKeyword */: return 64 /* Protected */; + case 106 /* PrivateKeyword */: return 32 /* Private */; + case 78 /* ExportKeyword */: return 1 /* Export */; + case 115 /* DeclareKeyword */: return 2 /* Ambient */; + case 70 /* ConstKeyword */: return 8192 /* Const */; + case 73 /* DefaultKeyword */: return 256 /* Default */; + } + return 0; + } + ts.modifierToFlag = modifierToFlag; + function isLeftHandSideExpression(expr) { + if (expr) { + switch (expr.kind) { + case 155 /* PropertyAccessExpression */: + case 156 /* ElementAccessExpression */: + case 158 /* NewExpression */: + case 157 /* CallExpression */: + case 159 /* TaggedTemplateExpression */: + case 153 /* ArrayLiteralExpression */: + case 161 /* ParenthesizedExpression */: + case 154 /* ObjectLiteralExpression */: + case 174 /* ClassExpression */: + case 162 /* FunctionExpression */: + case 65 /* Identifier */: + case 9 /* RegularExpressionLiteral */: + case 7 /* NumericLiteral */: + case 8 /* StringLiteral */: + case 10 /* NoSubstitutionTemplateLiteral */: + case 171 /* TemplateExpression */: + case 80 /* FalseKeyword */: + case 89 /* NullKeyword */: + case 93 /* ThisKeyword */: + case 95 /* TrueKeyword */: + case 91 /* SuperKeyword */: + return true; + } + } + return false; + } + ts.isLeftHandSideExpression = isLeftHandSideExpression; + function isAssignmentOperator(token) { + return token >= 53 /* FirstAssignment */ && token <= 64 /* LastAssignment */; + } + ts.isAssignmentOperator = isAssignmentOperator; + // Returns false if this heritage clause element's expression contains something unsupported + // (i.e. not a name or dotted name). function isSupportedHeritageClauseElement(node) { return isSupportedHeritageClauseElementExpression(node.expression); } ts.isSupportedHeritageClauseElement = isSupportedHeritageClauseElement; function isSupportedHeritageClauseElementExpression(node) { - if (node.kind === 65) { + if (node.kind === 65 /* Identifier */) { return true; } - else if (node.kind === 155) { + else if (node.kind === 155 /* PropertyAccessExpression */) { return isSupportedHeritageClauseElementExpression(node.expression); } else { @@ -5174,21 +5669,227 @@ var ts; } } function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 126 && node.parent.right === node) || - (node.parent.kind === 155 && node.parent.name === node); + return (node.parent.kind === 126 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 155 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function getLocalSymbolForExportDefault(symbol) { - return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & 256) ? symbol.valueDeclaration.localSymbol : undefined; + return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & 256 /* Default */) ? symbol.valueDeclaration.localSymbol : undefined; } ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; })(ts || (ts = {})); +var ts; +(function (ts) { + function getDefaultLibFileName(options) { + return options.target === 2 /* ES6 */ ? "lib.es6.d.ts" : "lib.d.ts"; + } + ts.getDefaultLibFileName = getDefaultLibFileName; + function textSpanEnd(span) { + return span.start + span.length; + } + ts.textSpanEnd = textSpanEnd; + function textSpanIsEmpty(span) { + return span.length === 0; + } + ts.textSpanIsEmpty = textSpanIsEmpty; + function textSpanContainsPosition(span, position) { + return position >= span.start && position < textSpanEnd(span); + } + ts.textSpanContainsPosition = textSpanContainsPosition; + // Returns true if 'span' contains 'other'. + function textSpanContainsTextSpan(span, other) { + return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span); + } + ts.textSpanContainsTextSpan = textSpanContainsTextSpan; + function textSpanOverlapsWith(span, other) { + var overlapStart = Math.max(span.start, other.start); + var overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other)); + return overlapStart < overlapEnd; + } + ts.textSpanOverlapsWith = textSpanOverlapsWith; + function textSpanOverlap(span1, span2) { + var overlapStart = Math.max(span1.start, span2.start); + var overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); + if (overlapStart < overlapEnd) { + return createTextSpanFromBounds(overlapStart, overlapEnd); + } + return undefined; + } + ts.textSpanOverlap = textSpanOverlap; + function textSpanIntersectsWithTextSpan(span, other) { + return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start; + } + ts.textSpanIntersectsWithTextSpan = textSpanIntersectsWithTextSpan; + function textSpanIntersectsWith(span, start, length) { + var end = start + length; + return start <= textSpanEnd(span) && end >= span.start; + } + ts.textSpanIntersectsWith = textSpanIntersectsWith; + function textSpanIntersectsWithPosition(span, position) { + return position <= textSpanEnd(span) && position >= span.start; + } + ts.textSpanIntersectsWithPosition = textSpanIntersectsWithPosition; + function textSpanIntersection(span1, span2) { + var intersectStart = Math.max(span1.start, span2.start); + var intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); + if (intersectStart <= intersectEnd) { + return createTextSpanFromBounds(intersectStart, intersectEnd); + } + return undefined; + } + ts.textSpanIntersection = textSpanIntersection; + function createTextSpan(start, length) { + if (start < 0) { + throw new Error("start < 0"); + } + if (length < 0) { + throw new Error("length < 0"); + } + return { start: start, length: length }; + } + ts.createTextSpan = createTextSpan; + function createTextSpanFromBounds(start, end) { + return createTextSpan(start, end - start); + } + ts.createTextSpanFromBounds = createTextSpanFromBounds; + function textChangeRangeNewSpan(range) { + return createTextSpan(range.span.start, range.newLength); + } + ts.textChangeRangeNewSpan = textChangeRangeNewSpan; + function textChangeRangeIsUnchanged(range) { + return textSpanIsEmpty(range.span) && range.newLength === 0; + } + ts.textChangeRangeIsUnchanged = textChangeRangeIsUnchanged; + function createTextChangeRange(span, newLength) { + if (newLength < 0) { + throw new Error("newLength < 0"); + } + return { span: span, newLength: newLength }; + } + ts.createTextChangeRange = createTextChangeRange; + ts.unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0); + /** + * Called to merge all the changes that occurred across several versions of a script snapshot + * into a single change. i.e. if a user keeps making successive edits to a script we will + * have a text change from V1 to V2, V2 to V3, ..., Vn. + * + * This function will then merge those changes into a single change range valid between V1 and + * Vn. + */ + function collapseTextChangeRangesAcrossMultipleVersions(changes) { + if (changes.length === 0) { + return ts.unchangedTextChangeRange; + } + if (changes.length === 1) { + return changes[0]; + } + // We change from talking about { { oldStart, oldLength }, newLength } to { oldStart, oldEnd, newEnd } + // as it makes things much easier to reason about. + var change0 = changes[0]; + var oldStartN = change0.span.start; + var oldEndN = textSpanEnd(change0.span); + var newEndN = oldStartN + change0.newLength; + for (var i = 1; i < changes.length; i++) { + var nextChange = changes[i]; + // Consider the following case: + // i.e. two edits. The first represents the text change range { { 10, 50 }, 30 }. i.e. The span starting + // at 10, with length 50 is reduced to length 30. The second represents the text change range { { 30, 30 }, 40 }. + // i.e. the span starting at 30 with length 30 is increased to length 40. + // + // 0 10 20 30 40 50 60 70 80 90 100 + // ------------------------------------------------------------------------------------------------------- + // | / + // | /---- + // T1 | /---- + // | /---- + // | /---- + // ------------------------------------------------------------------------------------------------------- + // | \ + // | \ + // T2 | \ + // | \ + // | \ + // ------------------------------------------------------------------------------------------------------- + // + // Merging these turns out to not be too difficult. First, determining the new start of the change is trivial + // it's just the min of the old and new starts. i.e.: + // + // 0 10 20 30 40 50 60 70 80 90 100 + // ------------------------------------------------------------*------------------------------------------ + // | / + // | /---- + // T1 | /---- + // | /---- + // | /---- + // ----------------------------------------$-------------------$------------------------------------------ + // . | \ + // . | \ + // T2 . | \ + // . | \ + // . | \ + // ----------------------------------------------------------------------*-------------------------------- + // + // (Note the dots represent the newly inferrred start. + // Determining the new and old end is also pretty simple. Basically it boils down to paying attention to the + // absolute positions at the asterixes, and the relative change between the dollar signs. Basically, we see + // which if the two $'s precedes the other, and we move that one forward until they line up. in this case that + // means: + // + // 0 10 20 30 40 50 60 70 80 90 100 + // --------------------------------------------------------------------------------*---------------------- + // | / + // | /---- + // T1 | /---- + // | /---- + // | /---- + // ------------------------------------------------------------$------------------------------------------ + // . | \ + // . | \ + // T2 . | \ + // . | \ + // . | \ + // ----------------------------------------------------------------------*-------------------------------- + // + // In other words (in this case), we're recognizing that the second edit happened after where the first edit + // ended with a delta of 20 characters (60 - 40). Thus, if we go back in time to where the first edit started + // that's the same as if we started at char 80 instead of 60. + // + // As it so happens, the same logic applies if the second edit precedes the first edit. In that case rahter + // than pusing the first edit forward to match the second, we'll push the second edit forward to match the + // first. + // + // In this case that means we have { oldStart: 10, oldEnd: 80, newEnd: 70 } or, in TextChangeRange + // semantics: { { start: 10, length: 70 }, newLength: 60 } + // + // The math then works out as follows. + // If we have { oldStart1, oldEnd1, newEnd1 } and { oldStart2, oldEnd2, newEnd2 } then we can compute the + // final result like so: + // + // { + // oldStart3: Min(oldStart1, oldStart2), + // oldEnd3 : Max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)), + // newEnd3 : Max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)) + // } + var oldStart1 = oldStartN; + var oldEnd1 = oldEndN; + var newEnd1 = newEndN; + var oldStart2 = nextChange.span.start; + var oldEnd2 = textSpanEnd(nextChange.span); + var newEnd2 = oldStart2 + nextChange.newLength; + oldStartN = Math.min(oldStart1, oldStart2); + oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)); + newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)); + } + return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), newEndN - oldStartN); + } + ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; +})(ts || (ts = {})); /// /// var ts; (function (ts) { - var nodeConstructors = new Array(229); - ts.parseTime = 0; + var nodeConstructors = new Array(229 /* Count */); + /* @internal */ ts.parseTime = 0; function getNodeConstructor(kind) { return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); } @@ -5218,27 +5919,34 @@ var ts; } } } + // Invokes a callback for each child of the given node. The 'cbNode' callback is invoked for all child nodes + // stored in properties. If a 'cbNodes' callback is specified, it is invoked for embedded arrays; otherwise, + // embedded arrays are flattened and the 'cbNode' callback is invoked for each element. If a callback returns + // a truthy value, iteration stops and that value is returned. Otherwise, undefined is returned. function forEachChild(node, cbNode, cbNodeArray) { if (!node) { return; } + // The visitXXX functions could be written as local functions that close over the cbNode and cbNodeArray + // callback parameters, but that causes a closure allocation for each invocation with noticeable effects + // on performance. var visitNodes = cbNodeArray ? visitNodeArray : visitEachNode; var cbNodes = cbNodeArray || cbNode; switch (node.kind) { - case 126: + case 126 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 128: + case 128 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.expression); - case 129: - case 132: - case 131: - case 224: - case 225: - case 198: - case 152: + case 129 /* Parameter */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 224 /* PropertyAssignment */: + case 225 /* ShorthandPropertyAssignment */: + case 198 /* VariableDeclaration */: + case 152 /* BindingElement */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.propertyName) || @@ -5247,24 +5955,24 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 142: - case 143: - case 138: - case 139: - case 140: + case 142 /* FunctionType */: + case 143 /* ConstructorType */: + case 138 /* CallSignature */: + case 139 /* ConstructSignature */: + case 140 /* IndexSignature */: 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: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 135 /* Constructor */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 162 /* FunctionExpression */: + case 200 /* FunctionDeclaration */: + case 163 /* ArrowFunction */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -5275,642 +5983,408 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 141: + case 141 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNodes, node.typeArguments); - case 144: + case 144 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 145: + case 145 /* TypeLiteral */: return visitNodes(cbNodes, node.members); - case 146: + case 146 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 147: + case 147 /* TupleType */: return visitNodes(cbNodes, node.elementTypes); - case 148: + case 148 /* UnionType */: return visitNodes(cbNodes, node.types); - case 149: + case 149 /* ParenthesizedType */: return visitNode(cbNode, node.type); - case 150: - case 151: + case 150 /* ObjectBindingPattern */: + case 151 /* ArrayBindingPattern */: return visitNodes(cbNodes, node.elements); - case 153: + case 153 /* ArrayLiteralExpression */: return visitNodes(cbNodes, node.elements); - case 154: + case 154 /* ObjectLiteralExpression */: return visitNodes(cbNodes, node.properties); - case 155: + case 155 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.dotToken) || visitNode(cbNode, node.name); - case 156: + case 156 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 157: - case 158: + case 157 /* CallExpression */: + case 158 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments) || visitNodes(cbNodes, node.arguments); - case 159: + case 159 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 160: + case 160 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 161: + case 161 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 164: + case 164 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 165: + case 165 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 166: + case 166 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 167: + case 167 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 172: + case 172 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 168: + case 168 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 169: + case 169 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 170: + case 170 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 173: + case 173 /* SpreadElementExpression */: return visitNode(cbNode, node.expression); - case 179: - case 206: + case 179 /* Block */: + case 206 /* ModuleBlock */: return visitNodes(cbNodes, node.statements); - case 227: + case 227 /* SourceFile */: return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 180: + case 180 /* VariableStatement */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 199: + case 199 /* VariableDeclarationList */: return visitNodes(cbNodes, node.declarations); - case 182: + case 182 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 183: + case 183 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 184: + case 184 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 185: + case 185 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 186: + case 186 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.iterator) || visitNode(cbNode, node.statement); - case 187: + case 187 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 188: + case 188 /* ForOfStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 189: - case 190: + case 189 /* ContinueStatement */: + case 190 /* BreakStatement */: return visitNode(cbNode, node.label); - case 191: + case 191 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 192: + case 192 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 193: + case 193 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 207: + case 207 /* CaseBlock */: return visitNodes(cbNodes, node.clauses); - case 220: + case 220 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.statements); - case 221: + case 221 /* DefaultClause */: return visitNodes(cbNodes, node.statements); - case 194: + case 194 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 195: + case 195 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 196: + case 196 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 223: + case 223 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 130: + case 130 /* Decorator */: return visitNode(cbNode, node.expression); - case 201: - case 174: + case 201 /* ClassDeclaration */: + case 174 /* ClassExpression */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); - case 202: + case 202 /* InterfaceDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); - case 203: + case 203 /* TypeAliasDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.type); - case 204: + case 204 /* EnumDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.members); - case 226: + case 226 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 205: + case 205 /* ModuleDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 208: + case 208 /* ImportEqualsDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 209: + case 209 /* ImportDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 210: + case 210 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 211: + case 211 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 212: - case 216: + case 212 /* NamedImports */: + case 216 /* NamedExports */: return visitNodes(cbNodes, node.elements); - case 215: + case 215 /* ExportDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 213: - case 217: + case 213 /* ImportSpecifier */: + case 217 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 214: + case 214 /* ExportAssignment */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.type); - case 171: + visitNode(cbNode, node.expression); + case 171 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); - case 176: + case 176 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 127: + case 127 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 222: + case 222 /* HeritageClause */: return visitNodes(cbNodes, node.types); - case 177: + case 177 /* HeritageClauseElement */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments); - case 219: + case 219 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 218: + case 218 /* MissingDeclaration */: return visitNodes(cbNodes, node.decorators); } } ts.forEachChild = forEachChild; - var ParsingContext; - (function (ParsingContext) { - ParsingContext[ParsingContext["SourceElements"] = 0] = "SourceElements"; - ParsingContext[ParsingContext["ModuleElements"] = 1] = "ModuleElements"; - ParsingContext[ParsingContext["BlockStatements"] = 2] = "BlockStatements"; - ParsingContext[ParsingContext["SwitchClauses"] = 3] = "SwitchClauses"; - ParsingContext[ParsingContext["SwitchClauseStatements"] = 4] = "SwitchClauseStatements"; - ParsingContext[ParsingContext["TypeMembers"] = 5] = "TypeMembers"; - ParsingContext[ParsingContext["ClassMembers"] = 6] = "ClassMembers"; - ParsingContext[ParsingContext["EnumMembers"] = 7] = "EnumMembers"; - ParsingContext[ParsingContext["HeritageClauseElement"] = 8] = "HeritageClauseElement"; - ParsingContext[ParsingContext["VariableDeclarations"] = 9] = "VariableDeclarations"; - ParsingContext[ParsingContext["ObjectBindingElements"] = 10] = "ObjectBindingElements"; - ParsingContext[ParsingContext["ArrayBindingElements"] = 11] = "ArrayBindingElements"; - ParsingContext[ParsingContext["ArgumentExpressions"] = 12] = "ArgumentExpressions"; - ParsingContext[ParsingContext["ObjectLiteralMembers"] = 13] = "ObjectLiteralMembers"; - ParsingContext[ParsingContext["ArrayLiteralMembers"] = 14] = "ArrayLiteralMembers"; - ParsingContext[ParsingContext["Parameters"] = 15] = "Parameters"; - ParsingContext[ParsingContext["TypeParameters"] = 16] = "TypeParameters"; - ParsingContext[ParsingContext["TypeArguments"] = 17] = "TypeArguments"; - ParsingContext[ParsingContext["TupleElementTypes"] = 18] = "TupleElementTypes"; - ParsingContext[ParsingContext["HeritageClauses"] = 19] = "HeritageClauses"; - ParsingContext[ParsingContext["ImportOrExportSpecifiers"] = 20] = "ImportOrExportSpecifiers"; - ParsingContext[ParsingContext["Count"] = 21] = "Count"; - })(ParsingContext || (ParsingContext = {})); - var Tristate; - (function (Tristate) { - Tristate[Tristate["False"] = 0] = "False"; - Tristate[Tristate["True"] = 1] = "True"; - Tristate[Tristate["Unknown"] = 2] = "Unknown"; - })(Tristate || (Tristate = {})); - 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.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 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) { - // 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; - forEachChild(n, visitNode); - parent = saveParent; - } - } - } - function shouldCheckNode(node) { - switch (node.kind) { - case 8: - case 7: - case 65: - return true; - } - return false; - } - function moveElementEntirelyPastChangeRange(element, isArray, delta, oldText, newText, aggressiveChecks) { - if (isArray) { - visitArray(element); - } - else { - visitNode(element); - } - return; - function visitNode(node) { - if (aggressiveChecks && shouldCheckNode(node)) { - var text = oldText.substring(node.pos, node.end); - } - node._children = undefined; - node.pos += delta; - node.end += delta; - if (aggressiveChecks && shouldCheckNode(node)) { - ts.Debug.assert(text === newText.substring(node.pos, node.end)); - } - forEachChild(node, visitNode, visitArray); - checkNodePositions(node, aggressiveChecks); - } - function visitArray(array) { - array._children = undefined; - array.pos += delta; - array.end += delta; - for (var _i = 0; _i < array.length; _i++) { - var node = array[_i]; - visitNode(node); - } - } - } - function adjustIntersectingElement(element, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta) { - ts.Debug.assert(element.end >= changeStart, "Adjusting an element that was entirely before the change range"); - ts.Debug.assert(element.pos <= changeRangeOldEnd, "Adjusting an element that was entirely after the change range"); - ts.Debug.assert(element.pos <= element.end); - element.pos = Math.min(element.pos, changeRangeNewEnd); - if (element.end >= changeRangeOldEnd) { - element.end += delta; - } - else { - element.end = Math.min(element.end, changeRangeNewEnd); - } - ts.Debug.assert(element.pos <= element.end); - if (element.parent) { - ts.Debug.assert(element.pos >= element.parent.pos); - ts.Debug.assert(element.end <= element.parent.end); - } - } - function checkNodePositions(node, aggressiveChecks) { - if (aggressiveChecks) { - var pos = node.pos; - forEachChild(node, function (child) { - ts.Debug.assert(child.pos >= pos); - pos = child.end; - }); - ts.Debug.assert(pos <= node.end); - } - } - function updateTokenPositionsAndMarkElements(sourceFile, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta, oldText, newText, aggressiveChecks) { - visitNode(sourceFile); - return; - function visitNode(child) { - ts.Debug.assert(child.pos <= child.end); - if (child.pos > changeRangeOldEnd) { - moveElementEntirelyPastChangeRange(child, false, delta, oldText, newText, aggressiveChecks); - return; - } - var fullEnd = child.end; - if (fullEnd >= changeStart) { - child.intersectsChange = true; - child._children = undefined; - adjustIntersectingElement(child, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - forEachChild(child, visitNode, visitArray); - checkNodePositions(child, aggressiveChecks); - return; - } - ts.Debug.assert(fullEnd < changeStart); - } - function visitArray(array) { - ts.Debug.assert(array.pos <= array.end); - if (array.pos > changeRangeOldEnd) { - moveElementEntirelyPastChangeRange(array, true, delta, oldText, newText, aggressiveChecks); - return; - } - var fullEnd = array.end; - if (fullEnd >= changeStart) { - array.intersectsChange = true; - array._children = undefined; - adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - for (var _i = 0; _i < array.length; _i++) { - var node = array[_i]; - visitNode(node); - } - return; - } - ts.Debug.assert(fullEnd < changeStart); - } - } - function extendToAffectedRange(sourceFile, changeRange) { - var maxLookahead = 1; - var start = changeRange.span.start; - for (var i = 0; start > 0 && i <= maxLookahead; i++) { - var nearestNode = findNearestNodeStartingBeforeOrAtPosition(sourceFile, start); - ts.Debug.assert(nearestNode.pos <= start); - var position = nearestNode.pos; - start = Math.max(0, position - 1); - } - var finalSpan = ts.createTextSpanFromBounds(start, ts.textSpanEnd(changeRange.span)); - var finalLength = changeRange.newLength + (changeRange.span.start - start); - return ts.createTextChangeRange(finalSpan, finalLength); - } - function findNearestNodeStartingBeforeOrAtPosition(sourceFile, position) { - var bestResult = sourceFile; - var lastNodeEntirelyBeforePosition; - forEachChild(sourceFile, visit); - if (lastNodeEntirelyBeforePosition) { - var lastChildOfLastEntireNodeBeforePosition = getLastChild(lastNodeEntirelyBeforePosition); - if (lastChildOfLastEntireNodeBeforePosition.pos > bestResult.pos) { - bestResult = lastChildOfLastEntireNodeBeforePosition; - } - } - return bestResult; - function getLastChild(node) { - while (true) { - var lastChild = getLastChildWorker(node); - if (lastChild) { - node = lastChild; - } - else { - return node; - } - } - } - function getLastChildWorker(node) { - var last = undefined; - forEachChild(node, function (child) { - if (ts.nodeIsPresent(child)) { - last = child; - } - }); - return last; - } - function visit(child) { - if (ts.nodeIsMissing(child)) { - return; - } - if (child.pos <= position) { - if (child.pos >= bestResult.pos) { - bestResult = child; - } - if (position < child.end) { - forEachChild(child, visit); - return true; - } - else { - ts.Debug.assert(child.end <= position); - lastNodeEntirelyBeforePosition = child; - } - } - else { - ts.Debug.assert(child.pos > position); - return true; - } - } - } - function checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks) { - var oldText = sourceFile.text; - if (textChangeRange) { - ts.Debug.assert((oldText.length - textChangeRange.span.length + textChangeRange.newLength) === newText.length); - if (aggressiveChecks || ts.Debug.shouldAssert(3)) { - var oldTextPrefix = oldText.substr(0, textChangeRange.span.start); - var newTextPrefix = newText.substr(0, textChangeRange.span.start); - ts.Debug.assert(oldTextPrefix === newTextPrefix); - var oldTextSuffix = oldText.substring(ts.textSpanEnd(textChangeRange.span), oldText.length); - var newTextSuffix = newText.substring(ts.textSpanEnd(ts.textChangeRangeNewSpan(textChangeRange)), newText.length); - ts.Debug.assert(oldTextSuffix === newTextSuffix); - } - } - } - function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks) { - aggressiveChecks = aggressiveChecks || ts.Debug.shouldAssert(2); - checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks); - if (ts.textChangeRangeIsUnchanged(textChangeRange)) { - return sourceFile; - } - if (sourceFile.statements.length === 0) { - return parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, undefined, true); - } - var incrementalSourceFile = sourceFile; - ts.Debug.assert(!incrementalSourceFile.hasBeenIncrementallyParsed); - incrementalSourceFile.hasBeenIncrementallyParsed = true; - var oldText = sourceFile.text; - var syntaxCursor = createSyntaxCursor(sourceFile); - var changeRange = extendToAffectedRange(sourceFile, textChangeRange); - checkChangeRange(sourceFile, newText, changeRange, aggressiveChecks); - ts.Debug.assert(changeRange.span.start <= textChangeRange.span.start); - ts.Debug.assert(ts.textSpanEnd(changeRange.span) === ts.textSpanEnd(textChangeRange.span)); - ts.Debug.assert(ts.textSpanEnd(ts.textChangeRangeNewSpan(changeRange)) === ts.textSpanEnd(ts.textChangeRangeNewSpan(textChangeRange))); - var delta = ts.textChangeRangeNewSpan(changeRange).length - changeRange.span.length; - updateTokenPositionsAndMarkElements(incrementalSourceFile, changeRange.span.start, ts.textSpanEnd(changeRange.span), ts.textSpanEnd(ts.textChangeRangeNewSpan(changeRange)), delta, oldText, newText, aggressiveChecks); - var result = parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, true); - return result; - } - ts.updateSourceFile = updateSourceFile; - function isEvalOrArgumentsIdentifier(node) { - return node.kind === 65 && - (node.text === "eval" || node.text === "arguments"); - } - ts.isEvalOrArgumentsIdentifier = isEvalOrArgumentsIdentifier; - function isUseStrictPrologueDirective(sourceFile, node) { - ts.Debug.assert(ts.isPrologueDirective(node)); - var nodeText = ts.getSourceTextOfNodeFromSourceFile(sourceFile, node.expression); - return nodeText === '"use strict"' || nodeText === "'use strict'"; - } - var InvalidPosition; - (function (InvalidPosition) { - InvalidPosition[InvalidPosition["Value"] = -1] = "Value"; - })(InvalidPosition || (InvalidPosition = {})); - function createSyntaxCursor(sourceFile) { - var currentArray = sourceFile.statements; - var currentArrayIndex = 0; - ts.Debug.assert(currentArrayIndex < currentArray.length); - var current = currentArray[currentArrayIndex]; - var lastQueriedPosition = -1; - return { - currentNode: function (position) { - if (position !== lastQueriedPosition) { - if (current && current.end === position && currentArrayIndex < (currentArray.length - 1)) { - currentArrayIndex++; - current = currentArray[currentArrayIndex]; - } - if (!current || current.pos !== position) { - findHighestListElementThatStartsAtPosition(position); - } - } - lastQueriedPosition = position; - ts.Debug.assert(!current || current.pos === position); - return current; - } - }; - function findHighestListElementThatStartsAtPosition(position) { - currentArray = undefined; - currentArrayIndex = -1; - current = undefined; - forEachChild(sourceFile, visitNode, visitArray); - return; - function visitNode(node) { - if (position >= node.pos && position < node.end) { - forEachChild(node, visitNode, visitArray); - return true; - } - return false; - } - function visitArray(array) { - if (position >= array.pos && position < array.end) { - for (var i = 0, n = array.length; i < n; i++) { - var child = array[i]; - if (child) { - if (child.pos === position) { - currentArray = array; - currentArrayIndex = i; - current = child; - return true; - } - else { - if (child.pos < position && position < child.end) { - forEachChild(child, visitNode, visitArray); - return true; - } - } - } - } - } - return false; - } - } - } function createSourceFile(fileName, sourceText, languageVersion, setParentNodes) { if (setParentNodes === void 0) { setParentNodes = false; } var start = new Date().getTime(); - var result = parseSourceFile(fileName, sourceText, languageVersion, undefined, setParentNodes); + var result = Parser.parseSourceFile(fileName, sourceText, languageVersion, undefined, setParentNodes); ts.parseTime += new Date().getTime() - start; return result; } 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; + // Produces a new SourceFile for the 'newText' provided. The 'textChangeRange' parameter + // indicates what changed between the 'text' that this SourceFile has and the 'newText'. + // The SourceFile will be created with the compiler attempting to reuse as many nodes from + // this file as possible. + // + // Note: this function mutates nodes from this SourceFile. That means any existing nodes + // from this SourceFile that are being held onto may change as a result (including + // becoming detached from any SourceFile). It is recommended that this SourceFile not + // be used once 'update' is called on it. + function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks) { + return IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks); + } + ts.updateSourceFile = updateSourceFile; + // Implement the parser as a singleton module. We do this for perf reasons because creating + // parser instances can actually be expensive enough to impact us on projects with many source + // files. + var Parser; + (function (Parser) { + // Share a single scanner across all calls to parse a source file. This helps speed things + // up by avoiding the cost of creating/compiling scanners over and over again. + var scanner = ts.createScanner(2 /* Latest */, true); + var disallowInAndDecoratorContext = 2 /* DisallowIn */ | 16 /* Decorator */; + var sourceFile; + var syntaxCursor; var token; - var sourceFile = createNode(227, 0); - sourceFile.pos = 0; - sourceFile.end = sourceText.length; - sourceFile.text = sourceText; - sourceFile.parseDiagnostics = []; - sourceFile.bindDiagnostics = []; - sourceFile.languageVersion = languageVersion; - sourceFile.fileName = ts.normalizePath(fileName); - sourceFile.flags = ts.fileExtensionIs(sourceFile.fileName, ".d.ts") ? 2048 : 0; + var sourceText; + var nodeCount; + var identifiers; + var identifierCount; + var parsingContext; + // Flags that dictate what parsing context we're in. For example: + // Whether or not we are in strict parsing mode. All that changes in strict parsing mode is + // 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 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 + // all nodes would need extra state on them to store this info. + // + // Note: 'allowIn' and 'allowYield' track 1:1 with the [in] and [yield] concepts in the ES6 + // grammar specification. + // + // 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 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: + // + // EqualityExpression[In, Yield] : + // RelationalExpression[?In, ?Yield] + // EqualityExpression[?In, ?Yield] == RelationalExpression[?In, ?Yield] + // EqualityExpression[?In, ?Yield] != RelationalExpression[?In, ?Yield] + // EqualityExpression[?In, ?Yield] === RelationalExpression[?In, ?Yield] + // EqualityExpression[?In, ?Yield] !== RelationalExpression[?In, ?Yield] + // + // Where you have to be careful is then understanding what the points are in the grammar + // where the values are *not* passed along. For example: + // + // SingleNameBinding[Yield,GeneratorParameter] + // [+GeneratorParameter]BindingIdentifier[Yield] Initializer[In]opt + // [~GeneratorParameter]BindingIdentifier[?Yield]Initializer[In, ?Yield]opt + // + // Here this is saying that if the GeneratorParameter context flag is set, that we should + // explicitly set the 'yield' context flag to false before calling into the BindingIdentifier + // and we should explicitly unset the 'yield' context flag before calling into the Initializer. + // production. Conversely, if the GeneratorParameter context flag is not set, then we + // should leave the 'yield' context flag alone. + // + // Getting this all correct is tricky and requires careful reading of the grammar to + // understand when these values should be changed versus when they should be inherited. + // + // Note: it should not be necessary to save/restore these flags during speculative/lookahead + // parsing. These context flags are naturally stored and restored through normal recursive + // descent parsing and unwinding. var contextFlags = 0; + // Whether or not we've had a parse error since creating the last AST node. If we have + // encountered an error, it will be stored on the next AST node we create. Parse errors + // can be broken down into three categories: + // + // 1) An error that occurred during scanning. For example, an unterminated literal, or a + // character that was completely not understood. + // + // 2) A token was expected, but was not present. This type of error is commonly produced + // by the 'parseExpected' function. + // + // 3) A token was present that no parsing function was able to consume. This type of error + // only occurs in the 'abortParsingListOrMoveToNextToken' function when the parser + // decides to skip the token. + // + // In all of these cases, we want to mark the next node as having had an error before it. + // With this mark, we can know in incremental settings if this node can be reused, or if + // we have to reparse it. If we don't keep this information around, we may just reuse the + // node. in that event we would then not produce the same errors as we did before, causing + // significant confusion problems. + // + // Note: it is necessary that this value be saved/restored during speculative/lookahead + // parsing. During lookahead parsing, we will often create a node. That node will have + // this value attached, and then this value will be set back to 'false'. If we decide to + // rewind, we must get back to the same value we had prior to the lookahead. + // + // Note: any errors at the end of the file that do not precede a regular node, should get + // attached to the EOF token. var parseErrorBeforeNextFinishedNode = false; - var scanner = ts.createScanner(languageVersion, true, sourceText, scanError); - token = nextToken(); - processReferenceComments(sourceFile); - sourceFile.statements = parseList(0, true, parseSourceElement); - ts.Debug.assert(token === 1); - sourceFile.endOfFileToken = parseTokenNode(); - setExternalModuleIndicator(sourceFile); - sourceFile.nodeCount = nodeCount; - sourceFile.identifierCount = identifierCount; - sourceFile.identifiers = identifiers; - if (setParentNodes) { - fixupParentReferences(sourceFile); + function parseSourceFile(fileName, _sourceText, languageVersion, _syntaxCursor, setParentNodes) { + sourceText = _sourceText; + syntaxCursor = _syntaxCursor; + parsingContext = 0; + identifiers = {}; + identifierCount = 0; + nodeCount = 0; + contextFlags = 0; + parseErrorBeforeNextFinishedNode = false; + createSourceFile(fileName, languageVersion); + // Initialize and prime the scanner before parsing the source elements. + scanner.setText(sourceText); + scanner.setOnError(scanError); + scanner.setScriptTarget(languageVersion); + token = nextToken(); + processReferenceComments(sourceFile); + sourceFile.statements = parseList(0 /* SourceElements */, true, parseSourceElement); + ts.Debug.assert(token === 1 /* EndOfFileToken */); + sourceFile.endOfFileToken = parseTokenNode(); + setExternalModuleIndicator(sourceFile); + sourceFile.nodeCount = nodeCount; + sourceFile.identifierCount = identifierCount; + sourceFile.identifiers = identifiers; + if (setParentNodes) { + fixupParentReferences(sourceFile); + } + syntaxCursor = undefined; + // Clear out the text the scanner is pointing at, so it doesn't keep anything alive unnecessarily. + scanner.setText(""); + scanner.setOnError(undefined); + var result = sourceFile; + // Clear any data. We don't want to accidently hold onto it for too long. + sourceFile = undefined; + identifiers = undefined; + syntaxCursor = undefined; + sourceText = undefined; + return result; + } + Parser.parseSourceFile = parseSourceFile; + function fixupParentReferences(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) { + // walk down setting parents that differ from the parent we think it should be. This + // allows us to quickly bail out of setting parents for subtrees during incremental + // parsing + if (n.parent !== parent) { + n.parent = parent; + var saveParent = parent; + parent = n; + forEachChild(n, visitNode); + parent = saveParent; + } + } + } + function createSourceFile(fileName, languageVersion) { + sourceFile = createNode(227 /* SourceFile */, 0); + sourceFile.pos = 0; + sourceFile.end = sourceText.length; + sourceFile.text = sourceText; + sourceFile.parseDiagnostics = []; + sourceFile.bindDiagnostics = []; + sourceFile.languageVersion = languageVersion; + sourceFile.fileName = ts.normalizePath(fileName); + sourceFile.flags = ts.fileExtensionIs(sourceFile.fileName, ".d.ts") ? 2048 /* DeclarationFile */ : 0; } - syntaxCursor = undefined; - return sourceFile; function setContextFlag(val, flag) { if (val) { contextFlags |= flag; @@ -5920,19 +6394,19 @@ var ts; } } function setStrictModeContext(val) { - setContextFlag(val, 1); + setContextFlag(val, 1 /* StrictMode */); } function setDisallowInContext(val) { - setContextFlag(val, 2); + setContextFlag(val, 2 /* DisallowIn */); } function setYieldContext(val) { - setContextFlag(val, 4); + setContextFlag(val, 4 /* Yield */); } function setGeneratorParameterContext(val) { - setContextFlag(val, 8); + setContextFlag(val, 8 /* GeneratorParameter */); } function setDecoratorContext(val) { - setContextFlag(val, 16); + setContextFlag(val, 16 /* Decorator */); } function doOutsideOfContext(flags, func) { var currentContextFlags = contextFlags & flags; @@ -5942,19 +6416,22 @@ var ts; setContextFlag(true, currentContextFlags); return result; } + // no need to do anything special as we are not in any of the requested contexts return func(); } function allowInAnd(func) { - if (contextFlags & 2) { + if (contextFlags & 2 /* DisallowIn */) { setDisallowInContext(false); var result = func(); setDisallowInContext(true); return result; } + // no need to do anything special if 'in' is already allowed. return func(); } function disallowInAnd(func) { - if (contextFlags & 2) { + if (contextFlags & 2 /* DisallowIn */) { + // no need to do anything special if 'in' is already disallowed. return func(); } setDisallowInContext(true); @@ -5963,7 +6440,8 @@ var ts; return result; } function doInYieldContext(func) { - if (contextFlags & 4) { + if (contextFlags & 4 /* Yield */) { + // no need to do anything special if we're already in the [Yield] context. return func(); } setYieldContext(true); @@ -5972,16 +6450,18 @@ var ts; return result; } function doOutsideOfYieldContext(func) { - if (contextFlags & 4) { + if (contextFlags & 4 /* Yield */) { setYieldContext(false); var result = func(); setYieldContext(true); return result; } + // no need to do anything special if we're not in the [Yield] context. return func(); } function doInDecoratorContext(func) { - if (contextFlags & 16) { + if (contextFlags & 16 /* Decorator */) { + // no need to do anything special if we're already in the [Decorator] context. return func(); } setDecoratorContext(true); @@ -5990,19 +6470,19 @@ var ts; return result; } function inYieldContext() { - return (contextFlags & 4) !== 0; + return (contextFlags & 4 /* Yield */) !== 0; } function inStrictModeContext() { - return (contextFlags & 1) !== 0; + return (contextFlags & 1 /* StrictMode */) !== 0; } function inGeneratorParameterContext() { - return (contextFlags & 8) !== 0; + return (contextFlags & 8 /* GeneratorParameter */) !== 0; } function inDisallowInContext() { - return (contextFlags & 2) !== 0; + return (contextFlags & 2 /* DisallowIn */) !== 0; } function inDecoratorContext() { - return (contextFlags & 16) !== 0; + return (contextFlags & 16 /* Decorator */) !== 0; } function parseErrorAtCurrentToken(message, arg0) { var start = scanner.getTokenPos(); @@ -6010,10 +6490,13 @@ var ts; parseErrorAtPosition(start, length, message, arg0); } function parseErrorAtPosition(start, length, message, arg0) { + // Don't report another error if it would just be at the same position as the last error. var lastError = ts.lastOrUndefined(sourceFile.parseDiagnostics); if (!lastError || start !== lastError.start) { sourceFile.parseDiagnostics.push(ts.createFileDiagnostic(sourceFile, start, length, message, arg0)); } + // Mark that we've encountered an error. We'll set an appropriate bit on the next + // node we finish so that it can't be reused incrementally. parseErrorBeforeNextFinishedNode = true; } function scanError(message, length) { @@ -6042,14 +6525,25 @@ var ts; return token = scanner.reScanTemplateToken(); } function speculationHelper(callback, isLookAhead) { + // Keep track of the state we'll need to rollback to if lookahead fails (or if the + // caller asked us to always reset our state). var saveToken = token; var saveParseDiagnosticsLength = sourceFile.parseDiagnostics.length; var saveParseErrorBeforeNextFinishedNode = parseErrorBeforeNextFinishedNode; + // Note: it is not actually necessary to save/restore the context flags here. That's + // because the saving/restorating of these flags happens naturally through the recursive + // descent nature of our parser. However, we still store this here just so we can + // assert that that invariant holds. var saveContextFlags = contextFlags; + // If we're only looking ahead, then tell the scanner to only lookahead as well. + // Otherwise, if we're actually speculatively parsing, then tell the scanner to do the + // same. var result = isLookAhead ? scanner.lookAhead(callback) : scanner.tryScan(callback); ts.Debug.assert(saveContextFlags === contextFlags); + // If our callback returned something 'falsy' or we're just looking ahead, + // then unconditionally restore us to where we were. if (!result || isLookAhead) { token = saveToken; sourceFile.parseDiagnostics.length = saveParseDiagnosticsLength; @@ -6057,26 +6551,37 @@ var ts; } return result; } + // Invokes the provided callback then unconditionally restores the parser to the state it + // was in immediately prior to invoking the callback. The result of invoking the callback + // is returned from this function. function lookAhead(callback) { return speculationHelper(callback, true); } + // Invokes the provided callback. If the callback returns something falsy, then it restores + // the parser to the state it was in immediately prior to invoking the callback. If the + // callback returns something truthy, then the parser state is not rolled back. The result + // of invoking the callback is returned from this function. function tryParse(callback) { return speculationHelper(callback, false); } + // Ignore strict mode flag because we will report an error in type checker instead. function isIdentifier() { - if (token === 65) { + if (token === 65 /* Identifier */) { return true; } - if (token === 111 && inYieldContext()) { + // If we have a 'yield' keyword, and we're in the [yield] context, then 'yield' is + // considered a keyword and is not an identifier. + if (token === 110 /* YieldKeyword */ && inYieldContext()) { return false; } - return inStrictModeContext() ? token > 111 : token > 101; + return token > 101 /* LastReservedWord */; } function parseExpected(kind, diagnosticMessage) { if (token === kind) { nextToken(); return true; } + // Report specific message if provided with one. Otherwise, report generic fallback message. if (diagnosticMessage) { parseErrorAtCurrentToken(diagnosticMessage); } @@ -6108,20 +6613,23 @@ var ts; return finishNode(node); } function canParseSemicolon() { - if (token === 22) { + // If there's a real semicolon, then we can always parse it out. + if (token === 22 /* SemicolonToken */) { return true; } - return token === 15 || token === 1 || scanner.hasPrecedingLineBreak(); + // We can parse out an optional semicolon in ASI cases in the following cases. + return token === 15 /* CloseBraceToken */ || token === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak(); } function parseSemicolon() { if (canParseSemicolon()) { - if (token === 22) { + if (token === 22 /* SemicolonToken */) { + // consume the semicolon if it was explicitly provided. nextToken(); } return true; } else { - return parseExpected(22); + return parseExpected(22 /* SemicolonToken */); } } function createNode(kind, pos) { @@ -6139,9 +6647,12 @@ var ts; if (contextFlags) { node.parserContextFlags = contextFlags; } + // Keep track on the node if we encountered an error while parsing it. If we did, then + // we cannot reuse the node incrementally. Once we've marked this node, clear out the + // flag so that we don't mark any subsequent nodes. if (parseErrorBeforeNextFinishedNode) { parseErrorBeforeNextFinishedNode = false; - node.parserContextFlags |= 32; + node.parserContextFlags |= 32 /* ThisNodeHasError */; } return node; } @@ -6160,15 +6671,22 @@ var ts; text = ts.escapeIdentifier(text); return ts.hasProperty(identifiers, text) ? identifiers[text] : (identifiers[text] = text); } + // An identifier that starts with two underscores has an extra underscore character prepended to it to avoid issues + // with magic property names like '__proto__'. The 'identifiers' object is used to share a single string instance for + // each identifier in order to reduce memory consumption. function createIdentifier(isIdentifier, diagnosticMessage) { identifierCount++; if (isIdentifier) { - var node = createNode(65); + var node = createNode(65 /* Identifier */); + // Store original token kind if it is not just an Identifier so we can report appropriate error later in type checker + if (token !== 65 /* Identifier */) { + node.originalKeywordKind = token; + } node.text = internIdentifier(scanner.getTokenValue()); nextToken(); return finishNode(node); } - return createMissingNode(65, false, diagnosticMessage || ts.Diagnostics.Identifier_expected); + return createMissingNode(65 /* Identifier */, false, diagnosticMessage || ts.Diagnostics.Identifier_expected); } function parseIdentifier(diagnosticMessage) { return createIdentifier(isIdentifier(), diagnosticMessage); @@ -6178,21 +6696,32 @@ var ts; } function isLiteralPropertyName() { return isIdentifierOrKeyword() || - token === 8 || - token === 7; + token === 8 /* StringLiteral */ || + token === 7 /* NumericLiteral */; } function parsePropertyName() { - if (token === 8 || token === 7) { + if (token === 8 /* StringLiteral */ || token === 7 /* NumericLiteral */) { return parseLiteralNode(true); } - if (token === 18) { + if (token === 18 /* OpenBracketToken */) { return parseComputedPropertyName(); } return parseIdentifierName(); } function parseComputedPropertyName() { - var node = createNode(127); - parseExpected(18); + // PropertyName[Yield,GeneratorParameter] : + // LiteralPropertyName + // [+GeneratorParameter] ComputedPropertyName + // [~GeneratorParameter] ComputedPropertyName[?Yield] + // + // ComputedPropertyName[Yield] : + // [ AssignmentExpression[In, ?Yield] ] + // + var node = createNode(127 /* ComputedPropertyName */); + parseExpected(18 /* OpenBracketToken */); + // We parse any expression (including a comma expression). But the grammar + // says that only an assignment expression is allowed, so the grammar checker + // will error if it sees a comma expression. var yieldContext = inYieldContext(); if (inGeneratorParameterContext()) { setYieldContext(false); @@ -6201,7 +6730,7 @@ var ts; if (inGeneratorParameterContext()) { setYieldContext(yieldContext); } - parseExpected(19); + parseExpected(19 /* CloseBracketToken */); return finishNode(node); } function parseContextualModifier(t) { @@ -6215,92 +6744,112 @@ var ts; return ts.isModifier(token) && tryParse(nextTokenCanFollowContextualModifier); } function nextTokenCanFollowContextualModifier() { - if (token === 70) { - return nextToken() === 77; + if (token === 70 /* ConstKeyword */) { + // 'const' is only a modifier if followed by 'enum'. + return nextToken() === 77 /* EnumKeyword */; } - if (token === 78) { + if (token === 78 /* ExportKeyword */) { nextToken(); - if (token === 73) { + if (token === 73 /* DefaultKeyword */) { return lookAhead(nextTokenIsClassOrFunction); } - return token !== 35 && token !== 14 && canFollowModifier(); + return token !== 35 /* AsteriskToken */ && token !== 14 /* OpenBraceToken */ && canFollowModifier(); } - if (token === 73) { + if (token === 73 /* DefaultKeyword */) { return nextTokenIsClassOrFunction(); } nextToken(); return canFollowModifier(); } function canFollowModifier() { - return token === 18 - || token === 14 - || token === 35 + return token === 18 /* OpenBracketToken */ + || token === 14 /* OpenBraceToken */ + || token === 35 /* AsteriskToken */ || isLiteralPropertyName(); } function nextTokenIsClassOrFunction() { nextToken(); - return token === 69 || token === 83; + return token === 69 /* ClassKeyword */ || token === 83 /* FunctionKeyword */; } + // True if positioned at the start of a list element function isListElement(parsingContext, inErrorRecovery) { var node = currentNode(parsingContext); if (node) { return true; } switch (parsingContext) { - case 0: - case 1: + case 0 /* SourceElements */: + case 1 /* ModuleElements */: return isSourceElement(inErrorRecovery); - case 2: - case 4: + case 2 /* BlockStatements */: + case 4 /* SwitchClauseStatements */: return isStartOfStatement(inErrorRecovery); - case 3: - return token === 67 || token === 73; - case 5: + case 3 /* SwitchClauses */: + return token === 67 /* CaseKeyword */ || token === 73 /* DefaultKeyword */; + case 5 /* TypeMembers */: return isStartOfTypeMember(); - case 6: - return lookAhead(isClassMemberStart) || (token === 22 && !inErrorRecovery); - case 7: - return token === 18 || isLiteralPropertyName(); - case 13: - return token === 18 || token === 35 || isLiteralPropertyName(); - case 10: + case 6 /* ClassMembers */: + // 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 === 22 /* SemicolonToken */ && !inErrorRecovery); + case 7 /* EnumMembers */: + // Include open bracket computed properties. This technically also lets in indexers, + // which would be a candidate for improved error reporting. + return token === 18 /* OpenBracketToken */ || isLiteralPropertyName(); + case 13 /* ObjectLiteralMembers */: + return token === 18 /* OpenBracketToken */ || token === 35 /* AsteriskToken */ || isLiteralPropertyName(); + case 10 /* ObjectBindingElements */: return isLiteralPropertyName(); - case 8: - if (token === 14) { + case 8 /* 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 === 14 /* 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 9: + case 9 /* VariableDeclarations */: return isIdentifierOrPattern(); - case 11: - return token === 23 || token === 21 || isIdentifierOrPattern(); - case 16: + case 11 /* ArrayBindingElements */: + return token === 23 /* CommaToken */ || token === 21 /* DotDotDotToken */ || isIdentifierOrPattern(); + case 16 /* TypeParameters */: return isIdentifier(); - case 12: - case 14: - return token === 23 || token === 21 || isStartOfExpression(); - case 15: + case 12 /* ArgumentExpressions */: + case 14 /* ArrayLiteralMembers */: + return token === 23 /* CommaToken */ || token === 21 /* DotDotDotToken */ || isStartOfExpression(); + case 15 /* Parameters */: return isStartOfParameter(); - case 17: - case 18: - return token === 23 || isStartOfType(); - case 19: + case 17 /* TypeArguments */: + case 18 /* TupleElementTypes */: + return token === 23 /* CommaToken */ || isStartOfType(); + case 19 /* HeritageClauses */: return isHeritageClause(); - case 20: + case 20 /* ImportOrExportSpecifiers */: return isIdentifierOrKeyword(); } ts.Debug.fail("Non-exhaustive case in 'isListElement'."); } function isValidHeritageClauseObjectLiteral() { - ts.Debug.assert(token === 14); - if (nextToken() === 15) { + ts.Debug.assert(token === 14 /* OpenBraceToken */); + if (nextToken() === 15 /* 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 var next = nextToken(); - return next === 23 || next === 14 || next === 79 || next === 103; + return next === 23 /* CommaToken */ || next === 14 /* OpenBraceToken */ || next === 79 /* ExtendsKeyword */ || next === 102 /* ImplementsKeyword */; } return true; } @@ -6309,8 +6858,8 @@ var ts; return isIdentifier(); } function isHeritageClauseExtendsOrImplementsKeyword() { - if (token === 103 || - token === 79) { + if (token === 102 /* ImplementsKeyword */ || + token === 79 /* ExtendsKeyword */) { return lookAhead(nextTokenIsStartOfExpression); } return false; @@ -6319,57 +6868,73 @@ var ts; nextToken(); return isStartOfExpression(); } + // True if positioned at a list terminator function isListTerminator(kind) { - if (token === 1) { + if (token === 1 /* EndOfFileToken */) { + // Being at the end of the file ends all lists. return true; } switch (kind) { - case 1: - case 2: - case 3: - case 5: - case 6: - case 7: - case 13: - case 10: - case 20: - return token === 15; - case 4: - return token === 15 || token === 67 || token === 73; - case 8: - return token === 14 || token === 79 || token === 103; - case 9: + case 1 /* ModuleElements */: + case 2 /* BlockStatements */: + case 3 /* SwitchClauses */: + case 5 /* TypeMembers */: + case 6 /* ClassMembers */: + case 7 /* EnumMembers */: + case 13 /* ObjectLiteralMembers */: + case 10 /* ObjectBindingElements */: + case 20 /* ImportOrExportSpecifiers */: + return token === 15 /* CloseBraceToken */; + case 4 /* SwitchClauseStatements */: + return token === 15 /* CloseBraceToken */ || token === 67 /* CaseKeyword */ || token === 73 /* DefaultKeyword */; + case 8 /* HeritageClauseElement */: + return token === 14 /* OpenBraceToken */ || token === 79 /* ExtendsKeyword */ || token === 102 /* ImplementsKeyword */; + case 9 /* VariableDeclarations */: return isVariableDeclaratorListTerminator(); - case 16: - return token === 25 || token === 16 || token === 14 || token === 79 || token === 103; - case 12: - return token === 17 || token === 22; - case 14: - case 18: - case 11: - return token === 19; - case 15: - return token === 17 || token === 19; - case 17: - return token === 25 || token === 16; - case 19: - return token === 14 || token === 15; + case 16 /* TypeParameters */: + // Tokens other than '>' are here for better error recovery + return token === 25 /* GreaterThanToken */ || token === 16 /* OpenParenToken */ || token === 14 /* OpenBraceToken */ || token === 79 /* ExtendsKeyword */ || token === 102 /* ImplementsKeyword */; + case 12 /* ArgumentExpressions */: + // Tokens other than ')' are here for better error recovery + return token === 17 /* CloseParenToken */ || token === 22 /* SemicolonToken */; + case 14 /* ArrayLiteralMembers */: + case 18 /* TupleElementTypes */: + case 11 /* ArrayBindingElements */: + return token === 19 /* CloseBracketToken */; + case 15 /* Parameters */: + // Tokens other than ')' and ']' (the latter for index signatures) are here for better error recovery + return token === 17 /* CloseParenToken */ || token === 19 /* CloseBracketToken */ /*|| token === SyntaxKind.OpenBraceToken*/; + case 17 /* TypeArguments */: + // Tokens other than '>' are here for better error recovery + return token === 25 /* GreaterThanToken */ || token === 16 /* OpenParenToken */; + case 19 /* HeritageClauses */: + return token === 14 /* OpenBraceToken */ || token === 15 /* CloseBraceToken */; } } function isVariableDeclaratorListTerminator() { + // If we can consume a semicolon (either explicitly, or with ASI), then consider us done + // with parsing the list of variable declarators. if (canParseSemicolon()) { return true; } + // in the case where we're parsing the variable declarator of a 'for-in' statement, we + // are done if we see an 'in' keyword in front of us. Same with for-of if (isInOrOfKeyword(token)) { return true; } - if (token === 32) { + // ERROR RECOVERY TWEAK: + // For better error recovery, if we see an '=>' then we just stop immediately. We've got an + // arrow function here and it's going to be very unlikely that we'll resynchronize and get + // another variable declaration. + if (token === 32 /* EqualsGreaterThanToken */) { return true; } + // Keep trying to parse out variable declarators. return false; } + // True if positioned at element or terminator of the current list or any enclosing list function isInSomeParsingContext() { - for (var kind = 0; kind < 21; kind++) { + for (var kind = 0; kind < 21 /* Count */; kind++) { if (parsingContext & (1 << kind)) { if (isListElement(kind, true) || isListTerminator(kind)) { return true; @@ -6378,6 +6943,7 @@ var ts; } return false; } + // Parses a list of elements function parseList(kind, checkForStrictMode, parseElement) { var saveParsingContext = parsingContext; parsingContext |= 1 << kind; @@ -6388,6 +6954,7 @@ var ts; if (isListElement(kind, false)) { var element = parseListElement(kind, parseElement); result.push(element); + // test elements only if we are not already in strict mode if (checkForStrictMode && !inStrictModeContext()) { if (ts.isPrologueDirective(element)) { if (isUseStrictPrologueDirective(sourceFile, element)) { @@ -6410,6 +6977,14 @@ var ts; parsingContext = saveParsingContext; return result; } + /// Should be called only on prologue directives (isPrologueDirective(node) should be true) + function isUseStrictPrologueDirective(sourceFile, node) { + ts.Debug.assert(ts.isPrologueDirective(node)); + var nodeText = ts.getSourceTextOfNodeFromSourceFile(sourceFile, node.expression); + // Note: the node text must be exactly "use strict" or 'use strict'. It is not ok for the + // string to contain unicode escapes (as per ES5). + return nodeText === '"use strict"' || nodeText === "'use strict'"; + } function parseListElement(parsingContext, parseElement) { var node = currentNode(parsingContext); if (node) { @@ -6418,76 +6993,130 @@ var ts; return parseElement(); } function currentNode(parsingContext) { + // If there is an outstanding parse error that we've encountered, but not attached to + // 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 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) { return undefined; } if (!syntaxCursor) { + // if we don't have a cursor, we could never return a node from the old tree. return undefined; } var node = syntaxCursor.currentNode(scanner.getStartPos()); + // Can't reuse a missing node. if (ts.nodeIsMissing(node)) { return undefined; } + // Can't reuse a node that intersected the change range. if (node.intersectsChange) { return undefined; } + // Can't reuse a node that contains a parse error. This is necessary so that we + // produce the same set of errors again. if (ts.containsParseError(node)) { return undefined; } - var nodeContextFlags = node.parserContextFlags & 63; + // We can only reuse a node if it was parsed under the same strict mode that we're + // currently in. i.e. if we originally parsed a node in non-strict mode, but then + // the user added 'using strict' at the top of the file, then we can't use that node + // again as the presense of strict mode may cause us to parse the tokens in the file + // differetly. + // + // Note: we *can* reuse tokens when the strict mode changes. That's because tokens + // are unaffected by strict mode. It's just the parser will decide what to do with it + // differently depending on what mode it is in. + // + // This also applies to all our other context flags as well. + var nodeContextFlags = node.parserContextFlags & 63 /* ParserGeneratedFlags */; if (nodeContextFlags !== contextFlags) { return undefined; } + // Ok, we have a node that looks like it could be reused. Now verify that it is valid + // in the currest list parsing context that we're currently at. if (!canReuseNode(node, parsingContext)) { return undefined; } return node; } function consumeNode(node) { + // Move the scanner so it is after the node we just consumed. scanner.setTextPos(node.end); nextToken(); return node; } function canReuseNode(node, parsingContext) { switch (parsingContext) { - case 1: + case 1 /* ModuleElements */: return isReusableModuleElement(node); - case 6: + case 6 /* ClassMembers */: return isReusableClassMember(node); - case 3: + case 3 /* SwitchClauses */: return isReusableSwitchClause(node); - case 2: - case 4: + case 2 /* BlockStatements */: + case 4 /* SwitchClauseStatements */: return isReusableStatement(node); - case 7: + case 7 /* EnumMembers */: return isReusableEnumMember(node); - case 5: + case 5 /* TypeMembers */: return isReusableTypeMember(node); - case 9: + case 9 /* VariableDeclarations */: return isReusableVariableDeclaration(node); - case 15: + case 15 /* Parameters */: return isReusableParameter(node); - case 19: - case 16: - case 18: - case 17: - case 12: - case 13: - case 8: + // Any other lists we do not care about reusing nodes in. But feel free to add if + // you can do so safely. Danger areas involve nodes that may involve speculative + // parsing. If speculative parsing is involved with the node, then the range the + // parser reached while looking ahead might be in the edited range (see the example + // in canReuseVariableDeclaratorNode for a good case of this). + case 19 /* HeritageClauses */: + // This would probably be safe to reuse. There is no speculative parsing with + // heritage clauses. + case 16 /* 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 + // unambiguous *type* contexts. While type *arguments* occur in very ambiguous + // *expression* contexts. + case 18 /* TupleElementTypes */: + // This would probably be safe to reuse. There is no speculative parsing with + // tuple types. + // Technically, type argument list types are probably safe to reuse. While + // speculative parsing is involved with them (since type argument lists are only + // produced from speculative parsing a < as a type argument list), we only have + // the types because speculative parsing succeeded. Thus, the lookahead never + // went past the end of the list and rewound. + case 17 /* TypeArguments */: + // Note: these are almost certainly not safe to ever reuse. Expressions commonly + // need a large amount of lookahead, and we should not reuse them as they may + // have actually intersected the edit. + case 12 /* ArgumentExpressions */: + // This is not safe to reuse for the same reason as the 'AssignmentExpression' + // cases. i.e. a property assignment may end with an expression, and thus might + // have lookahead far beyond it's old node. + case 13 /* 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 8 /* HeritageClauseElement */: } return false; } function isReusableModuleElement(node) { if (node) { switch (node.kind) { - case 209: - case 208: - case 215: - case 214: - case 201: - case 202: - case 205: - case 204: + case 209 /* ImportDeclaration */: + case 208 /* ImportEqualsDeclaration */: + case 215 /* ExportDeclaration */: + case 214 /* ExportAssignment */: + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + case 205 /* ModuleDeclaration */: + case 204 /* EnumDeclaration */: return true; } return isReusableStatement(node); @@ -6497,13 +7126,13 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 135: - case 140: - case 134: - case 136: - case 137: - case 132: - case 178: + case 135 /* Constructor */: + case 140 /* IndexSignature */: + case 134 /* MethodDeclaration */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 132 /* PropertyDeclaration */: + case 178 /* SemicolonClassElement */: return true; } } @@ -6512,8 +7141,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 220: - case 221: + case 220 /* CaseClause */: + case 221 /* DefaultClause */: return true; } } @@ -6522,61 +7151,77 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 200: - case 180: - 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: + case 200 /* FunctionDeclaration */: + case 180 /* VariableStatement */: + case 179 /* Block */: + case 183 /* IfStatement */: + case 182 /* ExpressionStatement */: + case 195 /* ThrowStatement */: + case 191 /* ReturnStatement */: + case 193 /* SwitchStatement */: + case 190 /* BreakStatement */: + case 189 /* ContinueStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: + case 186 /* ForStatement */: + case 185 /* WhileStatement */: + case 192 /* WithStatement */: + case 181 /* EmptyStatement */: + case 196 /* TryStatement */: + case 194 /* LabeledStatement */: + case 184 /* DoStatement */: + case 197 /* DebuggerStatement */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 226; + return node.kind === 226 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 139: - case 133: - case 140: - case 131: - case 138: + case 139 /* ConstructSignature */: + case 133 /* MethodSignature */: + case 140 /* IndexSignature */: + case 131 /* PropertySignature */: + case 138 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 198) { + if (node.kind !== 198 /* VariableDeclaration */) { return false; } + // Very subtle incremental parsing bug. Consider the following code: + // + // let v = new List < A, B + // + // This is actually legal code. It's a list of variable declarators "v = new List() + // + // then we have a problem. "v = new List= 0) { + // Always preserve a trailing comma by marking it on the NodeArray result.hasTrailingComma = true; } result.end = getNodeEnd(); @@ -6637,10 +7322,11 @@ var ts; } return createMissingList(); } + // The allowReservedWords parameter controls whether reserved words are permitted after the first dot function parseEntityName(allowReservedWords, diagnosticMessage) { var entity = parseIdentifier(diagnosticMessage); - while (parseOptional(20)) { - var node = createNode(126, entity.pos); + while (parseOptional(20 /* DotToken */)) { + var node = createNode(126 /* QualifiedName */, entity.pos); node.left = entity; node.right = parseRightSideOfDot(allowReservedWords); entity = finishNode(node); @@ -6648,37 +7334,59 @@ var ts; return entity; } function parseRightSideOfDot(allowIdentifierNames) { + // Technically a keyword is valid here as all keywords are identifier names. + // However, often we'll encounter this in error situations when the keyword + // is actually starting another valid construct. + // + // So, we check for the following specific case: + // + // name. + // keyword identifierNameOrKeyword + // + // Note: the newlines are important here. For example, if that above code + // were rewritten into: + // + // name.keyword + // identifierNameOrKeyword + // + // Then we would consider it valid. That's because ASI would take effect and + // the code would be implicitly: "name.keyword; identifierNameOrKeyword". + // In the first case though, ASI will not take effect because there is not a + // line terminator after the keyword. if (scanner.hasPrecedingLineBreak() && scanner.isReservedWord()) { var matchesPattern = lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); if (matchesPattern) { - return createMissingNode(65, true, ts.Diagnostics.Identifier_expected); + // Report that we need an identifier. However, report it right after the dot, + // and not on the next token. This is because the next token might actually + // be an identifier and the error woudl be quite confusing. + return createMissingNode(65 /* Identifier */, true, ts.Diagnostics.Identifier_expected); } } return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(171); + var template = createNode(171 /* TemplateExpression */); template.head = parseLiteralNode(); - ts.Debug.assert(template.head.kind === 11, "Template head has wrong token kind"); + ts.Debug.assert(template.head.kind === 11 /* TemplateHead */, "Template head has wrong token kind"); var templateSpans = []; templateSpans.pos = getNodePos(); do { templateSpans.push(parseTemplateSpan()); - } while (templateSpans[templateSpans.length - 1].literal.kind === 12); + } while (templateSpans[templateSpans.length - 1].literal.kind === 12 /* TemplateMiddle */); templateSpans.end = getNodeEnd(); template.templateSpans = templateSpans; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(176); + var span = createNode(176 /* TemplateSpan */); span.expression = allowInAnd(parseExpression); var literal; - if (token === 15) { + if (token === 15 /* CloseBraceToken */) { reScanTemplateToken(); literal = parseLiteralNode(); } else { - literal = parseExpectedToken(13, false, ts.Diagnostics._0_expected, ts.tokenToString(15)); + literal = parseExpectedToken(13 /* TemplateTail */, false, ts.Diagnostics._0_expected, ts.tokenToString(15 /* CloseBraceToken */)); } span.literal = literal; return finishNode(span); @@ -6696,55 +7404,73 @@ var ts; var tokenPos = scanner.getTokenPos(); nextToken(); finishNode(node); - if (node.kind === 7 - && sourceText.charCodeAt(tokenPos) === 48 + // Octal literals are not allowed in strict mode or ES5 + // Note that theoretically the following condition would hold true literals like 009, + // which is not octal.But because of how the scanner separates the tokens, we would + // never get a token like this. Instead, we would get 00 and 9 as two separate tokens. + // We also do not need to check for negatives because any prefix operator would be part of a + // parent unary expression. + if (node.kind === 7 /* NumericLiteral */ + && sourceText.charCodeAt(tokenPos) === 48 /* _0 */ && ts.isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { - node.flags |= 16384; + node.flags |= 16384 /* OctalLiteral */; } return node; } + // TYPES function parseTypeReference() { - var node = createNode(141); + var node = createNode(141 /* TypeReference */); node.typeName = parseEntityName(false, ts.Diagnostics.Type_expected); - if (!scanner.hasPrecedingLineBreak() && token === 24) { - node.typeArguments = parseBracketedList(17, parseType, 24, 25); + if (!scanner.hasPrecedingLineBreak() && token === 24 /* LessThanToken */) { + node.typeArguments = parseBracketedList(17 /* TypeArguments */, parseType, 24 /* LessThanToken */, 25 /* GreaterThanToken */); } return finishNode(node); } function parseTypeQuery() { - var node = createNode(144); - parseExpected(97); + var node = createNode(144 /* TypeQuery */); + parseExpected(97 /* TypeOfKeyword */); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(128); + var node = createNode(128 /* TypeParameter */); node.name = parseIdentifier(); - if (parseOptional(79)) { + if (parseOptional(79 /* ExtendsKeyword */)) { + // It's not uncommon for people to write improper constraints to a generic. If the + // user writes a constraint that is an expression and not an actual type, then parse + // it out as an expression (so we can recover well), but report that a type is needed + // instead. if (isStartOfType() || !isStartOfExpression()) { node.constraint = parseType(); } else { + // It was not a type, and it looked like an expression. Parse out an expression + // here so we recover well. Note: it is important that we call parseUnaryExpression + // and not parseExpression here. If the user has: + // + // + // + // We do *not* want to consume the > as we're consuming the expression for "". node.expression = parseUnaryExpressionOrHigher(); } } return finishNode(node); } function parseTypeParameters() { - if (token === 24) { - return parseBracketedList(16, parseTypeParameter, 24, 25); + if (token === 24 /* LessThanToken */) { + return parseBracketedList(16 /* TypeParameters */, parseTypeParameter, 24 /* LessThanToken */, 25 /* GreaterThanToken */); } } function parseParameterType() { - if (parseOptional(51)) { - return token === 8 + if (parseOptional(51 /* ColonToken */)) { + return token === 8 /* StringLiteral */ ? parseLiteralNode(true) : parseType(); } return undefined; } function isStartOfParameter() { - return token === 21 || isIdentifierOrPattern() || ts.isModifier(token) || token === 52; + return token === 21 /* DotDotDotToken */ || isIdentifierOrPattern() || ts.isModifier(token) || token === 52 /* AtToken */; } function setModifiers(node, modifiers) { if (modifiers) { @@ -6753,24 +7479,43 @@ var ts; } } function parseParameter() { - var node = createNode(129); + var node = createNode(129 /* Parameter */); node.decorators = parseDecorators(); setModifiers(node, parseModifiers()); - node.dotDotDotToken = parseOptionalToken(21); + node.dotDotDotToken = parseOptionalToken(21 /* DotDotDotToken */); + // SingleNameBinding[Yield,GeneratorParameter] : See 13.2.3 + // [+GeneratorParameter]BindingIdentifier[Yield]Initializer[In]opt + // [~GeneratorParameter]BindingIdentifier[?Yield]Initializer[In, ?Yield]opt node.name = inGeneratorParameterContext() ? doInYieldContext(parseIdentifierOrPattern) : parseIdentifierOrPattern(); if (ts.getFullWidth(node.name) === 0 && node.flags === 0 && ts.isModifier(token)) { + // in cases like + // 'use strict' + // function foo(static) + // isParameter('static') === true, because of isModifier('static') + // however 'static' is not a legal identifier in a strict mode. + // so result of this function will be ParameterDeclaration (flags = 0, name = missing, type = undefined, initializer = undefined) + // and current token will not change => parsing of the enclosing parameter list will last till the end of time (or OOM) + // to avoid this we'll advance cursor to the next token. nextToken(); } - node.questionToken = parseOptionalToken(50); + node.questionToken = parseOptionalToken(50 /* QuestionToken */); node.type = parseParameterType(); node.initializer = inGeneratorParameterContext() ? doOutsideOfYieldContext(parseParameterInitializer) : parseParameterInitializer(); + // Do not check for initializers in an ambient context for parameters. This is not + // a grammar error because the grammar allows arbitrary call signatures in + // an ambient context. + // It is actually not necessary for this to be an error at all. The reason is that + // function/constructor implementations are syntactically disallowed in ambient + // contexts. In addition, parameter initializers are semantically disallowed in + // overload signatures. So parameter initializers are transitively disallowed in + // ambient contexts. return finishNode(node); } function parseParameterInitializer() { return parseInitializer(true); } function fillSignature(returnToken, yieldAndGeneratorParameterContext, requireCompleteParameterList, signature) { - var returnTokenRequired = returnToken === 32; + var returnTokenRequired = returnToken === 32 /* EqualsGreaterThanToken */; signature.typeParameters = parseTypeParameters(); signature.parameters = parseParameterList(yieldAndGeneratorParameterContext, requireCompleteParameterList); if (returnTokenRequired) { @@ -6781,46 +7526,88 @@ var ts; signature.type = parseType(); } } + // Note: after careful analysis of the grammar, it does not appear to be possible to + // have 'Yield' And 'GeneratorParameter' not in sync. i.e. any production calling + // this FormalParameters production either always sets both to true, or always sets + // both to false. As such we only have a single parameter to represent both. function parseParameterList(yieldAndGeneratorParameterContext, requireCompleteParameterList) { - if (parseExpected(16)) { + // FormalParameters[Yield,GeneratorParameter] : + // ... + // + // FormalParameter[Yield,GeneratorParameter] : + // BindingElement[?Yield, ?GeneratorParameter] + // + // BindingElement[Yield, GeneratorParameter ] : See 13.2.3 + // SingleNameBinding[?Yield, ?GeneratorParameter] + // [+GeneratorParameter]BindingPattern[?Yield, GeneratorParameter]Initializer[In]opt + // [~GeneratorParameter]BindingPattern[?Yield]Initializer[In, ?Yield]opt + // + // SingleNameBinding[Yield, GeneratorParameter] : See 13.2.3 + // [+GeneratorParameter]BindingIdentifier[Yield]Initializer[In]opt + // [~GeneratorParameter]BindingIdentifier[?Yield]Initializer[In, ?Yield]opt + if (parseExpected(16 /* OpenParenToken */)) { var savedYieldContext = inYieldContext(); var savedGeneratorParameterContext = inGeneratorParameterContext(); setYieldContext(yieldAndGeneratorParameterContext); setGeneratorParameterContext(yieldAndGeneratorParameterContext); - var result = parseDelimitedList(15, parseParameter); + var result = parseDelimitedList(15 /* Parameters */, parseParameter); setYieldContext(savedYieldContext); setGeneratorParameterContext(savedGeneratorParameterContext); - if (!parseExpected(17) && requireCompleteParameterList) { + if (!parseExpected(17 /* CloseParenToken */) && requireCompleteParameterList) { + // Caller insisted that we had to end with a ) We didn't. So just return + // undefined here. return undefined; } return result; } + // We didn't even have an open paren. If the caller requires a complete parameter list, + // we definitely can't provide that. However, if they're ok with an incomplete one, + // then just return an empty set of parameters. return requireCompleteParameterList ? undefined : createMissingList(); } function parseTypeMemberSemicolon() { - if (parseOptional(23)) { + // We allow type members to be separated by commas or (possibly ASI) semicolons. + // First check if it was a comma. If so, we're done with the member. + if (parseOptional(23 /* CommaToken */)) { return; } + // Didn't have a comma. We must have a (possible ASI) semicolon. parseSemicolon(); } function parseSignatureMember(kind) { var node = createNode(kind); - if (kind === 139) { - parseExpected(88); + if (kind === 139 /* ConstructSignature */) { + parseExpected(88 /* NewKeyword */); } - fillSignature(51, false, false, node); + fillSignature(51 /* ColonToken */, false, false, node); parseTypeMemberSemicolon(); return finishNode(node); } function isIndexSignature() { - if (token !== 18) { + if (token !== 18 /* OpenBracketToken */) { return false; } return lookAhead(isUnambiguouslyIndexSignature); } function isUnambiguouslyIndexSignature() { + // The only allowed sequence is: + // + // [id: + // + // However, for error recovery, we also check the following cases: + // + // [... + // [id, + // [id?, + // [id?: + // [id?] + // [public id + // [private id + // [protected id + // [] + // nextToken(); - if (token === 21 || token === 19) { + if (token === 21 /* DotDotDotToken */ || token === 19 /* CloseBracketToken */) { return true; } if (ts.isModifier(token)) { @@ -6833,22 +7620,30 @@ var ts; return false; } else { + // Skip the identifier nextToken(); } - if (token === 51 || token === 23) { + // A colon signifies a well formed indexer + // A comma should be a badly formed indexer because comma expressions are not allowed + // in computed properties. + if (token === 51 /* ColonToken */ || token === 23 /* CommaToken */) { return true; } - if (token !== 50) { + // Question mark could be an indexer with an optional property, + // or it could be a conditional expression in a computed property. + if (token !== 50 /* QuestionToken */) { return false; } + // If any of the following tokens are after the question mark, it cannot + // be a conditional expression, so treat it as an indexer. nextToken(); - return token === 51 || token === 23 || token === 19; + return token === 51 /* ColonToken */ || token === 23 /* CommaToken */ || token === 19 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(fullStart, decorators, modifiers) { - var node = createNode(140, fullStart); + var node = createNode(140 /* IndexSignature */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); - node.parameters = parseBracketedList(15, parseParameter, 18, 19); + node.parameters = parseBracketedList(15 /* Parameters */, parseParameter, 18 /* OpenBracketToken */, 19 /* CloseBracketToken */); node.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); return finishNode(node); @@ -6856,17 +7651,19 @@ var ts; function parsePropertyOrMethodSignature() { var fullStart = scanner.getStartPos(); var name = parsePropertyName(); - var questionToken = parseOptionalToken(50); - if (token === 16 || token === 24) { - var method = createNode(133, fullStart); + var questionToken = parseOptionalToken(50 /* QuestionToken */); + if (token === 16 /* OpenParenToken */ || token === 24 /* LessThanToken */) { + var method = createNode(133 /* MethodSignature */, fullStart); method.name = name; method.questionToken = questionToken; - fillSignature(51, false, false, method); + // Method signatues don't exist in expression contexts. So they have neither + // [Yield] nor [GeneratorParameter] + fillSignature(51 /* ColonToken */, false, false, method); parseTypeMemberSemicolon(); return finishNode(method); } else { - var property = createNode(131, fullStart); + var property = createNode(131 /* PropertySignature */, fullStart); property.name = name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); @@ -6876,9 +7673,9 @@ var ts; } function isStartOfTypeMember() { switch (token) { - case 16: - case 24: - case 18: + case 16 /* OpenParenToken */: + case 24 /* LessThanToken */: + case 18 /* OpenBracketToken */: return true; default: if (ts.isModifier(token)) { @@ -6898,29 +7695,37 @@ var ts; } function isTypeMemberWithLiteralPropertyName() { nextToken(); - return token === 16 || - token === 24 || - token === 50 || - token === 51 || + return token === 16 /* OpenParenToken */ || + token === 24 /* LessThanToken */ || + token === 50 /* QuestionToken */ || + token === 51 /* ColonToken */ || canParseSemicolon(); } function parseTypeMember() { switch (token) { - case 16: - case 24: - return parseSignatureMember(138); - case 18: + case 16 /* OpenParenToken */: + case 24 /* LessThanToken */: + return parseSignatureMember(138 /* CallSignature */); + case 18 /* OpenBracketToken */: + // Indexer or computed property return isIndexSignature() ? parseIndexSignatureDeclaration(scanner.getStartPos(), undefined, undefined) : parsePropertyOrMethodSignature(); - case 88: + case 88 /* NewKeyword */: if (lookAhead(isStartOfConstructSignature)) { - return parseSignatureMember(139); + return parseSignatureMember(139 /* ConstructSignature */); } - case 8: - case 7: + // fall through. + case 8 /* StringLiteral */: + case 7 /* NumericLiteral */: return parsePropertyOrMethodSignature(); default: + // Index declaration as allowed as a type member. But as per the grammar, + // they also allow modifiers. So we have to check for an index declaration + // that might be following modifiers. This ensures that things work properly + // when incrementally parsing as the parser will produce the Index declaration + // if it has the same text regardless of whether it is inside a class or an + // object type. if (ts.isModifier(token)) { var result = tryParse(parseIndexSignatureWithModifiers); if (result) { @@ -6942,18 +7747,18 @@ var ts; } function isStartOfConstructSignature() { nextToken(); - return token === 16 || token === 24; + return token === 16 /* OpenParenToken */ || token === 24 /* LessThanToken */; } function parseTypeLiteral() { - var node = createNode(145); + var node = createNode(145 /* TypeLiteral */); node.members = parseObjectTypeMembers(); return finishNode(node); } function parseObjectTypeMembers() { var members; - if (parseExpected(14)) { - members = parseList(5, false, parseTypeMember); - parseExpected(15); + if (parseExpected(14 /* OpenBraceToken */)) { + members = parseList(5 /* TypeMembers */, false, parseTypeMember); + parseExpected(15 /* CloseBraceToken */); } else { members = createMissingList(); @@ -6961,47 +7766,48 @@ var ts; return members; } function parseTupleType() { - var node = createNode(147); - node.elementTypes = parseBracketedList(18, parseType, 18, 19); + var node = createNode(147 /* TupleType */); + node.elementTypes = parseBracketedList(18 /* TupleElementTypes */, parseType, 18 /* OpenBracketToken */, 19 /* CloseBracketToken */); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(149); - parseExpected(16); + var node = createNode(149 /* ParenthesizedType */); + parseExpected(16 /* OpenParenToken */); node.type = parseType(); - parseExpected(17); + parseExpected(17 /* CloseParenToken */); return finishNode(node); } function parseFunctionOrConstructorType(kind) { var node = createNode(kind); - if (kind === 143) { - parseExpected(88); + if (kind === 143 /* ConstructorType */) { + parseExpected(88 /* NewKeyword */); } - fillSignature(32, false, false, node); + fillSignature(32 /* EqualsGreaterThanToken */, false, false, node); return finishNode(node); } function parseKeywordAndNoDot() { var node = parseTokenNode(); - return token === 20 ? undefined : node; + return token === 20 /* DotToken */ ? undefined : node; } function parseNonArrayType() { switch (token) { - case 112: - case 121: - case 119: - case 113: - case 122: + case 112 /* AnyKeyword */: + case 121 /* StringKeyword */: + case 119 /* NumberKeyword */: + case 113 /* BooleanKeyword */: + case 122 /* SymbolKeyword */: + // If these are followed by a dot, then parse these out as a dotted type reference instead. var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReference(); - case 99: + case 99 /* VoidKeyword */: return parseTokenNode(); - case 97: + case 97 /* TypeOfKeyword */: return parseTypeQuery(); - case 14: + case 14 /* OpenBraceToken */: return parseTypeLiteral(); - case 18: + case 18 /* OpenBracketToken */: return parseTupleType(); - case 16: + case 16 /* OpenParenToken */: return parseParenthesizedType(); default: return parseTypeReference(); @@ -7009,19 +7815,21 @@ var ts; } function isStartOfType() { switch (token) { - case 112: - case 121: - case 119: - case 113: - case 122: - case 99: - case 97: - case 14: - case 18: - case 24: - case 88: + case 112 /* AnyKeyword */: + case 121 /* StringKeyword */: + case 119 /* NumberKeyword */: + case 113 /* BooleanKeyword */: + case 122 /* SymbolKeyword */: + case 99 /* VoidKeyword */: + case 97 /* TypeOfKeyword */: + case 14 /* OpenBraceToken */: + case 18 /* OpenBracketToken */: + case 24 /* LessThanToken */: + case 88 /* NewKeyword */: return true; - case 16: + case 16 /* OpenParenToken */: + // Only consider '(' the start of a type if followed by ')', '...', an identifier, a modifier, + // or something that starts a type. We don't want to consider things like '(1)' a type. return lookAhead(isStartOfParenthesizedOrFunctionType); default: return isIdentifier(); @@ -7029,13 +7837,13 @@ var ts; } function isStartOfParenthesizedOrFunctionType() { nextToken(); - return token === 17 || isStartOfParameter() || isStartOfType(); + return token === 17 /* CloseParenToken */ || isStartOfParameter() || isStartOfType(); } function parseArrayTypeOrHigher() { var type = parseNonArrayType(); - while (!scanner.hasPrecedingLineBreak() && parseOptional(18)) { - parseExpected(19); - var node = createNode(146, type.pos); + while (!scanner.hasPrecedingLineBreak() && parseOptional(18 /* OpenBracketToken */)) { + parseExpected(19 /* CloseBracketToken */); + var node = createNode(146 /* ArrayType */, type.pos); node.elementType = type; type = finishNode(node); } @@ -7043,40 +7851,48 @@ var ts; } function parseUnionTypeOrHigher() { var type = parseArrayTypeOrHigher(); - if (token === 44) { + if (token === 44 /* BarToken */) { var types = [type]; types.pos = type.pos; - while (parseOptional(44)) { + while (parseOptional(44 /* BarToken */)) { types.push(parseArrayTypeOrHigher()); } types.end = getNodeEnd(); - var node = createNode(148, type.pos); + var node = createNode(148 /* UnionType */, type.pos); node.types = types; type = finishNode(node); } return type; } function isStartOfFunctionType() { - if (token === 24) { + if (token === 24 /* LessThanToken */) { return true; } - return token === 16 && lookAhead(isUnambiguouslyStartOfFunctionType); + return token === 16 /* OpenParenToken */ && lookAhead(isUnambiguouslyStartOfFunctionType); } function isUnambiguouslyStartOfFunctionType() { nextToken(); - if (token === 17 || token === 21) { + if (token === 17 /* CloseParenToken */ || token === 21 /* DotDotDotToken */) { + // ( ) + // ( ... return true; } if (isIdentifier() || ts.isModifier(token)) { nextToken(); - if (token === 51 || token === 23 || - token === 50 || token === 53 || + if (token === 51 /* ColonToken */ || token === 23 /* CommaToken */ || + token === 50 /* QuestionToken */ || token === 53 /* EqualsToken */ || isIdentifier() || ts.isModifier(token)) { + // ( id : + // ( id , + // ( id ? + // ( id = + // ( modifier id return true; } - if (token === 17) { + if (token === 17 /* CloseParenToken */) { nextToken(); - if (token === 32) { + if (token === 32 /* EqualsGreaterThanToken */) { + // ( id ) => return true; } } @@ -7084,6 +7900,8 @@ var ts; return false; } function parseType() { + // The rules about 'yield' only apply to actual code/expression contexts. They don't + // apply to 'type' contexts. So we disable these parameters here before moving on. var savedYieldContext = inYieldContext(); var savedGeneratorParameterContext = inGeneratorParameterContext(); setYieldContext(false); @@ -7095,36 +7913,37 @@ var ts; } function parseTypeWorker() { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(142); + return parseFunctionOrConstructorType(142 /* FunctionType */); } - if (token === 88) { - return parseFunctionOrConstructorType(143); + if (token === 88 /* NewKeyword */) { + return parseFunctionOrConstructorType(143 /* ConstructorType */); } return parseUnionTypeOrHigher(); } function parseTypeAnnotation() { - return parseOptional(51) ? parseType() : undefined; + return parseOptional(51 /* ColonToken */) ? parseType() : undefined; } + // EXPRESSIONS function isStartOfLeftHandSideExpression() { switch (token) { - case 93: - case 91: - case 89: - case 95: - case 80: - case 7: - case 8: - case 10: - case 11: - case 16: - case 18: - case 14: - case 83: - case 69: - case 88: - case 36: - case 57: - case 65: + case 93 /* ThisKeyword */: + case 91 /* SuperKeyword */: + case 89 /* NullKeyword */: + case 95 /* TrueKeyword */: + case 80 /* FalseKeyword */: + case 7 /* NumericLiteral */: + case 8 /* StringLiteral */: + case 10 /* NoSubstitutionTemplateLiteral */: + case 11 /* TemplateHead */: + case 16 /* OpenParenToken */: + case 18 /* OpenBracketToken */: + case 14 /* OpenBraceToken */: + case 83 /* FunctionKeyword */: + case 69 /* ClassKeyword */: + case 88 /* NewKeyword */: + case 36 /* SlashToken */: + case 57 /* SlashEqualsToken */: + case 65 /* Identifier */: return true; default: return isIdentifier(); @@ -7135,19 +7954,26 @@ var ts; return true; } switch (token) { - case 33: - case 34: - case 47: - case 46: - case 74: - case 97: - case 99: - case 38: - case 39: - case 24: - case 111: + case 33 /* PlusToken */: + case 34 /* MinusToken */: + case 47 /* TildeToken */: + case 46 /* ExclamationToken */: + case 74 /* DeleteKeyword */: + case 97 /* TypeOfKeyword */: + case 99 /* VoidKeyword */: + case 38 /* PlusPlusToken */: + case 39 /* MinusMinusToken */: + case 24 /* LessThanToken */: + case 110 /* 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 + // a generator, or in strict mode (or both)) and it started a yield expression. return true; default: + // Error tolerance. If we see the start of some binary operator, we consider + // that the start of an expression. That way we'll parse out a missing identifier, + // give a good message about an identifier being missing, and then consume the + // rest of the binary expression. if (isBinaryOperator()) { return true; } @@ -7155,23 +7981,25 @@ var ts; } } function isStartOfExpressionStatement() { - return token !== 14 && - token !== 83 && - token !== 69 && - token !== 52 && + // As per the grammar, none of '{' or 'function' or 'class' can start an expression statement. + return token !== 14 /* OpenBraceToken */ && + token !== 83 /* FunctionKeyword */ && + token !== 69 /* ClassKeyword */ && + token !== 52 /* AtToken */ && isStartOfExpression(); } function parseExpression() { // Expression[in]: // AssignmentExpression[in] // Expression[in] , AssignmentExpression[in] + // clear the decorator context when parsing Expression, as it should be unambiguous when parsing a decorator var saveDecoratorContext = inDecoratorContext(); if (saveDecoratorContext) { setDecoratorContext(false); } var expr = parseAssignmentExpressionOrHigher(); var operatorToken; - while ((operatorToken = parseOptionalToken(23))) { + while ((operatorToken = parseOptionalToken(23 /* CommaToken */))) { expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher()); } if (saveDecoratorContext) { @@ -7180,12 +8008,24 @@ var ts; return expr; } function parseInitializer(inParameter) { - if (token !== 53) { - if (scanner.hasPrecedingLineBreak() || (inParameter && token === 14) || !isStartOfExpression()) { + if (token !== 53 /* EqualsToken */) { + // It's not uncommon during typing for the user to miss writing the '=' token. Check if + // there is no newline after the last token and if we're on an expression. If so, parse + // this as an equals-value clause with a missing equals. + // NOTE: There are two places where we allow equals-value clauses. The first is in a + // variable declarator. The second is with a parameter. For variable declarators + // it's more likely that a { would be a allowed (as an object literal). While this + // is also allowed for parameters, the risk is that we consume the { as an object + // literal when it really will be for the block following the parameter. + if (scanner.hasPrecedingLineBreak() || (inParameter && token === 14 /* OpenBraceToken */) || !isStartOfExpression()) { + // preceding line break, open brace in a parameter (likely a function body) or current token is not an expression - + // do not try to parse initializer return undefined; } } - parseExpected(53); + // Initializer[In, Yield] : + // = AssignmentExpression[?In, ?Yield] + parseExpected(53 /* EqualsToken */); return parseAssignmentExpressionOrHigher(); } function parseAssignmentExpressionOrHigher() { @@ -7198,30 +8038,72 @@ var ts; // // 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). + // First, do the simple check if we have a YieldExpression (production '5'). if (isYieldExpression()) { return parseYieldExpression(); } + // Then, check if we have an arrow function (production '4') that starts with a parenthesized + // parameter list. If we do, we must *not* recurse for productions 1, 2 or 3. An ArrowFunction is + // not a LeftHandSideExpression, nor does it start a ConditionalExpression. So we are done + // with AssignmentExpression if we see one. var arrowExpression = tryParseParenthesizedArrowFunctionExpression(); if (arrowExpression) { return arrowExpression; } + // Now try to see if we're in production '1', '2' or '3'. A conditional expression can + // start with a LogicalOrExpression, while the assignment productions can only start with + // LeftHandSideExpressions. + // + // So, first, we try to just parse out a BinaryExpression. If we get something that is a + // LeftHandSide or higher, then we can try to parse out the assignment expression part. + // Otherwise, we try to parse out the conditional expression bit. We want to allow any + // binary expression here, so we pass in the 'lowest' precedence here so that it matches + // and consumes anything. var expr = parseBinaryExpressionOrHigher(0); - if (expr.kind === 65 && token === 32) { + // To avoid a look-ahead, we did not handle the case of an arrow function with a single un-parenthesized + // parameter ('x => ...') above. We handle it here by checking if the parsed expression was a single + // identifier and the current token is an arrow. + if (expr.kind === 65 /* Identifier */ && token === 32 /* EqualsGreaterThanToken */) { return parseSimpleArrowFunctionExpression(expr); } - if (isLeftHandSideExpression(expr) && isAssignmentOperator(reScanGreaterToken())) { + // Now see if we might be in cases '2' or '3'. + // If the expression was a LHS expression, and we have an assignment operator, then + // we're in '2' or '3'. Consume the assignment and return. + // + // Note: we call reScanGreaterToken so that we get an appropriately merged token + // for cases like > > = becoming >>= + if (ts.isLeftHandSideExpression(expr) && ts.isAssignmentOperator(reScanGreaterToken())) { return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher()); } + // It wasn't an assignment or a lambda. This is a conditional expression: return parseConditionalExpressionRest(expr); } function isYieldExpression() { - if (token === 111) { + if (token === 110 /* YieldKeyword */) { + // If we have a 'yield' keyword, and htis is a context where yield expressions are + // allowed, then definitely parse out a yield expression. if (inYieldContext()) { return true; } if (inStrictModeContext()) { + // If we're in strict mode, then 'yield' is a keyword, could only ever start + // a yield expression. return true; } + // We're in a context where 'yield expr' is not allowed. However, if we can + // definitely tell that the user was trying to parse a 'yield expr' and not + // just a normal expr that start with a 'yield' identifier, then parse out + // a 'yield expr'. We can then report an error later that they are only + // allowed in generator expressions. + // + // for example, if we see 'yield(foo)', then we'll have to treat that as an + // invocation expression of something called 'yield'. However, if we have + // 'yield foo' then that is not legal as a normal expression, so we can + // definitely recognize this as a yield expression. + // + // for now we just check if the next token is an identifier. More heuristics + // can be added here later as necessary. We just need to make sure that we + // don't accidently consume something legal. return lookAhead(nextTokenIsIdentifierOnSameLine); } return false; @@ -7233,131 +8115,214 @@ var ts; function nextTokenIsIdentifierOrStartOfDestructuringOnTheSameLine() { nextToken(); return !scanner.hasPrecedingLineBreak() && - (isIdentifier() || token === 14 || token === 18); + (isIdentifier() || token === 14 /* OpenBraceToken */ || token === 18 /* OpenBracketToken */); } function parseYieldExpression() { - var node = createNode(172); + var node = createNode(172 /* YieldExpression */); + // YieldExpression[In] : + // yield + // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] + // yield [no LineTerminator here] * [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] nextToken(); if (!scanner.hasPrecedingLineBreak() && - (token === 35 || isStartOfExpression())) { - node.asteriskToken = parseOptionalToken(35); + (token === 35 /* AsteriskToken */ || isStartOfExpression())) { + node.asteriskToken = parseOptionalToken(35 /* AsteriskToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } else { + // if the next token is not on the same line as yield. or we don't have an '*' or + // the start of an expressin, then this is just a simple "yield" expression. return finishNode(node); } } function parseSimpleArrowFunctionExpression(identifier) { - ts.Debug.assert(token === 32, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - var node = createNode(163, identifier.pos); - var parameter = createNode(129, identifier.pos); + ts.Debug.assert(token === 32 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); + var node = createNode(163 /* ArrowFunction */, identifier.pos); + var parameter = createNode(129 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = [parameter]; node.parameters.pos = parameter.pos; node.parameters.end = parameter.end; - node.equalsGreaterThanToken = parseExpectedToken(32, false, ts.Diagnostics._0_expected, "=>"); + node.equalsGreaterThanToken = parseExpectedToken(32 /* EqualsGreaterThanToken */, false, ts.Diagnostics._0_expected, "=>"); node.body = parseArrowFunctionExpressionBody(); return finishNode(node); } function tryParseParenthesizedArrowFunctionExpression() { var triState = isParenthesizedArrowFunctionExpression(); - if (triState === 0) { + if (triState === 0 /* False */) { + // It's definitely not a parenthesized arrow function expression. return undefined; } - var arrowFunction = triState === 1 + // If we definitely have an arrow function, then we can just parse one, not requiring a + // following => or { token. Otherwise, we *might* have an arrow function. Try to parse + // it out, but don't allow any ambiguity, and return 'undefined' if this could be an + // expression instead. + var arrowFunction = triState === 1 /* True */ ? parseParenthesizedArrowFunctionExpressionHead(true) : tryParse(parsePossibleParenthesizedArrowFunctionExpressionHead); if (!arrowFunction) { + // Didn't appear to actually be a parenthesized arrow function. Just bail out. return undefined; } + // If we have an arrow, then try to parse the body. Even if not, try to parse if we + // have an opening brace, just in case we're in an error state. var lastToken = token; - arrowFunction.equalsGreaterThanToken = parseExpectedToken(32, false, ts.Diagnostics._0_expected, "=>"); - arrowFunction.body = (lastToken === 32 || lastToken === 14) + arrowFunction.equalsGreaterThanToken = parseExpectedToken(32 /* EqualsGreaterThanToken */, false, ts.Diagnostics._0_expected, "=>"); + arrowFunction.body = (lastToken === 32 /* EqualsGreaterThanToken */ || lastToken === 14 /* OpenBraceToken */) ? parseArrowFunctionExpressionBody() : parseIdentifier(); return finishNode(arrowFunction); } + // True -> We definitely expect a parenthesized arrow function here. + // False -> There *cannot* be a parenthesized arrow function here. + // Unknown -> There *might* be a parenthesized arrow function here. + // Speculatively look ahead to be sure, and rollback if not. function isParenthesizedArrowFunctionExpression() { - if (token === 16 || token === 24) { + if (token === 16 /* OpenParenToken */ || token === 24 /* LessThanToken */) { return lookAhead(isParenthesizedArrowFunctionExpressionWorker); } - if (token === 32) { - return 1; + if (token === 32 /* EqualsGreaterThanToken */) { + // ERROR RECOVERY TWEAK: + // If we see a standalone => try to parse it as an arrow function expression as that's + // likely what the user intended to write. + return 1 /* True */; } - return 0; + // Definitely not a parenthesized arrow function. + return 0 /* False */; } function isParenthesizedArrowFunctionExpressionWorker() { var first = token; var second = nextToken(); - if (first === 16) { - if (second === 17) { + if (first === 16 /* OpenParenToken */) { + if (second === 17 /* CloseParenToken */) { + // Simple cases: "() =>", "(): ", and "() {". + // This is an arrow function with no parameters. + // The last one is not actually an arrow function, + // but this is probably what the user intended. var third = nextToken(); switch (third) { - case 32: - case 51: - case 14: - return 1; + case 32 /* EqualsGreaterThanToken */: + case 51 /* ColonToken */: + case 14 /* OpenBraceToken */: + return 1 /* True */; default: - return 0; + return 0 /* False */; } } - if (second === 21) { - return 1; + // If encounter "([" or "({", this could be the start of a binding pattern. + // Examples: + // ([ x ]) => { } + // ({ x }) => { } + // ([ x ]) + // ({ x }) + if (second === 18 /* OpenBracketToken */ || second === 14 /* OpenBraceToken */) { + return 2 /* Unknown */; } + // Simple case: "(..." + // This is an arrow function with a rest parameter. + if (second === 21 /* DotDotDotToken */) { + return 1 /* True */; + } + // If we had "(" followed by something that's not an identifier, + // then this definitely doesn't look like a lambda. + // Note: we could be a little more lenient and allow + // "(public" or "(private". These would not ever actually be allowed, + // but we could provide a good error message instead of bailing out. if (!isIdentifier()) { - return 0; + return 0 /* False */; } - if (nextToken() === 51) { - return 1; + // If we have something like "(a:", then we must have a + // type-annotated parameter in an arrow function expression. + if (nextToken() === 51 /* ColonToken */) { + return 1 /* True */; } - return 2; + // This *could* be a parenthesized arrow function. + // Return Unknown to let the caller know. + return 2 /* Unknown */; } else { - ts.Debug.assert(first === 24); + ts.Debug.assert(first === 24 /* LessThanToken */); + // If we have "<" not followed by an identifier, + // then this definitely is not an arrow function. if (!isIdentifier()) { - return 0; + return 0 /* False */; } - return 2; + // This *could* be a parenthesized arrow function. + return 2 /* Unknown */; } } function parsePossibleParenthesizedArrowFunctionExpressionHead() { return parseParenthesizedArrowFunctionExpressionHead(false); } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNode(163); - fillSignature(51, false, !allowAmbiguity, node); + var node = createNode(163 /* ArrowFunction */); + // Arrow functions are never generators. + // + // If we're speculatively parsing a signature for a parenthesized arrow function, then + // we have to have a complete parameter list. Otherwise we might see something like + // a => (b => c) + // And think that "(b =>" was actually a parenthesized arrow function with a missing + // close paren. + fillSignature(51 /* ColonToken */, false, !allowAmbiguity, node); + // If we couldn't get parameters, we definitely could not parse out an arrow function. if (!node.parameters) { return undefined; } - if (!allowAmbiguity && token !== 32 && token !== 14) { + // Parsing a signature isn't enough. + // Parenthesized arrow signatures often look like other valid expressions. + // For instance: + // - "(x = 10)" is an assignment expression parsed as a signature with a default parameter value. + // - "(x,y)" is a comma expression parsed as a signature with two parameters. + // - "a ? (b): c" will have "(b):" parsed as a signature with a return type annotation. + // + // So we need just a bit of lookahead to ensure that it can only be a signature. + if (!allowAmbiguity && token !== 32 /* EqualsGreaterThanToken */ && token !== 14 /* OpenBraceToken */) { + // Returning undefined here will cause our caller to rewind to where we started from. return undefined; } return node; } function parseArrowFunctionExpressionBody() { - if (token === 14) { + if (token === 14 /* OpenBraceToken */) { return parseFunctionBlock(false, false); } if (isStartOfStatement(true) && !isStartOfExpressionStatement() && - token !== 83 && - token !== 69) { + token !== 83 /* FunctionKeyword */ && + token !== 69 /* 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: + // + // a => + // let v = 0; + // } + // + // they may be missing an open brace. Check to see if that's the case so we can + // try to recover better. If we don't do this, then the next close curly we see may end + // up preemptively closing the containing construct. + // + // Note: even when 'ignoreMissingOpenBrace' is passed as true, parseBody will still error. return parseFunctionBlock(false, true); } return parseAssignmentExpressionOrHigher(); } function parseConditionalExpressionRest(leftOperand) { - var questionToken = parseOptionalToken(50); + // Note: we are passed in an expression which was produced from parseBinaryExpressionOrHigher. + var questionToken = parseOptionalToken(50 /* QuestionToken */); if (!questionToken) { return leftOperand; } - var node = createNode(170, leftOperand.pos); + // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and + // we do not that for the 'whenFalse' part. + var node = createNode(170 /* ConditionalExpression */, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); - node.colonToken = parseExpectedToken(51, false, ts.Diagnostics._0_expected, ts.tokenToString(51)); + node.colonToken = parseExpectedToken(51 /* ColonToken */, false, ts.Diagnostics._0_expected, ts.tokenToString(51 /* ColonToken */)); node.whenFalse = parseAssignmentExpressionOrHigher(); return finishNode(node); } @@ -7366,16 +8331,19 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 86 || t === 125; + return t === 86 /* InKeyword */ || t === 125 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { + // We either have a binary operator here, or we're finished. We call + // reScanGreaterToken so that we merge token sequences like > and = into >= reScanGreaterToken(); var newPrecedence = getBinaryOperatorPrecedence(); + // Check the precedence to see if we should "take" this operator if (newPrecedence <= precedence) { break; } - if (token === 86 && inDisallowInContext()) { + if (token === 86 /* InKeyword */ && inDisallowInContext()) { break; } leftOperand = makeBinaryExpression(leftOperand, parseTokenNode(), parseBinaryExpressionOrHigher(newPrecedence)); @@ -7383,97 +8351,99 @@ var ts; return leftOperand; } function isBinaryOperator() { - if (inDisallowInContext() && token === 86) { + if (inDisallowInContext() && token === 86 /* InKeyword */) { return false; } return getBinaryOperatorPrecedence() > 0; } function getBinaryOperatorPrecedence() { switch (token) { - case 49: + case 49 /* BarBarToken */: return 1; - case 48: + case 48 /* AmpersandAmpersandToken */: return 2; - case 44: + case 44 /* BarToken */: return 3; - case 45: + case 45 /* CaretToken */: return 4; - case 43: + case 43 /* AmpersandToken */: return 5; - case 28: - case 29: - case 30: - case 31: + case 28 /* EqualsEqualsToken */: + case 29 /* ExclamationEqualsToken */: + case 30 /* EqualsEqualsEqualsToken */: + case 31 /* ExclamationEqualsEqualsToken */: return 6; - case 24: - case 25: - case 26: - case 27: - case 87: - case 86: + case 24 /* LessThanToken */: + case 25 /* GreaterThanToken */: + case 26 /* LessThanEqualsToken */: + case 27 /* GreaterThanEqualsToken */: + case 87 /* InstanceOfKeyword */: + case 86 /* InKeyword */: return 7; - case 40: - case 41: - case 42: + case 40 /* LessThanLessThanToken */: + case 41 /* GreaterThanGreaterThanToken */: + case 42 /* GreaterThanGreaterThanGreaterThanToken */: return 8; - case 33: - case 34: + case 33 /* PlusToken */: + case 34 /* MinusToken */: return 9; - case 35: - case 36: - case 37: + case 35 /* AsteriskToken */: + case 36 /* SlashToken */: + case 37 /* PercentToken */: return 10; } + // -1 is lower than all other precedences. Returning it will cause binary expression + // parsing to stop. return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(169, left.pos); + var node = createNode(169 /* BinaryExpression */, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(167); + var node = createNode(167 /* PrefixUnaryExpression */); node.operator = token; nextToken(); node.operand = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(164); + var node = createNode(164 /* DeleteExpression */); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(165); + var node = createNode(165 /* TypeOfExpression */); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(166); + var node = createNode(166 /* VoidExpression */); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseUnaryExpressionOrHigher() { switch (token) { - case 33: - case 34: - case 47: - case 46: - case 38: - case 39: + case 33 /* PlusToken */: + case 34 /* MinusToken */: + case 47 /* TildeToken */: + case 46 /* ExclamationToken */: + case 38 /* PlusPlusToken */: + case 39 /* MinusMinusToken */: return parsePrefixUnaryExpression(); - case 74: + case 74 /* DeleteKeyword */: return parseDeleteExpression(); - case 97: + case 97 /* TypeOfKeyword */: return parseTypeOfExpression(); - case 99: + case 99 /* VoidKeyword */: return parseVoidExpression(); - case 24: + case 24 /* LessThanToken */: return parseTypeAssertion(); default: return parsePostfixExpressionOrHigher(); @@ -7481,9 +8451,9 @@ var ts; } function parsePostfixExpressionOrHigher() { var expression = parseLeftHandSideExpressionOrHigher(); - ts.Debug.assert(isLeftHandSideExpression(expression)); - if ((token === 38 || token === 39) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(168, expression.pos); + ts.Debug.assert(ts.isLeftHandSideExpression(expression)); + if ((token === 38 /* PlusPlusToken */ || token === 39 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { + var node = createNode(168 /* PostfixUnaryExpression */, expression.pos); node.operand = expression; node.operator = token; nextToken(); @@ -7492,63 +8462,147 @@ var ts; return expression; } function parseLeftHandSideExpressionOrHigher() { - var expression = token === 91 + // Original Ecma: + // LeftHandSideExpression: See 11.2 + // NewExpression + // CallExpression + // + // Our simplification: + // + // LeftHandSideExpression: See 11.2 + // MemberExpression + // CallExpression + // + // See comment in parseMemberExpressionOrHigher on how we replaced NewExpression with + // MemberExpression to make our lives easier. + // + // to best understand the below code, it's important to see how CallExpression expands + // out into its own productions: + // + // CallExpression: + // MemberExpression Arguments + // CallExpression Arguments + // CallExpression[Expression] + // CallExpression.IdentifierName + // super ( ArgumentListopt ) + // super.IdentifierName + // + // Because of the recursion in these calls, we need to bottom out first. There are two + // bottom out states we can run into. Either we see 'super' which must start either of + // the last two CallExpression productions. Or we have a MemberExpression which either + // completes the LeftHandSideExpression, or starts the beginning of the first four + // CallExpression productions. + var expression = token === 91 /* SuperKeyword */ ? parseSuperExpression() : parseMemberExpressionOrHigher(); + // Now, we *may* be complete. However, we might have consumed the start of a + // CallExpression. As such, we need to consume the rest of it here to be complete. return parseCallExpressionRest(expression); } function parseMemberExpressionOrHigher() { + // Note: to make our lives simpler, we decompose the the NewExpression productions and + // place ObjectCreationExpression and FunctionExpression into PrimaryExpression. + // like so: + // + // PrimaryExpression : See 11.1 + // this + // Identifier + // Literal + // ArrayLiteral + // ObjectLiteral + // (Expression) + // FunctionExpression + // new MemberExpression Arguments? + // + // MemberExpression : See 11.2 + // PrimaryExpression + // MemberExpression[Expression] + // MemberExpression.IdentifierName + // + // CallExpression : See 11.2 + // MemberExpression + // CallExpression Arguments + // CallExpression[Expression] + // CallExpression.IdentifierName + // + // Technically this is ambiguous. i.e. CallExpression defines: + // + // CallExpression: + // CallExpression Arguments + // + // If you see: "new Foo()" + // + // Then that could be treated as a single ObjectCreationExpression, or it could be + // treated as the invocation of "new Foo". We disambiguate that in code (to match + // the original grammar) by making sure that if we see an ObjectCreationExpression + // we always consume arguments if they are there. So we treat "new Foo()" as an + // object creation only, and not at all as an invocation) Another way to think + // about this is that for every "new" that we see, we will consume an argument list if + // it is there as part of the *associated* object creation node. Any additional + // argument lists we see, will become invocation expressions. + // + // Because there are no other places in the grammar now that refer to FunctionExpression + // or ObjectCreationExpression, it is safe to push down into the PrimaryExpression + // production. + // + // Because CallExpression and MemberExpression are left recursive, we need to bottom out + // of the recursion immediately. So we parse out a primary expression to start with. var expression = parsePrimaryExpression(); return parseMemberExpressionRest(expression); } function parseSuperExpression() { var expression = parseTokenNode(); - if (token === 16 || token === 20) { + if (token === 16 /* OpenParenToken */ || token === 20 /* DotToken */) { return expression; } - var node = createNode(155, expression.pos); + // If we have seen "super" it must be followed by '(' or '.'. + // If it wasn't then just try to parse out a '.' and report an error. + var node = createNode(155 /* PropertyAccessExpression */, expression.pos); node.expression = expression; - node.dotToken = parseExpectedToken(20, false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); + node.dotToken = parseExpectedToken(20 /* DotToken */, false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(true); return finishNode(node); } function parseTypeAssertion() { - var node = createNode(160); - parseExpected(24); + var node = createNode(160 /* TypeAssertionExpression */); + parseExpected(24 /* LessThanToken */); node.type = parseType(); - parseExpected(25); + parseExpected(25 /* GreaterThanToken */); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseMemberExpressionRest(expression) { while (true) { - var dotToken = parseOptionalToken(20); + var dotToken = parseOptionalToken(20 /* DotToken */); if (dotToken) { - var propertyAccess = createNode(155, expression.pos); + var propertyAccess = createNode(155 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.dotToken = dotToken; propertyAccess.name = parseRightSideOfDot(true); expression = finishNode(propertyAccess); continue; } - if (!inDecoratorContext() && parseOptional(18)) { - var indexedAccess = createNode(156, expression.pos); + // when in the [Decorator] context, we do not parse ElementAccess as it could be part of a ComputedPropertyName + if (!inDecoratorContext() && parseOptional(18 /* OpenBracketToken */)) { + var indexedAccess = createNode(156 /* ElementAccessExpression */, expression.pos); indexedAccess.expression = expression; - if (token !== 19) { + // It's not uncommon for a user to write: "new Type[]". + // Check for that common pattern and report a better error message. + if (token !== 19 /* CloseBracketToken */) { indexedAccess.argumentExpression = allowInAnd(parseExpression); - if (indexedAccess.argumentExpression.kind === 8 || indexedAccess.argumentExpression.kind === 7) { + if (indexedAccess.argumentExpression.kind === 8 /* StringLiteral */ || indexedAccess.argumentExpression.kind === 7 /* NumericLiteral */) { var literal = indexedAccess.argumentExpression; literal.text = internIdentifier(literal.text); } } - parseExpected(19); + parseExpected(19 /* CloseBracketToken */); expression = finishNode(indexedAccess); continue; } - if (token === 10 || token === 11) { - var tagExpression = createNode(159, expression.pos); + if (token === 10 /* NoSubstitutionTemplateLiteral */ || token === 11 /* TemplateHead */) { + var tagExpression = createNode(159 /* TaggedTemplateExpression */, expression.pos); tagExpression.tag = expression; - tagExpression.template = token === 10 + tagExpression.template = token === 10 /* NoSubstitutionTemplateLiteral */ ? parseLiteralNode() : parseTemplateExpression(); expression = finishNode(tagExpression); @@ -7560,20 +8614,24 @@ var ts; function parseCallExpressionRest(expression) { while (true) { expression = parseMemberExpressionRest(expression); - if (token === 24) { + if (token === 24 /* LessThanToken */) { + // See if this is the start of a generic invocation. If so, consume it and + // keep checking for postfix expressions. Otherwise, it's just a '<' that's + // part of an arithmetic expression. Break out so we consume it higher in the + // stack. var typeArguments = tryParse(parseTypeArgumentsInExpression); if (!typeArguments) { return expression; } - var callExpr = createNode(157, expression.pos); + var callExpr = createNode(157 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); continue; } - else if (token === 16) { - var callExpr = createNode(157, expression.pos); + else if (token === 16 /* OpenParenToken */) { + var callExpr = createNode(157 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -7583,121 +8641,133 @@ var ts; } } function parseArgumentList() { - parseExpected(16); - var result = parseDelimitedList(12, parseArgumentExpression); - parseExpected(17); + parseExpected(16 /* OpenParenToken */); + var result = parseDelimitedList(12 /* ArgumentExpressions */, parseArgumentExpression); + parseExpected(17 /* CloseParenToken */); return result; } function parseTypeArgumentsInExpression() { - if (!parseOptional(24)) { + if (!parseOptional(24 /* LessThanToken */)) { return undefined; } - var typeArguments = parseDelimitedList(17, parseType); - if (!parseExpected(25)) { + var typeArguments = parseDelimitedList(17 /* TypeArguments */, parseType); + if (!parseExpected(25 /* GreaterThanToken */)) { + // If it doesn't have the closing > then it's definitely not an type argument list. return undefined; } + // If we have a '<', then only parse this as a arugment list if the type arguments + // are complete and we have an open paren. if we don't, rewind and return nothing. return typeArguments && canFollowTypeArgumentsInExpression() ? typeArguments : undefined; } function canFollowTypeArgumentsInExpression() { switch (token) { - case 16: - case 20: - case 17: - case 19: - case 51: - case 22: - case 50: - case 28: - case 30: - case 29: - case 31: - case 48: - case 49: - case 45: - case 43: - case 44: - case 15: - case 1: + case 16 /* OpenParenToken */: // foo( + // this case are the only case where this token can legally follow a type argument + // list. So we definitely want to treat this as a type arg list. + case 20 /* DotToken */: // foo. + case 17 /* CloseParenToken */: // foo) + case 19 /* CloseBracketToken */: // foo] + case 51 /* ColonToken */: // foo: + case 22 /* SemicolonToken */: // foo; + case 50 /* QuestionToken */: // foo? + case 28 /* EqualsEqualsToken */: // foo == + case 30 /* EqualsEqualsEqualsToken */: // foo === + case 29 /* ExclamationEqualsToken */: // foo != + case 31 /* ExclamationEqualsEqualsToken */: // foo !== + case 48 /* AmpersandAmpersandToken */: // foo && + case 49 /* BarBarToken */: // foo || + case 45 /* CaretToken */: // foo ^ + case 43 /* AmpersandToken */: // foo & + case 44 /* BarToken */: // foo | + case 15 /* CloseBraceToken */: // foo } + case 1 /* EndOfFileToken */: + // these cases can't legally follow a type arg list. However, they're not legal + // expressions either. The user is probably in the middle of a generic type. So + // treat it as such. return true; - case 23: - case 14: + case 23 /* CommaToken */: // foo, + case 14 /* 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; } } function parsePrimaryExpression() { switch (token) { - case 7: - case 8: - case 10: + case 7 /* NumericLiteral */: + case 8 /* StringLiteral */: + case 10 /* NoSubstitutionTemplateLiteral */: return parseLiteralNode(); - case 93: - case 91: - case 89: - case 95: - case 80: + case 93 /* ThisKeyword */: + case 91 /* SuperKeyword */: + case 89 /* NullKeyword */: + case 95 /* TrueKeyword */: + case 80 /* FalseKeyword */: return parseTokenNode(); - case 16: + case 16 /* OpenParenToken */: return parseParenthesizedExpression(); - case 18: + case 18 /* OpenBracketToken */: return parseArrayLiteralExpression(); - case 14: + case 14 /* OpenBraceToken */: return parseObjectLiteralExpression(); - case 69: + case 69 /* ClassKeyword */: return parseClassExpression(); - case 83: + case 83 /* FunctionKeyword */: return parseFunctionExpression(); - case 88: + case 88 /* NewKeyword */: return parseNewExpression(); - case 36: - case 57: - if (reScanSlashToken() === 9) { + case 36 /* SlashToken */: + case 57 /* SlashEqualsToken */: + if (reScanSlashToken() === 9 /* RegularExpressionLiteral */) { return parseLiteralNode(); } break; - case 11: + case 11 /* TemplateHead */: return parseTemplateExpression(); } return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNode(161); - parseExpected(16); + var node = createNode(161 /* ParenthesizedExpression */); + parseExpected(16 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); - parseExpected(17); + parseExpected(17 /* CloseParenToken */); return finishNode(node); } function parseSpreadElement() { - var node = createNode(173); - parseExpected(21); + var node = createNode(173 /* SpreadElementExpression */); + parseExpected(21 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { - return token === 21 ? parseSpreadElement() : - token === 23 ? createNode(175) : + return token === 21 /* DotDotDotToken */ ? parseSpreadElement() : + token === 23 /* CommaToken */ ? createNode(175 /* OmittedExpression */) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(153); - parseExpected(18); + var node = createNode(153 /* ArrayLiteralExpression */); + parseExpected(18 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) - node.flags |= 512; - node.elements = parseDelimitedList(14, parseArgumentOrArrayLiteralElement); - parseExpected(19); + node.flags |= 512 /* MultiLine */; + node.elements = parseDelimitedList(14 /* ArrayLiteralMembers */, parseArgumentOrArrayLiteralElement); + parseExpected(19 /* CloseBracketToken */); return finishNode(node); } function tryParseAccessorDeclaration(fullStart, decorators, modifiers) { - if (parseContextualModifier(116)) { - return parseAccessorDeclaration(136, fullStart, decorators, modifiers); + if (parseContextualModifier(116 /* GetKeyword */)) { + return parseAccessorDeclaration(136 /* GetAccessor */, fullStart, decorators, modifiers); } - else if (parseContextualModifier(120)) { - return parseAccessorDeclaration(137, fullStart, decorators, modifiers); + else if (parseContextualModifier(120 /* SetKeyword */)) { + return parseAccessorDeclaration(137 /* SetAccessor */, fullStart, decorators, modifiers); } return undefined; } @@ -7709,49 +8779,55 @@ var ts; if (accessor) { return accessor; } - var asteriskToken = parseOptionalToken(35); + var asteriskToken = parseOptionalToken(35 /* AsteriskToken */); var tokenIsIdentifier = isIdentifier(); var nameToken = token; var propertyName = parsePropertyName(); - var questionToken = parseOptionalToken(50); - if (asteriskToken || token === 16 || token === 24) { + // Disallowing of optional property assignments happens in the grammar checker. + var questionToken = parseOptionalToken(50 /* QuestionToken */); + if (asteriskToken || token === 16 /* OpenParenToken */ || token === 24 /* LessThanToken */) { return parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, propertyName, questionToken); } - if ((token === 23 || token === 15) && tokenIsIdentifier) { - var shorthandDeclaration = createNode(225, fullStart); + // Parse to check if it is short-hand property assignment or normal property assignment + if ((token === 23 /* CommaToken */ || token === 15 /* CloseBraceToken */) && tokenIsIdentifier) { + var shorthandDeclaration = createNode(225 /* ShorthandPropertyAssignment */, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; return finishNode(shorthandDeclaration); } else { - var propertyAssignment = createNode(224, fullStart); + var propertyAssignment = createNode(224 /* PropertyAssignment */, fullStart); propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; - parseExpected(51); + parseExpected(51 /* ColonToken */); propertyAssignment.initializer = allowInAnd(parseAssignmentExpressionOrHigher); return finishNode(propertyAssignment); } } function parseObjectLiteralExpression() { - var node = createNode(154); - parseExpected(14); + var node = createNode(154 /* ObjectLiteralExpression */); + parseExpected(14 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { - node.flags |= 512; + node.flags |= 512 /* MultiLine */; } - node.properties = parseDelimitedList(13, parseObjectLiteralElement, true); - parseExpected(15); + node.properties = parseDelimitedList(13 /* ObjectLiteralMembers */, parseObjectLiteralElement, true); + parseExpected(15 /* CloseBraceToken */); return finishNode(node); } function parseFunctionExpression() { + // GeneratorExpression : + // function * BindingIdentifier[Yield]opt (FormalParameters[Yield, GeneratorParameter]) { GeneratorBody[Yield] } + // FunctionExpression: + // function BindingIdentifieropt(FormalParameters) { FunctionBody } var saveDecoratorContext = inDecoratorContext(); if (saveDecoratorContext) { setDecoratorContext(false); } - var node = createNode(162); - parseExpected(83); - node.asteriskToken = parseOptionalToken(35); + var node = createNode(162 /* FunctionExpression */); + parseExpected(83 /* FunctionKeyword */); + node.asteriskToken = parseOptionalToken(35 /* AsteriskToken */); node.name = node.asteriskToken ? doInYieldContext(parseOptionalIdentifier) : parseOptionalIdentifier(); - fillSignature(51, !!node.asteriskToken, false, node); + fillSignature(51 /* ColonToken */, !!node.asteriskToken, false, node); node.body = parseFunctionBlock(!!node.asteriskToken, false); if (saveDecoratorContext) { setDecoratorContext(true); @@ -7762,20 +8838,21 @@ var ts; return isIdentifier() ? parseIdentifier() : undefined; } function parseNewExpression() { - var node = createNode(158); - parseExpected(88); + var node = createNode(158 /* NewExpression */); + parseExpected(88 /* NewKeyword */); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); - if (node.typeArguments || token === 16) { + if (node.typeArguments || token === 16 /* OpenParenToken */) { node.arguments = parseArgumentList(); } return finishNode(node); } + // STATEMENTS function parseBlock(ignoreMissingOpenBrace, checkForStrictMode, diagnosticMessage) { - var node = createNode(179); - if (parseExpected(14, diagnosticMessage) || ignoreMissingOpenBrace) { - node.statements = parseList(2, checkForStrictMode, parseStatement); - parseExpected(15); + var node = createNode(179 /* Block */); + if (parseExpected(14 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { + node.statements = parseList(2 /* BlockStatements */, checkForStrictMode, parseStatement); + parseExpected(15 /* CloseBraceToken */); } else { node.statements = createMissingList(); @@ -7785,6 +8862,8 @@ var ts; function parseFunctionBlock(allowYield, ignoreMissingOpenBrace, diagnosticMessage) { var savedYieldContext = inYieldContext(); setYieldContext(allowYield); + // We may be in a [Decorator] context when parsing a function expression or + // arrow function. The body of the function is not in [Decorator] context. var saveDecoratorContext = inDecoratorContext(); if (saveDecoratorContext) { setDecoratorContext(false); @@ -7797,47 +8876,51 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(181); - parseExpected(22); + var node = createNode(181 /* EmptyStatement */); + parseExpected(22 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(183); - parseExpected(84); - parseExpected(16); + var node = createNode(183 /* IfStatement */); + parseExpected(84 /* IfKeyword */); + parseExpected(16 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); - parseExpected(17); + parseExpected(17 /* CloseParenToken */); node.thenStatement = parseStatement(); - node.elseStatement = parseOptional(76) ? parseStatement() : undefined; + node.elseStatement = parseOptional(76 /* ElseKeyword */) ? parseStatement() : undefined; return finishNode(node); } function parseDoStatement() { - var node = createNode(184); - parseExpected(75); + var node = createNode(184 /* DoStatement */); + parseExpected(75 /* DoKeyword */); node.statement = parseStatement(); - parseExpected(100); - parseExpected(16); + parseExpected(100 /* WhileKeyword */); + parseExpected(16 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); - parseExpected(17); - parseOptional(22); + parseExpected(17 /* CloseParenToken */); + // From: https://mail.mozilla.org/pipermail/es-discuss/2011-August/016188.html + // 157 min --- All allen at wirfs-brock.com CONF --- "do{;}while(false)false" prohibited in + // spec but allowed in consensus reality. Approved -- this is the de-facto standard whereby + // do;while(0)x will have a semicolon inserted before x. + parseOptional(22 /* SemicolonToken */); return finishNode(node); } function parseWhileStatement() { - var node = createNode(185); - parseExpected(100); - parseExpected(16); + var node = createNode(185 /* WhileStatement */); + parseExpected(100 /* WhileKeyword */); + parseExpected(16 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); - parseExpected(17); + parseExpected(17 /* CloseParenToken */); node.statement = parseStatement(); return finishNode(node); } function parseForOrForInOrForOfStatement() { var pos = getNodePos(); - parseExpected(82); - parseExpected(16); + parseExpected(82 /* ForKeyword */); + parseExpected(16 /* OpenParenToken */); var initializer = undefined; - if (token !== 22) { - if (token === 98 || token === 105 || token === 70) { + if (token !== 22 /* SemicolonToken */) { + if (token === 98 /* VarKeyword */ || token === 104 /* LetKeyword */ || token === 70 /* ConstKeyword */) { initializer = parseVariableDeclarationList(true); } else { @@ -7845,32 +8928,32 @@ var ts; } } var forOrForInOrForOfStatement; - if (parseOptional(86)) { - var forInStatement = createNode(187, pos); + if (parseOptional(86 /* InKeyword */)) { + var forInStatement = createNode(187 /* ForInStatement */, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); - parseExpected(17); + parseExpected(17 /* CloseParenToken */); forOrForInOrForOfStatement = forInStatement; } - else if (parseOptional(125)) { - var forOfStatement = createNode(188, pos); + else if (parseOptional(125 /* OfKeyword */)) { + var forOfStatement = createNode(188 /* ForOfStatement */, pos); forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); - parseExpected(17); + parseExpected(17 /* CloseParenToken */); forOrForInOrForOfStatement = forOfStatement; } else { - var forStatement = createNode(186, pos); + var forStatement = createNode(186 /* ForStatement */, pos); forStatement.initializer = initializer; - parseExpected(22); - if (token !== 22 && token !== 17) { + parseExpected(22 /* SemicolonToken */); + if (token !== 22 /* SemicolonToken */ && token !== 17 /* CloseParenToken */) { forStatement.condition = allowInAnd(parseExpression); } - parseExpected(22); - if (token !== 17) { + parseExpected(22 /* SemicolonToken */); + if (token !== 17 /* CloseParenToken */) { forStatement.iterator = allowInAnd(parseExpression); } - parseExpected(17); + parseExpected(17 /* CloseParenToken */); forOrForInOrForOfStatement = forStatement; } forOrForInOrForOfStatement.statement = parseStatement(); @@ -7878,7 +8961,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 190 ? 66 : 71); + parseExpected(kind === 190 /* BreakStatement */ ? 66 /* BreakKeyword */ : 71 /* ContinueKeyword */); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -7886,8 +8969,8 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(191); - parseExpected(90); + var node = createNode(191 /* ReturnStatement */); + parseExpected(90 /* ReturnKeyword */); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); } @@ -7895,98 +8978,115 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(192); - parseExpected(101); - parseExpected(16); + var node = createNode(192 /* WithStatement */); + parseExpected(101 /* WithKeyword */); + parseExpected(16 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); - parseExpected(17); + parseExpected(17 /* CloseParenToken */); node.statement = parseStatement(); return finishNode(node); } function parseCaseClause() { - var node = createNode(220); - parseExpected(67); + var node = createNode(220 /* CaseClause */); + parseExpected(67 /* CaseKeyword */); node.expression = allowInAnd(parseExpression); - parseExpected(51); - node.statements = parseList(4, false, parseStatement); + parseExpected(51 /* ColonToken */); + node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatement); return finishNode(node); } function parseDefaultClause() { - var node = createNode(221); - parseExpected(73); - parseExpected(51); - node.statements = parseList(4, false, parseStatement); + var node = createNode(221 /* DefaultClause */); + parseExpected(73 /* DefaultKeyword */); + parseExpected(51 /* ColonToken */); + node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatement); return finishNode(node); } function parseCaseOrDefaultClause() { - return token === 67 ? parseCaseClause() : parseDefaultClause(); + return token === 67 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(193); - parseExpected(92); - parseExpected(16); + var node = createNode(193 /* SwitchStatement */); + parseExpected(92 /* SwitchKeyword */); + parseExpected(16 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); - parseExpected(17); - var caseBlock = createNode(207, scanner.getStartPos()); - parseExpected(14); - caseBlock.clauses = parseList(3, false, parseCaseOrDefaultClause); - parseExpected(15); + parseExpected(17 /* CloseParenToken */); + var caseBlock = createNode(207 /* CaseBlock */, scanner.getStartPos()); + parseExpected(14 /* OpenBraceToken */); + caseBlock.clauses = parseList(3 /* SwitchClauses */, false, parseCaseOrDefaultClause); + parseExpected(15 /* CloseBraceToken */); node.caseBlock = finishNode(caseBlock); return finishNode(node); } function parseThrowStatement() { // ThrowStatement[Yield] : // throw [no LineTerminator here]Expression[In, ?Yield]; - var node = createNode(195); - parseExpected(94); + // Because of automatic semicolon insertion, we need to report error if this + // throw could be terminated with a semicolon. Note: we can't call 'parseExpression' + // directly as that might consume an expression on the following line. + // We just return 'undefined' in that case. The actual error will be reported in the + // grammar walker. + var node = createNode(195 /* ThrowStatement */); + parseExpected(94 /* ThrowKeyword */); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); return finishNode(node); } + // TODO: Review for error recovery function parseTryStatement() { - var node = createNode(196); - parseExpected(96); + var node = createNode(196 /* TryStatement */); + parseExpected(96 /* TryKeyword */); node.tryBlock = parseBlock(false, false); - node.catchClause = token === 68 ? parseCatchClause() : undefined; - if (!node.catchClause || token === 81) { - parseExpected(81); + node.catchClause = token === 68 /* CatchKeyword */ ? parseCatchClause() : undefined; + // If we don't have a catch clause, then we must have a finally clause. Try to parse + // one out no matter what. + if (!node.catchClause || token === 81 /* FinallyKeyword */) { + parseExpected(81 /* FinallyKeyword */); node.finallyBlock = parseBlock(false, false); } return finishNode(node); } function parseCatchClause() { - var result = createNode(223); - parseExpected(68); - if (parseExpected(16)) { + var result = createNode(223 /* CatchClause */); + parseExpected(68 /* CatchKeyword */); + if (parseExpected(16 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); } - parseExpected(17); + parseExpected(17 /* CloseParenToken */); result.block = parseBlock(false, false); return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(197); - parseExpected(72); + var node = createNode(197 /* DebuggerStatement */); + parseExpected(72 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); } function parseExpressionOrLabeledStatement() { + // Avoiding having to do the lookahead for a labeled statement by just trying to parse + // out an expression, seeing if it is identifier and then seeing if it is followed by + // a colon. var fullStart = scanner.getStartPos(); var expression = allowInAnd(parseExpression); - if (expression.kind === 65 && parseOptional(51)) { - var labeledStatement = createNode(194, fullStart); + if (expression.kind === 65 /* Identifier */ && parseOptional(51 /* ColonToken */)) { + var labeledStatement = createNode(194 /* LabeledStatement */, fullStart); labeledStatement.label = expression; labeledStatement.statement = parseStatement(); return finishNode(labeledStatement); } else { - var expressionStatement = createNode(182, fullStart); + var expressionStatement = createNode(182 /* ExpressionStatement */, fullStart); expressionStatement.expression = expression; parseSemicolon(); return finishNode(expressionStatement); } } function isStartOfStatement(inErrorRecovery) { + // 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 (ts.isModifier(token)) { var result = lookAhead(parseVariableStatementOrFunctionDeclarationOrClassDeclarationWithDecoratorsOrModifiers); if (result) { @@ -7994,42 +9094,57 @@ var ts; } } switch (token) { - case 22: + case 22 /* SemicolonToken */: + // If we're in error recovery, then we don't want to treat ';' as an empty statement. + // The problem is that ';' can show up in far too many contexts, and if we see one + // and assume it's a statement, then we may bail out inappropriately from whatever + // we're parsing. For example, if we have a semicolon in the middle of a class, then + // we really don't want to assume the class is over and we're on a statement in the + // outer module. We just want to consume and move on. return !inErrorRecovery; - case 14: - case 98: - case 105: - case 83: - 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: + case 14 /* OpenBraceToken */: + case 98 /* VarKeyword */: + case 104 /* LetKeyword */: + case 83 /* FunctionKeyword */: + case 69 /* ClassKeyword */: + case 84 /* IfKeyword */: + case 75 /* DoKeyword */: + case 100 /* WhileKeyword */: + case 82 /* ForKeyword */: + case 71 /* ContinueKeyword */: + case 66 /* BreakKeyword */: + case 90 /* ReturnKeyword */: + case 101 /* WithKeyword */: + case 92 /* SwitchKeyword */: + case 94 /* ThrowKeyword */: + case 96 /* TryKeyword */: + case 72 /* DebuggerKeyword */: + // 'catch' and 'finally' do not actually indicate that the code is part of a statement, + // however, we say they are here so that we may gracefully parse them and error later. + case 68 /* CatchKeyword */: + case 81 /* FinallyKeyword */: return true; - case 70: + case 70 /* ConstKeyword */: + // const keyword can precede enum keyword when defining constant enums + // 'const enum' do not start statement. + // In ES 6 'enum' is a future reserved keyword, so it should not be used as identifier var isConstEnum = lookAhead(nextTokenIsEnumKeyword); return !isConstEnum; - case 104: - case 117: - case 77: - case 123: + case 103 /* InterfaceKeyword */: + case 117 /* ModuleKeyword */: + case 77 /* EnumKeyword */: + case 123 /* TypeKeyword */: + // When followed by an identifier, these do not start a statement but might + // instead be following declarations if (isDeclarationStart()) { return false; } - case 109: - case 107: - case 108: - case 110: + case 108 /* PublicKeyword */: + case 106 /* PrivateKeyword */: + case 107 /* ProtectedKeyword */: + case 109 /* StaticKeyword */: + // When followed by an identifier or keyword, these do not start a statement but + // might instead be following type members if (lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine)) { return false; } @@ -8039,7 +9154,7 @@ var ts; } function nextTokenIsEnumKeyword() { nextToken(); - return token === 77; + return token === 77 /* EnumKeyword */; } function nextTokenIsIdentifierOrKeywordOnSameLine() { nextToken(); @@ -8047,49 +9162,61 @@ var ts; } function parseStatement() { switch (token) { - case 14: + case 14 /* OpenBraceToken */: return parseBlock(false, false); - case 98: - case 70: + case 98 /* VarKeyword */: + case 70 /* ConstKeyword */: + // const here should always be parsed as const declaration because of check in 'isStatement' return parseVariableStatement(scanner.getStartPos(), undefined, undefined); - case 83: + case 83 /* FunctionKeyword */: return parseFunctionDeclaration(scanner.getStartPos(), undefined, undefined); - case 69: + case 69 /* ClassKeyword */: return parseClassDeclaration(scanner.getStartPos(), undefined, undefined); - case 22: + case 22 /* SemicolonToken */: return parseEmptyStatement(); - case 84: + case 84 /* IfKeyword */: return parseIfStatement(); - case 75: + case 75 /* DoKeyword */: return parseDoStatement(); - case 100: + case 100 /* WhileKeyword */: return parseWhileStatement(); - case 82: + case 82 /* ForKeyword */: return parseForOrForInOrForOfStatement(); - case 71: - return parseBreakOrContinueStatement(189); - case 66: - return parseBreakOrContinueStatement(190); - case 90: + case 71 /* ContinueKeyword */: + return parseBreakOrContinueStatement(189 /* ContinueStatement */); + case 66 /* BreakKeyword */: + return parseBreakOrContinueStatement(190 /* BreakStatement */); + case 90 /* ReturnKeyword */: return parseReturnStatement(); - case 101: + case 101 /* WithKeyword */: return parseWithStatement(); - case 92: + case 92 /* SwitchKeyword */: return parseSwitchStatement(); - case 94: + case 94 /* ThrowKeyword */: return parseThrowStatement(); - case 96: - case 68: - case 81: + case 96 /* TryKeyword */: + // Include the next two for error recovery. + case 68 /* CatchKeyword */: + case 81 /* FinallyKeyword */: return parseTryStatement(); - case 72: + case 72 /* DebuggerKeyword */: return parseDebuggerStatement(); - case 105: + case 104 /* LetKeyword */: + // If let follows identifier on the same line, it is declaration parse it as variable statement if (isLetDeclaration()) { return parseVariableStatement(scanner.getStartPos(), undefined, undefined); } + // Else parse it like identifier - fall through default: - if (ts.isModifier(token) || token === 52) { + // 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. + // Even though variable statements and function declarations cannot have decorators, + // we parse them here to provide better error recovery. + if (ts.isModifier(token) || token === 52 /* AtToken */) { var result = tryParse(parseVariableStatementOrFunctionDeclarationOrClassDeclarationWithDecoratorsOrModifiers); if (result) { return result; @@ -8103,85 +9230,88 @@ var ts; var decorators = parseDecorators(); var modifiers = parseModifiers(); switch (token) { - case 70: + case 70 /* ConstKeyword */: var nextTokenIsEnum = lookAhead(nextTokenIsEnumKeyword); if (nextTokenIsEnum) { return undefined; } return parseVariableStatement(start, decorators, modifiers); - case 105: + case 104 /* LetKeyword */: if (!isLetDeclaration()) { return undefined; } return parseVariableStatement(start, decorators, modifiers); - case 98: + case 98 /* VarKeyword */: return parseVariableStatement(start, decorators, modifiers); - case 83: + case 83 /* FunctionKeyword */: return parseFunctionDeclaration(start, decorators, modifiers); - case 69: + case 69 /* ClassKeyword */: return parseClassDeclaration(start, decorators, modifiers); } return undefined; } function parseFunctionBlockOrSemicolon(isGenerator, diagnosticMessage) { - if (token !== 14 && canParseSemicolon()) { + if (token !== 14 /* OpenBraceToken */ && canParseSemicolon()) { parseSemicolon(); return; } return parseFunctionBlock(isGenerator, false, diagnosticMessage); } + // DECLARATIONS function parseArrayBindingElement() { - if (token === 23) { - return createNode(175); + if (token === 23 /* CommaToken */) { + return createNode(175 /* OmittedExpression */); } - var node = createNode(152); - node.dotDotDotToken = parseOptionalToken(21); + var node = createNode(152 /* BindingElement */); + node.dotDotDotToken = parseOptionalToken(21 /* DotDotDotToken */); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(false); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(152); - var id = parsePropertyName(); - if (id.kind === 65 && token !== 51) { - node.name = id; + var node = createNode(152 /* BindingElement */); + // TODO(andersh): Handle computed properties + var tokenIsIdentifier = isIdentifier(); + var propertyName = parsePropertyName(); + if (tokenIsIdentifier && token !== 51 /* ColonToken */) { + node.name = propertyName; } else { - parseExpected(51); - node.propertyName = id; + parseExpected(51 /* ColonToken */); + node.propertyName = propertyName; node.name = parseIdentifierOrPattern(); } node.initializer = parseInitializer(false); return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(150); - parseExpected(14); - node.elements = parseDelimitedList(10, parseObjectBindingElement); - parseExpected(15); + var node = createNode(150 /* ObjectBindingPattern */); + parseExpected(14 /* OpenBraceToken */); + node.elements = parseDelimitedList(10 /* ObjectBindingElements */, parseObjectBindingElement); + parseExpected(15 /* CloseBraceToken */); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(151); - parseExpected(18); - node.elements = parseDelimitedList(11, parseArrayBindingElement); - parseExpected(19); + var node = createNode(151 /* ArrayBindingPattern */); + parseExpected(18 /* OpenBracketToken */); + node.elements = parseDelimitedList(11 /* ArrayBindingElements */, parseArrayBindingElement); + parseExpected(19 /* CloseBracketToken */); return finishNode(node); } function isIdentifierOrPattern() { - return token === 14 || token === 18 || isIdentifier(); + return token === 14 /* OpenBraceToken */ || token === 18 /* OpenBracketToken */ || isIdentifier(); } function parseIdentifierOrPattern() { - if (token === 18) { + if (token === 18 /* OpenBracketToken */) { return parseArrayBindingPattern(); } - if (token === 14) { + if (token === 14 /* OpenBraceToken */) { return parseObjectBindingPattern(); } return parseIdentifier(); } function parseVariableDeclaration() { - var node = createNode(198); + var node = createNode(198 /* VariableDeclaration */); node.name = parseIdentifierOrPattern(); node.type = parseTypeAnnotation(); if (!isInOrOfKeyword(token)) { @@ -8190,36 +9320,45 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(199); + var node = createNode(199 /* VariableDeclarationList */); switch (token) { - case 98: + case 98 /* VarKeyword */: break; - case 105: - node.flags |= 4096; + case 104 /* LetKeyword */: + node.flags |= 4096 /* Let */; break; - case 70: - node.flags |= 8192; + case 70 /* ConstKeyword */: + node.flags |= 8192 /* Const */; break; default: ts.Debug.fail(); } nextToken(); - if (token === 125 && lookAhead(canFollowContextualOfKeyword)) { + // The user may have written the following: + // + // for (let of X) { } + // + // In this case, we want to parse an empty declaration list, and then parse 'of' + // as a keyword. The reason this is not automatic is that 'of' is a valid identifier. + // So we need to look ahead to determine if 'of' should be treated as a keyword in + // this context. + // The checker will then give an error that there is an empty declaration list. + if (token === 125 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { var savedDisallowIn = inDisallowInContext(); setDisallowInContext(inForStatementInitializer); - node.declarations = parseDelimitedList(9, parseVariableDeclaration); + node.declarations = parseDelimitedList(9 /* VariableDeclarations */, parseVariableDeclaration); setDisallowInContext(savedDisallowIn); } return finishNode(node); } function canFollowContextualOfKeyword() { - return nextTokenIsIdentifier() && nextToken() === 17; + return nextTokenIsIdentifier() && nextToken() === 17 /* CloseParenToken */; } function parseVariableStatement(fullStart, decorators, modifiers) { - var node = createNode(180, fullStart); + var node = createNode(180 /* VariableStatement */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.declarationList = parseVariableDeclarationList(false); @@ -8227,38 +9366,38 @@ var ts; return finishNode(node); } function parseFunctionDeclaration(fullStart, decorators, modifiers) { - var node = createNode(200, fullStart); + var node = createNode(200 /* FunctionDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(83); - node.asteriskToken = parseOptionalToken(35); - node.name = node.flags & 256 ? parseOptionalIdentifier() : parseIdentifier(); - fillSignature(51, !!node.asteriskToken, false, node); + parseExpected(83 /* FunctionKeyword */); + node.asteriskToken = parseOptionalToken(35 /* AsteriskToken */); + node.name = node.flags & 256 /* Default */ ? parseOptionalIdentifier() : parseIdentifier(); + fillSignature(51 /* ColonToken */, !!node.asteriskToken, false, node); node.body = parseFunctionBlockOrSemicolon(!!node.asteriskToken, ts.Diagnostics.or_expected); return finishNode(node); } function parseConstructorDeclaration(pos, decorators, modifiers) { - var node = createNode(135, pos); + var node = createNode(135 /* Constructor */, pos); node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(114); - fillSignature(51, false, false, node); + parseExpected(114 /* ConstructorKeyword */); + fillSignature(51 /* ColonToken */, false, false, node); node.body = parseFunctionBlockOrSemicolon(false, ts.Diagnostics.or_expected); return finishNode(node); } function parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, diagnosticMessage) { - var method = createNode(134, fullStart); + var method = createNode(134 /* MethodDeclaration */, fullStart); method.decorators = decorators; setModifiers(method, modifiers); method.asteriskToken = asteriskToken; method.name = name; method.questionToken = questionToken; - fillSignature(51, !!asteriskToken, false, method); + fillSignature(51 /* ColonToken */, !!asteriskToken, false, method); method.body = parseFunctionBlockOrSemicolon(!!asteriskToken, diagnosticMessage); return finishNode(method); } function parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken) { - var property = createNode(132, fullStart); + var property = createNode(132 /* PropertyDeclaration */, fullStart); property.decorators = decorators; setModifiers(property, modifiers); property.name = name; @@ -8269,10 +9408,12 @@ var ts; return finishNode(property); } function parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers) { - var asteriskToken = parseOptionalToken(35); + var asteriskToken = parseOptionalToken(35 /* AsteriskToken */); var name = parsePropertyName(); - var questionToken = parseOptionalToken(50); - if (asteriskToken || token === 16 || token === 24) { + // Note: this is not legal as per the grammar. But we allow it in the parser and + // report an error in the grammar checker. + var questionToken = parseOptionalToken(50 /* QuestionToken */); + if (asteriskToken || token === 16 /* OpenParenToken */ || token === 24 /* LessThanToken */) { return parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, ts.Diagnostics.or_expected); } else { @@ -8287,41 +9428,74 @@ var ts; node.decorators = decorators; setModifiers(node, modifiers); node.name = parsePropertyName(); - fillSignature(51, false, false, node); + fillSignature(51 /* ColonToken */, false, false, node); node.body = parseFunctionBlockOrSemicolon(false); return finishNode(node); } + function isClassMemberModifier(idToken) { + switch (idToken) { + case 108 /* PublicKeyword */: + case 106 /* PrivateKeyword */: + case 107 /* ProtectedKeyword */: + case 109 /* StaticKeyword */: + return true; + default: + return false; + } + } function isClassMemberStart() { var idToken; - if (token === 52) { + if (token === 52 /* AtToken */) { return true; } + // Eat up all modifiers, but hold on to the last one in case it is actually an identifier. while (ts.isModifier(token)) { idToken = token; + // If the idToken is a class modifier (protected, private, public, and static), it is + // certain that we are starting to parse class member. This allows better error recovery + // Example: + // public foo() ... // true + // public @dec blah ... // true; we will then report an error later + // export public ... // true; we will then report an error later + if (isClassMemberModifier(idToken)) { + return true; + } nextToken(); } - if (token === 35) { + if (token === 35 /* AsteriskToken */) { return true; } + // Try to get the first property-like token following all modifiers. + // This can either be an identifier or the 'get' or 'set' keywords. if (isLiteralPropertyName()) { idToken = token; nextToken(); } - if (token === 18) { + // Index signatures and computed properties are class members; we can parse. + if (token === 18 /* OpenBracketToken */) { return true; } + // If we were able to get any potential identifier... if (idToken !== undefined) { - if (!ts.isKeyword(idToken) || idToken === 120 || idToken === 116) { + // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. + if (!ts.isKeyword(idToken) || idToken === 120 /* SetKeyword */ || idToken === 116 /* GetKeyword */) { return true; } + // If it *is* a keyword, but not an accessor, check a little farther along + // to see if it should actually be parsed as a class member. switch (token) { - case 16: - case 24: - case 51: - case 53: - case 50: + case 16 /* OpenParenToken */: // Method declaration + case 24 /* LessThanToken */: // Generic Method declaration + case 51 /* ColonToken */: // Type Annotation for declaration + case 53 /* EqualsToken */: // Initializer for declaration + case 50 /* QuestionToken */: return true; default: + // Covers + // - Semicolons (declaration termination) + // - Closing braces (end-of-class, must be declaration) + // - End-of-files (not valid, but permitted so that it gets caught later on) + // - Line-breaks (enabling *automatic semicolon insertion*) return canParseSemicolon(); } } @@ -8331,14 +9505,14 @@ var ts; var decorators; while (true) { var decoratorStart = getNodePos(); - if (!parseOptional(52)) { + if (!parseOptional(52 /* AtToken */)) { break; } if (!decorators) { decorators = []; decorators.pos = scanner.getStartPos(); } - var decorator = createNode(130, decoratorStart); + var decorator = createNode(130 /* Decorator */, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); decorators.push(finishNode(decorator)); } @@ -8360,7 +9534,7 @@ var ts; modifiers = []; modifiers.pos = modifierStart; } - flags |= modifierToFlag(modifierKind); + flags |= ts.modifierToFlag(modifierKind); modifiers.push(finishNode(createNode(modifierKind, modifierStart))); } if (modifiers) { @@ -8370,8 +9544,8 @@ var ts; return modifiers; } function parseClassElement() { - if (token === 22) { - var result = createNode(178); + if (token === 22 /* SemicolonToken */) { + var result = createNode(178 /* SemicolonClassElement */); nextToken(); return finishNode(result); } @@ -8382,48 +9556,57 @@ var ts; if (accessor) { return accessor; } - if (token === 114) { + if (token === 114 /* ConstructorKeyword */) { return parseConstructorDeclaration(fullStart, decorators, modifiers); } if (isIndexSignature()) { return parseIndexSignatureDeclaration(fullStart, decorators, modifiers); } + // It is very important that we check this *after* checking indexers because + // the [ token can start an index signature or a computed property name if (isIdentifierOrKeyword() || - token === 8 || - token === 7 || - token === 35 || - token === 18) { + token === 8 /* StringLiteral */ || + token === 7 /* NumericLiteral */ || + token === 35 /* AsteriskToken */ || + token === 18 /* OpenBracketToken */) { return parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers); } if (decorators) { - var name_3 = createMissingNode(65, true, ts.Diagnostics.Declaration_expected); + // treat this as a property declaration with a missing name. + var name_3 = createMissingNode(65 /* Identifier */, true, ts.Diagnostics.Declaration_expected); return parsePropertyDeclaration(fullStart, decorators, modifiers, name_3, undefined); } + // 'isClassMemberStart' should have hinted not to attempt parsing. ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 174); + return parseClassDeclarationOrExpression( + /*fullStart:*/ scanner.getStartPos(), + /*decorators:*/ undefined, + /*modifiers:*/ undefined, 174 /* ClassExpression */); } function parseClassDeclaration(fullStart, decorators, modifiers) { - return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 201); + return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 201 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) { + // In ES6 specification, All parts of a ClassDeclaration or a ClassExpression are strict mode code var savedStrictModeContext = inStrictModeContext(); - if (languageVersion >= 2) { - setStrictModeContext(true); - } + setStrictModeContext(true); var node = createNode(kind, fullStart); node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(69); - node.name = node.flags & 256 ? parseOptionalIdentifier() : parseIdentifier(); + parseExpected(69 /* ClassKeyword */); + node.name = parseOptionalIdentifier(); node.typeParameters = parseTypeParameters(); node.heritageClauses = parseHeritageClauses(true); - if (parseExpected(14)) { + if (parseExpected(14 /* OpenBraceToken */)) { + // ClassTail[Yield,GeneratorParameter] : See 14.5 + // [~GeneratorParameter]ClassHeritage[?Yield]opt { ClassBody[?Yield]opt } + // [+GeneratorParameter] ClassHeritageopt { ClassBodyopt } node.members = inGeneratorParameterContext() ? doOutsideOfYieldContext(parseClassMembers) : parseClassMembers(); - parseExpected(15); + parseExpected(15 /* CloseBraceToken */); } else { node.members = createMissingList(); @@ -8444,37 +9627,37 @@ var ts; return undefined; } function parseHeritageClausesWorker() { - return parseList(19, false, parseHeritageClause); + return parseList(19 /* HeritageClauses */, false, parseHeritageClause); } function parseHeritageClause() { - if (token === 79 || token === 103) { - var node = createNode(222); + if (token === 79 /* ExtendsKeyword */ || token === 102 /* ImplementsKeyword */) { + var node = createNode(222 /* HeritageClause */); node.token = token; nextToken(); - node.types = parseDelimitedList(8, parseHeritageClauseElement); + node.types = parseDelimitedList(8 /* HeritageClauseElement */, parseHeritageClauseElement); return finishNode(node); } return undefined; } function parseHeritageClauseElement() { - var node = createNode(177); + var node = createNode(177 /* HeritageClauseElement */); node.expression = parseLeftHandSideExpressionOrHigher(); - if (token === 24) { - node.typeArguments = parseBracketedList(17, parseType, 24, 25); + if (token === 24 /* LessThanToken */) { + node.typeArguments = parseBracketedList(17 /* TypeArguments */, parseType, 24 /* LessThanToken */, 25 /* GreaterThanToken */); } return finishNode(node); } function isHeritageClause() { - return token === 79 || token === 103; + return token === 79 /* ExtendsKeyword */ || token === 102 /* ImplementsKeyword */; } function parseClassMembers() { - return parseList(6, false, parseClassElement); + return parseList(6 /* ClassMembers */, false, parseClassElement); } function parseInterfaceDeclaration(fullStart, decorators, modifiers) { - var node = createNode(202, fullStart); + var node = createNode(202 /* InterfaceDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(104); + parseExpected(103 /* InterfaceKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); node.heritageClauses = parseHeritageClauses(false); @@ -8482,31 +9665,35 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(fullStart, decorators, modifiers) { - var node = createNode(203, fullStart); + var node = createNode(203 /* TypeAliasDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(123); + parseExpected(123 /* TypeKeyword */); node.name = parseIdentifier(); - parseExpected(53); + parseExpected(53 /* EqualsToken */); node.type = parseType(); parseSemicolon(); return finishNode(node); } + // In an ambient declaration, the grammar only allows integer literals as initializers. + // In a non-ambient declaration, the grammar allows uninitialized members only in a + // ConstantEnumMemberSection, which starts at the beginning of an enum declaration + // or any time an integer literal initializer is encountered. function parseEnumMember() { - var node = createNode(226, scanner.getStartPos()); + var node = createNode(226 /* EnumMember */, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return finishNode(node); } function parseEnumDeclaration(fullStart, decorators, modifiers) { - var node = createNode(204, fullStart); + var node = createNode(204 /* EnumDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(77); + parseExpected(77 /* EnumKeyword */); node.name = parseIdentifier(); - if (parseExpected(14)) { - node.members = parseDelimitedList(7, parseEnumMember); - parseExpected(15); + if (parseExpected(14 /* OpenBraceToken */)) { + node.members = parseDelimitedList(7 /* EnumMembers */, parseEnumMember); + parseExpected(15 /* CloseBraceToken */); } else { node.members = createMissingList(); @@ -8514,10 +9701,10 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(206, scanner.getStartPos()); - if (parseExpected(14)) { - node.statements = parseList(1, false, parseModuleElement); - parseExpected(15); + var node = createNode(206 /* ModuleBlock */, scanner.getStartPos()); + if (parseExpected(14 /* OpenBraceToken */)) { + node.statements = parseList(1 /* ModuleElements */, false, parseModuleElement); + parseExpected(15 /* CloseBraceToken */); } else { node.statements = createMissingList(); @@ -8525,18 +9712,18 @@ var ts; return finishNode(node); } function parseInternalModuleTail(fullStart, decorators, modifiers, flags) { - var node = createNode(205, fullStart); + var node = createNode(205 /* ModuleDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.flags |= flags; node.name = parseIdentifier(); - node.body = parseOptional(20) - ? parseInternalModuleTail(getNodePos(), undefined, undefined, 1) + node.body = parseOptional(20 /* DotToken */) + ? parseInternalModuleTail(getNodePos(), undefined, undefined, 1 /* Export */) : parseModuleBlock(); return finishNode(node); } function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) { - var node = createNode(205, fullStart); + var node = createNode(205 /* ModuleDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.name = parseLiteralNode(true); @@ -8544,48 +9731,55 @@ var ts; return finishNode(node); } function parseModuleDeclaration(fullStart, decorators, modifiers) { - parseExpected(117); - return token === 8 + parseExpected(117 /* ModuleKeyword */); + return token === 8 /* StringLiteral */ ? parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) : parseInternalModuleTail(fullStart, decorators, modifiers, modifiers ? modifiers.flags : 0); } function isExternalModuleReference() { - return token === 118 && + return token === 118 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { - return nextToken() === 16; + return nextToken() === 16 /* OpenParenToken */; } function nextTokenIsCommaOrFromKeyword() { nextToken(); - return token === 23 || - token === 124; + return token === 23 /* CommaToken */ || + token === 124 /* FromKeyword */; } function parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers) { - parseExpected(85); + parseExpected(85 /* ImportKeyword */); var afterImportPos = scanner.getStartPos(); var identifier; if (isIdentifier()) { identifier = parseIdentifier(); - if (token !== 23 && token !== 124) { - var importEqualsDeclaration = createNode(208, fullStart); + if (token !== 23 /* CommaToken */ && token !== 124 /* FromKeyword */) { + // ImportEquals declaration of type: + // import x = require("mod"); or + // import x = M.x; + var importEqualsDeclaration = createNode(208 /* ImportEqualsDeclaration */, fullStart); importEqualsDeclaration.decorators = decorators; setModifiers(importEqualsDeclaration, modifiers); importEqualsDeclaration.name = identifier; - parseExpected(53); + parseExpected(53 /* EqualsToken */); importEqualsDeclaration.moduleReference = parseModuleReference(); parseSemicolon(); return finishNode(importEqualsDeclaration); } } - var importDeclaration = createNode(209, fullStart); + // Import statement + var importDeclaration = createNode(209 /* ImportDeclaration */, fullStart); importDeclaration.decorators = decorators; setModifiers(importDeclaration, modifiers); + // ImportDeclaration: + // import ImportClause from ModuleSpecifier ; + // import ModuleSpecifier; if (identifier || - token === 35 || - token === 14) { + token === 35 /* AsteriskToken */ || + token === 14 /* OpenBraceToken */) { importDeclaration.importClause = parseImportClause(identifier, afterImportPos); - parseExpected(124); + parseExpected(124 /* FromKeyword */); } importDeclaration.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); @@ -8598,13 +9792,17 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(210, fullStart); + var importClause = createNode(210 /* ImportClause */, fullStart); if (identifier) { + // ImportedDefaultBinding: + // ImportedBinding importClause.name = identifier; } + // If there was no default import or if there is comma token after default import + // parse namespace or named imports if (!importClause.name || - parseOptional(23)) { - importClause.namedBindings = token === 35 ? parseNamespaceImport() : parseNamedImportsOrExports(212); + parseOptional(23 /* CommaToken */)) { + importClause.namedBindings = token === 35 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(212 /* NamedImports */); } return finishNode(importClause); } @@ -8614,47 +9812,67 @@ var ts; : parseEntityName(false); } function parseExternalModuleReference() { - var node = createNode(219); - parseExpected(118); - parseExpected(16); + var node = createNode(219 /* ExternalModuleReference */); + parseExpected(118 /* RequireKeyword */); + parseExpected(16 /* OpenParenToken */); node.expression = parseModuleSpecifier(); - parseExpected(17); + parseExpected(17 /* CloseParenToken */); return finishNode(node); } function parseModuleSpecifier() { + // We allow arbitrary expressions here, even though the grammar only allows string + // literals. We check to ensure that it is only a string literal later in the grammar + // walker. var result = parseExpression(); - if (result.kind === 8) { + // Ensure the string being required is in our 'identifier' table. This will ensure + // that features like 'find refs' will look inside this file when search for its name. + if (result.kind === 8 /* StringLiteral */) { internIdentifier(result.text); } return result; } function parseNamespaceImport() { - var namespaceImport = createNode(211); - parseExpected(35); - parseExpected(102); + // NameSpaceImport: + // * as ImportedBinding + var namespaceImport = createNode(211 /* NamespaceImport */); + parseExpected(35 /* AsteriskToken */); + parseExpected(111 /* AsKeyword */); namespaceImport.name = parseIdentifier(); return finishNode(namespaceImport); } function parseNamedImportsOrExports(kind) { var node = createNode(kind); - node.elements = parseBracketedList(20, kind === 212 ? parseImportSpecifier : parseExportSpecifier, 14, 15); + // NamedImports: + // { } + // { ImportsList } + // { ImportsList, } + // ImportsList: + // ImportSpecifier + // ImportsList, ImportSpecifier + node.elements = parseBracketedList(20 /* ImportOrExportSpecifiers */, kind === 212 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 14 /* OpenBraceToken */, 15 /* CloseBraceToken */); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(217); + return parseImportOrExportSpecifier(217 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(213); + return parseImportOrExportSpecifier(213 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); + // ImportSpecifier: + // BindingIdentifier + // IdentifierName as BindingIdentifier + // ExportSpecififer: + // IdentifierName + // IdentifierName as IdentifierName var checkIdentifierIsKeyword = ts.isKeyword(token) && !isIdentifier(); var checkIdentifierStart = scanner.getTokenPos(); var checkIdentifierEnd = scanner.getTextPos(); var identifierName = parseIdentifierName(); - if (token === 102) { + if (token === 111 /* AsKeyword */) { node.propertyName = identifierName; - parseExpected(102); + parseExpected(111 /* AsKeyword */); checkIdentifierIsKeyword = ts.isKeyword(token) && !isIdentifier(); checkIdentifierStart = scanner.getTokenPos(); checkIdentifierEnd = scanner.getTextPos(); @@ -8663,22 +9881,23 @@ var ts; else { node.name = identifierName; } - if (kind === 213 && checkIdentifierIsKeyword) { + if (kind === 213 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + // Report error identifier expected parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseExportDeclaration(fullStart, decorators, modifiers) { - var node = createNode(215, fullStart); + var node = createNode(215 /* ExportDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); - if (parseOptional(35)) { - parseExpected(124); + if (parseOptional(35 /* AsteriskToken */)) { + parseExpected(124 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(216); - if (parseOptional(124)) { + node.exportClause = parseNamedImportsOrExports(216 /* NamedExports */); + if (parseOptional(124 /* FromKeyword */)) { node.moduleSpecifier = parseModuleSpecifier(); } } @@ -8686,59 +9905,62 @@ var ts; return finishNode(node); } function parseExportAssignment(fullStart, decorators, modifiers) { - var node = createNode(214, fullStart); + var node = createNode(214 /* ExportAssignment */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); - if (parseOptional(53)) { + if (parseOptional(53 /* EqualsToken */)) { node.isExportEquals = true; - node.expression = parseAssignmentExpressionOrHigher(); } else { - parseExpected(73); - if (parseOptional(51)) { - node.type = parseType(); - } - else { - node.expression = parseAssignmentExpressionOrHigher(); - } + parseExpected(73 /* DefaultKeyword */); } + node.expression = parseAssignmentExpressionOrHigher(); parseSemicolon(); return finishNode(node); } function isLetDeclaration() { + // It is let declaration if in strict mode or next token is identifier\open bracket\open curly on same line. + // otherwise it needs to be treated like identifier return inStrictModeContext() || lookAhead(nextTokenIsIdentifierOrStartOfDestructuringOnTheSameLine); } function isDeclarationStart(followsModifier) { switch (token) { - case 98: - case 70: - case 83: + case 98 /* VarKeyword */: + case 70 /* ConstKeyword */: + case 83 /* FunctionKeyword */: return true; - case 105: + case 104 /* LetKeyword */: return isLetDeclaration(); - case 69: - case 104: - case 77: - case 123: + case 69 /* ClassKeyword */: + case 103 /* InterfaceKeyword */: + case 77 /* EnumKeyword */: + case 123 /* TypeKeyword */: + // Not true keywords so ensure an identifier follows return lookAhead(nextTokenIsIdentifierOrKeyword); - case 85: + case 85 /* ImportKeyword */: + // Not true keywords so ensure an identifier follows or is string literal or asterisk or open brace return lookAhead(nextTokenCanFollowImportKeyword); - case 117: + case 117 /* ModuleKeyword */: + // Not a true keyword so ensure an identifier or string literal follows return lookAhead(nextTokenIsIdentifierOrKeywordOrStringLiteral); - case 78: + case 78 /* ExportKeyword */: + // Check for export assignment or modifier on source element return lookAhead(nextTokenCanFollowExportKeyword); - case 115: - case 109: - case 107: - case 108: - case 110: + case 115 /* DeclareKeyword */: + case 108 /* PublicKeyword */: + case 106 /* PrivateKeyword */: + case 107 /* ProtectedKeyword */: + case 109 /* StaticKeyword */: + // Check for modifier on source element return lookAhead(nextTokenIsDeclarationStart); - case 52: + case 52 /* AtToken */: + // a lookahead here is too costly, and decorators are only valid on a declaration. + // We will assume we are parsing a declaration here and report an error later return !followsModifier; } } function isIdentifierOrKeyword() { - return token >= 65; + return token >= 65 /* Identifier */; } function nextTokenIsIdentifierOrKeyword() { nextToken(); @@ -8746,60 +9968,62 @@ var ts; } function nextTokenIsIdentifierOrKeywordOrStringLiteral() { nextToken(); - return isIdentifierOrKeyword() || token === 8; + return isIdentifierOrKeyword() || token === 8 /* StringLiteral */; } function nextTokenCanFollowImportKeyword() { nextToken(); - return isIdentifierOrKeyword() || token === 8 || - token === 35 || token === 14; + return isIdentifierOrKeyword() || token === 8 /* StringLiteral */ || + token === 35 /* AsteriskToken */ || token === 14 /* OpenBraceToken */; } function nextTokenCanFollowExportKeyword() { nextToken(); - return token === 53 || token === 35 || - token === 14 || token === 73 || isDeclarationStart(true); + return token === 53 /* EqualsToken */ || token === 35 /* AsteriskToken */ || + token === 14 /* OpenBraceToken */ || token === 73 /* DefaultKeyword */ || isDeclarationStart(true); } function nextTokenIsDeclarationStart() { nextToken(); return isDeclarationStart(true); } function nextTokenIsAsKeyword() { - return nextToken() === 102; + return nextToken() === 111 /* AsKeyword */; } function parseDeclaration() { var fullStart = getNodePos(); var decorators = parseDecorators(); var modifiers = parseModifiers(); - if (token === 78) { + if (token === 78 /* ExportKeyword */) { nextToken(); - if (token === 73 || token === 53) { + if (token === 73 /* DefaultKeyword */ || token === 53 /* EqualsToken */) { return parseExportAssignment(fullStart, decorators, modifiers); } - if (token === 35 || token === 14) { + if (token === 35 /* AsteriskToken */ || token === 14 /* OpenBraceToken */) { return parseExportDeclaration(fullStart, decorators, modifiers); } } switch (token) { - case 98: - case 105: - case 70: + case 98 /* VarKeyword */: + case 104 /* LetKeyword */: + case 70 /* ConstKeyword */: return parseVariableStatement(fullStart, decorators, modifiers); - case 83: + case 83 /* FunctionKeyword */: return parseFunctionDeclaration(fullStart, decorators, modifiers); - case 69: + case 69 /* ClassKeyword */: return parseClassDeclaration(fullStart, decorators, modifiers); - case 104: + case 103 /* InterfaceKeyword */: return parseInterfaceDeclaration(fullStart, decorators, modifiers); - case 123: + case 123 /* TypeKeyword */: return parseTypeAliasDeclaration(fullStart, decorators, modifiers); - case 77: + case 77 /* EnumKeyword */: return parseEnumDeclaration(fullStart, decorators, modifiers); - case 117: + case 117 /* ModuleKeyword */: return parseModuleDeclaration(fullStart, decorators, modifiers); - case 85: + case 85 /* ImportKeyword */: return parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers); default: if (decorators) { - var node = createMissingNode(218, true, ts.Diagnostics.Declaration_expected); + // We reached this point because we encountered an AtToken and assumed a declaration would + // follow. For recovery and error reporting purposes, return an incomplete declaration. + var node = createMissingNode(218 /* MissingDeclaration */, true, ts.Diagnostics.Declaration_expected); node.pos = fullStart; node.decorators = decorators; setModifiers(node, modifiers); @@ -8827,15 +10051,18 @@ var ts; var referencedFiles = []; var amdDependencies = []; var amdModuleName; + // Keep scanning all the leading trivia in the file until we get to something that + // isn't trivia. Any single line comment will be analyzed to see if it is a + // reference comment. while (true) { var kind = triviaScanner.scan(); - if (kind === 5 || kind === 4 || kind === 3) { + if (kind === 5 /* WhitespaceTrivia */ || kind === 4 /* NewLineTrivia */ || kind === 3 /* MultiLineCommentTrivia */) { continue; } - if (kind !== 2) { + if (kind !== 2 /* SingleLineCommentTrivia */) { break; } - var range = { pos: triviaScanner.getTokenPos(), end: triviaScanner.getTextPos() }; + var range = { pos: triviaScanner.getTokenPos(), end: triviaScanner.getTextPos(), kind: triviaScanner.getToken() }; var comment = sourceText.substring(range.pos, range.end); var referencePathMatchResult = ts.getFileReferenceFromReferencePath(comment, range); if (referencePathMatchResult) { @@ -8878,52 +10105,515 @@ var ts; } function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { - return node.flags & 1 - || node.kind === 208 && node.moduleReference.kind === 219 - || node.kind === 209 - || node.kind === 214 - || node.kind === 215 + return node.flags & 1 /* Export */ + || node.kind === 208 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 219 /* ExternalModuleReference */ + || node.kind === 209 /* ImportDeclaration */ + || node.kind === 214 /* ExportAssignment */ + || node.kind === 215 /* ExportDeclaration */ ? node : undefined; }); } - } - function isLeftHandSideExpression(expr) { - if (expr) { - switch (expr.kind) { - case 155: - case 156: - case 158: - case 157: - case 159: - case 153: - case 161: - case 154: - case 174: - case 162: - case 65: - case 9: - case 7: - case 8: - case 10: - case 171: - case 80: - case 89: - case 93: - case 95: - case 91: - return true; + var ParsingContext; + (function (ParsingContext) { + ParsingContext[ParsingContext["SourceElements"] = 0] = "SourceElements"; + ParsingContext[ParsingContext["ModuleElements"] = 1] = "ModuleElements"; + ParsingContext[ParsingContext["BlockStatements"] = 2] = "BlockStatements"; + ParsingContext[ParsingContext["SwitchClauses"] = 3] = "SwitchClauses"; + ParsingContext[ParsingContext["SwitchClauseStatements"] = 4] = "SwitchClauseStatements"; + ParsingContext[ParsingContext["TypeMembers"] = 5] = "TypeMembers"; + ParsingContext[ParsingContext["ClassMembers"] = 6] = "ClassMembers"; + ParsingContext[ParsingContext["EnumMembers"] = 7] = "EnumMembers"; + ParsingContext[ParsingContext["HeritageClauseElement"] = 8] = "HeritageClauseElement"; + ParsingContext[ParsingContext["VariableDeclarations"] = 9] = "VariableDeclarations"; + ParsingContext[ParsingContext["ObjectBindingElements"] = 10] = "ObjectBindingElements"; + ParsingContext[ParsingContext["ArrayBindingElements"] = 11] = "ArrayBindingElements"; + ParsingContext[ParsingContext["ArgumentExpressions"] = 12] = "ArgumentExpressions"; + ParsingContext[ParsingContext["ObjectLiteralMembers"] = 13] = "ObjectLiteralMembers"; + ParsingContext[ParsingContext["ArrayLiteralMembers"] = 14] = "ArrayLiteralMembers"; + ParsingContext[ParsingContext["Parameters"] = 15] = "Parameters"; + ParsingContext[ParsingContext["TypeParameters"] = 16] = "TypeParameters"; + ParsingContext[ParsingContext["TypeArguments"] = 17] = "TypeArguments"; + ParsingContext[ParsingContext["TupleElementTypes"] = 18] = "TupleElementTypes"; + ParsingContext[ParsingContext["HeritageClauses"] = 19] = "HeritageClauses"; + ParsingContext[ParsingContext["ImportOrExportSpecifiers"] = 20] = "ImportOrExportSpecifiers"; + ParsingContext[ParsingContext["Count"] = 21] = "Count"; // Number of parsing contexts + })(ParsingContext || (ParsingContext = {})); + var Tristate; + (function (Tristate) { + Tristate[Tristate["False"] = 0] = "False"; + Tristate[Tristate["True"] = 1] = "True"; + Tristate[Tristate["Unknown"] = 2] = "Unknown"; + })(Tristate || (Tristate = {})); + })(Parser || (Parser = {})); + var IncrementalParser; + (function (IncrementalParser) { + function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks) { + aggressiveChecks = aggressiveChecks || ts.Debug.shouldAssert(2 /* Aggressive */); + checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks); + if (ts.textChangeRangeIsUnchanged(textChangeRange)) { + // if the text didn't change, then we can just return our current source file as-is. + return sourceFile; + } + if (sourceFile.statements.length === 0) { + // If we don't have any statements in the current source file, then there's no real + // way to incrementally parse. So just do a full parse instead. + return Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, undefined, true); + } + // Make sure we're not trying to incrementally update a source file more than once. Once + // we do an update the original source file is considered unusbale from that point onwards. + // + // This is because we do incremental parsing in-place. i.e. we take nodes from the old + // tree and give them new positions and parents. From that point on, trusting the old + // tree at all is not possible as far too much of it may violate invariants. + var incrementalSourceFile = sourceFile; + ts.Debug.assert(!incrementalSourceFile.hasBeenIncrementallyParsed); + incrementalSourceFile.hasBeenIncrementallyParsed = true; + var oldText = sourceFile.text; + var syntaxCursor = createSyntaxCursor(sourceFile); + // Make the actual change larger so that we know to reparse anything whose lookahead + // might have intersected the change. + var changeRange = extendToAffectedRange(sourceFile, textChangeRange); + checkChangeRange(sourceFile, newText, changeRange, aggressiveChecks); + // Ensure that extending the affected range only moved the start of the change range + // earlier in the file. + ts.Debug.assert(changeRange.span.start <= textChangeRange.span.start); + ts.Debug.assert(ts.textSpanEnd(changeRange.span) === ts.textSpanEnd(textChangeRange.span)); + ts.Debug.assert(ts.textSpanEnd(ts.textChangeRangeNewSpan(changeRange)) === ts.textSpanEnd(ts.textChangeRangeNewSpan(textChangeRange))); + // The is the amount the nodes after the edit range need to be adjusted. It can be + // positive (if the edit added characters), negative (if the edit deleted characters) + // or zero (if this was a pure overwrite with nothing added/removed). + var delta = ts.textChangeRangeNewSpan(changeRange).length - changeRange.span.length; + // If we added or removed characters during the edit, then we need to go and adjust all + // the nodes after the edit. Those nodes may move forward (if we inserted chars) or they + // may move backward (if we deleted chars). + // + // Doing this helps us out in two ways. First, it means that any nodes/tokens we want + // 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 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 + // + // We will also adjust the positions of nodes that intersect the change range as well. + // By doing this, we ensure that all the positions in the old tree are consistent, not + // just the positions of nodes entirely before/after the change range. By being + // consistent, we can then easily map from positions to nodes in the old tree easily. + // + // Also, mark any syntax elements that intersect the changed span. We know, up front, + // that we cannot reuse these elements. + updateTokenPositionsAndMarkElements(incrementalSourceFile, changeRange.span.start, ts.textSpanEnd(changeRange.span), ts.textSpanEnd(ts.textChangeRangeNewSpan(changeRange)), delta, oldText, newText, aggressiveChecks); + // Now that we've set up our internal incremental state just proceed and parse the + // source file in the normal fashion. When possible the parser will retrieve and + // reuse nodes from the old tree. + // + // Note: passing in 'true' for setNodeParents is very important. When incrementally + // parsing, we will be reusing nodes from the old tree, and placing it into new + // parents. If we don't set the parents now, we'll end up with an observably + // inconsistent tree. Setting the parents on the new tree should be very fast. We + // will immediately bail out of walking any subtrees when we can see that their parents + // are already correct. + var result = Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, true); + return result; + } + IncrementalParser.updateSourceFile = updateSourceFile; + function moveElementEntirelyPastChangeRange(element, isArray, delta, oldText, newText, aggressiveChecks) { + if (isArray) { + visitArray(element); + } + else { + visitNode(element); + } + return; + function visitNode(node) { + if (aggressiveChecks && shouldCheckNode(node)) { + var text = oldText.substring(node.pos, node.end); + } + // Ditch any existing LS children we may have created. This way we can avoid + // moving them forward. + node._children = undefined; + node.pos += delta; + node.end += delta; + if (aggressiveChecks && shouldCheckNode(node)) { + ts.Debug.assert(text === newText.substring(node.pos, node.end)); + } + forEachChild(node, visitNode, visitArray); + checkNodePositions(node, aggressiveChecks); + } + function visitArray(array) { + array._children = undefined; + array.pos += delta; + array.end += delta; + for (var _i = 0; _i < array.length; _i++) { + var node = array[_i]; + visitNode(node); + } } } - return false; - } - ts.isLeftHandSideExpression = isLeftHandSideExpression; - function isAssignmentOperator(token) { - return token >= 53 && token <= 64; - } - ts.isAssignmentOperator = isAssignmentOperator; + function shouldCheckNode(node) { + switch (node.kind) { + case 8 /* StringLiteral */: + case 7 /* NumericLiteral */: + case 65 /* Identifier */: + return true; + } + return false; + } + function adjustIntersectingElement(element, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta) { + ts.Debug.assert(element.end >= changeStart, "Adjusting an element that was entirely before the change range"); + ts.Debug.assert(element.pos <= changeRangeOldEnd, "Adjusting an element that was entirely after the change range"); + ts.Debug.assert(element.pos <= element.end); + // We have an element that intersects the change range in some way. It may have its + // start, or its end (or both) in the changed range. We want to adjust any part + // that intersects such that the final tree is in a consistent state. i.e. all + // chlidren have spans within the span of their parent, and all siblings are ordered + // properly. + // We may need to update both the 'pos' and the 'end' of the element. + // If the 'pos' is before the start of the change, then we don't need to touch it. + // If it isn't, then the 'pos' must be inside the change. How we update it will + // depend if delta is positive or negative. If delta is positive then we have + // something like: + // + // -------------------AAA----------------- + // -------------------BBBCCCCCCC----------------- + // + // In this case, we consider any node that started in the change range to still be + // starting at the same position. + // + // however, if the delta is negative, then we instead have something like this: + // + // -------------------XXXYYYYYYY----------------- + // -------------------ZZZ----------------- + // + // In this case, any element that started in the 'X' range will keep its position. + // However any element htat started after that will have their pos adjusted to be + // at the end of the new range. i.e. any node that started in the 'Y' range will + // be adjusted to have their start at the end of the 'Z' range. + // + // The element will keep its position if possible. Or Move backward to the new-end + // if it's in the 'Y' range. + element.pos = Math.min(element.pos, changeRangeNewEnd); + // If the 'end' is after the change range, then we always adjust it by the delta + // amount. However, if the end is in the change range, then how we adjust it + // will depend on if delta is positive or negative. If delta is positive then we + // have something like: + // + // -------------------AAA----------------- + // -------------------BBBCCCCCCC----------------- + // + // In this case, we consider any node that ended inside the change range to keep its + // end position. + // + // however, if the delta is negative, then we instead have something like this: + // + // -------------------XXXYYYYYYY----------------- + // -------------------ZZZ----------------- + // + // In this case, any element that ended in the 'X' range will keep its position. + // However any element htat ended after that will have their pos adjusted to be + // at the end of the new range. i.e. any node that ended in the 'Y' range will + // be adjusted to have their end at the end of the 'Z' range. + if (element.end >= changeRangeOldEnd) { + // Element ends after the change range. Always adjust the end pos. + element.end += delta; + } + else { + // Element ends in the change range. The element will keep its position if + // possible. Or Move backward to the new-end if it's in the 'Y' range. + element.end = Math.min(element.end, changeRangeNewEnd); + } + ts.Debug.assert(element.pos <= element.end); + if (element.parent) { + ts.Debug.assert(element.pos >= element.parent.pos); + ts.Debug.assert(element.end <= element.parent.end); + } + } + function checkNodePositions(node, aggressiveChecks) { + if (aggressiveChecks) { + var pos = node.pos; + forEachChild(node, function (child) { + ts.Debug.assert(child.pos >= pos); + pos = child.end; + }); + ts.Debug.assert(pos <= node.end); + } + } + function updateTokenPositionsAndMarkElements(sourceFile, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta, oldText, newText, aggressiveChecks) { + visitNode(sourceFile); + return; + function visitNode(child) { + ts.Debug.assert(child.pos <= child.end); + if (child.pos > changeRangeOldEnd) { + // Node is entirely past the change range. We need to move both its pos and + // end, forward or backward appropriately. + moveElementEntirelyPastChangeRange(child, false, delta, oldText, newText, aggressiveChecks); + return; + } + // Check if the element intersects the change range. If it does, then it is not + // reusable. Also, we'll need to recurse to see what constituent portions we may + // be able to use. + var fullEnd = child.end; + if (fullEnd >= changeStart) { + child.intersectsChange = true; + child._children = undefined; + // Adjust the pos or end (or both) of the intersecting element accordingly. + adjustIntersectingElement(child, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); + forEachChild(child, visitNode, visitArray); + checkNodePositions(child, aggressiveChecks); + return; + } + // Otherwise, the node is entirely before the change range. No need to do anything with it. + ts.Debug.assert(fullEnd < changeStart); + } + function visitArray(array) { + ts.Debug.assert(array.pos <= array.end); + if (array.pos > changeRangeOldEnd) { + // Array is entirely after the change range. We need to move it, and move any of + // its children. + moveElementEntirelyPastChangeRange(array, true, delta, oldText, newText, aggressiveChecks); + return; + } + // Check if the element intersects the change range. If it does, then it is not + // reusable. Also, we'll need to recurse to see what constituent portions we may + // be able to use. + var fullEnd = array.end; + if (fullEnd >= changeStart) { + array.intersectsChange = true; + array._children = undefined; + // Adjust the pos or end (or both) of the intersecting array accordingly. + adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); + for (var _i = 0; _i < array.length; _i++) { + var node = array[_i]; + visitNode(node); + } + return; + } + // Otherwise, the array is entirely before the change range. No need to do anything with it. + ts.Debug.assert(fullEnd < changeStart); + } + } + function extendToAffectedRange(sourceFile, changeRange) { + // Consider the following code: + // void foo() { /; } + // + // If the text changes with an insertion of / just before the semicolon then we end up with: + // void foo() { //; } + // + // If we were to just use the changeRange a is, then we would not rescan the { token + // (as it does not intersect the actual original change range). Because an edit may + // change the token touching it, we actually need to look back *at least* one token so + // that the prior token sees that change. + var maxLookahead = 1; + var start = changeRange.span.start; + // the first iteration aligns us with the change start. subsequent iteration move us to + // the left by maxLookahead tokens. We only need to do this as long as we're not at the + // start of the tree. + for (var i = 0; start > 0 && i <= maxLookahead; i++) { + var nearestNode = findNearestNodeStartingBeforeOrAtPosition(sourceFile, start); + ts.Debug.assert(nearestNode.pos <= start); + var position = nearestNode.pos; + start = Math.max(0, position - 1); + } + var finalSpan = ts.createTextSpanFromBounds(start, ts.textSpanEnd(changeRange.span)); + var finalLength = changeRange.newLength + (changeRange.span.start - start); + return ts.createTextChangeRange(finalSpan, finalLength); + } + function findNearestNodeStartingBeforeOrAtPosition(sourceFile, position) { + var bestResult = sourceFile; + var lastNodeEntirelyBeforePosition; + forEachChild(sourceFile, visit); + if (lastNodeEntirelyBeforePosition) { + var lastChildOfLastEntireNodeBeforePosition = getLastChild(lastNodeEntirelyBeforePosition); + if (lastChildOfLastEntireNodeBeforePosition.pos > bestResult.pos) { + bestResult = lastChildOfLastEntireNodeBeforePosition; + } + } + return bestResult; + function getLastChild(node) { + while (true) { + var lastChild = getLastChildWorker(node); + if (lastChild) { + node = lastChild; + } + else { + return node; + } + } + } + function getLastChildWorker(node) { + var last = undefined; + forEachChild(node, function (child) { + if (ts.nodeIsPresent(child)) { + last = child; + } + }); + return last; + } + function visit(child) { + if (ts.nodeIsMissing(child)) { + // Missing nodes are effectively invisible to us. We never even consider them + // When trying to find the nearest node before us. + return; + } + // If the child intersects this position, then this node is currently the nearest + // node that starts before the position. + if (child.pos <= position) { + if (child.pos >= bestResult.pos) { + // This node starts before the position, and is closer to the position than + // the previous best node we found. It is now the new best node. + bestResult = child; + } + // Now, the node may overlap the position, or it may end entirely before the + // position. If it overlaps with the position, then either it, or one of its + // children must be the nearest node before the position. So we can just + // recurse into this child to see if we can find something better. + if (position < child.end) { + // The nearest node is either this child, or one of the children inside + // of it. We've already marked this child as the best so far. Recurse + // in case one of the children is better. + forEachChild(child, visit); + // Once we look at the children of this node, then there's no need to + // continue any further. + return true; + } + else { + ts.Debug.assert(child.end <= position); + // The child ends entirely before this position. Say you have the following + // (where $ is the position) + // + // ? $ : <...> <...> + // + // We would want to find the nearest preceding node in "complex expr 2". + // To support that, we keep track of this node, and once we're done searching + // for a best node, we recurse down this node to see if we can find a good + // result in it. + // + // This approach allows us to quickly skip over nodes that are entirely + // before the position, while still allowing us to find any nodes in the + // last one that might be what we want. + lastNodeEntirelyBeforePosition = child; + } + } + else { + ts.Debug.assert(child.pos > position); + // We're now at a node that is entirely past the position we're searching for. + // This node (and all following nodes) could never contribute to the result, + // so just skip them by returning 'true' here. + return true; + } + } + } + function checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks) { + var oldText = sourceFile.text; + if (textChangeRange) { + ts.Debug.assert((oldText.length - textChangeRange.span.length + textChangeRange.newLength) === newText.length); + if (aggressiveChecks || ts.Debug.shouldAssert(3 /* VeryAggressive */)) { + var oldTextPrefix = oldText.substr(0, textChangeRange.span.start); + var newTextPrefix = newText.substr(0, textChangeRange.span.start); + ts.Debug.assert(oldTextPrefix === newTextPrefix); + var oldTextSuffix = oldText.substring(ts.textSpanEnd(textChangeRange.span), oldText.length); + var newTextSuffix = newText.substring(ts.textSpanEnd(ts.textChangeRangeNewSpan(textChangeRange)), newText.length); + ts.Debug.assert(oldTextSuffix === newTextSuffix); + } + } + } + function createSyntaxCursor(sourceFile) { + var currentArray = sourceFile.statements; + var currentArrayIndex = 0; + ts.Debug.assert(currentArrayIndex < currentArray.length); + var current = currentArray[currentArrayIndex]; + var lastQueriedPosition = -1 /* Value */; + return { + currentNode: function (position) { + // Only compute the current node if the position is different than the last time + // we were asked. The parser commonly asks for the node at the same position + // twice. Once to know if can read an appropriate list element at a certain point, + // and then to actually read and consume the node. + if (position !== lastQueriedPosition) { + // Much of the time the parser will need the very next node in the array that + // we just returned a node from.So just simply check for that case and move + // forward in the array instead of searching for the node again. + if (current && current.end === position && currentArrayIndex < (currentArray.length - 1)) { + currentArrayIndex++; + current = currentArray[currentArrayIndex]; + } + // If we don't have a node, or the node we have isn't in the right position, + // then try to find a viable node at the position requested. + if (!current || current.pos !== position) { + findHighestListElementThatStartsAtPosition(position); + } + } + // Cache this query so that we don't do any extra work if the parser calls back + // into us. Note: this is very common as the parser will make pairs of calls like + // 'isListElement -> parseListElement'. If we were unable to find a node when + // called with 'isListElement', we don't want to redo the work when parseListElement + // is called immediately after. + lastQueriedPosition = position; + // Either we don'd have a node, or we have a node at the position being asked for. + ts.Debug.assert(!current || current.pos === position); + return current; + } + }; + // Finds the highest element in the tree we can find that starts at the provided position. + // The element must be a direct child of some node list in the tree. This way after we + // return it, we can easily return its next sibling in the list. + function findHighestListElementThatStartsAtPosition(position) { + // Clear out any cached state about the last node we found. + currentArray = undefined; + currentArrayIndex = -1 /* Value */; + current = undefined; + // Recurse into the source file to find the highest node at this position. + forEachChild(sourceFile, visitNode, visitArray); + return; + function visitNode(node) { + if (position >= node.pos && position < node.end) { + // Position was within this node. Keep searching deeper to find the node. + forEachChild(node, visitNode, visitArray); + // don't procede any futher in the search. + return true; + } + // position wasn't in this node, have to keep searching. + return false; + } + function visitArray(array) { + if (position >= array.pos && position < array.end) { + // position was in this array. Search through this array to see if we find a + // viable element. + for (var i = 0, n = array.length; i < n; i++) { + var child = array[i]; + if (child) { + if (child.pos === position) { + // Found the right node. We're done. + currentArray = array; + currentArrayIndex = i; + current = child; + return true; + } + else { + if (child.pos < position && position < child.end) { + // Position in somewhere within this child. Search in it and + // stop searching in this array. + forEachChild(child, visitNode, visitArray); + return true; + } + } + } + } + } + // position wasn't in this array, have to keep searching. + return false; + } + } + } + var InvalidPosition; + (function (InvalidPosition) { + InvalidPosition[InvalidPosition["Value"] = -1] = "Value"; + })(InvalidPosition || (InvalidPosition = {})); + })(IncrementalParser || (IncrementalParser = {})); })(ts || (ts = {})); /// +/* @internal */ var ts; (function (ts) { var nextSymbolId = 1; @@ -8951,10 +10641,10 @@ var ts; var emptyArray = []; var emptySymbols = {}; var compilerOptions = host.getCompilerOptions(); - var languageVersion = compilerOptions.target || 0; + var languageVersion = compilerOptions.target || 0 /* ES3 */; var emitResolver = createResolver(); - var undefinedSymbol = createSymbol(4 | 67108864, "undefined"); - var argumentsSymbol = createSymbol(4 | 67108864, "arguments"); + var undefinedSymbol = createSymbol(4 /* Property */ | 67108864 /* Transient */, "undefined"); + var argumentsSymbol = createSymbol(4 /* Property */ | 67108864 /* Transient */, "arguments"); var checker = { getNodeCount: function () { return ts.sum(host.getSourceFiles(), "nodeCount"); }, getIdentifierCount: function () { return ts.sum(host.getSourceFiles(), "identifierCount"); }, @@ -8989,20 +10679,20 @@ var ts; isImplementationOfOverload: isImplementationOfOverload, getAliasedSymbol: resolveAlias, getEmitResolver: getEmitResolver, - getExportsOfExternalModule: getExportsOfExternalModule + getExportsOfModule: getExportsOfModuleAsArray }; - var unknownSymbol = createSymbol(4 | 67108864, "unknown"); - var resolvingSymbol = createSymbol(67108864, "__resolving__"); - var anyType = createIntrinsicType(1, "any"); - var stringType = createIntrinsicType(2, "string"); - var numberType = createIntrinsicType(4, "number"); - var booleanType = createIntrinsicType(8, "boolean"); - var esSymbolType = createIntrinsicType(1048576, "symbol"); - var voidType = createIntrinsicType(16, "void"); - var undefinedType = createIntrinsicType(32 | 262144, "undefined"); - var nullType = createIntrinsicType(64 | 262144, "null"); - var unknownType = createIntrinsicType(1, "unknown"); - var resolvingType = createIntrinsicType(1, "__resolving__"); + var unknownSymbol = createSymbol(4 /* Property */ | 67108864 /* Transient */, "unknown"); + var resolvingSymbol = createSymbol(67108864 /* Transient */, "__resolving__"); + var anyType = createIntrinsicType(1 /* Any */, "any"); + var stringType = createIntrinsicType(2 /* String */, "string"); + var numberType = createIntrinsicType(4 /* Number */, "number"); + var booleanType = createIntrinsicType(8 /* Boolean */, "boolean"); + var esSymbolType = createIntrinsicType(1048576 /* ESSymbol */, "symbol"); + var voidType = createIntrinsicType(16 /* Void */, "void"); + var undefinedType = createIntrinsicType(32 /* Undefined */ | 262144 /* ContainsUndefinedOrNull */, "undefined"); + var nullType = createIntrinsicType(64 /* Null */ | 262144 /* ContainsUndefinedOrNull */, "null"); + var unknownType = createIntrinsicType(1 /* Any */, "unknown"); + var resolvingType = createIntrinsicType(1 /* Any */, "__resolving__"); var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); @@ -9032,6 +10722,7 @@ var ts; var stringLiteralTypes = {}; var emitExtends = false; var emitDecorate = false; + var emitParam = false; var mergedSymbols = []; var symbolLinks = []; var nodeLinks = []; @@ -9040,22 +10731,24 @@ var ts; var primitiveTypeInfo = { "string": { type: stringType, - flags: 258 + flags: 258 /* StringLike */ }, "number": { type: numberType, - flags: 132 + flags: 132 /* NumberLike */ }, "boolean": { type: booleanType, - flags: 8 + flags: 8 /* Boolean */ }, "symbol": { type: esSymbolType, - flags: 1048576 + flags: 1048576 /* ESSymbol */ } }; function getEmitResolver(sourceFile) { + // Ensure we have all the type information in place for this file so that all the + // emitter questions of this resolver will return the right information. getDiagnostics(sourceFile); return emitResolver; } @@ -9070,38 +10763,38 @@ var ts; } function getExcludedSymbolFlags(flags) { var result = 0; - if (flags & 2) - result |= 107455; - if (flags & 1) - result |= 107454; - if (flags & 4) - result |= 107455; - if (flags & 8) - result |= 107455; - if (flags & 16) - result |= 106927; - if (flags & 32) - result |= 899583; - if (flags & 64) - result |= 792992; - if (flags & 256) - result |= 899327; - if (flags & 128) - result |= 899967; - if (flags & 512) - result |= 106639; - if (flags & 8192) - result |= 99263; - if (flags & 32768) - result |= 41919; - if (flags & 65536) - result |= 74687; - if (flags & 262144) - result |= 530912; - if (flags & 524288) - result |= 793056; - if (flags & 8388608) - result |= 8388608; + if (flags & 2 /* BlockScopedVariable */) + result |= 107455 /* BlockScopedVariableExcludes */; + if (flags & 1 /* FunctionScopedVariable */) + result |= 107454 /* FunctionScopedVariableExcludes */; + if (flags & 4 /* Property */) + result |= 107455 /* PropertyExcludes */; + if (flags & 8 /* EnumMember */) + result |= 107455 /* EnumMemberExcludes */; + if (flags & 16 /* Function */) + result |= 106927 /* FunctionExcludes */; + if (flags & 32 /* Class */) + result |= 899583 /* ClassExcludes */; + if (flags & 64 /* Interface */) + result |= 792992 /* InterfaceExcludes */; + if (flags & 256 /* RegularEnum */) + result |= 899327 /* RegularEnumExcludes */; + if (flags & 128 /* ConstEnum */) + result |= 899967 /* ConstEnumExcludes */; + if (flags & 512 /* ValueModule */) + result |= 106639 /* ValueModuleExcludes */; + if (flags & 8192 /* Method */) + result |= 99263 /* MethodExcludes */; + if (flags & 32768 /* GetAccessor */) + result |= 41919 /* GetAccessorExcludes */; + if (flags & 65536 /* SetAccessor */) + result |= 74687 /* SetAccessorExcludes */; + if (flags & 262144 /* TypeParameter */) + result |= 530912 /* TypeParameterExcludes */; + if (flags & 524288 /* TypeAlias */) + result |= 793056 /* TypeAliasExcludes */; + if (flags & 8388608 /* Alias */) + result |= 8388608 /* AliasExcludes */; return result; } function recordMergedSymbol(target, source) { @@ -9110,7 +10803,7 @@ var ts; mergedSymbols[source.mergeId] = target; } function cloneSymbol(symbol) { - var result = createSymbol(symbol.flags | 33554432, symbol.name); + var result = createSymbol(symbol.flags | 33554432 /* Merged */, symbol.name); result.declarations = symbol.declarations.slice(0); result.parent = symbol.parent; if (symbol.valueDeclaration) @@ -9126,7 +10819,8 @@ var ts; } function mergeSymbol(target, source) { if (!(target.flags & getExcludedSymbolFlags(source.flags))) { - if (source.flags & 512 && target.flags & 512 && target.constEnumOnlyModule && !source.constEnumOnlyModule) { + if (source.flags & 512 /* ValueModule */ && target.flags & 512 /* ValueModule */ && target.constEnumOnlyModule && !source.constEnumOnlyModule) { + // reset flag when merging instantiated module into value module that has only const enums target.constEnumOnlyModule = false; } target.flags |= source.flags; @@ -9148,7 +10842,7 @@ var ts; recordMergedSymbol(target, source); } else { - var message = target.flags & 2 || source.flags & 2 + var message = target.flags & 2 /* BlockScopedVariable */ || source.flags & 2 /* BlockScopedVariable */ ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(source.declarations, function (node) { error(node.name ? node.name : node, message, symbolToString(source)); @@ -9175,7 +10869,7 @@ var ts; } else { var symbol = target[id]; - if (!(symbol.flags & 33554432)) { + if (!(symbol.flags & 33554432 /* Merged */)) { target[id] = symbol = cloneSymbol(symbol); } mergeSymbol(symbol, source[id]); @@ -9184,7 +10878,7 @@ var ts; } } function getSymbolLinks(symbol) { - if (symbol.flags & 67108864) + if (symbol.flags & 67108864 /* Transient */) return symbol; var id = getSymbolId(symbol); return symbolLinks[id] || (symbolLinks[id] = {}); @@ -9194,26 +10888,29 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = {}); } function getSourceFile(node) { - return ts.getAncestor(node, 227); + return ts.getAncestor(node, 227 /* SourceFile */); } function isGlobalSourceFile(node) { - return node.kind === 227 && !ts.isExternalModule(node); + return node.kind === 227 /* SourceFile */ && !ts.isExternalModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { var symbol = symbols[name]; - ts.Debug.assert((symbol.flags & 16777216) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((symbol.flags & 16777216 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); if (symbol.flags & meaning) { return symbol; } - if (symbol.flags & 8388608) { + if (symbol.flags & 8388608 /* Alias */) { var target = resolveAlias(symbol); + // Unknown symbol means an error occurred in alias resolution, treat it as positive answer to avoid cascading errors if (target === unknownSymbol || target.flags & meaning) { return symbol; } } } + // return undefined if we can't find a symbol. } + /** Returns true if node1 is defined before node 2**/ function isDefinedBefore(node1, node2) { var file1 = ts.getSourceFileOfNode(node1); var file2 = ts.getSourceFileOfNode(node2); @@ -9226,6 +10923,9 @@ var ts; var sourceFiles = host.getSourceFiles(); return sourceFiles.indexOf(file1) <= sourceFiles.indexOf(file2); } + // Resolve a given name for a given meaning at a given location. An error is reported if the name was not found and + // the nameNotFoundMessage argument is not undefined. Returns the resolved symbol, or undefined if no symbol with + // the given name can be found. function resolveName(location, name, meaning, nameNotFoundMessage, nameArg) { var result; var lastLocation; @@ -9233,24 +10933,26 @@ var ts; var errorLocation = location; var grandparent; loop: while (location) { + // Locals of a source file are not in scope (because they get merged into the global symbol table) if (location.locals && !isGlobalSourceFile(location)) { if (result = getSymbol(location.locals, name, meaning)) { break loop; } } switch (location.kind) { - case 227: + case 227 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 205: - if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8914931)) { - if (result.flags & meaning || !(result.flags & 8388608 && getDeclarationOfAliasSymbol(result).kind === 217)) { + case 205 /* ModuleDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8914931 /* ModuleMember */)) { + if (result.flags & meaning || !(result.flags & 8388608 /* Alias */ && getDeclarationOfAliasSymbol(result).kind === 217 /* ExportSpecifier */)) { break loop; } result = undefined; } - else if (location.kind === 227) { - result = getSymbol(getSymbolOfNode(location).exports, "default", meaning & 8914931); + else if (location.kind === 227 /* SourceFile */ || + (location.kind === 205 /* ModuleDeclaration */ && location.name.kind === 8 /* StringLiteral */)) { + result = getSymbol(getSymbolOfNode(location).exports, "default", meaning & 8914931 /* ModuleMember */); var localSymbol = ts.getLocalSymbolForExportDefault(result); if (result && (result.flags & meaning) && localSymbol && localSymbol.name === name) { break loop; @@ -9258,54 +10960,73 @@ var ts; result = undefined; } break; - case 204: - if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8)) { + case 204 /* EnumDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 132: - case 131: - if (location.parent.kind === 201 && !(location.flags & 128)) { + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + // TypeScript 1.0 spec (April 2014): 8.4.1 + // Initializer expressions for instance member variables are evaluated in the scope + // of the class constructor body but are not permitted to reference parameters or + // local variables of the constructor. This effectively means that entities from outer scopes + // by the same name as a constructor parameter or local variable are inaccessible + // in initializer expressions for instance member variables. + if (location.parent.kind === 201 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { - if (getSymbol(ctor.locals, name, meaning & 107455)) { + if (getSymbol(ctor.locals, name, meaning & 107455 /* Value */)) { + // Remember the property node, it will be used later to report appropriate error propertyWithInvalidInitializer = location; } } } break; - case 201: - case 202: - if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 793056)) { - if (lastLocation && lastLocation.flags & 128) { + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 793056 /* Type */)) { + if (lastLocation && lastLocation.flags & 128 /* Static */) { + // TypeScript 1.0 spec (April 2014): 3.4.1 + // The scope of a type parameter extends over the entire declaration with which the type + // parameter list is associated, with the exception of static member declarations in classes. error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters); return undefined; } break loop; } break; - case 127: + // It is not legal to reference a class's own type parameters from a computed property name that + // belongs to the class. For example: + // + // function foo() { return '' } + // class C { // <-- Class's own type parameter T + // [foo()]() { } // <-- Reference to T from class's own computed property + // } + // + case 127 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (grandparent.kind === 201 || grandparent.kind === 202) { - if (result = getSymbol(getSymbolOfNode(grandparent).members, name, meaning & 793056)) { + if (grandparent.kind === 201 /* ClassDeclaration */ || grandparent.kind === 202 /* InterfaceDeclaration */) { + // A reference to this grandparent's type parameters would be an error + if (result = getSymbol(getSymbolOfNode(grandparent).members, name, meaning & 793056 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); return undefined; } } break; - case 134: - case 133: - case 135: - case 136: - case 137: - case 200: - case 163: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 135 /* Constructor */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 200 /* FunctionDeclaration */: + case 163 /* ArrowFunction */: if (name === "arguments") { result = argumentsSymbol; break loop; } break; - case 162: + case 162 /* FunctionExpression */: if (name === "arguments") { result = argumentsSymbol; break loop; @@ -9316,17 +11037,31 @@ var ts; break loop; } break; - case 174: + case 174 /* ClassExpression */: var className = location.name; if (className && name === className.text) { result = location.symbol; break loop; } break; - case 130: - if (location.parent && location.parent.kind === 129) { + case 130 /* Decorator */: + // Decorators are resolved at the class declaration. Resolving at the parameter + // or member would result in looking up locals in the method. + // + // function y() {} + // class C { + // method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter. + // } + // + if (location.parent && location.parent.kind === 129 /* Parameter */) { location = location.parent; } + // + // function y() {} + // class C { + // @y method(x, y) {} // <-- decorator y should be resolved at the class declaration, not the method. + // } + // if (location.parent && ts.isClassElement(location.parent)) { location = location.parent; } @@ -9344,32 +11079,47 @@ var ts; } return undefined; } + // Perform extra checks only if error reporting was requested if (nameNotFoundMessage) { if (propertyWithInvalidInitializer) { + // We have a match, but the reference occurred within a property initializer and the identifier also binds + // to a local variable in the constructor where the code will be emitted. var propertyName = propertyWithInvalidInitializer.name; error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.declarationNameToString(propertyName), typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); return undefined; } - if (result.flags & 2) { + if (result.flags & 2 /* BlockScopedVariable */) { checkResolvedBlockScopedVariable(result, errorLocation); } } return result; } function checkResolvedBlockScopedVariable(result, errorLocation) { - ts.Debug.assert((result.flags & 2) !== 0); + ts.Debug.assert((result.flags & 2 /* BlockScopedVariable */) !== 0); + // Block-scoped variables cannot be used before their definition var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) ? d : undefined; }); ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); + // first check if usage is lexically located after the declaration var isUsedBeforeDeclaration = !isDefinedBefore(declaration, errorLocation); if (!isUsedBeforeDeclaration) { - var variableDeclaration = ts.getAncestor(declaration, 198); + // lexical check succeeded however code still can be illegal. + // - block scoped variables cannot be used in its initializers + // let x = x; // illegal but usage is lexically after definition + // - in ForIn/ForOf statements variable cannot be contained in expression part + // for (let x in x) + // for (let x of x) + // climb up to the variable declaration skipping binding patterns + var variableDeclaration = ts.getAncestor(declaration, 198 /* VariableDeclaration */); var container = ts.getEnclosingBlockScopeContainer(variableDeclaration); - if (variableDeclaration.parent.parent.kind === 180 || - variableDeclaration.parent.parent.kind === 186) { + if (variableDeclaration.parent.parent.kind === 180 /* VariableStatement */ || + variableDeclaration.parent.parent.kind === 186 /* ForStatement */) { + // variable statement/for statement case, + // use site should not be inside variable declaration (initializer of declaration or binding element) isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, variableDeclaration, container); } - else if (variableDeclaration.parent.parent.kind === 188 || - variableDeclaration.parent.parent.kind === 187) { + else if (variableDeclaration.parent.parent.kind === 188 /* ForOfStatement */ || + variableDeclaration.parent.parent.kind === 187 /* ForInStatement */) { + // ForIn/ForOf case - use site should not be used in expression part var expression = variableDeclaration.parent.parent.expression; isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, expression, container); } @@ -9378,6 +11128,10 @@ var ts; error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); } } + /* Starting from 'initial' node walk up the parent chain until 'stopAt' node is reached. + * If at any point current node is equal to 'parent' node - return true. + * Return false if 'stopAt' node is reached or isFunctionLike(current) === true. + */ function isSameScopeDescendentOf(initial, parent, stopAt) { if (!parent) { return false; @@ -9391,10 +11145,10 @@ var ts; } function getAnyImportSyntax(node) { if (ts.isAliasSymbolDeclaration(node)) { - if (node.kind === 208) { + if (node.kind === 208 /* ImportEqualsDeclaration */) { return node; } - while (node && node.kind !== 209) { + while (node && node.kind !== 209 /* ImportDeclaration */) { node = node.parent; } return node; @@ -9404,7 +11158,7 @@ var ts; return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; }); } function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 219) { + if (node.moduleReference.kind === 219 /* ExternalModuleReference */) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, node); @@ -9424,15 +11178,33 @@ var ts; return resolveESModuleSymbol(resolveExternalModuleName(node, moduleSpecifier), moduleSpecifier); } function getMemberOfModuleVariable(moduleSymbol, name) { - if (moduleSymbol.flags & 3) { + if (moduleSymbol.flags & 3 /* Variable */) { var typeAnnotation = moduleSymbol.valueDeclaration.type; if (typeAnnotation) { - return getPropertyOfType(getTypeFromTypeNodeOrHeritageClauseElement(typeAnnotation), name); + return getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name); } } } + // This function creates a synthetic symbol that combines the value side of one symbol with the + // type/namespace side of another symbol. Consider this example: + // + // declare module graphics { + // interface Point { + // x: number; + // y: number; + // } + // } + // declare var graphics: { + // Point: new (x: number, y: number) => graphics.Point; + // } + // declare module "graphics" { + // export = graphics; + // } + // + // An 'import { Point } from "graphics"' needs to create a symbol that combines the value side 'Point' + // property with the type/namespace side interface 'Point'. function combineValueAndTypeSymbols(valueSymbol, typeSymbol) { - if (valueSymbol.flags & (793056 | 1536)) { + if (valueSymbol.flags & (793056 /* Type */ | 1536 /* Namespace */)) { return valueSymbol; } var result = createSymbol(valueSymbol.flags | typeSymbol.flags, valueSymbol.name); @@ -9447,7 +11219,7 @@ var ts; return result; } function getExportOfModule(symbol, name) { - if (symbol.flags & 1536) { + if (symbol.flags & 1536 /* Module */) { var exports = getExportsOfSymbol(symbol); if (ts.hasProperty(exports, name)) { return resolveSymbol(exports[name]); @@ -9455,10 +11227,10 @@ var ts; } } function getPropertyOfVariable(symbol, name) { - if (symbol.flags & 3) { + if (symbol.flags & 3 /* Variable */) { var typeAnnotation = symbol.valueDeclaration.type; if (typeAnnotation) { - return resolveSymbol(getPropertyOfType(getTypeFromTypeNodeOrHeritageClauseElement(typeAnnotation), name)); + return resolveSymbol(getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name)); } } } @@ -9486,32 +11258,32 @@ var ts; function getTargetOfExportSpecifier(node) { return node.parent.parent.moduleSpecifier ? getExternalModuleMember(node.parent.parent, node) : - resolveEntityName(node.propertyName || node.name, 107455 | 793056 | 1536); + resolveEntityName(node.propertyName || node.name, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */); } function getTargetOfExportAssignment(node) { - return node.expression && resolveEntityName(node.expression, 107455 | 793056 | 1536); + return resolveEntityName(node.expression, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */); } function getTargetOfAliasDeclaration(node) { switch (node.kind) { - case 208: + case 208 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node); - case 210: + case 210 /* ImportClause */: return getTargetOfImportClause(node); - case 211: + case 211 /* NamespaceImport */: return getTargetOfNamespaceImport(node); - case 213: + case 213 /* ImportSpecifier */: return getTargetOfImportSpecifier(node); - case 217: + case 217 /* ExportSpecifier */: return getTargetOfExportSpecifier(node); - case 214: + case 214 /* ExportAssignment */: return getTargetOfExportAssignment(node); } } function resolveSymbol(symbol) { - return symbol && symbol.flags & 8388608 && !(symbol.flags & (107455 | 793056 | 1536)) ? resolveAlias(symbol) : symbol; + return symbol && symbol.flags & 8388608 /* Alias */ && !(symbol.flags & (107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */)) ? resolveAlias(symbol) : symbol; } function resolveAlias(symbol) { - ts.Debug.assert((symbol.flags & 8388608) !== 0, "Should only get Alias here."); + ts.Debug.assert((symbol.flags & 8388608 /* Alias */) !== 0, "Should only get Alias here."); var links = getSymbolLinks(symbol); if (!links.target) { links.target = resolvingSymbol; @@ -9534,62 +11306,79 @@ var ts; var target = resolveAlias(symbol); if (target) { var markAlias = (target === unknownSymbol && compilerOptions.separateCompilation) || - (target !== unknownSymbol && (target.flags & 107455) && !isConstEnumOrConstEnumOnlyModule(target)); + (target !== unknownSymbol && (target.flags & 107455 /* Value */) && !isConstEnumOrConstEnumOnlyModule(target)); if (markAlias) { markAliasSymbolAsReferenced(symbol); } } } + // When an alias symbol is referenced, we need to mark the entity it references as referenced and in turn repeat that until + // we reach a non-alias or an exported entity (which is always considered referenced). We do this by checking the target of + // the alias as an expression (which recursively takes us back here if the target references another alias). function markAliasSymbolAsReferenced(symbol) { var links = getSymbolLinks(symbol); if (!links.referenced) { links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); - if (node.kind === 214 && node.expression) { + if (node.kind === 214 /* ExportAssignment */) { + // export default checkExpressionCached(node.expression); } - else if (node.kind === 217) { + else if (node.kind === 217 /* ExportSpecifier */) { + // export { } or export { as foo } checkExpressionCached(node.propertyName || node.name); } else if (ts.isInternalModuleImportEqualsDeclaration(node)) { + // import foo = checkExpressionCached(node.moduleReference); } } } + // This function is only for imports with entity names function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 208); + importDeclaration = ts.getAncestor(entityName, 208 /* ImportEqualsDeclaration */); ts.Debug.assert(importDeclaration !== undefined); } - if (entityName.kind === 65 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { + // There are three things we might try to look for. In the following examples, + // the search term is enclosed in |...|: + // + // import a = |b|; // Namespace + // import a = |b.c|; // Value, type, namespace + // import a = |b.c|.d; // Namespace + if (entityName.kind === 65 /* Identifier */ && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 65 || entityName.parent.kind === 126) { - return resolveEntityName(entityName, 1536); + // Check for case 1 and 3 in the above example + if (entityName.kind === 65 /* Identifier */ || entityName.parent.kind === 126 /* QualifiedName */) { + return resolveEntityName(entityName, 1536 /* Namespace */); } else { - ts.Debug.assert(entityName.parent.kind === 208); - return resolveEntityName(entityName, 107455 | 793056 | 1536); + // Case 2 in above example + // entityName.kind could be a QualifiedName or a Missing identifier + ts.Debug.assert(entityName.parent.kind === 208 /* ImportEqualsDeclaration */); + return resolveEntityName(entityName, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */); } } function getFullyQualifiedName(symbol) { return symbol.parent ? getFullyQualifiedName(symbol.parent) + "." + symbolToString(symbol) : symbolToString(symbol); } + // Resolves a qualified name and any involved aliases function resolveEntityName(name, meaning) { if (ts.nodeIsMissing(name)) { return undefined; } var symbol; - if (name.kind === 65) { + if (name.kind === 65 /* Identifier */) { symbol = resolveName(name, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, name); if (!symbol) { return undefined; } } - else if (name.kind === 126 || name.kind === 155) { - var left = name.kind === 126 ? name.left : name.expression; - var right = name.kind === 126 ? name.right : name.name; - var namespace = resolveEntityName(left, 1536); + else if (name.kind === 126 /* QualifiedName */ || name.kind === 155 /* PropertyAccessExpression */) { + var left = name.kind === 126 /* QualifiedName */ ? name.left : name.expression; + var right = name.kind === 126 /* QualifiedName */ ? name.right : name.name; + var namespace = resolveEntityName(left, 1536 /* Namespace */); if (!namespace || namespace === unknownSymbol || ts.nodeIsMissing(right)) { return undefined; } @@ -9602,24 +11391,28 @@ var ts; else { ts.Debug.fail("Unknown entity name kind."); } - ts.Debug.assert((symbol.flags & 16777216) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((symbol.flags & 16777216 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); return symbol.flags & meaning ? symbol : resolveAlias(symbol); } function isExternalModuleNameRelative(moduleName) { + // TypeScript 1.0 spec (April 2014): 11.2.1 + // An external module name is "relative" if the first term is "." or "..". return moduleName.substr(0, 2) === "./" || moduleName.substr(0, 3) === "../" || moduleName.substr(0, 2) === ".\\" || moduleName.substr(0, 3) === "..\\"; } function resolveExternalModuleName(location, moduleReferenceExpression) { - if (moduleReferenceExpression.kind !== 8) { + if (moduleReferenceExpression.kind !== 8 /* StringLiteral */) { return; } var moduleReferenceLiteral = moduleReferenceExpression; var searchPath = ts.getDirectoryPath(getSourceFile(location).fileName); + // Module names are escaped in our symbol table. However, string literal values aren't. + // Escape the name in the "require(...)" clause to ensure we find the right symbol. var moduleName = ts.escapeIdentifier(moduleReferenceLiteral.text); if (!moduleName) return; var isRelative = isExternalModuleNameRelative(moduleName); if (!isRelative) { - var symbol = getSymbol(globals, '"' + moduleName + '"', 512); + var symbol = getSymbol(globals, '"' + moduleName + '"', 512 /* ValueModule */); if (symbol) { return symbol; } @@ -9646,12 +11439,17 @@ var ts; } error(moduleReferenceLiteral, ts.Diagnostics.Cannot_find_external_module_0, moduleName); } + // An external module with an 'export =' declaration resolves to the target of the 'export =' declaration, + // and an external module with no 'export =' declaration resolves to the module itself. function resolveExternalModuleSymbol(moduleSymbol) { return moduleSymbol && resolveSymbol(moduleSymbol.exports["export="]) || moduleSymbol; } + // An external module with an 'export =' declaration may be referenced as an ES6 module provided the 'export =' + // references a symbol that is at least declared as a module or a variable. The target of the 'export =' may + // combine other declarations with the module or variable (e.g. a class/module, function/module, interface/variable). function resolveESModuleSymbol(moduleSymbol, moduleReferenceExpression) { var symbol = resolveExternalModuleSymbol(moduleSymbol); - if (symbol && !(symbol.flags & (1536 | 3))) { + if (symbol && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */))) { error(moduleReferenceExpression, ts.Diagnostics.External_module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); symbol = undefined; } @@ -9660,8 +11458,11 @@ var ts; function getExportAssignmentSymbol(moduleSymbol) { return moduleSymbol.exports["export="]; } + function getExportsOfModuleAsArray(moduleSymbol) { + return symbolsToArray(getExportsOfModule(moduleSymbol)); + } function getExportsOfSymbol(symbol) { - return symbol.flags & 1536 ? getExportsOfModule(symbol) : symbol.exports || emptySymbols; + return symbol.flags & 1536 /* Module */ ? getExportsOfModule(symbol) : symbol.exports || emptySymbols; } function getExportsOfModule(moduleSymbol) { var links = getSymbolLinks(moduleSymbol); @@ -9679,8 +11480,10 @@ var ts; var visitedSymbols = []; visit(moduleSymbol); return result || moduleSymbol.exports; + // 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) { - if (symbol.flags & 1952 && !ts.contains(visitedSymbols, symbol)) { + if (symbol && symbol.flags & 1952 /* HasExports */ && !ts.contains(visitedSymbols, symbol)) { visitedSymbols.push(symbol); if (symbol !== moduleSymbol) { if (!result) { @@ -9688,6 +11491,7 @@ var ts; } extendExportSymbols(result, symbol.exports); } + // All export * declarations are collected in an __export symbol by the binder var exportStars = symbol.exports["__export"]; if (exportStars) { for (var _i = 0, _a = exportStars.declarations; _i < _a.length; _i++) { @@ -9709,19 +11513,23 @@ var ts; return getMergedSymbol(symbol.parent); } function getExportSymbolOfValueSymbolIfExported(symbol) { - return symbol && (symbol.flags & 1048576) !== 0 + return symbol && (symbol.flags & 1048576 /* ExportValue */) !== 0 ? getMergedSymbol(symbol.exportSymbol) : symbol; } function symbolIsValue(symbol) { - if (symbol.flags & 16777216) { + // If it is an instantiated symbol, then it is a value if the symbol it is an + // instantiation of is a value. + if (symbol.flags & 16777216 /* Instantiated */) { return symbolIsValue(getSymbolLinks(symbol).target); } - if (symbol.flags & 107455) { + // If the symbol has the value flag, it is trivially a value. + if (symbol.flags & 107455 /* Value */) { return true; } - if (symbol.flags & 8388608) { - return (resolveAlias(symbol).flags & 107455) !== 0; + // If it is an alias, then it is a value if the symbol it resolves to is a value. + if (symbol.flags & 8388608 /* Alias */) { + return (resolveAlias(symbol).flags & 107455 /* Value */) !== 0; } return false; } @@ -9729,7 +11537,7 @@ var ts; var members = node.members; for (var _i = 0; _i < members.length; _i++) { var member = members[_i]; - if (member.kind === 135 && ts.nodeIsPresent(member.body)) { + if (member.kind === 135 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -9749,11 +11557,15 @@ var ts; type.symbol = symbol; return type; } + // A reserved member name starts with two underscores, but the third character cannot be an underscore + // or the @ symbol. A third underscore indicates an escaped form of an identifer that started + // with at least two underscores. The @ character indicates that the name is denoted by a well known ES + // Symbol instance. 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 /* at */; } function getNamedMembers(members) { var result; @@ -9783,28 +11595,29 @@ var ts; return type; } function createAnonymousType(symbol, members, callSignatures, constructSignatures, stringIndexType, numberIndexType) { - return setObjectTypeMembers(createObjectType(32768, symbol), members, callSignatures, constructSignatures, stringIndexType, numberIndexType); + return setObjectTypeMembers(createObjectType(32768 /* Anonymous */, symbol), members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } function forEachSymbolTableInScope(enclosingDeclaration, callback) { var result; for (var location_1 = enclosingDeclaration; location_1; location_1 = location_1.parent) { + // Locals of a source file are not in scope (because they get merged into the global symbol table) if (location_1.locals && !isGlobalSourceFile(location_1)) { if (result = callback(location_1.locals)) { return result; } } switch (location_1.kind) { - case 227: + case 227 /* SourceFile */: if (!ts.isExternalModule(location_1)) { break; } - case 205: + case 205 /* ModuleDeclaration */: if (result = callback(getSymbolOfNode(location_1).exports)) { return result; } break; - case 201: - case 202: + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: if (result = callback(getSymbolOfNode(location_1).members)) { return result; } @@ -9814,34 +11627,45 @@ var ts; return callback(globals); } function getQualifiedLeftMeaning(rightMeaning) { - return rightMeaning === 107455 ? 107455 : 1536; + // If we are looking in value space, the parent meaning is value, other wise it is namespace + return rightMeaning === 107455 /* Value */ ? 107455 /* Value */ : 1536 /* Namespace */; } function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, useOnlyExternalAliasing) { function getAccessibleSymbolChainFromSymbolTable(symbols) { function canQualifySymbol(symbolFromSymbolTable, meaning) { + // If the symbol is equivalent and doesn't need further qualification, this symbol is accessible if (!needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning)) { return true; } + // If symbol needs qualification, make sure that parent is accessible, if it is then this symbol is accessible too var accessibleParent = getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning), useOnlyExternalAliasing); return !!accessibleParent; } function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol) { if (symbol === (resolvedAliasSymbol || symbolFromSymbolTable)) { + // if the symbolFromSymbolTable is not external module (it could be if it was determined as ambient external module and would be in globals table) + // and if symbolfrom symbolTable or alias resolution matches the symbol, + // check the symbol can be qualified, it is only then this symbol is accessible return !ts.forEach(symbolFromSymbolTable.declarations, hasExternalModuleSymbol) && canQualifySymbol(symbolFromSymbolTable, meaning); } } + // If symbol is directly available by its name in the symbol table if (isAccessible(ts.lookUp(symbols, symbol.name))) { return [symbol]; } + // Check if symbol is any of the alias return ts.forEachValue(symbols, function (symbolFromSymbolTable) { - if (symbolFromSymbolTable.flags & 8388608 && symbolFromSymbolTable.name !== "export=") { + if (symbolFromSymbolTable.flags & 8388608 /* Alias */ && symbolFromSymbolTable.name !== "export=") { if (!useOnlyExternalAliasing || + // Is this external alias, then use it to name ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); if (isAccessible(symbolFromSymbolTable, resolveAlias(symbolFromSymbolTable))) { return [symbolFromSymbolTable]; } + // Look in the exported members, if we can find accessibleSymbolChain, symbol is accessible using this chain + // but only if the symbolFromSymbolTable can be qualified var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined; if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); @@ -9857,59 +11681,82 @@ var ts; function needsQualification(symbol, enclosingDeclaration, meaning) { var qualify = false; forEachSymbolTableInScope(enclosingDeclaration, function (symbolTable) { + // If symbol of this name is not available in the symbol table we are ok if (!ts.hasProperty(symbolTable, symbol.name)) { + // Continue to the next symbol table return false; } + // If the symbol with this name is present it should refer to the symbol var symbolFromSymbolTable = symbolTable[symbol.name]; if (symbolFromSymbolTable === symbol) { + // No need to qualify return true; } - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + // Qualify if the symbol from symbol table has same meaning as expected + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 /* Alias */) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; } + // Continue to the next symbol table return false; }); return qualify; } function isSymbolAccessible(symbol, enclosingDeclaration, meaning) { - if (symbol && enclosingDeclaration && !(symbol.flags & 262144)) { + if (symbol && enclosingDeclaration && !(symbol.flags & 262144 /* TypeParameter */)) { var initialSymbol = symbol; var meaningToLook = meaning; while (symbol) { + // Symbol is accessible if it by itself is accessible var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaningToLook, false); if (accessibleSymbolChain) { var hasAccessibleDeclarations = hasVisibleDeclarations(accessibleSymbolChain[0]); if (!hasAccessibleDeclarations) { return { - accessibility: 1, + accessibility: 1 /* NotAccessible */, errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning), - errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, 1536) : undefined + errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, 1536 /* Namespace */) : undefined }; } return hasAccessibleDeclarations; } + // If we haven't got the accessible symbol, it doesn't mean the symbol is actually inaccessible. + // It could be a qualified symbol and hence verify the path + // e.g.: + // module m { + // export class c { + // } + // } + // let x: typeof m.c + // In the above example when we start with checking if typeof m.c symbol is accessible, + // we are going to see if c can be accessed in scope directly. + // But it can't, hence the accessible is going to be undefined, but that doesn't mean m.c is inaccessible + // It is accessible if the parent m is accessible because then m.c can be accessed through qualification meaningToLook = getQualifiedLeftMeaning(meaning); symbol = getParentOfSymbol(symbol); } + // This could be a symbol that is not exported in the external module + // or it could be a symbol from different external module that is not aliased and hence cannot be named var symbolExternalModule = ts.forEach(initialSymbol.declarations, getExternalModuleContainer); if (symbolExternalModule) { var enclosingExternalModule = getExternalModuleContainer(enclosingDeclaration); if (symbolExternalModule !== enclosingExternalModule) { + // name from different external module that is not visible return { - accessibility: 2, + accessibility: 2 /* CannotBeNamed */, errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning), errorModuleName: symbolToString(symbolExternalModule) }; } } + // Just a local name that is not accessible return { - accessibility: 1, + accessibility: 1 /* NotAccessible */, errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning) }; } - return { accessibility: 0 }; + return { accessibility: 0 /* Accessible */ }; function getExternalModuleContainer(declaration) { for (; declaration; declaration = declaration.parent) { if (hasExternalModuleSymbol(declaration)) { @@ -9919,20 +11766,22 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 205 && declaration.name.kind === 8) || - (declaration.kind === 227 && ts.isExternalModule(declaration)); + return (declaration.kind === 205 /* ModuleDeclaration */ && declaration.name.kind === 8 /* StringLiteral */) || + (declaration.kind === 227 /* SourceFile */ && ts.isExternalModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; if (ts.forEach(symbol.declarations, function (declaration) { return !getIsDeclarationVisible(declaration); })) { return undefined; } - return { accessibility: 0, aliasesToMakeVisible: aliasesToMakeVisible }; + return { accessibility: 0 /* Accessible */, aliasesToMakeVisible: aliasesToMakeVisible }; function getIsDeclarationVisible(declaration) { if (!isDeclarationVisible(declaration)) { + // Mark the unexported alias as visible if its parent is visible + // because these kind of aliases can be used to name types in declaration file var anyImportSyntax = getAnyImportSyntax(declaration); if (anyImportSyntax && - !(anyImportSyntax.flags & 1) && + !(anyImportSyntax.flags & 1 /* Export */) && isDeclarationVisible(anyImportSyntax.parent)) { getNodeLinks(declaration).isVisible = true; if (aliasesToMakeVisible) { @@ -9945,27 +11794,34 @@ var ts; } return true; } + // Declaration is not visible return false; } return true; } } function isEntityNameVisible(entityName, enclosingDeclaration) { + // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 144) { - meaning = 107455 | 1048576; + if (entityName.parent.kind === 144 /* TypeQuery */) { + // Typeof value + meaning = 107455 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 126 || entityName.kind === 155 || - entityName.parent.kind === 208) { - meaning = 1536; + else if (entityName.kind === 126 /* QualifiedName */ || entityName.kind === 155 /* PropertyAccessExpression */ || + entityName.parent.kind === 208 /* ImportEqualsDeclaration */) { + // Left identifier from type reference or TypeAlias + // Entity name of the import declaration + meaning = 1536 /* Namespace */; } else { - meaning = 793056; + // Type Reference or TypeAlias entity = Identifier + meaning = 793056 /* Type */; } var firstIdentifier = getFirstIdentifier(entityName); var symbol = resolveName(enclosingDeclaration, firstIdentifier.text, meaning, undefined, undefined); + // Verify if the symbol is accessible return (symbol && hasVisibleDeclarations(symbol)) || { - accessibility: 1, + accessibility: 1 /* NotAccessible */, errorSymbolName: ts.getTextOfNode(firstIdentifier), errorNode: firstIdentifier }; @@ -9991,26 +11847,31 @@ var ts; getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); var result = writer.string(); ts.releaseStringWriter(writer); - var maxLength = compilerOptions.noErrorTruncation || flags & 4 ? undefined : 100; + var maxLength = compilerOptions.noErrorTruncation || flags & 4 /* NoTruncation */ ? undefined : 100; if (maxLength && result.length >= maxLength) { result = result.substr(0, maxLength - "...".length) + "..."; } return result; } function getTypeAliasForTypeLiteral(type) { - if (type.symbol && type.symbol.flags & 2048) { + if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { var node = type.symbol.declarations[0].parent; - while (node.kind === 149) { + while (node.kind === 149 /* ParenthesizedType */) { node = node.parent; } - if (node.kind === 203) { + if (node.kind === 203 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } return undefined; } + // This is for caching the result of getSymbolDisplayBuilder. Do not access directly. var _displayBuilder; function getSymbolDisplayBuilder() { + /** + * Writes only the name of the symbol out to the writer. Uses the original source text + * for the name of the symbol if it is available to match how the user inputted the name. + */ function appendSymbolNameOnly(symbol, writer) { if (symbol.declarations && symbol.declarations.length > 0) { var declaration = symbol.declarations[0]; @@ -10021,29 +11882,42 @@ var ts; } writer.writeSymbol(symbol.name, symbol); } + /** + * Enclosing declaration is optional when we don't want to get qualified name in the enclosing declaration scope + * Meaning needs to be specified if the enclosing declaration is given + */ function buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning, flags, typeFlags) { var parentSymbol; function appendParentTypeArgumentsAndSymbolName(symbol) { if (parentSymbol) { - if (flags & 1) { - if (symbol.flags & 16777216) { + // Write type arguments of instantiated class/interface here + if (flags & 1 /* WriteTypeParametersOrArguments */) { + if (symbol.flags & 16777216 /* Instantiated */) { buildDisplayForTypeArgumentsAndDelimiters(getTypeParametersOfClassOrInterface(parentSymbol), symbol.mapper, writer, enclosingDeclaration); } else { buildTypeParameterDisplayFromSymbol(parentSymbol, writer, enclosingDeclaration); } } - writePunctuation(writer, 20); + writePunctuation(writer, 20 /* DotToken */); } parentSymbol = symbol; appendSymbolNameOnly(symbol, writer); } + // Let the writer know we just wrote out a symbol. The declaration emitter writer uses + // this to determine if an import it has previously seen (and not written out) needs + // to be written to the file once the walk of the tree is complete. + // + // NOTE(cyrusn): This approach feels somewhat unfortunate. A simple pass over the tree + // up front (for example, during checking) could determine if we need to emit the imports + // and we could then access that data during declaration emit. writer.trackSymbol(symbol, enclosingDeclaration, meaning); function walkSymbol(symbol, meaning) { if (symbol) { - var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, !!(flags & 2)); + var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, !!(flags & 2 /* UseOnlyExternalAliasing */)); if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { + // Go up and add our parent. walkSymbol(getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol), getQualifiedLeftMeaning(meaning)); } if (accessibleSymbolChain) { @@ -10053,18 +11927,23 @@ var ts; } } else { + // If we didn't find accessible symbol chain for this symbol, break if this is external module if (!parentSymbol && ts.forEach(symbol.declarations, hasExternalModuleSymbol)) { return; } - if (symbol.flags & 2048 || symbol.flags & 4096) { + // if this is anonymous type break + if (symbol.flags & 2048 /* TypeLiteral */ || symbol.flags & 4096 /* ObjectLiteral */) { return; } appendParentTypeArgumentsAndSymbolName(symbol); } } } - var isTypeParameter = symbol.flags & 262144; - var typeFormatFlag = 128 & typeFlags; + // Get qualified name if the symbol is not a type parameter + // and there is an enclosing declaration or we specifically + // asked for it + var isTypeParameter = symbol.flags & 262144 /* TypeParameter */; + var typeFormatFlag = 128 /* UseFullyQualifiedType */ & typeFlags; if (!isTypeParameter && (enclosingDeclaration || typeFormatFlag)) { walkSymbol(symbol, meaning); return; @@ -10072,37 +11951,42 @@ var ts; return appendParentTypeArgumentsAndSymbolName(symbol); } function buildTypeDisplay(type, writer, enclosingDeclaration, globalFlags, typeStack) { - var globalFlagsToPass = globalFlags & 16; + var globalFlagsToPass = globalFlags & 16 /* WriteOwnNameForAnyLike */; return writeType(type, globalFlags); function writeType(type, flags) { - if (type.flags & 1048703) { - writer.writeKeyword(!(globalFlags & 16) && - (type.flags & 1) ? "any" : type.intrinsicName); + // Write undefined/null type as any + if (type.flags & 1048703 /* Intrinsic */) { + // Special handling for unknown / resolving types, they should show up as any and not unknown or __resolving + writer.writeKeyword(!(globalFlags & 16 /* WriteOwnNameForAnyLike */) && + (type.flags & 1 /* Any */) ? "any" : type.intrinsicName); } - else if (type.flags & 4096) { + else if (type.flags & 4096 /* Reference */) { writeTypeReference(type, flags); } - else if (type.flags & (1024 | 2048 | 128 | 512)) { - buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 793056, 0, flags); + else if (type.flags & (1024 /* Class */ | 2048 /* Interface */ | 128 /* Enum */ | 512 /* TypeParameter */)) { + // The specified symbol flags need to be reinterpreted as type flags + buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 793056 /* Type */, 0 /* None */, flags); } - else if (type.flags & 8192) { + else if (type.flags & 8192 /* Tuple */) { writeTupleType(type); } - else if (type.flags & 16384) { + else if (type.flags & 16384 /* Union */) { writeUnionType(type, flags); } - else if (type.flags & 32768) { + else if (type.flags & 32768 /* Anonymous */) { writeAnonymousType(type, flags); } - else if (type.flags & 256) { + else if (type.flags & 256 /* StringLiteral */) { writer.writeStringLiteral(type.text); } else { - writePunctuation(writer, 14); + // Should never get here + // { ... } + writePunctuation(writer, 14 /* OpenBraceToken */); writeSpace(writer); - writePunctuation(writer, 21); + writePunctuation(writer, 21 /* DotDotDotToken */); writeSpace(writer); - writePunctuation(writer, 15); + writePunctuation(writer, 15 /* CloseBraceToken */); } } function writeTypeList(types, union) { @@ -10111,53 +11995,57 @@ var ts; if (union) { writeSpace(writer); } - writePunctuation(writer, union ? 44 : 23); + writePunctuation(writer, union ? 44 /* BarToken */ : 23 /* CommaToken */); writeSpace(writer); } - writeType(types[i], union ? 64 : 0); + writeType(types[i], union ? 64 /* InElementType */ : 0 /* None */); } } function writeTypeReference(type, flags) { - if (type.target === globalArrayType && !(flags & 1)) { - writeType(type.typeArguments[0], 64); - writePunctuation(writer, 18); - writePunctuation(writer, 19); + if (type.target === globalArrayType && !(flags & 1 /* WriteArrayAsGenericType */)) { + writeType(type.typeArguments[0], 64 /* InElementType */); + writePunctuation(writer, 18 /* OpenBracketToken */); + writePunctuation(writer, 19 /* CloseBracketToken */); } else { - buildSymbolDisplay(type.target.symbol, writer, enclosingDeclaration, 793056); - writePunctuation(writer, 24); + buildSymbolDisplay(type.target.symbol, writer, enclosingDeclaration, 793056 /* Type */); + writePunctuation(writer, 24 /* LessThanToken */); writeTypeList(type.typeArguments, false); - writePunctuation(writer, 25); + writePunctuation(writer, 25 /* GreaterThanToken */); } } function writeTupleType(type) { - writePunctuation(writer, 18); + writePunctuation(writer, 18 /* OpenBracketToken */); writeTypeList(type.elementTypes, false); - writePunctuation(writer, 19); + writePunctuation(writer, 19 /* CloseBracketToken */); } function writeUnionType(type, flags) { - if (flags & 64) { - writePunctuation(writer, 16); + if (flags & 64 /* InElementType */) { + writePunctuation(writer, 16 /* OpenParenToken */); } writeTypeList(type.types, true); - if (flags & 64) { - writePunctuation(writer, 17); + if (flags & 64 /* InElementType */) { + writePunctuation(writer, 17 /* CloseParenToken */); } } function writeAnonymousType(type, flags) { - if (type.symbol && type.symbol.flags & (32 | 384 | 512)) { + // Always use 'typeof T' for type of class, enum, and module objects + if (type.symbol && type.symbol.flags & (32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { writeTypeofSymbol(type, flags); } else if (shouldWriteTypeOfFunctionSymbol()) { writeTypeofSymbol(type, flags); } else if (typeStack && ts.contains(typeStack, type)) { + // If type is an anonymous type literal in a type alias declaration, use type alias name var typeAlias = getTypeAliasForTypeLiteral(type); if (typeAlias) { - buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, 793056, 0, flags); + // The specified symbol flags need to be reinterpreted as type flags + buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, 793056 /* Type */, 0 /* None */, flags); } else { - writeKeyword(writer, 112); + // Recursive usage, use any + writeKeyword(writer, 112 /* AnyKeyword */); } } else { @@ -10170,28 +12058,31 @@ 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) && + var isStaticMethodSymbol = !!(type.symbol.flags & 8192 /* Method */ && + ts.forEach(type.symbol.declarations, function (declaration) { return declaration.flags & 128 /* Static */; })); + var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16 /* Function */) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { - return declaration.parent.kind === 227 || declaration.parent.kind === 206; + return declaration.parent.kind === 227 /* SourceFile */ || declaration.parent.kind === 206 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { - return !!(flags & 2) || - (typeStack && ts.contains(typeStack, type)); + // typeof is allowed only for static/non local functions + return !!(flags & 2 /* UseTypeOfFunction */) || + (typeStack && ts.contains(typeStack, type)); // it is type of the symbol uses itself recursively } } } } function writeTypeofSymbol(type, typeFormatFlags) { - writeKeyword(writer, 97); + writeKeyword(writer, 97 /* TypeOfKeyword */); writeSpace(writer); - buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 107455, 0, typeFormatFlags); + buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 107455 /* Value */, 0 /* None */, typeFormatFlags); } function getIndexerParameterName(type, indexKind, fallbackName) { var declaration = getIndexDeclarationOfSymbol(type.symbol, indexKind); if (!declaration) { + // declaration might not be found if indexer was added from the contextual type. + // in this case use fallback name return fallbackName; } ts.Debug.assert(declaration.parameters.length !== 0); @@ -10201,111 +12092,113 @@ var ts; var resolved = resolveObjectOrUnionTypeMembers(type); if (!resolved.properties.length && !resolved.stringIndexType && !resolved.numberIndexType) { if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { - writePunctuation(writer, 14); - writePunctuation(writer, 15); + writePunctuation(writer, 14 /* OpenBraceToken */); + writePunctuation(writer, 15 /* CloseBraceToken */); return; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { - if (flags & 64) { - writePunctuation(writer, 16); + if (flags & 64 /* InElementType */) { + writePunctuation(writer, 16 /* OpenParenToken */); } - buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8, typeStack); - if (flags & 64) { - writePunctuation(writer, 17); + buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, typeStack); + if (flags & 64 /* InElementType */) { + writePunctuation(writer, 17 /* CloseParenToken */); } return; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { - if (flags & 64) { - writePunctuation(writer, 16); + if (flags & 64 /* InElementType */) { + writePunctuation(writer, 16 /* OpenParenToken */); } - writeKeyword(writer, 88); + writeKeyword(writer, 88 /* NewKeyword */); writeSpace(writer); - buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8, typeStack); - if (flags & 64) { - writePunctuation(writer, 17); + buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, typeStack); + if (flags & 64 /* InElementType */) { + writePunctuation(writer, 17 /* CloseParenToken */); } return; } } - writePunctuation(writer, 14); + writePunctuation(writer, 14 /* OpenBraceToken */); writer.writeLine(); writer.increaseIndent(); for (var _i = 0, _a = resolved.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); - writePunctuation(writer, 22); + writePunctuation(writer, 22 /* SemicolonToken */); writer.writeLine(); } for (var _b = 0, _c = resolved.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - writeKeyword(writer, 88); + writeKeyword(writer, 88 /* NewKeyword */); writeSpace(writer); buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); - writePunctuation(writer, 22); + writePunctuation(writer, 22 /* SemicolonToken */); writer.writeLine(); } if (resolved.stringIndexType) { - writePunctuation(writer, 18); - writer.writeParameter(getIndexerParameterName(resolved, 0, "x")); - writePunctuation(writer, 51); + // [x: string]: + writePunctuation(writer, 18 /* OpenBracketToken */); + writer.writeParameter(getIndexerParameterName(resolved, 0 /* String */, "x")); + writePunctuation(writer, 51 /* ColonToken */); writeSpace(writer); - writeKeyword(writer, 121); - writePunctuation(writer, 19); - writePunctuation(writer, 51); + writeKeyword(writer, 121 /* StringKeyword */); + writePunctuation(writer, 19 /* CloseBracketToken */); + writePunctuation(writer, 51 /* ColonToken */); writeSpace(writer); - writeType(resolved.stringIndexType, 0); - writePunctuation(writer, 22); + writeType(resolved.stringIndexType, 0 /* None */); + writePunctuation(writer, 22 /* SemicolonToken */); writer.writeLine(); } if (resolved.numberIndexType) { - writePunctuation(writer, 18); - writer.writeParameter(getIndexerParameterName(resolved, 1, "x")); - writePunctuation(writer, 51); + // [x: number]: + writePunctuation(writer, 18 /* OpenBracketToken */); + writer.writeParameter(getIndexerParameterName(resolved, 1 /* Number */, "x")); + writePunctuation(writer, 51 /* ColonToken */); writeSpace(writer); - writeKeyword(writer, 119); - writePunctuation(writer, 19); - writePunctuation(writer, 51); + writeKeyword(writer, 119 /* NumberKeyword */); + writePunctuation(writer, 19 /* CloseBracketToken */); + writePunctuation(writer, 51 /* ColonToken */); writeSpace(writer); - writeType(resolved.numberIndexType, 0); - writePunctuation(writer, 22); + writeType(resolved.numberIndexType, 0 /* None */); + writePunctuation(writer, 22 /* SemicolonToken */); writer.writeLine(); } 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); + if (p.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(t).length) { + var signatures = getSignaturesOfType(t, 0 /* Call */); for (var _f = 0; _f < signatures.length; _f++) { var signature = signatures[_f]; buildSymbolDisplay(p, writer); - if (p.flags & 536870912) { - writePunctuation(writer, 50); + if (p.flags & 536870912 /* Optional */) { + writePunctuation(writer, 50 /* QuestionToken */); } buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); - writePunctuation(writer, 22); + writePunctuation(writer, 22 /* SemicolonToken */); writer.writeLine(); } } else { buildSymbolDisplay(p, writer); - if (p.flags & 536870912) { - writePunctuation(writer, 50); + if (p.flags & 536870912 /* Optional */) { + writePunctuation(writer, 50 /* QuestionToken */); } - writePunctuation(writer, 51); + writePunctuation(writer, 51 /* ColonToken */); writeSpace(writer); - writeType(t, 0); - writePunctuation(writer, 22); + writeType(t, 0 /* None */); + writePunctuation(writer, 22 /* SemicolonToken */); writer.writeLine(); } } writer.decreaseIndent(); - writePunctuation(writer, 15); + writePunctuation(writer, 15 /* CloseBraceToken */); } } function buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaraiton, flags) { var targetSymbol = getTargetSymbol(symbol); - if (targetSymbol.flags & 32 || targetSymbol.flags & 64) { + if (targetSymbol.flags & 32 /* Class */ || targetSymbol.flags & 64 /* Interface */) { buildDisplayForTypeParametersAndDelimiters(getTypeParametersOfClassOrInterface(symbol), writer, enclosingDeclaraiton, flags); } } @@ -10314,73 +12207,75 @@ var ts; var constraint = getConstraintOfTypeParameter(tp); if (constraint) { writeSpace(writer); - writeKeyword(writer, 79); + writeKeyword(writer, 79 /* ExtendsKeyword */); writeSpace(writer); buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, typeStack); } } function buildParameterDisplay(p, writer, enclosingDeclaration, flags, typeStack) { if (ts.hasDotDotDotToken(p.valueDeclaration)) { - writePunctuation(writer, 21); + writePunctuation(writer, 21 /* DotDotDotToken */); } appendSymbolNameOnly(p, writer); if (ts.hasQuestionToken(p.valueDeclaration) || p.valueDeclaration.initializer) { - writePunctuation(writer, 50); + writePunctuation(writer, 50 /* QuestionToken */); } - writePunctuation(writer, 51); + writePunctuation(writer, 51 /* ColonToken */); writeSpace(writer); buildTypeDisplay(getTypeOfSymbol(p), writer, enclosingDeclaration, flags, typeStack); } function buildDisplayForTypeParametersAndDelimiters(typeParameters, writer, enclosingDeclaration, flags, typeStack) { if (typeParameters && typeParameters.length) { - writePunctuation(writer, 24); + writePunctuation(writer, 24 /* LessThanToken */); for (var i = 0; i < typeParameters.length; i++) { if (i > 0) { - writePunctuation(writer, 23); + writePunctuation(writer, 23 /* CommaToken */); writeSpace(writer); } buildTypeParameterDisplay(typeParameters[i], writer, enclosingDeclaration, flags, typeStack); } - writePunctuation(writer, 25); + writePunctuation(writer, 25 /* GreaterThanToken */); } } function buildDisplayForTypeArgumentsAndDelimiters(typeParameters, mapper, writer, enclosingDeclaration, flags, typeStack) { if (typeParameters && typeParameters.length) { - writePunctuation(writer, 24); + writePunctuation(writer, 24 /* LessThanToken */); for (var i = 0; i < typeParameters.length; i++) { if (i > 0) { - writePunctuation(writer, 23); + writePunctuation(writer, 23 /* CommaToken */); writeSpace(writer); } - buildTypeDisplay(mapper(typeParameters[i]), writer, enclosingDeclaration, 0); + buildTypeDisplay(mapper(typeParameters[i]), writer, enclosingDeclaration, 0 /* None */); } - writePunctuation(writer, 25); + writePunctuation(writer, 25 /* GreaterThanToken */); } } function buildDisplayForParametersAndDelimiters(parameters, writer, enclosingDeclaration, flags, typeStack) { - writePunctuation(writer, 16); + writePunctuation(writer, 16 /* OpenParenToken */); for (var i = 0; i < parameters.length; i++) { if (i > 0) { - writePunctuation(writer, 23); + writePunctuation(writer, 23 /* CommaToken */); writeSpace(writer); } buildParameterDisplay(parameters[i], writer, enclosingDeclaration, flags, typeStack); } - writePunctuation(writer, 17); + writePunctuation(writer, 17 /* CloseParenToken */); } function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, typeStack) { - if (flags & 8) { + if (flags & 8 /* WriteArrowStyleSignature */) { writeSpace(writer); - writePunctuation(writer, 32); + writePunctuation(writer, 32 /* EqualsGreaterThanToken */); } else { - writePunctuation(writer, 51); + writePunctuation(writer, 51 /* ColonToken */); } writeSpace(writer); buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags, typeStack); } function buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, typeStack) { - if (signature.target && (flags & 32)) { + if (signature.target && (flags & 32 /* WriteTypeArgumentsOfSignature */)) { + // Instantiated signature, write type arguments instead + // This is achieved by passing in the mapper separately buildDisplayForTypeArgumentsAndDelimiters(signature.target.typeParameters, signature.mapper, writer, enclosingDeclaration); } else { @@ -10407,41 +12302,47 @@ var ts; function isDeclarationVisible(node) { function getContainingExternalModule(node) { for (; node; node = node.parent) { - if (node.kind === 205) { - if (node.name.kind === 8) { + if (node.kind === 205 /* ModuleDeclaration */) { + if (node.name.kind === 8 /* StringLiteral */) { return node; } } - else if (node.kind === 227) { + else if (node.kind === 227 /* SourceFile */) { return ts.isExternalModule(node) ? node : undefined; } } ts.Debug.fail("getContainingModule cant reach here"); } function isUsedInExportAssignment(node) { + // Get source File and see if it is external module and has export assigned symbol var externalModule = getContainingExternalModule(node); var exportAssignmentSymbol; var resolvedExportSymbol; if (externalModule) { + // This is export assigned symbol node var externalModuleSymbol = getSymbolOfNode(externalModule); exportAssignmentSymbol = getExportAssignmentSymbol(externalModuleSymbol); var symbolOfNode = getSymbolOfNode(node); if (isSymbolUsedInExportAssignment(symbolOfNode)) { return true; } - if (symbolOfNode.flags & 8388608) { + // if symbolOfNode is alias declaration, resolve the symbol declaration and check + if (symbolOfNode.flags & 8388608 /* Alias */) { return isSymbolUsedInExportAssignment(resolveAlias(symbolOfNode)); } } + // Check if the symbol is used in export assignment function isSymbolUsedInExportAssignment(symbol) { if (exportAssignmentSymbol === symbol) { return true; } - if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 8388608)) { + if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 8388608 /* Alias */)) { + // if export assigned symbol is alias declaration, resolve the alias resolvedExportSymbol = resolvedExportSymbol || resolveAlias(exportAssignmentSymbol); if (resolvedExportSymbol === symbol) { return true; } + // Container of resolvedExportSymbol is visible return ts.forEach(resolvedExportSymbol.declarations, function (current) { while (current) { if (current === node) { @@ -10455,58 +12356,69 @@ var ts; } function determineIfDeclarationIsVisible() { switch (node.kind) { - case 152: + case 152 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 198: + case 198 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { + // If the binding pattern is empty, this variable declaration is not visible return false; } - case 205: - case 201: - case 202: - case 203: - case 200: - case 204: - case 208: + // Otherwise fall through + case 205 /* ModuleDeclaration */: + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + case 203 /* TypeAliasDeclaration */: + case 200 /* FunctionDeclaration */: + case 204 /* EnumDeclaration */: + case 208 /* ImportEqualsDeclaration */: var parent_2 = getDeclarationContainer(node); - if (!(ts.getCombinedNodeFlags(node) & 1) && - !(node.kind !== 208 && parent_2.kind !== 227 && ts.isInAmbientContext(parent_2))) { + // If the node is not exported or it is not ambient module element (except import declaration) + if (!(ts.getCombinedNodeFlags(node) & 1 /* Export */) && + !(node.kind !== 208 /* ImportEqualsDeclaration */ && parent_2.kind !== 227 /* SourceFile */ && ts.isInAmbientContext(parent_2))) { return isGlobalSourceFile(parent_2); } + // Exported members/ambient module elements (exception import declaration) are visible if parent is visible return isDeclarationVisible(parent_2); - case 132: - case 131: - case 136: - case 137: - case 134: - case 133: - if (node.flags & (32 | 64)) { + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + if (node.flags & (32 /* Private */ | 64 /* Protected */)) { + // Private/protected properties/methods are not visible return false; } - case 135: - case 139: - case 138: - case 140: - case 129: - case 206: - case 142: - case 143: - case 145: - case 141: - case 146: - case 147: - case 148: - case 149: + // Public properties/methods are visible if its parents are visible, so let it fall into next case statement + case 135 /* Constructor */: + case 139 /* ConstructSignature */: + case 138 /* CallSignature */: + case 140 /* IndexSignature */: + case 129 /* Parameter */: + case 206 /* ModuleBlock */: + case 142 /* FunctionType */: + case 143 /* ConstructorType */: + case 145 /* TypeLiteral */: + case 141 /* TypeReference */: + case 146 /* ArrayType */: + case 147 /* TupleType */: + case 148 /* UnionType */: + case 149 /* ParenthesizedType */: return isDeclarationVisible(node.parent); - case 210: - case 211: - case 213: + // Default binding, import specifier and namespace import is visible + // only on demand so by default it is not visible + case 210 /* ImportClause */: + case 211 /* NamespaceImport */: + case 213 /* ImportSpecifier */: return false; - case 128: - case 227: + // Type parameters are always visible + case 128 /* TypeParameter */: + // Source file is always visible + case 227 /* SourceFile */: return true; - case 214: + // Export assignements do not create name bindings outside the module + case 214 /* ExportAssignment */: return false; default: ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); @@ -10522,10 +12434,10 @@ var ts; } 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); + if (node.parent && node.parent.kind === 214 /* ExportAssignment */) { + exportSymbol = resolveName(node.parent, node.text, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */, ts.Diagnostics.Cannot_find_name_0, node); } - else if (node.parent.kind === 217) { + else if (node.parent.kind === 217 /* ExportSpecifier */) { exportSymbol = getTargetOfExportSpecifier(node.parent); } var result = []; @@ -10541,38 +12453,51 @@ var ts; result.push(resultNode); } if (ts.isInternalModuleImportEqualsDeclaration(declaration)) { + // Add the referenced top container visible var internalModuleReference = declaration.moduleReference; var firstIdentifier = getFirstIdentifier(internalModuleReference); - var importSymbol = resolveName(declaration, firstIdentifier.text, 107455 | 793056 | 1536, ts.Diagnostics.Cannot_find_name_0, firstIdentifier); + var importSymbol = resolveName(declaration, firstIdentifier.text, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */, ts.Diagnostics.Cannot_find_name_0, firstIdentifier); buildVisibleNodeList(importSymbol.declarations); } }); } } function getRootDeclaration(node) { - while (node.kind === 152) { + while (node.kind === 152 /* BindingElement */) { node = node.parent.parent; } return node; } function getDeclarationContainer(node) { node = getRootDeclaration(node); - return node.kind === 198 ? node.parent.parent.parent : node.parent; + // Parent chain: + // VaribleDeclaration -> VariableDeclarationList -> VariableStatement -> 'Declaration Container' + return node.kind === 198 /* VariableDeclaration */ ? node.parent.parent.parent : node.parent; } function getTypeOfPrototypeProperty(prototype) { + // TypeScript 1.0 spec (April 2014): 8.4 + // Every class automatically contains a static property member named 'prototype', + // the type of which is an instantiation of the class type with type Any supplied as a type argument for each type parameter. + // It is an error to explicitly declare a static property member with the name 'prototype'. var classType = getDeclaredTypeOfSymbol(prototype.parent); return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { return anyType; })) : classType; } + // Return the type of the given property in the given type, or undefined if no such property exists function getTypeOfPropertyOfType(type, name) { var prop = getPropertyOfType(type, name); return prop ? getTypeOfSymbol(prop) : undefined; } + // Return the inferred type for a binding element function getTypeForBindingElement(declaration) { var pattern = declaration.parent; var parentType = getTypeForVariableLikeDeclaration(pattern.parent); + // If parent has the unknown (error) type, then so does this binding element if (parentType === unknownType) { return unknownType; } + // If no type was specified or inferred for parent, or if the specified or inferred type is any, + // infer from the initializer of the binding element if one is present. Otherwise, go with the + // undefined or any type of the parent. if (!parentType || parentType === anyType) { if (declaration.initializer) { return checkExpressionCached(declaration.initializer); @@ -10580,24 +12505,33 @@ var ts; return parentType; } var type; - if (pattern.kind === 150) { + if (pattern.kind === 150 /* ObjectBindingPattern */) { + // Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form) var name_5 = declaration.propertyName || declaration.name; + // Use type of the specified property, or otherwise, for a numeric name, the type of the numeric index signature, + // or otherwise the type of the string index signature. type = getTypeOfPropertyOfType(parentType, name_5.text) || - isNumericLiteralName(name_5.text) && getIndexTypeOfType(parentType, 1) || - getIndexTypeOfType(parentType, 0); + isNumericLiteralName(name_5.text) && getIndexTypeOfType(parentType, 1 /* Number */) || + getIndexTypeOfType(parentType, 0 /* String */); if (!type) { error(name_5, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name_5)); return unknownType; } } else { - if (!isArrayLikeType(parentType)) { - error(pattern, ts.Diagnostics.Type_0_is_not_an_array_type, typeToString(parentType)); - return unknownType; - } + // This elementType will be used if the specific property corresponding to this index is not + // present (aka the tuple element property). This call also checks that the parentType is in + // fact an iterable or array (depending on target language). + var elementType = checkIteratedTypeOrElementType(parentType, pattern, false); if (!declaration.dotDotDotToken) { + if (elementType.flags & 1 /* Any */) { + return elementType; + } + // Use specific property type when parent is a tuple or numeric index type when parent is an array var propName = "" + ts.indexOf(pattern.elements, declaration); - type = isTupleLikeType(parentType) ? getTypeOfPropertyOfType(parentType, propName) : getIndexTypeOfType(parentType, 1); + type = isTupleLikeType(parentType) + ? getTypeOfPropertyOfType(parentType, propName) + : elementType; if (!type) { if (isTupleType(parentType)) { error(declaration, ts.Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2, typeToString(parentType), parentType.elementTypes.length, pattern.elements.length); @@ -10609,45 +12543,61 @@ var ts; } } else { - type = createArrayType(getIndexTypeOfType(parentType, 1)); + // Rest element has an array type with the same element type as the parent type + type = createArrayType(elementType); } } return type; } + // Return the inferred type for a variable, parameter, or property declaration function getTypeForVariableLikeDeclaration(declaration) { - if (declaration.parent.parent.kind === 187) { + // A variable declared in a for..in statement is always of type any + if (declaration.parent.parent.kind === 187 /* ForInStatement */) { return anyType; } - if (declaration.parent.parent.kind === 188) { + if (declaration.parent.parent.kind === 188 /* ForOfStatement */) { + // checkRightHandSideOfForOf will return undefined if the for-of expression type was + // missing properties/signatures required to get its iteratedType (like + // [Symbol.iterator] or next). This may be because we accessed properties from anyType, + // or it may have led to an error inside getIteratedType. return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType; } if (ts.isBindingPattern(declaration.parent)) { return getTypeForBindingElement(declaration); } + // Use type from type annotation if one is present if (declaration.type) { - return getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); + return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 129) { + if (declaration.kind === 129 /* Parameter */) { var func = declaration.parent; - if (func.kind === 137 && !ts.hasDynamicName(func)) { - var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 136); + // For a parameter of a set accessor, use the type of the get accessor if one is present + if (func.kind === 137 /* SetAccessor */ && !ts.hasDynamicName(func)) { + var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 136 /* GetAccessor */); if (getter) { return getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); } } + // Use contextual parameter type if one is available var type = getContextuallyTypedParameterType(declaration); if (type) { return type; } } + // Use the type of the initializer expression if one is present if (declaration.initializer) { return checkExpressionCached(declaration.initializer); } - if (declaration.kind === 225) { + // If it is a short-hand property assignment, use the type of the identifier + if (declaration.kind === 225 /* ShorthandPropertyAssignment */) { return checkIdentifier(declaration.name); } + // No type specified and nothing can be inferred return undefined; } + // Return the type implied by a binding pattern element. This is the type of the initializer of the element if + // one is present. Otherwise, if the element is itself a binding pattern, it is the type implied by the binding + // pattern. Otherwise, it is the type any. function getTypeFromBindingElement(element) { if (element.initializer) { return getWidenedType(checkExpressionCached(element.initializer)); @@ -10657,10 +12607,11 @@ var ts; } return anyType; } + // Return the type implied by an object binding pattern function getTypeFromObjectBindingPattern(pattern) { var members = {}; ts.forEach(pattern.elements, function (e) { - var flags = 4 | 67108864 | (e.initializer ? 536870912 : 0); + var flags = 4 /* Property */ | 67108864 /* Transient */ | (e.initializer ? 536870912 /* Optional */ : 0); var name = e.propertyName || e.name; var symbol = createSymbol(flags, name.text); symbol.type = getTypeFromBindingElement(e); @@ -10668,37 +12619,69 @@ var ts; }); return createAnonymousType(undefined, members, emptyArray, emptyArray, undefined, undefined); } + // Return the type implied by an array binding pattern function getTypeFromArrayBindingPattern(pattern) { var hasSpreadElement = false; var elementTypes = []; ts.forEach(pattern.elements, function (e) { - elementTypes.push(e.kind === 175 || e.dotDotDotToken ? anyType : getTypeFromBindingElement(e)); + elementTypes.push(e.kind === 175 /* OmittedExpression */ || e.dotDotDotToken ? anyType : getTypeFromBindingElement(e)); if (e.dotDotDotToken) { hasSpreadElement = true; } }); - return !elementTypes.length ? anyArrayType : hasSpreadElement ? createArrayType(getUnionType(elementTypes)) : createTupleType(elementTypes); + if (!elementTypes.length) { + return languageVersion >= 2 /* ES6 */ ? createIterableType(anyType) : anyArrayType; + } + else if (hasSpreadElement) { + var unionOfElements = getUnionType(elementTypes); + return languageVersion >= 2 /* ES6 */ ? createIterableType(unionOfElements) : createArrayType(unionOfElements); + } + // If the pattern has at least one element, and no rest element, then it should imply a tuple type. + return createTupleType(elementTypes); } + // Return the type implied by a binding pattern. This is the type implied purely by the binding pattern itself + // and without regard to its context (i.e. without regard any type annotation or initializer associated with the + // declaration in which the binding pattern is contained). For example, the implied type of [x, y] is [any, any] + // and the implied type of { x, y: z = 1 } is { x: any; y: number; }. The type implied by a binding pattern is + // used as the contextual type of an initializer associated with the binding pattern. Also, for a destructuring + // parameter with no type annotation or initializer, the type implied by the binding pattern becomes the type of + // the parameter. function getTypeFromBindingPattern(pattern) { - return pattern.kind === 150 + return pattern.kind === 150 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern) : getTypeFromArrayBindingPattern(pattern); } + // Return the type associated with a variable, parameter, or property declaration. In the simple case this is the type + // specified in a type annotation or inferred from an initializer. However, in the case of a destructuring declaration it + // is a bit more involved. For example: + // + // var [x, s = ""] = [1, "one"]; + // + // Here, the array literal [1, "one"] is contextually typed by the type [any, string], which is the implied type of the + // binding pattern [x, s = ""]. Because the contextual type is a tuple type, the resulting type of [1, "one"] is the + // tuple type [number, string]. Thus, the type inferred for 'x' is number and the type inferred for 's' is string. function getWidenedTypeForVariableLikeDeclaration(declaration, reportErrors) { var type = getTypeForVariableLikeDeclaration(declaration); if (type) { if (reportErrors) { reportErrorsFromWidening(declaration, type); } - return declaration.kind !== 224 ? getWidenedType(type) : type; + // During a normal type check we'll never get to here with a property assignment (the check of the containing + // object literal uses a different path). We exclude widening only so that language services and type verification + // tools see the actual type. + return declaration.kind !== 224 /* PropertyAssignment */ ? getWidenedType(type) : type; } + // If no type was specified and nothing could be inferred, and if the declaration specifies a binding pattern, use + // the type implied by the binding pattern if (ts.isBindingPattern(declaration.name)) { return getTypeFromBindingPattern(declaration.name); } + // Rest parameters default to type any[], other parameters default to type any type = declaration.dotDotDotToken ? anyArrayType : anyType; + // Report implicit any errors unless this is a private property within an ambient declaration if (reportErrors && compilerOptions.noImplicitAny) { var root = getRootDeclaration(declaration); - if (!isPrivateWithinAmbient(root) && !(root.kind === 129 && isPrivateWithinAmbient(root.parent))) { + if (!isPrivateWithinAmbient(root) && !(root.kind === 129 /* Parameter */ && isPrivateWithinAmbient(root.parent))) { reportImplicitAnyError(declaration, type); } } @@ -10707,25 +12690,20 @@ var ts; function getTypeOfVariableOrParameterOrProperty(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - if (symbol.flags & 134217728) { + // Handle prototype property + if (symbol.flags & 134217728 /* Prototype */) { return links.type = getTypeOfPrototypeProperty(symbol); } + // Handle catch clause variables var declaration = symbol.valueDeclaration; - if (declaration.parent.kind === 223) { + if (declaration.parent.kind === 223 /* CatchClause */) { return links.type = anyType; } - 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; - } + // Handle export default expressions + if (declaration.kind === 214 /* ExportAssignment */) { + return links.type = checkExpression(declaration.expression); } + // Handle variable, parameter or property links.type = resolvingType; var type = getWidenedTypeForVariableLikeDeclaration(declaration, true); if (links.type === resolvingType) { @@ -10748,12 +12726,12 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 136) { - return accessor.type && getTypeFromTypeNodeOrHeritageClauseElement(accessor.type); + if (accessor.kind === 136 /* GetAccessor */) { + return accessor.type && getTypeFromTypeNode(accessor.type); } else { var setterTypeAnnotation = getSetAccessorTypeAnnotationNode(accessor); - return setterTypeAnnotation && getTypeFromTypeNodeOrHeritageClauseElement(setterTypeAnnotation); + return setterTypeAnnotation && getTypeFromTypeNode(setterTypeAnnotation); } } return undefined; @@ -10767,19 +12745,22 @@ var ts; links = links || getSymbolLinks(symbol); if (!links.type) { links.type = resolvingType; - var getter = ts.getDeclarationOfKind(symbol, 136); - var setter = ts.getDeclarationOfKind(symbol, 137); + var getter = ts.getDeclarationOfKind(symbol, 136 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 137 /* SetAccessor */); var type; + // First try to see if the user specified a return type on the get-accessor. var getterReturnType = getAnnotatedAccessorType(getter); if (getterReturnType) { type = getterReturnType; } else { + // If the user didn't specify a return type, try to use the set-accessor's parameter type. var setterParameterType = getAnnotatedAccessorType(setter); if (setterParameterType) { type = setterParameterType; } else { + // If there are no specified types, try to infer it from the body of the get accessor if it exists. if (getter && getter.body) { type = getReturnTypeFromBody(getter); } @@ -10798,7 +12779,7 @@ var ts; else if (links.type === resolvingType) { links.type = anyType; if (compilerOptions.noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 136); + var getter = ts.getDeclarationOfKind(symbol, 136 /* GetAccessor */); error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } @@ -10806,7 +12787,7 @@ var ts; function getTypeOfFuncClassEnumModule(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - links.type = createObjectType(32768, symbol); + links.type = createObjectType(32768 /* Anonymous */, symbol); } return links.type; } @@ -10832,40 +12813,43 @@ var ts; return links.type; } function getTypeOfSymbol(symbol) { - if (symbol.flags & 16777216) { + if (symbol.flags & 16777216 /* Instantiated */) { return getTypeOfInstantiatedSymbol(symbol); } - if (symbol.flags & (3 | 4)) { + if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) { return getTypeOfVariableOrParameterOrProperty(symbol); } - if (symbol.flags & (16 | 8192 | 32 | 384 | 512)) { + if (symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { return getTypeOfFuncClassEnumModule(symbol); } - if (symbol.flags & 8) { + if (symbol.flags & 8 /* EnumMember */) { return getTypeOfEnumMember(symbol); } - if (symbol.flags & 98304) { + if (symbol.flags & 98304 /* Accessor */) { return getTypeOfAccessors(symbol); } - if (symbol.flags & 8388608) { + if (symbol.flags & 8388608 /* Alias */) { return getTypeOfAlias(symbol); } return unknownType; } function getTargetType(type) { - return type.flags & 4096 ? type.target : type; + return type.flags & 4096 /* Reference */ ? type.target : type; } function hasBaseType(type, checkBase) { return check(type); function check(type) { var target = getTargetType(type); - return target === checkBase || ts.forEach(target.baseTypes, check); + return target === checkBase || ts.forEach(getBaseTypes(target), check); } } + // Return combined list of type parameters from all declarations of a class or interface. Elsewhere we check they're all + // the same, but even if they're not we still need the complete list to ensure instantiations supply type arguments + // for all type parameters. function getTypeParametersOfClassOrInterface(symbol) { var result; ts.forEach(symbol.declarations, function (node) { - if (node.kind === 202 || node.kind === 201) { + if (node.kind === 202 /* InterfaceDeclaration */ || node.kind === 201 /* ClassDeclaration */) { var declaration = node; if (declaration.typeParameters && declaration.typeParameters.length) { ts.forEach(declaration.typeParameters, function (node) { @@ -10882,85 +12866,106 @@ var ts; }); return result; } + function getBaseTypes(type) { + var typeWithBaseTypes = type; + if (!typeWithBaseTypes.baseTypes) { + if (type.symbol.flags & 32 /* Class */) { + resolveBaseTypesOfClass(typeWithBaseTypes); + } + else if (type.symbol.flags & 64 /* Interface */) { + resolveBaseTypesOfInterface(typeWithBaseTypes); + } + else { + ts.Debug.fail("type must be class or interface"); + } + } + return typeWithBaseTypes.baseTypes; + } + function resolveBaseTypesOfClass(type) { + type.baseTypes = []; + var declaration = ts.getDeclarationOfKind(type.symbol, 201 /* ClassDeclaration */); + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(declaration); + if (baseTypeNode) { + var baseType = getTypeFromHeritageClauseElement(baseTypeNode); + if (baseType !== unknownType) { + if (getTargetType(baseType).flags & 1024 /* Class */) { + if (type !== baseType && !hasBaseType(baseType, type)) { + type.baseTypes.push(baseType); + } + else { + error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1 /* WriteArrayAsGenericType */)); + } + } + else { + error(baseTypeNode, ts.Diagnostics.A_class_may_only_extend_another_class); + } + } + } + } + function resolveBaseTypesOfInterface(type) { + type.baseTypes = []; + for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + if (declaration.kind === 202 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { + var node = _c[_b]; + var baseType = getTypeFromHeritageClauseElement(node); + if (baseType !== unknownType) { + if (getTargetType(baseType).flags & (1024 /* Class */ | 2048 /* Interface */)) { + if (type !== baseType && !hasBaseType(baseType, type)) { + type.baseTypes.push(baseType); + } + else { + error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1 /* WriteArrayAsGenericType */)); + } + } + else { + error(node, ts.Diagnostics.An_interface_may_only_extend_a_class_or_another_interface); + } + } + } + } + } + } function getDeclaredTypeOfClass(symbol) { var links = getSymbolLinks(symbol); if (!links.declaredType) { - var type = links.declaredType = createObjectType(1024, symbol); + var type = links.declaredType = createObjectType(1024 /* Class */, symbol); var typeParameters = getTypeParametersOfClassOrInterface(symbol); if (typeParameters) { - type.flags |= 4096; + type.flags |= 4096 /* Reference */; type.typeParameters = typeParameters; type.instantiations = {}; type.instantiations[getTypeListId(type.typeParameters)] = type; type.target = type; type.typeArguments = type.typeParameters; } - type.baseTypes = []; - var declaration = ts.getDeclarationOfKind(symbol, 201); - var baseTypeNode = ts.getClassExtendsHeritageClauseElement(declaration); - if (baseTypeNode) { - var baseType = getTypeFromHeritageClauseElement(baseTypeNode); - if (baseType !== unknownType) { - if (getTargetType(baseType).flags & 1024) { - if (type !== baseType && !hasBaseType(baseType, type)) { - type.baseTypes.push(baseType); - } - else { - error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1)); - } - } - else { - error(baseTypeNode, ts.Diagnostics.A_class_may_only_extend_another_class); - } - } - } type.declaredProperties = getNamedMembers(symbol.members); type.declaredCallSignatures = emptyArray; type.declaredConstructSignatures = emptyArray; - type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0); - type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1); + type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); + type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); } return links.declaredType; } function getDeclaredTypeOfInterface(symbol) { var links = getSymbolLinks(symbol); if (!links.declaredType) { - var type = links.declaredType = createObjectType(2048, symbol); + var type = links.declaredType = createObjectType(2048 /* Interface */, symbol); var typeParameters = getTypeParametersOfClassOrInterface(symbol); if (typeParameters) { - type.flags |= 4096; + type.flags |= 4096 /* Reference */; type.typeParameters = typeParameters; type.instantiations = {}; type.instantiations[getTypeListId(type.typeParameters)] = type; type.target = type; type.typeArguments = type.typeParameters; } - type.baseTypes = []; - ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 202 && ts.getInterfaceBaseTypeNodes(declaration)) { - ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), function (node) { - var baseType = getTypeFromHeritageClauseElement(node); - if (baseType !== unknownType) { - if (getTargetType(baseType).flags & (1024 | 2048)) { - if (type !== baseType && !hasBaseType(baseType, type)) { - type.baseTypes.push(baseType); - } - else { - error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1)); - } - } - else { - error(node, ts.Diagnostics.An_interface_may_only_extend_a_class_or_another_interface); - } - } - }); - } - }); type.declaredProperties = getNamedMembers(symbol.members); type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]); type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]); - type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0); - type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1); + type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); + type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); } return links.declaredType; } @@ -10968,15 +12973,15 @@ var ts; var links = getSymbolLinks(symbol); if (!links.declaredType) { links.declaredType = resolvingType; - var declaration = ts.getDeclarationOfKind(symbol, 203); - var type = getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); + var declaration = ts.getDeclarationOfKind(symbol, 203 /* TypeAliasDeclaration */); + var type = getTypeFromTypeNode(declaration.type); if (links.declaredType === resolvingType) { links.declaredType = type; } } else if (links.declaredType === resolvingType) { links.declaredType = unknownType; - var declaration = ts.getDeclarationOfKind(symbol, 203); + var declaration = ts.getDeclarationOfKind(symbol, 203 /* TypeAliasDeclaration */); error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); } return links.declaredType; @@ -10984,7 +12989,7 @@ var ts; function getDeclaredTypeOfEnum(symbol) { var links = getSymbolLinks(symbol); if (!links.declaredType) { - var type = createType(128); + var type = createType(128 /* Enum */); type.symbol = symbol; links.declaredType = type; } @@ -10993,9 +12998,9 @@ var ts; function getDeclaredTypeOfTypeParameter(symbol) { var links = getSymbolLinks(symbol); if (!links.declaredType) { - var type = createType(512); + var type = createType(512 /* TypeParameter */); type.symbol = symbol; - if (!ts.getDeclarationOfKind(symbol, 128).constraint) { + if (!ts.getDeclarationOfKind(symbol, 128 /* TypeParameter */).constraint) { type.constraint = noConstraintType; } links.declaredType = type; @@ -11010,23 +13015,23 @@ var ts; return links.declaredType; } function getDeclaredTypeOfSymbol(symbol) { - ts.Debug.assert((symbol.flags & 16777216) === 0); - if (symbol.flags & 32) { + ts.Debug.assert((symbol.flags & 16777216 /* Instantiated */) === 0); + if (symbol.flags & 32 /* Class */) { return getDeclaredTypeOfClass(symbol); } - if (symbol.flags & 64) { + if (symbol.flags & 64 /* Interface */) { return getDeclaredTypeOfInterface(symbol); } - if (symbol.flags & 524288) { + if (symbol.flags & 524288 /* TypeAlias */) { return getDeclaredTypeOfTypeAlias(symbol); } - if (symbol.flags & 384) { + if (symbol.flags & 384 /* Enum */) { return getDeclaredTypeOfEnum(symbol); } - if (symbol.flags & 262144) { + if (symbol.flags & 262144 /* TypeParameter */) { return getDeclaredTypeOfTypeParameter(symbol); } - if (symbol.flags & 8388608) { + if (symbol.flags & 8388608 /* Alias */) { return getDeclaredTypeOfAlias(symbol); } return unknownType; @@ -11069,15 +13074,17 @@ var ts; var constructSignatures = type.declaredConstructSignatures; var stringIndexType = type.declaredStringIndexType; var numberIndexType = type.declaredNumberIndexType; - if (type.baseTypes.length) { + var baseTypes = getBaseTypes(type); + if (baseTypes.length) { members = createSymbolTable(type.declaredProperties); - ts.forEach(type.baseTypes, function (baseType) { + for (var _i = 0; _i < baseTypes.length; _i++) { + var baseType = baseTypes[_i]; addInheritedMembers(members, getPropertiesOfObjectType(baseType)); - callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(baseType, 0)); - constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(baseType, 1)); - stringIndexType = stringIndexType || getIndexTypeOfType(baseType, 0); - numberIndexType = numberIndexType || getIndexTypeOfType(baseType, 1); - }); + callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(baseType, 0 /* Call */)); + constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(baseType, 1 /* Construct */)); + stringIndexType = stringIndexType || getIndexTypeOfType(baseType, 0 /* String */); + numberIndexType = numberIndexType || getIndexTypeOfType(baseType, 1 /* Number */); + } } setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } @@ -11089,13 +13096,13 @@ var ts; var constructSignatures = instantiateList(target.declaredConstructSignatures, mapper, instantiateSignature); var stringIndexType = target.declaredStringIndexType ? instantiateType(target.declaredStringIndexType, mapper) : undefined; var numberIndexType = target.declaredNumberIndexType ? instantiateType(target.declaredNumberIndexType, mapper) : undefined; - ts.forEach(target.baseTypes, function (baseType) { + ts.forEach(getBaseTypes(target), function (baseType) { var instantiatedBaseType = instantiateType(baseType, mapper); addInheritedMembers(members, getPropertiesOfObjectType(instantiatedBaseType)); - callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, 0)); - constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, 1)); - stringIndexType = stringIndexType || getIndexTypeOfType(instantiatedBaseType, 0); - numberIndexType = numberIndexType || getIndexTypeOfType(instantiatedBaseType, 1); + callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, 0 /* Call */)); + constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, 1 /* Construct */)); + stringIndexType = stringIndexType || getIndexTypeOfType(instantiatedBaseType, 0 /* String */); + numberIndexType = numberIndexType || getIndexTypeOfType(instantiatedBaseType, 1 /* Number */); }); setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } @@ -11114,11 +13121,12 @@ var ts; return createSignature(sig.declaration, sig.typeParameters, sig.parameters, sig.resolvedReturnType, sig.minArgumentCount, sig.hasRestParameter, sig.hasStringLiterals); } function getDefaultConstructSignatures(classType) { - if (classType.baseTypes.length) { - var baseType = classType.baseTypes[0]; - var baseSignatures = getSignaturesOfType(getTypeOfSymbol(baseType.symbol), 1); + var baseTypes = getBaseTypes(classType); + if (baseTypes.length) { + var baseType = baseTypes[0]; + var baseSignatures = getSignaturesOfType(getTypeOfSymbol(baseType.symbol), 1 /* Construct */); return ts.map(baseSignatures, function (baseSignature) { - var signature = baseType.flags & 4096 ? + var signature = baseType.flags & 4096 /* Reference */ ? getSignatureInstantiation(baseSignature, baseType.typeArguments) : cloneSignature(baseSignature); signature.typeParameters = classType.typeParameters; signature.resolvedReturnType = classType; @@ -11130,7 +13138,7 @@ var ts; function createTupleTypeMemberSymbols(memberTypes) { var members = {}; for (var i = 0; i < memberTypes.length; i++) { - var symbol = createSymbol(4 | 67108864, "" + i); + var symbol = createSymbol(4 /* Property */ | 67108864 /* Transient */, "" + i); symbol.type = memberTypes[i]; members[i] = symbol; } @@ -11153,6 +13161,9 @@ var ts; } return true; } + // If the lists of call or construct signatures in the given types are all identical except for return types, + // and if none of the signatures are generic, return a list of signatures that has substitutes a union of the + // return types of the corresponding signatures in each resulting signature. function getUnionSignatures(types, kind) { var signatureLists = ts.map(types, function (t) { return getSignaturesOfType(t, kind); }); var signatures = signatureLists[0]; @@ -11170,6 +13181,7 @@ var ts; var result = ts.map(signatures, cloneSignature); for (var i = 0; i < result.length; i++) { var s = result[i]; + // Clear resolved return type we possibly got from cloneSignature s.resolvedReturnType = undefined; s.unionSignatures = ts.map(signatureLists, function (signatures) { return signatures[i]; }); } @@ -11188,10 +13200,12 @@ var ts; return getUnionType(indexTypes); } function resolveUnionTypeMembers(type) { - var callSignatures = getUnionSignatures(type.types, 0); - var constructSignatures = getUnionSignatures(type.types, 1); - var stringIndexType = getUnionIndexType(type.types, 0); - var numberIndexType = getUnionIndexType(type.types, 1); + // The members and properties collections are empty for union types. To get all properties of a union + // type use getPropertiesOfType (only the language service uses this). + var callSignatures = getUnionSignatures(type.types, 0 /* Call */); + var constructSignatures = getUnionSignatures(type.types, 1 /* Construct */); + var stringIndexType = getUnionIndexType(type.types, 0 /* String */); + var numberIndexType = getUnionIndexType(type.types, 1 /* Number */); setObjectTypeMembers(type, emptySymbols, callSignatures, constructSignatures, stringIndexType, numberIndexType); } function resolveAnonymousTypeMembers(type) { @@ -11201,51 +13215,53 @@ var ts; var constructSignatures; var stringIndexType; var numberIndexType; - if (symbol.flags & 2048) { + if (symbol.flags & 2048 /* TypeLiteral */) { members = symbol.members; callSignatures = getSignaturesOfSymbol(members["__call"]); constructSignatures = getSignaturesOfSymbol(members["__new"]); - stringIndexType = getIndexTypeOfSymbol(symbol, 0); - numberIndexType = getIndexTypeOfSymbol(symbol, 1); + stringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); + numberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); } else { + // Combinations of function, class, enum and module members = emptySymbols; callSignatures = emptyArray; constructSignatures = emptyArray; - if (symbol.flags & 1952) { + if (symbol.flags & 1952 /* HasExports */) { members = getExportsOfSymbol(symbol); } - if (symbol.flags & (16 | 8192)) { + if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) { callSignatures = getSignaturesOfSymbol(symbol); } - if (symbol.flags & 32) { + if (symbol.flags & 32 /* Class */) { var classType = getDeclaredTypeOfClass(symbol); constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); if (!constructSignatures.length) { constructSignatures = getDefaultConstructSignatures(classType); } - if (classType.baseTypes.length) { + var baseTypes = getBaseTypes(classType); + if (baseTypes.length) { members = createSymbolTable(getNamedMembers(members)); - addInheritedMembers(members, getPropertiesOfObjectType(getTypeOfSymbol(classType.baseTypes[0].symbol))); + addInheritedMembers(members, getPropertiesOfObjectType(getTypeOfSymbol(baseTypes[0].symbol))); } } stringIndexType = undefined; - numberIndexType = (symbol.flags & 384) ? stringType : undefined; + numberIndexType = (symbol.flags & 384 /* Enum */) ? stringType : undefined; } setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } function resolveObjectOrUnionTypeMembers(type) { if (!type.members) { - if (type.flags & (1024 | 2048)) { + if (type.flags & (1024 /* Class */ | 2048 /* Interface */)) { resolveClassOrInterfaceMembers(type); } - else if (type.flags & 32768) { + else if (type.flags & 32768 /* Anonymous */) { resolveAnonymousTypeMembers(type); } - else if (type.flags & 8192) { + else if (type.flags & 8192 /* Tuple */) { resolveTupleTypeMembers(type); } - else if (type.flags & 16384) { + else if (type.flags & 16384 /* Union */) { resolveUnionTypeMembers(type); } else { @@ -11254,14 +13270,17 @@ var ts; } return type; } + // Return properties of an object type or an empty array for other types function getPropertiesOfObjectType(type) { - if (type.flags & 48128) { + if (type.flags & 48128 /* ObjectType */) { return resolveObjectOrUnionTypeMembers(type).properties; } return emptyArray; } + // If the given type is an object type and that type has a property by the given name, return + // the symbol for that property. Otherwise return undefined. function getPropertyOfObjectType(type, name) { - if (type.flags & 48128) { + if (type.flags & 48128 /* ObjectType */) { var resolved = resolveObjectOrUnionTypeMembers(type); if (ts.hasProperty(resolved.members, name)) { var symbol = resolved.members[name]; @@ -11282,30 +13301,34 @@ var ts; return result; } function getPropertiesOfType(type) { - if (type.flags & 16384) { - return getPropertiesOfUnionType(type); - } - return getPropertiesOfObjectType(getApparentType(type)); + type = getApparentType(type); + return type.flags & 16384 /* Union */ ? getPropertiesOfUnionType(type) : getPropertiesOfObjectType(type); } + // For a type parameter, return the base constraint of the type parameter. For the string, number, + // boolean, and symbol primitive types, return the corresponding object types. Otherwise return the + // type itself. Note that the apparent type of a union type is the union type itself. function getApparentType(type) { - if (type.flags & 512) { + if (type.flags & 16384 /* Union */) { + type = getReducedTypeOfUnionType(type); + } + if (type.flags & 512 /* TypeParameter */) { do { type = getConstraintOfTypeParameter(type); - } while (type && type.flags & 512); + } while (type && type.flags & 512 /* TypeParameter */); if (!type) { type = emptyObjectType; } } - if (type.flags & 258) { + if (type.flags & 258 /* StringLike */) { type = globalStringType; } - else if (type.flags & 132) { + else if (type.flags & 132 /* NumberLike */) { type = globalNumberType; } - else if (type.flags & 8) { + else if (type.flags & 8 /* Boolean */) { type = globalBooleanType; } - else if (type.flags & 1048576) { + else if (type.flags & 1048576 /* ESSymbol */) { type = globalESSymbolType; } return type; @@ -11338,7 +13361,7 @@ var ts; } propTypes.push(getTypeOfSymbol(prop)); } - var result = createSymbol(4 | 67108864 | 268435456, name); + var result = createSymbol(4 /* Property */ | 67108864 /* Transient */ | 268435456 /* UnionProperty */, name); result.unionType = unionType; result.declarations = declarations; result.type = getUnionType(propTypes); @@ -11355,49 +13378,66 @@ var ts; } return property; } + // Return the symbol for the property with the given name in the given type. Creates synthetic union properties when + // necessary, maps primitive types and type parameters are to their apparent types, and augments with properties from + // Object and Function as appropriate. function getPropertyOfType(type, name) { - if (type.flags & 16384) { + type = getApparentType(type); + if (type.flags & 48128 /* ObjectType */) { + var resolved = resolveObjectOrUnionTypeMembers(type); + if (ts.hasProperty(resolved.members, name)) { + var symbol = resolved.members[name]; + if (symbolIsValue(symbol)) { + return symbol; + } + } + if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { + var symbol = getPropertyOfObjectType(globalFunctionType, name); + if (symbol) { + return symbol; + } + } + return getPropertyOfObjectType(globalObjectType, name); + } + if (type.flags & 16384 /* Union */) { return getPropertyOfUnionType(type, name); } - if (!(type.flags & 48128)) { - type = getApparentType(type); - if (!(type.flags & 48128)) { - return undefined; - } - } - var resolved = resolveObjectOrUnionTypeMembers(type); - if (ts.hasProperty(resolved.members, name)) { - var symbol = resolved.members[name]; - if (symbolIsValue(symbol)) { - return symbol; - } - } - if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { - var symbol = getPropertyOfObjectType(globalFunctionType, name); - if (symbol) - return symbol; - } - return getPropertyOfObjectType(globalObjectType, name); + return undefined; } function getSignaturesOfObjectOrUnionType(type, kind) { - if (type.flags & (48128 | 16384)) { + if (type.flags & (48128 /* ObjectType */ | 16384 /* Union */)) { var resolved = resolveObjectOrUnionTypeMembers(type); - return kind === 0 ? resolved.callSignatures : resolved.constructSignatures; + return kind === 0 /* Call */ ? resolved.callSignatures : resolved.constructSignatures; } return emptyArray; } + // Return the signatures of the given kind in the given type. Creates synthetic union signatures when necessary and + // maps primitive types and type parameters are to their apparent types. function getSignaturesOfType(type, kind) { return getSignaturesOfObjectOrUnionType(getApparentType(type), kind); } - function getIndexTypeOfObjectOrUnionType(type, kind) { - if (type.flags & (48128 | 16384)) { + function typeHasCallOrConstructSignatures(type) { + var apparentType = getApparentType(type); + if (apparentType.flags & (48128 /* ObjectType */ | 16384 /* Union */)) { var resolved = resolveObjectOrUnionTypeMembers(type); - return kind === 0 ? resolved.stringIndexType : resolved.numberIndexType; + return resolved.callSignatures.length > 0 + || resolved.constructSignatures.length > 0; + } + return false; + } + function getIndexTypeOfObjectOrUnionType(type, kind) { + if (type.flags & (48128 /* ObjectType */ | 16384 /* Union */)) { + var resolved = resolveObjectOrUnionTypeMembers(type); + return kind === 0 /* String */ ? resolved.stringIndexType : resolved.numberIndexType; } } + // Return the index type of the given kind in the given type. Creates synthetic union index types when necessary and + // maps primitive types and type parameters are to their apparent types. function getIndexTypeOfType(type, kind) { return getIndexTypeOfObjectOrUnionType(getApparentType(type), kind); } + // Return list of type parameters with duplicates removed (duplicate identifier errors are generated in the actual + // type checking functions). function getTypeParametersFromDeclaration(typeParameterDeclarations) { var result = []; ts.forEach(typeParameterDeclarations, function (node) { @@ -11417,20 +13457,10 @@ var ts; } return result; } - function getExportsOfExternalModule(node) { - if (!node.moduleSpecifier) { - return emptyArray; - } - var module = resolveExternalModuleName(node, node.moduleSpecifier); - if (!module) { - return emptyArray; - } - return symbolsToArray(getExportsOfModule(module)); - } function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { - var classType = declaration.kind === 135 ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; + var classType = declaration.kind === 135 /* Constructor */ ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; var typeParameters = classType ? classType.typeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; var parameters = []; @@ -11439,7 +13469,7 @@ var ts; for (var i = 0, n = declaration.parameters.length; i < n; i++) { var param = declaration.parameters[i]; parameters.push(param.symbol); - if (param.type && param.type.kind === 8) { + if (param.type && param.type.kind === 8 /* StringLiteral */) { hasStringLiterals = true; } if (minArgumentCount < 0) { @@ -11456,11 +13486,13 @@ var ts; returnType = classType; } else if (declaration.type) { - returnType = getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); + returnType = getTypeFromTypeNode(declaration.type); } else { - if (declaration.kind === 136 && !ts.hasDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(declaration.symbol, 137); + // TypeScript 1.0 spec (April 2014): + // If only one accessor includes a type annotation, the other behaves as if it had the same type annotation. + if (declaration.kind === 136 /* GetAccessor */ && !ts.hasDynamicName(declaration)) { + var setter = ts.getDeclarationOfKind(declaration.symbol, 137 /* SetAccessor */); returnType = getAnnotatedAccessorType(setter); } if (!returnType && ts.nodeIsMissing(declaration.body)) { @@ -11478,19 +13510,22 @@ var ts; for (var i = 0, len = symbol.declarations.length; i < len; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 142: - case 143: - case 200: - case 134: - case 133: - case 135: - case 138: - case 139: - case 140: - case 136: - case 137: - case 162: - case 163: + case 142 /* FunctionType */: + case 143 /* ConstructorType */: + case 200 /* FunctionDeclaration */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 135 /* Constructor */: + case 138 /* CallSignature */: + case 139 /* ConstructSignature */: + case 140 /* IndexSignature */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: + // Don't include signature if node is the implementation of an overloaded function. A node is considered + // an implementation node if it has a body and the previous node is of the same kind and immediately + // precedes the implementation node (i.e. has the same parent and ends where the implementation starts). if (i > 0 && node.body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { @@ -11536,7 +13571,7 @@ var ts; function getRestTypeOfSignature(signature) { if (signature.hasRestParameter) { var type = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); - if (type.flags & 4096 && type.target === globalArrayType) { + if (type.flags & 4096 /* Reference */ && type.target === globalArrayType) { return type.typeArguments[0]; } } @@ -11559,9 +13594,13 @@ var ts; return signature.erasedSignatureCache; } function getOrCreateTypeFromSignature(signature) { + // There are two ways to declare a construct signature, one is by declaring a class constructor + // using the constructor keyword, and the other is declaring a bare construct signature in an + // object type literal or interface (using the new keyword). Each way of declaring a constructor + // will result in a different declaration kind. if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 135 || signature.declaration.kind === 139; - var type = createObjectType(32768 | 65536); + var isConstructor = signature.declaration.kind === 135 /* Constructor */ || signature.declaration.kind === 139 /* ConstructSignature */; + var type = createObjectType(32768 /* Anonymous */ | 65536 /* FromSignature */); type.members = emptySymbols; type.properties = emptyArray; type.callSignatures = !isConstructor ? [signature] : emptyArray; @@ -11574,7 +13613,7 @@ var ts; return symbol.members["__index"]; } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 ? 119 : 121; + var syntaxKind = kind === 1 /* Number */ ? 119 /* NumberKeyword */ : 121 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { var len = indexSymbol.declarations.length; @@ -11594,7 +13633,7 @@ var ts; function getIndexTypeOfSymbol(symbol, kind) { var declaration = getIndexDeclarationOfSymbol(symbol, kind); return declaration - ? declaration.type ? getTypeFromTypeNodeOrHeritageClauseElement(declaration.type) : anyType + ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType : undefined; } function getConstraintOfTypeParameter(type) { @@ -11604,7 +13643,7 @@ var ts; type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNodeOrHeritageClauseElement(ts.getDeclarationOfKind(type.symbol, 128).constraint); + type.constraint = getTypeFromTypeNode(ts.getDeclarationOfKind(type.symbol, 128 /* TypeParameter */).constraint); } } return type.constraint === noConstraintType ? undefined : type.constraint; @@ -11626,19 +13665,22 @@ var ts; return result; } } + // This function is used to propagate widening flags when creating new object types references and union types. + // It is only necessary to do so if a constituent type might be the undefined type, the null type, or the type + // of an object literal (since those types have widening related information we need to track). function getWideningFlagsOfTypes(types) { var result = 0; for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; result |= type.flags; } - return result & 786432; + return result & 786432 /* RequiresWidening */; } function createTypeReference(target, typeArguments) { var id = getTypeListId(typeArguments); var type = target.instantiations[id]; if (!type) { - var flags = 4096 | getWideningFlagsOfTypes(typeArguments); + var flags = 4096 /* Reference */ | getWideningFlagsOfTypes(typeArguments); type = target.instantiations[id] = createObjectType(flags, target.symbol); type.target = target; type.typeArguments = typeArguments; @@ -11650,21 +13692,31 @@ var ts; if (links.isIllegalTypeReferenceInConstraint !== undefined) { return links.isIllegalTypeReferenceInConstraint; } + // bubble up to the declaration var currentNode = typeReferenceNode; + // forEach === exists while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { currentNode = currentNode.parent; } - links.isIllegalTypeReferenceInConstraint = currentNode.kind === 128; + // if last step was made from the type parameter this means that path has started somewhere in constraint which is illegal + links.isIllegalTypeReferenceInConstraint = currentNode.kind === 128 /* TypeParameter */; return links.isIllegalTypeReferenceInConstraint; } function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) { var typeParameterSymbol; function check(n) { - if (n.kind === 141 && n.typeName.kind === 65) { + if (n.kind === 141 /* TypeReference */ && n.typeName.kind === 65 /* Identifier */) { var links = getNodeLinks(n); if (links.isIllegalTypeReferenceInConstraint === undefined) { - var symbol = resolveName(typeParameter, n.typeName.text, 793056, undefined, undefined); - if (symbol && (symbol.flags & 262144)) { + var symbol = resolveName(typeParameter, n.typeName.text, 793056 /* Type */, undefined, undefined); + if (symbol && (symbol.flags & 262144 /* TypeParameter */)) { + // 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 + // symbol.declaration.parent === typeParameter.parent + // -> typeParameter and symbol.declaration originate from the same type parameter list + // -> illegal for all declarations in symbol + // forEach === exists links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { return d.parent == typeParameter.parent; }); } } @@ -11689,24 +13741,30 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedType) { var type; - if (node.kind !== 177 || ts.isSupportedHeritageClauseElement(node)) { - var typeNameOrExpression = node.kind === 141 + // We don't currently support heritage clauses with complex expressions in them. + // For these cases, we just set the type to be the unknownType. + if (node.kind !== 177 /* HeritageClauseElement */ || ts.isSupportedHeritageClauseElement(node)) { + var typeNameOrExpression = node.kind === 141 /* TypeReference */ ? node.typeName : node.expression; - var symbol = resolveEntityName(typeNameOrExpression, 793056); + var symbol = resolveEntityName(typeNameOrExpression, 793056 /* Type */); if (symbol) { - if ((symbol.flags & 262144) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { + if ((symbol.flags & 262144 /* 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 & (1024 | 2048) && type.flags & 4096) { + if (type.flags & (1024 /* Class */ | 2048 /* Interface */) && type.flags & 4096 /* Reference */) { var typeParameters = type.typeParameters; if (node.typeArguments && node.typeArguments.length === typeParameters.length) { - type = createTypeReference(type, ts.map(node.typeArguments, getTypeFromTypeNodeOrHeritageClauseElement)); + 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); + error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, undefined, 1 /* WriteArrayAsGenericType */), typeParameters.length); type = undefined; } } @@ -11726,6 +13784,10 @@ var ts; function getTypeFromTypeQueryNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { + // TypeScript 1.0 spec (April 2014): 3.6.3 + // The expression is processed as an identifier expression (section 4.3) + // or property access expression(section 4.10), + // the widened type(section 3.9) of which becomes the result. links.resolvedType = getWidenedType(checkExpressionOrQualifiedName(node.exprName)); } return links.resolvedType; @@ -11736,9 +13798,9 @@ var ts; for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; switch (declaration.kind) { - case 201: - case 202: - case 204: + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + case 204 /* EnumDeclaration */: return declaration; } } @@ -11747,7 +13809,7 @@ var ts; return emptyObjectType; } var type = getDeclaredTypeOfSymbol(symbol); - if (!(type.flags & 48128)) { + if (!(type.flags & 48128 /* ObjectType */)) { error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_be_a_class_or_interface_type, symbol.name); return emptyObjectType; } @@ -11758,10 +13820,10 @@ var ts; return type; } function getGlobalValueSymbol(name) { - return getGlobalSymbol(name, 107455, ts.Diagnostics.Cannot_find_global_value_0); + return getGlobalSymbol(name, 107455 /* Value */, ts.Diagnostics.Cannot_find_global_value_0); } function getGlobalTypeSymbol(name) { - return getGlobalSymbol(name, 793056, ts.Diagnostics.Cannot_find_global_type_0); + return getGlobalSymbol(name, 793056 /* Type */, ts.Diagnostics.Cannot_find_global_type_0); } function getGlobalSymbol(name, meaning, diagnostic) { return resolveName(undefined, name, meaning, diagnostic, name); @@ -11773,14 +13835,20 @@ var ts; function getGlobalESSymbolConstructorSymbol() { return globalESSymbolConstructorSymbol || (globalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol")); } + function createIterableType(elementType) { + return globalIterableType !== emptyObjectType ? createTypeReference(globalIterableType, [elementType]) : emptyObjectType; + } function createArrayType(elementType) { + // globalArrayType will be undefined if we get here during creation of the Array type. This for example happens if + // user code augments the Array type with call or construct signatures that have an array type as the return type. + // We instead use globalArraySymbol to obtain the (not yet fully constructed) Array type. var arrayType = globalArrayType || getDeclaredTypeOfSymbol(globalArraySymbol); return arrayType !== emptyObjectType ? createTypeReference(arrayType, [elementType]) : emptyObjectType; } function getTypeFromArrayTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createArrayType(getTypeFromTypeNodeOrHeritageClauseElement(node.elementType)); + links.resolvedType = createArrayType(getTypeFromTypeNode(node.elementType)); } return links.resolvedType; } @@ -11788,7 +13856,7 @@ var ts; var id = getTypeListId(elementTypes); var type = tupleTypes[id]; if (!type) { - type = tupleTypes[id] = createObjectType(8192); + type = tupleTypes[id] = createObjectType(8192 /* Tuple */); type.elementTypes = elementTypes; } return type; @@ -11796,12 +13864,12 @@ var ts; function getTypeFromTupleTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createTupleType(ts.map(node.elementTypes, getTypeFromTypeNodeOrHeritageClauseElement)); + links.resolvedType = createTupleType(ts.map(node.elementTypes, getTypeFromTypeNode)); } return links.resolvedType; } function addTypeToSortedSet(sortedSet, type) { - if (type.flags & 16384) { + if (type.flags & 16384 /* Union */) { addTypesToSortedSet(sortedSet, type.types); } else { @@ -11842,7 +13910,7 @@ var ts; function containsAnyType(types) { for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; - if (type.flags & 1) { + if (type.flags & 1 /* Any */) { return true; } } @@ -11857,6 +13925,10 @@ var ts; } } } + // The noSubtypeReduction flag is there because it isn't possible to always do subtype reduction. The flag + // is true when creating a union type from a type node and when instantiating a union type. In both of those + // cases subtype reduction has to be deferred to properly support recursive union types. For example, a + // type alias of the form "type Item = string | (() => Item)" cannot be reduced during its declaration. function getUnionType(types, noSubtypeReduction) { if (types.length === 0) { return emptyObjectType; @@ -11879,22 +13951,31 @@ var ts; var id = getTypeListId(sortedTypes); var type = unionTypes[id]; if (!type) { - type = unionTypes[id] = createObjectType(16384 | getWideningFlagsOfTypes(sortedTypes)); + type = unionTypes[id] = createObjectType(16384 /* Union */ | getWideningFlagsOfTypes(sortedTypes)); type.types = sortedTypes; + type.reducedType = noSubtypeReduction ? undefined : type; } return type; } + function getReducedTypeOfUnionType(type) { + // If union type was created without subtype reduction, perform the deferred reduction now + if (!type.reducedType) { + type.reducedType = getUnionType(type.types, false); + } + return type.reducedType; + } function getTypeFromUnionTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNodeOrHeritageClauseElement), true); + links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNode), true); } return links.resolvedType; } function getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createObjectType(32768, node.symbol); + // Deferred resolution of members is handled by resolveObjectTypeMembers + links.resolvedType = createObjectType(32768 /* Anonymous */, node.symbol); } return links.resolvedType; } @@ -11902,7 +13983,7 @@ var ts; if (ts.hasProperty(stringLiteralTypes, node.text)) { return stringLiteralTypes[node.text]; } - var type = stringLiteralTypes[node.text] = createType(256); + var type = stringLiteralTypes[node.text] = createType(256 /* StringLiteral */); type.text = ts.getTextOfNode(node); return type; } @@ -11913,42 +13994,44 @@ var ts; } return links.resolvedType; } - function getTypeFromTypeNodeOrHeritageClauseElement(node) { + function getTypeFromTypeNode(node) { switch (node.kind) { - case 112: + case 112 /* AnyKeyword */: return anyType; - case 121: + case 121 /* StringKeyword */: return stringType; - case 119: + case 119 /* NumberKeyword */: return numberType; - case 113: + case 113 /* BooleanKeyword */: return booleanType; - case 122: + case 122 /* SymbolKeyword */: return esSymbolType; - case 99: + case 99 /* VoidKeyword */: return voidType; - case 8: + case 8 /* StringLiteral */: return getTypeFromStringLiteral(node); - case 141: + case 141 /* TypeReference */: return getTypeFromTypeReference(node); - case 177: + case 177 /* HeritageClauseElement */: return getTypeFromHeritageClauseElement(node); - case 144: + case 144 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 146: + case 146 /* ArrayType */: return getTypeFromArrayTypeNode(node); - case 147: + case 147 /* TupleType */: return getTypeFromTupleTypeNode(node); - case 148: + case 148 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 149: - return getTypeFromTypeNodeOrHeritageClauseElement(node.type); - case 142: - case 143: - case 145: + case 149 /* ParenthesizedType */: + return getTypeFromTypeNode(node.type); + case 142 /* FunctionType */: + case 143 /* ConstructorType */: + case 145 /* TypeLiteral */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 65: - case 126: + // This function assumes that an identifier or qualified name is a type expression + // Callers should first ensure this by calling isTypeNode + case 65 /* Identifier */: + case 126 /* QualifiedName */: var symbol = getSymbolInfo(node); return symbol && getDeclaredTypeOfSymbol(symbol); default: @@ -12025,7 +14108,7 @@ var ts; return function (t) { return mapper2(mapper1(t)); }; } function instantiateTypeParameter(typeParameter, mapper) { - var result = createType(512); + var result = createType(512 /* TypeParameter */); result.symbol = typeParameter.symbol; if (typeParameter.constraint) { result.constraint = instantiateType(typeParameter.constraint, mapper); @@ -12048,12 +14131,17 @@ var ts; return result; } function instantiateSymbol(symbol, mapper) { - if (symbol.flags & 16777216) { + if (symbol.flags & 16777216 /* Instantiated */) { var links = getSymbolLinks(symbol); + // If symbol being instantiated is itself a instantiation, fetch the original target and combine the + // type mappers. This ensures that original type identities are properly preserved and that aliases + // always reference a non-aliases. symbol = links.target; mapper = combineTypeMappers(links.mapper, mapper); } - var result = createSymbol(16777216 | 67108864 | symbol.flags, symbol.name); + // Keep the flags from the symbol we're instantiating. Mark that is instantiated, and + // also transient so that we can just store data on it directly. + var result = createSymbol(16777216 /* Instantiated */ | 67108864 /* Transient */ | symbol.flags, symbol.name); result.declarations = symbol.declarations; result.parent = symbol.parent; result.target = symbol; @@ -12064,13 +14152,13 @@ var ts; return result; } function instantiateAnonymousType(type, mapper) { - var result = createObjectType(32768, type.symbol); + var result = createObjectType(32768 /* Anonymous */, type.symbol); result.properties = instantiateList(getPropertiesOfObjectType(type), mapper, instantiateSymbol); result.members = createSymbolTable(result.properties); - result.callSignatures = instantiateList(getSignaturesOfType(type, 0), mapper, instantiateSignature); - result.constructSignatures = instantiateList(getSignaturesOfType(type, 1), mapper, instantiateSignature); - var stringIndexType = getIndexTypeOfType(type, 0); - var numberIndexType = getIndexTypeOfType(type, 1); + result.callSignatures = instantiateList(getSignaturesOfType(type, 0 /* Call */), mapper, instantiateSignature); + result.constructSignatures = instantiateList(getSignaturesOfType(type, 1 /* Construct */), mapper, instantiateSignature); + var stringIndexType = getIndexTypeOfType(type, 0 /* String */); + var numberIndexType = getIndexTypeOfType(type, 1 /* Number */); if (stringIndexType) result.stringIndexType = instantiateType(stringIndexType, mapper); if (numberIndexType) @@ -12079,47 +14167,49 @@ var ts; } function instantiateType(type, mapper) { if (mapper !== identityMapper) { - if (type.flags & 512) { + if (type.flags & 512 /* TypeParameter */) { return mapper(type); } - if (type.flags & 32768) { - return type.symbol && type.symbol.flags & (16 | 8192 | 2048 | 4096) ? + if (type.flags & 32768 /* Anonymous */) { + return type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) ? instantiateAnonymousType(type, mapper) : type; } - if (type.flags & 4096) { + if (type.flags & 4096 /* Reference */) { return createTypeReference(type.target, instantiateList(type.typeArguments, mapper, instantiateType)); } - if (type.flags & 8192) { + if (type.flags & 8192 /* Tuple */) { return createTupleType(instantiateList(type.elementTypes, mapper, instantiateType)); } - if (type.flags & 16384) { + if (type.flags & 16384 /* Union */) { return getUnionType(instantiateList(type.types, mapper, instantiateType), true); } } return type; } + // Returns true if the given expression contains (at any level of nesting) a function or arrow expression + // that is subject to contextual typing. function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 134 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 162: - case 163: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: return isContextSensitiveFunctionLikeDeclaration(node); - case 154: + case 154 /* ObjectLiteralExpression */: return ts.forEach(node.properties, isContextSensitive); - case 153: + case 153 /* ArrayLiteralExpression */: return ts.forEach(node.elements, isContextSensitive); - case 170: + case 170 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 169: - return node.operatorToken.kind === 49 && + case 169 /* BinaryExpression */: + return node.operatorToken.kind === 49 /* BarBarToken */ && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 224: + case 224 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 134: - case 133: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: return isContextSensitiveFunctionLikeDeclaration(node); - case 161: + case 161 /* ParenthesizedExpression */: return isContextSensitive(node.expression); } return false; @@ -12128,10 +14218,10 @@ var ts; return !node.typeParameters && node.parameters.length && !ts.forEach(node.parameters, function (p) { return p.type; }); } function getTypeWithoutConstructors(type) { - if (type.flags & 48128) { + if (type.flags & 48128 /* ObjectType */) { var resolved = resolveObjectOrUnionTypeMembers(type); if (resolved.constructSignatures.length) { - var result = createObjectType(32768, type.symbol); + var result = createObjectType(32768 /* Anonymous */, type.symbol); result.members = resolved.members; result.properties = resolved.properties; result.callSignatures = resolved.callSignatures; @@ -12141,6 +14231,7 @@ var ts; } return type; } + // TYPE CHECKING var subtypeRelation = {}; var assignableRelation = {}; var identityRelation = {}; @@ -12148,7 +14239,7 @@ var ts; return checkTypeRelatedTo(source, target, identityRelation, undefined); } function compareTypes(source, target) { - return checkTypeRelatedTo(source, target, identityRelation, undefined) ? -1 : 0; + return checkTypeRelatedTo(source, target, identityRelation, undefined) ? -1 /* True */ : 0 /* False */; } function isTypeSubtypeOf(source, target) { return checkTypeSubtypeOf(source, target, undefined); @@ -12182,6 +14273,10 @@ var ts; error(errorNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); } else if (errorInfo) { + // If we already computed this relation, but in a context where we didn't want to report errors (e.g. overload resolution), + // then we'll only have a top-level error (e.g. 'Class X does not implement interface Y') without any details. If this happened, + // request a recompuation to get a complete error message. This will be skipped if we've already done this computation in a context + // where errors were being reported. if (errorInfo.next === undefined) { errorInfo = undefined; elaborateErrors = true; @@ -12192,42 +14287,48 @@ var ts; } diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo)); } - return result !== 0; + return result !== 0 /* False */; function reportError(message, arg0, arg1, arg2) { errorInfo = ts.chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2); } + // Compare two types and return + // Ternary.True if they are related with no assumptions, + // Ternary.Maybe if they are related with assumptions of other relationships, or + // Ternary.False if they are not related. function isRelatedTo(source, target, reportErrors, headMessage) { var result; + // both types are the same - covers 'they are the same primitive type or both are Any' or the same type parameter cases if (source === target) - return -1; + return -1 /* True */; if (relation !== identityRelation) { - if (target.flags & 1) - return -1; + if (target.flags & 1 /* Any */) + return -1 /* True */; if (source === undefinedType) - return -1; + return -1 /* True */; if (source === nullType && target !== undefinedType) - return -1; - if (source.flags & 128 && target === numberType) - return -1; - if (source.flags & 256 && target === stringType) - return -1; + return -1 /* True */; + if (source.flags & 128 /* Enum */ && target === numberType) + return -1 /* True */; + if (source.flags & 256 /* StringLiteral */ && target === stringType) + return -1 /* True */; if (relation === assignableRelation) { - if (source.flags & 1) - return -1; - if (source === numberType && target.flags & 128) - return -1; + if (source.flags & 1 /* Any */) + return -1 /* True */; + if (source === numberType && target.flags & 128 /* Enum */) + return -1 /* True */; } } - if (source.flags & 16384 || target.flags & 16384) { + var saveErrorInfo = errorInfo; + if (source.flags & 16384 /* Union */ || target.flags & 16384 /* Union */) { if (relation === identityRelation) { - if (source.flags & 16384 && target.flags & 16384) { + if (source.flags & 16384 /* Union */ && target.flags & 16384 /* Union */) { if (result = unionTypeRelatedToUnionType(source, target)) { if (result &= unionTypeRelatedToUnionType(target, source)) { return result; } } } - else if (source.flags & 16384) { + else if (source.flags & 16384 /* Union */) { if (result = unionTypeRelatedToType(source, target, reportErrors)) { return result; } @@ -12239,7 +14340,7 @@ var ts; } } else { - if (source.flags & 16384) { + if (source.flags & 16384 /* Union */) { if (result = unionTypeRelatedToType(source, target, reportErrors)) { return result; } @@ -12251,46 +14352,57 @@ var ts; } } } - else if (source.flags & 512 && target.flags & 512) { + else if (source.flags & 512 /* TypeParameter */ && target.flags & 512 /* TypeParameter */) { 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; - } + else if (source.flags & 4096 /* Reference */ && target.flags & 4096 /* Reference */ && source.target === target.target) { + // We have type references to same target type, see if relationship holds for all type arguments + 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))) { + } + // Even if relationship doesn't hold for unions, type parameters, or generic type references, + // it may hold in a structural comparison. + // Report structural errors only if we haven't reported any errors yet + var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; + // identity relation does not use apparent type + var sourceOrApparentType = relation === identityRelation ? source : getApparentType(source); + if (sourceOrApparentType.flags & 48128 /* ObjectType */ && target.flags & 48128 /* ObjectType */) { + if (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors)) { errorInfo = saveErrorInfo; return result; } } + else if (source.flags & 512 /* TypeParameter */ && sourceOrApparentType.flags & 16384 /* Union */) { + // We clear the errors first because the following check often gives a better error than + // the union comparison above if it is applicable. + errorInfo = saveErrorInfo; + if (result = isRelatedTo(sourceOrApparentType, target, reportErrors)) { + return result; + } + } if (reportErrors) { headMessage = headMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1; var sourceType = typeToString(source); var targetType = typeToString(target); if (sourceType === targetType) { - sourceType = typeToString(source, undefined, 128); - targetType = typeToString(target, undefined, 128); + sourceType = typeToString(source, undefined, 128 /* UseFullyQualifiedType */); + targetType = typeToString(target, undefined, 128 /* UseFullyQualifiedType */); } reportError(headMessage, sourceType, targetType); } - return 0; + return 0 /* False */; } function unionTypeRelatedToUnionType(source, target) { - var result = -1; + var result = -1 /* True */; var sourceTypes = source.types; for (var _i = 0; _i < sourceTypes.length; _i++) { var sourceType = sourceTypes[_i]; var related = typeRelatedToUnionType(sourceType, target, false); if (!related) { - return 0; + return 0 /* False */; } result &= related; } @@ -12304,27 +14416,27 @@ var ts; return related; } } - return 0; + return 0 /* False */; } function unionTypeRelatedToType(source, target, reportErrors) { - var result = -1; + var result = -1 /* True */; var sourceTypes = source.types; for (var _i = 0; _i < sourceTypes.length; _i++) { var sourceType = sourceTypes[_i]; var related = isRelatedTo(sourceType, target, reportErrors); if (!related) { - return 0; + return 0 /* False */; } result &= related; } return result; } function typesRelatedTo(sources, targets, reportErrors) { - var result = -1; + var result = -1 /* True */; for (var i = 0, len = sources.length; i < len; i++) { var related = isRelatedTo(sources[i], targets[i], reportErrors); if (!related) { - return 0; + return 0 /* False */; } result &= related; } @@ -12333,13 +14445,14 @@ var ts; function typeParameterRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { if (source.symbol.name !== target.symbol.name) { - return 0; + return 0 /* False */; } + // covers case when both type parameters does not have constraint (both equal to noConstraintType) if (source.constraint === target.constraint) { - return -1; + return -1 /* True */; } if (source.constraint === noConstraintType || target.constraint === noConstraintType) { - return 0; + return 0 /* False */; } return isRelatedTo(source.constraint, target.constraint, reportErrors); } @@ -12347,34 +14460,43 @@ var ts; while (true) { var constraint = getConstraintOfTypeParameter(source); if (constraint === target) - return -1; - if (!(constraint && constraint.flags & 512)) + return -1 /* True */; + if (!(constraint && constraint.flags & 512 /* TypeParameter */)) break; source = constraint; } - return 0; + return 0 /* False */; } } + // Determine if two object types are related by structure. First, check if the result is already available in the global cache. + // Second, check if we have already started a comparison of the given two types in which case we assume the result to be true. + // Third, check if both types are part of deeply nested chains of generic type instantiations and if so assume the types are + // equal and infinitely expanding. Fourth, if we have reached a depth of 100 nested comparisons, assume we have runaway recursion + // and issue an error. Otherwise, actually compare the structure of the two types. function objectTypeRelatedTo(source, target, reportErrors) { if (overflow) { - return 0; + return 0 /* False */; } var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; var related = relation[id]; + //let related: RelationComparisonResult = undefined; // relation[id]; if (related !== undefined) { - if (!elaborateErrors || (related === 3)) { - return related === 1 ? -1 : 0; + // If we computed this relation already and it was failed and reported, or if we're not being asked to elaborate + // errors, we can use the cached value. Otherwise, recompute the relation + if (!elaborateErrors || (related === 3 /* FailedAndReported */)) { + return related === 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */; } } if (depth > 0) { for (var i = 0; i < depth; i++) { + // If source and target are already being compared, consider them related with assumptions if (maybeStack[i][id]) { - return 1; + return 1 /* Maybe */; } } if (depth === 100) { overflow = true; - return 0; + return 0 /* False */; } } else { @@ -12386,7 +14508,7 @@ var ts; sourceStack[depth] = source; targetStack[depth] = target; maybeStack[depth] = {}; - maybeStack[depth][id] = 1; + maybeStack[depth][id] = 1 /* Succeeded */; depth++; var saveExpandingFlags = expandingFlags; if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack)) @@ -12395,14 +14517,14 @@ var ts; expandingFlags |= 2; var result; if (expandingFlags === 3) { - result = 1; + result = 1 /* Maybe */; } else { result = propertiesRelatedTo(source, target, reportErrors); if (result) { - result &= signaturesRelatedTo(source, target, 0, reportErrors); + result &= signaturesRelatedTo(source, target, 0 /* Call */, reportErrors); if (result) { - result &= signaturesRelatedTo(source, target, 1, reportErrors); + result &= signaturesRelatedTo(source, target, 1 /* Construct */, reportErrors); if (result) { result &= stringIndexTypesRelatedTo(source, target, reportErrors); if (result) { @@ -12416,21 +14538,29 @@ var ts; depth--; if (result) { var maybeCache = maybeStack[depth]; - var destinationCache = (result === -1 || depth === 0) ? relation : maybeStack[depth - 1]; + // If result is definitely true, copy assumptions to global cache, else copy to next level up + var destinationCache = (result === -1 /* True */ || depth === 0) ? relation : maybeStack[depth - 1]; ts.copyMap(maybeCache, destinationCache); } else { - relation[id] = reportErrors ? 3 : 2; + // A false result goes straight into global cache (when something is false under assumptions it + // will also be false without assumptions) + relation[id] = reportErrors ? 3 /* FailedAndReported */ : 2 /* Failed */; } return result; } + // Return true if the given type is part of a deeply nested chain of generic instantiations. We consider this to be the case + // when structural type comparisons have been started for 10 or more instantiations of the same generic type. It is possible, + // though highly unlikely, for this test to be true in a situation where a chain of instantiations is not infinitely expanding. + // Effectively, we will generate a false positive when two types are structurally equal to at least 10 levels, but unequal at + // some level beyond that. function isDeeplyNestedGeneric(type, stack) { - if (type.flags & 4096 && depth >= 10) { + if (type.flags & 4096 /* Reference */ && depth >= 10) { 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_1) { + if (t.flags & 4096 /* Reference */ && t.target === target_1) { count++; if (count >= 10) return true; @@ -12443,67 +14573,74 @@ var ts; if (relation === identityRelation) { return propertiesIdenticalTo(source, target); } - var result = -1; + var result = -1 /* True */; var properties = getPropertiesOfObjectType(target); - var requireOptionalProperties = relation === subtypeRelation && !(source.flags & 131072); + var requireOptionalProperties = relation === subtypeRelation && !(source.flags & 131072 /* ObjectLiteral */); for (var _i = 0; _i < properties.length; _i++) { var targetProp = properties[_i]; var sourceProp = getPropertyOfType(source, targetProp.name); if (sourceProp !== targetProp) { if (!sourceProp) { - if (!(targetProp.flags & 536870912) || requireOptionalProperties) { + if (!(targetProp.flags & 536870912 /* Optional */) || requireOptionalProperties) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source)); } - return 0; + return 0 /* False */; } } - else if (!(targetProp.flags & 134217728)) { + else if (!(targetProp.flags & 134217728 /* Prototype */)) { var sourceFlags = getDeclarationFlagsFromSymbol(sourceProp); var targetFlags = getDeclarationFlagsFromSymbol(targetProp); - if (sourceFlags & 32 || targetFlags & 32) { + if (sourceFlags & 32 /* Private */ || targetFlags & 32 /* Private */) { if (sourceProp.valueDeclaration !== targetProp.valueDeclaration) { if (reportErrors) { - if (sourceFlags & 32 && targetFlags & 32) { + if (sourceFlags & 32 /* Private */ && targetFlags & 32 /* Private */) { reportError(ts.Diagnostics.Types_have_separate_declarations_of_a_private_property_0, symbolToString(targetProp)); } else { - reportError(ts.Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString(targetProp), typeToString(sourceFlags & 32 ? source : target), typeToString(sourceFlags & 32 ? target : source)); + reportError(ts.Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString(targetProp), typeToString(sourceFlags & 32 /* Private */ ? source : target), typeToString(sourceFlags & 32 /* Private */ ? target : source)); } } - return 0; + return 0 /* False */; } } - else if (targetFlags & 64) { - var sourceDeclaredInClass = sourceProp.parent && sourceProp.parent.flags & 32; + else if (targetFlags & 64 /* Protected */) { + var sourceDeclaredInClass = sourceProp.parent && sourceProp.parent.flags & 32 /* Class */; var sourceClass = sourceDeclaredInClass ? getDeclaredTypeOfSymbol(sourceProp.parent) : undefined; var targetClass = getDeclaredTypeOfSymbol(targetProp.parent); if (!sourceClass || !hasBaseType(sourceClass, targetClass)) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(sourceClass || source), typeToString(targetClass)); } - return 0; + return 0 /* False */; } } - else if (sourceFlags & 64) { + else if (sourceFlags & 64 /* Protected */) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); } - return 0; + return 0 /* False */; } var related = isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); if (!related) { if (reportErrors) { reportError(ts.Diagnostics.Types_of_property_0_are_incompatible, symbolToString(targetProp)); } - return 0; + return 0 /* False */; } result &= related; - if (sourceProp.flags & 536870912 && !(targetProp.flags & 536870912)) { + if (sourceProp.flags & 536870912 /* Optional */ && !(targetProp.flags & 536870912 /* Optional */)) { + // TypeScript 1.0 spec (April 2014): 3.8.3 + // S is a subtype of a type T, and T is a supertype of S if ... + // S' and T are object types and, for each member M in T.. + // M is a property and S' contains a property N where + // if M is a required property, N is also a required property + // (M - property in T) + // (N - property in S) if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); } - return 0; + return 0 /* False */; } } } @@ -12514,18 +14651,18 @@ var ts; var sourceProperties = getPropertiesOfObjectType(source); var targetProperties = getPropertiesOfObjectType(target); if (sourceProperties.length !== targetProperties.length) { - return 0; + return 0 /* False */; } - var result = -1; + var result = -1 /* True */; for (var _i = 0; _i < sourceProperties.length; _i++) { var sourceProp = sourceProperties[_i]; var targetProp = getPropertyOfObjectType(target, sourceProp.name); if (!targetProp) { - return 0; + return 0 /* False */; } var related = compareProperties(sourceProp, targetProp, isRelatedTo); if (!related) { - return 0; + return 0 /* False */; } result &= related; } @@ -12536,39 +14673,40 @@ var ts; return signaturesIdenticalTo(source, target, kind); } if (target === anyFunctionType || source === anyFunctionType) { - return -1; + return -1 /* True */; } var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); - var result = -1; + var result = -1 /* True */; var saveErrorInfo = errorInfo; outer: for (var _i = 0; _i < targetSignatures.length; _i++) { var t = targetSignatures[_i]; - if (!t.hasStringLiterals || target.flags & 65536) { + if (!t.hasStringLiterals || target.flags & 65536 /* FromSignature */) { var localErrors = reportErrors; for (var _a = 0; _a < sourceSignatures.length; _a++) { var s = sourceSignatures[_a]; - if (!s.hasStringLiterals || source.flags & 65536) { + if (!s.hasStringLiterals || source.flags & 65536 /* FromSignature */) { var related = signatureRelatedTo(s, t, localErrors); if (related) { result &= related; errorInfo = saveErrorInfo; continue outer; } + // Only report errors from the first failure localErrors = false; } } - return 0; + return 0 /* False */; } } return result; } function signatureRelatedTo(source, target, reportErrors) { if (source === target) { - return -1; + return -1 /* True */; } if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { - return 0; + return 0 /* False */; } var sourceMax = source.parameters.length; var targetMax = target.parameters.length; @@ -12589,9 +14727,11 @@ var ts; else { checkCount = sourceMax < targetMax ? sourceMax : targetMax; } + // Spec 1.0 Section 3.8.3 & 3.8.4: + // M and N (the signatures) are instantiated using type Any as the type argument for all type parameters declared by M and N source = getErasedSignature(source); target = getErasedSignature(target); - var result = -1; + var result = -1 /* True */; for (var i = 0; i < checkCount; i++) { var s_1 = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); var t_1 = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); @@ -12603,7 +14743,7 @@ var ts; if (reportErrors) { reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); } - return 0; + return 0 /* False */; } errorInfo = saveErrorInfo; } @@ -12619,13 +14759,13 @@ var ts; var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); if (sourceSignatures.length !== targetSignatures.length) { - return 0; + return 0 /* False */; } - var result = -1; + var result = -1 /* True */; for (var i = 0, len = sourceSignatures.length; i < len; ++i) { var related = compareSignatures(sourceSignatures[i], targetSignatures[i], true, isRelatedTo); if (!related) { - return 0; + return 0 /* False */; } result &= related; } @@ -12633,44 +14773,45 @@ var ts; } function stringIndexTypesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { - return indexTypesIdenticalTo(0, source, target); + return indexTypesIdenticalTo(0 /* String */, source, target); } - var targetType = getIndexTypeOfType(target, 0); + var targetType = getIndexTypeOfType(target, 0 /* String */); if (targetType) { - var sourceType = getIndexTypeOfType(source, 0); + var sourceType = getIndexTypeOfType(source, 0 /* String */); if (!sourceType) { if (reportErrors) { reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); } - return 0; + return 0 /* False */; } var related = isRelatedTo(sourceType, targetType, reportErrors); if (!related) { if (reportErrors) { reportError(ts.Diagnostics.Index_signatures_are_incompatible); } - return 0; + return 0 /* False */; } return related; } - return -1; + return -1 /* True */; } function numberIndexTypesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { - return indexTypesIdenticalTo(1, source, target); + return indexTypesIdenticalTo(1 /* Number */, source, target); } - var targetType = getIndexTypeOfType(target, 1); + var targetType = getIndexTypeOfType(target, 1 /* Number */); if (targetType) { - var sourceStringType = getIndexTypeOfType(source, 0); - var sourceNumberType = getIndexTypeOfType(source, 1); + var sourceStringType = getIndexTypeOfType(source, 0 /* String */); + var sourceNumberType = getIndexTypeOfType(source, 1 /* Number */); if (!(sourceStringType || sourceNumberType)) { if (reportErrors) { reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); } - return 0; + return 0 /* False */; } var related; if (sourceStringType && sourceNumberType) { + // If we know for sure we're testing both string and numeric index types then only report errors from the second one related = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); } else { @@ -12680,73 +14821,78 @@ var ts; if (reportErrors) { reportError(ts.Diagnostics.Index_signatures_are_incompatible); } - return 0; + return 0 /* False */; } return related; } - return -1; + return -1 /* True */; } function indexTypesIdenticalTo(indexKind, source, target) { var targetType = getIndexTypeOfType(target, indexKind); var sourceType = getIndexTypeOfType(source, indexKind); if (!sourceType && !targetType) { - return -1; + return -1 /* True */; } if (sourceType && targetType) { return isRelatedTo(sourceType, targetType); } - return 0; + return 0 /* False */; } } function isPropertyIdenticalTo(sourceProp, targetProp) { - return compareProperties(sourceProp, targetProp, compareTypes) !== 0; + return compareProperties(sourceProp, targetProp, compareTypes) !== 0 /* False */; } function compareProperties(sourceProp, targetProp, compareTypes) { + // Two members are considered identical when + // - they are public properties with identical names, optionality, and types, + // - they are private or protected properties originating in the same declaration and having identical types if (sourceProp === targetProp) { - return -1; + return -1 /* True */; } - var sourcePropAccessibility = getDeclarationFlagsFromSymbol(sourceProp) & (32 | 64); - var targetPropAccessibility = getDeclarationFlagsFromSymbol(targetProp) & (32 | 64); + var sourcePropAccessibility = getDeclarationFlagsFromSymbol(sourceProp) & (32 /* Private */ | 64 /* Protected */); + var targetPropAccessibility = getDeclarationFlagsFromSymbol(targetProp) & (32 /* Private */ | 64 /* Protected */); if (sourcePropAccessibility !== targetPropAccessibility) { - return 0; + return 0 /* False */; } if (sourcePropAccessibility) { if (getTargetSymbol(sourceProp) !== getTargetSymbol(targetProp)) { - return 0; + return 0 /* False */; } } else { - if ((sourceProp.flags & 536870912) !== (targetProp.flags & 536870912)) { - return 0; + if ((sourceProp.flags & 536870912 /* Optional */) !== (targetProp.flags & 536870912 /* Optional */)) { + return 0 /* False */; } } return compareTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); } function compareSignatures(source, target, compareReturnTypes, compareTypes) { if (source === target) { - return -1; + return -1 /* True */; } if (source.parameters.length !== target.parameters.length || source.minArgumentCount !== target.minArgumentCount || source.hasRestParameter !== target.hasRestParameter) { - return 0; + return 0 /* False */; } - var result = -1; + var result = -1 /* True */; if (source.typeParameters && target.typeParameters) { if (source.typeParameters.length !== target.typeParameters.length) { - return 0; + return 0 /* False */; } for (var i = 0, len = source.typeParameters.length; i < len; ++i) { var related = compareTypes(source.typeParameters[i], target.typeParameters[i]); if (!related) { - return 0; + return 0 /* False */; } result &= related; } } else if (source.typeParameters || target.typeParameters) { - return 0; + return 0 /* False */; } + // Spec 1.0 Section 3.8.3 & 3.8.4: + // M and N (the signatures) are instantiated using type Any as the type argument for all type parameters declared by M and N source = getErasedSignature(source); target = getErasedSignature(target); for (var i = 0, len = source.parameters.length; i < len; i++) { @@ -12754,7 +14900,7 @@ var ts; var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]); var related = compareTypes(s, t); if (!related) { - return 0; + return 0 /* False */; } result &= related; } @@ -12775,6 +14921,9 @@ var ts; return ts.forEach(types, function (t) { return isSupertypeOfEach(t, types) ? t : undefined; }); } function reportNoCommonSupertypeError(types, errorLocation, errorMessageChainHead) { + // The downfallType/bestSupertypeDownfallType is the first type that caused a particular candidate + // to not be the common supertype. So if it weren't for this one downfallType (and possibly others), + // the type in question could have been the common supertype. var bestSupertype; var bestSupertypeDownfallType; var bestSupertypeScore = 0; @@ -12795,23 +14944,31 @@ var ts; bestSupertypeDownfallType = downfallType; bestSupertypeScore = score; } + // types.length - 1 is the maximum score, given that getCommonSupertype returned false if (bestSupertypeScore === types.length - 1) { break; } } + // In the following errors, the {1} slot is before the {0} slot because checkTypeSubtypeOf supplies the + // subtype as the first argument to the error checkTypeSubtypeOf(bestSupertypeDownfallType, bestSupertype, errorLocation, ts.Diagnostics.Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0, errorMessageChainHead); } function isArrayType(type) { - return type.flags & 4096 && type.target === globalArrayType; + return type.flags & 4096 /* Reference */ && type.target === globalArrayType; } function isArrayLikeType(type) { - return !(type.flags & (32 | 64)) && isTypeAssignableTo(type, anyArrayType); + // A type is array-like if it is not the undefined or null type and if it is assignable to any[] + return !(type.flags & (32 /* Undefined */ | 64 /* Null */)) && isTypeAssignableTo(type, anyArrayType); } function isTupleLikeType(type) { return !!getPropertyOfType(type, "0"); } + /** + * Check if a Type was written as a tuple type literal. + * Prefer using isTupleLikeType() unless the use of `elementTypes` is required. + */ function isTupleType(type) { - return (type.flags & 8192) && !!type.elementTypes; + return (type.flags & 8192 /* Tuple */) && !!type.elementTypes; } function getWidenedTypeOfObjectLiteral(type) { var properties = getPropertiesOfObjectType(type); @@ -12820,7 +14977,7 @@ var ts; var propType = getTypeOfSymbol(p); var widenedType = getWidenedType(propType); if (propType !== widenedType) { - var symbol = createSymbol(p.flags | 67108864, p.name); + var symbol = createSymbol(p.flags | 67108864 /* Transient */, p.name); symbol.declarations = p.declarations; symbol.parent = p.parent; symbol.type = widenedType; @@ -12831,8 +14988,8 @@ var ts; } members[p.name] = p; }); - var stringIndexType = getIndexTypeOfType(type, 0); - var numberIndexType = getIndexTypeOfType(type, 1); + var stringIndexType = getIndexTypeOfType(type, 0 /* String */); + var numberIndexType = getIndexTypeOfType(type, 1 /* Number */); if (stringIndexType) stringIndexType = getWidenedType(stringIndexType); if (numberIndexType) @@ -12840,14 +14997,14 @@ var ts; return createAnonymousType(type.symbol, members, emptyArray, emptyArray, stringIndexType, numberIndexType); } function getWidenedType(type) { - if (type.flags & 786432) { - if (type.flags & (32 | 64)) { + if (type.flags & 786432 /* RequiresWidening */) { + if (type.flags & (32 /* Undefined */ | 64 /* Null */)) { return anyType; } - if (type.flags & 131072) { + if (type.flags & 131072 /* ObjectLiteral */) { return getWidenedTypeOfObjectLiteral(type); } - if (type.flags & 16384) { + if (type.flags & 16384 /* Union */) { return getUnionType(ts.map(type.types, getWidenedType)); } if (isArrayType(type)) { @@ -12857,7 +15014,7 @@ var ts; return type; } function reportWideningErrorsInType(type) { - if (type.flags & 16384) { + if (type.flags & 16384 /* Union */) { var errorReported = false; ts.forEach(type.types, function (t) { if (reportWideningErrorsInType(t)) { @@ -12869,11 +15026,11 @@ var ts; if (isArrayType(type)) { return reportWideningErrorsInType(type.typeArguments[0]); } - if (type.flags & 131072) { + if (type.flags & 131072 /* ObjectLiteral */) { var errorReported = false; ts.forEach(getPropertiesOfObjectType(type), function (p) { var t = getTypeOfSymbol(p); - if (t.flags & 262144) { + if (t.flags & 262144 /* ContainsUndefinedOrNull */) { if (!reportWideningErrorsInType(t)) { error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, p.name, typeToString(getWidenedType(t))); } @@ -12888,22 +15045,22 @@ var ts; var typeAsString = typeToString(getWidenedType(type)); var diagnostic; switch (declaration.kind) { - case 132: - case 131: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 129: + case 129 /* Parameter */: diagnostic = declaration.dotDotDotToken ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; - case 200: - case 134: - case 133: - case 136: - case 137: - case 162: - case 163: + case 200 /* FunctionDeclaration */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; @@ -12916,7 +15073,8 @@ var ts; error(declaration, diagnostic, ts.declarationNameToString(declaration.name), typeAsString); } function reportErrorsFromWidening(declaration, type) { - if (produceDiagnostics && compilerOptions.noImplicitAny && type.flags & 262144) { + if (produceDiagnostics && compilerOptions.noImplicitAny && type.flags & 262144 /* ContainsUndefinedOrNull */) { + // Report implicit any error within type if possible, otherwise report error on declaration if (!reportWideningErrorsInType(type)) { reportImplicitAnyError(declaration, type); } @@ -12981,7 +15139,7 @@ var ts; var count = 0; for (var i = 0; i < depth; i++) { var t = stack[i]; - if (t.flags & 4096 && t.target === target_2) { + if (t.flags & 4096 /* Reference */ && t.target === target_2) { count++; } } @@ -12993,12 +15151,19 @@ var ts; if (source === anyFunctionType) { return; } - if (target.flags & 512) { + if (target.flags & 512 /* TypeParameter */) { + // If target is a type parameter, make an inference var typeParameters = context.typeParameters; for (var i = 0; i < typeParameters.length; i++) { if (target === typeParameters[i]) { var inferences = context.inferences[i]; if (!inferences.isFixed) { + // Any inferences that are made to a type parameter in a union type are inferior + // to inferences made to a flat (non-union) type. This is because if we infer to + // T | string[], we really don't know if we should be inferring to T or not (because + // the correct constituent on the target side could be string[]). Therefore, we put + // such inferior inferences into a secondary bucket, and only use them if the primary + // bucket is empty. var candidates = inferiority ? inferences.secondary || (inferences.secondary = []) : inferences.primary || (inferences.primary = []); @@ -13010,20 +15175,22 @@ var ts; } } } - else if (source.flags & 4096 && target.flags & 4096 && source.target === target.target) { + else if (source.flags & 4096 /* Reference */ && target.flags & 4096 /* Reference */ && source.target === target.target) { + // If source and target are references to the same generic type, infer from type arguments var sourceTypes = source.typeArguments; var targetTypes = target.typeArguments; for (var i = 0; i < sourceTypes.length; i++) { inferFromTypes(sourceTypes[i], targetTypes[i]); } } - else if (target.flags & 16384) { + else if (target.flags & 16384 /* Union */) { var targetTypes = target.types; var typeParameterCount = 0; var typeParameter; + // First infer to each type in union that isn't a type parameter for (var _i = 0; _i < targetTypes.length; _i++) { var t = targetTypes[_i]; - if (t.flags & 512 && ts.contains(context.typeParameters, t)) { + if (t.flags & 512 /* TypeParameter */ && ts.contains(context.typeParameters, t)) { typeParameter = t; typeParameterCount++; } @@ -13031,21 +15198,24 @@ var ts; inferFromTypes(source, t); } } + // If union contains a single naked type parameter, make a secondary inference to that type parameter if (typeParameterCount === 1) { inferiority++; inferFromTypes(source, typeParameter); inferiority--; } } - else if (source.flags & 16384) { + else if (source.flags & 16384 /* Union */) { + // Source is a union type, infer from each consituent type 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 /* ObjectType */ && (target.flags & (4096 /* Reference */ | 8192 /* Tuple */) || + (target.flags & 32768 /* Anonymous */) && target.symbol && target.symbol.flags & (8192 /* Method */ | 2048 /* TypeLiteral */))) { + // If source is an object type, and target is a type reference, a tuple type, the type of a method, or a type literal, infer from members if (!isInProcess(source, target) && isWithinDepthLimit(source, sourceStack) && isWithinDepthLimit(target, targetStack)) { if (depth === 0) { sourceStack = []; @@ -13055,11 +15225,11 @@ var ts; targetStack[depth] = target; depth++; inferFromProperties(source, target); - inferFromSignatures(source, target, 0); - inferFromSignatures(source, target, 1); - inferFromIndexTypes(source, target, 0, 0); - inferFromIndexTypes(source, target, 1, 1); - inferFromIndexTypes(source, target, 0, 1); + inferFromSignatures(source, target, 0 /* Call */); + inferFromSignatures(source, target, 1 /* Construct */); + inferFromIndexTypes(source, target, 0 /* String */, 0 /* String */); + inferFromIndexTypes(source, target, 1 /* Number */, 1 /* Number */); + inferFromIndexTypes(source, target, 0 /* String */, 1 /* Number */); depth--; } } @@ -13108,19 +15278,28 @@ var ts; if (!inferredType) { var inferences = getInferenceCandidates(context, index); if (inferences.length) { + // Infer widened union or supertype, or the unknown type for no common supertype var unionOrSuperType = context.inferUnionTypes ? getUnionType(inferences) : getCommonSupertype(inferences); inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : unknownType; inferenceSucceeded = !!unionOrSuperType; } else { + // Infer the empty object type when no inferences were made. It is important to remember that + // in this case, inference still succeeds, meaning there is no error for not having inference + // candidates. An inference error only occurs when there are *conflicting* candidates, i.e. + // candidates with no common supertype. inferredType = emptyObjectType; inferenceSucceeded = true; } + // Only do the constraint check if inference succeeded (to prevent cascading errors) if (inferenceSucceeded) { var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); inferredType = constraint && !isTypeAssignableTo(inferredType, constraint) ? constraint : inferredType; } else if (context.failedTypeParameterIndex === undefined || context.failedTypeParameterIndex > index) { + // If inference failed, it is necessary to record the index of the failed type parameter (the one we are on). + // It might be that inference has already failed on a later type parameter on a previous call to inferTypeArguments. + // So if this failure is on preceding type parameter, this type parameter is the new failure index. context.failedTypeParameterIndex = index; } context.inferredTypes[index] = inferredType; @@ -13136,20 +15315,24 @@ var ts; function hasAncestor(node, kind) { return ts.getAncestor(node, kind) !== undefined; } + // EXPRESSION TYPE CHECKING function getResolvedSymbol(node) { var links = getNodeLinks(node); if (!links.resolvedSymbol) { - links.resolvedSymbol = (!ts.nodeIsMissing(node) && resolveName(node, node.text, 107455 | 1048576, ts.Diagnostics.Cannot_find_name_0, node)) || unknownSymbol; + links.resolvedSymbol = (!ts.nodeIsMissing(node) && resolveName(node, node.text, 107455 /* Value */ | 1048576 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, node)) || unknownSymbol; } return links.resolvedSymbol; } function isInTypeQuery(node) { + // TypeScript 1.0 spec (April 2014): 3.6.3 + // A type query consists of the keyword typeof followed by an expression. + // The expression is restricted to a single identifier or a sequence of identifiers separated by periods while (node) { switch (node.kind) { - case 144: + case 144 /* TypeQuery */: return true; - case 65: - case 126: + case 65 /* Identifier */: + case 126 /* QualifiedName */: node = node.parent; continue; default: @@ -13158,10 +15341,13 @@ var ts; } ts.Debug.fail("should not get here"); } + // For a union type, remove all constituent types that are of the given type kind (when isOfTypeKind is true) + // or not of the given type kind (when isOfTypeKind is false) function removeTypesFromUnionType(type, typeKind, isOfTypeKind, allowEmptyUnionResult) { - if (type.flags & 16384) { + if (type.flags & 16384 /* Union */) { var types = type.types; if (ts.forEach(types, function (t) { return !!(t.flags & typeKind) === isOfTypeKind; })) { + // Above we checked if we have anything to remove, now use the opposite test to do the removal var narrowedType = getUnionType(ts.filter(types, function (t) { return !(t.flags & typeKind) === isOfTypeKind; })); if (allowEmptyUnionResult || narrowedType !== emptyObjectType) { return narrowedType; @@ -13169,6 +15355,8 @@ var ts; } } else if (allowEmptyUnionResult && !!(type.flags & typeKind) === isOfTypeKind) { + // Use getUnionType(emptyArray) instead of emptyObjectType in case the way empty union types + // are represented ever changes. return getUnionType(emptyArray); } return type; @@ -13176,6 +15364,7 @@ var ts; function hasInitializer(node) { return !!(node.initializer || ts.isBindingPattern(node.parent) && hasInitializer(node.parent.parent)); } + // Check if a given variable is assigned within a given syntax node function isVariableAssignedWithin(symbol, node) { var links = getNodeLinks(node); if (links.assignmentChecks) { @@ -13189,12 +15378,12 @@ var ts; } return links.assignmentChecks[symbol.id] = isAssignedIn(node); function isAssignedInBinaryExpression(node) { - if (node.operatorToken.kind >= 53 && node.operatorToken.kind <= 64) { + if (node.operatorToken.kind >= 53 /* FirstAssignment */ && node.operatorToken.kind <= 64 /* LastAssignment */) { var n = node.left; - while (n.kind === 161) { + while (n.kind === 161 /* ParenthesizedExpression */) { n = n.expression; } - if (n.kind === 65 && getResolvedSymbol(n) === symbol) { + if (n.kind === 65 /* Identifier */ && getResolvedSymbol(n) === symbol) { return true; } } @@ -13208,52 +15397,54 @@ var ts; } function isAssignedIn(node) { switch (node.kind) { - case 169: + case 169 /* BinaryExpression */: return isAssignedInBinaryExpression(node); - case 198: - case 152: + case 198 /* VariableDeclaration */: + case 152 /* BindingElement */: return isAssignedInVariableDeclaration(node); - case 150: - case 151: - case 153: - case 154: - case 155: - case 156: - case 157: - case 158: - case 160: - case 161: - case 167: - case 164: - case 165: - case 166: - case 168: - case 170: - case 173: - case 179: - case 180: - case 182: - case 183: - case 184: - case 185: - case 186: - case 187: - case 188: - case 191: - case 192: - case 193: - case 220: - case 221: - case 194: - case 195: - case 196: - case 223: + case 150 /* ObjectBindingPattern */: + case 151 /* ArrayBindingPattern */: + case 153 /* ArrayLiteralExpression */: + case 154 /* ObjectLiteralExpression */: + case 155 /* PropertyAccessExpression */: + case 156 /* ElementAccessExpression */: + case 157 /* CallExpression */: + case 158 /* NewExpression */: + case 160 /* TypeAssertionExpression */: + case 161 /* ParenthesizedExpression */: + case 167 /* PrefixUnaryExpression */: + case 164 /* DeleteExpression */: + case 165 /* TypeOfExpression */: + case 166 /* VoidExpression */: + case 168 /* PostfixUnaryExpression */: + case 170 /* ConditionalExpression */: + case 173 /* SpreadElementExpression */: + case 179 /* Block */: + case 180 /* VariableStatement */: + case 182 /* ExpressionStatement */: + case 183 /* IfStatement */: + case 184 /* DoStatement */: + case 185 /* WhileStatement */: + case 186 /* ForStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: + case 191 /* ReturnStatement */: + case 192 /* WithStatement */: + case 193 /* SwitchStatement */: + case 220 /* CaseClause */: + case 221 /* DefaultClause */: + case 194 /* LabeledStatement */: + case 195 /* ThrowStatement */: + case 196 /* TryStatement */: + case 223 /* CatchClause */: return ts.forEachChild(node, isAssignedIn); } return false; } } function resolveLocation(node) { + // Resolve location from top down towards node if it is a context sensitive expression + // That helps in making sure not assigning types as any when resolved out of order var containerNodes = []; for (var parent_3 = node.parent; parent_3; parent_3 = parent_3.parent) { if ((ts.isExpression(parent_3) || ts.isObjectLiteralMethod(node)) && @@ -13273,46 +15464,65 @@ var ts; } function getTypeOfSymbolAtLocation(symbol, node) { resolveLocation(node); + // Get the narrowed type of symbol at given location instead of just getting + // the type of the symbol. + // eg. + // function foo(a: string | number) { + // if (typeof a === "string") { + // a/**/ + // } + // } + // getTypeOfSymbol for a would return type of parameter symbol string | number + // Unless we provide location /**/, checker wouldn't know how to narrow the type + // By using getNarrowedTypeOfSymbol would return string since it would be able to narrow + // it by typeguard in the if true condition return getNarrowedTypeOfSymbol(symbol, node); } + // Get the narrowed type of a given symbol at a given location function getNarrowedTypeOfSymbol(symbol, node) { var type = getTypeOfSymbol(symbol); - if (node && symbol.flags & 3 && type.flags & (1 | 48128 | 16384 | 512)) { + // Only narrow when symbol is variable of type any or an object, union, or type parameter type + if (node && symbol.flags & 3 /* Variable */ && type.flags & (1 /* Any */ | 48128 /* ObjectType */ | 16384 /* Union */ | 512 /* TypeParameter */)) { loop: while (node.parent) { var child = node; node = node.parent; var narrowedType = type; switch (node.kind) { - case 183: + case 183 /* IfStatement */: + // In a branch of an if statement, narrow based on controlling expression if (child !== node.expression) { narrowedType = narrowType(type, node.expression, child === node.thenStatement); } break; - case 170: + case 170 /* ConditionalExpression */: + // In a branch of a conditional expression, narrow based on controlling condition if (child !== node.condition) { narrowedType = narrowType(type, node.condition, child === node.whenTrue); } break; - case 169: + case 169 /* BinaryExpression */: + // In the right operand of an && or ||, narrow based on left operand if (child === node.right) { - if (node.operatorToken.kind === 48) { + if (node.operatorToken.kind === 48 /* AmpersandAmpersandToken */) { narrowedType = narrowType(type, node.left, true); } - else if (node.operatorToken.kind === 49) { + else if (node.operatorToken.kind === 49 /* BarBarToken */) { narrowedType = narrowType(type, node.left, false); } } break; - case 227: - case 205: - case 200: - case 134: - case 133: - case 136: - case 137: - case 135: + case 227 /* SourceFile */: + case 205 /* ModuleDeclaration */: + case 200 /* FunctionDeclaration */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 135 /* Constructor */: + // Stop at the first containing function or module declaration break loop; } + // Use narrowed type if construct contains no assignments to variable if (narrowedType !== type) { if (isVariableAssignedWithin(symbol, node)) { break; @@ -13323,39 +15533,50 @@ var ts; } return type; function narrowTypeByEquality(type, expr, assumeTrue) { - if (expr.left.kind !== 165 || expr.right.kind !== 8) { + // Check that we have 'typeof ' on the left and string literal on the right + if (expr.left.kind !== 165 /* TypeOfExpression */ || expr.right.kind !== 8 /* StringLiteral */) { return type; } var left = expr.left; var right = expr.right; - if (left.expression.kind !== 65 || getResolvedSymbol(left.expression) !== symbol) { + if (left.expression.kind !== 65 /* Identifier */ || getResolvedSymbol(left.expression) !== symbol) { return type; } var typeInfo = primitiveTypeInfo[right.text]; - if (expr.operatorToken.kind === 31) { + if (expr.operatorToken.kind === 31 /* ExclamationEqualsEqualsToken */) { assumeTrue = !assumeTrue; } if (assumeTrue) { + // Assumed result is true. If check was not for a primitive type, remove all primitive types if (!typeInfo) { - return removeTypesFromUnionType(type, 258 | 132 | 8 | 1048576, true, false); + return removeTypesFromUnionType(type, 258 /* StringLike */ | 132 /* NumberLike */ | 8 /* Boolean */ | 1048576 /* ESSymbol */, + /*isOfTypeKind*/ true, false); } + // Check was for a primitive type, return that primitive type if it is a subtype if (isTypeSubtypeOf(typeInfo.type, type)) { return typeInfo.type; } + // Otherwise, remove all types that aren't of the primitive type kind. This can happen when the type is + // union of enum types and other types. return removeTypesFromUnionType(type, typeInfo.flags, false, false); } else { + // Assumed result is false. If check was for a primitive type, remove that primitive type if (typeInfo) { return removeTypesFromUnionType(type, typeInfo.flags, true, false); } + // Otherwise we don't have enough information to do anything. return type; } } function narrowTypeByAnd(type, expr, assumeTrue) { if (assumeTrue) { + // The assumed result is true, therefore we narrow assuming each operand to be true. return narrowType(narrowType(type, expr.left, true), expr.right, true); } else { + // The assumed result is false. This means either the first operand was false, or the first operand was true + // and the second operand was false. We narrow with those assumptions and union the two resulting types. return getUnionType([ narrowType(type, expr.left, false), narrowType(narrowType(type, expr.left, true), expr.right, false) @@ -13364,57 +15585,67 @@ var ts; } function narrowTypeByOr(type, expr, assumeTrue) { if (assumeTrue) { + // The assumed result is true. This means either the first operand was true, or the first operand was false + // and the second operand was true. We narrow with those assumptions and union the two resulting types. return getUnionType([ narrowType(type, expr.left, true), narrowType(narrowType(type, expr.left, false), expr.right, true) ]); } else { + // The assumed result is false, therefore we narrow assuming each operand to be false. return narrowType(narrowType(type, expr.left, false), expr.right, false); } } function narrowTypeByInstanceof(type, expr, assumeTrue) { - if (type.flags & 1 || !assumeTrue || expr.left.kind !== 65 || getResolvedSymbol(expr.left) !== symbol) { + // Check that type is not any, assumed result is true, and we have variable symbol on the left + if (type.flags & 1 /* Any */ || !assumeTrue || expr.left.kind !== 65 /* Identifier */ || getResolvedSymbol(expr.left) !== symbol) { return type; } + // Check that right operand is a function type with a prototype property var rightType = checkExpression(expr.right); if (!isTypeSubtypeOf(rightType, globalFunctionType)) { return type; } + // Target type is type of prototype property var prototypeProperty = getPropertyOfType(rightType, "prototype"); if (!prototypeProperty) { return type; } var targetType = getTypeOfSymbol(prototypeProperty); + // Narrow to target type if it is a subtype of current type if (isTypeSubtypeOf(targetType, type)) { return targetType; } - if (type.flags & 16384) { + // If current type is a union type, remove all constituents that aren't subtypes of target type + if (type.flags & 16384 /* Union */) { return getUnionType(ts.filter(type.types, function (t) { return isTypeSubtypeOf(t, targetType); })); } return type; } + // Narrow the given type based on the given expression having the assumed boolean value. The returned type + // will be a subtype or the same type as the argument. function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 161: + case 161 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 169: + case 169 /* BinaryExpression */: var operator = expr.operatorToken.kind; - if (operator === 30 || operator === 31) { + if (operator === 30 /* EqualsEqualsEqualsToken */ || operator === 31 /* ExclamationEqualsEqualsToken */) { return narrowTypeByEquality(type, expr, assumeTrue); } - else if (operator === 48) { + else if (operator === 48 /* AmpersandAmpersandToken */) { return narrowTypeByAnd(type, expr, assumeTrue); } - else if (operator === 49) { + else if (operator === 49 /* BarBarToken */) { return narrowTypeByOr(type, expr, assumeTrue); } - else if (operator === 87) { + else if (operator === 87 /* InstanceOfKeyword */) { return narrowTypeByInstanceof(type, expr, assumeTrue); } break; - case 167: - if (expr.operator === 46) { + case 167 /* PrefixUnaryExpression */: + if (expr.operator === 46 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } break; @@ -13424,10 +15655,16 @@ var ts; } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); - 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); + // As noted in ECMAScript 6 language spec, arrow functions never have an arguments objects. + // Although in down-level emit of arrow function, we emit it using function expression which means that + // arguments objects will be bound to the inner object; emitting arrow function natively in ES6, arguments objects + // will be bound to non-arrow function that contain this arrow function. This results in inconsistent behavior. + // To avoid that we will give an error to users if they use arguments objects in arrow function so that they + // can explicitly bound arguments objects + if (symbol === argumentsSymbol && ts.getContainingFunction(node).kind === 163 /* ArrowFunction */ && languageVersion < 2 /* ES6 */) { + error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } - if (symbol.flags & 8388608 && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { + if (symbol.flags & 8388608 /* Alias */ && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { markAliasSymbolAsReferenced(symbol); } checkCollisionWithCapturedSuperVariable(node, node); @@ -13446,17 +15683,24 @@ var ts; return false; } function checkBlockScopedBindingCapturedInLoop(node, symbol) { - if (languageVersion >= 2 || - (symbol.flags & 2) === 0 || - symbol.valueDeclaration.parent.kind === 223) { + if (languageVersion >= 2 /* ES6 */ || + (symbol.flags & 2 /* BlockScopedVariable */) === 0 || + symbol.valueDeclaration.parent.kind === 223 /* CatchClause */) { return; } + // - check if binding is used in some function + // (stop the walk when reaching container of binding declaration) + // - if first check succeeded - check if variable is declared inside the loop + // nesting structure: + // (variable declaration or binding element) -> variable declaration list -> container var container = symbol.valueDeclaration; - while (container.kind !== 199) { + while (container.kind !== 199 /* VariableDeclarationList */) { container = container.parent; } + // get the parent of variable declaration list container = container.parent; - if (container.kind === 180) { + if (container.kind === 180 /* VariableStatement */) { + // if parent is variable statement - get its parent container = container.parent; } var inFunction = isInsideFunction(node.parent, container); @@ -13466,76 +15710,84 @@ var ts; if (inFunction) { grammarErrorOnFirstToken(current, ts.Diagnostics.Loop_contains_block_scoped_variable_0_referenced_by_a_function_in_the_loop_This_is_only_supported_in_ECMAScript_6_or_higher, ts.declarationNameToString(node)); } - getNodeLinks(symbol.valueDeclaration).flags |= 256; + // mark value declaration so during emit they can have a special handling + getNodeLinks(symbol.valueDeclaration).flags |= 256 /* BlockScopedBindingInLoop */; break; } current = current.parent; } } function captureLexicalThis(node, container) { - var classNode = container.parent && container.parent.kind === 201 ? container.parent : undefined; - getNodeLinks(node).flags |= 2; - if (container.kind === 132 || container.kind === 135) { - getNodeLinks(classNode).flags |= 4; + var classNode = container.parent && container.parent.kind === 201 /* ClassDeclaration */ ? container.parent : undefined; + getNodeLinks(node).flags |= 2 /* LexicalThis */; + if (container.kind === 132 /* PropertyDeclaration */ || container.kind === 135 /* Constructor */) { + getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } else { - getNodeLinks(container).flags |= 4; + getNodeLinks(container).flags |= 4 /* CaptureThis */; } } function checkThisExpression(node) { + // Stop at the first arrow function so that we can + // tell whether 'this' needs to be captured. var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; - if (container.kind === 163) { + // Now skip arrow functions to get the "real" owner of 'this'. + if (container.kind === 163 /* ArrowFunction */) { container = ts.getThisContainer(container, false); - needToCaptureLexicalThis = (languageVersion < 2); + // When targeting es6, arrow function lexically bind "this" so we do not need to do the work of binding "this" in emitted code + needToCaptureLexicalThis = (languageVersion < 2 /* ES6 */); } switch (container.kind) { - case 205: + case 205 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_body); + // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 204: + case 204 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); + // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 135: + case 135 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; - case 132: - case 131: - if (container.flags & 128) { + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + if (container.flags & 128 /* Static */) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } break; - case 127: + case 127 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } if (needToCaptureLexicalThis) { captureLexicalThis(node, container); } - var classNode = container.parent && container.parent.kind === 201 ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 201 /* ClassDeclaration */ ? container.parent : undefined; if (classNode) { var symbol = getSymbolOfNode(classNode); - return container.flags & 128 ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); + return container.flags & 128 /* Static */ ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); } return anyType; } function isInConstructorArgumentInitializer(node, constructorDecl) { for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 129) { + if (n.kind === 129 /* Parameter */) { return true; } } return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 157 && node.parent.expression === node; - var enclosingClass = ts.getAncestor(node, 201); + var isCallExpression = node.parent.kind === 157 /* CallExpression */ && node.parent.expression === node; + var enclosingClass = ts.getAncestor(node, 201 /* ClassDeclaration */); var baseClass; if (enclosingClass && ts.getClassExtendsHeritageClauseElement(enclosingClass)) { var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); - baseClass = classType.baseTypes.length && classType.baseTypes[0]; + var baseTypes = getBaseTypes(classType); + baseClass = baseTypes.length && baseTypes[0]; } if (!baseClass) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_a_derived_class); @@ -13546,55 +15798,67 @@ var ts; var canUseSuperExpression = false; var needToCaptureLexicalThis; if (isCallExpression) { - canUseSuperExpression = container.kind === 135; + // TS 1.0 SPEC (April 2014): 4.8.1 + // Super calls are only permitted in constructors of derived classes + canUseSuperExpression = container.kind === 135 /* Constructor */; } else { + // TS 1.0 SPEC (April 2014) + // 'super' property access is allowed + // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance + // - In a static member function or static member accessor + // super property access might appear in arrow functions with arbitrary deep nesting needToCaptureLexicalThis = false; - while (container && container.kind === 163) { + while (container && container.kind === 163 /* ArrowFunction */) { container = ts.getSuperContainer(container, true); - needToCaptureLexicalThis = true; + needToCaptureLexicalThis = languageVersion < 2 /* ES6 */; } - if (container && container.parent && container.parent.kind === 201) { - if (container.flags & 128) { + // topmost container must be something that is directly nested in the class declaration + if (container && container.parent && container.parent.kind === 201 /* ClassDeclaration */) { + if (container.flags & 128 /* Static */) { canUseSuperExpression = - container.kind === 134 || - container.kind === 133 || - container.kind === 136 || - container.kind === 137; + container.kind === 134 /* MethodDeclaration */ || + container.kind === 133 /* MethodSignature */ || + container.kind === 136 /* GetAccessor */ || + container.kind === 137 /* SetAccessor */; } else { canUseSuperExpression = - container.kind === 134 || - container.kind === 133 || - container.kind === 136 || - container.kind === 137 || - container.kind === 132 || - container.kind === 131 || - container.kind === 135; + container.kind === 134 /* MethodDeclaration */ || + container.kind === 133 /* MethodSignature */ || + container.kind === 136 /* GetAccessor */ || + container.kind === 137 /* SetAccessor */ || + container.kind === 132 /* PropertyDeclaration */ || + container.kind === 131 /* PropertySignature */ || + container.kind === 135 /* Constructor */; } } } if (canUseSuperExpression) { var returnType; - if ((container.flags & 128) || isCallExpression) { - getNodeLinks(node).flags |= 32; + if ((container.flags & 128 /* Static */) || isCallExpression) { + getNodeLinks(node).flags |= 32 /* SuperStatic */; returnType = getTypeOfSymbol(baseClass.symbol); } else { - getNodeLinks(node).flags |= 16; + getNodeLinks(node).flags |= 16 /* SuperInstance */; returnType = baseClass; } - if (container.kind === 135 && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 135 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); returnType = unknownType; } if (!isCallExpression && needToCaptureLexicalThis) { + // call expressions are allowed only in constructors so they should always capture correct 'this' + // super property access expressions can also appear in arrow functions - + // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } return returnType; } } - if (container.kind === 127) { + if (container && container.kind === 127 /* ComputedPropertyName */) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { @@ -13605,6 +15869,7 @@ var ts; } return unknownType; } + // Return contextual type of parameter or undefined if no contextual type is available function getContextuallyTypedParameterType(parameter) { if (isFunctionExpressionOrArrowFunction(parameter.parent)) { var func = parameter.parent; @@ -13617,6 +15882,7 @@ var ts; if (indexOfParameter < len) { return getTypeAtPosition(contextualSignature, indexOfParameter); } + // If last parameter is contextually rest parameter get its type if (indexOfParameter === (func.parameters.length - 1) && funcHasRestParameters && contextualSignature.hasRestParameter && func.parameters.length >= contextualSignature.parameters.length) { return getTypeOfSymbol(contextualSignature.parameters[contextualSignature.parameters.length - 1]); @@ -13626,13 +15892,18 @@ var ts; } return undefined; } + // In a variable, parameter or property declaration with a type annotation, the contextual type of an initializer + // expression is the type of the variable, parameter or property. Otherwise, in a parameter declaration of a + // contextually typed function expression, the contextual type of an initializer expression is the contextual type + // of the parameter. Otherwise, in a variable or parameter declaration with a binding pattern name, the contextual + // type of an initializer expression is the type implied by the binding pattern. function getContextualTypeForInitializerExpression(node) { var declaration = node.parent; if (node === declaration.initializer) { if (declaration.type) { - return getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); + return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 129) { + if (declaration.kind === 129 /* Parameter */) { var type = getContextuallyTypedParameterType(declaration); if (type) { return type; @@ -13647,9 +15918,13 @@ var ts; function getContextualTypeForReturnExpression(node) { var func = ts.getContainingFunction(node); if (func) { - if (func.type || func.kind === 135 || func.kind === 136 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(func.symbol, 137))) { + // If the containing function has a return type annotation, is a constructor, or is a get accessor whose + // corresponding set accessor has a type annotation, return statements in the function are contextually typed + if (func.type || func.kind === 135 /* Constructor */ || func.kind === 136 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(func.symbol, 137 /* SetAccessor */))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(func)); } + // Otherwise, if the containing function is contextually typed by a function type with exactly one call signature + // and that call signature is non-generic, return statements are contextually typed by the return type of the signature var signature = getContextualSignatureForFunctionLikeDeclaration(func); if (signature) { return getReturnTypeOfSignature(signature); @@ -13657,6 +15932,7 @@ var ts; } return undefined; } + // In a typed function call, an argument or substitution expression is contextually typed by the type of the corresponding parameter. function getContextualTypeForArgument(callTarget, arg) { var args = getEffectiveCallArguments(callTarget); var argIndex = ts.indexOf(args, arg); @@ -13667,7 +15943,7 @@ var ts; return undefined; } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 159) { + if (template.parent.kind === 159 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -13675,12 +15951,15 @@ var ts; function getContextualTypeForBinaryOperand(node) { var binaryExpression = node.parent; var operator = binaryExpression.operatorToken.kind; - if (operator >= 53 && operator <= 64) { + if (operator >= 53 /* FirstAssignment */ && operator <= 64 /* LastAssignment */) { + // In an assignment expression, the right operand is contextually typed by the type of the left operand. if (node === binaryExpression.right) { return checkExpression(binaryExpression.left); } } - else if (operator === 49) { + else if (operator === 49 /* BarBarToken */) { + // When an || expression has a contextual type, the operands are contextually typed by that type. When an || + // expression has no contextual type, the right operand is contextually typed by the type of the left operand. var type = getContextualType(binaryExpression); if (!type && node === binaryExpression.right) { type = checkExpression(binaryExpression.left); @@ -13689,8 +15968,11 @@ var ts; } return undefined; } + // Apply a mapping function to a contextual type and return the resulting type. If the contextual type + // is a union type, the mapping function is applied to each constituent type and a union of the resulting + // types is returned. function applyToContextualType(type, mapper) { - if (!(type.flags & 16384)) { + if (!(type.flags & 16384 /* Union */)) { return mapper(type); } var types = type.types; @@ -13722,15 +16004,21 @@ var ts; function getIndexTypeOfContextualType(type, kind) { return applyToContextualType(type, function (t) { return getIndexTypeOfObjectOrUnionType(t, kind); }); } + // Return true if the given contextual type is a tuple-like type function contextualTypeIsTupleLikeType(type) { - return !!(type.flags & 16384 ? ts.forEach(type.types, isTupleLikeType) : isTupleLikeType(type)); + return !!(type.flags & 16384 /* Union */ ? ts.forEach(type.types, isTupleLikeType) : isTupleLikeType(type)); } + // Return true if the given contextual type provides an index signature of the given kind 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 /* Union */ ? ts.forEach(type.types, function (t) { return getIndexTypeOfObjectOrUnionType(t, kind); }) : getIndexTypeOfObjectOrUnionType(type, kind)); } + // In an object literal contextually typed by a type T, the contextual type of a property assignment is the type of + // the matching property in T, if one exists. Otherwise, it is the type of the numeric index signature in T, if one + // exists. Otherwise, it is the type of the string index signature in T, if one exists. function getContextualTypeForObjectLiteralMethod(node) { ts.Debug.assert(ts.isObjectLiteralMethod(node)); if (isInsideWithStatementBody(node)) { + // We cannot answer semantic questions within a with block, do not proceed any further return undefined; } return getContextualTypeForObjectLiteralElement(node); @@ -13740,34 +16028,45 @@ var ts; var type = getContextualType(objectLiteral); if (type) { if (!ts.hasDynamicName(element)) { + // For a (non-symbol) computed property, there is no reason to look up the name + // in the type. It will just be "__computed", which does not appear in any + // SymbolTable. var symbolName = getSymbolOfNode(element).name; var propertyType = getTypeOfPropertyOfContextualType(type, symbolName); if (propertyType) { return propertyType; } } - return isNumericName(element.name) && getIndexTypeOfContextualType(type, 1) || - getIndexTypeOfContextualType(type, 0); + return isNumericName(element.name) && getIndexTypeOfContextualType(type, 1 /* Number */) || + getIndexTypeOfContextualType(type, 0 /* String */); } return undefined; } + // In an array literal contextually typed by a type T, the contextual type of an element expression at index N is + // the type of the property with the numeric name N in T, if one exists. Otherwise, if T has a numeric index signature, + // it is the type of the numeric index signature in T. Otherwise, in ES6 and higher, the contextual type is the iterated + // type of T. function getContextualTypeForElementExpression(node) { var arrayLiteral = node.parent; 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); + || getIndexTypeOfContextualType(type, 1 /* Number */) + || (languageVersion >= 2 /* ES6 */ ? checkIteratedType(type, undefined) : undefined); } return undefined; } + // In a contextually typed conditional expression, the true/false expressions are contextually typed by the same type. function getContextualTypeForConditionalOperand(node) { var conditional = node.parent; return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined; } + // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily + // be "pushed" onto a node using the contextualType property. function getContextualType(node) { if (isInsideWithStatementBody(node)) { + // We cannot answer semantic questions within a with block, do not proceed any further return undefined; } if (node.contextualType) { @@ -13775,38 +16074,40 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 198: - case 129: - case 132: - case 131: - case 152: + case 198 /* VariableDeclaration */: + case 129 /* Parameter */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 152 /* BindingElement */: return getContextualTypeForInitializerExpression(node); - case 163: - case 191: + case 163 /* ArrowFunction */: + case 191 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 157: - case 158: + case 157 /* CallExpression */: + case 158 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 160: - return getTypeFromTypeNodeOrHeritageClauseElement(parent.type); - case 169: + case 160 /* TypeAssertionExpression */: + return getTypeFromTypeNode(parent.type); + case 169 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node); - case 224: + case 224 /* PropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent); - case 153: + case 153 /* ArrayLiteralExpression */: return getContextualTypeForElementExpression(node); - case 170: + case 170 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node); - case 176: - ts.Debug.assert(parent.parent.kind === 171); + case 176 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 171 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 161: + case 161 /* ParenthesizedExpression */: return getContextualType(parent); } return undefined; } + // If the given type is an object or union type, if that type has a single signature, and if + // that signature is non-generic, return the signature. Otherwise return undefined. function getNonGenericSignature(type) { - var signatures = getSignaturesOfObjectOrUnionType(type, 0); + var signatures = getSignaturesOfObjectOrUnionType(type, 0 /* Call */); if (signatures.length === 1) { var signature = signatures[0]; if (!signature.typeParameters) { @@ -13815,74 +16116,94 @@ var ts; } } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 162 || node.kind === 163; + return node.kind === 162 /* FunctionExpression */ || node.kind === 163 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { + // Only function expressions and arrow functions are contextually typed. return isFunctionExpressionOrArrowFunction(node) ? getContextualSignature(node) : undefined; } + // Return the contextual signature for a given expression node. A contextual type provides a + // contextual signature if it has a single call signature and if that call signature is non-generic. + // If the contextual type is a union type, get the signature from each type possible and if they are + // all identical ignoring their return type, the result is same signature but with return type as + // union type of return types from these signatures function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 134 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var type = ts.isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node) : getContextualType(node); if (!type) { return undefined; } - if (!(type.flags & 16384)) { + if (!(type.flags & 16384 /* Union */)) { return getNonGenericSignature(type); } var signatureList; var types = type.types; for (var _i = 0; _i < types.length; _i++) { var current = types[_i]; + // The signature set of all constituent type with call signatures should match + // So number of signatures allowed is either 0 or 1 if (signatureList && - getSignaturesOfObjectOrUnionType(current, 0).length > 1) { + getSignaturesOfObjectOrUnionType(current, 0 /* Call */).length > 1) { return undefined; } var signature = getNonGenericSignature(current); if (signature) { if (!signatureList) { + // This signature will contribute to contextual union signature signatureList = [signature]; } else if (!compareSignatures(signatureList[0], signature, false, compareTypes)) { + // Signatures aren't identical, do not use return undefined; } else { + // Use this signature for contextual union signature signatureList.push(signature); } } } + // Result is union of signatures collected (return type is union of return types of this signature set) var result; if (signatureList) { result = cloneSignature(signatureList[0]); + // Clear resolved return type we possibly got from cloneSignature result.resolvedReturnType = undefined; result.unionSignatures = signatureList; } return result; } + // Presence of a contextual type mapper indicates inferential typing, except the identityMapper object is + // used as a special marker for other purposes. function isInferentialContext(mapper) { return mapper && mapper !== identityMapper; } + // A node is an assignment target if it is on the left hand side of an '=' token, if it is parented by a property + // assignment in an object literal that is an assignment target, or if it is parented by an array literal that is + // an assignment target. Examples include 'a = xxx', '{ p: a } = xxx', '[{ p: a}] = xxx'. function isAssignmentTarget(node) { var parent = node.parent; - if (parent.kind === 169 && parent.operatorToken.kind === 53 && parent.left === node) { + if (parent.kind === 169 /* BinaryExpression */ && parent.operatorToken.kind === 53 /* EqualsToken */ && parent.left === node) { return true; } - if (parent.kind === 224) { + if (parent.kind === 224 /* PropertyAssignment */) { return isAssignmentTarget(parent.parent); } - if (parent.kind === 153) { + if (parent.kind === 153 /* ArrayLiteralExpression */) { return isAssignmentTarget(parent); } return false; } function checkSpreadElementExpression(node, contextualMapper) { - var type = checkExpressionCached(node.expression, contextualMapper); - if (!isArrayLikeType(type)) { - error(node.expression, ts.Diagnostics.Type_0_is_not_an_array_type, typeToString(type)); - return unknownType; - } - return type; + // It is usually not safe to call checkExpressionCached if we can be contextually typing. + // You can tell that we are contextually typing because of the contextualMapper parameter. + // While it is true that a spread element can have a contextual type, it does not do anything + // with this type. It is neither affected by it, nor does it propagate it to its operand. + // So the fact that contextualMapper is passed is not important, because the operand of a spread + // element is not contextually typed. + var arrayOrIterableType = checkExpressionCached(node.expression, contextualMapper); + return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, false); } function checkArrayLiteral(node, contextualMapper) { var elements = node.elements; @@ -13891,38 +16212,82 @@ var ts; } var hasSpreadElement = false; var elementTypes = []; - ts.forEach(elements, function (e) { - var type = checkExpression(e, contextualMapper); - if (e.kind === 173) { - elementTypes.push(getIndexTypeOfType(type, 1) || anyType); - hasSpreadElement = true; + var inDestructuringPattern = isAssignmentTarget(node); + for (var _i = 0; _i < elements.length; _i++) { + var e = elements[_i]; + if (inDestructuringPattern && e.kind === 173 /* SpreadElementExpression */) { + // Given the following situation: + // var c: {}; + // [...c] = ["", 0]; + // + // c is represented in the tree as a spread element in an array literal. + // But c really functions as a rest element, and its purpose is to provide + // a contextual type for the right hand side of the assignment. Therefore, + // instead of calling checkExpression on "...c", which will give an error + // if c is not iterable/array-like, we need to act as if we are trying to + // get the contextual element type from it. So we do something similar to + // getContextualTypeForElementExpression, which will crucially not error + // if there is no index type / iterated type. + var restArrayType = checkExpression(e.expression, contextualMapper); + var restElementType = getIndexTypeOfType(restArrayType, 1 /* Number */) || + (languageVersion >= 2 /* ES6 */ ? checkIteratedType(restArrayType, undefined) : undefined); + if (restElementType) { + elementTypes.push(restElementType); + } } else { + var type = checkExpression(e, contextualMapper); elementTypes.push(type); } - }); + hasSpreadElement = hasSpreadElement || e.kind === 173 /* SpreadElementExpression */; + } if (!hasSpreadElement) { var contextualType = getContextualType(node); - if (contextualType && contextualTypeIsTupleLikeType(contextualType) || isAssignmentTarget(node)) { + if (contextualType && contextualTypeIsTupleLikeType(contextualType) || inDestructuringPattern) { return createTupleType(elementTypes); } } return createArrayType(getUnionType(elementTypes)); } function isNumericName(name) { - return name.kind === 127 ? isNumericComputedName(name) : isNumericLiteralName(name.text); + return name.kind === 127 /* ComputedPropertyName */ ? isNumericComputedName(name) : isNumericLiteralName(name.text); } function isNumericComputedName(name) { - return allConstituentTypesHaveKind(checkComputedPropertyName(name), 1 | 132); + // It seems odd to consider an expression of type Any to result in a numeric name, + // but this behavior is consistent with checkIndexedAccess + return allConstituentTypesHaveKind(checkComputedPropertyName(name), 1 /* Any */ | 132 /* NumberLike */); } function isNumericLiteralName(name) { + // The intent of numeric names is that + // - they are names with text in a numeric form, and that + // - setting properties/indexing with them is always equivalent to doing so with the numeric literal 'numLit', + // acquired by applying the abstract 'ToNumber' operation on the name's text. + // + // The subtlety is in the latter portion, as we cannot reliably say that anything that looks like a numeric literal is a numeric name. + // In fact, it is the case that the text of the name must be equal to 'ToString(numLit)' for this to hold. + // + // Consider the property name '"0xF00D"'. When one indexes with '0xF00D', they are actually indexing with the value of 'ToString(0xF00D)' + // according to the ECMAScript specification, so it is actually as if the user indexed with the string '"61453"'. + // Thus, the text of all numeric literals equivalent to '61543' such as '0xF00D', '0xf00D', '0170015', etc. are not valid numeric names + // because their 'ToString' representation is not equal to their original text. + // This is motivated by ECMA-262 sections 9.3.1, 9.8.1, 11.1.5, and 11.2.1. + // + // Here, we test whether 'ToString(ToNumber(name))' is exactly equal to 'name'. + // The '+' prefix operator is equivalent here to applying the abstract ToNumber operation. + // Applying the 'toString()' method on a number gives us the abstract ToString operation on a number. + // + // Note that this accepts the values 'Infinity', '-Infinity', and 'NaN', and that this is intentional. + // This is desired behavior, because when indexing with them as numeric entities, you are indexing + // with the strings '"Infinity"', '"-Infinity"', and '"NaN"' respectively. return (+name).toString() === name; } function checkComputedPropertyName(node) { var links = getNodeLinks(node.expression); if (!links.resolvedType) { links.resolvedType = checkExpression(node.expression); - if (!allConstituentTypesHaveKind(links.resolvedType, 1 | 132 | 258 | 1048576)) { + // This will allow types number, string, symbol or any. It will also allow enums, the unknown + // type, and any union of these types (like string | number). + if (!allConstituentTypesHaveKind(links.resolvedType, 1 /* Any */ | 132 /* NumberLike */ | 258 /* StringLike */ | 1048576 /* ESSymbol */)) { error(node, ts.Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any); } else { @@ -13932,6 +16297,7 @@ var ts; return links.resolvedType; } function checkObjectLiteral(node, contextualMapper) { + // Grammar checking checkGrammarObjectLiteralExpression(node); var propertiesTable = {}; var propertiesArray = []; @@ -13940,24 +16306,22 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var memberDecl = _a[_i]; var member = memberDecl.symbol; - if (memberDecl.kind === 224 || - memberDecl.kind === 225 || + if (memberDecl.kind === 224 /* PropertyAssignment */ || + memberDecl.kind === 225 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { var type = void 0; - if (memberDecl.kind === 224) { + if (memberDecl.kind === 224 /* PropertyAssignment */) { type = checkPropertyAssignment(memberDecl, contextualMapper); } - else if (memberDecl.kind === 134) { + else if (memberDecl.kind === 134 /* MethodDeclaration */) { type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { - ts.Debug.assert(memberDecl.kind === 225); - type = memberDecl.name.kind === 127 - ? unknownType - : checkExpression(memberDecl.name, contextualMapper); + ts.Debug.assert(memberDecl.kind === 225 /* ShorthandPropertyAssignment */); + type = checkExpression(memberDecl.name, contextualMapper); } typeFlags |= type.flags; - var prop = createSymbol(4 | 67108864 | member.flags, member.name); + var prop = createSymbol(4 /* Property */ | 67108864 /* Transient */ | member.flags, member.name); prop.declarations = member.declarations; prop.parent = member.parent; if (member.valueDeclaration) { @@ -13968,7 +16332,12 @@ var ts; member = prop; } else { - ts.Debug.assert(memberDecl.kind === 136 || memberDecl.kind === 137); + // TypeScript 1.0 spec (April 2014) + // A get accessor declaration is processed in the same manner as + // an ordinary function declaration(section 6.1) with no parameters. + // A set accessor declaration is processed in the same manner + // as an ordinary function declaration with a single parameter and a Void return type. + ts.Debug.assert(memberDecl.kind === 136 /* GetAccessor */ || memberDecl.kind === 137 /* SetAccessor */); checkAccessorDeclaration(memberDecl); } if (!ts.hasDynamicName(memberDecl)) { @@ -13976,17 +16345,21 @@ var ts; } propertiesArray.push(member); } - var stringIndexType = getIndexType(0); - var numberIndexType = getIndexType(1); + var stringIndexType = getIndexType(0 /* String */); + var numberIndexType = getIndexType(1 /* Number */); var result = createAnonymousType(node.symbol, propertiesTable, emptyArray, emptyArray, stringIndexType, numberIndexType); - result.flags |= 131072 | 524288 | (typeFlags & 262144); + result.flags |= 131072 /* ObjectLiteral */ | 524288 /* ContainsObjectLiteral */ | (typeFlags & 262144 /* ContainsUndefinedOrNull */); return result; function getIndexType(kind) { if (contextualType && contextualTypeHasIndexSignature(contextualType, kind)) { var propTypes = []; for (var i = 0; i < propertiesArray.length; i++) { var propertyDecl = node.properties[i]; - if (kind === 0 || isNumericName(propertyDecl.name)) { + if (kind === 0 /* String */ || isNumericName(propertyDecl.name)) { + // Do not call getSymbolOfNode(propertyDecl), as that will get the + // original symbol for the node. We actually want to get the symbol + // created by checkObjectLiteral, since that will be appropriately + // contextually typed and resolved. var type = getTypeOfSymbol(propertiesArray[i]); if (!ts.contains(propTypes, type)) { propTypes.push(type); @@ -14000,37 +16373,48 @@ var ts; return undefined; } } + // If a symbol is a synthesized symbol with no value declaration, we assume it is a property. Example of this are the synthesized + // '.prototype' property as well as synthesized tuple index properties. function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 132; + return s.valueDeclaration ? s.valueDeclaration.kind : 132 /* PropertyDeclaration */; } function getDeclarationFlagsFromSymbol(s) { - return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : s.flags & 134217728 ? 16 | 128 : 0; + return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : s.flags & 134217728 /* Prototype */ ? 16 /* Public */ | 128 /* Static */ : 0; } function checkClassPropertyAccess(node, left, type, prop) { var flags = getDeclarationFlagsFromSymbol(prop); - if (!(flags & (32 | 64))) { + // Public properties are always accessible + if (!(flags & (32 /* Private */ | 64 /* Protected */))) { return; } - var enclosingClassDeclaration = ts.getAncestor(node, 201); + // Property is known to be private or protected at this point + // Get the declaring and enclosing class instance types + var enclosingClassDeclaration = ts.getAncestor(node, 201 /* ClassDeclaration */); var enclosingClass = enclosingClassDeclaration ? getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClassDeclaration)) : undefined; var declaringClass = getDeclaredTypeOfSymbol(prop.parent); - if (flags & 32) { + // Private property is accessible if declaring and enclosing class are the same + if (flags & 32 /* Private */) { if (declaringClass !== enclosingClass) { error(node, ts.Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(declaringClass)); } return; } - if (left.kind === 91) { + // Property is known to be protected at this point + // All protected properties of a supertype are accessible in a super access + if (left.kind === 91 /* SuperKeyword */) { return; } + // A protected property is accessible in the declaring class and classes derived from it if (!enclosingClass || !hasBaseType(enclosingClass, declaringClass)) { error(node, ts.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(declaringClass)); return; } - if (flags & 128) { + // No further restrictions for static properties + if (flags & 128 /* Static */) { return; } - if (!(getTargetType(type).flags & (1024 | 2048) && hasBaseType(type, enclosingClass))) { + // An instance property must be accessed through an instance of the enclosing class + if (!(getTargetType(type).flags & (1024 /* Class */ | 2048 /* Interface */) && hasBaseType(type, enclosingClass))) { error(node, ts.Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1, symbolToString(prop), typeToString(enclosingClass)); } } @@ -14047,6 +16431,7 @@ var ts; if (type !== anyType) { var apparentType = getApparentType(getWidenedType(type)); if (apparentType === unknownType) { + // handle cases when type is Type parameter with invalid constraint return unknownType; } var prop = getPropertyOfType(apparentType, right.text); @@ -14057,8 +16442,15 @@ var ts; return unknownType; } getNodeLinks(node).resolvedSymbol = prop; - if (prop.parent && prop.parent.flags & 32) { - if (left.kind === 91 && getDeclarationKindFromSymbol(prop) !== 134) { + if (prop.parent && prop.parent.flags & 32 /* Class */) { + // TS 1.0 spec (April 2014): 4.8.2 + // - In a constructor, instance member function, instance member accessor, or + // instance member variable initializer where this references a derived class instance, + // a super property access is permitted and must specify a public instance member function of the base class. + // - In a static member function or static member accessor + // where this references the constructor function object of a derived class, + // a super property access is permitted and must specify a public static member function of the base class. + if (left.kind === 91 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 134 /* MethodDeclaration */) { error(right, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); } else { @@ -14070,14 +16462,14 @@ var ts; return anyType; } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 155 + var left = node.kind === 155 /* PropertyAccessExpression */ ? node.expression : node.left; var type = checkExpressionOrQualifiedName(left); if (type !== unknownType && type !== anyType) { var prop = getPropertyOfType(getWidenedType(type), propertyName); - if (prop && prop.parent && prop.parent.flags & 32) { - if (left.kind === 91 && getDeclarationKindFromSymbol(prop) !== 134) { + if (prop && prop.parent && prop.parent.flags & 32 /* Class */) { + if (left.kind === 91 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 134 /* MethodDeclaration */) { return false; } else { @@ -14090,9 +16482,10 @@ var ts; return true; } function checkIndexedAccess(node) { + // Grammar checking if (!node.argumentExpression) { var sourceFile = getSourceFile(node); - if (node.parent.kind === 158 && node.parent.expression === node) { + if (node.parent.kind === 158 /* NewExpression */ && node.parent.expression === node) { var start = ts.skipTrivia(sourceFile.text, node.expression.end); var end = node.end; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); @@ -14103,6 +16496,7 @@ var ts; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Expression_expected); } } + // Obtain base constraint such that we can bail out if the constraint is an unknown type var objectType = getApparentType(checkExpression(node.expression)); var indexType = node.argumentExpression ? checkExpression(node.argumentExpression) : unknownType; if (objectType === unknownType) { @@ -14110,10 +16504,19 @@ var ts; } var isConstEnum = isConstEnumObjectType(objectType); if (isConstEnum && - (!node.argumentExpression || node.argumentExpression.kind !== 8)) { + (!node.argumentExpression || node.argumentExpression.kind !== 8 /* StringLiteral */)) { error(node.argumentExpression, ts.Diagnostics.A_const_enum_member_can_only_be_accessed_using_a_string_literal); return unknownType; } + // TypeScript 1.0 spec (April 2014): 4.10 Property Access + // - If IndexExpr is a string literal or a numeric literal and ObjExpr's apparent type has a property with the name + // given by that literal(converted to its string representation in the case of a numeric literal), the property access is of the type of that property. + // - Otherwise, if ObjExpr's apparent type has a numeric index signature and IndexExpr is of type Any, the Number primitive type, or an enum type, + // the property access is of the type of that index signature. + // - Otherwise, if ObjExpr's apparent type has a string index signature and IndexExpr is of type Any, the String or Number primitive type, or an enum type, + // the property access is of the type of that index signature. + // - Otherwise, if IndexExpr is of type Any, the String or Number primitive type, or an enum type, the property access is of type Any. + // See if we can index as a property. if (node.argumentExpression) { var name_6 = getPropertyNameForIndexedAccess(node.argumentExpression, indexType); if (name_6 !== undefined) { @@ -14128,27 +16531,38 @@ var ts; } } } - if (allConstituentTypesHaveKind(indexType, 1 | 258 | 132 | 1048576)) { - if (allConstituentTypesHaveKind(indexType, 1 | 132)) { - var numberIndexType = getIndexTypeOfType(objectType, 1); + // Check for compatible indexer types. + if (allConstituentTypesHaveKind(indexType, 1 /* Any */ | 258 /* StringLike */ | 132 /* NumberLike */ | 1048576 /* ESSymbol */)) { + // Try to use a number indexer. + if (allConstituentTypesHaveKind(indexType, 1 /* Any */ | 132 /* NumberLike */)) { + var numberIndexType = getIndexTypeOfType(objectType, 1 /* Number */); if (numberIndexType) { return numberIndexType; } } - var stringIndexType = getIndexTypeOfType(objectType, 0); + // Try to use string indexing. + var stringIndexType = getIndexTypeOfType(objectType, 0 /* String */); if (stringIndexType) { return stringIndexType; } + // Fall back to any. if (compilerOptions.noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors && objectType !== anyType) { error(node, ts.Diagnostics.Index_signature_of_object_type_implicitly_has_an_any_type); } return anyType; } + // REVIEW: Users should know the type that was actually used. error(node, ts.Diagnostics.An_index_expression_argument_must_be_of_type_string_number_symbol_or_any); return unknownType; } + /** + * If indexArgumentExpression is a string literal or number literal, returns its text. + * If indexArgumentExpression is a well known symbol, returns the property name corresponding + * to this symbol, as long as it is a proper symbol reference. + * Otherwise, returns undefined. + */ function getPropertyNameForIndexedAccess(indexArgumentExpression, indexArgumentType) { - if (indexArgumentExpression.kind === 8 || indexArgumentExpression.kind === 7) { + if (indexArgumentExpression.kind === 8 /* StringLiteral */ || indexArgumentExpression.kind === 7 /* NumericLiteral */) { return indexArgumentExpression.text; } if (checkThatExpressionIsProperSymbolReference(indexArgumentExpression, indexArgumentType, false)) { @@ -14157,19 +16571,30 @@ var ts; } return undefined; } + /** + * A proper symbol reference requires the following: + * 1. The property access denotes a property that exists + * 2. The expression is of the form Symbol. + * 3. The property access is of the primitive type symbol. + * 4. Symbol in this context resolves to the global Symbol object + */ function checkThatExpressionIsProperSymbolReference(expression, expressionType, reportError) { if (expressionType === unknownType) { + // There is already an error, so no need to report one. return false; } if (!ts.isWellKnownSymbolSyntactically(expression)) { return false; } - if ((expressionType.flags & 1048576) === 0) { + // Make sure the property type is the primitive symbol type + if ((expressionType.flags & 1048576 /* ESSymbol */) === 0) { if (reportError) { error(expression, ts.Diagnostics.A_computed_property_name_of_the_form_0_must_be_of_type_symbol, ts.getTextOfNode(expression)); } return false; } + // The name is Symbol., so make sure Symbol actually resolves to the + // global Symbol object var leftHandSide = expression.expression; var leftHandSideSymbol = getResolvedSymbol(leftHandSide); if (!leftHandSideSymbol) { @@ -14177,6 +16602,7 @@ var ts; } var globalESSymbol = getGlobalESSymbolConstructorSymbol(); if (!globalESSymbol) { + // Already errored when we tried to look up the symbol return false; } if (leftHandSideSymbol !== globalESSymbol) { @@ -14188,7 +16614,7 @@ var ts; return true; } function resolveUntypedCall(node) { - if (node.kind === 159) { + if (node.kind === 159 /* TaggedTemplateExpression */) { checkExpression(node.template); } else { @@ -14202,6 +16628,14 @@ var ts; resolveUntypedCall(node); return unknownSignature; } + // Re-order candidate signatures into the result array. Assumes the result array to be empty. + // The candidate list orders groups in reverse, but within a group signatures are kept in declaration order + // A nit here is that we reorder only signatures that belong to the same symbol, + // so order how inherited signatures are processed is still preserved. + // interface A { (x: string): void } + // interface B extends A { (x: 'foo'): string } + // let b: B; + // b('foo') // <- here overloads should be processed as [(x:'foo'): string, (x: string): void] function reorderCandidates(signatures, result) { var lastParent; var lastSymbol; @@ -14224,13 +16658,20 @@ var ts; } } else { + // current declaration belongs to a different symbol + // set cutoffIndex so re-orderings in the future won't change result set from 0 to cutoffIndex index = cutoffIndex = result.length; lastParent = parent_4; } lastSymbol = symbol; + // specialized signatures always need to be placed before non-specialized signatures regardless + // of the cutoff position; see GH#1133 if (signature.hasStringLiterals) { specializedIndex++; spliceIndex = specializedIndex; + // The cutoff index always needs to be greater than or equal to the specialized signature index + // in order to prevent non-specialized signatures from being added before a specialized + // signature. cutoffIndex++; } else { @@ -14241,59 +16682,76 @@ var ts; } function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { - if (args[i].kind === 173) { + if (args[i].kind === 173 /* SpreadElementExpression */) { return i; } } return -1; } function hasCorrectArity(node, args, signature) { - var adjustedArgCount; - var typeArguments; - var callIsIncomplete; - if (node.kind === 159) { + var adjustedArgCount; // Apparent number of arguments we will have in this call + var typeArguments; // Type arguments (undefined if none) + var callIsIncomplete; // In incomplete call we want to be lenient when we have too few arguments + if (node.kind === 159 /* TaggedTemplateExpression */) { var tagExpression = node; + // Even if the call is incomplete, we'll have a missing expression as our last argument, + // so we can say the count is just the arg list length adjustedArgCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 171) { + if (tagExpression.template.kind === 171 /* TemplateExpression */) { + // If a tagged template expression lacks a tail literal, the call is incomplete. + // Specifically, a template only can end in a TemplateTail or a Missing literal. var templateExpression = tagExpression.template; var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans); - ts.Debug.assert(lastSpan !== undefined); + ts.Debug.assert(lastSpan !== undefined); // we should always have at least one span. callIsIncomplete = ts.nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated; } else { + // If the template didn't end in a backtick, or its beginning occurred right prior to EOF, + // then this might actually turn out to be a TemplateHead in the future; + // so we consider the call to be incomplete. var templateLiteral = tagExpression.template; - ts.Debug.assert(templateLiteral.kind === 10); + ts.Debug.assert(templateLiteral.kind === 10 /* NoSubstitutionTemplateLiteral */); callIsIncomplete = !!templateLiteral.isUnterminated; } } else { var callExpression = node; if (!callExpression.arguments) { - ts.Debug.assert(callExpression.kind === 158); + // This only happens when we have something of the form: 'new C' + ts.Debug.assert(callExpression.kind === 158 /* NewExpression */); return signature.minArgumentCount === 0; } + // For IDE scenarios we may have an incomplete call, so a trailing comma is tantamount to adding another argument. adjustedArgCount = callExpression.arguments.hasTrailingComma ? args.length + 1 : args.length; + // If we are missing the close paren, the call is incomplete. callIsIncomplete = callExpression.arguments.end === callExpression.end; typeArguments = callExpression.typeArguments; } + // If the user supplied type arguments, but the number of type arguments does not match + // the declared number of type parameters, the call has an incorrect arity. var hasRightNumberOfTypeArgs = !typeArguments || (signature.typeParameters && typeArguments.length === signature.typeParameters.length); if (!hasRightNumberOfTypeArgs) { return false; } + // If spread arguments are present, check that they correspond to a rest parameter. If so, no + // further checking is necessary. var spreadArgIndex = getSpreadArgumentIndex(args); if (spreadArgIndex >= 0) { return signature.hasRestParameter && spreadArgIndex >= signature.parameters.length - 1; } + // Too many arguments implies incorrect arity. if (!signature.hasRestParameter && adjustedArgCount > signature.parameters.length) { return false; } + // If the call is incomplete, we should skip the lower bound check. var hasEnoughArguments = adjustedArgCount >= signature.minArgumentCount; return callIsIncomplete || hasEnoughArguments; } + // If type has a single call signature and no other members, return that signature. Otherwise, return undefined. function getSingleCallSignature(type) { - if (type.flags & 48128) { + if (type.flags & 48128 /* ObjectType */) { var resolved = resolveObjectOrUnionTypeMembers(type); if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 && resolved.properties.length === 0 && !resolved.stringIndexType && !resolved.numberIndexType) { @@ -14302,9 +16760,11 @@ var ts; } return undefined; } + // Instantiate a generic signature in the context of a non-generic signature (section 3.8.5 in TypeScript spec) function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper) { var context = createInferenceContext(signature.typeParameters, true); forEachMatchingParameterType(contextualSignature, signature, function (source, target) { + // Type parameters from outer context referenced by source type are fixed by instantiation of the source type inferTypes(context, instantiateType(source, contextualMapper), target); }); return getSignatureInstantiation(signature, getInferredTypes(context)); @@ -14312,34 +16772,54 @@ var ts; function inferTypeArguments(signature, args, excludeArgument, context) { var typeParameters = signature.typeParameters; var inferenceMapper = createInferenceMapper(context); + // Clear out all the inference results from the last time inferTypeArguments was called on this context for (var i = 0; i < typeParameters.length; i++) { + // As an optimization, we don't have to clear (and later recompute) inferred types + // for type parameters that have already been fixed on the previous call to inferTypeArguments. + // It would be just as correct to reset all of them. But then we'd be repeating the same work + // for the type parameters that were fixed, namely the work done by getInferredType. if (!context.inferences[i].isFixed) { context.inferredTypes[i] = undefined; } } + // On this call to inferTypeArguments, we may get more inferences for certain type parameters that were not + // fixed last time. This means that a type parameter that failed inference last time may succeed this time, + // or vice versa. Therefore, the failedTypeParameterIndex is useless if it points to an unfixed type parameter, + // because it may change. So here we reset it. However, getInferredType will not revisit any type parameters + // that were previously fixed. So if a fixed type parameter failed previously, it will fail again because + // it will contain the exact same set of inferences. So if we reset the index from a fixed type parameter, + // we will lose information that we won't recover this time around. if (context.failedTypeParameterIndex !== undefined && !context.inferences[context.failedTypeParameterIndex].isFixed) { context.failedTypeParameterIndex = undefined; } + // We perform two passes over the arguments. In the first pass we infer from all arguments, but use + // wildcards for all context sensitive function expressions. for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg.kind !== 175) { - var paramType = getTypeAtPosition(signature, arg.kind === 173 ? -1 : i); + if (arg.kind !== 175 /* OmittedExpression */) { + var paramType = getTypeAtPosition(signature, i); var argType = void 0; - if (i === 0 && args[i].parent.kind === 159) { + if (i === 0 && args[i].parent.kind === 159 /* TaggedTemplateExpression */) { argType = globalTemplateStringsArrayType; } else { + // For context sensitive arguments we pass the identityMapper, which is a signal to treat all + // context sensitive function expressions as wildcards var mapper = excludeArgument && excludeArgument[i] !== undefined ? identityMapper : inferenceMapper; argType = checkExpressionWithContextualType(arg, paramType, mapper); } inferTypes(context, argType, paramType); } } + // In the second pass we visit only context sensitive arguments, and only those that aren't excluded, this + // time treating function expressions normally (which may cause previously inferred type arguments to be fixed + // as we construct types for contextually typed parameters) if (excludeArgument) { for (var i = 0; i < args.length; i++) { + // No need to check for omitted args and template expressions, their exlusion value is always undefined if (excludeArgument[i] === false) { var arg = args[i]; - var paramType = getTypeAtPosition(signature, arg.kind === 173 ? -1 : i); + var paramType = getTypeAtPosition(signature, i); inferTypes(context, checkExpressionWithContextualType(arg, paramType, inferenceMapper), paramType); } } @@ -14351,9 +16831,10 @@ var ts; var typeArgumentsAreAssignable = true; for (var i = 0; i < typeParameters.length; i++) { var typeArgNode = typeArguments[i]; - var typeArgument = getTypeFromTypeNodeOrHeritageClauseElement(typeArgNode); + var typeArgument = getTypeFromTypeNode(typeArgNode); + // Do not push on this array! It has a preallocated length typeArgumentResultTypes[i] = typeArgument; - if (typeArgumentsAreAssignable) { + if (typeArgumentsAreAssignable /* so far */) { var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { typeArgumentsAreAssignable = checkTypeAssignableTo(typeArgument, constraint, reportErrors ? typeArgNode : undefined, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); @@ -14365,11 +16846,17 @@ var ts; function checkApplicableSignature(node, args, signature, relation, excludeArgument, reportErrors) { for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg.kind !== 175) { - 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 (arg.kind !== 175 /* OmittedExpression */) { + // Check spread elements against rest type (from arity check we know spread argument corresponds to a rest parameter) + var paramType = getTypeAtPosition(signature, i); + // A tagged template expression provides a special first argument, and string literals get string literal types + // unless we're reporting errors + var argType = i === 0 && node.kind === 159 /* TaggedTemplateExpression */ + ? globalTemplateStringsArrayType + : arg.kind === 8 /* StringLiteral */ && !reportErrors + ? getStringLiteralType(arg) + : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); + // Use argument expression as error location when reporting errors if (!checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1)) { return false; } @@ -14377,12 +16864,19 @@ var ts; } return true; } + /** + * Returns the effective arguments for an expression that works like a function invocation. + * + * If 'node' is a CallExpression or a NewExpression, then its argument list is returned. + * If 'node' is a TaggedTemplateExpression, a new argument list is constructed from the substitution + * expressions, where the first element of the list is the template for error reporting purposes. + */ function getEffectiveCallArguments(node) { var args; - if (node.kind === 159) { + if (node.kind === 159 /* TaggedTemplateExpression */) { var template = node.template; args = [template]; - if (template.kind === 171) { + if (template.kind === 171 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args.push(span.expression); }); @@ -14393,32 +16887,56 @@ var ts; } return args; } + /** + * In a 'super' call, type arguments are not provided within the CallExpression node itself. + * Instead, they must be fetched from the class declaration's base type node. + * + * If 'node' is a 'super' call (e.g. super(...), new super(...)), then we attempt to fetch + * the type arguments off the containing class's first heritage clause (if one exists). Note that if + * type arguments are supplied on the 'super' call, they are ignored (though this is syntactically incorrect). + * + * In all other cases, the call's explicit type arguments are returned. + */ function getEffectiveTypeArguments(callExpression) { - if (callExpression.expression.kind === 91) { - var containingClass = ts.getAncestor(callExpression, 201); + if (callExpression.expression.kind === 91 /* SuperKeyword */) { + var containingClass = ts.getAncestor(callExpression, 201 /* ClassDeclaration */); var baseClassTypeNode = containingClass && ts.getClassExtendsHeritageClauseElement(containingClass); return baseClassTypeNode && baseClassTypeNode.typeArguments; } else { + // Ordinary case - simple function invocation. return callExpression.typeArguments; } } function resolveCall(node, signatures, candidatesOutArray) { - var isTaggedTemplate = node.kind === 159; + var isTaggedTemplate = node.kind === 159 /* TaggedTemplateExpression */; var typeArguments; if (!isTaggedTemplate) { typeArguments = getEffectiveTypeArguments(node); - if (node.expression.kind !== 91) { + // We already perform checking on the type arguments on the class declaration itself. + if (node.expression.kind !== 91 /* SuperKeyword */) { ts.forEach(typeArguments, checkSourceElement); } } var candidates = candidatesOutArray || []; + // reorderCandidates fills up the candidates array directly reorderCandidates(signatures, candidates); if (!candidates.length) { error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); return resolveErrorCall(node); } var args = getEffectiveCallArguments(node); + // The following applies to any value of 'excludeArgument[i]': + // - true: the argument at 'i' is susceptible to a one-time permanent contextual typing. + // - undefined: the argument at 'i' is *not* susceptible to permanent contextual typing. + // - false: the argument at 'i' *was* and *has been* permanently contextually typed. + // + // The idea is that we will perform type argument inference & assignability checking once + // without using the susceptible parameters that are functions, and once more for each of those + // parameters, contextually typing each as we go along. + // + // For a tagged template, then the first argument be 'undefined' if necessary + // because it represents a TemplateStringsArray. var excludeArgument; for (var i = isTaggedTemplate ? 1 : 0; i < args.length; i++) { if (isContextSensitive(args[i])) { @@ -14428,14 +16946,46 @@ var ts; excludeArgument[i] = true; } } + // The following variables are captured and modified by calls to chooseOverload. + // If overload resolution or type argument inference fails, we want to report the + // best error possible. The best error is one which says that an argument was not + // assignable to a parameter. This implies that everything else about the overload + // was fine. So if there is any overload that is only incorrect because of an + // argument, we will report an error on that one. + // + // function foo(s: string) {} + // function foo(n: number) {} // Report argument error on this overload + // function foo() {} + // foo(true); + // + // If none of the overloads even made it that far, there are two possibilities. + // There was a problem with type arguments for some overload, in which case + // report an error on that. Or none of the overloads even had correct arity, + // in which case give an arity error. + // + // function foo(x: T, y: T) {} // Report type argument inference error + // function foo() {} + // foo(0, true); + // var candidateForArgumentError; var candidateForTypeArgumentError; var resultOfFailedInference; var result; + // Section 4.12.1: + // if the candidate list contains one or more signatures for which the type of each argument + // expression is a subtype of each corresponding parameter type, the return type of the first + // of those signatures becomes the return type of the function call. + // Otherwise, the return type of the first signature in the candidate list becomes the return + // type of the function call. + // + // Whether the call is an error is determined by assignability of the arguments. The subtype pass + // is just important for choosing the best signature. So in the case where there is only one + // signature, the subtype pass is useless. So skipping it is an optimization. if (candidates.length > 1) { result = chooseOverload(candidates, subtypeRelation); } if (!result) { + // Reinitialize these pointers for round two candidateForArgumentError = undefined; candidateForTypeArgumentError = undefined; resultOfFailedInference = undefined; @@ -14444,7 +16994,16 @@ var ts; if (result) { return result; } + // No signatures were applicable. Now report errors based on the last applicable signature with + // no arguments excluded from assignability checks. + // If candidate is undefined, it means that no candidates had a suitable arity. In that case, + // skip the checkApplicableSignature check. if (candidateForArgumentError) { + // excludeArgument is undefined, in this case also equivalent to [undefined, undefined, ...] + // The importance of excludeArgument is to prevent us from typing function expression parameters + // in arguments too early. If possible, we'd like to only type them once we know the correct + // overload. However, this matters for the case where the call is correct. When the call is + // an error, we don't need to exclude any arguments, although it would cause no harm to do so. checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, undefined, true); } else if (candidateForTypeArgumentError) { @@ -14462,6 +17021,11 @@ var ts; else { error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); } + // No signature was applicable. We have already reported the errors for the invalid signature. + // If this is a type resolution session, e.g. Language Service, try to get better information that anySignature. + // Pick the first candidate that matches the arity. This way we can get a contextual type for cases like: + // declare function f(a: { xa: number; xb: number; }); + // f({ | if (!produceDiagnostics) { for (var _i = 0; _i < candidates.length; _i++) { var candidate = candidates[_i]; @@ -14509,6 +17073,11 @@ var ts; } excludeArgument[index] = false; } + // A post-mortem of this iteration of the loop. The signature was not applicable, + // so we want to track it as a candidate for reporting an error. If the candidate + // had no type parameters, or had no issues related to type arguments, we can + // report an error based on the arguments. If there was an issue with type + // arguments, then we can only report an error based on the type arguments. if (originalCandidate.typeParameters) { var instantiatedCandidate = candidate; if (typeArgumentsAreValid) { @@ -14530,26 +17099,41 @@ var ts; } } function resolveCallExpression(node, candidatesOutArray) { - if (node.expression.kind === 91) { + if (node.expression.kind === 91 /* SuperKeyword */) { var superType = checkSuperExpression(node.expression); if (superType !== unknownType) { - return resolveCall(node, getSignaturesOfType(superType, 1), candidatesOutArray); + return resolveCall(node, getSignaturesOfType(superType, 1 /* Construct */), candidatesOutArray); } return resolveUntypedCall(node); } var funcType = checkExpression(node.expression); var apparentType = getApparentType(funcType); if (apparentType === unknownType) { + // Another error has already been reported return resolveErrorCall(node); } - var callSignatures = getSignaturesOfType(apparentType, 0); - var constructSignatures = getSignaturesOfType(apparentType, 1); - if (funcType === anyType || (!callSignatures.length && !constructSignatures.length && !(funcType.flags & 16384) && isTypeAssignableTo(funcType, globalFunctionType))) { + // Technically, this signatures list may be incomplete. We are taking the apparent type, + // but we are not including call signatures that may have been added to the Object or + // Function interface, since they have none by default. This is a bit of a leap of faith + // that the user will not add any. + var callSignatures = getSignaturesOfType(apparentType, 0 /* Call */); + var constructSignatures = getSignaturesOfType(apparentType, 1 /* Construct */); + // TS 1.0 spec: 4.12 + // If FuncExpr is of type Any, or of an object type that has no call or construct signatures + // but is a subtype of the Function interface, the call is an untyped function call. In an + // untyped function call no TypeArgs are permitted, Args can be any argument list, no contextual + // types are provided for the argument expressions, and the result is always of type Any. + // We exclude union types because we may have a union of function types that happen to have + // no common signatures. + if (funcType === anyType || (!callSignatures.length && !constructSignatures.length && !(funcType.flags & 16384 /* Union */) && isTypeAssignableTo(funcType, globalFunctionType))) { if (node.typeArguments) { error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); } return resolveUntypedCall(node); } + // If FuncExpr's apparent type(section 3.8.1) is a function type, the call is a typed function call. + // TypeScript employs overload resolution in typed function calls in order to support functions + // with multiple call signatures. if (!callSignatures.length) { if (constructSignatures.length) { error(node, ts.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType)); @@ -14562,28 +17146,45 @@ var ts; return resolveCall(node, callSignatures, candidatesOutArray); } function resolveNewExpression(node, candidatesOutArray) { - if (node.arguments && languageVersion < 2) { + if (node.arguments && languageVersion < 2 /* ES6 */) { var spreadIndex = getSpreadArgumentIndex(node.arguments); if (spreadIndex >= 0) { error(node.arguments[spreadIndex], ts.Diagnostics.Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_6_and_higher); } } var expressionType = checkExpression(node.expression); + // TS 1.0 spec: 4.11 + // If ConstructExpr is of type Any, Args can be any argument + // list and the result of the operation is of type Any. if (expressionType === anyType) { if (node.typeArguments) { error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); } return resolveUntypedCall(node); } + // If ConstructExpr's apparent type(section 3.8.1) is an object type with one or + // more construct signatures, the expression is processed in the same manner as a + // function call, but using the construct signatures as the initial set of candidate + // signatures for overload resolution.The result type of the function call becomes + // the result type of the operation. expressionType = getApparentType(expressionType); if (expressionType === unknownType) { + // Another error has already been reported return resolveErrorCall(node); } - var constructSignatures = getSignaturesOfType(expressionType, 1); + // Technically, this signatures list may be incomplete. We are taking the apparent type, + // but we are not including construct signatures that may have been added to the Object or + // Function interface, since they have none by default. This is a bit of a leap of faith + // that the user will not add any. + var constructSignatures = getSignaturesOfType(expressionType, 1 /* Construct */); if (constructSignatures.length) { return resolveCall(node, constructSignatures, candidatesOutArray); } - var callSignatures = getSignaturesOfType(expressionType, 0); + // If ConstructExpr's apparent type is an object type with no construct signatures but + // one or more call signatures, the expression is processed as a function call. A compile-time + // error occurs if the result of the function call is not Void. The type of the result of the + // operation is Any. + var callSignatures = getSignaturesOfType(expressionType, 0 /* Call */); if (callSignatures.length) { var signature = resolveCall(node, callSignatures, candidatesOutArray); if (getReturnTypeOfSignature(signature) !== voidType) { @@ -14598,10 +17199,11 @@ var ts; var tagType = checkExpression(node.tag); var apparentType = getApparentType(tagType); if (apparentType === unknownType) { + // Another error has already been reported return resolveErrorCall(node); } - var callSignatures = getSignaturesOfType(apparentType, 0); - if (tagType === anyType || (!callSignatures.length && !(tagType.flags & 16384) && isTypeAssignableTo(tagType, globalFunctionType))) { + var callSignatures = getSignaturesOfType(apparentType, 0 /* Call */); + if (tagType === anyType || (!callSignatures.length && !(tagType.flags & 16384 /* Union */) && isTypeAssignableTo(tagType, globalFunctionType))) { return resolveUntypedCall(node); } if (!callSignatures.length) { @@ -14610,17 +17212,23 @@ var ts; } return resolveCall(node, callSignatures, candidatesOutArray); } + // candidatesOutArray is passed by signature help in the language service, and collectCandidates + // must fill it up with the appropriate candidate signatures function getResolvedSignature(node, candidatesOutArray) { var links = getNodeLinks(node); + // If getResolvedSignature has already been called, we will have cached the resolvedSignature. + // However, it is possible that either candidatesOutArray was not passed in the first time, + // or that a different candidatesOutArray was passed in. Therefore, we need to redo the work + // to correctly fill the candidatesOutArray. if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - if (node.kind === 157) { + if (node.kind === 157 /* CallExpression */) { links.resolvedSignature = resolveCallExpression(node, candidatesOutArray); } - else if (node.kind === 158) { + else if (node.kind === 158 /* NewExpression */) { links.resolvedSignature = resolveNewExpression(node, candidatesOutArray); } - else if (node.kind === 159) { + else if (node.kind === 159 /* TaggedTemplateExpression */) { links.resolvedSignature = resolveTaggedTemplateExpression(node, candidatesOutArray); } else { @@ -14630,17 +17238,19 @@ var ts; return links.resolvedSignature; } function checkCallExpression(node) { + // Grammar checking; stop grammar-checking if checkGrammarTypeArguments return true checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node, node.arguments); var signature = getResolvedSignature(node); - if (node.expression.kind === 91) { + if (node.expression.kind === 91 /* SuperKeyword */) { return voidType; } - if (node.kind === 158) { + if (node.kind === 158 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 135 && - declaration.kind !== 139 && - declaration.kind !== 143) { + declaration.kind !== 135 /* Constructor */ && + declaration.kind !== 139 /* ConstructSignature */ && + declaration.kind !== 143 /* ConstructorType */) { + // When resolved signature is a call signature (and not a construct signature) the result type is any if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } @@ -14654,7 +17264,7 @@ var ts; } function checkTypeAssertion(node) { var exprType = checkExpression(node.expression); - var targetType = getTypeFromTypeNodeOrHeritageClauseElement(node.type); + var targetType = getTypeFromTypeNode(node.type); if (produceDiagnostics && targetType !== unknownType) { var widenedType = getWidenedType(exprType); if (!(isTypeAssignableTo(targetType, widenedType))) { @@ -14664,14 +17274,9 @@ var ts; return targetType; } 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 ? - getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]) : - anyArrayType; + pos < signature.parameters.length - 1 ? getTypeOfSymbol(signature.parameters[pos]) : getRestTypeOfSignature(signature) : + pos < signature.parameters.length ? getTypeOfSymbol(signature.parameters[pos]) : anyType; } function assignContextualParameterTypes(signature, context, mapper) { var len = signature.parameters.length - (signature.hasRestParameter ? 1 : 0); @@ -14692,14 +17297,17 @@ var ts; return unknownType; } var type; - if (func.body.kind !== 179) { + if (func.body.kind !== 179 /* Block */) { type = checkExpressionCached(func.body, contextualMapper); } else { + // Aggregate the types of expressions within all the return statements. var types = checkAndAggregateReturnExpressionTypes(func.body, contextualMapper); if (types.length === 0) { return voidType; } + // When return statements are contextually typed we allow the return type to be a union type. Otherwise we require the + // return expressions to have a best common supertype. type = contextualSignature ? getUnionType(types) : getCommonSupertype(types); if (!type) { error(func, ts.Diagnostics.No_best_common_type_exists_among_return_expressions); @@ -14711,6 +17319,7 @@ var ts; } return getWidenedType(type); } + /// Returns a set of types relating to every return expression relating to a function block. function checkAndAggregateReturnExpressionTypes(body, contextualMapper) { var aggregatedTypes = []; ts.forEachReturnStatement(body, function (returnStatement) { @@ -14730,44 +17339,61 @@ var ts; }); } function bodyContainsSingleThrowStatement(body) { - return (body.statements.length === 1) && (body.statements[0].kind === 195); + return (body.statements.length === 1) && (body.statements[0].kind === 195 /* ThrowStatement */); } + // TypeScript Specification 1.0 (6.3) - July 2014 + // An explicitly typed function whose return type isn't the Void or the Any type + // must have at least one return statement somewhere in its body. + // An exception to this rule is if the function implementation consists of a single 'throw' statement. function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func, returnType) { if (!produceDiagnostics) { return; } + // Functions that return 'void' or 'any' don't need any return expressions. if (returnType === voidType || returnType === anyType) { return; } - if (ts.nodeIsMissing(func.body) || func.body.kind !== 179) { + // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. + if (ts.nodeIsMissing(func.body) || func.body.kind !== 179 /* Block */) { return; } var bodyBlock = func.body; + // Ensure the body has at least one return expression. if (bodyContainsAReturnStatement(bodyBlock)) { return; } + // If there are no return expressions, then we need to check if + // the function body consists solely of a throw statement; + // this is to make an exception for unimplemented functions. if (bodyContainsSingleThrowStatement(bodyBlock)) { return; } + // This function does not conform to the specification. error(func.type, ts.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement); } function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) { - ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); - var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 162) { + ts.Debug.assert(node.kind !== 134 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + // Grammar checking + var hasGrammarError = checkGrammarDeclarationNameInStrictMode(node) || checkGrammarFunctionLikeDeclaration(node); + if (!hasGrammarError && node.kind === 162 /* FunctionExpression */) { checkGrammarFunctionName(node.name) || checkGrammarForGenerator(node); } + // The identityMapper object is used to indicate that function expressions are wildcards if (contextualMapper === identityMapper && isContextSensitive(node)) { return anyFunctionType; } var links = getNodeLinks(node); var type = getTypeOfSymbol(node.symbol); - if (!(links.flags & 64)) { + // Check if function expression is contextually typed and assign parameter types if so + if (!(links.flags & 64 /* ContextChecked */)) { var contextualSignature = getContextualSignature(node); - if (!(links.flags & 64)) { - links.flags |= 64; + // If a type check is started at a function expression that is an argument of a function call, obtaining the + // contextual type may recursively get back to here during overload resolution of the call. If so, we will have + // already assigned contextual types. + if (!(links.flags & 64 /* ContextChecked */)) { + links.flags |= 64 /* ContextChecked */; if (contextualSignature) { - var signature = getSignaturesOfType(type, 0)[0]; + var signature = getSignaturesOfType(type, 0 /* Call */)[0]; if (isContextSensitive(node)) { assignContextualParameterTypes(signature, contextualSignature, contextualMapper || identityMapper); } @@ -14782,32 +17408,32 @@ var ts; checkSignatureDeclaration(node); } } - if (produceDiagnostics && node.kind !== 134 && node.kind !== 133) { + if (produceDiagnostics && node.kind !== 134 /* MethodDeclaration */ && node.kind !== 133 /* MethodSignature */) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); } return type; } function checkFunctionExpressionOrObjectLiteralMethodBody(node) { - ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); - if (node.type) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type)); + ts.Debug.assert(node.kind !== 134 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + if (node.type && !node.asteriskToken) { + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); } if (node.body) { - if (node.body.kind === 179) { + if (node.body.kind === 179 /* Block */) { checkSourceElement(node.body); } else { var exprType = checkExpression(node.body); if (node.type) { - checkTypeAssignableTo(exprType, getTypeFromTypeNodeOrHeritageClauseElement(node.type), node.body, undefined); + checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, undefined); } checkFunctionExpressionBodies(node.body); } } } function checkArithmeticOperandType(operand, type, diagnostic) { - if (!allConstituentTypesHaveKind(type, 1 | 132)) { + if (!allConstituentTypesHaveKind(type, 1 /* Any */ | 132 /* NumberLike */)) { error(operand, diagnostic); return false; } @@ -14816,21 +17442,37 @@ var ts; function checkReferenceExpression(n, invalidReferenceMessage, constantVariableMessage) { function findSymbol(n) { var symbol = getNodeLinks(n).resolvedSymbol; + // Because we got the symbol from the resolvedSymbol property, it might be of kind + // SymbolFlags.ExportValue. In this case it is necessary to get the actual export + // symbol, which will have the correct flags set on it. return symbol && getExportSymbolOfValueSymbolIfExported(symbol); } function isReferenceOrErrorExpression(n) { + // TypeScript 1.0 spec (April 2014): + // Expressions are classified as values or references. + // References are the subset of expressions that are permitted as the target of an assignment. + // Specifically, references are combinations of identifiers(section 4.3), parentheses(section 4.7), + // and property accesses(section 4.10). + // All other expression constructs described in this chapter are classified as values. switch (n.kind) { - case 65: { + case 65 /* Identifier */: { var symbol = findSymbol(n); - return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3) !== 0; + // TypeScript 1.0 spec (April 2014): 4.3 + // An identifier expression that references a variable or parameter is classified as a reference. + // An identifier expression that references any other kind of entity is classified as a value(and therefore cannot be the target of an assignment). + return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3 /* Variable */) !== 0; } - case 155: { + case 155 /* PropertyAccessExpression */: { var symbol = findSymbol(n); - return !symbol || symbol === unknownSymbol || (symbol.flags & ~8) !== 0; + // TypeScript 1.0 spec (April 2014): 4.10 + // A property access expression is always classified as a reference. + // NOTE (not in spec): assignment to enum members should not be allowed + return !symbol || symbol === unknownSymbol || (symbol.flags & ~8 /* EnumMember */) !== 0; } - case 156: + case 156 /* ElementAccessExpression */: + // old compiler doesn't check indexed assess return true; - case 161: + case 161 /* ParenthesizedExpression */: return isReferenceOrErrorExpression(n.expression); default: return false; @@ -14838,22 +17480,22 @@ var ts; } function isConstVariableReference(n) { switch (n.kind) { - case 65: - case 155: { + case 65 /* Identifier */: + case 155 /* PropertyAccessExpression */: { var symbol = findSymbol(n); - return symbol && (symbol.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 8192) !== 0; + return symbol && (symbol.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 8192 /* Const */) !== 0; } - case 156: { + case 156 /* ElementAccessExpression */: { var index = n.argumentExpression; var symbol = findSymbol(n.expression); - if (symbol && index && index.kind === 8) { + if (symbol && index && index.kind === 8 /* StringLiteral */) { var name_7 = index.text; var prop = getPropertyOfType(getTypeOfSymbol(symbol), name_7); - return prop && (prop.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 8192) !== 0; + return prop && (prop.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 8192 /* Const */) !== 0; } return false; } - case 161: + case 161 /* ParenthesizedExpression */: return isConstVariableReference(n.expression); default: return false; @@ -14870,7 +17512,10 @@ var ts; return true; } function checkDeleteExpression(node) { - if (node.parserContextFlags & 1 && node.expression.kind === 65) { + // Grammar checking + if (node.parserContextFlags & 1 /* StrictMode */ && node.expression.kind === 65 /* Identifier */) { + // When a delete operator occurs within strict mode code, a SyntaxError is thrown if its + // UnaryExpression is a direct reference to a variable, function argument, or function name grammarErrorOnNode(node.expression, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode); } var operandType = checkExpression(node.expression); @@ -14885,24 +17530,29 @@ var ts; return undefinedType; } function checkPrefixUnaryExpression(node) { - if ((node.operator === 38 || node.operator === 39)) { + // Grammar checking + // The identifier eval or arguments may not appear as the LeftHandSideExpression of an + // Assignment operator(11.13) or of a PostfixExpression(11.3) or as the UnaryExpression + // operated upon by a Prefix Increment(11.4.4) or a Prefix Decrement(11.4.5) operator + if ((node.operator === 38 /* PlusPlusToken */ || node.operator === 39 /* MinusMinusToken */)) { checkGrammarEvalOrArgumentsInStrictMode(node, node.operand); } var operandType = checkExpression(node.operand); switch (node.operator) { - case 33: - case 34: - case 47: - if (someConstituentTypeHasKind(operandType, 1048576)) { + case 33 /* PlusToken */: + case 34 /* MinusToken */: + case 47 /* TildeToken */: + if (someConstituentTypeHasKind(operandType, 1048576 /* ESSymbol */)) { error(node.operand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(node.operator)); } return numberType; - case 46: + case 46 /* ExclamationToken */: return booleanType; - case 38: - case 39: + case 38 /* PlusPlusToken */: + case 39 /* MinusMinusToken */: var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { + // run check only if former checks succeeded to avoid reporting cascading errors checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant); } return numberType; @@ -14910,19 +17560,26 @@ var ts; return unknownType; } function checkPostfixUnaryExpression(node) { + // Grammar checking + // The identifier eval or arguments may not appear as the LeftHandSideExpression of an + // Assignment operator(11.13) or of a PostfixExpression(11.3) or as the UnaryExpression + // operated upon by a Prefix Increment(11.4.4) or a Prefix Decrement(11.4.5) operator. checkGrammarEvalOrArgumentsInStrictMode(node, node.operand); var operandType = checkExpression(node.operand); var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { + // run check only if former checks succeeded to avoid reporting cascading errors checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant); } return numberType; } + // Just like isTypeOfKind below, except that it returns true if *any* constituent + // has this kind. function someConstituentTypeHasKind(type, kind) { if (type.flags & kind) { return true; } - if (type.flags & 16384) { + if (type.flags & 16384 /* Union */) { var types = type.types; for (var _i = 0; _i < types.length; _i++) { var current = types[_i]; @@ -14934,11 +17591,12 @@ var ts; } return false; } + // Return true if type has the given flags, or is a union type composed of types that all have those flags. function allConstituentTypesHaveKind(type, kind) { if (type.flags & kind) { return true; } - if (type.flags & 16384) { + if (type.flags & 16384 /* Union */) { var types = type.types; for (var _i = 0; _i < types.length; _i++) { var current = types[_i]; @@ -14951,25 +17609,35 @@ var ts; return false; } function isConstEnumObjectType(type) { - return type.flags & (48128 | 32768) && type.symbol && isConstEnumSymbol(type.symbol); + return type.flags & (48128 /* ObjectType */ | 32768 /* Anonymous */) && type.symbol && isConstEnumSymbol(type.symbol); } function isConstEnumSymbol(symbol) { - return (symbol.flags & 128) !== 0; + return (symbol.flags & 128 /* ConstEnum */) !== 0; } function checkInstanceOfExpression(node, leftType, rightType) { - if (allConstituentTypesHaveKind(leftType, 1049086)) { + // TypeScript 1.0 spec (April 2014): 4.15.4 + // The instanceof operator requires the left operand to be of type Any, an object type, or a type parameter type, + // and the right operand to be of type Any or a subtype of the 'Function' interface type. + // The result is always of the Boolean primitive type. + // NOTE: do not raise error if leftType is unknown as related error was already reported + if (allConstituentTypesHaveKind(leftType, 1049086 /* Primitive */)) { error(node.left, ts.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } - if (!(rightType.flags & 1 || isTypeSubtypeOf(rightType, globalFunctionType))) { + // NOTE: do not raise error if right is unknown as related error was already reported + if (!(rightType.flags & 1 /* Any */ || isTypeSubtypeOf(rightType, globalFunctionType))) { error(node.right, ts.Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type); } return booleanType; } function checkInExpression(node, leftType, rightType) { - if (!allConstituentTypesHaveKind(leftType, 1 | 258 | 132 | 1048576)) { + // TypeScript 1.0 spec (April 2014): 4.15.5 + // The in operator requires the left operand to be of type Any, the String primitive type, or the Number primitive type, + // and the right operand to be of type Any, an object type, or a type parameter type. + // The result is always of the Boolean primitive type. + if (!allConstituentTypesHaveKind(leftType, 1 /* Any */ | 258 /* StringLike */ | 132 /* NumberLike */ | 1048576 /* ESSymbol */)) { error(node.left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!allConstituentTypesHaveKind(rightType, 1 | 48128 | 512)) { + if (!allConstituentTypesHaveKind(rightType, 1 /* Any */ | 48128 /* ObjectType */ | 512 /* TypeParameter */)) { error(node.right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; @@ -14978,12 +17646,13 @@ var ts; var properties = node.properties; for (var _i = 0; _i < properties.length; _i++) { var p = properties[_i]; - if (p.kind === 224 || p.kind === 225) { + if (p.kind === 224 /* PropertyAssignment */ || p.kind === 225 /* ShorthandPropertyAssignment */) { + // TODO(andersh): Computed property support var name_8 = p.name; - var type = sourceType.flags & 1 ? sourceType : + var type = sourceType.flags & 1 /* Any */ ? sourceType : getTypeOfPropertyOfType(sourceType, name_8.text) || - isNumericLiteralName(name_8.text) && getIndexTypeOfType(sourceType, 1) || - getIndexTypeOfType(sourceType, 0); + isNumericLiteralName(name_8.text) && getIndexTypeOfType(sourceType, 1 /* Number */) || + getIndexTypeOfType(sourceType, 0 /* String */); if (type) { checkDestructuringAssignment(p.initializer || name_8, type); } @@ -14998,19 +17667,20 @@ var ts; return sourceType; } function checkArrayLiteralAssignment(node, sourceType, contextualMapper) { - if (!isArrayLikeType(sourceType)) { - error(node, ts.Diagnostics.Type_0_is_not_an_array_type, typeToString(sourceType)); - return sourceType; - } + // This elementType will be used if the specific property corresponding to this index is not + // present (aka the tuple element property). This call also checks that the parentType is in + // fact an iterable or array (depending on target language). + var elementType = checkIteratedTypeOrElementType(sourceType, node, false) || unknownType; var elements = node.elements; for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 175) { - if (e.kind !== 173) { + if (e.kind !== 175 /* OmittedExpression */) { + if (e.kind !== 173 /* SpreadElementExpression */) { var propName = "" + i; - var type = sourceType.flags & 1 ? sourceType : - isTupleLikeType(sourceType) ? getTypeOfPropertyOfType(sourceType, propName) : - getIndexTypeOfType(sourceType, 1); + var type = sourceType.flags & 1 /* Any */ ? sourceType : + isTupleLikeType(sourceType) + ? getTypeOfPropertyOfType(sourceType, propName) + : elementType; if (type) { checkDestructuringAssignment(e, type, contextualMapper); } @@ -15024,11 +17694,17 @@ var ts; } } else { - if (i === elements.length - 1) { - checkReferenceAssignment(e.expression, sourceType, contextualMapper); + if (i < elements.length - 1) { + error(e, ts.Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); } else { - error(e, ts.Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); + var restExpression = e.expression; + if (restExpression.kind === 169 /* BinaryExpression */ && restExpression.operatorToken.kind === 53 /* EqualsToken */) { + error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); + } + else { + checkDestructuringAssignment(restExpression, createArrayType(elementType), contextualMapper); + } } } } @@ -15036,14 +17712,14 @@ var ts; return sourceType; } function checkDestructuringAssignment(target, sourceType, contextualMapper) { - if (target.kind === 169 && target.operatorToken.kind === 53) { + if (target.kind === 169 /* BinaryExpression */ && target.operatorToken.kind === 53 /* EqualsToken */) { checkBinaryExpression(target, contextualMapper); target = target.left; } - if (target.kind === 154) { + if (target.kind === 154 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType, contextualMapper); } - if (target.kind === 153) { + if (target.kind === 153 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, contextualMapper); } return checkReferenceAssignment(target, sourceType, contextualMapper); @@ -15056,47 +17732,59 @@ var ts; return sourceType; } function checkBinaryExpression(node, contextualMapper) { + // Grammar checking if (ts.isLeftHandSideExpression(node.left) && ts.isAssignmentOperator(node.operatorToken.kind)) { + // ECMA 262 (Annex C) The identifier eval or arguments may not appear as the LeftHandSideExpression of an + // Assignment operator(11.13) or of a PostfixExpression(11.3) checkGrammarEvalOrArgumentsInStrictMode(node, node.left); } var operator = node.operatorToken.kind; - if (operator === 53 && (node.left.kind === 154 || node.left.kind === 153)) { + if (operator === 53 /* EqualsToken */ && (node.left.kind === 154 /* ObjectLiteralExpression */ || node.left.kind === 153 /* ArrayLiteralExpression */)) { 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 56: - case 36: - case 57: - case 37: - case 58: - case 34: - case 55: - case 40: - case 59: - case 41: - case 60: - case 42: - case 61: - case 44: - case 63: - case 45: - case 64: - case 43: - case 62: - if (leftType.flags & (32 | 64)) + case 35 /* AsteriskToken */: + case 56 /* AsteriskEqualsToken */: + case 36 /* SlashToken */: + case 57 /* SlashEqualsToken */: + case 37 /* PercentToken */: + case 58 /* PercentEqualsToken */: + case 34 /* MinusToken */: + case 55 /* MinusEqualsToken */: + case 40 /* LessThanLessThanToken */: + case 59 /* LessThanLessThanEqualsToken */: + case 41 /* GreaterThanGreaterThanToken */: + case 60 /* GreaterThanGreaterThanEqualsToken */: + case 42 /* GreaterThanGreaterThanGreaterThanToken */: + case 61 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 44 /* BarToken */: + case 63 /* BarEqualsToken */: + case 45 /* CaretToken */: + case 64 /* CaretEqualsToken */: + case 43 /* AmpersandToken */: + case 62 /* AmpersandEqualsToken */: + // TypeScript 1.0 spec (April 2014): 4.15.1 + // These operators require their operands to be of type Any, the Number primitive type, + // or an enum type. Operands of an enum type are treated + // as having the primitive type Number. If one operand is the null or undefined value, + // it is treated as having the type of the other operand. + // The result is always of the Number primitive type. + if (leftType.flags & (32 /* Undefined */ | 64 /* Null */)) leftType = rightType; - if (rightType.flags & (32 | 64)) + if (rightType.flags & (32 /* Undefined */ | 64 /* Null */)) rightType = leftType; var suggestedOperator; - if ((leftType.flags & 8) && - (rightType.flags & 8) && + // if a user tries to apply a bitwise operator to 2 boolean operands + // try and return them a helpful suggestion + if ((leftType.flags & 8 /* Boolean */) && + (rightType.flags & 8 /* Boolean */) && (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 { + // otherwise just check each operand separately and report errors as normal var leftOk = checkArithmeticOperandType(node.left, leftType, ts.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); var rightOk = checkArithmeticOperandType(node.right, rightType, ts.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); if (leftOk && rightOk) { @@ -15104,23 +17792,33 @@ var ts; } } return numberType; - case 33: - case 54: - if (leftType.flags & (32 | 64)) + case 33 /* PlusToken */: + case 54 /* PlusEqualsToken */: + // TypeScript 1.0 spec (April 2014): 4.15.2 + // The binary + operator requires both operands to be of the Number primitive type or an enum type, + // or at least one of the operands to be of type Any or the String primitive type. + // If one operand is the null or undefined value, it is treated as having the type of the other operand. + if (leftType.flags & (32 /* Undefined */ | 64 /* Null */)) leftType = rightType; - if (rightType.flags & (32 | 64)) + if (rightType.flags & (32 /* Undefined */ | 64 /* Null */)) rightType = leftType; var resultType; - if (allConstituentTypesHaveKind(leftType, 132) && allConstituentTypesHaveKind(rightType, 132)) { + if (allConstituentTypesHaveKind(leftType, 132 /* NumberLike */) && allConstituentTypesHaveKind(rightType, 132 /* NumberLike */)) { + // Operands of an enum type are treated as having the primitive type Number. + // If both operands are of the Number primitive type, the result is of the Number primitive type. resultType = numberType; } else { - if (allConstituentTypesHaveKind(leftType, 258) || allConstituentTypesHaveKind(rightType, 258)) { + if (allConstituentTypesHaveKind(leftType, 258 /* StringLike */) || allConstituentTypesHaveKind(rightType, 258 /* StringLike */)) { + // If one or both operands are of the String primitive type, the result is of the String primitive type. resultType = stringType; } - else if (leftType.flags & 1 || rightType.flags & 1) { + else if (leftType.flags & 1 /* Any */ || rightType.flags & 1 /* Any */) { + // Otherwise, the result is of type Any. + // NOTE: unknown type here denotes error type. Old compiler treated this case as any type so do we. resultType = anyType; } + // Symbols are not allowed at all in arithmetic expressions if (resultType && !checkForDisallowedESSymbolOperand(operator)) { return resultType; } @@ -15129,42 +17827,44 @@ var ts; reportOperatorError(); return anyType; } - if (operator === 54) { + if (operator === 54 /* PlusEqualsToken */) { checkAssignmentOperator(resultType); } return resultType; - case 24: - case 25: - case 26: - case 27: + case 24 /* LessThanToken */: + case 25 /* GreaterThanToken */: + case 26 /* LessThanEqualsToken */: + case 27 /* GreaterThanEqualsToken */: if (!checkForDisallowedESSymbolOperand(operator)) { return booleanType; } - case 28: - case 29: - case 30: - case 31: + // Fall through + case 28 /* EqualsEqualsToken */: + case 29 /* ExclamationEqualsToken */: + case 30 /* EqualsEqualsEqualsToken */: + case 31 /* ExclamationEqualsEqualsToken */: if (!isTypeAssignableTo(leftType, rightType) && !isTypeAssignableTo(rightType, leftType)) { reportOperatorError(); } return booleanType; - case 87: + case 87 /* InstanceOfKeyword */: return checkInstanceOfExpression(node, leftType, rightType); - case 86: + case 86 /* InKeyword */: return checkInExpression(node, leftType, rightType); - case 48: + case 48 /* AmpersandAmpersandToken */: return rightType; - case 49: + case 49 /* BarBarToken */: return getUnionType([leftType, rightType]); - case 53: + case 53 /* EqualsToken */: checkAssignmentOperator(rightType); return rightType; - case 23: + case 23 /* CommaToken */: return rightType; } + // Return true if there was no error, false if there was an error. function checkForDisallowedESSymbolOperand(operator) { - var offendingSymbolOperand = someConstituentTypeHasKind(leftType, 1048576) ? node.left : - someConstituentTypeHasKind(rightType, 1048576) ? node.right : + var offendingSymbolOperand = someConstituentTypeHasKind(leftType, 1048576 /* ESSymbol */) ? node.left : + someConstituentTypeHasKind(rightType, 1048576 /* ESSymbol */) ? node.right : undefined; if (offendingSymbolOperand) { error(offendingSymbolOperand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(operator)); @@ -15174,23 +17874,31 @@ var ts; } function getSuggestedBooleanOperator(operator) { switch (operator) { - case 44: - case 63: - return 49; - case 45: - case 64: - return 31; - case 43: - case 62: - return 48; + case 44 /* BarToken */: + case 63 /* BarEqualsToken */: + return 49 /* BarBarToken */; + case 45 /* CaretToken */: + case 64 /* CaretEqualsToken */: + return 31 /* ExclamationEqualsEqualsToken */; + case 43 /* AmpersandToken */: + case 62 /* AmpersandEqualsToken */: + return 48 /* AmpersandAmpersandToken */; default: return undefined; } } function checkAssignmentOperator(valueType) { - if (produceDiagnostics && operator >= 53 && operator <= 64) { + if (produceDiagnostics && operator >= 53 /* FirstAssignment */ && operator <= 64 /* LastAssignment */) { + // TypeScript 1.0 spec (April 2014): 4.17 + // An assignment of the form + // VarExpr = ValueExpr + // requires VarExpr to be classified as a reference + // A compound assignment furthermore requires VarExpr to be classified as a reference (section 4.1) + // and the type of the non - compound operation to be assignable to the type of VarExpr. 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); + // Use default messages if (ok) { + // to avoid cascading errors check assignability only if 'isReference' check succeeded and no errors were reported checkTypeAssignableTo(valueType, leftType, node.left, undefined); } } @@ -15200,7 +17908,8 @@ var ts; } } function checkYieldExpression(node) { - if (!(node.parserContextFlags & 4)) { + // Grammar checking + if (!(node.parserContextFlags & 4 /* Yield */)) { grammarErrorOnFirstToken(node, ts.Diagnostics.yield_expression_must_be_contained_within_a_generator_declaration); } else { @@ -15214,6 +17923,11 @@ var ts; return getUnionType([type1, type2]); } function checkTemplateExpression(node) { + // We just want to check each expressions, but we are unconcerned with + // the type of each expression, as any value may be coerced into a string. + // It is worth asking whether this is what we really want though. + // A place where we actually *are* concerned with the expressions' types are + // in tagged templates. ts.forEach(node.templateSpans, function (templateSpan) { checkExpression(templateSpan.expression); }); @@ -15234,14 +17948,21 @@ var ts; return links.resolvedType; } function checkPropertyAssignment(node, contextualMapper) { - if (node.name.kind === 127) { + // Do not use hasDynamicName here, because that returns false for well known symbols. + // We want to perform checkComputedPropertyName for all computed properties, including + // well known symbols. + if (node.name.kind === 127 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpression(node.initializer, contextualMapper); } function checkObjectLiteralMethod(node, contextualMapper) { + // Grammar checking checkGrammarMethod(node); - if (node.name.kind === 127) { + // Do not use hasDynamicName here, because that returns false for well known symbols. + // We want to perform checkComputedPropertyName for all computed properties, including + // well known symbols. + if (node.name.kind === 127 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); @@ -15263,11 +17984,19 @@ var ts; return type; } function checkExpression(node, contextualMapper) { + checkGrammarIdentifierInStrictMode(node); return checkExpressionOrQualifiedName(node, contextualMapper); } + // Checks an expression and returns its type. The contextualMapper parameter serves two purposes: When + // contextualMapper is not undefined and not equal to the identityMapper function object it indicates that the + // expression is being inferentially typed (section 4.12.2 in spec) and provides the type mapper to use in + // conjunction with the generic contextual type. When contextualMapper is equal to the identityMapper function + // object, it serves as an indicator that all contained function and arrow expressions should be considered to + // have the wildcard function type; this form of type check is used during overload resolution to exclude + // contextually typed function and arrow expressions in the initial phase. function checkExpressionOrQualifiedName(node, contextualMapper) { var type; - if (node.kind == 126) { + if (node.kind == 126 /* QualifiedName */) { type = checkQualifiedName(node); } else { @@ -15275,9 +18004,13 @@ var ts; type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); } if (isConstEnumObjectType(type)) { - var ok = (node.parent.kind === 155 && node.parent.expression === node) || - (node.parent.kind === 156 && node.parent.expression === node) || - ((node.kind === 65 || node.kind === 126) && isInRightSideOfImportOrExportAssignment(node)); + // enum object type for const enums are only permitted in: + // - 'left' in property access + // - 'object' in indexed access + // - target in rhs of import statement + var ok = (node.parent.kind === 155 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 156 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 65 /* Identifier */ || node.kind === 126 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node)); 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); } @@ -15285,78 +18018,82 @@ var ts; return type; } function checkNumericLiteral(node) { - checkGrammarNumbericLiteral(node); + // Grammar checking + checkGrammarNumericLiteral(node); return numberType; } function checkExpressionWorker(node, contextualMapper) { switch (node.kind) { - case 65: + case 65 /* Identifier */: return checkIdentifier(node); - case 93: + case 93 /* ThisKeyword */: return checkThisExpression(node); - case 91: + case 91 /* SuperKeyword */: return checkSuperExpression(node); - case 89: + case 89 /* NullKeyword */: return nullType; - case 95: - case 80: + case 95 /* TrueKeyword */: + case 80 /* FalseKeyword */: return booleanType; - case 7: + case 7 /* NumericLiteral */: return checkNumericLiteral(node); - case 171: + case 171 /* TemplateExpression */: return checkTemplateExpression(node); - case 8: - case 10: + case 8 /* StringLiteral */: + case 10 /* NoSubstitutionTemplateLiteral */: return stringType; - case 9: + case 9 /* RegularExpressionLiteral */: return globalRegExpType; - case 153: + case 153 /* ArrayLiteralExpression */: return checkArrayLiteral(node, contextualMapper); - case 154: + case 154 /* ObjectLiteralExpression */: return checkObjectLiteral(node, contextualMapper); - case 155: + case 155 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 156: + case 156 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 157: - case 158: + case 157 /* CallExpression */: + case 158 /* NewExpression */: return checkCallExpression(node); - case 159: + case 159 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 160: + case 160 /* TypeAssertionExpression */: return checkTypeAssertion(node); - case 161: + case 161 /* ParenthesizedExpression */: return checkExpression(node.expression, contextualMapper); - case 174: + case 174 /* ClassExpression */: return checkClassExpression(node); - case 162: - case 163: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - case 165: + case 165 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 164: + case 164 /* DeleteExpression */: return checkDeleteExpression(node); - case 166: + case 166 /* VoidExpression */: return checkVoidExpression(node); - case 167: + case 167 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 168: + case 168 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 169: + case 169 /* BinaryExpression */: return checkBinaryExpression(node, contextualMapper); - case 170: + case 170 /* ConditionalExpression */: return checkConditionalExpression(node, contextualMapper); - case 173: + case 173 /* SpreadElementExpression */: return checkSpreadElementExpression(node, contextualMapper); - case 175: + case 175 /* OmittedExpression */: return undefinedType; - case 172: + case 172 /* YieldExpression */: checkYieldExpression(node); return unknownType; } return unknownType; } + // DECLARATION AND STATEMENT TYPE CHECKING function checkTypeParameter(node) { + checkGrammarDeclarationNameInStrictMode(node); + // Grammar Checking if (node.expression) { grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected); } @@ -15365,6 +18102,7 @@ var ts; checkTypeParameterHasIllegalReferencesInConstraint(node); checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0); } + // TODO: Check multiple declarations are identical } function checkParameter(node) { // Grammar checking @@ -15373,31 +18111,33 @@ var ts; // 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) + // Grammar checking checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarEvalOrArgumentsInStrictMode(node, node.name); checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); - if (node.flags & 112) { + if (node.flags & 112 /* AccessibilityModifier */) { func = ts.getContainingFunction(node); - if (!(func.kind === 135 && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 135 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } if (node.questionToken && ts.isBindingPattern(node.name) && func.body) { error(node, ts.Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature); } - if (node.dotDotDotToken) { - if (!isArrayType(getTypeOfSymbol(node.symbol))) { - error(node, ts.Diagnostics.A_rest_parameter_must_be_of_an_array_type); - } + // Only check rest parameter type if it's not a binding pattern. Since binding patterns are + // not allowed in a rest parameter, we already have an error from checkGrammarParameterList. + if (node.dotDotDotToken && !ts.isBindingPattern(node.name) && !isArrayType(getTypeOfSymbol(node.symbol))) { + error(node, ts.Diagnostics.A_rest_parameter_must_be_of_an_array_type); } } function checkSignatureDeclaration(node) { - if (node.kind === 140) { + // Grammar checking + if (node.kind === 140 /* IndexSignature */) { checkGrammarIndexSignature(node); } - else if (node.kind === 142 || node.kind === 200 || node.kind === 143 || - node.kind === 138 || node.kind === 135 || - node.kind === 139) { + else if (node.kind === 142 /* FunctionType */ || node.kind === 200 /* FunctionDeclaration */ || node.kind === 143 /* ConstructorType */ || + node.kind === 138 /* CallSignature */ || node.kind === 135 /* Constructor */ || + node.kind === 139 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } checkTypeParameters(node.typeParameters); @@ -15409,10 +18149,10 @@ var ts; checkCollisionWithArgumentsInGeneratedCode(node); if (compilerOptions.noImplicitAny && !node.type) { switch (node.kind) { - case 139: + case 139 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 138: + case 138 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -15421,12 +18161,17 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 202) { + if (node.kind === 202 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); + // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration + // to prevent this run check only for the first declaration of a given kind if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; } } + // TypeScript 1.0 spec (April 2014) + // 3.7.4: An object type can contain at most one string index signature and one numeric index signature. + // 8.5: A class declaration can have at most one string index member declaration and one numeric index member declaration var indexSymbol = getIndexSymbol(getSymbolOfNode(node)); if (indexSymbol) { var seenNumericIndexer = false; @@ -15436,7 +18181,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 121: + case 121 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -15444,7 +18189,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 119: + case 119 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -15458,22 +18203,29 @@ var ts; } } function checkPropertyDeclaration(node) { + // Grammar checking checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarProperty(node) || checkGrammarComputedPropertyName(node.name); checkVariableLikeDeclaration(node); } function checkMethodDeclaration(node) { + // Grammar checking checkGrammarMethod(node) || checkGrammarComputedPropertyName(node.name); + // Grammar checking for modifiers is done inside the function checkGrammarFunctionLikeDeclaration checkFunctionLikeDeclaration(node); } function checkConstructorDeclaration(node) { + // Grammar check on signature of constructor and modifier of the constructor is done in checkSignatureDeclaration function. checkSignatureDeclaration(node); + // Grammar check for checking only related to constructoDeclaration checkGrammarConstructorTypeParameters(node) || checkGrammarConstructorTypeAnnotation(node); checkSourceElement(node.body); var symbol = getSymbolOfNode(node); var firstDeclaration = ts.getDeclarationOfKind(symbol, node.kind); + // Only type check the symbol once if (node === firstDeclaration) { checkFunctionOrConstructorSymbol(symbol); } + // exit early in the case of signature - super checks are not relevant to them if (ts.nodeIsMissing(node.body)) { return; } @@ -15481,43 +18233,51 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 157 && n.expression.kind === 91; + return n.kind === 157 /* CallExpression */ && n.expression.kind === 91 /* SuperKeyword */; } function containsSuperCall(n) { if (isSuperCallExpression(n)) { return true; } switch (n.kind) { - case 162: - case 200: - case 163: - case 154: return false; + case 162 /* FunctionExpression */: + case 200 /* FunctionDeclaration */: + case 163 /* ArrowFunction */: + case 154 /* ObjectLiteralExpression */: return false; default: return ts.forEachChild(n, containsSuperCall); } } function markThisReferencesAsErrors(n) { - if (n.kind === 93) { + if (n.kind === 93 /* ThisKeyword */) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 162 && n.kind !== 200) { + else if (n.kind !== 162 /* FunctionExpression */ && n.kind !== 200 /* FunctionDeclaration */) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 132 && - !(n.flags & 128) && + return n.kind === 132 /* PropertyDeclaration */ && + !(n.flags & 128 /* Static */) && !!n.initializer; } + // 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 (ts.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: + // - The containing class is a derived class. + // - The constructor declares parameter properties + // or the containing class declares instance member variables with initializers. var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || - ts.forEach(node.parameters, function (p) { return p.flags & (16 | 32 | 64); }); + ts.forEach(node.parameters, function (p) { return p.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */); }); if (superCallShouldBeFirst) { var statements = node.body.statements; - if (!statements.length || statements[0].kind !== 182 || !isSuperCallExpression(statements[0].expression)) { + if (!statements.length || statements[0].kind !== 182 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { error(node, ts.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties); } else { + // In such a required super call, it is a compile-time error for argument expressions to reference this. markThisReferencesAsErrors(statements[0].expression); } } @@ -15529,21 +18289,26 @@ var ts; } function checkAccessorDeclaration(node) { if (produceDiagnostics) { + // Grammar checking accessors checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name); - if (node.kind === 136) { + if (node.kind === 136 /* GetAccessor */) { if (!ts.isInAmbientContext(node) && ts.nodeIsPresent(node.body) && !(bodyContainsAReturnStatement(node.body) || bodyContainsSingleThrowStatement(node.body))) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement); } } if (!ts.hasDynamicName(node)) { - var otherKind = node.kind === 136 ? 137 : 136; + // TypeScript 1.0 spec (April 2014): 8.4.3 + // Accessors for the same member name must specify the same accessibility. + var otherKind = node.kind === 136 /* GetAccessor */ ? 137 /* SetAccessor */ : 136 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { - if (((node.flags & 112) !== (otherAccessor.flags & 112))) { + if (((node.flags & 112 /* AccessibilityModifier */) !== (otherAccessor.flags & 112 /* AccessibilityModifier */))) { error(node.name, ts.Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility); } var currentAccessorType = getAnnotatedAccessorType(node); var otherAccessorType = getAnnotatedAccessorType(otherAccessor); + // TypeScript 1.0 spec (April 2014): 4.5 + // If both accessors include type annotations, the specified types must be identical. if (currentAccessorType && otherAccessorType) { if (!isTypeIdenticalTo(currentAccessorType, otherAccessorType)) { error(node, ts.Diagnostics.get_and_set_accessor_must_have_the_same_type); @@ -15559,15 +18324,19 @@ var ts; checkDecorators(node); } function checkTypeReferenceNode(node) { + checkGrammarTypeReferenceInStrictMode(node.typeName); return checkTypeReferenceOrHeritageClauseElement(node); } function checkHeritageClauseElement(node) { + checkGrammarHeritageClauseElementInStrictMode(node.expression); return checkTypeReferenceOrHeritageClauseElement(node); } function checkTypeReferenceOrHeritageClauseElement(node) { + // Grammar checking checkGrammarTypeArguments(node, node.typeArguments); var type = getTypeFromTypeReferenceOrHeritageClauseElement(node); if (type !== unknownType && node.typeArguments) { + // Do type argument local checks only if referenced type is successfully resolved var len = node.typeArguments.length; for (var i = 0; i < len; i++) { checkSourceElement(node.typeArguments[i]); @@ -15594,6 +18363,7 @@ var ts; checkSourceElement(node.elementType); } function checkTupleType(node) { + // Grammar checking var hasErrorFromDisallowedTrailingComma = checkGrammarForDisallowedTrailingComma(node.elementTypes); if (!hasErrorFromDisallowedTrailingComma && node.elementTypes.length === 0) { grammarErrorOnNode(node, ts.Diagnostics.A_tuple_type_element_list_cannot_be_empty); @@ -15604,7 +18374,7 @@ var ts; ts.forEach(node.types, checkSourceElement); } function isPrivateWithinAmbient(node) { - return (node.flags & 32) && ts.isInAmbientContext(node); + return (node.flags & 32 /* Private */) && ts.isInAmbientContext(node); } function checkSpecializedSignatureDeclaration(signatureDeclarationNode) { if (!produceDiagnostics) { @@ -15614,14 +18384,21 @@ var ts; if (!signature.hasStringLiterals) { return; } + // TypeScript 1.0 spec (April 2014): 3.7.2.2 + // Specialized signatures are not permitted in conjunction with a function body if (ts.nodeIsPresent(signatureDeclarationNode.body)) { error(signatureDeclarationNode, ts.Diagnostics.A_signature_with_an_implementation_cannot_use_a_string_literal_type); return; } + // TypeScript 1.0 spec (April 2014): 3.7.2.4 + // Every specialized call or construct signature in an object type must be assignable + // to at least one non-specialized call or construct signature in the same object type var signaturesToCheck; - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 202) { - ts.Debug.assert(signatureDeclarationNode.kind === 138 || signatureDeclarationNode.kind === 139); - var signatureKind = signatureDeclarationNode.kind === 138 ? 0 : 1; + // Unnamed (call\construct) signatures in interfaces are inherited and not shadowed so examining just node symbol won't give complete answer. + // Use declaring type to obtain full list of signatures. + if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 202 /* InterfaceDeclaration */) { + ts.Debug.assert(signatureDeclarationNode.kind === 138 /* CallSignature */ || signatureDeclarationNode.kind === 139 /* ConstructSignature */); + var signatureKind = signatureDeclarationNode.kind === 138 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); var containingType = getDeclaredTypeOfSymbol(containingSymbol); signaturesToCheck = getSignaturesOfType(containingType, signatureKind); @@ -15639,11 +18416,12 @@ var ts; } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = ts.getCombinedNodeFlags(n); - if (n.parent.kind !== 202 && ts.isInAmbientContext(n)) { - if (!(flags & 2)) { - flags |= 1; + if (n.parent.kind !== 202 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { + if (!(flags & 2 /* Ambient */)) { + // It is nested in an ambient context, which means it is automatically exported + flags |= 1 /* Export */; } - flags |= 2; + flags |= 2 /* Ambient */; } return flags & flagsToCheck; } @@ -15652,22 +18430,29 @@ var ts; return; } function getCanonicalOverload(overloads, implementation) { + // Consider the canonical set of flags to be the flags of the bodyDeclaration or the first declaration + // Error on all deviations from this canonical set of flags + // The caveat is that if some overloads are defined in lib.d.ts, we don't want to + // report the errors on those. To achieve this, we will say that the implementation is + // the canonical signature only if it is in the same container as the first overload var implementationSharesContainerWithFirstOverload = implementation !== undefined && implementation.parent === overloads[0].parent; return implementationSharesContainerWithFirstOverload ? implementation : overloads[0]; } function checkFlagAgreementBetweenOverloads(overloads, implementation, flagsToCheck, someOverloadFlags, allOverloadFlags) { + // Error if some overloads have a flag that is not shared by all overloads. To find the + // deviations, we XOR someOverloadFlags with allOverloadFlags var someButNotAllOverloadFlags = someOverloadFlags ^ allOverloadFlags; if (someButNotAllOverloadFlags !== 0) { var canonicalFlags = getEffectiveDeclarationFlags(getCanonicalOverload(overloads, implementation), flagsToCheck); ts.forEach(overloads, function (o) { var deviation = getEffectiveDeclarationFlags(o, flagsToCheck) ^ canonicalFlags; - if (deviation & 1) { + if (deviation & 1 /* Export */) { error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_exported_or_not_exported); } - else if (deviation & 2) { + else if (deviation & 2 /* Ambient */) { error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient); } - else if (deviation & (32 | 64)) { + else if (deviation & (32 /* Private */ | 64 /* Protected */)) { error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_public_private_or_protected); } }); @@ -15684,7 +18469,7 @@ var ts; }); } } - var flagsToCheck = 1 | 2 | 32 | 64; + var flagsToCheck = 1 /* Export */ | 2 /* Ambient */ | 32 /* Private */ | 64 /* Protected */; var someNodeFlags = 0; var allNodeFlags = flagsToCheck; var someHaveQuestionToken = false; @@ -15694,7 +18479,7 @@ var ts; var lastSeenNonAmbientDeclaration; var previousDeclaration; var declarations = symbol.declarations; - var isConstructor = (symbol.flags & 16384) !== 0; + var isConstructor = (symbol.flags & 16384 /* Constructor */) !== 0; function reportImplementationExpectedError(node) { if (node.name && ts.nodeIsMissing(node.name)) { return; @@ -15711,10 +18496,12 @@ var ts; if (subsequentNode) { if (subsequentNode.kind === node.kind) { var errorNode_1 = subsequentNode.name || subsequentNode; + // TODO(jfreeman): These are methods, so handle computed name case if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - 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; + // the only situation when this is possible (same kind\same name but different symbol) - mixed static and instance class members + ts.Debug.assert(node.kind === 134 /* MethodDeclaration */ || node.kind === 133 /* MethodSignature */); + ts.Debug.assert((node.flags & 128 /* Static */) !== (subsequentNode.flags & 128 /* Static */)); + var diagnostic = node.flags & 128 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; error(errorNode_1, diagnostic); return; } @@ -15732,18 +18519,27 @@ var ts; error(errorNode, ts.Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration); } } - var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & 1536; + // when checking exported function declarations across modules check only duplicate implementations + // names and consistency of modifiers are verified when we check local symbol + var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & 1536 /* Module */; var duplicateFunctionDeclaration = false; var multipleConstructorImplementation = false; 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 === 202 || node.parent.kind === 145 || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 202 /* InterfaceDeclaration */ || node.parent.kind === 145 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { + // check if declarations are consecutive only if they are non-ambient + // 1. ambient declarations can be interleaved + // i.e. this is legal + // declare function foo(); + // declare function bar(); + // declare function foo(); + // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if (node.kind === 200 || node.kind === 134 || node.kind === 133 || node.kind === 135) { + if (node.kind === 200 /* FunctionDeclaration */ || node.kind === 134 /* MethodDeclaration */ || node.kind === 133 /* MethodSignature */ || node.kind === 135 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -15793,7 +18589,23 @@ var ts; if (bodyDeclaration) { var signatures = getSignaturesOfSymbol(symbol); var bodySignature = getSignatureFromDeclaration(bodyDeclaration); + // If the implementation signature has string literals, we will have reported an error in + // checkSpecializedSignatureDeclaration if (!bodySignature.hasStringLiterals) { + // TypeScript 1.0 spec (April 2014): 6.1 + // If a function declaration includes overloads, the overloads determine the call + // signatures of the type given to the function object + // and the function implementation signature must be assignable to that type + // + // TypeScript 1.0 spec (April 2014): 3.8.4 + // Note that specialized call and construct signatures (section 3.7.2.4) are not significant when determining assignment compatibility + // Consider checking against specialized signatures too. Not doing so creates a type hole: + // + // function g(x: "hi", y: boolean); + // function g(x: string, y: {}); + // function g(x: string, y: string) { } + // + // The implementation is completely unrelated to the specialized signature, yet we do not check this. for (var _a = 0; _a < signatures.length; _a++) { var signature = signatures[_a]; if (!signature.hasStringLiterals && !isSignatureAssignableTo(bodySignature, signature)) { @@ -15809,21 +18621,30 @@ var ts; if (!produceDiagnostics) { return; } + // Exports should be checked only if enclosing module contains both exported and non exported declarations. + // In case if all declarations are non-exported check is unnecessary. + // if localSymbol is defined on node then node itself is exported - check is required var symbol = node.localSymbol; if (!symbol) { + // local symbol is undefined => this declaration is non-exported. + // however symbol might contain other declarations that are exported symbol = getSymbolOfNode(node); - if (!(symbol.flags & 7340032)) { + if (!(symbol.flags & 7340032 /* Export */)) { + // this is a pure local symbol (all declarations are non-exported) - no need to check anything return; } } + // run the check only for the first declaration in the list if (ts.getDeclarationOfKind(symbol, node.kind) !== node) { return; } + // we use SymbolFlags.ExportValue, SymbolFlags.ExportType and SymbolFlags.ExportNamespace + // to denote disjoint declarationSpaces (without making new enum type). var exportedDeclarationSpaces = 0; var nonExportedDeclarationSpaces = 0; ts.forEach(symbol.declarations, function (d) { var declarationSpaces = getDeclarationSpaces(d); - if (getEffectiveDeclarationFlags(d, 1)) { + if (getEffectiveDeclarationFlags(d, 1 /* Export */)) { exportedDeclarationSpaces |= declarationSpaces; } else { @@ -15832,6 +18653,7 @@ var ts; }); var commonDeclarationSpace = exportedDeclarationSpaces & nonExportedDeclarationSpaces; if (commonDeclarationSpace) { + // declaration spaces for exported and non-exported declarations intersect ts.forEach(symbol.declarations, function (d) { if (getDeclarationSpaces(d) & commonDeclarationSpace) { error(d.name, ts.Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, ts.declarationNameToString(d.name)); @@ -15840,65 +18662,131 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 202: - return 2097152; - case 205: - return d.name.kind === 8 || ts.getModuleInstanceState(d) !== 0 - ? 4194304 | 1048576 - : 4194304; - case 201: - case 204: - return 2097152 | 1048576; - case 208: + case 202 /* InterfaceDeclaration */: + return 2097152 /* ExportType */; + case 205 /* ModuleDeclaration */: + return d.name.kind === 8 /* StringLiteral */ || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ + ? 4194304 /* ExportNamespace */ | 1048576 /* ExportValue */ + : 4194304 /* ExportNamespace */; + case 201 /* ClassDeclaration */: + case 204 /* EnumDeclaration */: + return 2097152 /* ExportType */ | 1048576 /* ExportValue */; + case 208 /* ImportEqualsDeclaration */: var result = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result |= getDeclarationSpaces(d); }); return result; default: - return 1048576; + return 1048576 /* ExportValue */; } } } + /** Check a decorator */ function checkDecorator(node) { var expression = node.expression; var exprType = checkExpression(expression); switch (node.parent.kind) { - case 201: + case 201 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); var classDecoratorType = instantiateSingleCallFunctionType(globalClassDecoratorType, [classConstructorType]); checkTypeAssignableTo(exprType, classDecoratorType, node); break; - case 132: + case 132 /* PropertyDeclaration */: checkTypeAssignableTo(exprType, globalPropertyDecoratorType, node); break; - case 134: - case 136: - case 137: + case 134 /* MethodDeclaration */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var methodDecoratorType = instantiateSingleCallFunctionType(globalMethodDecoratorType, [methodType]); checkTypeAssignableTo(exprType, methodDecoratorType, node); break; - case 129: + case 129 /* Parameter */: checkTypeAssignableTo(exprType, globalParameterDecoratorType, node); break; } } + /** Checks a type reference node as an expression. */ + function checkTypeNodeAsExpression(node) { + // When we are emitting type metadata for decorators, we need to try to check the type + // as if it were an expression so that we can emit the type in a value position when we + // serialize the type metadata. + if (node && node.kind === 141 /* TypeReference */) { + var type = getTypeFromTypeNode(node); + var shouldCheckIfUnknownType = type === unknownType && compilerOptions.separateCompilation; + if (!type || (!shouldCheckIfUnknownType && type.flags & (1048703 /* Intrinsic */ | 132 /* NumberLike */ | 258 /* 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) { + switch (node.kind) { + case 132 /* PropertyDeclaration */: + checkTypeNodeAsExpression(node.type); + break; + case 129 /* Parameter */: + checkTypeNodeAsExpression(node.type); + break; + case 134 /* MethodDeclaration */: + checkTypeNodeAsExpression(node.type); + break; + case 136 /* GetAccessor */: + checkTypeNodeAsExpression(node.type); + break; + case 137 /* 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) { + // ensure all type annotations with a value declaration are checked as an expression + for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { + var parameter = _a[_i]; + checkTypeAnnotationAsExpression(parameter); + } + } + /** Check the decorators of a node */ 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; + // skip this check for nodes that cannot have decorators. These should have already had an error reported by + // checkGrammarDecorators. + if (!ts.nodeCanBeDecorated(node)) { + 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 201 /* ClassDeclaration */: + var constructor = ts.getFirstConstructorWithBody(node); + if (constructor) { + checkParameterTypeAnnotationsAsExpressions(constructor); + } + break; + case 134 /* MethodDeclaration */: + checkParameterTypeAnnotationsAsExpressions(node); + // fall-through + case 137 /* SetAccessor */: + case 136 /* GetAccessor */: + case 132 /* PropertyDeclaration */: + case 129 /* Parameter */: + checkTypeAnnotationAsExpression(node); + break; + } + } + emitDecorate = true; + if (node.kind === 129 /* Parameter */) { + emitParam = true; } ts.forEach(node.decorators, checkDecorator); } @@ -15914,42 +18802,58 @@ var ts; } } function checkFunctionLikeDeclaration(node) { + checkGrammarDeclarationNameInStrictMode(node); checkDecorators(node); checkSignatureDeclaration(node); - if (node.name && node.name.kind === 127) { + // Do not use hasDynamicName here, because that returns false for well known symbols. + // We want to perform checkComputedPropertyName for all computed properties, including + // well known symbols. + if (node.name && node.name.kind === 127 /* ComputedPropertyName */) { + // This check will account for methods in class/interface declarations, + // as well as accessors in classes/object literals checkComputedPropertyName(node.name); } if (!ts.hasDynamicName(node)) { + // first we want to check the local symbol that contain this declaration + // - if node.localSymbol !== undefined - this is current declaration is exported and localSymbol points to the local symbol + // - if node.localSymbol === undefined - this node is non-exported so we can just pick the result of getSymbolOfNode var symbol = getSymbolOfNode(node); var localSymbol = node.localSymbol || symbol; var firstDeclaration = ts.getDeclarationOfKind(localSymbol, node.kind); + // Only type check the symbol once if (node === firstDeclaration) { checkFunctionOrConstructorSymbol(localSymbol); } if (symbol.parent) { + // run check once for the first declaration if (ts.getDeclarationOfKind(symbol, node.kind) === node) { + // run check on export symbol to check that modifiers agree across all exported declarations checkFunctionOrConstructorSymbol(symbol); } } } checkSourceElement(node.body); - if (node.type && !isAccessor(node.kind)) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type)); + if (node.type && !isAccessor(node.kind) && !node.asteriskToken) { + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); } + // Report an implicit any error if there is no body, no explicit return type, and node is not a private method + // in an ambient context if (compilerOptions.noImplicitAny && ts.nodeIsMissing(node.body) && !node.type && !isPrivateWithinAmbient(node)) { reportImplicitAnyError(node, anyType); } } function checkBlock(node) { - if (node.kind === 179) { + // Grammar checking for SyntaxKind.Block + if (node.kind === 179 /* Block */) { checkGrammarStatementInAmbientContext(node); } ts.forEach(node.statements, checkSourceElement); - if (ts.isFunctionBlock(node) || node.kind === 206) { + if (ts.isFunctionBlock(node) || node.kind === 206 /* ModuleBlock */) { checkFunctionExpressionBodies(node); } } function checkCollisionWithArgumentsInGeneratedCode(node) { + // no rest parameters \ declaration context \ overload - no codegen impact if (!ts.hasRestParameters(node) || ts.isInAmbientContext(node) || ts.nodeIsMissing(node.body)) { return; } @@ -15963,19 +18867,22 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 132 || - node.kind === 131 || - node.kind === 134 || - node.kind === 133 || - node.kind === 136 || - node.kind === 137) { + if (node.kind === 132 /* PropertyDeclaration */ || + node.kind === 131 /* PropertySignature */ || + node.kind === 134 /* MethodDeclaration */ || + node.kind === 133 /* MethodSignature */ || + node.kind === 136 /* GetAccessor */ || + node.kind === 137 /* SetAccessor */) { + // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } if (ts.isInAmbientContext(node)) { + // ambient context - no codegen impact return false; } var root = getRootDeclaration(node); - if (root.kind === 129 && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 129 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + // just an overload - no codegen impact return false; } return true; @@ -15985,11 +18892,12 @@ var ts; potentialThisCollisions.push(node); } } + // this function will run after checking the source file so 'CaptureThis' is correct for all nodes function checkIfThisIsCapturedInEnclosingScope(node) { var current = node; while (current) { - if (getNodeCheckFlags(current) & 4) { - var isDeclaration_1 = node.kind !== 65; + if (getNodeCheckFlags(current) & 4 /* CaptureThis */) { + var isDeclaration_1 = node.kind !== 65 /* Identifier */; if (isDeclaration_1) { error(node.name, ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference); } @@ -16005,12 +18913,14 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "_super")) { return; } - var enclosingClass = ts.getAncestor(node, 201); + // bubble up and find containing type + var enclosingClass = ts.getAncestor(node, 201 /* ClassDeclaration */); + // if containing type was not found or it is ambient - exit (no codegen) if (!enclosingClass || ts.isInAmbientContext(enclosingClass)) { return; } if (ts.getClassExtendsHeritageClauseElement(enclosingClass)) { - var isDeclaration_2 = node.kind !== 65; + var isDeclaration_2 = node.kind !== 65 /* Identifier */; if (isDeclaration_2) { error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); } @@ -16023,11 +18933,14 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { return; } - if (node.kind === 205 && ts.getModuleInstanceState(node) !== 1) { + // Uninstantiated modules shouldnt do this check + if (node.kind === 205 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return; } + // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 227 && ts.isExternalModule(parent)) { + if (parent.kind === 227 /* SourceFile */ && ts.isExternalModule(parent)) { + // If the declaration happens to be in external module, report error that require and exports are reserved keywords error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } @@ -16035,28 +18948,57 @@ var ts; // - 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)) { + // - Block : { StatementList } + // It is a Syntax Error if any element of the LexicallyDeclaredNames of StatementList + // also occurs in the VarDeclaredNames of StatementList. + // Variable declarations are hoisted to the top of their function scope. They can shadow + // block scoped declarations, which bind tighter. this will not be flagged as duplicate definition + // by the binder as the declaration scope is different. + // A non-initialized declaration is a no-op as the block declaration will resolve before the var + // declaration. the problem is if the declaration has an initializer. this will act as a write to the + // block declared value. this is fine for let, but not const. + // Only consider declarations with initializers, uninitialized let declarations will not + // step on a let/const variable. + // Do not consider let and const declarations, as duplicate block-scoped declarations + // are handled by the binder. + // We are only looking for let declarations that step on let\const declarations from a + // different scope. e.g.: + // { + // const x = 0; // localDeclarationSymbol obtained after name resolution will correspond to this declaration + // let x = 0; // symbol for this declaration will be 'symbol' + // } + // skip block-scoped variables and parameters + if ((ts.getCombinedNodeFlags(node) & 12288 /* BlockScoped */) !== 0 || isParameterDeclaration(node)) { return; } - if (node.kind === 198 && !node.initializer) { + // skip variable declarations that don't have initializers + // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern + // so we'll always treat binding elements as initialized + if (node.kind === 198 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); - if (symbol.flags & 1) { - var localDeclarationSymbol = resolveName(node, node.name.text, 3, undefined, undefined); + if (symbol.flags & 1 /* FunctionScopedVariable */) { + var localDeclarationSymbol = resolveName(node, node.name.text, 3 /* Variable */, 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 + localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { + if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 12288 /* BlockScoped */) { + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 199 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 180 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; + // names of block-scoped and function scoped variables can collide only + // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 179 && ts.isFunctionLike(container.parent) || - container.kind === 206 || - container.kind === 205 || - container.kind === 227); + (container.kind === 179 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 206 /* ModuleBlock */ || + container.kind === 205 /* ModuleDeclaration */ || + container.kind === 227 /* SourceFile */); + // here we know that function scoped variable is shadowed by block scoped one + // if they are defined in the same scope - binder has already reported redeclaration error + // otherwise if variable has an initializer - show error that initialization will fail + // since LHS will be block scoped name instead of function scoped if (!namesShareScope) { var name_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); @@ -16066,27 +19008,31 @@ var ts; } } function isParameterDeclaration(node) { - while (node.kind === 152) { + while (node.kind === 152 /* BindingElement */) { node = node.parent.parent; } - return node.kind === 129; + return node.kind === 129 /* Parameter */; } + // Check that a parameter initializer contains no references to parameters declared to the right of itself function checkParameterInitializer(node) { - if (getRootDeclaration(node).kind !== 129) { + if (getRootDeclaration(node).kind !== 129 /* Parameter */) { return; } var func = ts.getContainingFunction(node); visit(node.initializer); function visit(n) { - if (n.kind === 65) { + if (n.kind === 65 /* Identifier */) { var referencedSymbol = getNodeLinks(n).resolvedSymbol; - if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(func.locals, referencedSymbol.name, 107455) === referencedSymbol) { - if (referencedSymbol.valueDeclaration.kind === 129) { + // check FunctionLikeDeclaration.locals (stores parameters\function local variable) + // if it contains entry with a specified name and if this entry matches the resolved symbol + if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(func.locals, referencedSymbol.name, 107455 /* Value */) === referencedSymbol) { + if (referencedSymbol.valueDeclaration.kind === 129 /* Parameter */) { if (referencedSymbol.valueDeclaration === node) { error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.declarationNameToString(node.name)); return; } if (referencedSymbol.valueDeclaration.pos < node.pos) { + // legal case - parameter initializer references some parameter strictly on left of current parameter declaration return; } } @@ -16098,22 +19044,31 @@ var ts; } } } + // Check variable, parameter, or property declaration function checkVariableLikeDeclaration(node) { + checkGrammarDeclarationNameInStrictMode(node); checkDecorators(node); checkSourceElement(node.type); - if (node.name.kind === 127) { + // For a computed property, just check the initializer and exit + // Do not use hasDynamicName here, because that returns false for well known symbols. + // We want to perform checkComputedPropertyName for all computed properties, including + // well known symbols. + if (node.name.kind === 127 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } + // For a binding pattern, check contained binding elements if (ts.isBindingPattern(node.name)) { ts.forEach(node.name.elements, checkSourceElement); } - if (node.initializer && getRootDeclaration(node).kind === 129 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body + if (node.initializer && getRootDeclaration(node).kind === 129 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } + // For a binding pattern, validate the initializer and exit if (ts.isBindingPattern(node.name)) { if (node.initializer) { checkTypeAssignableTo(checkExpressionCached(node.initializer), getWidenedTypeForVariableLikeDeclaration(node), node, undefined); @@ -16124,12 +19079,15 @@ var ts; var symbol = getSymbolOfNode(node); var type = getTypeOfVariableOrParameterOrProperty(symbol); if (node === symbol.valueDeclaration) { + // Node is the primary declaration of the symbol, just validate the initializer if (node.initializer) { checkTypeAssignableTo(checkExpressionCached(node.initializer), type, node, undefined); checkParameterInitializer(node); } } else { + // Node is a secondary declaration, check that type is identical to primary declaration and check that + // initializer is consistent with type associated with the node var declarationType = getWidenedTypeForVariableLikeDeclaration(node); if (type !== unknownType && declarationType !== unknownType && !isTypeIdenticalTo(type, declarationType)) { error(node.name, ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, ts.declarationNameToString(node.name), typeToString(type), typeToString(declarationType)); @@ -16138,9 +19096,10 @@ var ts; checkTypeAssignableTo(checkExpressionCached(node.initializer), declarationType, node, undefined); } } - if (node.kind !== 132 && node.kind !== 131) { + if (node.kind !== 132 /* PropertyDeclaration */ && node.kind !== 131 /* PropertySignature */) { + // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 198 || node.kind === 152) { + if (node.kind === 198 /* VariableDeclaration */ || node.kind === 152 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); @@ -16157,6 +19116,7 @@ var ts; return checkVariableLikeDeclaration(node); } function checkVariableStatement(node) { + // Grammar checking checkGrammarDecorators(node) || checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || checkGrammarModifiers(node) || checkGrammarVariableDeclarationList(node.declarationList) || checkGrammarForDisallowedLetOrConstStatement(node); ts.forEach(node.declarationList.declarations, checkSourceElement); } @@ -16169,40 +19129,45 @@ var ts; } function inBlockOrObjectLiteralExpression(node) { while (node) { - if (node.kind === 179 || node.kind === 154) { + if (node.kind === 179 /* Block */ || node.kind === 154 /* ObjectLiteralExpression */) { return true; } node = node.parent; } } function checkExpressionStatement(node) { + // Grammar checking checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); } function checkIfStatement(node) { + // Grammar checking checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.thenStatement); checkSourceElement(node.elseStatement); } function checkDoStatement(node) { + // Grammar checking checkGrammarStatementInAmbientContext(node); checkSourceElement(node.statement); checkExpression(node.expression); } function checkWhileStatement(node) { + // Grammar checking checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.statement); } function checkForStatement(node) { + // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind == 199) { + if (node.initializer && node.initializer.kind == 199 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 199) { + if (node.initializer.kind === 199 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -16217,18 +19182,32 @@ var ts; } function checkForOfStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.initializer.kind === 199) { + // Check the LHS and RHS + // If the LHS is a declaration, just check it as a variable declaration, which will in turn check the RHS + // via checkRightHandSideOfForOf. + // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. + // Then check that the RHS is assignable to it. + if (node.initializer.kind === 199 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression); - if (varExpr.kind === 153 || varExpr.kind === 154) { + // There may be a destructuring assignment on the left side + if (varExpr.kind === 153 /* ArrayLiteralExpression */ || varExpr.kind === 154 /* ObjectLiteralExpression */) { + // iteratedType may be undefined. In this case, we still want to check the structure of + // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like + // to short circuit the type relation checking as much as possible, so we pass the unknownType. checkDestructuringAssignment(varExpr, iteratedType || unknownType); } else { var leftType = checkExpression(varExpr); - checkReferenceExpression(varExpr, ts.Diagnostics.Invalid_left_hand_side_in_for_of_statement, ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_be_a_previously_defined_constant); + checkReferenceExpression(varExpr, ts.Diagnostics.Invalid_left_hand_side_in_for_of_statement, + /*constantVariableMessage*/ ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_be_a_previously_defined_constant); + // iteratedType will be undefined if the rightType was missing properties/signatures + // required to get its iteratedType (like [Symbol.iterator] or next). This may be + // because we accessed properties from anyType, or it may have led to an error inside + // getIteratedType. if (iteratedType) { checkTypeAssignableTo(iteratedType, leftType, varExpr, undefined); } @@ -16237,8 +19216,14 @@ var ts; checkSourceElement(node.statement); } function checkForInStatement(node) { + // Grammar checking checkGrammarForInOrForOfStatement(node); - if (node.initializer.kind === 199) { + // TypeScript 1.0 spec (April 2014): 5.4 + // In a 'for-in' statement of the form + // for (let VarDecl in Expr) Statement + // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, + // and Expr must be an expression of type Any, an object type, or a type parameter type. + if (node.initializer.kind === 199 /* VariableDeclarationList */) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -16246,26 +19231,34 @@ var ts; checkForInOrForOfVariableDeclaration(node); } else { + // In a 'for-in' statement of the form + // for (Var in Expr) Statement + // Var must be an expression classified as a reference of type Any or the String primitive type, + // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 153 || varExpr.kind === 154) { + if (varExpr.kind === 153 /* ArrayLiteralExpression */ || varExpr.kind === 154 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } - else if (!allConstituentTypesHaveKind(leftType, 1 | 258)) { + else if (!allConstituentTypesHaveKind(leftType, 1 /* Any */ | 258 /* StringLike */)) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any); } else { + // run check only former check succeeded to avoid cascading errors checkReferenceExpression(varExpr, ts.Diagnostics.Invalid_left_hand_side_in_for_in_statement, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_previously_defined_constant); } } var rightType = checkExpression(node.expression); - if (!allConstituentTypesHaveKind(rightType, 1 | 48128 | 512)) { + // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved + // in this case error about missing name is already reported - do not report extra one + if (!allConstituentTypesHaveKind(rightType, 1 /* Any */ | 48128 /* ObjectType */ | 512 /* TypeParameter */)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); } checkSourceElement(node.statement); } function checkForInOrForOfVariableDeclaration(iterationStatement) { var variableDeclarationList = iterationStatement.initializer; + // checkGrammarForInOrForOfStatement will check that there is exactly one declaration. if (variableDeclarationList.declarations.length >= 1) { var decl = variableDeclarationList.declarations[0]; checkVariableDeclaration(decl); @@ -16273,21 +19266,40 @@ var ts; } function checkRightHandSideOfForOf(rhsExpression) { var expressionType = getTypeOfExpression(rhsExpression); - return languageVersion >= 2 - ? checkIteratedType(expressionType, rhsExpression) - : checkElementTypeOfArrayOrString(expressionType, rhsExpression); + return checkIteratedTypeOrElementType(expressionType, rhsExpression, true); } - 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; - checkTypeAssignableTo(iterable, completeIterableType, expressionForError); + function checkIteratedTypeOrElementType(inputType, errorNode, allowStringInput) { + if (inputType.flags & 1 /* Any */) { + return inputType; + } + if (languageVersion >= 2 /* ES6 */) { + return checkIteratedType(inputType, errorNode) || anyType; + } + if (allowStringInput) { + return checkElementTypeOfArrayOrString(inputType, errorNode); + } + if (isArrayLikeType(inputType)) { + var indexType = getIndexTypeOfType(inputType, 1 /* Number */); + if (indexType) { + return indexType; + } + } + error(errorNode, ts.Diagnostics.Type_0_is_not_an_array_type, typeToString(inputType)); + return unknownType; + } + /** + * When errorNode is undefined, it means we should not report any errors. + */ + function checkIteratedType(iterable, errorNode) { + ts.Debug.assert(languageVersion >= 2 /* ES6 */); + var iteratedType = getIteratedType(iterable, errorNode); + // Now even though we have extracted the iteratedType, we will have to validate that the type + // passed in is actually an Iterable. + if (errorNode && iteratedType) { + checkTypeAssignableTo(iterable, createIterableType(iteratedType), errorNode); } return iteratedType; - function getIteratedType(iterable, expressionForError) { + function getIteratedType(iterable, errorNode) { // 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): // @@ -16313,75 +19325,106 @@ var ts; // 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)) { + if (allConstituentTypesHaveKind(iterable, 1 /* Any */)) { return undefined; } + // As an optimization, if the type is instantiated directly using the globalIterableType (Iterable), + // then just grab its type argument. + if ((iterable.flags & 4096 /* Reference */) && iterable.target === globalIterableType) { + return iterable.typeArguments[0]; + } var iteratorFunction = getTypeOfPropertyOfType(iterable, ts.getPropertyNameForKnownSymbolName("iterator")); - if (iteratorFunction && allConstituentTypesHaveKind(iteratorFunction, 1)) { + if (iteratorFunction && allConstituentTypesHaveKind(iteratorFunction, 1 /* Any */)) { return undefined; } - var iteratorFunctionSignatures = iteratorFunction ? getSignaturesOfType(iteratorFunction, 0) : emptyArray; + var iteratorFunctionSignatures = iteratorFunction ? getSignaturesOfType(iteratorFunction, 0 /* Call */) : emptyArray; if (iteratorFunctionSignatures.length === 0) { - if (expressionForError) { - error(expressionForError, ts.Diagnostics.The_right_hand_side_of_a_for_of_statement_must_have_a_Symbol_iterator_method_that_returns_an_iterator); + if (errorNode) { + error(errorNode, ts.Diagnostics.Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator); } return undefined; } var iterator = getUnionType(ts.map(iteratorFunctionSignatures, getReturnTypeOfSignature)); - if (allConstituentTypesHaveKind(iterator, 1)) { + if (allConstituentTypesHaveKind(iterator, 1 /* Any */)) { return undefined; } var iteratorNextFunction = getTypeOfPropertyOfType(iterator, "next"); - if (iteratorNextFunction && allConstituentTypesHaveKind(iteratorNextFunction, 1)) { + if (iteratorNextFunction && allConstituentTypesHaveKind(iteratorNextFunction, 1 /* Any */)) { return undefined; } - var iteratorNextFunctionSignatures = iteratorNextFunction ? getSignaturesOfType(iteratorNextFunction, 0) : emptyArray; + var iteratorNextFunctionSignatures = iteratorNextFunction ? getSignaturesOfType(iteratorNextFunction, 0 /* Call */) : emptyArray; if (iteratorNextFunctionSignatures.length === 0) { - if (expressionForError) { - error(expressionForError, ts.Diagnostics.The_iterator_returned_by_the_right_hand_side_of_a_for_of_statement_must_have_a_next_method); + if (errorNode) { + error(errorNode, ts.Diagnostics.An_iterator_must_have_a_next_method); } return undefined; } var iteratorNextResult = getUnionType(ts.map(iteratorNextFunctionSignatures, getReturnTypeOfSignature)); - if (allConstituentTypesHaveKind(iteratorNextResult, 1)) { + if (allConstituentTypesHaveKind(iteratorNextResult, 1 /* Any */)) { return undefined; } var iteratorNextValue = getTypeOfPropertyOfType(iteratorNextResult, "value"); if (!iteratorNextValue) { - if (expressionForError) { - error(expressionForError, ts.Diagnostics.The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property); + if (errorNode) { + error(errorNode, ts.Diagnostics.The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property); } return undefined; } return iteratorNextValue; } } - function checkElementTypeOfArrayOrString(arrayOrStringType, expressionForError) { - ts.Debug.assert(languageVersion < 2); - var arrayType = removeTypesFromUnionType(arrayOrStringType, 258, true, true); + /** + * This function does the following steps: + * 1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents. + * 2. Take the element types of the array constituents. + * 3. Return the union of the element types, and string if there was a string constitutent. + * + * For example: + * string -> string + * number[] -> number + * string[] | number[] -> string | number + * string | number[] -> string | number + * string | string[] | number[] -> string | number + * + * It also errors if: + * 1. Some constituent is neither a string nor an array. + * 2. Some constituent is a string and target is less than ES5 (because in ES3 string is not indexable). + */ + function checkElementTypeOfArrayOrString(arrayOrStringType, errorNode) { + ts.Debug.assert(languageVersion < 2 /* ES6 */); + // After we remove all types that are StringLike, we will know if there was a string constituent + // based on whether the remaining type is the same as the initial type. + var arrayType = removeTypesFromUnionType(arrayOrStringType, 258 /* StringLike */, true, true); var hasStringConstituent = arrayOrStringType !== arrayType; var reportedError = false; if (hasStringConstituent) { - if (languageVersion < 1) { - error(expressionForError, ts.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); + if (languageVersion < 1 /* ES5 */) { + error(errorNode, ts.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); reportedError = true; } + // Now that we've removed all the StringLike types, if no constituents remain, then the entire + // arrayOrStringType was a string. if (arrayType === emptyObjectType) { return stringType; } } if (!isArrayLikeType(arrayType)) { if (!reportedError) { + // Which error we report depends on whether there was a string constituent. For example, + // if the input type is number | string, we want to say that number is not an array type. + // But if the input was just number, we want to say that number 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)); + error(errorNode, diagnostic, typeToString(arrayType)); } return hasStringConstituent ? stringType : unknownType; } - var arrayElementType = getIndexTypeOfType(arrayType, 1) || unknownType; + var arrayElementType = getIndexTypeOfType(arrayType, 1 /* Number */) || unknownType; if (hasStringConstituent) { - if (arrayElementType.flags & 258) { + // This is just an optimization for the case where arrayOrStringType is string | string[] + if (arrayElementType.flags & 258 /* StringLike */) { return stringType; } return getUnionType([arrayElementType, stringType]); @@ -16389,12 +19432,15 @@ var ts; return arrayElementType; } function checkBreakOrContinueStatement(node) { + // Grammar checking checkGrammarStatementInAmbientContext(node) || checkGrammarBreakOrContinueStatement(node); + // TODO: Check that target label is valid } function isGetAccessorWithAnnotatatedSetAccessor(node) { - return !!(node.kind === 136 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 137))); + return !!(node.kind === 136 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 137 /* SetAccessor */))); } function checkReturnStatement(node) { + // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { var functionBlock = ts.getContainingFunction(node); if (!functionBlock) { @@ -16406,11 +19452,11 @@ var ts; if (func) { var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func)); var exprType = checkExpressionCached(node.expression); - if (func.kind === 137) { + if (func.kind === 137 /* SetAccessor */) { error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); } else { - if (func.kind === 135) { + if (func.kind === 135 /* Constructor */) { if (!isTypeAssignableTo(exprType, returnType)) { error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -16423,8 +19469,9 @@ var ts; } } function checkWithStatement(node) { + // Grammar checking for withStatement if (!checkGrammarStatementInAmbientContext(node)) { - if (node.parserContextFlags & 1) { + if (node.parserContextFlags & 1 /* StrictMode */) { grammarErrorOnFirstToken(node, ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode); } } @@ -16432,12 +19479,14 @@ var ts; error(node.expression, ts.Diagnostics.All_symbols_within_a_with_block_will_be_resolved_to_any); } function checkSwitchStatement(node) { + // Grammar checking checkGrammarStatementInAmbientContext(node); var firstDefaultClause; var hasDuplicateDefaultClause = false; var expressionType = checkExpression(node.expression); ts.forEach(node.caseBlock.clauses, function (clause) { - if (clause.kind === 221 && !hasDuplicateDefaultClause) { + // Grammar check for duplicate default clauses, skip if we already report duplicate default clause + if (clause.kind === 221 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -16449,10 +19498,13 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 220) { + if (produceDiagnostics && clause.kind === 220 /* CaseClause */) { var caseClause = clause; + // TypeScript 1.0 spec (April 2014):5.9 + // In a 'switch' statement, each 'case' expression must be of a type that is assignable to or from the type of the 'switch' expression. var caseType = checkExpression(caseClause.expression); if (!isTypeAssignableTo(expressionType, caseType)) { + // check 'expressionType isAssignableTo caseType' failed, try the reversed check and report errors if it fails checkTypeAssignableTo(caseType, expressionType, caseClause.expression, undefined); } } @@ -16460,13 +19512,14 @@ var ts; }); } function checkLabeledStatement(node) { + // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { var current = node.parent; while (current) { if (ts.isFunctionLike(current)) { break; } - if (current.kind === 194 && current.label.text === node.label.text) { + if (current.kind === 194 /* LabeledStatement */ && current.label.text === node.label.text) { var sourceFile = ts.getSourceFileOfNode(node); grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNodeFromSourceText(sourceFile.text, node.label)); break; @@ -16474,9 +19527,11 @@ var ts; current = current.parent; } } + // ensure that label is unique checkSourceElement(node.statement); } function checkThrowStatement(node) { + // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { if (node.expression === undefined) { grammarErrorAfterFirstToken(node, ts.Diagnostics.Line_break_not_permitted_here); @@ -16487,12 +19542,14 @@ var ts; } } function checkTryStatement(node) { + // Grammar checking checkGrammarStatementInAmbientContext(node); checkBlock(node.tryBlock); var catchClause = node.catchClause; if (catchClause) { + // Grammar checking if (catchClause.variableDeclaration) { - if (catchClause.variableDeclaration.name.kind !== 65) { + if (catchClause.variableDeclaration.name.kind !== 65 /* Identifier */) { grammarErrorOnFirstToken(catchClause.variableDeclaration.name, ts.Diagnostics.Catch_clause_variable_name_must_be_an_identifier); } else if (catchClause.variableDeclaration.type) { @@ -16506,10 +19563,12 @@ var ts; var locals = catchClause.block.locals; if (locals && ts.hasProperty(locals, identifierName)) { var localSymbol = locals[identifierName]; - if (localSymbol && (localSymbol.flags & 2) !== 0) { + if (localSymbol && (localSymbol.flags & 2 /* BlockScopedVariable */) !== 0) { grammarErrorOnNode(localSymbol.valueDeclaration, ts.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause, identifierName); } } + // It is a SyntaxError if a TryStatement with a Catch occurs within strict code and the Identifier of the + // Catch production is eval or arguments checkGrammarEvalOrArgumentsInStrictMode(node, catchClause.variableDeclaration.name); } } @@ -16520,24 +19579,27 @@ var ts; } } function checkIndexConstraints(type) { - var declaredNumberIndexer = getIndexDeclarationOfSymbol(type.symbol, 1); - var declaredStringIndexer = getIndexDeclarationOfSymbol(type.symbol, 0); - var stringIndexType = getIndexTypeOfType(type, 0); - var numberIndexType = getIndexTypeOfType(type, 1); + var declaredNumberIndexer = getIndexDeclarationOfSymbol(type.symbol, 1 /* Number */); + var declaredStringIndexer = getIndexDeclarationOfSymbol(type.symbol, 0 /* String */); + var stringIndexType = getIndexTypeOfType(type, 0 /* String */); + var numberIndexType = getIndexTypeOfType(type, 1 /* Number */); if (stringIndexType || numberIndexType) { ts.forEach(getPropertiesOfObjectType(type), function (prop) { var propType = getTypeOfSymbol(prop); - checkIndexConstraintForProperty(prop, propType, type, declaredStringIndexer, stringIndexType, 0); - checkIndexConstraintForProperty(prop, propType, type, declaredNumberIndexer, numberIndexType, 1); + checkIndexConstraintForProperty(prop, propType, type, declaredStringIndexer, stringIndexType, 0 /* String */); + checkIndexConstraintForProperty(prop, propType, type, declaredNumberIndexer, numberIndexType, 1 /* Number */); }); - if (type.flags & 1024 && type.symbol.valueDeclaration.kind === 201) { + if (type.flags & 1024 /* Class */ && type.symbol.valueDeclaration.kind === 201 /* ClassDeclaration */) { var classDeclaration = type.symbol.valueDeclaration; for (var _i = 0, _a = classDeclaration.members; _i < _a.length; _i++) { var member = _a[_i]; - if (!(member.flags & 128) && ts.hasDynamicName(member)) { + // Only process instance properties with computed names here. + // Static properties cannot be in conflict with indexers, + // and properties with literal names were already checked. + if (!(member.flags & 128 /* Static */) && ts.hasDynamicName(member)) { var propType = getTypeOfSymbol(member.symbol); - checkIndexConstraintForProperty(member.symbol, propType, type, declaredStringIndexer, stringIndexType, 0); - checkIndexConstraintForProperty(member.symbol, propType, type, declaredNumberIndexer, numberIndexType, 1); + checkIndexConstraintForProperty(member.symbol, propType, type, declaredStringIndexer, stringIndexType, 0 /* String */); + checkIndexConstraintForProperty(member.symbol, propType, type, declaredNumberIndexer, numberIndexType, 1 /* Number */); } } } @@ -16545,8 +19607,9 @@ var ts; var errorNode; 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); }); + // condition 'errorNode === undefined' may appear if types does not declare nor string neither number indexer + if (!errorNode && (type.flags & 2048 /* Interface */)) { + var someBaseTypeHasBothIndexers = ts.forEach(getBaseTypes(type), function (base) { return getIndexTypeOfType(base, 0 /* String */) && getIndexTypeOfType(base, 1 /* Number */); }); errorNode = someBaseTypeHasBothIndexers ? undefined : type.symbol.declarations[0]; } } @@ -16557,22 +19620,28 @@ var ts; if (!indexType) { return; } - if (indexKind === 1 && !isNumericName(prop.valueDeclaration.name)) { + // index is numeric and property name is not valid numeric literal + if (indexKind === 1 /* Number */ && !isNumericName(prop.valueDeclaration.name)) { return; } + // perform property check if property or indexer is declared in 'type' + // this allows to rule out cases when both property and indexer are inherited from the base class var errorNode; - if (prop.valueDeclaration.name.kind === 127 || prop.parent === containingType.symbol) { + if (prop.valueDeclaration.name.kind === 127 /* ComputedPropertyName */ || prop.parent === containingType.symbol) { errorNode = prop.valueDeclaration; } else if (indexDeclaration) { errorNode = indexDeclaration; } - else if (containingType.flags & 2048) { - var someBaseClassHasBothPropertyAndIndexer = ts.forEach(containingType.baseTypes, function (base) { return getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind); }); + else if (containingType.flags & 2048 /* Interface */) { + // for interfaces property and indexer might be inherited from different bases + // check if any base class already has both property and indexer. + // check should be performed only if 'type' is the first type that brings property\indexer together + var someBaseClassHasBothPropertyAndIndexer = ts.forEach(getBaseTypes(containingType), 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 + var errorMessage = indexKind === 0 /* String */ ? 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)); @@ -16580,6 +19649,8 @@ var ts; } } function checkTypeNameIsReserved(name, message) { + // TS 1.0 spec (April 2014): 3.6.1 + // The predefined type keywords are reserved and cannot be used as names of user defined types. switch (name.text) { case "any": case "number": @@ -16590,6 +19661,7 @@ var ts; error(name, message, name.text); } } + // Check each type parameter and check that list has no duplicate type parameter declarations function checkTypeParameters(typeParameterDeclarations) { if (typeParameterDeclarations) { for (var i = 0, n = typeParameterDeclarations.length; i < n; i++) { @@ -16611,9 +19683,14 @@ var ts; return unknownType; } function checkClassDeclaration(node) { - if (node.parent.kind !== 206 && node.parent.kind !== 227) { + checkGrammarDeclarationNameInStrictMode(node); + // Grammar checking + if (node.parent.kind !== 206 /* ModuleBlock */ && node.parent.kind !== 227 /* SourceFile */) { grammarErrorOnNode(node, ts.Diagnostics.class_declarations_are_only_supported_directly_inside_a_module_or_as_a_top_level_declaration); } + if (!node.name && !(node.flags & 256 /* Default */)) { + grammarErrorOnFirstToken(node, ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name); + } checkGrammarClassDeclarationHeritageClauses(node); checkDecorators(node); if (node.name) { @@ -16634,19 +19711,21 @@ var ts; emitExtends = emitExtends || !ts.isInAmbientContext(node); checkHeritageClauseElement(baseTypeNode); } - if (type.baseTypes.length) { + var baseTypes = getBaseTypes(type); + if (baseTypes.length) { if (produceDiagnostics) { - var baseType = type.baseTypes[0]; + var baseType = baseTypes[0]; 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.expression, 107455)) { + if (baseType.symbol !== resolveEntityName(baseTypeNode.expression, 107455 /* Value */)) { error(baseTypeNode, ts.Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType)); } checkKindsOfPropertyMemberOverrides(type, baseType); } } - if (type.baseTypes.length || (baseTypeNode && compilerOptions.separateCompilation)) { + if (baseTypes.length || (baseTypeNode && compilerOptions.separateCompilation)) { + // Check that base type can be evaluated as expression checkExpressionOrQualifiedName(baseTypeNode.expression); } var implementedTypeNodes = ts.getClassImplementsHeritageClauseElements(node); @@ -16659,8 +19738,8 @@ var ts; if (produceDiagnostics) { var t = getTypeFromHeritageClauseElement(typeRefNode); if (t !== unknownType) { - var declaredType = (t.flags & 4096) ? t.target : t; - if (declaredType.flags & (1024 | 2048)) { + var declaredType = (t.flags & 4096 /* Reference */) ? t.target : t; + if (declaredType.flags & (1024 /* Class */ | 2048 /* Interface */)) { checkTypeAssignableTo(type, t, node.name || node, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); } else { @@ -16677,7 +19756,9 @@ var ts; } } function getTargetSymbol(s) { - return s.flags & 16777216 ? getSymbolLinks(s).target : s; + // if symbol is instantiated its flags are not copied from the 'target' + // so we'll need to get back original 'target' symbol to work with correct set of flags + return s.flags & 16777216 /* Instantiated */ ? getSymbolLinks(s).target : s; } function checkKindsOfPropertyMemberOverrides(type, baseType) { // TypeScript 1.0 spec (April 2014): 8.2.3 @@ -16693,43 +19774,47 @@ var ts; // 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. + // NOTE: assignability is checked in checkClassDeclaration var baseProperties = getPropertiesOfObjectType(baseType); for (var _i = 0; _i < baseProperties.length; _i++) { var baseProperty = baseProperties[_i]; var base = getTargetSymbol(baseProperty); - if (base.flags & 134217728) { + if (base.flags & 134217728 /* Prototype */) { continue; } var derived = getTargetSymbol(getPropertyOfObjectType(type, base.name)); if (derived) { var baseDeclarationFlags = getDeclarationFlagsFromSymbol(base); var derivedDeclarationFlags = getDeclarationFlagsFromSymbol(derived); - if ((baseDeclarationFlags & 32) || (derivedDeclarationFlags & 32)) { + if ((baseDeclarationFlags & 32 /* Private */) || (derivedDeclarationFlags & 32 /* Private */)) { + // either base or derived property is private - not override, skip it continue; } - if ((baseDeclarationFlags & 128) !== (derivedDeclarationFlags & 128)) { + if ((baseDeclarationFlags & 128 /* Static */) !== (derivedDeclarationFlags & 128 /* Static */)) { + // value of 'static' is not the same for properties - not override, skip it continue; } - if ((base.flags & derived.flags & 8192) || ((base.flags & 98308) && (derived.flags & 98308))) { + if ((base.flags & derived.flags & 8192 /* Method */) || ((base.flags & 98308 /* PropertyOrAccessor */) && (derived.flags & 98308 /* PropertyOrAccessor */))) { + // method is overridden with method or property/accessor is overridden with property/accessor - correct case continue; } var errorMessage = void 0; - if (base.flags & 8192) { - if (derived.flags & 98304) { + if (base.flags & 8192 /* Method */) { + if (derived.flags & 98304 /* Accessor */) { errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; } else { - ts.Debug.assert((derived.flags & 4) !== 0); + ts.Debug.assert((derived.flags & 4 /* Property */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property; } } - else if (base.flags & 4) { - ts.Debug.assert((derived.flags & 8192) !== 0); + else if (base.flags & 4 /* Property */) { + ts.Debug.assert((derived.flags & 8192 /* Method */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; } else { - ts.Debug.assert((base.flags & 98304) !== 0); - ts.Debug.assert((derived.flags & 8192) !== 0); + ts.Debug.assert((base.flags & 98304 /* Accessor */) !== 0); + ts.Debug.assert((derived.flags & 8192 /* Method */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; } error(derived.valueDeclaration.name, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); @@ -16737,7 +19822,7 @@ var ts; } } function isAccessor(kind) { - return kind === 136 || kind === 137; + return kind === 136 /* GetAccessor */ || kind === 137 /* SetAccessor */; } function areTypeParametersIdentical(list1, list2) { if (!list1 && !list2) { @@ -16746,6 +19831,9 @@ var ts; if (!list1 || !list2 || list1.length !== list2.length) { return false; } + // TypeScript 1.0 spec (April 2014): + // When a generic interface has multiple declarations, all declarations must have identical type parameter + // lists, i.e. identical type parameter names with identical constraints in identical order. for (var i = 0, len = list1.length; i < len; i++) { var tp1 = list1[i]; var tp2 = list2[i]; @@ -16758,24 +19846,25 @@ var ts; if (!tp1.constraint || !tp2.constraint) { return false; } - if (!isTypeIdenticalTo(getTypeFromTypeNodeOrHeritageClauseElement(tp1.constraint), getTypeFromTypeNodeOrHeritageClauseElement(tp2.constraint))) { + if (!isTypeIdenticalTo(getTypeFromTypeNode(tp1.constraint), getTypeFromTypeNode(tp2.constraint))) { return false; } } return true; } function checkInheritedPropertiesAreIdentical(type, typeNode) { - if (!type.baseTypes.length || type.baseTypes.length === 1) { + var baseTypes = getBaseTypes(type); + if (baseTypes.length < 2) { return true; } 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; _i < _a.length; _i++) { - var base = _a[_i]; + for (var _i = 0; _i < baseTypes.length; _i++) { + var base = baseTypes[_i]; var properties = getPropertiesOfObjectType(base); - for (var _b = 0; _b < properties.length; _b++) { - var prop = properties[_b]; + for (var _a = 0; _a < properties.length; _a++) { + var prop = properties[_a]; if (!ts.hasProperty(seen, prop.name)) { seen[prop.name] = { prop: prop, containingType: base }; } @@ -16796,22 +19885,25 @@ var ts; return ok; } function checkInterfaceDeclaration(node) { - checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarInterfaceDeclaration(node); + // Grammar checking + checkGrammarDeclarationNameInStrictMode(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, 202); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 202 /* InterfaceDeclaration */); if (symbol.declarations.length > 1) { if (node !== firstInterfaceDecl && !areTypeParametersIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); } } + // Only check this symbol once if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); + // run subsequent checks only if first set succeeded if (checkInheritedPropertiesAreIdentical(type, node.name)) { - ts.forEach(type.baseTypes, function (baseType) { + ts.forEach(getBaseTypes(type), function (baseType) { checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1); }); checkIndexConstraints(type); @@ -16830,20 +19922,21 @@ var ts; } } function checkTypeAliasDeclaration(node) { + // Grammar checking 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)) { + if (!(nodeLinks.flags & 128 /* EnumValuesComputed */)) { 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 !== 127 && isNumericLiteralName(member.name.text)) { + if (member.name.kind !== 127 /* ComputedPropertyName */ && isNumericLiteralName(member.name.text)) { error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name); } var initializer = member.initializer; @@ -16854,6 +19947,10 @@ var ts; error(initializer, ts.Diagnostics.In_const_enum_declarations_member_initializer_must_be_constant_expression); } else if (!ambient) { + // Only here do we need to check that the initializer is assignable to the enum type. + // If it is a constant value (not undefined), it is syntactically constrained to be a number. + // Also, we do not need to check this for ambients because there is already + // a syntax error if it is not a constant. checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, undefined); } } @@ -16873,24 +19970,24 @@ var ts; getNodeLinks(member).enumMemberValue = autoValue++; } }); - nodeLinks.flags |= 128; + nodeLinks.flags |= 128 /* EnumValuesComputed */; } function getConstantValueForEnumMemberInitializer(initializer) { return evalConstant(initializer); function evalConstant(e) { switch (e.kind) { - case 167: + case 167 /* PrefixUnaryExpression */: var value = evalConstant(e.operand); if (value === undefined) { return undefined; } switch (e.operator) { - case 33: return value; - case 34: return -value; - case 47: return ~value; + case 33 /* PlusToken */: return value; + case 34 /* MinusToken */: return -value; + case 47 /* TildeToken */: return ~value; } return undefined; - case 169: + case 169 /* BinaryExpression */: var left = evalConstant(e.left); if (left === undefined) { return undefined; @@ -16900,39 +19997,41 @@ 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 /* BarToken */: return left | right; + case 43 /* AmpersandToken */: return left & right; + case 41 /* GreaterThanGreaterThanToken */: return left >> right; + case 42 /* GreaterThanGreaterThanGreaterThanToken */: return left >>> right; + case 40 /* LessThanLessThanToken */: return left << right; + case 45 /* CaretToken */: return left ^ right; + case 35 /* AsteriskToken */: return left * right; + case 36 /* SlashToken */: return left / right; + case 33 /* PlusToken */: return left + right; + case 34 /* MinusToken */: return left - right; + case 37 /* PercentToken */: return left % right; } return undefined; - case 7: + case 7 /* NumericLiteral */: return +e.text; - case 161: + case 161 /* ParenthesizedExpression */: return evalConstant(e.expression); - case 65: - case 156: - case 155: + case 65 /* Identifier */: + case 156 /* ElementAccessExpression */: + case 155 /* PropertyAccessExpression */: var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); var enumType; var propertyName; - if (e.kind === 65) { + if (e.kind === 65 /* Identifier */) { + // unqualified names can refer to member that reside in different declaration of the enum so just doing name resolution won't work. + // instead pick current enum type and later try to fetch member from the type enumType = currentType; propertyName = e.text; } else { var expression; - if (e.kind === 156) { + if (e.kind === 156 /* ElementAccessExpression */) { if (e.argumentExpression === undefined || - e.argumentExpression.kind !== 8) { + e.argumentExpression.kind !== 8 /* StringLiteral */) { return undefined; } expression = e.expression; @@ -16942,12 +20041,13 @@ var ts; expression = e.expression; propertyName = e.name.text; } + // expression part in ElementAccess\PropertyAccess should be either identifier or dottedName var current = expression; while (current) { - if (current.kind === 65) { + if (current.kind === 65 /* Identifier */) { break; } - else if (current.kind === 155) { + else if (current.kind === 155 /* PropertyAccessExpression */) { current = current.expression; } else { @@ -16955,7 +20055,8 @@ var ts; } } enumType = checkExpression(expression); - if (!(enumType.symbol && (enumType.symbol.flags & 384))) { + // allow references to constant members of other enums + if (!(enumType.symbol && (enumType.symbol.flags & 384 /* Enum */))) { return undefined; } } @@ -16963,13 +20064,15 @@ var ts; return undefined; } var property = getPropertyOfObjectType(enumType, propertyName); - if (!property || !(property.flags & 8)) { + if (!property || !(property.flags & 8 /* EnumMember */)) { return undefined; } var propertyDecl = property.valueDeclaration; + // self references are illegal if (member === propertyDecl) { return undefined; } + // illegal case: forward reference if (!isDefinedBefore(propertyDecl, member)) { return undefined; } @@ -16982,7 +20085,8 @@ var ts; if (!produceDiagnostics) { return; } - checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarEnumDeclaration(node); + // Grammar checking + checkGrammarDeclarationNameInStrictMode(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); @@ -16992,10 +20096,17 @@ var ts; if (compilerOptions.separateCompilation && enumIsConst && ts.isInAmbientContext(node)) { error(node.name, ts.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 + // for the first member. + // + // Only perform this check once per symbol var enumSymbol = getSymbolOfNode(node); var firstDeclaration = ts.getDeclarationOfKind(enumSymbol, node.kind); if (node === firstDeclaration) { if (enumSymbol.declarations.length > 1) { + // check that const is placed\omitted on all enum declarations 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); @@ -17004,7 +20115,8 @@ var ts; } var seenEnumMissingInitialInitializer = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 204) { + // return true if we hit a violation of the rule, false otherwise + if (declaration.kind !== 204 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -17027,16 +20139,32 @@ var ts; var declarations = symbol.declarations; for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; - if ((declaration.kind === 201 || (declaration.kind === 200 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { + if ((declaration.kind === 201 /* ClassDeclaration */ || + (declaration.kind === 200 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + !ts.isInAmbientContext(declaration)) { return declaration; } } return undefined; } + function inSameLexicalScope(node1, node2) { + var container1 = ts.getEnclosingBlockScopeContainer(node1); + var container2 = ts.getEnclosingBlockScopeContainer(node2); + if (isGlobalSourceFile(container1)) { + return isGlobalSourceFile(container2); + } + else if (isGlobalSourceFile(container2)) { + return false; + } + else { + return container1 === container2; + } + } function checkModuleDeclaration(node) { if (produceDiagnostics) { - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node)) { - if (!ts.isInAmbientContext(node) && node.name.kind === 8) { + // Grammar checking + if (!checkGrammarDeclarationNameInStrictMode(node) && !checkGrammarDecorators(node) && !checkGrammarModifiers(node)) { + if (!ts.isInAmbientContext(node) && node.name.kind === 8 /* StringLiteral */) { grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names); } } @@ -17044,21 +20172,30 @@ var ts; checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - if (symbol.flags & 512 + // The following checks only apply on a non-ambient instantiated module declaration. + if (symbol.flags & 512 /* ValueModule */ && 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)) { + var firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); + if (firstNonAmbientClassOrFunc) { + if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(firstNonAmbientClassOrFunc)) { error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); } - else if (node.pos < classOrFunc.pos) { + else if (node.pos < firstNonAmbientClassOrFunc.pos) { error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); } } + // if the module merges with a class declaration in the same lexical scope, + // we need to track this to ensure the correct emit. + var mergedClass = ts.getDeclarationOfKind(symbol, 201 /* ClassDeclaration */); + if (mergedClass && + inSameLexicalScope(node, mergedClass)) { + getNodeLinks(node).flags |= 2048 /* LexicalModuleMergesWithClass */; + } } - if (node.name.kind === 8) { + // Checks for ambient external modules. + if (node.name.kind === 8 /* StringLiteral */) { if (!isGlobalSourceFile(node.parent)) { error(node.name, ts.Diagnostics.Ambient_external_modules_cannot_be_nested_in_other_modules); } @@ -17071,33 +20208,37 @@ var ts; } function getFirstIdentifier(node) { while (true) { - if (node.kind === 126) { + if (node.kind === 126 /* QualifiedName */) { node = node.left; } - else if (node.kind === 155) { + else if (node.kind === 155 /* PropertyAccessExpression */) { node = node.expression; } else { break; } } - ts.Debug.assert(node.kind === 65); + ts.Debug.assert(node.kind === 65 /* Identifier */); return node; } function checkExternalImportOrExportDeclaration(node) { var moduleName = ts.getExternalModuleName(node); - if (!ts.nodeIsMissing(moduleName) && moduleName.kind !== 8) { + if (!ts.nodeIsMissing(moduleName) && moduleName.kind !== 8 /* StringLiteral */) { error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 206 && node.parent.parent.name.kind === 8; - if (node.parent.kind !== 227 && !inAmbientExternalModule) { - error(moduleName, node.kind === 215 ? + var inAmbientExternalModule = node.parent.kind === 206 /* ModuleBlock */ && node.parent.parent.name.kind === 8 /* StringLiteral */; + if (node.parent.kind !== 227 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 215 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_an_internal_module : ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); return false; } if (inAmbientExternalModule && isExternalModuleNameRelative(moduleName.text)) { + // TypeScript 1.0 spec (April 2013): 12.1.6 + // An ExternalImportDeclaration in an AmbientExternalModuleDeclaration may reference + // other external modules only through top - level external module names. + // Relative external module names are not permitted. error(node, ts.Diagnostics.Import_or_export_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name); return false; } @@ -17107,11 +20248,11 @@ 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 /* Value */ ? 107455 /* Value */ : 0) | + (symbol.flags & 793056 /* Type */ ? 793056 /* Type */ : 0) | + (symbol.flags & 1536 /* Namespace */ ? 1536 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 217 ? + var message = node.kind === 217 /* ExportSpecifier */ ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); @@ -17124,7 +20265,7 @@ var ts; checkAliasSymbol(node); } function checkImportDeclaration(node) { - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) { + if (!checkGrammarImportDeclarationNameInStrictMode(node) && !checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499 /* Modifier */)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_import_declaration_cannot_have_modifiers); } if (checkExternalImportOrExportDeclaration(node)) { @@ -17134,7 +20275,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 211) { + if (importClause.namedBindings.kind === 211 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); } else { @@ -17145,46 +20286,51 @@ var ts; } } function checkImportEqualsDeclaration(node) { - checkGrammarDecorators(node) || checkGrammarModifiers(node); + checkGrammarDeclarationNameInStrictMode(node) || checkGrammarDecorators(node) || checkGrammarModifiers(node); if (ts.isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) { checkImportBinding(node); - if (node.flags & 1) { + if (node.flags & 1 /* Export */) { markExportAsReferenced(node); } if (ts.isInternalModuleImportEqualsDeclaration(node)) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { - if (target.flags & 107455) { + if (target.flags & 107455 /* Value */) { + // Target is a value symbol, check that it is not hidden by a local declaration with the same name var moduleName = getFirstIdentifier(node.moduleReference); - if (!(resolveEntityName(moduleName, 107455 | 1536).flags & 1536)) { + if (!(resolveEntityName(moduleName, 107455 /* Value */ | 1536 /* Namespace */).flags & 1536 /* Namespace */)) { error(moduleName, ts.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, ts.declarationNameToString(moduleName)); } } - if (target.flags & 793056) { + if (target.flags & 793056 /* Type */) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Import_name_cannot_be_0); } } } else { - if (languageVersion >= 2) { + if (languageVersion >= 2 /* ES6 */) { + // Import equals declaration is deprecated in es6 or above 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 (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499 /* Modifier */)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_declaration_cannot_have_modifiers); } if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) { if (node.exportClause) { + // export { x, y } + // export { x, y } from "foo" ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 206 && node.parent.parent.name.kind === 8; - if (node.parent.kind !== 227 && !inAmbientExternalModule) { + var inAmbientExternalModule = node.parent.kind === 206 /* ModuleBlock */ && node.parent.parent.name.kind === 8 /* StringLiteral */; + if (node.parent.kind !== 227 /* SourceFile */ && !inAmbientExternalModule) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_an_internal_module); } } else { + // export * from "foo" var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); if (moduleSymbol && moduleSymbol.exports["export="]) { error(node.moduleSpecifier, ts.Diagnostics.External_module_0_uses_export_and_cannot_be_used_with_export_Asterisk, symbolToString(moduleSymbol)); @@ -17199,38 +20345,32 @@ var ts; } } function checkExportAssignment(node) { - var container = node.parent.kind === 227 ? node.parent : node.parent.parent; - if (container.kind === 205 && container.name.kind === 65) { + var container = node.parent.kind === 227 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 205 /* ModuleDeclaration */ && container.name.kind === 65 /* Identifier */) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); return; } - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) { + // Grammar checking + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499 /* Modifier */)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_assignment_cannot_have_modifiers); } - if (node.expression) { - if (node.expression.kind === 65) { - markExportAsReferenced(node); - } - else { - checkExpressionCached(node.expression); - } + if (node.expression.kind === 65 /* Identifier */) { + markExportAsReferenced(node); } - 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); - } + else { + checkExpressionCached(node.expression); } checkExternalModuleExports(container); - if (node.isExportEquals && languageVersion >= 2) { + if (node.isExportEquals && languageVersion >= 2 /* ES6 */) { + // export assignment is deprecated in es6 or above grammarErrorOnNode(node, ts.Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead); } } function getModuleStatements(node) { - if (node.kind === 227) { + if (node.kind === 227 /* SourceFile */) { return node.statements; } - if (node.kind === 205 && node.body.kind === 206) { + if (node.kind === 205 /* ModuleDeclaration */ && node.body.kind === 206 /* ModuleBlock */) { return node.body.statements; } return emptyArray; @@ -17259,187 +20399,196 @@ var ts; if (!node) return; switch (node.kind) { - case 128: + case 128 /* TypeParameter */: return checkTypeParameter(node); - case 129: + case 129 /* Parameter */: return checkParameter(node); - case 132: - case 131: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: return checkPropertyDeclaration(node); - case 142: - case 143: - case 138: - case 139: + case 142 /* FunctionType */: + case 143 /* ConstructorType */: + case 138 /* CallSignature */: + case 139 /* ConstructSignature */: return checkSignatureDeclaration(node); - case 140: + case 140 /* IndexSignature */: return checkSignatureDeclaration(node); - case 134: - case 133: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: return checkMethodDeclaration(node); - case 135: + case 135 /* Constructor */: return checkConstructorDeclaration(node); - case 136: - case 137: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: return checkAccessorDeclaration(node); - case 141: + case 141 /* TypeReference */: return checkTypeReferenceNode(node); - case 144: + case 144 /* TypeQuery */: return checkTypeQuery(node); - case 145: + case 145 /* TypeLiteral */: return checkTypeLiteral(node); - case 146: + case 146 /* ArrayType */: return checkArrayType(node); - case 147: + case 147 /* TupleType */: return checkTupleType(node); - case 148: + case 148 /* UnionType */: return checkUnionType(node); - case 149: + case 149 /* ParenthesizedType */: return checkSourceElement(node.type); - case 200: + case 200 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 179: - case 206: + case 179 /* Block */: + case 206 /* ModuleBlock */: return checkBlock(node); - case 180: + case 180 /* VariableStatement */: return checkVariableStatement(node); - case 182: + case 182 /* ExpressionStatement */: return checkExpressionStatement(node); - case 183: + case 183 /* IfStatement */: return checkIfStatement(node); - case 184: + case 184 /* DoStatement */: return checkDoStatement(node); - case 185: + case 185 /* WhileStatement */: return checkWhileStatement(node); - case 186: + case 186 /* ForStatement */: return checkForStatement(node); - case 187: + case 187 /* ForInStatement */: return checkForInStatement(node); - case 188: + case 188 /* ForOfStatement */: return checkForOfStatement(node); - case 189: - case 190: + case 189 /* ContinueStatement */: + case 190 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 191: + case 191 /* ReturnStatement */: return checkReturnStatement(node); - case 192: + case 192 /* WithStatement */: return checkWithStatement(node); - case 193: + case 193 /* SwitchStatement */: return checkSwitchStatement(node); - case 194: + case 194 /* LabeledStatement */: return checkLabeledStatement(node); - case 195: + case 195 /* ThrowStatement */: return checkThrowStatement(node); - case 196: + case 196 /* TryStatement */: return checkTryStatement(node); - case 198: + case 198 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 152: + case 152 /* BindingElement */: return checkBindingElement(node); - case 201: + case 201 /* ClassDeclaration */: return checkClassDeclaration(node); - case 202: + case 202 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 203: + case 203 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 204: + case 204 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 205: + case 205 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 209: + case 209 /* ImportDeclaration */: return checkImportDeclaration(node); - case 208: + case 208 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 215: + case 215 /* ExportDeclaration */: return checkExportDeclaration(node); - case 214: + case 214 /* ExportAssignment */: return checkExportAssignment(node); - case 181: + case 181 /* EmptyStatement */: checkGrammarStatementInAmbientContext(node); return; - case 197: + case 197 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 218: + case 218 /* MissingDeclaration */: return checkMissingDeclaration(node); } } + // Function expression bodies are checked after all statements in the enclosing body. This is to ensure + // constructs like the following are permitted: + // let foo = function () { + // let s = foo(); + // return "hello"; + // } + // Here, performing a full type check of the body of the function expression whilst in the process of + // determining the type of foo would cause foo to be given type any because of the recursive reference. + // Delaying the type check of the body ensures foo has been assigned a type. function checkFunctionExpressionBodies(node) { switch (node.kind) { - case 162: - case 163: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: ts.forEach(node.parameters, checkFunctionExpressionBodies); checkFunctionExpressionOrObjectLiteralMethodBody(node); break; - case 134: - case 133: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: ts.forEach(node.parameters, checkFunctionExpressionBodies); if (ts.isObjectLiteralMethod(node)) { checkFunctionExpressionOrObjectLiteralMethodBody(node); } break; - case 135: - case 136: - case 137: - case 200: + case 135 /* Constructor */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 200 /* FunctionDeclaration */: ts.forEach(node.parameters, checkFunctionExpressionBodies); break; - case 192: + case 192 /* WithStatement */: checkFunctionExpressionBodies(node.expression); break; - case 129: - case 132: - case 131: - case 150: - case 151: - case 152: - case 153: - case 154: - case 224: - case 155: - case 156: - case 157: - case 158: - case 159: - case 171: - case 176: - case 160: - case 161: - case 165: - case 166: - case 164: - case 167: - case 168: - case 169: - case 170: - case 173: - case 179: - case 206: - case 180: - case 182: - case 183: - case 184: - case 185: - case 186: - case 187: - case 188: - case 189: - case 190: - case 191: - case 193: - case 207: - case 220: - case 221: - case 194: - case 195: - case 196: - case 223: - case 198: - case 199: - case 201: - case 204: - case 226: - case 214: - case 227: + case 129 /* Parameter */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 150 /* ObjectBindingPattern */: + case 151 /* ArrayBindingPattern */: + case 152 /* BindingElement */: + case 153 /* ArrayLiteralExpression */: + case 154 /* ObjectLiteralExpression */: + case 224 /* PropertyAssignment */: + case 155 /* PropertyAccessExpression */: + case 156 /* ElementAccessExpression */: + case 157 /* CallExpression */: + case 158 /* NewExpression */: + case 159 /* TaggedTemplateExpression */: + case 171 /* TemplateExpression */: + case 176 /* TemplateSpan */: + case 160 /* TypeAssertionExpression */: + case 161 /* ParenthesizedExpression */: + case 165 /* TypeOfExpression */: + case 166 /* VoidExpression */: + case 164 /* DeleteExpression */: + case 167 /* PrefixUnaryExpression */: + case 168 /* PostfixUnaryExpression */: + case 169 /* BinaryExpression */: + case 170 /* ConditionalExpression */: + case 173 /* SpreadElementExpression */: + case 179 /* Block */: + case 206 /* ModuleBlock */: + case 180 /* VariableStatement */: + case 182 /* ExpressionStatement */: + case 183 /* IfStatement */: + case 184 /* DoStatement */: + case 185 /* WhileStatement */: + case 186 /* ForStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: + case 189 /* ContinueStatement */: + case 190 /* BreakStatement */: + case 191 /* ReturnStatement */: + case 193 /* SwitchStatement */: + case 207 /* CaseBlock */: + case 220 /* CaseClause */: + case 221 /* DefaultClause */: + case 194 /* LabeledStatement */: + case 195 /* ThrowStatement */: + case 196 /* TryStatement */: + case 223 /* CatchClause */: + case 198 /* VariableDeclaration */: + case 199 /* VariableDeclarationList */: + case 201 /* ClassDeclaration */: + case 204 /* EnumDeclaration */: + case 226 /* EnumMember */: + case 214 /* ExportAssignment */: + case 227 /* SourceFile */: ts.forEachChild(node, checkFunctionExpressionBodies); break; } @@ -17449,11 +20598,15 @@ var ts; checkSourceFileWorker(node); ts.checkTime += new Date().getTime() - start; } + // Fully type check a source file and collect the relevant diagnostics. function checkSourceFileWorker(node) { var links = getNodeLinks(node); - if (!(links.flags & 1)) { + if (!(links.flags & 1 /* TypeChecked */)) { + // Grammar checking checkGrammarSourceFile(node); emitExtends = false; + emitDecorate = false; + emitParam = false; potentialThisCollisions.length = 0; ts.forEach(node.statements, checkSourceElement); checkFunctionExpressionBodies(node); @@ -17465,12 +20618,15 @@ var ts; potentialThisCollisions.length = 0; } if (emitExtends) { - links.flags |= 8; + links.flags |= 8 /* EmitExtends */; } if (emitDecorate) { - links.flags |= 512; + links.flags |= 512 /* EmitDecorate */; } - links.flags |= 1; + if (emitParam) { + links.flags |= 1024 /* EmitParam */; + } + links.flags |= 1 /* TypeChecked */; } } function getDiagnostics(sourceFile) { @@ -17491,10 +20647,11 @@ var ts; throw new Error("Trying to get diagnostics from a type checker that does not produce them."); } } + // Language service support function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 192 && node.parent.statement === node) { + if (node.parent.kind === 192 /* WithStatement */ && node.parent.statement === node) { return true; } node = node.parent; @@ -17506,6 +20663,7 @@ var ts; var symbols = {}; var memberFlags = 0; if (isInsideWithStatementBody(location)) { + // We cannot answer semantic questions within a with block, do not proceed any further return []; } populateSymbols(); @@ -17516,23 +20674,23 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 227: + case 227 /* SourceFile */: if (!ts.isExternalModule(location)) { break; } - case 205: - copySymbols(getSymbolOfNode(location).exports, meaning & 8914931); + case 205 /* ModuleDeclaration */: + copySymbols(getSymbolOfNode(location).exports, meaning & 8914931 /* ModuleMember */); break; - case 204: - copySymbols(getSymbolOfNode(location).exports, meaning & 8); + case 204 /* EnumDeclaration */: + copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 201: - case 202: - if (!(memberFlags & 128)) { - copySymbols(getSymbolOfNode(location).members, meaning & 793056); + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + if (!(memberFlags & 128 /* Static */)) { + copySymbols(getSymbolOfNode(location).members, meaning & 793056 /* Type */); } break; - case 162: + case 162 /* FunctionExpression */: if (location.name) { copySymbol(location.symbol, meaning); } @@ -17543,6 +20701,7 @@ var ts; } copySymbols(globals, meaning); } + // Returns 'true' if we should stop processing symbols. function copySymbol(symbol, meaning) { if (symbol.flags & meaning) { var id = symbol.name; @@ -17561,6 +20720,7 @@ var ts; } } if (isInsideWithStatementBody(location)) { + // We cannot answer semantic questions within a with block, do not proceed any further return []; } while (location) { @@ -17568,22 +20728,22 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 227: + case 227 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 205: - copySymbols(getSymbolOfNode(location).exports, meaning & 8914931); + case 205 /* ModuleDeclaration */: + copySymbols(getSymbolOfNode(location).exports, meaning & 8914931 /* ModuleMember */); break; - case 204: - copySymbols(getSymbolOfNode(location).exports, meaning & 8); + case 204 /* EnumDeclaration */: + copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 201: - case 202: - if (!(memberFlags & 128)) { - copySymbols(getSymbolOfNode(location).members, meaning & 793056); + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + if (!(memberFlags & 128 /* Static */)) { + copySymbols(getSymbolOfNode(location).members, meaning & 793056 /* Type */); } break; - case 162: + case 162 /* FunctionExpression */: if (location.name) { copySymbol(location.symbol, meaning); } @@ -17596,110 +20756,124 @@ var ts; return symbolsToArray(symbols); } function isTypeDeclarationName(name) { - return name.kind == 65 && + return name.kind == 65 /* Identifier */ && isTypeDeclaration(name.parent) && name.parent.name === name; } function isTypeDeclaration(node) { switch (node.kind) { - case 128: - case 201: - case 202: - case 203: - case 204: + case 128 /* TypeParameter */: + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + case 203 /* TypeAliasDeclaration */: + case 204 /* EnumDeclaration */: return true; } } + // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 126) { + while (node.parent && node.parent.kind === 126 /* QualifiedName */) { node = node.parent; } - return node.parent && node.parent.kind === 141; + return node.parent && node.parent.kind === 141 /* TypeReference */; } function isHeritageClauseElementIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 155) { + while (node.parent && node.parent.kind === 155 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent && node.parent.kind === 177; + return node.parent && node.parent.kind === 177 /* HeritageClauseElement */; } - function isTypeNodeOrHeritageClauseElement(node) { - if (141 <= node.kind && node.kind <= 149) { + function isTypeNode(node) { + if (141 /* FirstTypeNode */ <= node.kind && node.kind <= 149 /* LastTypeNode */) { return true; } switch (node.kind) { - case 112: - case 119: - case 121: - case 113: - case 122: + case 112 /* AnyKeyword */: + case 119 /* NumberKeyword */: + case 121 /* StringKeyword */: + case 113 /* BooleanKeyword */: + case 122 /* SymbolKeyword */: return true; - case 99: - return node.parent.kind !== 166; - case 8: - return node.parent.kind === 129; - case 177: + case 99 /* VoidKeyword */: + return node.parent.kind !== 166 /* VoidExpression */; + case 8 /* StringLiteral */: + // Specialized signatures can have string literals as their parameters' type names + return node.parent.kind === 129 /* Parameter */; + case 177 /* HeritageClauseElement */: return true; - case 65: - if (node.parent.kind === 126 && node.parent.right === node) { + // Identifiers and qualified names may be type nodes, depending on their context. Climb + // above them to find the lowest container + case 65 /* Identifier */: + // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. + if (node.parent.kind === 126 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 155 && node.parent.name === node) { + else if (node.parent.kind === 155 /* PropertyAccessExpression */ && 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'."); + // fall through + case 126 /* QualifiedName */: + case 155 /* PropertyAccessExpression */: + // At this point, node is either a qualified name or an identifier + ts.Debug.assert(node.kind === 65 /* Identifier */ || node.kind === 126 /* QualifiedName */ || node.kind === 155 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); var parent_5 = node.parent; - if (parent_5.kind === 144) { + if (parent_5.kind === 144 /* TypeQuery */) { return false; } - if (141 <= parent_5.kind && parent_5.kind <= 149) { + // Do not recursively call isTypeNode on the parent. In the example: + // + // let a: A.B.C; + // + // Calling isTypeNode would consider the qualified name A.B a type node. Only C or + // A.B.C is a type node. + if (141 /* FirstTypeNode */ <= parent_5.kind && parent_5.kind <= 149 /* LastTypeNode */) { return true; } switch (parent_5.kind) { - case 177: + case 177 /* HeritageClauseElement */: return true; - case 128: + case 128 /* TypeParameter */: return node === parent_5.constraint; - case 132: - case 131: - case 129: - case 198: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 129 /* Parameter */: + case 198 /* VariableDeclaration */: return node === parent_5.type; - case 200: - case 162: - case 163: - case 135: - case 134: - case 133: - case 136: - case 137: + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: + case 135 /* Constructor */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: return node === parent_5.type; - case 138: - case 139: - case 140: + case 138 /* CallSignature */: + case 139 /* ConstructSignature */: + case 140 /* IndexSignature */: return node === parent_5.type; - case 160: + case 160 /* TypeAssertionExpression */: return node === parent_5.type; - case 157: - case 158: + case 157 /* CallExpression */: + case 158 /* NewExpression */: return parent_5.typeArguments && ts.indexOf(parent_5.typeArguments, node) >= 0; - case 159: + case 159 /* TaggedTemplateExpression */: + // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } } return false; } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 126) { + while (nodeOnRightSide.parent.kind === 126 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 208) { + if (nodeOnRightSide.parent.kind === 208 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 214) { + if (nodeOnRightSide.parent.kind === 214 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -17711,11 +20885,13 @@ var ts; if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 214) { - return resolveEntityName(entityName, 107455 | 793056 | 1536 | 8388608); + if (entityName.parent.kind === 214 /* ExportAssignment */) { + return resolveEntityName(entityName, + /*all meanings*/ 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */ | 8388608 /* Alias */); } - if (entityName.kind !== 155) { + if (entityName.kind !== 155 /* PropertyAccessExpression */) { if (isInRightSideOfImportOrExportAssignment(entityName)) { + // Since we already checked for ExportAssignment, this really could only be an Import return getSymbolOfPartOfRightHandSideOfImportEquals(entityName); } } @@ -17723,26 +20899,29 @@ var ts; entityName = entityName.parent; } if (isHeritageClauseElementIdentifier(entityName)) { - var meaning = entityName.parent.kind === 177 ? 793056 : 1536; - meaning |= 8388608; + var meaning = entityName.parent.kind === 177 /* HeritageClauseElement */ ? 793056 /* Type */ : 1536 /* Namespace */; + meaning |= 8388608 /* Alias */; return resolveEntityName(entityName, meaning); } else if (ts.isExpression(entityName)) { if (ts.nodeIsMissing(entityName)) { + // Missing entity name. return undefined; } - if (entityName.kind === 65) { - var meaning = 107455 | 8388608; + if (entityName.kind === 65 /* Identifier */) { + // Include aliases in the meaning, this ensures that we do not follow aliases to where they point and instead + // return the alias symbol. + var meaning = 107455 /* Value */ | 8388608 /* Alias */; return resolveEntityName(entityName, meaning); } - else if (entityName.kind === 155) { + else if (entityName.kind === 155 /* PropertyAccessExpression */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccessExpression(entityName); } return getNodeLinks(entityName).resolvedSymbol; } - else if (entityName.kind === 126) { + else if (entityName.kind === 126 /* QualifiedName */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkQualifiedName(entityName); @@ -17751,49 +20930,58 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 141 ? 793056 : 1536; - meaning |= 8388608; + var meaning = entityName.parent.kind === 141 /* TypeReference */ ? 793056 /* Type */ : 1536 /* Namespace */; + // Include aliases in the meaning, this ensures that we do not follow aliases to where they point and instead + // return the alias symbol. + meaning |= 8388608 /* Alias */; return resolveEntityName(entityName, meaning); } + // Do we want to return undefined here? return undefined; } function getSymbolInfo(node) { if (isInsideWithStatementBody(node)) { + // We cannot answer semantic questions within a with block, do not proceed any further return undefined; } if (ts.isDeclarationName(node)) { + // This is a declaration, call getSymbolOfNode return getSymbolOfNode(node.parent); } - if (node.kind === 65 && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 214 + if (node.kind === 65 /* Identifier */ && isInRightSideOfImportOrExportAssignment(node)) { + return node.parent.kind === 214 /* ExportAssignment */ ? getSymbolOfEntityNameOrPropertyAccessExpression(node) : getSymbolOfPartOfRightHandSideOfImportEquals(node); } switch (node.kind) { - case 65: - case 155: - case 126: + case 65 /* Identifier */: + case 155 /* PropertyAccessExpression */: + case 126 /* QualifiedName */: return getSymbolOfEntityNameOrPropertyAccessExpression(node); - case 93: - case 91: + case 93 /* ThisKeyword */: + case 91 /* SuperKeyword */: var type = checkExpression(node); return type.symbol; - case 114: + case 114 /* ConstructorKeyword */: + // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 135) { + if (constructorDeclaration && constructorDeclaration.kind === 135 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; - case 8: + case 8 /* StringLiteral */: + // External module name in an import declaration var moduleName; if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 209 || node.parent.kind === 215) && + ((node.parent.kind === 209 /* ImportDeclaration */ || node.parent.kind === 215 /* ExportDeclaration */) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } - case 7: - if (node.parent.kind == 156 && node.parent.argumentExpression === node) { + // Intentional fall-through + case 7 /* NumericLiteral */: + // index access + if (node.parent.kind == 156 /* ElementAccessExpression */ && node.parent.argumentExpression === node) { var objectType = checkExpression(node.parent.expression); if (objectType === unknownType) return undefined; @@ -17807,22 +20995,27 @@ var ts; return undefined; } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 225) { - return resolveEntityName(location.name, 107455); + // The function returns a value symbol of an identifier in the short-hand property assignment. + // This is necessary as an identifier in short-hand property assignment can contains two meaning: + // property name and property value. + if (location && location.kind === 225 /* ShorthandPropertyAssignment */) { + return resolveEntityName(location.name, 107455 /* Value */); } return undefined; } function getTypeOfNode(node) { if (isInsideWithStatementBody(node)) { + // We cannot answer semantic questions within a with block, do not proceed any further return unknownType; } - if (isTypeNodeOrHeritageClauseElement(node)) { - return getTypeFromTypeNodeOrHeritageClauseElement(node); + if (isTypeNode(node)) { + return getTypeFromTypeNode(node); } if (ts.isExpression(node)) { return getTypeOfExpression(node); } if (isTypeDeclaration(node)) { + // In this case, we call getSymbolOfNode instead of getSymbolInfo because it is a declaration var symbol = getSymbolOfNode(node); return getDeclaredTypeOfSymbol(symbol); } @@ -17831,6 +21024,7 @@ var ts; return symbol && getDeclaredTypeOfSymbol(symbol); } if (ts.isDeclaration(node)) { + // In this case, we call getSymbolOfNode instead of getSymbolInfo because it is a declaration var symbol = getSymbolOfNode(node); return getTypeOfSymbol(symbol); } @@ -17851,10 +21045,12 @@ var ts; } return checkExpression(expr); } + // Return the list of properties of the given type, augmented with properties from Function + // if the type has call or construct signatures function getAugmentedPropertiesOfType(type) { type = getApparentType(type); var propsByName = createSymbolTable(getPropertiesOfType(type)); - if (getSignaturesOfType(type, 0).length || getSignaturesOfType(type, 1).length) { + if (getSignaturesOfType(type, 0 /* Call */).length || getSignaturesOfType(type, 1 /* Construct */).length) { ts.forEach(getPropertiesOfType(globalFunctionType), function (p) { if (!ts.hasProperty(propsByName, p.name)) { propsByName[p.name] = p; @@ -17864,7 +21060,7 @@ var ts; return getNamedMembers(propsByName); } function getRootSymbols(symbol) { - if (symbol.flags & 268435456) { + if (symbol.flags & 268435456 /* UnionProperty */) { var symbols = []; var name_10 = symbol.name; ts.forEach(getSymbolLinks(symbol).unionType.types, function (t) { @@ -17872,7 +21068,7 @@ var ts; }); return symbols; } - else if (symbol.flags & 67108864) { + else if (symbol.flags & 67108864 /* Transient */) { var target = getSymbolLinks(symbol).target; if (target) { return [target]; @@ -17880,19 +21076,29 @@ var ts; } return [symbol]; } + // Emitter support function isExternalModuleSymbol(symbol) { - return symbol.flags & 512 && symbol.declarations.length === 1 && symbol.declarations[0].kind === 227; + return symbol.flags & 512 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 227 /* SourceFile */; } function getAliasNameSubstitution(symbol, getGeneratedNameForNode) { - if (languageVersion >= 2) { + // If this is es6 or higher, just use the name of the export + // no need to qualify it. + if (languageVersion >= 2 /* ES6 */) { return undefined; } var node = getDeclarationOfAliasSymbol(symbol); if (node) { - if (node.kind === 210) { - return getGeneratedNameForNode(node.parent) + ".default"; + if (node.kind === 210 /* ImportClause */) { + var defaultKeyword; + if (languageVersion === 0 /* ES3 */) { + defaultKeyword = "[\"default\"]"; + } + else { + defaultKeyword = ".default"; + } + return getGeneratedNameForNode(node.parent) + defaultKeyword; } - if (node.kind === 213) { + if (node.kind === 213 /* ImportSpecifier */) { var moduleName = getGeneratedNameForNode(node.parent.parent.parent); var propertyName = node.propertyName || node.name; return moduleName + "." + ts.unescapeIdentifier(propertyName.text); @@ -17901,7 +21107,9 @@ var ts; } function getExportNameSubstitution(symbol, location, getGeneratedNameForNode) { if (isExternalModuleSymbol(symbol.parent)) { - if (languageVersion >= 2) { + // If this is es6 or higher, just use the name of the export + // no need to qualify it. + if (languageVersion >= 2 /* ES6 */) { return undefined; } return "exports." + ts.unescapeIdentifier(symbol.name); @@ -17909,7 +21117,7 @@ var ts; var node = location; var containerSymbol = getParentOfSymbol(symbol); while (node) { - if ((node.kind === 205 || node.kind === 204) && getSymbolOfNode(node) === containerSymbol) { + if ((node.kind === 205 /* ModuleDeclaration */ || node.kind === 204 /* EnumDeclaration */) && getSymbolOfNode(node) === containerSymbol) { return getGeneratedNameForNode(node) + "." + ts.unescapeIdentifier(symbol.name); } node = node.parent; @@ -17918,36 +21126,43 @@ var ts; function getExpressionNameSubstitution(node, getGeneratedNameForNode) { var symbol = getNodeLinks(node).resolvedSymbol || (ts.isDeclarationName(node) ? getSymbolOfNode(node.parent) : undefined); if (symbol) { + // Whan an identifier resolves to a parented symbol, it references an exported entity from + // another declaration of the same internal module. if (symbol.parent) { return getExportNameSubstitution(symbol, node.parent, getGeneratedNameForNode); } + // If we reference an exported entity within the same module declaration, then whether + // we prefix depends on the kind of entity. SymbolFlags.ExportHasLocal encompasses all the + // kinds that we do NOT prefix. var exportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); - if (symbol !== exportSymbol && !(exportSymbol.flags & 944)) { + if (symbol !== exportSymbol && !(exportSymbol.flags & 944 /* ExportHasLocal */)) { return getExportNameSubstitution(exportSymbol, node.parent, getGeneratedNameForNode); } - if (symbol.flags & 8388608) { + // Named imports from ES6 import declarations are rewritten + if (symbol.flags & 8388608 /* Alias */) { return getAliasNameSubstitution(symbol, getGeneratedNameForNode); } } } function isValueAliasDeclaration(node) { switch (node.kind) { - case 208: - case 210: - case 211: - case 213: - case 217: + case 208 /* ImportEqualsDeclaration */: + case 210 /* ImportClause */: + case 211 /* NamespaceImport */: + case 213 /* ImportSpecifier */: + case 217 /* ExportSpecifier */: return isAliasResolvedToValue(getSymbolOfNode(node)); - case 215: + case 215 /* ExportDeclaration */: var exportClause = node.exportClause; return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 214: - return node.expression && node.expression.kind === 65 ? isAliasResolvedToValue(getSymbolOfNode(node)) : true; + case 214 /* ExportAssignment */: + return node.expression && node.expression.kind === 65 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node)) : true; } return false; } function isTopLevelValueImportEqualsWithEntityName(node) { - if (node.parent.kind !== 227 || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node.parent.kind !== 227 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + // parent is not source file or it is not reference to internal module return false; } var isValue = isAliasResolvedToValue(getSymbolOfNode(node)); @@ -17958,7 +21173,8 @@ var ts; if (target === unknownSymbol && compilerOptions.separateCompilation) { return true; } - return target !== unknownSymbol && target && target.flags & 107455 && !isConstEnumOrConstEnumOnlyModule(target); + // const enums and modules that contain only const enums are not considered values from the emit perespective + return target !== unknownSymbol && target && target.flags & 107455 /* Value */ && !isConstEnumOrConstEnumOnlyModule(target); } function isConstEnumOrConstEnumOnlyModule(s) { return isConstEnumSymbol(s) || s.constEnumOnlyModule; @@ -17979,7 +21195,18 @@ var ts; if (ts.nodeIsPresent(node.body)) { var symbol = getSymbolOfNode(node); var signaturesOfSymbol = getSignaturesOfSymbol(symbol); + // If this function body corresponds to function with multiple signature, it is implementation of overload + // e.g.: function foo(a: string): string; + // function foo(a: number): number; + // function foo(a: any) { // This is implementation of the overloads + // return a; + // } return signaturesOfSymbol.length > 1 || + // If there is single signature for the symbol, it is overload if that signature isn't coming from the node + // e.g.: function foo(a: string): string; + // function foo(a: any) { // This is implementation of the overloads + // return a; + // } (signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node); } return false; @@ -17992,20 +21219,209 @@ var ts; return getNodeLinks(node).enumMemberValue; } function getConstantValue(node) { - if (node.kind === 226) { + if (node.kind === 226 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; - if (symbol && (symbol.flags & 8)) { + if (symbol && (symbol.flags & 8 /* EnumMember */)) { + // inline property\index accesses only for const enums if (ts.isConstEnumDeclaration(symbol.valueDeclaration.parent)) { return getEnumMemberValue(symbol.valueDeclaration); } } return undefined; } + /** Serializes an EntityName (with substitutions) to an appropriate JS constructor value. Used by the __metadata decorator. */ + function serializeEntityName(node, getGeneratedNameForNode, fallbackPath) { + if (node.kind === 65 /* 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, getGeneratedNameForNode) { + // 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". + var type = getTypeFromTypeReference(node); + if (type.flags & 16 /* Void */) { + return "void 0"; + } + else if (type.flags & 8 /* Boolean */) { + return "Boolean"; + } + else if (type.flags & 132 /* NumberLike */) { + return "Number"; + } + else if (type.flags & 258 /* StringLike */) { + return "String"; + } + else if (type.flags & 8192 /* Tuple */) { + return "Array"; + } + else if (type.flags & 1048576 /* ESSymbol */) { + return "Symbol"; + } + else if (type === unknownType) { + var fallbackPath = []; + 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, getGeneratedNameForNode) { + // 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 99 /* VoidKeyword */: + return "void 0"; + case 149 /* ParenthesizedType */: + return serializeTypeNode(node.type, getGeneratedNameForNode); + case 142 /* FunctionType */: + case 143 /* ConstructorType */: + return "Function"; + case 146 /* ArrayType */: + case 147 /* TupleType */: + return "Array"; + case 113 /* BooleanKeyword */: + return "Boolean"; + case 121 /* StringKeyword */: + case 8 /* StringLiteral */: + return "String"; + case 119 /* NumberKeyword */: + return "Number"; + case 141 /* TypeReference */: + return serializeTypeReferenceNode(node, getGeneratedNameForNode); + case 144 /* TypeQuery */: + case 145 /* TypeLiteral */: + case 148 /* UnionType */: + case 112 /* AnyKeyword */: + break; + default: + ts.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, getGeneratedNameForNode) { + // 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 201 /* ClassDeclaration */: return "Function"; + case 132 /* PropertyDeclaration */: return serializeTypeNode(node.type, getGeneratedNameForNode); + case 129 /* Parameter */: return serializeTypeNode(node.type, getGeneratedNameForNode); + case 136 /* GetAccessor */: return serializeTypeNode(node.type, getGeneratedNameForNode); + case 137 /* SetAccessor */: return serializeTypeNode(getSetAccessorTypeAnnotationNode(node), getGeneratedNameForNode); + } + if (ts.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, getGeneratedNameForNode) { + // 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; + if (node.kind === 201 /* ClassDeclaration */) { + valueDeclaration = ts.getFirstConstructorWithBody(node); + } + else if (ts.isFunctionLike(node) && ts.nodeIsPresent(node.body)) { + valueDeclaration = node; + } + if (valueDeclaration) { + var result; + 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 === 146 /* ArrayType */) { + parameterType = parameterType.elementType; + } + else if (parameterType.kind === 141 /* 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, getGeneratedNameForNode) { + if (node && ts.isFunctionLike(node)) { + return serializeTypeNode(node.type, getGeneratedNameForNode); + } + return "void 0"; + } function writeTypeOfDeclaration(declaration, enclosingDeclaration, flags, writer) { + // Get type of the symbol if this is the valid symbol otherwise get type at location var symbol = getSymbolOfNode(declaration); - var type = symbol && !(symbol.flags & (2048 | 131072)) + var type = symbol && !(symbol.flags & (2048 /* TypeLiteral */ | 131072 /* Signature */)) ? getTypeOfSymbol(symbol) : unknownType; getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); @@ -18023,18 +21439,20 @@ var ts; } function resolvesToSomeValue(location, name) { ts.Debug.assert(!ts.nodeIsSynthesized(location), "resolvesToSomeValue called with a synthesized location"); - return !!resolveName(location, name, 107455, undefined, undefined); + return !!resolveName(location, name, 107455 /* Value */, undefined, undefined); } function getBlockScopedVariableId(n) { ts.Debug.assert(!ts.nodeIsSynthesized(n)); - var isVariableDeclarationOrBindingElement = n.parent.kind === 152 || (n.parent.kind === 198 && n.parent.name === n); + var isVariableDeclarationOrBindingElement = n.parent.kind === 152 /* BindingElement */ || (n.parent.kind === 198 /* VariableDeclaration */ && n.parent.name === n); var symbol = (isVariableDeclarationOrBindingElement ? getSymbolOfNode(n.parent) : undefined) || getNodeLinks(n).resolvedSymbol || - resolveName(n, n.text, 107455 | 8388608, undefined, undefined); + resolveName(n, n.text, 107455 /* Value */ | 8388608 /* Alias */, undefined, undefined); var isLetOrConst = symbol && - (symbol.flags & 2) && - symbol.valueDeclaration.parent.kind !== 223; + (symbol.flags & 2 /* BlockScopedVariable */) && + symbol.valueDeclaration.parent.kind !== 223 /* CatchClause */; if (isLetOrConst) { + // side-effect of calling this method: + // assign id to symbol if it was not yet set getSymbolLinks(symbol); return symbol.id; } @@ -18069,22 +21487,29 @@ var ts; getConstantValue: getConstantValue, resolvesToSomeValue: resolvesToSomeValue, collectLinkedAliases: collectLinkedAliases, - getBlockScopedVariableId: getBlockScopedVariableId + getBlockScopedVariableId: getBlockScopedVariableId, + serializeTypeOfNode: serializeTypeOfNode, + serializeParameterTypesOfNode: serializeParameterTypesOfNode, + serializeReturnTypeOfNode: serializeReturnTypeOfNode }; } function initializeTypeChecker() { + // Bind all source files and propagate errors ts.forEach(host.getSourceFiles(), function (file) { ts.bindSourceFile(file); }); + // Initialize global symbol table ts.forEach(host.getSourceFiles(), function (file) { if (!ts.isExternalModule(file)) { mergeSymbolTable(globals, file.locals); } }); + // Initialize special symbols getSymbolLinks(undefinedSymbol).type = undefinedType; getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments"); getSymbolLinks(unknownSymbol).type = unknownType; globals[undefinedSymbol.name] = undefinedSymbol; + // Initialize special types globalArraySymbol = getGlobalTypeSymbol("Array"); globalArrayType = getTypeOfGlobalSymbol(globalArraySymbol, 1); globalObjectType = getGlobalType("Object"); @@ -18098,7 +21523,9 @@ var ts; globalPropertyDecoratorType = getGlobalType("PropertyDecorator"); globalMethodDecoratorType = getGlobalType("MethodDecorator"); globalParameterDecoratorType = getGlobalType("ParameterDecorator"); - if (languageVersion >= 2) { + // If we're in ES6 mode, load the TemplateStringsArray. + // Otherwise, default to 'unknown' for the purposes of type checking in LS scenarios. + if (languageVersion >= 2 /* ES6 */) { globalTemplateStringsArrayType = getGlobalType("TemplateStringsArray"); globalESSymbolType = getGlobalType("Symbol"); globalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol"); @@ -18106,51 +21533,186 @@ var ts; } else { globalTemplateStringsArrayType = unknownType; + // Consider putting Symbol interface in lib.d.ts. On the plus side, putting it in lib.d.ts would make it + // extensible for Polyfilling Symbols. But putting it into lib.d.ts could also break users that have + // a global Symbol already, particularly if it is a class. globalESSymbolType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); globalESSymbolConstructorSymbol = undefined; } anyArrayType = createArrayType(anyType); } + // GRAMMAR CHECKING + function isReservedWordInStrictMode(node) { + // Check that originalKeywordKind is less than LastFutureReservedWord to see if an Identifier is a strict-mode reserved word + return (node.parserContextFlags & 1 /* StrictMode */) && + (node.originalKeywordKind >= 102 /* FirstFutureReservedWord */ && node.originalKeywordKind <= 110 /* LastFutureReservedWord */); + } + function reportStrictModeGrammarErrorInClassDeclaration(identifier, message, arg0, arg1, arg2) { + // We are checking if this name is inside class declaration or class expression (which are under class definitions inside ES6 spec.) + // if so, we would like to give more explicit invalid usage error. + if (ts.getAncestor(identifier, 201 /* ClassDeclaration */) || ts.getAncestor(identifier, 174 /* ClassExpression */)) { + return grammarErrorOnNode(identifier, message, arg0); + } + return false; + } + function checkGrammarImportDeclarationNameInStrictMode(node) { + // Check if the import declaration used strict-mode reserved word in its names bindings + if (node.importClause) { + var impotClause = node.importClause; + if (impotClause.namedBindings) { + var nameBindings = impotClause.namedBindings; + if (nameBindings.kind === 211 /* NamespaceImport */) { + var name_11 = nameBindings.name; + if (name_11.originalKeywordKind) { + var nameText = ts.declarationNameToString(name_11); + return grammarErrorOnNode(name_11, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); + } + } + else if (nameBindings.kind === 212 /* NamedImports */) { + var reportError = false; + for (var _i = 0, _a = nameBindings.elements; _i < _a.length; _i++) { + var element = _a[_i]; + var name_12 = element.name; + if (name_12.originalKeywordKind) { + var nameText = ts.declarationNameToString(name_12); + reportError = reportError || grammarErrorOnNode(name_12, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); + } + } + return reportError; + } + } + } + return false; + } + function checkGrammarDeclarationNameInStrictMode(node) { + var name = node.name; + if (name && name.kind === 65 /* Identifier */ && isReservedWordInStrictMode(name)) { + var nameText = ts.declarationNameToString(name); + switch (node.kind) { + case 129 /* Parameter */: + case 198 /* VariableDeclaration */: + case 200 /* FunctionDeclaration */: + case 128 /* TypeParameter */: + case 152 /* BindingElement */: + case 202 /* InterfaceDeclaration */: + case 203 /* TypeAliasDeclaration */: + case 204 /* EnumDeclaration */: + return checkGrammarIdentifierInStrictMode(name); + case 201 /* ClassDeclaration */: + // Report an error if the class declaration uses strict-mode reserved word. + return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText); + case 205 /* ModuleDeclaration */: + // Report an error if the module declaration uses strict-mode reserved word. + // TODO(yuisu): fix this when having external module in strict mode + return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); + case 208 /* ImportEqualsDeclaration */: + // TODO(yuisu): fix this when having external module in strict mode + return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); + } + } + return false; + } + function checkGrammarTypeReferenceInStrictMode(typeName) { + // Check if the type reference is using strict mode keyword + // Example: + // class C { + // foo(x: public){} // Error. + // } + if (typeName.kind === 65 /* Identifier */) { + checkGrammarTypeNameInStrictMode(typeName); + } + else if (typeName.kind === 126 /* QualifiedName */) { + // Walk from right to left and report a possible error at each Identifier in QualifiedName + // Example: + // x1: public.private.package // error at public and private + checkGrammarTypeNameInStrictMode(typeName.right); + checkGrammarTypeReferenceInStrictMode(typeName.left); + } + } + // This function will report an error for every identifier in property access expression + // whether it violates strict mode reserved words. + // Example: + // public // error at public + // public.private.package // error at public + // B.private.B // no error + function checkGrammarHeritageClauseElementInStrictMode(expression) { + // Example: + // class C extends public // error at public + if (expression && expression.kind === 65 /* Identifier */) { + return checkGrammarIdentifierInStrictMode(expression); + } + else if (expression && expression.kind === 155 /* PropertyAccessExpression */) { + // Walk from left to right in PropertyAccessExpression until we are at the left most expression + // in PropertyAccessExpression. According to grammar production of MemberExpression, + // the left component expression is a PrimaryExpression (i.e. Identifier) while the other + // component after dots can be IdentifierName. + checkGrammarHeritageClauseElementInStrictMode(expression.expression); + } + } + // The function takes an identifier itself or an expression which has SyntaxKind.Identifier. + function checkGrammarIdentifierInStrictMode(node, nameText) { + if (node && node.kind === 65 /* Identifier */ && isReservedWordInStrictMode(node)) { + if (!nameText) { + nameText = ts.declarationNameToString(node); + } + // TODO (yuisu): Fix when module is a strict mode + var errorReport = reportStrictModeGrammarErrorInClassDeclaration(node, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText) || + grammarErrorOnNode(node, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); + return errorReport; + } + return false; + } + // The function takes an identifier when uses as a typeName in TypeReferenceNode + function checkGrammarTypeNameInStrictMode(node) { + if (node && node.kind === 65 /* Identifier */ && isReservedWordInStrictMode(node)) { + var nameText = ts.declarationNameToString(node); + // TODO (yuisu): Fix when module is a strict mode + var errorReport = reportStrictModeGrammarErrorInClassDeclaration(node, ts.Diagnostics.Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText) || + grammarErrorOnNode(node, ts.Diagnostics.Type_expected_0_is_a_reserved_word_in_strict_mode, nameText); + return errorReport; + } + return false; + } function checkGrammarDecorators(node) { if (!node.decorators) { return false; } if (!ts.nodeCanBeDecorated(node)) { - return grammarErrorOnNode(node, ts.Diagnostics.Decorators_are_not_valid_here); + return grammarErrorOnFirstToken(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 (languageVersion < 1 /* ES5 */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher); } - else if (node.kind === 136 || node.kind === 137) { + else if (node.kind === 136 /* GetAccessor */ || node.kind === 137 /* SetAccessor */) { 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 grammarErrorOnFirstToken(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 136: - case 137: - case 135: - case 132: - case 131: - case 134: - case 133: - case 140: - case 201: - case 202: - case 205: - case 204: - case 180: - case 200: - case 203: - case 209: - case 208: - case 215: - case 214: - case 129: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 135 /* Constructor */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 140 /* IndexSignature */: + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + case 205 /* ModuleDeclaration */: + case 204 /* EnumDeclaration */: + case 180 /* VariableStatement */: + case 200 /* FunctionDeclaration */: + case 203 /* TypeAliasDeclaration */: + case 209 /* ImportDeclaration */: + case 208 /* ImportEqualsDeclaration */: + case 215 /* ExportDeclaration */: + case 214 /* ExportAssignment */: + case 129 /* Parameter */: break; default: return false; @@ -18163,14 +21725,14 @@ var ts; 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 108 /* PublicKeyword */: + case 107 /* ProtectedKeyword */: + case 106 /* PrivateKeyword */: var text = void 0; - if (modifier.kind === 109) { + if (modifier.kind === 108 /* PublicKeyword */) { text = "public"; } - else if (modifier.kind === 108) { + else if (modifier.kind === 107 /* ProtectedKeyword */) { text = "protected"; lastProtected = modifier; } @@ -18178,81 +21740,81 @@ var ts; text = "private"; lastPrivate = modifier; } - if (flags & 112) { + if (flags & 112 /* AccessibilityModifier */) { return grammarErrorOnNode(modifier, ts.Diagnostics.Accessibility_modifier_already_seen); } - else if (flags & 128) { + else if (flags & 128 /* Static */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); } - else if (node.parent.kind === 206 || node.parent.kind === 227) { + else if (node.parent.kind === 206 /* ModuleBlock */ || node.parent.kind === 227 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); } flags |= ts.modifierToFlag(modifier.kind); break; - case 110: - if (flags & 128) { + case 109 /* StaticKeyword */: + if (flags & 128 /* Static */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static"); } - else if (node.parent.kind === 206 || node.parent.kind === 227) { + else if (node.parent.kind === 206 /* ModuleBlock */ || node.parent.kind === 227 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); } - else if (node.kind === 129) { + else if (node.kind === 129 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } - flags |= 128; + flags |= 128 /* Static */; lastStatic = modifier; break; - case 78: - if (flags & 1) { + case 78 /* ExportKeyword */: + if (flags & 1 /* Export */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "export"); } - else if (flags & 2) { + else if (flags & 2 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); } - else if (node.parent.kind === 201) { + else if (node.parent.kind === 201 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 129) { + else if (node.kind === 129 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } - flags |= 1; + flags |= 1 /* Export */; break; - case 115: - if (flags & 2) { + case 115 /* DeclareKeyword */: + if (flags & 2 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); } - else if (node.parent.kind === 201) { + else if (node.parent.kind === 201 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 129) { + else if (node.kind === 129 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 206) { + else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 206 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } - flags |= 2; + flags |= 2 /* Ambient */; lastDeclare = modifier; break; } } - if (node.kind === 135) { - if (flags & 128) { + if (node.kind === 135 /* Constructor */) { + if (flags & 128 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } - else if (flags & 64) { + else if (flags & 64 /* Protected */) { return grammarErrorOnNode(lastProtected, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "protected"); } - else if (flags & 32) { + else if (flags & 32 /* Private */) { return grammarErrorOnNode(lastPrivate, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); } } - else if ((node.kind === 209 || node.kind === 208) && flags & 2) { + else if ((node.kind === 209 /* ImportDeclaration */ || node.kind === 208 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 202 && flags & 2) { + else if (node.kind === 202 /* InterfaceDeclaration */ && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); } - else if (node.kind === 129 && (flags & 112) && ts.isBindingPattern(node.name)) { + else if (node.kind === 129 /* Parameter */ && (flags & 112 /* AccessibilityModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_a_binding_pattern); } } @@ -18286,6 +21848,9 @@ var ts; if (i !== (parameterCount - 1)) { return grammarErrorOnNode(parameter.dotDotDotToken, ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); } + if (ts.isBindingPattern(parameter.name)) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); + } if (parameter.questionToken) { return grammarErrorOnNode(parameter.questionToken, ts.Diagnostics.A_rest_parameter_cannot_be_optional); } @@ -18307,12 +21872,13 @@ var ts; } } function checkGrammarFunctionLikeDeclaration(node) { + // Prevent cascading error by short-circuit 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) { + if (node.kind === 163 /* ArrowFunction */) { var arrowFunction = node; var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; @@ -18335,7 +21901,7 @@ var ts; if (parameter.dotDotDotToken) { return grammarErrorOnNode(parameter.dotDotDotToken, ts.Diagnostics.An_index_signature_cannot_have_a_rest_parameter); } - if (parameter.flags & 499) { + if (parameter.flags & 499 /* Modifier */) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); } if (parameter.questionToken) { @@ -18347,7 +21913,7 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 121 && parameter.type.kind !== 119) { + if (parameter.type.kind !== 121 /* StringKeyword */ && parameter.type.kind !== 119 /* NumberKeyword */) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); } if (!node.type) { @@ -18355,11 +21921,12 @@ var ts; } } function checkGrammarForIndexSignatureModifier(node) { - if (node.flags & 499) { + if (node.flags & 499 /* Modifier */) { grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_not_permitted_on_index_signature_members); } } function checkGrammarIndexSignature(node) { + // Prevent cascading error by short-circuit return checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarIndexSignatureParameters(node) || checkGrammarForIndexSignatureModifier(node); } function checkGrammarForAtLeastOneTypeArgument(node, typeArguments) { @@ -18379,7 +21946,7 @@ var ts; var sourceFile = ts.getSourceFileOfNode(node); for (var _i = 0; _i < arguments.length; _i++) { var arg = arguments[_i]; - if (arg.kind === 175) { + if (arg.kind === 175 /* OmittedExpression */) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -18406,7 +21973,7 @@ var ts; 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 === 79) { + if (heritageClause.token === 79 /* ExtendsKeyword */) { if (seenExtendsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen); } @@ -18419,12 +21986,13 @@ var ts; seenExtendsClause = true; } else { - ts.Debug.assert(heritageClause.token === 103); + ts.Debug.assert(heritageClause.token === 102 /* ImplementsKeyword */); if (seenImplementsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.implements_clause_already_seen); } seenImplementsClause = true; } + // Grammar checking heritageClause inside class declaration checkGrammarHeritageClause(heritageClause); } } @@ -18434,27 +22002,29 @@ var ts; if (node.heritageClauses) { for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) { var heritageClause = _a[_i]; - if (heritageClause.token === 79) { + if (heritageClause.token === 79 /* ExtendsKeyword */) { if (seenExtendsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen); } seenExtendsClause = true; } else { - ts.Debug.assert(heritageClause.token === 103); + ts.Debug.assert(heritageClause.token === 102 /* ImplementsKeyword */); return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.Interface_declaration_cannot_have_implements_clause); } + // Grammar checking heritageClause inside class declaration checkGrammarHeritageClause(heritageClause); } } return false; } function checkGrammarComputedPropertyName(node) { - if (node.kind !== 127) { + // If node is not a computedPropertyName, just skip the grammar checking + if (node.kind !== 127 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 169 && computedPropertyName.expression.operatorToken.kind === 23) { + if (computedPropertyName.expression.kind === 169 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 23 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } @@ -18464,6 +22034,7 @@ var ts; } } function checkGrammarFunctionName(name) { + // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a strict mode FunctionDeclaration or FunctionExpression (13.1)) return checkGrammarEvalOrArgumentsInStrictMode(name, name); } function checkGrammarForInvalidQuestionMark(node, questionToken, message) { @@ -18477,55 +22048,65 @@ var ts; var GetAccessor = 2; var SetAccesor = 4; var GetOrSetAccessor = GetAccessor | SetAccesor; - var inStrictMode = (node.parserContextFlags & 1) !== 0; + var inStrictMode = (node.parserContextFlags & 1 /* StrictMode */) !== 0; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - var name_11 = prop.name; - if (prop.kind === 175 || - name_11.kind === 127) { - checkGrammarComputedPropertyName(name_11); + var name_13 = prop.name; + if (prop.kind === 175 /* OmittedExpression */ || + name_13.kind === 127 /* ComputedPropertyName */) { + // If the name is not a ComputedPropertyName, the grammar checking will skip it + checkGrammarComputedPropertyName(name_13); continue; } + // ECMA-262 11.1.5 Object Initialiser + // If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true + // a.This production is contained in strict code and IsDataDescriptor(previous) is true and + // IsDataDescriptor(propId.descriptor) is true. + // b.IsDataDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true. + // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. + // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true + // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; - if (prop.kind === 224 || prop.kind === 225) { + if (prop.kind === 224 /* PropertyAssignment */ || prop.kind === 225 /* ShorthandPropertyAssignment */) { + // Grammar checking for computedPropertName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); - if (name_11.kind === 7) { - checkGrammarNumbericLiteral(name_11); + if (name_13.kind === 7 /* NumericLiteral */) { + checkGrammarNumericLiteral(name_13); } currentKind = Property; } - else if (prop.kind === 134) { + else if (prop.kind === 134 /* MethodDeclaration */) { currentKind = Property; } - else if (prop.kind === 136) { + else if (prop.kind === 136 /* GetAccessor */) { currentKind = GetAccessor; } - else if (prop.kind === 137) { + else if (prop.kind === 137 /* SetAccessor */) { currentKind = SetAccesor; } else { ts.Debug.fail("Unexpected syntax kind:" + prop.kind); } - if (!ts.hasProperty(seen, name_11.text)) { - seen[name_11.text] = currentKind; + if (!ts.hasProperty(seen, name_13.text)) { + seen[name_13.text] = currentKind; } else { - var existingKind = seen[name_11.text]; + var existingKind = seen[name_13.text]; if (currentKind === Property && existingKind === Property) { if (inStrictMode) { - grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); + grammarErrorOnNode(name_13, 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_11.text] = currentKind | existingKind; + seen[name_13.text] = currentKind | existingKind; } else { - return grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + return grammarErrorOnNode(name_13, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); } } else { - return grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + return grammarErrorOnNode(name_13, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); } } } @@ -18534,24 +22115,24 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.initializer.kind === 199) { + if (forInOrOfStatement.initializer.kind === 199 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { if (variableList.declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 187 + var diagnostic = forInOrOfStatement.kind === 187 /* ForInStatement */ ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = variableList.declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 187 + var diagnostic = forInOrOfStatement.kind === 187 /* ForInStatement */ ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 187 + var diagnostic = forInOrOfStatement.kind === 187 /* ForInStatement */ ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -18562,7 +22143,7 @@ var ts; } function checkGrammarAccessor(accessor) { var kind = accessor.kind; - if (languageVersion < 1) { + if (languageVersion < 1 /* ES5 */) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher); } else if (ts.isInAmbientContext(accessor)) { @@ -18574,10 +22155,10 @@ var ts; else if (accessor.typeParameters) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } - else if (kind === 136 && accessor.parameters.length) { + else if (kind === 136 /* GetAccessor */ && accessor.parameters.length) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); } - else if (kind === 137) { + else if (kind === 137 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -18589,7 +22170,7 @@ var ts; if (parameter.dotDotDotToken) { return grammarErrorOnNode(parameter.dotDotDotToken, ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter); } - else if (parameter.flags & 499) { + else if (parameter.flags & 499 /* Modifier */) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } else if (parameter.questionToken) { @@ -18602,7 +22183,7 @@ var ts; } } function checkGrammarForNonSymbolComputedProperty(node, message) { - if (node.kind === 127 && !ts.isWellKnownSymbolSyntactically(node.expression)) { + if (node.kind === 127 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(node.expression)) { return grammarErrorOnNode(node, message); } } @@ -18612,7 +22193,7 @@ var ts; checkGrammarForGenerator(node)) { return true; } - if (node.parent.kind === 154) { + if (node.parent.kind === 154 /* ObjectLiteralExpression */) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } @@ -18620,10 +22201,15 @@ var ts; return grammarErrorAtPos(getSourceFile(node), node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } } - if (node.parent.kind === 201) { + if (node.parent.kind === 201 /* ClassDeclaration */) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } + // Technically, computed properties in ambient contexts is disallowed + // for property declarations and accessors too, not just methods. + // However, property declarations disallow computed names in general, + // and accessors are not allowed in ambient contexts in general, + // so this error only really matters for methods. if (ts.isInAmbientContext(node)) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol); } @@ -18631,22 +22217,22 @@ var ts; return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol); } } - else if (node.parent.kind === 202) { + else if (node.parent.kind === 202 /* InterfaceDeclaration */) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol); } - else if (node.parent.kind === 145) { + else if (node.parent.kind === 145 /* TypeLiteral */) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol); } } function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 186: - case 187: - case 188: - case 184: - case 185: + case 186 /* ForStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: + case 184 /* DoStatement */: + case 185 /* WhileStatement */: return true; - case 194: + case 194 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -18658,9 +22244,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 194: + case 194 /* LabeledStatement */: if (node.label && current.label.text === node.label.text) { - var isMisplacedContinueLabel = node.kind === 189 + // found matching label - verify that label usage is correct + // continue can only target labels that are on iteration statements + var isMisplacedContinueLabel = node.kind === 189 /* ContinueStatement */ && !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); @@ -18668,13 +22256,15 @@ var ts; return false; } break; - case 193: - if (node.kind === 190 && !node.label) { + case 193 /* SwitchStatement */: + if (node.kind === 190 /* BreakStatement */ && !node.label) { + // unlabeled break within switch statement - ok return false; } break; default: if (isIterationStatement(current, false) && !node.label) { + // unlabeled break or continue within iteration statement - ok return false; } break; @@ -18682,13 +22272,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 190 + var message = node.kind === 190 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 190 + var message = node.kind === 190 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -18700,16 +22290,23 @@ var ts; if (node !== elements[elements.length - 1]) { return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); } + if (node.name.kind === 151 /* ArrayBindingPattern */ || node.name.kind === 150 /* ObjectBindingPattern */) { + return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); + } if (node.initializer) { + // Error on equals token which immediate precedes the initializer return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.initializer.pos - 1, 1, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } } + // It is a SyntaxError if a VariableDeclaration or VariableDeclarationNoIn occurs within strict code + // and its Identifier is eval or arguments return checkGrammarEvalOrArgumentsInStrictMode(node, node.name); } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 187 && node.parent.parent.kind !== 188) { + if (node.parent.parent.kind !== 187 /* ForInStatement */ && node.parent.parent.kind !== 188 /* ForOfStatement */) { if (ts.isInAmbientContext(node)) { if (node.initializer) { + // Error on equals token which immediate precedes the initializer var equalsTokenLength = "=".length; return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.initializer.pos - equalsTokenLength, equalsTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); } @@ -18723,12 +22320,18 @@ var ts; } } } - var checkLetConstNames = languageVersion >= 2 && (ts.isLet(node) || ts.isConst(node)); + var checkLetConstNames = languageVersion >= 2 /* ES6 */ && (ts.isLet(node) || ts.isConst(node)); + // 1. LexicalDeclaration : LetOrConst BindingList ; + // It is a Syntax Error if the BoundNames of BindingList contains "let". + // 2. ForDeclaration: ForDeclaration : LetOrConst ForBinding + // It is a Syntax Error if the BoundNames of ForDeclaration contains "let". + // It is a SyntaxError if a VariableDeclaration or VariableDeclarationNoIn occurs within strict code + // and its Identifier is eval or arguments return (checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name)) || checkGrammarEvalOrArgumentsInStrictMode(node, node.name); } function checkGrammarNameInLetOrConstDeclarations(name) { - if (name.kind === 65) { + if (name.kind === 65 /* Identifier */) { if (name.text === "let") { return grammarErrorOnNode(name, ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations); } @@ -18737,7 +22340,9 @@ var ts; var elements = name.elements; for (var _i = 0; _i < elements.length; _i++) { var element = elements[_i]; - checkGrammarNameInLetOrConstDeclarations(element.name); + if (element.kind !== 175 /* OmittedExpression */) { + checkGrammarNameInLetOrConstDeclarations(element.name); + } } } } @@ -18752,15 +22357,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 183: - case 184: - case 185: - case 192: - case 186: - case 187: - case 188: + case 183 /* IfStatement */: + case 184 /* DoStatement */: + case 185 /* WhileStatement */: + case 192 /* WithStatement */: + case 186 /* ForStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: return false; - case 194: + case 194 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -18776,26 +22381,36 @@ var ts; } } function isIntegerLiteral(expression) { - if (expression.kind === 167) { + if (expression.kind === 167 /* PrefixUnaryExpression */) { var unaryExpression = expression; - if (unaryExpression.operator === 33 || unaryExpression.operator === 34) { + if (unaryExpression.operator === 33 /* PlusToken */ || unaryExpression.operator === 34 /* MinusToken */) { expression = unaryExpression.operand; } } - if (expression.kind === 7) { + if (expression.kind === 7 /* NumericLiteral */) { + // Allows for scientific notation since literalExpression.text was formed by + // coercing a number to a string. Sometimes this coercion can yield a string + // in scientific notation. + // We also don't need special logic for hex because a hex integer is converted + // to decimal when it is coerced. return /^[0-9]+([eE]\+?[0-9]+)?$/.test(expression.text); } return false; } function checkGrammarEnumDeclaration(enumDecl) { - var enumIsConst = (enumDecl.flags & 8192) !== 0; + var enumIsConst = (enumDecl.flags & 8192 /* Const */) !== 0; var hasError = false; + // skip checks below for const enums - they allow arbitrary initializers as long as they can be evaluated to constant expressions. + // since all values are known in compile time - it is not necessary to check that constant enum section precedes computed enum members. if (!enumIsConst) { var inConstantEnumMemberSection = true; var inAmbientContext = ts.isInAmbientContext(enumDecl); for (var _i = 0, _a = enumDecl.members; _i < _a.length; _i++) { var node = _a[_i]; - if (node.name.kind === 127) { + // Do not use hasDynamicName here, because that returns false for well known symbols. + // We want to perform checkComputedPropertyName for all computed properties, including + // well known symbols. + if (node.name.kind === 127 /* ComputedPropertyName */) { hasError = grammarErrorOnNode(node.name, ts.Diagnostics.Computed_property_names_are_not_allowed_in_enums); } else if (inAmbientContext) { @@ -18838,14 +22453,25 @@ var ts; } } function checkGrammarEvalOrArgumentsInStrictMode(contextNode, name) { - if (name && name.kind === 65) { + if (name && name.kind === 65 /* Identifier */) { var identifier = name; - if (contextNode && (contextNode.parserContextFlags & 1) && ts.isEvalOrArgumentsIdentifier(identifier)) { + if (contextNode && (contextNode.parserContextFlags & 1 /* StrictMode */) && isEvalOrArgumentsIdentifier(identifier)) { var nameText = ts.declarationNameToString(identifier); - return grammarErrorOnNode(identifier, ts.Diagnostics.Invalid_use_of_0_in_strict_mode, nameText); + // We check first if the name is inside class declaration or class expression; if so give explicit message + // otherwise report generic error message. + // reportGrammarErrorInClassDeclaration only return true if grammar error is successfully reported and false otherwise + var reportErrorInClassDeclaration = reportStrictModeGrammarErrorInClassDeclaration(identifier, ts.Diagnostics.Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode, nameText); + if (!reportErrorInClassDeclaration) { + return grammarErrorOnNode(identifier, ts.Diagnostics.Invalid_use_of_0_in_strict_mode, nameText); + } + return reportErrorInClassDeclaration; } } } + function isEvalOrArgumentsIdentifier(node) { + return node.kind === 65 /* Identifier */ && + (node.text === "eval" || node.text === "arguments"); + } function checkGrammarConstructorTypeParameters(node) { if (node.typeParameters) { return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); @@ -18857,18 +22483,18 @@ var ts; } } function checkGrammarProperty(node) { - if (node.parent.kind === 201) { + if (node.parent.kind === 201 /* ClassDeclaration */) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional) || checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol)) { return true; } } - else if (node.parent.kind === 202) { + else if (node.parent.kind === 202 /* InterfaceDeclaration */) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol)) { return true; } } - else if (node.parent.kind === 145) { + else if (node.parent.kind === 145 /* TypeLiteral */) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -18878,13 +22504,23 @@ var ts; } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 202 || - node.kind === 209 || - node.kind === 208 || - node.kind === 215 || - node.kind === 214 || - (node.flags & 2) || - (node.flags & (1 | 256))) { + // A declare modifier is required for any top level .d.ts declaration except export=, export default, + // interfaces and imports categories: + // + // DeclarationElement: + // ExportAssignment + // export_opt InterfaceDeclaration + // export_opt ImportDeclaration + // export_opt ExternalImportDeclaration + // export_opt AmbientDeclaration + // + if (node.kind === 202 /* InterfaceDeclaration */ || + node.kind === 209 /* ImportDeclaration */ || + node.kind === 208 /* ImportEqualsDeclaration */ || + node.kind === 215 /* ExportDeclaration */ || + node.kind === 214 /* ExportAssignment */ || + (node.flags & 2 /* Ambient */) || + (node.flags & (1 /* Export */ | 256 /* Default */))) { return false; } return grammarErrorOnFirstToken(node, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); @@ -18892,7 +22528,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 180) { + if (ts.isDeclaration(decl) || decl.kind === 180 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -18904,15 +22540,23 @@ var ts; } function checkGrammarStatementInAmbientContext(node) { if (ts.isInAmbientContext(node)) { + // An accessors is already reported about the ambient context if (isAccessor(node.parent.kind)) { return getNodeLinks(node).hasReportedStatementInAmbientContext = true; } + // Find containing block which is either Block, ModuleBlock, SourceFile var links = getNodeLinks(node); if (!links.hasReportedStatementInAmbientContext && ts.isFunctionLike(node.parent)) { return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); } - if (node.parent.kind === 179 || node.parent.kind === 206 || node.parent.kind === 227) { + // We are either parented by another statement, or some sort of block. + // If we're in a block, we only want to really report an error once + // to prevent noisyness. So use a bit on the block to indicate if + // this has already been reported, and don't report if it has. + // + if (node.parent.kind === 179 /* Block */ || node.parent.kind === 206 /* ModuleBlock */ || node.parent.kind === 227 /* SourceFile */) { var links_1 = getNodeLinks(node.parent); + // Check if the containing block ever report this error if (!links_1.hasReportedStatementInAmbientContext) { return links_1.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); } @@ -18921,12 +22565,13 @@ var ts; } } } - function checkGrammarNumbericLiteral(node) { - if (node.flags & 16384) { - if (node.parserContextFlags & 1) { + function checkGrammarNumericLiteral(node) { + // Grammar checking + if (node.flags & 16384 /* OctalLiteral */) { + if (node.parserContextFlags & 1 /* StrictMode */) { return grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode); } - else if (languageVersion >= 1) { + else if (languageVersion >= 1 /* ES5 */) { return grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher); } } @@ -18945,6 +22590,7 @@ var ts; ts.createTypeChecker = createTypeChecker; })(ts || (ts = {})); /// +/* @internal */ var ts; (function (ts) { function getDeclarationDiagnostics(host, resolver, targetSourceFile) { @@ -18957,7 +22603,7 @@ var ts; function emitDeclarations(host, resolver, diagnostics, jsFilePath, root) { var newLine = host.getNewLine(); var compilerOptions = host.getCompilerOptions(); - var languageVersion = compilerOptions.target || 0; + var languageVersion = compilerOptions.target || 0 /* ES3 */; var write; var writeLine; var increaseIndent; @@ -18971,13 +22617,18 @@ var ts; var emit = compilerOptions.stripInternal ? stripInternal : emitNode; var moduleElementDeclarationEmitInfo = []; var asynchronousSubModuleDeclarationEmitInfo; + // Contains the reference paths that needs to go in the declaration file. + // Collecting this separately because reference paths need to be first thing in the declaration file + // and we could be collecting these paths from multiple files into single one with --out option var referencePathsOutput = ""; if (root) { + // Emitting just a single file, so emit references in this file only if (!compilerOptions.noResolve) { var addedGlobalFileReference = false; ts.forEach(root.referencedFiles, function (fileReference) { var referencedFile = ts.tryResolveScriptReference(host, root, fileReference); - if (referencedFile && ((referencedFile.flags & 2048) || + // All the references that are not going to be part of same file + if (referencedFile && ((referencedFile.flags & 2048 /* DeclarationFile */) || ts.shouldEmitToOwnFile(referencedFile, compilerOptions) || !addedGlobalFileReference)) { writeReferencePath(referencedFile); @@ -18988,11 +22639,12 @@ var ts; }); } emitSourceFile(root); + // create asynchronous output for the importDeclarations if (moduleElementDeclarationEmitInfo.length) { var oldWriter = writer; ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { if (aliasEmitInfo.isVisible) { - ts.Debug.assert(aliasEmitInfo.node.kind === 209); + ts.Debug.assert(aliasEmitInfo.node.kind === 209 /* ImportDeclaration */); createAndSetNewTextWriterWithSymbolWriter(); ts.Debug.assert(aliasEmitInfo.indent === 0); writeImportDeclaration(aliasEmitInfo.node); @@ -19003,12 +22655,15 @@ var ts; } } else { + // Emit references corresponding to this file var emittedReferencedFiles = []; ts.forEach(host.getSourceFiles(), function (sourceFile) { if (!ts.isExternalModuleOrDeclarationFile(sourceFile)) { + // Check what references need to be added if (!compilerOptions.noResolve) { ts.forEach(sourceFile.referencedFiles, function (fileReference) { var referencedFile = ts.tryResolveScriptReference(host, sourceFile, fileReference); + // If the reference file is a declaration file or an external module, emit that reference if (referencedFile && (ts.isExternalModuleOrDeclarationFile(referencedFile) && !ts.contains(emittedReferencedFiles, referencedFile))) { writeReferencePath(referencedFile); @@ -19065,10 +22720,10 @@ var ts; var oldWriter = writer; ts.forEach(nodes, function (declaration) { var nodeToCheck; - if (declaration.kind === 198) { + if (declaration.kind === 198 /* VariableDeclaration */) { nodeToCheck = declaration.parent.parent; } - else if (declaration.kind === 212 || declaration.kind === 213 || declaration.kind === 210) { + else if (declaration.kind === 212 /* NamedImports */ || declaration.kind === 213 /* ImportSpecifier */ || declaration.kind === 210 /* ImportClause */) { ts.Debug.fail("We should be getting ImportDeclaration instead to write"); } else { @@ -19078,8 +22733,17 @@ var ts; if (!moduleElementEmitInfo && asynchronousSubModuleDeclarationEmitInfo) { moduleElementEmitInfo = ts.forEach(asynchronousSubModuleDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.node === nodeToCheck ? declEmitInfo : undefined; }); } + // If the alias was marked as not visible when we saw its declaration, we would have saved the aliasEmitInfo, but if we haven't yet visited the alias declaration + // then we don't need to write it at this point. We will write it when we actually see its declaration + // Eg. + // export function bar(a: foo.Foo) { } + // import foo = require("foo"); + // Writing of function bar would mark alias declaration foo as visible but we haven't yet visited that declaration so do nothing, + // we would write alias foo declaration when we visit it since it would now be marked as visible if (moduleElementEmitInfo) { - if (moduleElementEmitInfo.node.kind === 209) { + if (moduleElementEmitInfo.node.kind === 209 /* ImportDeclaration */) { + // we have to create asynchronous output only after we have collected complete information + // because it is possible to enable multiple bindings as asynchronously visible moduleElementEmitInfo.isVisible = true; } else { @@ -19087,12 +22751,12 @@ var ts; for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { increaseIndent(); } - if (nodeToCheck.kind === 205) { + if (nodeToCheck.kind === 205 /* ModuleDeclaration */) { ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); asynchronousSubModuleDeclarationEmitInfo = []; } writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 205) { + if (nodeToCheck.kind === 205 /* ModuleDeclaration */) { moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; asynchronousSubModuleDeclarationEmitInfo = undefined; } @@ -19103,12 +22767,14 @@ var ts; setWriter(oldWriter); } function handleSymbolAccessibilityError(symbolAccesibilityResult) { - if (symbolAccesibilityResult.accessibility === 0) { + if (symbolAccesibilityResult.accessibility === 0 /* Accessible */) { + // write the aliases if (symbolAccesibilityResult && symbolAccesibilityResult.aliasesToMakeVisible) { writeAsynchronousModuleElements(symbolAccesibilityResult.aliasesToMakeVisible); } } else { + // Report error reportedDeclarationError = true; var errorInfo = writer.getSymbolAccessibilityDiagnostic(symbolAccesibilityResult); if (errorInfo) { @@ -19128,20 +22794,22 @@ var ts; writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; write(": "); if (type) { + // Write the type emitType(type); } else { - resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, 2, writer); + resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); } } function writeReturnTypeAtSignature(signature, getSymbolAccessibilityDiagnostic) { writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; write(": "); if (signature.type) { + // Write the type emitType(signature.type); } else { - resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 2, writer); + resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); } } function emitLines(nodes) { @@ -19170,6 +22838,7 @@ var ts; if (declaration) { var jsDocComments = ts.getJsDocComments(declaration, currentSourceFile); ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, declaration, jsDocComments); + // jsDoc comments are emitted at /*leading comment1 */space/*leading comment*/space ts.emitComments(currentSourceFile, writer, jsDocComments, true, newLine, ts.writeCommentRange); } } @@ -19179,49 +22848,51 @@ var ts; } function emitType(type) { switch (type.kind) { - case 112: - case 121: - case 119: - case 113: - case 122: - case 99: - case 8: + case 112 /* AnyKeyword */: + case 121 /* StringKeyword */: + case 119 /* NumberKeyword */: + case 113 /* BooleanKeyword */: + case 122 /* SymbolKeyword */: + case 99 /* VoidKeyword */: + case 8 /* StringLiteral */: return writeTextOfNode(currentSourceFile, type); - case 177: + case 177 /* HeritageClauseElement */: return emitHeritageClauseElement(type); - case 141: + case 141 /* TypeReference */: return emitTypeReference(type); - case 144: + case 144 /* TypeQuery */: return emitTypeQuery(type); - case 146: + case 146 /* ArrayType */: return emitArrayType(type); - case 147: + case 147 /* TupleType */: return emitTupleType(type); - case 148: + case 148 /* UnionType */: return emitUnionType(type); - case 149: + case 149 /* ParenthesizedType */: return emitParenType(type); - case 142: - case 143: + case 142 /* FunctionType */: + case 143 /* ConstructorType */: return emitSignatureDeclarationWithJsDocComments(type); - case 145: + case 145 /* TypeLiteral */: return emitTypeLiteral(type); - case 65: + case 65 /* Identifier */: return emitEntityName(type); - case 126: + case 126 /* QualifiedName */: return emitEntityName(type); } function emitEntityName(entityName) { - var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 208 ? entityName.parent : enclosingDeclaration); + var visibilityResult = resolver.isEntityNameVisible(entityName, + // Aliases can be written asynchronously so use correct enclosing declaration + entityName.parent.kind === 208 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); writeEntityName(entityName); function writeEntityName(entityName) { - if (entityName.kind === 65) { + if (entityName.kind === 65 /* Identifier */) { writeTextOfNode(currentSourceFile, entityName); } else { - var left = entityName.kind === 126 ? entityName.left : entityName.expression; - var right = entityName.kind === 126 ? entityName.right : entityName.name; + var left = entityName.kind === 126 /* QualifiedName */ ? entityName.left : entityName.expression; + var right = entityName.kind === 126 /* QualifiedName */ ? entityName.right : entityName.name; writeEntityName(left); write("."); writeTextOfNode(currentSourceFile, right); @@ -19230,7 +22901,7 @@ var ts; } function emitHeritageClauseElement(node) { if (ts.isSupportedHeritageClauseElement(node)) { - ts.Debug.assert(node.expression.kind === 65 || node.expression.kind === 155); + ts.Debug.assert(node.expression.kind === 65 /* Identifier */ || node.expression.kind === 155 /* PropertyAccessExpression */); emitEntityName(node.expression); if (node.typeArguments) { write("<"); @@ -19273,6 +22944,7 @@ var ts; if (type.members.length) { writeLine(); increaseIndent(); + // write members emitLines(type.members); decreaseIndent(); } @@ -19284,25 +22956,47 @@ var ts; enclosingDeclaration = node; emitLines(node.statements); } + // Return a temp variable name to be used in `export default` statements. + // The temp name will be of the form _default_counter. + // Note that export default is only allowed at most once in a module, so we + // do not need to keep track of created temp names. + function getExportDefaultTempVariableName() { + var baseName = "_default"; + if (!ts.hasProperty(currentSourceFile.identifiers, baseName)) { + return baseName; + } + var count = 0; + while (true) { + var name_14 = baseName + "_" + (++count); + if (!ts.hasProperty(currentSourceFile.identifiers, name_14)) { + return name_14; + } + } + } function emitExportAssignment(node) { - write(node.isExportEquals ? "export = " : "export default "); - if (node.expression.kind === 65) { + if (node.expression.kind === 65 /* Identifier */) { + write(node.isExportEquals ? "export = " : "export default "); writeTextOfNode(currentSourceFile, node.expression); } else { + // Expression + var tempVarName = getExportDefaultTempVariableName(); + write("declare var "); + write(tempVarName); write(": "); - if (node.type) { - emitType(node.type); - } - else { - writer.getSymbolAccessibilityDiagnostic = getDefaultExportAccessibilityDiagnostic; - resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, 2, writer); - } + writer.getSymbolAccessibilityDiagnostic = getDefaultExportAccessibilityDiagnostic; + resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); + write(";"); + writeLine(); + write(node.isExportEquals ? "export = " : "export default "); + write(tempVarName); } write(";"); writeLine(); - if (node.expression.kind === 65) { + // Make all the declarations visible for the export name + if (node.expression.kind === 65 /* Identifier */) { var nodes = resolver.collectLinkedAliases(node.expression); + // write each of these declarations asynchronously writeAsynchronousModuleElements(nodes); } function getDefaultExportAccessibilityDiagnostic(diagnostic) { @@ -19319,10 +23013,11 @@ var ts; if (isModuleElementVisible) { writeModuleElement(node); } - else if (node.kind === 208 || - (node.parent.kind === 227 && ts.isExternalModule(currentSourceFile))) { + else if (node.kind === 208 /* ImportEqualsDeclaration */ || + (node.parent.kind === 227 /* SourceFile */ && ts.isExternalModule(currentSourceFile))) { var isVisible; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 227) { + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 227 /* SourceFile */) { + // Import declaration of another module that is visited async so lets put it in right spot asynchronousSubModuleDeclarationEmitInfo.push({ node: node, outputPos: writer.getTextPos(), @@ -19331,7 +23026,7 @@ var ts; }); } else { - if (node.kind === 209) { + if (node.kind === 209 /* ImportDeclaration */) { var importDeclaration = node; if (importDeclaration.importClause) { isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || @@ -19349,55 +23044,59 @@ var ts; } function writeModuleElement(node) { switch (node.kind) { - case 200: + case 200 /* FunctionDeclaration */: return writeFunctionDeclaration(node); - case 180: + case 180 /* VariableStatement */: return writeVariableStatement(node); - case 202: + case 202 /* InterfaceDeclaration */: return writeInterfaceDeclaration(node); - case 201: + case 201 /* ClassDeclaration */: return writeClassDeclaration(node); - case 203: + case 203 /* TypeAliasDeclaration */: return writeTypeAliasDeclaration(node); - case 204: + case 204 /* EnumDeclaration */: return writeEnumDeclaration(node); - case 205: + case 205 /* ModuleDeclaration */: return writeModuleDeclaration(node); - case 208: + case 208 /* ImportEqualsDeclaration */: return writeImportEqualsDeclaration(node); - case 209: + case 209 /* ImportDeclaration */: return writeImportDeclaration(node); default: ts.Debug.fail("Unknown symbol kind"); } } function emitModuleElementDeclarationFlags(node) { + // If the node is parented in the current source file we need to emit export declare or just export if (node.parent === currentSourceFile) { - if (node.flags & 1) { + // If the node is exported + if (node.flags & 1 /* Export */) { write("export "); } - if (node.flags & 256) { + if (node.flags & 256 /* Default */) { write("default "); } - else if (node.kind !== 202) { + else if (node.kind !== 202 /* InterfaceDeclaration */) { write("declare "); } } } function emitClassMemberDeclarationFlags(node) { - if (node.flags & 32) { + if (node.flags & 32 /* Private */) { write("private "); } - else if (node.flags & 64) { + else if (node.flags & 64 /* Protected */) { write("protected "); } - if (node.flags & 128) { + if (node.flags & 128 /* Static */) { write("static "); } } function writeImportEqualsDeclaration(node) { + // note usage of writer. methods instead of aliases created, just to make sure we are using + // correct writer especially to handle asynchronous alias writing emitJsDocComments(node); - if (node.flags & 1) { + if (node.flags & 1 /* Export */) { write("export "); } write("import "); @@ -19423,7 +23122,7 @@ var ts; } function isVisibleNamedBinding(namedBindings) { if (namedBindings) { - if (namedBindings.kind === 211) { + if (namedBindings.kind === 211 /* NamespaceImport */) { return resolver.isDeclarationVisible(namedBindings); } else { @@ -19432,11 +23131,12 @@ var ts; } } function writeImportDeclaration(node) { - if (!node.importClause && !(node.flags & 1)) { + if (!node.importClause && !(node.flags & 1 /* Export */)) { + // do not write non-exported import declarations that don't have import clauses return; } emitJsDocComments(node); - if (node.flags & 1) { + if (node.flags & 1 /* Export */) { write("export "); } write("import "); @@ -19447,9 +23147,10 @@ var ts; } if (node.importClause.namedBindings && isVisibleNamedBinding(node.importClause.namedBindings)) { if (currentWriterPos !== writer.getTextPos()) { + // If the default binding was emitted, write the separated write(", "); } - if (node.importClause.namedBindings.kind === 211) { + if (node.importClause.namedBindings.kind === 211 /* NamespaceImport */) { write("* as "); writeTextOfNode(currentSourceFile, node.importClause.namedBindings.name); } @@ -19474,7 +23175,9 @@ var ts; } function emitExportSpecifier(node) { emitImportOrExportSpecifier(node); + // Make all the declarations visible for the export name var nodes = resolver.collectLinkedAliases(node.propertyName || node.name); + // write each of these declarations asynchronously writeAsynchronousModuleElements(nodes); } function emitExportDeclaration(node) { @@ -19500,7 +23203,7 @@ var ts; emitModuleElementDeclarationFlags(node); write("module "); writeTextOfNode(currentSourceFile, node.name); - while (node.body.kind !== 206) { + while (node.body.kind !== 206 /* ModuleBlock */) { node = node.body; write("."); writeTextOfNode(currentSourceFile, node.name); @@ -19561,7 +23264,7 @@ var ts; writeLine(); } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 134 && (node.parent.flags & 32); + return node.parent.kind === 134 /* MethodDeclaration */ && (node.parent.flags & 32 /* Private */); } function emitTypeParameters(typeParameters) { function emitTypeParameter(node) { @@ -19569,17 +23272,18 @@ var ts; emitJsDocComments(node); decreaseIndent(); writeTextOfNode(currentSourceFile, node.name); + // If there is constraint present and this is not a type parameter of the private method emit the constraint if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); - if (node.parent.kind === 142 || - 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); + if (node.parent.kind === 142 /* FunctionType */ || + node.parent.kind === 143 /* ConstructorType */ || + (node.parent.parent && node.parent.parent.kind === 145 /* TypeLiteral */)) { + ts.Debug.assert(node.parent.kind === 134 /* MethodDeclaration */ || + node.parent.kind === 133 /* MethodSignature */ || + node.parent.kind === 142 /* FunctionType */ || + node.parent.kind === 143 /* ConstructorType */ || + node.parent.kind === 138 /* CallSignature */ || + node.parent.kind === 139 /* ConstructSignature */); emitType(node.constraint); } else { @@ -19587,33 +23291,34 @@ var ts; } } function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult) { + // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 201: + case 201 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 202: + case 202 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 139: + case 139 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 138: + case 138 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 134: - case 133: - if (node.parent.flags & 128) { + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + if (node.parent.flags & 128 /* Static */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 201) { + else if (node.parent.parent.kind === 201 /* ClassDeclaration */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 200: + case 200 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: @@ -19643,12 +23348,15 @@ var ts; } function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.parent.parent.kind === 201) { + // Heritage clause is written by user so it can always be named + if (node.parent.parent.kind === 201 /* ClassDeclaration */) { + // Class or Interface implemented/extended is inaccessible diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; } else { + // interface is inaccessible diagnosticMessage = ts.Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; } return { @@ -19663,7 +23371,7 @@ var ts; function emitParameterProperties(constructorDeclaration) { if (constructorDeclaration) { ts.forEach(constructorDeclaration.parameters, function (param) { - if (param.flags & 112) { + if (param.flags & 112 /* AccessibilityModifier */) { emitPropertyDeclaration(param); } }); @@ -19720,47 +23428,55 @@ var ts; writeLine(); } function emitVariableDeclaration(node) { - if (node.kind !== 198 || resolver.isDeclarationVisible(node)) { + // If we are emitting property it isn't moduleElement and hence we already know it needs to be emitted + // so there is no check needed to see if declaration is visible + if (node.kind !== 198 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { if (ts.isBindingPattern(node.name)) { emitBindingPattern(node.name); } else { + // If this node is a computed name, it can only be a symbol, because we've already skipped + // it if it's not a well known symbol. In that case, the text of the name will be exactly + // what we want, namely the name expression enclosed in brackets. writeTextOfNode(currentSourceFile, node.name); - if ((node.kind === 132 || node.kind === 131) && ts.hasQuestionToken(node)) { + // If optional property emit ? + if ((node.kind === 132 /* PropertyDeclaration */ || node.kind === 131 /* PropertySignature */) && ts.hasQuestionToken(node)) { write("?"); } - if ((node.kind === 132 || node.kind === 131) && node.parent.kind === 145) { + if ((node.kind === 132 /* PropertyDeclaration */ || node.kind === 131 /* PropertySignature */) && node.parent.kind === 145 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } - else if (!(node.flags & 32)) { + else if (!(node.flags & 32 /* Private */)) { writeTypeOfDeclaration(node, node.type, getVariableDeclarationTypeVisibilityError); } } } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { - if (node.kind === 198) { + if (node.kind === 198 /* VariableDeclaration */) { return symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? + symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; } - else if (node.kind === 132 || node.kind === 131) { - if (node.flags & 128) { + else if (node.kind === 132 /* PropertyDeclaration */ || node.kind === 131 /* PropertySignature */) { + // TODO(jfreeman): Deal with computed properties in error reporting. + if (node.flags & 128 /* Static */) { return symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? + symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? 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) { + else if (node.parent.kind === 201 /* ClassDeclaration */) { return symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? + symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : 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 { + // Interfaces cannot have types that cannot be named 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; @@ -19776,10 +23492,15 @@ var ts; } : undefined; } function emitBindingPattern(bindingPattern) { + // 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, ; var elements = []; for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 175) { + if (element.kind !== 175 /* OmittedExpression */) { elements.push(element); } } @@ -19806,6 +23527,9 @@ var ts; } } function emitTypeOfVariableDeclarationFromTypeLiteral(node) { + // if this is property of type literal, + // or is parameter of method/call/construct/index signature of type literal + // emit only if type is specified if (node.type) { write(": "); emitType(node.type); @@ -19841,11 +23565,12 @@ var ts; emitJsDocComments(accessors.setAccessor); emitClassMemberDeclarationFlags(node); writeTextOfNode(currentSourceFile, node.name); - if (!(node.flags & 32)) { + if (!(node.flags & 32 /* Private */)) { accessorWithTypeAnnotation = node; var type = getTypeAnnotationFromAccessor(node); if (!type) { - var anotherAccessor = node.kind === 136 ? accessors.setAccessor : accessors.getAccessor; + // couldn't get type for the first accessor, try the another one + var anotherAccessor = node.kind === 136 /* GetAccessor */ ? accessors.setAccessor : accessors.getAccessor; type = getTypeAnnotationFromAccessor(anotherAccessor); if (type) { accessorWithTypeAnnotation = anotherAccessor; @@ -19858,17 +23583,18 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 136 - ? accessor.type + return accessor.kind === 136 /* GetAccessor */ + ? accessor.type // Getter - return type : accessor.parameters.length > 0 - ? accessor.parameters[0].type + ? accessor.parameters[0].type // Setter parameter type : undefined; } } function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 137) { - if (accessorWithTypeAnnotation.parent.flags & 128) { + if (accessorWithTypeAnnotation.kind === 137 /* SetAccessor */) { + // Setters have to have type named and cannot infer it so, the type should always be named + if (accessorWithTypeAnnotation.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? 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; @@ -19881,20 +23607,21 @@ var ts; return { diagnosticMessage: diagnosticMessage, errorNode: accessorWithTypeAnnotation.parameters[0], + // TODO(jfreeman): Investigate why we are passing node.name instead of node.parameters[0].name typeName: accessorWithTypeAnnotation.name }; } else { - if (accessorWithTypeAnnotation.flags & 128) { + if (accessorWithTypeAnnotation.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? + symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? 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 ? + symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? 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; @@ -19911,19 +23638,21 @@ var ts; if (ts.hasDynamicName(node)) { return; } + // If we are emitting Method/Constructor it isn't moduleElement and hence already determined to be emitting + // so no need to verify if the declaration is visible if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 200) { + if (node.kind === 200 /* FunctionDeclaration */) { emitModuleElementDeclarationFlags(node); } - else if (node.kind === 134) { + else if (node.kind === 134 /* MethodDeclaration */) { emitClassMemberDeclarationFlags(node); } - if (node.kind === 200) { + if (node.kind === 200 /* FunctionDeclaration */) { write("function "); writeTextOfNode(currentSourceFile, node.name); } - else if (node.kind === 135) { + else if (node.kind === 135 /* Constructor */) { write("constructor"); } else { @@ -19940,11 +23669,12 @@ var ts; emitSignatureDeclaration(node); } function emitSignatureDeclaration(node) { - if (node.kind === 139 || node.kind === 143) { + // Construct signature or constructor type write new Signature + if (node.kind === 139 /* ConstructSignature */ || node.kind === 143 /* ConstructorType */) { write("new "); } emitTypeParameters(node.typeParameters); - if (node.kind === 140) { + if (node.kind === 140 /* IndexSignature */) { write("["); } else { @@ -19952,21 +23682,24 @@ var ts; } var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; + // Parameters emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 140) { + if (node.kind === 140 /* IndexSignature */) { write("]"); } else { write(")"); } - var isFunctionTypeOrConstructorType = node.kind === 142 || node.kind === 143; - if (isFunctionTypeOrConstructorType || node.parent.kind === 145) { + // If this is not a constructor and is not private, emit the return type + var isFunctionTypeOrConstructorType = node.kind === 142 /* FunctionType */ || node.kind === 143 /* ConstructorType */; + if (isFunctionTypeOrConstructorType || node.parent.kind === 145 /* TypeLiteral */) { + // Emit type literal signature return type only if specified if (node.type) { write(isFunctionTypeOrConstructorType ? " => " : ": "); emitType(node.type); } } - else if (node.kind !== 135 && !(node.flags & 32)) { + else if (node.kind !== 135 /* Constructor */ && !(node.flags & 32 /* Private */)) { writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } enclosingDeclaration = prevEnclosingDeclaration; @@ -19977,46 +23710,50 @@ var ts; function getReturnTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.kind) { - case 139: + case 139 /* ConstructSignature */: + // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 138: + case 138 /* CallSignature */: + // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 140: + case 140 /* IndexSignature */: + // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 134: - case 133: - if (node.flags & 128) { + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + if (node.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? + symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? 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 === 201) { + else if (node.parent.kind === 201 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? + symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : 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 { + // Interfaces cannot have return types that cannot be named 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 200: + case 200 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? + symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : 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; @@ -20037,6 +23774,9 @@ var ts; write("..."); } if (ts.isBindingPattern(node.name)) { + // 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 { @@ -20046,12 +23786,12 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 142 || - node.parent.kind === 143 || - node.parent.parent.kind === 145) { + if (node.parent.kind === 142 /* FunctionType */ || + node.parent.kind === 143 /* ConstructorType */ || + node.parent.parent.kind === 145 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } - else if (!(node.parent.flags & 32)) { + else if (!(node.parent.flags & 32 /* Private */)) { writeTypeOfDeclaration(node, node.type, getParameterDeclarationTypeVisibilityError); } function getParameterDeclarationTypeVisibilityError(symbolAccesibilityResult) { @@ -20064,44 +23804,47 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { switch (node.parent.kind) { - case 135: + case 135 /* Constructor */: return symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? + symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 139: + case 139 /* ConstructSignature */: + // Interfaces cannot have parameter types that cannot be named return symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 138: + case 138 /* CallSignature */: + // Interfaces cannot have parameter types that cannot be named return symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 134: - case 133: - if (node.parent.flags & 128) { + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + if (node.parent.flags & 128 /* Static */) { return symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? + symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? 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) { + else if (node.parent.parent.kind === 201 /* ClassDeclaration */) { return symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? + symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : 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 { + // Interfaces cannot have parameter types that cannot be named 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: + case 200 /* FunctionDeclaration */: return symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? + symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : 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; @@ -20110,12 +23853,13 @@ var ts; } } function emitBindingPattern(bindingPattern) { - if (bindingPattern.kind === 150) { + // We have to explicitly emit square bracket and bracket because these tokens are not store inside the node. + if (bindingPattern.kind === 150 /* ObjectBindingPattern */) { write("{"); emitCommaList(bindingPattern.elements, emitBindingElement); write("}"); } - else if (bindingPattern.kind === 151) { + else if (bindingPattern.kind === 151 /* ArrayBindingPattern */) { write("["); var elements = bindingPattern.elements; emitCommaList(elements, emitBindingElement); @@ -20134,21 +23878,45 @@ var ts; typeName: bindingElement.name } : undefined; } - if (bindingElement.kind === 175) { + if (bindingElement.kind === 175 /* 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 === 152) { + else if (bindingElement.kind === 152 /* 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 (ts.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 { - ts.Debug.assert(bindingElement.name.kind === 65); + ts.Debug.assert(bindingElement.name.kind === 65 /* 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("..."); } @@ -20160,54 +23928,59 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 200: - case 205: - case 208: - case 202: - case 201: - case 203: - case 204: + case 200 /* FunctionDeclaration */: + case 205 /* ModuleDeclaration */: + case 208 /* ImportEqualsDeclaration */: + case 202 /* InterfaceDeclaration */: + case 201 /* ClassDeclaration */: + case 203 /* TypeAliasDeclaration */: + case 204 /* EnumDeclaration */: return emitModuleElement(node, isModuleElementVisible(node)); - case 180: + case 180 /* VariableStatement */: return emitModuleElement(node, isVariableStatementVisible(node)); - case 209: + case 209 /* ImportDeclaration */: + // Import declaration without import clause is visible, otherwise it is not visible return emitModuleElement(node, !node.importClause); - case 215: + case 215 /* ExportDeclaration */: return emitExportDeclaration(node); - case 135: - case 134: - case 133: + case 135 /* Constructor */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: return writeFunctionDeclaration(node); - case 139: - case 138: - case 140: + case 139 /* ConstructSignature */: + case 138 /* CallSignature */: + case 140 /* IndexSignature */: return emitSignatureDeclarationWithJsDocComments(node); - case 136: - case 137: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: return emitAccessorDeclaration(node); - case 132: - case 131: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: return emitPropertyDeclaration(node); - case 226: + case 226 /* EnumMember */: return emitEnumMemberDeclaration(node); - case 214: + case 214 /* ExportAssignment */: return emitExportAssignment(node); - case 227: + case 227 /* SourceFile */: return emitSourceFile(node); } } function writeReferencePath(referencedFile) { - var declFileName = referencedFile.flags & 2048 - ? referencedFile.fileName + var declFileName = referencedFile.flags & 2048 /* DeclarationFile */ + ? referencedFile.fileName // Declaration file, use declaration file name : 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); + ? ts.getOwnEmitOutputFilePath(referencedFile, host, ".d.ts") // Own output file so get the .d.ts file + : ts.removeFileExtension(compilerOptions.out) + ".d.ts"; // Global out file + declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(jsFilePath)), declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, + /*isAbsolutePathAnUrl*/ false); referencePathsOutput += "/// " + newLine; } } + /* @internal */ function writeDeclarationFile(jsFilePath, sourceFile, host, resolver, diagnostics) { var emitDeclarationResult = emitDeclarations(host, resolver, diagnostics, jsFilePath, sourceFile); + // TODO(shkamat): Should we not write any declaration file if any of them can produce error, + // or should we just not write this file like we are doing now if (!emitDeclarationResult.reportedDeclarationError) { var declarationOutput = emitDeclarationResult.referencePathsOutput + getDeclarationOutput(emitDeclarationResult.synchronousDeclarationOutput, emitDeclarationResult.moduleElementDeclarationEmitInfo); @@ -20216,6 +23989,7 @@ var ts; function getDeclarationOutput(synchronousDeclarationOutput, moduleElementDeclarationEmitInfo) { var appliedSyncOutputPos = 0; var declarationOutput = ""; + // apply asynchronous additions to the synchronous output ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { if (aliasEmitInfo.asynchronousOutput) { declarationOutput += synchronousDeclarationOutput.substring(appliedSyncOutputPos, aliasEmitInfo.outputPos); @@ -20231,12 +24005,14 @@ var ts; })(ts || (ts = {})); /// /// +/* @internal */ var ts; (function (ts) { function isExternalModuleOrDeclarationFile(sourceFile) { return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); } ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; + // Flags enum to track count of temp variables and a few dedicated names var TempFlags; (function (TempFlags) { TempFlags[TempFlags["Auto"] = 0] = "Auto"; @@ -20244,9 +24020,18 @@ var ts; TempFlags[TempFlags["_i"] = 268435456] = "_i"; TempFlags[TempFlags["_n"] = 536870912] = "_n"; })(TempFlags || (TempFlags = {})); + // targetSourceFile is when users only want one file in entire project to be emitted. This is used in compileOnSave feature function emitFiles(resolver, host, targetSourceFile) { + // emit output for the __extends helper function + var extendsHelper = "\nvar __extends = this.__extends || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n __.prototype = b.prototype;\n d.prototype = new __();\n};"; + // emit output for the __decorate helper function + var decorateHelper = "\nvar __decorate = this.__decorate || (typeof Reflect === \"object\" && Reflect.decorate) || function (decorators, target, key, desc) {\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};"; + // emit output for the __metadata helper function + var metadataHelper = "\nvar __metadata = this.__metadata || (typeof Reflect === \"object\" && Reflect.metadata) || function () { };"; + // emit output for the __param helper function + var paramHelper = "\nvar __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } };"; var compilerOptions = host.getCompilerOptions(); - var languageVersion = compilerOptions.target || 0; + var languageVersion = compilerOptions.target || 0 /* ES3 */; var sourceMapDataList = compilerOptions.sourceMap ? [] : undefined; var diagnostics = []; var newLine = host.getNewLine(); @@ -20262,6 +24047,7 @@ var ts; } } else { + // targetSourceFile is specified (e.g calling emitter from language service or calling getSemanticDiagnostic from language service) if (ts.shouldEmitToOwnFile(targetSourceFile, compilerOptions)) { var jsFilePath = ts.getOwnEmitOutputFilePath(targetSourceFile, host, ".js"); emitFile(jsFilePath, targetSourceFile); @@ -20270,6 +24056,7 @@ var ts; emitFile(compilerOptions.out); } } + // Sort and make the unique list of diagnostics diagnostics = ts.sortAndDeduplicateDiagnostics(diagnostics); return { emitSkipped: false, @@ -20287,7 +24074,8 @@ var ts; 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)) { + // We conservatively include alias symbols to cover cases where they're emitted as locals + if (node.locals[name].flags & (107455 /* Value */ | 1048576 /* ExportValue */ | 8388608 /* Alias */)) { return false; } } @@ -20308,6 +24096,7 @@ var ts; var computedPropertyNamesToGeneratedNames; var extendsEmitted = false; var decorateEmitted = false; + var paramEmitted = false; var tempFlags = 0; var tempVariables; var tempParameters; @@ -20315,20 +24104,36 @@ var ts; var exportSpecifiers; var exportEquals; var hasExportStars; + /** write emitted output to disk*/ var writeEmittedFiles = writeJavaScriptFile; var detachedCommentsInfo; var writeComment = ts.writeCommentRange; + /** Emit a node */ var emit = emitNodeWithoutSourceMap; + /** Called just before starting emit of a node */ var emitStart = function (node) { }; + /** Called once the emit of the node is done */ var emitEnd = function (node) { }; + /** Emit the text for the given token that comes after startPos + * This by default writes the text provided with the given tokenKind + * but if optional emitFn callback is provided the text is emitted using the callback instead of default text + * @param tokenKind the kind of the token to search and emit + * @param startPos the position in the source to start searching for the token + * @param emitFn if given will be invoked to emit the text instead of actual token emit */ var emitToken = emitTokenText; + /** Called to before starting the lexical scopes as in function/class in the emitted code because of node + * @param scopeDeclaration node that starts the lexical scope + * @param scopeName Optional name of this scope instead of deducing one from the declaration node */ var scopeEmitStart = function (scopeDeclaration, scopeName) { }; + /** Called after coming out of the scope */ var scopeEmitEnd = function () { }; + /** Sourcemap data that will get encoded */ var sourceMapData; if (compilerOptions.sourceMap) { initializeEmitterWithSourceMaps(); } if (root) { + // Do not call emit directly. It does not set the currentSourceFile. emitSourceFile(root); } else { @@ -20350,27 +24155,36 @@ var ts; !ts.hasProperty(currentSourceFile.identifiers, name) && !ts.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) { if (flags && !(tempFlags & flags)) { - var name = flags === 268435456 ? "_i" : "_n"; + var name = flags === 268435456 /* _i */ ? "_i" : "_n"; if (isUniqueName(name)) { tempFlags |= flags; return name; } } while (true) { - var count = tempFlags & 268435455; + var count = tempFlags & 268435455 /* CountMask */; tempFlags++; + // Skip over 'i' and 'n' if (count !== 8 && count !== 13) { - var name_12 = count < 26 ? "_" + String.fromCharCode(97 + count) : "_" + (count - 26); - if (isUniqueName(name_12)) { - return name_12; + var name_15 = count < 26 ? "_" + String.fromCharCode(97 /* a */ + count) : "_" + (count - 26); + if (isUniqueName(name_15)) { + return name_15; } } } } + // 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) { - if (baseName.charCodeAt(baseName.length - 1) !== 95) { + // Find the first unique 'name_n', where n is a positive number + if (baseName.charCodeAt(baseName.length - 1) !== 95 /* _ */) { baseName += "_"; } var i = 1; @@ -20391,14 +24205,15 @@ var ts; } } 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)); + if (node.name.kind === 65 /* Identifier */) { + var name_16 = node.name.text; + // Use module/enum name itself if it is unique, otherwise make a unique variation + assignGeneratedName(node, isUniqueLocalName(name_16, node) ? name_16 : makeUniqueName(name_16)); } } function generateNameForImportOrExportDeclaration(node) { var expr = ts.getExternalModuleName(node); - var baseName = expr.kind === 8 ? + var baseName = expr.kind === 8 /* StringLiteral */ ? ts.escapeIdentifier(ts.makeIdentifierFromModuleName(expr.text)) : "module"; assignGeneratedName(node, makeUniqueName(baseName)); } @@ -20413,30 +24228,31 @@ var ts; } } function generateNameForExportAssignment(node) { - if (node.expression && node.expression.kind !== 65) { + if (node.expression && node.expression.kind !== 65 /* Identifier */) { assignGeneratedName(node, makeUniqueName("default")); } } function generateNameForNode(node) { switch (node.kind) { - case 200: - case 201: + case 200 /* FunctionDeclaration */: + case 201 /* ClassDeclaration */: + case 174 /* ClassExpression */: generateNameForFunctionOrClassDeclaration(node); break; - case 205: + case 205 /* ModuleDeclaration */: generateNameForModuleOrEnum(node); generateNameForNode(node.body); break; - case 204: + case 204 /* EnumDeclaration */: generateNameForModuleOrEnum(node); break; - case 209: + case 209 /* ImportDeclaration */: generateNameForImportDeclaration(node); break; - case 215: + case 215 /* ExportDeclaration */: generateNameForExportDeclaration(node); break; - case 214: + case 214 /* ExportAssignment */: generateNameForExportAssignment(node); break; } @@ -20449,13 +24265,16 @@ var ts; return nodeToGeneratedName[nodeId]; } function initializeEmitterWithSourceMaps() { - var sourceMapDir; + var sourceMapDir; // The directory in which sourcemap will be + // Current source map file and its index in the sources list var sourceMapSourceIndex = -1; + // Names and its index map var sourceMapNameIndexMap = {}; var sourceMapNameIndices = []; function getSourceMapNameIndex() { return sourceMapNameIndices.length ? sourceMapNameIndices[sourceMapNameIndices.length - 1] : -1; } + // Last recorded and encoded spans var lastRecordedSourceMapSpan; var lastEncodedSourceMapSpan = { emittedLine: 1, @@ -20465,26 +24284,35 @@ var ts; sourceIndex: 0 }; var lastEncodedNameIndex = 0; + // Encoding for sourcemap span function encodeLastRecordedSourceMapSpan() { if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan === lastEncodedSourceMapSpan) { return; } var prevEncodedEmittedColumn = lastEncodedSourceMapSpan.emittedColumn; + // Line/Comma delimiters if (lastEncodedSourceMapSpan.emittedLine == lastRecordedSourceMapSpan.emittedLine) { + // Emit comma to separate the entry if (sourceMapData.sourceMapMappings) { sourceMapData.sourceMapMappings += ","; } } else { + // Emit line delimiters for (var encodedLine = lastEncodedSourceMapSpan.emittedLine; encodedLine < lastRecordedSourceMapSpan.emittedLine; encodedLine++) { sourceMapData.sourceMapMappings += ";"; } prevEncodedEmittedColumn = 1; } + // 1. Relative Column 0 based sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.emittedColumn - prevEncodedEmittedColumn); + // 2. Relative sourceIndex sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceIndex - lastEncodedSourceMapSpan.sourceIndex); + // 3. Relative sourceLine 0 based sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceLine - lastEncodedSourceMapSpan.sourceLine); + // 4. Relative sourceColumn 0 based sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceColumn - lastEncodedSourceMapSpan.sourceColumn); + // 5. Relative namePosition 0 based if (lastRecordedSourceMapSpan.nameIndex >= 0) { sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.nameIndex - lastEncodedNameIndex); lastEncodedNameIndex = lastRecordedSourceMapSpan.nameIndex; @@ -20498,17 +24326,24 @@ var ts; } throw TypeError(inValue + ": not a 64 based value"); } + // Add a new least significant bit that has the sign of the value. + // if negative number the least significant bit that gets added to the number has value 1 + // else least significant bit value that gets added is 0 + // eg. -1 changes to binary : 01 [1] => 3 + // +1 changes to binary : 01 [0] => 2 if (inValue < 0) { inValue = ((-inValue) << 1) + 1; } else { inValue = inValue << 1; } + // Encode 5 bits at a time starting from least significant bits var encodedStr = ""; do { - var currentDigit = inValue & 31; + var currentDigit = inValue & 31; // 11111 inValue = inValue >> 5; if (inValue > 0) { + // There are still more digits to decode, set the msb (6th bit) currentDigit = currentDigit | 32; } encodedStr = encodedStr + base64FormatEncode(currentDigit); @@ -20518,17 +24353,21 @@ var ts; } function recordSourceMapSpan(pos) { var sourceLinePos = ts.getLineAndCharacterOfPosition(currentSourceFile, pos); + // Convert the location to be one-based. sourceLinePos.line++; sourceLinePos.character++; var emittedLine = writer.getLine(); var emittedColumn = writer.getColumn(); + // If this location wasn't recorded or the location in source is going backwards, record the span if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan.emittedLine != emittedLine || lastRecordedSourceMapSpan.emittedColumn != emittedColumn || (lastRecordedSourceMapSpan.sourceIndex === sourceMapSourceIndex && (lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line || (lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)))) { + // Encode the last recordedSpan before assigning new encodeLastRecordedSourceMapSpan(); + // New span lastRecordedSourceMapSpan = { emittedLine: emittedLine, emittedColumn: emittedColumn, @@ -20539,12 +24378,14 @@ var ts; }; } else { + // Take the new pos instead since there is no change in emittedLine and column since last location lastRecordedSourceMapSpan.sourceLine = sourceLinePos.line; lastRecordedSourceMapSpan.sourceColumn = sourceLinePos.character; lastRecordedSourceMapSpan.sourceIndex = sourceMapSourceIndex; } } function recordEmitNodeStartSpan(node) { + // Get the token pos after skipping to the token (ignoring the leading trivia) recordSourceMapSpan(ts.skipTrivia(currentSourceFile.text, node.pos)); } function recordEmitNodeEndSpan(node) { @@ -20558,9 +24399,14 @@ var ts; return tokenEndPos; } function recordNewSourceFileStart(node) { + // Add the file to tsFilePaths + // If sourceroot option: Use the relative path corresponding to the common directory path + // otherwise source locations relative to map file location var sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir; - sourceMapData.sourceMapSources.push(ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, node.fileName, host.getCurrentDirectory(), host.getCanonicalFileName, true)); + sourceMapData.sourceMapSources.push(ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, node.fileName, host.getCurrentDirectory(), host.getCanonicalFileName, + /*isAbsolutePathAnUrl*/ true)); sourceMapSourceIndex = sourceMapData.sourceMapSources.length - 1; + // The one that can be used from program to get the actual source file sourceMapData.inputSourceFileNames.push(node.fileName); } function recordScopeNameOfNode(node, scopeName) { @@ -20572,8 +24418,11 @@ var ts; if (scopeName) { var parentIndex = getSourceMapNameIndex(); if (parentIndex !== -1) { - var name_14 = node.name; - if (!name_14 || name_14.kind !== 127) { + // Child scopes are always shown with a dot (even if they have no name), + // unless it is a computed property. Then it is shown with brackets, + // but the brackets are included in the name. + var name_17 = node.name; + if (!name_17 || name_17.kind !== 127 /* ComputedPropertyName */) { scopeName = "." + scopeName; } scopeName = sourceMapData.sourceMapNames[parentIndex] + scopeName; @@ -20588,26 +24437,30 @@ var ts; recordScopeNameIndex(scopeNameIndex); } if (scopeName) { + // The scope was already given a name use it recordScopeNameStart(scopeName); } - 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) { + else if (node.kind === 200 /* FunctionDeclaration */ || + node.kind === 162 /* FunctionExpression */ || + node.kind === 134 /* MethodDeclaration */ || + node.kind === 133 /* MethodSignature */ || + node.kind === 136 /* GetAccessor */ || + node.kind === 137 /* SetAccessor */ || + node.kind === 205 /* ModuleDeclaration */ || + node.kind === 201 /* ClassDeclaration */ || + node.kind === 204 /* EnumDeclaration */) { + // Declaration and has associated name use it if (node.name) { - var name_15 = node.name; - scopeName = name_15.kind === 127 - ? ts.getTextOfNode(name_15) + var name_18 = node.name; + // For computed property names, the text will include the brackets + scopeName = name_18.kind === 127 /* ComputedPropertyName */ + ? ts.getTextOfNode(name_18) : node.name.text; } recordScopeNameStart(scopeName); } else { + // Block just use the name from upper level scope recordScopeNameIndex(getSourceMapNameIndex()); } } @@ -20644,11 +24497,14 @@ var ts; } } function writeJavaScriptAndSourceMapFile(emitOutput, writeByteOrderMark) { + // Write source map file encodeLastRecordedSourceMapSpan(); ts.writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings), false); sourceMapDataList.push(sourceMapData); + // Write sourcemap url to the js file and write the js file writeJavaScriptFile(emitOutput + "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL, writeByteOrderMark); } + // Initialize source map data var sourceMapJsFile = ts.getBaseFileName(ts.normalizeSlashes(jsFilePath)); sourceMapData = { sourceMapFilePath: jsFilePath + ".map", @@ -20661,18 +24517,24 @@ var ts; sourceMapMappings: "", sourceMapDecodedMappings: [] }; + // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the + // relative paths of the sources list in the sourcemap sourceMapData.sourceMapSourceRoot = ts.normalizeSlashes(sourceMapData.sourceMapSourceRoot); - if (sourceMapData.sourceMapSourceRoot.length && sourceMapData.sourceMapSourceRoot.charCodeAt(sourceMapData.sourceMapSourceRoot.length - 1) !== 47) { + if (sourceMapData.sourceMapSourceRoot.length && sourceMapData.sourceMapSourceRoot.charCodeAt(sourceMapData.sourceMapSourceRoot.length - 1) !== 47 /* slash */) { sourceMapData.sourceMapSourceRoot += ts.directorySeparator; } if (compilerOptions.mapRoot) { sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); if (root) { + // For modules or multiple emit files the mapRoot will have directory structure like the sources + // So if src\a.ts and src\lib\b.ts are compiled together user would be moving the maps into mapRoot\a.js.map and mapRoot\lib\b.js.map sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(root, host, sourceMapDir)); } if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { + // The relative paths are relative to the common directory sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir); - sourceMapData.jsSourceMappingURL = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(jsFilePath)), ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL), host.getCurrentDirectory(), host.getCanonicalFileName, true); + sourceMapData.jsSourceMappingURL = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(jsFilePath)), ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL), host.getCurrentDirectory(), host.getCanonicalFileName, + /*isAbsolutePathAnUrl*/ true); } else { sourceMapData.jsSourceMappingURL = ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL); @@ -20686,7 +24548,7 @@ var ts; if (ts.nodeIsSynthesized(node)) { return emitNodeWithoutSourceMap(node, false); } - if (node.kind != 227) { + if (node.kind != 227 /* SourceFile */) { recordEmitNodeStartSpan(node); emitNodeWithoutSourceMap(node, allowGeneratedIdentifiers); recordEmitNodeEndSpan(node); @@ -20709,8 +24571,9 @@ var ts; function writeJavaScriptFile(emitOutput, writeByteOrderMark) { ts.writeFile(host, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); } + // Create a temporary variable with a unique unused name. function createTempVariable(flags) { - var result = ts.createSynthesizedNode(65); + var result = ts.createSynthesizedNode(65 /* Identifier */); result.text = makeTempVariableName(flags); return result; } @@ -20804,27 +24667,32 @@ var ts; writeLine(); } } - function emitList(nodes, start, count, multiLine, trailingComma) { + function emitList(nodes, start, count, multiLine, trailingComma, leadingComma, noTrailingNewLine, emitNode) { + if (!emitNode) { + emitNode = emit; + } for (var 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) { if (nodes) { @@ -20841,12 +24709,12 @@ var ts; } } function isBinaryOrOctalIntegerLiteral(node, text) { - if (node.kind === 7 && text.length > 1) { + if (node.kind === 7 /* NumericLiteral */ && text.length > 1) { switch (text.charCodeAt(1)) { - case 98: - case 66: - case 111: - case 79: + case 98 /* b */: + case 66 /* B */: + case 111 /* o */: + case 79 /* O */: return true; } } @@ -20854,10 +24722,10 @@ var ts; } function emitLiteral(node) { var text = getLiteralText(node); - if (compilerOptions.sourceMap && (node.kind === 8 || ts.isTemplateLiteralKind(node.kind))) { + if (compilerOptions.sourceMap && (node.kind === 8 /* StringLiteral */ || ts.isTemplateLiteralKind(node.kind))) { writer.writeLiteral(text); } - else if (languageVersion < 2 && isBinaryOrOctalIntegerLiteral(node, text)) { + else if (languageVersion < 2 /* ES6 */ && isBinaryOrOctalIntegerLiteral(node, text)) { write(node.text); } else { @@ -20865,24 +24733,30 @@ var ts; } } function getLiteralText(node) { - if (languageVersion < 2 && (ts.isTemplateLiteralKind(node.kind) || node.hasExtendedUnicodeEscape)) { + // Any template literal or string literal with an extended escape + // (e.g. "\u{0067}") will need to be downleveled as a escaped string literal. + if (languageVersion < 2 /* ES6 */ && (ts.isTemplateLiteralKind(node.kind) || node.hasExtendedUnicodeEscape)) { return getQuotedEscapedLiteralText('"', node.text, '"'); } + // If we don't need to downlevel and we can reach the original source text using + // the node's parent reference, then simply get the text as it was originally written. if (node.parent) { return ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, node); } + // If we can't reach the original source text, use the canonical form if it's a number, + // or an escaped quoted form of the original text if it's string-like. switch (node.kind) { - case 8: + case 8 /* StringLiteral */: return getQuotedEscapedLiteralText('"', node.text, '"'); - case 10: + case 10 /* NoSubstitutionTemplateLiteral */: return getQuotedEscapedLiteralText('`', node.text, '`'); - case 11: + case 11 /* TemplateHead */: return getQuotedEscapedLiteralText('`', node.text, '${'); - case 12: + case 12 /* TemplateMiddle */: return getQuotedEscapedLiteralText('}', node.text, '${'); - case 13: + case 13 /* TemplateTail */: return getQuotedEscapedLiteralText('}', node.text, '`'); - case 7: + case 7 /* NumericLiteral */: return node.text; } ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for."); @@ -20891,16 +24765,26 @@ var ts; return leftQuote + ts.escapeNonAsciiCharacters(ts.escapeString(text)) + rightQuote; } function emitDownlevelRawTemplateLiteral(node) { + // Find original source text, since we need to emit the raw strings of the tagged template. + // The raw strings contain the (escaped) strings of what the user wrote. + // Examples: `\n` is converted to "\\n", a template string with a newline to "\n". var text = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, node); - var isLast = node.kind === 10 || node.kind === 13; + // text contains the original source, it will also contain quotes ("`"), dolar signs and braces ("${" and "}"), + // thus we need to remove those characters. + // First template piece starts with "`", others with "}" + // Last template piece ends with "`", others with "${" + var isLast = node.kind === 10 /* NoSubstitutionTemplateLiteral */ || node.kind === 13 /* TemplateTail */; text = text.substring(1, text.length - (isLast ? 1 : 2)); + // Newline normalization: + // ES6 Spec 11.8.6.1 - Static Semantics of TV's and TRV's + // and LineTerminatorSequences are normalized to for both TV and TRV. text = text.replace(/\r\n?/g, "\n"); text = ts.escapeString(text); write('"' + text + '"'); } function emitDownlevelTaggedTemplateArray(node, literalEmitter) { write("["); - if (node.template.kind === 10) { + if (node.template.kind === 10 /* NoSubstitutionTemplateLiteral */) { literalEmitter(node.template); } else { @@ -20913,7 +24797,7 @@ var ts; write("]"); } function emitDownlevelTaggedTemplate(node) { - var tempVariable = createAndRecordTempVariable(0); + var tempVariable = createAndRecordTempVariable(0 /* Auto */); write("("); emit(tempVariable); write(" = "); @@ -20926,18 +24810,21 @@ var ts; emitParenthesizedIf(node.tag, needsParenthesisForPropertyAccessOrInvocation(node.tag)); write("("); emit(tempVariable); - if (node.template.kind === 171) { + // Now we emit the expressions + if (node.template.kind === 171 /* TemplateExpression */) { ts.forEach(node.template.templateSpans, function (templateSpan) { write(", "); - var needsParens = templateSpan.expression.kind === 169 - && templateSpan.expression.operatorToken.kind === 23; + var needsParens = templateSpan.expression.kind === 169 /* BinaryExpression */ + && templateSpan.expression.operatorToken.kind === 23 /* CommaToken */; emitParenthesizedIf(templateSpan.expression, needsParens); }); } write("))"); } function emitTemplateExpression(node) { - if (languageVersion >= 2) { + // In ES6 mode and above, we can simply emit each portion of a template in order, but in + // ES3 & ES5 we must convert the template expression into a series of string concatenations. + if (languageVersion >= 2 /* ES6 */) { ts.forEachChild(node, emit); return; } @@ -20953,12 +24840,28 @@ var ts; } for (var i = 0, n = node.templateSpans.length; i < n; i++) { var templateSpan = node.templateSpans[i]; - var needsParens = templateSpan.expression.kind !== 161 - && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1; + // Check if the expression has operands and binds its operands less closely than binary '+'. + // If it does, we need to wrap the expression in parentheses. Otherwise, something like + // `abc${ 1 << 2 }` + // becomes + // "abc" + 1 << 2 + "" + // which is really + // ("abc" + 1) << (2 + "") + // rather than + // "abc" + (1 << 2) + "" + var needsParens = templateSpan.expression.kind !== 161 /* ParenthesizedExpression */ + && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1 /* GreaterThan */; if (i > 0 || headEmitted) { + // If this is the first span and the head was not emitted, then this templateSpan's + // expression will be the first to be emitted. Don't emit the preceding ' + ' in that + // case. write(" + "); } emitParenthesizedIf(templateSpan.expression, needsParens); + // Only emit if the literal is non-empty. + // The binary '+' operator is left-associative, so the first string concatenation + // with the head will force the result up to this point to be a string. + // Emitting a '+ ""' has no semantic effect for middles and tails. if (templateSpan.literal.text.length !== 0) { write(" + "); emitLiteral(templateSpan.literal); @@ -20981,39 +24884,55 @@ var ts; // `${ foo }${ bar }` // must still be emitted as // "" + foo + bar + // There is always atleast one templateSpan in this code path, since + // NoSubstitutionTemplateLiterals are directly emitted via emitLiteral() 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 157: - case 158: + case 157 /* CallExpression */: + case 158 /* NewExpression */: return parent.expression === template; - case 159: - case 161: + case 159 /* TaggedTemplateExpression */: + case 161 /* ParenthesizedExpression */: return false; default: - return comparePrecedenceToBinaryPlus(parent) !== -1; + return comparePrecedenceToBinaryPlus(parent) !== -1 /* LessThan */; } } + /** + * Returns whether the expression has lesser, greater, + * or equal precedence to the binary '+' operator + */ function comparePrecedenceToBinaryPlus(expression) { + // All binary expressions have lower precedence than '+' apart from '*', '/', and '%' + // which have greater precedence and '-' which has equal precedence. + // All unary operators have a higher precedence apart from yield. + // Arrow functions and conditionals have a lower precedence, + // although we convert the former into regular function expressions in ES5 mode, + // and in ES6 mode this function won't get called anyway. + // + // TODO (drosen): Note that we need to account for the upcoming 'yield' and + // spread ('...') unary operators that are anticipated for ES6. switch (expression.kind) { - case 169: + case 169 /* BinaryExpression */: switch (expression.operatorToken.kind) { - case 35: - case 36: - case 37: - return 1; - case 33: - case 34: - return 0; + case 35 /* AsteriskToken */: + case 36 /* SlashToken */: + case 37 /* PercentToken */: + return 1 /* GreaterThan */; + case 33 /* PlusToken */: + case 34 /* MinusToken */: + return 0 /* EqualTo */; default: - return -1; + return -1 /* LessThan */; } - case 170: - return -1; + case 172 /* YieldExpression */: + case 170 /* ConditionalExpression */: + return -1 /* LessThan */; default: - return 1; + return 1 /* GreaterThan */; } } } @@ -21021,25 +24940,39 @@ var ts; emit(span.expression); emit(span.literal); } + // This function specifically handles numeric/string literals for enum and accessor 'identifiers'. + // In a sense, it does not actually emit identifiers as much as it declares a name for a specific property. + // For example, this is utilized when feeding in a result to Object.defineProperty. function emitExpressionForPropertyName(node) { - ts.Debug.assert(node.kind !== 152); - if (node.kind === 8) { + ts.Debug.assert(node.kind !== 152 /* BindingElement */); + if (node.kind === 8 /* StringLiteral */) { emitLiteral(node); } - else if (node.kind === 127) { + else if (node.kind === 127 /* ComputedPropertyName */) { + // if this is a decorated computed property, we will need to capture the result + // of the property expression so that we can apply decorators later. This is to ensure + // we don't introduce unintended side effects: + // + // class C { + // [_a = x]() { } + // } + // + // The emit for the decorated computed property decorator is: + // + // Object.defineProperty(C.prototype, _a, __decorate([dec], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a))); + // if (ts.nodeIsDecorated(node.parent)) { if (!computedPropertyNamesToGeneratedNames) { computedPropertyNamesToGeneratedNames = []; } - var generatedName = computedPropertyNamesToGeneratedNames[node.id]; + var generatedName = computedPropertyNamesToGeneratedNames[ts.getNodeId(node)]; if (generatedName) { + // we have already generated a variable for this node, write that value instead. write(generatedName); return; } - var generatedVariable = createTempVariable(0); - generatedName = generatedVariable.text; - recordTempDeclaration(generatedVariable); - computedPropertyNamesToGeneratedNames[node.id] = generatedName; + generatedName = createAndRecordTempVariable(0 /* Auto */).text; + computedPropertyNamesToGeneratedNames[ts.getNodeId(node)] = generatedName; write(generatedName); write(" = "); } @@ -21047,7 +24980,7 @@ var ts; } else { write("\""); - if (node.kind === 7) { + if (node.kind === 7 /* NumericLiteral */) { write(node.text); } else { @@ -21059,36 +24992,36 @@ var ts; function isNotExpressionIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 129: - case 198: - case 152: - case 132: - case 131: - case 224: - case 225: - case 226: - case 134: - case 133: - case 200: - case 136: - case 137: - case 162: - case 201: - case 202: - case 204: - case 205: - case 208: - case 210: - case 211: + case 129 /* Parameter */: + case 198 /* VariableDeclaration */: + case 152 /* BindingElement */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 224 /* PropertyAssignment */: + case 225 /* ShorthandPropertyAssignment */: + case 226 /* EnumMember */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 200 /* FunctionDeclaration */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 162 /* FunctionExpression */: + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + case 204 /* EnumDeclaration */: + case 205 /* ModuleDeclaration */: + case 208 /* ImportEqualsDeclaration */: + case 210 /* ImportClause */: + case 211 /* NamespaceImport */: return parent.name === node; - case 213: - case 217: + case 213 /* ImportSpecifier */: + case 217 /* ExportSpecifier */: return parent.name === node || parent.propertyName === node; - case 190: - case 189: - case 214: + case 190 /* BreakStatement */: + case 189 /* ContinueStatement */: + case 214 /* ExportAssignment */: return false; - case 194: + case 194 /* LabeledStatement */: return node.parent.label === node; } } @@ -21130,7 +25063,7 @@ var ts; } } function emitThis(node) { - if (resolver.getNodeCheckFlags(node) & 2) { + if (resolver.getNodeCheckFlags(node) & 2 /* LexicalThis */) { write("_this"); } else { @@ -21138,12 +25071,12 @@ var ts; } } function emitSuper(node) { - if (languageVersion >= 2) { + if (languageVersion >= 2 /* ES6 */) { write("super"); } else { var flags = resolver.getNodeCheckFlags(node); - if (flags & 16) { + if (flags & 16 /* SuperInstance */) { write("_super.prototype"); } else { @@ -21183,14 +25116,26 @@ var ts; write("..."); emit(node.expression); } + function emitYieldExpression(node) { + write(ts.tokenToString(110 /* YieldKeyword */)); + if (node.asteriskToken) { + write("*"); + } + if (node.expression) { + write(" "); + emit(node.expression); + } + } function needsParenthesisForPropertyAccessOrInvocation(node) { switch (node.kind) { - case 65: - case 153: - case 155: - case 156: - case 157: - case 161: + case 65 /* Identifier */: + case 153 /* ArrayLiteralExpression */: + case 155 /* PropertyAccessExpression */: + case 156 /* ElementAccessExpression */: + case 157 /* CallExpression */: + case 161 /* ParenthesizedExpression */: + // This list is not exhaustive and only includes those cases that are relevant + // to the check in emitArrayLiteral. More cases can be added as needed. return false; } return true; @@ -21200,6 +25145,7 @@ var ts; var group = 0; var length = elements.length; while (pos < length) { + // Emit using the pattern .concat(, , ...) if (group === 1) { write(".concat("); } @@ -21207,14 +25153,14 @@ var ts; write(", "); } var e = elements[pos]; - if (e.kind === 173) { + if (e.kind === 173 /* SpreadElementExpression */) { e = e.expression; emitParenthesizedIf(e, group === 0 && needsParenthesisForPropertyAccessOrInvocation(e)); pos++; } else { var i = pos; - while (i < length && elements[i].kind !== 173) { + while (i < length && elements[i].kind !== 173 /* SpreadElementExpression */) { i++; } write("["); @@ -21235,171 +25181,169 @@ var ts; } } function isSpreadElementExpression(node) { - return node.kind === 173; + return node.kind === 173 /* SpreadElementExpression */; } function emitArrayLiteral(node) { var elements = node.elements; if (elements.length === 0) { write("[]"); } - else if (languageVersion >= 2 || !ts.forEach(elements, isSpreadElementExpression)) { + else if (languageVersion >= 2 /* ES6 */ || !ts.forEach(elements, isSpreadElementExpression)) { write("["); emitLinePreservingList(node, node.elements, elements.hasTrailingComma, false); write("]"); } else { - emitListWithSpread(elements, (node.flags & 512) !== 0, elements.hasTrailingComma); + emitListWithSpread(elements, (node.flags & 512 /* MultiLine */) !== 0, + /*trailingComma*/ elements.hasTrailingComma); } } + function emitObjectLiteralBody(node, numElements) { + 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, languageVersion >= 1 /* ES5 */, true); + } + else { + var multiLine = (node.flags & 512 /* MultiLine */) !== 0; + if (!multiLine) { + write(" "); + } + else { + increaseIndent(); + } + emitList(properties, 0, numElements, multiLine, false); + if (!multiLine) { + write(" "); + } + else { + decreaseIndent(); + } + } + } + write("}"); + } function emitDownlevelObjectLiteralWithComputedProperties(node, firstComputedPropertyIndex) { - var parenthesizedObjectLiteral = createDownlevelObjectLiteralWithComputedProperties(node, firstComputedPropertyIndex); - return emit(parenthesizedObjectLiteral); - } - function createDownlevelObjectLiteralWithComputedProperties(originalObjectLiteral, firstComputedPropertyIndex) { - var tempVar = createAndRecordTempVariable(0); - var initialObjectLiteral = ts.createSynthesizedNode(154); - initialObjectLiteral.properties = originalObjectLiteral.properties.slice(0, firstComputedPropertyIndex); - initialObjectLiteral.flags |= 512; - var propertyPatches = createBinaryExpression(tempVar, 53, initialObjectLiteral); - ts.forEach(originalObjectLiteral.properties, function (property) { - var patchedProperty = tryCreatePatchingPropertyAssignment(originalObjectLiteral, tempVar, property); - if (patchedProperty) { - propertyPatches = createBinaryExpression(propertyPatches, 23, patchedProperty); + var multiLine = (node.flags & 512 /* MultiLine */) !== 0; + var 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. + var tempVar = createAndRecordTempVariable(0 /* Auto */); + // 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); + for (var i = firstComputedPropertyIndex, n = properties.length; i < n; i++) { + writeComma(); + var property = properties[i]; + emitStart(property); + if (property.kind === 136 /* GetAccessor */ || property.kind === 137 /* SetAccessor */) { + // TODO (drosen): Reconcile with 'emitMemberFunctions'. + var accessors = ts.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); } - }); - propertyPatches = createBinaryExpression(propertyPatches, 23, createIdentifier(tempVar.text, true)); - var result = createParenthesizedExpression(propertyPatches); - return result; - } - function addCommentsToSynthesizedNode(node, leadingCommentRanges, trailingCommentRanges) { - node.leadingCommentRanges = leadingCommentRanges; - node.trailingCommentRanges = trailingCommentRanges; - } - function tryCreatePatchingPropertyAssignment(objectLiteral, tempVar, property) { - var leftHandSide = createMemberAccessForPropertyName(tempVar, property.name); - var maybeRightHandSide = tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral, property); - return maybeRightHandSide && createBinaryExpression(leftHandSide, 53, maybeRightHandSide, true); - } - function tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral, property) { - switch (property.kind) { - case 224: - return property.initializer; - case 225: - return createIdentifier(resolver.getExpressionNameSubstitution(property.name, getGeneratedNameForNode)); - case 134: - 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; + else { + emitLeadingComments(property); + emitStart(property.name); + emit(tempVar); + emitMemberAccessForPropertyName(property.name); + emitEnd(property.name); + write(" = "); + if (property.kind === 224 /* PropertyAssignment */) { + emit(property.initializer); } - var propertyDescriptor = ts.createSynthesizedNode(154); - var descriptorProperties = []; - if (getAccessor) { - var getProperty_1 = createPropertyAssignment(createIdentifier("get"), createFunctionExpression(getAccessor.parameters, getAccessor.body)); - descriptorProperties.push(getProperty_1); + else if (property.kind === 225 /* ShorthandPropertyAssignment */) { + emitExpressionIdentifier(property.name); } - if (setAccessor) { - var setProperty = createPropertyAssignment(createIdentifier("set"), createFunctionExpression(setAccessor.parameters, setAccessor.body)); - descriptorProperties.push(setProperty); + else if (property.kind === 134 /* MethodDeclaration */) { + emitFunctionDeclaration(property); } - var trueExpr = ts.createSynthesizedNode(95); - var enumerableTrue = createPropertyAssignment(createIdentifier("enumerable"), trueExpr); - descriptorProperties.push(enumerableTrue); - var configurableTrue = createPropertyAssignment(createIdentifier("configurable"), trueExpr); - descriptorProperties.push(configurableTrue); - propertyDescriptor.properties = descriptorProperties; - var objectDotDefineProperty = createPropertyAccessExpression(createIdentifier("Object"), createIdentifier("defineProperty")); - return createCallExpression(objectDotDefineProperty, createNodeArray(propertyDescriptor)); - default: - ts.Debug.fail("ObjectLiteralElement kind " + property.kind + " not accounted for."); + else { + ts.Debug.fail("ObjectLiteralElement type not accounted for: " + property.kind); + } + } + emitEnd(property); } - } - function createParenthesizedExpression(expression) { - var result = ts.createSynthesizedNode(161); - result.expression = expression; - return result; - } - function createNodeArray() { - var elements = []; - for (var _a = 0; _a < arguments.length; _a++) { - elements[_a - 0] = arguments[_a]; + writeComma(); + emit(tempVar); + if (multiLine) { + decreaseIndent(); + writeLine(); } - var result = elements; - result.pos = -1; - result.end = -1; - return result; - } - function createBinaryExpression(left, operator, right, 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(182); - result.expression = expression; - return result; - } - function createMemberAccessForPropertyName(expression, memberName) { - if (memberName.kind === 65) { - return createPropertyAccessExpression(expression, memberName); + write(")"); + function writeComma() { + if (multiLine) { + write(","); + writeLine(); + } + else { + write(", "); + } } - else if (memberName.kind === 8 || memberName.kind === 7) { - return createElementAccessExpression(expression, memberName); - } - else if (memberName.kind === 127) { - return createElementAccessExpression(expression, memberName.expression); - } - else { - ts.Debug.fail("Kind '" + memberName.kind + "' not accounted for."); - } - } - function createPropertyAssignment(name, initializer) { - var result = ts.createSynthesizedNode(224); - result.name = name; - result.initializer = initializer; - return result; - } - function createFunctionExpression(parameters, body) { - var result = ts.createSynthesizedNode(162); - result.parameters = parameters; - result.body = body; - return result; - } - function createPropertyAccessExpression(expression, name) { - 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(156); - result.expression = expression; - result.argumentExpression = argumentExpression; - return result; - } - function createIdentifier(name, startsOnNewLine) { - var result = ts.createSynthesizedNode(65, startsOnNewLine); - result.text = name; - return result; - } - function createCallExpression(invokedExpression, arguments) { - var result = ts.createSynthesizedNode(157); - result.expression = invokedExpression; - result.arguments = arguments; - return result; } function emitObjectLiteral(node) { var properties = node.properties; - if (languageVersion < 2) { + if (languageVersion < 2 /* ES6 */) { var numProperties = properties.length; + // Find the first computed property. + // Everything until that point can be emitted as part of the initial object literal. var numInitialNonComputedProperties = numProperties; for (var i = 0, n = properties.length; i < n; i++) { - if (properties[i].name.kind === 127) { + if (properties[i].name.kind === 127 /* ComputedPropertyName */) { numInitialNonComputedProperties = i; break; } @@ -21410,11 +25354,45 @@ var ts; return; } } - write("{"); - if (properties.length) { - emitLinePreservingList(node, properties, languageVersion >= 1, true); + // Ordinary case: either the object has no computed properties + // or we're compiling with an ES6+ target. + emitObjectLiteralBody(node, properties.length); + } + function createBinaryExpression(left, operator, right, startsOnNewLine) { + var result = ts.createSynthesizedNode(169 /* BinaryExpression */, startsOnNewLine); + result.operatorToken = ts.createSynthesizedNode(operator); + result.left = left; + result.right = right; + return result; + } + function createPropertyAccessExpression(expression, name) { + var result = ts.createSynthesizedNode(155 /* PropertyAccessExpression */); + result.expression = parenthesizeForAccess(expression); + result.dotToken = ts.createSynthesizedNode(20 /* DotToken */); + result.name = name; + return result; + } + function createElementAccessExpression(expression, argumentExpression) { + var result = ts.createSynthesizedNode(156 /* ElementAccessExpression */); + result.expression = parenthesizeForAccess(expression); + result.argumentExpression = argumentExpression; + return result; + } + function parenthesizeForAccess(expr) { + // isLeftHandSideExpression is almost the correct criterion for when it is not necessary + // to parenthesize the expression before a dot. The known exceptions are: + // + // NewExpression: + // new C.x -> not the same as (new C).x + // NumberLiteral + // 1.x -> not the same as (1).x + // + if (ts.isLeftHandSideExpression(expr) && expr.kind !== 158 /* NewExpression */ && expr.kind !== 7 /* NumericLiteral */) { + return expr; } - write("}"); + var node = ts.createSynthesizedNode(161 /* ParenthesizedExpression */); + node.expression = expr; + return node; } function emitComputedPropertyName(node) { write("["); @@ -21422,8 +25400,11 @@ var ts; write("]"); } function emitMethod(node) { + if (languageVersion >= 2 /* ES6 */ && node.asteriskToken) { + write("*"); + } emit(node.name, false); - if (languageVersion < 2) { + if (languageVersion < 2 /* ES6 */) { write(": function "); } emitSignatureAndBody(node); @@ -21435,38 +25416,57 @@ var ts; } function emitShorthandPropertyAssignment(node) { emit(node.name, false); - if (languageVersion < 2) { + // If short-hand property has a prefix, then regardless of the target version, we will emit it as normal property assignment. For example: + // module m { + // export let y; + // } + // module m { + // export let obj = { y }; + // } + // The short-hand property in obj need to emit as such ... = { y : m.y } regardless of the TargetScript version + if (languageVersion < 2 /* ES6 */) { + // Emit identifier as an identifier write(": "); var generatedName = getGeneratedNameForIdentifier(node.name); if (generatedName) { write(generatedName); } else { + // Even though this is stored as identifier treat it as an expression + // Short-hand, { x }, is equivalent of normal form { x: x } emitExpressionIdentifier(node.name); } } else if (resolver.getExpressionNameSubstitution(node.name, getGeneratedNameForNode)) { + // Emit identifier as an identifier write(": "); + // Even though this is stored as identifier treat it as an expression + // Short-hand, { x }, is equivalent of normal form { x: x } emitExpressionIdentifier(node.name); } } function tryEmitConstantValue(node) { if (compilerOptions.separateCompilation) { + // do not inline enum values in separate compilation mode return false; } var constantValue = resolver.getConstantValue(node); if (constantValue !== undefined) { write(constantValue.toString()); if (!compilerOptions.removeComments) { - var propertyName = node.kind === 155 ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); + var propertyName = node.kind === 155 /* PropertyAccessExpression */ ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); write(" /* " + propertyName + " */"); } return true; } return false; } + // Returns 'true' if the code was actually indented, false otherwise. + // If the code is not indented, an optional valueToWriteWhenNotIndenting will be + // emitted instead. function indentIfOnDifferentLines(parent, node1, node2, valueToWriteWhenNotIndenting) { var realNodesAreOnDifferentLines = !ts.nodeIsSynthesized(parent) && !nodeEndIsOnSameLineAsNodeStart(node1, node2); + // Always use a newline for synthesized code if the synthesizer desires it. var synthesizedNodeIsOnDifferentLine = synthesizedNodeStartsOnNewLine(node2); if (realNodesAreOnDifferentLines || synthesizedNodeIsOnDifferentLine) { increaseIndent(); @@ -21506,20 +25506,20 @@ var ts; write("]"); } function hasSpreadElement(elements) { - return ts.forEach(elements, function (e) { return e.kind === 173; }); + return ts.forEach(elements, function (e) { return e.kind === 173 /* SpreadElementExpression */; }); } function skipParentheses(node) { - while (node.kind === 161 || node.kind === 160) { + while (node.kind === 161 /* ParenthesizedExpression */ || node.kind === 160 /* TypeAssertionExpression */) { node = node.expression; } return node; } function emitCallTarget(node) { - if (node.kind === 65 || node.kind === 93 || node.kind === 91) { + if (node.kind === 65 /* Identifier */ || node.kind === 93 /* ThisKeyword */ || node.kind === 91 /* SuperKeyword */) { emit(node); return node; } - var temp = createAndRecordTempVariable(0); + var temp = createAndRecordTempVariable(0 /* Auto */); write("("); emit(temp); write(" = "); @@ -21530,18 +25530,20 @@ var ts; function emitCallWithSpread(node) { var target; var expr = skipParentheses(node.expression); - if (expr.kind === 155) { + if (expr.kind === 155 /* PropertyAccessExpression */) { + // Target will be emitted as "this" argument target = emitCallTarget(expr.expression); write("."); emit(expr.name); } - else if (expr.kind === 156) { + else if (expr.kind === 156 /* ElementAccessExpression */) { + // Target will be emitted as "this" argument target = emitCallTarget(expr.expression); write("["); emit(expr.argumentExpression); write("]"); } - else if (expr.kind === 91) { + else if (expr.kind === 91 /* SuperKeyword */) { target = expr; write("_super"); } @@ -21550,14 +25552,17 @@ var ts; } write(".apply("); if (target) { - if (target.kind === 91) { + if (target.kind === 91 /* SuperKeyword */) { + // Calls of form super(...) and super.foo(...) emitThis(target); } else { + // Calls of form obj.foo(...) emit(target); } } else { + // Calls of form foo(...) write("void 0"); } write(", "); @@ -21565,20 +25570,20 @@ var ts; write(")"); } function emitCallExpression(node) { - if (languageVersion < 2 && hasSpreadElement(node.arguments)) { + if (languageVersion < 2 /* ES6 */ && hasSpreadElement(node.arguments)) { emitCallWithSpread(node); return; } var superCall = false; - if (node.expression.kind === 91) { + if (node.expression.kind === 91 /* SuperKeyword */) { emitSuper(node.expression); superCall = true; } else { emit(node.expression); - superCall = node.expression.kind === 155 && node.expression.expression.kind === 91; + superCall = node.expression.kind === 155 /* PropertyAccessExpression */ && node.expression.expression.kind === 91 /* SuperKeyword */; } - if (superCall && languageVersion < 2) { + if (superCall && languageVersion < 2 /* ES6 */) { write(".call("); emitThis(node.expression); if (node.arguments.length) { @@ -21603,7 +25608,7 @@ var ts; } } function emitTaggedTemplateExpression(node) { - if (languageVersion >= 2) { + if (languageVersion >= 2 /* ES6 */) { emit(node.tag); write(" "); emit(node.template); @@ -21613,20 +25618,30 @@ var ts; } } function emitParenExpression(node) { - if (!node.parent || node.parent.kind !== 163) { - if (node.expression.kind === 160) { + if (!node.parent || node.parent.kind !== 163 /* ArrowFunction */) { + if (node.expression.kind === 160 /* TypeAssertionExpression */) { var operand = node.expression.expression; - while (operand.kind == 160) { + // Make sure we consider all nested cast expressions, e.g.: + // (-A).x; + while (operand.kind == 160 /* TypeAssertionExpression */) { operand = operand.expression; } - 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)) { + // We have an expression of the form: (SubExpr) + // Emitting this as (SubExpr) is really not desirable. We would like to emit the subexpr as is. + // Omitting the parentheses, however, could cause change in the semantics of the generated + // code if the casted expression has a lower precedence than the rest of the expression, e.g.: + // (new A).foo should be emitted as (new A).foo and not new A.foo + // (typeof A).toString() should be emitted as (typeof A).toString() and not typeof A.toString() + // new (A()) should be emitted as new (A()) and not new A() + // (function foo() { })() should be emitted as an IIF (function foo(){})() and not declaration function foo(){} () + if (operand.kind !== 167 /* PrefixUnaryExpression */ && + operand.kind !== 166 /* VoidExpression */ && + operand.kind !== 165 /* TypeOfExpression */ && + operand.kind !== 164 /* DeleteExpression */ && + operand.kind !== 168 /* PostfixUnaryExpression */ && + operand.kind !== 158 /* NewExpression */ && + !(operand.kind === 157 /* CallExpression */ && node.parent.kind === 158 /* NewExpression */) && + !(operand.kind === 162 /* FunctionExpression */ && node.parent.kind === 157 /* CallExpression */)) { emit(operand); return; } @@ -21637,28 +25652,40 @@ var ts; write(")"); } function emitDeleteExpression(node) { - write(ts.tokenToString(74)); + write(ts.tokenToString(74 /* DeleteKeyword */)); write(" "); emit(node.expression); } function emitVoidExpression(node) { - write(ts.tokenToString(99)); + write(ts.tokenToString(99 /* VoidKeyword */)); write(" "); emit(node.expression); } function emitTypeOfExpression(node) { - write(ts.tokenToString(97)); + write(ts.tokenToString(97 /* TypeOfKeyword */)); write(" "); emit(node.expression); } function emitPrefixUnaryExpression(node) { write(ts.tokenToString(node.operator)); - if (node.operand.kind === 167) { + // In some cases, we need to emit a space between the operator and the operand. One obvious case + // is when the operator is an identifier, like delete or typeof. We also need to do this for plus + // and minus expressions in certain cases. Specifically, consider the following two cases (parens + // are just for clarity of exposition, and not part of the source code): + // + // (+(+1)) + // (+(++1)) + // + // We need to emit a space in both cases. In the first case, the absence of a space will make + // the resulting expression a prefix increment operation. And in the second, it will make the resulting + // expression a prefix increment whose operand is a plus expression - (++(+x)) + // The same is true of minus of course. + if (node.operand.kind === 167 /* PrefixUnaryExpression */) { var operand = node.operand; - if (node.operator === 33 && (operand.operator === 33 || operand.operator === 38)) { + if (node.operator === 33 /* PlusToken */ && (operand.operator === 33 /* PlusToken */ || operand.operator === 38 /* PlusPlusToken */)) { write(" "); } - else if (node.operator === 34 && (operand.operator === 34 || operand.operator === 39)) { + else if (node.operator === 34 /* MinusToken */ && (operand.operator === 34 /* MinusToken */ || operand.operator === 39 /* MinusMinusToken */)) { write(" "); } } @@ -21669,13 +25696,13 @@ var ts; write(ts.tokenToString(node.operator)); } function emitBinaryExpression(node) { - if (languageVersion < 2 && node.operatorToken.kind === 53 && - (node.left.kind === 154 || node.left.kind === 153)) { - emitDestructuring(node, node.parent.kind === 182); + if (languageVersion < 2 /* ES6 */ && node.operatorToken.kind === 53 /* EqualsToken */ && + (node.left.kind === 154 /* ObjectLiteralExpression */ || node.left.kind === 153 /* ArrayLiteralExpression */)) { + emitDestructuring(node, node.parent.kind === 182 /* ExpressionStatement */); } else { emit(node.left); - var indentedBeforeOperator = indentIfOnDifferentLines(node, node.left, node.operatorToken, node.operatorToken.kind !== 23 ? " " : undefined); + var indentedBeforeOperator = indentIfOnDifferentLines(node, node.left, node.operatorToken, node.operatorToken.kind !== 23 /* CommaToken */ ? " " : undefined); write(ts.tokenToString(node.operatorToken.kind)); var indentedAfterOperator = indentIfOnDifferentLines(node, node.operatorToken, node.right, " "); emit(node.right); @@ -21698,6 +25725,10 @@ var ts; emit(node.whenFalse); decreaseIndentIf(indentedBeforeColon, indentedAfterColon); } + // Helper function to decrease the indent if we previously indented. Allows multiple + // previous indent values to be considered at a time. This also allows caller to just + // call this once, passing in all their appropriate indent values, instead of needing + // to call this helper function multiple times. function decreaseIndentIf(value1, value2) { if (value1) { decreaseIndent(); @@ -21707,36 +25738,36 @@ var ts; } } function isSingleLineEmptyBlock(node) { - if (node && node.kind === 179) { + if (node && node.kind === 179 /* Block */) { var block = node; return block.statements.length === 0 && nodeEndIsOnSameLineAsNodeStart(block, block); } } function emitBlock(node) { if (isSingleLineEmptyBlock(node)) { - emitToken(14, node.pos); + emitToken(14 /* OpenBraceToken */, node.pos); write(" "); - emitToken(15, node.statements.end); + emitToken(15 /* CloseBraceToken */, node.statements.end); return; } - emitToken(14, node.pos); + emitToken(14 /* OpenBraceToken */, node.pos); increaseIndent(); scopeEmitStart(node.parent); - if (node.kind === 206) { - ts.Debug.assert(node.parent.kind === 205); + if (node.kind === 206 /* ModuleBlock */) { + ts.Debug.assert(node.parent.kind === 205 /* ModuleDeclaration */); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); - if (node.kind === 206) { + if (node.kind === 206 /* ModuleBlock */) { emitTempDeclarations(true); } decreaseIndent(); writeLine(); - emitToken(15, node.statements.end); + emitToken(15 /* CloseBraceToken */, node.statements.end); scopeEmitEnd(); } function emitEmbeddedStatement(node) { - if (node.kind === 179) { + if (node.kind === 179 /* Block */) { write(" "); emit(node); } @@ -21748,20 +25779,20 @@ var ts; } } function emitExpressionStatement(node) { - emitParenthesizedIf(node.expression, node.expression.kind === 163); + emitParenthesizedIf(node.expression, node.expression.kind === 163 /* ArrowFunction */); write(";"); } function emitIfStatement(node) { - var endPos = emitToken(84, node.pos); + var endPos = emitToken(84 /* IfKeyword */, node.pos); write(" "); - endPos = emitToken(16, endPos); + endPos = emitToken(16 /* OpenParenToken */, endPos); emit(node.expression); - emitToken(17, node.expression.end); + emitToken(17 /* CloseParenToken */, node.expression.end); emitEmbeddedStatement(node.thenStatement); if (node.elseStatement) { writeLine(); - emitToken(76, node.thenStatement.end); - if (node.elseStatement.kind === 183) { + emitToken(76 /* ElseKeyword */, node.thenStatement.end); + if (node.elseStatement.kind === 183 /* IfStatement */) { write(" "); emit(node.elseStatement); } @@ -21773,7 +25804,7 @@ var ts; function emitDoStatement(node) { write("do"); emitEmbeddedStatement(node.statement); - if (node.statement.kind === 179) { + if (node.statement.kind === 179 /* Block */) { write(" "); } else { @@ -21790,13 +25821,13 @@ var ts; emitEmbeddedStatement(node.statement); } function emitStartOfVariableDeclarationList(decl, startPos) { - var tokenKind = 98; - if (decl && languageVersion >= 2) { + var tokenKind = 98 /* VarKeyword */; + if (decl && languageVersion >= 2 /* ES6 */) { if (ts.isLet(decl)) { - tokenKind = 105; + tokenKind = 104 /* LetKeyword */; } else if (ts.isConst(decl)) { - tokenKind = 70; + tokenKind = 70 /* ConstKeyword */; } } if (startPos !== undefined) { @@ -21804,20 +25835,20 @@ var ts; } else { switch (tokenKind) { - case 98: + case 98 /* VarKeyword */: return write("var "); - case 105: + case 104 /* LetKeyword */: return write("let "); - case 70: + case 70 /* ConstKeyword */: return write("const "); } } } function emitForStatement(node) { - var endPos = emitToken(82, node.pos); + var endPos = emitToken(82 /* ForKeyword */, node.pos); write(" "); - endPos = emitToken(16, endPos); - if (node.initializer && node.initializer.kind === 199) { + endPos = emitToken(16 /* OpenParenToken */, endPos); + if (node.initializer && node.initializer.kind === 199 /* VariableDeclarationList */) { var variableDeclarationList = node.initializer; var declarations = variableDeclarationList.declarations; emitStartOfVariableDeclarationList(declarations[0], endPos); @@ -21835,13 +25866,13 @@ var ts; emitEmbeddedStatement(node.statement); } function emitForInOrForOfStatement(node) { - if (languageVersion < 2 && node.kind === 188) { + if (languageVersion < 2 /* ES6 */ && node.kind === 188 /* ForOfStatement */) { return emitDownLevelForOfStatement(node); } - var endPos = emitToken(82, node.pos); + var endPos = emitToken(82 /* ForKeyword */, node.pos); write(" "); - endPos = emitToken(16, endPos); - if (node.initializer.kind === 199) { + endPos = emitToken(16 /* OpenParenToken */, endPos); + if (node.initializer.kind === 199 /* VariableDeclarationList */) { var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length >= 1) { var decl = variableDeclarationList.declarations[0]; @@ -21853,14 +25884,14 @@ var ts; else { emit(node.initializer); } - if (node.kind === 187) { + if (node.kind === 187 /* ForInStatement */) { write(" in "); } else { write(" of "); } emit(node.expression); - emitToken(17, node.expression.end); + emitToken(17 /* CloseParenToken */, node.expression.end); emitEmbeddedStatement(node.statement); } function emitDownLevelForOfStatement(node) { @@ -21884,18 +25915,30 @@ var ts; // 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); + var endPos = emitToken(82 /* ForKeyword */, node.pos); write(" "); - endPos = emitToken(16, endPos); - var rhsIsIdentifier = node.expression.kind === 65; - var counter = createTempVariable(268435456); - var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(0); + endPos = emitToken(16 /* OpenParenToken */, endPos); + // Do not emit the LHS let declaration yet, because it might contain destructuring. + // Do not call recordTempDeclaration because we are declaring the temps + // right here. Recording means they will be declared later. + // In the case where the user wrote an identifier as the RHS, like this: + // + // for (let v of arr) { } + // + // we don't want to emit a temporary variable for the RHS, just use it directly. + var rhsIsIdentifier = node.expression.kind === 65 /* Identifier */; + var counter = createTempVariable(268435456 /* _i */); + var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(0 /* Auto */); + // This is the let keyword for the counter and rhsReference. The let keyword for + // the LHS will be emitted inside the body. emitStart(node.expression); write("var "); + // _i = 0 emitNodeWithoutSourceMap(counter); write(" = 0"); emitEnd(node.expression); if (!rhsIsIdentifier) { + // , _a = expr write(", "); emitStart(node.expression); emitNodeWithoutSourceMap(rhsReference); @@ -21904,6 +25947,7 @@ var ts; emitEnd(node.expression); } write("; "); + // _i < _a.length; emitStart(node.initializer); emitNodeWithoutSourceMap(counter); write(" < "); @@ -21911,40 +25955,54 @@ var ts; write(".length"); emitEnd(node.initializer); write("; "); + // _i++) emitStart(node.initializer); emitNodeWithoutSourceMap(counter); write("++"); emitEnd(node.initializer); - emitToken(17, node.expression.end); + emitToken(17 /* CloseParenToken */, node.expression.end); + // Body write(" {"); writeLine(); increaseIndent(); + // Initialize LHS + // let v = _a[_i]; var rhsIterationValue = createElementAccessExpression(rhsReference, counter); emitStart(node.initializer); - if (node.initializer.kind === 199) { + if (node.initializer.kind === 199 /* VariableDeclarationList */) { write("var "); var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length > 0) { var declaration = variableDeclarationList.declarations[0]; if (ts.isBindingPattern(declaration.name)) { + // This works whether the declaration is a var, let, or const. + // It will use rhsIterationValue _a[_i] as the initializer. emitDestructuring(declaration, false, rhsIterationValue); } else { + // The following call does not include the initializer, so we have + // to emit it separately. emitNodeWithoutSourceMap(declaration); write(" = "); emitNodeWithoutSourceMap(rhsIterationValue); } } else { - emitNodeWithoutSourceMap(createTempVariable(0)); + // It's an empty declaration list. This can only happen in an error case, if the user wrote + // for (let of []) {} + emitNodeWithoutSourceMap(createTempVariable(0 /* Auto */)); write(" = "); emitNodeWithoutSourceMap(rhsIterationValue); } } else { - var assignmentExpression = createBinaryExpression(node.initializer, 53, rhsIterationValue, false); - if (node.initializer.kind === 153 || node.initializer.kind === 154) { - emitDestructuring(assignmentExpression, true, undefined, node); + // Initializer is an expression. Emit the expression in the body, so that it's + // evaluated on every iteration. + var assignmentExpression = createBinaryExpression(node.initializer, 53 /* EqualsToken */, rhsIterationValue, false); + if (node.initializer.kind === 153 /* ArrayLiteralExpression */ || node.initializer.kind === 154 /* ObjectLiteralExpression */) { + // This is a destructuring pattern, so call emitDestructuring instead of emit. Calling emit will not work, because it will cause + // the BinaryExpression to be passed in instead of the expression statement, which will cause emitDestructuring to crash. + emitDestructuring(assignmentExpression, true, undefined); } else { emitNodeWithoutSourceMap(assignmentExpression); @@ -21952,7 +26010,7 @@ var ts; } emitEnd(node.initializer); write(";"); - if (node.statement.kind === 179) { + if (node.statement.kind === 179 /* Block */) { emitLines(node.statement.statements); } else { @@ -21964,12 +26022,12 @@ var ts; write("}"); } function emitBreakOrContinueStatement(node) { - emitToken(node.kind === 190 ? 66 : 71, node.pos); + emitToken(node.kind === 190 /* BreakStatement */ ? 66 /* BreakKeyword */ : 71 /* ContinueKeyword */, node.pos); emitOptional(" ", node.label); write(";"); } function emitReturnStatement(node) { - emitToken(90, node.pos); + emitToken(90 /* ReturnKeyword */, node.pos); emitOptional(" ", node.expression); write(";"); } @@ -21980,21 +26038,21 @@ var ts; emitEmbeddedStatement(node.statement); } function emitSwitchStatement(node) { - var endPos = emitToken(92, node.pos); + var endPos = emitToken(92 /* SwitchKeyword */, node.pos); write(" "); - emitToken(16, endPos); + emitToken(16 /* OpenParenToken */, endPos); emit(node.expression); - endPos = emitToken(17, node.expression.end); + endPos = emitToken(17 /* CloseParenToken */, node.expression.end); write(" "); emitCaseBlock(node.caseBlock, endPos); } function emitCaseBlock(node, startPos) { - emitToken(14, startPos); + emitToken(14 /* OpenBraceToken */, startPos); increaseIndent(); emitLines(node.clauses); decreaseIndent(); writeLine(); - emitToken(15, node.clauses.end); + emitToken(15 /* CloseBraceToken */, node.clauses.end); } function nodeStartPositionsAreOnSameLine(node1, node2) { return ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node1.pos)) === @@ -22009,7 +26067,7 @@ var ts; ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 220) { + if (node.kind === 220 /* CaseClause */) { write("case "); emit(node.expression); write(":"); @@ -22044,16 +26102,16 @@ var ts; } function emitCatchClause(node) { writeLine(); - var endPos = emitToken(68, node.pos); + var endPos = emitToken(68 /* CatchKeyword */, node.pos); write(" "); - emitToken(16, endPos); + emitToken(16 /* OpenParenToken */, endPos); emit(node.variableDeclaration); - emitToken(17, node.variableDeclaration ? node.variableDeclaration.end : endPos); + emitToken(17 /* CloseParenToken */, node.variableDeclaration ? node.variableDeclaration.end : endPos); write(" "); emitBlock(node.block); } function emitDebuggerStatement(node) { - emitToken(72, node.pos); + emitToken(72 /* DebuggerKeyword */, node.pos); write(";"); } function emitLabelledStatement(node) { @@ -22064,7 +26122,7 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 205); + } while (node && node.kind !== 205 /* ModuleDeclaration */); return node; } function emitContainingModuleName(node) { @@ -22073,13 +26131,13 @@ var ts; } function emitModuleMemberName(node) { emitStart(node.name); - if (ts.getCombinedNodeFlags(node) & 1) { + if (ts.getCombinedNodeFlags(node) & 1 /* Export */) { var container = getContainingModule(node); if (container) { write(getGeneratedNameForNode(container)); write("."); } - else if (languageVersion < 2) { + else if (languageVersion < 2 /* ES6 */) { write("exports."); } } @@ -22087,18 +26145,23 @@ var ts; emitEnd(node.name); } function createVoidZero() { - var zero = ts.createSynthesizedNode(7); + var zero = ts.createSynthesizedNode(7 /* NumericLiteral */); zero.text = "0"; - var result = ts.createSynthesizedNode(166); + var result = ts.createSynthesizedNode(166 /* VoidExpression */); result.expression = zero; return result; } function emitExportMemberAssignment(node) { - if (node.flags & 1) { + if (node.flags & 1 /* Export */) { writeLine(); emitStart(node); - if (node.flags & 256) { - write("exports.default"); + if (node.flags & 256 /* Default */) { + if (languageVersion === 0 /* ES3 */) { + write("exports[\"default\"]"); + } + else { + write("exports.default"); + } } else { emitModuleMemberName(node); @@ -22125,10 +26188,12 @@ var ts; } } } - function emitDestructuring(root, isAssignmentExpressionStatement, value, lowestNonSynthesizedAncestor) { + function emitDestructuring(root, isAssignmentExpressionStatement, value) { var emitCount = 0; - var isDeclaration = (root.kind === 198 && !(ts.getCombinedNodeFlags(root) & 1)) || root.kind === 129; - if (root.kind === 169) { + // An exported declaration is actually emitted as an assignment (to a property on the module object), so + // temporary variables in an exported declaration need to have real declarations elsewhere + var isDeclaration = (root.kind === 198 /* VariableDeclaration */ && !(ts.getCombinedNodeFlags(root) & 1 /* Export */)) || root.kind === 129 /* Parameter */; + if (root.kind === 169 /* BinaryExpression */) { emitAssignmentExpression(root); } else { @@ -22140,7 +26205,7 @@ var ts; write(", "); } renameNonTopLevelLetAndConst(name); - if (name.parent && (name.parent.kind === 198 || name.parent.kind === 152)) { + if (name.parent && (name.parent.kind === 198 /* VariableDeclaration */ || name.parent.kind === 152 /* BindingElement */)) { emitModuleMemberName(name.parent); } else { @@ -22150,8 +26215,8 @@ var ts; emit(value); } function ensureIdentifier(expr) { - if (expr.kind !== 65) { - var identifier = createTempVariable(0); + if (expr.kind !== 65 /* Identifier */) { + var identifier = createTempVariable(0 /* Auto */); if (!isDeclaration) { recordTempDeclaration(identifier); } @@ -22161,90 +26226,89 @@ var ts; return expr; } function createDefaultValueCheck(value, defaultValue) { + // The value expression will be evaluated twice, so for anything but a simple identifier + // we need to generate a temporary variable value = ensureIdentifier(value); - var equals = ts.createSynthesizedNode(169); + // Return the expression 'value === void 0 ? defaultValue : value' + var equals = ts.createSynthesizedNode(169 /* BinaryExpression */); equals.left = value; - equals.operatorToken = ts.createSynthesizedNode(30); + equals.operatorToken = ts.createSynthesizedNode(30 /* EqualsEqualsEqualsToken */); equals.right = createVoidZero(); return createConditionalExpression(equals, defaultValue, value); } function createConditionalExpression(condition, whenTrue, whenFalse) { - var cond = ts.createSynthesizedNode(170); + var cond = ts.createSynthesizedNode(170 /* ConditionalExpression */); cond.condition = condition; - cond.questionToken = ts.createSynthesizedNode(50); + cond.questionToken = ts.createSynthesizedNode(50 /* QuestionToken */); cond.whenTrue = whenTrue; - cond.colonToken = ts.createSynthesizedNode(51); + cond.colonToken = ts.createSynthesizedNode(51 /* ColonToken */); cond.whenFalse = whenFalse; return cond; } function createNumericLiteral(value) { - var node = ts.createSynthesizedNode(7); + var node = ts.createSynthesizedNode(7 /* NumericLiteral */); node.text = "" + value; return node; } - function parenthesizeForAccess(expr) { - if (expr.kind === 65 || expr.kind === 155 || expr.kind === 156) { - return expr; + function createPropertyAccessForDestructuringProperty(object, propName) { + if (propName.kind !== 65 /* Identifier */) { + return createElementAccessExpression(object, propName); } - var node = ts.createSynthesizedNode(161); - node.expression = expr; - return node; + return createPropertyAccessExpression(object, propName); } - function createPropertyAccess(object, propName) { - if (propName.kind !== 65) { - return createElementAccess(object, propName); - } - return createPropertyAccessExpression(parenthesizeForAccess(object), propName); - } - function createElementAccess(object, index) { - var node = ts.createSynthesizedNode(156); - node.expression = parenthesizeForAccess(object); - node.argumentExpression = index; - return node; + function createSliceCall(value, sliceIndex) { + var call = ts.createSynthesizedNode(157 /* CallExpression */); + var sliceIdentifier = ts.createSynthesizedNode(65 /* Identifier */); + sliceIdentifier.text = "slice"; + call.expression = createPropertyAccessExpression(value, sliceIdentifier); + call.arguments = ts.createSynthesizedNodeArray(); + call.arguments[0] = createNumericLiteral(sliceIndex); + return call; } function emitObjectLiteralAssignment(target, value) { var properties = target.properties; if (properties.length !== 1) { + // For anything but a single element destructuring we need to generate a temporary + // to ensure value is evaluated exactly once. value = ensureIdentifier(value); } for (var _a = 0; _a < properties.length; _a++) { var p = properties[_a]; - if (p.kind === 224 || p.kind === 225) { + if (p.kind === 224 /* PropertyAssignment */ || p.kind === 225 /* ShorthandPropertyAssignment */) { + // TODO(andersh): Computed property support var propName = (p.name); - emitDestructuringAssignment(p.initializer || propName, createPropertyAccess(value, propName)); + emitDestructuringAssignment(p.initializer || propName, createPropertyAccessForDestructuringProperty(value, propName)); } } } function emitArrayLiteralAssignment(target, value) { var elements = target.elements; if (elements.length !== 1) { + // For anything but a single element destructuring we need to generate a temporary + // to ensure value is evaluated exactly once. value = ensureIdentifier(value); } for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 175) { - if (e.kind !== 173) { - emitDestructuringAssignment(e, createElementAccess(value, createNumericLiteral(i))); + if (e.kind !== 175 /* OmittedExpression */) { + if (e.kind !== 173 /* SpreadElementExpression */) { + emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i))); } - else { - if (i === elements.length - 1) { - value = ensureIdentifier(value); - emitAssignment(e.expression, value); - write(".slice(" + i + ")"); - } + else if (i === elements.length - 1) { + emitDestructuringAssignment(e.expression, createSliceCall(value, i)); } } } } function emitDestructuringAssignment(target, value) { - if (target.kind === 169 && target.operatorToken.kind === 53) { + if (target.kind === 169 /* BinaryExpression */ && target.operatorToken.kind === 53 /* EqualsToken */) { value = createDefaultValueCheck(value, target.right); target = target.left; } - if (target.kind === 154) { + if (target.kind === 154 /* ObjectLiteralExpression */) { emitObjectLiteralAssignment(target, value); } - else if (target.kind === 153) { + else if (target.kind === 153 /* ArrayLiteralExpression */) { emitArrayLiteralAssignment(target, value); } else { @@ -22258,47 +26322,49 @@ var ts; emitDestructuringAssignment(target, value); } else { - if (root.parent.kind !== 161) { + if (root.parent.kind !== 161 /* ParenthesizedExpression */) { write("("); } value = ensureIdentifier(value); emitDestructuringAssignment(target, value); write(", "); emit(value); - if (root.parent.kind !== 161) { + if (root.parent.kind !== 161 /* ParenthesizedExpression */) { write(")"); } } } function emitBindingElement(target, value) { if (target.initializer) { + // Combine value and initializer value = value ? createDefaultValueCheck(value, target.initializer) : target.initializer; } else if (!value) { + // Use 'void 0' in absence of value and initializer value = createVoidZero(); } if (ts.isBindingPattern(target.name)) { var pattern = target.name; var elements = pattern.elements; if (elements.length !== 1) { + // For anything but a single element destructuring we need to generate a temporary + // to ensure value is evaluated exactly once. value = ensureIdentifier(value); } for (var i = 0; i < elements.length; i++) { var element = elements[i]; - if (pattern.kind === 150) { + if (pattern.kind === 150 /* ObjectBindingPattern */) { + // Rewrite element to a declaration with an initializer that fetches property var propName = element.propertyName || element.name; - emitBindingElement(element, createPropertyAccess(value, propName)); + emitBindingElement(element, createPropertyAccessForDestructuringProperty(value, propName)); } - else if (element.kind !== 175) { + else if (element.kind !== 175 /* OmittedExpression */) { if (!element.dotDotDotToken) { - emitBindingElement(element, createElementAccess(value, createNumericLiteral(i))); + // Rewrite element to a declaration that accesses array element at index i + emitBindingElement(element, createElementAccessExpression(value, createNumericLiteral(i))); } - else { - if (i === elements.length - 1) { - value = ensureIdentifier(value); - emitAssignment(element.name, value); - write(".slice(" + i + ")"); - } + else if (i === elements.length - 1) { + emitBindingElement(element, createSliceCall(value, i)); } } } @@ -22310,7 +26376,7 @@ var ts; } function emitVariableDeclaration(node) { if (ts.isBindingPattern(node.name)) { - if (languageVersion < 2) { + if (languageVersion < 2 /* ES6 */) { emitDestructuring(node, false); } else { @@ -22322,12 +26388,19 @@ var ts; renameNonTopLevelLetAndConst(node.name); emitModuleMemberName(node); var initializer = node.initializer; - if (!initializer && languageVersion < 2) { - var isUninitializedLet = (resolver.getNodeCheckFlags(node) & 256) && - (getCombinedFlagsForIdentifier(node.name) & 4096); + if (!initializer && languageVersion < 2 /* ES6 */) { + // downlevel emit for non-initialized let bindings defined in loops + // for (...) { let x; } + // should be + // for (...) { var = void 0; } + // this is necessary to preserve ES6 semantic in scenarios like + // for (...) { let x; console.log(x); x = 1 } // assignment on one iteration should not affect other iterations + var isUninitializedLet = (resolver.getNodeCheckFlags(node) & 256 /* BlockScopedBindingInLoop */) && + (getCombinedFlagsForIdentifier(node.name) & 4096 /* Let */); + // NOTE: default initialization should not be added to let bindings in for-in\for-of statements if (isUninitializedLet && - node.parent.parent.kind !== 187 && - node.parent.parent.kind !== 188) { + node.parent.parent.kind !== 187 /* ForInStatement */ && + node.parent.parent.kind !== 188 /* ForOfStatement */) { initializer = createVoidZero(); } } @@ -22335,11 +26408,11 @@ var ts; } } function emitExportVariableAssignments(node) { - if (node.kind === 175) { + if (node.kind === 175 /* OmittedExpression */) { return; } var name = node.name; - if (name.kind === 65) { + if (name.kind === 65 /* Identifier */) { emitExportMemberAssignments(name); } else if (ts.isBindingPattern(name)) { @@ -22347,33 +26420,41 @@ var ts; } } function getCombinedFlagsForIdentifier(node) { - if (!node.parent || (node.parent.kind !== 198 && node.parent.kind !== 152)) { + if (!node.parent || (node.parent.kind !== 198 /* VariableDeclaration */ && node.parent.kind !== 152 /* BindingElement */)) { return 0; } return ts.getCombinedNodeFlags(node.parent); } function renameNonTopLevelLetAndConst(node) { - if (languageVersion >= 2 || + // do not rename if + // - language version is ES6+ + // - node is synthesized + // - node is not identifier (can happen when tree is malformed) + // - node is definitely not name of variable declaration. + // it still can be part of parameter declaration, this check will be done next + if (languageVersion >= 2 /* ES6 */ || ts.nodeIsSynthesized(node) || - node.kind !== 65 || - (node.parent.kind !== 198 && node.parent.kind !== 152)) { + node.kind !== 65 /* Identifier */ || + (node.parent.kind !== 198 /* VariableDeclaration */ && node.parent.kind !== 152 /* BindingElement */)) { return; } var combinedFlags = getCombinedFlagsForIdentifier(node); - if (((combinedFlags & 12288) === 0) || combinedFlags & 1) { + if (((combinedFlags & 12288 /* BlockScoped */) === 0) || combinedFlags & 1 /* Export */) { + // do not rename exported or non-block scoped variables 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); + // here it is known that node is a block scoped variable + var list = ts.getAncestor(node, 199 /* VariableDeclarationList */); + if (list.parent.kind === 180 /* VariableStatement */) { + var isSourceFileLevelBinding = list.parent.parent.kind === 227 /* SourceFile */; + var isModuleLevelBinding = list.parent.parent.kind === 206 /* ModuleBlock */; + var isFunctionLevelBinding = list.parent.parent.kind === 179 /* Block */ && ts.isFunctionLike(list.parent.parent.parent); if (isSourceFileLevelBinding || isModuleLevelBinding || isFunctionLevelBinding) { return; } } var blockScopeContainer = ts.getEnclosingBlockScopeContainer(node); - var parent = blockScopeContainer.kind === 227 + var parent = blockScopeContainer.kind === 227 /* SourceFile */ ? blockScopeContainer : blockScopeContainer.parent; if (resolver.resolvesToSomeValue(parent, node.text)) { @@ -22386,33 +26467,34 @@ var ts; } } function isES6ExportedDeclaration(node) { - return !!(node.flags & 1) && - languageVersion >= 2 && - node.parent.kind === 227; + return !!(node.flags & 1 /* Export */) && + languageVersion >= 2 /* ES6 */ && + node.parent.kind === 227 /* SourceFile */; } function emitVariableStatement(node) { - if (!(node.flags & 1)) { + if (!(node.flags & 1 /* Export */)) { emitStartOfVariableDeclarationList(node.declarationList); } else if (isES6ExportedDeclaration(node)) { + // Exported ES6 module member write("export "); emitStartOfVariableDeclarationList(node.declarationList); } emitCommaList(node.declarationList.declarations); write(";"); - if (languageVersion < 2 && node.parent === currentSourceFile) { + if (languageVersion < 2 /* ES6 */ && node.parent === currentSourceFile) { ts.forEach(node.declarationList.declarations, emitExportVariableAssignments); } } function emitParameter(node) { - if (languageVersion < 2) { + if (languageVersion < 2 /* ES6 */) { if (ts.isBindingPattern(node.name)) { - var name_16 = createTempVariable(0); + var name_19 = createTempVariable(0 /* Auto */); if (!tempParameters) { tempParameters = []; } - tempParameters.push(name_16); - emit(name_16); + tempParameters.push(name_19); + emit(name_19); } else { emit(node.name); @@ -22427,9 +26509,14 @@ var ts; } } function emitDefaultValueAssignments(node) { - if (languageVersion < 2) { + if (languageVersion < 2 /* ES6 */) { var tempIndex = 0; ts.forEach(node.parameters, function (p) { + // A rest parameter cannot have a binding pattern or an initializer, + // so let's just ignore it. + if (p.dotDotDotToken) { + return; + } if (ts.isBindingPattern(p.name)) { writeLine(); write("var "); @@ -22456,10 +26543,14 @@ var ts; } } function emitRestParameter(node) { - if (languageVersion < 2 && ts.hasRestParameters(node)) { + if (languageVersion < 2 /* ES6 */ && ts.hasRestParameters(node)) { var restIndex = node.parameters.length - 1; var restParam = node.parameters[restIndex]; - var tempName = createTempVariable(268435456).text; + // A rest parameter cannot have a binding pattern, so let's just ignore it if it does. + if (ts.isBindingPattern(restParam.name)) { + return; + } + var tempName = createTempVariable(268435456 /* _i */).text; writeLine(); emitLeadingComments(restParam); emitStart(restParam); @@ -22494,12 +26585,12 @@ var ts; } } function emitAccessor(node) { - write(node.kind === 136 ? "get " : "set "); + write(node.kind === 136 /* GetAccessor */ ? "get " : "set "); emit(node.name, false); emitSignatureAndBody(node); } function shouldEmitAsArrowFunction(node) { - return node.kind === 163 && languageVersion >= 2; + return node.kind === 163 /* ArrowFunction */ && languageVersion >= 2 /* ES6 */; } function emitDeclarationName(node) { if (node.name) { @@ -22510,42 +26601,51 @@ var ts; } } function shouldEmitFunctionName(node) { - if (node.kind === 162) { + if (node.kind === 162 /* FunctionExpression */) { + // Emit name if one is present return !!node.name; } - if (node.kind === 200) { - return !!node.name || languageVersion < 2; + if (node.kind === 200 /* FunctionDeclaration */) { + // Emit name if one is present, or emit generated name in down-level case (for export default case) + return !!node.name || languageVersion < 2 /* ES6 */; } } function emitFunctionDeclaration(node) { if (ts.nodeIsMissing(node.body)) { return emitOnlyPinnedOrTripleSlashComments(node); } - if (node.kind !== 134 && node.kind !== 133) { + if (node.kind !== 134 /* MethodDeclaration */ && node.kind !== 133 /* MethodSignature */) { + // Methods will emit the comments as part of emitting method declaration emitLeadingComments(node); } + // For targeting below es6, emit functions-like declaration including arrow function using function keyword. + // When targeting ES6, emit arrow function natively in ES6 by omitting function keyword and using fat arrow instead if (!shouldEmitAsArrowFunction(node)) { if (isES6ExportedDeclaration(node)) { write("export "); - if (node.flags & 256) { + if (node.flags & 256 /* Default */) { write("default "); } } - write("function "); + write("function"); + if (languageVersion >= 2 /* ES6 */ && node.asteriskToken) { + write("*"); + } + write(" "); } if (shouldEmitFunctionName(node)) { emitDeclarationName(node); } emitSignatureAndBody(node); - if (languageVersion < 2 && node.kind === 200 && node.parent === currentSourceFile && node.name) { + if (languageVersion < 2 /* ES6 */ && node.kind === 200 /* FunctionDeclaration */ && node.parent === currentSourceFile && node.name) { emitExportMemberAssignments(node.name); } - if (node.kind !== 134 && node.kind !== 133) { + if (node.kind !== 134 /* MethodDeclaration */ && node.kind !== 133 /* MethodSignature */) { emitTrailingComments(node); } } function emitCaptureThisForNodeIfNecessary(node) { - if (resolver.getNodeCheckFlags(node) & 4) { + if (resolver.getNodeCheckFlags(node) & 4 /* CaptureThis */) { writeLine(); emitStart(node); write("var _this = this;"); @@ -22557,13 +26657,14 @@ var ts; write("("); if (node) { var parameters = node.parameters; - var omitCount = languageVersion < 2 && ts.hasRestParameters(node) ? 1 : 0; + var omitCount = languageVersion < 2 /* ES6 */ && ts.hasRestParameters(node) ? 1 : 0; emitList(parameters, 0, parameters.length - omitCount, false, false); } write(")"); decreaseIndent(); } function emitSignatureParametersForArrow(node) { + // Check whether the parameter list needs parentheses and preserve no-parenthesis if (node.parameters.length === 1 && node.pos === node.parameters[0].pos) { emit(node.parameters[0]); return; @@ -22577,6 +26678,7 @@ var ts; tempFlags = 0; tempVariables = undefined; tempParameters = undefined; + // When targeting ES6, emit arrow function natively in ES6 if (shouldEmitAsArrowFunction(node)) { emitSignatureParametersForArrow(node); write(" =>"); @@ -22585,9 +26687,11 @@ var ts; emitSignatureParameters(node); } if (!node.body) { + // There can be no body when there are parse errors. Just emit an empty block + // in that case. write(" { }"); } - else if (node.body.kind === 179) { + else if (node.body.kind === 179 /* Block */) { emitBlockFunctionBody(node, node.body); } else { @@ -22600,22 +26704,28 @@ var ts; tempVariables = saveTempVariables; tempParameters = saveTempParameters; } + // Returns true if any preamble code was emitted. function emitFunctionBodyPreamble(node) { emitCaptureThisForNodeIfNecessary(node); emitDefaultValueAssignments(node); emitRestParameter(node); } function emitExpressionFunctionBody(node, body) { - if (languageVersion < 2) { + if (languageVersion < 2 /* ES6 */) { emitDownLevelExpressionFunctionBody(node, body); return; } + // For es6 and higher we can emit the expression as is. However, in the case + // where the expression might end up looking like a block when emitted, we'll + // also wrap it in parentheses first. For example if you have: a => {} + // then we need to generate: a => ({}) write(" "); + // Unwrap all type assertions. var current = body; - while (current.kind === 160) { + while (current.kind === 160 /* TypeAssertionExpression */) { current = current.expression; } - emitParenthesizedIf(body, current.kind === 154); + emitParenthesizedIf(body, current.kind === 154 /* ObjectLiteralExpression */); } function emitDownLevelExpressionFunctionBody(node, body) { write(" {"); @@ -22626,6 +26736,8 @@ var ts; emitFunctionBodyPreamble(node); var preambleEmitted = writer.getTextPos() !== outPos; decreaseIndent(); + // If we didn't have to emit any preamble code, then attempt to keep the arrow + // function on one line. if (!preambleEmitted && nodeStartPositionsAreOnSameLine(node, body)) { write(" "); emitStart(body); @@ -22659,6 +26771,8 @@ var ts; var initialTextPos = writer.getTextPos(); increaseIndent(); emitDetachedComments(body.statements); + // Emit all the directive prologues (like "use strict"). These have to come before + // any other preamble code we write (like parameter initializers). var startIndex = emitDirectivePrologues(body.statements, true); emitFunctionBodyPreamble(node); decreaseIndent(); @@ -22681,17 +26795,17 @@ var ts; emitLeadingCommentsOfPosition(body.statements.end); decreaseIndent(); } - emitToken(15, body.statements.end); + emitToken(15 /* CloseBraceToken */, body.statements.end); scopeEmitEnd(); } function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 182) { + if (statement && statement.kind === 182 /* ExpressionStatement */) { var expr = statement.expression; - if (expr && expr.kind === 157) { + if (expr && expr.kind === 157 /* CallExpression */) { var func = expr.expression; - if (func && func.kind === 91) { + if (func && func.kind === 91 /* SuperKeyword */) { return statement; } } @@ -22700,7 +26814,7 @@ var ts; } function emitParameterPropertyAssignments(node) { ts.forEach(node.parameters, function (param) { - if (param.flags & 112) { + if (param.flags & 112 /* AccessibilityModifier */) { writeLine(); emitStart(param); emitStart(param.name); @@ -22715,12 +26829,13 @@ var ts; }); } function emitMemberAccessForPropertyName(memberName) { - if (memberName.kind === 8 || memberName.kind === 7) { + // TODO: (jfreeman,drosen): comment on why this is emitNodeWithoutSourceMap instead of emit here. + if (memberName.kind === 8 /* StringLiteral */ || memberName.kind === 7 /* NumericLiteral */) { write("["); emitNodeWithoutSourceMap(memberName); write("]"); } - else if (memberName.kind === 127) { + else if (memberName.kind === 127 /* ComputedPropertyName */) { emitComputedPropertyName(memberName); } else { @@ -22728,36 +26843,55 @@ var ts; emitNodeWithoutSourceMap(memberName); } } - function emitMemberAssignments(node, staticFlag) { - ts.forEach(node.members, function (member) { - if (member.kind === 132 && (member.flags & 128) === 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, static) { + var properties = []; + for (var _a = 0, _b = node.members; _a < _b.length; _a++) { + var member = _b[_a]; + if (member.kind === 132 /* PropertyDeclaration */ && static === ((member.flags & 128 /* Static */) !== 0) && member.initializer) { + properties.push(member); } - }); + } + return properties; + } + function emitPropertyDeclarations(node, properties) { + for (var _a = 0; _a < properties.length; _a++) { + var property = properties[_a]; + emitPropertyDeclaration(node, property); + } + } + function emitPropertyDeclaration(node, property, receiver, isExpression) { + writeLine(); + emitLeadingComments(property); + emitStart(property); + emitStart(property.name); + if (receiver) { + emit(receiver); + } + else { + if (property.flags & 128 /* 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) { ts.forEach(node.members, function (member) { - if (member.kind === 178) { + if (member.kind === 178 /* SemicolonClassElement */) { writeLine(); write(";"); } - else if (member.kind === 134 || node.kind === 133) { + else if (member.kind === 134 /* MethodDeclaration */ || node.kind === 133 /* MethodSignature */) { if (!member.body) { return emitOnlyPinnedOrTripleSlashComments(member); } @@ -22776,7 +26910,7 @@ var ts; write(";"); emitTrailingComments(member); } - else if (member.kind === 136 || member.kind === 137) { + else if (member.kind === 136 /* GetAccessor */ || member.kind === 137 /* SetAccessor */) { var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { writeLine(); @@ -22826,30 +26960,33 @@ var ts; function emitMemberFunctionsForES6AndHigher(node) { for (var _a = 0, _b = node.members; _a < _b.length; _a++) { var member = _b[_a]; - if ((member.kind === 134 || node.kind === 133) && !member.body) { + if ((member.kind === 134 /* MethodDeclaration */ || node.kind === 133 /* MethodSignature */) && !member.body) { emitOnlyPinnedOrTripleSlashComments(member); } - else if (member.kind === 134 || - member.kind === 136 || - member.kind === 137) { + else if (member.kind === 134 /* MethodDeclaration */ || + member.kind === 136 /* GetAccessor */ || + member.kind === 137 /* SetAccessor */) { writeLine(); emitLeadingComments(member); emitStart(member); - if (member.flags & 128) { + if (member.flags & 128 /* Static */) { write("static "); } - if (member.kind === 136) { + if (member.kind === 136 /* GetAccessor */) { write("get "); } - else if (member.kind === 137) { + else if (member.kind === 137 /* SetAccessor */) { write("set "); } + if (member.asteriskToken) { + write("*"); + } emit(member.name); emitSignatureAndBody(member); emitEnd(member); emitTrailingComments(member); } - else if (member.kind === 178) { + else if (member.kind === 178 /* SemicolonClassElement */) { writeLine(); write(";"); } @@ -22862,24 +26999,37 @@ var ts; tempFlags = 0; tempVariables = undefined; tempParameters = undefined; + emitConstructorWorker(node, baseTypeElement); + tempFlags = saveTempFlags; + tempVariables = saveTempVariables; + tempParameters = saveTempParameters; + } + function emitConstructorWorker(node, baseTypeElement) { + // 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 var hasInstancePropertyWithInitializer = false; + // Emit the constructor overload pinned comments ts.forEach(node.members, function (member) { - if (member.kind === 135 && !member.body) { + if (member.kind === 135 /* Constructor */ && !member.body) { emitOnlyPinnedOrTripleSlashComments(member); } - if (member.kind === 132 && member.initializer && (member.flags & 128) === 0) { + // Check if there is any non-static property assignment + if (member.kind === 132 /* PropertyDeclaration */ && member.initializer && (member.flags & 128 /* Static */) === 0) { hasInstancePropertyWithInitializer = true; } }); var ctor = ts.getFirstConstructorWithBody(node); - if (languageVersion >= 2 && !ctor && !hasInstancePropertyWithInitializer) { + // For target ES6 and above, if there is no user-defined constructor and there is no property assignment + // do not emit constructor in class declaration. + if (languageVersion >= 2 /* ES6 */ && !ctor && !hasInstancePropertyWithInitializer) { return; } if (ctor) { emitLeadingComments(ctor); } emitStart(ctor || node); - if (languageVersion < 2) { + if (languageVersion < 2 /* ES6 */) { write("function "); emitDeclarationName(node); emitSignatureParameters(ctor); @@ -22890,6 +27040,12 @@ var ts; emitSignatureParameters(ctor); } else { + // Based on EcmaScript6 section 14.5.14: Runtime Semantics: ClassDefinitionEvaluation. + // If constructor is empty, then, + // If ClassHeritageopt is present, then + // 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 (baseTypeElement) { write("(...args)"); } @@ -22921,7 +27077,7 @@ var ts; if (baseTypeElement) { writeLine(); emitStart(baseTypeElement); - if (languageVersion < 2) { + if (languageVersion < 2 /* ES6 */) { write("_super.apply(this, arguments);"); } else { @@ -22930,7 +27086,7 @@ var ts; emitEnd(baseTypeElement); } } - emitMemberAssignments(node, 0); + emitPropertyDeclarations(node, getInitializedProperties(node, false)); if (ctor) { var statements = ctor.body.statements; if (superCall) { @@ -22944,15 +27100,12 @@ var ts; emitLeadingCommentsOfPosition(ctor.body.statements.end); } decreaseIndent(); - emitToken(15, ctor ? ctor.body.statements.end : node.members.end); + emitToken(15 /* CloseBraceToken */, 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); @@ -22961,7 +27114,7 @@ var ts; return emitClassLikeDeclaration(node); } function emitClassLikeDeclaration(node) { - if (languageVersion < 2) { + if (languageVersion < 2 /* ES6 */) { emitClassLikeDeclarationBelowES6(node); } else { @@ -22970,9 +27123,61 @@ var ts; } function emitClassLikeDeclarationForES6AndHigher(node) { var thisNodeIsDecorated = ts.nodeIsDecorated(node); - if (node.kind === 201) { + if (node.kind === 201 /* ClassDeclaration */) { if (thisNodeIsDecorated) { - if (isES6ExportedDeclaration(node) && !(node.flags & 256)) { + // 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 & 256 /* Default */)) { write("export "); } write("let "); @@ -22981,13 +27186,35 @@ var ts; } else if (isES6ExportedDeclaration(node)) { write("export "); - if (node.flags & 256) { + if (node.flags & 256 /* 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. + var staticProperties = getInitializedProperties(node, true); + var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 174 /* ClassExpression */; + var tempVariable; + if (isClassExpressionWithStaticProperties) { + tempVariable = createAndRecordTempVariable(0 /* Auto */); + write("("); + increaseIndent(); + emit(tempVariable); + write(" = "); + } write("class"); - if ((node.name || !(node.flags & 256)) && !thisNodeIsDecorated) { + // check if this is an "export default class" as it may not have a name. Do not emit the name if the class is decorated. + if ((node.name || !(node.flags & 256 /* Default */)) && !thisNodeIsDecorated) { write(" "); emitDeclarationName(node); } @@ -23004,8 +27231,15 @@ var ts; emitMemberFunctionsForES6AndHigher(node); decreaseIndent(); writeLine(); - emitToken(15, node.members.end); + emitToken(15 /* CloseBraceToken */, node.members.end); scopeEmitEnd(); + // For a decorated class, we need to assign its name (if it has one). This is because we emit + // the class as a class expression to avoid the double-binding of the identifier: + // + // let C = class { + // } + // Object.defineProperty(C, "name", { value: "C", configurable: true }); + // if (thisNodeIsDecorated) { write(";"); if (node.name) { @@ -23018,10 +27252,32 @@ var ts; writeLine(); } } - writeLine(); - emitMemberAssignments(node, 128); - emitDecoratorsOfClass(node); - if (!isES6ExportedDeclaration(node) && (node.flags & 1)) { + // Emit static property assignment. Because classDeclaration is lexically evaluated, + // it is safe to emit static property assignment after classDeclaration + // 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. + if (isClassExpressionWithStaticProperties) { + for (var _a = 0; _a < staticProperties.length; _a++) { + var property = staticProperties[_a]; + write(","); + writeLine(); + emitPropertyDeclaration(node, property, tempVariable, 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 + if (!isES6ExportedDeclaration(node) && (node.flags & 1 /* Export */)) { writeLine(); emitStart(node); emitModuleMemberName(node); @@ -23030,7 +27286,8 @@ var ts; emitEnd(node); write(";"); } - else if (isES6ExportedDeclaration(node) && (node.flags & 256) && thisNodeIsDecorated) { + else if (isES6ExportedDeclaration(node) && (node.flags & 256 /* Default */) && thisNodeIsDecorated) { + // if this is a top level default export of decorated class, write the export after the declaration. writeLine(); write("export default "); emitDeclarationName(node); @@ -23038,7 +27295,7 @@ var ts; } } function emitClassLikeDeclarationBelowES6(node) { - if (node.kind === 201) { + if (node.kind === 201 /* ClassDeclaration */) { write("var "); emitDeclarationName(node); write(" = "); @@ -23070,11 +27327,11 @@ var ts; writeLine(); emitConstructor(node, baseTypeNode); emitMemberFunctionsForES5AndLower(node); - emitMemberAssignments(node, 128); + emitPropertyDeclarations(node, getInitializedProperties(node, true)); writeLine(); emitDecoratorsOfClass(node); writeLine(); - emitToken(15, node.members.end, function () { + emitToken(15 /* CloseBraceToken */, node.members.end, function () { write("return "); emitDeclarationName(node); }); @@ -23086,7 +27343,7 @@ var ts; computedPropertyNamesToGeneratedNames = saveComputedPropertyNamesToGeneratedNames; decreaseIndent(); writeLine(); - emitToken(15, node.members.end); + emitToken(15 /* CloseBraceToken */, node.members.end); scopeEmitEnd(); emitStart(node); write(")("); @@ -23094,98 +27351,171 @@ var ts; emit(baseTypeNode.expression); } write(")"); - if (node.kind === 201) { + if (node.kind === 201 /* ClassDeclaration */) { write(";"); } emitEnd(node); - if (node.kind === 201) { + if (node.kind === 201 /* ClassDeclaration */) { emitExportMemberAssignment(node); } - if (languageVersion < 2 && node.parent === currentSourceFile && node.name) { + if (languageVersion < 2 /* ES6 */ && node.parent === currentSourceFile && node.name) { emitExportMemberAssignments(node.name); } } function emitClassMemberPrefix(node, member) { emitDeclarationName(node); - if (!(member.flags & 128)) { + if (!(member.flags & 128 /* Static */)) { write(".prototype"); } } function emitDecoratorsOfClass(node) { emitDecoratorsOfMembers(node, 0); - emitDecoratorsOfMembers(node, 128); + emitDecoratorsOfMembers(node, 128 /* Static */); emitDecoratorsOfConstructor(node); } function emitDecoratorsOfConstructor(node) { + var decorators = node.decorators; var constructor = ts.getFirstConstructorWithBody(node); - if (constructor) { - emitDecoratorsOfParameters(node, constructor); - } - if (!ts.nodeIsDecorated(node)) { + var hasDecoratedParameters = constructor && ts.forEach(constructor.parameters, ts.nodeIsDecorated); + // skip decoration of the constructor if neither it nor its parameters are decorated + if (!decorators && !hasDecoratedParameters) { return; } + // Emit the call to __decorate. Given the class: + // + // @dec + // class C { + // } + // + // The emit for the class is: + // + // C = __decorate([dec], C); + // writeLine(); emitStart(node); emitDeclarationName(node); - write(" = "); - emitDecorateStart(node.decorators); + write(" = __decorate(["); + increaseIndent(); + writeLine(); + var decoratorCount = decorators ? decorators.length : 0; + var argumentsWritten = emitList(decorators, 0, decoratorCount, true, false, false, true, function (decorator) { + emitStart(decorator); + emit(decorator.expression); + emitEnd(decorator); + }); + argumentsWritten += emitDecoratorsOfParameters(constructor, argumentsWritten > 0); + emitSerializedTypeMetadata(node, argumentsWritten >= 0); + decreaseIndent(); + writeLine(); + write("], "); emitDeclarationName(node); write(");"); emitEnd(node); writeLine(); } function emitDecoratorsOfMembers(node, staticFlag) { - ts.forEach(node.members, function (member) { - if ((member.flags & 128) !== staticFlag) { - return; + for (var _a = 0, _b = node.members; _a < _b.length; _a++) { + var member = _b[_a]; + // only emit members in the correct group + if ((member.flags & 128 /* Static */) !== staticFlag) { + continue; } - 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; + // skip members that cannot be decorated (such as the constructor) + if (!ts.nodeCanBeDecorated(member)) { + continue; } - if (!decorators) { - return; + // skip a member if it or any of its parameters are not decorated + if (!ts.nodeOrChildIsDecorated(member)) { + continue; } + // skip an accessor declaration if it is not the first accessor + var decorators = void 0; + var functionLikeMember = void 0; + if (ts.isAccessor(member)) { + var accessors = ts.getAllAccessorDeclarations(node.members, member); + if (member !== accessors.firstAccessor) { + continue; + } + // get the decorators from the first accessor with decorators + decorators = accessors.firstAccessor.decorators; + if (!decorators && accessors.secondAccessor) { + decorators = accessors.secondAccessor.decorators; + } + // we only decorate parameters of the set accessor + functionLikeMember = accessors.setAccessor; + } + else { + decorators = member.decorators; + // we only decorate the parameters here if this is a method + if (member.kind === 134 /* MethodDeclaration */) { + functionLikeMember = member; + } + } + // Emit the call to __decorate. Given the following: + // + // class C { + // @dec method(@dec2 x) {} + // @dec get accessor() {} + // @dec prop; + // } + // + // The emit for a method is: + // + // 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"))); + // + // The emit for a property is: + // + // __decorate([ + // dec + // ], C.prototype, "prop"); + // writeLine(); emitStart(member); - if (member.kind !== 132) { + if (member.kind !== 132 /* PropertyDeclaration */) { write("Object.defineProperty("); emitStart(member.name); emitClassMemberPrefix(node, member); write(", "); emitExpressionForPropertyName(member.name); emitEnd(member.name); - write(", "); + write(","); + increaseIndent(); + writeLine(); } - emitDecorateStart(decorators); + write("__decorate(["); + increaseIndent(); + writeLine(); + var decoratorCount = decorators ? decorators.length : 0; + var argumentsWritten = emitList(decorators, 0, decoratorCount, true, false, false, true, function (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(", "); emitExpressionForPropertyName(member.name); emitEnd(member.name); - if (member.kind !== 132) { + if (member.kind !== 132 /* PropertyDeclaration */) { write(", Object.getOwnPropertyDescriptor("); emitStart(member.name); emitClassMemberPrefix(node, member); @@ -23193,51 +27523,142 @@ var ts; emitExpressionForPropertyName(member.name); emitEnd(member.name); write("))"); + decreaseIndent(); } 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 emitDecoratorsOfParameters(node, leadingComma) { + var argumentsWritten = 0; + if (node) { + var parameterIndex = 0; + for (var _a = 0, _b = node.parameters; _a < _b.length; _a++) { + var parameter = _b[_a]; + if (ts.nodeIsDecorated(parameter)) { + var decorators = parameter.decorators; + argumentsWritten += emitList(decorators, 0, decorators.length, true, false, leadingComma, true, function (decorator) { + emitStart(decorator); + write("__param(" + parameterIndex + ", "); + emit(decorator.expression); + write(")"); + emitEnd(decorator); + }); + leadingComma = true; + } + ++parameterIndex; + } + } + return argumentsWritten; + } + function shouldEmitTypeMetadata(node) { + // 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 134 /* MethodDeclaration */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 132 /* PropertyDeclaration */: + return true; + } + return false; + } + function shouldEmitReturnTypeMetadata(node) { + // 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 134 /* MethodDeclaration */: + return true; + } + return false; + } + function shouldEmitParamTypesMetadata(node) { + // 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 201 /* ClassDeclaration */: + case 134 /* MethodDeclaration */: + case 137 /* SetAccessor */: + return true; + } + return false; + } + function emitSerializedTypeMetadata(node, writeComma) { + // This method emits the serialized type metadata for a decorator target. + // The caller should have already tested whether the node has decorators. + var 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, path, index) { + switch (index) { + case 0: + return "typeof " + path[index] + " !== 'undefined' && " + path[index]; + case 1: + return serializeTypeNameSegment(location, path, index - 1) + "." + path[index]; + default: + var temp = createAndRecordTempVariable(0 /* Auto */).text; + return "(" + temp + " = " + serializeTypeNameSegment(location, path, index - 1) + ") && " + temp + "." + path[index]; + } + } + function emitSerializedType(location, name) { + if (typeof name === "string") { + write(name); + return; + } + else { + ts.Debug.assert(name.length > 0, "Invalid serialized type name"); + write("(" + serializeTypeNameSegment(location, name, name.length - 1) + ") || Object"); + } } function emitInterfaceDeclaration(node) { emitOnlyPinnedOrTripleSlashComments(node); @@ -23247,10 +27668,11 @@ var ts; return !isConstEnum || compilerOptions.preserveConstEnums || compilerOptions.separateCompilation; } function emitEnumDeclaration(node) { + // const enums are completely erased during compilation. if (!shouldEmitEnumDeclaration(node)) { return; } - if (!(node.flags & 1) || isES6ExportedDeclaration(node)) { + if (!(node.flags & 1 /* Export */) || isES6ExportedDeclaration(node)) { emitStart(node); if (isES6ExportedDeclaration(node)) { write("export "); @@ -23272,7 +27694,7 @@ var ts; emitLines(node.members); decreaseIndent(); writeLine(); - emitToken(15, node.members.end); + emitToken(15 /* CloseBraceToken */, node.members.end); scopeEmitEnd(); write(")("); emitModuleMemberName(node); @@ -23280,7 +27702,7 @@ var ts; emitModuleMemberName(node); write(" = {}));"); emitEnd(node); - if (!isES6ExportedDeclaration(node) && node.flags & 1) { + if (!isES6ExportedDeclaration(node) && node.flags & 1 /* Export */) { writeLine(); emitStart(node); write("var "); @@ -23290,7 +27712,7 @@ var ts; emitEnd(node); write(";"); } - if (languageVersion < 2 && node.parent === currentSourceFile) { + if (languageVersion < 2 /* ES6 */ && node.parent === currentSourceFile) { emitExportMemberAssignments(node.name); } } @@ -23323,7 +27745,7 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 205) { + if (moduleDeclaration.body.kind === 205 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -23331,27 +27753,33 @@ var ts; function shouldEmitModuleDeclaration(node) { return ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation); } + function isModuleMergedWithES6Class(node) { + return languageVersion === 2 /* ES6 */ && !!(resolver.getNodeCheckFlags(node) & 2048 /* LexicalModuleMergesWithClass */); + } function emitModuleDeclaration(node) { + // Emit only if this module is non-ambient. var shouldEmit = shouldEmitModuleDeclaration(node); if (!shouldEmit) { return emitOnlyPinnedOrTripleSlashComments(node); } - emitStart(node); - if (isES6ExportedDeclaration(node)) { - write("export "); + if (!isModuleMergedWithES6Class(node)) { + emitStart(node); + if (isES6ExportedDeclaration(node)) { + write("export "); + } + write("var "); + emit(node.name); + write(";"); + emitEnd(node); + writeLine(); } - write("var "); - emit(node.name); - write(";"); - emitEnd(node); - writeLine(); emitStart(node); write("(function ("); emitStart(node.name); write(getGeneratedNameForNode(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 206) { + if (node.body.kind === 206 /* ModuleBlock */) { var saveTempFlags = tempFlags; var saveTempVariables = tempVariables; tempFlags = 0; @@ -23370,11 +27798,12 @@ var ts; decreaseIndent(); writeLine(); var moduleBlock = getInnerMostModuleDeclarationFromDottedModule(node).body; - emitToken(15, moduleBlock.statements.end); + emitToken(15 /* CloseBraceToken */, moduleBlock.statements.end); scopeEmitEnd(); } write(")("); - if ((node.flags & 1) && !isES6ExportedDeclaration(node)) { + // write moduleDecl = containingModule.m only if it is not exported es6 module member + if ((node.flags & 1 /* Export */) && !isES6ExportedDeclaration(node)) { emit(node.name); write(" = "); } @@ -23383,33 +27812,33 @@ var ts; emitModuleMemberName(node); write(" = {}));"); emitEnd(node); - if (!isES6ExportedDeclaration(node) && node.name.kind === 65 && node.parent === currentSourceFile) { + if (!isES6ExportedDeclaration(node) && node.name.kind === 65 /* Identifier */ && node.parent === currentSourceFile) { emitExportMemberAssignments(node.name); } } function emitRequire(moduleName) { - if (moduleName.kind === 8) { + if (moduleName.kind === 8 /* StringLiteral */) { write("require("); emitStart(moduleName); emitLiteral(moduleName); emitEnd(moduleName); - emitToken(17, moduleName.end); + emitToken(17 /* CloseParenToken */, moduleName.end); } else { write("require()"); } } function getNamespaceDeclarationNode(node) { - if (node.kind === 208) { + if (node.kind === 208 /* ImportEqualsDeclaration */) { return node; } var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 211) { + if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 211 /* NamespaceImport */) { return importClause.namedBindings; } } function isDefaultImport(node) { - return node.kind === 209 && node.importClause && !!node.importClause.name; + return node.kind === 209 /* ImportDeclaration */ && node.importClause && !!node.importClause.name; } function emitExportImportAssignments(node) { if (ts.isAliasSymbolDeclaration(node) && resolver.isValueAliasDeclaration(node)) { @@ -23418,9 +27847,10 @@ var ts; ts.forEachChild(node, emitExportImportAssignments); } function emitImportDeclaration(node) { - if (languageVersion < 2) { + if (languageVersion < 2 /* ES6 */) { return emitExternalImportDeclaration(node); } + // ES6 import if (node.importClause) { var shouldEmitDefaultBindings = resolver.isReferencedAliasDeclaration(node.importClause); var shouldEmitNamedBindings = node.importClause.namedBindings && resolver.isReferencedAliasDeclaration(node.importClause.namedBindings, true); @@ -23436,7 +27866,7 @@ var ts; if (shouldEmitNamedBindings) { emitLeadingComments(node.importClause.namedBindings); emitStart(node.importClause.namedBindings); - if (node.importClause.namedBindings.kind === 211) { + if (node.importClause.namedBindings.kind === 211 /* NamespaceImport */) { write("* as "); emit(node.importClause.namedBindings.name); } @@ -23462,19 +27892,26 @@ var ts; } function emitExternalImportDeclaration(node) { if (ts.contains(externalImports, node)) { - var isExportedImport = node.kind === 208 && (node.flags & 1) !== 0; + var isExportedImport = node.kind === 208 /* ImportEqualsDeclaration */ && (node.flags & 1 /* Export */) !== 0; var namespaceDeclaration = getNamespaceDeclarationNode(node); - if (compilerOptions.module !== 2) { + if (compilerOptions.module !== 2 /* AMD */) { emitLeadingComments(node); emitStart(node); if (namespaceDeclaration && !isDefaultImport(node)) { + // import x = require("foo") + // import * as x from "foo" if (!isExportedImport) write("var "); emitModuleMemberName(namespaceDeclaration); write(" = "); } else { - var isNakedImport = 209 && !node.importClause; + // import "foo" + // import x from "foo" + // import { x, y } from "foo" + // import d, * as x from "foo" + // import d, { x, y } from "foo" + var isNakedImport = 209 /* ImportDeclaration */ && !node.importClause; if (!isNakedImport) { write("var "); write(getGeneratedNameForNode(node)); @@ -23483,6 +27920,7 @@ var ts; } emitRequire(ts.getExternalModuleName(node)); if (namespaceDeclaration && isDefaultImport(node)) { + // import d, * as x from "foo" write(", "); emitModuleMemberName(namespaceDeclaration); write(" = "); @@ -23501,6 +27939,7 @@ var ts; write(";"); } else if (namespaceDeclaration && isDefaultImport(node)) { + // import d, * as x from "foo" write("var "); emitModuleMemberName(namespaceDeclaration); write(" = "); @@ -23516,6 +27955,9 @@ var ts; emitExternalImportDeclaration(node); return; } + // preserve old compiler's behavior: emit 'var' for import declaration (even if we do not consider them referenced) when + // - current file is not external module + // - import declaration is top level and target is value imported by entity name if (resolver.isReferencedAliasDeclaration(node) || (!ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node))) { emitLeadingComments(node); @@ -23524,7 +27966,7 @@ var ts; write("export "); write("var "); } - else if (!(node.flags & 1)) { + else if (!(node.flags & 1 /* Export */)) { write("var "); } emitModuleMemberName(node); @@ -23537,12 +27979,13 @@ var ts; } } function emitExportDeclaration(node) { - if (languageVersion < 2) { + if (languageVersion < 2 /* ES6 */) { if (node.moduleSpecifier && (!node.exportClause || resolver.isValueAliasDeclaration(node))) { emitStart(node); var generatedName = getGeneratedNameForNode(node); if (node.exportClause) { - if (compilerOptions.module !== 2) { + // export { x, y, ... } from "foo" + if (compilerOptions.module !== 2 /* AMD */) { write("var "); write(generatedName); write(" = "); @@ -23567,9 +28010,10 @@ var ts; } } else { + // export * from "foo" writeLine(); write("__export("); - if (compilerOptions.module !== 2) { + if (compilerOptions.module !== 2 /* AMD */) { emitRequire(ts.getExternalModuleName(node)); } else { @@ -23585,6 +28029,7 @@ var ts; emitStart(node); write("export "); if (node.exportClause) { + // export { x, y, ... } write("{ "); emitExportOrImportSpecifierList(node.exportClause.elements, resolver.isValueAliasDeclaration); write(" }"); @@ -23602,7 +28047,7 @@ var ts; } } function emitExportOrImportSpecifierList(specifiers, shouldEmit) { - ts.Debug.assert(languageVersion >= 2); + ts.Debug.assert(languageVersion >= 2 /* ES6 */); var needsComma = false; for (var _a = 0; _a < specifiers.length; _a++) { var specifier = specifiers[_a]; @@ -23623,14 +28068,14 @@ var ts; } function emitExportAssignment(node) { if (!node.isExportEquals && resolver.isValueAliasDeclaration(node)) { - if (languageVersion >= 2) { + if (languageVersion >= 2 /* ES6 */) { writeLine(); emitStart(node); write("export default "); var expression = node.expression; emit(expression); - if (expression.kind !== 200 && - expression.kind !== 201) { + if (expression.kind !== 200 /* FunctionDeclaration */ && + expression.kind !== 201 /* ClassDeclaration */) { write(";"); } emitEnd(node); @@ -23639,7 +28084,12 @@ var ts; writeLine(); emitStart(node); emitContainingModuleName(node); - write(".default = "); + if (languageVersion === 0 /* ES3 */) { + write("[\"default\"] = "); + } + else { + write(".default = "); + } emit(node.expression); write(";"); emitEnd(node); @@ -23654,56 +28104,52 @@ var ts; for (var _a = 0, _b = sourceFile.statements; _a < _b.length; _a++) { var node = _b[_a]; switch (node.kind) { - case 209: + case 209 /* ImportDeclaration */: if (!node.importClause || resolver.isReferencedAliasDeclaration(node.importClause, true)) { + // import "mod" + // import x from "mod" where x is referenced + // import * as x from "mod" where x is referenced + // import { x, y } from "mod" where at least one import is referenced externalImports.push(node); } break; - case 208: - if (node.moduleReference.kind === 219 && resolver.isReferencedAliasDeclaration(node)) { + case 208 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 219 /* ExternalModuleReference */ && resolver.isReferencedAliasDeclaration(node)) { + // import x = require("mod") where x is referenced externalImports.push(node); } break; - case 215: + case 215 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { + // export * from "mod" externalImports.push(node); hasExportStars = true; } else if (resolver.isValueAliasDeclaration(node)) { + // export { x, y } from "mod" where at least one export is a value symbol externalImports.push(node); } } else { + // export { x, y } 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); + var name_20 = (specifier.propertyName || specifier.name).text; + (exportSpecifiers[name_20] || (exportSpecifiers[name_20] = [])).push(specifier); } } break; - case 214: + case 214 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { + // export = x exportEquals = node; } break; } } } - function sortAMDModules(amdModules) { - return amdModules.sort(function (moduleA, moduleB) { - if (moduleA.name === moduleB.name) { - return 0; - } - else if (!moduleA.name) { - return 1; - } - else { - return -1; - } - }); - } function emitExportStarHelper() { if (hasExportStars) { writeLine(); @@ -23718,48 +28164,78 @@ var ts; } function emitAMDModule(node, startIndex) { collectExternalModuleInfo(node); + // An AMD define function has the following shape: + // define(id?, dependencies?, factory); + // + // This has the shape of + // define(name, ["module1", "module2"], function (module1Alias) { + // The location of the alias in the parameter list in the factory function needs to + // match the position of the module name in the dependency list. + // + // To ensure this is true in cases of modules with no aliases, e.g.: + // `import "module"` or `` + // we need to add modules without alias names to the end of the dependencies list + var aliasedModuleNames = []; // names of modules with corresponding parameter in the + // factory function. + var unaliasedModuleNames = []; // names of modules with no corresponding parameters in + // factory function. + var importAliasNames = []; // names of the parameters in the factory function; these + // paramters need to match the indexes of the corresponding + // module names in aliasedModuleNames. + // Fill in amd-dependency tags + for (var _a = 0, _b = node.amdDependencies; _a < _b.length; _a++) { + var amdDependency = _b[_a]; + if (amdDependency.name) { + aliasedModuleNames.push("\"" + amdDependency.path + "\""); + importAliasNames.push(amdDependency.name); + } + else { + unaliasedModuleNames.push("\"" + amdDependency.path + "\""); + } + } + for (var _c = 0; _c < externalImports.length; _c++) { + var importNode = externalImports[_c]; + // Find the name of the external module + var externalModuleName = ""; + var moduleName = ts.getExternalModuleName(importNode); + if (moduleName.kind === 8 /* StringLiteral */) { + externalModuleName = getLiteralText(moduleName); + } + // Find the name of the module alais, if there is one + var importAliasName = void 0; + var namespaceDeclaration = getNamespaceDeclarationNode(importNode); + if (namespaceDeclaration && !isDefaultImport(importNode)) { + importAliasName = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, namespaceDeclaration.name); + } + else { + importAliasName = getGeneratedNameForNode(importNode); + } + if (importAliasName) { + aliasedModuleNames.push(externalModuleName); + importAliasNames.push(importAliasName); + } + else { + unaliasedModuleNames.push(externalModuleName); + } + } writeLine(); write("define("); - sortAMDModules(node.amdDependencies); if (node.amdModuleName) { write("\"" + node.amdModuleName + "\", "); } write("[\"require\", \"exports\""); - for (var _a = 0; _a < externalImports.length; _a++) { - var importNode = externalImports[_a]; + if (aliasedModuleNames.length) { write(", "); - var moduleName = ts.getExternalModuleName(importNode); - if (moduleName.kind === 8) { - emitLiteral(moduleName); - } - else { - write("\"\""); - } + write(aliasedModuleNames.join(", ")); } - for (var _b = 0, _c = node.amdDependencies; _b < _c.length; _b++) { - var amdDependency = _c[_b]; - var text = "\"" + amdDependency.path + "\""; + if (unaliasedModuleNames.length) { write(", "); - write(text); + write(unaliasedModuleNames.join(", ")); } write("], function (require, exports"); - for (var _d = 0; _d < externalImports.length; _d++) { - var importNode = externalImports[_d]; + if (importAliasNames.length) { write(", "); - var namespaceDeclaration = getNamespaceDeclarationNode(importNode); - if (namespaceDeclaration && !isDefaultImport(importNode)) { - emit(namespaceDeclaration.name); - } - else { - write(getGeneratedNameForNode(importNode)); - } - } - for (var _e = 0, _f = node.amdDependencies; _e < _f.length; _e++) { - var amdDependency = _f[_e]; - if (amdDependency.name) { - write(", "); - write(amdDependency.name); - } + write(importAliasNames.join(", ")); } write(") {"); increaseIndent(); @@ -23788,6 +28264,8 @@ var ts; emitCaptureThisForNodeIfNecessary(node); emitLinesStartingAt(node.statements, startIndex); emitTempDeclarations(true); + // Emit exportDefault if it exists will happen as part + // or normal statement emit. } function emitExportEquals(emitAsReturn) { if (exportEquals && resolver.isValueAliasDeclaration(exportEquals)) { @@ -23808,12 +28286,13 @@ var ts; emit(statements[i]); } else { + // return index of the first non prologue directive return i; } } return statements.length; } - function writeHelper(text) { + function writeLines(text) { var lines = text.split(/\r\n|\r|\n/g); for (var i = 0; i < lines.length; ++i) { var line = lines[i]; @@ -23824,35 +28303,33 @@ var ts; } } function emitSourceFileNode(node) { + // Start new file on new line writeLine(); emitDetachedComments(node); + // emit prologue directives prior to __extends var startIndex = emitDirectivePrologues(node.statements, false); - if ((languageVersion < 2) && (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8)) { - 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("};"); + // Only Emit __extends function when target ES5. + // For target ES6 and above, we can emit classDeclaration as is. + if ((languageVersion < 2 /* ES6 */) && (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8 /* EmitExtends */)) { + writeLines(extendsHelper); extendsEmitted = true; } - if (!decorateEmitted && resolver.getNodeCheckFlags(node) & 512) { - 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};"); + if (!decorateEmitted && resolver.getNodeCheckFlags(node) & 512 /* EmitDecorate */) { + writeLines(decorateHelper); + if (compilerOptions.emitDecoratorMetadata) { + writeLines(metadataHelper); + } decorateEmitted = true; } + if (!paramEmitted && resolver.getNodeCheckFlags(node) & 1024 /* EmitParam */) { + writeLines(paramHelper); + paramEmitted = true; + } if (ts.isExternalModule(node)) { - if (languageVersion >= 2) { + if (languageVersion >= 2 /* ES6 */) { emitES6Module(node, startIndex); } - else if (compilerOptions.module === 2) { + else if (compilerOptions.module === 2 /* AMD */) { emitAMDModule(node, startIndex); } else { @@ -23874,7 +28351,7 @@ var ts; if (!node) { return; } - if (node.flags & 2) { + if (node.flags & 2 /* Ambient */) { return emitOnlyPinnedOrTripleSlashComments(node); } var emitComments = shouldEmitLeadingAndTrailingComments(node); @@ -23888,181 +28365,195 @@ var ts; } function shouldEmitLeadingAndTrailingComments(node) { switch (node.kind) { - case 202: - case 200: - case 209: - case 208: - case 203: - case 214: + // All of these entities are emitted in a specialized fashion. As such, we allow + // the specialized methods for each to handle the comments on the nodes. + case 202 /* InterfaceDeclaration */: + case 200 /* FunctionDeclaration */: + case 209 /* ImportDeclaration */: + case 208 /* ImportEqualsDeclaration */: + case 203 /* TypeAliasDeclaration */: + case 214 /* ExportAssignment */: return false; - case 205: + case 205 /* ModuleDeclaration */: + // Only emit the leading/trailing comments for a module if we're actually + // emitting the module as well. return shouldEmitModuleDeclaration(node); - case 204: + case 204 /* EnumDeclaration */: + // Only emit the leading/trailing comments for an enum if we're actually + // emitting the module as well. return shouldEmitEnumDeclaration(node); } - if (node.kind !== 179 && + // If this is the expression body of an arrow function that we're down-leveling, + // then we don't want to emit comments when we emit the body. It will have already + // been taken care of when we emitted the 'return' statement for the function + // expression body. + if (node.kind !== 179 /* Block */ && node.parent && - node.parent.kind === 163 && + node.parent.kind === 163 /* ArrowFunction */ && node.parent.body === node && - compilerOptions.target <= 1) { + compilerOptions.target <= 1 /* ES5 */) { return false; } + // Emit comments for everything else. return true; } function emitJavaScriptWorker(node, allowGeneratedIdentifiers) { if (allowGeneratedIdentifiers === void 0) { allowGeneratedIdentifiers = true; } + // Check if the node can be emitted regardless of the ScriptTarget switch (node.kind) { - case 65: + case 65 /* Identifier */: return emitIdentifier(node, allowGeneratedIdentifiers); - case 129: + case 129 /* Parameter */: return emitParameter(node); - case 134: - case 133: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: return emitMethod(node); - case 136: - case 137: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: return emitAccessor(node); - case 93: + case 93 /* ThisKeyword */: return emitThis(node); - case 91: + case 91 /* SuperKeyword */: return emitSuper(node); - case 89: + case 89 /* NullKeyword */: return write("null"); - case 95: + case 95 /* TrueKeyword */: return write("true"); - case 80: + case 80 /* FalseKeyword */: return write("false"); - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: + case 7 /* NumericLiteral */: + case 8 /* StringLiteral */: + case 9 /* RegularExpressionLiteral */: + case 10 /* NoSubstitutionTemplateLiteral */: + case 11 /* TemplateHead */: + case 12 /* TemplateMiddle */: + case 13 /* TemplateTail */: return emitLiteral(node); - case 171: + case 171 /* TemplateExpression */: return emitTemplateExpression(node); - case 176: + case 176 /* TemplateSpan */: return emitTemplateSpan(node); - case 126: + case 126 /* QualifiedName */: return emitQualifiedName(node); - case 150: + case 150 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 151: + case 151 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 152: + case 152 /* BindingElement */: return emitBindingElement(node); - case 153: + case 153 /* ArrayLiteralExpression */: return emitArrayLiteral(node); - case 154: + case 154 /* ObjectLiteralExpression */: return emitObjectLiteral(node); - case 224: + case 224 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 225: + case 225 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 127: + case 127 /* ComputedPropertyName */: return emitComputedPropertyName(node); - case 155: + case 155 /* PropertyAccessExpression */: return emitPropertyAccess(node); - case 156: + case 156 /* ElementAccessExpression */: return emitIndexedAccess(node); - case 157: + case 157 /* CallExpression */: return emitCallExpression(node); - case 158: + case 158 /* NewExpression */: return emitNewExpression(node); - case 159: + case 159 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 160: + case 160 /* TypeAssertionExpression */: return emit(node.expression); - case 161: + case 161 /* ParenthesizedExpression */: return emitParenExpression(node); - case 200: - case 162: - case 163: + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: return emitFunctionDeclaration(node); - case 164: + case 164 /* DeleteExpression */: return emitDeleteExpression(node); - case 165: + case 165 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 166: + case 166 /* VoidExpression */: return emitVoidExpression(node); - case 167: + case 167 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 168: + case 168 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 169: + case 169 /* BinaryExpression */: return emitBinaryExpression(node); - case 170: + case 170 /* ConditionalExpression */: return emitConditionalExpression(node); - case 173: + case 173 /* SpreadElementExpression */: return emitSpreadElementExpression(node); - case 175: + case 172 /* YieldExpression */: + return emitYieldExpression(node); + case 175 /* OmittedExpression */: return; - case 179: - case 206: + case 179 /* Block */: + case 206 /* ModuleBlock */: return emitBlock(node); - case 180: + case 180 /* VariableStatement */: return emitVariableStatement(node); - case 181: + case 181 /* EmptyStatement */: return write(";"); - case 182: + case 182 /* ExpressionStatement */: return emitExpressionStatement(node); - case 183: + case 183 /* IfStatement */: return emitIfStatement(node); - case 184: + case 184 /* DoStatement */: return emitDoStatement(node); - case 185: + case 185 /* WhileStatement */: return emitWhileStatement(node); - case 186: + case 186 /* ForStatement */: return emitForStatement(node); - case 188: - case 187: + case 188 /* ForOfStatement */: + case 187 /* ForInStatement */: return emitForInOrForOfStatement(node); - case 189: - case 190: + case 189 /* ContinueStatement */: + case 190 /* BreakStatement */: return emitBreakOrContinueStatement(node); - case 191: + case 191 /* ReturnStatement */: return emitReturnStatement(node); - case 192: + case 192 /* WithStatement */: return emitWithStatement(node); - case 193: + case 193 /* SwitchStatement */: return emitSwitchStatement(node); - case 220: - case 221: + case 220 /* CaseClause */: + case 221 /* DefaultClause */: return emitCaseOrDefaultClause(node); - case 194: + case 194 /* LabeledStatement */: return emitLabelledStatement(node); - case 195: + case 195 /* ThrowStatement */: return emitThrowStatement(node); - case 196: + case 196 /* TryStatement */: return emitTryStatement(node); - case 223: + case 223 /* CatchClause */: return emitCatchClause(node); - case 197: + case 197 /* DebuggerStatement */: return emitDebuggerStatement(node); - case 198: + case 198 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 174: + case 174 /* ClassExpression */: return emitClassExpression(node); - case 201: + case 201 /* ClassDeclaration */: return emitClassDeclaration(node); - case 202: + case 202 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 204: + case 204 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 226: + case 226 /* EnumMember */: return emitEnumMember(node); - case 205: + case 205 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 209: + case 209 /* ImportDeclaration */: return emitImportDeclaration(node); - case 208: + case 208 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 215: + case 215 /* ExportDeclaration */: return emitExportDeclaration(node); - case 214: + case 214 /* ExportAssignment */: return emitExportAssignment(node); - case 227: + case 227 /* SourceFile */: return emitSourceFileNode(node); } } @@ -24070,6 +28561,7 @@ var ts; return detachedCommentsInfo !== undefined && detachedCommentsInfo[detachedCommentsInfo.length - 1].nodePos === pos; } function getLeadingCommentsWithoutDetachedComments() { + // get the leading comments from detachedPos var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, detachedCommentsInfo[detachedCommentsInfo.length - 1].detachedCommentEndPos); if (detachedCommentsInfo.length - 1) { detachedCommentsInfo.pop(); @@ -24080,6 +28572,8 @@ var ts; return leadingComments; } function filterComments(ranges, onlyPinnedOrTripleSlashComments) { + // If we're removing comments, then we want to strip out all but the pinned or + // triple slash comments. if (ranges && onlyPinnedOrTripleSlashComments) { ranges = ts.filter(ranges, isPinnedOrTripleSlashComment); if (ranges.length === 0) { @@ -24089,20 +28583,24 @@ var ts; return ranges; } function getLeadingCommentsToEmit(node) { + // Emit the leading comments only if the parent's pos doesn't match because parent should take care of emitting these comments if (node.parent) { - if (node.parent.kind === 227 || node.pos !== node.parent.pos) { + if (node.parent.kind === 227 /* SourceFile */ || node.pos !== node.parent.pos) { if (hasDetachedComments(node.pos)) { + // get comments without detached comments return getLeadingCommentsWithoutDetachedComments(); } else { + // get the leading comments from the node return ts.getLeadingCommentRangesOfNode(node, currentSourceFile); } } } } function getTrailingCommentsToEmit(node) { + // Emit the trailing comments only if the parent's pos doesn't match because parent should take care of emitting these comments if (node.parent) { - if (node.parent.kind === 227 || node.end !== node.parent.end) { + if (node.parent.kind === 227 /* SourceFile */ || node.end !== node.parent.end) { return ts.getTrailingCommentRanges(currentSourceFile.text, node.end); } } @@ -24114,24 +28612,32 @@ var ts; return emitLeadingCommentsWorker(node, compilerOptions.removeComments); } function emitLeadingCommentsWorker(node, onlyPinnedOrTripleSlashComments) { + // If the caller only wants pinned or triple slash comments, then always filter + // down to that set. Otherwise, filter based on the current compiler options. var leadingComments = filterComments(getLeadingCommentsToEmit(node), onlyPinnedOrTripleSlashComments); ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); + // Leading comments are emitted at /*leading comment1 */space/*leading comment*/space ts.emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); } function emitTrailingComments(node) { + // Emit the trailing comments only if the parent's end doesn't match var trailingComments = filterComments(getTrailingCommentsToEmit(node), compilerOptions.removeComments); + // trailing comments are emitted at space/*trailing comment1 */space/*trailing comment*/ ts.emitComments(currentSourceFile, writer, trailingComments, false, newLine, writeComment); } function emitLeadingCommentsOfPosition(pos) { var leadingComments; if (hasDetachedComments(pos)) { + // get comments without detached comments leadingComments = getLeadingCommentsWithoutDetachedComments(); } else { + // get the leading comments from the node leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, pos); } leadingComments = filterComments(leadingComments, compilerOptions.removeComments); ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, { pos: pos, end: pos }, leadingComments); + // Leading comments are emitted at /*leading comment1 */space/*leading comment*/space ts.emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); } function emitDetachedComments(node) { @@ -24144,6 +28650,9 @@ var ts; var lastCommentLine = ts.getLineOfLocalPosition(currentSourceFile, lastComment.end); var commentLine = ts.getLineOfLocalPosition(currentSourceFile, comment.pos); if (commentLine >= lastCommentLine + 2) { + // There was a blank line between the last comment and this comment. This + // comment is not part of the copyright comments. Return what we have so + // far. return detachedComments; } } @@ -24151,9 +28660,13 @@ var ts; lastComment = comment; }); if (detachedComments.length) { + // All comments look like they could have been part of the copyright header. Make + // sure there is at least one blank line between it and the node. If not, it's not + // a copyright header. var lastCommentLine = ts.getLineOfLocalPosition(currentSourceFile, detachedComments[detachedComments.length - 1].end); var nodeLine = ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node.pos)); if (nodeLine >= lastCommentLine + 2) { + // Valid detachedComments ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); ts.emitComments(currentSourceFile, writer, detachedComments, true, newLine, writeComment); var currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: detachedComments[detachedComments.length - 1].end }; @@ -24168,12 +28681,12 @@ var ts; } } function isPinnedOrTripleSlashComment(comment) { - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42) { - return currentSourceFile.text.charCodeAt(comment.pos + 2) === 33; + if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42 /* asterisk */) { + return currentSourceFile.text.charCodeAt(comment.pos + 2) === 33 /* exclamation */; } - else if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 47 && + else if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 47 /* slash */ && comment.pos + 2 < comment.end && - currentSourceFile.text.charCodeAt(comment.pos + 2) === 47 && + currentSourceFile.text.charCodeAt(comment.pos + 2) === 47 /* slash */ && currentSourceFile.text.substring(comment.pos, comment.end).match(ts.fullTripleSlashReferencePathRegEx)) { return true; } @@ -24192,10 +28705,11 @@ var ts; /// var ts; (function (ts) { - ts.programTime = 0; - ts.emitTime = 0; - ts.ioReadTime = 0; - ts.ioWriteTime = 0; + /* @internal */ ts.programTime = 0; + /* @internal */ ts.emitTime = 0; + /* @internal */ ts.ioReadTime = 0; + /* @internal */ ts.ioWriteTime = 0; + /** The version of the TypeScript compiler release */ ts.version = "1.5.0-alpha"; function findConfigFile(searchPath) { var fileName = "tsconfig.json"; @@ -24217,8 +28731,11 @@ var ts; var currentDirectory; var existingDirectories = {}; function getCanonicalFileName(fileName) { + // if underlying system can distinguish between two files whose names differs only in cases then file name already in canonical form. + // otherwise use toLowerCase as a canonical form. return ts.sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(); } + // returned by CScript sys environment var unsupportedFileEncodingErrorCode = -2147024809; function getSourceFile(fileName, languageVersion, onError) { var text; @@ -24338,7 +28855,7 @@ var ts; getDiagnosticsProducingTypeChecker: getDiagnosticsProducingTypeChecker, getCommonSourceDirectory: function () { return commonSourceDirectory; }, emit: emit, - getCurrentDirectory: host.getCurrentDirectory, + getCurrentDirectory: function () { return host.getCurrentDirectory(); }, getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); }, getIdentifierCount: function () { return getDiagnosticsProducingTypeChecker().getIdentifierCount(); }, getSymbolCount: function () { return getDiagnosticsProducingTypeChecker().getSymbolCount(); }, @@ -24347,14 +28864,14 @@ var ts; return program; function getEmitHost(writeFileCallback) { return { - getCanonicalFileName: host.getCanonicalFileName, + getCanonicalFileName: function (fileName) { return host.getCanonicalFileName(fileName); }, getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, - getCurrentDirectory: host.getCurrentDirectory, - getNewLine: host.getNewLine, + getCurrentDirectory: function () { return host.getCurrentDirectory(); }, + getNewLine: function () { return host.getNewLine(); }, getSourceFile: program.getSourceFile, getSourceFiles: program.getSourceFiles, - writeFile: writeFileCallback || host.writeFile + writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError) { return host.writeFile(fileName, data, writeByteOrderMark, onError); }) }; } function getDiagnosticsProducingTypeChecker() { @@ -24364,9 +28881,14 @@ var ts; return noDiagnosticsTypeChecker || (noDiagnosticsTypeChecker = ts.createTypeChecker(program, false)); } function emit(sourceFile, writeFileCallback) { + // If the noEmitOnError flag is set, then check if we have any errors so far. If so, + // immediately bail out. if (options.noEmitOnError && getPreEmitDiagnostics(this).length > 0) { return { diagnostics: [], sourceMaps: undefined, emitSkipped: true }; } + // Create the emit resolver outside of the "emitTime" tracking code below. That way + // any cost associated with it (like type checking) are appropriate associated with + // the type-checking counter. var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile); var start = new Date().getTime(); var emitResult = ts.emitFiles(emitResolver, getEmitHost(writeFileCallback), sourceFile); @@ -24410,6 +28932,7 @@ var ts; function getDeclarationDiagnosticsForFile(sourceFile) { if (!ts.isDeclarationFile(sourceFile)) { var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile); + // Don't actually write any files since we're just getting diagnostics. var writeFile = function () { }; return ts.getDeclarationDiagnostics(getEmitHost(writeFile), resolver, sourceFile); } @@ -24464,9 +28987,11 @@ var ts; } } } + // Get source file from normalized fileName function findSourceFile(fileName, isDefaultLib, refFile, refStart, refLength) { var canonicalName = host.getCanonicalFileName(fileName); if (ts.hasProperty(filesByName, canonicalName)) { + // We've already looked for this file, use cached result return getSourceFileFromCache(fileName, canonicalName, false); } else { @@ -24475,6 +29000,7 @@ var ts; if (ts.hasProperty(filesByName, canonicalAbsolutePath)) { return getSourceFileFromCache(normalizedAbsolutePath, canonicalAbsolutePath, true); } + // We haven't looked for this file, do so now and cache result var file = filesByName[canonicalName] = host.getSourceFile(fileName, options.target, function (hostErrorMessage) { if (refFile) { diagnostics.add(ts.createFileDiagnostic(refFile, refStart, refLength, ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, hostErrorMessage)); @@ -24485,6 +29011,7 @@ var ts; }); if (file) { seenNoDefaultLib = seenNoDefaultLib || file.hasNoDefaultLib; + // Set the source file for normalized absolute path filesByName[canonicalAbsolutePath] = file; if (!options.noResolve) { var basePath = ts.getDirectoryPath(fileName); @@ -24519,9 +29046,9 @@ var ts; } function processImportedModules(file, basePath) { ts.forEach(file.statements, function (node) { - if (node.kind === 209 || node.kind === 208 || node.kind === 215) { + if (node.kind === 209 /* ImportDeclaration */ || node.kind === 208 /* ImportEqualsDeclaration */ || node.kind === 215 /* ExportDeclaration */) { var moduleNameExpr = ts.getExternalModuleName(node); - if (moduleNameExpr && moduleNameExpr.kind === 8) { + if (moduleNameExpr && moduleNameExpr.kind === 8 /* StringLiteral */) { var moduleNameText = moduleNameExpr.text; if (moduleNameText) { var searchPath = basePath; @@ -24539,13 +29066,21 @@ var ts; } } } - else if (node.kind === 205 && node.name.kind === 8 && (node.flags & 2 || ts.isDeclarationFile(file))) { + else if (node.kind === 205 /* ModuleDeclaration */ && node.name.kind === 8 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || ts.isDeclarationFile(file))) { + // TypeScript 1.0 spec (April 2014): 12.1.6 + // An AmbientExternalModuleDeclaration declares an external module. + // This type of declaration is permitted only in the global module. + // The StringLiteral must specify a top - level external module name. + // Relative external module names are not permitted ts.forEachChild(node.body, function (node) { if (ts.isExternalModuleImportEqualsDeclaration(node) && - ts.getExternalModuleImportEqualsDeclarationExpression(node).kind === 8) { + ts.getExternalModuleImportEqualsDeclarationExpression(node).kind === 8 /* StringLiteral */) { var nameLiteral = ts.getExternalModuleImportEqualsDeclarationExpression(node); var moduleName = nameLiteral.text; if (moduleName) { + // TypeScript 1.0 spec (April 2014): 12.1.6 + // An ExternalImportDeclaration in anAmbientExternalModuleDeclaration may reference other external modules + // only through top - level external module names. Relative external module names are not permitted. var searchName = ts.normalizePath(ts.combinePaths(basePath, moduleName)); var tsFile = findModuleSourceFile(searchName + ".ts", nameLiteral); if (!tsFile) { @@ -24576,6 +29111,7 @@ var ts; } } if (!options.sourceMap && (options.mapRoot || options.sourceRoot)) { + // Error to specify --mapRoot or --sourceRoot without mapSourceFiles if (options.mapRoot) { diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option)); } @@ -24584,10 +29120,10 @@ var ts; } return; } - var languageVersion = options.target || 0; + var languageVersion = options.target || 0 /* ES3 */; var firstExternalModuleSourceFile = ts.forEach(files, function (f) { return ts.isExternalModule(f) ? f : undefined; }); if (options.separateCompilation) { - if (!options.module && languageVersion < 2) { + if (!options.module && languageVersion < 2 /* ES6 */) { 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; }); @@ -24596,23 +29132,28 @@ var ts; 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) { + else if (firstExternalModuleSourceFile && languageVersion < 2 /* ES6 */ && !options.module) { + // We cannot use createDiagnosticFromNode because nodes do not have parents yet var span = ts.getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator); diagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_external_modules_unless_the_module_flag_is_provided)); } - if (options.module && languageVersion >= 2) { + // Cannot specify module gen target when in es6 or above + if (options.module && languageVersion >= 2 /* ES6 */) { diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher)); } + // 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 || options.sourceRoot || (options.mapRoot && (!options.out || firstExternalModuleSourceFile !== undefined))) { var commonPathComponents; ts.forEach(files, function (sourceFile) { - if (!(sourceFile.flags & 2048) + // Each file contributes into common source file path + if (!(sourceFile.flags & 2048 /* DeclarationFile */) && !ts.fileExtensionIs(sourceFile.fileName, ".js")) { var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile.fileName, host.getCurrentDirectory()); - sourcePathComponents.pop(); + sourcePathComponents.pop(); // FileName is not part of directory if (commonPathComponents) { for (var i = 0; i < Math.min(commonPathComponents.length, sourcePathComponents.length); i++) { if (commonPathComponents[i] !== sourcePathComponents[i]) { @@ -24620,21 +29161,27 @@ var ts; diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); return; } + // New common path found that is 0 -> i-1 commonPathComponents.length = i; break; } } + // If the fileComponent path completely matched and less than already found update the length if (sourcePathComponents.length < commonPathComponents.length) { commonPathComponents.length = sourcePathComponents.length; } } else { + // first file commonPathComponents = sourcePathComponents; } } }); commonSourceDirectory = ts.getNormalizedPathFromPathComponents(commonPathComponents); if (commonSourceDirectory) { + // Make sure directory path ends with directory separator so this string can directly + // used to replace with "" to get the relative path of the source file and the relative path doesn't + // start with / making it rooted path commonSourceDirectory += ts.directorySeparator; } } @@ -24656,6 +29203,7 @@ var ts; /// var ts; (function (ts) { + /* @internal */ ts.optionDeclarations = [ { name: "charset", @@ -24700,8 +29248,8 @@ var ts; name: "module", shortName: "m", type: { - "commonjs": 1, - "amd": 2 + "commonjs": 1 /* CommonJS */, + "amd": 2 /* AMD */ }, description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_or_amd, paramType: ts.Diagnostics.KIND, @@ -24791,7 +29339,7 @@ var ts; { name: "target", shortName: "t", - type: { "es3": 0, "es5": 1, "es6": 2 }, + type: { "es3": 0 /* ES3 */, "es5": 1 /* ES5 */, "es6": 2 /* ES6 */ }, description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental, paramType: ts.Diagnostics.VERSION, error: ts.Diagnostics.Argument_for_target_option_must_be_es3_es5_or_es6 @@ -24807,6 +29355,11 @@ var ts; shortName: "w", type: "boolean", description: ts.Diagnostics.Watch_input_files + }, + { + name: "emitDecoratorMetadata", + type: "boolean", + experimental: true } ]; function parseCommandLine(commandLine) { @@ -24831,16 +29384,18 @@ var ts; var i = 0; while (i < args.length) { var s = args[i++]; - if (s.charCodeAt(0) === 64) { + if (s.charCodeAt(0) === 64 /* at */) { parseResponseFile(s.slice(1)); } - else if (s.charCodeAt(0) === 45) { - s = s.slice(s.charCodeAt(1) === 45 ? 2 : 1).toLowerCase(); + else if (s.charCodeAt(0) === 45 /* minus */) { + s = s.slice(s.charCodeAt(1) === 45 /* minus */ ? 2 : 1).toLowerCase(); + // Try to translate short option names to their full equivalents. if (ts.hasProperty(shortOptionNames, s)) { s = shortOptionNames[s]; } if (ts.hasProperty(optionNameMap, s)) { var opt = optionNameMap[s]; + // Check to see if no argument was provided (e.g. "--locale" is the last command-line argument). if (!args[i] && opt.type !== "boolean") { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_expects_an_argument, opt.name)); } @@ -24854,6 +29409,7 @@ var ts; case "string": options[opt.name] = args[i++] || ""; break; + // If not a primitive, the possible types are specified in what is effectively a map of options. default: var map = opt.type; var key = (args[i++] || "").toLowerCase(); @@ -24883,14 +29439,14 @@ var ts; var args = []; var pos = 0; while (true) { - while (pos < text.length && text.charCodeAt(pos) <= 32) + while (pos < text.length && text.charCodeAt(pos) <= 32 /* space */) pos++; if (pos >= text.length) break; var start = pos; - if (text.charCodeAt(start) === 34) { + if (text.charCodeAt(start) === 34 /* doubleQuote */) { pos++; - while (pos < text.length && text.charCodeAt(pos) !== 34) + while (pos < text.length && text.charCodeAt(pos) !== 34 /* doubleQuote */) pos++; if (pos < text.length) { args.push(text.substring(start + 1, pos)); @@ -24901,7 +29457,7 @@ var ts; } } else { - while (text.charCodeAt(pos) > 32) + while (text.charCodeAt(pos) > 32 /* space */) pos++; args.push(text.substring(start, pos)); } @@ -24910,6 +29466,10 @@ var ts; } } ts.parseCommandLine = parseCommandLine; + /** + * Read tsconfig.json file + * @param fileName The path to the config file + */ function readConfigFile(fileName) { try { var text = ts.sys.readFile(fileName); @@ -24919,6 +29479,12 @@ var ts; } } ts.readConfigFile = readConfigFile; + /** + * Parse the contents of a config file (tsconfig.json). + * @param json The contents of the config file to parse + * @param basePath A root directory to resolve relative path entries in the config + * file to. e.g. outDir + */ function parseConfigFile(json, basePath) { var errors = []; return { @@ -24988,20 +29554,7 @@ 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. -// +/* @internal */ var ts; (function (ts) { var OutliningElementsCollector; @@ -25020,8 +29573,60 @@ var ts; elements.push(span); } } + function addOutliningSpanComments(commentSpan, autoCollapse) { + if (commentSpan) { + var span = { + textSpan: ts.createTextSpanFromBounds(commentSpan.pos, commentSpan.end), + hintSpan: ts.createTextSpanFromBounds(commentSpan.pos, commentSpan.end), + bannerText: collapseText, + autoCollapse: autoCollapse + }; + elements.push(span); + } + } + function addOutliningForLeadingCommentsForNode(n) { + var comments = ts.getLeadingCommentRangesOfNode(n, sourceFile); + if (comments) { + var firstSingleLineCommentStart = -1; + var lastSingleLineCommentEnd = -1; + var isFirstSingleLineComment = true; + var singleLineCommentCount = 0; + for (var _i = 0; _i < comments.length; _i++) { + var currentComment = comments[_i]; + // For single line comments, combine consecutive ones (2 or more) into + // a single span from the start of the first till the end of the last + if (currentComment.kind === 2 /* SingleLineCommentTrivia */) { + if (isFirstSingleLineComment) { + firstSingleLineCommentStart = currentComment.pos; + } + isFirstSingleLineComment = false; + lastSingleLineCommentEnd = currentComment.end; + singleLineCommentCount++; + } + else if (currentComment.kind === 3 /* MultiLineCommentTrivia */) { + combineAndAddMultipleSingleLineComments(singleLineCommentCount, firstSingleLineCommentStart, lastSingleLineCommentEnd); + addOutliningSpanComments(currentComment, false); + singleLineCommentCount = 0; + lastSingleLineCommentEnd = -1; + isFirstSingleLineComment = true; + } + } + combineAndAddMultipleSingleLineComments(singleLineCommentCount, firstSingleLineCommentStart, lastSingleLineCommentEnd); + } + } + function combineAndAddMultipleSingleLineComments(count, start, end) { + // Only outline spans of two or more consecutive single line comments + if (count > 1) { + var multipleSingleLineComments = { + pos: start, + end: end, + kind: 2 /* SingleLineCommentTrivia */ + }; + addOutliningSpanComments(multipleSingleLineComments, false); + } + } function autoCollapse(node) { - return ts.isFunctionBlock(node) && node.parent.kind !== 163; + return ts.isFunctionBlock(node) && node.parent.kind !== 163 /* ArrowFunction */; } var depth = 0; var maxDepth = 20; @@ -25029,37 +29634,46 @@ var ts; if (depth > maxDepth) { return; } + if (ts.isDeclaration(n)) { + addOutliningForLeadingCommentsForNode(n); + } switch (n.kind) { - case 179: + case 179 /* Block */: if (!ts.isFunctionBlock(n)) { var parent_6 = n.parent; - var openBrace = ts.findChildOfKind(n, 14, sourceFile); - var closeBrace = ts.findChildOfKind(n, 15, sourceFile); - if (parent_6.kind === 184 || - parent_6.kind === 187 || - parent_6.kind === 188 || - parent_6.kind === 186 || - parent_6.kind === 183 || - parent_6.kind === 185 || - parent_6.kind === 192 || - parent_6.kind === 223) { + var openBrace = ts.findChildOfKind(n, 14 /* OpenBraceToken */, sourceFile); + var closeBrace = ts.findChildOfKind(n, 15 /* CloseBraceToken */, sourceFile); + // Check if the block is standalone, or 'attached' to some parent statement. + // If the latter, we want to collaps the block, but consider its hint span + // to be the entire span of the parent. + if (parent_6.kind === 184 /* DoStatement */ || + parent_6.kind === 187 /* ForInStatement */ || + parent_6.kind === 188 /* ForOfStatement */ || + parent_6.kind === 186 /* ForStatement */ || + parent_6.kind === 183 /* IfStatement */ || + parent_6.kind === 185 /* WhileStatement */ || + parent_6.kind === 192 /* WithStatement */ || + parent_6.kind === 223 /* CatchClause */) { addOutliningSpan(parent_6, openBrace, closeBrace, autoCollapse(n)); break; } - if (parent_6.kind === 196) { + if (parent_6.kind === 196 /* TryStatement */) { + // Could be the try-block, or the finally-block. var tryStatement = parent_6; if (tryStatement.tryBlock === n) { addOutliningSpan(parent_6, openBrace, closeBrace, autoCollapse(n)); break; } else if (tryStatement.finallyBlock === n) { - var finallyKeyword = ts.findChildOfKind(tryStatement, 81, sourceFile); + var finallyKeyword = ts.findChildOfKind(tryStatement, 81 /* FinallyKeyword */, sourceFile); if (finallyKeyword) { addOutliningSpan(finallyKeyword, openBrace, closeBrace, autoCollapse(n)); break; } } } + // Block was a standalone block. In this case we want to only collapse + // the span of the block, independent of any parent span. var span = ts.createTextSpanFromBounds(n.getStart(), n.end); elements.push({ textSpan: span, @@ -25069,25 +29683,26 @@ var ts; }); break; } - case 206: { - var openBrace = ts.findChildOfKind(n, 14, sourceFile); - var closeBrace = ts.findChildOfKind(n, 15, sourceFile); + // Fallthrough. + case 206 /* ModuleBlock */: { + var openBrace = ts.findChildOfKind(n, 14 /* OpenBraceToken */, sourceFile); + var closeBrace = ts.findChildOfKind(n, 15 /* CloseBraceToken */, sourceFile); addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); break; } - case 201: - case 202: - case 204: - case 154: - case 207: { - var openBrace = ts.findChildOfKind(n, 14, sourceFile); - var closeBrace = ts.findChildOfKind(n, 15, sourceFile); + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + case 204 /* EnumDeclaration */: + case 154 /* ObjectLiteralExpression */: + case 207 /* CaseBlock */: { + var openBrace = ts.findChildOfKind(n, 14 /* OpenBraceToken */, sourceFile); + var closeBrace = ts.findChildOfKind(n, 15 /* CloseBraceToken */, sourceFile); addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); break; } - case 153: - var openBracket = ts.findChildOfKind(n, 18, sourceFile); - var closeBracket = ts.findChildOfKind(n, 19, sourceFile); + case 153 /* ArrayLiteralExpression */: + var openBracket = ts.findChildOfKind(n, 18 /* OpenBracketToken */, sourceFile); + var closeBracket = ts.findChildOfKind(n, 19 /* CloseBracketToken */, sourceFile); addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); break; } @@ -25101,6 +29716,7 @@ var ts; OutliningElementsCollector.collectElements = collectElements; })(OutliningElementsCollector = ts.OutliningElementsCollector || (ts.OutliningElementsCollector = {})); })(ts || (ts = {})); +/* @internal */ var ts; (function (ts) { var NavigateTo; @@ -25108,30 +29724,37 @@ var ts; function getNavigateToItems(program, cancellationToken, searchValue, maxResultCount) { var patternMatcher = ts.createPatternMatcher(searchValue); var rawItems = []; + // Search the declarations in all files and output matched NavigateToItem into array of NavigateToItem[] ts.forEach(program.getSourceFiles(), function (sourceFile) { cancellationToken.throwIfCancellationRequested(); - var declarations = sourceFile.getNamedDeclarations(); - for (var _i = 0; _i < declarations.length; _i++) { - var declaration = declarations[_i]; - var name = getDeclarationName(declaration); - if (name !== undefined) { - var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name); + var nameToDeclarations = sourceFile.getNamedDeclarations(); + for (var name_21 in nameToDeclarations) { + var declarations = ts.getProperty(nameToDeclarations, name_21); + if (declarations) { + // First do a quick check to see if the name of the declaration matches the + // last portion of the (possibly) dotted name they're searching for. + var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_21); if (!matches) { continue; } - if (patternMatcher.patternContainsDots) { - var containers = getContainers(declaration); - if (!containers) { - return undefined; - } - matches = patternMatcher.getMatches(containers, name); - if (!matches) { - continue; + for (var _i = 0; _i < declarations.length; _i++) { + var declaration = declarations[_i]; + // It was a match! If the pattern has dots in it, then also see if the + // declaration container matches as well. + if (patternMatcher.patternContainsDots) { + var containers = getContainers(declaration); + if (!containers) { + return undefined; + } + matches = patternMatcher.getMatches(containers, name_21); + if (!matches) { + continue; + } } + var fileName = sourceFile.fileName; + var matchKind = bestMatchKind(matches); + rawItems.push({ name: name_21, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); } - var fileName = sourceFile.fileName; - var matchKind = bestMatchKind(matches); - rawItems.push({ name: name, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); } } }); @@ -25143,6 +29766,7 @@ var ts; return items; function allMatchesAreCaseSensitive(matches) { ts.Debug.assert(matches.length > 0); + // This is a case sensitive match, only if all the submatches were case sensitive. for (var _i = 0; _i < matches.length; _i++) { var match = matches[_i]; if (!match.isCaseSensitive) { @@ -25151,25 +29775,13 @@ var ts; } return true; } - function getDeclarationName(declaration) { - var result = getTextOfIdentifierOrLiteral(declaration.name); - if (result !== undefined) { - return result; - } - if (declaration.name.kind === 127) { - var expr = declaration.name.expression; - if (expr.kind === 155) { - return expr.name.text; - } - return getTextOfIdentifierOrLiteral(expr); - } - return undefined; - } function getTextOfIdentifierOrLiteral(node) { - if (node.kind === 65 || - node.kind === 8 || - node.kind === 7) { - return node.text; + if (node) { + if (node.kind === 65 /* Identifier */ || + node.kind === 8 /* StringLiteral */ || + node.kind === 7 /* NumericLiteral */) { + return node.text; + } } return undefined; } @@ -25179,15 +29791,19 @@ var ts; if (text !== undefined) { containers.unshift(text); } - else if (declaration.name.kind === 127) { + else if (declaration.name.kind === 127 /* ComputedPropertyName */) { return tryAddComputedPropertyName(declaration.name.expression, containers, true); } else { + // Don't know how to add this. return false; } } return true; } + // Only added the names of computed properties if they're simple dotted expressions, like: + // + // [X.Y.Z]() { } function tryAddComputedPropertyName(expression, containers, includeLastPortion) { var text = getTextOfIdentifierOrLiteral(expression); if (text !== undefined) { @@ -25196,7 +29812,7 @@ var ts; } return true; } - if (expression.kind === 155) { + if (expression.kind === 155 /* PropertyAccessExpression */) { var propertyAccess = expression; if (includeLastPortion) { containers.unshift(propertyAccess.name.text); @@ -25207,11 +29823,14 @@ var ts; } function getContainers(declaration) { var containers = []; - if (declaration.name.kind === 127) { + // First, if we started with a computed property name, then add all but the last + // portion into the container array. + if (declaration.name.kind === 127 /* ComputedPropertyName */) { if (!tryAddComputedPropertyName(declaration.name.expression, containers, false)) { return undefined; } } + // Now, walk up our containers, adding all their names to the container array. declaration = ts.getContainerNode(declaration); while (declaration) { if (!tryAddSingleDeclarationName(declaration, containers)) { @@ -25233,8 +29852,13 @@ var ts; } return bestMatchKind; } + // This means "compare in a case insensitive manner." var baseSensitivity = { sensitivity: "base" }; function compareNavigateToItems(i1, i2) { + // TODO(cyrusn): get the gamut of comparisons that VS already uses here. + // Right now we just sort by kind first, and then by name of the item. + // We first sort case insensitively. So "Aaa" will come before "bar". + // Then we sort case sensitively, so "aaa" will come before "Aaa". return i1.matchKind - i2.matchKind || i1.name.localeCompare(i2.name, undefined, baseSensitivity) || i1.name.localeCompare(i2.name); @@ -25250,6 +29874,7 @@ var ts; isCaseSensitive: rawItem.isCaseSensitive, fileName: rawItem.fileName, textSpan: ts.createTextSpanFromBounds(declaration.getStart(), declaration.getEnd()), + // TODO(jfreeman): What should be the containerName when the container has a computed name? containerName: container && container.name ? container.name.text : "", containerKind: container && container.name ? ts.getNodeKind(container) : "" }; @@ -25259,26 +29884,34 @@ var ts; })(NavigateTo = ts.NavigateTo || (ts.NavigateTo = {})); })(ts || (ts = {})); /// +/* @internal */ var ts; (function (ts) { var NavigationBar; (function (NavigationBar) { function getNavigationBarItems(sourceFile) { + // If the source file has any child items, then it included in the tree + // and takes lexical ownership of all other top-level items. var hasGlobalNode = false; return getItemsWorker(getTopLevelNodes(sourceFile), createTopLevelItem); function getIndent(node) { + // If we have a global node in the tree, + // then it adds an extra layer of depth to all subnodes. var indent = hasGlobalNode ? 1 : 0; var current = node.parent; while (current) { switch (current.kind) { - case 205: + case 205 /* ModuleDeclaration */: + // If we have a module declared as A.B.C, it is more "intuitive" + // to say it only has a single layer of depth do { current = current.parent; - } while (current.kind === 205); - case 201: - case 204: - case 202: - case 200: + } while (current.kind === 205 /* ModuleDeclaration */); + // fall through + case 201 /* ClassDeclaration */: + case 204 /* EnumDeclaration */: + case 202 /* InterfaceDeclaration */: + case 200 /* FunctionDeclaration */: indent++; } current = current.parent; @@ -25289,26 +29922,33 @@ var ts; var childNodes = []; function visit(node) { switch (node.kind) { - case 180: + case 180 /* VariableStatement */: ts.forEach(node.declarationList.declarations, visit); break; - case 150: - case 151: + case 150 /* ObjectBindingPattern */: + case 151 /* ArrayBindingPattern */: ts.forEach(node.elements, visit); break; - case 215: + case 215 /* ExportDeclaration */: + // Handle named exports case e.g.: + // export {a, b as B} from "mod"; if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 209: + case 209 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { + // Handle default import case e.g.: + // import d from "mod"; if (importClause.name) { childNodes.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 === 211) { + if (importClause.namedBindings.kind === 211 /* NamespaceImport */) { childNodes.push(importClause.namedBindings); } else { @@ -25317,24 +29957,38 @@ var ts; } } break; - case 152: - case 198: + case 152 /* BindingElement */: + case 198 /* VariableDeclaration */: if (ts.isBindingPattern(node.name)) { visit(node.name); break; } - case 201: - case 204: - case 202: - case 205: - case 200: - case 208: - case 213: - case 217: + // Fall through + case 201 /* ClassDeclaration */: + case 204 /* EnumDeclaration */: + case 202 /* InterfaceDeclaration */: + case 205 /* ModuleDeclaration */: + case 200 /* FunctionDeclaration */: + case 208 /* ImportEqualsDeclaration */: + case 213 /* ImportSpecifier */: + case 217 /* ExportSpecifier */: childNodes.push(node); break; } } + //for (let i = 0, n = nodes.length; i < n; i++) { + // let node = nodes[i]; + // if (node.kind === SyntaxKind.ClassDeclaration || + // node.kind === SyntaxKind.EnumDeclaration || + // node.kind === SyntaxKind.InterfaceDeclaration || + // node.kind === SyntaxKind.ModuleDeclaration || + // node.kind === SyntaxKind.FunctionDeclaration) { + // childNodes.push(node); + // } + // else if (node.kind === SyntaxKind.VariableStatement) { + // childNodes.push.apply(childNodes, (node).declarations); + // } + //} ts.forEach(nodes, visit); return sortNodes(childNodes); } @@ -25365,17 +30019,17 @@ var ts; for (var _i = 0; _i < nodes.length; _i++) { var node = nodes[_i]; switch (node.kind) { - case 201: - case 204: - case 202: + case 201 /* ClassDeclaration */: + case 204 /* EnumDeclaration */: + case 202 /* InterfaceDeclaration */: topLevelNodes.push(node); break; - case 205: + case 205 /* ModuleDeclaration */: var moduleDeclaration = node; topLevelNodes.push(node); addTopLevelNodes(getInnermostModule(moduleDeclaration).body.statements, topLevelNodes); break; - case 200: + case 200 /* FunctionDeclaration */: var functionDeclaration = node; if (isTopLevelFunctionDeclaration(functionDeclaration)) { topLevelNodes.push(node); @@ -25386,11 +30040,16 @@ var ts; } } function isTopLevelFunctionDeclaration(functionDeclaration) { - if (functionDeclaration.kind === 200) { - if (functionDeclaration.body && functionDeclaration.body.kind === 179) { - if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 200 && !isEmpty(s.name.text); })) { + if (functionDeclaration.kind === 200 /* FunctionDeclaration */) { + // A function declaration is 'top level' if it contains any function declarations + // within it. + if (functionDeclaration.body && functionDeclaration.body.kind === 179 /* Block */) { + // Proper function declarations can only have identifier names + if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 200 /* FunctionDeclaration */ && !isEmpty(s.name.text); })) { return true; } + // Or if it is not parented by another function. i.e all functions + // at module scope are 'top level'. if (!ts.isFunctionBlock(functionDeclaration.parent)) { return true; } @@ -25403,17 +30062,18 @@ var ts; var keyToItem = {}; for (var _i = 0; _i < nodes.length; _i++) { var child = nodes[_i]; - 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 item = createItem(child); + if (item !== undefined) { + if (item.text.length > 0) { + var key = item.text + "-" + item.kind + "-" + item.indent; var itemWithSameName = keyToItem[key]; if (itemWithSameName) { - merge(itemWithSameName, item_3); + // We had an item with the same name. Merge these items together. + merge(itemWithSameName, item); } else { - keyToItem[key] = item_3; - items.push(item_3); + keyToItem[key] = item; + items.push(item); } } } @@ -25421,62 +30081,68 @@ var ts; return items; } function merge(target, source) { + // First, add any spans in the source to the target. target.spans.push.apply(target.spans, source.spans); if (source.childItems) { if (!target.childItems) { target.childItems = []; } + // Next, recursively merge or add any children in the source as appropriate. outer: for (var _i = 0, _a = source.childItems; _i < _a.length; _i++) { var sourceChild = _a[_i]; for (var _b = 0, _c = target.childItems; _b < _c.length; _b++) { var targetChild = _c[_b]; if (targetChild.text === sourceChild.text && targetChild.kind === sourceChild.kind) { + // Found a match. merge them. merge(targetChild, sourceChild); continue outer; } } + // Didn't find a match, just add this child to the list. target.childItems.push(sourceChild); } } } function createChildItem(node) { switch (node.kind) { - case 129: + case 129 /* Parameter */: if (ts.isBindingPattern(node.name)) { break; } - if ((node.flags & 499) === 0) { + if ((node.flags & 499 /* Modifier */) === 0) { return undefined; } return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 134: - case 133: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberFunctionElement); - case 136: + case 136 /* GetAccessor */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberGetAccessorElement); - case 137: + case 137 /* SetAccessor */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement); - case 140: + case 140 /* IndexSignature */: return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement); - case 226: + case 226 /* EnumMember */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 138: + case 138 /* CallSignature */: return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); - case 139: + case 139 /* ConstructSignature */: return createItem(node, "new()", ts.ScriptElementKind.constructSignatureElement); - case 132: - case 131: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 200: + case 200 /* FunctionDeclaration */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.functionElement); - case 198: - case 152: + case 198 /* VariableDeclaration */: + case 152 /* BindingElement */: var variableDeclarationNode; - var name_18; - if (node.kind === 152) { - name_18 = node.name; + var name_22; + if (node.kind === 152 /* BindingElement */) { + name_22 = node.name; variableDeclarationNode = node; - while (variableDeclarationNode && variableDeclarationNode.kind !== 198) { + // binding elements are added only for variable declarations + // bubble up to the containing variable declaration + while (variableDeclarationNode && variableDeclarationNode.kind !== 198 /* VariableDeclaration */) { variableDeclarationNode = variableDeclarationNode.parent; } ts.Debug.assert(variableDeclarationNode !== undefined); @@ -25484,24 +30150,24 @@ var ts; else { ts.Debug.assert(!ts.isBindingPattern(node.name)); variableDeclarationNode = node; - name_18 = node.name; + name_22 = node.name; } if (ts.isConst(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_18), ts.ScriptElementKind.constElement); + return createItem(node, getTextOfNode(name_22), ts.ScriptElementKind.constElement); } else if (ts.isLet(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_18), ts.ScriptElementKind.letElement); + return createItem(node, getTextOfNode(name_22), ts.ScriptElementKind.letElement); } else { - return createItem(node, getTextOfNode(name_18), ts.ScriptElementKind.variableElement); + return createItem(node, getTextOfNode(name_22), ts.ScriptElementKind.variableElement); } - case 135: + case 135 /* Constructor */: return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); - case 217: - case 213: - case 208: - case 210: - case 211: + case 217 /* ExportSpecifier */: + case 213 /* ImportSpecifier */: + case 208 /* ImportEqualsDeclaration */: + case 210 /* ImportClause */: + case 211 /* NamespaceImport */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.alias); } return undefined; @@ -25531,27 +30197,29 @@ var ts; } function createTopLevelItem(node) { switch (node.kind) { - case 227: + case 227 /* SourceFile */: return createSourceFileItem(node); - case 201: + case 201 /* ClassDeclaration */: return createClassItem(node); - case 204: + case 204 /* EnumDeclaration */: return createEnumItem(node); - case 202: + case 202 /* InterfaceDeclaration */: return createIterfaceItem(node); - case 205: + case 205 /* ModuleDeclaration */: return createModuleItem(node); - case 200: + case 200 /* FunctionDeclaration */: return createFunctionItem(node); } return undefined; function getModuleName(moduleDeclaration) { - if (moduleDeclaration.name.kind === 8) { + // We want to maintain quotation marks. + if (moduleDeclaration.name.kind === 8 /* StringLiteral */) { return getTextOfNode(moduleDeclaration.name); } + // Otherwise, we need to aggregate each identifier to build up the qualified name. var result = []; result.push(moduleDeclaration.name.text); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 205) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 205 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(moduleDeclaration.name.text); } @@ -25563,9 +30231,9 @@ var ts; return getNavigationBarItem(moduleName, ts.ScriptElementKind.moduleElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } function createFunctionItem(node) { - if ((node.name || node.flags & 256) && node.body && node.body.kind === 179) { + if (node.body && node.body.kind === 179 /* Block */) { var childItems = getItemsWorker(sortNodes(node.body.statements), createChildItem); - return getNavigationBarItem((!node.name && node.flags & 256) ? "default" : node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); + return getNavigationBarItem(!node.name ? "default" : node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } return undefined; } @@ -25584,15 +30252,18 @@ var ts; var childItems; if (node.members) { var constructor = ts.forEach(node.members, function (member) { - return member.kind === 135 && member; + return member.kind === 135 /* Constructor */ && member; }); + // Add the constructor parameters in as children of the class (for property parameters). + // Note that *all non-binding pattern named* parameters will be added to the nodes array, but parameters that + // are not properties will be filtered out later by createChildItem. var nodes = removeDynamicallyNamedProperties(node); if (constructor) { nodes.push.apply(nodes, ts.filter(constructor.parameters, function (p) { return !ts.isBindingPattern(p.name); })); } childItems = getItemsWorker(sortNodes(nodes), createChildItem); } - var nodeName = !node.name && (node.flags & 256) ? "default" : node.name.text; + var nodeName = !node.name ? "default" : node.name.text; return getNavigationBarItem(nodeName, ts.ScriptElementKind.classElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } function createEnumItem(node) { @@ -25605,19 +30276,22 @@ var ts; } } function removeComputedProperties(node) { - return ts.filter(node.members, function (member) { return member.name === undefined || member.name.kind !== 127; }); + return ts.filter(node.members, function (member) { return member.name === undefined || member.name.kind !== 127 /* ComputedPropertyName */; }); } + /** + * Like removeComputedProperties, but retains the properties with well known symbol names + */ function removeDynamicallyNamedProperties(node) { return ts.filter(node.members, function (member) { return !ts.hasDynamicName(member); }); } function getInnermostModule(node) { - while (node.body.kind === 205) { + while (node.body.kind === 205 /* ModuleDeclaration */) { node = node.body; } return node; } function getNodeSpan(node) { - return node.kind === 227 + return node.kind === 227 /* SourceFile */ ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) : ts.createTextSpanFromBounds(node.getStart(), node.getEnd()); } @@ -25628,8 +30302,10 @@ var ts; NavigationBar.getNavigationBarItems = getNavigationBarItems; })(NavigationBar = ts.NavigationBar || (ts.NavigationBar = {})); })(ts || (ts = {})); +/* @internal */ var ts; (function (ts) { + // Note(cyrusn): this enum is ordered from strongest match type to weakest match type. (function (PatternMatchKind) { PatternMatchKind[PatternMatchKind["exact"] = 0] = "exact"; PatternMatchKind[PatternMatchKind["prefix"] = 1] = "prefix"; @@ -25646,6 +30322,10 @@ var ts; }; } function createPatternMatcher(pattern) { + // We'll often see the same candidate string many times when searching (For example, when + // we see the name of a module that is used everywhere, or the name of an overload). As + // such, we cache the information we compute about the candidate for the life of this + // pattern matcher so we don't have to compute it multiple times. var stringToWordSpans = {}; pattern = pattern.trim(); var fullPatternSegment = createSegment(pattern); @@ -25656,6 +30336,7 @@ var ts; getMatchesForLastSegmentOfPattern: getMatchesForLastSegmentOfPattern, patternContainsDots: dotSeparatedSegments.length > 1 }; + // Quick checks so we can bail out when asked to match a candidate. function skipMatch(candidate) { return invalidPattern || !candidate; } @@ -25669,24 +30350,36 @@ var ts; if (skipMatch(candidate)) { return undefined; } + // First, check that the last part of the dot separated pattern matches the name of the + // candidate. If not, then there's no point in proceeding and doing the more + // expensive work. var candidateMatch = matchSegment(candidate, ts.lastOrUndefined(dotSeparatedSegments)); if (!candidateMatch) { return undefined; } candidateContainers = candidateContainers || []; + // -1 because the last part was checked against the name, and only the rest + // of the parts are checked against the container. if (dotSeparatedSegments.length - 1 > candidateContainers.length) { + // There weren't enough container parts to match against the pattern parts. + // So this definitely doesn't match. return undefined; } + // So far so good. Now break up the container for the candidate and check if all + // the dotted parts match up correctly. var totalMatch = candidateMatch; for (var i = dotSeparatedSegments.length - 2, j = candidateContainers.length - 1; i >= 0; i--, j--) { var segment = dotSeparatedSegments[i]; var containerName = candidateContainers[j]; var containerMatch = matchSegment(containerName, segment); if (!containerMatch) { + // This container didn't match the pattern piece. So there's no match at all. return undefined; } ts.addRange(totalMatch, containerMatch); } + // Success, this symbol's full name matched against the dotted name the user was asking + // about. return totalMatch; } function getWordSpans(word) { @@ -25699,30 +30392,46 @@ var ts; var index = indexOfIgnoringCase(candidate, chunk.textLowerCase); if (index === 0) { if (chunk.text.length === candidate.length) { + // a) Check if the part matches the candidate entirely, in an case insensitive or + // sensitive manner. If it does, return that there was an exact match. return createPatternMatch(PatternMatchKind.exact, punctuationStripped, candidate === chunk.text); } else { + // b) Check if the part is a prefix of the candidate, in a case insensitive or sensitive + // manner. If it does, return that there was a prefix match. return createPatternMatch(PatternMatchKind.prefix, punctuationStripped, startsWith(candidate, chunk.text)); } } var isLowercase = chunk.isLowerCase; if (isLowercase) { if (index > 0) { + // c) If the part is entirely lowercase, then check if it is contained anywhere in the + // candidate in a case insensitive manner. If so, return that there was a substring + // match. + // + // Note: We only have a substring match if the lowercase part is prefix match of some + // word part. That way we don't match something like 'Class' when the user types 'a'. + // But we would match 'FooAttribute' (since 'Attribute' starts with 'a'). var wordSpans = getWordSpans(candidate); for (var _i = 0; _i < wordSpans.length; _i++) { var span = wordSpans[_i]; if (partStartsWith(candidate, span, chunk.text, true)) { - return createPatternMatch(PatternMatchKind.substring, punctuationStripped, partStartsWith(candidate, span, chunk.text, false)); + return createPatternMatch(PatternMatchKind.substring, punctuationStripped, + /*isCaseSensitive:*/ partStartsWith(candidate, span, chunk.text, false)); } } } } else { + // d) If the part was not entirely lowercase, then check if it is contained in the + // candidate in a case *sensitive* manner. If so, return that there was a substring + // match. if (candidate.indexOf(chunk.text) > 0) { return createPatternMatch(PatternMatchKind.substring, punctuationStripped, true); } } if (!isLowercase) { + // e) If the part was not entirely lowercase, then attempt a camel cased match as well. if (chunk.characterSpans.length > 0) { var candidateParts = getWordSpans(candidate); var camelCaseWeight = tryCamelCaseMatch(candidate, candidateParts, chunk, false); @@ -25736,6 +30445,12 @@ var ts; } } if (isLowercase) { + // f) Is the pattern a substring of the candidate starting on one of the candidate's word boundaries? + // We could check every character boundary start of the candidate for the pattern. However, that's + // an m * n operation in the wost case. Instead, find the first instance of the pattern + // substring, and see if it starts on a capital letter. It seems unlikely that the user will try to + // filter the list based on a substring that starts on a capital letter and also with a lowercase one. + // (Pattern: fogbar, Candidate: quuxfogbarFogBar). if (chunk.text.length < candidate.length) { if (index > 0 && isUpperCaseLetter(candidate.charCodeAt(index))) { return createPatternMatch(PatternMatchKind.substring, punctuationStripped, false); @@ -25747,23 +30462,67 @@ var ts; function containsSpaceOrAsterisk(text) { for (var i = 0; i < text.length; i++) { var ch = text.charCodeAt(i); - if (ch === 32 || ch === 42) { + if (ch === 32 /* space */ || ch === 42 /* asterisk */) { return true; } } return false; } function matchSegment(candidate, segment) { + // First check if the segment matches as is. This is also useful if the segment contains + // characters we would normally strip when splitting into parts that we also may want to + // match in the candidate. For example if the segment is "@int" and the candidate is + // "@int", then that will show up as an exact match here. + // + // Note: if the segment contains a space or an asterisk then we must assume that it's a + // multi-word segment. if (!containsSpaceOrAsterisk(segment.totalTextChunk.text)) { var match = matchTextChunk(candidate, segment.totalTextChunk, false); if (match) { return [match]; } } + // The logic for pattern matching is now as follows: + // + // 1) Break the segment passed in into words. Breaking is rather simple and a + // good way to think about it that if gives you all the individual alphanumeric words + // of the pattern. + // + // 2) For each word try to match the word against the candidate value. + // + // 3) Matching is as follows: + // + // a) Check if the word matches the candidate entirely, in an case insensitive or + // sensitive manner. If it does, return that there was an exact match. + // + // b) Check if the word is a prefix of the candidate, in a case insensitive or + // sensitive manner. If it does, return that there was a prefix match. + // + // c) If the word is entirely lowercase, then check if it is contained anywhere in the + // candidate in a case insensitive manner. If so, return that there was a substring + // match. + // + // Note: We only have a substring match if the lowercase part is prefix match of + // some word part. That way we don't match something like 'Class' when the user + // types 'a'. But we would match 'FooAttribute' (since 'Attribute' starts with + // 'a'). + // + // d) If the word was not entirely lowercase, then check if it is contained in the + // candidate in a case *sensitive* manner. If so, return that there was a substring + // match. + // + // e) If the word was not entirely lowercase, then attempt a camel cased match as + // well. + // + // f) The word is all lower case. Is it a case insensitive substring of the candidate starting + // on a part boundary of the candidate? + // + // Only if all words have some sort of match is the pattern considered matched. var subWordTextChunks = segment.subWordTextChunks; var matches = undefined; for (var _i = 0; _i < subWordTextChunks.length; _i++) { var subWordTextChunk = subWordTextChunks[_i]; + // Try to match the candidate with this word var result = matchTextChunk(candidate, subWordTextChunk, true); if (!result) { return undefined; @@ -25777,6 +30536,7 @@ var ts; var patternPartStart = patternSpan ? patternSpan.start : 0; var patternPartLength = patternSpan ? patternSpan.length : pattern.length; if (patternPartLength > candidateSpan.length) { + // Pattern part is longer than the candidate part. There can never be a match. return false; } if (ignoreCase) { @@ -25801,29 +30561,45 @@ var ts; } function tryCamelCaseMatch(candidate, candidateParts, chunk, ignoreCase) { var chunkCharacterSpans = chunk.characterSpans; + // Note: we may have more pattern parts than candidate parts. This is because multiple + // pattern parts may match a candidate part. For example "SiUI" against "SimpleUI". + // We'll have 3 pattern parts Si/U/I against two candidate parts Simple/UI. However, U + // and I will both match in UI. var currentCandidate = 0; var currentChunkSpan = 0; var firstMatch = undefined; var contiguous = undefined; while (true) { + // Let's consider our termination cases if (currentChunkSpan === chunkCharacterSpans.length) { + // We did match! We shall assign a weight to this var weight = 0; + // Was this contiguous? if (contiguous) { weight += 1; } + // Did we start at the beginning of the candidate? if (firstMatch === 0) { weight += 2; } return weight; } else if (currentCandidate === candidateParts.length) { + // No match, since we still have more of the pattern to hit return undefined; } var candidatePart = candidateParts[currentCandidate]; var gotOneMatchThisCandidate = false; + // Consider the case of matching SiUI against SimpleUIElement. The candidate parts + // will be Simple/UI/Element, and the pattern parts will be Si/U/I. We'll match 'Si' + // against 'Simple' first. Then we'll match 'U' against 'UI'. However, we want to + // still keep matching pattern parts against that candidate part. for (; currentChunkSpan < chunkCharacterSpans.length; currentChunkSpan++) { var chunkCharacterSpan = chunkCharacterSpans[currentChunkSpan]; if (gotOneMatchThisCandidate) { + // We've already gotten one pattern part match in this candidate. We will + // only continue trying to consumer pattern parts if the last part and this + // part are both upper case. if (!isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan - 1].start)) || !isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan].start))) { break; @@ -25834,17 +30610,30 @@ var ts; } gotOneMatchThisCandidate = true; firstMatch = firstMatch === undefined ? currentCandidate : firstMatch; + // If we were contiguous, then keep that value. If we weren't, then keep that + // value. If we don't know, then set the value to 'true' as an initial match is + // obviously contiguous. contiguous = contiguous === undefined ? true : contiguous; candidatePart = ts.createTextSpan(candidatePart.start + chunkCharacterSpan.length, candidatePart.length - chunkCharacterSpan.length); } + // Check if we matched anything at all. If we didn't, then we need to unset the + // contiguous bit if we currently had it set. + // If we haven't set the bit yet, then that means we haven't matched anything so + // far, and we don't want to change that. if (!gotOneMatchThisCandidate && contiguous !== undefined) { contiguous = false; } + // Move onto the next candidate. currentCandidate++; } } } ts.createPatternMatcher = createPatternMatcher; + // 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 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, match2) { return compareType(match1, match2) || compareCamelCase(match1, match2) || @@ -25852,6 +30641,8 @@ var ts; comparePunctuation(match1, match2); } function comparePunctuation(result1, result2) { + // Consider a match to be better if it was successful without stripping punctuation + // versus a match that had to strip punctuation to succeed. if (result1.punctuationStripped !== result2.punctuationStripped) { return result1.punctuationStripped ? 1 : -1; } @@ -25868,6 +30659,8 @@ var ts; } function compareCamelCase(result1, result2) { if (result1.kind === PatternMatchKind.camelCase && result2.kind === PatternMatchKind.camelCase) { + // Swap the values here. If result1 has a higher weight, then we want it to come + // first. return result2.camelCaseWeight - result1.camelCaseWeight; } return 0; @@ -25878,26 +30671,33 @@ var ts; subWordTextChunks: breakPatternIntoTextChunks(text) }; } + // A segment is considered invalid if we couldn't find any words in it. function segmentIsInvalid(segment) { return segment.subWordTextChunks.length === 0; } function isUpperCaseLetter(ch) { - if (ch >= 65 && ch <= 90) { + // Fast check for the ascii range. + if (ch >= 65 /* A */ && ch <= 90 /* Z */) { return true; } - if (ch < 127 || !ts.isUnicodeIdentifierStart(ch, 2)) { + if (ch < 127 /* maxAsciiCharacter */ || !ts.isUnicodeIdentifierStart(ch, 2 /* Latest */)) { return false; } + // TODO: find a way to determine this for any unicode characters in a + // non-allocating manner. var str = String.fromCharCode(ch); return str === str.toUpperCase(); } function isLowerCaseLetter(ch) { - if (ch >= 97 && ch <= 122) { + // Fast check for the ascii range. + if (ch >= 97 /* a */ && ch <= 122 /* z */) { return true; } - if (ch < 127 || !ts.isUnicodeIdentifierStart(ch, 2)) { + if (ch < 127 /* maxAsciiCharacter */ || !ts.isUnicodeIdentifierStart(ch, 2 /* Latest */)) { return false; } + // TODO: find a way to determine this for any unicode characters in a + // non-allocating manner. var str = String.fromCharCode(ch); return str === str.toLowerCase(); } @@ -25917,6 +30717,7 @@ var ts; } return true; } + // Assumes 'value' is already lowercase. function indexOfIgnoringCase(string, value) { for (var i = 0, n = string.length - value.length; i <= n; i++) { if (startsWithIgnoringCase(string, value, i)) { @@ -25925,6 +30726,7 @@ var ts; } return -1; } + // Assumes 'value' is already lowercase. function startsWithIgnoringCase(string, value, start) { for (var i = 0, n = value.length; i < n; i++) { var ch1 = toLowerCase(string.charCodeAt(i + start)); @@ -25936,19 +30738,23 @@ var ts; return true; } function toLowerCase(ch) { - if (ch >= 65 && ch <= 90) { - return 97 + (ch - 65); + // Fast convert for the ascii range. + if (ch >= 65 /* A */ && ch <= 90 /* Z */) { + return 97 /* a */ + (ch - 65 /* A */); } - if (ch < 127) { + if (ch < 127 /* maxAsciiCharacter */) { return ch; } + // TODO: find a way to compute this for any unicode characters in a + // non-allocating manner. return String.fromCharCode(ch).toLowerCase().charCodeAt(0); } function isDigit(ch) { - return ch >= 48 && ch <= 57; + // TODO(cyrusn): Find a way to support this for unicode digits. + return ch >= 48 /* _0 */ && ch <= 57 /* _9 */; } function isWordChar(ch) { - return isUpperCaseLetter(ch) || isLowerCaseLetter(ch) || isDigit(ch) || ch === 95 || ch === 36; + return isUpperCaseLetter(ch) || isLowerCaseLetter(ch) || isDigit(ch) || ch === 95 /* _ */ || ch === 36 /* $ */; } function breakPatternIntoTextChunks(pattern) { var result = []; @@ -25982,11 +30788,11 @@ var ts; characterSpans: breakIntoCharacterSpans(text) }; } - function breakIntoCharacterSpans(identifier) { + /* @internal */ function breakIntoCharacterSpans(identifier) { return breakIntoSpans(identifier, false); } ts.breakIntoCharacterSpans = breakIntoCharacterSpans; - function breakIntoWordSpans(identifier) { + /* @internal */ function breakIntoWordSpans(identifier) { return breakIntoSpans(identifier, true); } ts.breakIntoWordSpans = breakIntoWordSpans; @@ -26016,29 +30822,29 @@ var ts; } function charIsPunctuation(ch) { switch (ch) { - case 33: - case 34: - case 35: - case 37: - case 38: - case 39: - case 40: - case 41: - case 42: - case 44: - case 45: - case 46: - case 47: - case 58: - case 59: - case 63: - case 64: - case 91: - case 92: - case 93: - case 95: - case 123: - case 125: + case 33 /* exclamation */: + case 34 /* doubleQuote */: + case 35 /* hash */: + case 37 /* percent */: + case 38 /* ampersand */: + case 39 /* singleQuote */: + case 40 /* openParen */: + case 41 /* closeParen */: + case 42 /* asterisk */: + case 44 /* comma */: + case 45 /* minus */: + case 46 /* dot */: + case 47 /* slash */: + case 58 /* colon */: + case 59 /* semicolon */: + case 63 /* question */: + case 64 /* at */: + case 91 /* openBracket */: + case 92 /* backslash */: + case 93 /* closeBracket */: + case 95 /* _ */: + case 123 /* openBrace */: + case 125 /* closeBrace */: return true; } return false; @@ -26046,7 +30852,8 @@ var ts; function isAllPunctuation(identifier, start, end) { for (var i = start; i < end; i++) { var ch = identifier.charCodeAt(i); - if (!charIsPunctuation(ch) || ch === 95 || ch === 36) { + // We don't consider _ or $ as punctuation as there may be things with that name. + if (!charIsPunctuation(ch) || ch === 95 /* _ */ || ch === 36 /* $ */) { return false; } } @@ -26054,11 +30861,25 @@ var ts; } function transitionFromUpperToLower(identifier, word, index, wordStart) { if (word) { + // Cases this supports: + // 1) IDisposable -> I, Disposable + // 2) UIElement -> UI, Element + // 3) HTMLDocument -> HTML, Document + // + // etc. if (index != wordStart && index + 1 < identifier.length) { var currentIsUpper = isUpperCaseLetter(identifier.charCodeAt(index)); var nextIsLower = isLowerCaseLetter(identifier.charCodeAt(index + 1)); if (currentIsUpper && nextIsLower) { + // We have a transition from an upper to a lower letter here. But we only + // want to break if all the letters that preceded are uppercase. i.e. if we + // have "Foo" we don't want to break that into "F, oo". But if we have + // "IFoo" or "UIFoo", then we want to break that into "I, Foo" and "UI, + // Foo". i.e. the last uppercase letter belongs to the lowercase letters + // that follows. Note: this will make the following not split properly: + // "HELLOthere". However, these sorts of names do not show up in .Net + // programs. for (var i = wordStart; i < index; i++) { if (!isUpperCaseLetter(identifier.charCodeAt(i))) { return false; @@ -26073,6 +30894,19 @@ var ts; function transitionFromLowerToUpper(identifier, word, index) { var lastIsUpper = isUpperCaseLetter(identifier.charCodeAt(index - 1)); var currentIsUpper = isUpperCaseLetter(identifier.charCodeAt(index)); + // See if the casing indicates we're starting a new word. Note: if we're breaking on + // words, then just seeing an upper case character isn't enough. Instead, it has to + // be uppercase and the previous character can't be uppercase. + // + // For example, breaking "AddMetadata" on words would make: Add Metadata + // + // on characters would be: A dd M etadata + // + // Break "AM" on words would be: AM + // + // on characters would be: A M + // + // We break the search string on characters. But we break the symbol name on words. var transition = word ? (currentIsUpper && !lastIsUpper) : currentIsUpper; @@ -26080,10 +30914,143 @@ var ts; } })(ts || (ts = {})); /// +/* @internal */ var ts; (function (ts) { var SignatureHelp; (function (SignatureHelp) { + // A partially written generic type expression is not guaranteed to have the correct syntax tree. the expression could be parsed as less than/greater than expression or a comma expression + // or some other combination depending on what the user has typed so far. For the purposes of signature help we need to consider any location after "<" as a possible generic type reference. + // To do this, the method will back parse the expression starting at the position required. it will try to parse the current expression as a generic type expression, if it did succeed it + // will return the generic identifier that started the expression (e.g. "foo" in "foo(#a, b) -> The token introduces a list, and should begin a sig help session + // Case 2: + // fo#o#(a, b)# -> The token is either not associated with a list, or ends a list, so the session should end + // Case 3: + // foo(a#, #b#) -> The token is buried inside a list, and should give sig help + // Find out if 'node' is an argument, a type argument, or neither + if (node.kind === 24 /* LessThanToken */ || + node.kind === 16 /* OpenParenToken */) { + // Find the list that starts right *after* the < or ( token. + // If the user has just opened a list, consider this item 0. var list = getChildListThatStartsWithOpenerToken(callExpression, node, sourceFile); var isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === list.pos; ts.Debug.assert(list !== undefined); return { - kind: isTypeArgList ? 0 : 1, + kind: isTypeArgList ? 0 /* TypeArguments */ : 1 /* CallArguments */, invocation: callExpression, argumentsSpan: getApplicableSpanForArguments(list), argumentIndex: 0, argumentCount: getArgumentCount(list) }; } + // findListItemInfo can return undefined if we are not in parent's argument list + // or type argument list. This includes cases where the cursor is: + // - To the right of the closing paren, non-substitution template, or template tail. + // - Between the type arguments and the arguments (greater than token) + // - On the target of the call (parent.func) + // - On the 'new' keyword in a 'new' expression var listItemInfo = ts.findListItemInfo(node); if (listItemInfo) { var list = listItemInfo.list; @@ -26133,7 +31172,7 @@ var ts; var argumentCount = getArgumentCount(list); ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); return { - kind: isTypeArgList ? 0 : 1, + kind: isTypeArgList ? 0 /* TypeArguments */ : 1 /* CallArguments */, invocation: callExpression, argumentsSpan: getApplicableSpanForArguments(list), argumentIndex: argumentIndex, @@ -26141,24 +31180,27 @@ var ts; }; } } - else if (node.kind === 10 && node.parent.kind === 159) { + else if (node.kind === 10 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 159 /* TaggedTemplateExpression */) { + // Check if we're actually inside the template; + // otherwise we'll fall out and return undefined. if (ts.isInsideTemplateLiteral(node, position)) { return getArgumentListInfoForTemplate(node.parent, 0); } } - else if (node.kind === 11 && node.parent.parent.kind === 159) { + else if (node.kind === 11 /* TemplateHead */ && node.parent.parent.kind === 159 /* TaggedTemplateExpression */) { var templateExpression = node.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 171); + ts.Debug.assert(templateExpression.kind === 171 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex); } - else if (node.parent.kind === 176 && node.parent.parent.parent.kind === 159) { + else if (node.parent.kind === 176 /* TemplateSpan */ && node.parent.parent.parent.kind === 159 /* TaggedTemplateExpression */) { var templateSpan = node.parent; var templateExpression = templateSpan.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 171); - if (node.kind === 13 && !ts.isInsideTemplateLiteral(node, position)) { + ts.Debug.assert(templateExpression.kind === 171 /* TemplateExpression */); + // If we're just after a template tail, don't show signature help. + if (node.kind === 13 /* TemplateTail */ && !ts.isInsideTemplateLiteral(node, position)) { return undefined; } var spanIndex = templateExpression.templateSpans.indexOf(templateSpan); @@ -26168,6 +31210,17 @@ var ts; return undefined; } function getArgumentIndex(argumentsList, node) { + // The list we got back can include commas. In the presence of errors it may + // also just have nodes without commas. For example "Foo(a b c)" will have 3 + // args without commas. We want to find what index we're at. So we count + // forward until we hit ourselves, only incrementing the index if it isn't a + // comma. + // + // Note: the subtlety around trailing commas (in getArgumentCount) does not apply + // here. That's because we're only walking forward until we hit the node we're + // on. In that case, even if we're after the trailing comma, we'll still see + // that trailing comma in the list, and we'll have generated the appropriate + // arg index. var argumentIndex = 0; var listChildren = argumentsList.getChildren(); for (var _i = 0; _i < listChildren.length; _i++) { @@ -26175,21 +31228,45 @@ var ts; if (child === node) { break; } - if (child.kind !== 23) { + if (child.kind !== 23 /* CommaToken */) { argumentIndex++; } } return argumentIndex; } function getArgumentCount(argumentsList) { + // The argument count for a list is normally the number of non-comma children it has. + // For example, if you have "Foo(a,b)" then there will be three children of the arg + // list 'a' '' 'b'. So, in this case the arg count will be 2. However, there + // is a small subtlety. If you have "Foo(a,)", then the child list will just have + // 'a' ''. So, in the case where the last child is a comma, we increase the + // arg count by one to compensate. + // + // Note: this subtlety only applies to the last comma. If you had "Foo(a,," then + // we'll have: 'a' '' '' + // That will give us 2 non-commas. We then add one for the last comma, givin us an + // arg count of 3. var listChildren = argumentsList.getChildren(); - var argumentCount = ts.countWhere(listChildren, function (arg) { return arg.kind !== 23; }); - if (listChildren.length > 0 && ts.lastOrUndefined(listChildren).kind === 23) { + var argumentCount = ts.countWhere(listChildren, function (arg) { return arg.kind !== 23 /* CommaToken */; }); + if (listChildren.length > 0 && ts.lastOrUndefined(listChildren).kind === 23 /* CommaToken */) { argumentCount++; } return argumentCount; } + // spanIndex is either the index for a given template span. + // This does not give appropriate results for a NoSubstitutionTemplateLiteral function getArgumentIndexForTemplatePiece(spanIndex, node) { + // Because the TemplateStringsArray is the first argument, we have to offset each substitution expression by 1. + // There are three cases we can encounter: + // 1. We are precisely in the template literal (argIndex = 0). + // 2. We are in or to the right of the substitution expression (argIndex = spanIndex + 1). + // 3. We are directly to the right of the template literal, but because we look for the token on the left, + // not enough to put us in the substitution expression; we should consider ourselves part of + // the *next* span's expression by offsetting the index (argIndex = (spanIndex + 1) + 1). + // + // Example: f `# abcd $#{# 1 + 1# }# efghi ${ #"#hello"# } # ` + // ^ ^ ^ ^ ^ ^ ^ ^ ^ + // Case: 1 1 3 2 1 3 2 2 1 ts.Debug.assert(position >= node.getStart(), "Assumed 'position' could not occur before node."); if (ts.isTemplateLiteralKind(node.kind)) { if (ts.isInsideTemplateLiteral(node, position)) { @@ -26200,12 +31277,13 @@ var ts; return spanIndex + 1; } function getArgumentListInfoForTemplate(tagExpression, argumentIndex) { - var argumentCount = tagExpression.template.kind === 10 + // argumentCount is either 1 or (numSpans + 1) to account for the template strings array argument. + var argumentCount = tagExpression.template.kind === 10 /* NoSubstitutionTemplateLiteral */ ? 1 : tagExpression.template.templateSpans.length + 1; ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); return { - kind: 2, + kind: 2 /* TaggedTemplateArguments */, invocation: tagExpression, argumentsSpan: getApplicableSpanForTaggedTemplate(tagExpression), argumentIndex: argumentIndex, @@ -26213,6 +31291,14 @@ var ts; }; } function getApplicableSpanForArguments(argumentsList) { + // We use full start and skip trivia on the end because we want to include trivia on + // both sides. For example, + // + // foo( /*comment */ a, b, c /*comment*/ ) + // | | + // + // The applicable span is from the first bar to the second bar (inclusive, + // but not including parentheses) var applicableSpanStart = argumentsList.getFullStart(); var applicableSpanEnd = ts.skipTrivia(sourceFile.text, argumentsList.getEnd(), false); return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); @@ -26221,7 +31307,16 @@ var ts; var template = taggedTemplate.template; var applicableSpanStart = template.getStart(); var applicableSpanEnd = template.getEnd(); - if (template.kind === 171) { + // We need to adjust the end position for the case where the template does not have a tail. + // Otherwise, we will not show signature help past the expression. + // For example, + // + // ` ${ 1 + 1 foo(10) + // | | + // + // This is because a Missing node has no width. However, what we actually want is to include trivia + // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. + if (template.kind === 171 /* TemplateExpression */) { var lastSpan = ts.lastOrUndefined(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, false); @@ -26230,10 +31325,12 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node) { - for (var n = node; n.kind !== 227; n = n.parent) { + for (var n = node; n.kind !== 227 /* SourceFile */; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } + // If the node is not a subspan of its parent, this is a big problem. + // There have been crashes that might be caused by this violation. 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); } @@ -26250,6 +31347,14 @@ var ts; ts.Debug.assert(indexOfOpenerToken >= 0 && children.length > indexOfOpenerToken + 1); return children[indexOfOpenerToken + 1]; } + /** + * The selectedItemIndex could be negative for several reasons. + * 1. There are too many arguments for all of the overloads + * 2. None of the overloads were type compatible + * The solution here is to try to pick the best overload by picking + * either the first one that has an appropriate number of parameters, + * or the one with the most parameters. + */ function selectBestInvalidOverloadIndex(candidates, argumentCount) { var maxParamsSignatureIndex = -1; var maxParams = -1; @@ -26267,11 +31372,11 @@ var ts; } function createSignatureHelpItems(candidates, bestSignature, argumentListInfo) { var applicableSpan = argumentListInfo.argumentsSpan; - var isTypeParameterList = argumentListInfo.kind === 0; + var isTypeParameterList = argumentListInfo.kind === 0 /* TypeArguments */; var invocation = argumentListInfo.invocation; var callTarget = ts.getInvokedExpression(invocation); - var callTargetSymbol = typeInfoResolver.getSymbolAtLocation(callTarget); - var callTargetDisplayParts = callTargetSymbol && ts.symbolToDisplayParts(typeInfoResolver, callTargetSymbol, undefined, undefined); + var callTargetSymbol = typeChecker.getSymbolAtLocation(callTarget); + var callTargetDisplayParts = callTargetSymbol && ts.symbolToDisplayParts(typeChecker, callTargetSymbol, undefined, undefined); var items = ts.map(candidates, function (candidateSignature) { var signatureHelpParameters; var prefixDisplayParts = []; @@ -26280,39 +31385,40 @@ var ts; prefixDisplayParts.push.apply(prefixDisplayParts, callTargetDisplayParts); } if (isTypeParameterList) { - prefixDisplayParts.push(ts.punctuationPart(24)); + prefixDisplayParts.push(ts.punctuationPart(24 /* LessThanToken */)); var typeParameters = candidateSignature.typeParameters; signatureHelpParameters = typeParameters && typeParameters.length > 0 ? ts.map(typeParameters, createSignatureHelpParameterForTypeParameter) : emptyArray; - suffixDisplayParts.push(ts.punctuationPart(25)); + suffixDisplayParts.push(ts.punctuationPart(25 /* GreaterThanToken */)); var parameterParts = ts.mapToDisplayParts(function (writer) { - return typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, invocation); + return typeChecker.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, invocation); }); suffixDisplayParts.push.apply(suffixDisplayParts, parameterParts); } else { var typeParameterParts = ts.mapToDisplayParts(function (writer) { - return typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation); + return typeChecker.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation); }); prefixDisplayParts.push.apply(prefixDisplayParts, typeParameterParts); - prefixDisplayParts.push(ts.punctuationPart(16)); + prefixDisplayParts.push(ts.punctuationPart(16 /* OpenParenToken */)); var parameters = candidateSignature.parameters; signatureHelpParameters = parameters.length > 0 ? ts.map(parameters, createSignatureHelpParameterForParameter) : emptyArray; - suffixDisplayParts.push(ts.punctuationPart(17)); + suffixDisplayParts.push(ts.punctuationPart(17 /* CloseParenToken */)); } var returnTypeParts = ts.mapToDisplayParts(function (writer) { - return typeInfoResolver.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation); + return typeChecker.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation); }); suffixDisplayParts.push.apply(suffixDisplayParts, returnTypeParts); return { isVariadic: candidateSignature.hasRestParameter, prefixDisplayParts: prefixDisplayParts, suffixDisplayParts: suffixDisplayParts, - separatorDisplayParts: [ts.punctuationPart(23), ts.spacePart()], + separatorDisplayParts: [ts.punctuationPart(23 /* CommaToken */), ts.spacePart()], parameters: signatureHelpParameters, documentation: candidateSignature.getDocumentationComment() }; }); var argumentIndex = argumentListInfo.argumentIndex; + // argumentCount is the *apparent* number of arguments. var argumentCount = argumentListInfo.argumentCount; var selectedItemIndex = candidates.indexOf(bestSignature); if (selectedItemIndex < 0) { @@ -26328,7 +31434,7 @@ var ts; }; function createSignatureHelpParameterForParameter(parameter) { var displayParts = ts.mapToDisplayParts(function (writer) { - return typeInfoResolver.getSymbolDisplayBuilder().buildParameterDisplay(parameter, writer, invocation); + return typeChecker.getSymbolDisplayBuilder().buildParameterDisplay(parameter, writer, invocation); }); var isOptional = ts.hasQuestionToken(parameter.valueDeclaration); return { @@ -26340,7 +31446,7 @@ var ts; } function createSignatureHelpParameterForTypeParameter(typeParameter) { var displayParts = ts.mapToDisplayParts(function (writer) { - return typeInfoResolver.getSymbolDisplayBuilder().buildTypeParameterDisplay(typeParameter, writer, invocation); + return typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(typeParameter, writer, invocation); }); return { name: typeParameter.symbol.name, @@ -26354,6 +31460,8 @@ var ts; SignatureHelp.getSignatureHelpItems = getSignatureHelpItems; })(SignatureHelp = ts.SignatureHelp || (ts.SignatureHelp = {})); })(ts || (ts = {})); +// These utilities are common to multiple language service features. +/* @internal */ var ts; (function (ts) { function getEndLinePosition(line, sourceFile) { @@ -26361,12 +31469,19 @@ var ts; var lineStarts = sourceFile.getLineStarts(); var lineIndex = line; if (lineIndex + 1 === lineStarts.length) { + // last line - return EOF return sourceFile.text.length - 1; } else { + // current line start var start = lineStarts[lineIndex]; + // take the start position of the next line -1 = it should be some line break var pos = lineStarts[lineIndex + 1] - 1; ts.Debug.assert(ts.isLineBreak(sourceFile.text.charCodeAt(pos))); + // walk backwards skipping line breaks, stop the the beginning of current line. + // i.e: + // + // $ <- end of line for this position should match the start position while (start <= pos && ts.isLineBreak(sourceFile.text.charCodeAt(pos))) { pos--; } @@ -26411,107 +31526,116 @@ var ts; 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: + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + case 204 /* EnumDeclaration */: + case 154 /* ObjectLiteralExpression */: + case 150 /* ObjectBindingPattern */: + case 145 /* TypeLiteral */: + case 179 /* Block */: + case 206 /* ModuleBlock */: + case 207 /* CaseBlock */: + return nodeEndsWith(n, 15 /* CloseBraceToken */, sourceFile); + case 223 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 158: + case 158 /* NewExpression */: if (!n.arguments) { return true; } - case 157: - case 161: - case 149: - return nodeEndsWith(n, 17, sourceFile); - case 142: - case 143: + // fall through + case 157 /* CallExpression */: + case 161 /* ParenthesizedExpression */: + case 149 /* ParenthesizedType */: + return nodeEndsWith(n, 17 /* CloseParenToken */, sourceFile); + case 142 /* FunctionType */: + case 143 /* ConstructorType */: 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: + case 135 /* Constructor */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 139 /* ConstructSignature */: + case 138 /* CallSignature */: + case 163 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } if (n.type) { return isCompletedNode(n.type, sourceFile); } - return hasChildOfKind(n, 17, sourceFile); - case 205: + // Even though type parameters can be unclosed, we can get away with + // having at least a closing paren. + return hasChildOfKind(n, 17 /* CloseParenToken */, sourceFile); + case 205 /* ModuleDeclaration */: return n.body && isCompletedNode(n.body, sourceFile); - case 183: + case 183 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 182: + case 182 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile); - case 153: - case 151: - case 156: - case 127: - case 147: - return nodeEndsWith(n, 19, sourceFile); - case 140: + case 153 /* ArrayLiteralExpression */: + case 151 /* ArrayBindingPattern */: + case 156 /* ElementAccessExpression */: + case 127 /* ComputedPropertyName */: + case 147 /* TupleType */: + return nodeEndsWith(n, 19 /* CloseBracketToken */, sourceFile); + case 140 /* IndexSignature */: if (n.type) { return isCompletedNode(n.type, sourceFile); } - return hasChildOfKind(n, 19, sourceFile); - case 220: - case 221: + return hasChildOfKind(n, 19 /* CloseBracketToken */, sourceFile); + case 220 /* CaseClause */: + case 221 /* DefaultClause */: + // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicitly always consider them non-completed return false; - case 186: - case 187: - case 188: - case 185: + case 186 /* ForStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: + case 185 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 184: - var hasWhileKeyword = findChildOfKind(n, 100, sourceFile); + case 184 /* DoStatement */: + // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; + var hasWhileKeyword = findChildOfKind(n, 100 /* WhileKeyword */, sourceFile); if (hasWhileKeyword) { - return nodeEndsWith(n, 17, sourceFile); + return nodeEndsWith(n, 17 /* CloseParenToken */, sourceFile); } return isCompletedNode(n.statement, sourceFile); - case 144: + case 144 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 165: - case 164: - case 166: - case 172: - case 173: + case 165 /* TypeOfExpression */: + case 164 /* DeleteExpression */: + case 166 /* VoidExpression */: + case 172 /* YieldExpression */: + case 173 /* SpreadElementExpression */: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 159: + case 159 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 171: + case 171 /* TemplateExpression */: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 176: + case 176 /* TemplateSpan */: return ts.nodeIsPresent(n.literal); - case 167: + case 167 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 169: + case 169 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 170: + case 170 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; } } ts.isCompletedNode = isCompletedNode; + /* + * Checks if node ends with 'expectedLastToken'. + * If child at position 'length - 1' is 'SemicolonToken' it is skipped and 'expectedLastToken' is compared with child at position 'length - 2'. + */ function nodeEndsWith(n, expectedLastToken, sourceFile) { var children = n.getChildren(sourceFile); if (children.length) { @@ -26519,7 +31643,7 @@ var ts; if (last.kind === expectedLastToken) { return true; } - else if (last.kind === 22 && children.length !== 1) { + else if (last.kind === 22 /* SemicolonToken */ && children.length !== 1) { return children[children.length - 2].kind === expectedLastToken; } } @@ -26527,6 +31651,10 @@ var ts; } function findListItemInfo(node) { var list = findContainingList(node); + // It is possible at this point for syntaxList to be undefined, either if + // node.parent had no list child, or if none of its list children contained + // the span of node. If this happens, return undefined. The caller should + // handle this case. if (!list) { return undefined; } @@ -26547,43 +31675,60 @@ var ts; } ts.findChildOfKind = findChildOfKind; function findContainingList(node) { + // The node might be a list element (nonsynthetic) or a comma (synthetic). Either way, it will + // be parented by the container of the SyntaxList, not the SyntaxList itself. + // In order to find the list item index, we first need to locate SyntaxList itself and then search + // for the position of the relevant node (or comma). var syntaxList = ts.forEach(node.parent.getChildren(), function (c) { - if (c.kind === 228 && c.pos <= node.pos && c.end >= node.end) { + // find syntax list that covers the span of the node + if (c.kind === 228 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { return c; } }); + // Either we didn't find an appropriate list, or the list must contain us. ts.Debug.assert(!syntaxList || ts.contains(syntaxList.getChildren(), node)); return syntaxList; } ts.findContainingList = findContainingList; + /* Gets the token whose text has range [start, end) and + * position >= start and (position < end or (position === end && token is keyword or identifier)) + */ function getTouchingWord(sourceFile, position) { return getTouchingToken(sourceFile, position, function (n) { return isWord(n.kind); }); } ts.getTouchingWord = getTouchingWord; + /* Gets the token whose text has range [start, end) and position >= start + * and (position < end or (position === end && token is keyword or identifier or numeric\string litera)) + */ function getTouchingPropertyName(sourceFile, position) { return getTouchingToken(sourceFile, position, function (n) { return isPropertyName(n.kind); }); } ts.getTouchingPropertyName = getTouchingPropertyName; + /** Returns the token if position is in [start, end) or if position === end and includeItemAtEndPosition(token) === true */ function getTouchingToken(sourceFile, position, includeItemAtEndPosition) { return getTokenAtPositionWorker(sourceFile, position, false, includeItemAtEndPosition); } ts.getTouchingToken = getTouchingToken; + /** Returns a token if position is in [start-of-leading-trivia, end) */ function getTokenAtPosition(sourceFile, position) { return getTokenAtPositionWorker(sourceFile, position, true, undefined); } ts.getTokenAtPosition = getTokenAtPosition; + /** Get the token whose text contains the position */ function getTokenAtPositionWorker(sourceFile, position, allowPositionInLeadingTrivia, includeItemAtEndPosition) { var current = sourceFile; outer: while (true) { if (isToken(current)) { + // exit early return current; } + // find the child that contains 'position' for (var i = 0, n = current.getChildCount(sourceFile); i < n; i++) { var child = current.getChildAt(i); var start = allowPositionInLeadingTrivia ? child.getFullStart() : child.getStart(sourceFile); if (start <= position) { var end = child.getEnd(); - if (position < end || (position === end && child.kind === 1)) { + if (position < end || (position === end && child.kind === 1 /* EndOfFileToken */)) { current = child; continue outer; } @@ -26598,7 +31743,17 @@ var ts; return current; } } + /** + * The token on the left of the position is the token that strictly includes the position + * or sits to the left of the cursor if it is on a boundary. For example + * + * fo|o -> will return foo + * foo |bar -> will return foo + * + */ function findTokenOnLeftOfPosition(file, position) { + // Ideally, getTokenAtPosition should return a token. However, it is currently + // broken, so we do a check to make sure the result was indeed a token. var tokenAtPosition = getTokenAtPosition(file, position); if (isToken(tokenAtPosition) && position > tokenAtPosition.getStart(file) && position < tokenAtPosition.getEnd()) { return tokenAtPosition; @@ -26610,12 +31765,16 @@ var ts; return find(parent); function find(n) { if (isToken(n) && n.pos === previousToken.end) { + // this is token that starts at the end of previous token - return it return n; } var children = n.getChildren(); for (var _i = 0; _i < children.length; _i++) { var child = children[_i]; - var shouldDiveInChildNode = (child.pos <= previousToken.pos && child.end > previousToken.end) || + var shouldDiveInChildNode = + // previous token is enclosed somewhere in the child + (child.pos <= previousToken.pos && child.end > previousToken.end) || + // previous token ends exactly at the beginning of child (child.pos === previousToken.end); if (shouldDiveInChildNode && nodeHasTokens(child)) { return find(child); @@ -26645,21 +31804,28 @@ var ts; if (nodeHasTokens(child)) { if (position <= child.end) { if (child.getStart(sourceFile) >= position) { + // actual start of the node is past the position - previous token should be at the end of previous child var candidate = findRightmostChildNodeWithTokens(children, i); return candidate && findRightmostToken(candidate); } else { + // candidate should be in this node return find(child); } } } } - ts.Debug.assert(startNode !== undefined || n.kind === 227); + ts.Debug.assert(startNode !== undefined || n.kind === 227 /* SourceFile */); + // Here we know that none of child token nodes embrace the position, + // the only known case is when position is at the end of the file. + // Try to find the rightmost token in the file without filtering. + // Namely we are skipping the check: 'position < node.end' if (children.length) { var candidate = findRightmostChildNodeWithTokens(children, children.length); return candidate && findRightmostToken(candidate); } } + /// finds last node that is considered as candidate for search (isCandidate(node) === true) starting from 'exclusiveStartPosition' function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) { for (var i = exclusiveStartPosition - 1; i >= 0; --i) { if (nodeHasTokens(children[i])) { @@ -26670,20 +31836,22 @@ var ts; } ts.findPrecedingToken = findPrecedingToken; function nodeHasTokens(n) { + // If we have a token or node that has a non-zero width, it must have tokens. + // Note, that getWidth() does not take trivia into account. return n.getWidth() !== 0; } function getNodeModifiers(node) { var flags = ts.getCombinedNodeFlags(node); var result = []; - if (flags & 32) + if (flags & 32 /* Private */) result.push(ts.ScriptElementKindModifier.privateMemberModifier); - if (flags & 64) + if (flags & 64 /* Protected */) result.push(ts.ScriptElementKindModifier.protectedMemberModifier); - if (flags & 16) + if (flags & 16 /* Public */) result.push(ts.ScriptElementKindModifier.publicMemberModifier); - if (flags & 128) + if (flags & 128 /* Static */) result.push(ts.ScriptElementKindModifier.staticModifier); - if (flags & 1) + if (flags & 1 /* Export */) result.push(ts.ScriptElementKindModifier.exportedModifier); if (ts.isInAmbientContext(node)) result.push(ts.ScriptElementKindModifier.ambientModifier); @@ -26691,32 +31859,32 @@ var ts; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 141 || node.kind === 157) { + if (node.kind === 141 /* TypeReference */ || node.kind === 157 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 201 || node.kind === 202) { + if (ts.isFunctionLike(node) || node.kind === 201 /* ClassDeclaration */ || node.kind === 202 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; } ts.getTypeArgumentOrTypeParameterList = getTypeArgumentOrTypeParameterList; function isToken(n) { - return n.kind >= 0 && n.kind <= 125; + return n.kind >= 0 /* FirstToken */ && n.kind <= 125 /* LastToken */; } ts.isToken = isToken; function isWord(kind) { - return kind === 65 || ts.isKeyword(kind); + return kind === 65 /* Identifier */ || ts.isKeyword(kind); } ts.isWord = isWord; function isPropertyName(kind) { - return kind === 8 || kind === 7 || isWord(kind); + return kind === 8 /* StringLiteral */ || kind === 7 /* NumericLiteral */ || isWord(kind); } function isComment(kind) { - return kind === 2 || kind === 3; + return kind === 2 /* SingleLineCommentTrivia */ || kind === 3 /* MultiLineCommentTrivia */; } ts.isComment = isComment; function isPunctuation(kind) { - return 14 <= kind && kind <= 64; + return 14 /* FirstPunctuation */ <= kind && kind <= 64 /* LastPunctuation */; } ts.isPunctuation = isPunctuation; function isInsideTemplateLiteral(node, position) { @@ -26726,9 +31894,9 @@ var ts; ts.isInsideTemplateLiteral = isInsideTemplateLiteral; function isAccessibilityModifier(kind) { switch (kind) { - case 109: - case 107: - case 108: + case 108 /* PublicKeyword */: + case 106 /* PrivateKeyword */: + case 107 /* ProtectedKeyword */: return true; } return false; @@ -26751,10 +31919,12 @@ var ts; } ts.compareDataObjects = compareDataObjects; })(ts || (ts = {})); +// Display-part writer helpers +/* @internal */ var ts; (function (ts) { function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 129; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 129 /* Parameter */; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -26809,46 +31979,46 @@ var ts; return displayPart(text, displayPartKind(symbol), symbol); function displayPartKind(symbol) { var flags = symbol.flags; - if (flags & 3) { + if (flags & 3 /* Variable */) { return isFirstDeclarationOfSymbolParameter(symbol) ? ts.SymbolDisplayPartKind.parameterName : ts.SymbolDisplayPartKind.localName; } - else if (flags & 4) { + else if (flags & 4 /* Property */) { return ts.SymbolDisplayPartKind.propertyName; } - else if (flags & 32768) { + else if (flags & 32768 /* GetAccessor */) { return ts.SymbolDisplayPartKind.propertyName; } - else if (flags & 65536) { + else if (flags & 65536 /* SetAccessor */) { return ts.SymbolDisplayPartKind.propertyName; } - else if (flags & 8) { + else if (flags & 8 /* EnumMember */) { return ts.SymbolDisplayPartKind.enumMemberName; } - else if (flags & 16) { + else if (flags & 16 /* Function */) { return ts.SymbolDisplayPartKind.functionName; } - else if (flags & 32) { + else if (flags & 32 /* Class */) { return ts.SymbolDisplayPartKind.className; } - else if (flags & 64) { + else if (flags & 64 /* Interface */) { return ts.SymbolDisplayPartKind.interfaceName; } - else if (flags & 384) { + else if (flags & 384 /* Enum */) { return ts.SymbolDisplayPartKind.enumName; } - else if (flags & 1536) { + else if (flags & 1536 /* Module */) { return ts.SymbolDisplayPartKind.moduleName; } - else if (flags & 8192) { + else if (flags & 8192 /* Method */) { return ts.SymbolDisplayPartKind.methodName; } - else if (flags & 262144) { + else if (flags & 262144 /* TypeParameter */) { return ts.SymbolDisplayPartKind.typeParameterName; } - else if (flags & 524288) { + else if (flags & 524288 /* TypeAlias */) { return ts.SymbolDisplayPartKind.aliasName; } - else if (flags & 8388608) { + else if (flags & 8388608 /* Alias */) { return ts.SymbolDisplayPartKind.aliasName; } return ts.SymbolDisplayPartKind.text; @@ -26918,14 +32088,19 @@ var ts; }); } ts.signatureToDisplayParts = signatureToDisplayParts; + function isJavaScript(fileName) { + return ts.fileExtensionIs(fileName, ".js"); + } + ts.isJavaScript = isJavaScript; })(ts || (ts = {})); /// /// +/* @internal */ var ts; (function (ts) { var formatting; (function (formatting) { - var scanner = ts.createScanner(2, false); + var scanner = ts.createScanner(2 /* Latest */, false); var ScanAction; (function (ScanAction) { ScanAction[ScanAction["Scan"] = 0] = "Scan"; @@ -26958,7 +32133,7 @@ var ts; if (isStarted) { if (trailingTrivia) { ts.Debug.assert(trailingTrivia.length !== 0); - wasNewLine = trailingTrivia[trailingTrivia.length - 1].kind === 4; + wasNewLine = trailingTrivia[trailingTrivia.length - 1].kind === 4 /* NewLineTrivia */; } else { wasNewLine = false; @@ -26971,13 +32146,15 @@ var ts; } var t; var pos = scanner.getStartPos(); + // Read leading trivia and token while (pos < endPos) { var t_2 = scanner.getToken(); if (!ts.isTrivia(t_2)) { break; } + // consume leading trivia scanner.scan(); - var item_4 = { + var item = { pos: pos, end: scanner.getStartPos(), kind: t_2 @@ -26986,79 +32163,90 @@ var ts; if (!leadingTrivia) { leadingTrivia = []; } - leadingTrivia.push(item_4); + leadingTrivia.push(item); } savedPos = scanner.getStartPos(); } function shouldRescanGreaterThanToken(node) { if (node) { switch (node.kind) { - case 27: - case 60: - case 61: - case 42: - case 41: + case 27 /* GreaterThanEqualsToken */: + case 60 /* GreaterThanGreaterThanEqualsToken */: + case 61 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 42 /* GreaterThanGreaterThanGreaterThanToken */: + case 41 /* GreaterThanGreaterThanToken */: return true; } } return false; } function shouldRescanSlashToken(container) { - return container.kind === 9; + return container.kind === 9 /* RegularExpressionLiteral */; } function shouldRescanTemplateToken(container) { - return container.kind === 12 || - container.kind === 13; + return container.kind === 12 /* TemplateMiddle */ || + container.kind === 13 /* TemplateTail */; } function startsWithSlashToken(t) { - return t === 36 || t === 57; + return t === 36 /* SlashToken */ || t === 57 /* SlashEqualsToken */; } function readTokenInfo(n) { if (!isOnToken()) { + // scanner is not on the token (either advance was not called yet or scanner is already past the end position) return { leadingTrivia: leadingTrivia, trailingTrivia: undefined, token: undefined }; } + // normally scanner returns the smallest available token + // check the kind of context node to determine if scanner should have more greedy behavior and consume more text. var expectedScanAction = shouldRescanGreaterThanToken(n) - ? 1 + ? 1 /* RescanGreaterThanToken */ : shouldRescanSlashToken(n) - ? 2 + ? 2 /* RescanSlashToken */ : shouldRescanTemplateToken(n) - ? 3 - : 0; + ? 3 /* RescanTemplateToken */ + : 0 /* Scan */; if (lastTokenInfo && expectedScanAction === lastScanAction) { + // readTokenInfo was called before with the same expected scan action. + // No need to re-scan text, return existing 'lastTokenInfo' + // it is ok to call fixTokenKind here since it does not affect + // what portion of text is consumed. In opposize rescanning can change it, + // i.e. for '>=' when originally scanner eats just one character + // and rescanning forces it to consume more. return fixTokenKind(lastTokenInfo, n); } if (scanner.getStartPos() !== savedPos) { ts.Debug.assert(lastTokenInfo !== undefined); + // readTokenInfo was called before but scan action differs - rescan text scanner.setTextPos(savedPos); scanner.scan(); } var currentToken = scanner.getToken(); - if (expectedScanAction === 1 && currentToken === 25) { + if (expectedScanAction === 1 /* RescanGreaterThanToken */ && currentToken === 25 /* GreaterThanToken */) { currentToken = scanner.reScanGreaterToken(); ts.Debug.assert(n.kind === currentToken); - lastScanAction = 1; + lastScanAction = 1 /* RescanGreaterThanToken */; } - else if (expectedScanAction === 2 && startsWithSlashToken(currentToken)) { + else if (expectedScanAction === 2 /* RescanSlashToken */ && startsWithSlashToken(currentToken)) { currentToken = scanner.reScanSlashToken(); ts.Debug.assert(n.kind === currentToken); - lastScanAction = 2; + lastScanAction = 2 /* RescanSlashToken */; } - else if (expectedScanAction === 3 && currentToken === 15) { + else if (expectedScanAction === 3 /* RescanTemplateToken */ && currentToken === 15 /* CloseBraceToken */) { currentToken = scanner.reScanTemplateToken(); - lastScanAction = 3; + lastScanAction = 3 /* RescanTemplateToken */; } else { - lastScanAction = 0; + lastScanAction = 0 /* Scan */; } var token = { pos: scanner.getStartPos(), end: scanner.getTextPos(), kind: currentToken }; + // consume trailing trivia if (trailingTrivia) { trailingTrivia = undefined; } @@ -27076,7 +32264,8 @@ var ts; trailingTrivia = []; } trailingTrivia.push(trivia); - if (currentToken === 4) { + if (currentToken === 4 /* NewLineTrivia */) { + // move past new line scanner.scan(); break; } @@ -27091,8 +32280,12 @@ 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); + return startPos < endPos && current !== 1 /* EndOfFileToken */ && !ts.isTrivia(current); } + // when containing node in the tree is token + // but its kind differs from the kind that was returned by the scanner, + // then kind needs to be fixed. This might happen in cases + // when parser interprets token differently, i.e keyword treated as identifier function fixTokenKind(tokenInfo, container) { if (ts.isToken(container) && tokenInfo.token.kind !== container.kind) { tokenInfo.token.kind = container.kind; @@ -27103,21 +32296,8 @@ 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. -// /// +/* @internal */ var ts; (function (ts) { var formatting; @@ -27138,6 +32318,7 @@ var ts; this.nextTokenSpan = nextRange; this.nextTokenParent = nextTokenParent; this.contextNode = commonParent; + // drop cached results this.contextNodeAllOnSameLine = undefined; this.nextNodeAllOnSameLine = undefined; this.tokensAreOnSameLine = undefined; @@ -27182,8 +32363,8 @@ var ts; return startLine == endLine; }; FormattingContext.prototype.BlockIsOnOneLine = function (node) { - var openBrace = ts.findChildOfKind(node, 14, this.sourceFile); - var closeBrace = ts.findChildOfKind(node, 15, this.sourceFile); + var openBrace = ts.findChildOfKind(node, 14 /* OpenBraceToken */, this.sourceFile); + var closeBrace = ts.findChildOfKind(node, 15 /* CloseBraceToken */, this.sourceFile); if (openBrace && closeBrace) { var startLine = this.sourceFile.getLineAndCharacterOfPosition(openBrace.getEnd()).line; var endLine = this.sourceFile.getLineAndCharacterOfPosition(closeBrace.getStart(this.sourceFile)).line; @@ -27196,21 +32377,8 @@ 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. -// /// +/* @internal */ var ts; (function (ts) { var formatting; @@ -27225,28 +32393,15 @@ 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. -// /// +/* @internal */ var ts; (function (ts) { var formatting; (function (formatting) { var Rule = (function () { function Rule(Descriptor, Operation, Flag) { - if (Flag === void 0) { Flag = 0; } + if (Flag === void 0) { Flag = 0 /* None */; } this.Descriptor = Descriptor; this.Operation = Operation; this.Flag = Flag; @@ -27261,21 +32416,8 @@ 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. -// /// +/* @internal */ var ts; (function (ts) { var formatting; @@ -27289,21 +32431,8 @@ 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. -// /// +/* @internal */ var ts; (function (ts) { var formatting; @@ -27334,21 +32463,8 @@ 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. -// /// +/* @internal */ var ts; (function (ts) { var formatting; @@ -27360,21 +32476,8 @@ 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. -// /// +/* @internal */ var ts; (function (ts) { var formatting; @@ -27402,21 +32505,8 @@ 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. -// /// +/* @internal */ var ts; (function (ts) { var formatting; @@ -27450,21 +32540,8 @@ 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. -// /// +/* @internal */ var ts; (function (ts) { var formatting; @@ -27474,74 +32551,113 @@ var ts; /// /// 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)); - this.NoSpaceBeforeColon = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 51), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8)); - this.NoSpaceBeforeQuestionMark = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 50), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8)); - this.SpaceAfterColon = new formatting.Rule(formatting.RuleDescriptor.create3(51, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 2)); - this.SpaceAfterQuestionMarkInConditionalOperator = new formatting.Rule(formatting.RuleDescriptor.create3(50, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsConditionalOperatorContext), 2)); - 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, 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)); - this.NoSpaceBeforeOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.NoSpaceAfterOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create3(18, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.NoSpaceBeforeCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 19), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.NoSpaceAfterCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create3(19, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); + // Leave comments alone + this.IgnoreBeforeComment = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.Comments), formatting.RuleOperation.create1(1 /* Ignore */)); + this.IgnoreAfterLineComment = new formatting.Rule(formatting.RuleDescriptor.create3(2 /* SingleLineCommentTrivia */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create1(1 /* Ignore */)); + // Space after keyword but not before ; or : or ? + this.NoSpaceBeforeSemicolon = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 22 /* SemicolonToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeColon = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 51 /* ColonToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8 /* Delete */)); + this.NoSpaceBeforeQuestionMark = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 50 /* QuestionToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8 /* Delete */)); + this.SpaceAfterColon = new formatting.Rule(formatting.RuleDescriptor.create3(51 /* ColonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 2 /* Space */)); + this.SpaceAfterQuestionMarkInConditionalOperator = new formatting.Rule(formatting.RuleDescriptor.create3(50 /* QuestionToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsConditionalOperatorContext), 2 /* Space */)); + this.NoSpaceAfterQuestionMark = new formatting.Rule(formatting.RuleDescriptor.create3(50 /* QuestionToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.SpaceAfterSemicolon = new formatting.Rule(formatting.RuleDescriptor.create3(22 /* SemicolonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + // Space after }. + this.SpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(15 /* CloseBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsAfterCodeBlockContext), 2 /* Space */)); + // Special case for (}, else) and (}, while) since else & while tokens are not part of the tree which makes SpaceAfterCloseBrace rule not applied + this.SpaceBetweenCloseBraceAndElse = new formatting.Rule(formatting.RuleDescriptor.create1(15 /* CloseBraceToken */, 76 /* ElseKeyword */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.SpaceBetweenCloseBraceAndWhile = new formatting.Rule(formatting.RuleDescriptor.create1(15 /* CloseBraceToken */, 100 /* WhileKeyword */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(15 /* CloseBraceToken */, formatting.Shared.TokenRange.FromTokens([17 /* CloseParenToken */, 19 /* CloseBracketToken */, 23 /* CommaToken */, 22 /* SemicolonToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + // No space for indexer and dot + this.NoSpaceBeforeDot = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20 /* DotToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterDot = new formatting.Rule(formatting.RuleDescriptor.create3(20 /* DotToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18 /* OpenBracketToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create3(18 /* OpenBracketToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 19 /* CloseBracketToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create3(19 /* CloseBracketToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + // Place a space before open brace in a function declaration 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([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, 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)); - this.NoSpaceBetweenEmptyBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(14, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectContext), 8)); - this.NewLineAfterOpenBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create3(14, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4)); - this.NewLineBeforeCloseBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.AnyIncludingMultilineComments, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4)); - this.NoSpaceAfterUnaryPrefixOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.UnaryPrefixOperators, formatting.Shared.TokenRange.UnaryPrefixExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8)); - this.NoSpaceAfterUnaryPreincrementOperator = new formatting.Rule(formatting.RuleDescriptor.create3(38, formatting.Shared.TokenRange.UnaryPreincrementExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.NoSpaceAfterUnaryPredecrementOperator = new formatting.Rule(formatting.RuleDescriptor.create3(39, formatting.Shared.TokenRange.UnaryPredecrementExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.NoSpaceBeforeUnaryPostincrementOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.UnaryPostincrementExpressions, 38), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.NoSpaceBeforeUnaryPostdecrementOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.UnaryPostdecrementExpressions, 39), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceAfterPostincrementWhenFollowedByAdd = new formatting.Rule(formatting.RuleDescriptor.create1(38, 33), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); - this.SpaceAfterAddWhenFollowedByUnaryPlus = new formatting.Rule(formatting.RuleDescriptor.create1(33, 33), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); - this.SpaceAfterAddWhenFollowedByPreincrement = new formatting.Rule(formatting.RuleDescriptor.create1(33, 38), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); - this.SpaceAfterPostdecrementWhenFollowedBySubtract = new formatting.Rule(formatting.RuleDescriptor.create1(39, 34), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); - 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([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(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(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(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, 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)); - this.NoSpaceAfterOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(24, formatting.Shared.TokenRange.TypeNames), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); - this.NoSpaceBeforeCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 25), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); - this.NoSpaceAfterCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(25, formatting.Shared.TokenRange.FromTokens([16, 18, 25, 23])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); - this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(14, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectTypeContext), 8)); + this.SpaceBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2 /* Space */), 1 /* CanDeleteNewLines */); + // Place a space before open brace in a TypeScript declaration that has braces as children (class, module, enum, etc) + this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([65 /* Identifier */, 3 /* MultiLineCommentTrivia */]); + this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2 /* Space */), 1 /* CanDeleteNewLines */); + // Place a space before open brace in a control flow construct + this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([17 /* CloseParenToken */, 3 /* MultiLineCommentTrivia */, 75 /* DoKeyword */, 96 /* TryKeyword */, 81 /* FinallyKeyword */, 76 /* ElseKeyword */]); + this.SpaceBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2 /* Space */), 1 /* CanDeleteNewLines */); + // Insert a space after { and before } in single-line contexts, but remove space from empty object literals {}. + this.SpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(14 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2 /* Space */)); + this.SpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 15 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2 /* Space */)); + this.NoSpaceBetweenEmptyBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(14 /* OpenBraceToken */, 15 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectContext), 8 /* Delete */)); + // Insert new line after { and before } in multi-line contexts. + this.NewLineAfterOpenBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create3(14 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4 /* NewLine */)); + // For functions and control block place } on a new line [multi-line rule] + this.NewLineBeforeCloseBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.AnyIncludingMultilineComments, 15 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4 /* NewLine */)); + // Special handling of unary operators. + // Prefix operators generally shouldn't have a space between + // them and their target unary expression. + this.NoSpaceAfterUnaryPrefixOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.UnaryPrefixOperators, formatting.Shared.TokenRange.UnaryPrefixExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8 /* Delete */)); + this.NoSpaceAfterUnaryPreincrementOperator = new formatting.Rule(formatting.RuleDescriptor.create3(38 /* PlusPlusToken */, formatting.Shared.TokenRange.UnaryPreincrementExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterUnaryPredecrementOperator = new formatting.Rule(formatting.RuleDescriptor.create3(39 /* MinusMinusToken */, formatting.Shared.TokenRange.UnaryPredecrementExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeUnaryPostincrementOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.UnaryPostincrementExpressions, 38 /* PlusPlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeUnaryPostdecrementOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.UnaryPostdecrementExpressions, 39 /* MinusMinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + // More unary operator special-casing. + // DevDiv 181814: Be careful when removing leading whitespace + // around unary operators. Examples: + // 1 - -2 --X--> 1--2 + // a + ++b --X--> a+++b + this.SpaceAfterPostincrementWhenFollowedByAdd = new formatting.Rule(formatting.RuleDescriptor.create1(38 /* PlusPlusToken */, 33 /* PlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterAddWhenFollowedByUnaryPlus = new formatting.Rule(formatting.RuleDescriptor.create1(33 /* PlusToken */, 33 /* PlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterAddWhenFollowedByPreincrement = new formatting.Rule(formatting.RuleDescriptor.create1(33 /* PlusToken */, 38 /* PlusPlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterPostdecrementWhenFollowedBySubtract = new formatting.Rule(formatting.RuleDescriptor.create1(39 /* MinusMinusToken */, 34 /* MinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterSubtractWhenFollowedByUnaryMinus = new formatting.Rule(formatting.RuleDescriptor.create1(34 /* MinusToken */, 34 /* MinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterSubtractWhenFollowedByPredecrement = new formatting.Rule(formatting.RuleDescriptor.create1(34 /* MinusToken */, 39 /* MinusMinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.NoSpaceBeforeComma = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 23 /* CommaToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.SpaceAfterCertainKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([98 /* VarKeyword */, 94 /* ThrowKeyword */, 88 /* NewKeyword */, 74 /* DeleteKeyword */, 90 /* ReturnKeyword */, 97 /* TypeOfKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([104 /* LetKeyword */, 70 /* ConstKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2 /* Space */)); + this.NoSpaceBeforeOpenParenInFuncCall = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionCallOrNewContext, Rules.IsPreviousTokenNotComma), 8 /* Delete */)); + this.SpaceAfterFunctionInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create3(83 /* FunctionKeyword */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); + this.NoSpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionDeclContext), 8 /* Delete */)); + this.SpaceAfterVoidOperator = new formatting.Rule(formatting.RuleDescriptor.create3(99 /* VoidKeyword */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsVoidOpContext), 2 /* Space */)); + this.NoSpaceBetweenReturnAndSemicolon = new formatting.Rule(formatting.RuleDescriptor.create1(90 /* ReturnKeyword */, 22 /* SemicolonToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + // Add a space between statements. All keywords except (do,else,case) has open/close parens after them. + // So, we have a rule to add a space for [),Any], [do,Any], [else,Any], and [case,Any] + this.SpaceBetweenStatements = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([17 /* CloseParenToken */, 75 /* DoKeyword */, 76 /* ElseKeyword */, 67 /* CaseKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotForContext), 2 /* Space */)); + // This low-pri rule takes care of "try {" and "finally {" in case the rule SpaceBeforeOpenBraceInControl didn't execute on FormatOnEnter. + this.SpaceAfterTryFinally = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([96 /* TryKeyword */, 81 /* FinallyKeyword */]), 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + // get x() {} + // set x(val) {} + this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([116 /* GetKeyword */, 120 /* SetKeyword */]), 65 /* Identifier */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); + // Special case for binary operators (that are keywords). For these we have to add a space and shouldn't follow any user options. + this.SpaceBeforeBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryKeywordOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryKeywordOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + // TypeScript-specific higher priority rules + // Treat constructor as an identifier in a function declaration, and remove spaces between constructor and following left parentheses + this.NoSpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(114 /* ConstructorKeyword */, 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + // Use of module as a function call. e.g.: import m2 = module("m2"); + this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([117 /* ModuleKeyword */, 118 /* RequireKeyword */]), 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + // Add a space around certain TypeScript keywords + this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([69 /* ClassKeyword */, 115 /* DeclareKeyword */, 77 /* EnumKeyword */, 78 /* ExportKeyword */, 79 /* ExtendsKeyword */, 116 /* GetKeyword */, 102 /* ImplementsKeyword */, 85 /* ImportKeyword */, 103 /* InterfaceKeyword */, 117 /* ModuleKeyword */, 106 /* PrivateKeyword */, 108 /* PublicKeyword */, 120 /* SetKeyword */, 109 /* StaticKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([79 /* ExtendsKeyword */, 102 /* ImplementsKeyword */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { + this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(8 /* StringLiteral */, 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2 /* Space */)); + // Lambda expressions + this.SpaceAfterArrow = new formatting.Rule(formatting.RuleDescriptor.create3(32 /* EqualsGreaterThanToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + // Optional parameters and let args + this.NoSpaceAfterEllipsis = new formatting.Rule(formatting.RuleDescriptor.create1(21 /* DotDotDotToken */, 65 /* Identifier */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterOptionalParameters = new formatting.Rule(formatting.RuleDescriptor.create3(50 /* QuestionToken */, formatting.Shared.TokenRange.FromTokens([17 /* CloseParenToken */, 23 /* CommaToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8 /* Delete */)); + // generics + this.NoSpaceBeforeOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.TypeNames, 24 /* LessThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8 /* Delete */)); + this.NoSpaceBetweenCloseParenAndAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create1(17 /* CloseParenToken */, 24 /* LessThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8 /* Delete */)); + this.NoSpaceAfterOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(24 /* LessThanToken */, formatting.Shared.TokenRange.TypeNames), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8 /* Delete */)); + this.NoSpaceBeforeCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 25 /* GreaterThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8 /* Delete */)); + this.NoSpaceAfterCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(25 /* GreaterThanToken */, formatting.Shared.TokenRange.FromTokens([16 /* OpenParenToken */, 18 /* OpenBracketToken */, 25 /* GreaterThanToken */, 23 /* CommaToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8 /* Delete */)); + // Remove spaces in empty interface literals. e.g.: x: {} + this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(14 /* OpenBraceToken */, 15 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectTypeContext), 8 /* Delete */)); + // decorators + this.SpaceBeforeAt = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 52 /* AtToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.NoSpaceAfterAt = new formatting.Rule(formatting.RuleDescriptor.create3(52 /* AtToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([65 /* Identifier */, 78 /* ExportKeyword */, 73 /* DefaultKeyword */, 69 /* ClassKeyword */, 109 /* StaticKeyword */, 108 /* PublicKeyword */, 106 /* PrivateKeyword */, 107 /* ProtectedKeyword */, 116 /* GetKeyword */, 120 /* SetKeyword */, 18 /* OpenBracketToken */, 35 /* AsteriskToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2 /* Space */)); + // These rules are higher in priority than user-configurable rules. this.HighPriorityCommonRules = [ this.IgnoreBeforeComment, this.IgnoreAfterLineComment, @@ -27565,6 +32681,7 @@ var ts; this.NoSpaceBeforeOpenParenInFuncCall, this.SpaceBeforeBinaryKeywordOperator, this.SpaceAfterBinaryKeywordOperator, this.SpaceAfterVoidOperator, + // TypeScript-specific rules this.NoSpaceAfterConstructor, this.NoSpaceAfterModuleImport, this.SpaceAfterCertainTypeScriptKeywords, this.SpaceBeforeCertainTypeScriptKeywords, this.SpaceAfterModuleName, @@ -27576,8 +32693,12 @@ var ts; this.NoSpaceBetweenCloseParenAndAngularBracket, this.NoSpaceAfterOpenAngularBracket, this.NoSpaceBeforeCloseAngularBracket, - this.NoSpaceAfterCloseAngularBracket + this.NoSpaceAfterCloseAngularBracket, + this.SpaceBeforeAt, + this.NoSpaceAfterAt, + this.SpaceAfterDecorator, ]; + // These rules are lower in priority than user-configurable rules. this.LowPriorityCommonRules = [ this.NoSpaceBeforeSemicolon, @@ -27589,60 +32710,81 @@ var ts; this.NoSpaceBeforeOpenParenInFuncDecl, this.SpaceBetweenStatements, this.SpaceAfterTryFinally ]; - this.SpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(23, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.NoSpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(23, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); - this.SpaceAfterBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); - this.NoSpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 8)); - this.NoSpaceAfterBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 8)); - this.SpaceAfterKeywordInControl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Keywords, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext), 2)); - this.NoSpaceAfterKeywordInControl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Keywords, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext), 8)); - this.NewLineBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeMultilineBlockContext), 4), 1); - this.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsBeforeMultilineBlockContext), 4), 1); - this.NewLineBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsBeforeMultilineBlockContext), 4), 1); - this.SpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(22, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsForContext), 2)); - this.NoSpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(22, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsForContext), 8)); - this.SpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.SpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - 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(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 controlled by user options + /// + // Insert space after comma delimiter + this.SpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(23 /* CommaToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.NoSpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(23 /* CommaToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + // Insert space before and after binary operators + this.SpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.NoSpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 8 /* Delete */)); + this.NoSpaceAfterBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 8 /* Delete */)); + // Insert space after keywords in control flow statements + this.SpaceAfterKeywordInControl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Keywords, 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext), 2 /* Space */)); + this.NoSpaceAfterKeywordInControl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Keywords, 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext), 8 /* Delete */)); + // Open Brace braces after function + //TypeScript: Function can have return types, which can be made of tons of different token kinds + this.NewLineBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeMultilineBlockContext), 4 /* NewLine */), 1 /* CanDeleteNewLines */); + // Open Brace braces after TypeScript module/class/interface + this.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsBeforeMultilineBlockContext), 4 /* NewLine */), 1 /* CanDeleteNewLines */); + // Open Brace braces after control block + this.NewLineBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsBeforeMultilineBlockContext), 4 /* NewLine */), 1 /* CanDeleteNewLines */); + // Insert space after semicolon in for statement + this.SpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(22 /* SemicolonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsForContext), 2 /* Space */)); + this.NoSpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(22 /* SemicolonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsForContext), 8 /* Delete */)); + // Insert space after opening and before closing nonempty parenthesis + this.SpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(16 /* OpenParenToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.SpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17 /* CloseParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.NoSpaceBetweenParens = new formatting.Rule(formatting.RuleDescriptor.create1(16 /* OpenParenToken */, 17 /* CloseParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(16 /* OpenParenToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17 /* CloseParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + // Insert space after function keyword for anonymous functions + this.SpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(83 /* FunctionKeyword */, 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); + this.NoSpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(83 /* FunctionKeyword */, 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 8 /* Delete */)); } Rules.prototype.getRuleName = function (rule) { var o = this; - for (var name_19 in o) { - if (o[name_19] === rule) { - return name_19; + for (var name_23 in o) { + if (o[name_23] === rule) { + return name_23; } } throw new Error("Unknown rule"); }; + /// + /// Contexts + /// Rules.IsForContext = function (context) { - return context.contextNode.kind === 186; + return context.contextNode.kind === 186 /* ForStatement */; }; Rules.IsNotForContext = function (context) { return !Rules.IsForContext(context); }; Rules.IsBinaryOpContext = function (context) { switch (context.contextNode.kind) { - case 169: - case 170: + case 169 /* BinaryExpression */: + case 170 /* ConditionalExpression */: return true; - case 208: - case 198: - case 129: - 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; + // equal in import a = module('a'); + case 208 /* ImportEqualsDeclaration */: + // equal in let a = 0; + case 198 /* VariableDeclaration */: + // equal in p = 0; + case 129 /* Parameter */: + case 226 /* EnumMember */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + return context.currentTokenSpan.kind === 53 /* EqualsToken */ || context.nextTokenSpan.kind === 53 /* EqualsToken */; + // "in" keyword in for (let x in []) { } + case 187 /* ForInStatement */: + return context.currentTokenSpan.kind === 86 /* InKeyword */ || context.nextTokenSpan.kind === 86 /* InKeyword */; + // Technically, "of" is not a binary operator, but format it the same way as "in" + case 188 /* ForOfStatement */: + return context.currentTokenSpan.kind === 125 /* OfKeyword */ || context.nextTokenSpan.kind === 125 /* OfKeyword */; + case 152 /* BindingElement */: + return context.currentTokenSpan.kind === 53 /* EqualsToken */ || context.nextTokenSpan.kind === 53 /* EqualsToken */; } return false; }; @@ -27650,7 +32792,7 @@ var ts; return !Rules.IsBinaryOpContext(context); }; Rules.IsConditionalOperatorContext = function (context) { - return context.contextNode.kind === 170; + return context.contextNode.kind === 170 /* ConditionalExpression */; }; Rules.IsSameLineTokenOrBeforeMultilineBlockContext = function (context) { //// This check is mainly used inside SpaceBeforeOpenBraceInControl and SpaceBeforeOpenBraceInFunction. @@ -27671,6 +32813,7 @@ var ts; //// * ) 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); }; + // This check is done before an open brace in a control construct, a function, or a typescript block declaration Rules.IsBeforeMultilineBlockContext = function (context) { return Rules.IsBeforeBlockContext(context) && !(context.NextNodeAllOnSameLine() || context.NextNodeBlockIsOnOneLine()); }; @@ -27686,31 +32829,38 @@ var ts; Rules.IsBeforeBlockContext = function (context) { return Rules.NodeIsBlockContext(context.nextTokenParent); }; + // IMPORTANT!!! This method must return true ONLY for nodes with open and close braces as immediate children Rules.NodeIsBlockContext = function (node) { if (Rules.NodeIsTypeScriptDeclWithBlockContext(node)) { + // This means we are in a context that looks like a block to the user, but in the grammar is actually not a node (it's a class, module, enum, object type literal, etc). return true; } switch (node.kind) { - case 179: - case 207: - case 154: - case 206: + case 179 /* Block */: + case 207 /* CaseBlock */: + case 154 /* ObjectLiteralExpression */: + case 206 /* ModuleBlock */: return true; } return false; }; Rules.IsFunctionDeclContext = function (context) { switch (context.contextNode.kind) { - case 200: - case 134: - case 133: - case 136: - case 137: - case 138: - case 162: - case 135: - case 163: - case 202: + case 200 /* FunctionDeclaration */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + //case SyntaxKind.MemberFunctionDeclaration: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + ///case SyntaxKind.MethodSignature: + case 138 /* CallSignature */: + case 162 /* FunctionExpression */: + case 135 /* Constructor */: + case 163 /* ArrowFunction */: + //case SyntaxKind.ConstructorDeclaration: + //case SyntaxKind.SimpleArrowFunctionExpression: + //case SyntaxKind.ParenthesizedArrowFunctionExpression: + case 202 /* InterfaceDeclaration */: return true; } return false; @@ -27720,93 +32870,107 @@ var ts; }; Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) { switch (node.kind) { - case 201: - case 202: - case 204: - case 145: - case 205: + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + case 204 /* EnumDeclaration */: + case 145 /* TypeLiteral */: + case 205 /* ModuleDeclaration */: return true; } return false; }; Rules.IsAfterCodeBlockContext = function (context) { switch (context.currentTokenParent.kind) { - case 201: - case 205: - case 204: - case 179: - case 223: - case 206: - case 193: + case 201 /* ClassDeclaration */: + case 205 /* ModuleDeclaration */: + case 204 /* EnumDeclaration */: + case 179 /* Block */: + case 223 /* CatchClause */: + case 206 /* ModuleBlock */: + case 193 /* SwitchStatement */: return true; } return false; }; Rules.IsControlDeclContext = function (context) { switch (context.contextNode.kind) { - case 183: - case 193: - case 186: - case 187: - case 188: - case 185: - case 196: - case 184: - case 192: - case 223: + case 183 /* IfStatement */: + case 193 /* SwitchStatement */: + case 186 /* ForStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: + case 185 /* WhileStatement */: + case 196 /* TryStatement */: + case 184 /* DoStatement */: + case 192 /* WithStatement */: + // TODO + // case SyntaxKind.ElseClause: + case 223 /* CatchClause */: return true; default: return false; } }; Rules.IsObjectContext = function (context) { - return context.contextNode.kind === 154; + return context.contextNode.kind === 154 /* ObjectLiteralExpression */; }; Rules.IsFunctionCallContext = function (context) { - return context.contextNode.kind === 157; + return context.contextNode.kind === 157 /* CallExpression */; }; Rules.IsNewContext = function (context) { - return context.contextNode.kind === 158; + return context.contextNode.kind === 158 /* NewExpression */; }; Rules.IsFunctionCallOrNewContext = function (context) { return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context); }; Rules.IsPreviousTokenNotComma = function (context) { - return context.currentTokenSpan.kind !== 23; + return context.currentTokenSpan.kind !== 23 /* CommaToken */; }; Rules.IsSameLineTokenContext = function (context) { return context.TokensAreOnSameLine(); }; + Rules.IsEndOfDecoratorContextOnSameLine = function (context) { + return context.TokensAreOnSameLine() && + context.contextNode.decorators && + Rules.NodeIsInDecoratorContext(context.currentTokenParent) && + !Rules.NodeIsInDecoratorContext(context.nextTokenParent); + }; + Rules.NodeIsInDecoratorContext = function (node) { + while (ts.isExpression(node)) { + node = node.parent; + } + return node.kind === 130 /* Decorator */; + }; Rules.IsStartOfVariableDeclarationList = function (context) { - return context.currentTokenParent.kind === 199 && + return context.currentTokenParent.kind === 199 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; }; Rules.IsNotFormatOnEnter = function (context) { - return context.formattingRequestKind != 2; + return context.formattingRequestKind != 2 /* FormatOnEnter */; }; Rules.IsModuleDeclContext = function (context) { - return context.contextNode.kind === 205; + return context.contextNode.kind === 205 /* ModuleDeclaration */; }; Rules.IsObjectTypeContext = function (context) { - return context.contextNode.kind === 145; + return context.contextNode.kind === 145 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; }; Rules.IsTypeArgumentOrParameter = function (token, parent) { - if (token.kind !== 24 && token.kind !== 25) { + if (token.kind !== 24 /* LessThanToken */ && token.kind !== 25 /* GreaterThanToken */) { 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 157: - case 158: + case 141 /* TypeReference */: + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 138 /* CallSignature */: + case 139 /* ConstructSignature */: + case 157 /* CallExpression */: + case 158 /* NewExpression */: return true; default: return false; @@ -27817,28 +32981,15 @@ var ts; Rules.IsTypeArgumentOrParameter(context.nextTokenSpan, context.nextTokenParent); }; Rules.IsVoidOpContext = function (context) { - return context.currentTokenSpan.kind === 99 && context.currentTokenParent.kind === 166; + return context.currentTokenSpan.kind === 99 /* VoidKeyword */ && context.currentTokenParent.kind === 166 /* VoidExpression */; }; 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. -// /// +/* @internal */ var ts; (function (ts) { var formatting; @@ -27854,9 +33005,10 @@ var ts; return result; }; RulesMap.prototype.Initialize = function (rules) { - this.mapRowLength = 125 + 1; - this.map = new Array(this.mapRowLength * this.mapRowLength); - var rulesBucketConstructionStateList = new Array(this.map.length); + this.mapRowLength = 125 /* LastToken */ + 1; + this.map = new Array(this.mapRowLength * this.mapRowLength); //new Array(this.mapRowLength * this.mapRowLength); + // This array is used only during construction of the rulesbucket in the map + var rulesBucketConstructionStateList = new Array(this.map.length); //new Array(this.map.length); this.FillRules(rules, rulesBucketConstructionStateList); return this.map; }; @@ -27868,6 +33020,7 @@ var ts; }; RulesMap.prototype.GetRuleBucketIndex = function (row, column) { var rulesBucketIndex = (row * this.mapRowLength) + column; + //Debug.Assert(rulesBucketIndex < this.map.Length, "Trying to access an index outside the array."); return rulesBucketIndex; }; RulesMap.prototype.FillRule = function (rule, rulesBucketConstructionStateList) { @@ -27914,6 +33067,21 @@ var ts; var RulesPosition = formatting.RulesPosition; var RulesBucketConstructionState = (function () { function RulesBucketConstructionState() { + //// The Rules list contains all the inserted rules into a rulebucket in the following order: + //// 1- Ignore rules with specific token combination + //// 2- Ignore rules with any token combination + //// 3- Context rules with specific token combination + //// 4- Context rules with any token combination + //// 5- Non-context rules with specific token combination + //// 6- Non-context rules with any token combination + //// + //// The member rulesInsertionIndexBitmap is used to describe the number of rules + //// in each sub-bucket (above) hence can be used to know the index of where to insert + //// the next rule. It's a bitmap which contains 6 different sections each is given 5 bits. + //// + //// Example: + //// In order to insert a rule to the end of sub-bucket (3), we get the index by adding + //// the values in the bitmap segments 3rd, 2nd, and 1st. this.rulesInsertionIndexBitmap = 0; } RulesBucketConstructionState.prototype.GetInsertionIndex = function (maskPosition) { @@ -27947,7 +33115,7 @@ var ts; }; RulesBucket.prototype.AddRule = function (rule, specificTokens, constructionState, rulesBucketIndex) { var position; - if (rule.Operation.Action == 1) { + if (rule.Operation.Action == 1 /* Ignore */) { position = specificTokens ? RulesPosition.IgnoreRulesSpecific : RulesPosition.IgnoreRulesAny; @@ -27975,21 +33143,8 @@ 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. -// /// +/* @internal */ var ts; (function (ts) { var formatting; @@ -28045,7 +33200,7 @@ var ts; } TokenAllAccess.prototype.GetTokens = function () { var result = []; - for (var token = 0; token <= 125; token++) { + for (var token = 0 /* FirstToken */; token <= 125 /* LastToken */; token++) { result.push(token); } return result; @@ -28086,38 +33241,24 @@ var ts; return this.tokenAccess.toString(); }; TokenRange.Any = TokenRange.AllTokens(); - TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([3])); - 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, 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([65, 119, 121, 113, 122, 99, 112]); + TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([3 /* MultiLineCommentTrivia */])); + TokenRange.Keywords = TokenRange.FromRange(66 /* FirstKeyword */, 125 /* LastKeyword */); + TokenRange.BinaryOperators = TokenRange.FromRange(24 /* FirstBinaryOperator */, 64 /* LastBinaryOperator */); + TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([86 /* InKeyword */, 87 /* InstanceOfKeyword */, 125 /* OfKeyword */]); + TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([38 /* PlusPlusToken */, 39 /* MinusMinusToken */, 47 /* TildeToken */, 46 /* ExclamationToken */]); + TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([7 /* NumericLiteral */, 65 /* Identifier */, 16 /* OpenParenToken */, 18 /* OpenBracketToken */, 14 /* OpenBraceToken */, 93 /* ThisKeyword */, 88 /* NewKeyword */]); + TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([65 /* Identifier */, 16 /* OpenParenToken */, 93 /* ThisKeyword */, 88 /* NewKeyword */]); + TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([65 /* Identifier */, 17 /* CloseParenToken */, 19 /* CloseBracketToken */, 88 /* NewKeyword */]); + TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([65 /* Identifier */, 16 /* OpenParenToken */, 93 /* ThisKeyword */, 88 /* NewKeyword */]); + TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([65 /* Identifier */, 17 /* CloseParenToken */, 19 /* CloseBracketToken */, 88 /* NewKeyword */]); + TokenRange.Comments = TokenRange.FromTokens([2 /* SingleLineCommentTrivia */, 3 /* MultiLineCommentTrivia */]); + TokenRange.TypeNames = TokenRange.FromTokens([65 /* Identifier */, 119 /* NumberKeyword */, 121 /* StringKeyword */, 113 /* BooleanKeyword */, 122 /* SymbolKeyword */, 99 /* VoidKeyword */, 112 /* AnyKeyword */]); 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. -// /// /// /// @@ -28130,21 +33271,8 @@ var 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. -// /// +/* @internal */ var ts; (function (ts) { var formatting; @@ -28234,6 +33362,7 @@ var ts; /// /// /// +/* @internal */ var ts; (function (ts) { var formatting; @@ -28247,19 +33376,22 @@ var ts; if (line === 0) { return []; } + // get the span for the previous\current line var span = { + // get start position for the previous line pos: ts.getStartPositionOfLine(line - 1, sourceFile), + // get end position for the current line (end value is exclusive so add 1 to the result) end: ts.getEndLinePosition(line, sourceFile) + 1 }; - return formatSpan(span, sourceFile, options, rulesProvider, 2); + return formatSpan(span, sourceFile, options, rulesProvider, 2 /* FormatOnEnter */); } formatting.formatOnEnter = formatOnEnter; function formatOnSemicolon(position, sourceFile, rulesProvider, options) { - return formatOutermostParent(position, 22, sourceFile, options, rulesProvider, 3); + return formatOutermostParent(position, 22 /* SemicolonToken */, sourceFile, options, rulesProvider, 3 /* FormatOnSemicolon */); } formatting.formatOnSemicolon = formatOnSemicolon; function formatOnClosingCurly(position, sourceFile, rulesProvider, options) { - return formatOutermostParent(position, 15, sourceFile, options, rulesProvider, 4); + return formatOutermostParent(position, 15 /* CloseBraceToken */, sourceFile, options, rulesProvider, 4 /* FormatOnClosingCurlyBrace */); } formatting.formatOnClosingCurly = formatOnClosingCurly; function formatDocument(sourceFile, rulesProvider, options) { @@ -28267,15 +33399,16 @@ var ts; pos: 0, end: sourceFile.text.length }; - return formatSpan(span, sourceFile, options, rulesProvider, 0); + return formatSpan(span, sourceFile, options, rulesProvider, 0 /* FormatDocument */); } formatting.formatDocument = formatDocument; function formatSelection(start, end, sourceFile, rulesProvider, options) { + // format from the beginning of the line var span = { pos: ts.getLineStartPositionForPosition(start, sourceFile), end: end }; - return formatSpan(span, sourceFile, options, rulesProvider, 1); + return formatSpan(span, sourceFile, options, rulesProvider, 1 /* FormatSelection */); } formatting.formatSelection = formatSelection; function formatOutermostParent(position, expectedLastToken, sourceFile, options, rulesProvider, requestKind) { @@ -28291,11 +33424,24 @@ var ts; } function findOutermostParent(position, expectedTokenKind, sourceFile) { var precedingToken = ts.findPrecedingToken(position, sourceFile); + // when it is claimed that trigger character was typed at given position + // we verify that there is a token with a matching kind whose end is equal to position (because the character was just typed). + // If this condition is not hold - then trigger character was typed in some other context, + // i.e.in comment and thus should not trigger autoformatting if (!precedingToken || precedingToken.kind !== expectedTokenKind || position !== precedingToken.getEnd()) { return undefined; } + // walk up and search for the parent node that ends at the same position with precedingToken. + // for cases like this + // + // let x = 1; + // while (true) { + // } + // after typing close curly in while statement we want to reformat just the while statement. + // However if we just walk upwards searching for the parent that has the same end value - + // we'll end up with the whole source file. isListElement allows to stop on the list element level var current = precedingToken; while (current && current.parent && @@ -28305,23 +33451,26 @@ var ts; } return current; } + // Returns true if node is a element in some list in parent + // i.e. parent is class declaration with the list of members and node is one of members. function isListElement(parent, node) { switch (parent.kind) { - case 201: - case 202: + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 205: + case 205 /* ModuleDeclaration */: var body = parent.body; - return body && body.kind === 179 && ts.rangeContainsRange(body.statements, node); - case 227: - case 179: - case 206: + return body && body.kind === 179 /* Block */ && ts.rangeContainsRange(body.statements, node); + case 227 /* SourceFile */: + case 179 /* Block */: + case 206 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 223: + case 223 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; } + /** find node that fully contains given text range */ function findEnclosingNode(range, sourceFile) { return find(sourceFile); function find(n) { @@ -28335,10 +33484,15 @@ var ts; return n; } } + /** formatting is not applied to ranges that contain parse errors. + * This function will return a predicate that for a given text range will tell + * if there are any parse errors that overlap with the range. + */ function prepareRangeContainsErrorFunction(errors, originalRange) { if (!errors.length) { return rangeHasNoErrors; } + // pick only errors that fall in range var sorted = errors .filter(function (d) { return ts.rangeOverlapsWithStartEnd(originalRange, d.start, d.start + d.length); }) .sort(function (e1, e2) { return e1.start - e2.start; }); @@ -28347,15 +33501,20 @@ var ts; } var index = 0; return function (r) { + // in current implementation sequence of arguments [r1, r2...] is monotonically increasing. + // 'index' tracks the index of the most recent error that was checked. while (true) { if (index >= sorted.length) { + // all errors in the range were already checked -> no error in specified range return false; } var error = sorted[index]; if (r.end <= error.start) { + // specified range ends before the error refered by 'index' - no error in range return false; } if (ts.startEndOverlapsWithStartEnd(r.pos, r.end, error.start, error.start + error.length)) { + // specified range overlaps with error range return true; } index++; @@ -28365,6 +33524,11 @@ var ts; return false; } } + /** + * Start of the original range might fall inside the comment - scanner will not yield appropriate results + * This function will look for token that is located before the start of target range + * and return its end as start position for the scanner. + */ function getScanStartPosition(enclosingNode, originalRange, sourceFile) { var start = enclosingNode.getStart(sourceFile); if (start === originalRange.pos && enclosingNode.end === originalRange.end) { @@ -28372,19 +33536,37 @@ var ts; } var precedingToken = ts.findPrecedingToken(originalRange.pos, sourceFile); if (!precedingToken) { + // no preceding token found - start from the beginning of enclosing node return enclosingNode.pos; } + // preceding token ends after the start of original range (i.e when originaRange.pos falls in the middle of literal) + // start from the beginning of enclosingNode to handle the entire 'originalRange' if (precedingToken.end >= originalRange.pos) { return enclosingNode.pos; } return precedingToken.end; } + /* + * For cases like + * if (a || + * b ||$ + * c) {...} + * If we hit Enter at $ we want line ' b ||' to be indented. + * Formatting will be applied to the last two lines. + * Node that fully encloses these lines is binary expression 'a ||...'. + * Initial indentation for this node will be 0. + * Binary expressions don't introduce new indentation scopes, however it is possible + * that some parent node on the same line does - like if statement in this case. + * Note that we are considering parents only from the same line with initial node - + * if parent is on the different line - its delta was already contributed + * to the initial indentation. + */ function getOwnOrInheritedDelta(n, options, sourceFile) { - var previousLine = -1; - var childKind = 0; + var previousLine = -1 /* Unknown */; + var childKind = 0 /* Unknown */; while (n) { var line = sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)).line; - if (previousLine !== -1 && line !== previousLine) { + if (previousLine !== -1 /* Unknown */ && line !== previousLine) { break; } if (formatting.SmartIndenter.shouldIndentChildNode(n.kind, childKind)) { @@ -28398,7 +33580,9 @@ var ts; } function formatSpan(originalRange, sourceFile, options, rulesProvider, requestKind) { var rangeContainsError = prepareRangeContainsErrorFunction(sourceFile.parseDiagnostics, originalRange); + // formatting context is used by rules provider var formattingContext = new formatting.FormattingContext(sourceFile, requestKind); + // find the smallest node that fully wraps the range and compute the initial indentation for the node var enclosingNode = findEnclosingNode(originalRange, sourceFile); var formattingScanner = formatting.getFormattingScanner(sourceFile, getScanStartPosition(enclosingNode, originalRange, sourceFile), originalRange.end); var initialIndentation = formatting.SmartIndenter.getIndentationForNode(enclosingNode, originalRange, sourceFile, options); @@ -28410,14 +33594,26 @@ var ts; formattingScanner.advance(); if (formattingScanner.isOnToken()) { var startLine = sourceFile.getLineAndCharacterOfPosition(enclosingNode.getStart(sourceFile)).line; + var undecoratedStartLine = startLine; + if (enclosingNode.decorators) { + undecoratedStartLine = sourceFile.getLineAndCharacterOfPosition(ts.getNonDecoratorTokenPosOfNode(enclosingNode, sourceFile)).line; + } var delta = getOwnOrInheritedDelta(enclosingNode, options, sourceFile); - processNode(enclosingNode, enclosingNode, startLine, initialIndentation, delta); + processNode(enclosingNode, enclosingNode, startLine, undecoratedStartLine, initialIndentation, delta); } formattingScanner.close(); return edits; + // local functions + /** Tries to compute the indentation for a list element. + * If list element is not in range then + * function will pick its actual indentation + * so it can be pushed downstream as inherited indentation. + * If list element is in the range - its indentation will be equal + * to inherited indentation from its predecessors. + */ function tryComputeIndentationForListItem(startPos, endPos, parentStartLine, range, inheritedIndentation) { if (ts.rangeOverlapsWithStartEnd(range, startPos, endPos)) { - if (inheritedIndentation !== -1) { + if (inheritedIndentation !== -1 /* Unknown */) { return inheritedIndentation; } } @@ -28429,16 +33625,20 @@ var ts; return column; } } - return -1; + return -1 /* Unknown */; } function computeIndentation(node, startLine, inheritedIndentation, parent, parentDynamicIndentation, effectiveParentStartLine) { var indentation = inheritedIndentation; - if (indentation === -1) { + if (indentation === -1 /* Unknown */) { if (isSomeBlock(node.kind)) { + // blocks should be indented in + // - other blocks + // - source file + // - switch\default clauses if (isSomeBlock(parent.kind) || - parent.kind === 227 || - parent.kind === 220 || - parent.kind === 221) { + parent.kind === 227 /* SourceFile */ || + parent.kind === 220 /* CaseClause */ || + parent.kind === 221 /* DefaultClause */) { indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); } else { @@ -28454,8 +33654,11 @@ var ts; } } } - var delta = formatting.SmartIndenter.shouldIndentChildNode(node.kind, 0) ? options.IndentSize : 0; + var delta = formatting.SmartIndenter.shouldIndentChildNode(node.kind, 0 /* Unknown */) ? options.IndentSize : 0; if (effectiveParentStartLine === startLine) { + // if node is located on the same line with the parent + // - inherit indentation from the parent + // - push children if either parent of node itself has non-zero delta indentation = parentDynamicIndentation.getIndentation(); delta = Math.min(options.IndentSize, parentDynamicIndentation.getDelta() + delta); } @@ -28469,18 +33672,19 @@ var ts; 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: + case 201 /* ClassDeclaration */: return 69 /* ClassKeyword */; + case 202 /* InterfaceDeclaration */: return 103 /* InterfaceKeyword */; + case 200 /* FunctionDeclaration */: return 83 /* FunctionKeyword */; + case 204 /* EnumDeclaration */: return 204 /* EnumDeclaration */; + case 136 /* GetAccessor */: return 116 /* GetKeyword */; + case 137 /* SetAccessor */: return 120 /* SetKeyword */; + case 134 /* MethodDeclaration */: if (node.asteriskToken) { - return 35; + return 35 /* AsteriskToken */; } - case 132: - case 129: + // fall-through + case 132 /* PropertyDeclaration */: + case 129 /* Parameter */: return node.name.kind; } } @@ -28488,8 +33692,12 @@ var ts; return { getIndentationForComment: function (kind) { switch (kind) { - case 15: - case 19: + // preceding comment to the token that closes the indentation scope inherits the indentation from the scope + // .. { + // // comment + // } + case 15 /* CloseBraceToken */: + case 19 /* CloseBracketToken */: return indentation + delta; } return indentation; @@ -28497,19 +33705,22 @@ var ts; getIndentationForToken: function (line, kind) { if (nodeStartLine !== line && node.decorators) { if (kind === getFirstNonDecoratorTokenOfNode(node)) { + // if this token is the first token following the list of decorators, we do not need to indent return indentation; } } switch (kind) { - case 14: - case 15: - case 18: - case 19: - case 76: - case 100: - case 52: + // open and close brace, 'else' and 'while' (in do statement) tokens has indentation of the parent + case 14 /* OpenBraceToken */: + case 15 /* CloseBraceToken */: + case 18 /* OpenBracketToken */: + case 19 /* CloseBracketToken */: + case 76 /* ElseKeyword */: + case 100 /* WhileKeyword */: + case 52 /* AtToken */: return indentation; default: + // if token line equals to the line of containing node (this is a first token in the node) - use node indentation return nodeStartLine !== line ? indentation + delta : indentation; } }, @@ -28523,7 +33734,7 @@ var ts; else { indentation -= options.IndentSize; } - if (formatting.SmartIndenter.shouldIndentChildNode(node.kind, 0)) { + if (formatting.SmartIndenter.shouldIndentChildNode(node.kind, 0 /* Unknown */)) { delta = options.IndentSize; } else { @@ -28533,17 +33744,31 @@ var ts; } }; } - function processNode(node, contextNode, nodeStartLine, indentation, delta) { + function processNode(node, contextNode, nodeStartLine, undecoratedNodeStartLine, indentation, delta) { if (!ts.rangeOverlapsWithStartEnd(originalRange, node.getStart(sourceFile), node.getEnd())) { return; } var nodeDynamicIndentation = getDynamicIndentation(node, nodeStartLine, indentation, delta); + // a useful observations when tracking context node + // / + // [a] + // / | \ + // [b] [c] [d] + // node 'a' is a context node for nodes 'b', 'c', 'd' + // except for the leftmost leaf token in [b] - in this case context node ('e') is located somewhere above 'a' + // this rule can be applied recursively to child nodes of 'a'. + // + // context node is set to parent node value after processing every child node + // context node is set to parent of the token after processing every token var childContextNode = contextNode; + // if there are any tokens that logically belong to node and interleave child nodes + // such tokens will be consumed in processChildNode for for the child that follows them ts.forEachChild(node, function (child) { - processChildNode(child, -1, node, nodeDynamicIndentation, nodeStartLine, false); + processChildNode(child, -1 /* Unknown */, node, nodeDynamicIndentation, nodeStartLine, undecoratedNodeStartLine, false); }, function (nodes) { processChildNodes(nodes, node, nodeStartLine, nodeDynamicIndentation); }); + // proceed any tokens in the node that are located after child nodes while (formattingScanner.isOnToken()) { var tokenInfo = formattingScanner.readTokenInfo(node); if (tokenInfo.token.end > node.end) { @@ -28551,16 +33776,22 @@ var ts; } consumeTokenAndAdvanceScanner(tokenInfo, node, nodeDynamicIndentation); } - function processChildNode(child, inheritedIndentation, parent, parentDynamicIndentation, parentStartLine, isListItem) { + function processChildNode(child, inheritedIndentation, parent, parentDynamicIndentation, parentStartLine, undecoratedParentStartLine, isListItem) { var childStartPos = child.getStart(sourceFile); - var childStart = sourceFile.getLineAndCharacterOfPosition(childStartPos); - var childIndentationAmount = -1; + var childStartLine = sourceFile.getLineAndCharacterOfPosition(childStartPos).line; + var undecoratedChildStartLine = childStartLine; + if (child.decorators) { + undecoratedChildStartLine = sourceFile.getLineAndCharacterOfPosition(ts.getNonDecoratorTokenPosOfNode(child, sourceFile)).line; + } + // if child is a list item - try to get its indentation + var childIndentationAmount = -1 /* Unknown */; if (isListItem) { childIndentationAmount = tryComputeIndentationForListItem(childStartPos, child.end, parentStartLine, originalRange, inheritedIndentation); - if (childIndentationAmount !== -1) { + if (childIndentationAmount !== -1 /* Unknown */) { inheritedIndentation = childIndentationAmount; } } + // child node is outside the target range - do not dive inside if (!ts.rangeOverlapsWithStartEnd(originalRange, child.pos, child.end)) { return inheritedIndentation; } @@ -28568,8 +33799,10 @@ var ts; return inheritedIndentation; } while (formattingScanner.isOnToken()) { + // proceed any parent tokens that are located prior to child.getStart() var tokenInfo = formattingScanner.readTokenInfo(node); if (tokenInfo.token.end > childStartPos) { + // stop when formatting scanner advances past the beginning of the child break; } consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); @@ -28578,13 +33811,15 @@ var ts; return inheritedIndentation; } if (ts.isToken(child)) { + // if child node is a token, it does not impact indentation, proceed it using parent indentation scope rules 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); - processNode(child, childContextNode, childStart.line, childIndentation.indentation, childIndentation.delta); + var effectiveParentStartLine = child.kind === 130 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); + processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); childContextNode = node; return inheritedIndentation; } @@ -28593,32 +33828,41 @@ var ts; var listEndToken = getCloseTokenForOpenToken(listStartToken); var listDynamicIndentation = parentDynamicIndentation; var startLine = parentStartLine; - if (listStartToken !== 0) { + if (listStartToken !== 0 /* Unknown */) { + // introduce a new indentation scope for lists (including list start and end tokens) while (formattingScanner.isOnToken()) { var tokenInfo = formattingScanner.readTokenInfo(parent); if (tokenInfo.token.end > nodes.pos) { + // stop when formatting scanner moves past the beginning of node list break; } else if (tokenInfo.token.kind === listStartToken) { + // consume list start token startLine = sourceFile.getLineAndCharacterOfPosition(tokenInfo.token.pos).line; - var indentation_1 = computeIndentation(tokenInfo.token, startLine, -1, parent, parentDynamicIndentation, startLine); + var indentation_1 = computeIndentation(tokenInfo.token, startLine, -1 /* Unknown */, parent, parentDynamicIndentation, startLine); listDynamicIndentation = getDynamicIndentation(parent, parentStartLine, indentation_1.indentation, indentation_1.delta); consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); } else { + // consume any tokens that precede the list as child elements of 'node' using its indentation scope consumeTokenAndAdvanceScanner(tokenInfo, parent, parentDynamicIndentation); } } } - var inheritedIndentation = -1; + var inheritedIndentation = -1 /* Unknown */; 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, startLine, true); } - if (listEndToken !== 0) { + if (listEndToken !== 0 /* Unknown */) { if (formattingScanner.isOnToken()) { var tokenInfo = formattingScanner.readTokenInfo(parent); + // consume the list end token only if it is still belong to the parent + // there might be the case when current token matches end token but does not considered as one + // function (x: function) <-- + // without this check close paren will be interpreted as list end token for function expression which is wrong if (tokenInfo.token.kind === listEndToken && ts.rangeContainsRange(parent, tokenInfo.token)) { + // consume list end token consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); } } @@ -28636,9 +33880,11 @@ var ts; var tokenStart = sourceFile.getLineAndCharacterOfPosition(currentTokenInfo.token.pos); if (isTokenInRange) { var rangeHasError = rangeContainsError(currentTokenInfo.token); + // save prevStartLine since processRange will overwrite this value with current ones var prevStartLine = previousRangeStartLine; lineAdded = processRange(currentTokenInfo.token, tokenStart, parent, childContextNode, dynamicIndentation); if (rangeHasError) { + // do not indent comments\token if token range overlaps with some error indentToken = false; } else { @@ -28663,24 +33909,25 @@ var ts; } var triviaStartLine = sourceFile.getLineAndCharacterOfPosition(triviaItem.pos).line; switch (triviaItem.kind) { - case 3: + case 3 /* MultiLineCommentTrivia */: var commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); indentMultilineComment(triviaItem, commentIndentation, !indentNextTokenOrTrivia); indentNextTokenOrTrivia = false; break; - case 2: + case 2 /* SingleLineCommentTrivia */: if (indentNextTokenOrTrivia) { var commentIndentation_1 = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); insertIndentation(triviaItem.pos, commentIndentation_1, false); indentNextTokenOrTrivia = false; } break; - case 4: + case 4 /* NewLineTrivia */: indentNextTokenOrTrivia = true; break; } } } + // indent token only if is it is in target range and does not overlap with any error ranges if (isTokenInRange && !rangeContainsError(currentTokenInfo.token)) { var tokenIndentation = dynamicIndentation.getIndentationForToken(tokenStart.line, currentTokenInfo.token.kind); insertIndentation(currentTokenInfo.token.pos, tokenIndentation, lineAdded); @@ -28704,6 +33951,7 @@ var ts; var lineAdded; if (!rangeHasError && !previousRangeHasError) { if (!previousRange) { + // trim whitespaces starting from the beginning of the span up to the current line var originalStart = sourceFile.getLineAndCharacterOfPosition(originalRange.pos); trimTrailingWhitespacesForLines(originalStart.line, rangeStart.line); } @@ -28725,26 +33973,33 @@ var ts; var lineAdded; if (rule) { applyRuleEdits(rule, previousItem, previousStartLine, currentItem, currentStartLine); - if (rule.Operation.Action & (2 | 8) && currentStartLine !== previousStartLine) { + if (rule.Operation.Action & (2 /* Space */ | 8 /* Delete */) && currentStartLine !== previousStartLine) { lineAdded = false; + // Handle the case where the next line is moved to be the end of this line. + // In this case we don't indent the next line in the next pass. if (currentParent.getStart(sourceFile) === currentItem.pos) { dynamicIndentation.recomputeIndentation(false); } } - else if (rule.Operation.Action & 4 && currentStartLine === previousStartLine) { + else if (rule.Operation.Action & 4 /* NewLine */ && currentStartLine === previousStartLine) { lineAdded = true; + // Handle the case where token2 is moved to the new line. + // In this case we indent token2 in the next pass but we set + // sameLineIndent flag to notify the indenter that the indentation is within the line. if (currentParent.getStart(sourceFile) === currentItem.pos) { dynamicIndentation.recomputeIndentation(true); } } + // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line trimTrailingWhitespaces = - (rule.Operation.Action & (4 | 2)) && - rule.Flag !== 1; + (rule.Operation.Action & (4 /* NewLine */ | 2 /* Space */)) && + rule.Flag !== 1 /* CanDeleteNewLines */; } else { trimTrailingWhitespaces = true; } if (currentStartLine !== previousStartLine && trimTrailingWhitespaces) { + // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line trimTrailingWhitespacesForLines(previousStartLine, currentStartLine, previousItem); } return lineAdded; @@ -28752,6 +34007,8 @@ var ts; function insertIndentation(pos, indentation, lineAdded) { var indentationString = getIndentationString(indentation, options); if (lineAdded) { + // new line is added before the token by the formatting rules + // insert indentation string at the very beginning of the token recordReplace(pos, 0, indentationString); } else { @@ -28763,11 +34020,13 @@ var ts; } } function indentMultilineComment(commentRange, indentation, firstLineIsIndented) { + // split comment in lines var startLine = sourceFile.getLineAndCharacterOfPosition(commentRange.pos).line; var endLine = sourceFile.getLineAndCharacterOfPosition(commentRange.end).line; var parts; if (startLine === endLine) { if (!firstLineIsIndented) { + // treat as single line comment insertIndentation(commentRange.pos, indentation, false); } return; @@ -28792,6 +34051,7 @@ var ts; startIndex = 1; startLine++; } + // shift all parts on the delta size var delta = indentation - nonWhitespaceColumnInFirstPart.column; for (var i = startIndex, len = parts.length; i < len; ++i, ++startLine) { var startLinePos_1 = ts.getStartPositionOfLine(startLine, sourceFile); @@ -28812,6 +34072,7 @@ var ts; for (var line = line1; line < line2; ++line) { var lineStartPosition = ts.getStartPositionOfLine(line, sourceFile); var lineEndPosition = ts.getEndLinePosition(line, sourceFile); + // do not trim whitespaces in comments if (range && ts.isComment(range.kind) && range.pos <= lineEndPosition && range.end > lineEndPosition) { continue; } @@ -28841,28 +34102,35 @@ var ts; function applyRuleEdits(rule, previousRange, previousStartLine, currentRange, currentStartLine) { var between; switch (rule.Operation.Action) { - case 1: + case 1 /* Ignore */: + // no action required return; - case 8: + case 8 /* Delete */: if (previousRange.end !== currentRange.pos) { + // delete characters starting from t1.end up to t2.pos exclusive recordDelete(previousRange.end, currentRange.pos - previousRange.end); } break; - case 4: - if (rule.Flag !== 1 && previousStartLine !== currentStartLine) { + case 4 /* NewLine */: + // exit early if we on different lines and rule cannot change number of newlines + // if line1 and line2 are on subsequent lines then no edits are required - ok to exit + // if line1 and line2 are separated with more than one newline - ok to exit since we cannot delete extra new lines + if (rule.Flag !== 1 /* CanDeleteNewLines */ && previousStartLine !== currentStartLine) { return; } + // edit should not be applied only if we have one line feed between elements var lineDelta = currentStartLine - previousStartLine; if (lineDelta !== 1) { recordReplace(previousRange.end, currentRange.pos - previousRange.end, options.NewLineCharacter); } break; - case 2: - if (rule.Flag !== 1 && previousStartLine !== currentStartLine) { + case 2 /* Space */: + // exit early if we on different lines and rule cannot change number of newlines + if (rule.Flag !== 1 /* CanDeleteNewLines */ && previousStartLine !== currentStartLine) { return; } var posDelta = currentRange.pos - previousRange.end; - if (posDelta !== 1 || sourceFile.text.charCodeAt(previousRange.end) !== 32) { + if (posDelta !== 1 || sourceFile.text.charCodeAt(previousRange.end) !== 32 /* space */) { recordReplace(previousRange.end, currentRange.pos - previousRange.end, " "); } break; @@ -28871,56 +34139,57 @@ var ts; } function isSomeBlock(kind) { switch (kind) { - case 179: - case 206: + case 179 /* Block */: + case 206 /* ModuleBlock */: return true; } return false; } function getOpenTokenForList(node, list) { switch (node.kind) { - case 135: - case 200: - case 162: - case 134: - case 133: - case 163: + case 135 /* Constructor */: + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 163 /* ArrowFunction */: if (node.typeParameters === list) { - return 24; + return 24 /* LessThanToken */; } else if (node.parameters === list) { - return 16; + return 16 /* OpenParenToken */; } break; - case 157: - case 158: + case 157 /* CallExpression */: + case 158 /* NewExpression */: if (node.typeArguments === list) { - return 24; + return 24 /* LessThanToken */; } else if (node.arguments === list) { - return 16; + return 16 /* OpenParenToken */; } break; - case 141: + case 141 /* TypeReference */: if (node.typeArguments === list) { - return 24; + return 24 /* LessThanToken */; } } - return 0; + return 0 /* Unknown */; } function getCloseTokenForOpenToken(kind) { switch (kind) { - case 16: - return 17; - case 24: - return 25; + case 16 /* OpenParenToken */: + return 17 /* CloseParenToken */; + case 24 /* LessThanToken */: + return 25 /* GreaterThanToken */; } - return 0; + return 0 /* Unknown */; } var internedSizes; var internedTabsIndentation; var internedSpacesIndentation; function getIndentationString(indentation, options) { + // reset interned strings if FormatCodeOptions were changed var resetInternedStrings = !internedSizes || (internedSizes.tabSize !== options.TabSize || internedSizes.indentSize !== options.IndentSize); if (resetInternedStrings) { internedSizes = { tabSize: options.TabSize, indentSize: options.IndentSize }; @@ -28969,6 +34238,7 @@ var ts; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); /// +/* @internal */ var ts; (function (ts) { var formatting; @@ -28981,34 +34251,38 @@ var ts; })(Value || (Value = {})); function getIndentation(position, sourceFile, options) { if (position > sourceFile.text.length) { - return 0; + return 0; // past EOF } var precedingToken = ts.findPrecedingToken(position, sourceFile); if (!precedingToken) { return 0; } - var precedingTokenIsLiteral = precedingToken.kind === 8 || - precedingToken.kind === 9 || - precedingToken.kind === 10 || - precedingToken.kind === 11 || - precedingToken.kind === 12 || - precedingToken.kind === 13; + // no indentation in string \regex\template literals + var precedingTokenIsLiteral = precedingToken.kind === 8 /* StringLiteral */ || + precedingToken.kind === 9 /* RegularExpressionLiteral */ || + precedingToken.kind === 10 /* NoSubstitutionTemplateLiteral */ || + precedingToken.kind === 11 /* TemplateHead */ || + precedingToken.kind === 12 /* TemplateMiddle */ || + precedingToken.kind === 13 /* TemplateTail */; if (precedingTokenIsLiteral && precedingToken.getStart(sourceFile) <= position && precedingToken.end > position) { return 0; } var lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line; - if (precedingToken.kind === 23 && precedingToken.parent.kind !== 169) { + if (precedingToken.kind === 23 /* CommaToken */ && precedingToken.parent.kind !== 169 /* BinaryExpression */) { + // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); - if (actualIndentation !== -1) { + if (actualIndentation !== -1 /* Unknown */) { return actualIndentation; } } + // try to find node that can contribute to indentation and includes 'position' starting from 'precedingToken' + // if such node is found - compute initial indentation for 'position' inside this node var previous; var current = precedingToken; var currentStart; var indentationDelta; while (current) { - if (ts.positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(current.kind, previous ? previous.kind : 0)) { + if (ts.positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(current.kind, previous ? previous.kind : 0 /* Unknown */)) { currentStart = getStartLineAndCharacterForNode(current, sourceFile); if (nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile)) { indentationDelta = 0; @@ -29018,14 +34292,16 @@ var ts; } break; } + // check if current node is a list item - if yes, take indentation from it var actualIndentation = getActualIndentationForListItem(current, sourceFile, options); - if (actualIndentation !== -1) { + if (actualIndentation !== -1 /* Unknown */) { return actualIndentation; } previous = current; current = current.parent; } if (!current) { + // no parent was found - return 0 to be indented on the level of SourceFile return 0; } return getIndentationForNodeWorker(current, currentStart, undefined, indentationDelta, sourceFile, options); @@ -29039,6 +34315,8 @@ var ts; function getIndentationForNodeWorker(current, currentStart, ignoreActualIndentationRange, indentationDelta, sourceFile, options) { var parent = current.parent; var parentStart; + // walk upwards and collect indentations for pairs of parent-child nodes + // indentation is not added if parent and child nodes start on the same line or if parent is IfStatement and child starts on the same line with 'else clause' while (parent) { var useActualIndentation = true; if (ignoreActualIndentationRange) { @@ -29046,8 +34324,9 @@ var ts; useActualIndentation = start < ignoreActualIndentationRange.pos || start > ignoreActualIndentationRange.end; } if (useActualIndentation) { + // check if current node is a list item - if yes, take indentation from it var actualIndentation = getActualIndentationForListItem(current, sourceFile, options); - if (actualIndentation !== -1) { + if (actualIndentation !== -1 /* Unknown */) { return actualIndentation + indentationDelta; } } @@ -29055,11 +34334,13 @@ var ts; var parentAndChildShareLine = parentStart.line === currentStart.line || childStartsOnTheSameLineWithElseInIfStatement(parent, current, currentStart.line, sourceFile); if (useActualIndentation) { + // try to fetch actual indentation for current node from source text var actualIndentation = getActualIndentationForNode(current, parent, currentStart, parentAndChildShareLine, sourceFile, options); - if (actualIndentation !== -1) { + if (actualIndentation !== -1 /* Unknown */) { return actualIndentation + indentationDelta; } } + // increase indentation if parent node wants its content to be indented and parent and child nodes don't start on the same line if (shouldIndentChildNode(parent.kind, current.kind) && !parentAndChildShareLine) { indentationDelta += options.IndentSize; } @@ -29076,20 +34357,31 @@ var ts; } return sourceFile.getLineAndCharacterOfPosition(parent.getStart(sourceFile)); } + /* + * Function returns Value.Unknown if indentation cannot be determined + */ function getActualIndentationForListItemBeforeComma(commaToken, sourceFile, options) { + // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var commaItemInfo = ts.findListItemInfo(commaToken); if (commaItemInfo && commaItemInfo.listItemIndex > 0) { return deriveActualIndentationFromList(commaItemInfo.list.getChildren(), commaItemInfo.listItemIndex - 1, sourceFile, options); } else { - return -1; + // handle broken code gracefully + return -1 /* Unknown */; } } + /* + * Function returns Value.Unknown if actual indentation for node should not be used (i.e because node is nested expression) + */ function getActualIndentationForNode(current, parent, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { + // actual indentation is used for statements\declarations if one of cases below is true: + // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually + // - parent and child are not on the same line var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && - (parent.kind === 227 || !parentAndChildShareLine); + (parent.kind === 227 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { - return -1; + return -1 /* Unknown */; } return findColumnForFirstNonWhitespaceCharacterInLine(currentLineAndChar, sourceFile, options); } @@ -29098,10 +34390,19 @@ var ts; if (!nextToken) { return false; } - if (nextToken.kind === 14) { + if (nextToken.kind === 14 /* OpenBraceToken */) { + // open braces are always indented at the parent level return true; } - else if (nextToken.kind === 15) { + else if (nextToken.kind === 15 /* CloseBraceToken */) { + // close braces are indented at the parent level if they are located on the same line with cursor + // this means that if new line will be added at $ position, this case will be indented + // class A { + // $ + // } + /// and this one - not + // class A { + // $} var nextTokenStartLine = getStartLineAndCharacterForNode(nextToken, sourceFile).line; return lineAtPosition === nextTokenStartLine; } @@ -29111,8 +34412,8 @@ var ts; return sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)); } function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 183 && parent.elseStatement === child) { - var elseKeyword = ts.findChildOfKind(parent, 76, sourceFile); + if (parent.kind === 183 /* IfStatement */ && parent.elseStatement === child) { + var elseKeyword = ts.findChildOfKind(parent, 76 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; return elseKeywordStartLine === childStartLine; @@ -29123,23 +34424,23 @@ var ts; function getContainingList(node, sourceFile) { if (node.parent) { switch (node.parent.kind) { - case 141: + case 141 /* TypeReference */: if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd())) { return node.parent.typeArguments; } break; - case 154: + case 154 /* ObjectLiteralExpression */: return node.parent.properties; - case 153: + case 153 /* ArrayLiteralExpression */: return node.parent.elements; - case 200: - case 162: - case 163: - case 134: - case 133: - case 138: - case 139: { + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 138 /* CallSignature */: + case 139 /* ConstructSignature */: { var start = node.getStart(sourceFile); if (node.parent.typeParameters && ts.rangeContainsStartEnd(node.parent.typeParameters, start, node.getEnd())) { @@ -29150,8 +34451,8 @@ var ts; } break; } - case 158: - case 157: { + case 158 /* NewExpression */: + case 157 /* CallExpression */: { var start = node.getStart(sourceFile); if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { @@ -29169,32 +34470,42 @@ var ts; } function getActualIndentationForListItem(node, sourceFile, options) { var containingList = getContainingList(node, sourceFile); - return containingList ? getActualIndentationFromList(containingList) : -1; + return containingList ? getActualIndentationFromList(containingList) : -1 /* Unknown */; function getActualIndentationFromList(list) { var index = ts.indexOf(list, node); - return index !== -1 ? deriveActualIndentationFromList(list, index, sourceFile, options) : -1; + return index !== -1 ? deriveActualIndentationFromList(list, index, sourceFile, options) : -1 /* Unknown */; } } function deriveActualIndentationFromList(list, index, sourceFile, options) { ts.Debug.assert(index >= 0 && index < list.length); var node = list[index]; + // walk toward the start of the list starting from current node and check if the line is the same for all items. + // if end line for item [i - 1] differs from the start line for item [i] - find column of the first non-whitespace character on the line of item [i] var lineAndCharacter = getStartLineAndCharacterForNode(node, sourceFile); for (var i = index - 1; i >= 0; --i) { - if (list[i].kind === 23) { + if (list[i].kind === 23 /* CommaToken */) { continue; } + // skip list items that ends on the same line with the current list element var prevEndLine = sourceFile.getLineAndCharacterOfPosition(list[i].end).line; if (prevEndLine !== lineAndCharacter.line) { return findColumnForFirstNonWhitespaceCharacterInLine(lineAndCharacter, sourceFile, options); } lineAndCharacter = getStartLineAndCharacterForNode(list[i], sourceFile); } - return -1; + return -1 /* Unknown */; } function findColumnForFirstNonWhitespaceCharacterInLine(lineAndCharacter, sourceFile, options) { var lineStart = sourceFile.getPositionOfLineAndCharacter(lineAndCharacter.line, 0); return findFirstNonWhitespaceColumn(lineStart, lineStart + lineAndCharacter.character, sourceFile, options); } + /* + Character is the actual index of the character since the beginning of the line. + Column - position of the character after expanding tabs to spaces + "0\t2$" + value of 'character' for '$' is 3 + value of 'column' for '$' is 6 (assuming that tab size is 4) + */ function findFirstNonWhitespaceCharacterAndColumn(startPos, endPos, sourceFile, options) { var character = 0; var column = 0; @@ -29203,7 +34514,7 @@ var ts; if (!ts.isWhiteSpace(ch)) { break; } - if (ch === 9) { + if (ch === 9 /* tab */) { column += options.TabSize + (column % options.TabSize); } else { @@ -29220,28 +34531,28 @@ var ts; SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; function nodeContentIsAlwaysIndented(kind) { switch (kind) { - case 201: - case 202: - 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 191: - case 170: - case 151: - case 150: + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + case 204 /* EnumDeclaration */: + case 153 /* ArrayLiteralExpression */: + case 179 /* Block */: + case 206 /* ModuleBlock */: + case 154 /* ObjectLiteralExpression */: + case 145 /* TypeLiteral */: + case 147 /* TupleType */: + case 207 /* CaseBlock */: + case 221 /* DefaultClause */: + case 220 /* CaseClause */: + case 161 /* ParenthesizedExpression */: + case 157 /* CallExpression */: + case 158 /* NewExpression */: + case 180 /* VariableStatement */: + case 198 /* VariableDeclaration */: + case 214 /* ExportAssignment */: + case 191 /* ReturnStatement */: + case 170 /* ConditionalExpression */: + case 151 /* ArrayBindingPattern */: + case 150 /* ObjectBindingPattern */: return true; } return false; @@ -29251,22 +34562,22 @@ var ts; return true; } switch (parent) { - case 184: - case 185: - case 187: - case 188: - case 186: - case 183: - case 200: - case 162: - case 134: - case 133: - case 138: - case 163: - case 135: - case 136: - case 137: - return child !== 179; + case 184 /* DoStatement */: + case 185 /* WhileStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: + case 186 /* ForStatement */: + case 183 /* IfStatement */: + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 138 /* CallSignature */: + case 163 /* ArrowFunction */: + case 135 /* Constructor */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + return child !== 179 /* Block */; default: return false; } @@ -29293,6 +34604,7 @@ var __extends = this.__extends || function (d, b) { /// var ts; (function (ts) { + /** The version of the language service API */ ts.servicesVersion = "0.4"; var ScriptSnapshot; (function (ScriptSnapshot) { @@ -29308,6 +34620,8 @@ var ts; return this.text.length; }; StringScriptSnapshot.prototype.getChangeRange = function (oldSnapshot) { + // Text-based snapshots do not support incremental parsing. Return undefined + // to signal that to the caller. return undefined; }; return StringScriptSnapshot; @@ -29317,7 +34631,7 @@ var ts; } ScriptSnapshot.fromString = fromString; })(ScriptSnapshot = ts.ScriptSnapshot || (ts.ScriptSnapshot = {})); - var scanner = ts.createScanner(2, true); + var scanner = ts.createScanner(2 /* Latest */, true); var emptyArray = []; function createNode(kind, pos, end, flags, parent) { var node = new (ts.getNodeConstructor(kind))(); @@ -29362,13 +34676,13 @@ var ts; while (pos < end) { var token = scanner.scan(); var textPos = scanner.getTextPos(); - nodes.push(createNode(token, pos, textPos, 1024, this)); + nodes.push(createNode(token, pos, textPos, 1024 /* Synthetic */, this)); pos = textPos; } return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(228, nodes.pos, nodes.end, 1024, this); + var list = createNode(228 /* SyntaxList */, nodes.pos, nodes.end, 1024 /* Synthetic */, this); list._children = []; var pos = nodes.pos; for (var _i = 0; _i < nodes.length; _i++) { @@ -29387,7 +34701,7 @@ var ts; NodeObject.prototype.createChildren = function (sourceFile) { var _this = this; var children; - if (this.kind >= 126) { + if (this.kind >= 126 /* FirstNode */) { scanner.setText((sourceFile || this.getSourceFile()).text); children = []; var pos = this.pos; @@ -29432,7 +34746,7 @@ var ts; var children = this.getChildren(); for (var _i = 0; _i < children.length; _i++) { var child = children[_i]; - if (child.kind < 126) { + if (child.kind < 126 /* FirstNode */) { return child; } return child.getFirstToken(sourceFile); @@ -29442,7 +34756,7 @@ var ts; var children = this.getChildren(sourceFile); for (var i = children.length - 1; i >= 0; i--) { var child = children[i]; - if (child.kind < 126) { + if (child.kind < 126 /* FirstNode */) { return child; } return child.getLastToken(sourceFile); @@ -29466,7 +34780,7 @@ var ts; }; SymbolObject.prototype.getDocumentationComment = function () { if (this.documentationComment === undefined) { - this.documentationComment = getJsDocCommentsFromDeclarations(this.declarations, this.name, !(this.flags & 4)); + this.documentationComment = getJsDocCommentsFromDeclarations(this.declarations, this.name, !(this.flags & 4 /* Property */)); } return this.documentationComment; }; @@ -29486,9 +34800,16 @@ var ts; var paramTag = "@param"; var jsDocCommentParts = []; ts.forEach(declarations, function (declaration, indexOfDeclaration) { + // Make sure we are collecting doc comment from declaration once, + // In case of union property there might be same declaration multiple times + // which only varies in type parameter + // Eg. let a: Array | Array; a.length + // The property length will have two declarations of property length coming + // from Array - Array and Array if (ts.indexOf(declarations, declaration) === indexOfDeclaration) { var sourceFileOfDeclaration = ts.getSourceFileOfNode(declaration); - if (canUseParsedParamTagComments && declaration.kind === 129) { + // If it is parameter - try and get the jsDoc comment with @param tag from function declaration's jsDoc comments + if (canUseParsedParamTagComments && declaration.kind === 129 /* Parameter */) { ts.forEach(getJsDocCommentTextRange(declaration.parent, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedParamJsDocComment = getCleanedParamJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedParamJsDocComment) { @@ -29496,13 +34817,16 @@ var ts; } }); } - if (declaration.kind === 205 && declaration.body.kind === 205) { + // If this is left side of dotted module declaration, there is no doc comments associated with this node + if (declaration.kind === 205 /* ModuleDeclaration */ && declaration.body.kind === 205 /* ModuleDeclaration */) { return; } - while (declaration.kind === 205 && declaration.parent.kind === 205) { + // If this is dotted module name, get the doc comments from the parent + while (declaration.kind === 205 /* ModuleDeclaration */ && declaration.parent.kind === 205 /* ModuleDeclaration */) { declaration = declaration.parent; } - ts.forEach(getJsDocCommentTextRange(declaration.kind === 198 ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { + // Get the cleaned js doc comment text from the declaration + ts.forEach(getJsDocCommentTextRange(declaration.kind === 198 /* VariableDeclaration */ ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedJsDocComment = getCleanedJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedJsDocComment) { jsDocCommentParts.push.apply(jsDocCommentParts, cleanedJsDocComment); @@ -29515,7 +34839,7 @@ var ts; return ts.map(ts.getJsDocComments(node, sourceFile), function (jsDocComment) { return { pos: jsDocComment.pos + "/*".length, - end: jsDocComment.end - "*/".length + end: jsDocComment.end - "*/".length // Trim off comment end indicator }; }); } @@ -29526,6 +34850,7 @@ var ts; for (; pos < end; pos++) { var ch = sourceFile.text.charCodeAt(pos); if (!ts.isWhiteSpace(ch) || ts.isLineBreak(ch)) { + // Either found lineBreak or non whiteSpace return pos; } } @@ -29544,9 +34869,11 @@ var ts; ts.isLineBreak(sourceFile.text.charCodeAt(pos + name.length))); } function isParamTag(pos, end, sourceFile) { + // If it is @param tag return isName(pos, end, sourceFile, paramTag); } function pushDocCommentLineText(docComments, text, blankLineCount) { + // Add the empty lines in between texts while (blankLineCount--) { docComments.push(ts.textPart("")); } @@ -29559,10 +34886,13 @@ var ts; var isInParamTag = false; while (pos < end) { var docCommentTextOfLine = ""; + // First consume leading white space pos = consumeWhiteSpacesOnTheLine(pos, end, sourceFile); - if (pos < end && sourceFile.text.charCodeAt(pos) === 42) { + // If the comment starts with '*' consume the spaces on this line + if (pos < end && sourceFile.text.charCodeAt(pos) === 42 /* asterisk */) { var lineStartPos = pos + 1; pos = consumeWhiteSpacesOnTheLine(pos + 1, end, sourceFile, spacesToRemoveAfterAsterisk); + // Set the spaces to remove after asterisk as margin if not already set if (spacesToRemoveAfterAsterisk === undefined && pos < end && !ts.isLineBreak(sourceFile.text.charCodeAt(pos))) { spacesToRemoveAfterAsterisk = pos - lineStartPos; } @@ -29570,9 +34900,11 @@ var ts; else if (spacesToRemoveAfterAsterisk === undefined) { spacesToRemoveAfterAsterisk = 0; } + // Analyse text on this line while (pos < end && !ts.isLineBreak(sourceFile.text.charCodeAt(pos))) { var ch = sourceFile.text.charAt(pos); if (ch === "@") { + // If it is @param tag if (isParamTag(pos, end, sourceFile)) { isInParamTag = true; pos += paramTag.length; @@ -29582,17 +34914,21 @@ var ts; isInParamTag = false; } } + // Add the ch to doc text if we arent in param tag if (!isInParamTag) { docCommentTextOfLine += ch; } + // Scan next character pos++; } + // Continue with next line pos = consumeLineBreaks(pos, end, sourceFile); if (docCommentTextOfLine) { pushDocCommentLineText(docComments, docCommentTextOfLine, blankLineCount); blankLineCount = 0; } else if (!isInParamTag && docComments.length) { + // This is blank line when there is text already parsed blankLineCount++; } } @@ -29605,38 +34941,48 @@ var ts; if (isParamTag(pos, end, sourceFile)) { var blankLineCount = 0; var recordedParamTag = false; + // Consume leading spaces pos = consumeWhiteSpaces(pos + paramTag.length); if (pos >= end) { break; } - if (sourceFile.text.charCodeAt(pos) === 123) { + // Ignore type expression + if (sourceFile.text.charCodeAt(pos) === 123 /* openBrace */) { pos++; for (var curlies = 1; pos < end; pos++) { var charCode = sourceFile.text.charCodeAt(pos); - if (charCode === 123) { + // { character means we need to find another } to match the found one + if (charCode === 123 /* openBrace */) { curlies++; continue; } - if (charCode === 125) { + // } char + if (charCode === 125 /* closeBrace */) { curlies--; if (curlies === 0) { + // We do not have any more } to match the type expression is ignored completely pos++; break; } else { + // there are more { to be matched with } continue; } } - if (charCode === 64) { + // Found start of another tag + if (charCode === 64 /* at */) { break; } } + // Consume white spaces pos = consumeWhiteSpaces(pos); if (pos >= end) { break; } } + // Parameter name if (isName(pos, end, sourceFile, name)) { + // Found the parameter we are looking for consume white spaces pos = consumeWhiteSpaces(pos + name.length); if (pos >= end) { break; @@ -29645,6 +34991,7 @@ var ts; var firstLineParamHelpStringPos = pos; while (pos < end) { var ch = sourceFile.text.charCodeAt(pos); + // at line break, set this comment line text and go to next line if (ts.isLineBreak(ch)) { if (paramHelpString) { pushDocCommentLineText(paramDocComments, paramHelpString, blankLineCount); @@ -29655,24 +35002,30 @@ var ts; else if (recordedParamTag) { blankLineCount++; } + // Get the pos after cleaning start of the line setPosForParamHelpStringOnNextLine(firstLineParamHelpStringPos); continue; } - if (ch === 64) { + // Done scanning param help string - next tag found + if (ch === 64 /* at */) { break; } paramHelpString += sourceFile.text.charAt(pos); + // Go to next character pos++; } + // If there is param help text, add it top the doc comments if (paramHelpString) { pushDocCommentLineText(paramDocComments, paramHelpString, blankLineCount); } paramHelpStringMargin = undefined; } - if (sourceFile.text.charCodeAt(pos) === 64) { + // If this is the start of another tag, continue with the loop in seach of param tag with symbol name + if (sourceFile.text.charCodeAt(pos) === 64 /* at */) { continue; } } + // Next character pos++; } return paramDocComments; @@ -29683,6 +35036,7 @@ var ts; return pos; } function setPosForParamHelpStringOnNextLine(firstLineParamHelpStringPos) { + // Get the pos after consuming line breaks pos = consumeLineBreaks(pos, end, sourceFile); if (pos >= end) { return; @@ -29690,6 +35044,7 @@ var ts; if (paramHelpStringMargin === undefined) { paramHelpStringMargin = sourceFile.getLineAndCharacterOfPosition(firstLineParamHelpStringPos).character; } + // Now consume white spaces max var startOfLinePos = pos; pos = consumeWhiteSpacesOnTheLine(pos, end, sourceFile, paramHelpStringMargin); if (pos >= end) { @@ -29698,7 +35053,8 @@ var ts; var consumedSpaces = pos - startOfLinePos; if (consumedSpaces < paramHelpStringMargin) { var ch = sourceFile.text.charCodeAt(pos); - if (ch === 42) { + if (ch === 42 /* asterisk */) { + // Consume more spaces after asterisk pos = consumeWhiteSpacesOnTheLine(pos + 1, end, sourceFile, paramHelpStringMargin - consumedSpaces - 1); } } @@ -29727,16 +35083,16 @@ var ts; return this.checker.getAugmentedPropertiesOfType(this); }; TypeObject.prototype.getCallSignatures = function () { - return this.checker.getSignaturesOfType(this, 0); + return this.checker.getSignaturesOfType(this, 0 /* Call */); }; TypeObject.prototype.getConstructSignatures = function () { - return this.checker.getSignaturesOfType(this, 1); + return this.checker.getSignaturesOfType(this, 1 /* Construct */); }; TypeObject.prototype.getStringIndexType = function () { - return this.checker.getIndexTypeOfType(this, 0); + return this.checker.getIndexTypeOfType(this, 0 /* String */); }; TypeObject.prototype.getNumberIndexType = function () { - return this.checker.getIndexTypeOfType(this, 1); + return this.checker.getIndexTypeOfType(this, 1 /* Number */); }; return TypeObject; })(); @@ -29758,7 +35114,9 @@ var ts; }; SignatureObject.prototype.getDocumentationComment = function () { if (this.documentationComment === undefined) { - this.documentationComment = this.declaration ? getJsDocCommentsFromDeclarations([this.declaration], undefined, false) : []; + this.documentationComment = this.declaration ? getJsDocCommentsFromDeclarations([this.declaration], + /*name*/ undefined, + /*canUseParsedParamTagComments*/ false) : []; } return this.documentationComment; }; @@ -29783,101 +35141,151 @@ var ts; }; SourceFileObject.prototype.getNamedDeclarations = function () { if (!this.namedDeclarations) { - var sourceFile = this; - var namedDeclarations = []; - ts.forEachChild(sourceFile, function visit(node) { - switch (node.kind) { - case 200: - case 134: - case 133: - var functionDeclaration = node; - if (functionDeclaration.name && functionDeclaration.name.getFullWidth() > 0) { - var lastDeclaration = namedDeclarations.length > 0 ? - namedDeclarations[namedDeclarations.length - 1] : - undefined; - if (lastDeclaration && functionDeclaration.symbol === lastDeclaration.symbol) { - if (functionDeclaration.body && !lastDeclaration.body) { - namedDeclarations[namedDeclarations.length - 1] = functionDeclaration; - } - } - else { - namedDeclarations.push(functionDeclaration); - } - ts.forEachChild(node, visit); - } - break; - case 201: - case 202: - case 203: - case 204: - case 205: - case 208: - case 217: - case 213: - case 208: - case 210: - case 211: - case 136: - case 137: - case 145: - if (node.name) { - namedDeclarations.push(node); - } - case 135: - case 180: - case 199: - case 150: - case 151: - case 206: - ts.forEachChild(node, visit); - break; - case 179: - if (ts.isFunctionBlock(node)) { - ts.forEachChild(node, visit); - } - break; - case 129: - if (!(node.flags & 112)) { - break; - } - case 198: - case 152: - if (ts.isBindingPattern(node.name)) { - ts.forEachChild(node.name, visit); - break; - } - case 226: - case 132: - case 131: - namedDeclarations.push(node); - break; - case 215: - if (node.exportClause) { - ts.forEach(node.exportClause.elements, visit); - } - break; - case 209: - var importClause = node.importClause; - if (importClause) { - if (importClause.name) { - namedDeclarations.push(importClause); - } - if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 211) { - namedDeclarations.push(importClause.namedBindings); - } - else { - ts.forEach(importClause.namedBindings.elements, visit); - } - } - } - break; - } - }); - this.namedDeclarations = namedDeclarations; + this.namedDeclarations = this.computeNamedDeclarations(); } return this.namedDeclarations; }; + SourceFileObject.prototype.computeNamedDeclarations = function () { + var result = {}; + ts.forEachChild(this, visit); + return result; + function addDeclaration(declaration) { + var name = getDeclarationName(declaration); + if (name) { + var declarations = getDeclarations(name); + declarations.push(declaration); + } + } + function getDeclarations(name) { + return ts.getProperty(result, name) || (result[name] = []); + } + function getDeclarationName(declaration) { + if (declaration.name) { + var result_2 = getTextOfIdentifierOrLiteral(declaration.name); + if (result_2 !== undefined) { + return result_2; + } + if (declaration.name.kind === 127 /* ComputedPropertyName */) { + var expr = declaration.name.expression; + if (expr.kind === 155 /* PropertyAccessExpression */) { + return expr.name.text; + } + return getTextOfIdentifierOrLiteral(expr); + } + } + return undefined; + } + function getTextOfIdentifierOrLiteral(node) { + if (node) { + if (node.kind === 65 /* Identifier */ || + node.kind === 8 /* StringLiteral */ || + node.kind === 7 /* NumericLiteral */) { + return node.text; + } + } + return undefined; + } + function visit(node) { + switch (node.kind) { + case 200 /* FunctionDeclaration */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + var functionDeclaration = node; + var declarationName = getDeclarationName(functionDeclaration); + if (declarationName) { + var declarations = getDeclarations(declarationName); + var lastDeclaration = ts.lastOrUndefined(declarations); + // Check whether this declaration belongs to an "overload group". + if (lastDeclaration && functionDeclaration.parent === lastDeclaration.parent && functionDeclaration.symbol === lastDeclaration.symbol) { + // Overwrite the last declaration if it was an overload + // and this one is an implementation. + if (functionDeclaration.body && !lastDeclaration.body) { + declarations[declarations.length - 1] = functionDeclaration; + } + } + else { + declarations.push(functionDeclaration); + } + ts.forEachChild(node, visit); + } + break; + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + case 203 /* TypeAliasDeclaration */: + case 204 /* EnumDeclaration */: + case 205 /* ModuleDeclaration */: + case 208 /* ImportEqualsDeclaration */: + case 217 /* ExportSpecifier */: + case 213 /* ImportSpecifier */: + case 208 /* ImportEqualsDeclaration */: + case 210 /* ImportClause */: + case 211 /* NamespaceImport */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 145 /* TypeLiteral */: + addDeclaration(node); + // fall through + case 135 /* Constructor */: + case 180 /* VariableStatement */: + case 199 /* VariableDeclarationList */: + case 150 /* ObjectBindingPattern */: + case 151 /* ArrayBindingPattern */: + case 206 /* ModuleBlock */: + ts.forEachChild(node, visit); + break; + case 179 /* Block */: + if (ts.isFunctionBlock(node)) { + ts.forEachChild(node, visit); + } + break; + case 129 /* Parameter */: + // Only consider properties defined as constructor parameters + if (!(node.flags & 112 /* AccessibilityModifier */)) { + break; + } + // fall through + case 198 /* VariableDeclaration */: + case 152 /* BindingElement */: + if (ts.isBindingPattern(node.name)) { + ts.forEachChild(node.name, visit); + break; + } + case 226 /* EnumMember */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + addDeclaration(node); + break; + case 215 /* ExportDeclaration */: + // Handle named exports case e.g.: + // export {a, b as B} from "mod"; + if (node.exportClause) { + ts.forEach(node.exportClause.elements, visit); + } + break; + case 209 /* ImportDeclaration */: + var importClause = node.importClause; + if (importClause) { + // Handle default import case e.g.: + // import d from "mod"; + if (importClause.name) { + addDeclaration(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 === 211 /* NamespaceImport */) { + addDeclaration(importClause.namedBindings); + } + else { + ts.forEach(importClause.namedBindings.elements, visit); + } + } + } + break; + } + } + }; return SourceFileObject; })(NodeObject); var TextChange = (function () { @@ -29886,6 +35294,13 @@ var ts; return TextChange; })(); ts.TextChange = TextChange; + var HighlightSpanKind; + (function (HighlightSpanKind) { + HighlightSpanKind.none = "none"; + HighlightSpanKind.definition = "definition"; + HighlightSpanKind.reference = "reference"; + HighlightSpanKind.writtenReference = "writtenReference"; + })(HighlightSpanKind = ts.HighlightSpanKind || (ts.HighlightSpanKind = {})); (function (SymbolDisplayPartKind) { SymbolDisplayPartKind[SymbolDisplayPartKind["aliasName"] = 0] = "aliasName"; SymbolDisplayPartKind[SymbolDisplayPartKind["className"] = 1] = "className"; @@ -29939,29 +35354,52 @@ var ts; TokenClass[TokenClass["RegExpLiteral"] = 8] = "RegExpLiteral"; })(ts.TokenClass || (ts.TokenClass = {})); var TokenClass = ts.TokenClass; - var ScriptElementKind = (function () { - function ScriptElementKind() { - } + // TODO: move these to enums + var ScriptElementKind; + (function (ScriptElementKind) { ScriptElementKind.unknown = ""; + ScriptElementKind.warning = "warning"; + // predefined type (void) or keyword (class) ScriptElementKind.keyword = "keyword"; + // top level script node ScriptElementKind.scriptElement = "script"; + // module foo {} ScriptElementKind.moduleElement = "module"; + // class X {} ScriptElementKind.classElement = "class"; + // interface Y {} ScriptElementKind.interfaceElement = "interface"; + // type T = ... ScriptElementKind.typeElement = "type"; + // enum E ScriptElementKind.enumElement = "enum"; + // Inside module and script only + // let v = .. ScriptElementKind.variableElement = "var"; + // Inside function ScriptElementKind.localVariableElement = "local var"; + // Inside module and script only + // function f() { } ScriptElementKind.functionElement = "function"; + // Inside function ScriptElementKind.localFunctionElement = "local function"; + // class X { [public|private]* foo() {} } ScriptElementKind.memberFunctionElement = "method"; + // class X { [public|private]* [get|set] foo:number; } ScriptElementKind.memberGetAccessorElement = "getter"; ScriptElementKind.memberSetAccessorElement = "setter"; + // class X { [public|private]* foo:number; } + // interface Y { foo:number; } ScriptElementKind.memberVariableElement = "property"; + // class X { constructor() { } } ScriptElementKind.constructorImplementationElement = "constructor"; + // interface Y { ():number; } ScriptElementKind.callSignatureElement = "call"; + // interface Y { []:number; } ScriptElementKind.indexSignatureElement = "index"; + // interface Y { new():Y; } ScriptElementKind.constructSignatureElement = "construct"; + // function foo(*Y*: string) ScriptElementKind.parameterElement = "parameter"; ScriptElementKind.typeParameterElement = "type parameter"; ScriptElementKind.primitiveType = "primitive type"; @@ -29969,12 +35407,9 @@ var ts; ScriptElementKind.alias = "alias"; ScriptElementKind.constElement = "const"; ScriptElementKind.letElement = "let"; - return ScriptElementKind; - })(); - ts.ScriptElementKind = ScriptElementKind; - var ScriptElementKindModifier = (function () { - function ScriptElementKindModifier() { - } + })(ScriptElementKind = ts.ScriptElementKind || (ts.ScriptElementKind = {})); + var ScriptElementKindModifier; + (function (ScriptElementKindModifier) { ScriptElementKindModifier.none = ""; ScriptElementKindModifier.publicMemberModifier = "public"; ScriptElementKindModifier.privateMemberModifier = "private"; @@ -29982,9 +35417,7 @@ var ts; ScriptElementKindModifier.exportedModifier = "export"; ScriptElementKindModifier.ambientModifier = "declare"; ScriptElementKindModifier.staticModifier = "static"; - return ScriptElementKindModifier; - })(); - ts.ScriptElementKindModifier = ScriptElementKindModifier; + })(ScriptElementKindModifier = ts.ScriptElementKindModifier || (ts.ScriptElementKindModifier = {})); var ClassificationTypeNames = (function () { function ClassificationTypeNames() { } @@ -30015,27 +35448,32 @@ var ts; ts.displayPartsToString = displayPartsToString; function isLocalVariableOrFunction(symbol) { if (symbol.parent) { - return false; + return false; // This is exported symbol } return ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 162) { + // Function expressions are local + if (declaration.kind === 162 /* FunctionExpression */) { return true; } - if (declaration.kind !== 198 && declaration.kind !== 200) { + if (declaration.kind !== 198 /* VariableDeclaration */ && declaration.kind !== 200 /* FunctionDeclaration */) { return false; } + // If the parent is not sourceFile or module block it is local variable for (var parent_7 = declaration.parent; !ts.isFunctionBlock(parent_7); parent_7 = parent_7.parent) { - if (parent_7.kind === 227 || parent_7.kind === 206) { + // Reached source file or module block + if (parent_7.kind === 227 /* SourceFile */ || parent_7.kind === 206 /* ModuleBlock */) { return false; } } + // parent is in function block return true; }); } function getDefaultCompilerOptions() { + // Always default to "ScriptTarget.ES5" for the language service return { - target: 1, - module: 0 + target: 1 /* ES5 */, + module: 0 /* None */ }; } ts.getDefaultCompilerOptions = getDefaultCompilerOptions; @@ -30061,15 +35499,21 @@ var ts; return CancellationTokenObject; })(); ts.CancellationTokenObject = CancellationTokenObject; + // Cache host information about scrip Should be refreshed + // at each language service public entry point, since we don't know when + // set of scripts handled by the host changes. var HostCache = (function () { function HostCache(host) { this.host = host; + // script id => script index this.fileNameToEntry = {}; + // Initialize the list with the root file names var rootFileNames = host.getScriptFileNames(); for (var _i = 0; _i < rootFileNames.length; _i++) { var fileName = rootFileNames[_i]; this.createEntry(fileName); } + // store the compilation settings this._compilationSettings = host.getCompilationSettings() || getDefaultCompilerOptions(); } HostCache.prototype.compilationSettings = function () { @@ -30125,18 +35569,22 @@ var ts; SyntaxTreeCache.prototype.getCurrentSourceFile = function (fileName) { var scriptSnapshot = this.host.getScriptSnapshot(fileName); if (!scriptSnapshot) { + // The host does not know about this file. throw new Error("Could not find file: '" + fileName + "'."); } var version = this.host.getScriptVersion(fileName); var sourceFile; if (this.currentFileName !== fileName) { - sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 2, version, true); + // This is a new file, just parse it + sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 2 /* Latest */, version, true); } else if (this.currentFileVersion !== version) { + // This is the same file, just a newer version. Incrementally parse the file. var editRange = scriptSnapshot.getChangeRange(this.currentFileScriptSnapshot); sourceFile = updateLanguageServiceSourceFile(this.currentSourceFile, scriptSnapshot, version, editRange); } if (sourceFile) { + // All done, ensure state is up to date this.currentFileVersion = version; this.currentFileName = fileName; this.currentFileScriptSnapshot = scriptSnapshot; @@ -30150,16 +35598,28 @@ var ts; sourceFile.version = version; 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 + */ function transpile(input, compilerOptions, fileName, diagnostics) { var options = compilerOptions ? ts.clone(compilerOptions) : getDefaultCompilerOptions(); options.separateCompilation = true; + // Filename can be non-ts file. options.allowNonTsExtensions = true; + // Parse var inputFileName = fileName || "module.ts"; var sourceFile = ts.createSourceFile(inputFileName, input, options.target); + // Store syntactic diagnostics if (diagnostics && sourceFile.parseDiagnostics) { diagnostics.push.apply(diagnostics, sourceFile.parseDiagnostics); } + // Output var outputText; + // Create a compilerHost object to allow the compiler to read and write files var compilerHost = { getSourceFile: function (fileName, target) { return fileName === inputFileName ? sourceFile : undefined; }, writeFile: function (name, text, writeByteOrderMark) { @@ -30170,12 +35630,13 @@ var ts; useCaseSensitiveFileNames: function () { return false; }, getCanonicalFileName: function (fileName) { return fileName; }, getCurrentDirectory: function () { return ""; }, - getNewLine: function () { return "\r\n"; } + getNewLine: function () { return (ts.sys && ts.sys.newLine) || "\r\n"; } }; var program = ts.createProgram([inputFileName], options, compilerHost); if (diagnostics) { diagnostics.push.apply(diagnostics, program.getGlobalDiagnostics()); } + // Emit program.emit(); ts.Debug.assert(outputText !== undefined, "Output generation failed"); return outputText; @@ -30184,29 +35645,38 @@ var ts; function createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTarget, version, setNodeParents) { var sourceFile = ts.createSourceFile(fileName, scriptSnapshot.getText(0, scriptSnapshot.getLength()), scriptTarget, setNodeParents); setSourceFileFields(sourceFile, scriptSnapshot, version); + // after full parsing we can use table with interned strings as name table sourceFile.nameTable = sourceFile.identifiers; return sourceFile; } ts.createLanguageServiceSourceFile = createLanguageServiceSourceFile; ts.disableIncrementalParsing = false; function updateLanguageServiceSourceFile(sourceFile, scriptSnapshot, version, textChangeRange, aggressiveChecks) { + // If we were given a text change range, and our version or open-ness changed, then + // incrementally parse this file. if (textChangeRange) { if (version !== sourceFile.version) { + // Once incremental parsing is ready, then just call into this function. if (!ts.disableIncrementalParsing) { var newSourceFile = ts.updateSourceFile(sourceFile, scriptSnapshot.getText(0, scriptSnapshot.getLength()), textChangeRange, aggressiveChecks); setSourceFileFields(newSourceFile, scriptSnapshot, version); + // after incremental parsing nameTable might not be up-to-date + // drop it so it can be lazily recreated later newSourceFile.nameTable = undefined; return newSourceFile; } } } + // Otherwise, just create a new source file. return createLanguageServiceSourceFile(sourceFile.fileName, scriptSnapshot, sourceFile.languageVersion, version, true); } ts.updateLanguageServiceSourceFile = updateLanguageServiceSourceFile; function createDocumentRegistry() { + // Maps from compiler setting target (ES3, ES5, etc.) to all the cached documents we have + // for those settings. var buckets = {}; function getKeyFromCompilationSettings(settings) { - return "_" + settings.target; + return "_" + settings.target; // + "|" + settings.propagateEnumConstantoString() } function getBucketForCompilationSettings(settings, createIfMissing) { var key = getKeyFromCompilationSettings(settings); @@ -30247,6 +35717,7 @@ var ts; var entry = ts.lookUp(bucket, fileName); if (!entry) { ts.Debug.assert(acquiring, "How could we be trying to update a document that the registry doesn't have?"); + // Have never seen this file with these settings. Create a new source file for it. var sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, compilationSettings.target, version, false); bucket[fileName] = entry = { sourceFile: sourceFile, @@ -30255,10 +35726,18 @@ var ts; }; } else { + // We have an entry for this file. However, it may be for a different version of + // the script snapshot. If so, update it appropriately. Otherwise, we can just + // return it as is. if (entry.sourceFile.version !== version) { entry.sourceFile = updateLanguageServiceSourceFile(entry.sourceFile, scriptSnapshot, version, scriptSnapshot.getChangeRange(entry.sourceFile.scriptSnapshot)); } } + // If we're acquiring, then this is the first time this LS is asking for this document. + // Increase our ref count so we know there's another LS using the document. If we're + // not acquiring, then that means the LS is 'updating' the file instead, and that means + // it has already acquired the document previously. As such, we do not need to increase + // the ref count. if (acquiring) { entry.languageServiceRefCount++; } @@ -30313,67 +35792,87 @@ var ts; function processImport() { scanner.setText(sourceText); var token = scanner.scan(); - while (token !== 1) { - if (token === 85) { + // Look for: + // import "mod"; + // import d from "mod" + // import {a as A } from "mod"; + // import * as NS from "mod" + // import d, {a, b as B} from "mod" + // import i = require("mod"); + // + // export * from "mod" + // export {a as b} from "mod" + while (token !== 1 /* EndOfFileToken */) { + if (token === 85 /* ImportKeyword */) { token = scanner.scan(); - if (token === 8) { + if (token === 8 /* StringLiteral */) { + // import "mod"; recordModuleName(); continue; } else { - if (token === 65) { + if (token === 65 /* Identifier */) { token = scanner.scan(); - if (token === 124) { + if (token === 124 /* FromKeyword */) { token = scanner.scan(); - if (token === 8) { + if (token === 8 /* StringLiteral */) { + // import d from "mod"; recordModuleName(); continue; } } - else if (token === 53) { + else if (token === 53 /* EqualsToken */) { token = scanner.scan(); - if (token === 118) { + if (token === 118 /* RequireKeyword */) { token = scanner.scan(); - if (token === 16) { + if (token === 16 /* OpenParenToken */) { token = scanner.scan(); - if (token === 8) { + if (token === 8 /* StringLiteral */) { + // import i = require("mod"); recordModuleName(); continue; } } } } - else if (token === 23) { + else if (token === 23 /* CommaToken */) { + // consume comma and keep going token = scanner.scan(); } else { + // unknown syntax continue; } } - if (token === 14) { + if (token === 14 /* OpenBraceToken */) { token = scanner.scan(); - while (token !== 15) { + // consume "{ a as B, c, d as D}" clauses + while (token !== 15 /* CloseBraceToken */) { token = scanner.scan(); } - if (token === 15) { + if (token === 15 /* CloseBraceToken */) { token = scanner.scan(); - if (token === 124) { + if (token === 124 /* FromKeyword */) { token = scanner.scan(); - if (token === 8) { + if (token === 8 /* StringLiteral */) { + // import {a as A} from "mod"; + // import d, {a, b as B} from "mod" recordModuleName(); } } } } - else if (token === 35) { + else if (token === 35 /* AsteriskToken */) { token = scanner.scan(); - if (token === 102) { + if (token === 111 /* AsKeyword */) { token = scanner.scan(); - if (token === 65) { + if (token === 65 /* Identifier */) { token = scanner.scan(); - if (token === 124) { + if (token === 124 /* FromKeyword */) { token = scanner.scan(); - if (token === 8) { + if (token === 8 /* StringLiteral */) { + // import * as NS from "mod" + // import d, * as NS from "mod" recordModuleName(); } } @@ -30382,28 +35881,32 @@ var ts; } } } - else if (token === 78) { + else if (token === 78 /* ExportKeyword */) { token = scanner.scan(); - if (token === 14) { + if (token === 14 /* OpenBraceToken */) { token = scanner.scan(); - while (token !== 15) { + // consume "{ a as B, c, d as D}" clauses + while (token !== 15 /* CloseBraceToken */) { token = scanner.scan(); } - if (token === 15) { + if (token === 15 /* CloseBraceToken */) { token = scanner.scan(); - if (token === 124) { + if (token === 124 /* FromKeyword */) { token = scanner.scan(); - if (token === 8) { + if (token === 8 /* StringLiteral */) { + // export {a as A} from "mod"; + // export {a, b as B} from "mod" recordModuleName(); } } } } - else if (token === 35) { + else if (token === 35 /* AsteriskToken */) { token = scanner.scan(); - if (token === 124) { + if (token === 124 /* FromKeyword */) { token = scanner.scan(); - if (token === 8) { + if (token === 8 /* StringLiteral */) { + // export * from "mod" recordModuleName(); } } @@ -30420,9 +35923,10 @@ var ts; return { referencedFiles: referencedFiles, importedFiles: importedFiles, isLibFile: isNoDefaultLib }; } ts.preProcessFile = preProcessFile; + /// Helpers function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 194 && referenceNode.label.text === labelName) { + if (referenceNode.kind === 194 /* LabeledStatement */ && referenceNode.label.text === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -30430,17 +35934,21 @@ var ts; return undefined; } function isJumpStatementTarget(node) { - return node.kind === 65 && - (node.parent.kind === 190 || node.parent.kind === 189) && + return node.kind === 65 /* Identifier */ && + (node.parent.kind === 190 /* BreakStatement */ || node.parent.kind === 189 /* ContinueStatement */) && node.parent.label === node; } function isLabelOfLabeledStatement(node) { - return node.kind === 65 && - node.parent.kind === 194 && + return node.kind === 65 /* Identifier */ && + node.parent.kind === 194 /* LabeledStatement */ && node.parent.label === node; } + /** + * Whether or not a 'node' is preceded by a label of the given string. + * Note: 'node' cannot be a SourceFile. + */ function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 194; owner = owner.parent) { + for (var owner = node.parent; owner.kind === 194 /* LabeledStatement */; owner = owner.parent) { if (owner.label.text === labelName) { return true; } @@ -30451,78 +35959,84 @@ var ts; return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); } function isRightSideOfQualifiedName(node) { - return node.parent.kind === 126 && node.parent.right === node; + return node.parent.kind === 126 /* QualifiedName */ && node.parent.right === node; } function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 155 && node.parent.name === node; + return node && node.parent && node.parent.kind === 155 /* PropertyAccessExpression */ && node.parent.name === node; } function isCallExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 157 && node.parent.expression === node; + return node && node.parent && node.parent.kind === 157 /* CallExpression */ && node.parent.expression === node; } function isNewExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 158 && node.parent.expression === node; + return node && node.parent && node.parent.kind === 158 /* NewExpression */ && node.parent.expression === node; } function isNameOfModuleDeclaration(node) { - return node.parent.kind === 205 && node.parent.name === node; + return node.parent.kind === 205 /* ModuleDeclaration */ && node.parent.name === node; } function isNameOfFunctionDeclaration(node) { - return node.kind === 65 && + return node.kind === 65 /* Identifier */ && ts.isFunctionLike(node.parent) && node.parent.name === node; } + /** Returns true if node is a name of an object literal property, e.g. "a" in x = { "a": 1 } */ function isNameOfPropertyAssignment(node) { - return (node.kind === 65 || node.kind === 8 || node.kind === 7) && - (node.parent.kind === 224 || node.parent.kind === 225) && node.parent.name === node; + return (node.kind === 65 /* Identifier */ || node.kind === 8 /* StringLiteral */ || node.kind === 7 /* NumericLiteral */) && + (node.parent.kind === 224 /* PropertyAssignment */ || node.parent.kind === 225 /* ShorthandPropertyAssignment */) && node.parent.name === node; } function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { - if (node.kind === 8 || node.kind === 7) { + if (node.kind === 8 /* StringLiteral */ || node.kind === 7 /* NumericLiteral */) { switch (node.parent.kind) { - case 132: - case 131: - case 224: - case 226: - case 134: - case 133: - case 136: - case 137: - case 205: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 224 /* PropertyAssignment */: + case 226 /* EnumMember */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 205 /* ModuleDeclaration */: return node.parent.name === node; - case 156: + case 156 /* ElementAccessExpression */: return node.parent.argumentExpression === node; } } return false; } function isNameOfExternalModuleImportOrDeclaration(node) { - if (node.kind === 8) { + if (node.kind === 8 /* StringLiteral */) { return isNameOfModuleDeclaration(node) || (ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node); } return false; } + /** Returns true if the position is within a comment */ function isInsideComment(sourceFile, token, position) { + // The position has to be: 1. in the leading trivia (before token.getStart()), and 2. within a comment return position <= token.getStart(sourceFile) && (isInsideCommentRange(ts.getTrailingCommentRanges(sourceFile.text, token.getFullStart())) || isInsideCommentRange(ts.getLeadingCommentRanges(sourceFile.text, token.getFullStart()))); function isInsideCommentRange(comments) { return ts.forEach(comments, function (comment) { + // either we are 1. completely inside the comment, or 2. at the end of the comment if (comment.pos < position && position < comment.end) { return true; } else if (position === comment.end) { var text = sourceFile.text; var width = comment.end - comment.pos; - if (width <= 2 || text.charCodeAt(comment.pos + 1) === 47) { + // is single line comment or just /* + if (width <= 2 || text.charCodeAt(comment.pos + 1) === 47 /* slash */) { return true; } else { - return !(text.charCodeAt(comment.end - 1) === 47 && - text.charCodeAt(comment.end - 2) === 42); + // is unterminated multi-line comment + return !(text.charCodeAt(comment.end - 1) === 47 /* slash */ && + text.charCodeAt(comment.end - 2) === 42 /* asterisk */); } } return false; @@ -30544,71 +36058,73 @@ var ts; BreakContinueSearchType[BreakContinueSearchType["Labeled"] = 2] = "Labeled"; BreakContinueSearchType[BreakContinueSearchType["All"] = 3] = "All"; })(BreakContinueSearchType || (BreakContinueSearchType = {})); + // A cache of completion entries for keywords, these do not change between sessions var keywordCompletions = []; - for (var i = 66; i <= 125; i++) { + for (var i = 66 /* FirstKeyword */; i <= 125 /* LastKeyword */; i++) { keywordCompletions.push({ name: ts.tokenToString(i), kind: ScriptElementKind.keyword, - kindModifiers: ScriptElementKindModifier.none + kindModifiers: ScriptElementKindModifier.none, + sortText: "0" }); } - function getContainerNode(node) { + /* @internal */ function getContainerNode(node) { while (true) { node = node.parent; if (!node) { return undefined; } switch (node.kind) { - case 227: - case 134: - case 133: - case 200: - case 162: - case 136: - case 137: - case 201: - case 202: - case 204: - case 205: + case 227 /* SourceFile */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + case 204 /* EnumDeclaration */: + case 205 /* ModuleDeclaration */: return node; } } } ts.getContainerNode = getContainerNode; - function getNodeKind(node) { + /* @internal */ function getNodeKind(node) { switch (node.kind) { - case 205: return ScriptElementKind.moduleElement; - case 201: return ScriptElementKind.classElement; - case 202: return ScriptElementKind.interfaceElement; - case 203: return ScriptElementKind.typeElement; - case 204: return ScriptElementKind.enumElement; - case 198: + case 205 /* ModuleDeclaration */: return ScriptElementKind.moduleElement; + case 201 /* ClassDeclaration */: return ScriptElementKind.classElement; + case 202 /* InterfaceDeclaration */: return ScriptElementKind.interfaceElement; + case 203 /* TypeAliasDeclaration */: return ScriptElementKind.typeElement; + case 204 /* EnumDeclaration */: return ScriptElementKind.enumElement; + case 198 /* VariableDeclaration */: return ts.isConst(node) ? ScriptElementKind.constElement : ts.isLet(node) ? ScriptElementKind.letElement : ScriptElementKind.variableElement; - case 200: return ScriptElementKind.functionElement; - case 136: return ScriptElementKind.memberGetAccessorElement; - case 137: return ScriptElementKind.memberSetAccessorElement; - case 134: - case 133: + case 200 /* FunctionDeclaration */: return ScriptElementKind.functionElement; + case 136 /* GetAccessor */: return ScriptElementKind.memberGetAccessorElement; + case 137 /* SetAccessor */: return ScriptElementKind.memberSetAccessorElement; + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: return ScriptElementKind.memberFunctionElement; - case 132: - case 131: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: return ScriptElementKind.memberVariableElement; - case 140: return ScriptElementKind.indexSignatureElement; - case 139: return ScriptElementKind.constructSignatureElement; - case 138: return ScriptElementKind.callSignatureElement; - case 135: return ScriptElementKind.constructorImplementationElement; - case 128: return ScriptElementKind.typeParameterElement; - case 226: return ScriptElementKind.variableElement; - case 129: return (node.flags & 112) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; - case 208: - case 213: - case 210: - case 217: - case 211: + case 140 /* IndexSignature */: return ScriptElementKind.indexSignatureElement; + case 139 /* ConstructSignature */: return ScriptElementKind.constructSignatureElement; + case 138 /* CallSignature */: return ScriptElementKind.callSignatureElement; + case 135 /* Constructor */: return ScriptElementKind.constructorImplementationElement; + case 128 /* TypeParameter */: return ScriptElementKind.typeParameterElement; + case 226 /* EnumMember */: return ScriptElementKind.variableElement; + case 129 /* Parameter */: return (node.flags & 112 /* AccessibilityModifier */) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; + case 208 /* ImportEqualsDeclaration */: + case 213 /* ImportSpecifier */: + case 210 /* ImportClause */: + case 217 /* ExportSpecifier */: + case 211 /* NamespaceImport */: return ScriptElementKind.alias; } return ScriptElementKind.unknown; @@ -30619,9 +36135,9 @@ var ts; var syntaxTreeCache = new SyntaxTreeCache(host); var ruleProvider; var program; - var typeInfoResolver; var useCaseSensitivefileNames = false; var cancellationToken = new CancellationTokenObject(host.getCancellationToken && host.getCancellationToken()); + // Check if the localized messages json is set, otherwise query the host for it if (!ts.localizedDiagnosticMessages && host.getLocalizedDiagnosticMessages) { ts.localizedDiagnosticMessages = host.getLocalizedDiagnosticMessages(); } @@ -30642,6 +36158,7 @@ var ts; return sourceFile; } function getRuleProvider(options) { + // Ensure rules are initialized and up to date wrt to formatting options if (!ruleProvider) { ruleProvider = new ts.formatting.RulesProvider(); } @@ -30649,13 +36166,21 @@ var ts; return ruleProvider; } function synchronizeHostData() { + // Get a fresh cache of the host information var hostCache = new HostCache(host); + // If the program is already up-to-date, we can reuse it if (programUpToDate()) { return; } + // IMPORTANT - It is critical from this moment onward that we do not check + // cancellation tokens. We are about to mutate source files from a previous program + // instance. If we cancel midway through, we may end up in an inconsistent state where + // the program points to old source files that have been invalidated because of + // incremental parsing. var oldSettings = program && program.getCompilerOptions(); var newSettings = hostCache.compilationSettings(); var changesInCompilationSettingsAffectSyntax = oldSettings && oldSettings.target !== newSettings.target; + // Now create a new compiler var newProgram = ts.createProgram(hostCache.getRootFileNames(), newSettings, { getSourceFile: getOrCreateSourceFile, getCancellationToken: function () { return cancellationToken; }, @@ -30666,6 +36191,8 @@ var ts; writeFile: function (fileName, data, writeByteOrderMark) { }, getCurrentDirectory: function () { return host.getCurrentDirectory(); } }); + // Release any files we have acquired in the old program but are + // not part of the new program. if (program) { var oldSourceFiles = program.getSourceFiles(); for (var _i = 0; _i < oldSourceFiles.length; _i++) { @@ -30677,38 +36204,73 @@ var ts; } } program = newProgram; - typeInfoResolver = program.getTypeChecker(); + // Make sure all the nodes in the program are both bound, and have their parent + // pointers set property. + program.getTypeChecker(); return; function getOrCreateSourceFile(fileName) { + // The program is asking for this file, check first if the host can locate it. + // If the host can not locate the file, then it does not exist. return undefined + // to the program to allow reporting of errors for missing files. var hostFileInformation = hostCache.getOrCreateEntry(fileName); if (!hostFileInformation) { return undefined; } + // Check if the language version has changed since we last created a program; if they are the same, + // it is safe to reuse the souceFiles; if not, then the shape of the AST can change, and the oldSourceFile + // can not be reused. we have to dump all syntax trees and create new ones. if (!changesInCompilationSettingsAffectSyntax) { + // Check if the old program had this file already var oldSourceFile = program && program.getSourceFile(fileName); if (oldSourceFile) { + // We already had a source file for this file name. Go to the registry to + // ensure that we get the right up to date version of it. We need this to + // address the following 'race'. Specifically, say we have the following: + // + // LS1 + // \ + // DocumentRegistry + // / + // LS2 + // + // Each LS has a reference to file 'foo.ts' at version 1. LS2 then updates + // it's version of 'foo.ts' to version 2. This will cause LS2 and the + // DocumentRegistry to have version 2 of the document. HOwever, LS1 will + // have version 1. And *importantly* this source file will be *corrupt*. + // The act of creating version 2 of the file irrevocably damages the version + // 1 file. + // + // So, later when we call into LS1, we need to make sure that it doesn't use + // it's source file any more, and instead defers to DocumentRegistry to get + // either version 1, version 2 (or some other version) depending on what the + // host says should be used. return documentRegistry.updateDocument(fileName, newSettings, hostFileInformation.scriptSnapshot, hostFileInformation.version); } } + // Could not find this file in the old program, create a new SourceFile for it. return documentRegistry.acquireDocument(fileName, newSettings, hostFileInformation.scriptSnapshot, hostFileInformation.version); } function sourceFileUpToDate(sourceFile) { return sourceFile && sourceFile.version === hostCache.getVersion(sourceFile.fileName); } function programUpToDate() { + // If we haven't create a program yet, then it is not up-to-date if (!program) { return false; } + // If number of files in the program do not match, it is not up-to-date var rootFileNames = hostCache.getRootFileNames(); if (program.getSourceFiles().length !== rootFileNames.length) { return false; } + // If any file is not up-to-date, then the whole program is not up-to-date for (var _i = 0; _i < rootFileNames.length; _i++) { var fileName = rootFileNames[_i]; if (!sourceFileUpToDate(program.getSourceFile(fileName))) { return false; } } + // If the compilation settings do no match, then the program is not up-to-date return ts.compareDataObjects(program.getCompilerOptions(), hostCache.compilationSettings()); } } @@ -30717,9 +36279,7 @@ var ts; return program; } function cleanupSemanticCache() { - if (program) { - typeInfoResolver = program.getTypeChecker(); - } + // TODO: Should we jettison the program (or it's type checker) here? } function dispose() { if (program) { @@ -30728,41 +36288,213 @@ var ts; }); } } + /// Diagnostics function getSyntacticDiagnostics(fileName) { synchronizeHostData(); return program.getSyntacticDiagnostics(getValidSourceFile(fileName)); } + /** + * 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) { synchronizeHostData(); var 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 (ts.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. var semanticDiagnostics = program.getSemanticDiagnostics(targetSourceFile); if (!program.getCompilerOptions().declaration) { return semanticDiagnostics; } + // If '-d' is enabled, check for emitter error. One example of emitter error is export class implements non-export interface var declarationDiagnostics = program.getDeclarationDiagnostics(targetSourceFile); return ts.concatenate(semanticDiagnostics, declarationDiagnostics); } + function getJavaScriptSemanticDiagnostics(sourceFile) { + var diagnostics = []; + walk(sourceFile); + return diagnostics; + function walk(node) { + if (!node) { + return false; + } + switch (node.kind) { + case 208 /* ImportEqualsDeclaration */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); + return true; + case 214 /* ExportAssignment */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); + return true; + case 201 /* ClassDeclaration */: + var classDeclaration = node; + if (checkModifiers(classDeclaration.modifiers) || + checkTypeParameters(classDeclaration.typeParameters)) { + return true; + } + break; + case 222 /* HeritageClause */: + var heritageClause = node; + if (heritageClause.token === 102 /* ImplementsKeyword */) { + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); + return true; + } + break; + case 202 /* InterfaceDeclaration */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 205 /* ModuleDeclaration */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 203 /* TypeAliasDeclaration */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); + return true; + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 135 /* Constructor */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 162 /* FunctionExpression */: + case 200 /* FunctionDeclaration */: + case 163 /* ArrowFunction */: + case 200 /* FunctionDeclaration */: + var functionDeclaration = node; + if (checkModifiers(functionDeclaration.modifiers) || + checkTypeParameters(functionDeclaration.typeParameters) || + checkTypeAnnotation(functionDeclaration.type)) { + return true; + } + break; + case 180 /* VariableStatement */: + var variableStatement = node; + if (checkModifiers(variableStatement.modifiers)) { + return true; + } + break; + case 198 /* VariableDeclaration */: + var variableDeclaration = node; + if (checkTypeAnnotation(variableDeclaration.type)) { + return true; + } + break; + case 157 /* CallExpression */: + case 158 /* NewExpression */: + var expression = node; + if (expression.typeArguments && expression.typeArguments.length > 0) { + var start = expression.typeArguments.pos; + diagnostics.push(ts.createFileDiagnostic(sourceFile, start, expression.typeArguments.end - start, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); + return true; + } + break; + case 129 /* Parameter */: + var parameter = node; + if (parameter.modifiers) { + var start = parameter.modifiers.pos; + diagnostics.push(ts.createFileDiagnostic(sourceFile, start, parameter.modifiers.end - start, ts.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)); + return true; + } + if (parameter.questionToken) { + diagnostics.push(ts.createDiagnosticForNode(parameter.questionToken, ts.Diagnostics.can_only_be_used_in_a_ts_file)); + return true; + } + if (parameter.type) { + diagnostics.push(ts.createDiagnosticForNode(parameter.type, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); + return true; + } + break; + case 132 /* PropertyDeclaration */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.property_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 204 /* EnumDeclaration */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 160 /* TypeAssertionExpression */: + var typeAssertionExpression = node; + diagnostics.push(ts.createDiagnosticForNode(typeAssertionExpression.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); + return true; + case 130 /* Decorator */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.decorators_can_only_be_used_in_a_ts_file)); + return true; + } + return ts.forEachChild(node, walk); + } + function checkTypeParameters(typeParameters) { + if (typeParameters) { + var start = typeParameters.pos; + diagnostics.push(ts.createFileDiagnostic(sourceFile, start, typeParameters.end - start, ts.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)); + return true; + } + return false; + } + function checkTypeAnnotation(type) { + if (type) { + diagnostics.push(ts.createDiagnosticForNode(type, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); + return true; + } + return false; + } + function checkModifiers(modifiers) { + if (modifiers) { + for (var _i = 0; _i < modifiers.length; _i++) { + var modifier = modifiers[_i]; + switch (modifier.kind) { + case 108 /* PublicKeyword */: + case 106 /* PrivateKeyword */: + case 107 /* ProtectedKeyword */: + case 115 /* DeclareKeyword */: + diagnostics.push(ts.createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind))); + return true; + // These are all legal modifiers. + case 109 /* StaticKeyword */: + case 78 /* ExportKeyword */: + case 70 /* ConstKeyword */: + case 73 /* DefaultKeyword */: + } + } + } + return false; + } + } function getCompilerOptionsDiagnostics() { synchronizeHostData(); return program.getGlobalDiagnostics(); } - function getCompletionEntryDisplayName(symbol, target, performCharacterChecks) { + /// Completion + function getCompletionEntryDisplayNameForSymbol(symbol, target, performCharacterChecks) { var displayName = symbol.getName(); + if (displayName) { + // If this is the default export, get the name of the declaration if it exists + if (displayName === "default") { + var localSymbol = ts.getLocalSymbolForExportDefault(symbol); + if (localSymbol && localSymbol.name) { + displayName = symbol.valueDeclaration.localSymbol.name; + } + } + var 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 & 1536 /* Namespace */) && (firstCharCode === 39 /* singleQuote */ || firstCharCode === 34 /* 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, target, performCharacterChecks) { if (!displayName) { return undefined; } - if (displayName === "default") { - var localSymbol = ts.getLocalSymbolForExportDefault(symbol); - if (localSymbol && localSymbol.name) { - displayName = symbol.valueDeclaration.localSymbol.name; - } - } 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)) { + if (displayName.length >= 2 && + firstCharCode === displayName.charCodeAt(displayName.length - 1) && + (firstCharCode === 39 /* singleQuote */ || firstCharCode === 34 /* 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. displayName = displayName.substring(1, displayName.length - 1); } if (!displayName) { @@ -30780,24 +36512,15 @@ var ts; } return ts.unescapeIdentifier(displayName); } - function createCompletionEntry(symbol, typeChecker, location) { - var displayName = getCompletionEntryDisplayName(symbol, program.getCompilerOptions().target, true); - if (!displayName) { - return undefined; - } - return { - name: displayName, - kind: getSymbolKind(symbol, typeChecker, location), - kindModifiers: getSymbolModifiers(symbol) - }; - } function getCompletionData(fileName, position) { + var typeChecker = program.getTypeChecker(); var syntacticStart = new Date().getTime(); var sourceFile = getValidSourceFile(fileName); var start = new Date().getTime(); var currentToken = ts.getTokenAtPosition(sourceFile, position); log("getCompletionData: Get current token: " + (new Date().getTime() - start)); start = new Date().getTime(); + // Completion not allowed inside comments, bail out if this is the case var insideComment = isInsideComment(sourceFile, currentToken, position); log("getCompletionData: Is inside comment: " + (new Date().getTime() - start)); if (insideComment) { @@ -30807,23 +36530,31 @@ var ts; start = new Date().getTime(); var previousToken = ts.findPrecedingToken(position, sourceFile); log("getCompletionData: Get previous token 1: " + (new Date().getTime() - start)); + // The decision to provide completion depends on the contextToken, which is determined through the previousToken. + // Note: 'previousToken' (and thus 'contextToken') can be undefined if we are the beginning of the file var contextToken = previousToken; + // Check if the caret is at the end of an identifier; this is a partial identifier that we want to complete: e.g. a.toS| + // Skip this partial identifier and adjust the contextToken to the token that precedes it. if (contextToken && position <= contextToken.end && ts.isWord(contextToken.kind)) { - var start_1 = new Date().getTime(); + var start_2 = new Date().getTime(); contextToken = ts.findPrecedingToken(contextToken.getFullStart(), sourceFile); - log("getCompletionData: Get previous token 2: " + (new Date().getTime() - start_1)); + log("getCompletionData: Get previous token 2: " + (new Date().getTime() - start_2)); } + // Check if this is a valid completion location if (contextToken && isCompletionListBlocker(contextToken)) { log("Returning an empty list because completion was requested in an invalid position."); 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 other wise, it is a request for all + // visible symbols in the scope, and the node is the current location. var node = currentToken; var isRightOfDot = false; - if (contextToken && contextToken.kind === 20 && contextToken.parent.kind === 155) { + if (contextToken && contextToken.kind === 20 /* DotToken */ && contextToken.parent.kind === 155 /* PropertyAccessExpression */) { node = contextToken.parent.expression; isRightOfDot = true; } - else if (contextToken && contextToken.kind === 20 && contextToken.parent.kind === 126) { + else if (contextToken && contextToken.kind === 20 /* DotToken */ && contextToken.parent.kind === 126 /* QualifiedName */) { node = contextToken.parent.left; isRightOfDot = true; } @@ -30832,73 +36563,131 @@ var ts; var semanticStart = new Date().getTime(); var isMemberCompletion; var isNewIdentifierLocation; - var symbols; + var symbols = []; if (isRightOfDot) { - symbols = []; + 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: symbols, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, location: location, isRightOfDot: isRightOfDot }; + function getTypeScriptMemberSymbols() { + // Right of dot member completion list isMemberCompletion = true; isNewIdentifierLocation = false; - if (node.kind === 65 || node.kind === 126 || node.kind === 155) { - var symbol = typeInfoResolver.getSymbolAtLocation(node); - if (symbol && symbol.flags & 8388608) { - symbol = typeInfoResolver.getAliasedSymbol(symbol); + if (node.kind === 65 /* Identifier */ || node.kind === 126 /* QualifiedName */ || node.kind === 155 /* PropertyAccessExpression */) { + var symbol = typeChecker.getSymbolAtLocation(node); + // This is an alias, follow what it aliases + if (symbol && symbol.flags & 8388608 /* Alias */) { + symbol = typeChecker.getAliasedSymbol(symbol); } - if (symbol && symbol.flags & 1952) { - ts.forEachValue(symbol.exports, function (symbol) { - if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) { + if (symbol && symbol.flags & 1952 /* HasExports */) { + // Extract module or enum members + var exportedSymbols = typeChecker.getExportsOfModule(symbol); + ts.forEach(exportedSymbols, function (symbol) { + if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) { symbols.push(symbol); } }); } } - var type = typeInfoResolver.getTypeAtLocation(node); + var type = typeChecker.getTypeAtLocation(node); if (type) { + // Filter private properties ts.forEach(type.getApparentProperties(), function (symbol) { - if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) { + if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) { symbols.push(symbol); } }); } } - else { + function tryGetGlobalSymbols() { var containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion(contextToken); if (containingObjectLiteral) { + // Object literal expression, look up possible property names from contextual type isMemberCompletion = true; isNewIdentifierLocation = true; - var contextualType = typeInfoResolver.getContextualType(containingObjectLiteral); + var contextualType = typeChecker.getContextualType(containingObjectLiteral); if (!contextualType) { - return undefined; + return false; } - var contextualTypeMembers = typeInfoResolver.getPropertiesOfType(contextualType); + var contextualTypeMembers = typeChecker.getPropertiesOfType(contextualType); if (contextualTypeMembers && contextualTypeMembers.length > 0) { + // Add filtered items to the completion list symbols = filterContextualMembersList(contextualTypeMembers, containingObjectLiteral.properties); } } - else if (ts.getAncestor(contextToken, 210)) { + else if (ts.getAncestor(contextToken, 210 /* ImportClause */)) { + // cursor is in import clause + // try to show exported member for imported module isMemberCompletion = true; isNewIdentifierLocation = true; if (showCompletionsInImportsClause(contextToken)) { - var importDeclaration = ts.getAncestor(contextToken, 209); + var importDeclaration = ts.getAncestor(contextToken, 209 /* ImportDeclaration */); ts.Debug.assert(importDeclaration !== undefined); - var exports = typeInfoResolver.getExportsOfExternalModule(importDeclaration); - symbols = filterModuleExports(exports, importDeclaration); + var exports; + if (importDeclaration.moduleSpecifier) { + var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(importDeclaration.moduleSpecifier); + if (moduleSpecifierSymbol) { + exports = typeChecker.getExportsOfModule(moduleSpecifierSymbol); + } + } + //let exports = typeInfoResolver.getExportsOfImportDeclaration(importDeclaration); + symbols = exports ? filterModuleExports(exports, importDeclaration) : emptyArray; } } else { + // Get all entities in the current scope. isMemberCompletion = false; isNewIdentifierLocation = isNewIdentifierDefinitionLocation(contextToken); if (previousToken !== contextToken) { ts.Debug.assert(!!previousToken, "Expected 'contextToken' to be defined when different from 'previousToken'."); } + // We need to find the node that will give us an appropriate scope to begin + // aggregating completion candidates. This is achieved in 'getScopeNode' + // by finding the first node that encompasses a position, accounting for whether a node + // is "complete" to decide whether a position belongs to the node. + // + // However, at the end of an identifier, we are interested in the scope of the identifier + // itself, but fall outside of the identifier. For instance: + // + // xyz => x$ + // + // the cursor is outside of both the 'x' and the arrow function 'xyz => x', + // so 'xyz' is not returned in our results. + // + // We define 'adjustedPosition' so that we may appropriately account for + // being at the end of an identifier. The intention is that if requesting completion + // at the end of an identifier, it should be effectively equivalent to requesting completion + // anywhere inside/at the beginning of the identifier. So in the previous case, the + // 'adjustedPosition' will work as if requesting completion in the following: + // + // xyz => $x + // + // If previousToken !== contextToken, then + // - 'contextToken' was adjusted to the token prior to 'previousToken' + // because we were at the end of an identifier. + // - 'previousToken' is defined. var adjustedPosition = previousToken !== contextToken ? previousToken.getStart() : position; var scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile; - var symbolMeanings = 793056 | 107455 | 1536 | 8388608; - symbols = typeInfoResolver.getSymbolsInScope(scopeNode, symbolMeanings); + /// TODO filter meaning based on the current context + var symbolMeanings = 793056 /* Type */ | 107455 /* Value */ | 1536 /* Namespace */ | 8388608 /* Alias */; + symbols = typeChecker.getSymbolsInScope(scopeNode, symbolMeanings); } + return true; } - log("getCompletionData: Semantic work: " + (new Date().getTime() - semanticStart)); - return { symbols: symbols, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, location: location }; + /** + * Finds the first node that "embraces" the position, so that one may + * accurately aggregate locals from the closest containing scope. + */ function getScopeNode(initialToken, position, sourceFile) { var scope = initialToken; while (scope && !ts.positionBelongsToNode(scope, position, sourceFile)) { @@ -30916,8 +36705,10 @@ var ts; } function showCompletionsInImportsClause(node) { if (node) { - if (node.kind === 14 || node.kind === 23) { - return node.parent.kind === 212; + // import {| + // import {a,| + if (node.kind === 14 /* OpenBraceToken */ || node.kind === 23 /* CommaToken */) { + return node.parent.kind === 212 /* NamedImports */; } } return false; @@ -30926,37 +36717,38 @@ var ts; if (previousToken) { var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { - case 23: - return containingNodeKind === 157 - || containingNodeKind === 135 - || containingNodeKind === 158 - || containingNodeKind === 153 - || containingNodeKind === 169; - case 16: - return containingNodeKind === 157 - || containingNodeKind === 135 - || containingNodeKind === 158 - || containingNodeKind === 161; - case 18: - return containingNodeKind === 153; - case 117: + case 23 /* CommaToken */: + return containingNodeKind === 157 /* CallExpression */ // func( a, | + || containingNodeKind === 135 /* Constructor */ // constructor( a, | public, protected, private keywords are allowed here, so show completion + || containingNodeKind === 158 /* NewExpression */ // new C(a, | + || containingNodeKind === 153 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 169 /* BinaryExpression */; // let x = (a, | + case 16 /* OpenParenToken */: + return containingNodeKind === 157 /* CallExpression */ // func( | + || containingNodeKind === 135 /* Constructor */ // constructor( | + || containingNodeKind === 158 /* NewExpression */ // new C(a| + || containingNodeKind === 161 /* ParenthesizedExpression */; // let x = (a| + case 18 /* OpenBracketToken */: + return containingNodeKind === 153 /* ArrayLiteralExpression */; // [ | + case 117 /* ModuleKeyword */: return true; - case 20: - return containingNodeKind === 205; - case 14: - return containingNodeKind === 201; - case 53: - return containingNodeKind === 198 - || containingNodeKind === 169; - case 11: - return containingNodeKind === 171; - case 12: - return containingNodeKind === 176; - case 109: - case 107: - case 108: - return containingNodeKind === 132; + case 20 /* DotToken */: + return containingNodeKind === 205 /* ModuleDeclaration */; // module A.| + case 14 /* OpenBraceToken */: + return containingNodeKind === 201 /* ClassDeclaration */; // class A{ | + case 53 /* EqualsToken */: + return containingNodeKind === 198 /* VariableDeclaration */ // let x = a| + || containingNodeKind === 169 /* BinaryExpression */; // x = a| + case 11 /* TemplateHead */: + return containingNodeKind === 171 /* TemplateExpression */; // `aa ${| + case 12 /* TemplateMiddle */: + return containingNodeKind === 176 /* TemplateSpan */; // `aa ${10} dd ${| + case 108 /* PublicKeyword */: + case 106 /* PrivateKeyword */: + case 107 /* ProtectedKeyword */: + return containingNodeKind === 132 /* PropertyDeclaration */; // class A{ public | } + // Previous token may have been a keyword that was converted to an identifier. switch (previousToken.getText()) { case "public": case "protected": @@ -30967,12 +36759,14 @@ var ts; return false; } function isInStringOrRegularExpressionOrTemplateLiteral(previousToken) { - if (previousToken.kind === 8 - || previousToken.kind === 9 + if (previousToken.kind === 8 /* StringLiteral */ + || previousToken.kind === 9 /* RegularExpressionLiteral */ || ts.isTemplateLiteralKind(previousToken.kind)) { - var start_2 = previousToken.getStart(); + // The position has to be either: 1. entirely within the token text, or + // 2. at the end position of an unterminated token. + var start_3 = previousToken.getStart(); var end = previousToken.getEnd(); - if (start_2 < position && position < end) { + if (start_3 < position && position < end) { return true; } else if (position === end) { @@ -30986,9 +36780,9 @@ var ts; if (previousToken) { var parent_8 = previousToken.parent; switch (previousToken.kind) { - case 14: - case 23: - if (parent_8 && parent_8.kind === 154) { + case 14 /* OpenBraceToken */: // let x = { | + case 23 /* CommaToken */: + if (parent_8 && parent_8.kind === 154 /* ObjectLiteralExpression */) { return parent_8; } break; @@ -30998,16 +36792,16 @@ var ts; } function isFunction(kind) { switch (kind) { - case 162: - case 163: - case 200: - case 134: - case 133: - case 136: - case 137: - case 138: - case 139: - case 140: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: + case 200 /* FunctionDeclaration */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 138 /* CallSignature */: + case 139 /* ConstructSignature */: + case 140 /* IndexSignature */: return true; } return false; @@ -31016,61 +36810,64 @@ var ts; if (previousToken) { var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { - case 23: - return containingNodeKind === 198 || - containingNodeKind === 199 || - containingNodeKind === 180 || - containingNodeKind === 204 || + case 23 /* CommaToken */: + return containingNodeKind === 198 /* VariableDeclaration */ || + containingNodeKind === 199 /* VariableDeclarationList */ || + containingNodeKind === 180 /* VariableStatement */ || + containingNodeKind === 204 /* EnumDeclaration */ || isFunction(containingNodeKind) || - containingNodeKind === 201 || - containingNodeKind === 200 || - containingNodeKind === 202 || - containingNodeKind === 151 || - containingNodeKind === 150; - case 20: - return containingNodeKind === 151; - case 18: - return containingNodeKind === 151; - case 16: - return containingNodeKind === 223 || + containingNodeKind === 201 /* ClassDeclaration */ || + containingNodeKind === 200 /* FunctionDeclaration */ || + containingNodeKind === 202 /* InterfaceDeclaration */ || + containingNodeKind === 151 /* ArrayBindingPattern */ || + containingNodeKind === 150 /* ObjectBindingPattern */; // function func({ x, y| + case 20 /* DotToken */: + return containingNodeKind === 151 /* ArrayBindingPattern */; // var [.| + case 18 /* OpenBracketToken */: + return containingNodeKind === 151 /* ArrayBindingPattern */; // var [x| + case 16 /* OpenParenToken */: + return containingNodeKind === 223 /* CatchClause */ || isFunction(containingNodeKind); - case 14: - return containingNodeKind === 204 || - containingNodeKind === 202 || - containingNodeKind === 145 || - containingNodeKind === 150; - case 22: - return containingNodeKind === 131 && - (previousToken.parent.parent.kind === 202 || - previousToken.parent.parent.kind === 145); - case 24: - return containingNodeKind === 201 || - containingNodeKind === 200 || - containingNodeKind === 202 || + case 14 /* OpenBraceToken */: + return containingNodeKind === 204 /* EnumDeclaration */ || + containingNodeKind === 202 /* InterfaceDeclaration */ || + containingNodeKind === 145 /* TypeLiteral */ || + containingNodeKind === 150 /* ObjectBindingPattern */; // function func({ x| + case 22 /* SemicolonToken */: + return containingNodeKind === 131 /* PropertySignature */ && + previousToken.parent && previousToken.parent.parent && + (previousToken.parent.parent.kind === 202 /* InterfaceDeclaration */ || + previousToken.parent.parent.kind === 145 /* TypeLiteral */); // let x : { a; | + case 24 /* LessThanToken */: + return containingNodeKind === 201 /* ClassDeclaration */ || + containingNodeKind === 200 /* FunctionDeclaration */ || + containingNodeKind === 202 /* InterfaceDeclaration */ || isFunction(containingNodeKind); - 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: + case 109 /* StaticKeyword */: + return containingNodeKind === 132 /* PropertyDeclaration */; + case 21 /* DotDotDotToken */: + return containingNodeKind === 129 /* Parameter */ || + containingNodeKind === 135 /* Constructor */ || + (previousToken.parent && previousToken.parent.parent && + previousToken.parent.parent.kind === 151 /* ArrayBindingPattern */); // var [ ...z| + case 108 /* PublicKeyword */: + case 106 /* PrivateKeyword */: + case 107 /* ProtectedKeyword */: + return containingNodeKind === 129 /* Parameter */; + case 69 /* ClassKeyword */: + case 77 /* EnumKeyword */: + case 103 /* InterfaceKeyword */: + case 83 /* FunctionKeyword */: + case 98 /* VarKeyword */: + case 116 /* GetKeyword */: + case 120 /* SetKeyword */: + case 85 /* ImportKeyword */: + case 104 /* LetKeyword */: + case 70 /* ConstKeyword */: + case 110 /* YieldKeyword */: return true; } + // Previous token may have been a keyword that was converted to an identifier. switch (previousToken.getText()) { case "class": case "interface": @@ -31087,7 +36884,7 @@ var ts; return false; } function isRightOfIllegalDot(previousToken) { - if (previousToken && previousToken.kind === 7) { + if (previousToken && previousToken.kind === 7 /* NumericLiteral */) { var text = previousToken.getFullText(); return text.charAt(text.length - 1) === "."; } @@ -31099,7 +36896,7 @@ var ts; return exports; } if (importDeclaration.importClause.namedBindings && - importDeclaration.importClause.namedBindings.kind === 212) { + importDeclaration.importClause.namedBindings.kind === 212 /* NamedImports */) { ts.forEach(importDeclaration.importClause.namedBindings.elements, function (el) { var name = el.propertyName || el.name; exisingImports[name.text] = true; @@ -31116,12 +36913,15 @@ var ts; } var existingMemberNames = {}; ts.forEach(existingMembers, function (m) { - if (m.kind !== 224 && m.kind !== 225) { + if (m.kind !== 224 /* PropertyAssignment */ && m.kind !== 225 /* ShorthandPropertyAssignment */) { + // Ignore omitted expressions for missing members in the object literal return; } if (m.getStart() <= position && position <= m.getEnd()) { + // If this is the current item we are editing right now, do not filter it out return; } + // TODO(jfreeman): Account for computed property name existingMemberNames[m.name.text] = true; }); var filteredMembers = []; @@ -31139,27 +36939,84 @@ var ts; 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 symbols = completionData.symbols, isMemberCompletion = completionData.isMemberCompletion, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, isRightOfDot = completionData.isRightOfDot; + var entries; + if (isRightOfDot && ts.isJavaScript(fileName)) { + entries = getCompletionEntriesFromSymbols(symbols); + ts.addRange(entries, getJavaScriptCompletionEntries()); } - var entries = getCompletionEntriesFromSymbols(symbols); + else { + if (!symbols || symbols.length === 0) { + return undefined; + } + entries = getCompletionEntriesFromSymbols(symbols); + } + // Add keywords if this is not a member completion list if (!isMemberCompletion) { ts.addRange(entries, keywordCompletions); } return { isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; + function getJavaScriptCompletionEntries() { + var entries = []; + var allNames = {}; + var target = program.getCompilerOptions().target; + for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { + var sourceFile = _a[_i]; + var nameTable = getNameTable(sourceFile); + for (var name_24 in nameTable) { + if (!allNames[name_24]) { + allNames[name_24] = name_24; + var displayName = getCompletionEntryDisplayName(name_24, target, true); + if (displayName) { + var entry = { + name: displayName, + kind: ScriptElementKind.warning, + kindModifiers: "", + sortText: "1" + }; + entries.push(entry); + } + } + } + } + return entries; + } + function createCompletionEntry(symbol, location) { + // Try to get a valid display name for this symbol, if we could not find one, then ignore it. + // We would like to only show things that can be added after a dot, so for instance numeric properties can + // not be accessed with a dot (a.1 <- invalid) + var displayName = getCompletionEntryDisplayNameForSymbol(symbol, program.getCompilerOptions().target, 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. + // 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, location), + kindModifiers: getSymbolModifiers(symbol), + sortText: "0" + }; + } 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; + if (symbols) { + var nameToSymbol = {}; + for (var _i = 0; _i < symbols.length; _i++) { + var symbol = symbols[_i]; + var entry = createCompletionEntry(symbol, location); + if (entry) { + var id = ts.escapeIdentifier(entry.name); + if (!ts.lookUp(nameToSymbol, id)) { + entries.push(entry); + nameToSymbol[id] = symbol; + } } } } @@ -31169,13 +37026,18 @@ var ts; } function getCompletionEntryDetails(fileName, position, entryName) { synchronizeHostData(); + // Compute all the completion symbols again. var completionData = getCompletionData(fileName, position); if (completionData) { var symbols = completionData.symbols, location_2 = completionData.location; + // Find the symbol with the matching entry name. var target = program.getCompilerOptions().target; - var symbol = ts.forEach(symbols, function (s) { return getCompletionEntryDisplayName(s, target, false) === entryName ? s : undefined; }); + // We don't need to perform character checks here because we're only comparing the + // name against 'entryName' (which is known to be good), not building a new + // completion entry. + var symbol = ts.forEach(symbols, function (s) { return getCompletionEntryDisplayNameForSymbol(s, target, false) === entryName ? s : undefined; }); if (symbol) { - var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location_2, typeInfoResolver, location_2, 7); + var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location_2, location_2, 7 /* All */); return { name: entryName, kind: displayPartsDocumentationsAndSymbolKind.symbolKind, @@ -31185,6 +37047,7 @@ var ts; }; } } + // Didn't find a symbol with this name. See if we can find a keyword instead. var keywordCompletion = ts.forEach(keywordCompletions, function (c) { return c.name === entryName; }); if (keywordCompletion) { return { @@ -31197,39 +37060,41 @@ var ts; } return undefined; } - function getSymbolKind(symbol, typeResolver, location) { + // TODO(drosen): use contextual SemanticMeaning. + function getSymbolKind(symbol, location) { var flags = symbol.getFlags(); - if (flags & 32) + if (flags & 32 /* Class */) return ScriptElementKind.classElement; - if (flags & 384) + if (flags & 384 /* Enum */) return ScriptElementKind.enumElement; - if (flags & 524288) + if (flags & 524288 /* TypeAlias */) return ScriptElementKind.typeElement; - if (flags & 64) + if (flags & 64 /* Interface */) return ScriptElementKind.interfaceElement; - if (flags & 262144) + if (flags & 262144 /* TypeParameter */) return ScriptElementKind.typeParameterElement; - var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver, location); + var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, location); if (result === ScriptElementKind.unknown) { - if (flags & 262144) + if (flags & 262144 /* TypeParameter */) return ScriptElementKind.typeParameterElement; - if (flags & 8) + if (flags & 8 /* EnumMember */) return ScriptElementKind.variableElement; - if (flags & 8388608) + if (flags & 8388608 /* Alias */) return ScriptElementKind.alias; - if (flags & 1536) + if (flags & 1536 /* Module */) return ScriptElementKind.moduleElement; } return result; } - function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver, location) { - if (typeResolver.isUndefinedSymbol(symbol)) { + function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, location) { + var typeChecker = program.getTypeChecker(); + if (typeChecker.isUndefinedSymbol(symbol)) { return ScriptElementKind.variableElement; } - if (typeResolver.isArgumentsSymbol(symbol)) { + if (typeChecker.isArgumentsSymbol(symbol)) { return ScriptElementKind.localVariableElement; } - if (flags & 3) { + if (flags & 3 /* Variable */) { if (ts.isFirstDeclarationOfSymbolParameter(symbol)) { return ScriptElementKind.parameterElement; } @@ -31241,27 +37106,30 @@ var ts; } return isLocalVariableOrFunction(symbol) ? ScriptElementKind.localVariableElement : ScriptElementKind.variableElement; } - if (flags & 16) + if (flags & 16 /* Function */) return isLocalVariableOrFunction(symbol) ? ScriptElementKind.localFunctionElement : ScriptElementKind.functionElement; - if (flags & 32768) + if (flags & 32768 /* GetAccessor */) return ScriptElementKind.memberGetAccessorElement; - if (flags & 65536) + if (flags & 65536 /* SetAccessor */) return ScriptElementKind.memberSetAccessorElement; - if (flags & 8192) + if (flags & 8192 /* Method */) return ScriptElementKind.memberFunctionElement; - if (flags & 16384) + if (flags & 16384 /* Constructor */) return ScriptElementKind.constructorImplementationElement; - if (flags & 4) { - if (flags & 268435456) { - var unionPropertyKind = ts.forEach(typeInfoResolver.getRootSymbols(symbol), function (rootSymbol) { + if (flags & 4 /* Property */) { + if (flags & 268435456 /* UnionProperty */) { + // If union property is result of union of non method (property/accessors/variables), it is labeled as property + var unionPropertyKind = ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) { var rootSymbolFlags = rootSymbol.getFlags(); - if (rootSymbolFlags & (98308 | 3)) { + if (rootSymbolFlags & (98308 /* PropertyOrAccessor */ | 3 /* Variable */)) { return ScriptElementKind.memberVariableElement; } - ts.Debug.assert(!!(rootSymbolFlags & 8192)); + ts.Debug.assert(!!(rootSymbolFlags & 8192 /* Method */)); }); if (!unionPropertyKind) { - var typeOfUnionProperty = typeInfoResolver.getTypeOfSymbolAtLocation(symbol, location); + // If this was union of all methods, + //make sure it has call signatures before we can label it as method + var typeOfUnionProperty = typeChecker.getTypeOfSymbolAtLocation(symbol, location); if (typeOfUnionProperty.getCallSignatures().length) { return ScriptElementKind.memberFunctionElement; } @@ -31275,17 +37143,17 @@ var ts; } function getTypeKind(type) { var flags = type.getFlags(); - if (flags & 128) + if (flags & 128 /* Enum */) return ScriptElementKind.enumElement; - if (flags & 1024) + if (flags & 1024 /* Class */) return ScriptElementKind.classElement; - if (flags & 2048) + if (flags & 2048 /* Interface */) return ScriptElementKind.interfaceElement; - if (flags & 512) + if (flags & 512 /* TypeParameter */) return ScriptElementKind.typeParameterElement; - if (flags & 1048703) + if (flags & 1048703 /* Intrinsic */) return ScriptElementKind.primitiveType; - if (flags & 256) + if (flags & 256 /* StringLiteral */) return ScriptElementKind.primitiveType; return ScriptElementKind.unknown; } @@ -31294,29 +37162,35 @@ var ts; ? ts.getNodeModifiers(symbol.declarations[0]) : ScriptElementKindModifier.none; } - function getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, enclosingDeclaration, typeResolver, location, semanticMeaning) { + // TODO(drosen): Currently completion entry details passes the SemanticMeaning.All instead of using semanticMeaning of location + function getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, enclosingDeclaration, location, semanticMeaning) { if (semanticMeaning === void 0) { semanticMeaning = getMeaningFromLocation(location); } + var typeChecker = program.getTypeChecker(); var displayParts = []; var documentation; var symbolFlags = symbol.flags; - var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, typeResolver, location); + var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, location); var hasAddedSymbolInfo; var type; - if (symbolKind !== ScriptElementKind.unknown || symbolFlags & 32 || symbolFlags & 8388608) { + // Class at constructor site need to be shown as constructor apart from property,method, vars + if (symbolKind !== ScriptElementKind.unknown || symbolFlags & 32 /* Class */ || symbolFlags & 8388608 /* Alias */) { + // If it is accessor they are allowed only if location is at name of the accessor if (symbolKind === ScriptElementKind.memberGetAccessorElement || symbolKind === ScriptElementKind.memberSetAccessorElement) { symbolKind = ScriptElementKind.memberVariableElement; } var signature; - type = typeResolver.getTypeOfSymbolAtLocation(symbol, location); + type = typeChecker.getTypeOfSymbolAtLocation(symbol, location); if (type) { - if (location.parent && location.parent.kind === 155) { + if (location.parent && location.parent.kind === 155 /* PropertyAccessExpression */) { var right = location.parent.name; + // Either the location is on the right of a property access, or on the left and the right is missing if (right === location || (right && right.getFullWidth() === 0)) { location = location.parent; } } + // try get the call/construct signature from the type if it matches var callExpression; - if (location.kind === 157 || location.kind === 158) { + if (location.kind === 157 /* CallExpression */ || location.kind === 158 /* NewExpression */) { callExpression = location; } else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { @@ -31324,26 +37198,29 @@ var ts; } if (callExpression) { var candidateSignatures = []; - signature = typeResolver.getResolvedSignature(callExpression, candidateSignatures); + signature = typeChecker.getResolvedSignature(callExpression, candidateSignatures); if (!signature && candidateSignatures.length) { + // Use the first candidate: signature = candidateSignatures[0]; } - var useConstructSignatures = callExpression.kind === 158 || callExpression.expression.kind === 91; + var useConstructSignatures = callExpression.kind === 158 /* NewExpression */ || callExpression.expression.kind === 91 /* SuperKeyword */; var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target || signature)) { + // Get the first signature if there signature = allSignatures.length ? allSignatures[0] : undefined; } if (signature) { - if (useConstructSignatures && (symbolFlags & 32)) { + if (useConstructSignatures && (symbolFlags & 32 /* Class */)) { + // Constructor symbolKind = ScriptElementKind.constructorImplementationElement; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } - else if (symbolFlags & 8388608) { + else if (symbolFlags & 8388608 /* Alias */) { symbolKind = ScriptElementKind.alias; pushTypePart(symbolKind); displayParts.push(ts.spacePart()); if (useConstructSignatures) { - displayParts.push(ts.keywordPart(88)); + displayParts.push(ts.keywordPart(88 /* NewKeyword */)); displayParts.push(ts.spacePart()); } addFullSymbolName(symbol); @@ -31358,147 +37235,154 @@ var ts; case ScriptElementKind.letElement: case ScriptElementKind.parameterElement: case ScriptElementKind.localVariableElement: - displayParts.push(ts.punctuationPart(51)); + // If it is call or construct signature of lambda's write type name + displayParts.push(ts.punctuationPart(51 /* ColonToken */)); displayParts.push(ts.spacePart()); if (useConstructSignatures) { - displayParts.push(ts.keywordPart(88)); + displayParts.push(ts.keywordPart(88 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - if (!(type.flags & 32768)) { - displayParts.push.apply(displayParts, ts.symbolToDisplayParts(typeResolver, type.symbol, enclosingDeclaration, undefined, 1)); + if (!(type.flags & 32768 /* Anonymous */)) { + displayParts.push.apply(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, undefined, 1 /* WriteTypeParametersOrArguments */)); } - addSignatureDisplayParts(signature, allSignatures, 8); + addSignatureDisplayParts(signature, allSignatures, 8 /* WriteArrowStyleSignature */); break; default: + // Just signature addSignatureDisplayParts(signature, allSignatures); } hasAddedSymbolInfo = true; } } - else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304)) || - (location.kind === 114 && location.parent.kind === 135)) { + else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304 /* Accessor */)) || + (location.kind === 114 /* ConstructorKeyword */ && location.parent.kind === 135 /* Constructor */)) { + // get the signature from the declaration and write it var functionDeclaration = location.parent; - var allSignatures = functionDeclaration.kind === 135 ? type.getConstructSignatures() : type.getCallSignatures(); - if (!typeResolver.isImplementationOfOverload(functionDeclaration)) { - signature = typeResolver.getSignatureFromDeclaration(functionDeclaration); + var allSignatures = functionDeclaration.kind === 135 /* Constructor */ ? type.getConstructSignatures() : type.getCallSignatures(); + if (!typeChecker.isImplementationOfOverload(functionDeclaration)) { + signature = typeChecker.getSignatureFromDeclaration(functionDeclaration); } else { signature = allSignatures[0]; } - if (functionDeclaration.kind === 135) { + if (functionDeclaration.kind === 135 /* Constructor */) { + // show (constructor) Type(...) signature symbolKind = ScriptElementKind.constructorImplementationElement; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { - addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 138 && - !(type.symbol.flags & 2048 || type.symbol.flags & 4096) ? type.symbol : symbol, symbolKind); + // (function/method) symbol(..signature) + addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 138 /* CallSignature */ && + !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); hasAddedSymbolInfo = true; } } } - if (symbolFlags & 32 && !hasAddedSymbolInfo) { - displayParts.push(ts.keywordPart(69)); + if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo) { + displayParts.push(ts.keywordPart(69 /* ClassKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); } - if ((symbolFlags & 64) && (semanticMeaning & 2)) { + if ((symbolFlags & 64 /* Interface */) && (semanticMeaning & 2 /* Type */)) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(104)); + displayParts.push(ts.keywordPart(103 /* InterfaceKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); } - if (symbolFlags & 524288) { + if (symbolFlags & 524288 /* TypeAlias */) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(123)); + displayParts.push(ts.keywordPart(123 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(53)); + displayParts.push(ts.operatorPart(53 /* EqualsToken */)); displayParts.push(ts.spacePart()); - displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeResolver, typeResolver.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration)); + displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration)); } - if (symbolFlags & 384) { + if (symbolFlags & 384 /* Enum */) { addNewLineIfDisplayPartsExist(); if (ts.forEach(symbol.declarations, ts.isConstEnumDeclaration)) { - displayParts.push(ts.keywordPart(70)); + displayParts.push(ts.keywordPart(70 /* ConstKeyword */)); displayParts.push(ts.spacePart()); } - displayParts.push(ts.keywordPart(77)); + displayParts.push(ts.keywordPart(77 /* EnumKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } - if (symbolFlags & 1536) { + if (symbolFlags & 1536 /* Module */) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(117)); + displayParts.push(ts.keywordPart(117 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } - if ((symbolFlags & 262144) && (semanticMeaning & 2)) { + if ((symbolFlags & 262144 /* TypeParameter */) && (semanticMeaning & 2 /* Type */)) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.punctuationPart(16)); + displayParts.push(ts.punctuationPart(16 /* OpenParenToken */)); displayParts.push(ts.textPart("type parameter")); - displayParts.push(ts.punctuationPart(17)); + displayParts.push(ts.punctuationPart(17 /* CloseParenToken */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(86)); + displayParts.push(ts.keywordPart(86 /* InKeyword */)); displayParts.push(ts.spacePart()); if (symbol.parent) { + // Class/Interface type parameter addFullSymbolName(symbol.parent, enclosingDeclaration); writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration); } else { - var signatureDeclaration = ts.getDeclarationOfKind(symbol, 128).parent; - var signature = typeResolver.getSignatureFromDeclaration(signatureDeclaration); - if (signatureDeclaration.kind === 139) { - displayParts.push(ts.keywordPart(88)); + // Method/function type parameter + var signatureDeclaration = ts.getDeclarationOfKind(symbol, 128 /* TypeParameter */).parent; + var signature = typeChecker.getSignatureFromDeclaration(signatureDeclaration); + if (signatureDeclaration.kind === 139 /* ConstructSignature */) { + displayParts.push(ts.keywordPart(88 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - else if (signatureDeclaration.kind !== 138 && signatureDeclaration.name) { + else if (signatureDeclaration.kind !== 138 /* CallSignature */ && signatureDeclaration.name) { addFullSymbolName(signatureDeclaration.symbol); } - displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeResolver, signature, sourceFile, 32)); + displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); } } - if (symbolFlags & 8) { + if (symbolFlags & 8 /* EnumMember */) { addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 226) { - var constantValue = typeResolver.getConstantValue(declaration); + if (declaration.kind === 226 /* EnumMember */) { + var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(53)); + displayParts.push(ts.operatorPart(53 /* EqualsToken */)); displayParts.push(ts.spacePart()); displayParts.push(ts.displayPart(constantValue.toString(), SymbolDisplayPartKind.numericLiteral)); } } } - if (symbolFlags & 8388608) { + if (symbolFlags & 8388608 /* Alias */) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(85)); + displayParts.push(ts.keywordPart(85 /* ImportKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 208) { + if (declaration.kind === 208 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(53)); + displayParts.push(ts.operatorPart(53 /* EqualsToken */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(118)); - displayParts.push(ts.punctuationPart(16)); + displayParts.push(ts.keywordPart(118 /* RequireKeyword */)); + displayParts.push(ts.punctuationPart(16 /* OpenParenToken */)); displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), SymbolDisplayPartKind.stringLiteral)); - displayParts.push(ts.punctuationPart(17)); + displayParts.push(ts.punctuationPart(17 /* CloseParenToken */)); } else { - var internalAliasSymbol = typeResolver.getSymbolAtLocation(importEqualsDeclaration.moduleReference); + var internalAliasSymbol = typeChecker.getSymbolAtLocation(importEqualsDeclaration.moduleReference); if (internalAliasSymbol) { displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(53)); + displayParts.push(ts.operatorPart(53 /* EqualsToken */)); displayParts.push(ts.spacePart()); addFullSymbolName(internalAliasSymbol, enclosingDeclaration); } @@ -31511,26 +37395,28 @@ var ts; if (symbolKind !== ScriptElementKind.unknown) { if (type) { addPrefixForAnyFunctionOrVar(symbol, symbolKind); + // For properties, variables and local vars: show the type if (symbolKind === ScriptElementKind.memberVariableElement || - symbolFlags & 3 || + symbolFlags & 3 /* Variable */ || symbolKind === ScriptElementKind.localVariableElement) { - displayParts.push(ts.punctuationPart(51)); + displayParts.push(ts.punctuationPart(51 /* ColonToken */)); displayParts.push(ts.spacePart()); - if (type.symbol && type.symbol.flags & 262144) { + // If the type is type parameter, format it specially + if (type.symbol && type.symbol.flags & 262144 /* TypeParameter */) { var typeParameterParts = ts.mapToDisplayParts(function (writer) { - typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration); + typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration); }); displayParts.push.apply(displayParts, typeParameterParts); } else { - displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeResolver, type, enclosingDeclaration)); + displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeChecker, type, enclosingDeclaration)); } } - else if (symbolFlags & 16 || - symbolFlags & 8192 || - symbolFlags & 16384 || - symbolFlags & 131072 || - symbolFlags & 98304 || + else if (symbolFlags & 16 /* Function */ || + symbolFlags & 8192 /* Method */ || + symbolFlags & 16384 /* Constructor */ || + symbolFlags & 131072 /* Signature */ || + symbolFlags & 98304 /* Accessor */ || symbolKind === ScriptElementKind.memberFunctionElement) { var allSignatures = type.getCallSignatures(); addSignatureDisplayParts(allSignatures[0], allSignatures); @@ -31538,7 +37424,7 @@ var ts; } } else { - symbolKind = getSymbolKind(symbol, typeResolver, location); + symbolKind = getSymbolKind(symbol, location); } } if (!documentation) { @@ -31551,7 +37437,7 @@ var ts; } } function addFullSymbolName(symbol, enclosingDeclaration) { - var fullSymbolDisplayParts = ts.symbolToDisplayParts(typeResolver, symbol, enclosingDeclaration || sourceFile, undefined, 1 | 2); + var fullSymbolDisplayParts = ts.symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration || sourceFile, undefined, 1 /* WriteTypeParametersOrArguments */ | 2 /* UseOnlyExternalAliasing */); displayParts.push.apply(displayParts, fullSymbolDisplayParts); } function addPrefixForAnyFunctionOrVar(symbol, symbolKind) { @@ -31572,28 +37458,28 @@ var ts; displayParts.push(ts.textOrKeywordPart(symbolKind)); return; default: - displayParts.push(ts.punctuationPart(16)); + displayParts.push(ts.punctuationPart(16 /* OpenParenToken */)); displayParts.push(ts.textOrKeywordPart(symbolKind)); - displayParts.push(ts.punctuationPart(17)); + displayParts.push(ts.punctuationPart(17 /* CloseParenToken */)); return; } } function addSignatureDisplayParts(signature, allSignatures, flags) { - displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeResolver, signature, enclosingDeclaration, flags | 32)); + displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | 32 /* WriteTypeArgumentsOfSignature */)); if (allSignatures.length > 1) { displayParts.push(ts.spacePart()); - displayParts.push(ts.punctuationPart(16)); - displayParts.push(ts.operatorPart(33)); + displayParts.push(ts.punctuationPart(16 /* OpenParenToken */)); + displayParts.push(ts.operatorPart(33 /* PlusToken */)); 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)); + displayParts.push(ts.punctuationPart(17 /* CloseParenToken */)); } documentation = signature.getDocumentationComment(); } function writeTypeParametersOfSymbol(symbol, enclosingDeclaration) { var typeParameterParts = ts.mapToDisplayParts(function (writer) { - typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration); + typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration); }); displayParts.push.apply(displayParts, typeParameterParts); } @@ -31605,28 +37491,34 @@ var ts; if (!node) { return undefined; } - var symbol = typeInfoResolver.getSymbolAtLocation(node); + if (isLabelName(node)) { + return undefined; + } + var typeChecker = program.getTypeChecker(); + var symbol = typeChecker.getSymbolAtLocation(node); if (!symbol) { + // Try getting just type at this position and show switch (node.kind) { - case 65: - case 155: - case 126: - case 93: - case 91: - var type = typeInfoResolver.getTypeAtLocation(node); + case 65 /* Identifier */: + case 155 /* PropertyAccessExpression */: + case 126 /* QualifiedName */: + case 93 /* ThisKeyword */: + case 91 /* SuperKeyword */: + // For the identifiers/this/super etc get the type at position + var type = typeChecker.getTypeAtLocation(node); if (type) { return { kind: ScriptElementKind.unknown, kindModifiers: ScriptElementKindModifier.none, textSpan: ts.createTextSpan(node.getStart(), node.getWidth()), - displayParts: ts.typeToDisplayParts(typeInfoResolver, type, getContainerNode(node)), + displayParts: ts.typeToDisplayParts(typeChecker, type, getContainerNode(node)), documentation: type.symbol ? type.symbol.getDocumentationComment() : undefined }; } } return undefined; } - var displayPartsDocumentationsAndKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, getContainerNode(node), typeInfoResolver, node); + var displayPartsDocumentationsAndKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, getContainerNode(node), node); return { kind: displayPartsDocumentationsAndKind.symbolKind, kindModifiers: getSymbolModifiers(symbol), @@ -31645,6 +37537,7 @@ var ts; containerName: containerName }; } + /// Goto definition function getDefinitionAtPosition(fileName, position) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); @@ -31652,11 +37545,13 @@ var ts; if (!node) { return undefined; } + // Labels if (isJumpStatementTarget(node)) { var labelName = node.text; var label = getTargetLabel(node.parent, node.text); return label ? [createDefinitionInfo(label, ScriptElementKind.label, labelName, undefined)] : undefined; } + /// Triple slash reference comments var comment = ts.forEach(sourceFile.referencedFiles, function (r) { return (r.pos <= position && position < r.end) ? r : undefined; }); if (comment) { var referenceFile = ts.tryResolveScriptReference(program, sourceFile, comment); @@ -31672,45 +37567,60 @@ var ts; } return undefined; } - var symbol = typeInfoResolver.getSymbolAtLocation(node); + var typeChecker = program.getTypeChecker(); + var symbol = typeChecker.getSymbolAtLocation(node); + // Could not find a symbol e.g. node is string or number keyword, + // or the symbol was an internal symbol and does not have a declaration e.g. undefined symbol if (!symbol) { return undefined; } - if (symbol.flags & 8388608) { + // If this is an alias, and the request came at the declaration location + // get the aliased symbol instead. This allows for goto def on an import e.g. + // import {A, B} from "mod"; + // to jump to the implementation directly. + if (symbol.flags & 8388608 /* Alias */) { var declaration = symbol.declarations[0]; - if (node.kind === 65 && node.parent === declaration) { - symbol = typeInfoResolver.getAliasedSymbol(symbol); + if (node.kind === 65 /* Identifier */ && node.parent === declaration) { + symbol = typeChecker.getAliasedSymbol(symbol); } } - if (node.parent.kind === 225) { - var shorthandSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); + // Because name in short-hand property assignment has two different meanings: property name and property value, + // using go-to-definition at such position should go to the variable declaration of the property value rather than + // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition + // is performed at the location of property access, we would like to go to definition of the property in the short-hand + // assignment. This case and others are handled by the following code. + if (node.parent.kind === 225 /* ShorthandPropertyAssignment */) { + var shorthandSymbol = typeChecker.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); + var shorthandSymbolKind = getSymbolKind(shorthandSymbol, node); + var shorthandSymbolName = typeChecker.symbolToString(shorthandSymbol); + var shorthandContainerName = typeChecker.symbolToString(symbol.parent, node); return ts.map(shorthandDeclarations, function (declaration) { return createDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName); }); } var result = []; var declarations = symbol.getDeclarations(); - var symbolName = typeInfoResolver.symbolToString(symbol); - var symbolKind = getSymbolKind(symbol, typeInfoResolver, node); + var symbolName = typeChecker.symbolToString(symbol); // Do not get scoped name, just the name of the symbol + var symbolKind = getSymbolKind(symbol, node); var containerSymbol = symbol.parent; - var containerName = containerSymbol ? typeInfoResolver.symbolToString(containerSymbol, node) : ""; + var containerName = containerSymbol ? typeChecker.symbolToString(containerSymbol, node) : ""; if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { + // Just add all the declarations. ts.forEach(declarations, function (declaration) { result.push(createDefinitionInfo(declaration, symbolKind, symbolName, containerName)); }); } return result; function tryAddConstructSignature(symbol, location, symbolKind, symbolName, containerName, result) { - if (isNewExpressionTarget(location) || location.kind === 114) { - if (symbol.flags & 32) { + // Applicable only if we are in a new expression, or we are on a constructor declaration + // and in either case the symbol has a construct signature definition, i.e. class + if (isNewExpressionTarget(location) || location.kind === 114 /* ConstructorKeyword */) { + if (symbol.flags & 32 /* Class */) { var classDeclaration = symbol.getDeclarations()[0]; - ts.Debug.assert(classDeclaration && classDeclaration.kind === 201); + ts.Debug.assert(classDeclaration && classDeclaration.kind === 201 /* ClassDeclaration */); return tryAddSignature(classDeclaration.members, true, symbolKind, symbolName, containerName, result); } } @@ -31726,8 +37636,8 @@ var ts; var declarations = []; var definition; ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 135) || - (!selectConstructors && (d.kind === 200 || d.kind === 134 || d.kind === 133))) { + if ((selectConstructors && d.kind === 135 /* Constructor */) || + (!selectConstructors && (d.kind === 200 /* FunctionDeclaration */ || d.kind === 134 /* MethodDeclaration */ || d.kind === 133 /* MethodSignature */))) { declarations.push(d); if (d.body) definition = d; @@ -31748,430 +37658,542 @@ var ts; 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 + "."); - }); + // Get occurrences only supports reporting occurrences for the file queried. So + // filter down to that list. + results = ts.filter(results, function (r) { return getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile; }); } return results; } - function getOccurrencesAtPositionCore(fileName, position) { + function getDocumentHighlights(fileName, position, filesToSearch) { synchronizeHostData(); + filesToSearch = ts.map(filesToSearch, ts.normalizeSlashes); + var sourceFilesToSearch = ts.filter(program.getSourceFiles(), function (f) { return ts.contains(filesToSearch, f.fileName); }); var sourceFile = getValidSourceFile(fileName); var node = ts.getTouchingWord(sourceFile, position); if (!node) { return undefined; } - if (node.kind === 65 || node.kind === 93 || node.kind === 91 || - isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { - return convertReferences(getReferencesForNode(node, [sourceFile], true, false, false)); + return getSemanticDocumentHighlights(node) || getSyntacticDocumentHighlights(node); + function getHighlightSpanForNode(node) { + var start = node.getStart(); + var end = node.getEnd(); + return { + fileName: sourceFile.fileName, + textSpan: ts.createTextSpanFromBounds(start, end), + kind: HighlightSpanKind.none + }; } - switch (node.kind) { - case 84: - case 76: - if (hasKind(node.parent, 183)) { - return getIfElseOccurrences(node.parent); - } - break; - case 90: - if (hasKind(node.parent, 191)) { - return getReturnOccurrences(node.parent); - } - break; - case 94: - if (hasKind(node.parent, 195)) { - return getThrowOccurrences(node.parent); - } - break; - case 68: - if (hasKind(parent(parent(node)), 196)) { - return getTryCatchFinallyOccurrences(node.parent.parent); - } - break; - case 96: - case 81: - if (hasKind(parent(node), 196)) { - return getTryCatchFinallyOccurrences(node.parent); - } - break; - case 92: - if (hasKind(node.parent, 193)) { - return getSwitchCaseDefaultOccurrences(node.parent); - } - break; - case 67: - case 73: - if (hasKind(parent(parent(parent(node))), 193)) { - return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); - } - break; - case 66: - case 71: - if (hasKind(node.parent, 190) || hasKind(node.parent, 189)) { - return getBreakOrContinueStatementOccurences(node.parent); - } - break; - case 82: - if (hasKind(node.parent, 186) || - hasKind(node.parent, 187) || - hasKind(node.parent, 188)) { - return getLoopBreakContinueOccurrences(node.parent); - } - break; - case 100: - case 75: - if (hasKind(node.parent, 185) || hasKind(node.parent, 184)) { - return getLoopBreakContinueOccurrences(node.parent); - } - break; - case 114: - if (hasKind(node.parent, 135)) { - return getConstructorOccurrences(node.parent); - } - break; - 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 === 180)) { - return getModifierOccurrences(node.kind, node.parent); - } - } - return undefined; - function getIfElseOccurrences(ifStatement) { - var keywords = []; - while (hasKind(ifStatement.parent, 183) && ifStatement.parent.elseStatement === ifStatement) { - ifStatement = ifStatement.parent; + function getSemanticDocumentHighlights(node) { + if (node.kind === 65 /* Identifier */ || + node.kind === 93 /* ThisKeyword */ || + node.kind === 91 /* SuperKeyword */ || + isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || + isNameOfExternalModuleImportOrDeclaration(node)) { + var referencedSymbols = getReferencedSymbolsForNodes(node, sourceFilesToSearch, false, false); + return convertReferencedSymbols(referencedSymbols); } - while (ifStatement) { - var children = ifStatement.getChildren(); - pushKeywordIf(keywords, children[0], 84); - for (var i = children.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, children[i], 76)) { + return undefined; + function convertReferencedSymbols(referencedSymbols) { + if (!referencedSymbols) { + return undefined; + } + var fileNameToDocumentHighlights = {}; + var result = []; + for (var _i = 0; _i < referencedSymbols.length; _i++) { + var referencedSymbol = referencedSymbols[_i]; + for (var _a = 0, _b = referencedSymbol.references; _a < _b.length; _a++) { + var referenceEntry = _b[_a]; + var fileName_1 = referenceEntry.fileName; + var documentHighlights = ts.getProperty(fileNameToDocumentHighlights, fileName_1); + if (!documentHighlights) { + documentHighlights = { fileName: fileName_1, highlightSpans: [] }; + fileNameToDocumentHighlights[fileName_1] = documentHighlights; + result.push(documentHighlights); + } + documentHighlights.highlightSpans.push({ + textSpan: referenceEntry.textSpan, + kind: referenceEntry.isWriteAccess ? HighlightSpanKind.writtenReference : HighlightSpanKind.reference + }); + } + } + return result; + } + } + function getSyntacticDocumentHighlights(node) { + var fileName = sourceFile.fileName; + var highlightSpans = getHighlightSpans(node); + if (!highlightSpans || highlightSpans.length === 0) { + return undefined; + } + return [{ fileName: fileName, highlightSpans: highlightSpans }]; + // returns true if 'node' is defined and has a matching 'kind'. + function hasKind(node, kind) { + return node !== undefined && node.kind === kind; + } + // Null-propagating 'parent' function. + function parent(node) { + return node && node.parent; + } + function getHighlightSpans(node) { + if (node) { + switch (node.kind) { + case 84 /* IfKeyword */: + case 76 /* ElseKeyword */: + if (hasKind(node.parent, 183 /* IfStatement */)) { + return getIfElseOccurrences(node.parent); + } + break; + case 90 /* ReturnKeyword */: + if (hasKind(node.parent, 191 /* ReturnStatement */)) { + return getReturnOccurrences(node.parent); + } + break; + case 94 /* ThrowKeyword */: + if (hasKind(node.parent, 195 /* ThrowStatement */)) { + return getThrowOccurrences(node.parent); + } + break; + case 68 /* CatchKeyword */: + if (hasKind(parent(parent(node)), 196 /* TryStatement */)) { + return getTryCatchFinallyOccurrences(node.parent.parent); + } + break; + case 96 /* TryKeyword */: + case 81 /* FinallyKeyword */: + if (hasKind(parent(node), 196 /* TryStatement */)) { + return getTryCatchFinallyOccurrences(node.parent); + } + break; + case 92 /* SwitchKeyword */: + if (hasKind(node.parent, 193 /* SwitchStatement */)) { + return getSwitchCaseDefaultOccurrences(node.parent); + } + break; + case 67 /* CaseKeyword */: + case 73 /* DefaultKeyword */: + if (hasKind(parent(parent(parent(node))), 193 /* SwitchStatement */)) { + return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); + } + break; + case 66 /* BreakKeyword */: + case 71 /* ContinueKeyword */: + if (hasKind(node.parent, 190 /* BreakStatement */) || hasKind(node.parent, 189 /* ContinueStatement */)) { + return getBreakOrContinueStatementOccurences(node.parent); + } + break; + case 82 /* ForKeyword */: + if (hasKind(node.parent, 186 /* ForStatement */) || + hasKind(node.parent, 187 /* ForInStatement */) || + hasKind(node.parent, 188 /* ForOfStatement */)) { + return getLoopBreakContinueOccurrences(node.parent); + } + break; + case 100 /* WhileKeyword */: + case 75 /* DoKeyword */: + if (hasKind(node.parent, 185 /* WhileStatement */) || hasKind(node.parent, 184 /* DoStatement */)) { + return getLoopBreakContinueOccurrences(node.parent); + } + break; + case 114 /* ConstructorKeyword */: + if (hasKind(node.parent, 135 /* Constructor */)) { + return getConstructorOccurrences(node.parent); + } + break; + case 116 /* GetKeyword */: + case 120 /* SetKeyword */: + if (hasKind(node.parent, 136 /* GetAccessor */) || hasKind(node.parent, 137 /* SetAccessor */)) { + return getGetAndSetOccurrences(node.parent); + } + default: + if (ts.isModifier(node.kind) && node.parent && + (ts.isDeclaration(node.parent) || node.parent.kind === 180 /* VariableStatement */)) { + return getModifierOccurrences(node.kind, node.parent); + } + } + } + return undefined; + } + /** + * Aggregates all throw-statements within this node *without* crossing + * into function boundaries and try-blocks with catch-clauses. + */ + function aggregateOwnedThrowStatements(node) { + var statementAccumulator = []; + aggregate(node); + return statementAccumulator; + function aggregate(node) { + if (node.kind === 195 /* ThrowStatement */) { + statementAccumulator.push(node); + } + else if (node.kind === 196 /* TryStatement */) { + var tryStatement = node; + if (tryStatement.catchClause) { + aggregate(tryStatement.catchClause); + } + else { + // Exceptions thrown within a try block lacking a catch clause + // are "owned" in the current context. + aggregate(tryStatement.tryBlock); + } + if (tryStatement.finallyBlock) { + aggregate(tryStatement.finallyBlock); + } + } + else if (!ts.isFunctionLike(node)) { + ts.forEachChild(node, aggregate); + } + } + ; + } + /** + * For lack of a better name, this function takes a throw statement and returns the + * nearest ancestor that is a try-block (whose try statement has a catch clause), + * function-block, or source file. + */ + function getThrowStatementOwner(throwStatement) { + var child = throwStatement; + while (child.parent) { + var parent_9 = child.parent; + if (ts.isFunctionBlock(parent_9) || parent_9.kind === 227 /* SourceFile */) { + return parent_9; + } + // A throw-statement is only owned by a try-statement if the try-statement has + // a catch clause, and if the throw-statement occurs within the try block. + if (parent_9.kind === 196 /* TryStatement */) { + var tryStatement = parent_9; + if (tryStatement.tryBlock === child && tryStatement.catchClause) { + return child; + } + } + child = parent_9; + } + return undefined; + } + function aggregateAllBreakAndContinueStatements(node) { + var statementAccumulator = []; + aggregate(node); + return statementAccumulator; + function aggregate(node) { + if (node.kind === 190 /* BreakStatement */ || node.kind === 189 /* ContinueStatement */) { + statementAccumulator.push(node); + } + else if (!ts.isFunctionLike(node)) { + ts.forEachChild(node, aggregate); + } + } + ; + } + function ownsBreakOrContinueStatement(owner, statement) { + var actualOwner = getBreakOrContinueOwner(statement); + return actualOwner && actualOwner === owner; + } + function getBreakOrContinueOwner(statement) { + for (var node_1 = statement.parent; node_1; node_1 = node_1.parent) { + switch (node_1.kind) { + case 193 /* SwitchStatement */: + if (statement.kind === 189 /* ContinueStatement */) { + continue; + } + // Fall through. + case 186 /* ForStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: + case 185 /* WhileStatement */: + case 184 /* DoStatement */: + if (!statement.label || isLabeledBy(node_1, statement.label.text)) { + return node_1; + } + break; + default: + // Don't cross function boundaries. + if (ts.isFunctionLike(node_1)) { + return undefined; + } + break; + } + } + return undefined; + } + function getModifierOccurrences(modifier, declaration) { + var container = declaration.parent; + // Make sure we only highlight the keyword when it makes sense to do so. + if (ts.isAccessibilityModifier(modifier)) { + if (!(container.kind === 201 /* ClassDeclaration */ || + (declaration.kind === 129 /* Parameter */ && hasKind(container, 135 /* Constructor */)))) { + return undefined; + } + } + else if (modifier === 109 /* StaticKeyword */) { + if (container.kind !== 201 /* ClassDeclaration */) { + return undefined; + } + } + else if (modifier === 78 /* ExportKeyword */ || modifier === 115 /* DeclareKeyword */) { + if (!(container.kind === 206 /* ModuleBlock */ || container.kind === 227 /* SourceFile */)) { + return undefined; + } + } + else { + // unsupported modifier + return undefined; + } + var keywords = []; + var modifierFlag = getFlagFromModifier(modifier); + var nodes; + switch (container.kind) { + case 206 /* ModuleBlock */: + case 227 /* SourceFile */: + nodes = container.statements; + break; + case 135 /* Constructor */: + nodes = container.parameters.concat(container.parent.members); + break; + case 201 /* ClassDeclaration */: + nodes = container.members; + // If we're an accessibility modifier, we're in an instance member and should search + // the constructor's parameter list for instance members as well. + if (modifierFlag & 112 /* AccessibilityModifier */) { + var constructor = ts.forEach(container.members, function (member) { + return member.kind === 135 /* Constructor */ && member; + }); + if (constructor) { + nodes = nodes.concat(constructor.parameters); + } + } + break; + default: + ts.Debug.fail("Invalid container kind."); + } + ts.forEach(nodes, function (node) { + if (node.modifiers && node.flags & modifierFlag) { + ts.forEach(node.modifiers, function (child) { return pushKeywordIf(keywords, child, modifier); }); + } + }); + return ts.map(keywords, getHighlightSpanForNode); + function getFlagFromModifier(modifier) { + switch (modifier) { + case 108 /* PublicKeyword */: + return 16 /* Public */; + case 106 /* PrivateKeyword */: + return 32 /* Private */; + case 107 /* ProtectedKeyword */: + return 64 /* Protected */; + case 109 /* StaticKeyword */: + return 128 /* Static */; + case 78 /* ExportKeyword */: + return 1 /* Export */; + case 115 /* DeclareKeyword */: + return 2 /* Ambient */; + default: + ts.Debug.fail(); + } + } + } + function pushKeywordIf(keywordList, token) { + var expected = []; + for (var _i = 2; _i < arguments.length; _i++) { + expected[_i - 2] = arguments[_i]; + } + if (token && ts.contains(expected, token.kind)) { + keywordList.push(token); + return true; + } + return false; + } + function getGetAndSetOccurrences(accessorDeclaration) { + var keywords = []; + tryPushAccessorKeyword(accessorDeclaration.symbol, 136 /* GetAccessor */); + tryPushAccessorKeyword(accessorDeclaration.symbol, 137 /* SetAccessor */); + return ts.map(keywords, getHighlightSpanForNode); + function tryPushAccessorKeyword(accessorSymbol, accessorKind) { + var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); + if (accessor) { + ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 116 /* GetKeyword */, 120 /* SetKeyword */); }); + } + } + } + function getConstructorOccurrences(constructorDeclaration) { + var declarations = constructorDeclaration.symbol.getDeclarations(); + var keywords = []; + ts.forEach(declarations, function (declaration) { + ts.forEach(declaration.getChildren(), function (token) { + return pushKeywordIf(keywords, token, 114 /* ConstructorKeyword */); + }); + }); + return ts.map(keywords, getHighlightSpanForNode); + } + function getLoopBreakContinueOccurrences(loopNode) { + var keywords = []; + if (pushKeywordIf(keywords, loopNode.getFirstToken(), 82 /* ForKeyword */, 100 /* WhileKeyword */, 75 /* DoKeyword */)) { + // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. + if (loopNode.kind === 184 /* DoStatement */) { + var loopTokens = loopNode.getChildren(); + for (var i = loopTokens.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, loopTokens[i], 100 /* WhileKeyword */)) { + break; + } + } + } + } + var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); + ts.forEach(breaksAndContinues, function (statement) { + if (ownsBreakOrContinueStatement(loopNode, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), 66 /* BreakKeyword */, 71 /* ContinueKeyword */); + } + }); + return ts.map(keywords, getHighlightSpanForNode); + } + function getBreakOrContinueStatementOccurences(breakOrContinueStatement) { + var owner = getBreakOrContinueOwner(breakOrContinueStatement); + if (owner) { + switch (owner.kind) { + case 186 /* ForStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: + case 184 /* DoStatement */: + case 185 /* WhileStatement */: + return getLoopBreakContinueOccurrences(owner); + case 193 /* SwitchStatement */: + return getSwitchCaseDefaultOccurrences(owner); + } + } + return undefined; + } + function getSwitchCaseDefaultOccurrences(switchStatement) { + var keywords = []; + pushKeywordIf(keywords, switchStatement.getFirstToken(), 92 /* SwitchKeyword */); + // Go through each clause in the switch statement, collecting the 'case'/'default' keywords. + ts.forEach(switchStatement.caseBlock.clauses, function (clause) { + pushKeywordIf(keywords, clause.getFirstToken(), 67 /* CaseKeyword */, 73 /* DefaultKeyword */); + var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); + ts.forEach(breaksAndContinues, function (statement) { + if (ownsBreakOrContinueStatement(switchStatement, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), 66 /* BreakKeyword */); + } + }); + }); + return ts.map(keywords, getHighlightSpanForNode); + } + function getTryCatchFinallyOccurrences(tryStatement) { + var keywords = []; + pushKeywordIf(keywords, tryStatement.getFirstToken(), 96 /* TryKeyword */); + if (tryStatement.catchClause) { + pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 68 /* CatchKeyword */); + } + if (tryStatement.finallyBlock) { + var finallyKeyword = ts.findChildOfKind(tryStatement, 81 /* FinallyKeyword */, sourceFile); + pushKeywordIf(keywords, finallyKeyword, 81 /* FinallyKeyword */); + } + return ts.map(keywords, getHighlightSpanForNode); + } + function getThrowOccurrences(throwStatement) { + var owner = getThrowStatementOwner(throwStatement); + if (!owner) { + return undefined; + } + var keywords = []; + ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { + pushKeywordIf(keywords, throwStatement.getFirstToken(), 94 /* ThrowKeyword */); + }); + // If the "owner" is a function, then we equate 'return' and 'throw' statements in their + // ability to "jump out" of the function, and include occurrences for both. + if (ts.isFunctionBlock(owner)) { + ts.forEachReturnStatement(owner, function (returnStatement) { + pushKeywordIf(keywords, returnStatement.getFirstToken(), 90 /* ReturnKeyword */); + }); + } + return ts.map(keywords, getHighlightSpanForNode); + } + function getReturnOccurrences(returnStatement) { + var func = ts.getContainingFunction(returnStatement); + // If we didn't find a containing function with a block body, bail out. + if (!(func && hasKind(func.body, 179 /* Block */))) { + return undefined; + } + var keywords = []; + ts.forEachReturnStatement(func.body, function (returnStatement) { + pushKeywordIf(keywords, returnStatement.getFirstToken(), 90 /* ReturnKeyword */); + }); + // Include 'throw' statements that do not occur within a try block. + ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { + pushKeywordIf(keywords, throwStatement.getFirstToken(), 94 /* ThrowKeyword */); + }); + return ts.map(keywords, getHighlightSpanForNode); + } + function getIfElseOccurrences(ifStatement) { + var keywords = []; + // Traverse upwards through all parent if-statements linked by their else-branches. + while (hasKind(ifStatement.parent, 183 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { + ifStatement = ifStatement.parent; + } + // Now traverse back down through the else branches, aggregating if/else keywords of if-statements. + while (ifStatement) { + var children = ifStatement.getChildren(); + pushKeywordIf(keywords, children[0], 84 /* IfKeyword */); + // Generally the 'else' keyword is second-to-last, so we traverse backwards. + for (var i = children.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, children[i], 76 /* ElseKeyword */)) { + break; + } + } + if (!hasKind(ifStatement.elseStatement, 183 /* IfStatement */)) { break; } + ifStatement = ifStatement.elseStatement; } - if (!hasKind(ifStatement.elseStatement, 183)) { - break; - } - ifStatement = ifStatement.elseStatement; - } - var result = []; - 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))) { - shouldHighlightNextKeyword = false; - break; + var result = []; + // We'd like to highlight else/ifs together if they are only separated by whitespace + // (i.e. the keywords are separated by no comments, no newlines). + for (var i = 0; i < keywords.length; i++) { + if (keywords[i].kind === 76 /* ElseKeyword */ && i < keywords.length - 1) { + var elseKeyword = keywords[i]; + var ifKeyword = keywords[i + 1]; // this *should* always be an 'if' keyword. + var shouldCombindElseAndIf = true; + // Avoid recalculating getStart() by iterating backwards. + for (var j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { + if (!ts.isWhiteSpace(sourceFile.text.charCodeAt(j))) { + shouldCombindElseAndIf = false; + break; + } } - } - if (shouldHighlightNextKeyword) { - result.push({ - fileName: fileName, - textSpan: ts.createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), - isWriteAccess: false - }); - i++; - continue; - } - } - result.push(getReferenceEntryFromNode(keywords[i])); - } - return result; - } - function getReturnOccurrences(returnStatement) { - var func = ts.getContainingFunction(returnStatement); - if (!(func && hasKind(func.body, 179))) { - return undefined; - } - var keywords = []; - ts.forEachReturnStatement(func.body, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 90); - }); - ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 94); - }); - return ts.map(keywords, getReferenceEntryFromNode); - } - function getThrowOccurrences(throwStatement) { - var owner = getThrowStatementOwner(throwStatement); - if (!owner) { - return undefined; - } - var keywords = []; - ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 94); - }); - if (ts.isFunctionBlock(owner)) { - ts.forEachReturnStatement(owner, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 90); - }); - } - return ts.map(keywords, getReferenceEntryFromNode); - } - function aggregateOwnedThrowStatements(node) { - var statementAccumulator = []; - aggregate(node); - return statementAccumulator; - function aggregate(node) { - if (node.kind === 195) { - statementAccumulator.push(node); - } - else if (node.kind === 196) { - var tryStatement = node; - if (tryStatement.catchClause) { - aggregate(tryStatement.catchClause); - } - else { - aggregate(tryStatement.tryBlock); - } - if (tryStatement.finallyBlock) { - aggregate(tryStatement.finallyBlock); - } - } - else if (!ts.isFunctionLike(node)) { - ts.forEachChild(node, aggregate); - } - } - ; - } - function getThrowStatementOwner(throwStatement) { - var child = throwStatement; - while (child.parent) { - var parent_9 = child.parent; - if (ts.isFunctionBlock(parent_9) || parent_9.kind === 227) { - return parent_9; - } - if (parent_9.kind === 196) { - var tryStatement = parent_9; - if (tryStatement.tryBlock === child && tryStatement.catchClause) { - return child; - } - } - child = parent_9; - } - return undefined; - } - function getTryCatchFinallyOccurrences(tryStatement) { - var keywords = []; - pushKeywordIf(keywords, tryStatement.getFirstToken(), 96); - if (tryStatement.catchClause) { - pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 68); - } - if (tryStatement.finallyBlock) { - 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(), 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], 100)) { - break; - } - } - } - } - var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); - ts.forEach(breaksAndContinues, function (statement) { - if (ownsBreakOrContinueStatement(loopNode, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 66, 71); - } - }); - return ts.map(keywords, getReferenceEntryFromNode); - } - function getSwitchCaseDefaultOccurrences(switchStatement) { - var keywords = []; - pushKeywordIf(keywords, switchStatement.getFirstToken(), 92); - ts.forEach(switchStatement.caseBlock.clauses, function (clause) { - pushKeywordIf(keywords, clause.getFirstToken(), 67, 73); - var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); - ts.forEach(breaksAndContinues, function (statement) { - if (ownsBreakOrContinueStatement(switchStatement, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 66); - } - }); - }); - return ts.map(keywords, getReferenceEntryFromNode); - } - function getBreakOrContinueStatementOccurences(breakOrContinueStatement) { - var owner = getBreakOrContinueOwner(breakOrContinueStatement); - if (owner) { - switch (owner.kind) { - case 186: - case 187: - case 188: - case 184: - case 185: - return getLoopBreakContinueOccurrences(owner); - case 193: - return getSwitchCaseDefaultOccurrences(owner); - } - } - return undefined; - } - function aggregateAllBreakAndContinueStatements(node) { - var statementAccumulator = []; - aggregate(node); - return statementAccumulator; - function aggregate(node) { - if (node.kind === 190 || node.kind === 189) { - statementAccumulator.push(node); - } - else if (!ts.isFunctionLike(node)) { - ts.forEachChild(node, aggregate); - } - } - ; - } - function ownsBreakOrContinueStatement(owner, statement) { - var actualOwner = getBreakOrContinueOwner(statement); - return actualOwner && actualOwner === owner; - } - function getBreakOrContinueOwner(statement) { - for (var node_1 = statement.parent; node_1; node_1 = node_1.parent) { - switch (node_1.kind) { - case 193: - if (statement.kind === 189) { + if (shouldCombindElseAndIf) { + result.push({ + fileName: fileName, + textSpan: ts.createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), + kind: HighlightSpanKind.reference + }); + i++; // skip the next keyword continue; } - 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_1)) { - return undefined; - } - break; - } - } - return undefined; - } - function getConstructorOccurrences(constructorDeclaration) { - var declarations = constructorDeclaration.symbol.getDeclarations(); - var keywords = []; - ts.forEach(declarations, function (declaration) { - ts.forEach(declaration.getChildren(), function (token) { - return pushKeywordIf(keywords, token, 114); - }); - }); - return ts.map(keywords, getReferenceEntryFromNode); - } - function getGetAndSetOccurrences(accessorDeclaration) { - var keywords = []; - 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, 116, 120); }); + } + // Ordinary case: just highlight the keyword. + result.push(getHighlightSpanForNode(keywords[i])); } + return result; } } - function getModifierOccurrences(modifier, declaration) { - var container = declaration.parent; - if (ts.isAccessibilityModifier(modifier)) { - if (!(container.kind === 201 || - (declaration.kind === 129 && hasKind(container, 135)))) { - return undefined; - } - } - else if (modifier === 110) { - if (container.kind !== 201) { - return undefined; - } - } - else if (modifier === 78 || modifier === 115) { - if (!(container.kind === 206 || container.kind === 227)) { - return undefined; - } - } - else { + } + /// References and Occurrences + function getOccurrencesAtPositionCore(fileName, position) { + synchronizeHostData(); + return convertDocumentHighlights(getDocumentHighlights(fileName, position, [fileName])); + function convertDocumentHighlights(documentHighlights) { + if (!documentHighlights) { return undefined; } - var keywords = []; - var modifierFlag = getFlagFromModifier(modifier); - var nodes; - switch (container.kind) { - case 206: - case 227: - nodes = container.statements; - break; - case 135: - nodes = container.parameters.concat(container.parent.members); - break; - case 201: - nodes = container.members; - if (modifierFlag & 112) { - var constructor = ts.forEach(container.members, function (member) { - return member.kind === 135 && member; - }); - if (constructor) { - nodes = nodes.concat(constructor.parameters); - } - } - break; - default: - ts.Debug.fail("Invalid container kind."); - } - ts.forEach(nodes, function (node) { - if (node.modifiers && node.flags & modifierFlag) { - ts.forEach(node.modifiers, function (child) { return pushKeywordIf(keywords, child, modifier); }); - } - }); - return ts.map(keywords, getReferenceEntryFromNode); - function getFlagFromModifier(modifier) { - switch (modifier) { - case 109: - return 16; - case 107: - return 32; - case 108: - return 64; - case 110: - return 128; - case 78: - return 1; - case 115: - return 2; - default: - ts.Debug.fail(); + var result = []; + for (var _i = 0; _i < documentHighlights.length; _i++) { + var entry = documentHighlights[_i]; + for (var _a = 0, _b = entry.highlightSpans; _a < _b.length; _a++) { + var highlightSpan = _b[_a]; + result.push({ + fileName: entry.fileName, + textSpan: highlightSpan.textSpan, + isWriteAccess: highlightSpan.kind === HighlightSpanKind.writtenReference + }); } } - } - function hasKind(node, kind) { - return node !== undefined && node.kind === kind; - } - function parent(node) { - return node && node.parent; - } - function pushKeywordIf(keywordList, token) { - var expected = []; - for (var _i = 2; _i < arguments.length; _i++) { - expected[_i - 2] = arguments[_i]; - } - if (token && ts.contains(expected, token.kind)) { - keywordList.push(token); - return true; - } - return false; + return result; } } function convertReferences(referenceSymbols) { @@ -32195,6 +38217,7 @@ var ts; } function findReferences(fileName, position) { var referencedSymbols = findReferencedSymbols(fileName, position, false, false); + // Only include referenced symbols that have a valid definition. return ts.filter(referencedSymbols, function (rs) { return !!rs.definition; }); } function findReferencedSymbols(fileName, position, findInStrings, findInComments) { @@ -32204,68 +38227,78 @@ var ts; if (!node) { return undefined; } - if (node.kind !== 65 && + if (node.kind !== 65 /* Identifier */ && + // TODO (drosen): This should be enabled in a later release - currently breaks rename. + //node.kind !== SyntaxKind.ThisKeyword && + //node.kind !== SyntaxKind.SuperKeyword && !isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && !isNameOfExternalModuleImportOrDeclaration(node)) { return undefined; } - ts.Debug.assert(node.kind === 65 || node.kind === 7 || node.kind === 8); - return getReferencesForNode(node, program.getSourceFiles(), false, findInStrings, findInComments); + ts.Debug.assert(node.kind === 65 /* Identifier */ || node.kind === 7 /* NumericLiteral */ || node.kind === 8 /* StringLiteral */); + return getReferencedSymbolsForNodes(node, program.getSourceFiles(), findInStrings, findInComments); } - function getReferencesForNode(node, sourceFiles, searchOnlyInCurrentFile, findInStrings, findInComments) { + function getReferencedSymbolsForNodes(node, sourceFiles, findInStrings, findInComments) { + var typeChecker = program.getTypeChecker(); + // Labels if (isLabelName(node)) { if (isJumpStatementTarget(node)) { var labelDefinition = getTargetLabel(node.parent, node.text); + // if we have a label definition, look within its statement for references, if not, then + // the label is undefined and we have no results.. return labelDefinition ? getLabelReferencesInNode(labelDefinition.parent, labelDefinition) : undefined; } else { + // it is a label definition and not a target, search within the parent labeledStatement return getLabelReferencesInNode(node.parent, node); } } - if (node.kind === 93) { + if (node.kind === 93 /* ThisKeyword */) { return getReferencesForThisKeyword(node, sourceFiles); } - if (node.kind === 91) { + if (node.kind === 91 /* SuperKeyword */) { return getReferencesForSuperKeyword(node); } - var symbol = typeInfoResolver.getSymbolAtLocation(node); + var symbol = typeChecker.getSymbolAtLocation(node); + // Could not find a symbol e.g. unknown identifier if (!symbol) { + // Can't have references to something that we have no symbol for. return undefined; } var declarations = symbol.declarations; + // The symbol was an internal symbol and does not have a declaration e.g.undefined symbol if (!declarations || !declarations.length) { return undefined; } var result; + // Compute the meaning from the location and the symbol it references var searchMeaning = getIntersectingMeaningFromDeclarations(getMeaningFromLocation(node), declarations); + // Get the text to search for, we need to normalize it as external module names will have quote var declaredName = getDeclaredName(symbol, node); + // Try to get the smallest valid scope that we can limit our search to; + // otherwise we'll need to search globally (i.e. include each file). var scope = getSymbolScope(symbol); + // Maps from a symbol ID to the ReferencedSymbol entry in 'result'. var symbolToIndex = []; if (scope) { 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, symbolToIndex); - } - else { - var internedName = getInternedName(symbol, node, declarations); - ts.forEach(sourceFiles, function (sourceFile) { - cancellationToken.throwIfCancellationRequested(); - var nameTable = getNameTable(sourceFile); - if (ts.lookUp(nameTable, internedName)) { - result = result || []; - getReferencesInNode(sourceFile, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); - } - }); + var internedName = getInternedName(symbol, node, declarations); + for (var _i = 0; _i < sourceFiles.length; _i++) { + var sourceFile = sourceFiles[_i]; + cancellationToken.throwIfCancellationRequested(); + var nameTable = getNameTable(sourceFile); + if (ts.lookUp(nameTable, internedName)) { + result = 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 info = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, node.getSourceFile(), getContainerNode(node), node); var name = ts.map(info.displayParts, function (p) { return p.text; }).join(""); var declarations = symbol.declarations; if (!declarations || declarations.length === 0) { @@ -32282,31 +38315,49 @@ var ts; } function isImportOrExportSpecifierName(location) { return location.parent && - (location.parent.kind === 213 || location.parent.kind === 217) && + (location.parent.kind === 213 /* ImportSpecifier */ || location.parent.kind === 217 /* ExportSpecifier */) && location.parent.propertyName === location; } function isImportOrExportSpecifierImportSymbol(symbol) { - return (symbol.flags & 8388608) && ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 213 || declaration.kind === 217; + return (symbol.flags & 8388608 /* Alias */) && ts.forEach(symbol.declarations, function (declaration) { + return declaration.kind === 213 /* ImportSpecifier */ || declaration.kind === 217 /* ExportSpecifier */; }); } function getDeclaredName(symbol, location) { - var functionExpression = ts.forEach(symbol.declarations, function (d) { return d.kind === 162 ? d : undefined; }); + // Special case for function expressions, whose names are solely local to their bodies. + var functionExpression = ts.forEach(symbol.declarations, function (d) { return d.kind === 162 /* FunctionExpression */ ? d : undefined; }); + // When a name gets interned into a SourceFile's 'identifiers' Map, + // its name is escaped and stored in the same way its symbol name/identifier + // name should be stored. Function expressions, however, are a special case, + // because despite sometimes having a name, the binder unconditionally binds them + // to a symbol with the name "__function". var name; if (functionExpression && functionExpression.name) { name = functionExpression.name.text; } + // If this is an export or import specifier it could have been renamed using the as syntax. + // if so we want to search for whatever under the cursor, the symbol is pointing to the alias (name) + // so check for the propertyName. if (isImportOrExportSpecifierName(location)) { return location.getText(); } - name = typeInfoResolver.symbolToString(symbol); + name = typeChecker.symbolToString(symbol); return stripQuotes(name); } function getInternedName(symbol, location, declarations) { + // If this is an export or import specifier it could have been renamed using the as syntax. + // if so we want to search for whatever under the cursor, the symbol is pointing to the alias (name) + // so check for the propertyName. if (isImportOrExportSpecifierName(location)) { return location.getText(); } - var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 162 ? d : undefined; }); + // Special case for function expressions, whose names are solely local to their bodies. + var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 162 /* FunctionExpression */ ? d : undefined; }); + // When a name gets interned into a SourceFile's 'identifiers' Map, + // its name is escaped and stored in the same way its symbol name/identifier + // name should be stored. Function expressions, however, are a special case, + // because despite sometimes having a name, the binder unconditionally binds them + // to a symbol with the name "__function". var name = functionExpression && functionExpression.name ? functionExpression.name.text : symbol.name; @@ -32314,23 +38365,28 @@ var ts; } function stripQuotes(name) { var length = name.length; - if (length >= 2 && name.charCodeAt(0) === 34 && name.charCodeAt(length - 1) === 34) { + if (length >= 2 && name.charCodeAt(0) === 34 /* doubleQuote */ && name.charCodeAt(length - 1) === 34 /* doubleQuote */) { return name.substring(1, length - 1); } ; return name; } function getSymbolScope(symbol) { - if (symbol.flags & (4 | 8192)) { - var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (d.flags & 32) ? d : undefined; }); + // If this is private property or method, the scope is the containing class + if (symbol.flags & (4 /* Property */ | 8192 /* Method */)) { + var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (d.flags & 32 /* Private */) ? d : undefined; }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 201); + return ts.getAncestor(privateDeclaration, 201 /* ClassDeclaration */); } } - if (symbol.flags & 8388608) { + // If the symbol is an import we would like to find it if we are looking for what it imports. + // So consider it visibile outside its declaration scope. + if (symbol.flags & 8388608 /* Alias */) { return undefined; } - if (symbol.parent || (symbol.flags & 268435456)) { + // if this symbol is visible from its parent container, e.g. exported, then bail out + // if symbol correspond to the union property - bail out + if (symbol.parent || (symbol.flags & 268435456 /* UnionProperty */)) { return undefined; } var scope = undefined; @@ -32343,11 +38399,15 @@ var ts; return undefined; } if (scope && scope !== container) { + // Different declarations have different containers, bail out return undefined; } - if (container.kind === 227 && !ts.isExternalModule(container)) { + if (container.kind === 227 /* SourceFile */ && !ts.isExternalModule(container)) { + // This is a global variable and not an external module, any declaration defined + // within this scope is visible outside the file return undefined; } + // The search scope is the container node scope = container; } } @@ -32355,6 +38415,9 @@ var ts; } function getPossibleSymbolReferencePositions(sourceFile, symbolName, start, end) { var positions = []; + /// TODO: Cache symbol existence for files to save text search + // Also, need to make this work for unicode escapes. + // Be resilient in the face of a symbol with no name or zero length name if (!symbolName || !symbolName.length) { return positions; } @@ -32364,11 +38427,15 @@ var ts; var position = text.indexOf(symbolName, start); while (position >= 0) { cancellationToken.throwIfCancellationRequested(); + // If we are past the end, stop looking if (position > end) break; + // We found a match. Make sure it's not part of a larger word (i.e. the char + // before and after it have to be a non-identifier char). var endPosition = position + symbolNameLength; - if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 2)) && - (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 2))) { + if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 2 /* Latest */)) && + (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 2 /* Latest */))) { + // Found a real match. Keep searching. positions.push(position); } position = text.indexOf(symbolName, position + symbolNameLength + 1); @@ -32386,6 +38453,7 @@ var ts; if (!node || node.getWidth() !== labelName.length) { return; } + // Only pick labels that are either the target label, or have a target that is the target label if (node === targetLabel || (isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel)) { references.push(getReferenceEntryFromNode(node)); @@ -32403,16 +38471,18 @@ var ts; } function isValidReferencePosition(node, searchSymbolName) { if (node) { + // Compare the length so we filter out strict superstrings of the symbol we are looking for switch (node.kind) { - case 65: + case 65 /* Identifier */: return node.getWidth() === searchSymbolName.length; - case 8: + case 8 /* StringLiteral */: if (isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { + // For string literals we have two additional chars for the quotes return node.getWidth() === searchSymbolName.length + 2; } break; - case 7: + case 7 /* NumericLiteral */: if (isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) { return node.getWidth() === searchSymbolName.length; } @@ -32421,18 +38491,30 @@ var ts; } return false; } + /** Search within node "container" for references for a search value, where the search value is defined as a + * tuple of(searchSymbol, searchText, searchLocation, and searchMeaning). + * searchLocation: a node where the search value + */ function getReferencesInNode(container, searchSymbol, searchText, searchLocation, searchMeaning, findInStrings, findInComments, result, symbolToIndex) { var sourceFile = container.getSourceFile(); var tripleSlashDirectivePrefixRegex = /^\/\/\/\s*= 0) { + else if (!(referenceSymbol.flags & 67108864 /* Transient */) && searchSymbols.indexOf(shorthandValueSymbol) >= 0) { var referencedSymbol = getReferencedSymbol(shorthandValueSymbol); referencedSymbol.references.push(getReferenceEntryFromNode(referenceSymbolDeclaration.name)); } @@ -32479,12 +38561,15 @@ var ts; } function isInString(position) { var token = ts.getTokenAtPosition(sourceFile, position); - return token && token.kind === 8 && position > token.getStart(); + return token && token.kind === 8 /* StringLiteral */ && position > token.getStart(); } function isInComment(position) { var token = ts.getTokenAtPosition(sourceFile, position); if (token && position < token.getStart()) { + // First, we have to see if this position actually landed in a comment. var commentRanges = ts.getLeadingCommentRanges(sourceFile.text, token.pos); + // Then we want to make sure that it wasn't in a "///<" directive comment + // We don't want to unintentionally update a file name. return ts.forEach(commentRanges, function (c) { if (c.pos < position && position < c.end) { var commentText = sourceFile.text.substring(c.pos, c.end); @@ -32502,17 +38587,18 @@ var ts; if (!searchSpaceNode) { return undefined; } - var staticFlag = 128; + // Whether 'super' occurs in a static context within a class. + var staticFlag = 128 /* Static */; switch (searchSpaceNode.kind) { - case 132: - case 131: - case 134: - case 133: - case 135: - case 136: - case 137: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 135 /* Constructor */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: staticFlag &= searchSpaceNode.flags; - searchSpaceNode = searchSpaceNode.parent; + searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; default: return undefined; @@ -32523,11 +38609,14 @@ var ts; ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); var node = ts.getTouchingWord(sourceFile, position); - if (!node || node.kind !== 91) { + if (!node || node.kind !== 91 /* SuperKeyword */) { return; } var container = ts.getSuperContainer(node, false); - if (container && (128 & container.flags) === staticFlag && container.parent.symbol === searchSpaceNode.symbol) { + // If we have a 'super' container, we must have an enclosing class. + // Now make sure the owning class is the same as the search-space + // and has the same static qualifier as the original 'super's owner. + if (container && (128 /* Static */ & container.flags) === staticFlag && container.parent.symbol === searchSpaceNode.symbol) { references.push(getReferenceEntryFromNode(node)); } }); @@ -32536,34 +38625,39 @@ var ts; } function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, false); - var staticFlag = 128; + // Whether 'this' occurs in a static context within a class. + var staticFlag = 128 /* Static */; switch (searchSpaceNode.kind) { - case 134: - case 133: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } - case 132: - case 131: - case 135: - case 136: - case 137: + // fall through + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 135 /* Constructor */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: staticFlag &= searchSpaceNode.flags; - searchSpaceNode = searchSpaceNode.parent; + searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 227: + case 227 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } - case 200: - case 162: + // Fall through + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: break; + // Computed properties in classes are not handled here because references to this are illegal, + // so there is no point finding references to them. default: return undefined; } var references = []; var possiblePositions; - if (searchSpaceNode.kind === 227) { + if (searchSpaceNode.kind === 227 /* SourceFile */) { ts.forEach(sourceFiles, function (sourceFile) { possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); @@ -32589,30 +38683,32 @@ var ts; ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); var node = ts.getTouchingWord(sourceFile, position); - if (!node || node.kind !== 93) { + if (!node || node.kind !== 93 /* ThisKeyword */) { return; } var container = ts.getThisContainer(node, false); switch (searchSpaceNode.kind) { - case 162: - case 200: + case 162 /* FunctionExpression */: + case 200 /* FunctionDeclaration */: if (searchSpaceNode.symbol === container.symbol) { result.push(getReferenceEntryFromNode(node)); } break; - case 134: - case 133: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { result.push(getReferenceEntryFromNode(node)); } break; - case 201: - if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (container.flags & 128) === staticFlag) { + case 201 /* ClassDeclaration */: + // Make sure the container belongs to the same class + // and has the appropriate static modifier from the original container. + if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (container.flags & 128 /* Static */) === staticFlag) { result.push(getReferenceEntryFromNode(node)); } break; - case 227: - if (container.kind === 227 && !ts.isExternalModule(container)) { + case 227 /* SourceFile */: + if (container.kind === 227 /* SourceFile */ && !ts.isExternalModule(container)) { result.push(getReferenceEntryFromNode(node)); } break; @@ -32621,37 +38717,56 @@ var ts; } } function populateSearchSymbolSet(symbol, location) { + // The search set contains at least the current symbol var result = [symbol]; + // If the symbol is an alias, add what it alaises to the list if (isImportOrExportSpecifierImportSymbol(symbol)) { - result.push(typeInfoResolver.getAliasedSymbol(symbol)); + result.push(typeChecker.getAliasedSymbol(symbol)); } + // If the location is in a context sensitive location (i.e. in an object literal) try + // to get a contextual type for it, and add the property symbol from the contextual + // type to the search set if (isNameOfPropertyAssignment(location)) { ts.forEach(getPropertySymbolsFromContextualType(location), function (contextualSymbol) { - result.push.apply(result, typeInfoResolver.getRootSymbols(contextualSymbol)); + result.push.apply(result, typeChecker.getRootSymbols(contextualSymbol)); }); - var shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(location.parent); + /* Because in short-hand property assignment, location has two meaning : property name and as value of the property + * When we do findAllReference at the position of the short-hand property assignment, we would want to have references to position of + * property name and variable declaration of the identifier. + * Like in below example, when querying for all references for an identifier 'name', of the property assignment, the language service + * should show both 'name' in 'obj' and 'name' in variable declaration + * let name = "Foo"; + * let obj = { name }; + * In order to do that, we will populate the search set with the value symbol of the identifier as a value of the property assignment + * so that when matching with potential reference symbol, both symbols from property declaration and variable declaration + * will be included correctly. + */ + var shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(location.parent); if (shorthandValueSymbol) { result.push(shorthandValueSymbol); } } - ts.forEach(typeInfoResolver.getRootSymbols(symbol), function (rootSymbol) { + // If this is a union property, add all the symbols from all its source symbols in all unioned types. + // If the symbol is an instantiation from a another symbol (e.g. widened symbol) , add the root the list + ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) { if (rootSymbol !== symbol) { result.push(rootSymbol); } - if (rootSymbol.parent && rootSymbol.parent.flags & (32 | 64)) { + // Add symbol of properties/methods of the same name in base classes and implemented interfaces definitions + if (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result); } }); return result; } function getPropertySymbolsFromBaseTypes(symbol, propertyName, result) { - if (symbol && symbol.flags & (32 | 64)) { + if (symbol && symbol.flags & (32 /* Class */ | 64 /* Interface */)) { ts.forEach(symbol.getDeclarations(), function (declaration) { - if (declaration.kind === 201) { + if (declaration.kind === 201 /* ClassDeclaration */) { getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); } - else if (declaration.kind === 202) { + else if (declaration.kind === 202 /* InterfaceDeclaration */) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); } }); @@ -32659,12 +38774,13 @@ var ts; return; function getPropertySymbolFromTypeReference(typeReference) { if (typeReference) { - var type = typeInfoResolver.getTypeAtLocation(typeReference); + var type = typeChecker.getTypeAtLocation(typeReference); if (type) { - var propertySymbol = typeInfoResolver.getPropertyOfType(type, propertyName); + var propertySymbol = typeChecker.getPropertyOfType(type, propertyName); if (propertySymbol) { result.push(propertySymbol); } + // Visit the typeReference as well to see if it directly or indirectly use that property getPropertySymbolsFromBaseTypes(type.symbol, propertyName, result); } } @@ -32674,25 +38790,35 @@ var ts; if (searchSymbols.indexOf(referenceSymbol) >= 0) { return referenceSymbol; } + // If the reference symbol is an alias, check if what it is aliasing is one of the search + // symbols. if (isImportOrExportSpecifierImportSymbol(referenceSymbol)) { - var aliasedSymbol = typeInfoResolver.getAliasedSymbol(referenceSymbol); + var aliasedSymbol = typeChecker.getAliasedSymbol(referenceSymbol); if (searchSymbols.indexOf(aliasedSymbol) >= 0) { return aliasedSymbol; } } + // If the reference location is in an object literal, try to get the contextual type for the + // object literal, lookup the property symbol in the contextual type, and use this symbol to + // compare to our searchSymbol if (isNameOfPropertyAssignment(referenceLocation)) { return ts.forEach(getPropertySymbolsFromContextualType(referenceLocation), function (contextualSymbol) { - return ts.forEach(typeInfoResolver.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); + return ts.forEach(typeChecker.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); }); } - return ts.forEach(typeInfoResolver.getRootSymbols(referenceSymbol), function (rootSymbol) { + // Unwrap symbols to get to the root (e.g. transient symbols as a result of widening) + // Or a union property, use its underlying unioned symbols + return ts.forEach(typeChecker.getRootSymbols(referenceSymbol), function (rootSymbol) { + // if it is in the list, then we are done if (searchSymbols.indexOf(rootSymbol) >= 0) { return rootSymbol; } - if (rootSymbol.parent && rootSymbol.parent.flags & (32 | 64)) { - var result_2 = []; - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_2); - return ts.forEach(result_2, function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); + // Finally, try all properties with the same name in any type the containing type extended or implemented, and + // see if any is in the list + if (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { + var result_3 = []; + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_3); + return ts.forEach(result_3, function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); } return undefined; }); @@ -32700,27 +38826,29 @@ var ts; function getPropertySymbolsFromContextualType(node) { if (isNameOfPropertyAssignment(node)) { var objectLiteral = node.parent.parent; - var contextualType = typeInfoResolver.getContextualType(objectLiteral); - var name_20 = node.text; + var contextualType = typeChecker.getContextualType(objectLiteral); + var name_25 = node.text; if (contextualType) { - if (contextualType.flags & 16384) { - var unionProperty = contextualType.getProperty(name_20); + if (contextualType.flags & 16384 /* Union */) { + // This is a union type, first see if the property we are looking for is a union property (i.e. exists in all types) + // if not, search the constituent types for the property + var unionProperty = contextualType.getProperty(name_25); if (unionProperty) { return [unionProperty]; } else { - var result_3 = []; + var result_4 = []; ts.forEach(contextualType.types, function (t) { - var symbol = t.getProperty(name_20); + var symbol = t.getProperty(name_25); if (symbol) { - result_3.push(symbol); + result_4.push(symbol); } }); - return result_3; + return result_4; } } else { - var symbol_1 = contextualType.getProperty(name_20); + var symbol_1 = contextualType.getProperty(name_25); if (symbol_1) { return [symbol_1]; } @@ -32729,10 +38857,22 @@ var ts; } return undefined; } + /** Given an initial searchMeaning, extracted from a location, widen the search scope based on the declarations + * of the corresponding symbol. e.g. if we are searching for "Foo" in value position, but "Foo" references a class + * then we need to widen the search to include type positions as well. + * On the contrary, if we are searching for "Bar" in type position and we trace bar to an interface, and an uninstantiated + * module, we want to keep the search limited to only types, as the two declarations (interface and uninstantiated module) + * do not intersect in any of the three spaces. + */ function getIntersectingMeaningFromDeclarations(meaning, declarations) { if (declarations) { var lastIterationMeaning; do { + // The result is order-sensitive, for instance if initialMeaning === Namespace, and declarations = [class, instantiated module] + // we need to consider both as they initialMeaning intersects with the module in the namespace space, and the module + // intersects with the class in the value space. + // To achieve that we will keep iterating until the result stabilizes. + // Remember the last meaning lastIterationMeaning = meaning; for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; @@ -32749,7 +38889,7 @@ var ts; function getReferenceEntryFromNode(node) { var start = node.getStart(); var end = node.getEnd(); - if (node.kind === 8) { + if (node.kind === 8 /* StringLiteral */) { start += 1; end -= 1; } @@ -32759,22 +38899,24 @@ var ts; isWriteAccess: isWriteAccess(node) }; } + /** A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment */ function isWriteAccess(node) { - if (node.kind === 65 && ts.isDeclarationName(node)) { + if (node.kind === 65 /* Identifier */ && ts.isDeclarationName(node)) { return true; } var parent = node.parent; if (parent) { - if (parent.kind === 168 || parent.kind === 167) { + if (parent.kind === 168 /* PostfixUnaryExpression */ || parent.kind === 167 /* PrefixUnaryExpression */) { return true; } - else if (parent.kind === 169 && parent.left === node) { + else if (parent.kind === 169 /* BinaryExpression */ && parent.left === node) { var operator = parent.operatorToken.kind; - return 53 <= operator && operator <= 64; + return 53 /* FirstAssignment */ <= operator && operator <= 64 /* LastAssignment */; } } return false; } + /// NavigateTo function getNavigateToItems(searchValue, maxResultCount) { synchronizeHostData(); return ts.NavigateTo.getNavigateToItems(program, cancellationToken, searchValue, maxResultCount); @@ -32801,60 +38943,61 @@ var ts; } function getMeaningFromDeclaration(node) { switch (node.kind) { - case 129: - case 198: - case 152: - case 132: - case 131: - case 224: - case 225: - case 226: - case 134: - case 133: - case 135: - 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; + case 129 /* Parameter */: + case 198 /* VariableDeclaration */: + case 152 /* BindingElement */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 224 /* PropertyAssignment */: + case 225 /* ShorthandPropertyAssignment */: + case 226 /* EnumMember */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 135 /* Constructor */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: + case 223 /* CatchClause */: + return 1 /* Value */; + case 128 /* TypeParameter */: + case 202 /* InterfaceDeclaration */: + case 203 /* TypeAliasDeclaration */: + case 145 /* TypeLiteral */: + return 2 /* Type */; + case 201 /* ClassDeclaration */: + case 204 /* EnumDeclaration */: + return 1 /* Value */ | 2 /* Type */; + case 205 /* ModuleDeclaration */: + if (node.name.kind === 8 /* StringLiteral */) { + return 4 /* Namespace */ | 1 /* Value */; } - else if (ts.getModuleInstanceState(node) === 1) { - return 4 | 1; + else if (ts.getModuleInstanceState(node) === 1 /* Instantiated */) { + return 4 /* Namespace */ | 1 /* Value */; } else { - return 4; + return 4 /* Namespace */; } - case 212: - case 213: - case 208: - case 209: - case 214: - case 215: - return 1 | 2 | 4; - case 227: - return 4 | 1; + case 212 /* NamedImports */: + case 213 /* ImportSpecifier */: + case 208 /* ImportEqualsDeclaration */: + case 209 /* ImportDeclaration */: + case 214 /* ExportAssignment */: + case 215 /* ExportDeclaration */: + return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; + // An external module can be a Value + case 227 /* SourceFile */: + return 4 /* Namespace */ | 1 /* Value */; } - return 1 | 2 | 4; + return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; ts.Debug.fail("Unknown declaration type"); } function isTypeReference(node) { if (ts.isRightSideOfQualifiedNameOrPropertyAccess(node)) { node = node.parent; } - return node.parent.kind === 141 || node.parent.kind === 177; + return node.parent.kind === 141 /* TypeReference */ || node.parent.kind === 177 /* HeritageClauseElement */; } function isNamespaceReference(node) { return isQualifiedNameNamespaceReference(node) || isPropertyAccessNamespaceReference(node); @@ -32862,48 +39005,51 @@ var ts; function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 155) { - while (root.parent && root.parent.kind === 155) { + if (root.parent.kind === 155 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 155 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 177 && root.parent.parent.kind === 222) { + if (!isLastClause && root.parent.kind === 177 /* HeritageClauseElement */ && root.parent.parent.kind === 222 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 201 && root.parent.parent.token === 103) || - (decl.kind === 202 && root.parent.parent.token === 79); + return (decl.kind === 201 /* ClassDeclaration */ && root.parent.parent.token === 102 /* ImplementsKeyword */) || + (decl.kind === 202 /* InterfaceDeclaration */ && root.parent.parent.token === 79 /* ExtendsKeyword */); } return false; } function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 126) { - while (root.parent && root.parent.kind === 126) { + if (root.parent.kind === 126 /* QualifiedName */) { + while (root.parent && root.parent.kind === 126 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 141 && !isLastClause; + return root.parent.kind === 141 /* TypeReference */ && !isLastClause; } function isInRightSideOfImport(node) { - while (node.parent.kind === 126) { + while (node.parent.kind === 126 /* QualifiedName */) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; } function getMeaningFromRightHandSideOfImportEquals(node) { - ts.Debug.assert(node.kind === 65); - if (node.parent.kind === 126 && + ts.Debug.assert(node.kind === 65 /* Identifier */); + // import a = |b|; // Namespace + // import a = |b.c|; // Value, type, namespace + // import a = |b.c|.d; // Namespace + if (node.parent.kind === 126 /* QualifiedName */ && node.parent.right === node && - node.parent.parent.kind === 208) { - return 1 | 2 | 4; + node.parent.parent.kind === 208 /* ImportEqualsDeclaration */) { + return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } - return 4; + return 4 /* Namespace */; } function getMeaningFromLocation(node) { - if (node.parent.kind === 214) { - return 1 | 2 | 4; + if (node.parent.kind === 214 /* ExportAssignment */) { + return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } else if (isInRightSideOfImport(node)) { return getMeaningFromRightHandSideOfImportEquals(node); @@ -32912,64 +39058,79 @@ var ts; return getMeaningFromDeclaration(node.parent); } else if (isTypeReference(node)) { - return 2; + return 2 /* Type */; } else if (isNamespaceReference(node)) { - return 4; + return 4 /* Namespace */; } else { - return 1; + return 1 /* Value */; } } + // Signature help + /** + * This is a semantic operation. + */ function getSignatureHelpItems(fileName, position) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); - return ts.SignatureHelp.getSignatureHelpItems(sourceFile, position, typeInfoResolver, cancellationToken); + return ts.SignatureHelp.getSignatureHelpItems(program, sourceFile, position, cancellationToken); } + /// Syntactic features function getSourceFile(fileName) { return syntaxTreeCache.getCurrentSourceFile(fileName); } function getNameOrDottedNameSpan(fileName, startPos, endPos) { var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + // Get node at the location var node = ts.getTouchingPropertyName(sourceFile, startPos); if (!node) { return; } switch (node.kind) { - case 155: - case 126: - case 8: - case 80: - case 95: - case 89: - case 91: - case 93: - case 65: + case 155 /* PropertyAccessExpression */: + case 126 /* QualifiedName */: + case 8 /* StringLiteral */: + case 80 /* FalseKeyword */: + case 95 /* TrueKeyword */: + case 89 /* NullKeyword */: + case 91 /* SuperKeyword */: + case 93 /* ThisKeyword */: + case 65 /* Identifier */: break; + // Cant create the text span default: return; } var nodeForStartPos = node; while (true) { if (isRightSideOfPropertyAccess(nodeForStartPos) || isRightSideOfQualifiedName(nodeForStartPos)) { + // If on the span is in right side of the the property or qualified name, return the span from the qualified name pos to end of this node nodeForStartPos = nodeForStartPos.parent; } else if (isNameOfModuleDeclaration(nodeForStartPos)) { - if (nodeForStartPos.parent.parent.kind === 205 && + // If this is name of a module declarations, check if this is right side of dotted module name + // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of + // Then this name is name from dotted module + if (nodeForStartPos.parent.parent.kind === 205 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { + // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; } else { + // We have to use this name for start pos break; } } else { + // Is not a member expression so we have found the node for start pos break; } } return ts.createTextSpanFromBounds(nodeForStartPos.getStart(), node.getEnd()); } function getBreakpointStatementAtPosition(fileName, position) { + // doesn't use compiler - no need to synchronize with host var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); return ts.BreakpointResolver.spanInSourceFileAtLocation(sourceFile, position); } @@ -32980,45 +39141,53 @@ var ts; function getSemanticClassifications(fileName, span) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); + var typeChecker = program.getTypeChecker(); var result = []; processNode(sourceFile); return result; function classifySymbol(symbol, meaningAtPosition) { var flags = symbol.getFlags(); - if (flags & 32) { + if (flags & 32 /* Class */) { return ClassificationTypeNames.className; } - else if (flags & 384) { + else if (flags & 384 /* Enum */) { return ClassificationTypeNames.enumName; } - else if (flags & 524288) { + else if (flags & 524288 /* TypeAlias */) { return ClassificationTypeNames.typeAlias; } - else if (meaningAtPosition & 2) { - if (flags & 64) { + else if (meaningAtPosition & 2 /* Type */) { + if (flags & 64 /* Interface */) { return ClassificationTypeNames.interfaceName; } - else if (flags & 262144) { + else if (flags & 262144 /* TypeParameter */) { return ClassificationTypeNames.typeParameterName; } } - else if (flags & 1536) { - if (meaningAtPosition & 4 || - (meaningAtPosition & 1 && hasValueSideModule(symbol))) { + else if (flags & 1536 /* Module */) { + // Only classify a module as such if + // - It appears in a namespace context. + // - There exists a module declaration which actually impacts the value side. + if (meaningAtPosition & 4 /* Namespace */ || + (meaningAtPosition & 1 /* Value */ && hasValueSideModule(symbol))) { return ClassificationTypeNames.moduleName; } } return undefined; + /** + * Returns true if there exists a module that introduces entities on the value side. + */ function hasValueSideModule(symbol) { return ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 205 && ts.getModuleInstanceState(declaration) == 1; + return declaration.kind === 205 /* ModuleDeclaration */ && ts.getModuleInstanceState(declaration) == 1 /* Instantiated */; }); } } function processNode(node) { + // Only walk into nodes that intersect the requested span. if (node && ts.textSpanIntersectsWith(span, node.getStart(), node.getWidth())) { - if (node.kind === 65 && node.getWidth() > 0) { - var symbol = typeInfoResolver.getSymbolAtLocation(node); + if (node.kind === 65 /* Identifier */ && node.getWidth() > 0) { + var symbol = typeChecker.getSymbolAtLocation(node); if (symbol) { var type = classifySymbol(symbol, getMeaningFromLocation(node)); if (type) { @@ -33034,9 +39203,11 @@ var ts; } } function getSyntacticClassifications(fileName, span) { + // doesn't use compiler - no need to synchronize with host var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - var triviaScanner = ts.createScanner(2, false, sourceFile.text); - var mergeConflictScanner = ts.createScanner(2, false, sourceFile.text); + // Make a scanner we can get trivia from. + var triviaScanner = ts.createScanner(2 /* Latest */, false, sourceFile.text); + var mergeConflictScanner = ts.createScanner(2 /* Latest */, false, sourceFile.text); var result = []; processElement(sourceFile); return result; @@ -33045,6 +39216,7 @@ var ts; if (tokenStart === token.pos) { return; } + // token has trivia. Classify them appropriately. triviaScanner.setTextPos(token.pos); while (true) { var start = triviaScanner.getTextPos(); @@ -33056,29 +39228,36 @@ var ts; return; } if (ts.isComment(kind)) { + // Simple comment. Just add as is. result.push({ textSpan: ts.createTextSpan(start, width), classificationType: ClassificationTypeNames.comment }); continue; } - if (kind === 6) { + if (kind === 6 /* ConflictMarkerTrivia */) { var text = sourceFile.text; var ch = text.charCodeAt(start); - if (ch === 60 || ch === 62) { + // for the <<<<<<< and >>>>>>> markers, we just add them in as comments + // in the classification stream. + if (ch === 60 /* lessThan */ || ch === 62 /* greaterThan */) { result.push({ textSpan: ts.createTextSpan(start, width), classificationType: ClassificationTypeNames.comment }); continue; } - ts.Debug.assert(ch === 61); + // for the ======== add a comment for the first line, and then lex all + // subsequent lines up until the end of the conflict marker. + ts.Debug.assert(ch === 61 /* equals */); classifyDisabledMergeCode(text, start, end); } } } } function classifyDisabledMergeCode(text, start, end) { + // Classify the line that the ======= marker is on as a comment. Then just lex + // all further tokens and add them to the result. for (var i = start; i < end; i++) { if (ts.isLineBreak(text.charCodeAt(i))) { break; @@ -33117,69 +39296,79 @@ var ts; } } } + // for accurate classification, the actual token should be passed in. however, for + // cases like 'disabled merge code' classification, we just get the token kind and + // classify based on that instead. function classifyTokenType(tokenKind, token) { if (ts.isKeyword(tokenKind)) { return ClassificationTypeNames.keyword; } - if (tokenKind === 24 || tokenKind === 25) { + // Special case < and > If they appear in a generic context they are punctuation, + // not operators. + if (tokenKind === 24 /* LessThanToken */ || tokenKind === 25 /* GreaterThanToken */) { + // If the node owning the token has a type argument list or type parameter list, then + // we can effectively assume that a '<' and '>' belong to those lists. if (token && ts.getTypeArgumentOrTypeParameterList(token.parent)) { return ClassificationTypeNames.punctuation; } } if (ts.isPunctuation(tokenKind)) { if (token) { - if (tokenKind === 53) { - if (token.parent.kind === 198 || - token.parent.kind === 132 || - token.parent.kind === 129) { + if (tokenKind === 53 /* EqualsToken */) { + // the '=' in a variable declaration is special cased here. + if (token.parent.kind === 198 /* VariableDeclaration */ || + token.parent.kind === 132 /* PropertyDeclaration */ || + token.parent.kind === 129 /* Parameter */) { return ClassificationTypeNames.operator; } } - if (token.parent.kind === 169 || - token.parent.kind === 167 || - token.parent.kind === 168 || - token.parent.kind === 170) { + if (token.parent.kind === 169 /* BinaryExpression */ || + token.parent.kind === 167 /* PrefixUnaryExpression */ || + token.parent.kind === 168 /* PostfixUnaryExpression */ || + token.parent.kind === 170 /* ConditionalExpression */) { return ClassificationTypeNames.operator; } } return ClassificationTypeNames.punctuation; } - else if (tokenKind === 7) { + else if (tokenKind === 7 /* NumericLiteral */) { return ClassificationTypeNames.numericLiteral; } - else if (tokenKind === 8) { + else if (tokenKind === 8 /* StringLiteral */) { return ClassificationTypeNames.stringLiteral; } - else if (tokenKind === 9) { + else if (tokenKind === 9 /* RegularExpressionLiteral */) { + // TODO: we should get another classification type for these literals. return ClassificationTypeNames.stringLiteral; } else if (ts.isTemplateLiteralKind(tokenKind)) { + // TODO (drosen): we should *also* get another classification type for these literals. return ClassificationTypeNames.stringLiteral; } - else if (tokenKind === 65) { + else if (tokenKind === 65 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 201: + case 201 /* ClassDeclaration */: if (token.parent.name === token) { return ClassificationTypeNames.className; } return; - case 128: + case 128 /* TypeParameter */: if (token.parent.name === token) { return ClassificationTypeNames.typeParameterName; } return; - case 202: + case 202 /* InterfaceDeclaration */: if (token.parent.name === token) { return ClassificationTypeNames.interfaceName; } return; - case 204: + case 204 /* EnumDeclaration */: if (token.parent.name === token) { return ClassificationTypeNames.enumName; } return; - case 205: + case 205 /* ModuleDeclaration */: if (token.parent.name === token) { return ClassificationTypeNames.moduleName; } @@ -33190,6 +39379,7 @@ var ts; } } function processElement(element) { + // Ignore nodes that don't intersect the original span to classify. if (ts.textSpanIntersectsWith(span, element.getFullStart(), element.getFullWidth())) { var children = element.getChildren(); for (var _i = 0; _i < children.length; _i++) { @@ -33198,6 +39388,7 @@ var ts; classifyToken(child); } else { + // Recurse into our child nodes. processElement(child); } } @@ -33205,6 +39396,7 @@ var ts; } } function getOutliningSpans(fileName) { + // doesn't use compiler - no need to synchronize with host var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); return ts.OutliningElementsCollector.collectElements(sourceFile); } @@ -33214,6 +39406,7 @@ var ts; var token = ts.getTouchingToken(sourceFile, position); if (token.getStart(sourceFile) === position) { var matchKind = getMatchingTokenKind(token); + // Ensure that there is a corresponding token to match ours. if (matchKind) { var parentElement = token.parent; var childNodes = parentElement.getChildren(sourceFile); @@ -33222,6 +39415,7 @@ var ts; if (current.kind === matchKind) { var range1 = ts.createTextSpan(token.getStart(sourceFile), token.getWidth(sourceFile)); var range2 = ts.createTextSpan(current.getStart(sourceFile), current.getWidth(sourceFile)); + // We want to order the braces when we return the result. if (range1.start < range2.start) { result.push(range1, range2); } @@ -33236,14 +39430,14 @@ var ts; return result; function getMatchingTokenKind(token) { switch (token.kind) { - case 14: return 15; - case 16: return 17; - case 18: return 19; - case 24: return 25; - case 15: return 14; - case 17: return 16; - case 19: return 18; - case 25: return 24; + case 14 /* OpenBraceToken */: return 15 /* CloseBraceToken */; + case 16 /* OpenParenToken */: return 17 /* CloseParenToken */; + case 18 /* OpenBracketToken */: return 19 /* CloseBracketToken */; + case 24 /* LessThanToken */: return 25 /* GreaterThanToken */; + case 15 /* CloseBraceToken */: return 14 /* OpenBraceToken */; + case 17 /* CloseParenToken */: return 16 /* OpenParenToken */; + case 19 /* CloseBracketToken */: return 18 /* OpenBracketToken */; + case 25 /* GreaterThanToken */: return 24 /* LessThanToken */; } return undefined; } @@ -33279,6 +39473,12 @@ var ts; return []; } function getTodoComments(fileName, descriptors) { + // Note: while getting todo comments seems like a syntactic operation, we actually + // treat it as a semantic operation here. This is because we expect our host to call + // this on every single file. If we treat this syntactically, then that will cause + // us to populate and throw away the tree in our syntax tree cache for each file. By + // treating this as a semantic operation, we can access any tree without throwing + // anything away. synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); cancellationToken.throwIfCancellationRequested(); @@ -33289,10 +39489,29 @@ var ts; var matchArray; while (matchArray = regExp.exec(fileContents)) { cancellationToken.throwIfCancellationRequested(); + // If we got a match, here is what the match array will look like. Say the source text is: + // + // " // hack 1" + // + // The result array with the regexp: will be: + // + // ["// hack 1", "// ", "hack 1", undefined, "hack"] + // + // Here are the relevant capture groups: + // 0) The full match for the entire regexp. + // 1) The preamble to the message portion. + // 2) The message portion. + // 3...N) The descriptor that was matched - by index. 'undefined' for each + // descriptor that didn't match. an actual value if it did match. + // + // i.e. 'undefined' in position 3 above means TODO(jason) didn't match. + // "hack" in position 4 means HACK did match. var firstDescriptorCaptureIndex = 3; ts.Debug.assert(matchArray.length === descriptors.length + firstDescriptorCaptureIndex); var preamble = matchArray[1]; var matchPosition = matchArray.index + preamble.length; + // OK, we have found a match in the file. This is only an acceptable match if + // it is contained within a comment. var token = ts.getTokenAtPosition(sourceFile, matchPosition); if (!isInsideComment(sourceFile, token, matchPosition)) { continue; @@ -33304,6 +39523,8 @@ var ts; } } ts.Debug.assert(descriptor !== undefined); + // We don't want to match something like 'TODOBY', so we make sure a non + // letter/digit follows the match. if (isLetterOrDigit(fileContents.charCodeAt(matchPosition + descriptor.text.length))) { continue; } @@ -33322,49 +39543,89 @@ var ts; 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. + // TODO comments can appear in one of the following forms: + // + // 1) // TODO or /////////// TODO + // + // 2) /* TODO or /********** TODO + // + // 3) /* + // * TODO + // */ + // + // The following three regexps are used to match the start of the text up to the TODO + // comment portion. var singleLineCommentStart = /(?:\/\/+\s*)/.source; var multiLineCommentStart = /(?:\/\*+\s*)/.source; var anyNumberOfSpacesAndAsterixesAtStartOfLine = /(?:^(?:\s|\*)*)/.source; + // Match any of the above three TODO comment start regexps. + // Note that the outermost group *is* a capture group. We want to capture the preamble + // so that we can determine the starting position of the TODO comment match. var preamble = "(" + anyNumberOfSpacesAndAsterixesAtStartOfLine + "|" + singleLineCommentStart + "|" + multiLineCommentStart + ")"; + // Takes the descriptors and forms a regexp that matches them as if they were literals. + // For example, if the descriptors are "TODO(jason)" and "HACK", then this will be: + // + // (?:(TODO\(jason\))|(HACK)) + // + // Note that the outermost group is *not* a capture group, but the innermost groups + // *are* capture groups. By capturing the inner literals we can determine after + // matching which descriptor we are dealing with. var literals = "(?:" + ts.map(descriptors, function (d) { return "(" + escapeRegExp(d.text) + ")"; }).join("|") + ")"; + // After matching a descriptor literal, the following regexp matches the rest of the + // text up to the end of the line (or */). var endOfLineOrEndOfComment = /(?:$|\*\/)/.source; var messageRemainder = /(?:.*?)/.source; + // This is the portion of the match we'll return as part of the TODO comment result. We + // match the literal portion up to the end of the line or end of comment. var messagePortion = "(" + literals + messageRemainder + ")"; var regExpString = preamble + messagePortion + endOfLineOrEndOfComment; + // The final regexp will look like this: + // /((?:\/\/+\s*)|(?:\/\*+\s*)|(?:^(?:\s|\*)*))((?:(TODO\(jason\))|(HACK))(?:.*?))(?:$|\*\/)/gim + // The flags of the regexp are important here. + // 'g' is so that we are doing a global search and can find matches several times + // in the input. + // + // 'i' is for case insensitivity (We do this to match C# TODO comment code). + // + // 'm' is so we can find matches in a multi-line input. return new RegExp(regExpString, "gim"); } function isLetterOrDigit(char) { - return (char >= 97 && char <= 122) || - (char >= 65 && char <= 90) || - (char >= 48 && char <= 57); + return (char >= 97 /* a */ && char <= 122 /* z */) || + (char >= 65 /* A */ && char <= 90 /* Z */) || + (char >= 48 /* _0 */ && char <= 57 /* _9 */); } } function getRenameInfo(fileName, position) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); + var typeChecker = program.getTypeChecker(); var node = ts.getTouchingWord(sourceFile, position); - if (node && node.kind === 65) { - var symbol = typeInfoResolver.getSymbolAtLocation(node); + // Can only rename an identifier. + if (node && node.kind === 65 /* Identifier */) { + var symbol = typeChecker.getSymbolAtLocation(node); + // Only allow a symbol to be renamed if it actually has at least one declaration. if (symbol) { var declarations = symbol.getDeclarations(); if (declarations && declarations.length > 0) { + // Disallow rename for elements that are defined in the standard TypeScript library. var defaultLibFileName = host.getDefaultLibFileName(host.getCompilationSettings()); if (defaultLibFileName) { for (var _i = 0; _i < declarations.length; _i++) { var current = declarations[_i]; - var sourceFile_1 = current.getSourceFile(); - if (sourceFile_1 && getCanonicalFileName(ts.normalizePath(sourceFile_1.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) { + var sourceFile_2 = current.getSourceFile(); + if (sourceFile_2 && getCanonicalFileName(ts.normalizePath(sourceFile_2.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) { return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library.key)); } } } - var kind = getSymbolKind(symbol, typeInfoResolver, node); + var kind = getSymbolKind(symbol, node); if (kind) { return { canRename: true, localizedErrorMessage: undefined, displayName: symbol.name, - fullDisplayName: typeInfoResolver.getFullyQualifiedName(symbol), + fullDisplayName: typeChecker.getFullyQualifiedName(symbol), kind: kind, kindModifiers: getSymbolModifiers(symbol), triggerSpan: ts.createTextSpan(node.getStart(), node.getWidth()) @@ -33402,6 +39663,7 @@ var ts; getReferencesAtPosition: getReferencesAtPosition, findReferences: findReferences, getOccurrencesAtPosition: getOccurrencesAtPosition, + getDocumentHighlights: getDocumentHighlights, getNameOrDottedNameSpan: getNameOrDottedNameSpan, getBreakpointStatementAtPosition: getBreakpointStatementAtPosition, getNavigateToItems: getNavigateToItems, @@ -33421,6 +39683,7 @@ var ts; }; } ts.createLanguageService = createLanguageService; + /* @internal */ function getNameTable(sourceFile) { if (!sourceFile.nameTable) { initializeNameTable(sourceFile); @@ -33434,13 +39697,17 @@ var ts; sourceFile.nameTable = nameTable; function walk(node) { switch (node.kind) { - case 65: + case 65 /* Identifier */: nameTable[node.text] = node.text; break; - case 8: - case 7: + case 8 /* StringLiteral */: + case 7 /* NumericLiteral */: + // We want to store any numbers/strings if they were a name that could be + // related to a declaration. So, if we have 'import x = require("something")' + // then we want 'something' to be in the name table. Similarly, if we have + // "a['propname']" then we want to store "propname" in the name table. if (ts.isDeclarationName(node) || - node.parent.kind === 219 || + node.parent.kind === 219 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node)) { nameTable[node.text] = node.text; } @@ -33453,126 +39720,202 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 156 && + node.parent.kind === 156 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } + /// Classifier function createClassifier() { - var scanner = ts.createScanner(2, false); + var scanner = ts.createScanner(2 /* Latest */, false); + /// We do not have a full parser support to know when we should parse a regex or not + /// If we consider every slash token to be a regex, we could be missing cases like "1/2/3", where + /// we have a series of divide operator. this list allows us to be more accurate by ruling out + /// locations where a regexp cannot exist. var noRegexTable = []; - noRegexTable[65] = true; - noRegexTable[8] = true; - noRegexTable[7] = true; - noRegexTable[9] = true; - noRegexTable[93] = true; - noRegexTable[38] = true; - noRegexTable[39] = true; - noRegexTable[17] = true; - noRegexTable[19] = true; - noRegexTable[15] = true; - noRegexTable[95] = true; - noRegexTable[80] = true; + noRegexTable[65 /* Identifier */] = true; + noRegexTable[8 /* StringLiteral */] = true; + noRegexTable[7 /* NumericLiteral */] = true; + noRegexTable[9 /* RegularExpressionLiteral */] = true; + noRegexTable[93 /* ThisKeyword */] = true; + noRegexTable[38 /* PlusPlusToken */] = true; + noRegexTable[39 /* MinusMinusToken */] = true; + noRegexTable[17 /* CloseParenToken */] = true; + noRegexTable[19 /* CloseBracketToken */] = true; + noRegexTable[15 /* CloseBraceToken */] = true; + noRegexTable[95 /* TrueKeyword */] = true; + noRegexTable[80 /* FalseKeyword */] = true; + // Just a stack of TemplateHeads and OpenCurlyBraces, used to perform rudimentary (inexact) + // classification on template strings. Because of the context free nature of templates, + // the only precise way to classify a template portion would be by propagating the stack across + // lines, just as we do with the end-of-line state. However, this is a burden for implementers, + // and the behavior is entirely subsumed by the syntactic classifier anyway, so we instead + // flatten any nesting when the template stack is non-empty and encode it in the end-of-line state. + // Situations in which this fails are + // 1) When template strings are nested across different lines: + // `hello ${ `world + // ` }` + // + // Where on the second line, you will get the closing of a template, + // a closing curly, and a new template. + // + // 2) When substitution expressions have curly braces and the curly brace falls on the next line: + // `hello ${ () => { + // return "world" } } ` + // + // Where on the second line, you will get the 'return' keyword, + // a string literal, and a template end consisting of '} } `'. var templateStack = []; + /** Returns true if 'keyword2' can legally follow 'keyword1' in any language construct. */ function canFollow(keyword1, keyword2) { if (ts.isAccessibilityModifier(keyword1)) { - if (keyword2 === 116 || - keyword2 === 120 || - keyword2 === 114 || - keyword2 === 110) { + if (keyword2 === 116 /* GetKeyword */ || + keyword2 === 120 /* SetKeyword */ || + keyword2 === 114 /* ConstructorKeyword */ || + keyword2 === 109 /* StaticKeyword */) { + // Allow things like "public get", "public constructor" and "public static". + // These are all legal. return true; } + // Any other keyword following "public" is actually an identifier an not a real + // keyword. return false; } + // Assume any other keyword combination is legal. This can be refined in the future + // if there are more cases we want the classifier to be better at. return true; } + // If there is a syntactic classifier ('syntacticClassifierAbsent' is false), + // we will be more conservative in order to avoid conflicting with the syntactic classifier. function getClassificationsForLine(text, lexState, syntacticClassifierAbsent) { var offset = 0; - var token = 0; - var lastNonTriviaToken = 0; + var token = 0 /* Unknown */; + var lastNonTriviaToken = 0 /* Unknown */; + // Empty out the template stack for reuse. while (templateStack.length > 0) { templateStack.pop(); } + // If we're in a string literal, then prepend: "\ + // (and a newline). That way when we lex we'll think we're still in a string literal. + // + // If we're in a multiline comment, then prepend: /* + // (and a newline). That way when we lex we'll think we're still in a multiline comment. switch (lexState) { - case 3: + case 3 /* InDoubleQuoteStringLiteral */: text = '"\\\n' + text; offset = 3; break; - case 2: + case 2 /* InSingleQuoteStringLiteral */: text = "'\\\n" + text; offset = 3; break; - case 1: + case 1 /* InMultiLineCommentTrivia */: text = "/*\n" + text; offset = 3; break; - case 4: + case 4 /* InTemplateHeadOrNoSubstitutionTemplate */: text = "`\n" + text; offset = 2; break; - case 5: + case 5 /* InTemplateMiddleOrTail */: text = "}\n" + text; offset = 2; - case 6: - templateStack.push(11); + // fallthrough + case 6 /* InTemplateSubstitutionPosition */: + templateStack.push(11 /* TemplateHead */); break; } scanner.setText(text); var result = { - finalLexState: 0, + finalLexState: 0 /* Start */, entries: [] }; + // We can run into an unfortunate interaction between the lexical and syntactic classifier + // when the user is typing something generic. Consider the case where the user types: + // + // Foo tokens. It's a weak heuristic, but should + // work well enough in practice. var angleBracketStack = 0; do { token = scanner.scan(); if (!ts.isTrivia(token)) { - if ((token === 36 || token === 57) && !noRegexTable[lastNonTriviaToken]) { - if (scanner.reScanSlashToken() === 9) { - token = 9; + if ((token === 36 /* SlashToken */ || token === 57 /* SlashEqualsToken */) && !noRegexTable[lastNonTriviaToken]) { + if (scanner.reScanSlashToken() === 9 /* RegularExpressionLiteral */) { + token = 9 /* RegularExpressionLiteral */; } } - else if (lastNonTriviaToken === 20 && isKeyword(token)) { - token = 65; + else if (lastNonTriviaToken === 20 /* DotToken */ && isKeyword(token)) { + token = 65 /* Identifier */; } else if (isKeyword(lastNonTriviaToken) && isKeyword(token) && !canFollow(lastNonTriviaToken, token)) { - token = 65; + // We have two keywords in a row. Only treat the second as a keyword if + // it's a sequence that could legally occur in the language. Otherwise + // treat it as an identifier. This way, if someone writes "private var" + // we recognize that 'var' is actually an identifier here. + token = 65 /* Identifier */; } - else if (lastNonTriviaToken === 65 && - token === 24) { + else if (lastNonTriviaToken === 65 /* Identifier */ && + token === 24 /* LessThanToken */) { + // Could be the start of something generic. Keep track of that by bumping + // up the current count of generic contexts we may be in. angleBracketStack++; } - else if (token === 25 && angleBracketStack > 0) { + else if (token === 25 /* GreaterThanToken */ && angleBracketStack > 0) { + // If we think we're currently in something generic, then mark that that + // generic entity is complete. angleBracketStack--; } - else if (token === 112 || - token === 121 || - token === 119 || - token === 113 || - token === 122) { + else if (token === 112 /* AnyKeyword */ || + token === 121 /* StringKeyword */ || + token === 119 /* NumberKeyword */ || + token === 113 /* BooleanKeyword */ || + token === 122 /* SymbolKeyword */) { if (angleBracketStack > 0 && !syntacticClassifierAbsent) { - token = 65; + // If it looks like we're could be in something generic, don't classify this + // as a keyword. We may just get overwritten by the syntactic classifier, + // causing a noisy experience for the user. + token = 65 /* Identifier */; } } - else if (token === 11) { + else if (token === 11 /* TemplateHead */) { templateStack.push(token); } - else if (token === 14) { + else if (token === 14 /* OpenBraceToken */) { + // If we don't have anything on the template stack, + // then we aren't trying to keep track of a previously scanned template head. if (templateStack.length > 0) { templateStack.push(token); } } - else if (token === 15) { + else if (token === 15 /* CloseBraceToken */) { + // If we don't have anything on the template stack, + // then we aren't trying to keep track of a previously scanned template head. if (templateStack.length > 0) { var lastTemplateStackToken = ts.lastOrUndefined(templateStack); - if (lastTemplateStackToken === 11) { + if (lastTemplateStackToken === 11 /* TemplateHead */) { token = scanner.reScanTemplateToken(); - if (token === 13) { + // Only pop on a TemplateTail; a TemplateMiddle indicates there is more for us. + if (token === 13 /* TemplateTail */) { templateStack.pop(); } else { - ts.Debug.assert(token === 12, "Should have been a template middle. Was " + token); + ts.Debug.assert(token === 12 /* TemplateMiddle */, "Should have been a template middle. Was " + token); } } else { - ts.Debug.assert(lastTemplateStackToken === 14, "Should have been an open brace. Was: " + token); + ts.Debug.assert(lastTemplateStackToken === 14 /* OpenBraceToken */, "Should have been an open brace. Was: " + token); templateStack.pop(); } } @@ -33580,54 +39923,59 @@ var ts; lastNonTriviaToken = token; } processToken(); - } while (token !== 1); + } while (token !== 1 /* EndOfFileToken */); return result; function processToken() { var start = scanner.getTokenPos(); var end = scanner.getTextPos(); addResult(end - start, classFromKind(token)); if (end >= text.length) { - if (token === 8) { + if (token === 8 /* StringLiteral */) { + // Check to see if we finished up on a multiline string literal. var tokenText = scanner.getTokenText(); if (scanner.isUnterminated()) { var lastCharIndex = tokenText.length - 1; var numBackslashes = 0; - while (tokenText.charCodeAt(lastCharIndex - numBackslashes) === 92) { + while (tokenText.charCodeAt(lastCharIndex - numBackslashes) === 92 /* backslash */) { numBackslashes++; } + // If we have an odd number of backslashes, then the multiline string is unclosed if (numBackslashes & 1) { var quoteChar = tokenText.charCodeAt(0); - result.finalLexState = quoteChar === 34 - ? 3 - : 2; + result.finalLexState = quoteChar === 34 /* doubleQuote */ + ? 3 /* InDoubleQuoteStringLiteral */ + : 2 /* InSingleQuoteStringLiteral */; } } } - else if (token === 3) { + else if (token === 3 /* MultiLineCommentTrivia */) { + // Check to see if the multiline comment was unclosed. if (scanner.isUnterminated()) { - result.finalLexState = 1; + result.finalLexState = 1 /* InMultiLineCommentTrivia */; } } else if (ts.isTemplateLiteralKind(token)) { if (scanner.isUnterminated()) { - if (token === 13) { - result.finalLexState = 5; + if (token === 13 /* TemplateTail */) { + result.finalLexState = 5 /* InTemplateMiddleOrTail */; } - else if (token === 10) { - result.finalLexState = 4; + else if (token === 10 /* NoSubstitutionTemplateLiteral */) { + result.finalLexState = 4 /* InTemplateHeadOrNoSubstitutionTemplate */; } else { ts.Debug.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #" + token); } } } - else if (templateStack.length > 0 && ts.lastOrUndefined(templateStack) === 11) { - result.finalLexState = 6; + else if (templateStack.length > 0 && ts.lastOrUndefined(templateStack) === 11 /* TemplateHead */) { + result.finalLexState = 6 /* InTemplateSubstitutionPosition */; } } } function addResult(length, classification) { if (length > 0) { + // If this is the first classification we're adding to the list, then remove any + // offset we have if we were continuing a construct from the previous line. if (result.entries.length === 0) { length -= offset; } @@ -33637,42 +39985,42 @@ var ts; } function isBinaryExpressionOperatorToken(token) { switch (token) { - case 35: - case 36: - case 37: - case 33: - case 34: - case 40: - case 41: - case 42: - case 24: - case 25: - case 26: - case 27: - case 87: - case 86: - case 28: - case 29: - case 30: - case 31: - case 43: - case 45: - case 44: - case 48: - case 49: - case 63: - case 62: - case 64: - case 59: - case 60: - case 61: - case 54: - case 55: - case 56: - case 57: - case 58: - case 53: - case 23: + case 35 /* AsteriskToken */: + case 36 /* SlashToken */: + case 37 /* PercentToken */: + case 33 /* PlusToken */: + case 34 /* MinusToken */: + case 40 /* LessThanLessThanToken */: + case 41 /* GreaterThanGreaterThanToken */: + case 42 /* GreaterThanGreaterThanGreaterThanToken */: + case 24 /* LessThanToken */: + case 25 /* GreaterThanToken */: + case 26 /* LessThanEqualsToken */: + case 27 /* GreaterThanEqualsToken */: + case 87 /* InstanceOfKeyword */: + case 86 /* InKeyword */: + case 28 /* EqualsEqualsToken */: + case 29 /* ExclamationEqualsToken */: + case 30 /* EqualsEqualsEqualsToken */: + case 31 /* ExclamationEqualsEqualsToken */: + case 43 /* AmpersandToken */: + case 45 /* CaretToken */: + case 44 /* BarToken */: + case 48 /* AmpersandAmpersandToken */: + case 49 /* BarBarToken */: + case 63 /* BarEqualsToken */: + case 62 /* AmpersandEqualsToken */: + case 64 /* CaretEqualsToken */: + case 59 /* LessThanLessThanEqualsToken */: + case 60 /* GreaterThanGreaterThanEqualsToken */: + case 61 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 54 /* PlusEqualsToken */: + case 55 /* MinusEqualsToken */: + case 56 /* AsteriskEqualsToken */: + case 57 /* SlashEqualsToken */: + case 58 /* PercentEqualsToken */: + case 53 /* EqualsToken */: + case 23 /* CommaToken */: return true; default: return false; @@ -33680,19 +40028,19 @@ var ts; } function isPrefixUnaryExpressionOperatorToken(token) { switch (token) { - case 33: - case 34: - case 47: - case 46: - case 38: - case 39: + case 33 /* PlusToken */: + case 34 /* MinusToken */: + case 47 /* TildeToken */: + case 46 /* ExclamationToken */: + case 38 /* PlusPlusToken */: + case 39 /* MinusMinusToken */: return true; default: return false; } } function isKeyword(token) { - return token >= 66 && token <= 125; + return token >= 66 /* FirstKeyword */ && token <= 125 /* LastKeyword */; } function classFromKind(token) { if (isKeyword(token)) { @@ -33701,24 +40049,24 @@ var ts; else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) { return TokenClass.Operator; } - else if (token >= 14 && token <= 64) { + else if (token >= 14 /* FirstPunctuation */ && token <= 64 /* LastPunctuation */) { return TokenClass.Punctuation; } switch (token) { - case 7: + case 7 /* NumericLiteral */: return TokenClass.NumberLiteral; - case 8: + case 8 /* StringLiteral */: return TokenClass.StringLiteral; - case 9: + case 9 /* RegularExpressionLiteral */: return TokenClass.RegExpLiteral; - case 6: - case 3: - case 2: + case 6 /* ConflictMarkerTrivia */: + case 3 /* MultiLineCommentTrivia */: + case 2 /* SingleLineCommentTrivia */: return TokenClass.Comment; - case 5: - case 4: + case 5 /* WhitespaceTrivia */: + case 4 /* NewLineTrivia */: return TokenClass.Whitespace; - case 65: + case 65 /* Identifier */: default: if (ts.isTemplateLiteralKind(token)) { return TokenClass.StringLiteral; @@ -33729,7 +40077,13 @@ var ts; return { getClassificationsForLine: getClassificationsForLine }; } ts.createClassifier = createClassifier; + /** + * 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) { + // Check __dirname is defined and that we are on a node.js system. if (typeof __dirname !== "undefined") { return __dirname + ts.directorySeparator + ts.getDefaultLibFileName(options); } @@ -33741,7 +40095,7 @@ var ts; getNodeConstructor: function (kind) { function Node() { } - var proto = kind === 227 ? new SourceFileObject() : new NodeObject(); + var proto = kind === 227 /* SourceFile */ ? new SourceFileObject() : new NodeObject(); proto.kind = kind; proto.pos = 0; proto.end = 0; @@ -33760,25 +40114,38 @@ var ts; // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// +/* @internal */ var ts; (function (ts) { var BreakpointResolver; (function (BreakpointResolver) { + /** + * Get the breakpoint span in given sourceFile + */ function spanInSourceFileAtLocation(sourceFile, position) { - if (sourceFile.flags & 2048) { + // Cannot set breakpoint in dts file + if (sourceFile.flags & 2048 /* DeclarationFile */) { return undefined; } var tokenAtLocation = ts.getTokenAtPosition(sourceFile, position); var lineOfPosition = sourceFile.getLineAndCharacterOfPosition(position).line; if (sourceFile.getLineAndCharacterOfPosition(tokenAtLocation.getStart()).line > lineOfPosition) { + // Get previous token if the token is returned starts on new line + // eg: let x =10; |--- cursor is here + // let y = 10; + // token at position will return let keyword on second line as the token but we would like to use + // token on same line if trailing trivia (comments or white spaces on same line) part of the last token on that line tokenAtLocation = ts.findPrecedingToken(tokenAtLocation.pos, sourceFile); + // Its a blank line if (!tokenAtLocation || sourceFile.getLineAndCharacterOfPosition(tokenAtLocation.getEnd()).line !== lineOfPosition) { return undefined; } } + // Cannot set breakpoint in ambient declarations if (ts.isInAmbientContext(tokenAtLocation)) { return undefined; } + // Get the span in the node based on its syntax return spanInNode(tokenAtLocation); function textSpan(startNode, endNode) { return ts.createTextSpanFromBounds(startNode.getStart(), (endNode || startNode).getEnd()); @@ -33798,173 +40165,210 @@ var ts; function spanInNode(node) { if (node) { if (ts.isExpression(node)) { - if (node.parent.kind === 184) { + if (node.parent.kind === 184 /* DoStatement */) { + // Set span as if on while keyword return spanInPreviousNode(node); } - if (node.parent.kind === 186) { + if (node.parent.kind === 186 /* ForStatement */) { + // For now lets set the span on this expression, fix it later return textSpan(node); } - if (node.parent.kind === 169 && node.parent.operatorToken.kind === 23) { + if (node.parent.kind === 169 /* BinaryExpression */ && node.parent.operatorToken.kind === 23 /* CommaToken */) { + // if this is comma expression, the breakpoint is possible in this expression return textSpan(node); } - if (node.parent.kind == 163 && node.parent.body == node) { + if (node.parent.kind == 163 /* ArrowFunction */ && node.parent.body == node) { + // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); } } switch (node.kind) { - case 180: + case 180 /* VariableStatement */: + // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 198: - case 132: - case 131: + case 198 /* VariableDeclaration */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: return spanInVariableDeclaration(node); - case 129: + case 129 /* Parameter */: return spanInParameterDeclaration(node); - case 200: - case 134: - case 133: - case 136: - case 137: - case 135: - case 162: - case 163: + case 200 /* FunctionDeclaration */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 135 /* Constructor */: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 179: + case 179 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } - case 206: + // Fall through + case 206 /* ModuleBlock */: return spanInBlock(node); - case 223: + case 223 /* CatchClause */: return spanInBlock(node.block); - case 182: + case 182 /* ExpressionStatement */: + // span on the expression return textSpan(node.expression); - case 191: + case 191 /* ReturnStatement */: + // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 185: + case 185 /* WhileStatement */: + // Span on while(...) return textSpan(node, ts.findNextToken(node.expression, node)); - case 184: + case 184 /* DoStatement */: + // span in statement of the do statement return spanInNode(node.statement); - case 197: + case 197 /* DebuggerStatement */: + // span on debugger keyword return textSpan(node.getChildAt(0)); - case 183: + case 183 /* IfStatement */: + // set on if(..) span return textSpan(node, ts.findNextToken(node.expression, node)); - case 194: + case 194 /* LabeledStatement */: + // span in statement return spanInNode(node.statement); - case 190: - case 189: + case 190 /* BreakStatement */: + case 189 /* ContinueStatement */: + // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 186: + case 186 /* ForStatement */: return spanInForStatement(node); - case 187: - case 188: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: + // span on for (a in ...) return textSpan(node, ts.findNextToken(node.expression, node)); - case 193: + case 193 /* SwitchStatement */: + // span on switch(...) return textSpan(node, ts.findNextToken(node.expression, node)); - case 220: - case 221: + case 220 /* CaseClause */: + case 221 /* DefaultClause */: + // span in first statement of the clause return spanInNode(node.statements[0]); - case 196: + case 196 /* TryStatement */: + // span in try block return spanInBlock(node.tryBlock); - case 195: + case 195 /* ThrowStatement */: + // span in throw ... return textSpan(node, node.expression); - case 214: - if (!node.expression) { - return undefined; - } + case 214 /* ExportAssignment */: + // span on export = id return textSpan(node, node.expression); - case 208: + case 208 /* ImportEqualsDeclaration */: + // import statement without including semicolon return textSpan(node, node.moduleReference); - case 209: + case 209 /* ImportDeclaration */: + // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 215: + case 215 /* ExportDeclaration */: + // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 205: - if (ts.getModuleInstanceState(node) !== 1) { + case 205 /* ModuleDeclaration */: + // span on complete module if it is instantiated + if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } - case 201: - case 204: - case 226: - case 157: - case 158: + case 201 /* ClassDeclaration */: + case 204 /* EnumDeclaration */: + case 226 /* EnumMember */: + case 157 /* CallExpression */: + case 158 /* NewExpression */: + // span on complete node return textSpan(node); - case 192: + case 192 /* WithStatement */: + // span in statement return spanInNode(node.statement); - case 202: - case 203: + // No breakpoint in interface, type alias + case 202 /* InterfaceDeclaration */: + case 203 /* TypeAliasDeclaration */: return undefined; - case 22: - case 1: + // Tokens: + case 22 /* SemicolonToken */: + case 1 /* EndOfFileToken */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile)); - case 23: + case 23 /* CommaToken */: return spanInPreviousNode(node); - case 14: + case 14 /* OpenBraceToken */: return spanInOpenBraceToken(node); - case 15: + case 15 /* CloseBraceToken */: return spanInCloseBraceToken(node); - case 16: + case 16 /* OpenParenToken */: return spanInOpenParenToken(node); - case 17: + case 17 /* CloseParenToken */: return spanInCloseParenToken(node); - case 51: + case 51 /* ColonToken */: return spanInColonToken(node); - case 25: - case 24: + case 25 /* GreaterThanToken */: + case 24 /* LessThanToken */: return spanInGreaterThanOrLessThanToken(node); - case 100: + // Keywords: + case 100 /* WhileKeyword */: return spanInWhileKeyword(node); - case 76: - case 68: - case 81: + case 76 /* ElseKeyword */: + case 68 /* CatchKeyword */: + case 81 /* FinallyKeyword */: return spanInNextNode(node); default: - if (node.parent.kind === 224 && node.parent.name === node) { + // If this is name of property assignment, set breakpoint in the initializer + if (node.parent.kind === 224 /* PropertyAssignment */ && node.parent.name === node) { return spanInNode(node.parent.initializer); } - if (node.parent.kind === 160 && node.parent.type === node) { + // Breakpoint in type assertion goes to its operand + if (node.parent.kind === 160 /* TypeAssertionExpression */ && node.parent.type === node) { return spanInNode(node.parent.expression); } + // return type of function go to previous token if (ts.isFunctionLike(node.parent) && node.parent.type === node) { return spanInPreviousNode(node); } + // Default go to parent to set the breakpoint return spanInNode(node.parent); } } function spanInVariableDeclaration(variableDeclaration) { - if (variableDeclaration.parent.parent.kind === 187 || - variableDeclaration.parent.parent.kind === 188) { + // If declaration of for in statement, just set the span in parent + if (variableDeclaration.parent.parent.kind === 187 /* ForInStatement */ || + variableDeclaration.parent.parent.kind === 188 /* ForOfStatement */) { return spanInNode(variableDeclaration.parent.parent); } - var isParentVariableStatement = variableDeclaration.parent.parent.kind === 180; - var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 186 && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); + var isParentVariableStatement = variableDeclaration.parent.parent.kind === 180 /* VariableStatement */; + var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 186 /* ForStatement */ && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); var declarations = isParentVariableStatement ? variableDeclaration.parent.parent.declarationList.declarations : isDeclarationOfForStatement ? variableDeclaration.parent.parent.initializer.declarations : undefined; - if (variableDeclaration.initializer || (variableDeclaration.flags & 1)) { + // Breakpoint is possible in variableDeclaration only if there is initialization + if (variableDeclaration.initializer || (variableDeclaration.flags & 1 /* Export */)) { if (declarations && declarations[0] === variableDeclaration) { if (isParentVariableStatement) { + // First declaration - include let keyword return textSpan(variableDeclaration.parent, variableDeclaration); } else { ts.Debug.assert(isDeclarationOfForStatement); + // Include let keyword from for statement declarations in the span return textSpan(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); } } else { + // Span only on this declaration return textSpan(variableDeclaration); } } else if (declarations && declarations[0] !== variableDeclaration) { + // If we cant set breakpoint on this declaration, set it on previous one var indexOfCurrentDeclaration = ts.indexOf(declarations, variableDeclaration); return spanInVariableDeclaration(declarations[indexOfCurrentDeclaration - 1]); } } function canHaveSpanInParameterDeclaration(parameter) { + // Breakpoint is possible on parameter only if it has initializer, is a rest parameter, or has public or private modifier return !!parameter.initializer || parameter.dotDotDotToken !== undefined || - !!(parameter.flags & 16) || !!(parameter.flags & 32); + !!(parameter.flags & 16 /* Public */) || !!(parameter.flags & 32 /* Private */); } function spanInParameterDeclaration(parameter) { if (canHaveSpanInParameterDeclaration(parameter)) { @@ -33974,24 +40378,29 @@ var ts; var functionDeclaration = parameter.parent; var indexOfParameter = ts.indexOf(functionDeclaration.parameters, parameter); if (indexOfParameter) { + // Not a first parameter, go to previous parameter return spanInParameterDeclaration(functionDeclaration.parameters[indexOfParameter - 1]); } else { + // Set breakpoint in the function declaration body return spanInNode(functionDeclaration.body); } } } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { - return !!(functionDeclaration.flags & 1) || - (functionDeclaration.parent.kind === 201 && functionDeclaration.kind !== 135); + return !!(functionDeclaration.flags & 1 /* Export */) || + (functionDeclaration.parent.kind === 201 /* ClassDeclaration */ && functionDeclaration.kind !== 135 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { + // No breakpoints in the function signature if (!functionDeclaration.body) { return undefined; } if (canFunctionHaveSpanInWholeDeclaration(functionDeclaration)) { + // Set the span on whole function declaration return textSpan(functionDeclaration); } + // Set span in function body return spanInNode(functionDeclaration.body); } function spanInFunctionBlock(block) { @@ -34003,23 +40412,26 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 205: - if (ts.getModuleInstanceState(block.parent) !== 1) { + case 205 /* ModuleDeclaration */: + if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } - case 185: - case 183: - case 187: - case 188: + // Set on parent if on same line otherwise on first statement + case 185 /* WhileStatement */: + case 183 /* IfStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); - case 186: + // Set span on previous token if it starts on same line otherwise on the first statement of the block + case 186 /* ForStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } + // Default action is to set on first statement return spanInNode(block.statements[0]); } function spanInForStatement(forStatement) { if (forStatement.initializer) { - if (forStatement.initializer.kind === 199) { + if (forStatement.initializer.kind === 199 /* VariableDeclarationList */) { var variableDeclarationList = forStatement.initializer; if (variableDeclarationList.declarations.length > 0) { return spanInNode(variableDeclarationList.declarations[0]); @@ -34036,87 +40448,103 @@ var ts; return textSpan(forStatement.iterator); } } + // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 204: + case 204 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 201: + case 201 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 207: + case 207 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } + // Default to parent node return spanInNode(node.parent); } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 206: - if (ts.getModuleInstanceState(node.parent.parent) !== 1) { + case 206 /* ModuleBlock */: + // If this is not instantiated module block no bp span + if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } - case 204: - case 201: + case 204 /* EnumDeclaration */: + case 201 /* ClassDeclaration */: + // Span on close brace token return textSpan(node); - case 179: + case 179 /* Block */: if (ts.isFunctionBlock(node.parent)) { + // Span on close brace token return textSpan(node); } - case 223: + // fall through. + case 223 /* CatchClause */: return spanInNode(node.parent.statements[node.parent.statements.length - 1]); ; - case 207: + case 207 /* CaseBlock */: + // breakpoint in last statement of the last clause var caseBlock = node.parent; var lastClause = caseBlock.clauses[caseBlock.clauses.length - 1]; if (lastClause) { return spanInNode(lastClause.statements[lastClause.statements.length - 1]); } return undefined; + // Default to parent node default: return spanInNode(node.parent); } } function spanInOpenParenToken(node) { - if (node.parent.kind === 184) { + if (node.parent.kind === 184 /* DoStatement */) { + // Go to while keyword and do action instead return spanInPreviousNode(node); } + // Default to parent node return spanInNode(node.parent); } function spanInCloseParenToken(node) { + // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 162: - case 200: - case 163: - case 134: - case 133: - case 136: - case 137: - case 135: - case 185: - case 184: - case 186: + case 162 /* FunctionExpression */: + case 200 /* FunctionDeclaration */: + case 163 /* ArrowFunction */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 135 /* Constructor */: + case 185 /* WhileStatement */: + case 184 /* DoStatement */: + case 186 /* ForStatement */: return spanInPreviousNode(node); + // Default to parent node default: return spanInNode(node.parent); } + // Default to parent node return spanInNode(node.parent); } function spanInColonToken(node) { - if (ts.isFunctionLike(node.parent) || node.parent.kind === 224) { + // Is this : specifying return annotation of the function declaration + if (ts.isFunctionLike(node.parent) || node.parent.kind === 224 /* PropertyAssignment */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 160) { + if (node.parent.kind === 160 /* TypeAssertionExpression */) { return spanInNode(node.parent.expression); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 184) { + if (node.parent.kind === 184 /* DoStatement */) { + // Set span on while expression return textSpan(node, ts.findNextToken(node.parent.expression, node.parent)); } + // Default to parent node return spanInNode(node.parent); } } @@ -34139,7 +40567,9 @@ var ts; // limitations under the License. // /// +/* @internal */ var debugObjectHost = this; +/* @internal */ var ts; (function (ts) { function logInternalError(logger, err) { @@ -34193,6 +40623,8 @@ var ts; return this.files = JSON.parse(encoded); }; LanguageServiceShimHostAdapter.prototype.getScriptSnapshot = function (fileName) { + // Shim the API changes for 1.5 release. This should be removed once + // TypeScript 1.5 has shipped. if (this.files && this.files.indexOf(fileName) < 0) { return undefined; } @@ -34222,6 +40654,8 @@ var ts; return this.shimHost.getCurrentDirectory(); }; LanguageServiceShimHostAdapter.prototype.getDefaultLibFileName = function (options) { + // Wrap the API changes for 1.5 release. This try/catch + // should be removed once TypeScript 1.5 has shipped. try { return this.shimHost.getDefaultLibFileName(JSON.stringify(options)); } @@ -34271,6 +40705,20 @@ var ts; }; return ShimBase; })(); + function realizeDiagnostics(diagnostics, newLine) { + return diagnostics.map(function (d) { return realizeDiagnostic(d, newLine); }); + } + ts.realizeDiagnostics = realizeDiagnostics; + function realizeDiagnostic(diagnostic, newLine) { + return { + message: ts.flattenDiagnosticMessageText(diagnostic.messageText, newLine), + start: diagnostic.start, + length: diagnostic.length, + /// TODO: no need for the tolowerCase call + category: ts.DiagnosticCategory[diagnostic.category].toLowerCase(), + code: diagnostic.code + }; + } var LanguageServiceShimObject = (function (_super) { __extends(LanguageServiceShimObject, _super); function LanguageServiceShimObject(factory, host, languageService) { @@ -34282,10 +40730,16 @@ var ts; LanguageServiceShimObject.prototype.forwardJSONCall = function (actionDescription, action) { return forwardJSONCall(this.logger, actionDescription, action); }; + /// DISPOSE + /** + * Ensure (almost) deterministic release of internal Javascript resources when + * some external native objects holds onto us (e.g. Com/Interop). + */ LanguageServiceShimObject.prototype.dispose = function (dummy) { this.logger.log("dispose()"); this.languageService.dispose(); this.languageService = null; + // force a GC if (debugObjectHost && debugObjectHost.CollectGarbage) { debugObjectHost.CollectGarbage(); this.logger.log("CollectGarbage()"); @@ -34293,6 +40747,10 @@ var ts; this.logger = null; _super.prototype.dispose.call(this, dummy); }; + /// REFRESH + /** + * Update the list of scripts known to the compiler + */ LanguageServiceShimObject.prototype.refresh = function (throwOnError) { this.forwardJSONCall("refresh(" + throwOnError + ")", function () { return null; @@ -34306,18 +40764,8 @@ var ts; }); }; LanguageServiceShimObject.prototype.realizeDiagnostics = function (diagnostics) { - var _this = this; var newLine = this.getNewLine(); - return diagnostics.map(function (d) { return _this.realizeDiagnostic(d, newLine); }); - }; - LanguageServiceShimObject.prototype.realizeDiagnostic = function (diagnostic, newLine) { - return { - message: ts.flattenDiagnosticMessageText(diagnostic.messageText, newLine), - start: diagnostic.start, - length: diagnostic.length, - category: ts.DiagnosticCategory[diagnostic.category].toLowerCase(), - code: diagnostic.code - }; + return ts.realizeDiagnostics(diagnostics, newLine); }; LanguageServiceShimObject.prototype.getSyntacticClassifications = function (fileName, start, length) { var _this = this; @@ -34357,6 +40805,11 @@ var ts; return _this.realizeDiagnostics(diagnostics); }); }; + /// QUICKINFO + /** + * Computes a string representation of the type at the requested position + * in the active file. + */ LanguageServiceShimObject.prototype.getQuickInfoAtPosition = function (fileName, position) { var _this = this; return this.forwardJSONCall("getQuickInfoAtPosition('" + fileName + "', " + position + ")", function () { @@ -34364,6 +40817,11 @@ var ts; return quickInfo; }); }; + /// NAMEORDOTTEDNAMESPAN + /** + * Computes span information of the name or dotted name at the requested position + * in the active file. + */ LanguageServiceShimObject.prototype.getNameOrDottedNameSpan = function (fileName, startPos, endPos) { var _this = this; return this.forwardJSONCall("getNameOrDottedNameSpan('" + fileName + "', " + startPos + ", " + endPos + ")", function () { @@ -34371,6 +40829,10 @@ var ts; return spanInfo; }); }; + /** + * STATEMENTSPAN + * Computes span information of statement at the requested position in the active file. + */ LanguageServiceShimObject.prototype.getBreakpointStatementAtPosition = function (fileName, position) { var _this = this; return this.forwardJSONCall("getBreakpointStatementAtPosition('" + fileName + "', " + position + ")", function () { @@ -34378,6 +40840,7 @@ var ts; return spanInfo; }); }; + /// SIGNATUREHELP LanguageServiceShimObject.prototype.getSignatureHelpItems = function (fileName, position) { var _this = this; return this.forwardJSONCall("getSignatureHelpItems('" + fileName + "', " + position + ")", function () { @@ -34385,6 +40848,11 @@ var ts; return signatureInfo; }); }; + /// GOTO DEFINITION + /** + * Computes the definition location and file for the symbol + * at the requested position. + */ LanguageServiceShimObject.prototype.getDefinitionAtPosition = function (fileName, position) { var _this = this; return this.forwardJSONCall("getDefinitionAtPosition('" + fileName + "', " + position + ")", function () { @@ -34403,6 +40871,7 @@ var ts; return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments); }); }; + /// GET BRACE MATCHING LanguageServiceShimObject.prototype.getBraceMatchingAtPosition = function (fileName, position) { var _this = this; return this.forwardJSONCall("getBraceMatchingAtPosition('" + fileName + "', " + position + ")", function () { @@ -34410,13 +40879,15 @@ var ts; return textRanges; }); }; - LanguageServiceShimObject.prototype.getIndentationAtPosition = function (fileName, position, options) { + /// GET SMART INDENT + LanguageServiceShimObject.prototype.getIndentationAtPosition = function (fileName, position, options /*Services.EditorOptions*/) { var _this = this; return this.forwardJSONCall("getIndentationAtPosition('" + fileName + "', " + position + ")", function () { var localOptions = JSON.parse(options); return _this.languageService.getIndentationAtPosition(fileName, position, localOptions); }); }; + /// GET REFERENCES LanguageServiceShimObject.prototype.getReferencesAtPosition = function (fileName, position) { var _this = this; return this.forwardJSONCall("getReferencesAtPosition('" + fileName + "', " + position + ")", function () { @@ -34435,6 +40906,18 @@ var ts; return _this.languageService.getOccurrencesAtPosition(fileName, position); }); }; + LanguageServiceShimObject.prototype.getDocumentHighlights = function (fileName, position, filesToSearch) { + var _this = this; + return this.forwardJSONCall("getDocumentHighlights('" + fileName + "', " + position + ")", function () { + return _this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch)); + }); + }; + /// COMPLETION LISTS + /** + * Get a string based representation of the completions + * to provide at the given source position and providing a member completion + * list if requested. + */ LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position) { var _this = this; return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ")", function () { @@ -34442,6 +40925,7 @@ var ts; return completion; }); }; + /** Get a string based representation of a completion list entry details */ LanguageServiceShimObject.prototype.getCompletionEntryDetails = function (fileName, position, entryName) { var _this = this; return this.forwardJSONCall("getCompletionEntryDetails('" + fileName + "', " + position + ", " + entryName + ")", function () { @@ -34449,7 +40933,7 @@ var ts; return details; }); }; - LanguageServiceShimObject.prototype.getFormattingEditsForRange = function (fileName, start, end, options) { + LanguageServiceShimObject.prototype.getFormattingEditsForRange = function (fileName, start, end, options /*Services.FormatCodeOptions*/) { var _this = this; return this.forwardJSONCall("getFormattingEditsForRange('" + fileName + "', " + start + ", " + end + ")", function () { var localOptions = JSON.parse(options); @@ -34457,7 +40941,7 @@ var ts; return edits; }); }; - LanguageServiceShimObject.prototype.getFormattingEditsForDocument = function (fileName, options) { + LanguageServiceShimObject.prototype.getFormattingEditsForDocument = function (fileName, options /*Services.FormatCodeOptions*/) { var _this = this; return this.forwardJSONCall("getFormattingEditsForDocument('" + fileName + "')", function () { var localOptions = JSON.parse(options); @@ -34465,7 +40949,7 @@ var ts; return edits; }); }; - LanguageServiceShimObject.prototype.getFormattingEditsAfterKeystroke = function (fileName, position, key, options) { + LanguageServiceShimObject.prototype.getFormattingEditsAfterKeystroke = function (fileName, position, key, options /*Services.FormatCodeOptions*/) { var _this = this; return this.forwardJSONCall("getFormattingEditsAfterKeystroke('" + fileName + "', " + position + ", '" + key + "')", function () { var localOptions = JSON.parse(options); @@ -34473,6 +40957,8 @@ var ts; return edits; }); }; + /// NAVIGATE TO + /** Return a list of symbols that are interesting to navigate to */ LanguageServiceShimObject.prototype.getNavigateToItems = function (searchValue, maxResultCount) { var _this = this; return this.forwardJSONCall("getNavigateToItems('" + searchValue + "', " + maxResultCount + ")", function () { @@ -34501,10 +40987,13 @@ var ts; return items; }); }; + /// Emit LanguageServiceShimObject.prototype.getEmitOutput = function (fileName) { var _this = this; return this.forwardJSONCall("getEmitOutput('" + fileName + "')", function () { var output = _this.languageService.getEmitOutput(fileName); + // Shim the API changes for 1.5 release. This should be removed once + // TypeScript 1.5 has shipped. output.emitOutputStatus = output.emitSkipped ? 1 : 0; return output; }); @@ -34517,6 +41006,7 @@ var ts; _super.call(this, factory); this.classifier = ts.createClassifier(); } + /// COLORIZATION ClassifierShimObject.prototype.getClassificationsForLine = function (text, lexState, classifyKeywordsInGenerics) { var classification = this.classifier.getClassificationsForLine(text, lexState, classifyKeywordsInGenerics); var items = classification.entries; @@ -34576,6 +41066,9 @@ var ts; this._shims = []; this.documentRegistry = ts.createDocumentRegistry(); } + /* + * Returns script API version. + */ TypeScriptServicesFactory.prototype.getServicesVersion = function () { return ts.servicesVersion; }; @@ -34609,6 +41102,7 @@ var ts; } }; TypeScriptServicesFactory.prototype.close = function () { + // Forget all the registered shims this._shims = []; this.documentRegistry = ts.createDocumentRegistry(); }; @@ -34631,6 +41125,8 @@ var ts; module.exports = ts; } })(ts || (ts = {})); +/// TODO: this is used by VS, clean this up on both sides of the interface +/* @internal */ var TypeScript; (function (TypeScript) { var Services; @@ -34638,4 +41134,5 @@ var TypeScript; Services.TypeScriptServicesFactory = ts.TypeScriptServicesFactory; })(Services = TypeScript.Services || (TypeScript.Services = {})); })(TypeScript || (TypeScript = {})); +/* @internal */ var toolsVersion = "1.4"; diff --git a/bin/typescriptServices.d.ts b/bin/typescriptServices.d.ts index 972a63a67bf..e6d06765c27 100644 --- a/bin/typescriptServices.d.ts +++ b/bin/typescriptServices.d.ts @@ -124,16 +124,16 @@ declare module ts { 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, + ImplementsKeyword = 102, + InterfaceKeyword = 103, + LetKeyword = 104, + PackageKeyword = 105, + PrivateKeyword = 106, + ProtectedKeyword = 107, + PublicKeyword = 108, + StaticKeyword = 109, + YieldKeyword = 110, + AsKeyword = 111, AnyKeyword = 112, BooleanKeyword = 113, ConstructorKeyword = 114, @@ -258,8 +258,8 @@ declare module ts { LastReservedWord = 101, FirstKeyword = 66, LastKeyword = 125, - FirstFutureReservedWord = 103, - LastFutureReservedWord = 111, + FirstFutureReservedWord = 102, + LastFutureReservedWord = 110, FirstTypeNode = 141, LastTypeNode = 149, FirstPunctuation = 14, @@ -295,34 +295,12 @@ declare module ts { 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; @@ -332,6 +310,7 @@ declare module ts { } interface Identifier extends PrimaryExpression { text: string; + originalKeywordKind?: SyntaxKind; } interface QualifiedName extends Node { left: EntityName; @@ -473,7 +452,8 @@ declare module ts { interface ParenthesizedTypeNode extends TypeNode { type: TypeNode; } - interface StringLiteralTypeNode extends LiteralExpression, TypeNode { + interface StringLiteral extends LiteralExpression, TypeNode { + _stringLiteralBrand: any; } interface Expression extends Node { _expressionBrand: any; @@ -539,9 +519,6 @@ declare module ts { isUnterminated?: boolean; hasExtendedUnicodeEscape?: boolean; } - interface StringLiteralExpression extends LiteralExpression { - _stringLiteralExpressionBrand: any; - } interface TemplateExpression extends PrimaryExpression { head: LiteralExpression; templateSpans: NodeArray; @@ -576,7 +553,7 @@ declare module ts { typeArguments?: NodeArray; arguments: NodeArray; } - interface HeritageClauseElement extends Node { + interface HeritageClauseElement extends TypeNode { expression: LeftHandSideExpression; typeArguments?: NodeArray; } @@ -723,7 +700,7 @@ declare module ts { interface ExternalModuleReference extends Node { expression?: Expression; } - interface ImportDeclaration extends Statement, ModuleElement { + interface ImportDeclaration extends ModuleElement { importClause?: ImportClause; moduleSpecifier: Expression; } @@ -751,14 +728,14 @@ declare module ts { type ExportSpecifier = ImportOrExportSpecifier; interface ExportAssignment extends Declaration, ModuleElement { isExportEquals?: boolean; - expression?: Expression; - type?: TypeNode; + expression: Expression; } interface FileReference extends TextRange { fileName: string; } interface CommentRange extends TextRange { hasTrailingNewLine?: boolean; + kind: SyntaxKind; } interface SourceFile extends Declaration { statements: NodeArray; @@ -772,9 +749,7 @@ declare module ts { amdModuleName: string; referencedFiles: FileReference[]; hasNoDefaultLib: boolean; - externalModuleIndicator: Node; languageVersion: ScriptTarget; - identifiers: Map; } interface ScriptReferenceHost { getCompilerOptions(): CompilerOptions; @@ -785,6 +760,9 @@ declare module ts { (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; } interface Program extends ScriptReferenceHost { + /** + * Get a list of files in the program + */ getSourceFiles(): SourceFile[]; /** * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then @@ -801,15 +779,23 @@ declare module ts { getGlobalDiagnostics(): Diagnostic[]; getSemanticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; getDeclarationDiagnostics(sourceFile?: SourceFile): Diagnostic[]; + /** + * Gets a type checker that can be used to semantically analyze source fils in the program. + */ getTypeChecker(): TypeChecker; - getCommonSourceDirectory(): string; } interface SourceMapSpan { + /** Line number in the .js file. */ emittedLine: number; + /** Column number in the .js file. */ emittedColumn: number; + /** Line number in the .ts file. */ sourceLine: number; + /** Column number in the .ts file. */ sourceColumn: number; + /** Optional name (index into names array) associated with this span. */ nameIndex?: number; + /** .ts file (index into sources array) associated with this span */ sourceIndex: number; } interface SourceMapData { @@ -823,6 +809,7 @@ declare module ts { sourceMapMappings: string; sourceMapDecodedMappings: SourceMapSpan[]; } + /** Return code used by getEmitOutput function to indicate status of the function */ enum ExitStatus { Success = 0, DiagnosticsPresent_OutputsSkipped = 1, @@ -831,7 +818,6 @@ declare module ts { interface EmitResult { emitSkipped: boolean; diagnostics: Diagnostic[]; - sourceMaps: SourceMapData[]; } interface TypeCheckerHost { getCompilerOptions(): CompilerOptions; @@ -865,7 +851,7 @@ declare 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[]; } interface SymbolDisplayBuilder { buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; @@ -908,40 +894,6 @@ declare module ts { 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 | Expression, 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, @@ -1011,57 +963,14 @@ declare module ts { 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, @@ -1079,26 +988,16 @@ declare module ts { 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; } @@ -1106,19 +1005,20 @@ declare module ts { } interface InterfaceType extends ObjectType { typeParameters: TypeParameter[]; - baseTypes: ObjectType[]; declaredProperties: Symbol[]; declaredCallSignatures: Signature[]; declaredConstructSignatures: Signature[]; declaredStringIndexType: Type; declaredNumberIndexType: Type; } + interface InterfaceTypeWithBaseTypes extends InterfaceType { + baseTypes: ObjectType[]; + } interface TypeReference extends ObjectType { target: GenericType; typeArguments: Type[]; } interface GenericType extends InterfaceType, TypeReference { - instantiations: Map; } interface TupleType extends ObjectType { elementTypes: Type[]; @@ -1126,20 +1026,9 @@ declare module ts { } 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, @@ -1149,28 +1038,22 @@ declare module ts { 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; } + /** + * A linked list of formatted diagnostic messages to be used as part of a multiline message. + * It is built from the bottom up, leaving the head to be the "main" diagnostic. + * While it seems that DiagnosticMessageChain is structurally similar to DiagnosticMessage, + * the difference is that messages are all preformatted in DMC. + */ interface DiagnosticMessageChain { messageText: string; category: DiagnosticCategory; @@ -1219,6 +1102,7 @@ declare module ts { version?: boolean; watch?: boolean; separateCompilation?: boolean; + emitDecoratorMetadata?: boolean; [option: string]: string | number | boolean; } const enum ModuleKind { @@ -1241,142 +1125,6 @@ declare module ts { 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; } @@ -1400,67 +1148,78 @@ declare module ts { } } declare module ts { - interface ErrorCallback { - (message: DiagnosticMessage, length: number): void; + interface System { + args: string[]; + newLine: string; + useCaseSensitiveFileNames: boolean; + write(s: string): void; + readFile(path: string, encoding?: string): string; + writeFile(path: string, data: string, writeByteOrderMark?: boolean): void; + watchFile?(path: string, callback: (path: string) => void): FileWatcher; + resolvePath(path: string): string; + fileExists(path: string): boolean; + directoryExists(path: string): boolean; + createDirectory(path: string): void; + getExecutingFilePath(): string; + getCurrentDirectory(): string; + readDirectory(path: string, extension?: string): string[]; + getMemoryUsage?(): number; + exit(exitCode?: 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; + interface FileWatcher { + close(): void; } + var sys: System; +} +declare module ts { 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 ts { + function getDefaultLibFileName(options: CompilerOptions): string; + function textSpanEnd(span: TextSpan): number; + function textSpanIsEmpty(span: TextSpan): boolean; + function textSpanContainsPosition(span: TextSpan, position: number): boolean; + function textSpanContainsTextSpan(span: TextSpan, other: TextSpan): boolean; + function textSpanOverlapsWith(span: TextSpan, other: TextSpan): boolean; + function textSpanOverlap(span1: TextSpan, span2: TextSpan): TextSpan; + function textSpanIntersectsWithTextSpan(span: TextSpan, other: TextSpan): boolean; + function textSpanIntersectsWith(span: TextSpan, start: number, length: number): boolean; + function textSpanIntersectsWithPosition(span: TextSpan, position: number): boolean; + function textSpanIntersection(span1: TextSpan, span2: TextSpan): TextSpan; + function createTextSpan(start: number, length: number): TextSpan; + function createTextSpanFromBounds(start: number, end: number): TextSpan; + function textChangeRangeNewSpan(range: TextChangeRange): TextSpan; + function textChangeRangeIsUnchanged(range: TextChangeRange): boolean; + function createTextChangeRange(span: TextSpan, newLength: number): TextChangeRange; + let unchangedTextChangeRange: TextChangeRange; + /** + * Called to merge all the changes that occurred across several versions of a script snapshot + * into a single change. i.e. if a user keeps making successive edits to a script we will + * have a text change from V1 to V2, V2 to V3, ..., Vn. + * + * This function will then merge those changes into a single change range valid between V1 and + * Vn. + */ + function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange; } declare module ts { 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 ts { - function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker; + function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; } declare module ts { /** The version of the TypeScript compiler release */ - let version: string; + const version: string; function findConfigFile(searchPath: string): string; function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; function getPreEmitDiagnostics(program: Program): Diagnostic[]; @@ -1468,6 +1227,7 @@ declare module ts { function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; } declare module ts { + function parseCommandLine(commandLine: string[]): ParsedCommandLine; /** * Read tsconfig.json file * @param fileName The path to the config file @@ -1525,7 +1285,6 @@ declare module ts { getDocumentationComment(): SymbolDisplayPart[]; } interface SourceFile { - getNamedDeclarations(): Declaration[]; getLineAndCharacterOfPosition(pos: number): LineAndCharacter; getLineStarts(): number[]; getPositionOfLineAndCharacter(line: number, character: number): number; @@ -1589,8 +1348,10 @@ declare module ts { 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[]; + getDocumentHighlights(fileName: string, position: number, filesToSearch: string[]): DocumentHighlights[]; + /** @deprecated */ + getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; getNavigationBarItems(fileName: string): NavigationBarItem[]; getOutliningSpans(fileName: string): OutliningSpan[]; @@ -1641,6 +1402,20 @@ declare module ts { fileName: string; isWriteAccess: boolean; } + interface DocumentHighlights { + fileName: string; + highlightSpans: HighlightSpan[]; + } + module HighlightSpanKind { + const none: string; + const definition: string; + const reference: string; + const writtenReference: string; + } + interface HighlightSpan { + textSpan: TextSpan; + kind: string; + } interface NavigateToItem { name: string; kind: string; @@ -1765,6 +1540,7 @@ declare module ts { name: string; kind: string; kindModifiers: string; + sortText: string; } interface CompletionEntryDetails { name: string; @@ -1905,43 +1681,44 @@ declare module ts { */ 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; + module ScriptElementKind { + const unknown: string; + const warning: string; + const keyword: string; + const scriptElement: string; + const moduleElement: string; + const classElement: string; + const interfaceElement: string; + const typeElement: string; + const enumElement: string; + const variableElement: string; + const localVariableElement: string; + const functionElement: string; + const localFunctionElement: string; + const memberFunctionElement: string; + const memberGetAccessorElement: string; + const memberSetAccessorElement: string; + const memberVariableElement: string; + const constructorImplementationElement: string; + const callSignatureElement: string; + const indexSignatureElement: string; + const constructSignatureElement: string; + const parameterElement: string; + const typeParameterElement: string; + const primitiveType: string; + const label: string; + const alias: string; + const constElement: string; + const 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; + module ScriptElementKindModifier { + const none: string; + const publicMemberModifier: string; + const privateMemberModifier: string; + const protectedMemberModifier: string; + const exportedModifier: string; + const ambientModifier: string; + const staticModifier: string; } class ClassificationTypeNames { static comment: string; diff --git a/bin/typescriptServices.js b/bin/typescriptServices.js index 75de01a630e..0165995c56d 100644 --- a/bin/typescriptServices.js +++ b/bin/typescriptServices.js @@ -15,6 +15,7 @@ and limitations under the License. var ts; (function (ts) { + // token > SyntaxKind.Identifer => token is a keyword (function (SyntaxKind) { SyntaxKind[SyntaxKind["Unknown"] = 0] = "Unknown"; SyntaxKind[SyntaxKind["EndOfFileToken"] = 1] = "EndOfFileToken"; @@ -22,14 +23,19 @@ var ts; SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 3] = "MultiLineCommentTrivia"; SyntaxKind[SyntaxKind["NewLineTrivia"] = 4] = "NewLineTrivia"; SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 5] = "WhitespaceTrivia"; + // We detect and provide better error recovery when we encounter a git merge marker. This + // allows us to edit files with git-conflict markers in them in a much more pleasant manner. SyntaxKind[SyntaxKind["ConflictMarkerTrivia"] = 6] = "ConflictMarkerTrivia"; + // Literals SyntaxKind[SyntaxKind["NumericLiteral"] = 7] = "NumericLiteral"; SyntaxKind[SyntaxKind["StringLiteral"] = 8] = "StringLiteral"; SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 9] = "RegularExpressionLiteral"; SyntaxKind[SyntaxKind["NoSubstitutionTemplateLiteral"] = 10] = "NoSubstitutionTemplateLiteral"; + // Pseudo-literals SyntaxKind[SyntaxKind["TemplateHead"] = 11] = "TemplateHead"; SyntaxKind[SyntaxKind["TemplateMiddle"] = 12] = "TemplateMiddle"; SyntaxKind[SyntaxKind["TemplateTail"] = 13] = "TemplateTail"; + // Punctuation SyntaxKind[SyntaxKind["OpenBraceToken"] = 14] = "OpenBraceToken"; SyntaxKind[SyntaxKind["CloseBraceToken"] = 15] = "CloseBraceToken"; SyntaxKind[SyntaxKind["OpenParenToken"] = 16] = "OpenParenToken"; @@ -69,6 +75,7 @@ var ts; SyntaxKind[SyntaxKind["QuestionToken"] = 50] = "QuestionToken"; SyntaxKind[SyntaxKind["ColonToken"] = 51] = "ColonToken"; SyntaxKind[SyntaxKind["AtToken"] = 52] = "AtToken"; + // Assignments SyntaxKind[SyntaxKind["EqualsToken"] = 53] = "EqualsToken"; SyntaxKind[SyntaxKind["PlusEqualsToken"] = 54] = "PlusEqualsToken"; SyntaxKind[SyntaxKind["MinusEqualsToken"] = 55] = "MinusEqualsToken"; @@ -81,7 +88,9 @@ var ts; SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 62] = "AmpersandEqualsToken"; SyntaxKind[SyntaxKind["BarEqualsToken"] = 63] = "BarEqualsToken"; SyntaxKind[SyntaxKind["CaretEqualsToken"] = 64] = "CaretEqualsToken"; + // Identifiers SyntaxKind[SyntaxKind["Identifier"] = 65] = "Identifier"; + // Reserved words SyntaxKind[SyntaxKind["BreakKeyword"] = 66] = "BreakKeyword"; SyntaxKind[SyntaxKind["CaseKeyword"] = 67] = "CaseKeyword"; SyntaxKind[SyntaxKind["CatchKeyword"] = 68] = "CatchKeyword"; @@ -118,16 +127,18 @@ var ts; 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"; + // Strict mode reserved words + 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"; + // Contextual keywords + SyntaxKind[SyntaxKind["AsKeyword"] = 111] = "AsKeyword"; SyntaxKind[SyntaxKind["AnyKeyword"] = 112] = "AnyKeyword"; SyntaxKind[SyntaxKind["BooleanKeyword"] = 113] = "BooleanKeyword"; SyntaxKind[SyntaxKind["ConstructorKeyword"] = 114] = "ConstructorKeyword"; @@ -142,11 +153,15 @@ var ts; SyntaxKind[SyntaxKind["TypeKeyword"] = 123] = "TypeKeyword"; SyntaxKind[SyntaxKind["FromKeyword"] = 124] = "FromKeyword"; SyntaxKind[SyntaxKind["OfKeyword"] = 125] = "OfKeyword"; + // Parse tree nodes + // Names SyntaxKind[SyntaxKind["QualifiedName"] = 126] = "QualifiedName"; SyntaxKind[SyntaxKind["ComputedPropertyName"] = 127] = "ComputedPropertyName"; + // Signature elements SyntaxKind[SyntaxKind["TypeParameter"] = 128] = "TypeParameter"; SyntaxKind[SyntaxKind["Parameter"] = 129] = "Parameter"; SyntaxKind[SyntaxKind["Decorator"] = 130] = "Decorator"; + // TypeMember SyntaxKind[SyntaxKind["PropertySignature"] = 131] = "PropertySignature"; SyntaxKind[SyntaxKind["PropertyDeclaration"] = 132] = "PropertyDeclaration"; SyntaxKind[SyntaxKind["MethodSignature"] = 133] = "MethodSignature"; @@ -157,6 +172,7 @@ var ts; SyntaxKind[SyntaxKind["CallSignature"] = 138] = "CallSignature"; SyntaxKind[SyntaxKind["ConstructSignature"] = 139] = "ConstructSignature"; SyntaxKind[SyntaxKind["IndexSignature"] = 140] = "IndexSignature"; + // Type SyntaxKind[SyntaxKind["TypeReference"] = 141] = "TypeReference"; SyntaxKind[SyntaxKind["FunctionType"] = 142] = "FunctionType"; SyntaxKind[SyntaxKind["ConstructorType"] = 143] = "ConstructorType"; @@ -166,9 +182,11 @@ var ts; SyntaxKind[SyntaxKind["TupleType"] = 147] = "TupleType"; SyntaxKind[SyntaxKind["UnionType"] = 148] = "UnionType"; SyntaxKind[SyntaxKind["ParenthesizedType"] = 149] = "ParenthesizedType"; + // Binding patterns SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 150] = "ObjectBindingPattern"; SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 151] = "ArrayBindingPattern"; SyntaxKind[SyntaxKind["BindingElement"] = 152] = "BindingElement"; + // Expression SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 153] = "ArrayLiteralExpression"; SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 154] = "ObjectLiteralExpression"; SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 155] = "PropertyAccessExpression"; @@ -192,9 +210,11 @@ var ts; SyntaxKind[SyntaxKind["SpreadElementExpression"] = 173] = "SpreadElementExpression"; SyntaxKind[SyntaxKind["ClassExpression"] = 174] = "ClassExpression"; SyntaxKind[SyntaxKind["OmittedExpression"] = 175] = "OmittedExpression"; + // Misc SyntaxKind[SyntaxKind["TemplateSpan"] = 176] = "TemplateSpan"; SyntaxKind[SyntaxKind["HeritageClauseElement"] = 177] = "HeritageClauseElement"; SyntaxKind[SyntaxKind["SemicolonClassElement"] = 178] = "SemicolonClassElement"; + // Element SyntaxKind[SyntaxKind["Block"] = 179] = "Block"; SyntaxKind[SyntaxKind["VariableStatement"] = 180] = "VariableStatement"; SyntaxKind[SyntaxKind["EmptyStatement"] = 181] = "EmptyStatement"; @@ -235,25 +255,33 @@ var ts; SyntaxKind[SyntaxKind["NamedExports"] = 216] = "NamedExports"; SyntaxKind[SyntaxKind["ExportSpecifier"] = 217] = "ExportSpecifier"; SyntaxKind[SyntaxKind["MissingDeclaration"] = 218] = "MissingDeclaration"; + // Module references SyntaxKind[SyntaxKind["ExternalModuleReference"] = 219] = "ExternalModuleReference"; + // Clauses SyntaxKind[SyntaxKind["CaseClause"] = 220] = "CaseClause"; SyntaxKind[SyntaxKind["DefaultClause"] = 221] = "DefaultClause"; SyntaxKind[SyntaxKind["HeritageClause"] = 222] = "HeritageClause"; SyntaxKind[SyntaxKind["CatchClause"] = 223] = "CatchClause"; + // Property assignments SyntaxKind[SyntaxKind["PropertyAssignment"] = 224] = "PropertyAssignment"; SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 225] = "ShorthandPropertyAssignment"; + // Enum SyntaxKind[SyntaxKind["EnumMember"] = 226] = "EnumMember"; + // Top-level nodes SyntaxKind[SyntaxKind["SourceFile"] = 227] = "SourceFile"; + // Synthesized list SyntaxKind[SyntaxKind["SyntaxList"] = 228] = "SyntaxList"; + // Enum value count SyntaxKind[SyntaxKind["Count"] = 229] = "Count"; + // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 53] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 64] = "LastAssignment"; SyntaxKind[SyntaxKind["FirstReservedWord"] = 66] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 101] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 66] = "FirstKeyword"; SyntaxKind[SyntaxKind["LastKeyword"] = 125] = "LastKeyword"; - SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 103] = "FirstFutureReservedWord"; - SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 111] = "LastFutureReservedWord"; + SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 102] = "FirstFutureReservedWord"; + SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 110] = "LastFutureReservedWord"; SyntaxKind[SyntaxKind["FirstTypeNode"] = 141] = "FirstTypeNode"; SyntaxKind[SyntaxKind["LastTypeNode"] = 149] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 14] = "FirstPunctuation"; @@ -291,27 +319,49 @@ var ts; NodeFlags[NodeFlags["BlockScoped"] = 12288] = "BlockScoped"; })(ts.NodeFlags || (ts.NodeFlags = {})); var NodeFlags = ts.NodeFlags; + /* @internal */ (function (ParserContextFlags) { + // Set if this node was parsed in strict mode. Used for grammar error checks, as well as + // checking if the node can be reused in incremental settings. ParserContextFlags[ParserContextFlags["StrictMode"] = 1] = "StrictMode"; + // If this node was parsed in a context where 'in-expressions' are not allowed. ParserContextFlags[ParserContextFlags["DisallowIn"] = 2] = "DisallowIn"; + // If this node was parsed in the 'yield' context created when parsing a generator. ParserContextFlags[ParserContextFlags["Yield"] = 4] = "Yield"; + // If this node was parsed in the parameters of a generator. ParserContextFlags[ParserContextFlags["GeneratorParameter"] = 8] = "GeneratorParameter"; + // If this node was parsed as part of a decorator ParserContextFlags[ParserContextFlags["Decorator"] = 16] = "Decorator"; + // If the parser encountered an error when parsing the code that created this node. Note + // the parser only sets this directly on the node it creates right after encountering the + // error. ParserContextFlags[ParserContextFlags["ThisNodeHasError"] = 32] = "ThisNodeHasError"; + // Context flags set directly by the parser. ParserContextFlags[ParserContextFlags["ParserGeneratedFlags"] = 63] = "ParserGeneratedFlags"; + // Context flags computed by aggregating child flags upwards. + // Used during incremental parsing to determine if this node or any of its children had an + // error. Computed only once and then cached. ParserContextFlags[ParserContextFlags["ThisNodeOrAnySubNodesHasError"] = 64] = "ThisNodeOrAnySubNodesHasError"; + // Used to know if we've computed data from children and cached it in this node. ParserContextFlags[ParserContextFlags["HasAggregatedChildData"] = 128] = "HasAggregatedChildData"; })(ts.ParserContextFlags || (ts.ParserContextFlags = {})); var ParserContextFlags = ts.ParserContextFlags; + /* @internal */ (function (RelationComparisonResult) { RelationComparisonResult[RelationComparisonResult["Succeeded"] = 1] = "Succeeded"; RelationComparisonResult[RelationComparisonResult["Failed"] = 2] = "Failed"; RelationComparisonResult[RelationComparisonResult["FailedAndReported"] = 3] = "FailedAndReported"; })(ts.RelationComparisonResult || (ts.RelationComparisonResult = {})); var RelationComparisonResult = ts.RelationComparisonResult; + /** Return code used by getEmitOutput function to indicate status of the function */ (function (ExitStatus) { + // Compiler ran successfully. Either this was a simple do-nothing compilation (for example, + // when -version or -help was provided, or this was a normal compilation, no diagnostics + // were produced, and all outputs were generated successfully. ExitStatus[ExitStatus["Success"] = 0] = "Success"; + // Diagnostics were produced and because of them no code was generated. ExitStatus[ExitStatus["DiagnosticsPresent_OutputsSkipped"] = 1] = "DiagnosticsPresent_OutputsSkipped"; + // Diagnostics were produced and outputs were generated in spite of them. ExitStatus[ExitStatus["DiagnosticsPresent_OutputsGenerated"] = 2] = "DiagnosticsPresent_OutputsGenerated"; })(ts.ExitStatus || (ts.ExitStatus = {})); var ExitStatus = ts.ExitStatus; @@ -329,10 +379,18 @@ var ts; var TypeFormatFlags = ts.TypeFormatFlags; (function (SymbolFormatFlags) { SymbolFormatFlags[SymbolFormatFlags["None"] = 0] = "None"; + // Write symbols's type argument if it is instantiated symbol + // eg. class C { p: T } <-- Show p as C.p here + // var a: C; + // var p = a.p; <--- Here p is property of C so show it as C.p instead of just C.p SymbolFormatFlags[SymbolFormatFlags["WriteTypeParametersOrArguments"] = 1] = "WriteTypeParametersOrArguments"; + // Use only external alias information to get the symbol name in the given context + // eg. module m { export class c { } } import x = m.c; + // When this flag is specified m.c will be used to refer to the class instead of alias symbol x SymbolFormatFlags[SymbolFormatFlags["UseOnlyExternalAliasing"] = 2] = "UseOnlyExternalAliasing"; })(ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {})); var SymbolFormatFlags = ts.SymbolFormatFlags; + /* @internal */ (function (SymbolAccessibility) { SymbolAccessibility[SymbolAccessibility["Accessible"] = 0] = "Accessible"; SymbolAccessibility[SymbolAccessibility["NotAccessible"] = 1] = "NotAccessible"; @@ -378,7 +436,11 @@ var ts; SymbolFlags[SymbolFlags["Namespace"] = 1536] = "Namespace"; SymbolFlags[SymbolFlags["Module"] = 1536] = "Module"; SymbolFlags[SymbolFlags["Accessor"] = 98304] = "Accessor"; + // Variables can be redeclared, but can not redeclare a block-scoped declaration with the + // same name, or any other value that is not a variable, e.g. ValueModule or Class SymbolFlags[SymbolFlags["FunctionScopedVariableExcludes"] = 107454] = "FunctionScopedVariableExcludes"; + // Block-scoped declarations are not allowed to be re-declared + // they can not merge with anything in the value space SymbolFlags[SymbolFlags["BlockScopedVariableExcludes"] = 107455] = "BlockScopedVariableExcludes"; SymbolFlags[SymbolFlags["ParameterExcludes"] = 107455] = "ParameterExcludes"; SymbolFlags[SymbolFlags["PropertyExcludes"] = 107455] = "PropertyExcludes"; @@ -406,6 +468,7 @@ var ts; SymbolFlags[SymbolFlags["Export"] = 7340032] = "Export"; })(ts.SymbolFlags || (ts.SymbolFlags = {})); var SymbolFlags = ts.SymbolFlags; + /* @internal */ (function (NodeCheckFlags) { NodeCheckFlags[NodeCheckFlags["TypeChecked"] = 1] = "TypeChecked"; NodeCheckFlags[NodeCheckFlags["LexicalThis"] = 2] = "LexicalThis"; @@ -414,9 +477,12 @@ var ts; NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 16] = "SuperInstance"; NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 32] = "SuperStatic"; NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 64] = "ContextChecked"; + // Values for enum members have been computed, and any errors have been reported for them. NodeCheckFlags[NodeCheckFlags["EnumValuesComputed"] = 128] = "EnumValuesComputed"; NodeCheckFlags[NodeCheckFlags["BlockScopedBindingInLoop"] = 256] = "BlockScopedBindingInLoop"; NodeCheckFlags[NodeCheckFlags["EmitDecorate"] = 512] = "EmitDecorate"; + NodeCheckFlags[NodeCheckFlags["EmitParam"] = 1024] = "EmitParam"; + NodeCheckFlags[NodeCheckFlags["LexicalModuleMergesWithClass"] = 2048] = "LexicalModuleMergesWithClass"; })(ts.NodeCheckFlags || (ts.NodeCheckFlags = {})); var NodeCheckFlags = ts.NodeCheckFlags; (function (TypeFlags) { @@ -436,16 +502,22 @@ var ts; TypeFlags[TypeFlags["Tuple"] = 8192] = "Tuple"; TypeFlags[TypeFlags["Union"] = 16384] = "Union"; TypeFlags[TypeFlags["Anonymous"] = 32768] = "Anonymous"; + /* @internal */ TypeFlags[TypeFlags["FromSignature"] = 65536] = "FromSignature"; TypeFlags[TypeFlags["ObjectLiteral"] = 131072] = "ObjectLiteral"; + /* @internal */ TypeFlags[TypeFlags["ContainsUndefinedOrNull"] = 262144] = "ContainsUndefinedOrNull"; + /* @internal */ TypeFlags[TypeFlags["ContainsObjectLiteral"] = 524288] = "ContainsObjectLiteral"; TypeFlags[TypeFlags["ESSymbol"] = 1048576] = "ESSymbol"; + /* @internal */ TypeFlags[TypeFlags["Intrinsic"] = 1048703] = "Intrinsic"; + /* @internal */ TypeFlags[TypeFlags["Primitive"] = 1049086] = "Primitive"; TypeFlags[TypeFlags["StringLike"] = 258] = "StringLike"; TypeFlags[TypeFlags["NumberLike"] = 132] = "NumberLike"; TypeFlags[TypeFlags["ObjectType"] = 48128] = "ObjectType"; + /* @internal */ TypeFlags[TypeFlags["RequiresWidening"] = 786432] = "RequiresWidening"; })(ts.TypeFlags || (ts.TypeFlags = {})); var TypeFlags = ts.TypeFlags; @@ -478,6 +550,7 @@ var ts; ScriptTarget[ScriptTarget["Latest"] = 2] = "Latest"; })(ts.ScriptTarget || (ts.ScriptTarget = {})); var ScriptTarget = ts.ScriptTarget; + /* @internal */ (function (CharacterCodes) { CharacterCodes[CharacterCodes["nullCharacter"] = 0] = "nullCharacter"; CharacterCodes[CharacterCodes["maxAsciiCharacter"] = 127] = "maxAsciiCharacter"; @@ -486,6 +559,7 @@ var ts; CharacterCodes[CharacterCodes["lineSeparator"] = 8232] = "lineSeparator"; CharacterCodes[CharacterCodes["paragraphSeparator"] = 8233] = "paragraphSeparator"; CharacterCodes[CharacterCodes["nextLine"] = 133] = "nextLine"; + // Unicode 3.0 space characters CharacterCodes[CharacterCodes["space"] = 32] = "space"; CharacterCodes[CharacterCodes["nonBreakingSpace"] = 160] = "nonBreakingSpace"; CharacterCodes[CharacterCodes["enQuad"] = 8192] = "enQuad"; @@ -607,8 +681,16 @@ var ts; var CharacterCodes = ts.CharacterCodes; })(ts || (ts = {})); /// +/* @internal */ var ts; (function (ts) { + // Ternary values are defined such that + // x & y is False if either x or y is False. + // x & y is Maybe if either x or y is Maybe, but neither x or y is False. + // x & y is True if both x and y are True. + // x | y is False if both x and y are False. + // x | y is Maybe if either x or y is Maybe, but neither x or y is True. + // x | y is True if either x or y is True. (function (Ternary) { Ternary[Ternary["False"] = 0] = "False"; Ternary[Ternary["Maybe"] = 1] = "Maybe"; @@ -674,9 +756,9 @@ var ts; if (array) { result = []; for (var _i = 0; _i < array.length; _i++) { - var item_1 = array[_i]; - if (f(item_1)) { - result.push(item_1); + var item = array[_i]; + if (f(item)) { + result.push(item); } } } @@ -708,9 +790,9 @@ var ts; if (array) { result = []; for (var _i = 0; _i < array.length; _i++) { - var item_2 = array[_i]; - if (!contains(result, item_2)) { - result.push(item_2); + var item = array[_i]; + if (!contains(result, item)) { + result.push(item); } } } @@ -735,6 +817,9 @@ var ts; } } ts.addRange = addRange; + /** + * Returns the last element of an array if non-empty, undefined otherwise. + */ function lastOrUndefined(array) { if (array.length === 0) { return undefined; @@ -857,6 +942,16 @@ var ts; } } ts.copyMap = copyMap; + /** + * Creates a map from the elements of an array. + * + * @param array the array of input elements. + * @param makeKey a function that produces a key for a given element. + * + * This function makes no effort to avoid collisions; if any two elements produce + * the same key with the given 'makeKey' function, then the element with the higher + * index in the array will be the one associated with the produced key. + */ function arrayToMap(array, makeKey) { var result = {}; forEach(array, function (value) { @@ -932,12 +1027,12 @@ var ts; ts.concatenateDiagnosticMessageChains = concatenateDiagnosticMessageChains; function compareValues(a, b) { if (a === b) - return 0; + return 0 /* EqualTo */; if (a === undefined) - return -1; + return -1 /* LessThan */; if (b === undefined) - return 1; - return a < b ? -1 : 1; + return 1 /* GreaterThan */; + return a < b ? -1 /* LessThan */ : 1 /* GreaterThan */; } ts.compareValues = compareValues; function getDiagnosticFileName(diagnostic) { @@ -949,11 +1044,12 @@ var ts; compareValues(d1.length, d2.length) || compareValues(d1.code, d2.code) || compareMessageText(d1.messageText, d2.messageText) || - 0; + 0 /* EqualTo */; } ts.compareDiagnostics = compareDiagnostics; function compareMessageText(text1, text2) { while (text1 && text2) { + // We still have both chains. var string1 = typeof text1 === "string" ? text1 : text1.messageText; var string2 = typeof text2 === "string" ? text2 : text2.messageText; var res = compareValues(string1, string2); @@ -964,9 +1060,11 @@ var ts; text2 = typeof text2 === "string" ? undefined : text2.next; } if (!text1 && !text2) { - return 0; + // if the chains are done, then these messages are the same. + return 0 /* EqualTo */; } - return text1 ? 1 : -1; + // We still have one chain remaining. The shorter chain should come first. + return text1 ? 1 /* GreaterThan */ : -1 /* LessThan */; } function sortAndDeduplicateDiagnostics(diagnostics) { return deduplicateSortedDiagnostics(diagnostics.sort(compareDiagnostics)); @@ -980,7 +1078,7 @@ var ts; var previousDiagnostic = diagnostics[0]; for (var i = 1; i < diagnostics.length; i++) { var currentDiagnostic = diagnostics[i]; - var isDupe = compareDiagnostics(currentDiagnostic, previousDiagnostic) === 0; + var isDupe = compareDiagnostics(currentDiagnostic, previousDiagnostic) === 0 /* EqualTo */; if (!isDupe) { newDiagnostics.push(currentDiagnostic); previousDiagnostic = currentDiagnostic; @@ -993,9 +1091,10 @@ var ts; return path.replace(/\\/g, "/"); } ts.normalizeSlashes = normalizeSlashes; + // Returns length of path root (i.e. length of "/", "x:/", "//server/share/, file:///user/files") function getRootLength(path) { - if (path.charCodeAt(0) === 47) { - if (path.charCodeAt(1) !== 47) + if (path.charCodeAt(0) === 47 /* slash */) { + if (path.charCodeAt(1) !== 47 /* slash */) return 1; var p1 = path.indexOf("/", 2); if (p1 < 0) @@ -1005,11 +1104,14 @@ var ts; return p1 + 1; return p2 + 1; } - if (path.charCodeAt(1) === 58) { - if (path.charCodeAt(2) === 47) + if (path.charCodeAt(1) === 58 /* colon */) { + if (path.charCodeAt(2) === 47 /* slash */) return 3; return 2; } + var idx = path.indexOf('://'); + if (idx !== -1) + return idx + 3; return 0; } ts.getRootLength = getRootLength; @@ -1024,6 +1126,8 @@ var ts; normalized.pop(); } else { + // A part may be an empty string (which is 'falsy') if the path had consecutive slashes, + // e.g. "path//file.ts". Drop these before re-joining the parts. if (part) { normalized.push(part); } @@ -1059,6 +1163,7 @@ var ts; path = normalizeSlashes(path); var rootLength = getRootLength(path); if (rootLength == 0) { + // If the path is not rooted it is relative to current directory path = combinePaths(normalizeSlashes(currentDirectory), path); rootLength = getRootLength(path); } @@ -1080,24 +1185,36 @@ var ts; // In this example the root is: http://www.website.com/ // normalized path components should be ["http://www.website.com/", "folder1", "folder2"] var urlLength = url.length; + // Initial root length is http:// part var rootLength = url.indexOf("://") + "://".length; while (rootLength < urlLength) { - if (url.charCodeAt(rootLength) === 47) { + // Consume all immediate slashes in the protocol + // eg.initial rootlength is just file:// but it needs to consume another "/" in file:/// + if (url.charCodeAt(rootLength) === 47 /* slash */) { rootLength++; } else { + // non slash character means we continue proceeding to next component of root search break; } } + // there are no parts after http:// just return current string as the pathComponent if (rootLength === urlLength) { return [url]; } + // Find the index of "/" after website.com so the root can be http://www.website.com/ (from existing http://) var indexOfNextSlash = url.indexOf(ts.directorySeparator, rootLength); if (indexOfNextSlash !== -1) { + // Found the "/" after the website.com so the root is length of http://www.website.com/ + // and get components afetr the root normally like any other folder components rootLength = indexOfNextSlash + 1; return normalizedPathComponents(url, rootLength); } else { + // Can't find the host assume the rest of the string as component + // but make sure we append "/" to it as root is not joined using "/" + // eg. if url passed in was http://website.com we want to use root as [http://website.com/] + // so that other path manipulations will be correct and it can be merged with relative paths correctly return [url + ts.directorySeparator]; } } @@ -1113,13 +1230,17 @@ var ts; var pathComponents = getNormalizedPathOrUrlComponents(relativeOrAbsolutePath, currentDirectory); var directoryComponents = getNormalizedPathOrUrlComponents(directoryPathOrUrl, currentDirectory); if (directoryComponents.length > 1 && directoryComponents[directoryComponents.length - 1] === "") { + // If the directory path given was of type test/cases/ then we really need components of directory to be only till its name + // that is ["test", "cases", ""] needs to be actually ["test", "cases"] directoryComponents.length--; } + // Find the component that differs for (var joinStartIndex = 0; joinStartIndex < pathComponents.length && joinStartIndex < directoryComponents.length; joinStartIndex++) { if (getCanonicalFileName(directoryComponents[joinStartIndex]) !== getCanonicalFileName(pathComponents[joinStartIndex])) { break; } } + // Get the relative path if (joinStartIndex) { var relativePath = ""; var relativePathComponents = pathComponents.slice(joinStartIndex, pathComponents.length); @@ -1130,6 +1251,7 @@ var ts; } return relativePath + relativePathComponents.join(ts.directorySeparator); } + // Cant find the relative path, get the absolute path var absolutePath = getNormalizedPathFromPathComponents(pathComponents); if (isAbsolutePathAnUrl && isRootedDiskPath(absolutePath)) { absolutePath = "file:///" + absolutePath; @@ -1185,12 +1307,8 @@ var ts; "\"": "\\\"", "\u2028": "\\u2028", "\u2029": "\\u2029", - "\u0085": "\\u0085" + "\u0085": "\\u0085" // nextLine }; - function getDefaultLibFileName(options) { - return options.target === 2 ? "lib.es6.d.ts" : "lib.d.ts"; - } - ts.getDefaultLibFileName = getDefaultLibFileName; function Symbol(flags, name) { this.flags = flags; this.name = name; @@ -1227,7 +1345,7 @@ var ts; var AssertionLevel = ts.AssertionLevel; var Debug; (function (Debug) { - var currentAssertionLevel = 0; + var currentAssertionLevel = 0 /* None */; function shouldAssert(level) { return currentAssertionLevel >= level; } @@ -1255,9 +1373,9 @@ var ts; function getWScriptSystem() { var fso = new ActiveXObject("Scripting.FileSystemObject"); var fileStream = new ActiveXObject("ADODB.Stream"); - fileStream.Type = 2; + fileStream.Type = 2 /*text*/; var binaryStream = new ActiveXObject("ADODB.Stream"); - binaryStream.Type = 1; + binaryStream.Type = 1 /*binary*/; var args = []; for (var i = 0; i < WScript.Arguments.length; i++) { args[i] = WScript.Arguments.Item(i); @@ -1273,12 +1391,16 @@ var ts; fileStream.LoadFromFile(fileName); } else { + // Load file and read the first two bytes into a string with no interpretation fileStream.Charset = "x-ansi"; fileStream.LoadFromFile(fileName); var bom = fileStream.ReadText(2) || ""; + // Position must be at 0 before encoding can be changed fileStream.Position = 0; + // [0xFF,0xFE] and [0xFE,0xFF] mean utf-16 (little or big endian), otherwise default to utf-8 fileStream.Charset = bom.length >= 2 && (bom.charCodeAt(0) === 0xFF && bom.charCodeAt(1) === 0xFE || bom.charCodeAt(0) === 0xFE && bom.charCodeAt(1) === 0xFF) ? "unicode" : "utf-8"; } + // ReadText method always strips byte order mark from resulting string return fileStream.ReadText(); } catch (e) { @@ -1292,8 +1414,11 @@ var ts; fileStream.Open(); binaryStream.Open(); try { + // Write characters in UTF-8 encoding fileStream.Charset = "utf-8"; fileStream.WriteText(data); + // If we don't want the BOM, then skip it by setting the starting location to 3 (size of BOM). + // If not, start from position 0, as the BOM will be added automatically when charset==utf8. if (writeByteOrderMark) { fileStream.Position = 0; } @@ -1301,7 +1426,7 @@ var ts; fileStream.Position = 3; } fileStream.CopyTo(binaryStream); - binaryStream.SaveToFile(fileName, 2); + binaryStream.SaveToFile(fileName, 2 /*overwrite*/); } finally { binaryStream.Close(); @@ -1379,6 +1504,7 @@ var ts; var _path = require("path"); var _os = require('os'); var platform = _os.platform(); + // win32\win64 are case insensitive platforms, MacOS (darwin) by default is also case insensitive var useCaseSensitiveFileNames = platform !== "win32" && platform !== "win64" && platform !== "darwin"; function readFile(fileName, encoding) { if (!_fs.existsSync(fileName)) { @@ -1387,6 +1513,8 @@ var ts; var buffer = _fs.readFileSync(fileName); var len = buffer.length; if (len >= 2 && buffer[0] === 0xFE && buffer[1] === 0xFF) { + // Big endian UTF-16 byte order mark detected. Since big endian is not supported by node.js, + // flip all byte pairs and treat as little endian. len &= ~1; for (var i = 0; i < len; i += 2) { var temp = buffer[i]; @@ -1396,14 +1524,18 @@ var ts; return buffer.toString("utf16le", 2); } if (len >= 2 && buffer[0] === 0xFF && buffer[1] === 0xFE) { + // Little endian UTF-16 byte order mark detected return buffer.toString("utf16le", 2); } if (len >= 3 && buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) { + // UTF-8 byte order mark detected return buffer.toString("utf8", 3); } + // Default is UTF-8 with no byte order mark return buffer.toString("utf8"); } function writeFile(fileName, data, writeByteOrderMark) { + // If a BOM is required, emit one if (writeByteOrderMark) { data = '\uFEFF' + data; } @@ -1440,11 +1572,13 @@ var ts; newLine: _os.EOL, useCaseSensitiveFileNames: useCaseSensitiveFileNames, write: function (s) { + // 1 is a standard descriptor for stdout _fs.writeSync(1, s); }, readFile: readFile, writeFile: writeFile, watchFile: function (fileName, callback) { + // watchFile polls a file every 250ms, picking up file notifications. _fs.watchFile(fileName, { persistent: true, interval: 250 }, fileChanged); return { close: function () { _fs.unwatchFile(fileName, fileChanged); } @@ -1496,11 +1630,13 @@ var ts; return getNodeSystem(); } else { - return undefined; + return undefined; // Unsupported host } })(); })(ts || (ts = {})); +// /// +/* @internal */ var ts; (function (ts) { ts.Diagnostics = { @@ -1660,7 +1796,6 @@ var ts; 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." }, @@ -1669,6 +1804,14 @@ var ts; 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." }, + Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: ts.DiagnosticCategory.Error, key: "Invalid use of '{0}'. Class definitions are automatically in strict mode." }, + A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A class declaration without the 'default' modifier must have a name" }, + Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode" }, + Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1213, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, + Identifier_expected_0_is_a_reserved_word_in_strict_mode_External_Module_is_automatically_in_strict_mode: { code: 1214, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. External Module is automatically in strict mode." }, + Type_expected_0_is_a_reserved_word_in_strict_mode: { code: 1215, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode" }, + Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1216, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, + Type_expected_0_is_a_reserved_word_in_strict_mode_Module_is_automatically_in_strict_mode: { code: 1217, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Module is automatically in strict mode." }, 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." }, @@ -1844,19 +1987,20 @@ var ts; 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." }, + Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: ts.DiagnosticCategory.Error, key: "Type must have a '[Symbol.iterator]()' method that returns an iterator." }, + An_iterator_must_have_a_next_method: { code: 2489, category: ts.DiagnosticCategory.Error, key: "An iterator 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." }, + The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression: { code: 2496, category: ts.DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression." }, External_module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct: { code: 2497, category: ts.DiagnosticCategory.Error, key: "External module '{0}' resolves to a non-module entity and cannot be imported using this construct." }, External_module_0_uses_export_and_cannot_be_used_with_export_Asterisk: { code: 2498, category: ts.DiagnosticCategory.Error, key: "External module '{0}' uses 'export =' and cannot be used with 'export *'." }, An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments: { code: 2499, category: ts.DiagnosticCategory.Error, key: "An interface can only extend an identifier/qualified-name with optional type arguments." }, A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments: { code: 2500, category: ts.DiagnosticCategory.Error, key: "A class can only implement an identifier/qualified-name with optional type arguments." }, + A_rest_element_cannot_contain_a_binding_pattern: { code: 2501, category: ts.DiagnosticCategory.Error, key: "A rest element cannot contain a binding pattern." }, 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}'." }, @@ -2007,6 +2151,22 @@ var 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: 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." }, + import_can_only_be_used_in_a_ts_file: { code: 8002, category: ts.DiagnosticCategory.Error, key: "'import ... =' can only be used in a .ts file." }, + export_can_only_be_used_in_a_ts_file: { code: 8003, category: ts.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: ts.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: ts.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: ts.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: ts.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: ts.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: ts.DiagnosticCategory.Error, key: "'{0}' can only be used in a .ts file." }, + types_can_only_be_used_in_a_ts_file: { code: 8010, category: ts.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: ts.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: ts.DiagnosticCategory.Error, key: "'parameter modifiers' can only be used in a .ts file." }, + can_only_be_used_in_a_ts_file: { code: 8013, category: ts.DiagnosticCategory.Error, key: "'?' can only be used in a .ts file." }, + property_declarations_can_only_be_used_in_a_ts_file: { code: 8014, category: ts.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: ts.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: ts.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: ts.DiagnosticCategory.Error, key: "'decorators' can only be used in a .ts file." }, 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." }, @@ -2019,131 +2179,176 @@ var ts; var ts; (function (ts) { var textToToken = { - "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, - ")": 17, - "[": 18, - "]": 19, - ".": 20, - "...": 21, - ";": 22, - ",": 23, - "<": 24, - ">": 25, - "<=": 26, - ">=": 27, - "==": 28, - "!=": 29, - "===": 30, - "!==": 31, - "=>": 32, - "+": 33, - "-": 34, - "*": 35, - "/": 36, - "%": 37, - "++": 38, - "--": 39, - "<<": 40, - ">>": 41, - ">>>": 42, - "&": 43, - "|": 44, - "^": 45, - "!": 46, - "~": 47, - "&&": 48, - "||": 49, - "?": 50, - ":": 51, - "=": 53, - "+=": 54, - "-=": 55, - "*=": 56, - "/=": 57, - "%=": 58, - "<<=": 59, - ">>=": 60, - ">>>=": 61, - "&=": 62, - "|=": 63, - "^=": 64, - "@": 52 + "any": 112 /* AnyKeyword */, + "as": 111 /* AsKeyword */, + "boolean": 113 /* BooleanKeyword */, + "break": 66 /* BreakKeyword */, + "case": 67 /* CaseKeyword */, + "catch": 68 /* CatchKeyword */, + "class": 69 /* ClassKeyword */, + "continue": 71 /* ContinueKeyword */, + "const": 70 /* ConstKeyword */, + "constructor": 114 /* ConstructorKeyword */, + "debugger": 72 /* DebuggerKeyword */, + "declare": 115 /* DeclareKeyword */, + "default": 73 /* DefaultKeyword */, + "delete": 74 /* DeleteKeyword */, + "do": 75 /* DoKeyword */, + "else": 76 /* ElseKeyword */, + "enum": 77 /* EnumKeyword */, + "export": 78 /* ExportKeyword */, + "extends": 79 /* ExtendsKeyword */, + "false": 80 /* FalseKeyword */, + "finally": 81 /* FinallyKeyword */, + "for": 82 /* ForKeyword */, + "from": 124 /* FromKeyword */, + "function": 83 /* FunctionKeyword */, + "get": 116 /* GetKeyword */, + "if": 84 /* IfKeyword */, + "implements": 102 /* ImplementsKeyword */, + "import": 85 /* ImportKeyword */, + "in": 86 /* InKeyword */, + "instanceof": 87 /* InstanceOfKeyword */, + "interface": 103 /* InterfaceKeyword */, + "let": 104 /* LetKeyword */, + "module": 117 /* ModuleKeyword */, + "new": 88 /* NewKeyword */, + "null": 89 /* NullKeyword */, + "number": 119 /* NumberKeyword */, + "package": 105 /* PackageKeyword */, + "private": 106 /* PrivateKeyword */, + "protected": 107 /* ProtectedKeyword */, + "public": 108 /* PublicKeyword */, + "require": 118 /* RequireKeyword */, + "return": 90 /* ReturnKeyword */, + "set": 120 /* SetKeyword */, + "static": 109 /* StaticKeyword */, + "string": 121 /* StringKeyword */, + "super": 91 /* SuperKeyword */, + "switch": 92 /* SwitchKeyword */, + "symbol": 122 /* SymbolKeyword */, + "this": 93 /* ThisKeyword */, + "throw": 94 /* ThrowKeyword */, + "true": 95 /* TrueKeyword */, + "try": 96 /* TryKeyword */, + "type": 123 /* TypeKeyword */, + "typeof": 97 /* TypeOfKeyword */, + "var": 98 /* VarKeyword */, + "void": 99 /* VoidKeyword */, + "while": 100 /* WhileKeyword */, + "with": 101 /* WithKeyword */, + "yield": 110 /* YieldKeyword */, + "of": 125 /* OfKeyword */, + "{": 14 /* OpenBraceToken */, + "}": 15 /* CloseBraceToken */, + "(": 16 /* OpenParenToken */, + ")": 17 /* CloseParenToken */, + "[": 18 /* OpenBracketToken */, + "]": 19 /* CloseBracketToken */, + ".": 20 /* DotToken */, + "...": 21 /* DotDotDotToken */, + ";": 22 /* SemicolonToken */, + ",": 23 /* CommaToken */, + "<": 24 /* LessThanToken */, + ">": 25 /* GreaterThanToken */, + "<=": 26 /* LessThanEqualsToken */, + ">=": 27 /* GreaterThanEqualsToken */, + "==": 28 /* EqualsEqualsToken */, + "!=": 29 /* ExclamationEqualsToken */, + "===": 30 /* EqualsEqualsEqualsToken */, + "!==": 31 /* ExclamationEqualsEqualsToken */, + "=>": 32 /* EqualsGreaterThanToken */, + "+": 33 /* PlusToken */, + "-": 34 /* MinusToken */, + "*": 35 /* AsteriskToken */, + "/": 36 /* SlashToken */, + "%": 37 /* PercentToken */, + "++": 38 /* PlusPlusToken */, + "--": 39 /* MinusMinusToken */, + "<<": 40 /* LessThanLessThanToken */, + ">>": 41 /* GreaterThanGreaterThanToken */, + ">>>": 42 /* GreaterThanGreaterThanGreaterThanToken */, + "&": 43 /* AmpersandToken */, + "|": 44 /* BarToken */, + "^": 45 /* CaretToken */, + "!": 46 /* ExclamationToken */, + "~": 47 /* TildeToken */, + "&&": 48 /* AmpersandAmpersandToken */, + "||": 49 /* BarBarToken */, + "?": 50 /* QuestionToken */, + ":": 51 /* ColonToken */, + "=": 53 /* EqualsToken */, + "+=": 54 /* PlusEqualsToken */, + "-=": 55 /* MinusEqualsToken */, + "*=": 56 /* AsteriskEqualsToken */, + "/=": 57 /* SlashEqualsToken */, + "%=": 58 /* PercentEqualsToken */, + "<<=": 59 /* LessThanLessThanEqualsToken */, + ">>=": 60 /* GreaterThanGreaterThanEqualsToken */, + ">>>=": 61 /* GreaterThanGreaterThanGreaterThanEqualsToken */, + "&=": 62 /* AmpersandEqualsToken */, + "|=": 63 /* BarEqualsToken */, + "^=": 64 /* CaretEqualsToken */, + "@": 52 /* AtToken */ }; + /* + As per ECMAScript Language Specification 3th Edition, Section 7.6: Identifiers + IdentifierStart :: + Can contain Unicode 3.0.0 categories: + Uppercase letter (Lu), + Lowercase letter (Ll), + Titlecase letter (Lt), + Modifier letter (Lm), + Other letter (Lo), or + Letter number (Nl). + IdentifierPart :: = + Can contain IdentifierStart + Unicode 3.0.0 categories: + Non-spacing mark (Mn), + Combining spacing mark (Mc), + Decimal number (Nd), or + Connector punctuation (Pc). + + Codepoint ranges for ES3 Identifiers are extracted from the Unicode 3.0.0 specification at: + http://www.unicode.org/Public/3.0-Update/UnicodeData-3.0.0.txt + */ 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,]; + /* + As per ECMAScript Language Specification 5th Edition, Section 7.6: ISyntaxToken Names and Identifiers + IdentifierStart :: + Can contain Unicode 6.2 categories: + Uppercase letter (Lu), + Lowercase letter (Ll), + Titlecase letter (Lt), + Modifier letter (Lm), + Other letter (Lo), or + Letter number (Nl). + IdentifierPart :: + Can contain IdentifierStart + Unicode 6.2 categories: + Non-spacing mark (Mn), + Combining spacing mark (Mc), + Decimal number (Nd), + Connector punctuation (Pc), + , or + . + + Codepoint ranges for ES5 Identifiers are extracted from the Unicode 6.2 specification at: + http://www.unicode.org/Public/6.2.0/ucd/UnicodeData.txt + */ 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) { + // Bail out quickly if it couldn't possibly be in the map. if (code < map[0]) { return false; } + // Perform binary search in one of the Unicode range maps var lo = 0; var hi = map.length; var mid; while (lo + 1 < hi) { mid = lo + (hi - lo) / 2; + // mid has to be even to catch a range's beginning mid -= mid % 2; if (map[mid] <= code && code <= map[mid + 1]) { return true; @@ -2157,14 +2362,14 @@ var ts; } return false; } - function isUnicodeIdentifierStart(code, languageVersion) { - return languageVersion >= 1 ? + /* @internal */ function isUnicodeIdentifierStart(code, languageVersion) { + return languageVersion >= 1 /* ES5 */ ? lookupInUnicodeMap(code, unicodeES5IdentifierStart) : lookupInUnicodeMap(code, unicodeES3IdentifierStart); } ts.isUnicodeIdentifierStart = isUnicodeIdentifierStart; function isUnicodeIdentifierPart(code, languageVersion) { - return languageVersion >= 1 ? + return languageVersion >= 1 /* ES5 */ ? lookupInUnicodeMap(code, unicodeES5IdentifierPart) : lookupInUnicodeMap(code, unicodeES3IdentifierPart); } @@ -2182,10 +2387,12 @@ var ts; return tokenStrings[t]; } ts.tokenToString = tokenToString; + /* @internal */ function stringToToken(s) { return textToToken[s]; } ts.stringToToken = stringToToken; + /* @internal */ function computeLineStarts(text) { var result = new Array(); var pos = 0; @@ -2193,16 +2400,16 @@ var ts; while (pos < text.length) { var ch = text.charCodeAt(pos++); switch (ch) { - case 13: - if (text.charCodeAt(pos) === 10) { + case 13 /* carriageReturn */: + if (text.charCodeAt(pos) === 10 /* lineFeed */) { pos++; } - case 10: + case 10 /* lineFeed */: result.push(lineStart); lineStart = pos; break; default: - if (ch > 127 && isLineBreak(ch)) { + if (ch > 127 /* maxAsciiCharacter */ && isLineBreak(ch)) { result.push(lineStart); lineStart = pos; } @@ -2217,18 +2424,25 @@ var ts; return computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character); } ts.getPositionOfLineAndCharacter = getPositionOfLineAndCharacter; + /* @internal */ function computePositionOfLineAndCharacter(lineStarts, line, character) { ts.Debug.assert(line >= 0 && line < lineStarts.length); return lineStarts[line] + character; } ts.computePositionOfLineAndCharacter = computePositionOfLineAndCharacter; + /* @internal */ function getLineStarts(sourceFile) { return sourceFile.lineMap || (sourceFile.lineMap = computeLineStarts(sourceFile.text)); } ts.getLineStarts = getLineStarts; + /* @internal */ function computeLineAndCharacterOfPosition(lineStarts, position) { var lineNumber = ts.binarySearch(lineStarts, position); if (lineNumber < 0) { + // If the actual position was not found, + // the binary search returns the negative value of the next line start + // e.g. if the line starts at [5, 10, 23, 80] and the position requested was 20 + // then the search will return -2 lineNumber = ~lineNumber - 1; } return { @@ -2243,18 +2457,20 @@ 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 === 133 || - ch === 5760 || - ch >= 8192 && ch <= 8203 || - ch === 8239 || - ch === 8287 || - ch === 12288 || - ch === 65279; + // Note: nextLine is in the Zs space, and should be considered to be a whitespace. + // It is explicitly not a line-break as it isn't in the exact set specified by EcmaScript. + return ch === 32 /* space */ || + ch === 9 /* tab */ || + ch === 11 /* verticalTab */ || + ch === 12 /* formFeed */ || + ch === 160 /* nonBreakingSpace */ || + ch === 133 /* nextLine */ || + ch === 5760 /* ogham */ || + ch >= 8192 /* enQuad */ && ch <= 8203 /* zeroWidthSpace */ || + ch === 8239 /* narrowNoBreakSpace */ || + ch === 8287 /* mathematicalSpace */ || + ch === 12288 /* ideographicSpace */ || + ch === 65279 /* byteOrderMark */; } ts.isWhiteSpace = isWhiteSpace; function isLineBreak(ch) { @@ -2268,41 +2484,43 @@ var ts; // \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; + return ch === 10 /* lineFeed */ || + ch === 13 /* carriageReturn */ || + ch === 8232 /* lineSeparator */ || + ch === 8233 /* paragraphSeparator */; } ts.isLineBreak = isLineBreak; function isDigit(ch) { - return ch >= 48 && ch <= 57; + return ch >= 48 /* _0 */ && ch <= 57 /* _9 */; } + /* @internal */ function isOctalDigit(ch) { - return ch >= 48 && ch <= 55; + return ch >= 48 /* _0 */ && ch <= 55 /* _7 */; } ts.isOctalDigit = isOctalDigit; + /* @internal */ function skipTrivia(text, pos, stopAfterLineBreak) { while (true) { var ch = text.charCodeAt(pos); switch (ch) { - case 13: - if (text.charCodeAt(pos + 1) === 10) { + case 13 /* carriageReturn */: + if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) { pos++; } - case 10: + case 10 /* lineFeed */: pos++; if (stopAfterLineBreak) { return pos; } continue; - case 9: - case 11: - case 12: - case 32: + case 9 /* tab */: + case 11 /* verticalTab */: + case 12 /* formFeed */: + case 32 /* space */: pos++; continue; - case 47: - if (text.charCodeAt(pos + 1) === 47) { + case 47 /* slash */: + if (text.charCodeAt(pos + 1) === 47 /* slash */) { pos += 2; while (pos < text.length) { if (isLineBreak(text.charCodeAt(pos))) { @@ -2312,10 +2530,10 @@ var ts; } continue; } - if (text.charCodeAt(pos + 1) === 42) { + if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { pos += 2; while (pos < text.length) { - if (text.charCodeAt(pos) === 42 && text.charCodeAt(pos + 1) === 47) { + if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { pos += 2; break; } @@ -2324,16 +2542,16 @@ var ts; continue; } break; - case 60: - case 61: - case 62: + case 60 /* lessThan */: + case 61 /* equals */: + case 62 /* greaterThan */: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos); continue; } break; default: - if (ch > 127 && (isWhiteSpace(ch) || isLineBreak(ch))) { + if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpace(ch) || isLineBreak(ch))) { pos++; continue; } @@ -2343,9 +2561,12 @@ var ts; } } ts.skipTrivia = skipTrivia; + // All conflict markers consist of the same character repeated seven times. If it is + // a <<<<<<< or >>>>>>> marker then it is also followd by a space. var mergeConflictMarkerLength = "<<<<<<<".length; function isConflictMarkerTrivia(text, pos) { ts.Debug.assert(pos >= 0); + // Conflict markers must be at the start of a line. if (pos === 0 || isLineBreak(text.charCodeAt(pos - 1))) { var ch = text.charCodeAt(pos); if ((pos + mergeConflictMarkerLength) < text.length) { @@ -2354,8 +2575,8 @@ var ts; return false; } } - return ch === 61 || - text.charCodeAt(pos + mergeConflictMarkerLength) === 32; + return ch === 61 /* equals */ || + text.charCodeAt(pos + mergeConflictMarkerLength) === 32 /* space */; } } return false; @@ -2366,16 +2587,18 @@ var ts; } var ch = text.charCodeAt(pos); var len = text.length; - if (ch === 60 || ch === 62) { + if (ch === 60 /* lessThan */ || ch === 62 /* greaterThan */) { while (pos < len && !isLineBreak(text.charCodeAt(pos))) { pos++; } } else { - ts.Debug.assert(ch === 61); + ts.Debug.assert(ch === 61 /* equals */); + // Consume everything from the start of the mid-conlict marker to the start of the next + // end-conflict marker. while (pos < len) { var ch_1 = text.charCodeAt(pos); - if (ch_1 === 62 && isConflictMarkerTrivia(text, pos)) { + if (ch_1 === 62 /* greaterThan */ && isConflictMarkerTrivia(text, pos)) { break; } pos++; @@ -2383,17 +2606,24 @@ var ts; } return pos; } + // Extract comments from the given source text starting at the given position. If trailing is + // false, whitespace is skipped until the first line break and comments between that location + // and the next token are returned.If trailing is true, comments occurring between the given + // position and the next line break are returned.The return value is an array containing a + // TextRange for each comment. Single-line comment ranges include the beginning '//' characters + // but not the ending line break. Multi - line comment ranges include the beginning '/* and + // ending '*/' characters.The return value is undefined if no comments were found. function getCommentRanges(text, pos, trailing) { var result; var collecting = trailing || pos === 0; while (true) { var ch = text.charCodeAt(pos); switch (ch) { - case 13: - if (text.charCodeAt(pos + 1) === 10) { + case 13 /* carriageReturn */: + if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) { pos++; } - case 10: + case 10 /* lineFeed */: pos++; if (trailing) { return result; @@ -2403,19 +2633,20 @@ var ts; result[result.length - 1].hasTrailingNewLine = true; } continue; - case 9: - case 11: - case 12: - case 32: + case 9 /* tab */: + case 11 /* verticalTab */: + case 12 /* formFeed */: + case 32 /* space */: pos++; continue; - case 47: + case 47 /* slash */: var nextChar = text.charCodeAt(pos + 1); var hasTrailingNewLine = false; - if (nextChar === 47 || nextChar === 42) { + if (nextChar === 47 /* slash */ || nextChar === 42 /* asterisk */) { + var kind = nextChar === 47 /* slash */ ? 2 /* SingleLineCommentTrivia */ : 3 /* MultiLineCommentTrivia */; var startPos = pos; pos += 2; - if (nextChar === 47) { + if (nextChar === 47 /* slash */) { while (pos < text.length) { if (isLineBreak(text.charCodeAt(pos))) { hasTrailingNewLine = true; @@ -2426,7 +2657,7 @@ var ts; } else { while (pos < text.length) { - if (text.charCodeAt(pos) === 42 && text.charCodeAt(pos + 1) === 47) { + if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { pos += 2; break; } @@ -2437,13 +2668,13 @@ var ts; if (!result) { result = []; } - result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine }); + result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine, kind: kind }); } continue; } break; default: - if (ch > 127 && (isWhiteSpace(ch) || isLineBreak(ch))) { + if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpace(ch) || isLineBreak(ch))) { if (result && result.length && isLineBreak(ch)) { result[result.length - 1].hasTrailingNewLine = true; } @@ -2464,55 +2695,81 @@ 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 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || + ch === 36 /* $ */ || ch === 95 /* _ */ || + ch > 127 /* maxAsciiCharacter */ && 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 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || + ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || + ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); } ts.isIdentifierPart = isIdentifierPart; - function createScanner(languageVersion, skipTrivia, text, onError) { - var pos; - var len; - var startPos; - var tokenPos; + // Creates a scanner over a (possibly unspecified) range of a piece of text. + /* @internal */ + function createScanner(languageVersion, skipTrivia, text, onError, start, length) { + var pos; // Current position (end position of text of current token) + var end; // end of text + var startPos; // Start position of whitespace before current token + var tokenPos; // Start position of text of current token var token; var tokenValue; var precedingLineBreak; var hasExtendedUnicodeEscape; var tokenIsUnterminated; + setText(text, start, length); + 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 === 65 /* Identifier */ || token > 101 /* LastReservedWord */; }, + isReservedWord: function () { return token >= 66 /* FirstReservedWord */ && token <= 101 /* LastReservedWord */; }, + isUnterminated: function () { return tokenIsUnterminated; }, + reScanGreaterToken: reScanGreaterToken, + reScanSlashToken: reScanSlashToken, + reScanTemplateToken: reScanTemplateToken, + scan: scan, + setText: setText, + setScriptTarget: setScriptTarget, + setOnError: setOnError, + setTextPos: setTextPos, + tryScan: tryScan, + lookAhead: lookAhead + }; function error(message, length) { if (onError) { onError(message, length || 0); } } function isIdentifierStart(ch) { - return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || - ch === 36 || ch === 95 || - ch > 127 && isUnicodeIdentifierStart(ch, languageVersion); + return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || + ch === 36 /* $ */ || ch === 95 /* _ */ || + ch > 127 /* maxAsciiCharacter */ && 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 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || + ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || + ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); } function scanNumber() { var start = pos; while (isDigit(text.charCodeAt(pos))) pos++; - if (text.charCodeAt(pos) === 46) { + if (text.charCodeAt(pos) === 46 /* dot */) { pos++; while (isDigit(text.charCodeAt(pos))) pos++; } var end = pos; - if (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101) { + if (text.charCodeAt(pos) === 69 /* E */ || text.charCodeAt(pos) === 101 /* e */) { pos++; - if (text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) + if (text.charCodeAt(pos) === 43 /* plus */ || text.charCodeAt(pos) === 45 /* minus */) pos++; if (isDigit(text.charCodeAt(pos))) { pos++; @@ -2533,9 +2790,17 @@ var ts; } return +(text.substring(start, pos)); } + /** + * Scans the given number of hexadecimal digits in the text, + * returning -1 if the given number is unavailable. + */ function scanExactNumberOfHexDigits(count) { return scanHexDigits(count, false); } + /** + * Scans as many hexadecimal digits as are available in the text, + * returning -1 if the given number of digits was unavailable. + */ function scanMinimumNumberOfHexDigits(count) { return scanHexDigits(count, true); } @@ -2544,14 +2809,14 @@ var ts; var value = 0; while (digits < minCount || scanAsManyAsPossible) { var ch = text.charCodeAt(pos); - if (ch >= 48 && ch <= 57) { - value = value * 16 + ch - 48; + if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) { + value = value * 16 + ch - 48 /* _0 */; } - else if (ch >= 65 && ch <= 70) { - value = value * 16 + ch - 65 + 10; + else if (ch >= 65 /* A */ && ch <= 70 /* F */) { + value = value * 16 + ch - 65 /* A */ + 10; } - else if (ch >= 97 && ch <= 102) { - value = value * 16 + ch - 97 + 10; + else if (ch >= 97 /* a */ && ch <= 102 /* f */) { + value = value * 16 + ch - 97 /* a */ + 10; } else { break; @@ -2569,7 +2834,7 @@ var ts; var result = ""; var start = pos; while (true) { - if (pos >= len) { + if (pos >= end) { result += text.substring(start, pos); tokenIsUnterminated = true; error(ts.Diagnostics.Unterminated_string_literal); @@ -2581,7 +2846,7 @@ var ts; pos++; break; } - if (ch === 92) { + if (ch === 92 /* backslash */) { result += text.substring(start, pos); result += scanEscapeSequence(); start = pos; @@ -2597,43 +2862,52 @@ var ts; } return result; } + /** + * Sets the current 'tokenValue' and returns a NoSubstitutionTemplateLiteral or + * a literal component of a TemplateExpression. + */ function scanTemplateAndSetTokenValue() { - var startedWithBacktick = text.charCodeAt(pos) === 96; + var startedWithBacktick = text.charCodeAt(pos) === 96 /* backtick */; pos++; var start = pos; var contents = ""; var resultingToken; while (true) { - if (pos >= len) { + if (pos >= end) { contents += text.substring(start, pos); tokenIsUnterminated = true; error(ts.Diagnostics.Unterminated_template_literal); - resultingToken = startedWithBacktick ? 10 : 13; + resultingToken = startedWithBacktick ? 10 /* NoSubstitutionTemplateLiteral */ : 13 /* TemplateTail */; break; } var currChar = text.charCodeAt(pos); - if (currChar === 96) { + // '`' + if (currChar === 96 /* backtick */) { contents += text.substring(start, pos); pos++; - resultingToken = startedWithBacktick ? 10 : 13; + resultingToken = startedWithBacktick ? 10 /* NoSubstitutionTemplateLiteral */ : 13 /* TemplateTail */; break; } - if (currChar === 36 && pos + 1 < len && text.charCodeAt(pos + 1) === 123) { + // '${' + if (currChar === 36 /* $ */ && pos + 1 < end && text.charCodeAt(pos + 1) === 123 /* openBrace */) { contents += text.substring(start, pos); pos += 2; - resultingToken = startedWithBacktick ? 11 : 12; + resultingToken = startedWithBacktick ? 11 /* TemplateHead */ : 12 /* TemplateMiddle */; break; } - if (currChar === 92) { + // Escape character + if (currChar === 92 /* backslash */) { contents += text.substring(start, pos); contents += scanEscapeSequence(); start = pos; continue; } - if (currChar === 13) { + // Speculated ECMAScript 6 Spec 11.8.6.1: + // and LineTerminatorSequences are normalized to for Template Values + if (currChar === 13 /* carriageReturn */) { contents += text.substring(start, pos); pos++; - if (pos < len && text.charCodeAt(pos) === 10) { + if (pos < end && text.charCodeAt(pos) === 10 /* lineFeed */) { pos++; } contents += "\n"; @@ -2648,46 +2922,52 @@ var ts; } function scanEscapeSequence() { pos++; - if (pos >= len) { + if (pos >= end) { error(ts.Diagnostics.Unexpected_end_of_text); return ""; } var ch = text.charCodeAt(pos++); switch (ch) { - case 48: + case 48 /* _0 */: return "\0"; - case 98: + case 98 /* b */: return "\b"; - case 116: + case 116 /* t */: return "\t"; - case 110: + case 110 /* n */: return "\n"; - case 118: + case 118 /* v */: return "\v"; - case 102: + case 102 /* f */: return "\f"; - case 114: + case 114 /* r */: return "\r"; - case 39: + case 39 /* singleQuote */: return "\'"; - case 34: + case 34 /* doubleQuote */: return "\""; - case 117: - if (pos < len && text.charCodeAt(pos) === 123) { + case 117 /* u */: + // '\u{DDDDDDDD}' + if (pos < end && text.charCodeAt(pos) === 123 /* openBrace */) { hasExtendedUnicodeEscape = true; pos++; return scanExtendedUnicodeEscape(); } + // '\uDDDD' return scanHexadecimalEscape(4); - case 120: + case 120 /* x */: + // '\xDD' return scanHexadecimalEscape(2); - case 13: - if (pos < len && text.charCodeAt(pos) === 10) { + // when encountering a LineContinuation (i.e. a backslash and a line terminator sequence), + // the line terminator is interpreted to be "the empty code unit sequence". + case 13 /* carriageReturn */: + if (pos < end && text.charCodeAt(pos) === 10 /* lineFeed */) { pos++; } - case 10: - case 8232: - case 8233: + // fall through + case 10 /* lineFeed */: + case 8232 /* lineSeparator */: + case 8233 /* paragraphSeparator */: return ""; default: return String.fromCharCode(ch); @@ -2706,6 +2986,7 @@ var ts; function scanExtendedUnicodeEscape() { var escapedValue = scanMinimumNumberOfHexDigits(1); var isInvalidExtendedEscape = false; + // Validate the value of the digit if (escapedValue < 0) { error(ts.Diagnostics.Hexadecimal_digit_expected); isInvalidExtendedEscape = true; @@ -2714,11 +2995,12 @@ var ts; error(ts.Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive); isInvalidExtendedEscape = true; } - if (pos >= len) { + if (pos >= end) { error(ts.Diagnostics.Unexpected_end_of_text); isInvalidExtendedEscape = true; } - else if (text.charCodeAt(pos) == 125) { + else if (text.charCodeAt(pos) == 125 /* closeBrace */) { + // Only swallow the following character up if it's a '}'. pos++; } else { @@ -2730,6 +3012,7 @@ var ts; } return utf16EncodeAsString(escapedValue); } + // Derived from the 10.1.1 UTF16Encoding of the ES6 Spec. function utf16EncodeAsString(codePoint) { ts.Debug.assert(0x0 <= codePoint && codePoint <= 0x10FFFF); if (codePoint <= 65535) { @@ -2739,12 +3022,14 @@ var ts; var codeUnit2 = ((codePoint - 65536) % 1024) + 0xDC00; return String.fromCharCode(codeUnit1, codeUnit2); } + // Current character is known to be a backslash. Check for Unicode escape of the form '\uXXXX' + // and return code point value if valid Unicode escape is found. Otherwise return -1. function peekUnicodeEscape() { - if (pos + 5 < len && text.charCodeAt(pos + 1) === 117) { - var start = pos; + if (pos + 5 < end && text.charCodeAt(pos + 1) === 117 /* u */) { + var start_1 = pos; pos += 2; var value = scanExactNumberOfHexDigits(4); - pos = start; + pos = start_1; return value; } return -1; @@ -2752,18 +3037,19 @@ var ts; function scanIdentifierParts() { var result = ""; var start = pos; - while (pos < len) { + while (pos < end) { var ch = text.charCodeAt(pos); if (isIdentifierPart(ch)) { pos++; } - else if (ch === 92) { + else if (ch === 92 /* backslash */) { ch = peekUnicodeEscape(); if (!(ch >= 0 && isIdentifierPart(ch))) { break; } result += text.substring(start, pos); result += String.fromCharCode(ch); + // Valid Unicode escape is always six characters pos += 6; start = pos; } @@ -2775,22 +3061,25 @@ var ts; return result; } function getIdentifierToken() { + // Reserved words are between 2 and 11 characters long and start with a lowercase letter var len = tokenValue.length; if (len >= 2 && len <= 11) { var ch = tokenValue.charCodeAt(0); - if (ch >= 97 && ch <= 122 && hasOwnProperty.call(textToToken, tokenValue)) { + if (ch >= 97 /* a */ && ch <= 122 /* z */ && hasOwnProperty.call(textToToken, tokenValue)) { return token = textToToken[tokenValue]; } } - return token = 65; + return token = 65 /* Identifier */; } function scanBinaryOrOctalDigits(base) { ts.Debug.assert(base !== 2 || base !== 8, "Expected either base 2 or base 8"); var value = 0; + // For counting number of digits; Valid binaryIntegerLiteral must have at least one binary digit following B or b. + // Similarly valid octalIntegerLiteral must have at least one octal digit following o or O. var numberOfDigits = 0; while (true) { var ch = text.charCodeAt(pos); - var valueOfCh = ch - 48; + var valueOfCh = ch - 48 /* _0 */; if (!isDigit(ch) || valueOfCh >= base) { break; } @@ -2798,6 +3087,7 @@ var ts; pos++; numberOfDigits++; } + // Invalid binaryIntegerLiteral or octalIntegerLiteral if (numberOfDigits === 0) { return -1; } @@ -2810,108 +3100,110 @@ var ts; tokenIsUnterminated = false; while (true) { tokenPos = pos; - if (pos >= len) { - return token = 1; + if (pos >= end) { + return token = 1 /* EndOfFileToken */; } var ch = text.charCodeAt(pos); switch (ch) { - case 10: - case 13: + case 10 /* lineFeed */: + case 13 /* carriageReturn */: precedingLineBreak = true; if (skipTrivia) { pos++; continue; } else { - if (ch === 13 && pos + 1 < len && text.charCodeAt(pos + 1) === 10) { + if (ch === 13 /* carriageReturn */ && pos + 1 < end && text.charCodeAt(pos + 1) === 10 /* lineFeed */) { + // consume both CR and LF pos += 2; } else { pos++; } - return token = 4; + return token = 4 /* NewLineTrivia */; } - case 9: - case 11: - case 12: - case 32: + case 9 /* tab */: + case 11 /* verticalTab */: + case 12 /* formFeed */: + case 32 /* space */: if (skipTrivia) { pos++; continue; } else { - while (pos < len && isWhiteSpace(text.charCodeAt(pos))) { + while (pos < end && isWhiteSpace(text.charCodeAt(pos))) { pos++; } - return token = 5; + return token = 5 /* WhitespaceTrivia */; } - case 33: - if (text.charCodeAt(pos + 1) === 61) { - if (text.charCodeAt(pos + 2) === 61) { - return pos += 3, token = 31; + case 33 /* exclamation */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 31 /* ExclamationEqualsEqualsToken */; } - return pos += 2, token = 29; + return pos += 2, token = 29 /* ExclamationEqualsToken */; } - return pos++, token = 46; - case 34: - case 39: + return pos++, token = 46 /* ExclamationToken */; + case 34 /* doubleQuote */: + case 39 /* singleQuote */: tokenValue = scanString(); - return token = 8; - case 96: + return token = 8 /* StringLiteral */; + case 96 /* backtick */: return token = scanTemplateAndSetTokenValue(); - case 37: - if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 58; + case 37 /* percent */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 58 /* PercentEqualsToken */; } - return pos++, token = 37; - case 38: - if (text.charCodeAt(pos + 1) === 38) { - return pos += 2, token = 48; + return pos++, token = 37 /* PercentToken */; + case 38 /* ampersand */: + if (text.charCodeAt(pos + 1) === 38 /* ampersand */) { + return pos += 2, token = 48 /* AmpersandAmpersandToken */; } - if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 62; + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 62 /* AmpersandEqualsToken */; } - return pos++, token = 43; - case 40: - return pos++, token = 16; - case 41: - return pos++, token = 17; - case 42: - if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 56; + return pos++, token = 43 /* AmpersandToken */; + case 40 /* openParen */: + return pos++, token = 16 /* OpenParenToken */; + case 41 /* closeParen */: + return pos++, token = 17 /* CloseParenToken */; + case 42 /* asterisk */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 56 /* AsteriskEqualsToken */; } - return pos++, token = 35; - case 43: - if (text.charCodeAt(pos + 1) === 43) { - return pos += 2, token = 38; + return pos++, token = 35 /* AsteriskToken */; + case 43 /* plus */: + if (text.charCodeAt(pos + 1) === 43 /* plus */) { + return pos += 2, token = 38 /* PlusPlusToken */; } - if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 54; + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 54 /* PlusEqualsToken */; } - return pos++, token = 33; - case 44: - return pos++, token = 23; - case 45: - if (text.charCodeAt(pos + 1) === 45) { - return pos += 2, token = 39; + return pos++, token = 33 /* PlusToken */; + case 44 /* comma */: + return pos++, token = 23 /* CommaToken */; + case 45 /* minus */: + if (text.charCodeAt(pos + 1) === 45 /* minus */) { + return pos += 2, token = 39 /* MinusMinusToken */; } - if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 55; + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 55 /* MinusEqualsToken */; } - return pos++, token = 34; - case 46: + return pos++, token = 34 /* MinusToken */; + case 46 /* dot */: if (isDigit(text.charCodeAt(pos + 1))) { tokenValue = "" + scanNumber(); - return token = 7; + return token = 7 /* NumericLiteral */; } - if (text.charCodeAt(pos + 1) === 46 && text.charCodeAt(pos + 2) === 46) { - return pos += 3, token = 21; + if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) { + return pos += 3, token = 21 /* DotDotDotToken */; } - return pos++, token = 20; - case 47: - if (text.charCodeAt(pos + 1) === 47) { + return pos++, token = 20 /* DotToken */; + case 47 /* slash */: + // Single-line comment + if (text.charCodeAt(pos + 1) === 47 /* slash */) { pos += 2; - while (pos < len) { + while (pos < end) { if (isLineBreak(text.charCodeAt(pos))) { break; } @@ -2921,15 +3213,16 @@ var ts; continue; } else { - return token = 2; + return token = 2 /* SingleLineCommentTrivia */; } } - if (text.charCodeAt(pos + 1) === 42) { + // Multi-line comment + if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { pos += 2; var commentClosed = false; - while (pos < len) { + while (pos < end) { var ch_2 = text.charCodeAt(pos); - if (ch_2 === 42 && text.charCodeAt(pos + 1) === 47) { + if (ch_2 === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { pos += 2; commentClosed = true; break; @@ -2947,15 +3240,15 @@ var ts; } else { tokenIsUnterminated = !commentClosed; - return token = 3; + return token = 3 /* MultiLineCommentTrivia */; } } - if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 57; + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 57 /* SlashEqualsToken */; } - return pos++, token = 36; - case 48: - if (pos + 2 < len && (text.charCodeAt(pos + 1) === 88 || text.charCodeAt(pos + 1) === 120)) { + return pos++, token = 36 /* SlashToken */; + case 48 /* _0 */: + if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 /* X */ || text.charCodeAt(pos + 1) === 120 /* x */)) { pos += 2; var value = scanMinimumNumberOfHexDigits(1); if (value < 0) { @@ -2963,9 +3256,9 @@ var ts; value = 0; } tokenValue = "" + value; - return token = 7; + return token = 7 /* NumericLiteral */; } - else if (pos + 2 < len && (text.charCodeAt(pos + 1) === 66 || text.charCodeAt(pos + 1) === 98)) { + else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 66 /* B */ || text.charCodeAt(pos + 1) === 98 /* b */)) { pos += 2; var value = scanBinaryOrOctalDigits(2); if (value < 0) { @@ -2973,9 +3266,9 @@ var ts; value = 0; } tokenValue = "" + value; - return token = 7; + return token = 7 /* NumericLiteral */; } - else if (pos + 2 < len && (text.charCodeAt(pos + 1) === 79 || text.charCodeAt(pos + 1) === 111)) { + else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 79 /* O */ || text.charCodeAt(pos + 1) === 111 /* o */)) { pos += 2; var value = scanBinaryOrOctalDigits(8); if (value < 0) { @@ -2983,106 +3276,110 @@ var ts; value = 0; } tokenValue = "" + value; - return token = 7; + return token = 7 /* NumericLiteral */; } - if (pos + 1 < len && isOctalDigit(text.charCodeAt(pos + 1))) { + // Try to parse as an octal + if (pos + 1 < end && isOctalDigit(text.charCodeAt(pos + 1))) { tokenValue = "" + scanOctalDigits(); - return token = 7; + return token = 7 /* NumericLiteral */; } - case 49: - case 50: - case 51: - case 52: - case 53: - case 54: - case 55: - case 56: - case 57: + // This fall-through is a deviation from the EcmaScript grammar. The grammar says that a leading zero + // can only be followed by an octal digit, a dot, or the end of the number literal. However, we are being + // permissive and allowing decimal digits of the form 08* and 09* (which many browsers also do). + case 49 /* _1 */: + case 50 /* _2 */: + case 51 /* _3 */: + case 52 /* _4 */: + case 53 /* _5 */: + case 54 /* _6 */: + case 55 /* _7 */: + case 56 /* _8 */: + case 57 /* _9 */: tokenValue = "" + scanNumber(); - return token = 7; - case 58: - return pos++, token = 51; - case 59: - return pos++, token = 22; - case 60: + return token = 7 /* NumericLiteral */; + case 58 /* colon */: + return pos++, token = 51 /* ColonToken */; + case 59 /* semicolon */: + return pos++, token = 22 /* SemicolonToken */; + case 60 /* lessThan */: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); if (skipTrivia) { continue; } else { - return token = 6; + return token = 6 /* ConflictMarkerTrivia */; } } - if (text.charCodeAt(pos + 1) === 60) { - if (text.charCodeAt(pos + 2) === 61) { - return pos += 3, token = 59; + if (text.charCodeAt(pos + 1) === 60 /* lessThan */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 59 /* LessThanLessThanEqualsToken */; } - return pos += 2, token = 40; + return pos += 2, token = 40 /* LessThanLessThanToken */; } - if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 26; + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 26 /* LessThanEqualsToken */; } - return pos++, token = 24; - case 61: + return pos++, token = 24 /* LessThanToken */; + case 61 /* equals */: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); if (skipTrivia) { continue; } else { - return token = 6; + return token = 6 /* ConflictMarkerTrivia */; } } - if (text.charCodeAt(pos + 1) === 61) { - if (text.charCodeAt(pos + 2) === 61) { - return pos += 3, token = 30; + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 30 /* EqualsEqualsEqualsToken */; } - return pos += 2, token = 28; + return pos += 2, token = 28 /* EqualsEqualsToken */; } - if (text.charCodeAt(pos + 1) === 62) { - return pos += 2, token = 32; + if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { + return pos += 2, token = 32 /* EqualsGreaterThanToken */; } - return pos++, token = 53; - case 62: + return pos++, token = 53 /* EqualsToken */; + case 62 /* greaterThan */: if (isConflictMarkerTrivia(text, pos)) { pos = scanConflictMarkerTrivia(text, pos, error); if (skipTrivia) { continue; } else { - return token = 6; + return token = 6 /* ConflictMarkerTrivia */; } } - return pos++, token = 25; - case 63: - return pos++, token = 50; - case 91: - return pos++, token = 18; - case 93: - return pos++, token = 19; - case 94: - if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 64; + return pos++, token = 25 /* GreaterThanToken */; + case 63 /* question */: + return pos++, token = 50 /* QuestionToken */; + case 91 /* openBracket */: + return pos++, token = 18 /* OpenBracketToken */; + case 93 /* closeBracket */: + return pos++, token = 19 /* CloseBracketToken */; + case 94 /* caret */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 64 /* CaretEqualsToken */; } - return pos++, token = 45; - case 123: - return pos++, token = 14; - case 124: - if (text.charCodeAt(pos + 1) === 124) { - return pos += 2, token = 49; + return pos++, token = 45 /* CaretToken */; + case 123 /* openBrace */: + return pos++, token = 14 /* OpenBraceToken */; + case 124 /* bar */: + if (text.charCodeAt(pos + 1) === 124 /* bar */) { + return pos += 2, token = 49 /* BarBarToken */; } - if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 63; + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 63 /* BarEqualsToken */; } - return pos++, token = 44; - case 125: - return pos++, token = 15; - case 126: - return pos++, token = 47; - case 64: - return pos++, token = 52; - case 92: + return pos++, token = 44 /* BarToken */; + case 125 /* closeBrace */: + return pos++, token = 15 /* CloseBraceToken */; + case 126 /* tilde */: + return pos++, token = 47 /* TildeToken */; + case 64 /* at */: + return pos++, token = 52 /* AtToken */; + case 92 /* backslash */: var cookedChar = peekUnicodeEscape(); if (cookedChar >= 0 && isIdentifierStart(cookedChar)) { pos += 6; @@ -3090,14 +3387,14 @@ var ts; return token = getIdentifierToken(); } error(ts.Diagnostics.Invalid_character); - return pos++, token = 0; + return pos++, token = 0 /* Unknown */; default: if (isIdentifierStart(ch)) { pos++; - while (pos < len && isIdentifierPart(ch = text.charCodeAt(pos))) + while (pos < end && isIdentifierPart(ch = text.charCodeAt(pos))) pos++; tokenValue = text.substring(tokenPos, pos); - if (ch === 92) { + if (ch === 92 /* backslash */) { tokenValue += scanIdentifierParts(); } return token = getIdentifierToken(); @@ -3112,37 +3409,39 @@ var ts; continue; } error(ts.Diagnostics.Invalid_character); - return pos++, token = 0; + return pos++, token = 0 /* Unknown */; } } } function reScanGreaterToken() { - if (token === 25) { - if (text.charCodeAt(pos) === 62) { - if (text.charCodeAt(pos + 1) === 62) { - if (text.charCodeAt(pos + 2) === 61) { - return pos += 3, token = 61; + if (token === 25 /* GreaterThanToken */) { + if (text.charCodeAt(pos) === 62 /* greaterThan */) { + if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 61 /* GreaterThanGreaterThanGreaterThanEqualsToken */; } - return pos += 2, token = 42; + return pos += 2, token = 42 /* GreaterThanGreaterThanGreaterThanToken */; } - if (text.charCodeAt(pos + 1) === 61) { - return pos += 2, token = 60; + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 60 /* GreaterThanGreaterThanEqualsToken */; } - return pos++, token = 41; + return pos++, token = 41 /* GreaterThanGreaterThanToken */; } - if (text.charCodeAt(pos) === 61) { - return pos++, token = 27; + if (text.charCodeAt(pos) === 61 /* equals */) { + return pos++, token = 27 /* GreaterThanEqualsToken */; } } return token; } function reScanSlashToken() { - if (token === 36 || token === 57) { + if (token === 36 /* SlashToken */ || token === 57 /* SlashEqualsToken */) { var p = tokenPos + 1; var inEscape = false; var inCharacterClass = false; while (true) { - if (p >= len) { + // If we reach the end of a file, or hit a newline, then this is an unterminated + // regex. Report error and return what we have so far. + if (p >= end) { tokenIsUnterminated = true; error(ts.Diagnostics.Unterminated_regular_expression_literal); break; @@ -3154,34 +3453,41 @@ var ts; break; } if (inEscape) { + // Parsing an escape character; + // reset the flag and just advance to the next char. inEscape = false; } - else if (ch === 47 && !inCharacterClass) { + else if (ch === 47 /* slash */ && !inCharacterClass) { + // A slash within a character class is permissible, + // but in general it signals the end of the regexp literal. p++; break; } - else if (ch === 91) { + else if (ch === 91 /* openBracket */) { inCharacterClass = true; } - else if (ch === 92) { + else if (ch === 92 /* backslash */) { inEscape = true; } - else if (ch === 93) { + else if (ch === 93 /* closeBracket */) { inCharacterClass = false; } p++; } - while (p < len && isIdentifierPart(text.charCodeAt(p))) { + while (p < end && isIdentifierPart(text.charCodeAt(p))) { p++; } pos = p; tokenValue = text.substring(tokenPos, pos); - token = 9; + token = 9 /* RegularExpressionLiteral */; } return token; } + /** + * Unconditionally back up and scan a template expression portion. + */ function reScanTemplateToken() { - ts.Debug.assert(token === 15, "'reScanTemplateToken' should only be called on a '}'"); + ts.Debug.assert(token === 15 /* CloseBraceToken */, "'reScanTemplateToken' should only be called on a '}'"); pos = tokenPos; return token = scanTemplateAndSetTokenValue(); } @@ -3193,6 +3499,8 @@ var ts; var saveTokenValue = tokenValue; var savePrecedingLineBreak = precedingLineBreak; var result = callback(); + // If our callback returned something 'falsy' or we're just looking ahead, + // then unconditionally restore us to where we were. if (!result || isLookahead) { pos = savePos; startPos = saveStartPos; @@ -3209,44 +3517,33 @@ var ts; function tryScan(callback) { return speculationHelper(callback, false); } - function setText(newText) { + function setText(newText, start, length) { text = newText || ""; - len = text.length; - setTextPos(0); + end = length === undefined ? text.length : start + length; + setTextPos(start || 0); + } + function setOnError(errorCallback) { + onError = errorCallback; + } + function setScriptTarget(scriptTarget) { + languageVersion = scriptTarget; } function setTextPos(textPos) { + ts.Debug.assert(textPos >= 0); pos = textPos; startPos = textPos; tokenPos = textPos; - token = 0; + token = 0 /* Unknown */; precedingLineBreak = false; + tokenValue = undefined; + hasExtendedUnicodeEscape = false; + tokenIsUnterminated = false; } - 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 === 65 || token > 101; }, - isReservedWord: function () { return token >= 66 && token <= 101; }, - isUnterminated: function () { return tokenIsUnterminated; }, - reScanGreaterToken: reScanGreaterToken, - reScanSlashToken: reScanSlashToken, - reScanTemplateToken: reScanTemplateToken, - scan: scan, - setText: setText, - setTextPos: setTextPos, - tryScan: tryScan, - lookAhead: lookAhead - }; } ts.createScanner = createScanner; })(ts || (ts = {})); /// +/* @internal */ var ts; (function (ts) { ts.bindTime = 0; @@ -3257,36 +3554,41 @@ var ts; })(ts.ModuleInstanceState || (ts.ModuleInstanceState = {})); var ModuleInstanceState = ts.ModuleInstanceState; function getModuleInstanceState(node) { - if (node.kind === 202 || node.kind === 203) { - return 0; + // A module is uninstantiated if it contains only + // 1. interface declarations, type alias declarations + if (node.kind === 202 /* InterfaceDeclaration */ || node.kind === 203 /* TypeAliasDeclaration */) { + return 0 /* NonInstantiated */; } else if (ts.isConstEnumDeclaration(node)) { - return 2; + return 2 /* ConstEnumOnly */; } - else if ((node.kind === 209 || node.kind === 208) && !(node.flags & 1)) { - return 0; + else if ((node.kind === 209 /* ImportDeclaration */ || node.kind === 208 /* ImportEqualsDeclaration */) && !(node.flags & 1 /* Export */)) { + return 0 /* NonInstantiated */; } - else if (node.kind === 206) { - var state = 0; + else if (node.kind === 206 /* ModuleBlock */) { + var state = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { switch (getModuleInstanceState(n)) { - case 0: + case 0 /* NonInstantiated */: + // child is non-instantiated - continue searching return false; - case 2: - state = 2; + case 2 /* ConstEnumOnly */: + // child is const enum only - record state and continue searching + state = 2 /* ConstEnumOnly */; return false; - case 1: - state = 1; + case 1 /* Instantiated */: + // child is instantiated - record state and stop + state = 1 /* Instantiated */; return true; } }); return state; } - else if (node.kind === 205) { + else if (node.kind === 205 /* ModuleDeclaration */) { return getModuleInstanceState(node.body); } else { - return 1; + return 1 /* Instantiated */; } } ts.getModuleInstanceState = getModuleInstanceState; @@ -3325,20 +3627,22 @@ var ts; if (!symbol.declarations) symbol.declarations = []; symbol.declarations.push(node); - if (symbolKind & 1952 && !symbol.exports) + if (symbolKind & 1952 /* HasExports */ && !symbol.exports) symbol.exports = {}; - if (symbolKind & 6240 && !symbol.members) + if (symbolKind & 6240 /* HasMembers */ && !symbol.members) symbol.members = {}; node.symbol = symbol; - if (symbolKind & 107455 && !symbol.valueDeclaration) + if (symbolKind & 107455 /* Value */ && !symbol.valueDeclaration) symbol.valueDeclaration = node; } + // Should not be called on a declaration with a computed property name, + // unless it is a well known Symbol. function getDeclarationName(node) { if (node.name) { - if (node.kind === 205 && node.name.kind === 8) { + if (node.kind === 205 /* ModuleDeclaration */ && node.name.kind === 8 /* StringLiteral */) { return '"' + node.name.text + '"'; } - if (node.name.kind === 127) { + if (node.name.kind === 127 /* ComputedPropertyName */) { var nameExpression = node.name.expression; ts.Debug.assert(ts.isWellKnownSymbolSyntactically(nameExpression)); return ts.getPropertyNameForKnownSymbolName(nameExpression.name.text); @@ -3346,23 +3650,23 @@ var ts; return node.name.text; } switch (node.kind) { - case 143: - case 135: + case 143 /* ConstructorType */: + case 135 /* Constructor */: return "__constructor"; - case 142: - case 138: + case 142 /* FunctionType */: + case 138 /* CallSignature */: return "__call"; - case 139: + case 139 /* ConstructSignature */: return "__new"; - case 140: + case 140 /* IndexSignature */: return "__index"; - case 215: + case 215 /* ExportDeclaration */: return "__export"; - case 214: + case 214 /* ExportAssignment */: return node.isExportEquals ? "export=" : "default"; - case 200: - case 201: - return node.flags & 256 ? "default" : undefined; + case 200 /* FunctionDeclaration */: + case 201 /* ClassDeclaration */: + return node.flags & 256 /* Default */ ? "default" : undefined; } } function getDisplayName(node) { @@ -3370,7 +3674,8 @@ var ts; } function declareSymbol(symbols, parent, node, includes, excludes) { ts.Debug.assert(!ts.hasDynamicName(node)); - var name = node.flags & 256 && parent ? "default" : getDeclarationName(node); + // The exported symbol for an export default function/class node is always named "default" + var name = node.flags & 256 /* Default */ && parent ? "default" : getDeclarationName(node); var symbol; if (name !== undefined) { symbol = ts.hasProperty(symbols, name) ? symbols[name] : (symbols[name] = createSymbol(0, name)); @@ -3378,7 +3683,9 @@ var ts; if (node.name) { node.name.parent = node; } - var message = symbol.flags & 2 + // Report errors every position with duplicate declaration + // Report errors on previous encountered declarations + var message = symbol.flags & 2 /* BlockScopedVariable */ ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(symbol.declarations, function (declaration) { @@ -3393,8 +3700,12 @@ var ts; } addDeclarationToSymbol(symbol, node, includes); symbol.parent = parent; - if ((node.kind === 201 || node.kind === 174) && symbol.exports) { - var prototypeSymbol = createSymbol(4 | 134217728, "prototype"); + if ((node.kind === 201 /* ClassDeclaration */ || node.kind === 174 /* 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. + // It is an error to explicitly declare a static property member with the name 'prototype'. + var prototypeSymbol = createSymbol(4 /* Property */ | 134217728 /* Prototype */, "prototype"); if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { if (node.name) { node.name.parent = node; @@ -3407,9 +3718,9 @@ var ts; return symbol; } function declareModuleMember(node, symbolKind, symbolExcludes) { - var hasExportModifier = ts.getCombinedNodeFlags(node) & 1; - if (symbolKind & 8388608) { - if (node.kind === 217 || (node.kind === 208 && hasExportModifier)) { + var hasExportModifier = ts.getCombinedNodeFlags(node) & 1 /* Export */; + if (symbolKind & 8388608 /* Alias */) { + if (node.kind === 217 /* ExportSpecifier */ || (node.kind === 208 /* ImportEqualsDeclaration */ && hasExportModifier)) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); } else { @@ -3417,10 +3728,21 @@ var ts; } } else { - if (hasExportModifier || container.flags & 32768) { - var exportKind = (symbolKind & 107455 ? 1048576 : 0) | - (symbolKind & 793056 ? 2097152 : 0) | - (symbolKind & 1536 ? 4194304 : 0); + // Exported module members are given 2 symbols: A local symbol that is classified with an ExportValue, + // ExportType, or ExportContainer flag, and an associated export symbol with all the correct flags set + // on it. There are 2 main reasons: + // + // 1. We treat locals and exports of the same name as mutually exclusive within a container. + // That means the binder will issue a Duplicate Identifier error if you mix locals and exports + // with the same name in the same container. + // TODO: Make this a more specific error and decouple it from the exclusion logic. + // 2. When we checkIdentifier in the checker, we set its resolved symbol to the local symbol, + // but return the export symbol (by calling getExportSymbolOfValueSymbolIfExported). That way + // when the emitter comes back to it, it knows not to qualify the name if it was found in a containing scope. + if (hasExportModifier || container.flags & 32768 /* ExportContext */) { + var exportKind = (symbolKind & 107455 /* Value */ ? 1048576 /* ExportValue */ : 0) | + (symbolKind & 793056 /* Type */ ? 2097152 /* ExportType */ : 0) | + (symbolKind & 1536 /* Namespace */ ? 4194304 /* ExportNamespace */ : 0); var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); node.localSymbol = local; @@ -3430,15 +3752,17 @@ var ts; } } } + // All container nodes are kept on a linked list in declaration order. This list is used by the getLocalNameOfContainer function + // in the type checker to validate that the local name used for a container is unique. function bindChildren(node, symbolKind, isBlockScopeContainer) { - if (symbolKind & 255504) { + if (symbolKind & 255504 /* HasLocals */) { node.locals = {}; } var saveParent = parent; var saveContainer = container; var savedBlockScopeContainer = blockScopeContainer; parent = node; - if (symbolKind & 262128) { + if (symbolKind & 262128 /* IsContainer */) { container = node; if (lastContainer) { lastContainer.nextContainer = container; @@ -3446,7 +3770,13 @@ var ts; lastContainer = container; } if (isBlockScopeContainer) { - setBlockScopeContainer(node, (symbolKind & 255504) === 0 && node.kind !== 227); + // in incremental scenarios we might reuse nodes that already have locals being allocated + // during the bind step these locals should be dropped to prevent using stale data. + // locals should always be dropped unless they were previously initialized by the binder + // these cases are: + // - node has locals (symbolKind & HasLocals) !== 0 + // - node is a source file + setBlockScopeContainer(node, (symbolKind & 255504 /* HasLocals */) === 0 && node.kind !== 227 /* SourceFile */); } ts.forEachChild(node, bind); container = saveContainer; @@ -3455,41 +3785,41 @@ var ts; } function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) { switch (container.kind) { - case 205: + case 205 /* ModuleDeclaration */: declareModuleMember(node, symbolKind, symbolExcludes); break; - case 227: + case 227 /* SourceFile */: 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: + case 142 /* FunctionType */: + case 143 /* ConstructorType */: + case 138 /* CallSignature */: + case 139 /* ConstructSignature */: + case 140 /* IndexSignature */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 135 /* Constructor */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); break; - case 174: - case 201: - if (node.flags & 128) { + case 174 /* ClassExpression */: + case 201 /* ClassDeclaration */: + if (node.flags & 128 /* Static */) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } - case 145: - case 154: - case 202: + case 145 /* TypeLiteral */: + case 154 /* ObjectLiteralExpression */: + case 202 /* InterfaceDeclaration */: declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); break; - case 204: + case 204 /* EnumDeclaration */: declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } @@ -3497,18 +3827,18 @@ var ts; } function isAmbientContext(node) { while (node) { - if (node.flags & 2) + if (node.flags & 2 /* Ambient */) 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) { + var body = node.kind === 227 /* SourceFile */ ? node : node.body; + if (body.kind === 227 /* SourceFile */ || body.kind === 206 /* ModuleBlock */) { for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { var stat = _a[_i]; - if (stat.kind === 215 || stat.kind === 214) { + if (stat.kind === 215 /* ExportDeclaration */ || stat.kind === 214 /* ExportAssignment */) { return true; } } @@ -3516,30 +3846,34 @@ var ts; return false; } function setExportContextFlag(node) { + // A declaration source file or ambient module declaration that contains no export declarations (but possibly regular + // declarations with export modifiers) is an export context in which declarations are implicitly exported. if (isAmbientContext(node) && !hasExportDeclarations(node)) { - node.flags |= 32768; + node.flags |= 32768 /* ExportContext */; } else { - node.flags &= ~32768; + node.flags &= ~32768 /* ExportContext */; } } function bindModuleDeclaration(node) { setExportContextFlag(node); - if (node.name.kind === 8) { - bindDeclaration(node, 512, 106639, true); + if (node.name.kind === 8 /* StringLiteral */) { + bindDeclaration(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */, true); } else { var state = getModuleInstanceState(node); - if (state === 0) { - bindDeclaration(node, 1024, 0, true); + if (state === 0 /* NonInstantiated */) { + bindDeclaration(node, 1024 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */, true); } else { - bindDeclaration(node, 512, 106639, true); - var currentModuleIsConstEnumOnly = state === 2; + bindDeclaration(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */, true); + var currentModuleIsConstEnumOnly = state === 2 /* ConstEnumOnly */; if (node.symbol.constEnumOnlyModule === undefined) { + // non-merged case - use the current state node.symbol.constEnumOnlyModule = currentModuleIsConstEnumOnly; } else { + // merged case: module is const enum only if all its pieces are non-instantiated or const enum node.symbol.constEnumOnlyModule = node.symbol.constEnumOnlyModule && currentModuleIsConstEnumOnly; } } @@ -3552,13 +3886,13 @@ var ts; // 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); + var symbol = createSymbol(131072 /* Signature */, getDeclarationName(node)); + addDeclarationToSymbol(symbol, node, 131072 /* Signature */); + bindChildren(node, 131072 /* Signature */, false); + var typeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type"); + addDeclarationToSymbol(typeLiteralSymbol, node, 2048 /* TypeLiteral */); typeLiteralSymbol.members = {}; - typeLiteralSymbol.members[node.kind === 142 ? "__call" : "__new"] = symbol; + typeLiteralSymbol.members[node.kind === 142 /* FunctionType */ ? "__call" : "__new"] = symbol; } function bindAnonymousDeclaration(node, symbolKind, name, isBlockScopeContainer) { var symbol = createSymbol(symbolKind, name); @@ -3568,23 +3902,27 @@ var ts; function bindCatchVariableDeclaration(node) { bindChildren(node, 0, true); } - function bindBlockScopedVariableDeclaration(node) { + function bindBlockScopedDeclaration(node, symbolKind, symbolExcludes) { switch (blockScopeContainer.kind) { - case 205: - declareModuleMember(node, 2, 107455); + case 205 /* ModuleDeclaration */: + declareModuleMember(node, symbolKind, symbolExcludes); break; - case 227: + case 227 /* SourceFile */: if (ts.isExternalModule(container)) { - declareModuleMember(node, 2, 107455); + declareModuleMember(node, symbolKind, symbolExcludes); break; } + // fall through. default: if (!blockScopeContainer.locals) { blockScopeContainer.locals = {}; } - declareSymbol(blockScopeContainer.locals, undefined, node, 2, 107455); + declareSymbol(blockScopeContainer.locals, undefined, node, symbolKind, symbolExcludes); } - bindChildren(node, 2, false); + bindChildren(node, symbolKind, false); + } + function bindBlockScopedVariableDeclaration(node) { + bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); } function getDestructuringParameterName(node) { return "__" + ts.indexOf(node.parent.parameters, node); @@ -3592,14 +3930,14 @@ var ts; function bind(node) { node.parent = parent; switch (node.kind) { - case 128: - bindDeclaration(node, 262144, 530912, false); + case 128 /* TypeParameter */: + bindDeclaration(node, 262144 /* TypeParameter */, 530912 /* TypeParameterExcludes */, false); break; - case 129: + case 129 /* Parameter */: bindParameter(node); break; - case 198: - case 152: + case 198 /* VariableDeclaration */: + case 152 /* BindingElement */: if (ts.isBindingPattern(node.name)) { bindChildren(node, 0, false); } @@ -3607,124 +3945,139 @@ var ts; bindBlockScopedVariableDeclaration(node); } else { - bindDeclaration(node, 1, 107454, false); + bindDeclaration(node, 1 /* FunctionScopedVariable */, 107454 /* FunctionScopedVariableExcludes */, false); } break; - case 132: - case 131: - bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 107455, false); + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + bindPropertyOrMethodOrAccessor(node, 4 /* Property */ | (node.questionToken ? 536870912 /* Optional */ : 0), 107455 /* PropertyExcludes */, false); break; - case 224: - case 225: - bindPropertyOrMethodOrAccessor(node, 4, 107455, false); + case 224 /* PropertyAssignment */: + case 225 /* ShorthandPropertyAssignment */: + bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 107455 /* PropertyExcludes */, false); break; - case 226: - bindPropertyOrMethodOrAccessor(node, 8, 107455, false); + case 226 /* EnumMember */: + bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 107455 /* EnumMemberExcludes */, false); break; - case 138: - case 139: - case 140: - bindDeclaration(node, 131072, 0, false); + case 138 /* CallSignature */: + case 139 /* ConstructSignature */: + case 140 /* IndexSignature */: + bindDeclaration(node, 131072 /* Signature */, 0, false); break; - case 134: - case 133: - bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 107455 : 99263, true); + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + // If this is an ObjectLiteralExpression method, then it sits in the same space + // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes + // so that it will conflict with any other object literal members with the same + // name. + bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 536870912 /* Optional */ : 0), ts.isObjectLiteralMethod(node) ? 107455 /* PropertyExcludes */ : 99263 /* MethodExcludes */, true); break; - case 200: - bindDeclaration(node, 16, 106927, true); + case 200 /* FunctionDeclaration */: + bindDeclaration(node, 16 /* Function */, 106927 /* FunctionExcludes */, true); break; - case 135: - bindDeclaration(node, 16384, 0, true); + case 135 /* Constructor */: + bindDeclaration(node, 16384 /* Constructor */, 0, true); break; - case 136: - bindPropertyOrMethodOrAccessor(node, 32768, 41919, true); + case 136 /* GetAccessor */: + bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 41919 /* GetAccessorExcludes */, true); break; - case 137: - bindPropertyOrMethodOrAccessor(node, 65536, 74687, true); + case 137 /* SetAccessor */: + bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 74687 /* SetAccessorExcludes */, true); break; - case 142: - case 143: + case 142 /* FunctionType */: + case 143 /* ConstructorType */: bindFunctionOrConstructorType(node); break; - case 145: - bindAnonymousDeclaration(node, 2048, "__type", false); + case 145 /* TypeLiteral */: + bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type", false); break; - case 154: - bindAnonymousDeclaration(node, 4096, "__object", false); + case 154 /* ObjectLiteralExpression */: + bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object", false); break; - case 162: - case 163: - bindAnonymousDeclaration(node, 16, "__function", true); + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: + bindAnonymousDeclaration(node, 16 /* Function */, "__function", true); break; - case 174: - bindAnonymousDeclaration(node, 32, "__class", false); + case 174 /* ClassExpression */: + bindAnonymousDeclaration(node, 32 /* Class */, "__class", false); break; - case 223: + case 223 /* CatchClause */: bindCatchVariableDeclaration(node); break; - case 201: - bindDeclaration(node, 32, 899583, false); + case 201 /* ClassDeclaration */: + bindBlockScopedDeclaration(node, 32 /* Class */, 899583 /* ClassExcludes */); break; - case 202: - bindDeclaration(node, 64, 792992, false); + case 202 /* InterfaceDeclaration */: + bindDeclaration(node, 64 /* Interface */, 792992 /* InterfaceExcludes */, false); break; - case 203: - bindDeclaration(node, 524288, 793056, false); + case 203 /* TypeAliasDeclaration */: + bindDeclaration(node, 524288 /* TypeAlias */, 793056 /* TypeAliasExcludes */, false); break; - case 204: + case 204 /* EnumDeclaration */: if (ts.isConst(node)) { - bindDeclaration(node, 128, 899967, false); + bindDeclaration(node, 128 /* ConstEnum */, 899967 /* ConstEnumExcludes */, false); } else { - bindDeclaration(node, 256, 899327, false); + bindDeclaration(node, 256 /* RegularEnum */, 899327 /* RegularEnumExcludes */, false); } break; - case 205: + case 205 /* ModuleDeclaration */: bindModuleDeclaration(node); break; - case 208: - case 211: - case 213: - case 217: - bindDeclaration(node, 8388608, 8388608, false); + case 208 /* ImportEqualsDeclaration */: + case 211 /* NamespaceImport */: + case 213 /* ImportSpecifier */: + case 217 /* ExportSpecifier */: + bindDeclaration(node, 8388608 /* Alias */, 8388608 /* AliasExcludes */, false); break; - case 210: + case 210 /* ImportClause */: if (node.name) { - bindDeclaration(node, 8388608, 8388608, false); + bindDeclaration(node, 8388608 /* Alias */, 8388608 /* AliasExcludes */, false); } else { bindChildren(node, 0, false); } break; - case 215: + case 215 /* ExportDeclaration */: if (!node.exportClause) { - declareSymbol(container.symbol.exports, container.symbol, node, 1073741824, 0); + // All export * declarations are collected in an __export symbol + declareSymbol(container.symbol.exports, container.symbol, node, 1073741824 /* ExportStar */, 0); } bindChildren(node, 0, false); break; - case 214: - if (node.expression && node.expression.kind === 65) { - declareSymbol(container.symbol.exports, container.symbol, node, 8388608, 107455 | 8388608); + case 214 /* ExportAssignment */: + if (node.expression.kind === 65 /* Identifier */) { + // An export default clause with an identifier exports all meanings of that identifier + declareSymbol(container.symbol.exports, container.symbol, node, 8388608 /* Alias */, 107455 /* PropertyExcludes */ | 8388608 /* AliasExcludes */); } else { - declareSymbol(container.symbol.exports, container.symbol, node, 4, 107455 | 8388608); + // An export default clause with an expression exports a value + declareSymbol(container.symbol.exports, container.symbol, node, 4 /* Property */, 107455 /* PropertyExcludes */ | 8388608 /* AliasExcludes */); } bindChildren(node, 0, false); break; - case 227: + case 227 /* SourceFile */: setExportContextFlag(node); if (ts.isExternalModule(node)) { - bindAnonymousDeclaration(node, 512, '"' + ts.removeFileExtension(node.fileName) + '"', true); + bindAnonymousDeclaration(node, 512 /* ValueModule */, '"' + ts.removeFileExtension(node.fileName) + '"', true); break; } - case 179: + case 179 /* Block */: + // do not treat function block a block-scope container + // all block-scope locals that reside in this block should go to the function locals. + // Otherwise this won't be considered as redeclaration of a block scoped local: + // function foo() { + // let x; + // let x; + // } + // 'let x' will be placed into the function locals and 'let x' - into the locals of the block bindChildren(node, 0, !ts.isFunctionLike(node.parent)); break; - case 223: - case 186: - case 187: - case 188: - case 207: + case 223 /* CatchClause */: + case 186 /* ForStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: + case 207 /* CaseBlock */: bindChildren(node, 0, true); break; default: @@ -3736,16 +4089,18 @@ var ts; } function bindParameter(node) { if (ts.isBindingPattern(node.name)) { - bindAnonymousDeclaration(node, 1, getDestructuringParameterName(node), false); + bindAnonymousDeclaration(node, 1 /* FunctionScopedVariable */, getDestructuringParameterName(node), false); } else { - bindDeclaration(node, 1, 107455, false); + bindDeclaration(node, 1 /* FunctionScopedVariable */, 107455 /* ParameterExcludes */, false); } - if (node.flags & 112 && - node.parent.kind === 135 && - (node.parent.parent.kind === 201 || node.parent.parent.kind === 174)) { + // If this is a property-parameter, then also declare the property symbol into the + // containing class. + if (node.flags & 112 /* AccessibilityModifier */ && + node.parent.kind === 135 /* Constructor */ && + (node.parent.parent.kind === 201 /* ClassDeclaration */ || node.parent.parent.kind === 174 /* ClassExpression */)) { var classDeclaration = node.parent.parent; - declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4, 107455); + declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 /* Property */, 107455 /* PropertyExcludes */); } } function bindPropertyOrMethodOrAccessor(node, symbolKind, symbolExcludes, isBlockScopeContainer) { @@ -3759,6 +4114,7 @@ var ts; } })(ts || (ts = {})); /// +/* @internal */ var ts; (function (ts) { function getDeclarationOfKind(symbol, kind) { @@ -3772,6 +4128,7 @@ var ts; return undefined; } ts.getDeclarationOfKind = getDeclarationOfKind; + // Pool writers to avoid needing to allocate them for every symbol we write. var stringWriters = []; function getSingleLineStringWriter() { if (stringWriters.length == 0) { @@ -3786,6 +4143,8 @@ var ts; writeStringLiteral: writeText, writeParameter: writeText, writeSymbol: writeText, + // Completely ignore indentation for string writers. And map newlines to + // a single space. writeLine: function () { return str += " "; }, increaseIndent: function () { }, decreaseIndent: function () { }, @@ -3805,23 +4164,31 @@ var ts; return node.end - node.pos; } ts.getFullWidth = getFullWidth; + // Returns true if this node contains a parse error anywhere underneath it. function containsParseError(node) { aggregateChildData(node); - return (node.parserContextFlags & 64) !== 0; + return (node.parserContextFlags & 64 /* ThisNodeOrAnySubNodesHasError */) !== 0; } ts.containsParseError = containsParseError; function aggregateChildData(node) { - if (!(node.parserContextFlags & 128)) { - var thisNodeOrAnySubNodesHasError = ((node.parserContextFlags & 32) !== 0) || + if (!(node.parserContextFlags & 128 /* HasAggregatedChildData */)) { + // A node is considered to contain a parse error if: + // a) the parser explicitly marked that it had an error + // b) any of it's children reported that it had an error. + var thisNodeOrAnySubNodesHasError = ((node.parserContextFlags & 32 /* ThisNodeHasError */) !== 0) || ts.forEachChild(node, containsParseError); + // If so, mark ourselves accordingly. if (thisNodeOrAnySubNodesHasError) { - node.parserContextFlags |= 64; + node.parserContextFlags |= 64 /* ThisNodeOrAnySubNodesHasError */; } - node.parserContextFlags |= 128; + // Also mark that we've propogated the child information to this node. This way we can + // always consult the bit directly on this node without needing to check its children + // again. + node.parserContextFlags |= 128 /* HasAggregatedChildData */; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 227) { + while (node && node.kind !== 227 /* SourceFile */) { node = node.parent; } return node; @@ -3832,6 +4199,7 @@ var ts; return ts.getLineStarts(sourceFile)[line]; } ts.getStartPositionOfLine = getStartPositionOfLine; + // This is a useful function for debugging purposes. function nodePosToString(node) { var file = getSourceFileOfNode(node); var loc = ts.getLineAndCharacterOfPosition(file, node.pos); @@ -3842,11 +4210,23 @@ var ts; return node.pos; } ts.getStartPosOfNode = getStartPosOfNode; + // Returns true if this node is missing from the actual source code. 'missing' is different + // from 'undefined/defined'. When a node is undefined (which can happen for optional nodes + // in the tree), it is definitel missing. HOwever, a node may be defined, but still be + // missing. This happens whenever the parser knows it needs to parse something, but can't + // get anything in the source code that it expects at that location. For example: + // + // let a: ; + // + // Here, the Type in the Type-Annotation is not-optional (as there is a colon in the source + // code). So the parser will attempt to parse out a type, and will create an actual node. + // However, this node will be 'missing' in the sense that no actual source-code/tokens are + // contained within it. function nodeIsMissing(node) { if (!node) { return true; } - return node.pos === node.end && node.kind !== 1; + return node.pos === node.end && node.kind !== 1 /* EndOfFileToken */; } ts.nodeIsMissing = nodeIsMissing; function nodeIsPresent(node) { @@ -3854,12 +4234,21 @@ var ts; } ts.nodeIsPresent = nodeIsPresent; function getTokenPosOfNode(node, sourceFile) { + // With nodes that have no width (i.e. 'Missing' nodes), we actually *don't* + // want to skip trivia because this will launch us forward to the next token. if (nodeIsMissing(node)) { return node.pos; } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); } ts.getTokenPosOfNode = getTokenPosOfNode; + function getNonDecoratorTokenPosOfNode(node, sourceFile) { + if (nodeIsMissing(node) || !node.decorators) { + return getTokenPosOfNode(node, sourceFile); + } + return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.decorators.end); + } + ts.getNonDecoratorTokenPosOfNode = getNonDecoratorTokenPosOfNode; function getSourceTextOfNodeFromSourceFile(sourceFile, node) { if (nodeIsMissing(node)) { return ""; @@ -3879,39 +4268,47 @@ var ts; return getSourceTextOfNodeFromSourceFile(getSourceFileOfNode(node), node); } ts.getTextOfNode = getTextOfNode; + // Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like '__proto__' function escapeIdentifier(identifier) { - return identifier.length >= 2 && identifier.charCodeAt(0) === 95 && identifier.charCodeAt(1) === 95 ? "_" + identifier : identifier; + return identifier.length >= 2 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ ? "_" + identifier : identifier; } ts.escapeIdentifier = escapeIdentifier; + // Remove extra underscore from escaped identifier function unescapeIdentifier(identifier) { - return identifier.length >= 3 && identifier.charCodeAt(0) === 95 && identifier.charCodeAt(1) === 95 && identifier.charCodeAt(2) === 95 ? identifier.substr(1) : identifier; + return identifier.length >= 3 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ && identifier.charCodeAt(2) === 95 /* _ */ ? identifier.substr(1) : identifier; } ts.unescapeIdentifier = unescapeIdentifier; + // Make an identifier from an external module name by extracting the string after the last "/" and replacing + // all non-alphanumeric characters with underscores function makeIdentifierFromModuleName(moduleName) { return ts.getBaseFileName(moduleName).replace(/\W/g, "_"); } ts.makeIdentifierFromModuleName = makeIdentifierFromModuleName; function isBlockOrCatchScoped(declaration) { - return (getCombinedNodeFlags(declaration) & 12288) !== 0 || + return (getCombinedNodeFlags(declaration) & 12288 /* BlockScoped */) !== 0 || isCatchClauseVariableDeclaration(declaration); } ts.isBlockOrCatchScoped = isBlockOrCatchScoped; + // Gets the nearest enclosing block scope container that has the provided node + // as a descendant, that is not the provided node. function getEnclosingBlockScopeContainer(node) { - var current = node; + var current = node.parent; while (current) { if (isFunctionLike(current)) { return current; } switch (current.kind) { - case 227: - case 207: - case 223: - case 205: - case 186: - case 187: - case 188: + case 227 /* SourceFile */: + case 207 /* CaseBlock */: + case 223 /* CatchClause */: + case 205 /* ModuleDeclaration */: + case 186 /* ForStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: return current; - case 179: + case 179 /* Block */: + // function block is not considered block-scope container + // see comment in binder.ts: bind(...), case for SyntaxKind.Block if (!isFunctionLike(current.parent)) { return current; } @@ -3922,11 +4319,14 @@ var ts; ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; function isCatchClauseVariableDeclaration(declaration) { return declaration && - declaration.kind === 198 && + declaration.kind === 198 /* VariableDeclaration */ && declaration.parent && - declaration.parent.kind === 223; + declaration.parent.kind === 223 /* CatchClause */; } ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration; + // Return display name of an identifier + // Computed property names will just be emitted as "[]", where is the source + // text of the expression in the computed property. function declarationNameToString(name) { return getFullWidth(name) === 0 ? "(Missing)" : getTextOfNode(name); } @@ -3951,42 +4351,46 @@ var ts; } ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain; function getSpanOfTokenAtPosition(sourceFile, pos) { - var scanner = ts.createScanner(sourceFile.languageVersion, true, sourceFile.text); - scanner.setTextPos(pos); + var scanner = ts.createScanner(sourceFile.languageVersion, true, sourceFile.text, undefined, pos); scanner.scan(); var start = scanner.getTokenPos(); - return createTextSpanFromBounds(start, scanner.getTextPos()); + return ts.createTextSpanFromBounds(start, scanner.getTextPos()); } ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 227: + case 227 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, false); if (pos_1 === sourceFile.text.length) { - return createTextSpan(0, 0); + // file is empty - return span for the beginning of the file + return ts.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 162: + // This list is a work in progress. Add missing node kinds to improve their error + // spans. + case 198 /* VariableDeclaration */: + case 152 /* BindingElement */: + case 201 /* ClassDeclaration */: + case 174 /* ClassExpression */: + case 202 /* InterfaceDeclaration */: + case 205 /* ModuleDeclaration */: + case 204 /* EnumDeclaration */: + case 226 /* EnumMember */: + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: 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. return getSpanOfTokenAtPosition(sourceFile, node.pos); } var pos = nodeIsMissing(errorNode) ? errorNode.pos : ts.skipTrivia(sourceFile.text, errorNode.pos); - return createTextSpanFromBounds(pos, errorNode.end); + return ts.createTextSpanFromBounds(pos, errorNode.end); } ts.getErrorSpanForNode = getErrorSpanForNode; function isExternalModule(file) { @@ -3994,49 +4398,61 @@ var ts; } ts.isExternalModule = isExternalModule; function isDeclarationFile(file) { - return (file.flags & 2048) !== 0; + return (file.flags & 2048 /* DeclarationFile */) !== 0; } ts.isDeclarationFile = isDeclarationFile; function isConstEnumDeclaration(node) { - return node.kind === 204 && isConst(node); + return node.kind === 204 /* EnumDeclaration */ && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 152 || isBindingPattern(node))) { + while (node && (node.kind === 152 /* BindingElement */ || isBindingPattern(node))) { node = node.parent; } return node; } + // Returns the node flags for this node and all relevant parent nodes. This is done so that + // nodes like variable declarations and binding elements can returned a view of their flags + // that includes the modifiers from their container. i.e. flags like export/declare aren't + // stored on the variable declaration directly, but on the containing variable statement + // (if it has one). Similarly, flags for let/const are store on the variable declaration + // list. By calling this function, all those flags are combined so that the client can treat + // the node as if it actually had those flags. function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 198) { + if (node.kind === 198 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 199) { + if (node && node.kind === 199 /* VariableDeclarationList */) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 180) { + if (node && node.kind === 180 /* VariableStatement */) { flags |= node.flags; } return flags; } ts.getCombinedNodeFlags = getCombinedNodeFlags; function isConst(node) { - return !!(getCombinedNodeFlags(node) & 8192); + return !!(getCombinedNodeFlags(node) & 8192 /* Const */); } ts.isConst = isConst; function isLet(node) { - return !!(getCombinedNodeFlags(node) & 4096); + return !!(getCombinedNodeFlags(node) & 4096 /* Let */); } ts.isLet = isLet; function isPrologueDirective(node) { - return node.kind === 182 && node.expression.kind === 8; + return node.kind === 182 /* ExpressionStatement */ && node.expression.kind === 8 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { - if (node.kind === 129 || node.kind === 128) { + // If parameter/type parameter, the prev token trailing comments are part of this node too + if (node.kind === 129 /* Parameter */ || node.kind === 128 /* TypeParameter */) { + // e.g. (/** blah */ a, /** blah */ b); + // e.g.: ( + // /** blah */ a, + // /** blah */ b); return ts.concatenate(ts.getTrailingCommentRanges(sourceFileOfNode.text, node.pos), ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos)); } else { @@ -4047,34 +4463,37 @@ 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; + // True if the comment starts with '/**' but not if it is '/**/' + return sourceFileOfNode.text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && + sourceFileOfNode.text.charCodeAt(comment.pos + 2) === 42 /* asterisk */ && + sourceFileOfNode.text.charCodeAt(comment.pos + 3) !== 47 /* slash */; } } ts.getJsDocComments = getJsDocComments; ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; + // Warning: This has the same semantics as the forEach family of functions, + // in that traversal terminates in the event that 'visitor' supplies a truthy value. function forEachReturnStatement(body, visitor) { return traverse(body); function traverse(node) { switch (node.kind) { - case 191: + case 191 /* ReturnStatement */: return visitor(node); - case 207: - case 179: - case 183: - case 184: - case 185: - case 186: - case 187: - case 188: - case 192: - case 193: - case 220: - case 221: - case 194: - case 196: - case 223: + case 207 /* CaseBlock */: + case 179 /* Block */: + case 183 /* IfStatement */: + case 184 /* DoStatement */: + case 185 /* WhileStatement */: + case 186 /* ForStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: + case 192 /* WithStatement */: + case 193 /* SwitchStatement */: + case 220 /* CaseClause */: + case 221 /* DefaultClause */: + case 194 /* LabeledStatement */: + case 196 /* TryStatement */: + case 223 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -4083,39 +4502,50 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 152: - case 226: - case 129: - case 224: - case 132: - case 131: - case 225: - case 198: + case 152 /* BindingElement */: + case 226 /* EnumMember */: + case 129 /* Parameter */: + case 224 /* PropertyAssignment */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 225 /* ShorthandPropertyAssignment */: + case 198 /* VariableDeclaration */: return true; } } return false; } ts.isVariableLike = isVariableLike; + function isAccessor(node) { + if (node) { + switch (node.kind) { + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + return true; + } + } + return false; + } + ts.isAccessor = isAccessor; function isFunctionLike(node) { if (node) { switch (node.kind) { - case 135: - case 162: - case 200: - case 163: - case 134: - case 133: - case 136: - case 137: - case 138: - case 139: - case 140: - case 142: - case 143: - case 162: - case 163: - case 200: + case 135 /* Constructor */: + case 162 /* FunctionExpression */: + case 200 /* FunctionDeclaration */: + case 163 /* ArrowFunction */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 138 /* CallSignature */: + case 139 /* ConstructSignature */: + case 140 /* IndexSignature */: + case 142 /* FunctionType */: + case 143 /* ConstructorType */: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: + case 200 /* FunctionDeclaration */: return true; } } @@ -4123,11 +4553,11 @@ var ts; } ts.isFunctionLike = isFunctionLike; function isFunctionBlock(node) { - return node && node.kind === 179 && isFunctionLike(node.parent); + return node && node.kind === 179 /* Block */ && isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 134 && node.parent.kind === 154; + return node && node.kind === 134 /* MethodDeclaration */ && node.parent.kind === 154 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function getContainingFunction(node) { @@ -4146,28 +4576,51 @@ var ts; return undefined; } switch (node.kind) { - case 127: - if (node.parent.parent.kind === 201) { + case 127 /* ComputedPropertyName */: + // If the grandparent node is an object literal (as opposed to a class), + // then the computed property is not a 'this' container. + // A computed property name in a class needs to be a this container + // so that we can error on it. + if (node.parent.parent.kind === 201 /* ClassDeclaration */) { return node; } + // If this is a computed property, then the parent should not + // make it a this container. The parent might be a property + // in an object literal, like a method or accessor. But in order for + // such a parent to be a this container, the reference must be in + // the *body* of the container. node = node.parent; break; - case 163: + case 130 /* Decorator */: + // Decorators are always applied outside of the body of a class or method. + if (node.parent.kind === 129 /* Parameter */ && isClassElement(node.parent.parent)) { + // If 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 163 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } - case 200: - case 162: - case 205: - case 132: - case 131: - case 134: - case 133: - case 135: - case 136: - case 137: - case 204: - case 227: + // Fall through + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: + case 205 /* ModuleDeclaration */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 135 /* Constructor */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 204 /* EnumDeclaration */: + case 227 /* SourceFile */: return node; } } @@ -4179,73 +4632,100 @@ var ts; if (!node) return node; switch (node.kind) { - case 127: - if (node.parent.parent.kind === 201) { + case 127 /* ComputedPropertyName */: + // If the grandparent node is an object literal (as opposed to a class), + // then the computed property is not a 'super' container. + // A computed property name in a class needs to be a super container + // so that we can error on it. + if (node.parent.parent.kind === 201 /* ClassDeclaration */) { return node; } + // If this is a computed property, then the parent should not + // make it a super container. The parent might be a property + // in an object literal, like a method or accessor. But in order for + // such a parent to be a super container, the reference must be in + // the *body* of the container. node = node.parent; break; - case 200: - case 162: - case 163: + case 130 /* Decorator */: + // Decorators are always applied outside of the body of a class or method. + if (node.parent.kind === 129 /* Parameter */ && isClassElement(node.parent.parent)) { + // If 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 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: if (!includeFunctions) { continue; } - case 132: - case 131: - case 134: - case 133: - case 135: - case 136: - case 137: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 135 /* Constructor */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: return node; } } } ts.getSuperContainer = getSuperContainer; function getInvokedExpression(node) { - if (node.kind === 159) { + if (node.kind === 159 /* TaggedTemplateExpression */) { return node.tag; } + // Will either be a CallExpression or NewExpression. return node.expression; } ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node) { switch (node.kind) { - case 201: + case 201 /* ClassDeclaration */: + // classes are valid targets 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; + case 132 /* PropertyDeclaration */: + // property declarations are valid if their parent is a class declaration. + return node.parent.kind === 201 /* ClassDeclaration */; + case 129 /* Parameter */: + // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; + return node.parent.body && node.parent.parent.kind === 201 /* ClassDeclaration */; + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 134 /* MethodDeclaration */: + // if this method has a body and its parent is a class declaration, this is a valid target. + return node.body && node.parent.kind === 201 /* ClassDeclaration */; } return false; } ts.nodeCanBeDecorated = nodeCanBeDecorated; function nodeIsDecorated(node) { switch (node.kind) { - case 201: + case 201 /* ClassDeclaration */: if (node.decorators) { return true; } return false; - case 132: - case 129: + case 132 /* PropertyDeclaration */: + case 129 /* Parameter */: if (node.decorators) { return true; } return false; - case 136: + case 136 /* GetAccessor */: if (node.body && node.decorators) { return true; } return false; - case 134: - case 137: + case 134 /* MethodDeclaration */: + case 137 /* SetAccessor */: if (node.body && node.decorators) { return true; } @@ -4256,10 +4736,10 @@ var ts; ts.nodeIsDecorated = nodeIsDecorated; function childIsDecorated(node) { switch (node.kind) { - case 201: + case 201 /* ClassDeclaration */: return ts.forEach(node.members, nodeOrChildIsDecorated); - case 134: - case 137: + case 134 /* MethodDeclaration */: + case 137 /* SetAccessor */: return ts.forEach(node.parameters, nodeIsDecorated); } return false; @@ -4271,84 +4751,87 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function isExpression(node) { switch (node.kind) { - case 93: - case 91: - case 89: - case 95: - case 80: - case 9: - case 153: - case 154: - case 155: - case 156: - case 157: - case 158: - case 159: - case 160: - case 161: - case 162: - case 174: - case 163: - case 166: - case 164: - case 165: - case 167: - case 168: - case 169: - case 170: - case 173: - case 171: - case 10: - case 175: + case 93 /* ThisKeyword */: + case 91 /* SuperKeyword */: + case 89 /* NullKeyword */: + case 95 /* TrueKeyword */: + case 80 /* FalseKeyword */: + case 9 /* RegularExpressionLiteral */: + case 153 /* ArrayLiteralExpression */: + case 154 /* ObjectLiteralExpression */: + case 155 /* PropertyAccessExpression */: + case 156 /* ElementAccessExpression */: + case 157 /* CallExpression */: + case 158 /* NewExpression */: + case 159 /* TaggedTemplateExpression */: + case 160 /* TypeAssertionExpression */: + case 161 /* ParenthesizedExpression */: + case 162 /* FunctionExpression */: + case 174 /* ClassExpression */: + case 163 /* ArrowFunction */: + case 166 /* VoidExpression */: + case 164 /* DeleteExpression */: + case 165 /* TypeOfExpression */: + case 167 /* PrefixUnaryExpression */: + case 168 /* PostfixUnaryExpression */: + case 169 /* BinaryExpression */: + case 170 /* ConditionalExpression */: + case 173 /* SpreadElementExpression */: + case 171 /* TemplateExpression */: + case 10 /* NoSubstitutionTemplateLiteral */: + case 175 /* OmittedExpression */: return true; - case 126: - while (node.parent.kind === 126) { + case 126 /* QualifiedName */: + while (node.parent.kind === 126 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 144; - case 65: - if (node.parent.kind === 144) { + return node.parent.kind === 144 /* TypeQuery */; + case 65 /* Identifier */: + if (node.parent.kind === 144 /* TypeQuery */) { return true; } - case 7: - case 8: + // fall through + case 7 /* NumericLiteral */: + case 8 /* StringLiteral */: var parent_1 = node.parent; switch (parent_1.kind) { - case 198: - case 129: - case 132: - case 131: - case 226: - case 224: - case 152: + case 198 /* VariableDeclaration */: + case 129 /* Parameter */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 226 /* EnumMember */: + case 224 /* PropertyAssignment */: + case 152 /* BindingElement */: return parent_1.initializer === node; - case 182: - case 183: - case 184: - case 185: - case 191: - case 192: - case 193: - case 220: - case 195: - case 193: + case 182 /* ExpressionStatement */: + case 183 /* IfStatement */: + case 184 /* DoStatement */: + case 185 /* WhileStatement */: + case 191 /* ReturnStatement */: + case 192 /* WithStatement */: + case 193 /* SwitchStatement */: + case 220 /* CaseClause */: + case 195 /* ThrowStatement */: + case 193 /* SwitchStatement */: return parent_1.expression === node; - case 186: + case 186 /* ForStatement */: var forStatement = parent_1; - return (forStatement.initializer === node && forStatement.initializer.kind !== 199) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 199 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.iterator === node; - case 187: - case 188: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: var forInStatement = parent_1; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 199) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 199 /* VariableDeclarationList */) || forInStatement.expression === node; - case 160: + case 160 /* TypeAssertionExpression */: return node === parent_1.expression; - case 176: + case 176 /* TemplateSpan */: return node === parent_1.expression; - case 127: + case 127 /* ComputedPropertyName */: return node === parent_1.expression; + case 130 /* Decorator */: + return true; default: if (isExpression(parent_1)) { return true; @@ -4360,12 +4843,12 @@ var ts; ts.isExpression = isExpression; function isInstantiatedModule(node, preserveConstEnums) { var moduleState = ts.getModuleInstanceState(node); - return moduleState === 1 || - (preserveConstEnums && moduleState === 2); + return moduleState === 1 /* Instantiated */ || + (preserveConstEnums && moduleState === 2 /* ConstEnumOnly */); } ts.isInstantiatedModule = isInstantiatedModule; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 208 && node.moduleReference.kind === 219; + return node.kind === 208 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 219 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -4374,40 +4857,40 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 208 && node.moduleReference.kind !== 219; + return node.kind === 208 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 219 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function getExternalModuleName(node) { - if (node.kind === 209) { + if (node.kind === 209 /* ImportDeclaration */) { return node.moduleSpecifier; } - if (node.kind === 208) { + if (node.kind === 208 /* ImportEqualsDeclaration */) { var reference = node.moduleReference; - if (reference.kind === 219) { + if (reference.kind === 219 /* ExternalModuleReference */) { return reference.expression; } } - if (node.kind === 215) { + if (node.kind === 215 /* ExportDeclaration */) { return node.moduleSpecifier; } } ts.getExternalModuleName = getExternalModuleName; function hasDotDotDotToken(node) { - return node && node.kind === 129 && node.dotDotDotToken !== undefined; + return node && node.kind === 129 /* Parameter */ && node.dotDotDotToken !== undefined; } ts.hasDotDotDotToken = hasDotDotDotToken; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 129: + case 129 /* Parameter */: return node.questionToken !== undefined; - case 134: - case 133: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: return node.questionToken !== undefined; - case 225: - case 224: - case 132: - case 131: + case 225 /* ShorthandPropertyAssignment */: + case 224 /* PropertyAssignment */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -4419,24 +4902,24 @@ var ts; } ts.hasRestParameters = hasRestParameters; function isLiteralKind(kind) { - return 7 <= kind && kind <= 10; + return 7 /* FirstLiteralToken */ <= kind && kind <= 10 /* LastLiteralToken */; } ts.isLiteralKind = isLiteralKind; function isTextualLiteralKind(kind) { - return kind === 8 || kind === 10; + return kind === 8 /* StringLiteral */ || kind === 10 /* NoSubstitutionTemplateLiteral */; } ts.isTextualLiteralKind = isTextualLiteralKind; function isTemplateLiteralKind(kind) { - return 10 <= kind && kind <= 13; + return 10 /* FirstTemplateToken */ <= kind && kind <= 13 /* LastTemplateToken */; } ts.isTemplateLiteralKind = isTemplateLiteralKind; function isBindingPattern(node) { - return !!node && (node.kind === 151 || node.kind === 150); + return !!node && (node.kind === 151 /* ArrayBindingPattern */ || node.kind === 150 /* ObjectBindingPattern */); } ts.isBindingPattern = isBindingPattern; function isInAmbientContext(node) { while (node) { - if (node.flags & (2 | 2048)) { + if (node.flags & (2 /* Ambient */ | 2048 /* DeclarationFile */)) { return true; } node = node.parent; @@ -4446,33 +4929,33 @@ var ts; ts.isInAmbientContext = isInAmbientContext; function isDeclaration(node) { switch (node.kind) { - case 163: - case 152: - case 201: - case 135: - case 204: - case 226: - case 217: - case 200: - case 162: - case 136: - case 210: - case 208: - case 213: - case 202: - case 134: - case 133: - case 205: - case 211: - case 129: - case 224: - case 132: - case 131: - case 137: - case 225: - case 203: - case 128: - case 198: + case 163 /* ArrowFunction */: + case 152 /* BindingElement */: + case 201 /* ClassDeclaration */: + case 135 /* Constructor */: + case 204 /* EnumDeclaration */: + case 226 /* EnumMember */: + case 217 /* ExportSpecifier */: + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: + case 136 /* GetAccessor */: + case 210 /* ImportClause */: + case 208 /* ImportEqualsDeclaration */: + case 213 /* ImportSpecifier */: + case 202 /* InterfaceDeclaration */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 205 /* ModuleDeclaration */: + case 211 /* NamespaceImport */: + case 129 /* Parameter */: + case 224 /* PropertyAssignment */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 137 /* SetAccessor */: + case 225 /* ShorthandPropertyAssignment */: + case 203 /* TypeAliasDeclaration */: + case 128 /* TypeParameter */: + case 198 /* VariableDeclaration */: return true; } return false; @@ -4480,25 +4963,25 @@ var ts; ts.isDeclaration = isDeclaration; function isStatement(n) { switch (n.kind) { - case 190: - case 189: - case 197: - case 184: - case 182: - case 181: - case 187: - case 188: - case 186: - case 183: - case 194: - case 191: - case 193: - case 94: - case 196: - case 180: - case 185: - case 192: - case 214: + case 190 /* BreakStatement */: + case 189 /* ContinueStatement */: + case 197 /* DebuggerStatement */: + case 184 /* DoStatement */: + case 182 /* ExpressionStatement */: + case 181 /* EmptyStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: + case 186 /* ForStatement */: + case 183 /* IfStatement */: + case 194 /* LabeledStatement */: + case 191 /* ReturnStatement */: + case 193 /* SwitchStatement */: + case 94 /* ThrowKeyword */: + case 196 /* TryStatement */: + case 180 /* VariableStatement */: + case 185 /* WhileStatement */: + case 192 /* WithStatement */: + case 214 /* ExportAssignment */: return true; default: return false; @@ -4507,24 +4990,26 @@ var ts; ts.isStatement = isStatement; function isClassElement(n) { switch (n.kind) { - case 135: - case 132: - case 134: - case 136: - case 137: - case 140: + case 135 /* Constructor */: + case 132 /* PropertyDeclaration */: + case 134 /* MethodDeclaration */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 133 /* MethodSignature */: + case 140 /* IndexSignature */: return true; default: return false; } } ts.isClassElement = isClassElement; + // True if the given identifier, string literal, or number literal is the name of a declaration node function isDeclarationName(name) { - if (name.kind !== 65 && name.kind !== 8 && name.kind !== 7) { + if (name.kind !== 65 /* Identifier */ && name.kind !== 8 /* StringLiteral */ && name.kind !== 7 /* NumericLiteral */) { return false; } var parent = name.parent; - if (parent.kind === 213 || parent.kind === 217) { + if (parent.kind === 213 /* ImportSpecifier */ || parent.kind === 217 /* ExportSpecifier */) { if (parent.propertyName) { return true; } @@ -4535,27 +5020,35 @@ var ts; return false; } ts.isDeclarationName = isDeclarationName; + // An alias symbol is created by one of the following declarations: + // import = ... + // import from ... + // import * as from ... + // import { x as } from ... + // export { x as } from ... + // export = ... + // export default ... function isAliasSymbolDeclaration(node) { - return node.kind === 208 || - node.kind === 210 && !!node.name || - node.kind === 211 || - node.kind === 213 || - node.kind === 217 || - node.kind === 214 && node.expression.kind === 65; + return node.kind === 208 /* ImportEqualsDeclaration */ || + node.kind === 210 /* ImportClause */ && !!node.name || + node.kind === 211 /* NamespaceImport */ || + node.kind === 213 /* ImportSpecifier */ || + node.kind === 217 /* ExportSpecifier */ || + node.kind === 214 /* ExportAssignment */ && node.expression.kind === 65 /* Identifier */; } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getClassExtendsHeritageClauseElement(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 79); + var heritageClause = getHeritageClause(node.heritageClauses, 79 /* ExtendsKeyword */); return heritageClause && heritageClause.types.length > 0 ? heritageClause.types[0] : undefined; } ts.getClassExtendsHeritageClauseElement = getClassExtendsHeritageClauseElement; function getClassImplementsHeritageClauseElements(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 103); + var heritageClause = getHeritageClause(node.heritageClauses, 102 /* ImplementsKeyword */); return heritageClause ? heritageClause.types : undefined; } ts.getClassImplementsHeritageClauseElements = getClassImplementsHeritageClauseElements; function getInterfaceBaseTypeNodes(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 79); + var heritageClause = getHeritageClause(node.heritageClauses, 79 /* ExtendsKeyword */); return heritageClause ? heritageClause.types : undefined; } ts.getInterfaceBaseTypeNodes = getInterfaceBaseTypeNodes; @@ -4624,28 +5117,40 @@ var ts; } ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; function isKeyword(token) { - return 66 <= token && token <= 125; + return 66 /* FirstKeyword */ <= token && token <= 125 /* LastKeyword */; } ts.isKeyword = isKeyword; function isTrivia(token) { - return 2 <= token && token <= 6; + return 2 /* FirstTriviaToken */ <= token && token <= 6 /* LastTriviaToken */; } ts.isTrivia = isTrivia; + /** + * A declaration has a dynamic name if both of the following are true: + * 1. The declaration has a computed property name + * 2. The computed name is *not* expressed as Symbol., where name + * is a property of the Symbol constructor that denotes a built in + * Symbol. + */ function hasDynamicName(declaration) { return declaration.name && - declaration.name.kind === 127 && + declaration.name.kind === 127 /* ComputedPropertyName */ && !isWellKnownSymbolSyntactically(declaration.name.expression); } ts.hasDynamicName = hasDynamicName; + /** + * Checks if the expression is of the form: + * Symbol.name + * where Symbol is literally the word "Symbol", and name is any identifierName + */ function isWellKnownSymbolSyntactically(node) { - return node.kind === 155 && isESSymbolIdentifier(node.expression); + return node.kind === 155 /* PropertyAccessExpression */ && isESSymbolIdentifier(node.expression); } ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically; function getPropertyNameForPropertyNameNode(name) { - if (name.kind === 65 || name.kind === 8 || name.kind === 7) { + if (name.kind === 65 /* Identifier */ || name.kind === 8 /* StringLiteral */ || name.kind === 7 /* NumericLiteral */) { return name.text; } - if (name.kind === 127) { + if (name.kind === 127 /* ComputedPropertyName */) { var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { var rightHandSideName = nameExpression.name.text; @@ -4659,136 +5164,30 @@ var ts; return "__@" + symbolName; } ts.getPropertyNameForKnownSymbolName = getPropertyNameForKnownSymbolName; + /** + * Includes the word "Symbol" with unicode escapes + */ function isESSymbolIdentifier(node) { - return node.kind === 65 && node.text === "Symbol"; + return node.kind === 65 /* Identifier */ && node.text === "Symbol"; } ts.isESSymbolIdentifier = isESSymbolIdentifier; function isModifier(token) { switch (token) { - case 109: - case 107: - case 108: - case 110: - case 78: - case 115: - case 70: - case 73: + case 108 /* PublicKeyword */: + case 106 /* PrivateKeyword */: + case 107 /* ProtectedKeyword */: + case 109 /* StaticKeyword */: + case 78 /* ExportKeyword */: + case 115 /* DeclareKeyword */: + case 70 /* ConstKeyword */: + case 73 /* DefaultKeyword */: return true; } return false; } ts.isModifier = isModifier; - function textSpanEnd(span) { - return span.start + span.length; - } - ts.textSpanEnd = textSpanEnd; - function textSpanIsEmpty(span) { - return span.length === 0; - } - ts.textSpanIsEmpty = textSpanIsEmpty; - function textSpanContainsPosition(span, position) { - return position >= span.start && position < textSpanEnd(span); - } - ts.textSpanContainsPosition = textSpanContainsPosition; - function textSpanContainsTextSpan(span, other) { - return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span); - } - ts.textSpanContainsTextSpan = textSpanContainsTextSpan; - function textSpanOverlapsWith(span, other) { - var overlapStart = Math.max(span.start, other.start); - var overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other)); - return overlapStart < overlapEnd; - } - ts.textSpanOverlapsWith = textSpanOverlapsWith; - function textSpanOverlap(span1, span2) { - var overlapStart = Math.max(span1.start, span2.start); - var overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); - if (overlapStart < overlapEnd) { - return createTextSpanFromBounds(overlapStart, overlapEnd); - } - return undefined; - } - ts.textSpanOverlap = textSpanOverlap; - function textSpanIntersectsWithTextSpan(span, other) { - return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start; - } - ts.textSpanIntersectsWithTextSpan = textSpanIntersectsWithTextSpan; - function textSpanIntersectsWith(span, start, length) { - var end = start + length; - return start <= textSpanEnd(span) && end >= span.start; - } - ts.textSpanIntersectsWith = textSpanIntersectsWith; - function textSpanIntersectsWithPosition(span, position) { - return position <= textSpanEnd(span) && position >= span.start; - } - ts.textSpanIntersectsWithPosition = textSpanIntersectsWithPosition; - function textSpanIntersection(span1, span2) { - var intersectStart = Math.max(span1.start, span2.start); - var intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); - if (intersectStart <= intersectEnd) { - return createTextSpanFromBounds(intersectStart, intersectEnd); - } - return undefined; - } - ts.textSpanIntersection = textSpanIntersection; - function createTextSpan(start, length) { - if (start < 0) { - throw new Error("start < 0"); - } - if (length < 0) { - throw new Error("length < 0"); - } - return { start: start, length: length }; - } - ts.createTextSpan = createTextSpan; - function createTextSpanFromBounds(start, end) { - return createTextSpan(start, end - start); - } - ts.createTextSpanFromBounds = createTextSpanFromBounds; - function textChangeRangeNewSpan(range) { - return createTextSpan(range.span.start, range.newLength); - } - ts.textChangeRangeNewSpan = textChangeRangeNewSpan; - function textChangeRangeIsUnchanged(range) { - return textSpanIsEmpty(range.span) && range.newLength === 0; - } - ts.textChangeRangeIsUnchanged = textChangeRangeIsUnchanged; - function createTextChangeRange(span, newLength) { - if (newLength < 0) { - throw new Error("newLength < 0"); - } - return { span: span, newLength: newLength }; - } - ts.createTextChangeRange = createTextChangeRange; - ts.unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0); - function collapseTextChangeRangesAcrossMultipleVersions(changes) { - if (changes.length === 0) { - return ts.unchangedTextChangeRange; - } - if (changes.length === 1) { - return changes[0]; - } - var change0 = changes[0]; - var oldStartN = change0.span.start; - var oldEndN = textSpanEnd(change0.span); - var newEndN = oldStartN + change0.newLength; - for (var i = 1; i < changes.length; i++) { - var nextChange = changes[i]; - var oldStart1 = oldStartN; - var oldEnd1 = oldEndN; - var newEnd1 = newEndN; - var oldStart2 = nextChange.span.start; - var oldEnd2 = textSpanEnd(nextChange.span); - var newEnd2 = oldStart2 + nextChange.newLength; - oldStartN = Math.min(oldStart1, oldStart2); - oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)); - newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)); - } - return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), newEndN - oldStartN); - } - ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function nodeStartsNewLexicalEnvironment(n) { - return isFunctionLike(n) || n.kind === 205 || n.kind === 227; + return isFunctionLike(n) || n.kind === 205 /* ModuleDeclaration */ || n.kind === 227 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(node) { @@ -4803,6 +5202,13 @@ var ts; return node; } ts.createSynthesizedNode = createSynthesizedNode; + function createSynthesizedNodeArray() { + var array = []; + array.pos = -1; + array.end = -1; + return array; + } + ts.createSynthesizedNodeArray = createSynthesizedNodeArray; function createDiagnosticCollection() { var nonFileDiagnostics = []; var fileDiagnostics = {}; @@ -4868,6 +5274,11 @@ var ts; } } ts.createDiagnosticCollection = createDiagnosticCollection; + // This consists of the first 19 unprintable ASCII characters, canonical escapes, lineSeparator, + // paragraphSeparator, and nextLine. The latter three are just desirable to suppress new lines in + // the language service. These characters should be escaped when printing, and if any characters are added, + // the map below must be updated. Note that this regexp *does not* include the 'delete' character. + // There is no reason for this other than that JSON.stringify does not handle it either. var escapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; var escapedCharsMap = { "\0": "\\0", @@ -4881,8 +5292,13 @@ var ts; "\"": "\\\"", "\u2028": "\\u2028", "\u2029": "\\u2029", - "\u0085": "\\u0085" + "\u0085": "\\u0085" // nextLine }; + /** + * 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) + * Note that this doesn't actually wrap the input in double quotes. + */ function escapeString(s) { s = escapedCharsRegExp.test(s) ? s.replace(escapedCharsRegExp, getReplacement) : s; return s; @@ -4898,6 +5314,8 @@ var ts; } var nonAsciiCharacters = /[^\u0000-\u007F]/g; function escapeNonAsciiCharacters(s) { + // Replace non-ASCII characters with '\uNNNN' escapes if any exist. + // Otherwise just return the original string. return nonAsciiCharacters.test(s) ? s.replace(nonAsciiCharacters, function (c) { return get16BitUnicodeEscapeSequence(c.charCodeAt(0)); }) : s; @@ -5005,7 +5423,7 @@ var ts; ts.getLineOfLocalPosition = getLineOfLocalPosition; function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 135 && nodeIsPresent(member.body)) { + if (member.kind === 135 /* Constructor */ && nodeIsPresent(member.body)) { return member; } }); @@ -5028,10 +5446,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 136) { + if (accessor.kind === 136 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 137) { + else if (accessor.kind === 137 /* SetAccessor */) { setAccessor = accessor; } else { @@ -5040,8 +5458,8 @@ var ts; } else { ts.forEach(declarations, function (member) { - if ((member.kind === 136 || member.kind === 137) - && (member.flags & 128) === (accessor.flags & 128)) { + if ((member.kind === 136 /* GetAccessor */ || member.kind === 137 /* SetAccessor */) + && (member.flags & 128 /* Static */) === (accessor.flags & 128 /* Static */)) { var memberName = getPropertyNameForPropertyNameNode(member.name); var accessorName = getPropertyNameForPropertyNameNode(accessor.name); if (memberName === accessorName) { @@ -5051,10 +5469,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 136 && !getAccessor) { + if (member.kind === 136 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 137 && !setAccessor) { + if (member.kind === 137 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -5070,6 +5488,7 @@ var ts; } ts.getAllAccessorDeclarations = getAllAccessorDeclarations; function emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments) { + // If the leading comments start on different line than the start of node, write new line if (leadingComments && leadingComments.length && node.pos !== leadingComments[0].pos && getLineOfLocalPosition(currentSourceFile, node.pos) !== getLineOfLocalPosition(currentSourceFile, leadingComments[0].pos)) { writer.writeLine(); @@ -5091,13 +5510,14 @@ var ts; writer.write(" "); } else { + // Emit leading space to separate comment during next comment emit emitLeadingSpace = true; } }); } ts.emitComments = emitComments; function writeCommentRange(currentSourceFile, writer, comment, newLine) { - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42) { + if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42 /* asterisk */) { var firstCommentLineAndCharacter = ts.getLineAndCharacterOfPosition(currentSourceFile, comment.pos); var lineCount = ts.getLineStarts(currentSourceFile).length; var firstCommentLineIndent; @@ -5106,51 +5526,76 @@ var ts; ? currentSourceFile.text.length + 1 : getStartPositionOfLine(currentLine + 1, currentSourceFile); if (pos !== comment.pos) { + // If we are not emitting first line, we need to write the spaces to adjust the alignment if (firstCommentLineIndent === undefined) { firstCommentLineIndent = calculateIndent(getStartPositionOfLine(firstCommentLineAndCharacter.line, currentSourceFile), comment.pos); } + // These are number of spaces writer is going to write at current indent var currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); + // Number of spaces we want to be writing + // eg: Assume writer indent + // module m { + // /* starts at character 9 this is line 1 + // * starts at character pos 4 line --1 = 8 - 8 + 3 + // More left indented comment */ --2 = 8 - 8 + 2 + // class c { } + // } + // module m { + // /* this is line 1 -- Assume current writer indent 8 + // * line --3 = 8 - 4 + 5 + // More right indented comment */ --4 = 8 - 4 + 11 + // class c { } + // } var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(pos, nextLineStart); if (spacesToEmit > 0) { var numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); var indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); + // Write indent size string ( in eg 1: = "", 2: "" , 3: string with 8 spaces 4: string with 12 spaces writer.rawWrite(indentSizeSpaceString); + // Emit the single spaces (in eg: 1: 3 spaces, 2: 2 spaces, 3: 1 space, 4: 3 spaces) while (numberOfSingleSpacesToEmit) { writer.rawWrite(" "); numberOfSingleSpacesToEmit--; } } else { + // No spaces to emit write empty string writer.rawWrite(""); } } + // Write the comment line text writeTrimmedCurrentLine(pos, nextLineStart); pos = nextLineStart; } } else { + // Single line comment of style //.... 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) { + // trimmed forward and ending spaces text writer.write(currentLineText); if (end !== comment.end) { writer.writeLine(); } } else { + // Empty string - make sure we write empty line 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) { + if (currentSourceFile.text.charCodeAt(pos) === 9 /* tab */) { + // Tabs = TabSize = indent size and go to next tabStop currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); } else { + // Single space currentLineIndent++; } } @@ -5158,15 +5603,65 @@ var ts; } } ts.writeCommentRange = writeCommentRange; + function modifierToFlag(token) { + switch (token) { + case 109 /* StaticKeyword */: return 128 /* Static */; + case 108 /* PublicKeyword */: return 16 /* Public */; + case 107 /* ProtectedKeyword */: return 64 /* Protected */; + case 106 /* PrivateKeyword */: return 32 /* Private */; + case 78 /* ExportKeyword */: return 1 /* Export */; + case 115 /* DeclareKeyword */: return 2 /* Ambient */; + case 70 /* ConstKeyword */: return 8192 /* Const */; + case 73 /* DefaultKeyword */: return 256 /* Default */; + } + return 0; + } + ts.modifierToFlag = modifierToFlag; + function isLeftHandSideExpression(expr) { + if (expr) { + switch (expr.kind) { + case 155 /* PropertyAccessExpression */: + case 156 /* ElementAccessExpression */: + case 158 /* NewExpression */: + case 157 /* CallExpression */: + case 159 /* TaggedTemplateExpression */: + case 153 /* ArrayLiteralExpression */: + case 161 /* ParenthesizedExpression */: + case 154 /* ObjectLiteralExpression */: + case 174 /* ClassExpression */: + case 162 /* FunctionExpression */: + case 65 /* Identifier */: + case 9 /* RegularExpressionLiteral */: + case 7 /* NumericLiteral */: + case 8 /* StringLiteral */: + case 10 /* NoSubstitutionTemplateLiteral */: + case 171 /* TemplateExpression */: + case 80 /* FalseKeyword */: + case 89 /* NullKeyword */: + case 93 /* ThisKeyword */: + case 95 /* TrueKeyword */: + case 91 /* SuperKeyword */: + return true; + } + } + return false; + } + ts.isLeftHandSideExpression = isLeftHandSideExpression; + function isAssignmentOperator(token) { + return token >= 53 /* FirstAssignment */ && token <= 64 /* LastAssignment */; + } + ts.isAssignmentOperator = isAssignmentOperator; + // Returns false if this heritage clause element's expression contains something unsupported + // (i.e. not a name or dotted name). function isSupportedHeritageClauseElement(node) { return isSupportedHeritageClauseElementExpression(node.expression); } ts.isSupportedHeritageClauseElement = isSupportedHeritageClauseElement; function isSupportedHeritageClauseElementExpression(node) { - if (node.kind === 65) { + if (node.kind === 65 /* Identifier */) { return true; } - else if (node.kind === 155) { + else if (node.kind === 155 /* PropertyAccessExpression */) { return isSupportedHeritageClauseElementExpression(node.expression); } else { @@ -5174,21 +5669,227 @@ var ts; } } function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 126 && node.parent.right === node) || - (node.parent.kind === 155 && node.parent.name === node); + return (node.parent.kind === 126 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 155 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function getLocalSymbolForExportDefault(symbol) { - return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & 256) ? symbol.valueDeclaration.localSymbol : undefined; + return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & 256 /* Default */) ? symbol.valueDeclaration.localSymbol : undefined; } ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; })(ts || (ts = {})); +var ts; +(function (ts) { + function getDefaultLibFileName(options) { + return options.target === 2 /* ES6 */ ? "lib.es6.d.ts" : "lib.d.ts"; + } + ts.getDefaultLibFileName = getDefaultLibFileName; + function textSpanEnd(span) { + return span.start + span.length; + } + ts.textSpanEnd = textSpanEnd; + function textSpanIsEmpty(span) { + return span.length === 0; + } + ts.textSpanIsEmpty = textSpanIsEmpty; + function textSpanContainsPosition(span, position) { + return position >= span.start && position < textSpanEnd(span); + } + ts.textSpanContainsPosition = textSpanContainsPosition; + // Returns true if 'span' contains 'other'. + function textSpanContainsTextSpan(span, other) { + return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span); + } + ts.textSpanContainsTextSpan = textSpanContainsTextSpan; + function textSpanOverlapsWith(span, other) { + var overlapStart = Math.max(span.start, other.start); + var overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other)); + return overlapStart < overlapEnd; + } + ts.textSpanOverlapsWith = textSpanOverlapsWith; + function textSpanOverlap(span1, span2) { + var overlapStart = Math.max(span1.start, span2.start); + var overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); + if (overlapStart < overlapEnd) { + return createTextSpanFromBounds(overlapStart, overlapEnd); + } + return undefined; + } + ts.textSpanOverlap = textSpanOverlap; + function textSpanIntersectsWithTextSpan(span, other) { + return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start; + } + ts.textSpanIntersectsWithTextSpan = textSpanIntersectsWithTextSpan; + function textSpanIntersectsWith(span, start, length) { + var end = start + length; + return start <= textSpanEnd(span) && end >= span.start; + } + ts.textSpanIntersectsWith = textSpanIntersectsWith; + function textSpanIntersectsWithPosition(span, position) { + return position <= textSpanEnd(span) && position >= span.start; + } + ts.textSpanIntersectsWithPosition = textSpanIntersectsWithPosition; + function textSpanIntersection(span1, span2) { + var intersectStart = Math.max(span1.start, span2.start); + var intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); + if (intersectStart <= intersectEnd) { + return createTextSpanFromBounds(intersectStart, intersectEnd); + } + return undefined; + } + ts.textSpanIntersection = textSpanIntersection; + function createTextSpan(start, length) { + if (start < 0) { + throw new Error("start < 0"); + } + if (length < 0) { + throw new Error("length < 0"); + } + return { start: start, length: length }; + } + ts.createTextSpan = createTextSpan; + function createTextSpanFromBounds(start, end) { + return createTextSpan(start, end - start); + } + ts.createTextSpanFromBounds = createTextSpanFromBounds; + function textChangeRangeNewSpan(range) { + return createTextSpan(range.span.start, range.newLength); + } + ts.textChangeRangeNewSpan = textChangeRangeNewSpan; + function textChangeRangeIsUnchanged(range) { + return textSpanIsEmpty(range.span) && range.newLength === 0; + } + ts.textChangeRangeIsUnchanged = textChangeRangeIsUnchanged; + function createTextChangeRange(span, newLength) { + if (newLength < 0) { + throw new Error("newLength < 0"); + } + return { span: span, newLength: newLength }; + } + ts.createTextChangeRange = createTextChangeRange; + ts.unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0); + /** + * Called to merge all the changes that occurred across several versions of a script snapshot + * into a single change. i.e. if a user keeps making successive edits to a script we will + * have a text change from V1 to V2, V2 to V3, ..., Vn. + * + * This function will then merge those changes into a single change range valid between V1 and + * Vn. + */ + function collapseTextChangeRangesAcrossMultipleVersions(changes) { + if (changes.length === 0) { + return ts.unchangedTextChangeRange; + } + if (changes.length === 1) { + return changes[0]; + } + // We change from talking about { { oldStart, oldLength }, newLength } to { oldStart, oldEnd, newEnd } + // as it makes things much easier to reason about. + var change0 = changes[0]; + var oldStartN = change0.span.start; + var oldEndN = textSpanEnd(change0.span); + var newEndN = oldStartN + change0.newLength; + for (var i = 1; i < changes.length; i++) { + var nextChange = changes[i]; + // Consider the following case: + // i.e. two edits. The first represents the text change range { { 10, 50 }, 30 }. i.e. The span starting + // at 10, with length 50 is reduced to length 30. The second represents the text change range { { 30, 30 }, 40 }. + // i.e. the span starting at 30 with length 30 is increased to length 40. + // + // 0 10 20 30 40 50 60 70 80 90 100 + // ------------------------------------------------------------------------------------------------------- + // | / + // | /---- + // T1 | /---- + // | /---- + // | /---- + // ------------------------------------------------------------------------------------------------------- + // | \ + // | \ + // T2 | \ + // | \ + // | \ + // ------------------------------------------------------------------------------------------------------- + // + // Merging these turns out to not be too difficult. First, determining the new start of the change is trivial + // it's just the min of the old and new starts. i.e.: + // + // 0 10 20 30 40 50 60 70 80 90 100 + // ------------------------------------------------------------*------------------------------------------ + // | / + // | /---- + // T1 | /---- + // | /---- + // | /---- + // ----------------------------------------$-------------------$------------------------------------------ + // . | \ + // . | \ + // T2 . | \ + // . | \ + // . | \ + // ----------------------------------------------------------------------*-------------------------------- + // + // (Note the dots represent the newly inferrred start. + // Determining the new and old end is also pretty simple. Basically it boils down to paying attention to the + // absolute positions at the asterixes, and the relative change between the dollar signs. Basically, we see + // which if the two $'s precedes the other, and we move that one forward until they line up. in this case that + // means: + // + // 0 10 20 30 40 50 60 70 80 90 100 + // --------------------------------------------------------------------------------*---------------------- + // | / + // | /---- + // T1 | /---- + // | /---- + // | /---- + // ------------------------------------------------------------$------------------------------------------ + // . | \ + // . | \ + // T2 . | \ + // . | \ + // . | \ + // ----------------------------------------------------------------------*-------------------------------- + // + // In other words (in this case), we're recognizing that the second edit happened after where the first edit + // ended with a delta of 20 characters (60 - 40). Thus, if we go back in time to where the first edit started + // that's the same as if we started at char 80 instead of 60. + // + // As it so happens, the same logic applies if the second edit precedes the first edit. In that case rahter + // than pusing the first edit forward to match the second, we'll push the second edit forward to match the + // first. + // + // In this case that means we have { oldStart: 10, oldEnd: 80, newEnd: 70 } or, in TextChangeRange + // semantics: { { start: 10, length: 70 }, newLength: 60 } + // + // The math then works out as follows. + // If we have { oldStart1, oldEnd1, newEnd1 } and { oldStart2, oldEnd2, newEnd2 } then we can compute the + // final result like so: + // + // { + // oldStart3: Min(oldStart1, oldStart2), + // oldEnd3 : Max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)), + // newEnd3 : Max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)) + // } + var oldStart1 = oldStartN; + var oldEnd1 = oldEndN; + var newEnd1 = newEndN; + var oldStart2 = nextChange.span.start; + var oldEnd2 = textSpanEnd(nextChange.span); + var newEnd2 = oldStart2 + nextChange.newLength; + oldStartN = Math.min(oldStart1, oldStart2); + oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)); + newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)); + } + return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), newEndN - oldStartN); + } + ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; +})(ts || (ts = {})); /// /// var ts; (function (ts) { - var nodeConstructors = new Array(229); - ts.parseTime = 0; + var nodeConstructors = new Array(229 /* Count */); + /* @internal */ ts.parseTime = 0; function getNodeConstructor(kind) { return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); } @@ -5218,27 +5919,34 @@ var ts; } } } + // Invokes a callback for each child of the given node. The 'cbNode' callback is invoked for all child nodes + // stored in properties. If a 'cbNodes' callback is specified, it is invoked for embedded arrays; otherwise, + // embedded arrays are flattened and the 'cbNode' callback is invoked for each element. If a callback returns + // a truthy value, iteration stops and that value is returned. Otherwise, undefined is returned. function forEachChild(node, cbNode, cbNodeArray) { if (!node) { return; } + // The visitXXX functions could be written as local functions that close over the cbNode and cbNodeArray + // callback parameters, but that causes a closure allocation for each invocation with noticeable effects + // on performance. var visitNodes = cbNodeArray ? visitNodeArray : visitEachNode; var cbNodes = cbNodeArray || cbNode; switch (node.kind) { - case 126: + case 126 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 128: + case 128 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.expression); - case 129: - case 132: - case 131: - case 224: - case 225: - case 198: - case 152: + case 129 /* Parameter */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 224 /* PropertyAssignment */: + case 225 /* ShorthandPropertyAssignment */: + case 198 /* VariableDeclaration */: + case 152 /* BindingElement */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.propertyName) || @@ -5247,24 +5955,24 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 142: - case 143: - case 138: - case 139: - case 140: + case 142 /* FunctionType */: + case 143 /* ConstructorType */: + case 138 /* CallSignature */: + case 139 /* ConstructSignature */: + case 140 /* IndexSignature */: 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: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 135 /* Constructor */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 162 /* FunctionExpression */: + case 200 /* FunctionDeclaration */: + case 163 /* ArrowFunction */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -5275,642 +5983,408 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 141: + case 141 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNodes, node.typeArguments); - case 144: + case 144 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 145: + case 145 /* TypeLiteral */: return visitNodes(cbNodes, node.members); - case 146: + case 146 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 147: + case 147 /* TupleType */: return visitNodes(cbNodes, node.elementTypes); - case 148: + case 148 /* UnionType */: return visitNodes(cbNodes, node.types); - case 149: + case 149 /* ParenthesizedType */: return visitNode(cbNode, node.type); - case 150: - case 151: + case 150 /* ObjectBindingPattern */: + case 151 /* ArrayBindingPattern */: return visitNodes(cbNodes, node.elements); - case 153: + case 153 /* ArrayLiteralExpression */: return visitNodes(cbNodes, node.elements); - case 154: + case 154 /* ObjectLiteralExpression */: return visitNodes(cbNodes, node.properties); - case 155: + case 155 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.dotToken) || visitNode(cbNode, node.name); - case 156: + case 156 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 157: - case 158: + case 157 /* CallExpression */: + case 158 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments) || visitNodes(cbNodes, node.arguments); - case 159: + case 159 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 160: + case 160 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 161: + case 161 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 164: + case 164 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 165: + case 165 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 166: + case 166 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 167: + case 167 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 172: + case 172 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 168: + case 168 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 169: + case 169 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 170: + case 170 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 173: + case 173 /* SpreadElementExpression */: return visitNode(cbNode, node.expression); - case 179: - case 206: + case 179 /* Block */: + case 206 /* ModuleBlock */: return visitNodes(cbNodes, node.statements); - case 227: + case 227 /* SourceFile */: return visitNodes(cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 180: + case 180 /* VariableStatement */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 199: + case 199 /* VariableDeclarationList */: return visitNodes(cbNodes, node.declarations); - case 182: + case 182 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 183: + case 183 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 184: + case 184 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 185: + case 185 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 186: + case 186 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.iterator) || visitNode(cbNode, node.statement); - case 187: + case 187 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 188: + case 188 /* ForOfStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 189: - case 190: + case 189 /* ContinueStatement */: + case 190 /* BreakStatement */: return visitNode(cbNode, node.label); - case 191: + case 191 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 192: + case 192 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 193: + case 193 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 207: + case 207 /* CaseBlock */: return visitNodes(cbNodes, node.clauses); - case 220: + case 220 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.statements); - case 221: + case 221 /* DefaultClause */: return visitNodes(cbNodes, node.statements); - case 194: + case 194 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 195: + case 195 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 196: + case 196 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 223: + case 223 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 130: + case 130 /* Decorator */: return visitNode(cbNode, node.expression); - case 201: - case 174: + case 201 /* ClassDeclaration */: + case 174 /* ClassExpression */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); - case 202: + case 202 /* InterfaceDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.typeParameters) || visitNodes(cbNodes, node.heritageClauses) || visitNodes(cbNodes, node.members); - case 203: + case 203 /* TypeAliasDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.type); - case 204: + case 204 /* EnumDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNodes, node.members); - case 226: + case 226 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 205: + case 205 /* ModuleDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 208: + case 208 /* ImportEqualsDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 209: + case 209 /* ImportDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 210: + case 210 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 211: + case 211 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 212: - case 216: + case 212 /* NamedImports */: + case 216 /* NamedExports */: return visitNodes(cbNodes, node.elements); - case 215: + case 215 /* ExportDeclaration */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 213: - case 217: + case 213 /* ImportSpecifier */: + case 217 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 214: + case 214 /* ExportAssignment */: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.type); - case 171: + visitNode(cbNode, node.expression); + case 171 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); - case 176: + case 176 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 127: + case 127 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 222: + case 222 /* HeritageClause */: return visitNodes(cbNodes, node.types); - case 177: + case 177 /* HeritageClauseElement */: return visitNode(cbNode, node.expression) || visitNodes(cbNodes, node.typeArguments); - case 219: + case 219 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 218: + case 218 /* MissingDeclaration */: return visitNodes(cbNodes, node.decorators); } } ts.forEachChild = forEachChild; - var ParsingContext; - (function (ParsingContext) { - ParsingContext[ParsingContext["SourceElements"] = 0] = "SourceElements"; - ParsingContext[ParsingContext["ModuleElements"] = 1] = "ModuleElements"; - ParsingContext[ParsingContext["BlockStatements"] = 2] = "BlockStatements"; - ParsingContext[ParsingContext["SwitchClauses"] = 3] = "SwitchClauses"; - ParsingContext[ParsingContext["SwitchClauseStatements"] = 4] = "SwitchClauseStatements"; - ParsingContext[ParsingContext["TypeMembers"] = 5] = "TypeMembers"; - ParsingContext[ParsingContext["ClassMembers"] = 6] = "ClassMembers"; - ParsingContext[ParsingContext["EnumMembers"] = 7] = "EnumMembers"; - ParsingContext[ParsingContext["HeritageClauseElement"] = 8] = "HeritageClauseElement"; - ParsingContext[ParsingContext["VariableDeclarations"] = 9] = "VariableDeclarations"; - ParsingContext[ParsingContext["ObjectBindingElements"] = 10] = "ObjectBindingElements"; - ParsingContext[ParsingContext["ArrayBindingElements"] = 11] = "ArrayBindingElements"; - ParsingContext[ParsingContext["ArgumentExpressions"] = 12] = "ArgumentExpressions"; - ParsingContext[ParsingContext["ObjectLiteralMembers"] = 13] = "ObjectLiteralMembers"; - ParsingContext[ParsingContext["ArrayLiteralMembers"] = 14] = "ArrayLiteralMembers"; - ParsingContext[ParsingContext["Parameters"] = 15] = "Parameters"; - ParsingContext[ParsingContext["TypeParameters"] = 16] = "TypeParameters"; - ParsingContext[ParsingContext["TypeArguments"] = 17] = "TypeArguments"; - ParsingContext[ParsingContext["TupleElementTypes"] = 18] = "TupleElementTypes"; - ParsingContext[ParsingContext["HeritageClauses"] = 19] = "HeritageClauses"; - ParsingContext[ParsingContext["ImportOrExportSpecifiers"] = 20] = "ImportOrExportSpecifiers"; - ParsingContext[ParsingContext["Count"] = 21] = "Count"; - })(ParsingContext || (ParsingContext = {})); - var Tristate; - (function (Tristate) { - Tristate[Tristate["False"] = 0] = "False"; - Tristate[Tristate["True"] = 1] = "True"; - Tristate[Tristate["Unknown"] = 2] = "Unknown"; - })(Tristate || (Tristate = {})); - 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.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 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) { - // 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; - forEachChild(n, visitNode); - parent = saveParent; - } - } - } - function shouldCheckNode(node) { - switch (node.kind) { - case 8: - case 7: - case 65: - return true; - } - return false; - } - function moveElementEntirelyPastChangeRange(element, isArray, delta, oldText, newText, aggressiveChecks) { - if (isArray) { - visitArray(element); - } - else { - visitNode(element); - } - return; - function visitNode(node) { - if (aggressiveChecks && shouldCheckNode(node)) { - var text = oldText.substring(node.pos, node.end); - } - node._children = undefined; - node.pos += delta; - node.end += delta; - if (aggressiveChecks && shouldCheckNode(node)) { - ts.Debug.assert(text === newText.substring(node.pos, node.end)); - } - forEachChild(node, visitNode, visitArray); - checkNodePositions(node, aggressiveChecks); - } - function visitArray(array) { - array._children = undefined; - array.pos += delta; - array.end += delta; - for (var _i = 0; _i < array.length; _i++) { - var node = array[_i]; - visitNode(node); - } - } - } - function adjustIntersectingElement(element, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta) { - ts.Debug.assert(element.end >= changeStart, "Adjusting an element that was entirely before the change range"); - ts.Debug.assert(element.pos <= changeRangeOldEnd, "Adjusting an element that was entirely after the change range"); - ts.Debug.assert(element.pos <= element.end); - element.pos = Math.min(element.pos, changeRangeNewEnd); - if (element.end >= changeRangeOldEnd) { - element.end += delta; - } - else { - element.end = Math.min(element.end, changeRangeNewEnd); - } - ts.Debug.assert(element.pos <= element.end); - if (element.parent) { - ts.Debug.assert(element.pos >= element.parent.pos); - ts.Debug.assert(element.end <= element.parent.end); - } - } - function checkNodePositions(node, aggressiveChecks) { - if (aggressiveChecks) { - var pos = node.pos; - forEachChild(node, function (child) { - ts.Debug.assert(child.pos >= pos); - pos = child.end; - }); - ts.Debug.assert(pos <= node.end); - } - } - function updateTokenPositionsAndMarkElements(sourceFile, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta, oldText, newText, aggressiveChecks) { - visitNode(sourceFile); - return; - function visitNode(child) { - ts.Debug.assert(child.pos <= child.end); - if (child.pos > changeRangeOldEnd) { - moveElementEntirelyPastChangeRange(child, false, delta, oldText, newText, aggressiveChecks); - return; - } - var fullEnd = child.end; - if (fullEnd >= changeStart) { - child.intersectsChange = true; - child._children = undefined; - adjustIntersectingElement(child, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - forEachChild(child, visitNode, visitArray); - checkNodePositions(child, aggressiveChecks); - return; - } - ts.Debug.assert(fullEnd < changeStart); - } - function visitArray(array) { - ts.Debug.assert(array.pos <= array.end); - if (array.pos > changeRangeOldEnd) { - moveElementEntirelyPastChangeRange(array, true, delta, oldText, newText, aggressiveChecks); - return; - } - var fullEnd = array.end; - if (fullEnd >= changeStart) { - array.intersectsChange = true; - array._children = undefined; - adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - for (var _i = 0; _i < array.length; _i++) { - var node = array[_i]; - visitNode(node); - } - return; - } - ts.Debug.assert(fullEnd < changeStart); - } - } - function extendToAffectedRange(sourceFile, changeRange) { - var maxLookahead = 1; - var start = changeRange.span.start; - for (var i = 0; start > 0 && i <= maxLookahead; i++) { - var nearestNode = findNearestNodeStartingBeforeOrAtPosition(sourceFile, start); - ts.Debug.assert(nearestNode.pos <= start); - var position = nearestNode.pos; - start = Math.max(0, position - 1); - } - var finalSpan = ts.createTextSpanFromBounds(start, ts.textSpanEnd(changeRange.span)); - var finalLength = changeRange.newLength + (changeRange.span.start - start); - return ts.createTextChangeRange(finalSpan, finalLength); - } - function findNearestNodeStartingBeforeOrAtPosition(sourceFile, position) { - var bestResult = sourceFile; - var lastNodeEntirelyBeforePosition; - forEachChild(sourceFile, visit); - if (lastNodeEntirelyBeforePosition) { - var lastChildOfLastEntireNodeBeforePosition = getLastChild(lastNodeEntirelyBeforePosition); - if (lastChildOfLastEntireNodeBeforePosition.pos > bestResult.pos) { - bestResult = lastChildOfLastEntireNodeBeforePosition; - } - } - return bestResult; - function getLastChild(node) { - while (true) { - var lastChild = getLastChildWorker(node); - if (lastChild) { - node = lastChild; - } - else { - return node; - } - } - } - function getLastChildWorker(node) { - var last = undefined; - forEachChild(node, function (child) { - if (ts.nodeIsPresent(child)) { - last = child; - } - }); - return last; - } - function visit(child) { - if (ts.nodeIsMissing(child)) { - return; - } - if (child.pos <= position) { - if (child.pos >= bestResult.pos) { - bestResult = child; - } - if (position < child.end) { - forEachChild(child, visit); - return true; - } - else { - ts.Debug.assert(child.end <= position); - lastNodeEntirelyBeforePosition = child; - } - } - else { - ts.Debug.assert(child.pos > position); - return true; - } - } - } - function checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks) { - var oldText = sourceFile.text; - if (textChangeRange) { - ts.Debug.assert((oldText.length - textChangeRange.span.length + textChangeRange.newLength) === newText.length); - if (aggressiveChecks || ts.Debug.shouldAssert(3)) { - var oldTextPrefix = oldText.substr(0, textChangeRange.span.start); - var newTextPrefix = newText.substr(0, textChangeRange.span.start); - ts.Debug.assert(oldTextPrefix === newTextPrefix); - var oldTextSuffix = oldText.substring(ts.textSpanEnd(textChangeRange.span), oldText.length); - var newTextSuffix = newText.substring(ts.textSpanEnd(ts.textChangeRangeNewSpan(textChangeRange)), newText.length); - ts.Debug.assert(oldTextSuffix === newTextSuffix); - } - } - } - function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks) { - aggressiveChecks = aggressiveChecks || ts.Debug.shouldAssert(2); - checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks); - if (ts.textChangeRangeIsUnchanged(textChangeRange)) { - return sourceFile; - } - if (sourceFile.statements.length === 0) { - return parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, undefined, true); - } - var incrementalSourceFile = sourceFile; - ts.Debug.assert(!incrementalSourceFile.hasBeenIncrementallyParsed); - incrementalSourceFile.hasBeenIncrementallyParsed = true; - var oldText = sourceFile.text; - var syntaxCursor = createSyntaxCursor(sourceFile); - var changeRange = extendToAffectedRange(sourceFile, textChangeRange); - checkChangeRange(sourceFile, newText, changeRange, aggressiveChecks); - ts.Debug.assert(changeRange.span.start <= textChangeRange.span.start); - ts.Debug.assert(ts.textSpanEnd(changeRange.span) === ts.textSpanEnd(textChangeRange.span)); - ts.Debug.assert(ts.textSpanEnd(ts.textChangeRangeNewSpan(changeRange)) === ts.textSpanEnd(ts.textChangeRangeNewSpan(textChangeRange))); - var delta = ts.textChangeRangeNewSpan(changeRange).length - changeRange.span.length; - updateTokenPositionsAndMarkElements(incrementalSourceFile, changeRange.span.start, ts.textSpanEnd(changeRange.span), ts.textSpanEnd(ts.textChangeRangeNewSpan(changeRange)), delta, oldText, newText, aggressiveChecks); - var result = parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, true); - return result; - } - ts.updateSourceFile = updateSourceFile; - function isEvalOrArgumentsIdentifier(node) { - return node.kind === 65 && - (node.text === "eval" || node.text === "arguments"); - } - ts.isEvalOrArgumentsIdentifier = isEvalOrArgumentsIdentifier; - function isUseStrictPrologueDirective(sourceFile, node) { - ts.Debug.assert(ts.isPrologueDirective(node)); - var nodeText = ts.getSourceTextOfNodeFromSourceFile(sourceFile, node.expression); - return nodeText === '"use strict"' || nodeText === "'use strict'"; - } - var InvalidPosition; - (function (InvalidPosition) { - InvalidPosition[InvalidPosition["Value"] = -1] = "Value"; - })(InvalidPosition || (InvalidPosition = {})); - function createSyntaxCursor(sourceFile) { - var currentArray = sourceFile.statements; - var currentArrayIndex = 0; - ts.Debug.assert(currentArrayIndex < currentArray.length); - var current = currentArray[currentArrayIndex]; - var lastQueriedPosition = -1; - return { - currentNode: function (position) { - if (position !== lastQueriedPosition) { - if (current && current.end === position && currentArrayIndex < (currentArray.length - 1)) { - currentArrayIndex++; - current = currentArray[currentArrayIndex]; - } - if (!current || current.pos !== position) { - findHighestListElementThatStartsAtPosition(position); - } - } - lastQueriedPosition = position; - ts.Debug.assert(!current || current.pos === position); - return current; - } - }; - function findHighestListElementThatStartsAtPosition(position) { - currentArray = undefined; - currentArrayIndex = -1; - current = undefined; - forEachChild(sourceFile, visitNode, visitArray); - return; - function visitNode(node) { - if (position >= node.pos && position < node.end) { - forEachChild(node, visitNode, visitArray); - return true; - } - return false; - } - function visitArray(array) { - if (position >= array.pos && position < array.end) { - for (var i = 0, n = array.length; i < n; i++) { - var child = array[i]; - if (child) { - if (child.pos === position) { - currentArray = array; - currentArrayIndex = i; - current = child; - return true; - } - else { - if (child.pos < position && position < child.end) { - forEachChild(child, visitNode, visitArray); - return true; - } - } - } - } - } - return false; - } - } - } function createSourceFile(fileName, sourceText, languageVersion, setParentNodes) { if (setParentNodes === void 0) { setParentNodes = false; } var start = new Date().getTime(); - var result = parseSourceFile(fileName, sourceText, languageVersion, undefined, setParentNodes); + var result = Parser.parseSourceFile(fileName, sourceText, languageVersion, undefined, setParentNodes); ts.parseTime += new Date().getTime() - start; return result; } 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; + // Produces a new SourceFile for the 'newText' provided. The 'textChangeRange' parameter + // indicates what changed between the 'text' that this SourceFile has and the 'newText'. + // The SourceFile will be created with the compiler attempting to reuse as many nodes from + // this file as possible. + // + // Note: this function mutates nodes from this SourceFile. That means any existing nodes + // from this SourceFile that are being held onto may change as a result (including + // becoming detached from any SourceFile). It is recommended that this SourceFile not + // be used once 'update' is called on it. + function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks) { + return IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks); + } + ts.updateSourceFile = updateSourceFile; + // Implement the parser as a singleton module. We do this for perf reasons because creating + // parser instances can actually be expensive enough to impact us on projects with many source + // files. + var Parser; + (function (Parser) { + // Share a single scanner across all calls to parse a source file. This helps speed things + // up by avoiding the cost of creating/compiling scanners over and over again. + var scanner = ts.createScanner(2 /* Latest */, true); + var disallowInAndDecoratorContext = 2 /* DisallowIn */ | 16 /* Decorator */; + var sourceFile; + var syntaxCursor; var token; - var sourceFile = createNode(227, 0); - sourceFile.pos = 0; - sourceFile.end = sourceText.length; - sourceFile.text = sourceText; - sourceFile.parseDiagnostics = []; - sourceFile.bindDiagnostics = []; - sourceFile.languageVersion = languageVersion; - sourceFile.fileName = ts.normalizePath(fileName); - sourceFile.flags = ts.fileExtensionIs(sourceFile.fileName, ".d.ts") ? 2048 : 0; + var sourceText; + var nodeCount; + var identifiers; + var identifierCount; + var parsingContext; + // Flags that dictate what parsing context we're in. For example: + // Whether or not we are in strict parsing mode. All that changes in strict parsing mode is + // 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 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 + // all nodes would need extra state on them to store this info. + // + // Note: 'allowIn' and 'allowYield' track 1:1 with the [in] and [yield] concepts in the ES6 + // grammar specification. + // + // 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 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: + // + // EqualityExpression[In, Yield] : + // RelationalExpression[?In, ?Yield] + // EqualityExpression[?In, ?Yield] == RelationalExpression[?In, ?Yield] + // EqualityExpression[?In, ?Yield] != RelationalExpression[?In, ?Yield] + // EqualityExpression[?In, ?Yield] === RelationalExpression[?In, ?Yield] + // EqualityExpression[?In, ?Yield] !== RelationalExpression[?In, ?Yield] + // + // Where you have to be careful is then understanding what the points are in the grammar + // where the values are *not* passed along. For example: + // + // SingleNameBinding[Yield,GeneratorParameter] + // [+GeneratorParameter]BindingIdentifier[Yield] Initializer[In]opt + // [~GeneratorParameter]BindingIdentifier[?Yield]Initializer[In, ?Yield]opt + // + // Here this is saying that if the GeneratorParameter context flag is set, that we should + // explicitly set the 'yield' context flag to false before calling into the BindingIdentifier + // and we should explicitly unset the 'yield' context flag before calling into the Initializer. + // production. Conversely, if the GeneratorParameter context flag is not set, then we + // should leave the 'yield' context flag alone. + // + // Getting this all correct is tricky and requires careful reading of the grammar to + // understand when these values should be changed versus when they should be inherited. + // + // Note: it should not be necessary to save/restore these flags during speculative/lookahead + // parsing. These context flags are naturally stored and restored through normal recursive + // descent parsing and unwinding. var contextFlags = 0; + // Whether or not we've had a parse error since creating the last AST node. If we have + // encountered an error, it will be stored on the next AST node we create. Parse errors + // can be broken down into three categories: + // + // 1) An error that occurred during scanning. For example, an unterminated literal, or a + // character that was completely not understood. + // + // 2) A token was expected, but was not present. This type of error is commonly produced + // by the 'parseExpected' function. + // + // 3) A token was present that no parsing function was able to consume. This type of error + // only occurs in the 'abortParsingListOrMoveToNextToken' function when the parser + // decides to skip the token. + // + // In all of these cases, we want to mark the next node as having had an error before it. + // With this mark, we can know in incremental settings if this node can be reused, or if + // we have to reparse it. If we don't keep this information around, we may just reuse the + // node. in that event we would then not produce the same errors as we did before, causing + // significant confusion problems. + // + // Note: it is necessary that this value be saved/restored during speculative/lookahead + // parsing. During lookahead parsing, we will often create a node. That node will have + // this value attached, and then this value will be set back to 'false'. If we decide to + // rewind, we must get back to the same value we had prior to the lookahead. + // + // Note: any errors at the end of the file that do not precede a regular node, should get + // attached to the EOF token. var parseErrorBeforeNextFinishedNode = false; - var scanner = ts.createScanner(languageVersion, true, sourceText, scanError); - token = nextToken(); - processReferenceComments(sourceFile); - sourceFile.statements = parseList(0, true, parseSourceElement); - ts.Debug.assert(token === 1); - sourceFile.endOfFileToken = parseTokenNode(); - setExternalModuleIndicator(sourceFile); - sourceFile.nodeCount = nodeCount; - sourceFile.identifierCount = identifierCount; - sourceFile.identifiers = identifiers; - if (setParentNodes) { - fixupParentReferences(sourceFile); + function parseSourceFile(fileName, _sourceText, languageVersion, _syntaxCursor, setParentNodes) { + sourceText = _sourceText; + syntaxCursor = _syntaxCursor; + parsingContext = 0; + identifiers = {}; + identifierCount = 0; + nodeCount = 0; + contextFlags = 0; + parseErrorBeforeNextFinishedNode = false; + createSourceFile(fileName, languageVersion); + // Initialize and prime the scanner before parsing the source elements. + scanner.setText(sourceText); + scanner.setOnError(scanError); + scanner.setScriptTarget(languageVersion); + token = nextToken(); + processReferenceComments(sourceFile); + sourceFile.statements = parseList(0 /* SourceElements */, true, parseSourceElement); + ts.Debug.assert(token === 1 /* EndOfFileToken */); + sourceFile.endOfFileToken = parseTokenNode(); + setExternalModuleIndicator(sourceFile); + sourceFile.nodeCount = nodeCount; + sourceFile.identifierCount = identifierCount; + sourceFile.identifiers = identifiers; + if (setParentNodes) { + fixupParentReferences(sourceFile); + } + syntaxCursor = undefined; + // Clear out the text the scanner is pointing at, so it doesn't keep anything alive unnecessarily. + scanner.setText(""); + scanner.setOnError(undefined); + var result = sourceFile; + // Clear any data. We don't want to accidently hold onto it for too long. + sourceFile = undefined; + identifiers = undefined; + syntaxCursor = undefined; + sourceText = undefined; + return result; + } + Parser.parseSourceFile = parseSourceFile; + function fixupParentReferences(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) { + // walk down setting parents that differ from the parent we think it should be. This + // allows us to quickly bail out of setting parents for subtrees during incremental + // parsing + if (n.parent !== parent) { + n.parent = parent; + var saveParent = parent; + parent = n; + forEachChild(n, visitNode); + parent = saveParent; + } + } + } + function createSourceFile(fileName, languageVersion) { + sourceFile = createNode(227 /* SourceFile */, 0); + sourceFile.pos = 0; + sourceFile.end = sourceText.length; + sourceFile.text = sourceText; + sourceFile.parseDiagnostics = []; + sourceFile.bindDiagnostics = []; + sourceFile.languageVersion = languageVersion; + sourceFile.fileName = ts.normalizePath(fileName); + sourceFile.flags = ts.fileExtensionIs(sourceFile.fileName, ".d.ts") ? 2048 /* DeclarationFile */ : 0; } - syntaxCursor = undefined; - return sourceFile; function setContextFlag(val, flag) { if (val) { contextFlags |= flag; @@ -5920,19 +6394,19 @@ var ts; } } function setStrictModeContext(val) { - setContextFlag(val, 1); + setContextFlag(val, 1 /* StrictMode */); } function setDisallowInContext(val) { - setContextFlag(val, 2); + setContextFlag(val, 2 /* DisallowIn */); } function setYieldContext(val) { - setContextFlag(val, 4); + setContextFlag(val, 4 /* Yield */); } function setGeneratorParameterContext(val) { - setContextFlag(val, 8); + setContextFlag(val, 8 /* GeneratorParameter */); } function setDecoratorContext(val) { - setContextFlag(val, 16); + setContextFlag(val, 16 /* Decorator */); } function doOutsideOfContext(flags, func) { var currentContextFlags = contextFlags & flags; @@ -5942,19 +6416,22 @@ var ts; setContextFlag(true, currentContextFlags); return result; } + // no need to do anything special as we are not in any of the requested contexts return func(); } function allowInAnd(func) { - if (contextFlags & 2) { + if (contextFlags & 2 /* DisallowIn */) { setDisallowInContext(false); var result = func(); setDisallowInContext(true); return result; } + // no need to do anything special if 'in' is already allowed. return func(); } function disallowInAnd(func) { - if (contextFlags & 2) { + if (contextFlags & 2 /* DisallowIn */) { + // no need to do anything special if 'in' is already disallowed. return func(); } setDisallowInContext(true); @@ -5963,7 +6440,8 @@ var ts; return result; } function doInYieldContext(func) { - if (contextFlags & 4) { + if (contextFlags & 4 /* Yield */) { + // no need to do anything special if we're already in the [Yield] context. return func(); } setYieldContext(true); @@ -5972,16 +6450,18 @@ var ts; return result; } function doOutsideOfYieldContext(func) { - if (contextFlags & 4) { + if (contextFlags & 4 /* Yield */) { setYieldContext(false); var result = func(); setYieldContext(true); return result; } + // no need to do anything special if we're not in the [Yield] context. return func(); } function doInDecoratorContext(func) { - if (contextFlags & 16) { + if (contextFlags & 16 /* Decorator */) { + // no need to do anything special if we're already in the [Decorator] context. return func(); } setDecoratorContext(true); @@ -5990,19 +6470,19 @@ var ts; return result; } function inYieldContext() { - return (contextFlags & 4) !== 0; + return (contextFlags & 4 /* Yield */) !== 0; } function inStrictModeContext() { - return (contextFlags & 1) !== 0; + return (contextFlags & 1 /* StrictMode */) !== 0; } function inGeneratorParameterContext() { - return (contextFlags & 8) !== 0; + return (contextFlags & 8 /* GeneratorParameter */) !== 0; } function inDisallowInContext() { - return (contextFlags & 2) !== 0; + return (contextFlags & 2 /* DisallowIn */) !== 0; } function inDecoratorContext() { - return (contextFlags & 16) !== 0; + return (contextFlags & 16 /* Decorator */) !== 0; } function parseErrorAtCurrentToken(message, arg0) { var start = scanner.getTokenPos(); @@ -6010,10 +6490,13 @@ var ts; parseErrorAtPosition(start, length, message, arg0); } function parseErrorAtPosition(start, length, message, arg0) { + // Don't report another error if it would just be at the same position as the last error. var lastError = ts.lastOrUndefined(sourceFile.parseDiagnostics); if (!lastError || start !== lastError.start) { sourceFile.parseDiagnostics.push(ts.createFileDiagnostic(sourceFile, start, length, message, arg0)); } + // Mark that we've encountered an error. We'll set an appropriate bit on the next + // node we finish so that it can't be reused incrementally. parseErrorBeforeNextFinishedNode = true; } function scanError(message, length) { @@ -6042,14 +6525,25 @@ var ts; return token = scanner.reScanTemplateToken(); } function speculationHelper(callback, isLookAhead) { + // Keep track of the state we'll need to rollback to if lookahead fails (or if the + // caller asked us to always reset our state). var saveToken = token; var saveParseDiagnosticsLength = sourceFile.parseDiagnostics.length; var saveParseErrorBeforeNextFinishedNode = parseErrorBeforeNextFinishedNode; + // Note: it is not actually necessary to save/restore the context flags here. That's + // because the saving/restorating of these flags happens naturally through the recursive + // descent nature of our parser. However, we still store this here just so we can + // assert that that invariant holds. var saveContextFlags = contextFlags; + // If we're only looking ahead, then tell the scanner to only lookahead as well. + // Otherwise, if we're actually speculatively parsing, then tell the scanner to do the + // same. var result = isLookAhead ? scanner.lookAhead(callback) : scanner.tryScan(callback); ts.Debug.assert(saveContextFlags === contextFlags); + // If our callback returned something 'falsy' or we're just looking ahead, + // then unconditionally restore us to where we were. if (!result || isLookAhead) { token = saveToken; sourceFile.parseDiagnostics.length = saveParseDiagnosticsLength; @@ -6057,26 +6551,37 @@ var ts; } return result; } + // Invokes the provided callback then unconditionally restores the parser to the state it + // was in immediately prior to invoking the callback. The result of invoking the callback + // is returned from this function. function lookAhead(callback) { return speculationHelper(callback, true); } + // Invokes the provided callback. If the callback returns something falsy, then it restores + // the parser to the state it was in immediately prior to invoking the callback. If the + // callback returns something truthy, then the parser state is not rolled back. The result + // of invoking the callback is returned from this function. function tryParse(callback) { return speculationHelper(callback, false); } + // Ignore strict mode flag because we will report an error in type checker instead. function isIdentifier() { - if (token === 65) { + if (token === 65 /* Identifier */) { return true; } - if (token === 111 && inYieldContext()) { + // If we have a 'yield' keyword, and we're in the [yield] context, then 'yield' is + // considered a keyword and is not an identifier. + if (token === 110 /* YieldKeyword */ && inYieldContext()) { return false; } - return inStrictModeContext() ? token > 111 : token > 101; + return token > 101 /* LastReservedWord */; } function parseExpected(kind, diagnosticMessage) { if (token === kind) { nextToken(); return true; } + // Report specific message if provided with one. Otherwise, report generic fallback message. if (diagnosticMessage) { parseErrorAtCurrentToken(diagnosticMessage); } @@ -6108,20 +6613,23 @@ var ts; return finishNode(node); } function canParseSemicolon() { - if (token === 22) { + // If there's a real semicolon, then we can always parse it out. + if (token === 22 /* SemicolonToken */) { return true; } - return token === 15 || token === 1 || scanner.hasPrecedingLineBreak(); + // We can parse out an optional semicolon in ASI cases in the following cases. + return token === 15 /* CloseBraceToken */ || token === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak(); } function parseSemicolon() { if (canParseSemicolon()) { - if (token === 22) { + if (token === 22 /* SemicolonToken */) { + // consume the semicolon if it was explicitly provided. nextToken(); } return true; } else { - return parseExpected(22); + return parseExpected(22 /* SemicolonToken */); } } function createNode(kind, pos) { @@ -6139,9 +6647,12 @@ var ts; if (contextFlags) { node.parserContextFlags = contextFlags; } + // Keep track on the node if we encountered an error while parsing it. If we did, then + // we cannot reuse the node incrementally. Once we've marked this node, clear out the + // flag so that we don't mark any subsequent nodes. if (parseErrorBeforeNextFinishedNode) { parseErrorBeforeNextFinishedNode = false; - node.parserContextFlags |= 32; + node.parserContextFlags |= 32 /* ThisNodeHasError */; } return node; } @@ -6160,15 +6671,22 @@ var ts; text = ts.escapeIdentifier(text); return ts.hasProperty(identifiers, text) ? identifiers[text] : (identifiers[text] = text); } + // An identifier that starts with two underscores has an extra underscore character prepended to it to avoid issues + // with magic property names like '__proto__'. The 'identifiers' object is used to share a single string instance for + // each identifier in order to reduce memory consumption. function createIdentifier(isIdentifier, diagnosticMessage) { identifierCount++; if (isIdentifier) { - var node = createNode(65); + var node = createNode(65 /* Identifier */); + // Store original token kind if it is not just an Identifier so we can report appropriate error later in type checker + if (token !== 65 /* Identifier */) { + node.originalKeywordKind = token; + } node.text = internIdentifier(scanner.getTokenValue()); nextToken(); return finishNode(node); } - return createMissingNode(65, false, diagnosticMessage || ts.Diagnostics.Identifier_expected); + return createMissingNode(65 /* Identifier */, false, diagnosticMessage || ts.Diagnostics.Identifier_expected); } function parseIdentifier(diagnosticMessage) { return createIdentifier(isIdentifier(), diagnosticMessage); @@ -6178,21 +6696,32 @@ var ts; } function isLiteralPropertyName() { return isIdentifierOrKeyword() || - token === 8 || - token === 7; + token === 8 /* StringLiteral */ || + token === 7 /* NumericLiteral */; } function parsePropertyName() { - if (token === 8 || token === 7) { + if (token === 8 /* StringLiteral */ || token === 7 /* NumericLiteral */) { return parseLiteralNode(true); } - if (token === 18) { + if (token === 18 /* OpenBracketToken */) { return parseComputedPropertyName(); } return parseIdentifierName(); } function parseComputedPropertyName() { - var node = createNode(127); - parseExpected(18); + // PropertyName[Yield,GeneratorParameter] : + // LiteralPropertyName + // [+GeneratorParameter] ComputedPropertyName + // [~GeneratorParameter] ComputedPropertyName[?Yield] + // + // ComputedPropertyName[Yield] : + // [ AssignmentExpression[In, ?Yield] ] + // + var node = createNode(127 /* ComputedPropertyName */); + parseExpected(18 /* OpenBracketToken */); + // We parse any expression (including a comma expression). But the grammar + // says that only an assignment expression is allowed, so the grammar checker + // will error if it sees a comma expression. var yieldContext = inYieldContext(); if (inGeneratorParameterContext()) { setYieldContext(false); @@ -6201,7 +6730,7 @@ var ts; if (inGeneratorParameterContext()) { setYieldContext(yieldContext); } - parseExpected(19); + parseExpected(19 /* CloseBracketToken */); return finishNode(node); } function parseContextualModifier(t) { @@ -6215,92 +6744,112 @@ var ts; return ts.isModifier(token) && tryParse(nextTokenCanFollowContextualModifier); } function nextTokenCanFollowContextualModifier() { - if (token === 70) { - return nextToken() === 77; + if (token === 70 /* ConstKeyword */) { + // 'const' is only a modifier if followed by 'enum'. + return nextToken() === 77 /* EnumKeyword */; } - if (token === 78) { + if (token === 78 /* ExportKeyword */) { nextToken(); - if (token === 73) { + if (token === 73 /* DefaultKeyword */) { return lookAhead(nextTokenIsClassOrFunction); } - return token !== 35 && token !== 14 && canFollowModifier(); + return token !== 35 /* AsteriskToken */ && token !== 14 /* OpenBraceToken */ && canFollowModifier(); } - if (token === 73) { + if (token === 73 /* DefaultKeyword */) { return nextTokenIsClassOrFunction(); } nextToken(); return canFollowModifier(); } function canFollowModifier() { - return token === 18 - || token === 14 - || token === 35 + return token === 18 /* OpenBracketToken */ + || token === 14 /* OpenBraceToken */ + || token === 35 /* AsteriskToken */ || isLiteralPropertyName(); } function nextTokenIsClassOrFunction() { nextToken(); - return token === 69 || token === 83; + return token === 69 /* ClassKeyword */ || token === 83 /* FunctionKeyword */; } + // True if positioned at the start of a list element function isListElement(parsingContext, inErrorRecovery) { var node = currentNode(parsingContext); if (node) { return true; } switch (parsingContext) { - case 0: - case 1: + case 0 /* SourceElements */: + case 1 /* ModuleElements */: return isSourceElement(inErrorRecovery); - case 2: - case 4: + case 2 /* BlockStatements */: + case 4 /* SwitchClauseStatements */: return isStartOfStatement(inErrorRecovery); - case 3: - return token === 67 || token === 73; - case 5: + case 3 /* SwitchClauses */: + return token === 67 /* CaseKeyword */ || token === 73 /* DefaultKeyword */; + case 5 /* TypeMembers */: return isStartOfTypeMember(); - case 6: - return lookAhead(isClassMemberStart) || (token === 22 && !inErrorRecovery); - case 7: - return token === 18 || isLiteralPropertyName(); - case 13: - return token === 18 || token === 35 || isLiteralPropertyName(); - case 10: + case 6 /* ClassMembers */: + // 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 === 22 /* SemicolonToken */ && !inErrorRecovery); + case 7 /* EnumMembers */: + // Include open bracket computed properties. This technically also lets in indexers, + // which would be a candidate for improved error reporting. + return token === 18 /* OpenBracketToken */ || isLiteralPropertyName(); + case 13 /* ObjectLiteralMembers */: + return token === 18 /* OpenBracketToken */ || token === 35 /* AsteriskToken */ || isLiteralPropertyName(); + case 10 /* ObjectBindingElements */: return isLiteralPropertyName(); - case 8: - if (token === 14) { + case 8 /* 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 === 14 /* 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 9: + case 9 /* VariableDeclarations */: return isIdentifierOrPattern(); - case 11: - return token === 23 || token === 21 || isIdentifierOrPattern(); - case 16: + case 11 /* ArrayBindingElements */: + return token === 23 /* CommaToken */ || token === 21 /* DotDotDotToken */ || isIdentifierOrPattern(); + case 16 /* TypeParameters */: return isIdentifier(); - case 12: - case 14: - return token === 23 || token === 21 || isStartOfExpression(); - case 15: + case 12 /* ArgumentExpressions */: + case 14 /* ArrayLiteralMembers */: + return token === 23 /* CommaToken */ || token === 21 /* DotDotDotToken */ || isStartOfExpression(); + case 15 /* Parameters */: return isStartOfParameter(); - case 17: - case 18: - return token === 23 || isStartOfType(); - case 19: + case 17 /* TypeArguments */: + case 18 /* TupleElementTypes */: + return token === 23 /* CommaToken */ || isStartOfType(); + case 19 /* HeritageClauses */: return isHeritageClause(); - case 20: + case 20 /* ImportOrExportSpecifiers */: return isIdentifierOrKeyword(); } ts.Debug.fail("Non-exhaustive case in 'isListElement'."); } function isValidHeritageClauseObjectLiteral() { - ts.Debug.assert(token === 14); - if (nextToken() === 15) { + ts.Debug.assert(token === 14 /* OpenBraceToken */); + if (nextToken() === 15 /* 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 var next = nextToken(); - return next === 23 || next === 14 || next === 79 || next === 103; + return next === 23 /* CommaToken */ || next === 14 /* OpenBraceToken */ || next === 79 /* ExtendsKeyword */ || next === 102 /* ImplementsKeyword */; } return true; } @@ -6309,8 +6858,8 @@ var ts; return isIdentifier(); } function isHeritageClauseExtendsOrImplementsKeyword() { - if (token === 103 || - token === 79) { + if (token === 102 /* ImplementsKeyword */ || + token === 79 /* ExtendsKeyword */) { return lookAhead(nextTokenIsStartOfExpression); } return false; @@ -6319,57 +6868,73 @@ var ts; nextToken(); return isStartOfExpression(); } + // True if positioned at a list terminator function isListTerminator(kind) { - if (token === 1) { + if (token === 1 /* EndOfFileToken */) { + // Being at the end of the file ends all lists. return true; } switch (kind) { - case 1: - case 2: - case 3: - case 5: - case 6: - case 7: - case 13: - case 10: - case 20: - return token === 15; - case 4: - return token === 15 || token === 67 || token === 73; - case 8: - return token === 14 || token === 79 || token === 103; - case 9: + case 1 /* ModuleElements */: + case 2 /* BlockStatements */: + case 3 /* SwitchClauses */: + case 5 /* TypeMembers */: + case 6 /* ClassMembers */: + case 7 /* EnumMembers */: + case 13 /* ObjectLiteralMembers */: + case 10 /* ObjectBindingElements */: + case 20 /* ImportOrExportSpecifiers */: + return token === 15 /* CloseBraceToken */; + case 4 /* SwitchClauseStatements */: + return token === 15 /* CloseBraceToken */ || token === 67 /* CaseKeyword */ || token === 73 /* DefaultKeyword */; + case 8 /* HeritageClauseElement */: + return token === 14 /* OpenBraceToken */ || token === 79 /* ExtendsKeyword */ || token === 102 /* ImplementsKeyword */; + case 9 /* VariableDeclarations */: return isVariableDeclaratorListTerminator(); - case 16: - return token === 25 || token === 16 || token === 14 || token === 79 || token === 103; - case 12: - return token === 17 || token === 22; - case 14: - case 18: - case 11: - return token === 19; - case 15: - return token === 17 || token === 19; - case 17: - return token === 25 || token === 16; - case 19: - return token === 14 || token === 15; + case 16 /* TypeParameters */: + // Tokens other than '>' are here for better error recovery + return token === 25 /* GreaterThanToken */ || token === 16 /* OpenParenToken */ || token === 14 /* OpenBraceToken */ || token === 79 /* ExtendsKeyword */ || token === 102 /* ImplementsKeyword */; + case 12 /* ArgumentExpressions */: + // Tokens other than ')' are here for better error recovery + return token === 17 /* CloseParenToken */ || token === 22 /* SemicolonToken */; + case 14 /* ArrayLiteralMembers */: + case 18 /* TupleElementTypes */: + case 11 /* ArrayBindingElements */: + return token === 19 /* CloseBracketToken */; + case 15 /* Parameters */: + // Tokens other than ')' and ']' (the latter for index signatures) are here for better error recovery + return token === 17 /* CloseParenToken */ || token === 19 /* CloseBracketToken */ /*|| token === SyntaxKind.OpenBraceToken*/; + case 17 /* TypeArguments */: + // Tokens other than '>' are here for better error recovery + return token === 25 /* GreaterThanToken */ || token === 16 /* OpenParenToken */; + case 19 /* HeritageClauses */: + return token === 14 /* OpenBraceToken */ || token === 15 /* CloseBraceToken */; } } function isVariableDeclaratorListTerminator() { + // If we can consume a semicolon (either explicitly, or with ASI), then consider us done + // with parsing the list of variable declarators. if (canParseSemicolon()) { return true; } + // in the case where we're parsing the variable declarator of a 'for-in' statement, we + // are done if we see an 'in' keyword in front of us. Same with for-of if (isInOrOfKeyword(token)) { return true; } - if (token === 32) { + // ERROR RECOVERY TWEAK: + // For better error recovery, if we see an '=>' then we just stop immediately. We've got an + // arrow function here and it's going to be very unlikely that we'll resynchronize and get + // another variable declaration. + if (token === 32 /* EqualsGreaterThanToken */) { return true; } + // Keep trying to parse out variable declarators. return false; } + // True if positioned at element or terminator of the current list or any enclosing list function isInSomeParsingContext() { - for (var kind = 0; kind < 21; kind++) { + for (var kind = 0; kind < 21 /* Count */; kind++) { if (parsingContext & (1 << kind)) { if (isListElement(kind, true) || isListTerminator(kind)) { return true; @@ -6378,6 +6943,7 @@ var ts; } return false; } + // Parses a list of elements function parseList(kind, checkForStrictMode, parseElement) { var saveParsingContext = parsingContext; parsingContext |= 1 << kind; @@ -6388,6 +6954,7 @@ var ts; if (isListElement(kind, false)) { var element = parseListElement(kind, parseElement); result.push(element); + // test elements only if we are not already in strict mode if (checkForStrictMode && !inStrictModeContext()) { if (ts.isPrologueDirective(element)) { if (isUseStrictPrologueDirective(sourceFile, element)) { @@ -6410,6 +6977,14 @@ var ts; parsingContext = saveParsingContext; return result; } + /// Should be called only on prologue directives (isPrologueDirective(node) should be true) + function isUseStrictPrologueDirective(sourceFile, node) { + ts.Debug.assert(ts.isPrologueDirective(node)); + var nodeText = ts.getSourceTextOfNodeFromSourceFile(sourceFile, node.expression); + // Note: the node text must be exactly "use strict" or 'use strict'. It is not ok for the + // string to contain unicode escapes (as per ES5). + return nodeText === '"use strict"' || nodeText === "'use strict'"; + } function parseListElement(parsingContext, parseElement) { var node = currentNode(parsingContext); if (node) { @@ -6418,76 +6993,130 @@ var ts; return parseElement(); } function currentNode(parsingContext) { + // If there is an outstanding parse error that we've encountered, but not attached to + // 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 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) { return undefined; } if (!syntaxCursor) { + // if we don't have a cursor, we could never return a node from the old tree. return undefined; } var node = syntaxCursor.currentNode(scanner.getStartPos()); + // Can't reuse a missing node. if (ts.nodeIsMissing(node)) { return undefined; } + // Can't reuse a node that intersected the change range. if (node.intersectsChange) { return undefined; } + // Can't reuse a node that contains a parse error. This is necessary so that we + // produce the same set of errors again. if (ts.containsParseError(node)) { return undefined; } - var nodeContextFlags = node.parserContextFlags & 63; + // We can only reuse a node if it was parsed under the same strict mode that we're + // currently in. i.e. if we originally parsed a node in non-strict mode, but then + // the user added 'using strict' at the top of the file, then we can't use that node + // again as the presense of strict mode may cause us to parse the tokens in the file + // differetly. + // + // Note: we *can* reuse tokens when the strict mode changes. That's because tokens + // are unaffected by strict mode. It's just the parser will decide what to do with it + // differently depending on what mode it is in. + // + // This also applies to all our other context flags as well. + var nodeContextFlags = node.parserContextFlags & 63 /* ParserGeneratedFlags */; if (nodeContextFlags !== contextFlags) { return undefined; } + // Ok, we have a node that looks like it could be reused. Now verify that it is valid + // in the currest list parsing context that we're currently at. if (!canReuseNode(node, parsingContext)) { return undefined; } return node; } function consumeNode(node) { + // Move the scanner so it is after the node we just consumed. scanner.setTextPos(node.end); nextToken(); return node; } function canReuseNode(node, parsingContext) { switch (parsingContext) { - case 1: + case 1 /* ModuleElements */: return isReusableModuleElement(node); - case 6: + case 6 /* ClassMembers */: return isReusableClassMember(node); - case 3: + case 3 /* SwitchClauses */: return isReusableSwitchClause(node); - case 2: - case 4: + case 2 /* BlockStatements */: + case 4 /* SwitchClauseStatements */: return isReusableStatement(node); - case 7: + case 7 /* EnumMembers */: return isReusableEnumMember(node); - case 5: + case 5 /* TypeMembers */: return isReusableTypeMember(node); - case 9: + case 9 /* VariableDeclarations */: return isReusableVariableDeclaration(node); - case 15: + case 15 /* Parameters */: return isReusableParameter(node); - case 19: - case 16: - case 18: - case 17: - case 12: - case 13: - case 8: + // Any other lists we do not care about reusing nodes in. But feel free to add if + // you can do so safely. Danger areas involve nodes that may involve speculative + // parsing. If speculative parsing is involved with the node, then the range the + // parser reached while looking ahead might be in the edited range (see the example + // in canReuseVariableDeclaratorNode for a good case of this). + case 19 /* HeritageClauses */: + // This would probably be safe to reuse. There is no speculative parsing with + // heritage clauses. + case 16 /* 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 + // unambiguous *type* contexts. While type *arguments* occur in very ambiguous + // *expression* contexts. + case 18 /* TupleElementTypes */: + // This would probably be safe to reuse. There is no speculative parsing with + // tuple types. + // Technically, type argument list types are probably safe to reuse. While + // speculative parsing is involved with them (since type argument lists are only + // produced from speculative parsing a < as a type argument list), we only have + // the types because speculative parsing succeeded. Thus, the lookahead never + // went past the end of the list and rewound. + case 17 /* TypeArguments */: + // Note: these are almost certainly not safe to ever reuse. Expressions commonly + // need a large amount of lookahead, and we should not reuse them as they may + // have actually intersected the edit. + case 12 /* ArgumentExpressions */: + // This is not safe to reuse for the same reason as the 'AssignmentExpression' + // cases. i.e. a property assignment may end with an expression, and thus might + // have lookahead far beyond it's old node. + case 13 /* 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 8 /* HeritageClauseElement */: } return false; } function isReusableModuleElement(node) { if (node) { switch (node.kind) { - case 209: - case 208: - case 215: - case 214: - case 201: - case 202: - case 205: - case 204: + case 209 /* ImportDeclaration */: + case 208 /* ImportEqualsDeclaration */: + case 215 /* ExportDeclaration */: + case 214 /* ExportAssignment */: + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + case 205 /* ModuleDeclaration */: + case 204 /* EnumDeclaration */: return true; } return isReusableStatement(node); @@ -6497,13 +7126,13 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 135: - case 140: - case 134: - case 136: - case 137: - case 132: - case 178: + case 135 /* Constructor */: + case 140 /* IndexSignature */: + case 134 /* MethodDeclaration */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 132 /* PropertyDeclaration */: + case 178 /* SemicolonClassElement */: return true; } } @@ -6512,8 +7141,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 220: - case 221: + case 220 /* CaseClause */: + case 221 /* DefaultClause */: return true; } } @@ -6522,61 +7151,77 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 200: - case 180: - 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: + case 200 /* FunctionDeclaration */: + case 180 /* VariableStatement */: + case 179 /* Block */: + case 183 /* IfStatement */: + case 182 /* ExpressionStatement */: + case 195 /* ThrowStatement */: + case 191 /* ReturnStatement */: + case 193 /* SwitchStatement */: + case 190 /* BreakStatement */: + case 189 /* ContinueStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: + case 186 /* ForStatement */: + case 185 /* WhileStatement */: + case 192 /* WithStatement */: + case 181 /* EmptyStatement */: + case 196 /* TryStatement */: + case 194 /* LabeledStatement */: + case 184 /* DoStatement */: + case 197 /* DebuggerStatement */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 226; + return node.kind === 226 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 139: - case 133: - case 140: - case 131: - case 138: + case 139 /* ConstructSignature */: + case 133 /* MethodSignature */: + case 140 /* IndexSignature */: + case 131 /* PropertySignature */: + case 138 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 198) { + if (node.kind !== 198 /* VariableDeclaration */) { return false; } + // Very subtle incremental parsing bug. Consider the following code: + // + // let v = new List < A, B + // + // This is actually legal code. It's a list of variable declarators "v = new List() + // + // then we have a problem. "v = new List= 0) { + // Always preserve a trailing comma by marking it on the NodeArray result.hasTrailingComma = true; } result.end = getNodeEnd(); @@ -6637,10 +7322,11 @@ var ts; } return createMissingList(); } + // The allowReservedWords parameter controls whether reserved words are permitted after the first dot function parseEntityName(allowReservedWords, diagnosticMessage) { var entity = parseIdentifier(diagnosticMessage); - while (parseOptional(20)) { - var node = createNode(126, entity.pos); + while (parseOptional(20 /* DotToken */)) { + var node = createNode(126 /* QualifiedName */, entity.pos); node.left = entity; node.right = parseRightSideOfDot(allowReservedWords); entity = finishNode(node); @@ -6648,37 +7334,59 @@ var ts; return entity; } function parseRightSideOfDot(allowIdentifierNames) { + // Technically a keyword is valid here as all keywords are identifier names. + // However, often we'll encounter this in error situations when the keyword + // is actually starting another valid construct. + // + // So, we check for the following specific case: + // + // name. + // keyword identifierNameOrKeyword + // + // Note: the newlines are important here. For example, if that above code + // were rewritten into: + // + // name.keyword + // identifierNameOrKeyword + // + // Then we would consider it valid. That's because ASI would take effect and + // the code would be implicitly: "name.keyword; identifierNameOrKeyword". + // In the first case though, ASI will not take effect because there is not a + // line terminator after the keyword. if (scanner.hasPrecedingLineBreak() && scanner.isReservedWord()) { var matchesPattern = lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); if (matchesPattern) { - return createMissingNode(65, true, ts.Diagnostics.Identifier_expected); + // Report that we need an identifier. However, report it right after the dot, + // and not on the next token. This is because the next token might actually + // be an identifier and the error woudl be quite confusing. + return createMissingNode(65 /* Identifier */, true, ts.Diagnostics.Identifier_expected); } } return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(171); + var template = createNode(171 /* TemplateExpression */); template.head = parseLiteralNode(); - ts.Debug.assert(template.head.kind === 11, "Template head has wrong token kind"); + ts.Debug.assert(template.head.kind === 11 /* TemplateHead */, "Template head has wrong token kind"); var templateSpans = []; templateSpans.pos = getNodePos(); do { templateSpans.push(parseTemplateSpan()); - } while (templateSpans[templateSpans.length - 1].literal.kind === 12); + } while (templateSpans[templateSpans.length - 1].literal.kind === 12 /* TemplateMiddle */); templateSpans.end = getNodeEnd(); template.templateSpans = templateSpans; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(176); + var span = createNode(176 /* TemplateSpan */); span.expression = allowInAnd(parseExpression); var literal; - if (token === 15) { + if (token === 15 /* CloseBraceToken */) { reScanTemplateToken(); literal = parseLiteralNode(); } else { - literal = parseExpectedToken(13, false, ts.Diagnostics._0_expected, ts.tokenToString(15)); + literal = parseExpectedToken(13 /* TemplateTail */, false, ts.Diagnostics._0_expected, ts.tokenToString(15 /* CloseBraceToken */)); } span.literal = literal; return finishNode(span); @@ -6696,55 +7404,73 @@ var ts; var tokenPos = scanner.getTokenPos(); nextToken(); finishNode(node); - if (node.kind === 7 - && sourceText.charCodeAt(tokenPos) === 48 + // Octal literals are not allowed in strict mode or ES5 + // Note that theoretically the following condition would hold true literals like 009, + // which is not octal.But because of how the scanner separates the tokens, we would + // never get a token like this. Instead, we would get 00 and 9 as two separate tokens. + // We also do not need to check for negatives because any prefix operator would be part of a + // parent unary expression. + if (node.kind === 7 /* NumericLiteral */ + && sourceText.charCodeAt(tokenPos) === 48 /* _0 */ && ts.isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { - node.flags |= 16384; + node.flags |= 16384 /* OctalLiteral */; } return node; } + // TYPES function parseTypeReference() { - var node = createNode(141); + var node = createNode(141 /* TypeReference */); node.typeName = parseEntityName(false, ts.Diagnostics.Type_expected); - if (!scanner.hasPrecedingLineBreak() && token === 24) { - node.typeArguments = parseBracketedList(17, parseType, 24, 25); + if (!scanner.hasPrecedingLineBreak() && token === 24 /* LessThanToken */) { + node.typeArguments = parseBracketedList(17 /* TypeArguments */, parseType, 24 /* LessThanToken */, 25 /* GreaterThanToken */); } return finishNode(node); } function parseTypeQuery() { - var node = createNode(144); - parseExpected(97); + var node = createNode(144 /* TypeQuery */); + parseExpected(97 /* TypeOfKeyword */); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(128); + var node = createNode(128 /* TypeParameter */); node.name = parseIdentifier(); - if (parseOptional(79)) { + if (parseOptional(79 /* ExtendsKeyword */)) { + // It's not uncommon for people to write improper constraints to a generic. If the + // user writes a constraint that is an expression and not an actual type, then parse + // it out as an expression (so we can recover well), but report that a type is needed + // instead. if (isStartOfType() || !isStartOfExpression()) { node.constraint = parseType(); } else { + // It was not a type, and it looked like an expression. Parse out an expression + // here so we recover well. Note: it is important that we call parseUnaryExpression + // and not parseExpression here. If the user has: + // + // + // + // We do *not* want to consume the > as we're consuming the expression for "". node.expression = parseUnaryExpressionOrHigher(); } } return finishNode(node); } function parseTypeParameters() { - if (token === 24) { - return parseBracketedList(16, parseTypeParameter, 24, 25); + if (token === 24 /* LessThanToken */) { + return parseBracketedList(16 /* TypeParameters */, parseTypeParameter, 24 /* LessThanToken */, 25 /* GreaterThanToken */); } } function parseParameterType() { - if (parseOptional(51)) { - return token === 8 + if (parseOptional(51 /* ColonToken */)) { + return token === 8 /* StringLiteral */ ? parseLiteralNode(true) : parseType(); } return undefined; } function isStartOfParameter() { - return token === 21 || isIdentifierOrPattern() || ts.isModifier(token) || token === 52; + return token === 21 /* DotDotDotToken */ || isIdentifierOrPattern() || ts.isModifier(token) || token === 52 /* AtToken */; } function setModifiers(node, modifiers) { if (modifiers) { @@ -6753,24 +7479,43 @@ var ts; } } function parseParameter() { - var node = createNode(129); + var node = createNode(129 /* Parameter */); node.decorators = parseDecorators(); setModifiers(node, parseModifiers()); - node.dotDotDotToken = parseOptionalToken(21); + node.dotDotDotToken = parseOptionalToken(21 /* DotDotDotToken */); + // SingleNameBinding[Yield,GeneratorParameter] : See 13.2.3 + // [+GeneratorParameter]BindingIdentifier[Yield]Initializer[In]opt + // [~GeneratorParameter]BindingIdentifier[?Yield]Initializer[In, ?Yield]opt node.name = inGeneratorParameterContext() ? doInYieldContext(parseIdentifierOrPattern) : parseIdentifierOrPattern(); if (ts.getFullWidth(node.name) === 0 && node.flags === 0 && ts.isModifier(token)) { + // in cases like + // 'use strict' + // function foo(static) + // isParameter('static') === true, because of isModifier('static') + // however 'static' is not a legal identifier in a strict mode. + // so result of this function will be ParameterDeclaration (flags = 0, name = missing, type = undefined, initializer = undefined) + // and current token will not change => parsing of the enclosing parameter list will last till the end of time (or OOM) + // to avoid this we'll advance cursor to the next token. nextToken(); } - node.questionToken = parseOptionalToken(50); + node.questionToken = parseOptionalToken(50 /* QuestionToken */); node.type = parseParameterType(); node.initializer = inGeneratorParameterContext() ? doOutsideOfYieldContext(parseParameterInitializer) : parseParameterInitializer(); + // Do not check for initializers in an ambient context for parameters. This is not + // a grammar error because the grammar allows arbitrary call signatures in + // an ambient context. + // It is actually not necessary for this to be an error at all. The reason is that + // function/constructor implementations are syntactically disallowed in ambient + // contexts. In addition, parameter initializers are semantically disallowed in + // overload signatures. So parameter initializers are transitively disallowed in + // ambient contexts. return finishNode(node); } function parseParameterInitializer() { return parseInitializer(true); } function fillSignature(returnToken, yieldAndGeneratorParameterContext, requireCompleteParameterList, signature) { - var returnTokenRequired = returnToken === 32; + var returnTokenRequired = returnToken === 32 /* EqualsGreaterThanToken */; signature.typeParameters = parseTypeParameters(); signature.parameters = parseParameterList(yieldAndGeneratorParameterContext, requireCompleteParameterList); if (returnTokenRequired) { @@ -6781,46 +7526,88 @@ var ts; signature.type = parseType(); } } + // Note: after careful analysis of the grammar, it does not appear to be possible to + // have 'Yield' And 'GeneratorParameter' not in sync. i.e. any production calling + // this FormalParameters production either always sets both to true, or always sets + // both to false. As such we only have a single parameter to represent both. function parseParameterList(yieldAndGeneratorParameterContext, requireCompleteParameterList) { - if (parseExpected(16)) { + // FormalParameters[Yield,GeneratorParameter] : + // ... + // + // FormalParameter[Yield,GeneratorParameter] : + // BindingElement[?Yield, ?GeneratorParameter] + // + // BindingElement[Yield, GeneratorParameter ] : See 13.2.3 + // SingleNameBinding[?Yield, ?GeneratorParameter] + // [+GeneratorParameter]BindingPattern[?Yield, GeneratorParameter]Initializer[In]opt + // [~GeneratorParameter]BindingPattern[?Yield]Initializer[In, ?Yield]opt + // + // SingleNameBinding[Yield, GeneratorParameter] : See 13.2.3 + // [+GeneratorParameter]BindingIdentifier[Yield]Initializer[In]opt + // [~GeneratorParameter]BindingIdentifier[?Yield]Initializer[In, ?Yield]opt + if (parseExpected(16 /* OpenParenToken */)) { var savedYieldContext = inYieldContext(); var savedGeneratorParameterContext = inGeneratorParameterContext(); setYieldContext(yieldAndGeneratorParameterContext); setGeneratorParameterContext(yieldAndGeneratorParameterContext); - var result = parseDelimitedList(15, parseParameter); + var result = parseDelimitedList(15 /* Parameters */, parseParameter); setYieldContext(savedYieldContext); setGeneratorParameterContext(savedGeneratorParameterContext); - if (!parseExpected(17) && requireCompleteParameterList) { + if (!parseExpected(17 /* CloseParenToken */) && requireCompleteParameterList) { + // Caller insisted that we had to end with a ) We didn't. So just return + // undefined here. return undefined; } return result; } + // We didn't even have an open paren. If the caller requires a complete parameter list, + // we definitely can't provide that. However, if they're ok with an incomplete one, + // then just return an empty set of parameters. return requireCompleteParameterList ? undefined : createMissingList(); } function parseTypeMemberSemicolon() { - if (parseOptional(23)) { + // We allow type members to be separated by commas or (possibly ASI) semicolons. + // First check if it was a comma. If so, we're done with the member. + if (parseOptional(23 /* CommaToken */)) { return; } + // Didn't have a comma. We must have a (possible ASI) semicolon. parseSemicolon(); } function parseSignatureMember(kind) { var node = createNode(kind); - if (kind === 139) { - parseExpected(88); + if (kind === 139 /* ConstructSignature */) { + parseExpected(88 /* NewKeyword */); } - fillSignature(51, false, false, node); + fillSignature(51 /* ColonToken */, false, false, node); parseTypeMemberSemicolon(); return finishNode(node); } function isIndexSignature() { - if (token !== 18) { + if (token !== 18 /* OpenBracketToken */) { return false; } return lookAhead(isUnambiguouslyIndexSignature); } function isUnambiguouslyIndexSignature() { + // The only allowed sequence is: + // + // [id: + // + // However, for error recovery, we also check the following cases: + // + // [... + // [id, + // [id?, + // [id?: + // [id?] + // [public id + // [private id + // [protected id + // [] + // nextToken(); - if (token === 21 || token === 19) { + if (token === 21 /* DotDotDotToken */ || token === 19 /* CloseBracketToken */) { return true; } if (ts.isModifier(token)) { @@ -6833,22 +7620,30 @@ var ts; return false; } else { + // Skip the identifier nextToken(); } - if (token === 51 || token === 23) { + // A colon signifies a well formed indexer + // A comma should be a badly formed indexer because comma expressions are not allowed + // in computed properties. + if (token === 51 /* ColonToken */ || token === 23 /* CommaToken */) { return true; } - if (token !== 50) { + // Question mark could be an indexer with an optional property, + // or it could be a conditional expression in a computed property. + if (token !== 50 /* QuestionToken */) { return false; } + // If any of the following tokens are after the question mark, it cannot + // be a conditional expression, so treat it as an indexer. nextToken(); - return token === 51 || token === 23 || token === 19; + return token === 51 /* ColonToken */ || token === 23 /* CommaToken */ || token === 19 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(fullStart, decorators, modifiers) { - var node = createNode(140, fullStart); + var node = createNode(140 /* IndexSignature */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); - node.parameters = parseBracketedList(15, parseParameter, 18, 19); + node.parameters = parseBracketedList(15 /* Parameters */, parseParameter, 18 /* OpenBracketToken */, 19 /* CloseBracketToken */); node.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); return finishNode(node); @@ -6856,17 +7651,19 @@ var ts; function parsePropertyOrMethodSignature() { var fullStart = scanner.getStartPos(); var name = parsePropertyName(); - var questionToken = parseOptionalToken(50); - if (token === 16 || token === 24) { - var method = createNode(133, fullStart); + var questionToken = parseOptionalToken(50 /* QuestionToken */); + if (token === 16 /* OpenParenToken */ || token === 24 /* LessThanToken */) { + var method = createNode(133 /* MethodSignature */, fullStart); method.name = name; method.questionToken = questionToken; - fillSignature(51, false, false, method); + // Method signatues don't exist in expression contexts. So they have neither + // [Yield] nor [GeneratorParameter] + fillSignature(51 /* ColonToken */, false, false, method); parseTypeMemberSemicolon(); return finishNode(method); } else { - var property = createNode(131, fullStart); + var property = createNode(131 /* PropertySignature */, fullStart); property.name = name; property.questionToken = questionToken; property.type = parseTypeAnnotation(); @@ -6876,9 +7673,9 @@ var ts; } function isStartOfTypeMember() { switch (token) { - case 16: - case 24: - case 18: + case 16 /* OpenParenToken */: + case 24 /* LessThanToken */: + case 18 /* OpenBracketToken */: return true; default: if (ts.isModifier(token)) { @@ -6898,29 +7695,37 @@ var ts; } function isTypeMemberWithLiteralPropertyName() { nextToken(); - return token === 16 || - token === 24 || - token === 50 || - token === 51 || + return token === 16 /* OpenParenToken */ || + token === 24 /* LessThanToken */ || + token === 50 /* QuestionToken */ || + token === 51 /* ColonToken */ || canParseSemicolon(); } function parseTypeMember() { switch (token) { - case 16: - case 24: - return parseSignatureMember(138); - case 18: + case 16 /* OpenParenToken */: + case 24 /* LessThanToken */: + return parseSignatureMember(138 /* CallSignature */); + case 18 /* OpenBracketToken */: + // Indexer or computed property return isIndexSignature() ? parseIndexSignatureDeclaration(scanner.getStartPos(), undefined, undefined) : parsePropertyOrMethodSignature(); - case 88: + case 88 /* NewKeyword */: if (lookAhead(isStartOfConstructSignature)) { - return parseSignatureMember(139); + return parseSignatureMember(139 /* ConstructSignature */); } - case 8: - case 7: + // fall through. + case 8 /* StringLiteral */: + case 7 /* NumericLiteral */: return parsePropertyOrMethodSignature(); default: + // Index declaration as allowed as a type member. But as per the grammar, + // they also allow modifiers. So we have to check for an index declaration + // that might be following modifiers. This ensures that things work properly + // when incrementally parsing as the parser will produce the Index declaration + // if it has the same text regardless of whether it is inside a class or an + // object type. if (ts.isModifier(token)) { var result = tryParse(parseIndexSignatureWithModifiers); if (result) { @@ -6942,18 +7747,18 @@ var ts; } function isStartOfConstructSignature() { nextToken(); - return token === 16 || token === 24; + return token === 16 /* OpenParenToken */ || token === 24 /* LessThanToken */; } function parseTypeLiteral() { - var node = createNode(145); + var node = createNode(145 /* TypeLiteral */); node.members = parseObjectTypeMembers(); return finishNode(node); } function parseObjectTypeMembers() { var members; - if (parseExpected(14)) { - members = parseList(5, false, parseTypeMember); - parseExpected(15); + if (parseExpected(14 /* OpenBraceToken */)) { + members = parseList(5 /* TypeMembers */, false, parseTypeMember); + parseExpected(15 /* CloseBraceToken */); } else { members = createMissingList(); @@ -6961,47 +7766,48 @@ var ts; return members; } function parseTupleType() { - var node = createNode(147); - node.elementTypes = parseBracketedList(18, parseType, 18, 19); + var node = createNode(147 /* TupleType */); + node.elementTypes = parseBracketedList(18 /* TupleElementTypes */, parseType, 18 /* OpenBracketToken */, 19 /* CloseBracketToken */); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(149); - parseExpected(16); + var node = createNode(149 /* ParenthesizedType */); + parseExpected(16 /* OpenParenToken */); node.type = parseType(); - parseExpected(17); + parseExpected(17 /* CloseParenToken */); return finishNode(node); } function parseFunctionOrConstructorType(kind) { var node = createNode(kind); - if (kind === 143) { - parseExpected(88); + if (kind === 143 /* ConstructorType */) { + parseExpected(88 /* NewKeyword */); } - fillSignature(32, false, false, node); + fillSignature(32 /* EqualsGreaterThanToken */, false, false, node); return finishNode(node); } function parseKeywordAndNoDot() { var node = parseTokenNode(); - return token === 20 ? undefined : node; + return token === 20 /* DotToken */ ? undefined : node; } function parseNonArrayType() { switch (token) { - case 112: - case 121: - case 119: - case 113: - case 122: + case 112 /* AnyKeyword */: + case 121 /* StringKeyword */: + case 119 /* NumberKeyword */: + case 113 /* BooleanKeyword */: + case 122 /* SymbolKeyword */: + // If these are followed by a dot, then parse these out as a dotted type reference instead. var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReference(); - case 99: + case 99 /* VoidKeyword */: return parseTokenNode(); - case 97: + case 97 /* TypeOfKeyword */: return parseTypeQuery(); - case 14: + case 14 /* OpenBraceToken */: return parseTypeLiteral(); - case 18: + case 18 /* OpenBracketToken */: return parseTupleType(); - case 16: + case 16 /* OpenParenToken */: return parseParenthesizedType(); default: return parseTypeReference(); @@ -7009,19 +7815,21 @@ var ts; } function isStartOfType() { switch (token) { - case 112: - case 121: - case 119: - case 113: - case 122: - case 99: - case 97: - case 14: - case 18: - case 24: - case 88: + case 112 /* AnyKeyword */: + case 121 /* StringKeyword */: + case 119 /* NumberKeyword */: + case 113 /* BooleanKeyword */: + case 122 /* SymbolKeyword */: + case 99 /* VoidKeyword */: + case 97 /* TypeOfKeyword */: + case 14 /* OpenBraceToken */: + case 18 /* OpenBracketToken */: + case 24 /* LessThanToken */: + case 88 /* NewKeyword */: return true; - case 16: + case 16 /* OpenParenToken */: + // Only consider '(' the start of a type if followed by ')', '...', an identifier, a modifier, + // or something that starts a type. We don't want to consider things like '(1)' a type. return lookAhead(isStartOfParenthesizedOrFunctionType); default: return isIdentifier(); @@ -7029,13 +7837,13 @@ var ts; } function isStartOfParenthesizedOrFunctionType() { nextToken(); - return token === 17 || isStartOfParameter() || isStartOfType(); + return token === 17 /* CloseParenToken */ || isStartOfParameter() || isStartOfType(); } function parseArrayTypeOrHigher() { var type = parseNonArrayType(); - while (!scanner.hasPrecedingLineBreak() && parseOptional(18)) { - parseExpected(19); - var node = createNode(146, type.pos); + while (!scanner.hasPrecedingLineBreak() && parseOptional(18 /* OpenBracketToken */)) { + parseExpected(19 /* CloseBracketToken */); + var node = createNode(146 /* ArrayType */, type.pos); node.elementType = type; type = finishNode(node); } @@ -7043,40 +7851,48 @@ var ts; } function parseUnionTypeOrHigher() { var type = parseArrayTypeOrHigher(); - if (token === 44) { + if (token === 44 /* BarToken */) { var types = [type]; types.pos = type.pos; - while (parseOptional(44)) { + while (parseOptional(44 /* BarToken */)) { types.push(parseArrayTypeOrHigher()); } types.end = getNodeEnd(); - var node = createNode(148, type.pos); + var node = createNode(148 /* UnionType */, type.pos); node.types = types; type = finishNode(node); } return type; } function isStartOfFunctionType() { - if (token === 24) { + if (token === 24 /* LessThanToken */) { return true; } - return token === 16 && lookAhead(isUnambiguouslyStartOfFunctionType); + return token === 16 /* OpenParenToken */ && lookAhead(isUnambiguouslyStartOfFunctionType); } function isUnambiguouslyStartOfFunctionType() { nextToken(); - if (token === 17 || token === 21) { + if (token === 17 /* CloseParenToken */ || token === 21 /* DotDotDotToken */) { + // ( ) + // ( ... return true; } if (isIdentifier() || ts.isModifier(token)) { nextToken(); - if (token === 51 || token === 23 || - token === 50 || token === 53 || + if (token === 51 /* ColonToken */ || token === 23 /* CommaToken */ || + token === 50 /* QuestionToken */ || token === 53 /* EqualsToken */ || isIdentifier() || ts.isModifier(token)) { + // ( id : + // ( id , + // ( id ? + // ( id = + // ( modifier id return true; } - if (token === 17) { + if (token === 17 /* CloseParenToken */) { nextToken(); - if (token === 32) { + if (token === 32 /* EqualsGreaterThanToken */) { + // ( id ) => return true; } } @@ -7084,6 +7900,8 @@ var ts; return false; } function parseType() { + // The rules about 'yield' only apply to actual code/expression contexts. They don't + // apply to 'type' contexts. So we disable these parameters here before moving on. var savedYieldContext = inYieldContext(); var savedGeneratorParameterContext = inGeneratorParameterContext(); setYieldContext(false); @@ -7095,36 +7913,37 @@ var ts; } function parseTypeWorker() { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(142); + return parseFunctionOrConstructorType(142 /* FunctionType */); } - if (token === 88) { - return parseFunctionOrConstructorType(143); + if (token === 88 /* NewKeyword */) { + return parseFunctionOrConstructorType(143 /* ConstructorType */); } return parseUnionTypeOrHigher(); } function parseTypeAnnotation() { - return parseOptional(51) ? parseType() : undefined; + return parseOptional(51 /* ColonToken */) ? parseType() : undefined; } + // EXPRESSIONS function isStartOfLeftHandSideExpression() { switch (token) { - case 93: - case 91: - case 89: - case 95: - case 80: - case 7: - case 8: - case 10: - case 11: - case 16: - case 18: - case 14: - case 83: - case 69: - case 88: - case 36: - case 57: - case 65: + case 93 /* ThisKeyword */: + case 91 /* SuperKeyword */: + case 89 /* NullKeyword */: + case 95 /* TrueKeyword */: + case 80 /* FalseKeyword */: + case 7 /* NumericLiteral */: + case 8 /* StringLiteral */: + case 10 /* NoSubstitutionTemplateLiteral */: + case 11 /* TemplateHead */: + case 16 /* OpenParenToken */: + case 18 /* OpenBracketToken */: + case 14 /* OpenBraceToken */: + case 83 /* FunctionKeyword */: + case 69 /* ClassKeyword */: + case 88 /* NewKeyword */: + case 36 /* SlashToken */: + case 57 /* SlashEqualsToken */: + case 65 /* Identifier */: return true; default: return isIdentifier(); @@ -7135,19 +7954,26 @@ var ts; return true; } switch (token) { - case 33: - case 34: - case 47: - case 46: - case 74: - case 97: - case 99: - case 38: - case 39: - case 24: - case 111: + case 33 /* PlusToken */: + case 34 /* MinusToken */: + case 47 /* TildeToken */: + case 46 /* ExclamationToken */: + case 74 /* DeleteKeyword */: + case 97 /* TypeOfKeyword */: + case 99 /* VoidKeyword */: + case 38 /* PlusPlusToken */: + case 39 /* MinusMinusToken */: + case 24 /* LessThanToken */: + case 110 /* 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 + // a generator, or in strict mode (or both)) and it started a yield expression. return true; default: + // Error tolerance. If we see the start of some binary operator, we consider + // that the start of an expression. That way we'll parse out a missing identifier, + // give a good message about an identifier being missing, and then consume the + // rest of the binary expression. if (isBinaryOperator()) { return true; } @@ -7155,23 +7981,25 @@ var ts; } } function isStartOfExpressionStatement() { - return token !== 14 && - token !== 83 && - token !== 69 && - token !== 52 && + // As per the grammar, none of '{' or 'function' or 'class' can start an expression statement. + return token !== 14 /* OpenBraceToken */ && + token !== 83 /* FunctionKeyword */ && + token !== 69 /* ClassKeyword */ && + token !== 52 /* AtToken */ && isStartOfExpression(); } function parseExpression() { // Expression[in]: // AssignmentExpression[in] // Expression[in] , AssignmentExpression[in] + // clear the decorator context when parsing Expression, as it should be unambiguous when parsing a decorator var saveDecoratorContext = inDecoratorContext(); if (saveDecoratorContext) { setDecoratorContext(false); } var expr = parseAssignmentExpressionOrHigher(); var operatorToken; - while ((operatorToken = parseOptionalToken(23))) { + while ((operatorToken = parseOptionalToken(23 /* CommaToken */))) { expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher()); } if (saveDecoratorContext) { @@ -7180,12 +8008,24 @@ var ts; return expr; } function parseInitializer(inParameter) { - if (token !== 53) { - if (scanner.hasPrecedingLineBreak() || (inParameter && token === 14) || !isStartOfExpression()) { + if (token !== 53 /* EqualsToken */) { + // It's not uncommon during typing for the user to miss writing the '=' token. Check if + // there is no newline after the last token and if we're on an expression. If so, parse + // this as an equals-value clause with a missing equals. + // NOTE: There are two places where we allow equals-value clauses. The first is in a + // variable declarator. The second is with a parameter. For variable declarators + // it's more likely that a { would be a allowed (as an object literal). While this + // is also allowed for parameters, the risk is that we consume the { as an object + // literal when it really will be for the block following the parameter. + if (scanner.hasPrecedingLineBreak() || (inParameter && token === 14 /* OpenBraceToken */) || !isStartOfExpression()) { + // preceding line break, open brace in a parameter (likely a function body) or current token is not an expression - + // do not try to parse initializer return undefined; } } - parseExpected(53); + // Initializer[In, Yield] : + // = AssignmentExpression[?In, ?Yield] + parseExpected(53 /* EqualsToken */); return parseAssignmentExpressionOrHigher(); } function parseAssignmentExpressionOrHigher() { @@ -7198,30 +8038,72 @@ var ts; // // 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). + // First, do the simple check if we have a YieldExpression (production '5'). if (isYieldExpression()) { return parseYieldExpression(); } + // Then, check if we have an arrow function (production '4') that starts with a parenthesized + // parameter list. If we do, we must *not* recurse for productions 1, 2 or 3. An ArrowFunction is + // not a LeftHandSideExpression, nor does it start a ConditionalExpression. So we are done + // with AssignmentExpression if we see one. var arrowExpression = tryParseParenthesizedArrowFunctionExpression(); if (arrowExpression) { return arrowExpression; } + // Now try to see if we're in production '1', '2' or '3'. A conditional expression can + // start with a LogicalOrExpression, while the assignment productions can only start with + // LeftHandSideExpressions. + // + // So, first, we try to just parse out a BinaryExpression. If we get something that is a + // LeftHandSide or higher, then we can try to parse out the assignment expression part. + // Otherwise, we try to parse out the conditional expression bit. We want to allow any + // binary expression here, so we pass in the 'lowest' precedence here so that it matches + // and consumes anything. var expr = parseBinaryExpressionOrHigher(0); - if (expr.kind === 65 && token === 32) { + // To avoid a look-ahead, we did not handle the case of an arrow function with a single un-parenthesized + // parameter ('x => ...') above. We handle it here by checking if the parsed expression was a single + // identifier and the current token is an arrow. + if (expr.kind === 65 /* Identifier */ && token === 32 /* EqualsGreaterThanToken */) { return parseSimpleArrowFunctionExpression(expr); } - if (isLeftHandSideExpression(expr) && isAssignmentOperator(reScanGreaterToken())) { + // Now see if we might be in cases '2' or '3'. + // If the expression was a LHS expression, and we have an assignment operator, then + // we're in '2' or '3'. Consume the assignment and return. + // + // Note: we call reScanGreaterToken so that we get an appropriately merged token + // for cases like > > = becoming >>= + if (ts.isLeftHandSideExpression(expr) && ts.isAssignmentOperator(reScanGreaterToken())) { return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher()); } + // It wasn't an assignment or a lambda. This is a conditional expression: return parseConditionalExpressionRest(expr); } function isYieldExpression() { - if (token === 111) { + if (token === 110 /* YieldKeyword */) { + // If we have a 'yield' keyword, and htis is a context where yield expressions are + // allowed, then definitely parse out a yield expression. if (inYieldContext()) { return true; } if (inStrictModeContext()) { + // If we're in strict mode, then 'yield' is a keyword, could only ever start + // a yield expression. return true; } + // We're in a context where 'yield expr' is not allowed. However, if we can + // definitely tell that the user was trying to parse a 'yield expr' and not + // just a normal expr that start with a 'yield' identifier, then parse out + // a 'yield expr'. We can then report an error later that they are only + // allowed in generator expressions. + // + // for example, if we see 'yield(foo)', then we'll have to treat that as an + // invocation expression of something called 'yield'. However, if we have + // 'yield foo' then that is not legal as a normal expression, so we can + // definitely recognize this as a yield expression. + // + // for now we just check if the next token is an identifier. More heuristics + // can be added here later as necessary. We just need to make sure that we + // don't accidently consume something legal. return lookAhead(nextTokenIsIdentifierOnSameLine); } return false; @@ -7233,131 +8115,214 @@ var ts; function nextTokenIsIdentifierOrStartOfDestructuringOnTheSameLine() { nextToken(); return !scanner.hasPrecedingLineBreak() && - (isIdentifier() || token === 14 || token === 18); + (isIdentifier() || token === 14 /* OpenBraceToken */ || token === 18 /* OpenBracketToken */); } function parseYieldExpression() { - var node = createNode(172); + var node = createNode(172 /* YieldExpression */); + // YieldExpression[In] : + // yield + // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] + // yield [no LineTerminator here] * [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] nextToken(); if (!scanner.hasPrecedingLineBreak() && - (token === 35 || isStartOfExpression())) { - node.asteriskToken = parseOptionalToken(35); + (token === 35 /* AsteriskToken */ || isStartOfExpression())) { + node.asteriskToken = parseOptionalToken(35 /* AsteriskToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } else { + // if the next token is not on the same line as yield. or we don't have an '*' or + // the start of an expressin, then this is just a simple "yield" expression. return finishNode(node); } } function parseSimpleArrowFunctionExpression(identifier) { - ts.Debug.assert(token === 32, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - var node = createNode(163, identifier.pos); - var parameter = createNode(129, identifier.pos); + ts.Debug.assert(token === 32 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); + var node = createNode(163 /* ArrowFunction */, identifier.pos); + var parameter = createNode(129 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = [parameter]; node.parameters.pos = parameter.pos; node.parameters.end = parameter.end; - node.equalsGreaterThanToken = parseExpectedToken(32, false, ts.Diagnostics._0_expected, "=>"); + node.equalsGreaterThanToken = parseExpectedToken(32 /* EqualsGreaterThanToken */, false, ts.Diagnostics._0_expected, "=>"); node.body = parseArrowFunctionExpressionBody(); return finishNode(node); } function tryParseParenthesizedArrowFunctionExpression() { var triState = isParenthesizedArrowFunctionExpression(); - if (triState === 0) { + if (triState === 0 /* False */) { + // It's definitely not a parenthesized arrow function expression. return undefined; } - var arrowFunction = triState === 1 + // If we definitely have an arrow function, then we can just parse one, not requiring a + // following => or { token. Otherwise, we *might* have an arrow function. Try to parse + // it out, but don't allow any ambiguity, and return 'undefined' if this could be an + // expression instead. + var arrowFunction = triState === 1 /* True */ ? parseParenthesizedArrowFunctionExpressionHead(true) : tryParse(parsePossibleParenthesizedArrowFunctionExpressionHead); if (!arrowFunction) { + // Didn't appear to actually be a parenthesized arrow function. Just bail out. return undefined; } + // If we have an arrow, then try to parse the body. Even if not, try to parse if we + // have an opening brace, just in case we're in an error state. var lastToken = token; - arrowFunction.equalsGreaterThanToken = parseExpectedToken(32, false, ts.Diagnostics._0_expected, "=>"); - arrowFunction.body = (lastToken === 32 || lastToken === 14) + arrowFunction.equalsGreaterThanToken = parseExpectedToken(32 /* EqualsGreaterThanToken */, false, ts.Diagnostics._0_expected, "=>"); + arrowFunction.body = (lastToken === 32 /* EqualsGreaterThanToken */ || lastToken === 14 /* OpenBraceToken */) ? parseArrowFunctionExpressionBody() : parseIdentifier(); return finishNode(arrowFunction); } + // True -> We definitely expect a parenthesized arrow function here. + // False -> There *cannot* be a parenthesized arrow function here. + // Unknown -> There *might* be a parenthesized arrow function here. + // Speculatively look ahead to be sure, and rollback if not. function isParenthesizedArrowFunctionExpression() { - if (token === 16 || token === 24) { + if (token === 16 /* OpenParenToken */ || token === 24 /* LessThanToken */) { return lookAhead(isParenthesizedArrowFunctionExpressionWorker); } - if (token === 32) { - return 1; + if (token === 32 /* EqualsGreaterThanToken */) { + // ERROR RECOVERY TWEAK: + // If we see a standalone => try to parse it as an arrow function expression as that's + // likely what the user intended to write. + return 1 /* True */; } - return 0; + // Definitely not a parenthesized arrow function. + return 0 /* False */; } function isParenthesizedArrowFunctionExpressionWorker() { var first = token; var second = nextToken(); - if (first === 16) { - if (second === 17) { + if (first === 16 /* OpenParenToken */) { + if (second === 17 /* CloseParenToken */) { + // Simple cases: "() =>", "(): ", and "() {". + // This is an arrow function with no parameters. + // The last one is not actually an arrow function, + // but this is probably what the user intended. var third = nextToken(); switch (third) { - case 32: - case 51: - case 14: - return 1; + case 32 /* EqualsGreaterThanToken */: + case 51 /* ColonToken */: + case 14 /* OpenBraceToken */: + return 1 /* True */; default: - return 0; + return 0 /* False */; } } - if (second === 21) { - return 1; + // If encounter "([" or "({", this could be the start of a binding pattern. + // Examples: + // ([ x ]) => { } + // ({ x }) => { } + // ([ x ]) + // ({ x }) + if (second === 18 /* OpenBracketToken */ || second === 14 /* OpenBraceToken */) { + return 2 /* Unknown */; } + // Simple case: "(..." + // This is an arrow function with a rest parameter. + if (second === 21 /* DotDotDotToken */) { + return 1 /* True */; + } + // If we had "(" followed by something that's not an identifier, + // then this definitely doesn't look like a lambda. + // Note: we could be a little more lenient and allow + // "(public" or "(private". These would not ever actually be allowed, + // but we could provide a good error message instead of bailing out. if (!isIdentifier()) { - return 0; + return 0 /* False */; } - if (nextToken() === 51) { - return 1; + // If we have something like "(a:", then we must have a + // type-annotated parameter in an arrow function expression. + if (nextToken() === 51 /* ColonToken */) { + return 1 /* True */; } - return 2; + // This *could* be a parenthesized arrow function. + // Return Unknown to let the caller know. + return 2 /* Unknown */; } else { - ts.Debug.assert(first === 24); + ts.Debug.assert(first === 24 /* LessThanToken */); + // If we have "<" not followed by an identifier, + // then this definitely is not an arrow function. if (!isIdentifier()) { - return 0; + return 0 /* False */; } - return 2; + // This *could* be a parenthesized arrow function. + return 2 /* Unknown */; } } function parsePossibleParenthesizedArrowFunctionExpressionHead() { return parseParenthesizedArrowFunctionExpressionHead(false); } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNode(163); - fillSignature(51, false, !allowAmbiguity, node); + var node = createNode(163 /* ArrowFunction */); + // Arrow functions are never generators. + // + // If we're speculatively parsing a signature for a parenthesized arrow function, then + // we have to have a complete parameter list. Otherwise we might see something like + // a => (b => c) + // And think that "(b =>" was actually a parenthesized arrow function with a missing + // close paren. + fillSignature(51 /* ColonToken */, false, !allowAmbiguity, node); + // If we couldn't get parameters, we definitely could not parse out an arrow function. if (!node.parameters) { return undefined; } - if (!allowAmbiguity && token !== 32 && token !== 14) { + // Parsing a signature isn't enough. + // Parenthesized arrow signatures often look like other valid expressions. + // For instance: + // - "(x = 10)" is an assignment expression parsed as a signature with a default parameter value. + // - "(x,y)" is a comma expression parsed as a signature with two parameters. + // - "a ? (b): c" will have "(b):" parsed as a signature with a return type annotation. + // + // So we need just a bit of lookahead to ensure that it can only be a signature. + if (!allowAmbiguity && token !== 32 /* EqualsGreaterThanToken */ && token !== 14 /* OpenBraceToken */) { + // Returning undefined here will cause our caller to rewind to where we started from. return undefined; } return node; } function parseArrowFunctionExpressionBody() { - if (token === 14) { + if (token === 14 /* OpenBraceToken */) { return parseFunctionBlock(false, false); } if (isStartOfStatement(true) && !isStartOfExpressionStatement() && - token !== 83 && - token !== 69) { + token !== 83 /* FunctionKeyword */ && + token !== 69 /* 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: + // + // a => + // let v = 0; + // } + // + // they may be missing an open brace. Check to see if that's the case so we can + // try to recover better. If we don't do this, then the next close curly we see may end + // up preemptively closing the containing construct. + // + // Note: even when 'ignoreMissingOpenBrace' is passed as true, parseBody will still error. return parseFunctionBlock(false, true); } return parseAssignmentExpressionOrHigher(); } function parseConditionalExpressionRest(leftOperand) { - var questionToken = parseOptionalToken(50); + // Note: we are passed in an expression which was produced from parseBinaryExpressionOrHigher. + var questionToken = parseOptionalToken(50 /* QuestionToken */); if (!questionToken) { return leftOperand; } - var node = createNode(170, leftOperand.pos); + // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and + // we do not that for the 'whenFalse' part. + var node = createNode(170 /* ConditionalExpression */, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); - node.colonToken = parseExpectedToken(51, false, ts.Diagnostics._0_expected, ts.tokenToString(51)); + node.colonToken = parseExpectedToken(51 /* ColonToken */, false, ts.Diagnostics._0_expected, ts.tokenToString(51 /* ColonToken */)); node.whenFalse = parseAssignmentExpressionOrHigher(); return finishNode(node); } @@ -7366,16 +8331,19 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 86 || t === 125; + return t === 86 /* InKeyword */ || t === 125 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { + // We either have a binary operator here, or we're finished. We call + // reScanGreaterToken so that we merge token sequences like > and = into >= reScanGreaterToken(); var newPrecedence = getBinaryOperatorPrecedence(); + // Check the precedence to see if we should "take" this operator if (newPrecedence <= precedence) { break; } - if (token === 86 && inDisallowInContext()) { + if (token === 86 /* InKeyword */ && inDisallowInContext()) { break; } leftOperand = makeBinaryExpression(leftOperand, parseTokenNode(), parseBinaryExpressionOrHigher(newPrecedence)); @@ -7383,97 +8351,99 @@ var ts; return leftOperand; } function isBinaryOperator() { - if (inDisallowInContext() && token === 86) { + if (inDisallowInContext() && token === 86 /* InKeyword */) { return false; } return getBinaryOperatorPrecedence() > 0; } function getBinaryOperatorPrecedence() { switch (token) { - case 49: + case 49 /* BarBarToken */: return 1; - case 48: + case 48 /* AmpersandAmpersandToken */: return 2; - case 44: + case 44 /* BarToken */: return 3; - case 45: + case 45 /* CaretToken */: return 4; - case 43: + case 43 /* AmpersandToken */: return 5; - case 28: - case 29: - case 30: - case 31: + case 28 /* EqualsEqualsToken */: + case 29 /* ExclamationEqualsToken */: + case 30 /* EqualsEqualsEqualsToken */: + case 31 /* ExclamationEqualsEqualsToken */: return 6; - case 24: - case 25: - case 26: - case 27: - case 87: - case 86: + case 24 /* LessThanToken */: + case 25 /* GreaterThanToken */: + case 26 /* LessThanEqualsToken */: + case 27 /* GreaterThanEqualsToken */: + case 87 /* InstanceOfKeyword */: + case 86 /* InKeyword */: return 7; - case 40: - case 41: - case 42: + case 40 /* LessThanLessThanToken */: + case 41 /* GreaterThanGreaterThanToken */: + case 42 /* GreaterThanGreaterThanGreaterThanToken */: return 8; - case 33: - case 34: + case 33 /* PlusToken */: + case 34 /* MinusToken */: return 9; - case 35: - case 36: - case 37: + case 35 /* AsteriskToken */: + case 36 /* SlashToken */: + case 37 /* PercentToken */: return 10; } + // -1 is lower than all other precedences. Returning it will cause binary expression + // parsing to stop. return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(169, left.pos); + var node = createNode(169 /* BinaryExpression */, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(167); + var node = createNode(167 /* PrefixUnaryExpression */); node.operator = token; nextToken(); node.operand = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(164); + var node = createNode(164 /* DeleteExpression */); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(165); + var node = createNode(165 /* TypeOfExpression */); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(166); + var node = createNode(166 /* VoidExpression */); nextToken(); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseUnaryExpressionOrHigher() { switch (token) { - case 33: - case 34: - case 47: - case 46: - case 38: - case 39: + case 33 /* PlusToken */: + case 34 /* MinusToken */: + case 47 /* TildeToken */: + case 46 /* ExclamationToken */: + case 38 /* PlusPlusToken */: + case 39 /* MinusMinusToken */: return parsePrefixUnaryExpression(); - case 74: + case 74 /* DeleteKeyword */: return parseDeleteExpression(); - case 97: + case 97 /* TypeOfKeyword */: return parseTypeOfExpression(); - case 99: + case 99 /* VoidKeyword */: return parseVoidExpression(); - case 24: + case 24 /* LessThanToken */: return parseTypeAssertion(); default: return parsePostfixExpressionOrHigher(); @@ -7481,9 +8451,9 @@ var ts; } function parsePostfixExpressionOrHigher() { var expression = parseLeftHandSideExpressionOrHigher(); - ts.Debug.assert(isLeftHandSideExpression(expression)); - if ((token === 38 || token === 39) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(168, expression.pos); + ts.Debug.assert(ts.isLeftHandSideExpression(expression)); + if ((token === 38 /* PlusPlusToken */ || token === 39 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { + var node = createNode(168 /* PostfixUnaryExpression */, expression.pos); node.operand = expression; node.operator = token; nextToken(); @@ -7492,63 +8462,147 @@ var ts; return expression; } function parseLeftHandSideExpressionOrHigher() { - var expression = token === 91 + // Original Ecma: + // LeftHandSideExpression: See 11.2 + // NewExpression + // CallExpression + // + // Our simplification: + // + // LeftHandSideExpression: See 11.2 + // MemberExpression + // CallExpression + // + // See comment in parseMemberExpressionOrHigher on how we replaced NewExpression with + // MemberExpression to make our lives easier. + // + // to best understand the below code, it's important to see how CallExpression expands + // out into its own productions: + // + // CallExpression: + // MemberExpression Arguments + // CallExpression Arguments + // CallExpression[Expression] + // CallExpression.IdentifierName + // super ( ArgumentListopt ) + // super.IdentifierName + // + // Because of the recursion in these calls, we need to bottom out first. There are two + // bottom out states we can run into. Either we see 'super' which must start either of + // the last two CallExpression productions. Or we have a MemberExpression which either + // completes the LeftHandSideExpression, or starts the beginning of the first four + // CallExpression productions. + var expression = token === 91 /* SuperKeyword */ ? parseSuperExpression() : parseMemberExpressionOrHigher(); + // Now, we *may* be complete. However, we might have consumed the start of a + // CallExpression. As such, we need to consume the rest of it here to be complete. return parseCallExpressionRest(expression); } function parseMemberExpressionOrHigher() { + // Note: to make our lives simpler, we decompose the the NewExpression productions and + // place ObjectCreationExpression and FunctionExpression into PrimaryExpression. + // like so: + // + // PrimaryExpression : See 11.1 + // this + // Identifier + // Literal + // ArrayLiteral + // ObjectLiteral + // (Expression) + // FunctionExpression + // new MemberExpression Arguments? + // + // MemberExpression : See 11.2 + // PrimaryExpression + // MemberExpression[Expression] + // MemberExpression.IdentifierName + // + // CallExpression : See 11.2 + // MemberExpression + // CallExpression Arguments + // CallExpression[Expression] + // CallExpression.IdentifierName + // + // Technically this is ambiguous. i.e. CallExpression defines: + // + // CallExpression: + // CallExpression Arguments + // + // If you see: "new Foo()" + // + // Then that could be treated as a single ObjectCreationExpression, or it could be + // treated as the invocation of "new Foo". We disambiguate that in code (to match + // the original grammar) by making sure that if we see an ObjectCreationExpression + // we always consume arguments if they are there. So we treat "new Foo()" as an + // object creation only, and not at all as an invocation) Another way to think + // about this is that for every "new" that we see, we will consume an argument list if + // it is there as part of the *associated* object creation node. Any additional + // argument lists we see, will become invocation expressions. + // + // Because there are no other places in the grammar now that refer to FunctionExpression + // or ObjectCreationExpression, it is safe to push down into the PrimaryExpression + // production. + // + // Because CallExpression and MemberExpression are left recursive, we need to bottom out + // of the recursion immediately. So we parse out a primary expression to start with. var expression = parsePrimaryExpression(); return parseMemberExpressionRest(expression); } function parseSuperExpression() { var expression = parseTokenNode(); - if (token === 16 || token === 20) { + if (token === 16 /* OpenParenToken */ || token === 20 /* DotToken */) { return expression; } - var node = createNode(155, expression.pos); + // If we have seen "super" it must be followed by '(' or '.'. + // If it wasn't then just try to parse out a '.' and report an error. + var node = createNode(155 /* PropertyAccessExpression */, expression.pos); node.expression = expression; - node.dotToken = parseExpectedToken(20, false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); + node.dotToken = parseExpectedToken(20 /* DotToken */, false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(true); return finishNode(node); } function parseTypeAssertion() { - var node = createNode(160); - parseExpected(24); + var node = createNode(160 /* TypeAssertionExpression */); + parseExpected(24 /* LessThanToken */); node.type = parseType(); - parseExpected(25); + parseExpected(25 /* GreaterThanToken */); node.expression = parseUnaryExpressionOrHigher(); return finishNode(node); } function parseMemberExpressionRest(expression) { while (true) { - var dotToken = parseOptionalToken(20); + var dotToken = parseOptionalToken(20 /* DotToken */); if (dotToken) { - var propertyAccess = createNode(155, expression.pos); + var propertyAccess = createNode(155 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.dotToken = dotToken; propertyAccess.name = parseRightSideOfDot(true); expression = finishNode(propertyAccess); continue; } - if (!inDecoratorContext() && parseOptional(18)) { - var indexedAccess = createNode(156, expression.pos); + // when in the [Decorator] context, we do not parse ElementAccess as it could be part of a ComputedPropertyName + if (!inDecoratorContext() && parseOptional(18 /* OpenBracketToken */)) { + var indexedAccess = createNode(156 /* ElementAccessExpression */, expression.pos); indexedAccess.expression = expression; - if (token !== 19) { + // It's not uncommon for a user to write: "new Type[]". + // Check for that common pattern and report a better error message. + if (token !== 19 /* CloseBracketToken */) { indexedAccess.argumentExpression = allowInAnd(parseExpression); - if (indexedAccess.argumentExpression.kind === 8 || indexedAccess.argumentExpression.kind === 7) { + if (indexedAccess.argumentExpression.kind === 8 /* StringLiteral */ || indexedAccess.argumentExpression.kind === 7 /* NumericLiteral */) { var literal = indexedAccess.argumentExpression; literal.text = internIdentifier(literal.text); } } - parseExpected(19); + parseExpected(19 /* CloseBracketToken */); expression = finishNode(indexedAccess); continue; } - if (token === 10 || token === 11) { - var tagExpression = createNode(159, expression.pos); + if (token === 10 /* NoSubstitutionTemplateLiteral */ || token === 11 /* TemplateHead */) { + var tagExpression = createNode(159 /* TaggedTemplateExpression */, expression.pos); tagExpression.tag = expression; - tagExpression.template = token === 10 + tagExpression.template = token === 10 /* NoSubstitutionTemplateLiteral */ ? parseLiteralNode() : parseTemplateExpression(); expression = finishNode(tagExpression); @@ -7560,20 +8614,24 @@ var ts; function parseCallExpressionRest(expression) { while (true) { expression = parseMemberExpressionRest(expression); - if (token === 24) { + if (token === 24 /* LessThanToken */) { + // See if this is the start of a generic invocation. If so, consume it and + // keep checking for postfix expressions. Otherwise, it's just a '<' that's + // part of an arithmetic expression. Break out so we consume it higher in the + // stack. var typeArguments = tryParse(parseTypeArgumentsInExpression); if (!typeArguments) { return expression; } - var callExpr = createNode(157, expression.pos); + var callExpr = createNode(157 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); continue; } - else if (token === 16) { - var callExpr = createNode(157, expression.pos); + else if (token === 16 /* OpenParenToken */) { + var callExpr = createNode(157 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -7583,121 +8641,133 @@ var ts; } } function parseArgumentList() { - parseExpected(16); - var result = parseDelimitedList(12, parseArgumentExpression); - parseExpected(17); + parseExpected(16 /* OpenParenToken */); + var result = parseDelimitedList(12 /* ArgumentExpressions */, parseArgumentExpression); + parseExpected(17 /* CloseParenToken */); return result; } function parseTypeArgumentsInExpression() { - if (!parseOptional(24)) { + if (!parseOptional(24 /* LessThanToken */)) { return undefined; } - var typeArguments = parseDelimitedList(17, parseType); - if (!parseExpected(25)) { + var typeArguments = parseDelimitedList(17 /* TypeArguments */, parseType); + if (!parseExpected(25 /* GreaterThanToken */)) { + // If it doesn't have the closing > then it's definitely not an type argument list. return undefined; } + // If we have a '<', then only parse this as a arugment list if the type arguments + // are complete and we have an open paren. if we don't, rewind and return nothing. return typeArguments && canFollowTypeArgumentsInExpression() ? typeArguments : undefined; } function canFollowTypeArgumentsInExpression() { switch (token) { - case 16: - case 20: - case 17: - case 19: - case 51: - case 22: - case 50: - case 28: - case 30: - case 29: - case 31: - case 48: - case 49: - case 45: - case 43: - case 44: - case 15: - case 1: + case 16 /* OpenParenToken */: // foo( + // this case are the only case where this token can legally follow a type argument + // list. So we definitely want to treat this as a type arg list. + case 20 /* DotToken */: // foo. + case 17 /* CloseParenToken */: // foo) + case 19 /* CloseBracketToken */: // foo] + case 51 /* ColonToken */: // foo: + case 22 /* SemicolonToken */: // foo; + case 50 /* QuestionToken */: // foo? + case 28 /* EqualsEqualsToken */: // foo == + case 30 /* EqualsEqualsEqualsToken */: // foo === + case 29 /* ExclamationEqualsToken */: // foo != + case 31 /* ExclamationEqualsEqualsToken */: // foo !== + case 48 /* AmpersandAmpersandToken */: // foo && + case 49 /* BarBarToken */: // foo || + case 45 /* CaretToken */: // foo ^ + case 43 /* AmpersandToken */: // foo & + case 44 /* BarToken */: // foo | + case 15 /* CloseBraceToken */: // foo } + case 1 /* EndOfFileToken */: + // these cases can't legally follow a type arg list. However, they're not legal + // expressions either. The user is probably in the middle of a generic type. So + // treat it as such. return true; - case 23: - case 14: + case 23 /* CommaToken */: // foo, + case 14 /* 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; } } function parsePrimaryExpression() { switch (token) { - case 7: - case 8: - case 10: + case 7 /* NumericLiteral */: + case 8 /* StringLiteral */: + case 10 /* NoSubstitutionTemplateLiteral */: return parseLiteralNode(); - case 93: - case 91: - case 89: - case 95: - case 80: + case 93 /* ThisKeyword */: + case 91 /* SuperKeyword */: + case 89 /* NullKeyword */: + case 95 /* TrueKeyword */: + case 80 /* FalseKeyword */: return parseTokenNode(); - case 16: + case 16 /* OpenParenToken */: return parseParenthesizedExpression(); - case 18: + case 18 /* OpenBracketToken */: return parseArrayLiteralExpression(); - case 14: + case 14 /* OpenBraceToken */: return parseObjectLiteralExpression(); - case 69: + case 69 /* ClassKeyword */: return parseClassExpression(); - case 83: + case 83 /* FunctionKeyword */: return parseFunctionExpression(); - case 88: + case 88 /* NewKeyword */: return parseNewExpression(); - case 36: - case 57: - if (reScanSlashToken() === 9) { + case 36 /* SlashToken */: + case 57 /* SlashEqualsToken */: + if (reScanSlashToken() === 9 /* RegularExpressionLiteral */) { return parseLiteralNode(); } break; - case 11: + case 11 /* TemplateHead */: return parseTemplateExpression(); } return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNode(161); - parseExpected(16); + var node = createNode(161 /* ParenthesizedExpression */); + parseExpected(16 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); - parseExpected(17); + parseExpected(17 /* CloseParenToken */); return finishNode(node); } function parseSpreadElement() { - var node = createNode(173); - parseExpected(21); + var node = createNode(173 /* SpreadElementExpression */); + parseExpected(21 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { - return token === 21 ? parseSpreadElement() : - token === 23 ? createNode(175) : + return token === 21 /* DotDotDotToken */ ? parseSpreadElement() : + token === 23 /* CommaToken */ ? createNode(175 /* OmittedExpression */) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(153); - parseExpected(18); + var node = createNode(153 /* ArrayLiteralExpression */); + parseExpected(18 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) - node.flags |= 512; - node.elements = parseDelimitedList(14, parseArgumentOrArrayLiteralElement); - parseExpected(19); + node.flags |= 512 /* MultiLine */; + node.elements = parseDelimitedList(14 /* ArrayLiteralMembers */, parseArgumentOrArrayLiteralElement); + parseExpected(19 /* CloseBracketToken */); return finishNode(node); } function tryParseAccessorDeclaration(fullStart, decorators, modifiers) { - if (parseContextualModifier(116)) { - return parseAccessorDeclaration(136, fullStart, decorators, modifiers); + if (parseContextualModifier(116 /* GetKeyword */)) { + return parseAccessorDeclaration(136 /* GetAccessor */, fullStart, decorators, modifiers); } - else if (parseContextualModifier(120)) { - return parseAccessorDeclaration(137, fullStart, decorators, modifiers); + else if (parseContextualModifier(120 /* SetKeyword */)) { + return parseAccessorDeclaration(137 /* SetAccessor */, fullStart, decorators, modifiers); } return undefined; } @@ -7709,49 +8779,55 @@ var ts; if (accessor) { return accessor; } - var asteriskToken = parseOptionalToken(35); + var asteriskToken = parseOptionalToken(35 /* AsteriskToken */); var tokenIsIdentifier = isIdentifier(); var nameToken = token; var propertyName = parsePropertyName(); - var questionToken = parseOptionalToken(50); - if (asteriskToken || token === 16 || token === 24) { + // Disallowing of optional property assignments happens in the grammar checker. + var questionToken = parseOptionalToken(50 /* QuestionToken */); + if (asteriskToken || token === 16 /* OpenParenToken */ || token === 24 /* LessThanToken */) { return parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, propertyName, questionToken); } - if ((token === 23 || token === 15) && tokenIsIdentifier) { - var shorthandDeclaration = createNode(225, fullStart); + // Parse to check if it is short-hand property assignment or normal property assignment + if ((token === 23 /* CommaToken */ || token === 15 /* CloseBraceToken */) && tokenIsIdentifier) { + var shorthandDeclaration = createNode(225 /* ShorthandPropertyAssignment */, fullStart); shorthandDeclaration.name = propertyName; shorthandDeclaration.questionToken = questionToken; return finishNode(shorthandDeclaration); } else { - var propertyAssignment = createNode(224, fullStart); + var propertyAssignment = createNode(224 /* PropertyAssignment */, fullStart); propertyAssignment.name = propertyName; propertyAssignment.questionToken = questionToken; - parseExpected(51); + parseExpected(51 /* ColonToken */); propertyAssignment.initializer = allowInAnd(parseAssignmentExpressionOrHigher); return finishNode(propertyAssignment); } } function parseObjectLiteralExpression() { - var node = createNode(154); - parseExpected(14); + var node = createNode(154 /* ObjectLiteralExpression */); + parseExpected(14 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { - node.flags |= 512; + node.flags |= 512 /* MultiLine */; } - node.properties = parseDelimitedList(13, parseObjectLiteralElement, true); - parseExpected(15); + node.properties = parseDelimitedList(13 /* ObjectLiteralMembers */, parseObjectLiteralElement, true); + parseExpected(15 /* CloseBraceToken */); return finishNode(node); } function parseFunctionExpression() { + // GeneratorExpression : + // function * BindingIdentifier[Yield]opt (FormalParameters[Yield, GeneratorParameter]) { GeneratorBody[Yield] } + // FunctionExpression: + // function BindingIdentifieropt(FormalParameters) { FunctionBody } var saveDecoratorContext = inDecoratorContext(); if (saveDecoratorContext) { setDecoratorContext(false); } - var node = createNode(162); - parseExpected(83); - node.asteriskToken = parseOptionalToken(35); + var node = createNode(162 /* FunctionExpression */); + parseExpected(83 /* FunctionKeyword */); + node.asteriskToken = parseOptionalToken(35 /* AsteriskToken */); node.name = node.asteriskToken ? doInYieldContext(parseOptionalIdentifier) : parseOptionalIdentifier(); - fillSignature(51, !!node.asteriskToken, false, node); + fillSignature(51 /* ColonToken */, !!node.asteriskToken, false, node); node.body = parseFunctionBlock(!!node.asteriskToken, false); if (saveDecoratorContext) { setDecoratorContext(true); @@ -7762,20 +8838,21 @@ var ts; return isIdentifier() ? parseIdentifier() : undefined; } function parseNewExpression() { - var node = createNode(158); - parseExpected(88); + var node = createNode(158 /* NewExpression */); + parseExpected(88 /* NewKeyword */); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); - if (node.typeArguments || token === 16) { + if (node.typeArguments || token === 16 /* OpenParenToken */) { node.arguments = parseArgumentList(); } return finishNode(node); } + // STATEMENTS function parseBlock(ignoreMissingOpenBrace, checkForStrictMode, diagnosticMessage) { - var node = createNode(179); - if (parseExpected(14, diagnosticMessage) || ignoreMissingOpenBrace) { - node.statements = parseList(2, checkForStrictMode, parseStatement); - parseExpected(15); + var node = createNode(179 /* Block */); + if (parseExpected(14 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { + node.statements = parseList(2 /* BlockStatements */, checkForStrictMode, parseStatement); + parseExpected(15 /* CloseBraceToken */); } else { node.statements = createMissingList(); @@ -7785,6 +8862,8 @@ var ts; function parseFunctionBlock(allowYield, ignoreMissingOpenBrace, diagnosticMessage) { var savedYieldContext = inYieldContext(); setYieldContext(allowYield); + // We may be in a [Decorator] context when parsing a function expression or + // arrow function. The body of the function is not in [Decorator] context. var saveDecoratorContext = inDecoratorContext(); if (saveDecoratorContext) { setDecoratorContext(false); @@ -7797,47 +8876,51 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(181); - parseExpected(22); + var node = createNode(181 /* EmptyStatement */); + parseExpected(22 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(183); - parseExpected(84); - parseExpected(16); + var node = createNode(183 /* IfStatement */); + parseExpected(84 /* IfKeyword */); + parseExpected(16 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); - parseExpected(17); + parseExpected(17 /* CloseParenToken */); node.thenStatement = parseStatement(); - node.elseStatement = parseOptional(76) ? parseStatement() : undefined; + node.elseStatement = parseOptional(76 /* ElseKeyword */) ? parseStatement() : undefined; return finishNode(node); } function parseDoStatement() { - var node = createNode(184); - parseExpected(75); + var node = createNode(184 /* DoStatement */); + parseExpected(75 /* DoKeyword */); node.statement = parseStatement(); - parseExpected(100); - parseExpected(16); + parseExpected(100 /* WhileKeyword */); + parseExpected(16 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); - parseExpected(17); - parseOptional(22); + parseExpected(17 /* CloseParenToken */); + // From: https://mail.mozilla.org/pipermail/es-discuss/2011-August/016188.html + // 157 min --- All allen at wirfs-brock.com CONF --- "do{;}while(false)false" prohibited in + // spec but allowed in consensus reality. Approved -- this is the de-facto standard whereby + // do;while(0)x will have a semicolon inserted before x. + parseOptional(22 /* SemicolonToken */); return finishNode(node); } function parseWhileStatement() { - var node = createNode(185); - parseExpected(100); - parseExpected(16); + var node = createNode(185 /* WhileStatement */); + parseExpected(100 /* WhileKeyword */); + parseExpected(16 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); - parseExpected(17); + parseExpected(17 /* CloseParenToken */); node.statement = parseStatement(); return finishNode(node); } function parseForOrForInOrForOfStatement() { var pos = getNodePos(); - parseExpected(82); - parseExpected(16); + parseExpected(82 /* ForKeyword */); + parseExpected(16 /* OpenParenToken */); var initializer = undefined; - if (token !== 22) { - if (token === 98 || token === 105 || token === 70) { + if (token !== 22 /* SemicolonToken */) { + if (token === 98 /* VarKeyword */ || token === 104 /* LetKeyword */ || token === 70 /* ConstKeyword */) { initializer = parseVariableDeclarationList(true); } else { @@ -7845,32 +8928,32 @@ var ts; } } var forOrForInOrForOfStatement; - if (parseOptional(86)) { - var forInStatement = createNode(187, pos); + if (parseOptional(86 /* InKeyword */)) { + var forInStatement = createNode(187 /* ForInStatement */, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); - parseExpected(17); + parseExpected(17 /* CloseParenToken */); forOrForInOrForOfStatement = forInStatement; } - else if (parseOptional(125)) { - var forOfStatement = createNode(188, pos); + else if (parseOptional(125 /* OfKeyword */)) { + var forOfStatement = createNode(188 /* ForOfStatement */, pos); forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); - parseExpected(17); + parseExpected(17 /* CloseParenToken */); forOrForInOrForOfStatement = forOfStatement; } else { - var forStatement = createNode(186, pos); + var forStatement = createNode(186 /* ForStatement */, pos); forStatement.initializer = initializer; - parseExpected(22); - if (token !== 22 && token !== 17) { + parseExpected(22 /* SemicolonToken */); + if (token !== 22 /* SemicolonToken */ && token !== 17 /* CloseParenToken */) { forStatement.condition = allowInAnd(parseExpression); } - parseExpected(22); - if (token !== 17) { + parseExpected(22 /* SemicolonToken */); + if (token !== 17 /* CloseParenToken */) { forStatement.iterator = allowInAnd(parseExpression); } - parseExpected(17); + parseExpected(17 /* CloseParenToken */); forOrForInOrForOfStatement = forStatement; } forOrForInOrForOfStatement.statement = parseStatement(); @@ -7878,7 +8961,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 190 ? 66 : 71); + parseExpected(kind === 190 /* BreakStatement */ ? 66 /* BreakKeyword */ : 71 /* ContinueKeyword */); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -7886,8 +8969,8 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(191); - parseExpected(90); + var node = createNode(191 /* ReturnStatement */); + parseExpected(90 /* ReturnKeyword */); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); } @@ -7895,98 +8978,115 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(192); - parseExpected(101); - parseExpected(16); + var node = createNode(192 /* WithStatement */); + parseExpected(101 /* WithKeyword */); + parseExpected(16 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); - parseExpected(17); + parseExpected(17 /* CloseParenToken */); node.statement = parseStatement(); return finishNode(node); } function parseCaseClause() { - var node = createNode(220); - parseExpected(67); + var node = createNode(220 /* CaseClause */); + parseExpected(67 /* CaseKeyword */); node.expression = allowInAnd(parseExpression); - parseExpected(51); - node.statements = parseList(4, false, parseStatement); + parseExpected(51 /* ColonToken */); + node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatement); return finishNode(node); } function parseDefaultClause() { - var node = createNode(221); - parseExpected(73); - parseExpected(51); - node.statements = parseList(4, false, parseStatement); + var node = createNode(221 /* DefaultClause */); + parseExpected(73 /* DefaultKeyword */); + parseExpected(51 /* ColonToken */); + node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatement); return finishNode(node); } function parseCaseOrDefaultClause() { - return token === 67 ? parseCaseClause() : parseDefaultClause(); + return token === 67 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(193); - parseExpected(92); - parseExpected(16); + var node = createNode(193 /* SwitchStatement */); + parseExpected(92 /* SwitchKeyword */); + parseExpected(16 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); - parseExpected(17); - var caseBlock = createNode(207, scanner.getStartPos()); - parseExpected(14); - caseBlock.clauses = parseList(3, false, parseCaseOrDefaultClause); - parseExpected(15); + parseExpected(17 /* CloseParenToken */); + var caseBlock = createNode(207 /* CaseBlock */, scanner.getStartPos()); + parseExpected(14 /* OpenBraceToken */); + caseBlock.clauses = parseList(3 /* SwitchClauses */, false, parseCaseOrDefaultClause); + parseExpected(15 /* CloseBraceToken */); node.caseBlock = finishNode(caseBlock); return finishNode(node); } function parseThrowStatement() { // ThrowStatement[Yield] : // throw [no LineTerminator here]Expression[In, ?Yield]; - var node = createNode(195); - parseExpected(94); + // Because of automatic semicolon insertion, we need to report error if this + // throw could be terminated with a semicolon. Note: we can't call 'parseExpression' + // directly as that might consume an expression on the following line. + // We just return 'undefined' in that case. The actual error will be reported in the + // grammar walker. + var node = createNode(195 /* ThrowStatement */); + parseExpected(94 /* ThrowKeyword */); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); return finishNode(node); } + // TODO: Review for error recovery function parseTryStatement() { - var node = createNode(196); - parseExpected(96); + var node = createNode(196 /* TryStatement */); + parseExpected(96 /* TryKeyword */); node.tryBlock = parseBlock(false, false); - node.catchClause = token === 68 ? parseCatchClause() : undefined; - if (!node.catchClause || token === 81) { - parseExpected(81); + node.catchClause = token === 68 /* CatchKeyword */ ? parseCatchClause() : undefined; + // If we don't have a catch clause, then we must have a finally clause. Try to parse + // one out no matter what. + if (!node.catchClause || token === 81 /* FinallyKeyword */) { + parseExpected(81 /* FinallyKeyword */); node.finallyBlock = parseBlock(false, false); } return finishNode(node); } function parseCatchClause() { - var result = createNode(223); - parseExpected(68); - if (parseExpected(16)) { + var result = createNode(223 /* CatchClause */); + parseExpected(68 /* CatchKeyword */); + if (parseExpected(16 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); } - parseExpected(17); + parseExpected(17 /* CloseParenToken */); result.block = parseBlock(false, false); return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(197); - parseExpected(72); + var node = createNode(197 /* DebuggerStatement */); + parseExpected(72 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); } function parseExpressionOrLabeledStatement() { + // Avoiding having to do the lookahead for a labeled statement by just trying to parse + // out an expression, seeing if it is identifier and then seeing if it is followed by + // a colon. var fullStart = scanner.getStartPos(); var expression = allowInAnd(parseExpression); - if (expression.kind === 65 && parseOptional(51)) { - var labeledStatement = createNode(194, fullStart); + if (expression.kind === 65 /* Identifier */ && parseOptional(51 /* ColonToken */)) { + var labeledStatement = createNode(194 /* LabeledStatement */, fullStart); labeledStatement.label = expression; labeledStatement.statement = parseStatement(); return finishNode(labeledStatement); } else { - var expressionStatement = createNode(182, fullStart); + var expressionStatement = createNode(182 /* ExpressionStatement */, fullStart); expressionStatement.expression = expression; parseSemicolon(); return finishNode(expressionStatement); } } function isStartOfStatement(inErrorRecovery) { + // 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 (ts.isModifier(token)) { var result = lookAhead(parseVariableStatementOrFunctionDeclarationOrClassDeclarationWithDecoratorsOrModifiers); if (result) { @@ -7994,42 +9094,57 @@ var ts; } } switch (token) { - case 22: + case 22 /* SemicolonToken */: + // If we're in error recovery, then we don't want to treat ';' as an empty statement. + // The problem is that ';' can show up in far too many contexts, and if we see one + // and assume it's a statement, then we may bail out inappropriately from whatever + // we're parsing. For example, if we have a semicolon in the middle of a class, then + // we really don't want to assume the class is over and we're on a statement in the + // outer module. We just want to consume and move on. return !inErrorRecovery; - case 14: - case 98: - case 105: - case 83: - 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: + case 14 /* OpenBraceToken */: + case 98 /* VarKeyword */: + case 104 /* LetKeyword */: + case 83 /* FunctionKeyword */: + case 69 /* ClassKeyword */: + case 84 /* IfKeyword */: + case 75 /* DoKeyword */: + case 100 /* WhileKeyword */: + case 82 /* ForKeyword */: + case 71 /* ContinueKeyword */: + case 66 /* BreakKeyword */: + case 90 /* ReturnKeyword */: + case 101 /* WithKeyword */: + case 92 /* SwitchKeyword */: + case 94 /* ThrowKeyword */: + case 96 /* TryKeyword */: + case 72 /* DebuggerKeyword */: + // 'catch' and 'finally' do not actually indicate that the code is part of a statement, + // however, we say they are here so that we may gracefully parse them and error later. + case 68 /* CatchKeyword */: + case 81 /* FinallyKeyword */: return true; - case 70: + case 70 /* ConstKeyword */: + // const keyword can precede enum keyword when defining constant enums + // 'const enum' do not start statement. + // In ES 6 'enum' is a future reserved keyword, so it should not be used as identifier var isConstEnum = lookAhead(nextTokenIsEnumKeyword); return !isConstEnum; - case 104: - case 117: - case 77: - case 123: + case 103 /* InterfaceKeyword */: + case 117 /* ModuleKeyword */: + case 77 /* EnumKeyword */: + case 123 /* TypeKeyword */: + // When followed by an identifier, these do not start a statement but might + // instead be following declarations if (isDeclarationStart()) { return false; } - case 109: - case 107: - case 108: - case 110: + case 108 /* PublicKeyword */: + case 106 /* PrivateKeyword */: + case 107 /* ProtectedKeyword */: + case 109 /* StaticKeyword */: + // When followed by an identifier or keyword, these do not start a statement but + // might instead be following type members if (lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine)) { return false; } @@ -8039,7 +9154,7 @@ var ts; } function nextTokenIsEnumKeyword() { nextToken(); - return token === 77; + return token === 77 /* EnumKeyword */; } function nextTokenIsIdentifierOrKeywordOnSameLine() { nextToken(); @@ -8047,49 +9162,61 @@ var ts; } function parseStatement() { switch (token) { - case 14: + case 14 /* OpenBraceToken */: return parseBlock(false, false); - case 98: - case 70: + case 98 /* VarKeyword */: + case 70 /* ConstKeyword */: + // const here should always be parsed as const declaration because of check in 'isStatement' return parseVariableStatement(scanner.getStartPos(), undefined, undefined); - case 83: + case 83 /* FunctionKeyword */: return parseFunctionDeclaration(scanner.getStartPos(), undefined, undefined); - case 69: + case 69 /* ClassKeyword */: return parseClassDeclaration(scanner.getStartPos(), undefined, undefined); - case 22: + case 22 /* SemicolonToken */: return parseEmptyStatement(); - case 84: + case 84 /* IfKeyword */: return parseIfStatement(); - case 75: + case 75 /* DoKeyword */: return parseDoStatement(); - case 100: + case 100 /* WhileKeyword */: return parseWhileStatement(); - case 82: + case 82 /* ForKeyword */: return parseForOrForInOrForOfStatement(); - case 71: - return parseBreakOrContinueStatement(189); - case 66: - return parseBreakOrContinueStatement(190); - case 90: + case 71 /* ContinueKeyword */: + return parseBreakOrContinueStatement(189 /* ContinueStatement */); + case 66 /* BreakKeyword */: + return parseBreakOrContinueStatement(190 /* BreakStatement */); + case 90 /* ReturnKeyword */: return parseReturnStatement(); - case 101: + case 101 /* WithKeyword */: return parseWithStatement(); - case 92: + case 92 /* SwitchKeyword */: return parseSwitchStatement(); - case 94: + case 94 /* ThrowKeyword */: return parseThrowStatement(); - case 96: - case 68: - case 81: + case 96 /* TryKeyword */: + // Include the next two for error recovery. + case 68 /* CatchKeyword */: + case 81 /* FinallyKeyword */: return parseTryStatement(); - case 72: + case 72 /* DebuggerKeyword */: return parseDebuggerStatement(); - case 105: + case 104 /* LetKeyword */: + // If let follows identifier on the same line, it is declaration parse it as variable statement if (isLetDeclaration()) { return parseVariableStatement(scanner.getStartPos(), undefined, undefined); } + // Else parse it like identifier - fall through default: - if (ts.isModifier(token) || token === 52) { + // 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. + // Even though variable statements and function declarations cannot have decorators, + // we parse them here to provide better error recovery. + if (ts.isModifier(token) || token === 52 /* AtToken */) { var result = tryParse(parseVariableStatementOrFunctionDeclarationOrClassDeclarationWithDecoratorsOrModifiers); if (result) { return result; @@ -8103,85 +9230,88 @@ var ts; var decorators = parseDecorators(); var modifiers = parseModifiers(); switch (token) { - case 70: + case 70 /* ConstKeyword */: var nextTokenIsEnum = lookAhead(nextTokenIsEnumKeyword); if (nextTokenIsEnum) { return undefined; } return parseVariableStatement(start, decorators, modifiers); - case 105: + case 104 /* LetKeyword */: if (!isLetDeclaration()) { return undefined; } return parseVariableStatement(start, decorators, modifiers); - case 98: + case 98 /* VarKeyword */: return parseVariableStatement(start, decorators, modifiers); - case 83: + case 83 /* FunctionKeyword */: return parseFunctionDeclaration(start, decorators, modifiers); - case 69: + case 69 /* ClassKeyword */: return parseClassDeclaration(start, decorators, modifiers); } return undefined; } function parseFunctionBlockOrSemicolon(isGenerator, diagnosticMessage) { - if (token !== 14 && canParseSemicolon()) { + if (token !== 14 /* OpenBraceToken */ && canParseSemicolon()) { parseSemicolon(); return; } return parseFunctionBlock(isGenerator, false, diagnosticMessage); } + // DECLARATIONS function parseArrayBindingElement() { - if (token === 23) { - return createNode(175); + if (token === 23 /* CommaToken */) { + return createNode(175 /* OmittedExpression */); } - var node = createNode(152); - node.dotDotDotToken = parseOptionalToken(21); + var node = createNode(152 /* BindingElement */); + node.dotDotDotToken = parseOptionalToken(21 /* DotDotDotToken */); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(false); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(152); - var id = parsePropertyName(); - if (id.kind === 65 && token !== 51) { - node.name = id; + var node = createNode(152 /* BindingElement */); + // TODO(andersh): Handle computed properties + var tokenIsIdentifier = isIdentifier(); + var propertyName = parsePropertyName(); + if (tokenIsIdentifier && token !== 51 /* ColonToken */) { + node.name = propertyName; } else { - parseExpected(51); - node.propertyName = id; + parseExpected(51 /* ColonToken */); + node.propertyName = propertyName; node.name = parseIdentifierOrPattern(); } node.initializer = parseInitializer(false); return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(150); - parseExpected(14); - node.elements = parseDelimitedList(10, parseObjectBindingElement); - parseExpected(15); + var node = createNode(150 /* ObjectBindingPattern */); + parseExpected(14 /* OpenBraceToken */); + node.elements = parseDelimitedList(10 /* ObjectBindingElements */, parseObjectBindingElement); + parseExpected(15 /* CloseBraceToken */); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(151); - parseExpected(18); - node.elements = parseDelimitedList(11, parseArrayBindingElement); - parseExpected(19); + var node = createNode(151 /* ArrayBindingPattern */); + parseExpected(18 /* OpenBracketToken */); + node.elements = parseDelimitedList(11 /* ArrayBindingElements */, parseArrayBindingElement); + parseExpected(19 /* CloseBracketToken */); return finishNode(node); } function isIdentifierOrPattern() { - return token === 14 || token === 18 || isIdentifier(); + return token === 14 /* OpenBraceToken */ || token === 18 /* OpenBracketToken */ || isIdentifier(); } function parseIdentifierOrPattern() { - if (token === 18) { + if (token === 18 /* OpenBracketToken */) { return parseArrayBindingPattern(); } - if (token === 14) { + if (token === 14 /* OpenBraceToken */) { return parseObjectBindingPattern(); } return parseIdentifier(); } function parseVariableDeclaration() { - var node = createNode(198); + var node = createNode(198 /* VariableDeclaration */); node.name = parseIdentifierOrPattern(); node.type = parseTypeAnnotation(); if (!isInOrOfKeyword(token)) { @@ -8190,36 +9320,45 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(199); + var node = createNode(199 /* VariableDeclarationList */); switch (token) { - case 98: + case 98 /* VarKeyword */: break; - case 105: - node.flags |= 4096; + case 104 /* LetKeyword */: + node.flags |= 4096 /* Let */; break; - case 70: - node.flags |= 8192; + case 70 /* ConstKeyword */: + node.flags |= 8192 /* Const */; break; default: ts.Debug.fail(); } nextToken(); - if (token === 125 && lookAhead(canFollowContextualOfKeyword)) { + // The user may have written the following: + // + // for (let of X) { } + // + // In this case, we want to parse an empty declaration list, and then parse 'of' + // as a keyword. The reason this is not automatic is that 'of' is a valid identifier. + // So we need to look ahead to determine if 'of' should be treated as a keyword in + // this context. + // The checker will then give an error that there is an empty declaration list. + if (token === 125 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { var savedDisallowIn = inDisallowInContext(); setDisallowInContext(inForStatementInitializer); - node.declarations = parseDelimitedList(9, parseVariableDeclaration); + node.declarations = parseDelimitedList(9 /* VariableDeclarations */, parseVariableDeclaration); setDisallowInContext(savedDisallowIn); } return finishNode(node); } function canFollowContextualOfKeyword() { - return nextTokenIsIdentifier() && nextToken() === 17; + return nextTokenIsIdentifier() && nextToken() === 17 /* CloseParenToken */; } function parseVariableStatement(fullStart, decorators, modifiers) { - var node = createNode(180, fullStart); + var node = createNode(180 /* VariableStatement */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.declarationList = parseVariableDeclarationList(false); @@ -8227,38 +9366,38 @@ var ts; return finishNode(node); } function parseFunctionDeclaration(fullStart, decorators, modifiers) { - var node = createNode(200, fullStart); + var node = createNode(200 /* FunctionDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(83); - node.asteriskToken = parseOptionalToken(35); - node.name = node.flags & 256 ? parseOptionalIdentifier() : parseIdentifier(); - fillSignature(51, !!node.asteriskToken, false, node); + parseExpected(83 /* FunctionKeyword */); + node.asteriskToken = parseOptionalToken(35 /* AsteriskToken */); + node.name = node.flags & 256 /* Default */ ? parseOptionalIdentifier() : parseIdentifier(); + fillSignature(51 /* ColonToken */, !!node.asteriskToken, false, node); node.body = parseFunctionBlockOrSemicolon(!!node.asteriskToken, ts.Diagnostics.or_expected); return finishNode(node); } function parseConstructorDeclaration(pos, decorators, modifiers) { - var node = createNode(135, pos); + var node = createNode(135 /* Constructor */, pos); node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(114); - fillSignature(51, false, false, node); + parseExpected(114 /* ConstructorKeyword */); + fillSignature(51 /* ColonToken */, false, false, node); node.body = parseFunctionBlockOrSemicolon(false, ts.Diagnostics.or_expected); return finishNode(node); } function parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, diagnosticMessage) { - var method = createNode(134, fullStart); + var method = createNode(134 /* MethodDeclaration */, fullStart); method.decorators = decorators; setModifiers(method, modifiers); method.asteriskToken = asteriskToken; method.name = name; method.questionToken = questionToken; - fillSignature(51, !!asteriskToken, false, method); + fillSignature(51 /* ColonToken */, !!asteriskToken, false, method); method.body = parseFunctionBlockOrSemicolon(!!asteriskToken, diagnosticMessage); return finishNode(method); } function parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken) { - var property = createNode(132, fullStart); + var property = createNode(132 /* PropertyDeclaration */, fullStart); property.decorators = decorators; setModifiers(property, modifiers); property.name = name; @@ -8269,10 +9408,12 @@ var ts; return finishNode(property); } function parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers) { - var asteriskToken = parseOptionalToken(35); + var asteriskToken = parseOptionalToken(35 /* AsteriskToken */); var name = parsePropertyName(); - var questionToken = parseOptionalToken(50); - if (asteriskToken || token === 16 || token === 24) { + // Note: this is not legal as per the grammar. But we allow it in the parser and + // report an error in the grammar checker. + var questionToken = parseOptionalToken(50 /* QuestionToken */); + if (asteriskToken || token === 16 /* OpenParenToken */ || token === 24 /* LessThanToken */) { return parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, ts.Diagnostics.or_expected); } else { @@ -8287,41 +9428,74 @@ var ts; node.decorators = decorators; setModifiers(node, modifiers); node.name = parsePropertyName(); - fillSignature(51, false, false, node); + fillSignature(51 /* ColonToken */, false, false, node); node.body = parseFunctionBlockOrSemicolon(false); return finishNode(node); } + function isClassMemberModifier(idToken) { + switch (idToken) { + case 108 /* PublicKeyword */: + case 106 /* PrivateKeyword */: + case 107 /* ProtectedKeyword */: + case 109 /* StaticKeyword */: + return true; + default: + return false; + } + } function isClassMemberStart() { var idToken; - if (token === 52) { + if (token === 52 /* AtToken */) { return true; } + // Eat up all modifiers, but hold on to the last one in case it is actually an identifier. while (ts.isModifier(token)) { idToken = token; + // If the idToken is a class modifier (protected, private, public, and static), it is + // certain that we are starting to parse class member. This allows better error recovery + // Example: + // public foo() ... // true + // public @dec blah ... // true; we will then report an error later + // export public ... // true; we will then report an error later + if (isClassMemberModifier(idToken)) { + return true; + } nextToken(); } - if (token === 35) { + if (token === 35 /* AsteriskToken */) { return true; } + // Try to get the first property-like token following all modifiers. + // This can either be an identifier or the 'get' or 'set' keywords. if (isLiteralPropertyName()) { idToken = token; nextToken(); } - if (token === 18) { + // Index signatures and computed properties are class members; we can parse. + if (token === 18 /* OpenBracketToken */) { return true; } + // If we were able to get any potential identifier... if (idToken !== undefined) { - if (!ts.isKeyword(idToken) || idToken === 120 || idToken === 116) { + // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. + if (!ts.isKeyword(idToken) || idToken === 120 /* SetKeyword */ || idToken === 116 /* GetKeyword */) { return true; } + // If it *is* a keyword, but not an accessor, check a little farther along + // to see if it should actually be parsed as a class member. switch (token) { - case 16: - case 24: - case 51: - case 53: - case 50: + case 16 /* OpenParenToken */: // Method declaration + case 24 /* LessThanToken */: // Generic Method declaration + case 51 /* ColonToken */: // Type Annotation for declaration + case 53 /* EqualsToken */: // Initializer for declaration + case 50 /* QuestionToken */: return true; default: + // Covers + // - Semicolons (declaration termination) + // - Closing braces (end-of-class, must be declaration) + // - End-of-files (not valid, but permitted so that it gets caught later on) + // - Line-breaks (enabling *automatic semicolon insertion*) return canParseSemicolon(); } } @@ -8331,14 +9505,14 @@ var ts; var decorators; while (true) { var decoratorStart = getNodePos(); - if (!parseOptional(52)) { + if (!parseOptional(52 /* AtToken */)) { break; } if (!decorators) { decorators = []; decorators.pos = scanner.getStartPos(); } - var decorator = createNode(130, decoratorStart); + var decorator = createNode(130 /* Decorator */, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); decorators.push(finishNode(decorator)); } @@ -8360,7 +9534,7 @@ var ts; modifiers = []; modifiers.pos = modifierStart; } - flags |= modifierToFlag(modifierKind); + flags |= ts.modifierToFlag(modifierKind); modifiers.push(finishNode(createNode(modifierKind, modifierStart))); } if (modifiers) { @@ -8370,8 +9544,8 @@ var ts; return modifiers; } function parseClassElement() { - if (token === 22) { - var result = createNode(178); + if (token === 22 /* SemicolonToken */) { + var result = createNode(178 /* SemicolonClassElement */); nextToken(); return finishNode(result); } @@ -8382,48 +9556,57 @@ var ts; if (accessor) { return accessor; } - if (token === 114) { + if (token === 114 /* ConstructorKeyword */) { return parseConstructorDeclaration(fullStart, decorators, modifiers); } if (isIndexSignature()) { return parseIndexSignatureDeclaration(fullStart, decorators, modifiers); } + // It is very important that we check this *after* checking indexers because + // the [ token can start an index signature or a computed property name if (isIdentifierOrKeyword() || - token === 8 || - token === 7 || - token === 35 || - token === 18) { + token === 8 /* StringLiteral */ || + token === 7 /* NumericLiteral */ || + token === 35 /* AsteriskToken */ || + token === 18 /* OpenBracketToken */) { return parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers); } if (decorators) { - var name_3 = createMissingNode(65, true, ts.Diagnostics.Declaration_expected); + // treat this as a property declaration with a missing name. + var name_3 = createMissingNode(65 /* Identifier */, true, ts.Diagnostics.Declaration_expected); return parsePropertyDeclaration(fullStart, decorators, modifiers, name_3, undefined); } + // 'isClassMemberStart' should have hinted not to attempt parsing. ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(scanner.getStartPos(), undefined, undefined, 174); + return parseClassDeclarationOrExpression( + /*fullStart:*/ scanner.getStartPos(), + /*decorators:*/ undefined, + /*modifiers:*/ undefined, 174 /* ClassExpression */); } function parseClassDeclaration(fullStart, decorators, modifiers) { - return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 201); + return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 201 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) { + // In ES6 specification, All parts of a ClassDeclaration or a ClassExpression are strict mode code var savedStrictModeContext = inStrictModeContext(); - if (languageVersion >= 2) { - setStrictModeContext(true); - } + setStrictModeContext(true); var node = createNode(kind, fullStart); node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(69); - node.name = node.flags & 256 ? parseOptionalIdentifier() : parseIdentifier(); + parseExpected(69 /* ClassKeyword */); + node.name = parseOptionalIdentifier(); node.typeParameters = parseTypeParameters(); node.heritageClauses = parseHeritageClauses(true); - if (parseExpected(14)) { + if (parseExpected(14 /* OpenBraceToken */)) { + // ClassTail[Yield,GeneratorParameter] : See 14.5 + // [~GeneratorParameter]ClassHeritage[?Yield]opt { ClassBody[?Yield]opt } + // [+GeneratorParameter] ClassHeritageopt { ClassBodyopt } node.members = inGeneratorParameterContext() ? doOutsideOfYieldContext(parseClassMembers) : parseClassMembers(); - parseExpected(15); + parseExpected(15 /* CloseBraceToken */); } else { node.members = createMissingList(); @@ -8444,37 +9627,37 @@ var ts; return undefined; } function parseHeritageClausesWorker() { - return parseList(19, false, parseHeritageClause); + return parseList(19 /* HeritageClauses */, false, parseHeritageClause); } function parseHeritageClause() { - if (token === 79 || token === 103) { - var node = createNode(222); + if (token === 79 /* ExtendsKeyword */ || token === 102 /* ImplementsKeyword */) { + var node = createNode(222 /* HeritageClause */); node.token = token; nextToken(); - node.types = parseDelimitedList(8, parseHeritageClauseElement); + node.types = parseDelimitedList(8 /* HeritageClauseElement */, parseHeritageClauseElement); return finishNode(node); } return undefined; } function parseHeritageClauseElement() { - var node = createNode(177); + var node = createNode(177 /* HeritageClauseElement */); node.expression = parseLeftHandSideExpressionOrHigher(); - if (token === 24) { - node.typeArguments = parseBracketedList(17, parseType, 24, 25); + if (token === 24 /* LessThanToken */) { + node.typeArguments = parseBracketedList(17 /* TypeArguments */, parseType, 24 /* LessThanToken */, 25 /* GreaterThanToken */); } return finishNode(node); } function isHeritageClause() { - return token === 79 || token === 103; + return token === 79 /* ExtendsKeyword */ || token === 102 /* ImplementsKeyword */; } function parseClassMembers() { - return parseList(6, false, parseClassElement); + return parseList(6 /* ClassMembers */, false, parseClassElement); } function parseInterfaceDeclaration(fullStart, decorators, modifiers) { - var node = createNode(202, fullStart); + var node = createNode(202 /* InterfaceDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(104); + parseExpected(103 /* InterfaceKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); node.heritageClauses = parseHeritageClauses(false); @@ -8482,31 +9665,35 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(fullStart, decorators, modifiers) { - var node = createNode(203, fullStart); + var node = createNode(203 /* TypeAliasDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(123); + parseExpected(123 /* TypeKeyword */); node.name = parseIdentifier(); - parseExpected(53); + parseExpected(53 /* EqualsToken */); node.type = parseType(); parseSemicolon(); return finishNode(node); } + // In an ambient declaration, the grammar only allows integer literals as initializers. + // In a non-ambient declaration, the grammar allows uninitialized members only in a + // ConstantEnumMemberSection, which starts at the beginning of an enum declaration + // or any time an integer literal initializer is encountered. function parseEnumMember() { - var node = createNode(226, scanner.getStartPos()); + var node = createNode(226 /* EnumMember */, scanner.getStartPos()); node.name = parsePropertyName(); node.initializer = allowInAnd(parseNonParameterInitializer); return finishNode(node); } function parseEnumDeclaration(fullStart, decorators, modifiers) { - var node = createNode(204, fullStart); + var node = createNode(204 /* EnumDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); - parseExpected(77); + parseExpected(77 /* EnumKeyword */); node.name = parseIdentifier(); - if (parseExpected(14)) { - node.members = parseDelimitedList(7, parseEnumMember); - parseExpected(15); + if (parseExpected(14 /* OpenBraceToken */)) { + node.members = parseDelimitedList(7 /* EnumMembers */, parseEnumMember); + parseExpected(15 /* CloseBraceToken */); } else { node.members = createMissingList(); @@ -8514,10 +9701,10 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(206, scanner.getStartPos()); - if (parseExpected(14)) { - node.statements = parseList(1, false, parseModuleElement); - parseExpected(15); + var node = createNode(206 /* ModuleBlock */, scanner.getStartPos()); + if (parseExpected(14 /* OpenBraceToken */)) { + node.statements = parseList(1 /* ModuleElements */, false, parseModuleElement); + parseExpected(15 /* CloseBraceToken */); } else { node.statements = createMissingList(); @@ -8525,18 +9712,18 @@ var ts; return finishNode(node); } function parseInternalModuleTail(fullStart, decorators, modifiers, flags) { - var node = createNode(205, fullStart); + var node = createNode(205 /* ModuleDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.flags |= flags; node.name = parseIdentifier(); - node.body = parseOptional(20) - ? parseInternalModuleTail(getNodePos(), undefined, undefined, 1) + node.body = parseOptional(20 /* DotToken */) + ? parseInternalModuleTail(getNodePos(), undefined, undefined, 1 /* Export */) : parseModuleBlock(); return finishNode(node); } function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) { - var node = createNode(205, fullStart); + var node = createNode(205 /* ModuleDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); node.name = parseLiteralNode(true); @@ -8544,48 +9731,55 @@ var ts; return finishNode(node); } function parseModuleDeclaration(fullStart, decorators, modifiers) { - parseExpected(117); - return token === 8 + parseExpected(117 /* ModuleKeyword */); + return token === 8 /* StringLiteral */ ? parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) : parseInternalModuleTail(fullStart, decorators, modifiers, modifiers ? modifiers.flags : 0); } function isExternalModuleReference() { - return token === 118 && + return token === 118 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { - return nextToken() === 16; + return nextToken() === 16 /* OpenParenToken */; } function nextTokenIsCommaOrFromKeyword() { nextToken(); - return token === 23 || - token === 124; + return token === 23 /* CommaToken */ || + token === 124 /* FromKeyword */; } function parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers) { - parseExpected(85); + parseExpected(85 /* ImportKeyword */); var afterImportPos = scanner.getStartPos(); var identifier; if (isIdentifier()) { identifier = parseIdentifier(); - if (token !== 23 && token !== 124) { - var importEqualsDeclaration = createNode(208, fullStart); + if (token !== 23 /* CommaToken */ && token !== 124 /* FromKeyword */) { + // ImportEquals declaration of type: + // import x = require("mod"); or + // import x = M.x; + var importEqualsDeclaration = createNode(208 /* ImportEqualsDeclaration */, fullStart); importEqualsDeclaration.decorators = decorators; setModifiers(importEqualsDeclaration, modifiers); importEqualsDeclaration.name = identifier; - parseExpected(53); + parseExpected(53 /* EqualsToken */); importEqualsDeclaration.moduleReference = parseModuleReference(); parseSemicolon(); return finishNode(importEqualsDeclaration); } } - var importDeclaration = createNode(209, fullStart); + // Import statement + var importDeclaration = createNode(209 /* ImportDeclaration */, fullStart); importDeclaration.decorators = decorators; setModifiers(importDeclaration, modifiers); + // ImportDeclaration: + // import ImportClause from ModuleSpecifier ; + // import ModuleSpecifier; if (identifier || - token === 35 || - token === 14) { + token === 35 /* AsteriskToken */ || + token === 14 /* OpenBraceToken */) { importDeclaration.importClause = parseImportClause(identifier, afterImportPos); - parseExpected(124); + parseExpected(124 /* FromKeyword */); } importDeclaration.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); @@ -8598,13 +9792,17 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(210, fullStart); + var importClause = createNode(210 /* ImportClause */, fullStart); if (identifier) { + // ImportedDefaultBinding: + // ImportedBinding importClause.name = identifier; } + // If there was no default import or if there is comma token after default import + // parse namespace or named imports if (!importClause.name || - parseOptional(23)) { - importClause.namedBindings = token === 35 ? parseNamespaceImport() : parseNamedImportsOrExports(212); + parseOptional(23 /* CommaToken */)) { + importClause.namedBindings = token === 35 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(212 /* NamedImports */); } return finishNode(importClause); } @@ -8614,47 +9812,67 @@ var ts; : parseEntityName(false); } function parseExternalModuleReference() { - var node = createNode(219); - parseExpected(118); - parseExpected(16); + var node = createNode(219 /* ExternalModuleReference */); + parseExpected(118 /* RequireKeyword */); + parseExpected(16 /* OpenParenToken */); node.expression = parseModuleSpecifier(); - parseExpected(17); + parseExpected(17 /* CloseParenToken */); return finishNode(node); } function parseModuleSpecifier() { + // We allow arbitrary expressions here, even though the grammar only allows string + // literals. We check to ensure that it is only a string literal later in the grammar + // walker. var result = parseExpression(); - if (result.kind === 8) { + // Ensure the string being required is in our 'identifier' table. This will ensure + // that features like 'find refs' will look inside this file when search for its name. + if (result.kind === 8 /* StringLiteral */) { internIdentifier(result.text); } return result; } function parseNamespaceImport() { - var namespaceImport = createNode(211); - parseExpected(35); - parseExpected(102); + // NameSpaceImport: + // * as ImportedBinding + var namespaceImport = createNode(211 /* NamespaceImport */); + parseExpected(35 /* AsteriskToken */); + parseExpected(111 /* AsKeyword */); namespaceImport.name = parseIdentifier(); return finishNode(namespaceImport); } function parseNamedImportsOrExports(kind) { var node = createNode(kind); - node.elements = parseBracketedList(20, kind === 212 ? parseImportSpecifier : parseExportSpecifier, 14, 15); + // NamedImports: + // { } + // { ImportsList } + // { ImportsList, } + // ImportsList: + // ImportSpecifier + // ImportsList, ImportSpecifier + node.elements = parseBracketedList(20 /* ImportOrExportSpecifiers */, kind === 212 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 14 /* OpenBraceToken */, 15 /* CloseBraceToken */); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(217); + return parseImportOrExportSpecifier(217 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(213); + return parseImportOrExportSpecifier(213 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); + // ImportSpecifier: + // BindingIdentifier + // IdentifierName as BindingIdentifier + // ExportSpecififer: + // IdentifierName + // IdentifierName as IdentifierName var checkIdentifierIsKeyword = ts.isKeyword(token) && !isIdentifier(); var checkIdentifierStart = scanner.getTokenPos(); var checkIdentifierEnd = scanner.getTextPos(); var identifierName = parseIdentifierName(); - if (token === 102) { + if (token === 111 /* AsKeyword */) { node.propertyName = identifierName; - parseExpected(102); + parseExpected(111 /* AsKeyword */); checkIdentifierIsKeyword = ts.isKeyword(token) && !isIdentifier(); checkIdentifierStart = scanner.getTokenPos(); checkIdentifierEnd = scanner.getTextPos(); @@ -8663,22 +9881,23 @@ var ts; else { node.name = identifierName; } - if (kind === 213 && checkIdentifierIsKeyword) { + if (kind === 213 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + // Report error identifier expected parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseExportDeclaration(fullStart, decorators, modifiers) { - var node = createNode(215, fullStart); + var node = createNode(215 /* ExportDeclaration */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); - if (parseOptional(35)) { - parseExpected(124); + if (parseOptional(35 /* AsteriskToken */)) { + parseExpected(124 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(216); - if (parseOptional(124)) { + node.exportClause = parseNamedImportsOrExports(216 /* NamedExports */); + if (parseOptional(124 /* FromKeyword */)) { node.moduleSpecifier = parseModuleSpecifier(); } } @@ -8686,59 +9905,62 @@ var ts; return finishNode(node); } function parseExportAssignment(fullStart, decorators, modifiers) { - var node = createNode(214, fullStart); + var node = createNode(214 /* ExportAssignment */, fullStart); node.decorators = decorators; setModifiers(node, modifiers); - if (parseOptional(53)) { + if (parseOptional(53 /* EqualsToken */)) { node.isExportEquals = true; - node.expression = parseAssignmentExpressionOrHigher(); } else { - parseExpected(73); - if (parseOptional(51)) { - node.type = parseType(); - } - else { - node.expression = parseAssignmentExpressionOrHigher(); - } + parseExpected(73 /* DefaultKeyword */); } + node.expression = parseAssignmentExpressionOrHigher(); parseSemicolon(); return finishNode(node); } function isLetDeclaration() { + // It is let declaration if in strict mode or next token is identifier\open bracket\open curly on same line. + // otherwise it needs to be treated like identifier return inStrictModeContext() || lookAhead(nextTokenIsIdentifierOrStartOfDestructuringOnTheSameLine); } function isDeclarationStart(followsModifier) { switch (token) { - case 98: - case 70: - case 83: + case 98 /* VarKeyword */: + case 70 /* ConstKeyword */: + case 83 /* FunctionKeyword */: return true; - case 105: + case 104 /* LetKeyword */: return isLetDeclaration(); - case 69: - case 104: - case 77: - case 123: + case 69 /* ClassKeyword */: + case 103 /* InterfaceKeyword */: + case 77 /* EnumKeyword */: + case 123 /* TypeKeyword */: + // Not true keywords so ensure an identifier follows return lookAhead(nextTokenIsIdentifierOrKeyword); - case 85: + case 85 /* ImportKeyword */: + // Not true keywords so ensure an identifier follows or is string literal or asterisk or open brace return lookAhead(nextTokenCanFollowImportKeyword); - case 117: + case 117 /* ModuleKeyword */: + // Not a true keyword so ensure an identifier or string literal follows return lookAhead(nextTokenIsIdentifierOrKeywordOrStringLiteral); - case 78: + case 78 /* ExportKeyword */: + // Check for export assignment or modifier on source element return lookAhead(nextTokenCanFollowExportKeyword); - case 115: - case 109: - case 107: - case 108: - case 110: + case 115 /* DeclareKeyword */: + case 108 /* PublicKeyword */: + case 106 /* PrivateKeyword */: + case 107 /* ProtectedKeyword */: + case 109 /* StaticKeyword */: + // Check for modifier on source element return lookAhead(nextTokenIsDeclarationStart); - case 52: + case 52 /* AtToken */: + // a lookahead here is too costly, and decorators are only valid on a declaration. + // We will assume we are parsing a declaration here and report an error later return !followsModifier; } } function isIdentifierOrKeyword() { - return token >= 65; + return token >= 65 /* Identifier */; } function nextTokenIsIdentifierOrKeyword() { nextToken(); @@ -8746,60 +9968,62 @@ var ts; } function nextTokenIsIdentifierOrKeywordOrStringLiteral() { nextToken(); - return isIdentifierOrKeyword() || token === 8; + return isIdentifierOrKeyword() || token === 8 /* StringLiteral */; } function nextTokenCanFollowImportKeyword() { nextToken(); - return isIdentifierOrKeyword() || token === 8 || - token === 35 || token === 14; + return isIdentifierOrKeyword() || token === 8 /* StringLiteral */ || + token === 35 /* AsteriskToken */ || token === 14 /* OpenBraceToken */; } function nextTokenCanFollowExportKeyword() { nextToken(); - return token === 53 || token === 35 || - token === 14 || token === 73 || isDeclarationStart(true); + return token === 53 /* EqualsToken */ || token === 35 /* AsteriskToken */ || + token === 14 /* OpenBraceToken */ || token === 73 /* DefaultKeyword */ || isDeclarationStart(true); } function nextTokenIsDeclarationStart() { nextToken(); return isDeclarationStart(true); } function nextTokenIsAsKeyword() { - return nextToken() === 102; + return nextToken() === 111 /* AsKeyword */; } function parseDeclaration() { var fullStart = getNodePos(); var decorators = parseDecorators(); var modifiers = parseModifiers(); - if (token === 78) { + if (token === 78 /* ExportKeyword */) { nextToken(); - if (token === 73 || token === 53) { + if (token === 73 /* DefaultKeyword */ || token === 53 /* EqualsToken */) { return parseExportAssignment(fullStart, decorators, modifiers); } - if (token === 35 || token === 14) { + if (token === 35 /* AsteriskToken */ || token === 14 /* OpenBraceToken */) { return parseExportDeclaration(fullStart, decorators, modifiers); } } switch (token) { - case 98: - case 105: - case 70: + case 98 /* VarKeyword */: + case 104 /* LetKeyword */: + case 70 /* ConstKeyword */: return parseVariableStatement(fullStart, decorators, modifiers); - case 83: + case 83 /* FunctionKeyword */: return parseFunctionDeclaration(fullStart, decorators, modifiers); - case 69: + case 69 /* ClassKeyword */: return parseClassDeclaration(fullStart, decorators, modifiers); - case 104: + case 103 /* InterfaceKeyword */: return parseInterfaceDeclaration(fullStart, decorators, modifiers); - case 123: + case 123 /* TypeKeyword */: return parseTypeAliasDeclaration(fullStart, decorators, modifiers); - case 77: + case 77 /* EnumKeyword */: return parseEnumDeclaration(fullStart, decorators, modifiers); - case 117: + case 117 /* ModuleKeyword */: return parseModuleDeclaration(fullStart, decorators, modifiers); - case 85: + case 85 /* ImportKeyword */: return parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers); default: if (decorators) { - var node = createMissingNode(218, true, ts.Diagnostics.Declaration_expected); + // We reached this point because we encountered an AtToken and assumed a declaration would + // follow. For recovery and error reporting purposes, return an incomplete declaration. + var node = createMissingNode(218 /* MissingDeclaration */, true, ts.Diagnostics.Declaration_expected); node.pos = fullStart; node.decorators = decorators; setModifiers(node, modifiers); @@ -8827,15 +10051,18 @@ var ts; var referencedFiles = []; var amdDependencies = []; var amdModuleName; + // Keep scanning all the leading trivia in the file until we get to something that + // isn't trivia. Any single line comment will be analyzed to see if it is a + // reference comment. while (true) { var kind = triviaScanner.scan(); - if (kind === 5 || kind === 4 || kind === 3) { + if (kind === 5 /* WhitespaceTrivia */ || kind === 4 /* NewLineTrivia */ || kind === 3 /* MultiLineCommentTrivia */) { continue; } - if (kind !== 2) { + if (kind !== 2 /* SingleLineCommentTrivia */) { break; } - var range = { pos: triviaScanner.getTokenPos(), end: triviaScanner.getTextPos() }; + var range = { pos: triviaScanner.getTokenPos(), end: triviaScanner.getTextPos(), kind: triviaScanner.getToken() }; var comment = sourceText.substring(range.pos, range.end); var referencePathMatchResult = ts.getFileReferenceFromReferencePath(comment, range); if (referencePathMatchResult) { @@ -8878,52 +10105,515 @@ var ts; } function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { - return node.flags & 1 - || node.kind === 208 && node.moduleReference.kind === 219 - || node.kind === 209 - || node.kind === 214 - || node.kind === 215 + return node.flags & 1 /* Export */ + || node.kind === 208 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 219 /* ExternalModuleReference */ + || node.kind === 209 /* ImportDeclaration */ + || node.kind === 214 /* ExportAssignment */ + || node.kind === 215 /* ExportDeclaration */ ? node : undefined; }); } - } - function isLeftHandSideExpression(expr) { - if (expr) { - switch (expr.kind) { - case 155: - case 156: - case 158: - case 157: - case 159: - case 153: - case 161: - case 154: - case 174: - case 162: - case 65: - case 9: - case 7: - case 8: - case 10: - case 171: - case 80: - case 89: - case 93: - case 95: - case 91: - return true; + var ParsingContext; + (function (ParsingContext) { + ParsingContext[ParsingContext["SourceElements"] = 0] = "SourceElements"; + ParsingContext[ParsingContext["ModuleElements"] = 1] = "ModuleElements"; + ParsingContext[ParsingContext["BlockStatements"] = 2] = "BlockStatements"; + ParsingContext[ParsingContext["SwitchClauses"] = 3] = "SwitchClauses"; + ParsingContext[ParsingContext["SwitchClauseStatements"] = 4] = "SwitchClauseStatements"; + ParsingContext[ParsingContext["TypeMembers"] = 5] = "TypeMembers"; + ParsingContext[ParsingContext["ClassMembers"] = 6] = "ClassMembers"; + ParsingContext[ParsingContext["EnumMembers"] = 7] = "EnumMembers"; + ParsingContext[ParsingContext["HeritageClauseElement"] = 8] = "HeritageClauseElement"; + ParsingContext[ParsingContext["VariableDeclarations"] = 9] = "VariableDeclarations"; + ParsingContext[ParsingContext["ObjectBindingElements"] = 10] = "ObjectBindingElements"; + ParsingContext[ParsingContext["ArrayBindingElements"] = 11] = "ArrayBindingElements"; + ParsingContext[ParsingContext["ArgumentExpressions"] = 12] = "ArgumentExpressions"; + ParsingContext[ParsingContext["ObjectLiteralMembers"] = 13] = "ObjectLiteralMembers"; + ParsingContext[ParsingContext["ArrayLiteralMembers"] = 14] = "ArrayLiteralMembers"; + ParsingContext[ParsingContext["Parameters"] = 15] = "Parameters"; + ParsingContext[ParsingContext["TypeParameters"] = 16] = "TypeParameters"; + ParsingContext[ParsingContext["TypeArguments"] = 17] = "TypeArguments"; + ParsingContext[ParsingContext["TupleElementTypes"] = 18] = "TupleElementTypes"; + ParsingContext[ParsingContext["HeritageClauses"] = 19] = "HeritageClauses"; + ParsingContext[ParsingContext["ImportOrExportSpecifiers"] = 20] = "ImportOrExportSpecifiers"; + ParsingContext[ParsingContext["Count"] = 21] = "Count"; // Number of parsing contexts + })(ParsingContext || (ParsingContext = {})); + var Tristate; + (function (Tristate) { + Tristate[Tristate["False"] = 0] = "False"; + Tristate[Tristate["True"] = 1] = "True"; + Tristate[Tristate["Unknown"] = 2] = "Unknown"; + })(Tristate || (Tristate = {})); + })(Parser || (Parser = {})); + var IncrementalParser; + (function (IncrementalParser) { + function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks) { + aggressiveChecks = aggressiveChecks || ts.Debug.shouldAssert(2 /* Aggressive */); + checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks); + if (ts.textChangeRangeIsUnchanged(textChangeRange)) { + // if the text didn't change, then we can just return our current source file as-is. + return sourceFile; + } + if (sourceFile.statements.length === 0) { + // If we don't have any statements in the current source file, then there's no real + // way to incrementally parse. So just do a full parse instead. + return Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, undefined, true); + } + // Make sure we're not trying to incrementally update a source file more than once. Once + // we do an update the original source file is considered unusbale from that point onwards. + // + // This is because we do incremental parsing in-place. i.e. we take nodes from the old + // tree and give them new positions and parents. From that point on, trusting the old + // tree at all is not possible as far too much of it may violate invariants. + var incrementalSourceFile = sourceFile; + ts.Debug.assert(!incrementalSourceFile.hasBeenIncrementallyParsed); + incrementalSourceFile.hasBeenIncrementallyParsed = true; + var oldText = sourceFile.text; + var syntaxCursor = createSyntaxCursor(sourceFile); + // Make the actual change larger so that we know to reparse anything whose lookahead + // might have intersected the change. + var changeRange = extendToAffectedRange(sourceFile, textChangeRange); + checkChangeRange(sourceFile, newText, changeRange, aggressiveChecks); + // Ensure that extending the affected range only moved the start of the change range + // earlier in the file. + ts.Debug.assert(changeRange.span.start <= textChangeRange.span.start); + ts.Debug.assert(ts.textSpanEnd(changeRange.span) === ts.textSpanEnd(textChangeRange.span)); + ts.Debug.assert(ts.textSpanEnd(ts.textChangeRangeNewSpan(changeRange)) === ts.textSpanEnd(ts.textChangeRangeNewSpan(textChangeRange))); + // The is the amount the nodes after the edit range need to be adjusted. It can be + // positive (if the edit added characters), negative (if the edit deleted characters) + // or zero (if this was a pure overwrite with nothing added/removed). + var delta = ts.textChangeRangeNewSpan(changeRange).length - changeRange.span.length; + // If we added or removed characters during the edit, then we need to go and adjust all + // the nodes after the edit. Those nodes may move forward (if we inserted chars) or they + // may move backward (if we deleted chars). + // + // Doing this helps us out in two ways. First, it means that any nodes/tokens we want + // 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 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 + // + // We will also adjust the positions of nodes that intersect the change range as well. + // By doing this, we ensure that all the positions in the old tree are consistent, not + // just the positions of nodes entirely before/after the change range. By being + // consistent, we can then easily map from positions to nodes in the old tree easily. + // + // Also, mark any syntax elements that intersect the changed span. We know, up front, + // that we cannot reuse these elements. + updateTokenPositionsAndMarkElements(incrementalSourceFile, changeRange.span.start, ts.textSpanEnd(changeRange.span), ts.textSpanEnd(ts.textChangeRangeNewSpan(changeRange)), delta, oldText, newText, aggressiveChecks); + // Now that we've set up our internal incremental state just proceed and parse the + // source file in the normal fashion. When possible the parser will retrieve and + // reuse nodes from the old tree. + // + // Note: passing in 'true' for setNodeParents is very important. When incrementally + // parsing, we will be reusing nodes from the old tree, and placing it into new + // parents. If we don't set the parents now, we'll end up with an observably + // inconsistent tree. Setting the parents on the new tree should be very fast. We + // will immediately bail out of walking any subtrees when we can see that their parents + // are already correct. + var result = Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, true); + return result; + } + IncrementalParser.updateSourceFile = updateSourceFile; + function moveElementEntirelyPastChangeRange(element, isArray, delta, oldText, newText, aggressiveChecks) { + if (isArray) { + visitArray(element); + } + else { + visitNode(element); + } + return; + function visitNode(node) { + if (aggressiveChecks && shouldCheckNode(node)) { + var text = oldText.substring(node.pos, node.end); + } + // Ditch any existing LS children we may have created. This way we can avoid + // moving them forward. + node._children = undefined; + node.pos += delta; + node.end += delta; + if (aggressiveChecks && shouldCheckNode(node)) { + ts.Debug.assert(text === newText.substring(node.pos, node.end)); + } + forEachChild(node, visitNode, visitArray); + checkNodePositions(node, aggressiveChecks); + } + function visitArray(array) { + array._children = undefined; + array.pos += delta; + array.end += delta; + for (var _i = 0; _i < array.length; _i++) { + var node = array[_i]; + visitNode(node); + } } } - return false; - } - ts.isLeftHandSideExpression = isLeftHandSideExpression; - function isAssignmentOperator(token) { - return token >= 53 && token <= 64; - } - ts.isAssignmentOperator = isAssignmentOperator; + function shouldCheckNode(node) { + switch (node.kind) { + case 8 /* StringLiteral */: + case 7 /* NumericLiteral */: + case 65 /* Identifier */: + return true; + } + return false; + } + function adjustIntersectingElement(element, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta) { + ts.Debug.assert(element.end >= changeStart, "Adjusting an element that was entirely before the change range"); + ts.Debug.assert(element.pos <= changeRangeOldEnd, "Adjusting an element that was entirely after the change range"); + ts.Debug.assert(element.pos <= element.end); + // We have an element that intersects the change range in some way. It may have its + // start, or its end (or both) in the changed range. We want to adjust any part + // that intersects such that the final tree is in a consistent state. i.e. all + // chlidren have spans within the span of their parent, and all siblings are ordered + // properly. + // We may need to update both the 'pos' and the 'end' of the element. + // If the 'pos' is before the start of the change, then we don't need to touch it. + // If it isn't, then the 'pos' must be inside the change. How we update it will + // depend if delta is positive or negative. If delta is positive then we have + // something like: + // + // -------------------AAA----------------- + // -------------------BBBCCCCCCC----------------- + // + // In this case, we consider any node that started in the change range to still be + // starting at the same position. + // + // however, if the delta is negative, then we instead have something like this: + // + // -------------------XXXYYYYYYY----------------- + // -------------------ZZZ----------------- + // + // In this case, any element that started in the 'X' range will keep its position. + // However any element htat started after that will have their pos adjusted to be + // at the end of the new range. i.e. any node that started in the 'Y' range will + // be adjusted to have their start at the end of the 'Z' range. + // + // The element will keep its position if possible. Or Move backward to the new-end + // if it's in the 'Y' range. + element.pos = Math.min(element.pos, changeRangeNewEnd); + // If the 'end' is after the change range, then we always adjust it by the delta + // amount. However, if the end is in the change range, then how we adjust it + // will depend on if delta is positive or negative. If delta is positive then we + // have something like: + // + // -------------------AAA----------------- + // -------------------BBBCCCCCCC----------------- + // + // In this case, we consider any node that ended inside the change range to keep its + // end position. + // + // however, if the delta is negative, then we instead have something like this: + // + // -------------------XXXYYYYYYY----------------- + // -------------------ZZZ----------------- + // + // In this case, any element that ended in the 'X' range will keep its position. + // However any element htat ended after that will have their pos adjusted to be + // at the end of the new range. i.e. any node that ended in the 'Y' range will + // be adjusted to have their end at the end of the 'Z' range. + if (element.end >= changeRangeOldEnd) { + // Element ends after the change range. Always adjust the end pos. + element.end += delta; + } + else { + // Element ends in the change range. The element will keep its position if + // possible. Or Move backward to the new-end if it's in the 'Y' range. + element.end = Math.min(element.end, changeRangeNewEnd); + } + ts.Debug.assert(element.pos <= element.end); + if (element.parent) { + ts.Debug.assert(element.pos >= element.parent.pos); + ts.Debug.assert(element.end <= element.parent.end); + } + } + function checkNodePositions(node, aggressiveChecks) { + if (aggressiveChecks) { + var pos = node.pos; + forEachChild(node, function (child) { + ts.Debug.assert(child.pos >= pos); + pos = child.end; + }); + ts.Debug.assert(pos <= node.end); + } + } + function updateTokenPositionsAndMarkElements(sourceFile, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta, oldText, newText, aggressiveChecks) { + visitNode(sourceFile); + return; + function visitNode(child) { + ts.Debug.assert(child.pos <= child.end); + if (child.pos > changeRangeOldEnd) { + // Node is entirely past the change range. We need to move both its pos and + // end, forward or backward appropriately. + moveElementEntirelyPastChangeRange(child, false, delta, oldText, newText, aggressiveChecks); + return; + } + // Check if the element intersects the change range. If it does, then it is not + // reusable. Also, we'll need to recurse to see what constituent portions we may + // be able to use. + var fullEnd = child.end; + if (fullEnd >= changeStart) { + child.intersectsChange = true; + child._children = undefined; + // Adjust the pos or end (or both) of the intersecting element accordingly. + adjustIntersectingElement(child, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); + forEachChild(child, visitNode, visitArray); + checkNodePositions(child, aggressiveChecks); + return; + } + // Otherwise, the node is entirely before the change range. No need to do anything with it. + ts.Debug.assert(fullEnd < changeStart); + } + function visitArray(array) { + ts.Debug.assert(array.pos <= array.end); + if (array.pos > changeRangeOldEnd) { + // Array is entirely after the change range. We need to move it, and move any of + // its children. + moveElementEntirelyPastChangeRange(array, true, delta, oldText, newText, aggressiveChecks); + return; + } + // Check if the element intersects the change range. If it does, then it is not + // reusable. Also, we'll need to recurse to see what constituent portions we may + // be able to use. + var fullEnd = array.end; + if (fullEnd >= changeStart) { + array.intersectsChange = true; + array._children = undefined; + // Adjust the pos or end (or both) of the intersecting array accordingly. + adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); + for (var _i = 0; _i < array.length; _i++) { + var node = array[_i]; + visitNode(node); + } + return; + } + // Otherwise, the array is entirely before the change range. No need to do anything with it. + ts.Debug.assert(fullEnd < changeStart); + } + } + function extendToAffectedRange(sourceFile, changeRange) { + // Consider the following code: + // void foo() { /; } + // + // If the text changes with an insertion of / just before the semicolon then we end up with: + // void foo() { //; } + // + // If we were to just use the changeRange a is, then we would not rescan the { token + // (as it does not intersect the actual original change range). Because an edit may + // change the token touching it, we actually need to look back *at least* one token so + // that the prior token sees that change. + var maxLookahead = 1; + var start = changeRange.span.start; + // the first iteration aligns us with the change start. subsequent iteration move us to + // the left by maxLookahead tokens. We only need to do this as long as we're not at the + // start of the tree. + for (var i = 0; start > 0 && i <= maxLookahead; i++) { + var nearestNode = findNearestNodeStartingBeforeOrAtPosition(sourceFile, start); + ts.Debug.assert(nearestNode.pos <= start); + var position = nearestNode.pos; + start = Math.max(0, position - 1); + } + var finalSpan = ts.createTextSpanFromBounds(start, ts.textSpanEnd(changeRange.span)); + var finalLength = changeRange.newLength + (changeRange.span.start - start); + return ts.createTextChangeRange(finalSpan, finalLength); + } + function findNearestNodeStartingBeforeOrAtPosition(sourceFile, position) { + var bestResult = sourceFile; + var lastNodeEntirelyBeforePosition; + forEachChild(sourceFile, visit); + if (lastNodeEntirelyBeforePosition) { + var lastChildOfLastEntireNodeBeforePosition = getLastChild(lastNodeEntirelyBeforePosition); + if (lastChildOfLastEntireNodeBeforePosition.pos > bestResult.pos) { + bestResult = lastChildOfLastEntireNodeBeforePosition; + } + } + return bestResult; + function getLastChild(node) { + while (true) { + var lastChild = getLastChildWorker(node); + if (lastChild) { + node = lastChild; + } + else { + return node; + } + } + } + function getLastChildWorker(node) { + var last = undefined; + forEachChild(node, function (child) { + if (ts.nodeIsPresent(child)) { + last = child; + } + }); + return last; + } + function visit(child) { + if (ts.nodeIsMissing(child)) { + // Missing nodes are effectively invisible to us. We never even consider them + // When trying to find the nearest node before us. + return; + } + // If the child intersects this position, then this node is currently the nearest + // node that starts before the position. + if (child.pos <= position) { + if (child.pos >= bestResult.pos) { + // This node starts before the position, and is closer to the position than + // the previous best node we found. It is now the new best node. + bestResult = child; + } + // Now, the node may overlap the position, or it may end entirely before the + // position. If it overlaps with the position, then either it, or one of its + // children must be the nearest node before the position. So we can just + // recurse into this child to see if we can find something better. + if (position < child.end) { + // The nearest node is either this child, or one of the children inside + // of it. We've already marked this child as the best so far. Recurse + // in case one of the children is better. + forEachChild(child, visit); + // Once we look at the children of this node, then there's no need to + // continue any further. + return true; + } + else { + ts.Debug.assert(child.end <= position); + // The child ends entirely before this position. Say you have the following + // (where $ is the position) + // + // ? $ : <...> <...> + // + // We would want to find the nearest preceding node in "complex expr 2". + // To support that, we keep track of this node, and once we're done searching + // for a best node, we recurse down this node to see if we can find a good + // result in it. + // + // This approach allows us to quickly skip over nodes that are entirely + // before the position, while still allowing us to find any nodes in the + // last one that might be what we want. + lastNodeEntirelyBeforePosition = child; + } + } + else { + ts.Debug.assert(child.pos > position); + // We're now at a node that is entirely past the position we're searching for. + // This node (and all following nodes) could never contribute to the result, + // so just skip them by returning 'true' here. + return true; + } + } + } + function checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks) { + var oldText = sourceFile.text; + if (textChangeRange) { + ts.Debug.assert((oldText.length - textChangeRange.span.length + textChangeRange.newLength) === newText.length); + if (aggressiveChecks || ts.Debug.shouldAssert(3 /* VeryAggressive */)) { + var oldTextPrefix = oldText.substr(0, textChangeRange.span.start); + var newTextPrefix = newText.substr(0, textChangeRange.span.start); + ts.Debug.assert(oldTextPrefix === newTextPrefix); + var oldTextSuffix = oldText.substring(ts.textSpanEnd(textChangeRange.span), oldText.length); + var newTextSuffix = newText.substring(ts.textSpanEnd(ts.textChangeRangeNewSpan(textChangeRange)), newText.length); + ts.Debug.assert(oldTextSuffix === newTextSuffix); + } + } + } + function createSyntaxCursor(sourceFile) { + var currentArray = sourceFile.statements; + var currentArrayIndex = 0; + ts.Debug.assert(currentArrayIndex < currentArray.length); + var current = currentArray[currentArrayIndex]; + var lastQueriedPosition = -1 /* Value */; + return { + currentNode: function (position) { + // Only compute the current node if the position is different than the last time + // we were asked. The parser commonly asks for the node at the same position + // twice. Once to know if can read an appropriate list element at a certain point, + // and then to actually read and consume the node. + if (position !== lastQueriedPosition) { + // Much of the time the parser will need the very next node in the array that + // we just returned a node from.So just simply check for that case and move + // forward in the array instead of searching for the node again. + if (current && current.end === position && currentArrayIndex < (currentArray.length - 1)) { + currentArrayIndex++; + current = currentArray[currentArrayIndex]; + } + // If we don't have a node, or the node we have isn't in the right position, + // then try to find a viable node at the position requested. + if (!current || current.pos !== position) { + findHighestListElementThatStartsAtPosition(position); + } + } + // Cache this query so that we don't do any extra work if the parser calls back + // into us. Note: this is very common as the parser will make pairs of calls like + // 'isListElement -> parseListElement'. If we were unable to find a node when + // called with 'isListElement', we don't want to redo the work when parseListElement + // is called immediately after. + lastQueriedPosition = position; + // Either we don'd have a node, or we have a node at the position being asked for. + ts.Debug.assert(!current || current.pos === position); + return current; + } + }; + // Finds the highest element in the tree we can find that starts at the provided position. + // The element must be a direct child of some node list in the tree. This way after we + // return it, we can easily return its next sibling in the list. + function findHighestListElementThatStartsAtPosition(position) { + // Clear out any cached state about the last node we found. + currentArray = undefined; + currentArrayIndex = -1 /* Value */; + current = undefined; + // Recurse into the source file to find the highest node at this position. + forEachChild(sourceFile, visitNode, visitArray); + return; + function visitNode(node) { + if (position >= node.pos && position < node.end) { + // Position was within this node. Keep searching deeper to find the node. + forEachChild(node, visitNode, visitArray); + // don't procede any futher in the search. + return true; + } + // position wasn't in this node, have to keep searching. + return false; + } + function visitArray(array) { + if (position >= array.pos && position < array.end) { + // position was in this array. Search through this array to see if we find a + // viable element. + for (var i = 0, n = array.length; i < n; i++) { + var child = array[i]; + if (child) { + if (child.pos === position) { + // Found the right node. We're done. + currentArray = array; + currentArrayIndex = i; + current = child; + return true; + } + else { + if (child.pos < position && position < child.end) { + // Position in somewhere within this child. Search in it and + // stop searching in this array. + forEachChild(child, visitNode, visitArray); + return true; + } + } + } + } + } + // position wasn't in this array, have to keep searching. + return false; + } + } + } + var InvalidPosition; + (function (InvalidPosition) { + InvalidPosition[InvalidPosition["Value"] = -1] = "Value"; + })(InvalidPosition || (InvalidPosition = {})); + })(IncrementalParser || (IncrementalParser = {})); })(ts || (ts = {})); /// +/* @internal */ var ts; (function (ts) { var nextSymbolId = 1; @@ -8951,10 +10641,10 @@ var ts; var emptyArray = []; var emptySymbols = {}; var compilerOptions = host.getCompilerOptions(); - var languageVersion = compilerOptions.target || 0; + var languageVersion = compilerOptions.target || 0 /* ES3 */; var emitResolver = createResolver(); - var undefinedSymbol = createSymbol(4 | 67108864, "undefined"); - var argumentsSymbol = createSymbol(4 | 67108864, "arguments"); + var undefinedSymbol = createSymbol(4 /* Property */ | 67108864 /* Transient */, "undefined"); + var argumentsSymbol = createSymbol(4 /* Property */ | 67108864 /* Transient */, "arguments"); var checker = { getNodeCount: function () { return ts.sum(host.getSourceFiles(), "nodeCount"); }, getIdentifierCount: function () { return ts.sum(host.getSourceFiles(), "identifierCount"); }, @@ -8989,20 +10679,20 @@ var ts; isImplementationOfOverload: isImplementationOfOverload, getAliasedSymbol: resolveAlias, getEmitResolver: getEmitResolver, - getExportsOfExternalModule: getExportsOfExternalModule + getExportsOfModule: getExportsOfModuleAsArray }; - var unknownSymbol = createSymbol(4 | 67108864, "unknown"); - var resolvingSymbol = createSymbol(67108864, "__resolving__"); - var anyType = createIntrinsicType(1, "any"); - var stringType = createIntrinsicType(2, "string"); - var numberType = createIntrinsicType(4, "number"); - var booleanType = createIntrinsicType(8, "boolean"); - var esSymbolType = createIntrinsicType(1048576, "symbol"); - var voidType = createIntrinsicType(16, "void"); - var undefinedType = createIntrinsicType(32 | 262144, "undefined"); - var nullType = createIntrinsicType(64 | 262144, "null"); - var unknownType = createIntrinsicType(1, "unknown"); - var resolvingType = createIntrinsicType(1, "__resolving__"); + var unknownSymbol = createSymbol(4 /* Property */ | 67108864 /* Transient */, "unknown"); + var resolvingSymbol = createSymbol(67108864 /* Transient */, "__resolving__"); + var anyType = createIntrinsicType(1 /* Any */, "any"); + var stringType = createIntrinsicType(2 /* String */, "string"); + var numberType = createIntrinsicType(4 /* Number */, "number"); + var booleanType = createIntrinsicType(8 /* Boolean */, "boolean"); + var esSymbolType = createIntrinsicType(1048576 /* ESSymbol */, "symbol"); + var voidType = createIntrinsicType(16 /* Void */, "void"); + var undefinedType = createIntrinsicType(32 /* Undefined */ | 262144 /* ContainsUndefinedOrNull */, "undefined"); + var nullType = createIntrinsicType(64 /* Null */ | 262144 /* ContainsUndefinedOrNull */, "null"); + var unknownType = createIntrinsicType(1 /* Any */, "unknown"); + var resolvingType = createIntrinsicType(1 /* Any */, "__resolving__"); var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); @@ -9032,6 +10722,7 @@ var ts; var stringLiteralTypes = {}; var emitExtends = false; var emitDecorate = false; + var emitParam = false; var mergedSymbols = []; var symbolLinks = []; var nodeLinks = []; @@ -9040,22 +10731,24 @@ var ts; var primitiveTypeInfo = { "string": { type: stringType, - flags: 258 + flags: 258 /* StringLike */ }, "number": { type: numberType, - flags: 132 + flags: 132 /* NumberLike */ }, "boolean": { type: booleanType, - flags: 8 + flags: 8 /* Boolean */ }, "symbol": { type: esSymbolType, - flags: 1048576 + flags: 1048576 /* ESSymbol */ } }; function getEmitResolver(sourceFile) { + // Ensure we have all the type information in place for this file so that all the + // emitter questions of this resolver will return the right information. getDiagnostics(sourceFile); return emitResolver; } @@ -9070,38 +10763,38 @@ var ts; } function getExcludedSymbolFlags(flags) { var result = 0; - if (flags & 2) - result |= 107455; - if (flags & 1) - result |= 107454; - if (flags & 4) - result |= 107455; - if (flags & 8) - result |= 107455; - if (flags & 16) - result |= 106927; - if (flags & 32) - result |= 899583; - if (flags & 64) - result |= 792992; - if (flags & 256) - result |= 899327; - if (flags & 128) - result |= 899967; - if (flags & 512) - result |= 106639; - if (flags & 8192) - result |= 99263; - if (flags & 32768) - result |= 41919; - if (flags & 65536) - result |= 74687; - if (flags & 262144) - result |= 530912; - if (flags & 524288) - result |= 793056; - if (flags & 8388608) - result |= 8388608; + if (flags & 2 /* BlockScopedVariable */) + result |= 107455 /* BlockScopedVariableExcludes */; + if (flags & 1 /* FunctionScopedVariable */) + result |= 107454 /* FunctionScopedVariableExcludes */; + if (flags & 4 /* Property */) + result |= 107455 /* PropertyExcludes */; + if (flags & 8 /* EnumMember */) + result |= 107455 /* EnumMemberExcludes */; + if (flags & 16 /* Function */) + result |= 106927 /* FunctionExcludes */; + if (flags & 32 /* Class */) + result |= 899583 /* ClassExcludes */; + if (flags & 64 /* Interface */) + result |= 792992 /* InterfaceExcludes */; + if (flags & 256 /* RegularEnum */) + result |= 899327 /* RegularEnumExcludes */; + if (flags & 128 /* ConstEnum */) + result |= 899967 /* ConstEnumExcludes */; + if (flags & 512 /* ValueModule */) + result |= 106639 /* ValueModuleExcludes */; + if (flags & 8192 /* Method */) + result |= 99263 /* MethodExcludes */; + if (flags & 32768 /* GetAccessor */) + result |= 41919 /* GetAccessorExcludes */; + if (flags & 65536 /* SetAccessor */) + result |= 74687 /* SetAccessorExcludes */; + if (flags & 262144 /* TypeParameter */) + result |= 530912 /* TypeParameterExcludes */; + if (flags & 524288 /* TypeAlias */) + result |= 793056 /* TypeAliasExcludes */; + if (flags & 8388608 /* Alias */) + result |= 8388608 /* AliasExcludes */; return result; } function recordMergedSymbol(target, source) { @@ -9110,7 +10803,7 @@ var ts; mergedSymbols[source.mergeId] = target; } function cloneSymbol(symbol) { - var result = createSymbol(symbol.flags | 33554432, symbol.name); + var result = createSymbol(symbol.flags | 33554432 /* Merged */, symbol.name); result.declarations = symbol.declarations.slice(0); result.parent = symbol.parent; if (symbol.valueDeclaration) @@ -9126,7 +10819,8 @@ var ts; } function mergeSymbol(target, source) { if (!(target.flags & getExcludedSymbolFlags(source.flags))) { - if (source.flags & 512 && target.flags & 512 && target.constEnumOnlyModule && !source.constEnumOnlyModule) { + if (source.flags & 512 /* ValueModule */ && target.flags & 512 /* ValueModule */ && target.constEnumOnlyModule && !source.constEnumOnlyModule) { + // reset flag when merging instantiated module into value module that has only const enums target.constEnumOnlyModule = false; } target.flags |= source.flags; @@ -9148,7 +10842,7 @@ var ts; recordMergedSymbol(target, source); } else { - var message = target.flags & 2 || source.flags & 2 + var message = target.flags & 2 /* BlockScopedVariable */ || source.flags & 2 /* BlockScopedVariable */ ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(source.declarations, function (node) { error(node.name ? node.name : node, message, symbolToString(source)); @@ -9175,7 +10869,7 @@ var ts; } else { var symbol = target[id]; - if (!(symbol.flags & 33554432)) { + if (!(symbol.flags & 33554432 /* Merged */)) { target[id] = symbol = cloneSymbol(symbol); } mergeSymbol(symbol, source[id]); @@ -9184,7 +10878,7 @@ var ts; } } function getSymbolLinks(symbol) { - if (symbol.flags & 67108864) + if (symbol.flags & 67108864 /* Transient */) return symbol; var id = getSymbolId(symbol); return symbolLinks[id] || (symbolLinks[id] = {}); @@ -9194,26 +10888,29 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = {}); } function getSourceFile(node) { - return ts.getAncestor(node, 227); + return ts.getAncestor(node, 227 /* SourceFile */); } function isGlobalSourceFile(node) { - return node.kind === 227 && !ts.isExternalModule(node); + return node.kind === 227 /* SourceFile */ && !ts.isExternalModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { var symbol = symbols[name]; - ts.Debug.assert((symbol.flags & 16777216) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((symbol.flags & 16777216 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); if (symbol.flags & meaning) { return symbol; } - if (symbol.flags & 8388608) { + if (symbol.flags & 8388608 /* Alias */) { var target = resolveAlias(symbol); + // Unknown symbol means an error occurred in alias resolution, treat it as positive answer to avoid cascading errors if (target === unknownSymbol || target.flags & meaning) { return symbol; } } } + // return undefined if we can't find a symbol. } + /** Returns true if node1 is defined before node 2**/ function isDefinedBefore(node1, node2) { var file1 = ts.getSourceFileOfNode(node1); var file2 = ts.getSourceFileOfNode(node2); @@ -9226,6 +10923,9 @@ var ts; var sourceFiles = host.getSourceFiles(); return sourceFiles.indexOf(file1) <= sourceFiles.indexOf(file2); } + // Resolve a given name for a given meaning at a given location. An error is reported if the name was not found and + // the nameNotFoundMessage argument is not undefined. Returns the resolved symbol, or undefined if no symbol with + // the given name can be found. function resolveName(location, name, meaning, nameNotFoundMessage, nameArg) { var result; var lastLocation; @@ -9233,24 +10933,26 @@ var ts; var errorLocation = location; var grandparent; loop: while (location) { + // Locals of a source file are not in scope (because they get merged into the global symbol table) if (location.locals && !isGlobalSourceFile(location)) { if (result = getSymbol(location.locals, name, meaning)) { break loop; } } switch (location.kind) { - case 227: + case 227 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 205: - if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8914931)) { - if (result.flags & meaning || !(result.flags & 8388608 && getDeclarationOfAliasSymbol(result).kind === 217)) { + case 205 /* ModuleDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8914931 /* ModuleMember */)) { + if (result.flags & meaning || !(result.flags & 8388608 /* Alias */ && getDeclarationOfAliasSymbol(result).kind === 217 /* ExportSpecifier */)) { break loop; } result = undefined; } - else if (location.kind === 227) { - result = getSymbol(getSymbolOfNode(location).exports, "default", meaning & 8914931); + else if (location.kind === 227 /* SourceFile */ || + (location.kind === 205 /* ModuleDeclaration */ && location.name.kind === 8 /* StringLiteral */)) { + result = getSymbol(getSymbolOfNode(location).exports, "default", meaning & 8914931 /* ModuleMember */); var localSymbol = ts.getLocalSymbolForExportDefault(result); if (result && (result.flags & meaning) && localSymbol && localSymbol.name === name) { break loop; @@ -9258,54 +10960,73 @@ var ts; result = undefined; } break; - case 204: - if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8)) { + case 204 /* EnumDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 132: - case 131: - if (location.parent.kind === 201 && !(location.flags & 128)) { + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + // TypeScript 1.0 spec (April 2014): 8.4.1 + // Initializer expressions for instance member variables are evaluated in the scope + // of the class constructor body but are not permitted to reference parameters or + // local variables of the constructor. This effectively means that entities from outer scopes + // by the same name as a constructor parameter or local variable are inaccessible + // in initializer expressions for instance member variables. + if (location.parent.kind === 201 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { - if (getSymbol(ctor.locals, name, meaning & 107455)) { + if (getSymbol(ctor.locals, name, meaning & 107455 /* Value */)) { + // Remember the property node, it will be used later to report appropriate error propertyWithInvalidInitializer = location; } } } break; - case 201: - case 202: - if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 793056)) { - if (lastLocation && lastLocation.flags & 128) { + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 793056 /* Type */)) { + if (lastLocation && lastLocation.flags & 128 /* Static */) { + // TypeScript 1.0 spec (April 2014): 3.4.1 + // The scope of a type parameter extends over the entire declaration with which the type + // parameter list is associated, with the exception of static member declarations in classes. error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters); return undefined; } break loop; } break; - case 127: + // It is not legal to reference a class's own type parameters from a computed property name that + // belongs to the class. For example: + // + // function foo() { return '' } + // class C { // <-- Class's own type parameter T + // [foo()]() { } // <-- Reference to T from class's own computed property + // } + // + case 127 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (grandparent.kind === 201 || grandparent.kind === 202) { - if (result = getSymbol(getSymbolOfNode(grandparent).members, name, meaning & 793056)) { + if (grandparent.kind === 201 /* ClassDeclaration */ || grandparent.kind === 202 /* InterfaceDeclaration */) { + // A reference to this grandparent's type parameters would be an error + if (result = getSymbol(getSymbolOfNode(grandparent).members, name, meaning & 793056 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); return undefined; } } break; - case 134: - case 133: - case 135: - case 136: - case 137: - case 200: - case 163: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 135 /* Constructor */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 200 /* FunctionDeclaration */: + case 163 /* ArrowFunction */: if (name === "arguments") { result = argumentsSymbol; break loop; } break; - case 162: + case 162 /* FunctionExpression */: if (name === "arguments") { result = argumentsSymbol; break loop; @@ -9316,17 +11037,31 @@ var ts; break loop; } break; - case 174: + case 174 /* ClassExpression */: var className = location.name; if (className && name === className.text) { result = location.symbol; break loop; } break; - case 130: - if (location.parent && location.parent.kind === 129) { + case 130 /* Decorator */: + // Decorators are resolved at the class declaration. Resolving at the parameter + // or member would result in looking up locals in the method. + // + // function y() {} + // class C { + // method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter. + // } + // + if (location.parent && location.parent.kind === 129 /* Parameter */) { location = location.parent; } + // + // function y() {} + // class C { + // @y method(x, y) {} // <-- decorator y should be resolved at the class declaration, not the method. + // } + // if (location.parent && ts.isClassElement(location.parent)) { location = location.parent; } @@ -9344,32 +11079,47 @@ var ts; } return undefined; } + // Perform extra checks only if error reporting was requested if (nameNotFoundMessage) { if (propertyWithInvalidInitializer) { + // We have a match, but the reference occurred within a property initializer and the identifier also binds + // to a local variable in the constructor where the code will be emitted. var propertyName = propertyWithInvalidInitializer.name; error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.declarationNameToString(propertyName), typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); return undefined; } - if (result.flags & 2) { + if (result.flags & 2 /* BlockScopedVariable */) { checkResolvedBlockScopedVariable(result, errorLocation); } } return result; } function checkResolvedBlockScopedVariable(result, errorLocation) { - ts.Debug.assert((result.flags & 2) !== 0); + ts.Debug.assert((result.flags & 2 /* BlockScopedVariable */) !== 0); + // Block-scoped variables cannot be used before their definition var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) ? d : undefined; }); ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); + // first check if usage is lexically located after the declaration var isUsedBeforeDeclaration = !isDefinedBefore(declaration, errorLocation); if (!isUsedBeforeDeclaration) { - var variableDeclaration = ts.getAncestor(declaration, 198); + // lexical check succeeded however code still can be illegal. + // - block scoped variables cannot be used in its initializers + // let x = x; // illegal but usage is lexically after definition + // - in ForIn/ForOf statements variable cannot be contained in expression part + // for (let x in x) + // for (let x of x) + // climb up to the variable declaration skipping binding patterns + var variableDeclaration = ts.getAncestor(declaration, 198 /* VariableDeclaration */); var container = ts.getEnclosingBlockScopeContainer(variableDeclaration); - if (variableDeclaration.parent.parent.kind === 180 || - variableDeclaration.parent.parent.kind === 186) { + if (variableDeclaration.parent.parent.kind === 180 /* VariableStatement */ || + variableDeclaration.parent.parent.kind === 186 /* ForStatement */) { + // variable statement/for statement case, + // use site should not be inside variable declaration (initializer of declaration or binding element) isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, variableDeclaration, container); } - else if (variableDeclaration.parent.parent.kind === 188 || - variableDeclaration.parent.parent.kind === 187) { + else if (variableDeclaration.parent.parent.kind === 188 /* ForOfStatement */ || + variableDeclaration.parent.parent.kind === 187 /* ForInStatement */) { + // ForIn/ForOf case - use site should not be used in expression part var expression = variableDeclaration.parent.parent.expression; isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, expression, container); } @@ -9378,6 +11128,10 @@ var ts; error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); } } + /* Starting from 'initial' node walk up the parent chain until 'stopAt' node is reached. + * If at any point current node is equal to 'parent' node - return true. + * Return false if 'stopAt' node is reached or isFunctionLike(current) === true. + */ function isSameScopeDescendentOf(initial, parent, stopAt) { if (!parent) { return false; @@ -9391,10 +11145,10 @@ var ts; } function getAnyImportSyntax(node) { if (ts.isAliasSymbolDeclaration(node)) { - if (node.kind === 208) { + if (node.kind === 208 /* ImportEqualsDeclaration */) { return node; } - while (node && node.kind !== 209) { + while (node && node.kind !== 209 /* ImportDeclaration */) { node = node.parent; } return node; @@ -9404,7 +11158,7 @@ var ts; return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; }); } function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 219) { + if (node.moduleReference.kind === 219 /* ExternalModuleReference */) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, node); @@ -9424,15 +11178,33 @@ var ts; return resolveESModuleSymbol(resolveExternalModuleName(node, moduleSpecifier), moduleSpecifier); } function getMemberOfModuleVariable(moduleSymbol, name) { - if (moduleSymbol.flags & 3) { + if (moduleSymbol.flags & 3 /* Variable */) { var typeAnnotation = moduleSymbol.valueDeclaration.type; if (typeAnnotation) { - return getPropertyOfType(getTypeFromTypeNodeOrHeritageClauseElement(typeAnnotation), name); + return getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name); } } } + // This function creates a synthetic symbol that combines the value side of one symbol with the + // type/namespace side of another symbol. Consider this example: + // + // declare module graphics { + // interface Point { + // x: number; + // y: number; + // } + // } + // declare var graphics: { + // Point: new (x: number, y: number) => graphics.Point; + // } + // declare module "graphics" { + // export = graphics; + // } + // + // An 'import { Point } from "graphics"' needs to create a symbol that combines the value side 'Point' + // property with the type/namespace side interface 'Point'. function combineValueAndTypeSymbols(valueSymbol, typeSymbol) { - if (valueSymbol.flags & (793056 | 1536)) { + if (valueSymbol.flags & (793056 /* Type */ | 1536 /* Namespace */)) { return valueSymbol; } var result = createSymbol(valueSymbol.flags | typeSymbol.flags, valueSymbol.name); @@ -9447,7 +11219,7 @@ var ts; return result; } function getExportOfModule(symbol, name) { - if (symbol.flags & 1536) { + if (symbol.flags & 1536 /* Module */) { var exports = getExportsOfSymbol(symbol); if (ts.hasProperty(exports, name)) { return resolveSymbol(exports[name]); @@ -9455,10 +11227,10 @@ var ts; } } function getPropertyOfVariable(symbol, name) { - if (symbol.flags & 3) { + if (symbol.flags & 3 /* Variable */) { var typeAnnotation = symbol.valueDeclaration.type; if (typeAnnotation) { - return resolveSymbol(getPropertyOfType(getTypeFromTypeNodeOrHeritageClauseElement(typeAnnotation), name)); + return resolveSymbol(getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name)); } } } @@ -9486,32 +11258,32 @@ var ts; function getTargetOfExportSpecifier(node) { return node.parent.parent.moduleSpecifier ? getExternalModuleMember(node.parent.parent, node) : - resolveEntityName(node.propertyName || node.name, 107455 | 793056 | 1536); + resolveEntityName(node.propertyName || node.name, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */); } function getTargetOfExportAssignment(node) { - return node.expression && resolveEntityName(node.expression, 107455 | 793056 | 1536); + return resolveEntityName(node.expression, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */); } function getTargetOfAliasDeclaration(node) { switch (node.kind) { - case 208: + case 208 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node); - case 210: + case 210 /* ImportClause */: return getTargetOfImportClause(node); - case 211: + case 211 /* NamespaceImport */: return getTargetOfNamespaceImport(node); - case 213: + case 213 /* ImportSpecifier */: return getTargetOfImportSpecifier(node); - case 217: + case 217 /* ExportSpecifier */: return getTargetOfExportSpecifier(node); - case 214: + case 214 /* ExportAssignment */: return getTargetOfExportAssignment(node); } } function resolveSymbol(symbol) { - return symbol && symbol.flags & 8388608 && !(symbol.flags & (107455 | 793056 | 1536)) ? resolveAlias(symbol) : symbol; + return symbol && symbol.flags & 8388608 /* Alias */ && !(symbol.flags & (107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */)) ? resolveAlias(symbol) : symbol; } function resolveAlias(symbol) { - ts.Debug.assert((symbol.flags & 8388608) !== 0, "Should only get Alias here."); + ts.Debug.assert((symbol.flags & 8388608 /* Alias */) !== 0, "Should only get Alias here."); var links = getSymbolLinks(symbol); if (!links.target) { links.target = resolvingSymbol; @@ -9534,62 +11306,79 @@ var ts; var target = resolveAlias(symbol); if (target) { var markAlias = (target === unknownSymbol && compilerOptions.separateCompilation) || - (target !== unknownSymbol && (target.flags & 107455) && !isConstEnumOrConstEnumOnlyModule(target)); + (target !== unknownSymbol && (target.flags & 107455 /* Value */) && !isConstEnumOrConstEnumOnlyModule(target)); if (markAlias) { markAliasSymbolAsReferenced(symbol); } } } + // When an alias symbol is referenced, we need to mark the entity it references as referenced and in turn repeat that until + // we reach a non-alias or an exported entity (which is always considered referenced). We do this by checking the target of + // the alias as an expression (which recursively takes us back here if the target references another alias). function markAliasSymbolAsReferenced(symbol) { var links = getSymbolLinks(symbol); if (!links.referenced) { links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); - if (node.kind === 214 && node.expression) { + if (node.kind === 214 /* ExportAssignment */) { + // export default checkExpressionCached(node.expression); } - else if (node.kind === 217) { + else if (node.kind === 217 /* ExportSpecifier */) { + // export { } or export { as foo } checkExpressionCached(node.propertyName || node.name); } else if (ts.isInternalModuleImportEqualsDeclaration(node)) { + // import foo = checkExpressionCached(node.moduleReference); } } } + // This function is only for imports with entity names function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 208); + importDeclaration = ts.getAncestor(entityName, 208 /* ImportEqualsDeclaration */); ts.Debug.assert(importDeclaration !== undefined); } - if (entityName.kind === 65 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { + // There are three things we might try to look for. In the following examples, + // the search term is enclosed in |...|: + // + // import a = |b|; // Namespace + // import a = |b.c|; // Value, type, namespace + // import a = |b.c|.d; // Namespace + if (entityName.kind === 65 /* Identifier */ && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 65 || entityName.parent.kind === 126) { - return resolveEntityName(entityName, 1536); + // Check for case 1 and 3 in the above example + if (entityName.kind === 65 /* Identifier */ || entityName.parent.kind === 126 /* QualifiedName */) { + return resolveEntityName(entityName, 1536 /* Namespace */); } else { - ts.Debug.assert(entityName.parent.kind === 208); - return resolveEntityName(entityName, 107455 | 793056 | 1536); + // Case 2 in above example + // entityName.kind could be a QualifiedName or a Missing identifier + ts.Debug.assert(entityName.parent.kind === 208 /* ImportEqualsDeclaration */); + return resolveEntityName(entityName, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */); } } function getFullyQualifiedName(symbol) { return symbol.parent ? getFullyQualifiedName(symbol.parent) + "." + symbolToString(symbol) : symbolToString(symbol); } + // Resolves a qualified name and any involved aliases function resolveEntityName(name, meaning) { if (ts.nodeIsMissing(name)) { return undefined; } var symbol; - if (name.kind === 65) { + if (name.kind === 65 /* Identifier */) { symbol = resolveName(name, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, name); if (!symbol) { return undefined; } } - else if (name.kind === 126 || name.kind === 155) { - var left = name.kind === 126 ? name.left : name.expression; - var right = name.kind === 126 ? name.right : name.name; - var namespace = resolveEntityName(left, 1536); + else if (name.kind === 126 /* QualifiedName */ || name.kind === 155 /* PropertyAccessExpression */) { + var left = name.kind === 126 /* QualifiedName */ ? name.left : name.expression; + var right = name.kind === 126 /* QualifiedName */ ? name.right : name.name; + var namespace = resolveEntityName(left, 1536 /* Namespace */); if (!namespace || namespace === unknownSymbol || ts.nodeIsMissing(right)) { return undefined; } @@ -9602,24 +11391,28 @@ var ts; else { ts.Debug.fail("Unknown entity name kind."); } - ts.Debug.assert((symbol.flags & 16777216) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((symbol.flags & 16777216 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); return symbol.flags & meaning ? symbol : resolveAlias(symbol); } function isExternalModuleNameRelative(moduleName) { + // TypeScript 1.0 spec (April 2014): 11.2.1 + // An external module name is "relative" if the first term is "." or "..". return moduleName.substr(0, 2) === "./" || moduleName.substr(0, 3) === "../" || moduleName.substr(0, 2) === ".\\" || moduleName.substr(0, 3) === "..\\"; } function resolveExternalModuleName(location, moduleReferenceExpression) { - if (moduleReferenceExpression.kind !== 8) { + if (moduleReferenceExpression.kind !== 8 /* StringLiteral */) { return; } var moduleReferenceLiteral = moduleReferenceExpression; var searchPath = ts.getDirectoryPath(getSourceFile(location).fileName); + // Module names are escaped in our symbol table. However, string literal values aren't. + // Escape the name in the "require(...)" clause to ensure we find the right symbol. var moduleName = ts.escapeIdentifier(moduleReferenceLiteral.text); if (!moduleName) return; var isRelative = isExternalModuleNameRelative(moduleName); if (!isRelative) { - var symbol = getSymbol(globals, '"' + moduleName + '"', 512); + var symbol = getSymbol(globals, '"' + moduleName + '"', 512 /* ValueModule */); if (symbol) { return symbol; } @@ -9646,12 +11439,17 @@ var ts; } error(moduleReferenceLiteral, ts.Diagnostics.Cannot_find_external_module_0, moduleName); } + // An external module with an 'export =' declaration resolves to the target of the 'export =' declaration, + // and an external module with no 'export =' declaration resolves to the module itself. function resolveExternalModuleSymbol(moduleSymbol) { return moduleSymbol && resolveSymbol(moduleSymbol.exports["export="]) || moduleSymbol; } + // An external module with an 'export =' declaration may be referenced as an ES6 module provided the 'export =' + // references a symbol that is at least declared as a module or a variable. The target of the 'export =' may + // combine other declarations with the module or variable (e.g. a class/module, function/module, interface/variable). function resolveESModuleSymbol(moduleSymbol, moduleReferenceExpression) { var symbol = resolveExternalModuleSymbol(moduleSymbol); - if (symbol && !(symbol.flags & (1536 | 3))) { + if (symbol && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */))) { error(moduleReferenceExpression, ts.Diagnostics.External_module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); symbol = undefined; } @@ -9660,8 +11458,11 @@ var ts; function getExportAssignmentSymbol(moduleSymbol) { return moduleSymbol.exports["export="]; } + function getExportsOfModuleAsArray(moduleSymbol) { + return symbolsToArray(getExportsOfModule(moduleSymbol)); + } function getExportsOfSymbol(symbol) { - return symbol.flags & 1536 ? getExportsOfModule(symbol) : symbol.exports || emptySymbols; + return symbol.flags & 1536 /* Module */ ? getExportsOfModule(symbol) : symbol.exports || emptySymbols; } function getExportsOfModule(moduleSymbol) { var links = getSymbolLinks(moduleSymbol); @@ -9679,8 +11480,10 @@ var ts; var visitedSymbols = []; visit(moduleSymbol); return result || moduleSymbol.exports; + // 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) { - if (symbol.flags & 1952 && !ts.contains(visitedSymbols, symbol)) { + if (symbol && symbol.flags & 1952 /* HasExports */ && !ts.contains(visitedSymbols, symbol)) { visitedSymbols.push(symbol); if (symbol !== moduleSymbol) { if (!result) { @@ -9688,6 +11491,7 @@ var ts; } extendExportSymbols(result, symbol.exports); } + // All export * declarations are collected in an __export symbol by the binder var exportStars = symbol.exports["__export"]; if (exportStars) { for (var _i = 0, _a = exportStars.declarations; _i < _a.length; _i++) { @@ -9709,19 +11513,23 @@ var ts; return getMergedSymbol(symbol.parent); } function getExportSymbolOfValueSymbolIfExported(symbol) { - return symbol && (symbol.flags & 1048576) !== 0 + return symbol && (symbol.flags & 1048576 /* ExportValue */) !== 0 ? getMergedSymbol(symbol.exportSymbol) : symbol; } function symbolIsValue(symbol) { - if (symbol.flags & 16777216) { + // If it is an instantiated symbol, then it is a value if the symbol it is an + // instantiation of is a value. + if (symbol.flags & 16777216 /* Instantiated */) { return symbolIsValue(getSymbolLinks(symbol).target); } - if (symbol.flags & 107455) { + // If the symbol has the value flag, it is trivially a value. + if (symbol.flags & 107455 /* Value */) { return true; } - if (symbol.flags & 8388608) { - return (resolveAlias(symbol).flags & 107455) !== 0; + // If it is an alias, then it is a value if the symbol it resolves to is a value. + if (symbol.flags & 8388608 /* Alias */) { + return (resolveAlias(symbol).flags & 107455 /* Value */) !== 0; } return false; } @@ -9729,7 +11537,7 @@ var ts; var members = node.members; for (var _i = 0; _i < members.length; _i++) { var member = members[_i]; - if (member.kind === 135 && ts.nodeIsPresent(member.body)) { + if (member.kind === 135 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -9749,11 +11557,15 @@ var ts; type.symbol = symbol; return type; } + // A reserved member name starts with two underscores, but the third character cannot be an underscore + // or the @ symbol. A third underscore indicates an escaped form of an identifer that started + // with at least two underscores. The @ character indicates that the name is denoted by a well known ES + // Symbol instance. 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 /* at */; } function getNamedMembers(members) { var result; @@ -9783,28 +11595,29 @@ var ts; return type; } function createAnonymousType(symbol, members, callSignatures, constructSignatures, stringIndexType, numberIndexType) { - return setObjectTypeMembers(createObjectType(32768, symbol), members, callSignatures, constructSignatures, stringIndexType, numberIndexType); + return setObjectTypeMembers(createObjectType(32768 /* Anonymous */, symbol), members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } function forEachSymbolTableInScope(enclosingDeclaration, callback) { var result; for (var location_1 = enclosingDeclaration; location_1; location_1 = location_1.parent) { + // Locals of a source file are not in scope (because they get merged into the global symbol table) if (location_1.locals && !isGlobalSourceFile(location_1)) { if (result = callback(location_1.locals)) { return result; } } switch (location_1.kind) { - case 227: + case 227 /* SourceFile */: if (!ts.isExternalModule(location_1)) { break; } - case 205: + case 205 /* ModuleDeclaration */: if (result = callback(getSymbolOfNode(location_1).exports)) { return result; } break; - case 201: - case 202: + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: if (result = callback(getSymbolOfNode(location_1).members)) { return result; } @@ -9814,34 +11627,45 @@ var ts; return callback(globals); } function getQualifiedLeftMeaning(rightMeaning) { - return rightMeaning === 107455 ? 107455 : 1536; + // If we are looking in value space, the parent meaning is value, other wise it is namespace + return rightMeaning === 107455 /* Value */ ? 107455 /* Value */ : 1536 /* Namespace */; } function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, useOnlyExternalAliasing) { function getAccessibleSymbolChainFromSymbolTable(symbols) { function canQualifySymbol(symbolFromSymbolTable, meaning) { + // If the symbol is equivalent and doesn't need further qualification, this symbol is accessible if (!needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning)) { return true; } + // If symbol needs qualification, make sure that parent is accessible, if it is then this symbol is accessible too var accessibleParent = getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning), useOnlyExternalAliasing); return !!accessibleParent; } function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol) { if (symbol === (resolvedAliasSymbol || symbolFromSymbolTable)) { + // if the symbolFromSymbolTable is not external module (it could be if it was determined as ambient external module and would be in globals table) + // and if symbolfrom symbolTable or alias resolution matches the symbol, + // check the symbol can be qualified, it is only then this symbol is accessible return !ts.forEach(symbolFromSymbolTable.declarations, hasExternalModuleSymbol) && canQualifySymbol(symbolFromSymbolTable, meaning); } } + // If symbol is directly available by its name in the symbol table if (isAccessible(ts.lookUp(symbols, symbol.name))) { return [symbol]; } + // Check if symbol is any of the alias return ts.forEachValue(symbols, function (symbolFromSymbolTable) { - if (symbolFromSymbolTable.flags & 8388608 && symbolFromSymbolTable.name !== "export=") { + if (symbolFromSymbolTable.flags & 8388608 /* Alias */ && symbolFromSymbolTable.name !== "export=") { if (!useOnlyExternalAliasing || + // Is this external alias, then use it to name ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); if (isAccessible(symbolFromSymbolTable, resolveAlias(symbolFromSymbolTable))) { return [symbolFromSymbolTable]; } + // Look in the exported members, if we can find accessibleSymbolChain, symbol is accessible using this chain + // but only if the symbolFromSymbolTable can be qualified var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined; if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); @@ -9857,59 +11681,82 @@ var ts; function needsQualification(symbol, enclosingDeclaration, meaning) { var qualify = false; forEachSymbolTableInScope(enclosingDeclaration, function (symbolTable) { + // If symbol of this name is not available in the symbol table we are ok if (!ts.hasProperty(symbolTable, symbol.name)) { + // Continue to the next symbol table return false; } + // If the symbol with this name is present it should refer to the symbol var symbolFromSymbolTable = symbolTable[symbol.name]; if (symbolFromSymbolTable === symbol) { + // No need to qualify return true; } - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + // Qualify if the symbol from symbol table has same meaning as expected + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 /* Alias */) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; } + // Continue to the next symbol table return false; }); return qualify; } function isSymbolAccessible(symbol, enclosingDeclaration, meaning) { - if (symbol && enclosingDeclaration && !(symbol.flags & 262144)) { + if (symbol && enclosingDeclaration && !(symbol.flags & 262144 /* TypeParameter */)) { var initialSymbol = symbol; var meaningToLook = meaning; while (symbol) { + // Symbol is accessible if it by itself is accessible var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaningToLook, false); if (accessibleSymbolChain) { var hasAccessibleDeclarations = hasVisibleDeclarations(accessibleSymbolChain[0]); if (!hasAccessibleDeclarations) { return { - accessibility: 1, + accessibility: 1 /* NotAccessible */, errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning), - errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, 1536) : undefined + errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, 1536 /* Namespace */) : undefined }; } return hasAccessibleDeclarations; } + // If we haven't got the accessible symbol, it doesn't mean the symbol is actually inaccessible. + // It could be a qualified symbol and hence verify the path + // e.g.: + // module m { + // export class c { + // } + // } + // let x: typeof m.c + // In the above example when we start with checking if typeof m.c symbol is accessible, + // we are going to see if c can be accessed in scope directly. + // But it can't, hence the accessible is going to be undefined, but that doesn't mean m.c is inaccessible + // It is accessible if the parent m is accessible because then m.c can be accessed through qualification meaningToLook = getQualifiedLeftMeaning(meaning); symbol = getParentOfSymbol(symbol); } + // This could be a symbol that is not exported in the external module + // or it could be a symbol from different external module that is not aliased and hence cannot be named var symbolExternalModule = ts.forEach(initialSymbol.declarations, getExternalModuleContainer); if (symbolExternalModule) { var enclosingExternalModule = getExternalModuleContainer(enclosingDeclaration); if (symbolExternalModule !== enclosingExternalModule) { + // name from different external module that is not visible return { - accessibility: 2, + accessibility: 2 /* CannotBeNamed */, errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning), errorModuleName: symbolToString(symbolExternalModule) }; } } + // Just a local name that is not accessible return { - accessibility: 1, + accessibility: 1 /* NotAccessible */, errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning) }; } - return { accessibility: 0 }; + return { accessibility: 0 /* Accessible */ }; function getExternalModuleContainer(declaration) { for (; declaration; declaration = declaration.parent) { if (hasExternalModuleSymbol(declaration)) { @@ -9919,20 +11766,22 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 205 && declaration.name.kind === 8) || - (declaration.kind === 227 && ts.isExternalModule(declaration)); + return (declaration.kind === 205 /* ModuleDeclaration */ && declaration.name.kind === 8 /* StringLiteral */) || + (declaration.kind === 227 /* SourceFile */ && ts.isExternalModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; if (ts.forEach(symbol.declarations, function (declaration) { return !getIsDeclarationVisible(declaration); })) { return undefined; } - return { accessibility: 0, aliasesToMakeVisible: aliasesToMakeVisible }; + return { accessibility: 0 /* Accessible */, aliasesToMakeVisible: aliasesToMakeVisible }; function getIsDeclarationVisible(declaration) { if (!isDeclarationVisible(declaration)) { + // Mark the unexported alias as visible if its parent is visible + // because these kind of aliases can be used to name types in declaration file var anyImportSyntax = getAnyImportSyntax(declaration); if (anyImportSyntax && - !(anyImportSyntax.flags & 1) && + !(anyImportSyntax.flags & 1 /* Export */) && isDeclarationVisible(anyImportSyntax.parent)) { getNodeLinks(declaration).isVisible = true; if (aliasesToMakeVisible) { @@ -9945,27 +11794,34 @@ var ts; } return true; } + // Declaration is not visible return false; } return true; } } function isEntityNameVisible(entityName, enclosingDeclaration) { + // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 144) { - meaning = 107455 | 1048576; + if (entityName.parent.kind === 144 /* TypeQuery */) { + // Typeof value + meaning = 107455 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 126 || entityName.kind === 155 || - entityName.parent.kind === 208) { - meaning = 1536; + else if (entityName.kind === 126 /* QualifiedName */ || entityName.kind === 155 /* PropertyAccessExpression */ || + entityName.parent.kind === 208 /* ImportEqualsDeclaration */) { + // Left identifier from type reference or TypeAlias + // Entity name of the import declaration + meaning = 1536 /* Namespace */; } else { - meaning = 793056; + // Type Reference or TypeAlias entity = Identifier + meaning = 793056 /* Type */; } var firstIdentifier = getFirstIdentifier(entityName); var symbol = resolveName(enclosingDeclaration, firstIdentifier.text, meaning, undefined, undefined); + // Verify if the symbol is accessible return (symbol && hasVisibleDeclarations(symbol)) || { - accessibility: 1, + accessibility: 1 /* NotAccessible */, errorSymbolName: ts.getTextOfNode(firstIdentifier), errorNode: firstIdentifier }; @@ -9991,26 +11847,31 @@ var ts; getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); var result = writer.string(); ts.releaseStringWriter(writer); - var maxLength = compilerOptions.noErrorTruncation || flags & 4 ? undefined : 100; + var maxLength = compilerOptions.noErrorTruncation || flags & 4 /* NoTruncation */ ? undefined : 100; if (maxLength && result.length >= maxLength) { result = result.substr(0, maxLength - "...".length) + "..."; } return result; } function getTypeAliasForTypeLiteral(type) { - if (type.symbol && type.symbol.flags & 2048) { + if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { var node = type.symbol.declarations[0].parent; - while (node.kind === 149) { + while (node.kind === 149 /* ParenthesizedType */) { node = node.parent; } - if (node.kind === 203) { + if (node.kind === 203 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } return undefined; } + // This is for caching the result of getSymbolDisplayBuilder. Do not access directly. var _displayBuilder; function getSymbolDisplayBuilder() { + /** + * Writes only the name of the symbol out to the writer. Uses the original source text + * for the name of the symbol if it is available to match how the user inputted the name. + */ function appendSymbolNameOnly(symbol, writer) { if (symbol.declarations && symbol.declarations.length > 0) { var declaration = symbol.declarations[0]; @@ -10021,29 +11882,42 @@ var ts; } writer.writeSymbol(symbol.name, symbol); } + /** + * Enclosing declaration is optional when we don't want to get qualified name in the enclosing declaration scope + * Meaning needs to be specified if the enclosing declaration is given + */ function buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning, flags, typeFlags) { var parentSymbol; function appendParentTypeArgumentsAndSymbolName(symbol) { if (parentSymbol) { - if (flags & 1) { - if (symbol.flags & 16777216) { + // Write type arguments of instantiated class/interface here + if (flags & 1 /* WriteTypeParametersOrArguments */) { + if (symbol.flags & 16777216 /* Instantiated */) { buildDisplayForTypeArgumentsAndDelimiters(getTypeParametersOfClassOrInterface(parentSymbol), symbol.mapper, writer, enclosingDeclaration); } else { buildTypeParameterDisplayFromSymbol(parentSymbol, writer, enclosingDeclaration); } } - writePunctuation(writer, 20); + writePunctuation(writer, 20 /* DotToken */); } parentSymbol = symbol; appendSymbolNameOnly(symbol, writer); } + // Let the writer know we just wrote out a symbol. The declaration emitter writer uses + // this to determine if an import it has previously seen (and not written out) needs + // to be written to the file once the walk of the tree is complete. + // + // NOTE(cyrusn): This approach feels somewhat unfortunate. A simple pass over the tree + // up front (for example, during checking) could determine if we need to emit the imports + // and we could then access that data during declaration emit. writer.trackSymbol(symbol, enclosingDeclaration, meaning); function walkSymbol(symbol, meaning) { if (symbol) { - var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, !!(flags & 2)); + var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, !!(flags & 2 /* UseOnlyExternalAliasing */)); if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { + // Go up and add our parent. walkSymbol(getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol), getQualifiedLeftMeaning(meaning)); } if (accessibleSymbolChain) { @@ -10053,18 +11927,23 @@ var ts; } } else { + // If we didn't find accessible symbol chain for this symbol, break if this is external module if (!parentSymbol && ts.forEach(symbol.declarations, hasExternalModuleSymbol)) { return; } - if (symbol.flags & 2048 || symbol.flags & 4096) { + // if this is anonymous type break + if (symbol.flags & 2048 /* TypeLiteral */ || symbol.flags & 4096 /* ObjectLiteral */) { return; } appendParentTypeArgumentsAndSymbolName(symbol); } } } - var isTypeParameter = symbol.flags & 262144; - var typeFormatFlag = 128 & typeFlags; + // Get qualified name if the symbol is not a type parameter + // and there is an enclosing declaration or we specifically + // asked for it + var isTypeParameter = symbol.flags & 262144 /* TypeParameter */; + var typeFormatFlag = 128 /* UseFullyQualifiedType */ & typeFlags; if (!isTypeParameter && (enclosingDeclaration || typeFormatFlag)) { walkSymbol(symbol, meaning); return; @@ -10072,37 +11951,42 @@ var ts; return appendParentTypeArgumentsAndSymbolName(symbol); } function buildTypeDisplay(type, writer, enclosingDeclaration, globalFlags, typeStack) { - var globalFlagsToPass = globalFlags & 16; + var globalFlagsToPass = globalFlags & 16 /* WriteOwnNameForAnyLike */; return writeType(type, globalFlags); function writeType(type, flags) { - if (type.flags & 1048703) { - writer.writeKeyword(!(globalFlags & 16) && - (type.flags & 1) ? "any" : type.intrinsicName); + // Write undefined/null type as any + if (type.flags & 1048703 /* Intrinsic */) { + // Special handling for unknown / resolving types, they should show up as any and not unknown or __resolving + writer.writeKeyword(!(globalFlags & 16 /* WriteOwnNameForAnyLike */) && + (type.flags & 1 /* Any */) ? "any" : type.intrinsicName); } - else if (type.flags & 4096) { + else if (type.flags & 4096 /* Reference */) { writeTypeReference(type, flags); } - else if (type.flags & (1024 | 2048 | 128 | 512)) { - buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 793056, 0, flags); + else if (type.flags & (1024 /* Class */ | 2048 /* Interface */ | 128 /* Enum */ | 512 /* TypeParameter */)) { + // The specified symbol flags need to be reinterpreted as type flags + buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 793056 /* Type */, 0 /* None */, flags); } - else if (type.flags & 8192) { + else if (type.flags & 8192 /* Tuple */) { writeTupleType(type); } - else if (type.flags & 16384) { + else if (type.flags & 16384 /* Union */) { writeUnionType(type, flags); } - else if (type.flags & 32768) { + else if (type.flags & 32768 /* Anonymous */) { writeAnonymousType(type, flags); } - else if (type.flags & 256) { + else if (type.flags & 256 /* StringLiteral */) { writer.writeStringLiteral(type.text); } else { - writePunctuation(writer, 14); + // Should never get here + // { ... } + writePunctuation(writer, 14 /* OpenBraceToken */); writeSpace(writer); - writePunctuation(writer, 21); + writePunctuation(writer, 21 /* DotDotDotToken */); writeSpace(writer); - writePunctuation(writer, 15); + writePunctuation(writer, 15 /* CloseBraceToken */); } } function writeTypeList(types, union) { @@ -10111,53 +11995,57 @@ var ts; if (union) { writeSpace(writer); } - writePunctuation(writer, union ? 44 : 23); + writePunctuation(writer, union ? 44 /* BarToken */ : 23 /* CommaToken */); writeSpace(writer); } - writeType(types[i], union ? 64 : 0); + writeType(types[i], union ? 64 /* InElementType */ : 0 /* None */); } } function writeTypeReference(type, flags) { - if (type.target === globalArrayType && !(flags & 1)) { - writeType(type.typeArguments[0], 64); - writePunctuation(writer, 18); - writePunctuation(writer, 19); + if (type.target === globalArrayType && !(flags & 1 /* WriteArrayAsGenericType */)) { + writeType(type.typeArguments[0], 64 /* InElementType */); + writePunctuation(writer, 18 /* OpenBracketToken */); + writePunctuation(writer, 19 /* CloseBracketToken */); } else { - buildSymbolDisplay(type.target.symbol, writer, enclosingDeclaration, 793056); - writePunctuation(writer, 24); + buildSymbolDisplay(type.target.symbol, writer, enclosingDeclaration, 793056 /* Type */); + writePunctuation(writer, 24 /* LessThanToken */); writeTypeList(type.typeArguments, false); - writePunctuation(writer, 25); + writePunctuation(writer, 25 /* GreaterThanToken */); } } function writeTupleType(type) { - writePunctuation(writer, 18); + writePunctuation(writer, 18 /* OpenBracketToken */); writeTypeList(type.elementTypes, false); - writePunctuation(writer, 19); + writePunctuation(writer, 19 /* CloseBracketToken */); } function writeUnionType(type, flags) { - if (flags & 64) { - writePunctuation(writer, 16); + if (flags & 64 /* InElementType */) { + writePunctuation(writer, 16 /* OpenParenToken */); } writeTypeList(type.types, true); - if (flags & 64) { - writePunctuation(writer, 17); + if (flags & 64 /* InElementType */) { + writePunctuation(writer, 17 /* CloseParenToken */); } } function writeAnonymousType(type, flags) { - if (type.symbol && type.symbol.flags & (32 | 384 | 512)) { + // Always use 'typeof T' for type of class, enum, and module objects + if (type.symbol && type.symbol.flags & (32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { writeTypeofSymbol(type, flags); } else if (shouldWriteTypeOfFunctionSymbol()) { writeTypeofSymbol(type, flags); } else if (typeStack && ts.contains(typeStack, type)) { + // If type is an anonymous type literal in a type alias declaration, use type alias name var typeAlias = getTypeAliasForTypeLiteral(type); if (typeAlias) { - buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, 793056, 0, flags); + // The specified symbol flags need to be reinterpreted as type flags + buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, 793056 /* Type */, 0 /* None */, flags); } else { - writeKeyword(writer, 112); + // Recursive usage, use any + writeKeyword(writer, 112 /* AnyKeyword */); } } else { @@ -10170,28 +12058,31 @@ 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) && + var isStaticMethodSymbol = !!(type.symbol.flags & 8192 /* Method */ && + ts.forEach(type.symbol.declarations, function (declaration) { return declaration.flags & 128 /* Static */; })); + var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16 /* Function */) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { - return declaration.parent.kind === 227 || declaration.parent.kind === 206; + return declaration.parent.kind === 227 /* SourceFile */ || declaration.parent.kind === 206 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { - return !!(flags & 2) || - (typeStack && ts.contains(typeStack, type)); + // typeof is allowed only for static/non local functions + return !!(flags & 2 /* UseTypeOfFunction */) || + (typeStack && ts.contains(typeStack, type)); // it is type of the symbol uses itself recursively } } } } function writeTypeofSymbol(type, typeFormatFlags) { - writeKeyword(writer, 97); + writeKeyword(writer, 97 /* TypeOfKeyword */); writeSpace(writer); - buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 107455, 0, typeFormatFlags); + buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 107455 /* Value */, 0 /* None */, typeFormatFlags); } function getIndexerParameterName(type, indexKind, fallbackName) { var declaration = getIndexDeclarationOfSymbol(type.symbol, indexKind); if (!declaration) { + // declaration might not be found if indexer was added from the contextual type. + // in this case use fallback name return fallbackName; } ts.Debug.assert(declaration.parameters.length !== 0); @@ -10201,111 +12092,113 @@ var ts; var resolved = resolveObjectOrUnionTypeMembers(type); if (!resolved.properties.length && !resolved.stringIndexType && !resolved.numberIndexType) { if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { - writePunctuation(writer, 14); - writePunctuation(writer, 15); + writePunctuation(writer, 14 /* OpenBraceToken */); + writePunctuation(writer, 15 /* CloseBraceToken */); return; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { - if (flags & 64) { - writePunctuation(writer, 16); + if (flags & 64 /* InElementType */) { + writePunctuation(writer, 16 /* OpenParenToken */); } - buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8, typeStack); - if (flags & 64) { - writePunctuation(writer, 17); + buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, typeStack); + if (flags & 64 /* InElementType */) { + writePunctuation(writer, 17 /* CloseParenToken */); } return; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { - if (flags & 64) { - writePunctuation(writer, 16); + if (flags & 64 /* InElementType */) { + writePunctuation(writer, 16 /* OpenParenToken */); } - writeKeyword(writer, 88); + writeKeyword(writer, 88 /* NewKeyword */); writeSpace(writer); - buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8, typeStack); - if (flags & 64) { - writePunctuation(writer, 17); + buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, typeStack); + if (flags & 64 /* InElementType */) { + writePunctuation(writer, 17 /* CloseParenToken */); } return; } } - writePunctuation(writer, 14); + writePunctuation(writer, 14 /* OpenBraceToken */); writer.writeLine(); writer.increaseIndent(); for (var _i = 0, _a = resolved.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); - writePunctuation(writer, 22); + writePunctuation(writer, 22 /* SemicolonToken */); writer.writeLine(); } for (var _b = 0, _c = resolved.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - writeKeyword(writer, 88); + writeKeyword(writer, 88 /* NewKeyword */); writeSpace(writer); buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); - writePunctuation(writer, 22); + writePunctuation(writer, 22 /* SemicolonToken */); writer.writeLine(); } if (resolved.stringIndexType) { - writePunctuation(writer, 18); - writer.writeParameter(getIndexerParameterName(resolved, 0, "x")); - writePunctuation(writer, 51); + // [x: string]: + writePunctuation(writer, 18 /* OpenBracketToken */); + writer.writeParameter(getIndexerParameterName(resolved, 0 /* String */, "x")); + writePunctuation(writer, 51 /* ColonToken */); writeSpace(writer); - writeKeyword(writer, 121); - writePunctuation(writer, 19); - writePunctuation(writer, 51); + writeKeyword(writer, 121 /* StringKeyword */); + writePunctuation(writer, 19 /* CloseBracketToken */); + writePunctuation(writer, 51 /* ColonToken */); writeSpace(writer); - writeType(resolved.stringIndexType, 0); - writePunctuation(writer, 22); + writeType(resolved.stringIndexType, 0 /* None */); + writePunctuation(writer, 22 /* SemicolonToken */); writer.writeLine(); } if (resolved.numberIndexType) { - writePunctuation(writer, 18); - writer.writeParameter(getIndexerParameterName(resolved, 1, "x")); - writePunctuation(writer, 51); + // [x: number]: + writePunctuation(writer, 18 /* OpenBracketToken */); + writer.writeParameter(getIndexerParameterName(resolved, 1 /* Number */, "x")); + writePunctuation(writer, 51 /* ColonToken */); writeSpace(writer); - writeKeyword(writer, 119); - writePunctuation(writer, 19); - writePunctuation(writer, 51); + writeKeyword(writer, 119 /* NumberKeyword */); + writePunctuation(writer, 19 /* CloseBracketToken */); + writePunctuation(writer, 51 /* ColonToken */); writeSpace(writer); - writeType(resolved.numberIndexType, 0); - writePunctuation(writer, 22); + writeType(resolved.numberIndexType, 0 /* None */); + writePunctuation(writer, 22 /* SemicolonToken */); writer.writeLine(); } 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); + if (p.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(t).length) { + var signatures = getSignaturesOfType(t, 0 /* Call */); for (var _f = 0; _f < signatures.length; _f++) { var signature = signatures[_f]; buildSymbolDisplay(p, writer); - if (p.flags & 536870912) { - writePunctuation(writer, 50); + if (p.flags & 536870912 /* Optional */) { + writePunctuation(writer, 50 /* QuestionToken */); } buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, typeStack); - writePunctuation(writer, 22); + writePunctuation(writer, 22 /* SemicolonToken */); writer.writeLine(); } } else { buildSymbolDisplay(p, writer); - if (p.flags & 536870912) { - writePunctuation(writer, 50); + if (p.flags & 536870912 /* Optional */) { + writePunctuation(writer, 50 /* QuestionToken */); } - writePunctuation(writer, 51); + writePunctuation(writer, 51 /* ColonToken */); writeSpace(writer); - writeType(t, 0); - writePunctuation(writer, 22); + writeType(t, 0 /* None */); + writePunctuation(writer, 22 /* SemicolonToken */); writer.writeLine(); } } writer.decreaseIndent(); - writePunctuation(writer, 15); + writePunctuation(writer, 15 /* CloseBraceToken */); } } function buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaraiton, flags) { var targetSymbol = getTargetSymbol(symbol); - if (targetSymbol.flags & 32 || targetSymbol.flags & 64) { + if (targetSymbol.flags & 32 /* Class */ || targetSymbol.flags & 64 /* Interface */) { buildDisplayForTypeParametersAndDelimiters(getTypeParametersOfClassOrInterface(symbol), writer, enclosingDeclaraiton, flags); } } @@ -10314,73 +12207,75 @@ var ts; var constraint = getConstraintOfTypeParameter(tp); if (constraint) { writeSpace(writer); - writeKeyword(writer, 79); + writeKeyword(writer, 79 /* ExtendsKeyword */); writeSpace(writer); buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, typeStack); } } function buildParameterDisplay(p, writer, enclosingDeclaration, flags, typeStack) { if (ts.hasDotDotDotToken(p.valueDeclaration)) { - writePunctuation(writer, 21); + writePunctuation(writer, 21 /* DotDotDotToken */); } appendSymbolNameOnly(p, writer); if (ts.hasQuestionToken(p.valueDeclaration) || p.valueDeclaration.initializer) { - writePunctuation(writer, 50); + writePunctuation(writer, 50 /* QuestionToken */); } - writePunctuation(writer, 51); + writePunctuation(writer, 51 /* ColonToken */); writeSpace(writer); buildTypeDisplay(getTypeOfSymbol(p), writer, enclosingDeclaration, flags, typeStack); } function buildDisplayForTypeParametersAndDelimiters(typeParameters, writer, enclosingDeclaration, flags, typeStack) { if (typeParameters && typeParameters.length) { - writePunctuation(writer, 24); + writePunctuation(writer, 24 /* LessThanToken */); for (var i = 0; i < typeParameters.length; i++) { if (i > 0) { - writePunctuation(writer, 23); + writePunctuation(writer, 23 /* CommaToken */); writeSpace(writer); } buildTypeParameterDisplay(typeParameters[i], writer, enclosingDeclaration, flags, typeStack); } - writePunctuation(writer, 25); + writePunctuation(writer, 25 /* GreaterThanToken */); } } function buildDisplayForTypeArgumentsAndDelimiters(typeParameters, mapper, writer, enclosingDeclaration, flags, typeStack) { if (typeParameters && typeParameters.length) { - writePunctuation(writer, 24); + writePunctuation(writer, 24 /* LessThanToken */); for (var i = 0; i < typeParameters.length; i++) { if (i > 0) { - writePunctuation(writer, 23); + writePunctuation(writer, 23 /* CommaToken */); writeSpace(writer); } - buildTypeDisplay(mapper(typeParameters[i]), writer, enclosingDeclaration, 0); + buildTypeDisplay(mapper(typeParameters[i]), writer, enclosingDeclaration, 0 /* None */); } - writePunctuation(writer, 25); + writePunctuation(writer, 25 /* GreaterThanToken */); } } function buildDisplayForParametersAndDelimiters(parameters, writer, enclosingDeclaration, flags, typeStack) { - writePunctuation(writer, 16); + writePunctuation(writer, 16 /* OpenParenToken */); for (var i = 0; i < parameters.length; i++) { if (i > 0) { - writePunctuation(writer, 23); + writePunctuation(writer, 23 /* CommaToken */); writeSpace(writer); } buildParameterDisplay(parameters[i], writer, enclosingDeclaration, flags, typeStack); } - writePunctuation(writer, 17); + writePunctuation(writer, 17 /* CloseParenToken */); } function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, typeStack) { - if (flags & 8) { + if (flags & 8 /* WriteArrowStyleSignature */) { writeSpace(writer); - writePunctuation(writer, 32); + writePunctuation(writer, 32 /* EqualsGreaterThanToken */); } else { - writePunctuation(writer, 51); + writePunctuation(writer, 51 /* ColonToken */); } writeSpace(writer); buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags, typeStack); } function buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, typeStack) { - if (signature.target && (flags & 32)) { + if (signature.target && (flags & 32 /* WriteTypeArgumentsOfSignature */)) { + // Instantiated signature, write type arguments instead + // This is achieved by passing in the mapper separately buildDisplayForTypeArgumentsAndDelimiters(signature.target.typeParameters, signature.mapper, writer, enclosingDeclaration); } else { @@ -10407,41 +12302,47 @@ var ts; function isDeclarationVisible(node) { function getContainingExternalModule(node) { for (; node; node = node.parent) { - if (node.kind === 205) { - if (node.name.kind === 8) { + if (node.kind === 205 /* ModuleDeclaration */) { + if (node.name.kind === 8 /* StringLiteral */) { return node; } } - else if (node.kind === 227) { + else if (node.kind === 227 /* SourceFile */) { return ts.isExternalModule(node) ? node : undefined; } } ts.Debug.fail("getContainingModule cant reach here"); } function isUsedInExportAssignment(node) { + // Get source File and see if it is external module and has export assigned symbol var externalModule = getContainingExternalModule(node); var exportAssignmentSymbol; var resolvedExportSymbol; if (externalModule) { + // This is export assigned symbol node var externalModuleSymbol = getSymbolOfNode(externalModule); exportAssignmentSymbol = getExportAssignmentSymbol(externalModuleSymbol); var symbolOfNode = getSymbolOfNode(node); if (isSymbolUsedInExportAssignment(symbolOfNode)) { return true; } - if (symbolOfNode.flags & 8388608) { + // if symbolOfNode is alias declaration, resolve the symbol declaration and check + if (symbolOfNode.flags & 8388608 /* Alias */) { return isSymbolUsedInExportAssignment(resolveAlias(symbolOfNode)); } } + // Check if the symbol is used in export assignment function isSymbolUsedInExportAssignment(symbol) { if (exportAssignmentSymbol === symbol) { return true; } - if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 8388608)) { + if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 8388608 /* Alias */)) { + // if export assigned symbol is alias declaration, resolve the alias resolvedExportSymbol = resolvedExportSymbol || resolveAlias(exportAssignmentSymbol); if (resolvedExportSymbol === symbol) { return true; } + // Container of resolvedExportSymbol is visible return ts.forEach(resolvedExportSymbol.declarations, function (current) { while (current) { if (current === node) { @@ -10455,58 +12356,69 @@ var ts; } function determineIfDeclarationIsVisible() { switch (node.kind) { - case 152: + case 152 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 198: + case 198 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { + // If the binding pattern is empty, this variable declaration is not visible return false; } - case 205: - case 201: - case 202: - case 203: - case 200: - case 204: - case 208: + // Otherwise fall through + case 205 /* ModuleDeclaration */: + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + case 203 /* TypeAliasDeclaration */: + case 200 /* FunctionDeclaration */: + case 204 /* EnumDeclaration */: + case 208 /* ImportEqualsDeclaration */: var parent_2 = getDeclarationContainer(node); - if (!(ts.getCombinedNodeFlags(node) & 1) && - !(node.kind !== 208 && parent_2.kind !== 227 && ts.isInAmbientContext(parent_2))) { + // If the node is not exported or it is not ambient module element (except import declaration) + if (!(ts.getCombinedNodeFlags(node) & 1 /* Export */) && + !(node.kind !== 208 /* ImportEqualsDeclaration */ && parent_2.kind !== 227 /* SourceFile */ && ts.isInAmbientContext(parent_2))) { return isGlobalSourceFile(parent_2); } + // Exported members/ambient module elements (exception import declaration) are visible if parent is visible return isDeclarationVisible(parent_2); - case 132: - case 131: - case 136: - case 137: - case 134: - case 133: - if (node.flags & (32 | 64)) { + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + if (node.flags & (32 /* Private */ | 64 /* Protected */)) { + // Private/protected properties/methods are not visible return false; } - case 135: - case 139: - case 138: - case 140: - case 129: - case 206: - case 142: - case 143: - case 145: - case 141: - case 146: - case 147: - case 148: - case 149: + // Public properties/methods are visible if its parents are visible, so let it fall into next case statement + case 135 /* Constructor */: + case 139 /* ConstructSignature */: + case 138 /* CallSignature */: + case 140 /* IndexSignature */: + case 129 /* Parameter */: + case 206 /* ModuleBlock */: + case 142 /* FunctionType */: + case 143 /* ConstructorType */: + case 145 /* TypeLiteral */: + case 141 /* TypeReference */: + case 146 /* ArrayType */: + case 147 /* TupleType */: + case 148 /* UnionType */: + case 149 /* ParenthesizedType */: return isDeclarationVisible(node.parent); - case 210: - case 211: - case 213: + // Default binding, import specifier and namespace import is visible + // only on demand so by default it is not visible + case 210 /* ImportClause */: + case 211 /* NamespaceImport */: + case 213 /* ImportSpecifier */: return false; - case 128: - case 227: + // Type parameters are always visible + case 128 /* TypeParameter */: + // Source file is always visible + case 227 /* SourceFile */: return true; - case 214: + // Export assignements do not create name bindings outside the module + case 214 /* ExportAssignment */: return false; default: ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); @@ -10522,10 +12434,10 @@ var ts; } 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); + if (node.parent && node.parent.kind === 214 /* ExportAssignment */) { + exportSymbol = resolveName(node.parent, node.text, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */, ts.Diagnostics.Cannot_find_name_0, node); } - else if (node.parent.kind === 217) { + else if (node.parent.kind === 217 /* ExportSpecifier */) { exportSymbol = getTargetOfExportSpecifier(node.parent); } var result = []; @@ -10541,38 +12453,51 @@ var ts; result.push(resultNode); } if (ts.isInternalModuleImportEqualsDeclaration(declaration)) { + // Add the referenced top container visible var internalModuleReference = declaration.moduleReference; var firstIdentifier = getFirstIdentifier(internalModuleReference); - var importSymbol = resolveName(declaration, firstIdentifier.text, 107455 | 793056 | 1536, ts.Diagnostics.Cannot_find_name_0, firstIdentifier); + var importSymbol = resolveName(declaration, firstIdentifier.text, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */, ts.Diagnostics.Cannot_find_name_0, firstIdentifier); buildVisibleNodeList(importSymbol.declarations); } }); } } function getRootDeclaration(node) { - while (node.kind === 152) { + while (node.kind === 152 /* BindingElement */) { node = node.parent.parent; } return node; } function getDeclarationContainer(node) { node = getRootDeclaration(node); - return node.kind === 198 ? node.parent.parent.parent : node.parent; + // Parent chain: + // VaribleDeclaration -> VariableDeclarationList -> VariableStatement -> 'Declaration Container' + return node.kind === 198 /* VariableDeclaration */ ? node.parent.parent.parent : node.parent; } function getTypeOfPrototypeProperty(prototype) { + // TypeScript 1.0 spec (April 2014): 8.4 + // Every class automatically contains a static property member named 'prototype', + // the type of which is an instantiation of the class type with type Any supplied as a type argument for each type parameter. + // It is an error to explicitly declare a static property member with the name 'prototype'. var classType = getDeclaredTypeOfSymbol(prototype.parent); return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { return anyType; })) : classType; } + // Return the type of the given property in the given type, or undefined if no such property exists function getTypeOfPropertyOfType(type, name) { var prop = getPropertyOfType(type, name); return prop ? getTypeOfSymbol(prop) : undefined; } + // Return the inferred type for a binding element function getTypeForBindingElement(declaration) { var pattern = declaration.parent; var parentType = getTypeForVariableLikeDeclaration(pattern.parent); + // If parent has the unknown (error) type, then so does this binding element if (parentType === unknownType) { return unknownType; } + // If no type was specified or inferred for parent, or if the specified or inferred type is any, + // infer from the initializer of the binding element if one is present. Otherwise, go with the + // undefined or any type of the parent. if (!parentType || parentType === anyType) { if (declaration.initializer) { return checkExpressionCached(declaration.initializer); @@ -10580,24 +12505,33 @@ var ts; return parentType; } var type; - if (pattern.kind === 150) { + if (pattern.kind === 150 /* ObjectBindingPattern */) { + // Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form) var name_5 = declaration.propertyName || declaration.name; + // Use type of the specified property, or otherwise, for a numeric name, the type of the numeric index signature, + // or otherwise the type of the string index signature. type = getTypeOfPropertyOfType(parentType, name_5.text) || - isNumericLiteralName(name_5.text) && getIndexTypeOfType(parentType, 1) || - getIndexTypeOfType(parentType, 0); + isNumericLiteralName(name_5.text) && getIndexTypeOfType(parentType, 1 /* Number */) || + getIndexTypeOfType(parentType, 0 /* String */); if (!type) { error(name_5, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name_5)); return unknownType; } } else { - if (!isArrayLikeType(parentType)) { - error(pattern, ts.Diagnostics.Type_0_is_not_an_array_type, typeToString(parentType)); - return unknownType; - } + // This elementType will be used if the specific property corresponding to this index is not + // present (aka the tuple element property). This call also checks that the parentType is in + // fact an iterable or array (depending on target language). + var elementType = checkIteratedTypeOrElementType(parentType, pattern, false); if (!declaration.dotDotDotToken) { + if (elementType.flags & 1 /* Any */) { + return elementType; + } + // Use specific property type when parent is a tuple or numeric index type when parent is an array var propName = "" + ts.indexOf(pattern.elements, declaration); - type = isTupleLikeType(parentType) ? getTypeOfPropertyOfType(parentType, propName) : getIndexTypeOfType(parentType, 1); + type = isTupleLikeType(parentType) + ? getTypeOfPropertyOfType(parentType, propName) + : elementType; if (!type) { if (isTupleType(parentType)) { error(declaration, ts.Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2, typeToString(parentType), parentType.elementTypes.length, pattern.elements.length); @@ -10609,45 +12543,61 @@ var ts; } } else { - type = createArrayType(getIndexTypeOfType(parentType, 1)); + // Rest element has an array type with the same element type as the parent type + type = createArrayType(elementType); } } return type; } + // Return the inferred type for a variable, parameter, or property declaration function getTypeForVariableLikeDeclaration(declaration) { - if (declaration.parent.parent.kind === 187) { + // A variable declared in a for..in statement is always of type any + if (declaration.parent.parent.kind === 187 /* ForInStatement */) { return anyType; } - if (declaration.parent.parent.kind === 188) { + if (declaration.parent.parent.kind === 188 /* ForOfStatement */) { + // checkRightHandSideOfForOf will return undefined if the for-of expression type was + // missing properties/signatures required to get its iteratedType (like + // [Symbol.iterator] or next). This may be because we accessed properties from anyType, + // or it may have led to an error inside getIteratedType. return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType; } if (ts.isBindingPattern(declaration.parent)) { return getTypeForBindingElement(declaration); } + // Use type from type annotation if one is present if (declaration.type) { - return getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); + return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 129) { + if (declaration.kind === 129 /* Parameter */) { var func = declaration.parent; - if (func.kind === 137 && !ts.hasDynamicName(func)) { - var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 136); + // For a parameter of a set accessor, use the type of the get accessor if one is present + if (func.kind === 137 /* SetAccessor */ && !ts.hasDynamicName(func)) { + var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 136 /* GetAccessor */); if (getter) { return getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); } } + // Use contextual parameter type if one is available var type = getContextuallyTypedParameterType(declaration); if (type) { return type; } } + // Use the type of the initializer expression if one is present if (declaration.initializer) { return checkExpressionCached(declaration.initializer); } - if (declaration.kind === 225) { + // If it is a short-hand property assignment, use the type of the identifier + if (declaration.kind === 225 /* ShorthandPropertyAssignment */) { return checkIdentifier(declaration.name); } + // No type specified and nothing can be inferred return undefined; } + // Return the type implied by a binding pattern element. This is the type of the initializer of the element if + // one is present. Otherwise, if the element is itself a binding pattern, it is the type implied by the binding + // pattern. Otherwise, it is the type any. function getTypeFromBindingElement(element) { if (element.initializer) { return getWidenedType(checkExpressionCached(element.initializer)); @@ -10657,10 +12607,11 @@ var ts; } return anyType; } + // Return the type implied by an object binding pattern function getTypeFromObjectBindingPattern(pattern) { var members = {}; ts.forEach(pattern.elements, function (e) { - var flags = 4 | 67108864 | (e.initializer ? 536870912 : 0); + var flags = 4 /* Property */ | 67108864 /* Transient */ | (e.initializer ? 536870912 /* Optional */ : 0); var name = e.propertyName || e.name; var symbol = createSymbol(flags, name.text); symbol.type = getTypeFromBindingElement(e); @@ -10668,37 +12619,69 @@ var ts; }); return createAnonymousType(undefined, members, emptyArray, emptyArray, undefined, undefined); } + // Return the type implied by an array binding pattern function getTypeFromArrayBindingPattern(pattern) { var hasSpreadElement = false; var elementTypes = []; ts.forEach(pattern.elements, function (e) { - elementTypes.push(e.kind === 175 || e.dotDotDotToken ? anyType : getTypeFromBindingElement(e)); + elementTypes.push(e.kind === 175 /* OmittedExpression */ || e.dotDotDotToken ? anyType : getTypeFromBindingElement(e)); if (e.dotDotDotToken) { hasSpreadElement = true; } }); - return !elementTypes.length ? anyArrayType : hasSpreadElement ? createArrayType(getUnionType(elementTypes)) : createTupleType(elementTypes); + if (!elementTypes.length) { + return languageVersion >= 2 /* ES6 */ ? createIterableType(anyType) : anyArrayType; + } + else if (hasSpreadElement) { + var unionOfElements = getUnionType(elementTypes); + return languageVersion >= 2 /* ES6 */ ? createIterableType(unionOfElements) : createArrayType(unionOfElements); + } + // If the pattern has at least one element, and no rest element, then it should imply a tuple type. + return createTupleType(elementTypes); } + // Return the type implied by a binding pattern. This is the type implied purely by the binding pattern itself + // and without regard to its context (i.e. without regard any type annotation or initializer associated with the + // declaration in which the binding pattern is contained). For example, the implied type of [x, y] is [any, any] + // and the implied type of { x, y: z = 1 } is { x: any; y: number; }. The type implied by a binding pattern is + // used as the contextual type of an initializer associated with the binding pattern. Also, for a destructuring + // parameter with no type annotation or initializer, the type implied by the binding pattern becomes the type of + // the parameter. function getTypeFromBindingPattern(pattern) { - return pattern.kind === 150 + return pattern.kind === 150 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern) : getTypeFromArrayBindingPattern(pattern); } + // Return the type associated with a variable, parameter, or property declaration. In the simple case this is the type + // specified in a type annotation or inferred from an initializer. However, in the case of a destructuring declaration it + // is a bit more involved. For example: + // + // var [x, s = ""] = [1, "one"]; + // + // Here, the array literal [1, "one"] is contextually typed by the type [any, string], which is the implied type of the + // binding pattern [x, s = ""]. Because the contextual type is a tuple type, the resulting type of [1, "one"] is the + // tuple type [number, string]. Thus, the type inferred for 'x' is number and the type inferred for 's' is string. function getWidenedTypeForVariableLikeDeclaration(declaration, reportErrors) { var type = getTypeForVariableLikeDeclaration(declaration); if (type) { if (reportErrors) { reportErrorsFromWidening(declaration, type); } - return declaration.kind !== 224 ? getWidenedType(type) : type; + // During a normal type check we'll never get to here with a property assignment (the check of the containing + // object literal uses a different path). We exclude widening only so that language services and type verification + // tools see the actual type. + return declaration.kind !== 224 /* PropertyAssignment */ ? getWidenedType(type) : type; } + // If no type was specified and nothing could be inferred, and if the declaration specifies a binding pattern, use + // the type implied by the binding pattern if (ts.isBindingPattern(declaration.name)) { return getTypeFromBindingPattern(declaration.name); } + // Rest parameters default to type any[], other parameters default to type any type = declaration.dotDotDotToken ? anyArrayType : anyType; + // Report implicit any errors unless this is a private property within an ambient declaration if (reportErrors && compilerOptions.noImplicitAny) { var root = getRootDeclaration(declaration); - if (!isPrivateWithinAmbient(root) && !(root.kind === 129 && isPrivateWithinAmbient(root.parent))) { + if (!isPrivateWithinAmbient(root) && !(root.kind === 129 /* Parameter */ && isPrivateWithinAmbient(root.parent))) { reportImplicitAnyError(declaration, type); } } @@ -10707,25 +12690,20 @@ var ts; function getTypeOfVariableOrParameterOrProperty(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - if (symbol.flags & 134217728) { + // Handle prototype property + if (symbol.flags & 134217728 /* Prototype */) { return links.type = getTypeOfPrototypeProperty(symbol); } + // Handle catch clause variables var declaration = symbol.valueDeclaration; - if (declaration.parent.kind === 223) { + if (declaration.parent.kind === 223 /* CatchClause */) { return links.type = anyType; } - 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; - } + // Handle export default expressions + if (declaration.kind === 214 /* ExportAssignment */) { + return links.type = checkExpression(declaration.expression); } + // Handle variable, parameter or property links.type = resolvingType; var type = getWidenedTypeForVariableLikeDeclaration(declaration, true); if (links.type === resolvingType) { @@ -10748,12 +12726,12 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 136) { - return accessor.type && getTypeFromTypeNodeOrHeritageClauseElement(accessor.type); + if (accessor.kind === 136 /* GetAccessor */) { + return accessor.type && getTypeFromTypeNode(accessor.type); } else { var setterTypeAnnotation = getSetAccessorTypeAnnotationNode(accessor); - return setterTypeAnnotation && getTypeFromTypeNodeOrHeritageClauseElement(setterTypeAnnotation); + return setterTypeAnnotation && getTypeFromTypeNode(setterTypeAnnotation); } } return undefined; @@ -10767,19 +12745,22 @@ var ts; links = links || getSymbolLinks(symbol); if (!links.type) { links.type = resolvingType; - var getter = ts.getDeclarationOfKind(symbol, 136); - var setter = ts.getDeclarationOfKind(symbol, 137); + var getter = ts.getDeclarationOfKind(symbol, 136 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 137 /* SetAccessor */); var type; + // First try to see if the user specified a return type on the get-accessor. var getterReturnType = getAnnotatedAccessorType(getter); if (getterReturnType) { type = getterReturnType; } else { + // If the user didn't specify a return type, try to use the set-accessor's parameter type. var setterParameterType = getAnnotatedAccessorType(setter); if (setterParameterType) { type = setterParameterType; } else { + // If there are no specified types, try to infer it from the body of the get accessor if it exists. if (getter && getter.body) { type = getReturnTypeFromBody(getter); } @@ -10798,7 +12779,7 @@ var ts; else if (links.type === resolvingType) { links.type = anyType; if (compilerOptions.noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 136); + var getter = ts.getDeclarationOfKind(symbol, 136 /* GetAccessor */); error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } @@ -10806,7 +12787,7 @@ var ts; function getTypeOfFuncClassEnumModule(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - links.type = createObjectType(32768, symbol); + links.type = createObjectType(32768 /* Anonymous */, symbol); } return links.type; } @@ -10832,40 +12813,43 @@ var ts; return links.type; } function getTypeOfSymbol(symbol) { - if (symbol.flags & 16777216) { + if (symbol.flags & 16777216 /* Instantiated */) { return getTypeOfInstantiatedSymbol(symbol); } - if (symbol.flags & (3 | 4)) { + if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) { return getTypeOfVariableOrParameterOrProperty(symbol); } - if (symbol.flags & (16 | 8192 | 32 | 384 | 512)) { + if (symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { return getTypeOfFuncClassEnumModule(symbol); } - if (symbol.flags & 8) { + if (symbol.flags & 8 /* EnumMember */) { return getTypeOfEnumMember(symbol); } - if (symbol.flags & 98304) { + if (symbol.flags & 98304 /* Accessor */) { return getTypeOfAccessors(symbol); } - if (symbol.flags & 8388608) { + if (symbol.flags & 8388608 /* Alias */) { return getTypeOfAlias(symbol); } return unknownType; } function getTargetType(type) { - return type.flags & 4096 ? type.target : type; + return type.flags & 4096 /* Reference */ ? type.target : type; } function hasBaseType(type, checkBase) { return check(type); function check(type) { var target = getTargetType(type); - return target === checkBase || ts.forEach(target.baseTypes, check); + return target === checkBase || ts.forEach(getBaseTypes(target), check); } } + // Return combined list of type parameters from all declarations of a class or interface. Elsewhere we check they're all + // the same, but even if they're not we still need the complete list to ensure instantiations supply type arguments + // for all type parameters. function getTypeParametersOfClassOrInterface(symbol) { var result; ts.forEach(symbol.declarations, function (node) { - if (node.kind === 202 || node.kind === 201) { + if (node.kind === 202 /* InterfaceDeclaration */ || node.kind === 201 /* ClassDeclaration */) { var declaration = node; if (declaration.typeParameters && declaration.typeParameters.length) { ts.forEach(declaration.typeParameters, function (node) { @@ -10882,85 +12866,106 @@ var ts; }); return result; } + function getBaseTypes(type) { + var typeWithBaseTypes = type; + if (!typeWithBaseTypes.baseTypes) { + if (type.symbol.flags & 32 /* Class */) { + resolveBaseTypesOfClass(typeWithBaseTypes); + } + else if (type.symbol.flags & 64 /* Interface */) { + resolveBaseTypesOfInterface(typeWithBaseTypes); + } + else { + ts.Debug.fail("type must be class or interface"); + } + } + return typeWithBaseTypes.baseTypes; + } + function resolveBaseTypesOfClass(type) { + type.baseTypes = []; + var declaration = ts.getDeclarationOfKind(type.symbol, 201 /* ClassDeclaration */); + var baseTypeNode = ts.getClassExtendsHeritageClauseElement(declaration); + if (baseTypeNode) { + var baseType = getTypeFromHeritageClauseElement(baseTypeNode); + if (baseType !== unknownType) { + if (getTargetType(baseType).flags & 1024 /* Class */) { + if (type !== baseType && !hasBaseType(baseType, type)) { + type.baseTypes.push(baseType); + } + else { + error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1 /* WriteArrayAsGenericType */)); + } + } + else { + error(baseTypeNode, ts.Diagnostics.A_class_may_only_extend_another_class); + } + } + } + } + function resolveBaseTypesOfInterface(type) { + type.baseTypes = []; + for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + if (declaration.kind === 202 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { + var node = _c[_b]; + var baseType = getTypeFromHeritageClauseElement(node); + if (baseType !== unknownType) { + if (getTargetType(baseType).flags & (1024 /* Class */ | 2048 /* Interface */)) { + if (type !== baseType && !hasBaseType(baseType, type)) { + type.baseTypes.push(baseType); + } + else { + error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1 /* WriteArrayAsGenericType */)); + } + } + else { + error(node, ts.Diagnostics.An_interface_may_only_extend_a_class_or_another_interface); + } + } + } + } + } + } function getDeclaredTypeOfClass(symbol) { var links = getSymbolLinks(symbol); if (!links.declaredType) { - var type = links.declaredType = createObjectType(1024, symbol); + var type = links.declaredType = createObjectType(1024 /* Class */, symbol); var typeParameters = getTypeParametersOfClassOrInterface(symbol); if (typeParameters) { - type.flags |= 4096; + type.flags |= 4096 /* Reference */; type.typeParameters = typeParameters; type.instantiations = {}; type.instantiations[getTypeListId(type.typeParameters)] = type; type.target = type; type.typeArguments = type.typeParameters; } - type.baseTypes = []; - var declaration = ts.getDeclarationOfKind(symbol, 201); - var baseTypeNode = ts.getClassExtendsHeritageClauseElement(declaration); - if (baseTypeNode) { - var baseType = getTypeFromHeritageClauseElement(baseTypeNode); - if (baseType !== unknownType) { - if (getTargetType(baseType).flags & 1024) { - if (type !== baseType && !hasBaseType(baseType, type)) { - type.baseTypes.push(baseType); - } - else { - error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1)); - } - } - else { - error(baseTypeNode, ts.Diagnostics.A_class_may_only_extend_another_class); - } - } - } type.declaredProperties = getNamedMembers(symbol.members); type.declaredCallSignatures = emptyArray; type.declaredConstructSignatures = emptyArray; - type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0); - type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1); + type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); + type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); } return links.declaredType; } function getDeclaredTypeOfInterface(symbol) { var links = getSymbolLinks(symbol); if (!links.declaredType) { - var type = links.declaredType = createObjectType(2048, symbol); + var type = links.declaredType = createObjectType(2048 /* Interface */, symbol); var typeParameters = getTypeParametersOfClassOrInterface(symbol); if (typeParameters) { - type.flags |= 4096; + type.flags |= 4096 /* Reference */; type.typeParameters = typeParameters; type.instantiations = {}; type.instantiations[getTypeListId(type.typeParameters)] = type; type.target = type; type.typeArguments = type.typeParameters; } - type.baseTypes = []; - ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 202 && ts.getInterfaceBaseTypeNodes(declaration)) { - ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), function (node) { - var baseType = getTypeFromHeritageClauseElement(node); - if (baseType !== unknownType) { - if (getTargetType(baseType).flags & (1024 | 2048)) { - if (type !== baseType && !hasBaseType(baseType, type)) { - type.baseTypes.push(baseType); - } - else { - error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1)); - } - } - else { - error(node, ts.Diagnostics.An_interface_may_only_extend_a_class_or_another_interface); - } - } - }); - } - }); type.declaredProperties = getNamedMembers(symbol.members); type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]); type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]); - type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0); - type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1); + type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); + type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); } return links.declaredType; } @@ -10968,15 +12973,15 @@ var ts; var links = getSymbolLinks(symbol); if (!links.declaredType) { links.declaredType = resolvingType; - var declaration = ts.getDeclarationOfKind(symbol, 203); - var type = getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); + var declaration = ts.getDeclarationOfKind(symbol, 203 /* TypeAliasDeclaration */); + var type = getTypeFromTypeNode(declaration.type); if (links.declaredType === resolvingType) { links.declaredType = type; } } else if (links.declaredType === resolvingType) { links.declaredType = unknownType; - var declaration = ts.getDeclarationOfKind(symbol, 203); + var declaration = ts.getDeclarationOfKind(symbol, 203 /* TypeAliasDeclaration */); error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); } return links.declaredType; @@ -10984,7 +12989,7 @@ var ts; function getDeclaredTypeOfEnum(symbol) { var links = getSymbolLinks(symbol); if (!links.declaredType) { - var type = createType(128); + var type = createType(128 /* Enum */); type.symbol = symbol; links.declaredType = type; } @@ -10993,9 +12998,9 @@ var ts; function getDeclaredTypeOfTypeParameter(symbol) { var links = getSymbolLinks(symbol); if (!links.declaredType) { - var type = createType(512); + var type = createType(512 /* TypeParameter */); type.symbol = symbol; - if (!ts.getDeclarationOfKind(symbol, 128).constraint) { + if (!ts.getDeclarationOfKind(symbol, 128 /* TypeParameter */).constraint) { type.constraint = noConstraintType; } links.declaredType = type; @@ -11010,23 +13015,23 @@ var ts; return links.declaredType; } function getDeclaredTypeOfSymbol(symbol) { - ts.Debug.assert((symbol.flags & 16777216) === 0); - if (symbol.flags & 32) { + ts.Debug.assert((symbol.flags & 16777216 /* Instantiated */) === 0); + if (symbol.flags & 32 /* Class */) { return getDeclaredTypeOfClass(symbol); } - if (symbol.flags & 64) { + if (symbol.flags & 64 /* Interface */) { return getDeclaredTypeOfInterface(symbol); } - if (symbol.flags & 524288) { + if (symbol.flags & 524288 /* TypeAlias */) { return getDeclaredTypeOfTypeAlias(symbol); } - if (symbol.flags & 384) { + if (symbol.flags & 384 /* Enum */) { return getDeclaredTypeOfEnum(symbol); } - if (symbol.flags & 262144) { + if (symbol.flags & 262144 /* TypeParameter */) { return getDeclaredTypeOfTypeParameter(symbol); } - if (symbol.flags & 8388608) { + if (symbol.flags & 8388608 /* Alias */) { return getDeclaredTypeOfAlias(symbol); } return unknownType; @@ -11069,15 +13074,17 @@ var ts; var constructSignatures = type.declaredConstructSignatures; var stringIndexType = type.declaredStringIndexType; var numberIndexType = type.declaredNumberIndexType; - if (type.baseTypes.length) { + var baseTypes = getBaseTypes(type); + if (baseTypes.length) { members = createSymbolTable(type.declaredProperties); - ts.forEach(type.baseTypes, function (baseType) { + for (var _i = 0; _i < baseTypes.length; _i++) { + var baseType = baseTypes[_i]; addInheritedMembers(members, getPropertiesOfObjectType(baseType)); - callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(baseType, 0)); - constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(baseType, 1)); - stringIndexType = stringIndexType || getIndexTypeOfType(baseType, 0); - numberIndexType = numberIndexType || getIndexTypeOfType(baseType, 1); - }); + callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(baseType, 0 /* Call */)); + constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(baseType, 1 /* Construct */)); + stringIndexType = stringIndexType || getIndexTypeOfType(baseType, 0 /* String */); + numberIndexType = numberIndexType || getIndexTypeOfType(baseType, 1 /* Number */); + } } setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } @@ -11089,13 +13096,13 @@ var ts; var constructSignatures = instantiateList(target.declaredConstructSignatures, mapper, instantiateSignature); var stringIndexType = target.declaredStringIndexType ? instantiateType(target.declaredStringIndexType, mapper) : undefined; var numberIndexType = target.declaredNumberIndexType ? instantiateType(target.declaredNumberIndexType, mapper) : undefined; - ts.forEach(target.baseTypes, function (baseType) { + ts.forEach(getBaseTypes(target), function (baseType) { var instantiatedBaseType = instantiateType(baseType, mapper); addInheritedMembers(members, getPropertiesOfObjectType(instantiatedBaseType)); - callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, 0)); - constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, 1)); - stringIndexType = stringIndexType || getIndexTypeOfType(instantiatedBaseType, 0); - numberIndexType = numberIndexType || getIndexTypeOfType(instantiatedBaseType, 1); + callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, 0 /* Call */)); + constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, 1 /* Construct */)); + stringIndexType = stringIndexType || getIndexTypeOfType(instantiatedBaseType, 0 /* String */); + numberIndexType = numberIndexType || getIndexTypeOfType(instantiatedBaseType, 1 /* Number */); }); setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } @@ -11114,11 +13121,12 @@ var ts; return createSignature(sig.declaration, sig.typeParameters, sig.parameters, sig.resolvedReturnType, sig.minArgumentCount, sig.hasRestParameter, sig.hasStringLiterals); } function getDefaultConstructSignatures(classType) { - if (classType.baseTypes.length) { - var baseType = classType.baseTypes[0]; - var baseSignatures = getSignaturesOfType(getTypeOfSymbol(baseType.symbol), 1); + var baseTypes = getBaseTypes(classType); + if (baseTypes.length) { + var baseType = baseTypes[0]; + var baseSignatures = getSignaturesOfType(getTypeOfSymbol(baseType.symbol), 1 /* Construct */); return ts.map(baseSignatures, function (baseSignature) { - var signature = baseType.flags & 4096 ? + var signature = baseType.flags & 4096 /* Reference */ ? getSignatureInstantiation(baseSignature, baseType.typeArguments) : cloneSignature(baseSignature); signature.typeParameters = classType.typeParameters; signature.resolvedReturnType = classType; @@ -11130,7 +13138,7 @@ var ts; function createTupleTypeMemberSymbols(memberTypes) { var members = {}; for (var i = 0; i < memberTypes.length; i++) { - var symbol = createSymbol(4 | 67108864, "" + i); + var symbol = createSymbol(4 /* Property */ | 67108864 /* Transient */, "" + i); symbol.type = memberTypes[i]; members[i] = symbol; } @@ -11153,6 +13161,9 @@ var ts; } return true; } + // If the lists of call or construct signatures in the given types are all identical except for return types, + // and if none of the signatures are generic, return a list of signatures that has substitutes a union of the + // return types of the corresponding signatures in each resulting signature. function getUnionSignatures(types, kind) { var signatureLists = ts.map(types, function (t) { return getSignaturesOfType(t, kind); }); var signatures = signatureLists[0]; @@ -11170,6 +13181,7 @@ var ts; var result = ts.map(signatures, cloneSignature); for (var i = 0; i < result.length; i++) { var s = result[i]; + // Clear resolved return type we possibly got from cloneSignature s.resolvedReturnType = undefined; s.unionSignatures = ts.map(signatureLists, function (signatures) { return signatures[i]; }); } @@ -11188,10 +13200,12 @@ var ts; return getUnionType(indexTypes); } function resolveUnionTypeMembers(type) { - var callSignatures = getUnionSignatures(type.types, 0); - var constructSignatures = getUnionSignatures(type.types, 1); - var stringIndexType = getUnionIndexType(type.types, 0); - var numberIndexType = getUnionIndexType(type.types, 1); + // The members and properties collections are empty for union types. To get all properties of a union + // type use getPropertiesOfType (only the language service uses this). + var callSignatures = getUnionSignatures(type.types, 0 /* Call */); + var constructSignatures = getUnionSignatures(type.types, 1 /* Construct */); + var stringIndexType = getUnionIndexType(type.types, 0 /* String */); + var numberIndexType = getUnionIndexType(type.types, 1 /* Number */); setObjectTypeMembers(type, emptySymbols, callSignatures, constructSignatures, stringIndexType, numberIndexType); } function resolveAnonymousTypeMembers(type) { @@ -11201,51 +13215,53 @@ var ts; var constructSignatures; var stringIndexType; var numberIndexType; - if (symbol.flags & 2048) { + if (symbol.flags & 2048 /* TypeLiteral */) { members = symbol.members; callSignatures = getSignaturesOfSymbol(members["__call"]); constructSignatures = getSignaturesOfSymbol(members["__new"]); - stringIndexType = getIndexTypeOfSymbol(symbol, 0); - numberIndexType = getIndexTypeOfSymbol(symbol, 1); + stringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); + numberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); } else { + // Combinations of function, class, enum and module members = emptySymbols; callSignatures = emptyArray; constructSignatures = emptyArray; - if (symbol.flags & 1952) { + if (symbol.flags & 1952 /* HasExports */) { members = getExportsOfSymbol(symbol); } - if (symbol.flags & (16 | 8192)) { + if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) { callSignatures = getSignaturesOfSymbol(symbol); } - if (symbol.flags & 32) { + if (symbol.flags & 32 /* Class */) { var classType = getDeclaredTypeOfClass(symbol); constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); if (!constructSignatures.length) { constructSignatures = getDefaultConstructSignatures(classType); } - if (classType.baseTypes.length) { + var baseTypes = getBaseTypes(classType); + if (baseTypes.length) { members = createSymbolTable(getNamedMembers(members)); - addInheritedMembers(members, getPropertiesOfObjectType(getTypeOfSymbol(classType.baseTypes[0].symbol))); + addInheritedMembers(members, getPropertiesOfObjectType(getTypeOfSymbol(baseTypes[0].symbol))); } } stringIndexType = undefined; - numberIndexType = (symbol.flags & 384) ? stringType : undefined; + numberIndexType = (symbol.flags & 384 /* Enum */) ? stringType : undefined; } setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } function resolveObjectOrUnionTypeMembers(type) { if (!type.members) { - if (type.flags & (1024 | 2048)) { + if (type.flags & (1024 /* Class */ | 2048 /* Interface */)) { resolveClassOrInterfaceMembers(type); } - else if (type.flags & 32768) { + else if (type.flags & 32768 /* Anonymous */) { resolveAnonymousTypeMembers(type); } - else if (type.flags & 8192) { + else if (type.flags & 8192 /* Tuple */) { resolveTupleTypeMembers(type); } - else if (type.flags & 16384) { + else if (type.flags & 16384 /* Union */) { resolveUnionTypeMembers(type); } else { @@ -11254,14 +13270,17 @@ var ts; } return type; } + // Return properties of an object type or an empty array for other types function getPropertiesOfObjectType(type) { - if (type.flags & 48128) { + if (type.flags & 48128 /* ObjectType */) { return resolveObjectOrUnionTypeMembers(type).properties; } return emptyArray; } + // If the given type is an object type and that type has a property by the given name, return + // the symbol for that property. Otherwise return undefined. function getPropertyOfObjectType(type, name) { - if (type.flags & 48128) { + if (type.flags & 48128 /* ObjectType */) { var resolved = resolveObjectOrUnionTypeMembers(type); if (ts.hasProperty(resolved.members, name)) { var symbol = resolved.members[name]; @@ -11282,30 +13301,34 @@ var ts; return result; } function getPropertiesOfType(type) { - if (type.flags & 16384) { - return getPropertiesOfUnionType(type); - } - return getPropertiesOfObjectType(getApparentType(type)); + type = getApparentType(type); + return type.flags & 16384 /* Union */ ? getPropertiesOfUnionType(type) : getPropertiesOfObjectType(type); } + // For a type parameter, return the base constraint of the type parameter. For the string, number, + // boolean, and symbol primitive types, return the corresponding object types. Otherwise return the + // type itself. Note that the apparent type of a union type is the union type itself. function getApparentType(type) { - if (type.flags & 512) { + if (type.flags & 16384 /* Union */) { + type = getReducedTypeOfUnionType(type); + } + if (type.flags & 512 /* TypeParameter */) { do { type = getConstraintOfTypeParameter(type); - } while (type && type.flags & 512); + } while (type && type.flags & 512 /* TypeParameter */); if (!type) { type = emptyObjectType; } } - if (type.flags & 258) { + if (type.flags & 258 /* StringLike */) { type = globalStringType; } - else if (type.flags & 132) { + else if (type.flags & 132 /* NumberLike */) { type = globalNumberType; } - else if (type.flags & 8) { + else if (type.flags & 8 /* Boolean */) { type = globalBooleanType; } - else if (type.flags & 1048576) { + else if (type.flags & 1048576 /* ESSymbol */) { type = globalESSymbolType; } return type; @@ -11338,7 +13361,7 @@ var ts; } propTypes.push(getTypeOfSymbol(prop)); } - var result = createSymbol(4 | 67108864 | 268435456, name); + var result = createSymbol(4 /* Property */ | 67108864 /* Transient */ | 268435456 /* UnionProperty */, name); result.unionType = unionType; result.declarations = declarations; result.type = getUnionType(propTypes); @@ -11355,49 +13378,66 @@ var ts; } return property; } + // Return the symbol for the property with the given name in the given type. Creates synthetic union properties when + // necessary, maps primitive types and type parameters are to their apparent types, and augments with properties from + // Object and Function as appropriate. function getPropertyOfType(type, name) { - if (type.flags & 16384) { + type = getApparentType(type); + if (type.flags & 48128 /* ObjectType */) { + var resolved = resolveObjectOrUnionTypeMembers(type); + if (ts.hasProperty(resolved.members, name)) { + var symbol = resolved.members[name]; + if (symbolIsValue(symbol)) { + return symbol; + } + } + if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { + var symbol = getPropertyOfObjectType(globalFunctionType, name); + if (symbol) { + return symbol; + } + } + return getPropertyOfObjectType(globalObjectType, name); + } + if (type.flags & 16384 /* Union */) { return getPropertyOfUnionType(type, name); } - if (!(type.flags & 48128)) { - type = getApparentType(type); - if (!(type.flags & 48128)) { - return undefined; - } - } - var resolved = resolveObjectOrUnionTypeMembers(type); - if (ts.hasProperty(resolved.members, name)) { - var symbol = resolved.members[name]; - if (symbolIsValue(symbol)) { - return symbol; - } - } - if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { - var symbol = getPropertyOfObjectType(globalFunctionType, name); - if (symbol) - return symbol; - } - return getPropertyOfObjectType(globalObjectType, name); + return undefined; } function getSignaturesOfObjectOrUnionType(type, kind) { - if (type.flags & (48128 | 16384)) { + if (type.flags & (48128 /* ObjectType */ | 16384 /* Union */)) { var resolved = resolveObjectOrUnionTypeMembers(type); - return kind === 0 ? resolved.callSignatures : resolved.constructSignatures; + return kind === 0 /* Call */ ? resolved.callSignatures : resolved.constructSignatures; } return emptyArray; } + // Return the signatures of the given kind in the given type. Creates synthetic union signatures when necessary and + // maps primitive types and type parameters are to their apparent types. function getSignaturesOfType(type, kind) { return getSignaturesOfObjectOrUnionType(getApparentType(type), kind); } - function getIndexTypeOfObjectOrUnionType(type, kind) { - if (type.flags & (48128 | 16384)) { + function typeHasCallOrConstructSignatures(type) { + var apparentType = getApparentType(type); + if (apparentType.flags & (48128 /* ObjectType */ | 16384 /* Union */)) { var resolved = resolveObjectOrUnionTypeMembers(type); - return kind === 0 ? resolved.stringIndexType : resolved.numberIndexType; + return resolved.callSignatures.length > 0 + || resolved.constructSignatures.length > 0; + } + return false; + } + function getIndexTypeOfObjectOrUnionType(type, kind) { + if (type.flags & (48128 /* ObjectType */ | 16384 /* Union */)) { + var resolved = resolveObjectOrUnionTypeMembers(type); + return kind === 0 /* String */ ? resolved.stringIndexType : resolved.numberIndexType; } } + // Return the index type of the given kind in the given type. Creates synthetic union index types when necessary and + // maps primitive types and type parameters are to their apparent types. function getIndexTypeOfType(type, kind) { return getIndexTypeOfObjectOrUnionType(getApparentType(type), kind); } + // Return list of type parameters with duplicates removed (duplicate identifier errors are generated in the actual + // type checking functions). function getTypeParametersFromDeclaration(typeParameterDeclarations) { var result = []; ts.forEach(typeParameterDeclarations, function (node) { @@ -11417,20 +13457,10 @@ var ts; } return result; } - function getExportsOfExternalModule(node) { - if (!node.moduleSpecifier) { - return emptyArray; - } - var module = resolveExternalModuleName(node, node.moduleSpecifier); - if (!module) { - return emptyArray; - } - return symbolsToArray(getExportsOfModule(module)); - } function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { - var classType = declaration.kind === 135 ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; + var classType = declaration.kind === 135 /* Constructor */ ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; var typeParameters = classType ? classType.typeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; var parameters = []; @@ -11439,7 +13469,7 @@ var ts; for (var i = 0, n = declaration.parameters.length; i < n; i++) { var param = declaration.parameters[i]; parameters.push(param.symbol); - if (param.type && param.type.kind === 8) { + if (param.type && param.type.kind === 8 /* StringLiteral */) { hasStringLiterals = true; } if (minArgumentCount < 0) { @@ -11456,11 +13486,13 @@ var ts; returnType = classType; } else if (declaration.type) { - returnType = getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); + returnType = getTypeFromTypeNode(declaration.type); } else { - if (declaration.kind === 136 && !ts.hasDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(declaration.symbol, 137); + // TypeScript 1.0 spec (April 2014): + // If only one accessor includes a type annotation, the other behaves as if it had the same type annotation. + if (declaration.kind === 136 /* GetAccessor */ && !ts.hasDynamicName(declaration)) { + var setter = ts.getDeclarationOfKind(declaration.symbol, 137 /* SetAccessor */); returnType = getAnnotatedAccessorType(setter); } if (!returnType && ts.nodeIsMissing(declaration.body)) { @@ -11478,19 +13510,22 @@ var ts; for (var i = 0, len = symbol.declarations.length; i < len; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 142: - case 143: - case 200: - case 134: - case 133: - case 135: - case 138: - case 139: - case 140: - case 136: - case 137: - case 162: - case 163: + case 142 /* FunctionType */: + case 143 /* ConstructorType */: + case 200 /* FunctionDeclaration */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 135 /* Constructor */: + case 138 /* CallSignature */: + case 139 /* ConstructSignature */: + case 140 /* IndexSignature */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: + // Don't include signature if node is the implementation of an overloaded function. A node is considered + // an implementation node if it has a body and the previous node is of the same kind and immediately + // precedes the implementation node (i.e. has the same parent and ends where the implementation starts). if (i > 0 && node.body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { @@ -11536,7 +13571,7 @@ var ts; function getRestTypeOfSignature(signature) { if (signature.hasRestParameter) { var type = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); - if (type.flags & 4096 && type.target === globalArrayType) { + if (type.flags & 4096 /* Reference */ && type.target === globalArrayType) { return type.typeArguments[0]; } } @@ -11559,9 +13594,13 @@ var ts; return signature.erasedSignatureCache; } function getOrCreateTypeFromSignature(signature) { + // There are two ways to declare a construct signature, one is by declaring a class constructor + // using the constructor keyword, and the other is declaring a bare construct signature in an + // object type literal or interface (using the new keyword). Each way of declaring a constructor + // will result in a different declaration kind. if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 135 || signature.declaration.kind === 139; - var type = createObjectType(32768 | 65536); + var isConstructor = signature.declaration.kind === 135 /* Constructor */ || signature.declaration.kind === 139 /* ConstructSignature */; + var type = createObjectType(32768 /* Anonymous */ | 65536 /* FromSignature */); type.members = emptySymbols; type.properties = emptyArray; type.callSignatures = !isConstructor ? [signature] : emptyArray; @@ -11574,7 +13613,7 @@ var ts; return symbol.members["__index"]; } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 ? 119 : 121; + var syntaxKind = kind === 1 /* Number */ ? 119 /* NumberKeyword */ : 121 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { var len = indexSymbol.declarations.length; @@ -11594,7 +13633,7 @@ var ts; function getIndexTypeOfSymbol(symbol, kind) { var declaration = getIndexDeclarationOfSymbol(symbol, kind); return declaration - ? declaration.type ? getTypeFromTypeNodeOrHeritageClauseElement(declaration.type) : anyType + ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType : undefined; } function getConstraintOfTypeParameter(type) { @@ -11604,7 +13643,7 @@ var ts; type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNodeOrHeritageClauseElement(ts.getDeclarationOfKind(type.symbol, 128).constraint); + type.constraint = getTypeFromTypeNode(ts.getDeclarationOfKind(type.symbol, 128 /* TypeParameter */).constraint); } } return type.constraint === noConstraintType ? undefined : type.constraint; @@ -11626,19 +13665,22 @@ var ts; return result; } } + // This function is used to propagate widening flags when creating new object types references and union types. + // It is only necessary to do so if a constituent type might be the undefined type, the null type, or the type + // of an object literal (since those types have widening related information we need to track). function getWideningFlagsOfTypes(types) { var result = 0; for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; result |= type.flags; } - return result & 786432; + return result & 786432 /* RequiresWidening */; } function createTypeReference(target, typeArguments) { var id = getTypeListId(typeArguments); var type = target.instantiations[id]; if (!type) { - var flags = 4096 | getWideningFlagsOfTypes(typeArguments); + var flags = 4096 /* Reference */ | getWideningFlagsOfTypes(typeArguments); type = target.instantiations[id] = createObjectType(flags, target.symbol); type.target = target; type.typeArguments = typeArguments; @@ -11650,21 +13692,31 @@ var ts; if (links.isIllegalTypeReferenceInConstraint !== undefined) { return links.isIllegalTypeReferenceInConstraint; } + // bubble up to the declaration var currentNode = typeReferenceNode; + // forEach === exists while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { currentNode = currentNode.parent; } - links.isIllegalTypeReferenceInConstraint = currentNode.kind === 128; + // if last step was made from the type parameter this means that path has started somewhere in constraint which is illegal + links.isIllegalTypeReferenceInConstraint = currentNode.kind === 128 /* TypeParameter */; return links.isIllegalTypeReferenceInConstraint; } function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) { var typeParameterSymbol; function check(n) { - if (n.kind === 141 && n.typeName.kind === 65) { + if (n.kind === 141 /* TypeReference */ && n.typeName.kind === 65 /* Identifier */) { var links = getNodeLinks(n); if (links.isIllegalTypeReferenceInConstraint === undefined) { - var symbol = resolveName(typeParameter, n.typeName.text, 793056, undefined, undefined); - if (symbol && (symbol.flags & 262144)) { + var symbol = resolveName(typeParameter, n.typeName.text, 793056 /* Type */, undefined, undefined); + if (symbol && (symbol.flags & 262144 /* TypeParameter */)) { + // 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 + // symbol.declaration.parent === typeParameter.parent + // -> typeParameter and symbol.declaration originate from the same type parameter list + // -> illegal for all declarations in symbol + // forEach === exists links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { return d.parent == typeParameter.parent; }); } } @@ -11689,24 +13741,30 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedType) { var type; - if (node.kind !== 177 || ts.isSupportedHeritageClauseElement(node)) { - var typeNameOrExpression = node.kind === 141 + // We don't currently support heritage clauses with complex expressions in them. + // For these cases, we just set the type to be the unknownType. + if (node.kind !== 177 /* HeritageClauseElement */ || ts.isSupportedHeritageClauseElement(node)) { + var typeNameOrExpression = node.kind === 141 /* TypeReference */ ? node.typeName : node.expression; - var symbol = resolveEntityName(typeNameOrExpression, 793056); + var symbol = resolveEntityName(typeNameOrExpression, 793056 /* Type */); if (symbol) { - if ((symbol.flags & 262144) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { + if ((symbol.flags & 262144 /* 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 & (1024 | 2048) && type.flags & 4096) { + if (type.flags & (1024 /* Class */ | 2048 /* Interface */) && type.flags & 4096 /* Reference */) { var typeParameters = type.typeParameters; if (node.typeArguments && node.typeArguments.length === typeParameters.length) { - type = createTypeReference(type, ts.map(node.typeArguments, getTypeFromTypeNodeOrHeritageClauseElement)); + 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); + error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, undefined, 1 /* WriteArrayAsGenericType */), typeParameters.length); type = undefined; } } @@ -11726,6 +13784,10 @@ var ts; function getTypeFromTypeQueryNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { + // TypeScript 1.0 spec (April 2014): 3.6.3 + // The expression is processed as an identifier expression (section 4.3) + // or property access expression(section 4.10), + // the widened type(section 3.9) of which becomes the result. links.resolvedType = getWidenedType(checkExpressionOrQualifiedName(node.exprName)); } return links.resolvedType; @@ -11736,9 +13798,9 @@ var ts; for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; switch (declaration.kind) { - case 201: - case 202: - case 204: + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + case 204 /* EnumDeclaration */: return declaration; } } @@ -11747,7 +13809,7 @@ var ts; return emptyObjectType; } var type = getDeclaredTypeOfSymbol(symbol); - if (!(type.flags & 48128)) { + if (!(type.flags & 48128 /* ObjectType */)) { error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_be_a_class_or_interface_type, symbol.name); return emptyObjectType; } @@ -11758,10 +13820,10 @@ var ts; return type; } function getGlobalValueSymbol(name) { - return getGlobalSymbol(name, 107455, ts.Diagnostics.Cannot_find_global_value_0); + return getGlobalSymbol(name, 107455 /* Value */, ts.Diagnostics.Cannot_find_global_value_0); } function getGlobalTypeSymbol(name) { - return getGlobalSymbol(name, 793056, ts.Diagnostics.Cannot_find_global_type_0); + return getGlobalSymbol(name, 793056 /* Type */, ts.Diagnostics.Cannot_find_global_type_0); } function getGlobalSymbol(name, meaning, diagnostic) { return resolveName(undefined, name, meaning, diagnostic, name); @@ -11773,14 +13835,20 @@ var ts; function getGlobalESSymbolConstructorSymbol() { return globalESSymbolConstructorSymbol || (globalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol")); } + function createIterableType(elementType) { + return globalIterableType !== emptyObjectType ? createTypeReference(globalIterableType, [elementType]) : emptyObjectType; + } function createArrayType(elementType) { + // globalArrayType will be undefined if we get here during creation of the Array type. This for example happens if + // user code augments the Array type with call or construct signatures that have an array type as the return type. + // We instead use globalArraySymbol to obtain the (not yet fully constructed) Array type. var arrayType = globalArrayType || getDeclaredTypeOfSymbol(globalArraySymbol); return arrayType !== emptyObjectType ? createTypeReference(arrayType, [elementType]) : emptyObjectType; } function getTypeFromArrayTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createArrayType(getTypeFromTypeNodeOrHeritageClauseElement(node.elementType)); + links.resolvedType = createArrayType(getTypeFromTypeNode(node.elementType)); } return links.resolvedType; } @@ -11788,7 +13856,7 @@ var ts; var id = getTypeListId(elementTypes); var type = tupleTypes[id]; if (!type) { - type = tupleTypes[id] = createObjectType(8192); + type = tupleTypes[id] = createObjectType(8192 /* Tuple */); type.elementTypes = elementTypes; } return type; @@ -11796,12 +13864,12 @@ var ts; function getTypeFromTupleTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createTupleType(ts.map(node.elementTypes, getTypeFromTypeNodeOrHeritageClauseElement)); + links.resolvedType = createTupleType(ts.map(node.elementTypes, getTypeFromTypeNode)); } return links.resolvedType; } function addTypeToSortedSet(sortedSet, type) { - if (type.flags & 16384) { + if (type.flags & 16384 /* Union */) { addTypesToSortedSet(sortedSet, type.types); } else { @@ -11842,7 +13910,7 @@ var ts; function containsAnyType(types) { for (var _i = 0; _i < types.length; _i++) { var type = types[_i]; - if (type.flags & 1) { + if (type.flags & 1 /* Any */) { return true; } } @@ -11857,6 +13925,10 @@ var ts; } } } + // The noSubtypeReduction flag is there because it isn't possible to always do subtype reduction. The flag + // is true when creating a union type from a type node and when instantiating a union type. In both of those + // cases subtype reduction has to be deferred to properly support recursive union types. For example, a + // type alias of the form "type Item = string | (() => Item)" cannot be reduced during its declaration. function getUnionType(types, noSubtypeReduction) { if (types.length === 0) { return emptyObjectType; @@ -11879,22 +13951,31 @@ var ts; var id = getTypeListId(sortedTypes); var type = unionTypes[id]; if (!type) { - type = unionTypes[id] = createObjectType(16384 | getWideningFlagsOfTypes(sortedTypes)); + type = unionTypes[id] = createObjectType(16384 /* Union */ | getWideningFlagsOfTypes(sortedTypes)); type.types = sortedTypes; + type.reducedType = noSubtypeReduction ? undefined : type; } return type; } + function getReducedTypeOfUnionType(type) { + // If union type was created without subtype reduction, perform the deferred reduction now + if (!type.reducedType) { + type.reducedType = getUnionType(type.types, false); + } + return type.reducedType; + } function getTypeFromUnionTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNodeOrHeritageClauseElement), true); + links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNode), true); } return links.resolvedType; } function getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createObjectType(32768, node.symbol); + // Deferred resolution of members is handled by resolveObjectTypeMembers + links.resolvedType = createObjectType(32768 /* Anonymous */, node.symbol); } return links.resolvedType; } @@ -11902,7 +13983,7 @@ var ts; if (ts.hasProperty(stringLiteralTypes, node.text)) { return stringLiteralTypes[node.text]; } - var type = stringLiteralTypes[node.text] = createType(256); + var type = stringLiteralTypes[node.text] = createType(256 /* StringLiteral */); type.text = ts.getTextOfNode(node); return type; } @@ -11913,42 +13994,44 @@ var ts; } return links.resolvedType; } - function getTypeFromTypeNodeOrHeritageClauseElement(node) { + function getTypeFromTypeNode(node) { switch (node.kind) { - case 112: + case 112 /* AnyKeyword */: return anyType; - case 121: + case 121 /* StringKeyword */: return stringType; - case 119: + case 119 /* NumberKeyword */: return numberType; - case 113: + case 113 /* BooleanKeyword */: return booleanType; - case 122: + case 122 /* SymbolKeyword */: return esSymbolType; - case 99: + case 99 /* VoidKeyword */: return voidType; - case 8: + case 8 /* StringLiteral */: return getTypeFromStringLiteral(node); - case 141: + case 141 /* TypeReference */: return getTypeFromTypeReference(node); - case 177: + case 177 /* HeritageClauseElement */: return getTypeFromHeritageClauseElement(node); - case 144: + case 144 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 146: + case 146 /* ArrayType */: return getTypeFromArrayTypeNode(node); - case 147: + case 147 /* TupleType */: return getTypeFromTupleTypeNode(node); - case 148: + case 148 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 149: - return getTypeFromTypeNodeOrHeritageClauseElement(node.type); - case 142: - case 143: - case 145: + case 149 /* ParenthesizedType */: + return getTypeFromTypeNode(node.type); + case 142 /* FunctionType */: + case 143 /* ConstructorType */: + case 145 /* TypeLiteral */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 65: - case 126: + // This function assumes that an identifier or qualified name is a type expression + // Callers should first ensure this by calling isTypeNode + case 65 /* Identifier */: + case 126 /* QualifiedName */: var symbol = getSymbolInfo(node); return symbol && getDeclaredTypeOfSymbol(symbol); default: @@ -12025,7 +14108,7 @@ var ts; return function (t) { return mapper2(mapper1(t)); }; } function instantiateTypeParameter(typeParameter, mapper) { - var result = createType(512); + var result = createType(512 /* TypeParameter */); result.symbol = typeParameter.symbol; if (typeParameter.constraint) { result.constraint = instantiateType(typeParameter.constraint, mapper); @@ -12048,12 +14131,17 @@ var ts; return result; } function instantiateSymbol(symbol, mapper) { - if (symbol.flags & 16777216) { + if (symbol.flags & 16777216 /* Instantiated */) { var links = getSymbolLinks(symbol); + // If symbol being instantiated is itself a instantiation, fetch the original target and combine the + // type mappers. This ensures that original type identities are properly preserved and that aliases + // always reference a non-aliases. symbol = links.target; mapper = combineTypeMappers(links.mapper, mapper); } - var result = createSymbol(16777216 | 67108864 | symbol.flags, symbol.name); + // Keep the flags from the symbol we're instantiating. Mark that is instantiated, and + // also transient so that we can just store data on it directly. + var result = createSymbol(16777216 /* Instantiated */ | 67108864 /* Transient */ | symbol.flags, symbol.name); result.declarations = symbol.declarations; result.parent = symbol.parent; result.target = symbol; @@ -12064,13 +14152,13 @@ var ts; return result; } function instantiateAnonymousType(type, mapper) { - var result = createObjectType(32768, type.symbol); + var result = createObjectType(32768 /* Anonymous */, type.symbol); result.properties = instantiateList(getPropertiesOfObjectType(type), mapper, instantiateSymbol); result.members = createSymbolTable(result.properties); - result.callSignatures = instantiateList(getSignaturesOfType(type, 0), mapper, instantiateSignature); - result.constructSignatures = instantiateList(getSignaturesOfType(type, 1), mapper, instantiateSignature); - var stringIndexType = getIndexTypeOfType(type, 0); - var numberIndexType = getIndexTypeOfType(type, 1); + result.callSignatures = instantiateList(getSignaturesOfType(type, 0 /* Call */), mapper, instantiateSignature); + result.constructSignatures = instantiateList(getSignaturesOfType(type, 1 /* Construct */), mapper, instantiateSignature); + var stringIndexType = getIndexTypeOfType(type, 0 /* String */); + var numberIndexType = getIndexTypeOfType(type, 1 /* Number */); if (stringIndexType) result.stringIndexType = instantiateType(stringIndexType, mapper); if (numberIndexType) @@ -12079,47 +14167,49 @@ var ts; } function instantiateType(type, mapper) { if (mapper !== identityMapper) { - if (type.flags & 512) { + if (type.flags & 512 /* TypeParameter */) { return mapper(type); } - if (type.flags & 32768) { - return type.symbol && type.symbol.flags & (16 | 8192 | 2048 | 4096) ? + if (type.flags & 32768 /* Anonymous */) { + return type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) ? instantiateAnonymousType(type, mapper) : type; } - if (type.flags & 4096) { + if (type.flags & 4096 /* Reference */) { return createTypeReference(type.target, instantiateList(type.typeArguments, mapper, instantiateType)); } - if (type.flags & 8192) { + if (type.flags & 8192 /* Tuple */) { return createTupleType(instantiateList(type.elementTypes, mapper, instantiateType)); } - if (type.flags & 16384) { + if (type.flags & 16384 /* Union */) { return getUnionType(instantiateList(type.types, mapper, instantiateType), true); } } return type; } + // Returns true if the given expression contains (at any level of nesting) a function or arrow expression + // that is subject to contextual typing. function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 134 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 162: - case 163: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: return isContextSensitiveFunctionLikeDeclaration(node); - case 154: + case 154 /* ObjectLiteralExpression */: return ts.forEach(node.properties, isContextSensitive); - case 153: + case 153 /* ArrayLiteralExpression */: return ts.forEach(node.elements, isContextSensitive); - case 170: + case 170 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 169: - return node.operatorToken.kind === 49 && + case 169 /* BinaryExpression */: + return node.operatorToken.kind === 49 /* BarBarToken */ && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 224: + case 224 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 134: - case 133: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: return isContextSensitiveFunctionLikeDeclaration(node); - case 161: + case 161 /* ParenthesizedExpression */: return isContextSensitive(node.expression); } return false; @@ -12128,10 +14218,10 @@ var ts; return !node.typeParameters && node.parameters.length && !ts.forEach(node.parameters, function (p) { return p.type; }); } function getTypeWithoutConstructors(type) { - if (type.flags & 48128) { + if (type.flags & 48128 /* ObjectType */) { var resolved = resolveObjectOrUnionTypeMembers(type); if (resolved.constructSignatures.length) { - var result = createObjectType(32768, type.symbol); + var result = createObjectType(32768 /* Anonymous */, type.symbol); result.members = resolved.members; result.properties = resolved.properties; result.callSignatures = resolved.callSignatures; @@ -12141,6 +14231,7 @@ var ts; } return type; } + // TYPE CHECKING var subtypeRelation = {}; var assignableRelation = {}; var identityRelation = {}; @@ -12148,7 +14239,7 @@ var ts; return checkTypeRelatedTo(source, target, identityRelation, undefined); } function compareTypes(source, target) { - return checkTypeRelatedTo(source, target, identityRelation, undefined) ? -1 : 0; + return checkTypeRelatedTo(source, target, identityRelation, undefined) ? -1 /* True */ : 0 /* False */; } function isTypeSubtypeOf(source, target) { return checkTypeSubtypeOf(source, target, undefined); @@ -12182,6 +14273,10 @@ var ts; error(errorNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); } else if (errorInfo) { + // If we already computed this relation, but in a context where we didn't want to report errors (e.g. overload resolution), + // then we'll only have a top-level error (e.g. 'Class X does not implement interface Y') without any details. If this happened, + // request a recompuation to get a complete error message. This will be skipped if we've already done this computation in a context + // where errors were being reported. if (errorInfo.next === undefined) { errorInfo = undefined; elaborateErrors = true; @@ -12192,42 +14287,48 @@ var ts; } diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo)); } - return result !== 0; + return result !== 0 /* False */; function reportError(message, arg0, arg1, arg2) { errorInfo = ts.chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2); } + // Compare two types and return + // Ternary.True if they are related with no assumptions, + // Ternary.Maybe if they are related with assumptions of other relationships, or + // Ternary.False if they are not related. function isRelatedTo(source, target, reportErrors, headMessage) { var result; + // both types are the same - covers 'they are the same primitive type or both are Any' or the same type parameter cases if (source === target) - return -1; + return -1 /* True */; if (relation !== identityRelation) { - if (target.flags & 1) - return -1; + if (target.flags & 1 /* Any */) + return -1 /* True */; if (source === undefinedType) - return -1; + return -1 /* True */; if (source === nullType && target !== undefinedType) - return -1; - if (source.flags & 128 && target === numberType) - return -1; - if (source.flags & 256 && target === stringType) - return -1; + return -1 /* True */; + if (source.flags & 128 /* Enum */ && target === numberType) + return -1 /* True */; + if (source.flags & 256 /* StringLiteral */ && target === stringType) + return -1 /* True */; if (relation === assignableRelation) { - if (source.flags & 1) - return -1; - if (source === numberType && target.flags & 128) - return -1; + if (source.flags & 1 /* Any */) + return -1 /* True */; + if (source === numberType && target.flags & 128 /* Enum */) + return -1 /* True */; } } - if (source.flags & 16384 || target.flags & 16384) { + var saveErrorInfo = errorInfo; + if (source.flags & 16384 /* Union */ || target.flags & 16384 /* Union */) { if (relation === identityRelation) { - if (source.flags & 16384 && target.flags & 16384) { + if (source.flags & 16384 /* Union */ && target.flags & 16384 /* Union */) { if (result = unionTypeRelatedToUnionType(source, target)) { if (result &= unionTypeRelatedToUnionType(target, source)) { return result; } } } - else if (source.flags & 16384) { + else if (source.flags & 16384 /* Union */) { if (result = unionTypeRelatedToType(source, target, reportErrors)) { return result; } @@ -12239,7 +14340,7 @@ var ts; } } else { - if (source.flags & 16384) { + if (source.flags & 16384 /* Union */) { if (result = unionTypeRelatedToType(source, target, reportErrors)) { return result; } @@ -12251,46 +14352,57 @@ var ts; } } } - else if (source.flags & 512 && target.flags & 512) { + else if (source.flags & 512 /* TypeParameter */ && target.flags & 512 /* TypeParameter */) { 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; - } + else if (source.flags & 4096 /* Reference */ && target.flags & 4096 /* Reference */ && source.target === target.target) { + // We have type references to same target type, see if relationship holds for all type arguments + 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))) { + } + // Even if relationship doesn't hold for unions, type parameters, or generic type references, + // it may hold in a structural comparison. + // Report structural errors only if we haven't reported any errors yet + var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; + // identity relation does not use apparent type + var sourceOrApparentType = relation === identityRelation ? source : getApparentType(source); + if (sourceOrApparentType.flags & 48128 /* ObjectType */ && target.flags & 48128 /* ObjectType */) { + if (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors)) { errorInfo = saveErrorInfo; return result; } } + else if (source.flags & 512 /* TypeParameter */ && sourceOrApparentType.flags & 16384 /* Union */) { + // We clear the errors first because the following check often gives a better error than + // the union comparison above if it is applicable. + errorInfo = saveErrorInfo; + if (result = isRelatedTo(sourceOrApparentType, target, reportErrors)) { + return result; + } + } if (reportErrors) { headMessage = headMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1; var sourceType = typeToString(source); var targetType = typeToString(target); if (sourceType === targetType) { - sourceType = typeToString(source, undefined, 128); - targetType = typeToString(target, undefined, 128); + sourceType = typeToString(source, undefined, 128 /* UseFullyQualifiedType */); + targetType = typeToString(target, undefined, 128 /* UseFullyQualifiedType */); } reportError(headMessage, sourceType, targetType); } - return 0; + return 0 /* False */; } function unionTypeRelatedToUnionType(source, target) { - var result = -1; + var result = -1 /* True */; var sourceTypes = source.types; for (var _i = 0; _i < sourceTypes.length; _i++) { var sourceType = sourceTypes[_i]; var related = typeRelatedToUnionType(sourceType, target, false); if (!related) { - return 0; + return 0 /* False */; } result &= related; } @@ -12304,27 +14416,27 @@ var ts; return related; } } - return 0; + return 0 /* False */; } function unionTypeRelatedToType(source, target, reportErrors) { - var result = -1; + var result = -1 /* True */; var sourceTypes = source.types; for (var _i = 0; _i < sourceTypes.length; _i++) { var sourceType = sourceTypes[_i]; var related = isRelatedTo(sourceType, target, reportErrors); if (!related) { - return 0; + return 0 /* False */; } result &= related; } return result; } function typesRelatedTo(sources, targets, reportErrors) { - var result = -1; + var result = -1 /* True */; for (var i = 0, len = sources.length; i < len; i++) { var related = isRelatedTo(sources[i], targets[i], reportErrors); if (!related) { - return 0; + return 0 /* False */; } result &= related; } @@ -12333,13 +14445,14 @@ var ts; function typeParameterRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { if (source.symbol.name !== target.symbol.name) { - return 0; + return 0 /* False */; } + // covers case when both type parameters does not have constraint (both equal to noConstraintType) if (source.constraint === target.constraint) { - return -1; + return -1 /* True */; } if (source.constraint === noConstraintType || target.constraint === noConstraintType) { - return 0; + return 0 /* False */; } return isRelatedTo(source.constraint, target.constraint, reportErrors); } @@ -12347,34 +14460,43 @@ var ts; while (true) { var constraint = getConstraintOfTypeParameter(source); if (constraint === target) - return -1; - if (!(constraint && constraint.flags & 512)) + return -1 /* True */; + if (!(constraint && constraint.flags & 512 /* TypeParameter */)) break; source = constraint; } - return 0; + return 0 /* False */; } } + // Determine if two object types are related by structure. First, check if the result is already available in the global cache. + // Second, check if we have already started a comparison of the given two types in which case we assume the result to be true. + // Third, check if both types are part of deeply nested chains of generic type instantiations and if so assume the types are + // equal and infinitely expanding. Fourth, if we have reached a depth of 100 nested comparisons, assume we have runaway recursion + // and issue an error. Otherwise, actually compare the structure of the two types. function objectTypeRelatedTo(source, target, reportErrors) { if (overflow) { - return 0; + return 0 /* False */; } var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; var related = relation[id]; + //let related: RelationComparisonResult = undefined; // relation[id]; if (related !== undefined) { - if (!elaborateErrors || (related === 3)) { - return related === 1 ? -1 : 0; + // If we computed this relation already and it was failed and reported, or if we're not being asked to elaborate + // errors, we can use the cached value. Otherwise, recompute the relation + if (!elaborateErrors || (related === 3 /* FailedAndReported */)) { + return related === 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */; } } if (depth > 0) { for (var i = 0; i < depth; i++) { + // If source and target are already being compared, consider them related with assumptions if (maybeStack[i][id]) { - return 1; + return 1 /* Maybe */; } } if (depth === 100) { overflow = true; - return 0; + return 0 /* False */; } } else { @@ -12386,7 +14508,7 @@ var ts; sourceStack[depth] = source; targetStack[depth] = target; maybeStack[depth] = {}; - maybeStack[depth][id] = 1; + maybeStack[depth][id] = 1 /* Succeeded */; depth++; var saveExpandingFlags = expandingFlags; if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack)) @@ -12395,14 +14517,14 @@ var ts; expandingFlags |= 2; var result; if (expandingFlags === 3) { - result = 1; + result = 1 /* Maybe */; } else { result = propertiesRelatedTo(source, target, reportErrors); if (result) { - result &= signaturesRelatedTo(source, target, 0, reportErrors); + result &= signaturesRelatedTo(source, target, 0 /* Call */, reportErrors); if (result) { - result &= signaturesRelatedTo(source, target, 1, reportErrors); + result &= signaturesRelatedTo(source, target, 1 /* Construct */, reportErrors); if (result) { result &= stringIndexTypesRelatedTo(source, target, reportErrors); if (result) { @@ -12416,21 +14538,29 @@ var ts; depth--; if (result) { var maybeCache = maybeStack[depth]; - var destinationCache = (result === -1 || depth === 0) ? relation : maybeStack[depth - 1]; + // If result is definitely true, copy assumptions to global cache, else copy to next level up + var destinationCache = (result === -1 /* True */ || depth === 0) ? relation : maybeStack[depth - 1]; ts.copyMap(maybeCache, destinationCache); } else { - relation[id] = reportErrors ? 3 : 2; + // A false result goes straight into global cache (when something is false under assumptions it + // will also be false without assumptions) + relation[id] = reportErrors ? 3 /* FailedAndReported */ : 2 /* Failed */; } return result; } + // Return true if the given type is part of a deeply nested chain of generic instantiations. We consider this to be the case + // when structural type comparisons have been started for 10 or more instantiations of the same generic type. It is possible, + // though highly unlikely, for this test to be true in a situation where a chain of instantiations is not infinitely expanding. + // Effectively, we will generate a false positive when two types are structurally equal to at least 10 levels, but unequal at + // some level beyond that. function isDeeplyNestedGeneric(type, stack) { - if (type.flags & 4096 && depth >= 10) { + if (type.flags & 4096 /* Reference */ && depth >= 10) { 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_1) { + if (t.flags & 4096 /* Reference */ && t.target === target_1) { count++; if (count >= 10) return true; @@ -12443,67 +14573,74 @@ var ts; if (relation === identityRelation) { return propertiesIdenticalTo(source, target); } - var result = -1; + var result = -1 /* True */; var properties = getPropertiesOfObjectType(target); - var requireOptionalProperties = relation === subtypeRelation && !(source.flags & 131072); + var requireOptionalProperties = relation === subtypeRelation && !(source.flags & 131072 /* ObjectLiteral */); for (var _i = 0; _i < properties.length; _i++) { var targetProp = properties[_i]; var sourceProp = getPropertyOfType(source, targetProp.name); if (sourceProp !== targetProp) { if (!sourceProp) { - if (!(targetProp.flags & 536870912) || requireOptionalProperties) { + if (!(targetProp.flags & 536870912 /* Optional */) || requireOptionalProperties) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source)); } - return 0; + return 0 /* False */; } } - else if (!(targetProp.flags & 134217728)) { + else if (!(targetProp.flags & 134217728 /* Prototype */)) { var sourceFlags = getDeclarationFlagsFromSymbol(sourceProp); var targetFlags = getDeclarationFlagsFromSymbol(targetProp); - if (sourceFlags & 32 || targetFlags & 32) { + if (sourceFlags & 32 /* Private */ || targetFlags & 32 /* Private */) { if (sourceProp.valueDeclaration !== targetProp.valueDeclaration) { if (reportErrors) { - if (sourceFlags & 32 && targetFlags & 32) { + if (sourceFlags & 32 /* Private */ && targetFlags & 32 /* Private */) { reportError(ts.Diagnostics.Types_have_separate_declarations_of_a_private_property_0, symbolToString(targetProp)); } else { - reportError(ts.Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString(targetProp), typeToString(sourceFlags & 32 ? source : target), typeToString(sourceFlags & 32 ? target : source)); + reportError(ts.Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString(targetProp), typeToString(sourceFlags & 32 /* Private */ ? source : target), typeToString(sourceFlags & 32 /* Private */ ? target : source)); } } - return 0; + return 0 /* False */; } } - else if (targetFlags & 64) { - var sourceDeclaredInClass = sourceProp.parent && sourceProp.parent.flags & 32; + else if (targetFlags & 64 /* Protected */) { + var sourceDeclaredInClass = sourceProp.parent && sourceProp.parent.flags & 32 /* Class */; var sourceClass = sourceDeclaredInClass ? getDeclaredTypeOfSymbol(sourceProp.parent) : undefined; var targetClass = getDeclaredTypeOfSymbol(targetProp.parent); if (!sourceClass || !hasBaseType(sourceClass, targetClass)) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(sourceClass || source), typeToString(targetClass)); } - return 0; + return 0 /* False */; } } - else if (sourceFlags & 64) { + else if (sourceFlags & 64 /* Protected */) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); } - return 0; + return 0 /* False */; } var related = isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); if (!related) { if (reportErrors) { reportError(ts.Diagnostics.Types_of_property_0_are_incompatible, symbolToString(targetProp)); } - return 0; + return 0 /* False */; } result &= related; - if (sourceProp.flags & 536870912 && !(targetProp.flags & 536870912)) { + if (sourceProp.flags & 536870912 /* Optional */ && !(targetProp.flags & 536870912 /* Optional */)) { + // TypeScript 1.0 spec (April 2014): 3.8.3 + // S is a subtype of a type T, and T is a supertype of S if ... + // S' and T are object types and, for each member M in T.. + // M is a property and S' contains a property N where + // if M is a required property, N is also a required property + // (M - property in T) + // (N - property in S) if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); } - return 0; + return 0 /* False */; } } } @@ -12514,18 +14651,18 @@ var ts; var sourceProperties = getPropertiesOfObjectType(source); var targetProperties = getPropertiesOfObjectType(target); if (sourceProperties.length !== targetProperties.length) { - return 0; + return 0 /* False */; } - var result = -1; + var result = -1 /* True */; for (var _i = 0; _i < sourceProperties.length; _i++) { var sourceProp = sourceProperties[_i]; var targetProp = getPropertyOfObjectType(target, sourceProp.name); if (!targetProp) { - return 0; + return 0 /* False */; } var related = compareProperties(sourceProp, targetProp, isRelatedTo); if (!related) { - return 0; + return 0 /* False */; } result &= related; } @@ -12536,39 +14673,40 @@ var ts; return signaturesIdenticalTo(source, target, kind); } if (target === anyFunctionType || source === anyFunctionType) { - return -1; + return -1 /* True */; } var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); - var result = -1; + var result = -1 /* True */; var saveErrorInfo = errorInfo; outer: for (var _i = 0; _i < targetSignatures.length; _i++) { var t = targetSignatures[_i]; - if (!t.hasStringLiterals || target.flags & 65536) { + if (!t.hasStringLiterals || target.flags & 65536 /* FromSignature */) { var localErrors = reportErrors; for (var _a = 0; _a < sourceSignatures.length; _a++) { var s = sourceSignatures[_a]; - if (!s.hasStringLiterals || source.flags & 65536) { + if (!s.hasStringLiterals || source.flags & 65536 /* FromSignature */) { var related = signatureRelatedTo(s, t, localErrors); if (related) { result &= related; errorInfo = saveErrorInfo; continue outer; } + // Only report errors from the first failure localErrors = false; } } - return 0; + return 0 /* False */; } } return result; } function signatureRelatedTo(source, target, reportErrors) { if (source === target) { - return -1; + return -1 /* True */; } if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { - return 0; + return 0 /* False */; } var sourceMax = source.parameters.length; var targetMax = target.parameters.length; @@ -12589,9 +14727,11 @@ var ts; else { checkCount = sourceMax < targetMax ? sourceMax : targetMax; } + // Spec 1.0 Section 3.8.3 & 3.8.4: + // M and N (the signatures) are instantiated using type Any as the type argument for all type parameters declared by M and N source = getErasedSignature(source); target = getErasedSignature(target); - var result = -1; + var result = -1 /* True */; for (var i = 0; i < checkCount; i++) { var s_1 = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); var t_1 = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); @@ -12603,7 +14743,7 @@ var ts; if (reportErrors) { reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); } - return 0; + return 0 /* False */; } errorInfo = saveErrorInfo; } @@ -12619,13 +14759,13 @@ var ts; var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); if (sourceSignatures.length !== targetSignatures.length) { - return 0; + return 0 /* False */; } - var result = -1; + var result = -1 /* True */; for (var i = 0, len = sourceSignatures.length; i < len; ++i) { var related = compareSignatures(sourceSignatures[i], targetSignatures[i], true, isRelatedTo); if (!related) { - return 0; + return 0 /* False */; } result &= related; } @@ -12633,44 +14773,45 @@ var ts; } function stringIndexTypesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { - return indexTypesIdenticalTo(0, source, target); + return indexTypesIdenticalTo(0 /* String */, source, target); } - var targetType = getIndexTypeOfType(target, 0); + var targetType = getIndexTypeOfType(target, 0 /* String */); if (targetType) { - var sourceType = getIndexTypeOfType(source, 0); + var sourceType = getIndexTypeOfType(source, 0 /* String */); if (!sourceType) { if (reportErrors) { reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); } - return 0; + return 0 /* False */; } var related = isRelatedTo(sourceType, targetType, reportErrors); if (!related) { if (reportErrors) { reportError(ts.Diagnostics.Index_signatures_are_incompatible); } - return 0; + return 0 /* False */; } return related; } - return -1; + return -1 /* True */; } function numberIndexTypesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { - return indexTypesIdenticalTo(1, source, target); + return indexTypesIdenticalTo(1 /* Number */, source, target); } - var targetType = getIndexTypeOfType(target, 1); + var targetType = getIndexTypeOfType(target, 1 /* Number */); if (targetType) { - var sourceStringType = getIndexTypeOfType(source, 0); - var sourceNumberType = getIndexTypeOfType(source, 1); + var sourceStringType = getIndexTypeOfType(source, 0 /* String */); + var sourceNumberType = getIndexTypeOfType(source, 1 /* Number */); if (!(sourceStringType || sourceNumberType)) { if (reportErrors) { reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); } - return 0; + return 0 /* False */; } var related; if (sourceStringType && sourceNumberType) { + // If we know for sure we're testing both string and numeric index types then only report errors from the second one related = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); } else { @@ -12680,73 +14821,78 @@ var ts; if (reportErrors) { reportError(ts.Diagnostics.Index_signatures_are_incompatible); } - return 0; + return 0 /* False */; } return related; } - return -1; + return -1 /* True */; } function indexTypesIdenticalTo(indexKind, source, target) { var targetType = getIndexTypeOfType(target, indexKind); var sourceType = getIndexTypeOfType(source, indexKind); if (!sourceType && !targetType) { - return -1; + return -1 /* True */; } if (sourceType && targetType) { return isRelatedTo(sourceType, targetType); } - return 0; + return 0 /* False */; } } function isPropertyIdenticalTo(sourceProp, targetProp) { - return compareProperties(sourceProp, targetProp, compareTypes) !== 0; + return compareProperties(sourceProp, targetProp, compareTypes) !== 0 /* False */; } function compareProperties(sourceProp, targetProp, compareTypes) { + // Two members are considered identical when + // - they are public properties with identical names, optionality, and types, + // - they are private or protected properties originating in the same declaration and having identical types if (sourceProp === targetProp) { - return -1; + return -1 /* True */; } - var sourcePropAccessibility = getDeclarationFlagsFromSymbol(sourceProp) & (32 | 64); - var targetPropAccessibility = getDeclarationFlagsFromSymbol(targetProp) & (32 | 64); + var sourcePropAccessibility = getDeclarationFlagsFromSymbol(sourceProp) & (32 /* Private */ | 64 /* Protected */); + var targetPropAccessibility = getDeclarationFlagsFromSymbol(targetProp) & (32 /* Private */ | 64 /* Protected */); if (sourcePropAccessibility !== targetPropAccessibility) { - return 0; + return 0 /* False */; } if (sourcePropAccessibility) { if (getTargetSymbol(sourceProp) !== getTargetSymbol(targetProp)) { - return 0; + return 0 /* False */; } } else { - if ((sourceProp.flags & 536870912) !== (targetProp.flags & 536870912)) { - return 0; + if ((sourceProp.flags & 536870912 /* Optional */) !== (targetProp.flags & 536870912 /* Optional */)) { + return 0 /* False */; } } return compareTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); } function compareSignatures(source, target, compareReturnTypes, compareTypes) { if (source === target) { - return -1; + return -1 /* True */; } if (source.parameters.length !== target.parameters.length || source.minArgumentCount !== target.minArgumentCount || source.hasRestParameter !== target.hasRestParameter) { - return 0; + return 0 /* False */; } - var result = -1; + var result = -1 /* True */; if (source.typeParameters && target.typeParameters) { if (source.typeParameters.length !== target.typeParameters.length) { - return 0; + return 0 /* False */; } for (var i = 0, len = source.typeParameters.length; i < len; ++i) { var related = compareTypes(source.typeParameters[i], target.typeParameters[i]); if (!related) { - return 0; + return 0 /* False */; } result &= related; } } else if (source.typeParameters || target.typeParameters) { - return 0; + return 0 /* False */; } + // Spec 1.0 Section 3.8.3 & 3.8.4: + // M and N (the signatures) are instantiated using type Any as the type argument for all type parameters declared by M and N source = getErasedSignature(source); target = getErasedSignature(target); for (var i = 0, len = source.parameters.length; i < len; i++) { @@ -12754,7 +14900,7 @@ var ts; var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]); var related = compareTypes(s, t); if (!related) { - return 0; + return 0 /* False */; } result &= related; } @@ -12775,6 +14921,9 @@ var ts; return ts.forEach(types, function (t) { return isSupertypeOfEach(t, types) ? t : undefined; }); } function reportNoCommonSupertypeError(types, errorLocation, errorMessageChainHead) { + // The downfallType/bestSupertypeDownfallType is the first type that caused a particular candidate + // to not be the common supertype. So if it weren't for this one downfallType (and possibly others), + // the type in question could have been the common supertype. var bestSupertype; var bestSupertypeDownfallType; var bestSupertypeScore = 0; @@ -12795,23 +14944,31 @@ var ts; bestSupertypeDownfallType = downfallType; bestSupertypeScore = score; } + // types.length - 1 is the maximum score, given that getCommonSupertype returned false if (bestSupertypeScore === types.length - 1) { break; } } + // In the following errors, the {1} slot is before the {0} slot because checkTypeSubtypeOf supplies the + // subtype as the first argument to the error checkTypeSubtypeOf(bestSupertypeDownfallType, bestSupertype, errorLocation, ts.Diagnostics.Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0, errorMessageChainHead); } function isArrayType(type) { - return type.flags & 4096 && type.target === globalArrayType; + return type.flags & 4096 /* Reference */ && type.target === globalArrayType; } function isArrayLikeType(type) { - return !(type.flags & (32 | 64)) && isTypeAssignableTo(type, anyArrayType); + // A type is array-like if it is not the undefined or null type and if it is assignable to any[] + return !(type.flags & (32 /* Undefined */ | 64 /* Null */)) && isTypeAssignableTo(type, anyArrayType); } function isTupleLikeType(type) { return !!getPropertyOfType(type, "0"); } + /** + * Check if a Type was written as a tuple type literal. + * Prefer using isTupleLikeType() unless the use of `elementTypes` is required. + */ function isTupleType(type) { - return (type.flags & 8192) && !!type.elementTypes; + return (type.flags & 8192 /* Tuple */) && !!type.elementTypes; } function getWidenedTypeOfObjectLiteral(type) { var properties = getPropertiesOfObjectType(type); @@ -12820,7 +14977,7 @@ var ts; var propType = getTypeOfSymbol(p); var widenedType = getWidenedType(propType); if (propType !== widenedType) { - var symbol = createSymbol(p.flags | 67108864, p.name); + var symbol = createSymbol(p.flags | 67108864 /* Transient */, p.name); symbol.declarations = p.declarations; symbol.parent = p.parent; symbol.type = widenedType; @@ -12831,8 +14988,8 @@ var ts; } members[p.name] = p; }); - var stringIndexType = getIndexTypeOfType(type, 0); - var numberIndexType = getIndexTypeOfType(type, 1); + var stringIndexType = getIndexTypeOfType(type, 0 /* String */); + var numberIndexType = getIndexTypeOfType(type, 1 /* Number */); if (stringIndexType) stringIndexType = getWidenedType(stringIndexType); if (numberIndexType) @@ -12840,14 +14997,14 @@ var ts; return createAnonymousType(type.symbol, members, emptyArray, emptyArray, stringIndexType, numberIndexType); } function getWidenedType(type) { - if (type.flags & 786432) { - if (type.flags & (32 | 64)) { + if (type.flags & 786432 /* RequiresWidening */) { + if (type.flags & (32 /* Undefined */ | 64 /* Null */)) { return anyType; } - if (type.flags & 131072) { + if (type.flags & 131072 /* ObjectLiteral */) { return getWidenedTypeOfObjectLiteral(type); } - if (type.flags & 16384) { + if (type.flags & 16384 /* Union */) { return getUnionType(ts.map(type.types, getWidenedType)); } if (isArrayType(type)) { @@ -12857,7 +15014,7 @@ var ts; return type; } function reportWideningErrorsInType(type) { - if (type.flags & 16384) { + if (type.flags & 16384 /* Union */) { var errorReported = false; ts.forEach(type.types, function (t) { if (reportWideningErrorsInType(t)) { @@ -12869,11 +15026,11 @@ var ts; if (isArrayType(type)) { return reportWideningErrorsInType(type.typeArguments[0]); } - if (type.flags & 131072) { + if (type.flags & 131072 /* ObjectLiteral */) { var errorReported = false; ts.forEach(getPropertiesOfObjectType(type), function (p) { var t = getTypeOfSymbol(p); - if (t.flags & 262144) { + if (t.flags & 262144 /* ContainsUndefinedOrNull */) { if (!reportWideningErrorsInType(t)) { error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, p.name, typeToString(getWidenedType(t))); } @@ -12888,22 +15045,22 @@ var ts; var typeAsString = typeToString(getWidenedType(type)); var diagnostic; switch (declaration.kind) { - case 132: - case 131: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 129: + case 129 /* Parameter */: diagnostic = declaration.dotDotDotToken ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; - case 200: - case 134: - case 133: - case 136: - case 137: - case 162: - case 163: + case 200 /* FunctionDeclaration */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; @@ -12916,7 +15073,8 @@ var ts; error(declaration, diagnostic, ts.declarationNameToString(declaration.name), typeAsString); } function reportErrorsFromWidening(declaration, type) { - if (produceDiagnostics && compilerOptions.noImplicitAny && type.flags & 262144) { + if (produceDiagnostics && compilerOptions.noImplicitAny && type.flags & 262144 /* ContainsUndefinedOrNull */) { + // Report implicit any error within type if possible, otherwise report error on declaration if (!reportWideningErrorsInType(type)) { reportImplicitAnyError(declaration, type); } @@ -12981,7 +15139,7 @@ var ts; var count = 0; for (var i = 0; i < depth; i++) { var t = stack[i]; - if (t.flags & 4096 && t.target === target_2) { + if (t.flags & 4096 /* Reference */ && t.target === target_2) { count++; } } @@ -12993,12 +15151,19 @@ var ts; if (source === anyFunctionType) { return; } - if (target.flags & 512) { + if (target.flags & 512 /* TypeParameter */) { + // If target is a type parameter, make an inference var typeParameters = context.typeParameters; for (var i = 0; i < typeParameters.length; i++) { if (target === typeParameters[i]) { var inferences = context.inferences[i]; if (!inferences.isFixed) { + // Any inferences that are made to a type parameter in a union type are inferior + // to inferences made to a flat (non-union) type. This is because if we infer to + // T | string[], we really don't know if we should be inferring to T or not (because + // the correct constituent on the target side could be string[]). Therefore, we put + // such inferior inferences into a secondary bucket, and only use them if the primary + // bucket is empty. var candidates = inferiority ? inferences.secondary || (inferences.secondary = []) : inferences.primary || (inferences.primary = []); @@ -13010,20 +15175,22 @@ var ts; } } } - else if (source.flags & 4096 && target.flags & 4096 && source.target === target.target) { + else if (source.flags & 4096 /* Reference */ && target.flags & 4096 /* Reference */ && source.target === target.target) { + // If source and target are references to the same generic type, infer from type arguments var sourceTypes = source.typeArguments; var targetTypes = target.typeArguments; for (var i = 0; i < sourceTypes.length; i++) { inferFromTypes(sourceTypes[i], targetTypes[i]); } } - else if (target.flags & 16384) { + else if (target.flags & 16384 /* Union */) { var targetTypes = target.types; var typeParameterCount = 0; var typeParameter; + // First infer to each type in union that isn't a type parameter for (var _i = 0; _i < targetTypes.length; _i++) { var t = targetTypes[_i]; - if (t.flags & 512 && ts.contains(context.typeParameters, t)) { + if (t.flags & 512 /* TypeParameter */ && ts.contains(context.typeParameters, t)) { typeParameter = t; typeParameterCount++; } @@ -13031,21 +15198,24 @@ var ts; inferFromTypes(source, t); } } + // If union contains a single naked type parameter, make a secondary inference to that type parameter if (typeParameterCount === 1) { inferiority++; inferFromTypes(source, typeParameter); inferiority--; } } - else if (source.flags & 16384) { + else if (source.flags & 16384 /* Union */) { + // Source is a union type, infer from each consituent type 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 /* ObjectType */ && (target.flags & (4096 /* Reference */ | 8192 /* Tuple */) || + (target.flags & 32768 /* Anonymous */) && target.symbol && target.symbol.flags & (8192 /* Method */ | 2048 /* TypeLiteral */))) { + // If source is an object type, and target is a type reference, a tuple type, the type of a method, or a type literal, infer from members if (!isInProcess(source, target) && isWithinDepthLimit(source, sourceStack) && isWithinDepthLimit(target, targetStack)) { if (depth === 0) { sourceStack = []; @@ -13055,11 +15225,11 @@ var ts; targetStack[depth] = target; depth++; inferFromProperties(source, target); - inferFromSignatures(source, target, 0); - inferFromSignatures(source, target, 1); - inferFromIndexTypes(source, target, 0, 0); - inferFromIndexTypes(source, target, 1, 1); - inferFromIndexTypes(source, target, 0, 1); + inferFromSignatures(source, target, 0 /* Call */); + inferFromSignatures(source, target, 1 /* Construct */); + inferFromIndexTypes(source, target, 0 /* String */, 0 /* String */); + inferFromIndexTypes(source, target, 1 /* Number */, 1 /* Number */); + inferFromIndexTypes(source, target, 0 /* String */, 1 /* Number */); depth--; } } @@ -13108,19 +15278,28 @@ var ts; if (!inferredType) { var inferences = getInferenceCandidates(context, index); if (inferences.length) { + // Infer widened union or supertype, or the unknown type for no common supertype var unionOrSuperType = context.inferUnionTypes ? getUnionType(inferences) : getCommonSupertype(inferences); inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : unknownType; inferenceSucceeded = !!unionOrSuperType; } else { + // Infer the empty object type when no inferences were made. It is important to remember that + // in this case, inference still succeeds, meaning there is no error for not having inference + // candidates. An inference error only occurs when there are *conflicting* candidates, i.e. + // candidates with no common supertype. inferredType = emptyObjectType; inferenceSucceeded = true; } + // Only do the constraint check if inference succeeded (to prevent cascading errors) if (inferenceSucceeded) { var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); inferredType = constraint && !isTypeAssignableTo(inferredType, constraint) ? constraint : inferredType; } else if (context.failedTypeParameterIndex === undefined || context.failedTypeParameterIndex > index) { + // If inference failed, it is necessary to record the index of the failed type parameter (the one we are on). + // It might be that inference has already failed on a later type parameter on a previous call to inferTypeArguments. + // So if this failure is on preceding type parameter, this type parameter is the new failure index. context.failedTypeParameterIndex = index; } context.inferredTypes[index] = inferredType; @@ -13136,20 +15315,24 @@ var ts; function hasAncestor(node, kind) { return ts.getAncestor(node, kind) !== undefined; } + // EXPRESSION TYPE CHECKING function getResolvedSymbol(node) { var links = getNodeLinks(node); if (!links.resolvedSymbol) { - links.resolvedSymbol = (!ts.nodeIsMissing(node) && resolveName(node, node.text, 107455 | 1048576, ts.Diagnostics.Cannot_find_name_0, node)) || unknownSymbol; + links.resolvedSymbol = (!ts.nodeIsMissing(node) && resolveName(node, node.text, 107455 /* Value */ | 1048576 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, node)) || unknownSymbol; } return links.resolvedSymbol; } function isInTypeQuery(node) { + // TypeScript 1.0 spec (April 2014): 3.6.3 + // A type query consists of the keyword typeof followed by an expression. + // The expression is restricted to a single identifier or a sequence of identifiers separated by periods while (node) { switch (node.kind) { - case 144: + case 144 /* TypeQuery */: return true; - case 65: - case 126: + case 65 /* Identifier */: + case 126 /* QualifiedName */: node = node.parent; continue; default: @@ -13158,10 +15341,13 @@ var ts; } ts.Debug.fail("should not get here"); } + // For a union type, remove all constituent types that are of the given type kind (when isOfTypeKind is true) + // or not of the given type kind (when isOfTypeKind is false) function removeTypesFromUnionType(type, typeKind, isOfTypeKind, allowEmptyUnionResult) { - if (type.flags & 16384) { + if (type.flags & 16384 /* Union */) { var types = type.types; if (ts.forEach(types, function (t) { return !!(t.flags & typeKind) === isOfTypeKind; })) { + // Above we checked if we have anything to remove, now use the opposite test to do the removal var narrowedType = getUnionType(ts.filter(types, function (t) { return !(t.flags & typeKind) === isOfTypeKind; })); if (allowEmptyUnionResult || narrowedType !== emptyObjectType) { return narrowedType; @@ -13169,6 +15355,8 @@ var ts; } } else if (allowEmptyUnionResult && !!(type.flags & typeKind) === isOfTypeKind) { + // Use getUnionType(emptyArray) instead of emptyObjectType in case the way empty union types + // are represented ever changes. return getUnionType(emptyArray); } return type; @@ -13176,6 +15364,7 @@ var ts; function hasInitializer(node) { return !!(node.initializer || ts.isBindingPattern(node.parent) && hasInitializer(node.parent.parent)); } + // Check if a given variable is assigned within a given syntax node function isVariableAssignedWithin(symbol, node) { var links = getNodeLinks(node); if (links.assignmentChecks) { @@ -13189,12 +15378,12 @@ var ts; } return links.assignmentChecks[symbol.id] = isAssignedIn(node); function isAssignedInBinaryExpression(node) { - if (node.operatorToken.kind >= 53 && node.operatorToken.kind <= 64) { + if (node.operatorToken.kind >= 53 /* FirstAssignment */ && node.operatorToken.kind <= 64 /* LastAssignment */) { var n = node.left; - while (n.kind === 161) { + while (n.kind === 161 /* ParenthesizedExpression */) { n = n.expression; } - if (n.kind === 65 && getResolvedSymbol(n) === symbol) { + if (n.kind === 65 /* Identifier */ && getResolvedSymbol(n) === symbol) { return true; } } @@ -13208,52 +15397,54 @@ var ts; } function isAssignedIn(node) { switch (node.kind) { - case 169: + case 169 /* BinaryExpression */: return isAssignedInBinaryExpression(node); - case 198: - case 152: + case 198 /* VariableDeclaration */: + case 152 /* BindingElement */: return isAssignedInVariableDeclaration(node); - case 150: - case 151: - case 153: - case 154: - case 155: - case 156: - case 157: - case 158: - case 160: - case 161: - case 167: - case 164: - case 165: - case 166: - case 168: - case 170: - case 173: - case 179: - case 180: - case 182: - case 183: - case 184: - case 185: - case 186: - case 187: - case 188: - case 191: - case 192: - case 193: - case 220: - case 221: - case 194: - case 195: - case 196: - case 223: + case 150 /* ObjectBindingPattern */: + case 151 /* ArrayBindingPattern */: + case 153 /* ArrayLiteralExpression */: + case 154 /* ObjectLiteralExpression */: + case 155 /* PropertyAccessExpression */: + case 156 /* ElementAccessExpression */: + case 157 /* CallExpression */: + case 158 /* NewExpression */: + case 160 /* TypeAssertionExpression */: + case 161 /* ParenthesizedExpression */: + case 167 /* PrefixUnaryExpression */: + case 164 /* DeleteExpression */: + case 165 /* TypeOfExpression */: + case 166 /* VoidExpression */: + case 168 /* PostfixUnaryExpression */: + case 170 /* ConditionalExpression */: + case 173 /* SpreadElementExpression */: + case 179 /* Block */: + case 180 /* VariableStatement */: + case 182 /* ExpressionStatement */: + case 183 /* IfStatement */: + case 184 /* DoStatement */: + case 185 /* WhileStatement */: + case 186 /* ForStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: + case 191 /* ReturnStatement */: + case 192 /* WithStatement */: + case 193 /* SwitchStatement */: + case 220 /* CaseClause */: + case 221 /* DefaultClause */: + case 194 /* LabeledStatement */: + case 195 /* ThrowStatement */: + case 196 /* TryStatement */: + case 223 /* CatchClause */: return ts.forEachChild(node, isAssignedIn); } return false; } } function resolveLocation(node) { + // Resolve location from top down towards node if it is a context sensitive expression + // That helps in making sure not assigning types as any when resolved out of order var containerNodes = []; for (var parent_3 = node.parent; parent_3; parent_3 = parent_3.parent) { if ((ts.isExpression(parent_3) || ts.isObjectLiteralMethod(node)) && @@ -13273,46 +15464,65 @@ var ts; } function getTypeOfSymbolAtLocation(symbol, node) { resolveLocation(node); + // Get the narrowed type of symbol at given location instead of just getting + // the type of the symbol. + // eg. + // function foo(a: string | number) { + // if (typeof a === "string") { + // a/**/ + // } + // } + // getTypeOfSymbol for a would return type of parameter symbol string | number + // Unless we provide location /**/, checker wouldn't know how to narrow the type + // By using getNarrowedTypeOfSymbol would return string since it would be able to narrow + // it by typeguard in the if true condition return getNarrowedTypeOfSymbol(symbol, node); } + // Get the narrowed type of a given symbol at a given location function getNarrowedTypeOfSymbol(symbol, node) { var type = getTypeOfSymbol(symbol); - if (node && symbol.flags & 3 && type.flags & (1 | 48128 | 16384 | 512)) { + // Only narrow when symbol is variable of type any or an object, union, or type parameter type + if (node && symbol.flags & 3 /* Variable */ && type.flags & (1 /* Any */ | 48128 /* ObjectType */ | 16384 /* Union */ | 512 /* TypeParameter */)) { loop: while (node.parent) { var child = node; node = node.parent; var narrowedType = type; switch (node.kind) { - case 183: + case 183 /* IfStatement */: + // In a branch of an if statement, narrow based on controlling expression if (child !== node.expression) { narrowedType = narrowType(type, node.expression, child === node.thenStatement); } break; - case 170: + case 170 /* ConditionalExpression */: + // In a branch of a conditional expression, narrow based on controlling condition if (child !== node.condition) { narrowedType = narrowType(type, node.condition, child === node.whenTrue); } break; - case 169: + case 169 /* BinaryExpression */: + // In the right operand of an && or ||, narrow based on left operand if (child === node.right) { - if (node.operatorToken.kind === 48) { + if (node.operatorToken.kind === 48 /* AmpersandAmpersandToken */) { narrowedType = narrowType(type, node.left, true); } - else if (node.operatorToken.kind === 49) { + else if (node.operatorToken.kind === 49 /* BarBarToken */) { narrowedType = narrowType(type, node.left, false); } } break; - case 227: - case 205: - case 200: - case 134: - case 133: - case 136: - case 137: - case 135: + case 227 /* SourceFile */: + case 205 /* ModuleDeclaration */: + case 200 /* FunctionDeclaration */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 135 /* Constructor */: + // Stop at the first containing function or module declaration break loop; } + // Use narrowed type if construct contains no assignments to variable if (narrowedType !== type) { if (isVariableAssignedWithin(symbol, node)) { break; @@ -13323,39 +15533,50 @@ var ts; } return type; function narrowTypeByEquality(type, expr, assumeTrue) { - if (expr.left.kind !== 165 || expr.right.kind !== 8) { + // Check that we have 'typeof ' on the left and string literal on the right + if (expr.left.kind !== 165 /* TypeOfExpression */ || expr.right.kind !== 8 /* StringLiteral */) { return type; } var left = expr.left; var right = expr.right; - if (left.expression.kind !== 65 || getResolvedSymbol(left.expression) !== symbol) { + if (left.expression.kind !== 65 /* Identifier */ || getResolvedSymbol(left.expression) !== symbol) { return type; } var typeInfo = primitiveTypeInfo[right.text]; - if (expr.operatorToken.kind === 31) { + if (expr.operatorToken.kind === 31 /* ExclamationEqualsEqualsToken */) { assumeTrue = !assumeTrue; } if (assumeTrue) { + // Assumed result is true. If check was not for a primitive type, remove all primitive types if (!typeInfo) { - return removeTypesFromUnionType(type, 258 | 132 | 8 | 1048576, true, false); + return removeTypesFromUnionType(type, 258 /* StringLike */ | 132 /* NumberLike */ | 8 /* Boolean */ | 1048576 /* ESSymbol */, + /*isOfTypeKind*/ true, false); } + // Check was for a primitive type, return that primitive type if it is a subtype if (isTypeSubtypeOf(typeInfo.type, type)) { return typeInfo.type; } + // Otherwise, remove all types that aren't of the primitive type kind. This can happen when the type is + // union of enum types and other types. return removeTypesFromUnionType(type, typeInfo.flags, false, false); } else { + // Assumed result is false. If check was for a primitive type, remove that primitive type if (typeInfo) { return removeTypesFromUnionType(type, typeInfo.flags, true, false); } + // Otherwise we don't have enough information to do anything. return type; } } function narrowTypeByAnd(type, expr, assumeTrue) { if (assumeTrue) { + // The assumed result is true, therefore we narrow assuming each operand to be true. return narrowType(narrowType(type, expr.left, true), expr.right, true); } else { + // The assumed result is false. This means either the first operand was false, or the first operand was true + // and the second operand was false. We narrow with those assumptions and union the two resulting types. return getUnionType([ narrowType(type, expr.left, false), narrowType(narrowType(type, expr.left, true), expr.right, false) @@ -13364,57 +15585,67 @@ var ts; } function narrowTypeByOr(type, expr, assumeTrue) { if (assumeTrue) { + // The assumed result is true. This means either the first operand was true, or the first operand was false + // and the second operand was true. We narrow with those assumptions and union the two resulting types. return getUnionType([ narrowType(type, expr.left, true), narrowType(narrowType(type, expr.left, false), expr.right, true) ]); } else { + // The assumed result is false, therefore we narrow assuming each operand to be false. return narrowType(narrowType(type, expr.left, false), expr.right, false); } } function narrowTypeByInstanceof(type, expr, assumeTrue) { - if (type.flags & 1 || !assumeTrue || expr.left.kind !== 65 || getResolvedSymbol(expr.left) !== symbol) { + // Check that type is not any, assumed result is true, and we have variable symbol on the left + if (type.flags & 1 /* Any */ || !assumeTrue || expr.left.kind !== 65 /* Identifier */ || getResolvedSymbol(expr.left) !== symbol) { return type; } + // Check that right operand is a function type with a prototype property var rightType = checkExpression(expr.right); if (!isTypeSubtypeOf(rightType, globalFunctionType)) { return type; } + // Target type is type of prototype property var prototypeProperty = getPropertyOfType(rightType, "prototype"); if (!prototypeProperty) { return type; } var targetType = getTypeOfSymbol(prototypeProperty); + // Narrow to target type if it is a subtype of current type if (isTypeSubtypeOf(targetType, type)) { return targetType; } - if (type.flags & 16384) { + // If current type is a union type, remove all constituents that aren't subtypes of target type + if (type.flags & 16384 /* Union */) { return getUnionType(ts.filter(type.types, function (t) { return isTypeSubtypeOf(t, targetType); })); } return type; } + // Narrow the given type based on the given expression having the assumed boolean value. The returned type + // will be a subtype or the same type as the argument. function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 161: + case 161 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 169: + case 169 /* BinaryExpression */: var operator = expr.operatorToken.kind; - if (operator === 30 || operator === 31) { + if (operator === 30 /* EqualsEqualsEqualsToken */ || operator === 31 /* ExclamationEqualsEqualsToken */) { return narrowTypeByEquality(type, expr, assumeTrue); } - else if (operator === 48) { + else if (operator === 48 /* AmpersandAmpersandToken */) { return narrowTypeByAnd(type, expr, assumeTrue); } - else if (operator === 49) { + else if (operator === 49 /* BarBarToken */) { return narrowTypeByOr(type, expr, assumeTrue); } - else if (operator === 87) { + else if (operator === 87 /* InstanceOfKeyword */) { return narrowTypeByInstanceof(type, expr, assumeTrue); } break; - case 167: - if (expr.operator === 46) { + case 167 /* PrefixUnaryExpression */: + if (expr.operator === 46 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } break; @@ -13424,10 +15655,16 @@ var ts; } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); - 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); + // As noted in ECMAScript 6 language spec, arrow functions never have an arguments objects. + // Although in down-level emit of arrow function, we emit it using function expression which means that + // arguments objects will be bound to the inner object; emitting arrow function natively in ES6, arguments objects + // will be bound to non-arrow function that contain this arrow function. This results in inconsistent behavior. + // To avoid that we will give an error to users if they use arguments objects in arrow function so that they + // can explicitly bound arguments objects + if (symbol === argumentsSymbol && ts.getContainingFunction(node).kind === 163 /* ArrowFunction */ && languageVersion < 2 /* ES6 */) { + error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } - if (symbol.flags & 8388608 && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { + if (symbol.flags & 8388608 /* Alias */ && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { markAliasSymbolAsReferenced(symbol); } checkCollisionWithCapturedSuperVariable(node, node); @@ -13446,17 +15683,24 @@ var ts; return false; } function checkBlockScopedBindingCapturedInLoop(node, symbol) { - if (languageVersion >= 2 || - (symbol.flags & 2) === 0 || - symbol.valueDeclaration.parent.kind === 223) { + if (languageVersion >= 2 /* ES6 */ || + (symbol.flags & 2 /* BlockScopedVariable */) === 0 || + symbol.valueDeclaration.parent.kind === 223 /* CatchClause */) { return; } + // - check if binding is used in some function + // (stop the walk when reaching container of binding declaration) + // - if first check succeeded - check if variable is declared inside the loop + // nesting structure: + // (variable declaration or binding element) -> variable declaration list -> container var container = symbol.valueDeclaration; - while (container.kind !== 199) { + while (container.kind !== 199 /* VariableDeclarationList */) { container = container.parent; } + // get the parent of variable declaration list container = container.parent; - if (container.kind === 180) { + if (container.kind === 180 /* VariableStatement */) { + // if parent is variable statement - get its parent container = container.parent; } var inFunction = isInsideFunction(node.parent, container); @@ -13466,76 +15710,84 @@ var ts; if (inFunction) { grammarErrorOnFirstToken(current, ts.Diagnostics.Loop_contains_block_scoped_variable_0_referenced_by_a_function_in_the_loop_This_is_only_supported_in_ECMAScript_6_or_higher, ts.declarationNameToString(node)); } - getNodeLinks(symbol.valueDeclaration).flags |= 256; + // mark value declaration so during emit they can have a special handling + getNodeLinks(symbol.valueDeclaration).flags |= 256 /* BlockScopedBindingInLoop */; break; } current = current.parent; } } function captureLexicalThis(node, container) { - var classNode = container.parent && container.parent.kind === 201 ? container.parent : undefined; - getNodeLinks(node).flags |= 2; - if (container.kind === 132 || container.kind === 135) { - getNodeLinks(classNode).flags |= 4; + var classNode = container.parent && container.parent.kind === 201 /* ClassDeclaration */ ? container.parent : undefined; + getNodeLinks(node).flags |= 2 /* LexicalThis */; + if (container.kind === 132 /* PropertyDeclaration */ || container.kind === 135 /* Constructor */) { + getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } else { - getNodeLinks(container).flags |= 4; + getNodeLinks(container).flags |= 4 /* CaptureThis */; } } function checkThisExpression(node) { + // Stop at the first arrow function so that we can + // tell whether 'this' needs to be captured. var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; - if (container.kind === 163) { + // Now skip arrow functions to get the "real" owner of 'this'. + if (container.kind === 163 /* ArrowFunction */) { container = ts.getThisContainer(container, false); - needToCaptureLexicalThis = (languageVersion < 2); + // When targeting es6, arrow function lexically bind "this" so we do not need to do the work of binding "this" in emitted code + needToCaptureLexicalThis = (languageVersion < 2 /* ES6 */); } switch (container.kind) { - case 205: + case 205 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_body); + // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 204: + case 204 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); + // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 135: + case 135 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; - case 132: - case 131: - if (container.flags & 128) { + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + if (container.flags & 128 /* Static */) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } break; - case 127: + case 127 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } if (needToCaptureLexicalThis) { captureLexicalThis(node, container); } - var classNode = container.parent && container.parent.kind === 201 ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 201 /* ClassDeclaration */ ? container.parent : undefined; if (classNode) { var symbol = getSymbolOfNode(classNode); - return container.flags & 128 ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); + return container.flags & 128 /* Static */ ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); } return anyType; } function isInConstructorArgumentInitializer(node, constructorDecl) { for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 129) { + if (n.kind === 129 /* Parameter */) { return true; } } return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 157 && node.parent.expression === node; - var enclosingClass = ts.getAncestor(node, 201); + var isCallExpression = node.parent.kind === 157 /* CallExpression */ && node.parent.expression === node; + var enclosingClass = ts.getAncestor(node, 201 /* ClassDeclaration */); var baseClass; if (enclosingClass && ts.getClassExtendsHeritageClauseElement(enclosingClass)) { var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); - baseClass = classType.baseTypes.length && classType.baseTypes[0]; + var baseTypes = getBaseTypes(classType); + baseClass = baseTypes.length && baseTypes[0]; } if (!baseClass) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_a_derived_class); @@ -13546,55 +15798,67 @@ var ts; var canUseSuperExpression = false; var needToCaptureLexicalThis; if (isCallExpression) { - canUseSuperExpression = container.kind === 135; + // TS 1.0 SPEC (April 2014): 4.8.1 + // Super calls are only permitted in constructors of derived classes + canUseSuperExpression = container.kind === 135 /* Constructor */; } else { + // TS 1.0 SPEC (April 2014) + // 'super' property access is allowed + // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance + // - In a static member function or static member accessor + // super property access might appear in arrow functions with arbitrary deep nesting needToCaptureLexicalThis = false; - while (container && container.kind === 163) { + while (container && container.kind === 163 /* ArrowFunction */) { container = ts.getSuperContainer(container, true); - needToCaptureLexicalThis = true; + needToCaptureLexicalThis = languageVersion < 2 /* ES6 */; } - if (container && container.parent && container.parent.kind === 201) { - if (container.flags & 128) { + // topmost container must be something that is directly nested in the class declaration + if (container && container.parent && container.parent.kind === 201 /* ClassDeclaration */) { + if (container.flags & 128 /* Static */) { canUseSuperExpression = - container.kind === 134 || - container.kind === 133 || - container.kind === 136 || - container.kind === 137; + container.kind === 134 /* MethodDeclaration */ || + container.kind === 133 /* MethodSignature */ || + container.kind === 136 /* GetAccessor */ || + container.kind === 137 /* SetAccessor */; } else { canUseSuperExpression = - container.kind === 134 || - container.kind === 133 || - container.kind === 136 || - container.kind === 137 || - container.kind === 132 || - container.kind === 131 || - container.kind === 135; + container.kind === 134 /* MethodDeclaration */ || + container.kind === 133 /* MethodSignature */ || + container.kind === 136 /* GetAccessor */ || + container.kind === 137 /* SetAccessor */ || + container.kind === 132 /* PropertyDeclaration */ || + container.kind === 131 /* PropertySignature */ || + container.kind === 135 /* Constructor */; } } } if (canUseSuperExpression) { var returnType; - if ((container.flags & 128) || isCallExpression) { - getNodeLinks(node).flags |= 32; + if ((container.flags & 128 /* Static */) || isCallExpression) { + getNodeLinks(node).flags |= 32 /* SuperStatic */; returnType = getTypeOfSymbol(baseClass.symbol); } else { - getNodeLinks(node).flags |= 16; + getNodeLinks(node).flags |= 16 /* SuperInstance */; returnType = baseClass; } - if (container.kind === 135 && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 135 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); returnType = unknownType; } if (!isCallExpression && needToCaptureLexicalThis) { + // call expressions are allowed only in constructors so they should always capture correct 'this' + // super property access expressions can also appear in arrow functions - + // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } return returnType; } } - if (container.kind === 127) { + if (container && container.kind === 127 /* ComputedPropertyName */) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { @@ -13605,6 +15869,7 @@ var ts; } return unknownType; } + // Return contextual type of parameter or undefined if no contextual type is available function getContextuallyTypedParameterType(parameter) { if (isFunctionExpressionOrArrowFunction(parameter.parent)) { var func = parameter.parent; @@ -13617,6 +15882,7 @@ var ts; if (indexOfParameter < len) { return getTypeAtPosition(contextualSignature, indexOfParameter); } + // If last parameter is contextually rest parameter get its type if (indexOfParameter === (func.parameters.length - 1) && funcHasRestParameters && contextualSignature.hasRestParameter && func.parameters.length >= contextualSignature.parameters.length) { return getTypeOfSymbol(contextualSignature.parameters[contextualSignature.parameters.length - 1]); @@ -13626,13 +15892,18 @@ var ts; } return undefined; } + // In a variable, parameter or property declaration with a type annotation, the contextual type of an initializer + // expression is the type of the variable, parameter or property. Otherwise, in a parameter declaration of a + // contextually typed function expression, the contextual type of an initializer expression is the contextual type + // of the parameter. Otherwise, in a variable or parameter declaration with a binding pattern name, the contextual + // type of an initializer expression is the type implied by the binding pattern. function getContextualTypeForInitializerExpression(node) { var declaration = node.parent; if (node === declaration.initializer) { if (declaration.type) { - return getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); + return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 129) { + if (declaration.kind === 129 /* Parameter */) { var type = getContextuallyTypedParameterType(declaration); if (type) { return type; @@ -13647,9 +15918,13 @@ var ts; function getContextualTypeForReturnExpression(node) { var func = ts.getContainingFunction(node); if (func) { - if (func.type || func.kind === 135 || func.kind === 136 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(func.symbol, 137))) { + // If the containing function has a return type annotation, is a constructor, or is a get accessor whose + // corresponding set accessor has a type annotation, return statements in the function are contextually typed + if (func.type || func.kind === 135 /* Constructor */ || func.kind === 136 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(func.symbol, 137 /* SetAccessor */))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(func)); } + // Otherwise, if the containing function is contextually typed by a function type with exactly one call signature + // and that call signature is non-generic, return statements are contextually typed by the return type of the signature var signature = getContextualSignatureForFunctionLikeDeclaration(func); if (signature) { return getReturnTypeOfSignature(signature); @@ -13657,6 +15932,7 @@ var ts; } return undefined; } + // In a typed function call, an argument or substitution expression is contextually typed by the type of the corresponding parameter. function getContextualTypeForArgument(callTarget, arg) { var args = getEffectiveCallArguments(callTarget); var argIndex = ts.indexOf(args, arg); @@ -13667,7 +15943,7 @@ var ts; return undefined; } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 159) { + if (template.parent.kind === 159 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -13675,12 +15951,15 @@ var ts; function getContextualTypeForBinaryOperand(node) { var binaryExpression = node.parent; var operator = binaryExpression.operatorToken.kind; - if (operator >= 53 && operator <= 64) { + if (operator >= 53 /* FirstAssignment */ && operator <= 64 /* LastAssignment */) { + // In an assignment expression, the right operand is contextually typed by the type of the left operand. if (node === binaryExpression.right) { return checkExpression(binaryExpression.left); } } - else if (operator === 49) { + else if (operator === 49 /* BarBarToken */) { + // When an || expression has a contextual type, the operands are contextually typed by that type. When an || + // expression has no contextual type, the right operand is contextually typed by the type of the left operand. var type = getContextualType(binaryExpression); if (!type && node === binaryExpression.right) { type = checkExpression(binaryExpression.left); @@ -13689,8 +15968,11 @@ var ts; } return undefined; } + // Apply a mapping function to a contextual type and return the resulting type. If the contextual type + // is a union type, the mapping function is applied to each constituent type and a union of the resulting + // types is returned. function applyToContextualType(type, mapper) { - if (!(type.flags & 16384)) { + if (!(type.flags & 16384 /* Union */)) { return mapper(type); } var types = type.types; @@ -13722,15 +16004,21 @@ var ts; function getIndexTypeOfContextualType(type, kind) { return applyToContextualType(type, function (t) { return getIndexTypeOfObjectOrUnionType(t, kind); }); } + // Return true if the given contextual type is a tuple-like type function contextualTypeIsTupleLikeType(type) { - return !!(type.flags & 16384 ? ts.forEach(type.types, isTupleLikeType) : isTupleLikeType(type)); + return !!(type.flags & 16384 /* Union */ ? ts.forEach(type.types, isTupleLikeType) : isTupleLikeType(type)); } + // Return true if the given contextual type provides an index signature of the given kind 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 /* Union */ ? ts.forEach(type.types, function (t) { return getIndexTypeOfObjectOrUnionType(t, kind); }) : getIndexTypeOfObjectOrUnionType(type, kind)); } + // In an object literal contextually typed by a type T, the contextual type of a property assignment is the type of + // the matching property in T, if one exists. Otherwise, it is the type of the numeric index signature in T, if one + // exists. Otherwise, it is the type of the string index signature in T, if one exists. function getContextualTypeForObjectLiteralMethod(node) { ts.Debug.assert(ts.isObjectLiteralMethod(node)); if (isInsideWithStatementBody(node)) { + // We cannot answer semantic questions within a with block, do not proceed any further return undefined; } return getContextualTypeForObjectLiteralElement(node); @@ -13740,34 +16028,45 @@ var ts; var type = getContextualType(objectLiteral); if (type) { if (!ts.hasDynamicName(element)) { + // For a (non-symbol) computed property, there is no reason to look up the name + // in the type. It will just be "__computed", which does not appear in any + // SymbolTable. var symbolName = getSymbolOfNode(element).name; var propertyType = getTypeOfPropertyOfContextualType(type, symbolName); if (propertyType) { return propertyType; } } - return isNumericName(element.name) && getIndexTypeOfContextualType(type, 1) || - getIndexTypeOfContextualType(type, 0); + return isNumericName(element.name) && getIndexTypeOfContextualType(type, 1 /* Number */) || + getIndexTypeOfContextualType(type, 0 /* String */); } return undefined; } + // In an array literal contextually typed by a type T, the contextual type of an element expression at index N is + // the type of the property with the numeric name N in T, if one exists. Otherwise, if T has a numeric index signature, + // it is the type of the numeric index signature in T. Otherwise, in ES6 and higher, the contextual type is the iterated + // type of T. function getContextualTypeForElementExpression(node) { var arrayLiteral = node.parent; 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); + || getIndexTypeOfContextualType(type, 1 /* Number */) + || (languageVersion >= 2 /* ES6 */ ? checkIteratedType(type, undefined) : undefined); } return undefined; } + // In a contextually typed conditional expression, the true/false expressions are contextually typed by the same type. function getContextualTypeForConditionalOperand(node) { var conditional = node.parent; return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined; } + // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily + // be "pushed" onto a node using the contextualType property. function getContextualType(node) { if (isInsideWithStatementBody(node)) { + // We cannot answer semantic questions within a with block, do not proceed any further return undefined; } if (node.contextualType) { @@ -13775,38 +16074,40 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 198: - case 129: - case 132: - case 131: - case 152: + case 198 /* VariableDeclaration */: + case 129 /* Parameter */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 152 /* BindingElement */: return getContextualTypeForInitializerExpression(node); - case 163: - case 191: + case 163 /* ArrowFunction */: + case 191 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 157: - case 158: + case 157 /* CallExpression */: + case 158 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 160: - return getTypeFromTypeNodeOrHeritageClauseElement(parent.type); - case 169: + case 160 /* TypeAssertionExpression */: + return getTypeFromTypeNode(parent.type); + case 169 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node); - case 224: + case 224 /* PropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent); - case 153: + case 153 /* ArrayLiteralExpression */: return getContextualTypeForElementExpression(node); - case 170: + case 170 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node); - case 176: - ts.Debug.assert(parent.parent.kind === 171); + case 176 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 171 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 161: + case 161 /* ParenthesizedExpression */: return getContextualType(parent); } return undefined; } + // If the given type is an object or union type, if that type has a single signature, and if + // that signature is non-generic, return the signature. Otherwise return undefined. function getNonGenericSignature(type) { - var signatures = getSignaturesOfObjectOrUnionType(type, 0); + var signatures = getSignaturesOfObjectOrUnionType(type, 0 /* Call */); if (signatures.length === 1) { var signature = signatures[0]; if (!signature.typeParameters) { @@ -13815,74 +16116,94 @@ var ts; } } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 162 || node.kind === 163; + return node.kind === 162 /* FunctionExpression */ || node.kind === 163 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { + // Only function expressions and arrow functions are contextually typed. return isFunctionExpressionOrArrowFunction(node) ? getContextualSignature(node) : undefined; } + // Return the contextual signature for a given expression node. A contextual type provides a + // contextual signature if it has a single call signature and if that call signature is non-generic. + // If the contextual type is a union type, get the signature from each type possible and if they are + // all identical ignoring their return type, the result is same signature but with return type as + // union type of return types from these signatures function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 134 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var type = ts.isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node) : getContextualType(node); if (!type) { return undefined; } - if (!(type.flags & 16384)) { + if (!(type.flags & 16384 /* Union */)) { return getNonGenericSignature(type); } var signatureList; var types = type.types; for (var _i = 0; _i < types.length; _i++) { var current = types[_i]; + // The signature set of all constituent type with call signatures should match + // So number of signatures allowed is either 0 or 1 if (signatureList && - getSignaturesOfObjectOrUnionType(current, 0).length > 1) { + getSignaturesOfObjectOrUnionType(current, 0 /* Call */).length > 1) { return undefined; } var signature = getNonGenericSignature(current); if (signature) { if (!signatureList) { + // This signature will contribute to contextual union signature signatureList = [signature]; } else if (!compareSignatures(signatureList[0], signature, false, compareTypes)) { + // Signatures aren't identical, do not use return undefined; } else { + // Use this signature for contextual union signature signatureList.push(signature); } } } + // Result is union of signatures collected (return type is union of return types of this signature set) var result; if (signatureList) { result = cloneSignature(signatureList[0]); + // Clear resolved return type we possibly got from cloneSignature result.resolvedReturnType = undefined; result.unionSignatures = signatureList; } return result; } + // Presence of a contextual type mapper indicates inferential typing, except the identityMapper object is + // used as a special marker for other purposes. function isInferentialContext(mapper) { return mapper && mapper !== identityMapper; } + // A node is an assignment target if it is on the left hand side of an '=' token, if it is parented by a property + // assignment in an object literal that is an assignment target, or if it is parented by an array literal that is + // an assignment target. Examples include 'a = xxx', '{ p: a } = xxx', '[{ p: a}] = xxx'. function isAssignmentTarget(node) { var parent = node.parent; - if (parent.kind === 169 && parent.operatorToken.kind === 53 && parent.left === node) { + if (parent.kind === 169 /* BinaryExpression */ && parent.operatorToken.kind === 53 /* EqualsToken */ && parent.left === node) { return true; } - if (parent.kind === 224) { + if (parent.kind === 224 /* PropertyAssignment */) { return isAssignmentTarget(parent.parent); } - if (parent.kind === 153) { + if (parent.kind === 153 /* ArrayLiteralExpression */) { return isAssignmentTarget(parent); } return false; } function checkSpreadElementExpression(node, contextualMapper) { - var type = checkExpressionCached(node.expression, contextualMapper); - if (!isArrayLikeType(type)) { - error(node.expression, ts.Diagnostics.Type_0_is_not_an_array_type, typeToString(type)); - return unknownType; - } - return type; + // It is usually not safe to call checkExpressionCached if we can be contextually typing. + // You can tell that we are contextually typing because of the contextualMapper parameter. + // While it is true that a spread element can have a contextual type, it does not do anything + // with this type. It is neither affected by it, nor does it propagate it to its operand. + // So the fact that contextualMapper is passed is not important, because the operand of a spread + // element is not contextually typed. + var arrayOrIterableType = checkExpressionCached(node.expression, contextualMapper); + return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, false); } function checkArrayLiteral(node, contextualMapper) { var elements = node.elements; @@ -13891,38 +16212,82 @@ var ts; } var hasSpreadElement = false; var elementTypes = []; - ts.forEach(elements, function (e) { - var type = checkExpression(e, contextualMapper); - if (e.kind === 173) { - elementTypes.push(getIndexTypeOfType(type, 1) || anyType); - hasSpreadElement = true; + var inDestructuringPattern = isAssignmentTarget(node); + for (var _i = 0; _i < elements.length; _i++) { + var e = elements[_i]; + if (inDestructuringPattern && e.kind === 173 /* SpreadElementExpression */) { + // Given the following situation: + // var c: {}; + // [...c] = ["", 0]; + // + // c is represented in the tree as a spread element in an array literal. + // But c really functions as a rest element, and its purpose is to provide + // a contextual type for the right hand side of the assignment. Therefore, + // instead of calling checkExpression on "...c", which will give an error + // if c is not iterable/array-like, we need to act as if we are trying to + // get the contextual element type from it. So we do something similar to + // getContextualTypeForElementExpression, which will crucially not error + // if there is no index type / iterated type. + var restArrayType = checkExpression(e.expression, contextualMapper); + var restElementType = getIndexTypeOfType(restArrayType, 1 /* Number */) || + (languageVersion >= 2 /* ES6 */ ? checkIteratedType(restArrayType, undefined) : undefined); + if (restElementType) { + elementTypes.push(restElementType); + } } else { + var type = checkExpression(e, contextualMapper); elementTypes.push(type); } - }); + hasSpreadElement = hasSpreadElement || e.kind === 173 /* SpreadElementExpression */; + } if (!hasSpreadElement) { var contextualType = getContextualType(node); - if (contextualType && contextualTypeIsTupleLikeType(contextualType) || isAssignmentTarget(node)) { + if (contextualType && contextualTypeIsTupleLikeType(contextualType) || inDestructuringPattern) { return createTupleType(elementTypes); } } return createArrayType(getUnionType(elementTypes)); } function isNumericName(name) { - return name.kind === 127 ? isNumericComputedName(name) : isNumericLiteralName(name.text); + return name.kind === 127 /* ComputedPropertyName */ ? isNumericComputedName(name) : isNumericLiteralName(name.text); } function isNumericComputedName(name) { - return allConstituentTypesHaveKind(checkComputedPropertyName(name), 1 | 132); + // It seems odd to consider an expression of type Any to result in a numeric name, + // but this behavior is consistent with checkIndexedAccess + return allConstituentTypesHaveKind(checkComputedPropertyName(name), 1 /* Any */ | 132 /* NumberLike */); } function isNumericLiteralName(name) { + // The intent of numeric names is that + // - they are names with text in a numeric form, and that + // - setting properties/indexing with them is always equivalent to doing so with the numeric literal 'numLit', + // acquired by applying the abstract 'ToNumber' operation on the name's text. + // + // The subtlety is in the latter portion, as we cannot reliably say that anything that looks like a numeric literal is a numeric name. + // In fact, it is the case that the text of the name must be equal to 'ToString(numLit)' for this to hold. + // + // Consider the property name '"0xF00D"'. When one indexes with '0xF00D', they are actually indexing with the value of 'ToString(0xF00D)' + // according to the ECMAScript specification, so it is actually as if the user indexed with the string '"61453"'. + // Thus, the text of all numeric literals equivalent to '61543' such as '0xF00D', '0xf00D', '0170015', etc. are not valid numeric names + // because their 'ToString' representation is not equal to their original text. + // This is motivated by ECMA-262 sections 9.3.1, 9.8.1, 11.1.5, and 11.2.1. + // + // Here, we test whether 'ToString(ToNumber(name))' is exactly equal to 'name'. + // The '+' prefix operator is equivalent here to applying the abstract ToNumber operation. + // Applying the 'toString()' method on a number gives us the abstract ToString operation on a number. + // + // Note that this accepts the values 'Infinity', '-Infinity', and 'NaN', and that this is intentional. + // This is desired behavior, because when indexing with them as numeric entities, you are indexing + // with the strings '"Infinity"', '"-Infinity"', and '"NaN"' respectively. return (+name).toString() === name; } function checkComputedPropertyName(node) { var links = getNodeLinks(node.expression); if (!links.resolvedType) { links.resolvedType = checkExpression(node.expression); - if (!allConstituentTypesHaveKind(links.resolvedType, 1 | 132 | 258 | 1048576)) { + // This will allow types number, string, symbol or any. It will also allow enums, the unknown + // type, and any union of these types (like string | number). + if (!allConstituentTypesHaveKind(links.resolvedType, 1 /* Any */ | 132 /* NumberLike */ | 258 /* StringLike */ | 1048576 /* ESSymbol */)) { error(node, ts.Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any); } else { @@ -13932,6 +16297,7 @@ var ts; return links.resolvedType; } function checkObjectLiteral(node, contextualMapper) { + // Grammar checking checkGrammarObjectLiteralExpression(node); var propertiesTable = {}; var propertiesArray = []; @@ -13940,24 +16306,22 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var memberDecl = _a[_i]; var member = memberDecl.symbol; - if (memberDecl.kind === 224 || - memberDecl.kind === 225 || + if (memberDecl.kind === 224 /* PropertyAssignment */ || + memberDecl.kind === 225 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { var type = void 0; - if (memberDecl.kind === 224) { + if (memberDecl.kind === 224 /* PropertyAssignment */) { type = checkPropertyAssignment(memberDecl, contextualMapper); } - else if (memberDecl.kind === 134) { + else if (memberDecl.kind === 134 /* MethodDeclaration */) { type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { - ts.Debug.assert(memberDecl.kind === 225); - type = memberDecl.name.kind === 127 - ? unknownType - : checkExpression(memberDecl.name, contextualMapper); + ts.Debug.assert(memberDecl.kind === 225 /* ShorthandPropertyAssignment */); + type = checkExpression(memberDecl.name, contextualMapper); } typeFlags |= type.flags; - var prop = createSymbol(4 | 67108864 | member.flags, member.name); + var prop = createSymbol(4 /* Property */ | 67108864 /* Transient */ | member.flags, member.name); prop.declarations = member.declarations; prop.parent = member.parent; if (member.valueDeclaration) { @@ -13968,7 +16332,12 @@ var ts; member = prop; } else { - ts.Debug.assert(memberDecl.kind === 136 || memberDecl.kind === 137); + // TypeScript 1.0 spec (April 2014) + // A get accessor declaration is processed in the same manner as + // an ordinary function declaration(section 6.1) with no parameters. + // A set accessor declaration is processed in the same manner + // as an ordinary function declaration with a single parameter and a Void return type. + ts.Debug.assert(memberDecl.kind === 136 /* GetAccessor */ || memberDecl.kind === 137 /* SetAccessor */); checkAccessorDeclaration(memberDecl); } if (!ts.hasDynamicName(memberDecl)) { @@ -13976,17 +16345,21 @@ var ts; } propertiesArray.push(member); } - var stringIndexType = getIndexType(0); - var numberIndexType = getIndexType(1); + var stringIndexType = getIndexType(0 /* String */); + var numberIndexType = getIndexType(1 /* Number */); var result = createAnonymousType(node.symbol, propertiesTable, emptyArray, emptyArray, stringIndexType, numberIndexType); - result.flags |= 131072 | 524288 | (typeFlags & 262144); + result.flags |= 131072 /* ObjectLiteral */ | 524288 /* ContainsObjectLiteral */ | (typeFlags & 262144 /* ContainsUndefinedOrNull */); return result; function getIndexType(kind) { if (contextualType && contextualTypeHasIndexSignature(contextualType, kind)) { var propTypes = []; for (var i = 0; i < propertiesArray.length; i++) { var propertyDecl = node.properties[i]; - if (kind === 0 || isNumericName(propertyDecl.name)) { + if (kind === 0 /* String */ || isNumericName(propertyDecl.name)) { + // Do not call getSymbolOfNode(propertyDecl), as that will get the + // original symbol for the node. We actually want to get the symbol + // created by checkObjectLiteral, since that will be appropriately + // contextually typed and resolved. var type = getTypeOfSymbol(propertiesArray[i]); if (!ts.contains(propTypes, type)) { propTypes.push(type); @@ -14000,37 +16373,48 @@ var ts; return undefined; } } + // If a symbol is a synthesized symbol with no value declaration, we assume it is a property. Example of this are the synthesized + // '.prototype' property as well as synthesized tuple index properties. function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 132; + return s.valueDeclaration ? s.valueDeclaration.kind : 132 /* PropertyDeclaration */; } function getDeclarationFlagsFromSymbol(s) { - return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : s.flags & 134217728 ? 16 | 128 : 0; + return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : s.flags & 134217728 /* Prototype */ ? 16 /* Public */ | 128 /* Static */ : 0; } function checkClassPropertyAccess(node, left, type, prop) { var flags = getDeclarationFlagsFromSymbol(prop); - if (!(flags & (32 | 64))) { + // Public properties are always accessible + if (!(flags & (32 /* Private */ | 64 /* Protected */))) { return; } - var enclosingClassDeclaration = ts.getAncestor(node, 201); + // Property is known to be private or protected at this point + // Get the declaring and enclosing class instance types + var enclosingClassDeclaration = ts.getAncestor(node, 201 /* ClassDeclaration */); var enclosingClass = enclosingClassDeclaration ? getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClassDeclaration)) : undefined; var declaringClass = getDeclaredTypeOfSymbol(prop.parent); - if (flags & 32) { + // Private property is accessible if declaring and enclosing class are the same + if (flags & 32 /* Private */) { if (declaringClass !== enclosingClass) { error(node, ts.Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(declaringClass)); } return; } - if (left.kind === 91) { + // Property is known to be protected at this point + // All protected properties of a supertype are accessible in a super access + if (left.kind === 91 /* SuperKeyword */) { return; } + // A protected property is accessible in the declaring class and classes derived from it if (!enclosingClass || !hasBaseType(enclosingClass, declaringClass)) { error(node, ts.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(declaringClass)); return; } - if (flags & 128) { + // No further restrictions for static properties + if (flags & 128 /* Static */) { return; } - if (!(getTargetType(type).flags & (1024 | 2048) && hasBaseType(type, enclosingClass))) { + // An instance property must be accessed through an instance of the enclosing class + if (!(getTargetType(type).flags & (1024 /* Class */ | 2048 /* Interface */) && hasBaseType(type, enclosingClass))) { error(node, ts.Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1, symbolToString(prop), typeToString(enclosingClass)); } } @@ -14047,6 +16431,7 @@ var ts; if (type !== anyType) { var apparentType = getApparentType(getWidenedType(type)); if (apparentType === unknownType) { + // handle cases when type is Type parameter with invalid constraint return unknownType; } var prop = getPropertyOfType(apparentType, right.text); @@ -14057,8 +16442,15 @@ var ts; return unknownType; } getNodeLinks(node).resolvedSymbol = prop; - if (prop.parent && prop.parent.flags & 32) { - if (left.kind === 91 && getDeclarationKindFromSymbol(prop) !== 134) { + if (prop.parent && prop.parent.flags & 32 /* Class */) { + // TS 1.0 spec (April 2014): 4.8.2 + // - In a constructor, instance member function, instance member accessor, or + // instance member variable initializer where this references a derived class instance, + // a super property access is permitted and must specify a public instance member function of the base class. + // - In a static member function or static member accessor + // where this references the constructor function object of a derived class, + // a super property access is permitted and must specify a public static member function of the base class. + if (left.kind === 91 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 134 /* MethodDeclaration */) { error(right, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); } else { @@ -14070,14 +16462,14 @@ var ts; return anyType; } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 155 + var left = node.kind === 155 /* PropertyAccessExpression */ ? node.expression : node.left; var type = checkExpressionOrQualifiedName(left); if (type !== unknownType && type !== anyType) { var prop = getPropertyOfType(getWidenedType(type), propertyName); - if (prop && prop.parent && prop.parent.flags & 32) { - if (left.kind === 91 && getDeclarationKindFromSymbol(prop) !== 134) { + if (prop && prop.parent && prop.parent.flags & 32 /* Class */) { + if (left.kind === 91 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 134 /* MethodDeclaration */) { return false; } else { @@ -14090,9 +16482,10 @@ var ts; return true; } function checkIndexedAccess(node) { + // Grammar checking if (!node.argumentExpression) { var sourceFile = getSourceFile(node); - if (node.parent.kind === 158 && node.parent.expression === node) { + if (node.parent.kind === 158 /* NewExpression */ && node.parent.expression === node) { var start = ts.skipTrivia(sourceFile.text, node.expression.end); var end = node.end; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); @@ -14103,6 +16496,7 @@ var ts; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Expression_expected); } } + // Obtain base constraint such that we can bail out if the constraint is an unknown type var objectType = getApparentType(checkExpression(node.expression)); var indexType = node.argumentExpression ? checkExpression(node.argumentExpression) : unknownType; if (objectType === unknownType) { @@ -14110,10 +16504,19 @@ var ts; } var isConstEnum = isConstEnumObjectType(objectType); if (isConstEnum && - (!node.argumentExpression || node.argumentExpression.kind !== 8)) { + (!node.argumentExpression || node.argumentExpression.kind !== 8 /* StringLiteral */)) { error(node.argumentExpression, ts.Diagnostics.A_const_enum_member_can_only_be_accessed_using_a_string_literal); return unknownType; } + // TypeScript 1.0 spec (April 2014): 4.10 Property Access + // - If IndexExpr is a string literal or a numeric literal and ObjExpr's apparent type has a property with the name + // given by that literal(converted to its string representation in the case of a numeric literal), the property access is of the type of that property. + // - Otherwise, if ObjExpr's apparent type has a numeric index signature and IndexExpr is of type Any, the Number primitive type, or an enum type, + // the property access is of the type of that index signature. + // - Otherwise, if ObjExpr's apparent type has a string index signature and IndexExpr is of type Any, the String or Number primitive type, or an enum type, + // the property access is of the type of that index signature. + // - Otherwise, if IndexExpr is of type Any, the String or Number primitive type, or an enum type, the property access is of type Any. + // See if we can index as a property. if (node.argumentExpression) { var name_6 = getPropertyNameForIndexedAccess(node.argumentExpression, indexType); if (name_6 !== undefined) { @@ -14128,27 +16531,38 @@ var ts; } } } - if (allConstituentTypesHaveKind(indexType, 1 | 258 | 132 | 1048576)) { - if (allConstituentTypesHaveKind(indexType, 1 | 132)) { - var numberIndexType = getIndexTypeOfType(objectType, 1); + // Check for compatible indexer types. + if (allConstituentTypesHaveKind(indexType, 1 /* Any */ | 258 /* StringLike */ | 132 /* NumberLike */ | 1048576 /* ESSymbol */)) { + // Try to use a number indexer. + if (allConstituentTypesHaveKind(indexType, 1 /* Any */ | 132 /* NumberLike */)) { + var numberIndexType = getIndexTypeOfType(objectType, 1 /* Number */); if (numberIndexType) { return numberIndexType; } } - var stringIndexType = getIndexTypeOfType(objectType, 0); + // Try to use string indexing. + var stringIndexType = getIndexTypeOfType(objectType, 0 /* String */); if (stringIndexType) { return stringIndexType; } + // Fall back to any. if (compilerOptions.noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors && objectType !== anyType) { error(node, ts.Diagnostics.Index_signature_of_object_type_implicitly_has_an_any_type); } return anyType; } + // REVIEW: Users should know the type that was actually used. error(node, ts.Diagnostics.An_index_expression_argument_must_be_of_type_string_number_symbol_or_any); return unknownType; } + /** + * If indexArgumentExpression is a string literal or number literal, returns its text. + * If indexArgumentExpression is a well known symbol, returns the property name corresponding + * to this symbol, as long as it is a proper symbol reference. + * Otherwise, returns undefined. + */ function getPropertyNameForIndexedAccess(indexArgumentExpression, indexArgumentType) { - if (indexArgumentExpression.kind === 8 || indexArgumentExpression.kind === 7) { + if (indexArgumentExpression.kind === 8 /* StringLiteral */ || indexArgumentExpression.kind === 7 /* NumericLiteral */) { return indexArgumentExpression.text; } if (checkThatExpressionIsProperSymbolReference(indexArgumentExpression, indexArgumentType, false)) { @@ -14157,19 +16571,30 @@ var ts; } return undefined; } + /** + * A proper symbol reference requires the following: + * 1. The property access denotes a property that exists + * 2. The expression is of the form Symbol. + * 3. The property access is of the primitive type symbol. + * 4. Symbol in this context resolves to the global Symbol object + */ function checkThatExpressionIsProperSymbolReference(expression, expressionType, reportError) { if (expressionType === unknownType) { + // There is already an error, so no need to report one. return false; } if (!ts.isWellKnownSymbolSyntactically(expression)) { return false; } - if ((expressionType.flags & 1048576) === 0) { + // Make sure the property type is the primitive symbol type + if ((expressionType.flags & 1048576 /* ESSymbol */) === 0) { if (reportError) { error(expression, ts.Diagnostics.A_computed_property_name_of_the_form_0_must_be_of_type_symbol, ts.getTextOfNode(expression)); } return false; } + // The name is Symbol., so make sure Symbol actually resolves to the + // global Symbol object var leftHandSide = expression.expression; var leftHandSideSymbol = getResolvedSymbol(leftHandSide); if (!leftHandSideSymbol) { @@ -14177,6 +16602,7 @@ var ts; } var globalESSymbol = getGlobalESSymbolConstructorSymbol(); if (!globalESSymbol) { + // Already errored when we tried to look up the symbol return false; } if (leftHandSideSymbol !== globalESSymbol) { @@ -14188,7 +16614,7 @@ var ts; return true; } function resolveUntypedCall(node) { - if (node.kind === 159) { + if (node.kind === 159 /* TaggedTemplateExpression */) { checkExpression(node.template); } else { @@ -14202,6 +16628,14 @@ var ts; resolveUntypedCall(node); return unknownSignature; } + // Re-order candidate signatures into the result array. Assumes the result array to be empty. + // The candidate list orders groups in reverse, but within a group signatures are kept in declaration order + // A nit here is that we reorder only signatures that belong to the same symbol, + // so order how inherited signatures are processed is still preserved. + // interface A { (x: string): void } + // interface B extends A { (x: 'foo'): string } + // let b: B; + // b('foo') // <- here overloads should be processed as [(x:'foo'): string, (x: string): void] function reorderCandidates(signatures, result) { var lastParent; var lastSymbol; @@ -14224,13 +16658,20 @@ var ts; } } else { + // current declaration belongs to a different symbol + // set cutoffIndex so re-orderings in the future won't change result set from 0 to cutoffIndex index = cutoffIndex = result.length; lastParent = parent_4; } lastSymbol = symbol; + // specialized signatures always need to be placed before non-specialized signatures regardless + // of the cutoff position; see GH#1133 if (signature.hasStringLiterals) { specializedIndex++; spliceIndex = specializedIndex; + // The cutoff index always needs to be greater than or equal to the specialized signature index + // in order to prevent non-specialized signatures from being added before a specialized + // signature. cutoffIndex++; } else { @@ -14241,59 +16682,76 @@ var ts; } function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { - if (args[i].kind === 173) { + if (args[i].kind === 173 /* SpreadElementExpression */) { return i; } } return -1; } function hasCorrectArity(node, args, signature) { - var adjustedArgCount; - var typeArguments; - var callIsIncomplete; - if (node.kind === 159) { + var adjustedArgCount; // Apparent number of arguments we will have in this call + var typeArguments; // Type arguments (undefined if none) + var callIsIncomplete; // In incomplete call we want to be lenient when we have too few arguments + if (node.kind === 159 /* TaggedTemplateExpression */) { var tagExpression = node; + // Even if the call is incomplete, we'll have a missing expression as our last argument, + // so we can say the count is just the arg list length adjustedArgCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 171) { + if (tagExpression.template.kind === 171 /* TemplateExpression */) { + // If a tagged template expression lacks a tail literal, the call is incomplete. + // Specifically, a template only can end in a TemplateTail or a Missing literal. var templateExpression = tagExpression.template; var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans); - ts.Debug.assert(lastSpan !== undefined); + ts.Debug.assert(lastSpan !== undefined); // we should always have at least one span. callIsIncomplete = ts.nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated; } else { + // If the template didn't end in a backtick, or its beginning occurred right prior to EOF, + // then this might actually turn out to be a TemplateHead in the future; + // so we consider the call to be incomplete. var templateLiteral = tagExpression.template; - ts.Debug.assert(templateLiteral.kind === 10); + ts.Debug.assert(templateLiteral.kind === 10 /* NoSubstitutionTemplateLiteral */); callIsIncomplete = !!templateLiteral.isUnterminated; } } else { var callExpression = node; if (!callExpression.arguments) { - ts.Debug.assert(callExpression.kind === 158); + // This only happens when we have something of the form: 'new C' + ts.Debug.assert(callExpression.kind === 158 /* NewExpression */); return signature.minArgumentCount === 0; } + // For IDE scenarios we may have an incomplete call, so a trailing comma is tantamount to adding another argument. adjustedArgCount = callExpression.arguments.hasTrailingComma ? args.length + 1 : args.length; + // If we are missing the close paren, the call is incomplete. callIsIncomplete = callExpression.arguments.end === callExpression.end; typeArguments = callExpression.typeArguments; } + // If the user supplied type arguments, but the number of type arguments does not match + // the declared number of type parameters, the call has an incorrect arity. var hasRightNumberOfTypeArgs = !typeArguments || (signature.typeParameters && typeArguments.length === signature.typeParameters.length); if (!hasRightNumberOfTypeArgs) { return false; } + // If spread arguments are present, check that they correspond to a rest parameter. If so, no + // further checking is necessary. var spreadArgIndex = getSpreadArgumentIndex(args); if (spreadArgIndex >= 0) { return signature.hasRestParameter && spreadArgIndex >= signature.parameters.length - 1; } + // Too many arguments implies incorrect arity. if (!signature.hasRestParameter && adjustedArgCount > signature.parameters.length) { return false; } + // If the call is incomplete, we should skip the lower bound check. var hasEnoughArguments = adjustedArgCount >= signature.minArgumentCount; return callIsIncomplete || hasEnoughArguments; } + // If type has a single call signature and no other members, return that signature. Otherwise, return undefined. function getSingleCallSignature(type) { - if (type.flags & 48128) { + if (type.flags & 48128 /* ObjectType */) { var resolved = resolveObjectOrUnionTypeMembers(type); if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 && resolved.properties.length === 0 && !resolved.stringIndexType && !resolved.numberIndexType) { @@ -14302,9 +16760,11 @@ var ts; } return undefined; } + // Instantiate a generic signature in the context of a non-generic signature (section 3.8.5 in TypeScript spec) function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper) { var context = createInferenceContext(signature.typeParameters, true); forEachMatchingParameterType(contextualSignature, signature, function (source, target) { + // Type parameters from outer context referenced by source type are fixed by instantiation of the source type inferTypes(context, instantiateType(source, contextualMapper), target); }); return getSignatureInstantiation(signature, getInferredTypes(context)); @@ -14312,34 +16772,54 @@ var ts; function inferTypeArguments(signature, args, excludeArgument, context) { var typeParameters = signature.typeParameters; var inferenceMapper = createInferenceMapper(context); + // Clear out all the inference results from the last time inferTypeArguments was called on this context for (var i = 0; i < typeParameters.length; i++) { + // As an optimization, we don't have to clear (and later recompute) inferred types + // for type parameters that have already been fixed on the previous call to inferTypeArguments. + // It would be just as correct to reset all of them. But then we'd be repeating the same work + // for the type parameters that were fixed, namely the work done by getInferredType. if (!context.inferences[i].isFixed) { context.inferredTypes[i] = undefined; } } + // On this call to inferTypeArguments, we may get more inferences for certain type parameters that were not + // fixed last time. This means that a type parameter that failed inference last time may succeed this time, + // or vice versa. Therefore, the failedTypeParameterIndex is useless if it points to an unfixed type parameter, + // because it may change. So here we reset it. However, getInferredType will not revisit any type parameters + // that were previously fixed. So if a fixed type parameter failed previously, it will fail again because + // it will contain the exact same set of inferences. So if we reset the index from a fixed type parameter, + // we will lose information that we won't recover this time around. if (context.failedTypeParameterIndex !== undefined && !context.inferences[context.failedTypeParameterIndex].isFixed) { context.failedTypeParameterIndex = undefined; } + // We perform two passes over the arguments. In the first pass we infer from all arguments, but use + // wildcards for all context sensitive function expressions. for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg.kind !== 175) { - var paramType = getTypeAtPosition(signature, arg.kind === 173 ? -1 : i); + if (arg.kind !== 175 /* OmittedExpression */) { + var paramType = getTypeAtPosition(signature, i); var argType = void 0; - if (i === 0 && args[i].parent.kind === 159) { + if (i === 0 && args[i].parent.kind === 159 /* TaggedTemplateExpression */) { argType = globalTemplateStringsArrayType; } else { + // For context sensitive arguments we pass the identityMapper, which is a signal to treat all + // context sensitive function expressions as wildcards var mapper = excludeArgument && excludeArgument[i] !== undefined ? identityMapper : inferenceMapper; argType = checkExpressionWithContextualType(arg, paramType, mapper); } inferTypes(context, argType, paramType); } } + // In the second pass we visit only context sensitive arguments, and only those that aren't excluded, this + // time treating function expressions normally (which may cause previously inferred type arguments to be fixed + // as we construct types for contextually typed parameters) if (excludeArgument) { for (var i = 0; i < args.length; i++) { + // No need to check for omitted args and template expressions, their exlusion value is always undefined if (excludeArgument[i] === false) { var arg = args[i]; - var paramType = getTypeAtPosition(signature, arg.kind === 173 ? -1 : i); + var paramType = getTypeAtPosition(signature, i); inferTypes(context, checkExpressionWithContextualType(arg, paramType, inferenceMapper), paramType); } } @@ -14351,9 +16831,10 @@ var ts; var typeArgumentsAreAssignable = true; for (var i = 0; i < typeParameters.length; i++) { var typeArgNode = typeArguments[i]; - var typeArgument = getTypeFromTypeNodeOrHeritageClauseElement(typeArgNode); + var typeArgument = getTypeFromTypeNode(typeArgNode); + // Do not push on this array! It has a preallocated length typeArgumentResultTypes[i] = typeArgument; - if (typeArgumentsAreAssignable) { + if (typeArgumentsAreAssignable /* so far */) { var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { typeArgumentsAreAssignable = checkTypeAssignableTo(typeArgument, constraint, reportErrors ? typeArgNode : undefined, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); @@ -14365,11 +16846,17 @@ var ts; function checkApplicableSignature(node, args, signature, relation, excludeArgument, reportErrors) { for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg.kind !== 175) { - 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 (arg.kind !== 175 /* OmittedExpression */) { + // Check spread elements against rest type (from arity check we know spread argument corresponds to a rest parameter) + var paramType = getTypeAtPosition(signature, i); + // A tagged template expression provides a special first argument, and string literals get string literal types + // unless we're reporting errors + var argType = i === 0 && node.kind === 159 /* TaggedTemplateExpression */ + ? globalTemplateStringsArrayType + : arg.kind === 8 /* StringLiteral */ && !reportErrors + ? getStringLiteralType(arg) + : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); + // Use argument expression as error location when reporting errors if (!checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1)) { return false; } @@ -14377,12 +16864,19 @@ var ts; } return true; } + /** + * Returns the effective arguments for an expression that works like a function invocation. + * + * If 'node' is a CallExpression or a NewExpression, then its argument list is returned. + * If 'node' is a TaggedTemplateExpression, a new argument list is constructed from the substitution + * expressions, where the first element of the list is the template for error reporting purposes. + */ function getEffectiveCallArguments(node) { var args; - if (node.kind === 159) { + if (node.kind === 159 /* TaggedTemplateExpression */) { var template = node.template; args = [template]; - if (template.kind === 171) { + if (template.kind === 171 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args.push(span.expression); }); @@ -14393,32 +16887,56 @@ var ts; } return args; } + /** + * In a 'super' call, type arguments are not provided within the CallExpression node itself. + * Instead, they must be fetched from the class declaration's base type node. + * + * If 'node' is a 'super' call (e.g. super(...), new super(...)), then we attempt to fetch + * the type arguments off the containing class's first heritage clause (if one exists). Note that if + * type arguments are supplied on the 'super' call, they are ignored (though this is syntactically incorrect). + * + * In all other cases, the call's explicit type arguments are returned. + */ function getEffectiveTypeArguments(callExpression) { - if (callExpression.expression.kind === 91) { - var containingClass = ts.getAncestor(callExpression, 201); + if (callExpression.expression.kind === 91 /* SuperKeyword */) { + var containingClass = ts.getAncestor(callExpression, 201 /* ClassDeclaration */); var baseClassTypeNode = containingClass && ts.getClassExtendsHeritageClauseElement(containingClass); return baseClassTypeNode && baseClassTypeNode.typeArguments; } else { + // Ordinary case - simple function invocation. return callExpression.typeArguments; } } function resolveCall(node, signatures, candidatesOutArray) { - var isTaggedTemplate = node.kind === 159; + var isTaggedTemplate = node.kind === 159 /* TaggedTemplateExpression */; var typeArguments; if (!isTaggedTemplate) { typeArguments = getEffectiveTypeArguments(node); - if (node.expression.kind !== 91) { + // We already perform checking on the type arguments on the class declaration itself. + if (node.expression.kind !== 91 /* SuperKeyword */) { ts.forEach(typeArguments, checkSourceElement); } } var candidates = candidatesOutArray || []; + // reorderCandidates fills up the candidates array directly reorderCandidates(signatures, candidates); if (!candidates.length) { error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); return resolveErrorCall(node); } var args = getEffectiveCallArguments(node); + // The following applies to any value of 'excludeArgument[i]': + // - true: the argument at 'i' is susceptible to a one-time permanent contextual typing. + // - undefined: the argument at 'i' is *not* susceptible to permanent contextual typing. + // - false: the argument at 'i' *was* and *has been* permanently contextually typed. + // + // The idea is that we will perform type argument inference & assignability checking once + // without using the susceptible parameters that are functions, and once more for each of those + // parameters, contextually typing each as we go along. + // + // For a tagged template, then the first argument be 'undefined' if necessary + // because it represents a TemplateStringsArray. var excludeArgument; for (var i = isTaggedTemplate ? 1 : 0; i < args.length; i++) { if (isContextSensitive(args[i])) { @@ -14428,14 +16946,46 @@ var ts; excludeArgument[i] = true; } } + // The following variables are captured and modified by calls to chooseOverload. + // If overload resolution or type argument inference fails, we want to report the + // best error possible. The best error is one which says that an argument was not + // assignable to a parameter. This implies that everything else about the overload + // was fine. So if there is any overload that is only incorrect because of an + // argument, we will report an error on that one. + // + // function foo(s: string) {} + // function foo(n: number) {} // Report argument error on this overload + // function foo() {} + // foo(true); + // + // If none of the overloads even made it that far, there are two possibilities. + // There was a problem with type arguments for some overload, in which case + // report an error on that. Or none of the overloads even had correct arity, + // in which case give an arity error. + // + // function foo(x: T, y: T) {} // Report type argument inference error + // function foo() {} + // foo(0, true); + // var candidateForArgumentError; var candidateForTypeArgumentError; var resultOfFailedInference; var result; + // Section 4.12.1: + // if the candidate list contains one or more signatures for which the type of each argument + // expression is a subtype of each corresponding parameter type, the return type of the first + // of those signatures becomes the return type of the function call. + // Otherwise, the return type of the first signature in the candidate list becomes the return + // type of the function call. + // + // Whether the call is an error is determined by assignability of the arguments. The subtype pass + // is just important for choosing the best signature. So in the case where there is only one + // signature, the subtype pass is useless. So skipping it is an optimization. if (candidates.length > 1) { result = chooseOverload(candidates, subtypeRelation); } if (!result) { + // Reinitialize these pointers for round two candidateForArgumentError = undefined; candidateForTypeArgumentError = undefined; resultOfFailedInference = undefined; @@ -14444,7 +16994,16 @@ var ts; if (result) { return result; } + // No signatures were applicable. Now report errors based on the last applicable signature with + // no arguments excluded from assignability checks. + // If candidate is undefined, it means that no candidates had a suitable arity. In that case, + // skip the checkApplicableSignature check. if (candidateForArgumentError) { + // excludeArgument is undefined, in this case also equivalent to [undefined, undefined, ...] + // The importance of excludeArgument is to prevent us from typing function expression parameters + // in arguments too early. If possible, we'd like to only type them once we know the correct + // overload. However, this matters for the case where the call is correct. When the call is + // an error, we don't need to exclude any arguments, although it would cause no harm to do so. checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, undefined, true); } else if (candidateForTypeArgumentError) { @@ -14462,6 +17021,11 @@ var ts; else { error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); } + // No signature was applicable. We have already reported the errors for the invalid signature. + // If this is a type resolution session, e.g. Language Service, try to get better information that anySignature. + // Pick the first candidate that matches the arity. This way we can get a contextual type for cases like: + // declare function f(a: { xa: number; xb: number; }); + // f({ | if (!produceDiagnostics) { for (var _i = 0; _i < candidates.length; _i++) { var candidate = candidates[_i]; @@ -14509,6 +17073,11 @@ var ts; } excludeArgument[index] = false; } + // A post-mortem of this iteration of the loop. The signature was not applicable, + // so we want to track it as a candidate for reporting an error. If the candidate + // had no type parameters, or had no issues related to type arguments, we can + // report an error based on the arguments. If there was an issue with type + // arguments, then we can only report an error based on the type arguments. if (originalCandidate.typeParameters) { var instantiatedCandidate = candidate; if (typeArgumentsAreValid) { @@ -14530,26 +17099,41 @@ var ts; } } function resolveCallExpression(node, candidatesOutArray) { - if (node.expression.kind === 91) { + if (node.expression.kind === 91 /* SuperKeyword */) { var superType = checkSuperExpression(node.expression); if (superType !== unknownType) { - return resolveCall(node, getSignaturesOfType(superType, 1), candidatesOutArray); + return resolveCall(node, getSignaturesOfType(superType, 1 /* Construct */), candidatesOutArray); } return resolveUntypedCall(node); } var funcType = checkExpression(node.expression); var apparentType = getApparentType(funcType); if (apparentType === unknownType) { + // Another error has already been reported return resolveErrorCall(node); } - var callSignatures = getSignaturesOfType(apparentType, 0); - var constructSignatures = getSignaturesOfType(apparentType, 1); - if (funcType === anyType || (!callSignatures.length && !constructSignatures.length && !(funcType.flags & 16384) && isTypeAssignableTo(funcType, globalFunctionType))) { + // Technically, this signatures list may be incomplete. We are taking the apparent type, + // but we are not including call signatures that may have been added to the Object or + // Function interface, since they have none by default. This is a bit of a leap of faith + // that the user will not add any. + var callSignatures = getSignaturesOfType(apparentType, 0 /* Call */); + var constructSignatures = getSignaturesOfType(apparentType, 1 /* Construct */); + // TS 1.0 spec: 4.12 + // If FuncExpr is of type Any, or of an object type that has no call or construct signatures + // but is a subtype of the Function interface, the call is an untyped function call. In an + // untyped function call no TypeArgs are permitted, Args can be any argument list, no contextual + // types are provided for the argument expressions, and the result is always of type Any. + // We exclude union types because we may have a union of function types that happen to have + // no common signatures. + if (funcType === anyType || (!callSignatures.length && !constructSignatures.length && !(funcType.flags & 16384 /* Union */) && isTypeAssignableTo(funcType, globalFunctionType))) { if (node.typeArguments) { error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); } return resolveUntypedCall(node); } + // If FuncExpr's apparent type(section 3.8.1) is a function type, the call is a typed function call. + // TypeScript employs overload resolution in typed function calls in order to support functions + // with multiple call signatures. if (!callSignatures.length) { if (constructSignatures.length) { error(node, ts.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType)); @@ -14562,28 +17146,45 @@ var ts; return resolveCall(node, callSignatures, candidatesOutArray); } function resolveNewExpression(node, candidatesOutArray) { - if (node.arguments && languageVersion < 2) { + if (node.arguments && languageVersion < 2 /* ES6 */) { var spreadIndex = getSpreadArgumentIndex(node.arguments); if (spreadIndex >= 0) { error(node.arguments[spreadIndex], ts.Diagnostics.Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_6_and_higher); } } var expressionType = checkExpression(node.expression); + // TS 1.0 spec: 4.11 + // If ConstructExpr is of type Any, Args can be any argument + // list and the result of the operation is of type Any. if (expressionType === anyType) { if (node.typeArguments) { error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); } return resolveUntypedCall(node); } + // If ConstructExpr's apparent type(section 3.8.1) is an object type with one or + // more construct signatures, the expression is processed in the same manner as a + // function call, but using the construct signatures as the initial set of candidate + // signatures for overload resolution.The result type of the function call becomes + // the result type of the operation. expressionType = getApparentType(expressionType); if (expressionType === unknownType) { + // Another error has already been reported return resolveErrorCall(node); } - var constructSignatures = getSignaturesOfType(expressionType, 1); + // Technically, this signatures list may be incomplete. We are taking the apparent type, + // but we are not including construct signatures that may have been added to the Object or + // Function interface, since they have none by default. This is a bit of a leap of faith + // that the user will not add any. + var constructSignatures = getSignaturesOfType(expressionType, 1 /* Construct */); if (constructSignatures.length) { return resolveCall(node, constructSignatures, candidatesOutArray); } - var callSignatures = getSignaturesOfType(expressionType, 0); + // If ConstructExpr's apparent type is an object type with no construct signatures but + // one or more call signatures, the expression is processed as a function call. A compile-time + // error occurs if the result of the function call is not Void. The type of the result of the + // operation is Any. + var callSignatures = getSignaturesOfType(expressionType, 0 /* Call */); if (callSignatures.length) { var signature = resolveCall(node, callSignatures, candidatesOutArray); if (getReturnTypeOfSignature(signature) !== voidType) { @@ -14598,10 +17199,11 @@ var ts; var tagType = checkExpression(node.tag); var apparentType = getApparentType(tagType); if (apparentType === unknownType) { + // Another error has already been reported return resolveErrorCall(node); } - var callSignatures = getSignaturesOfType(apparentType, 0); - if (tagType === anyType || (!callSignatures.length && !(tagType.flags & 16384) && isTypeAssignableTo(tagType, globalFunctionType))) { + var callSignatures = getSignaturesOfType(apparentType, 0 /* Call */); + if (tagType === anyType || (!callSignatures.length && !(tagType.flags & 16384 /* Union */) && isTypeAssignableTo(tagType, globalFunctionType))) { return resolveUntypedCall(node); } if (!callSignatures.length) { @@ -14610,17 +17212,23 @@ var ts; } return resolveCall(node, callSignatures, candidatesOutArray); } + // candidatesOutArray is passed by signature help in the language service, and collectCandidates + // must fill it up with the appropriate candidate signatures function getResolvedSignature(node, candidatesOutArray) { var links = getNodeLinks(node); + // If getResolvedSignature has already been called, we will have cached the resolvedSignature. + // However, it is possible that either candidatesOutArray was not passed in the first time, + // or that a different candidatesOutArray was passed in. Therefore, we need to redo the work + // to correctly fill the candidatesOutArray. if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - if (node.kind === 157) { + if (node.kind === 157 /* CallExpression */) { links.resolvedSignature = resolveCallExpression(node, candidatesOutArray); } - else if (node.kind === 158) { + else if (node.kind === 158 /* NewExpression */) { links.resolvedSignature = resolveNewExpression(node, candidatesOutArray); } - else if (node.kind === 159) { + else if (node.kind === 159 /* TaggedTemplateExpression */) { links.resolvedSignature = resolveTaggedTemplateExpression(node, candidatesOutArray); } else { @@ -14630,17 +17238,19 @@ var ts; return links.resolvedSignature; } function checkCallExpression(node) { + // Grammar checking; stop grammar-checking if checkGrammarTypeArguments return true checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node, node.arguments); var signature = getResolvedSignature(node); - if (node.expression.kind === 91) { + if (node.expression.kind === 91 /* SuperKeyword */) { return voidType; } - if (node.kind === 158) { + if (node.kind === 158 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 135 && - declaration.kind !== 139 && - declaration.kind !== 143) { + declaration.kind !== 135 /* Constructor */ && + declaration.kind !== 139 /* ConstructSignature */ && + declaration.kind !== 143 /* ConstructorType */) { + // When resolved signature is a call signature (and not a construct signature) the result type is any if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } @@ -14654,7 +17264,7 @@ var ts; } function checkTypeAssertion(node) { var exprType = checkExpression(node.expression); - var targetType = getTypeFromTypeNodeOrHeritageClauseElement(node.type); + var targetType = getTypeFromTypeNode(node.type); if (produceDiagnostics && targetType !== unknownType) { var widenedType = getWidenedType(exprType); if (!(isTypeAssignableTo(targetType, widenedType))) { @@ -14664,14 +17274,9 @@ var ts; return targetType; } 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 ? - getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]) : - anyArrayType; + pos < signature.parameters.length - 1 ? getTypeOfSymbol(signature.parameters[pos]) : getRestTypeOfSignature(signature) : + pos < signature.parameters.length ? getTypeOfSymbol(signature.parameters[pos]) : anyType; } function assignContextualParameterTypes(signature, context, mapper) { var len = signature.parameters.length - (signature.hasRestParameter ? 1 : 0); @@ -14692,14 +17297,17 @@ var ts; return unknownType; } var type; - if (func.body.kind !== 179) { + if (func.body.kind !== 179 /* Block */) { type = checkExpressionCached(func.body, contextualMapper); } else { + // Aggregate the types of expressions within all the return statements. var types = checkAndAggregateReturnExpressionTypes(func.body, contextualMapper); if (types.length === 0) { return voidType; } + // When return statements are contextually typed we allow the return type to be a union type. Otherwise we require the + // return expressions to have a best common supertype. type = contextualSignature ? getUnionType(types) : getCommonSupertype(types); if (!type) { error(func, ts.Diagnostics.No_best_common_type_exists_among_return_expressions); @@ -14711,6 +17319,7 @@ var ts; } return getWidenedType(type); } + /// Returns a set of types relating to every return expression relating to a function block. function checkAndAggregateReturnExpressionTypes(body, contextualMapper) { var aggregatedTypes = []; ts.forEachReturnStatement(body, function (returnStatement) { @@ -14730,44 +17339,61 @@ var ts; }); } function bodyContainsSingleThrowStatement(body) { - return (body.statements.length === 1) && (body.statements[0].kind === 195); + return (body.statements.length === 1) && (body.statements[0].kind === 195 /* ThrowStatement */); } + // TypeScript Specification 1.0 (6.3) - July 2014 + // An explicitly typed function whose return type isn't the Void or the Any type + // must have at least one return statement somewhere in its body. + // An exception to this rule is if the function implementation consists of a single 'throw' statement. function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func, returnType) { if (!produceDiagnostics) { return; } + // Functions that return 'void' or 'any' don't need any return expressions. if (returnType === voidType || returnType === anyType) { return; } - if (ts.nodeIsMissing(func.body) || func.body.kind !== 179) { + // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. + if (ts.nodeIsMissing(func.body) || func.body.kind !== 179 /* Block */) { return; } var bodyBlock = func.body; + // Ensure the body has at least one return expression. if (bodyContainsAReturnStatement(bodyBlock)) { return; } + // If there are no return expressions, then we need to check if + // the function body consists solely of a throw statement; + // this is to make an exception for unimplemented functions. if (bodyContainsSingleThrowStatement(bodyBlock)) { return; } + // This function does not conform to the specification. error(func.type, ts.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement); } function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) { - ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); - var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 162) { + ts.Debug.assert(node.kind !== 134 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + // Grammar checking + var hasGrammarError = checkGrammarDeclarationNameInStrictMode(node) || checkGrammarFunctionLikeDeclaration(node); + if (!hasGrammarError && node.kind === 162 /* FunctionExpression */) { checkGrammarFunctionName(node.name) || checkGrammarForGenerator(node); } + // The identityMapper object is used to indicate that function expressions are wildcards if (contextualMapper === identityMapper && isContextSensitive(node)) { return anyFunctionType; } var links = getNodeLinks(node); var type = getTypeOfSymbol(node.symbol); - if (!(links.flags & 64)) { + // Check if function expression is contextually typed and assign parameter types if so + if (!(links.flags & 64 /* ContextChecked */)) { var contextualSignature = getContextualSignature(node); - if (!(links.flags & 64)) { - links.flags |= 64; + // If a type check is started at a function expression that is an argument of a function call, obtaining the + // contextual type may recursively get back to here during overload resolution of the call. If so, we will have + // already assigned contextual types. + if (!(links.flags & 64 /* ContextChecked */)) { + links.flags |= 64 /* ContextChecked */; if (contextualSignature) { - var signature = getSignaturesOfType(type, 0)[0]; + var signature = getSignaturesOfType(type, 0 /* Call */)[0]; if (isContextSensitive(node)) { assignContextualParameterTypes(signature, contextualSignature, contextualMapper || identityMapper); } @@ -14782,32 +17408,32 @@ var ts; checkSignatureDeclaration(node); } } - if (produceDiagnostics && node.kind !== 134 && node.kind !== 133) { + if (produceDiagnostics && node.kind !== 134 /* MethodDeclaration */ && node.kind !== 133 /* MethodSignature */) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); } return type; } function checkFunctionExpressionOrObjectLiteralMethodBody(node) { - ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node)); - if (node.type) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type)); + ts.Debug.assert(node.kind !== 134 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + if (node.type && !node.asteriskToken) { + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); } if (node.body) { - if (node.body.kind === 179) { + if (node.body.kind === 179 /* Block */) { checkSourceElement(node.body); } else { var exprType = checkExpression(node.body); if (node.type) { - checkTypeAssignableTo(exprType, getTypeFromTypeNodeOrHeritageClauseElement(node.type), node.body, undefined); + checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, undefined); } checkFunctionExpressionBodies(node.body); } } } function checkArithmeticOperandType(operand, type, diagnostic) { - if (!allConstituentTypesHaveKind(type, 1 | 132)) { + if (!allConstituentTypesHaveKind(type, 1 /* Any */ | 132 /* NumberLike */)) { error(operand, diagnostic); return false; } @@ -14816,21 +17442,37 @@ var ts; function checkReferenceExpression(n, invalidReferenceMessage, constantVariableMessage) { function findSymbol(n) { var symbol = getNodeLinks(n).resolvedSymbol; + // Because we got the symbol from the resolvedSymbol property, it might be of kind + // SymbolFlags.ExportValue. In this case it is necessary to get the actual export + // symbol, which will have the correct flags set on it. return symbol && getExportSymbolOfValueSymbolIfExported(symbol); } function isReferenceOrErrorExpression(n) { + // TypeScript 1.0 spec (April 2014): + // Expressions are classified as values or references. + // References are the subset of expressions that are permitted as the target of an assignment. + // Specifically, references are combinations of identifiers(section 4.3), parentheses(section 4.7), + // and property accesses(section 4.10). + // All other expression constructs described in this chapter are classified as values. switch (n.kind) { - case 65: { + case 65 /* Identifier */: { var symbol = findSymbol(n); - return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3) !== 0; + // TypeScript 1.0 spec (April 2014): 4.3 + // An identifier expression that references a variable or parameter is classified as a reference. + // An identifier expression that references any other kind of entity is classified as a value(and therefore cannot be the target of an assignment). + return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3 /* Variable */) !== 0; } - case 155: { + case 155 /* PropertyAccessExpression */: { var symbol = findSymbol(n); - return !symbol || symbol === unknownSymbol || (symbol.flags & ~8) !== 0; + // TypeScript 1.0 spec (April 2014): 4.10 + // A property access expression is always classified as a reference. + // NOTE (not in spec): assignment to enum members should not be allowed + return !symbol || symbol === unknownSymbol || (symbol.flags & ~8 /* EnumMember */) !== 0; } - case 156: + case 156 /* ElementAccessExpression */: + // old compiler doesn't check indexed assess return true; - case 161: + case 161 /* ParenthesizedExpression */: return isReferenceOrErrorExpression(n.expression); default: return false; @@ -14838,22 +17480,22 @@ var ts; } function isConstVariableReference(n) { switch (n.kind) { - case 65: - case 155: { + case 65 /* Identifier */: + case 155 /* PropertyAccessExpression */: { var symbol = findSymbol(n); - return symbol && (symbol.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 8192) !== 0; + return symbol && (symbol.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 8192 /* Const */) !== 0; } - case 156: { + case 156 /* ElementAccessExpression */: { var index = n.argumentExpression; var symbol = findSymbol(n.expression); - if (symbol && index && index.kind === 8) { + if (symbol && index && index.kind === 8 /* StringLiteral */) { var name_7 = index.text; var prop = getPropertyOfType(getTypeOfSymbol(symbol), name_7); - return prop && (prop.flags & 3) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 8192) !== 0; + return prop && (prop.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 8192 /* Const */) !== 0; } return false; } - case 161: + case 161 /* ParenthesizedExpression */: return isConstVariableReference(n.expression); default: return false; @@ -14870,7 +17512,10 @@ var ts; return true; } function checkDeleteExpression(node) { - if (node.parserContextFlags & 1 && node.expression.kind === 65) { + // Grammar checking + if (node.parserContextFlags & 1 /* StrictMode */ && node.expression.kind === 65 /* Identifier */) { + // When a delete operator occurs within strict mode code, a SyntaxError is thrown if its + // UnaryExpression is a direct reference to a variable, function argument, or function name grammarErrorOnNode(node.expression, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode); } var operandType = checkExpression(node.expression); @@ -14885,24 +17530,29 @@ var ts; return undefinedType; } function checkPrefixUnaryExpression(node) { - if ((node.operator === 38 || node.operator === 39)) { + // Grammar checking + // The identifier eval or arguments may not appear as the LeftHandSideExpression of an + // Assignment operator(11.13) or of a PostfixExpression(11.3) or as the UnaryExpression + // operated upon by a Prefix Increment(11.4.4) or a Prefix Decrement(11.4.5) operator + if ((node.operator === 38 /* PlusPlusToken */ || node.operator === 39 /* MinusMinusToken */)) { checkGrammarEvalOrArgumentsInStrictMode(node, node.operand); } var operandType = checkExpression(node.operand); switch (node.operator) { - case 33: - case 34: - case 47: - if (someConstituentTypeHasKind(operandType, 1048576)) { + case 33 /* PlusToken */: + case 34 /* MinusToken */: + case 47 /* TildeToken */: + if (someConstituentTypeHasKind(operandType, 1048576 /* ESSymbol */)) { error(node.operand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(node.operator)); } return numberType; - case 46: + case 46 /* ExclamationToken */: return booleanType; - case 38: - case 39: + case 38 /* PlusPlusToken */: + case 39 /* MinusMinusToken */: var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { + // run check only if former checks succeeded to avoid reporting cascading errors checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant); } return numberType; @@ -14910,19 +17560,26 @@ var ts; return unknownType; } function checkPostfixUnaryExpression(node) { + // Grammar checking + // The identifier eval or arguments may not appear as the LeftHandSideExpression of an + // Assignment operator(11.13) or of a PostfixExpression(11.3) or as the UnaryExpression + // operated upon by a Prefix Increment(11.4.4) or a Prefix Decrement(11.4.5) operator. checkGrammarEvalOrArgumentsInStrictMode(node, node.operand); var operandType = checkExpression(node.operand); var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { + // run check only if former checks succeeded to avoid reporting cascading errors checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant); } return numberType; } + // Just like isTypeOfKind below, except that it returns true if *any* constituent + // has this kind. function someConstituentTypeHasKind(type, kind) { if (type.flags & kind) { return true; } - if (type.flags & 16384) { + if (type.flags & 16384 /* Union */) { var types = type.types; for (var _i = 0; _i < types.length; _i++) { var current = types[_i]; @@ -14934,11 +17591,12 @@ var ts; } return false; } + // Return true if type has the given flags, or is a union type composed of types that all have those flags. function allConstituentTypesHaveKind(type, kind) { if (type.flags & kind) { return true; } - if (type.flags & 16384) { + if (type.flags & 16384 /* Union */) { var types = type.types; for (var _i = 0; _i < types.length; _i++) { var current = types[_i]; @@ -14951,25 +17609,35 @@ var ts; return false; } function isConstEnumObjectType(type) { - return type.flags & (48128 | 32768) && type.symbol && isConstEnumSymbol(type.symbol); + return type.flags & (48128 /* ObjectType */ | 32768 /* Anonymous */) && type.symbol && isConstEnumSymbol(type.symbol); } function isConstEnumSymbol(symbol) { - return (symbol.flags & 128) !== 0; + return (symbol.flags & 128 /* ConstEnum */) !== 0; } function checkInstanceOfExpression(node, leftType, rightType) { - if (allConstituentTypesHaveKind(leftType, 1049086)) { + // TypeScript 1.0 spec (April 2014): 4.15.4 + // The instanceof operator requires the left operand to be of type Any, an object type, or a type parameter type, + // and the right operand to be of type Any or a subtype of the 'Function' interface type. + // The result is always of the Boolean primitive type. + // NOTE: do not raise error if leftType is unknown as related error was already reported + if (allConstituentTypesHaveKind(leftType, 1049086 /* Primitive */)) { error(node.left, ts.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } - if (!(rightType.flags & 1 || isTypeSubtypeOf(rightType, globalFunctionType))) { + // NOTE: do not raise error if right is unknown as related error was already reported + if (!(rightType.flags & 1 /* Any */ || isTypeSubtypeOf(rightType, globalFunctionType))) { error(node.right, ts.Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type); } return booleanType; } function checkInExpression(node, leftType, rightType) { - if (!allConstituentTypesHaveKind(leftType, 1 | 258 | 132 | 1048576)) { + // TypeScript 1.0 spec (April 2014): 4.15.5 + // The in operator requires the left operand to be of type Any, the String primitive type, or the Number primitive type, + // and the right operand to be of type Any, an object type, or a type parameter type. + // The result is always of the Boolean primitive type. + if (!allConstituentTypesHaveKind(leftType, 1 /* Any */ | 258 /* StringLike */ | 132 /* NumberLike */ | 1048576 /* ESSymbol */)) { error(node.left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!allConstituentTypesHaveKind(rightType, 1 | 48128 | 512)) { + if (!allConstituentTypesHaveKind(rightType, 1 /* Any */ | 48128 /* ObjectType */ | 512 /* TypeParameter */)) { error(node.right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; @@ -14978,12 +17646,13 @@ var ts; var properties = node.properties; for (var _i = 0; _i < properties.length; _i++) { var p = properties[_i]; - if (p.kind === 224 || p.kind === 225) { + if (p.kind === 224 /* PropertyAssignment */ || p.kind === 225 /* ShorthandPropertyAssignment */) { + // TODO(andersh): Computed property support var name_8 = p.name; - var type = sourceType.flags & 1 ? sourceType : + var type = sourceType.flags & 1 /* Any */ ? sourceType : getTypeOfPropertyOfType(sourceType, name_8.text) || - isNumericLiteralName(name_8.text) && getIndexTypeOfType(sourceType, 1) || - getIndexTypeOfType(sourceType, 0); + isNumericLiteralName(name_8.text) && getIndexTypeOfType(sourceType, 1 /* Number */) || + getIndexTypeOfType(sourceType, 0 /* String */); if (type) { checkDestructuringAssignment(p.initializer || name_8, type); } @@ -14998,19 +17667,20 @@ var ts; return sourceType; } function checkArrayLiteralAssignment(node, sourceType, contextualMapper) { - if (!isArrayLikeType(sourceType)) { - error(node, ts.Diagnostics.Type_0_is_not_an_array_type, typeToString(sourceType)); - return sourceType; - } + // This elementType will be used if the specific property corresponding to this index is not + // present (aka the tuple element property). This call also checks that the parentType is in + // fact an iterable or array (depending on target language). + var elementType = checkIteratedTypeOrElementType(sourceType, node, false) || unknownType; var elements = node.elements; for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 175) { - if (e.kind !== 173) { + if (e.kind !== 175 /* OmittedExpression */) { + if (e.kind !== 173 /* SpreadElementExpression */) { var propName = "" + i; - var type = sourceType.flags & 1 ? sourceType : - isTupleLikeType(sourceType) ? getTypeOfPropertyOfType(sourceType, propName) : - getIndexTypeOfType(sourceType, 1); + var type = sourceType.flags & 1 /* Any */ ? sourceType : + isTupleLikeType(sourceType) + ? getTypeOfPropertyOfType(sourceType, propName) + : elementType; if (type) { checkDestructuringAssignment(e, type, contextualMapper); } @@ -15024,11 +17694,17 @@ var ts; } } else { - if (i === elements.length - 1) { - checkReferenceAssignment(e.expression, sourceType, contextualMapper); + if (i < elements.length - 1) { + error(e, ts.Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); } else { - error(e, ts.Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); + var restExpression = e.expression; + if (restExpression.kind === 169 /* BinaryExpression */ && restExpression.operatorToken.kind === 53 /* EqualsToken */) { + error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); + } + else { + checkDestructuringAssignment(restExpression, createArrayType(elementType), contextualMapper); + } } } } @@ -15036,14 +17712,14 @@ var ts; return sourceType; } function checkDestructuringAssignment(target, sourceType, contextualMapper) { - if (target.kind === 169 && target.operatorToken.kind === 53) { + if (target.kind === 169 /* BinaryExpression */ && target.operatorToken.kind === 53 /* EqualsToken */) { checkBinaryExpression(target, contextualMapper); target = target.left; } - if (target.kind === 154) { + if (target.kind === 154 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType, contextualMapper); } - if (target.kind === 153) { + if (target.kind === 153 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, contextualMapper); } return checkReferenceAssignment(target, sourceType, contextualMapper); @@ -15056,47 +17732,59 @@ var ts; return sourceType; } function checkBinaryExpression(node, contextualMapper) { + // Grammar checking if (ts.isLeftHandSideExpression(node.left) && ts.isAssignmentOperator(node.operatorToken.kind)) { + // ECMA 262 (Annex C) The identifier eval or arguments may not appear as the LeftHandSideExpression of an + // Assignment operator(11.13) or of a PostfixExpression(11.3) checkGrammarEvalOrArgumentsInStrictMode(node, node.left); } var operator = node.operatorToken.kind; - if (operator === 53 && (node.left.kind === 154 || node.left.kind === 153)) { + if (operator === 53 /* EqualsToken */ && (node.left.kind === 154 /* ObjectLiteralExpression */ || node.left.kind === 153 /* ArrayLiteralExpression */)) { 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 56: - case 36: - case 57: - case 37: - case 58: - case 34: - case 55: - case 40: - case 59: - case 41: - case 60: - case 42: - case 61: - case 44: - case 63: - case 45: - case 64: - case 43: - case 62: - if (leftType.flags & (32 | 64)) + case 35 /* AsteriskToken */: + case 56 /* AsteriskEqualsToken */: + case 36 /* SlashToken */: + case 57 /* SlashEqualsToken */: + case 37 /* PercentToken */: + case 58 /* PercentEqualsToken */: + case 34 /* MinusToken */: + case 55 /* MinusEqualsToken */: + case 40 /* LessThanLessThanToken */: + case 59 /* LessThanLessThanEqualsToken */: + case 41 /* GreaterThanGreaterThanToken */: + case 60 /* GreaterThanGreaterThanEqualsToken */: + case 42 /* GreaterThanGreaterThanGreaterThanToken */: + case 61 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 44 /* BarToken */: + case 63 /* BarEqualsToken */: + case 45 /* CaretToken */: + case 64 /* CaretEqualsToken */: + case 43 /* AmpersandToken */: + case 62 /* AmpersandEqualsToken */: + // TypeScript 1.0 spec (April 2014): 4.15.1 + // These operators require their operands to be of type Any, the Number primitive type, + // or an enum type. Operands of an enum type are treated + // as having the primitive type Number. If one operand is the null or undefined value, + // it is treated as having the type of the other operand. + // The result is always of the Number primitive type. + if (leftType.flags & (32 /* Undefined */ | 64 /* Null */)) leftType = rightType; - if (rightType.flags & (32 | 64)) + if (rightType.flags & (32 /* Undefined */ | 64 /* Null */)) rightType = leftType; var suggestedOperator; - if ((leftType.flags & 8) && - (rightType.flags & 8) && + // if a user tries to apply a bitwise operator to 2 boolean operands + // try and return them a helpful suggestion + if ((leftType.flags & 8 /* Boolean */) && + (rightType.flags & 8 /* Boolean */) && (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 { + // otherwise just check each operand separately and report errors as normal var leftOk = checkArithmeticOperandType(node.left, leftType, ts.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); var rightOk = checkArithmeticOperandType(node.right, rightType, ts.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); if (leftOk && rightOk) { @@ -15104,23 +17792,33 @@ var ts; } } return numberType; - case 33: - case 54: - if (leftType.flags & (32 | 64)) + case 33 /* PlusToken */: + case 54 /* PlusEqualsToken */: + // TypeScript 1.0 spec (April 2014): 4.15.2 + // The binary + operator requires both operands to be of the Number primitive type or an enum type, + // or at least one of the operands to be of type Any or the String primitive type. + // If one operand is the null or undefined value, it is treated as having the type of the other operand. + if (leftType.flags & (32 /* Undefined */ | 64 /* Null */)) leftType = rightType; - if (rightType.flags & (32 | 64)) + if (rightType.flags & (32 /* Undefined */ | 64 /* Null */)) rightType = leftType; var resultType; - if (allConstituentTypesHaveKind(leftType, 132) && allConstituentTypesHaveKind(rightType, 132)) { + if (allConstituentTypesHaveKind(leftType, 132 /* NumberLike */) && allConstituentTypesHaveKind(rightType, 132 /* NumberLike */)) { + // Operands of an enum type are treated as having the primitive type Number. + // If both operands are of the Number primitive type, the result is of the Number primitive type. resultType = numberType; } else { - if (allConstituentTypesHaveKind(leftType, 258) || allConstituentTypesHaveKind(rightType, 258)) { + if (allConstituentTypesHaveKind(leftType, 258 /* StringLike */) || allConstituentTypesHaveKind(rightType, 258 /* StringLike */)) { + // If one or both operands are of the String primitive type, the result is of the String primitive type. resultType = stringType; } - else if (leftType.flags & 1 || rightType.flags & 1) { + else if (leftType.flags & 1 /* Any */ || rightType.flags & 1 /* Any */) { + // Otherwise, the result is of type Any. + // NOTE: unknown type here denotes error type. Old compiler treated this case as any type so do we. resultType = anyType; } + // Symbols are not allowed at all in arithmetic expressions if (resultType && !checkForDisallowedESSymbolOperand(operator)) { return resultType; } @@ -15129,42 +17827,44 @@ var ts; reportOperatorError(); return anyType; } - if (operator === 54) { + if (operator === 54 /* PlusEqualsToken */) { checkAssignmentOperator(resultType); } return resultType; - case 24: - case 25: - case 26: - case 27: + case 24 /* LessThanToken */: + case 25 /* GreaterThanToken */: + case 26 /* LessThanEqualsToken */: + case 27 /* GreaterThanEqualsToken */: if (!checkForDisallowedESSymbolOperand(operator)) { return booleanType; } - case 28: - case 29: - case 30: - case 31: + // Fall through + case 28 /* EqualsEqualsToken */: + case 29 /* ExclamationEqualsToken */: + case 30 /* EqualsEqualsEqualsToken */: + case 31 /* ExclamationEqualsEqualsToken */: if (!isTypeAssignableTo(leftType, rightType) && !isTypeAssignableTo(rightType, leftType)) { reportOperatorError(); } return booleanType; - case 87: + case 87 /* InstanceOfKeyword */: return checkInstanceOfExpression(node, leftType, rightType); - case 86: + case 86 /* InKeyword */: return checkInExpression(node, leftType, rightType); - case 48: + case 48 /* AmpersandAmpersandToken */: return rightType; - case 49: + case 49 /* BarBarToken */: return getUnionType([leftType, rightType]); - case 53: + case 53 /* EqualsToken */: checkAssignmentOperator(rightType); return rightType; - case 23: + case 23 /* CommaToken */: return rightType; } + // Return true if there was no error, false if there was an error. function checkForDisallowedESSymbolOperand(operator) { - var offendingSymbolOperand = someConstituentTypeHasKind(leftType, 1048576) ? node.left : - someConstituentTypeHasKind(rightType, 1048576) ? node.right : + var offendingSymbolOperand = someConstituentTypeHasKind(leftType, 1048576 /* ESSymbol */) ? node.left : + someConstituentTypeHasKind(rightType, 1048576 /* ESSymbol */) ? node.right : undefined; if (offendingSymbolOperand) { error(offendingSymbolOperand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(operator)); @@ -15174,23 +17874,31 @@ var ts; } function getSuggestedBooleanOperator(operator) { switch (operator) { - case 44: - case 63: - return 49; - case 45: - case 64: - return 31; - case 43: - case 62: - return 48; + case 44 /* BarToken */: + case 63 /* BarEqualsToken */: + return 49 /* BarBarToken */; + case 45 /* CaretToken */: + case 64 /* CaretEqualsToken */: + return 31 /* ExclamationEqualsEqualsToken */; + case 43 /* AmpersandToken */: + case 62 /* AmpersandEqualsToken */: + return 48 /* AmpersandAmpersandToken */; default: return undefined; } } function checkAssignmentOperator(valueType) { - if (produceDiagnostics && operator >= 53 && operator <= 64) { + if (produceDiagnostics && operator >= 53 /* FirstAssignment */ && operator <= 64 /* LastAssignment */) { + // TypeScript 1.0 spec (April 2014): 4.17 + // An assignment of the form + // VarExpr = ValueExpr + // requires VarExpr to be classified as a reference + // A compound assignment furthermore requires VarExpr to be classified as a reference (section 4.1) + // and the type of the non - compound operation to be assignable to the type of VarExpr. 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); + // Use default messages if (ok) { + // to avoid cascading errors check assignability only if 'isReference' check succeeded and no errors were reported checkTypeAssignableTo(valueType, leftType, node.left, undefined); } } @@ -15200,7 +17908,8 @@ var ts; } } function checkYieldExpression(node) { - if (!(node.parserContextFlags & 4)) { + // Grammar checking + if (!(node.parserContextFlags & 4 /* Yield */)) { grammarErrorOnFirstToken(node, ts.Diagnostics.yield_expression_must_be_contained_within_a_generator_declaration); } else { @@ -15214,6 +17923,11 @@ var ts; return getUnionType([type1, type2]); } function checkTemplateExpression(node) { + // We just want to check each expressions, but we are unconcerned with + // the type of each expression, as any value may be coerced into a string. + // It is worth asking whether this is what we really want though. + // A place where we actually *are* concerned with the expressions' types are + // in tagged templates. ts.forEach(node.templateSpans, function (templateSpan) { checkExpression(templateSpan.expression); }); @@ -15234,14 +17948,21 @@ var ts; return links.resolvedType; } function checkPropertyAssignment(node, contextualMapper) { - if (node.name.kind === 127) { + // Do not use hasDynamicName here, because that returns false for well known symbols. + // We want to perform checkComputedPropertyName for all computed properties, including + // well known symbols. + if (node.name.kind === 127 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpression(node.initializer, contextualMapper); } function checkObjectLiteralMethod(node, contextualMapper) { + // Grammar checking checkGrammarMethod(node); - if (node.name.kind === 127) { + // Do not use hasDynamicName here, because that returns false for well known symbols. + // We want to perform checkComputedPropertyName for all computed properties, including + // well known symbols. + if (node.name.kind === 127 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); @@ -15263,11 +17984,19 @@ var ts; return type; } function checkExpression(node, contextualMapper) { + checkGrammarIdentifierInStrictMode(node); return checkExpressionOrQualifiedName(node, contextualMapper); } + // Checks an expression and returns its type. The contextualMapper parameter serves two purposes: When + // contextualMapper is not undefined and not equal to the identityMapper function object it indicates that the + // expression is being inferentially typed (section 4.12.2 in spec) and provides the type mapper to use in + // conjunction with the generic contextual type. When contextualMapper is equal to the identityMapper function + // object, it serves as an indicator that all contained function and arrow expressions should be considered to + // have the wildcard function type; this form of type check is used during overload resolution to exclude + // contextually typed function and arrow expressions in the initial phase. function checkExpressionOrQualifiedName(node, contextualMapper) { var type; - if (node.kind == 126) { + if (node.kind == 126 /* QualifiedName */) { type = checkQualifiedName(node); } else { @@ -15275,9 +18004,13 @@ var ts; type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); } if (isConstEnumObjectType(type)) { - var ok = (node.parent.kind === 155 && node.parent.expression === node) || - (node.parent.kind === 156 && node.parent.expression === node) || - ((node.kind === 65 || node.kind === 126) && isInRightSideOfImportOrExportAssignment(node)); + // enum object type for const enums are only permitted in: + // - 'left' in property access + // - 'object' in indexed access + // - target in rhs of import statement + var ok = (node.parent.kind === 155 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 156 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 65 /* Identifier */ || node.kind === 126 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node)); 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); } @@ -15285,78 +18018,82 @@ var ts; return type; } function checkNumericLiteral(node) { - checkGrammarNumbericLiteral(node); + // Grammar checking + checkGrammarNumericLiteral(node); return numberType; } function checkExpressionWorker(node, contextualMapper) { switch (node.kind) { - case 65: + case 65 /* Identifier */: return checkIdentifier(node); - case 93: + case 93 /* ThisKeyword */: return checkThisExpression(node); - case 91: + case 91 /* SuperKeyword */: return checkSuperExpression(node); - case 89: + case 89 /* NullKeyword */: return nullType; - case 95: - case 80: + case 95 /* TrueKeyword */: + case 80 /* FalseKeyword */: return booleanType; - case 7: + case 7 /* NumericLiteral */: return checkNumericLiteral(node); - case 171: + case 171 /* TemplateExpression */: return checkTemplateExpression(node); - case 8: - case 10: + case 8 /* StringLiteral */: + case 10 /* NoSubstitutionTemplateLiteral */: return stringType; - case 9: + case 9 /* RegularExpressionLiteral */: return globalRegExpType; - case 153: + case 153 /* ArrayLiteralExpression */: return checkArrayLiteral(node, contextualMapper); - case 154: + case 154 /* ObjectLiteralExpression */: return checkObjectLiteral(node, contextualMapper); - case 155: + case 155 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 156: + case 156 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 157: - case 158: + case 157 /* CallExpression */: + case 158 /* NewExpression */: return checkCallExpression(node); - case 159: + case 159 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 160: + case 160 /* TypeAssertionExpression */: return checkTypeAssertion(node); - case 161: + case 161 /* ParenthesizedExpression */: return checkExpression(node.expression, contextualMapper); - case 174: + case 174 /* ClassExpression */: return checkClassExpression(node); - case 162: - case 163: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - case 165: + case 165 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 164: + case 164 /* DeleteExpression */: return checkDeleteExpression(node); - case 166: + case 166 /* VoidExpression */: return checkVoidExpression(node); - case 167: + case 167 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 168: + case 168 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 169: + case 169 /* BinaryExpression */: return checkBinaryExpression(node, contextualMapper); - case 170: + case 170 /* ConditionalExpression */: return checkConditionalExpression(node, contextualMapper); - case 173: + case 173 /* SpreadElementExpression */: return checkSpreadElementExpression(node, contextualMapper); - case 175: + case 175 /* OmittedExpression */: return undefinedType; - case 172: + case 172 /* YieldExpression */: checkYieldExpression(node); return unknownType; } return unknownType; } + // DECLARATION AND STATEMENT TYPE CHECKING function checkTypeParameter(node) { + checkGrammarDeclarationNameInStrictMode(node); + // Grammar Checking if (node.expression) { grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected); } @@ -15365,6 +18102,7 @@ var ts; checkTypeParameterHasIllegalReferencesInConstraint(node); checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0); } + // TODO: Check multiple declarations are identical } function checkParameter(node) { // Grammar checking @@ -15373,31 +18111,33 @@ var ts; // 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) + // Grammar checking checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarEvalOrArgumentsInStrictMode(node, node.name); checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); - if (node.flags & 112) { + if (node.flags & 112 /* AccessibilityModifier */) { func = ts.getContainingFunction(node); - if (!(func.kind === 135 && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 135 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } if (node.questionToken && ts.isBindingPattern(node.name) && func.body) { error(node, ts.Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature); } - if (node.dotDotDotToken) { - if (!isArrayType(getTypeOfSymbol(node.symbol))) { - error(node, ts.Diagnostics.A_rest_parameter_must_be_of_an_array_type); - } + // Only check rest parameter type if it's not a binding pattern. Since binding patterns are + // not allowed in a rest parameter, we already have an error from checkGrammarParameterList. + if (node.dotDotDotToken && !ts.isBindingPattern(node.name) && !isArrayType(getTypeOfSymbol(node.symbol))) { + error(node, ts.Diagnostics.A_rest_parameter_must_be_of_an_array_type); } } function checkSignatureDeclaration(node) { - if (node.kind === 140) { + // Grammar checking + if (node.kind === 140 /* IndexSignature */) { checkGrammarIndexSignature(node); } - else if (node.kind === 142 || node.kind === 200 || node.kind === 143 || - node.kind === 138 || node.kind === 135 || - node.kind === 139) { + else if (node.kind === 142 /* FunctionType */ || node.kind === 200 /* FunctionDeclaration */ || node.kind === 143 /* ConstructorType */ || + node.kind === 138 /* CallSignature */ || node.kind === 135 /* Constructor */ || + node.kind === 139 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } checkTypeParameters(node.typeParameters); @@ -15409,10 +18149,10 @@ var ts; checkCollisionWithArgumentsInGeneratedCode(node); if (compilerOptions.noImplicitAny && !node.type) { switch (node.kind) { - case 139: + case 139 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 138: + case 138 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -15421,12 +18161,17 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 202) { + if (node.kind === 202 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); + // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration + // to prevent this run check only for the first declaration of a given kind if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; } } + // TypeScript 1.0 spec (April 2014) + // 3.7.4: An object type can contain at most one string index signature and one numeric index signature. + // 8.5: A class declaration can have at most one string index member declaration and one numeric index member declaration var indexSymbol = getIndexSymbol(getSymbolOfNode(node)); if (indexSymbol) { var seenNumericIndexer = false; @@ -15436,7 +18181,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 121: + case 121 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -15444,7 +18189,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 119: + case 119 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -15458,22 +18203,29 @@ var ts; } } function checkPropertyDeclaration(node) { + // Grammar checking checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarProperty(node) || checkGrammarComputedPropertyName(node.name); checkVariableLikeDeclaration(node); } function checkMethodDeclaration(node) { + // Grammar checking checkGrammarMethod(node) || checkGrammarComputedPropertyName(node.name); + // Grammar checking for modifiers is done inside the function checkGrammarFunctionLikeDeclaration checkFunctionLikeDeclaration(node); } function checkConstructorDeclaration(node) { + // Grammar check on signature of constructor and modifier of the constructor is done in checkSignatureDeclaration function. checkSignatureDeclaration(node); + // Grammar check for checking only related to constructoDeclaration checkGrammarConstructorTypeParameters(node) || checkGrammarConstructorTypeAnnotation(node); checkSourceElement(node.body); var symbol = getSymbolOfNode(node); var firstDeclaration = ts.getDeclarationOfKind(symbol, node.kind); + // Only type check the symbol once if (node === firstDeclaration) { checkFunctionOrConstructorSymbol(symbol); } + // exit early in the case of signature - super checks are not relevant to them if (ts.nodeIsMissing(node.body)) { return; } @@ -15481,43 +18233,51 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 157 && n.expression.kind === 91; + return n.kind === 157 /* CallExpression */ && n.expression.kind === 91 /* SuperKeyword */; } function containsSuperCall(n) { if (isSuperCallExpression(n)) { return true; } switch (n.kind) { - case 162: - case 200: - case 163: - case 154: return false; + case 162 /* FunctionExpression */: + case 200 /* FunctionDeclaration */: + case 163 /* ArrowFunction */: + case 154 /* ObjectLiteralExpression */: return false; default: return ts.forEachChild(n, containsSuperCall); } } function markThisReferencesAsErrors(n) { - if (n.kind === 93) { + if (n.kind === 93 /* ThisKeyword */) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 162 && n.kind !== 200) { + else if (n.kind !== 162 /* FunctionExpression */ && n.kind !== 200 /* FunctionDeclaration */) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 132 && - !(n.flags & 128) && + return n.kind === 132 /* PropertyDeclaration */ && + !(n.flags & 128 /* Static */) && !!n.initializer; } + // 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 (ts.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: + // - The containing class is a derived class. + // - The constructor declares parameter properties + // or the containing class declares instance member variables with initializers. var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || - ts.forEach(node.parameters, function (p) { return p.flags & (16 | 32 | 64); }); + ts.forEach(node.parameters, function (p) { return p.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */); }); if (superCallShouldBeFirst) { var statements = node.body.statements; - if (!statements.length || statements[0].kind !== 182 || !isSuperCallExpression(statements[0].expression)) { + if (!statements.length || statements[0].kind !== 182 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { error(node, ts.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties); } else { + // In such a required super call, it is a compile-time error for argument expressions to reference this. markThisReferencesAsErrors(statements[0].expression); } } @@ -15529,21 +18289,26 @@ var ts; } function checkAccessorDeclaration(node) { if (produceDiagnostics) { + // Grammar checking accessors checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name); - if (node.kind === 136) { + if (node.kind === 136 /* GetAccessor */) { if (!ts.isInAmbientContext(node) && ts.nodeIsPresent(node.body) && !(bodyContainsAReturnStatement(node.body) || bodyContainsSingleThrowStatement(node.body))) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement); } } if (!ts.hasDynamicName(node)) { - var otherKind = node.kind === 136 ? 137 : 136; + // TypeScript 1.0 spec (April 2014): 8.4.3 + // Accessors for the same member name must specify the same accessibility. + var otherKind = node.kind === 136 /* GetAccessor */ ? 137 /* SetAccessor */ : 136 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { - if (((node.flags & 112) !== (otherAccessor.flags & 112))) { + if (((node.flags & 112 /* AccessibilityModifier */) !== (otherAccessor.flags & 112 /* AccessibilityModifier */))) { error(node.name, ts.Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility); } var currentAccessorType = getAnnotatedAccessorType(node); var otherAccessorType = getAnnotatedAccessorType(otherAccessor); + // TypeScript 1.0 spec (April 2014): 4.5 + // If both accessors include type annotations, the specified types must be identical. if (currentAccessorType && otherAccessorType) { if (!isTypeIdenticalTo(currentAccessorType, otherAccessorType)) { error(node, ts.Diagnostics.get_and_set_accessor_must_have_the_same_type); @@ -15559,15 +18324,19 @@ var ts; checkDecorators(node); } function checkTypeReferenceNode(node) { + checkGrammarTypeReferenceInStrictMode(node.typeName); return checkTypeReferenceOrHeritageClauseElement(node); } function checkHeritageClauseElement(node) { + checkGrammarHeritageClauseElementInStrictMode(node.expression); return checkTypeReferenceOrHeritageClauseElement(node); } function checkTypeReferenceOrHeritageClauseElement(node) { + // Grammar checking checkGrammarTypeArguments(node, node.typeArguments); var type = getTypeFromTypeReferenceOrHeritageClauseElement(node); if (type !== unknownType && node.typeArguments) { + // Do type argument local checks only if referenced type is successfully resolved var len = node.typeArguments.length; for (var i = 0; i < len; i++) { checkSourceElement(node.typeArguments[i]); @@ -15594,6 +18363,7 @@ var ts; checkSourceElement(node.elementType); } function checkTupleType(node) { + // Grammar checking var hasErrorFromDisallowedTrailingComma = checkGrammarForDisallowedTrailingComma(node.elementTypes); if (!hasErrorFromDisallowedTrailingComma && node.elementTypes.length === 0) { grammarErrorOnNode(node, ts.Diagnostics.A_tuple_type_element_list_cannot_be_empty); @@ -15604,7 +18374,7 @@ var ts; ts.forEach(node.types, checkSourceElement); } function isPrivateWithinAmbient(node) { - return (node.flags & 32) && ts.isInAmbientContext(node); + return (node.flags & 32 /* Private */) && ts.isInAmbientContext(node); } function checkSpecializedSignatureDeclaration(signatureDeclarationNode) { if (!produceDiagnostics) { @@ -15614,14 +18384,21 @@ var ts; if (!signature.hasStringLiterals) { return; } + // TypeScript 1.0 spec (April 2014): 3.7.2.2 + // Specialized signatures are not permitted in conjunction with a function body if (ts.nodeIsPresent(signatureDeclarationNode.body)) { error(signatureDeclarationNode, ts.Diagnostics.A_signature_with_an_implementation_cannot_use_a_string_literal_type); return; } + // TypeScript 1.0 spec (April 2014): 3.7.2.4 + // Every specialized call or construct signature in an object type must be assignable + // to at least one non-specialized call or construct signature in the same object type var signaturesToCheck; - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 202) { - ts.Debug.assert(signatureDeclarationNode.kind === 138 || signatureDeclarationNode.kind === 139); - var signatureKind = signatureDeclarationNode.kind === 138 ? 0 : 1; + // Unnamed (call\construct) signatures in interfaces are inherited and not shadowed so examining just node symbol won't give complete answer. + // Use declaring type to obtain full list of signatures. + if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 202 /* InterfaceDeclaration */) { + ts.Debug.assert(signatureDeclarationNode.kind === 138 /* CallSignature */ || signatureDeclarationNode.kind === 139 /* ConstructSignature */); + var signatureKind = signatureDeclarationNode.kind === 138 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); var containingType = getDeclaredTypeOfSymbol(containingSymbol); signaturesToCheck = getSignaturesOfType(containingType, signatureKind); @@ -15639,11 +18416,12 @@ var ts; } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = ts.getCombinedNodeFlags(n); - if (n.parent.kind !== 202 && ts.isInAmbientContext(n)) { - if (!(flags & 2)) { - flags |= 1; + if (n.parent.kind !== 202 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { + if (!(flags & 2 /* Ambient */)) { + // It is nested in an ambient context, which means it is automatically exported + flags |= 1 /* Export */; } - flags |= 2; + flags |= 2 /* Ambient */; } return flags & flagsToCheck; } @@ -15652,22 +18430,29 @@ var ts; return; } function getCanonicalOverload(overloads, implementation) { + // Consider the canonical set of flags to be the flags of the bodyDeclaration or the first declaration + // Error on all deviations from this canonical set of flags + // The caveat is that if some overloads are defined in lib.d.ts, we don't want to + // report the errors on those. To achieve this, we will say that the implementation is + // the canonical signature only if it is in the same container as the first overload var implementationSharesContainerWithFirstOverload = implementation !== undefined && implementation.parent === overloads[0].parent; return implementationSharesContainerWithFirstOverload ? implementation : overloads[0]; } function checkFlagAgreementBetweenOverloads(overloads, implementation, flagsToCheck, someOverloadFlags, allOverloadFlags) { + // Error if some overloads have a flag that is not shared by all overloads. To find the + // deviations, we XOR someOverloadFlags with allOverloadFlags var someButNotAllOverloadFlags = someOverloadFlags ^ allOverloadFlags; if (someButNotAllOverloadFlags !== 0) { var canonicalFlags = getEffectiveDeclarationFlags(getCanonicalOverload(overloads, implementation), flagsToCheck); ts.forEach(overloads, function (o) { var deviation = getEffectiveDeclarationFlags(o, flagsToCheck) ^ canonicalFlags; - if (deviation & 1) { + if (deviation & 1 /* Export */) { error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_exported_or_not_exported); } - else if (deviation & 2) { + else if (deviation & 2 /* Ambient */) { error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient); } - else if (deviation & (32 | 64)) { + else if (deviation & (32 /* Private */ | 64 /* Protected */)) { error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_public_private_or_protected); } }); @@ -15684,7 +18469,7 @@ var ts; }); } } - var flagsToCheck = 1 | 2 | 32 | 64; + var flagsToCheck = 1 /* Export */ | 2 /* Ambient */ | 32 /* Private */ | 64 /* Protected */; var someNodeFlags = 0; var allNodeFlags = flagsToCheck; var someHaveQuestionToken = false; @@ -15694,7 +18479,7 @@ var ts; var lastSeenNonAmbientDeclaration; var previousDeclaration; var declarations = symbol.declarations; - var isConstructor = (symbol.flags & 16384) !== 0; + var isConstructor = (symbol.flags & 16384 /* Constructor */) !== 0; function reportImplementationExpectedError(node) { if (node.name && ts.nodeIsMissing(node.name)) { return; @@ -15711,10 +18496,12 @@ var ts; if (subsequentNode) { if (subsequentNode.kind === node.kind) { var errorNode_1 = subsequentNode.name || subsequentNode; + // TODO(jfreeman): These are methods, so handle computed name case if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - 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; + // the only situation when this is possible (same kind\same name but different symbol) - mixed static and instance class members + ts.Debug.assert(node.kind === 134 /* MethodDeclaration */ || node.kind === 133 /* MethodSignature */); + ts.Debug.assert((node.flags & 128 /* Static */) !== (subsequentNode.flags & 128 /* Static */)); + var diagnostic = node.flags & 128 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; error(errorNode_1, diagnostic); return; } @@ -15732,18 +18519,27 @@ var ts; error(errorNode, ts.Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration); } } - var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & 1536; + // when checking exported function declarations across modules check only duplicate implementations + // names and consistency of modifiers are verified when we check local symbol + var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & 1536 /* Module */; var duplicateFunctionDeclaration = false; var multipleConstructorImplementation = false; 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 === 202 || node.parent.kind === 145 || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 202 /* InterfaceDeclaration */ || node.parent.kind === 145 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { + // check if declarations are consecutive only if they are non-ambient + // 1. ambient declarations can be interleaved + // i.e. this is legal + // declare function foo(); + // declare function bar(); + // declare function foo(); + // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if (node.kind === 200 || node.kind === 134 || node.kind === 133 || node.kind === 135) { + if (node.kind === 200 /* FunctionDeclaration */ || node.kind === 134 /* MethodDeclaration */ || node.kind === 133 /* MethodSignature */ || node.kind === 135 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -15793,7 +18589,23 @@ var ts; if (bodyDeclaration) { var signatures = getSignaturesOfSymbol(symbol); var bodySignature = getSignatureFromDeclaration(bodyDeclaration); + // If the implementation signature has string literals, we will have reported an error in + // checkSpecializedSignatureDeclaration if (!bodySignature.hasStringLiterals) { + // TypeScript 1.0 spec (April 2014): 6.1 + // If a function declaration includes overloads, the overloads determine the call + // signatures of the type given to the function object + // and the function implementation signature must be assignable to that type + // + // TypeScript 1.0 spec (April 2014): 3.8.4 + // Note that specialized call and construct signatures (section 3.7.2.4) are not significant when determining assignment compatibility + // Consider checking against specialized signatures too. Not doing so creates a type hole: + // + // function g(x: "hi", y: boolean); + // function g(x: string, y: {}); + // function g(x: string, y: string) { } + // + // The implementation is completely unrelated to the specialized signature, yet we do not check this. for (var _a = 0; _a < signatures.length; _a++) { var signature = signatures[_a]; if (!signature.hasStringLiterals && !isSignatureAssignableTo(bodySignature, signature)) { @@ -15809,21 +18621,30 @@ var ts; if (!produceDiagnostics) { return; } + // Exports should be checked only if enclosing module contains both exported and non exported declarations. + // In case if all declarations are non-exported check is unnecessary. + // if localSymbol is defined on node then node itself is exported - check is required var symbol = node.localSymbol; if (!symbol) { + // local symbol is undefined => this declaration is non-exported. + // however symbol might contain other declarations that are exported symbol = getSymbolOfNode(node); - if (!(symbol.flags & 7340032)) { + if (!(symbol.flags & 7340032 /* Export */)) { + // this is a pure local symbol (all declarations are non-exported) - no need to check anything return; } } + // run the check only for the first declaration in the list if (ts.getDeclarationOfKind(symbol, node.kind) !== node) { return; } + // we use SymbolFlags.ExportValue, SymbolFlags.ExportType and SymbolFlags.ExportNamespace + // to denote disjoint declarationSpaces (without making new enum type). var exportedDeclarationSpaces = 0; var nonExportedDeclarationSpaces = 0; ts.forEach(symbol.declarations, function (d) { var declarationSpaces = getDeclarationSpaces(d); - if (getEffectiveDeclarationFlags(d, 1)) { + if (getEffectiveDeclarationFlags(d, 1 /* Export */)) { exportedDeclarationSpaces |= declarationSpaces; } else { @@ -15832,6 +18653,7 @@ var ts; }); var commonDeclarationSpace = exportedDeclarationSpaces & nonExportedDeclarationSpaces; if (commonDeclarationSpace) { + // declaration spaces for exported and non-exported declarations intersect ts.forEach(symbol.declarations, function (d) { if (getDeclarationSpaces(d) & commonDeclarationSpace) { error(d.name, ts.Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, ts.declarationNameToString(d.name)); @@ -15840,65 +18662,131 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 202: - return 2097152; - case 205: - return d.name.kind === 8 || ts.getModuleInstanceState(d) !== 0 - ? 4194304 | 1048576 - : 4194304; - case 201: - case 204: - return 2097152 | 1048576; - case 208: + case 202 /* InterfaceDeclaration */: + return 2097152 /* ExportType */; + case 205 /* ModuleDeclaration */: + return d.name.kind === 8 /* StringLiteral */ || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ + ? 4194304 /* ExportNamespace */ | 1048576 /* ExportValue */ + : 4194304 /* ExportNamespace */; + case 201 /* ClassDeclaration */: + case 204 /* EnumDeclaration */: + return 2097152 /* ExportType */ | 1048576 /* ExportValue */; + case 208 /* ImportEqualsDeclaration */: var result = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result |= getDeclarationSpaces(d); }); return result; default: - return 1048576; + return 1048576 /* ExportValue */; } } } + /** Check a decorator */ function checkDecorator(node) { var expression = node.expression; var exprType = checkExpression(expression); switch (node.parent.kind) { - case 201: + case 201 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); var classDecoratorType = instantiateSingleCallFunctionType(globalClassDecoratorType, [classConstructorType]); checkTypeAssignableTo(exprType, classDecoratorType, node); break; - case 132: + case 132 /* PropertyDeclaration */: checkTypeAssignableTo(exprType, globalPropertyDecoratorType, node); break; - case 134: - case 136: - case 137: + case 134 /* MethodDeclaration */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var methodDecoratorType = instantiateSingleCallFunctionType(globalMethodDecoratorType, [methodType]); checkTypeAssignableTo(exprType, methodDecoratorType, node); break; - case 129: + case 129 /* Parameter */: checkTypeAssignableTo(exprType, globalParameterDecoratorType, node); break; } } + /** Checks a type reference node as an expression. */ + function checkTypeNodeAsExpression(node) { + // When we are emitting type metadata for decorators, we need to try to check the type + // as if it were an expression so that we can emit the type in a value position when we + // serialize the type metadata. + if (node && node.kind === 141 /* TypeReference */) { + var type = getTypeFromTypeNode(node); + var shouldCheckIfUnknownType = type === unknownType && compilerOptions.separateCompilation; + if (!type || (!shouldCheckIfUnknownType && type.flags & (1048703 /* Intrinsic */ | 132 /* NumberLike */ | 258 /* 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) { + switch (node.kind) { + case 132 /* PropertyDeclaration */: + checkTypeNodeAsExpression(node.type); + break; + case 129 /* Parameter */: + checkTypeNodeAsExpression(node.type); + break; + case 134 /* MethodDeclaration */: + checkTypeNodeAsExpression(node.type); + break; + case 136 /* GetAccessor */: + checkTypeNodeAsExpression(node.type); + break; + case 137 /* 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) { + // ensure all type annotations with a value declaration are checked as an expression + for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { + var parameter = _a[_i]; + checkTypeAnnotationAsExpression(parameter); + } + } + /** Check the decorators of a node */ 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; + // skip this check for nodes that cannot have decorators. These should have already had an error reported by + // checkGrammarDecorators. + if (!ts.nodeCanBeDecorated(node)) { + 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 201 /* ClassDeclaration */: + var constructor = ts.getFirstConstructorWithBody(node); + if (constructor) { + checkParameterTypeAnnotationsAsExpressions(constructor); + } + break; + case 134 /* MethodDeclaration */: + checkParameterTypeAnnotationsAsExpressions(node); + // fall-through + case 137 /* SetAccessor */: + case 136 /* GetAccessor */: + case 132 /* PropertyDeclaration */: + case 129 /* Parameter */: + checkTypeAnnotationAsExpression(node); + break; + } + } + emitDecorate = true; + if (node.kind === 129 /* Parameter */) { + emitParam = true; } ts.forEach(node.decorators, checkDecorator); } @@ -15914,42 +18802,58 @@ var ts; } } function checkFunctionLikeDeclaration(node) { + checkGrammarDeclarationNameInStrictMode(node); checkDecorators(node); checkSignatureDeclaration(node); - if (node.name && node.name.kind === 127) { + // Do not use hasDynamicName here, because that returns false for well known symbols. + // We want to perform checkComputedPropertyName for all computed properties, including + // well known symbols. + if (node.name && node.name.kind === 127 /* ComputedPropertyName */) { + // This check will account for methods in class/interface declarations, + // as well as accessors in classes/object literals checkComputedPropertyName(node.name); } if (!ts.hasDynamicName(node)) { + // first we want to check the local symbol that contain this declaration + // - if node.localSymbol !== undefined - this is current declaration is exported and localSymbol points to the local symbol + // - if node.localSymbol === undefined - this node is non-exported so we can just pick the result of getSymbolOfNode var symbol = getSymbolOfNode(node); var localSymbol = node.localSymbol || symbol; var firstDeclaration = ts.getDeclarationOfKind(localSymbol, node.kind); + // Only type check the symbol once if (node === firstDeclaration) { checkFunctionOrConstructorSymbol(localSymbol); } if (symbol.parent) { + // run check once for the first declaration if (ts.getDeclarationOfKind(symbol, node.kind) === node) { + // run check on export symbol to check that modifiers agree across all exported declarations checkFunctionOrConstructorSymbol(symbol); } } } checkSourceElement(node.body); - if (node.type && !isAccessor(node.kind)) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type)); + if (node.type && !isAccessor(node.kind) && !node.asteriskToken) { + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); } + // Report an implicit any error if there is no body, no explicit return type, and node is not a private method + // in an ambient context if (compilerOptions.noImplicitAny && ts.nodeIsMissing(node.body) && !node.type && !isPrivateWithinAmbient(node)) { reportImplicitAnyError(node, anyType); } } function checkBlock(node) { - if (node.kind === 179) { + // Grammar checking for SyntaxKind.Block + if (node.kind === 179 /* Block */) { checkGrammarStatementInAmbientContext(node); } ts.forEach(node.statements, checkSourceElement); - if (ts.isFunctionBlock(node) || node.kind === 206) { + if (ts.isFunctionBlock(node) || node.kind === 206 /* ModuleBlock */) { checkFunctionExpressionBodies(node); } } function checkCollisionWithArgumentsInGeneratedCode(node) { + // no rest parameters \ declaration context \ overload - no codegen impact if (!ts.hasRestParameters(node) || ts.isInAmbientContext(node) || ts.nodeIsMissing(node.body)) { return; } @@ -15963,19 +18867,22 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 132 || - node.kind === 131 || - node.kind === 134 || - node.kind === 133 || - node.kind === 136 || - node.kind === 137) { + if (node.kind === 132 /* PropertyDeclaration */ || + node.kind === 131 /* PropertySignature */ || + node.kind === 134 /* MethodDeclaration */ || + node.kind === 133 /* MethodSignature */ || + node.kind === 136 /* GetAccessor */ || + node.kind === 137 /* SetAccessor */) { + // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } if (ts.isInAmbientContext(node)) { + // ambient context - no codegen impact return false; } var root = getRootDeclaration(node); - if (root.kind === 129 && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 129 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + // just an overload - no codegen impact return false; } return true; @@ -15985,11 +18892,12 @@ var ts; potentialThisCollisions.push(node); } } + // this function will run after checking the source file so 'CaptureThis' is correct for all nodes function checkIfThisIsCapturedInEnclosingScope(node) { var current = node; while (current) { - if (getNodeCheckFlags(current) & 4) { - var isDeclaration_1 = node.kind !== 65; + if (getNodeCheckFlags(current) & 4 /* CaptureThis */) { + var isDeclaration_1 = node.kind !== 65 /* Identifier */; if (isDeclaration_1) { error(node.name, ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference); } @@ -16005,12 +18913,14 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "_super")) { return; } - var enclosingClass = ts.getAncestor(node, 201); + // bubble up and find containing type + var enclosingClass = ts.getAncestor(node, 201 /* ClassDeclaration */); + // if containing type was not found or it is ambient - exit (no codegen) if (!enclosingClass || ts.isInAmbientContext(enclosingClass)) { return; } if (ts.getClassExtendsHeritageClauseElement(enclosingClass)) { - var isDeclaration_2 = node.kind !== 65; + var isDeclaration_2 = node.kind !== 65 /* Identifier */; if (isDeclaration_2) { error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); } @@ -16023,11 +18933,14 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { return; } - if (node.kind === 205 && ts.getModuleInstanceState(node) !== 1) { + // Uninstantiated modules shouldnt do this check + if (node.kind === 205 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return; } + // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 227 && ts.isExternalModule(parent)) { + if (parent.kind === 227 /* SourceFile */ && ts.isExternalModule(parent)) { + // If the declaration happens to be in external module, report error that require and exports are reserved keywords error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } @@ -16035,28 +18948,57 @@ var ts; // - 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)) { + // - Block : { StatementList } + // It is a Syntax Error if any element of the LexicallyDeclaredNames of StatementList + // also occurs in the VarDeclaredNames of StatementList. + // Variable declarations are hoisted to the top of their function scope. They can shadow + // block scoped declarations, which bind tighter. this will not be flagged as duplicate definition + // by the binder as the declaration scope is different. + // A non-initialized declaration is a no-op as the block declaration will resolve before the var + // declaration. the problem is if the declaration has an initializer. this will act as a write to the + // block declared value. this is fine for let, but not const. + // Only consider declarations with initializers, uninitialized let declarations will not + // step on a let/const variable. + // Do not consider let and const declarations, as duplicate block-scoped declarations + // are handled by the binder. + // We are only looking for let declarations that step on let\const declarations from a + // different scope. e.g.: + // { + // const x = 0; // localDeclarationSymbol obtained after name resolution will correspond to this declaration + // let x = 0; // symbol for this declaration will be 'symbol' + // } + // skip block-scoped variables and parameters + if ((ts.getCombinedNodeFlags(node) & 12288 /* BlockScoped */) !== 0 || isParameterDeclaration(node)) { return; } - if (node.kind === 198 && !node.initializer) { + // skip variable declarations that don't have initializers + // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern + // so we'll always treat binding elements as initialized + if (node.kind === 198 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); - if (symbol.flags & 1) { - var localDeclarationSymbol = resolveName(node, node.name.text, 3, undefined, undefined); + if (symbol.flags & 1 /* FunctionScopedVariable */) { + var localDeclarationSymbol = resolveName(node, node.name.text, 3 /* Variable */, 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 + localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { + if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 12288 /* BlockScoped */) { + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 199 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 180 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; + // names of block-scoped and function scoped variables can collide only + // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 179 && ts.isFunctionLike(container.parent) || - container.kind === 206 || - container.kind === 205 || - container.kind === 227); + (container.kind === 179 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 206 /* ModuleBlock */ || + container.kind === 205 /* ModuleDeclaration */ || + container.kind === 227 /* SourceFile */); + // here we know that function scoped variable is shadowed by block scoped one + // if they are defined in the same scope - binder has already reported redeclaration error + // otherwise if variable has an initializer - show error that initialization will fail + // since LHS will be block scoped name instead of function scoped if (!namesShareScope) { var name_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); @@ -16066,27 +19008,31 @@ var ts; } } function isParameterDeclaration(node) { - while (node.kind === 152) { + while (node.kind === 152 /* BindingElement */) { node = node.parent.parent; } - return node.kind === 129; + return node.kind === 129 /* Parameter */; } + // Check that a parameter initializer contains no references to parameters declared to the right of itself function checkParameterInitializer(node) { - if (getRootDeclaration(node).kind !== 129) { + if (getRootDeclaration(node).kind !== 129 /* Parameter */) { return; } var func = ts.getContainingFunction(node); visit(node.initializer); function visit(n) { - if (n.kind === 65) { + if (n.kind === 65 /* Identifier */) { var referencedSymbol = getNodeLinks(n).resolvedSymbol; - if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(func.locals, referencedSymbol.name, 107455) === referencedSymbol) { - if (referencedSymbol.valueDeclaration.kind === 129) { + // check FunctionLikeDeclaration.locals (stores parameters\function local variable) + // if it contains entry with a specified name and if this entry matches the resolved symbol + if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(func.locals, referencedSymbol.name, 107455 /* Value */) === referencedSymbol) { + if (referencedSymbol.valueDeclaration.kind === 129 /* Parameter */) { if (referencedSymbol.valueDeclaration === node) { error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.declarationNameToString(node.name)); return; } if (referencedSymbol.valueDeclaration.pos < node.pos) { + // legal case - parameter initializer references some parameter strictly on left of current parameter declaration return; } } @@ -16098,22 +19044,31 @@ var ts; } } } + // Check variable, parameter, or property declaration function checkVariableLikeDeclaration(node) { + checkGrammarDeclarationNameInStrictMode(node); checkDecorators(node); checkSourceElement(node.type); - if (node.name.kind === 127) { + // For a computed property, just check the initializer and exit + // Do not use hasDynamicName here, because that returns false for well known symbols. + // We want to perform checkComputedPropertyName for all computed properties, including + // well known symbols. + if (node.name.kind === 127 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } + // For a binding pattern, check contained binding elements if (ts.isBindingPattern(node.name)) { ts.forEach(node.name.elements, checkSourceElement); } - if (node.initializer && getRootDeclaration(node).kind === 129 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body + if (node.initializer && getRootDeclaration(node).kind === 129 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } + // For a binding pattern, validate the initializer and exit if (ts.isBindingPattern(node.name)) { if (node.initializer) { checkTypeAssignableTo(checkExpressionCached(node.initializer), getWidenedTypeForVariableLikeDeclaration(node), node, undefined); @@ -16124,12 +19079,15 @@ var ts; var symbol = getSymbolOfNode(node); var type = getTypeOfVariableOrParameterOrProperty(symbol); if (node === symbol.valueDeclaration) { + // Node is the primary declaration of the symbol, just validate the initializer if (node.initializer) { checkTypeAssignableTo(checkExpressionCached(node.initializer), type, node, undefined); checkParameterInitializer(node); } } else { + // Node is a secondary declaration, check that type is identical to primary declaration and check that + // initializer is consistent with type associated with the node var declarationType = getWidenedTypeForVariableLikeDeclaration(node); if (type !== unknownType && declarationType !== unknownType && !isTypeIdenticalTo(type, declarationType)) { error(node.name, ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, ts.declarationNameToString(node.name), typeToString(type), typeToString(declarationType)); @@ -16138,9 +19096,10 @@ var ts; checkTypeAssignableTo(checkExpressionCached(node.initializer), declarationType, node, undefined); } } - if (node.kind !== 132 && node.kind !== 131) { + if (node.kind !== 132 /* PropertyDeclaration */ && node.kind !== 131 /* PropertySignature */) { + // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 198 || node.kind === 152) { + if (node.kind === 198 /* VariableDeclaration */ || node.kind === 152 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); @@ -16157,6 +19116,7 @@ var ts; return checkVariableLikeDeclaration(node); } function checkVariableStatement(node) { + // Grammar checking checkGrammarDecorators(node) || checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || checkGrammarModifiers(node) || checkGrammarVariableDeclarationList(node.declarationList) || checkGrammarForDisallowedLetOrConstStatement(node); ts.forEach(node.declarationList.declarations, checkSourceElement); } @@ -16169,40 +19129,45 @@ var ts; } function inBlockOrObjectLiteralExpression(node) { while (node) { - if (node.kind === 179 || node.kind === 154) { + if (node.kind === 179 /* Block */ || node.kind === 154 /* ObjectLiteralExpression */) { return true; } node = node.parent; } } function checkExpressionStatement(node) { + // Grammar checking checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); } function checkIfStatement(node) { + // Grammar checking checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.thenStatement); checkSourceElement(node.elseStatement); } function checkDoStatement(node) { + // Grammar checking checkGrammarStatementInAmbientContext(node); checkSourceElement(node.statement); checkExpression(node.expression); } function checkWhileStatement(node) { + // Grammar checking checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.statement); } function checkForStatement(node) { + // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind == 199) { + if (node.initializer && node.initializer.kind == 199 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 199) { + if (node.initializer.kind === 199 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -16217,18 +19182,32 @@ var ts; } function checkForOfStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.initializer.kind === 199) { + // Check the LHS and RHS + // If the LHS is a declaration, just check it as a variable declaration, which will in turn check the RHS + // via checkRightHandSideOfForOf. + // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. + // Then check that the RHS is assignable to it. + if (node.initializer.kind === 199 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression); - if (varExpr.kind === 153 || varExpr.kind === 154) { + // There may be a destructuring assignment on the left side + if (varExpr.kind === 153 /* ArrayLiteralExpression */ || varExpr.kind === 154 /* ObjectLiteralExpression */) { + // iteratedType may be undefined. In this case, we still want to check the structure of + // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like + // to short circuit the type relation checking as much as possible, so we pass the unknownType. checkDestructuringAssignment(varExpr, iteratedType || unknownType); } else { var leftType = checkExpression(varExpr); - checkReferenceExpression(varExpr, ts.Diagnostics.Invalid_left_hand_side_in_for_of_statement, ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_be_a_previously_defined_constant); + checkReferenceExpression(varExpr, ts.Diagnostics.Invalid_left_hand_side_in_for_of_statement, + /*constantVariableMessage*/ ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_be_a_previously_defined_constant); + // iteratedType will be undefined if the rightType was missing properties/signatures + // required to get its iteratedType (like [Symbol.iterator] or next). This may be + // because we accessed properties from anyType, or it may have led to an error inside + // getIteratedType. if (iteratedType) { checkTypeAssignableTo(iteratedType, leftType, varExpr, undefined); } @@ -16237,8 +19216,14 @@ var ts; checkSourceElement(node.statement); } function checkForInStatement(node) { + // Grammar checking checkGrammarForInOrForOfStatement(node); - if (node.initializer.kind === 199) { + // TypeScript 1.0 spec (April 2014): 5.4 + // In a 'for-in' statement of the form + // for (let VarDecl in Expr) Statement + // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, + // and Expr must be an expression of type Any, an object type, or a type parameter type. + if (node.initializer.kind === 199 /* VariableDeclarationList */) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -16246,26 +19231,34 @@ var ts; checkForInOrForOfVariableDeclaration(node); } else { + // In a 'for-in' statement of the form + // for (Var in Expr) Statement + // Var must be an expression classified as a reference of type Any or the String primitive type, + // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 153 || varExpr.kind === 154) { + if (varExpr.kind === 153 /* ArrayLiteralExpression */ || varExpr.kind === 154 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } - else if (!allConstituentTypesHaveKind(leftType, 1 | 258)) { + else if (!allConstituentTypesHaveKind(leftType, 1 /* Any */ | 258 /* StringLike */)) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any); } else { + // run check only former check succeeded to avoid cascading errors checkReferenceExpression(varExpr, ts.Diagnostics.Invalid_left_hand_side_in_for_in_statement, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_previously_defined_constant); } } var rightType = checkExpression(node.expression); - if (!allConstituentTypesHaveKind(rightType, 1 | 48128 | 512)) { + // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved + // in this case error about missing name is already reported - do not report extra one + if (!allConstituentTypesHaveKind(rightType, 1 /* Any */ | 48128 /* ObjectType */ | 512 /* TypeParameter */)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); } checkSourceElement(node.statement); } function checkForInOrForOfVariableDeclaration(iterationStatement) { var variableDeclarationList = iterationStatement.initializer; + // checkGrammarForInOrForOfStatement will check that there is exactly one declaration. if (variableDeclarationList.declarations.length >= 1) { var decl = variableDeclarationList.declarations[0]; checkVariableDeclaration(decl); @@ -16273,21 +19266,40 @@ var ts; } function checkRightHandSideOfForOf(rhsExpression) { var expressionType = getTypeOfExpression(rhsExpression); - return languageVersion >= 2 - ? checkIteratedType(expressionType, rhsExpression) - : checkElementTypeOfArrayOrString(expressionType, rhsExpression); + return checkIteratedTypeOrElementType(expressionType, rhsExpression, true); } - 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; - checkTypeAssignableTo(iterable, completeIterableType, expressionForError); + function checkIteratedTypeOrElementType(inputType, errorNode, allowStringInput) { + if (inputType.flags & 1 /* Any */) { + return inputType; + } + if (languageVersion >= 2 /* ES6 */) { + return checkIteratedType(inputType, errorNode) || anyType; + } + if (allowStringInput) { + return checkElementTypeOfArrayOrString(inputType, errorNode); + } + if (isArrayLikeType(inputType)) { + var indexType = getIndexTypeOfType(inputType, 1 /* Number */); + if (indexType) { + return indexType; + } + } + error(errorNode, ts.Diagnostics.Type_0_is_not_an_array_type, typeToString(inputType)); + return unknownType; + } + /** + * When errorNode is undefined, it means we should not report any errors. + */ + function checkIteratedType(iterable, errorNode) { + ts.Debug.assert(languageVersion >= 2 /* ES6 */); + var iteratedType = getIteratedType(iterable, errorNode); + // Now even though we have extracted the iteratedType, we will have to validate that the type + // passed in is actually an Iterable. + if (errorNode && iteratedType) { + checkTypeAssignableTo(iterable, createIterableType(iteratedType), errorNode); } return iteratedType; - function getIteratedType(iterable, expressionForError) { + function getIteratedType(iterable, errorNode) { // 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): // @@ -16313,75 +19325,106 @@ var ts; // 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)) { + if (allConstituentTypesHaveKind(iterable, 1 /* Any */)) { return undefined; } + // As an optimization, if the type is instantiated directly using the globalIterableType (Iterable), + // then just grab its type argument. + if ((iterable.flags & 4096 /* Reference */) && iterable.target === globalIterableType) { + return iterable.typeArguments[0]; + } var iteratorFunction = getTypeOfPropertyOfType(iterable, ts.getPropertyNameForKnownSymbolName("iterator")); - if (iteratorFunction && allConstituentTypesHaveKind(iteratorFunction, 1)) { + if (iteratorFunction && allConstituentTypesHaveKind(iteratorFunction, 1 /* Any */)) { return undefined; } - var iteratorFunctionSignatures = iteratorFunction ? getSignaturesOfType(iteratorFunction, 0) : emptyArray; + var iteratorFunctionSignatures = iteratorFunction ? getSignaturesOfType(iteratorFunction, 0 /* Call */) : emptyArray; if (iteratorFunctionSignatures.length === 0) { - if (expressionForError) { - error(expressionForError, ts.Diagnostics.The_right_hand_side_of_a_for_of_statement_must_have_a_Symbol_iterator_method_that_returns_an_iterator); + if (errorNode) { + error(errorNode, ts.Diagnostics.Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator); } return undefined; } var iterator = getUnionType(ts.map(iteratorFunctionSignatures, getReturnTypeOfSignature)); - if (allConstituentTypesHaveKind(iterator, 1)) { + if (allConstituentTypesHaveKind(iterator, 1 /* Any */)) { return undefined; } var iteratorNextFunction = getTypeOfPropertyOfType(iterator, "next"); - if (iteratorNextFunction && allConstituentTypesHaveKind(iteratorNextFunction, 1)) { + if (iteratorNextFunction && allConstituentTypesHaveKind(iteratorNextFunction, 1 /* Any */)) { return undefined; } - var iteratorNextFunctionSignatures = iteratorNextFunction ? getSignaturesOfType(iteratorNextFunction, 0) : emptyArray; + var iteratorNextFunctionSignatures = iteratorNextFunction ? getSignaturesOfType(iteratorNextFunction, 0 /* Call */) : emptyArray; if (iteratorNextFunctionSignatures.length === 0) { - if (expressionForError) { - error(expressionForError, ts.Diagnostics.The_iterator_returned_by_the_right_hand_side_of_a_for_of_statement_must_have_a_next_method); + if (errorNode) { + error(errorNode, ts.Diagnostics.An_iterator_must_have_a_next_method); } return undefined; } var iteratorNextResult = getUnionType(ts.map(iteratorNextFunctionSignatures, getReturnTypeOfSignature)); - if (allConstituentTypesHaveKind(iteratorNextResult, 1)) { + if (allConstituentTypesHaveKind(iteratorNextResult, 1 /* Any */)) { return undefined; } var iteratorNextValue = getTypeOfPropertyOfType(iteratorNextResult, "value"); if (!iteratorNextValue) { - if (expressionForError) { - error(expressionForError, ts.Diagnostics.The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property); + if (errorNode) { + error(errorNode, ts.Diagnostics.The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property); } return undefined; } return iteratorNextValue; } } - function checkElementTypeOfArrayOrString(arrayOrStringType, expressionForError) { - ts.Debug.assert(languageVersion < 2); - var arrayType = removeTypesFromUnionType(arrayOrStringType, 258, true, true); + /** + * This function does the following steps: + * 1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents. + * 2. Take the element types of the array constituents. + * 3. Return the union of the element types, and string if there was a string constitutent. + * + * For example: + * string -> string + * number[] -> number + * string[] | number[] -> string | number + * string | number[] -> string | number + * string | string[] | number[] -> string | number + * + * It also errors if: + * 1. Some constituent is neither a string nor an array. + * 2. Some constituent is a string and target is less than ES5 (because in ES3 string is not indexable). + */ + function checkElementTypeOfArrayOrString(arrayOrStringType, errorNode) { + ts.Debug.assert(languageVersion < 2 /* ES6 */); + // After we remove all types that are StringLike, we will know if there was a string constituent + // based on whether the remaining type is the same as the initial type. + var arrayType = removeTypesFromUnionType(arrayOrStringType, 258 /* StringLike */, true, true); var hasStringConstituent = arrayOrStringType !== arrayType; var reportedError = false; if (hasStringConstituent) { - if (languageVersion < 1) { - error(expressionForError, ts.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); + if (languageVersion < 1 /* ES5 */) { + error(errorNode, ts.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); reportedError = true; } + // Now that we've removed all the StringLike types, if no constituents remain, then the entire + // arrayOrStringType was a string. if (arrayType === emptyObjectType) { return stringType; } } if (!isArrayLikeType(arrayType)) { if (!reportedError) { + // Which error we report depends on whether there was a string constituent. For example, + // if the input type is number | string, we want to say that number is not an array type. + // But if the input was just number, we want to say that number 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)); + error(errorNode, diagnostic, typeToString(arrayType)); } return hasStringConstituent ? stringType : unknownType; } - var arrayElementType = getIndexTypeOfType(arrayType, 1) || unknownType; + var arrayElementType = getIndexTypeOfType(arrayType, 1 /* Number */) || unknownType; if (hasStringConstituent) { - if (arrayElementType.flags & 258) { + // This is just an optimization for the case where arrayOrStringType is string | string[] + if (arrayElementType.flags & 258 /* StringLike */) { return stringType; } return getUnionType([arrayElementType, stringType]); @@ -16389,12 +19432,15 @@ var ts; return arrayElementType; } function checkBreakOrContinueStatement(node) { + // Grammar checking checkGrammarStatementInAmbientContext(node) || checkGrammarBreakOrContinueStatement(node); + // TODO: Check that target label is valid } function isGetAccessorWithAnnotatatedSetAccessor(node) { - return !!(node.kind === 136 && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 137))); + return !!(node.kind === 136 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 137 /* SetAccessor */))); } function checkReturnStatement(node) { + // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { var functionBlock = ts.getContainingFunction(node); if (!functionBlock) { @@ -16406,11 +19452,11 @@ var ts; if (func) { var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func)); var exprType = checkExpressionCached(node.expression); - if (func.kind === 137) { + if (func.kind === 137 /* SetAccessor */) { error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); } else { - if (func.kind === 135) { + if (func.kind === 135 /* Constructor */) { if (!isTypeAssignableTo(exprType, returnType)) { error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -16423,8 +19469,9 @@ var ts; } } function checkWithStatement(node) { + // Grammar checking for withStatement if (!checkGrammarStatementInAmbientContext(node)) { - if (node.parserContextFlags & 1) { + if (node.parserContextFlags & 1 /* StrictMode */) { grammarErrorOnFirstToken(node, ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode); } } @@ -16432,12 +19479,14 @@ var ts; error(node.expression, ts.Diagnostics.All_symbols_within_a_with_block_will_be_resolved_to_any); } function checkSwitchStatement(node) { + // Grammar checking checkGrammarStatementInAmbientContext(node); var firstDefaultClause; var hasDuplicateDefaultClause = false; var expressionType = checkExpression(node.expression); ts.forEach(node.caseBlock.clauses, function (clause) { - if (clause.kind === 221 && !hasDuplicateDefaultClause) { + // Grammar check for duplicate default clauses, skip if we already report duplicate default clause + if (clause.kind === 221 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -16449,10 +19498,13 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 220) { + if (produceDiagnostics && clause.kind === 220 /* CaseClause */) { var caseClause = clause; + // TypeScript 1.0 spec (April 2014):5.9 + // In a 'switch' statement, each 'case' expression must be of a type that is assignable to or from the type of the 'switch' expression. var caseType = checkExpression(caseClause.expression); if (!isTypeAssignableTo(expressionType, caseType)) { + // check 'expressionType isAssignableTo caseType' failed, try the reversed check and report errors if it fails checkTypeAssignableTo(caseType, expressionType, caseClause.expression, undefined); } } @@ -16460,13 +19512,14 @@ var ts; }); } function checkLabeledStatement(node) { + // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { var current = node.parent; while (current) { if (ts.isFunctionLike(current)) { break; } - if (current.kind === 194 && current.label.text === node.label.text) { + if (current.kind === 194 /* LabeledStatement */ && current.label.text === node.label.text) { var sourceFile = ts.getSourceFileOfNode(node); grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNodeFromSourceText(sourceFile.text, node.label)); break; @@ -16474,9 +19527,11 @@ var ts; current = current.parent; } } + // ensure that label is unique checkSourceElement(node.statement); } function checkThrowStatement(node) { + // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { if (node.expression === undefined) { grammarErrorAfterFirstToken(node, ts.Diagnostics.Line_break_not_permitted_here); @@ -16487,12 +19542,14 @@ var ts; } } function checkTryStatement(node) { + // Grammar checking checkGrammarStatementInAmbientContext(node); checkBlock(node.tryBlock); var catchClause = node.catchClause; if (catchClause) { + // Grammar checking if (catchClause.variableDeclaration) { - if (catchClause.variableDeclaration.name.kind !== 65) { + if (catchClause.variableDeclaration.name.kind !== 65 /* Identifier */) { grammarErrorOnFirstToken(catchClause.variableDeclaration.name, ts.Diagnostics.Catch_clause_variable_name_must_be_an_identifier); } else if (catchClause.variableDeclaration.type) { @@ -16506,10 +19563,12 @@ var ts; var locals = catchClause.block.locals; if (locals && ts.hasProperty(locals, identifierName)) { var localSymbol = locals[identifierName]; - if (localSymbol && (localSymbol.flags & 2) !== 0) { + if (localSymbol && (localSymbol.flags & 2 /* BlockScopedVariable */) !== 0) { grammarErrorOnNode(localSymbol.valueDeclaration, ts.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause, identifierName); } } + // It is a SyntaxError if a TryStatement with a Catch occurs within strict code and the Identifier of the + // Catch production is eval or arguments checkGrammarEvalOrArgumentsInStrictMode(node, catchClause.variableDeclaration.name); } } @@ -16520,24 +19579,27 @@ var ts; } } function checkIndexConstraints(type) { - var declaredNumberIndexer = getIndexDeclarationOfSymbol(type.symbol, 1); - var declaredStringIndexer = getIndexDeclarationOfSymbol(type.symbol, 0); - var stringIndexType = getIndexTypeOfType(type, 0); - var numberIndexType = getIndexTypeOfType(type, 1); + var declaredNumberIndexer = getIndexDeclarationOfSymbol(type.symbol, 1 /* Number */); + var declaredStringIndexer = getIndexDeclarationOfSymbol(type.symbol, 0 /* String */); + var stringIndexType = getIndexTypeOfType(type, 0 /* String */); + var numberIndexType = getIndexTypeOfType(type, 1 /* Number */); if (stringIndexType || numberIndexType) { ts.forEach(getPropertiesOfObjectType(type), function (prop) { var propType = getTypeOfSymbol(prop); - checkIndexConstraintForProperty(prop, propType, type, declaredStringIndexer, stringIndexType, 0); - checkIndexConstraintForProperty(prop, propType, type, declaredNumberIndexer, numberIndexType, 1); + checkIndexConstraintForProperty(prop, propType, type, declaredStringIndexer, stringIndexType, 0 /* String */); + checkIndexConstraintForProperty(prop, propType, type, declaredNumberIndexer, numberIndexType, 1 /* Number */); }); - if (type.flags & 1024 && type.symbol.valueDeclaration.kind === 201) { + if (type.flags & 1024 /* Class */ && type.symbol.valueDeclaration.kind === 201 /* ClassDeclaration */) { var classDeclaration = type.symbol.valueDeclaration; for (var _i = 0, _a = classDeclaration.members; _i < _a.length; _i++) { var member = _a[_i]; - if (!(member.flags & 128) && ts.hasDynamicName(member)) { + // Only process instance properties with computed names here. + // Static properties cannot be in conflict with indexers, + // and properties with literal names were already checked. + if (!(member.flags & 128 /* Static */) && ts.hasDynamicName(member)) { var propType = getTypeOfSymbol(member.symbol); - checkIndexConstraintForProperty(member.symbol, propType, type, declaredStringIndexer, stringIndexType, 0); - checkIndexConstraintForProperty(member.symbol, propType, type, declaredNumberIndexer, numberIndexType, 1); + checkIndexConstraintForProperty(member.symbol, propType, type, declaredStringIndexer, stringIndexType, 0 /* String */); + checkIndexConstraintForProperty(member.symbol, propType, type, declaredNumberIndexer, numberIndexType, 1 /* Number */); } } } @@ -16545,8 +19607,9 @@ var ts; var errorNode; 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); }); + // condition 'errorNode === undefined' may appear if types does not declare nor string neither number indexer + if (!errorNode && (type.flags & 2048 /* Interface */)) { + var someBaseTypeHasBothIndexers = ts.forEach(getBaseTypes(type), function (base) { return getIndexTypeOfType(base, 0 /* String */) && getIndexTypeOfType(base, 1 /* Number */); }); errorNode = someBaseTypeHasBothIndexers ? undefined : type.symbol.declarations[0]; } } @@ -16557,22 +19620,28 @@ var ts; if (!indexType) { return; } - if (indexKind === 1 && !isNumericName(prop.valueDeclaration.name)) { + // index is numeric and property name is not valid numeric literal + if (indexKind === 1 /* Number */ && !isNumericName(prop.valueDeclaration.name)) { return; } + // perform property check if property or indexer is declared in 'type' + // this allows to rule out cases when both property and indexer are inherited from the base class var errorNode; - if (prop.valueDeclaration.name.kind === 127 || prop.parent === containingType.symbol) { + if (prop.valueDeclaration.name.kind === 127 /* ComputedPropertyName */ || prop.parent === containingType.symbol) { errorNode = prop.valueDeclaration; } else if (indexDeclaration) { errorNode = indexDeclaration; } - else if (containingType.flags & 2048) { - var someBaseClassHasBothPropertyAndIndexer = ts.forEach(containingType.baseTypes, function (base) { return getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind); }); + else if (containingType.flags & 2048 /* Interface */) { + // for interfaces property and indexer might be inherited from different bases + // check if any base class already has both property and indexer. + // check should be performed only if 'type' is the first type that brings property\indexer together + var someBaseClassHasBothPropertyAndIndexer = ts.forEach(getBaseTypes(containingType), 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 + var errorMessage = indexKind === 0 /* String */ ? 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)); @@ -16580,6 +19649,8 @@ var ts; } } function checkTypeNameIsReserved(name, message) { + // TS 1.0 spec (April 2014): 3.6.1 + // The predefined type keywords are reserved and cannot be used as names of user defined types. switch (name.text) { case "any": case "number": @@ -16590,6 +19661,7 @@ var ts; error(name, message, name.text); } } + // Check each type parameter and check that list has no duplicate type parameter declarations function checkTypeParameters(typeParameterDeclarations) { if (typeParameterDeclarations) { for (var i = 0, n = typeParameterDeclarations.length; i < n; i++) { @@ -16611,9 +19683,14 @@ var ts; return unknownType; } function checkClassDeclaration(node) { - if (node.parent.kind !== 206 && node.parent.kind !== 227) { + checkGrammarDeclarationNameInStrictMode(node); + // Grammar checking + if (node.parent.kind !== 206 /* ModuleBlock */ && node.parent.kind !== 227 /* SourceFile */) { grammarErrorOnNode(node, ts.Diagnostics.class_declarations_are_only_supported_directly_inside_a_module_or_as_a_top_level_declaration); } + if (!node.name && !(node.flags & 256 /* Default */)) { + grammarErrorOnFirstToken(node, ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name); + } checkGrammarClassDeclarationHeritageClauses(node); checkDecorators(node); if (node.name) { @@ -16634,19 +19711,21 @@ var ts; emitExtends = emitExtends || !ts.isInAmbientContext(node); checkHeritageClauseElement(baseTypeNode); } - if (type.baseTypes.length) { + var baseTypes = getBaseTypes(type); + if (baseTypes.length) { if (produceDiagnostics) { - var baseType = type.baseTypes[0]; + var baseType = baseTypes[0]; 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.expression, 107455)) { + if (baseType.symbol !== resolveEntityName(baseTypeNode.expression, 107455 /* Value */)) { error(baseTypeNode, ts.Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType)); } checkKindsOfPropertyMemberOverrides(type, baseType); } } - if (type.baseTypes.length || (baseTypeNode && compilerOptions.separateCompilation)) { + if (baseTypes.length || (baseTypeNode && compilerOptions.separateCompilation)) { + // Check that base type can be evaluated as expression checkExpressionOrQualifiedName(baseTypeNode.expression); } var implementedTypeNodes = ts.getClassImplementsHeritageClauseElements(node); @@ -16659,8 +19738,8 @@ var ts; if (produceDiagnostics) { var t = getTypeFromHeritageClauseElement(typeRefNode); if (t !== unknownType) { - var declaredType = (t.flags & 4096) ? t.target : t; - if (declaredType.flags & (1024 | 2048)) { + var declaredType = (t.flags & 4096 /* Reference */) ? t.target : t; + if (declaredType.flags & (1024 /* Class */ | 2048 /* Interface */)) { checkTypeAssignableTo(type, t, node.name || node, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); } else { @@ -16677,7 +19756,9 @@ var ts; } } function getTargetSymbol(s) { - return s.flags & 16777216 ? getSymbolLinks(s).target : s; + // if symbol is instantiated its flags are not copied from the 'target' + // so we'll need to get back original 'target' symbol to work with correct set of flags + return s.flags & 16777216 /* Instantiated */ ? getSymbolLinks(s).target : s; } function checkKindsOfPropertyMemberOverrides(type, baseType) { // TypeScript 1.0 spec (April 2014): 8.2.3 @@ -16693,43 +19774,47 @@ var ts; // 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. + // NOTE: assignability is checked in checkClassDeclaration var baseProperties = getPropertiesOfObjectType(baseType); for (var _i = 0; _i < baseProperties.length; _i++) { var baseProperty = baseProperties[_i]; var base = getTargetSymbol(baseProperty); - if (base.flags & 134217728) { + if (base.flags & 134217728 /* Prototype */) { continue; } var derived = getTargetSymbol(getPropertyOfObjectType(type, base.name)); if (derived) { var baseDeclarationFlags = getDeclarationFlagsFromSymbol(base); var derivedDeclarationFlags = getDeclarationFlagsFromSymbol(derived); - if ((baseDeclarationFlags & 32) || (derivedDeclarationFlags & 32)) { + if ((baseDeclarationFlags & 32 /* Private */) || (derivedDeclarationFlags & 32 /* Private */)) { + // either base or derived property is private - not override, skip it continue; } - if ((baseDeclarationFlags & 128) !== (derivedDeclarationFlags & 128)) { + if ((baseDeclarationFlags & 128 /* Static */) !== (derivedDeclarationFlags & 128 /* Static */)) { + // value of 'static' is not the same for properties - not override, skip it continue; } - if ((base.flags & derived.flags & 8192) || ((base.flags & 98308) && (derived.flags & 98308))) { + if ((base.flags & derived.flags & 8192 /* Method */) || ((base.flags & 98308 /* PropertyOrAccessor */) && (derived.flags & 98308 /* PropertyOrAccessor */))) { + // method is overridden with method or property/accessor is overridden with property/accessor - correct case continue; } var errorMessage = void 0; - if (base.flags & 8192) { - if (derived.flags & 98304) { + if (base.flags & 8192 /* Method */) { + if (derived.flags & 98304 /* Accessor */) { errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; } else { - ts.Debug.assert((derived.flags & 4) !== 0); + ts.Debug.assert((derived.flags & 4 /* Property */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property; } } - else if (base.flags & 4) { - ts.Debug.assert((derived.flags & 8192) !== 0); + else if (base.flags & 4 /* Property */) { + ts.Debug.assert((derived.flags & 8192 /* Method */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; } else { - ts.Debug.assert((base.flags & 98304) !== 0); - ts.Debug.assert((derived.flags & 8192) !== 0); + ts.Debug.assert((base.flags & 98304 /* Accessor */) !== 0); + ts.Debug.assert((derived.flags & 8192 /* Method */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; } error(derived.valueDeclaration.name, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); @@ -16737,7 +19822,7 @@ var ts; } } function isAccessor(kind) { - return kind === 136 || kind === 137; + return kind === 136 /* GetAccessor */ || kind === 137 /* SetAccessor */; } function areTypeParametersIdentical(list1, list2) { if (!list1 && !list2) { @@ -16746,6 +19831,9 @@ var ts; if (!list1 || !list2 || list1.length !== list2.length) { return false; } + // TypeScript 1.0 spec (April 2014): + // When a generic interface has multiple declarations, all declarations must have identical type parameter + // lists, i.e. identical type parameter names with identical constraints in identical order. for (var i = 0, len = list1.length; i < len; i++) { var tp1 = list1[i]; var tp2 = list2[i]; @@ -16758,24 +19846,25 @@ var ts; if (!tp1.constraint || !tp2.constraint) { return false; } - if (!isTypeIdenticalTo(getTypeFromTypeNodeOrHeritageClauseElement(tp1.constraint), getTypeFromTypeNodeOrHeritageClauseElement(tp2.constraint))) { + if (!isTypeIdenticalTo(getTypeFromTypeNode(tp1.constraint), getTypeFromTypeNode(tp2.constraint))) { return false; } } return true; } function checkInheritedPropertiesAreIdentical(type, typeNode) { - if (!type.baseTypes.length || type.baseTypes.length === 1) { + var baseTypes = getBaseTypes(type); + if (baseTypes.length < 2) { return true; } 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; _i < _a.length; _i++) { - var base = _a[_i]; + for (var _i = 0; _i < baseTypes.length; _i++) { + var base = baseTypes[_i]; var properties = getPropertiesOfObjectType(base); - for (var _b = 0; _b < properties.length; _b++) { - var prop = properties[_b]; + for (var _a = 0; _a < properties.length; _a++) { + var prop = properties[_a]; if (!ts.hasProperty(seen, prop.name)) { seen[prop.name] = { prop: prop, containingType: base }; } @@ -16796,22 +19885,25 @@ var ts; return ok; } function checkInterfaceDeclaration(node) { - checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarInterfaceDeclaration(node); + // Grammar checking + checkGrammarDeclarationNameInStrictMode(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, 202); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 202 /* InterfaceDeclaration */); if (symbol.declarations.length > 1) { if (node !== firstInterfaceDecl && !areTypeParametersIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); } } + // Only check this symbol once if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); + // run subsequent checks only if first set succeeded if (checkInheritedPropertiesAreIdentical(type, node.name)) { - ts.forEach(type.baseTypes, function (baseType) { + ts.forEach(getBaseTypes(type), function (baseType) { checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1); }); checkIndexConstraints(type); @@ -16830,20 +19922,21 @@ var ts; } } function checkTypeAliasDeclaration(node) { + // Grammar checking 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)) { + if (!(nodeLinks.flags & 128 /* EnumValuesComputed */)) { 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 !== 127 && isNumericLiteralName(member.name.text)) { + if (member.name.kind !== 127 /* ComputedPropertyName */ && isNumericLiteralName(member.name.text)) { error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name); } var initializer = member.initializer; @@ -16854,6 +19947,10 @@ var ts; error(initializer, ts.Diagnostics.In_const_enum_declarations_member_initializer_must_be_constant_expression); } else if (!ambient) { + // Only here do we need to check that the initializer is assignable to the enum type. + // If it is a constant value (not undefined), it is syntactically constrained to be a number. + // Also, we do not need to check this for ambients because there is already + // a syntax error if it is not a constant. checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, undefined); } } @@ -16873,24 +19970,24 @@ var ts; getNodeLinks(member).enumMemberValue = autoValue++; } }); - nodeLinks.flags |= 128; + nodeLinks.flags |= 128 /* EnumValuesComputed */; } function getConstantValueForEnumMemberInitializer(initializer) { return evalConstant(initializer); function evalConstant(e) { switch (e.kind) { - case 167: + case 167 /* PrefixUnaryExpression */: var value = evalConstant(e.operand); if (value === undefined) { return undefined; } switch (e.operator) { - case 33: return value; - case 34: return -value; - case 47: return ~value; + case 33 /* PlusToken */: return value; + case 34 /* MinusToken */: return -value; + case 47 /* TildeToken */: return ~value; } return undefined; - case 169: + case 169 /* BinaryExpression */: var left = evalConstant(e.left); if (left === undefined) { return undefined; @@ -16900,39 +19997,41 @@ 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 /* BarToken */: return left | right; + case 43 /* AmpersandToken */: return left & right; + case 41 /* GreaterThanGreaterThanToken */: return left >> right; + case 42 /* GreaterThanGreaterThanGreaterThanToken */: return left >>> right; + case 40 /* LessThanLessThanToken */: return left << right; + case 45 /* CaretToken */: return left ^ right; + case 35 /* AsteriskToken */: return left * right; + case 36 /* SlashToken */: return left / right; + case 33 /* PlusToken */: return left + right; + case 34 /* MinusToken */: return left - right; + case 37 /* PercentToken */: return left % right; } return undefined; - case 7: + case 7 /* NumericLiteral */: return +e.text; - case 161: + case 161 /* ParenthesizedExpression */: return evalConstant(e.expression); - case 65: - case 156: - case 155: + case 65 /* Identifier */: + case 156 /* ElementAccessExpression */: + case 155 /* PropertyAccessExpression */: var member = initializer.parent; var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); var enumType; var propertyName; - if (e.kind === 65) { + if (e.kind === 65 /* Identifier */) { + // unqualified names can refer to member that reside in different declaration of the enum so just doing name resolution won't work. + // instead pick current enum type and later try to fetch member from the type enumType = currentType; propertyName = e.text; } else { var expression; - if (e.kind === 156) { + if (e.kind === 156 /* ElementAccessExpression */) { if (e.argumentExpression === undefined || - e.argumentExpression.kind !== 8) { + e.argumentExpression.kind !== 8 /* StringLiteral */) { return undefined; } expression = e.expression; @@ -16942,12 +20041,13 @@ var ts; expression = e.expression; propertyName = e.name.text; } + // expression part in ElementAccess\PropertyAccess should be either identifier or dottedName var current = expression; while (current) { - if (current.kind === 65) { + if (current.kind === 65 /* Identifier */) { break; } - else if (current.kind === 155) { + else if (current.kind === 155 /* PropertyAccessExpression */) { current = current.expression; } else { @@ -16955,7 +20055,8 @@ var ts; } } enumType = checkExpression(expression); - if (!(enumType.symbol && (enumType.symbol.flags & 384))) { + // allow references to constant members of other enums + if (!(enumType.symbol && (enumType.symbol.flags & 384 /* Enum */))) { return undefined; } } @@ -16963,13 +20064,15 @@ var ts; return undefined; } var property = getPropertyOfObjectType(enumType, propertyName); - if (!property || !(property.flags & 8)) { + if (!property || !(property.flags & 8 /* EnumMember */)) { return undefined; } var propertyDecl = property.valueDeclaration; + // self references are illegal if (member === propertyDecl) { return undefined; } + // illegal case: forward reference if (!isDefinedBefore(propertyDecl, member)) { return undefined; } @@ -16982,7 +20085,8 @@ var ts; if (!produceDiagnostics) { return; } - checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarEnumDeclaration(node); + // Grammar checking + checkGrammarDeclarationNameInStrictMode(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); @@ -16992,10 +20096,17 @@ var ts; if (compilerOptions.separateCompilation && enumIsConst && ts.isInAmbientContext(node)) { error(node.name, ts.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 + // for the first member. + // + // Only perform this check once per symbol var enumSymbol = getSymbolOfNode(node); var firstDeclaration = ts.getDeclarationOfKind(enumSymbol, node.kind); if (node === firstDeclaration) { if (enumSymbol.declarations.length > 1) { + // check that const is placed\omitted on all enum declarations 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); @@ -17004,7 +20115,8 @@ var ts; } var seenEnumMissingInitialInitializer = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 204) { + // return true if we hit a violation of the rule, false otherwise + if (declaration.kind !== 204 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -17027,16 +20139,32 @@ var ts; var declarations = symbol.declarations; for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; - if ((declaration.kind === 201 || (declaration.kind === 200 && ts.nodeIsPresent(declaration.body))) && !ts.isInAmbientContext(declaration)) { + if ((declaration.kind === 201 /* ClassDeclaration */ || + (declaration.kind === 200 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + !ts.isInAmbientContext(declaration)) { return declaration; } } return undefined; } + function inSameLexicalScope(node1, node2) { + var container1 = ts.getEnclosingBlockScopeContainer(node1); + var container2 = ts.getEnclosingBlockScopeContainer(node2); + if (isGlobalSourceFile(container1)) { + return isGlobalSourceFile(container2); + } + else if (isGlobalSourceFile(container2)) { + return false; + } + else { + return container1 === container2; + } + } function checkModuleDeclaration(node) { if (produceDiagnostics) { - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node)) { - if (!ts.isInAmbientContext(node) && node.name.kind === 8) { + // Grammar checking + if (!checkGrammarDeclarationNameInStrictMode(node) && !checkGrammarDecorators(node) && !checkGrammarModifiers(node)) { + if (!ts.isInAmbientContext(node) && node.name.kind === 8 /* StringLiteral */) { grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names); } } @@ -17044,21 +20172,30 @@ var ts; checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - if (symbol.flags & 512 + // The following checks only apply on a non-ambient instantiated module declaration. + if (symbol.flags & 512 /* ValueModule */ && 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)) { + var firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); + if (firstNonAmbientClassOrFunc) { + if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(firstNonAmbientClassOrFunc)) { error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); } - else if (node.pos < classOrFunc.pos) { + else if (node.pos < firstNonAmbientClassOrFunc.pos) { error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); } } + // if the module merges with a class declaration in the same lexical scope, + // we need to track this to ensure the correct emit. + var mergedClass = ts.getDeclarationOfKind(symbol, 201 /* ClassDeclaration */); + if (mergedClass && + inSameLexicalScope(node, mergedClass)) { + getNodeLinks(node).flags |= 2048 /* LexicalModuleMergesWithClass */; + } } - if (node.name.kind === 8) { + // Checks for ambient external modules. + if (node.name.kind === 8 /* StringLiteral */) { if (!isGlobalSourceFile(node.parent)) { error(node.name, ts.Diagnostics.Ambient_external_modules_cannot_be_nested_in_other_modules); } @@ -17071,33 +20208,37 @@ var ts; } function getFirstIdentifier(node) { while (true) { - if (node.kind === 126) { + if (node.kind === 126 /* QualifiedName */) { node = node.left; } - else if (node.kind === 155) { + else if (node.kind === 155 /* PropertyAccessExpression */) { node = node.expression; } else { break; } } - ts.Debug.assert(node.kind === 65); + ts.Debug.assert(node.kind === 65 /* Identifier */); return node; } function checkExternalImportOrExportDeclaration(node) { var moduleName = ts.getExternalModuleName(node); - if (!ts.nodeIsMissing(moduleName) && moduleName.kind !== 8) { + if (!ts.nodeIsMissing(moduleName) && moduleName.kind !== 8 /* StringLiteral */) { error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 206 && node.parent.parent.name.kind === 8; - if (node.parent.kind !== 227 && !inAmbientExternalModule) { - error(moduleName, node.kind === 215 ? + var inAmbientExternalModule = node.parent.kind === 206 /* ModuleBlock */ && node.parent.parent.name.kind === 8 /* StringLiteral */; + if (node.parent.kind !== 227 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 215 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_an_internal_module : ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); return false; } if (inAmbientExternalModule && isExternalModuleNameRelative(moduleName.text)) { + // TypeScript 1.0 spec (April 2013): 12.1.6 + // An ExternalImportDeclaration in an AmbientExternalModuleDeclaration may reference + // other external modules only through top - level external module names. + // Relative external module names are not permitted. error(node, ts.Diagnostics.Import_or_export_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name); return false; } @@ -17107,11 +20248,11 @@ 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 /* Value */ ? 107455 /* Value */ : 0) | + (symbol.flags & 793056 /* Type */ ? 793056 /* Type */ : 0) | + (symbol.flags & 1536 /* Namespace */ ? 1536 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 217 ? + var message = node.kind === 217 /* ExportSpecifier */ ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); @@ -17124,7 +20265,7 @@ var ts; checkAliasSymbol(node); } function checkImportDeclaration(node) { - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) { + if (!checkGrammarImportDeclarationNameInStrictMode(node) && !checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499 /* Modifier */)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_import_declaration_cannot_have_modifiers); } if (checkExternalImportOrExportDeclaration(node)) { @@ -17134,7 +20275,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 211) { + if (importClause.namedBindings.kind === 211 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); } else { @@ -17145,46 +20286,51 @@ var ts; } } function checkImportEqualsDeclaration(node) { - checkGrammarDecorators(node) || checkGrammarModifiers(node); + checkGrammarDeclarationNameInStrictMode(node) || checkGrammarDecorators(node) || checkGrammarModifiers(node); if (ts.isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) { checkImportBinding(node); - if (node.flags & 1) { + if (node.flags & 1 /* Export */) { markExportAsReferenced(node); } if (ts.isInternalModuleImportEqualsDeclaration(node)) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { - if (target.flags & 107455) { + if (target.flags & 107455 /* Value */) { + // Target is a value symbol, check that it is not hidden by a local declaration with the same name var moduleName = getFirstIdentifier(node.moduleReference); - if (!(resolveEntityName(moduleName, 107455 | 1536).flags & 1536)) { + if (!(resolveEntityName(moduleName, 107455 /* Value */ | 1536 /* Namespace */).flags & 1536 /* Namespace */)) { error(moduleName, ts.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, ts.declarationNameToString(moduleName)); } } - if (target.flags & 793056) { + if (target.flags & 793056 /* Type */) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Import_name_cannot_be_0); } } } else { - if (languageVersion >= 2) { + if (languageVersion >= 2 /* ES6 */) { + // Import equals declaration is deprecated in es6 or above 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 (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) { + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499 /* Modifier */)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_declaration_cannot_have_modifiers); } if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) { if (node.exportClause) { + // export { x, y } + // export { x, y } from "foo" ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 206 && node.parent.parent.name.kind === 8; - if (node.parent.kind !== 227 && !inAmbientExternalModule) { + var inAmbientExternalModule = node.parent.kind === 206 /* ModuleBlock */ && node.parent.parent.name.kind === 8 /* StringLiteral */; + if (node.parent.kind !== 227 /* SourceFile */ && !inAmbientExternalModule) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_an_internal_module); } } else { + // export * from "foo" var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); if (moduleSymbol && moduleSymbol.exports["export="]) { error(node.moduleSpecifier, ts.Diagnostics.External_module_0_uses_export_and_cannot_be_used_with_export_Asterisk, symbolToString(moduleSymbol)); @@ -17199,38 +20345,32 @@ var ts; } } function checkExportAssignment(node) { - var container = node.parent.kind === 227 ? node.parent : node.parent.parent; - if (container.kind === 205 && container.name.kind === 65) { + var container = node.parent.kind === 227 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 205 /* ModuleDeclaration */ && container.name.kind === 65 /* Identifier */) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); return; } - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) { + // Grammar checking + if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499 /* Modifier */)) { grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_assignment_cannot_have_modifiers); } - if (node.expression) { - if (node.expression.kind === 65) { - markExportAsReferenced(node); - } - else { - checkExpressionCached(node.expression); - } + if (node.expression.kind === 65 /* Identifier */) { + markExportAsReferenced(node); } - 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); - } + else { + checkExpressionCached(node.expression); } checkExternalModuleExports(container); - if (node.isExportEquals && languageVersion >= 2) { + if (node.isExportEquals && languageVersion >= 2 /* ES6 */) { + // export assignment is deprecated in es6 or above grammarErrorOnNode(node, ts.Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead); } } function getModuleStatements(node) { - if (node.kind === 227) { + if (node.kind === 227 /* SourceFile */) { return node.statements; } - if (node.kind === 205 && node.body.kind === 206) { + if (node.kind === 205 /* ModuleDeclaration */ && node.body.kind === 206 /* ModuleBlock */) { return node.body.statements; } return emptyArray; @@ -17259,187 +20399,196 @@ var ts; if (!node) return; switch (node.kind) { - case 128: + case 128 /* TypeParameter */: return checkTypeParameter(node); - case 129: + case 129 /* Parameter */: return checkParameter(node); - case 132: - case 131: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: return checkPropertyDeclaration(node); - case 142: - case 143: - case 138: - case 139: + case 142 /* FunctionType */: + case 143 /* ConstructorType */: + case 138 /* CallSignature */: + case 139 /* ConstructSignature */: return checkSignatureDeclaration(node); - case 140: + case 140 /* IndexSignature */: return checkSignatureDeclaration(node); - case 134: - case 133: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: return checkMethodDeclaration(node); - case 135: + case 135 /* Constructor */: return checkConstructorDeclaration(node); - case 136: - case 137: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: return checkAccessorDeclaration(node); - case 141: + case 141 /* TypeReference */: return checkTypeReferenceNode(node); - case 144: + case 144 /* TypeQuery */: return checkTypeQuery(node); - case 145: + case 145 /* TypeLiteral */: return checkTypeLiteral(node); - case 146: + case 146 /* ArrayType */: return checkArrayType(node); - case 147: + case 147 /* TupleType */: return checkTupleType(node); - case 148: + case 148 /* UnionType */: return checkUnionType(node); - case 149: + case 149 /* ParenthesizedType */: return checkSourceElement(node.type); - case 200: + case 200 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 179: - case 206: + case 179 /* Block */: + case 206 /* ModuleBlock */: return checkBlock(node); - case 180: + case 180 /* VariableStatement */: return checkVariableStatement(node); - case 182: + case 182 /* ExpressionStatement */: return checkExpressionStatement(node); - case 183: + case 183 /* IfStatement */: return checkIfStatement(node); - case 184: + case 184 /* DoStatement */: return checkDoStatement(node); - case 185: + case 185 /* WhileStatement */: return checkWhileStatement(node); - case 186: + case 186 /* ForStatement */: return checkForStatement(node); - case 187: + case 187 /* ForInStatement */: return checkForInStatement(node); - case 188: + case 188 /* ForOfStatement */: return checkForOfStatement(node); - case 189: - case 190: + case 189 /* ContinueStatement */: + case 190 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 191: + case 191 /* ReturnStatement */: return checkReturnStatement(node); - case 192: + case 192 /* WithStatement */: return checkWithStatement(node); - case 193: + case 193 /* SwitchStatement */: return checkSwitchStatement(node); - case 194: + case 194 /* LabeledStatement */: return checkLabeledStatement(node); - case 195: + case 195 /* ThrowStatement */: return checkThrowStatement(node); - case 196: + case 196 /* TryStatement */: return checkTryStatement(node); - case 198: + case 198 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 152: + case 152 /* BindingElement */: return checkBindingElement(node); - case 201: + case 201 /* ClassDeclaration */: return checkClassDeclaration(node); - case 202: + case 202 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 203: + case 203 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 204: + case 204 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 205: + case 205 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 209: + case 209 /* ImportDeclaration */: return checkImportDeclaration(node); - case 208: + case 208 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 215: + case 215 /* ExportDeclaration */: return checkExportDeclaration(node); - case 214: + case 214 /* ExportAssignment */: return checkExportAssignment(node); - case 181: + case 181 /* EmptyStatement */: checkGrammarStatementInAmbientContext(node); return; - case 197: + case 197 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 218: + case 218 /* MissingDeclaration */: return checkMissingDeclaration(node); } } + // Function expression bodies are checked after all statements in the enclosing body. This is to ensure + // constructs like the following are permitted: + // let foo = function () { + // let s = foo(); + // return "hello"; + // } + // Here, performing a full type check of the body of the function expression whilst in the process of + // determining the type of foo would cause foo to be given type any because of the recursive reference. + // Delaying the type check of the body ensures foo has been assigned a type. function checkFunctionExpressionBodies(node) { switch (node.kind) { - case 162: - case 163: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: ts.forEach(node.parameters, checkFunctionExpressionBodies); checkFunctionExpressionOrObjectLiteralMethodBody(node); break; - case 134: - case 133: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: ts.forEach(node.parameters, checkFunctionExpressionBodies); if (ts.isObjectLiteralMethod(node)) { checkFunctionExpressionOrObjectLiteralMethodBody(node); } break; - case 135: - case 136: - case 137: - case 200: + case 135 /* Constructor */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 200 /* FunctionDeclaration */: ts.forEach(node.parameters, checkFunctionExpressionBodies); break; - case 192: + case 192 /* WithStatement */: checkFunctionExpressionBodies(node.expression); break; - case 129: - case 132: - case 131: - case 150: - case 151: - case 152: - case 153: - case 154: - case 224: - case 155: - case 156: - case 157: - case 158: - case 159: - case 171: - case 176: - case 160: - case 161: - case 165: - case 166: - case 164: - case 167: - case 168: - case 169: - case 170: - case 173: - case 179: - case 206: - case 180: - case 182: - case 183: - case 184: - case 185: - case 186: - case 187: - case 188: - case 189: - case 190: - case 191: - case 193: - case 207: - case 220: - case 221: - case 194: - case 195: - case 196: - case 223: - case 198: - case 199: - case 201: - case 204: - case 226: - case 214: - case 227: + case 129 /* Parameter */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 150 /* ObjectBindingPattern */: + case 151 /* ArrayBindingPattern */: + case 152 /* BindingElement */: + case 153 /* ArrayLiteralExpression */: + case 154 /* ObjectLiteralExpression */: + case 224 /* PropertyAssignment */: + case 155 /* PropertyAccessExpression */: + case 156 /* ElementAccessExpression */: + case 157 /* CallExpression */: + case 158 /* NewExpression */: + case 159 /* TaggedTemplateExpression */: + case 171 /* TemplateExpression */: + case 176 /* TemplateSpan */: + case 160 /* TypeAssertionExpression */: + case 161 /* ParenthesizedExpression */: + case 165 /* TypeOfExpression */: + case 166 /* VoidExpression */: + case 164 /* DeleteExpression */: + case 167 /* PrefixUnaryExpression */: + case 168 /* PostfixUnaryExpression */: + case 169 /* BinaryExpression */: + case 170 /* ConditionalExpression */: + case 173 /* SpreadElementExpression */: + case 179 /* Block */: + case 206 /* ModuleBlock */: + case 180 /* VariableStatement */: + case 182 /* ExpressionStatement */: + case 183 /* IfStatement */: + case 184 /* DoStatement */: + case 185 /* WhileStatement */: + case 186 /* ForStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: + case 189 /* ContinueStatement */: + case 190 /* BreakStatement */: + case 191 /* ReturnStatement */: + case 193 /* SwitchStatement */: + case 207 /* CaseBlock */: + case 220 /* CaseClause */: + case 221 /* DefaultClause */: + case 194 /* LabeledStatement */: + case 195 /* ThrowStatement */: + case 196 /* TryStatement */: + case 223 /* CatchClause */: + case 198 /* VariableDeclaration */: + case 199 /* VariableDeclarationList */: + case 201 /* ClassDeclaration */: + case 204 /* EnumDeclaration */: + case 226 /* EnumMember */: + case 214 /* ExportAssignment */: + case 227 /* SourceFile */: ts.forEachChild(node, checkFunctionExpressionBodies); break; } @@ -17449,11 +20598,15 @@ var ts; checkSourceFileWorker(node); ts.checkTime += new Date().getTime() - start; } + // Fully type check a source file and collect the relevant diagnostics. function checkSourceFileWorker(node) { var links = getNodeLinks(node); - if (!(links.flags & 1)) { + if (!(links.flags & 1 /* TypeChecked */)) { + // Grammar checking checkGrammarSourceFile(node); emitExtends = false; + emitDecorate = false; + emitParam = false; potentialThisCollisions.length = 0; ts.forEach(node.statements, checkSourceElement); checkFunctionExpressionBodies(node); @@ -17465,12 +20618,15 @@ var ts; potentialThisCollisions.length = 0; } if (emitExtends) { - links.flags |= 8; + links.flags |= 8 /* EmitExtends */; } if (emitDecorate) { - links.flags |= 512; + links.flags |= 512 /* EmitDecorate */; } - links.flags |= 1; + if (emitParam) { + links.flags |= 1024 /* EmitParam */; + } + links.flags |= 1 /* TypeChecked */; } } function getDiagnostics(sourceFile) { @@ -17491,10 +20647,11 @@ var ts; throw new Error("Trying to get diagnostics from a type checker that does not produce them."); } } + // Language service support function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 192 && node.parent.statement === node) { + if (node.parent.kind === 192 /* WithStatement */ && node.parent.statement === node) { return true; } node = node.parent; @@ -17506,6 +20663,7 @@ var ts; var symbols = {}; var memberFlags = 0; if (isInsideWithStatementBody(location)) { + // We cannot answer semantic questions within a with block, do not proceed any further return []; } populateSymbols(); @@ -17516,23 +20674,23 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 227: + case 227 /* SourceFile */: if (!ts.isExternalModule(location)) { break; } - case 205: - copySymbols(getSymbolOfNode(location).exports, meaning & 8914931); + case 205 /* ModuleDeclaration */: + copySymbols(getSymbolOfNode(location).exports, meaning & 8914931 /* ModuleMember */); break; - case 204: - copySymbols(getSymbolOfNode(location).exports, meaning & 8); + case 204 /* EnumDeclaration */: + copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 201: - case 202: - if (!(memberFlags & 128)) { - copySymbols(getSymbolOfNode(location).members, meaning & 793056); + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + if (!(memberFlags & 128 /* Static */)) { + copySymbols(getSymbolOfNode(location).members, meaning & 793056 /* Type */); } break; - case 162: + case 162 /* FunctionExpression */: if (location.name) { copySymbol(location.symbol, meaning); } @@ -17543,6 +20701,7 @@ var ts; } copySymbols(globals, meaning); } + // Returns 'true' if we should stop processing symbols. function copySymbol(symbol, meaning) { if (symbol.flags & meaning) { var id = symbol.name; @@ -17561,6 +20720,7 @@ var ts; } } if (isInsideWithStatementBody(location)) { + // We cannot answer semantic questions within a with block, do not proceed any further return []; } while (location) { @@ -17568,22 +20728,22 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 227: + case 227 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 205: - copySymbols(getSymbolOfNode(location).exports, meaning & 8914931); + case 205 /* ModuleDeclaration */: + copySymbols(getSymbolOfNode(location).exports, meaning & 8914931 /* ModuleMember */); break; - case 204: - copySymbols(getSymbolOfNode(location).exports, meaning & 8); + case 204 /* EnumDeclaration */: + copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 201: - case 202: - if (!(memberFlags & 128)) { - copySymbols(getSymbolOfNode(location).members, meaning & 793056); + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + if (!(memberFlags & 128 /* Static */)) { + copySymbols(getSymbolOfNode(location).members, meaning & 793056 /* Type */); } break; - case 162: + case 162 /* FunctionExpression */: if (location.name) { copySymbol(location.symbol, meaning); } @@ -17596,110 +20756,124 @@ var ts; return symbolsToArray(symbols); } function isTypeDeclarationName(name) { - return name.kind == 65 && + return name.kind == 65 /* Identifier */ && isTypeDeclaration(name.parent) && name.parent.name === name; } function isTypeDeclaration(node) { switch (node.kind) { - case 128: - case 201: - case 202: - case 203: - case 204: + case 128 /* TypeParameter */: + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + case 203 /* TypeAliasDeclaration */: + case 204 /* EnumDeclaration */: return true; } } + // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 126) { + while (node.parent && node.parent.kind === 126 /* QualifiedName */) { node = node.parent; } - return node.parent && node.parent.kind === 141; + return node.parent && node.parent.kind === 141 /* TypeReference */; } function isHeritageClauseElementIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 155) { + while (node.parent && node.parent.kind === 155 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent && node.parent.kind === 177; + return node.parent && node.parent.kind === 177 /* HeritageClauseElement */; } - function isTypeNodeOrHeritageClauseElement(node) { - if (141 <= node.kind && node.kind <= 149) { + function isTypeNode(node) { + if (141 /* FirstTypeNode */ <= node.kind && node.kind <= 149 /* LastTypeNode */) { return true; } switch (node.kind) { - case 112: - case 119: - case 121: - case 113: - case 122: + case 112 /* AnyKeyword */: + case 119 /* NumberKeyword */: + case 121 /* StringKeyword */: + case 113 /* BooleanKeyword */: + case 122 /* SymbolKeyword */: return true; - case 99: - return node.parent.kind !== 166; - case 8: - return node.parent.kind === 129; - case 177: + case 99 /* VoidKeyword */: + return node.parent.kind !== 166 /* VoidExpression */; + case 8 /* StringLiteral */: + // Specialized signatures can have string literals as their parameters' type names + return node.parent.kind === 129 /* Parameter */; + case 177 /* HeritageClauseElement */: return true; - case 65: - if (node.parent.kind === 126 && node.parent.right === node) { + // Identifiers and qualified names may be type nodes, depending on their context. Climb + // above them to find the lowest container + case 65 /* Identifier */: + // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. + if (node.parent.kind === 126 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 155 && node.parent.name === node) { + else if (node.parent.kind === 155 /* PropertyAccessExpression */ && 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'."); + // fall through + case 126 /* QualifiedName */: + case 155 /* PropertyAccessExpression */: + // At this point, node is either a qualified name or an identifier + ts.Debug.assert(node.kind === 65 /* Identifier */ || node.kind === 126 /* QualifiedName */ || node.kind === 155 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); var parent_5 = node.parent; - if (parent_5.kind === 144) { + if (parent_5.kind === 144 /* TypeQuery */) { return false; } - if (141 <= parent_5.kind && parent_5.kind <= 149) { + // Do not recursively call isTypeNode on the parent. In the example: + // + // let a: A.B.C; + // + // Calling isTypeNode would consider the qualified name A.B a type node. Only C or + // A.B.C is a type node. + if (141 /* FirstTypeNode */ <= parent_5.kind && parent_5.kind <= 149 /* LastTypeNode */) { return true; } switch (parent_5.kind) { - case 177: + case 177 /* HeritageClauseElement */: return true; - case 128: + case 128 /* TypeParameter */: return node === parent_5.constraint; - case 132: - case 131: - case 129: - case 198: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 129 /* Parameter */: + case 198 /* VariableDeclaration */: return node === parent_5.type; - case 200: - case 162: - case 163: - case 135: - case 134: - case 133: - case 136: - case 137: + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: + case 135 /* Constructor */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: return node === parent_5.type; - case 138: - case 139: - case 140: + case 138 /* CallSignature */: + case 139 /* ConstructSignature */: + case 140 /* IndexSignature */: return node === parent_5.type; - case 160: + case 160 /* TypeAssertionExpression */: return node === parent_5.type; - case 157: - case 158: + case 157 /* CallExpression */: + case 158 /* NewExpression */: return parent_5.typeArguments && ts.indexOf(parent_5.typeArguments, node) >= 0; - case 159: + case 159 /* TaggedTemplateExpression */: + // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } } return false; } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 126) { + while (nodeOnRightSide.parent.kind === 126 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 208) { + if (nodeOnRightSide.parent.kind === 208 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 214) { + if (nodeOnRightSide.parent.kind === 214 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -17711,11 +20885,13 @@ var ts; if (ts.isDeclarationName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 214) { - return resolveEntityName(entityName, 107455 | 793056 | 1536 | 8388608); + if (entityName.parent.kind === 214 /* ExportAssignment */) { + return resolveEntityName(entityName, + /*all meanings*/ 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */ | 8388608 /* Alias */); } - if (entityName.kind !== 155) { + if (entityName.kind !== 155 /* PropertyAccessExpression */) { if (isInRightSideOfImportOrExportAssignment(entityName)) { + // Since we already checked for ExportAssignment, this really could only be an Import return getSymbolOfPartOfRightHandSideOfImportEquals(entityName); } } @@ -17723,26 +20899,29 @@ var ts; entityName = entityName.parent; } if (isHeritageClauseElementIdentifier(entityName)) { - var meaning = entityName.parent.kind === 177 ? 793056 : 1536; - meaning |= 8388608; + var meaning = entityName.parent.kind === 177 /* HeritageClauseElement */ ? 793056 /* Type */ : 1536 /* Namespace */; + meaning |= 8388608 /* Alias */; return resolveEntityName(entityName, meaning); } else if (ts.isExpression(entityName)) { if (ts.nodeIsMissing(entityName)) { + // Missing entity name. return undefined; } - if (entityName.kind === 65) { - var meaning = 107455 | 8388608; + if (entityName.kind === 65 /* Identifier */) { + // Include aliases in the meaning, this ensures that we do not follow aliases to where they point and instead + // return the alias symbol. + var meaning = 107455 /* Value */ | 8388608 /* Alias */; return resolveEntityName(entityName, meaning); } - else if (entityName.kind === 155) { + else if (entityName.kind === 155 /* PropertyAccessExpression */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccessExpression(entityName); } return getNodeLinks(entityName).resolvedSymbol; } - else if (entityName.kind === 126) { + else if (entityName.kind === 126 /* QualifiedName */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkQualifiedName(entityName); @@ -17751,49 +20930,58 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 141 ? 793056 : 1536; - meaning |= 8388608; + var meaning = entityName.parent.kind === 141 /* TypeReference */ ? 793056 /* Type */ : 1536 /* Namespace */; + // Include aliases in the meaning, this ensures that we do not follow aliases to where they point and instead + // return the alias symbol. + meaning |= 8388608 /* Alias */; return resolveEntityName(entityName, meaning); } + // Do we want to return undefined here? return undefined; } function getSymbolInfo(node) { if (isInsideWithStatementBody(node)) { + // We cannot answer semantic questions within a with block, do not proceed any further return undefined; } if (ts.isDeclarationName(node)) { + // This is a declaration, call getSymbolOfNode return getSymbolOfNode(node.parent); } - if (node.kind === 65 && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 214 + if (node.kind === 65 /* Identifier */ && isInRightSideOfImportOrExportAssignment(node)) { + return node.parent.kind === 214 /* ExportAssignment */ ? getSymbolOfEntityNameOrPropertyAccessExpression(node) : getSymbolOfPartOfRightHandSideOfImportEquals(node); } switch (node.kind) { - case 65: - case 155: - case 126: + case 65 /* Identifier */: + case 155 /* PropertyAccessExpression */: + case 126 /* QualifiedName */: return getSymbolOfEntityNameOrPropertyAccessExpression(node); - case 93: - case 91: + case 93 /* ThisKeyword */: + case 91 /* SuperKeyword */: var type = checkExpression(node); return type.symbol; - case 114: + case 114 /* ConstructorKeyword */: + // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 135) { + if (constructorDeclaration && constructorDeclaration.kind === 135 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; - case 8: + case 8 /* StringLiteral */: + // External module name in an import declaration var moduleName; if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 209 || node.parent.kind === 215) && + ((node.parent.kind === 209 /* ImportDeclaration */ || node.parent.kind === 215 /* ExportDeclaration */) && node.parent.moduleSpecifier === node)) { return resolveExternalModuleName(node, node); } - case 7: - if (node.parent.kind == 156 && node.parent.argumentExpression === node) { + // Intentional fall-through + case 7 /* NumericLiteral */: + // index access + if (node.parent.kind == 156 /* ElementAccessExpression */ && node.parent.argumentExpression === node) { var objectType = checkExpression(node.parent.expression); if (objectType === unknownType) return undefined; @@ -17807,22 +20995,27 @@ var ts; return undefined; } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 225) { - return resolveEntityName(location.name, 107455); + // The function returns a value symbol of an identifier in the short-hand property assignment. + // This is necessary as an identifier in short-hand property assignment can contains two meaning: + // property name and property value. + if (location && location.kind === 225 /* ShorthandPropertyAssignment */) { + return resolveEntityName(location.name, 107455 /* Value */); } return undefined; } function getTypeOfNode(node) { if (isInsideWithStatementBody(node)) { + // We cannot answer semantic questions within a with block, do not proceed any further return unknownType; } - if (isTypeNodeOrHeritageClauseElement(node)) { - return getTypeFromTypeNodeOrHeritageClauseElement(node); + if (isTypeNode(node)) { + return getTypeFromTypeNode(node); } if (ts.isExpression(node)) { return getTypeOfExpression(node); } if (isTypeDeclaration(node)) { + // In this case, we call getSymbolOfNode instead of getSymbolInfo because it is a declaration var symbol = getSymbolOfNode(node); return getDeclaredTypeOfSymbol(symbol); } @@ -17831,6 +21024,7 @@ var ts; return symbol && getDeclaredTypeOfSymbol(symbol); } if (ts.isDeclaration(node)) { + // In this case, we call getSymbolOfNode instead of getSymbolInfo because it is a declaration var symbol = getSymbolOfNode(node); return getTypeOfSymbol(symbol); } @@ -17851,10 +21045,12 @@ var ts; } return checkExpression(expr); } + // Return the list of properties of the given type, augmented with properties from Function + // if the type has call or construct signatures function getAugmentedPropertiesOfType(type) { type = getApparentType(type); var propsByName = createSymbolTable(getPropertiesOfType(type)); - if (getSignaturesOfType(type, 0).length || getSignaturesOfType(type, 1).length) { + if (getSignaturesOfType(type, 0 /* Call */).length || getSignaturesOfType(type, 1 /* Construct */).length) { ts.forEach(getPropertiesOfType(globalFunctionType), function (p) { if (!ts.hasProperty(propsByName, p.name)) { propsByName[p.name] = p; @@ -17864,7 +21060,7 @@ var ts; return getNamedMembers(propsByName); } function getRootSymbols(symbol) { - if (symbol.flags & 268435456) { + if (symbol.flags & 268435456 /* UnionProperty */) { var symbols = []; var name_10 = symbol.name; ts.forEach(getSymbolLinks(symbol).unionType.types, function (t) { @@ -17872,7 +21068,7 @@ var ts; }); return symbols; } - else if (symbol.flags & 67108864) { + else if (symbol.flags & 67108864 /* Transient */) { var target = getSymbolLinks(symbol).target; if (target) { return [target]; @@ -17880,19 +21076,29 @@ var ts; } return [symbol]; } + // Emitter support function isExternalModuleSymbol(symbol) { - return symbol.flags & 512 && symbol.declarations.length === 1 && symbol.declarations[0].kind === 227; + return symbol.flags & 512 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 227 /* SourceFile */; } function getAliasNameSubstitution(symbol, getGeneratedNameForNode) { - if (languageVersion >= 2) { + // If this is es6 or higher, just use the name of the export + // no need to qualify it. + if (languageVersion >= 2 /* ES6 */) { return undefined; } var node = getDeclarationOfAliasSymbol(symbol); if (node) { - if (node.kind === 210) { - return getGeneratedNameForNode(node.parent) + ".default"; + if (node.kind === 210 /* ImportClause */) { + var defaultKeyword; + if (languageVersion === 0 /* ES3 */) { + defaultKeyword = "[\"default\"]"; + } + else { + defaultKeyword = ".default"; + } + return getGeneratedNameForNode(node.parent) + defaultKeyword; } - if (node.kind === 213) { + if (node.kind === 213 /* ImportSpecifier */) { var moduleName = getGeneratedNameForNode(node.parent.parent.parent); var propertyName = node.propertyName || node.name; return moduleName + "." + ts.unescapeIdentifier(propertyName.text); @@ -17901,7 +21107,9 @@ var ts; } function getExportNameSubstitution(symbol, location, getGeneratedNameForNode) { if (isExternalModuleSymbol(symbol.parent)) { - if (languageVersion >= 2) { + // If this is es6 or higher, just use the name of the export + // no need to qualify it. + if (languageVersion >= 2 /* ES6 */) { return undefined; } return "exports." + ts.unescapeIdentifier(symbol.name); @@ -17909,7 +21117,7 @@ var ts; var node = location; var containerSymbol = getParentOfSymbol(symbol); while (node) { - if ((node.kind === 205 || node.kind === 204) && getSymbolOfNode(node) === containerSymbol) { + if ((node.kind === 205 /* ModuleDeclaration */ || node.kind === 204 /* EnumDeclaration */) && getSymbolOfNode(node) === containerSymbol) { return getGeneratedNameForNode(node) + "." + ts.unescapeIdentifier(symbol.name); } node = node.parent; @@ -17918,36 +21126,43 @@ var ts; function getExpressionNameSubstitution(node, getGeneratedNameForNode) { var symbol = getNodeLinks(node).resolvedSymbol || (ts.isDeclarationName(node) ? getSymbolOfNode(node.parent) : undefined); if (symbol) { + // Whan an identifier resolves to a parented symbol, it references an exported entity from + // another declaration of the same internal module. if (symbol.parent) { return getExportNameSubstitution(symbol, node.parent, getGeneratedNameForNode); } + // If we reference an exported entity within the same module declaration, then whether + // we prefix depends on the kind of entity. SymbolFlags.ExportHasLocal encompasses all the + // kinds that we do NOT prefix. var exportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); - if (symbol !== exportSymbol && !(exportSymbol.flags & 944)) { + if (symbol !== exportSymbol && !(exportSymbol.flags & 944 /* ExportHasLocal */)) { return getExportNameSubstitution(exportSymbol, node.parent, getGeneratedNameForNode); } - if (symbol.flags & 8388608) { + // Named imports from ES6 import declarations are rewritten + if (symbol.flags & 8388608 /* Alias */) { return getAliasNameSubstitution(symbol, getGeneratedNameForNode); } } } function isValueAliasDeclaration(node) { switch (node.kind) { - case 208: - case 210: - case 211: - case 213: - case 217: + case 208 /* ImportEqualsDeclaration */: + case 210 /* ImportClause */: + case 211 /* NamespaceImport */: + case 213 /* ImportSpecifier */: + case 217 /* ExportSpecifier */: return isAliasResolvedToValue(getSymbolOfNode(node)); - case 215: + case 215 /* ExportDeclaration */: var exportClause = node.exportClause; return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 214: - return node.expression && node.expression.kind === 65 ? isAliasResolvedToValue(getSymbolOfNode(node)) : true; + case 214 /* ExportAssignment */: + return node.expression && node.expression.kind === 65 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node)) : true; } return false; } function isTopLevelValueImportEqualsWithEntityName(node) { - if (node.parent.kind !== 227 || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node.parent.kind !== 227 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + // parent is not source file or it is not reference to internal module return false; } var isValue = isAliasResolvedToValue(getSymbolOfNode(node)); @@ -17958,7 +21173,8 @@ var ts; if (target === unknownSymbol && compilerOptions.separateCompilation) { return true; } - return target !== unknownSymbol && target && target.flags & 107455 && !isConstEnumOrConstEnumOnlyModule(target); + // const enums and modules that contain only const enums are not considered values from the emit perespective + return target !== unknownSymbol && target && target.flags & 107455 /* Value */ && !isConstEnumOrConstEnumOnlyModule(target); } function isConstEnumOrConstEnumOnlyModule(s) { return isConstEnumSymbol(s) || s.constEnumOnlyModule; @@ -17979,7 +21195,18 @@ var ts; if (ts.nodeIsPresent(node.body)) { var symbol = getSymbolOfNode(node); var signaturesOfSymbol = getSignaturesOfSymbol(symbol); + // If this function body corresponds to function with multiple signature, it is implementation of overload + // e.g.: function foo(a: string): string; + // function foo(a: number): number; + // function foo(a: any) { // This is implementation of the overloads + // return a; + // } return signaturesOfSymbol.length > 1 || + // If there is single signature for the symbol, it is overload if that signature isn't coming from the node + // e.g.: function foo(a: string): string; + // function foo(a: any) { // This is implementation of the overloads + // return a; + // } (signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node); } return false; @@ -17992,20 +21219,209 @@ var ts; return getNodeLinks(node).enumMemberValue; } function getConstantValue(node) { - if (node.kind === 226) { + if (node.kind === 226 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; - if (symbol && (symbol.flags & 8)) { + if (symbol && (symbol.flags & 8 /* EnumMember */)) { + // inline property\index accesses only for const enums if (ts.isConstEnumDeclaration(symbol.valueDeclaration.parent)) { return getEnumMemberValue(symbol.valueDeclaration); } } return undefined; } + /** Serializes an EntityName (with substitutions) to an appropriate JS constructor value. Used by the __metadata decorator. */ + function serializeEntityName(node, getGeneratedNameForNode, fallbackPath) { + if (node.kind === 65 /* 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, getGeneratedNameForNode) { + // 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". + var type = getTypeFromTypeReference(node); + if (type.flags & 16 /* Void */) { + return "void 0"; + } + else if (type.flags & 8 /* Boolean */) { + return "Boolean"; + } + else if (type.flags & 132 /* NumberLike */) { + return "Number"; + } + else if (type.flags & 258 /* StringLike */) { + return "String"; + } + else if (type.flags & 8192 /* Tuple */) { + return "Array"; + } + else if (type.flags & 1048576 /* ESSymbol */) { + return "Symbol"; + } + else if (type === unknownType) { + var fallbackPath = []; + 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, getGeneratedNameForNode) { + // 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 99 /* VoidKeyword */: + return "void 0"; + case 149 /* ParenthesizedType */: + return serializeTypeNode(node.type, getGeneratedNameForNode); + case 142 /* FunctionType */: + case 143 /* ConstructorType */: + return "Function"; + case 146 /* ArrayType */: + case 147 /* TupleType */: + return "Array"; + case 113 /* BooleanKeyword */: + return "Boolean"; + case 121 /* StringKeyword */: + case 8 /* StringLiteral */: + return "String"; + case 119 /* NumberKeyword */: + return "Number"; + case 141 /* TypeReference */: + return serializeTypeReferenceNode(node, getGeneratedNameForNode); + case 144 /* TypeQuery */: + case 145 /* TypeLiteral */: + case 148 /* UnionType */: + case 112 /* AnyKeyword */: + break; + default: + ts.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, getGeneratedNameForNode) { + // 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 201 /* ClassDeclaration */: return "Function"; + case 132 /* PropertyDeclaration */: return serializeTypeNode(node.type, getGeneratedNameForNode); + case 129 /* Parameter */: return serializeTypeNode(node.type, getGeneratedNameForNode); + case 136 /* GetAccessor */: return serializeTypeNode(node.type, getGeneratedNameForNode); + case 137 /* SetAccessor */: return serializeTypeNode(getSetAccessorTypeAnnotationNode(node), getGeneratedNameForNode); + } + if (ts.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, getGeneratedNameForNode) { + // 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; + if (node.kind === 201 /* ClassDeclaration */) { + valueDeclaration = ts.getFirstConstructorWithBody(node); + } + else if (ts.isFunctionLike(node) && ts.nodeIsPresent(node.body)) { + valueDeclaration = node; + } + if (valueDeclaration) { + var result; + 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 === 146 /* ArrayType */) { + parameterType = parameterType.elementType; + } + else if (parameterType.kind === 141 /* 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, getGeneratedNameForNode) { + if (node && ts.isFunctionLike(node)) { + return serializeTypeNode(node.type, getGeneratedNameForNode); + } + return "void 0"; + } function writeTypeOfDeclaration(declaration, enclosingDeclaration, flags, writer) { + // Get type of the symbol if this is the valid symbol otherwise get type at location var symbol = getSymbolOfNode(declaration); - var type = symbol && !(symbol.flags & (2048 | 131072)) + var type = symbol && !(symbol.flags & (2048 /* TypeLiteral */ | 131072 /* Signature */)) ? getTypeOfSymbol(symbol) : unknownType; getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); @@ -18023,18 +21439,20 @@ var ts; } function resolvesToSomeValue(location, name) { ts.Debug.assert(!ts.nodeIsSynthesized(location), "resolvesToSomeValue called with a synthesized location"); - return !!resolveName(location, name, 107455, undefined, undefined); + return !!resolveName(location, name, 107455 /* Value */, undefined, undefined); } function getBlockScopedVariableId(n) { ts.Debug.assert(!ts.nodeIsSynthesized(n)); - var isVariableDeclarationOrBindingElement = n.parent.kind === 152 || (n.parent.kind === 198 && n.parent.name === n); + var isVariableDeclarationOrBindingElement = n.parent.kind === 152 /* BindingElement */ || (n.parent.kind === 198 /* VariableDeclaration */ && n.parent.name === n); var symbol = (isVariableDeclarationOrBindingElement ? getSymbolOfNode(n.parent) : undefined) || getNodeLinks(n).resolvedSymbol || - resolveName(n, n.text, 107455 | 8388608, undefined, undefined); + resolveName(n, n.text, 107455 /* Value */ | 8388608 /* Alias */, undefined, undefined); var isLetOrConst = symbol && - (symbol.flags & 2) && - symbol.valueDeclaration.parent.kind !== 223; + (symbol.flags & 2 /* BlockScopedVariable */) && + symbol.valueDeclaration.parent.kind !== 223 /* CatchClause */; if (isLetOrConst) { + // side-effect of calling this method: + // assign id to symbol if it was not yet set getSymbolLinks(symbol); return symbol.id; } @@ -18069,22 +21487,29 @@ var ts; getConstantValue: getConstantValue, resolvesToSomeValue: resolvesToSomeValue, collectLinkedAliases: collectLinkedAliases, - getBlockScopedVariableId: getBlockScopedVariableId + getBlockScopedVariableId: getBlockScopedVariableId, + serializeTypeOfNode: serializeTypeOfNode, + serializeParameterTypesOfNode: serializeParameterTypesOfNode, + serializeReturnTypeOfNode: serializeReturnTypeOfNode }; } function initializeTypeChecker() { + // Bind all source files and propagate errors ts.forEach(host.getSourceFiles(), function (file) { ts.bindSourceFile(file); }); + // Initialize global symbol table ts.forEach(host.getSourceFiles(), function (file) { if (!ts.isExternalModule(file)) { mergeSymbolTable(globals, file.locals); } }); + // Initialize special symbols getSymbolLinks(undefinedSymbol).type = undefinedType; getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments"); getSymbolLinks(unknownSymbol).type = unknownType; globals[undefinedSymbol.name] = undefinedSymbol; + // Initialize special types globalArraySymbol = getGlobalTypeSymbol("Array"); globalArrayType = getTypeOfGlobalSymbol(globalArraySymbol, 1); globalObjectType = getGlobalType("Object"); @@ -18098,7 +21523,9 @@ var ts; globalPropertyDecoratorType = getGlobalType("PropertyDecorator"); globalMethodDecoratorType = getGlobalType("MethodDecorator"); globalParameterDecoratorType = getGlobalType("ParameterDecorator"); - if (languageVersion >= 2) { + // If we're in ES6 mode, load the TemplateStringsArray. + // Otherwise, default to 'unknown' for the purposes of type checking in LS scenarios. + if (languageVersion >= 2 /* ES6 */) { globalTemplateStringsArrayType = getGlobalType("TemplateStringsArray"); globalESSymbolType = getGlobalType("Symbol"); globalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol"); @@ -18106,51 +21533,186 @@ var ts; } else { globalTemplateStringsArrayType = unknownType; + // Consider putting Symbol interface in lib.d.ts. On the plus side, putting it in lib.d.ts would make it + // extensible for Polyfilling Symbols. But putting it into lib.d.ts could also break users that have + // a global Symbol already, particularly if it is a class. globalESSymbolType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); globalESSymbolConstructorSymbol = undefined; } anyArrayType = createArrayType(anyType); } + // GRAMMAR CHECKING + function isReservedWordInStrictMode(node) { + // Check that originalKeywordKind is less than LastFutureReservedWord to see if an Identifier is a strict-mode reserved word + return (node.parserContextFlags & 1 /* StrictMode */) && + (node.originalKeywordKind >= 102 /* FirstFutureReservedWord */ && node.originalKeywordKind <= 110 /* LastFutureReservedWord */); + } + function reportStrictModeGrammarErrorInClassDeclaration(identifier, message, arg0, arg1, arg2) { + // We are checking if this name is inside class declaration or class expression (which are under class definitions inside ES6 spec.) + // if so, we would like to give more explicit invalid usage error. + if (ts.getAncestor(identifier, 201 /* ClassDeclaration */) || ts.getAncestor(identifier, 174 /* ClassExpression */)) { + return grammarErrorOnNode(identifier, message, arg0); + } + return false; + } + function checkGrammarImportDeclarationNameInStrictMode(node) { + // Check if the import declaration used strict-mode reserved word in its names bindings + if (node.importClause) { + var impotClause = node.importClause; + if (impotClause.namedBindings) { + var nameBindings = impotClause.namedBindings; + if (nameBindings.kind === 211 /* NamespaceImport */) { + var name_11 = nameBindings.name; + if (name_11.originalKeywordKind) { + var nameText = ts.declarationNameToString(name_11); + return grammarErrorOnNode(name_11, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); + } + } + else if (nameBindings.kind === 212 /* NamedImports */) { + var reportError = false; + for (var _i = 0, _a = nameBindings.elements; _i < _a.length; _i++) { + var element = _a[_i]; + var name_12 = element.name; + if (name_12.originalKeywordKind) { + var nameText = ts.declarationNameToString(name_12); + reportError = reportError || grammarErrorOnNode(name_12, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); + } + } + return reportError; + } + } + } + return false; + } + function checkGrammarDeclarationNameInStrictMode(node) { + var name = node.name; + if (name && name.kind === 65 /* Identifier */ && isReservedWordInStrictMode(name)) { + var nameText = ts.declarationNameToString(name); + switch (node.kind) { + case 129 /* Parameter */: + case 198 /* VariableDeclaration */: + case 200 /* FunctionDeclaration */: + case 128 /* TypeParameter */: + case 152 /* BindingElement */: + case 202 /* InterfaceDeclaration */: + case 203 /* TypeAliasDeclaration */: + case 204 /* EnumDeclaration */: + return checkGrammarIdentifierInStrictMode(name); + case 201 /* ClassDeclaration */: + // Report an error if the class declaration uses strict-mode reserved word. + return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText); + case 205 /* ModuleDeclaration */: + // Report an error if the module declaration uses strict-mode reserved word. + // TODO(yuisu): fix this when having external module in strict mode + return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); + case 208 /* ImportEqualsDeclaration */: + // TODO(yuisu): fix this when having external module in strict mode + return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); + } + } + return false; + } + function checkGrammarTypeReferenceInStrictMode(typeName) { + // Check if the type reference is using strict mode keyword + // Example: + // class C { + // foo(x: public){} // Error. + // } + if (typeName.kind === 65 /* Identifier */) { + checkGrammarTypeNameInStrictMode(typeName); + } + else if (typeName.kind === 126 /* QualifiedName */) { + // Walk from right to left and report a possible error at each Identifier in QualifiedName + // Example: + // x1: public.private.package // error at public and private + checkGrammarTypeNameInStrictMode(typeName.right); + checkGrammarTypeReferenceInStrictMode(typeName.left); + } + } + // This function will report an error for every identifier in property access expression + // whether it violates strict mode reserved words. + // Example: + // public // error at public + // public.private.package // error at public + // B.private.B // no error + function checkGrammarHeritageClauseElementInStrictMode(expression) { + // Example: + // class C extends public // error at public + if (expression && expression.kind === 65 /* Identifier */) { + return checkGrammarIdentifierInStrictMode(expression); + } + else if (expression && expression.kind === 155 /* PropertyAccessExpression */) { + // Walk from left to right in PropertyAccessExpression until we are at the left most expression + // in PropertyAccessExpression. According to grammar production of MemberExpression, + // the left component expression is a PrimaryExpression (i.e. Identifier) while the other + // component after dots can be IdentifierName. + checkGrammarHeritageClauseElementInStrictMode(expression.expression); + } + } + // The function takes an identifier itself or an expression which has SyntaxKind.Identifier. + function checkGrammarIdentifierInStrictMode(node, nameText) { + if (node && node.kind === 65 /* Identifier */ && isReservedWordInStrictMode(node)) { + if (!nameText) { + nameText = ts.declarationNameToString(node); + } + // TODO (yuisu): Fix when module is a strict mode + var errorReport = reportStrictModeGrammarErrorInClassDeclaration(node, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText) || + grammarErrorOnNode(node, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); + return errorReport; + } + return false; + } + // The function takes an identifier when uses as a typeName in TypeReferenceNode + function checkGrammarTypeNameInStrictMode(node) { + if (node && node.kind === 65 /* Identifier */ && isReservedWordInStrictMode(node)) { + var nameText = ts.declarationNameToString(node); + // TODO (yuisu): Fix when module is a strict mode + var errorReport = reportStrictModeGrammarErrorInClassDeclaration(node, ts.Diagnostics.Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText) || + grammarErrorOnNode(node, ts.Diagnostics.Type_expected_0_is_a_reserved_word_in_strict_mode, nameText); + return errorReport; + } + return false; + } function checkGrammarDecorators(node) { if (!node.decorators) { return false; } if (!ts.nodeCanBeDecorated(node)) { - return grammarErrorOnNode(node, ts.Diagnostics.Decorators_are_not_valid_here); + return grammarErrorOnFirstToken(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 (languageVersion < 1 /* ES5 */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher); } - else if (node.kind === 136 || node.kind === 137) { + else if (node.kind === 136 /* GetAccessor */ || node.kind === 137 /* SetAccessor */) { 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 grammarErrorOnFirstToken(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 136: - case 137: - case 135: - case 132: - case 131: - case 134: - case 133: - case 140: - case 201: - case 202: - case 205: - case 204: - case 180: - case 200: - case 203: - case 209: - case 208: - case 215: - case 214: - case 129: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 135 /* Constructor */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 140 /* IndexSignature */: + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + case 205 /* ModuleDeclaration */: + case 204 /* EnumDeclaration */: + case 180 /* VariableStatement */: + case 200 /* FunctionDeclaration */: + case 203 /* TypeAliasDeclaration */: + case 209 /* ImportDeclaration */: + case 208 /* ImportEqualsDeclaration */: + case 215 /* ExportDeclaration */: + case 214 /* ExportAssignment */: + case 129 /* Parameter */: break; default: return false; @@ -18163,14 +21725,14 @@ var ts; 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 108 /* PublicKeyword */: + case 107 /* ProtectedKeyword */: + case 106 /* PrivateKeyword */: var text = void 0; - if (modifier.kind === 109) { + if (modifier.kind === 108 /* PublicKeyword */) { text = "public"; } - else if (modifier.kind === 108) { + else if (modifier.kind === 107 /* ProtectedKeyword */) { text = "protected"; lastProtected = modifier; } @@ -18178,81 +21740,81 @@ var ts; text = "private"; lastPrivate = modifier; } - if (flags & 112) { + if (flags & 112 /* AccessibilityModifier */) { return grammarErrorOnNode(modifier, ts.Diagnostics.Accessibility_modifier_already_seen); } - else if (flags & 128) { + else if (flags & 128 /* Static */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); } - else if (node.parent.kind === 206 || node.parent.kind === 227) { + else if (node.parent.kind === 206 /* ModuleBlock */ || node.parent.kind === 227 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); } flags |= ts.modifierToFlag(modifier.kind); break; - case 110: - if (flags & 128) { + case 109 /* StaticKeyword */: + if (flags & 128 /* Static */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static"); } - else if (node.parent.kind === 206 || node.parent.kind === 227) { + else if (node.parent.kind === 206 /* ModuleBlock */ || node.parent.kind === 227 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); } - else if (node.kind === 129) { + else if (node.kind === 129 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } - flags |= 128; + flags |= 128 /* Static */; lastStatic = modifier; break; - case 78: - if (flags & 1) { + case 78 /* ExportKeyword */: + if (flags & 1 /* Export */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "export"); } - else if (flags & 2) { + else if (flags & 2 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); } - else if (node.parent.kind === 201) { + else if (node.parent.kind === 201 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 129) { + else if (node.kind === 129 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } - flags |= 1; + flags |= 1 /* Export */; break; - case 115: - if (flags & 2) { + case 115 /* DeclareKeyword */: + if (flags & 2 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); } - else if (node.parent.kind === 201) { + else if (node.parent.kind === 201 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 129) { + else if (node.kind === 129 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 206) { + else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 206 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } - flags |= 2; + flags |= 2 /* Ambient */; lastDeclare = modifier; break; } } - if (node.kind === 135) { - if (flags & 128) { + if (node.kind === 135 /* Constructor */) { + if (flags & 128 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } - else if (flags & 64) { + else if (flags & 64 /* Protected */) { return grammarErrorOnNode(lastProtected, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "protected"); } - else if (flags & 32) { + else if (flags & 32 /* Private */) { return grammarErrorOnNode(lastPrivate, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); } } - else if ((node.kind === 209 || node.kind === 208) && flags & 2) { + else if ((node.kind === 209 /* ImportDeclaration */ || node.kind === 208 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 202 && flags & 2) { + else if (node.kind === 202 /* InterfaceDeclaration */ && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); } - else if (node.kind === 129 && (flags & 112) && ts.isBindingPattern(node.name)) { + else if (node.kind === 129 /* Parameter */ && (flags & 112 /* AccessibilityModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_a_binding_pattern); } } @@ -18286,6 +21848,9 @@ var ts; if (i !== (parameterCount - 1)) { return grammarErrorOnNode(parameter.dotDotDotToken, ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); } + if (ts.isBindingPattern(parameter.name)) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); + } if (parameter.questionToken) { return grammarErrorOnNode(parameter.questionToken, ts.Diagnostics.A_rest_parameter_cannot_be_optional); } @@ -18307,12 +21872,13 @@ var ts; } } function checkGrammarFunctionLikeDeclaration(node) { + // Prevent cascading error by short-circuit 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) { + if (node.kind === 163 /* ArrowFunction */) { var arrowFunction = node; var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; @@ -18335,7 +21901,7 @@ var ts; if (parameter.dotDotDotToken) { return grammarErrorOnNode(parameter.dotDotDotToken, ts.Diagnostics.An_index_signature_cannot_have_a_rest_parameter); } - if (parameter.flags & 499) { + if (parameter.flags & 499 /* Modifier */) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); } if (parameter.questionToken) { @@ -18347,7 +21913,7 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 121 && parameter.type.kind !== 119) { + if (parameter.type.kind !== 121 /* StringKeyword */ && parameter.type.kind !== 119 /* NumberKeyword */) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); } if (!node.type) { @@ -18355,11 +21921,12 @@ var ts; } } function checkGrammarForIndexSignatureModifier(node) { - if (node.flags & 499) { + if (node.flags & 499 /* Modifier */) { grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_not_permitted_on_index_signature_members); } } function checkGrammarIndexSignature(node) { + // Prevent cascading error by short-circuit return checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarIndexSignatureParameters(node) || checkGrammarForIndexSignatureModifier(node); } function checkGrammarForAtLeastOneTypeArgument(node, typeArguments) { @@ -18379,7 +21946,7 @@ var ts; var sourceFile = ts.getSourceFileOfNode(node); for (var _i = 0; _i < arguments.length; _i++) { var arg = arguments[_i]; - if (arg.kind === 175) { + if (arg.kind === 175 /* OmittedExpression */) { return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -18406,7 +21973,7 @@ var ts; 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 === 79) { + if (heritageClause.token === 79 /* ExtendsKeyword */) { if (seenExtendsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen); } @@ -18419,12 +21986,13 @@ var ts; seenExtendsClause = true; } else { - ts.Debug.assert(heritageClause.token === 103); + ts.Debug.assert(heritageClause.token === 102 /* ImplementsKeyword */); if (seenImplementsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.implements_clause_already_seen); } seenImplementsClause = true; } + // Grammar checking heritageClause inside class declaration checkGrammarHeritageClause(heritageClause); } } @@ -18434,27 +22002,29 @@ var ts; if (node.heritageClauses) { for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) { var heritageClause = _a[_i]; - if (heritageClause.token === 79) { + if (heritageClause.token === 79 /* ExtendsKeyword */) { if (seenExtendsClause) { return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen); } seenExtendsClause = true; } else { - ts.Debug.assert(heritageClause.token === 103); + ts.Debug.assert(heritageClause.token === 102 /* ImplementsKeyword */); return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.Interface_declaration_cannot_have_implements_clause); } + // Grammar checking heritageClause inside class declaration checkGrammarHeritageClause(heritageClause); } } return false; } function checkGrammarComputedPropertyName(node) { - if (node.kind !== 127) { + // If node is not a computedPropertyName, just skip the grammar checking + if (node.kind !== 127 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 169 && computedPropertyName.expression.operatorToken.kind === 23) { + if (computedPropertyName.expression.kind === 169 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 23 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } @@ -18464,6 +22034,7 @@ var ts; } } function checkGrammarFunctionName(name) { + // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a strict mode FunctionDeclaration or FunctionExpression (13.1)) return checkGrammarEvalOrArgumentsInStrictMode(name, name); } function checkGrammarForInvalidQuestionMark(node, questionToken, message) { @@ -18477,55 +22048,65 @@ var ts; var GetAccessor = 2; var SetAccesor = 4; var GetOrSetAccessor = GetAccessor | SetAccesor; - var inStrictMode = (node.parserContextFlags & 1) !== 0; + var inStrictMode = (node.parserContextFlags & 1 /* StrictMode */) !== 0; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - var name_11 = prop.name; - if (prop.kind === 175 || - name_11.kind === 127) { - checkGrammarComputedPropertyName(name_11); + var name_13 = prop.name; + if (prop.kind === 175 /* OmittedExpression */ || + name_13.kind === 127 /* ComputedPropertyName */) { + // If the name is not a ComputedPropertyName, the grammar checking will skip it + checkGrammarComputedPropertyName(name_13); continue; } + // ECMA-262 11.1.5 Object Initialiser + // If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true + // a.This production is contained in strict code and IsDataDescriptor(previous) is true and + // IsDataDescriptor(propId.descriptor) is true. + // b.IsDataDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true. + // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. + // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true + // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; - if (prop.kind === 224 || prop.kind === 225) { + if (prop.kind === 224 /* PropertyAssignment */ || prop.kind === 225 /* ShorthandPropertyAssignment */) { + // Grammar checking for computedPropertName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); - if (name_11.kind === 7) { - checkGrammarNumbericLiteral(name_11); + if (name_13.kind === 7 /* NumericLiteral */) { + checkGrammarNumericLiteral(name_13); } currentKind = Property; } - else if (prop.kind === 134) { + else if (prop.kind === 134 /* MethodDeclaration */) { currentKind = Property; } - else if (prop.kind === 136) { + else if (prop.kind === 136 /* GetAccessor */) { currentKind = GetAccessor; } - else if (prop.kind === 137) { + else if (prop.kind === 137 /* SetAccessor */) { currentKind = SetAccesor; } else { ts.Debug.fail("Unexpected syntax kind:" + prop.kind); } - if (!ts.hasProperty(seen, name_11.text)) { - seen[name_11.text] = currentKind; + if (!ts.hasProperty(seen, name_13.text)) { + seen[name_13.text] = currentKind; } else { - var existingKind = seen[name_11.text]; + var existingKind = seen[name_13.text]; if (currentKind === Property && existingKind === Property) { if (inStrictMode) { - grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); + grammarErrorOnNode(name_13, 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_11.text] = currentKind | existingKind; + seen[name_13.text] = currentKind | existingKind; } else { - return grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + return grammarErrorOnNode(name_13, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); } } else { - return grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + return grammarErrorOnNode(name_13, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); } } } @@ -18534,24 +22115,24 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.initializer.kind === 199) { + if (forInOrOfStatement.initializer.kind === 199 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { if (variableList.declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 187 + var diagnostic = forInOrOfStatement.kind === 187 /* ForInStatement */ ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = variableList.declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 187 + var diagnostic = forInOrOfStatement.kind === 187 /* ForInStatement */ ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 187 + var diagnostic = forInOrOfStatement.kind === 187 /* ForInStatement */ ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -18562,7 +22143,7 @@ var ts; } function checkGrammarAccessor(accessor) { var kind = accessor.kind; - if (languageVersion < 1) { + if (languageVersion < 1 /* ES5 */) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher); } else if (ts.isInAmbientContext(accessor)) { @@ -18574,10 +22155,10 @@ var ts; else if (accessor.typeParameters) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } - else if (kind === 136 && accessor.parameters.length) { + else if (kind === 136 /* GetAccessor */ && accessor.parameters.length) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); } - else if (kind === 137) { + else if (kind === 137 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -18589,7 +22170,7 @@ var ts; if (parameter.dotDotDotToken) { return grammarErrorOnNode(parameter.dotDotDotToken, ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter); } - else if (parameter.flags & 499) { + else if (parameter.flags & 499 /* Modifier */) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } else if (parameter.questionToken) { @@ -18602,7 +22183,7 @@ var ts; } } function checkGrammarForNonSymbolComputedProperty(node, message) { - if (node.kind === 127 && !ts.isWellKnownSymbolSyntactically(node.expression)) { + if (node.kind === 127 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(node.expression)) { return grammarErrorOnNode(node, message); } } @@ -18612,7 +22193,7 @@ var ts; checkGrammarForGenerator(node)) { return true; } - if (node.parent.kind === 154) { + if (node.parent.kind === 154 /* ObjectLiteralExpression */) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } @@ -18620,10 +22201,15 @@ var ts; return grammarErrorAtPos(getSourceFile(node), node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); } } - if (node.parent.kind === 201) { + if (node.parent.kind === 201 /* ClassDeclaration */) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { return true; } + // Technically, computed properties in ambient contexts is disallowed + // for property declarations and accessors too, not just methods. + // However, property declarations disallow computed names in general, + // and accessors are not allowed in ambient contexts in general, + // so this error only really matters for methods. if (ts.isInAmbientContext(node)) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol); } @@ -18631,22 +22217,22 @@ var ts; return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol); } } - else if (node.parent.kind === 202) { + else if (node.parent.kind === 202 /* InterfaceDeclaration */) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol); } - else if (node.parent.kind === 145) { + else if (node.parent.kind === 145 /* TypeLiteral */) { return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol); } } function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 186: - case 187: - case 188: - case 184: - case 185: + case 186 /* ForStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: + case 184 /* DoStatement */: + case 185 /* WhileStatement */: return true; - case 194: + case 194 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -18658,9 +22244,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 194: + case 194 /* LabeledStatement */: if (node.label && current.label.text === node.label.text) { - var isMisplacedContinueLabel = node.kind === 189 + // found matching label - verify that label usage is correct + // continue can only target labels that are on iteration statements + var isMisplacedContinueLabel = node.kind === 189 /* ContinueStatement */ && !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); @@ -18668,13 +22256,15 @@ var ts; return false; } break; - case 193: - if (node.kind === 190 && !node.label) { + case 193 /* SwitchStatement */: + if (node.kind === 190 /* BreakStatement */ && !node.label) { + // unlabeled break within switch statement - ok return false; } break; default: if (isIterationStatement(current, false) && !node.label) { + // unlabeled break or continue within iteration statement - ok return false; } break; @@ -18682,13 +22272,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 190 + var message = node.kind === 190 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 190 + var message = node.kind === 190 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -18700,16 +22290,23 @@ var ts; if (node !== elements[elements.length - 1]) { return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); } + if (node.name.kind === 151 /* ArrayBindingPattern */ || node.name.kind === 150 /* ObjectBindingPattern */) { + return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); + } if (node.initializer) { + // Error on equals token which immediate precedes the initializer return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.initializer.pos - 1, 1, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } } + // It is a SyntaxError if a VariableDeclaration or VariableDeclarationNoIn occurs within strict code + // and its Identifier is eval or arguments return checkGrammarEvalOrArgumentsInStrictMode(node, node.name); } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 187 && node.parent.parent.kind !== 188) { + if (node.parent.parent.kind !== 187 /* ForInStatement */ && node.parent.parent.kind !== 188 /* ForOfStatement */) { if (ts.isInAmbientContext(node)) { if (node.initializer) { + // Error on equals token which immediate precedes the initializer var equalsTokenLength = "=".length; return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.initializer.pos - equalsTokenLength, equalsTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); } @@ -18723,12 +22320,18 @@ var ts; } } } - var checkLetConstNames = languageVersion >= 2 && (ts.isLet(node) || ts.isConst(node)); + var checkLetConstNames = languageVersion >= 2 /* ES6 */ && (ts.isLet(node) || ts.isConst(node)); + // 1. LexicalDeclaration : LetOrConst BindingList ; + // It is a Syntax Error if the BoundNames of BindingList contains "let". + // 2. ForDeclaration: ForDeclaration : LetOrConst ForBinding + // It is a Syntax Error if the BoundNames of ForDeclaration contains "let". + // It is a SyntaxError if a VariableDeclaration or VariableDeclarationNoIn occurs within strict code + // and its Identifier is eval or arguments return (checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name)) || checkGrammarEvalOrArgumentsInStrictMode(node, node.name); } function checkGrammarNameInLetOrConstDeclarations(name) { - if (name.kind === 65) { + if (name.kind === 65 /* Identifier */) { if (name.text === "let") { return grammarErrorOnNode(name, ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations); } @@ -18737,7 +22340,9 @@ var ts; var elements = name.elements; for (var _i = 0; _i < elements.length; _i++) { var element = elements[_i]; - checkGrammarNameInLetOrConstDeclarations(element.name); + if (element.kind !== 175 /* OmittedExpression */) { + checkGrammarNameInLetOrConstDeclarations(element.name); + } } } } @@ -18752,15 +22357,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 183: - case 184: - case 185: - case 192: - case 186: - case 187: - case 188: + case 183 /* IfStatement */: + case 184 /* DoStatement */: + case 185 /* WhileStatement */: + case 192 /* WithStatement */: + case 186 /* ForStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: return false; - case 194: + case 194 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -18776,26 +22381,36 @@ var ts; } } function isIntegerLiteral(expression) { - if (expression.kind === 167) { + if (expression.kind === 167 /* PrefixUnaryExpression */) { var unaryExpression = expression; - if (unaryExpression.operator === 33 || unaryExpression.operator === 34) { + if (unaryExpression.operator === 33 /* PlusToken */ || unaryExpression.operator === 34 /* MinusToken */) { expression = unaryExpression.operand; } } - if (expression.kind === 7) { + if (expression.kind === 7 /* NumericLiteral */) { + // Allows for scientific notation since literalExpression.text was formed by + // coercing a number to a string. Sometimes this coercion can yield a string + // in scientific notation. + // We also don't need special logic for hex because a hex integer is converted + // to decimal when it is coerced. return /^[0-9]+([eE]\+?[0-9]+)?$/.test(expression.text); } return false; } function checkGrammarEnumDeclaration(enumDecl) { - var enumIsConst = (enumDecl.flags & 8192) !== 0; + var enumIsConst = (enumDecl.flags & 8192 /* Const */) !== 0; var hasError = false; + // skip checks below for const enums - they allow arbitrary initializers as long as they can be evaluated to constant expressions. + // since all values are known in compile time - it is not necessary to check that constant enum section precedes computed enum members. if (!enumIsConst) { var inConstantEnumMemberSection = true; var inAmbientContext = ts.isInAmbientContext(enumDecl); for (var _i = 0, _a = enumDecl.members; _i < _a.length; _i++) { var node = _a[_i]; - if (node.name.kind === 127) { + // Do not use hasDynamicName here, because that returns false for well known symbols. + // We want to perform checkComputedPropertyName for all computed properties, including + // well known symbols. + if (node.name.kind === 127 /* ComputedPropertyName */) { hasError = grammarErrorOnNode(node.name, ts.Diagnostics.Computed_property_names_are_not_allowed_in_enums); } else if (inAmbientContext) { @@ -18838,14 +22453,25 @@ var ts; } } function checkGrammarEvalOrArgumentsInStrictMode(contextNode, name) { - if (name && name.kind === 65) { + if (name && name.kind === 65 /* Identifier */) { var identifier = name; - if (contextNode && (contextNode.parserContextFlags & 1) && ts.isEvalOrArgumentsIdentifier(identifier)) { + if (contextNode && (contextNode.parserContextFlags & 1 /* StrictMode */) && isEvalOrArgumentsIdentifier(identifier)) { var nameText = ts.declarationNameToString(identifier); - return grammarErrorOnNode(identifier, ts.Diagnostics.Invalid_use_of_0_in_strict_mode, nameText); + // We check first if the name is inside class declaration or class expression; if so give explicit message + // otherwise report generic error message. + // reportGrammarErrorInClassDeclaration only return true if grammar error is successfully reported and false otherwise + var reportErrorInClassDeclaration = reportStrictModeGrammarErrorInClassDeclaration(identifier, ts.Diagnostics.Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode, nameText); + if (!reportErrorInClassDeclaration) { + return grammarErrorOnNode(identifier, ts.Diagnostics.Invalid_use_of_0_in_strict_mode, nameText); + } + return reportErrorInClassDeclaration; } } } + function isEvalOrArgumentsIdentifier(node) { + return node.kind === 65 /* Identifier */ && + (node.text === "eval" || node.text === "arguments"); + } function checkGrammarConstructorTypeParameters(node) { if (node.typeParameters) { return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); @@ -18857,18 +22483,18 @@ var ts; } } function checkGrammarProperty(node) { - if (node.parent.kind === 201) { + if (node.parent.kind === 201 /* ClassDeclaration */) { if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional) || checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol)) { return true; } } - else if (node.parent.kind === 202) { + else if (node.parent.kind === 202 /* InterfaceDeclaration */) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol)) { return true; } } - else if (node.parent.kind === 145) { + else if (node.parent.kind === 145 /* TypeLiteral */) { if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) { return true; } @@ -18878,13 +22504,23 @@ var ts; } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 202 || - node.kind === 209 || - node.kind === 208 || - node.kind === 215 || - node.kind === 214 || - (node.flags & 2) || - (node.flags & (1 | 256))) { + // A declare modifier is required for any top level .d.ts declaration except export=, export default, + // interfaces and imports categories: + // + // DeclarationElement: + // ExportAssignment + // export_opt InterfaceDeclaration + // export_opt ImportDeclaration + // export_opt ExternalImportDeclaration + // export_opt AmbientDeclaration + // + if (node.kind === 202 /* InterfaceDeclaration */ || + node.kind === 209 /* ImportDeclaration */ || + node.kind === 208 /* ImportEqualsDeclaration */ || + node.kind === 215 /* ExportDeclaration */ || + node.kind === 214 /* ExportAssignment */ || + (node.flags & 2 /* Ambient */) || + (node.flags & (1 /* Export */ | 256 /* Default */))) { return false; } return grammarErrorOnFirstToken(node, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); @@ -18892,7 +22528,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 180) { + if (ts.isDeclaration(decl) || decl.kind === 180 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -18904,15 +22540,23 @@ var ts; } function checkGrammarStatementInAmbientContext(node) { if (ts.isInAmbientContext(node)) { + // An accessors is already reported about the ambient context if (isAccessor(node.parent.kind)) { return getNodeLinks(node).hasReportedStatementInAmbientContext = true; } + // Find containing block which is either Block, ModuleBlock, SourceFile var links = getNodeLinks(node); if (!links.hasReportedStatementInAmbientContext && ts.isFunctionLike(node.parent)) { return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); } - if (node.parent.kind === 179 || node.parent.kind === 206 || node.parent.kind === 227) { + // We are either parented by another statement, or some sort of block. + // If we're in a block, we only want to really report an error once + // to prevent noisyness. So use a bit on the block to indicate if + // this has already been reported, and don't report if it has. + // + if (node.parent.kind === 179 /* Block */ || node.parent.kind === 206 /* ModuleBlock */ || node.parent.kind === 227 /* SourceFile */) { var links_1 = getNodeLinks(node.parent); + // Check if the containing block ever report this error if (!links_1.hasReportedStatementInAmbientContext) { return links_1.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); } @@ -18921,12 +22565,13 @@ var ts; } } } - function checkGrammarNumbericLiteral(node) { - if (node.flags & 16384) { - if (node.parserContextFlags & 1) { + function checkGrammarNumericLiteral(node) { + // Grammar checking + if (node.flags & 16384 /* OctalLiteral */) { + if (node.parserContextFlags & 1 /* StrictMode */) { return grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode); } - else if (languageVersion >= 1) { + else if (languageVersion >= 1 /* ES5 */) { return grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher); } } @@ -18945,6 +22590,7 @@ var ts; ts.createTypeChecker = createTypeChecker; })(ts || (ts = {})); /// +/* @internal */ var ts; (function (ts) { function getDeclarationDiagnostics(host, resolver, targetSourceFile) { @@ -18957,7 +22603,7 @@ var ts; function emitDeclarations(host, resolver, diagnostics, jsFilePath, root) { var newLine = host.getNewLine(); var compilerOptions = host.getCompilerOptions(); - var languageVersion = compilerOptions.target || 0; + var languageVersion = compilerOptions.target || 0 /* ES3 */; var write; var writeLine; var increaseIndent; @@ -18971,13 +22617,18 @@ var ts; var emit = compilerOptions.stripInternal ? stripInternal : emitNode; var moduleElementDeclarationEmitInfo = []; var asynchronousSubModuleDeclarationEmitInfo; + // Contains the reference paths that needs to go in the declaration file. + // Collecting this separately because reference paths need to be first thing in the declaration file + // and we could be collecting these paths from multiple files into single one with --out option var referencePathsOutput = ""; if (root) { + // Emitting just a single file, so emit references in this file only if (!compilerOptions.noResolve) { var addedGlobalFileReference = false; ts.forEach(root.referencedFiles, function (fileReference) { var referencedFile = ts.tryResolveScriptReference(host, root, fileReference); - if (referencedFile && ((referencedFile.flags & 2048) || + // All the references that are not going to be part of same file + if (referencedFile && ((referencedFile.flags & 2048 /* DeclarationFile */) || ts.shouldEmitToOwnFile(referencedFile, compilerOptions) || !addedGlobalFileReference)) { writeReferencePath(referencedFile); @@ -18988,11 +22639,12 @@ var ts; }); } emitSourceFile(root); + // create asynchronous output for the importDeclarations if (moduleElementDeclarationEmitInfo.length) { var oldWriter = writer; ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { if (aliasEmitInfo.isVisible) { - ts.Debug.assert(aliasEmitInfo.node.kind === 209); + ts.Debug.assert(aliasEmitInfo.node.kind === 209 /* ImportDeclaration */); createAndSetNewTextWriterWithSymbolWriter(); ts.Debug.assert(aliasEmitInfo.indent === 0); writeImportDeclaration(aliasEmitInfo.node); @@ -19003,12 +22655,15 @@ var ts; } } else { + // Emit references corresponding to this file var emittedReferencedFiles = []; ts.forEach(host.getSourceFiles(), function (sourceFile) { if (!ts.isExternalModuleOrDeclarationFile(sourceFile)) { + // Check what references need to be added if (!compilerOptions.noResolve) { ts.forEach(sourceFile.referencedFiles, function (fileReference) { var referencedFile = ts.tryResolveScriptReference(host, sourceFile, fileReference); + // If the reference file is a declaration file or an external module, emit that reference if (referencedFile && (ts.isExternalModuleOrDeclarationFile(referencedFile) && !ts.contains(emittedReferencedFiles, referencedFile))) { writeReferencePath(referencedFile); @@ -19065,10 +22720,10 @@ var ts; var oldWriter = writer; ts.forEach(nodes, function (declaration) { var nodeToCheck; - if (declaration.kind === 198) { + if (declaration.kind === 198 /* VariableDeclaration */) { nodeToCheck = declaration.parent.parent; } - else if (declaration.kind === 212 || declaration.kind === 213 || declaration.kind === 210) { + else if (declaration.kind === 212 /* NamedImports */ || declaration.kind === 213 /* ImportSpecifier */ || declaration.kind === 210 /* ImportClause */) { ts.Debug.fail("We should be getting ImportDeclaration instead to write"); } else { @@ -19078,8 +22733,17 @@ var ts; if (!moduleElementEmitInfo && asynchronousSubModuleDeclarationEmitInfo) { moduleElementEmitInfo = ts.forEach(asynchronousSubModuleDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.node === nodeToCheck ? declEmitInfo : undefined; }); } + // If the alias was marked as not visible when we saw its declaration, we would have saved the aliasEmitInfo, but if we haven't yet visited the alias declaration + // then we don't need to write it at this point. We will write it when we actually see its declaration + // Eg. + // export function bar(a: foo.Foo) { } + // import foo = require("foo"); + // Writing of function bar would mark alias declaration foo as visible but we haven't yet visited that declaration so do nothing, + // we would write alias foo declaration when we visit it since it would now be marked as visible if (moduleElementEmitInfo) { - if (moduleElementEmitInfo.node.kind === 209) { + if (moduleElementEmitInfo.node.kind === 209 /* ImportDeclaration */) { + // we have to create asynchronous output only after we have collected complete information + // because it is possible to enable multiple bindings as asynchronously visible moduleElementEmitInfo.isVisible = true; } else { @@ -19087,12 +22751,12 @@ var ts; for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { increaseIndent(); } - if (nodeToCheck.kind === 205) { + if (nodeToCheck.kind === 205 /* ModuleDeclaration */) { ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); asynchronousSubModuleDeclarationEmitInfo = []; } writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 205) { + if (nodeToCheck.kind === 205 /* ModuleDeclaration */) { moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; asynchronousSubModuleDeclarationEmitInfo = undefined; } @@ -19103,12 +22767,14 @@ var ts; setWriter(oldWriter); } function handleSymbolAccessibilityError(symbolAccesibilityResult) { - if (symbolAccesibilityResult.accessibility === 0) { + if (symbolAccesibilityResult.accessibility === 0 /* Accessible */) { + // write the aliases if (symbolAccesibilityResult && symbolAccesibilityResult.aliasesToMakeVisible) { writeAsynchronousModuleElements(symbolAccesibilityResult.aliasesToMakeVisible); } } else { + // Report error reportedDeclarationError = true; var errorInfo = writer.getSymbolAccessibilityDiagnostic(symbolAccesibilityResult); if (errorInfo) { @@ -19128,20 +22794,22 @@ var ts; writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; write(": "); if (type) { + // Write the type emitType(type); } else { - resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, 2, writer); + resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); } } function writeReturnTypeAtSignature(signature, getSymbolAccessibilityDiagnostic) { writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; write(": "); if (signature.type) { + // Write the type emitType(signature.type); } else { - resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 2, writer); + resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); } } function emitLines(nodes) { @@ -19170,6 +22838,7 @@ var ts; if (declaration) { var jsDocComments = ts.getJsDocComments(declaration, currentSourceFile); ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, declaration, jsDocComments); + // jsDoc comments are emitted at /*leading comment1 */space/*leading comment*/space ts.emitComments(currentSourceFile, writer, jsDocComments, true, newLine, ts.writeCommentRange); } } @@ -19179,49 +22848,51 @@ var ts; } function emitType(type) { switch (type.kind) { - case 112: - case 121: - case 119: - case 113: - case 122: - case 99: - case 8: + case 112 /* AnyKeyword */: + case 121 /* StringKeyword */: + case 119 /* NumberKeyword */: + case 113 /* BooleanKeyword */: + case 122 /* SymbolKeyword */: + case 99 /* VoidKeyword */: + case 8 /* StringLiteral */: return writeTextOfNode(currentSourceFile, type); - case 177: + case 177 /* HeritageClauseElement */: return emitHeritageClauseElement(type); - case 141: + case 141 /* TypeReference */: return emitTypeReference(type); - case 144: + case 144 /* TypeQuery */: return emitTypeQuery(type); - case 146: + case 146 /* ArrayType */: return emitArrayType(type); - case 147: + case 147 /* TupleType */: return emitTupleType(type); - case 148: + case 148 /* UnionType */: return emitUnionType(type); - case 149: + case 149 /* ParenthesizedType */: return emitParenType(type); - case 142: - case 143: + case 142 /* FunctionType */: + case 143 /* ConstructorType */: return emitSignatureDeclarationWithJsDocComments(type); - case 145: + case 145 /* TypeLiteral */: return emitTypeLiteral(type); - case 65: + case 65 /* Identifier */: return emitEntityName(type); - case 126: + case 126 /* QualifiedName */: return emitEntityName(type); } function emitEntityName(entityName) { - var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 208 ? entityName.parent : enclosingDeclaration); + var visibilityResult = resolver.isEntityNameVisible(entityName, + // Aliases can be written asynchronously so use correct enclosing declaration + entityName.parent.kind === 208 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); writeEntityName(entityName); function writeEntityName(entityName) { - if (entityName.kind === 65) { + if (entityName.kind === 65 /* Identifier */) { writeTextOfNode(currentSourceFile, entityName); } else { - var left = entityName.kind === 126 ? entityName.left : entityName.expression; - var right = entityName.kind === 126 ? entityName.right : entityName.name; + var left = entityName.kind === 126 /* QualifiedName */ ? entityName.left : entityName.expression; + var right = entityName.kind === 126 /* QualifiedName */ ? entityName.right : entityName.name; writeEntityName(left); write("."); writeTextOfNode(currentSourceFile, right); @@ -19230,7 +22901,7 @@ var ts; } function emitHeritageClauseElement(node) { if (ts.isSupportedHeritageClauseElement(node)) { - ts.Debug.assert(node.expression.kind === 65 || node.expression.kind === 155); + ts.Debug.assert(node.expression.kind === 65 /* Identifier */ || node.expression.kind === 155 /* PropertyAccessExpression */); emitEntityName(node.expression); if (node.typeArguments) { write("<"); @@ -19273,6 +22944,7 @@ var ts; if (type.members.length) { writeLine(); increaseIndent(); + // write members emitLines(type.members); decreaseIndent(); } @@ -19284,25 +22956,47 @@ var ts; enclosingDeclaration = node; emitLines(node.statements); } + // Return a temp variable name to be used in `export default` statements. + // The temp name will be of the form _default_counter. + // Note that export default is only allowed at most once in a module, so we + // do not need to keep track of created temp names. + function getExportDefaultTempVariableName() { + var baseName = "_default"; + if (!ts.hasProperty(currentSourceFile.identifiers, baseName)) { + return baseName; + } + var count = 0; + while (true) { + var name_14 = baseName + "_" + (++count); + if (!ts.hasProperty(currentSourceFile.identifiers, name_14)) { + return name_14; + } + } + } function emitExportAssignment(node) { - write(node.isExportEquals ? "export = " : "export default "); - if (node.expression.kind === 65) { + if (node.expression.kind === 65 /* Identifier */) { + write(node.isExportEquals ? "export = " : "export default "); writeTextOfNode(currentSourceFile, node.expression); } else { + // Expression + var tempVarName = getExportDefaultTempVariableName(); + write("declare var "); + write(tempVarName); write(": "); - if (node.type) { - emitType(node.type); - } - else { - writer.getSymbolAccessibilityDiagnostic = getDefaultExportAccessibilityDiagnostic; - resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, 2, writer); - } + writer.getSymbolAccessibilityDiagnostic = getDefaultExportAccessibilityDiagnostic; + resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); + write(";"); + writeLine(); + write(node.isExportEquals ? "export = " : "export default "); + write(tempVarName); } write(";"); writeLine(); - if (node.expression.kind === 65) { + // Make all the declarations visible for the export name + if (node.expression.kind === 65 /* Identifier */) { var nodes = resolver.collectLinkedAliases(node.expression); + // write each of these declarations asynchronously writeAsynchronousModuleElements(nodes); } function getDefaultExportAccessibilityDiagnostic(diagnostic) { @@ -19319,10 +23013,11 @@ var ts; if (isModuleElementVisible) { writeModuleElement(node); } - else if (node.kind === 208 || - (node.parent.kind === 227 && ts.isExternalModule(currentSourceFile))) { + else if (node.kind === 208 /* ImportEqualsDeclaration */ || + (node.parent.kind === 227 /* SourceFile */ && ts.isExternalModule(currentSourceFile))) { var isVisible; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 227) { + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 227 /* SourceFile */) { + // Import declaration of another module that is visited async so lets put it in right spot asynchronousSubModuleDeclarationEmitInfo.push({ node: node, outputPos: writer.getTextPos(), @@ -19331,7 +23026,7 @@ var ts; }); } else { - if (node.kind === 209) { + if (node.kind === 209 /* ImportDeclaration */) { var importDeclaration = node; if (importDeclaration.importClause) { isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || @@ -19349,55 +23044,59 @@ var ts; } function writeModuleElement(node) { switch (node.kind) { - case 200: + case 200 /* FunctionDeclaration */: return writeFunctionDeclaration(node); - case 180: + case 180 /* VariableStatement */: return writeVariableStatement(node); - case 202: + case 202 /* InterfaceDeclaration */: return writeInterfaceDeclaration(node); - case 201: + case 201 /* ClassDeclaration */: return writeClassDeclaration(node); - case 203: + case 203 /* TypeAliasDeclaration */: return writeTypeAliasDeclaration(node); - case 204: + case 204 /* EnumDeclaration */: return writeEnumDeclaration(node); - case 205: + case 205 /* ModuleDeclaration */: return writeModuleDeclaration(node); - case 208: + case 208 /* ImportEqualsDeclaration */: return writeImportEqualsDeclaration(node); - case 209: + case 209 /* ImportDeclaration */: return writeImportDeclaration(node); default: ts.Debug.fail("Unknown symbol kind"); } } function emitModuleElementDeclarationFlags(node) { + // If the node is parented in the current source file we need to emit export declare or just export if (node.parent === currentSourceFile) { - if (node.flags & 1) { + // If the node is exported + if (node.flags & 1 /* Export */) { write("export "); } - if (node.flags & 256) { + if (node.flags & 256 /* Default */) { write("default "); } - else if (node.kind !== 202) { + else if (node.kind !== 202 /* InterfaceDeclaration */) { write("declare "); } } } function emitClassMemberDeclarationFlags(node) { - if (node.flags & 32) { + if (node.flags & 32 /* Private */) { write("private "); } - else if (node.flags & 64) { + else if (node.flags & 64 /* Protected */) { write("protected "); } - if (node.flags & 128) { + if (node.flags & 128 /* Static */) { write("static "); } } function writeImportEqualsDeclaration(node) { + // note usage of writer. methods instead of aliases created, just to make sure we are using + // correct writer especially to handle asynchronous alias writing emitJsDocComments(node); - if (node.flags & 1) { + if (node.flags & 1 /* Export */) { write("export "); } write("import "); @@ -19423,7 +23122,7 @@ var ts; } function isVisibleNamedBinding(namedBindings) { if (namedBindings) { - if (namedBindings.kind === 211) { + if (namedBindings.kind === 211 /* NamespaceImport */) { return resolver.isDeclarationVisible(namedBindings); } else { @@ -19432,11 +23131,12 @@ var ts; } } function writeImportDeclaration(node) { - if (!node.importClause && !(node.flags & 1)) { + if (!node.importClause && !(node.flags & 1 /* Export */)) { + // do not write non-exported import declarations that don't have import clauses return; } emitJsDocComments(node); - if (node.flags & 1) { + if (node.flags & 1 /* Export */) { write("export "); } write("import "); @@ -19447,9 +23147,10 @@ var ts; } if (node.importClause.namedBindings && isVisibleNamedBinding(node.importClause.namedBindings)) { if (currentWriterPos !== writer.getTextPos()) { + // If the default binding was emitted, write the separated write(", "); } - if (node.importClause.namedBindings.kind === 211) { + if (node.importClause.namedBindings.kind === 211 /* NamespaceImport */) { write("* as "); writeTextOfNode(currentSourceFile, node.importClause.namedBindings.name); } @@ -19474,7 +23175,9 @@ var ts; } function emitExportSpecifier(node) { emitImportOrExportSpecifier(node); + // Make all the declarations visible for the export name var nodes = resolver.collectLinkedAliases(node.propertyName || node.name); + // write each of these declarations asynchronously writeAsynchronousModuleElements(nodes); } function emitExportDeclaration(node) { @@ -19500,7 +23203,7 @@ var ts; emitModuleElementDeclarationFlags(node); write("module "); writeTextOfNode(currentSourceFile, node.name); - while (node.body.kind !== 206) { + while (node.body.kind !== 206 /* ModuleBlock */) { node = node.body; write("."); writeTextOfNode(currentSourceFile, node.name); @@ -19561,7 +23264,7 @@ var ts; writeLine(); } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 134 && (node.parent.flags & 32); + return node.parent.kind === 134 /* MethodDeclaration */ && (node.parent.flags & 32 /* Private */); } function emitTypeParameters(typeParameters) { function emitTypeParameter(node) { @@ -19569,17 +23272,18 @@ var ts; emitJsDocComments(node); decreaseIndent(); writeTextOfNode(currentSourceFile, node.name); + // If there is constraint present and this is not a type parameter of the private method emit the constraint if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); - if (node.parent.kind === 142 || - 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); + if (node.parent.kind === 142 /* FunctionType */ || + node.parent.kind === 143 /* ConstructorType */ || + (node.parent.parent && node.parent.parent.kind === 145 /* TypeLiteral */)) { + ts.Debug.assert(node.parent.kind === 134 /* MethodDeclaration */ || + node.parent.kind === 133 /* MethodSignature */ || + node.parent.kind === 142 /* FunctionType */ || + node.parent.kind === 143 /* ConstructorType */ || + node.parent.kind === 138 /* CallSignature */ || + node.parent.kind === 139 /* ConstructSignature */); emitType(node.constraint); } else { @@ -19587,33 +23291,34 @@ var ts; } } function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult) { + // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 201: + case 201 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 202: + case 202 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 139: + case 139 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 138: + case 138 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 134: - case 133: - if (node.parent.flags & 128) { + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + if (node.parent.flags & 128 /* Static */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 201) { + else if (node.parent.parent.kind === 201 /* ClassDeclaration */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 200: + case 200 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: @@ -19643,12 +23348,15 @@ var ts; } function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.parent.parent.kind === 201) { + // Heritage clause is written by user so it can always be named + if (node.parent.parent.kind === 201 /* ClassDeclaration */) { + // Class or Interface implemented/extended is inaccessible diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; } else { + // interface is inaccessible diagnosticMessage = ts.Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; } return { @@ -19663,7 +23371,7 @@ var ts; function emitParameterProperties(constructorDeclaration) { if (constructorDeclaration) { ts.forEach(constructorDeclaration.parameters, function (param) { - if (param.flags & 112) { + if (param.flags & 112 /* AccessibilityModifier */) { emitPropertyDeclaration(param); } }); @@ -19720,47 +23428,55 @@ var ts; writeLine(); } function emitVariableDeclaration(node) { - if (node.kind !== 198 || resolver.isDeclarationVisible(node)) { + // If we are emitting property it isn't moduleElement and hence we already know it needs to be emitted + // so there is no check needed to see if declaration is visible + if (node.kind !== 198 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { if (ts.isBindingPattern(node.name)) { emitBindingPattern(node.name); } else { + // If this node is a computed name, it can only be a symbol, because we've already skipped + // it if it's not a well known symbol. In that case, the text of the name will be exactly + // what we want, namely the name expression enclosed in brackets. writeTextOfNode(currentSourceFile, node.name); - if ((node.kind === 132 || node.kind === 131) && ts.hasQuestionToken(node)) { + // If optional property emit ? + if ((node.kind === 132 /* PropertyDeclaration */ || node.kind === 131 /* PropertySignature */) && ts.hasQuestionToken(node)) { write("?"); } - if ((node.kind === 132 || node.kind === 131) && node.parent.kind === 145) { + if ((node.kind === 132 /* PropertyDeclaration */ || node.kind === 131 /* PropertySignature */) && node.parent.kind === 145 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } - else if (!(node.flags & 32)) { + else if (!(node.flags & 32 /* Private */)) { writeTypeOfDeclaration(node, node.type, getVariableDeclarationTypeVisibilityError); } } } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { - if (node.kind === 198) { + if (node.kind === 198 /* VariableDeclaration */) { return symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? + symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; } - else if (node.kind === 132 || node.kind === 131) { - if (node.flags & 128) { + else if (node.kind === 132 /* PropertyDeclaration */ || node.kind === 131 /* PropertySignature */) { + // TODO(jfreeman): Deal with computed properties in error reporting. + if (node.flags & 128 /* Static */) { return symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? + symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? 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) { + else if (node.parent.kind === 201 /* ClassDeclaration */) { return symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? + symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : 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 { + // Interfaces cannot have types that cannot be named 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; @@ -19776,10 +23492,15 @@ var ts; } : undefined; } function emitBindingPattern(bindingPattern) { + // 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, ; var elements = []; for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 175) { + if (element.kind !== 175 /* OmittedExpression */) { elements.push(element); } } @@ -19806,6 +23527,9 @@ var ts; } } function emitTypeOfVariableDeclarationFromTypeLiteral(node) { + // if this is property of type literal, + // or is parameter of method/call/construct/index signature of type literal + // emit only if type is specified if (node.type) { write(": "); emitType(node.type); @@ -19841,11 +23565,12 @@ var ts; emitJsDocComments(accessors.setAccessor); emitClassMemberDeclarationFlags(node); writeTextOfNode(currentSourceFile, node.name); - if (!(node.flags & 32)) { + if (!(node.flags & 32 /* Private */)) { accessorWithTypeAnnotation = node; var type = getTypeAnnotationFromAccessor(node); if (!type) { - var anotherAccessor = node.kind === 136 ? accessors.setAccessor : accessors.getAccessor; + // couldn't get type for the first accessor, try the another one + var anotherAccessor = node.kind === 136 /* GetAccessor */ ? accessors.setAccessor : accessors.getAccessor; type = getTypeAnnotationFromAccessor(anotherAccessor); if (type) { accessorWithTypeAnnotation = anotherAccessor; @@ -19858,17 +23583,18 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 136 - ? accessor.type + return accessor.kind === 136 /* GetAccessor */ + ? accessor.type // Getter - return type : accessor.parameters.length > 0 - ? accessor.parameters[0].type + ? accessor.parameters[0].type // Setter parameter type : undefined; } } function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 137) { - if (accessorWithTypeAnnotation.parent.flags & 128) { + if (accessorWithTypeAnnotation.kind === 137 /* SetAccessor */) { + // Setters have to have type named and cannot infer it so, the type should always be named + if (accessorWithTypeAnnotation.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? 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; @@ -19881,20 +23607,21 @@ var ts; return { diagnosticMessage: diagnosticMessage, errorNode: accessorWithTypeAnnotation.parameters[0], + // TODO(jfreeman): Investigate why we are passing node.name instead of node.parameters[0].name typeName: accessorWithTypeAnnotation.name }; } else { - if (accessorWithTypeAnnotation.flags & 128) { + if (accessorWithTypeAnnotation.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? + symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? 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 ? + symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? 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; @@ -19911,19 +23638,21 @@ var ts; if (ts.hasDynamicName(node)) { return; } + // If we are emitting Method/Constructor it isn't moduleElement and hence already determined to be emitting + // so no need to verify if the declaration is visible if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 200) { + if (node.kind === 200 /* FunctionDeclaration */) { emitModuleElementDeclarationFlags(node); } - else if (node.kind === 134) { + else if (node.kind === 134 /* MethodDeclaration */) { emitClassMemberDeclarationFlags(node); } - if (node.kind === 200) { + if (node.kind === 200 /* FunctionDeclaration */) { write("function "); writeTextOfNode(currentSourceFile, node.name); } - else if (node.kind === 135) { + else if (node.kind === 135 /* Constructor */) { write("constructor"); } else { @@ -19940,11 +23669,12 @@ var ts; emitSignatureDeclaration(node); } function emitSignatureDeclaration(node) { - if (node.kind === 139 || node.kind === 143) { + // Construct signature or constructor type write new Signature + if (node.kind === 139 /* ConstructSignature */ || node.kind === 143 /* ConstructorType */) { write("new "); } emitTypeParameters(node.typeParameters); - if (node.kind === 140) { + if (node.kind === 140 /* IndexSignature */) { write("["); } else { @@ -19952,21 +23682,24 @@ var ts; } var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; + // Parameters emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 140) { + if (node.kind === 140 /* IndexSignature */) { write("]"); } else { write(")"); } - var isFunctionTypeOrConstructorType = node.kind === 142 || node.kind === 143; - if (isFunctionTypeOrConstructorType || node.parent.kind === 145) { + // If this is not a constructor and is not private, emit the return type + var isFunctionTypeOrConstructorType = node.kind === 142 /* FunctionType */ || node.kind === 143 /* ConstructorType */; + if (isFunctionTypeOrConstructorType || node.parent.kind === 145 /* TypeLiteral */) { + // Emit type literal signature return type only if specified if (node.type) { write(isFunctionTypeOrConstructorType ? " => " : ": "); emitType(node.type); } } - else if (node.kind !== 135 && !(node.flags & 32)) { + else if (node.kind !== 135 /* Constructor */ && !(node.flags & 32 /* Private */)) { writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } enclosingDeclaration = prevEnclosingDeclaration; @@ -19977,46 +23710,50 @@ var ts; function getReturnTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.kind) { - case 139: + case 139 /* ConstructSignature */: + // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 138: + case 138 /* CallSignature */: + // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 140: + case 140 /* IndexSignature */: + // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 134: - case 133: - if (node.flags & 128) { + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + if (node.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? + symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? 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 === 201) { + else if (node.parent.kind === 201 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? + symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : 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 { + // Interfaces cannot have return types that cannot be named 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 200: + case 200 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? + symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : 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; @@ -20037,6 +23774,9 @@ var ts; write("..."); } if (ts.isBindingPattern(node.name)) { + // 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 { @@ -20046,12 +23786,12 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 142 || - node.parent.kind === 143 || - node.parent.parent.kind === 145) { + if (node.parent.kind === 142 /* FunctionType */ || + node.parent.kind === 143 /* ConstructorType */ || + node.parent.parent.kind === 145 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } - else if (!(node.parent.flags & 32)) { + else if (!(node.parent.flags & 32 /* Private */)) { writeTypeOfDeclaration(node, node.type, getParameterDeclarationTypeVisibilityError); } function getParameterDeclarationTypeVisibilityError(symbolAccesibilityResult) { @@ -20064,44 +23804,47 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { switch (node.parent.kind) { - case 135: + case 135 /* Constructor */: return symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? + symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 139: + case 139 /* ConstructSignature */: + // Interfaces cannot have parameter types that cannot be named return symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 138: + case 138 /* CallSignature */: + // Interfaces cannot have parameter types that cannot be named return symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 134: - case 133: - if (node.parent.flags & 128) { + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + if (node.parent.flags & 128 /* Static */) { return symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? + symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? 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) { + else if (node.parent.parent.kind === 201 /* ClassDeclaration */) { return symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? + symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : 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 { + // Interfaces cannot have parameter types that cannot be named 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: + case 200 /* FunctionDeclaration */: return symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 ? + symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : 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; @@ -20110,12 +23853,13 @@ var ts; } } function emitBindingPattern(bindingPattern) { - if (bindingPattern.kind === 150) { + // We have to explicitly emit square bracket and bracket because these tokens are not store inside the node. + if (bindingPattern.kind === 150 /* ObjectBindingPattern */) { write("{"); emitCommaList(bindingPattern.elements, emitBindingElement); write("}"); } - else if (bindingPattern.kind === 151) { + else if (bindingPattern.kind === 151 /* ArrayBindingPattern */) { write("["); var elements = bindingPattern.elements; emitCommaList(elements, emitBindingElement); @@ -20134,21 +23878,45 @@ var ts; typeName: bindingElement.name } : undefined; } - if (bindingElement.kind === 175) { + if (bindingElement.kind === 175 /* 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 === 152) { + else if (bindingElement.kind === 152 /* 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 (ts.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 { - ts.Debug.assert(bindingElement.name.kind === 65); + ts.Debug.assert(bindingElement.name.kind === 65 /* 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("..."); } @@ -20160,54 +23928,59 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 200: - case 205: - case 208: - case 202: - case 201: - case 203: - case 204: + case 200 /* FunctionDeclaration */: + case 205 /* ModuleDeclaration */: + case 208 /* ImportEqualsDeclaration */: + case 202 /* InterfaceDeclaration */: + case 201 /* ClassDeclaration */: + case 203 /* TypeAliasDeclaration */: + case 204 /* EnumDeclaration */: return emitModuleElement(node, isModuleElementVisible(node)); - case 180: + case 180 /* VariableStatement */: return emitModuleElement(node, isVariableStatementVisible(node)); - case 209: + case 209 /* ImportDeclaration */: + // Import declaration without import clause is visible, otherwise it is not visible return emitModuleElement(node, !node.importClause); - case 215: + case 215 /* ExportDeclaration */: return emitExportDeclaration(node); - case 135: - case 134: - case 133: + case 135 /* Constructor */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: return writeFunctionDeclaration(node); - case 139: - case 138: - case 140: + case 139 /* ConstructSignature */: + case 138 /* CallSignature */: + case 140 /* IndexSignature */: return emitSignatureDeclarationWithJsDocComments(node); - case 136: - case 137: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: return emitAccessorDeclaration(node); - case 132: - case 131: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: return emitPropertyDeclaration(node); - case 226: + case 226 /* EnumMember */: return emitEnumMemberDeclaration(node); - case 214: + case 214 /* ExportAssignment */: return emitExportAssignment(node); - case 227: + case 227 /* SourceFile */: return emitSourceFile(node); } } function writeReferencePath(referencedFile) { - var declFileName = referencedFile.flags & 2048 - ? referencedFile.fileName + var declFileName = referencedFile.flags & 2048 /* DeclarationFile */ + ? referencedFile.fileName // Declaration file, use declaration file name : 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); + ? ts.getOwnEmitOutputFilePath(referencedFile, host, ".d.ts") // Own output file so get the .d.ts file + : ts.removeFileExtension(compilerOptions.out) + ".d.ts"; // Global out file + declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(jsFilePath)), declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, + /*isAbsolutePathAnUrl*/ false); referencePathsOutput += "/// " + newLine; } } + /* @internal */ function writeDeclarationFile(jsFilePath, sourceFile, host, resolver, diagnostics) { var emitDeclarationResult = emitDeclarations(host, resolver, diagnostics, jsFilePath, sourceFile); + // TODO(shkamat): Should we not write any declaration file if any of them can produce error, + // or should we just not write this file like we are doing now if (!emitDeclarationResult.reportedDeclarationError) { var declarationOutput = emitDeclarationResult.referencePathsOutput + getDeclarationOutput(emitDeclarationResult.synchronousDeclarationOutput, emitDeclarationResult.moduleElementDeclarationEmitInfo); @@ -20216,6 +23989,7 @@ var ts; function getDeclarationOutput(synchronousDeclarationOutput, moduleElementDeclarationEmitInfo) { var appliedSyncOutputPos = 0; var declarationOutput = ""; + // apply asynchronous additions to the synchronous output ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { if (aliasEmitInfo.asynchronousOutput) { declarationOutput += synchronousDeclarationOutput.substring(appliedSyncOutputPos, aliasEmitInfo.outputPos); @@ -20231,12 +24005,14 @@ var ts; })(ts || (ts = {})); /// /// +/* @internal */ var ts; (function (ts) { function isExternalModuleOrDeclarationFile(sourceFile) { return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); } ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; + // Flags enum to track count of temp variables and a few dedicated names var TempFlags; (function (TempFlags) { TempFlags[TempFlags["Auto"] = 0] = "Auto"; @@ -20244,9 +24020,18 @@ var ts; TempFlags[TempFlags["_i"] = 268435456] = "_i"; TempFlags[TempFlags["_n"] = 536870912] = "_n"; })(TempFlags || (TempFlags = {})); + // targetSourceFile is when users only want one file in entire project to be emitted. This is used in compileOnSave feature function emitFiles(resolver, host, targetSourceFile) { + // emit output for the __extends helper function + var extendsHelper = "\nvar __extends = this.__extends || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n __.prototype = b.prototype;\n d.prototype = new __();\n};"; + // emit output for the __decorate helper function + var decorateHelper = "\nvar __decorate = this.__decorate || (typeof Reflect === \"object\" && Reflect.decorate) || function (decorators, target, key, desc) {\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};"; + // emit output for the __metadata helper function + var metadataHelper = "\nvar __metadata = this.__metadata || (typeof Reflect === \"object\" && Reflect.metadata) || function () { };"; + // emit output for the __param helper function + var paramHelper = "\nvar __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } };"; var compilerOptions = host.getCompilerOptions(); - var languageVersion = compilerOptions.target || 0; + var languageVersion = compilerOptions.target || 0 /* ES3 */; var sourceMapDataList = compilerOptions.sourceMap ? [] : undefined; var diagnostics = []; var newLine = host.getNewLine(); @@ -20262,6 +24047,7 @@ var ts; } } else { + // targetSourceFile is specified (e.g calling emitter from language service or calling getSemanticDiagnostic from language service) if (ts.shouldEmitToOwnFile(targetSourceFile, compilerOptions)) { var jsFilePath = ts.getOwnEmitOutputFilePath(targetSourceFile, host, ".js"); emitFile(jsFilePath, targetSourceFile); @@ -20270,6 +24056,7 @@ var ts; emitFile(compilerOptions.out); } } + // Sort and make the unique list of diagnostics diagnostics = ts.sortAndDeduplicateDiagnostics(diagnostics); return { emitSkipped: false, @@ -20287,7 +24074,8 @@ var ts; 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)) { + // We conservatively include alias symbols to cover cases where they're emitted as locals + if (node.locals[name].flags & (107455 /* Value */ | 1048576 /* ExportValue */ | 8388608 /* Alias */)) { return false; } } @@ -20308,6 +24096,7 @@ var ts; var computedPropertyNamesToGeneratedNames; var extendsEmitted = false; var decorateEmitted = false; + var paramEmitted = false; var tempFlags = 0; var tempVariables; var tempParameters; @@ -20315,20 +24104,36 @@ var ts; var exportSpecifiers; var exportEquals; var hasExportStars; + /** write emitted output to disk*/ var writeEmittedFiles = writeJavaScriptFile; var detachedCommentsInfo; var writeComment = ts.writeCommentRange; + /** Emit a node */ var emit = emitNodeWithoutSourceMap; + /** Called just before starting emit of a node */ var emitStart = function (node) { }; + /** Called once the emit of the node is done */ var emitEnd = function (node) { }; + /** Emit the text for the given token that comes after startPos + * This by default writes the text provided with the given tokenKind + * but if optional emitFn callback is provided the text is emitted using the callback instead of default text + * @param tokenKind the kind of the token to search and emit + * @param startPos the position in the source to start searching for the token + * @param emitFn if given will be invoked to emit the text instead of actual token emit */ var emitToken = emitTokenText; + /** Called to before starting the lexical scopes as in function/class in the emitted code because of node + * @param scopeDeclaration node that starts the lexical scope + * @param scopeName Optional name of this scope instead of deducing one from the declaration node */ var scopeEmitStart = function (scopeDeclaration, scopeName) { }; + /** Called after coming out of the scope */ var scopeEmitEnd = function () { }; + /** Sourcemap data that will get encoded */ var sourceMapData; if (compilerOptions.sourceMap) { initializeEmitterWithSourceMaps(); } if (root) { + // Do not call emit directly. It does not set the currentSourceFile. emitSourceFile(root); } else { @@ -20350,27 +24155,36 @@ var ts; !ts.hasProperty(currentSourceFile.identifiers, name) && !ts.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) { if (flags && !(tempFlags & flags)) { - var name = flags === 268435456 ? "_i" : "_n"; + var name = flags === 268435456 /* _i */ ? "_i" : "_n"; if (isUniqueName(name)) { tempFlags |= flags; return name; } } while (true) { - var count = tempFlags & 268435455; + var count = tempFlags & 268435455 /* CountMask */; tempFlags++; + // Skip over 'i' and 'n' if (count !== 8 && count !== 13) { - var name_12 = count < 26 ? "_" + String.fromCharCode(97 + count) : "_" + (count - 26); - if (isUniqueName(name_12)) { - return name_12; + var name_15 = count < 26 ? "_" + String.fromCharCode(97 /* a */ + count) : "_" + (count - 26); + if (isUniqueName(name_15)) { + return name_15; } } } } + // 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) { - if (baseName.charCodeAt(baseName.length - 1) !== 95) { + // Find the first unique 'name_n', where n is a positive number + if (baseName.charCodeAt(baseName.length - 1) !== 95 /* _ */) { baseName += "_"; } var i = 1; @@ -20391,14 +24205,15 @@ var ts; } } 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)); + if (node.name.kind === 65 /* Identifier */) { + var name_16 = node.name.text; + // Use module/enum name itself if it is unique, otherwise make a unique variation + assignGeneratedName(node, isUniqueLocalName(name_16, node) ? name_16 : makeUniqueName(name_16)); } } function generateNameForImportOrExportDeclaration(node) { var expr = ts.getExternalModuleName(node); - var baseName = expr.kind === 8 ? + var baseName = expr.kind === 8 /* StringLiteral */ ? ts.escapeIdentifier(ts.makeIdentifierFromModuleName(expr.text)) : "module"; assignGeneratedName(node, makeUniqueName(baseName)); } @@ -20413,30 +24228,31 @@ var ts; } } function generateNameForExportAssignment(node) { - if (node.expression && node.expression.kind !== 65) { + if (node.expression && node.expression.kind !== 65 /* Identifier */) { assignGeneratedName(node, makeUniqueName("default")); } } function generateNameForNode(node) { switch (node.kind) { - case 200: - case 201: + case 200 /* FunctionDeclaration */: + case 201 /* ClassDeclaration */: + case 174 /* ClassExpression */: generateNameForFunctionOrClassDeclaration(node); break; - case 205: + case 205 /* ModuleDeclaration */: generateNameForModuleOrEnum(node); generateNameForNode(node.body); break; - case 204: + case 204 /* EnumDeclaration */: generateNameForModuleOrEnum(node); break; - case 209: + case 209 /* ImportDeclaration */: generateNameForImportDeclaration(node); break; - case 215: + case 215 /* ExportDeclaration */: generateNameForExportDeclaration(node); break; - case 214: + case 214 /* ExportAssignment */: generateNameForExportAssignment(node); break; } @@ -20449,13 +24265,16 @@ var ts; return nodeToGeneratedName[nodeId]; } function initializeEmitterWithSourceMaps() { - var sourceMapDir; + var sourceMapDir; // The directory in which sourcemap will be + // Current source map file and its index in the sources list var sourceMapSourceIndex = -1; + // Names and its index map var sourceMapNameIndexMap = {}; var sourceMapNameIndices = []; function getSourceMapNameIndex() { return sourceMapNameIndices.length ? sourceMapNameIndices[sourceMapNameIndices.length - 1] : -1; } + // Last recorded and encoded spans var lastRecordedSourceMapSpan; var lastEncodedSourceMapSpan = { emittedLine: 1, @@ -20465,26 +24284,35 @@ var ts; sourceIndex: 0 }; var lastEncodedNameIndex = 0; + // Encoding for sourcemap span function encodeLastRecordedSourceMapSpan() { if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan === lastEncodedSourceMapSpan) { return; } var prevEncodedEmittedColumn = lastEncodedSourceMapSpan.emittedColumn; + // Line/Comma delimiters if (lastEncodedSourceMapSpan.emittedLine == lastRecordedSourceMapSpan.emittedLine) { + // Emit comma to separate the entry if (sourceMapData.sourceMapMappings) { sourceMapData.sourceMapMappings += ","; } } else { + // Emit line delimiters for (var encodedLine = lastEncodedSourceMapSpan.emittedLine; encodedLine < lastRecordedSourceMapSpan.emittedLine; encodedLine++) { sourceMapData.sourceMapMappings += ";"; } prevEncodedEmittedColumn = 1; } + // 1. Relative Column 0 based sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.emittedColumn - prevEncodedEmittedColumn); + // 2. Relative sourceIndex sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceIndex - lastEncodedSourceMapSpan.sourceIndex); + // 3. Relative sourceLine 0 based sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceLine - lastEncodedSourceMapSpan.sourceLine); + // 4. Relative sourceColumn 0 based sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceColumn - lastEncodedSourceMapSpan.sourceColumn); + // 5. Relative namePosition 0 based if (lastRecordedSourceMapSpan.nameIndex >= 0) { sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.nameIndex - lastEncodedNameIndex); lastEncodedNameIndex = lastRecordedSourceMapSpan.nameIndex; @@ -20498,17 +24326,24 @@ var ts; } throw TypeError(inValue + ": not a 64 based value"); } + // Add a new least significant bit that has the sign of the value. + // if negative number the least significant bit that gets added to the number has value 1 + // else least significant bit value that gets added is 0 + // eg. -1 changes to binary : 01 [1] => 3 + // +1 changes to binary : 01 [0] => 2 if (inValue < 0) { inValue = ((-inValue) << 1) + 1; } else { inValue = inValue << 1; } + // Encode 5 bits at a time starting from least significant bits var encodedStr = ""; do { - var currentDigit = inValue & 31; + var currentDigit = inValue & 31; // 11111 inValue = inValue >> 5; if (inValue > 0) { + // There are still more digits to decode, set the msb (6th bit) currentDigit = currentDigit | 32; } encodedStr = encodedStr + base64FormatEncode(currentDigit); @@ -20518,17 +24353,21 @@ var ts; } function recordSourceMapSpan(pos) { var sourceLinePos = ts.getLineAndCharacterOfPosition(currentSourceFile, pos); + // Convert the location to be one-based. sourceLinePos.line++; sourceLinePos.character++; var emittedLine = writer.getLine(); var emittedColumn = writer.getColumn(); + // If this location wasn't recorded or the location in source is going backwards, record the span if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan.emittedLine != emittedLine || lastRecordedSourceMapSpan.emittedColumn != emittedColumn || (lastRecordedSourceMapSpan.sourceIndex === sourceMapSourceIndex && (lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line || (lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)))) { + // Encode the last recordedSpan before assigning new encodeLastRecordedSourceMapSpan(); + // New span lastRecordedSourceMapSpan = { emittedLine: emittedLine, emittedColumn: emittedColumn, @@ -20539,12 +24378,14 @@ var ts; }; } else { + // Take the new pos instead since there is no change in emittedLine and column since last location lastRecordedSourceMapSpan.sourceLine = sourceLinePos.line; lastRecordedSourceMapSpan.sourceColumn = sourceLinePos.character; lastRecordedSourceMapSpan.sourceIndex = sourceMapSourceIndex; } } function recordEmitNodeStartSpan(node) { + // Get the token pos after skipping to the token (ignoring the leading trivia) recordSourceMapSpan(ts.skipTrivia(currentSourceFile.text, node.pos)); } function recordEmitNodeEndSpan(node) { @@ -20558,9 +24399,14 @@ var ts; return tokenEndPos; } function recordNewSourceFileStart(node) { + // Add the file to tsFilePaths + // If sourceroot option: Use the relative path corresponding to the common directory path + // otherwise source locations relative to map file location var sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir; - sourceMapData.sourceMapSources.push(ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, node.fileName, host.getCurrentDirectory(), host.getCanonicalFileName, true)); + sourceMapData.sourceMapSources.push(ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, node.fileName, host.getCurrentDirectory(), host.getCanonicalFileName, + /*isAbsolutePathAnUrl*/ true)); sourceMapSourceIndex = sourceMapData.sourceMapSources.length - 1; + // The one that can be used from program to get the actual source file sourceMapData.inputSourceFileNames.push(node.fileName); } function recordScopeNameOfNode(node, scopeName) { @@ -20572,8 +24418,11 @@ var ts; if (scopeName) { var parentIndex = getSourceMapNameIndex(); if (parentIndex !== -1) { - var name_14 = node.name; - if (!name_14 || name_14.kind !== 127) { + // Child scopes are always shown with a dot (even if they have no name), + // unless it is a computed property. Then it is shown with brackets, + // but the brackets are included in the name. + var name_17 = node.name; + if (!name_17 || name_17.kind !== 127 /* ComputedPropertyName */) { scopeName = "." + scopeName; } scopeName = sourceMapData.sourceMapNames[parentIndex] + scopeName; @@ -20588,26 +24437,30 @@ var ts; recordScopeNameIndex(scopeNameIndex); } if (scopeName) { + // The scope was already given a name use it recordScopeNameStart(scopeName); } - 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) { + else if (node.kind === 200 /* FunctionDeclaration */ || + node.kind === 162 /* FunctionExpression */ || + node.kind === 134 /* MethodDeclaration */ || + node.kind === 133 /* MethodSignature */ || + node.kind === 136 /* GetAccessor */ || + node.kind === 137 /* SetAccessor */ || + node.kind === 205 /* ModuleDeclaration */ || + node.kind === 201 /* ClassDeclaration */ || + node.kind === 204 /* EnumDeclaration */) { + // Declaration and has associated name use it if (node.name) { - var name_15 = node.name; - scopeName = name_15.kind === 127 - ? ts.getTextOfNode(name_15) + var name_18 = node.name; + // For computed property names, the text will include the brackets + scopeName = name_18.kind === 127 /* ComputedPropertyName */ + ? ts.getTextOfNode(name_18) : node.name.text; } recordScopeNameStart(scopeName); } else { + // Block just use the name from upper level scope recordScopeNameIndex(getSourceMapNameIndex()); } } @@ -20644,11 +24497,14 @@ var ts; } } function writeJavaScriptAndSourceMapFile(emitOutput, writeByteOrderMark) { + // Write source map file encodeLastRecordedSourceMapSpan(); ts.writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings), false); sourceMapDataList.push(sourceMapData); + // Write sourcemap url to the js file and write the js file writeJavaScriptFile(emitOutput + "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL, writeByteOrderMark); } + // Initialize source map data var sourceMapJsFile = ts.getBaseFileName(ts.normalizeSlashes(jsFilePath)); sourceMapData = { sourceMapFilePath: jsFilePath + ".map", @@ -20661,18 +24517,24 @@ var ts; sourceMapMappings: "", sourceMapDecodedMappings: [] }; + // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the + // relative paths of the sources list in the sourcemap sourceMapData.sourceMapSourceRoot = ts.normalizeSlashes(sourceMapData.sourceMapSourceRoot); - if (sourceMapData.sourceMapSourceRoot.length && sourceMapData.sourceMapSourceRoot.charCodeAt(sourceMapData.sourceMapSourceRoot.length - 1) !== 47) { + if (sourceMapData.sourceMapSourceRoot.length && sourceMapData.sourceMapSourceRoot.charCodeAt(sourceMapData.sourceMapSourceRoot.length - 1) !== 47 /* slash */) { sourceMapData.sourceMapSourceRoot += ts.directorySeparator; } if (compilerOptions.mapRoot) { sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); if (root) { + // For modules or multiple emit files the mapRoot will have directory structure like the sources + // So if src\a.ts and src\lib\b.ts are compiled together user would be moving the maps into mapRoot\a.js.map and mapRoot\lib\b.js.map sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(root, host, sourceMapDir)); } if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { + // The relative paths are relative to the common directory sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir); - sourceMapData.jsSourceMappingURL = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(jsFilePath)), ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL), host.getCurrentDirectory(), host.getCanonicalFileName, true); + sourceMapData.jsSourceMappingURL = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(jsFilePath)), ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL), host.getCurrentDirectory(), host.getCanonicalFileName, + /*isAbsolutePathAnUrl*/ true); } else { sourceMapData.jsSourceMappingURL = ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL); @@ -20686,7 +24548,7 @@ var ts; if (ts.nodeIsSynthesized(node)) { return emitNodeWithoutSourceMap(node, false); } - if (node.kind != 227) { + if (node.kind != 227 /* SourceFile */) { recordEmitNodeStartSpan(node); emitNodeWithoutSourceMap(node, allowGeneratedIdentifiers); recordEmitNodeEndSpan(node); @@ -20709,8 +24571,9 @@ var ts; function writeJavaScriptFile(emitOutput, writeByteOrderMark) { ts.writeFile(host, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); } + // Create a temporary variable with a unique unused name. function createTempVariable(flags) { - var result = ts.createSynthesizedNode(65); + var result = ts.createSynthesizedNode(65 /* Identifier */); result.text = makeTempVariableName(flags); return result; } @@ -20804,27 +24667,32 @@ var ts; writeLine(); } } - function emitList(nodes, start, count, multiLine, trailingComma) { + function emitList(nodes, start, count, multiLine, trailingComma, leadingComma, noTrailingNewLine, emitNode) { + if (!emitNode) { + emitNode = emit; + } for (var 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) { if (nodes) { @@ -20841,12 +24709,12 @@ var ts; } } function isBinaryOrOctalIntegerLiteral(node, text) { - if (node.kind === 7 && text.length > 1) { + if (node.kind === 7 /* NumericLiteral */ && text.length > 1) { switch (text.charCodeAt(1)) { - case 98: - case 66: - case 111: - case 79: + case 98 /* b */: + case 66 /* B */: + case 111 /* o */: + case 79 /* O */: return true; } } @@ -20854,10 +24722,10 @@ var ts; } function emitLiteral(node) { var text = getLiteralText(node); - if (compilerOptions.sourceMap && (node.kind === 8 || ts.isTemplateLiteralKind(node.kind))) { + if (compilerOptions.sourceMap && (node.kind === 8 /* StringLiteral */ || ts.isTemplateLiteralKind(node.kind))) { writer.writeLiteral(text); } - else if (languageVersion < 2 && isBinaryOrOctalIntegerLiteral(node, text)) { + else if (languageVersion < 2 /* ES6 */ && isBinaryOrOctalIntegerLiteral(node, text)) { write(node.text); } else { @@ -20865,24 +24733,30 @@ var ts; } } function getLiteralText(node) { - if (languageVersion < 2 && (ts.isTemplateLiteralKind(node.kind) || node.hasExtendedUnicodeEscape)) { + // Any template literal or string literal with an extended escape + // (e.g. "\u{0067}") will need to be downleveled as a escaped string literal. + if (languageVersion < 2 /* ES6 */ && (ts.isTemplateLiteralKind(node.kind) || node.hasExtendedUnicodeEscape)) { return getQuotedEscapedLiteralText('"', node.text, '"'); } + // If we don't need to downlevel and we can reach the original source text using + // the node's parent reference, then simply get the text as it was originally written. if (node.parent) { return ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, node); } + // If we can't reach the original source text, use the canonical form if it's a number, + // or an escaped quoted form of the original text if it's string-like. switch (node.kind) { - case 8: + case 8 /* StringLiteral */: return getQuotedEscapedLiteralText('"', node.text, '"'); - case 10: + case 10 /* NoSubstitutionTemplateLiteral */: return getQuotedEscapedLiteralText('`', node.text, '`'); - case 11: + case 11 /* TemplateHead */: return getQuotedEscapedLiteralText('`', node.text, '${'); - case 12: + case 12 /* TemplateMiddle */: return getQuotedEscapedLiteralText('}', node.text, '${'); - case 13: + case 13 /* TemplateTail */: return getQuotedEscapedLiteralText('}', node.text, '`'); - case 7: + case 7 /* NumericLiteral */: return node.text; } ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for."); @@ -20891,16 +24765,26 @@ var ts; return leftQuote + ts.escapeNonAsciiCharacters(ts.escapeString(text)) + rightQuote; } function emitDownlevelRawTemplateLiteral(node) { + // Find original source text, since we need to emit the raw strings of the tagged template. + // The raw strings contain the (escaped) strings of what the user wrote. + // Examples: `\n` is converted to "\\n", a template string with a newline to "\n". var text = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, node); - var isLast = node.kind === 10 || node.kind === 13; + // text contains the original source, it will also contain quotes ("`"), dolar signs and braces ("${" and "}"), + // thus we need to remove those characters. + // First template piece starts with "`", others with "}" + // Last template piece ends with "`", others with "${" + var isLast = node.kind === 10 /* NoSubstitutionTemplateLiteral */ || node.kind === 13 /* TemplateTail */; text = text.substring(1, text.length - (isLast ? 1 : 2)); + // Newline normalization: + // ES6 Spec 11.8.6.1 - Static Semantics of TV's and TRV's + // and LineTerminatorSequences are normalized to for both TV and TRV. text = text.replace(/\r\n?/g, "\n"); text = ts.escapeString(text); write('"' + text + '"'); } function emitDownlevelTaggedTemplateArray(node, literalEmitter) { write("["); - if (node.template.kind === 10) { + if (node.template.kind === 10 /* NoSubstitutionTemplateLiteral */) { literalEmitter(node.template); } else { @@ -20913,7 +24797,7 @@ var ts; write("]"); } function emitDownlevelTaggedTemplate(node) { - var tempVariable = createAndRecordTempVariable(0); + var tempVariable = createAndRecordTempVariable(0 /* Auto */); write("("); emit(tempVariable); write(" = "); @@ -20926,18 +24810,21 @@ var ts; emitParenthesizedIf(node.tag, needsParenthesisForPropertyAccessOrInvocation(node.tag)); write("("); emit(tempVariable); - if (node.template.kind === 171) { + // Now we emit the expressions + if (node.template.kind === 171 /* TemplateExpression */) { ts.forEach(node.template.templateSpans, function (templateSpan) { write(", "); - var needsParens = templateSpan.expression.kind === 169 - && templateSpan.expression.operatorToken.kind === 23; + var needsParens = templateSpan.expression.kind === 169 /* BinaryExpression */ + && templateSpan.expression.operatorToken.kind === 23 /* CommaToken */; emitParenthesizedIf(templateSpan.expression, needsParens); }); } write("))"); } function emitTemplateExpression(node) { - if (languageVersion >= 2) { + // In ES6 mode and above, we can simply emit each portion of a template in order, but in + // ES3 & ES5 we must convert the template expression into a series of string concatenations. + if (languageVersion >= 2 /* ES6 */) { ts.forEachChild(node, emit); return; } @@ -20953,12 +24840,28 @@ var ts; } for (var i = 0, n = node.templateSpans.length; i < n; i++) { var templateSpan = node.templateSpans[i]; - var needsParens = templateSpan.expression.kind !== 161 - && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1; + // Check if the expression has operands and binds its operands less closely than binary '+'. + // If it does, we need to wrap the expression in parentheses. Otherwise, something like + // `abc${ 1 << 2 }` + // becomes + // "abc" + 1 << 2 + "" + // which is really + // ("abc" + 1) << (2 + "") + // rather than + // "abc" + (1 << 2) + "" + var needsParens = templateSpan.expression.kind !== 161 /* ParenthesizedExpression */ + && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1 /* GreaterThan */; if (i > 0 || headEmitted) { + // If this is the first span and the head was not emitted, then this templateSpan's + // expression will be the first to be emitted. Don't emit the preceding ' + ' in that + // case. write(" + "); } emitParenthesizedIf(templateSpan.expression, needsParens); + // Only emit if the literal is non-empty. + // The binary '+' operator is left-associative, so the first string concatenation + // with the head will force the result up to this point to be a string. + // Emitting a '+ ""' has no semantic effect for middles and tails. if (templateSpan.literal.text.length !== 0) { write(" + "); emitLiteral(templateSpan.literal); @@ -20981,39 +24884,55 @@ var ts; // `${ foo }${ bar }` // must still be emitted as // "" + foo + bar + // There is always atleast one templateSpan in this code path, since + // NoSubstitutionTemplateLiterals are directly emitted via emitLiteral() 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 157: - case 158: + case 157 /* CallExpression */: + case 158 /* NewExpression */: return parent.expression === template; - case 159: - case 161: + case 159 /* TaggedTemplateExpression */: + case 161 /* ParenthesizedExpression */: return false; default: - return comparePrecedenceToBinaryPlus(parent) !== -1; + return comparePrecedenceToBinaryPlus(parent) !== -1 /* LessThan */; } } + /** + * Returns whether the expression has lesser, greater, + * or equal precedence to the binary '+' operator + */ function comparePrecedenceToBinaryPlus(expression) { + // All binary expressions have lower precedence than '+' apart from '*', '/', and '%' + // which have greater precedence and '-' which has equal precedence. + // All unary operators have a higher precedence apart from yield. + // Arrow functions and conditionals have a lower precedence, + // although we convert the former into regular function expressions in ES5 mode, + // and in ES6 mode this function won't get called anyway. + // + // TODO (drosen): Note that we need to account for the upcoming 'yield' and + // spread ('...') unary operators that are anticipated for ES6. switch (expression.kind) { - case 169: + case 169 /* BinaryExpression */: switch (expression.operatorToken.kind) { - case 35: - case 36: - case 37: - return 1; - case 33: - case 34: - return 0; + case 35 /* AsteriskToken */: + case 36 /* SlashToken */: + case 37 /* PercentToken */: + return 1 /* GreaterThan */; + case 33 /* PlusToken */: + case 34 /* MinusToken */: + return 0 /* EqualTo */; default: - return -1; + return -1 /* LessThan */; } - case 170: - return -1; + case 172 /* YieldExpression */: + case 170 /* ConditionalExpression */: + return -1 /* LessThan */; default: - return 1; + return 1 /* GreaterThan */; } } } @@ -21021,25 +24940,39 @@ var ts; emit(span.expression); emit(span.literal); } + // This function specifically handles numeric/string literals for enum and accessor 'identifiers'. + // In a sense, it does not actually emit identifiers as much as it declares a name for a specific property. + // For example, this is utilized when feeding in a result to Object.defineProperty. function emitExpressionForPropertyName(node) { - ts.Debug.assert(node.kind !== 152); - if (node.kind === 8) { + ts.Debug.assert(node.kind !== 152 /* BindingElement */); + if (node.kind === 8 /* StringLiteral */) { emitLiteral(node); } - else if (node.kind === 127) { + else if (node.kind === 127 /* ComputedPropertyName */) { + // if this is a decorated computed property, we will need to capture the result + // of the property expression so that we can apply decorators later. This is to ensure + // we don't introduce unintended side effects: + // + // class C { + // [_a = x]() { } + // } + // + // The emit for the decorated computed property decorator is: + // + // Object.defineProperty(C.prototype, _a, __decorate([dec], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a))); + // if (ts.nodeIsDecorated(node.parent)) { if (!computedPropertyNamesToGeneratedNames) { computedPropertyNamesToGeneratedNames = []; } - var generatedName = computedPropertyNamesToGeneratedNames[node.id]; + var generatedName = computedPropertyNamesToGeneratedNames[ts.getNodeId(node)]; if (generatedName) { + // we have already generated a variable for this node, write that value instead. write(generatedName); return; } - var generatedVariable = createTempVariable(0); - generatedName = generatedVariable.text; - recordTempDeclaration(generatedVariable); - computedPropertyNamesToGeneratedNames[node.id] = generatedName; + generatedName = createAndRecordTempVariable(0 /* Auto */).text; + computedPropertyNamesToGeneratedNames[ts.getNodeId(node)] = generatedName; write(generatedName); write(" = "); } @@ -21047,7 +24980,7 @@ var ts; } else { write("\""); - if (node.kind === 7) { + if (node.kind === 7 /* NumericLiteral */) { write(node.text); } else { @@ -21059,36 +24992,36 @@ var ts; function isNotExpressionIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 129: - case 198: - case 152: - case 132: - case 131: - case 224: - case 225: - case 226: - case 134: - case 133: - case 200: - case 136: - case 137: - case 162: - case 201: - case 202: - case 204: - case 205: - case 208: - case 210: - case 211: + case 129 /* Parameter */: + case 198 /* VariableDeclaration */: + case 152 /* BindingElement */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 224 /* PropertyAssignment */: + case 225 /* ShorthandPropertyAssignment */: + case 226 /* EnumMember */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 200 /* FunctionDeclaration */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 162 /* FunctionExpression */: + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + case 204 /* EnumDeclaration */: + case 205 /* ModuleDeclaration */: + case 208 /* ImportEqualsDeclaration */: + case 210 /* ImportClause */: + case 211 /* NamespaceImport */: return parent.name === node; - case 213: - case 217: + case 213 /* ImportSpecifier */: + case 217 /* ExportSpecifier */: return parent.name === node || parent.propertyName === node; - case 190: - case 189: - case 214: + case 190 /* BreakStatement */: + case 189 /* ContinueStatement */: + case 214 /* ExportAssignment */: return false; - case 194: + case 194 /* LabeledStatement */: return node.parent.label === node; } } @@ -21130,7 +25063,7 @@ var ts; } } function emitThis(node) { - if (resolver.getNodeCheckFlags(node) & 2) { + if (resolver.getNodeCheckFlags(node) & 2 /* LexicalThis */) { write("_this"); } else { @@ -21138,12 +25071,12 @@ var ts; } } function emitSuper(node) { - if (languageVersion >= 2) { + if (languageVersion >= 2 /* ES6 */) { write("super"); } else { var flags = resolver.getNodeCheckFlags(node); - if (flags & 16) { + if (flags & 16 /* SuperInstance */) { write("_super.prototype"); } else { @@ -21183,14 +25116,26 @@ var ts; write("..."); emit(node.expression); } + function emitYieldExpression(node) { + write(ts.tokenToString(110 /* YieldKeyword */)); + if (node.asteriskToken) { + write("*"); + } + if (node.expression) { + write(" "); + emit(node.expression); + } + } function needsParenthesisForPropertyAccessOrInvocation(node) { switch (node.kind) { - case 65: - case 153: - case 155: - case 156: - case 157: - case 161: + case 65 /* Identifier */: + case 153 /* ArrayLiteralExpression */: + case 155 /* PropertyAccessExpression */: + case 156 /* ElementAccessExpression */: + case 157 /* CallExpression */: + case 161 /* ParenthesizedExpression */: + // This list is not exhaustive and only includes those cases that are relevant + // to the check in emitArrayLiteral. More cases can be added as needed. return false; } return true; @@ -21200,6 +25145,7 @@ var ts; var group = 0; var length = elements.length; while (pos < length) { + // Emit using the pattern .concat(, , ...) if (group === 1) { write(".concat("); } @@ -21207,14 +25153,14 @@ var ts; write(", "); } var e = elements[pos]; - if (e.kind === 173) { + if (e.kind === 173 /* SpreadElementExpression */) { e = e.expression; emitParenthesizedIf(e, group === 0 && needsParenthesisForPropertyAccessOrInvocation(e)); pos++; } else { var i = pos; - while (i < length && elements[i].kind !== 173) { + while (i < length && elements[i].kind !== 173 /* SpreadElementExpression */) { i++; } write("["); @@ -21235,171 +25181,169 @@ var ts; } } function isSpreadElementExpression(node) { - return node.kind === 173; + return node.kind === 173 /* SpreadElementExpression */; } function emitArrayLiteral(node) { var elements = node.elements; if (elements.length === 0) { write("[]"); } - else if (languageVersion >= 2 || !ts.forEach(elements, isSpreadElementExpression)) { + else if (languageVersion >= 2 /* ES6 */ || !ts.forEach(elements, isSpreadElementExpression)) { write("["); emitLinePreservingList(node, node.elements, elements.hasTrailingComma, false); write("]"); } else { - emitListWithSpread(elements, (node.flags & 512) !== 0, elements.hasTrailingComma); + emitListWithSpread(elements, (node.flags & 512 /* MultiLine */) !== 0, + /*trailingComma*/ elements.hasTrailingComma); } } + function emitObjectLiteralBody(node, numElements) { + 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, languageVersion >= 1 /* ES5 */, true); + } + else { + var multiLine = (node.flags & 512 /* MultiLine */) !== 0; + if (!multiLine) { + write(" "); + } + else { + increaseIndent(); + } + emitList(properties, 0, numElements, multiLine, false); + if (!multiLine) { + write(" "); + } + else { + decreaseIndent(); + } + } + } + write("}"); + } function emitDownlevelObjectLiteralWithComputedProperties(node, firstComputedPropertyIndex) { - var parenthesizedObjectLiteral = createDownlevelObjectLiteralWithComputedProperties(node, firstComputedPropertyIndex); - return emit(parenthesizedObjectLiteral); - } - function createDownlevelObjectLiteralWithComputedProperties(originalObjectLiteral, firstComputedPropertyIndex) { - var tempVar = createAndRecordTempVariable(0); - var initialObjectLiteral = ts.createSynthesizedNode(154); - initialObjectLiteral.properties = originalObjectLiteral.properties.slice(0, firstComputedPropertyIndex); - initialObjectLiteral.flags |= 512; - var propertyPatches = createBinaryExpression(tempVar, 53, initialObjectLiteral); - ts.forEach(originalObjectLiteral.properties, function (property) { - var patchedProperty = tryCreatePatchingPropertyAssignment(originalObjectLiteral, tempVar, property); - if (patchedProperty) { - propertyPatches = createBinaryExpression(propertyPatches, 23, patchedProperty); + var multiLine = (node.flags & 512 /* MultiLine */) !== 0; + var 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. + var tempVar = createAndRecordTempVariable(0 /* Auto */); + // 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); + for (var i = firstComputedPropertyIndex, n = properties.length; i < n; i++) { + writeComma(); + var property = properties[i]; + emitStart(property); + if (property.kind === 136 /* GetAccessor */ || property.kind === 137 /* SetAccessor */) { + // TODO (drosen): Reconcile with 'emitMemberFunctions'. + var accessors = ts.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); } - }); - propertyPatches = createBinaryExpression(propertyPatches, 23, createIdentifier(tempVar.text, true)); - var result = createParenthesizedExpression(propertyPatches); - return result; - } - function addCommentsToSynthesizedNode(node, leadingCommentRanges, trailingCommentRanges) { - node.leadingCommentRanges = leadingCommentRanges; - node.trailingCommentRanges = trailingCommentRanges; - } - function tryCreatePatchingPropertyAssignment(objectLiteral, tempVar, property) { - var leftHandSide = createMemberAccessForPropertyName(tempVar, property.name); - var maybeRightHandSide = tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral, property); - return maybeRightHandSide && createBinaryExpression(leftHandSide, 53, maybeRightHandSide, true); - } - function tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral, property) { - switch (property.kind) { - case 224: - return property.initializer; - case 225: - return createIdentifier(resolver.getExpressionNameSubstitution(property.name, getGeneratedNameForNode)); - case 134: - 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; + else { + emitLeadingComments(property); + emitStart(property.name); + emit(tempVar); + emitMemberAccessForPropertyName(property.name); + emitEnd(property.name); + write(" = "); + if (property.kind === 224 /* PropertyAssignment */) { + emit(property.initializer); } - var propertyDescriptor = ts.createSynthesizedNode(154); - var descriptorProperties = []; - if (getAccessor) { - var getProperty_1 = createPropertyAssignment(createIdentifier("get"), createFunctionExpression(getAccessor.parameters, getAccessor.body)); - descriptorProperties.push(getProperty_1); + else if (property.kind === 225 /* ShorthandPropertyAssignment */) { + emitExpressionIdentifier(property.name); } - if (setAccessor) { - var setProperty = createPropertyAssignment(createIdentifier("set"), createFunctionExpression(setAccessor.parameters, setAccessor.body)); - descriptorProperties.push(setProperty); + else if (property.kind === 134 /* MethodDeclaration */) { + emitFunctionDeclaration(property); } - var trueExpr = ts.createSynthesizedNode(95); - var enumerableTrue = createPropertyAssignment(createIdentifier("enumerable"), trueExpr); - descriptorProperties.push(enumerableTrue); - var configurableTrue = createPropertyAssignment(createIdentifier("configurable"), trueExpr); - descriptorProperties.push(configurableTrue); - propertyDescriptor.properties = descriptorProperties; - var objectDotDefineProperty = createPropertyAccessExpression(createIdentifier("Object"), createIdentifier("defineProperty")); - return createCallExpression(objectDotDefineProperty, createNodeArray(propertyDescriptor)); - default: - ts.Debug.fail("ObjectLiteralElement kind " + property.kind + " not accounted for."); + else { + ts.Debug.fail("ObjectLiteralElement type not accounted for: " + property.kind); + } + } + emitEnd(property); } - } - function createParenthesizedExpression(expression) { - var result = ts.createSynthesizedNode(161); - result.expression = expression; - return result; - } - function createNodeArray() { - var elements = []; - for (var _a = 0; _a < arguments.length; _a++) { - elements[_a - 0] = arguments[_a]; + writeComma(); + emit(tempVar); + if (multiLine) { + decreaseIndent(); + writeLine(); } - var result = elements; - result.pos = -1; - result.end = -1; - return result; - } - function createBinaryExpression(left, operator, right, 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(182); - result.expression = expression; - return result; - } - function createMemberAccessForPropertyName(expression, memberName) { - if (memberName.kind === 65) { - return createPropertyAccessExpression(expression, memberName); + write(")"); + function writeComma() { + if (multiLine) { + write(","); + writeLine(); + } + else { + write(", "); + } } - else if (memberName.kind === 8 || memberName.kind === 7) { - return createElementAccessExpression(expression, memberName); - } - else if (memberName.kind === 127) { - return createElementAccessExpression(expression, memberName.expression); - } - else { - ts.Debug.fail("Kind '" + memberName.kind + "' not accounted for."); - } - } - function createPropertyAssignment(name, initializer) { - var result = ts.createSynthesizedNode(224); - result.name = name; - result.initializer = initializer; - return result; - } - function createFunctionExpression(parameters, body) { - var result = ts.createSynthesizedNode(162); - result.parameters = parameters; - result.body = body; - return result; - } - function createPropertyAccessExpression(expression, name) { - 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(156); - result.expression = expression; - result.argumentExpression = argumentExpression; - return result; - } - function createIdentifier(name, startsOnNewLine) { - var result = ts.createSynthesizedNode(65, startsOnNewLine); - result.text = name; - return result; - } - function createCallExpression(invokedExpression, arguments) { - var result = ts.createSynthesizedNode(157); - result.expression = invokedExpression; - result.arguments = arguments; - return result; } function emitObjectLiteral(node) { var properties = node.properties; - if (languageVersion < 2) { + if (languageVersion < 2 /* ES6 */) { var numProperties = properties.length; + // Find the first computed property. + // Everything until that point can be emitted as part of the initial object literal. var numInitialNonComputedProperties = numProperties; for (var i = 0, n = properties.length; i < n; i++) { - if (properties[i].name.kind === 127) { + if (properties[i].name.kind === 127 /* ComputedPropertyName */) { numInitialNonComputedProperties = i; break; } @@ -21410,11 +25354,45 @@ var ts; return; } } - write("{"); - if (properties.length) { - emitLinePreservingList(node, properties, languageVersion >= 1, true); + // Ordinary case: either the object has no computed properties + // or we're compiling with an ES6+ target. + emitObjectLiteralBody(node, properties.length); + } + function createBinaryExpression(left, operator, right, startsOnNewLine) { + var result = ts.createSynthesizedNode(169 /* BinaryExpression */, startsOnNewLine); + result.operatorToken = ts.createSynthesizedNode(operator); + result.left = left; + result.right = right; + return result; + } + function createPropertyAccessExpression(expression, name) { + var result = ts.createSynthesizedNode(155 /* PropertyAccessExpression */); + result.expression = parenthesizeForAccess(expression); + result.dotToken = ts.createSynthesizedNode(20 /* DotToken */); + result.name = name; + return result; + } + function createElementAccessExpression(expression, argumentExpression) { + var result = ts.createSynthesizedNode(156 /* ElementAccessExpression */); + result.expression = parenthesizeForAccess(expression); + result.argumentExpression = argumentExpression; + return result; + } + function parenthesizeForAccess(expr) { + // isLeftHandSideExpression is almost the correct criterion for when it is not necessary + // to parenthesize the expression before a dot. The known exceptions are: + // + // NewExpression: + // new C.x -> not the same as (new C).x + // NumberLiteral + // 1.x -> not the same as (1).x + // + if (ts.isLeftHandSideExpression(expr) && expr.kind !== 158 /* NewExpression */ && expr.kind !== 7 /* NumericLiteral */) { + return expr; } - write("}"); + var node = ts.createSynthesizedNode(161 /* ParenthesizedExpression */); + node.expression = expr; + return node; } function emitComputedPropertyName(node) { write("["); @@ -21422,8 +25400,11 @@ var ts; write("]"); } function emitMethod(node) { + if (languageVersion >= 2 /* ES6 */ && node.asteriskToken) { + write("*"); + } emit(node.name, false); - if (languageVersion < 2) { + if (languageVersion < 2 /* ES6 */) { write(": function "); } emitSignatureAndBody(node); @@ -21435,38 +25416,57 @@ var ts; } function emitShorthandPropertyAssignment(node) { emit(node.name, false); - if (languageVersion < 2) { + // If short-hand property has a prefix, then regardless of the target version, we will emit it as normal property assignment. For example: + // module m { + // export let y; + // } + // module m { + // export let obj = { y }; + // } + // The short-hand property in obj need to emit as such ... = { y : m.y } regardless of the TargetScript version + if (languageVersion < 2 /* ES6 */) { + // Emit identifier as an identifier write(": "); var generatedName = getGeneratedNameForIdentifier(node.name); if (generatedName) { write(generatedName); } else { + // Even though this is stored as identifier treat it as an expression + // Short-hand, { x }, is equivalent of normal form { x: x } emitExpressionIdentifier(node.name); } } else if (resolver.getExpressionNameSubstitution(node.name, getGeneratedNameForNode)) { + // Emit identifier as an identifier write(": "); + // Even though this is stored as identifier treat it as an expression + // Short-hand, { x }, is equivalent of normal form { x: x } emitExpressionIdentifier(node.name); } } function tryEmitConstantValue(node) { if (compilerOptions.separateCompilation) { + // do not inline enum values in separate compilation mode return false; } var constantValue = resolver.getConstantValue(node); if (constantValue !== undefined) { write(constantValue.toString()); if (!compilerOptions.removeComments) { - var propertyName = node.kind === 155 ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); + var propertyName = node.kind === 155 /* PropertyAccessExpression */ ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); write(" /* " + propertyName + " */"); } return true; } return false; } + // Returns 'true' if the code was actually indented, false otherwise. + // If the code is not indented, an optional valueToWriteWhenNotIndenting will be + // emitted instead. function indentIfOnDifferentLines(parent, node1, node2, valueToWriteWhenNotIndenting) { var realNodesAreOnDifferentLines = !ts.nodeIsSynthesized(parent) && !nodeEndIsOnSameLineAsNodeStart(node1, node2); + // Always use a newline for synthesized code if the synthesizer desires it. var synthesizedNodeIsOnDifferentLine = synthesizedNodeStartsOnNewLine(node2); if (realNodesAreOnDifferentLines || synthesizedNodeIsOnDifferentLine) { increaseIndent(); @@ -21506,20 +25506,20 @@ var ts; write("]"); } function hasSpreadElement(elements) { - return ts.forEach(elements, function (e) { return e.kind === 173; }); + return ts.forEach(elements, function (e) { return e.kind === 173 /* SpreadElementExpression */; }); } function skipParentheses(node) { - while (node.kind === 161 || node.kind === 160) { + while (node.kind === 161 /* ParenthesizedExpression */ || node.kind === 160 /* TypeAssertionExpression */) { node = node.expression; } return node; } function emitCallTarget(node) { - if (node.kind === 65 || node.kind === 93 || node.kind === 91) { + if (node.kind === 65 /* Identifier */ || node.kind === 93 /* ThisKeyword */ || node.kind === 91 /* SuperKeyword */) { emit(node); return node; } - var temp = createAndRecordTempVariable(0); + var temp = createAndRecordTempVariable(0 /* Auto */); write("("); emit(temp); write(" = "); @@ -21530,18 +25530,20 @@ var ts; function emitCallWithSpread(node) { var target; var expr = skipParentheses(node.expression); - if (expr.kind === 155) { + if (expr.kind === 155 /* PropertyAccessExpression */) { + // Target will be emitted as "this" argument target = emitCallTarget(expr.expression); write("."); emit(expr.name); } - else if (expr.kind === 156) { + else if (expr.kind === 156 /* ElementAccessExpression */) { + // Target will be emitted as "this" argument target = emitCallTarget(expr.expression); write("["); emit(expr.argumentExpression); write("]"); } - else if (expr.kind === 91) { + else if (expr.kind === 91 /* SuperKeyword */) { target = expr; write("_super"); } @@ -21550,14 +25552,17 @@ var ts; } write(".apply("); if (target) { - if (target.kind === 91) { + if (target.kind === 91 /* SuperKeyword */) { + // Calls of form super(...) and super.foo(...) emitThis(target); } else { + // Calls of form obj.foo(...) emit(target); } } else { + // Calls of form foo(...) write("void 0"); } write(", "); @@ -21565,20 +25570,20 @@ var ts; write(")"); } function emitCallExpression(node) { - if (languageVersion < 2 && hasSpreadElement(node.arguments)) { + if (languageVersion < 2 /* ES6 */ && hasSpreadElement(node.arguments)) { emitCallWithSpread(node); return; } var superCall = false; - if (node.expression.kind === 91) { + if (node.expression.kind === 91 /* SuperKeyword */) { emitSuper(node.expression); superCall = true; } else { emit(node.expression); - superCall = node.expression.kind === 155 && node.expression.expression.kind === 91; + superCall = node.expression.kind === 155 /* PropertyAccessExpression */ && node.expression.expression.kind === 91 /* SuperKeyword */; } - if (superCall && languageVersion < 2) { + if (superCall && languageVersion < 2 /* ES6 */) { write(".call("); emitThis(node.expression); if (node.arguments.length) { @@ -21603,7 +25608,7 @@ var ts; } } function emitTaggedTemplateExpression(node) { - if (languageVersion >= 2) { + if (languageVersion >= 2 /* ES6 */) { emit(node.tag); write(" "); emit(node.template); @@ -21613,20 +25618,30 @@ var ts; } } function emitParenExpression(node) { - if (!node.parent || node.parent.kind !== 163) { - if (node.expression.kind === 160) { + if (!node.parent || node.parent.kind !== 163 /* ArrowFunction */) { + if (node.expression.kind === 160 /* TypeAssertionExpression */) { var operand = node.expression.expression; - while (operand.kind == 160) { + // Make sure we consider all nested cast expressions, e.g.: + // (-A).x; + while (operand.kind == 160 /* TypeAssertionExpression */) { operand = operand.expression; } - 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)) { + // We have an expression of the form: (SubExpr) + // Emitting this as (SubExpr) is really not desirable. We would like to emit the subexpr as is. + // Omitting the parentheses, however, could cause change in the semantics of the generated + // code if the casted expression has a lower precedence than the rest of the expression, e.g.: + // (new A).foo should be emitted as (new A).foo and not new A.foo + // (typeof A).toString() should be emitted as (typeof A).toString() and not typeof A.toString() + // new (A()) should be emitted as new (A()) and not new A() + // (function foo() { })() should be emitted as an IIF (function foo(){})() and not declaration function foo(){} () + if (operand.kind !== 167 /* PrefixUnaryExpression */ && + operand.kind !== 166 /* VoidExpression */ && + operand.kind !== 165 /* TypeOfExpression */ && + operand.kind !== 164 /* DeleteExpression */ && + operand.kind !== 168 /* PostfixUnaryExpression */ && + operand.kind !== 158 /* NewExpression */ && + !(operand.kind === 157 /* CallExpression */ && node.parent.kind === 158 /* NewExpression */) && + !(operand.kind === 162 /* FunctionExpression */ && node.parent.kind === 157 /* CallExpression */)) { emit(operand); return; } @@ -21637,28 +25652,40 @@ var ts; write(")"); } function emitDeleteExpression(node) { - write(ts.tokenToString(74)); + write(ts.tokenToString(74 /* DeleteKeyword */)); write(" "); emit(node.expression); } function emitVoidExpression(node) { - write(ts.tokenToString(99)); + write(ts.tokenToString(99 /* VoidKeyword */)); write(" "); emit(node.expression); } function emitTypeOfExpression(node) { - write(ts.tokenToString(97)); + write(ts.tokenToString(97 /* TypeOfKeyword */)); write(" "); emit(node.expression); } function emitPrefixUnaryExpression(node) { write(ts.tokenToString(node.operator)); - if (node.operand.kind === 167) { + // In some cases, we need to emit a space between the operator and the operand. One obvious case + // is when the operator is an identifier, like delete or typeof. We also need to do this for plus + // and minus expressions in certain cases. Specifically, consider the following two cases (parens + // are just for clarity of exposition, and not part of the source code): + // + // (+(+1)) + // (+(++1)) + // + // We need to emit a space in both cases. In the first case, the absence of a space will make + // the resulting expression a prefix increment operation. And in the second, it will make the resulting + // expression a prefix increment whose operand is a plus expression - (++(+x)) + // The same is true of minus of course. + if (node.operand.kind === 167 /* PrefixUnaryExpression */) { var operand = node.operand; - if (node.operator === 33 && (operand.operator === 33 || operand.operator === 38)) { + if (node.operator === 33 /* PlusToken */ && (operand.operator === 33 /* PlusToken */ || operand.operator === 38 /* PlusPlusToken */)) { write(" "); } - else if (node.operator === 34 && (operand.operator === 34 || operand.operator === 39)) { + else if (node.operator === 34 /* MinusToken */ && (operand.operator === 34 /* MinusToken */ || operand.operator === 39 /* MinusMinusToken */)) { write(" "); } } @@ -21669,13 +25696,13 @@ var ts; write(ts.tokenToString(node.operator)); } function emitBinaryExpression(node) { - if (languageVersion < 2 && node.operatorToken.kind === 53 && - (node.left.kind === 154 || node.left.kind === 153)) { - emitDestructuring(node, node.parent.kind === 182); + if (languageVersion < 2 /* ES6 */ && node.operatorToken.kind === 53 /* EqualsToken */ && + (node.left.kind === 154 /* ObjectLiteralExpression */ || node.left.kind === 153 /* ArrayLiteralExpression */)) { + emitDestructuring(node, node.parent.kind === 182 /* ExpressionStatement */); } else { emit(node.left); - var indentedBeforeOperator = indentIfOnDifferentLines(node, node.left, node.operatorToken, node.operatorToken.kind !== 23 ? " " : undefined); + var indentedBeforeOperator = indentIfOnDifferentLines(node, node.left, node.operatorToken, node.operatorToken.kind !== 23 /* CommaToken */ ? " " : undefined); write(ts.tokenToString(node.operatorToken.kind)); var indentedAfterOperator = indentIfOnDifferentLines(node, node.operatorToken, node.right, " "); emit(node.right); @@ -21698,6 +25725,10 @@ var ts; emit(node.whenFalse); decreaseIndentIf(indentedBeforeColon, indentedAfterColon); } + // Helper function to decrease the indent if we previously indented. Allows multiple + // previous indent values to be considered at a time. This also allows caller to just + // call this once, passing in all their appropriate indent values, instead of needing + // to call this helper function multiple times. function decreaseIndentIf(value1, value2) { if (value1) { decreaseIndent(); @@ -21707,36 +25738,36 @@ var ts; } } function isSingleLineEmptyBlock(node) { - if (node && node.kind === 179) { + if (node && node.kind === 179 /* Block */) { var block = node; return block.statements.length === 0 && nodeEndIsOnSameLineAsNodeStart(block, block); } } function emitBlock(node) { if (isSingleLineEmptyBlock(node)) { - emitToken(14, node.pos); + emitToken(14 /* OpenBraceToken */, node.pos); write(" "); - emitToken(15, node.statements.end); + emitToken(15 /* CloseBraceToken */, node.statements.end); return; } - emitToken(14, node.pos); + emitToken(14 /* OpenBraceToken */, node.pos); increaseIndent(); scopeEmitStart(node.parent); - if (node.kind === 206) { - ts.Debug.assert(node.parent.kind === 205); + if (node.kind === 206 /* ModuleBlock */) { + ts.Debug.assert(node.parent.kind === 205 /* ModuleDeclaration */); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); - if (node.kind === 206) { + if (node.kind === 206 /* ModuleBlock */) { emitTempDeclarations(true); } decreaseIndent(); writeLine(); - emitToken(15, node.statements.end); + emitToken(15 /* CloseBraceToken */, node.statements.end); scopeEmitEnd(); } function emitEmbeddedStatement(node) { - if (node.kind === 179) { + if (node.kind === 179 /* Block */) { write(" "); emit(node); } @@ -21748,20 +25779,20 @@ var ts; } } function emitExpressionStatement(node) { - emitParenthesizedIf(node.expression, node.expression.kind === 163); + emitParenthesizedIf(node.expression, node.expression.kind === 163 /* ArrowFunction */); write(";"); } function emitIfStatement(node) { - var endPos = emitToken(84, node.pos); + var endPos = emitToken(84 /* IfKeyword */, node.pos); write(" "); - endPos = emitToken(16, endPos); + endPos = emitToken(16 /* OpenParenToken */, endPos); emit(node.expression); - emitToken(17, node.expression.end); + emitToken(17 /* CloseParenToken */, node.expression.end); emitEmbeddedStatement(node.thenStatement); if (node.elseStatement) { writeLine(); - emitToken(76, node.thenStatement.end); - if (node.elseStatement.kind === 183) { + emitToken(76 /* ElseKeyword */, node.thenStatement.end); + if (node.elseStatement.kind === 183 /* IfStatement */) { write(" "); emit(node.elseStatement); } @@ -21773,7 +25804,7 @@ var ts; function emitDoStatement(node) { write("do"); emitEmbeddedStatement(node.statement); - if (node.statement.kind === 179) { + if (node.statement.kind === 179 /* Block */) { write(" "); } else { @@ -21790,13 +25821,13 @@ var ts; emitEmbeddedStatement(node.statement); } function emitStartOfVariableDeclarationList(decl, startPos) { - var tokenKind = 98; - if (decl && languageVersion >= 2) { + var tokenKind = 98 /* VarKeyword */; + if (decl && languageVersion >= 2 /* ES6 */) { if (ts.isLet(decl)) { - tokenKind = 105; + tokenKind = 104 /* LetKeyword */; } else if (ts.isConst(decl)) { - tokenKind = 70; + tokenKind = 70 /* ConstKeyword */; } } if (startPos !== undefined) { @@ -21804,20 +25835,20 @@ var ts; } else { switch (tokenKind) { - case 98: + case 98 /* VarKeyword */: return write("var "); - case 105: + case 104 /* LetKeyword */: return write("let "); - case 70: + case 70 /* ConstKeyword */: return write("const "); } } } function emitForStatement(node) { - var endPos = emitToken(82, node.pos); + var endPos = emitToken(82 /* ForKeyword */, node.pos); write(" "); - endPos = emitToken(16, endPos); - if (node.initializer && node.initializer.kind === 199) { + endPos = emitToken(16 /* OpenParenToken */, endPos); + if (node.initializer && node.initializer.kind === 199 /* VariableDeclarationList */) { var variableDeclarationList = node.initializer; var declarations = variableDeclarationList.declarations; emitStartOfVariableDeclarationList(declarations[0], endPos); @@ -21835,13 +25866,13 @@ var ts; emitEmbeddedStatement(node.statement); } function emitForInOrForOfStatement(node) { - if (languageVersion < 2 && node.kind === 188) { + if (languageVersion < 2 /* ES6 */ && node.kind === 188 /* ForOfStatement */) { return emitDownLevelForOfStatement(node); } - var endPos = emitToken(82, node.pos); + var endPos = emitToken(82 /* ForKeyword */, node.pos); write(" "); - endPos = emitToken(16, endPos); - if (node.initializer.kind === 199) { + endPos = emitToken(16 /* OpenParenToken */, endPos); + if (node.initializer.kind === 199 /* VariableDeclarationList */) { var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length >= 1) { var decl = variableDeclarationList.declarations[0]; @@ -21853,14 +25884,14 @@ var ts; else { emit(node.initializer); } - if (node.kind === 187) { + if (node.kind === 187 /* ForInStatement */) { write(" in "); } else { write(" of "); } emit(node.expression); - emitToken(17, node.expression.end); + emitToken(17 /* CloseParenToken */, node.expression.end); emitEmbeddedStatement(node.statement); } function emitDownLevelForOfStatement(node) { @@ -21884,18 +25915,30 @@ var ts; // 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); + var endPos = emitToken(82 /* ForKeyword */, node.pos); write(" "); - endPos = emitToken(16, endPos); - var rhsIsIdentifier = node.expression.kind === 65; - var counter = createTempVariable(268435456); - var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(0); + endPos = emitToken(16 /* OpenParenToken */, endPos); + // Do not emit the LHS let declaration yet, because it might contain destructuring. + // Do not call recordTempDeclaration because we are declaring the temps + // right here. Recording means they will be declared later. + // In the case where the user wrote an identifier as the RHS, like this: + // + // for (let v of arr) { } + // + // we don't want to emit a temporary variable for the RHS, just use it directly. + var rhsIsIdentifier = node.expression.kind === 65 /* Identifier */; + var counter = createTempVariable(268435456 /* _i */); + var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(0 /* Auto */); + // This is the let keyword for the counter and rhsReference. The let keyword for + // the LHS will be emitted inside the body. emitStart(node.expression); write("var "); + // _i = 0 emitNodeWithoutSourceMap(counter); write(" = 0"); emitEnd(node.expression); if (!rhsIsIdentifier) { + // , _a = expr write(", "); emitStart(node.expression); emitNodeWithoutSourceMap(rhsReference); @@ -21904,6 +25947,7 @@ var ts; emitEnd(node.expression); } write("; "); + // _i < _a.length; emitStart(node.initializer); emitNodeWithoutSourceMap(counter); write(" < "); @@ -21911,40 +25955,54 @@ var ts; write(".length"); emitEnd(node.initializer); write("; "); + // _i++) emitStart(node.initializer); emitNodeWithoutSourceMap(counter); write("++"); emitEnd(node.initializer); - emitToken(17, node.expression.end); + emitToken(17 /* CloseParenToken */, node.expression.end); + // Body write(" {"); writeLine(); increaseIndent(); + // Initialize LHS + // let v = _a[_i]; var rhsIterationValue = createElementAccessExpression(rhsReference, counter); emitStart(node.initializer); - if (node.initializer.kind === 199) { + if (node.initializer.kind === 199 /* VariableDeclarationList */) { write("var "); var variableDeclarationList = node.initializer; if (variableDeclarationList.declarations.length > 0) { var declaration = variableDeclarationList.declarations[0]; if (ts.isBindingPattern(declaration.name)) { + // This works whether the declaration is a var, let, or const. + // It will use rhsIterationValue _a[_i] as the initializer. emitDestructuring(declaration, false, rhsIterationValue); } else { + // The following call does not include the initializer, so we have + // to emit it separately. emitNodeWithoutSourceMap(declaration); write(" = "); emitNodeWithoutSourceMap(rhsIterationValue); } } else { - emitNodeWithoutSourceMap(createTempVariable(0)); + // It's an empty declaration list. This can only happen in an error case, if the user wrote + // for (let of []) {} + emitNodeWithoutSourceMap(createTempVariable(0 /* Auto */)); write(" = "); emitNodeWithoutSourceMap(rhsIterationValue); } } else { - var assignmentExpression = createBinaryExpression(node.initializer, 53, rhsIterationValue, false); - if (node.initializer.kind === 153 || node.initializer.kind === 154) { - emitDestructuring(assignmentExpression, true, undefined, node); + // Initializer is an expression. Emit the expression in the body, so that it's + // evaluated on every iteration. + var assignmentExpression = createBinaryExpression(node.initializer, 53 /* EqualsToken */, rhsIterationValue, false); + if (node.initializer.kind === 153 /* ArrayLiteralExpression */ || node.initializer.kind === 154 /* ObjectLiteralExpression */) { + // This is a destructuring pattern, so call emitDestructuring instead of emit. Calling emit will not work, because it will cause + // the BinaryExpression to be passed in instead of the expression statement, which will cause emitDestructuring to crash. + emitDestructuring(assignmentExpression, true, undefined); } else { emitNodeWithoutSourceMap(assignmentExpression); @@ -21952,7 +26010,7 @@ var ts; } emitEnd(node.initializer); write(";"); - if (node.statement.kind === 179) { + if (node.statement.kind === 179 /* Block */) { emitLines(node.statement.statements); } else { @@ -21964,12 +26022,12 @@ var ts; write("}"); } function emitBreakOrContinueStatement(node) { - emitToken(node.kind === 190 ? 66 : 71, node.pos); + emitToken(node.kind === 190 /* BreakStatement */ ? 66 /* BreakKeyword */ : 71 /* ContinueKeyword */, node.pos); emitOptional(" ", node.label); write(";"); } function emitReturnStatement(node) { - emitToken(90, node.pos); + emitToken(90 /* ReturnKeyword */, node.pos); emitOptional(" ", node.expression); write(";"); } @@ -21980,21 +26038,21 @@ var ts; emitEmbeddedStatement(node.statement); } function emitSwitchStatement(node) { - var endPos = emitToken(92, node.pos); + var endPos = emitToken(92 /* SwitchKeyword */, node.pos); write(" "); - emitToken(16, endPos); + emitToken(16 /* OpenParenToken */, endPos); emit(node.expression); - endPos = emitToken(17, node.expression.end); + endPos = emitToken(17 /* CloseParenToken */, node.expression.end); write(" "); emitCaseBlock(node.caseBlock, endPos); } function emitCaseBlock(node, startPos) { - emitToken(14, startPos); + emitToken(14 /* OpenBraceToken */, startPos); increaseIndent(); emitLines(node.clauses); decreaseIndent(); writeLine(); - emitToken(15, node.clauses.end); + emitToken(15 /* CloseBraceToken */, node.clauses.end); } function nodeStartPositionsAreOnSameLine(node1, node2) { return ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node1.pos)) === @@ -22009,7 +26067,7 @@ var ts; ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 220) { + if (node.kind === 220 /* CaseClause */) { write("case "); emit(node.expression); write(":"); @@ -22044,16 +26102,16 @@ var ts; } function emitCatchClause(node) { writeLine(); - var endPos = emitToken(68, node.pos); + var endPos = emitToken(68 /* CatchKeyword */, node.pos); write(" "); - emitToken(16, endPos); + emitToken(16 /* OpenParenToken */, endPos); emit(node.variableDeclaration); - emitToken(17, node.variableDeclaration ? node.variableDeclaration.end : endPos); + emitToken(17 /* CloseParenToken */, node.variableDeclaration ? node.variableDeclaration.end : endPos); write(" "); emitBlock(node.block); } function emitDebuggerStatement(node) { - emitToken(72, node.pos); + emitToken(72 /* DebuggerKeyword */, node.pos); write(";"); } function emitLabelledStatement(node) { @@ -22064,7 +26122,7 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 205); + } while (node && node.kind !== 205 /* ModuleDeclaration */); return node; } function emitContainingModuleName(node) { @@ -22073,13 +26131,13 @@ var ts; } function emitModuleMemberName(node) { emitStart(node.name); - if (ts.getCombinedNodeFlags(node) & 1) { + if (ts.getCombinedNodeFlags(node) & 1 /* Export */) { var container = getContainingModule(node); if (container) { write(getGeneratedNameForNode(container)); write("."); } - else if (languageVersion < 2) { + else if (languageVersion < 2 /* ES6 */) { write("exports."); } } @@ -22087,18 +26145,23 @@ var ts; emitEnd(node.name); } function createVoidZero() { - var zero = ts.createSynthesizedNode(7); + var zero = ts.createSynthesizedNode(7 /* NumericLiteral */); zero.text = "0"; - var result = ts.createSynthesizedNode(166); + var result = ts.createSynthesizedNode(166 /* VoidExpression */); result.expression = zero; return result; } function emitExportMemberAssignment(node) { - if (node.flags & 1) { + if (node.flags & 1 /* Export */) { writeLine(); emitStart(node); - if (node.flags & 256) { - write("exports.default"); + if (node.flags & 256 /* Default */) { + if (languageVersion === 0 /* ES3 */) { + write("exports[\"default\"]"); + } + else { + write("exports.default"); + } } else { emitModuleMemberName(node); @@ -22125,10 +26188,12 @@ var ts; } } } - function emitDestructuring(root, isAssignmentExpressionStatement, value, lowestNonSynthesizedAncestor) { + function emitDestructuring(root, isAssignmentExpressionStatement, value) { var emitCount = 0; - var isDeclaration = (root.kind === 198 && !(ts.getCombinedNodeFlags(root) & 1)) || root.kind === 129; - if (root.kind === 169) { + // An exported declaration is actually emitted as an assignment (to a property on the module object), so + // temporary variables in an exported declaration need to have real declarations elsewhere + var isDeclaration = (root.kind === 198 /* VariableDeclaration */ && !(ts.getCombinedNodeFlags(root) & 1 /* Export */)) || root.kind === 129 /* Parameter */; + if (root.kind === 169 /* BinaryExpression */) { emitAssignmentExpression(root); } else { @@ -22140,7 +26205,7 @@ var ts; write(", "); } renameNonTopLevelLetAndConst(name); - if (name.parent && (name.parent.kind === 198 || name.parent.kind === 152)) { + if (name.parent && (name.parent.kind === 198 /* VariableDeclaration */ || name.parent.kind === 152 /* BindingElement */)) { emitModuleMemberName(name.parent); } else { @@ -22150,8 +26215,8 @@ var ts; emit(value); } function ensureIdentifier(expr) { - if (expr.kind !== 65) { - var identifier = createTempVariable(0); + if (expr.kind !== 65 /* Identifier */) { + var identifier = createTempVariable(0 /* Auto */); if (!isDeclaration) { recordTempDeclaration(identifier); } @@ -22161,90 +26226,89 @@ var ts; return expr; } function createDefaultValueCheck(value, defaultValue) { + // The value expression will be evaluated twice, so for anything but a simple identifier + // we need to generate a temporary variable value = ensureIdentifier(value); - var equals = ts.createSynthesizedNode(169); + // Return the expression 'value === void 0 ? defaultValue : value' + var equals = ts.createSynthesizedNode(169 /* BinaryExpression */); equals.left = value; - equals.operatorToken = ts.createSynthesizedNode(30); + equals.operatorToken = ts.createSynthesizedNode(30 /* EqualsEqualsEqualsToken */); equals.right = createVoidZero(); return createConditionalExpression(equals, defaultValue, value); } function createConditionalExpression(condition, whenTrue, whenFalse) { - var cond = ts.createSynthesizedNode(170); + var cond = ts.createSynthesizedNode(170 /* ConditionalExpression */); cond.condition = condition; - cond.questionToken = ts.createSynthesizedNode(50); + cond.questionToken = ts.createSynthesizedNode(50 /* QuestionToken */); cond.whenTrue = whenTrue; - cond.colonToken = ts.createSynthesizedNode(51); + cond.colonToken = ts.createSynthesizedNode(51 /* ColonToken */); cond.whenFalse = whenFalse; return cond; } function createNumericLiteral(value) { - var node = ts.createSynthesizedNode(7); + var node = ts.createSynthesizedNode(7 /* NumericLiteral */); node.text = "" + value; return node; } - function parenthesizeForAccess(expr) { - if (expr.kind === 65 || expr.kind === 155 || expr.kind === 156) { - return expr; + function createPropertyAccessForDestructuringProperty(object, propName) { + if (propName.kind !== 65 /* Identifier */) { + return createElementAccessExpression(object, propName); } - var node = ts.createSynthesizedNode(161); - node.expression = expr; - return node; + return createPropertyAccessExpression(object, propName); } - function createPropertyAccess(object, propName) { - if (propName.kind !== 65) { - return createElementAccess(object, propName); - } - return createPropertyAccessExpression(parenthesizeForAccess(object), propName); - } - function createElementAccess(object, index) { - var node = ts.createSynthesizedNode(156); - node.expression = parenthesizeForAccess(object); - node.argumentExpression = index; - return node; + function createSliceCall(value, sliceIndex) { + var call = ts.createSynthesizedNode(157 /* CallExpression */); + var sliceIdentifier = ts.createSynthesizedNode(65 /* Identifier */); + sliceIdentifier.text = "slice"; + call.expression = createPropertyAccessExpression(value, sliceIdentifier); + call.arguments = ts.createSynthesizedNodeArray(); + call.arguments[0] = createNumericLiteral(sliceIndex); + return call; } function emitObjectLiteralAssignment(target, value) { var properties = target.properties; if (properties.length !== 1) { + // For anything but a single element destructuring we need to generate a temporary + // to ensure value is evaluated exactly once. value = ensureIdentifier(value); } for (var _a = 0; _a < properties.length; _a++) { var p = properties[_a]; - if (p.kind === 224 || p.kind === 225) { + if (p.kind === 224 /* PropertyAssignment */ || p.kind === 225 /* ShorthandPropertyAssignment */) { + // TODO(andersh): Computed property support var propName = (p.name); - emitDestructuringAssignment(p.initializer || propName, createPropertyAccess(value, propName)); + emitDestructuringAssignment(p.initializer || propName, createPropertyAccessForDestructuringProperty(value, propName)); } } } function emitArrayLiteralAssignment(target, value) { var elements = target.elements; if (elements.length !== 1) { + // For anything but a single element destructuring we need to generate a temporary + // to ensure value is evaluated exactly once. value = ensureIdentifier(value); } for (var i = 0; i < elements.length; i++) { var e = elements[i]; - if (e.kind !== 175) { - if (e.kind !== 173) { - emitDestructuringAssignment(e, createElementAccess(value, createNumericLiteral(i))); + if (e.kind !== 175 /* OmittedExpression */) { + if (e.kind !== 173 /* SpreadElementExpression */) { + emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i))); } - else { - if (i === elements.length - 1) { - value = ensureIdentifier(value); - emitAssignment(e.expression, value); - write(".slice(" + i + ")"); - } + else if (i === elements.length - 1) { + emitDestructuringAssignment(e.expression, createSliceCall(value, i)); } } } } function emitDestructuringAssignment(target, value) { - if (target.kind === 169 && target.operatorToken.kind === 53) { + if (target.kind === 169 /* BinaryExpression */ && target.operatorToken.kind === 53 /* EqualsToken */) { value = createDefaultValueCheck(value, target.right); target = target.left; } - if (target.kind === 154) { + if (target.kind === 154 /* ObjectLiteralExpression */) { emitObjectLiteralAssignment(target, value); } - else if (target.kind === 153) { + else if (target.kind === 153 /* ArrayLiteralExpression */) { emitArrayLiteralAssignment(target, value); } else { @@ -22258,47 +26322,49 @@ var ts; emitDestructuringAssignment(target, value); } else { - if (root.parent.kind !== 161) { + if (root.parent.kind !== 161 /* ParenthesizedExpression */) { write("("); } value = ensureIdentifier(value); emitDestructuringAssignment(target, value); write(", "); emit(value); - if (root.parent.kind !== 161) { + if (root.parent.kind !== 161 /* ParenthesizedExpression */) { write(")"); } } } function emitBindingElement(target, value) { if (target.initializer) { + // Combine value and initializer value = value ? createDefaultValueCheck(value, target.initializer) : target.initializer; } else if (!value) { + // Use 'void 0' in absence of value and initializer value = createVoidZero(); } if (ts.isBindingPattern(target.name)) { var pattern = target.name; var elements = pattern.elements; if (elements.length !== 1) { + // For anything but a single element destructuring we need to generate a temporary + // to ensure value is evaluated exactly once. value = ensureIdentifier(value); } for (var i = 0; i < elements.length; i++) { var element = elements[i]; - if (pattern.kind === 150) { + if (pattern.kind === 150 /* ObjectBindingPattern */) { + // Rewrite element to a declaration with an initializer that fetches property var propName = element.propertyName || element.name; - emitBindingElement(element, createPropertyAccess(value, propName)); + emitBindingElement(element, createPropertyAccessForDestructuringProperty(value, propName)); } - else if (element.kind !== 175) { + else if (element.kind !== 175 /* OmittedExpression */) { if (!element.dotDotDotToken) { - emitBindingElement(element, createElementAccess(value, createNumericLiteral(i))); + // Rewrite element to a declaration that accesses array element at index i + emitBindingElement(element, createElementAccessExpression(value, createNumericLiteral(i))); } - else { - if (i === elements.length - 1) { - value = ensureIdentifier(value); - emitAssignment(element.name, value); - write(".slice(" + i + ")"); - } + else if (i === elements.length - 1) { + emitBindingElement(element, createSliceCall(value, i)); } } } @@ -22310,7 +26376,7 @@ var ts; } function emitVariableDeclaration(node) { if (ts.isBindingPattern(node.name)) { - if (languageVersion < 2) { + if (languageVersion < 2 /* ES6 */) { emitDestructuring(node, false); } else { @@ -22322,12 +26388,19 @@ var ts; renameNonTopLevelLetAndConst(node.name); emitModuleMemberName(node); var initializer = node.initializer; - if (!initializer && languageVersion < 2) { - var isUninitializedLet = (resolver.getNodeCheckFlags(node) & 256) && - (getCombinedFlagsForIdentifier(node.name) & 4096); + if (!initializer && languageVersion < 2 /* ES6 */) { + // downlevel emit for non-initialized let bindings defined in loops + // for (...) { let x; } + // should be + // for (...) { var = void 0; } + // this is necessary to preserve ES6 semantic in scenarios like + // for (...) { let x; console.log(x); x = 1 } // assignment on one iteration should not affect other iterations + var isUninitializedLet = (resolver.getNodeCheckFlags(node) & 256 /* BlockScopedBindingInLoop */) && + (getCombinedFlagsForIdentifier(node.name) & 4096 /* Let */); + // NOTE: default initialization should not be added to let bindings in for-in\for-of statements if (isUninitializedLet && - node.parent.parent.kind !== 187 && - node.parent.parent.kind !== 188) { + node.parent.parent.kind !== 187 /* ForInStatement */ && + node.parent.parent.kind !== 188 /* ForOfStatement */) { initializer = createVoidZero(); } } @@ -22335,11 +26408,11 @@ var ts; } } function emitExportVariableAssignments(node) { - if (node.kind === 175) { + if (node.kind === 175 /* OmittedExpression */) { return; } var name = node.name; - if (name.kind === 65) { + if (name.kind === 65 /* Identifier */) { emitExportMemberAssignments(name); } else if (ts.isBindingPattern(name)) { @@ -22347,33 +26420,41 @@ var ts; } } function getCombinedFlagsForIdentifier(node) { - if (!node.parent || (node.parent.kind !== 198 && node.parent.kind !== 152)) { + if (!node.parent || (node.parent.kind !== 198 /* VariableDeclaration */ && node.parent.kind !== 152 /* BindingElement */)) { return 0; } return ts.getCombinedNodeFlags(node.parent); } function renameNonTopLevelLetAndConst(node) { - if (languageVersion >= 2 || + // do not rename if + // - language version is ES6+ + // - node is synthesized + // - node is not identifier (can happen when tree is malformed) + // - node is definitely not name of variable declaration. + // it still can be part of parameter declaration, this check will be done next + if (languageVersion >= 2 /* ES6 */ || ts.nodeIsSynthesized(node) || - node.kind !== 65 || - (node.parent.kind !== 198 && node.parent.kind !== 152)) { + node.kind !== 65 /* Identifier */ || + (node.parent.kind !== 198 /* VariableDeclaration */ && node.parent.kind !== 152 /* BindingElement */)) { return; } var combinedFlags = getCombinedFlagsForIdentifier(node); - if (((combinedFlags & 12288) === 0) || combinedFlags & 1) { + if (((combinedFlags & 12288 /* BlockScoped */) === 0) || combinedFlags & 1 /* Export */) { + // do not rename exported or non-block scoped variables 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); + // here it is known that node is a block scoped variable + var list = ts.getAncestor(node, 199 /* VariableDeclarationList */); + if (list.parent.kind === 180 /* VariableStatement */) { + var isSourceFileLevelBinding = list.parent.parent.kind === 227 /* SourceFile */; + var isModuleLevelBinding = list.parent.parent.kind === 206 /* ModuleBlock */; + var isFunctionLevelBinding = list.parent.parent.kind === 179 /* Block */ && ts.isFunctionLike(list.parent.parent.parent); if (isSourceFileLevelBinding || isModuleLevelBinding || isFunctionLevelBinding) { return; } } var blockScopeContainer = ts.getEnclosingBlockScopeContainer(node); - var parent = blockScopeContainer.kind === 227 + var parent = blockScopeContainer.kind === 227 /* SourceFile */ ? blockScopeContainer : blockScopeContainer.parent; if (resolver.resolvesToSomeValue(parent, node.text)) { @@ -22386,33 +26467,34 @@ var ts; } } function isES6ExportedDeclaration(node) { - return !!(node.flags & 1) && - languageVersion >= 2 && - node.parent.kind === 227; + return !!(node.flags & 1 /* Export */) && + languageVersion >= 2 /* ES6 */ && + node.parent.kind === 227 /* SourceFile */; } function emitVariableStatement(node) { - if (!(node.flags & 1)) { + if (!(node.flags & 1 /* Export */)) { emitStartOfVariableDeclarationList(node.declarationList); } else if (isES6ExportedDeclaration(node)) { + // Exported ES6 module member write("export "); emitStartOfVariableDeclarationList(node.declarationList); } emitCommaList(node.declarationList.declarations); write(";"); - if (languageVersion < 2 && node.parent === currentSourceFile) { + if (languageVersion < 2 /* ES6 */ && node.parent === currentSourceFile) { ts.forEach(node.declarationList.declarations, emitExportVariableAssignments); } } function emitParameter(node) { - if (languageVersion < 2) { + if (languageVersion < 2 /* ES6 */) { if (ts.isBindingPattern(node.name)) { - var name_16 = createTempVariable(0); + var name_19 = createTempVariable(0 /* Auto */); if (!tempParameters) { tempParameters = []; } - tempParameters.push(name_16); - emit(name_16); + tempParameters.push(name_19); + emit(name_19); } else { emit(node.name); @@ -22427,9 +26509,14 @@ var ts; } } function emitDefaultValueAssignments(node) { - if (languageVersion < 2) { + if (languageVersion < 2 /* ES6 */) { var tempIndex = 0; ts.forEach(node.parameters, function (p) { + // A rest parameter cannot have a binding pattern or an initializer, + // so let's just ignore it. + if (p.dotDotDotToken) { + return; + } if (ts.isBindingPattern(p.name)) { writeLine(); write("var "); @@ -22456,10 +26543,14 @@ var ts; } } function emitRestParameter(node) { - if (languageVersion < 2 && ts.hasRestParameters(node)) { + if (languageVersion < 2 /* ES6 */ && ts.hasRestParameters(node)) { var restIndex = node.parameters.length - 1; var restParam = node.parameters[restIndex]; - var tempName = createTempVariable(268435456).text; + // A rest parameter cannot have a binding pattern, so let's just ignore it if it does. + if (ts.isBindingPattern(restParam.name)) { + return; + } + var tempName = createTempVariable(268435456 /* _i */).text; writeLine(); emitLeadingComments(restParam); emitStart(restParam); @@ -22494,12 +26585,12 @@ var ts; } } function emitAccessor(node) { - write(node.kind === 136 ? "get " : "set "); + write(node.kind === 136 /* GetAccessor */ ? "get " : "set "); emit(node.name, false); emitSignatureAndBody(node); } function shouldEmitAsArrowFunction(node) { - return node.kind === 163 && languageVersion >= 2; + return node.kind === 163 /* ArrowFunction */ && languageVersion >= 2 /* ES6 */; } function emitDeclarationName(node) { if (node.name) { @@ -22510,42 +26601,51 @@ var ts; } } function shouldEmitFunctionName(node) { - if (node.kind === 162) { + if (node.kind === 162 /* FunctionExpression */) { + // Emit name if one is present return !!node.name; } - if (node.kind === 200) { - return !!node.name || languageVersion < 2; + if (node.kind === 200 /* FunctionDeclaration */) { + // Emit name if one is present, or emit generated name in down-level case (for export default case) + return !!node.name || languageVersion < 2 /* ES6 */; } } function emitFunctionDeclaration(node) { if (ts.nodeIsMissing(node.body)) { return emitOnlyPinnedOrTripleSlashComments(node); } - if (node.kind !== 134 && node.kind !== 133) { + if (node.kind !== 134 /* MethodDeclaration */ && node.kind !== 133 /* MethodSignature */) { + // Methods will emit the comments as part of emitting method declaration emitLeadingComments(node); } + // For targeting below es6, emit functions-like declaration including arrow function using function keyword. + // When targeting ES6, emit arrow function natively in ES6 by omitting function keyword and using fat arrow instead if (!shouldEmitAsArrowFunction(node)) { if (isES6ExportedDeclaration(node)) { write("export "); - if (node.flags & 256) { + if (node.flags & 256 /* Default */) { write("default "); } } - write("function "); + write("function"); + if (languageVersion >= 2 /* ES6 */ && node.asteriskToken) { + write("*"); + } + write(" "); } if (shouldEmitFunctionName(node)) { emitDeclarationName(node); } emitSignatureAndBody(node); - if (languageVersion < 2 && node.kind === 200 && node.parent === currentSourceFile && node.name) { + if (languageVersion < 2 /* ES6 */ && node.kind === 200 /* FunctionDeclaration */ && node.parent === currentSourceFile && node.name) { emitExportMemberAssignments(node.name); } - if (node.kind !== 134 && node.kind !== 133) { + if (node.kind !== 134 /* MethodDeclaration */ && node.kind !== 133 /* MethodSignature */) { emitTrailingComments(node); } } function emitCaptureThisForNodeIfNecessary(node) { - if (resolver.getNodeCheckFlags(node) & 4) { + if (resolver.getNodeCheckFlags(node) & 4 /* CaptureThis */) { writeLine(); emitStart(node); write("var _this = this;"); @@ -22557,13 +26657,14 @@ var ts; write("("); if (node) { var parameters = node.parameters; - var omitCount = languageVersion < 2 && ts.hasRestParameters(node) ? 1 : 0; + var omitCount = languageVersion < 2 /* ES6 */ && ts.hasRestParameters(node) ? 1 : 0; emitList(parameters, 0, parameters.length - omitCount, false, false); } write(")"); decreaseIndent(); } function emitSignatureParametersForArrow(node) { + // Check whether the parameter list needs parentheses and preserve no-parenthesis if (node.parameters.length === 1 && node.pos === node.parameters[0].pos) { emit(node.parameters[0]); return; @@ -22577,6 +26678,7 @@ var ts; tempFlags = 0; tempVariables = undefined; tempParameters = undefined; + // When targeting ES6, emit arrow function natively in ES6 if (shouldEmitAsArrowFunction(node)) { emitSignatureParametersForArrow(node); write(" =>"); @@ -22585,9 +26687,11 @@ var ts; emitSignatureParameters(node); } if (!node.body) { + // There can be no body when there are parse errors. Just emit an empty block + // in that case. write(" { }"); } - else if (node.body.kind === 179) { + else if (node.body.kind === 179 /* Block */) { emitBlockFunctionBody(node, node.body); } else { @@ -22600,22 +26704,28 @@ var ts; tempVariables = saveTempVariables; tempParameters = saveTempParameters; } + // Returns true if any preamble code was emitted. function emitFunctionBodyPreamble(node) { emitCaptureThisForNodeIfNecessary(node); emitDefaultValueAssignments(node); emitRestParameter(node); } function emitExpressionFunctionBody(node, body) { - if (languageVersion < 2) { + if (languageVersion < 2 /* ES6 */) { emitDownLevelExpressionFunctionBody(node, body); return; } + // For es6 and higher we can emit the expression as is. However, in the case + // where the expression might end up looking like a block when emitted, we'll + // also wrap it in parentheses first. For example if you have: a => {} + // then we need to generate: a => ({}) write(" "); + // Unwrap all type assertions. var current = body; - while (current.kind === 160) { + while (current.kind === 160 /* TypeAssertionExpression */) { current = current.expression; } - emitParenthesizedIf(body, current.kind === 154); + emitParenthesizedIf(body, current.kind === 154 /* ObjectLiteralExpression */); } function emitDownLevelExpressionFunctionBody(node, body) { write(" {"); @@ -22626,6 +26736,8 @@ var ts; emitFunctionBodyPreamble(node); var preambleEmitted = writer.getTextPos() !== outPos; decreaseIndent(); + // If we didn't have to emit any preamble code, then attempt to keep the arrow + // function on one line. if (!preambleEmitted && nodeStartPositionsAreOnSameLine(node, body)) { write(" "); emitStart(body); @@ -22659,6 +26771,8 @@ var ts; var initialTextPos = writer.getTextPos(); increaseIndent(); emitDetachedComments(body.statements); + // Emit all the directive prologues (like "use strict"). These have to come before + // any other preamble code we write (like parameter initializers). var startIndex = emitDirectivePrologues(body.statements, true); emitFunctionBodyPreamble(node); decreaseIndent(); @@ -22681,17 +26795,17 @@ var ts; emitLeadingCommentsOfPosition(body.statements.end); decreaseIndent(); } - emitToken(15, body.statements.end); + emitToken(15 /* CloseBraceToken */, body.statements.end); scopeEmitEnd(); } function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 182) { + if (statement && statement.kind === 182 /* ExpressionStatement */) { var expr = statement.expression; - if (expr && expr.kind === 157) { + if (expr && expr.kind === 157 /* CallExpression */) { var func = expr.expression; - if (func && func.kind === 91) { + if (func && func.kind === 91 /* SuperKeyword */) { return statement; } } @@ -22700,7 +26814,7 @@ var ts; } function emitParameterPropertyAssignments(node) { ts.forEach(node.parameters, function (param) { - if (param.flags & 112) { + if (param.flags & 112 /* AccessibilityModifier */) { writeLine(); emitStart(param); emitStart(param.name); @@ -22715,12 +26829,13 @@ var ts; }); } function emitMemberAccessForPropertyName(memberName) { - if (memberName.kind === 8 || memberName.kind === 7) { + // TODO: (jfreeman,drosen): comment on why this is emitNodeWithoutSourceMap instead of emit here. + if (memberName.kind === 8 /* StringLiteral */ || memberName.kind === 7 /* NumericLiteral */) { write("["); emitNodeWithoutSourceMap(memberName); write("]"); } - else if (memberName.kind === 127) { + else if (memberName.kind === 127 /* ComputedPropertyName */) { emitComputedPropertyName(memberName); } else { @@ -22728,36 +26843,55 @@ var ts; emitNodeWithoutSourceMap(memberName); } } - function emitMemberAssignments(node, staticFlag) { - ts.forEach(node.members, function (member) { - if (member.kind === 132 && (member.flags & 128) === 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, static) { + var properties = []; + for (var _a = 0, _b = node.members; _a < _b.length; _a++) { + var member = _b[_a]; + if (member.kind === 132 /* PropertyDeclaration */ && static === ((member.flags & 128 /* Static */) !== 0) && member.initializer) { + properties.push(member); } - }); + } + return properties; + } + function emitPropertyDeclarations(node, properties) { + for (var _a = 0; _a < properties.length; _a++) { + var property = properties[_a]; + emitPropertyDeclaration(node, property); + } + } + function emitPropertyDeclaration(node, property, receiver, isExpression) { + writeLine(); + emitLeadingComments(property); + emitStart(property); + emitStart(property.name); + if (receiver) { + emit(receiver); + } + else { + if (property.flags & 128 /* 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) { ts.forEach(node.members, function (member) { - if (member.kind === 178) { + if (member.kind === 178 /* SemicolonClassElement */) { writeLine(); write(";"); } - else if (member.kind === 134 || node.kind === 133) { + else if (member.kind === 134 /* MethodDeclaration */ || node.kind === 133 /* MethodSignature */) { if (!member.body) { return emitOnlyPinnedOrTripleSlashComments(member); } @@ -22776,7 +26910,7 @@ var ts; write(";"); emitTrailingComments(member); } - else if (member.kind === 136 || member.kind === 137) { + else if (member.kind === 136 /* GetAccessor */ || member.kind === 137 /* SetAccessor */) { var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { writeLine(); @@ -22826,30 +26960,33 @@ var ts; function emitMemberFunctionsForES6AndHigher(node) { for (var _a = 0, _b = node.members; _a < _b.length; _a++) { var member = _b[_a]; - if ((member.kind === 134 || node.kind === 133) && !member.body) { + if ((member.kind === 134 /* MethodDeclaration */ || node.kind === 133 /* MethodSignature */) && !member.body) { emitOnlyPinnedOrTripleSlashComments(member); } - else if (member.kind === 134 || - member.kind === 136 || - member.kind === 137) { + else if (member.kind === 134 /* MethodDeclaration */ || + member.kind === 136 /* GetAccessor */ || + member.kind === 137 /* SetAccessor */) { writeLine(); emitLeadingComments(member); emitStart(member); - if (member.flags & 128) { + if (member.flags & 128 /* Static */) { write("static "); } - if (member.kind === 136) { + if (member.kind === 136 /* GetAccessor */) { write("get "); } - else if (member.kind === 137) { + else if (member.kind === 137 /* SetAccessor */) { write("set "); } + if (member.asteriskToken) { + write("*"); + } emit(member.name); emitSignatureAndBody(member); emitEnd(member); emitTrailingComments(member); } - else if (member.kind === 178) { + else if (member.kind === 178 /* SemicolonClassElement */) { writeLine(); write(";"); } @@ -22862,24 +26999,37 @@ var ts; tempFlags = 0; tempVariables = undefined; tempParameters = undefined; + emitConstructorWorker(node, baseTypeElement); + tempFlags = saveTempFlags; + tempVariables = saveTempVariables; + tempParameters = saveTempParameters; + } + function emitConstructorWorker(node, baseTypeElement) { + // 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 var hasInstancePropertyWithInitializer = false; + // Emit the constructor overload pinned comments ts.forEach(node.members, function (member) { - if (member.kind === 135 && !member.body) { + if (member.kind === 135 /* Constructor */ && !member.body) { emitOnlyPinnedOrTripleSlashComments(member); } - if (member.kind === 132 && member.initializer && (member.flags & 128) === 0) { + // Check if there is any non-static property assignment + if (member.kind === 132 /* PropertyDeclaration */ && member.initializer && (member.flags & 128 /* Static */) === 0) { hasInstancePropertyWithInitializer = true; } }); var ctor = ts.getFirstConstructorWithBody(node); - if (languageVersion >= 2 && !ctor && !hasInstancePropertyWithInitializer) { + // For target ES6 and above, if there is no user-defined constructor and there is no property assignment + // do not emit constructor in class declaration. + if (languageVersion >= 2 /* ES6 */ && !ctor && !hasInstancePropertyWithInitializer) { return; } if (ctor) { emitLeadingComments(ctor); } emitStart(ctor || node); - if (languageVersion < 2) { + if (languageVersion < 2 /* ES6 */) { write("function "); emitDeclarationName(node); emitSignatureParameters(ctor); @@ -22890,6 +27040,12 @@ var ts; emitSignatureParameters(ctor); } else { + // Based on EcmaScript6 section 14.5.14: Runtime Semantics: ClassDefinitionEvaluation. + // If constructor is empty, then, + // If ClassHeritageopt is present, then + // 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 (baseTypeElement) { write("(...args)"); } @@ -22921,7 +27077,7 @@ var ts; if (baseTypeElement) { writeLine(); emitStart(baseTypeElement); - if (languageVersion < 2) { + if (languageVersion < 2 /* ES6 */) { write("_super.apply(this, arguments);"); } else { @@ -22930,7 +27086,7 @@ var ts; emitEnd(baseTypeElement); } } - emitMemberAssignments(node, 0); + emitPropertyDeclarations(node, getInitializedProperties(node, false)); if (ctor) { var statements = ctor.body.statements; if (superCall) { @@ -22944,15 +27100,12 @@ var ts; emitLeadingCommentsOfPosition(ctor.body.statements.end); } decreaseIndent(); - emitToken(15, ctor ? ctor.body.statements.end : node.members.end); + emitToken(15 /* CloseBraceToken */, 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); @@ -22961,7 +27114,7 @@ var ts; return emitClassLikeDeclaration(node); } function emitClassLikeDeclaration(node) { - if (languageVersion < 2) { + if (languageVersion < 2 /* ES6 */) { emitClassLikeDeclarationBelowES6(node); } else { @@ -22970,9 +27123,61 @@ var ts; } function emitClassLikeDeclarationForES6AndHigher(node) { var thisNodeIsDecorated = ts.nodeIsDecorated(node); - if (node.kind === 201) { + if (node.kind === 201 /* ClassDeclaration */) { if (thisNodeIsDecorated) { - if (isES6ExportedDeclaration(node) && !(node.flags & 256)) { + // 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 & 256 /* Default */)) { write("export "); } write("let "); @@ -22981,13 +27186,35 @@ var ts; } else if (isES6ExportedDeclaration(node)) { write("export "); - if (node.flags & 256) { + if (node.flags & 256 /* 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. + var staticProperties = getInitializedProperties(node, true); + var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 174 /* ClassExpression */; + var tempVariable; + if (isClassExpressionWithStaticProperties) { + tempVariable = createAndRecordTempVariable(0 /* Auto */); + write("("); + increaseIndent(); + emit(tempVariable); + write(" = "); + } write("class"); - if ((node.name || !(node.flags & 256)) && !thisNodeIsDecorated) { + // check if this is an "export default class" as it may not have a name. Do not emit the name if the class is decorated. + if ((node.name || !(node.flags & 256 /* Default */)) && !thisNodeIsDecorated) { write(" "); emitDeclarationName(node); } @@ -23004,8 +27231,15 @@ var ts; emitMemberFunctionsForES6AndHigher(node); decreaseIndent(); writeLine(); - emitToken(15, node.members.end); + emitToken(15 /* CloseBraceToken */, node.members.end); scopeEmitEnd(); + // For a decorated class, we need to assign its name (if it has one). This is because we emit + // the class as a class expression to avoid the double-binding of the identifier: + // + // let C = class { + // } + // Object.defineProperty(C, "name", { value: "C", configurable: true }); + // if (thisNodeIsDecorated) { write(";"); if (node.name) { @@ -23018,10 +27252,32 @@ var ts; writeLine(); } } - writeLine(); - emitMemberAssignments(node, 128); - emitDecoratorsOfClass(node); - if (!isES6ExportedDeclaration(node) && (node.flags & 1)) { + // Emit static property assignment. Because classDeclaration is lexically evaluated, + // it is safe to emit static property assignment after classDeclaration + // 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. + if (isClassExpressionWithStaticProperties) { + for (var _a = 0; _a < staticProperties.length; _a++) { + var property = staticProperties[_a]; + write(","); + writeLine(); + emitPropertyDeclaration(node, property, tempVariable, 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 + if (!isES6ExportedDeclaration(node) && (node.flags & 1 /* Export */)) { writeLine(); emitStart(node); emitModuleMemberName(node); @@ -23030,7 +27286,8 @@ var ts; emitEnd(node); write(";"); } - else if (isES6ExportedDeclaration(node) && (node.flags & 256) && thisNodeIsDecorated) { + else if (isES6ExportedDeclaration(node) && (node.flags & 256 /* Default */) && thisNodeIsDecorated) { + // if this is a top level default export of decorated class, write the export after the declaration. writeLine(); write("export default "); emitDeclarationName(node); @@ -23038,7 +27295,7 @@ var ts; } } function emitClassLikeDeclarationBelowES6(node) { - if (node.kind === 201) { + if (node.kind === 201 /* ClassDeclaration */) { write("var "); emitDeclarationName(node); write(" = "); @@ -23070,11 +27327,11 @@ var ts; writeLine(); emitConstructor(node, baseTypeNode); emitMemberFunctionsForES5AndLower(node); - emitMemberAssignments(node, 128); + emitPropertyDeclarations(node, getInitializedProperties(node, true)); writeLine(); emitDecoratorsOfClass(node); writeLine(); - emitToken(15, node.members.end, function () { + emitToken(15 /* CloseBraceToken */, node.members.end, function () { write("return "); emitDeclarationName(node); }); @@ -23086,7 +27343,7 @@ var ts; computedPropertyNamesToGeneratedNames = saveComputedPropertyNamesToGeneratedNames; decreaseIndent(); writeLine(); - emitToken(15, node.members.end); + emitToken(15 /* CloseBraceToken */, node.members.end); scopeEmitEnd(); emitStart(node); write(")("); @@ -23094,98 +27351,171 @@ var ts; emit(baseTypeNode.expression); } write(")"); - if (node.kind === 201) { + if (node.kind === 201 /* ClassDeclaration */) { write(";"); } emitEnd(node); - if (node.kind === 201) { + if (node.kind === 201 /* ClassDeclaration */) { emitExportMemberAssignment(node); } - if (languageVersion < 2 && node.parent === currentSourceFile && node.name) { + if (languageVersion < 2 /* ES6 */ && node.parent === currentSourceFile && node.name) { emitExportMemberAssignments(node.name); } } function emitClassMemberPrefix(node, member) { emitDeclarationName(node); - if (!(member.flags & 128)) { + if (!(member.flags & 128 /* Static */)) { write(".prototype"); } } function emitDecoratorsOfClass(node) { emitDecoratorsOfMembers(node, 0); - emitDecoratorsOfMembers(node, 128); + emitDecoratorsOfMembers(node, 128 /* Static */); emitDecoratorsOfConstructor(node); } function emitDecoratorsOfConstructor(node) { + var decorators = node.decorators; var constructor = ts.getFirstConstructorWithBody(node); - if (constructor) { - emitDecoratorsOfParameters(node, constructor); - } - if (!ts.nodeIsDecorated(node)) { + var hasDecoratedParameters = constructor && ts.forEach(constructor.parameters, ts.nodeIsDecorated); + // skip decoration of the constructor if neither it nor its parameters are decorated + if (!decorators && !hasDecoratedParameters) { return; } + // Emit the call to __decorate. Given the class: + // + // @dec + // class C { + // } + // + // The emit for the class is: + // + // C = __decorate([dec], C); + // writeLine(); emitStart(node); emitDeclarationName(node); - write(" = "); - emitDecorateStart(node.decorators); + write(" = __decorate(["); + increaseIndent(); + writeLine(); + var decoratorCount = decorators ? decorators.length : 0; + var argumentsWritten = emitList(decorators, 0, decoratorCount, true, false, false, true, function (decorator) { + emitStart(decorator); + emit(decorator.expression); + emitEnd(decorator); + }); + argumentsWritten += emitDecoratorsOfParameters(constructor, argumentsWritten > 0); + emitSerializedTypeMetadata(node, argumentsWritten >= 0); + decreaseIndent(); + writeLine(); + write("], "); emitDeclarationName(node); write(");"); emitEnd(node); writeLine(); } function emitDecoratorsOfMembers(node, staticFlag) { - ts.forEach(node.members, function (member) { - if ((member.flags & 128) !== staticFlag) { - return; + for (var _a = 0, _b = node.members; _a < _b.length; _a++) { + var member = _b[_a]; + // only emit members in the correct group + if ((member.flags & 128 /* Static */) !== staticFlag) { + continue; } - 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; + // skip members that cannot be decorated (such as the constructor) + if (!ts.nodeCanBeDecorated(member)) { + continue; } - if (!decorators) { - return; + // skip a member if it or any of its parameters are not decorated + if (!ts.nodeOrChildIsDecorated(member)) { + continue; } + // skip an accessor declaration if it is not the first accessor + var decorators = void 0; + var functionLikeMember = void 0; + if (ts.isAccessor(member)) { + var accessors = ts.getAllAccessorDeclarations(node.members, member); + if (member !== accessors.firstAccessor) { + continue; + } + // get the decorators from the first accessor with decorators + decorators = accessors.firstAccessor.decorators; + if (!decorators && accessors.secondAccessor) { + decorators = accessors.secondAccessor.decorators; + } + // we only decorate parameters of the set accessor + functionLikeMember = accessors.setAccessor; + } + else { + decorators = member.decorators; + // we only decorate the parameters here if this is a method + if (member.kind === 134 /* MethodDeclaration */) { + functionLikeMember = member; + } + } + // Emit the call to __decorate. Given the following: + // + // class C { + // @dec method(@dec2 x) {} + // @dec get accessor() {} + // @dec prop; + // } + // + // The emit for a method is: + // + // 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"))); + // + // The emit for a property is: + // + // __decorate([ + // dec + // ], C.prototype, "prop"); + // writeLine(); emitStart(member); - if (member.kind !== 132) { + if (member.kind !== 132 /* PropertyDeclaration */) { write("Object.defineProperty("); emitStart(member.name); emitClassMemberPrefix(node, member); write(", "); emitExpressionForPropertyName(member.name); emitEnd(member.name); - write(", "); + write(","); + increaseIndent(); + writeLine(); } - emitDecorateStart(decorators); + write("__decorate(["); + increaseIndent(); + writeLine(); + var decoratorCount = decorators ? decorators.length : 0; + var argumentsWritten = emitList(decorators, 0, decoratorCount, true, false, false, true, function (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(", "); emitExpressionForPropertyName(member.name); emitEnd(member.name); - if (member.kind !== 132) { + if (member.kind !== 132 /* PropertyDeclaration */) { write(", Object.getOwnPropertyDescriptor("); emitStart(member.name); emitClassMemberPrefix(node, member); @@ -23193,51 +27523,142 @@ var ts; emitExpressionForPropertyName(member.name); emitEnd(member.name); write("))"); + decreaseIndent(); } 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 emitDecoratorsOfParameters(node, leadingComma) { + var argumentsWritten = 0; + if (node) { + var parameterIndex = 0; + for (var _a = 0, _b = node.parameters; _a < _b.length; _a++) { + var parameter = _b[_a]; + if (ts.nodeIsDecorated(parameter)) { + var decorators = parameter.decorators; + argumentsWritten += emitList(decorators, 0, decorators.length, true, false, leadingComma, true, function (decorator) { + emitStart(decorator); + write("__param(" + parameterIndex + ", "); + emit(decorator.expression); + write(")"); + emitEnd(decorator); + }); + leadingComma = true; + } + ++parameterIndex; + } + } + return argumentsWritten; + } + function shouldEmitTypeMetadata(node) { + // 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 134 /* MethodDeclaration */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 132 /* PropertyDeclaration */: + return true; + } + return false; + } + function shouldEmitReturnTypeMetadata(node) { + // 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 134 /* MethodDeclaration */: + return true; + } + return false; + } + function shouldEmitParamTypesMetadata(node) { + // 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 201 /* ClassDeclaration */: + case 134 /* MethodDeclaration */: + case 137 /* SetAccessor */: + return true; + } + return false; + } + function emitSerializedTypeMetadata(node, writeComma) { + // This method emits the serialized type metadata for a decorator target. + // The caller should have already tested whether the node has decorators. + var 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, path, index) { + switch (index) { + case 0: + return "typeof " + path[index] + " !== 'undefined' && " + path[index]; + case 1: + return serializeTypeNameSegment(location, path, index - 1) + "." + path[index]; + default: + var temp = createAndRecordTempVariable(0 /* Auto */).text; + return "(" + temp + " = " + serializeTypeNameSegment(location, path, index - 1) + ") && " + temp + "." + path[index]; + } + } + function emitSerializedType(location, name) { + if (typeof name === "string") { + write(name); + return; + } + else { + ts.Debug.assert(name.length > 0, "Invalid serialized type name"); + write("(" + serializeTypeNameSegment(location, name, name.length - 1) + ") || Object"); + } } function emitInterfaceDeclaration(node) { emitOnlyPinnedOrTripleSlashComments(node); @@ -23247,10 +27668,11 @@ var ts; return !isConstEnum || compilerOptions.preserveConstEnums || compilerOptions.separateCompilation; } function emitEnumDeclaration(node) { + // const enums are completely erased during compilation. if (!shouldEmitEnumDeclaration(node)) { return; } - if (!(node.flags & 1) || isES6ExportedDeclaration(node)) { + if (!(node.flags & 1 /* Export */) || isES6ExportedDeclaration(node)) { emitStart(node); if (isES6ExportedDeclaration(node)) { write("export "); @@ -23272,7 +27694,7 @@ var ts; emitLines(node.members); decreaseIndent(); writeLine(); - emitToken(15, node.members.end); + emitToken(15 /* CloseBraceToken */, node.members.end); scopeEmitEnd(); write(")("); emitModuleMemberName(node); @@ -23280,7 +27702,7 @@ var ts; emitModuleMemberName(node); write(" = {}));"); emitEnd(node); - if (!isES6ExportedDeclaration(node) && node.flags & 1) { + if (!isES6ExportedDeclaration(node) && node.flags & 1 /* Export */) { writeLine(); emitStart(node); write("var "); @@ -23290,7 +27712,7 @@ var ts; emitEnd(node); write(";"); } - if (languageVersion < 2 && node.parent === currentSourceFile) { + if (languageVersion < 2 /* ES6 */ && node.parent === currentSourceFile) { emitExportMemberAssignments(node.name); } } @@ -23323,7 +27745,7 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 205) { + if (moduleDeclaration.body.kind === 205 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -23331,27 +27753,33 @@ var ts; function shouldEmitModuleDeclaration(node) { return ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation); } + function isModuleMergedWithES6Class(node) { + return languageVersion === 2 /* ES6 */ && !!(resolver.getNodeCheckFlags(node) & 2048 /* LexicalModuleMergesWithClass */); + } function emitModuleDeclaration(node) { + // Emit only if this module is non-ambient. var shouldEmit = shouldEmitModuleDeclaration(node); if (!shouldEmit) { return emitOnlyPinnedOrTripleSlashComments(node); } - emitStart(node); - if (isES6ExportedDeclaration(node)) { - write("export "); + if (!isModuleMergedWithES6Class(node)) { + emitStart(node); + if (isES6ExportedDeclaration(node)) { + write("export "); + } + write("var "); + emit(node.name); + write(";"); + emitEnd(node); + writeLine(); } - write("var "); - emit(node.name); - write(";"); - emitEnd(node); - writeLine(); emitStart(node); write("(function ("); emitStart(node.name); write(getGeneratedNameForNode(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 206) { + if (node.body.kind === 206 /* ModuleBlock */) { var saveTempFlags = tempFlags; var saveTempVariables = tempVariables; tempFlags = 0; @@ -23370,11 +27798,12 @@ var ts; decreaseIndent(); writeLine(); var moduleBlock = getInnerMostModuleDeclarationFromDottedModule(node).body; - emitToken(15, moduleBlock.statements.end); + emitToken(15 /* CloseBraceToken */, moduleBlock.statements.end); scopeEmitEnd(); } write(")("); - if ((node.flags & 1) && !isES6ExportedDeclaration(node)) { + // write moduleDecl = containingModule.m only if it is not exported es6 module member + if ((node.flags & 1 /* Export */) && !isES6ExportedDeclaration(node)) { emit(node.name); write(" = "); } @@ -23383,33 +27812,33 @@ var ts; emitModuleMemberName(node); write(" = {}));"); emitEnd(node); - if (!isES6ExportedDeclaration(node) && node.name.kind === 65 && node.parent === currentSourceFile) { + if (!isES6ExportedDeclaration(node) && node.name.kind === 65 /* Identifier */ && node.parent === currentSourceFile) { emitExportMemberAssignments(node.name); } } function emitRequire(moduleName) { - if (moduleName.kind === 8) { + if (moduleName.kind === 8 /* StringLiteral */) { write("require("); emitStart(moduleName); emitLiteral(moduleName); emitEnd(moduleName); - emitToken(17, moduleName.end); + emitToken(17 /* CloseParenToken */, moduleName.end); } else { write("require()"); } } function getNamespaceDeclarationNode(node) { - if (node.kind === 208) { + if (node.kind === 208 /* ImportEqualsDeclaration */) { return node; } var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 211) { + if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 211 /* NamespaceImport */) { return importClause.namedBindings; } } function isDefaultImport(node) { - return node.kind === 209 && node.importClause && !!node.importClause.name; + return node.kind === 209 /* ImportDeclaration */ && node.importClause && !!node.importClause.name; } function emitExportImportAssignments(node) { if (ts.isAliasSymbolDeclaration(node) && resolver.isValueAliasDeclaration(node)) { @@ -23418,9 +27847,10 @@ var ts; ts.forEachChild(node, emitExportImportAssignments); } function emitImportDeclaration(node) { - if (languageVersion < 2) { + if (languageVersion < 2 /* ES6 */) { return emitExternalImportDeclaration(node); } + // ES6 import if (node.importClause) { var shouldEmitDefaultBindings = resolver.isReferencedAliasDeclaration(node.importClause); var shouldEmitNamedBindings = node.importClause.namedBindings && resolver.isReferencedAliasDeclaration(node.importClause.namedBindings, true); @@ -23436,7 +27866,7 @@ var ts; if (shouldEmitNamedBindings) { emitLeadingComments(node.importClause.namedBindings); emitStart(node.importClause.namedBindings); - if (node.importClause.namedBindings.kind === 211) { + if (node.importClause.namedBindings.kind === 211 /* NamespaceImport */) { write("* as "); emit(node.importClause.namedBindings.name); } @@ -23462,19 +27892,26 @@ var ts; } function emitExternalImportDeclaration(node) { if (ts.contains(externalImports, node)) { - var isExportedImport = node.kind === 208 && (node.flags & 1) !== 0; + var isExportedImport = node.kind === 208 /* ImportEqualsDeclaration */ && (node.flags & 1 /* Export */) !== 0; var namespaceDeclaration = getNamespaceDeclarationNode(node); - if (compilerOptions.module !== 2) { + if (compilerOptions.module !== 2 /* AMD */) { emitLeadingComments(node); emitStart(node); if (namespaceDeclaration && !isDefaultImport(node)) { + // import x = require("foo") + // import * as x from "foo" if (!isExportedImport) write("var "); emitModuleMemberName(namespaceDeclaration); write(" = "); } else { - var isNakedImport = 209 && !node.importClause; + // import "foo" + // import x from "foo" + // import { x, y } from "foo" + // import d, * as x from "foo" + // import d, { x, y } from "foo" + var isNakedImport = 209 /* ImportDeclaration */ && !node.importClause; if (!isNakedImport) { write("var "); write(getGeneratedNameForNode(node)); @@ -23483,6 +27920,7 @@ var ts; } emitRequire(ts.getExternalModuleName(node)); if (namespaceDeclaration && isDefaultImport(node)) { + // import d, * as x from "foo" write(", "); emitModuleMemberName(namespaceDeclaration); write(" = "); @@ -23501,6 +27939,7 @@ var ts; write(";"); } else if (namespaceDeclaration && isDefaultImport(node)) { + // import d, * as x from "foo" write("var "); emitModuleMemberName(namespaceDeclaration); write(" = "); @@ -23516,6 +27955,9 @@ var ts; emitExternalImportDeclaration(node); return; } + // preserve old compiler's behavior: emit 'var' for import declaration (even if we do not consider them referenced) when + // - current file is not external module + // - import declaration is top level and target is value imported by entity name if (resolver.isReferencedAliasDeclaration(node) || (!ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node))) { emitLeadingComments(node); @@ -23524,7 +27966,7 @@ var ts; write("export "); write("var "); } - else if (!(node.flags & 1)) { + else if (!(node.flags & 1 /* Export */)) { write("var "); } emitModuleMemberName(node); @@ -23537,12 +27979,13 @@ var ts; } } function emitExportDeclaration(node) { - if (languageVersion < 2) { + if (languageVersion < 2 /* ES6 */) { if (node.moduleSpecifier && (!node.exportClause || resolver.isValueAliasDeclaration(node))) { emitStart(node); var generatedName = getGeneratedNameForNode(node); if (node.exportClause) { - if (compilerOptions.module !== 2) { + // export { x, y, ... } from "foo" + if (compilerOptions.module !== 2 /* AMD */) { write("var "); write(generatedName); write(" = "); @@ -23567,9 +28010,10 @@ var ts; } } else { + // export * from "foo" writeLine(); write("__export("); - if (compilerOptions.module !== 2) { + if (compilerOptions.module !== 2 /* AMD */) { emitRequire(ts.getExternalModuleName(node)); } else { @@ -23585,6 +28029,7 @@ var ts; emitStart(node); write("export "); if (node.exportClause) { + // export { x, y, ... } write("{ "); emitExportOrImportSpecifierList(node.exportClause.elements, resolver.isValueAliasDeclaration); write(" }"); @@ -23602,7 +28047,7 @@ var ts; } } function emitExportOrImportSpecifierList(specifiers, shouldEmit) { - ts.Debug.assert(languageVersion >= 2); + ts.Debug.assert(languageVersion >= 2 /* ES6 */); var needsComma = false; for (var _a = 0; _a < specifiers.length; _a++) { var specifier = specifiers[_a]; @@ -23623,14 +28068,14 @@ var ts; } function emitExportAssignment(node) { if (!node.isExportEquals && resolver.isValueAliasDeclaration(node)) { - if (languageVersion >= 2) { + if (languageVersion >= 2 /* ES6 */) { writeLine(); emitStart(node); write("export default "); var expression = node.expression; emit(expression); - if (expression.kind !== 200 && - expression.kind !== 201) { + if (expression.kind !== 200 /* FunctionDeclaration */ && + expression.kind !== 201 /* ClassDeclaration */) { write(";"); } emitEnd(node); @@ -23639,7 +28084,12 @@ var ts; writeLine(); emitStart(node); emitContainingModuleName(node); - write(".default = "); + if (languageVersion === 0 /* ES3 */) { + write("[\"default\"] = "); + } + else { + write(".default = "); + } emit(node.expression); write(";"); emitEnd(node); @@ -23654,56 +28104,52 @@ var ts; for (var _a = 0, _b = sourceFile.statements; _a < _b.length; _a++) { var node = _b[_a]; switch (node.kind) { - case 209: + case 209 /* ImportDeclaration */: if (!node.importClause || resolver.isReferencedAliasDeclaration(node.importClause, true)) { + // import "mod" + // import x from "mod" where x is referenced + // import * as x from "mod" where x is referenced + // import { x, y } from "mod" where at least one import is referenced externalImports.push(node); } break; - case 208: - if (node.moduleReference.kind === 219 && resolver.isReferencedAliasDeclaration(node)) { + case 208 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 219 /* ExternalModuleReference */ && resolver.isReferencedAliasDeclaration(node)) { + // import x = require("mod") where x is referenced externalImports.push(node); } break; - case 215: + case 215 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { + // export * from "mod" externalImports.push(node); hasExportStars = true; } else if (resolver.isValueAliasDeclaration(node)) { + // export { x, y } from "mod" where at least one export is a value symbol externalImports.push(node); } } else { + // export { x, y } 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); + var name_20 = (specifier.propertyName || specifier.name).text; + (exportSpecifiers[name_20] || (exportSpecifiers[name_20] = [])).push(specifier); } } break; - case 214: + case 214 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { + // export = x exportEquals = node; } break; } } } - function sortAMDModules(amdModules) { - return amdModules.sort(function (moduleA, moduleB) { - if (moduleA.name === moduleB.name) { - return 0; - } - else if (!moduleA.name) { - return 1; - } - else { - return -1; - } - }); - } function emitExportStarHelper() { if (hasExportStars) { writeLine(); @@ -23718,48 +28164,78 @@ var ts; } function emitAMDModule(node, startIndex) { collectExternalModuleInfo(node); + // An AMD define function has the following shape: + // define(id?, dependencies?, factory); + // + // This has the shape of + // define(name, ["module1", "module2"], function (module1Alias) { + // The location of the alias in the parameter list in the factory function needs to + // match the position of the module name in the dependency list. + // + // To ensure this is true in cases of modules with no aliases, e.g.: + // `import "module"` or `` + // we need to add modules without alias names to the end of the dependencies list + var aliasedModuleNames = []; // names of modules with corresponding parameter in the + // factory function. + var unaliasedModuleNames = []; // names of modules with no corresponding parameters in + // factory function. + var importAliasNames = []; // names of the parameters in the factory function; these + // paramters need to match the indexes of the corresponding + // module names in aliasedModuleNames. + // Fill in amd-dependency tags + for (var _a = 0, _b = node.amdDependencies; _a < _b.length; _a++) { + var amdDependency = _b[_a]; + if (amdDependency.name) { + aliasedModuleNames.push("\"" + amdDependency.path + "\""); + importAliasNames.push(amdDependency.name); + } + else { + unaliasedModuleNames.push("\"" + amdDependency.path + "\""); + } + } + for (var _c = 0; _c < externalImports.length; _c++) { + var importNode = externalImports[_c]; + // Find the name of the external module + var externalModuleName = ""; + var moduleName = ts.getExternalModuleName(importNode); + if (moduleName.kind === 8 /* StringLiteral */) { + externalModuleName = getLiteralText(moduleName); + } + // Find the name of the module alais, if there is one + var importAliasName = void 0; + var namespaceDeclaration = getNamespaceDeclarationNode(importNode); + if (namespaceDeclaration && !isDefaultImport(importNode)) { + importAliasName = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, namespaceDeclaration.name); + } + else { + importAliasName = getGeneratedNameForNode(importNode); + } + if (importAliasName) { + aliasedModuleNames.push(externalModuleName); + importAliasNames.push(importAliasName); + } + else { + unaliasedModuleNames.push(externalModuleName); + } + } writeLine(); write("define("); - sortAMDModules(node.amdDependencies); if (node.amdModuleName) { write("\"" + node.amdModuleName + "\", "); } write("[\"require\", \"exports\""); - for (var _a = 0; _a < externalImports.length; _a++) { - var importNode = externalImports[_a]; + if (aliasedModuleNames.length) { write(", "); - var moduleName = ts.getExternalModuleName(importNode); - if (moduleName.kind === 8) { - emitLiteral(moduleName); - } - else { - write("\"\""); - } + write(aliasedModuleNames.join(", ")); } - for (var _b = 0, _c = node.amdDependencies; _b < _c.length; _b++) { - var amdDependency = _c[_b]; - var text = "\"" + amdDependency.path + "\""; + if (unaliasedModuleNames.length) { write(", "); - write(text); + write(unaliasedModuleNames.join(", ")); } write("], function (require, exports"); - for (var _d = 0; _d < externalImports.length; _d++) { - var importNode = externalImports[_d]; + if (importAliasNames.length) { write(", "); - var namespaceDeclaration = getNamespaceDeclarationNode(importNode); - if (namespaceDeclaration && !isDefaultImport(importNode)) { - emit(namespaceDeclaration.name); - } - else { - write(getGeneratedNameForNode(importNode)); - } - } - for (var _e = 0, _f = node.amdDependencies; _e < _f.length; _e++) { - var amdDependency = _f[_e]; - if (amdDependency.name) { - write(", "); - write(amdDependency.name); - } + write(importAliasNames.join(", ")); } write(") {"); increaseIndent(); @@ -23788,6 +28264,8 @@ var ts; emitCaptureThisForNodeIfNecessary(node); emitLinesStartingAt(node.statements, startIndex); emitTempDeclarations(true); + // Emit exportDefault if it exists will happen as part + // or normal statement emit. } function emitExportEquals(emitAsReturn) { if (exportEquals && resolver.isValueAliasDeclaration(exportEquals)) { @@ -23808,12 +28286,13 @@ var ts; emit(statements[i]); } else { + // return index of the first non prologue directive return i; } } return statements.length; } - function writeHelper(text) { + function writeLines(text) { var lines = text.split(/\r\n|\r|\n/g); for (var i = 0; i < lines.length; ++i) { var line = lines[i]; @@ -23824,35 +28303,33 @@ var ts; } } function emitSourceFileNode(node) { + // Start new file on new line writeLine(); emitDetachedComments(node); + // emit prologue directives prior to __extends var startIndex = emitDirectivePrologues(node.statements, false); - if ((languageVersion < 2) && (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8)) { - 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("};"); + // Only Emit __extends function when target ES5. + // For target ES6 and above, we can emit classDeclaration as is. + if ((languageVersion < 2 /* ES6 */) && (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8 /* EmitExtends */)) { + writeLines(extendsHelper); extendsEmitted = true; } - if (!decorateEmitted && resolver.getNodeCheckFlags(node) & 512) { - 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};"); + if (!decorateEmitted && resolver.getNodeCheckFlags(node) & 512 /* EmitDecorate */) { + writeLines(decorateHelper); + if (compilerOptions.emitDecoratorMetadata) { + writeLines(metadataHelper); + } decorateEmitted = true; } + if (!paramEmitted && resolver.getNodeCheckFlags(node) & 1024 /* EmitParam */) { + writeLines(paramHelper); + paramEmitted = true; + } if (ts.isExternalModule(node)) { - if (languageVersion >= 2) { + if (languageVersion >= 2 /* ES6 */) { emitES6Module(node, startIndex); } - else if (compilerOptions.module === 2) { + else if (compilerOptions.module === 2 /* AMD */) { emitAMDModule(node, startIndex); } else { @@ -23874,7 +28351,7 @@ var ts; if (!node) { return; } - if (node.flags & 2) { + if (node.flags & 2 /* Ambient */) { return emitOnlyPinnedOrTripleSlashComments(node); } var emitComments = shouldEmitLeadingAndTrailingComments(node); @@ -23888,181 +28365,195 @@ var ts; } function shouldEmitLeadingAndTrailingComments(node) { switch (node.kind) { - case 202: - case 200: - case 209: - case 208: - case 203: - case 214: + // All of these entities are emitted in a specialized fashion. As such, we allow + // the specialized methods for each to handle the comments on the nodes. + case 202 /* InterfaceDeclaration */: + case 200 /* FunctionDeclaration */: + case 209 /* ImportDeclaration */: + case 208 /* ImportEqualsDeclaration */: + case 203 /* TypeAliasDeclaration */: + case 214 /* ExportAssignment */: return false; - case 205: + case 205 /* ModuleDeclaration */: + // Only emit the leading/trailing comments for a module if we're actually + // emitting the module as well. return shouldEmitModuleDeclaration(node); - case 204: + case 204 /* EnumDeclaration */: + // Only emit the leading/trailing comments for an enum if we're actually + // emitting the module as well. return shouldEmitEnumDeclaration(node); } - if (node.kind !== 179 && + // If this is the expression body of an arrow function that we're down-leveling, + // then we don't want to emit comments when we emit the body. It will have already + // been taken care of when we emitted the 'return' statement for the function + // expression body. + if (node.kind !== 179 /* Block */ && node.parent && - node.parent.kind === 163 && + node.parent.kind === 163 /* ArrowFunction */ && node.parent.body === node && - compilerOptions.target <= 1) { + compilerOptions.target <= 1 /* ES5 */) { return false; } + // Emit comments for everything else. return true; } function emitJavaScriptWorker(node, allowGeneratedIdentifiers) { if (allowGeneratedIdentifiers === void 0) { allowGeneratedIdentifiers = true; } + // Check if the node can be emitted regardless of the ScriptTarget switch (node.kind) { - case 65: + case 65 /* Identifier */: return emitIdentifier(node, allowGeneratedIdentifiers); - case 129: + case 129 /* Parameter */: return emitParameter(node); - case 134: - case 133: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: return emitMethod(node); - case 136: - case 137: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: return emitAccessor(node); - case 93: + case 93 /* ThisKeyword */: return emitThis(node); - case 91: + case 91 /* SuperKeyword */: return emitSuper(node); - case 89: + case 89 /* NullKeyword */: return write("null"); - case 95: + case 95 /* TrueKeyword */: return write("true"); - case 80: + case 80 /* FalseKeyword */: return write("false"); - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: + case 7 /* NumericLiteral */: + case 8 /* StringLiteral */: + case 9 /* RegularExpressionLiteral */: + case 10 /* NoSubstitutionTemplateLiteral */: + case 11 /* TemplateHead */: + case 12 /* TemplateMiddle */: + case 13 /* TemplateTail */: return emitLiteral(node); - case 171: + case 171 /* TemplateExpression */: return emitTemplateExpression(node); - case 176: + case 176 /* TemplateSpan */: return emitTemplateSpan(node); - case 126: + case 126 /* QualifiedName */: return emitQualifiedName(node); - case 150: + case 150 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 151: + case 151 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 152: + case 152 /* BindingElement */: return emitBindingElement(node); - case 153: + case 153 /* ArrayLiteralExpression */: return emitArrayLiteral(node); - case 154: + case 154 /* ObjectLiteralExpression */: return emitObjectLiteral(node); - case 224: + case 224 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 225: + case 225 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 127: + case 127 /* ComputedPropertyName */: return emitComputedPropertyName(node); - case 155: + case 155 /* PropertyAccessExpression */: return emitPropertyAccess(node); - case 156: + case 156 /* ElementAccessExpression */: return emitIndexedAccess(node); - case 157: + case 157 /* CallExpression */: return emitCallExpression(node); - case 158: + case 158 /* NewExpression */: return emitNewExpression(node); - case 159: + case 159 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 160: + case 160 /* TypeAssertionExpression */: return emit(node.expression); - case 161: + case 161 /* ParenthesizedExpression */: return emitParenExpression(node); - case 200: - case 162: - case 163: + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: return emitFunctionDeclaration(node); - case 164: + case 164 /* DeleteExpression */: return emitDeleteExpression(node); - case 165: + case 165 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 166: + case 166 /* VoidExpression */: return emitVoidExpression(node); - case 167: + case 167 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 168: + case 168 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 169: + case 169 /* BinaryExpression */: return emitBinaryExpression(node); - case 170: + case 170 /* ConditionalExpression */: return emitConditionalExpression(node); - case 173: + case 173 /* SpreadElementExpression */: return emitSpreadElementExpression(node); - case 175: + case 172 /* YieldExpression */: + return emitYieldExpression(node); + case 175 /* OmittedExpression */: return; - case 179: - case 206: + case 179 /* Block */: + case 206 /* ModuleBlock */: return emitBlock(node); - case 180: + case 180 /* VariableStatement */: return emitVariableStatement(node); - case 181: + case 181 /* EmptyStatement */: return write(";"); - case 182: + case 182 /* ExpressionStatement */: return emitExpressionStatement(node); - case 183: + case 183 /* IfStatement */: return emitIfStatement(node); - case 184: + case 184 /* DoStatement */: return emitDoStatement(node); - case 185: + case 185 /* WhileStatement */: return emitWhileStatement(node); - case 186: + case 186 /* ForStatement */: return emitForStatement(node); - case 188: - case 187: + case 188 /* ForOfStatement */: + case 187 /* ForInStatement */: return emitForInOrForOfStatement(node); - case 189: - case 190: + case 189 /* ContinueStatement */: + case 190 /* BreakStatement */: return emitBreakOrContinueStatement(node); - case 191: + case 191 /* ReturnStatement */: return emitReturnStatement(node); - case 192: + case 192 /* WithStatement */: return emitWithStatement(node); - case 193: + case 193 /* SwitchStatement */: return emitSwitchStatement(node); - case 220: - case 221: + case 220 /* CaseClause */: + case 221 /* DefaultClause */: return emitCaseOrDefaultClause(node); - case 194: + case 194 /* LabeledStatement */: return emitLabelledStatement(node); - case 195: + case 195 /* ThrowStatement */: return emitThrowStatement(node); - case 196: + case 196 /* TryStatement */: return emitTryStatement(node); - case 223: + case 223 /* CatchClause */: return emitCatchClause(node); - case 197: + case 197 /* DebuggerStatement */: return emitDebuggerStatement(node); - case 198: + case 198 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 174: + case 174 /* ClassExpression */: return emitClassExpression(node); - case 201: + case 201 /* ClassDeclaration */: return emitClassDeclaration(node); - case 202: + case 202 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 204: + case 204 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 226: + case 226 /* EnumMember */: return emitEnumMember(node); - case 205: + case 205 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 209: + case 209 /* ImportDeclaration */: return emitImportDeclaration(node); - case 208: + case 208 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 215: + case 215 /* ExportDeclaration */: return emitExportDeclaration(node); - case 214: + case 214 /* ExportAssignment */: return emitExportAssignment(node); - case 227: + case 227 /* SourceFile */: return emitSourceFileNode(node); } } @@ -24070,6 +28561,7 @@ var ts; return detachedCommentsInfo !== undefined && detachedCommentsInfo[detachedCommentsInfo.length - 1].nodePos === pos; } function getLeadingCommentsWithoutDetachedComments() { + // get the leading comments from detachedPos var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, detachedCommentsInfo[detachedCommentsInfo.length - 1].detachedCommentEndPos); if (detachedCommentsInfo.length - 1) { detachedCommentsInfo.pop(); @@ -24080,6 +28572,8 @@ var ts; return leadingComments; } function filterComments(ranges, onlyPinnedOrTripleSlashComments) { + // If we're removing comments, then we want to strip out all but the pinned or + // triple slash comments. if (ranges && onlyPinnedOrTripleSlashComments) { ranges = ts.filter(ranges, isPinnedOrTripleSlashComment); if (ranges.length === 0) { @@ -24089,20 +28583,24 @@ var ts; return ranges; } function getLeadingCommentsToEmit(node) { + // Emit the leading comments only if the parent's pos doesn't match because parent should take care of emitting these comments if (node.parent) { - if (node.parent.kind === 227 || node.pos !== node.parent.pos) { + if (node.parent.kind === 227 /* SourceFile */ || node.pos !== node.parent.pos) { if (hasDetachedComments(node.pos)) { + // get comments without detached comments return getLeadingCommentsWithoutDetachedComments(); } else { + // get the leading comments from the node return ts.getLeadingCommentRangesOfNode(node, currentSourceFile); } } } } function getTrailingCommentsToEmit(node) { + // Emit the trailing comments only if the parent's pos doesn't match because parent should take care of emitting these comments if (node.parent) { - if (node.parent.kind === 227 || node.end !== node.parent.end) { + if (node.parent.kind === 227 /* SourceFile */ || node.end !== node.parent.end) { return ts.getTrailingCommentRanges(currentSourceFile.text, node.end); } } @@ -24114,24 +28612,32 @@ var ts; return emitLeadingCommentsWorker(node, compilerOptions.removeComments); } function emitLeadingCommentsWorker(node, onlyPinnedOrTripleSlashComments) { + // If the caller only wants pinned or triple slash comments, then always filter + // down to that set. Otherwise, filter based on the current compiler options. var leadingComments = filterComments(getLeadingCommentsToEmit(node), onlyPinnedOrTripleSlashComments); ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); + // Leading comments are emitted at /*leading comment1 */space/*leading comment*/space ts.emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); } function emitTrailingComments(node) { + // Emit the trailing comments only if the parent's end doesn't match var trailingComments = filterComments(getTrailingCommentsToEmit(node), compilerOptions.removeComments); + // trailing comments are emitted at space/*trailing comment1 */space/*trailing comment*/ ts.emitComments(currentSourceFile, writer, trailingComments, false, newLine, writeComment); } function emitLeadingCommentsOfPosition(pos) { var leadingComments; if (hasDetachedComments(pos)) { + // get comments without detached comments leadingComments = getLeadingCommentsWithoutDetachedComments(); } else { + // get the leading comments from the node leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, pos); } leadingComments = filterComments(leadingComments, compilerOptions.removeComments); ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, { pos: pos, end: pos }, leadingComments); + // Leading comments are emitted at /*leading comment1 */space/*leading comment*/space ts.emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); } function emitDetachedComments(node) { @@ -24144,6 +28650,9 @@ var ts; var lastCommentLine = ts.getLineOfLocalPosition(currentSourceFile, lastComment.end); var commentLine = ts.getLineOfLocalPosition(currentSourceFile, comment.pos); if (commentLine >= lastCommentLine + 2) { + // There was a blank line between the last comment and this comment. This + // comment is not part of the copyright comments. Return what we have so + // far. return detachedComments; } } @@ -24151,9 +28660,13 @@ var ts; lastComment = comment; }); if (detachedComments.length) { + // All comments look like they could have been part of the copyright header. Make + // sure there is at least one blank line between it and the node. If not, it's not + // a copyright header. var lastCommentLine = ts.getLineOfLocalPosition(currentSourceFile, detachedComments[detachedComments.length - 1].end); var nodeLine = ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node.pos)); if (nodeLine >= lastCommentLine + 2) { + // Valid detachedComments ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); ts.emitComments(currentSourceFile, writer, detachedComments, true, newLine, writeComment); var currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: detachedComments[detachedComments.length - 1].end }; @@ -24168,12 +28681,12 @@ var ts; } } function isPinnedOrTripleSlashComment(comment) { - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42) { - return currentSourceFile.text.charCodeAt(comment.pos + 2) === 33; + if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42 /* asterisk */) { + return currentSourceFile.text.charCodeAt(comment.pos + 2) === 33 /* exclamation */; } - else if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 47 && + else if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 47 /* slash */ && comment.pos + 2 < comment.end && - currentSourceFile.text.charCodeAt(comment.pos + 2) === 47 && + currentSourceFile.text.charCodeAt(comment.pos + 2) === 47 /* slash */ && currentSourceFile.text.substring(comment.pos, comment.end).match(ts.fullTripleSlashReferencePathRegEx)) { return true; } @@ -24192,10 +28705,11 @@ var ts; /// var ts; (function (ts) { - ts.programTime = 0; - ts.emitTime = 0; - ts.ioReadTime = 0; - ts.ioWriteTime = 0; + /* @internal */ ts.programTime = 0; + /* @internal */ ts.emitTime = 0; + /* @internal */ ts.ioReadTime = 0; + /* @internal */ ts.ioWriteTime = 0; + /** The version of the TypeScript compiler release */ ts.version = "1.5.0-alpha"; function findConfigFile(searchPath) { var fileName = "tsconfig.json"; @@ -24217,8 +28731,11 @@ var ts; var currentDirectory; var existingDirectories = {}; function getCanonicalFileName(fileName) { + // if underlying system can distinguish between two files whose names differs only in cases then file name already in canonical form. + // otherwise use toLowerCase as a canonical form. return ts.sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(); } + // returned by CScript sys environment var unsupportedFileEncodingErrorCode = -2147024809; function getSourceFile(fileName, languageVersion, onError) { var text; @@ -24338,7 +28855,7 @@ var ts; getDiagnosticsProducingTypeChecker: getDiagnosticsProducingTypeChecker, getCommonSourceDirectory: function () { return commonSourceDirectory; }, emit: emit, - getCurrentDirectory: host.getCurrentDirectory, + getCurrentDirectory: function () { return host.getCurrentDirectory(); }, getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); }, getIdentifierCount: function () { return getDiagnosticsProducingTypeChecker().getIdentifierCount(); }, getSymbolCount: function () { return getDiagnosticsProducingTypeChecker().getSymbolCount(); }, @@ -24347,14 +28864,14 @@ var ts; return program; function getEmitHost(writeFileCallback) { return { - getCanonicalFileName: host.getCanonicalFileName, + getCanonicalFileName: function (fileName) { return host.getCanonicalFileName(fileName); }, getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, - getCurrentDirectory: host.getCurrentDirectory, - getNewLine: host.getNewLine, + getCurrentDirectory: function () { return host.getCurrentDirectory(); }, + getNewLine: function () { return host.getNewLine(); }, getSourceFile: program.getSourceFile, getSourceFiles: program.getSourceFiles, - writeFile: writeFileCallback || host.writeFile + writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError) { return host.writeFile(fileName, data, writeByteOrderMark, onError); }) }; } function getDiagnosticsProducingTypeChecker() { @@ -24364,9 +28881,14 @@ var ts; return noDiagnosticsTypeChecker || (noDiagnosticsTypeChecker = ts.createTypeChecker(program, false)); } function emit(sourceFile, writeFileCallback) { + // If the noEmitOnError flag is set, then check if we have any errors so far. If so, + // immediately bail out. if (options.noEmitOnError && getPreEmitDiagnostics(this).length > 0) { return { diagnostics: [], sourceMaps: undefined, emitSkipped: true }; } + // Create the emit resolver outside of the "emitTime" tracking code below. That way + // any cost associated with it (like type checking) are appropriate associated with + // the type-checking counter. var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile); var start = new Date().getTime(); var emitResult = ts.emitFiles(emitResolver, getEmitHost(writeFileCallback), sourceFile); @@ -24410,6 +28932,7 @@ var ts; function getDeclarationDiagnosticsForFile(sourceFile) { if (!ts.isDeclarationFile(sourceFile)) { var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile); + // Don't actually write any files since we're just getting diagnostics. var writeFile = function () { }; return ts.getDeclarationDiagnostics(getEmitHost(writeFile), resolver, sourceFile); } @@ -24464,9 +28987,11 @@ var ts; } } } + // Get source file from normalized fileName function findSourceFile(fileName, isDefaultLib, refFile, refStart, refLength) { var canonicalName = host.getCanonicalFileName(fileName); if (ts.hasProperty(filesByName, canonicalName)) { + // We've already looked for this file, use cached result return getSourceFileFromCache(fileName, canonicalName, false); } else { @@ -24475,6 +29000,7 @@ var ts; if (ts.hasProperty(filesByName, canonicalAbsolutePath)) { return getSourceFileFromCache(normalizedAbsolutePath, canonicalAbsolutePath, true); } + // We haven't looked for this file, do so now and cache result var file = filesByName[canonicalName] = host.getSourceFile(fileName, options.target, function (hostErrorMessage) { if (refFile) { diagnostics.add(ts.createFileDiagnostic(refFile, refStart, refLength, ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, hostErrorMessage)); @@ -24485,6 +29011,7 @@ var ts; }); if (file) { seenNoDefaultLib = seenNoDefaultLib || file.hasNoDefaultLib; + // Set the source file for normalized absolute path filesByName[canonicalAbsolutePath] = file; if (!options.noResolve) { var basePath = ts.getDirectoryPath(fileName); @@ -24519,9 +29046,9 @@ var ts; } function processImportedModules(file, basePath) { ts.forEach(file.statements, function (node) { - if (node.kind === 209 || node.kind === 208 || node.kind === 215) { + if (node.kind === 209 /* ImportDeclaration */ || node.kind === 208 /* ImportEqualsDeclaration */ || node.kind === 215 /* ExportDeclaration */) { var moduleNameExpr = ts.getExternalModuleName(node); - if (moduleNameExpr && moduleNameExpr.kind === 8) { + if (moduleNameExpr && moduleNameExpr.kind === 8 /* StringLiteral */) { var moduleNameText = moduleNameExpr.text; if (moduleNameText) { var searchPath = basePath; @@ -24539,13 +29066,21 @@ var ts; } } } - else if (node.kind === 205 && node.name.kind === 8 && (node.flags & 2 || ts.isDeclarationFile(file))) { + else if (node.kind === 205 /* ModuleDeclaration */ && node.name.kind === 8 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || ts.isDeclarationFile(file))) { + // TypeScript 1.0 spec (April 2014): 12.1.6 + // An AmbientExternalModuleDeclaration declares an external module. + // This type of declaration is permitted only in the global module. + // The StringLiteral must specify a top - level external module name. + // Relative external module names are not permitted ts.forEachChild(node.body, function (node) { if (ts.isExternalModuleImportEqualsDeclaration(node) && - ts.getExternalModuleImportEqualsDeclarationExpression(node).kind === 8) { + ts.getExternalModuleImportEqualsDeclarationExpression(node).kind === 8 /* StringLiteral */) { var nameLiteral = ts.getExternalModuleImportEqualsDeclarationExpression(node); var moduleName = nameLiteral.text; if (moduleName) { + // TypeScript 1.0 spec (April 2014): 12.1.6 + // An ExternalImportDeclaration in anAmbientExternalModuleDeclaration may reference other external modules + // only through top - level external module names. Relative external module names are not permitted. var searchName = ts.normalizePath(ts.combinePaths(basePath, moduleName)); var tsFile = findModuleSourceFile(searchName + ".ts", nameLiteral); if (!tsFile) { @@ -24576,6 +29111,7 @@ var ts; } } if (!options.sourceMap && (options.mapRoot || options.sourceRoot)) { + // Error to specify --mapRoot or --sourceRoot without mapSourceFiles if (options.mapRoot) { diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option)); } @@ -24584,10 +29120,10 @@ var ts; } return; } - var languageVersion = options.target || 0; + var languageVersion = options.target || 0 /* ES3 */; var firstExternalModuleSourceFile = ts.forEach(files, function (f) { return ts.isExternalModule(f) ? f : undefined; }); if (options.separateCompilation) { - if (!options.module && languageVersion < 2) { + if (!options.module && languageVersion < 2 /* ES6 */) { 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; }); @@ -24596,23 +29132,28 @@ var ts; 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) { + else if (firstExternalModuleSourceFile && languageVersion < 2 /* ES6 */ && !options.module) { + // We cannot use createDiagnosticFromNode because nodes do not have parents yet var span = ts.getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator); diagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_external_modules_unless_the_module_flag_is_provided)); } - if (options.module && languageVersion >= 2) { + // Cannot specify module gen target when in es6 or above + if (options.module && languageVersion >= 2 /* ES6 */) { diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher)); } + // 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 || options.sourceRoot || (options.mapRoot && (!options.out || firstExternalModuleSourceFile !== undefined))) { var commonPathComponents; ts.forEach(files, function (sourceFile) { - if (!(sourceFile.flags & 2048) + // Each file contributes into common source file path + if (!(sourceFile.flags & 2048 /* DeclarationFile */) && !ts.fileExtensionIs(sourceFile.fileName, ".js")) { var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile.fileName, host.getCurrentDirectory()); - sourcePathComponents.pop(); + sourcePathComponents.pop(); // FileName is not part of directory if (commonPathComponents) { for (var i = 0; i < Math.min(commonPathComponents.length, sourcePathComponents.length); i++) { if (commonPathComponents[i] !== sourcePathComponents[i]) { @@ -24620,21 +29161,27 @@ var ts; diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); return; } + // New common path found that is 0 -> i-1 commonPathComponents.length = i; break; } } + // If the fileComponent path completely matched and less than already found update the length if (sourcePathComponents.length < commonPathComponents.length) { commonPathComponents.length = sourcePathComponents.length; } } else { + // first file commonPathComponents = sourcePathComponents; } } }); commonSourceDirectory = ts.getNormalizedPathFromPathComponents(commonPathComponents); if (commonSourceDirectory) { + // Make sure directory path ends with directory separator so this string can directly + // used to replace with "" to get the relative path of the source file and the relative path doesn't + // start with / making it rooted path commonSourceDirectory += ts.directorySeparator; } } @@ -24656,6 +29203,7 @@ var ts; /// var ts; (function (ts) { + /* @internal */ ts.optionDeclarations = [ { name: "charset", @@ -24700,8 +29248,8 @@ var ts; name: "module", shortName: "m", type: { - "commonjs": 1, - "amd": 2 + "commonjs": 1 /* CommonJS */, + "amd": 2 /* AMD */ }, description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_or_amd, paramType: ts.Diagnostics.KIND, @@ -24791,7 +29339,7 @@ var ts; { name: "target", shortName: "t", - type: { "es3": 0, "es5": 1, "es6": 2 }, + type: { "es3": 0 /* ES3 */, "es5": 1 /* ES5 */, "es6": 2 /* ES6 */ }, description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental, paramType: ts.Diagnostics.VERSION, error: ts.Diagnostics.Argument_for_target_option_must_be_es3_es5_or_es6 @@ -24807,6 +29355,11 @@ var ts; shortName: "w", type: "boolean", description: ts.Diagnostics.Watch_input_files + }, + { + name: "emitDecoratorMetadata", + type: "boolean", + experimental: true } ]; function parseCommandLine(commandLine) { @@ -24831,16 +29384,18 @@ var ts; var i = 0; while (i < args.length) { var s = args[i++]; - if (s.charCodeAt(0) === 64) { + if (s.charCodeAt(0) === 64 /* at */) { parseResponseFile(s.slice(1)); } - else if (s.charCodeAt(0) === 45) { - s = s.slice(s.charCodeAt(1) === 45 ? 2 : 1).toLowerCase(); + else if (s.charCodeAt(0) === 45 /* minus */) { + s = s.slice(s.charCodeAt(1) === 45 /* minus */ ? 2 : 1).toLowerCase(); + // Try to translate short option names to their full equivalents. if (ts.hasProperty(shortOptionNames, s)) { s = shortOptionNames[s]; } if (ts.hasProperty(optionNameMap, s)) { var opt = optionNameMap[s]; + // Check to see if no argument was provided (e.g. "--locale" is the last command-line argument). if (!args[i] && opt.type !== "boolean") { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_expects_an_argument, opt.name)); } @@ -24854,6 +29409,7 @@ var ts; case "string": options[opt.name] = args[i++] || ""; break; + // If not a primitive, the possible types are specified in what is effectively a map of options. default: var map = opt.type; var key = (args[i++] || "").toLowerCase(); @@ -24883,14 +29439,14 @@ var ts; var args = []; var pos = 0; while (true) { - while (pos < text.length && text.charCodeAt(pos) <= 32) + while (pos < text.length && text.charCodeAt(pos) <= 32 /* space */) pos++; if (pos >= text.length) break; var start = pos; - if (text.charCodeAt(start) === 34) { + if (text.charCodeAt(start) === 34 /* doubleQuote */) { pos++; - while (pos < text.length && text.charCodeAt(pos) !== 34) + while (pos < text.length && text.charCodeAt(pos) !== 34 /* doubleQuote */) pos++; if (pos < text.length) { args.push(text.substring(start + 1, pos)); @@ -24901,7 +29457,7 @@ var ts; } } else { - while (text.charCodeAt(pos) > 32) + while (text.charCodeAt(pos) > 32 /* space */) pos++; args.push(text.substring(start, pos)); } @@ -24910,6 +29466,10 @@ var ts; } } ts.parseCommandLine = parseCommandLine; + /** + * Read tsconfig.json file + * @param fileName The path to the config file + */ function readConfigFile(fileName) { try { var text = ts.sys.readFile(fileName); @@ -24919,6 +29479,12 @@ var ts; } } ts.readConfigFile = readConfigFile; + /** + * Parse the contents of a config file (tsconfig.json). + * @param json The contents of the config file to parse + * @param basePath A root directory to resolve relative path entries in the config + * file to. e.g. outDir + */ function parseConfigFile(json, basePath) { var errors = []; return { @@ -24988,20 +29554,7 @@ 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. -// +/* @internal */ var ts; (function (ts) { var OutliningElementsCollector; @@ -25020,8 +29573,60 @@ var ts; elements.push(span); } } + function addOutliningSpanComments(commentSpan, autoCollapse) { + if (commentSpan) { + var span = { + textSpan: ts.createTextSpanFromBounds(commentSpan.pos, commentSpan.end), + hintSpan: ts.createTextSpanFromBounds(commentSpan.pos, commentSpan.end), + bannerText: collapseText, + autoCollapse: autoCollapse + }; + elements.push(span); + } + } + function addOutliningForLeadingCommentsForNode(n) { + var comments = ts.getLeadingCommentRangesOfNode(n, sourceFile); + if (comments) { + var firstSingleLineCommentStart = -1; + var lastSingleLineCommentEnd = -1; + var isFirstSingleLineComment = true; + var singleLineCommentCount = 0; + for (var _i = 0; _i < comments.length; _i++) { + var currentComment = comments[_i]; + // For single line comments, combine consecutive ones (2 or more) into + // a single span from the start of the first till the end of the last + if (currentComment.kind === 2 /* SingleLineCommentTrivia */) { + if (isFirstSingleLineComment) { + firstSingleLineCommentStart = currentComment.pos; + } + isFirstSingleLineComment = false; + lastSingleLineCommentEnd = currentComment.end; + singleLineCommentCount++; + } + else if (currentComment.kind === 3 /* MultiLineCommentTrivia */) { + combineAndAddMultipleSingleLineComments(singleLineCommentCount, firstSingleLineCommentStart, lastSingleLineCommentEnd); + addOutliningSpanComments(currentComment, false); + singleLineCommentCount = 0; + lastSingleLineCommentEnd = -1; + isFirstSingleLineComment = true; + } + } + combineAndAddMultipleSingleLineComments(singleLineCommentCount, firstSingleLineCommentStart, lastSingleLineCommentEnd); + } + } + function combineAndAddMultipleSingleLineComments(count, start, end) { + // Only outline spans of two or more consecutive single line comments + if (count > 1) { + var multipleSingleLineComments = { + pos: start, + end: end, + kind: 2 /* SingleLineCommentTrivia */ + }; + addOutliningSpanComments(multipleSingleLineComments, false); + } + } function autoCollapse(node) { - return ts.isFunctionBlock(node) && node.parent.kind !== 163; + return ts.isFunctionBlock(node) && node.parent.kind !== 163 /* ArrowFunction */; } var depth = 0; var maxDepth = 20; @@ -25029,37 +29634,46 @@ var ts; if (depth > maxDepth) { return; } + if (ts.isDeclaration(n)) { + addOutliningForLeadingCommentsForNode(n); + } switch (n.kind) { - case 179: + case 179 /* Block */: if (!ts.isFunctionBlock(n)) { var parent_6 = n.parent; - var openBrace = ts.findChildOfKind(n, 14, sourceFile); - var closeBrace = ts.findChildOfKind(n, 15, sourceFile); - if (parent_6.kind === 184 || - parent_6.kind === 187 || - parent_6.kind === 188 || - parent_6.kind === 186 || - parent_6.kind === 183 || - parent_6.kind === 185 || - parent_6.kind === 192 || - parent_6.kind === 223) { + var openBrace = ts.findChildOfKind(n, 14 /* OpenBraceToken */, sourceFile); + var closeBrace = ts.findChildOfKind(n, 15 /* CloseBraceToken */, sourceFile); + // Check if the block is standalone, or 'attached' to some parent statement. + // If the latter, we want to collaps the block, but consider its hint span + // to be the entire span of the parent. + if (parent_6.kind === 184 /* DoStatement */ || + parent_6.kind === 187 /* ForInStatement */ || + parent_6.kind === 188 /* ForOfStatement */ || + parent_6.kind === 186 /* ForStatement */ || + parent_6.kind === 183 /* IfStatement */ || + parent_6.kind === 185 /* WhileStatement */ || + parent_6.kind === 192 /* WithStatement */ || + parent_6.kind === 223 /* CatchClause */) { addOutliningSpan(parent_6, openBrace, closeBrace, autoCollapse(n)); break; } - if (parent_6.kind === 196) { + if (parent_6.kind === 196 /* TryStatement */) { + // Could be the try-block, or the finally-block. var tryStatement = parent_6; if (tryStatement.tryBlock === n) { addOutliningSpan(parent_6, openBrace, closeBrace, autoCollapse(n)); break; } else if (tryStatement.finallyBlock === n) { - var finallyKeyword = ts.findChildOfKind(tryStatement, 81, sourceFile); + var finallyKeyword = ts.findChildOfKind(tryStatement, 81 /* FinallyKeyword */, sourceFile); if (finallyKeyword) { addOutliningSpan(finallyKeyword, openBrace, closeBrace, autoCollapse(n)); break; } } } + // Block was a standalone block. In this case we want to only collapse + // the span of the block, independent of any parent span. var span = ts.createTextSpanFromBounds(n.getStart(), n.end); elements.push({ textSpan: span, @@ -25069,25 +29683,26 @@ var ts; }); break; } - case 206: { - var openBrace = ts.findChildOfKind(n, 14, sourceFile); - var closeBrace = ts.findChildOfKind(n, 15, sourceFile); + // Fallthrough. + case 206 /* ModuleBlock */: { + var openBrace = ts.findChildOfKind(n, 14 /* OpenBraceToken */, sourceFile); + var closeBrace = ts.findChildOfKind(n, 15 /* CloseBraceToken */, sourceFile); addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); break; } - case 201: - case 202: - case 204: - case 154: - case 207: { - var openBrace = ts.findChildOfKind(n, 14, sourceFile); - var closeBrace = ts.findChildOfKind(n, 15, sourceFile); + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + case 204 /* EnumDeclaration */: + case 154 /* ObjectLiteralExpression */: + case 207 /* CaseBlock */: { + var openBrace = ts.findChildOfKind(n, 14 /* OpenBraceToken */, sourceFile); + var closeBrace = ts.findChildOfKind(n, 15 /* CloseBraceToken */, sourceFile); addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); break; } - case 153: - var openBracket = ts.findChildOfKind(n, 18, sourceFile); - var closeBracket = ts.findChildOfKind(n, 19, sourceFile); + case 153 /* ArrayLiteralExpression */: + var openBracket = ts.findChildOfKind(n, 18 /* OpenBracketToken */, sourceFile); + var closeBracket = ts.findChildOfKind(n, 19 /* CloseBracketToken */, sourceFile); addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); break; } @@ -25101,6 +29716,7 @@ var ts; OutliningElementsCollector.collectElements = collectElements; })(OutliningElementsCollector = ts.OutliningElementsCollector || (ts.OutliningElementsCollector = {})); })(ts || (ts = {})); +/* @internal */ var ts; (function (ts) { var NavigateTo; @@ -25108,30 +29724,37 @@ var ts; function getNavigateToItems(program, cancellationToken, searchValue, maxResultCount) { var patternMatcher = ts.createPatternMatcher(searchValue); var rawItems = []; + // Search the declarations in all files and output matched NavigateToItem into array of NavigateToItem[] ts.forEach(program.getSourceFiles(), function (sourceFile) { cancellationToken.throwIfCancellationRequested(); - var declarations = sourceFile.getNamedDeclarations(); - for (var _i = 0; _i < declarations.length; _i++) { - var declaration = declarations[_i]; - var name = getDeclarationName(declaration); - if (name !== undefined) { - var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name); + var nameToDeclarations = sourceFile.getNamedDeclarations(); + for (var name_21 in nameToDeclarations) { + var declarations = ts.getProperty(nameToDeclarations, name_21); + if (declarations) { + // First do a quick check to see if the name of the declaration matches the + // last portion of the (possibly) dotted name they're searching for. + var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_21); if (!matches) { continue; } - if (patternMatcher.patternContainsDots) { - var containers = getContainers(declaration); - if (!containers) { - return undefined; - } - matches = patternMatcher.getMatches(containers, name); - if (!matches) { - continue; + for (var _i = 0; _i < declarations.length; _i++) { + var declaration = declarations[_i]; + // It was a match! If the pattern has dots in it, then also see if the + // declaration container matches as well. + if (patternMatcher.patternContainsDots) { + var containers = getContainers(declaration); + if (!containers) { + return undefined; + } + matches = patternMatcher.getMatches(containers, name_21); + if (!matches) { + continue; + } } + var fileName = sourceFile.fileName; + var matchKind = bestMatchKind(matches); + rawItems.push({ name: name_21, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); } - var fileName = sourceFile.fileName; - var matchKind = bestMatchKind(matches); - rawItems.push({ name: name, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); } } }); @@ -25143,6 +29766,7 @@ var ts; return items; function allMatchesAreCaseSensitive(matches) { ts.Debug.assert(matches.length > 0); + // This is a case sensitive match, only if all the submatches were case sensitive. for (var _i = 0; _i < matches.length; _i++) { var match = matches[_i]; if (!match.isCaseSensitive) { @@ -25151,25 +29775,13 @@ var ts; } return true; } - function getDeclarationName(declaration) { - var result = getTextOfIdentifierOrLiteral(declaration.name); - if (result !== undefined) { - return result; - } - if (declaration.name.kind === 127) { - var expr = declaration.name.expression; - if (expr.kind === 155) { - return expr.name.text; - } - return getTextOfIdentifierOrLiteral(expr); - } - return undefined; - } function getTextOfIdentifierOrLiteral(node) { - if (node.kind === 65 || - node.kind === 8 || - node.kind === 7) { - return node.text; + if (node) { + if (node.kind === 65 /* Identifier */ || + node.kind === 8 /* StringLiteral */ || + node.kind === 7 /* NumericLiteral */) { + return node.text; + } } return undefined; } @@ -25179,15 +29791,19 @@ var ts; if (text !== undefined) { containers.unshift(text); } - else if (declaration.name.kind === 127) { + else if (declaration.name.kind === 127 /* ComputedPropertyName */) { return tryAddComputedPropertyName(declaration.name.expression, containers, true); } else { + // Don't know how to add this. return false; } } return true; } + // Only added the names of computed properties if they're simple dotted expressions, like: + // + // [X.Y.Z]() { } function tryAddComputedPropertyName(expression, containers, includeLastPortion) { var text = getTextOfIdentifierOrLiteral(expression); if (text !== undefined) { @@ -25196,7 +29812,7 @@ var ts; } return true; } - if (expression.kind === 155) { + if (expression.kind === 155 /* PropertyAccessExpression */) { var propertyAccess = expression; if (includeLastPortion) { containers.unshift(propertyAccess.name.text); @@ -25207,11 +29823,14 @@ var ts; } function getContainers(declaration) { var containers = []; - if (declaration.name.kind === 127) { + // First, if we started with a computed property name, then add all but the last + // portion into the container array. + if (declaration.name.kind === 127 /* ComputedPropertyName */) { if (!tryAddComputedPropertyName(declaration.name.expression, containers, false)) { return undefined; } } + // Now, walk up our containers, adding all their names to the container array. declaration = ts.getContainerNode(declaration); while (declaration) { if (!tryAddSingleDeclarationName(declaration, containers)) { @@ -25233,8 +29852,13 @@ var ts; } return bestMatchKind; } + // This means "compare in a case insensitive manner." var baseSensitivity = { sensitivity: "base" }; function compareNavigateToItems(i1, i2) { + // TODO(cyrusn): get the gamut of comparisons that VS already uses here. + // Right now we just sort by kind first, and then by name of the item. + // We first sort case insensitively. So "Aaa" will come before "bar". + // Then we sort case sensitively, so "aaa" will come before "Aaa". return i1.matchKind - i2.matchKind || i1.name.localeCompare(i2.name, undefined, baseSensitivity) || i1.name.localeCompare(i2.name); @@ -25250,6 +29874,7 @@ var ts; isCaseSensitive: rawItem.isCaseSensitive, fileName: rawItem.fileName, textSpan: ts.createTextSpanFromBounds(declaration.getStart(), declaration.getEnd()), + // TODO(jfreeman): What should be the containerName when the container has a computed name? containerName: container && container.name ? container.name.text : "", containerKind: container && container.name ? ts.getNodeKind(container) : "" }; @@ -25259,26 +29884,34 @@ var ts; })(NavigateTo = ts.NavigateTo || (ts.NavigateTo = {})); })(ts || (ts = {})); /// +/* @internal */ var ts; (function (ts) { var NavigationBar; (function (NavigationBar) { function getNavigationBarItems(sourceFile) { + // If the source file has any child items, then it included in the tree + // and takes lexical ownership of all other top-level items. var hasGlobalNode = false; return getItemsWorker(getTopLevelNodes(sourceFile), createTopLevelItem); function getIndent(node) { + // If we have a global node in the tree, + // then it adds an extra layer of depth to all subnodes. var indent = hasGlobalNode ? 1 : 0; var current = node.parent; while (current) { switch (current.kind) { - case 205: + case 205 /* ModuleDeclaration */: + // If we have a module declared as A.B.C, it is more "intuitive" + // to say it only has a single layer of depth do { current = current.parent; - } while (current.kind === 205); - case 201: - case 204: - case 202: - case 200: + } while (current.kind === 205 /* ModuleDeclaration */); + // fall through + case 201 /* ClassDeclaration */: + case 204 /* EnumDeclaration */: + case 202 /* InterfaceDeclaration */: + case 200 /* FunctionDeclaration */: indent++; } current = current.parent; @@ -25289,26 +29922,33 @@ var ts; var childNodes = []; function visit(node) { switch (node.kind) { - case 180: + case 180 /* VariableStatement */: ts.forEach(node.declarationList.declarations, visit); break; - case 150: - case 151: + case 150 /* ObjectBindingPattern */: + case 151 /* ArrayBindingPattern */: ts.forEach(node.elements, visit); break; - case 215: + case 215 /* ExportDeclaration */: + // Handle named exports case e.g.: + // export {a, b as B} from "mod"; if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 209: + case 209 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { + // Handle default import case e.g.: + // import d from "mod"; if (importClause.name) { childNodes.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 === 211) { + if (importClause.namedBindings.kind === 211 /* NamespaceImport */) { childNodes.push(importClause.namedBindings); } else { @@ -25317,24 +29957,38 @@ var ts; } } break; - case 152: - case 198: + case 152 /* BindingElement */: + case 198 /* VariableDeclaration */: if (ts.isBindingPattern(node.name)) { visit(node.name); break; } - case 201: - case 204: - case 202: - case 205: - case 200: - case 208: - case 213: - case 217: + // Fall through + case 201 /* ClassDeclaration */: + case 204 /* EnumDeclaration */: + case 202 /* InterfaceDeclaration */: + case 205 /* ModuleDeclaration */: + case 200 /* FunctionDeclaration */: + case 208 /* ImportEqualsDeclaration */: + case 213 /* ImportSpecifier */: + case 217 /* ExportSpecifier */: childNodes.push(node); break; } } + //for (let i = 0, n = nodes.length; i < n; i++) { + // let node = nodes[i]; + // if (node.kind === SyntaxKind.ClassDeclaration || + // node.kind === SyntaxKind.EnumDeclaration || + // node.kind === SyntaxKind.InterfaceDeclaration || + // node.kind === SyntaxKind.ModuleDeclaration || + // node.kind === SyntaxKind.FunctionDeclaration) { + // childNodes.push(node); + // } + // else if (node.kind === SyntaxKind.VariableStatement) { + // childNodes.push.apply(childNodes, (node).declarations); + // } + //} ts.forEach(nodes, visit); return sortNodes(childNodes); } @@ -25365,17 +30019,17 @@ var ts; for (var _i = 0; _i < nodes.length; _i++) { var node = nodes[_i]; switch (node.kind) { - case 201: - case 204: - case 202: + case 201 /* ClassDeclaration */: + case 204 /* EnumDeclaration */: + case 202 /* InterfaceDeclaration */: topLevelNodes.push(node); break; - case 205: + case 205 /* ModuleDeclaration */: var moduleDeclaration = node; topLevelNodes.push(node); addTopLevelNodes(getInnermostModule(moduleDeclaration).body.statements, topLevelNodes); break; - case 200: + case 200 /* FunctionDeclaration */: var functionDeclaration = node; if (isTopLevelFunctionDeclaration(functionDeclaration)) { topLevelNodes.push(node); @@ -25386,11 +30040,16 @@ var ts; } } function isTopLevelFunctionDeclaration(functionDeclaration) { - if (functionDeclaration.kind === 200) { - if (functionDeclaration.body && functionDeclaration.body.kind === 179) { - if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 200 && !isEmpty(s.name.text); })) { + if (functionDeclaration.kind === 200 /* FunctionDeclaration */) { + // A function declaration is 'top level' if it contains any function declarations + // within it. + if (functionDeclaration.body && functionDeclaration.body.kind === 179 /* Block */) { + // Proper function declarations can only have identifier names + if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 200 /* FunctionDeclaration */ && !isEmpty(s.name.text); })) { return true; } + // Or if it is not parented by another function. i.e all functions + // at module scope are 'top level'. if (!ts.isFunctionBlock(functionDeclaration.parent)) { return true; } @@ -25403,17 +30062,18 @@ var ts; var keyToItem = {}; for (var _i = 0; _i < nodes.length; _i++) { var child = nodes[_i]; - 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 item = createItem(child); + if (item !== undefined) { + if (item.text.length > 0) { + var key = item.text + "-" + item.kind + "-" + item.indent; var itemWithSameName = keyToItem[key]; if (itemWithSameName) { - merge(itemWithSameName, item_3); + // We had an item with the same name. Merge these items together. + merge(itemWithSameName, item); } else { - keyToItem[key] = item_3; - items.push(item_3); + keyToItem[key] = item; + items.push(item); } } } @@ -25421,62 +30081,68 @@ var ts; return items; } function merge(target, source) { + // First, add any spans in the source to the target. target.spans.push.apply(target.spans, source.spans); if (source.childItems) { if (!target.childItems) { target.childItems = []; } + // Next, recursively merge or add any children in the source as appropriate. outer: for (var _i = 0, _a = source.childItems; _i < _a.length; _i++) { var sourceChild = _a[_i]; for (var _b = 0, _c = target.childItems; _b < _c.length; _b++) { var targetChild = _c[_b]; if (targetChild.text === sourceChild.text && targetChild.kind === sourceChild.kind) { + // Found a match. merge them. merge(targetChild, sourceChild); continue outer; } } + // Didn't find a match, just add this child to the list. target.childItems.push(sourceChild); } } } function createChildItem(node) { switch (node.kind) { - case 129: + case 129 /* Parameter */: if (ts.isBindingPattern(node.name)) { break; } - if ((node.flags & 499) === 0) { + if ((node.flags & 499 /* Modifier */) === 0) { return undefined; } return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 134: - case 133: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberFunctionElement); - case 136: + case 136 /* GetAccessor */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberGetAccessorElement); - case 137: + case 137 /* SetAccessor */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement); - case 140: + case 140 /* IndexSignature */: return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement); - case 226: + case 226 /* EnumMember */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 138: + case 138 /* CallSignature */: return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); - case 139: + case 139 /* ConstructSignature */: return createItem(node, "new()", ts.ScriptElementKind.constructSignatureElement); - case 132: - case 131: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 200: + case 200 /* FunctionDeclaration */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.functionElement); - case 198: - case 152: + case 198 /* VariableDeclaration */: + case 152 /* BindingElement */: var variableDeclarationNode; - var name_18; - if (node.kind === 152) { - name_18 = node.name; + var name_22; + if (node.kind === 152 /* BindingElement */) { + name_22 = node.name; variableDeclarationNode = node; - while (variableDeclarationNode && variableDeclarationNode.kind !== 198) { + // binding elements are added only for variable declarations + // bubble up to the containing variable declaration + while (variableDeclarationNode && variableDeclarationNode.kind !== 198 /* VariableDeclaration */) { variableDeclarationNode = variableDeclarationNode.parent; } ts.Debug.assert(variableDeclarationNode !== undefined); @@ -25484,24 +30150,24 @@ var ts; else { ts.Debug.assert(!ts.isBindingPattern(node.name)); variableDeclarationNode = node; - name_18 = node.name; + name_22 = node.name; } if (ts.isConst(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_18), ts.ScriptElementKind.constElement); + return createItem(node, getTextOfNode(name_22), ts.ScriptElementKind.constElement); } else if (ts.isLet(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_18), ts.ScriptElementKind.letElement); + return createItem(node, getTextOfNode(name_22), ts.ScriptElementKind.letElement); } else { - return createItem(node, getTextOfNode(name_18), ts.ScriptElementKind.variableElement); + return createItem(node, getTextOfNode(name_22), ts.ScriptElementKind.variableElement); } - case 135: + case 135 /* Constructor */: return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); - case 217: - case 213: - case 208: - case 210: - case 211: + case 217 /* ExportSpecifier */: + case 213 /* ImportSpecifier */: + case 208 /* ImportEqualsDeclaration */: + case 210 /* ImportClause */: + case 211 /* NamespaceImport */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.alias); } return undefined; @@ -25531,27 +30197,29 @@ var ts; } function createTopLevelItem(node) { switch (node.kind) { - case 227: + case 227 /* SourceFile */: return createSourceFileItem(node); - case 201: + case 201 /* ClassDeclaration */: return createClassItem(node); - case 204: + case 204 /* EnumDeclaration */: return createEnumItem(node); - case 202: + case 202 /* InterfaceDeclaration */: return createIterfaceItem(node); - case 205: + case 205 /* ModuleDeclaration */: return createModuleItem(node); - case 200: + case 200 /* FunctionDeclaration */: return createFunctionItem(node); } return undefined; function getModuleName(moduleDeclaration) { - if (moduleDeclaration.name.kind === 8) { + // We want to maintain quotation marks. + if (moduleDeclaration.name.kind === 8 /* StringLiteral */) { return getTextOfNode(moduleDeclaration.name); } + // Otherwise, we need to aggregate each identifier to build up the qualified name. var result = []; result.push(moduleDeclaration.name.text); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 205) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 205 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(moduleDeclaration.name.text); } @@ -25563,9 +30231,9 @@ var ts; return getNavigationBarItem(moduleName, ts.ScriptElementKind.moduleElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } function createFunctionItem(node) { - if ((node.name || node.flags & 256) && node.body && node.body.kind === 179) { + if (node.body && node.body.kind === 179 /* Block */) { var childItems = getItemsWorker(sortNodes(node.body.statements), createChildItem); - return getNavigationBarItem((!node.name && node.flags & 256) ? "default" : node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); + return getNavigationBarItem(!node.name ? "default" : node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } return undefined; } @@ -25584,15 +30252,18 @@ var ts; var childItems; if (node.members) { var constructor = ts.forEach(node.members, function (member) { - return member.kind === 135 && member; + return member.kind === 135 /* Constructor */ && member; }); + // Add the constructor parameters in as children of the class (for property parameters). + // Note that *all non-binding pattern named* parameters will be added to the nodes array, but parameters that + // are not properties will be filtered out later by createChildItem. var nodes = removeDynamicallyNamedProperties(node); if (constructor) { nodes.push.apply(nodes, ts.filter(constructor.parameters, function (p) { return !ts.isBindingPattern(p.name); })); } childItems = getItemsWorker(sortNodes(nodes), createChildItem); } - var nodeName = !node.name && (node.flags & 256) ? "default" : node.name.text; + var nodeName = !node.name ? "default" : node.name.text; return getNavigationBarItem(nodeName, ts.ScriptElementKind.classElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } function createEnumItem(node) { @@ -25605,19 +30276,22 @@ var ts; } } function removeComputedProperties(node) { - return ts.filter(node.members, function (member) { return member.name === undefined || member.name.kind !== 127; }); + return ts.filter(node.members, function (member) { return member.name === undefined || member.name.kind !== 127 /* ComputedPropertyName */; }); } + /** + * Like removeComputedProperties, but retains the properties with well known symbol names + */ function removeDynamicallyNamedProperties(node) { return ts.filter(node.members, function (member) { return !ts.hasDynamicName(member); }); } function getInnermostModule(node) { - while (node.body.kind === 205) { + while (node.body.kind === 205 /* ModuleDeclaration */) { node = node.body; } return node; } function getNodeSpan(node) { - return node.kind === 227 + return node.kind === 227 /* SourceFile */ ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) : ts.createTextSpanFromBounds(node.getStart(), node.getEnd()); } @@ -25628,8 +30302,10 @@ var ts; NavigationBar.getNavigationBarItems = getNavigationBarItems; })(NavigationBar = ts.NavigationBar || (ts.NavigationBar = {})); })(ts || (ts = {})); +/* @internal */ var ts; (function (ts) { + // Note(cyrusn): this enum is ordered from strongest match type to weakest match type. (function (PatternMatchKind) { PatternMatchKind[PatternMatchKind["exact"] = 0] = "exact"; PatternMatchKind[PatternMatchKind["prefix"] = 1] = "prefix"; @@ -25646,6 +30322,10 @@ var ts; }; } function createPatternMatcher(pattern) { + // We'll often see the same candidate string many times when searching (For example, when + // we see the name of a module that is used everywhere, or the name of an overload). As + // such, we cache the information we compute about the candidate for the life of this + // pattern matcher so we don't have to compute it multiple times. var stringToWordSpans = {}; pattern = pattern.trim(); var fullPatternSegment = createSegment(pattern); @@ -25656,6 +30336,7 @@ var ts; getMatchesForLastSegmentOfPattern: getMatchesForLastSegmentOfPattern, patternContainsDots: dotSeparatedSegments.length > 1 }; + // Quick checks so we can bail out when asked to match a candidate. function skipMatch(candidate) { return invalidPattern || !candidate; } @@ -25669,24 +30350,36 @@ var ts; if (skipMatch(candidate)) { return undefined; } + // First, check that the last part of the dot separated pattern matches the name of the + // candidate. If not, then there's no point in proceeding and doing the more + // expensive work. var candidateMatch = matchSegment(candidate, ts.lastOrUndefined(dotSeparatedSegments)); if (!candidateMatch) { return undefined; } candidateContainers = candidateContainers || []; + // -1 because the last part was checked against the name, and only the rest + // of the parts are checked against the container. if (dotSeparatedSegments.length - 1 > candidateContainers.length) { + // There weren't enough container parts to match against the pattern parts. + // So this definitely doesn't match. return undefined; } + // So far so good. Now break up the container for the candidate and check if all + // the dotted parts match up correctly. var totalMatch = candidateMatch; for (var i = dotSeparatedSegments.length - 2, j = candidateContainers.length - 1; i >= 0; i--, j--) { var segment = dotSeparatedSegments[i]; var containerName = candidateContainers[j]; var containerMatch = matchSegment(containerName, segment); if (!containerMatch) { + // This container didn't match the pattern piece. So there's no match at all. return undefined; } ts.addRange(totalMatch, containerMatch); } + // Success, this symbol's full name matched against the dotted name the user was asking + // about. return totalMatch; } function getWordSpans(word) { @@ -25699,30 +30392,46 @@ var ts; var index = indexOfIgnoringCase(candidate, chunk.textLowerCase); if (index === 0) { if (chunk.text.length === candidate.length) { + // a) Check if the part matches the candidate entirely, in an case insensitive or + // sensitive manner. If it does, return that there was an exact match. return createPatternMatch(PatternMatchKind.exact, punctuationStripped, candidate === chunk.text); } else { + // b) Check if the part is a prefix of the candidate, in a case insensitive or sensitive + // manner. If it does, return that there was a prefix match. return createPatternMatch(PatternMatchKind.prefix, punctuationStripped, startsWith(candidate, chunk.text)); } } var isLowercase = chunk.isLowerCase; if (isLowercase) { if (index > 0) { + // c) If the part is entirely lowercase, then check if it is contained anywhere in the + // candidate in a case insensitive manner. If so, return that there was a substring + // match. + // + // Note: We only have a substring match if the lowercase part is prefix match of some + // word part. That way we don't match something like 'Class' when the user types 'a'. + // But we would match 'FooAttribute' (since 'Attribute' starts with 'a'). var wordSpans = getWordSpans(candidate); for (var _i = 0; _i < wordSpans.length; _i++) { var span = wordSpans[_i]; if (partStartsWith(candidate, span, chunk.text, true)) { - return createPatternMatch(PatternMatchKind.substring, punctuationStripped, partStartsWith(candidate, span, chunk.text, false)); + return createPatternMatch(PatternMatchKind.substring, punctuationStripped, + /*isCaseSensitive:*/ partStartsWith(candidate, span, chunk.text, false)); } } } } else { + // d) If the part was not entirely lowercase, then check if it is contained in the + // candidate in a case *sensitive* manner. If so, return that there was a substring + // match. if (candidate.indexOf(chunk.text) > 0) { return createPatternMatch(PatternMatchKind.substring, punctuationStripped, true); } } if (!isLowercase) { + // e) If the part was not entirely lowercase, then attempt a camel cased match as well. if (chunk.characterSpans.length > 0) { var candidateParts = getWordSpans(candidate); var camelCaseWeight = tryCamelCaseMatch(candidate, candidateParts, chunk, false); @@ -25736,6 +30445,12 @@ var ts; } } if (isLowercase) { + // f) Is the pattern a substring of the candidate starting on one of the candidate's word boundaries? + // We could check every character boundary start of the candidate for the pattern. However, that's + // an m * n operation in the wost case. Instead, find the first instance of the pattern + // substring, and see if it starts on a capital letter. It seems unlikely that the user will try to + // filter the list based on a substring that starts on a capital letter and also with a lowercase one. + // (Pattern: fogbar, Candidate: quuxfogbarFogBar). if (chunk.text.length < candidate.length) { if (index > 0 && isUpperCaseLetter(candidate.charCodeAt(index))) { return createPatternMatch(PatternMatchKind.substring, punctuationStripped, false); @@ -25747,23 +30462,67 @@ var ts; function containsSpaceOrAsterisk(text) { for (var i = 0; i < text.length; i++) { var ch = text.charCodeAt(i); - if (ch === 32 || ch === 42) { + if (ch === 32 /* space */ || ch === 42 /* asterisk */) { return true; } } return false; } function matchSegment(candidate, segment) { + // First check if the segment matches as is. This is also useful if the segment contains + // characters we would normally strip when splitting into parts that we also may want to + // match in the candidate. For example if the segment is "@int" and the candidate is + // "@int", then that will show up as an exact match here. + // + // Note: if the segment contains a space or an asterisk then we must assume that it's a + // multi-word segment. if (!containsSpaceOrAsterisk(segment.totalTextChunk.text)) { var match = matchTextChunk(candidate, segment.totalTextChunk, false); if (match) { return [match]; } } + // The logic for pattern matching is now as follows: + // + // 1) Break the segment passed in into words. Breaking is rather simple and a + // good way to think about it that if gives you all the individual alphanumeric words + // of the pattern. + // + // 2) For each word try to match the word against the candidate value. + // + // 3) Matching is as follows: + // + // a) Check if the word matches the candidate entirely, in an case insensitive or + // sensitive manner. If it does, return that there was an exact match. + // + // b) Check if the word is a prefix of the candidate, in a case insensitive or + // sensitive manner. If it does, return that there was a prefix match. + // + // c) If the word is entirely lowercase, then check if it is contained anywhere in the + // candidate in a case insensitive manner. If so, return that there was a substring + // match. + // + // Note: We only have a substring match if the lowercase part is prefix match of + // some word part. That way we don't match something like 'Class' when the user + // types 'a'. But we would match 'FooAttribute' (since 'Attribute' starts with + // 'a'). + // + // d) If the word was not entirely lowercase, then check if it is contained in the + // candidate in a case *sensitive* manner. If so, return that there was a substring + // match. + // + // e) If the word was not entirely lowercase, then attempt a camel cased match as + // well. + // + // f) The word is all lower case. Is it a case insensitive substring of the candidate starting + // on a part boundary of the candidate? + // + // Only if all words have some sort of match is the pattern considered matched. var subWordTextChunks = segment.subWordTextChunks; var matches = undefined; for (var _i = 0; _i < subWordTextChunks.length; _i++) { var subWordTextChunk = subWordTextChunks[_i]; + // Try to match the candidate with this word var result = matchTextChunk(candidate, subWordTextChunk, true); if (!result) { return undefined; @@ -25777,6 +30536,7 @@ var ts; var patternPartStart = patternSpan ? patternSpan.start : 0; var patternPartLength = patternSpan ? patternSpan.length : pattern.length; if (patternPartLength > candidateSpan.length) { + // Pattern part is longer than the candidate part. There can never be a match. return false; } if (ignoreCase) { @@ -25801,29 +30561,45 @@ var ts; } function tryCamelCaseMatch(candidate, candidateParts, chunk, ignoreCase) { var chunkCharacterSpans = chunk.characterSpans; + // Note: we may have more pattern parts than candidate parts. This is because multiple + // pattern parts may match a candidate part. For example "SiUI" against "SimpleUI". + // We'll have 3 pattern parts Si/U/I against two candidate parts Simple/UI. However, U + // and I will both match in UI. var currentCandidate = 0; var currentChunkSpan = 0; var firstMatch = undefined; var contiguous = undefined; while (true) { + // Let's consider our termination cases if (currentChunkSpan === chunkCharacterSpans.length) { + // We did match! We shall assign a weight to this var weight = 0; + // Was this contiguous? if (contiguous) { weight += 1; } + // Did we start at the beginning of the candidate? if (firstMatch === 0) { weight += 2; } return weight; } else if (currentCandidate === candidateParts.length) { + // No match, since we still have more of the pattern to hit return undefined; } var candidatePart = candidateParts[currentCandidate]; var gotOneMatchThisCandidate = false; + // Consider the case of matching SiUI against SimpleUIElement. The candidate parts + // will be Simple/UI/Element, and the pattern parts will be Si/U/I. We'll match 'Si' + // against 'Simple' first. Then we'll match 'U' against 'UI'. However, we want to + // still keep matching pattern parts against that candidate part. for (; currentChunkSpan < chunkCharacterSpans.length; currentChunkSpan++) { var chunkCharacterSpan = chunkCharacterSpans[currentChunkSpan]; if (gotOneMatchThisCandidate) { + // We've already gotten one pattern part match in this candidate. We will + // only continue trying to consumer pattern parts if the last part and this + // part are both upper case. if (!isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan - 1].start)) || !isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan].start))) { break; @@ -25834,17 +30610,30 @@ var ts; } gotOneMatchThisCandidate = true; firstMatch = firstMatch === undefined ? currentCandidate : firstMatch; + // If we were contiguous, then keep that value. If we weren't, then keep that + // value. If we don't know, then set the value to 'true' as an initial match is + // obviously contiguous. contiguous = contiguous === undefined ? true : contiguous; candidatePart = ts.createTextSpan(candidatePart.start + chunkCharacterSpan.length, candidatePart.length - chunkCharacterSpan.length); } + // Check if we matched anything at all. If we didn't, then we need to unset the + // contiguous bit if we currently had it set. + // If we haven't set the bit yet, then that means we haven't matched anything so + // far, and we don't want to change that. if (!gotOneMatchThisCandidate && contiguous !== undefined) { contiguous = false; } + // Move onto the next candidate. currentCandidate++; } } } ts.createPatternMatcher = createPatternMatcher; + // 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 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, match2) { return compareType(match1, match2) || compareCamelCase(match1, match2) || @@ -25852,6 +30641,8 @@ var ts; comparePunctuation(match1, match2); } function comparePunctuation(result1, result2) { + // Consider a match to be better if it was successful without stripping punctuation + // versus a match that had to strip punctuation to succeed. if (result1.punctuationStripped !== result2.punctuationStripped) { return result1.punctuationStripped ? 1 : -1; } @@ -25868,6 +30659,8 @@ var ts; } function compareCamelCase(result1, result2) { if (result1.kind === PatternMatchKind.camelCase && result2.kind === PatternMatchKind.camelCase) { + // Swap the values here. If result1 has a higher weight, then we want it to come + // first. return result2.camelCaseWeight - result1.camelCaseWeight; } return 0; @@ -25878,26 +30671,33 @@ var ts; subWordTextChunks: breakPatternIntoTextChunks(text) }; } + // A segment is considered invalid if we couldn't find any words in it. function segmentIsInvalid(segment) { return segment.subWordTextChunks.length === 0; } function isUpperCaseLetter(ch) { - if (ch >= 65 && ch <= 90) { + // Fast check for the ascii range. + if (ch >= 65 /* A */ && ch <= 90 /* Z */) { return true; } - if (ch < 127 || !ts.isUnicodeIdentifierStart(ch, 2)) { + if (ch < 127 /* maxAsciiCharacter */ || !ts.isUnicodeIdentifierStart(ch, 2 /* Latest */)) { return false; } + // TODO: find a way to determine this for any unicode characters in a + // non-allocating manner. var str = String.fromCharCode(ch); return str === str.toUpperCase(); } function isLowerCaseLetter(ch) { - if (ch >= 97 && ch <= 122) { + // Fast check for the ascii range. + if (ch >= 97 /* a */ && ch <= 122 /* z */) { return true; } - if (ch < 127 || !ts.isUnicodeIdentifierStart(ch, 2)) { + if (ch < 127 /* maxAsciiCharacter */ || !ts.isUnicodeIdentifierStart(ch, 2 /* Latest */)) { return false; } + // TODO: find a way to determine this for any unicode characters in a + // non-allocating manner. var str = String.fromCharCode(ch); return str === str.toLowerCase(); } @@ -25917,6 +30717,7 @@ var ts; } return true; } + // Assumes 'value' is already lowercase. function indexOfIgnoringCase(string, value) { for (var i = 0, n = string.length - value.length; i <= n; i++) { if (startsWithIgnoringCase(string, value, i)) { @@ -25925,6 +30726,7 @@ var ts; } return -1; } + // Assumes 'value' is already lowercase. function startsWithIgnoringCase(string, value, start) { for (var i = 0, n = value.length; i < n; i++) { var ch1 = toLowerCase(string.charCodeAt(i + start)); @@ -25936,19 +30738,23 @@ var ts; return true; } function toLowerCase(ch) { - if (ch >= 65 && ch <= 90) { - return 97 + (ch - 65); + // Fast convert for the ascii range. + if (ch >= 65 /* A */ && ch <= 90 /* Z */) { + return 97 /* a */ + (ch - 65 /* A */); } - if (ch < 127) { + if (ch < 127 /* maxAsciiCharacter */) { return ch; } + // TODO: find a way to compute this for any unicode characters in a + // non-allocating manner. return String.fromCharCode(ch).toLowerCase().charCodeAt(0); } function isDigit(ch) { - return ch >= 48 && ch <= 57; + // TODO(cyrusn): Find a way to support this for unicode digits. + return ch >= 48 /* _0 */ && ch <= 57 /* _9 */; } function isWordChar(ch) { - return isUpperCaseLetter(ch) || isLowerCaseLetter(ch) || isDigit(ch) || ch === 95 || ch === 36; + return isUpperCaseLetter(ch) || isLowerCaseLetter(ch) || isDigit(ch) || ch === 95 /* _ */ || ch === 36 /* $ */; } function breakPatternIntoTextChunks(pattern) { var result = []; @@ -25982,11 +30788,11 @@ var ts; characterSpans: breakIntoCharacterSpans(text) }; } - function breakIntoCharacterSpans(identifier) { + /* @internal */ function breakIntoCharacterSpans(identifier) { return breakIntoSpans(identifier, false); } ts.breakIntoCharacterSpans = breakIntoCharacterSpans; - function breakIntoWordSpans(identifier) { + /* @internal */ function breakIntoWordSpans(identifier) { return breakIntoSpans(identifier, true); } ts.breakIntoWordSpans = breakIntoWordSpans; @@ -26016,29 +30822,29 @@ var ts; } function charIsPunctuation(ch) { switch (ch) { - case 33: - case 34: - case 35: - case 37: - case 38: - case 39: - case 40: - case 41: - case 42: - case 44: - case 45: - case 46: - case 47: - case 58: - case 59: - case 63: - case 64: - case 91: - case 92: - case 93: - case 95: - case 123: - case 125: + case 33 /* exclamation */: + case 34 /* doubleQuote */: + case 35 /* hash */: + case 37 /* percent */: + case 38 /* ampersand */: + case 39 /* singleQuote */: + case 40 /* openParen */: + case 41 /* closeParen */: + case 42 /* asterisk */: + case 44 /* comma */: + case 45 /* minus */: + case 46 /* dot */: + case 47 /* slash */: + case 58 /* colon */: + case 59 /* semicolon */: + case 63 /* question */: + case 64 /* at */: + case 91 /* openBracket */: + case 92 /* backslash */: + case 93 /* closeBracket */: + case 95 /* _ */: + case 123 /* openBrace */: + case 125 /* closeBrace */: return true; } return false; @@ -26046,7 +30852,8 @@ var ts; function isAllPunctuation(identifier, start, end) { for (var i = start; i < end; i++) { var ch = identifier.charCodeAt(i); - if (!charIsPunctuation(ch) || ch === 95 || ch === 36) { + // We don't consider _ or $ as punctuation as there may be things with that name. + if (!charIsPunctuation(ch) || ch === 95 /* _ */ || ch === 36 /* $ */) { return false; } } @@ -26054,11 +30861,25 @@ var ts; } function transitionFromUpperToLower(identifier, word, index, wordStart) { if (word) { + // Cases this supports: + // 1) IDisposable -> I, Disposable + // 2) UIElement -> UI, Element + // 3) HTMLDocument -> HTML, Document + // + // etc. if (index != wordStart && index + 1 < identifier.length) { var currentIsUpper = isUpperCaseLetter(identifier.charCodeAt(index)); var nextIsLower = isLowerCaseLetter(identifier.charCodeAt(index + 1)); if (currentIsUpper && nextIsLower) { + // We have a transition from an upper to a lower letter here. But we only + // want to break if all the letters that preceded are uppercase. i.e. if we + // have "Foo" we don't want to break that into "F, oo". But if we have + // "IFoo" or "UIFoo", then we want to break that into "I, Foo" and "UI, + // Foo". i.e. the last uppercase letter belongs to the lowercase letters + // that follows. Note: this will make the following not split properly: + // "HELLOthere". However, these sorts of names do not show up in .Net + // programs. for (var i = wordStart; i < index; i++) { if (!isUpperCaseLetter(identifier.charCodeAt(i))) { return false; @@ -26073,6 +30894,19 @@ var ts; function transitionFromLowerToUpper(identifier, word, index) { var lastIsUpper = isUpperCaseLetter(identifier.charCodeAt(index - 1)); var currentIsUpper = isUpperCaseLetter(identifier.charCodeAt(index)); + // See if the casing indicates we're starting a new word. Note: if we're breaking on + // words, then just seeing an upper case character isn't enough. Instead, it has to + // be uppercase and the previous character can't be uppercase. + // + // For example, breaking "AddMetadata" on words would make: Add Metadata + // + // on characters would be: A dd M etadata + // + // Break "AM" on words would be: AM + // + // on characters would be: A M + // + // We break the search string on characters. But we break the symbol name on words. var transition = word ? (currentIsUpper && !lastIsUpper) : currentIsUpper; @@ -26080,10 +30914,143 @@ var ts; } })(ts || (ts = {})); /// +/* @internal */ var ts; (function (ts) { var SignatureHelp; (function (SignatureHelp) { + // A partially written generic type expression is not guaranteed to have the correct syntax tree. the expression could be parsed as less than/greater than expression or a comma expression + // or some other combination depending on what the user has typed so far. For the purposes of signature help we need to consider any location after "<" as a possible generic type reference. + // To do this, the method will back parse the expression starting at the position required. it will try to parse the current expression as a generic type expression, if it did succeed it + // will return the generic identifier that started the expression (e.g. "foo" in "foo(#a, b) -> The token introduces a list, and should begin a sig help session + // Case 2: + // fo#o#(a, b)# -> The token is either not associated with a list, or ends a list, so the session should end + // Case 3: + // foo(a#, #b#) -> The token is buried inside a list, and should give sig help + // Find out if 'node' is an argument, a type argument, or neither + if (node.kind === 24 /* LessThanToken */ || + node.kind === 16 /* OpenParenToken */) { + // Find the list that starts right *after* the < or ( token. + // If the user has just opened a list, consider this item 0. var list = getChildListThatStartsWithOpenerToken(callExpression, node, sourceFile); var isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === list.pos; ts.Debug.assert(list !== undefined); return { - kind: isTypeArgList ? 0 : 1, + kind: isTypeArgList ? 0 /* TypeArguments */ : 1 /* CallArguments */, invocation: callExpression, argumentsSpan: getApplicableSpanForArguments(list), argumentIndex: 0, argumentCount: getArgumentCount(list) }; } + // findListItemInfo can return undefined if we are not in parent's argument list + // or type argument list. This includes cases where the cursor is: + // - To the right of the closing paren, non-substitution template, or template tail. + // - Between the type arguments and the arguments (greater than token) + // - On the target of the call (parent.func) + // - On the 'new' keyword in a 'new' expression var listItemInfo = ts.findListItemInfo(node); if (listItemInfo) { var list = listItemInfo.list; @@ -26133,7 +31172,7 @@ var ts; var argumentCount = getArgumentCount(list); ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); return { - kind: isTypeArgList ? 0 : 1, + kind: isTypeArgList ? 0 /* TypeArguments */ : 1 /* CallArguments */, invocation: callExpression, argumentsSpan: getApplicableSpanForArguments(list), argumentIndex: argumentIndex, @@ -26141,24 +31180,27 @@ var ts; }; } } - else if (node.kind === 10 && node.parent.kind === 159) { + else if (node.kind === 10 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 159 /* TaggedTemplateExpression */) { + // Check if we're actually inside the template; + // otherwise we'll fall out and return undefined. if (ts.isInsideTemplateLiteral(node, position)) { return getArgumentListInfoForTemplate(node.parent, 0); } } - else if (node.kind === 11 && node.parent.parent.kind === 159) { + else if (node.kind === 11 /* TemplateHead */ && node.parent.parent.kind === 159 /* TaggedTemplateExpression */) { var templateExpression = node.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 171); + ts.Debug.assert(templateExpression.kind === 171 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex); } - else if (node.parent.kind === 176 && node.parent.parent.parent.kind === 159) { + else if (node.parent.kind === 176 /* TemplateSpan */ && node.parent.parent.parent.kind === 159 /* TaggedTemplateExpression */) { var templateSpan = node.parent; var templateExpression = templateSpan.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 171); - if (node.kind === 13 && !ts.isInsideTemplateLiteral(node, position)) { + ts.Debug.assert(templateExpression.kind === 171 /* TemplateExpression */); + // If we're just after a template tail, don't show signature help. + if (node.kind === 13 /* TemplateTail */ && !ts.isInsideTemplateLiteral(node, position)) { return undefined; } var spanIndex = templateExpression.templateSpans.indexOf(templateSpan); @@ -26168,6 +31210,17 @@ var ts; return undefined; } function getArgumentIndex(argumentsList, node) { + // The list we got back can include commas. In the presence of errors it may + // also just have nodes without commas. For example "Foo(a b c)" will have 3 + // args without commas. We want to find what index we're at. So we count + // forward until we hit ourselves, only incrementing the index if it isn't a + // comma. + // + // Note: the subtlety around trailing commas (in getArgumentCount) does not apply + // here. That's because we're only walking forward until we hit the node we're + // on. In that case, even if we're after the trailing comma, we'll still see + // that trailing comma in the list, and we'll have generated the appropriate + // arg index. var argumentIndex = 0; var listChildren = argumentsList.getChildren(); for (var _i = 0; _i < listChildren.length; _i++) { @@ -26175,21 +31228,45 @@ var ts; if (child === node) { break; } - if (child.kind !== 23) { + if (child.kind !== 23 /* CommaToken */) { argumentIndex++; } } return argumentIndex; } function getArgumentCount(argumentsList) { + // The argument count for a list is normally the number of non-comma children it has. + // For example, if you have "Foo(a,b)" then there will be three children of the arg + // list 'a' '' 'b'. So, in this case the arg count will be 2. However, there + // is a small subtlety. If you have "Foo(a,)", then the child list will just have + // 'a' ''. So, in the case where the last child is a comma, we increase the + // arg count by one to compensate. + // + // Note: this subtlety only applies to the last comma. If you had "Foo(a,," then + // we'll have: 'a' '' '' + // That will give us 2 non-commas. We then add one for the last comma, givin us an + // arg count of 3. var listChildren = argumentsList.getChildren(); - var argumentCount = ts.countWhere(listChildren, function (arg) { return arg.kind !== 23; }); - if (listChildren.length > 0 && ts.lastOrUndefined(listChildren).kind === 23) { + var argumentCount = ts.countWhere(listChildren, function (arg) { return arg.kind !== 23 /* CommaToken */; }); + if (listChildren.length > 0 && ts.lastOrUndefined(listChildren).kind === 23 /* CommaToken */) { argumentCount++; } return argumentCount; } + // spanIndex is either the index for a given template span. + // This does not give appropriate results for a NoSubstitutionTemplateLiteral function getArgumentIndexForTemplatePiece(spanIndex, node) { + // Because the TemplateStringsArray is the first argument, we have to offset each substitution expression by 1. + // There are three cases we can encounter: + // 1. We are precisely in the template literal (argIndex = 0). + // 2. We are in or to the right of the substitution expression (argIndex = spanIndex + 1). + // 3. We are directly to the right of the template literal, but because we look for the token on the left, + // not enough to put us in the substitution expression; we should consider ourselves part of + // the *next* span's expression by offsetting the index (argIndex = (spanIndex + 1) + 1). + // + // Example: f `# abcd $#{# 1 + 1# }# efghi ${ #"#hello"# } # ` + // ^ ^ ^ ^ ^ ^ ^ ^ ^ + // Case: 1 1 3 2 1 3 2 2 1 ts.Debug.assert(position >= node.getStart(), "Assumed 'position' could not occur before node."); if (ts.isTemplateLiteralKind(node.kind)) { if (ts.isInsideTemplateLiteral(node, position)) { @@ -26200,12 +31277,13 @@ var ts; return spanIndex + 1; } function getArgumentListInfoForTemplate(tagExpression, argumentIndex) { - var argumentCount = tagExpression.template.kind === 10 + // argumentCount is either 1 or (numSpans + 1) to account for the template strings array argument. + var argumentCount = tagExpression.template.kind === 10 /* NoSubstitutionTemplateLiteral */ ? 1 : tagExpression.template.templateSpans.length + 1; ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); return { - kind: 2, + kind: 2 /* TaggedTemplateArguments */, invocation: tagExpression, argumentsSpan: getApplicableSpanForTaggedTemplate(tagExpression), argumentIndex: argumentIndex, @@ -26213,6 +31291,14 @@ var ts; }; } function getApplicableSpanForArguments(argumentsList) { + // We use full start and skip trivia on the end because we want to include trivia on + // both sides. For example, + // + // foo( /*comment */ a, b, c /*comment*/ ) + // | | + // + // The applicable span is from the first bar to the second bar (inclusive, + // but not including parentheses) var applicableSpanStart = argumentsList.getFullStart(); var applicableSpanEnd = ts.skipTrivia(sourceFile.text, argumentsList.getEnd(), false); return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); @@ -26221,7 +31307,16 @@ var ts; var template = taggedTemplate.template; var applicableSpanStart = template.getStart(); var applicableSpanEnd = template.getEnd(); - if (template.kind === 171) { + // We need to adjust the end position for the case where the template does not have a tail. + // Otherwise, we will not show signature help past the expression. + // For example, + // + // ` ${ 1 + 1 foo(10) + // | | + // + // This is because a Missing node has no width. However, what we actually want is to include trivia + // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. + if (template.kind === 171 /* TemplateExpression */) { var lastSpan = ts.lastOrUndefined(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, false); @@ -26230,10 +31325,12 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node) { - for (var n = node; n.kind !== 227; n = n.parent) { + for (var n = node; n.kind !== 227 /* SourceFile */; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } + // If the node is not a subspan of its parent, this is a big problem. + // There have been crashes that might be caused by this violation. 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); } @@ -26250,6 +31347,14 @@ var ts; ts.Debug.assert(indexOfOpenerToken >= 0 && children.length > indexOfOpenerToken + 1); return children[indexOfOpenerToken + 1]; } + /** + * The selectedItemIndex could be negative for several reasons. + * 1. There are too many arguments for all of the overloads + * 2. None of the overloads were type compatible + * The solution here is to try to pick the best overload by picking + * either the first one that has an appropriate number of parameters, + * or the one with the most parameters. + */ function selectBestInvalidOverloadIndex(candidates, argumentCount) { var maxParamsSignatureIndex = -1; var maxParams = -1; @@ -26267,11 +31372,11 @@ var ts; } function createSignatureHelpItems(candidates, bestSignature, argumentListInfo) { var applicableSpan = argumentListInfo.argumentsSpan; - var isTypeParameterList = argumentListInfo.kind === 0; + var isTypeParameterList = argumentListInfo.kind === 0 /* TypeArguments */; var invocation = argumentListInfo.invocation; var callTarget = ts.getInvokedExpression(invocation); - var callTargetSymbol = typeInfoResolver.getSymbolAtLocation(callTarget); - var callTargetDisplayParts = callTargetSymbol && ts.symbolToDisplayParts(typeInfoResolver, callTargetSymbol, undefined, undefined); + var callTargetSymbol = typeChecker.getSymbolAtLocation(callTarget); + var callTargetDisplayParts = callTargetSymbol && ts.symbolToDisplayParts(typeChecker, callTargetSymbol, undefined, undefined); var items = ts.map(candidates, function (candidateSignature) { var signatureHelpParameters; var prefixDisplayParts = []; @@ -26280,39 +31385,40 @@ var ts; prefixDisplayParts.push.apply(prefixDisplayParts, callTargetDisplayParts); } if (isTypeParameterList) { - prefixDisplayParts.push(ts.punctuationPart(24)); + prefixDisplayParts.push(ts.punctuationPart(24 /* LessThanToken */)); var typeParameters = candidateSignature.typeParameters; signatureHelpParameters = typeParameters && typeParameters.length > 0 ? ts.map(typeParameters, createSignatureHelpParameterForTypeParameter) : emptyArray; - suffixDisplayParts.push(ts.punctuationPart(25)); + suffixDisplayParts.push(ts.punctuationPart(25 /* GreaterThanToken */)); var parameterParts = ts.mapToDisplayParts(function (writer) { - return typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, invocation); + return typeChecker.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, invocation); }); suffixDisplayParts.push.apply(suffixDisplayParts, parameterParts); } else { var typeParameterParts = ts.mapToDisplayParts(function (writer) { - return typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation); + return typeChecker.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation); }); prefixDisplayParts.push.apply(prefixDisplayParts, typeParameterParts); - prefixDisplayParts.push(ts.punctuationPart(16)); + prefixDisplayParts.push(ts.punctuationPart(16 /* OpenParenToken */)); var parameters = candidateSignature.parameters; signatureHelpParameters = parameters.length > 0 ? ts.map(parameters, createSignatureHelpParameterForParameter) : emptyArray; - suffixDisplayParts.push(ts.punctuationPart(17)); + suffixDisplayParts.push(ts.punctuationPart(17 /* CloseParenToken */)); } var returnTypeParts = ts.mapToDisplayParts(function (writer) { - return typeInfoResolver.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation); + return typeChecker.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation); }); suffixDisplayParts.push.apply(suffixDisplayParts, returnTypeParts); return { isVariadic: candidateSignature.hasRestParameter, prefixDisplayParts: prefixDisplayParts, suffixDisplayParts: suffixDisplayParts, - separatorDisplayParts: [ts.punctuationPart(23), ts.spacePart()], + separatorDisplayParts: [ts.punctuationPart(23 /* CommaToken */), ts.spacePart()], parameters: signatureHelpParameters, documentation: candidateSignature.getDocumentationComment() }; }); var argumentIndex = argumentListInfo.argumentIndex; + // argumentCount is the *apparent* number of arguments. var argumentCount = argumentListInfo.argumentCount; var selectedItemIndex = candidates.indexOf(bestSignature); if (selectedItemIndex < 0) { @@ -26328,7 +31434,7 @@ var ts; }; function createSignatureHelpParameterForParameter(parameter) { var displayParts = ts.mapToDisplayParts(function (writer) { - return typeInfoResolver.getSymbolDisplayBuilder().buildParameterDisplay(parameter, writer, invocation); + return typeChecker.getSymbolDisplayBuilder().buildParameterDisplay(parameter, writer, invocation); }); var isOptional = ts.hasQuestionToken(parameter.valueDeclaration); return { @@ -26340,7 +31446,7 @@ var ts; } function createSignatureHelpParameterForTypeParameter(typeParameter) { var displayParts = ts.mapToDisplayParts(function (writer) { - return typeInfoResolver.getSymbolDisplayBuilder().buildTypeParameterDisplay(typeParameter, writer, invocation); + return typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(typeParameter, writer, invocation); }); return { name: typeParameter.symbol.name, @@ -26354,6 +31460,8 @@ var ts; SignatureHelp.getSignatureHelpItems = getSignatureHelpItems; })(SignatureHelp = ts.SignatureHelp || (ts.SignatureHelp = {})); })(ts || (ts = {})); +// These utilities are common to multiple language service features. +/* @internal */ var ts; (function (ts) { function getEndLinePosition(line, sourceFile) { @@ -26361,12 +31469,19 @@ var ts; var lineStarts = sourceFile.getLineStarts(); var lineIndex = line; if (lineIndex + 1 === lineStarts.length) { + // last line - return EOF return sourceFile.text.length - 1; } else { + // current line start var start = lineStarts[lineIndex]; + // take the start position of the next line -1 = it should be some line break var pos = lineStarts[lineIndex + 1] - 1; ts.Debug.assert(ts.isLineBreak(sourceFile.text.charCodeAt(pos))); + // walk backwards skipping line breaks, stop the the beginning of current line. + // i.e: + // + // $ <- end of line for this position should match the start position while (start <= pos && ts.isLineBreak(sourceFile.text.charCodeAt(pos))) { pos--; } @@ -26411,107 +31526,116 @@ var ts; 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: + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + case 204 /* EnumDeclaration */: + case 154 /* ObjectLiteralExpression */: + case 150 /* ObjectBindingPattern */: + case 145 /* TypeLiteral */: + case 179 /* Block */: + case 206 /* ModuleBlock */: + case 207 /* CaseBlock */: + return nodeEndsWith(n, 15 /* CloseBraceToken */, sourceFile); + case 223 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 158: + case 158 /* NewExpression */: if (!n.arguments) { return true; } - case 157: - case 161: - case 149: - return nodeEndsWith(n, 17, sourceFile); - case 142: - case 143: + // fall through + case 157 /* CallExpression */: + case 161 /* ParenthesizedExpression */: + case 149 /* ParenthesizedType */: + return nodeEndsWith(n, 17 /* CloseParenToken */, sourceFile); + case 142 /* FunctionType */: + case 143 /* ConstructorType */: 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: + case 135 /* Constructor */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 139 /* ConstructSignature */: + case 138 /* CallSignature */: + case 163 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } if (n.type) { return isCompletedNode(n.type, sourceFile); } - return hasChildOfKind(n, 17, sourceFile); - case 205: + // Even though type parameters can be unclosed, we can get away with + // having at least a closing paren. + return hasChildOfKind(n, 17 /* CloseParenToken */, sourceFile); + case 205 /* ModuleDeclaration */: return n.body && isCompletedNode(n.body, sourceFile); - case 183: + case 183 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 182: + case 182 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile); - case 153: - case 151: - case 156: - case 127: - case 147: - return nodeEndsWith(n, 19, sourceFile); - case 140: + case 153 /* ArrayLiteralExpression */: + case 151 /* ArrayBindingPattern */: + case 156 /* ElementAccessExpression */: + case 127 /* ComputedPropertyName */: + case 147 /* TupleType */: + return nodeEndsWith(n, 19 /* CloseBracketToken */, sourceFile); + case 140 /* IndexSignature */: if (n.type) { return isCompletedNode(n.type, sourceFile); } - return hasChildOfKind(n, 19, sourceFile); - case 220: - case 221: + return hasChildOfKind(n, 19 /* CloseBracketToken */, sourceFile); + case 220 /* CaseClause */: + case 221 /* DefaultClause */: + // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicitly always consider them non-completed return false; - case 186: - case 187: - case 188: - case 185: + case 186 /* ForStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: + case 185 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 184: - var hasWhileKeyword = findChildOfKind(n, 100, sourceFile); + case 184 /* DoStatement */: + // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; + var hasWhileKeyword = findChildOfKind(n, 100 /* WhileKeyword */, sourceFile); if (hasWhileKeyword) { - return nodeEndsWith(n, 17, sourceFile); + return nodeEndsWith(n, 17 /* CloseParenToken */, sourceFile); } return isCompletedNode(n.statement, sourceFile); - case 144: + case 144 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 165: - case 164: - case 166: - case 172: - case 173: + case 165 /* TypeOfExpression */: + case 164 /* DeleteExpression */: + case 166 /* VoidExpression */: + case 172 /* YieldExpression */: + case 173 /* SpreadElementExpression */: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 159: + case 159 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 171: + case 171 /* TemplateExpression */: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 176: + case 176 /* TemplateSpan */: return ts.nodeIsPresent(n.literal); - case 167: + case 167 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 169: + case 169 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 170: + case 170 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; } } ts.isCompletedNode = isCompletedNode; + /* + * Checks if node ends with 'expectedLastToken'. + * If child at position 'length - 1' is 'SemicolonToken' it is skipped and 'expectedLastToken' is compared with child at position 'length - 2'. + */ function nodeEndsWith(n, expectedLastToken, sourceFile) { var children = n.getChildren(sourceFile); if (children.length) { @@ -26519,7 +31643,7 @@ var ts; if (last.kind === expectedLastToken) { return true; } - else if (last.kind === 22 && children.length !== 1) { + else if (last.kind === 22 /* SemicolonToken */ && children.length !== 1) { return children[children.length - 2].kind === expectedLastToken; } } @@ -26527,6 +31651,10 @@ var ts; } function findListItemInfo(node) { var list = findContainingList(node); + // It is possible at this point for syntaxList to be undefined, either if + // node.parent had no list child, or if none of its list children contained + // the span of node. If this happens, return undefined. The caller should + // handle this case. if (!list) { return undefined; } @@ -26547,43 +31675,60 @@ var ts; } ts.findChildOfKind = findChildOfKind; function findContainingList(node) { + // The node might be a list element (nonsynthetic) or a comma (synthetic). Either way, it will + // be parented by the container of the SyntaxList, not the SyntaxList itself. + // In order to find the list item index, we first need to locate SyntaxList itself and then search + // for the position of the relevant node (or comma). var syntaxList = ts.forEach(node.parent.getChildren(), function (c) { - if (c.kind === 228 && c.pos <= node.pos && c.end >= node.end) { + // find syntax list that covers the span of the node + if (c.kind === 228 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { return c; } }); + // Either we didn't find an appropriate list, or the list must contain us. ts.Debug.assert(!syntaxList || ts.contains(syntaxList.getChildren(), node)); return syntaxList; } ts.findContainingList = findContainingList; + /* Gets the token whose text has range [start, end) and + * position >= start and (position < end or (position === end && token is keyword or identifier)) + */ function getTouchingWord(sourceFile, position) { return getTouchingToken(sourceFile, position, function (n) { return isWord(n.kind); }); } ts.getTouchingWord = getTouchingWord; + /* Gets the token whose text has range [start, end) and position >= start + * and (position < end or (position === end && token is keyword or identifier or numeric\string litera)) + */ function getTouchingPropertyName(sourceFile, position) { return getTouchingToken(sourceFile, position, function (n) { return isPropertyName(n.kind); }); } ts.getTouchingPropertyName = getTouchingPropertyName; + /** Returns the token if position is in [start, end) or if position === end and includeItemAtEndPosition(token) === true */ function getTouchingToken(sourceFile, position, includeItemAtEndPosition) { return getTokenAtPositionWorker(sourceFile, position, false, includeItemAtEndPosition); } ts.getTouchingToken = getTouchingToken; + /** Returns a token if position is in [start-of-leading-trivia, end) */ function getTokenAtPosition(sourceFile, position) { return getTokenAtPositionWorker(sourceFile, position, true, undefined); } ts.getTokenAtPosition = getTokenAtPosition; + /** Get the token whose text contains the position */ function getTokenAtPositionWorker(sourceFile, position, allowPositionInLeadingTrivia, includeItemAtEndPosition) { var current = sourceFile; outer: while (true) { if (isToken(current)) { + // exit early return current; } + // find the child that contains 'position' for (var i = 0, n = current.getChildCount(sourceFile); i < n; i++) { var child = current.getChildAt(i); var start = allowPositionInLeadingTrivia ? child.getFullStart() : child.getStart(sourceFile); if (start <= position) { var end = child.getEnd(); - if (position < end || (position === end && child.kind === 1)) { + if (position < end || (position === end && child.kind === 1 /* EndOfFileToken */)) { current = child; continue outer; } @@ -26598,7 +31743,17 @@ var ts; return current; } } + /** + * The token on the left of the position is the token that strictly includes the position + * or sits to the left of the cursor if it is on a boundary. For example + * + * fo|o -> will return foo + * foo |bar -> will return foo + * + */ function findTokenOnLeftOfPosition(file, position) { + // Ideally, getTokenAtPosition should return a token. However, it is currently + // broken, so we do a check to make sure the result was indeed a token. var tokenAtPosition = getTokenAtPosition(file, position); if (isToken(tokenAtPosition) && position > tokenAtPosition.getStart(file) && position < tokenAtPosition.getEnd()) { return tokenAtPosition; @@ -26610,12 +31765,16 @@ var ts; return find(parent); function find(n) { if (isToken(n) && n.pos === previousToken.end) { + // this is token that starts at the end of previous token - return it return n; } var children = n.getChildren(); for (var _i = 0; _i < children.length; _i++) { var child = children[_i]; - var shouldDiveInChildNode = (child.pos <= previousToken.pos && child.end > previousToken.end) || + var shouldDiveInChildNode = + // previous token is enclosed somewhere in the child + (child.pos <= previousToken.pos && child.end > previousToken.end) || + // previous token ends exactly at the beginning of child (child.pos === previousToken.end); if (shouldDiveInChildNode && nodeHasTokens(child)) { return find(child); @@ -26645,21 +31804,28 @@ var ts; if (nodeHasTokens(child)) { if (position <= child.end) { if (child.getStart(sourceFile) >= position) { + // actual start of the node is past the position - previous token should be at the end of previous child var candidate = findRightmostChildNodeWithTokens(children, i); return candidate && findRightmostToken(candidate); } else { + // candidate should be in this node return find(child); } } } } - ts.Debug.assert(startNode !== undefined || n.kind === 227); + ts.Debug.assert(startNode !== undefined || n.kind === 227 /* SourceFile */); + // Here we know that none of child token nodes embrace the position, + // the only known case is when position is at the end of the file. + // Try to find the rightmost token in the file without filtering. + // Namely we are skipping the check: 'position < node.end' if (children.length) { var candidate = findRightmostChildNodeWithTokens(children, children.length); return candidate && findRightmostToken(candidate); } } + /// finds last node that is considered as candidate for search (isCandidate(node) === true) starting from 'exclusiveStartPosition' function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) { for (var i = exclusiveStartPosition - 1; i >= 0; --i) { if (nodeHasTokens(children[i])) { @@ -26670,20 +31836,22 @@ var ts; } ts.findPrecedingToken = findPrecedingToken; function nodeHasTokens(n) { + // If we have a token or node that has a non-zero width, it must have tokens. + // Note, that getWidth() does not take trivia into account. return n.getWidth() !== 0; } function getNodeModifiers(node) { var flags = ts.getCombinedNodeFlags(node); var result = []; - if (flags & 32) + if (flags & 32 /* Private */) result.push(ts.ScriptElementKindModifier.privateMemberModifier); - if (flags & 64) + if (flags & 64 /* Protected */) result.push(ts.ScriptElementKindModifier.protectedMemberModifier); - if (flags & 16) + if (flags & 16 /* Public */) result.push(ts.ScriptElementKindModifier.publicMemberModifier); - if (flags & 128) + if (flags & 128 /* Static */) result.push(ts.ScriptElementKindModifier.staticModifier); - if (flags & 1) + if (flags & 1 /* Export */) result.push(ts.ScriptElementKindModifier.exportedModifier); if (ts.isInAmbientContext(node)) result.push(ts.ScriptElementKindModifier.ambientModifier); @@ -26691,32 +31859,32 @@ var ts; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 141 || node.kind === 157) { + if (node.kind === 141 /* TypeReference */ || node.kind === 157 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 201 || node.kind === 202) { + if (ts.isFunctionLike(node) || node.kind === 201 /* ClassDeclaration */ || node.kind === 202 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; } ts.getTypeArgumentOrTypeParameterList = getTypeArgumentOrTypeParameterList; function isToken(n) { - return n.kind >= 0 && n.kind <= 125; + return n.kind >= 0 /* FirstToken */ && n.kind <= 125 /* LastToken */; } ts.isToken = isToken; function isWord(kind) { - return kind === 65 || ts.isKeyword(kind); + return kind === 65 /* Identifier */ || ts.isKeyword(kind); } ts.isWord = isWord; function isPropertyName(kind) { - return kind === 8 || kind === 7 || isWord(kind); + return kind === 8 /* StringLiteral */ || kind === 7 /* NumericLiteral */ || isWord(kind); } function isComment(kind) { - return kind === 2 || kind === 3; + return kind === 2 /* SingleLineCommentTrivia */ || kind === 3 /* MultiLineCommentTrivia */; } ts.isComment = isComment; function isPunctuation(kind) { - return 14 <= kind && kind <= 64; + return 14 /* FirstPunctuation */ <= kind && kind <= 64 /* LastPunctuation */; } ts.isPunctuation = isPunctuation; function isInsideTemplateLiteral(node, position) { @@ -26726,9 +31894,9 @@ var ts; ts.isInsideTemplateLiteral = isInsideTemplateLiteral; function isAccessibilityModifier(kind) { switch (kind) { - case 109: - case 107: - case 108: + case 108 /* PublicKeyword */: + case 106 /* PrivateKeyword */: + case 107 /* ProtectedKeyword */: return true; } return false; @@ -26751,10 +31919,12 @@ var ts; } ts.compareDataObjects = compareDataObjects; })(ts || (ts = {})); +// Display-part writer helpers +/* @internal */ var ts; (function (ts) { function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 129; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 129 /* Parameter */; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -26809,46 +31979,46 @@ var ts; return displayPart(text, displayPartKind(symbol), symbol); function displayPartKind(symbol) { var flags = symbol.flags; - if (flags & 3) { + if (flags & 3 /* Variable */) { return isFirstDeclarationOfSymbolParameter(symbol) ? ts.SymbolDisplayPartKind.parameterName : ts.SymbolDisplayPartKind.localName; } - else if (flags & 4) { + else if (flags & 4 /* Property */) { return ts.SymbolDisplayPartKind.propertyName; } - else if (flags & 32768) { + else if (flags & 32768 /* GetAccessor */) { return ts.SymbolDisplayPartKind.propertyName; } - else if (flags & 65536) { + else if (flags & 65536 /* SetAccessor */) { return ts.SymbolDisplayPartKind.propertyName; } - else if (flags & 8) { + else if (flags & 8 /* EnumMember */) { return ts.SymbolDisplayPartKind.enumMemberName; } - else if (flags & 16) { + else if (flags & 16 /* Function */) { return ts.SymbolDisplayPartKind.functionName; } - else if (flags & 32) { + else if (flags & 32 /* Class */) { return ts.SymbolDisplayPartKind.className; } - else if (flags & 64) { + else if (flags & 64 /* Interface */) { return ts.SymbolDisplayPartKind.interfaceName; } - else if (flags & 384) { + else if (flags & 384 /* Enum */) { return ts.SymbolDisplayPartKind.enumName; } - else if (flags & 1536) { + else if (flags & 1536 /* Module */) { return ts.SymbolDisplayPartKind.moduleName; } - else if (flags & 8192) { + else if (flags & 8192 /* Method */) { return ts.SymbolDisplayPartKind.methodName; } - else if (flags & 262144) { + else if (flags & 262144 /* TypeParameter */) { return ts.SymbolDisplayPartKind.typeParameterName; } - else if (flags & 524288) { + else if (flags & 524288 /* TypeAlias */) { return ts.SymbolDisplayPartKind.aliasName; } - else if (flags & 8388608) { + else if (flags & 8388608 /* Alias */) { return ts.SymbolDisplayPartKind.aliasName; } return ts.SymbolDisplayPartKind.text; @@ -26918,14 +32088,19 @@ var ts; }); } ts.signatureToDisplayParts = signatureToDisplayParts; + function isJavaScript(fileName) { + return ts.fileExtensionIs(fileName, ".js"); + } + ts.isJavaScript = isJavaScript; })(ts || (ts = {})); /// /// +/* @internal */ var ts; (function (ts) { var formatting; (function (formatting) { - var scanner = ts.createScanner(2, false); + var scanner = ts.createScanner(2 /* Latest */, false); var ScanAction; (function (ScanAction) { ScanAction[ScanAction["Scan"] = 0] = "Scan"; @@ -26958,7 +32133,7 @@ var ts; if (isStarted) { if (trailingTrivia) { ts.Debug.assert(trailingTrivia.length !== 0); - wasNewLine = trailingTrivia[trailingTrivia.length - 1].kind === 4; + wasNewLine = trailingTrivia[trailingTrivia.length - 1].kind === 4 /* NewLineTrivia */; } else { wasNewLine = false; @@ -26971,13 +32146,15 @@ var ts; } var t; var pos = scanner.getStartPos(); + // Read leading trivia and token while (pos < endPos) { var t_2 = scanner.getToken(); if (!ts.isTrivia(t_2)) { break; } + // consume leading trivia scanner.scan(); - var item_4 = { + var item = { pos: pos, end: scanner.getStartPos(), kind: t_2 @@ -26986,79 +32163,90 @@ var ts; if (!leadingTrivia) { leadingTrivia = []; } - leadingTrivia.push(item_4); + leadingTrivia.push(item); } savedPos = scanner.getStartPos(); } function shouldRescanGreaterThanToken(node) { if (node) { switch (node.kind) { - case 27: - case 60: - case 61: - case 42: - case 41: + case 27 /* GreaterThanEqualsToken */: + case 60 /* GreaterThanGreaterThanEqualsToken */: + case 61 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 42 /* GreaterThanGreaterThanGreaterThanToken */: + case 41 /* GreaterThanGreaterThanToken */: return true; } } return false; } function shouldRescanSlashToken(container) { - return container.kind === 9; + return container.kind === 9 /* RegularExpressionLiteral */; } function shouldRescanTemplateToken(container) { - return container.kind === 12 || - container.kind === 13; + return container.kind === 12 /* TemplateMiddle */ || + container.kind === 13 /* TemplateTail */; } function startsWithSlashToken(t) { - return t === 36 || t === 57; + return t === 36 /* SlashToken */ || t === 57 /* SlashEqualsToken */; } function readTokenInfo(n) { if (!isOnToken()) { + // scanner is not on the token (either advance was not called yet or scanner is already past the end position) return { leadingTrivia: leadingTrivia, trailingTrivia: undefined, token: undefined }; } + // normally scanner returns the smallest available token + // check the kind of context node to determine if scanner should have more greedy behavior and consume more text. var expectedScanAction = shouldRescanGreaterThanToken(n) - ? 1 + ? 1 /* RescanGreaterThanToken */ : shouldRescanSlashToken(n) - ? 2 + ? 2 /* RescanSlashToken */ : shouldRescanTemplateToken(n) - ? 3 - : 0; + ? 3 /* RescanTemplateToken */ + : 0 /* Scan */; if (lastTokenInfo && expectedScanAction === lastScanAction) { + // readTokenInfo was called before with the same expected scan action. + // No need to re-scan text, return existing 'lastTokenInfo' + // it is ok to call fixTokenKind here since it does not affect + // what portion of text is consumed. In opposize rescanning can change it, + // i.e. for '>=' when originally scanner eats just one character + // and rescanning forces it to consume more. return fixTokenKind(lastTokenInfo, n); } if (scanner.getStartPos() !== savedPos) { ts.Debug.assert(lastTokenInfo !== undefined); + // readTokenInfo was called before but scan action differs - rescan text scanner.setTextPos(savedPos); scanner.scan(); } var currentToken = scanner.getToken(); - if (expectedScanAction === 1 && currentToken === 25) { + if (expectedScanAction === 1 /* RescanGreaterThanToken */ && currentToken === 25 /* GreaterThanToken */) { currentToken = scanner.reScanGreaterToken(); ts.Debug.assert(n.kind === currentToken); - lastScanAction = 1; + lastScanAction = 1 /* RescanGreaterThanToken */; } - else if (expectedScanAction === 2 && startsWithSlashToken(currentToken)) { + else if (expectedScanAction === 2 /* RescanSlashToken */ && startsWithSlashToken(currentToken)) { currentToken = scanner.reScanSlashToken(); ts.Debug.assert(n.kind === currentToken); - lastScanAction = 2; + lastScanAction = 2 /* RescanSlashToken */; } - else if (expectedScanAction === 3 && currentToken === 15) { + else if (expectedScanAction === 3 /* RescanTemplateToken */ && currentToken === 15 /* CloseBraceToken */) { currentToken = scanner.reScanTemplateToken(); - lastScanAction = 3; + lastScanAction = 3 /* RescanTemplateToken */; } else { - lastScanAction = 0; + lastScanAction = 0 /* Scan */; } var token = { pos: scanner.getStartPos(), end: scanner.getTextPos(), kind: currentToken }; + // consume trailing trivia if (trailingTrivia) { trailingTrivia = undefined; } @@ -27076,7 +32264,8 @@ var ts; trailingTrivia = []; } trailingTrivia.push(trivia); - if (currentToken === 4) { + if (currentToken === 4 /* NewLineTrivia */) { + // move past new line scanner.scan(); break; } @@ -27091,8 +32280,12 @@ 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); + return startPos < endPos && current !== 1 /* EndOfFileToken */ && !ts.isTrivia(current); } + // when containing node in the tree is token + // but its kind differs from the kind that was returned by the scanner, + // then kind needs to be fixed. This might happen in cases + // when parser interprets token differently, i.e keyword treated as identifier function fixTokenKind(tokenInfo, container) { if (ts.isToken(container) && tokenInfo.token.kind !== container.kind) { tokenInfo.token.kind = container.kind; @@ -27103,21 +32296,8 @@ 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. -// /// +/* @internal */ var ts; (function (ts) { var formatting; @@ -27138,6 +32318,7 @@ var ts; this.nextTokenSpan = nextRange; this.nextTokenParent = nextTokenParent; this.contextNode = commonParent; + // drop cached results this.contextNodeAllOnSameLine = undefined; this.nextNodeAllOnSameLine = undefined; this.tokensAreOnSameLine = undefined; @@ -27182,8 +32363,8 @@ var ts; return startLine == endLine; }; FormattingContext.prototype.BlockIsOnOneLine = function (node) { - var openBrace = ts.findChildOfKind(node, 14, this.sourceFile); - var closeBrace = ts.findChildOfKind(node, 15, this.sourceFile); + var openBrace = ts.findChildOfKind(node, 14 /* OpenBraceToken */, this.sourceFile); + var closeBrace = ts.findChildOfKind(node, 15 /* CloseBraceToken */, this.sourceFile); if (openBrace && closeBrace) { var startLine = this.sourceFile.getLineAndCharacterOfPosition(openBrace.getEnd()).line; var endLine = this.sourceFile.getLineAndCharacterOfPosition(closeBrace.getStart(this.sourceFile)).line; @@ -27196,21 +32377,8 @@ 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. -// /// +/* @internal */ var ts; (function (ts) { var formatting; @@ -27225,28 +32393,15 @@ 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. -// /// +/* @internal */ var ts; (function (ts) { var formatting; (function (formatting) { var Rule = (function () { function Rule(Descriptor, Operation, Flag) { - if (Flag === void 0) { Flag = 0; } + if (Flag === void 0) { Flag = 0 /* None */; } this.Descriptor = Descriptor; this.Operation = Operation; this.Flag = Flag; @@ -27261,21 +32416,8 @@ 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. -// /// +/* @internal */ var ts; (function (ts) { var formatting; @@ -27289,21 +32431,8 @@ 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. -// /// +/* @internal */ var ts; (function (ts) { var formatting; @@ -27334,21 +32463,8 @@ 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. -// /// +/* @internal */ var ts; (function (ts) { var formatting; @@ -27360,21 +32476,8 @@ 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. -// /// +/* @internal */ var ts; (function (ts) { var formatting; @@ -27402,21 +32505,8 @@ 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. -// /// +/* @internal */ var ts; (function (ts) { var formatting; @@ -27450,21 +32540,8 @@ 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. -// /// +/* @internal */ var ts; (function (ts) { var formatting; @@ -27474,74 +32551,113 @@ var ts; /// /// 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)); - this.NoSpaceBeforeColon = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 51), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8)); - this.NoSpaceBeforeQuestionMark = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 50), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8)); - this.SpaceAfterColon = new formatting.Rule(formatting.RuleDescriptor.create3(51, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 2)); - this.SpaceAfterQuestionMarkInConditionalOperator = new formatting.Rule(formatting.RuleDescriptor.create3(50, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsConditionalOperatorContext), 2)); - 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, 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)); - this.NoSpaceBeforeOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.NoSpaceAfterOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create3(18, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.NoSpaceBeforeCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 19), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.NoSpaceAfterCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create3(19, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); + // Leave comments alone + this.IgnoreBeforeComment = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.Comments), formatting.RuleOperation.create1(1 /* Ignore */)); + this.IgnoreAfterLineComment = new formatting.Rule(formatting.RuleDescriptor.create3(2 /* SingleLineCommentTrivia */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create1(1 /* Ignore */)); + // Space after keyword but not before ; or : or ? + this.NoSpaceBeforeSemicolon = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 22 /* SemicolonToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeColon = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 51 /* ColonToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8 /* Delete */)); + this.NoSpaceBeforeQuestionMark = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 50 /* QuestionToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8 /* Delete */)); + this.SpaceAfterColon = new formatting.Rule(formatting.RuleDescriptor.create3(51 /* ColonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 2 /* Space */)); + this.SpaceAfterQuestionMarkInConditionalOperator = new formatting.Rule(formatting.RuleDescriptor.create3(50 /* QuestionToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsConditionalOperatorContext), 2 /* Space */)); + this.NoSpaceAfterQuestionMark = new formatting.Rule(formatting.RuleDescriptor.create3(50 /* QuestionToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.SpaceAfterSemicolon = new formatting.Rule(formatting.RuleDescriptor.create3(22 /* SemicolonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + // Space after }. + this.SpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(15 /* CloseBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsAfterCodeBlockContext), 2 /* Space */)); + // Special case for (}, else) and (}, while) since else & while tokens are not part of the tree which makes SpaceAfterCloseBrace rule not applied + this.SpaceBetweenCloseBraceAndElse = new formatting.Rule(formatting.RuleDescriptor.create1(15 /* CloseBraceToken */, 76 /* ElseKeyword */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.SpaceBetweenCloseBraceAndWhile = new formatting.Rule(formatting.RuleDescriptor.create1(15 /* CloseBraceToken */, 100 /* WhileKeyword */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(15 /* CloseBraceToken */, formatting.Shared.TokenRange.FromTokens([17 /* CloseParenToken */, 19 /* CloseBracketToken */, 23 /* CommaToken */, 22 /* SemicolonToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + // No space for indexer and dot + this.NoSpaceBeforeDot = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20 /* DotToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterDot = new formatting.Rule(formatting.RuleDescriptor.create3(20 /* DotToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18 /* OpenBracketToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create3(18 /* OpenBracketToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 19 /* CloseBracketToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create3(19 /* CloseBracketToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + // Place a space before open brace in a function declaration 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([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, 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)); - this.NoSpaceBetweenEmptyBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(14, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectContext), 8)); - this.NewLineAfterOpenBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create3(14, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4)); - this.NewLineBeforeCloseBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.AnyIncludingMultilineComments, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4)); - this.NoSpaceAfterUnaryPrefixOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.UnaryPrefixOperators, formatting.Shared.TokenRange.UnaryPrefixExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8)); - this.NoSpaceAfterUnaryPreincrementOperator = new formatting.Rule(formatting.RuleDescriptor.create3(38, formatting.Shared.TokenRange.UnaryPreincrementExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.NoSpaceAfterUnaryPredecrementOperator = new formatting.Rule(formatting.RuleDescriptor.create3(39, formatting.Shared.TokenRange.UnaryPredecrementExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.NoSpaceBeforeUnaryPostincrementOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.UnaryPostincrementExpressions, 38), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.NoSpaceBeforeUnaryPostdecrementOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.UnaryPostdecrementExpressions, 39), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceAfterPostincrementWhenFollowedByAdd = new formatting.Rule(formatting.RuleDescriptor.create1(38, 33), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); - this.SpaceAfterAddWhenFollowedByUnaryPlus = new formatting.Rule(formatting.RuleDescriptor.create1(33, 33), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); - this.SpaceAfterAddWhenFollowedByPreincrement = new formatting.Rule(formatting.RuleDescriptor.create1(33, 38), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); - this.SpaceAfterPostdecrementWhenFollowedBySubtract = new formatting.Rule(formatting.RuleDescriptor.create1(39, 34), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); - 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([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(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(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(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, 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)); - this.NoSpaceAfterOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(24, formatting.Shared.TokenRange.TypeNames), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); - this.NoSpaceBeforeCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 25), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); - this.NoSpaceAfterCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(25, formatting.Shared.TokenRange.FromTokens([16, 18, 25, 23])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8)); - this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(14, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectTypeContext), 8)); + this.SpaceBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2 /* Space */), 1 /* CanDeleteNewLines */); + // Place a space before open brace in a TypeScript declaration that has braces as children (class, module, enum, etc) + this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([65 /* Identifier */, 3 /* MultiLineCommentTrivia */]); + this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2 /* Space */), 1 /* CanDeleteNewLines */); + // Place a space before open brace in a control flow construct + this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([17 /* CloseParenToken */, 3 /* MultiLineCommentTrivia */, 75 /* DoKeyword */, 96 /* TryKeyword */, 81 /* FinallyKeyword */, 76 /* ElseKeyword */]); + this.SpaceBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2 /* Space */), 1 /* CanDeleteNewLines */); + // Insert a space after { and before } in single-line contexts, but remove space from empty object literals {}. + this.SpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(14 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2 /* Space */)); + this.SpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 15 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2 /* Space */)); + this.NoSpaceBetweenEmptyBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(14 /* OpenBraceToken */, 15 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectContext), 8 /* Delete */)); + // Insert new line after { and before } in multi-line contexts. + this.NewLineAfterOpenBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create3(14 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4 /* NewLine */)); + // For functions and control block place } on a new line [multi-line rule] + this.NewLineBeforeCloseBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.AnyIncludingMultilineComments, 15 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4 /* NewLine */)); + // Special handling of unary operators. + // Prefix operators generally shouldn't have a space between + // them and their target unary expression. + this.NoSpaceAfterUnaryPrefixOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.UnaryPrefixOperators, formatting.Shared.TokenRange.UnaryPrefixExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8 /* Delete */)); + this.NoSpaceAfterUnaryPreincrementOperator = new formatting.Rule(formatting.RuleDescriptor.create3(38 /* PlusPlusToken */, formatting.Shared.TokenRange.UnaryPreincrementExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterUnaryPredecrementOperator = new formatting.Rule(formatting.RuleDescriptor.create3(39 /* MinusMinusToken */, formatting.Shared.TokenRange.UnaryPredecrementExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeUnaryPostincrementOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.UnaryPostincrementExpressions, 38 /* PlusPlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeUnaryPostdecrementOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.UnaryPostdecrementExpressions, 39 /* MinusMinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + // More unary operator special-casing. + // DevDiv 181814: Be careful when removing leading whitespace + // around unary operators. Examples: + // 1 - -2 --X--> 1--2 + // a + ++b --X--> a+++b + this.SpaceAfterPostincrementWhenFollowedByAdd = new formatting.Rule(formatting.RuleDescriptor.create1(38 /* PlusPlusToken */, 33 /* PlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterAddWhenFollowedByUnaryPlus = new formatting.Rule(formatting.RuleDescriptor.create1(33 /* PlusToken */, 33 /* PlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterAddWhenFollowedByPreincrement = new formatting.Rule(formatting.RuleDescriptor.create1(33 /* PlusToken */, 38 /* PlusPlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterPostdecrementWhenFollowedBySubtract = new formatting.Rule(formatting.RuleDescriptor.create1(39 /* MinusMinusToken */, 34 /* MinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterSubtractWhenFollowedByUnaryMinus = new formatting.Rule(formatting.RuleDescriptor.create1(34 /* MinusToken */, 34 /* MinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterSubtractWhenFollowedByPredecrement = new formatting.Rule(formatting.RuleDescriptor.create1(34 /* MinusToken */, 39 /* MinusMinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.NoSpaceBeforeComma = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 23 /* CommaToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.SpaceAfterCertainKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([98 /* VarKeyword */, 94 /* ThrowKeyword */, 88 /* NewKeyword */, 74 /* DeleteKeyword */, 90 /* ReturnKeyword */, 97 /* TypeOfKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([104 /* LetKeyword */, 70 /* ConstKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2 /* Space */)); + this.NoSpaceBeforeOpenParenInFuncCall = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionCallOrNewContext, Rules.IsPreviousTokenNotComma), 8 /* Delete */)); + this.SpaceAfterFunctionInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create3(83 /* FunctionKeyword */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); + this.NoSpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionDeclContext), 8 /* Delete */)); + this.SpaceAfterVoidOperator = new formatting.Rule(formatting.RuleDescriptor.create3(99 /* VoidKeyword */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsVoidOpContext), 2 /* Space */)); + this.NoSpaceBetweenReturnAndSemicolon = new formatting.Rule(formatting.RuleDescriptor.create1(90 /* ReturnKeyword */, 22 /* SemicolonToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + // Add a space between statements. All keywords except (do,else,case) has open/close parens after them. + // So, we have a rule to add a space for [),Any], [do,Any], [else,Any], and [case,Any] + this.SpaceBetweenStatements = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([17 /* CloseParenToken */, 75 /* DoKeyword */, 76 /* ElseKeyword */, 67 /* CaseKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotForContext), 2 /* Space */)); + // This low-pri rule takes care of "try {" and "finally {" in case the rule SpaceBeforeOpenBraceInControl didn't execute on FormatOnEnter. + this.SpaceAfterTryFinally = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([96 /* TryKeyword */, 81 /* FinallyKeyword */]), 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + // get x() {} + // set x(val) {} + this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([116 /* GetKeyword */, 120 /* SetKeyword */]), 65 /* Identifier */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); + // Special case for binary operators (that are keywords). For these we have to add a space and shouldn't follow any user options. + this.SpaceBeforeBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryKeywordOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryKeywordOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + // TypeScript-specific higher priority rules + // Treat constructor as an identifier in a function declaration, and remove spaces between constructor and following left parentheses + this.NoSpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(114 /* ConstructorKeyword */, 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + // Use of module as a function call. e.g.: import m2 = module("m2"); + this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([117 /* ModuleKeyword */, 118 /* RequireKeyword */]), 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + // Add a space around certain TypeScript keywords + this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([69 /* ClassKeyword */, 115 /* DeclareKeyword */, 77 /* EnumKeyword */, 78 /* ExportKeyword */, 79 /* ExtendsKeyword */, 116 /* GetKeyword */, 102 /* ImplementsKeyword */, 85 /* ImportKeyword */, 103 /* InterfaceKeyword */, 117 /* ModuleKeyword */, 106 /* PrivateKeyword */, 108 /* PublicKeyword */, 120 /* SetKeyword */, 109 /* StaticKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([79 /* ExtendsKeyword */, 102 /* ImplementsKeyword */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { + this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(8 /* StringLiteral */, 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2 /* Space */)); + // Lambda expressions + this.SpaceAfterArrow = new formatting.Rule(formatting.RuleDescriptor.create3(32 /* EqualsGreaterThanToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + // Optional parameters and let args + this.NoSpaceAfterEllipsis = new formatting.Rule(formatting.RuleDescriptor.create1(21 /* DotDotDotToken */, 65 /* Identifier */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterOptionalParameters = new formatting.Rule(formatting.RuleDescriptor.create3(50 /* QuestionToken */, formatting.Shared.TokenRange.FromTokens([17 /* CloseParenToken */, 23 /* CommaToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8 /* Delete */)); + // generics + this.NoSpaceBeforeOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.TypeNames, 24 /* LessThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8 /* Delete */)); + this.NoSpaceBetweenCloseParenAndAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create1(17 /* CloseParenToken */, 24 /* LessThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8 /* Delete */)); + this.NoSpaceAfterOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(24 /* LessThanToken */, formatting.Shared.TokenRange.TypeNames), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8 /* Delete */)); + this.NoSpaceBeforeCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 25 /* GreaterThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8 /* Delete */)); + this.NoSpaceAfterCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(25 /* GreaterThanToken */, formatting.Shared.TokenRange.FromTokens([16 /* OpenParenToken */, 18 /* OpenBracketToken */, 25 /* GreaterThanToken */, 23 /* CommaToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8 /* Delete */)); + // Remove spaces in empty interface literals. e.g.: x: {} + this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(14 /* OpenBraceToken */, 15 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectTypeContext), 8 /* Delete */)); + // decorators + this.SpaceBeforeAt = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 52 /* AtToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.NoSpaceAfterAt = new formatting.Rule(formatting.RuleDescriptor.create3(52 /* AtToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([65 /* Identifier */, 78 /* ExportKeyword */, 73 /* DefaultKeyword */, 69 /* ClassKeyword */, 109 /* StaticKeyword */, 108 /* PublicKeyword */, 106 /* PrivateKeyword */, 107 /* ProtectedKeyword */, 116 /* GetKeyword */, 120 /* SetKeyword */, 18 /* OpenBracketToken */, 35 /* AsteriskToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2 /* Space */)); + // These rules are higher in priority than user-configurable rules. this.HighPriorityCommonRules = [ this.IgnoreBeforeComment, this.IgnoreAfterLineComment, @@ -27565,6 +32681,7 @@ var ts; this.NoSpaceBeforeOpenParenInFuncCall, this.SpaceBeforeBinaryKeywordOperator, this.SpaceAfterBinaryKeywordOperator, this.SpaceAfterVoidOperator, + // TypeScript-specific rules this.NoSpaceAfterConstructor, this.NoSpaceAfterModuleImport, this.SpaceAfterCertainTypeScriptKeywords, this.SpaceBeforeCertainTypeScriptKeywords, this.SpaceAfterModuleName, @@ -27576,8 +32693,12 @@ var ts; this.NoSpaceBetweenCloseParenAndAngularBracket, this.NoSpaceAfterOpenAngularBracket, this.NoSpaceBeforeCloseAngularBracket, - this.NoSpaceAfterCloseAngularBracket + this.NoSpaceAfterCloseAngularBracket, + this.SpaceBeforeAt, + this.NoSpaceAfterAt, + this.SpaceAfterDecorator, ]; + // These rules are lower in priority than user-configurable rules. this.LowPriorityCommonRules = [ this.NoSpaceBeforeSemicolon, @@ -27589,60 +32710,81 @@ var ts; this.NoSpaceBeforeOpenParenInFuncDecl, this.SpaceBetweenStatements, this.SpaceAfterTryFinally ]; - this.SpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(23, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.NoSpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(23, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8)); - this.SpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); - this.SpaceAfterBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2)); - this.NoSpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 8)); - this.NoSpaceAfterBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 8)); - this.SpaceAfterKeywordInControl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Keywords, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext), 2)); - this.NoSpaceAfterKeywordInControl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Keywords, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext), 8)); - this.NewLineBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeMultilineBlockContext), 4), 1); - this.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsBeforeMultilineBlockContext), 4), 1); - this.NewLineBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsBeforeMultilineBlockContext), 4), 1); - this.SpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(22, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsForContext), 2)); - this.NoSpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(22, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsForContext), 8)); - this.SpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(16, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - this.SpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2)); - 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(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 controlled by user options + /// + // Insert space after comma delimiter + this.SpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(23 /* CommaToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.NoSpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(23 /* CommaToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + // Insert space before and after binary operators + this.SpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.NoSpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 8 /* Delete */)); + this.NoSpaceAfterBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 8 /* Delete */)); + // Insert space after keywords in control flow statements + this.SpaceAfterKeywordInControl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Keywords, 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext), 2 /* Space */)); + this.NoSpaceAfterKeywordInControl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Keywords, 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext), 8 /* Delete */)); + // Open Brace braces after function + //TypeScript: Function can have return types, which can be made of tons of different token kinds + this.NewLineBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeMultilineBlockContext), 4 /* NewLine */), 1 /* CanDeleteNewLines */); + // Open Brace braces after TypeScript module/class/interface + this.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsBeforeMultilineBlockContext), 4 /* NewLine */), 1 /* CanDeleteNewLines */); + // Open Brace braces after control block + this.NewLineBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsBeforeMultilineBlockContext), 4 /* NewLine */), 1 /* CanDeleteNewLines */); + // Insert space after semicolon in for statement + this.SpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(22 /* SemicolonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsForContext), 2 /* Space */)); + this.NoSpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(22 /* SemicolonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsForContext), 8 /* Delete */)); + // Insert space after opening and before closing nonempty parenthesis + this.SpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(16 /* OpenParenToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.SpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17 /* CloseParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.NoSpaceBetweenParens = new formatting.Rule(formatting.RuleDescriptor.create1(16 /* OpenParenToken */, 17 /* CloseParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(16 /* OpenParenToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17 /* CloseParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + // Insert space after function keyword for anonymous functions + this.SpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(83 /* FunctionKeyword */, 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); + this.NoSpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(83 /* FunctionKeyword */, 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 8 /* Delete */)); } Rules.prototype.getRuleName = function (rule) { var o = this; - for (var name_19 in o) { - if (o[name_19] === rule) { - return name_19; + for (var name_23 in o) { + if (o[name_23] === rule) { + return name_23; } } throw new Error("Unknown rule"); }; + /// + /// Contexts + /// Rules.IsForContext = function (context) { - return context.contextNode.kind === 186; + return context.contextNode.kind === 186 /* ForStatement */; }; Rules.IsNotForContext = function (context) { return !Rules.IsForContext(context); }; Rules.IsBinaryOpContext = function (context) { switch (context.contextNode.kind) { - case 169: - case 170: + case 169 /* BinaryExpression */: + case 170 /* ConditionalExpression */: return true; - case 208: - case 198: - case 129: - 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; + // equal in import a = module('a'); + case 208 /* ImportEqualsDeclaration */: + // equal in let a = 0; + case 198 /* VariableDeclaration */: + // equal in p = 0; + case 129 /* Parameter */: + case 226 /* EnumMember */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + return context.currentTokenSpan.kind === 53 /* EqualsToken */ || context.nextTokenSpan.kind === 53 /* EqualsToken */; + // "in" keyword in for (let x in []) { } + case 187 /* ForInStatement */: + return context.currentTokenSpan.kind === 86 /* InKeyword */ || context.nextTokenSpan.kind === 86 /* InKeyword */; + // Technically, "of" is not a binary operator, but format it the same way as "in" + case 188 /* ForOfStatement */: + return context.currentTokenSpan.kind === 125 /* OfKeyword */ || context.nextTokenSpan.kind === 125 /* OfKeyword */; + case 152 /* BindingElement */: + return context.currentTokenSpan.kind === 53 /* EqualsToken */ || context.nextTokenSpan.kind === 53 /* EqualsToken */; } return false; }; @@ -27650,7 +32792,7 @@ var ts; return !Rules.IsBinaryOpContext(context); }; Rules.IsConditionalOperatorContext = function (context) { - return context.contextNode.kind === 170; + return context.contextNode.kind === 170 /* ConditionalExpression */; }; Rules.IsSameLineTokenOrBeforeMultilineBlockContext = function (context) { //// This check is mainly used inside SpaceBeforeOpenBraceInControl and SpaceBeforeOpenBraceInFunction. @@ -27671,6 +32813,7 @@ var ts; //// * ) 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); }; + // This check is done before an open brace in a control construct, a function, or a typescript block declaration Rules.IsBeforeMultilineBlockContext = function (context) { return Rules.IsBeforeBlockContext(context) && !(context.NextNodeAllOnSameLine() || context.NextNodeBlockIsOnOneLine()); }; @@ -27686,31 +32829,38 @@ var ts; Rules.IsBeforeBlockContext = function (context) { return Rules.NodeIsBlockContext(context.nextTokenParent); }; + // IMPORTANT!!! This method must return true ONLY for nodes with open and close braces as immediate children Rules.NodeIsBlockContext = function (node) { if (Rules.NodeIsTypeScriptDeclWithBlockContext(node)) { + // This means we are in a context that looks like a block to the user, but in the grammar is actually not a node (it's a class, module, enum, object type literal, etc). return true; } switch (node.kind) { - case 179: - case 207: - case 154: - case 206: + case 179 /* Block */: + case 207 /* CaseBlock */: + case 154 /* ObjectLiteralExpression */: + case 206 /* ModuleBlock */: return true; } return false; }; Rules.IsFunctionDeclContext = function (context) { switch (context.contextNode.kind) { - case 200: - case 134: - case 133: - case 136: - case 137: - case 138: - case 162: - case 135: - case 163: - case 202: + case 200 /* FunctionDeclaration */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + //case SyntaxKind.MemberFunctionDeclaration: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + ///case SyntaxKind.MethodSignature: + case 138 /* CallSignature */: + case 162 /* FunctionExpression */: + case 135 /* Constructor */: + case 163 /* ArrowFunction */: + //case SyntaxKind.ConstructorDeclaration: + //case SyntaxKind.SimpleArrowFunctionExpression: + //case SyntaxKind.ParenthesizedArrowFunctionExpression: + case 202 /* InterfaceDeclaration */: return true; } return false; @@ -27720,93 +32870,107 @@ var ts; }; Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) { switch (node.kind) { - case 201: - case 202: - case 204: - case 145: - case 205: + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + case 204 /* EnumDeclaration */: + case 145 /* TypeLiteral */: + case 205 /* ModuleDeclaration */: return true; } return false; }; Rules.IsAfterCodeBlockContext = function (context) { switch (context.currentTokenParent.kind) { - case 201: - case 205: - case 204: - case 179: - case 223: - case 206: - case 193: + case 201 /* ClassDeclaration */: + case 205 /* ModuleDeclaration */: + case 204 /* EnumDeclaration */: + case 179 /* Block */: + case 223 /* CatchClause */: + case 206 /* ModuleBlock */: + case 193 /* SwitchStatement */: return true; } return false; }; Rules.IsControlDeclContext = function (context) { switch (context.contextNode.kind) { - case 183: - case 193: - case 186: - case 187: - case 188: - case 185: - case 196: - case 184: - case 192: - case 223: + case 183 /* IfStatement */: + case 193 /* SwitchStatement */: + case 186 /* ForStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: + case 185 /* WhileStatement */: + case 196 /* TryStatement */: + case 184 /* DoStatement */: + case 192 /* WithStatement */: + // TODO + // case SyntaxKind.ElseClause: + case 223 /* CatchClause */: return true; default: return false; } }; Rules.IsObjectContext = function (context) { - return context.contextNode.kind === 154; + return context.contextNode.kind === 154 /* ObjectLiteralExpression */; }; Rules.IsFunctionCallContext = function (context) { - return context.contextNode.kind === 157; + return context.contextNode.kind === 157 /* CallExpression */; }; Rules.IsNewContext = function (context) { - return context.contextNode.kind === 158; + return context.contextNode.kind === 158 /* NewExpression */; }; Rules.IsFunctionCallOrNewContext = function (context) { return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context); }; Rules.IsPreviousTokenNotComma = function (context) { - return context.currentTokenSpan.kind !== 23; + return context.currentTokenSpan.kind !== 23 /* CommaToken */; }; Rules.IsSameLineTokenContext = function (context) { return context.TokensAreOnSameLine(); }; + Rules.IsEndOfDecoratorContextOnSameLine = function (context) { + return context.TokensAreOnSameLine() && + context.contextNode.decorators && + Rules.NodeIsInDecoratorContext(context.currentTokenParent) && + !Rules.NodeIsInDecoratorContext(context.nextTokenParent); + }; + Rules.NodeIsInDecoratorContext = function (node) { + while (ts.isExpression(node)) { + node = node.parent; + } + return node.kind === 130 /* Decorator */; + }; Rules.IsStartOfVariableDeclarationList = function (context) { - return context.currentTokenParent.kind === 199 && + return context.currentTokenParent.kind === 199 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; }; Rules.IsNotFormatOnEnter = function (context) { - return context.formattingRequestKind != 2; + return context.formattingRequestKind != 2 /* FormatOnEnter */; }; Rules.IsModuleDeclContext = function (context) { - return context.contextNode.kind === 205; + return context.contextNode.kind === 205 /* ModuleDeclaration */; }; Rules.IsObjectTypeContext = function (context) { - return context.contextNode.kind === 145; + return context.contextNode.kind === 145 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; }; Rules.IsTypeArgumentOrParameter = function (token, parent) { - if (token.kind !== 24 && token.kind !== 25) { + if (token.kind !== 24 /* LessThanToken */ && token.kind !== 25 /* GreaterThanToken */) { 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 157: - case 158: + case 141 /* TypeReference */: + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 138 /* CallSignature */: + case 139 /* ConstructSignature */: + case 157 /* CallExpression */: + case 158 /* NewExpression */: return true; default: return false; @@ -27817,28 +32981,15 @@ var ts; Rules.IsTypeArgumentOrParameter(context.nextTokenSpan, context.nextTokenParent); }; Rules.IsVoidOpContext = function (context) { - return context.currentTokenSpan.kind === 99 && context.currentTokenParent.kind === 166; + return context.currentTokenSpan.kind === 99 /* VoidKeyword */ && context.currentTokenParent.kind === 166 /* VoidExpression */; }; 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. -// /// +/* @internal */ var ts; (function (ts) { var formatting; @@ -27854,9 +33005,10 @@ var ts; return result; }; RulesMap.prototype.Initialize = function (rules) { - this.mapRowLength = 125 + 1; - this.map = new Array(this.mapRowLength * this.mapRowLength); - var rulesBucketConstructionStateList = new Array(this.map.length); + this.mapRowLength = 125 /* LastToken */ + 1; + this.map = new Array(this.mapRowLength * this.mapRowLength); //new Array(this.mapRowLength * this.mapRowLength); + // This array is used only during construction of the rulesbucket in the map + var rulesBucketConstructionStateList = new Array(this.map.length); //new Array(this.map.length); this.FillRules(rules, rulesBucketConstructionStateList); return this.map; }; @@ -27868,6 +33020,7 @@ var ts; }; RulesMap.prototype.GetRuleBucketIndex = function (row, column) { var rulesBucketIndex = (row * this.mapRowLength) + column; + //Debug.Assert(rulesBucketIndex < this.map.Length, "Trying to access an index outside the array."); return rulesBucketIndex; }; RulesMap.prototype.FillRule = function (rule, rulesBucketConstructionStateList) { @@ -27914,6 +33067,21 @@ var ts; var RulesPosition = formatting.RulesPosition; var RulesBucketConstructionState = (function () { function RulesBucketConstructionState() { + //// The Rules list contains all the inserted rules into a rulebucket in the following order: + //// 1- Ignore rules with specific token combination + //// 2- Ignore rules with any token combination + //// 3- Context rules with specific token combination + //// 4- Context rules with any token combination + //// 5- Non-context rules with specific token combination + //// 6- Non-context rules with any token combination + //// + //// The member rulesInsertionIndexBitmap is used to describe the number of rules + //// in each sub-bucket (above) hence can be used to know the index of where to insert + //// the next rule. It's a bitmap which contains 6 different sections each is given 5 bits. + //// + //// Example: + //// In order to insert a rule to the end of sub-bucket (3), we get the index by adding + //// the values in the bitmap segments 3rd, 2nd, and 1st. this.rulesInsertionIndexBitmap = 0; } RulesBucketConstructionState.prototype.GetInsertionIndex = function (maskPosition) { @@ -27947,7 +33115,7 @@ var ts; }; RulesBucket.prototype.AddRule = function (rule, specificTokens, constructionState, rulesBucketIndex) { var position; - if (rule.Operation.Action == 1) { + if (rule.Operation.Action == 1 /* Ignore */) { position = specificTokens ? RulesPosition.IgnoreRulesSpecific : RulesPosition.IgnoreRulesAny; @@ -27975,21 +33143,8 @@ 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. -// /// +/* @internal */ var ts; (function (ts) { var formatting; @@ -28045,7 +33200,7 @@ var ts; } TokenAllAccess.prototype.GetTokens = function () { var result = []; - for (var token = 0; token <= 125; token++) { + for (var token = 0 /* FirstToken */; token <= 125 /* LastToken */; token++) { result.push(token); } return result; @@ -28086,38 +33241,24 @@ var ts; return this.tokenAccess.toString(); }; TokenRange.Any = TokenRange.AllTokens(); - TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([3])); - 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, 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([65, 119, 121, 113, 122, 99, 112]); + TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([3 /* MultiLineCommentTrivia */])); + TokenRange.Keywords = TokenRange.FromRange(66 /* FirstKeyword */, 125 /* LastKeyword */); + TokenRange.BinaryOperators = TokenRange.FromRange(24 /* FirstBinaryOperator */, 64 /* LastBinaryOperator */); + TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([86 /* InKeyword */, 87 /* InstanceOfKeyword */, 125 /* OfKeyword */]); + TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([38 /* PlusPlusToken */, 39 /* MinusMinusToken */, 47 /* TildeToken */, 46 /* ExclamationToken */]); + TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([7 /* NumericLiteral */, 65 /* Identifier */, 16 /* OpenParenToken */, 18 /* OpenBracketToken */, 14 /* OpenBraceToken */, 93 /* ThisKeyword */, 88 /* NewKeyword */]); + TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([65 /* Identifier */, 16 /* OpenParenToken */, 93 /* ThisKeyword */, 88 /* NewKeyword */]); + TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([65 /* Identifier */, 17 /* CloseParenToken */, 19 /* CloseBracketToken */, 88 /* NewKeyword */]); + TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([65 /* Identifier */, 16 /* OpenParenToken */, 93 /* ThisKeyword */, 88 /* NewKeyword */]); + TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([65 /* Identifier */, 17 /* CloseParenToken */, 19 /* CloseBracketToken */, 88 /* NewKeyword */]); + TokenRange.Comments = TokenRange.FromTokens([2 /* SingleLineCommentTrivia */, 3 /* MultiLineCommentTrivia */]); + TokenRange.TypeNames = TokenRange.FromTokens([65 /* Identifier */, 119 /* NumberKeyword */, 121 /* StringKeyword */, 113 /* BooleanKeyword */, 122 /* SymbolKeyword */, 99 /* VoidKeyword */, 112 /* AnyKeyword */]); 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. -// /// /// /// @@ -28130,21 +33271,8 @@ var 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. -// /// +/* @internal */ var ts; (function (ts) { var formatting; @@ -28234,6 +33362,7 @@ var ts; /// /// /// +/* @internal */ var ts; (function (ts) { var formatting; @@ -28247,19 +33376,22 @@ var ts; if (line === 0) { return []; } + // get the span for the previous\current line var span = { + // get start position for the previous line pos: ts.getStartPositionOfLine(line - 1, sourceFile), + // get end position for the current line (end value is exclusive so add 1 to the result) end: ts.getEndLinePosition(line, sourceFile) + 1 }; - return formatSpan(span, sourceFile, options, rulesProvider, 2); + return formatSpan(span, sourceFile, options, rulesProvider, 2 /* FormatOnEnter */); } formatting.formatOnEnter = formatOnEnter; function formatOnSemicolon(position, sourceFile, rulesProvider, options) { - return formatOutermostParent(position, 22, sourceFile, options, rulesProvider, 3); + return formatOutermostParent(position, 22 /* SemicolonToken */, sourceFile, options, rulesProvider, 3 /* FormatOnSemicolon */); } formatting.formatOnSemicolon = formatOnSemicolon; function formatOnClosingCurly(position, sourceFile, rulesProvider, options) { - return formatOutermostParent(position, 15, sourceFile, options, rulesProvider, 4); + return formatOutermostParent(position, 15 /* CloseBraceToken */, sourceFile, options, rulesProvider, 4 /* FormatOnClosingCurlyBrace */); } formatting.formatOnClosingCurly = formatOnClosingCurly; function formatDocument(sourceFile, rulesProvider, options) { @@ -28267,15 +33399,16 @@ var ts; pos: 0, end: sourceFile.text.length }; - return formatSpan(span, sourceFile, options, rulesProvider, 0); + return formatSpan(span, sourceFile, options, rulesProvider, 0 /* FormatDocument */); } formatting.formatDocument = formatDocument; function formatSelection(start, end, sourceFile, rulesProvider, options) { + // format from the beginning of the line var span = { pos: ts.getLineStartPositionForPosition(start, sourceFile), end: end }; - return formatSpan(span, sourceFile, options, rulesProvider, 1); + return formatSpan(span, sourceFile, options, rulesProvider, 1 /* FormatSelection */); } formatting.formatSelection = formatSelection; function formatOutermostParent(position, expectedLastToken, sourceFile, options, rulesProvider, requestKind) { @@ -28291,11 +33424,24 @@ var ts; } function findOutermostParent(position, expectedTokenKind, sourceFile) { var precedingToken = ts.findPrecedingToken(position, sourceFile); + // when it is claimed that trigger character was typed at given position + // we verify that there is a token with a matching kind whose end is equal to position (because the character was just typed). + // If this condition is not hold - then trigger character was typed in some other context, + // i.e.in comment and thus should not trigger autoformatting if (!precedingToken || precedingToken.kind !== expectedTokenKind || position !== precedingToken.getEnd()) { return undefined; } + // walk up and search for the parent node that ends at the same position with precedingToken. + // for cases like this + // + // let x = 1; + // while (true) { + // } + // after typing close curly in while statement we want to reformat just the while statement. + // However if we just walk upwards searching for the parent that has the same end value - + // we'll end up with the whole source file. isListElement allows to stop on the list element level var current = precedingToken; while (current && current.parent && @@ -28305,23 +33451,26 @@ var ts; } return current; } + // Returns true if node is a element in some list in parent + // i.e. parent is class declaration with the list of members and node is one of members. function isListElement(parent, node) { switch (parent.kind) { - case 201: - case 202: + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 205: + case 205 /* ModuleDeclaration */: var body = parent.body; - return body && body.kind === 179 && ts.rangeContainsRange(body.statements, node); - case 227: - case 179: - case 206: + return body && body.kind === 179 /* Block */ && ts.rangeContainsRange(body.statements, node); + case 227 /* SourceFile */: + case 179 /* Block */: + case 206 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 223: + case 223 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; } + /** find node that fully contains given text range */ function findEnclosingNode(range, sourceFile) { return find(sourceFile); function find(n) { @@ -28335,10 +33484,15 @@ var ts; return n; } } + /** formatting is not applied to ranges that contain parse errors. + * This function will return a predicate that for a given text range will tell + * if there are any parse errors that overlap with the range. + */ function prepareRangeContainsErrorFunction(errors, originalRange) { if (!errors.length) { return rangeHasNoErrors; } + // pick only errors that fall in range var sorted = errors .filter(function (d) { return ts.rangeOverlapsWithStartEnd(originalRange, d.start, d.start + d.length); }) .sort(function (e1, e2) { return e1.start - e2.start; }); @@ -28347,15 +33501,20 @@ var ts; } var index = 0; return function (r) { + // in current implementation sequence of arguments [r1, r2...] is monotonically increasing. + // 'index' tracks the index of the most recent error that was checked. while (true) { if (index >= sorted.length) { + // all errors in the range were already checked -> no error in specified range return false; } var error = sorted[index]; if (r.end <= error.start) { + // specified range ends before the error refered by 'index' - no error in range return false; } if (ts.startEndOverlapsWithStartEnd(r.pos, r.end, error.start, error.start + error.length)) { + // specified range overlaps with error range return true; } index++; @@ -28365,6 +33524,11 @@ var ts; return false; } } + /** + * Start of the original range might fall inside the comment - scanner will not yield appropriate results + * This function will look for token that is located before the start of target range + * and return its end as start position for the scanner. + */ function getScanStartPosition(enclosingNode, originalRange, sourceFile) { var start = enclosingNode.getStart(sourceFile); if (start === originalRange.pos && enclosingNode.end === originalRange.end) { @@ -28372,19 +33536,37 @@ var ts; } var precedingToken = ts.findPrecedingToken(originalRange.pos, sourceFile); if (!precedingToken) { + // no preceding token found - start from the beginning of enclosing node return enclosingNode.pos; } + // preceding token ends after the start of original range (i.e when originaRange.pos falls in the middle of literal) + // start from the beginning of enclosingNode to handle the entire 'originalRange' if (precedingToken.end >= originalRange.pos) { return enclosingNode.pos; } return precedingToken.end; } + /* + * For cases like + * if (a || + * b ||$ + * c) {...} + * If we hit Enter at $ we want line ' b ||' to be indented. + * Formatting will be applied to the last two lines. + * Node that fully encloses these lines is binary expression 'a ||...'. + * Initial indentation for this node will be 0. + * Binary expressions don't introduce new indentation scopes, however it is possible + * that some parent node on the same line does - like if statement in this case. + * Note that we are considering parents only from the same line with initial node - + * if parent is on the different line - its delta was already contributed + * to the initial indentation. + */ function getOwnOrInheritedDelta(n, options, sourceFile) { - var previousLine = -1; - var childKind = 0; + var previousLine = -1 /* Unknown */; + var childKind = 0 /* Unknown */; while (n) { var line = sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)).line; - if (previousLine !== -1 && line !== previousLine) { + if (previousLine !== -1 /* Unknown */ && line !== previousLine) { break; } if (formatting.SmartIndenter.shouldIndentChildNode(n.kind, childKind)) { @@ -28398,7 +33580,9 @@ var ts; } function formatSpan(originalRange, sourceFile, options, rulesProvider, requestKind) { var rangeContainsError = prepareRangeContainsErrorFunction(sourceFile.parseDiagnostics, originalRange); + // formatting context is used by rules provider var formattingContext = new formatting.FormattingContext(sourceFile, requestKind); + // find the smallest node that fully wraps the range and compute the initial indentation for the node var enclosingNode = findEnclosingNode(originalRange, sourceFile); var formattingScanner = formatting.getFormattingScanner(sourceFile, getScanStartPosition(enclosingNode, originalRange, sourceFile), originalRange.end); var initialIndentation = formatting.SmartIndenter.getIndentationForNode(enclosingNode, originalRange, sourceFile, options); @@ -28410,14 +33594,26 @@ var ts; formattingScanner.advance(); if (formattingScanner.isOnToken()) { var startLine = sourceFile.getLineAndCharacterOfPosition(enclosingNode.getStart(sourceFile)).line; + var undecoratedStartLine = startLine; + if (enclosingNode.decorators) { + undecoratedStartLine = sourceFile.getLineAndCharacterOfPosition(ts.getNonDecoratorTokenPosOfNode(enclosingNode, sourceFile)).line; + } var delta = getOwnOrInheritedDelta(enclosingNode, options, sourceFile); - processNode(enclosingNode, enclosingNode, startLine, initialIndentation, delta); + processNode(enclosingNode, enclosingNode, startLine, undecoratedStartLine, initialIndentation, delta); } formattingScanner.close(); return edits; + // local functions + /** Tries to compute the indentation for a list element. + * If list element is not in range then + * function will pick its actual indentation + * so it can be pushed downstream as inherited indentation. + * If list element is in the range - its indentation will be equal + * to inherited indentation from its predecessors. + */ function tryComputeIndentationForListItem(startPos, endPos, parentStartLine, range, inheritedIndentation) { if (ts.rangeOverlapsWithStartEnd(range, startPos, endPos)) { - if (inheritedIndentation !== -1) { + if (inheritedIndentation !== -1 /* Unknown */) { return inheritedIndentation; } } @@ -28429,16 +33625,20 @@ var ts; return column; } } - return -1; + return -1 /* Unknown */; } function computeIndentation(node, startLine, inheritedIndentation, parent, parentDynamicIndentation, effectiveParentStartLine) { var indentation = inheritedIndentation; - if (indentation === -1) { + if (indentation === -1 /* Unknown */) { if (isSomeBlock(node.kind)) { + // blocks should be indented in + // - other blocks + // - source file + // - switch\default clauses if (isSomeBlock(parent.kind) || - parent.kind === 227 || - parent.kind === 220 || - parent.kind === 221) { + parent.kind === 227 /* SourceFile */ || + parent.kind === 220 /* CaseClause */ || + parent.kind === 221 /* DefaultClause */) { indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); } else { @@ -28454,8 +33654,11 @@ var ts; } } } - var delta = formatting.SmartIndenter.shouldIndentChildNode(node.kind, 0) ? options.IndentSize : 0; + var delta = formatting.SmartIndenter.shouldIndentChildNode(node.kind, 0 /* Unknown */) ? options.IndentSize : 0; if (effectiveParentStartLine === startLine) { + // if node is located on the same line with the parent + // - inherit indentation from the parent + // - push children if either parent of node itself has non-zero delta indentation = parentDynamicIndentation.getIndentation(); delta = Math.min(options.IndentSize, parentDynamicIndentation.getDelta() + delta); } @@ -28469,18 +33672,19 @@ var ts; 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: + case 201 /* ClassDeclaration */: return 69 /* ClassKeyword */; + case 202 /* InterfaceDeclaration */: return 103 /* InterfaceKeyword */; + case 200 /* FunctionDeclaration */: return 83 /* FunctionKeyword */; + case 204 /* EnumDeclaration */: return 204 /* EnumDeclaration */; + case 136 /* GetAccessor */: return 116 /* GetKeyword */; + case 137 /* SetAccessor */: return 120 /* SetKeyword */; + case 134 /* MethodDeclaration */: if (node.asteriskToken) { - return 35; + return 35 /* AsteriskToken */; } - case 132: - case 129: + // fall-through + case 132 /* PropertyDeclaration */: + case 129 /* Parameter */: return node.name.kind; } } @@ -28488,8 +33692,12 @@ var ts; return { getIndentationForComment: function (kind) { switch (kind) { - case 15: - case 19: + // preceding comment to the token that closes the indentation scope inherits the indentation from the scope + // .. { + // // comment + // } + case 15 /* CloseBraceToken */: + case 19 /* CloseBracketToken */: return indentation + delta; } return indentation; @@ -28497,19 +33705,22 @@ var ts; getIndentationForToken: function (line, kind) { if (nodeStartLine !== line && node.decorators) { if (kind === getFirstNonDecoratorTokenOfNode(node)) { + // if this token is the first token following the list of decorators, we do not need to indent return indentation; } } switch (kind) { - case 14: - case 15: - case 18: - case 19: - case 76: - case 100: - case 52: + // open and close brace, 'else' and 'while' (in do statement) tokens has indentation of the parent + case 14 /* OpenBraceToken */: + case 15 /* CloseBraceToken */: + case 18 /* OpenBracketToken */: + case 19 /* CloseBracketToken */: + case 76 /* ElseKeyword */: + case 100 /* WhileKeyword */: + case 52 /* AtToken */: return indentation; default: + // if token line equals to the line of containing node (this is a first token in the node) - use node indentation return nodeStartLine !== line ? indentation + delta : indentation; } }, @@ -28523,7 +33734,7 @@ var ts; else { indentation -= options.IndentSize; } - if (formatting.SmartIndenter.shouldIndentChildNode(node.kind, 0)) { + if (formatting.SmartIndenter.shouldIndentChildNode(node.kind, 0 /* Unknown */)) { delta = options.IndentSize; } else { @@ -28533,17 +33744,31 @@ var ts; } }; } - function processNode(node, contextNode, nodeStartLine, indentation, delta) { + function processNode(node, contextNode, nodeStartLine, undecoratedNodeStartLine, indentation, delta) { if (!ts.rangeOverlapsWithStartEnd(originalRange, node.getStart(sourceFile), node.getEnd())) { return; } var nodeDynamicIndentation = getDynamicIndentation(node, nodeStartLine, indentation, delta); + // a useful observations when tracking context node + // / + // [a] + // / | \ + // [b] [c] [d] + // node 'a' is a context node for nodes 'b', 'c', 'd' + // except for the leftmost leaf token in [b] - in this case context node ('e') is located somewhere above 'a' + // this rule can be applied recursively to child nodes of 'a'. + // + // context node is set to parent node value after processing every child node + // context node is set to parent of the token after processing every token var childContextNode = contextNode; + // if there are any tokens that logically belong to node and interleave child nodes + // such tokens will be consumed in processChildNode for for the child that follows them ts.forEachChild(node, function (child) { - processChildNode(child, -1, node, nodeDynamicIndentation, nodeStartLine, false); + processChildNode(child, -1 /* Unknown */, node, nodeDynamicIndentation, nodeStartLine, undecoratedNodeStartLine, false); }, function (nodes) { processChildNodes(nodes, node, nodeStartLine, nodeDynamicIndentation); }); + // proceed any tokens in the node that are located after child nodes while (formattingScanner.isOnToken()) { var tokenInfo = formattingScanner.readTokenInfo(node); if (tokenInfo.token.end > node.end) { @@ -28551,16 +33776,22 @@ var ts; } consumeTokenAndAdvanceScanner(tokenInfo, node, nodeDynamicIndentation); } - function processChildNode(child, inheritedIndentation, parent, parentDynamicIndentation, parentStartLine, isListItem) { + function processChildNode(child, inheritedIndentation, parent, parentDynamicIndentation, parentStartLine, undecoratedParentStartLine, isListItem) { var childStartPos = child.getStart(sourceFile); - var childStart = sourceFile.getLineAndCharacterOfPosition(childStartPos); - var childIndentationAmount = -1; + var childStartLine = sourceFile.getLineAndCharacterOfPosition(childStartPos).line; + var undecoratedChildStartLine = childStartLine; + if (child.decorators) { + undecoratedChildStartLine = sourceFile.getLineAndCharacterOfPosition(ts.getNonDecoratorTokenPosOfNode(child, sourceFile)).line; + } + // if child is a list item - try to get its indentation + var childIndentationAmount = -1 /* Unknown */; if (isListItem) { childIndentationAmount = tryComputeIndentationForListItem(childStartPos, child.end, parentStartLine, originalRange, inheritedIndentation); - if (childIndentationAmount !== -1) { + if (childIndentationAmount !== -1 /* Unknown */) { inheritedIndentation = childIndentationAmount; } } + // child node is outside the target range - do not dive inside if (!ts.rangeOverlapsWithStartEnd(originalRange, child.pos, child.end)) { return inheritedIndentation; } @@ -28568,8 +33799,10 @@ var ts; return inheritedIndentation; } while (formattingScanner.isOnToken()) { + // proceed any parent tokens that are located prior to child.getStart() var tokenInfo = formattingScanner.readTokenInfo(node); if (tokenInfo.token.end > childStartPos) { + // stop when formatting scanner advances past the beginning of the child break; } consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); @@ -28578,13 +33811,15 @@ var ts; return inheritedIndentation; } if (ts.isToken(child)) { + // if child node is a token, it does not impact indentation, proceed it using parent indentation scope rules 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); - processNode(child, childContextNode, childStart.line, childIndentation.indentation, childIndentation.delta); + var effectiveParentStartLine = child.kind === 130 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); + processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); childContextNode = node; return inheritedIndentation; } @@ -28593,32 +33828,41 @@ var ts; var listEndToken = getCloseTokenForOpenToken(listStartToken); var listDynamicIndentation = parentDynamicIndentation; var startLine = parentStartLine; - if (listStartToken !== 0) { + if (listStartToken !== 0 /* Unknown */) { + // introduce a new indentation scope for lists (including list start and end tokens) while (formattingScanner.isOnToken()) { var tokenInfo = formattingScanner.readTokenInfo(parent); if (tokenInfo.token.end > nodes.pos) { + // stop when formatting scanner moves past the beginning of node list break; } else if (tokenInfo.token.kind === listStartToken) { + // consume list start token startLine = sourceFile.getLineAndCharacterOfPosition(tokenInfo.token.pos).line; - var indentation_1 = computeIndentation(tokenInfo.token, startLine, -1, parent, parentDynamicIndentation, startLine); + var indentation_1 = computeIndentation(tokenInfo.token, startLine, -1 /* Unknown */, parent, parentDynamicIndentation, startLine); listDynamicIndentation = getDynamicIndentation(parent, parentStartLine, indentation_1.indentation, indentation_1.delta); consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); } else { + // consume any tokens that precede the list as child elements of 'node' using its indentation scope consumeTokenAndAdvanceScanner(tokenInfo, parent, parentDynamicIndentation); } } } - var inheritedIndentation = -1; + var inheritedIndentation = -1 /* Unknown */; 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, startLine, true); } - if (listEndToken !== 0) { + if (listEndToken !== 0 /* Unknown */) { if (formattingScanner.isOnToken()) { var tokenInfo = formattingScanner.readTokenInfo(parent); + // consume the list end token only if it is still belong to the parent + // there might be the case when current token matches end token but does not considered as one + // function (x: function) <-- + // without this check close paren will be interpreted as list end token for function expression which is wrong if (tokenInfo.token.kind === listEndToken && ts.rangeContainsRange(parent, tokenInfo.token)) { + // consume list end token consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); } } @@ -28636,9 +33880,11 @@ var ts; var tokenStart = sourceFile.getLineAndCharacterOfPosition(currentTokenInfo.token.pos); if (isTokenInRange) { var rangeHasError = rangeContainsError(currentTokenInfo.token); + // save prevStartLine since processRange will overwrite this value with current ones var prevStartLine = previousRangeStartLine; lineAdded = processRange(currentTokenInfo.token, tokenStart, parent, childContextNode, dynamicIndentation); if (rangeHasError) { + // do not indent comments\token if token range overlaps with some error indentToken = false; } else { @@ -28663,24 +33909,25 @@ var ts; } var triviaStartLine = sourceFile.getLineAndCharacterOfPosition(triviaItem.pos).line; switch (triviaItem.kind) { - case 3: + case 3 /* MultiLineCommentTrivia */: var commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); indentMultilineComment(triviaItem, commentIndentation, !indentNextTokenOrTrivia); indentNextTokenOrTrivia = false; break; - case 2: + case 2 /* SingleLineCommentTrivia */: if (indentNextTokenOrTrivia) { var commentIndentation_1 = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); insertIndentation(triviaItem.pos, commentIndentation_1, false); indentNextTokenOrTrivia = false; } break; - case 4: + case 4 /* NewLineTrivia */: indentNextTokenOrTrivia = true; break; } } } + // indent token only if is it is in target range and does not overlap with any error ranges if (isTokenInRange && !rangeContainsError(currentTokenInfo.token)) { var tokenIndentation = dynamicIndentation.getIndentationForToken(tokenStart.line, currentTokenInfo.token.kind); insertIndentation(currentTokenInfo.token.pos, tokenIndentation, lineAdded); @@ -28704,6 +33951,7 @@ var ts; var lineAdded; if (!rangeHasError && !previousRangeHasError) { if (!previousRange) { + // trim whitespaces starting from the beginning of the span up to the current line var originalStart = sourceFile.getLineAndCharacterOfPosition(originalRange.pos); trimTrailingWhitespacesForLines(originalStart.line, rangeStart.line); } @@ -28725,26 +33973,33 @@ var ts; var lineAdded; if (rule) { applyRuleEdits(rule, previousItem, previousStartLine, currentItem, currentStartLine); - if (rule.Operation.Action & (2 | 8) && currentStartLine !== previousStartLine) { + if (rule.Operation.Action & (2 /* Space */ | 8 /* Delete */) && currentStartLine !== previousStartLine) { lineAdded = false; + // Handle the case where the next line is moved to be the end of this line. + // In this case we don't indent the next line in the next pass. if (currentParent.getStart(sourceFile) === currentItem.pos) { dynamicIndentation.recomputeIndentation(false); } } - else if (rule.Operation.Action & 4 && currentStartLine === previousStartLine) { + else if (rule.Operation.Action & 4 /* NewLine */ && currentStartLine === previousStartLine) { lineAdded = true; + // Handle the case where token2 is moved to the new line. + // In this case we indent token2 in the next pass but we set + // sameLineIndent flag to notify the indenter that the indentation is within the line. if (currentParent.getStart(sourceFile) === currentItem.pos) { dynamicIndentation.recomputeIndentation(true); } } + // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line trimTrailingWhitespaces = - (rule.Operation.Action & (4 | 2)) && - rule.Flag !== 1; + (rule.Operation.Action & (4 /* NewLine */ | 2 /* Space */)) && + rule.Flag !== 1 /* CanDeleteNewLines */; } else { trimTrailingWhitespaces = true; } if (currentStartLine !== previousStartLine && trimTrailingWhitespaces) { + // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line trimTrailingWhitespacesForLines(previousStartLine, currentStartLine, previousItem); } return lineAdded; @@ -28752,6 +34007,8 @@ var ts; function insertIndentation(pos, indentation, lineAdded) { var indentationString = getIndentationString(indentation, options); if (lineAdded) { + // new line is added before the token by the formatting rules + // insert indentation string at the very beginning of the token recordReplace(pos, 0, indentationString); } else { @@ -28763,11 +34020,13 @@ var ts; } } function indentMultilineComment(commentRange, indentation, firstLineIsIndented) { + // split comment in lines var startLine = sourceFile.getLineAndCharacterOfPosition(commentRange.pos).line; var endLine = sourceFile.getLineAndCharacterOfPosition(commentRange.end).line; var parts; if (startLine === endLine) { if (!firstLineIsIndented) { + // treat as single line comment insertIndentation(commentRange.pos, indentation, false); } return; @@ -28792,6 +34051,7 @@ var ts; startIndex = 1; startLine++; } + // shift all parts on the delta size var delta = indentation - nonWhitespaceColumnInFirstPart.column; for (var i = startIndex, len = parts.length; i < len; ++i, ++startLine) { var startLinePos_1 = ts.getStartPositionOfLine(startLine, sourceFile); @@ -28812,6 +34072,7 @@ var ts; for (var line = line1; line < line2; ++line) { var lineStartPosition = ts.getStartPositionOfLine(line, sourceFile); var lineEndPosition = ts.getEndLinePosition(line, sourceFile); + // do not trim whitespaces in comments if (range && ts.isComment(range.kind) && range.pos <= lineEndPosition && range.end > lineEndPosition) { continue; } @@ -28841,28 +34102,35 @@ var ts; function applyRuleEdits(rule, previousRange, previousStartLine, currentRange, currentStartLine) { var between; switch (rule.Operation.Action) { - case 1: + case 1 /* Ignore */: + // no action required return; - case 8: + case 8 /* Delete */: if (previousRange.end !== currentRange.pos) { + // delete characters starting from t1.end up to t2.pos exclusive recordDelete(previousRange.end, currentRange.pos - previousRange.end); } break; - case 4: - if (rule.Flag !== 1 && previousStartLine !== currentStartLine) { + case 4 /* NewLine */: + // exit early if we on different lines and rule cannot change number of newlines + // if line1 and line2 are on subsequent lines then no edits are required - ok to exit + // if line1 and line2 are separated with more than one newline - ok to exit since we cannot delete extra new lines + if (rule.Flag !== 1 /* CanDeleteNewLines */ && previousStartLine !== currentStartLine) { return; } + // edit should not be applied only if we have one line feed between elements var lineDelta = currentStartLine - previousStartLine; if (lineDelta !== 1) { recordReplace(previousRange.end, currentRange.pos - previousRange.end, options.NewLineCharacter); } break; - case 2: - if (rule.Flag !== 1 && previousStartLine !== currentStartLine) { + case 2 /* Space */: + // exit early if we on different lines and rule cannot change number of newlines + if (rule.Flag !== 1 /* CanDeleteNewLines */ && previousStartLine !== currentStartLine) { return; } var posDelta = currentRange.pos - previousRange.end; - if (posDelta !== 1 || sourceFile.text.charCodeAt(previousRange.end) !== 32) { + if (posDelta !== 1 || sourceFile.text.charCodeAt(previousRange.end) !== 32 /* space */) { recordReplace(previousRange.end, currentRange.pos - previousRange.end, " "); } break; @@ -28871,56 +34139,57 @@ var ts; } function isSomeBlock(kind) { switch (kind) { - case 179: - case 206: + case 179 /* Block */: + case 206 /* ModuleBlock */: return true; } return false; } function getOpenTokenForList(node, list) { switch (node.kind) { - case 135: - case 200: - case 162: - case 134: - case 133: - case 163: + case 135 /* Constructor */: + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 163 /* ArrowFunction */: if (node.typeParameters === list) { - return 24; + return 24 /* LessThanToken */; } else if (node.parameters === list) { - return 16; + return 16 /* OpenParenToken */; } break; - case 157: - case 158: + case 157 /* CallExpression */: + case 158 /* NewExpression */: if (node.typeArguments === list) { - return 24; + return 24 /* LessThanToken */; } else if (node.arguments === list) { - return 16; + return 16 /* OpenParenToken */; } break; - case 141: + case 141 /* TypeReference */: if (node.typeArguments === list) { - return 24; + return 24 /* LessThanToken */; } } - return 0; + return 0 /* Unknown */; } function getCloseTokenForOpenToken(kind) { switch (kind) { - case 16: - return 17; - case 24: - return 25; + case 16 /* OpenParenToken */: + return 17 /* CloseParenToken */; + case 24 /* LessThanToken */: + return 25 /* GreaterThanToken */; } - return 0; + return 0 /* Unknown */; } var internedSizes; var internedTabsIndentation; var internedSpacesIndentation; function getIndentationString(indentation, options) { + // reset interned strings if FormatCodeOptions were changed var resetInternedStrings = !internedSizes || (internedSizes.tabSize !== options.TabSize || internedSizes.indentSize !== options.IndentSize); if (resetInternedStrings) { internedSizes = { tabSize: options.TabSize, indentSize: options.IndentSize }; @@ -28969,6 +34238,7 @@ var ts; })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); /// +/* @internal */ var ts; (function (ts) { var formatting; @@ -28981,34 +34251,38 @@ var ts; })(Value || (Value = {})); function getIndentation(position, sourceFile, options) { if (position > sourceFile.text.length) { - return 0; + return 0; // past EOF } var precedingToken = ts.findPrecedingToken(position, sourceFile); if (!precedingToken) { return 0; } - var precedingTokenIsLiteral = precedingToken.kind === 8 || - precedingToken.kind === 9 || - precedingToken.kind === 10 || - precedingToken.kind === 11 || - precedingToken.kind === 12 || - precedingToken.kind === 13; + // no indentation in string \regex\template literals + var precedingTokenIsLiteral = precedingToken.kind === 8 /* StringLiteral */ || + precedingToken.kind === 9 /* RegularExpressionLiteral */ || + precedingToken.kind === 10 /* NoSubstitutionTemplateLiteral */ || + precedingToken.kind === 11 /* TemplateHead */ || + precedingToken.kind === 12 /* TemplateMiddle */ || + precedingToken.kind === 13 /* TemplateTail */; if (precedingTokenIsLiteral && precedingToken.getStart(sourceFile) <= position && precedingToken.end > position) { return 0; } var lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line; - if (precedingToken.kind === 23 && precedingToken.parent.kind !== 169) { + if (precedingToken.kind === 23 /* CommaToken */ && precedingToken.parent.kind !== 169 /* BinaryExpression */) { + // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); - if (actualIndentation !== -1) { + if (actualIndentation !== -1 /* Unknown */) { return actualIndentation; } } + // try to find node that can contribute to indentation and includes 'position' starting from 'precedingToken' + // if such node is found - compute initial indentation for 'position' inside this node var previous; var current = precedingToken; var currentStart; var indentationDelta; while (current) { - if (ts.positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(current.kind, previous ? previous.kind : 0)) { + if (ts.positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(current.kind, previous ? previous.kind : 0 /* Unknown */)) { currentStart = getStartLineAndCharacterForNode(current, sourceFile); if (nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile)) { indentationDelta = 0; @@ -29018,14 +34292,16 @@ var ts; } break; } + // check if current node is a list item - if yes, take indentation from it var actualIndentation = getActualIndentationForListItem(current, sourceFile, options); - if (actualIndentation !== -1) { + if (actualIndentation !== -1 /* Unknown */) { return actualIndentation; } previous = current; current = current.parent; } if (!current) { + // no parent was found - return 0 to be indented on the level of SourceFile return 0; } return getIndentationForNodeWorker(current, currentStart, undefined, indentationDelta, sourceFile, options); @@ -29039,6 +34315,8 @@ var ts; function getIndentationForNodeWorker(current, currentStart, ignoreActualIndentationRange, indentationDelta, sourceFile, options) { var parent = current.parent; var parentStart; + // walk upwards and collect indentations for pairs of parent-child nodes + // indentation is not added if parent and child nodes start on the same line or if parent is IfStatement and child starts on the same line with 'else clause' while (parent) { var useActualIndentation = true; if (ignoreActualIndentationRange) { @@ -29046,8 +34324,9 @@ var ts; useActualIndentation = start < ignoreActualIndentationRange.pos || start > ignoreActualIndentationRange.end; } if (useActualIndentation) { + // check if current node is a list item - if yes, take indentation from it var actualIndentation = getActualIndentationForListItem(current, sourceFile, options); - if (actualIndentation !== -1) { + if (actualIndentation !== -1 /* Unknown */) { return actualIndentation + indentationDelta; } } @@ -29055,11 +34334,13 @@ var ts; var parentAndChildShareLine = parentStart.line === currentStart.line || childStartsOnTheSameLineWithElseInIfStatement(parent, current, currentStart.line, sourceFile); if (useActualIndentation) { + // try to fetch actual indentation for current node from source text var actualIndentation = getActualIndentationForNode(current, parent, currentStart, parentAndChildShareLine, sourceFile, options); - if (actualIndentation !== -1) { + if (actualIndentation !== -1 /* Unknown */) { return actualIndentation + indentationDelta; } } + // increase indentation if parent node wants its content to be indented and parent and child nodes don't start on the same line if (shouldIndentChildNode(parent.kind, current.kind) && !parentAndChildShareLine) { indentationDelta += options.IndentSize; } @@ -29076,20 +34357,31 @@ var ts; } return sourceFile.getLineAndCharacterOfPosition(parent.getStart(sourceFile)); } + /* + * Function returns Value.Unknown if indentation cannot be determined + */ function getActualIndentationForListItemBeforeComma(commaToken, sourceFile, options) { + // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var commaItemInfo = ts.findListItemInfo(commaToken); if (commaItemInfo && commaItemInfo.listItemIndex > 0) { return deriveActualIndentationFromList(commaItemInfo.list.getChildren(), commaItemInfo.listItemIndex - 1, sourceFile, options); } else { - return -1; + // handle broken code gracefully + return -1 /* Unknown */; } } + /* + * Function returns Value.Unknown if actual indentation for node should not be used (i.e because node is nested expression) + */ function getActualIndentationForNode(current, parent, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { + // actual indentation is used for statements\declarations if one of cases below is true: + // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually + // - parent and child are not on the same line var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && - (parent.kind === 227 || !parentAndChildShareLine); + (parent.kind === 227 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { - return -1; + return -1 /* Unknown */; } return findColumnForFirstNonWhitespaceCharacterInLine(currentLineAndChar, sourceFile, options); } @@ -29098,10 +34390,19 @@ var ts; if (!nextToken) { return false; } - if (nextToken.kind === 14) { + if (nextToken.kind === 14 /* OpenBraceToken */) { + // open braces are always indented at the parent level return true; } - else if (nextToken.kind === 15) { + else if (nextToken.kind === 15 /* CloseBraceToken */) { + // close braces are indented at the parent level if they are located on the same line with cursor + // this means that if new line will be added at $ position, this case will be indented + // class A { + // $ + // } + /// and this one - not + // class A { + // $} var nextTokenStartLine = getStartLineAndCharacterForNode(nextToken, sourceFile).line; return lineAtPosition === nextTokenStartLine; } @@ -29111,8 +34412,8 @@ var ts; return sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)); } function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 183 && parent.elseStatement === child) { - var elseKeyword = ts.findChildOfKind(parent, 76, sourceFile); + if (parent.kind === 183 /* IfStatement */ && parent.elseStatement === child) { + var elseKeyword = ts.findChildOfKind(parent, 76 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; return elseKeywordStartLine === childStartLine; @@ -29123,23 +34424,23 @@ var ts; function getContainingList(node, sourceFile) { if (node.parent) { switch (node.parent.kind) { - case 141: + case 141 /* TypeReference */: if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd())) { return node.parent.typeArguments; } break; - case 154: + case 154 /* ObjectLiteralExpression */: return node.parent.properties; - case 153: + case 153 /* ArrayLiteralExpression */: return node.parent.elements; - case 200: - case 162: - case 163: - case 134: - case 133: - case 138: - case 139: { + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 138 /* CallSignature */: + case 139 /* ConstructSignature */: { var start = node.getStart(sourceFile); if (node.parent.typeParameters && ts.rangeContainsStartEnd(node.parent.typeParameters, start, node.getEnd())) { @@ -29150,8 +34451,8 @@ var ts; } break; } - case 158: - case 157: { + case 158 /* NewExpression */: + case 157 /* CallExpression */: { var start = node.getStart(sourceFile); if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { @@ -29169,32 +34470,42 @@ var ts; } function getActualIndentationForListItem(node, sourceFile, options) { var containingList = getContainingList(node, sourceFile); - return containingList ? getActualIndentationFromList(containingList) : -1; + return containingList ? getActualIndentationFromList(containingList) : -1 /* Unknown */; function getActualIndentationFromList(list) { var index = ts.indexOf(list, node); - return index !== -1 ? deriveActualIndentationFromList(list, index, sourceFile, options) : -1; + return index !== -1 ? deriveActualIndentationFromList(list, index, sourceFile, options) : -1 /* Unknown */; } } function deriveActualIndentationFromList(list, index, sourceFile, options) { ts.Debug.assert(index >= 0 && index < list.length); var node = list[index]; + // walk toward the start of the list starting from current node and check if the line is the same for all items. + // if end line for item [i - 1] differs from the start line for item [i] - find column of the first non-whitespace character on the line of item [i] var lineAndCharacter = getStartLineAndCharacterForNode(node, sourceFile); for (var i = index - 1; i >= 0; --i) { - if (list[i].kind === 23) { + if (list[i].kind === 23 /* CommaToken */) { continue; } + // skip list items that ends on the same line with the current list element var prevEndLine = sourceFile.getLineAndCharacterOfPosition(list[i].end).line; if (prevEndLine !== lineAndCharacter.line) { return findColumnForFirstNonWhitespaceCharacterInLine(lineAndCharacter, sourceFile, options); } lineAndCharacter = getStartLineAndCharacterForNode(list[i], sourceFile); } - return -1; + return -1 /* Unknown */; } function findColumnForFirstNonWhitespaceCharacterInLine(lineAndCharacter, sourceFile, options) { var lineStart = sourceFile.getPositionOfLineAndCharacter(lineAndCharacter.line, 0); return findFirstNonWhitespaceColumn(lineStart, lineStart + lineAndCharacter.character, sourceFile, options); } + /* + Character is the actual index of the character since the beginning of the line. + Column - position of the character after expanding tabs to spaces + "0\t2$" + value of 'character' for '$' is 3 + value of 'column' for '$' is 6 (assuming that tab size is 4) + */ function findFirstNonWhitespaceCharacterAndColumn(startPos, endPos, sourceFile, options) { var character = 0; var column = 0; @@ -29203,7 +34514,7 @@ var ts; if (!ts.isWhiteSpace(ch)) { break; } - if (ch === 9) { + if (ch === 9 /* tab */) { column += options.TabSize + (column % options.TabSize); } else { @@ -29220,28 +34531,28 @@ var ts; SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; function nodeContentIsAlwaysIndented(kind) { switch (kind) { - case 201: - case 202: - 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 191: - case 170: - case 151: - case 150: + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + case 204 /* EnumDeclaration */: + case 153 /* ArrayLiteralExpression */: + case 179 /* Block */: + case 206 /* ModuleBlock */: + case 154 /* ObjectLiteralExpression */: + case 145 /* TypeLiteral */: + case 147 /* TupleType */: + case 207 /* CaseBlock */: + case 221 /* DefaultClause */: + case 220 /* CaseClause */: + case 161 /* ParenthesizedExpression */: + case 157 /* CallExpression */: + case 158 /* NewExpression */: + case 180 /* VariableStatement */: + case 198 /* VariableDeclaration */: + case 214 /* ExportAssignment */: + case 191 /* ReturnStatement */: + case 170 /* ConditionalExpression */: + case 151 /* ArrayBindingPattern */: + case 150 /* ObjectBindingPattern */: return true; } return false; @@ -29251,22 +34562,22 @@ var ts; return true; } switch (parent) { - case 184: - case 185: - case 187: - case 188: - case 186: - case 183: - case 200: - case 162: - case 134: - case 133: - case 138: - case 163: - case 135: - case 136: - case 137: - return child !== 179; + case 184 /* DoStatement */: + case 185 /* WhileStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: + case 186 /* ForStatement */: + case 183 /* IfStatement */: + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 138 /* CallSignature */: + case 163 /* ArrowFunction */: + case 135 /* Constructor */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + return child !== 179 /* Block */; default: return false; } @@ -29293,6 +34604,7 @@ var __extends = this.__extends || function (d, b) { /// var ts; (function (ts) { + /** The version of the language service API */ ts.servicesVersion = "0.4"; var ScriptSnapshot; (function (ScriptSnapshot) { @@ -29308,6 +34620,8 @@ var ts; return this.text.length; }; StringScriptSnapshot.prototype.getChangeRange = function (oldSnapshot) { + // Text-based snapshots do not support incremental parsing. Return undefined + // to signal that to the caller. return undefined; }; return StringScriptSnapshot; @@ -29317,7 +34631,7 @@ var ts; } ScriptSnapshot.fromString = fromString; })(ScriptSnapshot = ts.ScriptSnapshot || (ts.ScriptSnapshot = {})); - var scanner = ts.createScanner(2, true); + var scanner = ts.createScanner(2 /* Latest */, true); var emptyArray = []; function createNode(kind, pos, end, flags, parent) { var node = new (ts.getNodeConstructor(kind))(); @@ -29362,13 +34676,13 @@ var ts; while (pos < end) { var token = scanner.scan(); var textPos = scanner.getTextPos(); - nodes.push(createNode(token, pos, textPos, 1024, this)); + nodes.push(createNode(token, pos, textPos, 1024 /* Synthetic */, this)); pos = textPos; } return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(228, nodes.pos, nodes.end, 1024, this); + var list = createNode(228 /* SyntaxList */, nodes.pos, nodes.end, 1024 /* Synthetic */, this); list._children = []; var pos = nodes.pos; for (var _i = 0; _i < nodes.length; _i++) { @@ -29387,7 +34701,7 @@ var ts; NodeObject.prototype.createChildren = function (sourceFile) { var _this = this; var children; - if (this.kind >= 126) { + if (this.kind >= 126 /* FirstNode */) { scanner.setText((sourceFile || this.getSourceFile()).text); children = []; var pos = this.pos; @@ -29432,7 +34746,7 @@ var ts; var children = this.getChildren(); for (var _i = 0; _i < children.length; _i++) { var child = children[_i]; - if (child.kind < 126) { + if (child.kind < 126 /* FirstNode */) { return child; } return child.getFirstToken(sourceFile); @@ -29442,7 +34756,7 @@ var ts; var children = this.getChildren(sourceFile); for (var i = children.length - 1; i >= 0; i--) { var child = children[i]; - if (child.kind < 126) { + if (child.kind < 126 /* FirstNode */) { return child; } return child.getLastToken(sourceFile); @@ -29466,7 +34780,7 @@ var ts; }; SymbolObject.prototype.getDocumentationComment = function () { if (this.documentationComment === undefined) { - this.documentationComment = getJsDocCommentsFromDeclarations(this.declarations, this.name, !(this.flags & 4)); + this.documentationComment = getJsDocCommentsFromDeclarations(this.declarations, this.name, !(this.flags & 4 /* Property */)); } return this.documentationComment; }; @@ -29486,9 +34800,16 @@ var ts; var paramTag = "@param"; var jsDocCommentParts = []; ts.forEach(declarations, function (declaration, indexOfDeclaration) { + // Make sure we are collecting doc comment from declaration once, + // In case of union property there might be same declaration multiple times + // which only varies in type parameter + // Eg. let a: Array | Array; a.length + // The property length will have two declarations of property length coming + // from Array - Array and Array if (ts.indexOf(declarations, declaration) === indexOfDeclaration) { var sourceFileOfDeclaration = ts.getSourceFileOfNode(declaration); - if (canUseParsedParamTagComments && declaration.kind === 129) { + // If it is parameter - try and get the jsDoc comment with @param tag from function declaration's jsDoc comments + if (canUseParsedParamTagComments && declaration.kind === 129 /* Parameter */) { ts.forEach(getJsDocCommentTextRange(declaration.parent, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedParamJsDocComment = getCleanedParamJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedParamJsDocComment) { @@ -29496,13 +34817,16 @@ var ts; } }); } - if (declaration.kind === 205 && declaration.body.kind === 205) { + // If this is left side of dotted module declaration, there is no doc comments associated with this node + if (declaration.kind === 205 /* ModuleDeclaration */ && declaration.body.kind === 205 /* ModuleDeclaration */) { return; } - while (declaration.kind === 205 && declaration.parent.kind === 205) { + // If this is dotted module name, get the doc comments from the parent + while (declaration.kind === 205 /* ModuleDeclaration */ && declaration.parent.kind === 205 /* ModuleDeclaration */) { declaration = declaration.parent; } - ts.forEach(getJsDocCommentTextRange(declaration.kind === 198 ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { + // Get the cleaned js doc comment text from the declaration + ts.forEach(getJsDocCommentTextRange(declaration.kind === 198 /* VariableDeclaration */ ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedJsDocComment = getCleanedJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedJsDocComment) { jsDocCommentParts.push.apply(jsDocCommentParts, cleanedJsDocComment); @@ -29515,7 +34839,7 @@ var ts; return ts.map(ts.getJsDocComments(node, sourceFile), function (jsDocComment) { return { pos: jsDocComment.pos + "/*".length, - end: jsDocComment.end - "*/".length + end: jsDocComment.end - "*/".length // Trim off comment end indicator }; }); } @@ -29526,6 +34850,7 @@ var ts; for (; pos < end; pos++) { var ch = sourceFile.text.charCodeAt(pos); if (!ts.isWhiteSpace(ch) || ts.isLineBreak(ch)) { + // Either found lineBreak or non whiteSpace return pos; } } @@ -29544,9 +34869,11 @@ var ts; ts.isLineBreak(sourceFile.text.charCodeAt(pos + name.length))); } function isParamTag(pos, end, sourceFile) { + // If it is @param tag return isName(pos, end, sourceFile, paramTag); } function pushDocCommentLineText(docComments, text, blankLineCount) { + // Add the empty lines in between texts while (blankLineCount--) { docComments.push(ts.textPart("")); } @@ -29559,10 +34886,13 @@ var ts; var isInParamTag = false; while (pos < end) { var docCommentTextOfLine = ""; + // First consume leading white space pos = consumeWhiteSpacesOnTheLine(pos, end, sourceFile); - if (pos < end && sourceFile.text.charCodeAt(pos) === 42) { + // If the comment starts with '*' consume the spaces on this line + if (pos < end && sourceFile.text.charCodeAt(pos) === 42 /* asterisk */) { var lineStartPos = pos + 1; pos = consumeWhiteSpacesOnTheLine(pos + 1, end, sourceFile, spacesToRemoveAfterAsterisk); + // Set the spaces to remove after asterisk as margin if not already set if (spacesToRemoveAfterAsterisk === undefined && pos < end && !ts.isLineBreak(sourceFile.text.charCodeAt(pos))) { spacesToRemoveAfterAsterisk = pos - lineStartPos; } @@ -29570,9 +34900,11 @@ var ts; else if (spacesToRemoveAfterAsterisk === undefined) { spacesToRemoveAfterAsterisk = 0; } + // Analyse text on this line while (pos < end && !ts.isLineBreak(sourceFile.text.charCodeAt(pos))) { var ch = sourceFile.text.charAt(pos); if (ch === "@") { + // If it is @param tag if (isParamTag(pos, end, sourceFile)) { isInParamTag = true; pos += paramTag.length; @@ -29582,17 +34914,21 @@ var ts; isInParamTag = false; } } + // Add the ch to doc text if we arent in param tag if (!isInParamTag) { docCommentTextOfLine += ch; } + // Scan next character pos++; } + // Continue with next line pos = consumeLineBreaks(pos, end, sourceFile); if (docCommentTextOfLine) { pushDocCommentLineText(docComments, docCommentTextOfLine, blankLineCount); blankLineCount = 0; } else if (!isInParamTag && docComments.length) { + // This is blank line when there is text already parsed blankLineCount++; } } @@ -29605,38 +34941,48 @@ var ts; if (isParamTag(pos, end, sourceFile)) { var blankLineCount = 0; var recordedParamTag = false; + // Consume leading spaces pos = consumeWhiteSpaces(pos + paramTag.length); if (pos >= end) { break; } - if (sourceFile.text.charCodeAt(pos) === 123) { + // Ignore type expression + if (sourceFile.text.charCodeAt(pos) === 123 /* openBrace */) { pos++; for (var curlies = 1; pos < end; pos++) { var charCode = sourceFile.text.charCodeAt(pos); - if (charCode === 123) { + // { character means we need to find another } to match the found one + if (charCode === 123 /* openBrace */) { curlies++; continue; } - if (charCode === 125) { + // } char + if (charCode === 125 /* closeBrace */) { curlies--; if (curlies === 0) { + // We do not have any more } to match the type expression is ignored completely pos++; break; } else { + // there are more { to be matched with } continue; } } - if (charCode === 64) { + // Found start of another tag + if (charCode === 64 /* at */) { break; } } + // Consume white spaces pos = consumeWhiteSpaces(pos); if (pos >= end) { break; } } + // Parameter name if (isName(pos, end, sourceFile, name)) { + // Found the parameter we are looking for consume white spaces pos = consumeWhiteSpaces(pos + name.length); if (pos >= end) { break; @@ -29645,6 +34991,7 @@ var ts; var firstLineParamHelpStringPos = pos; while (pos < end) { var ch = sourceFile.text.charCodeAt(pos); + // at line break, set this comment line text and go to next line if (ts.isLineBreak(ch)) { if (paramHelpString) { pushDocCommentLineText(paramDocComments, paramHelpString, blankLineCount); @@ -29655,24 +35002,30 @@ var ts; else if (recordedParamTag) { blankLineCount++; } + // Get the pos after cleaning start of the line setPosForParamHelpStringOnNextLine(firstLineParamHelpStringPos); continue; } - if (ch === 64) { + // Done scanning param help string - next tag found + if (ch === 64 /* at */) { break; } paramHelpString += sourceFile.text.charAt(pos); + // Go to next character pos++; } + // If there is param help text, add it top the doc comments if (paramHelpString) { pushDocCommentLineText(paramDocComments, paramHelpString, blankLineCount); } paramHelpStringMargin = undefined; } - if (sourceFile.text.charCodeAt(pos) === 64) { + // If this is the start of another tag, continue with the loop in seach of param tag with symbol name + if (sourceFile.text.charCodeAt(pos) === 64 /* at */) { continue; } } + // Next character pos++; } return paramDocComments; @@ -29683,6 +35036,7 @@ var ts; return pos; } function setPosForParamHelpStringOnNextLine(firstLineParamHelpStringPos) { + // Get the pos after consuming line breaks pos = consumeLineBreaks(pos, end, sourceFile); if (pos >= end) { return; @@ -29690,6 +35044,7 @@ var ts; if (paramHelpStringMargin === undefined) { paramHelpStringMargin = sourceFile.getLineAndCharacterOfPosition(firstLineParamHelpStringPos).character; } + // Now consume white spaces max var startOfLinePos = pos; pos = consumeWhiteSpacesOnTheLine(pos, end, sourceFile, paramHelpStringMargin); if (pos >= end) { @@ -29698,7 +35053,8 @@ var ts; var consumedSpaces = pos - startOfLinePos; if (consumedSpaces < paramHelpStringMargin) { var ch = sourceFile.text.charCodeAt(pos); - if (ch === 42) { + if (ch === 42 /* asterisk */) { + // Consume more spaces after asterisk pos = consumeWhiteSpacesOnTheLine(pos + 1, end, sourceFile, paramHelpStringMargin - consumedSpaces - 1); } } @@ -29727,16 +35083,16 @@ var ts; return this.checker.getAugmentedPropertiesOfType(this); }; TypeObject.prototype.getCallSignatures = function () { - return this.checker.getSignaturesOfType(this, 0); + return this.checker.getSignaturesOfType(this, 0 /* Call */); }; TypeObject.prototype.getConstructSignatures = function () { - return this.checker.getSignaturesOfType(this, 1); + return this.checker.getSignaturesOfType(this, 1 /* Construct */); }; TypeObject.prototype.getStringIndexType = function () { - return this.checker.getIndexTypeOfType(this, 0); + return this.checker.getIndexTypeOfType(this, 0 /* String */); }; TypeObject.prototype.getNumberIndexType = function () { - return this.checker.getIndexTypeOfType(this, 1); + return this.checker.getIndexTypeOfType(this, 1 /* Number */); }; return TypeObject; })(); @@ -29758,7 +35114,9 @@ var ts; }; SignatureObject.prototype.getDocumentationComment = function () { if (this.documentationComment === undefined) { - this.documentationComment = this.declaration ? getJsDocCommentsFromDeclarations([this.declaration], undefined, false) : []; + this.documentationComment = this.declaration ? getJsDocCommentsFromDeclarations([this.declaration], + /*name*/ undefined, + /*canUseParsedParamTagComments*/ false) : []; } return this.documentationComment; }; @@ -29783,101 +35141,151 @@ var ts; }; SourceFileObject.prototype.getNamedDeclarations = function () { if (!this.namedDeclarations) { - var sourceFile = this; - var namedDeclarations = []; - ts.forEachChild(sourceFile, function visit(node) { - switch (node.kind) { - case 200: - case 134: - case 133: - var functionDeclaration = node; - if (functionDeclaration.name && functionDeclaration.name.getFullWidth() > 0) { - var lastDeclaration = namedDeclarations.length > 0 ? - namedDeclarations[namedDeclarations.length - 1] : - undefined; - if (lastDeclaration && functionDeclaration.symbol === lastDeclaration.symbol) { - if (functionDeclaration.body && !lastDeclaration.body) { - namedDeclarations[namedDeclarations.length - 1] = functionDeclaration; - } - } - else { - namedDeclarations.push(functionDeclaration); - } - ts.forEachChild(node, visit); - } - break; - case 201: - case 202: - case 203: - case 204: - case 205: - case 208: - case 217: - case 213: - case 208: - case 210: - case 211: - case 136: - case 137: - case 145: - if (node.name) { - namedDeclarations.push(node); - } - case 135: - case 180: - case 199: - case 150: - case 151: - case 206: - ts.forEachChild(node, visit); - break; - case 179: - if (ts.isFunctionBlock(node)) { - ts.forEachChild(node, visit); - } - break; - case 129: - if (!(node.flags & 112)) { - break; - } - case 198: - case 152: - if (ts.isBindingPattern(node.name)) { - ts.forEachChild(node.name, visit); - break; - } - case 226: - case 132: - case 131: - namedDeclarations.push(node); - break; - case 215: - if (node.exportClause) { - ts.forEach(node.exportClause.elements, visit); - } - break; - case 209: - var importClause = node.importClause; - if (importClause) { - if (importClause.name) { - namedDeclarations.push(importClause); - } - if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 211) { - namedDeclarations.push(importClause.namedBindings); - } - else { - ts.forEach(importClause.namedBindings.elements, visit); - } - } - } - break; - } - }); - this.namedDeclarations = namedDeclarations; + this.namedDeclarations = this.computeNamedDeclarations(); } return this.namedDeclarations; }; + SourceFileObject.prototype.computeNamedDeclarations = function () { + var result = {}; + ts.forEachChild(this, visit); + return result; + function addDeclaration(declaration) { + var name = getDeclarationName(declaration); + if (name) { + var declarations = getDeclarations(name); + declarations.push(declaration); + } + } + function getDeclarations(name) { + return ts.getProperty(result, name) || (result[name] = []); + } + function getDeclarationName(declaration) { + if (declaration.name) { + var result_2 = getTextOfIdentifierOrLiteral(declaration.name); + if (result_2 !== undefined) { + return result_2; + } + if (declaration.name.kind === 127 /* ComputedPropertyName */) { + var expr = declaration.name.expression; + if (expr.kind === 155 /* PropertyAccessExpression */) { + return expr.name.text; + } + return getTextOfIdentifierOrLiteral(expr); + } + } + return undefined; + } + function getTextOfIdentifierOrLiteral(node) { + if (node) { + if (node.kind === 65 /* Identifier */ || + node.kind === 8 /* StringLiteral */ || + node.kind === 7 /* NumericLiteral */) { + return node.text; + } + } + return undefined; + } + function visit(node) { + switch (node.kind) { + case 200 /* FunctionDeclaration */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + var functionDeclaration = node; + var declarationName = getDeclarationName(functionDeclaration); + if (declarationName) { + var declarations = getDeclarations(declarationName); + var lastDeclaration = ts.lastOrUndefined(declarations); + // Check whether this declaration belongs to an "overload group". + if (lastDeclaration && functionDeclaration.parent === lastDeclaration.parent && functionDeclaration.symbol === lastDeclaration.symbol) { + // Overwrite the last declaration if it was an overload + // and this one is an implementation. + if (functionDeclaration.body && !lastDeclaration.body) { + declarations[declarations.length - 1] = functionDeclaration; + } + } + else { + declarations.push(functionDeclaration); + } + ts.forEachChild(node, visit); + } + break; + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + case 203 /* TypeAliasDeclaration */: + case 204 /* EnumDeclaration */: + case 205 /* ModuleDeclaration */: + case 208 /* ImportEqualsDeclaration */: + case 217 /* ExportSpecifier */: + case 213 /* ImportSpecifier */: + case 208 /* ImportEqualsDeclaration */: + case 210 /* ImportClause */: + case 211 /* NamespaceImport */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 145 /* TypeLiteral */: + addDeclaration(node); + // fall through + case 135 /* Constructor */: + case 180 /* VariableStatement */: + case 199 /* VariableDeclarationList */: + case 150 /* ObjectBindingPattern */: + case 151 /* ArrayBindingPattern */: + case 206 /* ModuleBlock */: + ts.forEachChild(node, visit); + break; + case 179 /* Block */: + if (ts.isFunctionBlock(node)) { + ts.forEachChild(node, visit); + } + break; + case 129 /* Parameter */: + // Only consider properties defined as constructor parameters + if (!(node.flags & 112 /* AccessibilityModifier */)) { + break; + } + // fall through + case 198 /* VariableDeclaration */: + case 152 /* BindingElement */: + if (ts.isBindingPattern(node.name)) { + ts.forEachChild(node.name, visit); + break; + } + case 226 /* EnumMember */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + addDeclaration(node); + break; + case 215 /* ExportDeclaration */: + // Handle named exports case e.g.: + // export {a, b as B} from "mod"; + if (node.exportClause) { + ts.forEach(node.exportClause.elements, visit); + } + break; + case 209 /* ImportDeclaration */: + var importClause = node.importClause; + if (importClause) { + // Handle default import case e.g.: + // import d from "mod"; + if (importClause.name) { + addDeclaration(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 === 211 /* NamespaceImport */) { + addDeclaration(importClause.namedBindings); + } + else { + ts.forEach(importClause.namedBindings.elements, visit); + } + } + } + break; + } + } + }; return SourceFileObject; })(NodeObject); var TextChange = (function () { @@ -29886,6 +35294,13 @@ var ts; return TextChange; })(); ts.TextChange = TextChange; + var HighlightSpanKind; + (function (HighlightSpanKind) { + HighlightSpanKind.none = "none"; + HighlightSpanKind.definition = "definition"; + HighlightSpanKind.reference = "reference"; + HighlightSpanKind.writtenReference = "writtenReference"; + })(HighlightSpanKind = ts.HighlightSpanKind || (ts.HighlightSpanKind = {})); (function (SymbolDisplayPartKind) { SymbolDisplayPartKind[SymbolDisplayPartKind["aliasName"] = 0] = "aliasName"; SymbolDisplayPartKind[SymbolDisplayPartKind["className"] = 1] = "className"; @@ -29939,29 +35354,52 @@ var ts; TokenClass[TokenClass["RegExpLiteral"] = 8] = "RegExpLiteral"; })(ts.TokenClass || (ts.TokenClass = {})); var TokenClass = ts.TokenClass; - var ScriptElementKind = (function () { - function ScriptElementKind() { - } + // TODO: move these to enums + var ScriptElementKind; + (function (ScriptElementKind) { ScriptElementKind.unknown = ""; + ScriptElementKind.warning = "warning"; + // predefined type (void) or keyword (class) ScriptElementKind.keyword = "keyword"; + // top level script node ScriptElementKind.scriptElement = "script"; + // module foo {} ScriptElementKind.moduleElement = "module"; + // class X {} ScriptElementKind.classElement = "class"; + // interface Y {} ScriptElementKind.interfaceElement = "interface"; + // type T = ... ScriptElementKind.typeElement = "type"; + // enum E ScriptElementKind.enumElement = "enum"; + // Inside module and script only + // let v = .. ScriptElementKind.variableElement = "var"; + // Inside function ScriptElementKind.localVariableElement = "local var"; + // Inside module and script only + // function f() { } ScriptElementKind.functionElement = "function"; + // Inside function ScriptElementKind.localFunctionElement = "local function"; + // class X { [public|private]* foo() {} } ScriptElementKind.memberFunctionElement = "method"; + // class X { [public|private]* [get|set] foo:number; } ScriptElementKind.memberGetAccessorElement = "getter"; ScriptElementKind.memberSetAccessorElement = "setter"; + // class X { [public|private]* foo:number; } + // interface Y { foo:number; } ScriptElementKind.memberVariableElement = "property"; + // class X { constructor() { } } ScriptElementKind.constructorImplementationElement = "constructor"; + // interface Y { ():number; } ScriptElementKind.callSignatureElement = "call"; + // interface Y { []:number; } ScriptElementKind.indexSignatureElement = "index"; + // interface Y { new():Y; } ScriptElementKind.constructSignatureElement = "construct"; + // function foo(*Y*: string) ScriptElementKind.parameterElement = "parameter"; ScriptElementKind.typeParameterElement = "type parameter"; ScriptElementKind.primitiveType = "primitive type"; @@ -29969,12 +35407,9 @@ var ts; ScriptElementKind.alias = "alias"; ScriptElementKind.constElement = "const"; ScriptElementKind.letElement = "let"; - return ScriptElementKind; - })(); - ts.ScriptElementKind = ScriptElementKind; - var ScriptElementKindModifier = (function () { - function ScriptElementKindModifier() { - } + })(ScriptElementKind = ts.ScriptElementKind || (ts.ScriptElementKind = {})); + var ScriptElementKindModifier; + (function (ScriptElementKindModifier) { ScriptElementKindModifier.none = ""; ScriptElementKindModifier.publicMemberModifier = "public"; ScriptElementKindModifier.privateMemberModifier = "private"; @@ -29982,9 +35417,7 @@ var ts; ScriptElementKindModifier.exportedModifier = "export"; ScriptElementKindModifier.ambientModifier = "declare"; ScriptElementKindModifier.staticModifier = "static"; - return ScriptElementKindModifier; - })(); - ts.ScriptElementKindModifier = ScriptElementKindModifier; + })(ScriptElementKindModifier = ts.ScriptElementKindModifier || (ts.ScriptElementKindModifier = {})); var ClassificationTypeNames = (function () { function ClassificationTypeNames() { } @@ -30015,27 +35448,32 @@ var ts; ts.displayPartsToString = displayPartsToString; function isLocalVariableOrFunction(symbol) { if (symbol.parent) { - return false; + return false; // This is exported symbol } return ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 162) { + // Function expressions are local + if (declaration.kind === 162 /* FunctionExpression */) { return true; } - if (declaration.kind !== 198 && declaration.kind !== 200) { + if (declaration.kind !== 198 /* VariableDeclaration */ && declaration.kind !== 200 /* FunctionDeclaration */) { return false; } + // If the parent is not sourceFile or module block it is local variable for (var parent_7 = declaration.parent; !ts.isFunctionBlock(parent_7); parent_7 = parent_7.parent) { - if (parent_7.kind === 227 || parent_7.kind === 206) { + // Reached source file or module block + if (parent_7.kind === 227 /* SourceFile */ || parent_7.kind === 206 /* ModuleBlock */) { return false; } } + // parent is in function block return true; }); } function getDefaultCompilerOptions() { + // Always default to "ScriptTarget.ES5" for the language service return { - target: 1, - module: 0 + target: 1 /* ES5 */, + module: 0 /* None */ }; } ts.getDefaultCompilerOptions = getDefaultCompilerOptions; @@ -30061,15 +35499,21 @@ var ts; return CancellationTokenObject; })(); ts.CancellationTokenObject = CancellationTokenObject; + // Cache host information about scrip Should be refreshed + // at each language service public entry point, since we don't know when + // set of scripts handled by the host changes. var HostCache = (function () { function HostCache(host) { this.host = host; + // script id => script index this.fileNameToEntry = {}; + // Initialize the list with the root file names var rootFileNames = host.getScriptFileNames(); for (var _i = 0; _i < rootFileNames.length; _i++) { var fileName = rootFileNames[_i]; this.createEntry(fileName); } + // store the compilation settings this._compilationSettings = host.getCompilationSettings() || getDefaultCompilerOptions(); } HostCache.prototype.compilationSettings = function () { @@ -30125,18 +35569,22 @@ var ts; SyntaxTreeCache.prototype.getCurrentSourceFile = function (fileName) { var scriptSnapshot = this.host.getScriptSnapshot(fileName); if (!scriptSnapshot) { + // The host does not know about this file. throw new Error("Could not find file: '" + fileName + "'."); } var version = this.host.getScriptVersion(fileName); var sourceFile; if (this.currentFileName !== fileName) { - sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 2, version, true); + // This is a new file, just parse it + sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 2 /* Latest */, version, true); } else if (this.currentFileVersion !== version) { + // This is the same file, just a newer version. Incrementally parse the file. var editRange = scriptSnapshot.getChangeRange(this.currentFileScriptSnapshot); sourceFile = updateLanguageServiceSourceFile(this.currentSourceFile, scriptSnapshot, version, editRange); } if (sourceFile) { + // All done, ensure state is up to date this.currentFileVersion = version; this.currentFileName = fileName; this.currentFileScriptSnapshot = scriptSnapshot; @@ -30150,16 +35598,28 @@ var ts; sourceFile.version = version; 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 + */ function transpile(input, compilerOptions, fileName, diagnostics) { var options = compilerOptions ? ts.clone(compilerOptions) : getDefaultCompilerOptions(); options.separateCompilation = true; + // Filename can be non-ts file. options.allowNonTsExtensions = true; + // Parse var inputFileName = fileName || "module.ts"; var sourceFile = ts.createSourceFile(inputFileName, input, options.target); + // Store syntactic diagnostics if (diagnostics && sourceFile.parseDiagnostics) { diagnostics.push.apply(diagnostics, sourceFile.parseDiagnostics); } + // Output var outputText; + // Create a compilerHost object to allow the compiler to read and write files var compilerHost = { getSourceFile: function (fileName, target) { return fileName === inputFileName ? sourceFile : undefined; }, writeFile: function (name, text, writeByteOrderMark) { @@ -30170,12 +35630,13 @@ var ts; useCaseSensitiveFileNames: function () { return false; }, getCanonicalFileName: function (fileName) { return fileName; }, getCurrentDirectory: function () { return ""; }, - getNewLine: function () { return "\r\n"; } + getNewLine: function () { return (ts.sys && ts.sys.newLine) || "\r\n"; } }; var program = ts.createProgram([inputFileName], options, compilerHost); if (diagnostics) { diagnostics.push.apply(diagnostics, program.getGlobalDiagnostics()); } + // Emit program.emit(); ts.Debug.assert(outputText !== undefined, "Output generation failed"); return outputText; @@ -30184,29 +35645,38 @@ var ts; function createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTarget, version, setNodeParents) { var sourceFile = ts.createSourceFile(fileName, scriptSnapshot.getText(0, scriptSnapshot.getLength()), scriptTarget, setNodeParents); setSourceFileFields(sourceFile, scriptSnapshot, version); + // after full parsing we can use table with interned strings as name table sourceFile.nameTable = sourceFile.identifiers; return sourceFile; } ts.createLanguageServiceSourceFile = createLanguageServiceSourceFile; ts.disableIncrementalParsing = false; function updateLanguageServiceSourceFile(sourceFile, scriptSnapshot, version, textChangeRange, aggressiveChecks) { + // If we were given a text change range, and our version or open-ness changed, then + // incrementally parse this file. if (textChangeRange) { if (version !== sourceFile.version) { + // Once incremental parsing is ready, then just call into this function. if (!ts.disableIncrementalParsing) { var newSourceFile = ts.updateSourceFile(sourceFile, scriptSnapshot.getText(0, scriptSnapshot.getLength()), textChangeRange, aggressiveChecks); setSourceFileFields(newSourceFile, scriptSnapshot, version); + // after incremental parsing nameTable might not be up-to-date + // drop it so it can be lazily recreated later newSourceFile.nameTable = undefined; return newSourceFile; } } } + // Otherwise, just create a new source file. return createLanguageServiceSourceFile(sourceFile.fileName, scriptSnapshot, sourceFile.languageVersion, version, true); } ts.updateLanguageServiceSourceFile = updateLanguageServiceSourceFile; function createDocumentRegistry() { + // Maps from compiler setting target (ES3, ES5, etc.) to all the cached documents we have + // for those settings. var buckets = {}; function getKeyFromCompilationSettings(settings) { - return "_" + settings.target; + return "_" + settings.target; // + "|" + settings.propagateEnumConstantoString() } function getBucketForCompilationSettings(settings, createIfMissing) { var key = getKeyFromCompilationSettings(settings); @@ -30247,6 +35717,7 @@ var ts; var entry = ts.lookUp(bucket, fileName); if (!entry) { ts.Debug.assert(acquiring, "How could we be trying to update a document that the registry doesn't have?"); + // Have never seen this file with these settings. Create a new source file for it. var sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, compilationSettings.target, version, false); bucket[fileName] = entry = { sourceFile: sourceFile, @@ -30255,10 +35726,18 @@ var ts; }; } else { + // We have an entry for this file. However, it may be for a different version of + // the script snapshot. If so, update it appropriately. Otherwise, we can just + // return it as is. if (entry.sourceFile.version !== version) { entry.sourceFile = updateLanguageServiceSourceFile(entry.sourceFile, scriptSnapshot, version, scriptSnapshot.getChangeRange(entry.sourceFile.scriptSnapshot)); } } + // If we're acquiring, then this is the first time this LS is asking for this document. + // Increase our ref count so we know there's another LS using the document. If we're + // not acquiring, then that means the LS is 'updating' the file instead, and that means + // it has already acquired the document previously. As such, we do not need to increase + // the ref count. if (acquiring) { entry.languageServiceRefCount++; } @@ -30313,67 +35792,87 @@ var ts; function processImport() { scanner.setText(sourceText); var token = scanner.scan(); - while (token !== 1) { - if (token === 85) { + // Look for: + // import "mod"; + // import d from "mod" + // import {a as A } from "mod"; + // import * as NS from "mod" + // import d, {a, b as B} from "mod" + // import i = require("mod"); + // + // export * from "mod" + // export {a as b} from "mod" + while (token !== 1 /* EndOfFileToken */) { + if (token === 85 /* ImportKeyword */) { token = scanner.scan(); - if (token === 8) { + if (token === 8 /* StringLiteral */) { + // import "mod"; recordModuleName(); continue; } else { - if (token === 65) { + if (token === 65 /* Identifier */) { token = scanner.scan(); - if (token === 124) { + if (token === 124 /* FromKeyword */) { token = scanner.scan(); - if (token === 8) { + if (token === 8 /* StringLiteral */) { + // import d from "mod"; recordModuleName(); continue; } } - else if (token === 53) { + else if (token === 53 /* EqualsToken */) { token = scanner.scan(); - if (token === 118) { + if (token === 118 /* RequireKeyword */) { token = scanner.scan(); - if (token === 16) { + if (token === 16 /* OpenParenToken */) { token = scanner.scan(); - if (token === 8) { + if (token === 8 /* StringLiteral */) { + // import i = require("mod"); recordModuleName(); continue; } } } } - else if (token === 23) { + else if (token === 23 /* CommaToken */) { + // consume comma and keep going token = scanner.scan(); } else { + // unknown syntax continue; } } - if (token === 14) { + if (token === 14 /* OpenBraceToken */) { token = scanner.scan(); - while (token !== 15) { + // consume "{ a as B, c, d as D}" clauses + while (token !== 15 /* CloseBraceToken */) { token = scanner.scan(); } - if (token === 15) { + if (token === 15 /* CloseBraceToken */) { token = scanner.scan(); - if (token === 124) { + if (token === 124 /* FromKeyword */) { token = scanner.scan(); - if (token === 8) { + if (token === 8 /* StringLiteral */) { + // import {a as A} from "mod"; + // import d, {a, b as B} from "mod" recordModuleName(); } } } } - else if (token === 35) { + else if (token === 35 /* AsteriskToken */) { token = scanner.scan(); - if (token === 102) { + if (token === 111 /* AsKeyword */) { token = scanner.scan(); - if (token === 65) { + if (token === 65 /* Identifier */) { token = scanner.scan(); - if (token === 124) { + if (token === 124 /* FromKeyword */) { token = scanner.scan(); - if (token === 8) { + if (token === 8 /* StringLiteral */) { + // import * as NS from "mod" + // import d, * as NS from "mod" recordModuleName(); } } @@ -30382,28 +35881,32 @@ var ts; } } } - else if (token === 78) { + else if (token === 78 /* ExportKeyword */) { token = scanner.scan(); - if (token === 14) { + if (token === 14 /* OpenBraceToken */) { token = scanner.scan(); - while (token !== 15) { + // consume "{ a as B, c, d as D}" clauses + while (token !== 15 /* CloseBraceToken */) { token = scanner.scan(); } - if (token === 15) { + if (token === 15 /* CloseBraceToken */) { token = scanner.scan(); - if (token === 124) { + if (token === 124 /* FromKeyword */) { token = scanner.scan(); - if (token === 8) { + if (token === 8 /* StringLiteral */) { + // export {a as A} from "mod"; + // export {a, b as B} from "mod" recordModuleName(); } } } } - else if (token === 35) { + else if (token === 35 /* AsteriskToken */) { token = scanner.scan(); - if (token === 124) { + if (token === 124 /* FromKeyword */) { token = scanner.scan(); - if (token === 8) { + if (token === 8 /* StringLiteral */) { + // export * from "mod" recordModuleName(); } } @@ -30420,9 +35923,10 @@ var ts; return { referencedFiles: referencedFiles, importedFiles: importedFiles, isLibFile: isNoDefaultLib }; } ts.preProcessFile = preProcessFile; + /// Helpers function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 194 && referenceNode.label.text === labelName) { + if (referenceNode.kind === 194 /* LabeledStatement */ && referenceNode.label.text === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -30430,17 +35934,21 @@ var ts; return undefined; } function isJumpStatementTarget(node) { - return node.kind === 65 && - (node.parent.kind === 190 || node.parent.kind === 189) && + return node.kind === 65 /* Identifier */ && + (node.parent.kind === 190 /* BreakStatement */ || node.parent.kind === 189 /* ContinueStatement */) && node.parent.label === node; } function isLabelOfLabeledStatement(node) { - return node.kind === 65 && - node.parent.kind === 194 && + return node.kind === 65 /* Identifier */ && + node.parent.kind === 194 /* LabeledStatement */ && node.parent.label === node; } + /** + * Whether or not a 'node' is preceded by a label of the given string. + * Note: 'node' cannot be a SourceFile. + */ function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 194; owner = owner.parent) { + for (var owner = node.parent; owner.kind === 194 /* LabeledStatement */; owner = owner.parent) { if (owner.label.text === labelName) { return true; } @@ -30451,78 +35959,84 @@ var ts; return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); } function isRightSideOfQualifiedName(node) { - return node.parent.kind === 126 && node.parent.right === node; + return node.parent.kind === 126 /* QualifiedName */ && node.parent.right === node; } function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 155 && node.parent.name === node; + return node && node.parent && node.parent.kind === 155 /* PropertyAccessExpression */ && node.parent.name === node; } function isCallExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 157 && node.parent.expression === node; + return node && node.parent && node.parent.kind === 157 /* CallExpression */ && node.parent.expression === node; } function isNewExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 158 && node.parent.expression === node; + return node && node.parent && node.parent.kind === 158 /* NewExpression */ && node.parent.expression === node; } function isNameOfModuleDeclaration(node) { - return node.parent.kind === 205 && node.parent.name === node; + return node.parent.kind === 205 /* ModuleDeclaration */ && node.parent.name === node; } function isNameOfFunctionDeclaration(node) { - return node.kind === 65 && + return node.kind === 65 /* Identifier */ && ts.isFunctionLike(node.parent) && node.parent.name === node; } + /** Returns true if node is a name of an object literal property, e.g. "a" in x = { "a": 1 } */ function isNameOfPropertyAssignment(node) { - return (node.kind === 65 || node.kind === 8 || node.kind === 7) && - (node.parent.kind === 224 || node.parent.kind === 225) && node.parent.name === node; + return (node.kind === 65 /* Identifier */ || node.kind === 8 /* StringLiteral */ || node.kind === 7 /* NumericLiteral */) && + (node.parent.kind === 224 /* PropertyAssignment */ || node.parent.kind === 225 /* ShorthandPropertyAssignment */) && node.parent.name === node; } function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { - if (node.kind === 8 || node.kind === 7) { + if (node.kind === 8 /* StringLiteral */ || node.kind === 7 /* NumericLiteral */) { switch (node.parent.kind) { - case 132: - case 131: - case 224: - case 226: - case 134: - case 133: - case 136: - case 137: - case 205: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 224 /* PropertyAssignment */: + case 226 /* EnumMember */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 205 /* ModuleDeclaration */: return node.parent.name === node; - case 156: + case 156 /* ElementAccessExpression */: return node.parent.argumentExpression === node; } } return false; } function isNameOfExternalModuleImportOrDeclaration(node) { - if (node.kind === 8) { + if (node.kind === 8 /* StringLiteral */) { return isNameOfModuleDeclaration(node) || (ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node); } return false; } + /** Returns true if the position is within a comment */ function isInsideComment(sourceFile, token, position) { + // The position has to be: 1. in the leading trivia (before token.getStart()), and 2. within a comment return position <= token.getStart(sourceFile) && (isInsideCommentRange(ts.getTrailingCommentRanges(sourceFile.text, token.getFullStart())) || isInsideCommentRange(ts.getLeadingCommentRanges(sourceFile.text, token.getFullStart()))); function isInsideCommentRange(comments) { return ts.forEach(comments, function (comment) { + // either we are 1. completely inside the comment, or 2. at the end of the comment if (comment.pos < position && position < comment.end) { return true; } else if (position === comment.end) { var text = sourceFile.text; var width = comment.end - comment.pos; - if (width <= 2 || text.charCodeAt(comment.pos + 1) === 47) { + // is single line comment or just /* + if (width <= 2 || text.charCodeAt(comment.pos + 1) === 47 /* slash */) { return true; } else { - return !(text.charCodeAt(comment.end - 1) === 47 && - text.charCodeAt(comment.end - 2) === 42); + // is unterminated multi-line comment + return !(text.charCodeAt(comment.end - 1) === 47 /* slash */ && + text.charCodeAt(comment.end - 2) === 42 /* asterisk */); } } return false; @@ -30544,71 +36058,73 @@ var ts; BreakContinueSearchType[BreakContinueSearchType["Labeled"] = 2] = "Labeled"; BreakContinueSearchType[BreakContinueSearchType["All"] = 3] = "All"; })(BreakContinueSearchType || (BreakContinueSearchType = {})); + // A cache of completion entries for keywords, these do not change between sessions var keywordCompletions = []; - for (var i = 66; i <= 125; i++) { + for (var i = 66 /* FirstKeyword */; i <= 125 /* LastKeyword */; i++) { keywordCompletions.push({ name: ts.tokenToString(i), kind: ScriptElementKind.keyword, - kindModifiers: ScriptElementKindModifier.none + kindModifiers: ScriptElementKindModifier.none, + sortText: "0" }); } - function getContainerNode(node) { + /* @internal */ function getContainerNode(node) { while (true) { node = node.parent; if (!node) { return undefined; } switch (node.kind) { - case 227: - case 134: - case 133: - case 200: - case 162: - case 136: - case 137: - case 201: - case 202: - case 204: - case 205: + case 227 /* SourceFile */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 201 /* ClassDeclaration */: + case 202 /* InterfaceDeclaration */: + case 204 /* EnumDeclaration */: + case 205 /* ModuleDeclaration */: return node; } } } ts.getContainerNode = getContainerNode; - function getNodeKind(node) { + /* @internal */ function getNodeKind(node) { switch (node.kind) { - case 205: return ScriptElementKind.moduleElement; - case 201: return ScriptElementKind.classElement; - case 202: return ScriptElementKind.interfaceElement; - case 203: return ScriptElementKind.typeElement; - case 204: return ScriptElementKind.enumElement; - case 198: + case 205 /* ModuleDeclaration */: return ScriptElementKind.moduleElement; + case 201 /* ClassDeclaration */: return ScriptElementKind.classElement; + case 202 /* InterfaceDeclaration */: return ScriptElementKind.interfaceElement; + case 203 /* TypeAliasDeclaration */: return ScriptElementKind.typeElement; + case 204 /* EnumDeclaration */: return ScriptElementKind.enumElement; + case 198 /* VariableDeclaration */: return ts.isConst(node) ? ScriptElementKind.constElement : ts.isLet(node) ? ScriptElementKind.letElement : ScriptElementKind.variableElement; - case 200: return ScriptElementKind.functionElement; - case 136: return ScriptElementKind.memberGetAccessorElement; - case 137: return ScriptElementKind.memberSetAccessorElement; - case 134: - case 133: + case 200 /* FunctionDeclaration */: return ScriptElementKind.functionElement; + case 136 /* GetAccessor */: return ScriptElementKind.memberGetAccessorElement; + case 137 /* SetAccessor */: return ScriptElementKind.memberSetAccessorElement; + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: return ScriptElementKind.memberFunctionElement; - case 132: - case 131: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: return ScriptElementKind.memberVariableElement; - case 140: return ScriptElementKind.indexSignatureElement; - case 139: return ScriptElementKind.constructSignatureElement; - case 138: return ScriptElementKind.callSignatureElement; - case 135: return ScriptElementKind.constructorImplementationElement; - case 128: return ScriptElementKind.typeParameterElement; - case 226: return ScriptElementKind.variableElement; - case 129: return (node.flags & 112) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; - case 208: - case 213: - case 210: - case 217: - case 211: + case 140 /* IndexSignature */: return ScriptElementKind.indexSignatureElement; + case 139 /* ConstructSignature */: return ScriptElementKind.constructSignatureElement; + case 138 /* CallSignature */: return ScriptElementKind.callSignatureElement; + case 135 /* Constructor */: return ScriptElementKind.constructorImplementationElement; + case 128 /* TypeParameter */: return ScriptElementKind.typeParameterElement; + case 226 /* EnumMember */: return ScriptElementKind.variableElement; + case 129 /* Parameter */: return (node.flags & 112 /* AccessibilityModifier */) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; + case 208 /* ImportEqualsDeclaration */: + case 213 /* ImportSpecifier */: + case 210 /* ImportClause */: + case 217 /* ExportSpecifier */: + case 211 /* NamespaceImport */: return ScriptElementKind.alias; } return ScriptElementKind.unknown; @@ -30619,9 +36135,9 @@ var ts; var syntaxTreeCache = new SyntaxTreeCache(host); var ruleProvider; var program; - var typeInfoResolver; var useCaseSensitivefileNames = false; var cancellationToken = new CancellationTokenObject(host.getCancellationToken && host.getCancellationToken()); + // Check if the localized messages json is set, otherwise query the host for it if (!ts.localizedDiagnosticMessages && host.getLocalizedDiagnosticMessages) { ts.localizedDiagnosticMessages = host.getLocalizedDiagnosticMessages(); } @@ -30642,6 +36158,7 @@ var ts; return sourceFile; } function getRuleProvider(options) { + // Ensure rules are initialized and up to date wrt to formatting options if (!ruleProvider) { ruleProvider = new ts.formatting.RulesProvider(); } @@ -30649,13 +36166,21 @@ var ts; return ruleProvider; } function synchronizeHostData() { + // Get a fresh cache of the host information var hostCache = new HostCache(host); + // If the program is already up-to-date, we can reuse it if (programUpToDate()) { return; } + // IMPORTANT - It is critical from this moment onward that we do not check + // cancellation tokens. We are about to mutate source files from a previous program + // instance. If we cancel midway through, we may end up in an inconsistent state where + // the program points to old source files that have been invalidated because of + // incremental parsing. var oldSettings = program && program.getCompilerOptions(); var newSettings = hostCache.compilationSettings(); var changesInCompilationSettingsAffectSyntax = oldSettings && oldSettings.target !== newSettings.target; + // Now create a new compiler var newProgram = ts.createProgram(hostCache.getRootFileNames(), newSettings, { getSourceFile: getOrCreateSourceFile, getCancellationToken: function () { return cancellationToken; }, @@ -30666,6 +36191,8 @@ var ts; writeFile: function (fileName, data, writeByteOrderMark) { }, getCurrentDirectory: function () { return host.getCurrentDirectory(); } }); + // Release any files we have acquired in the old program but are + // not part of the new program. if (program) { var oldSourceFiles = program.getSourceFiles(); for (var _i = 0; _i < oldSourceFiles.length; _i++) { @@ -30677,38 +36204,73 @@ var ts; } } program = newProgram; - typeInfoResolver = program.getTypeChecker(); + // Make sure all the nodes in the program are both bound, and have their parent + // pointers set property. + program.getTypeChecker(); return; function getOrCreateSourceFile(fileName) { + // The program is asking for this file, check first if the host can locate it. + // If the host can not locate the file, then it does not exist. return undefined + // to the program to allow reporting of errors for missing files. var hostFileInformation = hostCache.getOrCreateEntry(fileName); if (!hostFileInformation) { return undefined; } + // Check if the language version has changed since we last created a program; if they are the same, + // it is safe to reuse the souceFiles; if not, then the shape of the AST can change, and the oldSourceFile + // can not be reused. we have to dump all syntax trees and create new ones. if (!changesInCompilationSettingsAffectSyntax) { + // Check if the old program had this file already var oldSourceFile = program && program.getSourceFile(fileName); if (oldSourceFile) { + // We already had a source file for this file name. Go to the registry to + // ensure that we get the right up to date version of it. We need this to + // address the following 'race'. Specifically, say we have the following: + // + // LS1 + // \ + // DocumentRegistry + // / + // LS2 + // + // Each LS has a reference to file 'foo.ts' at version 1. LS2 then updates + // it's version of 'foo.ts' to version 2. This will cause LS2 and the + // DocumentRegistry to have version 2 of the document. HOwever, LS1 will + // have version 1. And *importantly* this source file will be *corrupt*. + // The act of creating version 2 of the file irrevocably damages the version + // 1 file. + // + // So, later when we call into LS1, we need to make sure that it doesn't use + // it's source file any more, and instead defers to DocumentRegistry to get + // either version 1, version 2 (or some other version) depending on what the + // host says should be used. return documentRegistry.updateDocument(fileName, newSettings, hostFileInformation.scriptSnapshot, hostFileInformation.version); } } + // Could not find this file in the old program, create a new SourceFile for it. return documentRegistry.acquireDocument(fileName, newSettings, hostFileInformation.scriptSnapshot, hostFileInformation.version); } function sourceFileUpToDate(sourceFile) { return sourceFile && sourceFile.version === hostCache.getVersion(sourceFile.fileName); } function programUpToDate() { + // If we haven't create a program yet, then it is not up-to-date if (!program) { return false; } + // If number of files in the program do not match, it is not up-to-date var rootFileNames = hostCache.getRootFileNames(); if (program.getSourceFiles().length !== rootFileNames.length) { return false; } + // If any file is not up-to-date, then the whole program is not up-to-date for (var _i = 0; _i < rootFileNames.length; _i++) { var fileName = rootFileNames[_i]; if (!sourceFileUpToDate(program.getSourceFile(fileName))) { return false; } } + // If the compilation settings do no match, then the program is not up-to-date return ts.compareDataObjects(program.getCompilerOptions(), hostCache.compilationSettings()); } } @@ -30717,9 +36279,7 @@ var ts; return program; } function cleanupSemanticCache() { - if (program) { - typeInfoResolver = program.getTypeChecker(); - } + // TODO: Should we jettison the program (or it's type checker) here? } function dispose() { if (program) { @@ -30728,41 +36288,213 @@ var ts; }); } } + /// Diagnostics function getSyntacticDiagnostics(fileName) { synchronizeHostData(); return program.getSyntacticDiagnostics(getValidSourceFile(fileName)); } + /** + * 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) { synchronizeHostData(); var 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 (ts.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. var semanticDiagnostics = program.getSemanticDiagnostics(targetSourceFile); if (!program.getCompilerOptions().declaration) { return semanticDiagnostics; } + // If '-d' is enabled, check for emitter error. One example of emitter error is export class implements non-export interface var declarationDiagnostics = program.getDeclarationDiagnostics(targetSourceFile); return ts.concatenate(semanticDiagnostics, declarationDiagnostics); } + function getJavaScriptSemanticDiagnostics(sourceFile) { + var diagnostics = []; + walk(sourceFile); + return diagnostics; + function walk(node) { + if (!node) { + return false; + } + switch (node.kind) { + case 208 /* ImportEqualsDeclaration */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); + return true; + case 214 /* ExportAssignment */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); + return true; + case 201 /* ClassDeclaration */: + var classDeclaration = node; + if (checkModifiers(classDeclaration.modifiers) || + checkTypeParameters(classDeclaration.typeParameters)) { + return true; + } + break; + case 222 /* HeritageClause */: + var heritageClause = node; + if (heritageClause.token === 102 /* ImplementsKeyword */) { + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); + return true; + } + break; + case 202 /* InterfaceDeclaration */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 205 /* ModuleDeclaration */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 203 /* TypeAliasDeclaration */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); + return true; + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 135 /* Constructor */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 162 /* FunctionExpression */: + case 200 /* FunctionDeclaration */: + case 163 /* ArrowFunction */: + case 200 /* FunctionDeclaration */: + var functionDeclaration = node; + if (checkModifiers(functionDeclaration.modifiers) || + checkTypeParameters(functionDeclaration.typeParameters) || + checkTypeAnnotation(functionDeclaration.type)) { + return true; + } + break; + case 180 /* VariableStatement */: + var variableStatement = node; + if (checkModifiers(variableStatement.modifiers)) { + return true; + } + break; + case 198 /* VariableDeclaration */: + var variableDeclaration = node; + if (checkTypeAnnotation(variableDeclaration.type)) { + return true; + } + break; + case 157 /* CallExpression */: + case 158 /* NewExpression */: + var expression = node; + if (expression.typeArguments && expression.typeArguments.length > 0) { + var start = expression.typeArguments.pos; + diagnostics.push(ts.createFileDiagnostic(sourceFile, start, expression.typeArguments.end - start, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); + return true; + } + break; + case 129 /* Parameter */: + var parameter = node; + if (parameter.modifiers) { + var start = parameter.modifiers.pos; + diagnostics.push(ts.createFileDiagnostic(sourceFile, start, parameter.modifiers.end - start, ts.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)); + return true; + } + if (parameter.questionToken) { + diagnostics.push(ts.createDiagnosticForNode(parameter.questionToken, ts.Diagnostics.can_only_be_used_in_a_ts_file)); + return true; + } + if (parameter.type) { + diagnostics.push(ts.createDiagnosticForNode(parameter.type, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); + return true; + } + break; + case 132 /* PropertyDeclaration */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.property_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 204 /* EnumDeclaration */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); + return true; + case 160 /* TypeAssertionExpression */: + var typeAssertionExpression = node; + diagnostics.push(ts.createDiagnosticForNode(typeAssertionExpression.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); + return true; + case 130 /* Decorator */: + diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.decorators_can_only_be_used_in_a_ts_file)); + return true; + } + return ts.forEachChild(node, walk); + } + function checkTypeParameters(typeParameters) { + if (typeParameters) { + var start = typeParameters.pos; + diagnostics.push(ts.createFileDiagnostic(sourceFile, start, typeParameters.end - start, ts.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)); + return true; + } + return false; + } + function checkTypeAnnotation(type) { + if (type) { + diagnostics.push(ts.createDiagnosticForNode(type, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); + return true; + } + return false; + } + function checkModifiers(modifiers) { + if (modifiers) { + for (var _i = 0; _i < modifiers.length; _i++) { + var modifier = modifiers[_i]; + switch (modifier.kind) { + case 108 /* PublicKeyword */: + case 106 /* PrivateKeyword */: + case 107 /* ProtectedKeyword */: + case 115 /* DeclareKeyword */: + diagnostics.push(ts.createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind))); + return true; + // These are all legal modifiers. + case 109 /* StaticKeyword */: + case 78 /* ExportKeyword */: + case 70 /* ConstKeyword */: + case 73 /* DefaultKeyword */: + } + } + } + return false; + } + } function getCompilerOptionsDiagnostics() { synchronizeHostData(); return program.getGlobalDiagnostics(); } - function getCompletionEntryDisplayName(symbol, target, performCharacterChecks) { + /// Completion + function getCompletionEntryDisplayNameForSymbol(symbol, target, performCharacterChecks) { var displayName = symbol.getName(); + if (displayName) { + // If this is the default export, get the name of the declaration if it exists + if (displayName === "default") { + var localSymbol = ts.getLocalSymbolForExportDefault(symbol); + if (localSymbol && localSymbol.name) { + displayName = symbol.valueDeclaration.localSymbol.name; + } + } + var 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 & 1536 /* Namespace */) && (firstCharCode === 39 /* singleQuote */ || firstCharCode === 34 /* 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, target, performCharacterChecks) { if (!displayName) { return undefined; } - if (displayName === "default") { - var localSymbol = ts.getLocalSymbolForExportDefault(symbol); - if (localSymbol && localSymbol.name) { - displayName = symbol.valueDeclaration.localSymbol.name; - } - } 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)) { + if (displayName.length >= 2 && + firstCharCode === displayName.charCodeAt(displayName.length - 1) && + (firstCharCode === 39 /* singleQuote */ || firstCharCode === 34 /* 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. displayName = displayName.substring(1, displayName.length - 1); } if (!displayName) { @@ -30780,24 +36512,15 @@ var ts; } return ts.unescapeIdentifier(displayName); } - function createCompletionEntry(symbol, typeChecker, location) { - var displayName = getCompletionEntryDisplayName(symbol, program.getCompilerOptions().target, true); - if (!displayName) { - return undefined; - } - return { - name: displayName, - kind: getSymbolKind(symbol, typeChecker, location), - kindModifiers: getSymbolModifiers(symbol) - }; - } function getCompletionData(fileName, position) { + var typeChecker = program.getTypeChecker(); var syntacticStart = new Date().getTime(); var sourceFile = getValidSourceFile(fileName); var start = new Date().getTime(); var currentToken = ts.getTokenAtPosition(sourceFile, position); log("getCompletionData: Get current token: " + (new Date().getTime() - start)); start = new Date().getTime(); + // Completion not allowed inside comments, bail out if this is the case var insideComment = isInsideComment(sourceFile, currentToken, position); log("getCompletionData: Is inside comment: " + (new Date().getTime() - start)); if (insideComment) { @@ -30807,23 +36530,31 @@ var ts; start = new Date().getTime(); var previousToken = ts.findPrecedingToken(position, sourceFile); log("getCompletionData: Get previous token 1: " + (new Date().getTime() - start)); + // The decision to provide completion depends on the contextToken, which is determined through the previousToken. + // Note: 'previousToken' (and thus 'contextToken') can be undefined if we are the beginning of the file var contextToken = previousToken; + // Check if the caret is at the end of an identifier; this is a partial identifier that we want to complete: e.g. a.toS| + // Skip this partial identifier and adjust the contextToken to the token that precedes it. if (contextToken && position <= contextToken.end && ts.isWord(contextToken.kind)) { - var start_1 = new Date().getTime(); + var start_2 = new Date().getTime(); contextToken = ts.findPrecedingToken(contextToken.getFullStart(), sourceFile); - log("getCompletionData: Get previous token 2: " + (new Date().getTime() - start_1)); + log("getCompletionData: Get previous token 2: " + (new Date().getTime() - start_2)); } + // Check if this is a valid completion location if (contextToken && isCompletionListBlocker(contextToken)) { log("Returning an empty list because completion was requested in an invalid position."); 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 other wise, it is a request for all + // visible symbols in the scope, and the node is the current location. var node = currentToken; var isRightOfDot = false; - if (contextToken && contextToken.kind === 20 && contextToken.parent.kind === 155) { + if (contextToken && contextToken.kind === 20 /* DotToken */ && contextToken.parent.kind === 155 /* PropertyAccessExpression */) { node = contextToken.parent.expression; isRightOfDot = true; } - else if (contextToken && contextToken.kind === 20 && contextToken.parent.kind === 126) { + else if (contextToken && contextToken.kind === 20 /* DotToken */ && contextToken.parent.kind === 126 /* QualifiedName */) { node = contextToken.parent.left; isRightOfDot = true; } @@ -30832,73 +36563,131 @@ var ts; var semanticStart = new Date().getTime(); var isMemberCompletion; var isNewIdentifierLocation; - var symbols; + var symbols = []; if (isRightOfDot) { - symbols = []; + 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: symbols, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, location: location, isRightOfDot: isRightOfDot }; + function getTypeScriptMemberSymbols() { + // Right of dot member completion list isMemberCompletion = true; isNewIdentifierLocation = false; - if (node.kind === 65 || node.kind === 126 || node.kind === 155) { - var symbol = typeInfoResolver.getSymbolAtLocation(node); - if (symbol && symbol.flags & 8388608) { - symbol = typeInfoResolver.getAliasedSymbol(symbol); + if (node.kind === 65 /* Identifier */ || node.kind === 126 /* QualifiedName */ || node.kind === 155 /* PropertyAccessExpression */) { + var symbol = typeChecker.getSymbolAtLocation(node); + // This is an alias, follow what it aliases + if (symbol && symbol.flags & 8388608 /* Alias */) { + symbol = typeChecker.getAliasedSymbol(symbol); } - if (symbol && symbol.flags & 1952) { - ts.forEachValue(symbol.exports, function (symbol) { - if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) { + if (symbol && symbol.flags & 1952 /* HasExports */) { + // Extract module or enum members + var exportedSymbols = typeChecker.getExportsOfModule(symbol); + ts.forEach(exportedSymbols, function (symbol) { + if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) { symbols.push(symbol); } }); } } - var type = typeInfoResolver.getTypeAtLocation(node); + var type = typeChecker.getTypeAtLocation(node); if (type) { + // Filter private properties ts.forEach(type.getApparentProperties(), function (symbol) { - if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) { + if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) { symbols.push(symbol); } }); } } - else { + function tryGetGlobalSymbols() { var containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion(contextToken); if (containingObjectLiteral) { + // Object literal expression, look up possible property names from contextual type isMemberCompletion = true; isNewIdentifierLocation = true; - var contextualType = typeInfoResolver.getContextualType(containingObjectLiteral); + var contextualType = typeChecker.getContextualType(containingObjectLiteral); if (!contextualType) { - return undefined; + return false; } - var contextualTypeMembers = typeInfoResolver.getPropertiesOfType(contextualType); + var contextualTypeMembers = typeChecker.getPropertiesOfType(contextualType); if (contextualTypeMembers && contextualTypeMembers.length > 0) { + // Add filtered items to the completion list symbols = filterContextualMembersList(contextualTypeMembers, containingObjectLiteral.properties); } } - else if (ts.getAncestor(contextToken, 210)) { + else if (ts.getAncestor(contextToken, 210 /* ImportClause */)) { + // cursor is in import clause + // try to show exported member for imported module isMemberCompletion = true; isNewIdentifierLocation = true; if (showCompletionsInImportsClause(contextToken)) { - var importDeclaration = ts.getAncestor(contextToken, 209); + var importDeclaration = ts.getAncestor(contextToken, 209 /* ImportDeclaration */); ts.Debug.assert(importDeclaration !== undefined); - var exports = typeInfoResolver.getExportsOfExternalModule(importDeclaration); - symbols = filterModuleExports(exports, importDeclaration); + var exports; + if (importDeclaration.moduleSpecifier) { + var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(importDeclaration.moduleSpecifier); + if (moduleSpecifierSymbol) { + exports = typeChecker.getExportsOfModule(moduleSpecifierSymbol); + } + } + //let exports = typeInfoResolver.getExportsOfImportDeclaration(importDeclaration); + symbols = exports ? filterModuleExports(exports, importDeclaration) : emptyArray; } } else { + // Get all entities in the current scope. isMemberCompletion = false; isNewIdentifierLocation = isNewIdentifierDefinitionLocation(contextToken); if (previousToken !== contextToken) { ts.Debug.assert(!!previousToken, "Expected 'contextToken' to be defined when different from 'previousToken'."); } + // We need to find the node that will give us an appropriate scope to begin + // aggregating completion candidates. This is achieved in 'getScopeNode' + // by finding the first node that encompasses a position, accounting for whether a node + // is "complete" to decide whether a position belongs to the node. + // + // However, at the end of an identifier, we are interested in the scope of the identifier + // itself, but fall outside of the identifier. For instance: + // + // xyz => x$ + // + // the cursor is outside of both the 'x' and the arrow function 'xyz => x', + // so 'xyz' is not returned in our results. + // + // We define 'adjustedPosition' so that we may appropriately account for + // being at the end of an identifier. The intention is that if requesting completion + // at the end of an identifier, it should be effectively equivalent to requesting completion + // anywhere inside/at the beginning of the identifier. So in the previous case, the + // 'adjustedPosition' will work as if requesting completion in the following: + // + // xyz => $x + // + // If previousToken !== contextToken, then + // - 'contextToken' was adjusted to the token prior to 'previousToken' + // because we were at the end of an identifier. + // - 'previousToken' is defined. var adjustedPosition = previousToken !== contextToken ? previousToken.getStart() : position; var scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile; - var symbolMeanings = 793056 | 107455 | 1536 | 8388608; - symbols = typeInfoResolver.getSymbolsInScope(scopeNode, symbolMeanings); + /// TODO filter meaning based on the current context + var symbolMeanings = 793056 /* Type */ | 107455 /* Value */ | 1536 /* Namespace */ | 8388608 /* Alias */; + symbols = typeChecker.getSymbolsInScope(scopeNode, symbolMeanings); } + return true; } - log("getCompletionData: Semantic work: " + (new Date().getTime() - semanticStart)); - return { symbols: symbols, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, location: location }; + /** + * Finds the first node that "embraces" the position, so that one may + * accurately aggregate locals from the closest containing scope. + */ function getScopeNode(initialToken, position, sourceFile) { var scope = initialToken; while (scope && !ts.positionBelongsToNode(scope, position, sourceFile)) { @@ -30916,8 +36705,10 @@ var ts; } function showCompletionsInImportsClause(node) { if (node) { - if (node.kind === 14 || node.kind === 23) { - return node.parent.kind === 212; + // import {| + // import {a,| + if (node.kind === 14 /* OpenBraceToken */ || node.kind === 23 /* CommaToken */) { + return node.parent.kind === 212 /* NamedImports */; } } return false; @@ -30926,37 +36717,38 @@ var ts; if (previousToken) { var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { - case 23: - return containingNodeKind === 157 - || containingNodeKind === 135 - || containingNodeKind === 158 - || containingNodeKind === 153 - || containingNodeKind === 169; - case 16: - return containingNodeKind === 157 - || containingNodeKind === 135 - || containingNodeKind === 158 - || containingNodeKind === 161; - case 18: - return containingNodeKind === 153; - case 117: + case 23 /* CommaToken */: + return containingNodeKind === 157 /* CallExpression */ // func( a, | + || containingNodeKind === 135 /* Constructor */ // constructor( a, | public, protected, private keywords are allowed here, so show completion + || containingNodeKind === 158 /* NewExpression */ // new C(a, | + || containingNodeKind === 153 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 169 /* BinaryExpression */; // let x = (a, | + case 16 /* OpenParenToken */: + return containingNodeKind === 157 /* CallExpression */ // func( | + || containingNodeKind === 135 /* Constructor */ // constructor( | + || containingNodeKind === 158 /* NewExpression */ // new C(a| + || containingNodeKind === 161 /* ParenthesizedExpression */; // let x = (a| + case 18 /* OpenBracketToken */: + return containingNodeKind === 153 /* ArrayLiteralExpression */; // [ | + case 117 /* ModuleKeyword */: return true; - case 20: - return containingNodeKind === 205; - case 14: - return containingNodeKind === 201; - case 53: - return containingNodeKind === 198 - || containingNodeKind === 169; - case 11: - return containingNodeKind === 171; - case 12: - return containingNodeKind === 176; - case 109: - case 107: - case 108: - return containingNodeKind === 132; + case 20 /* DotToken */: + return containingNodeKind === 205 /* ModuleDeclaration */; // module A.| + case 14 /* OpenBraceToken */: + return containingNodeKind === 201 /* ClassDeclaration */; // class A{ | + case 53 /* EqualsToken */: + return containingNodeKind === 198 /* VariableDeclaration */ // let x = a| + || containingNodeKind === 169 /* BinaryExpression */; // x = a| + case 11 /* TemplateHead */: + return containingNodeKind === 171 /* TemplateExpression */; // `aa ${| + case 12 /* TemplateMiddle */: + return containingNodeKind === 176 /* TemplateSpan */; // `aa ${10} dd ${| + case 108 /* PublicKeyword */: + case 106 /* PrivateKeyword */: + case 107 /* ProtectedKeyword */: + return containingNodeKind === 132 /* PropertyDeclaration */; // class A{ public | } + // Previous token may have been a keyword that was converted to an identifier. switch (previousToken.getText()) { case "public": case "protected": @@ -30967,12 +36759,14 @@ var ts; return false; } function isInStringOrRegularExpressionOrTemplateLiteral(previousToken) { - if (previousToken.kind === 8 - || previousToken.kind === 9 + if (previousToken.kind === 8 /* StringLiteral */ + || previousToken.kind === 9 /* RegularExpressionLiteral */ || ts.isTemplateLiteralKind(previousToken.kind)) { - var start_2 = previousToken.getStart(); + // The position has to be either: 1. entirely within the token text, or + // 2. at the end position of an unterminated token. + var start_3 = previousToken.getStart(); var end = previousToken.getEnd(); - if (start_2 < position && position < end) { + if (start_3 < position && position < end) { return true; } else if (position === end) { @@ -30986,9 +36780,9 @@ var ts; if (previousToken) { var parent_8 = previousToken.parent; switch (previousToken.kind) { - case 14: - case 23: - if (parent_8 && parent_8.kind === 154) { + case 14 /* OpenBraceToken */: // let x = { | + case 23 /* CommaToken */: + if (parent_8 && parent_8.kind === 154 /* ObjectLiteralExpression */) { return parent_8; } break; @@ -30998,16 +36792,16 @@ var ts; } function isFunction(kind) { switch (kind) { - case 162: - case 163: - case 200: - case 134: - case 133: - case 136: - case 137: - case 138: - case 139: - case 140: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: + case 200 /* FunctionDeclaration */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 138 /* CallSignature */: + case 139 /* ConstructSignature */: + case 140 /* IndexSignature */: return true; } return false; @@ -31016,61 +36810,64 @@ var ts; if (previousToken) { var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { - case 23: - return containingNodeKind === 198 || - containingNodeKind === 199 || - containingNodeKind === 180 || - containingNodeKind === 204 || + case 23 /* CommaToken */: + return containingNodeKind === 198 /* VariableDeclaration */ || + containingNodeKind === 199 /* VariableDeclarationList */ || + containingNodeKind === 180 /* VariableStatement */ || + containingNodeKind === 204 /* EnumDeclaration */ || isFunction(containingNodeKind) || - containingNodeKind === 201 || - containingNodeKind === 200 || - containingNodeKind === 202 || - containingNodeKind === 151 || - containingNodeKind === 150; - case 20: - return containingNodeKind === 151; - case 18: - return containingNodeKind === 151; - case 16: - return containingNodeKind === 223 || + containingNodeKind === 201 /* ClassDeclaration */ || + containingNodeKind === 200 /* FunctionDeclaration */ || + containingNodeKind === 202 /* InterfaceDeclaration */ || + containingNodeKind === 151 /* ArrayBindingPattern */ || + containingNodeKind === 150 /* ObjectBindingPattern */; // function func({ x, y| + case 20 /* DotToken */: + return containingNodeKind === 151 /* ArrayBindingPattern */; // var [.| + case 18 /* OpenBracketToken */: + return containingNodeKind === 151 /* ArrayBindingPattern */; // var [x| + case 16 /* OpenParenToken */: + return containingNodeKind === 223 /* CatchClause */ || isFunction(containingNodeKind); - case 14: - return containingNodeKind === 204 || - containingNodeKind === 202 || - containingNodeKind === 145 || - containingNodeKind === 150; - case 22: - return containingNodeKind === 131 && - (previousToken.parent.parent.kind === 202 || - previousToken.parent.parent.kind === 145); - case 24: - return containingNodeKind === 201 || - containingNodeKind === 200 || - containingNodeKind === 202 || + case 14 /* OpenBraceToken */: + return containingNodeKind === 204 /* EnumDeclaration */ || + containingNodeKind === 202 /* InterfaceDeclaration */ || + containingNodeKind === 145 /* TypeLiteral */ || + containingNodeKind === 150 /* ObjectBindingPattern */; // function func({ x| + case 22 /* SemicolonToken */: + return containingNodeKind === 131 /* PropertySignature */ && + previousToken.parent && previousToken.parent.parent && + (previousToken.parent.parent.kind === 202 /* InterfaceDeclaration */ || + previousToken.parent.parent.kind === 145 /* TypeLiteral */); // let x : { a; | + case 24 /* LessThanToken */: + return containingNodeKind === 201 /* ClassDeclaration */ || + containingNodeKind === 200 /* FunctionDeclaration */ || + containingNodeKind === 202 /* InterfaceDeclaration */ || isFunction(containingNodeKind); - 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: + case 109 /* StaticKeyword */: + return containingNodeKind === 132 /* PropertyDeclaration */; + case 21 /* DotDotDotToken */: + return containingNodeKind === 129 /* Parameter */ || + containingNodeKind === 135 /* Constructor */ || + (previousToken.parent && previousToken.parent.parent && + previousToken.parent.parent.kind === 151 /* ArrayBindingPattern */); // var [ ...z| + case 108 /* PublicKeyword */: + case 106 /* PrivateKeyword */: + case 107 /* ProtectedKeyword */: + return containingNodeKind === 129 /* Parameter */; + case 69 /* ClassKeyword */: + case 77 /* EnumKeyword */: + case 103 /* InterfaceKeyword */: + case 83 /* FunctionKeyword */: + case 98 /* VarKeyword */: + case 116 /* GetKeyword */: + case 120 /* SetKeyword */: + case 85 /* ImportKeyword */: + case 104 /* LetKeyword */: + case 70 /* ConstKeyword */: + case 110 /* YieldKeyword */: return true; } + // Previous token may have been a keyword that was converted to an identifier. switch (previousToken.getText()) { case "class": case "interface": @@ -31087,7 +36884,7 @@ var ts; return false; } function isRightOfIllegalDot(previousToken) { - if (previousToken && previousToken.kind === 7) { + if (previousToken && previousToken.kind === 7 /* NumericLiteral */) { var text = previousToken.getFullText(); return text.charAt(text.length - 1) === "."; } @@ -31099,7 +36896,7 @@ var ts; return exports; } if (importDeclaration.importClause.namedBindings && - importDeclaration.importClause.namedBindings.kind === 212) { + importDeclaration.importClause.namedBindings.kind === 212 /* NamedImports */) { ts.forEach(importDeclaration.importClause.namedBindings.elements, function (el) { var name = el.propertyName || el.name; exisingImports[name.text] = true; @@ -31116,12 +36913,15 @@ var ts; } var existingMemberNames = {}; ts.forEach(existingMembers, function (m) { - if (m.kind !== 224 && m.kind !== 225) { + if (m.kind !== 224 /* PropertyAssignment */ && m.kind !== 225 /* ShorthandPropertyAssignment */) { + // Ignore omitted expressions for missing members in the object literal return; } if (m.getStart() <= position && position <= m.getEnd()) { + // If this is the current item we are editing right now, do not filter it out return; } + // TODO(jfreeman): Account for computed property name existingMemberNames[m.name.text] = true; }); var filteredMembers = []; @@ -31139,27 +36939,84 @@ var ts; 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 symbols = completionData.symbols, isMemberCompletion = completionData.isMemberCompletion, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, isRightOfDot = completionData.isRightOfDot; + var entries; + if (isRightOfDot && ts.isJavaScript(fileName)) { + entries = getCompletionEntriesFromSymbols(symbols); + ts.addRange(entries, getJavaScriptCompletionEntries()); } - var entries = getCompletionEntriesFromSymbols(symbols); + else { + if (!symbols || symbols.length === 0) { + return undefined; + } + entries = getCompletionEntriesFromSymbols(symbols); + } + // Add keywords if this is not a member completion list if (!isMemberCompletion) { ts.addRange(entries, keywordCompletions); } return { isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; + function getJavaScriptCompletionEntries() { + var entries = []; + var allNames = {}; + var target = program.getCompilerOptions().target; + for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { + var sourceFile = _a[_i]; + var nameTable = getNameTable(sourceFile); + for (var name_24 in nameTable) { + if (!allNames[name_24]) { + allNames[name_24] = name_24; + var displayName = getCompletionEntryDisplayName(name_24, target, true); + if (displayName) { + var entry = { + name: displayName, + kind: ScriptElementKind.warning, + kindModifiers: "", + sortText: "1" + }; + entries.push(entry); + } + } + } + } + return entries; + } + function createCompletionEntry(symbol, location) { + // Try to get a valid display name for this symbol, if we could not find one, then ignore it. + // We would like to only show things that can be added after a dot, so for instance numeric properties can + // not be accessed with a dot (a.1 <- invalid) + var displayName = getCompletionEntryDisplayNameForSymbol(symbol, program.getCompilerOptions().target, 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. + // 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, location), + kindModifiers: getSymbolModifiers(symbol), + sortText: "0" + }; + } 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; + if (symbols) { + var nameToSymbol = {}; + for (var _i = 0; _i < symbols.length; _i++) { + var symbol = symbols[_i]; + var entry = createCompletionEntry(symbol, location); + if (entry) { + var id = ts.escapeIdentifier(entry.name); + if (!ts.lookUp(nameToSymbol, id)) { + entries.push(entry); + nameToSymbol[id] = symbol; + } } } } @@ -31169,13 +37026,18 @@ var ts; } function getCompletionEntryDetails(fileName, position, entryName) { synchronizeHostData(); + // Compute all the completion symbols again. var completionData = getCompletionData(fileName, position); if (completionData) { var symbols = completionData.symbols, location_2 = completionData.location; + // Find the symbol with the matching entry name. var target = program.getCompilerOptions().target; - var symbol = ts.forEach(symbols, function (s) { return getCompletionEntryDisplayName(s, target, false) === entryName ? s : undefined; }); + // We don't need to perform character checks here because we're only comparing the + // name against 'entryName' (which is known to be good), not building a new + // completion entry. + var symbol = ts.forEach(symbols, function (s) { return getCompletionEntryDisplayNameForSymbol(s, target, false) === entryName ? s : undefined; }); if (symbol) { - var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location_2, typeInfoResolver, location_2, 7); + var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location_2, location_2, 7 /* All */); return { name: entryName, kind: displayPartsDocumentationsAndSymbolKind.symbolKind, @@ -31185,6 +37047,7 @@ var ts; }; } } + // Didn't find a symbol with this name. See if we can find a keyword instead. var keywordCompletion = ts.forEach(keywordCompletions, function (c) { return c.name === entryName; }); if (keywordCompletion) { return { @@ -31197,39 +37060,41 @@ var ts; } return undefined; } - function getSymbolKind(symbol, typeResolver, location) { + // TODO(drosen): use contextual SemanticMeaning. + function getSymbolKind(symbol, location) { var flags = symbol.getFlags(); - if (flags & 32) + if (flags & 32 /* Class */) return ScriptElementKind.classElement; - if (flags & 384) + if (flags & 384 /* Enum */) return ScriptElementKind.enumElement; - if (flags & 524288) + if (flags & 524288 /* TypeAlias */) return ScriptElementKind.typeElement; - if (flags & 64) + if (flags & 64 /* Interface */) return ScriptElementKind.interfaceElement; - if (flags & 262144) + if (flags & 262144 /* TypeParameter */) return ScriptElementKind.typeParameterElement; - var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver, location); + var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, location); if (result === ScriptElementKind.unknown) { - if (flags & 262144) + if (flags & 262144 /* TypeParameter */) return ScriptElementKind.typeParameterElement; - if (flags & 8) + if (flags & 8 /* EnumMember */) return ScriptElementKind.variableElement; - if (flags & 8388608) + if (flags & 8388608 /* Alias */) return ScriptElementKind.alias; - if (flags & 1536) + if (flags & 1536 /* Module */) return ScriptElementKind.moduleElement; } return result; } - function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver, location) { - if (typeResolver.isUndefinedSymbol(symbol)) { + function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, location) { + var typeChecker = program.getTypeChecker(); + if (typeChecker.isUndefinedSymbol(symbol)) { return ScriptElementKind.variableElement; } - if (typeResolver.isArgumentsSymbol(symbol)) { + if (typeChecker.isArgumentsSymbol(symbol)) { return ScriptElementKind.localVariableElement; } - if (flags & 3) { + if (flags & 3 /* Variable */) { if (ts.isFirstDeclarationOfSymbolParameter(symbol)) { return ScriptElementKind.parameterElement; } @@ -31241,27 +37106,30 @@ var ts; } return isLocalVariableOrFunction(symbol) ? ScriptElementKind.localVariableElement : ScriptElementKind.variableElement; } - if (flags & 16) + if (flags & 16 /* Function */) return isLocalVariableOrFunction(symbol) ? ScriptElementKind.localFunctionElement : ScriptElementKind.functionElement; - if (flags & 32768) + if (flags & 32768 /* GetAccessor */) return ScriptElementKind.memberGetAccessorElement; - if (flags & 65536) + if (flags & 65536 /* SetAccessor */) return ScriptElementKind.memberSetAccessorElement; - if (flags & 8192) + if (flags & 8192 /* Method */) return ScriptElementKind.memberFunctionElement; - if (flags & 16384) + if (flags & 16384 /* Constructor */) return ScriptElementKind.constructorImplementationElement; - if (flags & 4) { - if (flags & 268435456) { - var unionPropertyKind = ts.forEach(typeInfoResolver.getRootSymbols(symbol), function (rootSymbol) { + if (flags & 4 /* Property */) { + if (flags & 268435456 /* UnionProperty */) { + // If union property is result of union of non method (property/accessors/variables), it is labeled as property + var unionPropertyKind = ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) { var rootSymbolFlags = rootSymbol.getFlags(); - if (rootSymbolFlags & (98308 | 3)) { + if (rootSymbolFlags & (98308 /* PropertyOrAccessor */ | 3 /* Variable */)) { return ScriptElementKind.memberVariableElement; } - ts.Debug.assert(!!(rootSymbolFlags & 8192)); + ts.Debug.assert(!!(rootSymbolFlags & 8192 /* Method */)); }); if (!unionPropertyKind) { - var typeOfUnionProperty = typeInfoResolver.getTypeOfSymbolAtLocation(symbol, location); + // If this was union of all methods, + //make sure it has call signatures before we can label it as method + var typeOfUnionProperty = typeChecker.getTypeOfSymbolAtLocation(symbol, location); if (typeOfUnionProperty.getCallSignatures().length) { return ScriptElementKind.memberFunctionElement; } @@ -31275,17 +37143,17 @@ var ts; } function getTypeKind(type) { var flags = type.getFlags(); - if (flags & 128) + if (flags & 128 /* Enum */) return ScriptElementKind.enumElement; - if (flags & 1024) + if (flags & 1024 /* Class */) return ScriptElementKind.classElement; - if (flags & 2048) + if (flags & 2048 /* Interface */) return ScriptElementKind.interfaceElement; - if (flags & 512) + if (flags & 512 /* TypeParameter */) return ScriptElementKind.typeParameterElement; - if (flags & 1048703) + if (flags & 1048703 /* Intrinsic */) return ScriptElementKind.primitiveType; - if (flags & 256) + if (flags & 256 /* StringLiteral */) return ScriptElementKind.primitiveType; return ScriptElementKind.unknown; } @@ -31294,29 +37162,35 @@ var ts; ? ts.getNodeModifiers(symbol.declarations[0]) : ScriptElementKindModifier.none; } - function getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, enclosingDeclaration, typeResolver, location, semanticMeaning) { + // TODO(drosen): Currently completion entry details passes the SemanticMeaning.All instead of using semanticMeaning of location + function getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, enclosingDeclaration, location, semanticMeaning) { if (semanticMeaning === void 0) { semanticMeaning = getMeaningFromLocation(location); } + var typeChecker = program.getTypeChecker(); var displayParts = []; var documentation; var symbolFlags = symbol.flags; - var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, typeResolver, location); + var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, location); var hasAddedSymbolInfo; var type; - if (symbolKind !== ScriptElementKind.unknown || symbolFlags & 32 || symbolFlags & 8388608) { + // Class at constructor site need to be shown as constructor apart from property,method, vars + if (symbolKind !== ScriptElementKind.unknown || symbolFlags & 32 /* Class */ || symbolFlags & 8388608 /* Alias */) { + // If it is accessor they are allowed only if location is at name of the accessor if (symbolKind === ScriptElementKind.memberGetAccessorElement || symbolKind === ScriptElementKind.memberSetAccessorElement) { symbolKind = ScriptElementKind.memberVariableElement; } var signature; - type = typeResolver.getTypeOfSymbolAtLocation(symbol, location); + type = typeChecker.getTypeOfSymbolAtLocation(symbol, location); if (type) { - if (location.parent && location.parent.kind === 155) { + if (location.parent && location.parent.kind === 155 /* PropertyAccessExpression */) { var right = location.parent.name; + // Either the location is on the right of a property access, or on the left and the right is missing if (right === location || (right && right.getFullWidth() === 0)) { location = location.parent; } } + // try get the call/construct signature from the type if it matches var callExpression; - if (location.kind === 157 || location.kind === 158) { + if (location.kind === 157 /* CallExpression */ || location.kind === 158 /* NewExpression */) { callExpression = location; } else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { @@ -31324,26 +37198,29 @@ var ts; } if (callExpression) { var candidateSignatures = []; - signature = typeResolver.getResolvedSignature(callExpression, candidateSignatures); + signature = typeChecker.getResolvedSignature(callExpression, candidateSignatures); if (!signature && candidateSignatures.length) { + // Use the first candidate: signature = candidateSignatures[0]; } - var useConstructSignatures = callExpression.kind === 158 || callExpression.expression.kind === 91; + var useConstructSignatures = callExpression.kind === 158 /* NewExpression */ || callExpression.expression.kind === 91 /* SuperKeyword */; var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target || signature)) { + // Get the first signature if there signature = allSignatures.length ? allSignatures[0] : undefined; } if (signature) { - if (useConstructSignatures && (symbolFlags & 32)) { + if (useConstructSignatures && (symbolFlags & 32 /* Class */)) { + // Constructor symbolKind = ScriptElementKind.constructorImplementationElement; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } - else if (symbolFlags & 8388608) { + else if (symbolFlags & 8388608 /* Alias */) { symbolKind = ScriptElementKind.alias; pushTypePart(symbolKind); displayParts.push(ts.spacePart()); if (useConstructSignatures) { - displayParts.push(ts.keywordPart(88)); + displayParts.push(ts.keywordPart(88 /* NewKeyword */)); displayParts.push(ts.spacePart()); } addFullSymbolName(symbol); @@ -31358,147 +37235,154 @@ var ts; case ScriptElementKind.letElement: case ScriptElementKind.parameterElement: case ScriptElementKind.localVariableElement: - displayParts.push(ts.punctuationPart(51)); + // If it is call or construct signature of lambda's write type name + displayParts.push(ts.punctuationPart(51 /* ColonToken */)); displayParts.push(ts.spacePart()); if (useConstructSignatures) { - displayParts.push(ts.keywordPart(88)); + displayParts.push(ts.keywordPart(88 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - if (!(type.flags & 32768)) { - displayParts.push.apply(displayParts, ts.symbolToDisplayParts(typeResolver, type.symbol, enclosingDeclaration, undefined, 1)); + if (!(type.flags & 32768 /* Anonymous */)) { + displayParts.push.apply(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, undefined, 1 /* WriteTypeParametersOrArguments */)); } - addSignatureDisplayParts(signature, allSignatures, 8); + addSignatureDisplayParts(signature, allSignatures, 8 /* WriteArrowStyleSignature */); break; default: + // Just signature addSignatureDisplayParts(signature, allSignatures); } hasAddedSymbolInfo = true; } } - else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304)) || - (location.kind === 114 && location.parent.kind === 135)) { + else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304 /* Accessor */)) || + (location.kind === 114 /* ConstructorKeyword */ && location.parent.kind === 135 /* Constructor */)) { + // get the signature from the declaration and write it var functionDeclaration = location.parent; - var allSignatures = functionDeclaration.kind === 135 ? type.getConstructSignatures() : type.getCallSignatures(); - if (!typeResolver.isImplementationOfOverload(functionDeclaration)) { - signature = typeResolver.getSignatureFromDeclaration(functionDeclaration); + var allSignatures = functionDeclaration.kind === 135 /* Constructor */ ? type.getConstructSignatures() : type.getCallSignatures(); + if (!typeChecker.isImplementationOfOverload(functionDeclaration)) { + signature = typeChecker.getSignatureFromDeclaration(functionDeclaration); } else { signature = allSignatures[0]; } - if (functionDeclaration.kind === 135) { + if (functionDeclaration.kind === 135 /* Constructor */) { + // show (constructor) Type(...) signature symbolKind = ScriptElementKind.constructorImplementationElement; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { - addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 138 && - !(type.symbol.flags & 2048 || type.symbol.flags & 4096) ? type.symbol : symbol, symbolKind); + // (function/method) symbol(..signature) + addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 138 /* CallSignature */ && + !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); hasAddedSymbolInfo = true; } } } - if (symbolFlags & 32 && !hasAddedSymbolInfo) { - displayParts.push(ts.keywordPart(69)); + if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo) { + displayParts.push(ts.keywordPart(69 /* ClassKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); } - if ((symbolFlags & 64) && (semanticMeaning & 2)) { + if ((symbolFlags & 64 /* Interface */) && (semanticMeaning & 2 /* Type */)) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(104)); + displayParts.push(ts.keywordPart(103 /* InterfaceKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); } - if (symbolFlags & 524288) { + if (symbolFlags & 524288 /* TypeAlias */) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(123)); + displayParts.push(ts.keywordPart(123 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(53)); + displayParts.push(ts.operatorPart(53 /* EqualsToken */)); displayParts.push(ts.spacePart()); - displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeResolver, typeResolver.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration)); + displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration)); } - if (symbolFlags & 384) { + if (symbolFlags & 384 /* Enum */) { addNewLineIfDisplayPartsExist(); if (ts.forEach(symbol.declarations, ts.isConstEnumDeclaration)) { - displayParts.push(ts.keywordPart(70)); + displayParts.push(ts.keywordPart(70 /* ConstKeyword */)); displayParts.push(ts.spacePart()); } - displayParts.push(ts.keywordPart(77)); + displayParts.push(ts.keywordPart(77 /* EnumKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } - if (symbolFlags & 1536) { + if (symbolFlags & 1536 /* Module */) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(117)); + displayParts.push(ts.keywordPart(117 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } - if ((symbolFlags & 262144) && (semanticMeaning & 2)) { + if ((symbolFlags & 262144 /* TypeParameter */) && (semanticMeaning & 2 /* Type */)) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.punctuationPart(16)); + displayParts.push(ts.punctuationPart(16 /* OpenParenToken */)); displayParts.push(ts.textPart("type parameter")); - displayParts.push(ts.punctuationPart(17)); + displayParts.push(ts.punctuationPart(17 /* CloseParenToken */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(86)); + displayParts.push(ts.keywordPart(86 /* InKeyword */)); displayParts.push(ts.spacePart()); if (symbol.parent) { + // Class/Interface type parameter addFullSymbolName(symbol.parent, enclosingDeclaration); writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration); } else { - var signatureDeclaration = ts.getDeclarationOfKind(symbol, 128).parent; - var signature = typeResolver.getSignatureFromDeclaration(signatureDeclaration); - if (signatureDeclaration.kind === 139) { - displayParts.push(ts.keywordPart(88)); + // Method/function type parameter + var signatureDeclaration = ts.getDeclarationOfKind(symbol, 128 /* TypeParameter */).parent; + var signature = typeChecker.getSignatureFromDeclaration(signatureDeclaration); + if (signatureDeclaration.kind === 139 /* ConstructSignature */) { + displayParts.push(ts.keywordPart(88 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - else if (signatureDeclaration.kind !== 138 && signatureDeclaration.name) { + else if (signatureDeclaration.kind !== 138 /* CallSignature */ && signatureDeclaration.name) { addFullSymbolName(signatureDeclaration.symbol); } - displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeResolver, signature, sourceFile, 32)); + displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); } } - if (symbolFlags & 8) { + if (symbolFlags & 8 /* EnumMember */) { addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 226) { - var constantValue = typeResolver.getConstantValue(declaration); + if (declaration.kind === 226 /* EnumMember */) { + var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(53)); + displayParts.push(ts.operatorPart(53 /* EqualsToken */)); displayParts.push(ts.spacePart()); displayParts.push(ts.displayPart(constantValue.toString(), SymbolDisplayPartKind.numericLiteral)); } } } - if (symbolFlags & 8388608) { + if (symbolFlags & 8388608 /* Alias */) { addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(85)); + displayParts.push(ts.keywordPart(85 /* ImportKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 208) { + if (declaration.kind === 208 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(53)); + displayParts.push(ts.operatorPart(53 /* EqualsToken */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(118)); - displayParts.push(ts.punctuationPart(16)); + displayParts.push(ts.keywordPart(118 /* RequireKeyword */)); + displayParts.push(ts.punctuationPart(16 /* OpenParenToken */)); displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), SymbolDisplayPartKind.stringLiteral)); - displayParts.push(ts.punctuationPart(17)); + displayParts.push(ts.punctuationPart(17 /* CloseParenToken */)); } else { - var internalAliasSymbol = typeResolver.getSymbolAtLocation(importEqualsDeclaration.moduleReference); + var internalAliasSymbol = typeChecker.getSymbolAtLocation(importEqualsDeclaration.moduleReference); if (internalAliasSymbol) { displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(53)); + displayParts.push(ts.operatorPart(53 /* EqualsToken */)); displayParts.push(ts.spacePart()); addFullSymbolName(internalAliasSymbol, enclosingDeclaration); } @@ -31511,26 +37395,28 @@ var ts; if (symbolKind !== ScriptElementKind.unknown) { if (type) { addPrefixForAnyFunctionOrVar(symbol, symbolKind); + // For properties, variables and local vars: show the type if (symbolKind === ScriptElementKind.memberVariableElement || - symbolFlags & 3 || + symbolFlags & 3 /* Variable */ || symbolKind === ScriptElementKind.localVariableElement) { - displayParts.push(ts.punctuationPart(51)); + displayParts.push(ts.punctuationPart(51 /* ColonToken */)); displayParts.push(ts.spacePart()); - if (type.symbol && type.symbol.flags & 262144) { + // If the type is type parameter, format it specially + if (type.symbol && type.symbol.flags & 262144 /* TypeParameter */) { var typeParameterParts = ts.mapToDisplayParts(function (writer) { - typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration); + typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration); }); displayParts.push.apply(displayParts, typeParameterParts); } else { - displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeResolver, type, enclosingDeclaration)); + displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeChecker, type, enclosingDeclaration)); } } - else if (symbolFlags & 16 || - symbolFlags & 8192 || - symbolFlags & 16384 || - symbolFlags & 131072 || - symbolFlags & 98304 || + else if (symbolFlags & 16 /* Function */ || + symbolFlags & 8192 /* Method */ || + symbolFlags & 16384 /* Constructor */ || + symbolFlags & 131072 /* Signature */ || + symbolFlags & 98304 /* Accessor */ || symbolKind === ScriptElementKind.memberFunctionElement) { var allSignatures = type.getCallSignatures(); addSignatureDisplayParts(allSignatures[0], allSignatures); @@ -31538,7 +37424,7 @@ var ts; } } else { - symbolKind = getSymbolKind(symbol, typeResolver, location); + symbolKind = getSymbolKind(symbol, location); } } if (!documentation) { @@ -31551,7 +37437,7 @@ var ts; } } function addFullSymbolName(symbol, enclosingDeclaration) { - var fullSymbolDisplayParts = ts.symbolToDisplayParts(typeResolver, symbol, enclosingDeclaration || sourceFile, undefined, 1 | 2); + var fullSymbolDisplayParts = ts.symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration || sourceFile, undefined, 1 /* WriteTypeParametersOrArguments */ | 2 /* UseOnlyExternalAliasing */); displayParts.push.apply(displayParts, fullSymbolDisplayParts); } function addPrefixForAnyFunctionOrVar(symbol, symbolKind) { @@ -31572,28 +37458,28 @@ var ts; displayParts.push(ts.textOrKeywordPart(symbolKind)); return; default: - displayParts.push(ts.punctuationPart(16)); + displayParts.push(ts.punctuationPart(16 /* OpenParenToken */)); displayParts.push(ts.textOrKeywordPart(symbolKind)); - displayParts.push(ts.punctuationPart(17)); + displayParts.push(ts.punctuationPart(17 /* CloseParenToken */)); return; } } function addSignatureDisplayParts(signature, allSignatures, flags) { - displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeResolver, signature, enclosingDeclaration, flags | 32)); + displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | 32 /* WriteTypeArgumentsOfSignature */)); if (allSignatures.length > 1) { displayParts.push(ts.spacePart()); - displayParts.push(ts.punctuationPart(16)); - displayParts.push(ts.operatorPart(33)); + displayParts.push(ts.punctuationPart(16 /* OpenParenToken */)); + displayParts.push(ts.operatorPart(33 /* PlusToken */)); 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)); + displayParts.push(ts.punctuationPart(17 /* CloseParenToken */)); } documentation = signature.getDocumentationComment(); } function writeTypeParametersOfSymbol(symbol, enclosingDeclaration) { var typeParameterParts = ts.mapToDisplayParts(function (writer) { - typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration); + typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration); }); displayParts.push.apply(displayParts, typeParameterParts); } @@ -31605,28 +37491,34 @@ var ts; if (!node) { return undefined; } - var symbol = typeInfoResolver.getSymbolAtLocation(node); + if (isLabelName(node)) { + return undefined; + } + var typeChecker = program.getTypeChecker(); + var symbol = typeChecker.getSymbolAtLocation(node); if (!symbol) { + // Try getting just type at this position and show switch (node.kind) { - case 65: - case 155: - case 126: - case 93: - case 91: - var type = typeInfoResolver.getTypeAtLocation(node); + case 65 /* Identifier */: + case 155 /* PropertyAccessExpression */: + case 126 /* QualifiedName */: + case 93 /* ThisKeyword */: + case 91 /* SuperKeyword */: + // For the identifiers/this/super etc get the type at position + var type = typeChecker.getTypeAtLocation(node); if (type) { return { kind: ScriptElementKind.unknown, kindModifiers: ScriptElementKindModifier.none, textSpan: ts.createTextSpan(node.getStart(), node.getWidth()), - displayParts: ts.typeToDisplayParts(typeInfoResolver, type, getContainerNode(node)), + displayParts: ts.typeToDisplayParts(typeChecker, type, getContainerNode(node)), documentation: type.symbol ? type.symbol.getDocumentationComment() : undefined }; } } return undefined; } - var displayPartsDocumentationsAndKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, getContainerNode(node), typeInfoResolver, node); + var displayPartsDocumentationsAndKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, getContainerNode(node), node); return { kind: displayPartsDocumentationsAndKind.symbolKind, kindModifiers: getSymbolModifiers(symbol), @@ -31645,6 +37537,7 @@ var ts; containerName: containerName }; } + /// Goto definition function getDefinitionAtPosition(fileName, position) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); @@ -31652,11 +37545,13 @@ var ts; if (!node) { return undefined; } + // Labels if (isJumpStatementTarget(node)) { var labelName = node.text; var label = getTargetLabel(node.parent, node.text); return label ? [createDefinitionInfo(label, ScriptElementKind.label, labelName, undefined)] : undefined; } + /// Triple slash reference comments var comment = ts.forEach(sourceFile.referencedFiles, function (r) { return (r.pos <= position && position < r.end) ? r : undefined; }); if (comment) { var referenceFile = ts.tryResolveScriptReference(program, sourceFile, comment); @@ -31672,45 +37567,60 @@ var ts; } return undefined; } - var symbol = typeInfoResolver.getSymbolAtLocation(node); + var typeChecker = program.getTypeChecker(); + var symbol = typeChecker.getSymbolAtLocation(node); + // Could not find a symbol e.g. node is string or number keyword, + // or the symbol was an internal symbol and does not have a declaration e.g. undefined symbol if (!symbol) { return undefined; } - if (symbol.flags & 8388608) { + // If this is an alias, and the request came at the declaration location + // get the aliased symbol instead. This allows for goto def on an import e.g. + // import {A, B} from "mod"; + // to jump to the implementation directly. + if (symbol.flags & 8388608 /* Alias */) { var declaration = symbol.declarations[0]; - if (node.kind === 65 && node.parent === declaration) { - symbol = typeInfoResolver.getAliasedSymbol(symbol); + if (node.kind === 65 /* Identifier */ && node.parent === declaration) { + symbol = typeChecker.getAliasedSymbol(symbol); } } - if (node.parent.kind === 225) { - var shorthandSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); + // Because name in short-hand property assignment has two different meanings: property name and property value, + // using go-to-definition at such position should go to the variable declaration of the property value rather than + // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition + // is performed at the location of property access, we would like to go to definition of the property in the short-hand + // assignment. This case and others are handled by the following code. + if (node.parent.kind === 225 /* ShorthandPropertyAssignment */) { + var shorthandSymbol = typeChecker.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); + var shorthandSymbolKind = getSymbolKind(shorthandSymbol, node); + var shorthandSymbolName = typeChecker.symbolToString(shorthandSymbol); + var shorthandContainerName = typeChecker.symbolToString(symbol.parent, node); return ts.map(shorthandDeclarations, function (declaration) { return createDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName); }); } var result = []; var declarations = symbol.getDeclarations(); - var symbolName = typeInfoResolver.symbolToString(symbol); - var symbolKind = getSymbolKind(symbol, typeInfoResolver, node); + var symbolName = typeChecker.symbolToString(symbol); // Do not get scoped name, just the name of the symbol + var symbolKind = getSymbolKind(symbol, node); var containerSymbol = symbol.parent; - var containerName = containerSymbol ? typeInfoResolver.symbolToString(containerSymbol, node) : ""; + var containerName = containerSymbol ? typeChecker.symbolToString(containerSymbol, node) : ""; if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { + // Just add all the declarations. ts.forEach(declarations, function (declaration) { result.push(createDefinitionInfo(declaration, symbolKind, symbolName, containerName)); }); } return result; function tryAddConstructSignature(symbol, location, symbolKind, symbolName, containerName, result) { - if (isNewExpressionTarget(location) || location.kind === 114) { - if (symbol.flags & 32) { + // Applicable only if we are in a new expression, or we are on a constructor declaration + // and in either case the symbol has a construct signature definition, i.e. class + if (isNewExpressionTarget(location) || location.kind === 114 /* ConstructorKeyword */) { + if (symbol.flags & 32 /* Class */) { var classDeclaration = symbol.getDeclarations()[0]; - ts.Debug.assert(classDeclaration && classDeclaration.kind === 201); + ts.Debug.assert(classDeclaration && classDeclaration.kind === 201 /* ClassDeclaration */); return tryAddSignature(classDeclaration.members, true, symbolKind, symbolName, containerName, result); } } @@ -31726,8 +37636,8 @@ var ts; var declarations = []; var definition; ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 135) || - (!selectConstructors && (d.kind === 200 || d.kind === 134 || d.kind === 133))) { + if ((selectConstructors && d.kind === 135 /* Constructor */) || + (!selectConstructors && (d.kind === 200 /* FunctionDeclaration */ || d.kind === 134 /* MethodDeclaration */ || d.kind === 133 /* MethodSignature */))) { declarations.push(d); if (d.body) definition = d; @@ -31748,430 +37658,542 @@ var ts; 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 + "."); - }); + // Get occurrences only supports reporting occurrences for the file queried. So + // filter down to that list. + results = ts.filter(results, function (r) { return getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile; }); } return results; } - function getOccurrencesAtPositionCore(fileName, position) { + function getDocumentHighlights(fileName, position, filesToSearch) { synchronizeHostData(); + filesToSearch = ts.map(filesToSearch, ts.normalizeSlashes); + var sourceFilesToSearch = ts.filter(program.getSourceFiles(), function (f) { return ts.contains(filesToSearch, f.fileName); }); var sourceFile = getValidSourceFile(fileName); var node = ts.getTouchingWord(sourceFile, position); if (!node) { return undefined; } - if (node.kind === 65 || node.kind === 93 || node.kind === 91 || - isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { - return convertReferences(getReferencesForNode(node, [sourceFile], true, false, false)); + return getSemanticDocumentHighlights(node) || getSyntacticDocumentHighlights(node); + function getHighlightSpanForNode(node) { + var start = node.getStart(); + var end = node.getEnd(); + return { + fileName: sourceFile.fileName, + textSpan: ts.createTextSpanFromBounds(start, end), + kind: HighlightSpanKind.none + }; } - switch (node.kind) { - case 84: - case 76: - if (hasKind(node.parent, 183)) { - return getIfElseOccurrences(node.parent); - } - break; - case 90: - if (hasKind(node.parent, 191)) { - return getReturnOccurrences(node.parent); - } - break; - case 94: - if (hasKind(node.parent, 195)) { - return getThrowOccurrences(node.parent); - } - break; - case 68: - if (hasKind(parent(parent(node)), 196)) { - return getTryCatchFinallyOccurrences(node.parent.parent); - } - break; - case 96: - case 81: - if (hasKind(parent(node), 196)) { - return getTryCatchFinallyOccurrences(node.parent); - } - break; - case 92: - if (hasKind(node.parent, 193)) { - return getSwitchCaseDefaultOccurrences(node.parent); - } - break; - case 67: - case 73: - if (hasKind(parent(parent(parent(node))), 193)) { - return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); - } - break; - case 66: - case 71: - if (hasKind(node.parent, 190) || hasKind(node.parent, 189)) { - return getBreakOrContinueStatementOccurences(node.parent); - } - break; - case 82: - if (hasKind(node.parent, 186) || - hasKind(node.parent, 187) || - hasKind(node.parent, 188)) { - return getLoopBreakContinueOccurrences(node.parent); - } - break; - case 100: - case 75: - if (hasKind(node.parent, 185) || hasKind(node.parent, 184)) { - return getLoopBreakContinueOccurrences(node.parent); - } - break; - case 114: - if (hasKind(node.parent, 135)) { - return getConstructorOccurrences(node.parent); - } - break; - 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 === 180)) { - return getModifierOccurrences(node.kind, node.parent); - } - } - return undefined; - function getIfElseOccurrences(ifStatement) { - var keywords = []; - while (hasKind(ifStatement.parent, 183) && ifStatement.parent.elseStatement === ifStatement) { - ifStatement = ifStatement.parent; + function getSemanticDocumentHighlights(node) { + if (node.kind === 65 /* Identifier */ || + node.kind === 93 /* ThisKeyword */ || + node.kind === 91 /* SuperKeyword */ || + isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || + isNameOfExternalModuleImportOrDeclaration(node)) { + var referencedSymbols = getReferencedSymbolsForNodes(node, sourceFilesToSearch, false, false); + return convertReferencedSymbols(referencedSymbols); } - while (ifStatement) { - var children = ifStatement.getChildren(); - pushKeywordIf(keywords, children[0], 84); - for (var i = children.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, children[i], 76)) { + return undefined; + function convertReferencedSymbols(referencedSymbols) { + if (!referencedSymbols) { + return undefined; + } + var fileNameToDocumentHighlights = {}; + var result = []; + for (var _i = 0; _i < referencedSymbols.length; _i++) { + var referencedSymbol = referencedSymbols[_i]; + for (var _a = 0, _b = referencedSymbol.references; _a < _b.length; _a++) { + var referenceEntry = _b[_a]; + var fileName_1 = referenceEntry.fileName; + var documentHighlights = ts.getProperty(fileNameToDocumentHighlights, fileName_1); + if (!documentHighlights) { + documentHighlights = { fileName: fileName_1, highlightSpans: [] }; + fileNameToDocumentHighlights[fileName_1] = documentHighlights; + result.push(documentHighlights); + } + documentHighlights.highlightSpans.push({ + textSpan: referenceEntry.textSpan, + kind: referenceEntry.isWriteAccess ? HighlightSpanKind.writtenReference : HighlightSpanKind.reference + }); + } + } + return result; + } + } + function getSyntacticDocumentHighlights(node) { + var fileName = sourceFile.fileName; + var highlightSpans = getHighlightSpans(node); + if (!highlightSpans || highlightSpans.length === 0) { + return undefined; + } + return [{ fileName: fileName, highlightSpans: highlightSpans }]; + // returns true if 'node' is defined and has a matching 'kind'. + function hasKind(node, kind) { + return node !== undefined && node.kind === kind; + } + // Null-propagating 'parent' function. + function parent(node) { + return node && node.parent; + } + function getHighlightSpans(node) { + if (node) { + switch (node.kind) { + case 84 /* IfKeyword */: + case 76 /* ElseKeyword */: + if (hasKind(node.parent, 183 /* IfStatement */)) { + return getIfElseOccurrences(node.parent); + } + break; + case 90 /* ReturnKeyword */: + if (hasKind(node.parent, 191 /* ReturnStatement */)) { + return getReturnOccurrences(node.parent); + } + break; + case 94 /* ThrowKeyword */: + if (hasKind(node.parent, 195 /* ThrowStatement */)) { + return getThrowOccurrences(node.parent); + } + break; + case 68 /* CatchKeyword */: + if (hasKind(parent(parent(node)), 196 /* TryStatement */)) { + return getTryCatchFinallyOccurrences(node.parent.parent); + } + break; + case 96 /* TryKeyword */: + case 81 /* FinallyKeyword */: + if (hasKind(parent(node), 196 /* TryStatement */)) { + return getTryCatchFinallyOccurrences(node.parent); + } + break; + case 92 /* SwitchKeyword */: + if (hasKind(node.parent, 193 /* SwitchStatement */)) { + return getSwitchCaseDefaultOccurrences(node.parent); + } + break; + case 67 /* CaseKeyword */: + case 73 /* DefaultKeyword */: + if (hasKind(parent(parent(parent(node))), 193 /* SwitchStatement */)) { + return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); + } + break; + case 66 /* BreakKeyword */: + case 71 /* ContinueKeyword */: + if (hasKind(node.parent, 190 /* BreakStatement */) || hasKind(node.parent, 189 /* ContinueStatement */)) { + return getBreakOrContinueStatementOccurences(node.parent); + } + break; + case 82 /* ForKeyword */: + if (hasKind(node.parent, 186 /* ForStatement */) || + hasKind(node.parent, 187 /* ForInStatement */) || + hasKind(node.parent, 188 /* ForOfStatement */)) { + return getLoopBreakContinueOccurrences(node.parent); + } + break; + case 100 /* WhileKeyword */: + case 75 /* DoKeyword */: + if (hasKind(node.parent, 185 /* WhileStatement */) || hasKind(node.parent, 184 /* DoStatement */)) { + return getLoopBreakContinueOccurrences(node.parent); + } + break; + case 114 /* ConstructorKeyword */: + if (hasKind(node.parent, 135 /* Constructor */)) { + return getConstructorOccurrences(node.parent); + } + break; + case 116 /* GetKeyword */: + case 120 /* SetKeyword */: + if (hasKind(node.parent, 136 /* GetAccessor */) || hasKind(node.parent, 137 /* SetAccessor */)) { + return getGetAndSetOccurrences(node.parent); + } + default: + if (ts.isModifier(node.kind) && node.parent && + (ts.isDeclaration(node.parent) || node.parent.kind === 180 /* VariableStatement */)) { + return getModifierOccurrences(node.kind, node.parent); + } + } + } + return undefined; + } + /** + * Aggregates all throw-statements within this node *without* crossing + * into function boundaries and try-blocks with catch-clauses. + */ + function aggregateOwnedThrowStatements(node) { + var statementAccumulator = []; + aggregate(node); + return statementAccumulator; + function aggregate(node) { + if (node.kind === 195 /* ThrowStatement */) { + statementAccumulator.push(node); + } + else if (node.kind === 196 /* TryStatement */) { + var tryStatement = node; + if (tryStatement.catchClause) { + aggregate(tryStatement.catchClause); + } + else { + // Exceptions thrown within a try block lacking a catch clause + // are "owned" in the current context. + aggregate(tryStatement.tryBlock); + } + if (tryStatement.finallyBlock) { + aggregate(tryStatement.finallyBlock); + } + } + else if (!ts.isFunctionLike(node)) { + ts.forEachChild(node, aggregate); + } + } + ; + } + /** + * For lack of a better name, this function takes a throw statement and returns the + * nearest ancestor that is a try-block (whose try statement has a catch clause), + * function-block, or source file. + */ + function getThrowStatementOwner(throwStatement) { + var child = throwStatement; + while (child.parent) { + var parent_9 = child.parent; + if (ts.isFunctionBlock(parent_9) || parent_9.kind === 227 /* SourceFile */) { + return parent_9; + } + // A throw-statement is only owned by a try-statement if the try-statement has + // a catch clause, and if the throw-statement occurs within the try block. + if (parent_9.kind === 196 /* TryStatement */) { + var tryStatement = parent_9; + if (tryStatement.tryBlock === child && tryStatement.catchClause) { + return child; + } + } + child = parent_9; + } + return undefined; + } + function aggregateAllBreakAndContinueStatements(node) { + var statementAccumulator = []; + aggregate(node); + return statementAccumulator; + function aggregate(node) { + if (node.kind === 190 /* BreakStatement */ || node.kind === 189 /* ContinueStatement */) { + statementAccumulator.push(node); + } + else if (!ts.isFunctionLike(node)) { + ts.forEachChild(node, aggregate); + } + } + ; + } + function ownsBreakOrContinueStatement(owner, statement) { + var actualOwner = getBreakOrContinueOwner(statement); + return actualOwner && actualOwner === owner; + } + function getBreakOrContinueOwner(statement) { + for (var node_1 = statement.parent; node_1; node_1 = node_1.parent) { + switch (node_1.kind) { + case 193 /* SwitchStatement */: + if (statement.kind === 189 /* ContinueStatement */) { + continue; + } + // Fall through. + case 186 /* ForStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: + case 185 /* WhileStatement */: + case 184 /* DoStatement */: + if (!statement.label || isLabeledBy(node_1, statement.label.text)) { + return node_1; + } + break; + default: + // Don't cross function boundaries. + if (ts.isFunctionLike(node_1)) { + return undefined; + } + break; + } + } + return undefined; + } + function getModifierOccurrences(modifier, declaration) { + var container = declaration.parent; + // Make sure we only highlight the keyword when it makes sense to do so. + if (ts.isAccessibilityModifier(modifier)) { + if (!(container.kind === 201 /* ClassDeclaration */ || + (declaration.kind === 129 /* Parameter */ && hasKind(container, 135 /* Constructor */)))) { + return undefined; + } + } + else if (modifier === 109 /* StaticKeyword */) { + if (container.kind !== 201 /* ClassDeclaration */) { + return undefined; + } + } + else if (modifier === 78 /* ExportKeyword */ || modifier === 115 /* DeclareKeyword */) { + if (!(container.kind === 206 /* ModuleBlock */ || container.kind === 227 /* SourceFile */)) { + return undefined; + } + } + else { + // unsupported modifier + return undefined; + } + var keywords = []; + var modifierFlag = getFlagFromModifier(modifier); + var nodes; + switch (container.kind) { + case 206 /* ModuleBlock */: + case 227 /* SourceFile */: + nodes = container.statements; + break; + case 135 /* Constructor */: + nodes = container.parameters.concat(container.parent.members); + break; + case 201 /* ClassDeclaration */: + nodes = container.members; + // If we're an accessibility modifier, we're in an instance member and should search + // the constructor's parameter list for instance members as well. + if (modifierFlag & 112 /* AccessibilityModifier */) { + var constructor = ts.forEach(container.members, function (member) { + return member.kind === 135 /* Constructor */ && member; + }); + if (constructor) { + nodes = nodes.concat(constructor.parameters); + } + } + break; + default: + ts.Debug.fail("Invalid container kind."); + } + ts.forEach(nodes, function (node) { + if (node.modifiers && node.flags & modifierFlag) { + ts.forEach(node.modifiers, function (child) { return pushKeywordIf(keywords, child, modifier); }); + } + }); + return ts.map(keywords, getHighlightSpanForNode); + function getFlagFromModifier(modifier) { + switch (modifier) { + case 108 /* PublicKeyword */: + return 16 /* Public */; + case 106 /* PrivateKeyword */: + return 32 /* Private */; + case 107 /* ProtectedKeyword */: + return 64 /* Protected */; + case 109 /* StaticKeyword */: + return 128 /* Static */; + case 78 /* ExportKeyword */: + return 1 /* Export */; + case 115 /* DeclareKeyword */: + return 2 /* Ambient */; + default: + ts.Debug.fail(); + } + } + } + function pushKeywordIf(keywordList, token) { + var expected = []; + for (var _i = 2; _i < arguments.length; _i++) { + expected[_i - 2] = arguments[_i]; + } + if (token && ts.contains(expected, token.kind)) { + keywordList.push(token); + return true; + } + return false; + } + function getGetAndSetOccurrences(accessorDeclaration) { + var keywords = []; + tryPushAccessorKeyword(accessorDeclaration.symbol, 136 /* GetAccessor */); + tryPushAccessorKeyword(accessorDeclaration.symbol, 137 /* SetAccessor */); + return ts.map(keywords, getHighlightSpanForNode); + function tryPushAccessorKeyword(accessorSymbol, accessorKind) { + var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); + if (accessor) { + ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 116 /* GetKeyword */, 120 /* SetKeyword */); }); + } + } + } + function getConstructorOccurrences(constructorDeclaration) { + var declarations = constructorDeclaration.symbol.getDeclarations(); + var keywords = []; + ts.forEach(declarations, function (declaration) { + ts.forEach(declaration.getChildren(), function (token) { + return pushKeywordIf(keywords, token, 114 /* ConstructorKeyword */); + }); + }); + return ts.map(keywords, getHighlightSpanForNode); + } + function getLoopBreakContinueOccurrences(loopNode) { + var keywords = []; + if (pushKeywordIf(keywords, loopNode.getFirstToken(), 82 /* ForKeyword */, 100 /* WhileKeyword */, 75 /* DoKeyword */)) { + // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. + if (loopNode.kind === 184 /* DoStatement */) { + var loopTokens = loopNode.getChildren(); + for (var i = loopTokens.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, loopTokens[i], 100 /* WhileKeyword */)) { + break; + } + } + } + } + var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); + ts.forEach(breaksAndContinues, function (statement) { + if (ownsBreakOrContinueStatement(loopNode, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), 66 /* BreakKeyword */, 71 /* ContinueKeyword */); + } + }); + return ts.map(keywords, getHighlightSpanForNode); + } + function getBreakOrContinueStatementOccurences(breakOrContinueStatement) { + var owner = getBreakOrContinueOwner(breakOrContinueStatement); + if (owner) { + switch (owner.kind) { + case 186 /* ForStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: + case 184 /* DoStatement */: + case 185 /* WhileStatement */: + return getLoopBreakContinueOccurrences(owner); + case 193 /* SwitchStatement */: + return getSwitchCaseDefaultOccurrences(owner); + } + } + return undefined; + } + function getSwitchCaseDefaultOccurrences(switchStatement) { + var keywords = []; + pushKeywordIf(keywords, switchStatement.getFirstToken(), 92 /* SwitchKeyword */); + // Go through each clause in the switch statement, collecting the 'case'/'default' keywords. + ts.forEach(switchStatement.caseBlock.clauses, function (clause) { + pushKeywordIf(keywords, clause.getFirstToken(), 67 /* CaseKeyword */, 73 /* DefaultKeyword */); + var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); + ts.forEach(breaksAndContinues, function (statement) { + if (ownsBreakOrContinueStatement(switchStatement, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), 66 /* BreakKeyword */); + } + }); + }); + return ts.map(keywords, getHighlightSpanForNode); + } + function getTryCatchFinallyOccurrences(tryStatement) { + var keywords = []; + pushKeywordIf(keywords, tryStatement.getFirstToken(), 96 /* TryKeyword */); + if (tryStatement.catchClause) { + pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 68 /* CatchKeyword */); + } + if (tryStatement.finallyBlock) { + var finallyKeyword = ts.findChildOfKind(tryStatement, 81 /* FinallyKeyword */, sourceFile); + pushKeywordIf(keywords, finallyKeyword, 81 /* FinallyKeyword */); + } + return ts.map(keywords, getHighlightSpanForNode); + } + function getThrowOccurrences(throwStatement) { + var owner = getThrowStatementOwner(throwStatement); + if (!owner) { + return undefined; + } + var keywords = []; + ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { + pushKeywordIf(keywords, throwStatement.getFirstToken(), 94 /* ThrowKeyword */); + }); + // If the "owner" is a function, then we equate 'return' and 'throw' statements in their + // ability to "jump out" of the function, and include occurrences for both. + if (ts.isFunctionBlock(owner)) { + ts.forEachReturnStatement(owner, function (returnStatement) { + pushKeywordIf(keywords, returnStatement.getFirstToken(), 90 /* ReturnKeyword */); + }); + } + return ts.map(keywords, getHighlightSpanForNode); + } + function getReturnOccurrences(returnStatement) { + var func = ts.getContainingFunction(returnStatement); + // If we didn't find a containing function with a block body, bail out. + if (!(func && hasKind(func.body, 179 /* Block */))) { + return undefined; + } + var keywords = []; + ts.forEachReturnStatement(func.body, function (returnStatement) { + pushKeywordIf(keywords, returnStatement.getFirstToken(), 90 /* ReturnKeyword */); + }); + // Include 'throw' statements that do not occur within a try block. + ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { + pushKeywordIf(keywords, throwStatement.getFirstToken(), 94 /* ThrowKeyword */); + }); + return ts.map(keywords, getHighlightSpanForNode); + } + function getIfElseOccurrences(ifStatement) { + var keywords = []; + // Traverse upwards through all parent if-statements linked by their else-branches. + while (hasKind(ifStatement.parent, 183 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { + ifStatement = ifStatement.parent; + } + // Now traverse back down through the else branches, aggregating if/else keywords of if-statements. + while (ifStatement) { + var children = ifStatement.getChildren(); + pushKeywordIf(keywords, children[0], 84 /* IfKeyword */); + // Generally the 'else' keyword is second-to-last, so we traverse backwards. + for (var i = children.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, children[i], 76 /* ElseKeyword */)) { + break; + } + } + if (!hasKind(ifStatement.elseStatement, 183 /* IfStatement */)) { break; } + ifStatement = ifStatement.elseStatement; } - if (!hasKind(ifStatement.elseStatement, 183)) { - break; - } - ifStatement = ifStatement.elseStatement; - } - var result = []; - 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))) { - shouldHighlightNextKeyword = false; - break; + var result = []; + // We'd like to highlight else/ifs together if they are only separated by whitespace + // (i.e. the keywords are separated by no comments, no newlines). + for (var i = 0; i < keywords.length; i++) { + if (keywords[i].kind === 76 /* ElseKeyword */ && i < keywords.length - 1) { + var elseKeyword = keywords[i]; + var ifKeyword = keywords[i + 1]; // this *should* always be an 'if' keyword. + var shouldCombindElseAndIf = true; + // Avoid recalculating getStart() by iterating backwards. + for (var j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { + if (!ts.isWhiteSpace(sourceFile.text.charCodeAt(j))) { + shouldCombindElseAndIf = false; + break; + } } - } - if (shouldHighlightNextKeyword) { - result.push({ - fileName: fileName, - textSpan: ts.createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), - isWriteAccess: false - }); - i++; - continue; - } - } - result.push(getReferenceEntryFromNode(keywords[i])); - } - return result; - } - function getReturnOccurrences(returnStatement) { - var func = ts.getContainingFunction(returnStatement); - if (!(func && hasKind(func.body, 179))) { - return undefined; - } - var keywords = []; - ts.forEachReturnStatement(func.body, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 90); - }); - ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 94); - }); - return ts.map(keywords, getReferenceEntryFromNode); - } - function getThrowOccurrences(throwStatement) { - var owner = getThrowStatementOwner(throwStatement); - if (!owner) { - return undefined; - } - var keywords = []; - ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 94); - }); - if (ts.isFunctionBlock(owner)) { - ts.forEachReturnStatement(owner, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 90); - }); - } - return ts.map(keywords, getReferenceEntryFromNode); - } - function aggregateOwnedThrowStatements(node) { - var statementAccumulator = []; - aggregate(node); - return statementAccumulator; - function aggregate(node) { - if (node.kind === 195) { - statementAccumulator.push(node); - } - else if (node.kind === 196) { - var tryStatement = node; - if (tryStatement.catchClause) { - aggregate(tryStatement.catchClause); - } - else { - aggregate(tryStatement.tryBlock); - } - if (tryStatement.finallyBlock) { - aggregate(tryStatement.finallyBlock); - } - } - else if (!ts.isFunctionLike(node)) { - ts.forEachChild(node, aggregate); - } - } - ; - } - function getThrowStatementOwner(throwStatement) { - var child = throwStatement; - while (child.parent) { - var parent_9 = child.parent; - if (ts.isFunctionBlock(parent_9) || parent_9.kind === 227) { - return parent_9; - } - if (parent_9.kind === 196) { - var tryStatement = parent_9; - if (tryStatement.tryBlock === child && tryStatement.catchClause) { - return child; - } - } - child = parent_9; - } - return undefined; - } - function getTryCatchFinallyOccurrences(tryStatement) { - var keywords = []; - pushKeywordIf(keywords, tryStatement.getFirstToken(), 96); - if (tryStatement.catchClause) { - pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 68); - } - if (tryStatement.finallyBlock) { - 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(), 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], 100)) { - break; - } - } - } - } - var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); - ts.forEach(breaksAndContinues, function (statement) { - if (ownsBreakOrContinueStatement(loopNode, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 66, 71); - } - }); - return ts.map(keywords, getReferenceEntryFromNode); - } - function getSwitchCaseDefaultOccurrences(switchStatement) { - var keywords = []; - pushKeywordIf(keywords, switchStatement.getFirstToken(), 92); - ts.forEach(switchStatement.caseBlock.clauses, function (clause) { - pushKeywordIf(keywords, clause.getFirstToken(), 67, 73); - var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); - ts.forEach(breaksAndContinues, function (statement) { - if (ownsBreakOrContinueStatement(switchStatement, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 66); - } - }); - }); - return ts.map(keywords, getReferenceEntryFromNode); - } - function getBreakOrContinueStatementOccurences(breakOrContinueStatement) { - var owner = getBreakOrContinueOwner(breakOrContinueStatement); - if (owner) { - switch (owner.kind) { - case 186: - case 187: - case 188: - case 184: - case 185: - return getLoopBreakContinueOccurrences(owner); - case 193: - return getSwitchCaseDefaultOccurrences(owner); - } - } - return undefined; - } - function aggregateAllBreakAndContinueStatements(node) { - var statementAccumulator = []; - aggregate(node); - return statementAccumulator; - function aggregate(node) { - if (node.kind === 190 || node.kind === 189) { - statementAccumulator.push(node); - } - else if (!ts.isFunctionLike(node)) { - ts.forEachChild(node, aggregate); - } - } - ; - } - function ownsBreakOrContinueStatement(owner, statement) { - var actualOwner = getBreakOrContinueOwner(statement); - return actualOwner && actualOwner === owner; - } - function getBreakOrContinueOwner(statement) { - for (var node_1 = statement.parent; node_1; node_1 = node_1.parent) { - switch (node_1.kind) { - case 193: - if (statement.kind === 189) { + if (shouldCombindElseAndIf) { + result.push({ + fileName: fileName, + textSpan: ts.createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), + kind: HighlightSpanKind.reference + }); + i++; // skip the next keyword continue; } - 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_1)) { - return undefined; - } - break; - } - } - return undefined; - } - function getConstructorOccurrences(constructorDeclaration) { - var declarations = constructorDeclaration.symbol.getDeclarations(); - var keywords = []; - ts.forEach(declarations, function (declaration) { - ts.forEach(declaration.getChildren(), function (token) { - return pushKeywordIf(keywords, token, 114); - }); - }); - return ts.map(keywords, getReferenceEntryFromNode); - } - function getGetAndSetOccurrences(accessorDeclaration) { - var keywords = []; - 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, 116, 120); }); + } + // Ordinary case: just highlight the keyword. + result.push(getHighlightSpanForNode(keywords[i])); } + return result; } } - function getModifierOccurrences(modifier, declaration) { - var container = declaration.parent; - if (ts.isAccessibilityModifier(modifier)) { - if (!(container.kind === 201 || - (declaration.kind === 129 && hasKind(container, 135)))) { - return undefined; - } - } - else if (modifier === 110) { - if (container.kind !== 201) { - return undefined; - } - } - else if (modifier === 78 || modifier === 115) { - if (!(container.kind === 206 || container.kind === 227)) { - return undefined; - } - } - else { + } + /// References and Occurrences + function getOccurrencesAtPositionCore(fileName, position) { + synchronizeHostData(); + return convertDocumentHighlights(getDocumentHighlights(fileName, position, [fileName])); + function convertDocumentHighlights(documentHighlights) { + if (!documentHighlights) { return undefined; } - var keywords = []; - var modifierFlag = getFlagFromModifier(modifier); - var nodes; - switch (container.kind) { - case 206: - case 227: - nodes = container.statements; - break; - case 135: - nodes = container.parameters.concat(container.parent.members); - break; - case 201: - nodes = container.members; - if (modifierFlag & 112) { - var constructor = ts.forEach(container.members, function (member) { - return member.kind === 135 && member; - }); - if (constructor) { - nodes = nodes.concat(constructor.parameters); - } - } - break; - default: - ts.Debug.fail("Invalid container kind."); - } - ts.forEach(nodes, function (node) { - if (node.modifiers && node.flags & modifierFlag) { - ts.forEach(node.modifiers, function (child) { return pushKeywordIf(keywords, child, modifier); }); - } - }); - return ts.map(keywords, getReferenceEntryFromNode); - function getFlagFromModifier(modifier) { - switch (modifier) { - case 109: - return 16; - case 107: - return 32; - case 108: - return 64; - case 110: - return 128; - case 78: - return 1; - case 115: - return 2; - default: - ts.Debug.fail(); + var result = []; + for (var _i = 0; _i < documentHighlights.length; _i++) { + var entry = documentHighlights[_i]; + for (var _a = 0, _b = entry.highlightSpans; _a < _b.length; _a++) { + var highlightSpan = _b[_a]; + result.push({ + fileName: entry.fileName, + textSpan: highlightSpan.textSpan, + isWriteAccess: highlightSpan.kind === HighlightSpanKind.writtenReference + }); } } - } - function hasKind(node, kind) { - return node !== undefined && node.kind === kind; - } - function parent(node) { - return node && node.parent; - } - function pushKeywordIf(keywordList, token) { - var expected = []; - for (var _i = 2; _i < arguments.length; _i++) { - expected[_i - 2] = arguments[_i]; - } - if (token && ts.contains(expected, token.kind)) { - keywordList.push(token); - return true; - } - return false; + return result; } } function convertReferences(referenceSymbols) { @@ -32195,6 +38217,7 @@ var ts; } function findReferences(fileName, position) { var referencedSymbols = findReferencedSymbols(fileName, position, false, false); + // Only include referenced symbols that have a valid definition. return ts.filter(referencedSymbols, function (rs) { return !!rs.definition; }); } function findReferencedSymbols(fileName, position, findInStrings, findInComments) { @@ -32204,68 +38227,78 @@ var ts; if (!node) { return undefined; } - if (node.kind !== 65 && + if (node.kind !== 65 /* Identifier */ && + // TODO (drosen): This should be enabled in a later release - currently breaks rename. + //node.kind !== SyntaxKind.ThisKeyword && + //node.kind !== SyntaxKind.SuperKeyword && !isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && !isNameOfExternalModuleImportOrDeclaration(node)) { return undefined; } - ts.Debug.assert(node.kind === 65 || node.kind === 7 || node.kind === 8); - return getReferencesForNode(node, program.getSourceFiles(), false, findInStrings, findInComments); + ts.Debug.assert(node.kind === 65 /* Identifier */ || node.kind === 7 /* NumericLiteral */ || node.kind === 8 /* StringLiteral */); + return getReferencedSymbolsForNodes(node, program.getSourceFiles(), findInStrings, findInComments); } - function getReferencesForNode(node, sourceFiles, searchOnlyInCurrentFile, findInStrings, findInComments) { + function getReferencedSymbolsForNodes(node, sourceFiles, findInStrings, findInComments) { + var typeChecker = program.getTypeChecker(); + // Labels if (isLabelName(node)) { if (isJumpStatementTarget(node)) { var labelDefinition = getTargetLabel(node.parent, node.text); + // if we have a label definition, look within its statement for references, if not, then + // the label is undefined and we have no results.. return labelDefinition ? getLabelReferencesInNode(labelDefinition.parent, labelDefinition) : undefined; } else { + // it is a label definition and not a target, search within the parent labeledStatement return getLabelReferencesInNode(node.parent, node); } } - if (node.kind === 93) { + if (node.kind === 93 /* ThisKeyword */) { return getReferencesForThisKeyword(node, sourceFiles); } - if (node.kind === 91) { + if (node.kind === 91 /* SuperKeyword */) { return getReferencesForSuperKeyword(node); } - var symbol = typeInfoResolver.getSymbolAtLocation(node); + var symbol = typeChecker.getSymbolAtLocation(node); + // Could not find a symbol e.g. unknown identifier if (!symbol) { + // Can't have references to something that we have no symbol for. return undefined; } var declarations = symbol.declarations; + // The symbol was an internal symbol and does not have a declaration e.g.undefined symbol if (!declarations || !declarations.length) { return undefined; } var result; + // Compute the meaning from the location and the symbol it references var searchMeaning = getIntersectingMeaningFromDeclarations(getMeaningFromLocation(node), declarations); + // Get the text to search for, we need to normalize it as external module names will have quote var declaredName = getDeclaredName(symbol, node); + // Try to get the smallest valid scope that we can limit our search to; + // otherwise we'll need to search globally (i.e. include each file). var scope = getSymbolScope(symbol); + // Maps from a symbol ID to the ReferencedSymbol entry in 'result'. var symbolToIndex = []; if (scope) { 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, symbolToIndex); - } - else { - var internedName = getInternedName(symbol, node, declarations); - ts.forEach(sourceFiles, function (sourceFile) { - cancellationToken.throwIfCancellationRequested(); - var nameTable = getNameTable(sourceFile); - if (ts.lookUp(nameTable, internedName)) { - result = result || []; - getReferencesInNode(sourceFile, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); - } - }); + var internedName = getInternedName(symbol, node, declarations); + for (var _i = 0; _i < sourceFiles.length; _i++) { + var sourceFile = sourceFiles[_i]; + cancellationToken.throwIfCancellationRequested(); + var nameTable = getNameTable(sourceFile); + if (ts.lookUp(nameTable, internedName)) { + result = 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 info = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, node.getSourceFile(), getContainerNode(node), node); var name = ts.map(info.displayParts, function (p) { return p.text; }).join(""); var declarations = symbol.declarations; if (!declarations || declarations.length === 0) { @@ -32282,31 +38315,49 @@ var ts; } function isImportOrExportSpecifierName(location) { return location.parent && - (location.parent.kind === 213 || location.parent.kind === 217) && + (location.parent.kind === 213 /* ImportSpecifier */ || location.parent.kind === 217 /* ExportSpecifier */) && location.parent.propertyName === location; } function isImportOrExportSpecifierImportSymbol(symbol) { - return (symbol.flags & 8388608) && ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 213 || declaration.kind === 217; + return (symbol.flags & 8388608 /* Alias */) && ts.forEach(symbol.declarations, function (declaration) { + return declaration.kind === 213 /* ImportSpecifier */ || declaration.kind === 217 /* ExportSpecifier */; }); } function getDeclaredName(symbol, location) { - var functionExpression = ts.forEach(symbol.declarations, function (d) { return d.kind === 162 ? d : undefined; }); + // Special case for function expressions, whose names are solely local to their bodies. + var functionExpression = ts.forEach(symbol.declarations, function (d) { return d.kind === 162 /* FunctionExpression */ ? d : undefined; }); + // When a name gets interned into a SourceFile's 'identifiers' Map, + // its name is escaped and stored in the same way its symbol name/identifier + // name should be stored. Function expressions, however, are a special case, + // because despite sometimes having a name, the binder unconditionally binds them + // to a symbol with the name "__function". var name; if (functionExpression && functionExpression.name) { name = functionExpression.name.text; } + // If this is an export or import specifier it could have been renamed using the as syntax. + // if so we want to search for whatever under the cursor, the symbol is pointing to the alias (name) + // so check for the propertyName. if (isImportOrExportSpecifierName(location)) { return location.getText(); } - name = typeInfoResolver.symbolToString(symbol); + name = typeChecker.symbolToString(symbol); return stripQuotes(name); } function getInternedName(symbol, location, declarations) { + // If this is an export or import specifier it could have been renamed using the as syntax. + // if so we want to search for whatever under the cursor, the symbol is pointing to the alias (name) + // so check for the propertyName. if (isImportOrExportSpecifierName(location)) { return location.getText(); } - var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 162 ? d : undefined; }); + // Special case for function expressions, whose names are solely local to their bodies. + var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 162 /* FunctionExpression */ ? d : undefined; }); + // When a name gets interned into a SourceFile's 'identifiers' Map, + // its name is escaped and stored in the same way its symbol name/identifier + // name should be stored. Function expressions, however, are a special case, + // because despite sometimes having a name, the binder unconditionally binds them + // to a symbol with the name "__function". var name = functionExpression && functionExpression.name ? functionExpression.name.text : symbol.name; @@ -32314,23 +38365,28 @@ var ts; } function stripQuotes(name) { var length = name.length; - if (length >= 2 && name.charCodeAt(0) === 34 && name.charCodeAt(length - 1) === 34) { + if (length >= 2 && name.charCodeAt(0) === 34 /* doubleQuote */ && name.charCodeAt(length - 1) === 34 /* doubleQuote */) { return name.substring(1, length - 1); } ; return name; } function getSymbolScope(symbol) { - if (symbol.flags & (4 | 8192)) { - var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (d.flags & 32) ? d : undefined; }); + // If this is private property or method, the scope is the containing class + if (symbol.flags & (4 /* Property */ | 8192 /* Method */)) { + var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (d.flags & 32 /* Private */) ? d : undefined; }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 201); + return ts.getAncestor(privateDeclaration, 201 /* ClassDeclaration */); } } - if (symbol.flags & 8388608) { + // If the symbol is an import we would like to find it if we are looking for what it imports. + // So consider it visibile outside its declaration scope. + if (symbol.flags & 8388608 /* Alias */) { return undefined; } - if (symbol.parent || (symbol.flags & 268435456)) { + // if this symbol is visible from its parent container, e.g. exported, then bail out + // if symbol correspond to the union property - bail out + if (symbol.parent || (symbol.flags & 268435456 /* UnionProperty */)) { return undefined; } var scope = undefined; @@ -32343,11 +38399,15 @@ var ts; return undefined; } if (scope && scope !== container) { + // Different declarations have different containers, bail out return undefined; } - if (container.kind === 227 && !ts.isExternalModule(container)) { + if (container.kind === 227 /* SourceFile */ && !ts.isExternalModule(container)) { + // This is a global variable and not an external module, any declaration defined + // within this scope is visible outside the file return undefined; } + // The search scope is the container node scope = container; } } @@ -32355,6 +38415,9 @@ var ts; } function getPossibleSymbolReferencePositions(sourceFile, symbolName, start, end) { var positions = []; + /// TODO: Cache symbol existence for files to save text search + // Also, need to make this work for unicode escapes. + // Be resilient in the face of a symbol with no name or zero length name if (!symbolName || !symbolName.length) { return positions; } @@ -32364,11 +38427,15 @@ var ts; var position = text.indexOf(symbolName, start); while (position >= 0) { cancellationToken.throwIfCancellationRequested(); + // If we are past the end, stop looking if (position > end) break; + // We found a match. Make sure it's not part of a larger word (i.e. the char + // before and after it have to be a non-identifier char). var endPosition = position + symbolNameLength; - if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 2)) && - (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 2))) { + if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 2 /* Latest */)) && + (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 2 /* Latest */))) { + // Found a real match. Keep searching. positions.push(position); } position = text.indexOf(symbolName, position + symbolNameLength + 1); @@ -32386,6 +38453,7 @@ var ts; if (!node || node.getWidth() !== labelName.length) { return; } + // Only pick labels that are either the target label, or have a target that is the target label if (node === targetLabel || (isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel)) { references.push(getReferenceEntryFromNode(node)); @@ -32403,16 +38471,18 @@ var ts; } function isValidReferencePosition(node, searchSymbolName) { if (node) { + // Compare the length so we filter out strict superstrings of the symbol we are looking for switch (node.kind) { - case 65: + case 65 /* Identifier */: return node.getWidth() === searchSymbolName.length; - case 8: + case 8 /* StringLiteral */: if (isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { + // For string literals we have two additional chars for the quotes return node.getWidth() === searchSymbolName.length + 2; } break; - case 7: + case 7 /* NumericLiteral */: if (isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) { return node.getWidth() === searchSymbolName.length; } @@ -32421,18 +38491,30 @@ var ts; } return false; } + /** Search within node "container" for references for a search value, where the search value is defined as a + * tuple of(searchSymbol, searchText, searchLocation, and searchMeaning). + * searchLocation: a node where the search value + */ function getReferencesInNode(container, searchSymbol, searchText, searchLocation, searchMeaning, findInStrings, findInComments, result, symbolToIndex) { var sourceFile = container.getSourceFile(); var tripleSlashDirectivePrefixRegex = /^\/\/\/\s*= 0) { + else if (!(referenceSymbol.flags & 67108864 /* Transient */) && searchSymbols.indexOf(shorthandValueSymbol) >= 0) { var referencedSymbol = getReferencedSymbol(shorthandValueSymbol); referencedSymbol.references.push(getReferenceEntryFromNode(referenceSymbolDeclaration.name)); } @@ -32479,12 +38561,15 @@ var ts; } function isInString(position) { var token = ts.getTokenAtPosition(sourceFile, position); - return token && token.kind === 8 && position > token.getStart(); + return token && token.kind === 8 /* StringLiteral */ && position > token.getStart(); } function isInComment(position) { var token = ts.getTokenAtPosition(sourceFile, position); if (token && position < token.getStart()) { + // First, we have to see if this position actually landed in a comment. var commentRanges = ts.getLeadingCommentRanges(sourceFile.text, token.pos); + // Then we want to make sure that it wasn't in a "///<" directive comment + // We don't want to unintentionally update a file name. return ts.forEach(commentRanges, function (c) { if (c.pos < position && position < c.end) { var commentText = sourceFile.text.substring(c.pos, c.end); @@ -32502,17 +38587,18 @@ var ts; if (!searchSpaceNode) { return undefined; } - var staticFlag = 128; + // Whether 'super' occurs in a static context within a class. + var staticFlag = 128 /* Static */; switch (searchSpaceNode.kind) { - case 132: - case 131: - case 134: - case 133: - case 135: - case 136: - case 137: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 135 /* Constructor */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: staticFlag &= searchSpaceNode.flags; - searchSpaceNode = searchSpaceNode.parent; + searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; default: return undefined; @@ -32523,11 +38609,14 @@ var ts; ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); var node = ts.getTouchingWord(sourceFile, position); - if (!node || node.kind !== 91) { + if (!node || node.kind !== 91 /* SuperKeyword */) { return; } var container = ts.getSuperContainer(node, false); - if (container && (128 & container.flags) === staticFlag && container.parent.symbol === searchSpaceNode.symbol) { + // If we have a 'super' container, we must have an enclosing class. + // Now make sure the owning class is the same as the search-space + // and has the same static qualifier as the original 'super's owner. + if (container && (128 /* Static */ & container.flags) === staticFlag && container.parent.symbol === searchSpaceNode.symbol) { references.push(getReferenceEntryFromNode(node)); } }); @@ -32536,34 +38625,39 @@ var ts; } function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, false); - var staticFlag = 128; + // Whether 'this' occurs in a static context within a class. + var staticFlag = 128 /* Static */; switch (searchSpaceNode.kind) { - case 134: - case 133: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } - case 132: - case 131: - case 135: - case 136: - case 137: + // fall through + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 135 /* Constructor */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: staticFlag &= searchSpaceNode.flags; - searchSpaceNode = searchSpaceNode.parent; + searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 227: + case 227 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } - case 200: - case 162: + // Fall through + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: break; + // Computed properties in classes are not handled here because references to this are illegal, + // so there is no point finding references to them. default: return undefined; } var references = []; var possiblePositions; - if (searchSpaceNode.kind === 227) { + if (searchSpaceNode.kind === 227 /* SourceFile */) { ts.forEach(sourceFiles, function (sourceFile) { possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); @@ -32589,30 +38683,32 @@ var ts; ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); var node = ts.getTouchingWord(sourceFile, position); - if (!node || node.kind !== 93) { + if (!node || node.kind !== 93 /* ThisKeyword */) { return; } var container = ts.getThisContainer(node, false); switch (searchSpaceNode.kind) { - case 162: - case 200: + case 162 /* FunctionExpression */: + case 200 /* FunctionDeclaration */: if (searchSpaceNode.symbol === container.symbol) { result.push(getReferenceEntryFromNode(node)); } break; - case 134: - case 133: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { result.push(getReferenceEntryFromNode(node)); } break; - case 201: - if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (container.flags & 128) === staticFlag) { + case 201 /* ClassDeclaration */: + // Make sure the container belongs to the same class + // and has the appropriate static modifier from the original container. + if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (container.flags & 128 /* Static */) === staticFlag) { result.push(getReferenceEntryFromNode(node)); } break; - case 227: - if (container.kind === 227 && !ts.isExternalModule(container)) { + case 227 /* SourceFile */: + if (container.kind === 227 /* SourceFile */ && !ts.isExternalModule(container)) { result.push(getReferenceEntryFromNode(node)); } break; @@ -32621,37 +38717,56 @@ var ts; } } function populateSearchSymbolSet(symbol, location) { + // The search set contains at least the current symbol var result = [symbol]; + // If the symbol is an alias, add what it alaises to the list if (isImportOrExportSpecifierImportSymbol(symbol)) { - result.push(typeInfoResolver.getAliasedSymbol(symbol)); + result.push(typeChecker.getAliasedSymbol(symbol)); } + // If the location is in a context sensitive location (i.e. in an object literal) try + // to get a contextual type for it, and add the property symbol from the contextual + // type to the search set if (isNameOfPropertyAssignment(location)) { ts.forEach(getPropertySymbolsFromContextualType(location), function (contextualSymbol) { - result.push.apply(result, typeInfoResolver.getRootSymbols(contextualSymbol)); + result.push.apply(result, typeChecker.getRootSymbols(contextualSymbol)); }); - var shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(location.parent); + /* Because in short-hand property assignment, location has two meaning : property name and as value of the property + * When we do findAllReference at the position of the short-hand property assignment, we would want to have references to position of + * property name and variable declaration of the identifier. + * Like in below example, when querying for all references for an identifier 'name', of the property assignment, the language service + * should show both 'name' in 'obj' and 'name' in variable declaration + * let name = "Foo"; + * let obj = { name }; + * In order to do that, we will populate the search set with the value symbol of the identifier as a value of the property assignment + * so that when matching with potential reference symbol, both symbols from property declaration and variable declaration + * will be included correctly. + */ + var shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(location.parent); if (shorthandValueSymbol) { result.push(shorthandValueSymbol); } } - ts.forEach(typeInfoResolver.getRootSymbols(symbol), function (rootSymbol) { + // If this is a union property, add all the symbols from all its source symbols in all unioned types. + // If the symbol is an instantiation from a another symbol (e.g. widened symbol) , add the root the list + ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) { if (rootSymbol !== symbol) { result.push(rootSymbol); } - if (rootSymbol.parent && rootSymbol.parent.flags & (32 | 64)) { + // Add symbol of properties/methods of the same name in base classes and implemented interfaces definitions + if (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result); } }); return result; } function getPropertySymbolsFromBaseTypes(symbol, propertyName, result) { - if (symbol && symbol.flags & (32 | 64)) { + if (symbol && symbol.flags & (32 /* Class */ | 64 /* Interface */)) { ts.forEach(symbol.getDeclarations(), function (declaration) { - if (declaration.kind === 201) { + if (declaration.kind === 201 /* ClassDeclaration */) { getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); } - else if (declaration.kind === 202) { + else if (declaration.kind === 202 /* InterfaceDeclaration */) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); } }); @@ -32659,12 +38774,13 @@ var ts; return; function getPropertySymbolFromTypeReference(typeReference) { if (typeReference) { - var type = typeInfoResolver.getTypeAtLocation(typeReference); + var type = typeChecker.getTypeAtLocation(typeReference); if (type) { - var propertySymbol = typeInfoResolver.getPropertyOfType(type, propertyName); + var propertySymbol = typeChecker.getPropertyOfType(type, propertyName); if (propertySymbol) { result.push(propertySymbol); } + // Visit the typeReference as well to see if it directly or indirectly use that property getPropertySymbolsFromBaseTypes(type.symbol, propertyName, result); } } @@ -32674,25 +38790,35 @@ var ts; if (searchSymbols.indexOf(referenceSymbol) >= 0) { return referenceSymbol; } + // If the reference symbol is an alias, check if what it is aliasing is one of the search + // symbols. if (isImportOrExportSpecifierImportSymbol(referenceSymbol)) { - var aliasedSymbol = typeInfoResolver.getAliasedSymbol(referenceSymbol); + var aliasedSymbol = typeChecker.getAliasedSymbol(referenceSymbol); if (searchSymbols.indexOf(aliasedSymbol) >= 0) { return aliasedSymbol; } } + // If the reference location is in an object literal, try to get the contextual type for the + // object literal, lookup the property symbol in the contextual type, and use this symbol to + // compare to our searchSymbol if (isNameOfPropertyAssignment(referenceLocation)) { return ts.forEach(getPropertySymbolsFromContextualType(referenceLocation), function (contextualSymbol) { - return ts.forEach(typeInfoResolver.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); + return ts.forEach(typeChecker.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); }); } - return ts.forEach(typeInfoResolver.getRootSymbols(referenceSymbol), function (rootSymbol) { + // Unwrap symbols to get to the root (e.g. transient symbols as a result of widening) + // Or a union property, use its underlying unioned symbols + return ts.forEach(typeChecker.getRootSymbols(referenceSymbol), function (rootSymbol) { + // if it is in the list, then we are done if (searchSymbols.indexOf(rootSymbol) >= 0) { return rootSymbol; } - if (rootSymbol.parent && rootSymbol.parent.flags & (32 | 64)) { - var result_2 = []; - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_2); - return ts.forEach(result_2, function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); + // Finally, try all properties with the same name in any type the containing type extended or implemented, and + // see if any is in the list + if (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { + var result_3 = []; + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_3); + return ts.forEach(result_3, function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); } return undefined; }); @@ -32700,27 +38826,29 @@ var ts; function getPropertySymbolsFromContextualType(node) { if (isNameOfPropertyAssignment(node)) { var objectLiteral = node.parent.parent; - var contextualType = typeInfoResolver.getContextualType(objectLiteral); - var name_20 = node.text; + var contextualType = typeChecker.getContextualType(objectLiteral); + var name_25 = node.text; if (contextualType) { - if (contextualType.flags & 16384) { - var unionProperty = contextualType.getProperty(name_20); + if (contextualType.flags & 16384 /* Union */) { + // This is a union type, first see if the property we are looking for is a union property (i.e. exists in all types) + // if not, search the constituent types for the property + var unionProperty = contextualType.getProperty(name_25); if (unionProperty) { return [unionProperty]; } else { - var result_3 = []; + var result_4 = []; ts.forEach(contextualType.types, function (t) { - var symbol = t.getProperty(name_20); + var symbol = t.getProperty(name_25); if (symbol) { - result_3.push(symbol); + result_4.push(symbol); } }); - return result_3; + return result_4; } } else { - var symbol_1 = contextualType.getProperty(name_20); + var symbol_1 = contextualType.getProperty(name_25); if (symbol_1) { return [symbol_1]; } @@ -32729,10 +38857,22 @@ var ts; } return undefined; } + /** Given an initial searchMeaning, extracted from a location, widen the search scope based on the declarations + * of the corresponding symbol. e.g. if we are searching for "Foo" in value position, but "Foo" references a class + * then we need to widen the search to include type positions as well. + * On the contrary, if we are searching for "Bar" in type position and we trace bar to an interface, and an uninstantiated + * module, we want to keep the search limited to only types, as the two declarations (interface and uninstantiated module) + * do not intersect in any of the three spaces. + */ function getIntersectingMeaningFromDeclarations(meaning, declarations) { if (declarations) { var lastIterationMeaning; do { + // The result is order-sensitive, for instance if initialMeaning === Namespace, and declarations = [class, instantiated module] + // we need to consider both as they initialMeaning intersects with the module in the namespace space, and the module + // intersects with the class in the value space. + // To achieve that we will keep iterating until the result stabilizes. + // Remember the last meaning lastIterationMeaning = meaning; for (var _i = 0; _i < declarations.length; _i++) { var declaration = declarations[_i]; @@ -32749,7 +38889,7 @@ var ts; function getReferenceEntryFromNode(node) { var start = node.getStart(); var end = node.getEnd(); - if (node.kind === 8) { + if (node.kind === 8 /* StringLiteral */) { start += 1; end -= 1; } @@ -32759,22 +38899,24 @@ var ts; isWriteAccess: isWriteAccess(node) }; } + /** A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment */ function isWriteAccess(node) { - if (node.kind === 65 && ts.isDeclarationName(node)) { + if (node.kind === 65 /* Identifier */ && ts.isDeclarationName(node)) { return true; } var parent = node.parent; if (parent) { - if (parent.kind === 168 || parent.kind === 167) { + if (parent.kind === 168 /* PostfixUnaryExpression */ || parent.kind === 167 /* PrefixUnaryExpression */) { return true; } - else if (parent.kind === 169 && parent.left === node) { + else if (parent.kind === 169 /* BinaryExpression */ && parent.left === node) { var operator = parent.operatorToken.kind; - return 53 <= operator && operator <= 64; + return 53 /* FirstAssignment */ <= operator && operator <= 64 /* LastAssignment */; } } return false; } + /// NavigateTo function getNavigateToItems(searchValue, maxResultCount) { synchronizeHostData(); return ts.NavigateTo.getNavigateToItems(program, cancellationToken, searchValue, maxResultCount); @@ -32801,60 +38943,61 @@ var ts; } function getMeaningFromDeclaration(node) { switch (node.kind) { - case 129: - case 198: - case 152: - case 132: - case 131: - case 224: - case 225: - case 226: - case 134: - case 133: - case 135: - 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; + case 129 /* Parameter */: + case 198 /* VariableDeclaration */: + case 152 /* BindingElement */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: + case 224 /* PropertyAssignment */: + case 225 /* ShorthandPropertyAssignment */: + case 226 /* EnumMember */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 135 /* Constructor */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 200 /* FunctionDeclaration */: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: + case 223 /* CatchClause */: + return 1 /* Value */; + case 128 /* TypeParameter */: + case 202 /* InterfaceDeclaration */: + case 203 /* TypeAliasDeclaration */: + case 145 /* TypeLiteral */: + return 2 /* Type */; + case 201 /* ClassDeclaration */: + case 204 /* EnumDeclaration */: + return 1 /* Value */ | 2 /* Type */; + case 205 /* ModuleDeclaration */: + if (node.name.kind === 8 /* StringLiteral */) { + return 4 /* Namespace */ | 1 /* Value */; } - else if (ts.getModuleInstanceState(node) === 1) { - return 4 | 1; + else if (ts.getModuleInstanceState(node) === 1 /* Instantiated */) { + return 4 /* Namespace */ | 1 /* Value */; } else { - return 4; + return 4 /* Namespace */; } - case 212: - case 213: - case 208: - case 209: - case 214: - case 215: - return 1 | 2 | 4; - case 227: - return 4 | 1; + case 212 /* NamedImports */: + case 213 /* ImportSpecifier */: + case 208 /* ImportEqualsDeclaration */: + case 209 /* ImportDeclaration */: + case 214 /* ExportAssignment */: + case 215 /* ExportDeclaration */: + return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; + // An external module can be a Value + case 227 /* SourceFile */: + return 4 /* Namespace */ | 1 /* Value */; } - return 1 | 2 | 4; + return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; ts.Debug.fail("Unknown declaration type"); } function isTypeReference(node) { if (ts.isRightSideOfQualifiedNameOrPropertyAccess(node)) { node = node.parent; } - return node.parent.kind === 141 || node.parent.kind === 177; + return node.parent.kind === 141 /* TypeReference */ || node.parent.kind === 177 /* HeritageClauseElement */; } function isNamespaceReference(node) { return isQualifiedNameNamespaceReference(node) || isPropertyAccessNamespaceReference(node); @@ -32862,48 +39005,51 @@ var ts; function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 155) { - while (root.parent && root.parent.kind === 155) { + if (root.parent.kind === 155 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 155 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 177 && root.parent.parent.kind === 222) { + if (!isLastClause && root.parent.kind === 177 /* HeritageClauseElement */ && root.parent.parent.kind === 222 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 201 && root.parent.parent.token === 103) || - (decl.kind === 202 && root.parent.parent.token === 79); + return (decl.kind === 201 /* ClassDeclaration */ && root.parent.parent.token === 102 /* ImplementsKeyword */) || + (decl.kind === 202 /* InterfaceDeclaration */ && root.parent.parent.token === 79 /* ExtendsKeyword */); } return false; } function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 126) { - while (root.parent && root.parent.kind === 126) { + if (root.parent.kind === 126 /* QualifiedName */) { + while (root.parent && root.parent.kind === 126 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 141 && !isLastClause; + return root.parent.kind === 141 /* TypeReference */ && !isLastClause; } function isInRightSideOfImport(node) { - while (node.parent.kind === 126) { + while (node.parent.kind === 126 /* QualifiedName */) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; } function getMeaningFromRightHandSideOfImportEquals(node) { - ts.Debug.assert(node.kind === 65); - if (node.parent.kind === 126 && + ts.Debug.assert(node.kind === 65 /* Identifier */); + // import a = |b|; // Namespace + // import a = |b.c|; // Value, type, namespace + // import a = |b.c|.d; // Namespace + if (node.parent.kind === 126 /* QualifiedName */ && node.parent.right === node && - node.parent.parent.kind === 208) { - return 1 | 2 | 4; + node.parent.parent.kind === 208 /* ImportEqualsDeclaration */) { + return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } - return 4; + return 4 /* Namespace */; } function getMeaningFromLocation(node) { - if (node.parent.kind === 214) { - return 1 | 2 | 4; + if (node.parent.kind === 214 /* ExportAssignment */) { + return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } else if (isInRightSideOfImport(node)) { return getMeaningFromRightHandSideOfImportEquals(node); @@ -32912,64 +39058,79 @@ var ts; return getMeaningFromDeclaration(node.parent); } else if (isTypeReference(node)) { - return 2; + return 2 /* Type */; } else if (isNamespaceReference(node)) { - return 4; + return 4 /* Namespace */; } else { - return 1; + return 1 /* Value */; } } + // Signature help + /** + * This is a semantic operation. + */ function getSignatureHelpItems(fileName, position) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); - return ts.SignatureHelp.getSignatureHelpItems(sourceFile, position, typeInfoResolver, cancellationToken); + return ts.SignatureHelp.getSignatureHelpItems(program, sourceFile, position, cancellationToken); } + /// Syntactic features function getSourceFile(fileName) { return syntaxTreeCache.getCurrentSourceFile(fileName); } function getNameOrDottedNameSpan(fileName, startPos, endPos) { var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + // Get node at the location var node = ts.getTouchingPropertyName(sourceFile, startPos); if (!node) { return; } switch (node.kind) { - case 155: - case 126: - case 8: - case 80: - case 95: - case 89: - case 91: - case 93: - case 65: + case 155 /* PropertyAccessExpression */: + case 126 /* QualifiedName */: + case 8 /* StringLiteral */: + case 80 /* FalseKeyword */: + case 95 /* TrueKeyword */: + case 89 /* NullKeyword */: + case 91 /* SuperKeyword */: + case 93 /* ThisKeyword */: + case 65 /* Identifier */: break; + // Cant create the text span default: return; } var nodeForStartPos = node; while (true) { if (isRightSideOfPropertyAccess(nodeForStartPos) || isRightSideOfQualifiedName(nodeForStartPos)) { + // If on the span is in right side of the the property or qualified name, return the span from the qualified name pos to end of this node nodeForStartPos = nodeForStartPos.parent; } else if (isNameOfModuleDeclaration(nodeForStartPos)) { - if (nodeForStartPos.parent.parent.kind === 205 && + // If this is name of a module declarations, check if this is right side of dotted module name + // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of + // Then this name is name from dotted module + if (nodeForStartPos.parent.parent.kind === 205 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { + // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; } else { + // We have to use this name for start pos break; } } else { + // Is not a member expression so we have found the node for start pos break; } } return ts.createTextSpanFromBounds(nodeForStartPos.getStart(), node.getEnd()); } function getBreakpointStatementAtPosition(fileName, position) { + // doesn't use compiler - no need to synchronize with host var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); return ts.BreakpointResolver.spanInSourceFileAtLocation(sourceFile, position); } @@ -32980,45 +39141,53 @@ var ts; function getSemanticClassifications(fileName, span) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); + var typeChecker = program.getTypeChecker(); var result = []; processNode(sourceFile); return result; function classifySymbol(symbol, meaningAtPosition) { var flags = symbol.getFlags(); - if (flags & 32) { + if (flags & 32 /* Class */) { return ClassificationTypeNames.className; } - else if (flags & 384) { + else if (flags & 384 /* Enum */) { return ClassificationTypeNames.enumName; } - else if (flags & 524288) { + else if (flags & 524288 /* TypeAlias */) { return ClassificationTypeNames.typeAlias; } - else if (meaningAtPosition & 2) { - if (flags & 64) { + else if (meaningAtPosition & 2 /* Type */) { + if (flags & 64 /* Interface */) { return ClassificationTypeNames.interfaceName; } - else if (flags & 262144) { + else if (flags & 262144 /* TypeParameter */) { return ClassificationTypeNames.typeParameterName; } } - else if (flags & 1536) { - if (meaningAtPosition & 4 || - (meaningAtPosition & 1 && hasValueSideModule(symbol))) { + else if (flags & 1536 /* Module */) { + // Only classify a module as such if + // - It appears in a namespace context. + // - There exists a module declaration which actually impacts the value side. + if (meaningAtPosition & 4 /* Namespace */ || + (meaningAtPosition & 1 /* Value */ && hasValueSideModule(symbol))) { return ClassificationTypeNames.moduleName; } } return undefined; + /** + * Returns true if there exists a module that introduces entities on the value side. + */ function hasValueSideModule(symbol) { return ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 205 && ts.getModuleInstanceState(declaration) == 1; + return declaration.kind === 205 /* ModuleDeclaration */ && ts.getModuleInstanceState(declaration) == 1 /* Instantiated */; }); } } function processNode(node) { + // Only walk into nodes that intersect the requested span. if (node && ts.textSpanIntersectsWith(span, node.getStart(), node.getWidth())) { - if (node.kind === 65 && node.getWidth() > 0) { - var symbol = typeInfoResolver.getSymbolAtLocation(node); + if (node.kind === 65 /* Identifier */ && node.getWidth() > 0) { + var symbol = typeChecker.getSymbolAtLocation(node); if (symbol) { var type = classifySymbol(symbol, getMeaningFromLocation(node)); if (type) { @@ -33034,9 +39203,11 @@ var ts; } } function getSyntacticClassifications(fileName, span) { + // doesn't use compiler - no need to synchronize with host var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - var triviaScanner = ts.createScanner(2, false, sourceFile.text); - var mergeConflictScanner = ts.createScanner(2, false, sourceFile.text); + // Make a scanner we can get trivia from. + var triviaScanner = ts.createScanner(2 /* Latest */, false, sourceFile.text); + var mergeConflictScanner = ts.createScanner(2 /* Latest */, false, sourceFile.text); var result = []; processElement(sourceFile); return result; @@ -33045,6 +39216,7 @@ var ts; if (tokenStart === token.pos) { return; } + // token has trivia. Classify them appropriately. triviaScanner.setTextPos(token.pos); while (true) { var start = triviaScanner.getTextPos(); @@ -33056,29 +39228,36 @@ var ts; return; } if (ts.isComment(kind)) { + // Simple comment. Just add as is. result.push({ textSpan: ts.createTextSpan(start, width), classificationType: ClassificationTypeNames.comment }); continue; } - if (kind === 6) { + if (kind === 6 /* ConflictMarkerTrivia */) { var text = sourceFile.text; var ch = text.charCodeAt(start); - if (ch === 60 || ch === 62) { + // for the <<<<<<< and >>>>>>> markers, we just add them in as comments + // in the classification stream. + if (ch === 60 /* lessThan */ || ch === 62 /* greaterThan */) { result.push({ textSpan: ts.createTextSpan(start, width), classificationType: ClassificationTypeNames.comment }); continue; } - ts.Debug.assert(ch === 61); + // for the ======== add a comment for the first line, and then lex all + // subsequent lines up until the end of the conflict marker. + ts.Debug.assert(ch === 61 /* equals */); classifyDisabledMergeCode(text, start, end); } } } } function classifyDisabledMergeCode(text, start, end) { + // Classify the line that the ======= marker is on as a comment. Then just lex + // all further tokens and add them to the result. for (var i = start; i < end; i++) { if (ts.isLineBreak(text.charCodeAt(i))) { break; @@ -33117,69 +39296,79 @@ var ts; } } } + // for accurate classification, the actual token should be passed in. however, for + // cases like 'disabled merge code' classification, we just get the token kind and + // classify based on that instead. function classifyTokenType(tokenKind, token) { if (ts.isKeyword(tokenKind)) { return ClassificationTypeNames.keyword; } - if (tokenKind === 24 || tokenKind === 25) { + // Special case < and > If they appear in a generic context they are punctuation, + // not operators. + if (tokenKind === 24 /* LessThanToken */ || tokenKind === 25 /* GreaterThanToken */) { + // If the node owning the token has a type argument list or type parameter list, then + // we can effectively assume that a '<' and '>' belong to those lists. if (token && ts.getTypeArgumentOrTypeParameterList(token.parent)) { return ClassificationTypeNames.punctuation; } } if (ts.isPunctuation(tokenKind)) { if (token) { - if (tokenKind === 53) { - if (token.parent.kind === 198 || - token.parent.kind === 132 || - token.parent.kind === 129) { + if (tokenKind === 53 /* EqualsToken */) { + // the '=' in a variable declaration is special cased here. + if (token.parent.kind === 198 /* VariableDeclaration */ || + token.parent.kind === 132 /* PropertyDeclaration */ || + token.parent.kind === 129 /* Parameter */) { return ClassificationTypeNames.operator; } } - if (token.parent.kind === 169 || - token.parent.kind === 167 || - token.parent.kind === 168 || - token.parent.kind === 170) { + if (token.parent.kind === 169 /* BinaryExpression */ || + token.parent.kind === 167 /* PrefixUnaryExpression */ || + token.parent.kind === 168 /* PostfixUnaryExpression */ || + token.parent.kind === 170 /* ConditionalExpression */) { return ClassificationTypeNames.operator; } } return ClassificationTypeNames.punctuation; } - else if (tokenKind === 7) { + else if (tokenKind === 7 /* NumericLiteral */) { return ClassificationTypeNames.numericLiteral; } - else if (tokenKind === 8) { + else if (tokenKind === 8 /* StringLiteral */) { return ClassificationTypeNames.stringLiteral; } - else if (tokenKind === 9) { + else if (tokenKind === 9 /* RegularExpressionLiteral */) { + // TODO: we should get another classification type for these literals. return ClassificationTypeNames.stringLiteral; } else if (ts.isTemplateLiteralKind(tokenKind)) { + // TODO (drosen): we should *also* get another classification type for these literals. return ClassificationTypeNames.stringLiteral; } - else if (tokenKind === 65) { + else if (tokenKind === 65 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 201: + case 201 /* ClassDeclaration */: if (token.parent.name === token) { return ClassificationTypeNames.className; } return; - case 128: + case 128 /* TypeParameter */: if (token.parent.name === token) { return ClassificationTypeNames.typeParameterName; } return; - case 202: + case 202 /* InterfaceDeclaration */: if (token.parent.name === token) { return ClassificationTypeNames.interfaceName; } return; - case 204: + case 204 /* EnumDeclaration */: if (token.parent.name === token) { return ClassificationTypeNames.enumName; } return; - case 205: + case 205 /* ModuleDeclaration */: if (token.parent.name === token) { return ClassificationTypeNames.moduleName; } @@ -33190,6 +39379,7 @@ var ts; } } function processElement(element) { + // Ignore nodes that don't intersect the original span to classify. if (ts.textSpanIntersectsWith(span, element.getFullStart(), element.getFullWidth())) { var children = element.getChildren(); for (var _i = 0; _i < children.length; _i++) { @@ -33198,6 +39388,7 @@ var ts; classifyToken(child); } else { + // Recurse into our child nodes. processElement(child); } } @@ -33205,6 +39396,7 @@ var ts; } } function getOutliningSpans(fileName) { + // doesn't use compiler - no need to synchronize with host var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); return ts.OutliningElementsCollector.collectElements(sourceFile); } @@ -33214,6 +39406,7 @@ var ts; var token = ts.getTouchingToken(sourceFile, position); if (token.getStart(sourceFile) === position) { var matchKind = getMatchingTokenKind(token); + // Ensure that there is a corresponding token to match ours. if (matchKind) { var parentElement = token.parent; var childNodes = parentElement.getChildren(sourceFile); @@ -33222,6 +39415,7 @@ var ts; if (current.kind === matchKind) { var range1 = ts.createTextSpan(token.getStart(sourceFile), token.getWidth(sourceFile)); var range2 = ts.createTextSpan(current.getStart(sourceFile), current.getWidth(sourceFile)); + // We want to order the braces when we return the result. if (range1.start < range2.start) { result.push(range1, range2); } @@ -33236,14 +39430,14 @@ var ts; return result; function getMatchingTokenKind(token) { switch (token.kind) { - case 14: return 15; - case 16: return 17; - case 18: return 19; - case 24: return 25; - case 15: return 14; - case 17: return 16; - case 19: return 18; - case 25: return 24; + case 14 /* OpenBraceToken */: return 15 /* CloseBraceToken */; + case 16 /* OpenParenToken */: return 17 /* CloseParenToken */; + case 18 /* OpenBracketToken */: return 19 /* CloseBracketToken */; + case 24 /* LessThanToken */: return 25 /* GreaterThanToken */; + case 15 /* CloseBraceToken */: return 14 /* OpenBraceToken */; + case 17 /* CloseParenToken */: return 16 /* OpenParenToken */; + case 19 /* CloseBracketToken */: return 18 /* OpenBracketToken */; + case 25 /* GreaterThanToken */: return 24 /* LessThanToken */; } return undefined; } @@ -33279,6 +39473,12 @@ var ts; return []; } function getTodoComments(fileName, descriptors) { + // Note: while getting todo comments seems like a syntactic operation, we actually + // treat it as a semantic operation here. This is because we expect our host to call + // this on every single file. If we treat this syntactically, then that will cause + // us to populate and throw away the tree in our syntax tree cache for each file. By + // treating this as a semantic operation, we can access any tree without throwing + // anything away. synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); cancellationToken.throwIfCancellationRequested(); @@ -33289,10 +39489,29 @@ var ts; var matchArray; while (matchArray = regExp.exec(fileContents)) { cancellationToken.throwIfCancellationRequested(); + // If we got a match, here is what the match array will look like. Say the source text is: + // + // " // hack 1" + // + // The result array with the regexp: will be: + // + // ["// hack 1", "// ", "hack 1", undefined, "hack"] + // + // Here are the relevant capture groups: + // 0) The full match for the entire regexp. + // 1) The preamble to the message portion. + // 2) The message portion. + // 3...N) The descriptor that was matched - by index. 'undefined' for each + // descriptor that didn't match. an actual value if it did match. + // + // i.e. 'undefined' in position 3 above means TODO(jason) didn't match. + // "hack" in position 4 means HACK did match. var firstDescriptorCaptureIndex = 3; ts.Debug.assert(matchArray.length === descriptors.length + firstDescriptorCaptureIndex); var preamble = matchArray[1]; var matchPosition = matchArray.index + preamble.length; + // OK, we have found a match in the file. This is only an acceptable match if + // it is contained within a comment. var token = ts.getTokenAtPosition(sourceFile, matchPosition); if (!isInsideComment(sourceFile, token, matchPosition)) { continue; @@ -33304,6 +39523,8 @@ var ts; } } ts.Debug.assert(descriptor !== undefined); + // We don't want to match something like 'TODOBY', so we make sure a non + // letter/digit follows the match. if (isLetterOrDigit(fileContents.charCodeAt(matchPosition + descriptor.text.length))) { continue; } @@ -33322,49 +39543,89 @@ var ts; 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. + // TODO comments can appear in one of the following forms: + // + // 1) // TODO or /////////// TODO + // + // 2) /* TODO or /********** TODO + // + // 3) /* + // * TODO + // */ + // + // The following three regexps are used to match the start of the text up to the TODO + // comment portion. var singleLineCommentStart = /(?:\/\/+\s*)/.source; var multiLineCommentStart = /(?:\/\*+\s*)/.source; var anyNumberOfSpacesAndAsterixesAtStartOfLine = /(?:^(?:\s|\*)*)/.source; + // Match any of the above three TODO comment start regexps. + // Note that the outermost group *is* a capture group. We want to capture the preamble + // so that we can determine the starting position of the TODO comment match. var preamble = "(" + anyNumberOfSpacesAndAsterixesAtStartOfLine + "|" + singleLineCommentStart + "|" + multiLineCommentStart + ")"; + // Takes the descriptors and forms a regexp that matches them as if they were literals. + // For example, if the descriptors are "TODO(jason)" and "HACK", then this will be: + // + // (?:(TODO\(jason\))|(HACK)) + // + // Note that the outermost group is *not* a capture group, but the innermost groups + // *are* capture groups. By capturing the inner literals we can determine after + // matching which descriptor we are dealing with. var literals = "(?:" + ts.map(descriptors, function (d) { return "(" + escapeRegExp(d.text) + ")"; }).join("|") + ")"; + // After matching a descriptor literal, the following regexp matches the rest of the + // text up to the end of the line (or */). var endOfLineOrEndOfComment = /(?:$|\*\/)/.source; var messageRemainder = /(?:.*?)/.source; + // This is the portion of the match we'll return as part of the TODO comment result. We + // match the literal portion up to the end of the line or end of comment. var messagePortion = "(" + literals + messageRemainder + ")"; var regExpString = preamble + messagePortion + endOfLineOrEndOfComment; + // The final regexp will look like this: + // /((?:\/\/+\s*)|(?:\/\*+\s*)|(?:^(?:\s|\*)*))((?:(TODO\(jason\))|(HACK))(?:.*?))(?:$|\*\/)/gim + // The flags of the regexp are important here. + // 'g' is so that we are doing a global search and can find matches several times + // in the input. + // + // 'i' is for case insensitivity (We do this to match C# TODO comment code). + // + // 'm' is so we can find matches in a multi-line input. return new RegExp(regExpString, "gim"); } function isLetterOrDigit(char) { - return (char >= 97 && char <= 122) || - (char >= 65 && char <= 90) || - (char >= 48 && char <= 57); + return (char >= 97 /* a */ && char <= 122 /* z */) || + (char >= 65 /* A */ && char <= 90 /* Z */) || + (char >= 48 /* _0 */ && char <= 57 /* _9 */); } } function getRenameInfo(fileName, position) { synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); + var typeChecker = program.getTypeChecker(); var node = ts.getTouchingWord(sourceFile, position); - if (node && node.kind === 65) { - var symbol = typeInfoResolver.getSymbolAtLocation(node); + // Can only rename an identifier. + if (node && node.kind === 65 /* Identifier */) { + var symbol = typeChecker.getSymbolAtLocation(node); + // Only allow a symbol to be renamed if it actually has at least one declaration. if (symbol) { var declarations = symbol.getDeclarations(); if (declarations && declarations.length > 0) { + // Disallow rename for elements that are defined in the standard TypeScript library. var defaultLibFileName = host.getDefaultLibFileName(host.getCompilationSettings()); if (defaultLibFileName) { for (var _i = 0; _i < declarations.length; _i++) { var current = declarations[_i]; - var sourceFile_1 = current.getSourceFile(); - if (sourceFile_1 && getCanonicalFileName(ts.normalizePath(sourceFile_1.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) { + var sourceFile_2 = current.getSourceFile(); + if (sourceFile_2 && getCanonicalFileName(ts.normalizePath(sourceFile_2.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) { return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library.key)); } } } - var kind = getSymbolKind(symbol, typeInfoResolver, node); + var kind = getSymbolKind(symbol, node); if (kind) { return { canRename: true, localizedErrorMessage: undefined, displayName: symbol.name, - fullDisplayName: typeInfoResolver.getFullyQualifiedName(symbol), + fullDisplayName: typeChecker.getFullyQualifiedName(symbol), kind: kind, kindModifiers: getSymbolModifiers(symbol), triggerSpan: ts.createTextSpan(node.getStart(), node.getWidth()) @@ -33402,6 +39663,7 @@ var ts; getReferencesAtPosition: getReferencesAtPosition, findReferences: findReferences, getOccurrencesAtPosition: getOccurrencesAtPosition, + getDocumentHighlights: getDocumentHighlights, getNameOrDottedNameSpan: getNameOrDottedNameSpan, getBreakpointStatementAtPosition: getBreakpointStatementAtPosition, getNavigateToItems: getNavigateToItems, @@ -33421,6 +39683,7 @@ var ts; }; } ts.createLanguageService = createLanguageService; + /* @internal */ function getNameTable(sourceFile) { if (!sourceFile.nameTable) { initializeNameTable(sourceFile); @@ -33434,13 +39697,17 @@ var ts; sourceFile.nameTable = nameTable; function walk(node) { switch (node.kind) { - case 65: + case 65 /* Identifier */: nameTable[node.text] = node.text; break; - case 8: - case 7: + case 8 /* StringLiteral */: + case 7 /* NumericLiteral */: + // We want to store any numbers/strings if they were a name that could be + // related to a declaration. So, if we have 'import x = require("something")' + // then we want 'something' to be in the name table. Similarly, if we have + // "a['propname']" then we want to store "propname" in the name table. if (ts.isDeclarationName(node) || - node.parent.kind === 219 || + node.parent.kind === 219 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node)) { nameTable[node.text] = node.text; } @@ -33453,126 +39720,202 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 156 && + node.parent.kind === 156 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } + /// Classifier function createClassifier() { - var scanner = ts.createScanner(2, false); + var scanner = ts.createScanner(2 /* Latest */, false); + /// We do not have a full parser support to know when we should parse a regex or not + /// If we consider every slash token to be a regex, we could be missing cases like "1/2/3", where + /// we have a series of divide operator. this list allows us to be more accurate by ruling out + /// locations where a regexp cannot exist. var noRegexTable = []; - noRegexTable[65] = true; - noRegexTable[8] = true; - noRegexTable[7] = true; - noRegexTable[9] = true; - noRegexTable[93] = true; - noRegexTable[38] = true; - noRegexTable[39] = true; - noRegexTable[17] = true; - noRegexTable[19] = true; - noRegexTable[15] = true; - noRegexTable[95] = true; - noRegexTable[80] = true; + noRegexTable[65 /* Identifier */] = true; + noRegexTable[8 /* StringLiteral */] = true; + noRegexTable[7 /* NumericLiteral */] = true; + noRegexTable[9 /* RegularExpressionLiteral */] = true; + noRegexTable[93 /* ThisKeyword */] = true; + noRegexTable[38 /* PlusPlusToken */] = true; + noRegexTable[39 /* MinusMinusToken */] = true; + noRegexTable[17 /* CloseParenToken */] = true; + noRegexTable[19 /* CloseBracketToken */] = true; + noRegexTable[15 /* CloseBraceToken */] = true; + noRegexTable[95 /* TrueKeyword */] = true; + noRegexTable[80 /* FalseKeyword */] = true; + // Just a stack of TemplateHeads and OpenCurlyBraces, used to perform rudimentary (inexact) + // classification on template strings. Because of the context free nature of templates, + // the only precise way to classify a template portion would be by propagating the stack across + // lines, just as we do with the end-of-line state. However, this is a burden for implementers, + // and the behavior is entirely subsumed by the syntactic classifier anyway, so we instead + // flatten any nesting when the template stack is non-empty and encode it in the end-of-line state. + // Situations in which this fails are + // 1) When template strings are nested across different lines: + // `hello ${ `world + // ` }` + // + // Where on the second line, you will get the closing of a template, + // a closing curly, and a new template. + // + // 2) When substitution expressions have curly braces and the curly brace falls on the next line: + // `hello ${ () => { + // return "world" } } ` + // + // Where on the second line, you will get the 'return' keyword, + // a string literal, and a template end consisting of '} } `'. var templateStack = []; + /** Returns true if 'keyword2' can legally follow 'keyword1' in any language construct. */ function canFollow(keyword1, keyword2) { if (ts.isAccessibilityModifier(keyword1)) { - if (keyword2 === 116 || - keyword2 === 120 || - keyword2 === 114 || - keyword2 === 110) { + if (keyword2 === 116 /* GetKeyword */ || + keyword2 === 120 /* SetKeyword */ || + keyword2 === 114 /* ConstructorKeyword */ || + keyword2 === 109 /* StaticKeyword */) { + // Allow things like "public get", "public constructor" and "public static". + // These are all legal. return true; } + // Any other keyword following "public" is actually an identifier an not a real + // keyword. return false; } + // Assume any other keyword combination is legal. This can be refined in the future + // if there are more cases we want the classifier to be better at. return true; } + // If there is a syntactic classifier ('syntacticClassifierAbsent' is false), + // we will be more conservative in order to avoid conflicting with the syntactic classifier. function getClassificationsForLine(text, lexState, syntacticClassifierAbsent) { var offset = 0; - var token = 0; - var lastNonTriviaToken = 0; + var token = 0 /* Unknown */; + var lastNonTriviaToken = 0 /* Unknown */; + // Empty out the template stack for reuse. while (templateStack.length > 0) { templateStack.pop(); } + // If we're in a string literal, then prepend: "\ + // (and a newline). That way when we lex we'll think we're still in a string literal. + // + // If we're in a multiline comment, then prepend: /* + // (and a newline). That way when we lex we'll think we're still in a multiline comment. switch (lexState) { - case 3: + case 3 /* InDoubleQuoteStringLiteral */: text = '"\\\n' + text; offset = 3; break; - case 2: + case 2 /* InSingleQuoteStringLiteral */: text = "'\\\n" + text; offset = 3; break; - case 1: + case 1 /* InMultiLineCommentTrivia */: text = "/*\n" + text; offset = 3; break; - case 4: + case 4 /* InTemplateHeadOrNoSubstitutionTemplate */: text = "`\n" + text; offset = 2; break; - case 5: + case 5 /* InTemplateMiddleOrTail */: text = "}\n" + text; offset = 2; - case 6: - templateStack.push(11); + // fallthrough + case 6 /* InTemplateSubstitutionPosition */: + templateStack.push(11 /* TemplateHead */); break; } scanner.setText(text); var result = { - finalLexState: 0, + finalLexState: 0 /* Start */, entries: [] }; + // We can run into an unfortunate interaction between the lexical and syntactic classifier + // when the user is typing something generic. Consider the case where the user types: + // + // Foo tokens. It's a weak heuristic, but should + // work well enough in practice. var angleBracketStack = 0; do { token = scanner.scan(); if (!ts.isTrivia(token)) { - if ((token === 36 || token === 57) && !noRegexTable[lastNonTriviaToken]) { - if (scanner.reScanSlashToken() === 9) { - token = 9; + if ((token === 36 /* SlashToken */ || token === 57 /* SlashEqualsToken */) && !noRegexTable[lastNonTriviaToken]) { + if (scanner.reScanSlashToken() === 9 /* RegularExpressionLiteral */) { + token = 9 /* RegularExpressionLiteral */; } } - else if (lastNonTriviaToken === 20 && isKeyword(token)) { - token = 65; + else if (lastNonTriviaToken === 20 /* DotToken */ && isKeyword(token)) { + token = 65 /* Identifier */; } else if (isKeyword(lastNonTriviaToken) && isKeyword(token) && !canFollow(lastNonTriviaToken, token)) { - token = 65; + // We have two keywords in a row. Only treat the second as a keyword if + // it's a sequence that could legally occur in the language. Otherwise + // treat it as an identifier. This way, if someone writes "private var" + // we recognize that 'var' is actually an identifier here. + token = 65 /* Identifier */; } - else if (lastNonTriviaToken === 65 && - token === 24) { + else if (lastNonTriviaToken === 65 /* Identifier */ && + token === 24 /* LessThanToken */) { + // Could be the start of something generic. Keep track of that by bumping + // up the current count of generic contexts we may be in. angleBracketStack++; } - else if (token === 25 && angleBracketStack > 0) { + else if (token === 25 /* GreaterThanToken */ && angleBracketStack > 0) { + // If we think we're currently in something generic, then mark that that + // generic entity is complete. angleBracketStack--; } - else if (token === 112 || - token === 121 || - token === 119 || - token === 113 || - token === 122) { + else if (token === 112 /* AnyKeyword */ || + token === 121 /* StringKeyword */ || + token === 119 /* NumberKeyword */ || + token === 113 /* BooleanKeyword */ || + token === 122 /* SymbolKeyword */) { if (angleBracketStack > 0 && !syntacticClassifierAbsent) { - token = 65; + // If it looks like we're could be in something generic, don't classify this + // as a keyword. We may just get overwritten by the syntactic classifier, + // causing a noisy experience for the user. + token = 65 /* Identifier */; } } - else if (token === 11) { + else if (token === 11 /* TemplateHead */) { templateStack.push(token); } - else if (token === 14) { + else if (token === 14 /* OpenBraceToken */) { + // If we don't have anything on the template stack, + // then we aren't trying to keep track of a previously scanned template head. if (templateStack.length > 0) { templateStack.push(token); } } - else if (token === 15) { + else if (token === 15 /* CloseBraceToken */) { + // If we don't have anything on the template stack, + // then we aren't trying to keep track of a previously scanned template head. if (templateStack.length > 0) { var lastTemplateStackToken = ts.lastOrUndefined(templateStack); - if (lastTemplateStackToken === 11) { + if (lastTemplateStackToken === 11 /* TemplateHead */) { token = scanner.reScanTemplateToken(); - if (token === 13) { + // Only pop on a TemplateTail; a TemplateMiddle indicates there is more for us. + if (token === 13 /* TemplateTail */) { templateStack.pop(); } else { - ts.Debug.assert(token === 12, "Should have been a template middle. Was " + token); + ts.Debug.assert(token === 12 /* TemplateMiddle */, "Should have been a template middle. Was " + token); } } else { - ts.Debug.assert(lastTemplateStackToken === 14, "Should have been an open brace. Was: " + token); + ts.Debug.assert(lastTemplateStackToken === 14 /* OpenBraceToken */, "Should have been an open brace. Was: " + token); templateStack.pop(); } } @@ -33580,54 +39923,59 @@ var ts; lastNonTriviaToken = token; } processToken(); - } while (token !== 1); + } while (token !== 1 /* EndOfFileToken */); return result; function processToken() { var start = scanner.getTokenPos(); var end = scanner.getTextPos(); addResult(end - start, classFromKind(token)); if (end >= text.length) { - if (token === 8) { + if (token === 8 /* StringLiteral */) { + // Check to see if we finished up on a multiline string literal. var tokenText = scanner.getTokenText(); if (scanner.isUnterminated()) { var lastCharIndex = tokenText.length - 1; var numBackslashes = 0; - while (tokenText.charCodeAt(lastCharIndex - numBackslashes) === 92) { + while (tokenText.charCodeAt(lastCharIndex - numBackslashes) === 92 /* backslash */) { numBackslashes++; } + // If we have an odd number of backslashes, then the multiline string is unclosed if (numBackslashes & 1) { var quoteChar = tokenText.charCodeAt(0); - result.finalLexState = quoteChar === 34 - ? 3 - : 2; + result.finalLexState = quoteChar === 34 /* doubleQuote */ + ? 3 /* InDoubleQuoteStringLiteral */ + : 2 /* InSingleQuoteStringLiteral */; } } } - else if (token === 3) { + else if (token === 3 /* MultiLineCommentTrivia */) { + // Check to see if the multiline comment was unclosed. if (scanner.isUnterminated()) { - result.finalLexState = 1; + result.finalLexState = 1 /* InMultiLineCommentTrivia */; } } else if (ts.isTemplateLiteralKind(token)) { if (scanner.isUnterminated()) { - if (token === 13) { - result.finalLexState = 5; + if (token === 13 /* TemplateTail */) { + result.finalLexState = 5 /* InTemplateMiddleOrTail */; } - else if (token === 10) { - result.finalLexState = 4; + else if (token === 10 /* NoSubstitutionTemplateLiteral */) { + result.finalLexState = 4 /* InTemplateHeadOrNoSubstitutionTemplate */; } else { ts.Debug.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #" + token); } } } - else if (templateStack.length > 0 && ts.lastOrUndefined(templateStack) === 11) { - result.finalLexState = 6; + else if (templateStack.length > 0 && ts.lastOrUndefined(templateStack) === 11 /* TemplateHead */) { + result.finalLexState = 6 /* InTemplateSubstitutionPosition */; } } } function addResult(length, classification) { if (length > 0) { + // If this is the first classification we're adding to the list, then remove any + // offset we have if we were continuing a construct from the previous line. if (result.entries.length === 0) { length -= offset; } @@ -33637,42 +39985,42 @@ var ts; } function isBinaryExpressionOperatorToken(token) { switch (token) { - case 35: - case 36: - case 37: - case 33: - case 34: - case 40: - case 41: - case 42: - case 24: - case 25: - case 26: - case 27: - case 87: - case 86: - case 28: - case 29: - case 30: - case 31: - case 43: - case 45: - case 44: - case 48: - case 49: - case 63: - case 62: - case 64: - case 59: - case 60: - case 61: - case 54: - case 55: - case 56: - case 57: - case 58: - case 53: - case 23: + case 35 /* AsteriskToken */: + case 36 /* SlashToken */: + case 37 /* PercentToken */: + case 33 /* PlusToken */: + case 34 /* MinusToken */: + case 40 /* LessThanLessThanToken */: + case 41 /* GreaterThanGreaterThanToken */: + case 42 /* GreaterThanGreaterThanGreaterThanToken */: + case 24 /* LessThanToken */: + case 25 /* GreaterThanToken */: + case 26 /* LessThanEqualsToken */: + case 27 /* GreaterThanEqualsToken */: + case 87 /* InstanceOfKeyword */: + case 86 /* InKeyword */: + case 28 /* EqualsEqualsToken */: + case 29 /* ExclamationEqualsToken */: + case 30 /* EqualsEqualsEqualsToken */: + case 31 /* ExclamationEqualsEqualsToken */: + case 43 /* AmpersandToken */: + case 45 /* CaretToken */: + case 44 /* BarToken */: + case 48 /* AmpersandAmpersandToken */: + case 49 /* BarBarToken */: + case 63 /* BarEqualsToken */: + case 62 /* AmpersandEqualsToken */: + case 64 /* CaretEqualsToken */: + case 59 /* LessThanLessThanEqualsToken */: + case 60 /* GreaterThanGreaterThanEqualsToken */: + case 61 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 54 /* PlusEqualsToken */: + case 55 /* MinusEqualsToken */: + case 56 /* AsteriskEqualsToken */: + case 57 /* SlashEqualsToken */: + case 58 /* PercentEqualsToken */: + case 53 /* EqualsToken */: + case 23 /* CommaToken */: return true; default: return false; @@ -33680,19 +40028,19 @@ var ts; } function isPrefixUnaryExpressionOperatorToken(token) { switch (token) { - case 33: - case 34: - case 47: - case 46: - case 38: - case 39: + case 33 /* PlusToken */: + case 34 /* MinusToken */: + case 47 /* TildeToken */: + case 46 /* ExclamationToken */: + case 38 /* PlusPlusToken */: + case 39 /* MinusMinusToken */: return true; default: return false; } } function isKeyword(token) { - return token >= 66 && token <= 125; + return token >= 66 /* FirstKeyword */ && token <= 125 /* LastKeyword */; } function classFromKind(token) { if (isKeyword(token)) { @@ -33701,24 +40049,24 @@ var ts; else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) { return TokenClass.Operator; } - else if (token >= 14 && token <= 64) { + else if (token >= 14 /* FirstPunctuation */ && token <= 64 /* LastPunctuation */) { return TokenClass.Punctuation; } switch (token) { - case 7: + case 7 /* NumericLiteral */: return TokenClass.NumberLiteral; - case 8: + case 8 /* StringLiteral */: return TokenClass.StringLiteral; - case 9: + case 9 /* RegularExpressionLiteral */: return TokenClass.RegExpLiteral; - case 6: - case 3: - case 2: + case 6 /* ConflictMarkerTrivia */: + case 3 /* MultiLineCommentTrivia */: + case 2 /* SingleLineCommentTrivia */: return TokenClass.Comment; - case 5: - case 4: + case 5 /* WhitespaceTrivia */: + case 4 /* NewLineTrivia */: return TokenClass.Whitespace; - case 65: + case 65 /* Identifier */: default: if (ts.isTemplateLiteralKind(token)) { return TokenClass.StringLiteral; @@ -33729,7 +40077,13 @@ var ts; return { getClassificationsForLine: getClassificationsForLine }; } ts.createClassifier = createClassifier; + /** + * 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) { + // Check __dirname is defined and that we are on a node.js system. if (typeof __dirname !== "undefined") { return __dirname + ts.directorySeparator + ts.getDefaultLibFileName(options); } @@ -33741,7 +40095,7 @@ var ts; getNodeConstructor: function (kind) { function Node() { } - var proto = kind === 227 ? new SourceFileObject() : new NodeObject(); + var proto = kind === 227 /* SourceFile */ ? new SourceFileObject() : new NodeObject(); proto.kind = kind; proto.pos = 0; proto.end = 0; @@ -33760,25 +40114,38 @@ var ts; // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// +/* @internal */ var ts; (function (ts) { var BreakpointResolver; (function (BreakpointResolver) { + /** + * Get the breakpoint span in given sourceFile + */ function spanInSourceFileAtLocation(sourceFile, position) { - if (sourceFile.flags & 2048) { + // Cannot set breakpoint in dts file + if (sourceFile.flags & 2048 /* DeclarationFile */) { return undefined; } var tokenAtLocation = ts.getTokenAtPosition(sourceFile, position); var lineOfPosition = sourceFile.getLineAndCharacterOfPosition(position).line; if (sourceFile.getLineAndCharacterOfPosition(tokenAtLocation.getStart()).line > lineOfPosition) { + // Get previous token if the token is returned starts on new line + // eg: let x =10; |--- cursor is here + // let y = 10; + // token at position will return let keyword on second line as the token but we would like to use + // token on same line if trailing trivia (comments or white spaces on same line) part of the last token on that line tokenAtLocation = ts.findPrecedingToken(tokenAtLocation.pos, sourceFile); + // Its a blank line if (!tokenAtLocation || sourceFile.getLineAndCharacterOfPosition(tokenAtLocation.getEnd()).line !== lineOfPosition) { return undefined; } } + // Cannot set breakpoint in ambient declarations if (ts.isInAmbientContext(tokenAtLocation)) { return undefined; } + // Get the span in the node based on its syntax return spanInNode(tokenAtLocation); function textSpan(startNode, endNode) { return ts.createTextSpanFromBounds(startNode.getStart(), (endNode || startNode).getEnd()); @@ -33798,173 +40165,210 @@ var ts; function spanInNode(node) { if (node) { if (ts.isExpression(node)) { - if (node.parent.kind === 184) { + if (node.parent.kind === 184 /* DoStatement */) { + // Set span as if on while keyword return spanInPreviousNode(node); } - if (node.parent.kind === 186) { + if (node.parent.kind === 186 /* ForStatement */) { + // For now lets set the span on this expression, fix it later return textSpan(node); } - if (node.parent.kind === 169 && node.parent.operatorToken.kind === 23) { + if (node.parent.kind === 169 /* BinaryExpression */ && node.parent.operatorToken.kind === 23 /* CommaToken */) { + // if this is comma expression, the breakpoint is possible in this expression return textSpan(node); } - if (node.parent.kind == 163 && node.parent.body == node) { + if (node.parent.kind == 163 /* ArrowFunction */ && node.parent.body == node) { + // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); } } switch (node.kind) { - case 180: + case 180 /* VariableStatement */: + // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 198: - case 132: - case 131: + case 198 /* VariableDeclaration */: + case 132 /* PropertyDeclaration */: + case 131 /* PropertySignature */: return spanInVariableDeclaration(node); - case 129: + case 129 /* Parameter */: return spanInParameterDeclaration(node); - case 200: - case 134: - case 133: - case 136: - case 137: - case 135: - case 162: - case 163: + case 200 /* FunctionDeclaration */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 135 /* Constructor */: + case 162 /* FunctionExpression */: + case 163 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 179: + case 179 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } - case 206: + // Fall through + case 206 /* ModuleBlock */: return spanInBlock(node); - case 223: + case 223 /* CatchClause */: return spanInBlock(node.block); - case 182: + case 182 /* ExpressionStatement */: + // span on the expression return textSpan(node.expression); - case 191: + case 191 /* ReturnStatement */: + // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 185: + case 185 /* WhileStatement */: + // Span on while(...) return textSpan(node, ts.findNextToken(node.expression, node)); - case 184: + case 184 /* DoStatement */: + // span in statement of the do statement return spanInNode(node.statement); - case 197: + case 197 /* DebuggerStatement */: + // span on debugger keyword return textSpan(node.getChildAt(0)); - case 183: + case 183 /* IfStatement */: + // set on if(..) span return textSpan(node, ts.findNextToken(node.expression, node)); - case 194: + case 194 /* LabeledStatement */: + // span in statement return spanInNode(node.statement); - case 190: - case 189: + case 190 /* BreakStatement */: + case 189 /* ContinueStatement */: + // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 186: + case 186 /* ForStatement */: return spanInForStatement(node); - case 187: - case 188: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: + // span on for (a in ...) return textSpan(node, ts.findNextToken(node.expression, node)); - case 193: + case 193 /* SwitchStatement */: + // span on switch(...) return textSpan(node, ts.findNextToken(node.expression, node)); - case 220: - case 221: + case 220 /* CaseClause */: + case 221 /* DefaultClause */: + // span in first statement of the clause return spanInNode(node.statements[0]); - case 196: + case 196 /* TryStatement */: + // span in try block return spanInBlock(node.tryBlock); - case 195: + case 195 /* ThrowStatement */: + // span in throw ... return textSpan(node, node.expression); - case 214: - if (!node.expression) { - return undefined; - } + case 214 /* ExportAssignment */: + // span on export = id return textSpan(node, node.expression); - case 208: + case 208 /* ImportEqualsDeclaration */: + // import statement without including semicolon return textSpan(node, node.moduleReference); - case 209: + case 209 /* ImportDeclaration */: + // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 215: + case 215 /* ExportDeclaration */: + // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 205: - if (ts.getModuleInstanceState(node) !== 1) { + case 205 /* ModuleDeclaration */: + // span on complete module if it is instantiated + if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } - case 201: - case 204: - case 226: - case 157: - case 158: + case 201 /* ClassDeclaration */: + case 204 /* EnumDeclaration */: + case 226 /* EnumMember */: + case 157 /* CallExpression */: + case 158 /* NewExpression */: + // span on complete node return textSpan(node); - case 192: + case 192 /* WithStatement */: + // span in statement return spanInNode(node.statement); - case 202: - case 203: + // No breakpoint in interface, type alias + case 202 /* InterfaceDeclaration */: + case 203 /* TypeAliasDeclaration */: return undefined; - case 22: - case 1: + // Tokens: + case 22 /* SemicolonToken */: + case 1 /* EndOfFileToken */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile)); - case 23: + case 23 /* CommaToken */: return spanInPreviousNode(node); - case 14: + case 14 /* OpenBraceToken */: return spanInOpenBraceToken(node); - case 15: + case 15 /* CloseBraceToken */: return spanInCloseBraceToken(node); - case 16: + case 16 /* OpenParenToken */: return spanInOpenParenToken(node); - case 17: + case 17 /* CloseParenToken */: return spanInCloseParenToken(node); - case 51: + case 51 /* ColonToken */: return spanInColonToken(node); - case 25: - case 24: + case 25 /* GreaterThanToken */: + case 24 /* LessThanToken */: return spanInGreaterThanOrLessThanToken(node); - case 100: + // Keywords: + case 100 /* WhileKeyword */: return spanInWhileKeyword(node); - case 76: - case 68: - case 81: + case 76 /* ElseKeyword */: + case 68 /* CatchKeyword */: + case 81 /* FinallyKeyword */: return spanInNextNode(node); default: - if (node.parent.kind === 224 && node.parent.name === node) { + // If this is name of property assignment, set breakpoint in the initializer + if (node.parent.kind === 224 /* PropertyAssignment */ && node.parent.name === node) { return spanInNode(node.parent.initializer); } - if (node.parent.kind === 160 && node.parent.type === node) { + // Breakpoint in type assertion goes to its operand + if (node.parent.kind === 160 /* TypeAssertionExpression */ && node.parent.type === node) { return spanInNode(node.parent.expression); } + // return type of function go to previous token if (ts.isFunctionLike(node.parent) && node.parent.type === node) { return spanInPreviousNode(node); } + // Default go to parent to set the breakpoint return spanInNode(node.parent); } } function spanInVariableDeclaration(variableDeclaration) { - if (variableDeclaration.parent.parent.kind === 187 || - variableDeclaration.parent.parent.kind === 188) { + // If declaration of for in statement, just set the span in parent + if (variableDeclaration.parent.parent.kind === 187 /* ForInStatement */ || + variableDeclaration.parent.parent.kind === 188 /* ForOfStatement */) { return spanInNode(variableDeclaration.parent.parent); } - var isParentVariableStatement = variableDeclaration.parent.parent.kind === 180; - var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 186 && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); + var isParentVariableStatement = variableDeclaration.parent.parent.kind === 180 /* VariableStatement */; + var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 186 /* ForStatement */ && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); var declarations = isParentVariableStatement ? variableDeclaration.parent.parent.declarationList.declarations : isDeclarationOfForStatement ? variableDeclaration.parent.parent.initializer.declarations : undefined; - if (variableDeclaration.initializer || (variableDeclaration.flags & 1)) { + // Breakpoint is possible in variableDeclaration only if there is initialization + if (variableDeclaration.initializer || (variableDeclaration.flags & 1 /* Export */)) { if (declarations && declarations[0] === variableDeclaration) { if (isParentVariableStatement) { + // First declaration - include let keyword return textSpan(variableDeclaration.parent, variableDeclaration); } else { ts.Debug.assert(isDeclarationOfForStatement); + // Include let keyword from for statement declarations in the span return textSpan(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); } } else { + // Span only on this declaration return textSpan(variableDeclaration); } } else if (declarations && declarations[0] !== variableDeclaration) { + // If we cant set breakpoint on this declaration, set it on previous one var indexOfCurrentDeclaration = ts.indexOf(declarations, variableDeclaration); return spanInVariableDeclaration(declarations[indexOfCurrentDeclaration - 1]); } } function canHaveSpanInParameterDeclaration(parameter) { + // Breakpoint is possible on parameter only if it has initializer, is a rest parameter, or has public or private modifier return !!parameter.initializer || parameter.dotDotDotToken !== undefined || - !!(parameter.flags & 16) || !!(parameter.flags & 32); + !!(parameter.flags & 16 /* Public */) || !!(parameter.flags & 32 /* Private */); } function spanInParameterDeclaration(parameter) { if (canHaveSpanInParameterDeclaration(parameter)) { @@ -33974,24 +40378,29 @@ var ts; var functionDeclaration = parameter.parent; var indexOfParameter = ts.indexOf(functionDeclaration.parameters, parameter); if (indexOfParameter) { + // Not a first parameter, go to previous parameter return spanInParameterDeclaration(functionDeclaration.parameters[indexOfParameter - 1]); } else { + // Set breakpoint in the function declaration body return spanInNode(functionDeclaration.body); } } } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { - return !!(functionDeclaration.flags & 1) || - (functionDeclaration.parent.kind === 201 && functionDeclaration.kind !== 135); + return !!(functionDeclaration.flags & 1 /* Export */) || + (functionDeclaration.parent.kind === 201 /* ClassDeclaration */ && functionDeclaration.kind !== 135 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { + // No breakpoints in the function signature if (!functionDeclaration.body) { return undefined; } if (canFunctionHaveSpanInWholeDeclaration(functionDeclaration)) { + // Set the span on whole function declaration return textSpan(functionDeclaration); } + // Set span in function body return spanInNode(functionDeclaration.body); } function spanInFunctionBlock(block) { @@ -34003,23 +40412,26 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 205: - if (ts.getModuleInstanceState(block.parent) !== 1) { + case 205 /* ModuleDeclaration */: + if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } - case 185: - case 183: - case 187: - case 188: + // Set on parent if on same line otherwise on first statement + case 185 /* WhileStatement */: + case 183 /* IfStatement */: + case 187 /* ForInStatement */: + case 188 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); - case 186: + // Set span on previous token if it starts on same line otherwise on the first statement of the block + case 186 /* ForStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } + // Default action is to set on first statement return spanInNode(block.statements[0]); } function spanInForStatement(forStatement) { if (forStatement.initializer) { - if (forStatement.initializer.kind === 199) { + if (forStatement.initializer.kind === 199 /* VariableDeclarationList */) { var variableDeclarationList = forStatement.initializer; if (variableDeclarationList.declarations.length > 0) { return spanInNode(variableDeclarationList.declarations[0]); @@ -34036,87 +40448,103 @@ var ts; return textSpan(forStatement.iterator); } } + // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 204: + case 204 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 201: + case 201 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 207: + case 207 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } + // Default to parent node return spanInNode(node.parent); } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 206: - if (ts.getModuleInstanceState(node.parent.parent) !== 1) { + case 206 /* ModuleBlock */: + // If this is not instantiated module block no bp span + if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } - case 204: - case 201: + case 204 /* EnumDeclaration */: + case 201 /* ClassDeclaration */: + // Span on close brace token return textSpan(node); - case 179: + case 179 /* Block */: if (ts.isFunctionBlock(node.parent)) { + // Span on close brace token return textSpan(node); } - case 223: + // fall through. + case 223 /* CatchClause */: return spanInNode(node.parent.statements[node.parent.statements.length - 1]); ; - case 207: + case 207 /* CaseBlock */: + // breakpoint in last statement of the last clause var caseBlock = node.parent; var lastClause = caseBlock.clauses[caseBlock.clauses.length - 1]; if (lastClause) { return spanInNode(lastClause.statements[lastClause.statements.length - 1]); } return undefined; + // Default to parent node default: return spanInNode(node.parent); } } function spanInOpenParenToken(node) { - if (node.parent.kind === 184) { + if (node.parent.kind === 184 /* DoStatement */) { + // Go to while keyword and do action instead return spanInPreviousNode(node); } + // Default to parent node return spanInNode(node.parent); } function spanInCloseParenToken(node) { + // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 162: - case 200: - case 163: - case 134: - case 133: - case 136: - case 137: - case 135: - case 185: - case 184: - case 186: + case 162 /* FunctionExpression */: + case 200 /* FunctionDeclaration */: + case 163 /* ArrowFunction */: + case 134 /* MethodDeclaration */: + case 133 /* MethodSignature */: + case 136 /* GetAccessor */: + case 137 /* SetAccessor */: + case 135 /* Constructor */: + case 185 /* WhileStatement */: + case 184 /* DoStatement */: + case 186 /* ForStatement */: return spanInPreviousNode(node); + // Default to parent node default: return spanInNode(node.parent); } + // Default to parent node return spanInNode(node.parent); } function spanInColonToken(node) { - if (ts.isFunctionLike(node.parent) || node.parent.kind === 224) { + // Is this : specifying return annotation of the function declaration + if (ts.isFunctionLike(node.parent) || node.parent.kind === 224 /* PropertyAssignment */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 160) { + if (node.parent.kind === 160 /* TypeAssertionExpression */) { return spanInNode(node.parent.expression); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 184) { + if (node.parent.kind === 184 /* DoStatement */) { + // Set span on while expression return textSpan(node, ts.findNextToken(node.parent.expression, node.parent)); } + // Default to parent node return spanInNode(node.parent); } } @@ -34139,7 +40567,9 @@ var ts; // limitations under the License. // /// +/* @internal */ var debugObjectHost = this; +/* @internal */ var ts; (function (ts) { function logInternalError(logger, err) { @@ -34193,6 +40623,8 @@ var ts; return this.files = JSON.parse(encoded); }; LanguageServiceShimHostAdapter.prototype.getScriptSnapshot = function (fileName) { + // Shim the API changes for 1.5 release. This should be removed once + // TypeScript 1.5 has shipped. if (this.files && this.files.indexOf(fileName) < 0) { return undefined; } @@ -34222,6 +40654,8 @@ var ts; return this.shimHost.getCurrentDirectory(); }; LanguageServiceShimHostAdapter.prototype.getDefaultLibFileName = function (options) { + // Wrap the API changes for 1.5 release. This try/catch + // should be removed once TypeScript 1.5 has shipped. try { return this.shimHost.getDefaultLibFileName(JSON.stringify(options)); } @@ -34271,6 +40705,20 @@ var ts; }; return ShimBase; })(); + function realizeDiagnostics(diagnostics, newLine) { + return diagnostics.map(function (d) { return realizeDiagnostic(d, newLine); }); + } + ts.realizeDiagnostics = realizeDiagnostics; + function realizeDiagnostic(diagnostic, newLine) { + return { + message: ts.flattenDiagnosticMessageText(diagnostic.messageText, newLine), + start: diagnostic.start, + length: diagnostic.length, + /// TODO: no need for the tolowerCase call + category: ts.DiagnosticCategory[diagnostic.category].toLowerCase(), + code: diagnostic.code + }; + } var LanguageServiceShimObject = (function (_super) { __extends(LanguageServiceShimObject, _super); function LanguageServiceShimObject(factory, host, languageService) { @@ -34282,10 +40730,16 @@ var ts; LanguageServiceShimObject.prototype.forwardJSONCall = function (actionDescription, action) { return forwardJSONCall(this.logger, actionDescription, action); }; + /// DISPOSE + /** + * Ensure (almost) deterministic release of internal Javascript resources when + * some external native objects holds onto us (e.g. Com/Interop). + */ LanguageServiceShimObject.prototype.dispose = function (dummy) { this.logger.log("dispose()"); this.languageService.dispose(); this.languageService = null; + // force a GC if (debugObjectHost && debugObjectHost.CollectGarbage) { debugObjectHost.CollectGarbage(); this.logger.log("CollectGarbage()"); @@ -34293,6 +40747,10 @@ var ts; this.logger = null; _super.prototype.dispose.call(this, dummy); }; + /// REFRESH + /** + * Update the list of scripts known to the compiler + */ LanguageServiceShimObject.prototype.refresh = function (throwOnError) { this.forwardJSONCall("refresh(" + throwOnError + ")", function () { return null; @@ -34306,18 +40764,8 @@ var ts; }); }; LanguageServiceShimObject.prototype.realizeDiagnostics = function (diagnostics) { - var _this = this; var newLine = this.getNewLine(); - return diagnostics.map(function (d) { return _this.realizeDiagnostic(d, newLine); }); - }; - LanguageServiceShimObject.prototype.realizeDiagnostic = function (diagnostic, newLine) { - return { - message: ts.flattenDiagnosticMessageText(diagnostic.messageText, newLine), - start: diagnostic.start, - length: diagnostic.length, - category: ts.DiagnosticCategory[diagnostic.category].toLowerCase(), - code: diagnostic.code - }; + return ts.realizeDiagnostics(diagnostics, newLine); }; LanguageServiceShimObject.prototype.getSyntacticClassifications = function (fileName, start, length) { var _this = this; @@ -34357,6 +40805,11 @@ var ts; return _this.realizeDiagnostics(diagnostics); }); }; + /// QUICKINFO + /** + * Computes a string representation of the type at the requested position + * in the active file. + */ LanguageServiceShimObject.prototype.getQuickInfoAtPosition = function (fileName, position) { var _this = this; return this.forwardJSONCall("getQuickInfoAtPosition('" + fileName + "', " + position + ")", function () { @@ -34364,6 +40817,11 @@ var ts; return quickInfo; }); }; + /// NAMEORDOTTEDNAMESPAN + /** + * Computes span information of the name or dotted name at the requested position + * in the active file. + */ LanguageServiceShimObject.prototype.getNameOrDottedNameSpan = function (fileName, startPos, endPos) { var _this = this; return this.forwardJSONCall("getNameOrDottedNameSpan('" + fileName + "', " + startPos + ", " + endPos + ")", function () { @@ -34371,6 +40829,10 @@ var ts; return spanInfo; }); }; + /** + * STATEMENTSPAN + * Computes span information of statement at the requested position in the active file. + */ LanguageServiceShimObject.prototype.getBreakpointStatementAtPosition = function (fileName, position) { var _this = this; return this.forwardJSONCall("getBreakpointStatementAtPosition('" + fileName + "', " + position + ")", function () { @@ -34378,6 +40840,7 @@ var ts; return spanInfo; }); }; + /// SIGNATUREHELP LanguageServiceShimObject.prototype.getSignatureHelpItems = function (fileName, position) { var _this = this; return this.forwardJSONCall("getSignatureHelpItems('" + fileName + "', " + position + ")", function () { @@ -34385,6 +40848,11 @@ var ts; return signatureInfo; }); }; + /// GOTO DEFINITION + /** + * Computes the definition location and file for the symbol + * at the requested position. + */ LanguageServiceShimObject.prototype.getDefinitionAtPosition = function (fileName, position) { var _this = this; return this.forwardJSONCall("getDefinitionAtPosition('" + fileName + "', " + position + ")", function () { @@ -34403,6 +40871,7 @@ var ts; return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments); }); }; + /// GET BRACE MATCHING LanguageServiceShimObject.prototype.getBraceMatchingAtPosition = function (fileName, position) { var _this = this; return this.forwardJSONCall("getBraceMatchingAtPosition('" + fileName + "', " + position + ")", function () { @@ -34410,13 +40879,15 @@ var ts; return textRanges; }); }; - LanguageServiceShimObject.prototype.getIndentationAtPosition = function (fileName, position, options) { + /// GET SMART INDENT + LanguageServiceShimObject.prototype.getIndentationAtPosition = function (fileName, position, options /*Services.EditorOptions*/) { var _this = this; return this.forwardJSONCall("getIndentationAtPosition('" + fileName + "', " + position + ")", function () { var localOptions = JSON.parse(options); return _this.languageService.getIndentationAtPosition(fileName, position, localOptions); }); }; + /// GET REFERENCES LanguageServiceShimObject.prototype.getReferencesAtPosition = function (fileName, position) { var _this = this; return this.forwardJSONCall("getReferencesAtPosition('" + fileName + "', " + position + ")", function () { @@ -34435,6 +40906,18 @@ var ts; return _this.languageService.getOccurrencesAtPosition(fileName, position); }); }; + LanguageServiceShimObject.prototype.getDocumentHighlights = function (fileName, position, filesToSearch) { + var _this = this; + return this.forwardJSONCall("getDocumentHighlights('" + fileName + "', " + position + ")", function () { + return _this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch)); + }); + }; + /// COMPLETION LISTS + /** + * Get a string based representation of the completions + * to provide at the given source position and providing a member completion + * list if requested. + */ LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position) { var _this = this; return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ")", function () { @@ -34442,6 +40925,7 @@ var ts; return completion; }); }; + /** Get a string based representation of a completion list entry details */ LanguageServiceShimObject.prototype.getCompletionEntryDetails = function (fileName, position, entryName) { var _this = this; return this.forwardJSONCall("getCompletionEntryDetails('" + fileName + "', " + position + ", " + entryName + ")", function () { @@ -34449,7 +40933,7 @@ var ts; return details; }); }; - LanguageServiceShimObject.prototype.getFormattingEditsForRange = function (fileName, start, end, options) { + LanguageServiceShimObject.prototype.getFormattingEditsForRange = function (fileName, start, end, options /*Services.FormatCodeOptions*/) { var _this = this; return this.forwardJSONCall("getFormattingEditsForRange('" + fileName + "', " + start + ", " + end + ")", function () { var localOptions = JSON.parse(options); @@ -34457,7 +40941,7 @@ var ts; return edits; }); }; - LanguageServiceShimObject.prototype.getFormattingEditsForDocument = function (fileName, options) { + LanguageServiceShimObject.prototype.getFormattingEditsForDocument = function (fileName, options /*Services.FormatCodeOptions*/) { var _this = this; return this.forwardJSONCall("getFormattingEditsForDocument('" + fileName + "')", function () { var localOptions = JSON.parse(options); @@ -34465,7 +40949,7 @@ var ts; return edits; }); }; - LanguageServiceShimObject.prototype.getFormattingEditsAfterKeystroke = function (fileName, position, key, options) { + LanguageServiceShimObject.prototype.getFormattingEditsAfterKeystroke = function (fileName, position, key, options /*Services.FormatCodeOptions*/) { var _this = this; return this.forwardJSONCall("getFormattingEditsAfterKeystroke('" + fileName + "', " + position + ", '" + key + "')", function () { var localOptions = JSON.parse(options); @@ -34473,6 +40957,8 @@ var ts; return edits; }); }; + /// NAVIGATE TO + /** Return a list of symbols that are interesting to navigate to */ LanguageServiceShimObject.prototype.getNavigateToItems = function (searchValue, maxResultCount) { var _this = this; return this.forwardJSONCall("getNavigateToItems('" + searchValue + "', " + maxResultCount + ")", function () { @@ -34501,10 +40987,13 @@ var ts; return items; }); }; + /// Emit LanguageServiceShimObject.prototype.getEmitOutput = function (fileName) { var _this = this; return this.forwardJSONCall("getEmitOutput('" + fileName + "')", function () { var output = _this.languageService.getEmitOutput(fileName); + // Shim the API changes for 1.5 release. This should be removed once + // TypeScript 1.5 has shipped. output.emitOutputStatus = output.emitSkipped ? 1 : 0; return output; }); @@ -34517,6 +41006,7 @@ var ts; _super.call(this, factory); this.classifier = ts.createClassifier(); } + /// COLORIZATION ClassifierShimObject.prototype.getClassificationsForLine = function (text, lexState, classifyKeywordsInGenerics) { var classification = this.classifier.getClassificationsForLine(text, lexState, classifyKeywordsInGenerics); var items = classification.entries; @@ -34576,6 +41066,9 @@ var ts; this._shims = []; this.documentRegistry = ts.createDocumentRegistry(); } + /* + * Returns script API version. + */ TypeScriptServicesFactory.prototype.getServicesVersion = function () { return ts.servicesVersion; }; @@ -34609,6 +41102,7 @@ var ts; } }; TypeScriptServicesFactory.prototype.close = function () { + // Forget all the registered shims this._shims = []; this.documentRegistry = ts.createDocumentRegistry(); }; @@ -34631,6 +41125,8 @@ var ts; module.exports = ts; } })(ts || (ts = {})); +/// TODO: this is used by VS, clean this up on both sides of the interface +/* @internal */ var TypeScript; (function (TypeScript) { var Services; @@ -34638,4 +41134,5 @@ var TypeScript; Services.TypeScriptServicesFactory = ts.TypeScriptServicesFactory; })(Services = TypeScript.Services || (TypeScript.Services = {})); })(TypeScript || (TypeScript = {})); +/* @internal */ var toolsVersion = "1.4"; diff --git a/bin/typescriptServices_internal.d.ts b/bin/typescriptServices_internal.d.ts deleted file mode 100644 index f0f86ebfe02..00000000000 --- a/bin/typescriptServices_internal.d.ts +++ /dev/null @@ -1,399 +0,0 @@ -/*! ***************************************************************************** -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 ts { - const enum Ternary { - False = 0, - Maybe = 1, - True = -1, - } - const enum Comparison { - LessThan = -1, - EqualTo = 0, - GreaterThan = 1, - } - interface StringSet extends Map { - } - function forEach(array: T[], callback: (element: T, index: number) => U): U; - function contains(array: T[], value: T): boolean; - function indexOf(array: T[], value: T): number; - function countWhere(array: T[], predicate: (x: T) => boolean): number; - function filter(array: T[], f: (x: T) => boolean): T[]; - function map(array: T[], f: (x: T) => U): U[]; - function concatenate(array1: T[], array2: T[]): T[]; - function deduplicate(array: T[]): T[]; - function sum(array: any[], prop: string): number; - function addRange(to: T[], from: T[]): void; - /** - * Returns the last element of an array if non-empty, undefined otherwise. - */ - 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; - function clone(object: T): T; - function extend(first: Map, second: Map): Map; - 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 copyMap(source: Map, target: Map): void; - /** - * Creates a map from the elements of an array. - * - * @param array the array of input elements. - * @param makeKey a function that produces a key for a given element. - * - * This function makes no effort to avoid collisions; if any two elements produce - * the same key with the given 'makeKey' function, then the element with the higher - * index in the array will be the one associated with the produced key. - */ - function arrayToMap(array: T[], makeKey: (value: T) => string): Map; - let localizedDiagnosticMessages: Map; - function getLocaleSpecificMessage(message: string): string; - function createFileDiagnostic(file: SourceFile, start: number, length: number, message: DiagnosticMessage, ...args: any[]): Diagnostic; - function createCompilerDiagnostic(message: DiagnosticMessage, ...args: any[]): Diagnostic; - function chainDiagnosticMessages(details: DiagnosticMessageChain, message: DiagnosticMessage, ...args: any[]): DiagnosticMessageChain; - function concatenateDiagnosticMessageChains(headChain: DiagnosticMessageChain, tailChain: DiagnosticMessageChain): DiagnosticMessageChain; - function compareValues(a: T, b: T): Comparison; - function compareDiagnostics(d1: Diagnostic, d2: Diagnostic): Comparison; - function sortAndDeduplicateDiagnostics(diagnostics: Diagnostic[]): Diagnostic[]; - function deduplicateSortedDiagnostics(diagnostics: Diagnostic[]): Diagnostic[]; - function normalizeSlashes(path: string): string; - function getRootLength(path: string): number; - let directorySeparator: string; - function normalizePath(path: string): string; - function getDirectoryPath(path: string): string; - function isUrl(path: string): boolean; - function isRootedDiskPath(path: string): boolean; - function getNormalizedPathComponents(path: string, currentDirectory: string): string[]; - function getNormalizedAbsolutePath(fileName: string, currentDirectory: string): string; - function getNormalizedPathFromPathComponents(pathComponents: string[]): string; - function getRelativePathToDirectoryOrUrl(directoryPathOrUrl: string, relativeOrAbsolutePath: string, currentDirectory: string, getCanonicalFileName: (fileName: string) => string, isAbsolutePathAnUrl: boolean): string; - function getBaseFileName(path: string): string; - function combinePaths(path1: string, path2: string): string; - function fileExtensionIs(path: string, extension: string): boolean; - function removeFileExtension(path: string): string; - function getDefaultLibFileName(options: CompilerOptions): string; - interface ObjectAllocator { - getNodeConstructor(kind: SyntaxKind): new () => Node; - getSymbolConstructor(): new (flags: SymbolFlags, name: string) => Symbol; - getTypeConstructor(): new (checker: TypeChecker, flags: TypeFlags) => Type; - getSignatureConstructor(): new (checker: TypeChecker) => Signature; - } - let objectAllocator: ObjectAllocator; - const enum AssertionLevel { - None = 0, - Normal = 1, - Aggressive = 2, - VeryAggressive = 3, - } - module Debug { - function shouldAssert(level: AssertionLevel): boolean; - function assert(expression: boolean, message?: string, verboseDebugInfo?: () => string): void; - function fail(message?: string): void; - } -} -declare module ts { - interface System { - args: string[]; - newLine: string; - useCaseSensitiveFileNames: boolean; - write(s: string): void; - readFile(fileName: string, encoding?: string): string; - writeFile(fileName: string, data: string, writeByteOrderMark?: boolean): void; - watchFile?(fileName: string, callback: (fileName: string) => void): FileWatcher; - resolvePath(path: string): string; - fileExists(path: string): boolean; - directoryExists(path: string): boolean; - createDirectory(directoryName: string): void; - getExecutingFilePath(): string; - getCurrentDirectory(): string; - readDirectory(path: string, extension?: string): string[]; - getMemoryUsage?(): number; - exit(exitCode?: number): void; - } - interface FileWatcher { - close(): void; - } - var sys: System; -} -declare module ts { - interface ReferencePathMatchResult { - fileReference?: FileReference; - diagnosticMessage?: DiagnosticMessage; - isNoDefaultLib?: boolean; - } - interface SynthesizedNode extends Node { - leadingCommentRanges?: CommentRange[]; - trailingCommentRanges?: CommentRange[]; - startsOnNewLine: boolean; - } - function getDeclarationOfKind(symbol: Symbol, kind: SyntaxKind): Declaration; - interface StringSymbolWriter extends SymbolWriter { - string(): string; - } - interface EmitHost extends ScriptReferenceHost { - getSourceFiles(): SourceFile[]; - getCommonSourceDirectory(): string; - getCanonicalFileName(fileName: string): string; - getNewLine(): string; - writeFile: WriteFileCallback; - } - function getSingleLineStringWriter(): StringSymbolWriter; - function releaseStringWriter(writer: StringSymbolWriter): void; - function getFullWidth(node: Node): number; - function containsParseError(node: Node): boolean; - function getSourceFileOfNode(node: Node): SourceFile; - function getStartPositionOfLine(line: number, sourceFile: SourceFile): number; - function nodePosToString(node: Node): string; - function getStartPosOfNode(node: Node): number; - function nodeIsMissing(node: Node): boolean; - function nodeIsPresent(node: Node): boolean; - function getTokenPosOfNode(node: Node, sourceFile?: SourceFile): number; - function getSourceTextOfNodeFromSourceFile(sourceFile: SourceFile, node: Node): string; - function getTextOfNodeFromSourceText(sourceText: string, node: Node): string; - function getTextOfNode(node: Node): string; - function escapeIdentifier(identifier: string): string; - function unescapeIdentifier(identifier: string): string; - function makeIdentifierFromModuleName(moduleName: string): string; - function isBlockOrCatchScoped(declaration: Declaration): boolean; - function getEnclosingBlockScopeContainer(node: Node): Node; - function isCatchClauseVariableDeclaration(declaration: Declaration): boolean; - function declarationNameToString(name: DeclarationName): string; - function createDiagnosticForNode(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): Diagnostic; - function createDiagnosticForNodeFromMessageChain(node: Node, messageChain: DiagnosticMessageChain): Diagnostic; - function getErrorSpanForNode(sourceFile: SourceFile, node: Node): TextSpan; - function isExternalModule(file: SourceFile): boolean; - function isDeclarationFile(file: SourceFile): boolean; - function isConstEnumDeclaration(node: Node): boolean; - function getCombinedNodeFlags(node: Node): NodeFlags; - function isConst(node: Node): boolean; - function isLet(node: Node): boolean; - function isPrologueDirective(node: Node): boolean; - 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; - function isFunctionLike(node: Node): boolean; - function isFunctionBlock(node: Node): boolean; - function isObjectLiteralMethod(node: Node): boolean; - function getContainingFunction(node: Node): FunctionLikeDeclaration; - 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; - function getExternalModuleImportEqualsDeclarationExpression(node: Node): Expression; - function isInternalModuleImportEqualsDeclaration(node: Node): boolean; - function getExternalModuleName(node: Node): Expression; - function hasDotDotDotToken(node: Node): boolean; - function hasQuestionToken(node: Node): boolean; - function hasRestParameters(s: SignatureDeclaration): boolean; - function isLiteralKind(kind: SyntaxKind): boolean; - function isTextualLiteralKind(kind: SyntaxKind): boolean; - function isTemplateLiteralKind(kind: SyntaxKind): boolean; - function isBindingPattern(node: Node): boolean; - 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 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; - function getFileReferenceFromReferencePath(comment: string, commentRange: CommentRange): ReferencePathMatchResult; - function isKeyword(token: SyntaxKind): boolean; - function isTrivia(token: SyntaxKind): boolean; - /** - * A declaration has a dynamic name if both of the following are true: - * 1. The declaration has a computed property name - * 2. The computed name is *not* expressed as Symbol., where name - * is a property of the Symbol constructor that denotes a built in - * Symbol. - */ - function hasDynamicName(declaration: Declaration): boolean; - /** - * Checks if the expression is of the form: - * Symbol.name - * where Symbol is literally the word "Symbol", and name is any identifierName - */ - function isWellKnownSymbolSyntactically(node: Expression): boolean; - function getPropertyNameForPropertyNameNode(name: DeclarationName): string; - function getPropertyNameForKnownSymbolName(symbolName: string): string; - /** - * Includes the word "Symbol" with unicode escapes - */ - function isESSymbolIdentifier(node: Node): boolean; - function isModifier(token: SyntaxKind): boolean; - function textSpanEnd(span: TextSpan): number; - function textSpanIsEmpty(span: TextSpan): boolean; - function textSpanContainsPosition(span: TextSpan, position: number): boolean; - function textSpanContainsTextSpan(span: TextSpan, other: TextSpan): boolean; - function textSpanOverlapsWith(span: TextSpan, other: TextSpan): boolean; - function textSpanOverlap(span1: TextSpan, span2: TextSpan): TextSpan; - function textSpanIntersectsWithTextSpan(span: TextSpan, other: TextSpan): boolean; - function textSpanIntersectsWith(span: TextSpan, start: number, length: number): boolean; - function textSpanIntersectsWithPosition(span: TextSpan, position: number): boolean; - function textSpanIntersection(span1: TextSpan, span2: TextSpan): TextSpan; - function createTextSpan(start: number, length: number): TextSpan; - function createTextSpanFromBounds(start: number, end: number): TextSpan; - function textChangeRangeNewSpan(range: TextChangeRange): TextSpan; - function textChangeRangeIsUnchanged(range: TextChangeRange): boolean; - function createTextChangeRange(span: TextSpan, newLength: number): TextChangeRange; - let unchangedTextChangeRange: TextChangeRange; - /** - * Called to merge all the changes that occurred across several versions of a script snapshot - * into a single change. i.e. if a user keeps making successive edits to a script we will - * have a text change from V1 to V2, V2 to V3, ..., Vn. - * - * This function will then merge those changes into a single change range valid between V1 and - * Vn. - */ - function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange; - function nodeStartsNewLexicalEnvironment(n: Node): boolean; - function nodeIsSynthesized(node: Node): boolean; - function createSynthesizedNode(kind: SyntaxKind, startsOnNewLine?: boolean): Node; - /** - * 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) - * Note that this doesn't actually wrap the input in double quotes. - */ - 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 { - /** - * 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 { - interface ListItemInfo { - listItemIndex: number; - list: Node; - } - function getEndLinePosition(line: number, sourceFile: SourceFile): number; - function getLineStartPositionForPosition(position: number, sourceFile: SourceFile): number; - function rangeContainsRange(r1: TextRange, r2: TextRange): boolean; - function startEndContainsRange(start: number, end: number, range: TextRange): boolean; - 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; - function getTouchingPropertyName(sourceFile: SourceFile, position: number): Node; - /** Returns the token if position is in [start, end) or if position === end and includeItemAtEndPosition(token) === true */ - function getTouchingToken(sourceFile: SourceFile, position: number, includeItemAtEndPosition?: (n: Node) => boolean): Node; - /** Returns a token if position is in [start-of-leading-trivia, end) */ - function getTokenAtPosition(sourceFile: SourceFile, position: number): Node; - /** - * The token on the left of the position is the token that strictly includes the position - * or sits to the left of the cursor if it is on a boundary. For example - * - * fo|o -> will return foo - * foo |bar -> will return foo - * - */ - function findTokenOnLeftOfPosition(file: SourceFile, position: number): Node; - function findNextToken(previousToken: Node, parent: Node): Node; - function findPrecedingToken(position: number, sourceFile: SourceFile, startNode?: Node): Node; - 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 { - function isFirstDeclarationOfSymbolParameter(symbol: Symbol): boolean; - function symbolPart(text: string, symbol: Symbol): SymbolDisplayPart; - function displayPart(text: string, kind: SymbolDisplayPartKind, symbol?: Symbol): SymbolDisplayPart; - function spacePart(): SymbolDisplayPart; - 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[]; - function typeToDisplayParts(typechecker: TypeChecker, type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): SymbolDisplayPart[]; - function symbolToDisplayParts(typeChecker: TypeChecker, symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): SymbolDisplayPart[]; - function signatureToDisplayParts(typechecker: TypeChecker, signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags): SymbolDisplayPart[]; -} diff --git a/bin/typescript_internal.d.ts b/bin/typescript_internal.d.ts deleted file mode 100644 index 6fc997c62d5..00000000000 --- a/bin/typescript_internal.d.ts +++ /dev/null @@ -1,399 +0,0 @@ -/*! ***************************************************************************** -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" { - const enum Ternary { - False = 0, - Maybe = 1, - True = -1, - } - const enum Comparison { - LessThan = -1, - EqualTo = 0, - GreaterThan = 1, - } - interface StringSet extends Map { - } - function forEach(array: T[], callback: (element: T, index: number) => U): U; - function contains(array: T[], value: T): boolean; - function indexOf(array: T[], value: T): number; - function countWhere(array: T[], predicate: (x: T) => boolean): number; - function filter(array: T[], f: (x: T) => boolean): T[]; - function map(array: T[], f: (x: T) => U): U[]; - function concatenate(array1: T[], array2: T[]): T[]; - function deduplicate(array: T[]): T[]; - function sum(array: any[], prop: string): number; - function addRange(to: T[], from: T[]): void; - /** - * Returns the last element of an array if non-empty, undefined otherwise. - */ - 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; - function clone(object: T): T; - function extend(first: Map, second: Map): Map; - 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 copyMap(source: Map, target: Map): void; - /** - * Creates a map from the elements of an array. - * - * @param array the array of input elements. - * @param makeKey a function that produces a key for a given element. - * - * This function makes no effort to avoid collisions; if any two elements produce - * the same key with the given 'makeKey' function, then the element with the higher - * index in the array will be the one associated with the produced key. - */ - function arrayToMap(array: T[], makeKey: (value: T) => string): Map; - let localizedDiagnosticMessages: Map; - function getLocaleSpecificMessage(message: string): string; - function createFileDiagnostic(file: SourceFile, start: number, length: number, message: DiagnosticMessage, ...args: any[]): Diagnostic; - function createCompilerDiagnostic(message: DiagnosticMessage, ...args: any[]): Diagnostic; - function chainDiagnosticMessages(details: DiagnosticMessageChain, message: DiagnosticMessage, ...args: any[]): DiagnosticMessageChain; - function concatenateDiagnosticMessageChains(headChain: DiagnosticMessageChain, tailChain: DiagnosticMessageChain): DiagnosticMessageChain; - function compareValues(a: T, b: T): Comparison; - function compareDiagnostics(d1: Diagnostic, d2: Diagnostic): Comparison; - function sortAndDeduplicateDiagnostics(diagnostics: Diagnostic[]): Diagnostic[]; - function deduplicateSortedDiagnostics(diagnostics: Diagnostic[]): Diagnostic[]; - function normalizeSlashes(path: string): string; - function getRootLength(path: string): number; - let directorySeparator: string; - function normalizePath(path: string): string; - function getDirectoryPath(path: string): string; - function isUrl(path: string): boolean; - function isRootedDiskPath(path: string): boolean; - function getNormalizedPathComponents(path: string, currentDirectory: string): string[]; - function getNormalizedAbsolutePath(fileName: string, currentDirectory: string): string; - function getNormalizedPathFromPathComponents(pathComponents: string[]): string; - function getRelativePathToDirectoryOrUrl(directoryPathOrUrl: string, relativeOrAbsolutePath: string, currentDirectory: string, getCanonicalFileName: (fileName: string) => string, isAbsolutePathAnUrl: boolean): string; - function getBaseFileName(path: string): string; - function combinePaths(path1: string, path2: string): string; - function fileExtensionIs(path: string, extension: string): boolean; - function removeFileExtension(path: string): string; - function getDefaultLibFileName(options: CompilerOptions): string; - interface ObjectAllocator { - getNodeConstructor(kind: SyntaxKind): new () => Node; - getSymbolConstructor(): new (flags: SymbolFlags, name: string) => Symbol; - getTypeConstructor(): new (checker: TypeChecker, flags: TypeFlags) => Type; - getSignatureConstructor(): new (checker: TypeChecker) => Signature; - } - let objectAllocator: ObjectAllocator; - const enum AssertionLevel { - None = 0, - Normal = 1, - Aggressive = 2, - VeryAggressive = 3, - } - module Debug { - function shouldAssert(level: AssertionLevel): boolean; - function assert(expression: boolean, message?: string, verboseDebugInfo?: () => string): void; - function fail(message?: string): void; - } -} -declare module "typescript" { - interface System { - args: string[]; - newLine: string; - useCaseSensitiveFileNames: boolean; - write(s: string): void; - readFile(fileName: string, encoding?: string): string; - writeFile(fileName: string, data: string, writeByteOrderMark?: boolean): void; - watchFile?(fileName: string, callback: (fileName: string) => void): FileWatcher; - resolvePath(path: string): string; - fileExists(path: string): boolean; - directoryExists(path: string): boolean; - createDirectory(directoryName: string): void; - getExecutingFilePath(): string; - getCurrentDirectory(): string; - readDirectory(path: string, extension?: string): string[]; - getMemoryUsage?(): number; - exit(exitCode?: number): void; - } - interface FileWatcher { - close(): void; - } - var sys: System; -} -declare module "typescript" { - interface ReferencePathMatchResult { - fileReference?: FileReference; - diagnosticMessage?: DiagnosticMessage; - isNoDefaultLib?: boolean; - } - interface SynthesizedNode extends Node { - leadingCommentRanges?: CommentRange[]; - trailingCommentRanges?: CommentRange[]; - startsOnNewLine: boolean; - } - function getDeclarationOfKind(symbol: Symbol, kind: SyntaxKind): Declaration; - interface StringSymbolWriter extends SymbolWriter { - string(): string; - } - interface EmitHost extends ScriptReferenceHost { - getSourceFiles(): SourceFile[]; - getCommonSourceDirectory(): string; - getCanonicalFileName(fileName: string): string; - getNewLine(): string; - writeFile: WriteFileCallback; - } - function getSingleLineStringWriter(): StringSymbolWriter; - function releaseStringWriter(writer: StringSymbolWriter): void; - function getFullWidth(node: Node): number; - function containsParseError(node: Node): boolean; - function getSourceFileOfNode(node: Node): SourceFile; - function getStartPositionOfLine(line: number, sourceFile: SourceFile): number; - function nodePosToString(node: Node): string; - function getStartPosOfNode(node: Node): number; - function nodeIsMissing(node: Node): boolean; - function nodeIsPresent(node: Node): boolean; - function getTokenPosOfNode(node: Node, sourceFile?: SourceFile): number; - function getSourceTextOfNodeFromSourceFile(sourceFile: SourceFile, node: Node): string; - function getTextOfNodeFromSourceText(sourceText: string, node: Node): string; - function getTextOfNode(node: Node): string; - function escapeIdentifier(identifier: string): string; - function unescapeIdentifier(identifier: string): string; - function makeIdentifierFromModuleName(moduleName: string): string; - function isBlockOrCatchScoped(declaration: Declaration): boolean; - function getEnclosingBlockScopeContainer(node: Node): Node; - function isCatchClauseVariableDeclaration(declaration: Declaration): boolean; - function declarationNameToString(name: DeclarationName): string; - function createDiagnosticForNode(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): Diagnostic; - function createDiagnosticForNodeFromMessageChain(node: Node, messageChain: DiagnosticMessageChain): Diagnostic; - function getErrorSpanForNode(sourceFile: SourceFile, node: Node): TextSpan; - function isExternalModule(file: SourceFile): boolean; - function isDeclarationFile(file: SourceFile): boolean; - function isConstEnumDeclaration(node: Node): boolean; - function getCombinedNodeFlags(node: Node): NodeFlags; - function isConst(node: Node): boolean; - function isLet(node: Node): boolean; - function isPrologueDirective(node: Node): boolean; - 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; - function isFunctionLike(node: Node): boolean; - function isFunctionBlock(node: Node): boolean; - function isObjectLiteralMethod(node: Node): boolean; - function getContainingFunction(node: Node): FunctionLikeDeclaration; - 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; - function getExternalModuleImportEqualsDeclarationExpression(node: Node): Expression; - function isInternalModuleImportEqualsDeclaration(node: Node): boolean; - function getExternalModuleName(node: Node): Expression; - function hasDotDotDotToken(node: Node): boolean; - function hasQuestionToken(node: Node): boolean; - function hasRestParameters(s: SignatureDeclaration): boolean; - function isLiteralKind(kind: SyntaxKind): boolean; - function isTextualLiteralKind(kind: SyntaxKind): boolean; - function isTemplateLiteralKind(kind: SyntaxKind): boolean; - function isBindingPattern(node: Node): boolean; - 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 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; - function getFileReferenceFromReferencePath(comment: string, commentRange: CommentRange): ReferencePathMatchResult; - function isKeyword(token: SyntaxKind): boolean; - function isTrivia(token: SyntaxKind): boolean; - /** - * A declaration has a dynamic name if both of the following are true: - * 1. The declaration has a computed property name - * 2. The computed name is *not* expressed as Symbol., where name - * is a property of the Symbol constructor that denotes a built in - * Symbol. - */ - function hasDynamicName(declaration: Declaration): boolean; - /** - * Checks if the expression is of the form: - * Symbol.name - * where Symbol is literally the word "Symbol", and name is any identifierName - */ - function isWellKnownSymbolSyntactically(node: Expression): boolean; - function getPropertyNameForPropertyNameNode(name: DeclarationName): string; - function getPropertyNameForKnownSymbolName(symbolName: string): string; - /** - * Includes the word "Symbol" with unicode escapes - */ - function isESSymbolIdentifier(node: Node): boolean; - function isModifier(token: SyntaxKind): boolean; - function textSpanEnd(span: TextSpan): number; - function textSpanIsEmpty(span: TextSpan): boolean; - function textSpanContainsPosition(span: TextSpan, position: number): boolean; - function textSpanContainsTextSpan(span: TextSpan, other: TextSpan): boolean; - function textSpanOverlapsWith(span: TextSpan, other: TextSpan): boolean; - function textSpanOverlap(span1: TextSpan, span2: TextSpan): TextSpan; - function textSpanIntersectsWithTextSpan(span: TextSpan, other: TextSpan): boolean; - function textSpanIntersectsWith(span: TextSpan, start: number, length: number): boolean; - function textSpanIntersectsWithPosition(span: TextSpan, position: number): boolean; - function textSpanIntersection(span1: TextSpan, span2: TextSpan): TextSpan; - function createTextSpan(start: number, length: number): TextSpan; - function createTextSpanFromBounds(start: number, end: number): TextSpan; - function textChangeRangeNewSpan(range: TextChangeRange): TextSpan; - function textChangeRangeIsUnchanged(range: TextChangeRange): boolean; - function createTextChangeRange(span: TextSpan, newLength: number): TextChangeRange; - let unchangedTextChangeRange: TextChangeRange; - /** - * Called to merge all the changes that occurred across several versions of a script snapshot - * into a single change. i.e. if a user keeps making successive edits to a script we will - * have a text change from V1 to V2, V2 to V3, ..., Vn. - * - * This function will then merge those changes into a single change range valid between V1 and - * Vn. - */ - function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange; - function nodeStartsNewLexicalEnvironment(n: Node): boolean; - function nodeIsSynthesized(node: Node): boolean; - function createSynthesizedNode(kind: SyntaxKind, startsOnNewLine?: boolean): Node; - /** - * 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) - * Note that this doesn't actually wrap the input in double quotes. - */ - 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" { - /** - * 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" { - interface ListItemInfo { - listItemIndex: number; - list: Node; - } - function getEndLinePosition(line: number, sourceFile: SourceFile): number; - function getLineStartPositionForPosition(position: number, sourceFile: SourceFile): number; - function rangeContainsRange(r1: TextRange, r2: TextRange): boolean; - function startEndContainsRange(start: number, end: number, range: TextRange): boolean; - 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; - function getTouchingPropertyName(sourceFile: SourceFile, position: number): Node; - /** Returns the token if position is in [start, end) or if position === end and includeItemAtEndPosition(token) === true */ - function getTouchingToken(sourceFile: SourceFile, position: number, includeItemAtEndPosition?: (n: Node) => boolean): Node; - /** Returns a token if position is in [start-of-leading-trivia, end) */ - function getTokenAtPosition(sourceFile: SourceFile, position: number): Node; - /** - * The token on the left of the position is the token that strictly includes the position - * or sits to the left of the cursor if it is on a boundary. For example - * - * fo|o -> will return foo - * foo |bar -> will return foo - * - */ - function findTokenOnLeftOfPosition(file: SourceFile, position: number): Node; - function findNextToken(previousToken: Node, parent: Node): Node; - function findPrecedingToken(position: number, sourceFile: SourceFile, startNode?: Node): Node; - 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" { - function isFirstDeclarationOfSymbolParameter(symbol: Symbol): boolean; - function symbolPart(text: string, symbol: Symbol): SymbolDisplayPart; - function displayPart(text: string, kind: SymbolDisplayPartKind, symbol?: Symbol): SymbolDisplayPart; - function spacePart(): SymbolDisplayPart; - 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[]; - function typeToDisplayParts(typechecker: TypeChecker, type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): SymbolDisplayPart[]; - function symbolToDisplayParts(typeChecker: TypeChecker, symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): SymbolDisplayPart[]; - function signatureToDisplayParts(typechecker: TypeChecker, signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags): SymbolDisplayPart[]; -} diff --git a/scripts/processDiagnosticMessages.ts b/scripts/processDiagnosticMessages.ts index b97e4a2ea54..9cfde5b2964 100644 --- a/scripts/processDiagnosticMessages.ts +++ b/scripts/processDiagnosticMessages.ts @@ -54,6 +54,7 @@ function buildInfoFileOutput(messageTable: InputDiagnosticMessageTable, nameMap: var result = '// \r\n' + '/// \r\n' + + '/* @internal */\r\n' + 'module ts {\r\n' + ' export var Diagnostics = {\r\n'; var names = Utilities.getObjectKeys(messageTable); diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 494570c85c1..9d6d9fab35b 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -1,7 +1,8 @@ /// +/* @internal */ module ts { - /* @internal */ export let bindTime = 0; + export let bindTime = 0; export const enum ModuleInstanceState { NonInstantiated = 0, @@ -539,7 +540,7 @@ module ts { bindChildren(node, 0, /*isBlockScopeContainer*/ false); break; case SyntaxKind.ExportAssignment: - if ((node).expression && (node).expression.kind === SyntaxKind.Identifier) { + if ((node).expression.kind === SyntaxKind.Identifier) { // An export default clause with an identifier exports all meanings of that identifier declareSymbol(container.symbol.exports, container.symbol, node, SymbolFlags.Alias, SymbolFlags.PropertyExcludes | SymbolFlags.AliasExcludes); } diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ea38a8f4b31..a6973bb273b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1,19 +1,18 @@ /// +/* @internal */ module ts { let nextSymbolId = 1; let nextNodeId = 1; let nextMergeId = 1; - // @internal export function getNodeId(node: Node): number { if (!node.id) node.id = nextNodeId++; return node.id; } - /* @internal */ export let checkTime = 0; + export let checkTime = 0; - /* @internal */ export function getSymbolId(symbol: Symbol): number { if (!symbol.id) { symbol.id = nextSymbolId++; @@ -350,7 +349,8 @@ module ts { } result = undefined; } - else if (location.kind === SyntaxKind.SourceFile) { + else if (location.kind === SyntaxKind.SourceFile || + (location.kind === SyntaxKind.ModuleDeclaration && (location).name.kind === SyntaxKind.StringLiteral)) { result = getSymbol(getSymbolOfNode(location).exports, "default", meaning & SymbolFlags.ModuleMember); let localSymbol = getLocalSymbolForExportDefault(result); if (result && (result.flags & meaning) && localSymbol && localSymbol.name === name) { @@ -598,7 +598,7 @@ module ts { if (moduleSymbol.flags & SymbolFlags.Variable) { let typeAnnotation = (moduleSymbol.valueDeclaration).type; if (typeAnnotation) { - return getPropertyOfType(getTypeFromTypeNodeOrHeritageClauseElement(typeAnnotation), name); + return getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name); } } } @@ -647,7 +647,7 @@ module ts { if (symbol.flags & SymbolFlags.Variable) { var typeAnnotation = (symbol.valueDeclaration).type; if (typeAnnotation) { - return resolveSymbol(getPropertyOfType(getTypeFromTypeNodeOrHeritageClauseElement(typeAnnotation), name)); + return resolveSymbol(getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name)); } } } @@ -682,7 +682,7 @@ module ts { } function getTargetOfExportAssignment(node: ExportAssignment): Symbol { - return node.expression && resolveEntityName(node.expression, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace); + return resolveEntityName(node.expression, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace); } function getTargetOfAliasDeclaration(node: Declaration): Symbol { @@ -748,7 +748,7 @@ module ts { if (!links.referenced) { links.referenced = true; let node = getDeclarationOfAliasSymbol(symbol); - if (node.kind === SyntaxKind.ExportAssignment && (node).expression) { + if (node.kind === SyntaxKind.ExportAssignment) { // export default checkExpressionCached((node).expression); } @@ -2128,7 +2128,7 @@ module ts { } // Use type from type annotation if one is present if (declaration.type) { - return getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); + return getTypeFromTypeNode(declaration.type); } if (declaration.kind === SyntaxKind.Parameter) { let func = declaration.parent; @@ -2198,25 +2198,7 @@ module ts { } else if (hasSpreadElement) { let unionOfElements = getUnionType(elementTypes); - if (languageVersion >= ScriptTarget.ES6) { - // If the user has something like: - // - // function fun(...[a, ...b]) { } - // - // Normally, in ES6, the implied type of an array binding pattern with a rest element is - // an iterable. However, there is a requirement in our type system that all rest - // parameters be array types. To satisfy this, we have an exception to the rule that - // says the type of an array binding pattern with a rest element is an array type - // if it is *itself* in a rest parameter. It will still be compatible with a spreaded - // iterable argument, but within the function it will be an array. - let parent = pattern.parent; - let isRestParameter = parent.kind === SyntaxKind.Parameter && - pattern === (parent).name && - (parent).dotDotDotToken !== undefined; - return isRestParameter ? createArrayType(unionOfElements) : createIterableType(unionOfElements); - } - - return createArrayType(unionOfElements); + return languageVersion >= ScriptTarget.ES6 ? createIterableType(unionOfElements) : createArrayType(unionOfElements); } // If the pattern has at least one element, and no rest element, then it should imply a tuple type. @@ -2287,16 +2269,7 @@ module ts { } // Handle export default expressions if (declaration.kind === SyntaxKind.ExportAssignment) { - 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; - } + return links.type = checkExpression((declaration).expression); } // Handle variable, parameter or property links.type = resolvingType; @@ -2317,18 +2290,18 @@ module ts { return links.type; } - function getSetAccessorTypeAnnotationNode(accessor: AccessorDeclaration): TypeNode | LiteralExpression { + function getSetAccessorTypeAnnotationNode(accessor: AccessorDeclaration): TypeNode { return accessor && accessor.parameters.length > 0 && accessor.parameters[0].type; } function getAnnotatedAccessorType(accessor: AccessorDeclaration): Type { if (accessor) { if (accessor.kind === SyntaxKind.GetAccessor) { - return accessor.type && getTypeFromTypeNodeOrHeritageClauseElement(accessor.type); + return accessor.type && getTypeFromTypeNode(accessor.type); } else { let setterTypeAnnotation = getSetAccessorTypeAnnotationNode(accessor); - return setterTypeAnnotation && getTypeFromTypeNodeOrHeritageClauseElement(setterTypeAnnotation); + return setterTypeAnnotation && getTypeFromTypeNode(setterTypeAnnotation); } } return undefined; @@ -2451,7 +2424,7 @@ module ts { return check(type); function check(type: InterfaceType): boolean { let target = getTargetType(type); - return target === checkBase || forEach(target.baseTypes, check); + return target === checkBase || forEach(getBaseTypes(target), check); } } @@ -2479,6 +2452,70 @@ module ts { return result; } + function getBaseTypes(type: InterfaceType): ObjectType[]{ + let typeWithBaseTypes = type; + if (!typeWithBaseTypes.baseTypes) { + if (type.symbol.flags & SymbolFlags.Class) { + resolveBaseTypesOfClass(typeWithBaseTypes); + } + else if (type.symbol.flags & SymbolFlags.Interface) { + resolveBaseTypesOfInterface(typeWithBaseTypes); + } + else { + Debug.fail("type must be class or interface"); + } + } + + return typeWithBaseTypes.baseTypes; + } + + function resolveBaseTypesOfClass(type: InterfaceTypeWithBaseTypes): void { + type.baseTypes = []; + let declaration = getDeclarationOfKind(type.symbol, SyntaxKind.ClassDeclaration); + let baseTypeNode = getClassExtendsHeritageClauseElement(declaration); + if (baseTypeNode) { + let baseType = getTypeFromHeritageClauseElement(baseTypeNode); + if (baseType !== unknownType) { + if (getTargetType(baseType).flags & TypeFlags.Class) { + if (type !== baseType && !hasBaseType(baseType, type)) { + type.baseTypes.push(baseType); + } + else { + error(declaration, Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, /*enclosingDeclaration*/ undefined, TypeFormatFlags.WriteArrayAsGenericType)); + } + } + else { + error(baseTypeNode, Diagnostics.A_class_may_only_extend_another_class); + } + } + } + } + + function resolveBaseTypesOfInterface(type: InterfaceTypeWithBaseTypes): void { + type.baseTypes = []; + for (let declaration of type.symbol.declarations) { + if (declaration.kind === SyntaxKind.InterfaceDeclaration && getInterfaceBaseTypeNodes(declaration)) { + for (let node of getInterfaceBaseTypeNodes(declaration)) { + let baseType = getTypeFromHeritageClauseElement(node); + + if (baseType !== unknownType) { + if (getTargetType(baseType).flags & (TypeFlags.Class | TypeFlags.Interface)) { + if (type !== baseType && !hasBaseType(baseType, type)) { + type.baseTypes.push(baseType); + } + else { + error(declaration, Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, /*enclosingDeclaration*/ undefined, TypeFormatFlags.WriteArrayAsGenericType)); + } + } + else { + error(node, Diagnostics.An_interface_may_only_extend_a_class_or_another_interface); + } + } + } + } + } + } + function getDeclaredTypeOfClass(symbol: Symbol): InterfaceType { let links = getSymbolLinks(symbol); if (!links.declaredType) { @@ -2492,25 +2529,7 @@ module ts { (type).target = type; (type).typeArguments = type.typeParameters; } - type.baseTypes = []; - let declaration = getDeclarationOfKind(symbol, SyntaxKind.ClassDeclaration); - let baseTypeNode = getClassExtendsHeritageClauseElement(declaration); - if (baseTypeNode) { - let baseType = getTypeFromHeritageClauseElement(baseTypeNode); - if (baseType !== unknownType) { - if (getTargetType(baseType).flags & TypeFlags.Class) { - if (type !== baseType && !hasBaseType(baseType, type)) { - type.baseTypes.push(baseType); - } - else { - error(declaration, Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, /*enclosingDeclaration*/ undefined, TypeFormatFlags.WriteArrayAsGenericType)); - } - } - else { - error(baseTypeNode, Diagnostics.A_class_may_only_extend_another_class); - } - } - } + type.declaredProperties = getNamedMembers(symbol.members); type.declaredCallSignatures = emptyArray; type.declaredConstructSignatures = emptyArray; @@ -2533,28 +2552,7 @@ module ts { (type).target = type; (type).typeArguments = type.typeParameters; } - type.baseTypes = []; - forEach(symbol.declarations, declaration => { - if (declaration.kind === SyntaxKind.InterfaceDeclaration && getInterfaceBaseTypeNodes(declaration)) { - forEach(getInterfaceBaseTypeNodes(declaration), node => { - let baseType = getTypeFromHeritageClauseElement(node); - if (baseType !== unknownType) { - if (getTargetType(baseType).flags & (TypeFlags.Class | TypeFlags.Interface)) { - if (type !== baseType && !hasBaseType(baseType, type)) { - type.baseTypes.push(baseType); - } - else { - error(declaration, Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, /*enclosingDeclaration*/ undefined, TypeFormatFlags.WriteArrayAsGenericType)); - } - } - else { - error(node, Diagnostics.An_interface_may_only_extend_a_class_or_another_interface); - } - } - }); - } - }); type.declaredProperties = getNamedMembers(symbol.members); type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]); type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]); @@ -2569,7 +2567,7 @@ module ts { if (!links.declaredType) { links.declaredType = resolvingType; let declaration = getDeclarationOfKind(symbol, SyntaxKind.TypeAliasDeclaration); - let type = getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); + let type = getTypeFromTypeNode(declaration.type); if (links.declaredType === resolvingType) { links.declaredType = type; } @@ -2674,15 +2672,16 @@ module ts { let constructSignatures = type.declaredConstructSignatures; let stringIndexType = type.declaredStringIndexType; let numberIndexType = type.declaredNumberIndexType; - if (type.baseTypes.length) { + let baseTypes = getBaseTypes(type); + if (baseTypes.length) { members = createSymbolTable(type.declaredProperties); - forEach(type.baseTypes, baseType => { + for (let baseType of baseTypes) { addInheritedMembers(members, getPropertiesOfObjectType(baseType)); callSignatures = concatenate(callSignatures, getSignaturesOfType(baseType, SignatureKind.Call)); constructSignatures = concatenate(constructSignatures, getSignaturesOfType(baseType, SignatureKind.Construct)); stringIndexType = stringIndexType || getIndexTypeOfType(baseType, IndexKind.String); numberIndexType = numberIndexType || getIndexTypeOfType(baseType, IndexKind.Number); - }); + } } setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } @@ -2695,7 +2694,7 @@ module ts { let constructSignatures = instantiateList(target.declaredConstructSignatures, mapper, instantiateSignature); let stringIndexType = target.declaredStringIndexType ? instantiateType(target.declaredStringIndexType, mapper) : undefined; let numberIndexType = target.declaredNumberIndexType ? instantiateType(target.declaredNumberIndexType, mapper) : undefined; - forEach(target.baseTypes, baseType => { + forEach(getBaseTypes(target), baseType => { let instantiatedBaseType = instantiateType(baseType, mapper); addInheritedMembers(members, getPropertiesOfObjectType(instantiatedBaseType)); callSignatures = concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, SignatureKind.Call)); @@ -2724,9 +2723,10 @@ module ts { sig.minArgumentCount, sig.hasRestParameter, sig.hasStringLiterals); } - function getDefaultConstructSignatures(classType: InterfaceType): Signature[] { - if (classType.baseTypes.length) { - let baseType = classType.baseTypes[0]; + function getDefaultConstructSignatures(classType: InterfaceType): Signature[]{ + let baseTypes = getBaseTypes(classType); + if (baseTypes.length) { + let baseType = baseTypes[0]; let baseSignatures = getSignaturesOfType(getTypeOfSymbol(baseType.symbol), SignatureKind.Construct); return map(baseSignatures, baseSignature => { let signature = baseType.flags & TypeFlags.Reference ? @@ -2848,9 +2848,10 @@ module ts { if (!constructSignatures.length) { constructSignatures = getDefaultConstructSignatures(classType); } - if (classType.baseTypes.length) { + let baseTypes = getBaseTypes(classType); + if (baseTypes.length) { members = createSymbolTable(getNamedMembers(members)); - addInheritedMembers(members, getPropertiesOfObjectType(getTypeOfSymbol(classType.baseTypes[0].symbol))); + addInheritedMembers(members, getPropertiesOfObjectType(getTypeOfSymbol(baseTypes[0].symbol))); } } stringIndexType = undefined; @@ -2914,16 +2915,17 @@ module ts { } function getPropertiesOfType(type: Type): Symbol[] { - if (type.flags & TypeFlags.Union) { - return getPropertiesOfUnionType(type); - } - return getPropertiesOfObjectType(getApparentType(type)); + type = getApparentType(type); + return type.flags & TypeFlags.Union ? getPropertiesOfUnionType(type) : getPropertiesOfObjectType(type); } // For a type parameter, return the base constraint of the type parameter. For the string, number, // boolean, and symbol primitive types, return the corresponding object types. Otherwise return the // type itself. Note that the apparent type of a union type is the union type itself. function getApparentType(type: Type): Type { + if (type.flags & TypeFlags.Union) { + type = getReducedTypeOfUnionType(type); + } if (type.flags & TypeFlags.TypeParameter) { do { type = getConstraintOfTypeParameter(type); @@ -2996,27 +2998,27 @@ module ts { // necessary, maps primitive types and type parameters are to their apparent types, and augments with properties from // Object and Function as appropriate. function getPropertyOfType(type: Type, name: string): Symbol { + type = getApparentType(type); + if (type.flags & TypeFlags.ObjectType) { + let resolved = resolveObjectOrUnionTypeMembers(type); + if (hasProperty(resolved.members, name)) { + let symbol = resolved.members[name]; + if (symbolIsValue(symbol)) { + return symbol; + } + } + if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { + let symbol = getPropertyOfObjectType(globalFunctionType, name); + if (symbol) { + return symbol; + } + } + return getPropertyOfObjectType(globalObjectType, name); + } if (type.flags & TypeFlags.Union) { return getPropertyOfUnionType(type, name); } - if (!(type.flags & TypeFlags.ObjectType)) { - type = getApparentType(type); - if (!(type.flags & TypeFlags.ObjectType)) { - return undefined; - } - } - let resolved = resolveObjectOrUnionTypeMembers(type); - if (hasProperty(resolved.members, name)) { - let symbol = resolved.members[name]; - if (symbolIsValue(symbol)) { - return symbol; - } - } - if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { - let symbol = getPropertyOfObjectType(globalFunctionType, name); - if (symbol) return symbol; - } - return getPropertyOfObjectType(globalObjectType, name); + return undefined; } function getSignaturesOfObjectOrUnionType(type: Type, kind: SignatureKind): Signature[] { @@ -3110,7 +3112,7 @@ module ts { returnType = classType; } else if (declaration.type) { - returnType = getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); + returnType = getTypeFromTypeNode(declaration.type); } else { // TypeScript 1.0 spec (April 2014): @@ -3268,7 +3270,7 @@ module ts { function getIndexTypeOfSymbol(symbol: Symbol, kind: IndexKind): Type { let declaration = getIndexDeclarationOfSymbol(symbol, kind); return declaration - ? declaration.type ? getTypeFromTypeNodeOrHeritageClauseElement(declaration.type) : anyType + ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType : undefined; } @@ -3279,7 +3281,7 @@ module ts { type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNodeOrHeritageClauseElement((getDeclarationOfKind(type.symbol, SyntaxKind.TypeParameter)).constraint); + type.constraint = getTypeFromTypeNode((getDeclarationOfKind(type.symbol, SyntaxKind.TypeParameter)).constraint); } } return type.constraint === noConstraintType ? undefined : type.constraint; @@ -3410,7 +3412,7 @@ module ts { 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)); + 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); @@ -3508,7 +3510,7 @@ module ts { function getTypeFromArrayTypeNode(node: ArrayTypeNode): Type { let links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createArrayType(getTypeFromTypeNodeOrHeritageClauseElement(node.elementType)); + links.resolvedType = createArrayType(getTypeFromTypeNode(node.elementType)); } return links.resolvedType; } @@ -3526,7 +3528,7 @@ module ts { function getTypeFromTupleTypeNode(node: TupleTypeNode): Type { let links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = createTupleType(map(node.elementTypes, getTypeFromTypeNodeOrHeritageClauseElement)); + links.resolvedType = createTupleType(map(node.elementTypes, getTypeFromTypeNode)); } return links.resolvedType; } @@ -3591,6 +3593,10 @@ module ts { } } + // The noSubtypeReduction flag is there because it isn't possible to always do subtype reduction. The flag + // is true when creating a union type from a type node and when instantiating a union type. In both of those + // cases subtype reduction has to be deferred to properly support recursive union types. For example, a + // type alias of the form "type Item = string | (() => Item)" cannot be reduced during its declaration. function getUnionType(types: Type[], noSubtypeReduction?: boolean): Type { if (types.length === 0) { return emptyObjectType; @@ -3615,14 +3621,23 @@ module ts { if (!type) { type = unionTypes[id] = createObjectType(TypeFlags.Union | getWideningFlagsOfTypes(sortedTypes)); type.types = sortedTypes; + type.reducedType = noSubtypeReduction ? undefined : type; } return type; } + function getReducedTypeOfUnionType(type: UnionType): Type { + // If union type was created without subtype reduction, perform the deferred reduction now + if (!type.reducedType) { + type.reducedType = getUnionType(type.types, /*noSubtypeReduction*/ false); + } + return type.reducedType; + } + function getTypeFromUnionTypeNode(node: UnionTypeNode): Type { let links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = getUnionType(map(node.types, getTypeFromTypeNodeOrHeritageClauseElement), /*noSubtypeReduction*/ true); + links.resolvedType = getUnionType(map(node.types, getTypeFromTypeNode), /*noSubtypeReduction*/ true); } return links.resolvedType; } @@ -3636,7 +3651,7 @@ module ts { return links.resolvedType; } - function getStringLiteralType(node: LiteralExpression): StringLiteralType { + function getStringLiteralType(node: StringLiteral): StringLiteralType { if (hasProperty(stringLiteralTypes, node.text)) { return stringLiteralTypes[node.text]; } @@ -3646,7 +3661,7 @@ module ts { return type; } - function getTypeFromStringLiteral(node: LiteralExpression): Type { + function getTypeFromStringLiteral(node: StringLiteral): Type { let links = getNodeLinks(node); if (!links.resolvedType) { links.resolvedType = getStringLiteralType(node); @@ -3654,7 +3669,7 @@ module ts { return links.resolvedType; } - function getTypeFromTypeNodeOrHeritageClauseElement(node: TypeNode | LiteralExpression | HeritageClauseElement): Type { + function getTypeFromTypeNode(node: TypeNode): Type { switch (node.kind) { case SyntaxKind.AnyKeyword: return anyType; @@ -3669,7 +3684,7 @@ module ts { case SyntaxKind.VoidKeyword: return voidType; case SyntaxKind.StringLiteral: - return getTypeFromStringLiteral(node); + return getTypeFromStringLiteral(node); case SyntaxKind.TypeReference: return getTypeFromTypeReference(node); case SyntaxKind.HeritageClauseElement: @@ -3683,7 +3698,7 @@ module ts { case SyntaxKind.UnionType: return getTypeFromUnionTypeNode(node); case SyntaxKind.ParenthesizedType: - return getTypeFromTypeNodeOrHeritageClauseElement((node).type); + return getTypeFromTypeNode((node).type); case SyntaxKind.FunctionType: case SyntaxKind.ConstructorType: case SyntaxKind.TypeLiteral: @@ -4012,6 +4027,7 @@ module ts { if (source === numberType && target.flags & TypeFlags.Enum) return Ternary.True; } } + let saveErrorInfo = errorInfo; if (source.flags & TypeFlags.Union || target.flags & TypeFlags.Union) { if (relation === identityRelation) { if (source.flags & TypeFlags.Union && target.flags & TypeFlags.Union) { @@ -4050,25 +4066,34 @@ module ts { return result; } } - else { - let saveErrorInfo = errorInfo; - if (source.flags & TypeFlags.Reference && target.flags & TypeFlags.Reference && (source).target === (target).target) { - // We have type references to same target type, see if relationship holds for all type arguments - if (result = typesRelatedTo((source).typeArguments, (target).typeArguments, reportErrors)) { - return result; - } + else if (source.flags & TypeFlags.Reference && target.flags & TypeFlags.Reference && (source).target === (target).target) { + // We have type references to same target type, see if relationship holds for all type arguments + if (result = typesRelatedTo((source).typeArguments, (target).typeArguments, reportErrors)) { + return result; } - // Even if relationship doesn't hold for type arguments, it may hold in a structural comparison - // Report structural errors only if we haven't reported any errors yet - let reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; - // identity relation does not use apparent type - let sourceOrApparentType = relation === identityRelation ? source : getApparentType(source); - if (sourceOrApparentType.flags & TypeFlags.ObjectType && target.flags & TypeFlags.ObjectType && - (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors))) { + } + + // Even if relationship doesn't hold for unions, type parameters, or generic type references, + // it may hold in a structural comparison. + // Report structural errors only if we haven't reported any errors yet + let reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; + // identity relation does not use apparent type + let sourceOrApparentType = relation === identityRelation ? source : getApparentType(source); + if (sourceOrApparentType.flags & TypeFlags.ObjectType && target.flags & TypeFlags.ObjectType) { + if (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors)) { errorInfo = saveErrorInfo; return result; } } + else if (source.flags & TypeFlags.TypeParameter && sourceOrApparentType.flags & TypeFlags.Union) { + // We clear the errors first because the following check often gives a better error than + // the union comparison above if it is applicable. + errorInfo = saveErrorInfo; + if (result = isRelatedTo(sourceOrApparentType, target, reportErrors)) { + return result; + } + } + if (reportErrors) { headMessage = headMessage || Diagnostics.Type_0_is_not_assignable_to_type_1; let sourceType = typeToString(source); @@ -5408,8 +5433,8 @@ module ts { // will be bound to non-arrow function that contain this arrow function. This results in inconsistent behavior. // To avoid that we will give an error to users if they use arguments objects in arrow function so that they // can explicitly bound arguments objects - if (symbol === argumentsSymbol && getContainingFunction(node).kind === SyntaxKind.ArrowFunction) { - error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression); + if (symbol === argumentsSymbol && getContainingFunction(node).kind === SyntaxKind.ArrowFunction && languageVersion < ScriptTarget.ES6) { + error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } if (symbol.flags & SymbolFlags.Alias && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { @@ -5554,7 +5579,8 @@ module ts { let baseClass: Type; if (enclosingClass && getClassExtendsHeritageClauseElement(enclosingClass)) { let classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); - baseClass = classType.baseTypes.length && classType.baseTypes[0]; + let baseTypes = getBaseTypes(classType); + baseClass = baseTypes.length && baseTypes[0]; } if (!baseClass) { @@ -5582,7 +5608,7 @@ module ts { needToCaptureLexicalThis = false; while (container && container.kind === SyntaxKind.ArrowFunction) { container = getSuperContainer(container, /*includeFunctions*/ true); - needToCaptureLexicalThis = true; + needToCaptureLexicalThis = languageVersion < ScriptTarget.ES6; } // topmost container must be something that is directly nested in the class declaration @@ -5684,7 +5710,7 @@ module ts { let declaration = node.parent; if (node === declaration.initializer) { if (declaration.type) { - return getTypeFromTypeNodeOrHeritageClauseElement(declaration.type); + return getTypeFromTypeNode(declaration.type); } if (declaration.kind === SyntaxKind.Parameter) { let type = getContextuallyTypedParameterType(declaration); @@ -5887,7 +5913,7 @@ module ts { case SyntaxKind.NewExpression: return getContextualTypeForArgument(parent, node); case SyntaxKind.TypeAssertionExpression: - return getTypeFromTypeNodeOrHeritageClauseElement((parent).type); + return getTypeFromTypeNode((parent).type); case SyntaxKind.BinaryExpression: return getContextualTypeForBinaryOperand(node); case SyntaxKind.PropertyAssignment: @@ -6021,14 +6047,38 @@ module ts { } let hasSpreadElement = false; let elementTypes: Type[] = []; + let inDestructuringPattern = isAssignmentTarget(node); for (let e of elements) { - let type = checkExpression(e, contextualMapper); - elementTypes.push(type); + if (inDestructuringPattern && e.kind === SyntaxKind.SpreadElementExpression) { + // Given the following situation: + // var c: {}; + // [...c] = ["", 0]; + // + // c is represented in the tree as a spread element in an array literal. + // But c really functions as a rest element, and its purpose is to provide + // a contextual type for the right hand side of the assignment. Therefore, + // instead of calling checkExpression on "...c", which will give an error + // if c is not iterable/array-like, we need to act as if we are trying to + // get the contextual element type from it. So we do something similar to + // getContextualTypeForElementExpression, which will crucially not error + // if there is no index type / iterated type. + let restArrayType = checkExpression((e).expression, contextualMapper); + let restElementType = getIndexTypeOfType(restArrayType, IndexKind.Number) || + (languageVersion >= ScriptTarget.ES6 ? checkIteratedType(restArrayType, /*expressionForError*/ undefined) : undefined); + + if (restElementType) { + elementTypes.push(restElementType); + } + } + else { + let type = checkExpression(e, contextualMapper); + elementTypes.push(type); + } hasSpreadElement = hasSpreadElement || e.kind === SyntaxKind.SpreadElementExpression; } if (!hasSpreadElement) { let contextualType = getContextualType(node); - if (contextualType && contextualTypeIsTupleLikeType(contextualType) || isAssignmentTarget(node)) { + if (contextualType && contextualTypeIsTupleLikeType(contextualType) || inDestructuringPattern) { return createTupleType(elementTypes); } } @@ -6111,9 +6161,7 @@ module ts { } else { Debug.assert(memberDecl.kind === SyntaxKind.ShorthandPropertyAssignment); - type = memberDecl.name.kind === SyntaxKind.ComputedPropertyName - ? unknownType - : checkExpression(memberDecl.name, contextualMapper); + type = checkExpression((memberDecl).name, contextualMapper); } typeFlags |= type.flags; let prop = createSymbol(SymbolFlags.Property | SymbolFlags.Transient | member.flags, member.name); @@ -6685,7 +6733,7 @@ module ts { let typeArgumentsAreAssignable = true; for (let i = 0; i < typeParameters.length; i++) { let typeArgNode = typeArguments[i]; - let typeArgument = getTypeFromTypeNodeOrHeritageClauseElement(typeArgNode); + let typeArgument = getTypeFromTypeNode(typeArgNode); // Do not push on this array! It has a preallocated length typeArgumentResultTypes[i] = typeArgument; if (typeArgumentsAreAssignable /* so far */) { @@ -6707,9 +6755,12 @@ module ts { let paramType = getTypeAtPosition(signature, i); // A tagged template expression provides a special first argument, and string literals get string literal types // unless we're reporting errors - let argType = i === 0 && node.kind === SyntaxKind.TaggedTemplateExpression ? globalTemplateStringsArrayType : - arg.kind === SyntaxKind.StringLiteral && !reportErrors ? getStringLiteralType(arg) : - checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); + let argType = i === 0 && node.kind === SyntaxKind.TaggedTemplateExpression + ? globalTemplateStringsArrayType + : arg.kind === SyntaxKind.StringLiteral && !reportErrors + ? getStringLiteralType(arg) + : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); + // Use argument expression as error location when reporting errors if (!checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1)) { @@ -7167,7 +7218,7 @@ module ts { function checkTypeAssertion(node: TypeAssertion): Type { let exprType = checkExpression(node.expression); - let targetType = getTypeFromTypeNodeOrHeritageClauseElement(node.type); + let targetType = getTypeFromTypeNode(node.type); if (produceDiagnostics && targetType !== unknownType) { let widenedType = getWidenedType(exprType); if (!(isTypeAssignableTo(targetType, widenedType))) { @@ -7294,7 +7345,7 @@ module ts { Debug.assert(node.kind !== SyntaxKind.MethodDeclaration || isObjectLiteralMethod(node)); // Grammar checking - let hasGrammarError = checkGrammarFunctionLikeDeclaration(node); + let hasGrammarError = checkGrammarDeclarationNameInStrictMode(node) || checkGrammarFunctionLikeDeclaration(node); if (!hasGrammarError && node.kind === SyntaxKind.FunctionExpression) { checkGrammarFunctionName(node.name) || checkGrammarForGenerator(node); } @@ -7340,8 +7391,8 @@ module ts { function checkFunctionExpressionOrObjectLiteralMethodBody(node: FunctionExpression | MethodDeclaration) { Debug.assert(node.kind !== SyntaxKind.MethodDeclaration || isObjectLiteralMethod(node)); - if (node.type) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type)); + if (node.type && !node.asteriskToken) { + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); } if (node.body) { @@ -7351,7 +7402,7 @@ module ts { else { let exprType = checkExpression(node.body); if (node.type) { - checkTypeAssignableTo(exprType, getTypeFromTypeNodeOrHeritageClauseElement(node.type), node.body, /*headMessage*/ undefined); + checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, /*headMessage*/ undefined); } checkFunctionExpressionBodies(node.body); } @@ -7619,7 +7670,7 @@ module ts { // This elementType will be used if the specific property corresponding to this index is not // present (aka the tuple element property). This call also checks that the parentType is in // fact an iterable or array (depending on target language). - let elementType = checkIteratedTypeOrElementType(sourceType, node, /*allowStringInput*/ false); + let elementType = checkIteratedTypeOrElementType(sourceType, node, /*allowStringInput*/ false) || unknownType; let elements = node.elements; for (let i = 0; i < elements.length; i++) { let e = elements[i]; @@ -7643,11 +7694,17 @@ module ts { } } else { - if (i === elements.length - 1) { - checkReferenceAssignment((e).expression, createArrayType(elementType), contextualMapper); + if (i < elements.length - 1) { + error(e, Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); } else { - error(e, Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); + let restExpression = (e).expression; + if (restExpression.kind === SyntaxKind.BinaryExpression && (restExpression).operatorToken.kind === SyntaxKind.EqualsToken) { + error((restExpression).operatorToken, Diagnostics.A_rest_element_cannot_have_an_initializer); + } + else { + checkDestructuringAssignment(restExpression, createArrayType(elementType), contextualMapper); + } } } } @@ -7954,6 +8011,7 @@ module ts { } function checkExpression(node: Expression, contextualMapper?: TypeMapper): Type { + checkGrammarIdentifierInStrictMode(node); return checkExpressionOrQualifiedName(node, contextualMapper); } @@ -7993,7 +8051,7 @@ module ts { function checkNumericLiteral(node: LiteralExpression): Type { // Grammar checking - checkGrammarNumbericLiteral(node); + checkGrammarNumericLiteral(node); return numberType; } @@ -8069,6 +8127,8 @@ module ts { // DECLARATION AND STATEMENT TYPE CHECKING function checkTypeParameter(node: TypeParameterDeclaration) { + checkGrammarDeclarationNameInStrictMode(node); + // Grammar Checking if (node.expression) { grammarErrorOnFirstToken(node.expression, Diagnostics.Type_expected); @@ -8104,10 +8164,11 @@ module ts { if (node.questionToken && isBindingPattern(node.name) && func.body) { error(node, Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature); } - if (node.dotDotDotToken) { - if (!isArrayType(getTypeOfSymbol(node.symbol))) { - error(node, Diagnostics.A_rest_parameter_must_be_of_an_array_type); - } + + // Only check rest parameter type if it's not a binding pattern. Since binding patterns are + // not allowed in a rest parameter, we already have an error from checkGrammarParameterList. + if (node.dotDotDotToken && !isBindingPattern(node.name) && !isArrayType(getTypeOfSymbol(node.symbol))) { + error(node, Diagnostics.A_rest_parameter_must_be_of_an_array_type); } } @@ -8337,10 +8398,13 @@ module ts { } function checkTypeReferenceNode(node: TypeReferenceNode) { + checkGrammarTypeReferenceInStrictMode(node.typeName); return checkTypeReferenceOrHeritageClauseElement(node); } function checkHeritageClauseElement(node: HeritageClauseElement) { + checkGrammarHeritageClauseElementInStrictMode(node.expression); + return checkTypeReferenceOrHeritageClauseElement(node); } @@ -8767,12 +8831,12 @@ module ts { } /** Checks a type reference node as an expression. */ - function checkTypeNodeAsExpression(node: TypeNode | LiteralExpression) { + function checkTypeNodeAsExpression(node: TypeNode) { // 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 type = getTypeFromTypeNode(node); let shouldCheckIfUnknownType = type === unknownType && compilerOptions.separateCompilation; if (!type || (!shouldCheckIfUnknownType && type.flags & (TypeFlags.Intrinsic | TypeFlags.NumberLike | TypeFlags.StringLike))) { return; @@ -8792,7 +8856,8 @@ module ts { case SyntaxKind.PropertyDeclaration: checkTypeNodeAsExpression((node).type); break; - case SyntaxKind.Parameter: checkTypeNodeAsExpression((node).type); + case SyntaxKind.Parameter: + checkTypeNodeAsExpression((node).type); break; case SyntaxKind.MethodDeclaration: checkTypeNodeAsExpression((node).type); @@ -8871,6 +8936,7 @@ module ts { } function checkFunctionLikeDeclaration(node: FunctionLikeDeclaration): void { + checkGrammarDeclarationNameInStrictMode(node); checkDecorators(node); checkSignatureDeclaration(node); @@ -8906,8 +8972,8 @@ module ts { } checkSourceElement(node.body); - if (node.type && !isAccessor(node.kind)) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type)); + if (node.type && !isAccessor(node.kind) && !node.asteriskToken) { + checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); } // Report an implicit any error if there is no body, no explicit return type, and node is not a private method @@ -9154,6 +9220,7 @@ module ts { // Check variable, parameter, or property declaration function checkVariableLikeDeclaration(node: VariableLikeDeclaration) { + checkGrammarDeclarationNameInStrictMode(node); checkDecorators(node); checkSourceElement(node.type); // For a computed property, just check the initializer and exit @@ -9405,6 +9472,10 @@ module ts { } function checkIteratedTypeOrElementType(inputType: Type, errorNode: Node, allowStringInput: boolean): Type { + if (inputType.flags & TypeFlags.Any) { + return inputType; + } + if (languageVersion >= ScriptTarget.ES6) { return checkIteratedType(inputType, errorNode) || anyType; } @@ -9414,7 +9485,10 @@ module ts { } if (isArrayLikeType(inputType)) { - return getIndexTypeOfType(inputType, IndexKind.Number); + let indexType = getIndexTypeOfType(inputType, IndexKind.Number); + if (indexType) { + return indexType; + } } error(errorNode, Diagnostics.Type_0_is_not_an_array_type, typeToString(inputType)); @@ -9787,7 +9861,7 @@ module ts { errorNode = declaredNumberIndexer || declaredStringIndexer; // condition 'errorNode === undefined' may appear if types does not declare nor string neither number indexer if (!errorNode && (type.flags & TypeFlags.Interface)) { - let someBaseTypeHasBothIndexers = forEach((type).baseTypes, base => getIndexTypeOfType(base, IndexKind.String) && getIndexTypeOfType(base, IndexKind.Number)); + let someBaseTypeHasBothIndexers = forEach(getBaseTypes(type), base => getIndexTypeOfType(base, IndexKind.String) && getIndexTypeOfType(base, IndexKind.Number)); errorNode = someBaseTypeHasBothIndexers ? undefined : type.symbol.declarations[0]; } } @@ -9827,7 +9901,7 @@ module ts { // for interfaces property and indexer might be inherited from different bases // check if any base class already has both property and indexer. // check should be performed only if 'type' is the first type that brings property\indexer together - let someBaseClassHasBothPropertyAndIndexer = forEach((containingType).baseTypes, base => getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind)); + let someBaseClassHasBothPropertyAndIndexer = forEach(getBaseTypes(containingType), base => getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind)); errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : containingType.symbol.declarations[0]; } @@ -9880,6 +9954,7 @@ module ts { } function checkClassDeclaration(node: ClassDeclaration) { + checkGrammarDeclarationNameInStrictMode(node); // 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); @@ -9910,9 +9985,10 @@ module ts { emitExtends = emitExtends || !isInAmbientContext(node); checkHeritageClauseElement(baseTypeNode); } - if (type.baseTypes.length) { + let baseTypes = getBaseTypes(type); + if (baseTypes.length) { if (produceDiagnostics) { - let baseType = type.baseTypes[0]; + let baseType = baseTypes[0]; checkTypeAssignableTo(type, baseType, node.name || node, Diagnostics.Class_0_incorrectly_extends_base_class_1); let staticBaseType = getTypeOfSymbol(baseType.symbol); checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name || node, @@ -9926,7 +10002,7 @@ module ts { } } - if (type.baseTypes.length || (baseTypeNode && compilerOptions.separateCompilation)) { + if (baseTypes.length || (baseTypeNode && compilerOptions.separateCompilation)) { // Check that base type can be evaluated as expression checkExpressionOrQualifiedName(baseTypeNode.expression); } @@ -10062,7 +10138,7 @@ module ts { if (!tp1.constraint || !tp2.constraint) { return false; } - if (!isTypeIdenticalTo(getTypeFromTypeNodeOrHeritageClauseElement(tp1.constraint), getTypeFromTypeNodeOrHeritageClauseElement(tp2.constraint))) { + if (!isTypeIdenticalTo(getTypeFromTypeNode(tp1.constraint), getTypeFromTypeNode(tp2.constraint))) { return false; } } @@ -10070,7 +10146,8 @@ module ts { } function checkInheritedPropertiesAreIdentical(type: InterfaceType, typeNode: Node): boolean { - if (!type.baseTypes.length || type.baseTypes.length === 1) { + let baseTypes = getBaseTypes(type); + if (baseTypes.length < 2) { return true; } @@ -10078,7 +10155,7 @@ module ts { forEach(type.declaredProperties, p => { seen[p.name] = { prop: p, containingType: type }; }); let ok = true; - for (let base of type.baseTypes) { + for (let base of baseTypes) { let properties = getPropertiesOfObjectType(base); for (let prop of properties) { if (!hasProperty(seen, prop.name)) { @@ -10106,7 +10183,7 @@ module ts { function checkInterfaceDeclaration(node: InterfaceDeclaration) { // Grammar checking - checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarInterfaceDeclaration(node); + checkGrammarDeclarationNameInStrictMode(node) || checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarInterfaceDeclaration(node); checkTypeParameters(node.typeParameters); if (produceDiagnostics) { @@ -10126,7 +10203,7 @@ module ts { let type = getDeclaredTypeOfSymbol(symbol); // run subsequent checks only if first set succeeded if (checkInheritedPropertiesAreIdentical(type, node.name)) { - forEach(type.baseTypes, baseType => { + forEach(getBaseTypes(type), baseType => { checkTypeAssignableTo(type, baseType, node.name, Diagnostics.Interface_0_incorrectly_extends_interface_1); }); checkIndexConstraints(type); @@ -10331,7 +10408,7 @@ module ts { } // Grammar checking - checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarEnumDeclaration(node); + checkGrammarDeclarationNameInStrictMode(node) || checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarEnumDeclaration(node); checkTypeNameIsReserved(node.name, Diagnostics.Enum_name_cannot_be_0); checkCollisionWithCapturedThisVariable(node, node.name); @@ -10391,17 +10468,33 @@ module ts { function getFirstNonAmbientClassOrFunctionDeclaration(symbol: Symbol): Declaration { let declarations = symbol.declarations; for (let declaration of declarations) { - if ((declaration.kind === SyntaxKind.ClassDeclaration || (declaration.kind === SyntaxKind.FunctionDeclaration && nodeIsPresent((declaration).body))) && !isInAmbientContext(declaration)) { + if ((declaration.kind === SyntaxKind.ClassDeclaration || + (declaration.kind === SyntaxKind.FunctionDeclaration && nodeIsPresent((declaration).body))) && + !isInAmbientContext(declaration)) { return declaration; } } return undefined; } + function inSameLexicalScope(node1: Node, node2: Node) { + let container1 = getEnclosingBlockScopeContainer(node1); + let container2 = getEnclosingBlockScopeContainer(node2); + if (isGlobalSourceFile(container1)) { + return isGlobalSourceFile(container2); + } + else if (isGlobalSourceFile(container2)) { + return false; + } + else { + return container1 === container2; + } + } + function checkModuleDeclaration(node: ModuleDeclaration) { if (produceDiagnostics) { // Grammar checking - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node)) { + if (!checkGrammarDeclarationNameInStrictMode(node) && !checkGrammarDecorators(node) && !checkGrammarModifiers(node)) { if (!isInAmbientContext(node) && node.name.kind === SyntaxKind.StringLiteral) { grammarErrorOnNode(node.name, Diagnostics.Only_ambient_modules_can_use_quoted_names); } @@ -10417,15 +10510,23 @@ module ts { && symbol.declarations.length > 1 && !isInAmbientContext(node) && isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation)) { - let classOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); - if (classOrFunc) { - if (getSourceFileOfNode(node) !== getSourceFileOfNode(classOrFunc)) { + let firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); + if (firstNonAmbientClassOrFunc) { + if (getSourceFileOfNode(node) !== getSourceFileOfNode(firstNonAmbientClassOrFunc)) { error(node.name, Diagnostics.A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); } - else if (node.pos < classOrFunc.pos) { + else if (node.pos < firstNonAmbientClassOrFunc.pos) { error(node.name, Diagnostics.A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); } } + + // if the module merges with a class declaration in the same lexical scope, + // we need to track this to ensure the correct emit. + let mergedClass = getDeclarationOfKind(symbol, SyntaxKind.ClassDeclaration); + if (mergedClass && + inSameLexicalScope(node, mergedClass)) { + getNodeLinks(node).flags |= NodeCheckFlags.LexicalModuleMergesWithClass; + } } // Checks for ambient external modules. @@ -10505,7 +10606,7 @@ module ts { } function checkImportDeclaration(node: ImportDeclaration) { - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & NodeFlags.Modifier)) { + if (!checkGrammarImportDeclarationNameInStrictMode(node) && !checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & NodeFlags.Modifier)) { grammarErrorOnFirstToken(node, Diagnostics.An_import_declaration_cannot_have_modifiers); } if (checkExternalImportOrExportDeclaration(node)) { @@ -10527,7 +10628,7 @@ module ts { } function checkImportEqualsDeclaration(node: ImportEqualsDeclaration) { - checkGrammarDecorators(node) || checkGrammarModifiers(node); + checkGrammarDeclarationNameInStrictMode(node) || checkGrammarDecorators(node) || checkGrammarModifiers(node); if (isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) { checkImportBinding(node); if (node.flags & NodeFlags.Export) { @@ -10599,21 +10700,12 @@ module ts { if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & NodeFlags.Modifier)) { grammarErrorOnFirstToken(node, Diagnostics.An_export_assignment_cannot_have_modifiers); } - if (node.expression) { - if (node.expression.kind === SyntaxKind.Identifier) { - markExportAsReferenced(node); - } - else { - checkExpressionCached(node.expression); - } + if (node.expression.kind === SyntaxKind.Identifier) { + markExportAsReferenced(node); } - if (node.type) { - checkSourceElement(node.type); - if (!isInAmbientContext(node)) { - grammarErrorOnFirstToken(node.type, Diagnostics.A_type_annotation_on_an_export_statement_is_only_allowed_in_an_ambient_external_module_declaration); - } + else { + checkExpressionCached(node.expression); } - checkExternalModuleExports(container); if (node.isExportEquals && languageVersion >= ScriptTarget.ES6) { @@ -10867,6 +10959,8 @@ module ts { checkGrammarSourceFile(node); emitExtends = false; + emitDecorate = false; + emitParam = false; potentialThisCollisions.length = 0; forEach(node.statements, checkSourceElement); @@ -11076,7 +11170,7 @@ module ts { return node.parent && node.parent.kind === SyntaxKind.HeritageClauseElement; } - function isTypeNodeOrHeritageClauseElement(node: Node): boolean { + function isTypeNode(node: Node): boolean { if (SyntaxKind.FirstTypeNode <= node.kind && node.kind <= SyntaxKind.LastTypeNode) { return true; } @@ -11325,8 +11419,8 @@ module ts { return unknownType; } - if (isTypeNodeOrHeritageClauseElement(node)) { - return getTypeFromTypeNodeOrHeritageClauseElement(node); + if (isTypeNode(node)) { + return getTypeFromTypeNode(node); } if (isExpression(node)) { @@ -11420,7 +11514,14 @@ module ts { let node = getDeclarationOfAliasSymbol(symbol); if (node) { if (node.kind === SyntaxKind.ImportClause) { - return getGeneratedNameForNode(node.parent) + ".default"; + let defaultKeyword: string; + + if (languageVersion === ScriptTarget.ES3) { + defaultKeyword = "[\"default\"]"; + } else { + defaultKeyword = ".default"; + } + return getGeneratedNameForNode(node.parent) + defaultKeyword; } if (node.kind === SyntaxKind.ImportSpecifier) { let moduleName = getGeneratedNameForNode(node.parent.parent.parent); @@ -11913,8 +12014,155 @@ module ts { anyArrayType = createArrayType(anyType); } - // GRAMMAR CHECKING + function isReservedWordInStrictMode(node: Identifier): boolean { + // Check that originalKeywordKind is less than LastFutureReservedWord to see if an Identifier is a strict-mode reserved word + return (node.parserContextFlags & ParserContextFlags.StrictMode) && + (node.originalKeywordKind >= SyntaxKind.FirstFutureReservedWord && node.originalKeywordKind <= SyntaxKind.LastFutureReservedWord); + } + + function reportStrictModeGrammarErrorInClassDeclaration(identifier: Identifier, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): boolean { + // We are checking if this name is inside class declaration or class expression (which are under class definitions inside ES6 spec.) + // if so, we would like to give more explicit invalid usage error. + if (getAncestor(identifier, SyntaxKind.ClassDeclaration) || getAncestor(identifier, SyntaxKind.ClassExpression)) { + return grammarErrorOnNode(identifier, message, arg0); + } + return false; + } + + function checkGrammarImportDeclarationNameInStrictMode(node: ImportDeclaration): boolean { + // Check if the import declaration used strict-mode reserved word in its names bindings + if (node.importClause) { + let impotClause = node.importClause; + if (impotClause.namedBindings) { + let nameBindings = impotClause.namedBindings; + if (nameBindings.kind === SyntaxKind.NamespaceImport) { + let name = (nameBindings).name; + if (name.originalKeywordKind) { + let nameText = declarationNameToString(name); + return grammarErrorOnNode(name, Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); + } + } + else if (nameBindings.kind === SyntaxKind.NamedImports) { + let reportError = false; + for (let element of (nameBindings).elements) { + let name = element.name; + if (name.originalKeywordKind) { + let nameText = declarationNameToString(name); + reportError = reportError || grammarErrorOnNode(name, Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); + } + } + return reportError; + } + } + } + return false; + } + + function checkGrammarDeclarationNameInStrictMode(node: Declaration): boolean { + let name = node.name; + if (name && name.kind === SyntaxKind.Identifier && isReservedWordInStrictMode(name)) { + let nameText = declarationNameToString(name); + switch (node.kind) { + case SyntaxKind.Parameter: + case SyntaxKind.VariableDeclaration: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.TypeParameter: + case SyntaxKind.BindingElement: + case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.TypeAliasDeclaration: + case SyntaxKind.EnumDeclaration: + return checkGrammarIdentifierInStrictMode(name); + + case SyntaxKind.ClassDeclaration: + // Report an error if the class declaration uses strict-mode reserved word. + return grammarErrorOnNode(name, Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText); + + case SyntaxKind.ModuleDeclaration: + // Report an error if the module declaration uses strict-mode reserved word. + // TODO(yuisu): fix this when having external module in strict mode + return grammarErrorOnNode(name, Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); + + case SyntaxKind.ImportEqualsDeclaration: + // TODO(yuisu): fix this when having external module in strict mode + return grammarErrorOnNode(name, Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); + } + } + return false; + } + + function checkGrammarTypeReferenceInStrictMode(typeName: Identifier | QualifiedName) { + // Check if the type reference is using strict mode keyword + // Example: + // class C { + // foo(x: public){} // Error. + // } + if (typeName.kind === SyntaxKind.Identifier) { + checkGrammarTypeNameInStrictMode(typeName); + } + // Report an error for each identifier in QualifiedName + // Example: + // foo (x: B.private.bar) // error at private + // foo (x: public.private.package) // error at public, private, and package + else if (typeName.kind === SyntaxKind.QualifiedName) { + // Walk from right to left and report a possible error at each Identifier in QualifiedName + // Example: + // x1: public.private.package // error at public and private + checkGrammarTypeNameInStrictMode((typeName).right); + checkGrammarTypeReferenceInStrictMode((typeName).left); + } + } + + // This function will report an error for every identifier in property access expression + // whether it violates strict mode reserved words. + // Example: + // public // error at public + // public.private.package // error at public + // B.private.B // no error + function checkGrammarHeritageClauseElementInStrictMode(expression: Expression) { + // Example: + // class C extends public // error at public + if (expression && expression.kind === SyntaxKind.Identifier) { + return checkGrammarIdentifierInStrictMode(expression); + } + else if (expression && expression.kind === SyntaxKind.PropertyAccessExpression) { + // Walk from left to right in PropertyAccessExpression until we are at the left most expression + // in PropertyAccessExpression. According to grammar production of MemberExpression, + // the left component expression is a PrimaryExpression (i.e. Identifier) while the other + // component after dots can be IdentifierName. + checkGrammarHeritageClauseElementInStrictMode((expression).expression); + } + + } + + // The function takes an identifier itself or an expression which has SyntaxKind.Identifier. + function checkGrammarIdentifierInStrictMode(node: Expression | Identifier, nameText?: string): boolean { + if (node && node.kind === SyntaxKind.Identifier && isReservedWordInStrictMode(node)) { + if (!nameText) { + nameText = declarationNameToString(node); + } + + // TODO (yuisu): Fix when module is a strict mode + let errorReport = reportStrictModeGrammarErrorInClassDeclaration(node, Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText)|| + grammarErrorOnNode(node, Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); + return errorReport; + } + return false; + } + + // The function takes an identifier when uses as a typeName in TypeReferenceNode + function checkGrammarTypeNameInStrictMode(node: Identifier): boolean { + if (node && node.kind === SyntaxKind.Identifier && isReservedWordInStrictMode(node)) { + let nameText = declarationNameToString(node); + + // TODO (yuisu): Fix when module is a strict mode + let errorReport = reportStrictModeGrammarErrorInClassDeclaration(node, Diagnostics.Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText) || + grammarErrorOnNode(node, Diagnostics.Type_expected_0_is_a_reserved_word_in_strict_mode, nameText); + return errorReport; + } + return false; + } + function checkGrammarDecorators(node: Node): boolean { if (!node.decorators) { return false; @@ -12104,6 +12352,10 @@ module ts { return grammarErrorOnNode(parameter.dotDotDotToken, Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); } + if (isBindingPattern(parameter.name)) { + return grammarErrorOnNode(parameter.name, Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); + } + if (parameter.questionToken) { return grammarErrorOnNode(parameter.questionToken, Diagnostics.A_rest_parameter_cannot_be_optional); } @@ -12352,7 +12604,7 @@ module ts { // Grammar checking for computedPropertName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop,(prop).questionToken, Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === SyntaxKind.NumericLiteral) { - checkGrammarNumbericLiteral(name); + checkGrammarNumericLiteral(name); } currentKind = Property; } @@ -12590,6 +12842,11 @@ module ts { if (node !== elements[elements.length - 1]) { return grammarErrorOnNode(node, Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); } + + if (node.name.kind === SyntaxKind.ArrayBindingPattern || node.name.kind === SyntaxKind.ObjectBindingPattern) { + return grammarErrorOnNode(node.name, Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); + } + if (node.initializer) { // Error on equals token which immediate precedes the initializer return grammarErrorAtPos(getSourceFileOfNode(node), node.initializer.pos - 1, 1, Diagnostics.A_rest_element_cannot_have_an_initializer); @@ -12775,19 +13032,23 @@ module ts { if (contextNode && (contextNode.parserContextFlags & ParserContextFlags.StrictMode) && isEvalOrArgumentsIdentifier(identifier)) { let nameText = declarationNameToString(identifier); - // 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 { + // We check first if the name is inside class declaration or class expression; if so give explicit message + // otherwise report generic error message. + // reportGrammarErrorInClassDeclaration only return true if grammar error is successfully reported and false otherwise + let reportErrorInClassDeclaration = reportStrictModeGrammarErrorInClassDeclaration(identifier, Diagnostics.Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode, nameText); + if (!reportErrorInClassDeclaration){ return grammarErrorOnNode(identifier, Diagnostics.Invalid_use_of_0_in_strict_mode, nameText); } + return reportErrorInClassDeclaration; } } } + function isEvalOrArgumentsIdentifier(node: Node): boolean { + return node.kind === SyntaxKind.Identifier && + ((node).text === "eval" || (node).text === "arguments"); + } + function checkGrammarConstructorTypeParameters(node: ConstructorDeclaration) { if (node.typeParameters) { return grammarErrorAtPos(getSourceFileOfNode(node), node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); @@ -12895,7 +13156,7 @@ module ts { } } - function checkGrammarNumbericLiteral(node: Identifier): boolean { + function checkGrammarNumericLiteral(node: Identifier): boolean { // Grammar checking if (node.flags & NodeFlags.OctalLiteral) { if (node.parserContextFlags & ParserContextFlags.StrictMode) { diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 48817798d81..8169421ca17 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -164,7 +164,6 @@ module ts { } ]; - /* @internal */ export function parseCommandLine(commandLine: string[]): ParsedCommandLine { var options: CompilerOptions = {}; var fileNames: string[] = []; diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 65c711475d6..80840068332 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -1,7 +1,7 @@ /// +/* @internal */ module ts { - // Ternary values are defined such that // x & y is False if either x or y is False. // x & y is Maybe if either x or y is Maybe, but neither x or y is False. @@ -659,10 +659,6 @@ module ts { "\u0085": "\\u0085" // nextLine }; - export function getDefaultLibFileName(options: CompilerOptions): string { - return options.target === ScriptTarget.ES6 ? "lib.es6.d.ts" : "lib.d.ts"; - } - export interface ObjectAllocator { getNodeConstructor(kind: SyntaxKind): new () => Node; getSymbolConstructor(): new (flags: SymbolFlags, name: string) => Symbol; diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index 7d41a72435f..3f613271ce1 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -1,7 +1,7 @@ /// +/* @internal */ module ts { - interface ModuleElementDeclarationEmitInfo { node: Node; outputPos: number; @@ -258,7 +258,7 @@ module ts { handleSymbolAccessibilityError(resolver.isSymbolAccessible(symbol, enclosingDeclaration, meaning)); } - function writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, type: TypeNode | StringLiteralExpression, getSymbolAccessibilityDiagnostic: GetSymbolAccessibilityDiagnostic) { + function writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, type: TypeNode, getSymbolAccessibilityDiagnostic: GetSymbolAccessibilityDiagnostic) { writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; write(": "); if (type) { @@ -314,12 +314,12 @@ module ts { } } - function emitTypeWithNewGetSymbolAccessibilityDiagnostic(type: TypeNode | EntityName | HeritageClauseElement, getSymbolAccessibilityDiagnostic: GetSymbolAccessibilityDiagnostic) { + function emitTypeWithNewGetSymbolAccessibilityDiagnostic(type: TypeNode | EntityName, getSymbolAccessibilityDiagnostic: GetSymbolAccessibilityDiagnostic) { writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; emitType(type); } - function emitType(type: TypeNode | StringLiteralExpression | Identifier | QualifiedName | HeritageClauseElement) { + function emitType(type: TypeNode | Identifier | QualifiedName) { switch (type.kind) { case SyntaxKind.AnyKeyword: case SyntaxKind.StringKeyword: @@ -442,20 +442,41 @@ module ts { emitLines(node.statements); } + // Return a temp variable name to be used in `export default` statements. + // The temp name will be of the form _default_counter. + // Note that export default is only allowed at most once in a module, so we + // do not need to keep track of created temp names. + function getExportDefaultTempVariableName(): string { + let baseName = "_default"; + if (!hasProperty(currentSourceFile.identifiers, baseName)) { + return baseName; + } + let count = 0; + while (true) { + let name = baseName + "_" + (++count); + if (!hasProperty(currentSourceFile.identifiers, name)) { + return name; + } + } + } + function emitExportAssignment(node: ExportAssignment) { - write(node.isExportEquals ? "export = " : "export default "); if (node.expression.kind === SyntaxKind.Identifier) { + write(node.isExportEquals ? "export = " : "export default "); writeTextOfNode(currentSourceFile, node.expression); } else { + // Expression + let tempVarName = getExportDefaultTempVariableName(); + write("declare var "); + write(tempVarName); write(": "); - if (node.type) { - emitType(node.type); - } - else { - writer.getSymbolAccessibilityDiagnostic = getDefaultExportAccessibilityDiagnostic; - resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); - } + writer.getSymbolAccessibilityDiagnostic = getDefaultExportAccessibilityDiagnostic; + resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); + write(";"); + writeLine(); + write(node.isExportEquals ? "export = " : "export default "); + write(tempVarName); } write(";"); writeLine(); @@ -1105,7 +1126,7 @@ module ts { writeLine(); } - function getTypeAnnotationFromAccessor(accessor: AccessorDeclaration): TypeNode | StringLiteralExpression { + function getTypeAnnotationFromAccessor(accessor: AccessorDeclaration): TypeNode { if (accessor) { return accessor.kind === SyntaxKind.GetAccessor ? accessor.type // Getter - return type @@ -1540,7 +1561,7 @@ module ts { } } - // @internal + /* @internal */ export function writeDeclarationFile(jsFilePath: string, sourceFile: SourceFile, host: EmitHost, resolver: EmitResolver, diagnostics: Diagnostic[]) { let emitDeclarationResult = emitDeclarations(host, resolver, diagnostics, jsFilePath, sourceFile); // TODO(shkamat): Should we not write any declaration file if any of them can produce error, diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 5062be5ed46..f3e9c325da6 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -1,5 +1,6 @@ // /// +/* @internal */ module ts { export var Diagnostics = { Unterminated_string_literal: { code: 1002, category: DiagnosticCategory.Error, key: "Unterminated string literal." }, @@ -158,7 +159,6 @@ module ts { An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: { code: 1198, category: DiagnosticCategory.Error, key: "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive." }, Unterminated_Unicode_escape_sequence: { code: 1199, category: DiagnosticCategory.Error, key: "Unterminated Unicode escape sequence." }, Line_terminator_not_permitted_before_arrow: { code: 1200, category: 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: 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: DiagnosticCategory.Error, key: "Import assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'import * as ns from \"mod\"', 'import {a} from \"mod\"' or 'import d from \"mod\"' instead." }, Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead: { code: 1203, category: DiagnosticCategory.Error, key: "Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead." }, Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher: { code: 1204, category: DiagnosticCategory.Error, key: "Cannot compile external modules into amd or commonjs when targeting es6 or higher." }, @@ -169,6 +169,12 @@ module ts { Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided: { code: 1209, category: DiagnosticCategory.Error, key: "Ambient const enums are not allowed when the '--separateCompilation' flag is provided." }, Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: DiagnosticCategory.Error, key: "Invalid use of '{0}'. Class definitions are automatically in strict mode." }, A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: DiagnosticCategory.Error, key: "A class declaration without the 'default' modifier must have a name" }, + Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode" }, + Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1213, category: DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, + Identifier_expected_0_is_a_reserved_word_in_strict_mode_External_Module_is_automatically_in_strict_mode: { code: 1214, category: DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. External Module is automatically in strict mode." }, + Type_expected_0_is_a_reserved_word_in_strict_mode: { code: 1215, category: DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode" }, + Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1216, category: DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, + Type_expected_0_is_a_reserved_word_in_strict_mode_Module_is_automatically_in_strict_mode: { code: 1217, category: DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Module is automatically in strict mode." }, 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." }, @@ -352,11 +358,12 @@ module ts { Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: { code: 2493, category: 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: DiagnosticCategory.Error, key: "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher." }, Type_0_is_not_an_array_type_or_a_string_type: { code: 2495, category: DiagnosticCategory.Error, key: "Type '{0}' is not an array type or a string type." }, - The_arguments_object_cannot_be_referenced_in_an_arrow_function_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." }, + The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression: { code: 2496, category: DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression." }, External_module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct: { code: 2497, category: DiagnosticCategory.Error, key: "External module '{0}' resolves to a non-module entity and cannot be imported using this construct." }, External_module_0_uses_export_and_cannot_be_used_with_export_Asterisk: { code: 2498, category: DiagnosticCategory.Error, key: "External module '{0}' uses 'export =' and cannot be used with 'export *'." }, An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments: { code: 2499, category: DiagnosticCategory.Error, key: "An interface can only extend an identifier/qualified-name with optional type arguments." }, A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments: { code: 2500, category: DiagnosticCategory.Error, key: "A class can only implement an identifier/qualified-name with optional type arguments." }, + A_rest_element_cannot_contain_a_binding_pattern: { code: 2501, category: DiagnosticCategory.Error, key: "A rest element cannot contain a binding pattern." }, 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}'." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 4476b0cad4a..61ce23c316b 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -623,10 +623,6 @@ "category": "Error", "code": 1200 }, - "A type annotation on an export statement is only allowed in an ambient external module declaration.": { - "category": "Error", - "code": 1201 - }, "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.": { "category": "Error", "code": 1202 @@ -661,12 +657,36 @@ }, "Invalid use of '{0}'. Class definitions are automatically in strict mode.": { "category": "Error", - "code": 1210 + "code": 1210 }, "A class declaration without the 'default' modifier must have a name": { "category": "Error", "code": 1211 }, + "Identifier expected. '{0}' is a reserved word in strict mode": { + "category": "Error", + "code": 1212 + }, + "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode.": { + "category": "Error", + "code": 1213 + }, + "Identifier expected. '{0}' is a reserved word in strict mode. External Module is automatically in strict mode.": { + "category": "Error", + "code": 1214 + }, + "Type expected. '{0}' is a reserved word in strict mode": { + "category": "Error", + "code": 1215 + }, + "Type expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode.": { + "category": "Error", + "code": 1216 + }, + "Type expected. '{0}' is a reserved word in strict mode. Module is automatically in strict mode.": { + "category": "Error", + "code": 1217 + }, "Duplicate identifier '{0}'.": { "category": "Error", "code": 2300 @@ -1399,7 +1419,7 @@ "category": "Error", "code": 2495 }, - "The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.": { + "The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.": { "category": "Error", "code": 2496 }, @@ -1419,6 +1439,10 @@ "category": "Error", "code": 2500 }, + "A rest element cannot contain a binding pattern.": { + "category": "Error", + "code": 2501 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", @@ -2023,19 +2047,19 @@ }, "'import ... =' can only be used in a .ts file.": { "category": "Error", - "code": 8002 + "code": 8002 }, "'export=' can only be used in a .ts file.": { "category": "Error", - "code": 8003 + "code": 8003 }, "'type parameter declarations' can only be used in a .ts file.": { "category": "Error", - "code": 8004 + "code": 8004 }, "'implements clauses' can only be used in a .ts file.": { "category": "Error", - "code": 8005 + "code": 8005 }, "'interface declarations' can only be used in a .ts file.": { "category": "Error", diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 940edf04191..226c682d2d7 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -1,6 +1,7 @@ /// /// +/* @internal */ module ts { // represents one LexicalEnvironment frame to store unique generated names interface ScopeFrame { @@ -20,7 +21,6 @@ module ts { _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 @@ -1097,6 +1097,7 @@ var __param = this.__param || function(index, decorator) { return function (targ default: return Comparison.LessThan; } + case SyntaxKind.YieldExpression: case SyntaxKind.ConditionalExpression: return Comparison.LessThan; default: @@ -1305,6 +1306,17 @@ var __param = this.__param || function(index, decorator) { return function (targ emit((node).expression); } + function emitYieldExpression(node: YieldExpression) { + write(tokenToString(SyntaxKind.YieldKeyword)); + if (node.asteriskToken) { + write("*"); + } + if (node.expression) { + write(" "); + emit(node.expression); + } + } + function needsParenthesisForPropertyAccessOrInvocation(node: Expression) { switch (node.kind) { case SyntaxKind.Identifier: @@ -1577,23 +1589,40 @@ var __param = this.__param || function(index, decorator) { return function (targ return result; } - function createPropertyAccessExpression(expression: LeftHandSideExpression, name: Identifier): PropertyAccessExpression { + function createPropertyAccessExpression(expression: Expression, name: Identifier): PropertyAccessExpression { let result = createSynthesizedNode(SyntaxKind.PropertyAccessExpression); - result.expression = expression; + result.expression = parenthesizeForAccess(expression); result.dotToken = createSynthesizedNode(SyntaxKind.DotToken); result.name = name; return result; - } + } - function createElementAccessExpression(expression: LeftHandSideExpression, argumentExpression: Expression): ElementAccessExpression { + function createElementAccessExpression(expression: Expression, argumentExpression: Expression): ElementAccessExpression { let result = createSynthesizedNode(SyntaxKind.ElementAccessExpression); - result.expression = expression; + result.expression = parenthesizeForAccess(expression); result.argumentExpression = argumentExpression; return result; } + function parenthesizeForAccess(expr: Expression): LeftHandSideExpression { + // isLeftHandSideExpression is almost the correct criterion for when it is not necessary + // to parenthesize the expression before a dot. The known exceptions are: + // + // NewExpression: + // new C.x -> not the same as (new C).x + // NumberLiteral + // 1.x -> not the same as (1).x + // + if (isLeftHandSideExpression(expr) && expr.kind !== SyntaxKind.NewExpression && expr.kind !== SyntaxKind.NumericLiteral) { + return expr; + } + let node = createSynthesizedNode(SyntaxKind.ParenthesizedExpression); + node.expression = expr; + return node; + } + function emitComputedPropertyName(node: ComputedPropertyName) { write("["); emitExpressionForPropertyName(node); @@ -1601,6 +1630,10 @@ var __param = this.__param || function(index, decorator) { return function (targ } function emitMethod(node: MethodDeclaration) { + if (languageVersion >= ScriptTarget.ES6 && node.asteriskToken) { + write("*"); + } + emit(node.name, /*allowGeneratedIdentifiers*/ false); if (languageVersion < ScriptTarget.ES6) { write(": function "); @@ -2260,7 +2293,7 @@ var __param = this.__param || function(index, decorator) { return function (targ if (node.initializer.kind === SyntaxKind.ArrayLiteralExpression || node.initializer.kind === SyntaxKind.ObjectLiteralExpression) { // This is a destructuring pattern, so call emitDestructuring instead of emit. Calling emit will not work, because it will cause // the BinaryExpression to be passed in instead of the expression statement, which will cause emitDestructuring to crash. - emitDestructuring(assignmentExpression, /*isAssignmentExpressionStatement*/ true, /*value*/ undefined, /*locationForCheckingExistingName*/ node); + emitDestructuring(assignmentExpression, /*isAssignmentExpressionStatement*/ true, /*value*/ undefined); } else { emitNodeWithoutSourceMap(assignmentExpression); @@ -2436,7 +2469,11 @@ var __param = this.__param || function(index, decorator) { return function (targ writeLine(); emitStart(node); if (node.flags & NodeFlags.Default) { - write("exports.default"); + if (languageVersion === ScriptTarget.ES3) { + write("exports[\"default\"]"); + } else { + write("exports.default"); + } } else { emitModuleMemberName(node); @@ -2464,16 +2501,7 @@ var __param = this.__param || function(index, decorator) { return function (targ } } - /** - * If the root has a chance of being a synthesized node, callers should also pass a value for - * lowestNonSynthesizedAncestor. This should be an ancestor of root, it should not be synthesized, - * and there should not be a lower ancestor that introduces a scope. This node will be used as the - * location for ensuring that temporary names are unique. - */ - function emitDestructuring(root: BinaryExpression | VariableDeclaration | ParameterDeclaration, - isAssignmentExpressionStatement: boolean, - value?: Expression, - lowestNonSynthesizedAncestor?: Node) { + function emitDestructuring(root: BinaryExpression | VariableDeclaration | ParameterDeclaration, isAssignmentExpressionStatement: boolean, value?: Expression) { let emitCount = 0; // An exported declaration is actually emitted as an assignment (to a property on the module object), so // temporary variables in an exported declaration need to have real declarations elsewhere @@ -2504,9 +2532,6 @@ var __param = this.__param || function(index, decorator) { return function (targ function ensureIdentifier(expr: Expression): Expression { if (expr.kind !== SyntaxKind.Identifier) { - // 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(TempFlags.Auto); if (!isDeclaration) { recordTempDeclaration(identifier); @@ -2545,27 +2570,22 @@ var __param = this.__param || function(index, decorator) { return function (targ return node; } - function parenthesizeForAccess(expr: Expression): LeftHandSideExpression { - if (expr.kind === SyntaxKind.Identifier || expr.kind === SyntaxKind.PropertyAccessExpression || expr.kind === SyntaxKind.ElementAccessExpression) { - return expr; - } - let node = createSynthesizedNode(SyntaxKind.ParenthesizedExpression); - node.expression = expr; - return node; - } - - function createPropertyAccess(object: Expression, propName: Identifier): Expression { + function createPropertyAccessForDestructuringProperty(object: Expression, propName: Identifier | LiteralExpression): Expression { if (propName.kind !== SyntaxKind.Identifier) { - return createElementAccess(object, propName); + return createElementAccessExpression(object, propName); } - return createPropertyAccessExpression(parenthesizeForAccess(object), propName); + + return createPropertyAccessExpression(object, propName); } - function createElementAccess(object: Expression, index: Expression): Expression { - let node = createSynthesizedNode(SyntaxKind.ElementAccessExpression); - node.expression = parenthesizeForAccess(object); - node.argumentExpression = index; - return node; + function createSliceCall(value: Expression, sliceIndex: number): CallExpression { + let call = createSynthesizedNode(SyntaxKind.CallExpression); + let sliceIdentifier = createSynthesizedNode(SyntaxKind.Identifier); + sliceIdentifier.text = "slice"; + call.expression = createPropertyAccessExpression(value, sliceIdentifier); + call.arguments = >createSynthesizedNodeArray(); + call.arguments[0] = createNumericLiteral(sliceIndex); + return call; } function emitObjectLiteralAssignment(target: ObjectLiteralExpression, value: Expression) { @@ -2578,8 +2598,8 @@ var __param = this.__param || function(index, decorator) { return function (targ for (let p of properties) { if (p.kind === SyntaxKind.PropertyAssignment || p.kind === SyntaxKind.ShorthandPropertyAssignment) { // TODO(andersh): Computed property support - let propName = ((p).name); - emitDestructuringAssignment((p).initializer || propName, createPropertyAccess(value, propName)); + let propName = ((p).name); + emitDestructuringAssignment((p).initializer || propName, createPropertyAccessForDestructuringProperty(value, propName)); } } } @@ -2595,14 +2615,10 @@ var __param = this.__param || function(index, decorator) { return function (targ let e = elements[i]; if (e.kind !== SyntaxKind.OmittedExpression) { if (e.kind !== SyntaxKind.SpreadElementExpression) { - emitDestructuringAssignment(e, createElementAccess(value, createNumericLiteral(i))); + emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i))); } - else { - if (i === elements.length - 1) { - value = ensureIdentifier(value); - emitAssignment((e).expression, value); - write(".slice(" + i + ")"); - } + else if (i === elements.length - 1) { + emitDestructuringAssignment((e).expression, createSliceCall(value, i)); } } } @@ -2666,19 +2682,15 @@ var __param = this.__param || function(index, decorator) { return function (targ if (pattern.kind === SyntaxKind.ObjectBindingPattern) { // Rewrite element to a declaration with an initializer that fetches property let propName = element.propertyName || element.name; - emitBindingElement(element, createPropertyAccess(value, propName)); + emitBindingElement(element, createPropertyAccessForDestructuringProperty(value, propName)); } else if (element.kind !== SyntaxKind.OmittedExpression) { if (!element.dotDotDotToken) { // Rewrite element to a declaration that accesses array element at index i - emitBindingElement(element, createElementAccess(value, createNumericLiteral(i))); + emitBindingElement(element, createElementAccessExpression(value, createNumericLiteral(i))); } - else { - if (i === elements.length - 1) { - value = ensureIdentifier(value); - emitAssignment(element.name, value); - write(".slice(" + i + ")"); - } + else if (i === elements.length - 1) { + emitBindingElement(element, createSliceCall(value, i)); } } } @@ -2846,6 +2858,12 @@ var __param = this.__param || function(index, decorator) { return function (targ if (languageVersion < ScriptTarget.ES6) { let tempIndex = 0; forEach(node.parameters, p => { + // A rest parameter cannot have a binding pattern or an initializer, + // so let's just ignore it. + if (p.dotDotDotToken) { + return; + } + if (isBindingPattern(p.name)) { writeLine(); write("var "); @@ -2876,6 +2894,12 @@ var __param = this.__param || function(index, decorator) { return function (targ if (languageVersion < ScriptTarget.ES6 && hasRestParameters(node)) { let restIndex = node.parameters.length - 1; let restParam = node.parameters[restIndex]; + + // A rest parameter cannot have a binding pattern, so let's just ignore it if it does. + if (isBindingPattern(restParam.name)) { + return; + } + let tempName = createTempVariable(TempFlags._i).text; writeLine(); emitLeadingComments(restParam); @@ -2960,7 +2984,12 @@ var __param = this.__param || function(index, decorator) { return function (targ write("default "); } } - write("function "); + + write("function"); + if (languageVersion >= ScriptTarget.ES6 && node.asteriskToken) { + write("*"); + } + write(" "); } if (shouldEmitFunctionName(node)) { @@ -3344,6 +3373,9 @@ var __param = this.__param || function(index, decorator) { return function (targ else if (member.kind === SyntaxKind.SetAccessor) { write("set "); } + if ((member).asteriskToken) { + write("*"); + } emit((member).name); emitSignatureAndBody(member); emitEnd(member); @@ -4183,6 +4215,10 @@ var __param = this.__param || function(index, decorator) { return function (targ return isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation); } + function isModuleMergedWithES6Class(node: ModuleDeclaration) { + return languageVersion === ScriptTarget.ES6 && !!(resolver.getNodeCheckFlags(node) & NodeCheckFlags.LexicalModuleMergesWithClass); + } + function emitModuleDeclaration(node: ModuleDeclaration) { // Emit only if this module is non-ambient. let shouldEmit = shouldEmitModuleDeclaration(node); @@ -4191,15 +4227,19 @@ var __param = this.__param || function(index, decorator) { return function (targ return emitOnlyPinnedOrTripleSlashComments(node); } - emitStart(node); - if (isES6ExportedDeclaration(node)) { - write("export "); + if (!isModuleMergedWithES6Class(node)) { + emitStart(node); + if (isES6ExportedDeclaration(node)) { + write("export "); + } + + write("var "); + emit(node.name); + write(";"); + emitEnd(node); + writeLine(); } - write("var "); - emit(node.name); - write(";"); - emitEnd(node); - writeLine(); + emitStart(node); write("(function ("); emitStart(node.name); @@ -4524,7 +4564,11 @@ var __param = this.__param || function(index, decorator) { return function (targ writeLine(); emitStart(node); emitContainingModuleName(node); - write(".default = "); + if (languageVersion === ScriptTarget.ES3) { + write("[\"default\"] = "); + } else { + write(".default = "); + } emit(node.expression); write(";"); emitEnd(node); @@ -4585,19 +4629,6 @@ var __param = this.__param || function(index, decorator) { return function (targ } } - function sortAMDModules(amdModules: {name: string; path: string}[]) { - // AMD modules with declared variable names go first - return amdModules.sort((moduleA, moduleB) => { - if (moduleA.name === moduleB.name) { - return 0; - } else if (!moduleA.name) { - return 1; - } else { - return -1; - } - }); - } - function emitExportStarHelper() { if (hasExportStars) { writeLine(); @@ -4613,44 +4644,83 @@ var __param = this.__param || function(index, decorator) { return function (targ function emitAMDModule(node: SourceFile, startIndex: number) { collectExternalModuleInfo(node); + + // An AMD define function has the following shape: + // define(id?, dependencies?, factory); + // + // This has the shape of + // define(name, ["module1", "module2"], function (module1Alias) { + // The location of the alias in the parameter list in the factory function needs to + // match the position of the module name in the dependency list. + // + // To ensure this is true in cases of modules with no aliases, e.g.: + // `import "module"` or `` + // we need to add modules without alias names to the end of the dependencies list + + let aliasedModuleNames: string[] = []; // names of modules with corresponding parameter in the + // factory function. + let unaliasedModuleNames: string[] = []; // names of modules with no corresponding parameters in + // factory function. + let importAliasNames: string[] = []; // names of the parameters in the factory function; these + // paramters need to match the indexes of the corresponding + // module names in aliasedModuleNames. + + // Fill in amd-dependency tags + for (let amdDependency of node.amdDependencies) { + if (amdDependency.name) { + aliasedModuleNames.push("\"" + amdDependency.path + "\""); + importAliasNames.push(amdDependency.name); + } + else { + unaliasedModuleNames.push("\"" + amdDependency.path + "\""); + } + } + + for (let importNode of externalImports) { + // Find the name of the external module + let externalModuleName = ""; + let moduleName = getExternalModuleName(importNode); + if (moduleName.kind === SyntaxKind.StringLiteral) { + externalModuleName = getLiteralText(moduleName); + } + + // Find the name of the module alais, if there is one + let importAliasName: string; + let namespaceDeclaration = getNamespaceDeclarationNode(importNode); + if (namespaceDeclaration && !isDefaultImport(importNode)) { + importAliasName = getSourceTextOfNodeFromSourceFile(currentSourceFile, namespaceDeclaration.name); + } + else { + importAliasName = getGeneratedNameForNode(importNode); + } + + if (importAliasName) { + aliasedModuleNames.push(externalModuleName); + importAliasNames.push(importAliasName); + } + else { + unaliasedModuleNames.push(externalModuleName); + } + } + writeLine(); write("define("); - sortAMDModules(node.amdDependencies); if (node.amdModuleName) { write("\"" + node.amdModuleName + "\", "); } write("[\"require\", \"exports\""); - for (let importNode of externalImports) { + if (aliasedModuleNames.length) { write(", "); - let moduleName = getExternalModuleName(importNode); - if (moduleName.kind === SyntaxKind.StringLiteral) { - emitLiteral(moduleName); - } - else { - write("\"\""); - } + write(aliasedModuleNames.join(", ")); } - for (let amdDependency of node.amdDependencies) { - let text = "\"" + amdDependency.path + "\""; + if (unaliasedModuleNames.length) { write(", "); - write(text); + write(unaliasedModuleNames.join(", ")); } write("], function (require, exports"); - for (let importNode of externalImports) { + if (importAliasNames.length) { write(", "); - let namespaceDeclaration = getNamespaceDeclarationNode(importNode); - if (namespaceDeclaration && !isDefaultImport(importNode)) { - emit(namespaceDeclaration.name); - } - else { - write(getGeneratedNameForNode(importNode)); - } - } - for (let amdDependency of node.amdDependencies) { - if (amdDependency.name) { - write(", "); - write(amdDependency.name); - } + write(importAliasNames.join(", ")); } write(") {"); increaseIndent(); @@ -4922,6 +4992,8 @@ var __param = this.__param || function(index, decorator) { return function (targ return emitConditionalExpression(node); case SyntaxKind.SpreadElementExpression: return emitSpreadElementExpression(node); + case SyntaxKind.YieldExpression: + return emitYieldExpression(node); case SyntaxKind.OmittedExpression: return; case SyntaxKind.Block: diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index bde4cec3f3f..6ad38ac73c1 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -299,8 +299,7 @@ module ts { case SyntaxKind.ExportAssignment: return visitNodes(cbNodes, node.decorators) || visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, (node).expression) || - visitNode(cbNode, (node).type); + visitNode(cbNode, (node).expression); case SyntaxKind.TemplateExpression: return visitNode(cbNode, (node).head) || visitNodes(cbNodes, (node).templateSpans); case SyntaxKind.TemplateSpan: @@ -319,452 +318,12 @@ module ts { } } - const enum ParsingContext { - SourceElements, // Elements in source file - ModuleElements, // Elements in module declaration - BlockStatements, // Statements in block - SwitchClauses, // Clauses in switch statement - SwitchClauseStatements, // Statements in switch clause - TypeMembers, // Members in interface or type literal - ClassMembers, // Members in class declaration - EnumMembers, // Members in enum declaration - 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 - ArgumentExpressions, // Expressions in argument list - ObjectLiteralMembers, // Members in object literal - ArrayLiteralMembers, // Members in array literal - Parameters, // Parameters in parameter list - TypeParameters, // Type parameters in type parameter list - TypeArguments, // Type arguments in type argument list - TupleElementTypes, // Element types in tuple element type list - HeritageClauses, // Heritage clauses for a class or interface declaration. - ImportOrExportSpecifiers, // Named import clause's import specifier list - Count // Number of parsing contexts - } + export function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes = false): SourceFile { + let start = new Date().getTime(); + let result = Parser.parseSourceFile(fileName, sourceText, languageVersion, /*syntaxCursor*/ undefined, setParentNodes); - const enum Tristate { - False, - True, - Unknown - } - - function parsingContextErrors(context: ParsingContext): DiagnosticMessage { - switch (context) { - case ParsingContext.SourceElements: return Diagnostics.Declaration_or_statement_expected; - case ParsingContext.ModuleElements: return Diagnostics.Declaration_or_statement_expected; - case ParsingContext.BlockStatements: return Diagnostics.Statement_expected; - case ParsingContext.SwitchClauses: return Diagnostics.case_or_default_expected; - case ParsingContext.SwitchClauseStatements: return Diagnostics.Statement_expected; - 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.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; - case ParsingContext.ArgumentExpressions: return Diagnostics.Argument_expression_expected; - case ParsingContext.ObjectLiteralMembers: return Diagnostics.Property_assignment_expected; - case ParsingContext.ArrayLiteralMembers: return Diagnostics.Expression_or_comma_expected; - case ParsingContext.Parameters: return Diagnostics.Parameter_declaration_expected; - case ParsingContext.TypeParameters: return Diagnostics.Type_parameter_declaration_expected; - case ParsingContext.TypeArguments: return Diagnostics.Type_argument_expected; - case ParsingContext.TupleElementTypes: return Diagnostics.Type_expected; - case ParsingContext.HeritageClauses: return Diagnostics.Unexpected_token_expected; - case ParsingContext.ImportOrExportSpecifiers: return Diagnostics.Identifier_expected; - } - }; - - export function modifierToFlag(token: SyntaxKind): NodeFlags { - switch (token) { - case SyntaxKind.StaticKeyword: return NodeFlags.Static; - case SyntaxKind.PublicKeyword: return NodeFlags.Public; - case SyntaxKind.ProtectedKeyword: return NodeFlags.Protected; - case SyntaxKind.PrivateKeyword: return NodeFlags.Private; - case SyntaxKind.ExportKeyword: return NodeFlags.Export; - case SyntaxKind.DeclareKeyword: return NodeFlags.Ambient; - case SyntaxKind.ConstKeyword: return NodeFlags.Const; - case SyntaxKind.DefaultKeyword: return NodeFlags.Default; - } - return 0; - } - - function fixupParentReferences(sourceFile: 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. - - let parent: Node = sourceFile; - forEachChild(sourceFile, visitNode); - return; - - function visitNode(n: Node): void { - // walk down setting parents that differ from the parent we think it should be. This - // allows us to quickly bail out of setting parents for subtrees during incremental - // parsing - if (n.parent !== parent) { - n.parent = parent; - - let saveParent = parent; - parent = n; - forEachChild(n, visitNode); - parent = saveParent; - } - } - } - - function shouldCheckNode(node: Node) { - switch (node.kind) { - case SyntaxKind.StringLiteral: - case SyntaxKind.NumericLiteral: - case SyntaxKind.Identifier: - return true; - } - - return false; - } - - function moveElementEntirelyPastChangeRange(element: IncrementalElement, isArray: boolean, delta: number, oldText: string, newText: string, aggressiveChecks: boolean) { - if (isArray) { - visitArray(element); - } - else { - visitNode(element); - } - return; - - function visitNode(node: IncrementalNode) { - if (aggressiveChecks && shouldCheckNode(node)) { - var text = oldText.substring(node.pos, node.end); - } - - // Ditch any existing LS children we may have created. This way we can avoid - // moving them forward. - node._children = undefined; - node.pos += delta; - node.end += delta; - - if (aggressiveChecks && shouldCheckNode(node)) { - Debug.assert(text === newText.substring(node.pos, node.end)); - } - - forEachChild(node, visitNode, visitArray); - checkNodePositions(node, aggressiveChecks); - } - - function visitArray(array: IncrementalNodeArray) { - array._children = undefined; - array.pos += delta; - array.end += delta; - - for (let node of array) { - visitNode(node); - } - } - } - - function adjustIntersectingElement(element: IncrementalElement, changeStart: number, changeRangeOldEnd: number, changeRangeNewEnd: number, delta: number) { - Debug.assert(element.end >= changeStart, "Adjusting an element that was entirely before the change range"); - Debug.assert(element.pos <= changeRangeOldEnd, "Adjusting an element that was entirely after the change range"); - Debug.assert(element.pos <= element.end); - - // We have an element that intersects the change range in some way. It may have its - // start, or its end (or both) in the changed range. We want to adjust any part - // that intersects such that the final tree is in a consistent state. i.e. all - // chlidren have spans within the span of their parent, and all siblings are ordered - // properly. - - // We may need to update both the 'pos' and the 'end' of the element. - - // If the 'pos' is before the start of the change, then we don't need to touch it. - // If it isn't, then the 'pos' must be inside the change. How we update it will - // depend if delta is positive or negative. If delta is positive then we have - // something like: - // - // -------------------AAA----------------- - // -------------------BBBCCCCCCC----------------- - // - // In this case, we consider any node that started in the change range to still be - // starting at the same position. - // - // however, if the delta is negative, then we instead have something like this: - // - // -------------------XXXYYYYYYY----------------- - // -------------------ZZZ----------------- - // - // In this case, any element that started in the 'X' range will keep its position. - // However any element htat started after that will have their pos adjusted to be - // at the end of the new range. i.e. any node that started in the 'Y' range will - // be adjusted to have their start at the end of the 'Z' range. - // - // The element will keep its position if possible. Or Move backward to the new-end - // if it's in the 'Y' range. - element.pos = Math.min(element.pos, changeRangeNewEnd); - - // If the 'end' is after the change range, then we always adjust it by the delta - // amount. However, if the end is in the change range, then how we adjust it - // will depend on if delta is positive or negative. If delta is positive then we - // have something like: - // - // -------------------AAA----------------- - // -------------------BBBCCCCCCC----------------- - // - // In this case, we consider any node that ended inside the change range to keep its - // end position. - // - // however, if the delta is negative, then we instead have something like this: - // - // -------------------XXXYYYYYYY----------------- - // -------------------ZZZ----------------- - // - // In this case, any element that ended in the 'X' range will keep its position. - // However any element htat ended after that will have their pos adjusted to be - // at the end of the new range. i.e. any node that ended in the 'Y' range will - // be adjusted to have their end at the end of the 'Z' range. - if (element.end >= changeRangeOldEnd) { - // Element ends after the change range. Always adjust the end pos. - element.end += delta; - } - else { - // Element ends in the change range. The element will keep its position if - // possible. Or Move backward to the new-end if it's in the 'Y' range. - element.end = Math.min(element.end, changeRangeNewEnd); - } - - Debug.assert(element.pos <= element.end); - if (element.parent) { - Debug.assert(element.pos >= element.parent.pos); - Debug.assert(element.end <= element.parent.end); - } - } - - function checkNodePositions(node: Node, aggressiveChecks: boolean) { - if (aggressiveChecks) { - let pos = node.pos; - forEachChild(node, child => { - Debug.assert(child.pos >= pos); - pos = child.end; - }); - Debug.assert(pos <= node.end); - } - } - - function updateTokenPositionsAndMarkElements( - sourceFile: IncrementalNode, - changeStart: number, - changeRangeOldEnd: number, - changeRangeNewEnd: number, - delta: number, - oldText: string, - newText: string, - aggressiveChecks: boolean): void { - - visitNode(sourceFile); - return; - - function visitNode(child: IncrementalNode) { - Debug.assert(child.pos <= child.end); - if (child.pos > changeRangeOldEnd) { - // Node is entirely past the change range. We need to move both its pos and - // end, forward or backward appropriately. - moveElementEntirelyPastChangeRange(child, /*isArray:*/ false, delta, oldText, newText, aggressiveChecks); - return; - } - - // Check if the element intersects the change range. If it does, then it is not - // reusable. Also, we'll need to recurse to see what constituent portions we may - // be able to use. - let fullEnd = child.end; - if (fullEnd >= changeStart) { - child.intersectsChange = true; - child._children = undefined; - - // Adjust the pos or end (or both) of the intersecting element accordingly. - adjustIntersectingElement(child, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - forEachChild(child, visitNode, visitArray); - - checkNodePositions(child, aggressiveChecks); - return; - } - - // Otherwise, the node is entirely before the change range. No need to do anything with it. - Debug.assert(fullEnd < changeStart); - } - - function visitArray(array: IncrementalNodeArray) { - Debug.assert(array.pos <= array.end); - if (array.pos > changeRangeOldEnd) { - // Array is entirely after the change range. We need to move it, and move any of - // its children. - moveElementEntirelyPastChangeRange(array, /*isArray:*/ true, delta, oldText, newText, aggressiveChecks); - return; - } - - // Check if the element intersects the change range. If it does, then it is not - // reusable. Also, we'll need to recurse to see what constituent portions we may - // be able to use. - let fullEnd = array.end; - if (fullEnd >= changeStart) { - array.intersectsChange = true; - array._children = undefined; - - // Adjust the pos or end (or both) of the intersecting array accordingly. - adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - for (let node of array) { - visitNode(node); - } - return; - } - - // Otherwise, the array is entirely before the change range. No need to do anything with it. - Debug.assert(fullEnd < changeStart); - } - } - - function extendToAffectedRange(sourceFile: SourceFile, changeRange: TextChangeRange): TextChangeRange { - // Consider the following code: - // void foo() { /; } - // - // If the text changes with an insertion of / just before the semicolon then we end up with: - // void foo() { //; } - // - // If we were to just use the changeRange a is, then we would not rescan the { token - // (as it does not intersect the actual original change range). Because an edit may - // change the token touching it, we actually need to look back *at least* one token so - // that the prior token sees that change. - let maxLookahead = 1; - - let start = changeRange.span.start; - - // the first iteration aligns us with the change start. subsequent iteration move us to - // the left by maxLookahead tokens. We only need to do this as long as we're not at the - // start of the tree. - for (let i = 0; start > 0 && i <= maxLookahead; i++) { - let nearestNode = findNearestNodeStartingBeforeOrAtPosition(sourceFile, start); - Debug.assert(nearestNode.pos <= start); - let position = nearestNode.pos; - - start = Math.max(0, position - 1); - } - - let finalSpan = createTextSpanFromBounds(start, textSpanEnd(changeRange.span)); - let finalLength = changeRange.newLength + (changeRange.span.start - start); - - return createTextChangeRange(finalSpan, finalLength); - } - - function findNearestNodeStartingBeforeOrAtPosition(sourceFile: SourceFile, position: number): Node { - let bestResult: Node = sourceFile; - let lastNodeEntirelyBeforePosition: Node; - - forEachChild(sourceFile, visit); - - if (lastNodeEntirelyBeforePosition) { - let lastChildOfLastEntireNodeBeforePosition = getLastChild(lastNodeEntirelyBeforePosition); - if (lastChildOfLastEntireNodeBeforePosition.pos > bestResult.pos) { - bestResult = lastChildOfLastEntireNodeBeforePosition; - } - } - - return bestResult; - - function getLastChild(node: Node): Node { - while (true) { - let lastChild = getLastChildWorker(node); - if (lastChild) { - node = lastChild; - } - else { - return node; - } - } - } - - function getLastChildWorker(node: Node): Node { - let last: Node = undefined; - forEachChild(node, child => { - if (nodeIsPresent(child)) { - last = child; - } - }); - return last; - } - - function visit(child: Node) { - if (nodeIsMissing(child)) { - // Missing nodes are effectively invisible to us. We never even consider them - // When trying to find the nearest node before us. - return; - } - - // If the child intersects this position, then this node is currently the nearest - // node that starts before the position. - if (child.pos <= position) { - if (child.pos >= bestResult.pos) { - // This node starts before the position, and is closer to the position than - // the previous best node we found. It is now the new best node. - bestResult = child; - } - - // Now, the node may overlap the position, or it may end entirely before the - // position. If it overlaps with the position, then either it, or one of its - // children must be the nearest node before the position. So we can just - // recurse into this child to see if we can find something better. - if (position < child.end) { - // The nearest node is either this child, or one of the children inside - // of it. We've already marked this child as the best so far. Recurse - // in case one of the children is better. - forEachChild(child, visit); - - // Once we look at the children of this node, then there's no need to - // continue any further. - return true; - } - else { - Debug.assert(child.end <= position); - // The child ends entirely before this position. Say you have the following - // (where $ is the position) - // - // ? $ : <...> <...> - // - // We would want to find the nearest preceding node in "complex expr 2". - // To support that, we keep track of this node, and once we're done searching - // for a best node, we recurse down this node to see if we can find a good - // result in it. - // - // This approach allows us to quickly skip over nodes that are entirely - // before the position, while still allowing us to find any nodes in the - // last one that might be what we want. - lastNodeEntirelyBeforePosition = child; - } - } - else { - Debug.assert(child.pos > position); - // We're now at a node that is entirely past the position we're searching for. - // This node (and all following nodes) could never contribute to the result, - // so just skip them by returning 'true' here. - return true; - } - } - } - - function checkChangeRange(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks: boolean) { - let oldText = sourceFile.text; - if (textChangeRange) { - Debug.assert((oldText.length - textChangeRange.span.length + textChangeRange.newLength) === newText.length); - - if (aggressiveChecks || Debug.shouldAssert(AssertionLevel.VeryAggressive)) { - let oldTextPrefix = oldText.substr(0, textChangeRange.span.start); - let newTextPrefix = newText.substr(0, textChangeRange.span.start); - Debug.assert(oldTextPrefix === newTextPrefix); - - let oldTextSuffix = oldText.substring(textSpanEnd(textChangeRange.span), oldText.length); - let newTextSuffix = newText.substring(textSpanEnd(textChangeRangeNewSpan(textChangeRange)), newText.length); - Debug.assert(oldTextSuffix === newTextSuffix); - } - } + parseTime += new Date().getTime() - start; + return result; } // Produces a new SourceFile for the 'newText' provided. The 'textChangeRange' parameter @@ -777,256 +336,28 @@ module ts { // becoming detached from any SourceFile). It is recommended that this SourceFile not // be used once 'update' is called on it. export function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile { - aggressiveChecks = aggressiveChecks || Debug.shouldAssert(AssertionLevel.Aggressive); - - checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks); - if (textChangeRangeIsUnchanged(textChangeRange)) { - // if the text didn't change, then we can just return our current source file as-is. - return sourceFile; - } - - if (sourceFile.statements.length === 0) { - // If we don't have any statements in the current source file, then there's no real - // way to incrementally parse. So just do a full parse instead. - return parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, /*syntaxCursor*/ undefined, /*setNodeParents*/ true) - } - - // Make sure we're not trying to incrementally update a source file more than once. Once - // we do an update the original source file is considered unusbale from that point onwards. - // - // This is because we do incremental parsing in-place. i.e. we take nodes from the old - // tree and give them new positions and parents. From that point on, trusting the old - // tree at all is not possible as far too much of it may violate invariants. - let incrementalSourceFile = sourceFile; - Debug.assert(!incrementalSourceFile.hasBeenIncrementallyParsed); - incrementalSourceFile.hasBeenIncrementallyParsed = true; - - let oldText = sourceFile.text; - let syntaxCursor = createSyntaxCursor(sourceFile); - - // Make the actual change larger so that we know to reparse anything whose lookahead - // might have intersected the change. - let changeRange = extendToAffectedRange(sourceFile, textChangeRange); - checkChangeRange(sourceFile, newText, changeRange, aggressiveChecks); - - // Ensure that extending the affected range only moved the start of the change range - // earlier in the file. - Debug.assert(changeRange.span.start <= textChangeRange.span.start); - Debug.assert(textSpanEnd(changeRange.span) === textSpanEnd(textChangeRange.span)); - Debug.assert(textSpanEnd(textChangeRangeNewSpan(changeRange)) === textSpanEnd(textChangeRangeNewSpan(textChangeRange))); - - // The is the amount the nodes after the edit range need to be adjusted. It can be - // positive (if the edit added characters), negative (if the edit deleted characters) - // or zero (if this was a pure overwrite with nothing added/removed). - let delta = textChangeRangeNewSpan(changeRange).length - changeRange.span.length; - - // If we added or removed characters during the edit, then we need to go and adjust all - // the nodes after the edit. Those nodes may move forward (if we inserted chars) or they - // may move backward (if we deleted chars). - // - // Doing this helps us out in two ways. First, it means that any nodes/tokens we want - // 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 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 - // - // We will also adjust the positions of nodes that intersect the change range as well. - // By doing this, we ensure that all the positions in the old tree are consistent, not - // just the positions of nodes entirely before/after the change range. By being - // consistent, we can then easily map from positions to nodes in the old tree easily. - // - // Also, mark any syntax elements that intersect the changed span. We know, up front, - // that we cannot reuse these elements. - updateTokenPositionsAndMarkElements(incrementalSourceFile, - changeRange.span.start, textSpanEnd(changeRange.span), textSpanEnd(textChangeRangeNewSpan(changeRange)), delta, oldText, newText, aggressiveChecks); - - // Now that we've set up our internal incremental state just proceed and parse the - // source file in the normal fashion. When possible the parser will retrieve and - // reuse nodes from the old tree. - // - // Note: passing in 'true' for setNodeParents is very important. When incrementally - // parsing, we will be reusing nodes from the old tree, and placing it into new - // parents. If we don't set the parents now, we'll end up with an observably - // inconsistent tree. Setting the parents on the new tree should be very fast. We - // will immediately bail out of walking any subtrees when we can see that their parents - // are already correct. - let result = parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, /* setParentNode */ true) - - return result; + return IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks); } - export function isEvalOrArgumentsIdentifier(node: Node): boolean { - return node.kind === SyntaxKind.Identifier && - ((node).text === "eval" || (node).text === "arguments"); - } - - /// Should be called only on prologue directives (isPrologueDirective(node) should be true) - function isUseStrictPrologueDirective(sourceFile: SourceFile, node: Node): boolean { - Debug.assert(isPrologueDirective(node)); - let nodeText = getSourceTextOfNodeFromSourceFile(sourceFile,(node).expression); - - // Note: the node text must be exactly "use strict" or 'use strict'. It is not ok for the - // string to contain unicode escapes (as per ES5). - return nodeText === '"use strict"' || nodeText === "'use strict'"; - } - - interface IncrementalElement extends TextRange { - parent?: Node; - intersectsChange: boolean - length?: number; - _children: Node[]; - } - - interface IncrementalNode extends Node, IncrementalElement { - hasBeenIncrementallyParsed: boolean - } - - interface IncrementalNodeArray extends NodeArray, IncrementalElement { - length: number - } - - // Allows finding nodes in the source file at a certain position in an efficient manner. - // The implementation takes advantage of the calling pattern it knows the parser will - // make in order to optimize finding nodes as quickly as possible. - interface SyntaxCursor { - currentNode(position: number): IncrementalNode; - } - - const enum InvalidPosition { - Value = -1 - } - - function createSyntaxCursor(sourceFile: SourceFile): SyntaxCursor { - let currentArray: NodeArray = sourceFile.statements; - let currentArrayIndex = 0; - - Debug.assert(currentArrayIndex < currentArray.length); - let current = currentArray[currentArrayIndex]; - let lastQueriedPosition = InvalidPosition.Value; - - return { - currentNode(position: number) { - // Only compute the current node if the position is different than the last time - // we were asked. The parser commonly asks for the node at the same position - // twice. Once to know if can read an appropriate list element at a certain point, - // and then to actually read and consume the node. - if (position !== lastQueriedPosition) { - // Much of the time the parser will need the very next node in the array that - // we just returned a node from.So just simply check for that case and move - // forward in the array instead of searching for the node again. - if (current && current.end === position && currentArrayIndex < (currentArray.length - 1)) { - currentArrayIndex++; - current = currentArray[currentArrayIndex]; - } - - // If we don't have a node, or the node we have isn't in the right position, - // then try to find a viable node at the position requested. - if (!current || current.pos !== position) { - findHighestListElementThatStartsAtPosition(position); - } - } - - // Cache this query so that we don't do any extra work if the parser calls back - // into us. Note: this is very common as the parser will make pairs of calls like - // 'isListElement -> parseListElement'. If we were unable to find a node when - // called with 'isListElement', we don't want to redo the work when parseListElement - // is called immediately after. - lastQueriedPosition = position; - - // Either we don'd have a node, or we have a node at the position being asked for. - Debug.assert(!current || current.pos === position); - return current; - } - }; - - // Finds the highest element in the tree we can find that starts at the provided position. - // The element must be a direct child of some node list in the tree. This way after we - // return it, we can easily return its next sibling in the list. - function findHighestListElementThatStartsAtPosition(position: number) { - // Clear out any cached state about the last node we found. - currentArray = undefined; - currentArrayIndex = InvalidPosition.Value; - current = undefined; - - // Recurse into the source file to find the highest node at this position. - forEachChild(sourceFile, visitNode, visitArray); - return; - - function visitNode(node: Node) { - if (position >= node.pos && position < node.end) { - // Position was within this node. Keep searching deeper to find the node. - forEachChild(node, visitNode, visitArray); - - // don't procede any futher in the search. - return true; - } - - // position wasn't in this node, have to keep searching. - return false; - } - - function visitArray(array: NodeArray) { - if (position >= array.pos && position < array.end) { - // position was in this array. Search through this array to see if we find a - // viable element. - for (let i = 0, n = array.length; i < n; i++) { - let child = array[i]; - if (child) { - if (child.pos === position) { - // Found the right node. We're done. - currentArray = array; - currentArrayIndex = i; - current = child; - return true; - } - else { - if (child.pos < position && position < child.end) { - // Position in somewhere within this child. Search in it and - // stop searching in this array. - forEachChild(child, visitNode, visitArray); - return true; - } - } - } - } - } - - // position wasn't in this array, have to keep searching. - return false; - } - } - } - - export function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes = false): SourceFile { - let start = new Date().getTime(); - let result = parseSourceFile(fileName, sourceText, languageVersion, /*syntaxCursor*/ undefined, setParentNodes); - - parseTime += new Date().getTime() - start; - return result; - } - - function parseSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, syntaxCursor: SyntaxCursor, setParentNodes = false): SourceFile { + // Implement the parser as a singleton module. We do this for perf reasons because creating + // parser instances can actually be expensive enough to impact us on projects with many source + // files. + module Parser { + // Share a single scanner across all calls to parse a source file. This helps speed things + // up by avoiding the cost of creating/compiling scanners over and over again. + const scanner = createScanner(ScriptTarget.Latest, /*skipTrivia:*/ true); const disallowInAndDecoratorContext = ParserContextFlags.DisallowIn | ParserContextFlags.Decorator; - let parsingContext: ParsingContext = 0; - let identifiers: Map = {}; - let identifierCount = 0; - let nodeCount = 0; + let sourceFile: SourceFile; + let syntaxCursor: IncrementalParser.SyntaxCursor; + let token: SyntaxKind; + let sourceText: string; + let nodeCount: number; + let identifiers: Map; + let identifierCount: number; - let sourceFile = createNode(SyntaxKind.SourceFile, /*pos*/ 0); - - sourceFile.pos = 0; - sourceFile.end = sourceText.length; - sourceFile.text = sourceText; - - sourceFile.parseDiagnostics = []; - sourceFile.bindDiagnostics = []; - sourceFile.languageVersion = languageVersion; - sourceFile.fileName = normalizePath(fileName); - sourceFile.flags = fileExtensionIs(sourceFile.fileName, ".d.ts") ? NodeFlags.DeclarationFile : 0; + let parsingContext: ParsingContext; // Flags that dictate what parsing context we're in. For example: // Whether or not we are in strict parsing mode. All that changes in strict parsing mode is @@ -1105,28 +436,97 @@ module ts { // attached to the EOF token. let parseErrorBeforeNextFinishedNode: boolean = false; - // Create and prime the scanner before parsing the source elements. - let scanner = createScanner(languageVersion, /*skipTrivia*/ true, sourceText, scanError); - token = nextToken(); + export function parseSourceFile(fileName: string, _sourceText: string, languageVersion: ScriptTarget, _syntaxCursor: IncrementalParser.SyntaxCursor, setParentNodes?: boolean): SourceFile { + sourceText = _sourceText; + syntaxCursor = _syntaxCursor; - processReferenceComments(sourceFile); + parsingContext = 0; + identifiers = {}; + identifierCount = 0; + nodeCount = 0; - sourceFile.statements = parseList(ParsingContext.SourceElements, /*checkForStrictMode*/ true, parseSourceElement); - Debug.assert(token === SyntaxKind.EndOfFileToken); - sourceFile.endOfFileToken = parseTokenNode(); + contextFlags = 0; + parseErrorBeforeNextFinishedNode = false; - setExternalModuleIndicator(sourceFile); + createSourceFile(fileName, languageVersion); - sourceFile.nodeCount = nodeCount; - sourceFile.identifierCount = identifierCount; - sourceFile.identifiers = identifiers; + // Initialize and prime the scanner before parsing the source elements. + scanner.setText(sourceText); + scanner.setOnError(scanError); + scanner.setScriptTarget(languageVersion); + token = nextToken(); - if (setParentNodes) { - fixupParentReferences(sourceFile); + processReferenceComments(sourceFile); + + sourceFile.statements = parseList(ParsingContext.SourceElements, /*checkForStrictMode*/ true, parseSourceElement); + Debug.assert(token === SyntaxKind.EndOfFileToken); + sourceFile.endOfFileToken = parseTokenNode(); + + setExternalModuleIndicator(sourceFile); + + sourceFile.nodeCount = nodeCount; + sourceFile.identifierCount = identifierCount; + sourceFile.identifiers = identifiers; + + if (setParentNodes) { + fixupParentReferences(sourceFile); + } + + syntaxCursor = undefined; + + // Clear out the text the scanner is pointing at, so it doesn't keep anything alive unnecessarily. + scanner.setText(""); + scanner.setOnError(undefined); + + let result = sourceFile; + + // Clear any data. We don't want to accidently hold onto it for too long. + sourceFile = undefined; + identifiers = undefined; + syntaxCursor = undefined; + sourceText = undefined; + + return result; } - syntaxCursor = undefined; - return sourceFile; + function fixupParentReferences(sourceFile: 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. + + let parent: Node = sourceFile; + forEachChild(sourceFile, visitNode); + return; + + function visitNode(n: Node): void { + // walk down setting parents that differ from the parent we think it should be. This + // allows us to quickly bail out of setting parents for subtrees during incremental + // parsing + if (n.parent !== parent) { + n.parent = parent; + + let saveParent = parent; + parent = n; + forEachChild(n, visitNode); + parent = saveParent; + } + } + } + + function createSourceFile(fileName: string, languageVersion: ScriptTarget) { + sourceFile = createNode(SyntaxKind.SourceFile, /*pos*/ 0); + + sourceFile.pos = 0; + sourceFile.end = sourceText.length; + sourceFile.text = sourceText; + + sourceFile.parseDiagnostics = []; + sourceFile.bindDiagnostics = []; + sourceFile.languageVersion = languageVersion; + sourceFile.fileName = normalizePath(fileName); + sourceFile.flags = fileExtensionIs(sourceFile.fileName, ".d.ts") ? NodeFlags.DeclarationFile : 0; + } function setContextFlag(val: Boolean, flag: ParserContextFlags) { if (val) { @@ -1350,6 +750,7 @@ module ts { return speculationHelper(callback, /*isLookAhead:*/ false); } + // Ignore strict mode flag because we will report an error in type checker instead. function isIdentifier(): boolean { if (token === SyntaxKind.Identifier) { return true; @@ -1361,7 +762,7 @@ module ts { return false; } - return inStrictModeContext() ? token > SyntaxKind.LastFutureReservedWord : token > SyntaxKind.LastReservedWord; + return token > SyntaxKind.LastReservedWord; } function parseExpected(kind: SyntaxKind, diagnosticMessage?: DiagnosticMessage): boolean { @@ -1459,7 +860,7 @@ module ts { return node; } - + function createMissingNode(kind: SyntaxKind, reportAtCurrentPosition: boolean, diagnosticMessage: DiagnosticMessage, arg0?: any): Node { if (reportAtCurrentPosition) { parseErrorAtPosition(scanner.getStartPos(), 0, diagnosticMessage, arg0); @@ -1485,6 +886,11 @@ module ts { identifierCount++; if (isIdentifier) { let node = createNode(SyntaxKind.Identifier); + + // Store original token kind if it is not just an Identifier so we can report appropriate error later in type checker + if (token !== SyntaxKind.Identifier) { + node.originalKeywordKind = token; + } node.text = internIdentifier(scanner.getTokenValue()); nextToken(); return finishNode(node); @@ -1822,6 +1228,16 @@ module ts { return result; } + /// Should be called only on prologue directives (isPrologueDirective(node) should be true) + function isUseStrictPrologueDirective(sourceFile: SourceFile, node: Node): boolean { + Debug.assert(isPrologueDirective(node)); + let nodeText = getSourceTextOfNodeFromSourceFile(sourceFile, (node).expression); + + // Note: the node text must be exactly "use strict" or 'use strict'. It is not ok for the + // string to contain unicode escapes (as per ES5). + return nodeText === '"use strict"' || nodeText === "'use strict'"; + } + function parseListElement(parsingContext: ParsingContext, parseElement: () => T): T { let node = currentNode(parsingContext); if (node) { @@ -2113,6 +1529,32 @@ module ts { return false; } + function parsingContextErrors(context: ParsingContext): DiagnosticMessage { + switch (context) { + case ParsingContext.SourceElements: return Diagnostics.Declaration_or_statement_expected; + case ParsingContext.ModuleElements: return Diagnostics.Declaration_or_statement_expected; + case ParsingContext.BlockStatements: return Diagnostics.Statement_expected; + case ParsingContext.SwitchClauses: return Diagnostics.case_or_default_expected; + case ParsingContext.SwitchClauseStatements: return Diagnostics.Statement_expected; + 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.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; + case ParsingContext.ArgumentExpressions: return Diagnostics.Argument_expression_expected; + case ParsingContext.ObjectLiteralMembers: return Diagnostics.Property_assignment_expected; + case ParsingContext.ArrayLiteralMembers: return Diagnostics.Expression_or_comma_expected; + case ParsingContext.Parameters: return Diagnostics.Parameter_declaration_expected; + case ParsingContext.TypeParameters: return Diagnostics.Type_parameter_declaration_expected; + case ParsingContext.TypeArguments: return Diagnostics.Type_argument_expected; + case ParsingContext.TupleElementTypes: return Diagnostics.Type_expected; + case ParsingContext.HeritageClauses: return Diagnostics.Unexpected_token_expected; + case ParsingContext.ImportOrExportSpecifiers: return Diagnostics.Identifier_expected; + } + }; + // Parses a comma-delimited list of elements function parseDelimitedList(kind: ParsingContext, parseElement: () => T, considerSemicolonAsDelimeter?: boolean): NodeArray { let saveParsingContext = parsingContext; @@ -2361,7 +1803,7 @@ module ts { function parseParameterType(): TypeNode { if (parseOptional(SyntaxKind.ColonToken)) { return token === SyntaxKind.StringLiteral - ? parseLiteralNode(/*internName:*/ true) + ? parseLiteralNode(/*internName:*/ true) : parseType(); } @@ -2423,10 +1865,10 @@ module ts { } function fillSignature( - returnToken: SyntaxKind, - yieldAndGeneratorParameterContext: boolean, - requireCompleteParameterList: boolean, - signature: SignatureDeclaration): void { + returnToken: SyntaxKind, + yieldAndGeneratorParameterContext: boolean, + requireCompleteParameterList: boolean, + signature: SignatureDeclaration): void { let returnTokenRequired = returnToken === SyntaxKind.EqualsGreaterThanToken; signature.typeParameters = parseTypeParameters(); signature.parameters = parseParameterList(yieldAndGeneratorParameterContext, requireCompleteParameterList); @@ -3221,6 +2663,16 @@ module ts { } } + // If encounter "([" or "({", this could be the start of a binding pattern. + // Examples: + // ([ x ]) => { } + // ({ x }) => { } + // ([ x ]) + // ({ x }) + if (second === SyntaxKind.OpenBracketToken || second === SyntaxKind.OpenBraceToken) { + return Tristate.Unknown; + } + // Simple case: "(..." // This is an arrow function with a rest parameter. if (second === SyntaxKind.DotDotDotToken) { @@ -3750,9 +3202,9 @@ module ts { 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. + // 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. @@ -3815,7 +3267,7 @@ module ts { function parseArgumentOrArrayLiteralElement(): Expression { return token === SyntaxKind.DotDotDotToken ? parseSpreadElement() : token === SyntaxKind.CommaToken ? createNode(SyntaxKind.OmittedExpression) : - parseAssignmentExpressionOrHigher(); + parseAssignmentExpressionOrHigher(); } function parseArgumentExpression(): Expression { @@ -4407,13 +3859,14 @@ module ts { function parseObjectBindingElement(): BindingElement { let node = createNode(SyntaxKind.BindingElement); // TODO(andersh): Handle computed properties - let id = parsePropertyName(); - if (id.kind === SyntaxKind.Identifier && token !== SyntaxKind.ColonToken) { - node.name = id; + let tokenIsIdentifier = isIdentifier(); + let propertyName = parsePropertyName(); + if (tokenIsIdentifier && token !== SyntaxKind.ColonToken) { + node.name = propertyName; } else { parseExpected(SyntaxKind.ColonToken); - node.propertyName = id; + node.propertyName = propertyName; node.name = parseIdentifierOrPattern(); } node.initializer = parseInitializer(/*inParameter*/ false); @@ -4590,6 +4043,18 @@ module ts { return finishNode(node); } + function isClassMemberModifier(idToken: SyntaxKind) { + switch (idToken) { + case SyntaxKind.PublicKeyword: + case SyntaxKind.PrivateKeyword: + case SyntaxKind.ProtectedKeyword: + case SyntaxKind.StaticKeyword: + return true; + default: + return false; + } + } + function isClassMemberStart(): boolean { let idToken: SyntaxKind; @@ -4600,6 +4065,16 @@ module ts { // Eat up all modifiers, but hold on to the last one in case it is actually an identifier. while (isModifier(token)) { idToken = token; + // If the idToken is a class modifier (protected, private, public, and static), it is + // certain that we are starting to parse class member. This allows better error recovery + // Example: + // public foo() ... // true + // public @dec blah ... // true; we will then report an error later + // export public ... // true; we will then report an error later + if (isClassMemberModifier(idToken)) { + return true; + } + nextToken(); } @@ -5123,17 +4598,11 @@ module ts { setModifiers(node, modifiers); if (parseOptional(SyntaxKind.EqualsToken)) { node.isExportEquals = true; - node.expression = parseAssignmentExpressionOrHigher(); } else { parseExpected(SyntaxKind.DefaultKeyword); - if (parseOptional(SyntaxKind.ColonToken)) { - node.type = parseType(); - } - else { - node.expression = parseAssignmentExpressionOrHigher(); - } } + node.expression = parseAssignmentExpressionOrHigher(); parseSemicolon(); return finishNode(node); } @@ -5284,7 +4753,7 @@ module ts { function processReferenceComments(sourceFile: SourceFile): void { let triviaScanner = createScanner(sourceFile.languageVersion, /*skipTrivia*/false, sourceText); let referencedFiles: FileReference[] = []; - let amdDependencies: {path: string; name: string}[] = []; + let amdDependencies: { path: string; name: string }[] = []; let amdModuleName: string; // Keep scanning all the leading trivia in the file until we get to something that @@ -5299,7 +4768,7 @@ module ts { break; } - let range = { pos: triviaScanner.getTokenPos(), end: triviaScanner.getTextPos() }; + let range = { pos: triviaScanner.getTokenPos(), end: triviaScanner.getTextPos(), kind: triviaScanner.getToken() }; let comment = sourceText.substring(range.pos, range.end); let referencePathMatchResult = getFileReferenceFromReferencePath(comment, range); @@ -5332,7 +4801,7 @@ module ts { let pathMatchResult = pathRegex.exec(comment); let nameMatchResult = nameRegex.exec(comment); if (pathMatchResult) { - let amdDependency = {path: pathMatchResult[2], name: nameMatchResult ? nameMatchResult[2] : undefined }; + let amdDependency = { path: pathMatchResult[2], name: nameMatchResult ? nameMatchResult[2] : undefined }; amdDependencies.push(amdDependency); } } @@ -5347,47 +4816,605 @@ module ts { function setExternalModuleIndicator(sourceFile: SourceFile) { sourceFile.externalModuleIndicator = forEach(sourceFile.statements, node => node.flags & NodeFlags.Export - || node.kind === SyntaxKind.ImportEqualsDeclaration && (node).moduleReference.kind === SyntaxKind.ExternalModuleReference - || node.kind === SyntaxKind.ImportDeclaration - || node.kind === SyntaxKind.ExportAssignment - || node.kind === SyntaxKind.ExportDeclaration + || node.kind === SyntaxKind.ImportEqualsDeclaration && (node).moduleReference.kind === SyntaxKind.ExternalModuleReference + || node.kind === SyntaxKind.ImportDeclaration + || node.kind === SyntaxKind.ExportAssignment + || node.kind === SyntaxKind.ExportDeclaration ? node : undefined); } + + const enum ParsingContext { + SourceElements, // Elements in source file + ModuleElements, // Elements in module declaration + BlockStatements, // Statements in block + SwitchClauses, // Clauses in switch statement + SwitchClauseStatements, // Statements in switch clause + TypeMembers, // Members in interface or type literal + ClassMembers, // Members in class declaration + EnumMembers, // Members in enum declaration + 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 + ArgumentExpressions, // Expressions in argument list + ObjectLiteralMembers, // Members in object literal + ArrayLiteralMembers, // Members in array literal + Parameters, // Parameters in parameter list + TypeParameters, // Type parameters in type parameter list + TypeArguments, // Type arguments in type argument list + TupleElementTypes, // Element types in tuple element type list + HeritageClauses, // Heritage clauses for a class or interface declaration. + ImportOrExportSpecifiers, // Named import clause's import specifier list + Count // Number of parsing contexts + } + + const enum Tristate { + False, + True, + Unknown + } } - export function isLeftHandSideExpression(expr: Expression): boolean { - if (expr) { - switch (expr.kind) { - case SyntaxKind.PropertyAccessExpression: - case SyntaxKind.ElementAccessExpression: - case SyntaxKind.NewExpression: - case SyntaxKind.CallExpression: - case SyntaxKind.TaggedTemplateExpression: - case SyntaxKind.ArrayLiteralExpression: - case SyntaxKind.ParenthesizedExpression: - case SyntaxKind.ObjectLiteralExpression: - case SyntaxKind.ClassExpression: - case SyntaxKind.FunctionExpression: - case SyntaxKind.Identifier: - case SyntaxKind.RegularExpressionLiteral: - case SyntaxKind.NumericLiteral: - case SyntaxKind.StringLiteral: - case SyntaxKind.NoSubstitutionTemplateLiteral: - case SyntaxKind.TemplateExpression: - case SyntaxKind.FalseKeyword: - case SyntaxKind.NullKeyword: - case SyntaxKind.ThisKeyword: - case SyntaxKind.TrueKeyword: - case SyntaxKind.SuperKeyword: - return true; + module IncrementalParser { + export function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks: boolean): SourceFile { + aggressiveChecks = aggressiveChecks || Debug.shouldAssert(AssertionLevel.Aggressive); + + checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks); + if (textChangeRangeIsUnchanged(textChangeRange)) { + // if the text didn't change, then we can just return our current source file as-is. + return sourceFile; + } + + if (sourceFile.statements.length === 0) { + // If we don't have any statements in the current source file, then there's no real + // way to incrementally parse. So just do a full parse instead. + return Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, /*syntaxCursor*/ undefined, /*setNodeParents*/ true) + } + + // Make sure we're not trying to incrementally update a source file more than once. Once + // we do an update the original source file is considered unusbale from that point onwards. + // + // This is because we do incremental parsing in-place. i.e. we take nodes from the old + // tree and give them new positions and parents. From that point on, trusting the old + // tree at all is not possible as far too much of it may violate invariants. + let incrementalSourceFile = sourceFile; + Debug.assert(!incrementalSourceFile.hasBeenIncrementallyParsed); + incrementalSourceFile.hasBeenIncrementallyParsed = true; + + let oldText = sourceFile.text; + let syntaxCursor = createSyntaxCursor(sourceFile); + + // Make the actual change larger so that we know to reparse anything whose lookahead + // might have intersected the change. + let changeRange = extendToAffectedRange(sourceFile, textChangeRange); + checkChangeRange(sourceFile, newText, changeRange, aggressiveChecks); + + // Ensure that extending the affected range only moved the start of the change range + // earlier in the file. + Debug.assert(changeRange.span.start <= textChangeRange.span.start); + Debug.assert(textSpanEnd(changeRange.span) === textSpanEnd(textChangeRange.span)); + Debug.assert(textSpanEnd(textChangeRangeNewSpan(changeRange)) === textSpanEnd(textChangeRangeNewSpan(textChangeRange))); + + // The is the amount the nodes after the edit range need to be adjusted. It can be + // positive (if the edit added characters), negative (if the edit deleted characters) + // or zero (if this was a pure overwrite with nothing added/removed). + let delta = textChangeRangeNewSpan(changeRange).length - changeRange.span.length; + + // If we added or removed characters during the edit, then we need to go and adjust all + // the nodes after the edit. Those nodes may move forward (if we inserted chars) or they + // may move backward (if we deleted chars). + // + // Doing this helps us out in two ways. First, it means that any nodes/tokens we want + // 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 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 + // + // We will also adjust the positions of nodes that intersect the change range as well. + // By doing this, we ensure that all the positions in the old tree are consistent, not + // just the positions of nodes entirely before/after the change range. By being + // consistent, we can then easily map from positions to nodes in the old tree easily. + // + // Also, mark any syntax elements that intersect the changed span. We know, up front, + // that we cannot reuse these elements. + updateTokenPositionsAndMarkElements(incrementalSourceFile, + changeRange.span.start, textSpanEnd(changeRange.span), textSpanEnd(textChangeRangeNewSpan(changeRange)), delta, oldText, newText, aggressiveChecks); + + // Now that we've set up our internal incremental state just proceed and parse the + // source file in the normal fashion. When possible the parser will retrieve and + // reuse nodes from the old tree. + // + // Note: passing in 'true' for setNodeParents is very important. When incrementally + // parsing, we will be reusing nodes from the old tree, and placing it into new + // parents. If we don't set the parents now, we'll end up with an observably + // inconsistent tree. Setting the parents on the new tree should be very fast. We + // will immediately bail out of walking any subtrees when we can see that their parents + // are already correct. + let result = Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, /* setParentNode */ true) + + return result; + } + + function moveElementEntirelyPastChangeRange(element: IncrementalElement, isArray: boolean, delta: number, oldText: string, newText: string, aggressiveChecks: boolean) { + if (isArray) { + visitArray(element); + } + else { + visitNode(element); + } + return; + + function visitNode(node: IncrementalNode) { + if (aggressiveChecks && shouldCheckNode(node)) { + var text = oldText.substring(node.pos, node.end); + } + + // Ditch any existing LS children we may have created. This way we can avoid + // moving them forward. + node._children = undefined; + node.pos += delta; + node.end += delta; + + if (aggressiveChecks && shouldCheckNode(node)) { + Debug.assert(text === newText.substring(node.pos, node.end)); + } + + forEachChild(node, visitNode, visitArray); + checkNodePositions(node, aggressiveChecks); + } + + function visitArray(array: IncrementalNodeArray) { + array._children = undefined; + array.pos += delta; + array.end += delta; + + for (let node of array) { + visitNode(node); + } } } - return false; - } + function shouldCheckNode(node: Node) { + switch (node.kind) { + case SyntaxKind.StringLiteral: + case SyntaxKind.NumericLiteral: + case SyntaxKind.Identifier: + return true; + } - export function isAssignmentOperator(token: SyntaxKind): boolean { - return token >= SyntaxKind.FirstAssignment && token <= SyntaxKind.LastAssignment; + return false; + } + + function adjustIntersectingElement(element: IncrementalElement, changeStart: number, changeRangeOldEnd: number, changeRangeNewEnd: number, delta: number) { + Debug.assert(element.end >= changeStart, "Adjusting an element that was entirely before the change range"); + Debug.assert(element.pos <= changeRangeOldEnd, "Adjusting an element that was entirely after the change range"); + Debug.assert(element.pos <= element.end); + + // We have an element that intersects the change range in some way. It may have its + // start, or its end (or both) in the changed range. We want to adjust any part + // that intersects such that the final tree is in a consistent state. i.e. all + // chlidren have spans within the span of their parent, and all siblings are ordered + // properly. + + // We may need to update both the 'pos' and the 'end' of the element. + + // If the 'pos' is before the start of the change, then we don't need to touch it. + // If it isn't, then the 'pos' must be inside the change. How we update it will + // depend if delta is positive or negative. If delta is positive then we have + // something like: + // + // -------------------AAA----------------- + // -------------------BBBCCCCCCC----------------- + // + // In this case, we consider any node that started in the change range to still be + // starting at the same position. + // + // however, if the delta is negative, then we instead have something like this: + // + // -------------------XXXYYYYYYY----------------- + // -------------------ZZZ----------------- + // + // In this case, any element that started in the 'X' range will keep its position. + // However any element htat started after that will have their pos adjusted to be + // at the end of the new range. i.e. any node that started in the 'Y' range will + // be adjusted to have their start at the end of the 'Z' range. + // + // The element will keep its position if possible. Or Move backward to the new-end + // if it's in the 'Y' range. + element.pos = Math.min(element.pos, changeRangeNewEnd); + + // If the 'end' is after the change range, then we always adjust it by the delta + // amount. However, if the end is in the change range, then how we adjust it + // will depend on if delta is positive or negative. If delta is positive then we + // have something like: + // + // -------------------AAA----------------- + // -------------------BBBCCCCCCC----------------- + // + // In this case, we consider any node that ended inside the change range to keep its + // end position. + // + // however, if the delta is negative, then we instead have something like this: + // + // -------------------XXXYYYYYYY----------------- + // -------------------ZZZ----------------- + // + // In this case, any element that ended in the 'X' range will keep its position. + // However any element htat ended after that will have their pos adjusted to be + // at the end of the new range. i.e. any node that ended in the 'Y' range will + // be adjusted to have their end at the end of the 'Z' range. + if (element.end >= changeRangeOldEnd) { + // Element ends after the change range. Always adjust the end pos. + element.end += delta; + } + else { + // Element ends in the change range. The element will keep its position if + // possible. Or Move backward to the new-end if it's in the 'Y' range. + element.end = Math.min(element.end, changeRangeNewEnd); + } + + Debug.assert(element.pos <= element.end); + if (element.parent) { + Debug.assert(element.pos >= element.parent.pos); + Debug.assert(element.end <= element.parent.end); + } + } + + function checkNodePositions(node: Node, aggressiveChecks: boolean) { + if (aggressiveChecks) { + let pos = node.pos; + forEachChild(node, child => { + Debug.assert(child.pos >= pos); + pos = child.end; + }); + Debug.assert(pos <= node.end); + } + } + + function updateTokenPositionsAndMarkElements( + sourceFile: IncrementalNode, + changeStart: number, + changeRangeOldEnd: number, + changeRangeNewEnd: number, + delta: number, + oldText: string, + newText: string, + aggressiveChecks: boolean): void { + + visitNode(sourceFile); + return; + + function visitNode(child: IncrementalNode) { + Debug.assert(child.pos <= child.end); + if (child.pos > changeRangeOldEnd) { + // Node is entirely past the change range. We need to move both its pos and + // end, forward or backward appropriately. + moveElementEntirelyPastChangeRange(child, /*isArray:*/ false, delta, oldText, newText, aggressiveChecks); + return; + } + + // Check if the element intersects the change range. If it does, then it is not + // reusable. Also, we'll need to recurse to see what constituent portions we may + // be able to use. + let fullEnd = child.end; + if (fullEnd >= changeStart) { + child.intersectsChange = true; + child._children = undefined; + + // Adjust the pos or end (or both) of the intersecting element accordingly. + adjustIntersectingElement(child, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); + forEachChild(child, visitNode, visitArray); + + checkNodePositions(child, aggressiveChecks); + return; + } + + // Otherwise, the node is entirely before the change range. No need to do anything with it. + Debug.assert(fullEnd < changeStart); + } + + function visitArray(array: IncrementalNodeArray) { + Debug.assert(array.pos <= array.end); + if (array.pos > changeRangeOldEnd) { + // Array is entirely after the change range. We need to move it, and move any of + // its children. + moveElementEntirelyPastChangeRange(array, /*isArray:*/ true, delta, oldText, newText, aggressiveChecks); + return; + } + + // Check if the element intersects the change range. If it does, then it is not + // reusable. Also, we'll need to recurse to see what constituent portions we may + // be able to use. + let fullEnd = array.end; + if (fullEnd >= changeStart) { + array.intersectsChange = true; + array._children = undefined; + + // Adjust the pos or end (or both) of the intersecting array accordingly. + adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); + for (let node of array) { + visitNode(node); + } + return; + } + + // Otherwise, the array is entirely before the change range. No need to do anything with it. + Debug.assert(fullEnd < changeStart); + } + } + + function extendToAffectedRange(sourceFile: SourceFile, changeRange: TextChangeRange): TextChangeRange { + // Consider the following code: + // void foo() { /; } + // + // If the text changes with an insertion of / just before the semicolon then we end up with: + // void foo() { //; } + // + // If we were to just use the changeRange a is, then we would not rescan the { token + // (as it does not intersect the actual original change range). Because an edit may + // change the token touching it, we actually need to look back *at least* one token so + // that the prior token sees that change. + let maxLookahead = 1; + + let start = changeRange.span.start; + + // the first iteration aligns us with the change start. subsequent iteration move us to + // the left by maxLookahead tokens. We only need to do this as long as we're not at the + // start of the tree. + for (let i = 0; start > 0 && i <= maxLookahead; i++) { + let nearestNode = findNearestNodeStartingBeforeOrAtPosition(sourceFile, start); + Debug.assert(nearestNode.pos <= start); + let position = nearestNode.pos; + + start = Math.max(0, position - 1); + } + + let finalSpan = createTextSpanFromBounds(start, textSpanEnd(changeRange.span)); + let finalLength = changeRange.newLength + (changeRange.span.start - start); + + return createTextChangeRange(finalSpan, finalLength); + } + + function findNearestNodeStartingBeforeOrAtPosition(sourceFile: SourceFile, position: number): Node { + let bestResult: Node = sourceFile; + let lastNodeEntirelyBeforePosition: Node; + + forEachChild(sourceFile, visit); + + if (lastNodeEntirelyBeforePosition) { + let lastChildOfLastEntireNodeBeforePosition = getLastChild(lastNodeEntirelyBeforePosition); + if (lastChildOfLastEntireNodeBeforePosition.pos > bestResult.pos) { + bestResult = lastChildOfLastEntireNodeBeforePosition; + } + } + + return bestResult; + + function getLastChild(node: Node): Node { + while (true) { + let lastChild = getLastChildWorker(node); + if (lastChild) { + node = lastChild; + } + else { + return node; + } + } + } + + function getLastChildWorker(node: Node): Node { + let last: Node = undefined; + forEachChild(node, child => { + if (nodeIsPresent(child)) { + last = child; + } + }); + return last; + } + + function visit(child: Node) { + if (nodeIsMissing(child)) { + // Missing nodes are effectively invisible to us. We never even consider them + // When trying to find the nearest node before us. + return; + } + + // If the child intersects this position, then this node is currently the nearest + // node that starts before the position. + if (child.pos <= position) { + if (child.pos >= bestResult.pos) { + // This node starts before the position, and is closer to the position than + // the previous best node we found. It is now the new best node. + bestResult = child; + } + + // Now, the node may overlap the position, or it may end entirely before the + // position. If it overlaps with the position, then either it, or one of its + // children must be the nearest node before the position. So we can just + // recurse into this child to see if we can find something better. + if (position < child.end) { + // The nearest node is either this child, or one of the children inside + // of it. We've already marked this child as the best so far. Recurse + // in case one of the children is better. + forEachChild(child, visit); + + // Once we look at the children of this node, then there's no need to + // continue any further. + return true; + } + else { + Debug.assert(child.end <= position); + // The child ends entirely before this position. Say you have the following + // (where $ is the position) + // + // ? $ : <...> <...> + // + // We would want to find the nearest preceding node in "complex expr 2". + // To support that, we keep track of this node, and once we're done searching + // for a best node, we recurse down this node to see if we can find a good + // result in it. + // + // This approach allows us to quickly skip over nodes that are entirely + // before the position, while still allowing us to find any nodes in the + // last one that might be what we want. + lastNodeEntirelyBeforePosition = child; + } + } + else { + Debug.assert(child.pos > position); + // We're now at a node that is entirely past the position we're searching for. + // This node (and all following nodes) could never contribute to the result, + // so just skip them by returning 'true' here. + return true; + } + } + } + + function checkChangeRange(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks: boolean) { + let oldText = sourceFile.text; + if (textChangeRange) { + Debug.assert((oldText.length - textChangeRange.span.length + textChangeRange.newLength) === newText.length); + + if (aggressiveChecks || Debug.shouldAssert(AssertionLevel.VeryAggressive)) { + let oldTextPrefix = oldText.substr(0, textChangeRange.span.start); + let newTextPrefix = newText.substr(0, textChangeRange.span.start); + Debug.assert(oldTextPrefix === newTextPrefix); + + let oldTextSuffix = oldText.substring(textSpanEnd(textChangeRange.span), oldText.length); + let newTextSuffix = newText.substring(textSpanEnd(textChangeRangeNewSpan(textChangeRange)), newText.length); + Debug.assert(oldTextSuffix === newTextSuffix); + } + } + } + + interface IncrementalElement extends TextRange { + parent?: Node; + intersectsChange: boolean + length?: number; + _children: Node[]; + } + + export interface IncrementalNode extends Node, IncrementalElement { + hasBeenIncrementallyParsed: boolean + } + + interface IncrementalNodeArray extends NodeArray, IncrementalElement { + length: number + } + + // Allows finding nodes in the source file at a certain position in an efficient manner. + // The implementation takes advantage of the calling pattern it knows the parser will + // make in order to optimize finding nodes as quickly as possible. + export interface SyntaxCursor { + currentNode(position: number): IncrementalNode; + } + + function createSyntaxCursor(sourceFile: SourceFile): SyntaxCursor { + let currentArray: NodeArray = sourceFile.statements; + let currentArrayIndex = 0; + + Debug.assert(currentArrayIndex < currentArray.length); + let current = currentArray[currentArrayIndex]; + let lastQueriedPosition = InvalidPosition.Value; + + return { + currentNode(position: number) { + // Only compute the current node if the position is different than the last time + // we were asked. The parser commonly asks for the node at the same position + // twice. Once to know if can read an appropriate list element at a certain point, + // and then to actually read and consume the node. + if (position !== lastQueriedPosition) { + // Much of the time the parser will need the very next node in the array that + // we just returned a node from.So just simply check for that case and move + // forward in the array instead of searching for the node again. + if (current && current.end === position && currentArrayIndex < (currentArray.length - 1)) { + currentArrayIndex++; + current = currentArray[currentArrayIndex]; + } + + // If we don't have a node, or the node we have isn't in the right position, + // then try to find a viable node at the position requested. + if (!current || current.pos !== position) { + findHighestListElementThatStartsAtPosition(position); + } + } + + // Cache this query so that we don't do any extra work if the parser calls back + // into us. Note: this is very common as the parser will make pairs of calls like + // 'isListElement -> parseListElement'. If we were unable to find a node when + // called with 'isListElement', we don't want to redo the work when parseListElement + // is called immediately after. + lastQueriedPosition = position; + + // Either we don'd have a node, or we have a node at the position being asked for. + Debug.assert(!current || current.pos === position); + return current; + } + }; + + // Finds the highest element in the tree we can find that starts at the provided position. + // The element must be a direct child of some node list in the tree. This way after we + // return it, we can easily return its next sibling in the list. + function findHighestListElementThatStartsAtPosition(position: number) { + // Clear out any cached state about the last node we found. + currentArray = undefined; + currentArrayIndex = InvalidPosition.Value; + current = undefined; + + // Recurse into the source file to find the highest node at this position. + forEachChild(sourceFile, visitNode, visitArray); + return; + + function visitNode(node: Node) { + if (position >= node.pos && position < node.end) { + // Position was within this node. Keep searching deeper to find the node. + forEachChild(node, visitNode, visitArray); + + // don't procede any futher in the search. + return true; + } + + // position wasn't in this node, have to keep searching. + return false; + } + + function visitArray(array: NodeArray) { + if (position >= array.pos && position < array.end) { + // position was in this array. Search through this array to see if we find a + // viable element. + for (let i = 0, n = array.length; i < n; i++) { + let child = array[i]; + if (child) { + if (child.pos === position) { + // Found the right node. We're done. + currentArray = array; + currentArrayIndex = i; + current = child; + return true; + } + else { + if (child.pos < position && position < child.end) { + // Position in somewhere within this child. Search in it and + // stop searching in this array. + forEachChild(child, visitNode, visitArray); + return true; + } + } + } + } + } + + // position wasn't in this array, have to keep searching. + return false; + } + } + } + + const enum InvalidPosition { + Value = -1 + } } } diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 6041abc1350..c0259dc9986 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-alpha"; + export const version = "1.5.0-alpha"; export function findConfigFile(searchPath: string): string { var fileName = "tsconfig.json"; @@ -54,6 +54,7 @@ module ts { } text = ""; } + return text !== undefined ? createSourceFile(fileName, text, languageVersion, setParentNodes) : undefined; } @@ -170,7 +171,7 @@ module ts { getDiagnosticsProducingTypeChecker, getCommonSourceDirectory: () => commonSourceDirectory, emit, - getCurrentDirectory: host.getCurrentDirectory, + getCurrentDirectory: () => host.getCurrentDirectory(), getNodeCount: () => getDiagnosticsProducingTypeChecker().getNodeCount(), getIdentifierCount: () => getDiagnosticsProducingTypeChecker().getIdentifierCount(), getSymbolCount: () => getDiagnosticsProducingTypeChecker().getSymbolCount(), @@ -180,14 +181,15 @@ module ts { function getEmitHost(writeFileCallback?: WriteFileCallback): EmitHost { return { - getCanonicalFileName: host.getCanonicalFileName, + getCanonicalFileName: fileName => host.getCanonicalFileName(fileName), getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, - getCurrentDirectory: host.getCurrentDirectory, - getNewLine: host.getNewLine, + getCurrentDirectory: () => host.getCurrentDirectory(), + getNewLine: () => host.getNewLine(), getSourceFile: program.getSourceFile, getSourceFiles: program.getSourceFiles, - writeFile: writeFileCallback || host.writeFile, + writeFile: writeFileCallback || ( + (fileName, data, writeByteOrderMark, onError) => host.writeFile(fileName, data, writeByteOrderMark, onError)), }; } diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 3a208698c25..c2b693d6772 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -2,11 +2,12 @@ /// module ts { - + /* @internal */ export interface ErrorCallback { (message: DiagnosticMessage, length: number): void; } + /* @internal */ export interface Scanner { getStartPos(): number; getToken(): SyntaxKind; @@ -23,7 +24,11 @@ module ts { reScanSlashToken(): SyntaxKind; reScanTemplateToken(): SyntaxKind; scan(): SyntaxKind; - setText(text: string): void; + // Sets the text for the scanner to scan. An optional subrange starting point and length + // can be provided to have the scanner only scan a portion of the text. + setText(text: string, start?: number, length?: number): void; + setOnError(onError: ErrorCallback): void; + setScriptTarget(scriptTarget: ScriptTarget): void; setTextPos(textPos: number): void; // Invokes the provided callback then unconditionally restores the scanner to the state it // was in immediately prior to invoking the callback. The result of invoking the callback @@ -262,6 +267,7 @@ module ts { return textToToken[s]; } + /* @internal */ export function computeLineStarts(text: string): number[] { let result: number[] = new Array(); let pos = 0; @@ -293,15 +299,18 @@ module ts { return computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character); } + /* @internal */ export function computePositionOfLineAndCharacter(lineStarts: number[], line: number, character: number): number { Debug.assert(line >= 0 && line < lineStarts.length); return lineStarts[line] + character; } + /* @internal */ export function getLineStarts(sourceFile: SourceFile): number[] { return sourceFile.lineMap || (sourceFile.lineMap = computeLineStarts(sourceFile.text)); } + /* @internal */ export function computeLineAndCharacterOfPosition(lineStarts: number[], position: number) { let lineNumber = binarySearch(lineStarts, position); if (lineNumber < 0) { @@ -362,10 +371,12 @@ module ts { return ch >= CharacterCodes._0 && ch <= CharacterCodes._9; } + /* @internal */ export function isOctalDigit(ch: number): boolean { return ch >= CharacterCodes._0 && ch <= CharacterCodes._7; } + /* @internal */ export function skipTrivia(text: string, pos: number, stopAfterLineBreak?: boolean): number { while (true) { let ch = text.charCodeAt(pos); @@ -523,6 +534,7 @@ module ts { let nextChar = text.charCodeAt(pos + 1); let hasTrailingNewLine = false; if (nextChar === CharacterCodes.slash || nextChar === CharacterCodes.asterisk) { + let kind = nextChar === CharacterCodes.slash ? SyntaxKind.SingleLineCommentTrivia : SyntaxKind.MultiLineCommentTrivia; let startPos = pos; pos += 2; if (nextChar === CharacterCodes.slash) { @@ -548,7 +560,7 @@ module ts { result = []; } - result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine }); + result.push({ pos: startPos, end: pos, hasTrailingNewLine, kind }); } continue; } @@ -587,9 +599,11 @@ module ts { ch > CharacterCodes.maxAsciiCharacter && isUnicodeIdentifierPart(ch, languageVersion); } - export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback): Scanner { + // Creates a scanner over a (possibly unspecified) range of a piece of text. + /* @internal */ + export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner { let pos: number; // Current position (end position of text of current token) - let len: number; // Length of text + let end: number; // end of text let startPos: number; // Start position of whitespace before current token let tokenPos: number; // Start position of text of current token let token: SyntaxKind; @@ -598,6 +612,32 @@ module ts { let hasExtendedUnicodeEscape: boolean; let tokenIsUnterminated: boolean; + setText(text, start, length); + + return { + getStartPos: () => startPos, + getTextPos: () => pos, + getToken: () => token, + getTokenPos: () => tokenPos, + getTokenText: () => text.substring(tokenPos, pos), + getTokenValue: () => tokenValue, + hasExtendedUnicodeEscape: () => hasExtendedUnicodeEscape, + hasPrecedingLineBreak: () => precedingLineBreak, + isIdentifier: () => token === SyntaxKind.Identifier || token > SyntaxKind.LastReservedWord, + isReservedWord: () => token >= SyntaxKind.FirstReservedWord && token <= SyntaxKind.LastReservedWord, + isUnterminated: () => tokenIsUnterminated, + reScanGreaterToken, + reScanSlashToken, + reScanTemplateToken, + scan, + setText, + setScriptTarget, + setOnError, + setTextPos, + tryScan, + lookAhead, + }; + function error(message: DiagnosticMessage, length?: number): void { if (onError) { onError(message, length || 0); @@ -694,7 +734,7 @@ module ts { let result = ""; let start = pos; while (true) { - if (pos >= len) { + if (pos >= end) { result += text.substring(start, pos); tokenIsUnterminated = true; error(Diagnostics.Unterminated_string_literal); @@ -736,7 +776,7 @@ module ts { let resultingToken: SyntaxKind; while (true) { - if (pos >= len) { + if (pos >= end) { contents += text.substring(start, pos); tokenIsUnterminated = true; error(Diagnostics.Unterminated_template_literal); @@ -755,7 +795,7 @@ module ts { } // '${' - if (currChar === CharacterCodes.$ && pos + 1 < len && text.charCodeAt(pos + 1) === CharacterCodes.openBrace) { + if (currChar === CharacterCodes.$ && pos + 1 < end && text.charCodeAt(pos + 1) === CharacterCodes.openBrace) { contents += text.substring(start, pos); pos += 2; resultingToken = startedWithBacktick ? SyntaxKind.TemplateHead : SyntaxKind.TemplateMiddle; @@ -776,7 +816,7 @@ module ts { contents += text.substring(start, pos); pos++; - if (pos < len && text.charCodeAt(pos) === CharacterCodes.lineFeed) { + if (pos < end && text.charCodeAt(pos) === CharacterCodes.lineFeed) { pos++; } @@ -796,7 +836,7 @@ module ts { function scanEscapeSequence(): string { pos++; - if (pos >= len) { + if (pos >= end) { error(Diagnostics.Unexpected_end_of_text); return ""; } @@ -822,7 +862,7 @@ module ts { return "\""; case CharacterCodes.u: // '\u{DDDDDDDD}' - if (pos < len && text.charCodeAt(pos) === CharacterCodes.openBrace) { + if (pos < end && text.charCodeAt(pos) === CharacterCodes.openBrace) { hasExtendedUnicodeEscape = true; pos++; return scanExtendedUnicodeEscape(); @@ -838,7 +878,7 @@ module ts { // when encountering a LineContinuation (i.e. a backslash and a line terminator sequence), // the line terminator is interpreted to be "the empty code unit sequence". case CharacterCodes.carriageReturn: - if (pos < len && text.charCodeAt(pos) === CharacterCodes.lineFeed) { + if (pos < end && text.charCodeAt(pos) === CharacterCodes.lineFeed) { pos++; } // fall through @@ -877,7 +917,7 @@ module ts { isInvalidExtendedEscape = true; } - if (pos >= len) { + if (pos >= end) { error(Diagnostics.Unexpected_end_of_text); isInvalidExtendedEscape = true; } @@ -914,7 +954,7 @@ module ts { // Current character is known to be a backslash. Check for Unicode escape of the form '\uXXXX' // and return code point value if valid Unicode escape is found. Otherwise return -1. function peekUnicodeEscape(): number { - if (pos + 5 < len && text.charCodeAt(pos + 1) === CharacterCodes.u) { + if (pos + 5 < end && text.charCodeAt(pos + 1) === CharacterCodes.u) { let start = pos; pos += 2; let value = scanExactNumberOfHexDigits(4); @@ -927,7 +967,7 @@ module ts { function scanIdentifierParts(): string { let result = ""; let start = pos; - while (pos < len) { + while (pos < end) { let ch = text.charCodeAt(pos); if (isIdentifierPart(ch)) { pos++; @@ -994,7 +1034,7 @@ module ts { tokenIsUnterminated = false; while (true) { tokenPos = pos; - if (pos >= len) { + if (pos >= end) { return token = SyntaxKind.EndOfFileToken; } let ch = text.charCodeAt(pos); @@ -1007,7 +1047,7 @@ module ts { continue; } else { - if (ch === CharacterCodes.carriageReturn && pos + 1 < len && text.charCodeAt(pos + 1) === CharacterCodes.lineFeed) { + if (ch === CharacterCodes.carriageReturn && pos + 1 < end && text.charCodeAt(pos + 1) === CharacterCodes.lineFeed) { // consume both CR and LF pos += 2; } @@ -1025,7 +1065,7 @@ module ts { continue; } else { - while (pos < len && isWhiteSpace(text.charCodeAt(pos))) { + while (pos < end && isWhiteSpace(text.charCodeAt(pos))) { pos++; } return token = SyntaxKind.WhitespaceTrivia; @@ -1098,7 +1138,7 @@ module ts { if (text.charCodeAt(pos + 1) === CharacterCodes.slash) { pos += 2; - while (pos < len) { + while (pos < end) { if (isLineBreak(text.charCodeAt(pos))) { break; } @@ -1118,7 +1158,7 @@ module ts { pos += 2; let commentClosed = false; - while (pos < len) { + while (pos < end) { let ch = text.charCodeAt(pos); if (ch === CharacterCodes.asterisk && text.charCodeAt(pos + 1) === CharacterCodes.slash) { @@ -1153,7 +1193,7 @@ module ts { return pos++, token = SyntaxKind.SlashToken; case CharacterCodes._0: - if (pos + 2 < len && (text.charCodeAt(pos + 1) === CharacterCodes.X || text.charCodeAt(pos + 1) === CharacterCodes.x)) { + if (pos + 2 < end && (text.charCodeAt(pos + 1) === CharacterCodes.X || text.charCodeAt(pos + 1) === CharacterCodes.x)) { pos += 2; let value = scanMinimumNumberOfHexDigits(1); if (value < 0) { @@ -1163,7 +1203,7 @@ module ts { tokenValue = "" + value; return token = SyntaxKind.NumericLiteral; } - else if (pos + 2 < len && (text.charCodeAt(pos + 1) === CharacterCodes.B || text.charCodeAt(pos + 1) === CharacterCodes.b)) { + else if (pos + 2 < end && (text.charCodeAt(pos + 1) === CharacterCodes.B || text.charCodeAt(pos + 1) === CharacterCodes.b)) { pos += 2; let value = scanBinaryOrOctalDigits(/* base */ 2); if (value < 0) { @@ -1173,7 +1213,7 @@ module ts { tokenValue = "" + value; return token = SyntaxKind.NumericLiteral; } - else if (pos + 2 < len && (text.charCodeAt(pos + 1) === CharacterCodes.O || text.charCodeAt(pos + 1) === CharacterCodes.o)) { + else if (pos + 2 < end && (text.charCodeAt(pos + 1) === CharacterCodes.O || text.charCodeAt(pos + 1) === CharacterCodes.o)) { pos += 2; let value = scanBinaryOrOctalDigits(/* base */ 8); if (value < 0) { @@ -1184,7 +1224,7 @@ module ts { return token = SyntaxKind.NumericLiteral; } // Try to parse as an octal - if (pos + 1 < len && isOctalDigit(text.charCodeAt(pos + 1))) { + if (pos + 1 < end && isOctalDigit(text.charCodeAt(pos + 1))) { tokenValue = "" + scanOctalDigits(); return token = SyntaxKind.NumericLiteral; } @@ -1299,7 +1339,7 @@ module ts { default: if (isIdentifierStart(ch)) { pos++; - while (pos < len && isIdentifierPart(ch = text.charCodeAt(pos))) pos++; + while (pos < end && isIdentifierPart(ch = text.charCodeAt(pos))) pos++; tokenValue = text.substring(tokenPos, pos); if (ch === CharacterCodes.backslash) { tokenValue += scanIdentifierParts(); @@ -1350,7 +1390,7 @@ module ts { while (true) { // If we reach the end of a file, or hit a newline, then this is an unterminated // regex. Report error and return what we have so far. - if (p >= len) { + if (p >= end) { tokenIsUnterminated = true; error(Diagnostics.Unterminated_regular_expression_literal) break; @@ -1386,7 +1426,7 @@ module ts { p++; } - while (p < len && isIdentifierPart(text.charCodeAt(p))) { + while (p < end && isIdentifierPart(text.charCodeAt(p))) { p++; } pos = p; @@ -1435,43 +1475,31 @@ module ts { return speculationHelper(callback, /*isLookahead:*/ false); } - function setText(newText: string) { + function setText(newText: string, start: number, length: number) { text = newText || ""; - len = text.length; - setTextPos(0); + end = length === undefined ? text.length : start + length; + setTextPos(start || 0); + } + + function setOnError(errorCallback: ErrorCallback) { + onError = errorCallback; + } + + function setScriptTarget(scriptTarget: ScriptTarget) { + languageVersion = scriptTarget; } function setTextPos(textPos: number) { + Debug.assert(textPos >= 0); pos = textPos; startPos = textPos; tokenPos = textPos; token = SyntaxKind.Unknown; precedingLineBreak = false; + + tokenValue = undefined; + hasExtendedUnicodeEscape = false; + tokenIsUnterminated = false; } - - setText(text); - - - return { - getStartPos: () => startPos, - getTextPos: () => pos, - getToken: () => token, - getTokenPos: () => tokenPos, - getTokenText: () => text.substring(tokenPos, pos), - getTokenValue: () => tokenValue, - hasExtendedUnicodeEscape: () => hasExtendedUnicodeEscape, - hasPrecedingLineBreak: () => precedingLineBreak, - isIdentifier: () => token === SyntaxKind.Identifier || token > SyntaxKind.LastReservedWord, - isReservedWord: () => token >= SyntaxKind.FirstReservedWord && token <= SyntaxKind.LastReservedWord, - isUnterminated: () => tokenIsUnterminated, - reScanGreaterToken, - reScanSlashToken, - reScanTemplateToken, - scan, - setText, - setTextPos, - tryScan, - lookAhead, - }; } } diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index f89c474ce7f..f9daf52c5f2 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -6,17 +6,17 @@ module ts { newLine: string; useCaseSensitiveFileNames: boolean; write(s: string): void; - readFile(fileName: string, encoding?: string): string; - writeFile(fileName: string, data: string, writeByteOrderMark?: boolean): void; - watchFile? (fileName: string, callback: (fileName: string) => void): FileWatcher; + readFile(path: string, encoding?: string): string; + writeFile(path: string, data: string, writeByteOrderMark?: boolean): void; + watchFile?(path: string, callback: (path: string) => void): FileWatcher; resolvePath(path: string): string; fileExists(path: string): boolean; directoryExists(path: string): boolean; - createDirectory(directoryName: string): void; + createDirectory(path: string): void; getExecutingFilePath(): string; getCurrentDirectory(): string; readDirectory(path: string, extension?: string): string[]; - getMemoryUsage? (): number; + getMemoryUsage?(): number; exit(exitCode?: number): void; } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 74777057963..078f3d060a6 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -121,7 +121,6 @@ module ts { WhileKeyword, WithKeyword, // Strict mode reserved words - AsKeyword, ImplementsKeyword, InterfaceKeyword, LetKeyword, @@ -132,6 +131,7 @@ module ts { StaticKeyword, YieldKeyword, // Contextual keywords + AsKeyword, AnyKeyword, BooleanKeyword, ConstructorKeyword, @@ -320,6 +320,7 @@ module ts { BlockScoped = Let | Const } + /* @internal */ export const enum ParserContextFlags { // Set if this node was parsed in strict mode. Used for grammar error checks, as well as // checking if the node can be reused in incremental settings. @@ -355,6 +356,7 @@ module ts { HasAggregatedChildData = 1 << 7 } + /* @internal */ export const enum RelationComparisonResult { Succeeded = 1, // Should be truthy Failed = 2, @@ -366,15 +368,15 @@ module ts { flags: NodeFlags; // Specific context the parser was in when this node was created. Normally undefined. // Only set when the parser was in some interesting context (like async/yield). - parserContextFlags?: ParserContextFlags; - decorators?: NodeArray; // Array of decorators (in document order) - modifiers?: ModifiersArray; // Array of modifiers - id?: number; // Unique id (used to look up NodeLinks) - parent?: Node; // Parent node (initialized by binding) - symbol?: Symbol; // Symbol declared by node (initialized by binding) - locals?: SymbolTable; // Locals associated with node (initialized by binding) - nextContainer?: Node; // Next container in declaration order (initialized by binding) - localSymbol?: Symbol; // Local symbol declared by node (initialized by binding only for exported nodes) + /* @internal */ parserContextFlags?: ParserContextFlags; + decorators?: NodeArray; // Array of decorators (in document order) + modifiers?: ModifiersArray; // Array of modifiers + /* @internal */ id?: number; // Unique id (used to look up NodeLinks) + parent?: Node; // Parent node (initialized by binding) + /* @internal */ symbol?: Symbol; // Symbol declared by node (initialized by binding) + /* @internal */ locals?: SymbolTable; // Locals associated with node (initialized by binding) + /* @internal */ nextContainer?: Node; // Next container in declaration order (initialized by binding) + /* @internal */ localSymbol?: Symbol; // Local symbol declared by node (initialized by binding only for exported nodes) } export interface NodeArray extends Array, TextRange { @@ -386,7 +388,8 @@ module ts { } export interface Identifier extends PrimaryExpression { - text: string; // Text of identifier (with escapes converted to characters) + text: string; // Text of identifier (with escapes converted to characters) + originalKeywordKind?: SyntaxKind; // Original syntaxKind which get set so that we can report an error later } export interface QualifiedName extends Node { @@ -593,7 +596,11 @@ module ts { type: TypeNode; } - export interface StringLiteralTypeNode extends LiteralExpression, TypeNode { } + // Note that a StringLiteral AST node is both an Expression and a TypeNode. The latter is + // because string literals can appear in the type annotation of a parameter node. + export interface StringLiteral extends LiteralExpression, TypeNode { + _stringLiteralBrand: any; + } // Note: 'brands' in our syntax nodes serve to give us a small amount of nominal typing. // Consider 'Expression'. Without the brand, 'Expression' is actually no different @@ -686,10 +693,6 @@ module ts { hasExtendedUnicodeEscape?: boolean; } - export interface StringLiteralExpression extends LiteralExpression { - _stringLiteralExpressionBrand: any; - } - export interface TemplateExpression extends PrimaryExpression { head: LiteralExpression; templateSpans: NodeArray; @@ -736,7 +739,7 @@ module ts { arguments: NodeArray; } - export interface HeritageClauseElement extends Node { + export interface HeritageClauseElement extends TypeNode { expression: LeftHandSideExpression; typeArguments?: NodeArray; } @@ -975,8 +978,7 @@ module ts { export interface ExportAssignment extends Declaration, ModuleElement { isExportEquals?: boolean; - expression?: Expression; - type?: TypeNode; + expression: Expression; } export interface FileReference extends TextRange { @@ -985,6 +987,7 @@ module ts { export interface CommentRange extends TextRange { hasTrailingNewLine?: boolean; + kind: SyntaxKind; } // Source files are declarations when they are external modules. @@ -1001,11 +1004,12 @@ module ts { hasNoDefaultLib: boolean; - // The first node that causes this file to be an external module - externalModuleIndicator: Node; languageVersion: ScriptTarget; - identifiers: Map; + // The first node that causes this file to be an external module + /* @internal */ externalModuleIndicator: Node; + + /* @internal */ identifiers: Map; /* @internal */ nodeCount: number; /* @internal */ identifierCount: number; /* @internal */ symbolCount: number; @@ -1033,6 +1037,9 @@ module ts { } export interface Program extends ScriptReferenceHost { + /** + * Get a list of files in the program + */ getSourceFiles(): SourceFile[]; /** @@ -1052,10 +1059,12 @@ module ts { getSemanticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; getDeclarationDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - // Gets a type checker that can be used to semantically analyze source fils in the program. + /** + * Gets a type checker that can be used to semantically analyze source fils in the program. + */ getTypeChecker(): TypeChecker; - getCommonSourceDirectory(): string; + /* @internal */ getCommonSourceDirectory(): string; // For testing purposes only. Should not be used by any other consumers (including the // language service). @@ -1068,12 +1077,18 @@ module ts { } export interface SourceMapSpan { - emittedLine: number; // Line number in the .js file - emittedColumn: number; // Column number in the .js file - sourceLine: number; // Line number in the .ts file - sourceColumn: number; // Column number in the .ts file - nameIndex?: number; // Optional name (index into names array) associated with this span - sourceIndex: number; // .ts file (index into sources array) associated with this span*/ + /** Line number in the .js file. */ + emittedLine: number; + /** Column number in the .js file. */ + emittedColumn: number; + /** Line number in the .ts file. */ + sourceLine: number; + /** Column number in the .ts file. */ + sourceColumn: number; + /** Optional name (index into names array) associated with this span. */ + nameIndex?: number; + /** .ts file (index into sources array) associated with this span */ + sourceIndex: number; } export interface SourceMapData { @@ -1088,7 +1103,7 @@ module ts { sourceMapDecodedMappings: SourceMapSpan[]; // Raw source map spans that were encoded into the sourceMapMappings } - // Return code used by getEmitOutput function to indicate status of the function + /** Return code used by getEmitOutput function to indicate status of the function */ export enum ExitStatus { // Compiler ran successfully. Either this was a simple do-nothing compilation (for example, // when -version or -help was provided, or this was a normal compilation, no diagnostics @@ -1105,7 +1120,7 @@ module ts { export interface EmitResult { emitSkipped: boolean; diagnostics: Diagnostic[]; - sourceMaps: SourceMapData[]; // Array of sourceMapData if compiler emitted sourcemaps + /* @internal */ sourceMaps: SourceMapData[]; // Array of sourceMapData if compiler emitted sourcemaps } export interface TypeCheckerHost { @@ -1124,8 +1139,6 @@ module ts { getIndexTypeOfType(type: Type, kind: IndexKind): Type; getReturnTypeOfSignature(signature: Signature): Type; - // If 'predicate' is supplied, then only the first symbol in scope matching the predicate - // will be returned. Otherwise, all symbols in scope will be returned. getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; getSymbolAtLocation(node: Node): Symbol; getShorthandAssignmentValueSymbol(location: Node): Symbol; @@ -1217,14 +1230,17 @@ module ts { UseOnlyExternalAliasing = 0x00000002, } + /* @internal */ export const enum SymbolAccessibility { Accessible, NotAccessible, CannotBeNamed } + /* @internal */ export type AnyImportSyntax = ImportDeclaration | ImportEqualsDeclaration; + /* @internal */ export interface SymbolVisibilityResult { accessibility: SymbolAccessibility; aliasesToMakeVisible?: AnyImportSyntax[]; // aliases that need to have this symbol visible @@ -1232,10 +1248,12 @@ module ts { errorNode?: Node; // optional node that results in error } + /* @internal */ export interface SymbolAccessiblityResult extends SymbolVisibilityResult { errorModuleName?: string // If the symbol is not visible from module, module's name } + /* @internal */ export interface EmitResolver { hasGlobalName(name: string): boolean; getExpressionNameSubstitution(node: Identifier, getGeneratedNameForNode: (node: Node) => string): string; @@ -1340,19 +1358,20 @@ module ts { } export interface Symbol { - flags: SymbolFlags; // Symbol flags - name: string; // Name of symbol - id?: number; // Unique id (used to look up SymbolLinks) - mergeId?: number; // Merge id (used to look up merged symbol) - declarations?: Declaration[]; // Declarations associated with this symbol - parent?: Symbol; // Parent symbol - members?: SymbolTable; // Class, interface or literal instance members - exports?: SymbolTable; // Module exports - exportSymbol?: Symbol; // Exported symbol associated with this symbol - valueDeclaration?: Declaration // First value declaration of the symbol - constEnumOnlyModule?: boolean // True if module contains only const enums or other modules with only const enums + flags: SymbolFlags; // Symbol flags + name: string; // Name of symbol + /* @internal */ id?: number; // Unique id (used to look up SymbolLinks) + /* @internal */ mergeId?: number; // Merge id (used to look up merged symbol) + declarations?: Declaration[]; // Declarations associated with this symbol + /* @internal */ parent?: Symbol; // Parent symbol + members?: SymbolTable; // Class, interface or literal instance members + exports?: SymbolTable; // Module exports + /* @internal */ exportSymbol?: Symbol; // Exported symbol associated with this symbol + valueDeclaration?: Declaration; // First value declaration of the symbol + /* @internal */ constEnumOnlyModule?: boolean; // True if module contains only const enums or other modules with only const enums } + /* @internal */ export interface SymbolLinks { target?: Symbol; // Resolved (non-alias) target of an alias type?: Type; // Type of value symbol @@ -1364,12 +1383,14 @@ module ts { exportsChecked?: boolean; // True if exports of external module have been checked } + /* @internal */ export interface TransientSymbol extends Symbol, SymbolLinks { } export interface SymbolTable { [index: string]: Symbol; } + /* @internal */ export const enum NodeCheckFlags { TypeChecked = 0x00000001, // Node has been type checked LexicalThis = 0x00000002, // Lexical 'this' reference @@ -1384,8 +1405,10 @@ module ts { BlockScopedBindingInLoop = 0x00000100, EmitDecorate = 0x00000200, // Emit __decorate EmitParam = 0x00000400, // Emit __param helper for decorators + LexicalModuleMergesWithClass = 0x00000800, // Instantiated lexical module declaration is merged with a previous class declaration. } + /* @internal */ export interface NodeLinks { resolvedType?: Type; // Cached type of type node resolvedSignature?: Signature; // Cached signature of signature node or call expression @@ -1418,27 +1441,34 @@ module ts { Tuple = 0x00002000, // Tuple Union = 0x00004000, // Union Anonymous = 0x00008000, // Anonymous + /* @internal */ FromSignature = 0x00010000, // Created for signature assignment check ObjectLiteral = 0x00020000, // Originates in an object literal + /* @internal */ ContainsUndefinedOrNull = 0x00040000, // Type is or contains Undefined or Null type - ContainsObjectLiteral = 0x00080000, // Type is or contains object literal type + /* @internal */ + ContainsObjectLiteral = 0x00080000, // Type is or contains object literal type ESSymbol = 0x00100000, // Type of symbol primitive introduced in ES6 + /* @internal */ Intrinsic = Any | String | Number | Boolean | ESSymbol | Void | Undefined | Null, + /* @internal */ Primitive = String | Number | Boolean | ESSymbol | Void | Undefined | Null | StringLiteral | Enum, StringLike = String | StringLiteral, NumberLike = Number | Enum, ObjectType = Class | Interface | Reference | Tuple | Anonymous, + /* @internal */ RequiresWidening = ContainsUndefinedOrNull | ContainsObjectLiteral } // Properties common to all types export interface Type { - flags: TypeFlags; // Flags - id: number; // Unique ID - symbol?: Symbol; // Symbol associated with type (if any) + flags: TypeFlags; // Flags + /* @internal */ id: number; // Unique ID + symbol?: Symbol; // Symbol associated with type (if any) } + /* @internal */ // Intrinsic types (TypeFlags.Intrinsic) export interface IntrinsicType extends Type { intrinsicName: string; // Name of intrinsic type @@ -1455,7 +1485,6 @@ module ts { // Class and interface types (TypeFlags.Class and TypeFlags.Interface) export interface InterfaceType extends ObjectType { typeParameters: TypeParameter[]; // Type parameters (undefined if non-generic) - baseTypes: ObjectType[]; // Base types declaredProperties: Symbol[]; // Declared members declaredCallSignatures: Signature[]; // Declared call signatures declaredConstructSignatures: Signature[]; // Declared construct signatures @@ -1463,6 +1492,10 @@ module ts { declaredNumberIndexType: Type; // Declared numeric index type } + export interface InterfaceTypeWithBaseTypes extends InterfaceType { + baseTypes: ObjectType[]; + } + // Type references (TypeFlags.Reference) export interface TypeReference extends ObjectType { target: GenericType; // Type reference target @@ -1471,6 +1504,7 @@ module ts { // Generic class and interface types export interface GenericType extends InterfaceType, TypeReference { + /* @internal */ instantiations: Map; // Generic instantiation cache } @@ -1481,9 +1515,13 @@ module ts { export interface UnionType extends Type { types: Type[]; // Constituent types + /* @internal */ + reducedType: Type; // Reduced union type (all subtypes removed) + /* @internal */ resolvedProperties: SymbolTable; // Cache of resolved properties } + /* @internal */ // Resolved object or union type export interface ResolvedType extends ObjectType, UnionType { members: SymbolTable; // Properties by name @@ -1497,7 +1535,9 @@ module ts { // Type parameters (TypeFlags.TypeParameter) export interface TypeParameter extends Type { constraint: Type; // Constraint + /* @internal */ target?: TypeParameter; // Instantiation target + /* @internal */ mapper?: TypeMapper; // Instantiation mapper } @@ -1510,14 +1550,23 @@ module ts { declaration: SignatureDeclaration; // Originating declaration typeParameters: TypeParameter[]; // Type parameters (undefined if non-generic) parameters: Symbol[]; // Parameters + /* @internal */ resolvedReturnType: Type; // Resolved return type + /* @internal */ minArgumentCount: number; // Number of non-optional parameters + /* @internal */ hasRestParameter: boolean; // True if last parameter is rest parameter + /* @internal */ hasStringLiterals: boolean; // True if specialized + /* @internal */ target?: Signature; // Instantiation target + /* @internal */ mapper?: TypeMapper; // Instantiation mapper + /* @internal */ unionSignatures?: Signature[]; // Underlying signatures of a union signature + /* @internal */ erasedSignatureCache?: Signature; // Erased version of signature (deferred) + /* @internal */ isolatedSignatureType?: ObjectType; // A manufactured type that just contains the signature for purposes of signature comparison } @@ -1526,11 +1575,12 @@ module ts { Number, } + /* @internal */ export interface TypeMapper { (t: Type): Type; } - // @internal + /* @internal */ export interface TypeInferences { primary: Type[]; // Inferences made directly to a type parameter secondary: Type[]; // Inferences made to a type parameter in a union type @@ -1538,7 +1588,7 @@ module ts { // If a type parameter is fixed, no more inferences can be made for the type parameter } - // @internal + /* @internal */ export interface InferenceContext { typeParameters: TypeParameter[]; // Type parameters for which inferences are made inferUnionTypes: boolean; // Infer union types for disjoint candidates (otherwise undefinedType) @@ -1554,10 +1604,12 @@ module ts { code: number; } - // A linked list of formatted diagnostic messages to be used as part of a multiline message. - // It is built from the bottom up, leaving the head to be the "main" diagnostic. - // While it seems that DiagnosticMessageChain is structurally similar to DiagnosticMessage, - // the difference is that messages are all preformatted in DMC. + /** + * A linked list of formatted diagnostic messages to be used as part of a multiline message. + * It is built from the bottom up, leaving the head to be the "main" diagnostic. + * While it seems that DiagnosticMessageChain is structurally similar to DiagnosticMessage, + * the difference is that messages are all preformatted in DMC. + */ export interface DiagnosticMessageChain { messageText: string; category: DiagnosticCategory; @@ -1641,6 +1693,7 @@ module ts { errors: Diagnostic[]; } + /* @internal */ export interface CommandLineOption { name: string; type: string | Map; // "string", "number", "boolean", or an object literal mapping named values to actual values @@ -1652,6 +1705,7 @@ module ts { experimental?: boolean; } + /* @internal */ export const enum CharacterCodes { nullCharacter = 0, maxAsciiCharacter = 0x7F, @@ -1813,7 +1867,7 @@ module ts { newLength: number; } - // @internal + /* @internal */ export interface DiagnosticCollection { // Adds a diagnostic to this diagnostic collection. add(diagnostic: Diagnostic): void; diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 4df840c3241..b1aa59be323 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -1,5 +1,6 @@ /// +/* @internal */ module ts { export interface ReferencePathMatchResult { fileReference?: FileReference @@ -160,6 +161,14 @@ module ts { return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); } + export function getNonDecoratorTokenPosOfNode(node: Node, sourceFile?: SourceFile): number { + if (nodeIsMissing(node) || !node.decorators) { + return getTokenPosOfNode(node, sourceFile); + } + + return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.decorators.end); + } + export function getSourceTextOfNodeFromSourceFile(sourceFile: SourceFile, node: Node): string { if (nodeIsMissing(node)) { return ""; @@ -202,8 +211,10 @@ module ts { isCatchClauseVariableDeclaration(declaration); } + // Gets the nearest enclosing block scope container that has the provided node + // as a descendant, that is not the provided node. export function getEnclosingBlockScopeContainer(node: Node): Node { - let current = node; + let current = node.parent; while (current) { if (isFunctionLike(current)) { return current; @@ -262,10 +273,8 @@ module ts { }; } - /* @internal */ export function getSpanOfTokenAtPosition(sourceFile: SourceFile, pos: number): TextSpan { - let scanner = createScanner(sourceFile.languageVersion, /*skipTrivia*/ true, sourceFile.text); - scanner.setTextPos(pos); + let scanner = createScanner(sourceFile.languageVersion, /*skipTrivia*/ true, sourceFile.text, /*onError:*/ undefined, pos); scanner.scan(); let start = scanner.getTokenPos(); return createTextSpanFromBounds(start, scanner.getTextPos()); @@ -399,7 +408,6 @@ module ts { export let fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/ - // Warning: This has the same semantics as the forEach family of functions, // in that traversal terminates in the event that 'visitor' supplies a truthy value. export function forEachReturnStatement(body: Block, visitor: (stmt: ReturnStatement) => T): T { @@ -430,7 +438,6 @@ module ts { } } - /* @internal */ export function isVariableLike(node: Node): boolean { if (node) { switch (node.kind) { @@ -780,6 +787,8 @@ module ts { return node === (parent).expression; case SyntaxKind.ComputedPropertyName: return node === (parent).expression; + case SyntaxKind.Decorator: + return true; default: if (isExpression(parent)) { return true; @@ -1140,218 +1149,7 @@ module ts { } return false; } - - export function textSpanEnd(span: TextSpan) { - return span.start + span.length - } - - export function textSpanIsEmpty(span: TextSpan) { - return span.length === 0 - } - - export function textSpanContainsPosition(span: TextSpan, position: number) { - return position >= span.start && position < textSpanEnd(span); - } - - // Returns true if 'span' contains 'other'. - export function textSpanContainsTextSpan(span: TextSpan, other: TextSpan) { - return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span); - } - - export function textSpanOverlapsWith(span: TextSpan, other: TextSpan) { - let overlapStart = Math.max(span.start, other.start); - let overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other)); - return overlapStart < overlapEnd; - } - - export function textSpanOverlap(span1: TextSpan, span2: TextSpan) { - let overlapStart = Math.max(span1.start, span2.start); - let overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); - if (overlapStart < overlapEnd) { - return createTextSpanFromBounds(overlapStart, overlapEnd); - } - return undefined; - } - - export function textSpanIntersectsWithTextSpan(span: TextSpan, other: TextSpan) { - return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start - } - - export function textSpanIntersectsWith(span: TextSpan, start: number, length: number) { - let end = start + length; - return start <= textSpanEnd(span) && end >= span.start; - } - - export function textSpanIntersectsWithPosition(span: TextSpan, position: number) { - return position <= textSpanEnd(span) && position >= span.start; - } - - export function textSpanIntersection(span1: TextSpan, span2: TextSpan) { - let intersectStart = Math.max(span1.start, span2.start); - let intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); - if (intersectStart <= intersectEnd) { - return createTextSpanFromBounds(intersectStart, intersectEnd); - } - return undefined; - } - - export function createTextSpan(start: number, length: number): TextSpan { - if (start < 0) { - throw new Error("start < 0"); - } - if (length < 0) { - throw new Error("length < 0"); - } - - return { start, length }; - } - - export function createTextSpanFromBounds(start: number, end: number) { - return createTextSpan(start, end - start); - } - - export function textChangeRangeNewSpan(range: TextChangeRange) { - return createTextSpan(range.span.start, range.newLength); - } - - export function textChangeRangeIsUnchanged(range: TextChangeRange) { - return textSpanIsEmpty(range.span) && range.newLength === 0; - } - - export function createTextChangeRange(span: TextSpan, newLength: number): TextChangeRange { - if (newLength < 0) { - throw new Error("newLength < 0"); - } - - return { span, newLength }; - } - - export let unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0); - - /** - * Called to merge all the changes that occurred across several versions of a script snapshot - * into a single change. i.e. if a user keeps making successive edits to a script we will - * have a text change from V1 to V2, V2 to V3, ..., Vn. - * - * This function will then merge those changes into a single change range valid between V1 and - * Vn. - */ - export function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange { - if (changes.length === 0) { - return unchangedTextChangeRange; - } - - if (changes.length === 1) { - return changes[0]; - } - - // We change from talking about { { oldStart, oldLength }, newLength } to { oldStart, oldEnd, newEnd } - // as it makes things much easier to reason about. - let change0 = changes[0]; - - let oldStartN = change0.span.start; - let oldEndN = textSpanEnd(change0.span); - let newEndN = oldStartN + change0.newLength; - - for (let i = 1; i < changes.length; i++) { - let nextChange = changes[i]; - - // Consider the following case: - // i.e. two edits. The first represents the text change range { { 10, 50 }, 30 }. i.e. The span starting - // at 10, with length 50 is reduced to length 30. The second represents the text change range { { 30, 30 }, 40 }. - // i.e. the span starting at 30 with length 30 is increased to length 40. - // - // 0 10 20 30 40 50 60 70 80 90 100 - // ------------------------------------------------------------------------------------------------------- - // | / - // | /---- - // T1 | /---- - // | /---- - // | /---- - // ------------------------------------------------------------------------------------------------------- - // | \ - // | \ - // T2 | \ - // | \ - // | \ - // ------------------------------------------------------------------------------------------------------- - // - // Merging these turns out to not be too difficult. First, determining the new start of the change is trivial - // it's just the min of the old and new starts. i.e.: - // - // 0 10 20 30 40 50 60 70 80 90 100 - // ------------------------------------------------------------*------------------------------------------ - // | / - // | /---- - // T1 | /---- - // | /---- - // | /---- - // ----------------------------------------$-------------------$------------------------------------------ - // . | \ - // . | \ - // T2 . | \ - // . | \ - // . | \ - // ----------------------------------------------------------------------*-------------------------------- - // - // (Note the dots represent the newly inferrred start. - // Determining the new and old end is also pretty simple. Basically it boils down to paying attention to the - // absolute positions at the asterixes, and the relative change between the dollar signs. Basically, we see - // which if the two $'s precedes the other, and we move that one forward until they line up. in this case that - // means: - // - // 0 10 20 30 40 50 60 70 80 90 100 - // --------------------------------------------------------------------------------*---------------------- - // | / - // | /---- - // T1 | /---- - // | /---- - // | /---- - // ------------------------------------------------------------$------------------------------------------ - // . | \ - // . | \ - // T2 . | \ - // . | \ - // . | \ - // ----------------------------------------------------------------------*-------------------------------- - // - // In other words (in this case), we're recognizing that the second edit happened after where the first edit - // ended with a delta of 20 characters (60 - 40). Thus, if we go back in time to where the first edit started - // that's the same as if we started at char 80 instead of 60. - // - // As it so happens, the same logic applies if the second edit precedes the first edit. In that case rahter - // than pusing the first edit forward to match the second, we'll push the second edit forward to match the - // first. - // - // In this case that means we have { oldStart: 10, oldEnd: 80, newEnd: 70 } or, in TextChangeRange - // semantics: { { start: 10, length: 70 }, newLength: 60 } - // - // The math then works out as follows. - // If we have { oldStart1, oldEnd1, newEnd1 } and { oldStart2, oldEnd2, newEnd2 } then we can compute the - // final result like so: - // - // { - // oldStart3: Min(oldStart1, oldStart2), - // oldEnd3 : Max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)), - // newEnd3 : Max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)) - // } - - let oldStart1 = oldStartN; - let oldEnd1 = oldEndN; - let newEnd1 = newEndN; - - let oldStart2 = nextChange.span.start; - let oldEnd2 = textSpanEnd(nextChange.span); - let newEnd2 = oldStart2 + nextChange.newLength; - - oldStartN = Math.min(oldStart1, oldStart2); - oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)); - newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)); - } - - return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), /*newLength:*/ newEndN - oldStartN); - } - + export function nodeStartsNewLexicalEnvironment(n: Node): boolean { return isFunctionLike(n) || n.kind === SyntaxKind.ModuleDeclaration || n.kind === SyntaxKind.SourceFile; } @@ -1368,7 +1166,13 @@ module ts { return node; } - // @internal + export function createSynthesizedNodeArray(): NodeArray { + var array = >[]; + array.pos = -1; + array.end = -1; + return array; + } + export function createDiagnosticCollection(): DiagnosticCollection { let nonFileDiagnostics: Diagnostic[] = []; let fileDiagnostics: Map = {}; @@ -1816,6 +1620,55 @@ module ts { } } + export function modifierToFlag(token: SyntaxKind): NodeFlags { + switch (token) { + case SyntaxKind.StaticKeyword: return NodeFlags.Static; + case SyntaxKind.PublicKeyword: return NodeFlags.Public; + case SyntaxKind.ProtectedKeyword: return NodeFlags.Protected; + case SyntaxKind.PrivateKeyword: return NodeFlags.Private; + case SyntaxKind.ExportKeyword: return NodeFlags.Export; + case SyntaxKind.DeclareKeyword: return NodeFlags.Ambient; + case SyntaxKind.ConstKeyword: return NodeFlags.Const; + case SyntaxKind.DefaultKeyword: return NodeFlags.Default; + } + return 0; + } + + export function isLeftHandSideExpression(expr: Expression): boolean { + if (expr) { + switch (expr.kind) { + case SyntaxKind.PropertyAccessExpression: + case SyntaxKind.ElementAccessExpression: + case SyntaxKind.NewExpression: + case SyntaxKind.CallExpression: + case SyntaxKind.TaggedTemplateExpression: + case SyntaxKind.ArrayLiteralExpression: + case SyntaxKind.ParenthesizedExpression: + case SyntaxKind.ObjectLiteralExpression: + case SyntaxKind.ClassExpression: + case SyntaxKind.FunctionExpression: + case SyntaxKind.Identifier: + case SyntaxKind.RegularExpressionLiteral: + case SyntaxKind.NumericLiteral: + case SyntaxKind.StringLiteral: + case SyntaxKind.NoSubstitutionTemplateLiteral: + case SyntaxKind.TemplateExpression: + case SyntaxKind.FalseKeyword: + case SyntaxKind.NullKeyword: + case SyntaxKind.ThisKeyword: + case SyntaxKind.TrueKeyword: + case SyntaxKind.SuperKeyword: + return true; + } + } + + return false; + } + + export function isAssignmentOperator(token: SyntaxKind): boolean { + return token >= SyntaxKind.FirstAssignment && token <= SyntaxKind.LastAssignment; + } + // 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 { @@ -1843,3 +1696,220 @@ module ts { return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & NodeFlags.Default) ? symbol.valueDeclaration.localSymbol : undefined; } } + +module ts { + export function getDefaultLibFileName(options: CompilerOptions): string { + return options.target === ScriptTarget.ES6 ? "lib.es6.d.ts" : "lib.d.ts"; + } + + export function textSpanEnd(span: TextSpan) { + return span.start + span.length + } + + export function textSpanIsEmpty(span: TextSpan) { + return span.length === 0 + } + + export function textSpanContainsPosition(span: TextSpan, position: number) { + return position >= span.start && position < textSpanEnd(span); + } + + // Returns true if 'span' contains 'other'. + export function textSpanContainsTextSpan(span: TextSpan, other: TextSpan) { + return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span); + } + + export function textSpanOverlapsWith(span: TextSpan, other: TextSpan) { + let overlapStart = Math.max(span.start, other.start); + let overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other)); + return overlapStart < overlapEnd; + } + + export function textSpanOverlap(span1: TextSpan, span2: TextSpan) { + let overlapStart = Math.max(span1.start, span2.start); + let overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); + if (overlapStart < overlapEnd) { + return createTextSpanFromBounds(overlapStart, overlapEnd); + } + return undefined; + } + + export function textSpanIntersectsWithTextSpan(span: TextSpan, other: TextSpan) { + return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start + } + + export function textSpanIntersectsWith(span: TextSpan, start: number, length: number) { + let end = start + length; + return start <= textSpanEnd(span) && end >= span.start; + } + + export function textSpanIntersectsWithPosition(span: TextSpan, position: number) { + return position <= textSpanEnd(span) && position >= span.start; + } + + export function textSpanIntersection(span1: TextSpan, span2: TextSpan) { + let intersectStart = Math.max(span1.start, span2.start); + let intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); + if (intersectStart <= intersectEnd) { + return createTextSpanFromBounds(intersectStart, intersectEnd); + } + return undefined; + } + + export function createTextSpan(start: number, length: number): TextSpan { + if (start < 0) { + throw new Error("start < 0"); + } + if (length < 0) { + throw new Error("length < 0"); + } + + return { start, length }; + } + + export function createTextSpanFromBounds(start: number, end: number) { + return createTextSpan(start, end - start); + } + + export function textChangeRangeNewSpan(range: TextChangeRange) { + return createTextSpan(range.span.start, range.newLength); + } + + export function textChangeRangeIsUnchanged(range: TextChangeRange) { + return textSpanIsEmpty(range.span) && range.newLength === 0; + } + + export function createTextChangeRange(span: TextSpan, newLength: number): TextChangeRange { + if (newLength < 0) { + throw new Error("newLength < 0"); + } + + return { span, newLength }; + } + + export let unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0); + + /** + * Called to merge all the changes that occurred across several versions of a script snapshot + * into a single change. i.e. if a user keeps making successive edits to a script we will + * have a text change from V1 to V2, V2 to V3, ..., Vn. + * + * This function will then merge those changes into a single change range valid between V1 and + * Vn. + */ + export function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange { + if (changes.length === 0) { + return unchangedTextChangeRange; + } + + if (changes.length === 1) { + return changes[0]; + } + + // We change from talking about { { oldStart, oldLength }, newLength } to { oldStart, oldEnd, newEnd } + // as it makes things much easier to reason about. + let change0 = changes[0]; + + let oldStartN = change0.span.start; + let oldEndN = textSpanEnd(change0.span); + let newEndN = oldStartN + change0.newLength; + + for (let i = 1; i < changes.length; i++) { + let nextChange = changes[i]; + + // Consider the following case: + // i.e. two edits. The first represents the text change range { { 10, 50 }, 30 }. i.e. The span starting + // at 10, with length 50 is reduced to length 30. The second represents the text change range { { 30, 30 }, 40 }. + // i.e. the span starting at 30 with length 30 is increased to length 40. + // + // 0 10 20 30 40 50 60 70 80 90 100 + // ------------------------------------------------------------------------------------------------------- + // | / + // | /---- + // T1 | /---- + // | /---- + // | /---- + // ------------------------------------------------------------------------------------------------------- + // | \ + // | \ + // T2 | \ + // | \ + // | \ + // ------------------------------------------------------------------------------------------------------- + // + // Merging these turns out to not be too difficult. First, determining the new start of the change is trivial + // it's just the min of the old and new starts. i.e.: + // + // 0 10 20 30 40 50 60 70 80 90 100 + // ------------------------------------------------------------*------------------------------------------ + // | / + // | /---- + // T1 | /---- + // | /---- + // | /---- + // ----------------------------------------$-------------------$------------------------------------------ + // . | \ + // . | \ + // T2 . | \ + // . | \ + // . | \ + // ----------------------------------------------------------------------*-------------------------------- + // + // (Note the dots represent the newly inferrred start. + // Determining the new and old end is also pretty simple. Basically it boils down to paying attention to the + // absolute positions at the asterixes, and the relative change between the dollar signs. Basically, we see + // which if the two $'s precedes the other, and we move that one forward until they line up. in this case that + // means: + // + // 0 10 20 30 40 50 60 70 80 90 100 + // --------------------------------------------------------------------------------*---------------------- + // | / + // | /---- + // T1 | /---- + // | /---- + // | /---- + // ------------------------------------------------------------$------------------------------------------ + // . | \ + // . | \ + // T2 . | \ + // . | \ + // . | \ + // ----------------------------------------------------------------------*-------------------------------- + // + // In other words (in this case), we're recognizing that the second edit happened after where the first edit + // ended with a delta of 20 characters (60 - 40). Thus, if we go back in time to where the first edit started + // that's the same as if we started at char 80 instead of 60. + // + // As it so happens, the same logic applies if the second edit precedes the first edit. In that case rahter + // than pusing the first edit forward to match the second, we'll push the second edit forward to match the + // first. + // + // In this case that means we have { oldStart: 10, oldEnd: 80, newEnd: 70 } or, in TextChangeRange + // semantics: { { start: 10, length: 70 }, newLength: 60 } + // + // The math then works out as follows. + // If we have { oldStart1, oldEnd1, newEnd1 } and { oldStart2, oldEnd2, newEnd2 } then we can compute the + // final result like so: + // + // { + // oldStart3: Min(oldStart1, oldStart2), + // oldEnd3 : Max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)), + // newEnd3 : Max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)) + // } + + let oldStart1 = oldStartN; + let oldEnd1 = oldEndN; + let newEnd1 = newEndN; + + let oldStart2 = nextChange.span.start; + let oldEnd2 = textSpanEnd(nextChange.span); + let newEnd2 = oldStart2 + nextChange.newLength; + + oldStartN = Math.min(oldStart1, oldStart2); + oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)); + newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)); + } + + return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), /*newLength:*/ newEndN - oldStartN); + } +} diff --git a/src/harness/compilerRunner.ts b/src/harness/compilerRunner.ts index d4dd8e31258..42a0cabe48c 100644 --- a/src/harness/compilerRunner.ts +++ b/src/harness/compilerRunner.ts @@ -253,6 +253,10 @@ class CompilerBaselineRunner extends RunnerBase { }); it('Correct type baselines for ' + fileName, () => { + if (fileName.indexOf("APISample") >= 0) { + return; + } + // NEWTODO: Type baselines if (result.errors.length === 0) { // The full walker simulates the types that you would get from doing a full @@ -270,29 +274,53 @@ class CompilerBaselineRunner extends RunnerBase { // These types are equivalent, but depend on what order the compiler observed // certain parts of the program. - var fullWalker = new TypeWriterWalker(program, /*fullTypeCheck:*/ true); - var pullWalker = new TypeWriterWalker(program, /*fullTypeCheck:*/ false); + let allFiles = toBeCompiled.concat(otherFiles).filter(file => !!program.getSourceFile(file.unitName)); - var fullTypes = generateTypes(fullWalker); - var pullTypes = generateTypes(pullWalker); + let fullWalker = new TypeWriterWalker(program, /*fullTypeCheck:*/ true); + let pullWalker = new TypeWriterWalker(program, /*fullTypeCheck:*/ false); - if (fullTypes !== pullTypes) { - Harness.Baseline.runBaseline('Correct full expression types for ' + fileName, justName.replace(/\.ts/, '.types'), () => fullTypes); - Harness.Baseline.runBaseline('Correct pull expression types for ' + fileName, justName.replace(/\.ts/, '.types.pull'), () => pullTypes); - } - else { - Harness.Baseline.runBaseline('Correct expression types for ' + fileName, justName.replace(/\.ts/, '.types'), () => fullTypes); + let fullResults: ts.Map = {}; + let pullResults: ts.Map = {}; + + for (let sourceFile of allFiles) { + fullResults[sourceFile.unitName] = fullWalker.getTypeAndSymbols(sourceFile.unitName); + pullResults[sourceFile.unitName] = fullWalker.getTypeAndSymbols(sourceFile.unitName); } - function generateTypes(walker: TypeWriterWalker): string { - var allFiles = toBeCompiled.concat(otherFiles).filter(file => !!program.getSourceFile(file.unitName)); - var typeLines: string[] = []; - var typeMap: { [fileName: string]: { [lineNum: number]: string[]; } } = {}; + // Produce baselines. The first gives the types for all expressions. + // The second gives symbols for all identifiers. + checkBaseLines(/*isSymbolBaseLine:*/ false); + checkBaseLines(/*isSymbolBaseLine:*/ true); + + function checkBaseLines(isSymbolBaseLine: boolean) { + let fullBaseLine = generateBaseLine(fullResults, isSymbolBaseLine); + let pullBaseLine = generateBaseLine(pullResults, isSymbolBaseLine); + + let fullExtension = isSymbolBaseLine ? '.symbols' : '.types'; + let pullExtension = isSymbolBaseLine ? '.symbols.pull' : '.types.pull'; + + if (fullBaseLine !== pullBaseLine) { + Harness.Baseline.runBaseline('Correct full information for ' + fileName, justName.replace(/\.ts/, fullExtension), () => fullBaseLine); + Harness.Baseline.runBaseline('Correct pull information for ' + fileName, justName.replace(/\.ts/, pullExtension), () => pullBaseLine); + } + else { + Harness.Baseline.runBaseline('Correct information for ' + fileName, justName.replace(/\.ts/, fullExtension), () => fullBaseLine); + } + } + + function generateBaseLine(typeWriterResults: ts.Map, isSymbolBaseline: boolean): string { + let typeLines: string[] = []; + let typeMap: { [fileName: string]: { [lineNum: number]: string[]; } } = {}; allFiles.forEach(file => { var codeLines = file.content.split('\n'); - walker.getTypes(file.unitName).forEach(result => { - var formattedLine = result.sourceText.replace(/\r?\n/g, "") + " : " + result.type; + typeWriterResults[file.unitName].forEach(result => { + if (isSymbolBaseline && !result.symbol) { + return; + } + + var typeOrSymbolString = isSymbolBaseline ? result.symbol : result.type; + var formattedLine = result.sourceText.replace(/\r?\n/g, "") + " : " + typeOrSymbolString; if (!typeMap[file.unitName]) { typeMap[file.unitName] = {}; } @@ -316,11 +344,13 @@ class CompilerBaselineRunner extends RunnerBase { typeLines.push('>' + ty + '\r\n'); }); if (i + 1 < codeLines.length && (codeLines[i + 1].match(/^\s*[{|}]\s*$/) || codeLines[i + 1].trim() === '')) { - } else { + } + else { typeLines.push('\r\n'); } } - } else { + } + else { typeLines.push('No type information for this code.'); } } diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index 299ba52bdeb..bce4c9828fa 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -336,6 +336,9 @@ module Harness.LanguageService { getOccurrencesAtPosition(fileName: string, position: number): ts.ReferenceEntry[] { return unwrapJSONCallResult(this.shim.getOccurrencesAtPosition(fileName, position)); } + getDocumentHighlights(fileName: string, position: number, filesToSearch: string[]): ts.DocumentHighlights[] { + return unwrapJSONCallResult(this.shim.getDocumentHighlights(fileName, position, JSON.stringify(filesToSearch))); + } getNavigateToItems(searchValue: string): ts.NavigateToItem[] { return unwrapJSONCallResult(this.shim.getNavigateToItems(searchValue)); } diff --git a/src/harness/typeWriter.ts b/src/harness/typeWriter.ts index 4c50e0e0cad..533f90a2d83 100644 --- a/src/harness/typeWriter.ts +++ b/src/harness/typeWriter.ts @@ -1,9 +1,9 @@ interface TypeWriterResult { line: number; - column: number; syntaxKind: number; sourceText: string; type: string; + symbol: string; } class TypeWriterWalker { @@ -20,7 +20,7 @@ class TypeWriterWalker { : program.getTypeChecker(); } - public getTypes(fileName: string): TypeWriterResult[] { + public getTypeAndSymbols(fileName: string): TypeWriterResult[] { var sourceFile = this.program.getSourceFile(fileName); this.currentSourceFile = sourceFile; this.results = []; @@ -29,90 +29,43 @@ class TypeWriterWalker { } private visitNode(node: ts.Node): void { - switch (node.kind) { - // Should always log expressions that are not tokens - // Also, always log the "this" keyword - // TODO: Ideally we should log all expressions, but to compare to the - // old typeWriter baselines, suppress tokens - case ts.SyntaxKind.ThisKeyword: - case ts.SyntaxKind.SuperKeyword: - case ts.SyntaxKind.ArrayLiteralExpression: - case ts.SyntaxKind.ObjectLiteralExpression: - case ts.SyntaxKind.ElementAccessExpression: - case ts.SyntaxKind.CallExpression: - case ts.SyntaxKind.NewExpression: - case ts.SyntaxKind.TypeAssertionExpression: - case ts.SyntaxKind.ParenthesizedExpression: - case ts.SyntaxKind.FunctionExpression: - case ts.SyntaxKind.ArrowFunction: - case ts.SyntaxKind.TypeOfExpression: - case ts.SyntaxKind.VoidExpression: - case ts.SyntaxKind.DeleteExpression: - case ts.SyntaxKind.PrefixUnaryExpression: - case ts.SyntaxKind.PostfixUnaryExpression: - case ts.SyntaxKind.BinaryExpression: - case ts.SyntaxKind.ConditionalExpression: - case ts.SyntaxKind.SpreadElementExpression: - 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 - case ts.SyntaxKind.Identifier: - var identifier = node; - if (!this.isLabel(identifier)) { - var type = this.getTypeOfNode(identifier); - this.log(node, type); - } - break; + if (ts.isExpression(node) || node.kind === ts.SyntaxKind.Identifier) { + this.logTypeAndSymbol(node); } ts.forEachChild(node, child => this.visitNode(child)); } - private isLabel(identifier: ts.Identifier): boolean { - var parent = identifier.parent; - switch (parent.kind) { - case ts.SyntaxKind.ContinueStatement: - case ts.SyntaxKind.BreakStatement: - return (parent).label === identifier; - case ts.SyntaxKind.LabeledStatement: - return (parent).label === identifier; - } - return false; - } - - private log(node: ts.Node, type: ts.Type): void { + private logTypeAndSymbol(node: ts.Node): void { var actualPos = ts.skipTrivia(this.currentSourceFile.text, node.pos); var lineAndCharacter = this.currentSourceFile.getLineAndCharacterOfPosition(actualPos); var sourceText = ts.getTextOfNodeFromSourceText(this.currentSourceFile.text, node); - - // If we got an unknown type, we temporarily want to fall back to just pretending the name - // (source text) of the node is the type. This is to align with the old typeWriter to make - // baseline comparisons easier. In the long term, we will want to just call typeToString - this.results.push({ - line: lineAndCharacter.line, - // todo(cyrusn): Not sure why column is one-based for type-writer. But I'm preserving - // that behavior to prevent having a lot of baselines to fix up. - column: lineAndCharacter.character + 1, - syntaxKind: node.kind, - sourceText: sourceText, - type: this.checker.typeToString(type, node.parent, ts.TypeFormatFlags.NoTruncation | ts.TypeFormatFlags.WriteOwnNameForAnyLike) - }); - } - private getTypeOfNode(node: ts.Node): ts.Type { var type = this.checker.getTypeAtLocation(node); ts.Debug.assert(type !== undefined, "type doesn't exist"); - return type; + var symbol = this.checker.getSymbolAtLocation(node); + + var typeString = this.checker.typeToString(type, node.parent, ts.TypeFormatFlags.NoTruncation); + var symbolString: string; + if (symbol) { + symbolString = "Symbol(" + this.checker.symbolToString(symbol, node.parent); + if (symbol.declarations) { + for (let declaration of symbol.declarations) { + symbolString += ", "; + let declSourceFile = declaration.getSourceFile(); + let declLineAndCharacter = declSourceFile.getLineAndCharacterOfPosition(declaration.pos); + symbolString += `Decl(${ ts.getBaseFileName(declSourceFile.fileName) }, ${ declLineAndCharacter.line }, ${ declLineAndCharacter.character })` + } + } + symbolString += ")"; + } + + this.results.push({ + line: lineAndCharacter.line, + syntaxKind: node.kind, + sourceText: sourceText, + type: typeString, + symbol: symbolString + }); } } diff --git a/src/lib/core.d.ts b/src/lib/core.d.ts index 3d830ae5203..822b7ca5202 100644 --- a/src/lib/core.d.ts +++ b/src/lib/core.d.ts @@ -823,7 +823,7 @@ interface RegExp { */ test(string: string): boolean; - /** Returns a copy of the text of the regular expression pattern. Read-only. The rgExp argument is a Regular expression object. It can be a variable name or a literal. */ + /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */ source: string; /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */ diff --git a/src/lib/dom.generated.d.ts b/src/lib/dom.generated.d.ts index 53f21708b3f..1958bf55439 100644 --- a/src/lib/dom.generated.d.ts +++ b/src/lib/dom.generated.d.ts @@ -1,33 +1,96 @@ + ///////////////////////////// /// IE DOM APIs ///////////////////////////// - -interface PositionOptions { - enableHighAccuracy?: boolean; - timeout?: number; - maximumAge?: number; +interface Algorithm { + name?: string; } -interface ObjectURLOptions { - oneTimeOnly?: boolean; +interface AriaRequestEventInit extends EventInit { + attributeName?: string; + attributeValue?: string; } -interface StoreExceptionsInformation extends ExceptionInformation { - siteName?: string; - explanationString?: string; - detailURI?: string; +interface ClipboardEventInit extends EventInit { + data?: string; + dataType?: string; } -interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation { - arrayOfDomainStrings?: string[]; +interface CommandEventInit extends EventInit { + commandName?: string; + detail?: string; +} + +interface CompositionEventInit extends UIEventInit { + data?: string; } interface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation { arrayOfDomainStrings?: string[]; } -interface AlgorithmParameters { +interface CustomEventInit extends EventInit { + detail?: any; +} + +interface DeviceAccelerationDict { + x?: number; + y?: number; + z?: number; +} + +interface DeviceRotationRateDict { + alpha?: number; + beta?: number; + gamma?: number; +} + +interface EventInit { + bubbles?: boolean; + cancelable?: boolean; +} + +interface ExceptionInformation { + domain?: string; +} + +interface FocusEventInit extends UIEventInit { + relatedTarget?: EventTarget; +} + +interface HashChangeEventInit extends EventInit { + newURL?: string; + oldURL?: string; +} + +interface KeyAlgorithm { + name?: string; +} + +interface KeyboardEventInit extends SharedKeyboardAndMouseEventInit { + key?: string; + location?: number; + repeat?: boolean; +} + +interface MouseEventInit extends SharedKeyboardAndMouseEventInit { + screenX?: number; + screenY?: number; + clientX?: number; + clientY?: number; + button?: number; + buttons?: number; + relatedTarget?: EventTarget; +} + +interface MsZoomToOptions { + contentX?: number; + contentY?: number; + viewportX?: string; + viewportY?: string; + scaleFactor?: number; + animate?: string; } interface MutationObserverInit { @@ -40,6 +103,10 @@ interface MutationObserverInit { attributeFilter?: string[]; } +interface ObjectURLOptions { + oneTimeOnly?: boolean; +} + interface PointerEventInit extends MouseEventInit { pointerId?: number; width?: number; @@ -51,52 +118,43 @@ interface PointerEventInit extends MouseEventInit { isPrimary?: boolean; } -interface ExceptionInformation { - domain?: string; +interface PositionOptions { + enableHighAccuracy?: boolean; + timeout?: number; + maximumAge?: number; } -interface DeviceAccelerationDict { - x?: number; - y?: number; - z?: number; -} - -interface MsZoomToOptions { - contentX?: number; - contentY?: number; - viewportX?: string; - viewportY?: string; - scaleFactor?: number; - animate?: string; -} - -interface DeviceRotationRateDict { - alpha?: number; - beta?: number; - gamma?: number; -} - -interface Algorithm { - name?: string; - params?: AlgorithmParameters; -} - -interface MouseEventInit { - bubbles?: boolean; - cancelable?: boolean; - view?: Window; - detail?: number; - screenX?: number; - screenY?: number; - clientX?: number; - clientY?: number; +interface SharedKeyboardAndMouseEventInit extends UIEventInit { ctrlKey?: boolean; shiftKey?: boolean; altKey?: boolean; metaKey?: boolean; - button?: number; - buttons?: number; - relatedTarget?: EventTarget; + keyModifierStateAltGraph?: boolean; + keyModifierStateCapsLock?: boolean; + keyModifierStateFn?: boolean; + keyModifierStateFnLock?: boolean; + keyModifierStateHyper?: boolean; + keyModifierStateNumLock?: boolean; + keyModifierStateOS?: boolean; + keyModifierStateScrollLock?: boolean; + keyModifierStateSuper?: boolean; + keyModifierStateSymbol?: boolean; + keyModifierStateSymbolLock?: boolean; +} + +interface StoreExceptionsInformation extends ExceptionInformation { + siteName?: string; + explanationString?: string; + detailURI?: string; +} + +interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation { + arrayOfDomainStrings?: string[]; +} + +interface UIEventInit extends EventInit { + view?: Window; + detail?: number; } interface WebGLContextAttributes { @@ -108,526 +166,1863 @@ interface WebGLContextAttributes { preserveDrawingBuffer?: boolean; } -interface NodeListOf extends NodeList { - length: number; - item(index: number): TNode; - [index: number]: TNode; +interface WebGLContextEventInit extends EventInit { + statusMessage?: string; } -interface HTMLElement extends Element, ElementCSSInlineStyle, MSEventAttachmentTarget, MSNodeExtensions { - hidden: any; - readyState: any; - onmouseleave: (ev: MouseEvent) => any; - onbeforecut: (ev: DragEvent) => any; - onkeydown: (ev: KeyboardEvent) => any; - onmove: (ev: MSEventObj) => any; - onkeyup: (ev: KeyboardEvent) => any; - onreset: (ev: Event) => any; - onhelp: (ev: Event) => any; - ondragleave: (ev: DragEvent) => any; - className: string; - onfocusin: (ev: FocusEvent) => any; - onseeked: (ev: Event) => any; - recordNumber: any; - title: string; - parentTextEdit: Element; - outerHTML: string; - ondurationchange: (ev: Event) => any; - offsetHeight: number; - all: HTMLCollection; - onblur: (ev: FocusEvent) => any; - dir: string; - onemptied: (ev: Event) => any; - onseeking: (ev: Event) => any; - oncanplay: (ev: Event) => any; - ondeactivate: (ev: UIEvent) => any; - ondatasetchanged: (ev: MSEventObj) => any; - onrowsdelete: (ev: MSEventObj) => any; - sourceIndex: number; - onloadstart: (ev: Event) => any; - onlosecapture: (ev: MSEventObj) => any; - ondragenter: (ev: DragEvent) => any; - oncontrolselect: (ev: MSEventObj) => any; - onsubmit: (ev: Event) => any; - behaviorUrns: MSBehaviorUrnsCollection; - scopeName: string; - onchange: (ev: Event) => any; - id: string; - onlayoutcomplete: (ev: MSEventObj) => any; - uniqueID: string; - onbeforeactivate: (ev: UIEvent) => any; - oncanplaythrough: (ev: Event) => any; - onbeforeupdate: (ev: MSEventObj) => any; - onfilterchange: (ev: MSEventObj) => any; - offsetParent: Element; - ondatasetcomplete: (ev: MSEventObj) => any; - onsuspend: (ev: Event) => any; - onmouseenter: (ev: MouseEvent) => any; - innerText: string; - onerrorupdate: (ev: MSEventObj) => any; - onmouseout: (ev: MouseEvent) => any; - parentElement: HTMLElement; - onmousewheel: (ev: MouseWheelEvent) => any; - onvolumechange: (ev: Event) => any; - oncellchange: (ev: MSEventObj) => any; - onrowexit: (ev: MSEventObj) => any; - onrowsinserted: (ev: MSEventObj) => any; - onpropertychange: (ev: MSEventObj) => any; - filters: any; - children: HTMLCollection; - ondragend: (ev: DragEvent) => any; - onbeforepaste: (ev: DragEvent) => any; - ondragover: (ev: DragEvent) => any; - offsetTop: number; - onmouseup: (ev: MouseEvent) => any; - ondragstart: (ev: DragEvent) => any; - onbeforecopy: (ev: DragEvent) => any; - ondrag: (ev: DragEvent) => any; - innerHTML: string; - onmouseover: (ev: MouseEvent) => any; - lang: string; - uniqueNumber: number; - onpause: (ev: Event) => any; - tagUrn: string; - onmousedown: (ev: MouseEvent) => any; - onclick: (ev: MouseEvent) => any; - onwaiting: (ev: Event) => any; - onresizestart: (ev: MSEventObj) => any; - offsetLeft: number; - isTextEdit: boolean; - isDisabled: boolean; - onpaste: (ev: DragEvent) => any; - canHaveHTML: boolean; - onmoveend: (ev: MSEventObj) => any; - language: string; - onstalled: (ev: Event) => any; - onmousemove: (ev: MouseEvent) => any; - style: MSStyleCSSProperties; - isContentEditable: boolean; - onbeforeeditfocus: (ev: MSEventObj) => any; - onratechange: (ev: Event) => any; - contentEditable: string; - tabIndex: number; - document: Document; +interface WheelEventInit extends MouseEventInit { + deltaX?: number; + deltaY?: number; + deltaZ?: number; + deltaMode?: number; +} + +interface EventListener { + (evt: Event): void; +} + +interface ANGLE_instanced_arrays { + drawArraysInstancedANGLE(mode: number, first: number, count: number, primcount: number): void; + drawElementsInstancedANGLE(mode: number, count: number, type: number, offset: number, primcount: number): void; + vertexAttribDivisorANGLE(index: number, divisor: number): void; + VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; +} + +declare var ANGLE_instanced_arrays: { + prototype: ANGLE_instanced_arrays; + new(): ANGLE_instanced_arrays; + VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; +} + +interface AnalyserNode extends AudioNode { + fftSize: number; + frequencyBinCount: number; + maxDecibels: number; + minDecibels: number; + smoothingTimeConstant: number; + getByteFrequencyData(array: Uint8Array): void; + getByteTimeDomainData(array: Uint8Array): void; + getFloatFrequencyData(array: any): void; + getFloatTimeDomainData(array: any): void; +} + +declare var AnalyserNode: { + prototype: AnalyserNode; + new(): AnalyserNode; +} + +interface AnimationEvent extends Event { + animationName: string; + elapsedTime: number; + initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void; +} + +declare var AnimationEvent: { + prototype: AnimationEvent; + new(): AnimationEvent; +} + +interface ApplicationCache extends EventTarget { + oncached: (ev: Event) => any; + onchecking: (ev: Event) => any; + ondownloading: (ev: Event) => any; + onerror: (ev: Event) => any; + onnoupdate: (ev: Event) => any; + onobsolete: (ev: Event) => any; onprogress: (ev: ProgressEvent) => any; - ondblclick: (ev: MouseEvent) => any; - oncontextmenu: (ev: MouseEvent) => any; - onloadedmetadata: (ev: Event) => any; - onafterupdate: (ev: MSEventObj) => any; - onerror: (ev: ErrorEvent) => any; - onplay: (ev: Event) => any; - onresizeend: (ev: MSEventObj) => any; - onplaying: (ev: Event) => any; - isMultiLine: boolean; - onfocusout: (ev: FocusEvent) => any; - onabort: (ev: UIEvent) => any; - ondataavailable: (ev: MSEventObj) => any; - hideFocus: boolean; - onreadystatechange: (ev: Event) => any; - onkeypress: (ev: KeyboardEvent) => any; - onloadeddata: (ev: Event) => any; - onbeforedeactivate: (ev: UIEvent) => any; - outerText: string; - disabled: boolean; - onactivate: (ev: UIEvent) => any; - accessKey: string; - onmovestart: (ev: MSEventObj) => any; - onselectstart: (ev: Event) => any; - onfocus: (ev: FocusEvent) => any; - ontimeupdate: (ev: Event) => any; - onresize: (ev: UIEvent) => any; - oncut: (ev: DragEvent) => any; - onselect: (ev: UIEvent) => any; - ondrop: (ev: DragEvent) => any; - offsetWidth: number; - oncopy: (ev: DragEvent) => any; - onended: (ev: Event) => any; - onscroll: (ev: UIEvent) => any; - onrowenter: (ev: MSEventObj) => any; - onload: (ev: Event) => any; - canHaveChildren: boolean; - oninput: (ev: Event) => any; - onmscontentzoom: (ev: MSEventObj) => any; - oncuechange: (ev: Event) => any; - spellcheck: boolean; - classList: DOMTokenList; - onmsmanipulationstatechanged: (ev: any) => any; - draggable: boolean; - dataset: DOMStringMap; - dragDrop(): boolean; - scrollIntoView(top?: boolean): void; - addFilter(filter: any): void; - setCapture(containerCapture?: boolean): void; - focus(): void; - getAdjacentText(where: string): string; - insertAdjacentText(where: string, text: string): void; - getElementsByClassName(classNames: string): NodeList; - setActive(): void; - removeFilter(filter: any): void; - blur(): void; - clearAttributes(): void; - releaseCapture(): void; - createControlRange(): ControlRangeCollection; - removeBehavior(cookie: number): boolean; - contains(child: HTMLElement): boolean; - click(): void; - insertAdjacentElement(position: string, insertedElement: Element): Element; - mergeAttributes(source: HTMLElement, preserveIdentity?: boolean): void; - replaceAdjacentText(where: string, newText: string): string; - applyElement(apply: Element, where?: string): Element; - addBehavior(bstrUrl: string, factory?: any): number; - insertAdjacentHTML(where: string, html: string): void; - msGetInputContext(): MSInputMethodContext; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + onupdateready: (ev: Event) => any; + status: number; + abort(): void; + swapCache(): void; + update(): void; + CHECKING: number; + DOWNLOADING: number; + IDLE: number; + OBSOLETE: number; + UNCACHED: number; + UPDATEREADY: number; + addEventListener(type: "cached", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "checking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "downloading", listener: (ev: Event) => any, useCapture?: boolean): void; addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLElement: { - prototype: HTMLElement; - new(): HTMLElement; + addEventListener(type: "noupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "obsolete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "updateready", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface Document extends Node, NodeSelector, MSEventAttachmentTarget, DocumentEvent, MSResourceMetadata, MSNodeExtensions, MSDocumentExtensions, GlobalEventHandlers { +declare var ApplicationCache: { + prototype: ApplicationCache; + new(): ApplicationCache; + CHECKING: number; + DOWNLOADING: number; + IDLE: number; + OBSOLETE: number; + UNCACHED: number; + UPDATEREADY: number; +} + +interface AriaRequestEvent extends Event { + attributeName: string; + attributeValue: string; +} + +declare var AriaRequestEvent: { + prototype: AriaRequestEvent; + new(type: string, eventInitDict?: AriaRequestEventInit): AriaRequestEvent; +} + +interface Attr extends Node { + name: string; + ownerElement: Element; + specified: boolean; + value: string; +} + +declare var Attr: { + prototype: Attr; + new(): Attr; +} + +interface AudioBuffer { + duration: number; + length: number; + numberOfChannels: number; + sampleRate: number; + getChannelData(channel: number): any; +} + +declare var AudioBuffer: { + prototype: AudioBuffer; + new(): AudioBuffer; +} + +interface AudioBufferSourceNode extends AudioNode { + buffer: AudioBuffer; + loop: boolean; + loopEnd: number; + loopStart: number; + onended: (ev: Event) => any; + playbackRate: AudioParam; + start(when?: number, offset?: number, duration?: number): void; + stop(when?: number): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var AudioBufferSourceNode: { + prototype: AudioBufferSourceNode; + new(): AudioBufferSourceNode; +} + +interface AudioContext extends EventTarget { + currentTime: number; + destination: AudioDestinationNode; + listener: AudioListener; + sampleRate: number; + createAnalyser(): AnalyserNode; + createBiquadFilter(): BiquadFilterNode; + createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer; + createBufferSource(): AudioBufferSourceNode; + createChannelMerger(numberOfInputs?: number): ChannelMergerNode; + createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode; + createConvolver(): ConvolverNode; + createDelay(maxDelayTime?: number): DelayNode; + createDynamicsCompressor(): DynamicsCompressorNode; + createGain(): GainNode; + createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode; + createOscillator(): OscillatorNode; + createPanner(): PannerNode; + createPeriodicWave(real: any, imag: any): PeriodicWave; + createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode; + createStereoPanner(): StereoPannerNode; + createWaveShaper(): WaveShaperNode; + decodeAudioData(audioData: ArrayBuffer, successCallback: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): void; +} + +declare var AudioContext: { + prototype: AudioContext; + new(): AudioContext; +} + +interface AudioDestinationNode extends AudioNode { + maxChannelCount: number; +} + +declare var AudioDestinationNode: { + prototype: AudioDestinationNode; + new(): AudioDestinationNode; +} + +interface AudioListener { + dopplerFactor: number; + speedOfSound: number; + setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void; + setPosition(x: number, y: number, z: number): void; + setVelocity(x: number, y: number, z: number): void; +} + +declare var AudioListener: { + prototype: AudioListener; + new(): AudioListener; +} + +interface AudioNode extends EventTarget { + channelCount: number; + channelCountMode: string; + channelInterpretation: string; + context: AudioContext; + numberOfInputs: number; + numberOfOutputs: number; + connect(destination: AudioNode, output?: number, input?: number): void; + disconnect(output?: number): void; +} + +declare var AudioNode: { + prototype: AudioNode; + new(): AudioNode; +} + +interface AudioParam { + defaultValue: number; + value: number; + cancelScheduledValues(startTime: number): void; + exponentialRampToValueAtTime(value: number, endTime: number): void; + linearRampToValueAtTime(value: number, endTime: number): void; + setTargetAtTime(target: number, startTime: number, timeConstant: number): void; + setValueAtTime(value: number, startTime: number): void; + setValueCurveAtTime(values: any, startTime: number, duration: number): void; +} + +declare var AudioParam: { + prototype: AudioParam; + new(): AudioParam; +} + +interface AudioProcessingEvent extends Event { + inputBuffer: AudioBuffer; + outputBuffer: AudioBuffer; + playbackTime: number; +} + +declare var AudioProcessingEvent: { + prototype: AudioProcessingEvent; + new(): AudioProcessingEvent; +} + +interface AudioTrack { + enabled: boolean; + id: string; + kind: string; + label: string; + language: string; + sourceBuffer: SourceBuffer; +} + +declare var AudioTrack: { + prototype: AudioTrack; + new(): AudioTrack; +} + +interface AudioTrackList extends EventTarget { + length: number; + onaddtrack: (ev: TrackEvent) => any; + onchange: (ev: Event) => any; + onremovetrack: (ev: TrackEvent) => any; + getTrackById(id: string): AudioTrack; + item(index: number): AudioTrack; + addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "removetrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: AudioTrack; +} + +declare var AudioTrackList: { + prototype: AudioTrackList; + new(): AudioTrackList; +} + +interface BarProp { + visible: boolean; +} + +declare var BarProp: { + prototype: BarProp; + new(): BarProp; +} + +interface BeforeUnloadEvent extends Event { + returnValue: any; +} + +declare var BeforeUnloadEvent: { + prototype: BeforeUnloadEvent; + new(): BeforeUnloadEvent; +} + +interface BiquadFilterNode extends AudioNode { + Q: AudioParam; + detune: AudioParam; + frequency: AudioParam; + gain: AudioParam; + type: string; + getFrequencyResponse(frequencyHz: any, magResponse: any, phaseResponse: any): void; +} + +declare var BiquadFilterNode: { + prototype: BiquadFilterNode; + new(): BiquadFilterNode; +} + +interface Blob { + size: number; + type: string; + msClose(): void; + msDetachStream(): any; + slice(start?: number, end?: number, contentType?: string): Blob; +} + +declare var Blob: { + prototype: Blob; + new (blobParts?: any[], options?: BlobPropertyBag): Blob; +} + +interface CDATASection extends Text { +} + +declare var CDATASection: { + prototype: CDATASection; + new(): CDATASection; +} + +interface CSS { + supports(property: string, value?: string): boolean; +} +declare var CSS: CSS; + +interface CSSConditionRule extends CSSGroupingRule { + conditionText: string; +} + +declare var CSSConditionRule: { + prototype: CSSConditionRule; + new(): CSSConditionRule; +} + +interface CSSFontFaceRule extends CSSRule { + style: CSSStyleDeclaration; +} + +declare var CSSFontFaceRule: { + prototype: CSSFontFaceRule; + new(): CSSFontFaceRule; +} + +interface CSSGroupingRule extends CSSRule { + cssRules: CSSRuleList; + deleteRule(index?: number): void; + insertRule(rule: string, index?: number): number; +} + +declare var CSSGroupingRule: { + prototype: CSSGroupingRule; + new(): CSSGroupingRule; +} + +interface CSSImportRule extends CSSRule { + href: string; + media: MediaList; + styleSheet: CSSStyleSheet; +} + +declare var CSSImportRule: { + prototype: CSSImportRule; + new(): CSSImportRule; +} + +interface CSSKeyframeRule extends CSSRule { + keyText: string; + style: CSSStyleDeclaration; +} + +declare var CSSKeyframeRule: { + prototype: CSSKeyframeRule; + new(): CSSKeyframeRule; +} + +interface CSSKeyframesRule extends CSSRule { + cssRules: CSSRuleList; + name: string; + appendRule(rule: string): void; + deleteRule(rule: string): void; + findRule(rule: string): CSSKeyframeRule; +} + +declare var CSSKeyframesRule: { + prototype: CSSKeyframesRule; + new(): CSSKeyframesRule; +} + +interface CSSMediaRule extends CSSConditionRule { + media: MediaList; +} + +declare var CSSMediaRule: { + prototype: CSSMediaRule; + new(): CSSMediaRule; +} + +interface CSSNamespaceRule extends CSSRule { + namespaceURI: string; + prefix: string; +} + +declare var CSSNamespaceRule: { + prototype: CSSNamespaceRule; + new(): CSSNamespaceRule; +} + +interface CSSPageRule extends CSSRule { + pseudoClass: string; + selector: string; + selectorText: string; + style: CSSStyleDeclaration; +} + +declare var CSSPageRule: { + prototype: CSSPageRule; + new(): CSSPageRule; +} + +interface CSSRule { + cssText: string; + parentRule: CSSRule; + parentStyleSheet: CSSStyleSheet; + type: number; + CHARSET_RULE: number; + FONT_FACE_RULE: number; + IMPORT_RULE: number; + KEYFRAMES_RULE: number; + KEYFRAME_RULE: number; + MEDIA_RULE: number; + NAMESPACE_RULE: number; + PAGE_RULE: number; + STYLE_RULE: number; + SUPPORTS_RULE: number; + UNKNOWN_RULE: number; + VIEWPORT_RULE: number; +} + +declare var CSSRule: { + prototype: CSSRule; + new(): CSSRule; + CHARSET_RULE: number; + FONT_FACE_RULE: number; + IMPORT_RULE: number; + KEYFRAMES_RULE: number; + KEYFRAME_RULE: number; + MEDIA_RULE: number; + NAMESPACE_RULE: number; + PAGE_RULE: number; + STYLE_RULE: number; + SUPPORTS_RULE: number; + UNKNOWN_RULE: number; + VIEWPORT_RULE: number; +} + +interface CSSRuleList { + length: number; + item(index: number): CSSRule; + [index: number]: CSSRule; +} + +declare var CSSRuleList: { + prototype: CSSRuleList; + new(): CSSRuleList; +} + +interface CSSStyleDeclaration { + alignContent: string; + alignItems: string; + alignSelf: string; + alignmentBaseline: string; + animation: string; + animationDelay: string; + animationDirection: string; + animationDuration: string; + animationFillMode: string; + animationIterationCount: string; + animationName: string; + animationPlayState: string; + animationTimingFunction: string; + backfaceVisibility: string; + background: string; + backgroundAttachment: string; + backgroundClip: string; + backgroundColor: string; + backgroundImage: string; + backgroundOrigin: string; + backgroundPosition: string; + backgroundPositionX: string; + backgroundPositionY: string; + backgroundRepeat: string; + backgroundSize: string; + baselineShift: string; + border: string; + borderBottom: string; + borderBottomColor: string; + borderBottomLeftRadius: string; + borderBottomRightRadius: string; + borderBottomStyle: string; + borderBottomWidth: string; + borderCollapse: string; + borderColor: string; + borderImage: string; + borderImageOutset: string; + borderImageRepeat: string; + borderImageSlice: string; + borderImageSource: string; + borderImageWidth: string; + borderLeft: string; + borderLeftColor: string; + borderLeftStyle: string; + borderLeftWidth: string; + borderRadius: string; + borderRight: string; + borderRightColor: string; + borderRightStyle: string; + borderRightWidth: string; + borderSpacing: string; + borderStyle: string; + borderTop: string; + borderTopColor: string; + borderTopLeftRadius: string; + borderTopRightRadius: string; + borderTopStyle: string; + borderTopWidth: string; + borderWidth: string; + bottom: string; + boxShadow: string; + boxSizing: string; + breakAfter: string; + breakBefore: string; + breakInside: string; + captionSide: string; + clear: string; + clip: string; + clipPath: string; + clipRule: string; + color: string; + colorInterpolationFilters: string; + columnCount: any; + columnFill: string; + columnGap: any; + columnRule: string; + columnRuleColor: any; + columnRuleStyle: string; + columnRuleWidth: any; + columnSpan: string; + columnWidth: any; + columns: string; + content: string; + counterIncrement: string; + counterReset: string; + cssFloat: string; + cssText: string; + cursor: string; + direction: string; + display: string; + dominantBaseline: string; + emptyCells: string; + enableBackground: string; + fill: string; + fillOpacity: string; + fillRule: string; + filter: string; + flex: string; + flexBasis: string; + flexDirection: string; + flexFlow: string; + flexGrow: string; + flexShrink: string; + flexWrap: string; + floodColor: string; + floodOpacity: string; + font: string; + fontFamily: string; + fontFeatureSettings: string; + fontSize: string; + fontSizeAdjust: string; + fontStretch: string; + fontStyle: string; + fontVariant: string; + fontWeight: string; + glyphOrientationHorizontal: string; + glyphOrientationVertical: string; + height: string; + imeMode: string; + justifyContent: string; + kerning: string; + left: string; + length: number; + letterSpacing: string; + lightingColor: string; + lineHeight: string; + listStyle: string; + listStyleImage: string; + listStylePosition: string; + listStyleType: string; + margin: string; + marginBottom: string; + marginLeft: string; + marginRight: string; + marginTop: string; + marker: string; + markerEnd: string; + markerMid: string; + markerStart: string; + mask: string; + maxHeight: string; + maxWidth: string; + minHeight: string; + minWidth: string; + msContentZoomChaining: string; + msContentZoomLimit: string; + msContentZoomLimitMax: any; + msContentZoomLimitMin: any; + msContentZoomSnap: string; + msContentZoomSnapPoints: string; + msContentZoomSnapType: string; + msContentZooming: string; + msFlowFrom: string; + msFlowInto: string; + msFontFeatureSettings: string; + msGridColumn: any; + msGridColumnAlign: string; + msGridColumnSpan: any; + msGridColumns: string; + msGridRow: any; + msGridRowAlign: string; + msGridRowSpan: any; + msGridRows: string; + msHighContrastAdjust: string; + msHyphenateLimitChars: string; + msHyphenateLimitLines: any; + msHyphenateLimitZone: any; + msHyphens: string; + msImeAlign: string; + msOverflowStyle: string; + msScrollChaining: string; + msScrollLimit: string; + msScrollLimitXMax: any; + msScrollLimitXMin: any; + msScrollLimitYMax: any; + msScrollLimitYMin: any; + msScrollRails: string; + msScrollSnapPointsX: string; + msScrollSnapPointsY: string; + msScrollSnapType: string; + msScrollSnapX: string; + msScrollSnapY: string; + msScrollTranslation: string; + msTextCombineHorizontal: string; + msTextSizeAdjust: any; + msTouchAction: string; + msTouchSelect: string; + msUserSelect: string; + msWrapFlow: string; + msWrapMargin: any; + msWrapThrough: string; + opacity: string; + order: string; + orphans: string; + outline: string; + outlineColor: string; + outlineStyle: string; + outlineWidth: string; + overflow: string; + overflowX: string; + overflowY: string; + padding: string; + paddingBottom: string; + paddingLeft: string; + paddingRight: string; + paddingTop: string; + pageBreakAfter: string; + pageBreakBefore: string; + pageBreakInside: string; + parentRule: CSSRule; + perspective: string; + perspectiveOrigin: string; + pointerEvents: string; + position: string; + quotes: string; + right: string; + rubyAlign: string; + rubyOverhang: string; + rubyPosition: string; + stopColor: string; + stopOpacity: string; + stroke: string; + strokeDasharray: string; + strokeDashoffset: string; + strokeLinecap: string; + strokeLinejoin: string; + strokeMiterlimit: string; + strokeOpacity: string; + strokeWidth: string; + tableLayout: string; + textAlign: string; + textAlignLast: string; + textAnchor: string; + textDecoration: string; + textFillColor: string; + textIndent: string; + textJustify: string; + textKashida: string; + textKashidaSpace: string; + textOverflow: string; + textShadow: string; + textTransform: string; + textUnderlinePosition: string; + top: string; + touchAction: string; + transform: string; + transformOrigin: string; + transformStyle: string; + transition: string; + transitionDelay: string; + transitionDuration: string; + transitionProperty: string; + transitionTimingFunction: string; + unicodeBidi: string; + verticalAlign: string; + visibility: string; + webkitAlignContent: string; + webkitAlignItems: string; + webkitAlignSelf: string; + webkitAnimation: string; + webkitAnimationDelay: string; + webkitAnimationDirection: string; + webkitAnimationDuration: string; + webkitAnimationFillMode: string; + webkitAnimationIterationCount: string; + webkitAnimationName: string; + webkitAnimationPlayState: string; + webkitAnimationTimingFunction: string; + webkitAppearance: string; + webkitBackfaceVisibility: string; + webkitBackground: string; + webkitBackgroundAttachment: string; + webkitBackgroundClip: string; + webkitBackgroundColor: string; + webkitBackgroundImage: string; + webkitBackgroundOrigin: string; + webkitBackgroundPosition: string; + webkitBackgroundPositionX: string; + webkitBackgroundPositionY: string; + webkitBackgroundRepeat: string; + webkitBackgroundSize: string; + webkitBorderBottomLeftRadius: string; + webkitBorderBottomRightRadius: string; + webkitBorderImage: string; + webkitBorderImageOutset: string; + webkitBorderImageRepeat: string; + webkitBorderImageSlice: string; + webkitBorderImageSource: string; + webkitBorderImageWidth: string; + webkitBorderRadius: string; + webkitBorderTopLeftRadius: string; + webkitBorderTopRightRadius: string; + webkitBoxAlign: string; + webkitBoxDirection: string; + webkitBoxFlex: string; + webkitBoxOrdinalGroup: string; + webkitBoxOrient: string; + webkitBoxPack: string; + webkitBoxSizing: string; + webkitColumnBreakAfter: string; + webkitColumnBreakBefore: string; + webkitColumnBreakInside: string; + webkitColumnCount: any; + webkitColumnGap: any; + webkitColumnRule: string; + webkitColumnRuleColor: any; + webkitColumnRuleStyle: string; + webkitColumnRuleWidth: any; + webkitColumnSpan: string; + webkitColumnWidth: any; + webkitColumns: string; + webkitFilter: string; + webkitFlex: string; + webkitFlexBasis: string; + webkitFlexDirection: string; + webkitFlexFlow: string; + webkitFlexGrow: string; + webkitFlexShrink: string; + webkitFlexWrap: string; + webkitJustifyContent: string; + webkitOrder: string; + webkitPerspective: string; + webkitPerspectiveOrigin: string; + webkitTapHighlightColor: string; + webkitTextFillColor: string; + webkitTextSizeAdjust: any; + webkitTransform: string; + webkitTransformOrigin: string; + webkitTransformStyle: string; + webkitTransition: string; + webkitTransitionDelay: string; + webkitTransitionDuration: string; + webkitTransitionProperty: string; + webkitTransitionTimingFunction: string; + webkitUserSelect: string; + webkitWritingMode: string; + whiteSpace: string; + widows: string; + width: string; + wordBreak: string; + wordSpacing: string; + wordWrap: string; + writingMode: string; + zIndex: string; + zoom: string; + getPropertyPriority(propertyName: string): string; + getPropertyValue(propertyName: string): string; + item(index: number): string; + removeProperty(propertyName: string): string; + setProperty(propertyName: string, value: string, priority?: string): void; + [index: number]: string; +} + +declare var CSSStyleDeclaration: { + prototype: CSSStyleDeclaration; + new(): CSSStyleDeclaration; +} + +interface CSSStyleRule extends CSSRule { + readOnly: boolean; + selectorText: string; + style: CSSStyleDeclaration; +} + +declare var CSSStyleRule: { + prototype: CSSStyleRule; + new(): CSSStyleRule; +} + +interface CSSStyleSheet extends StyleSheet { + cssRules: CSSRuleList; + cssText: string; + href: string; + id: string; + imports: StyleSheetList; + isAlternate: boolean; + isPrefAlternate: boolean; + ownerRule: CSSRule; + owningElement: Element; + pages: StyleSheetPageList; + readOnly: boolean; + rules: CSSRuleList; + addImport(bstrURL: string, lIndex?: number): number; + addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; + addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number; + deleteRule(index?: number): void; + insertRule(rule: string, index?: number): number; + removeImport(lIndex: number): void; + removeRule(lIndex: number): void; +} + +declare var CSSStyleSheet: { + prototype: CSSStyleSheet; + new(): CSSStyleSheet; +} + +interface CSSSupportsRule extends CSSConditionRule { +} + +declare var CSSSupportsRule: { + prototype: CSSSupportsRule; + new(): CSSSupportsRule; +} + +interface CanvasGradient { + addColorStop(offset: number, color: string): void; +} + +declare var CanvasGradient: { + prototype: CanvasGradient; + new(): CanvasGradient; +} + +interface CanvasPattern { +} + +declare var CanvasPattern: { + prototype: CanvasPattern; + new(): CanvasPattern; +} + +interface CanvasRenderingContext2D { + canvas: HTMLCanvasElement; + fillStyle: any; + font: string; + globalAlpha: number; + globalCompositeOperation: string; + lineCap: string; + lineDashOffset: number; + lineJoin: string; + lineWidth: number; + miterLimit: number; + msFillRule: string; + msImageSmoothingEnabled: boolean; + shadowBlur: number; + shadowColor: string; + shadowOffsetX: number; + shadowOffsetY: number; + strokeStyle: any; + textAlign: string; + textBaseline: string; + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; + arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; + beginPath(): void; + bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; + clearRect(x: number, y: number, w: number, h: number): void; + clip(fillRule?: string): void; + closePath(): void; + createImageData(imageDataOrSw: number, sh?: number): ImageData; + createImageData(imageDataOrSw: ImageData, sh?: number): ImageData; + createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; + createPattern(image: HTMLImageElement, repetition: string): CanvasPattern; + createPattern(image: HTMLCanvasElement, repetition: string): CanvasPattern; + createPattern(image: HTMLVideoElement, repetition: string): CanvasPattern; + createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; + drawImage(image: HTMLImageElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; + drawImage(image: HTMLCanvasElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; + drawImage(image: HTMLVideoElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; + fill(fillRule?: string): void; + fillRect(x: number, y: number, w: number, h: number): void; + fillText(text: string, x: number, y: number, maxWidth?: number): void; + getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; + getLineDash(): number[]; + isPointInPath(x: number, y: number, fillRule?: string): boolean; + lineTo(x: number, y: number): void; + measureText(text: string): TextMetrics; + moveTo(x: number, y: number): void; + putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void; + quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; + rect(x: number, y: number, w: number, h: number): void; + restore(): void; + rotate(angle: number): void; + save(): void; + scale(x: number, y: number): void; + setLineDash(segments: number[]): void; + setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; + stroke(): void; + strokeRect(x: number, y: number, w: number, h: number): void; + strokeText(text: string, x: number, y: number, maxWidth?: number): void; + transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; + translate(x: number, y: number): void; +} + +declare var CanvasRenderingContext2D: { + prototype: CanvasRenderingContext2D; + new(): CanvasRenderingContext2D; +} + +interface ChannelMergerNode extends AudioNode { +} + +declare var ChannelMergerNode: { + prototype: ChannelMergerNode; + new(): ChannelMergerNode; +} + +interface ChannelSplitterNode extends AudioNode { +} + +declare var ChannelSplitterNode: { + prototype: ChannelSplitterNode; + new(): ChannelSplitterNode; +} + +interface CharacterData extends Node, ChildNode { + data: string; + length: number; + appendData(arg: string): void; + deleteData(offset: number, count: number): void; + insertData(offset: number, arg: string): void; + replaceData(offset: number, count: number, arg: string): void; + substringData(offset: number, count: number): string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var CharacterData: { + prototype: CharacterData; + new(): CharacterData; +} + +interface ClientRect { + bottom: number; + height: number; + left: number; + right: number; + top: number; + width: number; +} + +declare var ClientRect: { + prototype: ClientRect; + new(): ClientRect; +} + +interface ClientRectList { + length: number; + item(index: number): ClientRect; + [index: number]: ClientRect; +} + +declare var ClientRectList: { + prototype: ClientRectList; + new(): ClientRectList; +} + +interface ClipboardEvent extends Event { + clipboardData: DataTransfer; +} + +declare var ClipboardEvent: { + prototype: ClipboardEvent; + new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent; +} + +interface CloseEvent extends Event { + code: number; + reason: string; + wasClean: boolean; + initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; +} + +declare var CloseEvent: { + prototype: CloseEvent; + new(): CloseEvent; +} + +interface CommandEvent extends Event { + commandName: string; + detail: string; +} + +declare var CommandEvent: { + prototype: CommandEvent; + new(type: string, eventInitDict?: CommandEventInit): CommandEvent; +} + +interface Comment extends CharacterData { + text: string; +} + +declare var Comment: { + prototype: Comment; + new(): Comment; +} + +interface CompositionEvent extends UIEvent { + data: string; + locale: string; + initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void; +} + +declare var CompositionEvent: { + prototype: CompositionEvent; + new(typeArg: string, eventInitDict?: CompositionEventInit): CompositionEvent; +} + +interface Console { + assert(test?: boolean, message?: string, ...optionalParams: any[]): void; + clear(): void; + count(countTitle?: string): void; + debug(message?: string, ...optionalParams: any[]): void; + dir(value?: any, ...optionalParams: any[]): void; + dirxml(value: any): void; + error(message?: any, ...optionalParams: any[]): void; + group(groupTitle?: string): void; + groupCollapsed(groupTitle?: string): void; + groupEnd(): void; + info(message?: any, ...optionalParams: any[]): void; + log(message?: any, ...optionalParams: any[]): void; + msIsIndependentlyComposed(element: Element): boolean; + profile(reportName?: string): void; + profileEnd(): void; + select(element: Element): void; + time(timerName?: string): void; + timeEnd(timerName?: string): void; + trace(): void; + warn(message?: any, ...optionalParams: any[]): void; +} + +declare var Console: { + prototype: Console; + new(): Console; +} + +interface ConvolverNode extends AudioNode { + buffer: AudioBuffer; + normalize: boolean; +} + +declare var ConvolverNode: { + prototype: ConvolverNode; + new(): ConvolverNode; +} + +interface Coordinates { + accuracy: number; + altitude: number; + altitudeAccuracy: number; + heading: number; + latitude: number; + longitude: number; + speed: number; +} + +declare var Coordinates: { + prototype: Coordinates; + new(): Coordinates; +} + +interface Crypto extends Object, RandomSource { + subtle: SubtleCrypto; +} + +declare var Crypto: { + prototype: Crypto; + new(): Crypto; +} + +interface CryptoKey { + algorithm: KeyAlgorithm; + extractable: boolean; + type: string; + usages: string[]; +} + +declare var CryptoKey: { + prototype: CryptoKey; + new(): CryptoKey; +} + +interface CryptoKeyPair { + privateKey: CryptoKey; + publicKey: CryptoKey; +} + +declare var CryptoKeyPair: { + prototype: CryptoKeyPair; + new(): CryptoKeyPair; +} + +interface CustomEvent extends Event { + detail: any; + initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void; +} + +declare var CustomEvent: { + prototype: CustomEvent; + new(typeArg: string, eventInitDict?: CustomEventInit): CustomEvent; +} + +interface DOMError { + name: string; + toString(): string; +} + +declare var DOMError: { + prototype: DOMError; + new(): DOMError; +} + +interface DOMException { + code: number; + message: string; + name: string; + toString(): string; + ABORT_ERR: number; + DATA_CLONE_ERR: number; + DOMSTRING_SIZE_ERR: number; + HIERARCHY_REQUEST_ERR: number; + INDEX_SIZE_ERR: number; + INUSE_ATTRIBUTE_ERR: number; + INVALID_ACCESS_ERR: number; + INVALID_CHARACTER_ERR: number; + INVALID_MODIFICATION_ERR: number; + INVALID_NODE_TYPE_ERR: number; + INVALID_STATE_ERR: number; + NAMESPACE_ERR: number; + NETWORK_ERR: number; + NOT_FOUND_ERR: number; + NOT_SUPPORTED_ERR: number; + NO_DATA_ALLOWED_ERR: number; + NO_MODIFICATION_ALLOWED_ERR: number; + PARSE_ERR: number; + QUOTA_EXCEEDED_ERR: number; + SECURITY_ERR: number; + SERIALIZE_ERR: number; + SYNTAX_ERR: number; + TIMEOUT_ERR: number; + TYPE_MISMATCH_ERR: number; + URL_MISMATCH_ERR: number; + VALIDATION_ERR: number; + WRONG_DOCUMENT_ERR: number; +} + +declare var DOMException: { + prototype: DOMException; + new(): DOMException; + ABORT_ERR: number; + DATA_CLONE_ERR: number; + DOMSTRING_SIZE_ERR: number; + HIERARCHY_REQUEST_ERR: number; + INDEX_SIZE_ERR: number; + INUSE_ATTRIBUTE_ERR: number; + INVALID_ACCESS_ERR: number; + INVALID_CHARACTER_ERR: number; + INVALID_MODIFICATION_ERR: number; + INVALID_NODE_TYPE_ERR: number; + INVALID_STATE_ERR: number; + NAMESPACE_ERR: number; + NETWORK_ERR: number; + NOT_FOUND_ERR: number; + NOT_SUPPORTED_ERR: number; + NO_DATA_ALLOWED_ERR: number; + NO_MODIFICATION_ALLOWED_ERR: number; + PARSE_ERR: number; + QUOTA_EXCEEDED_ERR: number; + SECURITY_ERR: number; + SERIALIZE_ERR: number; + SYNTAX_ERR: number; + TIMEOUT_ERR: number; + TYPE_MISMATCH_ERR: number; + URL_MISMATCH_ERR: number; + VALIDATION_ERR: number; + WRONG_DOCUMENT_ERR: number; +} + +interface DOMImplementation { + createDocument(namespaceURI: string, qualifiedName: string, doctype: DocumentType): Document; + createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; + createHTMLDocument(title: string): Document; + hasFeature(feature: string, version: string): boolean; +} + +declare var DOMImplementation: { + prototype: DOMImplementation; + new(): DOMImplementation; +} + +interface DOMParser { + parseFromString(source: string, mimeType: string): Document; +} + +declare var DOMParser: { + prototype: DOMParser; + new(): DOMParser; +} + +interface DOMSettableTokenList extends DOMTokenList { + value: string; +} + +declare var DOMSettableTokenList: { + prototype: DOMSettableTokenList; + new(): DOMSettableTokenList; +} + +interface DOMStringList { + length: number; + contains(str: string): boolean; + item(index: number): string; + [index: number]: string; +} + +declare var DOMStringList: { + prototype: DOMStringList; + new(): DOMStringList; +} + +interface DOMStringMap { + [name: string]: string; +} + +declare var DOMStringMap: { + prototype: DOMStringMap; + new(): DOMStringMap; +} + +interface DOMTokenList { + length: number; + add(...token: string[]): void; + contains(token: string): boolean; + item(index: number): string; + remove(...token: string[]): void; + toString(): string; + toggle(token: string, force?: boolean): boolean; + [index: number]: string; +} + +declare var DOMTokenList: { + prototype: DOMTokenList; + new(): DOMTokenList; +} + +interface DataCue extends TextTrackCue { + data: ArrayBuffer; +} + +declare var DataCue: { + prototype: DataCue; + new(): DataCue; +} + +interface DataTransfer { + dropEffect: string; + effectAllowed: string; + files: FileList; + items: DataTransferItemList; + types: DOMStringList; + clearData(format?: string): boolean; + getData(format: string): string; + setData(format: string, data: string): boolean; +} + +declare var DataTransfer: { + prototype: DataTransfer; + new(): DataTransfer; +} + +interface DataTransferItem { + kind: string; + type: string; + getAsFile(): File; + getAsString(_callback: FunctionStringCallback): void; +} + +declare var DataTransferItem: { + prototype: DataTransferItem; + new(): DataTransferItem; +} + +interface DataTransferItemList { + length: number; + add(data: File): DataTransferItem; + clear(): void; + item(index: number): File; + remove(index: number): void; + [index: number]: File; +} + +declare var DataTransferItemList: { + prototype: DataTransferItemList; + new(): DataTransferItemList; +} + +interface DeferredPermissionRequest { + id: number; + type: string; + uri: string; + allow(): void; + deny(): void; +} + +declare var DeferredPermissionRequest: { + prototype: DeferredPermissionRequest; + new(): DeferredPermissionRequest; +} + +interface DelayNode extends AudioNode { + delayTime: AudioParam; +} + +declare var DelayNode: { + prototype: DelayNode; + new(): DelayNode; +} + +interface DeviceAcceleration { + x: number; + y: number; + z: number; +} + +declare var DeviceAcceleration: { + prototype: DeviceAcceleration; + new(): DeviceAcceleration; +} + +interface DeviceMotionEvent extends Event { + acceleration: DeviceAcceleration; + accelerationIncludingGravity: DeviceAcceleration; + interval: number; + rotationRate: DeviceRotationRate; + initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict, accelerationIncludingGravity: DeviceAccelerationDict, rotationRate: DeviceRotationRateDict, interval: number): void; +} + +declare var DeviceMotionEvent: { + prototype: DeviceMotionEvent; + new(): DeviceMotionEvent; +} + +interface DeviceOrientationEvent extends Event { + absolute: boolean; + alpha: number; + beta: number; + gamma: number; + initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number, beta: number, gamma: number, absolute: boolean): void; +} + +declare var DeviceOrientationEvent: { + prototype: DeviceOrientationEvent; + new(): DeviceOrientationEvent; +} + +interface DeviceRotationRate { + alpha: number; + beta: number; + gamma: number; +} + +declare var DeviceRotationRate: { + prototype: DeviceRotationRate; + new(): DeviceRotationRate; +} + +interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEvent { /** - * Gets a reference to the root node of the document. + * Sets or gets the URL for the current document. */ - documentElement: HTMLElement; + URL: string; /** - * Retrieves the collection of user agents and versions declared in the X-UA-Compatible + * Gets the URL for the document, stripped of any character encoding. */ - compatible: MSCompatibleInfoCollection; + URLUnencoded: string; /** - * Fires when the user presses a key. - * @param ev The keyboard event + * Gets the object that has the focus when the parent document has focus. */ - onkeydown: (ev: KeyboardEvent) => any; + activeElement: Element; /** - * Fires when the user releases a key. - * @param ev The keyboard event + * Sets or gets the color of all active links in the document. */ - onkeyup: (ev: KeyboardEvent) => any; - /** - * Gets the implementation object of the current document. - */ - implementation: DOMImplementation; - /** - * Fires when the user resets a form. - * @param ev The event. - */ - onreset: (ev: Event) => any; - /** - * Retrieves a collection of all script objects in the document. - */ - scripts: HTMLCollection; - /** - * Fires when the user presses the F1 key while the browser is the active window. - * @param ev The event. - */ - onhelp: (ev: Event) => any; - /** - * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. - * @param ev The drag event. - */ - ondragleave: (ev: DragEvent) => any; - /** - * Gets or sets the character set used to encode the object. - */ - charset: string; - /** - * Fires for an element just prior to setting focus on that element. - * @param ev The focus event - */ - onfocusin: (ev: FocusEvent) => any; - /** - * Sets or gets the color of the links that the user has visited. - */ - vlinkColor: string; - /** - * Occurs when the seek operation ends. - * @param ev The event. - */ - onseeked: (ev: Event) => any; - security: string; - /** - * Contains the title of the document. - */ - title: string; - /** - * Retrieves a collection of namespace objects. - */ - namespaces: MSNamespaceInfoCollection; - /** - * Gets the default character set from the current regional language settings. - */ - defaultCharset: string; - /** - * Retrieves a collection of all embed objects in the document. - */ - embeds: HTMLCollection; - /** - * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. - */ - styleSheets: StyleSheetList; - /** - * Retrieves a collection of all window objects defined by the given document or defined by the document associated with the given window. - */ - frames: Window; - /** - * Occurs when the duration attribute is updated. - * @param ev The event. - */ - ondurationchange: (ev: Event) => any; + alinkColor: string; /** * Returns a reference to the collection of elements contained by the object. */ all: HTMLCollection; + /** + * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. + */ + anchors: HTMLCollection; + /** + * Retrieves a collection of all applet objects in the document. + */ + applets: HTMLCollection; + /** + * Deprecated. Sets or retrieves a value that indicates the background color behind the object. + */ + bgColor: string; + /** + * Specifies the beginning and end of the document body. + */ + body: HTMLElement; + characterSet: string; + /** + * Gets or sets the character set used to encode the object. + */ + charset: string; + /** + * Gets a value that indicates whether standards-compliant mode is switched on for the object. + */ + compatMode: string; + cookie: string; + /** + * Gets the default character set from the current regional language settings. + */ + defaultCharset: string; + defaultView: Window; + /** + * Sets or gets a value that indicates whether the document can be edited. + */ + designMode: string; + /** + * Sets or retrieves a value that indicates the reading order of the object. + */ + dir: string; + /** + * Gets an object representing the document type declaration associated with the current document. + */ + doctype: DocumentType; + /** + * Gets a reference to the root node of the document. + */ + documentElement: HTMLElement; + /** + * Sets or gets the security domain of the document. + */ + domain: string; + /** + * Retrieves a collection of all embed objects in the document. + */ + embeds: HTMLCollection; + /** + * Sets or gets the foreground (text) color of the document. + */ + fgColor: string; /** * Retrieves a collection, in source order, of all form objects in the document. */ forms: HTMLCollection; + fullscreenElement: Element; + fullscreenEnabled: boolean; + head: HTMLHeadElement; + hidden: boolean; + /** + * Retrieves a collection, in source order, of img objects in the document. + */ + images: HTMLCollection; + /** + * Gets the implementation object of the current document. + */ + implementation: DOMImplementation; + /** + * Returns the character encoding used to create the webpage that is loaded into the document object. + */ + inputEncoding: string; + /** + * Gets the date that the page was last modified, if the page supplies one. + */ + lastModified: string; + /** + * Sets or gets the color of the document links. + */ + linkColor: string; + /** + * Retrieves a collection of all a objects that specify the href property and all area objects in the document. + */ + links: HTMLCollection; + /** + * Contains information about the current URL. + */ + location: Location; + media: string; + msCSSOMElementFloatMetrics: boolean; + msCapsLockWarningOff: boolean; + msHidden: boolean; + msVisibilityState: string; + /** + * Fires when the user aborts the download. + * @param ev The event. + */ + onabort: (ev: Event) => any; + /** + * Fires when the object is set as the active element. + * @param ev The event. + */ + onactivate: (ev: UIEvent) => any; + /** + * Fires immediately before the object is set as the active element. + * @param ev The event. + */ + onbeforeactivate: (ev: UIEvent) => any; + /** + * Fires immediately before the activeElement is changed from the current object to another object in the parent document. + * @param ev The event. + */ + onbeforedeactivate: (ev: UIEvent) => any; /** * Fires when the object loses the input focus. * @param ev The focus event. */ onblur: (ev: FocusEvent) => any; - /** - * Sets or retrieves a value that indicates the reading order of the object. - */ - dir: string; - /** - * Occurs when the media element is reset to its initial state. - * @param ev The event. - */ - onemptied: (ev: Event) => any; - /** - * Sets or gets a value that indicates whether the document can be edited. - */ - designMode: string; - /** - * Occurs when the current playback position is moved. - * @param ev The event. - */ - onseeking: (ev: Event) => any; - /** - * Fires when the activeElement is changed from the current object to another object in the parent document. - * @param ev The UI Event - */ - ondeactivate: (ev: UIEvent) => any; /** * Occurs when playback is possible, but would require further buffering. * @param ev The event. */ oncanplay: (ev: Event) => any; - /** - * Fires when the data set exposed by a data source object changes. - * @param ev The event. - */ - ondatasetchanged: (ev: MSEventObj) => any; - /** - * Fires when rows are about to be deleted from the recordset. - * @param ev The event - */ - onrowsdelete: (ev: MSEventObj) => any; - Script: MSScriptHost; - /** - * Occurs when Internet Explorer begins looking for media data. - * @param ev The event. - */ - onloadstart: (ev: Event) => any; - /** - * Gets the URL for the document, stripped of any character encoding. - */ - URLUnencoded: string; - defaultView: Window; - /** - * Fires when the user is about to make a control selection of the object. - * @param ev The event. - */ - oncontrolselect: (ev: MSEventObj) => any; - /** - * Fires on the target element when the user drags the object to a valid drop target. - * @param ev The drag event. - */ - ondragenter: (ev: DragEvent) => any; - onsubmit: (ev: Event) => any; - /** - * Returns the character encoding used to create the webpage that is loaded into the document object. - */ - inputEncoding: string; - /** - * Gets the object that has the focus when the parent document has focus. - */ - activeElement: Element; + oncanplaythrough: (ev: Event) => any; /** * Fires when the contents of the object or selection have changed. * @param ev The event. */ onchange: (ev: Event) => any; /** - * Retrieves a collection of all a objects that specify the href property and all area objects in the document. + * Fires when the user clicks the left mouse button on the object + * @param ev The mouse event. */ - links: HTMLCollection; + onclick: (ev: MouseEvent) => any; /** - * Retrieves an autogenerated, unique identifier for the object. + * Fires when the user clicks the right mouse button in the client area, opening the context menu. + * @param ev The mouse event. */ - uniqueID: string; + oncontextmenu: (ev: PointerEvent) => any; /** - * Sets or gets the URL for the current document. + * Fires when the user double-clicks the object. + * @param ev The mouse event. */ - URL: string; + ondblclick: (ev: MouseEvent) => any; /** - * Fires immediately before the object is set as the active element. + * Fires when the activeElement is changed from the current object to another object in the parent document. + * @param ev The UI Event + */ + ondeactivate: (ev: UIEvent) => any; + /** + * Fires on the source object continuously during a drag operation. * @param ev The event. */ - onbeforeactivate: (ev: UIEvent) => any; - head: HTMLHeadElement; - cookie: string; - xmlEncoding: string; - oncanplaythrough: (ev: Event) => any; - /** - * Retrieves the document compatibility mode of the document. - */ - documentMode: number; - characterSet: string; + ondrag: (ev: DragEvent) => any; /** - * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. - */ - anchors: HTMLCollection; - onbeforeupdate: (ev: MSEventObj) => any; - /** - * Fires to indicate that all data is available from the data source object. + * Fires on the source object when the user releases the mouse at the close of a drag operation. * @param ev The event. */ - ondatasetcomplete: (ev: MSEventObj) => any; - plugins: HTMLCollection; + ondragend: (ev: DragEvent) => any; + /** + * Fires on the target element when the user drags the object to a valid drop target. + * @param ev The drag event. + */ + ondragenter: (ev: DragEvent) => any; + /** + * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. + * @param ev The drag event. + */ + ondragleave: (ev: DragEvent) => any; + /** + * Fires on the target element continuously while the user drags the object over a valid drop target. + * @param ev The event. + */ + ondragover: (ev: DragEvent) => any; + /** + * Fires on the source object when the user starts to drag a text selection or selected object. + * @param ev The event. + */ + ondragstart: (ev: DragEvent) => any; + ondrop: (ev: DragEvent) => any; + /** + * Occurs when the duration attribute is updated. + * @param ev The event. + */ + ondurationchange: (ev: Event) => any; + /** + * Occurs when the media element is reset to its initial state. + * @param ev The event. + */ + onemptied: (ev: Event) => any; + /** + * Occurs when the end of playback is reached. + * @param ev The event + */ + onended: (ev: Event) => any; + /** + * Fires when an error occurs during object loading. + * @param ev The event. + */ + onerror: (ev: Event) => any; + /** + * Fires when the object receives focus. + * @param ev The event. + */ + onfocus: (ev: FocusEvent) => any; + onfullscreenchange: (ev: Event) => any; + onfullscreenerror: (ev: Event) => any; + oninput: (ev: Event) => any; + /** + * Fires when the user presses a key. + * @param ev The keyboard event + */ + onkeydown: (ev: KeyboardEvent) => any; + /** + * Fires when the user presses an alphanumeric key. + * @param ev The event. + */ + onkeypress: (ev: KeyboardEvent) => any; + /** + * Fires when the user releases a key. + * @param ev The keyboard event + */ + onkeyup: (ev: KeyboardEvent) => any; + /** + * Fires immediately after the browser loads the object. + * @param ev The event. + */ + onload: (ev: Event) => any; + /** + * Occurs when media data is loaded at the current playback position. + * @param ev The event. + */ + onloadeddata: (ev: Event) => any; + /** + * Occurs when the duration and dimensions of the media have been determined. + * @param ev The event. + */ + onloadedmetadata: (ev: Event) => any; + /** + * Occurs when Internet Explorer begins looking for media data. + * @param ev The event. + */ + onloadstart: (ev: Event) => any; + /** + * Fires when the user clicks the object with either mouse button. + * @param ev The mouse event. + */ + onmousedown: (ev: MouseEvent) => any; + /** + * Fires when the user moves the mouse over the object. + * @param ev The mouse event. + */ + onmousemove: (ev: MouseEvent) => any; + /** + * Fires when the user moves the mouse pointer outside the boundaries of the object. + * @param ev The mouse event. + */ + onmouseout: (ev: MouseEvent) => any; + /** + * Fires when the user moves the mouse pointer into the object. + * @param ev The mouse event. + */ + onmouseover: (ev: MouseEvent) => any; + /** + * Fires when the user releases a mouse button while the mouse is over the object. + * @param ev The mouse event. + */ + onmouseup: (ev: MouseEvent) => any; + /** + * Fires when the wheel button is rotated. + * @param ev The mouse event + */ + onmousewheel: (ev: MouseWheelEvent) => any; + onmscontentzoom: (ev: UIEvent) => any; + onmsgesturechange: (ev: MSGestureEvent) => any; + onmsgesturedoubletap: (ev: MSGestureEvent) => any; + onmsgestureend: (ev: MSGestureEvent) => any; + onmsgesturehold: (ev: MSGestureEvent) => any; + onmsgesturestart: (ev: MSGestureEvent) => any; + onmsgesturetap: (ev: MSGestureEvent) => any; + onmsinertiastart: (ev: MSGestureEvent) => any; + onmsmanipulationstatechanged: (ev: MSManipulationEvent) => any; + onmspointercancel: (ev: MSPointerEvent) => any; + onmspointerdown: (ev: MSPointerEvent) => any; + onmspointerenter: (ev: MSPointerEvent) => any; + onmspointerleave: (ev: MSPointerEvent) => any; + onmspointermove: (ev: MSPointerEvent) => any; + onmspointerout: (ev: MSPointerEvent) => any; + onmspointerover: (ev: MSPointerEvent) => any; + onmspointerup: (ev: MSPointerEvent) => any; + /** + * Occurs when an item is removed from a Jump List of a webpage running in Site Mode. + * @param ev The event. + */ + onmssitemodejumplistitemremoved: (ev: MSSiteModeEvent) => any; + /** + * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode. + * @param ev The event. + */ + onmsthumbnailclick: (ev: MSSiteModeEvent) => any; + /** + * Occurs when playback is paused. + * @param ev The event. + */ + onpause: (ev: Event) => any; + /** + * Occurs when the play method is requested. + * @param ev The event. + */ + onplay: (ev: Event) => any; + /** + * Occurs when the audio or video has started playing. + * @param ev The event. + */ + onplaying: (ev: Event) => any; + onpointerlockchange: (ev: Event) => any; + onpointerlockerror: (ev: Event) => any; + /** + * Occurs to indicate progress while downloading media data. + * @param ev The event. + */ + onprogress: (ev: ProgressEvent) => any; + /** + * Occurs when the playback rate is increased or decreased. + * @param ev The event. + */ + onratechange: (ev: Event) => any; + /** + * Fires when the state of the object has changed. + * @param ev The event + */ + onreadystatechange: (ev: ProgressEvent) => any; + /** + * Fires when the user resets a form. + * @param ev The event. + */ + onreset: (ev: Event) => any; + /** + * Fires when the user repositions the scroll box in the scroll bar on the object. + * @param ev The event. + */ + onscroll: (ev: UIEvent) => any; + /** + * Occurs when the seek operation ends. + * @param ev The event. + */ + onseeked: (ev: Event) => any; + /** + * Occurs when the current playback position is moved. + * @param ev The event. + */ + onseeking: (ev: Event) => any; + /** + * Fires when the current selection changes. + * @param ev The event. + */ + onselect: (ev: UIEvent) => any; + onselectstart: (ev: Event) => any; + /** + * Occurs when the download has stopped. + * @param ev The event. + */ + onstalled: (ev: Event) => any; + /** + * Fires when the user clicks the Stop button or leaves the Web page. + * @param ev The event. + */ + onstop: (ev: Event) => any; + onsubmit: (ev: Event) => any; /** * Occurs if the load operation has been intentionally halted. * @param ev The event. */ onsuspend: (ev: Event) => any; /** - * Gets the root svg element in the document hierarchy. + * Occurs to indicate the current playback position. + * @param ev The event. */ - rootElement: SVGSVGElement; + ontimeupdate: (ev: Event) => any; + ontouchcancel: (ev: TouchEvent) => any; + ontouchend: (ev: TouchEvent) => any; + ontouchmove: (ev: TouchEvent) => any; + ontouchstart: (ev: TouchEvent) => any; + /** + * Occurs when the volume is changed, or playback is muted or unmuted. + * @param ev The event. + */ + onvolumechange: (ev: Event) => any; + /** + * Occurs when playback stops because the next frame of a video resource is not available. + * @param ev The event. + */ + onwaiting: (ev: Event) => any; + onwebkitfullscreenchange: (ev: Event) => any; + onwebkitfullscreenerror: (ev: Event) => any; + plugins: HTMLCollection; + pointerLockElement: Element; /** * Retrieves a value that indicates the current state of the object. */ @@ -637,390 +2032,60 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document */ referrer: string; /** - * Sets or gets the color of all active links in the document. + * Gets the root svg element in the document hierarchy. */ - alinkColor: string; + rootElement: SVGSVGElement; /** - * Fires on a databound object when an error occurs while updating the associated data in the data source object. - * @param ev The event. + * Retrieves a collection of all script objects in the document. */ - onerrorupdate: (ev: MSEventObj) => any; + scripts: HTMLCollection; + security: string; /** - * Gets a reference to the container object of the window. + * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. */ - parentWindow: Window; + styleSheets: StyleSheetList; /** - * Fires when the user moves the mouse pointer outside the boundaries of the object. - * @param ev The mouse event. + * Contains the title of the document. */ - onmouseout: (ev: MouseEvent) => any; - /** - * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode. - * @param ev The event. - */ - onmsthumbnailclick: (ev: MSSiteModeEvent) => any; - /** - * Fires when the wheel button is rotated. - * @param ev The mouse event - */ - onmousewheel: (ev: MouseWheelEvent) => any; - /** - * Occurs when the volume is changed, or playback is muted or unmuted. - * @param ev The event. - */ - onvolumechange: (ev: Event) => any; + title: string; + visibilityState: string; /** - * Fires when data changes in the data provider. - * @param ev The event. + * Sets or gets the color of the links that the user has visited. */ - oncellchange: (ev: MSEventObj) => any; - /** - * Fires just before the data source control changes the current row in the object. - * @param ev The event. - */ - onrowexit: (ev: MSEventObj) => any; - /** - * Fires just after new rows are inserted in the current recordset. - * @param ev The event. - */ - onrowsinserted: (ev: MSEventObj) => any; + vlinkColor: string; + webkitCurrentFullScreenElement: Element; + webkitFullscreenElement: Element; + webkitFullscreenEnabled: boolean; + webkitIsFullScreen: boolean; + xmlEncoding: string; + xmlStandalone: boolean; /** * Gets or sets the version attribute specified in the declaration of an XML document. */ xmlVersion: string; - msCapsLockWarningOff: boolean; - /** - * Fires when a property changes on the object. - * @param ev The event. - */ - onpropertychange: (ev: MSEventObj) => any; - /** - * Fires on the source object when the user releases the mouse at the close of a drag operation. - * @param ev The event. - */ - ondragend: (ev: DragEvent) => any; - /** - * Gets an object representing the document type declaration associated with the current document. - */ - doctype: DocumentType; - /** - * Fires on the target element continuously while the user drags the object over a valid drop target. - * @param ev The event. - */ - ondragover: (ev: DragEvent) => any; - /** - * Deprecated. Sets or retrieves a value that indicates the background color behind the object. - */ - bgColor: string; - /** - * Fires on the source object when the user starts to drag a text selection or selected object. - * @param ev The event. - */ - ondragstart: (ev: DragEvent) => any; - /** - * Fires when the user releases a mouse button while the mouse is over the object. - * @param ev The mouse event. - */ - onmouseup: (ev: MouseEvent) => any; - /** - * Fires on the source object continuously during a drag operation. - * @param ev The event. - */ - ondrag: (ev: DragEvent) => any; - /** - * Fires when the user moves the mouse pointer into the object. - * @param ev The mouse event. - */ - onmouseover: (ev: MouseEvent) => any; - /** - * Sets or gets the color of the document links. - */ - linkColor: string; - /** - * Occurs when playback is paused. - * @param ev The event. - */ - onpause: (ev: Event) => any; - /** - * Fires when the user clicks the object with either mouse button. - * @param ev The mouse event. - */ - onmousedown: (ev: MouseEvent) => any; - /** - * Fires when the user clicks the left mouse button on the object - * @param ev The mouse event. - */ - onclick: (ev: MouseEvent) => any; - /** - * Occurs when playback stops because the next frame of a video resource is not available. - * @param ev The event. - */ - onwaiting: (ev: Event) => any; - /** - * Fires when the user clicks the Stop button or leaves the Web page. - * @param ev The event. - */ - onstop: (ev: Event) => any; - /** - * Occurs when an item is removed from a Jump List of a webpage running in Site Mode. - * @param ev The event. - */ - onmssitemodejumplistitemremoved: (ev: MSSiteModeEvent) => any; - /** - * Retrieves a collection of all applet objects in the document. - */ - applets: HTMLCollection; - /** - * Specifies the beginning and end of the document body. - */ - body: HTMLElement; - /** - * Sets or gets the security domain of the document. - */ - domain: string; - xmlStandalone: boolean; - /** - * Represents the active selection, which is a highlighted block of text or other elements in the document that a user or a script can carry out some action on. - */ - selection: MSSelection; - /** - * Occurs when the download has stopped. - * @param ev The event. - */ - onstalled: (ev: Event) => any; - /** - * Fires when the user moves the mouse over the object. - * @param ev The mouse event. - */ - onmousemove: (ev: MouseEvent) => any; - /** - * Fires before an object contained in an editable element enters a UI-activated state or when an editable container object is control selected. - * @param ev The event. - */ - onbeforeeditfocus: (ev: MSEventObj) => any; - /** - * Occurs when the playback rate is increased or decreased. - * @param ev The event. - */ - onratechange: (ev: Event) => any; - /** - * Occurs to indicate progress while downloading media data. - * @param ev The event. - */ - onprogress: (ev: ProgressEvent) => any; - /** - * Fires when the user double-clicks the object. - * @param ev The mouse event. - */ - ondblclick: (ev: MouseEvent) => any; - /** - * Fires when the user clicks the right mouse button in the client area, opening the context menu. - * @param ev The mouse event. - */ - oncontextmenu: (ev: MouseEvent) => any; - /** - * Occurs when the duration and dimensions of the media have been determined. - * @param ev The event. - */ - onloadedmetadata: (ev: Event) => any; - media: string; - /** - * Fires when an error occurs during object loading. - * @param ev The event. - */ - onerror: (ev: ErrorEvent) => any; - /** - * Occurs when the play method is requested. - * @param ev The event. - */ - onplay: (ev: Event) => any; - onafterupdate: (ev: MSEventObj) => any; - /** - * Occurs when the audio or video has started playing. - * @param ev The event. - */ - onplaying: (ev: Event) => any; - /** - * Retrieves a collection, in source order, of img objects in the document. - */ - images: HTMLCollection; - /** - * Contains information about the current URL. - */ - location: Location; - /** - * Fires when the user aborts the download. - * @param ev The event. - */ - onabort: (ev: UIEvent) => any; - /** - * Fires for the current element with focus immediately after moving focus to another element. - * @param ev The event. - */ - onfocusout: (ev: FocusEvent) => any; - /** - * Fires when the selection state of a document changes. - * @param ev The event. - */ - onselectionchange: (ev: Event) => any; - /** - * Fires when a local DOM Storage area is written to disk. - * @param ev The event. - */ - onstoragecommit: (ev: StorageEvent) => any; - /** - * Fires periodically as data arrives from data source objects that asynchronously transmit their data. - * @param ev The event. - */ - ondataavailable: (ev: MSEventObj) => any; - /** - * Fires when the state of the object has changed. - * @param ev The event - */ - onreadystatechange: (ev: Event) => any; - /** - * Gets the date that the page was last modified, if the page supplies one. - */ - lastModified: string; - /** - * Fires when the user presses an alphanumeric key. - * @param ev The event. - */ - onkeypress: (ev: KeyboardEvent) => any; - /** - * Occurs when media data is loaded at the current playback position. - * @param ev The event. - */ - onloadeddata: (ev: Event) => any; - /** - * Fires immediately before the activeElement is changed from the current object to another object in the parent document. - * @param ev The event. - */ - onbeforedeactivate: (ev: UIEvent) => any; - /** - * Fires when the object is set as the active element. - * @param ev The event. - */ - onactivate: (ev: UIEvent) => any; - onselectstart: (ev: Event) => any; - /** - * Fires when the object receives focus. - * @param ev The event. - */ - onfocus: (ev: FocusEvent) => any; - /** - * Sets or gets the foreground (text) color of the document. - */ - fgColor: string; - /** - * Occurs to indicate the current playback position. - * @param ev The event. - */ - ontimeupdate: (ev: Event) => any; - /** - * Fires when the current selection changes. - * @param ev The event. - */ - onselect: (ev: UIEvent) => any; - ondrop: (ev: DragEvent) => any; - /** - * Occurs when the end of playback is reached. - * @param ev The event - */ - onended: (ev: Event) => any; - /** - * Gets a value that indicates whether standards-compliant mode is switched on for the object. - */ - compatMode: string; - /** - * Fires when the user repositions the scroll box in the scroll bar on the object. - * @param ev The event. - */ - onscroll: (ev: UIEvent) => any; - /** - * Fires to indicate that the current row has changed in the data source and new data values are available on the object. - * @param ev The event. - */ - onrowenter: (ev: MSEventObj) => any; - /** - * Fires immediately after the browser loads the object. - * @param ev The event. - */ - onload: (ev: Event) => any; - oninput: (ev: Event) => any; - onmspointerdown: (ev: any) => any; - msHidden: boolean; - msVisibilityState: string; - onmsgesturedoubletap: (ev: any) => any; - visibilityState: string; - onmsmanipulationstatechanged: (ev: any) => any; - onmspointerhover: (ev: any) => any; - onmscontentzoom: (ev: MSEventObj) => any; - onmspointermove: (ev: any) => any; - onmsgesturehold: (ev: any) => any; - onmsgesturechange: (ev: any) => any; - onmsgesturestart: (ev: any) => any; - onmspointercancel: (ev: any) => any; - onmsgestureend: (ev: any) => any; - onmsgesturetap: (ev: any) => any; - onmspointerout: (ev: any) => any; - onmsinertiastart: (ev: any) => any; - msCSSOMElementFloatMetrics: boolean; - onmspointerover: (ev: any) => any; - hidden: boolean; - onmspointerup: (ev: any) => any; - msFullscreenEnabled: boolean; - onmsfullscreenerror: (ev: any) => any; - onmspointerenter: (ev: any) => any; - msFullscreenElement: Element; - onmsfullscreenchange: (ev: any) => any; - onmspointerleave: (ev: any) => any; - /** - * Returns a reference to the first object with the specified value of the ID or NAME attribute. - * @param elementId String that specifies the ID value. Case-insensitive. - */ - getElementById(elementId: string): HTMLElement; - /** - * Returns the current value of the document, range, or current selection for the given command. - * @param commandId String that specifies a command identifier. - */ - queryCommandValue(commandId: string): string; adoptNode(source: Node): Node; + captureEvents(): void; + clear(): void; /** - * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. - * @param commandId String that specifies a command identifier. + * Closes an output stream and forces the sent data to display. */ - queryCommandIndeterm(commandId: string): boolean; - getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; - createProcessingInstruction(target: string, data: string): ProcessingInstruction; + close(): void; /** - * Executes a command on the current document, current selection, or the given range. - * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. - * @param showUI Display the user interface, defaults to false. - * @param value Value to assign. + * Creates an attribute object with a specified name. + * @param name String that sets the attribute object's name. */ - execCommand(commandId: string, showUI?: boolean, value?: any): boolean; - /** - * Returns the element for the specified x coordinate and the specified y coordinate. - * @param x The x-offset - * @param y The y-offset - */ - elementFromPoint(x: number, y: number): Element; + createAttribute(name: string): Attr; + createAttributeNS(namespaceURI: string, qualifiedName: string): Attr; createCDATASection(data: string): CDATASection; /** - * Retrieves the string associated with a command. - * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers. + * Creates a comment object with the specified data. + * @param data Sets the comment object's data. */ - queryCommandText(commandId: string): string; + createComment(data: string): Comment; /** - * Writes one or more HTML expressions to a document in the specified window. - * @param content Specifies the text and HTML tags to write. + * Creates a new document. */ - write(...content: string[]): void; - /** - * Allows updating the print settings for the page. - */ - updateSettings(): void; + createDocumentFragment(): DocumentFragment; /** * Creates an instance of the element for the specified tag. * @param tagName The name of an element. @@ -1031,14 +2096,11 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document createElement(tagName: "address"): HTMLBlockElement; createElement(tagName: "applet"): HTMLAppletElement; createElement(tagName: "area"): HTMLAreaElement; - createElement(tagName: "article"): HTMLElement; - createElement(tagName: "aside"): HTMLElement; createElement(tagName: "audio"): HTMLAudioElement; createElement(tagName: "b"): HTMLPhraseElement; createElement(tagName: "base"): HTMLBaseElement; createElement(tagName: "basefont"): HTMLBaseFontElement; createElement(tagName: "bdo"): HTMLPhraseElement; - createElement(tagName: "bgsound"): HTMLBGSoundElement; createElement(tagName: "big"): HTMLPhraseElement; createElement(tagName: "blockquote"): HTMLBlockElement; createElement(tagName: "body"): HTMLBodyElement; @@ -1062,10 +2124,7 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document createElement(tagName: "em"): HTMLPhraseElement; createElement(tagName: "embed"): HTMLEmbedElement; createElement(tagName: "fieldset"): HTMLFieldSetElement; - createElement(tagName: "figcaption"): HTMLElement; - createElement(tagName: "figure"): HTMLElement; createElement(tagName: "font"): HTMLFontElement; - createElement(tagName: "footer"): HTMLElement; createElement(tagName: "form"): HTMLFormElement; createElement(tagName: "frame"): HTMLFrameElement; createElement(tagName: "frameset"): HTMLFrameSetElement; @@ -1076,8 +2135,6 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document createElement(tagName: "h5"): HTMLHeadingElement; createElement(tagName: "h6"): HTMLHeadingElement; createElement(tagName: "head"): HTMLHeadElement; - createElement(tagName: "header"): HTMLElement; - createElement(tagName: "hgroup"): HTMLElement; createElement(tagName: "hr"): HTMLHRElement; createElement(tagName: "html"): HTMLHtmlElement; createElement(tagName: "i"): HTMLPhraseElement; @@ -1094,15 +2151,11 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document createElement(tagName: "link"): HTMLLinkElement; createElement(tagName: "listing"): HTMLBlockElement; createElement(tagName: "map"): HTMLMapElement; - createElement(tagName: "mark"): HTMLElement; createElement(tagName: "marquee"): HTMLMarqueeElement; createElement(tagName: "menu"): HTMLMenuElement; createElement(tagName: "meta"): HTMLMetaElement; - createElement(tagName: "nav"): HTMLElement; createElement(tagName: "nextid"): HTMLNextIdElement; createElement(tagName: "nobr"): HTMLPhraseElement; - createElement(tagName: "noframes"): HTMLElement; - createElement(tagName: "noscript"): HTMLElement; createElement(tagName: "object"): HTMLObjectElement; createElement(tagName: "ol"): HTMLOListElement; createElement(tagName: "optgroup"): HTMLOptGroupElement; @@ -1118,10 +2171,9 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document createElement(tagName: "s"): HTMLPhraseElement; createElement(tagName: "samp"): HTMLPhraseElement; createElement(tagName: "script"): HTMLScriptElement; - createElement(tagName: "section"): HTMLElement; createElement(tagName: "select"): HTMLSelectElement; createElement(tagName: "small"): HTMLPhraseElement; - createElement(tagName: "SOURCE"): HTMLSourceElement; + createElement(tagName: "source"): HTMLSourceElement; createElement(tagName: "span"): HTMLSpanElement; createElement(tagName: "strike"): HTMLPhraseElement; createElement(tagName: "strong"): HTMLPhraseElement; @@ -1143,33 +2195,32 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document createElement(tagName: "ul"): HTMLUListElement; createElement(tagName: "var"): HTMLPhraseElement; createElement(tagName: "video"): HTMLVideoElement; - createElement(tagName: "wbr"): HTMLElement; createElement(tagName: "x-ms-webview"): MSHTMLWebViewElement; createElement(tagName: "xmp"): HTMLBlockElement; createElement(tagName: string): HTMLElement; - /** - * Removes mouse capture from the object in the current document. - */ - releaseCapture(): void; - /** - * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. - * @param content The text and HTML tags to write. - */ - writeln(...content: string[]): void; createElementNS(namespaceURI: string, qualifiedName: string): Element; + createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; + createNSResolver(nodeResolver: Node): XPathNSResolver; /** - * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. - * @param url Specifies a MIME type for the document. - * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. - * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. - * @param replace Specifies whether the existing entry for the document is replaced in the history list. + * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list + * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. + * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. */ - open(url?: string, name?: string, features?: string, replace?: boolean): any; + createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): NodeIterator; + createProcessingInstruction(target: string, data: string): ProcessingInstruction; /** - * Returns a Boolean value that indicates whether the current command is supported on the current range. - * @param commandId Specifies a command identifier. + * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. */ - queryCommandSupported(commandId: string): boolean; + createRange(): Range; + /** + * Creates a text string from the specified value. + * @param data String that specifies the nodeValue property of the text node. + */ + createTextNode(data: string): Text; + createTouch(view: any, target: EventTarget, identifier: number, pageX: number, pageY: number, screenX: number, screenY: number): Touch; + createTouchList(...touches: Touch[]): TouchList; /** * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. * @param root The root element or node to start traversing on. @@ -1177,42 +2228,500 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document * @param filter A custom NodeFilter function to use. * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. */ - createTreeWalker(root: Node, whatToShow: number, filter: NodeFilter, entityReferenceExpansion: boolean): TreeWalker; - createAttributeNS(namespaceURI: string, qualifiedName: string): Attr; + createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): TreeWalker; + /** + * Returns the element for the specified x coordinate and the specified y coordinate. + * @param x The x-offset + * @param y The y-offset + */ + elementFromPoint(x: number, y: number): Element; + evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver, type: number, result: XPathResult): XPathResult; + /** + * Executes a command on the current document, current selection, or the given range. + * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. + * @param showUI Display the user interface, defaults to false. + * @param value Value to assign. + */ + execCommand(commandId: string, showUI?: boolean, value?: any): boolean; + /** + * Displays help information for the given command identifier. + * @param commandId Displays help information for the given command identifier. + */ + execCommandShowHelp(commandId: string): boolean; + exitFullscreen(): void; + exitPointerLock(): void; + /** + * Causes the element to receive the focus and executes the code specified by the onfocus event. + */ + focus(): void; + /** + * Returns a reference to the first object with the specified value of the ID or NAME attribute. + * @param elementId String that specifies the ID value. Case-insensitive. + */ + getElementById(elementId: string): HTMLElement; + getElementsByClassName(classNames: string): NodeList; + /** + * Gets a collection of objects based on the value of the NAME or ID attribute. + * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. + */ + getElementsByName(elementName: string): NodeList; + /** + * Retrieves a collection of objects based on the specified element name. + * @param name Specifies the name of an element. + */ + getElementsByTagName(tagname: "a"): NodeListOf; + getElementsByTagName(tagname: "abbr"): NodeListOf; + getElementsByTagName(tagname: "acronym"): NodeListOf; + getElementsByTagName(tagname: "address"): NodeListOf; + getElementsByTagName(tagname: "applet"): NodeListOf; + getElementsByTagName(tagname: "area"): NodeListOf; + getElementsByTagName(tagname: "article"): NodeListOf; + getElementsByTagName(tagname: "aside"): NodeListOf; + getElementsByTagName(tagname: "audio"): NodeListOf; + getElementsByTagName(tagname: "b"): NodeListOf; + getElementsByTagName(tagname: "base"): NodeListOf; + getElementsByTagName(tagname: "basefont"): NodeListOf; + getElementsByTagName(tagname: "bdo"): NodeListOf; + getElementsByTagName(tagname: "big"): NodeListOf; + getElementsByTagName(tagname: "blockquote"): NodeListOf; + getElementsByTagName(tagname: "body"): NodeListOf; + getElementsByTagName(tagname: "br"): NodeListOf; + getElementsByTagName(tagname: "button"): NodeListOf; + getElementsByTagName(tagname: "canvas"): NodeListOf; + getElementsByTagName(tagname: "caption"): NodeListOf; + getElementsByTagName(tagname: "center"): NodeListOf; + getElementsByTagName(tagname: "circle"): NodeListOf; + getElementsByTagName(tagname: "cite"): NodeListOf; + getElementsByTagName(tagname: "clippath"): NodeListOf; + getElementsByTagName(tagname: "code"): NodeListOf; + getElementsByTagName(tagname: "col"): NodeListOf; + getElementsByTagName(tagname: "colgroup"): NodeListOf; + getElementsByTagName(tagname: "datalist"): NodeListOf; + getElementsByTagName(tagname: "dd"): NodeListOf; + getElementsByTagName(tagname: "defs"): NodeListOf; + getElementsByTagName(tagname: "del"): NodeListOf; + getElementsByTagName(tagname: "desc"): NodeListOf; + getElementsByTagName(tagname: "dfn"): NodeListOf; + getElementsByTagName(tagname: "dir"): NodeListOf; + getElementsByTagName(tagname: "div"): NodeListOf; + getElementsByTagName(tagname: "dl"): NodeListOf; + getElementsByTagName(tagname: "dt"): NodeListOf; + getElementsByTagName(tagname: "ellipse"): NodeListOf; + getElementsByTagName(tagname: "em"): NodeListOf; + getElementsByTagName(tagname: "embed"): NodeListOf; + getElementsByTagName(tagname: "feblend"): NodeListOf; + getElementsByTagName(tagname: "fecolormatrix"): NodeListOf; + getElementsByTagName(tagname: "fecomponenttransfer"): NodeListOf; + getElementsByTagName(tagname: "fecomposite"): NodeListOf; + getElementsByTagName(tagname: "feconvolvematrix"): NodeListOf; + getElementsByTagName(tagname: "fediffuselighting"): NodeListOf; + getElementsByTagName(tagname: "fedisplacementmap"): NodeListOf; + getElementsByTagName(tagname: "fedistantlight"): NodeListOf; + getElementsByTagName(tagname: "feflood"): NodeListOf; + getElementsByTagName(tagname: "fefunca"): NodeListOf; + getElementsByTagName(tagname: "fefuncb"): NodeListOf; + getElementsByTagName(tagname: "fefuncg"): NodeListOf; + getElementsByTagName(tagname: "fefuncr"): NodeListOf; + getElementsByTagName(tagname: "fegaussianblur"): NodeListOf; + getElementsByTagName(tagname: "feimage"): NodeListOf; + getElementsByTagName(tagname: "femerge"): NodeListOf; + getElementsByTagName(tagname: "femergenode"): NodeListOf; + getElementsByTagName(tagname: "femorphology"): NodeListOf; + getElementsByTagName(tagname: "feoffset"): NodeListOf; + getElementsByTagName(tagname: "fepointlight"): NodeListOf; + getElementsByTagName(tagname: "fespecularlighting"): NodeListOf; + getElementsByTagName(tagname: "fespotlight"): NodeListOf; + getElementsByTagName(tagname: "fetile"): NodeListOf; + getElementsByTagName(tagname: "feturbulence"): NodeListOf; + getElementsByTagName(tagname: "fieldset"): NodeListOf; + getElementsByTagName(tagname: "figcaption"): NodeListOf; + getElementsByTagName(tagname: "figure"): NodeListOf; + getElementsByTagName(tagname: "filter"): NodeListOf; + getElementsByTagName(tagname: "font"): NodeListOf; + getElementsByTagName(tagname: "footer"): NodeListOf; + getElementsByTagName(tagname: "foreignobject"): NodeListOf; + getElementsByTagName(tagname: "form"): NodeListOf; + getElementsByTagName(tagname: "frame"): NodeListOf; + getElementsByTagName(tagname: "frameset"): NodeListOf; + getElementsByTagName(tagname: "g"): NodeListOf; + getElementsByTagName(tagname: "h1"): NodeListOf; + getElementsByTagName(tagname: "h2"): NodeListOf; + getElementsByTagName(tagname: "h3"): NodeListOf; + getElementsByTagName(tagname: "h4"): NodeListOf; + getElementsByTagName(tagname: "h5"): NodeListOf; + getElementsByTagName(tagname: "h6"): NodeListOf; + getElementsByTagName(tagname: "head"): NodeListOf; + getElementsByTagName(tagname: "header"): NodeListOf; + getElementsByTagName(tagname: "hgroup"): NodeListOf; + getElementsByTagName(tagname: "hr"): NodeListOf; + getElementsByTagName(tagname: "html"): NodeListOf; + getElementsByTagName(tagname: "i"): NodeListOf; + getElementsByTagName(tagname: "iframe"): NodeListOf; + getElementsByTagName(tagname: "image"): NodeListOf; + getElementsByTagName(tagname: "img"): NodeListOf; + getElementsByTagName(tagname: "input"): NodeListOf; + getElementsByTagName(tagname: "ins"): NodeListOf; + getElementsByTagName(tagname: "isindex"): NodeListOf; + getElementsByTagName(tagname: "kbd"): NodeListOf; + getElementsByTagName(tagname: "keygen"): NodeListOf; + getElementsByTagName(tagname: "label"): NodeListOf; + getElementsByTagName(tagname: "legend"): NodeListOf; + getElementsByTagName(tagname: "li"): NodeListOf; + getElementsByTagName(tagname: "line"): NodeListOf; + getElementsByTagName(tagname: "lineargradient"): NodeListOf; + getElementsByTagName(tagname: "link"): NodeListOf; + getElementsByTagName(tagname: "listing"): NodeListOf; + getElementsByTagName(tagname: "map"): NodeListOf; + getElementsByTagName(tagname: "mark"): NodeListOf; + getElementsByTagName(tagname: "marker"): NodeListOf; + getElementsByTagName(tagname: "marquee"): NodeListOf; + getElementsByTagName(tagname: "mask"): NodeListOf; + getElementsByTagName(tagname: "menu"): NodeListOf; + getElementsByTagName(tagname: "meta"): NodeListOf; + getElementsByTagName(tagname: "metadata"): NodeListOf; + getElementsByTagName(tagname: "nav"): NodeListOf; + getElementsByTagName(tagname: "nextid"): NodeListOf; + getElementsByTagName(tagname: "nobr"): NodeListOf; + getElementsByTagName(tagname: "noframes"): NodeListOf; + getElementsByTagName(tagname: "noscript"): NodeListOf; + getElementsByTagName(tagname: "object"): NodeListOf; + getElementsByTagName(tagname: "ol"): NodeListOf; + getElementsByTagName(tagname: "optgroup"): NodeListOf; + getElementsByTagName(tagname: "option"): NodeListOf; + getElementsByTagName(tagname: "p"): NodeListOf; + getElementsByTagName(tagname: "param"): NodeListOf; + getElementsByTagName(tagname: "path"): NodeListOf; + getElementsByTagName(tagname: "pattern"): NodeListOf; + getElementsByTagName(tagname: "plaintext"): NodeListOf; + getElementsByTagName(tagname: "polygon"): NodeListOf; + getElementsByTagName(tagname: "polyline"): NodeListOf; + getElementsByTagName(tagname: "pre"): NodeListOf; + getElementsByTagName(tagname: "progress"): NodeListOf; + getElementsByTagName(tagname: "q"): NodeListOf; + getElementsByTagName(tagname: "radialgradient"): NodeListOf; + getElementsByTagName(tagname: "rect"): NodeListOf; + getElementsByTagName(tagname: "rt"): NodeListOf; + getElementsByTagName(tagname: "ruby"): NodeListOf; + getElementsByTagName(tagname: "s"): NodeListOf; + getElementsByTagName(tagname: "samp"): NodeListOf; + getElementsByTagName(tagname: "script"): NodeListOf; + getElementsByTagName(tagname: "section"): NodeListOf; + getElementsByTagName(tagname: "select"): NodeListOf; + getElementsByTagName(tagname: "small"): NodeListOf; + getElementsByTagName(tagname: "source"): NodeListOf; + getElementsByTagName(tagname: "span"): NodeListOf; + getElementsByTagName(tagname: "stop"): NodeListOf; + getElementsByTagName(tagname: "strike"): NodeListOf; + getElementsByTagName(tagname: "strong"): NodeListOf; + getElementsByTagName(tagname: "style"): NodeListOf; + getElementsByTagName(tagname: "sub"): NodeListOf; + getElementsByTagName(tagname: "sup"): NodeListOf; + getElementsByTagName(tagname: "svg"): NodeListOf; + getElementsByTagName(tagname: "switch"): NodeListOf; + getElementsByTagName(tagname: "symbol"): NodeListOf; + getElementsByTagName(tagname: "table"): NodeListOf; + getElementsByTagName(tagname: "tbody"): NodeListOf; + getElementsByTagName(tagname: "td"): NodeListOf; + getElementsByTagName(tagname: "text"): NodeListOf; + getElementsByTagName(tagname: "textpath"): NodeListOf; + getElementsByTagName(tagname: "textarea"): NodeListOf; + getElementsByTagName(tagname: "tfoot"): NodeListOf; + getElementsByTagName(tagname: "th"): NodeListOf; + getElementsByTagName(tagname: "thead"): NodeListOf; + getElementsByTagName(tagname: "title"): NodeListOf; + getElementsByTagName(tagname: "tr"): NodeListOf; + getElementsByTagName(tagname: "track"): NodeListOf; + getElementsByTagName(tagname: "tspan"): NodeListOf; + getElementsByTagName(tagname: "tt"): NodeListOf; + getElementsByTagName(tagname: "u"): NodeListOf; + getElementsByTagName(tagname: "ul"): NodeListOf; + getElementsByTagName(tagname: "use"): NodeListOf; + getElementsByTagName(tagname: "var"): NodeListOf; + getElementsByTagName(tagname: "video"): NodeListOf; + getElementsByTagName(tagname: "view"): NodeListOf; + getElementsByTagName(tagname: "wbr"): NodeListOf; + getElementsByTagName(tagname: "x-ms-webview"): NodeListOf; + getElementsByTagName(tagname: "xmp"): NodeListOf; + getElementsByTagName(tagname: string): NodeList; + getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; + /** + * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. + */ + getSelection(): Selection; + /** + * Gets a value indicating whether the object currently has focus. + */ + hasFocus(): boolean; + importNode(importedNode: Node, deep: boolean): Node; + msElementsFromPoint(x: number, y: number): NodeList; + msElementsFromRect(left: number, top: number, width: number, height: number): NodeList; + msGetPrintDocumentForNamedFlow(flowName: string): Document; + msSetPrintDocumentUriForNamedFlow(flowName: string, uri: string): void; + /** + * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. + * @param url Specifies a MIME type for the document. + * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. + * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. + * @param replace Specifies whether the existing entry for the document is replaced in the history list. + */ + open(url?: string, name?: string, features?: string, replace?: boolean): Document | Window; /** * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document. * @param commandId Specifies a command identifier. */ queryCommandEnabled(commandId: string): boolean; /** - * Causes the element to receive the focus and executes the code specified by the onfocus event. + * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. + * @param commandId String that specifies a command identifier. */ - focus(): void; + queryCommandIndeterm(commandId: string): boolean; /** - * Closes an output stream and forces the sent data to display. + * Returns a Boolean value that indicates the current state of the command. + * @param commandId String that specifies a command identifier. */ - close(): void; - getElementsByClassName(classNames: string): NodeList; - importNode(importedNode: Node, deep: boolean): Node; + queryCommandState(commandId: string): boolean; /** - * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. + * Returns a Boolean value that indicates whether the current command is supported on the current range. + * @param commandId Specifies a command identifier. */ - createRange(): Range; + queryCommandSupported(commandId: string): boolean; /** - * Fires a specified event on the object. - * @param eventName Specifies the name of the event to fire. - * @param eventObj Object that specifies the event object from which to obtain event object properties. + * Retrieves the string associated with a command. + * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers. */ - fireEvent(eventName: string, eventObj?: any): boolean; + queryCommandText(commandId: string): string; /** - * Creates a comment object with the specified data. - * @param data Sets the comment object's data. + * Returns the current value of the document, range, or current selection for the given command. + * @param commandId String that specifies a command identifier. */ - createComment(data: string): Comment; + queryCommandValue(commandId: string): string; + releaseEvents(): void; /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. + * Allows updating the print settings for the page. */ + updateSettings(): void; + webkitCancelFullScreen(): void; + webkitExitFullscreen(): void; + /** + * Writes one or more HTML expressions to a document in the specified window. + * @param content Specifies the text and HTML tags to write. + */ + write(...content: string[]): void; + /** + * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. + * @param content The text and HTML tags to write. + */ + writeln(...content: string[]): void; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "fullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "fullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mssitemodejumplistitemremoved", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "msthumbnailclick", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerlockchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointerlockerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stop", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Document: { + prototype: Document; + new(): Document; +} + +interface DocumentFragment extends Node, NodeSelector { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var DocumentFragment: { + prototype: DocumentFragment; + new(): DocumentFragment; +} + +interface DocumentType extends Node, ChildNode { + entities: NamedNodeMap; + internalSubset: string; + name: string; + notations: NamedNodeMap; + publicId: string; + systemId: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var DocumentType: { + prototype: DocumentType; + new(): DocumentType; +} + +interface DragEvent extends MouseEvent { + dataTransfer: DataTransfer; + initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void; + msConvertURL(file: File, targetType: string, targetURL?: string): void; +} + +declare var DragEvent: { + prototype: DragEvent; + new(): DragEvent; +} + +interface DynamicsCompressorNode extends AudioNode { + attack: AudioParam; + knee: AudioParam; + ratio: AudioParam; + reduction: AudioParam; + release: AudioParam; + threshold: AudioParam; +} + +declare var DynamicsCompressorNode: { + prototype: DynamicsCompressorNode; + new(): DynamicsCompressorNode; +} + +interface EXT_texture_filter_anisotropic { + MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; + TEXTURE_MAX_ANISOTROPY_EXT: number; +} + +declare var EXT_texture_filter_anisotropic: { + prototype: EXT_texture_filter_anisotropic; + new(): EXT_texture_filter_anisotropic; + MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; + TEXTURE_MAX_ANISOTROPY_EXT: number; +} + +interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelector, ChildNode { + classList: DOMTokenList; + clientHeight: number; + clientLeft: number; + clientTop: number; + clientWidth: number; + msContentZoomFactor: number; + msRegionOverflow: string; + onariarequest: (ev: AriaRequestEvent) => any; + oncommand: (ev: CommandEvent) => any; + ongotpointercapture: (ev: PointerEvent) => any; + onlostpointercapture: (ev: PointerEvent) => any; + onmsgesturechange: (ev: MSGestureEvent) => any; + onmsgesturedoubletap: (ev: MSGestureEvent) => any; + onmsgestureend: (ev: MSGestureEvent) => any; + onmsgesturehold: (ev: MSGestureEvent) => any; + onmsgesturestart: (ev: MSGestureEvent) => any; + onmsgesturetap: (ev: MSGestureEvent) => any; + onmsgotpointercapture: (ev: MSPointerEvent) => any; + onmsinertiastart: (ev: MSGestureEvent) => any; + onmslostpointercapture: (ev: MSPointerEvent) => any; + onmspointercancel: (ev: MSPointerEvent) => any; + onmspointerdown: (ev: MSPointerEvent) => any; + onmspointerenter: (ev: MSPointerEvent) => any; + onmspointerleave: (ev: MSPointerEvent) => any; + onmspointermove: (ev: MSPointerEvent) => any; + onmspointerout: (ev: MSPointerEvent) => any; + onmspointerover: (ev: MSPointerEvent) => any; + onmspointerup: (ev: MSPointerEvent) => any; + ontouchcancel: (ev: TouchEvent) => any; + ontouchend: (ev: TouchEvent) => any; + ontouchmove: (ev: TouchEvent) => any; + ontouchstart: (ev: TouchEvent) => any; + onwebkitfullscreenchange: (ev: Event) => any; + onwebkitfullscreenerror: (ev: Event) => any; + scrollHeight: number; + scrollLeft: number; + scrollTop: number; + scrollWidth: number; + tagName: string; + getAttribute(name?: string): string; + getAttributeNS(namespaceURI: string, localName: string): string; + getAttributeNode(name: string): Attr; + getAttributeNodeNS(namespaceURI: string, localName: string): Attr; + getBoundingClientRect(): ClientRect; + getClientRects(): ClientRectList; getElementsByTagName(name: "a"): NodeListOf; getElementsByTagName(name: "abbr"): NodeListOf; getElementsByTagName(name: "acronym"): NodeListOf; @@ -1226,7 +2735,6 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "base"): NodeListOf; getElementsByTagName(name: "basefont"): NodeListOf; getElementsByTagName(name: "bdo"): NodeListOf; - getElementsByTagName(name: "bgsound"): NodeListOf; getElementsByTagName(name: "big"): NodeListOf; getElementsByTagName(name: "blockquote"): NodeListOf; getElementsByTagName(name: "body"): NodeListOf; @@ -1235,28 +2743,60 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "canvas"): NodeListOf; getElementsByTagName(name: "caption"): NodeListOf; getElementsByTagName(name: "center"): NodeListOf; + getElementsByTagName(name: "circle"): NodeListOf; getElementsByTagName(name: "cite"): NodeListOf; + getElementsByTagName(name: "clippath"): NodeListOf; getElementsByTagName(name: "code"): NodeListOf; getElementsByTagName(name: "col"): NodeListOf; getElementsByTagName(name: "colgroup"): NodeListOf; getElementsByTagName(name: "datalist"): NodeListOf; getElementsByTagName(name: "dd"): NodeListOf; + getElementsByTagName(name: "defs"): NodeListOf; getElementsByTagName(name: "del"): NodeListOf; + getElementsByTagName(name: "desc"): NodeListOf; getElementsByTagName(name: "dfn"): NodeListOf; getElementsByTagName(name: "dir"): NodeListOf; getElementsByTagName(name: "div"): NodeListOf; getElementsByTagName(name: "dl"): NodeListOf; getElementsByTagName(name: "dt"): NodeListOf; + getElementsByTagName(name: "ellipse"): NodeListOf; getElementsByTagName(name: "em"): NodeListOf; getElementsByTagName(name: "embed"): NodeListOf; + getElementsByTagName(name: "feblend"): NodeListOf; + getElementsByTagName(name: "fecolormatrix"): NodeListOf; + getElementsByTagName(name: "fecomponenttransfer"): NodeListOf; + getElementsByTagName(name: "fecomposite"): NodeListOf; + getElementsByTagName(name: "feconvolvematrix"): NodeListOf; + getElementsByTagName(name: "fediffuselighting"): NodeListOf; + getElementsByTagName(name: "fedisplacementmap"): NodeListOf; + getElementsByTagName(name: "fedistantlight"): NodeListOf; + getElementsByTagName(name: "feflood"): NodeListOf; + getElementsByTagName(name: "fefunca"): NodeListOf; + getElementsByTagName(name: "fefuncb"): NodeListOf; + getElementsByTagName(name: "fefuncg"): NodeListOf; + getElementsByTagName(name: "fefuncr"): NodeListOf; + getElementsByTagName(name: "fegaussianblur"): NodeListOf; + getElementsByTagName(name: "feimage"): NodeListOf; + getElementsByTagName(name: "femerge"): NodeListOf; + getElementsByTagName(name: "femergenode"): NodeListOf; + getElementsByTagName(name: "femorphology"): NodeListOf; + getElementsByTagName(name: "feoffset"): NodeListOf; + getElementsByTagName(name: "fepointlight"): NodeListOf; + getElementsByTagName(name: "fespecularlighting"): NodeListOf; + getElementsByTagName(name: "fespotlight"): NodeListOf; + getElementsByTagName(name: "fetile"): NodeListOf; + getElementsByTagName(name: "feturbulence"): NodeListOf; getElementsByTagName(name: "fieldset"): NodeListOf; getElementsByTagName(name: "figcaption"): NodeListOf; getElementsByTagName(name: "figure"): NodeListOf; + getElementsByTagName(name: "filter"): NodeListOf; getElementsByTagName(name: "font"): NodeListOf; getElementsByTagName(name: "footer"): NodeListOf; + getElementsByTagName(name: "foreignobject"): NodeListOf; getElementsByTagName(name: "form"): NodeListOf; getElementsByTagName(name: "frame"): NodeListOf; getElementsByTagName(name: "frameset"): NodeListOf; + getElementsByTagName(name: "g"): NodeListOf; getElementsByTagName(name: "h1"): NodeListOf; getElementsByTagName(name: "h2"): NodeListOf; getElementsByTagName(name: "h3"): NodeListOf; @@ -1270,6 +2810,7 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "html"): NodeListOf; getElementsByTagName(name: "i"): NodeListOf; getElementsByTagName(name: "iframe"): NodeListOf; + getElementsByTagName(name: "image"): NodeListOf; getElementsByTagName(name: "img"): NodeListOf; getElementsByTagName(name: "input"): NodeListOf; getElementsByTagName(name: "ins"): NodeListOf; @@ -1279,13 +2820,18 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "label"): NodeListOf; getElementsByTagName(name: "legend"): NodeListOf; getElementsByTagName(name: "li"): NodeListOf; + getElementsByTagName(name: "line"): NodeListOf; + getElementsByTagName(name: "lineargradient"): NodeListOf; getElementsByTagName(name: "link"): NodeListOf; getElementsByTagName(name: "listing"): NodeListOf; getElementsByTagName(name: "map"): NodeListOf; getElementsByTagName(name: "mark"): NodeListOf; + getElementsByTagName(name: "marker"): NodeListOf; getElementsByTagName(name: "marquee"): NodeListOf; + getElementsByTagName(name: "mask"): NodeListOf; getElementsByTagName(name: "menu"): NodeListOf; getElementsByTagName(name: "meta"): NodeListOf; + getElementsByTagName(name: "metadata"): NodeListOf; getElementsByTagName(name: "nav"): NodeListOf; getElementsByTagName(name: "nextid"): NodeListOf; getElementsByTagName(name: "nobr"): NodeListOf; @@ -1297,10 +2843,16 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "option"): NodeListOf; getElementsByTagName(name: "p"): NodeListOf; getElementsByTagName(name: "param"): NodeListOf; + getElementsByTagName(name: "path"): NodeListOf; + getElementsByTagName(name: "pattern"): NodeListOf; getElementsByTagName(name: "plaintext"): NodeListOf; + getElementsByTagName(name: "polygon"): NodeListOf; + getElementsByTagName(name: "polyline"): NodeListOf; getElementsByTagName(name: "pre"): NodeListOf; getElementsByTagName(name: "progress"): NodeListOf; getElementsByTagName(name: "q"): NodeListOf; + getElementsByTagName(name: "radialgradient"): NodeListOf; + getElementsByTagName(name: "rect"): NodeListOf; getElementsByTagName(name: "rt"): NodeListOf; getElementsByTagName(name: "ruby"): NodeListOf; getElementsByTagName(name: "s"): NodeListOf; @@ -1309,16 +2861,22 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "section"): NodeListOf; getElementsByTagName(name: "select"): NodeListOf; getElementsByTagName(name: "small"): NodeListOf; - getElementsByTagName(name: "SOURCE"): NodeListOf; + getElementsByTagName(name: "source"): NodeListOf; getElementsByTagName(name: "span"): NodeListOf; + getElementsByTagName(name: "stop"): NodeListOf; getElementsByTagName(name: "strike"): NodeListOf; getElementsByTagName(name: "strong"): NodeListOf; getElementsByTagName(name: "style"): NodeListOf; getElementsByTagName(name: "sub"): NodeListOf; getElementsByTagName(name: "sup"): NodeListOf; + getElementsByTagName(name: "svg"): NodeListOf; + getElementsByTagName(name: "switch"): NodeListOf; + getElementsByTagName(name: "symbol"): NodeListOf; getElementsByTagName(name: "table"): NodeListOf; getElementsByTagName(name: "tbody"): NodeListOf; getElementsByTagName(name: "td"): NodeListOf; + getElementsByTagName(name: "text"): NodeListOf; + getElementsByTagName(name: "textpath"): NodeListOf; getElementsByTagName(name: "textarea"): NodeListOf; getElementsByTagName(name: "tfoot"): NodeListOf; getElementsByTagName(name: "th"): NodeListOf; @@ -1326,546 +2884,837 @@ interface Document extends Node, NodeSelector, MSEventAttachmentTarget, Document getElementsByTagName(name: "title"): NodeListOf; getElementsByTagName(name: "tr"): NodeListOf; getElementsByTagName(name: "track"): NodeListOf; + getElementsByTagName(name: "tspan"): NodeListOf; getElementsByTagName(name: "tt"): NodeListOf; getElementsByTagName(name: "u"): NodeListOf; getElementsByTagName(name: "ul"): NodeListOf; + getElementsByTagName(name: "use"): NodeListOf; getElementsByTagName(name: "var"): NodeListOf; getElementsByTagName(name: "video"): NodeListOf; + getElementsByTagName(name: "view"): NodeListOf; getElementsByTagName(name: "wbr"): NodeListOf; getElementsByTagName(name: "x-ms-webview"): NodeListOf; getElementsByTagName(name: "xmp"): NodeListOf; getElementsByTagName(name: string): NodeList; - /** - * Creates a new document. - */ - createDocumentFragment(): DocumentFragment; - /** - * Creates a style sheet for the document. - * @param href Specifies how to add the style sheet to the document. If a file name is specified for the URL, the style information is added as a link object. If the URL contains style information, it is added to the style object. - * @param index Specifies the index that indicates where the new style sheet is inserted in the styleSheets collection. The default is to insert the new style sheet at the end of the collection. - */ - createStyleSheet(href?: string, index?: number): CSSStyleSheet; - /** - * Gets a collection of objects based on the value of the NAME or ID attribute. - * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. - */ - getElementsByName(elementName: string): NodeList; - /** - * Returns a Boolean value that indicates the current state of the command. - * @param commandId String that specifies a command identifier. - */ - queryCommandState(commandId: string): boolean; - /** - * Gets a value indicating whether the object currently has focus. - */ - hasFocus(): boolean; - /** - * Displays help information for the given command identifier. - * @param commandId Displays help information for the given command identifier. - */ - execCommandShowHelp(commandId: string): boolean; - /** - * Creates an attribute object with a specified name. - * @param name String that sets the attribute object's name. - */ - createAttribute(name: string): Attr; - /** - * Creates a text string from the specified value. - * @param data String that specifies the nodeValue property of the text node. - */ - createTextNode(data: string): Text; - /** - * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. - * @param root The root element or node to start traversing on. - * @param whatToShow The type of nodes or elements to appear in the node list - * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. - * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. - */ - createNodeIterator(root: Node, whatToShow: number, filter: NodeFilter, entityReferenceExpansion: boolean): NodeIterator; - /** - * Generates an event object to pass event context information when you use the fireEvent method. - * @param eventObj An object that specifies an existing event object on which to base the new object. - */ - createEventObject(eventObj?: any): MSEventObj; - /** - * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. - */ - getSelection(): Selection; - msElementsFromPoint(x: number, y: number): NodeList; - msElementsFromRect(left: number, top: number, width: number, height: number): NodeList; - clear(): void; - msExitFullscreen(): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; + hasAttribute(name: string): boolean; + hasAttributeNS(namespaceURI: string, localName: string): boolean; + msGetRegionContent(): MSRangeCollection; + msGetUntransformedBounds(): ClientRect; + msMatchesSelector(selectors: string): boolean; + msReleasePointerCapture(pointerId: number): void; + msSetPointerCapture(pointerId: number): void; + msZoomTo(args: MsZoomToOptions): void; + releasePointerCapture(pointerId: number): void; + removeAttribute(name?: string): void; + removeAttributeNS(namespaceURI: string, localName: string): void; + removeAttributeNode(oldAttr: Attr): Attr; + requestFullscreen(): void; + requestPointerLock(): void; + setAttribute(name?: string, value?: string): void; + setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; + setAttributeNode(newAttr: Attr): Attr; + setAttributeNodeNS(newAttr: Attr): Attr; + setPointerCapture(pointerId: number): void; + webkitMatchesSelector(selectors: string): boolean; + webkitRequestFullScreen(): void; + webkitRequestFullscreen(): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Element: { + prototype: Element; + new(): Element; +} + +interface ErrorEvent extends Event { + colno: number; + error: any; + filename: string; + lineno: number; + message: string; + initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; +} + +declare var ErrorEvent: { + prototype: ErrorEvent; + new(): ErrorEvent; +} + +interface Event { + bubbles: boolean; + cancelBubble: boolean; + cancelable: boolean; + currentTarget: EventTarget; + defaultPrevented: boolean; + eventPhase: number; + isTrusted: boolean; + returnValue: boolean; + srcElement: Element; + target: EventTarget; + timeStamp: number; + type: string; + initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; + preventDefault(): void; + stopImmediatePropagation(): void; + stopPropagation(): void; + AT_TARGET: number; + BUBBLING_PHASE: number; + CAPTURING_PHASE: number; +} + +declare var Event: { + prototype: Event; + new(type: string, eventInitDict?: EventInit): Event; + AT_TARGET: number; + BUBBLING_PHASE: number; + CAPTURING_PHASE: number; +} + +interface EventTarget { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + dispatchEvent(evt: Event): boolean; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var EventTarget: { + prototype: EventTarget; + new(): EventTarget; +} + +interface External { +} + +declare var External: { + prototype: External; + new(): External; +} + +interface File extends Blob { + lastModifiedDate: any; + name: string; +} + +declare var File: { + prototype: File; + new(): File; +} + +interface FileList { + length: number; + item(index: number): File; + [index: number]: File; +} + +declare var FileList: { + prototype: FileList; + new(): FileList; +} + +interface FileReader extends EventTarget, MSBaseReader { + error: DOMError; + readAsArrayBuffer(blob: Blob): void; + readAsBinaryString(blob: Blob): void; + readAsDataURL(blob: Blob): void; + readAsText(blob: Blob, encoding?: string): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var FileReader: { + prototype: FileReader; + new(): FileReader; +} + +interface FocusEvent extends UIEvent { + relatedTarget: EventTarget; + initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void; +} + +declare var FocusEvent: { + prototype: FocusEvent; + new(typeArg: string, eventInitDict?: FocusEventInit): FocusEvent; +} + +interface FormData { + append(name: any, value: any, blobName?: string): void; +} + +declare var FormData: { + prototype: FormData; + new(): FormData; +} + +interface GainNode extends AudioNode { + gain: AudioParam; +} + +declare var GainNode: { + prototype: GainNode; + new(): GainNode; +} + +interface Gamepad { + axes: number[]; + buttons: GamepadButton[]; + connected: boolean; + id: string; + index: number; + mapping: string; + timestamp: number; +} + +declare var Gamepad: { + prototype: Gamepad; + new(): Gamepad; +} + +interface GamepadButton { + pressed: boolean; + value: number; +} + +declare var GamepadButton: { + prototype: GamepadButton; + new(): GamepadButton; +} + +interface GamepadEvent extends Event { + gamepad: Gamepad; +} + +declare var GamepadEvent: { + prototype: GamepadEvent; + new(): GamepadEvent; +} + +interface Geolocation { + clearWatch(watchId: number): void; + getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void; + watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number; +} + +declare var Geolocation: { + prototype: Geolocation; + new(): Geolocation; +} + +interface HTMLAllCollection extends HTMLCollection { + namedItem(name: string): Element; +} + +declare var HTMLAllCollection: { + prototype: HTMLAllCollection; + new(): HTMLAllCollection; +} + +interface HTMLAnchorElement extends HTMLElement { + Methods: string; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Sets or retrieves the coordinates of the object. + */ + coords: string; + /** + * Contains the anchor portion of the URL including the hash sign (#). + */ + hash: string; + /** + * Contains the hostname and port values of the URL. + */ + host: string; + /** + * Contains the hostname of a URL. + */ + hostname: string; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or retrieves the language code of the object. + */ + hreflang: string; + mimeType: string; + /** + * Sets or retrieves the shape of the object. + */ + name: string; + nameProp: string; + /** + * Contains the pathname of the URL. + */ + pathname: string; + /** + * Sets or retrieves the port number associated with a URL. + */ + port: string; + /** + * Contains the protocol of the URL. + */ + protocol: string; + protocolLong: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rel: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rev: string; + /** + * Sets or retrieves the substring of the href property that follows the question mark. + */ + search: string; + /** + * Sets or retrieves the shape of the object. + */ + shape: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; + type: string; + urn: string; + /** + * Returns a string representation of an object. + */ + toString(): string; +} + +declare var HTMLAnchorElement: { + prototype: HTMLAnchorElement; + new(): HTMLAnchorElement; +} + +interface HTMLAppletElement extends HTMLElement { + /** + * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. + */ + BaseHref: string; + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Gets or sets the optional alternative HTML script to execute if the object fails to load. + */ + altHtml: string; + /** + * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. + */ + archive: string; + border: string; + code: string; + /** + * Sets or retrieves the URL of the component. + */ + codeBase: string; + /** + * Sets or retrieves the Internet media type for the code associated with the object. + */ + codeType: string; + /** + * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned. + */ + contentDocument: Document; + /** + * Sets or retrieves the URL that references the data of the object. + */ + data: string; + /** + * Sets or retrieves a character string that can be used to implement your own declare functionality for the object. + */ + declare: boolean; + form: HTMLFormElement; + /** + * Sets or retrieves the height of the object. + */ + height: string; + hspace: number; + /** + * Sets or retrieves the shape of the object. + */ + name: string; + object: string; + /** + * Sets or retrieves a message to be displayed while an object is loading. + */ + standby: string; + /** + * Returns the content type of the object. + */ + type: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + vspace: number; + width: number; +} + +declare var HTMLAppletElement: { + prototype: HTMLAppletElement; + new(): HTMLAppletElement; +} + +interface HTMLAreaElement extends HTMLElement { + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Sets or retrieves the coordinates of the object. + */ + coords: string; + /** + * Sets or retrieves the subsection of the href property that follows the number sign (#). + */ + hash: string; + /** + * Sets or retrieves the hostname and port number of the location or URL. + */ + host: string; + /** + * Sets or retrieves the host name part of the location or URL. + */ + hostname: string; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or gets whether clicks in this region cause action. + */ + noHref: boolean; + /** + * Sets or retrieves the file name or path specified by the object. + */ + pathname: string; + /** + * Sets or retrieves the port number associated with a URL. + */ + port: string; + /** + * Sets or retrieves the protocol portion of a URL. + */ + protocol: string; + rel: string; + /** + * Sets or retrieves the substring of the href property that follows the question mark. + */ + search: string; + /** + * Sets or retrieves the shape of the object. + */ + shape: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Returns a string representation of an object. + */ + toString(): string; +} + +declare var HTMLAreaElement: { + prototype: HTMLAreaElement; + new(): HTMLAreaElement; +} + +interface HTMLAreasCollection extends HTMLCollection { + /** + * Adds an element to the areas, controlRange, or options collection. + */ + add(element: HTMLElement, before?: HTMLElement): void; + add(element: HTMLElement, before?: number): void; + /** + * Removes an element from the collection. + */ + remove(index?: number): void; +} + +declare var HTMLAreasCollection: { + prototype: HTMLAreasCollection; + new(): HTMLAreasCollection; +} + +interface HTMLAudioElement extends HTMLMediaElement { +} + +declare var HTMLAudioElement: { + prototype: HTMLAudioElement; + new(): HTMLAudioElement; +} + +interface HTMLBRElement extends HTMLElement { + /** + * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document. + */ + clear: string; +} + +declare var HTMLBRElement: { + prototype: HTMLBRElement; + new(): HTMLBRElement; +} + +interface HTMLBaseElement extends HTMLElement { + /** + * Gets or sets the baseline URL on which relative links are based. + */ + href: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; +} + +declare var HTMLBaseElement: { + prototype: HTMLBaseElement; + new(): HTMLBaseElement; +} + +interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty { + /** + * Sets or retrieves the current typeface family. + */ + face: string; + /** + * Sets or retrieves the font size of the object. + */ + size: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLBaseFontElement: { + prototype: HTMLBaseFontElement; + new(): HTMLBaseFontElement; +} + +interface HTMLBlockElement extends HTMLElement { + /** + * Sets or retrieves reference information about the object. + */ + cite: string; + clear: string; + /** + * Sets or retrieves the width of the object. + */ + width: number; +} + +declare var HTMLBlockElement: { + prototype: HTMLBlockElement; + new(): HTMLBlockElement; +} + +interface HTMLBodyElement extends HTMLElement { + aLink: any; + background: string; + bgColor: any; + bgProperties: string; + link: any; + noWrap: boolean; + onafterprint: (ev: Event) => any; + onbeforeprint: (ev: Event) => any; + onbeforeunload: (ev: BeforeUnloadEvent) => any; + onblur: (ev: FocusEvent) => any; + onerror: (ev: Event) => any; + onfocus: (ev: FocusEvent) => any; + onhashchange: (ev: HashChangeEvent) => any; + onload: (ev: Event) => any; + onmessage: (ev: MessageEvent) => any; + onoffline: (ev: Event) => any; + ononline: (ev: Event) => any; + onorientationchange: (ev: Event) => any; + onpagehide: (ev: PageTransitionEvent) => any; + onpageshow: (ev: PageTransitionEvent) => any; + onpopstate: (ev: PopStateEvent) => any; + onresize: (ev: UIEvent) => any; + onstorage: (ev: StorageEvent) => any; + onunload: (ev: Event) => any; + text: any; + vLink: any; + createTextRange(): TextRange; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "msthumbnailclick", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stop", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mssitemodejumplistitemremoved", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectionchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "storagecommit", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msfullscreenerror", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msfullscreenchange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Document: { - prototype: Document; - new(): Document; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface Console { - info(message?: any, ...optionalParams: any[]): void; - warn(message?: any, ...optionalParams: any[]): void; - error(message?: any, ...optionalParams: any[]): void; - log(message?: any, ...optionalParams: any[]): void; - profile(reportName?: string): void; - assert(test?: boolean, message?: string, ...optionalParams: any[]): void; - msIsIndependentlyComposed(element: Element): boolean; - clear(): void; - dir(value?: any, ...optionalParams: any[]): void; - profileEnd(): void; - count(countTitle?: string): void; - groupEnd(): void; - time(timerName?: string): void; - timeEnd(timerName?: string): void; - trace(): void; - group(groupTitle?: string): void; - dirxml(value: any): void; - debug(message?: string, ...optionalParams: any[]): void; - groupCollapsed(groupTitle?: string): void; - select(element: Element): void; -} -declare var Console: { - prototype: Console; - new(): Console; +declare var HTMLBodyElement: { + prototype: HTMLBodyElement; + new(): HTMLBodyElement; } -interface MSEventObj extends Event { - nextPage: string; - keyCode: number; - toElement: Element; - returnValue: any; - dataFld: string; - y: number; - dataTransfer: DataTransfer; - propertyName: string; - url: string; - offsetX: number; - recordset: any; - screenX: number; - buttonID: number; - wheelDelta: number; - reason: number; - origin: string; - data: string; - srcFilter: any; - boundElements: HTMLCollection; - cancelBubble: boolean; - altLeft: boolean; - behaviorCookie: number; - bookmarks: BookmarkCollection; +interface HTMLButtonElement extends HTMLElement { + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Overrides the action attribute (where the data on a form is sent) on the parent form element. + */ + formAction: string; + /** + * Used to override the encoding (formEnctype attribute) specified on the form element. + */ + formEnctype: string; + /** + * Overrides the submit method attribute previously specified on a form element. + */ + formMethod: string; + /** + * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. + */ + formNoValidate: string; + /** + * Overrides the target attribute on a form element. + */ + formTarget: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + status: any; + /** + * Gets the classification and default behavior of the button. + */ type: string; - repeat: boolean; - srcElement: Element; - source: Window; - fromElement: Element; - offsetY: number; - x: number; - behaviorPart: number; - qualifier: string; - altKey: boolean; - ctrlKey: boolean; - clientY: number; - shiftKey: boolean; - shiftLeft: boolean; - contentOverflow: boolean; - screenY: number; - ctrlLeft: boolean; - button: number; - srcUrn: string; - clientX: number; - actionURL: string; - getAttribute(strAttributeName: string, lFlags?: number): any; - setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; - removeAttribute(strAttributeName: string, lFlags?: number): boolean; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Sets or retrieves the default or selected value of the control. + */ + value: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Creates a TextRange object for the element. + */ + createTextRange(): TextRange; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; } -declare var MSEventObj: { - prototype: MSEventObj; - new(): MSEventObj; + +declare var HTMLButtonElement: { + prototype: HTMLButtonElement; + new(): HTMLButtonElement; } interface HTMLCanvasElement extends HTMLElement { - /** - * Gets or sets the width of a canvas element on a document. - */ - width: number; /** * Gets or sets the height of a canvas element on a document. */ height: number; /** - * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. - * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); + * Gets or sets the width of a canvas element on a document. */ - getContext(contextId: "2d"): CanvasRenderingContext2D; + width: number; /** * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); */ - getContext(contextId: "experimental-webgl"): WebGLRenderingContext; + getContext(contextId: string, ...args: any[]): CanvasRenderingContext2D | WebGLRenderingContext; /** - * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. - * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); + * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. */ - getContext(contextId: string, ...args: any[]): any; + msToBlob(): Blob; /** * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element. * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image. */ toDataURL(type?: string, ...args: any[]): string; - /** - * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. - */ - msToBlob(): Blob; } + declare var HTMLCanvasElement: { prototype: HTMLCanvasElement; new(): HTMLCanvasElement; } -interface Window extends EventTarget, MSEventAttachmentTarget, WindowLocalStorage, MSWindowExtensions, WindowSessionStorage, WindowTimers, WindowBase64, IDBEnvironment, WindowConsole, GlobalEventHandlers { - ondragend: (ev: DragEvent) => any; - onkeydown: (ev: KeyboardEvent) => any; - ondragover: (ev: DragEvent) => any; - onkeyup: (ev: KeyboardEvent) => any; - onreset: (ev: Event) => any; - onmouseup: (ev: MouseEvent) => any; - ondragstart: (ev: DragEvent) => any; - ondrag: (ev: DragEvent) => any; - screenX: number; - onmouseover: (ev: MouseEvent) => any; - ondragleave: (ev: DragEvent) => any; - history: History; - pageXOffset: number; - name: string; - onafterprint: (ev: Event) => any; - onpause: (ev: Event) => any; - onbeforeprint: (ev: Event) => any; - top: Window; - onmousedown: (ev: MouseEvent) => any; - onseeked: (ev: Event) => any; - opener: Window; - onclick: (ev: MouseEvent) => any; - innerHeight: number; - onwaiting: (ev: Event) => any; - ononline: (ev: Event) => any; - ondurationchange: (ev: Event) => any; - frames: Window; - onblur: (ev: FocusEvent) => any; - onemptied: (ev: Event) => any; - onseeking: (ev: Event) => any; - oncanplay: (ev: Event) => any; - outerWidth: number; - onstalled: (ev: Event) => any; - onmousemove: (ev: MouseEvent) => any; - innerWidth: number; - onoffline: (ev: Event) => any; - length: number; - screen: Screen; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - onratechange: (ev: Event) => any; - onstorage: (ev: StorageEvent) => any; - onloadstart: (ev: Event) => any; - ondragenter: (ev: DragEvent) => any; - onsubmit: (ev: Event) => any; - self: Window; - document: Document; - onprogress: (ev: ProgressEvent) => any; - ondblclick: (ev: MouseEvent) => any; - pageYOffset: number; - oncontextmenu: (ev: MouseEvent) => any; - onchange: (ev: Event) => any; - onloadedmetadata: (ev: Event) => any; - onplay: (ev: Event) => any; - onerror: ErrorEventHandler; - onplaying: (ev: Event) => any; - parent: Window; - location: Location; - oncanplaythrough: (ev: Event) => any; - onabort: (ev: UIEvent) => any; - onreadystatechange: (ev: Event) => any; - outerHeight: number; - onkeypress: (ev: KeyboardEvent) => any; - frameElement: Element; - onloadeddata: (ev: Event) => any; - onsuspend: (ev: Event) => any; - window: Window; - onfocus: (ev: FocusEvent) => any; - onmessage: (ev: MessageEvent) => any; - ontimeupdate: (ev: Event) => any; - onresize: (ev: UIEvent) => any; - onselect: (ev: UIEvent) => any; - navigator: Navigator; - styleMedia: StyleMedia; - ondrop: (ev: DragEvent) => any; - onmouseout: (ev: MouseEvent) => any; - onended: (ev: Event) => any; - onhashchange: (ev: Event) => any; - onunload: (ev: Event) => any; - onscroll: (ev: UIEvent) => any; - screenY: number; - onmousewheel: (ev: MouseWheelEvent) => any; - onload: (ev: Event) => any; - onvolumechange: (ev: Event) => any; - oninput: (ev: Event) => any; - performance: Performance; - onmspointerdown: (ev: any) => any; - animationStartTime: number; - onmsgesturedoubletap: (ev: any) => any; - onmspointerhover: (ev: any) => any; - onmsgesturehold: (ev: any) => any; - onmspointermove: (ev: any) => any; - onmsgesturechange: (ev: any) => any; - onmsgesturestart: (ev: any) => any; - onmspointercancel: (ev: any) => any; - onmsgestureend: (ev: any) => any; - onmsgesturetap: (ev: any) => any; - onmspointerout: (ev: any) => any; - msAnimationStartTime: number; - applicationCache: ApplicationCache; - onmsinertiastart: (ev: any) => any; - onmspointerover: (ev: any) => any; - onpopstate: (ev: PopStateEvent) => any; - onmspointerup: (ev: any) => any; - onpageshow: (ev: PageTransitionEvent) => any; - ondevicemotion: (ev: DeviceMotionEvent) => any; - devicePixelRatio: number; - msCrypto: Crypto; - ondeviceorientation: (ev: DeviceOrientationEvent) => any; - doNotTrack: string; - onmspointerenter: (ev: any) => any; - onpagehide: (ev: PageTransitionEvent) => any; - onmspointerleave: (ev: any) => any; - alert(message?: any): void; - scroll(x?: number, y?: number): void; - focus(): void; - scrollTo(x?: number, y?: number): void; - print(): void; - prompt(message?: string, _default?: string): string; - toString(): string; - open(url?: string, target?: string, features?: string, replace?: boolean): Window; - scrollBy(x?: number, y?: number): void; - confirm(message?: string): boolean; - close(): void; - postMessage(message: any, targetOrigin: string, ports?: any): void; - showModalDialog(url?: string, argument?: any, options?: any): any; - blur(): void; - getSelection(): Selection; - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; - msCancelRequestAnimationFrame(handle: number): void; - matchMedia(mediaQuery: string): MediaQueryList; - cancelAnimationFrame(handle: number): void; - msIsStaticHTML(html: string): boolean; - msMatchMedia(mediaQuery: string): MediaQueryList; - requestAnimationFrame(callback: FrameRequestCallback): number; - msRequestAnimationFrame(callback: FrameRequestCallback): number; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Window: { - prototype: Window; - new(): Window; -} - -interface HTMLCollection extends MSHTMLCollectionExtensions { +interface HTMLCollection { /** * Sets or retrieves the number of objects in a collection. */ @@ -1878,1338 +3727,2371 @@ interface HTMLCollection extends MSHTMLCollectionExtensions { * Retrieves a select object or an object from an options collection. */ namedItem(name: string): Element; - // [name: string]: Element; [index: number]: Element; } + declare var HTMLCollection: { prototype: HTMLCollection; new(): HTMLCollection; } -interface BlobPropertyBag { - type?: string; - endings?: string; +interface HTMLDDElement extends HTMLElement { + /** + * Sets or retrieves whether the browser automatically performs wordwrap. + */ + noWrap: boolean; } -interface Blob { - type: string; - size: number; - msDetachStream(): any; - slice(start?: number, end?: number, contentType?: string): Blob; - msClose(): void; -} -declare var Blob: { - prototype: Blob; - new (blobParts?: any[], options?: BlobPropertyBag): Blob; +declare var HTMLDDElement: { + prototype: HTMLDDElement; + new(): HTMLDDElement; } -interface NavigatorID { - appVersion: string; - appName: string; - userAgent: string; - platform: string; - product: string; - vendor: string; +interface HTMLDListElement extends HTMLElement { + compact: boolean; } -interface HTMLTableElement extends HTMLElement, MSDataBindingTableExtensions, MSDataBindingExtensions, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorLight: any; - /** - * Sets or retrieves the amount of space between cells in a table. - */ - cellSpacing: string; - /** - * Retrieves the tFoot object of the table. - */ - tFoot: HTMLTableSectionElement; - /** - * Sets or retrieves the way the border frame around the table is displayed. - */ - frame: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: HTMLCollection; - /** - * Sets or retrieves which dividing lines (inner borders) are displayed. - */ - rules: string; - /** - * Sets or retrieves the number of columns in the table. - */ - cols: number; - /** - * Sets or retrieves a description and/or structure of the object. - */ - summary: string; - /** - * Retrieves the caption object of a table. - */ - caption: HTMLTableCaptionElement; - /** - * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order. - */ - tBodies: HTMLCollection; - /** - * Retrieves the tHead object of the table. - */ - tHead: HTMLTableSectionElement; - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; - /** - * Retrieves a collection of all cells in the table row or in the entire table. - */ - cells: HTMLCollection; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves the amount of space between the border of the cell and the content of the cell. - */ - cellPadding: string; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - border: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorDark: any; - /** - * Removes the specified row (tr) from the element and from the rows collection. - * @param index Number that specifies the zero-based position in the rows collection of the row to remove. - */ - deleteRow(index?: number): void; - /** - * Creates an empty tBody element in the table. - */ - createTBody(): HTMLElement; - /** - * Deletes the caption element and its contents from the table. - */ - deleteCaption(): void; - /** - * Creates a new row (tr) in the table, and adds the row to the rows collection. - * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. - */ - insertRow(index?: number): HTMLElement; - /** - * Deletes the tFoot element and its contents from the table. - */ - deleteTFoot(): void; - /** - * Returns the tHead element object if successful, or null otherwise. - */ - createTHead(): HTMLElement; - /** - * Deletes the tHead element and its contents from the table. - */ - deleteTHead(): void; - /** - * Creates an empty caption element in the table. - */ - createCaption(): HTMLElement; - /** - * Moves a table row to a new position. - * @param indexFrom Number that specifies the index in the rows collection of the table row that is moved. - * @param indexTo Number that specifies where the row is moved within the rows collection. - */ - moveRow(indexFrom?: number, indexTo?: number): any; - /** - * Creates an empty tFoot element in the table. - */ - createTFoot(): HTMLElement; -} -declare var HTMLTableElement: { - prototype: HTMLTableElement; - new(): HTMLTableElement; +declare var HTMLDListElement: { + prototype: HTMLDListElement; + new(): HTMLDListElement; } -interface TreeWalker { - whatToShow: number; - filter: NodeFilter; - root: Node; - currentNode: Node; - expandEntityReferences: boolean; - previousSibling(): Node; - lastChild(): Node; - nextSibling(): Node; - nextNode(): Node; - parentNode(): Node; - firstChild(): Node; - previousNode(): Node; -} -declare var TreeWalker: { - prototype: TreeWalker; - new(): TreeWalker; -} - -interface GetSVGDocument { - getSVGDocument(): Document; -} - -interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { - y: number; - y1: number; - x: number; - x1: number; -} -declare var SVGPathSegCurvetoQuadraticRel: { - prototype: SVGPathSegCurvetoQuadraticRel; - new(): SVGPathSegCurvetoQuadraticRel; -} - -interface Performance { - navigation: PerformanceNavigation; - timing: PerformanceTiming; - getEntriesByType(entryType: string): any; - toJSON(): any; - getMeasures(measureName?: string): any; - clearMarks(markName?: string): void; - getMarks(markName?: string): any; - clearResourceTimings(): void; - mark(markName: string): void; - measure(measureName: string, startMarkName?: string, endMarkName?: string): void; - getEntriesByName(name: string, entryType?: string): any; - getEntries(): any; - clearMeasures(measureName?: string): void; - setResourceTimingBufferSize(maxSize: number): void; - now(): number; -} -declare var Performance: { - prototype: Performance; - new(): Performance; -} - -interface MSDataBindingTableExtensions { - dataPageSize: number; - nextPage(): void; - firstPage(): void; - refresh(): void; - previousPage(): void; - lastPage(): void; -} - -interface CompositionEvent extends UIEvent { - data: string; - locale: string; - initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void; -} -declare var CompositionEvent: { - prototype: CompositionEvent; - new(): CompositionEvent; -} - -interface WindowTimers extends WindowTimersExtension { - clearTimeout(handle: number): void; - setTimeout(handler: any, timeout?: any, ...args: any[]): number; - clearInterval(handle: number): void; - setInterval(handler: any, timeout?: any, ...args: any[]): number; -} - -interface SVGMarkerElement extends SVGElement, SVGStylable, SVGLangSpace, SVGFitToViewBox, SVGExternalResourcesRequired { - orientType: SVGAnimatedEnumeration; - markerUnits: SVGAnimatedEnumeration; - markerWidth: SVGAnimatedLength; - markerHeight: SVGAnimatedLength; - orientAngle: SVGAnimatedAngle; - refY: SVGAnimatedLength; - refX: SVGAnimatedLength; - setOrientToAngle(angle: SVGAngle): void; - setOrientToAuto(): void; - SVG_MARKER_ORIENT_UNKNOWN: number; - SVG_MARKER_ORIENT_ANGLE: number; - SVG_MARKERUNITS_UNKNOWN: number; - SVG_MARKERUNITS_STROKEWIDTH: number; - SVG_MARKER_ORIENT_AUTO: number; - SVG_MARKERUNITS_USERSPACEONUSE: number; -} -declare var SVGMarkerElement: { - prototype: SVGMarkerElement; - new(): SVGMarkerElement; - SVG_MARKER_ORIENT_UNKNOWN: number; - SVG_MARKER_ORIENT_ANGLE: number; - SVG_MARKERUNITS_UNKNOWN: number; - SVG_MARKERUNITS_STROKEWIDTH: number; - SVG_MARKER_ORIENT_AUTO: number; - SVG_MARKERUNITS_USERSPACEONUSE: number; -} - -interface CSSStyleDeclaration { - backgroundAttachment: string; - visibility: string; - textAlignLast: string; - borderRightStyle: string; - counterIncrement: string; - orphans: string; - cssText: string; - borderStyle: string; - pointerEvents: string; - borderTopColor: string; - markerEnd: string; - textIndent: string; - listStyleImage: string; - cursor: string; - listStylePosition: string; - wordWrap: string; - borderTopStyle: string; - alignmentBaseline: string; - opacity: string; - direction: string; - strokeMiterlimit: string; - maxWidth: string; - color: string; - clip: string; - borderRightWidth: string; - verticalAlign: string; - overflow: string; - mask: string; - borderLeftStyle: string; - emptyCells: string; - stopOpacity: string; - paddingRight: string; - parentRule: CSSRule; - background: string; - boxSizing: string; - textJustify: string; - height: string; - paddingTop: string; - length: number; - right: string; - baselineShift: string; - borderLeft: string; - widows: string; - lineHeight: string; - left: string; - textUnderlinePosition: string; - glyphOrientationHorizontal: string; - display: string; - textAnchor: string; - cssFloat: string; - strokeDasharray: string; - rubyAlign: string; - fontSizeAdjust: string; - borderLeftColor: string; - backgroundImage: string; - listStyleType: string; - strokeWidth: string; - textOverflow: string; - fillRule: string; - borderBottomColor: string; - zIndex: string; - position: string; - listStyle: string; - msTransformOrigin: string; - dominantBaseline: string; - overflowY: string; - fill: string; - captionSide: string; - borderCollapse: string; - boxShadow: string; - quotes: string; - tableLayout: string; - unicodeBidi: string; - borderBottomWidth: string; - backgroundSize: string; - textDecoration: string; - strokeDashoffset: string; - fontSize: string; - border: string; - pageBreakBefore: string; - borderTopRightRadius: string; - msTransform: string; - borderBottomLeftRadius: string; - textTransform: string; - rubyPosition: string; - strokeLinejoin: string; - clipPath: string; - borderRightColor: string; - fontFamily: string; - clear: string; - content: string; - backgroundClip: string; - marginBottom: string; - counterReset: string; - outlineWidth: string; - marginRight: string; - paddingLeft: string; - borderBottom: string; - wordBreak: string; - marginTop: string; - top: string; - fontWeight: string; - borderRight: string; - width: string; - kerning: string; - pageBreakAfter: string; - borderBottomStyle: string; - fontStretch: string; - padding: string; - strokeOpacity: string; - markerStart: string; - bottom: string; - borderLeftWidth: string; - clipRule: string; - backgroundPosition: string; - backgroundColor: string; - pageBreakInside: string; - backgroundOrigin: string; - strokeLinecap: string; - borderTopWidth: string; - outlineStyle: string; - borderTop: string; - outlineColor: string; - paddingBottom: string; - marginLeft: string; - font: string; - outline: string; - wordSpacing: string; - maxHeight: string; - fillOpacity: string; - letterSpacing: string; - borderSpacing: string; - backgroundRepeat: string; - borderRadius: string; - borderWidth: string; - borderBottomRightRadius: string; - whiteSpace: string; - fontStyle: string; - minWidth: string; - stopColor: string; - borderTopLeftRadius: string; - borderColor: string; - marker: string; - glyphOrientationVertical: string; - markerMid: string; - fontVariant: string; - minHeight: string; - stroke: string; - rubyOverhang: string; - overflowX: string; - textAlign: string; - margin: string; - animationFillMode: string; - floodColor: string; - animationIterationCount: string; - textShadow: string; - backfaceVisibility: string; - msAnimationIterationCount: string; - animationDelay: string; - animationTimingFunction: string; - columnWidth: any; - msScrollSnapX: string; - columnRuleColor: any; - columnRuleWidth: any; - transitionDelay: string; - transition: string; - msFlowFrom: string; - msScrollSnapType: string; - msContentZoomSnapType: string; - msGridColumns: string; - msAnimationName: string; - msGridRowAlign: string; - msContentZoomChaining: string; - msGridColumn: any; - msHyphenateLimitZone: any; - msScrollRails: string; - msAnimationDelay: string; - enableBackground: string; - msWrapThrough: string; - columnRuleStyle: string; - msAnimation: string; - msFlexFlow: string; - msScrollSnapY: string; - msHyphenateLimitLines: any; - msTouchAction: string; - msScrollLimit: string; - animation: string; - transform: string; - filter: string; - colorInterpolationFilters: string; - transitionTimingFunction: string; - msBackfaceVisibility: string; - animationPlayState: string; - transformOrigin: string; - msScrollLimitYMin: any; - msFontFeatureSettings: string; - msContentZoomLimitMin: any; - columnGap: any; - transitionProperty: string; - msAnimationDuration: string; - msAnimationFillMode: string; - msFlexDirection: string; - msTransitionDuration: string; - fontFeatureSettings: string; - breakBefore: string; - msFlexWrap: string; - perspective: string; - msFlowInto: string; - msTransformStyle: string; - msScrollTranslation: string; - msTransitionProperty: string; - msUserSelect: string; - msOverflowStyle: string; - msScrollSnapPointsY: string; - animationDirection: string; - animationDuration: string; - msFlex: string; - msTransitionTimingFunction: string; - animationName: string; - columnRule: string; - msGridColumnSpan: any; - msFlexNegative: string; - columnFill: string; - msGridRow: any; - msFlexOrder: string; - msFlexItemAlign: string; - msFlexPositive: string; - msContentZoomLimitMax: any; - msScrollLimitYMax: any; - msGridColumnAlign: string; - perspectiveOrigin: string; - lightingColor: string; - columns: string; - msScrollChaining: string; - msHyphenateLimitChars: string; - msTouchSelect: string; - floodOpacity: string; - msAnimationDirection: string; - msAnimationPlayState: string; - columnSpan: string; - msContentZooming: string; - msPerspective: string; - msFlexPack: string; - msScrollSnapPointsX: string; - msContentZoomSnapPoints: string; - msGridRowSpan: any; - msContentZoomSnap: string; - msScrollLimitXMin: any; - breakInside: string; - msHighContrastAdjust: string; - msFlexLinePack: string; - msGridRows: string; - transitionDuration: string; - msHyphens: string; - breakAfter: string; - msTransition: string; - msPerspectiveOrigin: string; - msContentZoomLimit: string; - msScrollLimitXMax: any; - msFlexAlign: string; - msWrapMargin: any; - columnCount: any; - msAnimationTimingFunction: string; - msTransitionDelay: string; - transformStyle: string; - msWrapFlow: string; - msFlexPreferredSize: string; - alignItems: string; - borderImageSource: string; - flexBasis: string; - borderImageWidth: string; - borderImageRepeat: string; - order: string; - flex: string; - alignContent: string; - msImeAlign: string; - flexShrink: string; - flexGrow: string; - borderImageSlice: string; - flexWrap: string; - borderImageOutset: string; - flexDirection: string; - touchAction: string; - flexFlow: string; - borderImage: string; - justifyContent: string; - alignSelf: string; - msTextCombineHorizontal: string; - getPropertyPriority(propertyName: string): string; - getPropertyValue(propertyName: string): string; - removeProperty(propertyName: string): string; - item(index: number): string; - [index: number]: string; - setProperty(propertyName: string, value: string, priority?: string): void; -} -declare var CSSStyleDeclaration: { - prototype: CSSStyleDeclaration; - new(): CSSStyleDeclaration; -} - -interface SVGGElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGGElement: { - prototype: SVGGElement; - new(): SVGGElement; -} - -interface MSStyleCSSProperties extends MSCSSProperties { - pixelWidth: number; - posHeight: number; - posLeft: number; - pixelTop: number; - pixelBottom: number; - textDecorationNone: boolean; - pixelLeft: number; - posTop: number; - posBottom: number; - textDecorationOverline: boolean; - posWidth: number; - textDecorationLineThrough: boolean; - pixelHeight: number; - textDecorationBlink: boolean; - posRight: number; - pixelRight: number; - textDecorationUnderline: boolean; -} -declare var MSStyleCSSProperties: { - prototype: MSStyleCSSProperties; - new(): MSStyleCSSProperties; -} - -interface Navigator extends NavigatorID, NavigatorOnLine, NavigatorContentUtils, MSNavigatorExtensions, NavigatorGeolocation, MSNavigatorDoNotTrack, NavigatorStorageUtils, MSFileSaver { - msMaxTouchPoints: number; - msPointerEnabled: boolean; - msManipulationViewsEnabled: boolean; - pointerEnabled: boolean; - maxTouchPoints: number; - msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; -} -declare var Navigator: { - prototype: Navigator; - new(): Navigator; -} - -interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg { - y: number; - x2: number; - x: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicSmoothAbs: { - prototype: SVGPathSegCurvetoCubicSmoothAbs; - new(): SVGPathSegCurvetoCubicSmoothAbs; -} - -interface SVGZoomEvent extends UIEvent { - zoomRectScreen: SVGRect; - previousScale: number; - newScale: number; - previousTranslate: SVGPoint; - newTranslate: SVGPoint; -} -declare var SVGZoomEvent: { - prototype: SVGZoomEvent; - new(): SVGZoomEvent; -} - -interface NodeSelector { - querySelectorAll(selectors: string): NodeList; - querySelector(selectors: string): Element; -} - -interface HTMLTableDataCellElement extends HTMLTableCellElement { -} -declare var HTMLTableDataCellElement: { - prototype: HTMLTableDataCellElement; - new(): HTMLTableDataCellElement; -} - -interface HTMLBaseElement extends HTMLElement { +interface HTMLDTElement extends HTMLElement { /** - * Sets or retrieves the window or frame at which to target content. + * Sets or retrieves whether the browser automatically performs wordwrap. */ - target: string; - /** - * Gets or sets the baseline URL on which relative links are based. - */ - href: string; -} -declare var HTMLBaseElement: { - prototype: HTMLBaseElement; - new(): HTMLBaseElement; + noWrap: boolean; } -interface ClientRect { - left: number; - width: number; - right: number; - top: number; - bottom: number; - height: number; -} -declare var ClientRect: { - prototype: ClientRect; - new(): ClientRect; +declare var HTMLDTElement: { + prototype: HTMLDTElement; + new(): HTMLDTElement; } -interface PositionErrorCallback { - (error: PositionError): void; +interface HTMLDataListElement extends HTMLElement { + options: HTMLCollection; } -interface DOMImplementation { - createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; - createDocument(namespaceURI: string, qualifiedName: string, doctype: DocumentType): Document; - hasFeature(feature: string, version?: string): boolean; - createHTMLDocument(title: string): Document; -} -declare var DOMImplementation: { - prototype: DOMImplementation; - new(): DOMImplementation; +declare var HTMLDataListElement: { + prototype: HTMLDataListElement; + new(): HTMLDataListElement; } -interface SVGUnitTypes { - SVG_UNIT_TYPE_UNKNOWN: number; - SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; - SVG_UNIT_TYPE_USERSPACEONUSE: number; -} -declare var SVGUnitTypes: SVGUnitTypes; - -interface Element extends Node, NodeSelector, ElementTraversal, GlobalEventHandlers { - scrollTop: number; - clientLeft: number; - scrollLeft: number; - tagName: string; - clientWidth: number; - scrollWidth: number; - clientHeight: number; - clientTop: number; - scrollHeight: number; - msRegionOverflow: string; - onmspointerdown: (ev: any) => any; - onmsgotpointercapture: (ev: any) => any; - onmsgesturedoubletap: (ev: any) => any; - onmspointerhover: (ev: any) => any; - onmsgesturehold: (ev: any) => any; - onmspointermove: (ev: any) => any; - onmsgesturechange: (ev: any) => any; - onmsgesturestart: (ev: any) => any; - onmspointercancel: (ev: any) => any; - onmsgestureend: (ev: any) => any; - onmsgesturetap: (ev: any) => any; - onmspointerout: (ev: any) => any; - onmsinertiastart: (ev: any) => any; - onmslostpointercapture: (ev: any) => any; - onmspointerover: (ev: any) => any; - msContentZoomFactor: number; - onmspointerup: (ev: any) => any; - onlostpointercapture: (ev: PointerEvent) => any; - onmspointerenter: (ev: any) => any; - ongotpointercapture: (ev: PointerEvent) => any; - onmspointerleave: (ev: any) => any; - getAttribute(name?: string): string; - getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; - hasAttributeNS(namespaceURI: string, localName: string): boolean; - getBoundingClientRect(): ClientRect; - getAttributeNS(namespaceURI: string, localName: string): string; - getAttributeNodeNS(namespaceURI: string, localName: string): Attr; - setAttributeNodeNS(newAttr: Attr): Attr; - msMatchesSelector(selectors: string): boolean; - hasAttribute(name: string): boolean; - removeAttribute(name?: string): void; - setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; - getAttributeNode(name: string): Attr; - fireEvent(eventName: string, eventObj?: any): boolean; - getElementsByTagName(name: "a"): NodeListOf; - getElementsByTagName(name: "abbr"): NodeListOf; - getElementsByTagName(name: "acronym"): NodeListOf; - getElementsByTagName(name: "address"): NodeListOf; - getElementsByTagName(name: "applet"): NodeListOf; - getElementsByTagName(name: "area"): NodeListOf; - getElementsByTagName(name: "article"): NodeListOf; - getElementsByTagName(name: "aside"): NodeListOf; - getElementsByTagName(name: "audio"): NodeListOf; - getElementsByTagName(name: "b"): NodeListOf; - getElementsByTagName(name: "base"): NodeListOf; - getElementsByTagName(name: "basefont"): NodeListOf; - getElementsByTagName(name: "bdo"): NodeListOf; - getElementsByTagName(name: "bgsound"): NodeListOf; - getElementsByTagName(name: "big"): NodeListOf; - getElementsByTagName(name: "blockquote"): NodeListOf; - getElementsByTagName(name: "body"): NodeListOf; - getElementsByTagName(name: "br"): NodeListOf; - getElementsByTagName(name: "button"): NodeListOf; - getElementsByTagName(name: "canvas"): NodeListOf; - getElementsByTagName(name: "caption"): NodeListOf; - getElementsByTagName(name: "center"): NodeListOf; - getElementsByTagName(name: "cite"): NodeListOf; - getElementsByTagName(name: "code"): NodeListOf; - getElementsByTagName(name: "col"): NodeListOf; - getElementsByTagName(name: "colgroup"): NodeListOf; - getElementsByTagName(name: "datalist"): NodeListOf; - getElementsByTagName(name: "dd"): NodeListOf; - getElementsByTagName(name: "del"): NodeListOf; - getElementsByTagName(name: "dfn"): NodeListOf; - getElementsByTagName(name: "dir"): NodeListOf; - getElementsByTagName(name: "div"): NodeListOf; - getElementsByTagName(name: "dl"): NodeListOf; - getElementsByTagName(name: "dt"): NodeListOf; - getElementsByTagName(name: "em"): NodeListOf; - getElementsByTagName(name: "embed"): NodeListOf; - getElementsByTagName(name: "fieldset"): NodeListOf; - getElementsByTagName(name: "figcaption"): NodeListOf; - getElementsByTagName(name: "figure"): NodeListOf; - getElementsByTagName(name: "font"): NodeListOf; - getElementsByTagName(name: "footer"): NodeListOf; - getElementsByTagName(name: "form"): NodeListOf; - getElementsByTagName(name: "frame"): NodeListOf; - getElementsByTagName(name: "frameset"): NodeListOf; - getElementsByTagName(name: "h1"): NodeListOf; - getElementsByTagName(name: "h2"): NodeListOf; - getElementsByTagName(name: "h3"): NodeListOf; - getElementsByTagName(name: "h4"): NodeListOf; - getElementsByTagName(name: "h5"): NodeListOf; - getElementsByTagName(name: "h6"): NodeListOf; - getElementsByTagName(name: "head"): NodeListOf; - getElementsByTagName(name: "header"): NodeListOf; - getElementsByTagName(name: "hgroup"): NodeListOf; - getElementsByTagName(name: "hr"): NodeListOf; - getElementsByTagName(name: "html"): NodeListOf; - getElementsByTagName(name: "i"): NodeListOf; - getElementsByTagName(name: "iframe"): NodeListOf; - getElementsByTagName(name: "img"): NodeListOf; - getElementsByTagName(name: "input"): NodeListOf; - getElementsByTagName(name: "ins"): NodeListOf; - getElementsByTagName(name: "isindex"): NodeListOf; - getElementsByTagName(name: "kbd"): NodeListOf; - getElementsByTagName(name: "keygen"): NodeListOf; - getElementsByTagName(name: "label"): NodeListOf; - getElementsByTagName(name: "legend"): NodeListOf; - getElementsByTagName(name: "li"): NodeListOf; - getElementsByTagName(name: "link"): NodeListOf; - getElementsByTagName(name: "listing"): NodeListOf; - getElementsByTagName(name: "map"): NodeListOf; - getElementsByTagName(name: "mark"): NodeListOf; - getElementsByTagName(name: "marquee"): NodeListOf; - getElementsByTagName(name: "menu"): NodeListOf; - getElementsByTagName(name: "meta"): NodeListOf; - getElementsByTagName(name: "nav"): NodeListOf; - getElementsByTagName(name: "nextid"): NodeListOf; - getElementsByTagName(name: "nobr"): NodeListOf; - getElementsByTagName(name: "noframes"): NodeListOf; - getElementsByTagName(name: "noscript"): NodeListOf; - getElementsByTagName(name: "object"): NodeListOf; - getElementsByTagName(name: "ol"): NodeListOf; - getElementsByTagName(name: "optgroup"): NodeListOf; - getElementsByTagName(name: "option"): NodeListOf; - getElementsByTagName(name: "p"): NodeListOf; - getElementsByTagName(name: "param"): NodeListOf; - getElementsByTagName(name: "plaintext"): NodeListOf; - getElementsByTagName(name: "pre"): NodeListOf; - getElementsByTagName(name: "progress"): NodeListOf; - getElementsByTagName(name: "q"): NodeListOf; - getElementsByTagName(name: "rt"): NodeListOf; - getElementsByTagName(name: "ruby"): NodeListOf; - getElementsByTagName(name: "s"): NodeListOf; - getElementsByTagName(name: "samp"): NodeListOf; - getElementsByTagName(name: "script"): NodeListOf; - getElementsByTagName(name: "section"): NodeListOf; - getElementsByTagName(name: "select"): NodeListOf; - getElementsByTagName(name: "small"): NodeListOf; - getElementsByTagName(name: "SOURCE"): NodeListOf; - getElementsByTagName(name: "span"): NodeListOf; - getElementsByTagName(name: "strike"): NodeListOf; - getElementsByTagName(name: "strong"): NodeListOf; - getElementsByTagName(name: "style"): NodeListOf; - getElementsByTagName(name: "sub"): NodeListOf; - getElementsByTagName(name: "sup"): NodeListOf; - getElementsByTagName(name: "table"): NodeListOf; - getElementsByTagName(name: "tbody"): NodeListOf; - getElementsByTagName(name: "td"): NodeListOf; - getElementsByTagName(name: "textarea"): NodeListOf; - getElementsByTagName(name: "tfoot"): NodeListOf; - getElementsByTagName(name: "th"): NodeListOf; - getElementsByTagName(name: "thead"): NodeListOf; - getElementsByTagName(name: "title"): NodeListOf; - getElementsByTagName(name: "tr"): NodeListOf; - getElementsByTagName(name: "track"): NodeListOf; - getElementsByTagName(name: "tt"): NodeListOf; - getElementsByTagName(name: "u"): NodeListOf; - getElementsByTagName(name: "ul"): NodeListOf; - getElementsByTagName(name: "var"): NodeListOf; - getElementsByTagName(name: "video"): NodeListOf; - getElementsByTagName(name: "wbr"): NodeListOf; - getElementsByTagName(name: "x-ms-webview"): NodeListOf; - getElementsByTagName(name: "xmp"): NodeListOf; - getElementsByTagName(name: string): NodeList; - getClientRects(): ClientRectList; - setAttributeNode(newAttr: Attr): Attr; - removeAttributeNode(oldAttr: Attr): Attr; - setAttribute(name?: string, value?: string): void; - removeAttributeNS(namespaceURI: string, localName: string): void; - msGetRegionContent(): MSRangeCollection; - msReleasePointerCapture(pointerId: number): void; - msSetPointerCapture(pointerId: number): void; - msZoomTo(args: MsZoomToOptions): void; - setPointerCapture(pointerId: number): void; - msGetUntransformedBounds(): ClientRect; - releasePointerCapture(pointerId: number): void; - msRequestFullscreen(): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Element: { - prototype: Element; - new(): Element; +interface HTMLDirectoryElement extends HTMLElement { + compact: boolean; } -interface HTMLNextIdElement extends HTMLElement { - n: string; -} -declare var HTMLNextIdElement: { - prototype: HTMLNextIdElement; - new(): HTMLNextIdElement; +declare var HTMLDirectoryElement: { + prototype: HTMLDirectoryElement; + new(): HTMLDirectoryElement; } -interface SVGPathSegMovetoRel extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegMovetoRel: { - prototype: SVGPathSegMovetoRel; - new(): SVGPathSegMovetoRel; -} - -interface SVGLineElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - y1: SVGAnimatedLength; - x2: SVGAnimatedLength; - x1: SVGAnimatedLength; - y2: SVGAnimatedLength; -} -declare var SVGLineElement: { - prototype: SVGLineElement; - new(): SVGLineElement; -} - -interface HTMLParagraphElement extends HTMLElement, DOML2DeprecatedTextFlowControl { +interface HTMLDivElement extends HTMLElement { /** * Sets or retrieves how the object is aligned with adjacent text. */ align: string; -} -declare var HTMLParagraphElement: { - prototype: HTMLParagraphElement; - new(): HTMLParagraphElement; -} - -interface HTMLAreasCollection extends HTMLCollection { /** - * Removes an element from the collection. + * Sets or retrieves whether the browser automatically performs wordwrap. */ - remove(index?: number): void; - /** - * Adds an element to the areas, controlRange, or options collection. - */ - add(element: HTMLElement, before?: any): void; -} -declare var HTMLAreasCollection: { - prototype: HTMLAreasCollection; - new(): HTMLAreasCollection; + noWrap: boolean; } -interface SVGDescElement extends SVGElement, SVGStylable, SVGLangSpace { -} -declare var SVGDescElement: { - prototype: SVGDescElement; - new(): SVGDescElement; +declare var HTMLDivElement: { + prototype: HTMLDivElement; + new(): HTMLDivElement; } -interface Node extends EventTarget { - nodeType: number; - previousSibling: Node; - localName: string; - namespaceURI: string; - textContent: string; - parentNode: Node; - nextSibling: Node; - nodeValue: string; - lastChild: Node; - childNodes: NodeList; - nodeName: string; - ownerDocument: Document; - attributes: NamedNodeMap; - firstChild: Node; - prefix: string; - removeChild(oldChild: Node): Node; - appendChild(newChild: Node): Node; - isSupported(feature: string, version: string): boolean; - isEqualNode(arg: Node): boolean; - lookupPrefix(namespaceURI: string): string; - isDefaultNamespace(namespaceURI: string): boolean; - compareDocumentPosition(other: Node): number; - normalize(): void; - isSameNode(other: Node): boolean; - hasAttributes(): boolean; - lookupNamespaceURI(prefix: string): string; - cloneNode(deep?: boolean): Node; - hasChildNodes(): boolean; - replaceChild(newChild: Node, oldChild: Node): Node; - insertBefore(newChild: Node, refChild?: Node): Node; - ENTITY_REFERENCE_NODE: number; - ATTRIBUTE_NODE: number; - DOCUMENT_FRAGMENT_NODE: number; - TEXT_NODE: number; - ELEMENT_NODE: number; - COMMENT_NODE: number; - DOCUMENT_POSITION_DISCONNECTED: number; - DOCUMENT_POSITION_CONTAINED_BY: number; - DOCUMENT_POSITION_CONTAINS: number; - DOCUMENT_TYPE_NODE: number; - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - DOCUMENT_NODE: number; - ENTITY_NODE: number; - PROCESSING_INSTRUCTION_NODE: number; - CDATA_SECTION_NODE: number; - NOTATION_NODE: number; - DOCUMENT_POSITION_FOLLOWING: number; - DOCUMENT_POSITION_PRECEDING: number; -} -declare var Node: { - prototype: Node; - new(): Node; - ENTITY_REFERENCE_NODE: number; - ATTRIBUTE_NODE: number; - DOCUMENT_FRAGMENT_NODE: number; - TEXT_NODE: number; - ELEMENT_NODE: number; - COMMENT_NODE: number; - DOCUMENT_POSITION_DISCONNECTED: number; - DOCUMENT_POSITION_CONTAINED_BY: number; - DOCUMENT_POSITION_CONTAINS: number; - DOCUMENT_TYPE_NODE: number; - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - DOCUMENT_NODE: number; - ENTITY_NODE: number; - PROCESSING_INSTRUCTION_NODE: number; - CDATA_SECTION_NODE: number; - NOTATION_NODE: number; - DOCUMENT_POSITION_FOLLOWING: number; - DOCUMENT_POSITION_PRECEDING: number; +interface HTMLDocument extends Document { } -interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegCurvetoQuadraticSmoothRel: { - prototype: SVGPathSegCurvetoQuadraticSmoothRel; - new(): SVGPathSegCurvetoQuadraticSmoothRel; +declare var HTMLDocument: { + prototype: HTMLDocument; + new(): HTMLDocument; } -interface DOML2DeprecatedListSpaceReduction { - compact: boolean; +interface HTMLElement extends Element { + accessKey: string; + children: HTMLCollection; + className: string; + contentEditable: string; + dataset: DOMStringMap; + dir: string; + draggable: boolean; + hidden: boolean; + hideFocus: boolean; + id: string; + innerHTML: string; + innerText: string; + isContentEditable: boolean; + lang: string; + offsetHeight: number; + offsetLeft: number; + offsetParent: Element; + offsetTop: number; + offsetWidth: number; + onabort: (ev: Event) => any; + onactivate: (ev: UIEvent) => any; + onbeforeactivate: (ev: UIEvent) => any; + onbeforecopy: (ev: DragEvent) => any; + onbeforecut: (ev: DragEvent) => any; + onbeforedeactivate: (ev: UIEvent) => any; + onbeforepaste: (ev: DragEvent) => any; + onblur: (ev: FocusEvent) => any; + oncanplay: (ev: Event) => any; + oncanplaythrough: (ev: Event) => any; + onchange: (ev: Event) => any; + onclick: (ev: MouseEvent) => any; + oncontextmenu: (ev: PointerEvent) => any; + oncopy: (ev: DragEvent) => any; + oncuechange: (ev: Event) => any; + oncut: (ev: DragEvent) => any; + ondblclick: (ev: MouseEvent) => any; + ondeactivate: (ev: UIEvent) => any; + ondrag: (ev: DragEvent) => any; + ondragend: (ev: DragEvent) => any; + ondragenter: (ev: DragEvent) => any; + ondragleave: (ev: DragEvent) => any; + ondragover: (ev: DragEvent) => any; + ondragstart: (ev: DragEvent) => any; + ondrop: (ev: DragEvent) => any; + ondurationchange: (ev: Event) => any; + onemptied: (ev: Event) => any; + onended: (ev: Event) => any; + onerror: (ev: Event) => any; + onfocus: (ev: FocusEvent) => any; + oninput: (ev: Event) => any; + onkeydown: (ev: KeyboardEvent) => any; + onkeypress: (ev: KeyboardEvent) => any; + onkeyup: (ev: KeyboardEvent) => any; + onload: (ev: Event) => any; + onloadeddata: (ev: Event) => any; + onloadedmetadata: (ev: Event) => any; + onloadstart: (ev: Event) => any; + onmousedown: (ev: MouseEvent) => any; + onmouseenter: (ev: MouseEvent) => any; + onmouseleave: (ev: MouseEvent) => any; + onmousemove: (ev: MouseEvent) => any; + onmouseout: (ev: MouseEvent) => any; + onmouseover: (ev: MouseEvent) => any; + onmouseup: (ev: MouseEvent) => any; + onmousewheel: (ev: MouseWheelEvent) => any; + onmscontentzoom: (ev: UIEvent) => any; + onmsmanipulationstatechanged: (ev: MSManipulationEvent) => any; + onpaste: (ev: DragEvent) => any; + onpause: (ev: Event) => any; + onplay: (ev: Event) => any; + onplaying: (ev: Event) => any; + onprogress: (ev: ProgressEvent) => any; + onratechange: (ev: Event) => any; + onreset: (ev: Event) => any; + onscroll: (ev: UIEvent) => any; + onseeked: (ev: Event) => any; + onseeking: (ev: Event) => any; + onselect: (ev: UIEvent) => any; + onselectstart: (ev: Event) => any; + onstalled: (ev: Event) => any; + onsubmit: (ev: Event) => any; + onsuspend: (ev: Event) => any; + ontimeupdate: (ev: Event) => any; + onvolumechange: (ev: Event) => any; + onwaiting: (ev: Event) => any; + outerHTML: string; + outerText: string; + spellcheck: boolean; + style: CSSStyleDeclaration; + tabIndex: number; + title: string; + blur(): void; + click(): void; + contains(child: HTMLElement): boolean; + dragDrop(): boolean; + focus(): void; + getElementsByClassName(classNames: string): NodeList; + insertAdjacentElement(position: string, insertedElement: Element): Element; + insertAdjacentHTML(where: string, html: string): void; + insertAdjacentText(where: string, text: string): void; + msGetInputContext(): MSInputMethodContext; + scrollIntoView(top?: boolean): void; + setActive(): void; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface MSScriptHost { -} -declare var MSScriptHost: { - prototype: MSScriptHost; - new(): MSScriptHost; +declare var HTMLElement: { + prototype: HTMLElement; + new(): HTMLElement; } -interface SVGClipPathElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - clipPathUnits: SVGAnimatedEnumeration; -} -declare var SVGClipPathElement: { - prototype: SVGClipPathElement; - new(): SVGClipPathElement; -} - -interface MouseEvent extends UIEvent { - toElement: Element; - layerY: number; - fromElement: Element; - which: number; - pageX: number; - offsetY: number; - x: number; - y: number; - metaKey: boolean; - altKey: boolean; - ctrlKey: boolean; - offsetX: number; - screenX: number; - clientY: number; - shiftKey: boolean; - layerX: number; - screenY: number; - relatedTarget: EventTarget; - button: number; - pageY: number; - buttons: number; - clientX: number; - initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget): void; - getModifierState(keyArg: string): boolean; -} -declare var MouseEvent: { - prototype: MouseEvent; - new(): MouseEvent; -} - -interface RangeException { - code: number; - message: string; - name: string; - toString(): string; - INVALID_NODE_TYPE_ERR: number; - BAD_BOUNDARYPOINTS_ERR: number; -} -declare var RangeException: { - prototype: RangeException; - new(): RangeException; - INVALID_NODE_TYPE_ERR: number; - BAD_BOUNDARYPOINTS_ERR: number; -} - -interface SVGTextPositioningElement extends SVGTextContentElement { - y: SVGAnimatedLengthList; - rotate: SVGAnimatedNumberList; - dy: SVGAnimatedLengthList; - x: SVGAnimatedLengthList; - dx: SVGAnimatedLengthList; -} -declare var SVGTextPositioningElement: { - prototype: SVGTextPositioningElement; - new(): SVGTextPositioningElement; -} - -interface HTMLAppletElement extends HTMLElement, DOML2DeprecatedMarginStyle, DOML2DeprecatedBorderStyle, DOML2DeprecatedAlignmentStyle, MSDataBindingExtensions, MSDataBindingRecordSetExtensions { - width: number; - /** - * Sets or retrieves the Internet media type for the code associated with the object. - */ - codeType: string; - object: string; - form: HTMLFormElement; - code: string; - /** - * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. - */ - archive: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves a message to be displayed while an object is loading. - */ - standby: string; - /** - * Sets or retrieves the class identifier for the object. - */ - classid: string; - /** - * Sets or retrieves the shape of the object. - */ - name: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Sets or retrieves the URL that references the data of the object. - */ - data: string; +interface HTMLEmbedElement extends HTMLElement, GetSVGDocument { /** * Sets or retrieves the height of the object. */ height: string; + hidden: any; /** - * Gets or sets the optional alternative HTML script to execute if the object fails to load. + * Gets or sets whether the DLNA PlayTo device is available. */ - altHtml: string; + msPlayToDisabled: boolean; /** - * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned. + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. */ - contentDocument: Document; + msPlayToPreferredSourceUri: string; /** - * Sets or retrieves the URL of the component. + * Gets or sets the primary DLNA PlayTo device. */ - codeBase: string; + msPlayToPrimary: boolean; /** - * Sets or retrieves a character string that can be used to implement your own declare functionality for the object. + * Gets the source associated with the media element for use by the PlayToManager. */ - declare: boolean; - /** - * Returns the content type of the object. - */ - type: string; - /** - * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. - */ - BaseHref: string; -} -declare var HTMLAppletElement: { - prototype: HTMLAppletElement; - new(): HTMLAppletElement; -} - -interface TextMetrics { - width: number; -} -declare var TextMetrics: { - prototype: TextMetrics; - new(): TextMetrics; -} - -interface DocumentEvent { - createEvent(eventInterface: "AnimationEvent"): AnimationEvent; - createEvent(eventInterface: "CloseEvent"): CloseEvent; - createEvent(eventInterface: "CompositionEvent"): CompositionEvent; - createEvent(eventInterface: "CustomEvent"): CustomEvent; - createEvent(eventInterface: "DeviceMotionEvent"): DeviceMotionEvent; - createEvent(eventInterface: "DeviceOrientationEvent"): DeviceOrientationEvent; - createEvent(eventInterface: "DragEvent"): DragEvent; - createEvent(eventInterface: "ErrorEvent"): ErrorEvent; - createEvent(eventInterface: "Event"): Event; - createEvent(eventInterface: "Events"): Event; - createEvent(eventInterface: "FocusEvent"): FocusEvent; - createEvent(eventInterface: "HTMLEvents"): Event; - createEvent(eventInterface: "IDBVersionChangeEvent"): IDBVersionChangeEvent; - createEvent(eventInterface: "KeyboardEvent"): KeyboardEvent; - createEvent(eventInterface: "LongRunningScriptDetectedEvent"): LongRunningScriptDetectedEvent; - createEvent(eventInterface: "MessageEvent"): MessageEvent; - createEvent(eventInterface: "MouseEvent"): MouseEvent; - createEvent(eventInterface: "MouseEvents"): MouseEvent; - createEvent(eventInterface: "MouseWheelEvent"): MouseWheelEvent; - createEvent(eventInterface: "MSGestureEvent"): MSGestureEvent; - createEvent(eventInterface: "MSPointerEvent"): MSPointerEvent; - createEvent(eventInterface: "MutationEvent"): MutationEvent; - createEvent(eventInterface: "MutationEvents"): MutationEvent; - createEvent(eventInterface: "NavigationCompletedEvent"): NavigationCompletedEvent; - createEvent(eventInterface: "NavigationEvent"): NavigationEvent; - createEvent(eventInterface: "PageTransitionEvent"): PageTransitionEvent; - createEvent(eventInterface: "PointerEvent"): MSPointerEvent; - createEvent(eventInterface: "PopStateEvent"): PopStateEvent; - createEvent(eventInterface: "ProgressEvent"): ProgressEvent; - createEvent(eventInterface: "StorageEvent"): StorageEvent; - createEvent(eventInterface: "SVGZoomEvents"): SVGZoomEvent; - createEvent(eventInterface: "TextEvent"): TextEvent; - createEvent(eventInterface: "TrackEvent"): TrackEvent; - createEvent(eventInterface: "TransitionEvent"): TransitionEvent; - createEvent(eventInterface: "UIEvent"): UIEvent; - createEvent(eventInterface: "UIEvents"): UIEvent; - createEvent(eventInterface: "UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent; - createEvent(eventInterface: "WebGLContextEvent"): WebGLContextEvent; - createEvent(eventInterface: "WheelEvent"): WheelEvent; - createEvent(eventInterface: string): Event; -} - -interface HTMLOListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { - /** - * The starting number. - */ - start: number; -} -declare var HTMLOListElement: { - prototype: HTMLOListElement; - new(): HTMLOListElement; -} - -interface SVGPathSegLinetoVerticalRel extends SVGPathSeg { - y: number; -} -declare var SVGPathSegLinetoVerticalRel: { - prototype: SVGPathSegLinetoVerticalRel; - new(): SVGPathSegLinetoVerticalRel; -} - -interface SVGAnimatedString { - animVal: string; - baseVal: string; -} -declare var SVGAnimatedString: { - prototype: SVGAnimatedString; - new(): SVGAnimatedString; -} - -interface CDATASection extends Text { -} -declare var CDATASection: { - prototype: CDATASection; - new(): CDATASection; -} - -interface StyleMedia { - type: string; - matchMedium(mediaquery: string): boolean; -} -declare var StyleMedia: { - prototype: StyleMedia; - new(): StyleMedia; -} - -interface HTMLSelectElement extends HTMLElement, MSHTMLCollectionExtensions, MSDataBindingExtensions { - options: HTMLSelectElement; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; + msPlayToSource: any; /** * Sets or retrieves the name of the object. */ name: string; /** - * Sets or retrieves the number of rows in the list box. + * Retrieves the palette used for the embedded document. */ - size: number; + palette: string; + /** + * Retrieves the URL of the plug-in used to view an embedded document. + */ + pluginspage: string; + readyState: string; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the height and width units of the embed object. + */ + units: string; + /** + * Sets or retrieves the width of the object. + */ + width: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLEmbedElement: { + prototype: HTMLEmbedElement; + new(): HTMLEmbedElement; +} + +interface HTMLFieldSetElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; +} + +declare var HTMLFieldSetElement: { + prototype: HTMLFieldSetElement; + new(): HTMLFieldSetElement; +} + +interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { + /** + * Sets or retrieves the current typeface family. + */ + face: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLFontElement: { + prototype: HTMLFontElement; + new(): HTMLFontElement; +} + +interface HTMLFormElement extends HTMLElement { + /** + * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form. + */ + acceptCharset: string; + /** + * Sets or retrieves the URL to which the form content is sent for processing. + */ + action: string; + /** + * Specifies whether autocomplete is applied to an editable text field. + */ + autocomplete: string; + /** + * Retrieves a collection, in source order, of all controls in a given form. + */ + elements: HTMLCollection; + /** + * Sets or retrieves the MIME encoding for the form. + */ + encoding: string; + /** + * Sets or retrieves the encoding type for the form. + */ + enctype: string; /** * Sets or retrieves the number of objects in a collection. */ length: number; /** - * Sets or retrieves the index of the selected option in a select object. + * Sets or retrieves how to send the form data to the server. */ - selectedIndex: number; + method: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Designates a form that is not validated when submitted. + */ + noValidate: boolean; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Retrieves a form object or an object from an elements collection. + * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. + * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. + */ + item(name?: any, index?: any): any; + /** + * Retrieves a form object or an object from an elements collection. + */ + namedItem(name: string): any; + /** + * Fires when the user resets a form. + */ + reset(): void; + /** + * Fires when a FORM is about to be submitted. + */ + submit(): void; + [name: string]: any; +} + +declare var HTMLFormElement: { + prototype: HTMLFormElement; + new(): HTMLFormElement; +} + +interface HTMLFrameElement extends HTMLElement, GetSVGDocument { + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Retrieves the document object of the page or frame. + */ + contentDocument: Document; + /** + * Retrieves the object of the specified. + */ + contentWindow: Window; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + /** + * Sets or retrieves the height of the object. + */ + height: string | number; + /** + * Sets or retrieves a URI to a long description of the object. + */ + longDesc: string; + /** + * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. + */ + marginHeight: string; + /** + * Sets or retrieves the left and right margin widths before displaying the text in a frame. + */ + marginWidth: string; + /** + * Sets or retrieves the frame name. + */ + name: string; + /** + * Sets or retrieves whether the user can resize the frame. + */ + noResize: boolean; + /** + * Raised when the object has been completely received from the server. + */ + onload: (ev: Event) => any; + /** + * Sets or retrieves whether the frame can be scrolled. + */ + scrolling: string; + /** + * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. + */ + security: any; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the width of the object. + */ + width: string | number; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLFrameElement: { + prototype: HTMLFrameElement; + new(): HTMLFrameElement; +} + +interface HTMLFrameSetElement extends HTMLElement { + border: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Sets or retrieves the frame widths of the object. + */ + cols: string; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + name: string; + onafterprint: (ev: Event) => any; + onbeforeprint: (ev: Event) => any; + onbeforeunload: (ev: BeforeUnloadEvent) => any; + /** + * Fires when the object loses the input focus. + */ + onblur: (ev: FocusEvent) => any; + onerror: (ev: Event) => any; + /** + * Fires when the object receives focus. + */ + onfocus: (ev: FocusEvent) => any; + onhashchange: (ev: HashChangeEvent) => any; + onload: (ev: Event) => any; + onmessage: (ev: MessageEvent) => any; + onoffline: (ev: Event) => any; + ononline: (ev: Event) => any; + onorientationchange: (ev: Event) => any; + onpagehide: (ev: PageTransitionEvent) => any; + onpageshow: (ev: PageTransitionEvent) => any; + onresize: (ev: UIEvent) => any; + onstorage: (ev: StorageEvent) => any; + onunload: (ev: Event) => any; + /** + * Sets or retrieves the frame heights of the object. + */ + rows: string; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLFrameSetElement: { + prototype: HTMLFrameSetElement; + new(): HTMLFrameSetElement; +} + +interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves whether the horizontal rule is drawn with 3-D shading. + */ + noShade: boolean; + /** + * Sets or retrieves the width of the object. + */ + width: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLHRElement: { + prototype: HTMLHRElement; + new(): HTMLHRElement; +} + +interface HTMLHeadElement extends HTMLElement { + profile: string; +} + +declare var HTMLHeadElement: { + prototype: HTMLHeadElement; + new(): HTMLHeadElement; +} + +interface HTMLHeadingElement extends HTMLElement { + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; + clear: string; +} + +declare var HTMLHeadingElement: { + prototype: HTMLHeadingElement; + new(): HTMLHeadingElement; +} + +interface HTMLHtmlElement extends HTMLElement { + /** + * Sets or retrieves the DTD version that governs the current document. + */ + version: string; +} + +declare var HTMLHtmlElement: { + prototype: HTMLHtmlElement; + new(): HTMLHtmlElement; +} + +interface HTMLIFrameElement extends HTMLElement, GetSVGDocument { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + allowFullscreen: boolean; + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Retrieves the document object of the page or frame. + */ + contentDocument: Document; + /** + * Retrieves the object of the specified. + */ + contentWindow: Window; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Sets or retrieves the horizontal margin for the object. + */ + hspace: number; + /** + * Sets or retrieves a URI to a long description of the object. + */ + longDesc: string; + /** + * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. + */ + marginHeight: string; + /** + * Sets or retrieves the left and right margin widths before displaying the text in a frame. + */ + marginWidth: string; + /** + * Sets or retrieves the frame name. + */ + name: string; + /** + * Sets or retrieves whether the user can resize the frame. + */ + noResize: boolean; + /** + * Raised when the object has been completely received from the server. + */ + onload: (ev: Event) => any; + sandbox: DOMSettableTokenList; + /** + * Sets or retrieves whether the frame can be scrolled. + */ + scrolling: string; + /** + * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. + */ + security: any; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: string; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLIFrameElement: { + prototype: HTMLIFrameElement; + new(): HTMLIFrameElement; +} + +interface HTMLImageElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Retrieves whether the object is fully loaded. + */ + complete: boolean; + crossOrigin: string; + currentSrc: string; + /** + * Sets or retrieves the height of the object. + */ + height: number; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + hspace: number; + /** + * Sets or retrieves whether the image is a server-side image map. + */ + isMap: boolean; + /** + * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object. + */ + longDesc: string; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * The original height of the image resource before sizing. + */ + naturalHeight: number; + /** + * The original width of the image resource before sizing. + */ + naturalWidth: number; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + srcset: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: number; + x: number; + y: number; + msGetAsCastingSource(): any; +} + +declare var HTMLImageElement: { + prototype: HTMLImageElement; + new(): HTMLImageElement; + create(): HTMLImageElement; +} + +interface HTMLInputElement extends HTMLElement { + /** + * Sets or retrieves a comma-separated list of content types. + */ + accept: string; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Specifies whether autocomplete is applied to an editable text field. + */ + autocomplete: string; + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + border: string; + /** + * Sets or retrieves the state of the check box or radio button. + */ + checked: boolean; + /** + * Retrieves whether the object is fully loaded. + */ + complete: boolean; + /** + * Sets or retrieves the state of the check box or radio button. + */ + defaultChecked: boolean; + /** + * Sets or retrieves the initial contents of the object. + */ + defaultValue: string; + disabled: boolean; + /** + * Returns a FileList object on a file type input object. + */ + files: FileList; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Overrides the action attribute (where the data on a form is sent) on the parent form element. + */ + formAction: string; + /** + * Used to override the encoding (formEnctype attribute) specified on the form element. + */ + formEnctype: string; + /** + * Overrides the submit method attribute previously specified on a form element. + */ + formMethod: string; + /** + * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. + */ + formNoValidate: string; + /** + * Overrides the target attribute on a form element. + */ + formTarget: string; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + hspace: number; + indeterminate: boolean; + /** + * Specifies the ID of a pre-defined datalist of options for an input element. + */ + list: HTMLElement; + /** + * Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field. + */ + max: string; + /** + * Sets or retrieves the maximum number of characters that the user can enter in a text control. + */ + maxLength: number; + /** + * Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field. + */ + min: string; /** * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. */ multiple: boolean; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Gets or sets a string containing a regular expression that the user's input must match. + */ + pattern: string; + /** + * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. + */ + placeholder: string; + readOnly: boolean; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + /** + * Gets or sets the end position or offset of a text selection. + */ + selectionEnd: number; + /** + * Gets or sets the starting position or offset of a text selection. + */ + selectionStart: number; + size: number; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + status: boolean; + /** + * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field. + */ + step: string; + /** + * Returns the content type of the object. + */ + type: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Returns the value of the data at the cursor's current position. + */ + value: string; + valueAsDate: Date; + /** + * Returns the input field value as a number. + */ + valueAsNumber: number; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Creates a TextRange object for the element. + */ + createTextRange(): TextRange; + /** + * Makes the selection equal to the current object. + */ + select(): void; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + /** + * Sets the start and end positions of a selection in a text field. + * @param start The offset into the text field for the start of the selection. + * @param end The offset into the text field for the end of the selection. + */ + setSelectionRange(start: number, end: number): void; + /** + * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. + * @param n Value to decrement the value by. + */ + stepDown(n?: number): void; + /** + * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value. + * @param n Value to increment the value by. + */ + stepUp(n?: number): void; +} + +declare var HTMLInputElement: { + prototype: HTMLInputElement; + new(): HTMLInputElement; +} + +interface HTMLIsIndexElement extends HTMLElement { + /** + * Sets or retrieves the URL to which the form content is sent for processing. + */ + action: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + prompt: string; +} + +declare var HTMLIsIndexElement: { + prototype: HTMLIsIndexElement; + new(): HTMLIsIndexElement; +} + +interface HTMLLIElement extends HTMLElement { + type: string; + /** + * Sets or retrieves the value of a list item. + */ + value: number; +} + +declare var HTMLLIElement: { + prototype: HTMLLIElement; + new(): HTMLLIElement; +} + +interface HTMLLabelElement extends HTMLElement { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the object to which the given label object is assigned. + */ + htmlFor: string; +} + +declare var HTMLLabelElement: { + prototype: HTMLLabelElement; + new(): HTMLLabelElement; +} + +interface HTMLLegendElement extends HTMLElement { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + align: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; +} + +declare var HTMLLegendElement: { + prototype: HTMLLegendElement; + new(): HTMLLegendElement; +} + +interface HTMLLinkElement extends HTMLElement, LinkStyle { + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + disabled: boolean; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or retrieves the language code of the object. + */ + hreflang: string; + /** + * Sets or retrieves the media type. + */ + media: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rel: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rev: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Sets or retrieves the MIME type of the object. + */ + type: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLLinkElement: { + prototype: HTMLLinkElement; + new(): HTMLLinkElement; +} + +interface HTMLMapElement extends HTMLElement { + /** + * Retrieves a collection of the area objects defined for the given map object. + */ + areas: HTMLAreasCollection; + /** + * Sets or retrieves the name of the object. + */ + name: string; +} + +declare var HTMLMapElement: { + prototype: HTMLMapElement; + new(): HTMLMapElement; +} + +interface HTMLMarqueeElement extends HTMLElement { + behavior: string; + bgColor: any; + direction: string; + height: string; + hspace: number; + loop: number; + onbounce: (ev: Event) => any; + onfinish: (ev: Event) => any; + onstart: (ev: Event) => any; + scrollAmount: number; + scrollDelay: number; + trueSpeed: boolean; + vspace: number; + width: string; + start(): void; + stop(): void; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "bounce", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "finish", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "start", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMarqueeElement: { + prototype: HTMLMarqueeElement; + new(): HTMLMarqueeElement; +} + +interface HTMLMediaElement extends HTMLElement { + /** + * Returns an AudioTrackList object with the audio tracks for a given video element. + */ + audioTracks: AudioTrackList; + /** + * Gets or sets a value that indicates whether to start playing the media automatically. + */ + autoplay: boolean; + /** + * Gets a collection of buffered time ranges. + */ + buffered: TimeRanges; + /** + * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player). + */ + controls: boolean; + /** + * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement. + */ + currentSrc: string; + /** + * Gets or sets the current playback position, in seconds. + */ + currentTime: number; + defaultMuted: boolean; + /** + * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource. + */ + defaultPlaybackRate: number; + /** + * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming. + */ + duration: number; + /** + * Gets information about whether the playback has ended or not. + */ + ended: boolean; + /** + * Returns an object representing the current error state of the audio or video element. + */ + error: MediaError; + /** + * Gets or sets a flag to specify whether playback should restart after it completes. + */ + loop: boolean; + /** + * Specifies the purpose of the audio or video media, such as background audio or alerts. + */ + msAudioCategory: string; + /** + * Specifies the output device id that the audio will be sent to. + */ + msAudioDeviceType: string; + msGraphicsTrustStatus: MSGraphicsTrust; + /** + * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element. + */ + msKeys: MSMediaKeys; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; + /** + * Specifies whether or not to enable low-latency playback on the media element. + */ + msRealTime: boolean; + /** + * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted. + */ + muted: boolean; + /** + * Gets the current network activity for the element. + */ + networkState: number; + onmsneedkey: (ev: MSMediaKeyNeededEvent) => any; + /** + * Gets a flag that specifies whether playback is paused. + */ + paused: boolean; + /** + * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource. + */ + playbackRate: number; + /** + * Gets TimeRanges for the current media resource that has been played. + */ + played: TimeRanges; + /** + * Gets or sets the current playback position, in seconds. + */ + preload: string; + readyState: any; + /** + * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. + */ + seekable: TimeRanges; + /** + * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource. + */ + seeking: boolean; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + textTracks: TextTrackList; + videoTracks: VideoTrackList; + /** + * Gets or sets the volume level for audio portions of the media element. + */ + volume: number; + addTextTrack(kind: string, label?: string, language?: string): TextTrack; + /** + * Returns a string that specifies whether the client can play a given media resource type. + */ + canPlayType(type: string): string; + /** + * Fires immediately after the client loads the object. + */ + load(): void; + /** + * Clears all effects from the media pipeline. + */ + msClearEffects(): void; + msGetAsCastingSource(): any; + /** + * Inserts the specified audio effect into media pipeline. + */ + msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; + msSetMediaKeys(mediaKeys: MSMediaKeys): void; + /** + * Specifies the media protection manager for a given media pipeline. + */ + msSetMediaProtectionManager(mediaProtectionManager?: any): void; + /** + * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not. + */ + pause(): void; + /** + * Loads and starts playback of a media resource. + */ + play(): void; + HAVE_CURRENT_DATA: number; + HAVE_ENOUGH_DATA: number; + HAVE_FUTURE_DATA: number; + HAVE_METADATA: number; + HAVE_NOTHING: number; + NETWORK_EMPTY: number; + NETWORK_IDLE: number; + NETWORK_LOADING: number; + NETWORK_NO_SOURCE: number; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMediaElement: { + prototype: HTMLMediaElement; + new(): HTMLMediaElement; + HAVE_CURRENT_DATA: number; + HAVE_ENOUGH_DATA: number; + HAVE_FUTURE_DATA: number; + HAVE_METADATA: number; + HAVE_NOTHING: number; + NETWORK_EMPTY: number; + NETWORK_IDLE: number; + NETWORK_LOADING: number; + NETWORK_NO_SOURCE: number; +} + +interface HTMLMenuElement extends HTMLElement { + compact: boolean; + type: string; +} + +declare var HTMLMenuElement: { + prototype: HTMLMenuElement; + new(): HTMLMenuElement; +} + +interface HTMLMetaElement extends HTMLElement { + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Gets or sets meta-information to associate with httpEquiv or name. + */ + content: string; + /** + * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header. + */ + httpEquiv: string; + /** + * Sets or retrieves the value specified in the content attribute of the meta object. + */ + name: string; + /** + * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object. + */ + scheme: string; + /** + * Sets or retrieves the URL property that will be loaded after the specified time has elapsed. + */ + url: string; +} + +declare var HTMLMetaElement: { + prototype: HTMLMetaElement; + new(): HTMLMetaElement; +} + +interface HTMLModElement extends HTMLElement { + /** + * Sets or retrieves reference information about the object. + */ + cite: string; + /** + * Sets or retrieves the date and time of a modification to the object. + */ + dateTime: string; +} + +declare var HTMLModElement: { + prototype: HTMLModElement; + new(): HTMLModElement; +} + +interface HTMLNextIdElement extends HTMLElement { + n: string; +} + +declare var HTMLNextIdElement: { + prototype: HTMLNextIdElement; + new(): HTMLNextIdElement; +} + +interface HTMLOListElement extends HTMLElement { + compact: boolean; + /** + * The starting number. + */ + start: number; + type: string; +} + +declare var HTMLOListElement: { + prototype: HTMLOListElement; + new(): HTMLOListElement; +} + +interface HTMLObjectElement extends HTMLElement, GetSVGDocument { + /** + * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. + */ + BaseHref: string; + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Gets or sets the optional alternative HTML script to execute if the object fails to load. + */ + altHtml: string; + /** + * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. + */ + archive: string; + border: string; + /** + * Sets or retrieves the URL of the file containing the compiled Java class. + */ + code: string; + /** + * Sets or retrieves the URL of the component. + */ + codeBase: string; + /** + * Sets or retrieves the Internet media type for the code associated with the object. + */ + codeType: string; + /** + * Retrieves the document object of the page or frame. + */ + contentDocument: Document; + /** + * Sets or retrieves the URL that references the data of the object. + */ + data: string; + declare: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the height of the object. + */ + height: string; + hspace: number; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Retrieves the contained object. + */ + object: any; + readyState: number; + /** + * Sets or retrieves a message to be displayed while an object is loading. + */ + standby: string; + /** + * Sets or retrieves the MIME type of the object. + */ + type: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLObjectElement: { + prototype: HTMLObjectElement; + new(): HTMLObjectElement; +} + +interface HTMLOptGroupElement extends HTMLElement { + /** + * Sets or retrieves the status of an option. + */ + defaultSelected: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the ordinal position of an option in a list box. + */ + index: number; + /** + * Sets or retrieves a value that you can use to implement your own label functionality for the object. + */ + label: string; + /** + * Sets or retrieves whether the option in the list box is the default item. + */ + selected: boolean; + /** + * Sets or retrieves the text string specified by the option tag. + */ + text: string; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; +} + +declare var HTMLOptGroupElement: { + prototype: HTMLOptGroupElement; + new(): HTMLOptGroupElement; +} + +interface HTMLOptionElement extends HTMLElement { + /** + * Sets or retrieves the status of an option. + */ + defaultSelected: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the ordinal position of an option in a list box. + */ + index: number; + /** + * Sets or retrieves a value that you can use to implement your own label functionality for the object. + */ + label: string; + /** + * Sets or retrieves whether the option in the list box is the default item. + */ + selected: boolean; + /** + * Sets or retrieves the text string specified by the option tag. + */ + text: string; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; +} + +declare var HTMLOptionElement: { + prototype: HTMLOptionElement; + new(): HTMLOptionElement; + create(): HTMLOptionElement; +} + +interface HTMLParagraphElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + clear: string; +} + +declare var HTMLParagraphElement: { + prototype: HTMLParagraphElement; + new(): HTMLParagraphElement; +} + +interface HTMLParamElement extends HTMLElement { + /** + * Sets or retrieves the name of an input parameter for an element. + */ + name: string; + /** + * Sets or retrieves the content type of the resource designated by the value attribute. + */ + type: string; + /** + * Sets or retrieves the value of an input parameter for an element. + */ + value: string; + /** + * Sets or retrieves the data type of the value attribute. + */ + valueType: string; +} + +declare var HTMLParamElement: { + prototype: HTMLParamElement; + new(): HTMLParamElement; +} + +interface HTMLPhraseElement extends HTMLElement { + /** + * Sets or retrieves reference information about the object. + */ + cite: string; + /** + * Sets or retrieves the date and time of a modification to the object. + */ + dateTime: string; +} + +declare var HTMLPhraseElement: { + prototype: HTMLPhraseElement; + new(): HTMLPhraseElement; +} + +interface HTMLPreElement extends HTMLElement { + /** + * Indicates a citation by rendering text in italic type. + */ + cite: string; + clear: string; + /** + * Sets or gets a value that you can use to implement your own width functionality for the object. + */ + width: number; +} + +declare var HTMLPreElement: { + prototype: HTMLPreElement; + new(): HTMLPreElement; +} + +interface HTMLProgressElement extends HTMLElement { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Defines the maximum, or "done" value for a progress element. + */ + max: number; + /** + * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar). + */ + position: number; + /** + * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value. + */ + value: number; +} + +declare var HTMLProgressElement: { + prototype: HTMLProgressElement; + new(): HTMLProgressElement; +} + +interface HTMLQuoteElement extends HTMLElement { + /** + * Sets or retrieves reference information about the object. + */ + cite: string; + /** + * Sets or retrieves the date and time of a modification to the object. + */ + dateTime: string; +} + +declare var HTMLQuoteElement: { + prototype: HTMLQuoteElement; + new(): HTMLQuoteElement; +} + +interface HTMLScriptElement extends HTMLElement { + async: boolean; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Sets or retrieves the status of the script. + */ + defer: boolean; + /** + * Sets or retrieves the event for which the script is written. + */ + event: string; + /** + * Sets or retrieves the object that is bound to the event script. + */ + htmlFor: string; + /** + * Retrieves the URL to an external file that contains the source code or data. + */ + src: string; + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; + /** + * Sets or retrieves the MIME type for the associated scripting engine. + */ + type: string; +} + +declare var HTMLScriptElement: { + prototype: HTMLScriptElement; + new(): HTMLScriptElement; +} + +interface HTMLSelectElement extends HTMLElement { + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the number of objects in a collection. + */ + length: number; + /** + * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. + */ + multiple: boolean; + /** + * Sets or retrieves the name of the object. + */ + name: string; + options: HTMLSelectElement; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + /** + * Sets or retrieves the index of the selected option in a select object. + */ + selectedIndex: number; + /** + * Sets or retrieves the number of rows in the list box. + */ + size: number; /** * Retrieves the type of select control based on the value of the MULTIPLE attribute. */ @@ -3218,33 +6100,29 @@ interface HTMLSelectElement extends HTMLElement, MSHTMLCollectionExtensions, MSD * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. */ validationMessage: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; /** * Returns a ValidityState object that represents the validity states of an element. */ validity: ValidityState; /** - * When present, marks an element that can't be submitted without a value. + * Sets or retrieves the value which is returned to the server when the form control is submitted. */ - required: boolean; + value: string; /** * Returns whether an element will successfully validate based on forms validation rules and constraints. */ willValidate: boolean; - /** - * Removes an element from the collection. - * @param index Number that specifies the zero-based index of the element to remove from the collection. - */ - remove(index?: number): void; /** * Adds an element to the areas, controlRange, or options collection. * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection. * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection. */ - add(element: HTMLElement, before?: any): void; + add(element: HTMLElement, before?: HTMLElement): void; + add(element: HTMLElement, before?: number): void; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; /** * Retrieves a select object or an object from an options collection. * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. @@ -3256,373 +6134,68 @@ interface HTMLSelectElement extends HTMLElement, MSHTMLCollectionExtensions, MSD * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made. */ namedItem(name: string): any; - [name: string]: any; /** - * Returns whether a form will validate when it is submitted, without having to submit it. + * Removes an element from the collection. + * @param index Number that specifies the zero-based index of the element to remove from the collection. */ - checkValidity(): boolean; + remove(index?: number): void; /** * Sets a custom error message that is displayed when a form is submitted. * @param error Sets a custom error message that is displayed when a form is submitted. */ setCustomValidity(error: string): void; + [name: string]: any; } + declare var HTMLSelectElement: { prototype: HTMLSelectElement; new(): HTMLSelectElement; } -interface TextRange { - boundingLeft: number; - htmlText: string; - offsetLeft: number; - boundingWidth: number; - boundingHeight: number; - boundingTop: number; - text: string; - offsetTop: number; - moveToPoint(x: number, y: number): void; - queryCommandValue(cmdID: string): any; - getBookmark(): string; - move(unit: string, count?: number): number; - queryCommandIndeterm(cmdID: string): boolean; - scrollIntoView(fStart?: boolean): void; - findText(string: string, count?: number, flags?: number): boolean; - execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; - getBoundingClientRect(): ClientRect; - moveToBookmark(bookmark: string): boolean; - isEqual(range: TextRange): boolean; - duplicate(): TextRange; - collapse(start?: boolean): void; - queryCommandText(cmdID: string): string; - select(): void; - pasteHTML(html: string): void; - inRange(range: TextRange): boolean; - moveEnd(unit: string, count?: number): number; - getClientRects(): ClientRectList; - moveStart(unit: string, count?: number): number; - parentElement(): Element; - queryCommandState(cmdID: string): boolean; - compareEndPoints(how: string, sourceRange: TextRange): number; - execCommandShowHelp(cmdID: string): boolean; - moveToElementText(element: Element): void; - expand(Unit: string): boolean; - queryCommandSupported(cmdID: string): boolean; - setEndPoint(how: string, SourceRange: TextRange): void; - queryCommandEnabled(cmdID: string): boolean; -} -declare var TextRange: { - prototype: TextRange; - new(): TextRange; -} - -interface SVGTests { - requiredFeatures: SVGStringList; - requiredExtensions: SVGStringList; - systemLanguage: SVGStringList; - hasExtension(extension: string): boolean; -} - -interface HTMLBlockElement extends HTMLElement, DOML2DeprecatedTextFlowControl { +interface HTMLSourceElement extends HTMLElement { /** - * Sets or retrieves the width of the object. - */ - width: number; + * Gets or sets the intended media type of the media source. + */ + media: string; + msKeySystem: string; /** - * Sets or retrieves reference information about the object. + * The address or URL of the a media resource that is to be considered. */ - cite: string; -} -declare var HTMLBlockElement: { - prototype: HTMLBlockElement; - new(): HTMLBlockElement; -} - -interface CSSStyleSheet extends StyleSheet { - owningElement: Element; - imports: StyleSheetList; - isAlternate: boolean; - rules: MSCSSRuleList; - isPrefAlternate: boolean; - readOnly: boolean; - cssText: string; - ownerRule: CSSRule; - href: string; - cssRules: CSSRuleList; - id: string; - pages: StyleSheetPageList; - addImport(bstrURL: string, lIndex?: number): number; - addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; - insertRule(rule: string, index?: number): number; - removeRule(lIndex: number): void; - deleteRule(index?: number): void; - addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number; - removeImport(lIndex: number): void; -} -declare var CSSStyleSheet: { - prototype: CSSStyleSheet; - new(): CSSStyleSheet; -} - -interface MSSelection { - type: string; - typeDetail: string; - createRange(): TextRange; - clear(): void; - createRangeCollection(): TextRangeCollection; - empty(): void; -} -declare var MSSelection: { - prototype: MSSelection; - new(): MSSelection; -} - -interface HTMLMetaElement extends HTMLElement { + src: string; /** - * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header. - */ - httpEquiv: string; - /** - * Sets or retrieves the value specified in the content attribute of the meta object. - */ - name: string; - /** - * Gets or sets meta-information to associate with httpEquiv or name. - */ - content: string; - /** - * Sets or retrieves the URL property that will be loaded after the specified time has elapsed. - */ - url: string; - /** - * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object. - */ - scheme: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; -} -declare var HTMLMetaElement: { - prototype: HTMLMetaElement; - new(): HTMLMetaElement; -} - -interface SVGPatternElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGTests, SVGFitToViewBox, SVGExternalResourcesRequired, SVGURIReference { - patternUnits: SVGAnimatedEnumeration; - y: SVGAnimatedLength; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - patternContentUnits: SVGAnimatedEnumeration; - patternTransform: SVGAnimatedTransformList; - height: SVGAnimatedLength; -} -declare var SVGPatternElement: { - prototype: SVGPatternElement; - new(): SVGPatternElement; -} - -interface SVGAnimatedAngle { - animVal: SVGAngle; - baseVal: SVGAngle; -} -declare var SVGAnimatedAngle: { - prototype: SVGAnimatedAngle; - new(): SVGAnimatedAngle; -} - -interface Selection { - isCollapsed: boolean; - anchorNode: Node; - focusNode: Node; - anchorOffset: number; - focusOffset: number; - rangeCount: number; - addRange(range: Range): void; - collapseToEnd(): void; - toString(): string; - selectAllChildren(parentNode: Node): void; - getRangeAt(index: number): Range; - collapse(parentNode: Node, offset: number): void; - removeAllRanges(): void; - collapseToStart(): void; - deleteFromDocument(): void; - removeRange(range: Range): void; -} -declare var Selection: { - prototype: Selection; - new(): Selection; -} - -interface SVGScriptElement extends SVGElement, SVGExternalResourcesRequired, SVGURIReference { + * Gets or sets the MIME type of a media resource. + */ type: string; } -declare var SVGScriptElement: { - prototype: SVGScriptElement; - new(): SVGScriptElement; + +declare var HTMLSourceElement: { + prototype: HTMLSourceElement; + new(): HTMLSourceElement; } -interface HTMLDDElement extends HTMLElement { - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} -declare var HTMLDDElement: { - prototype: HTMLDDElement; - new(): HTMLDDElement; +interface HTMLSpanElement extends HTMLElement { } -interface MSDataBindingRecordSetReadonlyExtensions { - recordset: any; - namedRecordset(dataMember: string, hierarchy?: any): any; +declare var HTMLSpanElement: { + prototype: HTMLSpanElement; + new(): HTMLSpanElement; } -interface CSSStyleRule extends CSSRule { - selectorText: string; - style: MSStyleCSSProperties; - readOnly: boolean; -} -declare var CSSStyleRule: { - prototype: CSSStyleRule; - new(): CSSStyleRule; -} - -interface NodeIterator { - whatToShow: number; - filter: NodeFilter; - root: Node; - expandEntityReferences: boolean; - nextNode(): Node; - detach(): void; - previousNode(): Node; -} -declare var NodeIterator: { - prototype: NodeIterator; - new(): NodeIterator; -} - -interface SVGViewElement extends SVGElement, SVGZoomAndPan, SVGFitToViewBox, SVGExternalResourcesRequired { - viewTarget: SVGStringList; -} -declare var SVGViewElement: { - prototype: SVGViewElement; - new(): SVGViewElement; -} - -interface HTMLLinkElement extends HTMLElement, LinkStyle { - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rel: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; +interface HTMLStyleElement extends HTMLElement, LinkStyle { /** * Sets or retrieves the media type. */ media: string; /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rev: string; - /** - * Sets or retrieves the MIME type of the object. + * Retrieves the CSS language in which the style sheet is written. */ type: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the language code of the object. - */ - hreflang: string; -} -declare var HTMLLinkElement: { - prototype: HTMLLinkElement; - new(): HTMLLinkElement; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface SVGLocatable { - farthestViewportElement: SVGElement; - nearestViewportElement: SVGElement; - getBBox(): SVGRect; - getTransformToElement(element: SVGElement): SVGMatrix; - getCTM(): SVGMatrix; - getScreenCTM(): SVGMatrix; -} - -interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { - /** - * Sets or retrieves the current typeface family. - */ - face: string; -} -declare var HTMLFontElement: { - prototype: HTMLFontElement; - new(): HTMLFontElement; -} - -interface SVGTitleElement extends SVGElement, SVGStylable, SVGLangSpace { -} -declare var SVGTitleElement: { - prototype: SVGTitleElement; - new(): SVGTitleElement; -} - -interface ControlRangeCollection { - length: number; - queryCommandValue(cmdID: string): any; - remove(index: number): void; - add(item: Element): void; - queryCommandIndeterm(cmdID: string): boolean; - scrollIntoView(varargStart?: any): void; - item(index: number): Element; - [index: number]: Element; - execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; - addElement(item: Element): void; - queryCommandState(cmdID: string): boolean; - queryCommandSupported(cmdID: string): boolean; - queryCommandEnabled(cmdID: string): boolean; - queryCommandText(cmdID: string): string; - select(): void; -} -declare var ControlRangeCollection: { - prototype: ControlRangeCollection; - new(): ControlRangeCollection; -} - -interface MSNamespaceInfo extends MSEventAttachmentTarget { - urn: string; - onreadystatechange: (ev: Event) => any; - name: string; - readyState: string; - doImport(implementationUrl: string): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var MSNamespaceInfo: { - prototype: MSNamespaceInfo; - new(): MSNamespaceInfo; -} - -interface WindowSessionStorage { - sessionStorage: Storage; -} - -interface SVGAnimatedTransformList { - animVal: SVGTransformList; - baseVal: SVGTransformList; -} -declare var SVGAnimatedTransformList: { - prototype: SVGAnimatedTransformList; - new(): SVGAnimatedTransformList; +declare var HTMLStyleElement: { + prototype: HTMLStyleElement; + new(): HTMLStyleElement; } interface HTMLTableCaptionElement extends HTMLElement { @@ -3635,637 +6208,240 @@ interface HTMLTableCaptionElement extends HTMLElement { */ vAlign: string; } + declare var HTMLTableCaptionElement: { prototype: HTMLTableCaptionElement; new(): HTMLTableCaptionElement; } -interface HTMLOptionElement extends HTMLElement, MSDataBindingExtensions { +interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment { /** - * Sets or retrieves the ordinal position of an option in a list box. + * Sets or retrieves abbreviated text for the object. */ - index: number; - /** - * Sets or retrieves the status of an option. - */ - defaultSelected: boolean; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - /** - * Sets or retrieves the text string specified by the option tag. - */ - text: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves a value that you can use to implement your own label functionality for the object. - */ - label: string; - /** - * Sets or retrieves whether the option in the list box is the default item. - */ - selected: boolean; -} -declare var HTMLOptionElement: { - prototype: HTMLOptionElement; - new(): HTMLOptionElement; - create(): HTMLOptionElement; -} - -interface HTMLMapElement extends HTMLElement { - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Retrieves a collection of the area objects defined for the given map object. - */ - areas: HTMLAreasCollection; -} -declare var HTMLMapElement: { - prototype: HTMLMapElement; - new(): HTMLMapElement; -} - -interface HTMLMenuElement extends HTMLElement, DOML2DeprecatedListSpaceReduction { - type: string; -} -declare var HTMLMenuElement: { - prototype: HTMLMenuElement; - new(): HTMLMenuElement; -} - -interface MouseWheelEvent extends MouseEvent { - wheelDelta: number; - initMouseWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, wheelDeltaArg: number): void; -} -declare var MouseWheelEvent: { - prototype: MouseWheelEvent; - new(): MouseWheelEvent; -} - -interface SVGFitToViewBox { - viewBox: SVGAnimatedRect; - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; -} - -interface SVGPointList { - numberOfItems: number; - replaceItem(newItem: SVGPoint, index: number): SVGPoint; - getItem(index: number): SVGPoint; - clear(): void; - appendItem(newItem: SVGPoint): SVGPoint; - initialize(newItem: SVGPoint): SVGPoint; - removeItem(index: number): SVGPoint; - insertItemBefore(newItem: SVGPoint, index: number): SVGPoint; -} -declare var SVGPointList: { - prototype: SVGPointList; - new(): SVGPointList; -} - -interface SVGAnimatedLengthList { - animVal: SVGLengthList; - baseVal: SVGLengthList; -} -declare var SVGAnimatedLengthList: { - prototype: SVGAnimatedLengthList; - new(): SVGAnimatedLengthList; -} - -interface SVGAnimatedPreserveAspectRatio { - animVal: SVGPreserveAspectRatio; - baseVal: SVGPreserveAspectRatio; -} -declare var SVGAnimatedPreserveAspectRatio: { - prototype: SVGAnimatedPreserveAspectRatio; - new(): SVGAnimatedPreserveAspectRatio; -} - -interface MSSiteModeEvent extends Event { - buttonID: number; - actionURL: string; -} -declare var MSSiteModeEvent: { - prototype: MSSiteModeEvent; - new(): MSSiteModeEvent; -} - -interface DOML2DeprecatedTextFlowControl { - clear: string; -} - -interface StyleSheetPageList { - length: number; - item(index: number): CSSPageRule; - [index: number]: CSSPageRule; -} -declare var StyleSheetPageList: { - prototype: StyleSheetPageList; - new(): StyleSheetPageList; -} - -interface MSCSSProperties extends CSSStyleDeclaration { - scrollbarShadowColor: string; - scrollbarHighlightColor: string; - layoutGridChar: string; - layoutGridType: string; - textAutospace: string; - textKashidaSpace: string; - writingMode: string; - scrollbarFaceColor: string; - backgroundPositionY: string; - lineBreak: string; - imeMode: string; - msBlockProgression: string; - layoutGridLine: string; - scrollbarBaseColor: string; - layoutGrid: string; - layoutFlow: string; - textKashida: string; - filter: string; - zoom: string; - scrollbarArrowColor: string; - behavior: string; - backgroundPositionX: string; - accelerator: string; - layoutGridMode: string; - textJustifyTrim: string; - scrollbar3dLightColor: string; - msInterpolationMode: string; - scrollbarTrackColor: string; - scrollbarDarkShadowColor: string; - styleFloat: string; - getAttribute(attributeName: string, flags?: number): any; - setAttribute(attributeName: string, AttributeValue: any, flags?: number): void; - removeAttribute(attributeName: string, flags?: number): boolean; -} -declare var MSCSSProperties: { - prototype: MSCSSProperties; - new(): MSCSSProperties; -} - -interface SVGExternalResourcesRequired { - externalResourcesRequired: SVGAnimatedBoolean; -} - -interface HTMLImageElement extends HTMLElement, MSImageResourceExtensions, MSDataBindingExtensions, MSResourceMetadata { - /** - * Sets or retrieves the width of the object. - */ - width: number; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * The original height of the image resource before sizing. - */ - naturalHeight: number; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; + abbr: string; /** * Sets or retrieves how the object is aligned with adjacent text. */ align: string; /** - * The address or URL of the a media resource that is to be considered. + * Sets or retrieves a comma-delimited list of conceptual categories associated with the object. */ - src: string; + axis: string; + bgColor: any; /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + * Retrieves the position of the object in the cells collection of a row. */ - useMap: string; + cellIndex: number; /** - * The original width of the image resource before sizing. + * Sets or retrieves the number columns in the table that the object should span. */ - naturalWidth: number; + colSpan: number; /** - * Sets or retrieves the name of the object. + * Sets or retrieves a list of header cells that provide information for the object. */ - name: string; - /** - * Sets or retrieves the height of the object. - */ - height: number; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - hspace: number; - /** - * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object. - */ - longDesc: string; - /** - * Contains the hypertext reference (HREF) of the URL. - */ - href: string; - /** - * Sets or retrieves whether the image is a server-side image map. - */ - isMap: boolean; - /** - * Retrieves whether the object is fully loaded. - */ - complete: boolean; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; - crossOrigin: string; - msPlayToPreferredSourceUri: string; -} -declare var HTMLImageElement: { - prototype: HTMLImageElement; - new(): HTMLImageElement; - create(): HTMLImageElement; -} - -interface HTMLAreaElement extends HTMLElement { - /** - * Sets or retrieves the protocol portion of a URL. - */ - protocol: string; - /** - * Sets or retrieves the substring of the href property that follows the question mark. - */ - search: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves the coordinates of the object. - */ - coords: string; - /** - * Sets or retrieves the host name part of the location or URL. - */ - hostname: string; - /** - * Sets or retrieves the port number associated with a URL. - */ - port: string; - /** - * Sets or retrieves the file name or path specified by the object. - */ - pathname: string; - /** - * Sets or retrieves the hostname and port number of the location or URL. - */ - host: string; - /** - * Sets or retrieves the subsection of the href property that follows the number sign (#). - */ - hash: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or gets whether clicks in this region cause action. - */ - noHref: boolean; - /** - * Sets or retrieves the shape of the object. - */ - shape: string; - /** - * Returns a string representation of an object. - */ - toString(): string; -} -declare var HTMLAreaElement: { - prototype: HTMLAreaElement; - new(): HTMLAreaElement; -} - -interface EventTarget { - removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; - dispatchEvent(evt: Event): boolean; -} - -interface SVGAngle { - valueAsString: string; - valueInSpecifiedUnits: number; - value: number; - unitType: number; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - convertToSpecifiedUnits(unitType: number): void; - SVG_ANGLETYPE_RAD: number; - SVG_ANGLETYPE_UNKNOWN: number; - SVG_ANGLETYPE_UNSPECIFIED: number; - SVG_ANGLETYPE_DEG: number; - SVG_ANGLETYPE_GRAD: number; -} -declare var SVGAngle: { - prototype: SVGAngle; - new(): SVGAngle; - SVG_ANGLETYPE_RAD: number; - SVG_ANGLETYPE_UNKNOWN: number; - SVG_ANGLETYPE_UNSPECIFIED: number; - SVG_ANGLETYPE_DEG: number; - SVG_ANGLETYPE_GRAD: number; -} - -interface HTMLButtonElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the default or selected value of the control. - */ - value: string; - status: any; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Gets the classification and default behavior of the button. - */ - type: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Overrides the target attribute on a form element. - */ - formTarget: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Overrides the action attribute (where the data on a form is sent) on the parent form element. - */ - formAction: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. - */ - formNoValidate: string; - /** - * Used to override the encoding (formEnctype attribute) specified on the form element. - */ - formEnctype: string; - /** - * Overrides the submit method attribute previously specified on a form element. - */ - formMethod: string; - /** - * Creates a TextRange object for the element. - */ - createTextRange(): TextRange; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLButtonElement: { - prototype: HTMLButtonElement; - new(): HTMLButtonElement; -} - -interface HTMLSourceElement extends HTMLElement { - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - /** - * Gets or sets the intended media type of the media source. - */ - media: string; - /** - * Gets or sets the MIME type of a media resource. - */ - type: string; - msKeySystem: string; -} -declare var HTMLSourceElement: { - prototype: HTMLSourceElement; - new(): HTMLSourceElement; -} - -interface CanvasGradient { - addColorStop(offset: number, color: string): void; -} -declare var CanvasGradient: { - prototype: CanvasGradient; - new(): CanvasGradient; -} - -interface KeyboardEvent extends UIEvent { - location: number; - keyCode: number; - shiftKey: boolean; - which: number; - locale: string; - key: string; - altKey: boolean; - metaKey: boolean; - char: string; - ctrlKey: boolean; - repeat: boolean; - charCode: number; - getModifierState(keyArg: string): boolean; - initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; - DOM_KEY_LOCATION_RIGHT: number; - DOM_KEY_LOCATION_STANDARD: number; - DOM_KEY_LOCATION_LEFT: number; - DOM_KEY_LOCATION_NUMPAD: number; - DOM_KEY_LOCATION_JOYSTICK: number; - DOM_KEY_LOCATION_MOBILE: number; -} -declare var KeyboardEvent: { - prototype: KeyboardEvent; - new(): KeyboardEvent; - DOM_KEY_LOCATION_RIGHT: number; - DOM_KEY_LOCATION_STANDARD: number; - DOM_KEY_LOCATION_LEFT: number; - DOM_KEY_LOCATION_NUMPAD: number; - DOM_KEY_LOCATION_JOYSTICK: number; - DOM_KEY_LOCATION_MOBILE: number; -} - -interface MessageEvent extends Event { - source: Window; - origin: string; - data: any; - ports: any; - initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void; -} -declare var MessageEvent: { - prototype: MessageEvent; - new(): MessageEvent; -} - -interface SVGElement extends Element { - onmouseover: (ev: MouseEvent) => any; - viewportElement: SVGElement; - onmousemove: (ev: MouseEvent) => any; - onmouseout: (ev: MouseEvent) => any; - ondblclick: (ev: MouseEvent) => any; - onfocusout: (ev: FocusEvent) => any; - onfocusin: (ev: FocusEvent) => any; - xmlbase: string; - onmousedown: (ev: MouseEvent) => any; - onload: (ev: Event) => any; - onmouseup: (ev: MouseEvent) => any; - onclick: (ev: MouseEvent) => any; - ownerSVGElement: SVGSVGElement; - id: string; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var SVGElement: { - prototype: SVGElement; - new(): SVGElement; -} - -interface HTMLScriptElement extends HTMLElement { - /** - * Sets or retrieves the status of the script. - */ - defer: boolean; - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; - /** - * Retrieves the URL to an external file that contains the source code or data. - */ - src: string; - /** - * Sets or retrieves the object that is bound to the event script. - */ - htmlFor: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the MIME type for the associated scripting engine. - */ - type: string; - /** - * Sets or retrieves the event for which the script is written. - */ - event: string; - async: boolean; -} -declare var HTMLScriptElement: { - prototype: HTMLScriptElement; - new(): HTMLScriptElement; -} - -interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundColorStyle { - /** - * Retrieves the position of the object in the rows collection for the table. - */ - rowIndex: number; - /** - * Retrieves a collection of all cells in the table row. - */ - cells: HTMLCollection; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorLight: any; - /** - * Retrieves the position of the object in the collection. - */ - sectionRowIndex: number; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; + headers: string; /** * Sets or retrieves the height of the object. */ height: any; /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. + * Sets or retrieves whether the browser automatically performs wordwrap. */ - borderColorDark: any; + noWrap: boolean; + /** + * Sets or retrieves how many rows in a table the cell should span. + */ + rowSpan: number; + /** + * Sets or retrieves the group of cells in a table to which the object's information applies. + */ + scope: string; + /** + * Sets or retrieves the width of the object. + */ + width: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableCellElement: { + prototype: HTMLTableCellElement; + new(): HTMLTableCellElement; +} + +interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment { + /** + * Sets or retrieves the alignment of the object relative to the display or table. + */ + align: string; + /** + * Sets or retrieves the number of columns in the group. + */ + span: number; + /** + * Sets or retrieves the width of the object. + */ + width: any; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableColElement: { + prototype: HTMLTableColElement; + new(): HTMLTableColElement; +} + +interface HTMLTableDataCellElement extends HTMLTableCellElement { +} + +declare var HTMLTableDataCellElement: { + prototype: HTMLTableDataCellElement; + new(): HTMLTableDataCellElement; +} + +interface HTMLTableElement extends HTMLElement { + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; + bgColor: any; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + border: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Retrieves the caption object of a table. + */ + caption: HTMLTableCaptionElement; + /** + * Sets or retrieves the amount of space between the border of the cell and the content of the cell. + */ + cellPadding: string; + /** + * Sets or retrieves the amount of space between cells in a table. + */ + cellSpacing: string; + /** + * Sets or retrieves the number of columns in the table. + */ + cols: number; + /** + * Sets or retrieves the way the border frame around the table is displayed. + */ + frame: string; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Sets or retrieves the number of horizontal rows contained in the object. + */ + rows: HTMLCollection; + /** + * Sets or retrieves which dividing lines (inner borders) are displayed. + */ + rules: string; + /** + * Sets or retrieves a description and/or structure of the object. + */ + summary: string; + /** + * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order. + */ + tBodies: HTMLCollection; + /** + * Retrieves the tFoot object of the table. + */ + tFoot: HTMLTableSectionElement; + /** + * Retrieves the tHead object of the table. + */ + tHead: HTMLTableSectionElement; + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Creates an empty caption element in the table. + */ + createCaption(): HTMLElement; + /** + * Creates an empty tBody element in the table. + */ + createTBody(): HTMLElement; + /** + * Creates an empty tFoot element in the table. + */ + createTFoot(): HTMLElement; + /** + * Returns the tHead element object if successful, or null otherwise. + */ + createTHead(): HTMLElement; + /** + * Deletes the caption element and its contents from the table. + */ + deleteCaption(): void; + /** + * Removes the specified row (tr) from the element and from the rows collection. + * @param index Number that specifies the zero-based position in the rows collection of the row to remove. + */ + deleteRow(index?: number): void; + /** + * Deletes the tFoot element and its contents from the table. + */ + deleteTFoot(): void; + /** + * Deletes the tHead element and its contents from the table. + */ + deleteTHead(): void; + /** + * Creates a new row (tr) in the table, and adds the row to the rows collection. + * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. + */ + insertRow(index?: number): HTMLElement; +} + +declare var HTMLTableElement: { + prototype: HTMLTableElement; + new(): HTMLTableElement; +} + +interface HTMLTableHeaderCellElement extends HTMLTableCellElement { + /** + * Sets or retrieves the group of cells in a table to which the object's information applies. + */ + scope: string; +} + +declare var HTMLTableHeaderCellElement: { + prototype: HTMLTableHeaderCellElement; + new(): HTMLTableHeaderCellElement; +} + +interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + bgColor: any; + /** + * Retrieves a collection of all cells in the table row. + */ + cells: HTMLCollection; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Retrieves the position of the object in the rows collection for the table. + */ + rowIndex: number; + /** + * Retrieves the position of the object in the collection. + */ + sectionRowIndex: number; /** * Removes the specified cell from the table row, as well as from the cells collection. * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted. @@ -4276,1511 +6452,15 @@ interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment, DOML2Depr * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection. */ insertCell(index?: number): HTMLElement; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var HTMLTableRowElement: { prototype: HTMLTableRowElement; new(): HTMLTableRowElement; } -interface CanvasRenderingContext2D { - miterLimit: number; - font: string; - globalCompositeOperation: string; - msFillRule: string; - lineCap: string; - msImageSmoothingEnabled: boolean; - lineDashOffset: number; - shadowColor: string; - lineJoin: string; - shadowOffsetX: number; - lineWidth: number; - canvas: HTMLCanvasElement; - strokeStyle: any; - globalAlpha: number; - shadowOffsetY: number; - fillStyle: any; - shadowBlur: number; - textAlign: string; - textBaseline: string; - restore(): void; - setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - save(): void; - arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; - measureText(text: string): TextMetrics; - isPointInPath(x: number, y: number, fillRule?: string): boolean; - quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; - putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void; - rotate(angle: number): void; - fillText(text: string, x: number, y: number, maxWidth?: number): void; - translate(x: number, y: number): void; - scale(x: number, y: number): void; - createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; - lineTo(x: number, y: number): void; - getLineDash(): number[]; - fill(fillRule?: string): void; - createImageData(imageDataOrSw: any, sh?: number): ImageData; - createPattern(image: HTMLElement, repetition: string): CanvasPattern; - closePath(): void; - rect(x: number, y: number, w: number, h: number): void; - clip(fillRule?: string): void; - clearRect(x: number, y: number, w: number, h: number): void; - moveTo(x: number, y: number): void; - getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; - fillRect(x: number, y: number, w: number, h: number): void; - bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; - drawImage(image: HTMLElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; - transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - stroke(): void; - strokeRect(x: number, y: number, w: number, h: number): void; - setLineDash(segments: number[]): void; - strokeText(text: string, x: number, y: number, maxWidth?: number): void; - beginPath(): void; - arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; - createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; -} -declare var CanvasRenderingContext2D: { - prototype: CanvasRenderingContext2D; - new(): CanvasRenderingContext2D; -} - -interface MSCSSRuleList { - length: number; - item(index?: number): CSSStyleRule; - [index: number]: CSSStyleRule; -} -declare var MSCSSRuleList: { - prototype: MSCSSRuleList; - new(): MSCSSRuleList; -} - -interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg { - x: number; -} -declare var SVGPathSegLinetoHorizontalAbs: { - prototype: SVGPathSegLinetoHorizontalAbs; - new(): SVGPathSegLinetoHorizontalAbs; -} - -interface SVGPathSegArcAbs extends SVGPathSeg { - y: number; - sweepFlag: boolean; - r2: number; - x: number; - angle: number; - r1: number; - largeArcFlag: boolean; -} -declare var SVGPathSegArcAbs: { - prototype: SVGPathSegArcAbs; - new(): SVGPathSegArcAbs; -} - -interface SVGTransformList { - numberOfItems: number; - getItem(index: number): SVGTransform; - consolidate(): SVGTransform; - clear(): void; - appendItem(newItem: SVGTransform): SVGTransform; - initialize(newItem: SVGTransform): SVGTransform; - removeItem(index: number): SVGTransform; - insertItemBefore(newItem: SVGTransform, index: number): SVGTransform; - replaceItem(newItem: SVGTransform, index: number): SVGTransform; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; -} -declare var SVGTransformList: { - prototype: SVGTransformList; - new(): SVGTransformList; -} - -interface HTMLHtmlElement extends HTMLElement { - /** - * Sets or retrieves the DTD version that governs the current document. - */ - version: string; -} -declare var HTMLHtmlElement: { - prototype: HTMLHtmlElement; - new(): HTMLHtmlElement; -} - -interface SVGPathSegClosePath extends SVGPathSeg { -} -declare var SVGPathSegClosePath: { - prototype: SVGPathSegClosePath; - new(): SVGPathSegClosePath; -} - -interface HTMLFrameElement extends HTMLElement, GetSVGDocument, MSDataBindingExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: any; - /** - * Sets or retrieves whether the frame can be scrolled. - */ - scrolling: string; - /** - * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. - */ - marginHeight: string; - /** - * Sets or retrieves the left and right margin widths before displaying the text in a frame. - */ - marginWidth: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves whether the user can resize the frame. - */ - noResize: boolean; - /** - * Retrieves the object of the specified. - */ - contentWindow: Window; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the frame name. - */ - name: string; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Retrieves the document object of the page or frame. - */ - contentDocument: Document; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Sets or retrieves a URI to a long description of the object. - */ - longDesc: string; - /** - * Raised when the object has been completely received from the server. - */ - onload: (ev: Event) => any; - /** - * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. - */ - security: any; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLFrameElement: { - prototype: HTMLFrameElement; - new(): HTMLFrameElement; -} - -interface SVGAnimatedLength { - animVal: SVGLength; - baseVal: SVGLength; -} -declare var SVGAnimatedLength: { - prototype: SVGAnimatedLength; - new(): SVGAnimatedLength; -} - -interface SVGAnimatedPoints { - points: SVGPointList; - animatedPoints: SVGPointList; -} - -interface SVGDefsElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGDefsElement: { - prototype: SVGDefsElement; - new(): SVGDefsElement; -} - -interface HTMLQuoteElement extends HTMLElement { - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; - /** - * Sets or retrieves reference information about the object. - */ - cite: string; -} -declare var HTMLQuoteElement: { - prototype: HTMLQuoteElement; - new(): HTMLQuoteElement; -} - -interface CSSMediaRule extends CSSRule { - media: MediaList; - cssRules: CSSRuleList; - insertRule(rule: string, index?: number): number; - deleteRule(index?: number): void; -} -declare var CSSMediaRule: { - prototype: CSSMediaRule; - new(): CSSMediaRule; -} - -interface WindowModal { - dialogArguments: any; - returnValue: any; -} - -interface XMLHttpRequest extends EventTarget { - responseBody: any; - status: number; - readyState: number; - responseText: string; - responseXML: any; - ontimeout: (ev: Event) => any; - statusText: string; - onreadystatechange: (ev: Event) => any; - timeout: number; - onload: (ev: Event) => any; - response: any; - withCredentials: boolean; - onprogress: (ev: ProgressEvent) => any; - onabort: (ev: UIEvent) => any; - responseType: string; - onloadend: (ev: ProgressEvent) => any; - upload: XMLHttpRequestEventTarget; - onerror: (ev: ErrorEvent) => any; - onloadstart: (ev: Event) => any; - msCaching: string; - open(method: string, url: string, async?: boolean, user?: string, password?: string): void; - send(data?: any): void; - abort(): void; - getAllResponseHeaders(): string; - setRequestHeader(header: string, value: string): void; - getResponseHeader(header: string): string; - msCachingEnabled(): boolean; - overrideMimeType(mime: string): void; - LOADING: number; - DONE: number; - UNSENT: number; - OPENED: number; - HEADERS_RECEIVED: number; - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var XMLHttpRequest: { - prototype: XMLHttpRequest; - new(): XMLHttpRequest; - LOADING: number; - DONE: number; - UNSENT: number; - OPENED: number; - HEADERS_RECEIVED: number; - create(): XMLHttpRequest; -} - -interface HTMLTableHeaderCellElement extends HTMLTableCellElement { - /** - * Sets or retrieves the group of cells in a table to which the object's information applies. - */ - scope: string; -} -declare var HTMLTableHeaderCellElement: { - prototype: HTMLTableHeaderCellElement; - new(): HTMLTableHeaderCellElement; -} - -interface HTMLDListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction { -} -declare var HTMLDListElement: { - prototype: HTMLDListElement; - new(): HTMLDListElement; -} - -interface MSDataBindingExtensions { - dataSrc: string; - dataFormatAs: string; - dataFld: string; -} - -interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg { - x: number; -} -declare var SVGPathSegLinetoHorizontalRel: { - prototype: SVGPathSegLinetoHorizontalRel; - new(): SVGPathSegLinetoHorizontalRel; -} - -interface SVGEllipseElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - ry: SVGAnimatedLength; - cx: SVGAnimatedLength; - rx: SVGAnimatedLength; - cy: SVGAnimatedLength; -} -declare var SVGEllipseElement: { - prototype: SVGEllipseElement; - new(): SVGEllipseElement; -} - -interface SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { - target: SVGAnimatedString; -} -declare var SVGAElement: { - prototype: SVGAElement; - new(): SVGAElement; -} - -interface SVGStylable { - className: SVGAnimatedString; - style: CSSStyleDeclaration; -} - -interface SVGTransformable extends SVGLocatable { - transform: SVGAnimatedTransformList; -} - -interface HTMLFrameSetElement extends HTMLElement { - ononline: (ev: Event) => any; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the frame heights of the object. - */ - rows: string; - /** - * Sets or retrieves the frame widths of the object. - */ - cols: string; - /** - * Fires when the object loses the input focus. - */ - onblur: (ev: FocusEvent) => any; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Fires when the object receives focus. - */ - onfocus: (ev: FocusEvent) => any; - onmessage: (ev: MessageEvent) => any; - onerror: (ev: ErrorEvent) => any; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - onresize: (ev: UIEvent) => any; - name: string; - onafterprint: (ev: Event) => any; - onbeforeprint: (ev: Event) => any; - onoffline: (ev: Event) => any; - border: string; - onunload: (ev: Event) => any; - onhashchange: (ev: Event) => any; - onload: (ev: Event) => any; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - onstorage: (ev: StorageEvent) => any; - onpageshow: (ev: PageTransitionEvent) => any; - onpagehide: (ev: PageTransitionEvent) => any; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLFrameSetElement: { - prototype: HTMLFrameSetElement; - new(): HTMLFrameSetElement; -} - -interface Screen extends EventTarget { - width: number; - deviceXDPI: number; - fontSmoothingEnabled: boolean; - bufferDepth: number; - logicalXDPI: number; - systemXDPI: number; - availHeight: number; - height: number; - logicalYDPI: number; - systemYDPI: number; - updateInterval: number; - colorDepth: number; - availWidth: number; - deviceYDPI: number; - pixelDepth: number; - msOrientation: string; - onmsorientationchange: (ev: any) => any; - msLockOrientation(orientation: string): boolean; - msLockOrientation(orientations: string[]): boolean; - msUnlockOrientation(): void; - addEventListener(type: "msorientationchange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Screen: { - prototype: Screen; - new(): Screen; -} - -interface Coordinates { - altitudeAccuracy: number; - longitude: number; - latitude: number; - speed: number; - heading: number; - altitude: number; - accuracy: number; -} -declare var Coordinates: { - prototype: Coordinates; - new(): Coordinates; -} - -interface NavigatorGeolocation { - geolocation: Geolocation; -} - -interface NavigatorContentUtils { -} - -interface EventListener { - (evt: Event): void; -} - -interface SVGLangSpace { - xmllang: string; - xmlspace: string; -} - -interface DataTransfer { - effectAllowed: string; - dropEffect: string; - types: DOMStringList; - files: FileList; - clearData(format?: string): boolean; - setData(format: string, data: string): boolean; - getData(format: string): string; -} -declare var DataTransfer: { - prototype: DataTransfer; - new(): DataTransfer; -} - -interface FocusEvent extends UIEvent { - relatedTarget: EventTarget; - initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void; -} -declare var FocusEvent: { - prototype: FocusEvent; - new(): FocusEvent; -} - -interface Range { - startOffset: number; - collapsed: boolean; - endOffset: number; - startContainer: Node; - endContainer: Node; - commonAncestorContainer: Node; - setStart(refNode: Node, offset: number): void; - setEndBefore(refNode: Node): void; - setStartBefore(refNode: Node): void; - selectNode(refNode: Node): void; - detach(): void; - getBoundingClientRect(): ClientRect; - toString(): string; - compareBoundaryPoints(how: number, sourceRange: Range): number; - insertNode(newNode: Node): void; - collapse(toStart: boolean): void; - selectNodeContents(refNode: Node): void; - cloneContents(): DocumentFragment; - setEnd(refNode: Node, offset: number): void; - cloneRange(): Range; - getClientRects(): ClientRectList; - surroundContents(newParent: Node): void; - deleteContents(): void; - setStartAfter(refNode: Node): void; - extractContents(): DocumentFragment; - setEndAfter(refNode: Node): void; - createContextualFragment(fragment: string): DocumentFragment; - END_TO_END: number; - START_TO_START: number; - START_TO_END: number; - END_TO_START: number; -} -declare var Range: { - prototype: Range; - new(): Range; - END_TO_END: number; - START_TO_START: number; - START_TO_END: number; - END_TO_START: number; -} - -interface SVGPoint { - y: number; - x: number; - matrixTransform(matrix: SVGMatrix): SVGPoint; -} -declare var SVGPoint: { - prototype: SVGPoint; - new(): SVGPoint; -} - -interface MSPluginsCollection { - length: number; - refresh(reload?: boolean): void; -} -declare var MSPluginsCollection: { - prototype: MSPluginsCollection; - new(): MSPluginsCollection; -} - -interface SVGAnimatedNumberList { - animVal: SVGNumberList; - baseVal: SVGNumberList; -} -declare var SVGAnimatedNumberList: { - prototype: SVGAnimatedNumberList; - new(): SVGAnimatedNumberList; -} - -interface SVGSVGElement extends SVGElement, SVGStylable, SVGZoomAndPan, DocumentEvent, SVGLangSpace, SVGLocatable, SVGTests, SVGFitToViewBox, SVGExternalResourcesRequired { - width: SVGAnimatedLength; - x: SVGAnimatedLength; - contentStyleType: string; - onzoom: (ev: any) => any; - y: SVGAnimatedLength; - viewport: SVGRect; - onerror: (ev: ErrorEvent) => any; - pixelUnitToMillimeterY: number; - onresize: (ev: UIEvent) => any; - screenPixelToMillimeterY: number; - height: SVGAnimatedLength; - onabort: (ev: UIEvent) => any; - contentScriptType: string; - pixelUnitToMillimeterX: number; - currentTranslate: SVGPoint; - onunload: (ev: Event) => any; - currentScale: number; - onscroll: (ev: UIEvent) => any; - screenPixelToMillimeterX: number; - setCurrentTime(seconds: number): void; - createSVGLength(): SVGLength; - getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeList; - unpauseAnimations(): void; - createSVGRect(): SVGRect; - checkIntersection(element: SVGElement, rect: SVGRect): boolean; - unsuspendRedrawAll(): void; - pauseAnimations(): void; - suspendRedraw(maxWaitMilliseconds: number): number; - deselectAll(): void; - createSVGAngle(): SVGAngle; - getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeList; - createSVGTransform(): SVGTransform; - unsuspendRedraw(suspendHandleID: number): void; - forceRedraw(): void; - getCurrentTime(): number; - checkEnclosure(element: SVGElement, rect: SVGRect): boolean; - createSVGMatrix(): SVGMatrix; - createSVGPoint(): SVGPoint; - createSVGNumber(): SVGNumber; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; - getElementById(elementId: string): Element; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "zoom", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var SVGSVGElement: { - prototype: SVGSVGElement; - new(): SVGSVGElement; -} - -interface HTMLLabelElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the object to which the given label object is assigned. - */ - htmlFor: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; -} -declare var HTMLLabelElement: { - prototype: HTMLLabelElement; - new(): HTMLLabelElement; -} - -interface MSResourceMetadata { - protocol: string; - fileSize: string; - fileUpdatedDate: string; - nameProp: string; - fileCreatedDate: string; - fileModifiedDate: string; - mimeType: string; -} - -interface HTMLLegendElement extends HTMLElement, MSDataBindingExtensions { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - align: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; -} -declare var HTMLLegendElement: { - prototype: HTMLLegendElement; - new(): HTMLLegendElement; -} - -interface HTMLDirectoryElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { -} -declare var HTMLDirectoryElement: { - prototype: HTMLDirectoryElement; - new(): HTMLDirectoryElement; -} - -interface SVGAnimatedInteger { - animVal: number; - baseVal: number; -} -declare var SVGAnimatedInteger: { - prototype: SVGAnimatedInteger; - new(): SVGAnimatedInteger; -} - -interface SVGTextElement extends SVGTextPositioningElement, SVGTransformable { -} -declare var SVGTextElement: { - prototype: SVGTextElement; - new(): SVGTextElement; -} - -interface SVGTSpanElement extends SVGTextPositioningElement { -} -declare var SVGTSpanElement: { - prototype: SVGTSpanElement; - new(): SVGTSpanElement; -} - -interface HTMLLIElement extends HTMLElement, DOML2DeprecatedListNumberingAndBulletStyle { - /** - * Sets or retrieves the value of a list item. - */ - value: number; -} -declare var HTMLLIElement: { - prototype: HTMLLIElement; - new(): HTMLLIElement; -} - -interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg { - y: number; -} -declare var SVGPathSegLinetoVerticalAbs: { - prototype: SVGPathSegLinetoVerticalAbs; - new(): SVGPathSegLinetoVerticalAbs; -} - -interface MSStorageExtensions { - remainingSpace: number; -} - -interface SVGStyleElement extends SVGElement, SVGLangSpace { - media: string; - type: string; - title: string; -} -declare var SVGStyleElement: { - prototype: SVGStyleElement; - new(): SVGStyleElement; -} - -interface MSCurrentStyleCSSProperties extends MSCSSProperties { - blockDirection: string; - clipBottom: string; - clipLeft: string; - clipRight: string; - clipTop: string; - hasLayout: string; -} -declare var MSCurrentStyleCSSProperties: { - prototype: MSCurrentStyleCSSProperties; - new(): MSCurrentStyleCSSProperties; -} - -interface MSHTMLCollectionExtensions { - urns(urn: any): any; - tags(tagName: any): any; -} - -interface Storage extends MSStorageExtensions { - length: number; - getItem(key: string): any; - [key: string]: any; - setItem(key: string, data: string): void; - clear(): void; - removeItem(key: string): void; - key(index: number): string; - [index: number]: string; -} -declare var Storage: { - prototype: Storage; - new(): Storage; -} - -interface HTMLIFrameElement extends HTMLElement, GetSVGDocument, MSDataBindingExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Sets or retrieves whether the frame can be scrolled. - */ - scrolling: string; - /** - * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. - */ - marginHeight: string; - /** - * Sets or retrieves the left and right margin widths before displaying the text in a frame. - */ - marginWidth: string; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves whether the user can resize the frame. - */ - noResize: boolean; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Retrieves the object of the specified. - */ - contentWindow: Window; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the frame name. - */ - name: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Retrieves the document object of the page or frame. - */ - contentDocument: Document; - /** - * Sets or retrieves the horizontal margin for the object. - */ - hspace: number; - /** - * Sets or retrieves a URI to a long description of the object. - */ - longDesc: string; - /** - * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. - */ - security: any; - /** - * Raised when the object has been completely received from the server. - */ - onload: (ev: Event) => any; - sandbox: DOMSettableTokenList; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLIFrameElement: { - prototype: HTMLIFrameElement; - new(): HTMLIFrameElement; -} - -interface TextRangeCollection { - length: number; - item(index: number): TextRange; - [index: number]: TextRange; -} -declare var TextRangeCollection: { - prototype: TextRangeCollection; - new(): TextRangeCollection; -} - -interface HTMLBodyElement extends HTMLElement, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { - scroll: string; - ononline: (ev: Event) => any; - onblur: (ev: FocusEvent) => any; - noWrap: boolean; - onfocus: (ev: FocusEvent) => any; - onmessage: (ev: MessageEvent) => any; - text: any; - onerror: (ev: ErrorEvent) => any; - bgProperties: string; - onresize: (ev: UIEvent) => any; - link: any; - aLink: any; - bottomMargin: any; - topMargin: any; - onafterprint: (ev: Event) => any; - vLink: any; - onbeforeprint: (ev: Event) => any; - onoffline: (ev: Event) => any; - onunload: (ev: Event) => any; - onhashchange: (ev: Event) => any; - onload: (ev: Event) => any; - rightMargin: any; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - leftMargin: any; - onstorage: (ev: StorageEvent) => any; - onpopstate: (ev: PopStateEvent) => any; - onpageshow: (ev: PageTransitionEvent) => any; - onpagehide: (ev: PageTransitionEvent) => any; - createTextRange(): TextRange; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLBodyElement: { - prototype: HTMLBodyElement; - new(): HTMLBodyElement; -} - -interface DocumentType extends Node { - name: string; - notations: NamedNodeMap; - systemId: string; - internalSubset: string; - entities: NamedNodeMap; - publicId: string; -} -declare var DocumentType: { - prototype: DocumentType; - new(): DocumentType; -} - -interface SVGRadialGradientElement extends SVGGradientElement { - cx: SVGAnimatedLength; - r: SVGAnimatedLength; - cy: SVGAnimatedLength; - fx: SVGAnimatedLength; - fy: SVGAnimatedLength; -} -declare var SVGRadialGradientElement: { - prototype: SVGRadialGradientElement; - new(): SVGRadialGradientElement; -} - -interface MutationEvent extends Event { - newValue: string; - attrChange: number; - attrName: string; - prevValue: string; - relatedNode: Node; - initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; - MODIFICATION: number; - REMOVAL: number; - ADDITION: number; -} -declare var MutationEvent: { - prototype: MutationEvent; - new(): MutationEvent; - MODIFICATION: number; - REMOVAL: number; - ADDITION: number; -} - -interface DragEvent extends MouseEvent { - dataTransfer: DataTransfer; - initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void; - msConvertURL(file: File, targetType: string, targetURL?: string): void; -} -declare var DragEvent: { - prototype: DragEvent; - new(): DragEvent; -} - -interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundColorStyle { +interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment { /** * Sets or retrieves a value that indicates the table alignment. */ @@ -5794,650 +6474,125 @@ interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment, DOML2 * @param index Number that specifies the zero-based position in the rows collection of the row to remove. */ deleteRow(index?: number): void; - /** - * Moves a table row to a new position. - * @param indexFrom Number that specifies the index in the rows collection of the table row that is moved. - * @param indexTo Number that specifies where the row is moved within the rows collection. - */ - moveRow(indexFrom?: number, indexTo?: number): any; /** * Creates a new row (tr) in the table, and adds the row to the rows collection. * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. */ insertRow(index?: number): HTMLElement; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var HTMLTableSectionElement: { prototype: HTMLTableSectionElement; new(): HTMLTableSectionElement; } -interface DOML2DeprecatedListNumberingAndBulletStyle { - type: string; -} - -interface HTMLInputElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: string; - status: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Gets or sets the starting position or offset of a text selection. - */ - selectionStart: number; - indeterminate: boolean; - readOnly: boolean; - size: number; - loop: number; - /** - * Gets or sets the end position or offset of a text selection. - */ - selectionEnd: number; - /** - * Sets or retrieves the URL of the virtual reality modeling language (VRML) world to be displayed in the window. - */ - vrml: string; - /** - * Sets or retrieves a lower resolution image to display. - */ - lowsrc: string; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Sets or retrieves a comma-separated list of content types. - */ - accept: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves the state of the check box or radio button. - */ - defaultChecked: boolean; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Returns the value of the data at the cursor's current position. - */ - value: string; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - border: string; - dynsrc: string; - /** - * Sets or retrieves the state of the check box or radio button. - */ - checked: boolean; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - hspace: number; - /** - * Sets or retrieves the maximum number of characters that the user can enter in a text control. - */ - maxLength: number; - /** - * Returns the content type of the object. - */ - type: string; - /** - * Sets or retrieves the initial contents of the object. - */ - defaultValue: string; - /** - * Retrieves whether the object is fully loaded. - */ - complete: boolean; - start: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a FileList object on a file type input object. - */ - files: FileList; - /** - * Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field. - */ - max: string; - /** - * Overrides the target attribute on a form element. - */ - formTarget: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field. - */ - step: string; +interface HTMLTextAreaElement extends HTMLElement { /** * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. */ autofocus: boolean; /** - * When present, marks an element that can't be submitted without a value. + * Sets or retrieves the width of the object. */ - required: boolean; + cols: number; /** - * Used to override the encoding (formEnctype attribute) specified on the form element. + * Sets or retrieves the initial contents of the object. */ - formEnctype: string; + defaultValue: string; + disabled: boolean; /** - * Returns the input field value as a number. + * Retrieves a reference to the form that the object is embedded in. */ - valueAsNumber: number; + form: HTMLFormElement; + /** + * Sets or retrieves the maximum number of characters that the user can enter in a text control. + */ + maxLength: number; + /** + * Sets or retrieves the name of the object. + */ + name: string; /** * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. */ placeholder: string; /** - * Overrides the submit method attribute previously specified on a form element. + * Sets or retrieves the value indicated whether the content of the object is read-only. */ - formMethod: string; + readOnly: boolean; /** - * Specifies the ID of a pre-defined datalist of options for an input element. + * When present, marks an element that can't be submitted without a value. */ - list: HTMLElement; + required: boolean; /** - * Specifies whether autocomplete is applied to an editable text field. + * Sets or retrieves the number of horizontal rows contained in the object. */ - autocomplete: string; + rows: number; /** - * Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field. + * Gets or sets the end position or offset of a text selection. */ - min: string; + selectionEnd: number; /** - * Overrides the action attribute (where the data on a form is sent) on the parent form element. + * Gets or sets the starting position or offset of a text selection. */ - formAction: string; + selectionStart: number; /** - * Gets or sets a string containing a regular expression that the user's input must match. + * Sets or retrieves the value indicating whether the control is selected. */ - pattern: string; + status: any; + /** + * Retrieves the type of control. + */ + type: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; /** * Returns a ValidityState object that represents the validity states of an element. */ validity: ValidityState; /** - * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. + * Retrieves or sets the text in the entry field of the textArea element. */ - formNoValidate: string; + value: string; /** - * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. + * Returns whether an element will successfully validate based on forms validation rules and constraints. */ - multiple: boolean; + willValidate: boolean; + /** + * Sets or retrieves how to handle wordwrapping in the object. + */ + wrap: string; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; /** * Creates a TextRange object for the element. */ createTextRange(): TextRange; + /** + * Highlights the input area of a form element. + */ + select(): void; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; /** * Sets the start and end positions of a selection in a text field. * @param start The offset into the text field for the start of the selection. * @param end The offset into the text field for the end of the selection. */ setSelectionRange(start: number, end: number): void; - /** - * Makes the selection equal to the current object. - */ - select(): void; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. - * @param n Value to decrement the value by. - */ - stepDown(n?: number): void; - /** - * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value. - * @param n Value to increment the value by. - */ - stepUp(n?: number): void; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLInputElement: { - prototype: HTMLInputElement; - new(): HTMLInputElement; } -interface HTMLAnchorElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rel: string; - /** - * Contains the protocol of the URL. - */ - protocol: string; - /** - * Sets or retrieves the substring of the href property that follows the question mark. - */ - search: string; - /** - * Sets or retrieves the coordinates of the object. - */ - coords: string; - /** - * Contains the hostname of a URL. - */ - hostname: string; - /** - * Contains the pathname of the URL. - */ - pathname: string; - Methods: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - protocolLong: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or retrieves the shape of the object. - */ - name: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the language code of the object. - */ - hreflang: string; - /** - * Sets or retrieves the port number associated with a URL. - */ - port: string; - /** - * Contains the hostname and port values of the URL. - */ - host: string; - /** - * Contains the anchor portion of the URL including the hash sign (#). - */ - hash: string; - nameProp: string; - urn: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rev: string; - /** - * Sets or retrieves the shape of the object. - */ - shape: string; - type: string; - mimeType: string; - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; - /** - * Returns a string representation of an object. - */ - toString(): string; -} -declare var HTMLAnchorElement: { - prototype: HTMLAnchorElement; - new(): HTMLAnchorElement; -} - -interface HTMLParamElement extends HTMLElement { - /** - * Sets or retrieves the value of an input parameter for an element. - */ - value: string; - /** - * Sets or retrieves the name of an input parameter for an element. - */ - name: string; - /** - * Sets or retrieves the content type of the resource designated by the value attribute. - */ - type: string; - /** - * Sets or retrieves the data type of the value attribute. - */ - valueType: string; -} -declare var HTMLParamElement: { - prototype: HTMLParamElement; - new(): HTMLParamElement; -} - -interface SVGImageElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGImageElement: { - prototype: SVGImageElement; - new(): SVGImageElement; -} - -interface SVGAnimatedNumber { - animVal: number; - baseVal: number; -} -declare var SVGAnimatedNumber: { - prototype: SVGAnimatedNumber; - new(): SVGAnimatedNumber; -} - -interface PerformanceTiming { - redirectStart: number; - domainLookupEnd: number; - responseStart: number; - domComplete: number; - domainLookupStart: number; - loadEventStart: number; - msFirstPaint: number; - unloadEventEnd: number; - fetchStart: number; - requestStart: number; - domInteractive: number; - navigationStart: number; - connectEnd: number; - loadEventEnd: number; - connectStart: number; - responseEnd: number; - domLoading: number; - redirectEnd: number; - unloadEventStart: number; - domContentLoadedEventStart: number; - domContentLoadedEventEnd: number; - toJSON(): any; -} -declare var PerformanceTiming: { - prototype: PerformanceTiming; - new(): PerformanceTiming; -} - -interface HTMLPreElement extends HTMLElement, DOML2DeprecatedTextFlowControl { - /** - * Sets or gets a value that you can use to implement your own width functionality for the object. - */ - width: number; - /** - * Indicates a citation by rendering text in italic type. - */ - cite: string; -} -declare var HTMLPreElement: { - prototype: HTMLPreElement; - new(): HTMLPreElement; -} - -interface EventException { - code: number; - message: string; - name: string; - toString(): string; - DISPATCH_REQUEST_ERR: number; - UNSPECIFIED_EVENT_TYPE_ERR: number; -} -declare var EventException: { - prototype: EventException; - new(): EventException; - DISPATCH_REQUEST_ERR: number; - UNSPECIFIED_EVENT_TYPE_ERR: number; -} - -interface MSNavigatorDoNotTrack { - msDoNotTrack: string; - removeSiteSpecificTrackingException(args: ExceptionInformation): void; - removeWebWideTrackingException(args: ExceptionInformation): void; - storeWebWideTrackingException(args: StoreExceptionsInformation): void; - storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void; - confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean; - confirmWebWideTrackingException(args: ExceptionInformation): boolean; -} - -interface NavigatorOnLine { - onLine: boolean; -} - -interface WindowLocalStorage { - localStorage: Storage; -} - -interface SVGMetadataElement extends SVGElement { -} -declare var SVGMetadataElement: { - prototype: SVGMetadataElement; - new(): SVGMetadataElement; -} - -interface SVGPathSegArcRel extends SVGPathSeg { - y: number; - sweepFlag: boolean; - r2: number; - x: number; - angle: number; - r1: number; - largeArcFlag: boolean; -} -declare var SVGPathSegArcRel: { - prototype: SVGPathSegArcRel; - new(): SVGPathSegArcRel; -} - -interface SVGPathSegMovetoAbs extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegMovetoAbs: { - prototype: SVGPathSegMovetoAbs; - new(): SVGPathSegMovetoAbs; -} - -interface SVGStringList { - numberOfItems: number; - replaceItem(newItem: string, index: number): string; - getItem(index: number): string; - clear(): void; - appendItem(newItem: string): string; - initialize(newItem: string): string; - removeItem(index: number): string; - insertItemBefore(newItem: string, index: number): string; -} -declare var SVGStringList: { - prototype: SVGStringList; - new(): SVGStringList; -} - -interface XDomainRequest { - timeout: number; - onerror: (ev: ErrorEvent) => any; - onload: (ev: Event) => any; - onprogress: (ev: ProgressEvent) => any; - ontimeout: (ev: Event) => any; - responseText: string; - contentType: string; - open(method: string, url: string): void; - abort(): void; - send(data?: any): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var XDomainRequest: { - prototype: XDomainRequest; - new(): XDomainRequest; - create(): XDomainRequest; -} - -interface DOML2DeprecatedBackgroundColorStyle { - bgColor: any; -} - -interface ElementTraversal { - childElementCount: number; - previousElementSibling: Element; - lastElementChild: Element; - nextElementSibling: Element; - firstElementChild: Element; -} - -interface SVGLength { - valueAsString: string; - valueInSpecifiedUnits: number; - value: number; - unitType: number; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - convertToSpecifiedUnits(unitType: number): void; - SVG_LENGTHTYPE_NUMBER: number; - SVG_LENGTHTYPE_CM: number; - SVG_LENGTHTYPE_PC: number; - SVG_LENGTHTYPE_PERCENTAGE: number; - SVG_LENGTHTYPE_MM: number; - SVG_LENGTHTYPE_PT: number; - SVG_LENGTHTYPE_IN: number; - SVG_LENGTHTYPE_EMS: number; - SVG_LENGTHTYPE_PX: number; - SVG_LENGTHTYPE_UNKNOWN: number; - SVG_LENGTHTYPE_EXS: number; -} -declare var SVGLength: { - prototype: SVGLength; - new(): SVGLength; - SVG_LENGTHTYPE_NUMBER: number; - SVG_LENGTHTYPE_CM: number; - SVG_LENGTHTYPE_PC: number; - SVG_LENGTHTYPE_PERCENTAGE: number; - SVG_LENGTHTYPE_MM: number; - SVG_LENGTHTYPE_PT: number; - SVG_LENGTHTYPE_IN: number; - SVG_LENGTHTYPE_EMS: number; - SVG_LENGTHTYPE_PX: number; - SVG_LENGTHTYPE_UNKNOWN: number; - SVG_LENGTHTYPE_EXS: number; -} - -interface SVGPolygonElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGAnimatedPoints, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGPolygonElement: { - prototype: SVGPolygonElement; - new(): SVGPolygonElement; -} - -interface HTMLPhraseElement extends HTMLElement { - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; - /** - * Sets or retrieves reference information about the object. - */ - cite: string; -} -declare var HTMLPhraseElement: { - prototype: HTMLPhraseElement; - new(): HTMLPhraseElement; -} - -interface NavigatorStorageUtils { -} - -interface SVGPathSegCurvetoCubicRel extends SVGPathSeg { - y: number; - y1: number; - x2: number; - x: number; - x1: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicRel: { - prototype: SVGPathSegCurvetoCubicRel; - new(): SVGPathSegCurvetoCubicRel; -} - -interface SVGTextContentElement extends SVGElement, SVGStylable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - textLength: SVGAnimatedLength; - lengthAdjust: SVGAnimatedEnumeration; - getCharNumAtPosition(point: SVGPoint): number; - getStartPositionOfChar(charnum: number): SVGPoint; - getExtentOfChar(charnum: number): SVGRect; - getComputedTextLength(): number; - getSubStringLength(charnum: number, nchars: number): number; - selectSubString(charnum: number, nchars: number): void; - getNumberOfChars(): number; - getRotationOfChar(charnum: number): number; - getEndPositionOfChar(charnum: number): SVGPoint; - LENGTHADJUST_SPACING: number; - LENGTHADJUST_SPACINGANDGLYPHS: number; - LENGTHADJUST_UNKNOWN: number; -} -declare var SVGTextContentElement: { - prototype: SVGTextContentElement; - new(): SVGTextContentElement; - LENGTHADJUST_SPACING: number; - LENGTHADJUST_SPACINGANDGLYPHS: number; - LENGTHADJUST_UNKNOWN: number; -} - -interface DOML2DeprecatedColorProperty { - color: string; -} - -interface Location { - hash: string; - protocol: string; - search: string; - href: string; - hostname: string; - port: string; - pathname: string; - host: string; - reload(flag?: boolean): void; - replace(url: string): void; - assign(url: string): void; - toString(): string; -} -declare var Location: { - prototype: Location; - new(): Location; +declare var HTMLTextAreaElement: { + prototype: HTMLTextAreaElement; + new(): HTMLTextAreaElement; } interface HTMLTitleElement extends HTMLElement { @@ -6446,719 +6601,215 @@ interface HTMLTitleElement extends HTMLElement { */ text: string; } + declare var HTMLTitleElement: { prototype: HTMLTitleElement; new(): HTMLTitleElement; } -interface HTMLStyleElement extends HTMLElement, LinkStyle { - /** - * Sets or retrieves the media type. - */ - media: string; - /** - * Retrieves the CSS language in which the style sheet is written. - */ +interface HTMLTrackElement extends HTMLElement { + default: boolean; + kind: string; + label: string; + readyState: number; + src: string; + srclang: string; + track: TextTrack; + ERROR: number; + LOADED: number; + LOADING: number; + NONE: number; +} + +declare var HTMLTrackElement: { + prototype: HTMLTrackElement; + new(): HTMLTrackElement; + ERROR: number; + LOADED: number; + LOADING: number; + NONE: number; +} + +interface HTMLUListElement extends HTMLElement { + compact: boolean; type: string; } -declare var HTMLStyleElement: { - prototype: HTMLStyleElement; - new(): HTMLStyleElement; + +declare var HTMLUListElement: { + prototype: HTMLUListElement; + new(): HTMLUListElement; } -interface PerformanceEntry { - name: string; - startTime: number; - duration: number; - entryType: string; -} -declare var PerformanceEntry: { - prototype: PerformanceEntry; - new(): PerformanceEntry; +interface HTMLUnknownElement extends HTMLElement { } -interface SVGTransform { - type: number; - angle: number; - matrix: SVGMatrix; - setTranslate(tx: number, ty: number): void; - setScale(sx: number, sy: number): void; - setMatrix(matrix: SVGMatrix): void; - setSkewY(angle: number): void; - setRotate(angle: number, cx: number, cy: number): void; - setSkewX(angle: number): void; - SVG_TRANSFORM_SKEWX: number; - SVG_TRANSFORM_UNKNOWN: number; - SVG_TRANSFORM_SCALE: number; - SVG_TRANSFORM_TRANSLATE: number; - SVG_TRANSFORM_MATRIX: number; - SVG_TRANSFORM_ROTATE: number; - SVG_TRANSFORM_SKEWY: number; -} -declare var SVGTransform: { - prototype: SVGTransform; - new(): SVGTransform; - SVG_TRANSFORM_SKEWX: number; - SVG_TRANSFORM_UNKNOWN: number; - SVG_TRANSFORM_SCALE: number; - SVG_TRANSFORM_TRANSLATE: number; - SVG_TRANSFORM_MATRIX: number; - SVG_TRANSFORM_ROTATE: number; - SVG_TRANSFORM_SKEWY: number; -} - -interface UIEvent extends Event { - detail: number; - view: Window; - initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void; -} -declare var UIEvent: { - prototype: UIEvent; - new(): UIEvent; -} - -interface SVGURIReference { - href: SVGAnimatedString; -} - -interface SVGPathSeg { - pathSegType: number; - pathSegTypeAsLetter: string; - PATHSEG_MOVETO_REL: number; - PATHSEG_LINETO_VERTICAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - PATHSEG_CURVETO_QUADRATIC_REL: number; - PATHSEG_CURVETO_CUBIC_ABS: number; - PATHSEG_LINETO_HORIZONTAL_ABS: number; - PATHSEG_CURVETO_QUADRATIC_ABS: number; - PATHSEG_LINETO_ABS: number; - PATHSEG_CLOSEPATH: number; - PATHSEG_LINETO_HORIZONTAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - PATHSEG_LINETO_REL: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - PATHSEG_ARC_REL: number; - PATHSEG_CURVETO_CUBIC_REL: number; - PATHSEG_UNKNOWN: number; - PATHSEG_LINETO_VERTICAL_ABS: number; - PATHSEG_ARC_ABS: number; - PATHSEG_MOVETO_ABS: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; -} -declare var SVGPathSeg: { - prototype: SVGPathSeg; - new(): SVGPathSeg; - PATHSEG_MOVETO_REL: number; - PATHSEG_LINETO_VERTICAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - PATHSEG_CURVETO_QUADRATIC_REL: number; - PATHSEG_CURVETO_CUBIC_ABS: number; - PATHSEG_LINETO_HORIZONTAL_ABS: number; - PATHSEG_CURVETO_QUADRATIC_ABS: number; - PATHSEG_LINETO_ABS: number; - PATHSEG_CLOSEPATH: number; - PATHSEG_LINETO_HORIZONTAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - PATHSEG_LINETO_REL: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - PATHSEG_ARC_REL: number; - PATHSEG_CURVETO_CUBIC_REL: number; - PATHSEG_UNKNOWN: number; - PATHSEG_LINETO_VERTICAL_ABS: number; - PATHSEG_ARC_ABS: number; - PATHSEG_MOVETO_ABS: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; -} - -interface WheelEvent extends MouseEvent { - deltaZ: number; - deltaX: number; - deltaMode: number; - deltaY: number; - initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void; - getCurrentPoint(element: Element): void; - DOM_DELTA_PIXEL: number; - DOM_DELTA_LINE: number; - DOM_DELTA_PAGE: number; -} -declare var WheelEvent: { - prototype: WheelEvent; - new(): WheelEvent; - DOM_DELTA_PIXEL: number; - DOM_DELTA_LINE: number; - DOM_DELTA_PAGE: number; -} - -interface MSEventAttachmentTarget { - attachEvent(event: string, listener: EventListener): boolean; - detachEvent(event: string, listener: EventListener): void; -} - -interface SVGNumber { - value: number; -} -declare var SVGNumber: { - prototype: SVGNumber; - new(): SVGNumber; -} - -interface SVGPathElement extends SVGElement, SVGStylable, SVGAnimatedPathData, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - getPathSegAtLength(distance: number): number; - getPointAtLength(distance: number): SVGPoint; - createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs; - createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel; - createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel; - createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs; - createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs; - createSVGPathSegClosePath(): SVGPathSegClosePath; - createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel; - createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel; - createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel; - createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs; - createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs; - createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel; - createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel; - createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs; - createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel; - getTotalLength(): number; - createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel; - createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs; - createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs; - createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs; -} -declare var SVGPathElement: { - prototype: SVGPathElement; - new(): SVGPathElement; -} - -interface MSCompatibleInfo { - version: string; - userAgent: string; -} -declare var MSCompatibleInfo: { - prototype: MSCompatibleInfo; - new(): MSCompatibleInfo; -} - -interface Text extends CharacterData, MSNodeExtensions { - wholeText: string; - splitText(offset: number): Text; - replaceWholeText(content: string): Text; -} -declare var Text: { - prototype: Text; - new(): Text; -} - -interface SVGAnimatedRect { - animVal: SVGRect; - baseVal: SVGRect; -} -declare var SVGAnimatedRect: { - prototype: SVGAnimatedRect; - new(): SVGAnimatedRect; -} - -interface CSSNamespaceRule extends CSSRule { - namespaceURI: string; - prefix: string; -} -declare var CSSNamespaceRule: { - prototype: CSSNamespaceRule; - new(): CSSNamespaceRule; -} - -interface SVGPathSegList { - numberOfItems: number; - replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg; - getItem(index: number): SVGPathSeg; - clear(): void; - appendItem(newItem: SVGPathSeg): SVGPathSeg; - initialize(newItem: SVGPathSeg): SVGPathSeg; - removeItem(index: number): SVGPathSeg; - insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg; -} -declare var SVGPathSegList: { - prototype: SVGPathSegList; - new(): SVGPathSegList; -} - -interface HTMLUnknownElement extends HTMLElement, MSDataBindingRecordSetReadonlyExtensions { -} declare var HTMLUnknownElement: { prototype: HTMLUnknownElement; new(): HTMLUnknownElement; } -interface HTMLAudioElement extends HTMLMediaElement { -} -declare var HTMLAudioElement: { - prototype: HTMLAudioElement; - new(): HTMLAudioElement; -} - -interface MSImageResourceExtensions { - dynsrc: string; - vrml: string; - lowsrc: string; - start: string; - loop: number; -} - -interface PositionError { - code: number; - message: string; - toString(): string; - POSITION_UNAVAILABLE: number; - PERMISSION_DENIED: number; - TIMEOUT: number; -} -declare var PositionError: { - prototype: PositionError; - new(): PositionError; - POSITION_UNAVAILABLE: number; - PERMISSION_DENIED: number; - TIMEOUT: number; -} - -interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { +interface HTMLVideoElement extends HTMLMediaElement { /** - * Sets or retrieves the width of the object. + * Gets or sets the height of the video element. */ - width: number; - /** - * Sets or retrieves a list of header cells that provide information for the object. - */ - headers: string; - /** - * Retrieves the position of the object in the cells collection of a row. - */ - cellIndex: number; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorLight: any; - /** - * Sets or retrieves the number columns in the table that the object should span. - */ - colSpan: number; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves a comma-delimited list of conceptual categories associated with the object. - */ - axis: string; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; - /** - * Sets or retrieves abbreviated text for the object. - */ - abbr: string; - /** - * Sets or retrieves how many rows in a table the cell should span. - */ - rowSpan: number; - /** - * Sets or retrieves the group of cells in a table to which the object's information applies. - */ - scope: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorDark: any; -} -declare var HTMLTableCellElement: { - prototype: HTMLTableCellElement; - new(): HTMLTableCellElement; -} - -interface SVGElementInstance extends EventTarget { - previousSibling: SVGElementInstance; - parentNode: SVGElementInstance; - lastChild: SVGElementInstance; - nextSibling: SVGElementInstance; - childNodes: SVGElementInstanceList; - correspondingUseElement: SVGUseElement; - correspondingElement: SVGElement; - firstChild: SVGElementInstance; -} -declare var SVGElementInstance: { - prototype: SVGElementInstance; - new(): SVGElementInstance; -} - -interface MSNamespaceInfoCollection { - length: number; - add(namespace?: string, urn?: string, implementationUrl?: any): any; - item(index: any): any; - // [index: any]: any; -} -declare var MSNamespaceInfoCollection: { - prototype: MSNamespaceInfoCollection; - new(): MSNamespaceInfoCollection; -} - -interface SVGCircleElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - cx: SVGAnimatedLength; - r: SVGAnimatedLength; - cy: SVGAnimatedLength; -} -declare var SVGCircleElement: { - prototype: SVGCircleElement; - new(): SVGCircleElement; -} - -interface StyleSheetList { - length: number; - item(index?: number): StyleSheet; - [index: number]: StyleSheet; -} -declare var StyleSheetList: { - prototype: StyleSheetList; - new(): StyleSheetList; -} - -interface CSSImportRule extends CSSRule { - styleSheet: CSSStyleSheet; - href: string; - media: MediaList; -} -declare var CSSImportRule: { - prototype: CSSImportRule; - new(): CSSImportRule; -} - -interface CustomEvent extends Event { - detail: any; - initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void; -} -declare var CustomEvent: { - prototype: CustomEvent; - new(): CustomEvent; -} - -interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty { - /** - * Sets or retrieves the current typeface family. - */ - face: string; - /** - * Sets or retrieves the font size of the object. - */ - size: number; -} -declare var HTMLBaseFontElement: { - prototype: HTMLBaseFontElement; - new(): HTMLBaseFontElement; -} - -interface HTMLTextAreaElement extends HTMLElement, MSDataBindingExtensions { - /** - * Retrieves or sets the text in the entry field of the textArea element. - */ - value: string; - /** - * Sets or retrieves the value indicating whether the control is selected. - */ - status: any; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Gets or sets the starting position or offset of a text selection. - */ - selectionStart: number; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: number; - /** - * Sets or retrieves the width of the object. - */ - cols: number; - /** - * Sets or retrieves the value indicated whether the content of the object is read-only. - */ - readOnly: boolean; - /** - * Sets or retrieves how to handle wordwrapping in the object. - */ - wrap: string; - /** - * Gets or sets the end position or offset of a text selection. - */ - selectionEnd: number; - /** - * Retrieves the type of control. - */ - type: string; - /** - * Sets or retrieves the initial contents of the object. - */ - defaultValue: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - /** - * Sets or retrieves the maximum number of characters that the user can enter in a text control. - */ - maxLength: number; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. - */ - placeholder: string; - /** - * Creates a TextRange object for the element. - */ - createTextRange(): TextRange; - /** - * Sets the start and end positions of a selection in a text field. - * @param start The offset into the text field for the start of the selection. - * @param end The offset into the text field for the end of the selection. - */ - setSelectionRange(start: number, end: number): void; - /** - * Highlights the input area of a form element. - */ - select(): void; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLTextAreaElement: { - prototype: HTMLTextAreaElement; - new(): HTMLTextAreaElement; -} - -interface Geolocation { - clearWatch(watchId: number): void; - getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void; - watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number; -} -declare var Geolocation: { - prototype: Geolocation; - new(): Geolocation; -} - -interface DOML2DeprecatedMarginStyle { - vspace: number; - hspace: number; -} - -interface MSWindowModeless { - dialogTop: any; - dialogLeft: any; - dialogWidth: any; - dialogHeight: any; - menuArguments: any; -} - -interface DOML2DeprecatedAlignmentStyle { - align: string; -} - -interface HTMLMarqueeElement extends HTMLElement, MSDataBindingExtensions, DOML2DeprecatedBackgroundColorStyle { - width: string; - onbounce: (ev: Event) => any; - vspace: number; - trueSpeed: boolean; - scrollAmount: number; - scrollDelay: number; - behavior: string; - height: string; - loop: number; - direction: string; - hspace: number; - onstart: (ev: Event) => any; - onfinish: (ev: Event) => any; - stop(): void; - start(): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "bounce", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "start", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "finish", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLMarqueeElement: { - prototype: HTMLMarqueeElement; - new(): HTMLMarqueeElement; -} - -interface SVGRect { - y: number; - width: number; - x: number; height: number; -} -declare var SVGRect: { - prototype: SVGRect; - new(): SVGRect; + msHorizontalMirror: boolean; + msIsLayoutOptimalForPlayback: boolean; + msIsStereo3D: boolean; + msStereo3DPackingMode: string; + msStereo3DRenderMode: string; + msZoom: boolean; + onMSVideoFormatChanged: (ev: Event) => any; + onMSVideoFrameStepCompleted: (ev: Event) => any; + onMSVideoOptimalLayoutChanged: (ev: Event) => any; + /** + * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available. + */ + poster: string; + /** + * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known. + */ + videoHeight: number; + /** + * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known. + */ + videoWidth: number; + webkitDisplayingFullscreen: boolean; + webkitSupportsFullscreen: boolean; + /** + * Gets or sets the width of the video element. + */ + width: number; + getVideoPlaybackQuality(): VideoPlaybackQuality; + msFrameStep(forward: boolean): void; + msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; + msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void; + webkitEnterFullScreen(): void; + webkitEnterFullscreen(): void; + webkitExitFullScreen(): void; + webkitExitFullscreen(): void; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSVideoFormatChanged", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "MSVideoFrameStepCompleted", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "MSVideoOptimalLayoutChanged", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface MSNodeExtensions { - swapNode(otherNode: Node): Node; - removeNode(deep?: boolean): Node; - replaceNode(replacement: Node): Node; +declare var HTMLVideoElement: { + prototype: HTMLVideoElement; + new(): HTMLVideoElement; +} + +interface HashChangeEvent extends Event { + newURL: string; + oldURL: string; +} + +declare var HashChangeEvent: { + prototype: HashChangeEvent; + new(type: string, eventInitDict?: HashChangeEventInit): HashChangeEvent; } interface History { @@ -7167,2002 +6818,373 @@ interface History { back(distance?: any): void; forward(distance?: any): void; go(delta?: any): void; - replaceState(statedata: any, title: string, url?: string): void; - pushState(statedata: any, title: string, url?: string): void; + pushState(statedata: any, title?: string, url?: string): void; + replaceState(statedata: any, title?: string, url?: string): void; } + declare var History: { prototype: History; new(): History; } -interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg { - y: number; - y1: number; - x2: number; - x: number; - x1: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicAbs: { - prototype: SVGPathSegCurvetoCubicAbs; - new(): SVGPathSegCurvetoCubicAbs; +interface IDBCursor { + direction: string; + key: any; + primaryKey: any; + source: any; + advance(count: number): void; + continue(key?: any): void; + delete(): IDBRequest; + update(value: any): IDBRequest; + NEXT: string; + NEXT_NO_DUPLICATE: string; + PREV: string; + PREV_NO_DUPLICATE: string; } -interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg { - y: number; - y1: number; - x: number; - x1: number; -} -declare var SVGPathSegCurvetoQuadraticAbs: { - prototype: SVGPathSegCurvetoQuadraticAbs; - new(): SVGPathSegCurvetoQuadraticAbs; +declare var IDBCursor: { + prototype: IDBCursor; + new(): IDBCursor; + NEXT: string; + NEXT_NO_DUPLICATE: string; + PREV: string; + PREV_NO_DUPLICATE: string; } -interface TimeRanges { - length: number; - start(index: number): number; - end(index: number): number; -} -declare var TimeRanges: { - prototype: TimeRanges; - new(): TimeRanges; +interface IDBCursorWithValue extends IDBCursor { + value: any; } -interface CSSRule { - cssText: string; - parentStyleSheet: CSSStyleSheet; - parentRule: CSSRule; - type: number; - IMPORT_RULE: number; - MEDIA_RULE: number; - STYLE_RULE: number; - NAMESPACE_RULE: number; - PAGE_RULE: number; - UNKNOWN_RULE: number; - FONT_FACE_RULE: number; - CHARSET_RULE: number; - KEYFRAMES_RULE: number; - KEYFRAME_RULE: number; - VIEWPORT_RULE: number; -} -declare var CSSRule: { - prototype: CSSRule; - new(): CSSRule; - IMPORT_RULE: number; - MEDIA_RULE: number; - STYLE_RULE: number; - NAMESPACE_RULE: number; - PAGE_RULE: number; - UNKNOWN_RULE: number; - FONT_FACE_RULE: number; - CHARSET_RULE: number; - KEYFRAMES_RULE: number; - KEYFRAME_RULE: number; - VIEWPORT_RULE: number; +declare var IDBCursorWithValue: { + prototype: IDBCursorWithValue; + new(): IDBCursorWithValue; } -interface SVGPathSegLinetoAbs extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegLinetoAbs: { - prototype: SVGPathSegLinetoAbs; - new(): SVGPathSegLinetoAbs; +interface IDBDatabase extends EventTarget { + name: string; + objectStoreNames: DOMStringList; + onabort: (ev: Event) => any; + onerror: (ev: Event) => any; + version: string; + close(): void; + createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; + deleteObjectStore(name: string): void; + transaction(storeNames: any, mode?: string): IDBTransaction; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface HTMLModElement extends HTMLElement { - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; - /** - * Sets or retrieves reference information about the object. - */ - cite: string; -} -declare var HTMLModElement: { - prototype: HTMLModElement; - new(): HTMLModElement; +declare var IDBDatabase: { + prototype: IDBDatabase; + new(): IDBDatabase; } -interface SVGMatrix { - e: number; - c: number; - a: number; - b: number; - d: number; - f: number; - multiply(secondMatrix: SVGMatrix): SVGMatrix; - flipY(): SVGMatrix; - skewY(angle: number): SVGMatrix; - inverse(): SVGMatrix; - scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix; - rotate(angle: number): SVGMatrix; - flipX(): SVGMatrix; - translate(x: number, y: number): SVGMatrix; - scale(scaleFactor: number): SVGMatrix; - rotateFromVector(x: number, y: number): SVGMatrix; - skewX(angle: number): SVGMatrix; -} -declare var SVGMatrix: { - prototype: SVGMatrix; - new(): SVGMatrix; +interface IDBFactory { + cmp(first: any, second: any): number; + deleteDatabase(name: string): IDBOpenDBRequest; + open(name: string, version?: number): IDBOpenDBRequest; } -interface MSPopupWindow { - document: Document; - isOpen: boolean; - show(x: number, y: number, w: number, h: number, element?: any): void; - hide(): void; -} -declare var MSPopupWindow: { - prototype: MSPopupWindow; - new(): MSPopupWindow; +declare var IDBFactory: { + prototype: IDBFactory; + new(): IDBFactory; } -interface BeforeUnloadEvent extends Event { - returnValue: string; -} -declare var BeforeUnloadEvent: { - prototype: BeforeUnloadEvent; - new(): BeforeUnloadEvent; +interface IDBIndex { + keyPath: string; + name: string; + objectStore: IDBObjectStore; + unique: boolean; + count(key?: any): IDBRequest; + get(key: any): IDBRequest; + getKey(key: any): IDBRequest; + openCursor(range?: IDBKeyRange, direction?: string): IDBRequest; + openKeyCursor(range?: IDBKeyRange, direction?: string): IDBRequest; } -interface SVGUseElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - animatedInstanceRoot: SVGElementInstance; - instanceRoot: SVGElementInstance; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGUseElement: { - prototype: SVGUseElement; - new(): SVGUseElement; +declare var IDBIndex: { + prototype: IDBIndex; + new(): IDBIndex; } -interface Event { - timeStamp: number; - defaultPrevented: boolean; - isTrusted: boolean; - currentTarget: EventTarget; - cancelBubble: boolean; - target: EventTarget; - eventPhase: number; - cancelable: boolean; - type: string; - srcElement: Element; - bubbles: boolean; - initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; - stopPropagation(): void; - stopImmediatePropagation(): void; - preventDefault(): void; - CAPTURING_PHASE: number; - AT_TARGET: number; - BUBBLING_PHASE: number; +interface IDBKeyRange { + lower: any; + lowerOpen: boolean; + upper: any; + upperOpen: boolean; } -declare var Event: { - prototype: Event; - new(): Event; - CAPTURING_PHASE: number; - AT_TARGET: number; - BUBBLING_PHASE: number; + +declare var IDBKeyRange: { + prototype: IDBKeyRange; + new(): IDBKeyRange; + bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; + lowerBound(bound: any, open?: boolean): IDBKeyRange; + only(value: any): IDBKeyRange; + upperBound(bound: any, open?: boolean): IDBKeyRange; +} + +interface IDBObjectStore { + indexNames: DOMStringList; + keyPath: string; + name: string; + transaction: IDBTransaction; + add(value: any, key?: any): IDBRequest; + clear(): IDBRequest; + count(key?: any): IDBRequest; + createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; + delete(key: any): IDBRequest; + deleteIndex(indexName: string): void; + get(key: any): IDBRequest; + index(name: string): IDBIndex; + openCursor(range?: any, direction?: string): IDBRequest; + put(value: any, key?: any): IDBRequest; +} + +declare var IDBObjectStore: { + prototype: IDBObjectStore; + new(): IDBObjectStore; +} + +interface IDBOpenDBRequest extends IDBRequest { + onblocked: (ev: Event) => any; + onupgradeneeded: (ev: IDBVersionChangeEvent) => any; + addEventListener(type: "blocked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "upgradeneeded", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBOpenDBRequest: { + prototype: IDBOpenDBRequest; + new(): IDBOpenDBRequest; +} + +interface IDBRequest extends EventTarget { + error: DOMError; + onerror: (ev: Event) => any; + onsuccess: (ev: Event) => any; + readyState: string; + result: any; + source: any; + transaction: IDBTransaction; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBRequest: { + prototype: IDBRequest; + new(): IDBRequest; +} + +interface IDBTransaction extends EventTarget { + db: IDBDatabase; + error: DOMError; + mode: string; + onabort: (ev: Event) => any; + oncomplete: (ev: Event) => any; + onerror: (ev: Event) => any; + abort(): void; + objectStore(name: string): IDBObjectStore; + READ_ONLY: string; + READ_WRITE: string; + VERSION_CHANGE: string; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBTransaction: { + prototype: IDBTransaction; + new(): IDBTransaction; + READ_ONLY: string; + READ_WRITE: string; + VERSION_CHANGE: string; +} + +interface IDBVersionChangeEvent extends Event { + newVersion: number; + oldVersion: number; +} + +declare var IDBVersionChangeEvent: { + prototype: IDBVersionChangeEvent; + new(): IDBVersionChangeEvent; } interface ImageData { - width: number; data: number[]; height: number; + width: number; } + declare var ImageData: { prototype: ImageData; new(): ImageData; } -interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves the width of the object. - */ - width: any; - /** - * Sets or retrieves the alignment of the object relative to the display or table. - */ - align: string; - /** - * Sets or retrieves the number of columns in the group. - */ - span: number; -} -declare var HTMLTableColElement: { - prototype: HTMLTableColElement; - new(): HTMLTableColElement; -} - -interface SVGException { - code: number; - message: string; - name: string; - toString(): string; - SVG_MATRIX_NOT_INVERTABLE: number; - SVG_WRONG_TYPE_ERR: number; - SVG_INVALID_VALUE_ERR: number; -} -declare var SVGException: { - prototype: SVGException; - new(): SVGException; - SVG_MATRIX_NOT_INVERTABLE: number; - SVG_WRONG_TYPE_ERR: number; - SVG_INVALID_VALUE_ERR: number; -} - -interface SVGLinearGradientElement extends SVGGradientElement { - y1: SVGAnimatedLength; - x2: SVGAnimatedLength; - x1: SVGAnimatedLength; - y2: SVGAnimatedLength; -} -declare var SVGLinearGradientElement: { - prototype: SVGLinearGradientElement; - new(): SVGLinearGradientElement; -} - -interface HTMLTableAlignment { - /** - * Sets or retrieves a value that you can use to implement your own ch functionality for the object. - */ - ch: string; - /** - * Sets or retrieves how text and other content are vertically aligned within the object that contains them. - */ - vAlign: string; - /** - * Sets or retrieves a value that you can use to implement your own chOff functionality for the object. - */ - chOff: string; -} - -interface SVGAnimatedEnumeration { - animVal: number; - baseVal: number; -} -declare var SVGAnimatedEnumeration: { - prototype: SVGAnimatedEnumeration; - new(): SVGAnimatedEnumeration; -} - -interface DOML2DeprecatedSizeProperty { - size: number; -} - -interface HTMLUListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { -} -declare var HTMLUListElement: { - prototype: HTMLUListElement; - new(): HTMLUListElement; -} - -interface SVGRectElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - ry: SVGAnimatedLength; - rx: SVGAnimatedLength; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGRectElement: { - prototype: SVGRectElement; - new(): SVGRectElement; -} - -interface ErrorEventHandler { - (event: Event, source: string, fileno: number, columnNumber: number): void; -} - -interface HTMLDivElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} -declare var HTMLDivElement: { - prototype: HTMLDivElement; - new(): HTMLDivElement; -} - -interface DOML2DeprecatedBorderStyle { - border: string; -} - -interface NamedNodeMap { - length: number; - removeNamedItemNS(namespaceURI: string, localName: string): Attr; - item(index: number): Attr; - [index: number]: Attr; - removeNamedItem(name: string): Attr; - getNamedItem(name: string): Attr; - // [name: string]: Attr; - setNamedItem(arg: Attr): Attr; - getNamedItemNS(namespaceURI: string, localName: string): Attr; - setNamedItemNS(arg: Attr): Attr; -} -declare var NamedNodeMap: { - prototype: NamedNodeMap; - new(): NamedNodeMap; -} - -interface MediaList { - length: number; - mediaText: string; - deleteMedium(oldMedium: string): void; - appendMedium(newMedium: string): void; - item(index: number): string; - [index: number]: string; - toString(): string; -} -declare var MediaList: { - prototype: MediaList; - new(): MediaList; -} - -interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegCurvetoQuadraticSmoothAbs: { - prototype: SVGPathSegCurvetoQuadraticSmoothAbs; - new(): SVGPathSegCurvetoQuadraticSmoothAbs; -} - -interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { - y: number; - x2: number; - x: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicSmoothRel: { - prototype: SVGPathSegCurvetoCubicSmoothRel; - new(): SVGPathSegCurvetoCubicSmoothRel; -} - -interface SVGLengthList { - numberOfItems: number; - replaceItem(newItem: SVGLength, index: number): SVGLength; - getItem(index: number): SVGLength; - clear(): void; - appendItem(newItem: SVGLength): SVGLength; - initialize(newItem: SVGLength): SVGLength; - removeItem(index: number): SVGLength; - insertItemBefore(newItem: SVGLength, index: number): SVGLength; -} -declare var SVGLengthList: { - prototype: SVGLengthList; - new(): SVGLengthList; -} - -interface ProcessingInstruction extends Node { - target: string; - data: string; -} -declare var ProcessingInstruction: { - prototype: ProcessingInstruction; - new(): ProcessingInstruction; -} - -interface MSWindowExtensions { - status: string; - onmouseleave: (ev: MouseEvent) => any; - screenLeft: number; - offscreenBuffering: any; - maxConnectionsPerServer: number; - onmouseenter: (ev: MouseEvent) => any; - clipboardData: DataTransfer; - defaultStatus: string; - clientInformation: Navigator; - closed: boolean; - onhelp: (ev: Event) => any; - external: External; - event: MSEventObj; - onfocusout: (ev: FocusEvent) => any; - screenTop: number; - onfocusin: (ev: FocusEvent) => any; - showModelessDialog(url?: string, argument?: any, options?: any): Window; - navigate(url: string): void; - resizeBy(x?: number, y?: number): void; - item(index: any): any; - resizeTo(x?: number, y?: number): void; - createPopup(arguments?: any): MSPopupWindow; - toStaticHTML(html: string): string; - execScript(code: string, language?: string): any; - msWriteProfilerMark(profilerMarkName: string): void; - moveTo(x?: number, y?: number): void; - moveBy(x?: number, y?: number): void; - showHelp(url: string, helpArg?: any, features?: string): void; - captureEvents(): void; - releaseEvents(): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface MSBehaviorUrnsCollection { - length: number; - item(index: number): string; -} -declare var MSBehaviorUrnsCollection: { - prototype: MSBehaviorUrnsCollection; - new(): MSBehaviorUrnsCollection; -} - -interface CSSFontFaceRule extends CSSRule { - style: CSSStyleDeclaration; -} -declare var CSSFontFaceRule: { - prototype: CSSFontFaceRule; - new(): CSSFontFaceRule; -} - -interface DOML2DeprecatedBackgroundStyle { - background: string; -} - -interface TextEvent extends UIEvent { - inputMethod: number; - data: string; - locale: string; - initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void; - DOM_INPUT_METHOD_KEYBOARD: number; - DOM_INPUT_METHOD_DROP: number; - DOM_INPUT_METHOD_IME: number; - DOM_INPUT_METHOD_SCRIPT: number; - DOM_INPUT_METHOD_VOICE: number; - DOM_INPUT_METHOD_UNKNOWN: number; - DOM_INPUT_METHOD_PASTE: number; - DOM_INPUT_METHOD_HANDWRITING: number; - DOM_INPUT_METHOD_OPTION: number; - DOM_INPUT_METHOD_MULTIMODAL: number; -} -declare var TextEvent: { - prototype: TextEvent; - new(): TextEvent; - DOM_INPUT_METHOD_KEYBOARD: number; - DOM_INPUT_METHOD_DROP: number; - DOM_INPUT_METHOD_IME: number; - DOM_INPUT_METHOD_SCRIPT: number; - DOM_INPUT_METHOD_VOICE: number; - DOM_INPUT_METHOD_UNKNOWN: number; - DOM_INPUT_METHOD_PASTE: number; - DOM_INPUT_METHOD_HANDWRITING: number; - DOM_INPUT_METHOD_OPTION: number; - DOM_INPUT_METHOD_MULTIMODAL: number; -} - -interface DocumentFragment extends Node, NodeSelector, MSEventAttachmentTarget, MSNodeExtensions { -} -declare var DocumentFragment: { - prototype: DocumentFragment; - new(): DocumentFragment; -} - -interface SVGPolylineElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGAnimatedPoints, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGPolylineElement: { - prototype: SVGPolylineElement; - new(): SVGPolylineElement; -} - -interface SVGAnimatedPathData { - pathSegList: SVGPathSegList; -} - -interface Position { - timestamp: Date; - coords: Coordinates; -} -declare var Position: { - prototype: Position; - new(): Position; -} - -interface BookmarkCollection { - length: number; - item(index: number): any; - [index: number]: any; -} -declare var BookmarkCollection: { - prototype: BookmarkCollection; - new(): BookmarkCollection; -} - -interface PerformanceMark extends PerformanceEntry { -} -declare var PerformanceMark: { - prototype: PerformanceMark; - new(): PerformanceMark; -} - -interface CSSPageRule extends CSSRule { - pseudoClass: string; - selectorText: string; - selector: string; - style: CSSStyleDeclaration; -} -declare var CSSPageRule: { - prototype: CSSPageRule; - new(): CSSPageRule; -} - -interface HTMLBRElement extends HTMLElement { - /** - * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document. - */ - clear: string; -} -declare var HTMLBRElement: { - prototype: HTMLBRElement; - new(): HTMLBRElement; -} - -interface MSNavigatorExtensions { - userLanguage: string; - plugins: MSPluginsCollection; - cookieEnabled: boolean; - appCodeName: string; - cpuClass: string; - appMinorVersion: string; - connectionSpeed: number; - browserLanguage: string; - mimeTypes: MSMimeTypesCollection; - systemLanguage: string; - language: string; - javaEnabled(): boolean; - taintEnabled(): boolean; -} - -interface HTMLSpanElement extends HTMLElement, MSDataBindingExtensions { -} -declare var HTMLSpanElement: { - prototype: HTMLSpanElement; - new(): HTMLSpanElement; -} - -interface HTMLHeadElement extends HTMLElement { - profile: string; -} -declare var HTMLHeadElement: { - prototype: HTMLHeadElement; - new(): HTMLHeadElement; -} - -interface HTMLHeadingElement extends HTMLElement, DOML2DeprecatedTextFlowControl { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; -} -declare var HTMLHeadingElement: { - prototype: HTMLHeadingElement; - new(): HTMLHeadingElement; -} - -interface HTMLFormElement extends HTMLElement, MSHTMLCollectionExtensions { - /** - * Sets or retrieves the number of objects in a collection. - */ - length: number; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form. - */ - acceptCharset: string; - /** - * Sets or retrieves the encoding type for the form. - */ - enctype: string; - /** - * Retrieves a collection, in source order, of all controls in a given form. - */ - elements: HTMLCollection; - /** - * Sets or retrieves the URL to which the form content is sent for processing. - */ - action: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Sets or retrieves how to send the form data to the server. - */ - method: string; - /** - * Sets or retrieves the MIME encoding for the form. - */ - encoding: string; - /** - * Specifies whether autocomplete is applied to an editable text field. - */ - autocomplete: string; - /** - * Designates a form that is not validated when submitted. - */ - noValidate: boolean; - /** - * Fires when the user resets a form. - */ - reset(): void; - /** - * Retrieves a form object or an object from an elements collection. - * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. - * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. - */ - item(name?: any, index?: any): any; - /** - * Fires when a FORM is about to be submitted. - */ - submit(): void; - /** - * Retrieves a form object or an object from an elements collection. - */ - namedItem(name: string): any; - [name: string]: any; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; -} -declare var HTMLFormElement: { - prototype: HTMLFormElement; - new(): HTMLFormElement; -} - -interface SVGZoomAndPan { - zoomAndPan: number; - SVG_ZOOMANDPAN_MAGNIFY: number; - SVG_ZOOMANDPAN_UNKNOWN: number; - SVG_ZOOMANDPAN_DISABLE: number; -} -declare var SVGZoomAndPan: SVGZoomAndPan; - -interface HTMLMediaElement extends HTMLElement { - /** - * Gets the earliest possible position, in seconds, that the playback can begin. - */ - initialTime: number; - /** - * Gets TimeRanges for the current media resource that has been played. - */ - played: TimeRanges; - /** - * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement. - */ - currentSrc: string; - readyState: any; - /** - * The autobuffer element is not supported by Internet Explorer 9. Use the preload element instead. - */ - autobuffer: boolean; - /** - * Gets or sets a flag to specify whether playback should restart after it completes. - */ - loop: boolean; - /** - * Gets information about whether the playback has ended or not. - */ - ended: boolean; - /** - * Gets a collection of buffered time ranges. - */ - buffered: TimeRanges; - /** - * Returns an object representing the current error state of the audio or video element. - */ - error: MediaError; - /** - * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. - */ - seekable: TimeRanges; - /** - * Gets or sets a value that indicates whether to start playing the media automatically. - */ - autoplay: boolean; - /** - * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player). - */ - controls: boolean; - /** - * Gets or sets the volume level for audio portions of the media element. - */ - volume: number; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - /** - * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource. - */ - playbackRate: number; - /** - * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming. - */ - duration: number; - /** - * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted. - */ - muted: boolean; - /** - * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource. - */ - defaultPlaybackRate: number; - /** - * Gets a flag that specifies whether playback is paused. - */ - paused: boolean; - /** - * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource. - */ - seeking: boolean; - /** - * Gets or sets the current playback position, in seconds. - */ - currentTime: number; - /** - * Gets or sets the current playback position, in seconds. - */ - preload: string; - /** - * Gets the current network activity for the element. - */ - networkState: number; - /** - * Specifies the purpose of the audio or video media, such as background audio or alerts. - */ - msAudioCategory: string; - /** - * Specifies whether or not to enable low-latency playback on the media element. - */ - msRealTime: boolean; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - textTracks: TextTrackList; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Returns an AudioTrackList object with the audio tracks for a given video element. - */ - audioTracks: AudioTrackList; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; - /** - * Specifies the output device id that the audio will be sent to. - */ - msAudioDeviceType: string; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - onmsneedkey: (ev: MSMediaKeyNeededEvent) => any; - /** - * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element. - */ - msKeys: MSMediaKeys; - msGraphicsTrustStatus: MSGraphicsTrust; - /** - * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not. - */ - pause(): void; - /** - * Loads and starts playback of a media resource. - */ - play(): void; - /** - * Fires immediately after the client loads the object. - */ - load(): void; - /** - * Returns a string that specifies whether the client can play a given media resource type. - */ - canPlayType(type: string): string; - /** - * Clears all effects from the media pipeline. - */ - msClearEffects(): void; - /** - * Specifies the media protection manager for a given media pipeline. - */ - msSetMediaProtectionManager(mediaProtectionManager?: any): void; - /** - * Inserts the specified audio effect into media pipeline. - */ - msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; - msSetMediaKeys(mediaKeys: MSMediaKeys): void; - addTextTrack(kind: string, label?: string, language?: string): TextTrack; - HAVE_METADATA: number; - HAVE_CURRENT_DATA: number; - HAVE_NOTHING: number; - NETWORK_NO_SOURCE: number; - HAVE_ENOUGH_DATA: number; - NETWORK_EMPTY: number; - NETWORK_LOADING: number; - NETWORK_IDLE: number; - HAVE_FUTURE_DATA: number; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLMediaElement: { - prototype: HTMLMediaElement; - new(): HTMLMediaElement; - HAVE_METADATA: number; - HAVE_CURRENT_DATA: number; - HAVE_NOTHING: number; - NETWORK_NO_SOURCE: number; - HAVE_ENOUGH_DATA: number; - NETWORK_EMPTY: number; - NETWORK_LOADING: number; - NETWORK_IDLE: number; - HAVE_FUTURE_DATA: number; -} - -interface ElementCSSInlineStyle { - runtimeStyle: MSStyleCSSProperties; - currentStyle: MSCurrentStyleCSSProperties; - doScroll(component?: any): void; - componentFromPoint(x: number, y: number): string; -} - -interface DOMParser { - parseFromString(source: string, mimeType: string): Document; -} -declare var DOMParser: { - prototype: DOMParser; - new(): DOMParser; -} - -interface MSMimeTypesCollection { - length: number; -} -declare var MSMimeTypesCollection: { - prototype: MSMimeTypesCollection; - new(): MSMimeTypesCollection; -} - -interface StyleSheet { - disabled: boolean; - ownerNode: Node; - parentStyleSheet: StyleSheet; - href: string; - media: MediaList; - type: string; - title: string; -} -declare var StyleSheet: { - prototype: StyleSheet; - new(): StyleSheet; -} - -interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { - startOffset: SVGAnimatedLength; - method: SVGAnimatedEnumeration; - spacing: SVGAnimatedEnumeration; - TEXTPATH_SPACINGTYPE_EXACT: number; - TEXTPATH_METHODTYPE_STRETCH: number; - TEXTPATH_SPACINGTYPE_AUTO: number; - TEXTPATH_SPACINGTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_ALIGN: number; -} -declare var SVGTextPathElement: { - prototype: SVGTextPathElement; - new(): SVGTextPathElement; - TEXTPATH_SPACINGTYPE_EXACT: number; - TEXTPATH_METHODTYPE_STRETCH: number; - TEXTPATH_SPACINGTYPE_AUTO: number; - TEXTPATH_SPACINGTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_ALIGN: number; -} - -interface HTMLDTElement extends HTMLElement { - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} -declare var HTMLDTElement: { - prototype: HTMLDTElement; - new(): HTMLDTElement; -} - -interface NodeList { - length: number; - item(index: number): Node; - [index: number]: Node; -} -declare var NodeList: { - prototype: NodeList; - new(): NodeList; -} - -interface XMLSerializer { - serializeToString(target: Node): string; -} -declare var XMLSerializer: { - prototype: XMLSerializer; - new(): XMLSerializer; -} - -interface PerformanceMeasure extends PerformanceEntry { -} -declare var PerformanceMeasure: { - prototype: PerformanceMeasure; - new(): PerformanceMeasure; -} - -interface SVGGradientElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGExternalResourcesRequired, SVGURIReference { - spreadMethod: SVGAnimatedEnumeration; - gradientTransform: SVGAnimatedTransformList; - gradientUnits: SVGAnimatedEnumeration; - SVG_SPREADMETHOD_REFLECT: number; - SVG_SPREADMETHOD_PAD: number; - SVG_SPREADMETHOD_UNKNOWN: number; - SVG_SPREADMETHOD_REPEAT: number; -} -declare var SVGGradientElement: { - prototype: SVGGradientElement; - new(): SVGGradientElement; - SVG_SPREADMETHOD_REFLECT: number; - SVG_SPREADMETHOD_PAD: number; - SVG_SPREADMETHOD_UNKNOWN: number; - SVG_SPREADMETHOD_REPEAT: number; -} - -interface NodeFilter { - acceptNode(n: Node): number; - SHOW_ENTITY_REFERENCE: number; - SHOW_NOTATION: number; - SHOW_ENTITY: number; - SHOW_DOCUMENT: number; - SHOW_PROCESSING_INSTRUCTION: number; - FILTER_REJECT: number; - SHOW_CDATA_SECTION: number; - FILTER_ACCEPT: number; - SHOW_ALL: number; - SHOW_DOCUMENT_TYPE: number; - SHOW_TEXT: number; - SHOW_ELEMENT: number; - SHOW_COMMENT: number; - FILTER_SKIP: number; - SHOW_ATTRIBUTE: number; - SHOW_DOCUMENT_FRAGMENT: number; -} -declare var NodeFilter: NodeFilter; - -interface SVGNumberList { - numberOfItems: number; - replaceItem(newItem: SVGNumber, index: number): SVGNumber; - getItem(index: number): SVGNumber; - clear(): void; - appendItem(newItem: SVGNumber): SVGNumber; - initialize(newItem: SVGNumber): SVGNumber; - removeItem(index: number): SVGNumber; - insertItemBefore(newItem: SVGNumber, index: number): SVGNumber; -} -declare var SVGNumberList: { - prototype: SVGNumberList; - new(): SVGNumberList; -} - -interface MediaError { - code: number; - msExtendedCode: number; - MEDIA_ERR_ABORTED: number; - MEDIA_ERR_NETWORK: number; - MEDIA_ERR_SRC_NOT_SUPPORTED: number; - MEDIA_ERR_DECODE: number; - MS_MEDIA_ERR_ENCRYPTED: number; -} -declare var MediaError: { - prototype: MediaError; - new(): MediaError; - MEDIA_ERR_ABORTED: number; - MEDIA_ERR_NETWORK: number; - MEDIA_ERR_SRC_NOT_SUPPORTED: number; - MEDIA_ERR_DECODE: number; - MS_MEDIA_ERR_ENCRYPTED: number; -} - -interface HTMLFieldSetElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLFieldSetElement: { - prototype: HTMLFieldSetElement; - new(): HTMLFieldSetElement; -} - -interface HTMLBGSoundElement extends HTMLElement { - /** - * Sets or gets the value indicating how the volume of the background sound is divided between the left speaker and the right speaker. - */ - balance: any; - /** - * Sets or gets the volume setting for the sound. - */ - volume: any; - /** - * Sets or gets the URL of a sound to play. - */ - src: string; - /** - * Sets or retrieves the number of times a sound or video clip will loop when activated. - */ - loop: number; -} -declare var HTMLBGSoundElement: { - prototype: HTMLBGSoundElement; - new(): HTMLBGSoundElement; -} - -interface Comment extends CharacterData { - text: string; -} -declare var Comment: { - prototype: Comment; - new(): Comment; -} - -interface PerformanceResourceTiming extends PerformanceEntry { - redirectStart: number; - redirectEnd: number; - domainLookupEnd: number; - responseStart: number; - domainLookupStart: number; - fetchStart: number; - requestStart: number; - connectEnd: number; - connectStart: number; - initiatorType: string; - responseEnd: number; -} -declare var PerformanceResourceTiming: { - prototype: PerformanceResourceTiming; - new(): PerformanceResourceTiming; -} - -interface CanvasPattern { -} -declare var CanvasPattern: { - prototype: CanvasPattern; - new(): CanvasPattern; -} - -interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { - /** - * Sets or retrieves the width of the object. - */ - width: number; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves whether the horizontal rule is drawn with 3-D shading. - */ - noShade: boolean; -} -declare var HTMLHRElement: { - prototype: HTMLHRElement; - new(): HTMLHRElement; -} - -interface HTMLObjectElement extends HTMLElement, GetSVGDocument, DOML2DeprecatedMarginStyle, DOML2DeprecatedBorderStyle, DOML2DeprecatedAlignmentStyle, MSDataBindingExtensions, MSDataBindingRecordSetExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Sets or retrieves the Internet media type for the code associated with the object. - */ - codeType: string; - /** - * Retrieves the contained object. - */ - object: any; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the URL of the file containing the compiled Java class. - */ - code: string; - /** - * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. - */ - archive: string; - /** - * Sets or retrieves a message to be displayed while an object is loading. - */ - standby: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves the class identifier for the object. - */ - classid: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Sets or retrieves the URL that references the data of the object. - */ - data: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Retrieves the document object of the page or frame. - */ - contentDocument: Document; - /** - * Gets or sets the optional alternative HTML script to execute if the object fails to load. - */ - altHtml: string; - /** - * Sets or retrieves the URL of the component. - */ - codeBase: string; - declare: boolean; - /** - * Sets or retrieves the MIME type of the object. - */ - type: string; - /** - * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. - */ - BaseHref: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - readyState: number; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLObjectElement: { - prototype: HTMLObjectElement; - new(): HTMLObjectElement; -} - -interface HTMLEmbedElement extends HTMLElement, GetSVGDocument { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Retrieves the palette used for the embedded document. - */ - palette: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - hidden: string; - /** - * Retrieves the URL of the plug-in used to view an embedded document. - */ - pluginspage: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Sets or retrieves the height and width units of the embed object. - */ - units: string; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - readyState: string; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; -} -declare var HTMLEmbedElement: { - prototype: HTMLEmbedElement; - new(): HTMLEmbedElement; -} - -interface StorageEvent extends Event { - oldValue: any; - newValue: any; - url: string; - storageArea: Storage; +interface KeyboardEvent extends UIEvent { + altKey: boolean; + char: string; + charCode: number; + ctrlKey: boolean; key: string; - initStorageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, keyArg: string, oldValueArg: any, newValueArg: any, urlArg: string, storageAreaArg: Storage): void; -} -declare var StorageEvent: { - prototype: StorageEvent; - new(): StorageEvent; + keyCode: number; + locale: string; + location: number; + metaKey: boolean; + repeat: boolean; + shiftKey: boolean; + which: number; + getModifierState(keyArg: string): boolean; + initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; + DOM_KEY_LOCATION_JOYSTICK: number; + DOM_KEY_LOCATION_LEFT: number; + DOM_KEY_LOCATION_MOBILE: number; + DOM_KEY_LOCATION_NUMPAD: number; + DOM_KEY_LOCATION_RIGHT: number; + DOM_KEY_LOCATION_STANDARD: number; } -interface CharacterData extends Node { - length: number; - data: string; - deleteData(offset: number, count: number): void; - replaceData(offset: number, count: number, arg: string): void; - appendData(arg: string): void; - insertData(offset: number, arg: string): void; - substringData(offset: number, count: number): string; -} -declare var CharacterData: { - prototype: CharacterData; - new(): CharacterData; +declare var KeyboardEvent: { + prototype: KeyboardEvent; + new(typeArg: string, eventInitDict?: KeyboardEventInit): KeyboardEvent; + DOM_KEY_LOCATION_JOYSTICK: number; + DOM_KEY_LOCATION_LEFT: number; + DOM_KEY_LOCATION_MOBILE: number; + DOM_KEY_LOCATION_NUMPAD: number; + DOM_KEY_LOCATION_RIGHT: number; + DOM_KEY_LOCATION_STANDARD: number; } -interface HTMLOptGroupElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the ordinal position of an option in a list box. - */ - index: number; - /** - * Sets or retrieves the status of an option. - */ - defaultSelected: boolean; - /** - * Sets or retrieves the text string specified by the option tag. - */ - text: string; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves a value that you can use to implement your own label functionality for the object. - */ - label: string; - /** - * Sets or retrieves whether the option in the list box is the default item. - */ - selected: boolean; -} -declare var HTMLOptGroupElement: { - prototype: HTMLOptGroupElement; - new(): HTMLOptGroupElement; -} - -interface HTMLIsIndexElement extends HTMLElement { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the URL to which the form content is sent for processing. - */ - action: string; - prompt: string; -} -declare var HTMLIsIndexElement: { - prototype: HTMLIsIndexElement; - new(): HTMLIsIndexElement; -} - -interface SVGPathSegLinetoRel extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegLinetoRel: { - prototype: SVGPathSegLinetoRel; - new(): SVGPathSegLinetoRel; -} - -interface DOMException { - code: number; - message: string; - name: string; +interface Location { + hash: string; + host: string; + hostname: string; + href: string; + origin: string; + pathname: string; + port: string; + protocol: string; + search: string; + assign(url: string): void; + reload(forcedReload?: boolean): void; + replace(url: string): void; toString(): string; - HIERARCHY_REQUEST_ERR: number; - NO_MODIFICATION_ALLOWED_ERR: number; - INVALID_MODIFICATION_ERR: number; - NAMESPACE_ERR: number; - INVALID_CHARACTER_ERR: number; - TYPE_MISMATCH_ERR: number; - ABORT_ERR: number; - INVALID_STATE_ERR: number; - SECURITY_ERR: number; - NETWORK_ERR: number; - WRONG_DOCUMENT_ERR: number; - QUOTA_EXCEEDED_ERR: number; - INDEX_SIZE_ERR: number; - DOMSTRING_SIZE_ERR: number; - SYNTAX_ERR: number; - SERIALIZE_ERR: number; - VALIDATION_ERR: number; - NOT_FOUND_ERR: number; - URL_MISMATCH_ERR: number; - PARSE_ERR: number; - NO_DATA_ALLOWED_ERR: number; - NOT_SUPPORTED_ERR: number; - INVALID_ACCESS_ERR: number; - INUSE_ATTRIBUTE_ERR: number; - INVALID_NODE_TYPE_ERR: number; - DATA_CLONE_ERR: number; - TIMEOUT_ERR: number; -} -declare var DOMException: { - prototype: DOMException; - new(): DOMException; - HIERARCHY_REQUEST_ERR: number; - NO_MODIFICATION_ALLOWED_ERR: number; - INVALID_MODIFICATION_ERR: number; - NAMESPACE_ERR: number; - INVALID_CHARACTER_ERR: number; - TYPE_MISMATCH_ERR: number; - ABORT_ERR: number; - INVALID_STATE_ERR: number; - SECURITY_ERR: number; - NETWORK_ERR: number; - WRONG_DOCUMENT_ERR: number; - QUOTA_EXCEEDED_ERR: number; - INDEX_SIZE_ERR: number; - DOMSTRING_SIZE_ERR: number; - SYNTAX_ERR: number; - SERIALIZE_ERR: number; - VALIDATION_ERR: number; - NOT_FOUND_ERR: number; - URL_MISMATCH_ERR: number; - PARSE_ERR: number; - NO_DATA_ALLOWED_ERR: number; - NOT_SUPPORTED_ERR: number; - INVALID_ACCESS_ERR: number; - INUSE_ATTRIBUTE_ERR: number; - INVALID_NODE_TYPE_ERR: number; - DATA_CLONE_ERR: number; - TIMEOUT_ERR: number; } -interface SVGAnimatedBoolean { - animVal: boolean; - baseVal: boolean; -} -declare var SVGAnimatedBoolean: { - prototype: SVGAnimatedBoolean; - new(): SVGAnimatedBoolean; +declare var Location: { + prototype: Location; + new(): Location; } -interface MSCompatibleInfoCollection { - length: number; - item(index: number): MSCompatibleInfo; -} -declare var MSCompatibleInfoCollection: { - prototype: MSCompatibleInfoCollection; - new(): MSCompatibleInfoCollection; +interface LongRunningScriptDetectedEvent extends Event { + executionTime: number; + stopPageScriptExecution: boolean; } -interface SVGSwitchElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGSwitchElement: { - prototype: SVGSwitchElement; - new(): SVGSwitchElement; +declare var LongRunningScriptDetectedEvent: { + prototype: LongRunningScriptDetectedEvent; + new(): LongRunningScriptDetectedEvent; } -interface SVGPreserveAspectRatio { - align: number; - meetOrSlice: number; - SVG_PRESERVEASPECTRATIO_NONE: number; - SVG_PRESERVEASPECTRATIO_XMINYMID: number; - SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - SVG_MEETORSLICE_UNKNOWN: number; - SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - SVG_PRESERVEASPECTRATIO_XMINYMIN: number; - SVG_MEETORSLICE_MEET: number; - SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - SVG_MEETORSLICE_SLICE: number; - SVG_PRESERVEASPECTRATIO_UNKNOWN: number; -} -declare var SVGPreserveAspectRatio: { - prototype: SVGPreserveAspectRatio; - new(): SVGPreserveAspectRatio; - SVG_PRESERVEASPECTRATIO_NONE: number; - SVG_PRESERVEASPECTRATIO_XMINYMID: number; - SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - SVG_MEETORSLICE_UNKNOWN: number; - SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - SVG_PRESERVEASPECTRATIO_XMINYMIN: number; - SVG_MEETORSLICE_MEET: number; - SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - SVG_MEETORSLICE_SLICE: number; - SVG_PRESERVEASPECTRATIO_UNKNOWN: number; +interface MSApp { + clearTemporaryWebDataAsync(): MSAppAsyncOperation; + createBlobFromRandomAccessStream(type: string, seeker: any): Blob; + createDataPackage(object: any): any; + createDataPackageFromSelection(): any; + createFileFromStorageFile(storageFile: any): File; + createStreamFromInputStream(type: string, inputStream: any): MSStream; + execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; + execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; + getCurrentPriority(): string; + getHtmlPrintDocumentSourceAsync(htmlDoc: any): any; + getViewId(view: any): any; + isTaskScheduledAtPriorityOrHigher(priority: string): boolean; + pageHandlesAllApplicationActivations(enabled: boolean): void; + suppressSubdownloadCredentialPrompts(suppress: boolean): void; + terminateApp(exceptionObject: any): void; + CURRENT: string; + HIGH: string; + IDLE: string; + NORMAL: string; } +declare var MSApp: MSApp; -interface Attr extends Node { - expando: boolean; - specified: boolean; - ownerElement: Element; - value: string; - name: string; -} -declare var Attr: { - prototype: Attr; - new(): Attr; -} - -interface PerformanceNavigation { - redirectCount: number; - type: number; - toJSON(): any; - TYPE_RELOAD: number; - TYPE_RESERVED: number; - TYPE_BACK_FORWARD: number; - TYPE_NAVIGATE: number; -} -declare var PerformanceNavigation: { - prototype: PerformanceNavigation; - new(): PerformanceNavigation; - TYPE_RELOAD: number; - TYPE_RESERVED: number; - TYPE_BACK_FORWARD: number; - TYPE_NAVIGATE: number; -} - -interface SVGStopElement extends SVGElement, SVGStylable { - offset: SVGAnimatedNumber; -} -declare var SVGStopElement: { - prototype: SVGStopElement; - new(): SVGStopElement; -} - -interface PositionCallback { - (position: Position): void; -} - -interface SVGSymbolElement extends SVGElement, SVGStylable, SVGLangSpace, SVGFitToViewBox, SVGExternalResourcesRequired { -} -declare var SVGSymbolElement: { - prototype: SVGSymbolElement; - new(): SVGSymbolElement; -} - -interface SVGElementInstanceList { - length: number; - item(index: number): SVGElementInstance; -} -declare var SVGElementInstanceList: { - prototype: SVGElementInstanceList; - new(): SVGElementInstanceList; -} - -interface CSSRuleList { - length: number; - item(index: number): CSSRule; - [index: number]: CSSRule; -} -declare var CSSRuleList: { - prototype: CSSRuleList; - new(): CSSRuleList; -} - -interface MSDataBindingRecordSetExtensions { - recordset: any; - namedRecordset(dataMember: string, hierarchy?: any): any; -} - -interface LinkStyle { - styleSheet: StyleSheet; - sheet: StyleSheet; -} - -interface HTMLVideoElement extends HTMLMediaElement { - /** - * Gets or sets the width of the video element. - */ - width: number; - /** - * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known. - */ - videoWidth: number; - /** - * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known. - */ - videoHeight: number; - /** - * Gets or sets the height of the video element. - */ - height: number; - /** - * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available. - */ - poster: string; - msIsStereo3D: boolean; - msStereo3DPackingMode: string; - onMSVideoOptimalLayoutChanged: (ev: any) => any; - onMSVideoFrameStepCompleted: (ev: any) => any; - msStereo3DRenderMode: string; - msIsLayoutOptimalForPlayback: boolean; - msHorizontalMirror: boolean; - onMSVideoFormatChanged: (ev: any) => any; - msZoom: boolean; - msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; - msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void; - msFrameStep(forward: boolean): void; - getVideoPlaybackQuality(): VideoPlaybackQuality; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; +interface MSAppAsyncOperation extends EventTarget { + error: DOMError; + oncomplete: (ev: Event) => any; + onerror: (ev: Event) => any; + readyState: number; + result: any; + start(): void; + COMPLETED: number; + ERROR: number; + STARTED: number; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoOptimalLayoutChanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoFrameStepCompleted", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoFormatChanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLVideoElement: { - prototype: HTMLVideoElement; - new(): HTMLVideoElement; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface ClientRectList { - length: number; - item(index: number): ClientRect; - [index: number]: ClientRect; -} -declare var ClientRectList: { - prototype: ClientRectList; - new(): ClientRectList; +declare var MSAppAsyncOperation: { + prototype: MSAppAsyncOperation; + new(): MSAppAsyncOperation; + COMPLETED: number; + ERROR: number; + STARTED: number; } -interface SVGMaskElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - maskUnits: SVGAnimatedEnumeration; - maskContentUnits: SVGAnimatedEnumeration; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGMaskElement: { - prototype: SVGMaskElement; - new(): SVGMaskElement; +interface MSBlobBuilder { + append(data: any, endings?: string): void; + getBlob(contentType?: string): Blob; } -interface External { -} -declare var External: { - prototype: External; - new(): External; +declare var MSBlobBuilder: { + prototype: MSBlobBuilder; + new(): MSBlobBuilder; } -interface MSGestureEvent extends UIEvent { - offsetY: number; - translationY: number; - velocityExpansion: number; - velocityY: number; - velocityAngular: number; - translationX: number; - velocityX: number; - hwTimestamp: number; - offsetX: number; - screenX: number; - rotation: number; - expansion: number; - clientY: number; - screenY: number; - scale: number; - gestureObject: any; - clientX: number; - initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void; - MSGESTURE_FLAG_BEGIN: number; - MSGESTURE_FLAG_END: number; - MSGESTURE_FLAG_CANCEL: number; - MSGESTURE_FLAG_INERTIA: number; - MSGESTURE_FLAG_NONE: number; -} -declare var MSGestureEvent: { - prototype: MSGestureEvent; - new(): MSGestureEvent; - MSGESTURE_FLAG_BEGIN: number; - MSGESTURE_FLAG_END: number; - MSGESTURE_FLAG_CANCEL: number; - MSGESTURE_FLAG_INERTIA: number; - MSGESTURE_FLAG_NONE: number; +interface MSCSSMatrix { + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + m11: number; + m12: number; + m13: number; + m14: number; + m21: number; + m22: number; + m23: number; + m24: number; + m31: number; + m32: number; + m33: number; + m34: number; + m41: number; + m42: number; + m43: number; + m44: number; + inverse(): MSCSSMatrix; + multiply(secondMatrix: MSCSSMatrix): MSCSSMatrix; + rotate(angleX: number, angleY?: number, angleZ?: number): MSCSSMatrix; + rotateAxisAngle(x: number, y: number, z: number, angle: number): MSCSSMatrix; + scale(scaleX: number, scaleY?: number, scaleZ?: number): MSCSSMatrix; + setMatrixValue(value: string): void; + skewX(angle: number): MSCSSMatrix; + skewY(angle: number): MSCSSMatrix; + toString(): string; + translate(x: number, y: number, z?: number): MSCSSMatrix; } -interface ErrorEvent extends Event { - colno: number; - filename: string; - error: any; - lineno: number; - message: string; - initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; -} -declare var ErrorEvent: { - prototype: ErrorEvent; - new(): ErrorEvent; -} - -interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - filterResX: SVGAnimatedInteger; - filterUnits: SVGAnimatedEnumeration; - primitiveUnits: SVGAnimatedEnumeration; - x: SVGAnimatedLength; - height: SVGAnimatedLength; - filterResY: SVGAnimatedInteger; - setFilterRes(filterResX: number, filterResY: number): void; -} -declare var SVGFilterElement: { - prototype: SVGFilterElement; - new(): SVGFilterElement; -} - -interface TrackEvent extends Event { - track: any; -} -declare var TrackEvent: { - prototype: TrackEvent; - new(): TrackEvent; -} - -interface SVGFEMergeNodeElement extends SVGElement { - in1: SVGAnimatedString; -} -declare var SVGFEMergeNodeElement: { - prototype: SVGFEMergeNodeElement; - new(): SVGFEMergeNodeElement; -} - -interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { -} -declare var SVGFEFloodElement: { - prototype: SVGFEFloodElement; - new(): SVGFEFloodElement; +declare var MSCSSMatrix: { + prototype: MSCSSMatrix; + new(text?: string): MSCSSMatrix; } interface MSGesture { @@ -9170,118 +7192,472 @@ interface MSGesture { addPointer(pointerId: number): void; stop(): void; } + declare var MSGesture: { prototype: MSGesture; new(): MSGesture; } -interface TextTrackCue extends EventTarget { - onenter: (ev: Event) => any; - track: TextTrack; - endTime: number; - text: string; - pauseOnExit: boolean; - id: string; - startTime: number; - onexit: (ev: Event) => any; - getCueAsHTML(): DocumentFragment; - addEventListener(type: "enter", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "exit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var TextTrackCue: { - prototype: TextTrackCue; - new(startTime: number, endTime: number, text: string): TextTrackCue; +interface MSGestureEvent extends UIEvent { + clientX: number; + clientY: number; + expansion: number; + gestureObject: any; + hwTimestamp: number; + offsetX: number; + offsetY: number; + rotation: number; + scale: number; + screenX: number; + screenY: number; + translationX: number; + translationY: number; + velocityAngular: number; + velocityExpansion: number; + velocityX: number; + velocityY: number; + initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void; + MSGESTURE_FLAG_BEGIN: number; + MSGESTURE_FLAG_CANCEL: number; + MSGESTURE_FLAG_END: number; + MSGESTURE_FLAG_INERTIA: number; + MSGESTURE_FLAG_NONE: number; } -interface MSStreamReader extends MSBaseReader { +declare var MSGestureEvent: { + prototype: MSGestureEvent; + new(): MSGestureEvent; + MSGESTURE_FLAG_BEGIN: number; + MSGESTURE_FLAG_CANCEL: number; + MSGESTURE_FLAG_END: number; + MSGESTURE_FLAG_INERTIA: number; + MSGESTURE_FLAG_NONE: number; +} + +interface MSGraphicsTrust { + constrictionActive: boolean; + status: string; +} + +declare var MSGraphicsTrust: { + prototype: MSGraphicsTrust; + new(): MSGraphicsTrust; +} + +interface MSHTMLWebViewElement extends HTMLElement { + canGoBack: boolean; + canGoForward: boolean; + containsFullScreenElement: boolean; + documentTitle: string; + height: number; + settings: MSWebViewSettings; + src: string; + width: number; + addWebAllowedObject(name: string, applicationObject: any): void; + buildLocalStreamUri(contentIdentifier: string, relativePath: string): string; + capturePreviewToBlobAsync(): MSWebViewAsyncOperation; + captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation; + getDeferredPermissionRequestById(id: number): DeferredPermissionRequest; + getDeferredPermissionRequests(): DeferredPermissionRequest[]; + goBack(): void; + goForward(): void; + invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation; + navigate(uri: string): void; + navigateToLocalStreamUri(source: string, streamResolver: any): void; + navigateToString(contents: string): void; + navigateWithHttpRequestMessage(requestMessage: any): void; + refresh(): void; + stop(): void; +} + +declare var MSHTMLWebViewElement: { + prototype: MSHTMLWebViewElement; + new(): MSHTMLWebViewElement; +} + +interface MSHeaderFooter { + URL: string; + dateLong: string; + dateShort: string; + font: string; + htmlFoot: string; + htmlHead: string; + page: number; + pageTotal: number; + textFoot: string; + textHead: string; + timeLong: string; + timeShort: string; + title: string; +} + +declare var MSHeaderFooter: { + prototype: MSHeaderFooter; + new(): MSHeaderFooter; +} + +interface MSInputMethodContext extends EventTarget { + compositionEndOffset: number; + compositionStartOffset: number; + oncandidatewindowhide: (ev: Event) => any; + oncandidatewindowshow: (ev: Event) => any; + oncandidatewindowupdate: (ev: Event) => any; + target: HTMLElement; + getCandidateWindowClientRect(): ClientRect; + getCompositionAlternatives(): string[]; + hasComposition(): boolean; + isCandidateWindowVisible(): boolean; + addEventListener(type: "MSCandidateWindowHide", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "MSCandidateWindowShow", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "MSCandidateWindowUpdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSInputMethodContext: { + prototype: MSInputMethodContext; + new(): MSInputMethodContext; +} + +interface MSManipulationEvent extends UIEvent { + currentState: number; + inertiaDestinationX: number; + inertiaDestinationY: number; + lastState: number; + initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void; + MS_MANIPULATION_STATE_ACTIVE: number; + MS_MANIPULATION_STATE_CANCELLED: number; + MS_MANIPULATION_STATE_COMMITTED: number; + MS_MANIPULATION_STATE_DRAGGING: number; + MS_MANIPULATION_STATE_INERTIA: number; + MS_MANIPULATION_STATE_PRESELECT: number; + MS_MANIPULATION_STATE_SELECTING: number; + MS_MANIPULATION_STATE_STOPPED: number; +} + +declare var MSManipulationEvent: { + prototype: MSManipulationEvent; + new(): MSManipulationEvent; + MS_MANIPULATION_STATE_ACTIVE: number; + MS_MANIPULATION_STATE_CANCELLED: number; + MS_MANIPULATION_STATE_COMMITTED: number; + MS_MANIPULATION_STATE_DRAGGING: number; + MS_MANIPULATION_STATE_INERTIA: number; + MS_MANIPULATION_STATE_PRESELECT: number; + MS_MANIPULATION_STATE_SELECTING: number; + MS_MANIPULATION_STATE_STOPPED: number; +} + +interface MSMediaKeyError { + code: number; + systemCode: number; + MS_MEDIA_KEYERR_CLIENT: number; + MS_MEDIA_KEYERR_DOMAIN: number; + MS_MEDIA_KEYERR_HARDWARECHANGE: number; + MS_MEDIA_KEYERR_OUTPUT: number; + MS_MEDIA_KEYERR_SERVICE: number; + MS_MEDIA_KEYERR_UNKNOWN: number; +} + +declare var MSMediaKeyError: { + prototype: MSMediaKeyError; + new(): MSMediaKeyError; + MS_MEDIA_KEYERR_CLIENT: number; + MS_MEDIA_KEYERR_DOMAIN: number; + MS_MEDIA_KEYERR_HARDWARECHANGE: number; + MS_MEDIA_KEYERR_OUTPUT: number; + MS_MEDIA_KEYERR_SERVICE: number; + MS_MEDIA_KEYERR_UNKNOWN: number; +} + +interface MSMediaKeyMessageEvent extends Event { + destinationURL: string; + message: Uint8Array; +} + +declare var MSMediaKeyMessageEvent: { + prototype: MSMediaKeyMessageEvent; + new(): MSMediaKeyMessageEvent; +} + +interface MSMediaKeyNeededEvent extends Event { + initData: Uint8Array; +} + +declare var MSMediaKeyNeededEvent: { + prototype: MSMediaKeyNeededEvent; + new(): MSMediaKeyNeededEvent; +} + +interface MSMediaKeySession extends EventTarget { + error: MSMediaKeyError; + keySystem: string; + sessionId: string; + close(): void; + update(key: Uint8Array): void; +} + +declare var MSMediaKeySession: { + prototype: MSMediaKeySession; + new(): MSMediaKeySession; +} + +interface MSMediaKeys { + keySystem: string; + createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession; +} + +declare var MSMediaKeys: { + prototype: MSMediaKeys; + new(keySystem: string): MSMediaKeys; + isTypeSupported(keySystem: string, type?: string): boolean; +} + +interface MSMimeTypesCollection { + length: number; +} + +declare var MSMimeTypesCollection: { + prototype: MSMimeTypesCollection; + new(): MSMimeTypesCollection; +} + +interface MSPluginsCollection { + length: number; + refresh(reload?: boolean): void; +} + +declare var MSPluginsCollection: { + prototype: MSPluginsCollection; + new(): MSPluginsCollection; +} + +interface MSPointerEvent extends MouseEvent { + currentPoint: any; + height: number; + hwTimestamp: number; + intermediatePoints: any; + isPrimary: boolean; + pointerId: number; + pointerType: any; + pressure: number; + rotation: number; + tiltX: number; + tiltY: number; + width: number; + getCurrentPoint(element: Element): void; + getIntermediatePoints(element: Element): void; + initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; +} + +declare var MSPointerEvent: { + prototype: MSPointerEvent; + new(typeArg: string, eventInitDict?: PointerEventInit): MSPointerEvent; +} + +interface MSPrintManagerTemplatePrinter extends MSTemplatePrinter, EventTarget { + percentScale: number; + showHeaderFooter: boolean; + shrinkToFit: boolean; + drawPreviewPage(element: HTMLElement, pageNumber: number): void; + endPrint(): void; + getPrintTaskOptionValue(key: string): any; + invalidatePreview(): void; + setPageCount(pageCount: number): void; + startPrint(): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSPrintManagerTemplatePrinter: { + prototype: MSPrintManagerTemplatePrinter; + new(): MSPrintManagerTemplatePrinter; +} + +interface MSRangeCollection { + length: number; + item(index: number): Range; + [index: number]: Range; +} + +declare var MSRangeCollection: { + prototype: MSRangeCollection; + new(): MSRangeCollection; +} + +interface MSSiteModeEvent extends Event { + actionURL: string; + buttonID: number; +} + +declare var MSSiteModeEvent: { + prototype: MSSiteModeEvent; + new(): MSSiteModeEvent; +} + +interface MSStream { + type: string; + msClose(): void; + msDetachStream(): any; +} + +declare var MSStream: { + prototype: MSStream; + new(): MSStream; +} + +interface MSStreamReader extends EventTarget, MSBaseReader { error: DOMError; readAsArrayBuffer(stream: MSStream, size?: number): void; + readAsBinaryString(stream: MSStream, size?: number): void; readAsBlob(stream: MSStream, size?: number): void; readAsDataURL(stream: MSStream, size?: number): void; readAsText(stream: MSStream, encoding?: string, size?: number): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var MSStreamReader: { prototype: MSStreamReader; new(): MSStreamReader; } -interface DOMTokenList { +interface MSTemplatePrinter { + collate: boolean; + copies: number; + currentPage: boolean; + currentPageAvail: boolean; + duplex: boolean; + footer: string; + frameActive: boolean; + frameActiveEnabled: boolean; + frameAsShown: boolean; + framesetDocument: boolean; + header: string; + headerFooterFont: string; + marginBottom: number; + marginLeft: number; + marginRight: number; + marginTop: number; + orientation: string; + pageFrom: number; + pageHeight: number; + pageTo: number; + pageWidth: number; + selectedPages: boolean; + selection: boolean; + selectionEnabled: boolean; + unprintableBottom: number; + unprintableLeft: number; + unprintableRight: number; + unprintableTop: number; + usePrinterCopyCollate: boolean; + createHeaderFooter(): MSHeaderFooter; + deviceSupports(property: string): any; + ensurePrintDialogDefaults(): boolean; + getPageMarginBottom(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; + getPageMarginBottomImportant(pageRule: CSSPageRule): boolean; + getPageMarginLeft(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; + getPageMarginLeftImportant(pageRule: CSSPageRule): boolean; + getPageMarginRight(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; + getPageMarginRightImportant(pageRule: CSSPageRule): boolean; + getPageMarginTop(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; + getPageMarginTopImportant(pageRule: CSSPageRule): boolean; + printBlankPage(): void; + printNonNative(document: any): boolean; + printNonNativeFrames(document: any, activeFrame: boolean): void; + printPage(element: HTMLElement): void; + showPageSetupDialog(): boolean; + showPrintDialog(): boolean; + startDoc(title: string): boolean; + stopDoc(): void; + updatePageStatus(status: number): void; +} + +declare var MSTemplatePrinter: { + prototype: MSTemplatePrinter; + new(): MSTemplatePrinter; +} + +interface MSWebViewAsyncOperation extends EventTarget { + error: DOMError; + oncomplete: (ev: Event) => any; + onerror: (ev: Event) => any; + readyState: number; + result: any; + target: MSHTMLWebViewElement; + type: number; + start(): void; + COMPLETED: number; + ERROR: number; + STARTED: number; + TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; + TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; + TYPE_INVOKE_SCRIPT: number; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSWebViewAsyncOperation: { + prototype: MSWebViewAsyncOperation; + new(): MSWebViewAsyncOperation; + COMPLETED: number; + ERROR: number; + STARTED: number; + TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; + TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; + TYPE_INVOKE_SCRIPT: number; +} + +interface MSWebViewSettings { + isIndexedDBEnabled: boolean; + isJavaScriptEnabled: boolean; +} + +declare var MSWebViewSettings: { + prototype: MSWebViewSettings; + new(): MSWebViewSettings; +} + +interface MediaElementAudioSourceNode extends AudioNode { +} + +declare var MediaElementAudioSourceNode: { + prototype: MediaElementAudioSourceNode; + new(): MediaElementAudioSourceNode; +} + +interface MediaError { + code: number; + msExtendedCode: number; + MEDIA_ERR_ABORTED: number; + MEDIA_ERR_DECODE: number; + MEDIA_ERR_NETWORK: number; + MEDIA_ERR_SRC_NOT_SUPPORTED: number; + MS_MEDIA_ERR_ENCRYPTED: number; +} + +declare var MediaError: { + prototype: MediaError; + new(): MediaError; + MEDIA_ERR_ABORTED: number; + MEDIA_ERR_DECODE: number; + MEDIA_ERR_NETWORK: number; + MEDIA_ERR_SRC_NOT_SUPPORTED: number; + MS_MEDIA_ERR_ENCRYPTED: number; +} + +interface MediaList { length: number; - contains(token: string): boolean; - remove(token: string): void; - toggle(token: string): boolean; - add(token: string): void; + mediaText: string; + appendMedium(newMedium: string): void; + deleteMedium(oldMedium: string): void; item(index: number): string; - [index: number]: string; toString(): string; -} -declare var DOMTokenList: { - prototype: DOMTokenList; - new(): DOMTokenList; + [index: number]: string; } -interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncAElement: { - prototype: SVGFEFuncAElement; - new(): SVGFEFuncAElement; -} - -interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; -} -declare var SVGFETileElement: { - prototype: SVGFETileElement; - new(): SVGFETileElement; -} - -interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in2: SVGAnimatedString; - mode: SVGAnimatedEnumeration; - in1: SVGAnimatedString; - SVG_FEBLEND_MODE_DARKEN: number; - SVG_FEBLEND_MODE_UNKNOWN: number; - SVG_FEBLEND_MODE_MULTIPLY: number; - SVG_FEBLEND_MODE_NORMAL: number; - SVG_FEBLEND_MODE_SCREEN: number; - SVG_FEBLEND_MODE_LIGHTEN: number; -} -declare var SVGFEBlendElement: { - prototype: SVGFEBlendElement; - new(): SVGFEBlendElement; - SVG_FEBLEND_MODE_DARKEN: number; - SVG_FEBLEND_MODE_UNKNOWN: number; - SVG_FEBLEND_MODE_MULTIPLY: number; - SVG_FEBLEND_MODE_NORMAL: number; - SVG_FEBLEND_MODE_SCREEN: number; - SVG_FEBLEND_MODE_LIGHTEN: number; -} - -interface MessageChannel { - port2: MessagePort; - port1: MessagePort; -} -declare var MessageChannel: { - prototype: MessageChannel; - new(): MessageChannel; -} - -interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { -} -declare var SVGFEMergeElement: { - prototype: SVGFEMergeElement; - new(): SVGFEMergeElement; -} - -interface TransitionEvent extends Event { - propertyName: string; - elapsedTime: number; - initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void; -} -declare var TransitionEvent: { - prototype: TransitionEvent; - new(): TransitionEvent; +declare var MediaList: { + prototype: MediaList; + new(): MediaList; } interface MediaQueryList { @@ -9290,734 +7666,49 @@ interface MediaQueryList { addListener(listener: MediaQueryListListener): void; removeListener(listener: MediaQueryListListener): void; } + declare var MediaQueryList: { prototype: MediaQueryList; new(): MediaQueryList; } -interface DOMError { - name: string; - toString(): string; -} -declare var DOMError: { - prototype: DOMError; - new(): DOMError; -} - -interface CloseEvent extends Event { - wasClean: boolean; - reason: string; - code: number; - initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; -} -declare var CloseEvent: { - prototype: CloseEvent; - new(): CloseEvent; -} - -interface WebSocket extends EventTarget { - protocol: string; - readyState: number; - bufferedAmount: number; - onopen: (ev: Event) => any; - extensions: string; - onmessage: (ev: MessageEvent) => any; - onclose: (ev: CloseEvent) => any; - onerror: (ev: ErrorEvent) => any; - binaryType: string; - url: string; - close(code?: number, reason?: string): void; - send(data: any): void; - OPEN: number; - CLOSING: number; - CONNECTING: number; - CLOSED: number; - addEventListener(type: "open", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "close", listener: (ev: CloseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var WebSocket: { - prototype: WebSocket; - new(url: string, protocols?: string): WebSocket; - new(url: string, protocols?: string[]): WebSocket; - OPEN: number; - CLOSING: number; - CONNECTING: number; - CLOSED: number; -} - -interface SVGFEPointLightElement extends SVGElement { - y: SVGAnimatedNumber; - x: SVGAnimatedNumber; - z: SVGAnimatedNumber; -} -declare var SVGFEPointLightElement: { - prototype: SVGFEPointLightElement; - new(): SVGFEPointLightElement; -} - -interface ProgressEvent extends Event { - loaded: number; - lengthComputable: boolean; - total: number; - initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; -} -declare var ProgressEvent: { - prototype: ProgressEvent; - new(): ProgressEvent; -} - -interface IDBObjectStore { - indexNames: DOMStringList; - name: string; - transaction: IDBTransaction; - keyPath: string; - count(key?: any): IDBRequest; - add(value: any, key?: any): IDBRequest; - clear(): IDBRequest; - createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; - put(value: any, key?: any): IDBRequest; - openCursor(range?: any, direction?: string): IDBRequest; - deleteIndex(indexName: string): void; - index(name: string): IDBIndex; - get(key: any): IDBRequest; - delete(key: any): IDBRequest; -} -declare var IDBObjectStore: { - prototype: IDBObjectStore; - new(): IDBObjectStore; -} - -interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - stdDeviationX: SVGAnimatedNumber; - in1: SVGAnimatedString; - stdDeviationY: SVGAnimatedNumber; - setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; -} -declare var SVGFEGaussianBlurElement: { - prototype: SVGFEGaussianBlurElement; - new(): SVGFEGaussianBlurElement; -} - -interface SVGFilterPrimitiveStandardAttributes extends SVGStylable { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - height: SVGAnimatedLength; - result: SVGAnimatedString; -} - -interface IDBVersionChangeEvent extends Event { - newVersion: number; - oldVersion: number; -} -declare var IDBVersionChangeEvent: { - prototype: IDBVersionChangeEvent; - new(): IDBVersionChangeEvent; -} - -interface IDBIndex { - unique: boolean; - name: string; - keyPath: string; - objectStore: IDBObjectStore; - count(key?: any): IDBRequest; - getKey(key: any): IDBRequest; - openKeyCursor(range?: IDBKeyRange, direction?: string): IDBRequest; - get(key: any): IDBRequest; - openCursor(range?: IDBKeyRange, direction?: string): IDBRequest; -} -declare var IDBIndex: { - prototype: IDBIndex; - new(): IDBIndex; -} - -interface FileList { - length: number; - item(index: number): File; - [index: number]: File; -} -declare var FileList: { - prototype: FileList; - new(): FileList; -} - -interface IDBCursor { - source: any; - direction: string; - key: any; - primaryKey: any; - advance(count: number): void; - delete(): IDBRequest; - continue(key?: any): void; - update(value: any): IDBRequest; - PREV: string; - PREV_NO_DUPLICATE: string; - NEXT: string; - NEXT_NO_DUPLICATE: string; -} -declare var IDBCursor: { - prototype: IDBCursor; - new(): IDBCursor; - PREV: string; - PREV_NO_DUPLICATE: string; - NEXT: string; - NEXT_NO_DUPLICATE: string; -} - -interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - kernelUnitLengthY: SVGAnimatedNumber; - surfaceScale: SVGAnimatedNumber; - specularExponent: SVGAnimatedNumber; - in1: SVGAnimatedString; - kernelUnitLengthX: SVGAnimatedNumber; - specularConstant: SVGAnimatedNumber; -} -declare var SVGFESpecularLightingElement: { - prototype: SVGFESpecularLightingElement; - new(): SVGFESpecularLightingElement; -} - -interface File extends Blob { - lastModifiedDate: any; - name: string; -} -declare var File: { - prototype: File; - new(): File; -} - -interface URL { - revokeObjectURL(url: string): void; - createObjectURL(object: any, options?: ObjectURLOptions): string; -} -declare var URL: URL; - -interface IDBCursorWithValue extends IDBCursor { - value: any; -} -declare var IDBCursorWithValue: { - prototype: IDBCursorWithValue; - new(): IDBCursorWithValue; -} - -interface XMLHttpRequestEventTarget extends EventTarget { - onprogress: (ev: ProgressEvent) => any; - onerror: (ev: ErrorEvent) => any; - onload: (ev: Event) => any; - ontimeout: (ev: Event) => any; - onabort: (ev: UIEvent) => any; - onloadstart: (ev: Event) => any; - onloadend: (ev: ProgressEvent) => any; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var XMLHttpRequestEventTarget: { - prototype: XMLHttpRequestEventTarget; - new(): XMLHttpRequestEventTarget; -} - -interface IDBEnvironment { - msIndexedDB: IDBFactory; - indexedDB: IDBFactory; -} - -interface AudioTrackList extends EventTarget { - length: number; - onchange: (ev: Event) => any; - onaddtrack: (ev: TrackEvent) => any; - onremovetrack: (ev: any /*PluginArray*/) => any; - getTrackById(id: string): AudioTrack; - item(index: number): AudioTrack; - [index: number]: AudioTrack; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: "removetrack", listener: (ev: any /*PluginArray*/) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var AudioTrackList: { - prototype: AudioTrackList; - new(): AudioTrackList; -} - -interface MSBaseReader extends EventTarget { - onprogress: (ev: ProgressEvent) => any; - readyState: number; - onabort: (ev: UIEvent) => any; - onloadend: (ev: ProgressEvent) => any; - onerror: (ev: ErrorEvent) => any; - onload: (ev: Event) => any; - onloadstart: (ev: Event) => any; - result: any; - abort(): void; - LOADING: number; - EMPTY: number; - DONE: number; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - operator: SVGAnimatedEnumeration; - radiusX: SVGAnimatedNumber; - radiusY: SVGAnimatedNumber; - in1: SVGAnimatedString; - SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; - SVG_MORPHOLOGY_OPERATOR_ERODE: number; - SVG_MORPHOLOGY_OPERATOR_DILATE: number; -} -declare var SVGFEMorphologyElement: { - prototype: SVGFEMorphologyElement; - new(): SVGFEMorphologyElement; - SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; - SVG_MORPHOLOGY_OPERATOR_ERODE: number; - SVG_MORPHOLOGY_OPERATOR_DILATE: number; -} - -interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncRElement: { - prototype: SVGFEFuncRElement; - new(): SVGFEFuncRElement; -} - -interface WindowTimersExtension { - msSetImmediate(expression: any, ...args: any[]): number; - clearImmediate(handle: number): void; - msClearImmediate(handle: number): void; - setImmediate(expression: any, ...args: any[]): number; -} - -interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in2: SVGAnimatedString; - xChannelSelector: SVGAnimatedEnumeration; - yChannelSelector: SVGAnimatedEnumeration; - scale: SVGAnimatedNumber; - in1: SVGAnimatedString; - SVG_CHANNEL_B: number; - SVG_CHANNEL_R: number; - SVG_CHANNEL_G: number; - SVG_CHANNEL_UNKNOWN: number; - SVG_CHANNEL_A: number; -} -declare var SVGFEDisplacementMapElement: { - prototype: SVGFEDisplacementMapElement; - new(): SVGFEDisplacementMapElement; - SVG_CHANNEL_B: number; - SVG_CHANNEL_R: number; - SVG_CHANNEL_G: number; - SVG_CHANNEL_UNKNOWN: number; - SVG_CHANNEL_A: number; -} - -interface AnimationEvent extends Event { - animationName: string; - elapsedTime: number; - initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void; -} -declare var AnimationEvent: { - prototype: AnimationEvent; - new(): AnimationEvent; -} - -interface SVGComponentTransferFunctionElement extends SVGElement { - tableValues: SVGAnimatedNumberList; - slope: SVGAnimatedNumber; - type: SVGAnimatedEnumeration; - exponent: SVGAnimatedNumber; - amplitude: SVGAnimatedNumber; - intercept: SVGAnimatedNumber; - offset: SVGAnimatedNumber; - SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; - SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; -} -declare var SVGComponentTransferFunctionElement: { - prototype: SVGComponentTransferFunctionElement; - new(): SVGComponentTransferFunctionElement; - SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; - SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; -} - -interface MSRangeCollection { - length: number; - item(index: number): Range; - [index: number]: Range; -} -declare var MSRangeCollection: { - prototype: MSRangeCollection; - new(): MSRangeCollection; -} - -interface SVGFEDistantLightElement extends SVGElement { - azimuth: SVGAnimatedNumber; - elevation: SVGAnimatedNumber; -} -declare var SVGFEDistantLightElement: { - prototype: SVGFEDistantLightElement; - new(): SVGFEDistantLightElement; -} - -interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncBElement: { - prototype: SVGFEFuncBElement; - new(): SVGFEFuncBElement; -} - -interface IDBKeyRange { - upper: any; - upperOpen: boolean; - lower: any; - lowerOpen: boolean; -} -declare var IDBKeyRange: { - prototype: IDBKeyRange; - new(): IDBKeyRange; - bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; - only(value: any): IDBKeyRange; - lowerBound(bound: any, open?: boolean): IDBKeyRange; - upperBound(bound: any, open?: boolean): IDBKeyRange; -} - -interface WindowConsole { - console: Console; -} - -interface IDBTransaction extends EventTarget { - oncomplete: (ev: Event) => any; - db: IDBDatabase; - mode: string; - error: DOMError; - onerror: (ev: ErrorEvent) => any; - onabort: (ev: UIEvent) => any; - abort(): void; - objectStore(name: string): IDBObjectStore; - READ_ONLY: string; - VERSION_CHANGE: string; - READ_WRITE: string; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBTransaction: { - prototype: IDBTransaction; - new(): IDBTransaction; - READ_ONLY: string; - VERSION_CHANGE: string; - READ_WRITE: string; -} - -interface AudioTrack { - kind: string; - language: string; - id: string; - label: string; - enabled: boolean; - sourceBuffer: SourceBuffer; -} -declare var AudioTrack: { - prototype: AudioTrack; - new(): AudioTrack; -} - -interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - orderY: SVGAnimatedInteger; - kernelUnitLengthY: SVGAnimatedNumber; - orderX: SVGAnimatedInteger; - preserveAlpha: SVGAnimatedBoolean; - kernelMatrix: SVGAnimatedNumberList; - edgeMode: SVGAnimatedEnumeration; - kernelUnitLengthX: SVGAnimatedNumber; - bias: SVGAnimatedNumber; - targetX: SVGAnimatedInteger; - targetY: SVGAnimatedInteger; - divisor: SVGAnimatedNumber; - in1: SVGAnimatedString; - SVG_EDGEMODE_WRAP: number; - SVG_EDGEMODE_DUPLICATE: number; - SVG_EDGEMODE_UNKNOWN: number; - SVG_EDGEMODE_NONE: number; -} -declare var SVGFEConvolveMatrixElement: { - prototype: SVGFEConvolveMatrixElement; - new(): SVGFEConvolveMatrixElement; - SVG_EDGEMODE_WRAP: number; - SVG_EDGEMODE_DUPLICATE: number; - SVG_EDGEMODE_UNKNOWN: number; - SVG_EDGEMODE_NONE: number; -} - -interface TextTrackCueList { - length: number; - item(index: number): TextTrackCue; - [index: number]: TextTrackCue; - getCueById(id: string): TextTrackCue; -} -declare var TextTrackCueList: { - prototype: TextTrackCueList; - new(): TextTrackCueList; -} - -interface CSSKeyframesRule extends CSSRule { - name: string; - cssRules: CSSRuleList; - findRule(rule: string): CSSKeyframeRule; - deleteRule(rule: string): void; - appendRule(rule: string): void; -} -declare var CSSKeyframesRule: { - prototype: CSSKeyframesRule; - new(): CSSKeyframesRule; -} - -interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - baseFrequencyX: SVGAnimatedNumber; - numOctaves: SVGAnimatedInteger; - type: SVGAnimatedEnumeration; - baseFrequencyY: SVGAnimatedNumber; - stitchTiles: SVGAnimatedEnumeration; - seed: SVGAnimatedNumber; - SVG_STITCHTYPE_UNKNOWN: number; - SVG_STITCHTYPE_NOSTITCH: number; - SVG_TURBULENCE_TYPE_UNKNOWN: number; - SVG_TURBULENCE_TYPE_TURBULENCE: number; - SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - SVG_STITCHTYPE_STITCH: number; -} -declare var SVGFETurbulenceElement: { - prototype: SVGFETurbulenceElement; - new(): SVGFETurbulenceElement; - SVG_STITCHTYPE_UNKNOWN: number; - SVG_STITCHTYPE_NOSTITCH: number; - SVG_TURBULENCE_TYPE_UNKNOWN: number; - SVG_TURBULENCE_TYPE_TURBULENCE: number; - SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - SVG_STITCHTYPE_STITCH: number; -} - -interface TextTrackList extends EventTarget { - length: number; - onaddtrack: (ev: TrackEvent) => any; - item(index: number): TextTrack; - [index: number]: TextTrack; - addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var TextTrackList: { - prototype: TextTrackList; - new(): TextTrackList; -} - -interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncGElement: { - prototype: SVGFEFuncGElement; - new(): SVGFEFuncGElement; -} - -interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; - type: SVGAnimatedEnumeration; - values: SVGAnimatedNumberList; - SVG_FECOLORMATRIX_TYPE_SATURATE: number; - SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; - SVG_FECOLORMATRIX_TYPE_MATRIX: number; - SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; -} -declare var SVGFEColorMatrixElement: { - prototype: SVGFEColorMatrixElement; - new(): SVGFEColorMatrixElement; - SVG_FECOLORMATRIX_TYPE_SATURATE: number; - SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; - SVG_FECOLORMATRIX_TYPE_MATRIX: number; - SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; -} - -interface SVGFESpotLightElement extends SVGElement { - pointsAtY: SVGAnimatedNumber; - y: SVGAnimatedNumber; - limitingConeAngle: SVGAnimatedNumber; - specularExponent: SVGAnimatedNumber; - x: SVGAnimatedNumber; - pointsAtZ: SVGAnimatedNumber; - z: SVGAnimatedNumber; - pointsAtX: SVGAnimatedNumber; -} -declare var SVGFESpotLightElement: { - prototype: SVGFESpotLightElement; - new(): SVGFESpotLightElement; -} - -interface WindowBase64 { - btoa(rawString: string): string; - atob(encodedString: string): string; -} - -interface IDBDatabase extends EventTarget { - version: string; - name: string; - objectStoreNames: DOMStringList; - onerror: (ev: ErrorEvent) => any; - onabort: (ev: UIEvent) => any; - createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; - close(): void; - transaction(storeNames: any, mode?: string): IDBTransaction; - deleteObjectStore(name: string): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBDatabase: { - prototype: IDBDatabase; - new(): IDBDatabase; -} - -interface DOMStringList { - length: number; - contains(str: string): boolean; - item(index: number): string; - [index: number]: string; -} -declare var DOMStringList: { - prototype: DOMStringList; - new(): DOMStringList; -} - -interface IDBOpenDBRequest extends IDBRequest { - onupgradeneeded: (ev: IDBVersionChangeEvent) => any; - onblocked: (ev: Event) => any; - addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "upgradeneeded", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blocked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBOpenDBRequest: { - prototype: IDBOpenDBRequest; - new(): IDBOpenDBRequest; -} - -interface HTMLProgressElement extends HTMLElement { - /** - * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value. - */ - value: number; - /** - * Defines the maximum, or "done" value for a progress element. - */ - max: number; - /** - * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar). - */ - position: number; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; -} -declare var HTMLProgressElement: { - prototype: HTMLProgressElement; - new(): HTMLProgressElement; -} - -interface MSLaunchUriCallback { - (): void; -} - -interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - dy: SVGAnimatedNumber; - in1: SVGAnimatedString; - dx: SVGAnimatedNumber; -} -declare var SVGFEOffsetElement: { - prototype: SVGFEOffsetElement; - new(): SVGFEOffsetElement; -} - -interface MSUnsafeFunctionCallback { - (): any; -} - -interface TextTrack extends EventTarget { - language: string; - mode: any; - readyState: number; - activeCues: TextTrackCueList; - cues: TextTrackCueList; - oncuechange: (ev: Event) => any; - kind: string; - onload: (ev: Event) => any; - onerror: (ev: ErrorEvent) => any; - label: string; - addCue(cue: TextTrackCue): void; - removeCue(cue: TextTrackCue): void; - ERROR: number; - SHOWING: number; - LOADING: number; - LOADED: number; - NONE: number; - HIDDEN: number; - DISABLED: number; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var TextTrack: { - prototype: TextTrack; - new(): TextTrack; - ERROR: number; - SHOWING: number; - LOADING: number; - LOADED: number; - NONE: number; - HIDDEN: number; - DISABLED: number; -} - -interface MediaQueryListListener { - (mql: MediaQueryList): void; -} - -interface IDBRequest extends EventTarget { - source: any; - onsuccess: (ev: Event) => any; - error: DOMError; - transaction: IDBTransaction; - onerror: (ev: ErrorEvent) => any; +interface MediaSource extends EventTarget { + activeSourceBuffers: SourceBufferList; + duration: number; readyState: string; - result: any; - addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + sourceBuffers: SourceBufferList; + addSourceBuffer(type: string): SourceBuffer; + endOfStream(error?: string): void; + removeSourceBuffer(sourceBuffer: SourceBuffer): void; } -declare var IDBRequest: { - prototype: IDBRequest; - new(): IDBRequest; + +declare var MediaSource: { + prototype: MediaSource; + new(): MediaSource; + isTypeSupported(type: string): boolean; +} + +interface MessageChannel { + port1: MessagePort; + port2: MessagePort; +} + +declare var MessageChannel: { + prototype: MessageChannel; + new(): MessageChannel; +} + +interface MessageEvent extends Event { + data: any; + origin: string; + ports: any; + source: Window; + initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void; +} + +declare var MessageEvent: { + prototype: MessageEvent; + new(): MessageEvent; } interface MessagePort extends EventTarget { @@ -10026,2174 +7717,5247 @@ interface MessagePort extends EventTarget { postMessage(message?: any, ports?: any): void; start(): void; addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var MessagePort: { prototype: MessagePort; new(): MessagePort; } -interface FileReader extends MSBaseReader { - error: DOMError; - readAsArrayBuffer(blob: Blob): void; - readAsDataURL(blob: Blob): void; - readAsText(blob: Blob, encoding?: string): void; -} -declare var FileReader: { - prototype: FileReader; - new(): FileReader; +interface MimeType { + description: string; + enabledPlugin: Plugin; + suffixes: string; + type: string; } -interface ApplicationCache extends EventTarget { - status: number; - ondownloading: (ev: Event) => any; - onprogress: (ev: ProgressEvent) => any; - onupdateready: (ev: Event) => any; - oncached: (ev: Event) => any; - onobsolete: (ev: Event) => any; - onerror: (ev: ErrorEvent) => any; - onchecking: (ev: Event) => any; - onnoupdate: (ev: Event) => any; - swapCache(): void; - abort(): void; - update(): void; - CHECKING: number; - UNCACHED: number; - UPDATEREADY: number; - DOWNLOADING: number; - IDLE: number; - OBSOLETE: number; - addEventListener(type: "downloading", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "updateready", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cached", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "obsolete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "checking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "noupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var ApplicationCache: { - prototype: ApplicationCache; - new(): ApplicationCache; - CHECKING: number; - UNCACHED: number; - UPDATEREADY: number; - DOWNLOADING: number; - IDLE: number; - OBSOLETE: number; +declare var MimeType: { + prototype: MimeType; + new(): MimeType; } -interface FrameRequestCallback { - (time: number): void; +interface MimeTypeArray { + length: number; + item(index: number): Plugin; + namedItem(type: string): Plugin; + [index: number]: Plugin; +} + +declare var MimeTypeArray: { + prototype: MimeTypeArray; + new(): MimeTypeArray; +} + +interface MouseEvent extends UIEvent { + altKey: boolean; + button: number; + buttons: number; + clientX: number; + clientY: number; + ctrlKey: boolean; + fromElement: Element; + layerX: number; + layerY: number; + metaKey: boolean; + movementX: number; + movementY: number; + offsetX: number; + offsetY: number; + pageX: number; + pageY: number; + relatedTarget: EventTarget; + screenX: number; + screenY: number; + shiftKey: boolean; + toElement: Element; + which: number; + x: number; + y: number; + getModifierState(keyArg: string): boolean; + initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget): void; +} + +declare var MouseEvent: { + prototype: MouseEvent; + new(typeArg: string, eventInitDict?: MouseEventInit): MouseEvent; +} + +interface MouseWheelEvent extends MouseEvent { + wheelDelta: number; + wheelDeltaX: number; + wheelDeltaY: number; + initMouseWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, wheelDeltaArg: number): void; +} + +declare var MouseWheelEvent: { + prototype: MouseWheelEvent; + new(): MouseWheelEvent; +} + +interface MutationEvent extends Event { + attrChange: number; + attrName: string; + newValue: string; + prevValue: string; + relatedNode: Node; + initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; + ADDITION: number; + MODIFICATION: number; + REMOVAL: number; +} + +declare var MutationEvent: { + prototype: MutationEvent; + new(): MutationEvent; + ADDITION: number; + MODIFICATION: number; + REMOVAL: number; +} + +interface MutationObserver { + disconnect(): void; + observe(target: Node, options: MutationObserverInit): void; + takeRecords(): MutationRecord[]; +} + +declare var MutationObserver: { + prototype: MutationObserver; + new(callback: MutationCallback): MutationObserver; +} + +interface MutationRecord { + addedNodes: NodeList; + attributeName: string; + attributeNamespace: string; + nextSibling: Node; + oldValue: string; + previousSibling: Node; + removedNodes: NodeList; + target: Node; + type: string; +} + +declare var MutationRecord: { + prototype: MutationRecord; + new(): MutationRecord; +} + +interface NamedNodeMap { + length: number; + getNamedItem(name: string): Attr; + getNamedItemNS(namespaceURI: string, localName: string): Attr; + item(index: number): Attr; + removeNamedItem(name: string): Attr; + removeNamedItemNS(namespaceURI: string, localName: string): Attr; + setNamedItem(arg: Attr): Attr; + setNamedItemNS(arg: Attr): Attr; + [index: number]: Attr; +} + +declare var NamedNodeMap: { + prototype: NamedNodeMap; + new(): NamedNodeMap; +} + +interface NavigationCompletedEvent extends NavigationEvent { + isSuccess: boolean; + webErrorStatus: number; +} + +declare var NavigationCompletedEvent: { + prototype: NavigationCompletedEvent; + new(): NavigationCompletedEvent; +} + +interface NavigationEvent extends Event { + uri: string; +} + +declare var NavigationEvent: { + prototype: NavigationEvent; + new(): NavigationEvent; +} + +interface NavigationEventWithReferrer extends NavigationEvent { + referer: string; +} + +declare var NavigationEventWithReferrer: { + prototype: NavigationEventWithReferrer; + new(): NavigationEventWithReferrer; +} + +interface Navigator extends Object, NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, NavigatorGeolocation, MSNavigatorDoNotTrack, MSFileSaver { + appCodeName: string; + appMinorVersion: string; + browserLanguage: string; + connectionSpeed: number; + cookieEnabled: boolean; + cpuClass: string; + language: string; + maxTouchPoints: number; + mimeTypes: MSMimeTypesCollection; + msManipulationViewsEnabled: boolean; + msMaxTouchPoints: number; + msPointerEnabled: boolean; + plugins: MSPluginsCollection; + pointerEnabled: boolean; + systemLanguage: string; + userLanguage: string; + webdriver: boolean; + getGamepads(): Gamepad[]; + javaEnabled(): boolean; + msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Navigator: { + prototype: Navigator; + new(): Navigator; +} + +interface Node extends EventTarget { + attributes: NamedNodeMap; + baseURI: string; + childNodes: NodeList; + firstChild: Node; + lastChild: Node; + localName: string; + namespaceURI: string; + nextSibling: Node; + nodeName: string; + nodeType: number; + nodeValue: string; + ownerDocument: Document; + parentElement: HTMLElement; + parentNode: Node; + prefix: string; + previousSibling: Node; + textContent: string; + appendChild(newChild: Node): Node; + cloneNode(deep?: boolean): Node; + compareDocumentPosition(other: Node): number; + hasAttributes(): boolean; + hasChildNodes(): boolean; + insertBefore(newChild: Node, refChild?: Node): Node; + isDefaultNamespace(namespaceURI: string): boolean; + isEqualNode(arg: Node): boolean; + isSameNode(other: Node): boolean; + lookupNamespaceURI(prefix: string): string; + lookupPrefix(namespaceURI: string): string; + normalize(): void; + removeChild(oldChild: Node): Node; + replaceChild(newChild: Node, oldChild: Node): Node; + ATTRIBUTE_NODE: number; + CDATA_SECTION_NODE: number; + COMMENT_NODE: number; + DOCUMENT_FRAGMENT_NODE: number; + DOCUMENT_NODE: number; + DOCUMENT_POSITION_CONTAINED_BY: number; + DOCUMENT_POSITION_CONTAINS: number; + DOCUMENT_POSITION_DISCONNECTED: number; + DOCUMENT_POSITION_FOLLOWING: number; + DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; + DOCUMENT_POSITION_PRECEDING: number; + DOCUMENT_TYPE_NODE: number; + ELEMENT_NODE: number; + ENTITY_NODE: number; + ENTITY_REFERENCE_NODE: number; + NOTATION_NODE: number; + PROCESSING_INSTRUCTION_NODE: number; + TEXT_NODE: number; +} + +declare var Node: { + prototype: Node; + new(): Node; + ATTRIBUTE_NODE: number; + CDATA_SECTION_NODE: number; + COMMENT_NODE: number; + DOCUMENT_FRAGMENT_NODE: number; + DOCUMENT_NODE: number; + DOCUMENT_POSITION_CONTAINED_BY: number; + DOCUMENT_POSITION_CONTAINS: number; + DOCUMENT_POSITION_DISCONNECTED: number; + DOCUMENT_POSITION_FOLLOWING: number; + DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; + DOCUMENT_POSITION_PRECEDING: number; + DOCUMENT_TYPE_NODE: number; + ELEMENT_NODE: number; + ENTITY_NODE: number; + ENTITY_REFERENCE_NODE: number; + NOTATION_NODE: number; + PROCESSING_INSTRUCTION_NODE: number; + TEXT_NODE: number; +} + +interface NodeFilter { + FILTER_ACCEPT: number; + FILTER_REJECT: number; + FILTER_SKIP: number; + SHOW_ALL: number; + SHOW_ATTRIBUTE: number; + SHOW_CDATA_SECTION: number; + SHOW_COMMENT: number; + SHOW_DOCUMENT: number; + SHOW_DOCUMENT_FRAGMENT: number; + SHOW_DOCUMENT_TYPE: number; + SHOW_ELEMENT: number; + SHOW_ENTITY: number; + SHOW_ENTITY_REFERENCE: number; + SHOW_NOTATION: number; + SHOW_PROCESSING_INSTRUCTION: number; + SHOW_TEXT: number; +} +declare var NodeFilter: NodeFilter; + +interface NodeIterator { + expandEntityReferences: boolean; + filter: NodeFilter; + root: Node; + whatToShow: number; + detach(): void; + nextNode(): Node; + previousNode(): Node; +} + +declare var NodeIterator: { + prototype: NodeIterator; + new(): NodeIterator; +} + +interface NodeList { + length: number; + item(index: number): Node; + [index: number]: Node; +} + +declare var NodeList: { + prototype: NodeList; + new(): NodeList; +} + +interface OES_element_index_uint { +} + +declare var OES_element_index_uint: { + prototype: OES_element_index_uint; + new(): OES_element_index_uint; +} + +interface OES_standard_derivatives { + FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; +} + +declare var OES_standard_derivatives: { + prototype: OES_standard_derivatives; + new(): OES_standard_derivatives; + FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; +} + +interface OES_texture_float { +} + +declare var OES_texture_float: { + prototype: OES_texture_float; + new(): OES_texture_float; +} + +interface OES_texture_float_linear { +} + +declare var OES_texture_float_linear: { + prototype: OES_texture_float_linear; + new(): OES_texture_float_linear; +} + +interface OfflineAudioCompletionEvent extends Event { + renderedBuffer: AudioBuffer; +} + +declare var OfflineAudioCompletionEvent: { + prototype: OfflineAudioCompletionEvent; + new(): OfflineAudioCompletionEvent; +} + +interface OfflineAudioContext extends AudioContext { + oncomplete: (ev: Event) => any; + startRendering(): void; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var OfflineAudioContext: { + prototype: OfflineAudioContext; + new(numberOfChannels: number, length: number, sampleRate: number): OfflineAudioContext; +} + +interface OscillatorNode extends AudioNode { + detune: AudioParam; + frequency: AudioParam; + onended: (ev: Event) => any; + type: string; + setPeriodicWave(periodicWave: PeriodicWave): void; + start(when?: number): void; + stop(when?: number): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var OscillatorNode: { + prototype: OscillatorNode; + new(): OscillatorNode; +} + +interface PageTransitionEvent extends Event { + persisted: boolean; +} + +declare var PageTransitionEvent: { + prototype: PageTransitionEvent; + new(): PageTransitionEvent; +} + +interface PannerNode extends AudioNode { + coneInnerAngle: number; + coneOuterAngle: number; + coneOuterGain: number; + distanceModel: string; + maxDistance: number; + panningModel: string; + refDistance: number; + rolloffFactor: number; + setOrientation(x: number, y: number, z: number): void; + setPosition(x: number, y: number, z: number): void; + setVelocity(x: number, y: number, z: number): void; +} + +declare var PannerNode: { + prototype: PannerNode; + new(): PannerNode; +} + +interface PerfWidgetExternal { + activeNetworkRequestCount: number; + averageFrameTime: number; + averagePaintTime: number; + extraInformationEnabled: boolean; + independentRenderingEnabled: boolean; + irDisablingContentString: string; + irStatusAvailable: boolean; + maxCpuSpeed: number; + paintRequestsPerSecond: number; + performanceCounter: number; + performanceCounterFrequency: number; + addEventListener(eventType: string, callback: Function): void; + getMemoryUsage(): number; + getProcessCpuUsage(): number; + getRecentCpuUsage(last: number): any; + getRecentFrames(last: number): any; + getRecentMemoryUsage(last: number): any; + getRecentPaintRequests(last: number): any; + removeEventListener(eventType: string, callback: Function): void; + repositionWindow(x: number, y: number): void; + resizeWindow(width: number, height: number): void; +} + +declare var PerfWidgetExternal: { + prototype: PerfWidgetExternal; + new(): PerfWidgetExternal; +} + +interface Performance { + navigation: PerformanceNavigation; + timing: PerformanceTiming; + clearMarks(markName?: string): void; + clearMeasures(measureName?: string): void; + clearResourceTimings(): void; + getEntries(): any; + getEntriesByName(name: string, entryType?: string): any; + getEntriesByType(entryType: string): any; + getMarks(markName?: string): any; + getMeasures(measureName?: string): any; + mark(markName: string): void; + measure(measureName: string, startMarkName?: string, endMarkName?: string): void; + now(): number; + setResourceTimingBufferSize(maxSize: number): void; + toJSON(): any; +} + +declare var Performance: { + prototype: Performance; + new(): Performance; +} + +interface PerformanceEntry { + duration: number; + entryType: string; + name: string; + startTime: number; +} + +declare var PerformanceEntry: { + prototype: PerformanceEntry; + new(): PerformanceEntry; +} + +interface PerformanceMark extends PerformanceEntry { +} + +declare var PerformanceMark: { + prototype: PerformanceMark; + new(): PerformanceMark; +} + +interface PerformanceMeasure extends PerformanceEntry { +} + +declare var PerformanceMeasure: { + prototype: PerformanceMeasure; + new(): PerformanceMeasure; +} + +interface PerformanceNavigation { + redirectCount: number; + type: number; + toJSON(): any; + TYPE_BACK_FORWARD: number; + TYPE_NAVIGATE: number; + TYPE_RELOAD: number; + TYPE_RESERVED: number; +} + +declare var PerformanceNavigation: { + prototype: PerformanceNavigation; + new(): PerformanceNavigation; + TYPE_BACK_FORWARD: number; + TYPE_NAVIGATE: number; + TYPE_RELOAD: number; + TYPE_RESERVED: number; +} + +interface PerformanceNavigationTiming extends PerformanceEntry { + connectEnd: number; + connectStart: number; + domComplete: number; + domContentLoadedEventEnd: number; + domContentLoadedEventStart: number; + domInteractive: number; + domLoading: number; + domainLookupEnd: number; + domainLookupStart: number; + fetchStart: number; + loadEventEnd: number; + loadEventStart: number; + navigationStart: number; + redirectCount: number; + redirectEnd: number; + redirectStart: number; + requestStart: number; + responseEnd: number; + responseStart: number; + type: string; + unloadEventEnd: number; + unloadEventStart: number; +} + +declare var PerformanceNavigationTiming: { + prototype: PerformanceNavigationTiming; + new(): PerformanceNavigationTiming; +} + +interface PerformanceResourceTiming extends PerformanceEntry { + connectEnd: number; + connectStart: number; + domainLookupEnd: number; + domainLookupStart: number; + fetchStart: number; + initiatorType: string; + redirectEnd: number; + redirectStart: number; + requestStart: number; + responseEnd: number; + responseStart: number; +} + +declare var PerformanceResourceTiming: { + prototype: PerformanceResourceTiming; + new(): PerformanceResourceTiming; +} + +interface PerformanceTiming { + connectEnd: number; + connectStart: number; + domComplete: number; + domContentLoadedEventEnd: number; + domContentLoadedEventStart: number; + domInteractive: number; + domLoading: number; + domainLookupEnd: number; + domainLookupStart: number; + fetchStart: number; + loadEventEnd: number; + loadEventStart: number; + msFirstPaint: number; + navigationStart: number; + redirectEnd: number; + redirectStart: number; + requestStart: number; + responseEnd: number; + responseStart: number; + unloadEventEnd: number; + unloadEventStart: number; + toJSON(): any; +} + +declare var PerformanceTiming: { + prototype: PerformanceTiming; + new(): PerformanceTiming; +} + +interface PeriodicWave { +} + +declare var PeriodicWave: { + prototype: PeriodicWave; + new(): PeriodicWave; +} + +interface PermissionRequest extends DeferredPermissionRequest { + state: string; + defer(): void; +} + +declare var PermissionRequest: { + prototype: PermissionRequest; + new(): PermissionRequest; +} + +interface PermissionRequestedEvent extends Event { + permissionRequest: PermissionRequest; +} + +declare var PermissionRequestedEvent: { + prototype: PermissionRequestedEvent; + new(): PermissionRequestedEvent; +} + +interface Plugin { + description: string; + filename: string; + length: number; + name: string; + version: string; + item(index: number): MimeType; + namedItem(type: string): MimeType; + [index: number]: MimeType; +} + +declare var Plugin: { + prototype: Plugin; + new(): Plugin; +} + +interface PluginArray { + length: number; + item(index: number): Plugin; + namedItem(name: string): Plugin; + refresh(reload?: boolean): void; + [index: number]: Plugin; +} + +declare var PluginArray: { + prototype: PluginArray; + new(): PluginArray; +} + +interface PointerEvent extends MouseEvent { + currentPoint: any; + height: number; + hwTimestamp: number; + intermediatePoints: any; + isPrimary: boolean; + pointerId: number; + pointerType: any; + pressure: number; + rotation: number; + tiltX: number; + tiltY: number; + width: number; + getCurrentPoint(element: Element): void; + getIntermediatePoints(element: Element): void; + initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; +} + +declare var PointerEvent: { + prototype: PointerEvent; + new(typeArg: string, eventInitDict?: PointerEventInit): PointerEvent; } interface PopStateEvent extends Event { state: any; initPopStateEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, stateArg: any): void; } + declare var PopStateEvent: { prototype: PopStateEvent; new(): PopStateEvent; } -interface CSSKeyframeRule extends CSSRule { - keyText: string; - style: CSSStyleDeclaration; -} -declare var CSSKeyframeRule: { - prototype: CSSKeyframeRule; - new(): CSSKeyframeRule; +interface Position { + coords: Coordinates; + timestamp: Date; } -interface MSFileSaver { - msSaveBlob(blob: any, defaultName?: string): boolean; - msSaveOrOpenBlob(blob: any, defaultName?: string): boolean; +declare var Position: { + prototype: Position; + new(): Position; } -interface MSStream { - type: string; - msDetachStream(): any; - msClose(): void; -} -declare var MSStream: { - prototype: MSStream; - new(): MSStream; +interface PositionError { + code: number; + message: string; + toString(): string; + PERMISSION_DENIED: number; + POSITION_UNAVAILABLE: number; + TIMEOUT: number; } -interface MSBlobBuilder { - append(data: any, endings?: string): void; - getBlob(contentType?: string): Blob; -} -declare var MSBlobBuilder: { - prototype: MSBlobBuilder; - new(): MSBlobBuilder; +declare var PositionError: { + prototype: PositionError; + new(): PositionError; + PERMISSION_DENIED: number; + POSITION_UNAVAILABLE: number; + TIMEOUT: number; } -interface DOMSettableTokenList extends DOMTokenList { - value: string; -} -declare var DOMSettableTokenList: { - prototype: DOMSettableTokenList; - new(): DOMSettableTokenList; +interface ProcessingInstruction extends CharacterData { + target: string; } -interface IDBFactory { - open(name: string, version?: number): IDBOpenDBRequest; - cmp(first: any, second: any): number; - deleteDatabase(name: string): IDBOpenDBRequest; -} -declare var IDBFactory: { - prototype: IDBFactory; - new(): IDBFactory; +declare var ProcessingInstruction: { + prototype: ProcessingInstruction; + new(): ProcessingInstruction; } -interface MSPointerEvent extends MouseEvent { - width: number; - rotation: number; - pressure: number; - pointerType: any; - isPrimary: boolean; - tiltY: number; - height: number; - intermediatePoints: any; - currentPoint: any; - tiltX: number; - hwTimestamp: number; - pointerId: number; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; - MSPOINTER_TYPE_PEN: number; - MSPOINTER_TYPE_MOUSE: number; - MSPOINTER_TYPE_TOUCH: number; -} -declare var MSPointerEvent: { - prototype: MSPointerEvent; - new(): MSPointerEvent; - MSPOINTER_TYPE_PEN: number; - MSPOINTER_TYPE_MOUSE: number; - MSPOINTER_TYPE_TOUCH: number; +interface ProgressEvent extends Event { + lengthComputable: boolean; + loaded: number; + total: number; + initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; } -interface MSManipulationEvent extends UIEvent { - lastState: number; - currentState: number; - initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void; - MS_MANIPULATION_STATE_STOPPED: number; - MS_MANIPULATION_STATE_ACTIVE: number; - MS_MANIPULATION_STATE_INERTIA: number; - MS_MANIPULATION_STATE_SELECTING: number; - MS_MANIPULATION_STATE_COMMITTED: number; - MS_MANIPULATION_STATE_PRESELECT: number; - MS_MANIPULATION_STATE_DRAGGING: number; - MS_MANIPULATION_STATE_CANCELLED: number; -} -declare var MSManipulationEvent: { - prototype: MSManipulationEvent; - new(): MSManipulationEvent; - MS_MANIPULATION_STATE_STOPPED: number; - MS_MANIPULATION_STATE_ACTIVE: number; - MS_MANIPULATION_STATE_INERTIA: number; - MS_MANIPULATION_STATE_SELECTING: number; - MS_MANIPULATION_STATE_COMMITTED: number; - MS_MANIPULATION_STATE_PRESELECT: number; - MS_MANIPULATION_STATE_DRAGGING: number; - MS_MANIPULATION_STATE_CANCELLED: number; +declare var ProgressEvent: { + prototype: ProgressEvent; + new(): ProgressEvent; } -interface FormData { - append(name: any, value: any, blobName?: string): void; -} -declare var FormData: { - prototype: FormData; - new(): FormData; +interface Range { + collapsed: boolean; + commonAncestorContainer: Node; + endContainer: Node; + endOffset: number; + startContainer: Node; + startOffset: number; + cloneContents(): DocumentFragment; + cloneRange(): Range; + collapse(toStart: boolean): void; + compareBoundaryPoints(how: number, sourceRange: Range): number; + createContextualFragment(fragment: string): DocumentFragment; + deleteContents(): void; + detach(): void; + expand(Unit: string): boolean; + extractContents(): DocumentFragment; + getBoundingClientRect(): ClientRect; + getClientRects(): ClientRectList; + insertNode(newNode: Node): void; + selectNode(refNode: Node): void; + selectNodeContents(refNode: Node): void; + setEnd(refNode: Node, offset: number): void; + setEndAfter(refNode: Node): void; + setEndBefore(refNode: Node): void; + setStart(refNode: Node, offset: number): void; + setStartAfter(refNode: Node): void; + setStartBefore(refNode: Node): void; + surroundContents(newParent: Node): void; + toString(): string; + END_TO_END: number; + END_TO_START: number; + START_TO_END: number; + START_TO_START: number; } -interface HTMLDataListElement extends HTMLElement { - options: HTMLCollection; -} -declare var HTMLDataListElement: { - prototype: HTMLDataListElement; - new(): HTMLDataListElement; +declare var Range: { + prototype: Range; + new(): Range; + END_TO_END: number; + END_TO_START: number; + START_TO_END: number; + START_TO_START: number; } -interface SVGFEImageElement extends SVGElement, SVGLangSpace, SVGFilterPrimitiveStandardAttributes, SVGURIReference, SVGExternalResourcesRequired { - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; -} -declare var SVGFEImageElement: { - prototype: SVGFEImageElement; - new(): SVGFEImageElement; +interface SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { + target: SVGAnimatedString; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface AbstractWorker extends EventTarget { - onerror: (ev: ErrorEvent) => any; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +declare var SVGAElement: { + prototype: SVGAElement; + new(): SVGAElement; } -interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - operator: SVGAnimatedEnumeration; - in2: SVGAnimatedString; - k2: SVGAnimatedNumber; - k1: SVGAnimatedNumber; - k3: SVGAnimatedNumber; +interface SVGAngle { + unitType: number; + value: number; + valueAsString: string; + valueInSpecifiedUnits: number; + convertToSpecifiedUnits(unitType: number): void; + newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; + SVG_ANGLETYPE_DEG: number; + SVG_ANGLETYPE_GRAD: number; + SVG_ANGLETYPE_RAD: number; + SVG_ANGLETYPE_UNKNOWN: number; + SVG_ANGLETYPE_UNSPECIFIED: number; +} + +declare var SVGAngle: { + prototype: SVGAngle; + new(): SVGAngle; + SVG_ANGLETYPE_DEG: number; + SVG_ANGLETYPE_GRAD: number; + SVG_ANGLETYPE_RAD: number; + SVG_ANGLETYPE_UNKNOWN: number; + SVG_ANGLETYPE_UNSPECIFIED: number; +} + +interface SVGAnimatedAngle { + animVal: SVGAngle; + baseVal: SVGAngle; +} + +declare var SVGAnimatedAngle: { + prototype: SVGAnimatedAngle; + new(): SVGAnimatedAngle; +} + +interface SVGAnimatedBoolean { + animVal: boolean; + baseVal: boolean; +} + +declare var SVGAnimatedBoolean: { + prototype: SVGAnimatedBoolean; + new(): SVGAnimatedBoolean; +} + +interface SVGAnimatedEnumeration { + animVal: number; + baseVal: number; +} + +declare var SVGAnimatedEnumeration: { + prototype: SVGAnimatedEnumeration; + new(): SVGAnimatedEnumeration; +} + +interface SVGAnimatedInteger { + animVal: number; + baseVal: number; +} + +declare var SVGAnimatedInteger: { + prototype: SVGAnimatedInteger; + new(): SVGAnimatedInteger; +} + +interface SVGAnimatedLength { + animVal: SVGLength; + baseVal: SVGLength; +} + +declare var SVGAnimatedLength: { + prototype: SVGAnimatedLength; + new(): SVGAnimatedLength; +} + +interface SVGAnimatedLengthList { + animVal: SVGLengthList; + baseVal: SVGLengthList; +} + +declare var SVGAnimatedLengthList: { + prototype: SVGAnimatedLengthList; + new(): SVGAnimatedLengthList; +} + +interface SVGAnimatedNumber { + animVal: number; + baseVal: number; +} + +declare var SVGAnimatedNumber: { + prototype: SVGAnimatedNumber; + new(): SVGAnimatedNumber; +} + +interface SVGAnimatedNumberList { + animVal: SVGNumberList; + baseVal: SVGNumberList; +} + +declare var SVGAnimatedNumberList: { + prototype: SVGAnimatedNumberList; + new(): SVGAnimatedNumberList; +} + +interface SVGAnimatedPreserveAspectRatio { + animVal: SVGPreserveAspectRatio; + baseVal: SVGPreserveAspectRatio; +} + +declare var SVGAnimatedPreserveAspectRatio: { + prototype: SVGAnimatedPreserveAspectRatio; + new(): SVGAnimatedPreserveAspectRatio; +} + +interface SVGAnimatedRect { + animVal: SVGRect; + baseVal: SVGRect; +} + +declare var SVGAnimatedRect: { + prototype: SVGAnimatedRect; + new(): SVGAnimatedRect; +} + +interface SVGAnimatedString { + animVal: string; + baseVal: string; +} + +declare var SVGAnimatedString: { + prototype: SVGAnimatedString; + new(): SVGAnimatedString; +} + +interface SVGAnimatedTransformList { + animVal: SVGTransformList; + baseVal: SVGTransformList; +} + +declare var SVGAnimatedTransformList: { + prototype: SVGAnimatedTransformList; + new(): SVGAnimatedTransformList; +} + +interface SVGCircleElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + cx: SVGAnimatedLength; + cy: SVGAnimatedLength; + r: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGCircleElement: { + prototype: SVGCircleElement; + new(): SVGCircleElement; +} + +interface SVGClipPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes { + clipPathUnits: SVGAnimatedEnumeration; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGClipPathElement: { + prototype: SVGClipPathElement; + new(): SVGClipPathElement; +} + +interface SVGComponentTransferFunctionElement extends SVGElement { + amplitude: SVGAnimatedNumber; + exponent: SVGAnimatedNumber; + intercept: SVGAnimatedNumber; + offset: SVGAnimatedNumber; + slope: SVGAnimatedNumber; + tableValues: SVGAnimatedNumberList; + type: SVGAnimatedEnumeration; + SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; + SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; + SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; + SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; + SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; + SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; +} + +declare var SVGComponentTransferFunctionElement: { + prototype: SVGComponentTransferFunctionElement; + new(): SVGComponentTransferFunctionElement; + SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; + SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; + SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; + SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; + SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; + SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; +} + +interface SVGDefsElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGDefsElement: { + prototype: SVGDefsElement; + new(): SVGDefsElement; +} + +interface SVGDescElement extends SVGElement, SVGStylable, SVGLangSpace { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGDescElement: { + prototype: SVGDescElement; + new(): SVGDescElement; +} + +interface SVGElement extends Element { + id: string; + onclick: (ev: MouseEvent) => any; + ondblclick: (ev: MouseEvent) => any; + onfocusin: (ev: FocusEvent) => any; + onfocusout: (ev: FocusEvent) => any; + onload: (ev: Event) => any; + onmousedown: (ev: MouseEvent) => any; + onmousemove: (ev: MouseEvent) => any; + onmouseout: (ev: MouseEvent) => any; + onmouseover: (ev: MouseEvent) => any; + onmouseup: (ev: MouseEvent) => any; + ownerSVGElement: SVGSVGElement; + viewportElement: SVGElement; + xmlbase: string; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGElement: { + prototype: SVGElement; + new(): SVGElement; +} + +interface SVGElementInstance extends EventTarget { + childNodes: SVGElementInstanceList; + correspondingElement: SVGElement; + correspondingUseElement: SVGUseElement; + firstChild: SVGElementInstance; + lastChild: SVGElementInstance; + nextSibling: SVGElementInstance; + parentNode: SVGElementInstance; + previousSibling: SVGElementInstance; +} + +declare var SVGElementInstance: { + prototype: SVGElementInstance; + new(): SVGElementInstance; +} + +interface SVGElementInstanceList { + length: number; + item(index: number): SVGElementInstance; +} + +declare var SVGElementInstanceList: { + prototype: SVGElementInstanceList; + new(): SVGElementInstanceList; +} + +interface SVGEllipseElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + cx: SVGAnimatedLength; + cy: SVGAnimatedLength; + rx: SVGAnimatedLength; + ry: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGEllipseElement: { + prototype: SVGEllipseElement; + new(): SVGEllipseElement; +} + +interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { in1: SVGAnimatedString; - k4: SVGAnimatedNumber; - SVG_FECOMPOSITE_OPERATOR_OUT: number; - SVG_FECOMPOSITE_OPERATOR_OVER: number; - SVG_FECOMPOSITE_OPERATOR_XOR: number; - SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - SVG_FECOMPOSITE_OPERATOR_IN: number; - SVG_FECOMPOSITE_OPERATOR_ATOP: number; -} -declare var SVGFECompositeElement: { - prototype: SVGFECompositeElement; - new(): SVGFECompositeElement; - SVG_FECOMPOSITE_OPERATOR_OUT: number; - SVG_FECOMPOSITE_OPERATOR_OVER: number; - SVG_FECOMPOSITE_OPERATOR_XOR: number; - SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - SVG_FECOMPOSITE_OPERATOR_IN: number; - SVG_FECOMPOSITE_OPERATOR_ATOP: number; + in2: SVGAnimatedString; + mode: SVGAnimatedEnumeration; + SVG_FEBLEND_MODE_COLOR: number; + SVG_FEBLEND_MODE_COLOR_BURN: number; + SVG_FEBLEND_MODE_COLOR_DODGE: number; + SVG_FEBLEND_MODE_DARKEN: number; + SVG_FEBLEND_MODE_DIFFERENCE: number; + SVG_FEBLEND_MODE_EXCLUSION: number; + SVG_FEBLEND_MODE_HARD_LIGHT: number; + SVG_FEBLEND_MODE_HUE: number; + SVG_FEBLEND_MODE_LIGHTEN: number; + SVG_FEBLEND_MODE_LUMINOSITY: number; + SVG_FEBLEND_MODE_MULTIPLY: number; + SVG_FEBLEND_MODE_NORMAL: number; + SVG_FEBLEND_MODE_OVERLAY: number; + SVG_FEBLEND_MODE_SATURATION: number; + SVG_FEBLEND_MODE_SCREEN: number; + SVG_FEBLEND_MODE_SOFT_LIGHT: number; + SVG_FEBLEND_MODE_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface ValidityState { - customError: boolean; - valueMissing: boolean; - stepMismatch: boolean; - rangeUnderflow: boolean; - rangeOverflow: boolean; - typeMismatch: boolean; - patternMismatch: boolean; - tooLong: boolean; - valid: boolean; -} -declare var ValidityState: { - prototype: ValidityState; - new(): ValidityState; +declare var SVGFEBlendElement: { + prototype: SVGFEBlendElement; + new(): SVGFEBlendElement; + SVG_FEBLEND_MODE_COLOR: number; + SVG_FEBLEND_MODE_COLOR_BURN: number; + SVG_FEBLEND_MODE_COLOR_DODGE: number; + SVG_FEBLEND_MODE_DARKEN: number; + SVG_FEBLEND_MODE_DIFFERENCE: number; + SVG_FEBLEND_MODE_EXCLUSION: number; + SVG_FEBLEND_MODE_HARD_LIGHT: number; + SVG_FEBLEND_MODE_HUE: number; + SVG_FEBLEND_MODE_LIGHTEN: number; + SVG_FEBLEND_MODE_LUMINOSITY: number; + SVG_FEBLEND_MODE_MULTIPLY: number; + SVG_FEBLEND_MODE_NORMAL: number; + SVG_FEBLEND_MODE_OVERLAY: number; + SVG_FEBLEND_MODE_SATURATION: number; + SVG_FEBLEND_MODE_SCREEN: number; + SVG_FEBLEND_MODE_SOFT_LIGHT: number; + SVG_FEBLEND_MODE_UNKNOWN: number; } -interface HTMLTrackElement extends HTMLElement { - kind: string; - src: string; - srclang: string; - track: TextTrack; - label: string; - default: boolean; - readyState: number; - ERROR: number; - LOADING: number; - LOADED: number; - NONE: number; -} -declare var HTMLTrackElement: { - prototype: HTMLTrackElement; - new(): HTMLTrackElement; - ERROR: number; - LOADING: number; - LOADED: number; - NONE: number; +interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + type: SVGAnimatedEnumeration; + values: SVGAnimatedNumberList; + SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; + SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; + SVG_FECOLORMATRIX_TYPE_MATRIX: number; + SVG_FECOLORMATRIX_TYPE_SATURATE: number; + SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface MSApp { - createFileFromStorageFile(storageFile: any): File; - createBlobFromRandomAccessStream(type: string, seeker: any): Blob; - createStreamFromInputStream(type: string, inputStream: any): MSStream; - terminateApp(exceptionObject: any): void; - createDataPackage(object: any): any; - execUnsafeLocalFunction(unsafeFunction: MSUnsafeFunctionCallback): any; - getHtmlPrintDocumentSource(htmlDoc: any): any; - addPublicLocalApplicationUri(uri: string): void; - createDataPackageFromSelection(): any; - getViewOpener(): MSAppView; - suppressSubdownloadCredentialPrompts(suppress: boolean): void; - execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; - isTaskScheduledAtPriorityOrHigher(priority: string): boolean; - execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; - createNewView(uri: string): MSAppView; - getCurrentPriority(): string; - NORMAL: string; - HIGH: string; - IDLE: string; - CURRENT: string; +declare var SVGFEColorMatrixElement: { + prototype: SVGFEColorMatrixElement; + new(): SVGFEColorMatrixElement; + SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; + SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; + SVG_FECOLORMATRIX_TYPE_MATRIX: number; + SVG_FECOLORMATRIX_TYPE_SATURATE: number; + SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; } -declare var MSApp: MSApp; interface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { in1: SVGAnimatedString; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var SVGFEComponentTransferElement: { prototype: SVGFEComponentTransferElement; new(): SVGFEComponentTransferElement; } -interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { +interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + in2: SVGAnimatedString; + k1: SVGAnimatedNumber; + k2: SVGAnimatedNumber; + k3: SVGAnimatedNumber; + k4: SVGAnimatedNumber; + operator: SVGAnimatedEnumeration; + SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; + SVG_FECOMPOSITE_OPERATOR_ATOP: number; + SVG_FECOMPOSITE_OPERATOR_IN: number; + SVG_FECOMPOSITE_OPERATOR_OUT: number; + SVG_FECOMPOSITE_OPERATOR_OVER: number; + SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; + SVG_FECOMPOSITE_OPERATOR_XOR: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFECompositeElement: { + prototype: SVGFECompositeElement; + new(): SVGFECompositeElement; + SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; + SVG_FECOMPOSITE_OPERATOR_ATOP: number; + SVG_FECOMPOSITE_OPERATOR_IN: number; + SVG_FECOMPOSITE_OPERATOR_OUT: number; + SVG_FECOMPOSITE_OPERATOR_OVER: number; + SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; + SVG_FECOMPOSITE_OPERATOR_XOR: number; +} + +interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + bias: SVGAnimatedNumber; + divisor: SVGAnimatedNumber; + edgeMode: SVGAnimatedEnumeration; + in1: SVGAnimatedString; + kernelMatrix: SVGAnimatedNumberList; + kernelUnitLengthX: SVGAnimatedNumber; kernelUnitLengthY: SVGAnimatedNumber; - surfaceScale: SVGAnimatedNumber; + orderX: SVGAnimatedInteger; + orderY: SVGAnimatedInteger; + preserveAlpha: SVGAnimatedBoolean; + targetX: SVGAnimatedInteger; + targetY: SVGAnimatedInteger; + SVG_EDGEMODE_DUPLICATE: number; + SVG_EDGEMODE_NONE: number; + SVG_EDGEMODE_UNKNOWN: number; + SVG_EDGEMODE_WRAP: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEConvolveMatrixElement: { + prototype: SVGFEConvolveMatrixElement; + new(): SVGFEConvolveMatrixElement; + SVG_EDGEMODE_DUPLICATE: number; + SVG_EDGEMODE_NONE: number; + SVG_EDGEMODE_UNKNOWN: number; + SVG_EDGEMODE_WRAP: number; +} + +interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + diffuseConstant: SVGAnimatedNumber; in1: SVGAnimatedString; kernelUnitLengthX: SVGAnimatedNumber; - diffuseConstant: SVGAnimatedNumber; + kernelUnitLengthY: SVGAnimatedNumber; + surfaceScale: SVGAnimatedNumber; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var SVGFEDiffuseLightingElement: { prototype: SVGFEDiffuseLightingElement; new(): SVGFEDiffuseLightingElement; } -interface MSCSSMatrix { - m24: number; - m34: number; +interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + in2: SVGAnimatedString; + scale: SVGAnimatedNumber; + xChannelSelector: SVGAnimatedEnumeration; + yChannelSelector: SVGAnimatedEnumeration; + SVG_CHANNEL_A: number; + SVG_CHANNEL_B: number; + SVG_CHANNEL_G: number; + SVG_CHANNEL_R: number; + SVG_CHANNEL_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEDisplacementMapElement: { + prototype: SVGFEDisplacementMapElement; + new(): SVGFEDisplacementMapElement; + SVG_CHANNEL_A: number; + SVG_CHANNEL_B: number; + SVG_CHANNEL_G: number; + SVG_CHANNEL_R: number; + SVG_CHANNEL_UNKNOWN: number; +} + +interface SVGFEDistantLightElement extends SVGElement { + azimuth: SVGAnimatedNumber; + elevation: SVGAnimatedNumber; +} + +declare var SVGFEDistantLightElement: { + prototype: SVGFEDistantLightElement; + new(): SVGFEDistantLightElement; +} + +interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEFloodElement: { + prototype: SVGFEFloodElement; + new(): SVGFEFloodElement; +} + +interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { +} + +declare var SVGFEFuncAElement: { + prototype: SVGFEFuncAElement; + new(): SVGFEFuncAElement; +} + +interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { +} + +declare var SVGFEFuncBElement: { + prototype: SVGFEFuncBElement; + new(): SVGFEFuncBElement; +} + +interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { +} + +declare var SVGFEFuncGElement: { + prototype: SVGFEFuncGElement; + new(): SVGFEFuncGElement; +} + +interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { +} + +declare var SVGFEFuncRElement: { + prototype: SVGFEFuncRElement; + new(): SVGFEFuncRElement; +} + +interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + stdDeviationX: SVGAnimatedNumber; + stdDeviationY: SVGAnimatedNumber; + setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEGaussianBlurElement: { + prototype: SVGFEGaussianBlurElement; + new(): SVGFEGaussianBlurElement; +} + +interface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { + preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEImageElement: { + prototype: SVGFEImageElement; + new(): SVGFEImageElement; +} + +interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEMergeElement: { + prototype: SVGFEMergeElement; + new(): SVGFEMergeElement; +} + +interface SVGFEMergeNodeElement extends SVGElement { + in1: SVGAnimatedString; +} + +declare var SVGFEMergeNodeElement: { + prototype: SVGFEMergeNodeElement; + new(): SVGFEMergeNodeElement; +} + +interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + operator: SVGAnimatedEnumeration; + radiusX: SVGAnimatedNumber; + radiusY: SVGAnimatedNumber; + SVG_MORPHOLOGY_OPERATOR_DILATE: number; + SVG_MORPHOLOGY_OPERATOR_ERODE: number; + SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEMorphologyElement: { + prototype: SVGFEMorphologyElement; + new(): SVGFEMorphologyElement; + SVG_MORPHOLOGY_OPERATOR_DILATE: number; + SVG_MORPHOLOGY_OPERATOR_ERODE: number; + SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; +} + +interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + dx: SVGAnimatedNumber; + dy: SVGAnimatedNumber; + in1: SVGAnimatedString; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEOffsetElement: { + prototype: SVGFEOffsetElement; + new(): SVGFEOffsetElement; +} + +interface SVGFEPointLightElement extends SVGElement { + x: SVGAnimatedNumber; + y: SVGAnimatedNumber; + z: SVGAnimatedNumber; +} + +declare var SVGFEPointLightElement: { + prototype: SVGFEPointLightElement; + new(): SVGFEPointLightElement; +} + +interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + kernelUnitLengthX: SVGAnimatedNumber; + kernelUnitLengthY: SVGAnimatedNumber; + specularConstant: SVGAnimatedNumber; + specularExponent: SVGAnimatedNumber; + surfaceScale: SVGAnimatedNumber; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFESpecularLightingElement: { + prototype: SVGFESpecularLightingElement; + new(): SVGFESpecularLightingElement; +} + +interface SVGFESpotLightElement extends SVGElement { + limitingConeAngle: SVGAnimatedNumber; + pointsAtX: SVGAnimatedNumber; + pointsAtY: SVGAnimatedNumber; + pointsAtZ: SVGAnimatedNumber; + specularExponent: SVGAnimatedNumber; + x: SVGAnimatedNumber; + y: SVGAnimatedNumber; + z: SVGAnimatedNumber; +} + +declare var SVGFESpotLightElement: { + prototype: SVGFESpotLightElement; + new(): SVGFESpotLightElement; +} + +interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFETileElement: { + prototype: SVGFETileElement; + new(): SVGFETileElement; +} + +interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + baseFrequencyX: SVGAnimatedNumber; + baseFrequencyY: SVGAnimatedNumber; + numOctaves: SVGAnimatedInteger; + seed: SVGAnimatedNumber; + stitchTiles: SVGAnimatedEnumeration; + type: SVGAnimatedEnumeration; + SVG_STITCHTYPE_NOSTITCH: number; + SVG_STITCHTYPE_STITCH: number; + SVG_STITCHTYPE_UNKNOWN: number; + SVG_TURBULENCE_TYPE_FRACTALNOISE: number; + SVG_TURBULENCE_TYPE_TURBULENCE: number; + SVG_TURBULENCE_TYPE_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFETurbulenceElement: { + prototype: SVGFETurbulenceElement; + new(): SVGFETurbulenceElement; + SVG_STITCHTYPE_NOSTITCH: number; + SVG_STITCHTYPE_STITCH: number; + SVG_STITCHTYPE_UNKNOWN: number; + SVG_TURBULENCE_TYPE_FRACTALNOISE: number; + SVG_TURBULENCE_TYPE_TURBULENCE: number; + SVG_TURBULENCE_TYPE_UNKNOWN: number; +} + +interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { + filterResX: SVGAnimatedInteger; + filterResY: SVGAnimatedInteger; + filterUnits: SVGAnimatedEnumeration; + height: SVGAnimatedLength; + primitiveUnits: SVGAnimatedEnumeration; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + setFilterRes(filterResX: number, filterResY: number): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFilterElement: { + prototype: SVGFilterElement; + new(): SVGFilterElement; +} + +interface SVGForeignObjectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + height: SVGAnimatedLength; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGForeignObjectElement: { + prototype: SVGForeignObjectElement; + new(): SVGForeignObjectElement; +} + +interface SVGGElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGGElement: { + prototype: SVGGElement; + new(): SVGGElement; +} + +interface SVGGradientElement extends SVGElement, SVGStylable, SVGExternalResourcesRequired, SVGURIReference, SVGUnitTypes { + gradientTransform: SVGAnimatedTransformList; + gradientUnits: SVGAnimatedEnumeration; + spreadMethod: SVGAnimatedEnumeration; + SVG_SPREADMETHOD_PAD: number; + SVG_SPREADMETHOD_REFLECT: number; + SVG_SPREADMETHOD_REPEAT: number; + SVG_SPREADMETHOD_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGGradientElement: { + prototype: SVGGradientElement; + new(): SVGGradientElement; + SVG_SPREADMETHOD_PAD: number; + SVG_SPREADMETHOD_REFLECT: number; + SVG_SPREADMETHOD_REPEAT: number; + SVG_SPREADMETHOD_UNKNOWN: number; +} + +interface SVGImageElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { + height: SVGAnimatedLength; + preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGImageElement: { + prototype: SVGImageElement; + new(): SVGImageElement; +} + +interface SVGLength { + unitType: number; + value: number; + valueAsString: string; + valueInSpecifiedUnits: number; + convertToSpecifiedUnits(unitType: number): void; + newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; + SVG_LENGTHTYPE_CM: number; + SVG_LENGTHTYPE_EMS: number; + SVG_LENGTHTYPE_EXS: number; + SVG_LENGTHTYPE_IN: number; + SVG_LENGTHTYPE_MM: number; + SVG_LENGTHTYPE_NUMBER: number; + SVG_LENGTHTYPE_PC: number; + SVG_LENGTHTYPE_PERCENTAGE: number; + SVG_LENGTHTYPE_PT: number; + SVG_LENGTHTYPE_PX: number; + SVG_LENGTHTYPE_UNKNOWN: number; +} + +declare var SVGLength: { + prototype: SVGLength; + new(): SVGLength; + SVG_LENGTHTYPE_CM: number; + SVG_LENGTHTYPE_EMS: number; + SVG_LENGTHTYPE_EXS: number; + SVG_LENGTHTYPE_IN: number; + SVG_LENGTHTYPE_MM: number; + SVG_LENGTHTYPE_NUMBER: number; + SVG_LENGTHTYPE_PC: number; + SVG_LENGTHTYPE_PERCENTAGE: number; + SVG_LENGTHTYPE_PT: number; + SVG_LENGTHTYPE_PX: number; + SVG_LENGTHTYPE_UNKNOWN: number; +} + +interface SVGLengthList { + numberOfItems: number; + appendItem(newItem: SVGLength): SVGLength; + clear(): void; + getItem(index: number): SVGLength; + initialize(newItem: SVGLength): SVGLength; + insertItemBefore(newItem: SVGLength, index: number): SVGLength; + removeItem(index: number): SVGLength; + replaceItem(newItem: SVGLength, index: number): SVGLength; +} + +declare var SVGLengthList: { + prototype: SVGLengthList; + new(): SVGLengthList; +} + +interface SVGLineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + x1: SVGAnimatedLength; + x2: SVGAnimatedLength; + y1: SVGAnimatedLength; + y2: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGLineElement: { + prototype: SVGLineElement; + new(): SVGLineElement; +} + +interface SVGLinearGradientElement extends SVGGradientElement { + x1: SVGAnimatedLength; + x2: SVGAnimatedLength; + y1: SVGAnimatedLength; + y2: SVGAnimatedLength; +} + +declare var SVGLinearGradientElement: { + prototype: SVGLinearGradientElement; + new(): SVGLinearGradientElement; +} + +interface SVGMarkerElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox { + markerHeight: SVGAnimatedLength; + markerUnits: SVGAnimatedEnumeration; + markerWidth: SVGAnimatedLength; + orientAngle: SVGAnimatedAngle; + orientType: SVGAnimatedEnumeration; + refX: SVGAnimatedLength; + refY: SVGAnimatedLength; + setOrientToAngle(angle: SVGAngle): void; + setOrientToAuto(): void; + SVG_MARKERUNITS_STROKEWIDTH: number; + SVG_MARKERUNITS_UNKNOWN: number; + SVG_MARKERUNITS_USERSPACEONUSE: number; + SVG_MARKER_ORIENT_ANGLE: number; + SVG_MARKER_ORIENT_AUTO: number; + SVG_MARKER_ORIENT_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGMarkerElement: { + prototype: SVGMarkerElement; + new(): SVGMarkerElement; + SVG_MARKERUNITS_STROKEWIDTH: number; + SVG_MARKERUNITS_UNKNOWN: number; + SVG_MARKERUNITS_USERSPACEONUSE: number; + SVG_MARKER_ORIENT_ANGLE: number; + SVG_MARKER_ORIENT_AUTO: number; + SVG_MARKER_ORIENT_UNKNOWN: number; +} + +interface SVGMaskElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes { + height: SVGAnimatedLength; + maskContentUnits: SVGAnimatedEnumeration; + maskUnits: SVGAnimatedEnumeration; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGMaskElement: { + prototype: SVGMaskElement; + new(): SVGMaskElement; +} + +interface SVGMatrix { a: number; - d: number; - m32: number; - m41: number; - m11: number; - f: number; - e: number; - m23: number; - m14: number; - m33: number; - m22: number; - m21: number; - c: number; - m12: number; b: number; - m42: number; - m31: number; - m43: number; - m13: number; - m44: number; - multiply(secondMatrix: MSCSSMatrix): MSCSSMatrix; - skewY(angle: number): MSCSSMatrix; - setMatrixValue(value: string): void; - inverse(): MSCSSMatrix; - rotateAxisAngle(x: number, y: number, z: number, angle: number): MSCSSMatrix; - toString(): string; - rotate(angleX: number, angleY?: number, angleZ?: number): MSCSSMatrix; - translate(x: number, y: number, z?: number): MSCSSMatrix; - scale(scaleX: number, scaleY?: number, scaleZ?: number): MSCSSMatrix; - skewX(angle: number): MSCSSMatrix; -} -declare var MSCSSMatrix: { - prototype: MSCSSMatrix; - new(text?: string): MSCSSMatrix; + c: number; + d: number; + e: number; + f: number; + flipX(): SVGMatrix; + flipY(): SVGMatrix; + inverse(): SVGMatrix; + multiply(secondMatrix: SVGMatrix): SVGMatrix; + rotate(angle: number): SVGMatrix; + rotateFromVector(x: number, y: number): SVGMatrix; + scale(scaleFactor: number): SVGMatrix; + scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix; + skewX(angle: number): SVGMatrix; + skewY(angle: number): SVGMatrix; + translate(x: number, y: number): SVGMatrix; } -interface Worker extends AbstractWorker { - onmessage: (ev: MessageEvent) => any; - postMessage(message: any, ports?: any): void; - terminate(): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Worker: { - prototype: Worker; - new(stringUrl: string): Worker; +declare var SVGMatrix: { + prototype: SVGMatrix; + new(): SVGMatrix; } -interface MSExecAtPriorityFunctionCallback { - (...args: any[]): any; +interface SVGMetadataElement extends SVGElement { } -interface MSGraphicsTrust { - status: string; - constrictionActive: boolean; -} -declare var MSGraphicsTrust: { - prototype: MSGraphicsTrust; - new(): MSGraphicsTrust; +declare var SVGMetadataElement: { + prototype: SVGMetadataElement; + new(): SVGMetadataElement; } -interface SubtleCrypto { - unwrapKey(wrappedKey: ArrayBufferView, keyAlgorithm: any, keyEncryptionKey: Key, extractable?: boolean, keyUsages?: string[]): KeyOperation; - encrypt(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; - importKey(format: string, keyData: ArrayBufferView, algorithm: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; - wrapKey(key: Key, keyEncryptionKey: Key, keyWrappingAlgorithm: any): KeyOperation; - verify(algorithm: any, key: Key, signature: ArrayBufferView, buffer?: ArrayBufferView): CryptoOperation; - deriveKey(algorithm: any, baseKey: Key, derivedKeyType: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; - digest(algorithm: any, buffer?: ArrayBufferView): CryptoOperation; - exportKey(format: string, key: Key): KeyOperation; - generateKey(algorithm: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; - sign(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; - decrypt(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; -} -declare var SubtleCrypto: { - prototype: SubtleCrypto; - new(): SubtleCrypto; +interface SVGNumber { + value: number; } -interface Crypto extends RandomSource { - subtle: SubtleCrypto; -} -declare var Crypto: { - prototype: Crypto; - new(): Crypto; +declare var SVGNumber: { + prototype: SVGNumber; + new(): SVGNumber; } -interface VideoPlaybackQuality { - totalFrameDelay: number; - creationTime: number; - totalVideoFrames: number; - droppedVideoFrames: number; -} -declare var VideoPlaybackQuality: { - prototype: VideoPlaybackQuality; - new(): VideoPlaybackQuality; +interface SVGNumberList { + numberOfItems: number; + appendItem(newItem: SVGNumber): SVGNumber; + clear(): void; + getItem(index: number): SVGNumber; + initialize(newItem: SVGNumber): SVGNumber; + insertItemBefore(newItem: SVGNumber, index: number): SVGNumber; + removeItem(index: number): SVGNumber; + replaceItem(newItem: SVGNumber, index: number): SVGNumber; } -interface GlobalEventHandlers { - onpointerenter: (ev: PointerEvent) => any; - onpointerout: (ev: PointerEvent) => any; - onpointerdown: (ev: PointerEvent) => any; - onpointerup: (ev: PointerEvent) => any; - onpointercancel: (ev: PointerEvent) => any; - onpointerover: (ev: PointerEvent) => any; - onpointermove: (ev: PointerEvent) => any; - onpointerleave: (ev: PointerEvent) => any; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +declare var SVGNumberList: { + prototype: SVGNumberList; + new(): SVGNumberList; } -interface Key { - algorithm: Algorithm; - type: string; - extractable: boolean; - keyUsage: string[]; -} -declare var Key: { - prototype: Key; - new(): Key; +interface SVGPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPathData { + createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs; + createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel; + createSVGPathSegClosePath(): SVGPathSegClosePath; + createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs; + createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel; + createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs; + createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel; + createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs; + createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel; + createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs; + createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel; + createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs; + createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs; + createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel; + createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel; + createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs; + createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel; + createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs; + createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel; + getPathSegAtLength(distance: number): number; + getPointAtLength(distance: number): SVGPoint; + getTotalLength(): number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface DeviceAcceleration { - y: number; +declare var SVGPathElement: { + prototype: SVGPathElement; + new(): SVGPathElement; +} + +interface SVGPathSeg { + pathSegType: number; + pathSegTypeAsLetter: string; + PATHSEG_ARC_ABS: number; + PATHSEG_ARC_REL: number; + PATHSEG_CLOSEPATH: number; + PATHSEG_CURVETO_CUBIC_ABS: number; + PATHSEG_CURVETO_CUBIC_REL: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; + PATHSEG_CURVETO_QUADRATIC_ABS: number; + PATHSEG_CURVETO_QUADRATIC_REL: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; + PATHSEG_LINETO_ABS: number; + PATHSEG_LINETO_HORIZONTAL_ABS: number; + PATHSEG_LINETO_HORIZONTAL_REL: number; + PATHSEG_LINETO_REL: number; + PATHSEG_LINETO_VERTICAL_ABS: number; + PATHSEG_LINETO_VERTICAL_REL: number; + PATHSEG_MOVETO_ABS: number; + PATHSEG_MOVETO_REL: number; + PATHSEG_UNKNOWN: number; +} + +declare var SVGPathSeg: { + prototype: SVGPathSeg; + new(): SVGPathSeg; + PATHSEG_ARC_ABS: number; + PATHSEG_ARC_REL: number; + PATHSEG_CLOSEPATH: number; + PATHSEG_CURVETO_CUBIC_ABS: number; + PATHSEG_CURVETO_CUBIC_REL: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; + PATHSEG_CURVETO_QUADRATIC_ABS: number; + PATHSEG_CURVETO_QUADRATIC_REL: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; + PATHSEG_LINETO_ABS: number; + PATHSEG_LINETO_HORIZONTAL_ABS: number; + PATHSEG_LINETO_HORIZONTAL_REL: number; + PATHSEG_LINETO_REL: number; + PATHSEG_LINETO_VERTICAL_ABS: number; + PATHSEG_LINETO_VERTICAL_REL: number; + PATHSEG_MOVETO_ABS: number; + PATHSEG_MOVETO_REL: number; + PATHSEG_UNKNOWN: number; +} + +interface SVGPathSegArcAbs extends SVGPathSeg { + angle: number; + largeArcFlag: boolean; + r1: number; + r2: number; + sweepFlag: boolean; x: number; - z: number; -} -declare var DeviceAcceleration: { - prototype: DeviceAcceleration; - new(): DeviceAcceleration; + y: number; } -interface HTMLAllCollection extends HTMLCollection { - namedItem(name: string): Element; - // [name: string]: Element; -} -declare var HTMLAllCollection: { - prototype: HTMLAllCollection; - new(): HTMLAllCollection; +declare var SVGPathSegArcAbs: { + prototype: SVGPathSegArcAbs; + new(): SVGPathSegArcAbs; } -interface AesGcmEncryptResult { - ciphertext: ArrayBuffer; - tag: ArrayBuffer; -} -declare var AesGcmEncryptResult: { - prototype: AesGcmEncryptResult; - new(): AesGcmEncryptResult; +interface SVGPathSegArcRel extends SVGPathSeg { + angle: number; + largeArcFlag: boolean; + r1: number; + r2: number; + sweepFlag: boolean; + x: number; + y: number; } -interface NavigationCompletedEvent extends NavigationEvent { - webErrorStatus: number; - isSuccess: boolean; -} -declare var NavigationCompletedEvent: { - prototype: NavigationCompletedEvent; - new(): NavigationCompletedEvent; +declare var SVGPathSegArcRel: { + prototype: SVGPathSegArcRel; + new(): SVGPathSegArcRel; } -interface MutationRecord { - oldValue: string; - previousSibling: Node; - addedNodes: NodeList; - attributeName: string; - removedNodes: NodeList; - target: Node; - nextSibling: Node; - attributeNamespace: string; - type: string; -} -declare var MutationRecord: { - prototype: MutationRecord; - new(): MutationRecord; +interface SVGPathSegClosePath extends SVGPathSeg { } -interface MimeTypeArray { - length: number; - item(index: number): Plugin; - [index: number]: Plugin; - namedItem(type: string): Plugin; - // [type: string]: Plugin; -} -declare var MimeTypeArray: { - prototype: MimeTypeArray; - new(): MimeTypeArray; +declare var SVGPathSegClosePath: { + prototype: SVGPathSegClosePath; + new(): SVGPathSegClosePath; } -interface KeyOperation extends EventTarget { - oncomplete: (ev: Event) => any; - onerror: (ev: ErrorEvent) => any; - result: any; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var KeyOperation: { - prototype: KeyOperation; - new(): KeyOperation; +interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg { + x: number; + x1: number; + x2: number; + y: number; + y1: number; + y2: number; } -interface DOMStringMap { -} -declare var DOMStringMap: { - prototype: DOMStringMap; - new(): DOMStringMap; +declare var SVGPathSegCurvetoCubicAbs: { + prototype: SVGPathSegCurvetoCubicAbs; + new(): SVGPathSegCurvetoCubicAbs; } -interface DeviceOrientationEvent extends Event { - gamma: number; - alpha: number; - absolute: boolean; - beta: number; - initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number, beta: number, gamma: number, absolute: boolean): void; -} -declare var DeviceOrientationEvent: { - prototype: DeviceOrientationEvent; - new(): DeviceOrientationEvent; +interface SVGPathSegCurvetoCubicRel extends SVGPathSeg { + x: number; + x1: number; + x2: number; + y: number; + y1: number; + y2: number; } -interface MSMediaKeys { - keySystem: string; - createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession; -} -declare var MSMediaKeys: { - prototype: MSMediaKeys; - new(keySystem: string): MSMediaKeys; - isTypeSupported(keySystem: string, type?: string): boolean; +declare var SVGPathSegCurvetoCubicRel: { + prototype: SVGPathSegCurvetoCubicRel; + new(): SVGPathSegCurvetoCubicRel; } -interface MSMediaKeyMessageEvent extends Event { - destinationURL: string; - message: Uint8Array; -} -declare var MSMediaKeyMessageEvent: { - prototype: MSMediaKeyMessageEvent; - new(): MSMediaKeyMessageEvent; +interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg { + x: number; + x2: number; + y: number; + y2: number; } -interface MSHTMLWebViewElement extends HTMLElement { - documentTitle: string; - width: number; - src: string; - canGoForward: boolean; +declare var SVGPathSegCurvetoCubicSmoothAbs: { + prototype: SVGPathSegCurvetoCubicSmoothAbs; + new(): SVGPathSegCurvetoCubicSmoothAbs; +} + +interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { + x: number; + x2: number; + y: number; + y2: number; +} + +declare var SVGPathSegCurvetoCubicSmoothRel: { + prototype: SVGPathSegCurvetoCubicSmoothRel; + new(): SVGPathSegCurvetoCubicSmoothRel; +} + +interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg { + x: number; + x1: number; + y: number; + y1: number; +} + +declare var SVGPathSegCurvetoQuadraticAbs: { + prototype: SVGPathSegCurvetoQuadraticAbs; + new(): SVGPathSegCurvetoQuadraticAbs; +} + +interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { + x: number; + x1: number; + y: number; + y1: number; +} + +declare var SVGPathSegCurvetoQuadraticRel: { + prototype: SVGPathSegCurvetoQuadraticRel; + new(): SVGPathSegCurvetoQuadraticRel; +} + +interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegCurvetoQuadraticSmoothAbs: { + prototype: SVGPathSegCurvetoQuadraticSmoothAbs; + new(): SVGPathSegCurvetoQuadraticSmoothAbs; +} + +interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegCurvetoQuadraticSmoothRel: { + prototype: SVGPathSegCurvetoQuadraticSmoothRel; + new(): SVGPathSegCurvetoQuadraticSmoothRel; +} + +interface SVGPathSegLinetoAbs extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegLinetoAbs: { + prototype: SVGPathSegLinetoAbs; + new(): SVGPathSegLinetoAbs; +} + +interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg { + x: number; +} + +declare var SVGPathSegLinetoHorizontalAbs: { + prototype: SVGPathSegLinetoHorizontalAbs; + new(): SVGPathSegLinetoHorizontalAbs; +} + +interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg { + x: number; +} + +declare var SVGPathSegLinetoHorizontalRel: { + prototype: SVGPathSegLinetoHorizontalRel; + new(): SVGPathSegLinetoHorizontalRel; +} + +interface SVGPathSegLinetoRel extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegLinetoRel: { + prototype: SVGPathSegLinetoRel; + new(): SVGPathSegLinetoRel; +} + +interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg { + y: number; +} + +declare var SVGPathSegLinetoVerticalAbs: { + prototype: SVGPathSegLinetoVerticalAbs; + new(): SVGPathSegLinetoVerticalAbs; +} + +interface SVGPathSegLinetoVerticalRel extends SVGPathSeg { + y: number; +} + +declare var SVGPathSegLinetoVerticalRel: { + prototype: SVGPathSegLinetoVerticalRel; + new(): SVGPathSegLinetoVerticalRel; +} + +interface SVGPathSegList { + numberOfItems: number; + appendItem(newItem: SVGPathSeg): SVGPathSeg; + clear(): void; + getItem(index: number): SVGPathSeg; + initialize(newItem: SVGPathSeg): SVGPathSeg; + insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg; + removeItem(index: number): SVGPathSeg; + replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg; +} + +declare var SVGPathSegList: { + prototype: SVGPathSegList; + new(): SVGPathSegList; +} + +interface SVGPathSegMovetoAbs extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegMovetoAbs: { + prototype: SVGPathSegMovetoAbs; + new(): SVGPathSegMovetoAbs; +} + +interface SVGPathSegMovetoRel extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegMovetoRel: { + prototype: SVGPathSegMovetoRel; + new(): SVGPathSegMovetoRel; +} + +interface SVGPatternElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGURIReference, SVGUnitTypes { + height: SVGAnimatedLength; + patternContentUnits: SVGAnimatedEnumeration; + patternTransform: SVGAnimatedTransformList; + patternUnits: SVGAnimatedEnumeration; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPatternElement: { + prototype: SVGPatternElement; + new(): SVGPatternElement; +} + +interface SVGPoint { + x: number; + y: number; + matrixTransform(matrix: SVGMatrix): SVGPoint; +} + +declare var SVGPoint: { + prototype: SVGPoint; + new(): SVGPoint; +} + +interface SVGPointList { + numberOfItems: number; + appendItem(newItem: SVGPoint): SVGPoint; + clear(): void; + getItem(index: number): SVGPoint; + initialize(newItem: SVGPoint): SVGPoint; + insertItemBefore(newItem: SVGPoint, index: number): SVGPoint; + removeItem(index: number): SVGPoint; + replaceItem(newItem: SVGPoint, index: number): SVGPoint; +} + +declare var SVGPointList: { + prototype: SVGPointList; + new(): SVGPointList; +} + +interface SVGPolygonElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPolygonElement: { + prototype: SVGPolygonElement; + new(): SVGPolygonElement; +} + +interface SVGPolylineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPolylineElement: { + prototype: SVGPolylineElement; + new(): SVGPolylineElement; +} + +interface SVGPreserveAspectRatio { + align: number; + meetOrSlice: number; + SVG_MEETORSLICE_MEET: number; + SVG_MEETORSLICE_SLICE: number; + SVG_MEETORSLICE_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_NONE: number; + SVG_PRESERVEASPECTRATIO_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; + SVG_PRESERVEASPECTRATIO_XMAXYMID: number; + SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; + SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; + SVG_PRESERVEASPECTRATIO_XMIDYMID: number; + SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; + SVG_PRESERVEASPECTRATIO_XMINYMAX: number; + SVG_PRESERVEASPECTRATIO_XMINYMID: number; + SVG_PRESERVEASPECTRATIO_XMINYMIN: number; +} + +declare var SVGPreserveAspectRatio: { + prototype: SVGPreserveAspectRatio; + new(): SVGPreserveAspectRatio; + SVG_MEETORSLICE_MEET: number; + SVG_MEETORSLICE_SLICE: number; + SVG_MEETORSLICE_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_NONE: number; + SVG_PRESERVEASPECTRATIO_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; + SVG_PRESERVEASPECTRATIO_XMAXYMID: number; + SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; + SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; + SVG_PRESERVEASPECTRATIO_XMIDYMID: number; + SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; + SVG_PRESERVEASPECTRATIO_XMINYMAX: number; + SVG_PRESERVEASPECTRATIO_XMINYMID: number; + SVG_PRESERVEASPECTRATIO_XMINYMIN: number; +} + +interface SVGRadialGradientElement extends SVGGradientElement { + cx: SVGAnimatedLength; + cy: SVGAnimatedLength; + fx: SVGAnimatedLength; + fy: SVGAnimatedLength; + r: SVGAnimatedLength; +} + +declare var SVGRadialGradientElement: { + prototype: SVGRadialGradientElement; + new(): SVGRadialGradientElement; +} + +interface SVGRect { height: number; - canGoBack: boolean; - navigateWithHttpRequestMessage(requestMessage: any): void; - goBack(): void; - navigate(uri: string): void; - stop(): void; - navigateToString(contents: string): void; - captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation; - capturePreviewToBlobAsync(): MSWebViewAsyncOperation; - refresh(): void; - goForward(): void; - navigateToLocalStreamUri(source: string, streamResolver: any): void; - invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation; - buildLocalStreamUri(contentIdentifier: string, relativePath: string): string; -} -declare var MSHTMLWebViewElement: { - prototype: MSHTMLWebViewElement; - new(): MSHTMLWebViewElement; + width: number; + x: number; + y: number; } -interface NavigationEvent extends Event { - uri: string; -} -declare var NavigationEvent: { - prototype: NavigationEvent; - new(): NavigationEvent; +declare var SVGRect: { + prototype: SVGRect; + new(): SVGRect; } -interface RandomSource { - getRandomValues(array: ArrayBufferView): ArrayBufferView; +interface SVGRectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + height: SVGAnimatedLength; + rx: SVGAnimatedLength; + ry: SVGAnimatedLength; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGRectElement: { + prototype: SVGRectElement; + new(): SVGRectElement; +} + +interface SVGSVGElement extends SVGElement, DocumentEvent, SVGLocatable, SVGTests, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan { + contentScriptType: string; + contentStyleType: string; + currentScale: number; + currentTranslate: SVGPoint; + height: SVGAnimatedLength; + onabort: (ev: Event) => any; + onerror: (ev: Event) => any; + onresize: (ev: UIEvent) => any; + onscroll: (ev: UIEvent) => any; + onunload: (ev: Event) => any; + onzoom: (ev: SVGZoomEvent) => any; + pixelUnitToMillimeterX: number; + pixelUnitToMillimeterY: number; + screenPixelToMillimeterX: number; + screenPixelToMillimeterY: number; + viewport: SVGRect; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + checkEnclosure(element: SVGElement, rect: SVGRect): boolean; + checkIntersection(element: SVGElement, rect: SVGRect): boolean; + createSVGAngle(): SVGAngle; + createSVGLength(): SVGLength; + createSVGMatrix(): SVGMatrix; + createSVGNumber(): SVGNumber; + createSVGPoint(): SVGPoint; + createSVGRect(): SVGRect; + createSVGTransform(): SVGTransform; + createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; + deselectAll(): void; + forceRedraw(): void; + getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; + getCurrentTime(): number; + getElementById(elementId: string): Element; + getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeList; + getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeList; + pauseAnimations(): void; + setCurrentTime(seconds: number): void; + suspendRedraw(maxWaitMilliseconds: number): number; + unpauseAnimations(): void; + unsuspendRedraw(suspendHandleID: number): void; + unsuspendRedrawAll(): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "SVGAbort", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "SVGError", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "SVGUnload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "SVGZoom", listener: (ev: SVGZoomEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGSVGElement: { + prototype: SVGSVGElement; + new(): SVGSVGElement; +} + +interface SVGScriptElement extends SVGElement, SVGExternalResourcesRequired, SVGURIReference { + type: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGScriptElement: { + prototype: SVGScriptElement; + new(): SVGScriptElement; +} + +interface SVGStopElement extends SVGElement, SVGStylable { + offset: SVGAnimatedNumber; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGStopElement: { + prototype: SVGStopElement; + new(): SVGStopElement; +} + +interface SVGStringList { + numberOfItems: number; + appendItem(newItem: string): string; + clear(): void; + getItem(index: number): string; + initialize(newItem: string): string; + insertItemBefore(newItem: string, index: number): string; + removeItem(index: number): string; + replaceItem(newItem: string, index: number): string; +} + +declare var SVGStringList: { + prototype: SVGStringList; + new(): SVGStringList; +} + +interface SVGStyleElement extends SVGElement, SVGLangSpace { + media: string; + title: string; + type: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGStyleElement: { + prototype: SVGStyleElement; + new(): SVGStyleElement; +} + +interface SVGSwitchElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGSwitchElement: { + prototype: SVGSwitchElement; + new(): SVGSwitchElement; +} + +interface SVGSymbolElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGSymbolElement: { + prototype: SVGSymbolElement; + new(): SVGSymbolElement; +} + +interface SVGTSpanElement extends SVGTextPositioningElement { +} + +declare var SVGTSpanElement: { + prototype: SVGTSpanElement; + new(): SVGTSpanElement; +} + +interface SVGTextContentElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + lengthAdjust: SVGAnimatedEnumeration; + textLength: SVGAnimatedLength; + getCharNumAtPosition(point: SVGPoint): number; + getComputedTextLength(): number; + getEndPositionOfChar(charnum: number): SVGPoint; + getExtentOfChar(charnum: number): SVGRect; + getNumberOfChars(): number; + getRotationOfChar(charnum: number): number; + getStartPositionOfChar(charnum: number): SVGPoint; + getSubStringLength(charnum: number, nchars: number): number; + selectSubString(charnum: number, nchars: number): void; + LENGTHADJUST_SPACING: number; + LENGTHADJUST_SPACINGANDGLYPHS: number; + LENGTHADJUST_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTextContentElement: { + prototype: SVGTextContentElement; + new(): SVGTextContentElement; + LENGTHADJUST_SPACING: number; + LENGTHADJUST_SPACINGANDGLYPHS: number; + LENGTHADJUST_UNKNOWN: number; +} + +interface SVGTextElement extends SVGTextPositioningElement, SVGTransformable { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTextElement: { + prototype: SVGTextElement; + new(): SVGTextElement; +} + +interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { + method: SVGAnimatedEnumeration; + spacing: SVGAnimatedEnumeration; + startOffset: SVGAnimatedLength; + TEXTPATH_METHODTYPE_ALIGN: number; + TEXTPATH_METHODTYPE_STRETCH: number; + TEXTPATH_METHODTYPE_UNKNOWN: number; + TEXTPATH_SPACINGTYPE_AUTO: number; + TEXTPATH_SPACINGTYPE_EXACT: number; + TEXTPATH_SPACINGTYPE_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTextPathElement: { + prototype: SVGTextPathElement; + new(): SVGTextPathElement; + TEXTPATH_METHODTYPE_ALIGN: number; + TEXTPATH_METHODTYPE_STRETCH: number; + TEXTPATH_METHODTYPE_UNKNOWN: number; + TEXTPATH_SPACINGTYPE_AUTO: number; + TEXTPATH_SPACINGTYPE_EXACT: number; + TEXTPATH_SPACINGTYPE_UNKNOWN: number; +} + +interface SVGTextPositioningElement extends SVGTextContentElement { + dx: SVGAnimatedLengthList; + dy: SVGAnimatedLengthList; + rotate: SVGAnimatedNumberList; + x: SVGAnimatedLengthList; + y: SVGAnimatedLengthList; +} + +declare var SVGTextPositioningElement: { + prototype: SVGTextPositioningElement; + new(): SVGTextPositioningElement; +} + +interface SVGTitleElement extends SVGElement, SVGStylable, SVGLangSpace { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTitleElement: { + prototype: SVGTitleElement; + new(): SVGTitleElement; +} + +interface SVGTransform { + angle: number; + matrix: SVGMatrix; + type: number; + setMatrix(matrix: SVGMatrix): void; + setRotate(angle: number, cx: number, cy: number): void; + setScale(sx: number, sy: number): void; + setSkewX(angle: number): void; + setSkewY(angle: number): void; + setTranslate(tx: number, ty: number): void; + SVG_TRANSFORM_MATRIX: number; + SVG_TRANSFORM_ROTATE: number; + SVG_TRANSFORM_SCALE: number; + SVG_TRANSFORM_SKEWX: number; + SVG_TRANSFORM_SKEWY: number; + SVG_TRANSFORM_TRANSLATE: number; + SVG_TRANSFORM_UNKNOWN: number; +} + +declare var SVGTransform: { + prototype: SVGTransform; + new(): SVGTransform; + SVG_TRANSFORM_MATRIX: number; + SVG_TRANSFORM_ROTATE: number; + SVG_TRANSFORM_SCALE: number; + SVG_TRANSFORM_SKEWX: number; + SVG_TRANSFORM_SKEWY: number; + SVG_TRANSFORM_TRANSLATE: number; + SVG_TRANSFORM_UNKNOWN: number; +} + +interface SVGTransformList { + numberOfItems: number; + appendItem(newItem: SVGTransform): SVGTransform; + clear(): void; + consolidate(): SVGTransform; + createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; + getItem(index: number): SVGTransform; + initialize(newItem: SVGTransform): SVGTransform; + insertItemBefore(newItem: SVGTransform, index: number): SVGTransform; + removeItem(index: number): SVGTransform; + replaceItem(newItem: SVGTransform, index: number): SVGTransform; +} + +declare var SVGTransformList: { + prototype: SVGTransformList; + new(): SVGTransformList; +} + +interface SVGUnitTypes { + SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; + SVG_UNIT_TYPE_UNKNOWN: number; + SVG_UNIT_TYPE_USERSPACEONUSE: number; +} +declare var SVGUnitTypes: SVGUnitTypes; + +interface SVGUseElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { + animatedInstanceRoot: SVGElementInstance; + height: SVGAnimatedLength; + instanceRoot: SVGElementInstance; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGUseElement: { + prototype: SVGUseElement; + new(): SVGUseElement; +} + +interface SVGViewElement extends SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan { + viewTarget: SVGStringList; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGViewElement: { + prototype: SVGViewElement; + new(): SVGViewElement; +} + +interface SVGZoomAndPan { + SVG_ZOOMANDPAN_DISABLE: number; + SVG_ZOOMANDPAN_MAGNIFY: number; + SVG_ZOOMANDPAN_UNKNOWN: number; +} +declare var SVGZoomAndPan: SVGZoomAndPan; + +interface SVGZoomEvent extends UIEvent { + newScale: number; + newTranslate: SVGPoint; + previousScale: number; + previousTranslate: SVGPoint; + zoomRectScreen: SVGRect; +} + +declare var SVGZoomEvent: { + prototype: SVGZoomEvent; + new(): SVGZoomEvent; +} + +interface Screen extends EventTarget { + availHeight: number; + availWidth: number; + bufferDepth: number; + colorDepth: number; + deviceXDPI: number; + deviceYDPI: number; + fontSmoothingEnabled: boolean; + height: number; + logicalXDPI: number; + logicalYDPI: number; + msOrientation: string; + onmsorientationchange: (ev: Event) => any; + pixelDepth: number; + systemXDPI: number; + systemYDPI: number; + width: number; + msLockOrientation(orientations: string): boolean; + msLockOrientation(orientations: string[]): boolean; + msUnlockOrientation(): void; + addEventListener(type: "MSOrientationChange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Screen: { + prototype: Screen; + new(): Screen; +} + +interface ScriptNotifyEvent extends Event { + callingUri: string; + value: string; +} + +declare var ScriptNotifyEvent: { + prototype: ScriptNotifyEvent; + new(): ScriptNotifyEvent; +} + +interface ScriptProcessorNode extends AudioNode { + bufferSize: number; + onaudioprocess: (ev: AudioProcessingEvent) => any; + addEventListener(type: "audioprocess", listener: (ev: AudioProcessingEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var ScriptProcessorNode: { + prototype: ScriptProcessorNode; + new(): ScriptProcessorNode; +} + +interface Selection { + anchorNode: Node; + anchorOffset: number; + focusNode: Node; + focusOffset: number; + isCollapsed: boolean; + rangeCount: number; + type: string; + addRange(range: Range): void; + collapse(parentNode: Node, offset: number): void; + collapseToEnd(): void; + collapseToStart(): void; + containsNode(node: Node, partlyContained: boolean): boolean; + deleteFromDocument(): void; + empty(): void; + extend(newNode: Node, offset: number): void; + getRangeAt(index: number): Range; + removeAllRanges(): void; + removeRange(range: Range): void; + selectAllChildren(parentNode: Node): void; + setBaseAndExtent(baseNode: Node, baseOffset: number, extentNode: Node, extentOffset: number): void; + toString(): string; +} + +declare var Selection: { + prototype: Selection; + new(): Selection; } interface SourceBuffer extends EventTarget { - updating: boolean; - appendWindowStart: number; appendWindowEnd: number; - buffered: TimeRanges; - timestampOffset: number; + appendWindowStart: number; audioTracks: AudioTrackList; - appendBuffer(data: ArrayBuffer): void; - remove(start: number, end: number): void; + buffered: TimeRanges; + mode: string; + timestampOffset: number; + updating: boolean; + videoTracks: VideoTrackList; abort(): void; + appendBuffer(data: ArrayBuffer): void; + appendBuffer(data: ArrayBufferView): void; appendStream(stream: MSStream, maxSize?: number): void; + remove(start: number, end: number): void; } + declare var SourceBuffer: { prototype: SourceBuffer; new(): SourceBuffer; } -interface MSInputMethodContext extends EventTarget { - oncandidatewindowshow: (ev: any) => any; - target: HTMLElement; - compositionStartOffset: number; - oncandidatewindowhide: (ev: any) => any; - oncandidatewindowupdate: (ev: any) => any; - compositionEndOffset: number; - getCompositionAlternatives(): string[]; - getCandidateWindowClientRect(): ClientRect; - hasComposition(): boolean; - isCandidateWindowVisible(): boolean; - addEventListener(type: "candidatewindowshow", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "candidatewindowhide", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "candidatewindowupdate", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var MSInputMethodContext: { - prototype: MSInputMethodContext; - new(): MSInputMethodContext; -} - -interface DeviceRotationRate { - gamma: number; - alpha: number; - beta: number; -} -declare var DeviceRotationRate: { - prototype: DeviceRotationRate; - new(): DeviceRotationRate; -} - -interface PluginArray { - length: number; - refresh(reload?: boolean): void; - item(index: number): Plugin; - [index: number]: Plugin; - namedItem(name: string): Plugin; - // [name: string]: Plugin; -} -declare var PluginArray: { - prototype: PluginArray; - new(): PluginArray; -} - -interface MSMediaKeyError { - systemCode: number; - code: number; - MS_MEDIA_KEYERR_SERVICE: number; - MS_MEDIA_KEYERR_HARDWARECHANGE: number; - MS_MEDIA_KEYERR_OUTPUT: number; - MS_MEDIA_KEYERR_DOMAIN: number; - MS_MEDIA_KEYERR_UNKNOWN: number; - MS_MEDIA_KEYERR_CLIENT: number; -} -declare var MSMediaKeyError: { - prototype: MSMediaKeyError; - new(): MSMediaKeyError; - MS_MEDIA_KEYERR_SERVICE: number; - MS_MEDIA_KEYERR_HARDWARECHANGE: number; - MS_MEDIA_KEYERR_OUTPUT: number; - MS_MEDIA_KEYERR_DOMAIN: number; - MS_MEDIA_KEYERR_UNKNOWN: number; - MS_MEDIA_KEYERR_CLIENT: number; -} - -interface Plugin { - length: number; - filename: string; - version: string; - name: string; - description: string; - item(index: number): MimeType; - [index: number]: MimeType; - namedItem(type: string): MimeType; - // [type: string]: MimeType; -} -declare var Plugin: { - prototype: Plugin; - new(): Plugin; -} - -interface MediaSource extends EventTarget { - sourceBuffers: SourceBufferList; - duration: number; - readyState: string; - activeSourceBuffers: SourceBufferList; - addSourceBuffer(type: string): SourceBuffer; - endOfStream(error?: string): void; - removeSourceBuffer(sourceBuffer: SourceBuffer): void; -} -declare var MediaSource: { - prototype: MediaSource; - new(): MediaSource; - isTypeSupported(type: string): boolean; -} - interface SourceBufferList extends EventTarget { length: number; item(index: number): SourceBuffer; [index: number]: SourceBuffer; } + declare var SourceBufferList: { prototype: SourceBufferList; new(): SourceBufferList; } -interface XMLDocument extends Document { -} -declare var XMLDocument: { - prototype: XMLDocument; - new(): XMLDocument; +interface StereoPannerNode extends AudioNode { + pan: AudioParam; } -interface DeviceMotionEvent extends Event { - rotationRate: DeviceRotationRate; - acceleration: DeviceAcceleration; - interval: number; - accelerationIncludingGravity: DeviceAcceleration; - initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict, accelerationIncludingGravity: DeviceAccelerationDict, rotationRate: DeviceRotationRateDict, interval: number): void; -} -declare var DeviceMotionEvent: { - prototype: DeviceMotionEvent; - new(): DeviceMotionEvent; +declare var StereoPannerNode: { + prototype: StereoPannerNode; + new(): StereoPannerNode; } -interface MimeType { - enabledPlugin: Plugin; - suffixes: string; +interface Storage { + length: number; + clear(): void; + getItem(key: string): any; + key(index: number): string; + removeItem(key: string): void; + setItem(key: string, data: string): void; + [key: string]: any; + [index: number]: string; +} + +declare var Storage: { + prototype: Storage; + new(): Storage; +} + +interface StorageEvent extends Event { + key: string; + newValue: any; + oldValue: any; + storageArea: Storage; + url: string; + initStorageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, keyArg: string, oldValueArg: any, newValueArg: any, urlArg: string, storageAreaArg: Storage): void; +} + +declare var StorageEvent: { + prototype: StorageEvent; + new(): StorageEvent; +} + +interface StyleMedia { type: string; - description: string; -} -declare var MimeType: { - prototype: MimeType; - new(): MimeType; + matchMedium(mediaquery: string): boolean; } -interface PointerEvent extends MouseEvent { +declare var StyleMedia: { + prototype: StyleMedia; + new(): StyleMedia; +} + +interface StyleSheet { + disabled: boolean; + href: string; + media: MediaList; + ownerNode: Node; + parentStyleSheet: StyleSheet; + title: string; + type: string; +} + +declare var StyleSheet: { + prototype: StyleSheet; + new(): StyleSheet; +} + +interface StyleSheetList { + length: number; + item(index?: number): StyleSheet; + [index: number]: StyleSheet; +} + +declare var StyleSheetList: { + prototype: StyleSheetList; + new(): StyleSheetList; +} + +interface StyleSheetPageList { + length: number; + item(index: number): CSSPageRule; + [index: number]: CSSPageRule; +} + +declare var StyleSheetPageList: { + prototype: StyleSheetPageList; + new(): StyleSheetPageList; +} + +interface SubtleCrypto { + decrypt(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; + decrypt(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; + deriveBits(algorithm: string, baseKey: CryptoKey, length: number): any; + deriveBits(algorithm: Algorithm, baseKey: CryptoKey, length: number): any; + deriveKey(algorithm: string, baseKey: CryptoKey, derivedKeyType: string, extractable: boolean, keyUsages: string[]): any; + deriveKey(algorithm: string, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: boolean, keyUsages: string[]): any; + deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: string, extractable: boolean, keyUsages: string[]): any; + deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: boolean, keyUsages: string[]): any; + digest(algorithm: string, data: ArrayBufferView): any; + digest(algorithm: Algorithm, data: ArrayBufferView): any; + encrypt(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; + encrypt(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; + exportKey(format: string, key: CryptoKey): any; + generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): any; + generateKey(algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + importKey(format: string, keyData: ArrayBufferView, algorithm: string, extractable: boolean, keyUsages: string[]): any; + importKey(format: string, keyData: ArrayBufferView, algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + sign(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; + sign(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + verify(algorithm: string, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): any; + verify(algorithm: Algorithm, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): any; + wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string): any; + wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: Algorithm): any; +} + +declare var SubtleCrypto: { + prototype: SubtleCrypto; + new(): SubtleCrypto; +} + +interface Text extends CharacterData { + wholeText: string; + replaceWholeText(content: string): Text; + splitText(offset: number): Text; +} + +declare var Text: { + prototype: Text; + new(): Text; +} + +interface TextEvent extends UIEvent { + data: string; + inputMethod: number; + locale: string; + initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void; + DOM_INPUT_METHOD_DROP: number; + DOM_INPUT_METHOD_HANDWRITING: number; + DOM_INPUT_METHOD_IME: number; + DOM_INPUT_METHOD_KEYBOARD: number; + DOM_INPUT_METHOD_MULTIMODAL: number; + DOM_INPUT_METHOD_OPTION: number; + DOM_INPUT_METHOD_PASTE: number; + DOM_INPUT_METHOD_SCRIPT: number; + DOM_INPUT_METHOD_UNKNOWN: number; + DOM_INPUT_METHOD_VOICE: number; +} + +declare var TextEvent: { + prototype: TextEvent; + new(): TextEvent; + DOM_INPUT_METHOD_DROP: number; + DOM_INPUT_METHOD_HANDWRITING: number; + DOM_INPUT_METHOD_IME: number; + DOM_INPUT_METHOD_KEYBOARD: number; + DOM_INPUT_METHOD_MULTIMODAL: number; + DOM_INPUT_METHOD_OPTION: number; + DOM_INPUT_METHOD_PASTE: number; + DOM_INPUT_METHOD_SCRIPT: number; + DOM_INPUT_METHOD_UNKNOWN: number; + DOM_INPUT_METHOD_VOICE: number; +} + +interface TextMetrics { width: number; - rotation: number; - pressure: number; - pointerType: any; - isPrimary: boolean; - tiltY: number; - height: number; - intermediatePoints: any; - currentPoint: any; - tiltX: number; - hwTimestamp: number; - pointerId: number; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; -} -declare var PointerEvent: { - prototype: PointerEvent; - new(): PointerEvent; } -interface MSDocumentExtensions { - captureEvents(): void; - releaseEvents(): void; +declare var TextMetrics: { + prototype: TextMetrics; + new(): TextMetrics; } -interface MutationObserver { - observe(target: Node, options: MutationObserverInit): void; - takeRecords(): MutationRecord[]; - disconnect(): void; -} -declare var MutationObserver: { - prototype: MutationObserver; - new (callback: (arr: MutationRecord[], observer: MutationObserver)=>any): MutationObserver; +interface TextRange { + boundingHeight: number; + boundingLeft: number; + boundingTop: number; + boundingWidth: number; + htmlText: string; + offsetLeft: number; + offsetTop: number; + text: string; + collapse(start?: boolean): void; + compareEndPoints(how: string, sourceRange: TextRange): number; + duplicate(): TextRange; + execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; + execCommandShowHelp(cmdID: string): boolean; + expand(Unit: string): boolean; + findText(string: string, count?: number, flags?: number): boolean; + getBookmark(): string; + getBoundingClientRect(): ClientRect; + getClientRects(): ClientRectList; + inRange(range: TextRange): boolean; + isEqual(range: TextRange): boolean; + move(unit: string, count?: number): number; + moveEnd(unit: string, count?: number): number; + moveStart(unit: string, count?: number): number; + moveToBookmark(bookmark: string): boolean; + moveToElementText(element: Element): void; + moveToPoint(x: number, y: number): void; + parentElement(): Element; + pasteHTML(html: string): void; + queryCommandEnabled(cmdID: string): boolean; + queryCommandIndeterm(cmdID: string): boolean; + queryCommandState(cmdID: string): boolean; + queryCommandSupported(cmdID: string): boolean; + queryCommandText(cmdID: string): string; + queryCommandValue(cmdID: string): any; + scrollIntoView(fStart?: boolean): void; + select(): void; + setEndPoint(how: string, SourceRange: TextRange): void; } -interface MSWebViewAsyncOperation extends EventTarget { - target: MSHTMLWebViewElement; - oncomplete: (ev: Event) => any; - error: DOMError; - onerror: (ev: ErrorEvent) => any; +declare var TextRange: { + prototype: TextRange; + new(): TextRange; +} + +interface TextRangeCollection { + length: number; + item(index: number): TextRange; + [index: number]: TextRange; +} + +declare var TextRangeCollection: { + prototype: TextRangeCollection; + new(): TextRangeCollection; +} + +interface TextTrack extends EventTarget { + activeCues: TextTrackCueList; + cues: TextTrackCueList; + inBandMetadataTrackDispatchType: string; + kind: string; + label: string; + language: string; + mode: any; + oncuechange: (ev: Event) => any; + onerror: (ev: Event) => any; + onload: (ev: Event) => any; readyState: number; - type: number; - result: any; - start(): void; + addCue(cue: TextTrackCue): void; + removeCue(cue: TextTrackCue): void; + DISABLED: number; ERROR: number; - TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; - TYPE_INVOKE_SCRIPT: number; - COMPLETED: number; - TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; - STARTED: number; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + HIDDEN: number; + LOADED: number; + LOADING: number; + NONE: number; + SHOWING: number; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -declare var MSWebViewAsyncOperation: { - prototype: MSWebViewAsyncOperation; - new(): MSWebViewAsyncOperation; + +declare var TextTrack: { + prototype: TextTrack; + new(): TextTrack; + DISABLED: number; ERROR: number; - TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; - TYPE_INVOKE_SCRIPT: number; - COMPLETED: number; - TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; - STARTED: number; + HIDDEN: number; + LOADED: number; + LOADING: number; + NONE: number; + SHOWING: number; } -interface ScriptNotifyEvent extends Event { - value: string; - callingUri: string; -} -declare var ScriptNotifyEvent: { - prototype: ScriptNotifyEvent; - new(): ScriptNotifyEvent; +interface TextTrackCue extends EventTarget { + endTime: number; + id: string; + onenter: (ev: Event) => any; + onexit: (ev: Event) => any; + pauseOnExit: boolean; + startTime: number; + text: string; + track: TextTrack; + getCueAsHTML(): DocumentFragment; + addEventListener(type: "enter", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "exit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } -interface PerformanceNavigationTiming extends PerformanceEntry { - redirectStart: number; - domainLookupEnd: number; - responseStart: number; - domComplete: number; - domainLookupStart: number; - loadEventStart: number; - unloadEventEnd: number; - fetchStart: number; - requestStart: number; - domInteractive: number; - navigationStart: number; - connectEnd: number; - loadEventEnd: number; - connectStart: number; - responseEnd: number; - domLoading: number; - redirectEnd: number; - redirectCount: number; - unloadEventStart: number; - domContentLoadedEventStart: number; - domContentLoadedEventEnd: number; - type: string; -} -declare var PerformanceNavigationTiming: { - prototype: PerformanceNavigationTiming; - new(): PerformanceNavigationTiming; +declare var TextTrackCue: { + prototype: TextTrackCue; + new(startTime: number, endTime: number, text: string): TextTrackCue; } -interface MSMediaKeyNeededEvent extends Event { - initData: Uint8Array; -} -declare var MSMediaKeyNeededEvent: { - prototype: MSMediaKeyNeededEvent; - new(): MSMediaKeyNeededEvent; +interface TextTrackCueList { + length: number; + getCueById(id: string): TextTrackCue; + item(index: number): TextTrackCue; + [index: number]: TextTrackCue; } -interface LongRunningScriptDetectedEvent extends Event { - stopPageScriptExecution: boolean; - executionTime: number; -} -declare var LongRunningScriptDetectedEvent: { - prototype: LongRunningScriptDetectedEvent; - new(): LongRunningScriptDetectedEvent; +declare var TextTrackCueList: { + prototype: TextTrackCueList; + new(): TextTrackCueList; } -interface MSAppView { - viewId: number; - close(): void; - postMessage(message: any, targetOrigin: string, ports?: any): void; -} -declare var MSAppView: { - prototype: MSAppView; - new(): MSAppView; +interface TextTrackList extends EventTarget { + length: number; + onaddtrack: (ev: TrackEvent) => any; + item(index: number): TextTrack; + addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: TextTrack; } -interface PerfWidgetExternal { - maxCpuSpeed: number; - independentRenderingEnabled: boolean; - irDisablingContentString: string; - irStatusAvailable: boolean; - performanceCounter: number; - averagePaintTime: number; - activeNetworkRequestCount: number; - paintRequestsPerSecond: number; - extraInformationEnabled: boolean; - performanceCounterFrequency: number; - averageFrameTime: number; - repositionWindow(x: number, y: number): void; - getRecentMemoryUsage(last: number): any; - getMemoryUsage(): number; - resizeWindow(width: number, height: number): void; - getProcessCpuUsage(): number; - removeEventListener(eventType: string, callback: (ev: any) => any): void; - getRecentCpuUsage(last: number): any; - addEventListener(eventType: string, callback: (ev: any) => any): void; - getRecentFrames(last: number): any; - getRecentPaintRequests(last: number): any; -} -declare var PerfWidgetExternal: { - prototype: PerfWidgetExternal; - new(): PerfWidgetExternal; +declare var TextTrackList: { + prototype: TextTrackList; + new(): TextTrackList; } -interface PageTransitionEvent extends Event { - persisted: boolean; -} -declare var PageTransitionEvent: { - prototype: PageTransitionEvent; - new(): PageTransitionEvent; +interface TimeRanges { + length: number; + end(index: number): number; + start(index: number): number; } -interface MutationCallback { - (mutations: MutationRecord[], observer: MutationObserver): void; +declare var TimeRanges: { + prototype: TimeRanges; + new(): TimeRanges; } -interface HTMLDocument extends Document { -} -declare var HTMLDocument: { - prototype: HTMLDocument; - new(): HTMLDocument; +interface Touch { + clientX: number; + clientY: number; + identifier: number; + pageX: number; + pageY: number; + screenX: number; + screenY: number; + target: EventTarget; } -interface KeyPair { - privateKey: Key; - publicKey: Key; -} -declare var KeyPair: { - prototype: KeyPair; - new(): KeyPair; +declare var Touch: { + prototype: Touch; + new(): Touch; } -interface MSMediaKeySession extends EventTarget { - sessionId: string; - error: MSMediaKeyError; - keySystem: string; - close(): void; - update(key: Uint8Array): void; -} -declare var MSMediaKeySession: { - prototype: MSMediaKeySession; - new(): MSMediaKeySession; +interface TouchEvent extends UIEvent { + altKey: boolean; + changedTouches: TouchList; + ctrlKey: boolean; + metaKey: boolean; + shiftKey: boolean; + targetTouches: TouchList; + touches: TouchList; } -interface UnviewableContentIdentifiedEvent extends NavigationEvent { - referrer: string; +declare var TouchEvent: { + prototype: TouchEvent; + new(): TouchEvent; } + +interface TouchList { + length: number; + item(index: number): Touch; + [index: number]: Touch; +} + +declare var TouchList: { + prototype: TouchList; + new(): TouchList; +} + +interface TrackEvent extends Event { + track: any; +} + +declare var TrackEvent: { + prototype: TrackEvent; + new(): TrackEvent; +} + +interface TransitionEvent extends Event { + elapsedTime: number; + propertyName: string; + initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void; +} + +declare var TransitionEvent: { + prototype: TransitionEvent; + new(): TransitionEvent; +} + +interface TreeWalker { + currentNode: Node; + expandEntityReferences: boolean; + filter: NodeFilter; + root: Node; + whatToShow: number; + firstChild(): Node; + lastChild(): Node; + nextNode(): Node; + nextSibling(): Node; + parentNode(): Node; + previousNode(): Node; + previousSibling(): Node; +} + +declare var TreeWalker: { + prototype: TreeWalker; + new(): TreeWalker; +} + +interface UIEvent extends Event { + detail: number; + view: Window; + initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void; +} + +declare var UIEvent: { + prototype: UIEvent; + new(type: string, eventInitDict?: UIEventInit): UIEvent; +} + +interface URL { + createObjectURL(object: any, options?: ObjectURLOptions): string; + revokeObjectURL(url: string): void; +} +declare var URL: URL; + +interface UnviewableContentIdentifiedEvent extends NavigationEventWithReferrer { + mediaType: string; +} + declare var UnviewableContentIdentifiedEvent: { prototype: UnviewableContentIdentifiedEvent; new(): UnviewableContentIdentifiedEvent; } -interface CryptoOperation extends EventTarget { - algorithm: Algorithm; - oncomplete: (ev: Event) => any; - onerror: (ev: ErrorEvent) => any; - onprogress: (ev: ProgressEvent) => any; - onabort: (ev: UIEvent) => any; - key: Key; - result: any; - abort(): void; - finish(): void; - process(buffer: ArrayBufferView): void; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var CryptoOperation: { - prototype: CryptoOperation; - new(): CryptoOperation; +interface ValidityState { + badInput: boolean; + customError: boolean; + patternMismatch: boolean; + rangeOverflow: boolean; + rangeUnderflow: boolean; + stepMismatch: boolean; + tooLong: boolean; + typeMismatch: boolean; + valid: boolean; + valueMissing: boolean; } -interface WebGLTexture extends WebGLObject { -} -declare var WebGLTexture: { - prototype: WebGLTexture; - new(): WebGLTexture; +declare var ValidityState: { + prototype: ValidityState; + new(): ValidityState; } -interface OES_texture_float { -} -declare var OES_texture_float: { - prototype: OES_texture_float; - new(): OES_texture_float; +interface VideoPlaybackQuality { + corruptedVideoFrames: number; + creationTime: number; + droppedVideoFrames: number; + totalFrameDelay: number; + totalVideoFrames: number; } -interface WebGLContextEvent extends Event { - statusMessage: string; -} -declare var WebGLContextEvent: { - prototype: WebGLContextEvent; - new(): WebGLContextEvent; +declare var VideoPlaybackQuality: { + prototype: VideoPlaybackQuality; + new(): VideoPlaybackQuality; } -interface WebGLRenderbuffer extends WebGLObject { -} -declare var WebGLRenderbuffer: { - prototype: WebGLRenderbuffer; - new(): WebGLRenderbuffer; +interface VideoTrack { + id: string; + kind: string; + label: string; + language: string; + selected: boolean; + sourceBuffer: SourceBuffer; } -interface WebGLUniformLocation { +declare var VideoTrack: { + prototype: VideoTrack; + new(): VideoTrack; } -declare var WebGLUniformLocation: { - prototype: WebGLUniformLocation; - new(): WebGLUniformLocation; + +interface VideoTrackList extends EventTarget { + length: number; + onaddtrack: (ev: TrackEvent) => any; + onchange: (ev: Event) => any; + onremovetrack: (ev: TrackEvent) => any; + selectedIndex: number; + getTrackById(id: string): VideoTrack; + item(index: number): VideoTrack; + addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "removetrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: VideoTrack; +} + +declare var VideoTrackList: { + prototype: VideoTrackList; + new(): VideoTrackList; +} + +interface WEBGL_compressed_texture_s3tc { + COMPRESSED_RGBA_S3TC_DXT1_EXT: number; + COMPRESSED_RGBA_S3TC_DXT3_EXT: number; + COMPRESSED_RGBA_S3TC_DXT5_EXT: number; + COMPRESSED_RGB_S3TC_DXT1_EXT: number; +} + +declare var WEBGL_compressed_texture_s3tc: { + prototype: WEBGL_compressed_texture_s3tc; + new(): WEBGL_compressed_texture_s3tc; + COMPRESSED_RGBA_S3TC_DXT1_EXT: number; + COMPRESSED_RGBA_S3TC_DXT3_EXT: number; + COMPRESSED_RGBA_S3TC_DXT5_EXT: number; + COMPRESSED_RGB_S3TC_DXT1_EXT: number; +} + +interface WEBGL_debug_renderer_info { + UNMASKED_RENDERER_WEBGL: number; + UNMASKED_VENDOR_WEBGL: number; +} + +declare var WEBGL_debug_renderer_info: { + prototype: WEBGL_debug_renderer_info; + new(): WEBGL_debug_renderer_info; + UNMASKED_RENDERER_WEBGL: number; + UNMASKED_VENDOR_WEBGL: number; +} + +interface WEBGL_depth_texture { + UNSIGNED_INT_24_8_WEBGL: number; +} + +declare var WEBGL_depth_texture: { + prototype: WEBGL_depth_texture; + new(): WEBGL_depth_texture; + UNSIGNED_INT_24_8_WEBGL: number; +} + +interface WaveShaperNode extends AudioNode { + curve: any; + oversample: string; +} + +declare var WaveShaperNode: { + prototype: WaveShaperNode; + new(): WaveShaperNode; } interface WebGLActiveInfo { name: string; - type: number; size: number; + type: number; } + declare var WebGLActiveInfo: { prototype: WebGLActiveInfo; new(): WebGLActiveInfo; } -interface WEBGL_compressed_texture_s3tc { - COMPRESSED_RGBA_S3TC_DXT1_EXT: number; - COMPRESSED_RGBA_S3TC_DXT5_EXT: number; - COMPRESSED_RGBA_S3TC_DXT3_EXT: number; - COMPRESSED_RGB_S3TC_DXT1_EXT: number; -} -declare var WEBGL_compressed_texture_s3tc: { - prototype: WEBGL_compressed_texture_s3tc; - new(): WEBGL_compressed_texture_s3tc; - COMPRESSED_RGBA_S3TC_DXT1_EXT: number; - COMPRESSED_RGBA_S3TC_DXT5_EXT: number; - COMPRESSED_RGBA_S3TC_DXT3_EXT: number; - COMPRESSED_RGB_S3TC_DXT1_EXT: number; -} - -interface WebGLRenderingContext { - drawingBufferWidth: number; - drawingBufferHeight: number; - canvas: HTMLCanvasElement; - getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation; - bindTexture(target: number, texture: WebGLTexture): void; - bufferData(target: number, data: ArrayBufferView, usage: number): void; - bufferData(target: number, data: ArrayBuffer, usage: number): void; - bufferData(target: number, size: number, usage: number): void; - depthMask(flag: boolean): void; - getUniform(program: WebGLProgram, location: WebGLUniformLocation): any; - vertexAttrib3fv(indx: number, values: number[]): void; - vertexAttrib3fv(indx: number, values: Float32Array): void; - linkProgram(program: WebGLProgram): void; - getSupportedExtensions(): string[]; - bufferSubData(target: number, offset: number, data: ArrayBuffer): void; - bufferSubData(target: number, offset: number, data: ArrayBufferView): void; - vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void; - polygonOffset(factor: number, units: number): void; - blendColor(red: number, green: number, blue: number, alpha: number): void; - createTexture(): WebGLTexture; - hint(target: number, mode: number): void; - getVertexAttrib(index: number, pname: number): any; - enableVertexAttribArray(index: number): void; - depthRange(zNear: number, zFar: number): void; - cullFace(mode: number): void; - createFramebuffer(): WebGLFramebuffer; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; - framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture, level: number): void; - deleteFramebuffer(framebuffer: WebGLFramebuffer): void; - colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; - compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; - getExtension(name: string): any; - createProgram(): WebGLProgram; - deleteShader(shader: WebGLShader): void; - getAttachedShaders(program: WebGLProgram): WebGLShader[]; - enable(cap: number): void; - blendEquation(mode: number): void; - texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels: ArrayBufferView): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, image: HTMLImageElement): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, canvas: HTMLCanvasElement): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, video: HTMLVideoElement): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageData): void; - createBuffer(): WebGLBuffer; - deleteTexture(texture: WebGLTexture): void; - useProgram(program: WebGLProgram): void; - vertexAttrib2fv(indx: number, values: number[]): void; - vertexAttrib2fv(indx: number, values: Float32Array): void; - checkFramebufferStatus(target: number): number; - frontFace(mode: number): void; - getBufferParameter(target: number, pname: number): any; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, image: HTMLImageElement): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, canvas: HTMLCanvasElement): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, video: HTMLVideoElement): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void; - copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; - getVertexAttribOffset(index: number, pname: number): number; - disableVertexAttribArray(index: number): void; - blendFunc(sfactor: number, dfactor: number): void; - drawElements(mode: number, count: number, type: number, offset: number): void; - isFramebuffer(framebuffer: WebGLFramebuffer): boolean; - uniform3iv(location: WebGLUniformLocation, v: number[]): void; - uniform3iv(location: WebGLUniformLocation, v: Int32Array): void; - lineWidth(width: number): void; - getShaderInfoLog(shader: WebGLShader): string; - getTexParameter(target: number, pname: number): any; - getParameter(pname: number): any; - getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat; - getContextAttributes(): WebGLContextAttributes; - vertexAttrib1f(indx: number, x: number): void; - bindFramebuffer(target: number, framebuffer: WebGLFramebuffer): void; - compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; - isContextLost(): boolean; - uniform1iv(location: WebGLUniformLocation, v: number[]): void; - uniform1iv(location: WebGLUniformLocation, v: Int32Array): void; - getRenderbufferParameter(target: number, pname: number): any; - uniform2fv(location: WebGLUniformLocation, v: number[]): void; - uniform2fv(location: WebGLUniformLocation, v: Float32Array): void; - isTexture(texture: WebGLTexture): boolean; - getError(): number; - shaderSource(shader: WebGLShader, source: string): void; - deleteRenderbuffer(renderbuffer: WebGLRenderbuffer): void; - stencilMask(mask: number): void; - bindBuffer(target: number, buffer: WebGLBuffer): void; - getAttribLocation(program: WebGLProgram, name: string): number; - uniform3i(location: WebGLUniformLocation, x: number, y: number, z: number): void; - blendEquationSeparate(modeRGB: number, modeAlpha: number): void; - clear(mask: number): void; - blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; - stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void; - readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; - scissor(x: number, y: number, width: number, height: number): void; - uniform2i(location: WebGLUniformLocation, x: number, y: number): void; - getActiveAttrib(program: WebGLProgram, index: number): WebGLActiveInfo; - getShaderSource(shader: WebGLShader): string; - generateMipmap(target: number): void; - bindAttribLocation(program: WebGLProgram, index: number, name: string): void; - uniform1fv(location: WebGLUniformLocation, v: number[]): void; - uniform1fv(location: WebGLUniformLocation, v: Float32Array): void; - uniform2iv(location: WebGLUniformLocation, v: number[]): void; - uniform2iv(location: WebGLUniformLocation, v: Int32Array): void; - stencilOp(fail: number, zfail: number, zpass: number): void; - uniform4fv(location: WebGLUniformLocation, v: number[]): void; - uniform4fv(location: WebGLUniformLocation, v: Float32Array): void; - vertexAttrib1fv(indx: number, values: number[]): void; - vertexAttrib1fv(indx: number, values: Float32Array): void; - flush(): void; - uniform4f(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; - deleteProgram(program: WebGLProgram): void; - isRenderbuffer(renderbuffer: WebGLRenderbuffer): boolean; - uniform1i(location: WebGLUniformLocation, x: number): void; - getProgramParameter(program: WebGLProgram, pname: number): any; - getActiveUniform(program: WebGLProgram, index: number): WebGLActiveInfo; - stencilFunc(func: number, ref: number, mask: number): void; - pixelStorei(pname: number, param: number): void; - disable(cap: number): void; - vertexAttrib4fv(indx: number, values: number[]): void; - vertexAttrib4fv(indx: number, values: Float32Array): void; - createRenderbuffer(): WebGLRenderbuffer; - isBuffer(buffer: WebGLBuffer): boolean; - stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; - getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any; - uniform4i(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; - sampleCoverage(value: number, invert: boolean): void; - depthFunc(func: number): void; - texParameterf(target: number, pname: number, param: number): void; - vertexAttrib3f(indx: number, x: number, y: number, z: number): void; - drawArrays(mode: number, first: number, count: number): void; - texParameteri(target: number, pname: number, param: number): void; - vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void; - getShaderParameter(shader: WebGLShader, pname: number): any; - clearDepth(depth: number): void; - activeTexture(texture: number): void; - viewport(x: number, y: number, width: number, height: number): void; - detachShader(program: WebGLProgram, shader: WebGLShader): void; - uniform1f(location: WebGLUniformLocation, x: number): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; - deleteBuffer(buffer: WebGLBuffer): void; - copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; - uniform3fv(location: WebGLUniformLocation, v: number[]): void; - uniform3fv(location: WebGLUniformLocation, v: Float32Array): void; - stencilMaskSeparate(face: number, mask: number): void; - attachShader(program: WebGLProgram, shader: WebGLShader): void; - compileShader(shader: WebGLShader): void; - clearColor(red: number, green: number, blue: number, alpha: number): void; - isShader(shader: WebGLShader): boolean; - clearStencil(s: number): void; - framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer): void; - finish(): void; - uniform2f(location: WebGLUniformLocation, x: number, y: number): void; - renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; - uniform3f(location: WebGLUniformLocation, x: number, y: number, z: number): void; - getProgramInfoLog(program: WebGLProgram): string; - validateProgram(program: WebGLProgram): void; - isEnabled(cap: number): boolean; - vertexAttrib2f(indx: number, x: number, y: number): void; - isProgram(program: WebGLProgram): boolean; - createShader(type: number): WebGLShader; - bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer): void; - uniform4iv(location: WebGLUniformLocation, v: number[]): void; - uniform4iv(location: WebGLUniformLocation, v: Int32Array): void; - DEPTH_FUNC: number; - DEPTH_COMPONENT16: number; - REPLACE: number; - REPEAT: number; - VERTEX_ATTRIB_ARRAY_ENABLED: number; - FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - STENCIL_BUFFER_BIT: number; - RENDERER: number; - STENCIL_BACK_REF: number; - TEXTURE26: number; - RGB565: number; - DITHER: number; - CONSTANT_COLOR: number; - GENERATE_MIPMAP_HINT: number; - POINTS: number; - DECR: number; - INT_VEC3: number; - TEXTURE28: number; - ONE_MINUS_CONSTANT_ALPHA: number; - BACK: number; - RENDERBUFFER_STENCIL_SIZE: number; - UNPACK_FLIP_Y_WEBGL: number; - BLEND: number; - TEXTURE9: number; - ARRAY_BUFFER_BINDING: number; - MAX_VIEWPORT_DIMS: number; - INVALID_FRAMEBUFFER_OPERATION: number; - TEXTURE: number; - TEXTURE0: number; - TEXTURE31: number; - TEXTURE24: number; - HIGH_INT: number; - RENDERBUFFER_BINDING: number; - BLEND_COLOR: number; - FASTEST: number; - STENCIL_WRITEMASK: number; - ALIASED_POINT_SIZE_RANGE: number; - TEXTURE12: number; - DST_ALPHA: number; - BLEND_EQUATION_RGB: number; - FRAMEBUFFER_COMPLETE: number; - NEAREST_MIPMAP_NEAREST: number; - VERTEX_ATTRIB_ARRAY_SIZE: number; - TEXTURE3: number; - DEPTH_WRITEMASK: number; - CONTEXT_LOST_WEBGL: number; - INVALID_VALUE: number; - TEXTURE_MAG_FILTER: number; - ONE_MINUS_CONSTANT_COLOR: number; - ONE_MINUS_SRC_ALPHA: number; - TEXTURE_CUBE_MAP_POSITIVE_Z: number; - NOTEQUAL: number; - ALPHA: number; - DEPTH_STENCIL: number; - MAX_VERTEX_UNIFORM_VECTORS: number; - DEPTH_COMPONENT: number; - RENDERBUFFER_RED_SIZE: number; - TEXTURE20: number; - RED_BITS: number; - RENDERBUFFER_BLUE_SIZE: number; - SCISSOR_BOX: number; - VENDOR: number; - FRONT_AND_BACK: number; - CONSTANT_ALPHA: number; - VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - NEAREST: number; - CULL_FACE: number; - ALIASED_LINE_WIDTH_RANGE: number; - TEXTURE19: number; - FRONT: number; - DEPTH_CLEAR_VALUE: number; - GREEN_BITS: number; - TEXTURE29: number; - TEXTURE23: number; - MAX_RENDERBUFFER_SIZE: number; - STENCIL_ATTACHMENT: number; - TEXTURE27: number; - BOOL_VEC2: number; - OUT_OF_MEMORY: number; - MIRRORED_REPEAT: number; - POLYGON_OFFSET_UNITS: number; - TEXTURE_MIN_FILTER: number; - STENCIL_BACK_PASS_DEPTH_PASS: number; - LINE_LOOP: number; - FLOAT_MAT3: number; - TEXTURE14: number; - LINEAR: number; - RGB5_A1: number; - ONE_MINUS_SRC_COLOR: number; - SAMPLE_COVERAGE_INVERT: number; - DONT_CARE: number; - FRAMEBUFFER_BINDING: number; - RENDERBUFFER_ALPHA_SIZE: number; - STENCIL_REF: number; - ZERO: number; - DECR_WRAP: number; - SAMPLE_COVERAGE: number; - STENCIL_BACK_FUNC: number; - TEXTURE30: number; - VIEWPORT: number; - STENCIL_BITS: number; - FLOAT: number; - COLOR_WRITEMASK: number; - SAMPLE_COVERAGE_VALUE: number; - TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - STENCIL_BACK_FAIL: number; - FLOAT_MAT4: number; - UNSIGNED_SHORT_4_4_4_4: number; - TEXTURE6: number; - RENDERBUFFER_WIDTH: number; - RGBA4: number; - ALWAYS: number; - BLEND_EQUATION_ALPHA: number; - COLOR_BUFFER_BIT: number; - TEXTURE_CUBE_MAP: number; - DEPTH_BUFFER_BIT: number; - STENCIL_CLEAR_VALUE: number; - BLEND_EQUATION: number; - RENDERBUFFER_GREEN_SIZE: number; - NEAREST_MIPMAP_LINEAR: number; - VERTEX_ATTRIB_ARRAY_TYPE: number; - INCR_WRAP: number; - ONE_MINUS_DST_COLOR: number; - HIGH_FLOAT: number; - BYTE: number; - FRONT_FACE: number; - SAMPLE_ALPHA_TO_COVERAGE: number; - CCW: number; - TEXTURE13: number; - MAX_VERTEX_ATTRIBS: number; - MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_WRAP_T: number; - UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - FLOAT_VEC2: number; - LUMINANCE: number; - GREATER: number; - INT_VEC2: number; - VALIDATE_STATUS: number; - FRAMEBUFFER: number; - FRAMEBUFFER_UNSUPPORTED: number; - TEXTURE5: number; - FUNC_SUBTRACT: number; - BLEND_DST_ALPHA: number; - SAMPLER_CUBE: number; - ONE_MINUS_DST_ALPHA: number; - LESS: number; - TEXTURE_CUBE_MAP_POSITIVE_X: number; - BLUE_BITS: number; - DEPTH_TEST: number; - VERTEX_ATTRIB_ARRAY_STRIDE: number; - DELETE_STATUS: number; - TEXTURE18: number; - POLYGON_OFFSET_FACTOR: number; - UNSIGNED_INT: number; - TEXTURE_2D: number; - DST_COLOR: number; - FLOAT_MAT2: number; - COMPRESSED_TEXTURE_FORMATS: number; - MAX_FRAGMENT_UNIFORM_VECTORS: number; - DEPTH_STENCIL_ATTACHMENT: number; - LUMINANCE_ALPHA: number; - CW: number; - VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - LINEAR_MIPMAP_LINEAR: number; - BUFFER_SIZE: number; - SAMPLE_BUFFERS: number; - TEXTURE15: number; - ACTIVE_TEXTURE: number; - VERTEX_SHADER: number; - TEXTURE22: number; - VERTEX_ATTRIB_ARRAY_POINTER: number; - INCR: number; - COMPILE_STATUS: number; - MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - TEXTURE7: number; - UNSIGNED_SHORT_5_5_5_1: number; - DEPTH_BITS: number; - RGBA: number; - TRIANGLE_STRIP: number; - COLOR_CLEAR_VALUE: number; - BROWSER_DEFAULT_WEBGL: number; - INVALID_ENUM: number; - SCISSOR_TEST: number; - LINE_STRIP: number; - FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - STENCIL_FUNC: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - RENDERBUFFER_HEIGHT: number; - TEXTURE8: number; - TRIANGLES: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - STENCIL_BACK_VALUE_MASK: number; - TEXTURE25: number; - RENDERBUFFER: number; - LEQUAL: number; - TEXTURE1: number; - STENCIL_INDEX8: number; - FUNC_ADD: number; - STENCIL_FAIL: number; - BLEND_SRC_ALPHA: number; - BOOL: number; - ALPHA_BITS: number; - LOW_INT: number; - TEXTURE10: number; - SRC_COLOR: number; - MAX_VARYING_VECTORS: number; - BLEND_DST_RGB: number; - TEXTURE_BINDING_CUBE_MAP: number; - STENCIL_INDEX: number; - TEXTURE_BINDING_2D: number; - MEDIUM_INT: number; - SHADER_TYPE: number; - POLYGON_OFFSET_FILL: number; - DYNAMIC_DRAW: number; - TEXTURE4: number; - STENCIL_BACK_PASS_DEPTH_FAIL: number; - STREAM_DRAW: number; - MAX_CUBE_MAP_TEXTURE_SIZE: number; - TEXTURE17: number; - TRIANGLE_FAN: number; - UNPACK_ALIGNMENT: number; - CURRENT_PROGRAM: number; - LINES: number; - INVALID_OPERATION: number; - FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - LINEAR_MIPMAP_NEAREST: number; - CLAMP_TO_EDGE: number; - RENDERBUFFER_DEPTH_SIZE: number; - TEXTURE_WRAP_S: number; - ELEMENT_ARRAY_BUFFER: number; - UNSIGNED_SHORT_5_6_5: number; - ACTIVE_UNIFORMS: number; - FLOAT_VEC3: number; - NO_ERROR: number; - ATTACHED_SHADERS: number; - DEPTH_ATTACHMENT: number; - TEXTURE11: number; - STENCIL_TEST: number; - ONE: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - STATIC_DRAW: number; - GEQUAL: number; - BOOL_VEC4: number; - COLOR_ATTACHMENT0: number; - PACK_ALIGNMENT: number; - MAX_TEXTURE_SIZE: number; - STENCIL_PASS_DEPTH_FAIL: number; - CULL_FACE_MODE: number; - TEXTURE16: number; - STENCIL_BACK_WRITEMASK: number; - SRC_ALPHA: number; - UNSIGNED_SHORT: number; - TEXTURE21: number; - FUNC_REVERSE_SUBTRACT: number; - SHADING_LANGUAGE_VERSION: number; - EQUAL: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - BOOL_VEC3: number; - SAMPLER_2D: number; - TEXTURE_CUBE_MAP_NEGATIVE_X: number; - MAX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_CUBE_MAP_POSITIVE_Y: number; - RENDERBUFFER_INTERNAL_FORMAT: number; - STENCIL_VALUE_MASK: number; - ELEMENT_ARRAY_BUFFER_BINDING: number; - ARRAY_BUFFER: number; - DEPTH_RANGE: number; - NICEST: number; - ACTIVE_ATTRIBUTES: number; - NEVER: number; - FLOAT_VEC4: number; - CURRENT_VERTEX_ATTRIB: number; - STENCIL_PASS_DEPTH_PASS: number; - INVERT: number; - LINK_STATUS: number; - RGB: number; - INT_VEC4: number; - TEXTURE2: number; - UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - MEDIUM_FLOAT: number; - SRC_ALPHA_SATURATE: number; - BUFFER_USAGE: number; - SHORT: number; - NONE: number; - UNSIGNED_BYTE: number; - INT: number; - SUBPIXEL_BITS: number; - KEEP: number; - SAMPLES: number; - FRAGMENT_SHADER: number; - LINE_WIDTH: number; - BLEND_SRC_RGB: number; - LOW_FLOAT: number; - VERSION: number; -} -declare var WebGLRenderingContext: { - prototype: WebGLRenderingContext; - new(): WebGLRenderingContext; - DEPTH_FUNC: number; - DEPTH_COMPONENT16: number; - REPLACE: number; - REPEAT: number; - VERTEX_ATTRIB_ARRAY_ENABLED: number; - FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - STENCIL_BUFFER_BIT: number; - RENDERER: number; - STENCIL_BACK_REF: number; - TEXTURE26: number; - RGB565: number; - DITHER: number; - CONSTANT_COLOR: number; - GENERATE_MIPMAP_HINT: number; - POINTS: number; - DECR: number; - INT_VEC3: number; - TEXTURE28: number; - ONE_MINUS_CONSTANT_ALPHA: number; - BACK: number; - RENDERBUFFER_STENCIL_SIZE: number; - UNPACK_FLIP_Y_WEBGL: number; - BLEND: number; - TEXTURE9: number; - ARRAY_BUFFER_BINDING: number; - MAX_VIEWPORT_DIMS: number; - INVALID_FRAMEBUFFER_OPERATION: number; - TEXTURE: number; - TEXTURE0: number; - TEXTURE31: number; - TEXTURE24: number; - HIGH_INT: number; - RENDERBUFFER_BINDING: number; - BLEND_COLOR: number; - FASTEST: number; - STENCIL_WRITEMASK: number; - ALIASED_POINT_SIZE_RANGE: number; - TEXTURE12: number; - DST_ALPHA: number; - BLEND_EQUATION_RGB: number; - FRAMEBUFFER_COMPLETE: number; - NEAREST_MIPMAP_NEAREST: number; - VERTEX_ATTRIB_ARRAY_SIZE: number; - TEXTURE3: number; - DEPTH_WRITEMASK: number; - CONTEXT_LOST_WEBGL: number; - INVALID_VALUE: number; - TEXTURE_MAG_FILTER: number; - ONE_MINUS_CONSTANT_COLOR: number; - ONE_MINUS_SRC_ALPHA: number; - TEXTURE_CUBE_MAP_POSITIVE_Z: number; - NOTEQUAL: number; - ALPHA: number; - DEPTH_STENCIL: number; - MAX_VERTEX_UNIFORM_VECTORS: number; - DEPTH_COMPONENT: number; - RENDERBUFFER_RED_SIZE: number; - TEXTURE20: number; - RED_BITS: number; - RENDERBUFFER_BLUE_SIZE: number; - SCISSOR_BOX: number; - VENDOR: number; - FRONT_AND_BACK: number; - CONSTANT_ALPHA: number; - VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - NEAREST: number; - CULL_FACE: number; - ALIASED_LINE_WIDTH_RANGE: number; - TEXTURE19: number; - FRONT: number; - DEPTH_CLEAR_VALUE: number; - GREEN_BITS: number; - TEXTURE29: number; - TEXTURE23: number; - MAX_RENDERBUFFER_SIZE: number; - STENCIL_ATTACHMENT: number; - TEXTURE27: number; - BOOL_VEC2: number; - OUT_OF_MEMORY: number; - MIRRORED_REPEAT: number; - POLYGON_OFFSET_UNITS: number; - TEXTURE_MIN_FILTER: number; - STENCIL_BACK_PASS_DEPTH_PASS: number; - LINE_LOOP: number; - FLOAT_MAT3: number; - TEXTURE14: number; - LINEAR: number; - RGB5_A1: number; - ONE_MINUS_SRC_COLOR: number; - SAMPLE_COVERAGE_INVERT: number; - DONT_CARE: number; - FRAMEBUFFER_BINDING: number; - RENDERBUFFER_ALPHA_SIZE: number; - STENCIL_REF: number; - ZERO: number; - DECR_WRAP: number; - SAMPLE_COVERAGE: number; - STENCIL_BACK_FUNC: number; - TEXTURE30: number; - VIEWPORT: number; - STENCIL_BITS: number; - FLOAT: number; - COLOR_WRITEMASK: number; - SAMPLE_COVERAGE_VALUE: number; - TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - STENCIL_BACK_FAIL: number; - FLOAT_MAT4: number; - UNSIGNED_SHORT_4_4_4_4: number; - TEXTURE6: number; - RENDERBUFFER_WIDTH: number; - RGBA4: number; - ALWAYS: number; - BLEND_EQUATION_ALPHA: number; - COLOR_BUFFER_BIT: number; - TEXTURE_CUBE_MAP: number; - DEPTH_BUFFER_BIT: number; - STENCIL_CLEAR_VALUE: number; - BLEND_EQUATION: number; - RENDERBUFFER_GREEN_SIZE: number; - NEAREST_MIPMAP_LINEAR: number; - VERTEX_ATTRIB_ARRAY_TYPE: number; - INCR_WRAP: number; - ONE_MINUS_DST_COLOR: number; - HIGH_FLOAT: number; - BYTE: number; - FRONT_FACE: number; - SAMPLE_ALPHA_TO_COVERAGE: number; - CCW: number; - TEXTURE13: number; - MAX_VERTEX_ATTRIBS: number; - MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_WRAP_T: number; - UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - FLOAT_VEC2: number; - LUMINANCE: number; - GREATER: number; - INT_VEC2: number; - VALIDATE_STATUS: number; - FRAMEBUFFER: number; - FRAMEBUFFER_UNSUPPORTED: number; - TEXTURE5: number; - FUNC_SUBTRACT: number; - BLEND_DST_ALPHA: number; - SAMPLER_CUBE: number; - ONE_MINUS_DST_ALPHA: number; - LESS: number; - TEXTURE_CUBE_MAP_POSITIVE_X: number; - BLUE_BITS: number; - DEPTH_TEST: number; - VERTEX_ATTRIB_ARRAY_STRIDE: number; - DELETE_STATUS: number; - TEXTURE18: number; - POLYGON_OFFSET_FACTOR: number; - UNSIGNED_INT: number; - TEXTURE_2D: number; - DST_COLOR: number; - FLOAT_MAT2: number; - COMPRESSED_TEXTURE_FORMATS: number; - MAX_FRAGMENT_UNIFORM_VECTORS: number; - DEPTH_STENCIL_ATTACHMENT: number; - LUMINANCE_ALPHA: number; - CW: number; - VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - LINEAR_MIPMAP_LINEAR: number; - BUFFER_SIZE: number; - SAMPLE_BUFFERS: number; - TEXTURE15: number; - ACTIVE_TEXTURE: number; - VERTEX_SHADER: number; - TEXTURE22: number; - VERTEX_ATTRIB_ARRAY_POINTER: number; - INCR: number; - COMPILE_STATUS: number; - MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - TEXTURE7: number; - UNSIGNED_SHORT_5_5_5_1: number; - DEPTH_BITS: number; - RGBA: number; - TRIANGLE_STRIP: number; - COLOR_CLEAR_VALUE: number; - BROWSER_DEFAULT_WEBGL: number; - INVALID_ENUM: number; - SCISSOR_TEST: number; - LINE_STRIP: number; - FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - STENCIL_FUNC: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - RENDERBUFFER_HEIGHT: number; - TEXTURE8: number; - TRIANGLES: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - STENCIL_BACK_VALUE_MASK: number; - TEXTURE25: number; - RENDERBUFFER: number; - LEQUAL: number; - TEXTURE1: number; - STENCIL_INDEX8: number; - FUNC_ADD: number; - STENCIL_FAIL: number; - BLEND_SRC_ALPHA: number; - BOOL: number; - ALPHA_BITS: number; - LOW_INT: number; - TEXTURE10: number; - SRC_COLOR: number; - MAX_VARYING_VECTORS: number; - BLEND_DST_RGB: number; - TEXTURE_BINDING_CUBE_MAP: number; - STENCIL_INDEX: number; - TEXTURE_BINDING_2D: number; - MEDIUM_INT: number; - SHADER_TYPE: number; - POLYGON_OFFSET_FILL: number; - DYNAMIC_DRAW: number; - TEXTURE4: number; - STENCIL_BACK_PASS_DEPTH_FAIL: number; - STREAM_DRAW: number; - MAX_CUBE_MAP_TEXTURE_SIZE: number; - TEXTURE17: number; - TRIANGLE_FAN: number; - UNPACK_ALIGNMENT: number; - CURRENT_PROGRAM: number; - LINES: number; - INVALID_OPERATION: number; - FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - LINEAR_MIPMAP_NEAREST: number; - CLAMP_TO_EDGE: number; - RENDERBUFFER_DEPTH_SIZE: number; - TEXTURE_WRAP_S: number; - ELEMENT_ARRAY_BUFFER: number; - UNSIGNED_SHORT_5_6_5: number; - ACTIVE_UNIFORMS: number; - FLOAT_VEC3: number; - NO_ERROR: number; - ATTACHED_SHADERS: number; - DEPTH_ATTACHMENT: number; - TEXTURE11: number; - STENCIL_TEST: number; - ONE: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - STATIC_DRAW: number; - GEQUAL: number; - BOOL_VEC4: number; - COLOR_ATTACHMENT0: number; - PACK_ALIGNMENT: number; - MAX_TEXTURE_SIZE: number; - STENCIL_PASS_DEPTH_FAIL: number; - CULL_FACE_MODE: number; - TEXTURE16: number; - STENCIL_BACK_WRITEMASK: number; - SRC_ALPHA: number; - UNSIGNED_SHORT: number; - TEXTURE21: number; - FUNC_REVERSE_SUBTRACT: number; - SHADING_LANGUAGE_VERSION: number; - EQUAL: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - BOOL_VEC3: number; - SAMPLER_2D: number; - TEXTURE_CUBE_MAP_NEGATIVE_X: number; - MAX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_CUBE_MAP_POSITIVE_Y: number; - RENDERBUFFER_INTERNAL_FORMAT: number; - STENCIL_VALUE_MASK: number; - ELEMENT_ARRAY_BUFFER_BINDING: number; - ARRAY_BUFFER: number; - DEPTH_RANGE: number; - NICEST: number; - ACTIVE_ATTRIBUTES: number; - NEVER: number; - FLOAT_VEC4: number; - CURRENT_VERTEX_ATTRIB: number; - STENCIL_PASS_DEPTH_PASS: number; - INVERT: number; - LINK_STATUS: number; - RGB: number; - INT_VEC4: number; - TEXTURE2: number; - UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - MEDIUM_FLOAT: number; - SRC_ALPHA_SATURATE: number; - BUFFER_USAGE: number; - SHORT: number; - NONE: number; - UNSIGNED_BYTE: number; - INT: number; - SUBPIXEL_BITS: number; - KEEP: number; - SAMPLES: number; - FRAGMENT_SHADER: number; - LINE_WIDTH: number; - BLEND_SRC_RGB: number; - LOW_FLOAT: number; - VERSION: number; -} - -interface WebGLProgram extends WebGLObject { -} -declare var WebGLProgram: { - prototype: WebGLProgram; - new(): WebGLProgram; -} - -interface OES_standard_derivatives { - FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; -} -declare var OES_standard_derivatives: { - prototype: OES_standard_derivatives; - new(): OES_standard_derivatives; - FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; -} - -interface WebGLFramebuffer extends WebGLObject { -} -declare var WebGLFramebuffer: { - prototype: WebGLFramebuffer; - new(): WebGLFramebuffer; -} - -interface WebGLShader extends WebGLObject { -} -declare var WebGLShader: { - prototype: WebGLShader; - new(): WebGLShader; -} - -interface OES_texture_float_linear { -} -declare var OES_texture_float_linear: { - prototype: OES_texture_float_linear; - new(): OES_texture_float_linear; -} - -interface WebGLObject { -} -declare var WebGLObject: { - prototype: WebGLObject; - new(): WebGLObject; -} - interface WebGLBuffer extends WebGLObject { } + declare var WebGLBuffer: { prototype: WebGLBuffer; new(): WebGLBuffer; } -interface WebGLShaderPrecisionFormat { - rangeMin: number; - rangeMax: number; - precision: number; +interface WebGLContextEvent extends Event { + statusMessage: string; } + +declare var WebGLContextEvent: { + prototype: WebGLContextEvent; + new(): WebGLContextEvent; +} + +interface WebGLFramebuffer extends WebGLObject { +} + +declare var WebGLFramebuffer: { + prototype: WebGLFramebuffer; + new(): WebGLFramebuffer; +} + +interface WebGLObject { +} + +declare var WebGLObject: { + prototype: WebGLObject; + new(): WebGLObject; +} + +interface WebGLProgram extends WebGLObject { +} + +declare var WebGLProgram: { + prototype: WebGLProgram; + new(): WebGLProgram; +} + +interface WebGLRenderbuffer extends WebGLObject { +} + +declare var WebGLRenderbuffer: { + prototype: WebGLRenderbuffer; + new(): WebGLRenderbuffer; +} + +interface WebGLRenderingContext { + canvas: HTMLCanvasElement; + drawingBufferHeight: number; + drawingBufferWidth: number; + activeTexture(texture: number): void; + attachShader(program: WebGLProgram, shader: WebGLShader): void; + bindAttribLocation(program: WebGLProgram, index: number, name: string): void; + bindBuffer(target: number, buffer: WebGLBuffer): void; + bindFramebuffer(target: number, framebuffer: WebGLFramebuffer): void; + bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer): void; + bindTexture(target: number, texture: WebGLTexture): void; + blendColor(red: number, green: number, blue: number, alpha: number): void; + blendEquation(mode: number): void; + blendEquationSeparate(modeRGB: number, modeAlpha: number): void; + blendFunc(sfactor: number, dfactor: number): void; + blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; + bufferData(target: number, size: number, usage: number): void; + bufferData(target: number, size: ArrayBufferView, usage: number): void; + bufferData(target: number, size: any, usage: number): void; + bufferSubData(target: number, offset: number, data: ArrayBufferView): void; + bufferSubData(target: number, offset: number, data: any): void; + checkFramebufferStatus(target: number): number; + clear(mask: number): void; + clearColor(red: number, green: number, blue: number, alpha: number): void; + clearDepth(depth: number): void; + clearStencil(s: number): void; + colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; + compileShader(shader: WebGLShader): void; + compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; + compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; + copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; + copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; + createBuffer(): WebGLBuffer; + createFramebuffer(): WebGLFramebuffer; + createProgram(): WebGLProgram; + createRenderbuffer(): WebGLRenderbuffer; + createShader(type: number): WebGLShader; + createTexture(): WebGLTexture; + cullFace(mode: number): void; + deleteBuffer(buffer: WebGLBuffer): void; + deleteFramebuffer(framebuffer: WebGLFramebuffer): void; + deleteProgram(program: WebGLProgram): void; + deleteRenderbuffer(renderbuffer: WebGLRenderbuffer): void; + deleteShader(shader: WebGLShader): void; + deleteTexture(texture: WebGLTexture): void; + depthFunc(func: number): void; + depthMask(flag: boolean): void; + depthRange(zNear: number, zFar: number): void; + detachShader(program: WebGLProgram, shader: WebGLShader): void; + disable(cap: number): void; + disableVertexAttribArray(index: number): void; + drawArrays(mode: number, first: number, count: number): void; + drawElements(mode: number, count: number, type: number, offset: number): void; + enable(cap: number): void; + enableVertexAttribArray(index: number): void; + finish(): void; + flush(): void; + framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer): void; + framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture, level: number): void; + frontFace(mode: number): void; + generateMipmap(target: number): void; + getActiveAttrib(program: WebGLProgram, index: number): WebGLActiveInfo; + getActiveUniform(program: WebGLProgram, index: number): WebGLActiveInfo; + getAttachedShaders(program: WebGLProgram): WebGLShader[]; + getAttribLocation(program: WebGLProgram, name: string): number; + getBufferParameter(target: number, pname: number): any; + getContextAttributes(): WebGLContextAttributes; + getError(): number; + getExtension(name: string): any; + getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any; + getParameter(pname: number): any; + getProgramInfoLog(program: WebGLProgram): string; + getProgramParameter(program: WebGLProgram, pname: number): any; + getRenderbufferParameter(target: number, pname: number): any; + getShaderInfoLog(shader: WebGLShader): string; + getShaderParameter(shader: WebGLShader, pname: number): any; + getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat; + getShaderSource(shader: WebGLShader): string; + getSupportedExtensions(): string[]; + getTexParameter(target: number, pname: number): any; + getUniform(program: WebGLProgram, location: WebGLUniformLocation): any; + getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation; + getVertexAttrib(index: number, pname: number): any; + getVertexAttribOffset(index: number, pname: number): number; + hint(target: number, mode: number): void; + isBuffer(buffer: WebGLBuffer): boolean; + isContextLost(): boolean; + isEnabled(cap: number): boolean; + isFramebuffer(framebuffer: WebGLFramebuffer): boolean; + isProgram(program: WebGLProgram): boolean; + isRenderbuffer(renderbuffer: WebGLRenderbuffer): boolean; + isShader(shader: WebGLShader): boolean; + isTexture(texture: WebGLTexture): boolean; + lineWidth(width: number): void; + linkProgram(program: WebGLProgram): void; + pixelStorei(pname: number, param: number): void; + polygonOffset(factor: number, units: number): void; + readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; + renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; + sampleCoverage(value: number, invert: boolean): void; + scissor(x: number, y: number, width: number, height: number): void; + shaderSource(shader: WebGLShader, source: string): void; + stencilFunc(func: number, ref: number, mask: number): void; + stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void; + stencilMask(mask: number): void; + stencilMaskSeparate(face: number, mask: number): void; + stencilOp(fail: number, zfail: number, zpass: number): void; + stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageData): void; + texParameterf(target: number, pname: number, param: number): void; + texParameteri(target: number, pname: number, param: number): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void; + uniform1f(location: WebGLUniformLocation, x: number): void; + uniform1fv(location: WebGLUniformLocation, v: any): void; + uniform1i(location: WebGLUniformLocation, x: number): void; + uniform1iv(location: WebGLUniformLocation, v: Int32Array): void; + uniform2f(location: WebGLUniformLocation, x: number, y: number): void; + uniform2fv(location: WebGLUniformLocation, v: any): void; + uniform2i(location: WebGLUniformLocation, x: number, y: number): void; + uniform2iv(location: WebGLUniformLocation, v: Int32Array): void; + uniform3f(location: WebGLUniformLocation, x: number, y: number, z: number): void; + uniform3fv(location: WebGLUniformLocation, v: any): void; + uniform3i(location: WebGLUniformLocation, x: number, y: number, z: number): void; + uniform3iv(location: WebGLUniformLocation, v: Int32Array): void; + uniform4f(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; + uniform4fv(location: WebGLUniformLocation, v: any): void; + uniform4i(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; + uniform4iv(location: WebGLUniformLocation, v: Int32Array): void; + uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: any): void; + uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: any): void; + uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: any): void; + useProgram(program: WebGLProgram): void; + validateProgram(program: WebGLProgram): void; + vertexAttrib1f(indx: number, x: number): void; + vertexAttrib1fv(indx: number, values: any): void; + vertexAttrib2f(indx: number, x: number, y: number): void; + vertexAttrib2fv(indx: number, values: any): void; + vertexAttrib3f(indx: number, x: number, y: number, z: number): void; + vertexAttrib3fv(indx: number, values: any): void; + vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void; + vertexAttrib4fv(indx: number, values: any): void; + vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void; + viewport(x: number, y: number, width: number, height: number): void; + ACTIVE_ATTRIBUTES: number; + ACTIVE_TEXTURE: number; + ACTIVE_UNIFORMS: number; + ALIASED_LINE_WIDTH_RANGE: number; + ALIASED_POINT_SIZE_RANGE: number; + ALPHA: number; + ALPHA_BITS: number; + ALWAYS: number; + ARRAY_BUFFER: number; + ARRAY_BUFFER_BINDING: number; + ATTACHED_SHADERS: number; + BACK: number; + BLEND: number; + BLEND_COLOR: number; + BLEND_DST_ALPHA: number; + BLEND_DST_RGB: number; + BLEND_EQUATION: number; + BLEND_EQUATION_ALPHA: number; + BLEND_EQUATION_RGB: number; + BLEND_SRC_ALPHA: number; + BLEND_SRC_RGB: number; + BLUE_BITS: number; + BOOL: number; + BOOL_VEC2: number; + BOOL_VEC3: number; + BOOL_VEC4: number; + BROWSER_DEFAULT_WEBGL: number; + BUFFER_SIZE: number; + BUFFER_USAGE: number; + BYTE: number; + CCW: number; + CLAMP_TO_EDGE: number; + COLOR_ATTACHMENT0: number; + COLOR_BUFFER_BIT: number; + COLOR_CLEAR_VALUE: number; + COLOR_WRITEMASK: number; + COMPILE_STATUS: number; + COMPRESSED_TEXTURE_FORMATS: number; + CONSTANT_ALPHA: number; + CONSTANT_COLOR: number; + CONTEXT_LOST_WEBGL: number; + CULL_FACE: number; + CULL_FACE_MODE: number; + CURRENT_PROGRAM: number; + CURRENT_VERTEX_ATTRIB: number; + CW: number; + DECR: number; + DECR_WRAP: number; + DELETE_STATUS: number; + DEPTH_ATTACHMENT: number; + DEPTH_BITS: number; + DEPTH_BUFFER_BIT: number; + DEPTH_CLEAR_VALUE: number; + DEPTH_COMPONENT: number; + DEPTH_COMPONENT16: number; + DEPTH_FUNC: number; + DEPTH_RANGE: number; + DEPTH_STENCIL: number; + DEPTH_STENCIL_ATTACHMENT: number; + DEPTH_TEST: number; + DEPTH_WRITEMASK: number; + DITHER: number; + DONT_CARE: number; + DST_ALPHA: number; + DST_COLOR: number; + DYNAMIC_DRAW: number; + ELEMENT_ARRAY_BUFFER: number; + ELEMENT_ARRAY_BUFFER_BINDING: number; + EQUAL: number; + FASTEST: number; + FLOAT: number; + FLOAT_MAT2: number; + FLOAT_MAT3: number; + FLOAT_MAT4: number; + FLOAT_VEC2: number; + FLOAT_VEC3: number; + FLOAT_VEC4: number; + FRAGMENT_SHADER: number; + FRAMEBUFFER: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; + FRAMEBUFFER_BINDING: number; + FRAMEBUFFER_COMPLETE: number; + FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; + FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; + FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; + FRAMEBUFFER_UNSUPPORTED: number; + FRONT: number; + FRONT_AND_BACK: number; + FRONT_FACE: number; + FUNC_ADD: number; + FUNC_REVERSE_SUBTRACT: number; + FUNC_SUBTRACT: number; + GENERATE_MIPMAP_HINT: number; + GEQUAL: number; + GREATER: number; + GREEN_BITS: number; + HIGH_FLOAT: number; + HIGH_INT: number; + IMPLEMENTATION_COLOR_READ_FORMAT: number; + IMPLEMENTATION_COLOR_READ_TYPE: number; + INCR: number; + INCR_WRAP: number; + INT: number; + INT_VEC2: number; + INT_VEC3: number; + INT_VEC4: number; + INVALID_ENUM: number; + INVALID_FRAMEBUFFER_OPERATION: number; + INVALID_OPERATION: number; + INVALID_VALUE: number; + INVERT: number; + KEEP: number; + LEQUAL: number; + LESS: number; + LINEAR: number; + LINEAR_MIPMAP_LINEAR: number; + LINEAR_MIPMAP_NEAREST: number; + LINES: number; + LINE_LOOP: number; + LINE_STRIP: number; + LINE_WIDTH: number; + LINK_STATUS: number; + LOW_FLOAT: number; + LOW_INT: number; + LUMINANCE: number; + LUMINANCE_ALPHA: number; + MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; + MAX_CUBE_MAP_TEXTURE_SIZE: number; + MAX_FRAGMENT_UNIFORM_VECTORS: number; + MAX_RENDERBUFFER_SIZE: number; + MAX_TEXTURE_IMAGE_UNITS: number; + MAX_TEXTURE_SIZE: number; + MAX_VARYING_VECTORS: number; + MAX_VERTEX_ATTRIBS: number; + MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; + MAX_VERTEX_UNIFORM_VECTORS: number; + MAX_VIEWPORT_DIMS: number; + MEDIUM_FLOAT: number; + MEDIUM_INT: number; + MIRRORED_REPEAT: number; + NEAREST: number; + NEAREST_MIPMAP_LINEAR: number; + NEAREST_MIPMAP_NEAREST: number; + NEVER: number; + NICEST: number; + NONE: number; + NOTEQUAL: number; + NO_ERROR: number; + ONE: number; + ONE_MINUS_CONSTANT_ALPHA: number; + ONE_MINUS_CONSTANT_COLOR: number; + ONE_MINUS_DST_ALPHA: number; + ONE_MINUS_DST_COLOR: number; + ONE_MINUS_SRC_ALPHA: number; + ONE_MINUS_SRC_COLOR: number; + OUT_OF_MEMORY: number; + PACK_ALIGNMENT: number; + POINTS: number; + POLYGON_OFFSET_FACTOR: number; + POLYGON_OFFSET_FILL: number; + POLYGON_OFFSET_UNITS: number; + RED_BITS: number; + RENDERBUFFER: number; + RENDERBUFFER_ALPHA_SIZE: number; + RENDERBUFFER_BINDING: number; + RENDERBUFFER_BLUE_SIZE: number; + RENDERBUFFER_DEPTH_SIZE: number; + RENDERBUFFER_GREEN_SIZE: number; + RENDERBUFFER_HEIGHT: number; + RENDERBUFFER_INTERNAL_FORMAT: number; + RENDERBUFFER_RED_SIZE: number; + RENDERBUFFER_STENCIL_SIZE: number; + RENDERBUFFER_WIDTH: number; + RENDERER: number; + REPEAT: number; + REPLACE: number; + RGB: number; + RGB565: number; + RGB5_A1: number; + RGBA: number; + RGBA4: number; + SAMPLER_2D: number; + SAMPLER_CUBE: number; + SAMPLES: number; + SAMPLE_ALPHA_TO_COVERAGE: number; + SAMPLE_BUFFERS: number; + SAMPLE_COVERAGE: number; + SAMPLE_COVERAGE_INVERT: number; + SAMPLE_COVERAGE_VALUE: number; + SCISSOR_BOX: number; + SCISSOR_TEST: number; + SHADER_TYPE: number; + SHADING_LANGUAGE_VERSION: number; + SHORT: number; + SRC_ALPHA: number; + SRC_ALPHA_SATURATE: number; + SRC_COLOR: number; + STATIC_DRAW: number; + STENCIL_ATTACHMENT: number; + STENCIL_BACK_FAIL: number; + STENCIL_BACK_FUNC: number; + STENCIL_BACK_PASS_DEPTH_FAIL: number; + STENCIL_BACK_PASS_DEPTH_PASS: number; + STENCIL_BACK_REF: number; + STENCIL_BACK_VALUE_MASK: number; + STENCIL_BACK_WRITEMASK: number; + STENCIL_BITS: number; + STENCIL_BUFFER_BIT: number; + STENCIL_CLEAR_VALUE: number; + STENCIL_FAIL: number; + STENCIL_FUNC: number; + STENCIL_INDEX: number; + STENCIL_INDEX8: number; + STENCIL_PASS_DEPTH_FAIL: number; + STENCIL_PASS_DEPTH_PASS: number; + STENCIL_REF: number; + STENCIL_TEST: number; + STENCIL_VALUE_MASK: number; + STENCIL_WRITEMASK: number; + STREAM_DRAW: number; + SUBPIXEL_BITS: number; + TEXTURE: number; + TEXTURE0: number; + TEXTURE1: number; + TEXTURE10: number; + TEXTURE11: number; + TEXTURE12: number; + TEXTURE13: number; + TEXTURE14: number; + TEXTURE15: number; + TEXTURE16: number; + TEXTURE17: number; + TEXTURE18: number; + TEXTURE19: number; + TEXTURE2: number; + TEXTURE20: number; + TEXTURE21: number; + TEXTURE22: number; + TEXTURE23: number; + TEXTURE24: number; + TEXTURE25: number; + TEXTURE26: number; + TEXTURE27: number; + TEXTURE28: number; + TEXTURE29: number; + TEXTURE3: number; + TEXTURE30: number; + TEXTURE31: number; + TEXTURE4: number; + TEXTURE5: number; + TEXTURE6: number; + TEXTURE7: number; + TEXTURE8: number; + TEXTURE9: number; + TEXTURE_2D: number; + TEXTURE_BINDING_2D: number; + TEXTURE_BINDING_CUBE_MAP: number; + TEXTURE_CUBE_MAP: number; + TEXTURE_CUBE_MAP_NEGATIVE_X: number; + TEXTURE_CUBE_MAP_NEGATIVE_Y: number; + TEXTURE_CUBE_MAP_NEGATIVE_Z: number; + TEXTURE_CUBE_MAP_POSITIVE_X: number; + TEXTURE_CUBE_MAP_POSITIVE_Y: number; + TEXTURE_CUBE_MAP_POSITIVE_Z: number; + TEXTURE_MAG_FILTER: number; + TEXTURE_MIN_FILTER: number; + TEXTURE_WRAP_S: number; + TEXTURE_WRAP_T: number; + TRIANGLES: number; + TRIANGLE_FAN: number; + TRIANGLE_STRIP: number; + UNPACK_ALIGNMENT: number; + UNPACK_COLORSPACE_CONVERSION_WEBGL: number; + UNPACK_FLIP_Y_WEBGL: number; + UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; + UNSIGNED_BYTE: number; + UNSIGNED_INT: number; + UNSIGNED_SHORT: number; + UNSIGNED_SHORT_4_4_4_4: number; + UNSIGNED_SHORT_5_5_5_1: number; + UNSIGNED_SHORT_5_6_5: number; + VALIDATE_STATUS: number; + VENDOR: number; + VERSION: number; + VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; + VERTEX_ATTRIB_ARRAY_ENABLED: number; + VERTEX_ATTRIB_ARRAY_NORMALIZED: number; + VERTEX_ATTRIB_ARRAY_POINTER: number; + VERTEX_ATTRIB_ARRAY_SIZE: number; + VERTEX_ATTRIB_ARRAY_STRIDE: number; + VERTEX_ATTRIB_ARRAY_TYPE: number; + VERTEX_SHADER: number; + VIEWPORT: number; + ZERO: number; +} + +declare var WebGLRenderingContext: { + prototype: WebGLRenderingContext; + new(): WebGLRenderingContext; + ACTIVE_ATTRIBUTES: number; + ACTIVE_TEXTURE: number; + ACTIVE_UNIFORMS: number; + ALIASED_LINE_WIDTH_RANGE: number; + ALIASED_POINT_SIZE_RANGE: number; + ALPHA: number; + ALPHA_BITS: number; + ALWAYS: number; + ARRAY_BUFFER: number; + ARRAY_BUFFER_BINDING: number; + ATTACHED_SHADERS: number; + BACK: number; + BLEND: number; + BLEND_COLOR: number; + BLEND_DST_ALPHA: number; + BLEND_DST_RGB: number; + BLEND_EQUATION: number; + BLEND_EQUATION_ALPHA: number; + BLEND_EQUATION_RGB: number; + BLEND_SRC_ALPHA: number; + BLEND_SRC_RGB: number; + BLUE_BITS: number; + BOOL: number; + BOOL_VEC2: number; + BOOL_VEC3: number; + BOOL_VEC4: number; + BROWSER_DEFAULT_WEBGL: number; + BUFFER_SIZE: number; + BUFFER_USAGE: number; + BYTE: number; + CCW: number; + CLAMP_TO_EDGE: number; + COLOR_ATTACHMENT0: number; + COLOR_BUFFER_BIT: number; + COLOR_CLEAR_VALUE: number; + COLOR_WRITEMASK: number; + COMPILE_STATUS: number; + COMPRESSED_TEXTURE_FORMATS: number; + CONSTANT_ALPHA: number; + CONSTANT_COLOR: number; + CONTEXT_LOST_WEBGL: number; + CULL_FACE: number; + CULL_FACE_MODE: number; + CURRENT_PROGRAM: number; + CURRENT_VERTEX_ATTRIB: number; + CW: number; + DECR: number; + DECR_WRAP: number; + DELETE_STATUS: number; + DEPTH_ATTACHMENT: number; + DEPTH_BITS: number; + DEPTH_BUFFER_BIT: number; + DEPTH_CLEAR_VALUE: number; + DEPTH_COMPONENT: number; + DEPTH_COMPONENT16: number; + DEPTH_FUNC: number; + DEPTH_RANGE: number; + DEPTH_STENCIL: number; + DEPTH_STENCIL_ATTACHMENT: number; + DEPTH_TEST: number; + DEPTH_WRITEMASK: number; + DITHER: number; + DONT_CARE: number; + DST_ALPHA: number; + DST_COLOR: number; + DYNAMIC_DRAW: number; + ELEMENT_ARRAY_BUFFER: number; + ELEMENT_ARRAY_BUFFER_BINDING: number; + EQUAL: number; + FASTEST: number; + FLOAT: number; + FLOAT_MAT2: number; + FLOAT_MAT3: number; + FLOAT_MAT4: number; + FLOAT_VEC2: number; + FLOAT_VEC3: number; + FLOAT_VEC4: number; + FRAGMENT_SHADER: number; + FRAMEBUFFER: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; + FRAMEBUFFER_BINDING: number; + FRAMEBUFFER_COMPLETE: number; + FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; + FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; + FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; + FRAMEBUFFER_UNSUPPORTED: number; + FRONT: number; + FRONT_AND_BACK: number; + FRONT_FACE: number; + FUNC_ADD: number; + FUNC_REVERSE_SUBTRACT: number; + FUNC_SUBTRACT: number; + GENERATE_MIPMAP_HINT: number; + GEQUAL: number; + GREATER: number; + GREEN_BITS: number; + HIGH_FLOAT: number; + HIGH_INT: number; + IMPLEMENTATION_COLOR_READ_FORMAT: number; + IMPLEMENTATION_COLOR_READ_TYPE: number; + INCR: number; + INCR_WRAP: number; + INT: number; + INT_VEC2: number; + INT_VEC3: number; + INT_VEC4: number; + INVALID_ENUM: number; + INVALID_FRAMEBUFFER_OPERATION: number; + INVALID_OPERATION: number; + INVALID_VALUE: number; + INVERT: number; + KEEP: number; + LEQUAL: number; + LESS: number; + LINEAR: number; + LINEAR_MIPMAP_LINEAR: number; + LINEAR_MIPMAP_NEAREST: number; + LINES: number; + LINE_LOOP: number; + LINE_STRIP: number; + LINE_WIDTH: number; + LINK_STATUS: number; + LOW_FLOAT: number; + LOW_INT: number; + LUMINANCE: number; + LUMINANCE_ALPHA: number; + MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; + MAX_CUBE_MAP_TEXTURE_SIZE: number; + MAX_FRAGMENT_UNIFORM_VECTORS: number; + MAX_RENDERBUFFER_SIZE: number; + MAX_TEXTURE_IMAGE_UNITS: number; + MAX_TEXTURE_SIZE: number; + MAX_VARYING_VECTORS: number; + MAX_VERTEX_ATTRIBS: number; + MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; + MAX_VERTEX_UNIFORM_VECTORS: number; + MAX_VIEWPORT_DIMS: number; + MEDIUM_FLOAT: number; + MEDIUM_INT: number; + MIRRORED_REPEAT: number; + NEAREST: number; + NEAREST_MIPMAP_LINEAR: number; + NEAREST_MIPMAP_NEAREST: number; + NEVER: number; + NICEST: number; + NONE: number; + NOTEQUAL: number; + NO_ERROR: number; + ONE: number; + ONE_MINUS_CONSTANT_ALPHA: number; + ONE_MINUS_CONSTANT_COLOR: number; + ONE_MINUS_DST_ALPHA: number; + ONE_MINUS_DST_COLOR: number; + ONE_MINUS_SRC_ALPHA: number; + ONE_MINUS_SRC_COLOR: number; + OUT_OF_MEMORY: number; + PACK_ALIGNMENT: number; + POINTS: number; + POLYGON_OFFSET_FACTOR: number; + POLYGON_OFFSET_FILL: number; + POLYGON_OFFSET_UNITS: number; + RED_BITS: number; + RENDERBUFFER: number; + RENDERBUFFER_ALPHA_SIZE: number; + RENDERBUFFER_BINDING: number; + RENDERBUFFER_BLUE_SIZE: number; + RENDERBUFFER_DEPTH_SIZE: number; + RENDERBUFFER_GREEN_SIZE: number; + RENDERBUFFER_HEIGHT: number; + RENDERBUFFER_INTERNAL_FORMAT: number; + RENDERBUFFER_RED_SIZE: number; + RENDERBUFFER_STENCIL_SIZE: number; + RENDERBUFFER_WIDTH: number; + RENDERER: number; + REPEAT: number; + REPLACE: number; + RGB: number; + RGB565: number; + RGB5_A1: number; + RGBA: number; + RGBA4: number; + SAMPLER_2D: number; + SAMPLER_CUBE: number; + SAMPLES: number; + SAMPLE_ALPHA_TO_COVERAGE: number; + SAMPLE_BUFFERS: number; + SAMPLE_COVERAGE: number; + SAMPLE_COVERAGE_INVERT: number; + SAMPLE_COVERAGE_VALUE: number; + SCISSOR_BOX: number; + SCISSOR_TEST: number; + SHADER_TYPE: number; + SHADING_LANGUAGE_VERSION: number; + SHORT: number; + SRC_ALPHA: number; + SRC_ALPHA_SATURATE: number; + SRC_COLOR: number; + STATIC_DRAW: number; + STENCIL_ATTACHMENT: number; + STENCIL_BACK_FAIL: number; + STENCIL_BACK_FUNC: number; + STENCIL_BACK_PASS_DEPTH_FAIL: number; + STENCIL_BACK_PASS_DEPTH_PASS: number; + STENCIL_BACK_REF: number; + STENCIL_BACK_VALUE_MASK: number; + STENCIL_BACK_WRITEMASK: number; + STENCIL_BITS: number; + STENCIL_BUFFER_BIT: number; + STENCIL_CLEAR_VALUE: number; + STENCIL_FAIL: number; + STENCIL_FUNC: number; + STENCIL_INDEX: number; + STENCIL_INDEX8: number; + STENCIL_PASS_DEPTH_FAIL: number; + STENCIL_PASS_DEPTH_PASS: number; + STENCIL_REF: number; + STENCIL_TEST: number; + STENCIL_VALUE_MASK: number; + STENCIL_WRITEMASK: number; + STREAM_DRAW: number; + SUBPIXEL_BITS: number; + TEXTURE: number; + TEXTURE0: number; + TEXTURE1: number; + TEXTURE10: number; + TEXTURE11: number; + TEXTURE12: number; + TEXTURE13: number; + TEXTURE14: number; + TEXTURE15: number; + TEXTURE16: number; + TEXTURE17: number; + TEXTURE18: number; + TEXTURE19: number; + TEXTURE2: number; + TEXTURE20: number; + TEXTURE21: number; + TEXTURE22: number; + TEXTURE23: number; + TEXTURE24: number; + TEXTURE25: number; + TEXTURE26: number; + TEXTURE27: number; + TEXTURE28: number; + TEXTURE29: number; + TEXTURE3: number; + TEXTURE30: number; + TEXTURE31: number; + TEXTURE4: number; + TEXTURE5: number; + TEXTURE6: number; + TEXTURE7: number; + TEXTURE8: number; + TEXTURE9: number; + TEXTURE_2D: number; + TEXTURE_BINDING_2D: number; + TEXTURE_BINDING_CUBE_MAP: number; + TEXTURE_CUBE_MAP: number; + TEXTURE_CUBE_MAP_NEGATIVE_X: number; + TEXTURE_CUBE_MAP_NEGATIVE_Y: number; + TEXTURE_CUBE_MAP_NEGATIVE_Z: number; + TEXTURE_CUBE_MAP_POSITIVE_X: number; + TEXTURE_CUBE_MAP_POSITIVE_Y: number; + TEXTURE_CUBE_MAP_POSITIVE_Z: number; + TEXTURE_MAG_FILTER: number; + TEXTURE_MIN_FILTER: number; + TEXTURE_WRAP_S: number; + TEXTURE_WRAP_T: number; + TRIANGLES: number; + TRIANGLE_FAN: number; + TRIANGLE_STRIP: number; + UNPACK_ALIGNMENT: number; + UNPACK_COLORSPACE_CONVERSION_WEBGL: number; + UNPACK_FLIP_Y_WEBGL: number; + UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; + UNSIGNED_BYTE: number; + UNSIGNED_INT: number; + UNSIGNED_SHORT: number; + UNSIGNED_SHORT_4_4_4_4: number; + UNSIGNED_SHORT_5_5_5_1: number; + UNSIGNED_SHORT_5_6_5: number; + VALIDATE_STATUS: number; + VENDOR: number; + VERSION: number; + VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; + VERTEX_ATTRIB_ARRAY_ENABLED: number; + VERTEX_ATTRIB_ARRAY_NORMALIZED: number; + VERTEX_ATTRIB_ARRAY_POINTER: number; + VERTEX_ATTRIB_ARRAY_SIZE: number; + VERTEX_ATTRIB_ARRAY_STRIDE: number; + VERTEX_ATTRIB_ARRAY_TYPE: number; + VERTEX_SHADER: number; + VIEWPORT: number; + ZERO: number; +} + +interface WebGLShader extends WebGLObject { +} + +declare var WebGLShader: { + prototype: WebGLShader; + new(): WebGLShader; +} + +interface WebGLShaderPrecisionFormat { + precision: number; + rangeMax: number; + rangeMin: number; +} + declare var WebGLShaderPrecisionFormat: { prototype: WebGLShaderPrecisionFormat; new(): WebGLShaderPrecisionFormat; } -interface EXT_texture_filter_anisotropic { - TEXTURE_MAX_ANISOTROPY_EXT: number; - MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; -} -declare var EXT_texture_filter_anisotropic: { - prototype: EXT_texture_filter_anisotropic; - new(): EXT_texture_filter_anisotropic; - TEXTURE_MAX_ANISOTROPY_EXT: number; - MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; +interface WebGLTexture extends WebGLObject { } -declare var Option: { new(text?: string, value?: string, defaultSelected?: boolean, selected?:boolean): HTMLOptionElement; }; -declare var Image: { new(width?: number, height?: number): HTMLImageElement; }; -declare var Audio: { new(src?: string): HTMLAudioElement; }; +declare var WebGLTexture: { + prototype: WebGLTexture; + new(): WebGLTexture; +} -declare var ondragend: (ev: DragEvent) => any; -declare var onkeydown: (ev: KeyboardEvent) => any; -declare var ondragover: (ev: DragEvent) => any; -declare var onkeyup: (ev: KeyboardEvent) => any; -declare var onreset: (ev: Event) => any; -declare var onmouseup: (ev: MouseEvent) => any; -declare var ondragstart: (ev: DragEvent) => any; -declare var ondrag: (ev: DragEvent) => any; -declare var screenX: number; -declare var onmouseover: (ev: MouseEvent) => any; -declare var ondragleave: (ev: DragEvent) => any; -declare var history: History; -declare var pageXOffset: number; -declare var name: string; -declare var onafterprint: (ev: Event) => any; -declare var onpause: (ev: Event) => any; -declare var onbeforeprint: (ev: Event) => any; -declare var top: Window; -declare var onmousedown: (ev: MouseEvent) => any; -declare var onseeked: (ev: Event) => any; -declare var opener: Window; -declare var onclick: (ev: MouseEvent) => any; -declare var innerHeight: number; -declare var onwaiting: (ev: Event) => any; -declare var ononline: (ev: Event) => any; -declare var ondurationchange: (ev: Event) => any; -declare var frames: Window; -declare var onblur: (ev: FocusEvent) => any; -declare var onemptied: (ev: Event) => any; -declare var onseeking: (ev: Event) => any; -declare var oncanplay: (ev: Event) => any; -declare var outerWidth: number; -declare var onstalled: (ev: Event) => any; -declare var onmousemove: (ev: MouseEvent) => any; -declare var innerWidth: number; -declare var onoffline: (ev: Event) => any; -declare var length: number; -declare var screen: Screen; -declare var onbeforeunload: (ev: BeforeUnloadEvent) => any; -declare var onratechange: (ev: Event) => any; -declare var onstorage: (ev: StorageEvent) => any; -declare var onloadstart: (ev: Event) => any; -declare var ondragenter: (ev: DragEvent) => any; -declare var onsubmit: (ev: Event) => any; -declare var self: Window; -declare var document: Document; -declare var onprogress: (ev: ProgressEvent) => any; -declare var ondblclick: (ev: MouseEvent) => any; -declare var pageYOffset: number; -declare var oncontextmenu: (ev: MouseEvent) => any; -declare var onchange: (ev: Event) => any; -declare var onloadedmetadata: (ev: Event) => any; -declare var onplay: (ev: Event) => any; -declare var onerror: ErrorEventHandler; -declare var onplaying: (ev: Event) => any; -declare var parent: Window; -declare var location: Location; -declare var oncanplaythrough: (ev: Event) => any; -declare var onabort: (ev: UIEvent) => any; -declare var onreadystatechange: (ev: Event) => any; -declare var outerHeight: number; -declare var onkeypress: (ev: KeyboardEvent) => any; -declare var frameElement: Element; -declare var onloadeddata: (ev: Event) => any; -declare var onsuspend: (ev: Event) => any; -declare var window: Window; -declare var onfocus: (ev: FocusEvent) => any; -declare var onmessage: (ev: MessageEvent) => any; -declare var ontimeupdate: (ev: Event) => any; -declare var onresize: (ev: UIEvent) => any; -declare var onselect: (ev: UIEvent) => any; -declare var navigator: Navigator; -declare var styleMedia: StyleMedia; -declare var ondrop: (ev: DragEvent) => any; -declare var onmouseout: (ev: MouseEvent) => any; -declare var onended: (ev: Event) => any; -declare var onhashchange: (ev: Event) => any; -declare var onunload: (ev: Event) => any; -declare var onscroll: (ev: UIEvent) => any; -declare var screenY: number; -declare var onmousewheel: (ev: MouseWheelEvent) => any; -declare var onload: (ev: Event) => any; -declare var onvolumechange: (ev: Event) => any; -declare var oninput: (ev: Event) => any; -declare var performance: Performance; -declare var onmspointerdown: (ev: any) => any; +interface WebGLUniformLocation { +} + +declare var WebGLUniformLocation: { + prototype: WebGLUniformLocation; + new(): WebGLUniformLocation; +} + +interface WebKitCSSMatrix { + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + m11: number; + m12: number; + m13: number; + m14: number; + m21: number; + m22: number; + m23: number; + m24: number; + m31: number; + m32: number; + m33: number; + m34: number; + m41: number; + m42: number; + m43: number; + m44: number; + inverse(): WebKitCSSMatrix; + multiply(secondMatrix: WebKitCSSMatrix): WebKitCSSMatrix; + rotate(angleX: number, angleY?: number, angleZ?: number): WebKitCSSMatrix; + rotateAxisAngle(x: number, y: number, z: number, angle: number): WebKitCSSMatrix; + scale(scaleX: number, scaleY?: number, scaleZ?: number): WebKitCSSMatrix; + setMatrixValue(value: string): void; + skewX(angle: number): WebKitCSSMatrix; + skewY(angle: number): WebKitCSSMatrix; + toString(): string; + translate(x: number, y: number, z?: number): WebKitCSSMatrix; +} + +declare var WebKitCSSMatrix: { + prototype: WebKitCSSMatrix; + new(text?: string): WebKitCSSMatrix; +} + +interface WebKitPoint { + x: number; + y: number; +} + +declare var WebKitPoint: { + prototype: WebKitPoint; + new(x?: number, y?: number): WebKitPoint; +} + +interface WebSocket extends EventTarget { + binaryType: string; + bufferedAmount: number; + extensions: string; + onclose: (ev: CloseEvent) => any; + onerror: (ev: Event) => any; + onmessage: (ev: MessageEvent) => any; + onopen: (ev: Event) => any; + protocol: string; + readyState: number; + url: string; + close(code?: number, reason?: string): void; + send(data: any): void; + CLOSED: number; + CLOSING: number; + CONNECTING: number; + OPEN: number; + addEventListener(type: "close", listener: (ev: CloseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "open", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var WebSocket: { + prototype: WebSocket; + new(url: string, protocols?: string): WebSocket; + new(url: string, protocols?: any): WebSocket; + CLOSED: number; + CLOSING: number; + CONNECTING: number; + OPEN: number; +} + +interface WheelEvent extends MouseEvent { + deltaMode: number; + deltaX: number; + deltaY: number; + deltaZ: number; + getCurrentPoint(element: Element): void; + initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void; + DOM_DELTA_LINE: number; + DOM_DELTA_PAGE: number; + DOM_DELTA_PIXEL: number; +} + +declare var WheelEvent: { + prototype: WheelEvent; + new(typeArg: string, eventInitDict?: WheelEventInit): WheelEvent; + DOM_DELTA_LINE: number; + DOM_DELTA_PAGE: number; + DOM_DELTA_PIXEL: number; +} + +interface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64 { + animationStartTime: number; + applicationCache: ApplicationCache; + clientInformation: Navigator; + closed: boolean; + crypto: Crypto; + defaultStatus: string; + devicePixelRatio: number; + doNotTrack: string; + document: Document; + event: Event; + external: External; + frameElement: Element; + frames: Window; + history: History; + innerHeight: number; + innerWidth: number; + length: number; + location: Location; + locationbar: BarProp; + menubar: BarProp; + msAnimationStartTime: number; + msTemplatePrinter: MSTemplatePrinter; + name: string; + navigator: Navigator; + offscreenBuffering: string | boolean; + onabort: (ev: Event) => any; + onafterprint: (ev: Event) => any; + onbeforeprint: (ev: Event) => any; + onbeforeunload: (ev: BeforeUnloadEvent) => any; + onblur: (ev: FocusEvent) => any; + oncanplay: (ev: Event) => any; + oncanplaythrough: (ev: Event) => any; + onchange: (ev: Event) => any; + onclick: (ev: MouseEvent) => any; + oncompassneedscalibration: (ev: Event) => any; + oncontextmenu: (ev: PointerEvent) => any; + ondblclick: (ev: MouseEvent) => any; + ondevicemotion: (ev: DeviceMotionEvent) => any; + ondeviceorientation: (ev: DeviceOrientationEvent) => any; + ondrag: (ev: DragEvent) => any; + ondragend: (ev: DragEvent) => any; + ondragenter: (ev: DragEvent) => any; + ondragleave: (ev: DragEvent) => any; + ondragover: (ev: DragEvent) => any; + ondragstart: (ev: DragEvent) => any; + ondrop: (ev: DragEvent) => any; + ondurationchange: (ev: Event) => any; + onemptied: (ev: Event) => any; + onended: (ev: Event) => any; + onerror: ErrorEventHandler; + onfocus: (ev: FocusEvent) => any; + onhashchange: (ev: HashChangeEvent) => any; + oninput: (ev: Event) => any; + onkeydown: (ev: KeyboardEvent) => any; + onkeypress: (ev: KeyboardEvent) => any; + onkeyup: (ev: KeyboardEvent) => any; + onload: (ev: Event) => any; + onloadeddata: (ev: Event) => any; + onloadedmetadata: (ev: Event) => any; + onloadstart: (ev: Event) => any; + onmessage: (ev: MessageEvent) => any; + onmousedown: (ev: MouseEvent) => any; + onmouseenter: (ev: MouseEvent) => any; + onmouseleave: (ev: MouseEvent) => any; + onmousemove: (ev: MouseEvent) => any; + onmouseout: (ev: MouseEvent) => any; + onmouseover: (ev: MouseEvent) => any; + onmouseup: (ev: MouseEvent) => any; + onmousewheel: (ev: MouseWheelEvent) => any; + onmsgesturechange: (ev: MSGestureEvent) => any; + onmsgesturedoubletap: (ev: MSGestureEvent) => any; + onmsgestureend: (ev: MSGestureEvent) => any; + onmsgesturehold: (ev: MSGestureEvent) => any; + onmsgesturestart: (ev: MSGestureEvent) => any; + onmsgesturetap: (ev: MSGestureEvent) => any; + onmsinertiastart: (ev: MSGestureEvent) => any; + onmspointercancel: (ev: MSPointerEvent) => any; + onmspointerdown: (ev: MSPointerEvent) => any; + onmspointerenter: (ev: MSPointerEvent) => any; + onmspointerleave: (ev: MSPointerEvent) => any; + onmspointermove: (ev: MSPointerEvent) => any; + onmspointerout: (ev: MSPointerEvent) => any; + onmspointerover: (ev: MSPointerEvent) => any; + onmspointerup: (ev: MSPointerEvent) => any; + onoffline: (ev: Event) => any; + ononline: (ev: Event) => any; + onorientationchange: (ev: Event) => any; + onpagehide: (ev: PageTransitionEvent) => any; + onpageshow: (ev: PageTransitionEvent) => any; + onpause: (ev: Event) => any; + onplay: (ev: Event) => any; + onplaying: (ev: Event) => any; + onpopstate: (ev: PopStateEvent) => any; + onprogress: (ev: ProgressEvent) => any; + onratechange: (ev: Event) => any; + onreadystatechange: (ev: ProgressEvent) => any; + onreset: (ev: Event) => any; + onresize: (ev: UIEvent) => any; + onscroll: (ev: UIEvent) => any; + onseeked: (ev: Event) => any; + onseeking: (ev: Event) => any; + onselect: (ev: UIEvent) => any; + onstalled: (ev: Event) => any; + onstorage: (ev: StorageEvent) => any; + onsubmit: (ev: Event) => any; + onsuspend: (ev: Event) => any; + ontimeupdate: (ev: Event) => any; + ontouchcancel: any; + ontouchend: any; + ontouchmove: any; + ontouchstart: any; + onunload: (ev: Event) => any; + onvolumechange: (ev: Event) => any; + onwaiting: (ev: Event) => any; + opener: Window; + orientation: string; + outerHeight: number; + outerWidth: number; + pageXOffset: number; + pageYOffset: number; + parent: Window; + performance: Performance; + personalbar: BarProp; + screen: Screen; + screenLeft: number; + screenTop: number; + screenX: number; + screenY: number; + scrollX: number; + scrollY: number; + scrollbars: BarProp; + self: Window; + status: string; + statusbar: BarProp; + styleMedia: StyleMedia; + toolbar: BarProp; + top: Window; + window: Window; + alert(message?: any): void; + blur(): void; + cancelAnimationFrame(handle: number): void; + captureEvents(): void; + close(): void; + confirm(message?: string): boolean; + focus(): void; + getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; + getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; + getSelection(): Selection; + matchMedia(mediaQuery: string): MediaQueryList; + moveBy(x?: number, y?: number): void; + moveTo(x?: number, y?: number): void; + msCancelRequestAnimationFrame(handle: number): void; + msMatchMedia(mediaQuery: string): MediaQueryList; + msRequestAnimationFrame(callback: FrameRequestCallback): number; + msWriteProfilerMark(profilerMarkName: string): void; + open(url?: string, target?: string, features?: string, replace?: boolean): any; + postMessage(message: any, targetOrigin: string, ports?: any): void; + print(): void; + prompt(message?: string, _default?: string): string; + releaseEvents(): void; + requestAnimationFrame(callback: FrameRequestCallback): number; + resizeBy(x?: number, y?: number): void; + resizeTo(x?: number, y?: number): void; + scroll(x?: number, y?: number): void; + scrollBy(x?: number, y?: number): void; + scrollTo(x?: number, y?: number): void; + webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; + webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "compassneedscalibration", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: Window; +} + +declare var Window: { + prototype: Window; + new(): Window; +} + +interface Worker extends EventTarget, AbstractWorker { + onmessage: (ev: MessageEvent) => any; + postMessage(message: any, ports?: any): void; + terminate(): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Worker: { + prototype: Worker; + new(stringUrl: string): Worker; +} + +interface XMLDocument extends Document { +} + +declare var XMLDocument: { + prototype: XMLDocument; + new(): XMLDocument; +} + +interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget { + msCaching: string; + onreadystatechange: (ev: ProgressEvent) => any; + readyState: number; + response: any; + responseBody: any; + responseText: string; + responseType: string; + responseXML: any; + status: number; + statusText: string; + timeout: number; + upload: XMLHttpRequestUpload; + withCredentials: boolean; + abort(): void; + getAllResponseHeaders(): string; + getResponseHeader(header: string): string; + msCachingEnabled(): boolean; + open(method: string, url: string, async?: boolean, user?: string, password?: string): void; + overrideMimeType(mime: string): void; + send(data?: Document): void; + send(data?: string): void; + setRequestHeader(header: string, value: string): void; + DONE: number; + HEADERS_RECEIVED: number; + LOADING: number; + OPENED: number; + UNSENT: number; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeout", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var XMLHttpRequest: { + prototype: XMLHttpRequest; + new(): XMLHttpRequest; + DONE: number; + HEADERS_RECEIVED: number; + LOADING: number; + OPENED: number; + UNSENT: number; + create(): XMLHttpRequest; +} + +interface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var XMLHttpRequestUpload: { + prototype: XMLHttpRequestUpload; + new(): XMLHttpRequestUpload; +} + +interface XMLSerializer { + serializeToString(target: Node): string; +} + +declare var XMLSerializer: { + prototype: XMLSerializer; + new(): XMLSerializer; +} + +interface XPathEvaluator { + createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; + createNSResolver(nodeResolver?: Node): XPathNSResolver; + evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver, type: number, result: XPathResult): XPathResult; +} + +declare var XPathEvaluator: { + prototype: XPathEvaluator; + new(): XPathEvaluator; +} + +interface XPathExpression { + evaluate(contextNode: Node, type: number, result: XPathResult): XPathExpression; +} + +declare var XPathExpression: { + prototype: XPathExpression; + new(): XPathExpression; +} + +interface XPathNSResolver { + lookupNamespaceURI(prefix: string): string; +} + +declare var XPathNSResolver: { + prototype: XPathNSResolver; + new(): XPathNSResolver; +} + +interface XPathResult { + booleanValue: boolean; + invalidIteratorState: boolean; + numberValue: number; + resultType: number; + singleNodeValue: Node; + snapshotLength: number; + stringValue: string; + iterateNext(): Node; + snapshotItem(index: number): Node; + ANY_TYPE: number; + ANY_UNORDERED_NODE_TYPE: number; + BOOLEAN_TYPE: number; + FIRST_ORDERED_NODE_TYPE: number; + NUMBER_TYPE: number; + ORDERED_NODE_ITERATOR_TYPE: number; + ORDERED_NODE_SNAPSHOT_TYPE: number; + STRING_TYPE: number; + UNORDERED_NODE_ITERATOR_TYPE: number; + UNORDERED_NODE_SNAPSHOT_TYPE: number; +} + +declare var XPathResult: { + prototype: XPathResult; + new(): XPathResult; + ANY_TYPE: number; + ANY_UNORDERED_NODE_TYPE: number; + BOOLEAN_TYPE: number; + FIRST_ORDERED_NODE_TYPE: number; + NUMBER_TYPE: number; + ORDERED_NODE_ITERATOR_TYPE: number; + ORDERED_NODE_SNAPSHOT_TYPE: number; + STRING_TYPE: number; + UNORDERED_NODE_ITERATOR_TYPE: number; + UNORDERED_NODE_SNAPSHOT_TYPE: number; +} + +interface XSLTProcessor { + clearParameters(): void; + getParameter(namespaceURI: string, localName: string): any; + importStylesheet(style: Node): void; + removeParameter(namespaceURI: string, localName: string): void; + reset(): void; + setParameter(namespaceURI: string, localName: string, value: any): void; + transformToDocument(source: Node): Document; + transformToFragment(source: Node, document: Document): DocumentFragment; +} + +declare var XSLTProcessor: { + prototype: XSLTProcessor; + new(): XSLTProcessor; +} + +interface AbstractWorker { + onerror: (ev: Event) => any; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface ChildNode { + remove(): void; +} + +interface DOML2DeprecatedColorProperty { + color: string; +} + +interface DOML2DeprecatedSizeProperty { + size: number; +} + +interface DocumentEvent { + createEvent(eventInterface:"AnimationEvent"): AnimationEvent; + createEvent(eventInterface:"AriaRequestEvent"): AriaRequestEvent; + createEvent(eventInterface:"AudioProcessingEvent"): AudioProcessingEvent; + createEvent(eventInterface:"BeforeUnloadEvent"): BeforeUnloadEvent; + createEvent(eventInterface:"CloseEvent"): CloseEvent; + createEvent(eventInterface:"CommandEvent"): CommandEvent; + createEvent(eventInterface:"CompositionEvent"): CompositionEvent; + createEvent(eventInterface:"DeviceMotionEvent"): DeviceMotionEvent; + createEvent(eventInterface:"DeviceOrientationEvent"): DeviceOrientationEvent; + createEvent(eventInterface:"DragEvent"): DragEvent; + createEvent(eventInterface:"ErrorEvent"): ErrorEvent; + createEvent(eventInterface:"Event"): Event; + createEvent(eventInterface:"FocusEvent"): FocusEvent; + createEvent(eventInterface:"GamepadEvent"): GamepadEvent; + createEvent(eventInterface:"HashChangeEvent"): HashChangeEvent; + createEvent(eventInterface:"IDBVersionChangeEvent"): IDBVersionChangeEvent; + createEvent(eventInterface:"KeyboardEvent"): KeyboardEvent; + createEvent(eventInterface:"LongRunningScriptDetectedEvent"): LongRunningScriptDetectedEvent; + createEvent(eventInterface:"MSGestureEvent"): MSGestureEvent; + createEvent(eventInterface:"MSManipulationEvent"): MSManipulationEvent; + createEvent(eventInterface:"MSMediaKeyMessageEvent"): MSMediaKeyMessageEvent; + createEvent(eventInterface:"MSMediaKeyNeededEvent"): MSMediaKeyNeededEvent; + createEvent(eventInterface:"MSPointerEvent"): MSPointerEvent; + createEvent(eventInterface:"MSSiteModeEvent"): MSSiteModeEvent; + createEvent(eventInterface:"MessageEvent"): MessageEvent; + createEvent(eventInterface:"MouseEvent"): MouseEvent; + createEvent(eventInterface:"MouseWheelEvent"): MouseWheelEvent; + createEvent(eventInterface:"MutationEvent"): MutationEvent; + createEvent(eventInterface:"NavigationCompletedEvent"): NavigationCompletedEvent; + createEvent(eventInterface:"NavigationEvent"): NavigationEvent; + createEvent(eventInterface:"NavigationEventWithReferrer"): NavigationEventWithReferrer; + createEvent(eventInterface:"OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent; + createEvent(eventInterface:"PageTransitionEvent"): PageTransitionEvent; + createEvent(eventInterface:"PermissionRequestedEvent"): PermissionRequestedEvent; + createEvent(eventInterface:"PointerEvent"): PointerEvent; + createEvent(eventInterface:"PopStateEvent"): PopStateEvent; + createEvent(eventInterface:"ProgressEvent"): ProgressEvent; + createEvent(eventInterface:"SVGZoomEvent"): SVGZoomEvent; + createEvent(eventInterface:"ScriptNotifyEvent"): ScriptNotifyEvent; + createEvent(eventInterface:"StorageEvent"): StorageEvent; + createEvent(eventInterface:"TextEvent"): TextEvent; + createEvent(eventInterface:"TouchEvent"): TouchEvent; + createEvent(eventInterface:"TrackEvent"): TrackEvent; + createEvent(eventInterface:"TransitionEvent"): TransitionEvent; + createEvent(eventInterface:"UIEvent"): UIEvent; + createEvent(eventInterface:"UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent; + createEvent(eventInterface:"WebGLContextEvent"): WebGLContextEvent; + createEvent(eventInterface:"WheelEvent"): WheelEvent; + createEvent(eventInterface: string): Event; +} + +interface ElementTraversal { + childElementCount: number; + firstElementChild: Element; + lastElementChild: Element; + nextElementSibling: Element; + previousElementSibling: Element; +} + +interface GetSVGDocument { + getSVGDocument(): Document; +} + +interface GlobalEventHandlers { + onpointercancel: (ev: PointerEvent) => any; + onpointerdown: (ev: PointerEvent) => any; + onpointerenter: (ev: PointerEvent) => any; + onpointerleave: (ev: PointerEvent) => any; + onpointermove: (ev: PointerEvent) => any; + onpointerout: (ev: PointerEvent) => any; + onpointerover: (ev: PointerEvent) => any; + onpointerup: (ev: PointerEvent) => any; + onwheel: (ev: WheelEvent) => any; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface HTMLTableAlignment { + /** + * Sets or retrieves a value that you can use to implement your own ch functionality for the object. + */ + ch: string; + /** + * Sets or retrieves a value that you can use to implement your own chOff functionality for the object. + */ + chOff: string; + /** + * Sets or retrieves how text and other content are vertically aligned within the object that contains them. + */ + vAlign: string; +} + +interface IDBEnvironment { + indexedDB: IDBFactory; + msIndexedDB: IDBFactory; +} + +interface LinkStyle { + sheet: StyleSheet; +} + +interface MSBaseReader { + onabort: (ev: Event) => any; + onerror: (ev: Event) => any; + onload: (ev: Event) => any; + onloadend: (ev: ProgressEvent) => any; + onloadstart: (ev: Event) => any; + onprogress: (ev: ProgressEvent) => any; + readyState: number; + result: any; + abort(): void; + DONE: number; + EMPTY: number; + LOADING: number; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface MSFileSaver { + msSaveBlob(blob: any, defaultName?: string): boolean; + msSaveOrOpenBlob(blob: any, defaultName?: string): boolean; +} + +interface MSNavigatorDoNotTrack { + confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean; + confirmWebWideTrackingException(args: ExceptionInformation): boolean; + removeSiteSpecificTrackingException(args: ExceptionInformation): void; + removeWebWideTrackingException(args: ExceptionInformation): void; + storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void; + storeWebWideTrackingException(args: StoreExceptionsInformation): void; +} + +interface NavigatorContentUtils { +} + +interface NavigatorGeolocation { + geolocation: Geolocation; +} + +interface NavigatorID { + appName: string; + appVersion: string; + platform: string; + product: string; + productSub: string; + userAgent: string; + vendor: string; + vendorSub: string; +} + +interface NavigatorOnLine { + onLine: boolean; +} + +interface NavigatorStorageUtils { +} + +interface NodeSelector { + querySelector(selectors: string): Element; + querySelectorAll(selectors: string): NodeList; +} + +interface RandomSource { + getRandomValues(array: ArrayBufferView): ArrayBufferView; +} + +interface SVGAnimatedPathData { + pathSegList: SVGPathSegList; +} + +interface SVGAnimatedPoints { + animatedPoints: SVGPointList; + points: SVGPointList; +} + +interface SVGExternalResourcesRequired { + externalResourcesRequired: SVGAnimatedBoolean; +} + +interface SVGFilterPrimitiveStandardAttributes extends SVGStylable { + height: SVGAnimatedLength; + result: SVGAnimatedString; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; +} + +interface SVGFitToViewBox { + preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + viewBox: SVGAnimatedRect; +} + +interface SVGLangSpace { + xmllang: string; + xmlspace: string; +} + +interface SVGLocatable { + farthestViewportElement: SVGElement; + nearestViewportElement: SVGElement; + getBBox(): SVGRect; + getCTM(): SVGMatrix; + getScreenCTM(): SVGMatrix; + getTransformToElement(element: SVGElement): SVGMatrix; +} + +interface SVGStylable { + className: SVGAnimatedString; + style: CSSStyleDeclaration; +} + +interface SVGTests { + requiredExtensions: SVGStringList; + requiredFeatures: SVGStringList; + systemLanguage: SVGStringList; + hasExtension(extension: string): boolean; +} + +interface SVGTransformable extends SVGLocatable { + transform: SVGAnimatedTransformList; +} + +interface SVGURIReference { + href: SVGAnimatedString; +} + +interface WindowBase64 { + atob(encodedString: string): string; + btoa(rawString: string): string; +} + +interface WindowConsole { + console: Console; +} + +interface WindowLocalStorage { + localStorage: Storage; +} + +interface WindowSessionStorage { + sessionStorage: Storage; +} + +interface WindowTimers extends Object, WindowTimersExtension { + clearInterval(handle: number): void; + clearTimeout(handle: number): void; + setInterval(handler: any, timeout?: any, ...args: any[]): number; + setTimeout(handler: any, timeout?: any, ...args: any[]): number; +} + +interface WindowTimersExtension { + clearImmediate(handle: number): void; + msClearImmediate(handle: number): void; + msSetImmediate(expression: any, ...args: any[]): number; + setImmediate(expression: any, ...args: any[]): number; +} + +interface XMLHttpRequestEventTarget { + onabort: (ev: Event) => any; + onerror: (ev: Event) => any; + onload: (ev: Event) => any; + onloadend: (ev: ProgressEvent) => any; + onloadstart: (ev: Event) => any; + onprogress: (ev: ProgressEvent) => any; + ontimeout: (ev: ProgressEvent) => any; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeout", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + + +interface NodeListOf extends NodeList { + length: number; + item(index: number): TNode; + [index: number]: TNode; +} + +interface BlobPropertyBag { + type?: string; + endings?: string; +} + +interface EventListenerObject { + handleEvent(evt: Event): void; +} + +declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; + +interface ErrorEventHandler { + (event: Event, source?: string, fileno?: number, columnNumber?: number): void; + (event: string, source?: string, fileno?: number, columnNumber?: number): void; +} +interface PositionCallback { + (position: Position): void; +} +interface PositionErrorCallback { + (error: PositionError): void; +} +interface MediaQueryListListener { + (mql: MediaQueryList): void; +} +interface MSLaunchUriCallback { + (): void; +} +interface FrameRequestCallback { + (time: number): void; +} +interface MSUnsafeFunctionCallback { + (): any; +} +interface MSExecAtPriorityFunctionCallback { + (...args: any[]): any; +} +interface MutationCallback { + (mutations: MutationRecord[], observer: MutationObserver): void; +} +interface DecodeSuccessCallback { + (decodedData: AudioBuffer): void; +} +interface DecodeErrorCallback { + (): void; +} +interface FunctionStringCallback { + (data: string): void; +} +declare var Audio: {new(src?: string): HTMLAudioElement; }; +declare var Image: {new(width?: number, height?: number): HTMLImageElement; }; +declare var Option: {new(text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement; }; declare var animationStartTime: number; -declare var onmsgesturedoubletap: (ev: any) => any; -declare var onmspointerhover: (ev: any) => any; -declare var onmsgesturehold: (ev: any) => any; -declare var onmspointermove: (ev: any) => any; -declare var onmsgesturechange: (ev: any) => any; -declare var onmsgesturestart: (ev: any) => any; -declare var onmspointercancel: (ev: any) => any; -declare var onmsgestureend: (ev: any) => any; -declare var onmsgesturetap: (ev: any) => any; -declare var onmspointerout: (ev: any) => any; -declare var msAnimationStartTime: number; declare var applicationCache: ApplicationCache; -declare var onmsinertiastart: (ev: any) => any; -declare var onmspointerover: (ev: any) => any; -declare var onpopstate: (ev: PopStateEvent) => any; -declare var onmspointerup: (ev: any) => any; -declare var onpageshow: (ev: PageTransitionEvent) => any; -declare var ondevicemotion: (ev: DeviceMotionEvent) => any; -declare var devicePixelRatio: number; -declare var msCrypto: Crypto; -declare var ondeviceorientation: (ev: DeviceOrientationEvent) => any; -declare var doNotTrack: string; -declare var onmspointerenter: (ev: any) => any; -declare var onpagehide: (ev: PageTransitionEvent) => any; -declare var onmspointerleave: (ev: any) => any; -declare function alert(message?: any): void; -declare function scroll(x?: number, y?: number): void; -declare function focus(): void; -declare function scrollTo(x?: number, y?: number): void; -declare function print(): void; -declare function prompt(message?: string, _default?: string): string; -declare function toString(): string; -declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window; -declare function scrollBy(x?: number, y?: number): void; -declare function confirm(message?: string): boolean; -declare function close(): void; -declare function postMessage(message: any, targetOrigin: string, ports?: any): void; -declare function showModalDialog(url?: string, argument?: any, options?: any): any; -declare function blur(): void; -declare function getSelection(): Selection; -declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; -declare function msCancelRequestAnimationFrame(handle: number): void; -declare function matchMedia(mediaQuery: string): MediaQueryList; -declare function cancelAnimationFrame(handle: number): void; -declare function msIsStaticHTML(html: string): boolean; -declare function msMatchMedia(mediaQuery: string): MediaQueryList; -declare function requestAnimationFrame(callback: FrameRequestCallback): number; -declare function msRequestAnimationFrame(callback: FrameRequestCallback): number; -declare function removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -declare function dispatchEvent(evt: Event): boolean; -declare function attachEvent(event: string, listener: EventListener): boolean; -declare function detachEvent(event: string, listener: EventListener): void; -declare var localStorage: Storage; -declare var status: string; -declare var onmouseleave: (ev: MouseEvent) => any; -declare var screenLeft: number; -declare var offscreenBuffering: any; -declare var maxConnectionsPerServer: number; -declare var onmouseenter: (ev: MouseEvent) => any; -declare var clipboardData: DataTransfer; -declare var defaultStatus: string; declare var clientInformation: Navigator; declare var closed: boolean; -declare var onhelp: (ev: Event) => any; +declare var crypto: Crypto; +declare var defaultStatus: string; +declare var devicePixelRatio: number; +declare var doNotTrack: string; +declare var document: Document; +declare var event: Event; declare var external: External; -declare var event: MSEventObj; -declare var onfocusout: (ev: FocusEvent) => any; +declare var frameElement: Element; +declare var frames: Window; +declare var history: History; +declare var innerHeight: number; +declare var innerWidth: number; +declare var length: number; +declare var location: Location; +declare var locationbar: BarProp; +declare var menubar: BarProp; +declare var msAnimationStartTime: number; +declare var msTemplatePrinter: MSTemplatePrinter; +declare var name: string; +declare var navigator: Navigator; +declare var offscreenBuffering: string | boolean; +declare var onabort: (ev: Event) => any; +declare var onafterprint: (ev: Event) => any; +declare var onbeforeprint: (ev: Event) => any; +declare var onbeforeunload: (ev: BeforeUnloadEvent) => any; +declare var onblur: (ev: FocusEvent) => any; +declare var oncanplay: (ev: Event) => any; +declare var oncanplaythrough: (ev: Event) => any; +declare var onchange: (ev: Event) => any; +declare var onclick: (ev: MouseEvent) => any; +declare var oncompassneedscalibration: (ev: Event) => any; +declare var oncontextmenu: (ev: PointerEvent) => any; +declare var ondblclick: (ev: MouseEvent) => any; +declare var ondevicemotion: (ev: DeviceMotionEvent) => any; +declare var ondeviceorientation: (ev: DeviceOrientationEvent) => any; +declare var ondrag: (ev: DragEvent) => any; +declare var ondragend: (ev: DragEvent) => any; +declare var ondragenter: (ev: DragEvent) => any; +declare var ondragleave: (ev: DragEvent) => any; +declare var ondragover: (ev: DragEvent) => any; +declare var ondragstart: (ev: DragEvent) => any; +declare var ondrop: (ev: DragEvent) => any; +declare var ondurationchange: (ev: Event) => any; +declare var onemptied: (ev: Event) => any; +declare var onended: (ev: Event) => any; +declare var onerror: ErrorEventHandler; +declare var onfocus: (ev: FocusEvent) => any; +declare var onhashchange: (ev: HashChangeEvent) => any; +declare var oninput: (ev: Event) => any; +declare var onkeydown: (ev: KeyboardEvent) => any; +declare var onkeypress: (ev: KeyboardEvent) => any; +declare var onkeyup: (ev: KeyboardEvent) => any; +declare var onload: (ev: Event) => any; +declare var onloadeddata: (ev: Event) => any; +declare var onloadedmetadata: (ev: Event) => any; +declare var onloadstart: (ev: Event) => any; +declare var onmessage: (ev: MessageEvent) => any; +declare var onmousedown: (ev: MouseEvent) => any; +declare var onmouseenter: (ev: MouseEvent) => any; +declare var onmouseleave: (ev: MouseEvent) => any; +declare var onmousemove: (ev: MouseEvent) => any; +declare var onmouseout: (ev: MouseEvent) => any; +declare var onmouseover: (ev: MouseEvent) => any; +declare var onmouseup: (ev: MouseEvent) => any; +declare var onmousewheel: (ev: MouseWheelEvent) => any; +declare var onmsgesturechange: (ev: MSGestureEvent) => any; +declare var onmsgesturedoubletap: (ev: MSGestureEvent) => any; +declare var onmsgestureend: (ev: MSGestureEvent) => any; +declare var onmsgesturehold: (ev: MSGestureEvent) => any; +declare var onmsgesturestart: (ev: MSGestureEvent) => any; +declare var onmsgesturetap: (ev: MSGestureEvent) => any; +declare var onmsinertiastart: (ev: MSGestureEvent) => any; +declare var onmspointercancel: (ev: MSPointerEvent) => any; +declare var onmspointerdown: (ev: MSPointerEvent) => any; +declare var onmspointerenter: (ev: MSPointerEvent) => any; +declare var onmspointerleave: (ev: MSPointerEvent) => any; +declare var onmspointermove: (ev: MSPointerEvent) => any; +declare var onmspointerout: (ev: MSPointerEvent) => any; +declare var onmspointerover: (ev: MSPointerEvent) => any; +declare var onmspointerup: (ev: MSPointerEvent) => any; +declare var onoffline: (ev: Event) => any; +declare var ononline: (ev: Event) => any; +declare var onorientationchange: (ev: Event) => any; +declare var onpagehide: (ev: PageTransitionEvent) => any; +declare var onpageshow: (ev: PageTransitionEvent) => any; +declare var onpause: (ev: Event) => any; +declare var onplay: (ev: Event) => any; +declare var onplaying: (ev: Event) => any; +declare var onpopstate: (ev: PopStateEvent) => any; +declare var onprogress: (ev: ProgressEvent) => any; +declare var onratechange: (ev: Event) => any; +declare var onreadystatechange: (ev: ProgressEvent) => any; +declare var onreset: (ev: Event) => any; +declare var onresize: (ev: UIEvent) => any; +declare var onscroll: (ev: UIEvent) => any; +declare var onseeked: (ev: Event) => any; +declare var onseeking: (ev: Event) => any; +declare var onselect: (ev: UIEvent) => any; +declare var onstalled: (ev: Event) => any; +declare var onstorage: (ev: StorageEvent) => any; +declare var onsubmit: (ev: Event) => any; +declare var onsuspend: (ev: Event) => any; +declare var ontimeupdate: (ev: Event) => any; +declare var ontouchcancel: any; +declare var ontouchend: any; +declare var ontouchmove: any; +declare var ontouchstart: any; +declare var onunload: (ev: Event) => any; +declare var onvolumechange: (ev: Event) => any; +declare var onwaiting: (ev: Event) => any; +declare var opener: Window; +declare var orientation: string; +declare var outerHeight: number; +declare var outerWidth: number; +declare var pageXOffset: number; +declare var pageYOffset: number; +declare var parent: Window; +declare var performance: Performance; +declare var personalbar: BarProp; +declare var screen: Screen; +declare var screenLeft: number; declare var screenTop: number; -declare var onfocusin: (ev: FocusEvent) => any; -declare function showModelessDialog(url?: string, argument?: any, options?: any): Window; -declare function navigate(url: string): void; -declare function resizeBy(x?: number, y?: number): void; -declare function item(index: any): any; -declare function resizeTo(x?: number, y?: number): void; -declare function createPopup(arguments?: any): MSPopupWindow; -declare function toStaticHTML(html: string): string; -declare function execScript(code: string, language?: string): any; -declare function msWriteProfilerMark(profilerMarkName: string): void; -declare function moveTo(x?: number, y?: number): void; -declare function moveBy(x?: number, y?: number): void; -declare function showHelp(url: string, helpArg?: any, features?: string): void; +declare var screenX: number; +declare var screenY: number; +declare var scrollX: number; +declare var scrollY: number; +declare var scrollbars: BarProp; +declare var self: Window; +declare var status: string; +declare var statusbar: BarProp; +declare var styleMedia: StyleMedia; +declare var toolbar: BarProp; +declare var top: Window; +declare var window: Window; +declare function alert(message?: any): void; +declare function blur(): void; +declare function cancelAnimationFrame(handle: number): void; declare function captureEvents(): void; +declare function close(): void; +declare function confirm(message?: string): boolean; +declare function focus(): void; +declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; +declare function getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; +declare function getSelection(): Selection; +declare function matchMedia(mediaQuery: string): MediaQueryList; +declare function moveBy(x?: number, y?: number): void; +declare function moveTo(x?: number, y?: number): void; +declare function msCancelRequestAnimationFrame(handle: number): void; +declare function msMatchMedia(mediaQuery: string): MediaQueryList; +declare function msRequestAnimationFrame(callback: FrameRequestCallback): number; +declare function msWriteProfilerMark(profilerMarkName: string): void; +declare function open(url?: string, target?: string, features?: string, replace?: boolean): any; +declare function postMessage(message: any, targetOrigin: string, ports?: any): void; +declare function print(): void; +declare function prompt(message?: string, _default?: string): string; declare function releaseEvents(): void; -declare var sessionStorage: Storage; -declare function clearTimeout(handle: number): void; -declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; +declare function requestAnimationFrame(callback: FrameRequestCallback): number; +declare function resizeBy(x?: number, y?: number): void; +declare function resizeTo(x?: number, y?: number): void; +declare function scroll(x?: number, y?: number): void; +declare function scrollBy(x?: number, y?: number): void; +declare function scrollTo(x?: number, y?: number): void; +declare function webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; +declare function webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; +declare function toString(): string; +declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +declare function dispatchEvent(evt: Event): boolean; +declare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; declare function clearInterval(handle: number): void; +declare function clearTimeout(handle: number): void; declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; -declare function msSetImmediate(expression: any, ...args: any[]): number; +declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; declare function clearImmediate(handle: number): void; declare function msClearImmediate(handle: number): void; +declare function msSetImmediate(expression: any, ...args: any[]): number; declare function setImmediate(expression: any, ...args: any[]): number; -declare function btoa(rawString: string): string; -declare function atob(encodedString: string): string; -declare var msIndexedDB: IDBFactory; -declare var indexedDB: IDBFactory; +declare var sessionStorage: Storage; +declare var localStorage: Storage; declare var console: Console; -declare var onpointerenter: (ev: PointerEvent) => any; -declare var onpointerout: (ev: PointerEvent) => any; -declare var onpointerdown: (ev: PointerEvent) => any; -declare var onpointerup: (ev: PointerEvent) => any; declare var onpointercancel: (ev: PointerEvent) => any; -declare var onpointerover: (ev: PointerEvent) => any; -declare var onpointermove: (ev: PointerEvent) => any; +declare var onpointerdown: (ev: PointerEvent) => any; +declare var onpointerenter: (ev: PointerEvent) => any; declare var onpointerleave: (ev: PointerEvent) => any; -declare function addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; +declare var onpointermove: (ev: PointerEvent) => any; +declare var onpointerout: (ev: PointerEvent) => any; +declare var onpointerover: (ev: PointerEvent) => any; +declare var onpointerup: (ev: PointerEvent) => any; +declare var onwheel: (ev: WheelEvent) => any; +declare var indexedDB: IDBFactory; +declare var msIndexedDB: IDBFactory; +declare function atob(encodedString: string): string; +declare function btoa(rawString: string): string; +declare function addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; declare function addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "compassneedscalibration", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; declare function addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; declare function addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; +declare function addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; declare function addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +declare function addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; \ No newline at end of file diff --git a/src/lib/es6.d.ts b/src/lib/es6.d.ts index 8590e2273e0..b81a3341a6c 100644 --- a/src/lib/es6.d.ts +++ b/src/lib/es6.d.ts @@ -50,26 +50,21 @@ interface SymbolConstructor { */ isConcatSpreadable: symbol; - /** - * A Boolean value that if true indicates that an object may be used as a regular expression. - */ - isRegExp: symbol; - /** * A method that returns the default iterator for an object.Called by the semantics of the - * for-of statement. + * for-of statement. */ iterator: symbol; /** * A method that converts an object to a corresponding primitive value.Called by the ToPrimitive - * abstract operation. + * abstract operation. */ toPrimitive: symbol; /** - * A String value that is used in the creation of the default string description of an object. - * Called by the built- in method Object.prototype.toString. + * A String value that is used in the creation of the default string description of an object. + * Called by the built-in method Object.prototype.toString. */ toStringTag: symbol; @@ -111,7 +106,7 @@ interface ObjectConstructor { getOwnPropertySymbols(o: any): symbol[]; /** - * Returns true if the values are the same value, false otherwise. + * Returns true if the values are the same value, false otherwise. * @param value1 The first value. * @param value2 The second value. */ @@ -598,8 +593,6 @@ interface Math { } interface RegExp { - [Symbol.isRegExp]: boolean; - /** * Matches a string with a regular expression, and returns an array containing the results of * that search. @@ -631,6 +624,20 @@ interface RegExp { */ split(string: string, limit?: number): string[]; + /** + * Returns a string indicating the flags of the regular expression in question. This field is read-only. + * The characters in this string are sequenced and concatenated in the following order: + * + * - "g" for global + * - "i" for ignoreCase + * - "m" for multiline + * - "u" for unicode + * - "y" for sticky + * + * If no flags are set, the value is the empty string. + */ + flags: string; + /** * Returns a Boolean value indicating the state of the sticky flag (y) used with a regular * expression. Default is false. Read-only. diff --git a/src/lib/extensions.d.ts b/src/lib/extensions.d.ts index 599d65bdfad..8ce4198551d 100644 --- a/src/lib/extensions.d.ts +++ b/src/lib/extensions.d.ts @@ -21,38 +21,216 @@ interface ArrayBuffer { slice(begin:number, end?:number): ArrayBuffer; } -declare var ArrayBuffer: { +interface ArrayBufferConstructor { prototype: ArrayBuffer; new (byteLength: number): ArrayBuffer; + isView(arg: any): boolean; } +declare var ArrayBuffer: ArrayBufferConstructor; interface ArrayBufferView { + /** + * The ArrayBuffer instance referenced by the array. + */ buffer: ArrayBuffer; - byteOffset: number; + + /** + * The length in bytes of the array. + */ byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; } /** - * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. + * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. */ -interface Int8Array extends ArrayBufferView { +interface Int8Array { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Int8Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Int8Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): Int8Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. */ - get(index: number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Int8Array; /** * Sets a value or an array of values. @@ -68,49 +246,256 @@ interface Int8Array extends ArrayBufferView { */ set(array: Int8Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Int8Array; /** - * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements at begin, inclusive, up to end, exclusive. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Int8Array; + + /** + * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Int8Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Int8Array: { +interface Int8ArrayConstructor { prototype: Int8Array; new (length: number): Int8Array; new (array: Int8Array): Int8Array; new (array: number[]): Int8Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Int8Array; +} +declare var Int8Array: Int8ArrayConstructor; + +/** + * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Uint8Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Uint8Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): Uint8Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint8Array; /** * Sets a value or an array of values. @@ -126,49 +511,257 @@ interface Uint8Array extends ArrayBufferView { */ set(array: Uint8Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Uint8Array; /** - * Gets a new Uint8Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Uint8Array; + + /** + * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Uint8Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Uint8Array: { + +interface Uint8ArrayConstructor { prototype: Uint8Array; new (length: number): Uint8Array; new (array: Uint8Array): Uint8Array; new (array: number[]): Uint8Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 16-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Int16Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint8Array; +} +declare var Uint8Array: Uint8ArrayConstructor; + +/** + * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int16Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Int16Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Int16Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): Int16Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Int16Array; /** * Sets a value or an array of values. @@ -184,49 +777,257 @@ interface Int16Array extends ArrayBufferView { */ set(array: Int16Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Int16Array; /** - * Gets a new Int16Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Int16Array; + + /** + * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Int16Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Int16Array: { + +interface Int16ArrayConstructor { prototype: Int16Array; new (length: number): Int16Array; new (array: Int16Array): Int16Array; new (array: number[]): Int16Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint16Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Int16Array; +} +declare var Int16Array: Int16ArrayConstructor; + +/** + * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint16Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Uint16Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Uint16Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): Uint16Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint16Array; /** * Sets a value or an array of values. @@ -242,49 +1043,256 @@ interface Uint16Array extends ArrayBufferView { */ set(array: Uint16Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Uint16Array; /** - * Gets a new Uint16Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Uint16Array; + + /** + * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Uint16Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Uint16Array: { + +interface Uint16ArrayConstructor { prototype: Uint16Array; new (length: number): Uint16Array; new (array: Uint16Array): Uint16Array; new (array: number[]): Uint16Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 32-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Int32Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint16Array; +} +declare var Uint16Array: Uint16ArrayConstructor; +/** + * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int32Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Int32Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Int32Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): Int32Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Int32Array; /** * Sets a value or an array of values. @@ -300,49 +1308,257 @@ interface Int32Array extends ArrayBufferView { */ set(array: Int32Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Int32Array; /** - * Gets a new Int32Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Int32Array; + + /** + * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Int32Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Int32Array: { + +interface Int32ArrayConstructor { prototype: Int32Array; new (length: number): Int32Array; new (array: Int32Array): Int32Array; new (array: number[]): Int32Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint32Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Int32Array; +} +declare var Int32Array: Int32ArrayConstructor; + +/** + * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint32Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Uint32Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Uint32Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): Uint32Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint32Array; /** * Sets a value or an array of values. @@ -358,49 +1574,257 @@ interface Uint32Array extends ArrayBufferView { */ set(array: Uint32Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Uint32Array; /** - * Gets a new Int8Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Uint32Array; + + /** + * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Uint32Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Uint32Array: { + +interface Uint32ArrayConstructor { prototype: Uint32Array; new (length: number): Uint32Array; new (array: Uint32Array): Uint32Array; new (array: number[]): Uint32Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Float32Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint32Array; +} +declare var Uint32Array: Uint32ArrayConstructor; + +/** + * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number + * of bytes could not be allocated an exception is raised. + */ +interface Float32Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Float32Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Float32Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): Float32Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Float32Array; /** * Sets a value or an array of values. @@ -416,49 +1840,257 @@ interface Float32Array extends ArrayBufferView { */ set(array: Float32Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Float32Array; /** - * Gets a new Float32Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Float32Array; + + /** + * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Float32Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Float32Array: { + +interface Float32ArrayConstructor { prototype: Float32Array; new (length: number): Float32Array; new (array: Float32Array): Float32Array; new (array: number[]): Float32Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array; - BYTES_PER_ELEMENT: number; -} -/** - * A typed array of 64-bit float values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Float64Array extends ArrayBufferView { /** * The size in bytes of each element in the array. */ BYTES_PER_ELEMENT: number; + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Float32Array; +} +declare var Float32Array: Float32ArrayConstructor; + +/** + * A typed array of 64-bit float values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Float64Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Float64Array; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Float64Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): Float64Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + /** * The length of the array. */ length: number; - [index: number]: number; /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. */ - get(index: number): number; + map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Float64Array; /** * Sets a value or an array of values. @@ -474,187 +2106,67 @@ interface Float64Array extends ArrayBufferView { */ set(array: Float64Array, offset?: number): void; - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. */ - set(array: number[], offset?: number): void; + slice(start?: number, end?: number): Float64Array; /** - * Gets a new Float64Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Float64Array; + + /** + * Gets a new Float64Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin: number, end?: number): Float64Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + [index: number]: number; } -declare var Float64Array: { + +interface Float64ArrayConstructor { prototype: Float64Array; new (length: number): Float64Array; new (array: Float64Array): Float64Array; new (array: number[]): Float64Array; new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array; + + /** + * The size in bytes of each element in the array. + */ BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Float64Array; } - -/** - * You can use a DataView object to read and write the different kinds of binary data to any location in the ArrayBuffer. - */ -interface DataView extends ArrayBufferView { - /** - * Gets the Int8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt8(byteOffset: number): number; - - /** - * Gets the Uint8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint8(byteOffset: number): number; - - /** - * Gets the Int16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt16(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Uint16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint16(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Int32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Uint32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Float32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Float64 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat64(byteOffset: number, littleEndian?: boolean): number; - - /** - * Stores an Int8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setInt8(byteOffset: number, value: number): void; - - /** - * Stores an Uint8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setUint8(byteOffset: number, value: number): void; - - /** - * Stores an Int16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setInt16(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Uint16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setUint16(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Int32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setInt32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Uint32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setUint32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Float32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Float64 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void; -} -declare var DataView: { - prototype: DataView; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): DataView; -} - -///////////////////////////// -/// IE11 ECMAScript Extensions -///////////////////////////// - -interface Map { - clear(): void; - delete(key: K): boolean; - forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; - get(key: K): V; - has(key: K): boolean; - set(key: K, value: V): Map; - size: number; -} -declare var Map: { - new (): Map; - prototype: Map; -} - -interface WeakMap { - clear(): void; - delete(key: K): boolean; - get(key: K): V; - has(key: K): boolean; - set(key: K, value: V): WeakMap; -} -declare var WeakMap: { - new (): WeakMap; - prototype: WeakMap; -} - -interface Set { - add(value: T): Set; - clear(): void; - delete(value: T): boolean; - forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; - has(value: T): boolean; - size: number; -} -declare var Set: { - new (): Set; - prototype: Set; -} +declare var Float64Array: Float64ArrayConstructor; \ No newline at end of file diff --git a/src/lib/scriptHost.d.ts b/src/lib/scriptHost.d.ts index decf813bc2d..7faae06714c 100644 --- a/src/lib/scriptHost.d.ts +++ b/src/lib/scriptHost.d.ts @@ -21,13 +21,16 @@ 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. + * 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; } @@ -37,10 +40,12 @@ 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. */ @@ -49,37 +54,43 @@ interface TextStreamWriter extends TextStreamBase { interface TextStreamReader extends TextStreamBase { /** - * Returns a specified number of characters from an input stream, beginning at the current pointer position. + * Returns a specified number of characters from an input stream, starting 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. */ @@ -88,85 +99,180 @@ interface TextStreamReader extends TextStreamBase { 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). + * Outputs text to either a message box (under WScript.exe) or the command console window followed by + * a newline (under CScript.exe). */ 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 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; }; + +/** + * Allows enumerating over a COM collection, which may not have indexed item access. + */ +interface Enumerator { + /** + * Returns true if the current item is the last one in the collection, or the collection is empty, + * or the current item is undefined. + */ + atEnd(): boolean; + + /** + * Returns the current item in the collection + */ + item(): T; + + /** + * Resets the current item in the collection to the first item. If there are no items in the collection, + * the current item is set to undefined. + */ + moveFirst(): void; + + /** + * Moves the current item to the next item in the collection. If the enumerator is at the end of + * the collection or the collection is empty, the current item is set to undefined. + */ + moveNext(): void; +} + +interface EnumeratorConstructor { + new (collection: any): Enumerator; + new (collection: any): Enumerator; +} + +declare var Enumerator: EnumeratorConstructor; + +/** + * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions. + */ +interface VBArray { + /** + * Returns the number of dimensions (1-based). + */ + dimensions(): number; + + /** + * Takes an index for each dimension in the array, and returns the item at the corresponding location. + */ + getItem(dimension1Index: number, ...dimensionNIndexes: number[]): T; + + /** + * Returns the smallest available index for a given dimension. + * @param dimension 1-based dimension (defaults to 1) + */ + lbound(dimension?: number): number; + + /** + * Returns the largest available index for a given dimension. + * @param dimension 1-based dimension (defaults to 1) + */ + ubound(dimension?: number): number; + + /** + * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions, + * each successive dimension is appended to the end of the array. + * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6] + */ + toArray(): T[]; +} + +interface VBArrayConstructor { + new (safeArray: any): VBArray; + new (safeArray: any): VBArray; +} + +declare var VBArray: VBArrayConstructor; diff --git a/src/lib/webworker.generated.d.ts b/src/lib/webworker.generated.d.ts index a6119989164..1ab2c7d418f 100644 --- a/src/lib/webworker.generated.d.ts +++ b/src/lib/webworker.generated.d.ts @@ -1,176 +1,73 @@ + ///////////////////////////// /// IE Worker APIs ///////////////////////////// - -interface Console { - info(message?: any, ...optionalParams: any[]): void; - warn(message?: any, ...optionalParams: any[]): void; - error(message?: any, ...optionalParams: any[]): void; - log(message?: any, ...optionalParams: any[]): void; - profile(reportName?: string): void; - assert(test?: boolean, message?: string, ...optionalParams: any[]): void; - msIsIndependentlyComposed(element: any): boolean; - clear(): void; - dir(value?: any, ...optionalParams: any[]): void; - profileEnd(): void; - count(countTitle?: string): void; - groupEnd(): void; - time(timerName?: string): void; - timeEnd(timerName?: string): void; - trace(): void; - group(groupTitle?: string): void; - dirxml(value: any): void; - debug(message?: string, ...optionalParams: any[]): void; - groupCollapsed(groupTitle?: string): void; - select(element: any): void; -} -declare var Console: { - prototype: Console; - new(): Console; -} - -interface NavigatorID { - appVersion: string; - appName: string; - userAgent: string; - platform: string; - product: string; - vendor: string; -} - -interface EventTarget { - removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; - dispatchEvent(evt: Event): boolean; -} - -interface MessageEvent extends Event { - source: any; - origin: string; - data: any; - ports: any; - initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: any): void; -} -declare var MessageEvent: { - prototype: MessageEvent; - new(): MessageEvent; -} - -interface XMLHttpRequest extends EventTarget { - responseBody: any; - status: number; - readyState: number; - responseText: string; - responseXML: any; - ontimeout: (ev: Event) => any; - statusText: string; - onreadystatechange: (ev: Event) => any; - timeout: number; - onload: (ev: Event) => any; - response: any; - withCredentials: boolean; - onprogress: (ev: ProgressEvent) => any; - onabort: (ev: any) => any; - responseType: string; - onloadend: (ev: ProgressEvent) => any; - upload: XMLHttpRequestEventTarget; - onerror: (ev: ErrorEvent) => any; - onloadstart: (ev: Event) => any; - msCaching: string; - open(method: string, url: string, async?: boolean, user?: string, password?: string): void; - send(data?: any): void; - abort(): void; - getAllResponseHeaders(): string; - setRequestHeader(header: string, value: string): void; - getResponseHeader(header: string): string; - msCachingEnabled(): boolean; - overrideMimeType(mime: string): void; - LOADING: number; - DONE: number; - UNSENT: number; - OPENED: number; - HEADERS_RECEIVED: number; - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var XMLHttpRequest: { - prototype: XMLHttpRequest; - new(): XMLHttpRequest; - LOADING: number; - DONE: number; - UNSENT: number; - OPENED: number; - HEADERS_RECEIVED: number; - create(): XMLHttpRequest; -} - interface EventListener { (evt: Event): void; } -interface EventException { +interface Blob { + size: number; + type: string; + msClose(): void; + msDetachStream(): any; + slice(start?: number, end?: number, contentType?: string): Blob; +} + +declare var Blob: { + prototype: Blob; + new (blobParts?: any[], options?: BlobPropertyBag): Blob; +} + +interface CloseEvent extends Event { code: number; - message: string; + reason: string; + wasClean: boolean; + initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; +} + +declare var CloseEvent: { + prototype: CloseEvent; + new(): CloseEvent; +} + +interface Console { + assert(test?: boolean, message?: string, ...optionalParams: any[]): void; + clear(): void; + count(countTitle?: string): void; + debug(message?: string, ...optionalParams: any[]): void; + dir(value?: any, ...optionalParams: any[]): void; + dirxml(value: any): void; + error(message?: any, ...optionalParams: any[]): void; + group(groupTitle?: string): void; + groupCollapsed(groupTitle?: string): void; + groupEnd(): void; + info(message?: any, ...optionalParams: any[]): void; + log(message?: any, ...optionalParams: any[]): void; + msIsIndependentlyComposed(element: any): boolean; + profile(reportName?: string): void; + profileEnd(): void; + select(element: any): void; + time(timerName?: string): void; + timeEnd(timerName?: string): void; + trace(): void; + warn(message?: any, ...optionalParams: any[]): void; +} + +declare var Console: { + prototype: Console; + new(): Console; +} + +interface DOMError { name: string; toString(): string; - DISPATCH_REQUEST_ERR: number; - UNSPECIFIED_EVENT_TYPE_ERR: number; -} -declare var EventException: { - prototype: EventException; - new(): EventException; - DISPATCH_REQUEST_ERR: number; - UNSPECIFIED_EVENT_TYPE_ERR: number; } -interface NavigatorOnLine { - onLine: boolean; -} - -interface Event { - timeStamp: number; - defaultPrevented: boolean; - isTrusted: boolean; - currentTarget: EventTarget; - cancelBubble: boolean; - target: EventTarget; - eventPhase: number; - cancelable: boolean; - type: string; - srcElement: any; - bubbles: boolean; - initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; - stopPropagation(): void; - stopImmediatePropagation(): void; - preventDefault(): void; - CAPTURING_PHASE: number; - AT_TARGET: number; - BUBBLING_PHASE: number; -} -declare var Event: { - prototype: Event; - new(): Event; - CAPTURING_PHASE: number; - AT_TARGET: number; - BUBBLING_PHASE: number; -} - -interface ImageData { - width: number; - data: number[]; - height: number; -} -declare var ImageData: { - prototype: ImageData; - new(): ImageData; +declare var DOMError: { + prototype: DOMError; + new(): DOMError; } interface DOMException { @@ -178,370 +75,65 @@ interface DOMException { message: string; name: string; toString(): string; - HIERARCHY_REQUEST_ERR: number; - NO_MODIFICATION_ALLOWED_ERR: number; - INVALID_MODIFICATION_ERR: number; - NAMESPACE_ERR: number; - INVALID_CHARACTER_ERR: number; - TYPE_MISMATCH_ERR: number; ABORT_ERR: number; - INVALID_STATE_ERR: number; - SECURITY_ERR: number; - NETWORK_ERR: number; - WRONG_DOCUMENT_ERR: number; - QUOTA_EXCEEDED_ERR: number; - INDEX_SIZE_ERR: number; - DOMSTRING_SIZE_ERR: number; - SYNTAX_ERR: number; - SERIALIZE_ERR: number; - VALIDATION_ERR: number; - NOT_FOUND_ERR: number; - URL_MISMATCH_ERR: number; - PARSE_ERR: number; - NO_DATA_ALLOWED_ERR: number; - NOT_SUPPORTED_ERR: number; - INVALID_ACCESS_ERR: number; - INUSE_ATTRIBUTE_ERR: number; - INVALID_NODE_TYPE_ERR: number; DATA_CLONE_ERR: number; + DOMSTRING_SIZE_ERR: number; + HIERARCHY_REQUEST_ERR: number; + INDEX_SIZE_ERR: number; + INUSE_ATTRIBUTE_ERR: number; + INVALID_ACCESS_ERR: number; + INVALID_CHARACTER_ERR: number; + INVALID_MODIFICATION_ERR: number; + INVALID_NODE_TYPE_ERR: number; + INVALID_STATE_ERR: number; + NAMESPACE_ERR: number; + NETWORK_ERR: number; + NOT_FOUND_ERR: number; + NOT_SUPPORTED_ERR: number; + NO_DATA_ALLOWED_ERR: number; + NO_MODIFICATION_ALLOWED_ERR: number; + PARSE_ERR: number; + QUOTA_EXCEEDED_ERR: number; + SECURITY_ERR: number; + SERIALIZE_ERR: number; + SYNTAX_ERR: number; TIMEOUT_ERR: number; + TYPE_MISMATCH_ERR: number; + URL_MISMATCH_ERR: number; + VALIDATION_ERR: number; + WRONG_DOCUMENT_ERR: number; } + declare var DOMException: { prototype: DOMException; new(): DOMException; - HIERARCHY_REQUEST_ERR: number; - NO_MODIFICATION_ALLOWED_ERR: number; - INVALID_MODIFICATION_ERR: number; - NAMESPACE_ERR: number; - INVALID_CHARACTER_ERR: number; - TYPE_MISMATCH_ERR: number; ABORT_ERR: number; - INVALID_STATE_ERR: number; - SECURITY_ERR: number; - NETWORK_ERR: number; - WRONG_DOCUMENT_ERR: number; - QUOTA_EXCEEDED_ERR: number; - INDEX_SIZE_ERR: number; - DOMSTRING_SIZE_ERR: number; - SYNTAX_ERR: number; - SERIALIZE_ERR: number; - VALIDATION_ERR: number; - NOT_FOUND_ERR: number; - URL_MISMATCH_ERR: number; - PARSE_ERR: number; - NO_DATA_ALLOWED_ERR: number; - NOT_SUPPORTED_ERR: number; - INVALID_ACCESS_ERR: number; - INUSE_ATTRIBUTE_ERR: number; - INVALID_NODE_TYPE_ERR: number; DATA_CLONE_ERR: number; + DOMSTRING_SIZE_ERR: number; + HIERARCHY_REQUEST_ERR: number; + INDEX_SIZE_ERR: number; + INUSE_ATTRIBUTE_ERR: number; + INVALID_ACCESS_ERR: number; + INVALID_CHARACTER_ERR: number; + INVALID_MODIFICATION_ERR: number; + INVALID_NODE_TYPE_ERR: number; + INVALID_STATE_ERR: number; + NAMESPACE_ERR: number; + NETWORK_ERR: number; + NOT_FOUND_ERR: number; + NOT_SUPPORTED_ERR: number; + NO_DATA_ALLOWED_ERR: number; + NO_MODIFICATION_ALLOWED_ERR: number; + PARSE_ERR: number; + QUOTA_EXCEEDED_ERR: number; + SECURITY_ERR: number; + SERIALIZE_ERR: number; + SYNTAX_ERR: number; TIMEOUT_ERR: number; -} - -interface ErrorEvent extends Event { - colno: number; - filename: string; - error: any; - lineno: number; - message: string; - initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; -} -declare var ErrorEvent: { - prototype: ErrorEvent; - new(): ErrorEvent; -} - -interface MSStreamReader extends MSBaseReader { - error: DOMError; - readAsArrayBuffer(stream: MSStream, size?: number): void; - readAsBlob(stream: MSStream, size?: number): void; - readAsDataURL(stream: MSStream, size?: number): void; - readAsText(stream: MSStream, encoding?: string, size?: number): void; -} -declare var MSStreamReader: { - prototype: MSStreamReader; - new(): MSStreamReader; -} - -interface MessageChannel { - port2: MessagePort; - port1: MessagePort; -} -declare var MessageChannel: { - prototype: MessageChannel; - new(): MessageChannel; -} - -interface DOMError { - name: string; - toString(): string; -} -declare var DOMError: { - prototype: DOMError; - new(): DOMError; -} - -interface CloseEvent extends Event { - wasClean: boolean; - reason: string; - code: number; - initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; -} -declare var CloseEvent: { - prototype: CloseEvent; - new(): CloseEvent; -} - -interface WebSocket extends EventTarget { - protocol: string; - readyState: number; - bufferedAmount: number; - onopen: (ev: Event) => any; - extensions: string; - onmessage: (ev: MessageEvent) => any; - onclose: (ev: CloseEvent) => any; - onerror: (ev: ErrorEvent) => any; - binaryType: string; - url: string; - close(code?: number, reason?: string): void; - send(data: any): void; - OPEN: number; - CLOSING: number; - CONNECTING: number; - CLOSED: number; - addEventListener(type: "open", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "close", listener: (ev: CloseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var WebSocket: { - prototype: WebSocket; - new(url: string, protocols?: string): WebSocket; - new(url: string, protocols?: string[]): WebSocket; - OPEN: number; - CLOSING: number; - CONNECTING: number; - CLOSED: number; -} - -interface ProgressEvent extends Event { - loaded: number; - lengthComputable: boolean; - total: number; - initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; -} -declare var ProgressEvent: { - prototype: ProgressEvent; - new(): ProgressEvent; -} - -interface IDBObjectStore { - indexNames: DOMStringList; - name: string; - transaction: IDBTransaction; - keyPath: string; - count(key?: any): IDBRequest; - add(value: any, key?: any): IDBRequest; - clear(): IDBRequest; - createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; - put(value: any, key?: any): IDBRequest; - openCursor(range?: any, direction?: string): IDBRequest; - deleteIndex(indexName: string): void; - index(name: string): IDBIndex; - get(key: any): IDBRequest; - delete(key: any): IDBRequest; -} -declare var IDBObjectStore: { - prototype: IDBObjectStore; - new(): IDBObjectStore; -} - -interface IDBVersionChangeEvent extends Event { - newVersion: number; - oldVersion: number; -} -declare var IDBVersionChangeEvent: { - prototype: IDBVersionChangeEvent; - new(): IDBVersionChangeEvent; -} - -interface IDBIndex { - unique: boolean; - name: string; - keyPath: string; - objectStore: IDBObjectStore; - count(key?: any): IDBRequest; - getKey(key: any): IDBRequest; - openKeyCursor(range?: IDBKeyRange, direction?: string): IDBRequest; - get(key: any): IDBRequest; - openCursor(range?: IDBKeyRange, direction?: string): IDBRequest; -} -declare var IDBIndex: { - prototype: IDBIndex; - new(): IDBIndex; -} - -interface FileList { - length: number; - item(index: number): File; - [index: number]: File; -} -declare var FileList: { - prototype: FileList; - new(): FileList; -} - -interface IDBCursor { - source: any; - direction: string; - key: any; - primaryKey: any; - advance(count: number): void; - delete(): IDBRequest; - continue(key?: any): void; - update(value: any): IDBRequest; - PREV: string; - PREV_NO_DUPLICATE: string; - NEXT: string; - NEXT_NO_DUPLICATE: string; -} -declare var IDBCursor: { - prototype: IDBCursor; - new(): IDBCursor; - PREV: string; - PREV_NO_DUPLICATE: string; - NEXT: string; - NEXT_NO_DUPLICATE: string; -} - -interface File extends Blob { - lastModifiedDate: any; - name: string; -} -declare var File: { - prototype: File; - new(): File; -} - -interface IDBCursorWithValue extends IDBCursor { - value: any; -} -declare var IDBCursorWithValue: { - prototype: IDBCursorWithValue; - new(): IDBCursorWithValue; -} - -interface XMLHttpRequestEventTarget extends EventTarget { - onprogress: (ev: ProgressEvent) => any; - onerror: (ev: ErrorEvent) => any; - onload: (ev: Event) => any; - ontimeout: (ev: Event) => any; - onabort: (ev: any) => any; - onloadstart: (ev: Event) => any; - onloadend: (ev: ProgressEvent) => any; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var XMLHttpRequestEventTarget: { - prototype: XMLHttpRequestEventTarget; - new(): XMLHttpRequestEventTarget; -} - -interface MSBaseReader extends EventTarget { - onprogress: (ev: ProgressEvent) => any; - readyState: number; - onabort: (ev: any) => any; - onloadend: (ev: ProgressEvent) => any; - onerror: (ev: ErrorEvent) => any; - onload: (ev: Event) => any; - onloadstart: (ev: Event) => any; - result: any; - abort(): void; - LOADING: number; - EMPTY: number; - DONE: number; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface IDBKeyRange { - upper: any; - upperOpen: boolean; - lower: any; - lowerOpen: boolean; -} -declare var IDBKeyRange: { - prototype: IDBKeyRange; - new(): IDBKeyRange; - bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; - only(value: any): IDBKeyRange; - lowerBound(bound: any, open?: boolean): IDBKeyRange; - upperBound(bound: any, open?: boolean): IDBKeyRange; -} - -interface WindowConsole { - console: Console; -} - -interface IDBTransaction extends EventTarget { - oncomplete: (ev: Event) => any; - db: IDBDatabase; - mode: string; - error: DOMError; - onerror: (ev: ErrorEvent) => any; - onabort: (ev: any) => any; - abort(): void; - objectStore(name: string): IDBObjectStore; - READ_ONLY: string; - VERSION_CHANGE: string; - READ_WRITE: string; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBTransaction: { - prototype: IDBTransaction; - new(): IDBTransaction; - READ_ONLY: string; - VERSION_CHANGE: string; - READ_WRITE: string; -} - -interface WindowBase64 { - btoa(rawString: string): string; - atob(encodedString: string): string; -} - -interface IDBDatabase extends EventTarget { - version: string; - name: string; - objectStoreNames: DOMStringList; - onerror: (ev: ErrorEvent) => any; - onabort: (ev: any) => any; - createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; - close(): void; - transaction(storeNames: any, mode?: string): IDBTransaction; - deleteObjectStore(name: string): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBDatabase: { - prototype: IDBDatabase; - new(): IDBDatabase; + TYPE_MISMATCH_ERR: number; + URL_MISMATCH_ERR: number; + VALIDATION_ERR: number; + WRONG_DOCUMENT_ERR: number; } interface DOMStringList { @@ -550,68 +142,657 @@ interface DOMStringList { item(index: number): string; [index: number]: string; } + declare var DOMStringList: { prototype: DOMStringList; new(): DOMStringList; } -interface IDBOpenDBRequest extends IDBRequest { - onupgradeneeded: (ev: IDBVersionChangeEvent) => any; - onblocked: (ev: Event) => any; - addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "upgradeneeded", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blocked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +interface ErrorEvent extends Event { + colno: number; + error: any; + filename: string; + lineno: number; + message: string; + initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; } + +declare var ErrorEvent: { + prototype: ErrorEvent; + new(): ErrorEvent; +} + +interface Event { + bubbles: boolean; + cancelBubble: boolean; + cancelable: boolean; + currentTarget: EventTarget; + defaultPrevented: boolean; + eventPhase: number; + isTrusted: boolean; + returnValue: boolean; + srcElement: any; + target: EventTarget; + timeStamp: number; + type: string; + initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; + preventDefault(): void; + stopImmediatePropagation(): void; + stopPropagation(): void; + AT_TARGET: number; + BUBBLING_PHASE: number; + CAPTURING_PHASE: number; +} + +declare var Event: { + prototype: Event; + new(type: string, eventInitDict?: EventInit): Event; + AT_TARGET: number; + BUBBLING_PHASE: number; + CAPTURING_PHASE: number; +} + +interface EventTarget { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + dispatchEvent(evt: Event): boolean; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var EventTarget: { + prototype: EventTarget; + new(): EventTarget; +} + +interface File extends Blob { + lastModifiedDate: any; + name: string; +} + +declare var File: { + prototype: File; + new(): File; +} + +interface FileList { + length: number; + item(index: number): File; + [index: number]: File; +} + +declare var FileList: { + prototype: FileList; + new(): FileList; +} + +interface FileReader extends EventTarget, MSBaseReader { + error: DOMError; + readAsArrayBuffer(blob: Blob): void; + readAsBinaryString(blob: Blob): void; + readAsDataURL(blob: Blob): void; + readAsText(blob: Blob, encoding?: string): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var FileReader: { + prototype: FileReader; + new(): FileReader; +} + +interface IDBCursor { + direction: string; + key: any; + primaryKey: any; + source: any; + advance(count: number): void; + continue(key?: any): void; + delete(): IDBRequest; + update(value: any): IDBRequest; + NEXT: string; + NEXT_NO_DUPLICATE: string; + PREV: string; + PREV_NO_DUPLICATE: string; +} + +declare var IDBCursor: { + prototype: IDBCursor; + new(): IDBCursor; + NEXT: string; + NEXT_NO_DUPLICATE: string; + PREV: string; + PREV_NO_DUPLICATE: string; +} + +interface IDBCursorWithValue extends IDBCursor { + value: any; +} + +declare var IDBCursorWithValue: { + prototype: IDBCursorWithValue; + new(): IDBCursorWithValue; +} + +interface IDBDatabase extends EventTarget { + name: string; + objectStoreNames: DOMStringList; + onabort: (ev: Event) => any; + onerror: (ev: Event) => any; + version: string; + close(): void; + createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; + deleteObjectStore(name: string): void; + transaction(storeNames: any, mode?: string): IDBTransaction; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBDatabase: { + prototype: IDBDatabase; + new(): IDBDatabase; +} + +interface IDBFactory { + cmp(first: any, second: any): number; + deleteDatabase(name: string): IDBOpenDBRequest; + open(name: string, version?: number): IDBOpenDBRequest; +} + +declare var IDBFactory: { + prototype: IDBFactory; + new(): IDBFactory; +} + +interface IDBIndex { + keyPath: string; + name: string; + objectStore: IDBObjectStore; + unique: boolean; + count(key?: any): IDBRequest; + get(key: any): IDBRequest; + getKey(key: any): IDBRequest; + openCursor(range?: IDBKeyRange, direction?: string): IDBRequest; + openKeyCursor(range?: IDBKeyRange, direction?: string): IDBRequest; +} + +declare var IDBIndex: { + prototype: IDBIndex; + new(): IDBIndex; +} + +interface IDBKeyRange { + lower: any; + lowerOpen: boolean; + upper: any; + upperOpen: boolean; +} + +declare var IDBKeyRange: { + prototype: IDBKeyRange; + new(): IDBKeyRange; + bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; + lowerBound(bound: any, open?: boolean): IDBKeyRange; + only(value: any): IDBKeyRange; + upperBound(bound: any, open?: boolean): IDBKeyRange; +} + +interface IDBObjectStore { + indexNames: DOMStringList; + keyPath: string; + name: string; + transaction: IDBTransaction; + add(value: any, key?: any): IDBRequest; + clear(): IDBRequest; + count(key?: any): IDBRequest; + createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; + delete(key: any): IDBRequest; + deleteIndex(indexName: string): void; + get(key: any): IDBRequest; + index(name: string): IDBIndex; + openCursor(range?: any, direction?: string): IDBRequest; + put(value: any, key?: any): IDBRequest; +} + +declare var IDBObjectStore: { + prototype: IDBObjectStore; + new(): IDBObjectStore; +} + +interface IDBOpenDBRequest extends IDBRequest { + onblocked: (ev: Event) => any; + onupgradeneeded: (ev: IDBVersionChangeEvent) => any; + addEventListener(type: "blocked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "upgradeneeded", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + declare var IDBOpenDBRequest: { prototype: IDBOpenDBRequest; new(): IDBOpenDBRequest; } -interface MSUnsafeFunctionCallback { - (): any; -} - interface IDBRequest extends EventTarget { - source: any; - onsuccess: (ev: Event) => any; error: DOMError; - transaction: IDBTransaction; - onerror: (ev: ErrorEvent) => any; + onerror: (ev: Event) => any; + onsuccess: (ev: Event) => any; readyState: string; result: any; - addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; + source: any; + transaction: IDBTransaction; addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var IDBRequest: { prototype: IDBRequest; new(): IDBRequest; } +interface IDBTransaction extends EventTarget { + db: IDBDatabase; + error: DOMError; + mode: string; + onabort: (ev: Event) => any; + oncomplete: (ev: Event) => any; + onerror: (ev: Event) => any; + abort(): void; + objectStore(name: string): IDBObjectStore; + READ_ONLY: string; + READ_WRITE: string; + VERSION_CHANGE: string; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBTransaction: { + prototype: IDBTransaction; + new(): IDBTransaction; + READ_ONLY: string; + READ_WRITE: string; + VERSION_CHANGE: string; +} + +interface IDBVersionChangeEvent extends Event { + newVersion: number; + oldVersion: number; +} + +declare var IDBVersionChangeEvent: { + prototype: IDBVersionChangeEvent; + new(): IDBVersionChangeEvent; +} + +interface ImageData { + data: number[]; + height: number; + width: number; +} + +declare var ImageData: { + prototype: ImageData; + new(): ImageData; +} + +interface MSApp { + clearTemporaryWebDataAsync(): MSAppAsyncOperation; + createBlobFromRandomAccessStream(type: string, seeker: any): Blob; + createDataPackage(object: any): any; + createDataPackageFromSelection(): any; + createFileFromStorageFile(storageFile: any): File; + createStreamFromInputStream(type: string, inputStream: any): MSStream; + execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; + execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; + getCurrentPriority(): string; + getHtmlPrintDocumentSourceAsync(htmlDoc: any): any; + getViewId(view: any): any; + isTaskScheduledAtPriorityOrHigher(priority: string): boolean; + pageHandlesAllApplicationActivations(enabled: boolean): void; + suppressSubdownloadCredentialPrompts(suppress: boolean): void; + terminateApp(exceptionObject: any): void; + CURRENT: string; + HIGH: string; + IDLE: string; + NORMAL: string; +} +declare var MSApp: MSApp; + +interface MSBlobBuilder { + append(data: any, endings?: string): void; + getBlob(contentType?: string): Blob; +} + +declare var MSBlobBuilder: { + prototype: MSBlobBuilder; + new(): MSBlobBuilder; +} + +interface MSStream { + type: string; + msClose(): void; + msDetachStream(): any; +} + +declare var MSStream: { + prototype: MSStream; + new(): MSStream; +} + +interface MSStreamReader extends EventTarget, MSBaseReader { + error: DOMError; + readAsArrayBuffer(stream: MSStream, size?: number): void; + readAsBinaryString(stream: MSStream, size?: number): void; + readAsBlob(stream: MSStream, size?: number): void; + readAsDataURL(stream: MSStream, size?: number): void; + readAsText(stream: MSStream, encoding?: string, size?: number): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSStreamReader: { + prototype: MSStreamReader; + new(): MSStreamReader; +} + +interface MessageChannel { + port1: MessagePort; + port2: MessagePort; +} + +declare var MessageChannel: { + prototype: MessageChannel; + new(): MessageChannel; +} + +interface MessageEvent extends Event { + data: any; + origin: string; + ports: any; + source: any; + initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: any): void; +} + +declare var MessageEvent: { + prototype: MessageEvent; + new(): MessageEvent; +} + interface MessagePort extends EventTarget { onmessage: (ev: MessageEvent) => any; close(): void; postMessage(message?: any, ports?: any): void; start(): void; addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } + declare var MessagePort: { prototype: MessagePort; new(): MessagePort; } -interface FileReader extends MSBaseReader { - error: DOMError; - readAsArrayBuffer(blob: Blob): void; - readAsDataURL(blob: Blob): void; - readAsText(blob: Blob, encoding?: string): void; +interface ProgressEvent extends Event { + lengthComputable: boolean; + loaded: number; + total: number; + initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; } -declare var FileReader: { - prototype: FileReader; - new(): FileReader; + +declare var ProgressEvent: { + prototype: ProgressEvent; + new(): ProgressEvent; +} + +interface WebSocket extends EventTarget { + binaryType: string; + bufferedAmount: number; + extensions: string; + onclose: (ev: CloseEvent) => any; + onerror: (ev: Event) => any; + onmessage: (ev: MessageEvent) => any; + onopen: (ev: Event) => any; + protocol: string; + readyState: number; + url: string; + close(code?: number, reason?: string): void; + send(data: any): void; + CLOSED: number; + CLOSING: number; + CONNECTING: number; + OPEN: number; + addEventListener(type: "close", listener: (ev: CloseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "open", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var WebSocket: { + prototype: WebSocket; + new(url: string, protocols?: string): WebSocket; + new(url: string, protocols?: any): WebSocket; + CLOSED: number; + CLOSING: number; + CONNECTING: number; + OPEN: number; +} + +interface Worker extends EventTarget, AbstractWorker { + onmessage: (ev: MessageEvent) => any; + postMessage(message: any, ports?: any): void; + terminate(): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Worker: { + prototype: Worker; + new(stringUrl: string): Worker; +} + +interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget { + msCaching: string; + onreadystatechange: (ev: ProgressEvent) => any; + readyState: number; + response: any; + responseBody: any; + responseText: string; + responseType: string; + responseXML: any; + status: number; + statusText: string; + timeout: number; + upload: XMLHttpRequestUpload; + withCredentials: boolean; + abort(): void; + getAllResponseHeaders(): string; + getResponseHeader(header: string): string; + msCachingEnabled(): boolean; + open(method: string, url: string, async?: boolean, user?: string, password?: string): void; + overrideMimeType(mime: string): void; + send(data?: string): void; + send(data?: any): void; + setRequestHeader(header: string, value: string): void; + DONE: number; + HEADERS_RECEIVED: number; + LOADING: number; + OPENED: number; + UNSENT: number; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeout", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var XMLHttpRequest: { + prototype: XMLHttpRequest; + new(): XMLHttpRequest; + DONE: number; + HEADERS_RECEIVED: number; + LOADING: number; + OPENED: number; + UNSENT: number; + create(): XMLHttpRequest; +} + +interface AbstractWorker { + onerror: (ev: Event) => any; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface MSBaseReader { + onabort: (ev: Event) => any; + onerror: (ev: Event) => any; + onload: (ev: Event) => any; + onloadend: (ev: ProgressEvent) => any; + onloadstart: (ev: Event) => any; + onprogress: (ev: ProgressEvent) => any; + readyState: number; + result: any; + abort(): void; + DONE: number; + EMPTY: number; + LOADING: number; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface NavigatorID { + appName: string; + appVersion: string; + platform: string; + product: string; + productSub: string; + userAgent: string; + vendor: string; + vendorSub: string; +} + +interface NavigatorOnLine { + onLine: boolean; +} + +interface WindowBase64 { + atob(encodedString: string): string; + btoa(rawString: string): string; +} + +interface WindowConsole { + console: Console; +} + +interface XMLHttpRequestEventTarget { + onabort: (ev: Event) => any; + onerror: (ev: Event) => any; + onload: (ev: Event) => any; + onloadend: (ev: ProgressEvent) => any; + onloadstart: (ev: Event) => any; + onprogress: (ev: ProgressEvent) => any; + ontimeout: (ev: ProgressEvent) => any; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeout", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface FileReaderSync { + readAsArrayBuffer(blob: Blob): any; + readAsBinaryString(blob: Blob): void; + readAsDataURL(blob: Blob): string; + readAsText(blob: Blob, encoding?: string): string; +} + +declare var FileReaderSync: { + prototype: FileReaderSync; + new(): FileReaderSync; +} + +interface WorkerGlobalScope extends EventTarget, WorkerUtils, DedicatedWorkerGlobalScope, WindowConsole { + location: WorkerLocation; + onerror: (ev: Event) => any; + self: WorkerGlobalScope; + close(): void; + msWriteProfilerMark(profilerMarkName: string): void; + toString(): string; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var WorkerGlobalScope: { + prototype: WorkerGlobalScope; + new(): WorkerGlobalScope; +} + +interface WorkerLocation { + hash: string; + host: string; + hostname: string; + href: string; + pathname: string; + port: string; + protocol: string; + search: string; + toString(): string; +} + +declare var WorkerLocation: { + prototype: WorkerLocation; + new(): WorkerLocation; +} + +interface WorkerNavigator extends Object, NavigatorID, NavigatorOnLine { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var WorkerNavigator: { + prototype: WorkerNavigator; + new(): WorkerNavigator; +} + +interface DedicatedWorkerGlobalScope { + onmessage: (ev: MessageEvent) => any; + postMessage(data: any): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface WorkerUtils extends Object, WindowBase64 { + indexedDB: IDBFactory; + msIndexedDB: IDBFactory; + navigator: WorkerNavigator; + clearImmediate(handle: number): void; + clearInterval(handle: number): void; + clearTimeout(handle: number): void; + importScripts(...urls: string[]): void; + setImmediate(handler: any, ...args: any[]): number; + setInterval(handler: any, timeout?: any, ...args: any[]): number; + setTimeout(handler: any, timeout?: any, ...args: any[]): number; +} + + +interface NodeListOf extends NodeList { + length: number; + item(index: number): TNode; + [index: number]: TNode; } interface BlobPropertyBag { @@ -619,190 +800,67 @@ interface BlobPropertyBag { endings?: string; } -interface Blob { - type: string; - size: number; - msDetachStream(): any; - slice(start?: number, end?: number, contentType?: string): Blob; - msClose(): void; -} -declare var Blob: { - prototype: Blob; - new (blobParts?: any[], options?: BlobPropertyBag): Blob; +interface EventListenerObject { + handleEvent(evt: Event): void; } -interface MSStream { - type: string; - msDetachStream(): any; - msClose(): void; -} -declare var MSStream: { - prototype: MSStream; - new(): MSStream; -} +declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; -interface MSBlobBuilder { - append(data: any, endings?: string): void; - getBlob(contentType?: string): Blob; +interface ErrorEventHandler { + (event: Event, source?: string, fileno?: number, columnNumber?: number): void; + (event: string, source?: string, fileno?: number, columnNumber?: number): void; } -declare var MSBlobBuilder: { - prototype: MSBlobBuilder; - new(): MSBlobBuilder; +interface PositionCallback { + (position: Position): void; } - -interface IDBFactory { - open(name: string, version?: number): IDBOpenDBRequest; - cmp(first: any, second: any): number; - deleteDatabase(name: string): IDBOpenDBRequest; +interface PositionErrorCallback { + (error: PositionError): void; } -declare var IDBFactory: { - prototype: IDBFactory; - new(): IDBFactory; +interface MediaQueryListListener { + (mql: MediaQueryList): void; } - -interface AbstractWorker extends EventTarget { - onerror: (ev: ErrorEvent) => any; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +interface MSLaunchUriCallback { + (): void; } - -interface MSApp { - createFileFromStorageFile(storageFile: any): File; - createBlobFromRandomAccessStream(type: string, seeker: any): Blob; - createStreamFromInputStream(type: string, inputStream: any): MSStream; - terminateApp(exceptionObject: any): void; - createDataPackage(object: any): any; - execUnsafeLocalFunction(unsafeFunction: MSUnsafeFunctionCallback): any; - getHtmlPrintDocumentSource(htmlDoc: any): any; - addPublicLocalApplicationUri(uri: string): void; - createDataPackageFromSelection(): any; - getViewOpener(): MSAppView; - suppressSubdownloadCredentialPrompts(suppress: boolean): void; - execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; - isTaskScheduledAtPriorityOrHigher(priority: string): boolean; - execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; - createNewView(uri: string): MSAppView; - getCurrentPriority(): string; - NORMAL: string; - HIGH: string; - IDLE: string; - CURRENT: string; +interface FrameRequestCallback { + (time: number): void; } -declare var MSApp: MSApp; - -interface Worker extends AbstractWorker { - onmessage: (ev: MessageEvent) => any; - postMessage(message: any, ports?: any): void; - terminate(): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +interface MutationCallback { + (mutations: MutationRecord[], observer: MutationObserver): void; } -declare var Worker: { - prototype: Worker; - new(stringUrl: string): Worker; +interface DecodeSuccessCallback { + (decodedData: AudioBuffer): void; } - -interface MSExecAtPriorityFunctionCallback { - (...args: any[]): any; +interface DecodeErrorCallback { + (): void; } - -interface MSAppView { - viewId: number; - close(): void; - postMessage(message: any, targetOrigin: string, ports?: any): void; +interface FunctionStringCallback { + (data: string): void; } -declare var MSAppView: { - prototype: MSAppView; - new(): MSAppView; -} - -interface WorkerLocation { - hash: string; - protocol: string; - search: string; - href: string; - hostname: string; - port: string; - pathname: string; - host: string; - toString(): string; -} -declare var WorkerLocation: { - prototype: WorkerLocation; - new(): WorkerLocation; -} - -interface FileReaderSync { - readAsArrayBuffer(blob: Blob): any; - readAsDataURL(blob: Blob): string; - readAsText(blob: Blob, encoding?: string): string; -} -declare var FileReaderSync: { - prototype: FileReaderSync; - new(): FileReaderSync; -} - -interface WorkerGlobalScope extends EventTarget, DedicatedWorkerGlobalScope, WindowConsole, WorkerUtils { - location: WorkerLocation; - self: WorkerGlobalScope; - onerror: (ev: ErrorEvent) => any; - msWriteProfilerMark(profilerMarkName: string): void; - close(): void; - toString(): string; -} -declare var WorkerGlobalScope: { - prototype: WorkerGlobalScope; - new(): WorkerGlobalScope; -} - -interface DedicatedWorkerGlobalScope { - onmessage: (ev: MessageEvent) => any; - postMessage(data: any): void; -} - -interface WorkerNavigator extends NavigatorID, NavigatorOnLine { -} -declare var WorkerNavigator: { - prototype: WorkerNavigator; - new(): WorkerNavigator; -} - -interface WorkerUtils extends WindowBase64 { - navigator: WorkerNavigator; - msIndexedDB: IDBFactory; - indexedDB: IDBFactory; - clearImmediate(handle: number): void; - importScripts(...urls: string[]): void; - clearTimeout(handle: number): void; - setImmediate(handler: any, ...args: any[]): number; - setTimeout(handler: any, timeout?: any, ...args: any[]): number; - clearInterval(handle: number): void; - setInterval(handler: any, timeout?: any, ...args: any[]): number; -} - - declare var location: WorkerLocation; +declare var onerror: (ev: Event) => any; declare var self: WorkerGlobalScope; -declare var onerror: (ev: ErrorEvent) => any; -declare function msWriteProfilerMark(profilerMarkName: string): void; declare function close(): void; +declare function msWriteProfilerMark(profilerMarkName: string): void; declare function toString(): string; -declare function removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -declare function addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; +declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; declare function dispatchEvent(evt: Event): boolean; +declare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +declare var indexedDB: IDBFactory; +declare var msIndexedDB: IDBFactory; +declare var navigator: WorkerNavigator; +declare function clearImmediate(handle: number): void; +declare function clearInterval(handle: number): void; +declare function clearTimeout(handle: number): void; +declare function importScripts(...urls: string[]): void; +declare function setImmediate(handler: any, ...args: any[]): number; +declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; +declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; +declare function atob(encodedString: string): string; +declare function btoa(rawString: string): string; declare var onmessage: (ev: MessageEvent) => any; declare function postMessage(data: any): void; declare var console: Console; -declare var navigator: WorkerNavigator; -declare var msIndexedDB: IDBFactory; -declare var indexedDB: IDBFactory; -declare function clearImmediate(handle: number): void; -declare function importScripts(...urls: string[]): void; -declare function clearTimeout(handle: number): void; -declare function setImmediate(handler: any, ...args: any[]): number; -declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; -declare function clearInterval(handle: number): void; -declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; -declare function btoa(rawString: string): string; -declare function atob(encodedString: string): string; +declare function addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; \ No newline at end of file diff --git a/src/server/client.ts b/src/server/client.ts index 3306bd5a9d4..9d71f627005 100644 --- a/src/server/client.ts +++ b/src/server/client.ts @@ -488,6 +488,10 @@ module ts.server { }); } + getDocumentHighlights(fileName: string, position: number): DocumentHighlights[] { + throw new Error("Not Implemented Yet."); + } + getOutliningSpans(fileName: string): OutliningSpan[] { throw new Error("Not Implemented Yet."); } diff --git a/src/server/session.ts b/src/server/session.ts index 09373d6bf96..faedce0e1af 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -118,7 +118,7 @@ module ts.server { constructor(private host: ServerHost, private logger: Logger) { this.projectService = - new ProjectService(host, logger, (eventName, project, fileName) => { + new ProjectService(host, logger, (eventName,project,fileName) => { this.handleEvent(eventName, project, fileName); }); } @@ -263,7 +263,7 @@ module ts.server { } } - getDefinition({ line, offset, file: fileName }: protocol.FileLocationRequestArgs): protocol.FileSpan[] { + getDefinition(line: number, offset: number, fileName: string): protocol.FileSpan[] { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -285,7 +285,7 @@ module ts.server { })); } - getOccurrences({ line, offset, file: fileName }: protocol.FileLocationRequestArgs): protocol.OccurrencesResponseItem[] { + getOccurrences(line: number, offset: number, fileName: string): protocol.OccurrencesResponseItem[] { fileName = ts.normalizePath(fileName); let project = this.projectService.getProjectForFile(fileName); @@ -315,7 +315,7 @@ module ts.server { }); } - getRenameLocations({line, offset, file: fileName, findInComments, findInStrings }: protocol.RenameRequestArgs): protocol.RenameResponseBody { + getRenameLocations(line: number, offset: number, fileName: string,findInComments: boolean, findInStrings: boolean): protocol.RenameResponseBody { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -383,7 +383,7 @@ module ts.server { return { info: renameInfo, locs: bakedRenameLocs }; } - getReferences({ line, offset, file: fileName }: protocol.FileLocationRequestArgs): protocol.ReferencesResponseBody { + getReferences(line: number, offset: number, fileName: string): protocol.ReferencesResponseBody { // TODO: get all projects for this file; report refs for all projects deleting duplicates // can avoid duplicates by eliminating same ref file from subsequent projects var file = ts.normalizePath(fileName); @@ -430,12 +430,12 @@ module ts.server { }; } - openClientFile({ file: fileName }: protocol.OpenRequestArgs) { + openClientFile(fileName: string) { var file = ts.normalizePath(fileName); this.projectService.openClientFile(file); } - getQuickInfo({ line, offset, file: fileName }: protocol.FileLocationRequestArgs): protocol.QuickInfoResponseBody { + getQuickInfo(line: number, offset: number, fileName: string): protocol.QuickInfoResponseBody { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -461,7 +461,7 @@ module ts.server { }; } - getFormattingEditsForRange({line, offset, endLine, endOffset, file: fileName}: protocol.FormatRequestArgs): protocol.CodeEdit[] { + getFormattingEditsForRange(line: number, offset: number, endLine: number, endOffset: number, fileName: string): protocol.CodeEdit[] { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -488,7 +488,7 @@ module ts.server { }); } - getFormattingEditsAfterKeystroke({line, offset, key, file: fileName}: protocol.FormatOnKeyRequestArgs): protocol.CodeEdit[] { + getFormattingEditsAfterKeystroke(line: number, offset: number, key: string, fileName: string): protocol.CodeEdit[] { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); @@ -561,7 +561,7 @@ module ts.server { }); } - getCompletions({ line, offset, prefix, file: fileName}: protocol.CompletionsRequestArgs): protocol.CompletionEntry[] { + getCompletions(line: number, offset: number, prefix: string, fileName: string): protocol.CompletionEntry[] { if (!prefix) { prefix = ""; } @@ -587,7 +587,8 @@ module ts.server { }, []).sort((a, b) => a.name.localeCompare(b.name)); } - getCompletionEntryDetails({ line, offset, entryNames, file: fileName}: protocol.CompletionDetailsRequestArgs): protocol.CompletionEntryDetails[] { + getCompletionEntryDetails(line: number, offset: number, + entryNames: string[], fileName: string): protocol.CompletionEntryDetails[] { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -606,20 +607,20 @@ module ts.server { }, []); } - getSignatureHelpItems({ line, offset, file: fileName }: protocol.SignatureHelpRequestArgs): protocol.SignatureHelpItems { + getSignatureHelpItems(line: number, offset: number, fileName: string): protocol.SignatureHelpItems { 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: protocol.SignatureHelpItems = { items: helpItems.items, @@ -631,11 +632,11 @@ module ts.server { argumentIndex: helpItems.argumentIndex, argumentCount: helpItems.argumentCount, } - + return result; } - - getDiagnostics({ delay, files: fileNames }: protocol.GeterrRequestArgs): void { + + getDiagnostics(delay: number, fileNames: string[]) { var checkList = fileNames.reduce((accum: PendingErrorCheck[], fileName: string) => { fileName = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(fileName); @@ -646,11 +647,11 @@ module ts.server { }, []); if (checkList.length > 0) { - this.updateErrorCheck(checkList, this.changeSeq, (n) => n == this.changeSeq, delay) + this.updateErrorCheck(checkList, this.changeSeq,(n) => n == this.changeSeq, delay) } } - change({ line, offset, endLine, endOffset, insertString, file: fileName }: protocol.ChangeRequestArgs): void { + change(line: number, offset: number, endLine: number, endOffset: number, insertString: string, fileName: string) { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (project) { @@ -665,7 +666,7 @@ module ts.server { } } - reload({ file: fileName, tmpfile: tempFileName }: protocol.ReloadRequestArgs, reqSeq = 0): void { + reload(fileName: string, tempFileName: string, reqSeq = 0) { var file = ts.normalizePath(fileName); var tmpfile = ts.normalizePath(tempFileName); var project = this.projectService.getProjectForFile(file); @@ -678,7 +679,7 @@ module ts.server { } } - saveToTmp({ file: fileName, tmpfile: tempFileName }: protocol.SavetoRequestArgs): void { + saveToTmp(fileName: string, tempFileName: string) { var file = ts.normalizePath(fileName); var tmpfile = ts.normalizePath(tempFileName); @@ -688,7 +689,7 @@ module ts.server { } } - closeClientFile({ file: fileName }: protocol.FileRequestArgs) { + closeClientFile(fileName: string) { var file = ts.normalizePath(fileName); this.projectService.closeClientFile(file); } @@ -712,7 +713,7 @@ module ts.server { })); } - getNavigationBarItems({ file: fileName }: protocol.FileRequestArgs): protocol.NavigationBarItem[]{ + getNavigationBarItems(fileName: string): protocol.NavigationBarItem[] { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -728,7 +729,7 @@ module ts.server { return this.decorateNavigationBarItem(project, fileName, items); } - getNavigateToItems({ searchValue, file: fileName, maxResultCount }: protocol.NavtoRequestArgs): protocol.NavtoItem[]{ + getNavigateToItems(searchValue: string, fileName: string, maxResultCount?: number): protocol.NavtoItem[] { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -767,7 +768,7 @@ module ts.server { }); } - getBraceMatching({ line, offset, file: fileName }: protocol.FileLocationRequestArgs): protocol.TextSpan[]{ + getBraceMatching(line: number, offset: number, fileName: string): protocol.TextSpan[] { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); @@ -809,91 +810,114 @@ module ts.server { break; } case CommandNames.Definition: { - response = this.getDefinition(request.arguments); + var defArgs = request.arguments; + response = this.getDefinition(defArgs.line, defArgs.offset, defArgs.file); break; } case CommandNames.References: { - response = this.getReferences(request.arguments); + var refArgs = request.arguments; + response = this.getReferences(refArgs.line, refArgs.offset, refArgs.file); break; } case CommandNames.Rename: { - response = this.getRenameLocations(request.arguments); + var renameArgs = request.arguments; + response = this.getRenameLocations(renameArgs.line, renameArgs.offset, renameArgs.file, renameArgs.findInComments, renameArgs.findInStrings); break; } case CommandNames.Open: { - this.openClientFile(request.arguments); + var openArgs = request.arguments; + this.openClientFile(openArgs.file); responseRequired = false; break; } case CommandNames.Quickinfo: { - response = this.getQuickInfo(request.arguments); + var quickinfoArgs = request.arguments; + response = this.getQuickInfo(quickinfoArgs.line, quickinfoArgs.offset, quickinfoArgs.file); break; } case CommandNames.Format: { - response = this.getFormattingEditsForRange(request.arguments); + var formatArgs = request.arguments; + response = this.getFormattingEditsForRange(formatArgs.line, formatArgs.offset, formatArgs.endLine, formatArgs.endOffset, formatArgs.file); break; } case CommandNames.Formatonkey: { - response = this.getFormattingEditsAfterKeystroke(request.arguments); + var formatOnKeyArgs = request.arguments; + response = this.getFormattingEditsAfterKeystroke(formatOnKeyArgs.line, formatOnKeyArgs.offset, formatOnKeyArgs.key, formatOnKeyArgs.file); break; } case CommandNames.Completions: { - response = this.getCompletions(request.arguments); + var completionsArgs = request.arguments; + response = this.getCompletions(completionsArgs.line, completionsArgs.offset, completionsArgs.prefix, completionsArgs.file); break; } case CommandNames.CompletionDetails: { - response = this.getCompletionEntryDetails(request.arguments); + var completionDetailsArgs = request.arguments; + response = + this.getCompletionEntryDetails(completionDetailsArgs.line,completionDetailsArgs.offset, + completionDetailsArgs.entryNames,completionDetailsArgs.file); break; } case CommandNames.SignatureHelp: { - response = this.getSignatureHelpItems(request.arguments); + var signatureHelpArgs = request.arguments; + response = this.getSignatureHelpItems(signatureHelpArgs.line, signatureHelpArgs.offset, signatureHelpArgs.file); break; } case CommandNames.Geterr: { - this.getDiagnostics(request.arguments); + var geterrArgs = request.arguments; + response = this.getDiagnostics(geterrArgs.delay, geterrArgs.files); responseRequired = false; break; } case CommandNames.Change: { - this.change(request.arguments); + var changeArgs = request.arguments; + this.change(changeArgs.line, changeArgs.offset, changeArgs.endLine, changeArgs.endOffset, + changeArgs.insertString, changeArgs.file); responseRequired = false; break; } case CommandNames.Configure: { - this.projectService.setHostConfiguration(request.arguments); + var configureArgs = request.arguments; + this.projectService.setHostConfiguration(configureArgs); this.output(undefined, CommandNames.Configure, request.seq); responseRequired = false; break; } case CommandNames.Reload: { - this.reload(request.arguments); + var reloadArgs = request.arguments; + this.reload(reloadArgs.file, reloadArgs.tmpfile, request.seq); responseRequired = false; break; } case CommandNames.Saveto: { - this.saveToTmp(request.arguments); + var savetoArgs = request.arguments; + this.saveToTmp(savetoArgs.file, savetoArgs.tmpfile); responseRequired = false; break; } case CommandNames.Close: { - this.closeClientFile(request.arguments); + var closeArgs = request.arguments; + this.closeClientFile(closeArgs.file); responseRequired = false; break; } case CommandNames.Navto: { - response = this.getNavigateToItems(request.arguments); + var navtoArgs = request.arguments; + response = this.getNavigateToItems(navtoArgs.searchValue, navtoArgs.file, navtoArgs.maxResultCount); break; } case CommandNames.Brace: { - response = this.getBraceMatching(request.arguments); + var braceArguments = request.arguments; + response = this.getBraceMatching(braceArguments.line, braceArguments.offset, braceArguments.file); break; } case CommandNames.NavBar: { - response = this.getNavigationBarItems(request.arguments); + var navBarArgs = request.arguments; + response = this.getNavigationBarItems(navBarArgs.file); break; } case CommandNames.Occurrences: { - response = this.getOccurrences(request.arguments); + var { line, offset, file: fileName } = request.arguments; + response = this.getOccurrences(line, offset, fileName); break; } default: { diff --git a/src/services/breakpoints.ts b/src/services/breakpoints.ts index 395141cc4cc..caed0582c33 100644 --- a/src/services/breakpoints.ts +++ b/src/services/breakpoints.ts @@ -3,6 +3,7 @@ /// +/* @internal */ module ts.BreakpointResolver { /** * Get the breakpoint span in given sourceFile @@ -173,10 +174,6 @@ module ts.BreakpointResolver { return textSpan(node, (node).expression); case SyntaxKind.ExportAssignment: - if (!(node).expression) { - return undefined; - } - // span on export = id return textSpan(node, (node).expression); diff --git a/src/services/formatting/formatting.ts b/src/services/formatting/formatting.ts index 6a5ed25459e..751f1a94027 100644 --- a/src/services/formatting/formatting.ts +++ b/src/services/formatting/formatting.ts @@ -3,6 +3,7 @@ /// /// +/* @internal */ module ts.formatting { export interface TextRangeWithKind extends TextRange { @@ -328,8 +329,13 @@ module ts.formatting { if (formattingScanner.isOnToken()) { let startLine = sourceFile.getLineAndCharacterOfPosition(enclosingNode.getStart(sourceFile)).line; + let undecoratedStartLine = startLine; + if (enclosingNode.decorators) { + undecoratedStartLine = sourceFile.getLineAndCharacterOfPosition(getNonDecoratorTokenPosOfNode(enclosingNode, sourceFile)).line; + } + let delta = getOwnOrInheritedDelta(enclosingNode, options, sourceFile); - processNode(enclosingNode, enclosingNode, startLine, initialIndentation, delta); + processNode(enclosingNode, enclosingNode, startLine, undecoratedStartLine, initialIndentation, delta); } formattingScanner.close(); @@ -500,7 +506,7 @@ module ts.formatting { } } - function processNode(node: Node, contextNode: Node, nodeStartLine: number, indentation: number, delta: number) { + function processNode(node: Node, contextNode: Node, nodeStartLine: number, undecoratedNodeStartLine: number, indentation: number, delta: number) { if (!rangeOverlapsWithStartEnd(originalRange, node.getStart(sourceFile), node.getEnd())) { return; } @@ -526,7 +532,7 @@ module ts.formatting { forEachChild( node, child => { - processChildNode(child, /*inheritedIndentation*/ Constants.Unknown, node, nodeDynamicIndentation, nodeStartLine, /*isListElement*/ false) + processChildNode(child, /*inheritedIndentation*/ Constants.Unknown, node, nodeDynamicIndentation, nodeStartLine, undecoratedNodeStartLine, /*isListElement*/ false) }, (nodes: NodeArray) => { processChildNodes(nodes, node, nodeStartLine, nodeDynamicIndentation); @@ -547,11 +553,17 @@ module ts.formatting { parent: Node, parentDynamicIndentation: DynamicIndentation, parentStartLine: number, + undecoratedParentStartLine: number, isListItem: boolean): number { let childStartPos = child.getStart(sourceFile); - let childStart = sourceFile.getLineAndCharacterOfPosition(childStartPos); + let childStartLine = sourceFile.getLineAndCharacterOfPosition(childStartPos).line; + + let undecoratedChildStartLine = childStartLine; + if (child.decorators) { + undecoratedChildStartLine = sourceFile.getLineAndCharacterOfPosition(getNonDecoratorTokenPosOfNode(child, sourceFile)).line; + } // if child is a list item - try to get its indentation let childIndentationAmount = Constants.Unknown; @@ -594,9 +606,10 @@ module ts.formatting { return inheritedIndentation; } - let childIndentation = computeIndentation(child, childStart.line, childIndentationAmount, node, parentDynamicIndentation, parentStartLine); + let effectiveParentStartLine = child.kind === SyntaxKind.Decorator ? childStartLine : undecoratedParentStartLine; + let childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); - processNode(child, childContextNode, childStart.line, childIndentation.indentation, childIndentation.delta); + processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); childContextNode = node; @@ -640,7 +653,7 @@ module ts.formatting { let inheritedIndentation = Constants.Unknown; for (let child of nodes) { - inheritedIndentation = processChildNode(child, inheritedIndentation, node, listDynamicIndentation, startLine, /*isListElement*/ true) + inheritedIndentation = processChildNode(child, inheritedIndentation, node, listDynamicIndentation, startLine, startLine, /*isListElement*/ true) } if (listEndToken !== SyntaxKind.Unknown) { diff --git a/src/services/formatting/formattingContext.ts b/src/services/formatting/formattingContext.ts index 8683a975777..84c09b86bb9 100644 --- a/src/services/formatting/formattingContext.ts +++ b/src/services/formatting/formattingContext.ts @@ -1,20 +1,6 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// 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. -// - /// +/* @internal */ module ts.formatting { export class FormattingContext { public currentTokenSpan: TextRangeWithKind; diff --git a/src/services/formatting/formattingRequestKind.ts b/src/services/formatting/formattingRequestKind.ts index a66169c1e7c..4bdc83ffd45 100644 --- a/src/services/formatting/formattingRequestKind.ts +++ b/src/services/formatting/formattingRequestKind.ts @@ -1,20 +1,6 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// 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. -// - /// +/* @internal */ module ts.formatting { export const enum FormattingRequestKind { FormatDocument, diff --git a/src/services/formatting/formattingScanner.ts b/src/services/formatting/formattingScanner.ts index f93739d6fb5..388d9428ffc 100644 --- a/src/services/formatting/formattingScanner.ts +++ b/src/services/formatting/formattingScanner.ts @@ -1,6 +1,7 @@ /// /// +/* @internal */ module ts.formatting { let scanner = createScanner(ScriptTarget.Latest, /*skipTrivia*/ false); diff --git a/src/services/formatting/references.ts b/src/services/formatting/references.ts index b421424a61b..318f10c664e 100644 --- a/src/services/formatting/references.ts +++ b/src/services/formatting/references.ts @@ -1,18 +1,3 @@ -// -// 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. -// - /// /// /// diff --git a/src/services/formatting/rule.ts b/src/services/formatting/rule.ts index 356720d2330..f1bb39e69c2 100644 --- a/src/services/formatting/rule.ts +++ b/src/services/formatting/rule.ts @@ -1,20 +1,6 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// 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. -// - /// +/* @internal */ module ts.formatting { export class Rule { constructor( diff --git a/src/services/formatting/ruleAction.ts b/src/services/formatting/ruleAction.ts index d2890d8e080..e5734b1a03c 100644 --- a/src/services/formatting/ruleAction.ts +++ b/src/services/formatting/ruleAction.ts @@ -1,20 +1,6 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// 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. -// - /// +/* @internal */ module ts.formatting { export const enum RuleAction { Ignore = 0x00000001, diff --git a/src/services/formatting/ruleDescriptor.ts b/src/services/formatting/ruleDescriptor.ts index 031f88be00e..f3492715f3a 100644 --- a/src/services/formatting/ruleDescriptor.ts +++ b/src/services/formatting/ruleDescriptor.ts @@ -1,20 +1,6 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// 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. -// - /// +/* @internal */ module ts.formatting { export class RuleDescriptor { constructor(public LeftTokenRange: Shared.TokenRange, public RightTokenRange: Shared.TokenRange) { diff --git a/src/services/formatting/ruleFlag.ts b/src/services/formatting/ruleFlag.ts index aaf70639e01..4e6e002c184 100644 --- a/src/services/formatting/ruleFlag.ts +++ b/src/services/formatting/ruleFlag.ts @@ -1,20 +1,7 @@ -// -// 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. -// - /// + +/* @internal */ module ts.formatting { export const enum RuleFlags { None, diff --git a/src/services/formatting/ruleOperation.ts b/src/services/formatting/ruleOperation.ts index 7bd092e9584..1cca437e491 100644 --- a/src/services/formatting/ruleOperation.ts +++ b/src/services/formatting/ruleOperation.ts @@ -1,20 +1,6 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// 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. -// - /// +/* @internal */ module ts.formatting { export class RuleOperation { public Context: RuleOperationContext; diff --git a/src/services/formatting/ruleOperationContext.ts b/src/services/formatting/ruleOperationContext.ts index dc4e5d4f105..69ed3453a75 100644 --- a/src/services/formatting/ruleOperationContext.ts +++ b/src/services/formatting/ruleOperationContext.ts @@ -1,20 +1,6 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// 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. -// - /// +/* @internal */ module ts.formatting { export class RuleOperationContext { diff --git a/src/services/formatting/rules.ts b/src/services/formatting/rules.ts index 7d3509ef495..73b586e3706 100644 --- a/src/services/formatting/rules.ts +++ b/src/services/formatting/rules.ts @@ -1,20 +1,6 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// 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. -// - /// +/* @internal */ module ts.formatting { export class Rules { public getRuleName(rule: Rule) { @@ -208,6 +194,11 @@ module ts.formatting { public SpaceAfterAnonymousFunctionKeyword: Rule; public NoSpaceAfterAnonymousFunctionKeyword: Rule; + // Insert space after @ in decorator + public SpaceBeforeAt: Rule; + public NoSpaceAfterAt: Rule; + public SpaceAfterDecorator: Rule; + constructor() { /// /// Common Rules @@ -344,6 +335,11 @@ module ts.formatting { // Remove spaces in empty interface literals. e.g.: x: {} this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new Rule(RuleDescriptor.create1(SyntaxKind.OpenBraceToken, SyntaxKind.CloseBraceToken), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectTypeContext), RuleAction.Delete)); + // decorators + this.SpaceBeforeAt = new Rule(RuleDescriptor.create2(Shared.TokenRange.Any, SyntaxKind.AtToken), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Space)); + this.NoSpaceAfterAt = new Rule(RuleDescriptor.create3(SyntaxKind.AtToken, Shared.TokenRange.Any), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Delete)); + this.SpaceAfterDecorator = new Rule(RuleDescriptor.create4(Shared.TokenRange.Any, Shared.TokenRange.FromTokens([SyntaxKind.Identifier, SyntaxKind.ExportKeyword, SyntaxKind.DefaultKeyword, SyntaxKind.ClassKeyword, SyntaxKind.StaticKeyword, SyntaxKind.PublicKeyword, SyntaxKind.PrivateKeyword, SyntaxKind.ProtectedKeyword, SyntaxKind.GetKeyword, SyntaxKind.SetKeyword, SyntaxKind.OpenBracketToken, SyntaxKind.AsteriskToken])), RuleOperation.create2(new RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), RuleAction.Space)); + // These rules are higher in priority than user-configurable rules. this.HighPriorityCommonRules = [ @@ -381,7 +377,10 @@ module ts.formatting { this.NoSpaceBetweenCloseParenAndAngularBracket, this.NoSpaceAfterOpenAngularBracket, this.NoSpaceBeforeCloseAngularBracket, - this.NoSpaceAfterCloseAngularBracket + this.NoSpaceAfterCloseAngularBracket, + this.SpaceBeforeAt, + this.NoSpaceAfterAt, + this.SpaceAfterDecorator, ]; // These rules are lower in priority than user-configurable rules. @@ -649,6 +648,20 @@ module ts.formatting { return context.TokensAreOnSameLine(); } + static IsEndOfDecoratorContextOnSameLine(context: FormattingContext): boolean { + return context.TokensAreOnSameLine() && + context.contextNode.decorators && + Rules.NodeIsInDecoratorContext(context.currentTokenParent) && + !Rules.NodeIsInDecoratorContext(context.nextTokenParent); + } + + static NodeIsInDecoratorContext(node: Node): boolean { + while (isExpression(node)) { + node = node.parent; + } + return node.kind === SyntaxKind.Decorator; + } + static IsStartOfVariableDeclarationList(context: FormattingContext): boolean { return context.currentTokenParent.kind === SyntaxKind.VariableDeclarationList && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; diff --git a/src/services/formatting/rulesMap.ts b/src/services/formatting/rulesMap.ts index b43e91424f8..5aae6f40fcd 100644 --- a/src/services/formatting/rulesMap.ts +++ b/src/services/formatting/rulesMap.ts @@ -1,20 +1,6 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// 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. -// - /// +/* @internal */ module ts.formatting { export class RulesMap { public map: RulesBucket[]; diff --git a/src/services/formatting/rulesProvider.ts b/src/services/formatting/rulesProvider.ts index 5f63db8630b..0867bcf31c0 100644 --- a/src/services/formatting/rulesProvider.ts +++ b/src/services/formatting/rulesProvider.ts @@ -1,20 +1,6 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// 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. -// - /// +/* @internal */ module ts.formatting { export class RulesProvider { private globalRules: Rules; diff --git a/src/services/formatting/smartIndenter.ts b/src/services/formatting/smartIndenter.ts index 8508e3b932d..9cd28a40a54 100644 --- a/src/services/formatting/smartIndenter.ts +++ b/src/services/formatting/smartIndenter.ts @@ -1,5 +1,6 @@ /// +/* @internal */ module ts.formatting { export module SmartIndenter { diff --git a/src/services/formatting/tokenRange.ts b/src/services/formatting/tokenRange.ts index f1cdfebc978..712d6f3792e 100644 --- a/src/services/formatting/tokenRange.ts +++ b/src/services/formatting/tokenRange.ts @@ -1,20 +1,6 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// 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. -// - /// +/* @internal */ module ts.formatting { export module Shared { export interface ITokenAccess { diff --git a/src/services/navigateTo.ts b/src/services/navigateTo.ts index 54f87d8e50b..aec3bdf765f 100644 --- a/src/services/navigateTo.ts +++ b/src/services/navigateTo.ts @@ -1,3 +1,4 @@ +/* @internal */ module ts.NavigateTo { type RawNavigateToItem = { name: string; fileName: string; matchKind: PatternMatchKind; isCaseSensitive: boolean; declaration: Declaration }; @@ -9,11 +10,10 @@ module ts.NavigateTo { forEach(program.getSourceFiles(), sourceFile => { cancellationToken.throwIfCancellationRequested(); - let declarations = sourceFile.getNamedDeclarations(); - for (let declaration of declarations) { - var name = getDeclarationName(declaration); - if (name !== undefined) { - + let nameToDeclarations = sourceFile.getNamedDeclarations(); + for (let name in nameToDeclarations) { + let declarations = getProperty(nameToDeclarations, name); + if (declarations) { // First do a quick check to see if the name of the declaration matches the // last portion of the (possibly) dotted name they're searching for. let matches = patternMatcher.getMatchesForLastSegmentOfPattern(name); @@ -22,24 +22,26 @@ module ts.NavigateTo { continue; } - // 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); - if (!containers) { - return undefined; + for (let declaration of declarations) { + // 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); + if (!containers) { + return undefined; + } + + matches = patternMatcher.getMatches(containers, name); + + if (!matches) { + continue; + } } - matches = patternMatcher.getMatches(containers, name); - - if (!matches) { - continue; - } + let fileName = sourceFile.fileName; + let matchKind = bestMatchKind(matches); + rawItems.push({ name, fileName, matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration }); } - - let fileName = sourceFile.fileName; - let matchKind = bestMatchKind(matches); - rawItems.push({ name, fileName, matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration }); } } }); @@ -66,30 +68,14 @@ module ts.NavigateTo { return true; } - function getDeclarationName(declaration: Declaration): string { - let result = getTextOfIdentifierOrLiteral(declaration.name); - if (result !== undefined) { - return result; - } - - if (declaration.name.kind === SyntaxKind.ComputedPropertyName) { - let expr = (declaration.name).expression; - if (expr.kind === SyntaxKind.PropertyAccessExpression) { - return (expr).name.text; - } - - return getTextOfIdentifierOrLiteral(expr); - } - - return undefined; - } - function getTextOfIdentifierOrLiteral(node: Node) { - if (node.kind === SyntaxKind.Identifier || - node.kind === SyntaxKind.StringLiteral || - node.kind === SyntaxKind.NumericLiteral) { + if (node) { + if (node.kind === SyntaxKind.Identifier || + node.kind === SyntaxKind.StringLiteral || + node.kind === SyntaxKind.NumericLiteral) { - return (node).text; + return (node).text; + } } return undefined; diff --git a/src/services/navigationBar.ts b/src/services/navigationBar.ts index e475827837c..8acdbac20c5 100644 --- a/src/services/navigationBar.ts +++ b/src/services/navigationBar.ts @@ -1,5 +1,6 @@ /// +/* @internal */ module ts.NavigationBar { export function getNavigationBarItems(sourceFile: SourceFile): ts.NavigationBarItem[] { // If the source file has any child items, then it included in the tree diff --git a/src/services/outliningElementsCollector.ts b/src/services/outliningElementsCollector.ts index 4c9dcedc7a4..d413f611209 100644 --- a/src/services/outliningElementsCollector.ts +++ b/src/services/outliningElementsCollector.ts @@ -1,18 +1,4 @@ -// -// 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. -// - +/* @internal */ module ts { export module OutliningElementsCollector { export function collectElements(sourceFile: SourceFile): OutliningSpan[] { @@ -31,6 +17,66 @@ module ts { } } + function addOutliningSpanComments(commentSpan: CommentRange, autoCollapse: boolean) { + if (commentSpan) { + let span: OutliningSpan = { + textSpan: createTextSpanFromBounds(commentSpan.pos, commentSpan.end), + hintSpan: createTextSpanFromBounds(commentSpan.pos, commentSpan.end), + bannerText: collapseText, + autoCollapse: autoCollapse + }; + elements.push(span); + } + } + + function addOutliningForLeadingCommentsForNode(n: Node) { + let comments = ts.getLeadingCommentRangesOfNode(n, sourceFile); + + if (comments) { + let firstSingleLineCommentStart = -1; + let lastSingleLineCommentEnd = -1; + let isFirstSingleLineComment = true; + let singleLineCommentCount = 0; + + for (let currentComment of comments) { + + // For single line comments, combine consecutive ones (2 or more) into + // a single span from the start of the first till the end of the last + if (currentComment.kind === SyntaxKind.SingleLineCommentTrivia) { + if (isFirstSingleLineComment) { + firstSingleLineCommentStart = currentComment.pos; + } + isFirstSingleLineComment = false; + lastSingleLineCommentEnd = currentComment.end; + singleLineCommentCount++; + } + else if (currentComment.kind === SyntaxKind.MultiLineCommentTrivia) { + combineAndAddMultipleSingleLineComments(singleLineCommentCount, firstSingleLineCommentStart, lastSingleLineCommentEnd); + addOutliningSpanComments(currentComment, /*autoCollapse*/ false); + + singleLineCommentCount = 0; + lastSingleLineCommentEnd = -1; + isFirstSingleLineComment = true; + } + } + + combineAndAddMultipleSingleLineComments(singleLineCommentCount, firstSingleLineCommentStart, lastSingleLineCommentEnd); + } + } + + function combineAndAddMultipleSingleLineComments(count: number, start: number, end: number) { + // Only outline spans of two or more consecutive single line comments + if (count > 1) { + let multipleSingleLineComments = { + pos: start, + end: end, + kind: SyntaxKind.SingleLineCommentTrivia + } + + addOutliningSpanComments(multipleSingleLineComments, /*autoCollapse*/ false); + } + } + function autoCollapse(node: Node) { return isFunctionBlock(node) && node.parent.kind !== SyntaxKind.ArrowFunction; } @@ -41,6 +87,11 @@ module ts { if (depth > maxDepth) { return; } + + if (isDeclaration(n)) { + addOutliningForLeadingCommentsForNode(n); + } + switch (n.kind) { case SyntaxKind.Block: if (!isFunctionBlock(n)) { @@ -93,7 +144,7 @@ module ts { }); break; } - // Fallthrough. + // Fallthrough. case SyntaxKind.ModuleBlock: { let openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile); diff --git a/src/services/patternMatcher.ts b/src/services/patternMatcher.ts index 646782b2cf0..88cd9fdbb0f 100644 --- a/src/services/patternMatcher.ts +++ b/src/services/patternMatcher.ts @@ -1,3 +1,4 @@ +/* @internal */ module ts { // Note(cyrusn): this enum is ordered from strongest match type to weakest match type. export enum PatternMatchKind { diff --git a/src/services/services.ts b/src/services/services.ts index 86c323f24bf..98a7fe0499f 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -63,7 +63,8 @@ module ts { /* @internal */ scriptSnapshot: IScriptSnapshot; /* @internal */ nameTable: Map; - getNamedDeclarations(): Declaration[]; + /* @internal */ getNamedDeclarations(): Map; + getLineAndCharacterOfPosition(pos: number): LineAndCharacter; getLineStarts(): number[]; getPositionOfLineAndCharacter(line: number, character: number): number; @@ -749,7 +750,7 @@ module ts { public identifiers: Map; public nameTable: Map; - private namedDeclarations: Declaration[]; + private namedDeclarations: Map; public update(newText: string, textChangeRange: TextChangeRange): SourceFile { return updateSourceFile(this, newText, textChangeRange); @@ -767,7 +768,7 @@ module ts { return ts.getPositionOfLineAndCharacter(this, line, character); } - public getNamedDeclarations() { + public getNamedDeclarations(): Map { if (!this.namedDeclarations) { this.namedDeclarations = this.computeNamedDeclarations(); } @@ -775,12 +776,57 @@ module ts { return this.namedDeclarations; } - private computeNamedDeclarations() { - let namedDeclarations: Declaration[] = []; + private computeNamedDeclarations(): Map { + let result: Map = {}; forEachChild(this, visit); - return namedDeclarations; + return result; + + function addDeclaration(declaration: Declaration) { + let name = getDeclarationName(declaration); + if (name) { + let declarations = getDeclarations(name); + declarations.push(declaration); + } + } + + function getDeclarations(name: string) { + return getProperty(result, name) || (result[name] = []); + } + + function getDeclarationName(declaration: Declaration) { + if (declaration.name) { + let result = getTextOfIdentifierOrLiteral(declaration.name); + if (result !== undefined) { + return result; + } + + if (declaration.name.kind === SyntaxKind.ComputedPropertyName) { + let expr = (declaration.name).expression; + if (expr.kind === SyntaxKind.PropertyAccessExpression) { + return (expr).name.text; + } + + return getTextOfIdentifierOrLiteral(expr); + } + } + + return undefined; + } + + function getTextOfIdentifierOrLiteral(node: Node) { + if (node) { + if (node.kind === SyntaxKind.Identifier || + node.kind === SyntaxKind.StringLiteral || + node.kind === SyntaxKind.NumericLiteral) { + + return (node).text; + } + } + + return undefined; + } function visit(node: Node): void { switch (node.kind) { @@ -788,22 +834,22 @@ module ts { case SyntaxKind.MethodDeclaration: case SyntaxKind.MethodSignature: let functionDeclaration = node; + let declarationName = getDeclarationName(functionDeclaration); - if (functionDeclaration.name && functionDeclaration.name.getFullWidth() > 0) { - let lastDeclaration = namedDeclarations.length > 0 ? - namedDeclarations[namedDeclarations.length - 1] : - undefined; + if (declarationName) { + let declarations = getDeclarations(declarationName); + let lastDeclaration = lastOrUndefined(declarations); // Check whether this declaration belongs to an "overload group". - if (lastDeclaration && functionDeclaration.symbol === lastDeclaration.symbol) { + if (lastDeclaration && functionDeclaration.parent === lastDeclaration.parent && 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; + declarations[declarations.length - 1] = functionDeclaration; } } else { - namedDeclarations.push(functionDeclaration); + declarations.push(functionDeclaration); } forEachChild(node, visit); @@ -824,10 +870,8 @@ module ts { case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: case SyntaxKind.TypeLiteral: - if ((node).name) { - namedDeclarations.push(node); - } - // fall through + addDeclaration(node); + // fall through case SyntaxKind.Constructor: case SyntaxKind.VariableStatement: case SyntaxKind.VariableDeclarationList: @@ -858,7 +902,7 @@ module ts { case SyntaxKind.EnumMember: case SyntaxKind.PropertyDeclaration: case SyntaxKind.PropertySignature: - namedDeclarations.push(node); + addDeclaration(node); break; case SyntaxKind.ExportDeclaration: @@ -875,7 +919,7 @@ module ts { // Handle default import case e.g.: // import d from "mod"; if (importClause.name) { - namedDeclarations.push(importClause); + addDeclaration(importClause); } // Handle named bindings in imports e.g.: @@ -883,7 +927,7 @@ module ts { // import {a, b as B} from "mod"; if (importClause.namedBindings) { if (importClause.namedBindings.kind === SyntaxKind.NamespaceImport) { - namedDeclarations.push(importClause.namedBindings); + addDeclaration(importClause.namedBindings); } else { forEach((importClause.namedBindings).elements, visit); @@ -944,8 +988,11 @@ 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[]; + getDocumentHighlights(fileName: string, position: number, filesToSearch: string[]): DocumentHighlights[]; + + /** @deprecated */ + getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; getNavigationBarItems(fileName: string): NavigationBarItem[]; @@ -1011,6 +1058,23 @@ module ts { isWriteAccess: boolean; } + export interface DocumentHighlights { + fileName: string; + highlightSpans: HighlightSpan[]; + } + + export module HighlightSpanKind { + export const none = "none"; + export const definition = "definition"; + export const reference = "reference"; + export const writtenReference = "writtenReference"; + } + + export interface HighlightSpan { + textSpan: TextSpan; + kind: string; + } + export interface NavigateToItem { name: string; kind: string; @@ -1315,92 +1379,92 @@ module ts { } // TODO: move these to enums - export class ScriptElementKind { - static unknown = ""; - static warning = "warning"; + export module ScriptElementKind { + export const unknown = ""; + export const warning = "warning"; // predefined type (void) or keyword (class) - static keyword = "keyword"; + export const keyword = "keyword"; // top level script node - static scriptElement = "script"; + export const scriptElement = "script"; // module foo {} - static moduleElement = "module"; + export const moduleElement = "module"; // class X {} - static classElement = "class"; + export const classElement = "class"; // interface Y {} - static interfaceElement = "interface"; + export const interfaceElement = "interface"; // type T = ... - static typeElement = "type"; + export const typeElement = "type"; // enum E - static enumElement = "enum"; + export const enumElement = "enum"; // Inside module and script only // let v = .. - static variableElement = "var"; + export const variableElement = "var"; // Inside function - static localVariableElement = "local var"; + export const localVariableElement = "local var"; // Inside module and script only // function f() { } - static functionElement = "function"; + export const functionElement = "function"; // Inside function - static localFunctionElement = "local function"; + export const localFunctionElement = "local function"; // class X { [public|private]* foo() {} } - static memberFunctionElement = "method"; + export const memberFunctionElement = "method"; // class X { [public|private]* [get|set] foo:number; } - static memberGetAccessorElement = "getter"; - static memberSetAccessorElement = "setter"; + export const memberGetAccessorElement = "getter"; + export const memberSetAccessorElement = "setter"; // class X { [public|private]* foo:number; } // interface Y { foo:number; } - static memberVariableElement = "property"; + export const memberVariableElement = "property"; // class X { constructor() { } } - static constructorImplementationElement = "constructor"; + export const constructorImplementationElement = "constructor"; // interface Y { ():number; } - static callSignatureElement = "call"; + export const callSignatureElement = "call"; // interface Y { []:number; } - static indexSignatureElement = "index"; + export const indexSignatureElement = "index"; // interface Y { new():Y; } - static constructSignatureElement = "construct"; + export const constructSignatureElement = "construct"; // function foo(*Y*: string) - static parameterElement = "parameter"; + export const parameterElement = "parameter"; - static typeParameterElement = "type parameter"; + export const typeParameterElement = "type parameter"; - static primitiveType = "primitive type"; + export const primitiveType = "primitive type"; - static label = "label"; + export const label = "label"; - static alias = "alias"; + export const alias = "alias"; - static constElement = "const"; + export const constElement = "const"; - static letElement = "let"; + export const letElement = "let"; } - export class ScriptElementKindModifier { - static none = ""; - static publicMemberModifier = "public"; - static privateMemberModifier = "private"; - static protectedMemberModifier = "protected"; - static exportedModifier = "export"; - static ambientModifier = "declare"; - static staticModifier = "static"; + export module ScriptElementKindModifier { + export const none = ""; + export const publicMemberModifier = "public"; + export const privateMemberModifier = "private"; + export const protectedMemberModifier = "protected"; + export const exportedModifier = "export"; + export const ambientModifier = "declare"; + export const staticModifier = "static"; } export class ClassificationTypeNames { @@ -2240,8 +2304,6 @@ module ts { let ruleProvider: formatting.RulesProvider; let program: Program; - // this checker is used to answer all LS questions except errors - let typeInfoResolver: TypeChecker; let useCaseSensitivefileNames = false; let cancellationToken = new CancellationTokenObject(host.getCancellationToken && host.getCancellationToken()); @@ -2323,8 +2385,10 @@ module ts { } program = newProgram; - typeInfoResolver = program.getTypeChecker(); + // Make sure all the nodes in the program are both bound, and have their parent + // pointers set property. + program.getTypeChecker(); return; function getOrCreateSourceFile(fileName: string): SourceFile { @@ -2408,15 +2472,8 @@ module ts { return program; } - /** - * Clean up any semantic caches that are not needed. - * The host can call this method if it wants to jettison unused memory. - * We will just dump the typeChecker and recreate a new one. this should have the effect of destroying all the semantic caches. - */ function cleanupSemanticCache(): void { - if (program) { - typeInfoResolver = program.getTypeChecker(); - } + // TODO: Should we jettison the program (or it's type checker) here? } function dispose(): void { @@ -2433,10 +2490,6 @@ 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 @@ -2684,32 +2737,8 @@ module ts { return unescapeIdentifier(displayName); } - function createCompletionEntry(symbol: Symbol, typeChecker: TypeChecker, location: Node): CompletionEntry { - // 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 = 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. - - // 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), - sortText: "0", - }; - } - function getCompletionData(fileName: string, position: number) { + let typeChecker = program.getTypeChecker(); let syntacticStart = new Date().getTime(); let sourceFile = getValidSourceFile(fileName); @@ -2793,29 +2822,29 @@ module ts { isNewIdentifierLocation = false; if (node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName || node.kind === SyntaxKind.PropertyAccessExpression) { - let symbol = typeInfoResolver.getSymbolAtLocation(node); + let symbol = typeChecker.getSymbolAtLocation(node); // This is an alias, follow what it aliases if (symbol && symbol.flags & SymbolFlags.Alias) { - symbol = typeInfoResolver.getAliasedSymbol(symbol); + symbol = typeChecker.getAliasedSymbol(symbol); } if (symbol && symbol.flags & SymbolFlags.HasExports) { // Extract module or enum members - let exportedSymbols = typeInfoResolver.getExportsOfModule(symbol); + let exportedSymbols = typeChecker.getExportsOfModule(symbol); forEach(exportedSymbols, symbol => { - if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) { + if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) { symbols.push(symbol); } }); } } - let type = typeInfoResolver.getTypeAtLocation(node); + let type = typeChecker.getTypeAtLocation(node); if (type) { // Filter private properties forEach(type.getApparentProperties(), symbol => { - if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) { + if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) { symbols.push(symbol); } }); @@ -2829,12 +2858,12 @@ module ts { isMemberCompletion = true; isNewIdentifierLocation = true; - let contextualType = typeInfoResolver.getContextualType(containingObjectLiteral); + let contextualType = typeChecker.getContextualType(containingObjectLiteral); if (!contextualType) { return false; } - let contextualTypeMembers = typeInfoResolver.getPropertiesOfType(contextualType); + let contextualTypeMembers = typeChecker.getPropertiesOfType(contextualType); if (contextualTypeMembers && contextualTypeMembers.length > 0) { // Add filtered items to the completion list symbols = filterContextualMembersList(contextualTypeMembers, containingObjectLiteral.properties); @@ -2851,9 +2880,9 @@ module ts { let exports: Symbol[]; if (importDeclaration.moduleSpecifier) { - let moduleSpecifierSymbol = typeInfoResolver.getSymbolAtLocation(importDeclaration.moduleSpecifier); + let moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(importDeclaration.moduleSpecifier); if (moduleSpecifierSymbol) { - exports = typeInfoResolver.getExportsOfModule(moduleSpecifierSymbol); + exports = typeChecker.getExportsOfModule(moduleSpecifierSymbol); } } @@ -2902,7 +2931,7 @@ module ts { /// TODO filter meaning based on the current context let symbolMeanings = SymbolFlags.Type | SymbolFlags.Value | SymbolFlags.Namespace | SymbolFlags.Alias; - symbols = typeInfoResolver.getSymbolsInScope(scopeNode, symbolMeanings); + symbols = typeChecker.getSymbolsInScope(scopeNode, symbolMeanings); } return true; @@ -3089,6 +3118,7 @@ module ts { case SyntaxKind.SemicolonToken: return containingNodeKind === SyntaxKind.PropertySignature && + previousToken.parent && previousToken.parent.parent && (previousToken.parent.parent.kind === SyntaxKind.InterfaceDeclaration || // interface a { f; | previousToken.parent.parent.kind === SyntaxKind.TypeLiteral); // let x : { a; | @@ -3104,7 +3134,8 @@ module ts { case SyntaxKind.DotDotDotToken: return containingNodeKind === SyntaxKind.Parameter || containingNodeKind === SyntaxKind.Constructor || - (previousToken.parent.parent.kind === SyntaxKind.ArrayBindingPattern); // var [ ...z| + (previousToken.parent && previousToken.parent.parent && + previousToken.parent.parent.kind === SyntaxKind.ArrayBindingPattern); // var [ ...z| case SyntaxKind.PublicKeyword: case SyntaxKind.PrivateKeyword: @@ -3263,6 +3294,31 @@ module ts { return entries; } + function createCompletionEntry(symbol: Symbol, location: Node): CompletionEntry { + // 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 = 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. + + // 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, location), + kindModifiers: getSymbolModifiers(symbol), + sortText: "0", + }; + } + function getCompletionEntriesFromSymbols(symbols: Symbol[]): CompletionEntry[] { let start = new Date().getTime(); var entries: CompletionEntry[] = []; @@ -3270,7 +3326,7 @@ module ts { if (symbols) { var nameToSymbol: Map = {}; for (let symbol of symbols) { - let entry = createCompletionEntry(symbol, typeInfoResolver, location); + let entry = createCompletionEntry(symbol, location); if (entry) { let id = escapeIdentifier(entry.name); if (!lookUp(nameToSymbol, id)) { @@ -3302,7 +3358,7 @@ module ts { 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); + let displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location, location, SemanticMeaning.All); return { name: entryName, kind: displayPartsDocumentationsAndSymbolKind.symbolKind, @@ -3329,7 +3385,7 @@ module ts { } // TODO(drosen): use contextual SemanticMeaning. - function getSymbolKind(symbol: Symbol, typeResolver: TypeChecker, location: Node): string { + function getSymbolKind(symbol: Symbol, location: Node): string { let flags = symbol.getFlags(); if (flags & SymbolFlags.Class) return ScriptElementKind.classElement; @@ -3338,7 +3394,7 @@ module ts { if (flags & SymbolFlags.Interface) return ScriptElementKind.interfaceElement; if (flags & SymbolFlags.TypeParameter) return ScriptElementKind.typeParameterElement; - let result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver, location); + let result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, location); if (result === ScriptElementKind.unknown) { if (flags & SymbolFlags.TypeParameter) return ScriptElementKind.typeParameterElement; if (flags & SymbolFlags.EnumMember) return ScriptElementKind.variableElement; @@ -3349,11 +3405,13 @@ module ts { return result; } - function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol: Symbol, flags: SymbolFlags, typeResolver: TypeChecker, location: Node) { - if (typeResolver.isUndefinedSymbol(symbol)) { + function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol: Symbol, flags: SymbolFlags, location: Node) { + let typeChecker = program.getTypeChecker(); + + if (typeChecker.isUndefinedSymbol(symbol)) { return ScriptElementKind.variableElement; } - if (typeResolver.isArgumentsSymbol(symbol)) { + if (typeChecker.isArgumentsSymbol(symbol)) { return ScriptElementKind.localVariableElement; } if (flags & SymbolFlags.Variable) { @@ -3377,7 +3435,7 @@ module ts { if (flags & SymbolFlags.Property) { if (flags & SymbolFlags.UnionProperty) { // If union property is result of union of non method (property/accessors/variables), it is labeled as property - let unionPropertyKind = forEach(typeInfoResolver.getRootSymbols(symbol), rootSymbol => { + let unionPropertyKind = forEach(typeChecker.getRootSymbols(symbol), rootSymbol => { let rootSymbolFlags = rootSymbol.getFlags(); if (rootSymbolFlags & (SymbolFlags.PropertyOrAccessor | SymbolFlags.Variable)) { return ScriptElementKind.memberVariableElement; @@ -3387,7 +3445,7 @@ module ts { if (!unionPropertyKind) { // If this was union of all methods, //make sure it has call signatures before we can label it as method - let typeOfUnionProperty = typeInfoResolver.getTypeOfSymbolAtLocation(symbol, location); + let typeOfUnionProperty = typeChecker.getTypeOfSymbolAtLocation(symbol, location); if (typeOfUnionProperty.getCallSignatures().length) { return ScriptElementKind.memberFunctionElement; } @@ -3420,15 +3478,16 @@ module ts { : ScriptElementKindModifier.none; } + // TODO(drosen): Currently completion entry details passes the SemanticMeaning.All instead of using semanticMeaning of location function getSymbolDisplayPartsDocumentationAndSymbolKind(symbol: Symbol, sourceFile: SourceFile, enclosingDeclaration: Node, - typeResolver: TypeChecker, location: Node, - // TODO(drosen): Currently completion entry details passes the SemanticMeaning.All instead of using semanticMeaning of location - semanticMeaning = getMeaningFromLocation(location)) { + location: Node, semanticMeaning = getMeaningFromLocation(location)) { + + let typeChecker = program.getTypeChecker(); let displayParts: SymbolDisplayPart[] = []; let documentation: SymbolDisplayPart[]; let symbolFlags = symbol.flags; - let symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, typeResolver, location); + let symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, location); let hasAddedSymbolInfo: boolean; let type: Type; @@ -3440,7 +3499,7 @@ module ts { } let signature: Signature; - type = typeResolver.getTypeOfSymbolAtLocation(symbol, location); + type = typeChecker.getTypeOfSymbolAtLocation(symbol, location); if (type) { if (location.parent && location.parent.kind === SyntaxKind.PropertyAccessExpression) { let right = (location.parent).name; @@ -3461,7 +3520,7 @@ module ts { if (callExpression) { let candidateSignatures: Signature[] = []; - signature = typeResolver.getResolvedSignature(callExpression, candidateSignatures); + signature = typeChecker.getResolvedSignature(callExpression, candidateSignatures); if (!signature && candidateSignatures.length) { // Use the first candidate: signature = candidateSignatures[0]; @@ -3510,7 +3569,7 @@ module ts { displayParts.push(spacePart()); } if (!(type.flags & TypeFlags.Anonymous)) { - displayParts.push.apply(displayParts, symbolToDisplayParts(typeResolver, type.symbol, enclosingDeclaration, /*meaning*/ undefined, SymbolFormatFlags.WriteTypeParametersOrArguments)); + displayParts.push.apply(displayParts, symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, SymbolFormatFlags.WriteTypeParametersOrArguments)); } addSignatureDisplayParts(signature, allSignatures, TypeFormatFlags.WriteArrowStyleSignature); break; @@ -3527,8 +3586,8 @@ module ts { // get the signature from the declaration and write it let functionDeclaration = location.parent; let allSignatures = functionDeclaration.kind === SyntaxKind.Constructor ? type.getConstructSignatures() : type.getCallSignatures(); - if (!typeResolver.isImplementationOfOverload(functionDeclaration)) { - signature = typeResolver.getSignatureFromDeclaration(functionDeclaration); + if (!typeChecker.isImplementationOfOverload(functionDeclaration)) { + signature = typeChecker.getSignatureFromDeclaration(functionDeclaration); } else { signature = allSignatures[0]; @@ -3571,7 +3630,7 @@ module ts { displayParts.push(spacePart()); displayParts.push(operatorPart(SyntaxKind.EqualsToken)); displayParts.push(spacePart()); - displayParts.push.apply(displayParts, typeToDisplayParts(typeResolver, typeResolver.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration)); + displayParts.push.apply(displayParts, typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration)); } if (symbolFlags & SymbolFlags.Enum) { addNewLineIfDisplayPartsExist(); @@ -3607,7 +3666,7 @@ module ts { else { // Method/function type parameter let signatureDeclaration = getDeclarationOfKind(symbol, SyntaxKind.TypeParameter).parent; - let signature = typeResolver.getSignatureFromDeclaration(signatureDeclaration); + let signature = typeChecker.getSignatureFromDeclaration(signatureDeclaration); if (signatureDeclaration.kind === SyntaxKind.ConstructSignature) { displayParts.push(keywordPart(SyntaxKind.NewKeyword)); displayParts.push(spacePart()); @@ -3615,14 +3674,14 @@ module ts { else if (signatureDeclaration.kind !== SyntaxKind.CallSignature && signatureDeclaration.name) { addFullSymbolName(signatureDeclaration.symbol); } - displayParts.push.apply(displayParts, signatureToDisplayParts(typeResolver, signature, sourceFile, TypeFormatFlags.WriteTypeArgumentsOfSignature)); + displayParts.push.apply(displayParts, signatureToDisplayParts(typeChecker, signature, sourceFile, TypeFormatFlags.WriteTypeArgumentsOfSignature)); } } if (symbolFlags & SymbolFlags.EnumMember) { addPrefixForAnyFunctionOrVar(symbol, "enum member"); let declaration = symbol.declarations[0]; if (declaration.kind === SyntaxKind.EnumMember) { - let constantValue = typeResolver.getConstantValue(declaration); + let constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(spacePart()); displayParts.push(operatorPart(SyntaxKind.EqualsToken)); @@ -3649,7 +3708,7 @@ module ts { displayParts.push(punctuationPart(SyntaxKind.CloseParenToken)); } else { - let internalAliasSymbol = typeResolver.getSymbolAtLocation(importEqualsDeclaration.moduleReference); + let internalAliasSymbol = typeChecker.getSymbolAtLocation(importEqualsDeclaration.moduleReference); if (internalAliasSymbol) { displayParts.push(spacePart()); displayParts.push(operatorPart(SyntaxKind.EqualsToken)); @@ -3674,12 +3733,12 @@ module ts { // If the type is type parameter, format it specially if (type.symbol && type.symbol.flags & SymbolFlags.TypeParameter) { let typeParameterParts = mapToDisplayParts(writer => { - typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration); + typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration); }); displayParts.push.apply(displayParts, typeParameterParts); } else { - displayParts.push.apply(displayParts, typeToDisplayParts(typeResolver, type, enclosingDeclaration)); + displayParts.push.apply(displayParts, typeToDisplayParts(typeChecker, type, enclosingDeclaration)); } } else if (symbolFlags & SymbolFlags.Function || @@ -3694,7 +3753,7 @@ module ts { } } else { - symbolKind = getSymbolKind(symbol, typeResolver, location); + symbolKind = getSymbolKind(symbol, location); } } @@ -3711,7 +3770,7 @@ module ts { } function addFullSymbolName(symbol: Symbol, enclosingDeclaration?: Node) { - let fullSymbolDisplayParts = symbolToDisplayParts(typeResolver, symbol, enclosingDeclaration || sourceFile, /*meaning*/ undefined, + let fullSymbolDisplayParts = symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration || sourceFile, /*meaning*/ undefined, SymbolFormatFlags.WriteTypeParametersOrArguments | SymbolFormatFlags.UseOnlyExternalAliasing); displayParts.push.apply(displayParts, fullSymbolDisplayParts); } @@ -3743,7 +3802,7 @@ module ts { } function addSignatureDisplayParts(signature: Signature, allSignatures: Signature[], flags?: TypeFormatFlags) { - displayParts.push.apply(displayParts, signatureToDisplayParts(typeResolver, signature, enclosingDeclaration, flags | TypeFormatFlags.WriteTypeArgumentsOfSignature)); + displayParts.push.apply(displayParts, signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | TypeFormatFlags.WriteTypeArgumentsOfSignature)); if (allSignatures.length > 1) { displayParts.push(spacePart()); displayParts.push(punctuationPart(SyntaxKind.OpenParenToken)); @@ -3758,7 +3817,7 @@ module ts { function writeTypeParametersOfSymbol(symbol: Symbol, enclosingDeclaration: Node) { let typeParameterParts = mapToDisplayParts(writer => { - typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration); + typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration); }); displayParts.push.apply(displayParts, typeParameterParts); } @@ -3773,7 +3832,13 @@ module ts { return undefined; } - let symbol = typeInfoResolver.getSymbolAtLocation(node); + if (isLabelName(node)) { + return undefined; + } + + let typeChecker = program.getTypeChecker(); + let symbol = typeChecker.getSymbolAtLocation(node); + if (!symbol) { // Try getting just type at this position and show switch (node.kind) { @@ -3783,13 +3848,13 @@ module ts { case SyntaxKind.ThisKeyword: case SyntaxKind.SuperKeyword: // For the identifiers/this/super etc get the type at position - let type = typeInfoResolver.getTypeAtLocation(node); + let type = typeChecker.getTypeAtLocation(node); if (type) { return { kind: ScriptElementKind.unknown, kindModifiers: ScriptElementKindModifier.none, textSpan: createTextSpan(node.getStart(), node.getWidth()), - displayParts: typeToDisplayParts(typeInfoResolver, type, getContainerNode(node)), + displayParts: typeToDisplayParts(typeChecker, type, getContainerNode(node)), documentation: type.symbol ? type.symbol.getDocumentationComment() : undefined }; } @@ -3798,7 +3863,7 @@ module ts { return undefined; } - let displayPartsDocumentationsAndKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, getContainerNode(node), typeInfoResolver, node); + let displayPartsDocumentationsAndKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, getContainerNode(node), node); return { kind: displayPartsDocumentationsAndKind.symbolKind, kindModifiers: getSymbolModifiers(symbol), @@ -3854,7 +3919,8 @@ module ts { return undefined; } - let symbol = typeInfoResolver.getSymbolAtLocation(node); + let typeChecker = program.getTypeChecker(); + let symbol = typeChecker.getSymbolAtLocation(node); // Could not find a symbol e.g. node is string or number keyword, // or the symbol was an internal symbol and does not have a declaration e.g. undefined symbol @@ -3869,7 +3935,7 @@ module ts { if (symbol.flags & SymbolFlags.Alias) { let declaration = symbol.declarations[0]; if (node.kind === SyntaxKind.Identifier && node.parent === declaration) { - symbol = typeInfoResolver.getAliasedSymbol(symbol); + symbol = typeChecker.getAliasedSymbol(symbol); } } @@ -3879,25 +3945,25 @@ module ts { // is performed at the location of property access, we would like to go to definition of the property in the short-hand // assignment. This case and others are handled by the following code. if (node.parent.kind === SyntaxKind.ShorthandPropertyAssignment) { - let shorthandSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); + let shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); if (!shorthandSymbol) { return []; } let shorthandDeclarations = shorthandSymbol.getDeclarations(); - let shorthandSymbolKind = getSymbolKind(shorthandSymbol, typeInfoResolver, node); - let shorthandSymbolName = typeInfoResolver.symbolToString(shorthandSymbol); - let shorthandContainerName = typeInfoResolver.symbolToString(symbol.parent, node); + let shorthandSymbolKind = getSymbolKind(shorthandSymbol, node); + let shorthandSymbolName = typeChecker.symbolToString(shorthandSymbol); + let shorthandContainerName = typeChecker.symbolToString(symbol.parent, node); return map(shorthandDeclarations, declaration => createDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName)); } let result: DefinitionInfo[] = []; let declarations = symbol.getDeclarations(); - let symbolName = typeInfoResolver.symbolToString(symbol); // Do not get scoped name, just the name of the symbol - let symbolKind = getSymbolKind(symbol, typeInfoResolver, node); + let symbolName = typeChecker.symbolToString(symbol); // Do not get scoped name, just the name of the symbol + let symbolKind = getSymbolKind(symbol, node); let containerSymbol = symbol.parent; - let containerName = containerSymbol ? typeInfoResolver.symbolToString(containerSymbol, node) : ""; + let containerName = containerSymbol ? typeChecker.symbolToString(containerSymbol, node) : ""; if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { @@ -3961,20 +4027,19 @@ module ts { 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}.`); - }); + // Get occurrences only supports reporting occurrences for the file queried. So + // filter down to that list. + results = filter(results, r => getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile); } return results; } - /// References and Occurrences - function getOccurrencesAtPositionCore(fileName: string, position: number): ReferenceEntry[] { + function getDocumentHighlights(fileName: string, position: number, filesToSearch: string[]): DocumentHighlights[] { synchronizeHostData(); + filesToSearch = map(filesToSearch, normalizeSlashes); + let sourceFilesToSearch = filter(program.getSourceFiles(), f => contains(filesToSearch, f.fileName)); let sourceFile = getValidSourceFile(fileName); let node = getTouchingWord(sourceFile, position); @@ -3982,549 +4047,642 @@ module ts { return undefined; } - if (node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.ThisKeyword || node.kind === SyntaxKind.SuperKeyword || - isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { - return convertReferences(getReferencesForNode(node, [sourceFile], /*searchOnlyInCurrentFile*/ true, /*findInStrings:*/ false, /*findInComments:*/ false)); + return getSemanticDocumentHighlights(node) || getSyntacticDocumentHighlights(node); + + function getHighlightSpanForNode(node: Node): HighlightSpan { + let start = node.getStart(); + let end = node.getEnd(); + + return { + fileName: sourceFile.fileName, + textSpan: createTextSpanFromBounds(start, end), + kind: HighlightSpanKind.none + }; } - switch (node.kind) { - case SyntaxKind.IfKeyword: - case SyntaxKind.ElseKeyword: - if (hasKind(node.parent, SyntaxKind.IfStatement)) { - return getIfElseOccurrences(node.parent); - } - break; - case SyntaxKind.ReturnKeyword: - if (hasKind(node.parent, SyntaxKind.ReturnStatement)) { - return getReturnOccurrences(node.parent); - } - break; - case SyntaxKind.ThrowKeyword: - if (hasKind(node.parent, SyntaxKind.ThrowStatement)) { - return getThrowOccurrences(node.parent); - } - break; - case SyntaxKind.CatchKeyword: - if (hasKind(parent(parent(node)), SyntaxKind.TryStatement)) { - return getTryCatchFinallyOccurrences(node.parent.parent); - } - break; - case SyntaxKind.TryKeyword: - case SyntaxKind.FinallyKeyword: - if (hasKind(parent(node), SyntaxKind.TryStatement)) { - return getTryCatchFinallyOccurrences(node.parent); - } - break; - case SyntaxKind.SwitchKeyword: - if (hasKind(node.parent, SyntaxKind.SwitchStatement)) { - return getSwitchCaseDefaultOccurrences(node.parent); - } - break; - case SyntaxKind.CaseKeyword: - case SyntaxKind.DefaultKeyword: - if (hasKind(parent(parent(parent(node))), SyntaxKind.SwitchStatement)) { - return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); - } - break; - case SyntaxKind.BreakKeyword: - case SyntaxKind.ContinueKeyword: - if (hasKind(node.parent, SyntaxKind.BreakStatement) || hasKind(node.parent, SyntaxKind.ContinueStatement)) { - return getBreakOrContinueStatementOccurences(node.parent); - } - break; - case SyntaxKind.ForKeyword: - if (hasKind(node.parent, SyntaxKind.ForStatement) || - hasKind(node.parent, SyntaxKind.ForInStatement) || - hasKind(node.parent, SyntaxKind.ForOfStatement)) { - return getLoopBreakContinueOccurrences(node.parent); - } - break; - case SyntaxKind.WhileKeyword: - case SyntaxKind.DoKeyword: - if (hasKind(node.parent, SyntaxKind.WhileStatement) || hasKind(node.parent, SyntaxKind.DoStatement)) { - return getLoopBreakContinueOccurrences(node.parent); - } - break; - case SyntaxKind.ConstructorKeyword: - if (hasKind(node.parent, SyntaxKind.Constructor)) { - return getConstructorOccurrences(node.parent); - } - break; - case SyntaxKind.GetKeyword: - case SyntaxKind.SetKeyword: - if (hasKind(node.parent, SyntaxKind.GetAccessor) || hasKind(node.parent, SyntaxKind.SetAccessor)) { - return getGetAndSetOccurrences(node.parent); - } - default: - if (isModifier(node.kind) && node.parent && - (isDeclaration(node.parent) || node.parent.kind === SyntaxKind.VariableStatement)) { - return getModifierOccurrences(node.kind, node.parent); - } - } + function getSemanticDocumentHighlights(node: Node): DocumentHighlights[] { + if (node.kind === SyntaxKind.Identifier || + node.kind === SyntaxKind.ThisKeyword || + node.kind === SyntaxKind.SuperKeyword || + isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || + isNameOfExternalModuleImportOrDeclaration(node)) { - return undefined; - - function getIfElseOccurrences(ifStatement: IfStatement): ReferenceEntry[] { - let keywords: Node[] = []; - - // Traverse upwards through all parent if-statements linked by their else-branches. - while (hasKind(ifStatement.parent, SyntaxKind.IfStatement) && (ifStatement.parent).elseStatement === ifStatement) { - ifStatement = ifStatement.parent; + let referencedSymbols = getReferencedSymbolsForNodes(node, sourceFilesToSearch, /*findInStrings:*/ false, /*findInComments:*/ false); + return convertReferencedSymbols(referencedSymbols); } - // Now traverse back down through the else branches, aggregating if/else keywords of if-statements. - while (ifStatement) { - let children = ifStatement.getChildren(); - pushKeywordIf(keywords, children[0], SyntaxKind.IfKeyword); + return undefined; - // Generally the 'else' keyword is second-to-last, so we traverse backwards. - for (let i = children.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, children[i], SyntaxKind.ElseKeyword)) { - break; + function convertReferencedSymbols(referencedSymbols: ReferencedSymbol[]): DocumentHighlights[] { + if (!referencedSymbols) { + return undefined; + } + + let fileNameToDocumentHighlights: Map = {}; + let result: DocumentHighlights[] = []; + for (let referencedSymbol of referencedSymbols) { + for (let referenceEntry of referencedSymbol.references) { + let fileName = referenceEntry.fileName; + let documentHighlights = getProperty(fileNameToDocumentHighlights, fileName); + if (!documentHighlights) { + documentHighlights = { fileName, highlightSpans: [] }; + + fileNameToDocumentHighlights[fileName] = documentHighlights; + result.push(documentHighlights); + } + + documentHighlights.highlightSpans.push({ + textSpan: referenceEntry.textSpan, + kind: referenceEntry.isWriteAccess ? HighlightSpanKind.writtenReference : HighlightSpanKind.reference + }); } } - if (!hasKind(ifStatement.elseStatement, SyntaxKind.IfStatement)) { - break - } + return result; + } + } - ifStatement = ifStatement.elseStatement; + function getSyntacticDocumentHighlights(node: Node): DocumentHighlights[] { + let fileName = sourceFile.fileName; + + var highlightSpans = getHighlightSpans(node); + if (!highlightSpans || highlightSpans.length === 0) { + return undefined; } - let result: ReferenceEntry[] = []; + return [{ fileName, highlightSpans }]; - // We'd like to highlight else/ifs together if they are only separated by whitespace - // (i.e. the keywords are separated by no comments, no newlines). - for (let i = 0; i < keywords.length; i++) { - if (keywords[i].kind === SyntaxKind.ElseKeyword && i < keywords.length - 1) { - let elseKeyword = keywords[i]; - let ifKeyword = keywords[i + 1]; // this *should* always be an 'if' keyword. + // returns true if 'node' is defined and has a matching 'kind'. + function hasKind(node: Node, kind: SyntaxKind) { + return node !== undefined && node.kind === kind; + } - let shouldHighlightNextKeyword = true; + // Null-propagating 'parent' function. + function parent(node: Node): Node { + return node && node.parent; + } - // Avoid recalculating getStart() by iterating backwards. - for (let j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { - if (!isWhiteSpace(sourceFile.text.charCodeAt(j))) { - shouldHighlightNextKeyword = false; + function getHighlightSpans(node: Node): HighlightSpan[] { + if (node) { + switch (node.kind) { + case SyntaxKind.IfKeyword: + case SyntaxKind.ElseKeyword: + if (hasKind(node.parent, SyntaxKind.IfStatement)) { + return getIfElseOccurrences(node.parent); + } + break; + case SyntaxKind.ReturnKeyword: + if (hasKind(node.parent, SyntaxKind.ReturnStatement)) { + return getReturnOccurrences(node.parent); + } + break; + case SyntaxKind.ThrowKeyword: + if (hasKind(node.parent, SyntaxKind.ThrowStatement)) { + return getThrowOccurrences(node.parent); + } + break; + case SyntaxKind.CatchKeyword: + if (hasKind(parent(parent(node)), SyntaxKind.TryStatement)) { + return getTryCatchFinallyOccurrences(node.parent.parent); + } + break; + case SyntaxKind.TryKeyword: + case SyntaxKind.FinallyKeyword: + if (hasKind(parent(node), SyntaxKind.TryStatement)) { + return getTryCatchFinallyOccurrences(node.parent); + } + break; + case SyntaxKind.SwitchKeyword: + if (hasKind(node.parent, SyntaxKind.SwitchStatement)) { + return getSwitchCaseDefaultOccurrences(node.parent); + } + break; + case SyntaxKind.CaseKeyword: + case SyntaxKind.DefaultKeyword: + if (hasKind(parent(parent(parent(node))), SyntaxKind.SwitchStatement)) { + return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); + } + break; + case SyntaxKind.BreakKeyword: + case SyntaxKind.ContinueKeyword: + if (hasKind(node.parent, SyntaxKind.BreakStatement) || hasKind(node.parent, SyntaxKind.ContinueStatement)) { + return getBreakOrContinueStatementOccurences(node.parent); + } + break; + case SyntaxKind.ForKeyword: + if (hasKind(node.parent, SyntaxKind.ForStatement) || + hasKind(node.parent, SyntaxKind.ForInStatement) || + hasKind(node.parent, SyntaxKind.ForOfStatement)) { + return getLoopBreakContinueOccurrences(node.parent); + } + break; + case SyntaxKind.WhileKeyword: + case SyntaxKind.DoKeyword: + if (hasKind(node.parent, SyntaxKind.WhileStatement) || hasKind(node.parent, SyntaxKind.DoStatement)) { + return getLoopBreakContinueOccurrences(node.parent); + } + break; + case SyntaxKind.ConstructorKeyword: + if (hasKind(node.parent, SyntaxKind.Constructor)) { + return getConstructorOccurrences(node.parent); + } + break; + case SyntaxKind.GetKeyword: + case SyntaxKind.SetKeyword: + if (hasKind(node.parent, SyntaxKind.GetAccessor) || hasKind(node.parent, SyntaxKind.SetAccessor)) { + return getGetAndSetOccurrences(node.parent); + } + default: + if (isModifier(node.kind) && node.parent && + (isDeclaration(node.parent) || node.parent.kind === SyntaxKind.VariableStatement)) { + return getModifierOccurrences(node.kind, node.parent); + } + } + } + + return undefined; + } + + /** + * Aggregates all throw-statements within this node *without* crossing + * into function boundaries and try-blocks with catch-clauses. + */ + function aggregateOwnedThrowStatements(node: Node): ThrowStatement[] { + let statementAccumulator: ThrowStatement[] = [] + aggregate(node); + return statementAccumulator; + + function aggregate(node: Node): void { + if (node.kind === SyntaxKind.ThrowStatement) { + statementAccumulator.push(node); + } + else if (node.kind === SyntaxKind.TryStatement) { + let tryStatement = node; + + if (tryStatement.catchClause) { + aggregate(tryStatement.catchClause); + } + else { + // Exceptions thrown within a try block lacking a catch clause + // are "owned" in the current context. + aggregate(tryStatement.tryBlock); + } + + if (tryStatement.finallyBlock) { + aggregate(tryStatement.finallyBlock); + } + } + // Do not cross function boundaries. + else if (!isFunctionLike(node)) { + forEachChild(node, aggregate); + } + }; + } + + /** + * For lack of a better name, this function takes a throw statement and returns the + * nearest ancestor that is a try-block (whose try statement has a catch clause), + * function-block, or source file. + */ + function getThrowStatementOwner(throwStatement: ThrowStatement): Node { + let child: Node = throwStatement; + + while (child.parent) { + let parent = child.parent; + + if (isFunctionBlock(parent) || parent.kind === SyntaxKind.SourceFile) { + return parent; + } + + // A throw-statement is only owned by a try-statement if the try-statement has + // a catch clause, and if the throw-statement occurs within the try block. + if (parent.kind === SyntaxKind.TryStatement) { + let tryStatement = parent; + + if (tryStatement.tryBlock === child && tryStatement.catchClause) { + return child; + } + } + + child = parent; + } + + return undefined; + } + + function aggregateAllBreakAndContinueStatements(node: Node): BreakOrContinueStatement[] { + let statementAccumulator: BreakOrContinueStatement[] = [] + aggregate(node); + return statementAccumulator; + + function aggregate(node: Node): void { + if (node.kind === SyntaxKind.BreakStatement || node.kind === SyntaxKind.ContinueStatement) { + statementAccumulator.push(node); + } + // Do not cross function boundaries. + else if (!isFunctionLike(node)) { + forEachChild(node, aggregate); + } + }; + } + + function ownsBreakOrContinueStatement(owner: Node, statement: BreakOrContinueStatement): boolean { + let actualOwner = getBreakOrContinueOwner(statement); + + return actualOwner && actualOwner === owner; + } + + function getBreakOrContinueOwner(statement: BreakOrContinueStatement): Node { + for (let node = statement.parent; node; node = node.parent) { + switch (node.kind) { + case SyntaxKind.SwitchStatement: + if (statement.kind === SyntaxKind.ContinueStatement) { + continue; + } + // Fall through. + case SyntaxKind.ForStatement: + case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: + case SyntaxKind.WhileStatement: + case SyntaxKind.DoStatement: + if (!statement.label || isLabeledBy(node, statement.label.text)) { + return node; + } + break; + default: + // Don't cross function boundaries. + if (isFunctionLike(node)) { + return undefined; + } + break; + } + } + + return undefined; + } + + function getModifierOccurrences(modifier: SyntaxKind, declaration: Node): HighlightSpan[] { + let container = declaration.parent; + + // Make sure we only highlight the keyword when it makes sense to do so. + if (isAccessibilityModifier(modifier)) { + if (!(container.kind === SyntaxKind.ClassDeclaration || + (declaration.kind === SyntaxKind.Parameter && hasKind(container, SyntaxKind.Constructor)))) { + return undefined; + } + } + else if (modifier === SyntaxKind.StaticKeyword) { + if (container.kind !== SyntaxKind.ClassDeclaration) { + return undefined; + } + } + else if (modifier === SyntaxKind.ExportKeyword || modifier === SyntaxKind.DeclareKeyword) { + if (!(container.kind === SyntaxKind.ModuleBlock || container.kind === SyntaxKind.SourceFile)) { + return undefined; + } + } + else { + // unsupported modifier + return undefined; + } + + let keywords: Node[] = []; + let modifierFlag: NodeFlags = getFlagFromModifier(modifier); + + let nodes: Node[]; + switch (container.kind) { + case SyntaxKind.ModuleBlock: + case SyntaxKind.SourceFile: + nodes = (container).statements; + break; + case SyntaxKind.Constructor: + nodes = ((container).parameters).concat( + (container.parent).members); + break; + case SyntaxKind.ClassDeclaration: + nodes = (container).members; + + // If we're an accessibility modifier, we're in an instance member and should search + // the constructor's parameter list for instance members as well. + if (modifierFlag & NodeFlags.AccessibilityModifier) { + let constructor = forEach((container).members, member => { + return member.kind === SyntaxKind.Constructor && member; + }); + + if (constructor) { + nodes = nodes.concat(constructor.parameters); + } + } + break; + default: + Debug.fail("Invalid container kind.") + } + + forEach(nodes, node => { + if (node.modifiers && node.flags & modifierFlag) { + forEach(node.modifiers, child => pushKeywordIf(keywords, child, modifier)); + } + }); + + return map(keywords, getHighlightSpanForNode); + + function getFlagFromModifier(modifier: SyntaxKind) { + switch (modifier) { + case SyntaxKind.PublicKeyword: + return NodeFlags.Public; + case SyntaxKind.PrivateKeyword: + return NodeFlags.Private; + case SyntaxKind.ProtectedKeyword: + return NodeFlags.Protected; + case SyntaxKind.StaticKeyword: + return NodeFlags.Static; + case SyntaxKind.ExportKeyword: + return NodeFlags.Export; + case SyntaxKind.DeclareKeyword: + return NodeFlags.Ambient; + default: + Debug.fail(); + } + } + } + + function pushKeywordIf(keywordList: Node[], token: Node, ...expected: SyntaxKind[]): boolean { + if (token && contains(expected, token.kind)) { + keywordList.push(token); + return true; + } + + return false; + } + + function getGetAndSetOccurrences(accessorDeclaration: AccessorDeclaration): HighlightSpan[] { + let keywords: Node[] = []; + + tryPushAccessorKeyword(accessorDeclaration.symbol, SyntaxKind.GetAccessor); + tryPushAccessorKeyword(accessorDeclaration.symbol, SyntaxKind.SetAccessor); + + return map(keywords, getHighlightSpanForNode); + + function tryPushAccessorKeyword(accessorSymbol: Symbol, accessorKind: SyntaxKind): void { + let accessor = getDeclarationOfKind(accessorSymbol, accessorKind); + + if (accessor) { + forEach(accessor.getChildren(), child => pushKeywordIf(keywords, child, SyntaxKind.GetKeyword, SyntaxKind.SetKeyword)); + } + } + } + + function getConstructorOccurrences(constructorDeclaration: ConstructorDeclaration): HighlightSpan[] { + let declarations = constructorDeclaration.symbol.getDeclarations() + + let keywords: Node[] = []; + + forEach(declarations, declaration => { + forEach(declaration.getChildren(), token => { + return pushKeywordIf(keywords, token, SyntaxKind.ConstructorKeyword); + }); + }); + + return map(keywords, getHighlightSpanForNode); + } + + function getLoopBreakContinueOccurrences(loopNode: IterationStatement): HighlightSpan[] { + let keywords: Node[] = []; + + if (pushKeywordIf(keywords, loopNode.getFirstToken(), SyntaxKind.ForKeyword, SyntaxKind.WhileKeyword, SyntaxKind.DoKeyword)) { + // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. + if (loopNode.kind === SyntaxKind.DoStatement) { + let loopTokens = loopNode.getChildren(); + + for (let i = loopTokens.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, loopTokens[i], SyntaxKind.WhileKeyword)) { + break; + } + } + } + } + + let breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); + + forEach(breaksAndContinues, statement => { + if (ownsBreakOrContinueStatement(loopNode, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), SyntaxKind.BreakKeyword, SyntaxKind.ContinueKeyword); + } + }); + + return map(keywords, getHighlightSpanForNode); + } + + function getBreakOrContinueStatementOccurences(breakOrContinueStatement: BreakOrContinueStatement): HighlightSpan[] { + let owner = getBreakOrContinueOwner(breakOrContinueStatement); + + if (owner) { + switch (owner.kind) { + case SyntaxKind.ForStatement: + case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: + case SyntaxKind.DoStatement: + case SyntaxKind.WhileStatement: + return getLoopBreakContinueOccurrences(owner) + case SyntaxKind.SwitchStatement: + return getSwitchCaseDefaultOccurrences(owner); + + } + } + + return undefined; + } + + function getSwitchCaseDefaultOccurrences(switchStatement: SwitchStatement): HighlightSpan[] { + let keywords: Node[] = []; + + pushKeywordIf(keywords, switchStatement.getFirstToken(), SyntaxKind.SwitchKeyword); + + // Go through each clause in the switch statement, collecting the 'case'/'default' keywords. + forEach(switchStatement.caseBlock.clauses, clause => { + pushKeywordIf(keywords, clause.getFirstToken(), SyntaxKind.CaseKeyword, SyntaxKind.DefaultKeyword); + + let breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); + + forEach(breaksAndContinues, statement => { + if (ownsBreakOrContinueStatement(switchStatement, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), SyntaxKind.BreakKeyword); + } + }); + }); + + return map(keywords, getHighlightSpanForNode); + } + + function getTryCatchFinallyOccurrences(tryStatement: TryStatement): HighlightSpan[] { + let keywords: Node[] = []; + + pushKeywordIf(keywords, tryStatement.getFirstToken(), SyntaxKind.TryKeyword); + + if (tryStatement.catchClause) { + pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), SyntaxKind.CatchKeyword); + } + + if (tryStatement.finallyBlock) { + let finallyKeyword = findChildOfKind(tryStatement, SyntaxKind.FinallyKeyword, sourceFile); + pushKeywordIf(keywords, finallyKeyword, SyntaxKind.FinallyKeyword); + } + + return map(keywords, getHighlightSpanForNode); + } + + function getThrowOccurrences(throwStatement: ThrowStatement): HighlightSpan[] { + let owner = getThrowStatementOwner(throwStatement); + + if (!owner) { + return undefined; + } + + let keywords: Node[] = []; + + forEach(aggregateOwnedThrowStatements(owner), throwStatement => { + pushKeywordIf(keywords, throwStatement.getFirstToken(), SyntaxKind.ThrowKeyword); + }); + + // If the "owner" is a function, then we equate 'return' and 'throw' statements in their + // ability to "jump out" of the function, and include occurrences for both. + if (isFunctionBlock(owner)) { + forEachReturnStatement(owner, returnStatement => { + pushKeywordIf(keywords, returnStatement.getFirstToken(), SyntaxKind.ReturnKeyword); + }); + } + + return map(keywords, getHighlightSpanForNode); + } + + function getReturnOccurrences(returnStatement: ReturnStatement): HighlightSpan[] { + let func = getContainingFunction(returnStatement); + + // If we didn't find a containing function with a block body, bail out. + if (!(func && hasKind(func.body, SyntaxKind.Block))) { + return undefined; + } + + let keywords: Node[] = [] + forEachReturnStatement(func.body, returnStatement => { + pushKeywordIf(keywords, returnStatement.getFirstToken(), SyntaxKind.ReturnKeyword); + }); + + // Include 'throw' statements that do not occur within a try block. + forEach(aggregateOwnedThrowStatements(func.body), throwStatement => { + pushKeywordIf(keywords, throwStatement.getFirstToken(), SyntaxKind.ThrowKeyword); + }); + + return map(keywords, getHighlightSpanForNode); + } + + function getIfElseOccurrences(ifStatement: IfStatement): HighlightSpan[] { + let keywords: Node[] = []; + + // Traverse upwards through all parent if-statements linked by their else-branches. + while (hasKind(ifStatement.parent, SyntaxKind.IfStatement) && (ifStatement.parent).elseStatement === ifStatement) { + ifStatement = ifStatement.parent; + } + + // Now traverse back down through the else branches, aggregating if/else keywords of if-statements. + while (ifStatement) { + let children = ifStatement.getChildren(); + pushKeywordIf(keywords, children[0], SyntaxKind.IfKeyword); + + // Generally the 'else' keyword is second-to-last, so we traverse backwards. + for (let i = children.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, children[i], SyntaxKind.ElseKeyword)) { break; } } - if (shouldHighlightNextKeyword) { - result.push({ - fileName: fileName, - textSpan: createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), - isWriteAccess: false - }); - i++; // skip the next keyword - continue; + if (!hasKind(ifStatement.elseStatement, SyntaxKind.IfStatement)) { + break } + + ifStatement = ifStatement.elseStatement; } - // Ordinary case: just highlight the keyword. - result.push(getReferenceEntryFromNode(keywords[i])); + let result: HighlightSpan[] = []; + + // We'd like to highlight else/ifs together if they are only separated by whitespace + // (i.e. the keywords are separated by no comments, no newlines). + for (let i = 0; i < keywords.length; i++) { + if (keywords[i].kind === SyntaxKind.ElseKeyword && i < keywords.length - 1) { + let elseKeyword = keywords[i]; + let ifKeyword = keywords[i + 1]; // this *should* always be an 'if' keyword. + + let shouldCombindElseAndIf = true; + + // Avoid recalculating getStart() by iterating backwards. + for (let j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { + if (!isWhiteSpace(sourceFile.text.charCodeAt(j))) { + shouldCombindElseAndIf = false; + break; + } + } + + if (shouldCombindElseAndIf) { + result.push({ + fileName: fileName, + textSpan: createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), + kind: HighlightSpanKind.reference + }); + i++; // skip the next keyword + continue; + } + } + + // Ordinary case: just highlight the keyword. + result.push(getHighlightSpanForNode(keywords[i])); + } + + return result; + } + } + } + + /// References and Occurrences + function getOccurrencesAtPositionCore(fileName: string, position: number): ReferenceEntry[] { + synchronizeHostData(); + + return convertDocumentHighlights(getDocumentHighlights(fileName, position, [fileName])); + + function convertDocumentHighlights(documentHighlights: DocumentHighlights[]): ReferenceEntry[] { + if (!documentHighlights) { + return undefined; + } + + let result: ReferenceEntry[] = []; + for (let entry of documentHighlights) { + for (let highlightSpan of entry.highlightSpans) { + result.push({ + fileName: entry.fileName, + textSpan: highlightSpan.textSpan, + isWriteAccess: highlightSpan.kind === HighlightSpanKind.writtenReference + }); + } } return result; } - - function getReturnOccurrences(returnStatement: ReturnStatement): ReferenceEntry[] { - let func = getContainingFunction(returnStatement); - - // If we didn't find a containing function with a block body, bail out. - if (!(func && hasKind(func.body, SyntaxKind.Block))) { - return undefined; - } - - let keywords: Node[] = [] - forEachReturnStatement(func.body, returnStatement => { - pushKeywordIf(keywords, returnStatement.getFirstToken(), SyntaxKind.ReturnKeyword); - }); - - // Include 'throw' statements that do not occur within a try block. - forEach(aggregateOwnedThrowStatements(func.body), throwStatement => { - pushKeywordIf(keywords, throwStatement.getFirstToken(), SyntaxKind.ThrowKeyword); - }); - - return map(keywords, getReferenceEntryFromNode); - } - - function getThrowOccurrences(throwStatement: ThrowStatement) { - let owner = getThrowStatementOwner(throwStatement); - - if (!owner) { - return undefined; - } - - let keywords: Node[] = []; - - forEach(aggregateOwnedThrowStatements(owner), throwStatement => { - pushKeywordIf(keywords, throwStatement.getFirstToken(), SyntaxKind.ThrowKeyword); - }); - - // If the "owner" is a function, then we equate 'return' and 'throw' statements in their - // ability to "jump out" of the function, and include occurrences for both. - if (isFunctionBlock(owner)) { - forEachReturnStatement(owner, returnStatement => { - pushKeywordIf(keywords, returnStatement.getFirstToken(), SyntaxKind.ReturnKeyword); - }); - } - - return map(keywords, getReferenceEntryFromNode); - } - - /** - * Aggregates all throw-statements within this node *without* crossing - * into function boundaries and try-blocks with catch-clauses. - */ - function aggregateOwnedThrowStatements(node: Node): ThrowStatement[] { - let statementAccumulator: ThrowStatement[] = [] - aggregate(node); - return statementAccumulator; - - function aggregate(node: Node): void { - if (node.kind === SyntaxKind.ThrowStatement) { - statementAccumulator.push(node); - } - else if (node.kind === SyntaxKind.TryStatement) { - let tryStatement = node; - - if (tryStatement.catchClause) { - aggregate(tryStatement.catchClause); - } - else { - // Exceptions thrown within a try block lacking a catch clause - // are "owned" in the current context. - aggregate(tryStatement.tryBlock); - } - - if (tryStatement.finallyBlock) { - aggregate(tryStatement.finallyBlock); - } - } - // Do not cross function boundaries. - else if (!isFunctionLike(node)) { - forEachChild(node, aggregate); - } - }; - } - - /** - * For lack of a better name, this function takes a throw statement and returns the - * nearest ancestor that is a try-block (whose try statement has a catch clause), - * function-block, or source file. - */ - function getThrowStatementOwner(throwStatement: ThrowStatement): Node { - let child: Node = throwStatement; - - while (child.parent) { - let parent = child.parent; - - if (isFunctionBlock(parent) || parent.kind === SyntaxKind.SourceFile) { - return parent; - } - - // A throw-statement is only owned by a try-statement if the try-statement has - // a catch clause, and if the throw-statement occurs within the try block. - if (parent.kind === SyntaxKind.TryStatement) { - let tryStatement = parent; - - if (tryStatement.tryBlock === child && tryStatement.catchClause) { - return child; - } - } - - child = parent; - } - - return undefined; - } - - function getTryCatchFinallyOccurrences(tryStatement: TryStatement): ReferenceEntry[] { - let keywords: Node[] = []; - - pushKeywordIf(keywords, tryStatement.getFirstToken(), SyntaxKind.TryKeyword); - - if (tryStatement.catchClause) { - pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), SyntaxKind.CatchKeyword); - } - - if (tryStatement.finallyBlock) { - let finallyKeyword = findChildOfKind(tryStatement, SyntaxKind.FinallyKeyword, sourceFile); - pushKeywordIf(keywords, finallyKeyword, SyntaxKind.FinallyKeyword); - } - - return map(keywords, getReferenceEntryFromNode); - } - - function getLoopBreakContinueOccurrences(loopNode: IterationStatement): ReferenceEntry[] { - let keywords: Node[] = []; - - if (pushKeywordIf(keywords, loopNode.getFirstToken(), SyntaxKind.ForKeyword, SyntaxKind.WhileKeyword, SyntaxKind.DoKeyword)) { - // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === SyntaxKind.DoStatement) { - let loopTokens = loopNode.getChildren(); - - for (let i = loopTokens.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, loopTokens[i], SyntaxKind.WhileKeyword)) { - break; - } - } - } - } - - let breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); - - forEach(breaksAndContinues, statement => { - if (ownsBreakOrContinueStatement(loopNode, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), SyntaxKind.BreakKeyword, SyntaxKind.ContinueKeyword); - } - }); - - return map(keywords, getReferenceEntryFromNode); - } - - function getSwitchCaseDefaultOccurrences(switchStatement: SwitchStatement): ReferenceEntry[] { - let keywords: Node[] = []; - - pushKeywordIf(keywords, switchStatement.getFirstToken(), SyntaxKind.SwitchKeyword); - - // Go through each clause in the switch statement, collecting the 'case'/'default' keywords. - forEach(switchStatement.caseBlock.clauses, clause => { - pushKeywordIf(keywords, clause.getFirstToken(), SyntaxKind.CaseKeyword, SyntaxKind.DefaultKeyword); - - let breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); - - forEach(breaksAndContinues, statement => { - if (ownsBreakOrContinueStatement(switchStatement, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), SyntaxKind.BreakKeyword); - } - }); - }); - - return map(keywords, getReferenceEntryFromNode); - } - - function getBreakOrContinueStatementOccurences(breakOrContinueStatement: BreakOrContinueStatement): ReferenceEntry[] { - let owner = getBreakOrContinueOwner(breakOrContinueStatement); - - if (owner) { - switch (owner.kind) { - case SyntaxKind.ForStatement: - case SyntaxKind.ForInStatement: - case SyntaxKind.ForOfStatement: - case SyntaxKind.DoStatement: - case SyntaxKind.WhileStatement: - return getLoopBreakContinueOccurrences(owner) - case SyntaxKind.SwitchStatement: - return getSwitchCaseDefaultOccurrences(owner); - - } - } - - return undefined; - } - - function aggregateAllBreakAndContinueStatements(node: Node): BreakOrContinueStatement[] { - let statementAccumulator: BreakOrContinueStatement[] = [] - aggregate(node); - return statementAccumulator; - - function aggregate(node: Node): void { - if (node.kind === SyntaxKind.BreakStatement || node.kind === SyntaxKind.ContinueStatement) { - statementAccumulator.push(node); - } - // Do not cross function boundaries. - else if (!isFunctionLike(node)) { - forEachChild(node, aggregate); - } - }; - } - - function ownsBreakOrContinueStatement(owner: Node, statement: BreakOrContinueStatement): boolean { - let actualOwner = getBreakOrContinueOwner(statement); - - return actualOwner && actualOwner === owner; - } - - function getBreakOrContinueOwner(statement: BreakOrContinueStatement): Node { - for (let node = statement.parent; node; node = node.parent) { - switch (node.kind) { - case SyntaxKind.SwitchStatement: - if (statement.kind === SyntaxKind.ContinueStatement) { - continue; - } - // Fall through. - case SyntaxKind.ForStatement: - case SyntaxKind.ForInStatement: - case SyntaxKind.ForOfStatement: - case SyntaxKind.WhileStatement: - case SyntaxKind.DoStatement: - if (!statement.label || isLabeledBy(node, statement.label.text)) { - return node; - } - break; - default: - // Don't cross function boundaries. - if (isFunctionLike(node)) { - return undefined; - } - break; - } - } - - return undefined; - } - - function getConstructorOccurrences(constructorDeclaration: ConstructorDeclaration): ReferenceEntry[] { - let declarations = constructorDeclaration.symbol.getDeclarations() - - let keywords: Node[] = []; - - forEach(declarations, declaration => { - forEach(declaration.getChildren(), token => { - return pushKeywordIf(keywords, token, SyntaxKind.ConstructorKeyword); - }); - }); - - return map(keywords, getReferenceEntryFromNode); - } - - function getGetAndSetOccurrences(accessorDeclaration: AccessorDeclaration): ReferenceEntry[] { - let keywords: Node[] = []; - - tryPushAccessorKeyword(accessorDeclaration.symbol, SyntaxKind.GetAccessor); - tryPushAccessorKeyword(accessorDeclaration.symbol, SyntaxKind.SetAccessor); - - return map(keywords, getReferenceEntryFromNode); - - function tryPushAccessorKeyword(accessorSymbol: Symbol, accessorKind: SyntaxKind): void { - let accessor = getDeclarationOfKind(accessorSymbol, accessorKind); - - if (accessor) { - forEach(accessor.getChildren(), child => pushKeywordIf(keywords, child, SyntaxKind.GetKeyword, SyntaxKind.SetKeyword)); - } - } - } - - function getModifierOccurrences(modifier: SyntaxKind, declaration: Node): ReferenceEntry[] { - let container = declaration.parent; - - // Make sure we only highlight the keyword when it makes sense to do so. - if (isAccessibilityModifier(modifier)) { - if (!(container.kind === SyntaxKind.ClassDeclaration || - (declaration.kind === SyntaxKind.Parameter && hasKind(container, SyntaxKind.Constructor)))) { - return undefined; - } - } - else if (modifier === SyntaxKind.StaticKeyword) { - if (container.kind !== SyntaxKind.ClassDeclaration) { - return undefined; - } - } - else if (modifier === SyntaxKind.ExportKeyword || modifier === SyntaxKind.DeclareKeyword) { - if (!(container.kind === SyntaxKind.ModuleBlock || container.kind === SyntaxKind.SourceFile)) { - return undefined; - } - } - else { - // unsupported modifier - return undefined; - } - - let keywords: Node[] = []; - let modifierFlag: NodeFlags = getFlagFromModifier(modifier); - - let nodes: Node[]; - switch (container.kind) { - case SyntaxKind.ModuleBlock: - case SyntaxKind.SourceFile: - nodes = (container).statements; - break; - case SyntaxKind.Constructor: - nodes = ((container).parameters).concat( - (container.parent).members); - break; - case SyntaxKind.ClassDeclaration: - nodes = (container).members; - - // If we're an accessibility modifier, we're in an instance member and should search - // the constructor's parameter list for instance members as well. - if (modifierFlag & NodeFlags.AccessibilityModifier) { - let constructor = forEach((container).members, member => { - return member.kind === SyntaxKind.Constructor && member; - }); - - if (constructor) { - nodes = nodes.concat(constructor.parameters); - } - } - break; - default: - Debug.fail("Invalid container kind.") - } - - forEach(nodes, node => { - if (node.modifiers && node.flags & modifierFlag) { - forEach(node.modifiers, child => pushKeywordIf(keywords, child, modifier)); - } - }); - - return map(keywords, getReferenceEntryFromNode); - - function getFlagFromModifier(modifier: SyntaxKind) { - switch (modifier) { - case SyntaxKind.PublicKeyword: - return NodeFlags.Public; - case SyntaxKind.PrivateKeyword: - return NodeFlags.Private; - case SyntaxKind.ProtectedKeyword: - return NodeFlags.Protected; - case SyntaxKind.StaticKeyword: - return NodeFlags.Static; - case SyntaxKind.ExportKeyword: - return NodeFlags.Export; - case SyntaxKind.DeclareKeyword: - return NodeFlags.Ambient; - default: - Debug.fail(); - } - } - } - - // returns true if 'node' is defined and has a matching 'kind'. - function hasKind(node: Node, kind: SyntaxKind) { - return node !== undefined && node.kind === kind; - } - - // Null-propagating 'parent' function. - function parent(node: Node): Node { - return node && node.parent; - } - - function pushKeywordIf(keywordList: Node[], token: Node, ...expected: SyntaxKind[]): boolean { - if (token && contains(expected, token.kind)) { - keywordList.push(token); - return true; - } - - return false; - } } - function convertReferences(referenceSymbols: ReferencedSymbol[]): ReferenceEntry[]{ + function convertReferences(referenceSymbols: ReferencedSymbol[]): ReferenceEntry[] { if (!referenceSymbols) { return undefined; } let referenceEntries: ReferenceEntry[] = []; + for (let referenceSymbol of referenceSymbols) { addRange(referenceEntries, referenceSymbol.references); } + return referenceEntries; } - function findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]{ + function findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[] { var referencedSymbols = findReferencedSymbols(fileName, position, findInStrings, findInComments); return convertReferences(referencedSymbols); } @@ -4561,10 +4719,12 @@ module ts { } Debug.assert(node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.NumericLiteral || node.kind === SyntaxKind.StringLiteral); - return getReferencesForNode(node, program.getSourceFiles(), /*searchOnlyInCurrentFile*/ false, findInStrings, findInComments); + return getReferencedSymbolsForNodes(node, program.getSourceFiles(), findInStrings, findInComments); } - function getReferencesForNode(node: Node, sourceFiles: SourceFile[], searchOnlyInCurrentFile: boolean, findInStrings: boolean, findInComments: boolean): ReferencedSymbol[]{ + function getReferencedSymbolsForNodes(node: Node, sourceFiles: SourceFile[], findInStrings: boolean, findInComments: boolean): ReferencedSymbol[] { + let typeChecker = program.getTypeChecker(); + // Labels if (isLabelName(node)) { if (isJumpStatementTarget(node)) { @@ -4587,7 +4747,7 @@ module ts { return getReferencesForSuperKeyword(node); } - let symbol = typeInfoResolver.getSymbolAtLocation(node); + let symbol = typeChecker.getSymbolAtLocation(node); // Could not find a symbol e.g. unknown identifier if (!symbol) { @@ -4622,30 +4782,23 @@ module ts { getReferencesInNode(scope, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); } else { - if (searchOnlyInCurrentFile) { - Debug.assert(sourceFiles.length === 1); - result = []; - getReferencesInNode(sourceFiles[0], symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); - } - else { - let internedName = getInternedName(symbol, node, declarations) - forEach(sourceFiles, sourceFile => { - cancellationToken.throwIfCancellationRequested(); + let internedName = getInternedName(symbol, node, declarations) + for (let sourceFile of sourceFiles) { + cancellationToken.throwIfCancellationRequested(); - let nameTable = getNameTable(sourceFile); + let nameTable = getNameTable(sourceFile); - if (lookUp(nameTable, internedName)) { - result = result || []; - getReferencesInNode(sourceFile, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); - } - }); + if (lookUp(nameTable, internedName)) { + result = result || []; + getReferencesInNode(sourceFile, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); + } } } return result; function getDefinition(symbol: Symbol): DefinitionInfo { - let info = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, node.getSourceFile(), getContainerNode(node), typeInfoResolver, node); + let info = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, node.getSourceFile(), getContainerNode(node), node); let name = map(info.displayParts, p => p.text).join(""); let declarations = symbol.declarations; if (!declarations || declarations.length === 0) { @@ -4695,7 +4848,7 @@ module ts { return location.getText(); } - name = typeInfoResolver.symbolToString(symbol); + name = typeChecker.symbolToString(symbol); return stripQuotes(name); } @@ -4931,10 +5084,10 @@ module ts { return; } - let referenceSymbol = typeInfoResolver.getSymbolAtLocation(referenceLocation); + let referenceSymbol = typeChecker.getSymbolAtLocation(referenceLocation); if (referenceSymbol) { let referenceSymbolDeclaration = referenceSymbol.valueDeclaration; - let shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration); + let shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration); var relatedSymbol = getRelatedSymbol(searchSymbols, referenceSymbol, referenceLocation); if (relatedSymbol) { @@ -5159,7 +5312,7 @@ module ts { // If the symbol is an alias, add what it alaises to the list if (isImportOrExportSpecifierImportSymbol(symbol)) { - result.push(typeInfoResolver.getAliasedSymbol(symbol)); + result.push(typeChecker.getAliasedSymbol(symbol)); } // If the location is in a context sensitive location (i.e. in an object literal) try @@ -5167,7 +5320,7 @@ module ts { // type to the search set if (isNameOfPropertyAssignment(location)) { forEach(getPropertySymbolsFromContextualType(location), contextualSymbol => { - result.push.apply(result, typeInfoResolver.getRootSymbols(contextualSymbol)); + result.push.apply(result, typeChecker.getRootSymbols(contextualSymbol)); }); /* Because in short-hand property assignment, location has two meaning : property name and as value of the property @@ -5181,7 +5334,7 @@ module ts { * so that when matching with potential reference symbol, both symbols from property declaration and variable declaration * will be included correctly. */ - let shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(location.parent); + let shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(location.parent); if (shorthandValueSymbol) { result.push(shorthandValueSymbol); } @@ -5189,7 +5342,7 @@ module ts { // If this is a union property, add all the symbols from all its source symbols in all unioned types. // If the symbol is an instantiation from a another symbol (e.g. widened symbol) , add the root the list - forEach(typeInfoResolver.getRootSymbols(symbol), rootSymbol => { + forEach(typeChecker.getRootSymbols(symbol), rootSymbol => { if (rootSymbol !== symbol) { result.push(rootSymbol); } @@ -5219,9 +5372,9 @@ module ts { function getPropertySymbolFromTypeReference(typeReference: HeritageClauseElement) { if (typeReference) { - let type = typeInfoResolver.getTypeAtLocation(typeReference); + let type = typeChecker.getTypeAtLocation(typeReference); if (type) { - let propertySymbol = typeInfoResolver.getPropertyOfType(type, propertyName); + let propertySymbol = typeChecker.getPropertyOfType(type, propertyName); if (propertySymbol) { result.push(propertySymbol); } @@ -5241,7 +5394,7 @@ module ts { // If the reference symbol is an alias, check if what it is aliasing is one of the search // symbols. if (isImportOrExportSpecifierImportSymbol(referenceSymbol)) { - var aliasedSymbol = typeInfoResolver.getAliasedSymbol(referenceSymbol); + var aliasedSymbol = typeChecker.getAliasedSymbol(referenceSymbol); if (searchSymbols.indexOf(aliasedSymbol) >= 0) { return aliasedSymbol; } @@ -5252,13 +5405,13 @@ module ts { // compare to our searchSymbol if (isNameOfPropertyAssignment(referenceLocation)) { return forEach(getPropertySymbolsFromContextualType(referenceLocation), contextualSymbol => { - return forEach(typeInfoResolver.getRootSymbols(contextualSymbol), s => searchSymbols.indexOf(s) >= 0 ? s : undefined); + return forEach(typeChecker.getRootSymbols(contextualSymbol), s => searchSymbols.indexOf(s) >= 0 ? s : undefined); }); } // Unwrap symbols to get to the root (e.g. transient symbols as a result of widening) // Or a union property, use its underlying unioned symbols - return forEach(typeInfoResolver.getRootSymbols(referenceSymbol), rootSymbol => { + return forEach(typeChecker.getRootSymbols(referenceSymbol), rootSymbol => { // if it is in the list, then we are done if (searchSymbols.indexOf(rootSymbol) >= 0) { return rootSymbol; @@ -5279,7 +5432,7 @@ module ts { function getPropertySymbolsFromContextualType(node: Node): Symbol[] { if (isNameOfPropertyAssignment(node)) { let objectLiteral = node.parent.parent; - let contextualType = typeInfoResolver.getContextualType(objectLiteral); + let contextualType = typeChecker.getContextualType(objectLiteral); let name = (node).text; if (contextualType) { if (contextualType.flags & TypeFlags.Union) { @@ -5571,7 +5724,7 @@ module ts { let sourceFile = getValidSourceFile(fileName); - return SignatureHelp.getSignatureHelpItems(sourceFile, position, typeInfoResolver, cancellationToken); + return SignatureHelp.getSignatureHelpItems(program, sourceFile, position, cancellationToken); } /// Syntactic features @@ -5652,6 +5805,7 @@ module ts { synchronizeHostData(); let sourceFile = getValidSourceFile(fileName); + let typeChecker = program.getTypeChecker(); let result: ClassifiedSpan[] = []; processNode(sourceFile); @@ -5704,7 +5858,7 @@ module ts { // Only walk into nodes that intersect the requested span. if (node && textSpanIntersectsWith(span, node.getStart(), node.getWidth())) { if (node.kind === SyntaxKind.Identifier && node.getWidth() > 0) { - let symbol = typeInfoResolver.getSymbolAtLocation(node); + let symbol = typeChecker.getSymbolAtLocation(node); if (symbol) { let type = classifySymbol(symbol, getMeaningFromLocation(node)); if (type) { @@ -6186,12 +6340,13 @@ module ts { synchronizeHostData(); let sourceFile = getValidSourceFile(fileName); + let typeChecker = program.getTypeChecker(); let node = getTouchingWord(sourceFile, position); // Can only rename an identifier. if (node && node.kind === SyntaxKind.Identifier) { - let symbol = typeInfoResolver.getSymbolAtLocation(node); + let symbol = typeChecker.getSymbolAtLocation(node); // Only allow a symbol to be renamed if it actually has at least one declaration. if (symbol) { @@ -6208,13 +6363,13 @@ module ts { } } - let kind = getSymbolKind(symbol, typeInfoResolver, node); + let kind = getSymbolKind(symbol, node); if (kind) { return { canRename: true, localizedErrorMessage: undefined, displayName: symbol.name, - fullDisplayName: typeInfoResolver.getFullyQualifiedName(symbol), + fullDisplayName: typeChecker.getFullyQualifiedName(symbol), kind: kind, kindModifiers: getSymbolModifiers(symbol), triggerSpan: createTextSpan(node.getStart(), node.getWidth()) @@ -6255,6 +6410,7 @@ module ts { getReferencesAtPosition, findReferences, getOccurrencesAtPosition, + getDocumentHighlights, getNameOrDottedNameSpan, getBreakpointStatementAtPosition, getNavigateToItems, diff --git a/src/services/shims.ts b/src/services/shims.ts index 7b5eeaf94d2..110090daf5c 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -15,8 +15,10 @@ /// +/* @internal */ var debugObjectHost = (this); +/* @internal */ module ts { export interface ScriptSnapshotShim { /** Gets a portion of the script snapshot specified by [start, end). */ @@ -135,11 +137,21 @@ module ts { findReferences(fileName: string, position: number): string; /** + * @deprecated * Returns a JSON-encoded value of the type: * { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean }[] */ getOccurrencesAtPosition(fileName: string, position: number): string; + /** + * Returns a JSON-encoded value of the type: + * { fileName: string; highlights: { start: number; length: number, isDefinition: boolean }[] }[] + * + * @param fileToSearch A JSON encoded string[] containing the file names that should be + * considered when searching. + */ + getDocumentHighlights(fileName: string, position: number, filesToSearch: string): string; + /** * Returns a JSON-encoded value of the type: * { name: string; kind: string; kindModifiers: string; containerName: string; containerKind: string; matchKind: string; fileName: string; textSpan: { start: number; length: number}; } [] = []; @@ -331,7 +343,6 @@ 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)); } @@ -590,6 +601,14 @@ module ts { }); } + public getDocumentHighlights(fileName: string, position: number, filesToSearch: string): string { + return this.forwardJSONCall( + "getDocumentHighlights('" + fileName + "', " + position + ")", + () => { + return this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch)); + }); + } + /// COMPLETION LISTS /** @@ -844,8 +863,10 @@ module ts { /// TODO: this is used by VS, clean this up on both sides of the interface +/* @internal */ module TypeScript.Services { export var TypeScriptServicesFactory = ts.TypeScriptServicesFactory; } +/* @internal */ let toolsVersion = "1.4"; diff --git a/src/services/signatureHelp.ts b/src/services/signatureHelp.ts index 419d4819ba6..77aba4c85c1 100644 --- a/src/services/signatureHelp.ts +++ b/src/services/signatureHelp.ts @@ -1,5 +1,5 @@ /// - +/* @internal */ module ts.SignatureHelp { // A partially written generic type expression is not guaranteed to have the correct syntax tree. the expression could be parsed as less than/greater than expression or a comma expression @@ -178,7 +178,9 @@ module ts.SignatureHelp { argumentCount: number; } - export function getSignatureHelpItems(sourceFile: SourceFile, position: number, typeInfoResolver: TypeChecker, cancellationToken: CancellationTokenObject): SignatureHelpItems { + export function getSignatureHelpItems(program: Program, sourceFile: SourceFile, position: number, cancellationToken: CancellationTokenObject): SignatureHelpItems { + let typeChecker = program.getTypeChecker(); + // Decide whether to show signature help let startingToken = findTokenOnLeftOfPosition(sourceFile, position); if (!startingToken) { @@ -196,15 +198,61 @@ module ts.SignatureHelp { let call = argumentInfo.invocation; let candidates = []; - let resolvedSignature = typeInfoResolver.getResolvedSignature(call, candidates); + let resolvedSignature = typeChecker.getResolvedSignature(call, candidates); cancellationToken.throwIfCancellationRequested(); if (!candidates.length) { + // We didn't have any sig help items produced by the TS compiler. If this is a JS + // file, then see if we can figure out anything better. + if (isJavaScript(sourceFile.fileName)) { + return createJavaScriptSignatureHelpItems(argumentInfo); + } + return undefined; } return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo); + function createJavaScriptSignatureHelpItems(argumentInfo: ArgumentListInfo): SignatureHelpItems { + if (argumentInfo.invocation.kind !== SyntaxKind.CallExpression) { + return undefined; + } + + // See if we can find some symbol with the call expression name that has call signatures. + let callExpression = argumentInfo.invocation; + let expression = callExpression.expression; + let name = expression.kind === SyntaxKind.Identifier + ? expression + : expression.kind === SyntaxKind.PropertyAccessExpression + ? (expression).name + : undefined; + + if (!name || !name.text) { + return undefined; + } + + let typeChecker = program.getTypeChecker(); + for (let sourceFile of program.getSourceFiles()) { + let nameToDeclarations = sourceFile.getNamedDeclarations(); + let declarations = getProperty(nameToDeclarations, name.text); + + if (declarations) { + for (let declaration of declarations) { + let symbol = declaration.symbol; + if (symbol) { + let type = typeChecker.getTypeOfSymbolAtLocation(symbol, declaration); + if (type) { + let callSignatures = type.getCallSignatures(); + if (callSignatures && callSignatures.length) { + return createSignatureHelpItems(callSignatures, callSignatures[0], argumentInfo); + } + } + } + } + } + } + } + /** * Returns relevant information for the argument list and the current argument if we are * in the argument of an invocation; returns undefined otherwise. @@ -494,8 +542,8 @@ module ts.SignatureHelp { let invocation = argumentListInfo.invocation; let callTarget = getInvokedExpression(invocation) - let callTargetSymbol = typeInfoResolver.getSymbolAtLocation(callTarget); - let callTargetDisplayParts = callTargetSymbol && symbolToDisplayParts(typeInfoResolver, callTargetSymbol, /*enclosingDeclaration*/ undefined, /*meaning*/ undefined); + let callTargetSymbol = typeChecker.getSymbolAtLocation(callTarget); + let callTargetDisplayParts = callTargetSymbol && symbolToDisplayParts(typeChecker, callTargetSymbol, /*enclosingDeclaration*/ undefined, /*meaning*/ undefined); let items: SignatureHelpItem[] = map(candidates, candidateSignature => { let signatureHelpParameters: SignatureHelpParameter[]; let prefixDisplayParts: SymbolDisplayPart[] = []; @@ -511,12 +559,12 @@ module ts.SignatureHelp { signatureHelpParameters = typeParameters && typeParameters.length > 0 ? map(typeParameters, createSignatureHelpParameterForTypeParameter) : emptyArray; suffixDisplayParts.push(punctuationPart(SyntaxKind.GreaterThanToken)); let parameterParts = mapToDisplayParts(writer => - typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, invocation)); + typeChecker.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, invocation)); suffixDisplayParts.push.apply(suffixDisplayParts, parameterParts); } else { let typeParameterParts = mapToDisplayParts(writer => - typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation)); + typeChecker.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation)); prefixDisplayParts.push.apply(prefixDisplayParts, typeParameterParts); prefixDisplayParts.push(punctuationPart(SyntaxKind.OpenParenToken)); @@ -526,7 +574,7 @@ module ts.SignatureHelp { } let returnTypeParts = mapToDisplayParts(writer => - typeInfoResolver.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation)); + typeChecker.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation)); suffixDisplayParts.push.apply(suffixDisplayParts, returnTypeParts); return { @@ -561,7 +609,7 @@ module ts.SignatureHelp { function createSignatureHelpParameterForParameter(parameter: Symbol): SignatureHelpParameter { let displayParts = mapToDisplayParts(writer => - typeInfoResolver.getSymbolDisplayBuilder().buildParameterDisplay(parameter, writer, invocation)); + typeChecker.getSymbolDisplayBuilder().buildParameterDisplay(parameter, writer, invocation)); let isOptional = hasQuestionToken(parameter.valueDeclaration); @@ -575,7 +623,7 @@ module ts.SignatureHelp { function createSignatureHelpParameterForTypeParameter(typeParameter: TypeParameter): SignatureHelpParameter { let displayParts = mapToDisplayParts(writer => - typeInfoResolver.getSymbolDisplayBuilder().buildTypeParameterDisplay(typeParameter, writer, invocation)); + typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(typeParameter, writer, invocation)); return { name: typeParameter.symbol.name, diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 719aa658724..5e1460bbdcd 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -1,4 +1,5 @@ // These utilities are common to multiple language service features. +/* @internal */ module ts { export interface ListItemInfo { listItemIndex: number; @@ -500,6 +501,7 @@ module ts { } // Display-part writer helpers +/* @internal */ module ts { export function isFirstDeclarationOfSymbolParameter(symbol: Symbol) { return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === SyntaxKind.Parameter; @@ -650,4 +652,8 @@ module ts { typechecker.getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags); }); } + + export function isJavaScript(fileName: string) { + return fileExtensionIs(fileName, ".js"); + } } \ No newline at end of file diff --git a/tests/baselines/reference/2dArrays.symbols b/tests/baselines/reference/2dArrays.symbols new file mode 100644 index 00000000000..c069f2dae8c --- /dev/null +++ b/tests/baselines/reference/2dArrays.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/2dArrays.ts === +class Cell { +>Cell : Symbol(Cell, Decl(2dArrays.ts, 0, 0)) +} + +class Ship { +>Ship : Symbol(Ship, Decl(2dArrays.ts, 1, 1)) + + isSunk: boolean; +>isSunk : Symbol(isSunk, Decl(2dArrays.ts, 3, 12)) +} + +class Board { +>Board : Symbol(Board, Decl(2dArrays.ts, 5, 1)) + + ships: Ship[]; +>ships : Symbol(ships, Decl(2dArrays.ts, 7, 13)) +>Ship : Symbol(Ship, Decl(2dArrays.ts, 1, 1)) + + cells: Cell[]; +>cells : Symbol(cells, Decl(2dArrays.ts, 8, 18)) +>Cell : Symbol(Cell, Decl(2dArrays.ts, 0, 0)) + + private allShipsSunk() { +>allShipsSunk : Symbol(allShipsSunk, Decl(2dArrays.ts, 9, 18)) + + return this.ships.every(function (val) { return val.isSunk; }); +>this.ships.every : Symbol(Array.every, Decl(lib.d.ts, 1094, 62)) +>this.ships : Symbol(ships, Decl(2dArrays.ts, 7, 13)) +>this : Symbol(Board, Decl(2dArrays.ts, 5, 1)) +>ships : Symbol(ships, Decl(2dArrays.ts, 7, 13)) +>every : Symbol(Array.every, Decl(lib.d.ts, 1094, 62)) +>val : Symbol(val, Decl(2dArrays.ts, 12, 42)) +>val.isSunk : Symbol(Ship.isSunk, Decl(2dArrays.ts, 3, 12)) +>val : Symbol(val, Decl(2dArrays.ts, 12, 42)) +>isSunk : Symbol(Ship.isSunk, Decl(2dArrays.ts, 3, 12)) + } +} diff --git a/tests/baselines/reference/APISample_compile.types b/tests/baselines/reference/APISample_compile.types deleted file mode 100644 index 7ccbae38212..00000000000 --- a/tests/baselines/reference/APISample_compile.types +++ /dev/null @@ -1,158 +0,0 @@ -=== tests/cases/compiler/APISample_compile.ts === - -/* - * Note: This test is a public API sample. The sample sources can be found - at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#a-minimal-compiler - * 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 os: any; ->os : any - -import ts = require("typescript"); ->ts : typeof ts - -export function compile(fileNames: string[], options: ts.CompilerOptions): void { ->compile : (fileNames: string[], options: ts.CompilerOptions) => void ->fileNames : string[] ->options : ts.CompilerOptions ->ts : unknown ->CompilerOptions : ts.CompilerOptions - - var program = ts.createProgram(fileNames, options); ->program : ts.Program ->ts.createProgram(fileNames, options) : 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 ->fileNames : string[] ->options : ts.CompilerOptions - - 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 - - var allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics); ->allDiagnostics : ts.Diagnostic[] ->ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics) : ts.Diagnostic[] ->ts.getPreEmitDiagnostics(program).concat : { (...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): 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 ->concat : { (...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; } ->emitResult.diagnostics : ts.Diagnostic[] ->emitResult : ts.EmitResult ->diagnostics : ts.Diagnostic[] - - allDiagnostics.forEach(diagnostic => { ->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 { 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 { 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 ->diagnostic : ts.Diagnostic ->file : ts.SourceFile ->getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter ->diagnostic.start : number ->diagnostic : ts.Diagnostic ->start : number - - 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 ->diagnostic.file.fileName : string ->diagnostic.file : ts.SourceFile ->diagnostic : ts.Diagnostic ->file : ts.SourceFile ->fileName : string ->line + 1 : number ->line : number ->character + 1 : number ->character : number ->message : string - - }); - - var exitCode = emitResult.emitSkipped ? 1 : 0; ->exitCode : number ->emitResult.emitSkipped ? 1 : 0 : number ->emitResult.emitSkipped : boolean ->emitResult : ts.EmitResult ->emitSkipped : boolean - - console.log(`Process exiting with code '${exitCode}'.`); ->console.log(`Process exiting with code '${exitCode}'.`) : any ->console.log : any ->console : any ->log : any ->exitCode : number - - process.exit(exitCode); ->process.exit(exitCode) : any ->process.exit : any ->process : any ->exit : any ->exitCode : number -} - -compile(process.argv.slice(2), { ->compile(process.argv.slice(2), { noEmitOnError: true, noImplicitAny: true, target: ts.ScriptTarget.ES5, module: ts.ModuleKind.CommonJS}) : void ->compile : (fileNames: string[], options: ts.CompilerOptions) => void ->process.argv.slice(2) : any ->process.argv.slice : any ->process.argv : any ->process : any ->argv : any ->slice : any ->{ noEmitOnError: true, noImplicitAny: true, target: ts.ScriptTarget.ES5, module: ts.ModuleKind.CommonJS} : { [x: string]: boolean | ts.ScriptTarget | ts.ModuleKind; noEmitOnError: boolean; noImplicitAny: boolean; target: ts.ScriptTarget; module: ts.ModuleKind; } - - noEmitOnError: true, noImplicitAny: true, ->noEmitOnError : boolean ->noImplicitAny : boolean - - target: ts.ScriptTarget.ES5, module: ts.ModuleKind.CommonJS ->target : ts.ScriptTarget ->ts.ScriptTarget.ES5 : ts.ScriptTarget ->ts.ScriptTarget : typeof ts.ScriptTarget ->ts : typeof ts ->ScriptTarget : typeof ts.ScriptTarget ->ES5 : ts.ScriptTarget ->module : ts.ModuleKind ->ts.ModuleKind.CommonJS : ts.ModuleKind ->ts.ModuleKind : typeof ts.ModuleKind ->ts : typeof ts ->ModuleKind : typeof ts.ModuleKind ->CommonJS : ts.ModuleKind - -}); diff --git a/tests/baselines/reference/APISample_linter.types b/tests/baselines/reference/APISample_linter.types deleted file mode 100644 index 609f08f3a76..00000000000 --- a/tests/baselines/reference/APISample_linter.types +++ /dev/null @@ -1,303 +0,0 @@ -=== tests/cases/compiler/APISample_linter.ts === - -/* - * Note: This test is a public API sample. The sample sources can be found - at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#traversing-the-ast-with-a-little-linter - * 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 readFileSync: any; ->readFileSync : any - -import * as ts from "typescript"; ->ts : typeof ts - -export function delint(sourceFile: ts.SourceFile) { ->delint : (sourceFile: ts.SourceFile) => void ->sourceFile : ts.SourceFile ->ts : unknown ->SourceFile : ts.SourceFile - - delintNode(sourceFile); ->delintNode(sourceFile) : void ->delintNode : (node: ts.Node) => void ->sourceFile : ts.SourceFile - - function delintNode(node: ts.Node) { ->delintNode : (node: ts.Node) => void ->node : ts.Node ->ts : unknown ->Node : ts.Node - - switch (node.kind) { ->node.kind : ts.SyntaxKind ->node : ts.Node ->kind : ts.SyntaxKind - - case ts.SyntaxKind.ForStatement: ->ts.SyntaxKind.ForStatement : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->ForStatement : ts.SyntaxKind - - case ts.SyntaxKind.ForInStatement: ->ts.SyntaxKind.ForInStatement : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->ForInStatement : ts.SyntaxKind - - case ts.SyntaxKind.WhileStatement: ->ts.SyntaxKind.WhileStatement : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->WhileStatement : ts.SyntaxKind - - case ts.SyntaxKind.DoStatement: ->ts.SyntaxKind.DoStatement : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->DoStatement : ts.SyntaxKind - - if ((node).statement.kind !== ts.SyntaxKind.Block) { ->(node).statement.kind !== ts.SyntaxKind.Block : boolean ->(node).statement.kind : ts.SyntaxKind ->(node).statement : ts.Statement ->(node) : ts.IterationStatement ->node : ts.IterationStatement ->ts : unknown ->IterationStatement : ts.IterationStatement ->node : ts.Node ->statement : ts.Statement ->kind : ts.SyntaxKind ->ts.SyntaxKind.Block : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->Block : ts.SyntaxKind - - report(node, "A looping statement's contents should be wrapped in a block body."); ->report(node, "A looping statement's contents should be wrapped in a block body.") : void ->report : (node: ts.Node, message: string) => void ->node : ts.Node - } - break; - - case ts.SyntaxKind.IfStatement: ->ts.SyntaxKind.IfStatement : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->IfStatement : ts.SyntaxKind - - let ifStatement = (node); ->ifStatement : ts.IfStatement ->(node) : ts.IfStatement ->node : ts.IfStatement ->ts : unknown ->IfStatement : ts.IfStatement ->node : ts.Node - - if (ifStatement.thenStatement.kind !== ts.SyntaxKind.Block) { ->ifStatement.thenStatement.kind !== ts.SyntaxKind.Block : boolean ->ifStatement.thenStatement.kind : ts.SyntaxKind ->ifStatement.thenStatement : ts.Statement ->ifStatement : ts.IfStatement ->thenStatement : ts.Statement ->kind : ts.SyntaxKind ->ts.SyntaxKind.Block : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->Block : ts.SyntaxKind - - report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body."); ->report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body.") : void ->report : (node: ts.Node, message: string) => void ->ifStatement.thenStatement : ts.Statement ->ifStatement : ts.IfStatement ->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 : boolean ->ifStatement.elseStatement : ts.Statement ->ifStatement : ts.IfStatement ->elseStatement : ts.Statement - - ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && ->ifStatement.elseStatement.kind !== ts.SyntaxKind.Block : boolean ->ifStatement.elseStatement.kind : ts.SyntaxKind ->ifStatement.elseStatement : ts.Statement ->ifStatement : ts.IfStatement ->elseStatement : ts.Statement ->kind : ts.SyntaxKind ->ts.SyntaxKind.Block : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->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 ->ifStatement : ts.IfStatement ->elseStatement : ts.Statement ->kind : ts.SyntaxKind ->ts.SyntaxKind.IfStatement : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->IfStatement : ts.SyntaxKind - - report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body."); ->report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body.") : void ->report : (node: ts.Node, message: string) => void ->ifStatement.elseStatement : ts.Statement ->ifStatement : ts.IfStatement ->elseStatement : ts.Statement - } - break; - - case ts.SyntaxKind.BinaryExpression: ->ts.SyntaxKind.BinaryExpression : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->BinaryExpression : ts.SyntaxKind - - let op = (node).operatorToken.kind; ->op : ts.SyntaxKind ->(node).operatorToken.kind : ts.SyntaxKind ->(node).operatorToken : ts.Node ->(node) : ts.BinaryExpression ->node : ts.BinaryExpression ->ts : unknown ->BinaryExpression : ts.BinaryExpression ->node : ts.Node ->operatorToken : ts.Node ->kind : ts.SyntaxKind - - 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 ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->EqualsEqualsToken : ts.SyntaxKind ->op == ts.SyntaxKind.ExclamationEqualsToken : boolean ->op : ts.SyntaxKind ->ts.SyntaxKind.ExclamationEqualsToken : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->ExclamationEqualsToken : ts.SyntaxKind - - report(node, "Use '===' and '!=='.") ->report(node, "Use '===' and '!=='.") : void ->report : (node: ts.Node, message: string) => void ->node : ts.Node - } - break; - } - - ts.forEachChild(node, delintNode); ->ts.forEachChild(node, delintNode) : void ->ts.forEachChild : (node: ts.Node, cbNode: (node: ts.Node) => T, cbNodeArray?: (nodes: ts.Node[]) => T) => T ->ts : typeof ts ->forEachChild : (node: ts.Node, cbNode: (node: ts.Node) => T, cbNodeArray?: (nodes: ts.Node[]) => T) => T ->node : ts.Node ->delintNode : (node: ts.Node) => void - } - - function report(node: ts.Node, message: string) { ->report : (node: ts.Node, message: string) => void ->node : ts.Node ->ts : unknown ->Node : ts.Node ->message : string - - 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 ->getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter ->node.getStart() : number ->node.getStart : (sourceFile?: ts.SourceFile) => number ->node : ts.Node ->getStart : (sourceFile?: ts.SourceFile) => number - - 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 ->line + 1 : number ->line : number ->character + 1 : number ->character : number ->message : string - } -} - -const fileNames = process.argv.slice(2); ->fileNames : any ->process.argv.slice(2) : any ->process.argv.slice : any ->process.argv : any ->process : any ->argv : any ->slice : any - -fileNames.forEach(fileName => { ->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 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 - let sourceFile = ts.createSourceFile(fileName, readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); ->sourceFile : 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 ->readFileSync(fileName).toString() : any ->readFileSync(fileName).toString : any ->readFileSync(fileName) : any ->readFileSync : any ->fileName : any ->toString : any ->ts.ScriptTarget.ES6 : ts.ScriptTarget ->ts.ScriptTarget : typeof ts.ScriptTarget ->ts : typeof ts ->ScriptTarget : typeof ts.ScriptTarget ->ES6 : ts.ScriptTarget - - // delint it - delint(sourceFile); ->delint(sourceFile) : void ->delint : (sourceFile: ts.SourceFile) => void ->sourceFile : ts.SourceFile - -}); diff --git a/tests/baselines/reference/APISample_transform.types b/tests/baselines/reference/APISample_transform.types deleted file mode 100644 index d98d2cfad00..00000000000 --- a/tests/baselines/reference/APISample_transform.types +++ /dev/null @@ -1,43 +0,0 @@ -=== tests/cases/compiler/APISample_transform.ts === - -/* - * Note: This test is a public API sample. The sample sources can be found - at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#a-simple-transform-function - * Please log a "breaking change" issue for any API breaking change affecting this issue - */ - -declare var console: any; ->console : any - -import * as ts from "typescript"; ->ts : typeof ts - -const source = "let x: string = 'string'"; ->source : 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 ->console.log : any ->console : any ->log : any ->JSON.stringify(result) : string ->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 : string - diff --git a/tests/baselines/reference/APISample_watcher.types b/tests/baselines/reference/APISample_watcher.types deleted file mode 100644 index 5f123ea839b..00000000000 --- a/tests/baselines/reference/APISample_watcher.types +++ /dev/null @@ -1,428 +0,0 @@ -=== tests/cases/compiler/APISample_watcher.ts === - -/* - * Note: This test is a public API sample. The sample sources can be found - at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#incremental-build-support-using-the-language-services - * 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 - -import * as ts from "typescript"; ->ts : typeof ts - -function watch(rootFileNames: string[], options: ts.CompilerOptions) { ->watch : (rootFileNames: string[], options: ts.CompilerOptions) => void ->rootFileNames : string[] ->options : ts.CompilerOptions ->ts : unknown ->CompilerOptions : ts.CompilerOptions - - const files: ts.Map<{ version: number }> = {}; ->files : ts.Map<{ version: number; }> ->ts : unknown ->Map : ts.Map ->version : number ->{} : { [x: string]: undefined; } - - // initialize the list of files - rootFileNames.forEach(fileName => { ->rootFileNames.forEach(fileName => { files[fileName] = { version: 0 }; }) : void ->rootFileNames.forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void ->rootFileNames : string[] ->forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void ->fileName => { files[fileName] = { version: 0 }; } : (fileName: string) => void ->fileName : string - - files[fileName] = { version: 0 }; ->files[fileName] = { version: 0 } : { version: number; } ->files[fileName] : { version: number; } ->files : ts.Map<{ version: number; }> ->fileName : string ->{ version: 0 } : { version: number; } ->version : number - - }); - - // Create the language service host to allow the LS to communicate with the host - const servicesHost: ts.LanguageServiceHost = { ->servicesHost : ts.LanguageServiceHost ->ts : unknown ->LanguageServiceHost : ts.LanguageServiceHost ->{ getScriptFileNames: () => rootFileNames, getScriptVersion: (fileName) => files[fileName] && files[fileName].version.toString(), getScriptSnapshot: (fileName) => { if (!fs.existsSync(fileName)) { return undefined; } return ts.ScriptSnapshot.fromString(fs.readFileSync(fileName).toString()); }, getCurrentDirectory: () => process.cwd(), getCompilationSettings: () => options, getDefaultLibFileName: (options) => ts.getDefaultLibFilePath(options), } : { getScriptFileNames: () => string[]; getScriptVersion: (fileName: string) => string; getScriptSnapshot: (fileName: string) => ts.IScriptSnapshot; getCurrentDirectory: () => any; getCompilationSettings: () => ts.CompilerOptions; getDefaultLibFileName: (options: ts.CompilerOptions) => string; } - - getScriptFileNames: () => rootFileNames, ->getScriptFileNames : () => string[] ->() => rootFileNames : () => string[] ->rootFileNames : string[] - - getScriptVersion: (fileName) => files[fileName] && files[fileName].version.toString(), ->getScriptVersion : (fileName: string) => string ->(fileName) => files[fileName] && files[fileName].version.toString() : (fileName: string) => string ->fileName : string ->files[fileName] && files[fileName].version.toString() : string ->files[fileName] : { version: number; } ->files : ts.Map<{ version: number; }> ->fileName : string ->files[fileName].version.toString() : string ->files[fileName].version.toString : (radix?: number) => string ->files[fileName].version : number ->files[fileName] : { version: number; } ->files : ts.Map<{ version: number; }> ->fileName : string ->version : number ->toString : (radix?: number) => string - - getScriptSnapshot: (fileName) => { ->getScriptSnapshot : (fileName: string) => ts.IScriptSnapshot ->(fileName) => { if (!fs.existsSync(fileName)) { return undefined; } return ts.ScriptSnapshot.fromString(fs.readFileSync(fileName).toString()); } : (fileName: string) => ts.IScriptSnapshot ->fileName : string - - if (!fs.existsSync(fileName)) { ->!fs.existsSync(fileName) : boolean ->fs.existsSync(fileName) : any ->fs.existsSync : any ->fs : any ->existsSync : any ->fileName : string - - return undefined; ->undefined : undefined - } - - return ts.ScriptSnapshot.fromString(fs.readFileSync(fileName).toString()); ->ts.ScriptSnapshot.fromString(fs.readFileSync(fileName).toString()) : ts.IScriptSnapshot ->ts.ScriptSnapshot.fromString : (text: string) => ts.IScriptSnapshot ->ts.ScriptSnapshot : typeof ts.ScriptSnapshot ->ts : typeof ts ->ScriptSnapshot : typeof ts.ScriptSnapshot ->fromString : (text: string) => ts.IScriptSnapshot ->fs.readFileSync(fileName).toString() : any ->fs.readFileSync(fileName).toString : any ->fs.readFileSync(fileName) : any ->fs.readFileSync : any ->fs : any ->readFileSync : any ->fileName : string ->toString : any - - }, - getCurrentDirectory: () => process.cwd(), ->getCurrentDirectory : () => any ->() => process.cwd() : () => any ->process.cwd() : any ->process.cwd : any ->process : any ->cwd : any - - getCompilationSettings: () => options, ->getCompilationSettings : () => ts.CompilerOptions ->() => options : () => ts.CompilerOptions ->options : ts.CompilerOptions - - getDefaultLibFileName: (options) => ts.getDefaultLibFilePath(options), ->getDefaultLibFileName : (options: ts.CompilerOptions) => string ->(options) => ts.getDefaultLibFilePath(options) : (options: ts.CompilerOptions) => string ->options : ts.CompilerOptions ->ts.getDefaultLibFilePath(options) : string ->ts.getDefaultLibFilePath : (options: ts.CompilerOptions) => string ->ts : typeof ts ->getDefaultLibFilePath : (options: ts.CompilerOptions) => string ->options : ts.CompilerOptions - - }; - - // Create the language service files - 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 ->ts : typeof ts ->createLanguageService : (host: ts.LanguageServiceHost, documentRegistry?: ts.DocumentRegistry) => ts.LanguageService ->servicesHost : ts.LanguageServiceHost ->ts.createDocumentRegistry() : ts.DocumentRegistry ->ts.createDocumentRegistry : () => ts.DocumentRegistry ->ts : typeof ts ->createDocumentRegistry : () => ts.DocumentRegistry - - // Now let's watch the files - rootFileNames.forEach(fileName => { ->rootFileNames.forEach(fileName => { // 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 }, (curr, prev) => { // Check timestamp if (+curr.mtime <= +prev.mtime) { return; } // Update the version to signal a change in the file files[fileName].version++; // write the changes to disk emitFile(fileName); }); }) : void ->rootFileNames.forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void ->rootFileNames : string[] ->forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void ->fileName => { // 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 }, (curr, prev) => { // Check timestamp if (+curr.mtime <= +prev.mtime) { return; } // Update the version to signal a change in the file files[fileName].version++; // write the changes to disk emitFile(fileName); }); } : (fileName: string) => void ->fileName : string - - // First time around, emit all files - emitFile(fileName); ->emitFile(fileName) : void ->emitFile : (fileName: string) => void ->fileName : string - - // Add a watch on the file to handle next change - fs.watchFile(fileName, ->fs.watchFile(fileName, { persistent: true, interval: 250 }, (curr, prev) => { // Check timestamp if (+curr.mtime <= +prev.mtime) { return; } // Update the version to signal a change in the file files[fileName].version++; // write the changes to disk emitFile(fileName); }) : any ->fs.watchFile : any ->fs : any ->watchFile : any ->fileName : string - - { persistent: true, interval: 250 }, ->{ persistent: true, interval: 250 } : { persistent: boolean; interval: number; } ->persistent : boolean ->interval : number - - (curr, prev) => { ->(curr, prev) => { // Check timestamp if (+curr.mtime <= +prev.mtime) { return; } // Update the version to signal a change in the file files[fileName].version++; // write the changes to disk emitFile(fileName); } : (curr: any, prev: any) => void ->curr : any ->prev : any - - // Check timestamp - if (+curr.mtime <= +prev.mtime) { ->+curr.mtime <= +prev.mtime : boolean ->+curr.mtime : number ->curr.mtime : any ->curr : any ->mtime : any ->+prev.mtime : number ->prev.mtime : any ->prev : any ->mtime : any - - return; - } - - // Update the version to signal a change in the file - files[fileName].version++; ->files[fileName].version++ : number ->files[fileName].version : number ->files[fileName] : { version: number; } ->files : ts.Map<{ version: number; }> ->fileName : string ->version : number - - // write the changes to disk - emitFile(fileName); ->emitFile(fileName) : void ->emitFile : (fileName: string) => void ->fileName : string - - }); - }); - - function emitFile(fileName: string) { ->emitFile : (fileName: string) => void ->fileName : string - - let output = services.getEmitOutput(fileName); ->output : ts.EmitOutput ->services.getEmitOutput(fileName) : ts.EmitOutput ->services.getEmitOutput : (fileName: string) => ts.EmitOutput ->services : ts.LanguageService ->getEmitOutput : (fileName: string) => ts.EmitOutput ->fileName : string - - if (!output.emitSkipped) { ->!output.emitSkipped : boolean ->output.emitSkipped : boolean ->output : ts.EmitOutput ->emitSkipped : boolean - - console.log(`Emitting ${fileName}`); ->console.log(`Emitting ${fileName}`) : any ->console.log : any ->console : any ->log : any ->fileName : string - } - else { - console.log(`Emitting ${fileName} failed`); ->console.log(`Emitting ${fileName} failed`) : any ->console.log : any ->console : any ->log : any ->fileName : string - - logErrors(fileName); ->logErrors(fileName) : void ->logErrors : (fileName: string) => void ->fileName : string - } - - output.outputFiles.forEach(o => { ->output.outputFiles.forEach(o => { fs.writeFileSync(o.name, o.text, "utf8"); }) : void ->output.outputFiles.forEach : (callbackfn: (value: ts.OutputFile, index: number, array: ts.OutputFile[]) => void, thisArg?: any) => void ->output.outputFiles : ts.OutputFile[] ->output : ts.EmitOutput ->outputFiles : ts.OutputFile[] ->forEach : (callbackfn: (value: ts.OutputFile, index: number, array: ts.OutputFile[]) => void, thisArg?: any) => void ->o => { fs.writeFileSync(o.name, o.text, "utf8"); } : (o: ts.OutputFile) => void ->o : ts.OutputFile - - fs.writeFileSync(o.name, o.text, "utf8"); ->fs.writeFileSync(o.name, o.text, "utf8") : any ->fs.writeFileSync : any ->fs : any ->writeFileSync : any ->o.name : string ->o : ts.OutputFile ->name : string ->o.text : string ->o : ts.OutputFile ->text : string - - }); - } - - function logErrors(fileName: string) { ->logErrors : (fileName: string) => void ->fileName : string - - 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[]; } ->services.getCompilerOptionsDiagnostics() .concat(services.getSyntacticDiagnostics(fileName)) : ts.Diagnostic[] ->services.getCompilerOptionsDiagnostics() .concat : { (...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; } ->services.getCompilerOptionsDiagnostics() : ts.Diagnostic[] ->services.getCompilerOptionsDiagnostics : () => ts.Diagnostic[] ->services : ts.LanguageService ->getCompilerOptionsDiagnostics : () => ts.Diagnostic[] - - .concat(services.getSyntacticDiagnostics(fileName)) ->concat : { (...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; } ->services.getSyntacticDiagnostics(fileName) : ts.Diagnostic[] ->services.getSyntacticDiagnostics : (fileName: string) => ts.Diagnostic[] ->services : ts.LanguageService ->getSyntacticDiagnostics : (fileName: string) => ts.Diagnostic[] ->fileName : string - - .concat(services.getSemanticDiagnostics(fileName)); ->concat : { (...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; } ->services.getSemanticDiagnostics(fileName) : ts.Diagnostic[] ->services.getSemanticDiagnostics : (fileName: string) => ts.Diagnostic[] ->services : ts.LanguageService ->getSemanticDiagnostics : (fileName: string) => ts.Diagnostic[] ->fileName : string - - allDiagnostics.forEach(diagnostic => { ->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 => { 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 - - 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 ->diagnostic : ts.Diagnostic ->file : ts.SourceFile ->getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter ->diagnostic.start : number ->diagnostic : ts.Diagnostic ->start : number - - 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 ->diagnostic.file.fileName : string ->diagnostic.file : ts.SourceFile ->diagnostic : ts.Diagnostic ->file : ts.SourceFile ->fileName : string ->line + 1 : number ->line : number ->character + 1 : number ->character : number ->message : string - } - else { - console.log(` Error: ${message}`); ->console.log(` Error: ${message}`) : any ->console.log : any ->console : any ->log : any ->message : string - } - }); - } -} - -// Initialize files constituting the program as all .ts files in the current directory -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 ->fs.readdirSync(process.cwd()) : any ->fs.readdirSync : any ->fs : any ->readdirSync : any ->process.cwd() : any ->process.cwd : any ->process : any ->cwd : any - - filter(fileName=> fileName.length >= 3 && fileName.substr(fileName.length - 3, 3) === ".ts"); ->filter : any ->fileName=> fileName.length >= 3 && fileName.substr(fileName.length - 3, 3) === ".ts" : (fileName: any) => boolean ->fileName : any ->fileName.length >= 3 && fileName.substr(fileName.length - 3, 3) === ".ts" : boolean ->fileName.length >= 3 : boolean ->fileName.length : any ->fileName : any ->length : any ->fileName.substr(fileName.length - 3, 3) === ".ts" : boolean ->fileName.substr(fileName.length - 3, 3) : any ->fileName.substr : any ->fileName : any ->substr : any ->fileName.length - 3 : number ->fileName.length : any ->fileName : any ->length : any - -// Start the watcher -watch(currentDirectoryFiles, { module: ts.ModuleKind.CommonJS }); ->watch(currentDirectoryFiles, { module: ts.ModuleKind.CommonJS }) : void ->watch : (rootFileNames: string[], options: ts.CompilerOptions) => void ->currentDirectoryFiles : any ->{ 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 - diff --git a/tests/baselines/reference/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.symbols b/tests/baselines/reference/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.symbols new file mode 100644 index 00000000000..cc0e8c5e746 --- /dev/null +++ b/tests/baselines/reference/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.symbols @@ -0,0 +1,32 @@ +=== tests/cases/conformance/internalModules/DeclarationMerging/module.d.ts === +declare module Point { +>Point : Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.d.ts, 0, 0)) + + export var Origin: { x: number; y: number; } +>Origin : Symbol(Origin, Decl(module.d.ts, 1, 14)) +>x : Symbol(x, Decl(module.d.ts, 1, 24)) +>y : Symbol(y, Decl(module.d.ts, 1, 35)) +} + +=== tests/cases/conformance/internalModules/DeclarationMerging/function.d.ts === +declare function Point(): { x: number; y: number; } +>Point : Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.d.ts, 0, 0)) +>x : Symbol(x, Decl(function.d.ts, 0, 27)) +>y : Symbol(y, Decl(function.d.ts, 0, 38)) + +=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts === +var cl: { x: number; y: number; } +>cl : Symbol(cl, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3)) +>x : Symbol(x, Decl(test.ts, 0, 9)) +>y : Symbol(y, Decl(test.ts, 0, 20)) + +var cl = Point(); +>cl : Symbol(cl, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3)) +>Point : Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.d.ts, 0, 0)) + +var cl = Point.Origin; +>cl : Symbol(cl, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3)) +>Point.Origin : Symbol(Point.Origin, Decl(module.d.ts, 1, 14)) +>Point : Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.d.ts, 0, 0)) +>Origin : Symbol(Point.Origin, Decl(module.d.ts, 1, 14)) + diff --git a/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.symbols b/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.symbols new file mode 100644 index 00000000000..2a24e5df919 --- /dev/null +++ b/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.symbols @@ -0,0 +1,58 @@ +=== tests/cases/conformance/internalModules/DeclarationMerging/module.d.ts === +declare module A { +>A : Symbol(A, Decl(module.d.ts, 0, 0), Decl(class.d.ts, 0, 0)) + + export module Point { +>Point : Symbol(Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18)) + + export var Origin: { +>Origin : Symbol(Origin, Decl(module.d.ts, 2, 18)) + + x: number; +>x : Symbol(x, Decl(module.d.ts, 2, 28)) + + y: number; +>y : Symbol(y, Decl(module.d.ts, 3, 22)) + } + } +} + +=== tests/cases/conformance/internalModules/DeclarationMerging/class.d.ts === +declare module A { +>A : Symbol(A, Decl(module.d.ts, 0, 0), Decl(class.d.ts, 0, 0)) + + export class Point { +>Point : Symbol(Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18)) + + constructor(x: number, y: number); +>x : Symbol(x, Decl(class.d.ts, 2, 20)) +>y : Symbol(y, Decl(class.d.ts, 2, 30)) + + x: number; +>x : Symbol(x, Decl(class.d.ts, 2, 42)) + + y: number; +>y : Symbol(y, Decl(class.d.ts, 3, 18)) + } +} + +=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts === +var p: { x: number; y: number; } +>p : Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3)) +>x : Symbol(x, Decl(test.ts, 0, 8)) +>y : Symbol(y, Decl(test.ts, 0, 19)) + +var p = A.Point.Origin; +>p : Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3)) +>A.Point.Origin : Symbol(A.Point.Origin, Decl(module.d.ts, 2, 18)) +>A.Point : Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18)) +>A : Symbol(A, Decl(module.d.ts, 0, 0), Decl(class.d.ts, 0, 0)) +>Point : Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18)) +>Origin : Symbol(A.Point.Origin, Decl(module.d.ts, 2, 18)) + +var p = new A.Point(0, 0); // unexpected error here, bug 840000 +>p : Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3)) +>A.Point : Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18)) +>A : Symbol(A, Decl(module.d.ts, 0, 0), Decl(class.d.ts, 0, 0)) +>Point : Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18)) + diff --git a/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.types b/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.types index 8846d2c3a37..fec7593a993 100644 --- a/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.types +++ b/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.types @@ -56,4 +56,6 @@ var p = new A.Point(0, 0); // unexpected error here, bug 840000 >A.Point : typeof A.Point >A : typeof A >Point : typeof A.Point +>0 : number +>0 : number diff --git a/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.symbols b/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.symbols new file mode 100644 index 00000000000..09762fd1406 --- /dev/null +++ b/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.symbols @@ -0,0 +1,52 @@ +=== tests/cases/conformance/internalModules/DeclarationMerging/module.d.ts === +declare module A { +>A : Symbol(A, Decl(module.d.ts, 0, 0), Decl(classPoint.ts, 0, 0)) + + export module Point { +>Point : Symbol(Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10)) + + export var Origin: { +>Origin : Symbol(Origin, Decl(module.d.ts, 2, 18)) + + x: number; +>x : Symbol(x, Decl(module.d.ts, 2, 28)) + + y: number; +>y : Symbol(y, Decl(module.d.ts, 3, 22)) + } + } +} + +=== tests/cases/conformance/internalModules/DeclarationMerging/classPoint.ts === +module A { +>A : Symbol(A, Decl(module.d.ts, 0, 0), Decl(classPoint.ts, 0, 0)) + + export class Point { +>Point : Symbol(Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10)) + + constructor(public x: number, public y: number) { } +>x : Symbol(x, Decl(classPoint.ts, 2, 20)) +>y : Symbol(y, Decl(classPoint.ts, 2, 37)) + } +} + +=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts === +var p: { x: number; y: number; } +>p : Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3)) +>x : Symbol(x, Decl(test.ts, 0, 8)) +>y : Symbol(y, Decl(test.ts, 0, 19)) + +var p = A.Point.Origin; +>p : Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3)) +>A.Point.Origin : Symbol(A.Point.Origin, Decl(module.d.ts, 2, 18)) +>A.Point : Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10)) +>A : Symbol(A, Decl(module.d.ts, 0, 0), Decl(classPoint.ts, 0, 0)) +>Point : Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10)) +>Origin : Symbol(A.Point.Origin, Decl(module.d.ts, 2, 18)) + +var p = new A.Point(0, 0); // unexpected error here, bug 840000 +>p : Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3)) +>A.Point : Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10)) +>A : Symbol(A, Decl(module.d.ts, 0, 0), Decl(classPoint.ts, 0, 0)) +>Point : Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10)) + diff --git a/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.types b/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.types index 975f0f65a68..cd57c0c503d 100644 --- a/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.types +++ b/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.types @@ -50,4 +50,6 @@ var p = new A.Point(0, 0); // unexpected error here, bug 840000 >A.Point : typeof A.Point >A : typeof A >Point : typeof A.Point +>0 : number +>0 : number diff --git a/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.symbols b/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.symbols new file mode 100644 index 00000000000..ccb8662712f --- /dev/null +++ b/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.symbols @@ -0,0 +1,35 @@ +=== tests/cases/conformance/internalModules/DeclarationMerging/module.d.ts === +declare module Point { +>Point : Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.ts, 0, 0)) + + export var Origin: { x: number; y: number; } +>Origin : Symbol(Origin, Decl(module.d.ts, 1, 14)) +>x : Symbol(x, Decl(module.d.ts, 1, 24)) +>y : Symbol(y, Decl(module.d.ts, 1, 35)) +} + +=== tests/cases/conformance/internalModules/DeclarationMerging/function.ts === +function Point() { +>Point : Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.ts, 0, 0)) + + return { x: 0, y: 0 }; +>x : Symbol(x, Decl(function.ts, 1, 12)) +>y : Symbol(y, Decl(function.ts, 1, 18)) +} + +=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts === +var cl: { x: number; y: number; } +>cl : Symbol(cl, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3)) +>x : Symbol(x, Decl(test.ts, 0, 9)) +>y : Symbol(y, Decl(test.ts, 0, 20)) + +var cl = Point(); +>cl : Symbol(cl, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3)) +>Point : Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.ts, 0, 0)) + +var cl = Point.Origin; +>cl : Symbol(cl, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3)) +>Point.Origin : Symbol(Point.Origin, Decl(module.d.ts, 1, 14)) +>Point : Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.ts, 0, 0)) +>Origin : Symbol(Point.Origin, Decl(module.d.ts, 1, 14)) + diff --git a/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.types b/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.types index cf4aeb6bcc0..035f2a50c37 100644 --- a/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.types +++ b/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.types @@ -15,7 +15,9 @@ function Point() { return { x: 0, y: 0 }; >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } === tests/cases/conformance/internalModules/DeclarationMerging/test.ts === diff --git a/tests/baselines/reference/ArrowFunction4.symbols b/tests/baselines/reference/ArrowFunction4.symbols new file mode 100644 index 00000000000..cd19b8cdac9 --- /dev/null +++ b/tests/baselines/reference/ArrowFunction4.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction4.ts === +var v = (a, b) => { +>v : Symbol(v, Decl(ArrowFunction4.ts, 0, 3)) +>a : Symbol(a, Decl(ArrowFunction4.ts, 0, 9)) +>b : Symbol(b, Decl(ArrowFunction4.ts, 0, 11)) + +}; diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.symbols b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.symbols new file mode 100644 index 00000000000..1c75c33a278 --- /dev/null +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.symbols @@ -0,0 +1,47 @@ +=== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts === +class Point { +>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 4, 1)) + + constructor(public x: number, public y: number) { } +>x : Symbol(x, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 1, 16)) +>y : Symbol(y, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 1, 33)) + + static Origin(): Point { return { x: 0, y: 0 }; } +>Origin : Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 1, 55)) +>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 4, 1)) +>x : Symbol(x, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 3, 37)) +>y : Symbol(y, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 3, 43)) +} + +module Point { +>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 4, 1)) + + function Origin() { return ""; }// not an error, since not exported +>Origin : Symbol(Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 6, 14)) +} + + +module A { +>A : Symbol(A, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 8, 1)) + + export class Point { +>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 16, 5)) + + constructor(public x: number, public y: number) { } +>x : Symbol(x, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 13, 20)) +>y : Symbol(y, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 13, 37)) + + static Origin(): Point { return { x: 0, y: 0 }; } +>Origin : Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 13, 59)) +>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 16, 5)) +>x : Symbol(x, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 15, 41)) +>y : Symbol(y, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 15, 47)) + } + + export module Point { +>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 16, 5)) + + function Origin() { return ""; }// not an error since not exported +>Origin : Symbol(Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 18, 25)) + } +} diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types index 3ea1919ecae..9d943ab354c 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types @@ -11,7 +11,9 @@ class Point { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } module Point { @@ -19,6 +21,7 @@ module Point { function Origin() { return ""; }// not an error, since not exported >Origin : () => string +>"" : string } @@ -37,7 +40,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } export module Point { @@ -45,5 +50,6 @@ module A { function Origin() { return ""; }// not an error since not exported >Origin : () => string +>"" : string } } diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.symbols b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.symbols new file mode 100644 index 00000000000..046b92fd6ee --- /dev/null +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.symbols @@ -0,0 +1,47 @@ +=== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts === +class Point { +>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 4, 1)) + + constructor(public x: number, public y: number) { } +>x : Symbol(x, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 1, 16)) +>y : Symbol(y, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 1, 33)) + + static Origin: Point = { x: 0, y: 0 }; +>Origin : Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 1, 55)) +>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 4, 1)) +>x : Symbol(x, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 3, 28)) +>y : Symbol(y, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 3, 34)) +} + +module Point { +>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 4, 1)) + + var Origin = ""; // not an error, since not exported +>Origin : Symbol(Origin, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 7, 7)) +} + + +module A { +>A : Symbol(A, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 8, 1)) + + export class Point { +>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 16, 5)) + + constructor(public x: number, public y: number) { } +>x : Symbol(x, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 13, 20)) +>y : Symbol(y, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 13, 37)) + + static Origin: Point = { x: 0, y: 0 }; +>Origin : Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 13, 59)) +>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 16, 5)) +>x : Symbol(x, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 15, 32)) +>y : Symbol(y, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 15, 38)) + } + + export module Point { +>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 16, 5)) + + var Origin = ""; // not an error since not exported +>Origin : Symbol(Origin, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 19, 11)) + } +} diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.types b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.types index 827089847e2..8f8ffc8839f 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.types +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.types @@ -11,7 +11,9 @@ class Point { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } module Point { @@ -19,6 +21,7 @@ module Point { var Origin = ""; // not an error, since not exported >Origin : string +>"" : string } @@ -37,7 +40,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } export module Point { @@ -45,5 +50,6 @@ module A { var Origin = ""; // not an error since not exported >Origin : string +>"" : string } } diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStringIndexerAndExportedFunctionWithTypeIncompatibleWithIndexer.symbols b/tests/baselines/reference/ClassAndModuleThatMergeWithStringIndexerAndExportedFunctionWithTypeIncompatibleWithIndexer.symbols new file mode 100644 index 00000000000..4375eaa3ffb --- /dev/null +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStringIndexerAndExportedFunctionWithTypeIncompatibleWithIndexer.symbols @@ -0,0 +1,3 @@ +=== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStringIndexerAndExportedFunctionWithTypeIncompatibleWithIndexer.ts === + +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.errors.txt b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.errors.txt new file mode 100644 index 00000000000..4c707dfd861 --- /dev/null +++ b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.errors.txt @@ -0,0 +1,44 @@ +tests/cases/conformance/internalModules/DeclarationMerging/module.ts(2,19): error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged + + +==== tests/cases/conformance/internalModules/DeclarationMerging/class.ts (0 errors) ==== + module X.Y { + export class Point { + constructor(x: number, y: number) { + this.x = x; + this.y = y; + } + x: number; + y: number; + } + } + +==== tests/cases/conformance/internalModules/DeclarationMerging/module.ts (1 errors) ==== + module X.Y { + export module Point { + ~~~~~ +!!! error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged + export var Origin = new Point(0, 0); + } + } + +==== tests/cases/conformance/internalModules/DeclarationMerging/test.ts (0 errors) ==== + //var cl: { x: number; y: number; } + var cl = new X.Y.Point(1,1); + var cl = X.Y.Point.Origin; // error not expected here same as bug 83996 ? + + +==== tests/cases/conformance/internalModules/DeclarationMerging/simple.ts (0 errors) ==== + class A { + id: string; + } + + module A { + export var Instance = new A(); + } + + // ensure merging works as expected + var a = A.Instance; + var a = new A(); + var a: { id: string }; + \ No newline at end of file diff --git a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.js b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.js new file mode 100644 index 00000000000..71f633a41e3 --- /dev/null +++ b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.js @@ -0,0 +1,81 @@ +//// [tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleWithSameNameAndCommonRootES6.ts] //// + +//// [class.ts] +module X.Y { + export class Point { + constructor(x: number, y: number) { + this.x = x; + this.y = y; + } + x: number; + y: number; + } +} + +//// [module.ts] +module X.Y { + export module Point { + export var Origin = new Point(0, 0); + } +} + +//// [test.ts] +//var cl: { x: number; y: number; } +var cl = new X.Y.Point(1,1); +var cl = X.Y.Point.Origin; // error not expected here same as bug 83996 ? + + +//// [simple.ts] +class A { + id: string; +} + +module A { + export var Instance = new A(); +} + +// ensure merging works as expected +var a = A.Instance; +var a = new A(); +var a: { id: string }; + + +//// [class.js] +var X; +(function (X) { + var Y; + (function (Y) { + class Point { + constructor(x, y) { + this.x = x; + this.y = y; + } + } + Y.Point = Point; + })(Y = X.Y || (X.Y = {})); +})(X || (X = {})); +//// [module.js] +var X; +(function (X) { + var Y; + (function (Y) { + var Point; + (function (Point) { + Point.Origin = new Point(0, 0); + })(Point = Y.Point || (Y.Point = {})); + })(Y = X.Y || (X.Y = {})); +})(X || (X = {})); +//// [test.js] +//var cl: { x: number; y: number; } +var cl = new X.Y.Point(1, 1); +var cl = X.Y.Point.Origin; // error not expected here same as bug 83996 ? +//// [simple.js] +class A { +} +(function (A) { + A.Instance = new A(); +})(A || (A = {})); +// ensure merging works as expected +var a = A.Instance; +var a = new A(); +var a; diff --git a/tests/baselines/reference/ES3For-ofTypeCheck2.symbols b/tests/baselines/reference/ES3For-ofTypeCheck2.symbols new file mode 100644 index 00000000000..607c404682b --- /dev/null +++ b/tests/baselines/reference/ES3For-ofTypeCheck2.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck2.ts === +for (var v of [true]) { } +>v : Symbol(v, Decl(ES3For-ofTypeCheck2.ts, 0, 8)) + diff --git a/tests/baselines/reference/ES3For-ofTypeCheck2.types b/tests/baselines/reference/ES3For-ofTypeCheck2.types index f5ca0ab17e8..81230c9cea4 100644 --- a/tests/baselines/reference/ES3For-ofTypeCheck2.types +++ b/tests/baselines/reference/ES3For-ofTypeCheck2.types @@ -2,4 +2,5 @@ for (var v of [true]) { } >v : boolean >[true] : boolean[] +>true : boolean diff --git a/tests/baselines/reference/ES3For-ofTypeCheck6.symbols b/tests/baselines/reference/ES3For-ofTypeCheck6.symbols new file mode 100644 index 00000000000..f42b8e87f35 --- /dev/null +++ b/tests/baselines/reference/ES3For-ofTypeCheck6.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck6.ts === +var union: string[] | number[]; +>union : Symbol(union, Decl(ES3For-ofTypeCheck6.ts, 0, 3)) + +for (var v of union) { } +>v : Symbol(v, Decl(ES3For-ofTypeCheck6.ts, 1, 8)) +>union : Symbol(union, Decl(ES3For-ofTypeCheck6.ts, 0, 3)) + diff --git a/tests/baselines/reference/ES5For-of10.symbols b/tests/baselines/reference/ES5For-of10.symbols new file mode 100644 index 00000000000..302db0a5ec7 --- /dev/null +++ b/tests/baselines/reference/ES5For-of10.symbols @@ -0,0 +1,23 @@ +=== tests/cases/conformance/statements/for-ofStatements/ES5For-of10.ts === +function foo() { +>foo : Symbol(foo, Decl(ES5For-of10.ts, 0, 0)) + + return { x: 0 }; +>x : Symbol(x, Decl(ES5For-of10.ts, 1, 12)) +} +for (foo().x of []) { +>foo().x : Symbol(x, Decl(ES5For-of10.ts, 1, 12)) +>foo : Symbol(foo, Decl(ES5For-of10.ts, 0, 0)) +>x : Symbol(x, Decl(ES5For-of10.ts, 1, 12)) + + for (foo().x of []) +>foo().x : Symbol(x, Decl(ES5For-of10.ts, 1, 12)) +>foo : Symbol(foo, Decl(ES5For-of10.ts, 0, 0)) +>x : Symbol(x, Decl(ES5For-of10.ts, 1, 12)) + + var p = foo().x; +>p : Symbol(p, Decl(ES5For-of10.ts, 5, 11)) +>foo().x : Symbol(x, Decl(ES5For-of10.ts, 1, 12)) +>foo : Symbol(foo, Decl(ES5For-of10.ts, 0, 0)) +>x : Symbol(x, Decl(ES5For-of10.ts, 1, 12)) +} diff --git a/tests/baselines/reference/ES5For-of10.types b/tests/baselines/reference/ES5For-of10.types index 32a2adcf3da..d31f8972038 100644 --- a/tests/baselines/reference/ES5For-of10.types +++ b/tests/baselines/reference/ES5For-of10.types @@ -5,6 +5,7 @@ function foo() { return { x: 0 }; >{ x: 0 } : { x: number; } >x : number +>0 : number } for (foo().x of []) { >foo().x : number diff --git a/tests/baselines/reference/ES5For-of11.symbols b/tests/baselines/reference/ES5For-of11.symbols new file mode 100644 index 00000000000..7d80e3ab271 --- /dev/null +++ b/tests/baselines/reference/ES5For-of11.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/statements/for-ofStatements/ES5For-of11.ts === +var v; +>v : Symbol(v, Decl(ES5For-of11.ts, 0, 3)) + +for (v of []) { } +>v : Symbol(v, Decl(ES5For-of11.ts, 0, 3)) + diff --git a/tests/baselines/reference/ES5For-of13.symbols b/tests/baselines/reference/ES5For-of13.symbols new file mode 100644 index 00000000000..2dcfe344cf4 --- /dev/null +++ b/tests/baselines/reference/ES5For-of13.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/statements/for-ofStatements/ES5For-of13.ts === +for (let v of ['a', 'b', 'c']) { +>v : Symbol(v, Decl(ES5For-of13.ts, 0, 8)) + + var x = v; +>x : Symbol(x, Decl(ES5For-of13.ts, 1, 7)) +>v : Symbol(v, Decl(ES5For-of13.ts, 0, 8)) +} diff --git a/tests/baselines/reference/ES5For-of13.types b/tests/baselines/reference/ES5For-of13.types index 64aac2ae4b2..46125af551e 100644 --- a/tests/baselines/reference/ES5For-of13.types +++ b/tests/baselines/reference/ES5For-of13.types @@ -2,6 +2,9 @@ for (let v of ['a', 'b', 'c']) { >v : string >['a', 'b', 'c'] : string[] +>'a' : string +>'b' : string +>'c' : string var x = v; >x : string diff --git a/tests/baselines/reference/ES5For-of14.symbols b/tests/baselines/reference/ES5For-of14.symbols new file mode 100644 index 00000000000..771a088f8dc --- /dev/null +++ b/tests/baselines/reference/ES5For-of14.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/statements/for-ofStatements/ES5For-of14.ts === +for (const v of []) { +>v : Symbol(v, Decl(ES5For-of14.ts, 0, 10)) + + var x = v; +>x : Symbol(x, Decl(ES5For-of14.ts, 1, 7)) +>v : Symbol(v, Decl(ES5For-of14.ts, 0, 10)) +} diff --git a/tests/baselines/reference/ES5For-of15.symbols b/tests/baselines/reference/ES5For-of15.symbols new file mode 100644 index 00000000000..ea769ccfac9 --- /dev/null +++ b/tests/baselines/reference/ES5For-of15.symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/statements/for-ofStatements/ES5For-of15.ts === +for (let v of []) { +>v : Symbol(v, Decl(ES5For-of15.ts, 0, 8)) + + v; +>v : Symbol(v, Decl(ES5For-of15.ts, 0, 8)) + + for (const v of []) { +>v : Symbol(v, Decl(ES5For-of15.ts, 2, 14)) + + var x = v; +>x : Symbol(x, Decl(ES5For-of15.ts, 3, 11)) +>v : Symbol(v, Decl(ES5For-of15.ts, 2, 14)) + } +} diff --git a/tests/baselines/reference/ES5For-of16.symbols b/tests/baselines/reference/ES5For-of16.symbols new file mode 100644 index 00000000000..f603cb05450 --- /dev/null +++ b/tests/baselines/reference/ES5For-of16.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/statements/for-ofStatements/ES5For-of16.ts === +for (let v of []) { +>v : Symbol(v, Decl(ES5For-of16.ts, 0, 8)) + + v; +>v : Symbol(v, Decl(ES5For-of16.ts, 0, 8)) + + for (let v of []) { +>v : Symbol(v, Decl(ES5For-of16.ts, 2, 12)) + + var x = v; +>x : Symbol(x, Decl(ES5For-of16.ts, 3, 11)) +>v : Symbol(v, Decl(ES5For-of16.ts, 2, 12)) + + v++; +>v : Symbol(v, Decl(ES5For-of16.ts, 2, 12)) + } +} diff --git a/tests/baselines/reference/ES5For-of18.symbols b/tests/baselines/reference/ES5For-of18.symbols new file mode 100644 index 00000000000..f564c4d5aaa --- /dev/null +++ b/tests/baselines/reference/ES5For-of18.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/statements/for-ofStatements/ES5For-of18.ts === +for (let v of []) { +>v : Symbol(v, Decl(ES5For-of18.ts, 0, 8)) + + v; +>v : Symbol(v, Decl(ES5For-of18.ts, 0, 8)) +} +for (let v of []) { +>v : Symbol(v, Decl(ES5For-of18.ts, 3, 8)) + + v; +>v : Symbol(v, Decl(ES5For-of18.ts, 3, 8)) +} + diff --git a/tests/baselines/reference/ES5For-of19.symbols b/tests/baselines/reference/ES5For-of19.symbols new file mode 100644 index 00000000000..93133c2ec49 --- /dev/null +++ b/tests/baselines/reference/ES5For-of19.symbols @@ -0,0 +1,19 @@ +=== tests/cases/conformance/statements/for-ofStatements/ES5For-of19.ts === +for (let v of []) { +>v : Symbol(v, Decl(ES5For-of19.ts, 0, 8)) + + v; +>v : Symbol(v, Decl(ES5For-of19.ts, 0, 8)) + + function foo() { +>foo : Symbol(foo, Decl(ES5For-of19.ts, 1, 6)) + + for (const v of []) { +>v : Symbol(v, Decl(ES5For-of19.ts, 3, 18)) + + v; +>v : Symbol(v, Decl(ES5For-of19.ts, 3, 18)) + } + } +} + diff --git a/tests/baselines/reference/ES5For-of2.symbols b/tests/baselines/reference/ES5For-of2.symbols new file mode 100644 index 00000000000..250429031c5 --- /dev/null +++ b/tests/baselines/reference/ES5For-of2.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/statements/for-ofStatements/ES5For-of2.ts === +for (var v of []) { +>v : Symbol(v, Decl(ES5For-of2.ts, 0, 8)) + + var x = v; +>x : Symbol(x, Decl(ES5For-of2.ts, 1, 7)) +>v : Symbol(v, Decl(ES5For-of2.ts, 0, 8)) +} diff --git a/tests/baselines/reference/ES5For-of21.symbols b/tests/baselines/reference/ES5For-of21.symbols new file mode 100644 index 00000000000..9cbecdb20ba --- /dev/null +++ b/tests/baselines/reference/ES5For-of21.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/statements/for-ofStatements/ES5For-of21.ts === +for (let v of []) { +>v : Symbol(v, Decl(ES5For-of21.ts, 0, 8)) + + for (let _i of []) { } +>_i : Symbol(_i, Decl(ES5For-of21.ts, 1, 12)) +} diff --git a/tests/baselines/reference/ES5For-of24.symbols b/tests/baselines/reference/ES5For-of24.symbols new file mode 100644 index 00000000000..9a9a98660dc --- /dev/null +++ b/tests/baselines/reference/ES5For-of24.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/statements/for-ofStatements/ES5For-of24.ts === +var a = [1, 2, 3]; +>a : Symbol(a, Decl(ES5For-of24.ts, 0, 3)) + +for (var v of a) { +>v : Symbol(v, Decl(ES5For-of24.ts, 1, 8)) +>a : Symbol(a, Decl(ES5For-of24.ts, 0, 3)) + + let a = 0; +>a : Symbol(a, Decl(ES5For-of24.ts, 2, 7)) +} diff --git a/tests/baselines/reference/ES5For-of24.types b/tests/baselines/reference/ES5For-of24.types index 7170073b5d9..c0c4666fbf5 100644 --- a/tests/baselines/reference/ES5For-of24.types +++ b/tests/baselines/reference/ES5For-of24.types @@ -2,6 +2,9 @@ var a = [1, 2, 3]; >a : number[] >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number for (var v of a) { >v : number @@ -9,4 +12,5 @@ for (var v of a) { let a = 0; >a : number +>0 : number } diff --git a/tests/baselines/reference/ES5For-of25.symbols b/tests/baselines/reference/ES5For-of25.symbols new file mode 100644 index 00000000000..22f04d9ae28 --- /dev/null +++ b/tests/baselines/reference/ES5For-of25.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/statements/for-ofStatements/ES5For-of25.ts === +var a = [1, 2, 3]; +>a : Symbol(a, Decl(ES5For-of25.ts, 0, 3)) + +for (var v of a) { +>v : Symbol(v, Decl(ES5For-of25.ts, 1, 8)) +>a : Symbol(a, Decl(ES5For-of25.ts, 0, 3)) + + v; +>v : Symbol(v, Decl(ES5For-of25.ts, 1, 8)) + + a; +>a : Symbol(a, Decl(ES5For-of25.ts, 0, 3)) +} diff --git a/tests/baselines/reference/ES5For-of25.types b/tests/baselines/reference/ES5For-of25.types index 7b306ee9a26..4650e3244d3 100644 --- a/tests/baselines/reference/ES5For-of25.types +++ b/tests/baselines/reference/ES5For-of25.types @@ -2,6 +2,9 @@ var a = [1, 2, 3]; >a : number[] >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number for (var v of a) { >v : number diff --git a/tests/baselines/reference/ES5For-of3.symbols b/tests/baselines/reference/ES5For-of3.symbols new file mode 100644 index 00000000000..452b2224aea --- /dev/null +++ b/tests/baselines/reference/ES5For-of3.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/statements/for-ofStatements/ES5For-of3.ts === +for (var v of ['a', 'b', 'c']) +>v : Symbol(v, Decl(ES5For-of3.ts, 0, 8)) + + var x = v; +>x : Symbol(x, Decl(ES5For-of3.ts, 1, 7)) +>v : Symbol(v, Decl(ES5For-of3.ts, 0, 8)) + diff --git a/tests/baselines/reference/ES5For-of3.types b/tests/baselines/reference/ES5For-of3.types index c47328816e8..65267fe3f70 100644 --- a/tests/baselines/reference/ES5For-of3.types +++ b/tests/baselines/reference/ES5For-of3.types @@ -2,6 +2,9 @@ for (var v of ['a', 'b', 'c']) >v : string >['a', 'b', 'c'] : string[] +>'a' : string +>'b' : string +>'c' : string var x = v; >x : string diff --git a/tests/baselines/reference/ES5For-of4.symbols b/tests/baselines/reference/ES5For-of4.symbols new file mode 100644 index 00000000000..f79e09b366f --- /dev/null +++ b/tests/baselines/reference/ES5For-of4.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/statements/for-ofStatements/ES5For-of4.ts === +for (var v of []) +>v : Symbol(v, Decl(ES5For-of4.ts, 0, 8)) + + var x = v; +>x : Symbol(x, Decl(ES5For-of4.ts, 1, 7)) +>v : Symbol(v, Decl(ES5For-of4.ts, 0, 8)) + +var y = v; +>y : Symbol(y, Decl(ES5For-of4.ts, 2, 3)) +>v : Symbol(v, Decl(ES5For-of4.ts, 0, 8)) + diff --git a/tests/baselines/reference/ES5For-of5.symbols b/tests/baselines/reference/ES5For-of5.symbols new file mode 100644 index 00000000000..9cf59c68c2b --- /dev/null +++ b/tests/baselines/reference/ES5For-of5.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/statements/for-ofStatements/ES5For-of5.ts === +for (var _a of []) { +>_a : Symbol(_a, Decl(ES5For-of5.ts, 0, 8)) + + var x = _a; +>x : Symbol(x, Decl(ES5For-of5.ts, 1, 7)) +>_a : Symbol(_a, Decl(ES5For-of5.ts, 0, 8)) +} diff --git a/tests/baselines/reference/ES5For-of6.symbols b/tests/baselines/reference/ES5For-of6.symbols new file mode 100644 index 00000000000..3bdae947038 --- /dev/null +++ b/tests/baselines/reference/ES5For-of6.symbols @@ -0,0 +1,13 @@ +=== tests/cases/conformance/statements/for-ofStatements/ES5For-of6.ts === +for (var w of []) { +>w : Symbol(w, Decl(ES5For-of6.ts, 0, 8)) + + for (var v of []) { +>v : Symbol(v, Decl(ES5For-of6.ts, 1, 12)) + + var x = [w, v]; +>x : Symbol(x, Decl(ES5For-of6.ts, 2, 11)) +>w : Symbol(w, Decl(ES5For-of6.ts, 0, 8)) +>v : Symbol(v, Decl(ES5For-of6.ts, 1, 12)) + } +} diff --git a/tests/baselines/reference/ES5For-of9.symbols b/tests/baselines/reference/ES5For-of9.symbols new file mode 100644 index 00000000000..426a5442ecb --- /dev/null +++ b/tests/baselines/reference/ES5For-of9.symbols @@ -0,0 +1,24 @@ +=== tests/cases/conformance/statements/for-ofStatements/ES5For-of9.ts === +function foo() { +>foo : Symbol(foo, Decl(ES5For-of9.ts, 0, 0)) + + return { x: 0 }; +>x : Symbol(x, Decl(ES5For-of9.ts, 1, 12)) +} +for (foo().x of []) { +>foo().x : Symbol(x, Decl(ES5For-of9.ts, 1, 12)) +>foo : Symbol(foo, Decl(ES5For-of9.ts, 0, 0)) +>x : Symbol(x, Decl(ES5For-of9.ts, 1, 12)) + + for (foo().x of []) { +>foo().x : Symbol(x, Decl(ES5For-of9.ts, 1, 12)) +>foo : Symbol(foo, Decl(ES5For-of9.ts, 0, 0)) +>x : Symbol(x, Decl(ES5For-of9.ts, 1, 12)) + + var p = foo().x; +>p : Symbol(p, Decl(ES5For-of9.ts, 5, 11)) +>foo().x : Symbol(x, Decl(ES5For-of9.ts, 1, 12)) +>foo : Symbol(foo, Decl(ES5For-of9.ts, 0, 0)) +>x : Symbol(x, Decl(ES5For-of9.ts, 1, 12)) + } +} diff --git a/tests/baselines/reference/ES5For-of9.types b/tests/baselines/reference/ES5For-of9.types index 60870c2d642..ec41df704c6 100644 --- a/tests/baselines/reference/ES5For-of9.types +++ b/tests/baselines/reference/ES5For-of9.types @@ -5,6 +5,7 @@ function foo() { return { x: 0 }; >{ x: 0 } : { x: number; } >x : number +>0 : number } for (foo().x of []) { >foo().x : number diff --git a/tests/baselines/reference/ES5For-ofTypeCheck1.symbols b/tests/baselines/reference/ES5For-ofTypeCheck1.symbols new file mode 100644 index 00000000000..83b7fbd0d2c --- /dev/null +++ b/tests/baselines/reference/ES5For-ofTypeCheck1.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck1.ts === +for (var v of "") { } +>v : Symbol(v, Decl(ES5For-ofTypeCheck1.ts, 0, 8)) + diff --git a/tests/baselines/reference/ES5For-ofTypeCheck1.types b/tests/baselines/reference/ES5For-ofTypeCheck1.types index 4da0ecc0e36..395900d683b 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck1.types +++ b/tests/baselines/reference/ES5For-ofTypeCheck1.types @@ -1,4 +1,5 @@ === tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck1.ts === for (var v of "") { } >v : string +>"" : string diff --git a/tests/baselines/reference/ES5For-ofTypeCheck2.symbols b/tests/baselines/reference/ES5For-ofTypeCheck2.symbols new file mode 100644 index 00000000000..cd1d3f346e8 --- /dev/null +++ b/tests/baselines/reference/ES5For-ofTypeCheck2.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck2.ts === +for (var v of [true]) { } +>v : Symbol(v, Decl(ES5For-ofTypeCheck2.ts, 0, 8)) + diff --git a/tests/baselines/reference/ES5For-ofTypeCheck2.types b/tests/baselines/reference/ES5For-ofTypeCheck2.types index e6b86ce1d81..d28a2803216 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck2.types +++ b/tests/baselines/reference/ES5For-ofTypeCheck2.types @@ -2,4 +2,5 @@ for (var v of [true]) { } >v : boolean >[true] : boolean[] +>true : boolean diff --git a/tests/baselines/reference/ES5For-ofTypeCheck3.symbols b/tests/baselines/reference/ES5For-ofTypeCheck3.symbols new file mode 100644 index 00000000000..82196315ca6 --- /dev/null +++ b/tests/baselines/reference/ES5For-ofTypeCheck3.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck3.ts === +var tuple: [string, number] = ["", 0]; +>tuple : Symbol(tuple, Decl(ES5For-ofTypeCheck3.ts, 0, 3)) + +for (var v of tuple) { } +>v : Symbol(v, Decl(ES5For-ofTypeCheck3.ts, 1, 8)) +>tuple : Symbol(tuple, Decl(ES5For-ofTypeCheck3.ts, 0, 3)) + diff --git a/tests/baselines/reference/ES5For-ofTypeCheck3.types b/tests/baselines/reference/ES5For-ofTypeCheck3.types index 5293634c6c5..a62dcc94f98 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck3.types +++ b/tests/baselines/reference/ES5For-ofTypeCheck3.types @@ -2,6 +2,8 @@ var tuple: [string, number] = ["", 0]; >tuple : [string, number] >["", 0] : [string, number] +>"" : string +>0 : number for (var v of tuple) { } >v : string | number diff --git a/tests/baselines/reference/ES5For-ofTypeCheck4.symbols b/tests/baselines/reference/ES5For-ofTypeCheck4.symbols new file mode 100644 index 00000000000..7d3dac4ef81 --- /dev/null +++ b/tests/baselines/reference/ES5For-ofTypeCheck4.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck4.ts === +var union: string | string[]; +>union : Symbol(union, Decl(ES5For-ofTypeCheck4.ts, 0, 3)) + +for (const v of union) { } +>v : Symbol(v, Decl(ES5For-ofTypeCheck4.ts, 1, 10)) +>union : Symbol(union, Decl(ES5For-ofTypeCheck4.ts, 0, 3)) + diff --git a/tests/baselines/reference/ES5For-ofTypeCheck5.symbols b/tests/baselines/reference/ES5For-ofTypeCheck5.symbols new file mode 100644 index 00000000000..41f80949e52 --- /dev/null +++ b/tests/baselines/reference/ES5For-ofTypeCheck5.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck5.ts === +var union: string | number[]; +>union : Symbol(union, Decl(ES5For-ofTypeCheck5.ts, 0, 3)) + +for (var v of union) { } +>v : Symbol(v, Decl(ES5For-ofTypeCheck5.ts, 1, 8)) +>union : Symbol(union, Decl(ES5For-ofTypeCheck5.ts, 0, 3)) + diff --git a/tests/baselines/reference/ES5For-ofTypeCheck6.symbols b/tests/baselines/reference/ES5For-ofTypeCheck6.symbols new file mode 100644 index 00000000000..4c362bf9bc7 --- /dev/null +++ b/tests/baselines/reference/ES5For-ofTypeCheck6.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck6.ts === +var union: string[] | number[]; +>union : Symbol(union, Decl(ES5For-ofTypeCheck6.ts, 0, 3)) + +for (var v of union) { } +>v : Symbol(v, Decl(ES5For-ofTypeCheck6.ts, 1, 8)) +>union : Symbol(union, Decl(ES5For-ofTypeCheck6.ts, 0, 3)) + diff --git a/tests/baselines/reference/ES5SymbolType1.symbols b/tests/baselines/reference/ES5SymbolType1.symbols new file mode 100644 index 00000000000..ea6c9084046 --- /dev/null +++ b/tests/baselines/reference/ES5SymbolType1.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/Symbols/ES5SymbolType1.ts === +var s: symbol; +>s : Symbol(s, Decl(ES5SymbolType1.ts, 0, 3)) + +s.toString(); +>s.toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) +>s : Symbol(s, Decl(ES5SymbolType1.ts, 0, 3)) +>toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) + diff --git a/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.symbols b/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.symbols new file mode 100644 index 00000000000..dc97960f71e --- /dev/null +++ b/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.symbols @@ -0,0 +1,42 @@ +=== tests/cases/conformance/internalModules/DeclarationMerging/EnumAndModuleWithSameNameAndCommonRoot.ts === +enum enumdule { +>enumdule : Symbol(enumdule, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 0), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 2, 1)) + + Red, Blue +>Red : Symbol(enumdule.Red, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 15)) +>Blue : Symbol(enumdule.Blue, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 1, 8)) +} + +module enumdule { +>enumdule : Symbol(enumdule, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 0), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 2, 1)) + + export class Point { +>Point : Symbol(Point, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 4, 17)) + + constructor(public x: number, public y: number) { } +>x : Symbol(x, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 7, 20)) +>y : Symbol(y, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 7, 37)) + } +} + +var x: enumdule; +>x : Symbol(x, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 11, 3), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 12, 3)) +>enumdule : Symbol(enumdule, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 0), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 2, 1)) + +var x = enumdule.Red; +>x : Symbol(x, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 11, 3), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 12, 3)) +>enumdule.Red : Symbol(enumdule.Red, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 15)) +>enumdule : Symbol(enumdule, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 0), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 2, 1)) +>Red : Symbol(enumdule.Red, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 15)) + +var y: { x: number; y: number }; +>y : Symbol(y, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 14, 3), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 15, 3)) +>x : Symbol(x, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 14, 8)) +>y : Symbol(y, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 14, 19)) + +var y = new enumdule.Point(0, 0); +>y : Symbol(y, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 14, 3), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 15, 3)) +>enumdule.Point : Symbol(enumdule.Point, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 4, 17)) +>enumdule : Symbol(enumdule, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 0), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 2, 1)) +>Point : Symbol(enumdule.Point, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 4, 17)) + diff --git a/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.types b/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.types index 3cbd14c78bb..205335c7eb6 100644 --- a/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.types +++ b/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.types @@ -40,4 +40,6 @@ var y = new enumdule.Point(0, 0); >enumdule.Point : typeof enumdule.Point >enumdule : typeof enumdule >Point : typeof enumdule.Point +>0 : number +>0 : number diff --git a/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.symbols b/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.symbols new file mode 100644 index 00000000000..8346888d81f --- /dev/null +++ b/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.symbols @@ -0,0 +1,38 @@ +=== tests/cases/conformance/internalModules/exportDeclarations/ExportClassWhichExtendsInterfaceWithInaccessibleType.ts === +module A { +>A : Symbol(A, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 0, 0)) + + interface Point { +>Point : Symbol(Point, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 0, 10)) + + x: number; +>x : Symbol(x, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 2, 21)) + + y: number; +>y : Symbol(y, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 3, 18)) + + fromOrigin(p: Point): number; +>fromOrigin : Symbol(fromOrigin, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 4, 18)) +>p : Symbol(p, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 6, 19)) +>Point : Symbol(Point, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 0, 10)) + } + + export class Point2d implements Point { +>Point2d : Symbol(Point2d, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 7, 5)) +>Point : Symbol(Point, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 0, 10)) + + constructor(public x: number, public y: number) { } +>x : Symbol(x, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 10, 20)) +>y : Symbol(y, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 10, 37)) + + fromOrigin(p: Point) { +>fromOrigin : Symbol(fromOrigin, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 10, 59)) +>p : Symbol(p, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 12, 19)) +>Point : Symbol(Point, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 0, 10)) + + return 1; + } + } +} + + diff --git a/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.types b/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.types index 6d69109e542..e47b38a0b61 100644 --- a/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.types +++ b/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.types @@ -31,6 +31,7 @@ module A { >Point : Point return 1; +>1 : number } } } diff --git a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.symbols b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.symbols new file mode 100644 index 00000000000..2802e6aa392 --- /dev/null +++ b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.symbols @@ -0,0 +1,48 @@ +=== tests/cases/conformance/internalModules/exportDeclarations/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts === +module A { +>A : Symbol(A, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 0)) + + export class Point { +>Point : Symbol(Point, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10)) + + x: number; +>x : Symbol(x, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 2, 24)) + + y: number; +>y : Symbol(y, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 3, 18)) + } + + export var Origin: Point = { x: 0, y: 0 }; +>Origin : Symbol(Origin, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 14)) +>Point : Symbol(Point, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10)) +>x : Symbol(x, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 32)) +>y : Symbol(y, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 38)) + + export class Point3d extends Point { +>Point3d : Symbol(Point3d, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 46)) +>Point : Symbol(Point, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10)) + + z: number; +>z : Symbol(z, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 9, 40)) + } + + export var Origin3d: Point3d = { x: 0, y: 0, z: 0 }; +>Origin3d : Symbol(Origin3d, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 14)) +>Point3d : Symbol(Point3d, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 46)) +>x : Symbol(x, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 36)) +>y : Symbol(y, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 42)) +>z : Symbol(z, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 48)) + + export class Line{ +>Line : Symbol(Line, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 56)) +>TPoint : Symbol(TPoint, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 22)) +>Point : Symbol(Point, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10)) + + constructor(public start: TPoint, public end: TPoint) { } +>start : Symbol(start, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 16, 20)) +>TPoint : Symbol(TPoint, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 22)) +>end : Symbol(end, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 16, 41)) +>TPoint : Symbol(TPoint, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 22)) + } +} + diff --git a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types index 17b4a25cde3..a5cefcc521e 100644 --- a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types +++ b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types @@ -17,7 +17,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number export class Point3d extends Point { >Point3d : Point3d @@ -32,8 +34,11 @@ module A { >Point3d : Point3d >{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } >x : number +>0 : number >y : number +>0 : number >z : number +>0 : number export class Line{ >Line : Line diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.symbols b/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.symbols new file mode 100644 index 00000000000..e1e433a8921 --- /dev/null +++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.symbols @@ -0,0 +1,28 @@ +=== tests/cases/conformance/internalModules/exportDeclarations/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts === +module A { +>A : Symbol(A, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 0)) + + class Point { +>Point : Symbol(Point, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 10)) + + x: number; +>x : Symbol(x, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 2, 17)) + + y: number; +>y : Symbol(y, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 3, 18)) + } + + export class points { +>points : Symbol(points, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 5, 5)) + + [idx: number]: Point; +>idx : Symbol(idx, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 9, 9)) +>Point : Symbol(Point, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 10)) + + [idx: string]: Point; +>idx : Symbol(idx, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 10, 9)) +>Point : Symbol(Point, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 10)) + } +} + + diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.symbols b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.symbols new file mode 100644 index 00000000000..e1044bd2442 --- /dev/null +++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.symbols @@ -0,0 +1,58 @@ +=== tests/cases/conformance/internalModules/exportDeclarations/ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts === +module A { +>A : Symbol(A, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 0)) + + class Point { +>Point : Symbol(Point, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10)) + + x: number; +>x : Symbol(x, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 2, 17)) + + y: number; +>y : Symbol(y, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 3, 18)) + } + + export var Origin: Point = { x: 0, y: 0 }; +>Origin : Symbol(Origin, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 14)) +>Point : Symbol(Point, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10)) +>x : Symbol(x, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 32)) +>y : Symbol(y, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 38)) + + export class Point3d extends Point { +>Point3d : Symbol(Point3d, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 46)) +>Point : Symbol(Point, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10)) + + z: number; +>z : Symbol(z, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 9, 40)) + } + + export var Origin3d: Point3d = { x: 0, y: 0, z: 0 }; +>Origin3d : Symbol(Origin3d, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 14)) +>Point3d : Symbol(Point3d, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 46)) +>x : Symbol(x, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 36)) +>y : Symbol(y, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 42)) +>z : Symbol(z, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 48)) + + export class Line{ +>Line : Symbol(Line, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 56)) +>TPoint : Symbol(TPoint, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 22)) +>Point : Symbol(Point, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10)) + + constructor(public start: TPoint, public end: TPoint) { } +>start : Symbol(start, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 16, 20)) +>TPoint : Symbol(TPoint, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 22)) +>end : Symbol(end, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 16, 41)) +>TPoint : Symbol(TPoint, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 22)) + + static fromorigin2d(p: Point): Line{ +>fromorigin2d : Symbol(Line.fromorigin2d, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 16, 65)) +>p : Symbol(p, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 18, 28)) +>Point : Symbol(Point, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10)) +>Line : Symbol(Line, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 56)) +>Point : Symbol(Point, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10)) + + return null; + } + } +} + diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types index 6f4452fce4c..ba174d9bbba 100644 --- a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types +++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types @@ -17,7 +17,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number export class Point3d extends Point { >Point3d : Point3d @@ -32,8 +34,11 @@ module A { >Point3d : Point3d >{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } >x : number +>0 : number >y : number +>0 : number >z : number +>0 : number export class Line{ >Line : Line @@ -54,6 +59,7 @@ module A { >Point : Point return null; +>null : null } } } diff --git a/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.symbols b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.symbols new file mode 100644 index 00000000000..37b6da18c37 --- /dev/null +++ b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.symbols @@ -0,0 +1,37 @@ +=== tests/cases/conformance/internalModules/exportDeclarations/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts === +module A { +>A : Symbol(A, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 0, 0)) + + export class Point { +>Point : Symbol(Point, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 0, 10)) + + x: number; +>x : Symbol(x, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 2, 24)) + + y: number; +>y : Symbol(y, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 3, 18)) + } + + export class Line { +>Line : Symbol(Line, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 5, 5)) + + constructor(public start: Point, public end: Point) { } +>start : Symbol(start, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 8, 20)) +>Point : Symbol(Point, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 0, 10)) +>end : Symbol(end, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 8, 40)) +>Point : Symbol(Point, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 0, 10)) + } + + export function fromOrigin(p: Point): Line { +>fromOrigin : Symbol(fromOrigin, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 9, 5)) +>p : Symbol(p, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 11, 31)) +>Point : Symbol(Point, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 0, 10)) +>Line : Symbol(Line, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 5, 5)) + + return new Line({ x: 0, y: 0 }, p); +>Line : Symbol(Line, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 5, 5)) +>x : Symbol(x, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 12, 25)) +>y : Symbol(y, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 12, 31)) +>p : Symbol(p, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 11, 31)) + } +} diff --git a/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types index ac1845a533c..60a6e122a78 100644 --- a/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types +++ b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types @@ -33,7 +33,9 @@ module A { >Line : typeof Line >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number >p : Point } } diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.symbols b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.symbols new file mode 100644 index 00000000000..41993ebf48f --- /dev/null +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.symbols @@ -0,0 +1,37 @@ +=== tests/cases/conformance/internalModules/exportDeclarations/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts === +module A { +>A : Symbol(A, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 0, 0)) + + class Point { +>Point : Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 0, 10)) + + x: number; +>x : Symbol(x, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 2, 17)) + + y: number; +>y : Symbol(y, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 3, 18)) + } + + export class Line { +>Line : Symbol(Line, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 5, 5)) + + constructor(public start: Point, public end: Point) { } +>start : Symbol(start, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 8, 20)) +>Point : Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 0, 10)) +>end : Symbol(end, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 8, 40)) +>Point : Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 0, 10)) + } + + export function fromOrigin(p: Point): Line { +>fromOrigin : Symbol(fromOrigin, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 9, 5)) +>p : Symbol(p, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 11, 31)) +>Point : Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 0, 10)) +>Line : Symbol(Line, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 5, 5)) + + return new Line({ x: 0, y: 0 }, p); +>Line : Symbol(Line, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 5, 5)) +>x : Symbol(x, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 12, 25)) +>y : Symbol(y, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 12, 31)) +>p : Symbol(p, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 11, 31)) + } +} diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types index 3f3a670ee8e..ba862ad77cf 100644 --- a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types @@ -33,7 +33,9 @@ module A { >Line : typeof Line >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number >p : Point } } diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.symbols b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.symbols new file mode 100644 index 00000000000..77d57215795 --- /dev/null +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.symbols @@ -0,0 +1,37 @@ +=== tests/cases/conformance/internalModules/exportDeclarations/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts === +module A { +>A : Symbol(A, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 0, 0)) + + export class Point { +>Point : Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 0, 10)) + + x: number; +>x : Symbol(x, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 2, 24)) + + y: number; +>y : Symbol(y, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 3, 18)) + } + + class Line { +>Line : Symbol(Line, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 5, 5)) + + constructor(public start: Point, public end: Point) { } +>start : Symbol(start, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 8, 20)) +>Point : Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 0, 10)) +>end : Symbol(end, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 8, 40)) +>Point : Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 0, 10)) + } + + export function fromOrigin(p: Point): Line { +>fromOrigin : Symbol(fromOrigin, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 9, 5)) +>p : Symbol(p, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 11, 31)) +>Point : Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 0, 10)) +>Line : Symbol(Line, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 5, 5)) + + return new Line({ x: 0, y: 0 }, p); +>Line : Symbol(Line, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 5, 5)) +>x : Symbol(x, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 12, 25)) +>y : Symbol(y, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 12, 31)) +>p : Symbol(p, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 11, 31)) + } +} diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types index 7634e2cde3e..ef72f80ffde 100644 --- a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types @@ -33,7 +33,9 @@ module A { >Line : typeof Line >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number >p : Point } } diff --git a/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.symbols b/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.symbols new file mode 100644 index 00000000000..31b978c85f9 --- /dev/null +++ b/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.symbols @@ -0,0 +1,56 @@ +=== tests/cases/conformance/internalModules/exportDeclarations/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts === +module A { +>A : Symbol(A, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 0)) + + export interface Point { +>Point : Symbol(Point, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10)) + + x: number; +>x : Symbol(x, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 2, 28)) + + y: number; +>y : Symbol(y, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 3, 18)) + } + + export var Origin: Point = { x: 0, y: 0 }; +>Origin : Symbol(Origin, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 14)) +>Point : Symbol(Point, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10)) +>x : Symbol(x, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 32)) +>y : Symbol(y, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 38)) + + export interface Point3d extends Point { +>Point3d : Symbol(Point3d, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 46)) +>Point : Symbol(Point, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10)) + + z: number; +>z : Symbol(z, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 9, 44)) + } + + export var Origin3d: Point3d = { x: 0, y: 0, z: 0 }; +>Origin3d : Symbol(Origin3d, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 14)) +>Point3d : Symbol(Point3d, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 46)) +>x : Symbol(x, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 36)) +>y : Symbol(y, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 42)) +>z : Symbol(z, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 48)) + + export interface Line{ +>Line : Symbol(Line, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 56)) +>TPoint : Symbol(TPoint, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 26)) +>Point : Symbol(Point, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10)) + + new (start: TPoint, end: TPoint); +>start : Symbol(start, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 16, 13)) +>TPoint : Symbol(TPoint, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 26)) +>end : Symbol(end, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 16, 27)) +>TPoint : Symbol(TPoint, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 26)) + + start: TPoint; +>start : Symbol(start, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 16, 41)) +>TPoint : Symbol(TPoint, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 26)) + + end: TPoint; +>end : Symbol(end, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 17, 22)) +>TPoint : Symbol(TPoint, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 26)) + } +} + diff --git a/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types b/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types index f6f4e6a441a..b4a331b9140 100644 --- a/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types +++ b/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types @@ -17,7 +17,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number export interface Point3d extends Point { >Point3d : Point3d @@ -32,8 +34,11 @@ module A { >Point3d : Point3d >{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } >x : number +>0 : number >y : number +>0 : number >z : number +>0 : number export interface Line{ >Line : Line diff --git a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.symbols b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.symbols new file mode 100644 index 00000000000..00f9025aa8c --- /dev/null +++ b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.symbols @@ -0,0 +1,28 @@ +=== tests/cases/conformance/internalModules/exportDeclarations/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts === +module A { +>A : Symbol(A, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 0)) + + interface Point { +>Point : Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 10)) + + x: number; +>x : Symbol(x, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 2, 21)) + + y: number; +>y : Symbol(y, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 3, 18)) + } + + export interface points { +>points : Symbol(points, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 5, 5)) + + [idx: number]: Point; +>idx : Symbol(idx, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 9, 9)) +>Point : Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 10)) + + [idx: string]: Point; +>idx : Symbol(idx, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 10, 9)) +>Point : Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 10)) + } +} + + diff --git a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.types b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.types index 6caed8a138a..8be90b5946e 100644 --- a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.types +++ b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.types @@ -1,6 +1,6 @@ === tests/cases/conformance/internalModules/exportDeclarations/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts === module A { ->A : unknown +>A : any interface Point { >Point : Point diff --git a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.symbols b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.symbols new file mode 100644 index 00000000000..7ee70a0c77b --- /dev/null +++ b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.symbols @@ -0,0 +1,56 @@ +=== tests/cases/conformance/internalModules/exportDeclarations/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts === +module A { +>A : Symbol(A, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 0)) + + interface Point { +>Point : Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10)) + + x: number; +>x : Symbol(x, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 2, 21)) + + y: number; +>y : Symbol(y, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 3, 18)) + } + + export var Origin: Point = { x: 0, y: 0 }; +>Origin : Symbol(Origin, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 14)) +>Point : Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10)) +>x : Symbol(x, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 32)) +>y : Symbol(y, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 38)) + + export interface Point3d extends Point { +>Point3d : Symbol(Point3d, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 46)) +>Point : Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10)) + + z: number; +>z : Symbol(z, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 9, 44)) + } + + export var Origin3d: Point3d = { x: 0, y: 0, z: 0 }; +>Origin3d : Symbol(Origin3d, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 14)) +>Point3d : Symbol(Point3d, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 46)) +>x : Symbol(x, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 36)) +>y : Symbol(y, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 42)) +>z : Symbol(z, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 48)) + + export interface Line{ +>Line : Symbol(Line, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 56)) +>TPoint : Symbol(TPoint, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 26)) +>Point : Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10)) + + new (start: TPoint, end: TPoint); +>start : Symbol(start, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 16, 13)) +>TPoint : Symbol(TPoint, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 26)) +>end : Symbol(end, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 16, 27)) +>TPoint : Symbol(TPoint, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 26)) + + start: TPoint; +>start : Symbol(start, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 16, 41)) +>TPoint : Symbol(TPoint, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 26)) + + end: TPoint; +>end : Symbol(end, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 18, 22)) +>TPoint : Symbol(TPoint, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 26)) + } +} + diff --git a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.types b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.types index 53484780474..366e21b6472 100644 --- a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.types +++ b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.types @@ -17,7 +17,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number export interface Point3d extends Point { >Point3d : Point3d @@ -32,8 +34,11 @@ module A { >Point3d : Point3d >{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } >x : number +>0 : number >y : number +>0 : number >z : number +>0 : number export interface Line{ >Line : Line diff --git a/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.symbols b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.symbols new file mode 100644 index 00000000000..acf6a1caef4 --- /dev/null +++ b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.symbols @@ -0,0 +1,45 @@ +=== tests/cases/conformance/internalModules/exportDeclarations/ExportModuleWithAccessibleTypesOnItsExportedMembers.ts === +module A { +>A : Symbol(A, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 0)) + + export class Point { +>Point : Symbol(Point, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 10)) + + constructor(public x: number, public y: number) { } +>x : Symbol(x, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 3, 20)) +>y : Symbol(y, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 3, 37)) + } + + export module B { +>B : Symbol(B, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 4, 5)) + + export var Origin: Point = new Point(0, 0); +>Origin : Symbol(Origin, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 7, 18)) +>Point : Symbol(Point, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 10)) +>Point : Symbol(Point, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 10)) + + export class Line { +>Line : Symbol(Line, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 7, 51)) + + constructor(start: Point, end: Point) { +>start : Symbol(start, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 10, 24)) +>Point : Symbol(Point, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 10)) +>end : Symbol(end, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 10, 37)) +>Point : Symbol(Point, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 10)) + + } + + static fromOrigin(p: Point) { +>fromOrigin : Symbol(Line.fromOrigin, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 12, 13)) +>p : Symbol(p, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 14, 30)) +>Point : Symbol(Point, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 10)) + + return new Line({ x: 0, y: 0 }, p); +>Line : Symbol(Line, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 7, 51)) +>x : Symbol(x, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 15, 33)) +>y : Symbol(y, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 15, 39)) +>p : Symbol(p, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 14, 30)) + } + } + } +} diff --git a/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types index a3a80cb06ad..cd8526242fa 100644 --- a/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types +++ b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types @@ -18,6 +18,8 @@ module A { >Point : Point >new Point(0, 0) : Point >Point : typeof Point +>0 : number +>0 : number export class Line { >Line : Line @@ -40,7 +42,9 @@ module A { >Line : typeof Line >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number >p : Point } } diff --git a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.symbols b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.symbols new file mode 100644 index 00000000000..dccc613aca9 --- /dev/null +++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.symbols @@ -0,0 +1,26 @@ +=== tests/cases/conformance/internalModules/exportDeclarations/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts === +module A { +>A : Symbol(A, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 0, 0)) + + class Point { +>Point : Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 0, 10)) + + constructor(public x: number, public y: number) { } +>x : Symbol(x, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 3, 20)) +>y : Symbol(y, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 3, 37)) + } + + export var Origin: Point = { x: 0, y: 0 }; +>Origin : Symbol(Origin, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 6, 14)) +>Point : Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 0, 10)) +>x : Symbol(x, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 6, 32)) +>y : Symbol(y, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 6, 38)) + + export var Unity = { start: new Point(0, 0), end: new Point(1, 0) }; +>Unity : Symbol(Unity, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 8, 14)) +>start : Symbol(start, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 8, 24)) +>Point : Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 0, 10)) +>end : Symbol(end, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 8, 48)) +>Point : Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 0, 10)) +} + diff --git a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.types b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.types index 82bdf732173..e08a4345a95 100644 --- a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.types +++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.types @@ -15,7 +15,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number export var Unity = { start: new Point(0, 0), end: new Point(1, 0) }; >Unity : { start: Point; end: Point; } @@ -23,8 +25,12 @@ module A { >start : Point >new Point(0, 0) : Point >Point : typeof Point +>0 : number +>0 : number >end : Point >new Point(1, 0) : Point >Point : typeof Point +>1 : number +>0 : number } diff --git a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.symbols b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.symbols new file mode 100644 index 00000000000..3c1ca13b616 --- /dev/null +++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.symbols @@ -0,0 +1,31 @@ +=== tests/cases/conformance/internalModules/exportDeclarations/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts === +module A { +>A : Symbol(A, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 0, 0)) + + class Point { +>Point : Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 0, 10)) + + constructor(public x: number, public y: number) { } +>x : Symbol(x, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 3, 20)) +>y : Symbol(y, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 3, 37)) + } + + export var UnitSquare : { +>UnitSquare : Symbol(UnitSquare, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 6, 14)) + + top: { left: Point, right: Point }, +>top : Symbol(top, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 6, 29)) +>left : Symbol(left, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 7, 14)) +>Point : Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 0, 10)) +>right : Symbol(right, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 7, 27)) +>Point : Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 0, 10)) + + bottom: { left: Point, right: Point } +>bottom : Symbol(bottom, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 7, 43)) +>left : Symbol(left, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 8, 17)) +>Point : Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 0, 10)) +>right : Symbol(right, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 8, 30)) +>Point : Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 0, 10)) + + } = null; +} diff --git a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.types b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.types index a4284a8f410..12a8cd974ad 100644 --- a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.types +++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.types @@ -28,4 +28,5 @@ module A { >Point : Point } = null; +>null : null } diff --git a/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.symbols b/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.symbols new file mode 100644 index 00000000000..f56b2f526d4 --- /dev/null +++ b/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/internalModules/exportDeclarations/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts === +module A { +>A : Symbol(A, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 0, 0)) + + class B { +>B : Symbol(B, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 0, 10)) + + id: number; +>id : Symbol(id, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 1, 13)) + } + + export var beez: Array; +>beez : Symbol(beez, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 5, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>B : Symbol(B, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 0, 10)) + + export var beez2 = new Array(); +>beez2 : Symbol(beez2, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 6, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>B : Symbol(B, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 0, 10)) +} diff --git a/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.symbols b/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.symbols new file mode 100644 index 00000000000..55ba5fd0cf3 --- /dev/null +++ b/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.symbols @@ -0,0 +1,22 @@ +=== tests/cases/conformance/internalModules/exportDeclarations/ExportVariableWithAccessibleTypeInTypeAnnotation.ts === +module A { +>A : Symbol(A, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 0, 0)) + + export interface Point { +>Point : Symbol(Point, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 0, 10)) + + x: number; +>x : Symbol(x, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 2, 28)) + + y: number; +>y : Symbol(y, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 3, 18)) + } + + // valid since Point is exported + export var Origin: Point = { x: 0, y: 0 }; +>Origin : Symbol(Origin, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 8, 14)) +>Point : Symbol(Point, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 0, 10)) +>x : Symbol(x, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 8, 32)) +>y : Symbol(y, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 8, 38)) +} + diff --git a/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.types b/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.types index 945a4be6fe5..faf86ea6982 100644 --- a/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.types +++ b/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.types @@ -18,6 +18,8 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } diff --git a/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.symbols b/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.symbols new file mode 100644 index 00000000000..ac43ccea789 --- /dev/null +++ b/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.symbols @@ -0,0 +1,38 @@ +=== tests/cases/conformance/internalModules/exportDeclarations/ExportVariableWithInaccessibleTypeInTypeAnnotation.ts === +module A { +>A : Symbol(A, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 0, 0)) + + export interface Point { +>Point : Symbol(Point, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 0, 10)) + + x: number; +>x : Symbol(x, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 2, 28)) + + y: number; +>y : Symbol(y, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 3, 18)) + } + + // valid since Point is exported + export var Origin: Point = { x: 0, y: 0 }; +>Origin : Symbol(Origin, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 8, 14)) +>Point : Symbol(Point, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 0, 10)) +>x : Symbol(x, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 8, 32)) +>y : Symbol(y, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 8, 38)) + + interface Point3d extends Point { +>Point3d : Symbol(Point3d, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 8, 46)) +>Point : Symbol(Point, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 0, 10)) + + z: number; +>z : Symbol(z, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 10, 37)) + } + + // invalid Point3d is not exported + export var Origin3d: Point3d = { x: 0, y: 0, z: 0 }; +>Origin3d : Symbol(Origin3d, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 15, 14)) +>Point3d : Symbol(Point3d, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 8, 46)) +>x : Symbol(x, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 15, 36)) +>y : Symbol(y, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 15, 42)) +>z : Symbol(z, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 15, 48)) +} + diff --git a/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.types b/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.types index 9ae05f87416..4ce1912d441 100644 --- a/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.types +++ b/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.types @@ -18,7 +18,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number interface Point3d extends Point { >Point3d : Point3d @@ -34,7 +36,10 @@ module A { >Point3d : Point3d >{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } >x : number +>0 : number >y : number +>0 : number >z : number +>0 : number } diff --git a/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.symbols b/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.symbols new file mode 100644 index 00000000000..96963246d26 --- /dev/null +++ b/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.symbols @@ -0,0 +1,52 @@ +=== tests/cases/conformance/internalModules/DeclarationMerging/function.ts === +module A { +>A : Symbol(A, Decl(function.ts, 0, 0)) + + export function Point() { +>Point : Symbol(Point, Decl(function.ts, 0, 10)) + + return { x: 0, y: 0 }; +>x : Symbol(x, Decl(function.ts, 2, 16)) +>y : Symbol(y, Decl(function.ts, 2, 22)) + } +} + +=== tests/cases/conformance/internalModules/DeclarationMerging/module.ts === +module B { +>B : Symbol(B, Decl(module.ts, 0, 0)) + + export module Point { +>Point : Symbol(Point, Decl(module.ts, 0, 10)) + + export var Origin = { x: 0, y: 0 }; +>Origin : Symbol(Origin, Decl(module.ts, 2, 18)) +>x : Symbol(x, Decl(module.ts, 2, 29)) +>y : Symbol(y, Decl(module.ts, 2, 35)) + } +} + +=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts === +var fn: () => { x: number; y: number }; +>fn : Symbol(fn, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3)) +>x : Symbol(x, Decl(test.ts, 0, 15)) +>y : Symbol(y, Decl(test.ts, 0, 26)) + +var fn = A.Point; +>fn : Symbol(fn, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3)) +>A.Point : Symbol(A.Point, Decl(function.ts, 0, 10)) +>A : Symbol(A, Decl(function.ts, 0, 0)) +>Point : Symbol(A.Point, Decl(function.ts, 0, 10)) + +var cl: { x: number; y: number; } +>cl : Symbol(cl, Decl(test.ts, 3, 3), Decl(test.ts, 4, 3)) +>x : Symbol(x, Decl(test.ts, 3, 9)) +>y : Symbol(y, Decl(test.ts, 3, 20)) + +var cl = B.Point.Origin; +>cl : Symbol(cl, Decl(test.ts, 3, 3), Decl(test.ts, 4, 3)) +>B.Point.Origin : Symbol(B.Point.Origin, Decl(module.ts, 2, 18)) +>B.Point : Symbol(B.Point, Decl(module.ts, 0, 10)) +>B : Symbol(B, Decl(module.ts, 0, 0)) +>Point : Symbol(B.Point, Decl(module.ts, 0, 10)) +>Origin : Symbol(B.Point.Origin, Decl(module.ts, 2, 18)) + diff --git a/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.types b/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.types index 879088f93df..fe976cd0a3b 100644 --- a/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.types +++ b/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.types @@ -8,7 +8,9 @@ module A { return { x: 0, y: 0 }; >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } } @@ -23,7 +25,9 @@ module B { >Origin : { x: number; y: number; } >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } } diff --git a/tests/baselines/reference/FunctionDeclaration2_es6.symbols b/tests/baselines/reference/FunctionDeclaration2_es6.symbols new file mode 100644 index 00000000000..ad9241abaf1 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration2_es6.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration2_es6.ts === +function f(yield) { +>f : Symbol(f, Decl(FunctionDeclaration2_es6.ts, 0, 0)) +>yield : Symbol(yield, Decl(FunctionDeclaration2_es6.ts, 0, 11)) +} diff --git a/tests/baselines/reference/FunctionDeclaration4_es6.symbols b/tests/baselines/reference/FunctionDeclaration4_es6.symbols new file mode 100644 index 00000000000..badb1695cdc --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration4_es6.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration4_es6.ts === +function yield() { +>yield : Symbol(yield, Decl(FunctionDeclaration4_es6.ts, 0, 0)) +} diff --git a/tests/baselines/reference/FunctionDeclaration9_es6.js b/tests/baselines/reference/FunctionDeclaration9_es6.js index bca309d2d62..e19d862f21b 100644 --- a/tests/baselines/reference/FunctionDeclaration9_es6.js +++ b/tests/baselines/reference/FunctionDeclaration9_es6.js @@ -5,6 +5,6 @@ function * foo() { //// [FunctionDeclaration9_es6.js] function foo() { - var v = (_a = {}, _a[] = foo, _a); + var v = (_a = {}, _a[yield] = foo, _a); var _a; } diff --git a/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.symbols b/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.symbols new file mode 100644 index 00000000000..72eb0340eb2 --- /dev/null +++ b/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.symbols @@ -0,0 +1,42 @@ +=== tests/cases/conformance/internalModules/DeclarationMerging/ModuleAndEnumWithSameNameAndCommonRoot.ts === +module enumdule { +>enumdule : Symbol(enumdule, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 0), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 5, 1)) + + export class Point { +>Point : Symbol(Point, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 17)) + + constructor(public x: number, public y: number) { } +>x : Symbol(x, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 3, 20)) +>y : Symbol(y, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 3, 37)) + } +} + +enum enumdule { +>enumdule : Symbol(enumdule, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 0), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 5, 1)) + + Red, Blue +>Red : Symbol(enumdule.Red, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 7, 15)) +>Blue : Symbol(enumdule.Blue, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 8, 8)) +} + +var x: enumdule; +>x : Symbol(x, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 11, 3), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 12, 3)) +>enumdule : Symbol(enumdule, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 0), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 5, 1)) + +var x = enumdule.Red; +>x : Symbol(x, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 11, 3), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 12, 3)) +>enumdule.Red : Symbol(enumdule.Red, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 7, 15)) +>enumdule : Symbol(enumdule, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 0), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 5, 1)) +>Red : Symbol(enumdule.Red, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 7, 15)) + +var y: { x: number; y: number }; +>y : Symbol(y, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 14, 3), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 15, 3)) +>x : Symbol(x, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 14, 8)) +>y : Symbol(y, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 14, 19)) + +var y = new enumdule.Point(0, 0); +>y : Symbol(y, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 14, 3), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 15, 3)) +>enumdule.Point : Symbol(enumdule.Point, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 17)) +>enumdule : Symbol(enumdule, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 0), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 5, 1)) +>Point : Symbol(enumdule.Point, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 17)) + diff --git a/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.types b/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.types index 023511c8c4d..343b69954b0 100644 --- a/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.types +++ b/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.types @@ -40,4 +40,6 @@ var y = new enumdule.Point(0, 0); >enumdule.Point : typeof enumdule.Point >enumdule : typeof enumdule >Point : typeof enumdule.Point +>0 : number +>0 : number diff --git a/tests/baselines/reference/Protected5.symbols b/tests/baselines/reference/Protected5.symbols new file mode 100644 index 00000000000..a4c91729ed3 --- /dev/null +++ b/tests/baselines/reference/Protected5.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/Protected/Protected5.ts === +class C { +>C : Symbol(C, Decl(Protected5.ts, 0, 0)) + + protected static m() { } +>m : Symbol(C.m, Decl(Protected5.ts, 0, 9)) +} diff --git a/tests/baselines/reference/Protected8.symbols b/tests/baselines/reference/Protected8.symbols new file mode 100644 index 00000000000..502e68bb9c2 --- /dev/null +++ b/tests/baselines/reference/Protected8.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/parser/ecmascript5/Protected/Protected8.ts === +interface I { +>I : Symbol(I, Decl(Protected8.ts, 0, 0)) + + protected +>protected : Symbol(protected, Decl(Protected8.ts, 0, 13)) + + p +>p : Symbol(p, Decl(Protected8.ts, 1, 12)) +} diff --git a/tests/baselines/reference/Protected9.symbols b/tests/baselines/reference/Protected9.symbols new file mode 100644 index 00000000000..27ce91344e4 --- /dev/null +++ b/tests/baselines/reference/Protected9.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/Protected/Protected9.ts === +class C { +>C : Symbol(C, Decl(Protected9.ts, 0, 0)) + + constructor(protected p) { } +>p : Symbol(p, Decl(Protected9.ts, 1, 15)) +} diff --git a/tests/baselines/reference/TupleType1.symbols b/tests/baselines/reference/TupleType1.symbols new file mode 100644 index 00000000000..9f4b2c78a8e --- /dev/null +++ b/tests/baselines/reference/TupleType1.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType1.ts === +var v: [number] +>v : Symbol(v, Decl(TupleType1.ts, 0, 3)) + diff --git a/tests/baselines/reference/TupleType2.symbols b/tests/baselines/reference/TupleType2.symbols new file mode 100644 index 00000000000..5ef9209147a --- /dev/null +++ b/tests/baselines/reference/TupleType2.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType2.ts === +var v: [number, string] +>v : Symbol(v, Decl(TupleType2.ts, 0, 3)) + diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.symbols b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.symbols new file mode 100644 index 00000000000..c9e2c124e9d --- /dev/null +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.symbols @@ -0,0 +1,96 @@ +=== tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts === +module A { +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 5, 1)) + + export class Point { +>Point : Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 10)) + + x: number; +>x : Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 1, 24)) + + y: number; +>y : Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 2, 18)) + } +} + +module A { +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 5, 1)) + + class Point { +>Point : Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 7, 10)) + + fromCarthesian(p: A.Point) { +>fromCarthesian : Symbol(fromCarthesian, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 8, 17)) +>p : Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 9, 23)) +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 5, 1)) +>Point : Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 10)) + + return { x: p.x, y: p.y }; +>x : Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 10, 20)) +>p.x : Symbol(Point.x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 1, 24)) +>p : Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 9, 23)) +>x : Symbol(Point.x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 1, 24)) +>y : Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 10, 28)) +>p.y : Symbol(Point.y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 2, 18)) +>p : Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 9, 23)) +>y : Symbol(Point.y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 2, 18)) + } + } +} + +// ensure merges as expected +var p: { x: number; y: number; }; +>p : Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 16, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 17, 3)) +>x : Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 16, 8)) +>y : Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 16, 19)) + +var p: A.Point; +>p : Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 16, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 17, 3)) +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 5, 1)) +>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 10)) + +module X.Y.Z { +>X : Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 17, 15), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 23, 1)) +>Y : Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 9), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 25, 10)) +>Z : Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 11), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 26, 21)) + + export class Line { +>Line : Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 14)) + + length: number; +>length : Symbol(length, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 20, 23)) + } +} + +module X { +>X : Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 17, 15), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 23, 1)) + + export module Y { +>Y : Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 9), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 25, 10)) + + export module Z { +>Z : Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 11), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 26, 21)) + + class Line { +>Line : Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 27, 25)) + + name: string; +>name : Symbol(name, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 28, 24)) + } + } + } +} + +// ensure merges as expected +var l: { length: number; } +>l : Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 36, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 37, 3)) +>length : Symbol(length, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 36, 8)) + +var l: X.Y.Z.Line; +>l : Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 36, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 37, 3)) +>X : Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 17, 15), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 23, 1)) +>Y : Symbol(X.Y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 9), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 25, 10)) +>Z : Symbol(X.Y.Z, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 11), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 26, 21)) +>Line : Symbol(X.Y.Z.Line, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 14)) + + diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.types b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.types index a856b699dd5..25c23b83273 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.types +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.types @@ -22,7 +22,7 @@ module A { fromCarthesian(p: A.Point) { >fromCarthesian : (p: A.Point) => { x: number; y: number; } >p : A.Point ->A : unknown +>A : any >Point : A.Point return { x: p.x, y: p.y }; @@ -47,7 +47,7 @@ var p: { x: number; y: number; }; var p: A.Point; >p : { x: number; y: number; } ->A : unknown +>A : any >Point : A.Point module X.Y.Z { @@ -89,9 +89,9 @@ var l: { length: number; } var l: X.Y.Z.Line; >l : { length: number; } ->X : unknown ->Y : unknown ->Z : unknown +>X : any +>Y : any +>Z : any >Line : X.Y.Z.Line diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.symbols b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.symbols new file mode 100644 index 00000000000..2fcf3c4b09e --- /dev/null +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.symbols @@ -0,0 +1,103 @@ +=== tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts === +module A { +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1)) + + export interface Point { +>Point : Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10)) + + x: number; +>x : Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 1, 28)) + + y: number; +>y : Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 2, 18)) + + toCarth(): Point; +>toCarth : Symbol(toCarth, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 3, 18)) +>Point : Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10)) + } +} + +module A { +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1)) + + interface Point { +>Point : Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 8, 10)) + + fromCarth(): Point; +>fromCarth : Symbol(fromCarth, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 9, 21)) +>Point : Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 8, 10)) + } +} + +// ensure merges as expected +var p: { x: number; y: number; toCarth(): A.Point; }; +>p : Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 15, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 16, 3)) +>x : Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 15, 8)) +>y : Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 15, 19)) +>toCarth : Symbol(toCarth, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 15, 30)) +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1)) +>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10)) + +var p: A.Point; +>p : Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 15, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 16, 3)) +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1)) +>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10)) + +module X.Y.Z { +>X : Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 16, 15), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 22, 1)) +>Y : Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 9), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 24, 10)) +>Z : Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 11), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 25, 20)) + + export interface Line { +>Line : Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 14)) + + new (start: A.Point, end: A.Point); +>start : Symbol(start, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 20, 13)) +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1)) +>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10)) +>end : Symbol(end, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 20, 28)) +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1)) +>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10)) + } +} + +module X { +>X : Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 16, 15), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 22, 1)) + + export module Y.Z { +>Y : Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 9), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 24, 10)) +>Z : Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 11), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 25, 20)) + + interface Line { +>Line : Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 25, 23)) + + start: A.Point; +>start : Symbol(start, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 26, 24)) +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1)) +>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10)) + + end: A.Point; +>end : Symbol(end, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 27, 27)) +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1)) +>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10)) + } + } +} + +// ensure merges as expected +var l: { new (s: A.Point, e: A.Point); } +>l : Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 34, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 35, 3)) +>s : Symbol(s, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 34, 14)) +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1)) +>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10)) +>e : Symbol(e, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 34, 25)) +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1)) +>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10)) + +var l: X.Y.Z.Line; +>l : Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 34, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 35, 3)) +>X : Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 16, 15), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 22, 1)) +>Y : Symbol(X.Y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 9), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 24, 10)) +>Z : Symbol(X.Y.Z, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 11), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 25, 20)) +>Line : Symbol(X.Y.Z.Line, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 14)) + diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.types b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.types index a8fc56495dd..309ad35d54f 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.types +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.types @@ -1,6 +1,6 @@ === tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts === module A { ->A : unknown +>A : any export interface Point { >Point : Point @@ -18,7 +18,7 @@ module A { } module A { ->A : unknown +>A : any interface Point { >Point : Point @@ -35,50 +35,50 @@ var p: { x: number; y: number; toCarth(): A.Point; }; >x : number >y : number >toCarth : () => A.Point ->A : unknown +>A : any >Point : A.Point var p: A.Point; >p : { x: number; y: number; toCarth(): A.Point; } ->A : unknown +>A : any >Point : A.Point module X.Y.Z { ->X : unknown ->Y : unknown ->Z : unknown +>X : any +>Y : any +>Z : any export interface Line { >Line : Line new (start: A.Point, end: A.Point); >start : A.Point ->A : unknown +>A : any >Point : A.Point >end : A.Point ->A : unknown +>A : any >Point : A.Point } } module X { ->X : unknown +>X : any export module Y.Z { ->Y : unknown ->Z : unknown +>Y : any +>Z : any interface Line { >Line : Line start: A.Point; >start : A.Point ->A : unknown +>A : any >Point : A.Point end: A.Point; >end : A.Point ->A : unknown +>A : any >Point : A.Point } } @@ -88,16 +88,16 @@ module X { var l: { new (s: A.Point, e: A.Point); } >l : new (s: A.Point, e: A.Point) => any >s : A.Point ->A : unknown +>A : any >Point : A.Point >e : A.Point ->A : unknown +>A : any >Point : A.Point var l: X.Y.Z.Line; >l : new (s: A.Point, e: A.Point) => any ->X : unknown ->Y : unknown ->Z : unknown +>X : any +>Y : any +>Z : any >Line : X.Y.Z.Line diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.symbols b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.symbols new file mode 100644 index 00000000000..b7402952dff --- /dev/null +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.symbols @@ -0,0 +1,120 @@ +=== tests/cases/conformance/internalModules/DeclarationMerging/part1.ts === +module A { +>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0)) + + export interface Point { +>Point : Symbol(Point, Decl(part1.ts, 0, 10)) + + x: number; +>x : Symbol(x, Decl(part1.ts, 1, 28)) + + y: number; +>y : Symbol(y, Decl(part1.ts, 2, 18)) + } + + export module Utils { +>Utils : Symbol(Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31)) + + export function mirror(p: T) { +>mirror : Symbol(mirror, Decl(part1.ts, 6, 25)) +>T : Symbol(T, Decl(part1.ts, 7, 31)) +>Point : Symbol(Point, Decl(part1.ts, 0, 10)) +>p : Symbol(p, Decl(part1.ts, 7, 48)) +>T : Symbol(T, Decl(part1.ts, 7, 31)) + + return { x: p.y, y: p.x }; +>x : Symbol(x, Decl(part1.ts, 8, 20)) +>p.y : Symbol(Point.y, Decl(part1.ts, 2, 18)) +>p : Symbol(p, Decl(part1.ts, 7, 48)) +>y : Symbol(Point.y, Decl(part1.ts, 2, 18)) +>y : Symbol(y, Decl(part1.ts, 8, 28)) +>p.x : Symbol(Point.x, Decl(part1.ts, 1, 28)) +>p : Symbol(p, Decl(part1.ts, 7, 48)) +>x : Symbol(Point.x, Decl(part1.ts, 1, 28)) + } + } + export var Origin: Point = { x: 0, y: 0 }; +>Origin : Symbol(Origin, Decl(part1.ts, 11, 14)) +>Point : Symbol(Point, Decl(part1.ts, 0, 10)) +>x : Symbol(x, Decl(part1.ts, 11, 32)) +>y : Symbol(y, Decl(part1.ts, 11, 38)) +} + +=== tests/cases/conformance/internalModules/DeclarationMerging/part2.ts === +module A { +>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0)) + + // not a collision, since we don't export + var Origin: string = "0,0"; +>Origin : Symbol(Origin, Decl(part2.ts, 2, 7)) + + export module Utils { +>Utils : Symbol(Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31)) + + export class Plane { +>Plane : Symbol(Plane, Decl(part2.ts, 4, 25)) + + constructor(public tl: Point, public br: Point) { } +>tl : Symbol(tl, Decl(part2.ts, 6, 24)) +>Point : Symbol(Point, Decl(part1.ts, 0, 10)) +>br : Symbol(br, Decl(part2.ts, 6, 41)) +>Point : Symbol(Point, Decl(part1.ts, 0, 10)) + } + } +} + +=== tests/cases/conformance/internalModules/DeclarationMerging/part3.ts === +// test the merging actually worked + +var o: { x: number; y: number }; +>o : Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3)) +>x : Symbol(x, Decl(part3.ts, 2, 8)) +>y : Symbol(y, Decl(part3.ts, 2, 19)) + +var o: A.Point; +>o : Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3)) +>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0)) +>Point : Symbol(A.Point, Decl(part1.ts, 0, 10)) + +var o = A.Origin; +>o : Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3)) +>A.Origin : Symbol(A.Origin, Decl(part1.ts, 11, 14)) +>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0)) +>Origin : Symbol(A.Origin, Decl(part1.ts, 11, 14)) + +var o = A.Utils.mirror(o); +>o : Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3)) +>A.Utils.mirror : Symbol(A.Utils.mirror, Decl(part1.ts, 6, 25)) +>A.Utils : Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31)) +>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0)) +>Utils : Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31)) +>mirror : Symbol(A.Utils.mirror, Decl(part1.ts, 6, 25)) +>o : Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3)) + +var p: { tl: A.Point; br: A.Point }; +>p : Symbol(p, Decl(part3.ts, 7, 3), Decl(part3.ts, 8, 3), Decl(part3.ts, 9, 3)) +>tl : Symbol(tl, Decl(part3.ts, 7, 8)) +>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0)) +>Point : Symbol(A.Point, Decl(part1.ts, 0, 10)) +>br : Symbol(br, Decl(part3.ts, 7, 21)) +>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0)) +>Point : Symbol(A.Point, Decl(part1.ts, 0, 10)) + +var p: A.Utils.Plane; +>p : Symbol(p, Decl(part3.ts, 7, 3), Decl(part3.ts, 8, 3), Decl(part3.ts, 9, 3)) +>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0)) +>Utils : Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31)) +>Plane : Symbol(A.Utils.Plane, Decl(part2.ts, 4, 25)) + +var p = new A.Utils.Plane(o, { x: 1, y: 1 }); +>p : Symbol(p, Decl(part3.ts, 7, 3), Decl(part3.ts, 8, 3), Decl(part3.ts, 9, 3)) +>A.Utils.Plane : Symbol(A.Utils.Plane, Decl(part2.ts, 4, 25)) +>A.Utils : Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31)) +>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0)) +>Utils : Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31)) +>Plane : Symbol(A.Utils.Plane, Decl(part2.ts, 4, 25)) +>o : Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3)) +>x : Symbol(x, Decl(part3.ts, 9, 30)) +>y : Symbol(y, Decl(part3.ts, 9, 36)) + + diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types index 003fb5fa15a..af3c0776b56 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types @@ -39,7 +39,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } === tests/cases/conformance/internalModules/DeclarationMerging/part2.ts === @@ -49,6 +51,7 @@ module A { // not a collision, since we don't export var Origin: string = "0,0"; >Origin : string +>"0,0" : string export module Utils { >Utils : typeof Utils @@ -75,7 +78,7 @@ var o: { x: number; y: number }; var o: A.Point; >o : { x: number; y: number; } ->A : unknown +>A : any >Point : A.Point var o = A.Origin; @@ -97,16 +100,16 @@ var o = A.Utils.mirror(o); var p: { tl: A.Point; br: A.Point }; >p : { tl: A.Point; br: A.Point; } >tl : A.Point ->A : unknown +>A : any >Point : A.Point >br : A.Point ->A : unknown +>A : any >Point : A.Point var p: A.Utils.Plane; >p : { tl: A.Point; br: A.Point; } ->A : unknown ->Utils : unknown +>A : any +>Utils : any >Plane : A.Utils.Plane var p = new A.Utils.Plane(o, { x: 1, y: 1 }); @@ -120,6 +123,8 @@ var p = new A.Utils.Plane(o, { x: 1, y: 1 }); >o : { x: number; y: number; } >{ x: 1, y: 1 } : { x: number; y: number; } >x : number +>1 : number >y : number +>1 : number diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.symbols b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.symbols new file mode 100644 index 00000000000..3e8fa64501f --- /dev/null +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.symbols @@ -0,0 +1,112 @@ +=== tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts === +module A { +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1)) + + export interface Point { +>Point : Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10)) + + x: number; +>x : Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 1, 28)) + + y: number; +>y : Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 2, 18)) + + toCarth(): Point; +>toCarth : Symbol(toCarth, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 3, 18)) +>Point : Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10)) + } +} + +module A { +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1)) + + export interface Point { +>Point : Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10)) + + fromCarth(): Point; +>fromCarth : Symbol(fromCarth, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 9, 28)) +>Point : Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10)) + } +} + +// ensure merges as expected +var p: { x: number; y: number; toCarth(): A.Point; fromCarth(): A.Point; }; +>p : Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 15, 3), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 16, 3)) +>x : Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 15, 8)) +>y : Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 15, 19)) +>toCarth : Symbol(toCarth, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 15, 30)) +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1)) +>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10)) +>fromCarth : Symbol(fromCarth, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 15, 50)) +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1)) +>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10)) + +var p: A.Point; +>p : Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 15, 3), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 16, 3)) +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1)) +>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10)) + +module X.Y.Z { +>X : Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 16, 15), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 22, 1)) +>Y : Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 9), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 24, 10)) +>Z : Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 11), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 25, 20)) + + export interface Line { +>Line : Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 14), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 25, 23)) + + new (start: A.Point, end: A.Point); +>start : Symbol(start, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 20, 13)) +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1)) +>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10)) +>end : Symbol(end, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 20, 28)) +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1)) +>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10)) + } +} + +module X { +>X : Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 16, 15), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 22, 1)) + + export module Y.Z { +>Y : Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 9), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 24, 10)) +>Z : Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 11), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 25, 20)) + + export interface Line { +>Line : Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 14), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 25, 23)) + + start: A.Point; +>start : Symbol(start, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 26, 31)) +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1)) +>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10)) + + end: A.Point; +>end : Symbol(end, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 27, 27)) +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1)) +>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10)) + } + } +} + +// ensure merges as expected +var l: { start: A.Point; end: A.Point; new (s: A.Point, e: A.Point); } +>l : Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 34, 3), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 35, 3)) +>start : Symbol(start, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 34, 8)) +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1)) +>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10)) +>end : Symbol(end, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 34, 24)) +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1)) +>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10)) +>s : Symbol(s, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 34, 44)) +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1)) +>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10)) +>e : Symbol(e, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 34, 55)) +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1)) +>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10)) + +var l: X.Y.Z.Line; +>l : Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 34, 3), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 35, 3)) +>X : Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 16, 15), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 22, 1)) +>Y : Symbol(X.Y, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 9), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 24, 10)) +>Z : Symbol(X.Y.Z, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 11), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 25, 20)) +>Line : Symbol(X.Y.Z.Line, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 14), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 25, 23)) + diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.types b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.types index c54ad5f3ad9..5795beda4a9 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.types +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.types @@ -1,6 +1,6 @@ === tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts === module A { ->A : unknown +>A : any export interface Point { >Point : Point @@ -18,7 +18,7 @@ module A { } module A { ->A : unknown +>A : any export interface Point { >Point : Point @@ -35,53 +35,53 @@ var p: { x: number; y: number; toCarth(): A.Point; fromCarth(): A.Point; }; >x : number >y : number >toCarth : () => A.Point ->A : unknown +>A : any >Point : A.Point >fromCarth : () => A.Point ->A : unknown +>A : any >Point : A.Point var p: A.Point; >p : { x: number; y: number; toCarth(): A.Point; fromCarth(): A.Point; } ->A : unknown +>A : any >Point : A.Point module X.Y.Z { ->X : unknown ->Y : unknown ->Z : unknown +>X : any +>Y : any +>Z : any export interface Line { >Line : Line new (start: A.Point, end: A.Point); >start : A.Point ->A : unknown +>A : any >Point : A.Point >end : A.Point ->A : unknown +>A : any >Point : A.Point } } module X { ->X : unknown +>X : any export module Y.Z { ->Y : unknown ->Z : unknown +>Y : any +>Z : any export interface Line { >Line : Line start: A.Point; >start : A.Point ->A : unknown +>A : any >Point : A.Point end: A.Point; >end : A.Point ->A : unknown +>A : any >Point : A.Point } } @@ -91,22 +91,22 @@ module X { var l: { start: A.Point; end: A.Point; new (s: A.Point, e: A.Point); } >l : { new (s: A.Point, e: A.Point): any; start: A.Point; end: A.Point; } >start : A.Point ->A : unknown +>A : any >Point : A.Point >end : A.Point ->A : unknown +>A : any >Point : A.Point >s : A.Point ->A : unknown +>A : any >Point : A.Point >e : A.Point ->A : unknown +>A : any >Point : A.Point var l: X.Y.Z.Line; >l : { new (s: A.Point, e: A.Point): any; start: A.Point; end: A.Point; } ->X : unknown ->Y : unknown ->Z : unknown +>X : any +>Y : any +>Z : any >Line : X.Y.Z.Line diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.symbols b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.symbols new file mode 100644 index 00000000000..e8187771695 --- /dev/null +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.symbols @@ -0,0 +1,76 @@ +=== tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts === +module A.B { +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 2, 1)) +>B : Symbol(B, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 0, 9)) + + export var x: number; +>x : Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 1, 14)) +} + +module A{ +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 2, 1)) + + module B { +>B : Symbol(B, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 4, 9)) + + export var x: string; +>x : Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 6, 18)) + } +} + +// ensure the right var decl is exported +var x: number; +>x : Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 11, 3), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 12, 3)) + +var x = A.B.x; +>x : Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 11, 3), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 12, 3)) +>A.B.x : Symbol(A.B.x, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 1, 14)) +>A.B : Symbol(A.B, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 0, 9)) +>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 2, 1)) +>B : Symbol(A.B, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 0, 9)) +>x : Symbol(A.B.x, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 1, 14)) + +module X.Y.Z { +>X : Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 12, 14), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 18, 1)) +>Y : Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 9), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 20, 10)) +>Z : Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 11)) + + export class Line { +>Line : Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 14)) + + length: number; +>length : Symbol(length, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 15, 23)) + } +} + +module X { +>X : Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 12, 14), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 18, 1)) + + export module Y { +>Y : Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 9), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 20, 10)) + + module Z { +>Z : Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 21, 21)) + + export class Line { +>Line : Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 22, 18)) + + name: string; +>name : Symbol(name, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 23, 31)) + } + } + } +} + +// make sure merging works as expected +var l: { length: number }; +>l : Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 31, 3), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 32, 3)) +>length : Symbol(length, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 31, 8)) + +var l: X.Y.Z.Line; +>l : Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 31, 3), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 32, 3)) +>X : Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 12, 14), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 18, 1)) +>Y : Symbol(X.Y, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 9), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 20, 10)) +>Z : Symbol(X.Y.Z, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 11)) +>Line : Symbol(X.Y.Z.Line, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 14)) + diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.types b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.types index 9232af469ac..a19e0839901 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.types +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.types @@ -69,8 +69,8 @@ var l: { length: number }; var l: X.Y.Z.Line; >l : { length: number; } ->X : unknown ->Y : unknown ->Z : unknown +>X : any +>Y : any +>Z : any >Line : X.Y.Z.Line diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.symbols b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.symbols new file mode 100644 index 00000000000..5c533273fa6 --- /dev/null +++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.symbols @@ -0,0 +1,76 @@ +=== tests/cases/conformance/internalModules/DeclarationMerging/part1.ts === +module Root { +>Root : Symbol(Root, Decl(part1.ts, 0, 0)) + + export module A { +>A : Symbol(A, Decl(part1.ts, 0, 13)) + + export interface Point { +>Point : Symbol(Point, Decl(part1.ts, 1, 21)) + + x: number; +>x : Symbol(x, Decl(part1.ts, 2, 32)) + + y: number; +>y : Symbol(y, Decl(part1.ts, 3, 22)) + } + + export module Utils { +>Utils : Symbol(Utils, Decl(part1.ts, 5, 9)) + + export function mirror(p: T) { +>mirror : Symbol(mirror, Decl(part1.ts, 7, 29)) +>T : Symbol(T, Decl(part1.ts, 8, 35)) +>Point : Symbol(Point, Decl(part1.ts, 1, 21)) +>p : Symbol(p, Decl(part1.ts, 8, 52)) +>T : Symbol(T, Decl(part1.ts, 8, 35)) + + return { x: p.y, y: p.x }; +>x : Symbol(x, Decl(part1.ts, 9, 24)) +>p.y : Symbol(Point.y, Decl(part1.ts, 3, 22)) +>p : Symbol(p, Decl(part1.ts, 8, 52)) +>y : Symbol(Point.y, Decl(part1.ts, 3, 22)) +>y : Symbol(y, Decl(part1.ts, 9, 32)) +>p.x : Symbol(Point.x, Decl(part1.ts, 2, 32)) +>p : Symbol(p, Decl(part1.ts, 8, 52)) +>x : Symbol(Point.x, Decl(part1.ts, 2, 32)) + } + } + } +} + +=== tests/cases/conformance/internalModules/DeclarationMerging/part2.ts === +module otherRoot { +>otherRoot : Symbol(otherRoot, Decl(part2.ts, 0, 0)) + + export module A { +>A : Symbol(A, Decl(part2.ts, 0, 18)) + + // have to be fully qualified since in different root + export var Origin: Root.A.Point = { x: 0, y: 0 }; +>Origin : Symbol(Origin, Decl(part2.ts, 3, 18)) +>Root : Symbol(Root, Decl(part1.ts, 0, 0)) +>A : Symbol(Root.A, Decl(part1.ts, 0, 13)) +>Point : Symbol(Root.A.Point, Decl(part1.ts, 1, 21)) +>x : Symbol(x, Decl(part2.ts, 3, 43)) +>y : Symbol(y, Decl(part2.ts, 3, 49)) + + export module Utils { +>Utils : Symbol(Utils, Decl(part2.ts, 3, 57)) + + export class Plane { +>Plane : Symbol(Plane, Decl(part2.ts, 5, 29)) + + constructor(public tl: Root.A.Point, public br: Root.A.Point) { } +>tl : Symbol(tl, Decl(part2.ts, 7, 28)) +>Root : Symbol(Root, Decl(part1.ts, 0, 0)) +>A : Symbol(Root.A, Decl(part1.ts, 0, 13)) +>Point : Symbol(Root.A.Point, Decl(part1.ts, 1, 21)) +>br : Symbol(br, Decl(part2.ts, 7, 52)) +>Root : Symbol(Root, Decl(part1.ts, 0, 0)) +>A : Symbol(Root.A, Decl(part1.ts, 0, 13)) +>Point : Symbol(Root.A.Point, Decl(part1.ts, 1, 21)) + } + } + } +} diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types index b31bb4b22ac..e005522ddfc 100644 --- a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types +++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types @@ -50,12 +50,14 @@ module otherRoot { // have to be fully qualified since in different root export var Origin: Root.A.Point = { x: 0, y: 0 }; >Origin : Root.A.Point ->Root : unknown ->A : unknown +>Root : any +>A : any >Point : Root.A.Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number export module Utils { >Utils : typeof Utils @@ -65,12 +67,12 @@ module otherRoot { constructor(public tl: Root.A.Point, public br: Root.A.Point) { } >tl : Root.A.Point ->Root : unknown ->A : unknown +>Root : any +>A : any >Point : Root.A.Point >br : Root.A.Point ->Root : unknown ->A : unknown +>Root : any +>A : any >Point : Root.A.Point } } diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.symbols b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.symbols new file mode 100644 index 00000000000..34abd4ecd65 --- /dev/null +++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.symbols @@ -0,0 +1,117 @@ +=== tests/cases/conformance/internalModules/DeclarationMerging/part1.ts === +module A { +>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0)) + + export interface Point { +>Point : Symbol(Point, Decl(part1.ts, 0, 10)) + + x: number; +>x : Symbol(x, Decl(part1.ts, 1, 28)) + + y: number; +>y : Symbol(y, Decl(part1.ts, 2, 18)) + } + + export module Utils { +>Utils : Symbol(Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46)) + + export function mirror(p: T) { +>mirror : Symbol(mirror, Decl(part1.ts, 6, 25)) +>T : Symbol(T, Decl(part1.ts, 7, 31)) +>Point : Symbol(Point, Decl(part1.ts, 0, 10)) +>p : Symbol(p, Decl(part1.ts, 7, 48)) +>T : Symbol(T, Decl(part1.ts, 7, 31)) + + return { x: p.y, y: p.x }; +>x : Symbol(x, Decl(part1.ts, 8, 20)) +>p.y : Symbol(Point.y, Decl(part1.ts, 2, 18)) +>p : Symbol(p, Decl(part1.ts, 7, 48)) +>y : Symbol(Point.y, Decl(part1.ts, 2, 18)) +>y : Symbol(y, Decl(part1.ts, 8, 28)) +>p.x : Symbol(Point.x, Decl(part1.ts, 1, 28)) +>p : Symbol(p, Decl(part1.ts, 7, 48)) +>x : Symbol(Point.x, Decl(part1.ts, 1, 28)) + } + } +} + +=== tests/cases/conformance/internalModules/DeclarationMerging/part2.ts === +module A { +>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0)) + + export var Origin: Point = { x: 0, y: 0 }; +>Origin : Symbol(Origin, Decl(part2.ts, 1, 14)) +>Point : Symbol(Point, Decl(part1.ts, 0, 10)) +>x : Symbol(x, Decl(part2.ts, 1, 32)) +>y : Symbol(y, Decl(part2.ts, 1, 38)) + + export module Utils { +>Utils : Symbol(Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46)) + + export class Plane { +>Plane : Symbol(Plane, Decl(part2.ts, 3, 25)) + + constructor(public tl: Point, public br: Point) { } +>tl : Symbol(tl, Decl(part2.ts, 5, 24)) +>Point : Symbol(Point, Decl(part1.ts, 0, 10)) +>br : Symbol(br, Decl(part2.ts, 5, 41)) +>Point : Symbol(Point, Decl(part1.ts, 0, 10)) + } + } +} + +=== tests/cases/conformance/internalModules/DeclarationMerging/part3.ts === +// test the merging actually worked + +var o: { x: number; y: number }; +>o : Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3)) +>x : Symbol(x, Decl(part3.ts, 2, 8)) +>y : Symbol(y, Decl(part3.ts, 2, 19)) + +var o: A.Point; +>o : Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3)) +>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0)) +>Point : Symbol(A.Point, Decl(part1.ts, 0, 10)) + +var o = A.Origin; +>o : Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3)) +>A.Origin : Symbol(A.Origin, Decl(part2.ts, 1, 14)) +>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0)) +>Origin : Symbol(A.Origin, Decl(part2.ts, 1, 14)) + +var o = A.Utils.mirror(o); +>o : Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3)) +>A.Utils.mirror : Symbol(A.Utils.mirror, Decl(part1.ts, 6, 25)) +>A.Utils : Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46)) +>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0)) +>Utils : Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46)) +>mirror : Symbol(A.Utils.mirror, Decl(part1.ts, 6, 25)) +>o : Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3)) + +var p: { tl: A.Point; br: A.Point }; +>p : Symbol(p, Decl(part3.ts, 7, 3), Decl(part3.ts, 8, 3), Decl(part3.ts, 9, 3)) +>tl : Symbol(tl, Decl(part3.ts, 7, 8)) +>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0)) +>Point : Symbol(A.Point, Decl(part1.ts, 0, 10)) +>br : Symbol(br, Decl(part3.ts, 7, 21)) +>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0)) +>Point : Symbol(A.Point, Decl(part1.ts, 0, 10)) + +var p: A.Utils.Plane; +>p : Symbol(p, Decl(part3.ts, 7, 3), Decl(part3.ts, 8, 3), Decl(part3.ts, 9, 3)) +>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0)) +>Utils : Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46)) +>Plane : Symbol(A.Utils.Plane, Decl(part2.ts, 3, 25)) + +var p = new A.Utils.Plane(o, { x: 1, y: 1 }); +>p : Symbol(p, Decl(part3.ts, 7, 3), Decl(part3.ts, 8, 3), Decl(part3.ts, 9, 3)) +>A.Utils.Plane : Symbol(A.Utils.Plane, Decl(part2.ts, 3, 25)) +>A.Utils : Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46)) +>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0)) +>Utils : Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46)) +>Plane : Symbol(A.Utils.Plane, Decl(part2.ts, 3, 25)) +>o : Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3)) +>x : Symbol(x, Decl(part3.ts, 9, 30)) +>y : Symbol(y, Decl(part3.ts, 9, 36)) + + diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types index b13cbde5522..e2dd1f400f4 100644 --- a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types +++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types @@ -45,7 +45,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number export module Utils { >Utils : typeof Utils @@ -72,7 +74,7 @@ var o: { x: number; y: number }; var o: A.Point; >o : { x: number; y: number; } ->A : unknown +>A : any >Point : A.Point var o = A.Origin; @@ -94,16 +96,16 @@ var o = A.Utils.mirror(o); var p: { tl: A.Point; br: A.Point }; >p : { tl: A.Point; br: A.Point; } >tl : A.Point ->A : unknown +>A : any >Point : A.Point >br : A.Point ->A : unknown +>A : any >Point : A.Point var p: A.Utils.Plane; >p : { tl: A.Point; br: A.Point; } ->A : unknown ->Utils : unknown +>A : any +>Utils : any >Plane : A.Utils.Plane var p = new A.Utils.Plane(o, { x: 1, y: 1 }); @@ -117,6 +119,8 @@ var p = new A.Utils.Plane(o, { x: 1, y: 1 }); >o : { x: number; y: number; } >{ x: 1, y: 1 } : { x: number; y: number; } >x : number +>1 : number >y : number +>1 : number diff --git a/tests/baselines/reference/TypeGuardWithArrayUnion.symbols b/tests/baselines/reference/TypeGuardWithArrayUnion.symbols new file mode 100644 index 00000000000..57bcdf70e79 --- /dev/null +++ b/tests/baselines/reference/TypeGuardWithArrayUnion.symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/expressions/typeGuards/TypeGuardWithArrayUnion.ts === +class Message { +>Message : Symbol(Message, Decl(TypeGuardWithArrayUnion.ts, 0, 0)) + + value: string; +>value : Symbol(value, Decl(TypeGuardWithArrayUnion.ts, 0, 15)) +} + +function saySize(message: Message | Message[]) { +>saySize : Symbol(saySize, Decl(TypeGuardWithArrayUnion.ts, 2, 1)) +>message : Symbol(message, Decl(TypeGuardWithArrayUnion.ts, 4, 17)) +>Message : Symbol(Message, Decl(TypeGuardWithArrayUnion.ts, 0, 0)) +>Message : Symbol(Message, Decl(TypeGuardWithArrayUnion.ts, 0, 0)) + + if (message instanceof Array) { +>message : Symbol(message, Decl(TypeGuardWithArrayUnion.ts, 4, 17)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + + return message.length; // Should have type Message[] here +>message.length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>message : Symbol(message, Decl(TypeGuardWithArrayUnion.ts, 4, 17)) +>length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) + } +} + diff --git a/tests/baselines/reference/TypeGuardWithEnumUnion.symbols b/tests/baselines/reference/TypeGuardWithEnumUnion.symbols new file mode 100644 index 00000000000..92b83f3c56d --- /dev/null +++ b/tests/baselines/reference/TypeGuardWithEnumUnion.symbols @@ -0,0 +1,88 @@ +=== tests/cases/conformance/expressions/typeGuards/TypeGuardWithEnumUnion.ts === +enum Color { R, G, B } +>Color : Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0)) +>R : Symbol(Color.R, Decl(TypeGuardWithEnumUnion.ts, 0, 12)) +>G : Symbol(Color.G, Decl(TypeGuardWithEnumUnion.ts, 0, 15)) +>B : Symbol(Color.B, Decl(TypeGuardWithEnumUnion.ts, 0, 18)) + +function f1(x: Color | string) { +>f1 : Symbol(f1, Decl(TypeGuardWithEnumUnion.ts, 0, 22)) +>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12)) +>Color : Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0)) + + if (typeof x === "number") { +>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12)) + + var y = x; +>y : Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 4, 11), Decl(TypeGuardWithEnumUnion.ts, 5, 11)) +>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12)) + + var y: Color; +>y : Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 4, 11), Decl(TypeGuardWithEnumUnion.ts, 5, 11)) +>Color : Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0)) + } + else { + var z = x; +>z : Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 8, 11), Decl(TypeGuardWithEnumUnion.ts, 9, 11)) +>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12)) + + var z: string; +>z : Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 8, 11), Decl(TypeGuardWithEnumUnion.ts, 9, 11)) + } +} + +function f2(x: Color | string | string[]) { +>f2 : Symbol(f2, Decl(TypeGuardWithEnumUnion.ts, 11, 1)) +>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12)) +>Color : Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0)) + + if (typeof x === "object") { +>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12)) + + var y = x; +>y : Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 15, 11), Decl(TypeGuardWithEnumUnion.ts, 16, 11)) +>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12)) + + var y: string[]; +>y : Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 15, 11), Decl(TypeGuardWithEnumUnion.ts, 16, 11)) + } + if (typeof x === "number") { +>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12)) + + var z = x; +>z : Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 19, 11), Decl(TypeGuardWithEnumUnion.ts, 20, 11)) +>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12)) + + var z: Color; +>z : Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 19, 11), Decl(TypeGuardWithEnumUnion.ts, 20, 11)) +>Color : Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0)) + } + else { + var w = x; +>w : Symbol(w, Decl(TypeGuardWithEnumUnion.ts, 23, 11), Decl(TypeGuardWithEnumUnion.ts, 24, 11)) +>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12)) + + var w: string | string[]; +>w : Symbol(w, Decl(TypeGuardWithEnumUnion.ts, 23, 11), Decl(TypeGuardWithEnumUnion.ts, 24, 11)) + } + if (typeof x === "string") { +>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12)) + + var a = x; +>a : Symbol(a, Decl(TypeGuardWithEnumUnion.ts, 27, 11), Decl(TypeGuardWithEnumUnion.ts, 28, 11)) +>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12)) + + var a: string; +>a : Symbol(a, Decl(TypeGuardWithEnumUnion.ts, 27, 11), Decl(TypeGuardWithEnumUnion.ts, 28, 11)) + } + else { + var b = x; +>b : Symbol(b, Decl(TypeGuardWithEnumUnion.ts, 31, 11), Decl(TypeGuardWithEnumUnion.ts, 32, 11)) +>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12)) + + var b: Color | string[]; +>b : Symbol(b, Decl(TypeGuardWithEnumUnion.ts, 31, 11), Decl(TypeGuardWithEnumUnion.ts, 32, 11)) +>Color : Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0)) + } +} + diff --git a/tests/baselines/reference/TypeGuardWithEnumUnion.types b/tests/baselines/reference/TypeGuardWithEnumUnion.types index 9296e0ad04e..16d999e46f2 100644 --- a/tests/baselines/reference/TypeGuardWithEnumUnion.types +++ b/tests/baselines/reference/TypeGuardWithEnumUnion.types @@ -14,6 +14,7 @@ function f1(x: Color | string) { >typeof x === "number" : boolean >typeof x : string >x : string | Color +>"number" : string var y = x; >y : Color @@ -42,6 +43,7 @@ function f2(x: Color | string | string[]) { >typeof x === "object" : boolean >typeof x : string >x : string | string[] | Color +>"object" : string var y = x; >y : string[] @@ -54,6 +56,7 @@ function f2(x: Color | string | string[]) { >typeof x === "number" : boolean >typeof x : string >x : string | string[] | Color +>"number" : string var z = x; >z : Color @@ -75,6 +78,7 @@ function f2(x: Color | string | string[]) { >typeof x === "string" : boolean >typeof x : string >x : string | string[] | Color +>"string" : string var a = x; >a : string diff --git a/tests/baselines/reference/TypeGuardWithEnumUnion.types.pull b/tests/baselines/reference/TypeGuardWithEnumUnion.types.pull deleted file mode 100644 index 33a40762445..00000000000 --- a/tests/baselines/reference/TypeGuardWithEnumUnion.types.pull +++ /dev/null @@ -1,96 +0,0 @@ -=== tests/cases/conformance/expressions/typeGuards/TypeGuardWithEnumUnion.ts === -enum Color { R, G, B } ->Color : Color ->R : Color ->G : Color ->B : Color - -function f1(x: Color | string) { ->f1 : (x: string | Color) => void ->x : string | Color ->Color : Color - - if (typeof x === "number") { ->typeof x === "number" : boolean ->typeof x : string ->x : string | Color - - var y = x; ->y : Color ->x : Color - - var y: Color; ->y : Color ->Color : Color - } - else { - var z = x; ->z : string ->x : string - - var z: string; ->z : string - } -} - -function f2(x: Color | string | string[]) { ->f2 : (x: string | Color | string[]) => void ->x : string | Color | string[] ->Color : Color - - if (typeof x === "object") { ->typeof x === "object" : boolean ->typeof x : string ->x : string | Color | string[] - - var y = x; ->y : string[] ->x : string[] - - var y: string[]; ->y : string[] - } - if (typeof x === "number") { ->typeof x === "number" : boolean ->typeof x : string ->x : string | Color | string[] - - var z = x; ->z : Color ->x : Color - - var z: Color; ->z : Color ->Color : Color - } - else { - var w = x; ->w : string | string[] ->x : string | string[] - - var w: string | string[]; ->w : string | string[] - } - if (typeof x === "string") { ->typeof x === "string" : boolean ->typeof x : string ->x : string | Color | string[] - - var a = x; ->a : string ->x : string - - var a: string; ->a : string - } - else { - var b = x; ->b : Color | string[] ->x : Color | string[] - - var b: Color | string[]; ->b : Color | string[] ->Color : Color - } -} - diff --git a/tests/baselines/reference/VariableDeclaration10_es6.symbols b/tests/baselines/reference/VariableDeclaration10_es6.symbols new file mode 100644 index 00000000000..ce37f77ed6d --- /dev/null +++ b/tests/baselines/reference/VariableDeclaration10_es6.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration10_es6.ts === +let a: number = 1 +>a : Symbol(a, Decl(VariableDeclaration10_es6.ts, 0, 3)) + diff --git a/tests/baselines/reference/VariableDeclaration10_es6.types b/tests/baselines/reference/VariableDeclaration10_es6.types index 47238fdd5a8..717de7ed0ff 100644 --- a/tests/baselines/reference/VariableDeclaration10_es6.types +++ b/tests/baselines/reference/VariableDeclaration10_es6.types @@ -1,4 +1,5 @@ === tests/cases/conformance/es6/variableDeclarations/VariableDeclaration10_es6.ts === let a: number = 1 >a : number +>1 : number diff --git a/tests/baselines/reference/VariableDeclaration3_es6.symbols b/tests/baselines/reference/VariableDeclaration3_es6.symbols new file mode 100644 index 00000000000..431e15aa60e --- /dev/null +++ b/tests/baselines/reference/VariableDeclaration3_es6.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration3_es6.ts === +const a = 1 +>a : Symbol(a, Decl(VariableDeclaration3_es6.ts, 0, 5)) + diff --git a/tests/baselines/reference/VariableDeclaration3_es6.types b/tests/baselines/reference/VariableDeclaration3_es6.types index a172c8114cb..1b5bbdb4ea7 100644 --- a/tests/baselines/reference/VariableDeclaration3_es6.types +++ b/tests/baselines/reference/VariableDeclaration3_es6.types @@ -1,4 +1,5 @@ === tests/cases/conformance/es6/variableDeclarations/VariableDeclaration3_es6.ts === const a = 1 >a : number +>1 : number diff --git a/tests/baselines/reference/VariableDeclaration5_es6.symbols b/tests/baselines/reference/VariableDeclaration5_es6.symbols new file mode 100644 index 00000000000..e187f78e4d7 --- /dev/null +++ b/tests/baselines/reference/VariableDeclaration5_es6.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration5_es6.ts === +const a: number = 1 +>a : Symbol(a, Decl(VariableDeclaration5_es6.ts, 0, 5)) + diff --git a/tests/baselines/reference/VariableDeclaration5_es6.types b/tests/baselines/reference/VariableDeclaration5_es6.types index a07894d533d..0dce532be51 100644 --- a/tests/baselines/reference/VariableDeclaration5_es6.types +++ b/tests/baselines/reference/VariableDeclaration5_es6.types @@ -1,4 +1,5 @@ === tests/cases/conformance/es6/variableDeclarations/VariableDeclaration5_es6.ts === const a: number = 1 >a : number +>1 : number diff --git a/tests/baselines/reference/VariableDeclaration7_es6.symbols b/tests/baselines/reference/VariableDeclaration7_es6.symbols new file mode 100644 index 00000000000..033e10978a3 --- /dev/null +++ b/tests/baselines/reference/VariableDeclaration7_es6.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration7_es6.ts === +let a +>a : Symbol(a, Decl(VariableDeclaration7_es6.ts, 0, 3)) + diff --git a/tests/baselines/reference/VariableDeclaration8_es6.symbols b/tests/baselines/reference/VariableDeclaration8_es6.symbols new file mode 100644 index 00000000000..9dcd7c4b260 --- /dev/null +++ b/tests/baselines/reference/VariableDeclaration8_es6.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration8_es6.ts === +let a = 1 +>a : Symbol(a, Decl(VariableDeclaration8_es6.ts, 0, 3)) + diff --git a/tests/baselines/reference/VariableDeclaration8_es6.types b/tests/baselines/reference/VariableDeclaration8_es6.types index 530b147136d..24a3cd85383 100644 --- a/tests/baselines/reference/VariableDeclaration8_es6.types +++ b/tests/baselines/reference/VariableDeclaration8_es6.types @@ -1,4 +1,5 @@ === tests/cases/conformance/es6/variableDeclarations/VariableDeclaration8_es6.ts === let a = 1 >a : number +>1 : number diff --git a/tests/baselines/reference/VariableDeclaration9_es6.symbols b/tests/baselines/reference/VariableDeclaration9_es6.symbols new file mode 100644 index 00000000000..a92d00f7fbd --- /dev/null +++ b/tests/baselines/reference/VariableDeclaration9_es6.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration9_es6.ts === +let a: number +>a : Symbol(a, Decl(VariableDeclaration9_es6.ts, 0, 3)) + diff --git a/tests/baselines/reference/YieldExpression10_es6.js b/tests/baselines/reference/YieldExpression10_es6.js index 3bae1b645fe..1400e8c277e 100644 --- a/tests/baselines/reference/YieldExpression10_es6.js +++ b/tests/baselines/reference/YieldExpression10_es6.js @@ -7,6 +7,6 @@ var v = { * foo() { //// [YieldExpression10_es6.js] var v = { foo: function () { - ; + yield (foo); } }; diff --git a/tests/baselines/reference/YieldExpression11_es6.js b/tests/baselines/reference/YieldExpression11_es6.js index 306cef3051e..07af8462a85 100644 --- a/tests/baselines/reference/YieldExpression11_es6.js +++ b/tests/baselines/reference/YieldExpression11_es6.js @@ -10,7 +10,7 @@ var C = (function () { function C() { } C.prototype.foo = function () { - ; + yield (foo); }; return C; })(); diff --git a/tests/baselines/reference/YieldExpression12_es6.js b/tests/baselines/reference/YieldExpression12_es6.js index 020340fc4a3..ed9f8130bb3 100644 --- a/tests/baselines/reference/YieldExpression12_es6.js +++ b/tests/baselines/reference/YieldExpression12_es6.js @@ -8,7 +8,7 @@ class C { //// [YieldExpression12_es6.js] var C = (function () { function C() { - ; + yield foo; } return C; })(); diff --git a/tests/baselines/reference/YieldExpression13_es6.js b/tests/baselines/reference/YieldExpression13_es6.js index 093759e6bd9..4923f124707 100644 --- a/tests/baselines/reference/YieldExpression13_es6.js +++ b/tests/baselines/reference/YieldExpression13_es6.js @@ -2,4 +2,4 @@ function* foo() { yield } //// [YieldExpression13_es6.js] -function foo() { ; } +function foo() { yield; } diff --git a/tests/baselines/reference/YieldExpression14_es6.js b/tests/baselines/reference/YieldExpression14_es6.js index 132890b1b6a..a03d31998ff 100644 --- a/tests/baselines/reference/YieldExpression14_es6.js +++ b/tests/baselines/reference/YieldExpression14_es6.js @@ -10,7 +10,7 @@ var C = (function () { function C() { } C.prototype.foo = function () { - ; + yield foo; }; return C; })(); diff --git a/tests/baselines/reference/YieldExpression15_es6.js b/tests/baselines/reference/YieldExpression15_es6.js index 13e6b92a577..1e4431d6168 100644 --- a/tests/baselines/reference/YieldExpression15_es6.js +++ b/tests/baselines/reference/YieldExpression15_es6.js @@ -5,5 +5,5 @@ var v = () => { //// [YieldExpression15_es6.js] var v = function () { - ; + yield foo; }; diff --git a/tests/baselines/reference/YieldExpression16_es6.js b/tests/baselines/reference/YieldExpression16_es6.js index ee73439a2d5..4bb019c8dbe 100644 --- a/tests/baselines/reference/YieldExpression16_es6.js +++ b/tests/baselines/reference/YieldExpression16_es6.js @@ -8,6 +8,6 @@ function* foo() { //// [YieldExpression16_es6.js] function foo() { function bar() { - ; + yield foo; } } diff --git a/tests/baselines/reference/YieldExpression17_es6.js b/tests/baselines/reference/YieldExpression17_es6.js index cefe4ca28df..8aed4a9d571 100644 --- a/tests/baselines/reference/YieldExpression17_es6.js +++ b/tests/baselines/reference/YieldExpression17_es6.js @@ -2,4 +2,4 @@ var v = { get foo() { yield foo; } } //// [YieldExpression17_es6.js] -var v = { get foo() { ; } }; +var v = { get foo() { yield foo; } }; diff --git a/tests/baselines/reference/YieldExpression18_es6.js b/tests/baselines/reference/YieldExpression18_es6.js index 7fb630b9c08..b4ba37d3ac4 100644 --- a/tests/baselines/reference/YieldExpression18_es6.js +++ b/tests/baselines/reference/YieldExpression18_es6.js @@ -4,4 +4,4 @@ yield(foo); //// [YieldExpression18_es6.js] "use strict"; -; +yield (foo); diff --git a/tests/baselines/reference/YieldExpression19_es6.js b/tests/baselines/reference/YieldExpression19_es6.js index 91643e09b0e..d40b6e89a9d 100644 --- a/tests/baselines/reference/YieldExpression19_es6.js +++ b/tests/baselines/reference/YieldExpression19_es6.js @@ -11,7 +11,7 @@ function*foo() { function foo() { function bar() { function quux() { - ; + yield (foo); } } } diff --git a/tests/baselines/reference/YieldExpression2_es6.js b/tests/baselines/reference/YieldExpression2_es6.js index 0207b8afca0..7d9b1efb76b 100644 --- a/tests/baselines/reference/YieldExpression2_es6.js +++ b/tests/baselines/reference/YieldExpression2_es6.js @@ -2,4 +2,4 @@ yield foo; //// [YieldExpression2_es6.js] -; +yield foo; diff --git a/tests/baselines/reference/YieldExpression3_es6.js b/tests/baselines/reference/YieldExpression3_es6.js index cc3716587ea..c69e8b29700 100644 --- a/tests/baselines/reference/YieldExpression3_es6.js +++ b/tests/baselines/reference/YieldExpression3_es6.js @@ -6,6 +6,6 @@ function* foo() { //// [YieldExpression3_es6.js] function foo() { - ; - ; + yield; + yield; } diff --git a/tests/baselines/reference/YieldExpression4_es6.js b/tests/baselines/reference/YieldExpression4_es6.js index 84b11a03a2c..5f50b721bc8 100644 --- a/tests/baselines/reference/YieldExpression4_es6.js +++ b/tests/baselines/reference/YieldExpression4_es6.js @@ -6,6 +6,6 @@ function* foo() { //// [YieldExpression4_es6.js] function foo() { - ; - ; + yield; + yield; } diff --git a/tests/baselines/reference/YieldExpression5_es6.js b/tests/baselines/reference/YieldExpression5_es6.js index 5e0e9f811fa..82b405a4cda 100644 --- a/tests/baselines/reference/YieldExpression5_es6.js +++ b/tests/baselines/reference/YieldExpression5_es6.js @@ -5,5 +5,5 @@ function* foo() { //// [YieldExpression5_es6.js] function foo() { - ; + yield* ; } diff --git a/tests/baselines/reference/YieldExpression6_es6.js b/tests/baselines/reference/YieldExpression6_es6.js index 5024e9bbd40..67d5a745e72 100644 --- a/tests/baselines/reference/YieldExpression6_es6.js +++ b/tests/baselines/reference/YieldExpression6_es6.js @@ -5,5 +5,5 @@ function* foo() { //// [YieldExpression6_es6.js] function foo() { - ; + yield* foo; } diff --git a/tests/baselines/reference/YieldExpression7_es6.js b/tests/baselines/reference/YieldExpression7_es6.js index 96ef5af107e..226555dd6ef 100644 --- a/tests/baselines/reference/YieldExpression7_es6.js +++ b/tests/baselines/reference/YieldExpression7_es6.js @@ -5,5 +5,5 @@ function* foo() { //// [YieldExpression7_es6.js] function foo() { - ; + yield foo; } diff --git a/tests/baselines/reference/YieldExpression8_es6.js b/tests/baselines/reference/YieldExpression8_es6.js index 190c2cc3da5..990164af20d 100644 --- a/tests/baselines/reference/YieldExpression8_es6.js +++ b/tests/baselines/reference/YieldExpression8_es6.js @@ -7,5 +7,5 @@ function* foo() { //// [YieldExpression8_es6.js] yield(foo); function foo() { - ; + yield (foo); } diff --git a/tests/baselines/reference/YieldExpression9_es6.js b/tests/baselines/reference/YieldExpression9_es6.js index 978e0d455bd..f38aa811fec 100644 --- a/tests/baselines/reference/YieldExpression9_es6.js +++ b/tests/baselines/reference/YieldExpression9_es6.js @@ -5,5 +5,5 @@ var v = function*() { //// [YieldExpression9_es6.js] var v = function () { - ; + yield (foo); }; diff --git a/tests/baselines/reference/acceptableAlias1.symbols b/tests/baselines/reference/acceptableAlias1.symbols new file mode 100644 index 00000000000..cffbc70290f --- /dev/null +++ b/tests/baselines/reference/acceptableAlias1.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/acceptableAlias1.ts === +module M { +>M : Symbol(M, Decl(acceptableAlias1.ts, 0, 0)) + + export module N { +>N : Symbol(N, Decl(acceptableAlias1.ts, 0, 10)) + } + export import X = N; +>X : Symbol(X, Decl(acceptableAlias1.ts, 2, 5)) +>N : Symbol(N, Decl(acceptableAlias1.ts, 0, 10)) +} + +import r = M.X; +>r : Symbol(r, Decl(acceptableAlias1.ts, 4, 1)) +>M : Symbol(M, Decl(acceptableAlias1.ts, 0, 0)) +>X : Symbol(r, Decl(acceptableAlias1.ts, 0, 10)) + diff --git a/tests/baselines/reference/acceptableAlias1.types b/tests/baselines/reference/acceptableAlias1.types index 213e5ad5bc3..ccf766d8f2f 100644 --- a/tests/baselines/reference/acceptableAlias1.types +++ b/tests/baselines/reference/acceptableAlias1.types @@ -3,15 +3,15 @@ module M { >M : typeof M export module N { ->N : unknown +>N : any } export import X = N; ->X : unknown ->N : unknown +>X : any +>N : any } import r = M.X; ->r : unknown +>r : any >M : typeof M ->X : unknown +>X : any diff --git a/tests/baselines/reference/accessOverriddenBaseClassMember1.symbols b/tests/baselines/reference/accessOverriddenBaseClassMember1.symbols new file mode 100644 index 00000000000..e5e19030afa --- /dev/null +++ b/tests/baselines/reference/accessOverriddenBaseClassMember1.symbols @@ -0,0 +1,47 @@ +=== tests/cases/compiler/accessOverriddenBaseClassMember1.ts === +class Point { +>Point : Symbol(Point, Decl(accessOverriddenBaseClassMember1.ts, 0, 0)) + + constructor(public x: number, public y: number) { } +>x : Symbol(x, Decl(accessOverriddenBaseClassMember1.ts, 1, 16)) +>y : Symbol(y, Decl(accessOverriddenBaseClassMember1.ts, 1, 33)) + + public toString() { +>toString : Symbol(toString, Decl(accessOverriddenBaseClassMember1.ts, 1, 55)) + + return "x=" + this.x + " y=" + this.y; +>this.x : Symbol(x, Decl(accessOverriddenBaseClassMember1.ts, 1, 16)) +>this : Symbol(Point, Decl(accessOverriddenBaseClassMember1.ts, 0, 0)) +>x : Symbol(x, Decl(accessOverriddenBaseClassMember1.ts, 1, 16)) +>this.y : Symbol(y, Decl(accessOverriddenBaseClassMember1.ts, 1, 33)) +>this : Symbol(Point, Decl(accessOverriddenBaseClassMember1.ts, 0, 0)) +>y : Symbol(y, Decl(accessOverriddenBaseClassMember1.ts, 1, 33)) + } +} +class ColoredPoint extends Point { +>ColoredPoint : Symbol(ColoredPoint, Decl(accessOverriddenBaseClassMember1.ts, 5, 1)) +>Point : Symbol(Point, Decl(accessOverriddenBaseClassMember1.ts, 0, 0)) + + constructor(x: number, y: number, public color: string) { +>x : Symbol(x, Decl(accessOverriddenBaseClassMember1.ts, 7, 16)) +>y : Symbol(y, Decl(accessOverriddenBaseClassMember1.ts, 7, 26)) +>color : Symbol(color, Decl(accessOverriddenBaseClassMember1.ts, 7, 37)) + + super(x, y); +>super : Symbol(Point, Decl(accessOverriddenBaseClassMember1.ts, 0, 0)) +>x : Symbol(x, Decl(accessOverriddenBaseClassMember1.ts, 7, 16)) +>y : Symbol(y, Decl(accessOverriddenBaseClassMember1.ts, 7, 26)) + } + public toString() { +>toString : Symbol(toString, Decl(accessOverriddenBaseClassMember1.ts, 9, 5)) + + return super.toString() + " color=" + this.color; +>super.toString : Symbol(Point.toString, Decl(accessOverriddenBaseClassMember1.ts, 1, 55)) +>super : Symbol(Point, Decl(accessOverriddenBaseClassMember1.ts, 0, 0)) +>toString : Symbol(Point.toString, Decl(accessOverriddenBaseClassMember1.ts, 1, 55)) +>this.color : Symbol(color, Decl(accessOverriddenBaseClassMember1.ts, 7, 37)) +>this : Symbol(ColoredPoint, Decl(accessOverriddenBaseClassMember1.ts, 5, 1)) +>color : Symbol(color, Decl(accessOverriddenBaseClassMember1.ts, 7, 37)) + } +} + diff --git a/tests/baselines/reference/accessOverriddenBaseClassMember1.types b/tests/baselines/reference/accessOverriddenBaseClassMember1.types index 15007cebf4c..2aeb541d723 100644 --- a/tests/baselines/reference/accessOverriddenBaseClassMember1.types +++ b/tests/baselines/reference/accessOverriddenBaseClassMember1.types @@ -13,9 +13,11 @@ class Point { >"x=" + this.x + " y=" + this.y : string >"x=" + this.x + " y=" : string >"x=" + this.x : string +>"x=" : string >this.x : number >this : Point >x : number +>" y=" : string >this.y : number >this : Point >y : number @@ -46,6 +48,7 @@ class ColoredPoint extends Point { >super.toString : () => string >super : Point >toString : () => string +>" color=" : string >this.color : string >this : ColoredPoint >color : string diff --git a/tests/baselines/reference/accessorWithES5.symbols b/tests/baselines/reference/accessorWithES5.symbols new file mode 100644 index 00000000000..dccbd8180bb --- /dev/null +++ b/tests/baselines/reference/accessorWithES5.symbols @@ -0,0 +1,35 @@ +=== tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES5.ts === + +class C { +>C : Symbol(C, Decl(accessorWithES5.ts, 0, 0)) + + get x() { +>x : Symbol(x, Decl(accessorWithES5.ts, 1, 9)) + + return 1; + } +} + +class D { +>D : Symbol(D, Decl(accessorWithES5.ts, 5, 1)) + + set x(v) { +>x : Symbol(x, Decl(accessorWithES5.ts, 7, 9)) +>v : Symbol(v, Decl(accessorWithES5.ts, 8, 10)) + } +} + +var x = { +>x : Symbol(x, Decl(accessorWithES5.ts, 12, 3)) + + get a() { return 1 } +>a : Symbol(a, Decl(accessorWithES5.ts, 12, 9)) +} + +var y = { +>y : Symbol(y, Decl(accessorWithES5.ts, 16, 3)) + + set b(v) { } +>b : Symbol(b, Decl(accessorWithES5.ts, 16, 9)) +>v : Symbol(v, Decl(accessorWithES5.ts, 17, 10)) +} diff --git a/tests/baselines/reference/accessorWithES5.types b/tests/baselines/reference/accessorWithES5.types index 9d4976dd91a..cb54e92b184 100644 --- a/tests/baselines/reference/accessorWithES5.types +++ b/tests/baselines/reference/accessorWithES5.types @@ -7,6 +7,7 @@ class C { >x : number return 1; +>1 : number } } @@ -25,6 +26,7 @@ var x = { get a() { return 1 } >a : number +>1 : number } var y = { diff --git a/tests/baselines/reference/addMoreCallSignaturesToBaseSignature.symbols b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature.symbols new file mode 100644 index 00000000000..339f419f5cc --- /dev/null +++ b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/addMoreCallSignaturesToBaseSignature.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(addMoreCallSignaturesToBaseSignature.ts, 0, 0)) + + (): string; +} + +interface Bar extends Foo { +>Bar : Symbol(Bar, Decl(addMoreCallSignaturesToBaseSignature.ts, 2, 1)) +>Foo : Symbol(Foo, Decl(addMoreCallSignaturesToBaseSignature.ts, 0, 0)) + + (key: string): string; +>key : Symbol(key, Decl(addMoreCallSignaturesToBaseSignature.ts, 5, 5)) +} + +var a: Bar; +>a : Symbol(a, Decl(addMoreCallSignaturesToBaseSignature.ts, 8, 3)) +>Bar : Symbol(Bar, Decl(addMoreCallSignaturesToBaseSignature.ts, 2, 1)) + +var kitty = a(); +>kitty : Symbol(kitty, Decl(addMoreCallSignaturesToBaseSignature.ts, 9, 3)) +>a : Symbol(a, Decl(addMoreCallSignaturesToBaseSignature.ts, 8, 3)) + diff --git a/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.symbols b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.symbols new file mode 100644 index 00000000000..e8185780dcf --- /dev/null +++ b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/addMoreCallSignaturesToBaseSignature2.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(addMoreCallSignaturesToBaseSignature2.ts, 0, 0)) + + (bar:number): string; +>bar : Symbol(bar, Decl(addMoreCallSignaturesToBaseSignature2.ts, 1, 5)) +} + +interface Bar extends Foo { +>Bar : Symbol(Bar, Decl(addMoreCallSignaturesToBaseSignature2.ts, 2, 1)) +>Foo : Symbol(Foo, Decl(addMoreCallSignaturesToBaseSignature2.ts, 0, 0)) + + (key: string): string; +>key : Symbol(key, Decl(addMoreCallSignaturesToBaseSignature2.ts, 5, 5)) +} + +var a: Bar; +>a : Symbol(a, Decl(addMoreCallSignaturesToBaseSignature2.ts, 8, 3)) +>Bar : Symbol(Bar, Decl(addMoreCallSignaturesToBaseSignature2.ts, 2, 1)) + +var kitty = a(1); +>kitty : Symbol(kitty, Decl(addMoreCallSignaturesToBaseSignature2.ts, 9, 3)) +>a : Symbol(a, Decl(addMoreCallSignaturesToBaseSignature2.ts, 8, 3)) + diff --git a/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.types b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.types index a80986c8cd1..98bd1910241 100644 --- a/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.types +++ b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.types @@ -22,4 +22,5 @@ var kitty = a(1); >kitty : string >a(1) : string >a : Bar +>1 : number diff --git a/tests/baselines/reference/additionOperatorWithAnyAndEveryType.symbols b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.symbols new file mode 100644 index 00000000000..eff45630aae --- /dev/null +++ b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.symbols @@ -0,0 +1,143 @@ +=== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithAnyAndEveryType.ts === +function foo() { } +>foo : Symbol(foo, Decl(additionOperatorWithAnyAndEveryType.ts, 0, 0)) + +class C { +>C : Symbol(C, Decl(additionOperatorWithAnyAndEveryType.ts, 0, 18)) + + public a: string; +>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 1, 9)) + + static foo() { } +>foo : Symbol(C.foo, Decl(additionOperatorWithAnyAndEveryType.ts, 2, 21)) +} +enum E { a, b, c } +>E : Symbol(E, Decl(additionOperatorWithAnyAndEveryType.ts, 4, 1)) +>a : Symbol(E.a, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 8)) +>b : Symbol(E.b, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 11)) +>c : Symbol(E.c, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 14)) + +module M { export var a } +>M : Symbol(M, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 18)) +>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 6, 21)) + +var a: any; +>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3)) + +var b: boolean; +>b : Symbol(b, Decl(additionOperatorWithAnyAndEveryType.ts, 9, 3)) + +var c: number; +>c : Symbol(c, Decl(additionOperatorWithAnyAndEveryType.ts, 10, 3)) + +var d: string; +>d : Symbol(d, Decl(additionOperatorWithAnyAndEveryType.ts, 11, 3)) + +var e: Object; +>e : Symbol(e, Decl(additionOperatorWithAnyAndEveryType.ts, 12, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +// any as left operand, result is type Any except plusing string +var r1 = a + a; +>r1 : Symbol(r1, Decl(additionOperatorWithAnyAndEveryType.ts, 15, 3)) +>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3)) +>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3)) + +var r2 = a + b; +>r2 : Symbol(r2, Decl(additionOperatorWithAnyAndEveryType.ts, 16, 3)) +>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3)) +>b : Symbol(b, Decl(additionOperatorWithAnyAndEveryType.ts, 9, 3)) + +var r3 = a + c; +>r3 : Symbol(r3, Decl(additionOperatorWithAnyAndEveryType.ts, 17, 3)) +>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3)) +>c : Symbol(c, Decl(additionOperatorWithAnyAndEveryType.ts, 10, 3)) + +var r4 = a + d; +>r4 : Symbol(r4, Decl(additionOperatorWithAnyAndEveryType.ts, 18, 3)) +>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3)) +>d : Symbol(d, Decl(additionOperatorWithAnyAndEveryType.ts, 11, 3)) + +var r5 = a + e; +>r5 : Symbol(r5, Decl(additionOperatorWithAnyAndEveryType.ts, 19, 3)) +>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3)) +>e : Symbol(e, Decl(additionOperatorWithAnyAndEveryType.ts, 12, 3)) + +// any as right operand, result is type Any except plusing string +var r6 = b + a; +>r6 : Symbol(r6, Decl(additionOperatorWithAnyAndEveryType.ts, 22, 3)) +>b : Symbol(b, Decl(additionOperatorWithAnyAndEveryType.ts, 9, 3)) +>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3)) + +var r7 = c + a; +>r7 : Symbol(r7, Decl(additionOperatorWithAnyAndEveryType.ts, 23, 3)) +>c : Symbol(c, Decl(additionOperatorWithAnyAndEveryType.ts, 10, 3)) +>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3)) + +var r8 = d + a; +>r8 : Symbol(r8, Decl(additionOperatorWithAnyAndEveryType.ts, 24, 3)) +>d : Symbol(d, Decl(additionOperatorWithAnyAndEveryType.ts, 11, 3)) +>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3)) + +var r9 = e + a; +>r9 : Symbol(r9, Decl(additionOperatorWithAnyAndEveryType.ts, 25, 3)) +>e : Symbol(e, Decl(additionOperatorWithAnyAndEveryType.ts, 12, 3)) +>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3)) + +// other cases +var r10 = a + foo; +>r10 : Symbol(r10, Decl(additionOperatorWithAnyAndEveryType.ts, 28, 3)) +>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3)) +>foo : Symbol(foo, Decl(additionOperatorWithAnyAndEveryType.ts, 0, 0)) + +var r11 = a + foo(); +>r11 : Symbol(r11, Decl(additionOperatorWithAnyAndEveryType.ts, 29, 3)) +>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3)) +>foo : Symbol(foo, Decl(additionOperatorWithAnyAndEveryType.ts, 0, 0)) + +var r12 = a + C; +>r12 : Symbol(r12, Decl(additionOperatorWithAnyAndEveryType.ts, 30, 3)) +>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3)) +>C : Symbol(C, Decl(additionOperatorWithAnyAndEveryType.ts, 0, 18)) + +var r13 = a + new C(); +>r13 : Symbol(r13, Decl(additionOperatorWithAnyAndEveryType.ts, 31, 3)) +>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3)) +>C : Symbol(C, Decl(additionOperatorWithAnyAndEveryType.ts, 0, 18)) + +var r14 = a + E; +>r14 : Symbol(r14, Decl(additionOperatorWithAnyAndEveryType.ts, 32, 3)) +>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3)) +>E : Symbol(E, Decl(additionOperatorWithAnyAndEveryType.ts, 4, 1)) + +var r15 = a + E.a; +>r15 : Symbol(r15, Decl(additionOperatorWithAnyAndEveryType.ts, 33, 3)) +>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3)) +>E.a : Symbol(E.a, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 8)) +>E : Symbol(E, Decl(additionOperatorWithAnyAndEveryType.ts, 4, 1)) +>a : Symbol(E.a, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 8)) + +var r16 = a + M; +>r16 : Symbol(r16, Decl(additionOperatorWithAnyAndEveryType.ts, 34, 3)) +>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3)) +>M : Symbol(M, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 18)) + +var r17 = a + ''; +>r17 : Symbol(r17, Decl(additionOperatorWithAnyAndEveryType.ts, 35, 3)) +>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3)) + +var r18 = a + 123; +>r18 : Symbol(r18, Decl(additionOperatorWithAnyAndEveryType.ts, 36, 3)) +>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3)) + +var r19 = a + { a: '' }; +>r19 : Symbol(r19, Decl(additionOperatorWithAnyAndEveryType.ts, 37, 3)) +>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3)) +>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 37, 15)) + +var r20 = a + ((a: string) => { return a }); +>r20 : Symbol(r20, Decl(additionOperatorWithAnyAndEveryType.ts, 38, 3)) +>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3)) +>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 38, 16)) +>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 38, 16)) + diff --git a/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types index da534c68ad6..9f1a9f03898 100644 --- a/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types +++ b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types @@ -144,11 +144,13 @@ var r17 = a + ''; >r17 : string >a + '' : string >a : any +>'' : string var r18 = a + 123; >r18 : any >a + 123 : any >a : any +>123 : number var r19 = a + { a: '' }; >r19 : any @@ -156,6 +158,7 @@ var r19 = a + { a: '' }; >a : any >{ a: '' } : { a: string; } >a : string +>'' : string var r20 = a + ((a: string) => { return a }); >r20 : any diff --git a/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.symbols b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.symbols new file mode 100644 index 00000000000..ccb53ab5ef1 --- /dev/null +++ b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.symbols @@ -0,0 +1,91 @@ +=== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts === +// If one operand is the null or undefined value, it is treated as having the type of the other operand. + +enum E { a, b, c } +>E : Symbol(E, Decl(additionOperatorWithNullValueAndValidOperator.ts, 0, 0)) +>a : Symbol(E.a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 2, 8)) +>b : Symbol(E.b, Decl(additionOperatorWithNullValueAndValidOperator.ts, 2, 11)) +>c : Symbol(E.c, Decl(additionOperatorWithNullValueAndValidOperator.ts, 2, 14)) + +var a: any; +>a : Symbol(a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 4, 3)) + +var b: number; +>b : Symbol(b, Decl(additionOperatorWithNullValueAndValidOperator.ts, 5, 3)) + +var c: E; +>c : Symbol(c, Decl(additionOperatorWithNullValueAndValidOperator.ts, 6, 3)) +>E : Symbol(E, Decl(additionOperatorWithNullValueAndValidOperator.ts, 0, 0)) + +var d: string; +>d : Symbol(d, Decl(additionOperatorWithNullValueAndValidOperator.ts, 7, 3)) + +// null + any +var r1: any = null + a; +>r1 : Symbol(r1, Decl(additionOperatorWithNullValueAndValidOperator.ts, 10, 3)) +>a : Symbol(a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 4, 3)) + +var r2: any = a + null; +>r2 : Symbol(r2, Decl(additionOperatorWithNullValueAndValidOperator.ts, 11, 3)) +>a : Symbol(a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 4, 3)) + +// null + number/enum +var r3 = null + b; +>r3 : Symbol(r3, Decl(additionOperatorWithNullValueAndValidOperator.ts, 14, 3)) +>b : Symbol(b, Decl(additionOperatorWithNullValueAndValidOperator.ts, 5, 3)) + +var r4 = null + 1; +>r4 : Symbol(r4, Decl(additionOperatorWithNullValueAndValidOperator.ts, 15, 3)) + +var r5 = null + c; +>r5 : Symbol(r5, Decl(additionOperatorWithNullValueAndValidOperator.ts, 16, 3)) +>c : Symbol(c, Decl(additionOperatorWithNullValueAndValidOperator.ts, 6, 3)) + +var r6 = null + E.a; +>r6 : Symbol(r6, Decl(additionOperatorWithNullValueAndValidOperator.ts, 17, 3)) +>E.a : Symbol(E.a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 2, 8)) +>E : Symbol(E, Decl(additionOperatorWithNullValueAndValidOperator.ts, 0, 0)) +>a : Symbol(E.a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 2, 8)) + +var r7 = null + E['a']; +>r7 : Symbol(r7, Decl(additionOperatorWithNullValueAndValidOperator.ts, 18, 3)) +>E : Symbol(E, Decl(additionOperatorWithNullValueAndValidOperator.ts, 0, 0)) +>'a' : Symbol(E.a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 2, 8)) + +var r8 = b + null; +>r8 : Symbol(r8, Decl(additionOperatorWithNullValueAndValidOperator.ts, 19, 3)) +>b : Symbol(b, Decl(additionOperatorWithNullValueAndValidOperator.ts, 5, 3)) + +var r9 = 1 + null; +>r9 : Symbol(r9, Decl(additionOperatorWithNullValueAndValidOperator.ts, 20, 3)) + +var r10 = c + null +>r10 : Symbol(r10, Decl(additionOperatorWithNullValueAndValidOperator.ts, 21, 3)) +>c : Symbol(c, Decl(additionOperatorWithNullValueAndValidOperator.ts, 6, 3)) + +var r11 = E.a + null; +>r11 : Symbol(r11, Decl(additionOperatorWithNullValueAndValidOperator.ts, 22, 3)) +>E.a : Symbol(E.a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 2, 8)) +>E : Symbol(E, Decl(additionOperatorWithNullValueAndValidOperator.ts, 0, 0)) +>a : Symbol(E.a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 2, 8)) + +var r12 = E['a'] + null; +>r12 : Symbol(r12, Decl(additionOperatorWithNullValueAndValidOperator.ts, 23, 3)) +>E : Symbol(E, Decl(additionOperatorWithNullValueAndValidOperator.ts, 0, 0)) +>'a' : Symbol(E.a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 2, 8)) + +// null + string +var r13 = null + d; +>r13 : Symbol(r13, Decl(additionOperatorWithNullValueAndValidOperator.ts, 26, 3)) +>d : Symbol(d, Decl(additionOperatorWithNullValueAndValidOperator.ts, 7, 3)) + +var r14 = null + ''; +>r14 : Symbol(r14, Decl(additionOperatorWithNullValueAndValidOperator.ts, 27, 3)) + +var r15 = d + null; +>r15 : Symbol(r15, Decl(additionOperatorWithNullValueAndValidOperator.ts, 28, 3)) +>d : Symbol(d, Decl(additionOperatorWithNullValueAndValidOperator.ts, 7, 3)) + +var r16 = '' + null; +>r16 : Symbol(r16, Decl(additionOperatorWithNullValueAndValidOperator.ts, 29, 3)) + diff --git a/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.types b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.types index 4dade89f5e4..f4ea168ee0d 100644 --- a/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.types +++ b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.types @@ -24,31 +24,38 @@ var d: string; var r1: any = null + a; >r1 : any >null + a : any +>null : null >a : any var r2: any = a + null; >r2 : any >a + null : any >a : any +>null : null // null + number/enum var r3 = null + b; >r3 : number >null + b : number +>null : null >b : number var r4 = null + 1; >r4 : number >null + 1 : number +>null : null +>1 : number var r5 = null + c; >r5 : number >null + c : number +>null : null >c : E var r6 = null + E.a; >r6 : number >null + E.a : number +>null : null >E.a : E >E : typeof E >a : E @@ -56,22 +63,28 @@ var r6 = null + E.a; var r7 = null + E['a']; >r7 : number >null + E['a'] : number +>null : null >E['a'] : E >E : typeof E +>'a' : string var r8 = b + null; >r8 : number >b + null : number >b : number +>null : null var r9 = 1 + null; >r9 : number >1 + null : number +>1 : number +>null : null var r10 = c + null >r10 : number >c + null : number >c : E +>null : null var r11 = E.a + null; >r11 : number @@ -79,29 +92,38 @@ var r11 = E.a + null; >E.a : E >E : typeof E >a : E +>null : null var r12 = E['a'] + null; >r12 : number >E['a'] + null : number >E['a'] : E >E : typeof E +>'a' : string +>null : null // null + string var r13 = null + d; >r13 : string >null + d : string +>null : null >d : string var r14 = null + ''; >r14 : string >null + '' : string +>null : null +>'' : string var r15 = d + null; >r15 : string >d + null : string >d : string +>null : null var r16 = '' + null; >r16 : string >'' + null : string +>'' : string +>null : null diff --git a/tests/baselines/reference/additionOperatorWithNumberAndEnum.symbols b/tests/baselines/reference/additionOperatorWithNumberAndEnum.symbols new file mode 100644 index 00000000000..835bdbe3a65 --- /dev/null +++ b/tests/baselines/reference/additionOperatorWithNumberAndEnum.symbols @@ -0,0 +1,101 @@ +=== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNumberAndEnum.ts === +enum E { a, b } +>E : Symbol(E, Decl(additionOperatorWithNumberAndEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(additionOperatorWithNumberAndEnum.ts, 0, 8)) +>b : Symbol(E.b, Decl(additionOperatorWithNumberAndEnum.ts, 0, 11)) + +enum F { c, d } +>F : Symbol(F, Decl(additionOperatorWithNumberAndEnum.ts, 0, 15)) +>c : Symbol(F.c, Decl(additionOperatorWithNumberAndEnum.ts, 1, 8)) +>d : Symbol(F.d, Decl(additionOperatorWithNumberAndEnum.ts, 1, 11)) + +var a: number; +>a : Symbol(a, Decl(additionOperatorWithNumberAndEnum.ts, 3, 3)) + +var b: E; +>b : Symbol(b, Decl(additionOperatorWithNumberAndEnum.ts, 4, 3)) +>E : Symbol(E, Decl(additionOperatorWithNumberAndEnum.ts, 0, 0)) + +var c: E | F; +>c : Symbol(c, Decl(additionOperatorWithNumberAndEnum.ts, 5, 3)) +>E : Symbol(E, Decl(additionOperatorWithNumberAndEnum.ts, 0, 0)) +>F : Symbol(F, Decl(additionOperatorWithNumberAndEnum.ts, 0, 15)) + +var r1 = a + a; +>r1 : Symbol(r1, Decl(additionOperatorWithNumberAndEnum.ts, 7, 3)) +>a : Symbol(a, Decl(additionOperatorWithNumberAndEnum.ts, 3, 3)) +>a : Symbol(a, Decl(additionOperatorWithNumberAndEnum.ts, 3, 3)) + +var r2 = a + b; +>r2 : Symbol(r2, Decl(additionOperatorWithNumberAndEnum.ts, 8, 3)) +>a : Symbol(a, Decl(additionOperatorWithNumberAndEnum.ts, 3, 3)) +>b : Symbol(b, Decl(additionOperatorWithNumberAndEnum.ts, 4, 3)) + +var r3 = b + a; +>r3 : Symbol(r3, Decl(additionOperatorWithNumberAndEnum.ts, 9, 3)) +>b : Symbol(b, Decl(additionOperatorWithNumberAndEnum.ts, 4, 3)) +>a : Symbol(a, Decl(additionOperatorWithNumberAndEnum.ts, 3, 3)) + +var r4 = b + b; +>r4 : Symbol(r4, Decl(additionOperatorWithNumberAndEnum.ts, 10, 3)) +>b : Symbol(b, Decl(additionOperatorWithNumberAndEnum.ts, 4, 3)) +>b : Symbol(b, Decl(additionOperatorWithNumberAndEnum.ts, 4, 3)) + +var r5 = 0 + a; +>r5 : Symbol(r5, Decl(additionOperatorWithNumberAndEnum.ts, 12, 3)) +>a : Symbol(a, Decl(additionOperatorWithNumberAndEnum.ts, 3, 3)) + +var r6 = E.a + 0; +>r6 : Symbol(r6, Decl(additionOperatorWithNumberAndEnum.ts, 13, 3)) +>E.a : Symbol(E.a, Decl(additionOperatorWithNumberAndEnum.ts, 0, 8)) +>E : Symbol(E, Decl(additionOperatorWithNumberAndEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(additionOperatorWithNumberAndEnum.ts, 0, 8)) + +var r7 = E.a + E.b; +>r7 : Symbol(r7, Decl(additionOperatorWithNumberAndEnum.ts, 14, 3)) +>E.a : Symbol(E.a, Decl(additionOperatorWithNumberAndEnum.ts, 0, 8)) +>E : Symbol(E, Decl(additionOperatorWithNumberAndEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(additionOperatorWithNumberAndEnum.ts, 0, 8)) +>E.b : Symbol(E.b, Decl(additionOperatorWithNumberAndEnum.ts, 0, 11)) +>E : Symbol(E, Decl(additionOperatorWithNumberAndEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(additionOperatorWithNumberAndEnum.ts, 0, 11)) + +var r8 = E['a'] + E['b']; +>r8 : Symbol(r8, Decl(additionOperatorWithNumberAndEnum.ts, 15, 3)) +>E : Symbol(E, Decl(additionOperatorWithNumberAndEnum.ts, 0, 0)) +>'a' : Symbol(E.a, Decl(additionOperatorWithNumberAndEnum.ts, 0, 8)) +>E : Symbol(E, Decl(additionOperatorWithNumberAndEnum.ts, 0, 0)) +>'b' : Symbol(E.b, Decl(additionOperatorWithNumberAndEnum.ts, 0, 11)) + +var r9 = E['a'] + F['c']; +>r9 : Symbol(r9, Decl(additionOperatorWithNumberAndEnum.ts, 16, 3)) +>E : Symbol(E, Decl(additionOperatorWithNumberAndEnum.ts, 0, 0)) +>'a' : Symbol(E.a, Decl(additionOperatorWithNumberAndEnum.ts, 0, 8)) +>F : Symbol(F, Decl(additionOperatorWithNumberAndEnum.ts, 0, 15)) +>'c' : Symbol(F.c, Decl(additionOperatorWithNumberAndEnum.ts, 1, 8)) + +var r10 = a + c; +>r10 : Symbol(r10, Decl(additionOperatorWithNumberAndEnum.ts, 18, 3)) +>a : Symbol(a, Decl(additionOperatorWithNumberAndEnum.ts, 3, 3)) +>c : Symbol(c, Decl(additionOperatorWithNumberAndEnum.ts, 5, 3)) + +var r11 = c + a; +>r11 : Symbol(r11, Decl(additionOperatorWithNumberAndEnum.ts, 19, 3)) +>c : Symbol(c, Decl(additionOperatorWithNumberAndEnum.ts, 5, 3)) +>a : Symbol(a, Decl(additionOperatorWithNumberAndEnum.ts, 3, 3)) + +var r12 = b + c; +>r12 : Symbol(r12, Decl(additionOperatorWithNumberAndEnum.ts, 20, 3)) +>b : Symbol(b, Decl(additionOperatorWithNumberAndEnum.ts, 4, 3)) +>c : Symbol(c, Decl(additionOperatorWithNumberAndEnum.ts, 5, 3)) + +var r13 = c + b; +>r13 : Symbol(r13, Decl(additionOperatorWithNumberAndEnum.ts, 21, 3)) +>c : Symbol(c, Decl(additionOperatorWithNumberAndEnum.ts, 5, 3)) +>b : Symbol(b, Decl(additionOperatorWithNumberAndEnum.ts, 4, 3)) + +var r14 = c + c; +>r14 : Symbol(r14, Decl(additionOperatorWithNumberAndEnum.ts, 22, 3)) +>c : Symbol(c, Decl(additionOperatorWithNumberAndEnum.ts, 5, 3)) +>c : Symbol(c, Decl(additionOperatorWithNumberAndEnum.ts, 5, 3)) + diff --git a/tests/baselines/reference/additionOperatorWithNumberAndEnum.types b/tests/baselines/reference/additionOperatorWithNumberAndEnum.types index c22939ffd98..2b1c2794065 100644 --- a/tests/baselines/reference/additionOperatorWithNumberAndEnum.types +++ b/tests/baselines/reference/additionOperatorWithNumberAndEnum.types @@ -48,6 +48,7 @@ var r4 = b + b; var r5 = 0 + a; >r5 : number >0 + a : number +>0 : number >a : number var r6 = E.a + 0; @@ -56,6 +57,7 @@ var r6 = E.a + 0; >E.a : E >E : typeof E >a : E +>0 : number var r7 = E.a + E.b; >r7 : number @@ -72,16 +74,20 @@ var r8 = E['a'] + E['b']; >E['a'] + E['b'] : number >E['a'] : E >E : typeof E +>'a' : string >E['b'] : E >E : typeof E +>'b' : string var r9 = E['a'] + F['c']; >r9 : number >E['a'] + F['c'] : number >E['a'] : E >E : typeof E +>'a' : string >F['c'] : F >F : typeof F +>'c' : string var r10 = a + c; >r10 : number diff --git a/tests/baselines/reference/additionOperatorWithStringAndEveryType.symbols b/tests/baselines/reference/additionOperatorWithStringAndEveryType.symbols new file mode 100644 index 00000000000..0fb0f428716 --- /dev/null +++ b/tests/baselines/reference/additionOperatorWithStringAndEveryType.symbols @@ -0,0 +1,136 @@ +=== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithStringAndEveryType.ts === +enum E { a, b, c } +>E : Symbol(E, Decl(additionOperatorWithStringAndEveryType.ts, 0, 0)) +>a : Symbol(E.a, Decl(additionOperatorWithStringAndEveryType.ts, 0, 8)) +>b : Symbol(E.b, Decl(additionOperatorWithStringAndEveryType.ts, 0, 11)) +>c : Symbol(E.c, Decl(additionOperatorWithStringAndEveryType.ts, 0, 14)) + +var a: any; +>a : Symbol(a, Decl(additionOperatorWithStringAndEveryType.ts, 2, 3)) + +var b: boolean; +>b : Symbol(b, Decl(additionOperatorWithStringAndEveryType.ts, 3, 3)) + +var c: number; +>c : Symbol(c, Decl(additionOperatorWithStringAndEveryType.ts, 4, 3)) + +var d: string; +>d : Symbol(d, Decl(additionOperatorWithStringAndEveryType.ts, 5, 3)) + +var e: Object; +>e : Symbol(e, Decl(additionOperatorWithStringAndEveryType.ts, 6, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var f: void; +>f : Symbol(f, Decl(additionOperatorWithStringAndEveryType.ts, 7, 3)) + +var g: E; +>g : Symbol(g, Decl(additionOperatorWithStringAndEveryType.ts, 8, 3)) +>E : Symbol(E, Decl(additionOperatorWithStringAndEveryType.ts, 0, 0)) + +var x: string; +>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3)) + +// string could plus every type, and the result is always string +// string as left operand +var r1 = x + a; +>r1 : Symbol(r1, Decl(additionOperatorWithStringAndEveryType.ts, 14, 3)) +>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3)) +>a : Symbol(a, Decl(additionOperatorWithStringAndEveryType.ts, 2, 3)) + +var r2 = x + b; +>r2 : Symbol(r2, Decl(additionOperatorWithStringAndEveryType.ts, 15, 3)) +>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3)) +>b : Symbol(b, Decl(additionOperatorWithStringAndEveryType.ts, 3, 3)) + +var r3 = x + c; +>r3 : Symbol(r3, Decl(additionOperatorWithStringAndEveryType.ts, 16, 3)) +>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3)) +>c : Symbol(c, Decl(additionOperatorWithStringAndEveryType.ts, 4, 3)) + +var r4 = x + d; +>r4 : Symbol(r4, Decl(additionOperatorWithStringAndEveryType.ts, 17, 3)) +>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3)) +>d : Symbol(d, Decl(additionOperatorWithStringAndEveryType.ts, 5, 3)) + +var r5 = x + e; +>r5 : Symbol(r5, Decl(additionOperatorWithStringAndEveryType.ts, 18, 3)) +>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3)) +>e : Symbol(e, Decl(additionOperatorWithStringAndEveryType.ts, 6, 3)) + +var r6 = x + f; +>r6 : Symbol(r6, Decl(additionOperatorWithStringAndEveryType.ts, 19, 3)) +>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3)) +>f : Symbol(f, Decl(additionOperatorWithStringAndEveryType.ts, 7, 3)) + +var r7 = x + g; +>r7 : Symbol(r7, Decl(additionOperatorWithStringAndEveryType.ts, 20, 3)) +>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3)) +>g : Symbol(g, Decl(additionOperatorWithStringAndEveryType.ts, 8, 3)) + +// string as right operand +var r8 = a + x; +>r8 : Symbol(r8, Decl(additionOperatorWithStringAndEveryType.ts, 23, 3)) +>a : Symbol(a, Decl(additionOperatorWithStringAndEveryType.ts, 2, 3)) +>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3)) + +var r9 = b + x; +>r9 : Symbol(r9, Decl(additionOperatorWithStringAndEveryType.ts, 24, 3)) +>b : Symbol(b, Decl(additionOperatorWithStringAndEveryType.ts, 3, 3)) +>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3)) + +var r10 = c + x; +>r10 : Symbol(r10, Decl(additionOperatorWithStringAndEveryType.ts, 25, 3)) +>c : Symbol(c, Decl(additionOperatorWithStringAndEveryType.ts, 4, 3)) +>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3)) + +var r11 = d + x; +>r11 : Symbol(r11, Decl(additionOperatorWithStringAndEveryType.ts, 26, 3)) +>d : Symbol(d, Decl(additionOperatorWithStringAndEveryType.ts, 5, 3)) +>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3)) + +var r12 = e + x; +>r12 : Symbol(r12, Decl(additionOperatorWithStringAndEveryType.ts, 27, 3)) +>e : Symbol(e, Decl(additionOperatorWithStringAndEveryType.ts, 6, 3)) +>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3)) + +var r13 = f + x; +>r13 : Symbol(r13, Decl(additionOperatorWithStringAndEveryType.ts, 28, 3)) +>f : Symbol(f, Decl(additionOperatorWithStringAndEveryType.ts, 7, 3)) +>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3)) + +var r14 = g + x; +>r14 : Symbol(r14, Decl(additionOperatorWithStringAndEveryType.ts, 29, 3)) +>g : Symbol(g, Decl(additionOperatorWithStringAndEveryType.ts, 8, 3)) +>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3)) + +// other cases +var r15 = x + E; +>r15 : Symbol(r15, Decl(additionOperatorWithStringAndEveryType.ts, 32, 3)) +>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3)) +>E : Symbol(E, Decl(additionOperatorWithStringAndEveryType.ts, 0, 0)) + +var r16 = x + E.a; +>r16 : Symbol(r16, Decl(additionOperatorWithStringAndEveryType.ts, 33, 3)) +>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3)) +>E.a : Symbol(E.a, Decl(additionOperatorWithStringAndEveryType.ts, 0, 8)) +>E : Symbol(E, Decl(additionOperatorWithStringAndEveryType.ts, 0, 0)) +>a : Symbol(E.a, Decl(additionOperatorWithStringAndEveryType.ts, 0, 8)) + +var r17 = x + ''; +>r17 : Symbol(r17, Decl(additionOperatorWithStringAndEveryType.ts, 34, 3)) +>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3)) + +var r18 = x + 0; +>r18 : Symbol(r18, Decl(additionOperatorWithStringAndEveryType.ts, 35, 3)) +>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3)) + +var r19 = x + { a: '' }; +>r19 : Symbol(r19, Decl(additionOperatorWithStringAndEveryType.ts, 36, 3)) +>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3)) +>a : Symbol(a, Decl(additionOperatorWithStringAndEveryType.ts, 36, 15)) + +var r20 = x + []; +>r20 : Symbol(r20, Decl(additionOperatorWithStringAndEveryType.ts, 37, 3)) +>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3)) + diff --git a/tests/baselines/reference/additionOperatorWithStringAndEveryType.types b/tests/baselines/reference/additionOperatorWithStringAndEveryType.types index 9d5a926c427..5413f5f5bdf 100644 --- a/tests/baselines/reference/additionOperatorWithStringAndEveryType.types +++ b/tests/baselines/reference/additionOperatorWithStringAndEveryType.types @@ -137,11 +137,13 @@ var r17 = x + ''; >r17 : string >x + '' : string >x : string +>'' : string var r18 = x + 0; >r18 : string >x + 0 : string >x : string +>0 : number var r19 = x + { a: '' }; >r19 : string @@ -149,6 +151,7 @@ var r19 = x + { a: '' }; >x : string >{ a: '' } : { a: string; } >a : string +>'' : string var r20 = x + []; >r20 : string diff --git a/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.symbols b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.symbols new file mode 100644 index 00000000000..d91dd946c83 --- /dev/null +++ b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.symbols @@ -0,0 +1,107 @@ +=== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndValidOperator.ts === +// If one operand is the null or undefined value, it is treated as having the type of the other operand. + +enum E { a, b, c } +>E : Symbol(E, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 0, 0)) +>a : Symbol(E.a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 2, 8)) +>b : Symbol(E.b, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 2, 11)) +>c : Symbol(E.c, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 2, 14)) + +var a: any; +>a : Symbol(a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 4, 3)) + +var b: number; +>b : Symbol(b, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 5, 3)) + +var c: E; +>c : Symbol(c, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 6, 3)) +>E : Symbol(E, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 0, 0)) + +var d: string; +>d : Symbol(d, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 7, 3)) + +// undefined + any +var r1: any = undefined + a; +>r1 : Symbol(r1, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 10, 3)) +>undefined : Symbol(undefined) +>a : Symbol(a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 4, 3)) + +var r2: any = a + undefined; +>r2 : Symbol(r2, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 11, 3)) +>a : Symbol(a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 4, 3)) +>undefined : Symbol(undefined) + +// undefined + number/enum +var r3 = undefined + b; +>r3 : Symbol(r3, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 14, 3)) +>undefined : Symbol(undefined) +>b : Symbol(b, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 5, 3)) + +var r4 = undefined + 1; +>r4 : Symbol(r4, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 15, 3)) +>undefined : Symbol(undefined) + +var r5 = undefined + c; +>r5 : Symbol(r5, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 16, 3)) +>undefined : Symbol(undefined) +>c : Symbol(c, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 6, 3)) + +var r6 = undefined + E.a; +>r6 : Symbol(r6, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 17, 3)) +>undefined : Symbol(undefined) +>E.a : Symbol(E.a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 2, 8)) +>E : Symbol(E, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 0, 0)) +>a : Symbol(E.a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 2, 8)) + +var r7 = undefined + E['a']; +>r7 : Symbol(r7, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 18, 3)) +>undefined : Symbol(undefined) +>E : Symbol(E, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 0, 0)) +>'a' : Symbol(E.a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 2, 8)) + +var r8 = b + undefined; +>r8 : Symbol(r8, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 19, 3)) +>b : Symbol(b, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 5, 3)) +>undefined : Symbol(undefined) + +var r9 = 1 + undefined; +>r9 : Symbol(r9, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 20, 3)) +>undefined : Symbol(undefined) + +var r10 = c + undefined +>r10 : Symbol(r10, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 21, 3)) +>c : Symbol(c, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 6, 3)) +>undefined : Symbol(undefined) + +var r11 = E.a + undefined; +>r11 : Symbol(r11, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 22, 3)) +>E.a : Symbol(E.a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 2, 8)) +>E : Symbol(E, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 0, 0)) +>a : Symbol(E.a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 2, 8)) +>undefined : Symbol(undefined) + +var r12 = E['a'] + undefined; +>r12 : Symbol(r12, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 23, 3)) +>E : Symbol(E, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 0, 0)) +>'a' : Symbol(E.a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 2, 8)) +>undefined : Symbol(undefined) + +// undefined + string +var r13 = undefined + d; +>r13 : Symbol(r13, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 26, 3)) +>undefined : Symbol(undefined) +>d : Symbol(d, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 7, 3)) + +var r14 = undefined + ''; +>r14 : Symbol(r14, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 27, 3)) +>undefined : Symbol(undefined) + +var r15 = d + undefined; +>r15 : Symbol(r15, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 28, 3)) +>d : Symbol(d, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 7, 3)) +>undefined : Symbol(undefined) + +var r16 = '' + undefined; +>r16 : Symbol(r16, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 29, 3)) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.types b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.types index 9a67b25024c..16f0a4dfa84 100644 --- a/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.types +++ b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.types @@ -44,6 +44,7 @@ var r4 = undefined + 1; >r4 : number >undefined + 1 : number >undefined : undefined +>1 : number var r5 = undefined + c; >r5 : number @@ -65,6 +66,7 @@ var r7 = undefined + E['a']; >undefined : undefined >E['a'] : E >E : typeof E +>'a' : string var r8 = b + undefined; >r8 : number @@ -75,6 +77,7 @@ var r8 = b + undefined; var r9 = 1 + undefined; >r9 : number >1 + undefined : number +>1 : number >undefined : undefined var r10 = c + undefined @@ -96,6 +99,7 @@ var r12 = E['a'] + undefined; >E['a'] + undefined : number >E['a'] : E >E : typeof E +>'a' : string >undefined : undefined // undefined + string @@ -109,6 +113,7 @@ var r14 = undefined + ''; >r14 : string >undefined + '' : string >undefined : undefined +>'' : string var r15 = d + undefined; >r15 : string @@ -119,5 +124,6 @@ var r15 = d + undefined; var r16 = '' + undefined; >r16 : string >'' + undefined : string +>'' : string >undefined : undefined diff --git a/tests/baselines/reference/aliasUsageInAccessorsOfClass.symbols b/tests/baselines/reference/aliasUsageInAccessorsOfClass.symbols new file mode 100644 index 00000000000..3524b1ce31e --- /dev/null +++ b/tests/baselines/reference/aliasUsageInAccessorsOfClass.symbols @@ -0,0 +1,61 @@ +=== tests/cases/compiler/aliasUsage1_main.ts === +import Backbone = require("aliasUsage1_backbone"); +>Backbone : Symbol(Backbone, Decl(aliasUsage1_main.ts, 0, 0)) + +import moduleA = require("aliasUsage1_moduleA"); +>moduleA : Symbol(moduleA, Decl(aliasUsage1_main.ts, 0, 50)) + +interface IHasVisualizationModel { +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsage1_main.ts, 1, 48)) + + VisualizationModel: typeof Backbone.Model; +>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsage1_main.ts, 2, 34)) +>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsage1_backbone.ts, 0, 0)) +>Backbone : Symbol(Backbone, Decl(aliasUsage1_main.ts, 0, 0)) +>Model : Symbol(Backbone.Model, Decl(aliasUsage1_backbone.ts, 0, 0)) +} +class C2 { +>C2 : Symbol(C2, Decl(aliasUsage1_main.ts, 4, 1)) + + x: IHasVisualizationModel; +>x : Symbol(x, Decl(aliasUsage1_main.ts, 5, 10)) +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsage1_main.ts, 1, 48)) + + get A() { +>A : Symbol(A, Decl(aliasUsage1_main.ts, 6, 30), Decl(aliasUsage1_main.ts, 9, 5)) + + return this.x; +>this.x : Symbol(x, Decl(aliasUsage1_main.ts, 5, 10)) +>this : Symbol(C2, Decl(aliasUsage1_main.ts, 4, 1)) +>x : Symbol(x, Decl(aliasUsage1_main.ts, 5, 10)) + } + set A(x) { +>A : Symbol(A, Decl(aliasUsage1_main.ts, 6, 30), Decl(aliasUsage1_main.ts, 9, 5)) +>x : Symbol(x, Decl(aliasUsage1_main.ts, 10, 10)) + + x = moduleA; +>x : Symbol(x, Decl(aliasUsage1_main.ts, 10, 10)) +>moduleA : Symbol(moduleA, Decl(aliasUsage1_main.ts, 0, 50)) + } +} +=== tests/cases/compiler/aliasUsage1_backbone.ts === +export class Model { +>Model : Symbol(Model, Decl(aliasUsage1_backbone.ts, 0, 0)) + + public someData: string; +>someData : Symbol(someData, Decl(aliasUsage1_backbone.ts, 0, 20)) +} + +=== tests/cases/compiler/aliasUsage1_moduleA.ts === +import Backbone = require("aliasUsage1_backbone"); +>Backbone : Symbol(Backbone, Decl(aliasUsage1_moduleA.ts, 0, 0)) + +export class VisualizationModel extends Backbone.Model { +>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsage1_moduleA.ts, 0, 50)) +>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsage1_backbone.ts, 0, 0)) +>Backbone : Symbol(Backbone, Decl(aliasUsage1_moduleA.ts, 0, 0)) +>Model : Symbol(Backbone.Model, Decl(aliasUsage1_backbone.ts, 0, 0)) + + // interesting stuff here +} + diff --git a/tests/baselines/reference/aliasUsageInAccessorsOfClass.types b/tests/baselines/reference/aliasUsageInAccessorsOfClass.types index a666d2cee98..eccdbc8528c 100644 --- a/tests/baselines/reference/aliasUsageInAccessorsOfClass.types +++ b/tests/baselines/reference/aliasUsageInAccessorsOfClass.types @@ -10,6 +10,7 @@ interface IHasVisualizationModel { VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model +>Backbone.Model : typeof Backbone.Model >Backbone : typeof Backbone >Model : typeof Backbone.Model } @@ -52,6 +53,7 @@ import Backbone = require("aliasUsage1_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel +>Backbone.Model : any >Backbone : typeof Backbone >Model : Backbone.Model diff --git a/tests/baselines/reference/aliasUsageInArray.symbols b/tests/baselines/reference/aliasUsageInArray.symbols new file mode 100644 index 00000000000..7f1e31d2277 --- /dev/null +++ b/tests/baselines/reference/aliasUsageInArray.symbols @@ -0,0 +1,48 @@ +=== tests/cases/compiler/aliasUsageInArray_main.ts === +import Backbone = require("aliasUsageInArray_backbone"); +>Backbone : Symbol(Backbone, Decl(aliasUsageInArray_main.ts, 0, 0)) + +import moduleA = require("aliasUsageInArray_moduleA"); +>moduleA : Symbol(moduleA, Decl(aliasUsageInArray_main.ts, 0, 56)) + +interface IHasVisualizationModel { +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInArray_main.ts, 1, 54)) + + VisualizationModel: typeof Backbone.Model; +>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInArray_main.ts, 2, 34)) +>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInArray_backbone.ts, 0, 0)) +>Backbone : Symbol(Backbone, Decl(aliasUsageInArray_main.ts, 0, 0)) +>Model : Symbol(Backbone.Model, Decl(aliasUsageInArray_backbone.ts, 0, 0)) +} + +var xs: IHasVisualizationModel[] = [moduleA]; +>xs : Symbol(xs, Decl(aliasUsageInArray_main.ts, 6, 3)) +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInArray_main.ts, 1, 54)) +>moduleA : Symbol(moduleA, Decl(aliasUsageInArray_main.ts, 0, 56)) + +var xs2: typeof moduleA[] = [moduleA]; +>xs2 : Symbol(xs2, Decl(aliasUsageInArray_main.ts, 7, 3)) +>moduleA : Symbol(moduleA, Decl(aliasUsageInArray_main.ts, 0, 56)) +>moduleA : Symbol(moduleA, Decl(aliasUsageInArray_main.ts, 0, 56)) + +=== tests/cases/compiler/aliasUsageInArray_backbone.ts === +export class Model { +>Model : Symbol(Model, Decl(aliasUsageInArray_backbone.ts, 0, 0)) + + public someData: string; +>someData : Symbol(someData, Decl(aliasUsageInArray_backbone.ts, 0, 20)) +} + +=== tests/cases/compiler/aliasUsageInArray_moduleA.ts === +import Backbone = require("aliasUsageInArray_backbone"); +>Backbone : Symbol(Backbone, Decl(aliasUsageInArray_moduleA.ts, 0, 0)) + +export class VisualizationModel extends Backbone.Model { +>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInArray_moduleA.ts, 0, 56)) +>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInArray_backbone.ts, 0, 0)) +>Backbone : Symbol(Backbone, Decl(aliasUsageInArray_moduleA.ts, 0, 0)) +>Model : Symbol(Backbone.Model, Decl(aliasUsageInArray_backbone.ts, 0, 0)) + + // interesting stuff here +} + diff --git a/tests/baselines/reference/aliasUsageInArray.types b/tests/baselines/reference/aliasUsageInArray.types index f7e2beb49dd..ee54300e7d9 100644 --- a/tests/baselines/reference/aliasUsageInArray.types +++ b/tests/baselines/reference/aliasUsageInArray.types @@ -10,6 +10,7 @@ interface IHasVisualizationModel { VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model +>Backbone.Model : typeof Backbone.Model >Backbone : typeof Backbone >Model : typeof Backbone.Model } @@ -40,6 +41,7 @@ import Backbone = require("aliasUsageInArray_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel +>Backbone.Model : any >Backbone : typeof Backbone >Model : Backbone.Model diff --git a/tests/baselines/reference/aliasUsageInFunctionExpression.symbols b/tests/baselines/reference/aliasUsageInFunctionExpression.symbols new file mode 100644 index 00000000000..2afb6be55c5 --- /dev/null +++ b/tests/baselines/reference/aliasUsageInFunctionExpression.symbols @@ -0,0 +1,48 @@ +=== tests/cases/compiler/aliasUsageInFunctionExpression_main.ts === +import Backbone = require("aliasUsageInFunctionExpression_backbone"); +>Backbone : Symbol(Backbone, Decl(aliasUsageInFunctionExpression_main.ts, 0, 0)) + +import moduleA = require("aliasUsageInFunctionExpression_moduleA"); +>moduleA : Symbol(moduleA, Decl(aliasUsageInFunctionExpression_main.ts, 0, 69)) + +interface IHasVisualizationModel { +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInFunctionExpression_main.ts, 1, 67)) + + VisualizationModel: typeof Backbone.Model; +>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInFunctionExpression_main.ts, 2, 34)) +>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInFunctionExpression_backbone.ts, 0, 0)) +>Backbone : Symbol(Backbone, Decl(aliasUsageInFunctionExpression_main.ts, 0, 0)) +>Model : Symbol(Backbone.Model, Decl(aliasUsageInFunctionExpression_backbone.ts, 0, 0)) +} +var f = (x: IHasVisualizationModel) => x; +>f : Symbol(f, Decl(aliasUsageInFunctionExpression_main.ts, 5, 3)) +>x : Symbol(x, Decl(aliasUsageInFunctionExpression_main.ts, 5, 9)) +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInFunctionExpression_main.ts, 1, 67)) +>x : Symbol(x, Decl(aliasUsageInFunctionExpression_main.ts, 5, 9)) + +f = (x) => moduleA; +>f : Symbol(f, Decl(aliasUsageInFunctionExpression_main.ts, 5, 3)) +>x : Symbol(x, Decl(aliasUsageInFunctionExpression_main.ts, 6, 5)) +>moduleA : Symbol(moduleA, Decl(aliasUsageInFunctionExpression_main.ts, 0, 69)) + +=== tests/cases/compiler/aliasUsageInFunctionExpression_backbone.ts === +export class Model { +>Model : Symbol(Model, Decl(aliasUsageInFunctionExpression_backbone.ts, 0, 0)) + + public someData: string; +>someData : Symbol(someData, Decl(aliasUsageInFunctionExpression_backbone.ts, 0, 20)) +} + +=== tests/cases/compiler/aliasUsageInFunctionExpression_moduleA.ts === +import Backbone = require("aliasUsageInFunctionExpression_backbone"); +>Backbone : Symbol(Backbone, Decl(aliasUsageInFunctionExpression_moduleA.ts, 0, 0)) + +export class VisualizationModel extends Backbone.Model { +>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInFunctionExpression_moduleA.ts, 0, 69)) +>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInFunctionExpression_backbone.ts, 0, 0)) +>Backbone : Symbol(Backbone, Decl(aliasUsageInFunctionExpression_moduleA.ts, 0, 0)) +>Model : Symbol(Backbone.Model, Decl(aliasUsageInFunctionExpression_backbone.ts, 0, 0)) + + // interesting stuff here +} + diff --git a/tests/baselines/reference/aliasUsageInFunctionExpression.types b/tests/baselines/reference/aliasUsageInFunctionExpression.types index 392481d2d02..17994dcab52 100644 --- a/tests/baselines/reference/aliasUsageInFunctionExpression.types +++ b/tests/baselines/reference/aliasUsageInFunctionExpression.types @@ -10,6 +10,7 @@ interface IHasVisualizationModel { VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model +>Backbone.Model : typeof Backbone.Model >Backbone : typeof Backbone >Model : typeof Backbone.Model } @@ -41,6 +42,7 @@ import Backbone = require("aliasUsageInFunctionExpression_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel +>Backbone.Model : any >Backbone : typeof Backbone >Model : Backbone.Model diff --git a/tests/baselines/reference/aliasUsageInGenericFunction.symbols b/tests/baselines/reference/aliasUsageInGenericFunction.symbols new file mode 100644 index 00000000000..3f001e8bd1a --- /dev/null +++ b/tests/baselines/reference/aliasUsageInGenericFunction.symbols @@ -0,0 +1,60 @@ +=== tests/cases/compiler/aliasUsageInGenericFunction_main.ts === +import Backbone = require("aliasUsageInGenericFunction_backbone"); +>Backbone : Symbol(Backbone, Decl(aliasUsageInGenericFunction_main.ts, 0, 0)) + +import moduleA = require("aliasUsageInGenericFunction_moduleA"); +>moduleA : Symbol(moduleA, Decl(aliasUsageInGenericFunction_main.ts, 0, 66)) + +interface IHasVisualizationModel { +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInGenericFunction_main.ts, 1, 64)) + + VisualizationModel: typeof Backbone.Model; +>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInGenericFunction_main.ts, 2, 34)) +>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInGenericFunction_backbone.ts, 0, 0)) +>Backbone : Symbol(Backbone, Decl(aliasUsageInGenericFunction_main.ts, 0, 0)) +>Model : Symbol(Backbone.Model, Decl(aliasUsageInGenericFunction_backbone.ts, 0, 0)) +} +function foo(x: T) { +>foo : Symbol(foo, Decl(aliasUsageInGenericFunction_main.ts, 4, 1)) +>T : Symbol(T, Decl(aliasUsageInGenericFunction_main.ts, 5, 13)) +>a : Symbol(a, Decl(aliasUsageInGenericFunction_main.ts, 5, 24)) +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInGenericFunction_main.ts, 1, 64)) +>x : Symbol(x, Decl(aliasUsageInGenericFunction_main.ts, 5, 54)) +>T : Symbol(T, Decl(aliasUsageInGenericFunction_main.ts, 5, 13)) + + return x; +>x : Symbol(x, Decl(aliasUsageInGenericFunction_main.ts, 5, 54)) +} +var r = foo({ a: moduleA }); +>r : Symbol(r, Decl(aliasUsageInGenericFunction_main.ts, 8, 3)) +>foo : Symbol(foo, Decl(aliasUsageInGenericFunction_main.ts, 4, 1)) +>a : Symbol(a, Decl(aliasUsageInGenericFunction_main.ts, 8, 13)) +>moduleA : Symbol(moduleA, Decl(aliasUsageInGenericFunction_main.ts, 0, 66)) + +var r2 = foo({ a: null }); +>r2 : Symbol(r2, Decl(aliasUsageInGenericFunction_main.ts, 9, 3)) +>foo : Symbol(foo, Decl(aliasUsageInGenericFunction_main.ts, 4, 1)) +>a : Symbol(a, Decl(aliasUsageInGenericFunction_main.ts, 9, 14)) +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInGenericFunction_main.ts, 1, 64)) + +=== tests/cases/compiler/aliasUsageInGenericFunction_backbone.ts === +export class Model { +>Model : Symbol(Model, Decl(aliasUsageInGenericFunction_backbone.ts, 0, 0)) + + public someData: string; +>someData : Symbol(someData, Decl(aliasUsageInGenericFunction_backbone.ts, 0, 20)) +} + +=== tests/cases/compiler/aliasUsageInGenericFunction_moduleA.ts === +import Backbone = require("aliasUsageInGenericFunction_backbone"); +>Backbone : Symbol(Backbone, Decl(aliasUsageInGenericFunction_moduleA.ts, 0, 0)) + +export class VisualizationModel extends Backbone.Model { +>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInGenericFunction_moduleA.ts, 0, 66)) +>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInGenericFunction_backbone.ts, 0, 0)) +>Backbone : Symbol(Backbone, Decl(aliasUsageInGenericFunction_moduleA.ts, 0, 0)) +>Model : Symbol(Backbone.Model, Decl(aliasUsageInGenericFunction_backbone.ts, 0, 0)) + + // interesting stuff here +} + diff --git a/tests/baselines/reference/aliasUsageInGenericFunction.types b/tests/baselines/reference/aliasUsageInGenericFunction.types index 568e885f51f..0821732f5fc 100644 --- a/tests/baselines/reference/aliasUsageInGenericFunction.types +++ b/tests/baselines/reference/aliasUsageInGenericFunction.types @@ -10,6 +10,7 @@ interface IHasVisualizationModel { VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model +>Backbone.Model : typeof Backbone.Model >Backbone : typeof Backbone >Model : typeof Backbone.Model } @@ -40,6 +41,7 @@ var r2 = foo({ a: null }); >a : IHasVisualizationModel >null : IHasVisualizationModel >IHasVisualizationModel : IHasVisualizationModel +>null : null === tests/cases/compiler/aliasUsageInGenericFunction_backbone.ts === export class Model { @@ -55,6 +57,7 @@ import Backbone = require("aliasUsageInGenericFunction_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel +>Backbone.Model : any >Backbone : typeof Backbone >Model : Backbone.Model diff --git a/tests/baselines/reference/aliasUsageInIndexerOfClass.symbols b/tests/baselines/reference/aliasUsageInIndexerOfClass.symbols new file mode 100644 index 00000000000..900653c7fd1 --- /dev/null +++ b/tests/baselines/reference/aliasUsageInIndexerOfClass.symbols @@ -0,0 +1,59 @@ +=== tests/cases/compiler/aliasUsageInIndexerOfClass_main.ts === +import Backbone = require("aliasUsageInIndexerOfClass_backbone"); +>Backbone : Symbol(Backbone, Decl(aliasUsageInIndexerOfClass_main.ts, 0, 0)) + +import moduleA = require("aliasUsageInIndexerOfClass_moduleA"); +>moduleA : Symbol(moduleA, Decl(aliasUsageInIndexerOfClass_main.ts, 0, 65)) + +interface IHasVisualizationModel { +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInIndexerOfClass_main.ts, 1, 63)) + + VisualizationModel: typeof Backbone.Model; +>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInIndexerOfClass_main.ts, 2, 34)) +>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInIndexerOfClass_backbone.ts, 0, 0)) +>Backbone : Symbol(Backbone, Decl(aliasUsageInIndexerOfClass_main.ts, 0, 0)) +>Model : Symbol(Backbone.Model, Decl(aliasUsageInIndexerOfClass_backbone.ts, 0, 0)) +} +class N { +>N : Symbol(N, Decl(aliasUsageInIndexerOfClass_main.ts, 4, 1)) + + [idx: string]: IHasVisualizationModel +>idx : Symbol(idx, Decl(aliasUsageInIndexerOfClass_main.ts, 6, 5)) +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInIndexerOfClass_main.ts, 1, 63)) + + x = moduleA; +>x : Symbol(x, Decl(aliasUsageInIndexerOfClass_main.ts, 6, 41)) +>moduleA : Symbol(moduleA, Decl(aliasUsageInIndexerOfClass_main.ts, 0, 65)) +} +class N2 { +>N2 : Symbol(N2, Decl(aliasUsageInIndexerOfClass_main.ts, 8, 1)) + + [idx: string]: typeof moduleA +>idx : Symbol(idx, Decl(aliasUsageInIndexerOfClass_main.ts, 10, 5)) +>moduleA : Symbol(moduleA, Decl(aliasUsageInIndexerOfClass_main.ts, 0, 65)) + + x: IHasVisualizationModel; +>x : Symbol(x, Decl(aliasUsageInIndexerOfClass_main.ts, 10, 33)) +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInIndexerOfClass_main.ts, 1, 63)) +} +=== tests/cases/compiler/aliasUsageInIndexerOfClass_backbone.ts === +export class Model { +>Model : Symbol(Model, Decl(aliasUsageInIndexerOfClass_backbone.ts, 0, 0)) + + public someData: string; +>someData : Symbol(someData, Decl(aliasUsageInIndexerOfClass_backbone.ts, 0, 20)) +} + +=== tests/cases/compiler/aliasUsageInIndexerOfClass_moduleA.ts === +import Backbone = require("aliasUsageInIndexerOfClass_backbone"); +>Backbone : Symbol(Backbone, Decl(aliasUsageInIndexerOfClass_moduleA.ts, 0, 0)) + +export class VisualizationModel extends Backbone.Model { +>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInIndexerOfClass_moduleA.ts, 0, 65)) +>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInIndexerOfClass_backbone.ts, 0, 0)) +>Backbone : Symbol(Backbone, Decl(aliasUsageInIndexerOfClass_moduleA.ts, 0, 0)) +>Model : Symbol(Backbone.Model, Decl(aliasUsageInIndexerOfClass_backbone.ts, 0, 0)) + + // interesting stuff here +} + diff --git a/tests/baselines/reference/aliasUsageInIndexerOfClass.types b/tests/baselines/reference/aliasUsageInIndexerOfClass.types index e968abe597f..fe67655d4f5 100644 --- a/tests/baselines/reference/aliasUsageInIndexerOfClass.types +++ b/tests/baselines/reference/aliasUsageInIndexerOfClass.types @@ -10,6 +10,7 @@ interface IHasVisualizationModel { VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model +>Backbone.Model : typeof Backbone.Model >Backbone : typeof Backbone >Model : typeof Backbone.Model } @@ -49,6 +50,7 @@ import Backbone = require("aliasUsageInIndexerOfClass_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel +>Backbone.Model : any >Backbone : typeof Backbone >Model : Backbone.Model diff --git a/tests/baselines/reference/aliasUsageInObjectLiteral.symbols b/tests/baselines/reference/aliasUsageInObjectLiteral.symbols new file mode 100644 index 00000000000..a508e9fafc1 --- /dev/null +++ b/tests/baselines/reference/aliasUsageInObjectLiteral.symbols @@ -0,0 +1,60 @@ +=== tests/cases/compiler/aliasUsageInObjectLiteral_main.ts === +import Backbone = require("aliasUsageInObjectLiteral_backbone"); +>Backbone : Symbol(Backbone, Decl(aliasUsageInObjectLiteral_main.ts, 0, 0)) + +import moduleA = require("aliasUsageInObjectLiteral_moduleA"); +>moduleA : Symbol(moduleA, Decl(aliasUsageInObjectLiteral_main.ts, 0, 64)) + +interface IHasVisualizationModel { +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInObjectLiteral_main.ts, 1, 62)) + + VisualizationModel: typeof Backbone.Model; +>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInObjectLiteral_main.ts, 2, 34)) +>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInObjectLiteral_backbone.ts, 0, 0)) +>Backbone : Symbol(Backbone, Decl(aliasUsageInObjectLiteral_main.ts, 0, 0)) +>Model : Symbol(Backbone.Model, Decl(aliasUsageInObjectLiteral_backbone.ts, 0, 0)) +} +var a: { x: typeof moduleA } = { x: moduleA }; +>a : Symbol(a, Decl(aliasUsageInObjectLiteral_main.ts, 5, 3)) +>x : Symbol(x, Decl(aliasUsageInObjectLiteral_main.ts, 5, 8)) +>moduleA : Symbol(moduleA, Decl(aliasUsageInObjectLiteral_main.ts, 0, 64)) +>x : Symbol(x, Decl(aliasUsageInObjectLiteral_main.ts, 5, 32)) +>moduleA : Symbol(moduleA, Decl(aliasUsageInObjectLiteral_main.ts, 0, 64)) + +var b: { x: IHasVisualizationModel } = { x: moduleA }; +>b : Symbol(b, Decl(aliasUsageInObjectLiteral_main.ts, 6, 3)) +>x : Symbol(x, Decl(aliasUsageInObjectLiteral_main.ts, 6, 8)) +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInObjectLiteral_main.ts, 1, 62)) +>x : Symbol(x, Decl(aliasUsageInObjectLiteral_main.ts, 6, 40)) +>moduleA : Symbol(moduleA, Decl(aliasUsageInObjectLiteral_main.ts, 0, 64)) + +var c: { y: { z: IHasVisualizationModel } } = { y: { z: moduleA } }; +>c : Symbol(c, Decl(aliasUsageInObjectLiteral_main.ts, 7, 3)) +>y : Symbol(y, Decl(aliasUsageInObjectLiteral_main.ts, 7, 8)) +>z : Symbol(z, Decl(aliasUsageInObjectLiteral_main.ts, 7, 13)) +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInObjectLiteral_main.ts, 1, 62)) +>y : Symbol(y, Decl(aliasUsageInObjectLiteral_main.ts, 7, 47)) +>z : Symbol(z, Decl(aliasUsageInObjectLiteral_main.ts, 7, 52)) +>moduleA : Symbol(moduleA, Decl(aliasUsageInObjectLiteral_main.ts, 0, 64)) + +=== tests/cases/compiler/aliasUsageInObjectLiteral_backbone.ts === +export class Model { +>Model : Symbol(Model, Decl(aliasUsageInObjectLiteral_backbone.ts, 0, 0)) + + public someData: string; +>someData : Symbol(someData, Decl(aliasUsageInObjectLiteral_backbone.ts, 0, 20)) +} + +=== tests/cases/compiler/aliasUsageInObjectLiteral_moduleA.ts === +import Backbone = require("aliasUsageInObjectLiteral_backbone"); +>Backbone : Symbol(Backbone, Decl(aliasUsageInObjectLiteral_moduleA.ts, 0, 0)) + +export class VisualizationModel extends Backbone.Model { +>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInObjectLiteral_moduleA.ts, 0, 64)) +>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInObjectLiteral_backbone.ts, 0, 0)) +>Backbone : Symbol(Backbone, Decl(aliasUsageInObjectLiteral_moduleA.ts, 0, 0)) +>Model : Symbol(Backbone.Model, Decl(aliasUsageInObjectLiteral_backbone.ts, 0, 0)) + + // interesting stuff here +} + diff --git a/tests/baselines/reference/aliasUsageInObjectLiteral.types b/tests/baselines/reference/aliasUsageInObjectLiteral.types index 2e631a41cdf..32a78d555b1 100644 --- a/tests/baselines/reference/aliasUsageInObjectLiteral.types +++ b/tests/baselines/reference/aliasUsageInObjectLiteral.types @@ -10,6 +10,7 @@ interface IHasVisualizationModel { VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model +>Backbone.Model : typeof Backbone.Model >Backbone : typeof Backbone >Model : typeof Backbone.Model } @@ -54,6 +55,7 @@ import Backbone = require("aliasUsageInObjectLiteral_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel +>Backbone.Model : any >Backbone : typeof Backbone >Model : Backbone.Model diff --git a/tests/baselines/reference/aliasUsageInOrExpression.symbols b/tests/baselines/reference/aliasUsageInOrExpression.symbols new file mode 100644 index 00000000000..adfba01a119 --- /dev/null +++ b/tests/baselines/reference/aliasUsageInOrExpression.symbols @@ -0,0 +1,76 @@ +=== tests/cases/compiler/aliasUsageInOrExpression_main.ts === +import Backbone = require("aliasUsageInOrExpression_backbone"); +>Backbone : Symbol(Backbone, Decl(aliasUsageInOrExpression_main.ts, 0, 0)) + +import moduleA = require("aliasUsageInOrExpression_moduleA"); +>moduleA : Symbol(moduleA, Decl(aliasUsageInOrExpression_main.ts, 0, 63)) + +interface IHasVisualizationModel { +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61)) + + VisualizationModel: typeof Backbone.Model; +>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 2, 34)) +>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInOrExpression_backbone.ts, 0, 0)) +>Backbone : Symbol(Backbone, Decl(aliasUsageInOrExpression_main.ts, 0, 0)) +>Model : Symbol(Backbone.Model, Decl(aliasUsageInOrExpression_backbone.ts, 0, 0)) +} +var i: IHasVisualizationModel; +>i : Symbol(i, Decl(aliasUsageInOrExpression_main.ts, 5, 3)) +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61)) + +var d1 = i || moduleA; +>d1 : Symbol(d1, Decl(aliasUsageInOrExpression_main.ts, 6, 3)) +>i : Symbol(i, Decl(aliasUsageInOrExpression_main.ts, 5, 3)) +>moduleA : Symbol(moduleA, Decl(aliasUsageInOrExpression_main.ts, 0, 63)) + +var d2: IHasVisualizationModel = i || moduleA; +>d2 : Symbol(d2, Decl(aliasUsageInOrExpression_main.ts, 7, 3), Decl(aliasUsageInOrExpression_main.ts, 8, 3)) +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61)) +>i : Symbol(i, Decl(aliasUsageInOrExpression_main.ts, 5, 3)) +>moduleA : Symbol(moduleA, Decl(aliasUsageInOrExpression_main.ts, 0, 63)) + +var d2: IHasVisualizationModel = moduleA || i; +>d2 : Symbol(d2, Decl(aliasUsageInOrExpression_main.ts, 7, 3), Decl(aliasUsageInOrExpression_main.ts, 8, 3)) +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61)) +>moduleA : Symbol(moduleA, Decl(aliasUsageInOrExpression_main.ts, 0, 63)) +>i : Symbol(i, Decl(aliasUsageInOrExpression_main.ts, 5, 3)) + +var e: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null || { x: moduleA }; +>e : Symbol(e, Decl(aliasUsageInOrExpression_main.ts, 9, 3)) +>x : Symbol(x, Decl(aliasUsageInOrExpression_main.ts, 9, 8)) +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61)) +>x : Symbol(x, Decl(aliasUsageInOrExpression_main.ts, 9, 41)) +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61)) +>x : Symbol(x, Decl(aliasUsageInOrExpression_main.ts, 9, 79)) +>moduleA : Symbol(moduleA, Decl(aliasUsageInOrExpression_main.ts, 0, 63)) + +var f: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null ? { x: moduleA } : null; +>f : Symbol(f, Decl(aliasUsageInOrExpression_main.ts, 10, 3)) +>x : Symbol(x, Decl(aliasUsageInOrExpression_main.ts, 10, 8)) +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61)) +>x : Symbol(x, Decl(aliasUsageInOrExpression_main.ts, 10, 41)) +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61)) +>x : Symbol(x, Decl(aliasUsageInOrExpression_main.ts, 10, 78)) +>moduleA : Symbol(moduleA, Decl(aliasUsageInOrExpression_main.ts, 0, 63)) + +=== tests/cases/compiler/aliasUsageInOrExpression_backbone.ts === +export class Model { +>Model : Symbol(Model, Decl(aliasUsageInOrExpression_backbone.ts, 0, 0)) + + public someData: string; +>someData : Symbol(someData, Decl(aliasUsageInOrExpression_backbone.ts, 0, 20)) +} + +=== tests/cases/compiler/aliasUsageInOrExpression_moduleA.ts === +import Backbone = require("aliasUsageInOrExpression_backbone"); +>Backbone : Symbol(Backbone, Decl(aliasUsageInOrExpression_moduleA.ts, 0, 0)) + +export class VisualizationModel extends Backbone.Model { +>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInOrExpression_moduleA.ts, 0, 63)) +>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInOrExpression_backbone.ts, 0, 0)) +>Backbone : Symbol(Backbone, Decl(aliasUsageInOrExpression_moduleA.ts, 0, 0)) +>Model : Symbol(Backbone.Model, Decl(aliasUsageInOrExpression_backbone.ts, 0, 0)) + + // interesting stuff here +} + diff --git a/tests/baselines/reference/aliasUsageInOrExpression.types b/tests/baselines/reference/aliasUsageInOrExpression.types index 1a4dae90356..8d3163d481b 100644 --- a/tests/baselines/reference/aliasUsageInOrExpression.types +++ b/tests/baselines/reference/aliasUsageInOrExpression.types @@ -10,6 +10,7 @@ interface IHasVisualizationModel { VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model +>Backbone.Model : typeof Backbone.Model >Backbone : typeof Backbone >Model : typeof Backbone.Model } @@ -45,6 +46,7 @@ var e: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null || { ><{ x: IHasVisualizationModel }>null : { x: IHasVisualizationModel; } >x : IHasVisualizationModel >IHasVisualizationModel : IHasVisualizationModel +>null : null >{ x: moduleA } : { x: typeof moduleA; } >x : typeof moduleA >moduleA : typeof moduleA @@ -57,9 +59,11 @@ var f: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null ? { x ><{ x: IHasVisualizationModel }>null : { x: IHasVisualizationModel; } >x : IHasVisualizationModel >IHasVisualizationModel : IHasVisualizationModel +>null : null >{ x: moduleA } : { x: typeof moduleA; } >x : typeof moduleA >moduleA : typeof moduleA +>null : null === tests/cases/compiler/aliasUsageInOrExpression_backbone.ts === export class Model { @@ -75,6 +79,7 @@ import Backbone = require("aliasUsageInOrExpression_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel +>Backbone.Model : any >Backbone : typeof Backbone >Model : Backbone.Model diff --git a/tests/baselines/reference/aliasUsageInOrExpression.types.pull b/tests/baselines/reference/aliasUsageInOrExpression.types.pull deleted file mode 100644 index 3b138d1404a..00000000000 --- a/tests/baselines/reference/aliasUsageInOrExpression.types.pull +++ /dev/null @@ -1,83 +0,0 @@ -=== tests/cases/compiler/aliasUsageInOrExpression_main.ts === -import Backbone = require("aliasUsageInOrExpression_backbone"); ->Backbone : typeof Backbone - -import moduleA = require("aliasUsageInOrExpression_moduleA"); ->moduleA : typeof moduleA - -interface IHasVisualizationModel { ->IHasVisualizationModel : IHasVisualizationModel - - VisualizationModel: typeof Backbone.Model; ->VisualizationModel : typeof Backbone.Model ->Backbone : typeof Backbone ->Model : typeof Backbone.Model -} -var i: IHasVisualizationModel; ->i : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel - -var d1 = i || moduleA; ->d1 : typeof moduleA ->i || moduleA : typeof moduleA ->i : IHasVisualizationModel ->moduleA : typeof moduleA - -var d2: IHasVisualizationModel = i || moduleA; ->d2 : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel ->i || moduleA : typeof moduleA ->i : IHasVisualizationModel ->moduleA : typeof moduleA - -var d2: IHasVisualizationModel = moduleA || i; ->d2 : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel ->moduleA || i : typeof moduleA ->moduleA : typeof moduleA ->i : IHasVisualizationModel - -var e: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null || { x: moduleA }; ->e : { x: IHasVisualizationModel; } ->x : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel -><{ x: IHasVisualizationModel }>null || { x: moduleA } : { x: IHasVisualizationModel; } -><{ x: IHasVisualizationModel }>null : { x: IHasVisualizationModel; } ->x : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel ->{ x: moduleA } : { x: typeof moduleA; } ->x : typeof moduleA ->moduleA : typeof moduleA - -var f: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null ? { x: moduleA } : null; ->f : { x: IHasVisualizationModel; } ->x : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel -><{ x: IHasVisualizationModel }>null ? { x: moduleA } : null : { x: typeof moduleA; } -><{ x: IHasVisualizationModel }>null : { x: IHasVisualizationModel; } ->x : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel ->{ x: moduleA } : { x: typeof moduleA; } ->x : typeof moduleA ->moduleA : typeof moduleA - -=== tests/cases/compiler/aliasUsageInOrExpression_backbone.ts === -export class Model { ->Model : Model - - public someData: string; ->someData : string -} - -=== tests/cases/compiler/aliasUsageInOrExpression_moduleA.ts === -import Backbone = require("aliasUsageInOrExpression_backbone"); ->Backbone : typeof Backbone - -export class VisualizationModel extends Backbone.Model { ->VisualizationModel : VisualizationModel ->Backbone : typeof Backbone ->Model : Backbone.Model - - // interesting stuff here -} - diff --git a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.symbols b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.symbols new file mode 100644 index 00000000000..f3ca1f7ec37 --- /dev/null +++ b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.symbols @@ -0,0 +1,55 @@ +=== tests/cases/compiler/aliasUsageInTypeArgumentOfExtendsClause_main.ts === +import Backbone = require("aliasUsageInTypeArgumentOfExtendsClause_backbone"); +>Backbone : Symbol(Backbone, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 0, 0)) + +import moduleA = require("aliasUsageInTypeArgumentOfExtendsClause_moduleA"); +>moduleA : Symbol(moduleA, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 0, 78)) + +interface IHasVisualizationModel { +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 1, 76)) + + VisualizationModel: typeof Backbone.Model; +>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 2, 34)) +>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInTypeArgumentOfExtendsClause_backbone.ts, 0, 0)) +>Backbone : Symbol(Backbone, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 0, 0)) +>Model : Symbol(Backbone.Model, Decl(aliasUsageInTypeArgumentOfExtendsClause_backbone.ts, 0, 0)) +} +class C { +>C : Symbol(C, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 4, 1)) +>T : Symbol(T, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 5, 8)) +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 1, 76)) + + x: T; +>x : Symbol(x, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 5, 43)) +>T : Symbol(T, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 5, 8)) +} +class D extends C { +>D : Symbol(D, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 7, 1)) +>C : Symbol(C, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 4, 1)) +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 1, 76)) + + x = moduleA; +>x : Symbol(x, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 8, 43)) +>moduleA : Symbol(moduleA, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 0, 78)) +} +=== tests/cases/compiler/aliasUsageInTypeArgumentOfExtendsClause_backbone.ts === +export class Model { +>Model : Symbol(Model, Decl(aliasUsageInTypeArgumentOfExtendsClause_backbone.ts, 0, 0)) + + public someData: string; +>someData : Symbol(someData, Decl(aliasUsageInTypeArgumentOfExtendsClause_backbone.ts, 0, 20)) +} + +=== tests/cases/compiler/aliasUsageInTypeArgumentOfExtendsClause_moduleA.ts === +import Backbone = require("aliasUsageInTypeArgumentOfExtendsClause_backbone"); +>Backbone : Symbol(Backbone, Decl(aliasUsageInTypeArgumentOfExtendsClause_moduleA.ts, 0, 0)) + +export class VisualizationModel extends Backbone.Model { +>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInTypeArgumentOfExtendsClause_moduleA.ts, 0, 78)) +>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInTypeArgumentOfExtendsClause_backbone.ts, 0, 0)) +>Backbone : Symbol(Backbone, Decl(aliasUsageInTypeArgumentOfExtendsClause_moduleA.ts, 0, 0)) +>Model : Symbol(Backbone.Model, Decl(aliasUsageInTypeArgumentOfExtendsClause_backbone.ts, 0, 0)) + + // interesting stuff here +} + diff --git a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.types b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.types index 72f0aaf9e20..460b422a2a4 100644 --- a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.types +++ b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.types @@ -10,6 +10,7 @@ interface IHasVisualizationModel { VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model +>Backbone.Model : typeof Backbone.Model >Backbone : typeof Backbone >Model : typeof Backbone.Model } @@ -45,6 +46,7 @@ import Backbone = require("aliasUsageInTypeArgumentOfExtendsClause_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel +>Backbone.Model : any >Backbone : typeof Backbone >Model : Backbone.Model diff --git a/tests/baselines/reference/aliasUsageInVarAssignment.symbols b/tests/baselines/reference/aliasUsageInVarAssignment.symbols new file mode 100644 index 00000000000..d1996fe8ecb --- /dev/null +++ b/tests/baselines/reference/aliasUsageInVarAssignment.symbols @@ -0,0 +1,46 @@ +=== tests/cases/compiler/aliasUsageInVarAssignment_main.ts === +import Backbone = require("aliasUsageInVarAssignment_backbone"); +>Backbone : Symbol(Backbone, Decl(aliasUsageInVarAssignment_main.ts, 0, 0)) + +import moduleA = require("aliasUsageInVarAssignment_moduleA"); +>moduleA : Symbol(moduleA, Decl(aliasUsageInVarAssignment_main.ts, 0, 64)) + +interface IHasVisualizationModel { +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInVarAssignment_main.ts, 1, 62)) + + VisualizationModel: typeof Backbone.Model; +>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInVarAssignment_main.ts, 2, 34)) +>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInVarAssignment_backbone.ts, 0, 0)) +>Backbone : Symbol(Backbone, Decl(aliasUsageInVarAssignment_main.ts, 0, 0)) +>Model : Symbol(Backbone.Model, Decl(aliasUsageInVarAssignment_backbone.ts, 0, 0)) +} +var i: IHasVisualizationModel; +>i : Symbol(i, Decl(aliasUsageInVarAssignment_main.ts, 5, 3)) +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInVarAssignment_main.ts, 1, 62)) + +var m: typeof moduleA = i; +>m : Symbol(m, Decl(aliasUsageInVarAssignment_main.ts, 6, 3)) +>moduleA : Symbol(moduleA, Decl(aliasUsageInVarAssignment_main.ts, 0, 64)) +>i : Symbol(i, Decl(aliasUsageInVarAssignment_main.ts, 5, 3)) + +=== tests/cases/compiler/aliasUsageInVarAssignment_backbone.ts === +export class Model { +>Model : Symbol(Model, Decl(aliasUsageInVarAssignment_backbone.ts, 0, 0)) + + public someData: string; +>someData : Symbol(someData, Decl(aliasUsageInVarAssignment_backbone.ts, 0, 20)) +} + +=== tests/cases/compiler/aliasUsageInVarAssignment_moduleA.ts === +import Backbone = require("aliasUsageInVarAssignment_backbone"); +>Backbone : Symbol(Backbone, Decl(aliasUsageInVarAssignment_moduleA.ts, 0, 0)) + +export class VisualizationModel extends Backbone.Model { +>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInVarAssignment_moduleA.ts, 0, 64)) +>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInVarAssignment_backbone.ts, 0, 0)) +>Backbone : Symbol(Backbone, Decl(aliasUsageInVarAssignment_moduleA.ts, 0, 0)) +>Model : Symbol(Backbone.Model, Decl(aliasUsageInVarAssignment_backbone.ts, 0, 0)) + + // interesting stuff here +} + diff --git a/tests/baselines/reference/aliasUsageInVarAssignment.types b/tests/baselines/reference/aliasUsageInVarAssignment.types index 6b1c097ad97..b5d20a1b372 100644 --- a/tests/baselines/reference/aliasUsageInVarAssignment.types +++ b/tests/baselines/reference/aliasUsageInVarAssignment.types @@ -10,6 +10,7 @@ interface IHasVisualizationModel { VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model +>Backbone.Model : typeof Backbone.Model >Backbone : typeof Backbone >Model : typeof Backbone.Model } @@ -36,6 +37,7 @@ import Backbone = require("aliasUsageInVarAssignment_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel +>Backbone.Model : any >Backbone : typeof Backbone >Model : Backbone.Model diff --git a/tests/baselines/reference/aliasUsedAsNameValue.symbols b/tests/baselines/reference/aliasUsedAsNameValue.symbols new file mode 100644 index 00000000000..a816e2b2c63 --- /dev/null +++ b/tests/baselines/reference/aliasUsedAsNameValue.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/aliasUsedAsNameValue_2.ts === +/// +/// +import mod = require("aliasUsedAsNameValue_0"); +>mod : Symbol(mod, Decl(aliasUsedAsNameValue_2.ts, 0, 0)) + +import b = require("aliasUsedAsNameValue_1"); +>b : Symbol(b, Decl(aliasUsedAsNameValue_2.ts, 2, 47)) + +export var a = function () { +>a : Symbol(a, Decl(aliasUsedAsNameValue_2.ts, 5, 10)) + + //var x = mod.id; // TODO needed hack that mod is loaded + b.b(mod); +>b.b : Symbol(b.b, Decl(aliasUsedAsNameValue_1.ts, 0, 0)) +>b : Symbol(b, Decl(aliasUsedAsNameValue_2.ts, 2, 47)) +>b : Symbol(b.b, Decl(aliasUsedAsNameValue_1.ts, 0, 0)) +>mod : Symbol(mod, Decl(aliasUsedAsNameValue_2.ts, 0, 0)) +} + +=== tests/cases/compiler/aliasUsedAsNameValue_0.ts === +export var id: number; +>id : Symbol(id, Decl(aliasUsedAsNameValue_0.ts, 0, 10)) + +=== tests/cases/compiler/aliasUsedAsNameValue_1.ts === +export function b(a: any): any { return null; } +>b : Symbol(b, Decl(aliasUsedAsNameValue_1.ts, 0, 0)) +>a : Symbol(a, Decl(aliasUsedAsNameValue_1.ts, 0, 18)) + diff --git a/tests/baselines/reference/aliasUsedAsNameValue.types b/tests/baselines/reference/aliasUsedAsNameValue.types index b8d92f28496..9c519786c76 100644 --- a/tests/baselines/reference/aliasUsedAsNameValue.types +++ b/tests/baselines/reference/aliasUsedAsNameValue.types @@ -28,4 +28,5 @@ export var id: number; export function b(a: any): any { return null; } >b : (a: any) => any >a : any +>null : null diff --git a/tests/baselines/reference/ambientClassDeclarationWithExtends.symbols b/tests/baselines/reference/ambientClassDeclarationWithExtends.symbols new file mode 100644 index 00000000000..71d1e1a66d8 --- /dev/null +++ b/tests/baselines/reference/ambientClassDeclarationWithExtends.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/ambientClassDeclarationWithExtends.ts === +declare class A { } +>A : Symbol(A, Decl(ambientClassDeclarationWithExtends.ts, 0, 0)) + +declare class B extends A { } +>B : Symbol(B, Decl(ambientClassDeclarationWithExtends.ts, 0, 19)) +>A : Symbol(A, Decl(ambientClassDeclarationWithExtends.ts, 0, 0)) + diff --git a/tests/baselines/reference/ambientDeclarations.symbols b/tests/baselines/reference/ambientDeclarations.symbols new file mode 100644 index 00000000000..e5b85ae7c2c --- /dev/null +++ b/tests/baselines/reference/ambientDeclarations.symbols @@ -0,0 +1,167 @@ +=== tests/cases/conformance/ambient/ambientDeclarations.ts === +// Ambient variable without type annotation +declare var n; +>n : Symbol(n, Decl(ambientDeclarations.ts, 1, 11)) + +// Ambient variable with type annotation +declare var m: string; +>m : Symbol(m, Decl(ambientDeclarations.ts, 4, 11)) + +// Ambient function with no type annotations +declare function fn1(); +>fn1 : Symbol(fn1, Decl(ambientDeclarations.ts, 4, 22)) + +// Ambient function with type annotations +declare function fn2(n: string): number; +>fn2 : Symbol(fn2, Decl(ambientDeclarations.ts, 7, 23)) +>n : Symbol(n, Decl(ambientDeclarations.ts, 10, 21)) + +// Ambient function with valid overloads +declare function fn3(n: string): number; +>fn3 : Symbol(fn3, Decl(ambientDeclarations.ts, 10, 40)) +>n : Symbol(n, Decl(ambientDeclarations.ts, 13, 21)) + +declare function fn4(n: number, y: number): string; +>fn4 : Symbol(fn4, Decl(ambientDeclarations.ts, 13, 40)) +>n : Symbol(n, Decl(ambientDeclarations.ts, 14, 21)) +>y : Symbol(y, Decl(ambientDeclarations.ts, 14, 31)) + +// Ambient function with optional parameters +declare function fn5(x, y?); +>fn5 : Symbol(fn5, Decl(ambientDeclarations.ts, 14, 51)) +>x : Symbol(x, Decl(ambientDeclarations.ts, 17, 21)) +>y : Symbol(y, Decl(ambientDeclarations.ts, 17, 23)) + +declare function fn6(e?); +>fn6 : Symbol(fn6, Decl(ambientDeclarations.ts, 17, 28)) +>e : Symbol(e, Decl(ambientDeclarations.ts, 18, 21)) + +declare function fn7(x, y?, ...z); +>fn7 : Symbol(fn7, Decl(ambientDeclarations.ts, 18, 25)) +>x : Symbol(x, Decl(ambientDeclarations.ts, 19, 21)) +>y : Symbol(y, Decl(ambientDeclarations.ts, 19, 23)) +>z : Symbol(z, Decl(ambientDeclarations.ts, 19, 27)) + +declare function fn8(y?, ...z: number[]); +>fn8 : Symbol(fn8, Decl(ambientDeclarations.ts, 19, 34)) +>y : Symbol(y, Decl(ambientDeclarations.ts, 20, 21)) +>z : Symbol(z, Decl(ambientDeclarations.ts, 20, 24)) + +declare function fn9(...q: {}[]); +>fn9 : Symbol(fn9, Decl(ambientDeclarations.ts, 20, 41)) +>q : Symbol(q, Decl(ambientDeclarations.ts, 21, 21)) + +declare function fn10(...q: T[]); +>fn10 : Symbol(fn10, Decl(ambientDeclarations.ts, 21, 33)) +>T : Symbol(T, Decl(ambientDeclarations.ts, 22, 22)) +>q : Symbol(q, Decl(ambientDeclarations.ts, 22, 25)) +>T : Symbol(T, Decl(ambientDeclarations.ts, 22, 22)) + +// Ambient class +declare class cls { +>cls : Symbol(cls, Decl(ambientDeclarations.ts, 22, 36)) + + constructor(); + method(): cls; +>method : Symbol(method, Decl(ambientDeclarations.ts, 26, 18)) +>cls : Symbol(cls, Decl(ambientDeclarations.ts, 22, 36)) + + static static(p): number; +>static : Symbol(cls.static, Decl(ambientDeclarations.ts, 27, 18)) +>p : Symbol(p, Decl(ambientDeclarations.ts, 28, 18)) + + static q; +>q : Symbol(cls.q, Decl(ambientDeclarations.ts, 28, 29)) + + private fn(); +>fn : Symbol(fn, Decl(ambientDeclarations.ts, 29, 13)) + + private static fns(); +>fns : Symbol(cls.fns, Decl(ambientDeclarations.ts, 30, 17)) +} + +// Ambient enum +declare enum E1 { +>E1 : Symbol(E1, Decl(ambientDeclarations.ts, 32, 1)) + + x, +>x : Symbol(E1.x, Decl(ambientDeclarations.ts, 35, 17)) + + y, +>y : Symbol(E1.y, Decl(ambientDeclarations.ts, 36, 6)) + + z +>z : Symbol(E1.z, Decl(ambientDeclarations.ts, 37, 6)) +} + +// Ambient enum with integer literal initializer +declare enum E2 { +>E2 : Symbol(E2, Decl(ambientDeclarations.ts, 39, 1)) + + q, +>q : Symbol(E2.q, Decl(ambientDeclarations.ts, 42, 17)) + + a = 1, +>a : Symbol(E2.a, Decl(ambientDeclarations.ts, 43, 6)) + + b, +>b : Symbol(E2.b, Decl(ambientDeclarations.ts, 44, 10)) + + c = 2, +>c : Symbol(E2.c, Decl(ambientDeclarations.ts, 45, 6)) + + d +>d : Symbol(E2.d, Decl(ambientDeclarations.ts, 46, 10)) +} + +// Ambient enum members are always exported with or without export keyword +declare enum E3 { +>E3 : Symbol(E3, Decl(ambientDeclarations.ts, 48, 1), Decl(ambientDeclarations.ts, 53, 1)) + + A +>A : Symbol(E3.A, Decl(ambientDeclarations.ts, 51, 17)) +} +declare module E3 { +>E3 : Symbol(E3, Decl(ambientDeclarations.ts, 48, 1), Decl(ambientDeclarations.ts, 53, 1)) + + var B; +>B : Symbol(B, Decl(ambientDeclarations.ts, 55, 7)) +} +var x = E3.B; +>x : Symbol(x, Decl(ambientDeclarations.ts, 57, 3)) +>E3.B : Symbol(E3.B, Decl(ambientDeclarations.ts, 55, 7)) +>E3 : Symbol(E3, Decl(ambientDeclarations.ts, 48, 1), Decl(ambientDeclarations.ts, 53, 1)) +>B : Symbol(E3.B, Decl(ambientDeclarations.ts, 55, 7)) + +// Ambient module +declare module M1 { +>M1 : Symbol(M1, Decl(ambientDeclarations.ts, 57, 13)) + + var x; +>x : Symbol(x, Decl(ambientDeclarations.ts, 61, 7)) + + function fn(): number; +>fn : Symbol(fn, Decl(ambientDeclarations.ts, 61, 10)) +} + +// Ambient module members are always exported with or without export keyword +var p = M1.x; +>p : Symbol(p, Decl(ambientDeclarations.ts, 66, 3)) +>M1.x : Symbol(M1.x, Decl(ambientDeclarations.ts, 61, 7)) +>M1 : Symbol(M1, Decl(ambientDeclarations.ts, 57, 13)) +>x : Symbol(M1.x, Decl(ambientDeclarations.ts, 61, 7)) + +var q = M1.fn(); +>q : Symbol(q, Decl(ambientDeclarations.ts, 67, 3)) +>M1.fn : Symbol(M1.fn, Decl(ambientDeclarations.ts, 61, 10)) +>M1 : Symbol(M1, Decl(ambientDeclarations.ts, 57, 13)) +>fn : Symbol(M1.fn, Decl(ambientDeclarations.ts, 61, 10)) + +// Ambient external module in the global module +// Ambient external module with a string literal name that is a top level external module name +declare module 'external1' { + var q; +>q : Symbol(q, Decl(ambientDeclarations.ts, 72, 7)) +} + + diff --git a/tests/baselines/reference/ambientDeclarations.types b/tests/baselines/reference/ambientDeclarations.types index 38814405521..f44d49cfc57 100644 --- a/tests/baselines/reference/ambientDeclarations.types +++ b/tests/baselines/reference/ambientDeclarations.types @@ -103,12 +103,14 @@ declare enum E2 { a = 1, >a : E2 +>1 : number b, >b : E2 c = 2, >c : E2 +>2 : number d >d : E2 diff --git a/tests/baselines/reference/ambientEnumElementInitializer1.symbols b/tests/baselines/reference/ambientEnumElementInitializer1.symbols new file mode 100644 index 00000000000..84eb56abcbc --- /dev/null +++ b/tests/baselines/reference/ambientEnumElementInitializer1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/ambientEnumElementInitializer1.ts === +declare enum E { +>E : Symbol(E, Decl(ambientEnumElementInitializer1.ts, 0, 0)) + + e = 3 +>e : Symbol(E.e, Decl(ambientEnumElementInitializer1.ts, 0, 16)) +} diff --git a/tests/baselines/reference/ambientEnumElementInitializer1.types b/tests/baselines/reference/ambientEnumElementInitializer1.types index da80015cbd5..97db9f199d3 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer1.types +++ b/tests/baselines/reference/ambientEnumElementInitializer1.types @@ -4,4 +4,5 @@ declare enum E { e = 3 >e : E +>3 : number } diff --git a/tests/baselines/reference/ambientEnumElementInitializer2.symbols b/tests/baselines/reference/ambientEnumElementInitializer2.symbols new file mode 100644 index 00000000000..04939d33896 --- /dev/null +++ b/tests/baselines/reference/ambientEnumElementInitializer2.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/ambientEnumElementInitializer2.ts === +declare enum E { +>E : Symbol(E, Decl(ambientEnumElementInitializer2.ts, 0, 0)) + + e = -3 // Negative +>e : Symbol(E.e, Decl(ambientEnumElementInitializer2.ts, 0, 16)) +} diff --git a/tests/baselines/reference/ambientEnumElementInitializer2.types b/tests/baselines/reference/ambientEnumElementInitializer2.types index cb1414630b9..7217bc8e6fd 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer2.types +++ b/tests/baselines/reference/ambientEnumElementInitializer2.types @@ -5,4 +5,5 @@ declare enum E { e = -3 // Negative >e : E >-3 : number +>3 : number } diff --git a/tests/baselines/reference/ambientEnumElementInitializer4.symbols b/tests/baselines/reference/ambientEnumElementInitializer4.symbols new file mode 100644 index 00000000000..de17c6702bb --- /dev/null +++ b/tests/baselines/reference/ambientEnumElementInitializer4.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/ambientEnumElementInitializer4.ts === +declare enum E { +>E : Symbol(E, Decl(ambientEnumElementInitializer4.ts, 0, 0)) + + e = 0xA +>e : Symbol(E.e, Decl(ambientEnumElementInitializer4.ts, 0, 16)) +} diff --git a/tests/baselines/reference/ambientEnumElementInitializer4.types b/tests/baselines/reference/ambientEnumElementInitializer4.types index 566c03103a1..b85649d654d 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer4.types +++ b/tests/baselines/reference/ambientEnumElementInitializer4.types @@ -4,4 +4,5 @@ declare enum E { e = 0xA >e : E +>0xA : number } diff --git a/tests/baselines/reference/ambientEnumElementInitializer5.symbols b/tests/baselines/reference/ambientEnumElementInitializer5.symbols new file mode 100644 index 00000000000..9c58db811f4 --- /dev/null +++ b/tests/baselines/reference/ambientEnumElementInitializer5.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/ambientEnumElementInitializer5.ts === +declare enum E { +>E : Symbol(E, Decl(ambientEnumElementInitializer5.ts, 0, 0)) + + e = -0xA +>e : Symbol(E.e, Decl(ambientEnumElementInitializer5.ts, 0, 16)) +} diff --git a/tests/baselines/reference/ambientEnumElementInitializer5.types b/tests/baselines/reference/ambientEnumElementInitializer5.types index 3b6198f0e24..1c5ea0ecdd3 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer5.types +++ b/tests/baselines/reference/ambientEnumElementInitializer5.types @@ -5,4 +5,5 @@ declare enum E { e = -0xA >e : E >-0xA : number +>0xA : number } diff --git a/tests/baselines/reference/ambientEnumElementInitializer6.symbols b/tests/baselines/reference/ambientEnumElementInitializer6.symbols new file mode 100644 index 00000000000..3b0b6283ec9 --- /dev/null +++ b/tests/baselines/reference/ambientEnumElementInitializer6.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/ambientEnumElementInitializer6.ts === +declare module M { +>M : Symbol(M, Decl(ambientEnumElementInitializer6.ts, 0, 0)) + + enum E { +>E : Symbol(E, Decl(ambientEnumElementInitializer6.ts, 0, 18)) + + e = 3 +>e : Symbol(E.e, Decl(ambientEnumElementInitializer6.ts, 1, 12)) + } +} diff --git a/tests/baselines/reference/ambientEnumElementInitializer6.types b/tests/baselines/reference/ambientEnumElementInitializer6.types index 3a38fd6912d..015d3f4e146 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer6.types +++ b/tests/baselines/reference/ambientEnumElementInitializer6.types @@ -7,5 +7,6 @@ declare module M { e = 3 >e : E +>3 : number } } diff --git a/tests/baselines/reference/ambientExternalModuleMerging.symbols b/tests/baselines/reference/ambientExternalModuleMerging.symbols new file mode 100644 index 00000000000..7fea7fea89f --- /dev/null +++ b/tests/baselines/reference/ambientExternalModuleMerging.symbols @@ -0,0 +1,28 @@ +=== tests/cases/conformance/ambient/ambientExternalModuleMerging_use.ts === +import M = require("M"); +>M : Symbol(M, Decl(ambientExternalModuleMerging_use.ts, 0, 0)) + +// Should be strings +var x = M.x; +>x : Symbol(x, Decl(ambientExternalModuleMerging_use.ts, 2, 3)) +>M.x : Symbol(M.x, Decl(ambientExternalModuleMerging_declare.ts, 1, 14)) +>M : Symbol(M, Decl(ambientExternalModuleMerging_use.ts, 0, 0)) +>x : Symbol(M.x, Decl(ambientExternalModuleMerging_declare.ts, 1, 14)) + +var y = M.y; +>y : Symbol(y, Decl(ambientExternalModuleMerging_use.ts, 3, 3)) +>M.y : Symbol(M.y, Decl(ambientExternalModuleMerging_declare.ts, 6, 14)) +>M : Symbol(M, Decl(ambientExternalModuleMerging_use.ts, 0, 0)) +>y : Symbol(M.y, Decl(ambientExternalModuleMerging_declare.ts, 6, 14)) + +=== tests/cases/conformance/ambient/ambientExternalModuleMerging_declare.ts === +declare module "M" { + export var x: string; +>x : Symbol(x, Decl(ambientExternalModuleMerging_declare.ts, 1, 14)) +} + +// Merge +declare module "M" { + export var y: string; +>y : Symbol(y, Decl(ambientExternalModuleMerging_declare.ts, 6, 14)) +} diff --git a/tests/baselines/reference/ambientExternalModuleReopen.symbols b/tests/baselines/reference/ambientExternalModuleReopen.symbols new file mode 100644 index 00000000000..a2a1ba72fab --- /dev/null +++ b/tests/baselines/reference/ambientExternalModuleReopen.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/ambientExternalModuleReopen.ts === +declare module "fs" { + var x: string; +>x : Symbol(x, Decl(ambientExternalModuleReopen.ts, 1, 7)) +} +declare module 'fs' { + var y: number; +>y : Symbol(y, Decl(ambientExternalModuleReopen.ts, 4, 7)) +} diff --git a/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.symbols b/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.symbols new file mode 100644 index 00000000000..3af41f90957 --- /dev/null +++ b/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/ambientExternalModuleWithInternalImportDeclaration_1.ts === +/// +import A = require('M'); +>A : Symbol(A, Decl(ambientExternalModuleWithInternalImportDeclaration_1.ts, 0, 0)) + +var c = new A(); +>c : Symbol(c, Decl(ambientExternalModuleWithInternalImportDeclaration_1.ts, 2, 3)) +>A : Symbol(A, Decl(ambientExternalModuleWithInternalImportDeclaration_1.ts, 0, 0)) + +=== tests/cases/compiler/ambientExternalModuleWithInternalImportDeclaration_0.ts === +declare module 'M' { + module C { +>C : Symbol(C, Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 0, 20), Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 3, 5)) + + export var f: number; +>f : Symbol(f, Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 2, 18)) + } + class C { +>C : Symbol(C, Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 0, 20), Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 3, 5)) + + foo(): void; +>foo : Symbol(foo, Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 4, 13)) + } + import X = C; +>X : Symbol(X, Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 6, 5)) +>C : Symbol(C, Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 0, 20), Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 3, 5)) + + export = X; +>X : Symbol(X, Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 6, 5)) + +} + diff --git a/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.symbols b/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.symbols new file mode 100644 index 00000000000..baf15f22a4a --- /dev/null +++ b/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/ambientExternalModuleWithoutInternalImportDeclaration_1.ts === +/// +import A = require('M'); +>A : Symbol(A, Decl(ambientExternalModuleWithoutInternalImportDeclaration_1.ts, 0, 0)) + +var c = new A(); +>c : Symbol(c, Decl(ambientExternalModuleWithoutInternalImportDeclaration_1.ts, 2, 3)) +>A : Symbol(A, Decl(ambientExternalModuleWithoutInternalImportDeclaration_1.ts, 0, 0)) + +=== tests/cases/compiler/ambientExternalModuleWithoutInternalImportDeclaration_0.ts === +declare module 'M' { + module C { +>C : Symbol(C, Decl(ambientExternalModuleWithoutInternalImportDeclaration_0.ts, 0, 20), Decl(ambientExternalModuleWithoutInternalImportDeclaration_0.ts, 3, 5)) + + export var f: number; +>f : Symbol(f, Decl(ambientExternalModuleWithoutInternalImportDeclaration_0.ts, 2, 18)) + } + class C { +>C : Symbol(C, Decl(ambientExternalModuleWithoutInternalImportDeclaration_0.ts, 0, 20), Decl(ambientExternalModuleWithoutInternalImportDeclaration_0.ts, 3, 5)) + + foo(): void; +>foo : Symbol(foo, Decl(ambientExternalModuleWithoutInternalImportDeclaration_0.ts, 4, 13)) + } + export = C; +>C : Symbol(C, Decl(ambientExternalModuleWithoutInternalImportDeclaration_0.ts, 0, 20), Decl(ambientExternalModuleWithoutInternalImportDeclaration_0.ts, 3, 5)) + +} + diff --git a/tests/baselines/reference/ambientFundule.symbols b/tests/baselines/reference/ambientFundule.symbols new file mode 100644 index 00000000000..e7e2c5a4a4d --- /dev/null +++ b/tests/baselines/reference/ambientFundule.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/ambientFundule.ts === +declare function f(); +>f : Symbol(f, Decl(ambientFundule.ts, 0, 0), Decl(ambientFundule.ts, 0, 21), Decl(ambientFundule.ts, 1, 26)) + +declare module f { var x } +>f : Symbol(f, Decl(ambientFundule.ts, 0, 0), Decl(ambientFundule.ts, 0, 21), Decl(ambientFundule.ts, 1, 26)) +>x : Symbol(x, Decl(ambientFundule.ts, 1, 22)) + +declare function f(x); +>f : Symbol(f, Decl(ambientFundule.ts, 0, 0), Decl(ambientFundule.ts, 0, 21), Decl(ambientFundule.ts, 1, 26)) +>x : Symbol(x, Decl(ambientFundule.ts, 2, 19)) + diff --git a/tests/baselines/reference/ambientInsideNonAmbient.symbols b/tests/baselines/reference/ambientInsideNonAmbient.symbols new file mode 100644 index 00000000000..5a668ca9e43 --- /dev/null +++ b/tests/baselines/reference/ambientInsideNonAmbient.symbols @@ -0,0 +1,38 @@ +=== tests/cases/conformance/ambient/ambientInsideNonAmbient.ts === +module M { +>M : Symbol(M, Decl(ambientInsideNonAmbient.ts, 0, 0)) + + export declare var x; +>x : Symbol(x, Decl(ambientInsideNonAmbient.ts, 1, 22)) + + export declare function f(); +>f : Symbol(f, Decl(ambientInsideNonAmbient.ts, 1, 25)) + + export declare class C { } +>C : Symbol(C, Decl(ambientInsideNonAmbient.ts, 2, 32)) + + export declare enum E { } +>E : Symbol(E, Decl(ambientInsideNonAmbient.ts, 3, 30)) + + export declare module M { } +>M : Symbol(M, Decl(ambientInsideNonAmbient.ts, 4, 29)) +} + +module M2 { +>M2 : Symbol(M2, Decl(ambientInsideNonAmbient.ts, 6, 1)) + + declare var x; +>x : Symbol(x, Decl(ambientInsideNonAmbient.ts, 9, 15)) + + declare function f(); +>f : Symbol(f, Decl(ambientInsideNonAmbient.ts, 9, 18)) + + declare class C { } +>C : Symbol(C, Decl(ambientInsideNonAmbient.ts, 10, 25)) + + declare enum E { } +>E : Symbol(E, Decl(ambientInsideNonAmbient.ts, 11, 23)) + + declare module M { } +>M : Symbol(M, Decl(ambientInsideNonAmbient.ts, 12, 22)) +} diff --git a/tests/baselines/reference/ambientInsideNonAmbient.types b/tests/baselines/reference/ambientInsideNonAmbient.types index ee654aee333..ae593ab4225 100644 --- a/tests/baselines/reference/ambientInsideNonAmbient.types +++ b/tests/baselines/reference/ambientInsideNonAmbient.types @@ -15,7 +15,7 @@ module M { >E : E export declare module M { } ->M : unknown +>M : any } module M2 { @@ -34,5 +34,5 @@ module M2 { >E : E declare module M { } ->M : unknown +>M : any } diff --git a/tests/baselines/reference/ambientInsideNonAmbientExternalModule.symbols b/tests/baselines/reference/ambientInsideNonAmbientExternalModule.symbols new file mode 100644 index 00000000000..268aeab9171 --- /dev/null +++ b/tests/baselines/reference/ambientInsideNonAmbientExternalModule.symbols @@ -0,0 +1,16 @@ +=== tests/cases/conformance/ambient/ambientInsideNonAmbientExternalModule.ts === +export declare var x; +>x : Symbol(x, Decl(ambientInsideNonAmbientExternalModule.ts, 0, 18)) + +export declare function f(); +>f : Symbol(f, Decl(ambientInsideNonAmbientExternalModule.ts, 0, 21)) + +export declare class C { } +>C : Symbol(C, Decl(ambientInsideNonAmbientExternalModule.ts, 1, 28)) + +export declare enum E { } +>E : Symbol(E, Decl(ambientInsideNonAmbientExternalModule.ts, 2, 26)) + +export declare module M { } +>M : Symbol(M, Decl(ambientInsideNonAmbientExternalModule.ts, 3, 25)) + diff --git a/tests/baselines/reference/ambientInsideNonAmbientExternalModule.types b/tests/baselines/reference/ambientInsideNonAmbientExternalModule.types index bda7a61a7f3..a8fb61f4280 100644 --- a/tests/baselines/reference/ambientInsideNonAmbientExternalModule.types +++ b/tests/baselines/reference/ambientInsideNonAmbientExternalModule.types @@ -12,5 +12,5 @@ export declare enum E { } >E : E export declare module M { } ->M : unknown +>M : any diff --git a/tests/baselines/reference/ambientModuleExports.symbols b/tests/baselines/reference/ambientModuleExports.symbols new file mode 100644 index 00000000000..6af5b669cc9 --- /dev/null +++ b/tests/baselines/reference/ambientModuleExports.symbols @@ -0,0 +1,59 @@ +=== tests/cases/compiler/ambientModuleExports.ts === +declare module Foo { +>Foo : Symbol(Foo, Decl(ambientModuleExports.ts, 0, 0)) + + function a():void; +>a : Symbol(a, Decl(ambientModuleExports.ts, 0, 20)) + + var b:number; +>b : Symbol(b, Decl(ambientModuleExports.ts, 2, 4)) + + class C {} +>C : Symbol(C, Decl(ambientModuleExports.ts, 2, 14)) +} + +Foo.a(); +>Foo.a : Symbol(Foo.a, Decl(ambientModuleExports.ts, 0, 20)) +>Foo : Symbol(Foo, Decl(ambientModuleExports.ts, 0, 0)) +>a : Symbol(Foo.a, Decl(ambientModuleExports.ts, 0, 20)) + +Foo.b; +>Foo.b : Symbol(Foo.b, Decl(ambientModuleExports.ts, 2, 4)) +>Foo : Symbol(Foo, Decl(ambientModuleExports.ts, 0, 0)) +>b : Symbol(Foo.b, Decl(ambientModuleExports.ts, 2, 4)) + +var c = new Foo.C(); +>c : Symbol(c, Decl(ambientModuleExports.ts, 8, 3)) +>Foo.C : Symbol(Foo.C, Decl(ambientModuleExports.ts, 2, 14)) +>Foo : Symbol(Foo, Decl(ambientModuleExports.ts, 0, 0)) +>C : Symbol(Foo.C, Decl(ambientModuleExports.ts, 2, 14)) + +declare module Foo2 { +>Foo2 : Symbol(Foo2, Decl(ambientModuleExports.ts, 8, 20)) + + export function a(): void; +>a : Symbol(a, Decl(ambientModuleExports.ts, 10, 21)) + + export var b: number; +>b : Symbol(b, Decl(ambientModuleExports.ts, 12, 14)) + + export class C { } +>C : Symbol(C, Decl(ambientModuleExports.ts, 12, 25)) +} + +Foo2.a(); +>Foo2.a : Symbol(Foo2.a, Decl(ambientModuleExports.ts, 10, 21)) +>Foo2 : Symbol(Foo2, Decl(ambientModuleExports.ts, 8, 20)) +>a : Symbol(Foo2.a, Decl(ambientModuleExports.ts, 10, 21)) + +Foo2.b; +>Foo2.b : Symbol(Foo2.b, Decl(ambientModuleExports.ts, 12, 14)) +>Foo2 : Symbol(Foo2, Decl(ambientModuleExports.ts, 8, 20)) +>b : Symbol(Foo2.b, Decl(ambientModuleExports.ts, 12, 14)) + +var c2 = new Foo2.C(); +>c2 : Symbol(c2, Decl(ambientModuleExports.ts, 18, 3)) +>Foo2.C : Symbol(Foo2.C, Decl(ambientModuleExports.ts, 12, 25)) +>Foo2 : Symbol(Foo2, Decl(ambientModuleExports.ts, 8, 20)) +>C : Symbol(Foo2.C, Decl(ambientModuleExports.ts, 12, 25)) + diff --git a/tests/baselines/reference/ambientModuleWithClassDeclarationWithExtends.symbols b/tests/baselines/reference/ambientModuleWithClassDeclarationWithExtends.symbols new file mode 100644 index 00000000000..f24d3a102d5 --- /dev/null +++ b/tests/baselines/reference/ambientModuleWithClassDeclarationWithExtends.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/ambientModuleWithClassDeclarationWithExtends.ts === +declare module foo { +>foo : Symbol(foo, Decl(ambientModuleWithClassDeclarationWithExtends.ts, 0, 0)) + + class A { } +>A : Symbol(A, Decl(ambientModuleWithClassDeclarationWithExtends.ts, 0, 20)) + + class B extends A { } +>B : Symbol(B, Decl(ambientModuleWithClassDeclarationWithExtends.ts, 1, 15)) +>A : Symbol(A, Decl(ambientModuleWithClassDeclarationWithExtends.ts, 0, 20)) +} diff --git a/tests/baselines/reference/ambientModules.symbols b/tests/baselines/reference/ambientModules.symbols new file mode 100644 index 00000000000..776e36fa933 --- /dev/null +++ b/tests/baselines/reference/ambientModules.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/ambientModules.ts === +declare module Foo.Bar { export var foo; }; +>Foo : Symbol(Foo, Decl(ambientModules.ts, 0, 0)) +>Bar : Symbol(Bar, Decl(ambientModules.ts, 0, 19)) +>foo : Symbol(foo, Decl(ambientModules.ts, 0, 35)) + +Foo.Bar.foo = 5; +>Foo.Bar.foo : Symbol(Foo.Bar.foo, Decl(ambientModules.ts, 0, 35)) +>Foo.Bar : Symbol(Foo.Bar, Decl(ambientModules.ts, 0, 19)) +>Foo : Symbol(Foo, Decl(ambientModules.ts, 0, 0)) +>Bar : Symbol(Foo.Bar, Decl(ambientModules.ts, 0, 19)) +>foo : Symbol(Foo.Bar.foo, Decl(ambientModules.ts, 0, 35)) + diff --git a/tests/baselines/reference/ambientModules.types b/tests/baselines/reference/ambientModules.types index fe0aceef810..15e6d51b457 100644 --- a/tests/baselines/reference/ambientModules.types +++ b/tests/baselines/reference/ambientModules.types @@ -11,4 +11,5 @@ Foo.Bar.foo = 5; >Foo : typeof Foo >Bar : typeof Foo.Bar >foo : any +>5 : number diff --git a/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.symbols b/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.symbols new file mode 100644 index 00000000000..5d6c34f4d68 --- /dev/null +++ b/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.symbols @@ -0,0 +1,76 @@ +=== tests/cases/compiler/ambiguousCallsWhereReturnTypesAgree.ts === +class TestClass { +>TestClass : Symbol(TestClass, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 0, 0)) + + public bar(x: string): void; +>bar : Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 0, 17), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 1, 32), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 2, 34)) +>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 1, 15)) + + public bar(x: string[]): void; +>bar : Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 0, 17), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 1, 32), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 2, 34)) +>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 2, 15)) + + public bar(x: any): void { +>bar : Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 0, 17), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 1, 32), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 2, 34)) +>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 3, 15)) + + } + + public foo(x: string): void; +>foo : Symbol(foo, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 5, 5), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 7, 32), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 8, 34)) +>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 7, 15)) + + public foo(x: string[]): void; +>foo : Symbol(foo, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 5, 5), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 7, 32), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 8, 34)) +>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 8, 15)) + + public foo(x: any): void { +>foo : Symbol(foo, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 5, 5), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 7, 32), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 8, 34)) +>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 9, 15)) + + this.bar(x); // should not error +>this.bar : Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 0, 17), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 1, 32), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 2, 34)) +>this : Symbol(TestClass, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 0, 0)) +>bar : Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 0, 17), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 1, 32), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 2, 34)) +>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 9, 15)) + } +} + +class TestClass2 { +>TestClass2 : Symbol(TestClass2, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 12, 1)) + + public bar(x: string): number; +>bar : Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 14, 18), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 15, 34), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 16, 36)) +>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 15, 15)) + + public bar(x: string[]): number; +>bar : Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 14, 18), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 15, 34), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 16, 36)) +>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 16, 15)) + + public bar(x: any): number { +>bar : Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 14, 18), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 15, 34), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 16, 36)) +>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 17, 15)) + + return 0; + } + + public foo(x: string): number; +>foo : Symbol(foo, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 19, 5), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 21, 34), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 22, 36)) +>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 21, 15)) + + public foo(x: string[]): number; +>foo : Symbol(foo, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 19, 5), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 21, 34), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 22, 36)) +>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 22, 15)) + + public foo(x: any): number { +>foo : Symbol(foo, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 19, 5), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 21, 34), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 22, 36)) +>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 23, 15)) + + return this.bar(x); // should not error +>this.bar : Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 14, 18), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 15, 34), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 16, 36)) +>this : Symbol(TestClass2, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 12, 1)) +>bar : Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 14, 18), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 15, 34), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 16, 36)) +>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 23, 15)) + } +} + diff --git a/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.types b/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.types index 4e508ba2df5..d4df0f75d16 100644 --- a/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.types +++ b/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.types @@ -53,6 +53,7 @@ class TestClass2 { >x : any return 0; +>0 : number } public foo(x: string): number; diff --git a/tests/baselines/reference/ambiguousOverloadResolution.symbols b/tests/baselines/reference/ambiguousOverloadResolution.symbols new file mode 100644 index 00000000000..1d848d707de --- /dev/null +++ b/tests/baselines/reference/ambiguousOverloadResolution.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/ambiguousOverloadResolution.ts === +class A { } +>A : Symbol(A, Decl(ambiguousOverloadResolution.ts, 0, 0)) + +class B extends A { x: number; } +>B : Symbol(B, Decl(ambiguousOverloadResolution.ts, 0, 11)) +>A : Symbol(A, Decl(ambiguousOverloadResolution.ts, 0, 0)) +>x : Symbol(x, Decl(ambiguousOverloadResolution.ts, 1, 19)) + +declare function f(p: A, q: B): number; +>f : Symbol(f, Decl(ambiguousOverloadResolution.ts, 1, 32), Decl(ambiguousOverloadResolution.ts, 3, 39)) +>p : Symbol(p, Decl(ambiguousOverloadResolution.ts, 3, 19)) +>A : Symbol(A, Decl(ambiguousOverloadResolution.ts, 0, 0)) +>q : Symbol(q, Decl(ambiguousOverloadResolution.ts, 3, 24)) +>B : Symbol(B, Decl(ambiguousOverloadResolution.ts, 0, 11)) + +declare function f(p: B, q: A): string; +>f : Symbol(f, Decl(ambiguousOverloadResolution.ts, 1, 32), Decl(ambiguousOverloadResolution.ts, 3, 39)) +>p : Symbol(p, Decl(ambiguousOverloadResolution.ts, 4, 19)) +>B : Symbol(B, Decl(ambiguousOverloadResolution.ts, 0, 11)) +>q : Symbol(q, Decl(ambiguousOverloadResolution.ts, 4, 24)) +>A : Symbol(A, Decl(ambiguousOverloadResolution.ts, 0, 0)) + +var x: B; +>x : Symbol(x, Decl(ambiguousOverloadResolution.ts, 6, 3)) +>B : Symbol(B, Decl(ambiguousOverloadResolution.ts, 0, 11)) + +var t: number = f(x, x); // Not an error +>t : Symbol(t, Decl(ambiguousOverloadResolution.ts, 7, 3)) +>f : Symbol(f, Decl(ambiguousOverloadResolution.ts, 1, 32), Decl(ambiguousOverloadResolution.ts, 3, 39)) +>x : Symbol(x, Decl(ambiguousOverloadResolution.ts, 6, 3)) +>x : Symbol(x, Decl(ambiguousOverloadResolution.ts, 6, 3)) + diff --git a/tests/baselines/reference/amdDependencyCommentName2.js b/tests/baselines/reference/amdDependencyCommentName2.js index 4f54c548580..6f9f1f268e8 100644 --- a/tests/baselines/reference/amdDependencyCommentName2.js +++ b/tests/baselines/reference/amdDependencyCommentName2.js @@ -6,6 +6,6 @@ m1.f(); //// [amdDependencyCommentName2.js] /// -define(["require", "exports", "m2", "bar"], function (require, exports, m1, b) { +define(["require", "exports", "bar", "m2"], function (require, exports, b, m1) { m1.f(); }); diff --git a/tests/baselines/reference/amdDependencyCommentName3.js b/tests/baselines/reference/amdDependencyCommentName3.js index ca6b1280585..2b74dc23aed 100644 --- a/tests/baselines/reference/amdDependencyCommentName3.js +++ b/tests/baselines/reference/amdDependencyCommentName3.js @@ -10,6 +10,6 @@ m1.f(); /// /// /// -define(["require", "exports", "m2", "bar", "goo", "foo"], function (require, exports, m1, b, c) { +define(["require", "exports", "bar", "goo", "m2", "foo"], function (require, exports, b, c, m1) { m1.f(); }); diff --git a/tests/baselines/reference/amdDependencyCommentName4.errors.txt b/tests/baselines/reference/amdDependencyCommentName4.errors.txt new file mode 100644 index 00000000000..6b32830e51c --- /dev/null +++ b/tests/baselines/reference/amdDependencyCommentName4.errors.txt @@ -0,0 +1,35 @@ +tests/cases/compiler/amdDependencyCommentName4.ts(8,21): error TS2307: Cannot find external module 'aliasedModule1'. +tests/cases/compiler/amdDependencyCommentName4.ts(11,26): error TS2307: Cannot find external module 'aliasedModule2'. +tests/cases/compiler/amdDependencyCommentName4.ts(14,15): error TS2307: Cannot find external module 'aliasedModule3'. +tests/cases/compiler/amdDependencyCommentName4.ts(17,21): error TS2307: Cannot find external module 'aliasedModule4'. + + +==== tests/cases/compiler/amdDependencyCommentName4.ts (4 errors) ==== + /// + /// + /// + /// + + import "unaliasedModule1"; + + import r1 = require("aliasedModule1"); + ~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find external module 'aliasedModule1'. + r1; + + import {p1, p2, p3} from "aliasedModule2"; + ~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find external module 'aliasedModule2'. + p1; + + import d from "aliasedModule3"; + ~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find external module 'aliasedModule3'. + d; + + import * as ns from "aliasedModule4"; + ~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find external module 'aliasedModule4'. + ns; + + import "unaliasedModule2"; \ No newline at end of file diff --git a/tests/baselines/reference/amdDependencyCommentName4.js b/tests/baselines/reference/amdDependencyCommentName4.js new file mode 100644 index 00000000000..636d2804257 --- /dev/null +++ b/tests/baselines/reference/amdDependencyCommentName4.js @@ -0,0 +1,33 @@ +//// [amdDependencyCommentName4.ts] +/// +/// +/// +/// + +import "unaliasedModule1"; + +import r1 = require("aliasedModule1"); +r1; + +import {p1, p2, p3} from "aliasedModule2"; +p1; + +import d from "aliasedModule3"; +d; + +import * as ns from "aliasedModule4"; +ns; + +import "unaliasedModule2"; + +//// [amdDependencyCommentName4.js] +/// +/// +/// +/// +define(["require", "exports", "aliasedModule5", "aliasedModule6", "aliasedModule1", "aliasedModule2", "aliasedModule3", "aliasedModule4", "unaliasedModule3", "unaliasedModule4", "unaliasedModule1", "unaliasedModule2"], function (require, exports, n1, n2, r1, aliasedModule2_1, aliasedModule3_1, ns) { + r1; + aliasedModule2_1.p1; + aliasedModule3_1["default"]; + ns; +}); diff --git a/tests/baselines/reference/amdImportAsPrimaryExpression.symbols b/tests/baselines/reference/amdImportAsPrimaryExpression.symbols new file mode 100644 index 00000000000..9ab71defd86 --- /dev/null +++ b/tests/baselines/reference/amdImportAsPrimaryExpression.symbols @@ -0,0 +1,24 @@ +=== tests/cases/conformance/externalModules/foo_1.ts === +import foo = require("./foo_0"); +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) + +if(foo.E1.A === 0){ +>foo.E1.A : Symbol(foo.E1.A, Decl(foo_0.ts, 0, 16)) +>foo.E1 : Symbol(foo.E1, Decl(foo_0.ts, 0, 0)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>E1 : Symbol(foo.E1, Decl(foo_0.ts, 0, 0)) +>A : Symbol(foo.E1.A, Decl(foo_0.ts, 0, 16)) + + // Should cause runtime import - interesting optimization possibility, as gets inlined to 0. +} + +=== tests/cases/conformance/externalModules/foo_0.ts === +export enum E1 { +>E1 : Symbol(E1, Decl(foo_0.ts, 0, 0)) + + A,B,C +>A : Symbol(E1.A, Decl(foo_0.ts, 0, 16)) +>B : Symbol(E1.B, Decl(foo_0.ts, 1, 3)) +>C : Symbol(E1.C, Decl(foo_0.ts, 1, 5)) +} + diff --git a/tests/baselines/reference/amdImportAsPrimaryExpression.types b/tests/baselines/reference/amdImportAsPrimaryExpression.types index f88bc9a1ffe..eab0b168f44 100644 --- a/tests/baselines/reference/amdImportAsPrimaryExpression.types +++ b/tests/baselines/reference/amdImportAsPrimaryExpression.types @@ -9,6 +9,7 @@ if(foo.E1.A === 0){ >foo : typeof foo >E1 : typeof foo.E1 >A : foo.E1 +>0 : number // Should cause runtime import - interesting optimization possibility, as gets inlined to 0. } diff --git a/tests/baselines/reference/amdImportNotAsPrimaryExpression.symbols b/tests/baselines/reference/amdImportNotAsPrimaryExpression.symbols new file mode 100644 index 00000000000..68a852c6165 --- /dev/null +++ b/tests/baselines/reference/amdImportNotAsPrimaryExpression.symbols @@ -0,0 +1,81 @@ +=== tests/cases/conformance/externalModules/foo_1.ts === +import foo = require("./foo_0"); +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) + +// None of the below should cause a runtime dependency on foo_0 +import f = foo.M1; +>f : Symbol(f, Decl(foo_1.ts, 0, 32)) +>foo : Symbol(foo, Decl(foo_0.ts, 0, 0)) +>M1 : Symbol(foo.M1, Decl(foo_0.ts, 8, 1)) + +var i: f.I2; +>i : Symbol(i, Decl(foo_1.ts, 3, 3)) +>f : Symbol(f, Decl(foo_1.ts, 0, 32)) +>I2 : Symbol(f.I2, Decl(foo_0.ts, 10, 18)) + +var x: foo.C1 = <{m1: number}>{}; +>x : Symbol(x, Decl(foo_1.ts, 4, 3)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>C1 : Symbol(foo.C1, Decl(foo_0.ts, 0, 0)) +>m1 : Symbol(m1, Decl(foo_1.ts, 4, 18)) + +var y: typeof foo.C1.s1 = false; +>y : Symbol(y, Decl(foo_1.ts, 5, 3)) +>foo.C1.s1 : Symbol(foo.C1.s1, Decl(foo_0.ts, 1, 9)) +>foo.C1 : Symbol(foo.C1, Decl(foo_0.ts, 0, 0)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>C1 : Symbol(foo.C1, Decl(foo_0.ts, 0, 0)) +>s1 : Symbol(foo.C1.s1, Decl(foo_0.ts, 1, 9)) + +var z: foo.M1.I2; +>z : Symbol(z, Decl(foo_1.ts, 6, 3)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>M1 : Symbol(foo.M1, Decl(foo_0.ts, 8, 1)) +>I2 : Symbol(f.I2, Decl(foo_0.ts, 10, 18)) + +var e: number = 0; +>e : Symbol(e, Decl(foo_1.ts, 7, 3)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>E1 : Symbol(foo.E1, Decl(foo_0.ts, 14, 1)) + +=== tests/cases/conformance/externalModules/foo_0.ts === +export class C1 { +>C1 : Symbol(C1, Decl(foo_0.ts, 0, 0)) + + m1 = 42; +>m1 : Symbol(m1, Decl(foo_0.ts, 0, 17)) + + static s1 = true; +>s1 : Symbol(C1.s1, Decl(foo_0.ts, 1, 9)) +} + +export interface I1 { +>I1 : Symbol(I1, Decl(foo_0.ts, 3, 1)) + + name: string; +>name : Symbol(name, Decl(foo_0.ts, 5, 21)) + + age: number; +>age : Symbol(age, Decl(foo_0.ts, 6, 14)) +} + +export module M1 { +>M1 : Symbol(M1, Decl(foo_0.ts, 8, 1)) + + export interface I2 { +>I2 : Symbol(I2, Decl(foo_0.ts, 10, 18)) + + foo: string; +>foo : Symbol(foo, Decl(foo_0.ts, 11, 22)) + } +} + +export enum E1 { +>E1 : Symbol(E1, Decl(foo_0.ts, 14, 1)) + + A,B,C +>A : Symbol(E1.A, Decl(foo_0.ts, 16, 16)) +>B : Symbol(E1.B, Decl(foo_0.ts, 17, 3)) +>C : Symbol(E1.C, Decl(foo_0.ts, 17, 5)) +} + diff --git a/tests/baselines/reference/amdImportNotAsPrimaryExpression.types b/tests/baselines/reference/amdImportNotAsPrimaryExpression.types index bde0cb02b1e..6c3978d93aa 100644 --- a/tests/baselines/reference/amdImportNotAsPrimaryExpression.types +++ b/tests/baselines/reference/amdImportNotAsPrimaryExpression.types @@ -4,18 +4,18 @@ import foo = require("./foo_0"); // None of the below should cause a runtime dependency on foo_0 import f = foo.M1; ->f : unknown +>f : any >foo : typeof foo ->M1 : unknown +>M1 : any var i: f.I2; >i : f.I2 ->f : unknown +>f : any >I2 : f.I2 var x: foo.C1 = <{m1: number}>{}; >x : foo.C1 ->foo : unknown +>foo : any >C1 : foo.C1 ><{m1: number}>{} : { m1: number; } >m1 : number @@ -23,21 +23,25 @@ var x: foo.C1 = <{m1: number}>{}; var y: typeof foo.C1.s1 = false; >y : boolean +>foo.C1.s1 : boolean +>foo.C1 : typeof foo.C1 >foo : typeof foo >C1 : typeof foo.C1 >s1 : boolean +>false : boolean var z: foo.M1.I2; >z : f.I2 ->foo : unknown ->M1 : unknown +>foo : any +>M1 : any >I2 : f.I2 var e: number = 0; >e : number >0 : foo.E1 ->foo : unknown +>foo : any >E1 : foo.E1 +>0 : number === tests/cases/conformance/externalModules/foo_0.ts === export class C1 { @@ -45,9 +49,11 @@ export class C1 { m1 = 42; >m1 : number +>42 : number static s1 = true; >s1 : boolean +>true : boolean } export interface I1 { @@ -61,7 +67,7 @@ export interface I1 { } export module M1 { ->M1 : unknown +>M1 : any export interface I2 { >I2 : I2 diff --git a/tests/baselines/reference/amdModuleName1.symbols b/tests/baselines/reference/amdModuleName1.symbols new file mode 100644 index 00000000000..04f471dc2ad --- /dev/null +++ b/tests/baselines/reference/amdModuleName1.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/amdModuleName1.ts === +/// +class Foo { +>Foo : Symbol(Foo, Decl(amdModuleName1.ts, 0, 0)) + + x: number; +>x : Symbol(x, Decl(amdModuleName1.ts, 1, 11)) + + constructor() { + this.x = 5; +>this.x : Symbol(x, Decl(amdModuleName1.ts, 1, 11)) +>this : Symbol(Foo, Decl(amdModuleName1.ts, 0, 0)) +>x : Symbol(x, Decl(amdModuleName1.ts, 1, 11)) + } +} +export = Foo; +>Foo : Symbol(Foo, Decl(amdModuleName1.ts, 0, 0)) + diff --git a/tests/baselines/reference/amdModuleName1.types b/tests/baselines/reference/amdModuleName1.types index 02ad9472354..64bc7842451 100644 --- a/tests/baselines/reference/amdModuleName1.types +++ b/tests/baselines/reference/amdModuleName1.types @@ -12,6 +12,7 @@ class Foo { >this.x : number >this : Foo >x : number +>5 : number } } export = Foo; diff --git a/tests/baselines/reference/anonterface.symbols b/tests/baselines/reference/anonterface.symbols new file mode 100644 index 00000000000..fccd48043cf --- /dev/null +++ b/tests/baselines/reference/anonterface.symbols @@ -0,0 +1,36 @@ +=== tests/cases/compiler/anonterface.ts === +module M { +>M : Symbol(M, Decl(anonterface.ts, 0, 0)) + + export class C { +>C : Symbol(C, Decl(anonterface.ts, 0, 10)) + + m(fn:{ (n:number):string; },n2:number):string { +>m : Symbol(m, Decl(anonterface.ts, 1, 20)) +>fn : Symbol(fn, Decl(anonterface.ts, 2, 10)) +>n : Symbol(n, Decl(anonterface.ts, 2, 16)) +>n2 : Symbol(n2, Decl(anonterface.ts, 2, 36)) + + return fn(n2); +>fn : Symbol(fn, Decl(anonterface.ts, 2, 10)) +>n2 : Symbol(n2, Decl(anonterface.ts, 2, 36)) + } + } +} + +var c=new M.C(); +>c : Symbol(c, Decl(anonterface.ts, 8, 3)) +>M.C : Symbol(M.C, Decl(anonterface.ts, 0, 10)) +>M : Symbol(M, Decl(anonterface.ts, 0, 0)) +>C : Symbol(M.C, Decl(anonterface.ts, 0, 10)) + +c.m(function(n) { return "hello: "+n; },18); +>c.m : Symbol(M.C.m, Decl(anonterface.ts, 1, 20)) +>c : Symbol(c, Decl(anonterface.ts, 8, 3)) +>m : Symbol(M.C.m, Decl(anonterface.ts, 1, 20)) +>n : Symbol(n, Decl(anonterface.ts, 9, 13)) +>n : Symbol(n, Decl(anonterface.ts, 9, 13)) + + + + diff --git a/tests/baselines/reference/anonterface.types b/tests/baselines/reference/anonterface.types index 7b5b1401cac..b152ce79a1d 100644 --- a/tests/baselines/reference/anonterface.types +++ b/tests/baselines/reference/anonterface.types @@ -34,7 +34,9 @@ c.m(function(n) { return "hello: "+n; },18); >function(n) { return "hello: "+n; } : (n: number) => string >n : number >"hello: "+n : string +>"hello: " : string >n : number +>18 : number diff --git a/tests/baselines/reference/anyAsFunctionCall.symbols b/tests/baselines/reference/anyAsFunctionCall.symbols new file mode 100644 index 00000000000..14aeb993a6d --- /dev/null +++ b/tests/baselines/reference/anyAsFunctionCall.symbols @@ -0,0 +1,20 @@ +=== tests/cases/conformance/types/any/anyAsFunctionCall.ts === +// any is considered an untyped function call +// can be called except with type arguments which is an error + +var x: any; +>x : Symbol(x, Decl(anyAsFunctionCall.ts, 3, 3)) + +var a = x(); +>a : Symbol(a, Decl(anyAsFunctionCall.ts, 4, 3)) +>x : Symbol(x, Decl(anyAsFunctionCall.ts, 3, 3)) + +var b = x('hello'); +>b : Symbol(b, Decl(anyAsFunctionCall.ts, 5, 3)) +>x : Symbol(x, Decl(anyAsFunctionCall.ts, 3, 3)) + +var c = x(x); +>c : Symbol(c, Decl(anyAsFunctionCall.ts, 6, 3)) +>x : Symbol(x, Decl(anyAsFunctionCall.ts, 3, 3)) +>x : Symbol(x, Decl(anyAsFunctionCall.ts, 3, 3)) + diff --git a/tests/baselines/reference/anyAsFunctionCall.types b/tests/baselines/reference/anyAsFunctionCall.types index 6492dce37d2..340ccac463f 100644 --- a/tests/baselines/reference/anyAsFunctionCall.types +++ b/tests/baselines/reference/anyAsFunctionCall.types @@ -14,6 +14,7 @@ var b = x('hello'); >b : any >x('hello') : any >x : any +>'hello' : string var c = x(x); >c : any diff --git a/tests/baselines/reference/anyAsReturnTypeForNewOnCall.symbols b/tests/baselines/reference/anyAsReturnTypeForNewOnCall.symbols new file mode 100644 index 00000000000..d6d6719240d --- /dev/null +++ b/tests/baselines/reference/anyAsReturnTypeForNewOnCall.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/anyAsReturnTypeForNewOnCall.ts === +function Point(x, y) { +>Point : Symbol(Point, Decl(anyAsReturnTypeForNewOnCall.ts, 0, 0)) +>x : Symbol(x, Decl(anyAsReturnTypeForNewOnCall.ts, 0, 15)) +>y : Symbol(y, Decl(anyAsReturnTypeForNewOnCall.ts, 0, 17)) + + this.x = x; +>x : Symbol(x, Decl(anyAsReturnTypeForNewOnCall.ts, 0, 15)) + + this.y = y; +>y : Symbol(y, Decl(anyAsReturnTypeForNewOnCall.ts, 0, 17)) + +} + +var o = new Point(3, 4); +>o : Symbol(o, Decl(anyAsReturnTypeForNewOnCall.ts, 8, 3)) +>Point : Symbol(Point, Decl(anyAsReturnTypeForNewOnCall.ts, 0, 0)) + +var xx = o.x; +>xx : Symbol(xx, Decl(anyAsReturnTypeForNewOnCall.ts, 10, 3)) +>o : Symbol(o, Decl(anyAsReturnTypeForNewOnCall.ts, 8, 3)) + + + diff --git a/tests/baselines/reference/anyAsReturnTypeForNewOnCall.types b/tests/baselines/reference/anyAsReturnTypeForNewOnCall.types index f25cd57831b..bd0d9a9a092 100644 --- a/tests/baselines/reference/anyAsReturnTypeForNewOnCall.types +++ b/tests/baselines/reference/anyAsReturnTypeForNewOnCall.types @@ -24,6 +24,8 @@ var o = new Point(3, 4); >o : any >new Point(3, 4) : any >Point : (x: any, y: any) => void +>3 : number +>4 : number var xx = o.x; >xx : any diff --git a/tests/baselines/reference/anyAssignabilityInInheritance.symbols b/tests/baselines/reference/anyAssignabilityInInheritance.symbols new file mode 100644 index 00000000000..0f659dddd21 --- /dev/null +++ b/tests/baselines/reference/anyAssignabilityInInheritance.symbols @@ -0,0 +1,304 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/anyAssignabilityInInheritance.ts === +// any is not a subtype of any other types, errors expected on all the below derived classes unless otherwise noted + +interface I { +>I : Symbol(I, Decl(anyAssignabilityInInheritance.ts, 0, 0)) + + [x: string]: any; +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 3, 5)) + + foo: any; // ok, any identical to itself +>foo : Symbol(foo, Decl(anyAssignabilityInInheritance.ts, 3, 21)) +} + +var a: any; +>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3)) + +declare function foo2(x: number): number; +>foo2 : Symbol(foo2, Decl(anyAssignabilityInInheritance.ts, 7, 11), Decl(anyAssignabilityInInheritance.ts, 9, 41)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 9, 22)) + +declare function foo2(x: any): any; +>foo2 : Symbol(foo2, Decl(anyAssignabilityInInheritance.ts, 7, 11), Decl(anyAssignabilityInInheritance.ts, 9, 41)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 10, 22)) + +var r3 = foo2(a); // any, not a subtype of number so it skips that overload, is a subtype of itself so it picks second (if truly ambiguous it would pick first overload) +>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3)) +>foo2 : Symbol(foo2, Decl(anyAssignabilityInInheritance.ts, 7, 11), Decl(anyAssignabilityInInheritance.ts, 9, 41)) +>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3)) + +declare function foo3(x: string): string; +>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 13, 22)) + +declare function foo3(x: any): any; +>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 14, 22)) + +var r3 = foo3(a); // any +>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3)) +>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41)) +>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3)) + +declare function foo4(x: boolean): boolean; +>foo4 : Symbol(foo4, Decl(anyAssignabilityInInheritance.ts, 15, 17), Decl(anyAssignabilityInInheritance.ts, 17, 43)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 17, 22)) + +declare function foo4(x: any): any; +>foo4 : Symbol(foo4, Decl(anyAssignabilityInInheritance.ts, 15, 17), Decl(anyAssignabilityInInheritance.ts, 17, 43)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 18, 22)) + +var r3 = foo3(a); // any +>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3)) +>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41)) +>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3)) + +declare function foo5(x: Date): Date; +>foo5 : Symbol(foo5, Decl(anyAssignabilityInInheritance.ts, 19, 17), Decl(anyAssignabilityInInheritance.ts, 21, 37)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 21, 22)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +declare function foo5(x: any): any; +>foo5 : Symbol(foo5, Decl(anyAssignabilityInInheritance.ts, 19, 17), Decl(anyAssignabilityInInheritance.ts, 21, 37)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 22, 22)) + +var r3 = foo3(a); // any +>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3)) +>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41)) +>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3)) + +declare function foo6(x: RegExp): RegExp; +>foo6 : Symbol(foo6, Decl(anyAssignabilityInInheritance.ts, 23, 17), Decl(anyAssignabilityInInheritance.ts, 25, 41)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 25, 22)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) + +declare function foo6(x: any): any; +>foo6 : Symbol(foo6, Decl(anyAssignabilityInInheritance.ts, 23, 17), Decl(anyAssignabilityInInheritance.ts, 25, 41)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 26, 22)) + +var r3 = foo3(a); // any +>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3)) +>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41)) +>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3)) + +declare function foo7(x: { bar: number }): { bar: number }; +>foo7 : Symbol(foo7, Decl(anyAssignabilityInInheritance.ts, 27, 17), Decl(anyAssignabilityInInheritance.ts, 29, 59)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 29, 22)) +>bar : Symbol(bar, Decl(anyAssignabilityInInheritance.ts, 29, 26)) +>bar : Symbol(bar, Decl(anyAssignabilityInInheritance.ts, 29, 44)) + +declare function foo7(x: any): any; +>foo7 : Symbol(foo7, Decl(anyAssignabilityInInheritance.ts, 27, 17), Decl(anyAssignabilityInInheritance.ts, 29, 59)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 30, 22)) + +var r3 = foo3(a); // any +>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3)) +>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41)) +>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3)) + +declare function foo8(x: number[]): number[]; +>foo8 : Symbol(foo8, Decl(anyAssignabilityInInheritance.ts, 31, 17), Decl(anyAssignabilityInInheritance.ts, 33, 45)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 33, 22)) + +declare function foo8(x: any): any; +>foo8 : Symbol(foo8, Decl(anyAssignabilityInInheritance.ts, 31, 17), Decl(anyAssignabilityInInheritance.ts, 33, 45)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 34, 22)) + +var r3 = foo3(a); // any +>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3)) +>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41)) +>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3)) + +interface I8 { foo: string } +>I8 : Symbol(I8, Decl(anyAssignabilityInInheritance.ts, 35, 17)) +>foo : Symbol(foo, Decl(anyAssignabilityInInheritance.ts, 37, 14)) + +declare function foo9(x: I8): I8; +>foo9 : Symbol(foo9, Decl(anyAssignabilityInInheritance.ts, 37, 28), Decl(anyAssignabilityInInheritance.ts, 38, 33)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 38, 22)) +>I8 : Symbol(I8, Decl(anyAssignabilityInInheritance.ts, 35, 17)) +>I8 : Symbol(I8, Decl(anyAssignabilityInInheritance.ts, 35, 17)) + +declare function foo9(x: any): any; +>foo9 : Symbol(foo9, Decl(anyAssignabilityInInheritance.ts, 37, 28), Decl(anyAssignabilityInInheritance.ts, 38, 33)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 39, 22)) + +var r3 = foo3(a); // any +>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3)) +>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41)) +>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3)) + +class A { foo: number; } +>A : Symbol(A, Decl(anyAssignabilityInInheritance.ts, 40, 17)) +>foo : Symbol(foo, Decl(anyAssignabilityInInheritance.ts, 42, 9)) + +declare function foo10(x: A): A; +>foo10 : Symbol(foo10, Decl(anyAssignabilityInInheritance.ts, 42, 24), Decl(anyAssignabilityInInheritance.ts, 43, 32)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 43, 23)) +>A : Symbol(A, Decl(anyAssignabilityInInheritance.ts, 40, 17)) +>A : Symbol(A, Decl(anyAssignabilityInInheritance.ts, 40, 17)) + +declare function foo10(x: any): any; +>foo10 : Symbol(foo10, Decl(anyAssignabilityInInheritance.ts, 42, 24), Decl(anyAssignabilityInInheritance.ts, 43, 32)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 44, 23)) + +var r3 = foo3(a); // any +>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3)) +>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41)) +>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3)) + +class A2 { foo: T; } +>A2 : Symbol(A2, Decl(anyAssignabilityInInheritance.ts, 45, 17)) +>T : Symbol(T, Decl(anyAssignabilityInInheritance.ts, 47, 9)) +>foo : Symbol(foo, Decl(anyAssignabilityInInheritance.ts, 47, 13)) +>T : Symbol(T, Decl(anyAssignabilityInInheritance.ts, 47, 9)) + +declare function foo11(x: A2): A2; +>foo11 : Symbol(foo11, Decl(anyAssignabilityInInheritance.ts, 47, 23), Decl(anyAssignabilityInInheritance.ts, 48, 50)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 48, 23)) +>A2 : Symbol(A2, Decl(anyAssignabilityInInheritance.ts, 45, 17)) +>A2 : Symbol(A2, Decl(anyAssignabilityInInheritance.ts, 45, 17)) + +declare function foo11(x: any): any; +>foo11 : Symbol(foo11, Decl(anyAssignabilityInInheritance.ts, 47, 23), Decl(anyAssignabilityInInheritance.ts, 48, 50)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 49, 23)) + +var r3 = foo3(a); // any +>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3)) +>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41)) +>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3)) + +declare function foo12(x: (x) => number): (x) => number; +>foo12 : Symbol(foo12, Decl(anyAssignabilityInInheritance.ts, 50, 17), Decl(anyAssignabilityInInheritance.ts, 52, 56)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 52, 23)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 52, 27)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 52, 43)) + +declare function foo12(x: any): any; +>foo12 : Symbol(foo12, Decl(anyAssignabilityInInheritance.ts, 50, 17), Decl(anyAssignabilityInInheritance.ts, 52, 56)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 53, 23)) + +var r3 = foo3(a); // any +>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3)) +>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41)) +>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3)) + +declare function foo13(x: (x: T) => T): (x: T) => T; +>foo13 : Symbol(foo13, Decl(anyAssignabilityInInheritance.ts, 54, 17), Decl(anyAssignabilityInInheritance.ts, 56, 58)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 56, 23)) +>T : Symbol(T, Decl(anyAssignabilityInInheritance.ts, 56, 27)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 56, 30)) +>T : Symbol(T, Decl(anyAssignabilityInInheritance.ts, 56, 27)) +>T : Symbol(T, Decl(anyAssignabilityInInheritance.ts, 56, 27)) +>T : Symbol(T, Decl(anyAssignabilityInInheritance.ts, 56, 44)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 56, 47)) +>T : Symbol(T, Decl(anyAssignabilityInInheritance.ts, 56, 44)) +>T : Symbol(T, Decl(anyAssignabilityInInheritance.ts, 56, 44)) + +declare function foo13(x: any): any; +>foo13 : Symbol(foo13, Decl(anyAssignabilityInInheritance.ts, 54, 17), Decl(anyAssignabilityInInheritance.ts, 56, 58)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 57, 23)) + +var r3 = foo3(a); // any +>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3)) +>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41)) +>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3)) + +enum E { A } +>E : Symbol(E, Decl(anyAssignabilityInInheritance.ts, 58, 17)) +>A : Symbol(E.A, Decl(anyAssignabilityInInheritance.ts, 60, 8)) + +declare function foo14(x: E): E; +>foo14 : Symbol(foo14, Decl(anyAssignabilityInInheritance.ts, 60, 12), Decl(anyAssignabilityInInheritance.ts, 61, 32)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 61, 23)) +>E : Symbol(E, Decl(anyAssignabilityInInheritance.ts, 58, 17)) +>E : Symbol(E, Decl(anyAssignabilityInInheritance.ts, 58, 17)) + +declare function foo14(x: any): any; +>foo14 : Symbol(foo14, Decl(anyAssignabilityInInheritance.ts, 60, 12), Decl(anyAssignabilityInInheritance.ts, 61, 32)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 62, 23)) + +var r3 = foo3(a); // any +>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3)) +>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41)) +>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3)) + +function f() { } +>f : Symbol(f, Decl(anyAssignabilityInInheritance.ts, 63, 17), Decl(anyAssignabilityInInheritance.ts, 65, 16)) + +module f { +>f : Symbol(f, Decl(anyAssignabilityInInheritance.ts, 63, 17), Decl(anyAssignabilityInInheritance.ts, 65, 16)) + + export var bar = 1; +>bar : Symbol(bar, Decl(anyAssignabilityInInheritance.ts, 67, 14)) +} +declare function foo15(x: typeof f): typeof f; +>foo15 : Symbol(foo15, Decl(anyAssignabilityInInheritance.ts, 68, 1), Decl(anyAssignabilityInInheritance.ts, 69, 46)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 69, 23)) +>f : Symbol(f, Decl(anyAssignabilityInInheritance.ts, 63, 17), Decl(anyAssignabilityInInheritance.ts, 65, 16)) +>f : Symbol(f, Decl(anyAssignabilityInInheritance.ts, 63, 17), Decl(anyAssignabilityInInheritance.ts, 65, 16)) + +declare function foo15(x: any): any; +>foo15 : Symbol(foo15, Decl(anyAssignabilityInInheritance.ts, 68, 1), Decl(anyAssignabilityInInheritance.ts, 69, 46)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 70, 23)) + +var r3 = foo3(a); // any +>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3)) +>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41)) +>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3)) + +class CC { baz: string } +>CC : Symbol(CC, Decl(anyAssignabilityInInheritance.ts, 71, 17), Decl(anyAssignabilityInInheritance.ts, 73, 24)) +>baz : Symbol(baz, Decl(anyAssignabilityInInheritance.ts, 73, 10)) + +module CC { +>CC : Symbol(CC, Decl(anyAssignabilityInInheritance.ts, 71, 17), Decl(anyAssignabilityInInheritance.ts, 73, 24)) + + export var bar = 1; +>bar : Symbol(bar, Decl(anyAssignabilityInInheritance.ts, 75, 14)) +} +declare function foo16(x: CC): CC; +>foo16 : Symbol(foo16, Decl(anyAssignabilityInInheritance.ts, 76, 1), Decl(anyAssignabilityInInheritance.ts, 77, 34)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 77, 23)) +>CC : Symbol(CC, Decl(anyAssignabilityInInheritance.ts, 71, 17), Decl(anyAssignabilityInInheritance.ts, 73, 24)) +>CC : Symbol(CC, Decl(anyAssignabilityInInheritance.ts, 71, 17), Decl(anyAssignabilityInInheritance.ts, 73, 24)) + +declare function foo16(x: any): any; +>foo16 : Symbol(foo16, Decl(anyAssignabilityInInheritance.ts, 76, 1), Decl(anyAssignabilityInInheritance.ts, 77, 34)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 78, 23)) + +var r3 = foo3(a); // any +>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3)) +>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41)) +>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3)) + +declare function foo17(x: Object): Object; +>foo17 : Symbol(foo17, Decl(anyAssignabilityInInheritance.ts, 79, 17), Decl(anyAssignabilityInInheritance.ts, 81, 42)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 81, 23)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +declare function foo17(x: any): any; +>foo17 : Symbol(foo17, Decl(anyAssignabilityInInheritance.ts, 79, 17), Decl(anyAssignabilityInInheritance.ts, 81, 42)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 82, 23)) + +var r3 = foo3(a); // any +>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3)) +>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41)) +>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3)) + +declare function foo18(x: {}): {}; +>foo18 : Symbol(foo18, Decl(anyAssignabilityInInheritance.ts, 83, 17), Decl(anyAssignabilityInInheritance.ts, 85, 34)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 85, 23)) + +declare function foo18(x: any): any; +>foo18 : Symbol(foo18, Decl(anyAssignabilityInInheritance.ts, 83, 17), Decl(anyAssignabilityInInheritance.ts, 85, 34)) +>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 86, 23)) + +var r3 = foo3(a); // any +>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3)) +>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41)) +>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3)) + diff --git a/tests/baselines/reference/anyAssignabilityInInheritance.types b/tests/baselines/reference/anyAssignabilityInInheritance.types index f5a4f22ef3f..b8575e8edb2 100644 --- a/tests/baselines/reference/anyAssignabilityInInheritance.types +++ b/tests/baselines/reference/anyAssignabilityInInheritance.types @@ -246,6 +246,7 @@ module f { export var bar = 1; >bar : number +>1 : number } declare function foo15(x: typeof f): typeof f; >foo15 : { (x: typeof f): typeof f; (x: any): any; } @@ -272,6 +273,7 @@ module CC { export var bar = 1; >bar : number +>1 : number } declare function foo16(x: CC): CC; >foo16 : { (x: CC): CC; (x: any): any; } diff --git a/tests/baselines/reference/anyAssignableToEveryType.symbols b/tests/baselines/reference/anyAssignableToEveryType.symbols new file mode 100644 index 00000000000..19dc94c7a43 --- /dev/null +++ b/tests/baselines/reference/anyAssignableToEveryType.symbols @@ -0,0 +1,150 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/anyAssignableToEveryType.ts === +var a: any; +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +class C { +>C : Symbol(C, Decl(anyAssignableToEveryType.ts, 0, 11)) + + foo: string; +>foo : Symbol(foo, Decl(anyAssignableToEveryType.ts, 2, 9)) +} +var ac: C; +>ac : Symbol(ac, Decl(anyAssignableToEveryType.ts, 5, 3)) +>C : Symbol(C, Decl(anyAssignableToEveryType.ts, 0, 11)) + +interface I { +>I : Symbol(I, Decl(anyAssignableToEveryType.ts, 5, 10)) + + foo: string; +>foo : Symbol(foo, Decl(anyAssignableToEveryType.ts, 6, 13)) +} +var ai: I; +>ai : Symbol(ai, Decl(anyAssignableToEveryType.ts, 9, 3)) +>I : Symbol(I, Decl(anyAssignableToEveryType.ts, 5, 10)) + +enum E { A } +>E : Symbol(E, Decl(anyAssignableToEveryType.ts, 9, 10)) +>A : Symbol(E.A, Decl(anyAssignableToEveryType.ts, 11, 8)) + +var ae: E; +>ae : Symbol(ae, Decl(anyAssignableToEveryType.ts, 12, 3)) +>E : Symbol(E, Decl(anyAssignableToEveryType.ts, 9, 10)) + +var b: number = a; +>b : Symbol(b, Decl(anyAssignableToEveryType.ts, 14, 3)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var c: string = a; +>c : Symbol(c, Decl(anyAssignableToEveryType.ts, 15, 3)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var d: boolean = a; +>d : Symbol(d, Decl(anyAssignableToEveryType.ts, 16, 3)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var e: Date = a; +>e : Symbol(e, Decl(anyAssignableToEveryType.ts, 17, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var f: any = a; +>f : Symbol(f, Decl(anyAssignableToEveryType.ts, 18, 3)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var g: void = a; +>g : Symbol(g, Decl(anyAssignableToEveryType.ts, 19, 3)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var h: Object = a; +>h : Symbol(h, Decl(anyAssignableToEveryType.ts, 20, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var i: {} = a; +>i : Symbol(i, Decl(anyAssignableToEveryType.ts, 21, 3)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var j: () => {} = a; +>j : Symbol(j, Decl(anyAssignableToEveryType.ts, 22, 3)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var k: Function = a; +>k : Symbol(k, Decl(anyAssignableToEveryType.ts, 23, 3)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var l: (x: number) => string = a; +>l : Symbol(l, Decl(anyAssignableToEveryType.ts, 24, 3)) +>x : Symbol(x, Decl(anyAssignableToEveryType.ts, 24, 8)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +ac = a; +>ac : Symbol(ac, Decl(anyAssignableToEveryType.ts, 5, 3)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +ai = a; +>ai : Symbol(ai, Decl(anyAssignableToEveryType.ts, 9, 3)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +ae = a; +>ae : Symbol(ae, Decl(anyAssignableToEveryType.ts, 12, 3)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var m: number[] = a; +>m : Symbol(m, Decl(anyAssignableToEveryType.ts, 28, 3)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var n: { foo: string } = a; +>n : Symbol(n, Decl(anyAssignableToEveryType.ts, 29, 3)) +>foo : Symbol(foo, Decl(anyAssignableToEveryType.ts, 29, 8)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var o: (x: T) => T = a; +>o : Symbol(o, Decl(anyAssignableToEveryType.ts, 30, 3)) +>T : Symbol(T, Decl(anyAssignableToEveryType.ts, 30, 8)) +>x : Symbol(x, Decl(anyAssignableToEveryType.ts, 30, 11)) +>T : Symbol(T, Decl(anyAssignableToEveryType.ts, 30, 8)) +>T : Symbol(T, Decl(anyAssignableToEveryType.ts, 30, 8)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var p: Number = a; +>p : Symbol(p, Decl(anyAssignableToEveryType.ts, 31, 3)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var q: String = a; +>q : Symbol(q, Decl(anyAssignableToEveryType.ts, 32, 3)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +function foo(x: T, y: U, z: V) { +>foo : Symbol(foo, Decl(anyAssignableToEveryType.ts, 32, 18)) +>T : Symbol(T, Decl(anyAssignableToEveryType.ts, 34, 13)) +>U : Symbol(U, Decl(anyAssignableToEveryType.ts, 34, 15)) +>V : Symbol(V, Decl(anyAssignableToEveryType.ts, 34, 32)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>x : Symbol(x, Decl(anyAssignableToEveryType.ts, 34, 49)) +>T : Symbol(T, Decl(anyAssignableToEveryType.ts, 34, 13)) +>y : Symbol(y, Decl(anyAssignableToEveryType.ts, 34, 54)) +>U : Symbol(U, Decl(anyAssignableToEveryType.ts, 34, 15)) +>z : Symbol(z, Decl(anyAssignableToEveryType.ts, 34, 60)) +>V : Symbol(V, Decl(anyAssignableToEveryType.ts, 34, 32)) + + x = a; +>x : Symbol(x, Decl(anyAssignableToEveryType.ts, 34, 49)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + + y = a; +>y : Symbol(y, Decl(anyAssignableToEveryType.ts, 34, 54)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + + z = a; +>z : Symbol(z, Decl(anyAssignableToEveryType.ts, 34, 60)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) +} + +//function foo(x: T, y: U, z: V) { +// x = a; +// y = a; +// z = a; +//} diff --git a/tests/baselines/reference/anyInferenceAnonymousFunctions.symbols b/tests/baselines/reference/anyInferenceAnonymousFunctions.symbols new file mode 100644 index 00000000000..daf7947e694 --- /dev/null +++ b/tests/baselines/reference/anyInferenceAnonymousFunctions.symbols @@ -0,0 +1,50 @@ +=== tests/cases/compiler/anyInferenceAnonymousFunctions.ts === +var paired: any[]; +>paired : Symbol(paired, Decl(anyInferenceAnonymousFunctions.ts, 0, 3)) + +paired.reduce(function (a1, a2) { +>paired.reduce : Symbol(Array.reduce, Decl(lib.d.ts, 1129, 93), Decl(lib.d.ts, 1136, 120)) +>paired : Symbol(paired, Decl(anyInferenceAnonymousFunctions.ts, 0, 3)) +>reduce : Symbol(Array.reduce, Decl(lib.d.ts, 1129, 93), Decl(lib.d.ts, 1136, 120)) +>a1 : Symbol(a1, Decl(anyInferenceAnonymousFunctions.ts, 2, 24)) +>a2 : Symbol(a2, Decl(anyInferenceAnonymousFunctions.ts, 2, 27)) + + return a1.concat({}); +>a1 : Symbol(a1, Decl(anyInferenceAnonymousFunctions.ts, 2, 24)) + +} , []); + +paired.reduce((b1, b2) => { +>paired.reduce : Symbol(Array.reduce, Decl(lib.d.ts, 1129, 93), Decl(lib.d.ts, 1136, 120)) +>paired : Symbol(paired, Decl(anyInferenceAnonymousFunctions.ts, 0, 3)) +>reduce : Symbol(Array.reduce, Decl(lib.d.ts, 1129, 93), Decl(lib.d.ts, 1136, 120)) +>b1 : Symbol(b1, Decl(anyInferenceAnonymousFunctions.ts, 8, 15)) +>b2 : Symbol(b2, Decl(anyInferenceAnonymousFunctions.ts, 8, 18)) + + return b1.concat({}); +>b1 : Symbol(b1, Decl(anyInferenceAnonymousFunctions.ts, 8, 15)) + +} , []); + +paired.reduce((b3, b4) => b3.concat({}), []); +>paired.reduce : Symbol(Array.reduce, Decl(lib.d.ts, 1129, 93), Decl(lib.d.ts, 1136, 120)) +>paired : Symbol(paired, Decl(anyInferenceAnonymousFunctions.ts, 0, 3)) +>reduce : Symbol(Array.reduce, Decl(lib.d.ts, 1129, 93), Decl(lib.d.ts, 1136, 120)) +>b3 : Symbol(b3, Decl(anyInferenceAnonymousFunctions.ts, 13, 15)) +>b4 : Symbol(b4, Decl(anyInferenceAnonymousFunctions.ts, 13, 18)) +>b3 : Symbol(b3, Decl(anyInferenceAnonymousFunctions.ts, 13, 15)) + +paired.map((c1) => c1.count); +>paired.map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>paired : Symbol(paired, Decl(anyInferenceAnonymousFunctions.ts, 0, 3)) +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>c1 : Symbol(c1, Decl(anyInferenceAnonymousFunctions.ts, 15, 12)) +>c1 : Symbol(c1, Decl(anyInferenceAnonymousFunctions.ts, 15, 12)) + +paired.map(function (c2) { return c2.count; }); +>paired.map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>paired : Symbol(paired, Decl(anyInferenceAnonymousFunctions.ts, 0, 3)) +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>c2 : Symbol(c2, Decl(anyInferenceAnonymousFunctions.ts, 16, 21)) +>c2 : Symbol(c2, Decl(anyInferenceAnonymousFunctions.ts, 16, 21)) + diff --git a/tests/baselines/reference/anyIsAssignableToObject.symbols b/tests/baselines/reference/anyIsAssignableToObject.symbols new file mode 100644 index 00000000000..a9650fa58b8 --- /dev/null +++ b/tests/baselines/reference/anyIsAssignableToObject.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/anyIsAssignableToObject.ts === +interface P { +>P : Symbol(P, Decl(anyIsAssignableToObject.ts, 0, 0)) + + p: {}; +>p : Symbol(p, Decl(anyIsAssignableToObject.ts, 0, 13)) +} + +interface Q extends P { // Check assignability here. Any is assignable to {} +>Q : Symbol(Q, Decl(anyIsAssignableToObject.ts, 2, 1)) +>P : Symbol(P, Decl(anyIsAssignableToObject.ts, 0, 0)) + + p: any; +>p : Symbol(p, Decl(anyIsAssignableToObject.ts, 4, 23)) +} diff --git a/tests/baselines/reference/anyIsAssignableToVoid.symbols b/tests/baselines/reference/anyIsAssignableToVoid.symbols new file mode 100644 index 00000000000..f5ee5ce7b23 --- /dev/null +++ b/tests/baselines/reference/anyIsAssignableToVoid.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/anyIsAssignableToVoid.ts === +interface P { +>P : Symbol(P, Decl(anyIsAssignableToVoid.ts, 0, 0)) + + p: void; +>p : Symbol(p, Decl(anyIsAssignableToVoid.ts, 0, 13)) +} + +interface Q extends P { // check assignability here. any is assignable to void. +>Q : Symbol(Q, Decl(anyIsAssignableToVoid.ts, 2, 1)) +>P : Symbol(P, Decl(anyIsAssignableToVoid.ts, 0, 0)) + + p: any; +>p : Symbol(p, Decl(anyIsAssignableToVoid.ts, 4, 23)) +} diff --git a/tests/baselines/reference/anyPlusAny1.symbols b/tests/baselines/reference/anyPlusAny1.symbols new file mode 100644 index 00000000000..e0552e4541f --- /dev/null +++ b/tests/baselines/reference/anyPlusAny1.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/anyPlusAny1.ts === +var x; +>x : Symbol(x, Decl(anyPlusAny1.ts, 0, 3)) + +x.name = "hello"; +>x : Symbol(x, Decl(anyPlusAny1.ts, 0, 3)) + +var z = x + x; +>z : Symbol(z, Decl(anyPlusAny1.ts, 2, 3)) +>x : Symbol(x, Decl(anyPlusAny1.ts, 0, 3)) +>x : Symbol(x, Decl(anyPlusAny1.ts, 0, 3)) + diff --git a/tests/baselines/reference/anyPlusAny1.types b/tests/baselines/reference/anyPlusAny1.types index aeda001eeaa..406d432f06e 100644 --- a/tests/baselines/reference/anyPlusAny1.types +++ b/tests/baselines/reference/anyPlusAny1.types @@ -7,6 +7,7 @@ x.name = "hello"; >x.name : any >x : any >name : any +>"hello" : string var z = x + x; >z : any diff --git a/tests/baselines/reference/anyPropertyAccess.symbols b/tests/baselines/reference/anyPropertyAccess.symbols new file mode 100644 index 00000000000..e99b494853e --- /dev/null +++ b/tests/baselines/reference/anyPropertyAccess.symbols @@ -0,0 +1,28 @@ +=== tests/cases/conformance/types/any/anyPropertyAccess.ts === +var x: any; +>x : Symbol(x, Decl(anyPropertyAccess.ts, 0, 3)) + +var a = x.foo; +>a : Symbol(a, Decl(anyPropertyAccess.ts, 1, 3)) +>x : Symbol(x, Decl(anyPropertyAccess.ts, 0, 3)) + +var b = x['foo']; +>b : Symbol(b, Decl(anyPropertyAccess.ts, 2, 3)) +>x : Symbol(x, Decl(anyPropertyAccess.ts, 0, 3)) + +var c = x['fn'](); +>c : Symbol(c, Decl(anyPropertyAccess.ts, 3, 3)) +>x : Symbol(x, Decl(anyPropertyAccess.ts, 0, 3)) + +var d = x.bar.baz; +>d : Symbol(d, Decl(anyPropertyAccess.ts, 4, 3)) +>x : Symbol(x, Decl(anyPropertyAccess.ts, 0, 3)) + +var e = x[0].foo; +>e : Symbol(e, Decl(anyPropertyAccess.ts, 5, 3)) +>x : Symbol(x, Decl(anyPropertyAccess.ts, 0, 3)) + +var f = x['0'].bar; +>f : Symbol(f, Decl(anyPropertyAccess.ts, 6, 3)) +>x : Symbol(x, Decl(anyPropertyAccess.ts, 0, 3)) + diff --git a/tests/baselines/reference/anyPropertyAccess.types b/tests/baselines/reference/anyPropertyAccess.types index 5ea20cefdd6..13eec6b53b2 100644 --- a/tests/baselines/reference/anyPropertyAccess.types +++ b/tests/baselines/reference/anyPropertyAccess.types @@ -12,12 +12,14 @@ var b = x['foo']; >b : any >x['foo'] : any >x : any +>'foo' : string var c = x['fn'](); >c : any >x['fn']() : any >x['fn'] : any >x : any +>'fn' : string var d = x.bar.baz; >d : any @@ -32,6 +34,7 @@ var e = x[0].foo; >x[0].foo : any >x[0] : any >x : any +>0 : number >foo : any var f = x['0'].bar; @@ -39,5 +42,6 @@ var f = x['0'].bar; >x['0'].bar : any >x['0'] : any >x : any +>'0' : string >bar : any diff --git a/tests/baselines/reference/argsInScope.symbols b/tests/baselines/reference/argsInScope.symbols new file mode 100644 index 00000000000..7ea039819aa --- /dev/null +++ b/tests/baselines/reference/argsInScope.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/argsInScope.ts === +class C { +>C : Symbol(C, Decl(argsInScope.ts, 0, 0)) + + P(ii:number, j:number, k:number) { +>P : Symbol(P, Decl(argsInScope.ts, 0, 9)) +>ii : Symbol(ii, Decl(argsInScope.ts, 1, 6)) +>j : Symbol(j, Decl(argsInScope.ts, 1, 16)) +>k : Symbol(k, Decl(argsInScope.ts, 1, 26)) + + for (var i = 0; i < arguments.length; i++) { +>i : Symbol(i, Decl(argsInScope.ts, 2, 15)) +>i : Symbol(i, Decl(argsInScope.ts, 2, 15)) +>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, 272, 25)) +>arguments : Symbol(arguments) +>length : Symbol(IArguments.length, Decl(lib.d.ts, 272, 25)) +>i : Symbol(i, Decl(argsInScope.ts, 2, 15)) + + // WScript.Echo("param: " + arguments[i]); + } + } +} + +var c = new C(); +>c : Symbol(c, Decl(argsInScope.ts, 8, 3)) +>C : Symbol(C, Decl(argsInScope.ts, 0, 0)) + +c.P(1,2,3); +>c.P : Symbol(C.P, Decl(argsInScope.ts, 0, 9)) +>c : Symbol(c, Decl(argsInScope.ts, 8, 3)) +>P : Symbol(C.P, Decl(argsInScope.ts, 0, 9)) + diff --git a/tests/baselines/reference/argsInScope.types b/tests/baselines/reference/argsInScope.types index 010e5624039..745ae249359 100644 --- a/tests/baselines/reference/argsInScope.types +++ b/tests/baselines/reference/argsInScope.types @@ -10,6 +10,7 @@ class C { for (var i = 0; i < arguments.length; i++) { >i : number +>0 : number >i < arguments.length : boolean >i : number >arguments.length : number @@ -33,4 +34,7 @@ c.P(1,2,3); >c.P : (ii: number, j: number, k: number) => void >c : C >P : (ii: number, j: number, k: number) => void +>1 : number +>2 : number +>3 : number diff --git a/tests/baselines/reference/arguments.symbols b/tests/baselines/reference/arguments.symbols new file mode 100644 index 00000000000..2825d792715 --- /dev/null +++ b/tests/baselines/reference/arguments.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/arguments.ts === +function f() { +>f : Symbol(f, Decl(arguments.ts, 0, 0)) + + var x=arguments[12]; +>x : Symbol(x, Decl(arguments.ts, 1, 7)) +>arguments : Symbol(arguments) +} diff --git a/tests/baselines/reference/arguments.types b/tests/baselines/reference/arguments.types index 1902e459316..4699d463b34 100644 --- a/tests/baselines/reference/arguments.types +++ b/tests/baselines/reference/arguments.types @@ -6,4 +6,5 @@ function f() { >x : any >arguments[12] : any >arguments : IArguments +>12 : number } diff --git a/tests/baselines/reference/argumentsUsedInObjectLiteralProperty.symbols b/tests/baselines/reference/argumentsUsedInObjectLiteralProperty.symbols new file mode 100644 index 00000000000..1c3b54ef427 --- /dev/null +++ b/tests/baselines/reference/argumentsUsedInObjectLiteralProperty.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/argumentsUsedInObjectLiteralProperty.ts === +class A { +>A : Symbol(A, Decl(argumentsUsedInObjectLiteralProperty.ts, 0, 0)) + + public static createSelectableViewModel(initialState?: any, selectedValue?: any) { +>createSelectableViewModel : Symbol(A.createSelectableViewModel, Decl(argumentsUsedInObjectLiteralProperty.ts, 0, 9)) +>initialState : Symbol(initialState, Decl(argumentsUsedInObjectLiteralProperty.ts, 1, 44)) +>selectedValue : Symbol(selectedValue, Decl(argumentsUsedInObjectLiteralProperty.ts, 1, 63)) + + return { + selectedValue: arguments.length +>selectedValue : Symbol(selectedValue, Decl(argumentsUsedInObjectLiteralProperty.ts, 2, 16)) +>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, 272, 25)) +>arguments : Symbol(arguments) +>length : Symbol(IArguments.length, Decl(lib.d.ts, 272, 25)) + + }; + } +} diff --git a/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.symbols b/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.symbols new file mode 100644 index 00000000000..e45db3637f0 --- /dev/null +++ b/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.symbols @@ -0,0 +1,357 @@ +=== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithAnyAndNumber.ts === +var a: any; +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var b: number; +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +// operator * +var ra1 = a * a; +>ra1 : Symbol(ra1, Decl(arithmeticOperatorWithAnyAndNumber.ts, 4, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var ra2 = a * b; +>ra2 : Symbol(ra2, Decl(arithmeticOperatorWithAnyAndNumber.ts, 5, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var ra3 = a * 0; +>ra3 : Symbol(ra3, Decl(arithmeticOperatorWithAnyAndNumber.ts, 6, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var ra4 = 0 * a; +>ra4 : Symbol(ra4, Decl(arithmeticOperatorWithAnyAndNumber.ts, 7, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var ra5 = 0 * 0; +>ra5 : Symbol(ra5, Decl(arithmeticOperatorWithAnyAndNumber.ts, 8, 3)) + +var ra6 = b * 0; +>ra6 : Symbol(ra6, Decl(arithmeticOperatorWithAnyAndNumber.ts, 9, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var ra7 = 0 * b; +>ra7 : Symbol(ra7, Decl(arithmeticOperatorWithAnyAndNumber.ts, 10, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var ra8 = b * b; +>ra8 : Symbol(ra8, Decl(arithmeticOperatorWithAnyAndNumber.ts, 11, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +// operator / +var rb1 = a / a; +>rb1 : Symbol(rb1, Decl(arithmeticOperatorWithAnyAndNumber.ts, 14, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rb2 = a / b; +>rb2 : Symbol(rb2, Decl(arithmeticOperatorWithAnyAndNumber.ts, 15, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rb3 = a / 0; +>rb3 : Symbol(rb3, Decl(arithmeticOperatorWithAnyAndNumber.ts, 16, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rb4 = 0 / a; +>rb4 : Symbol(rb4, Decl(arithmeticOperatorWithAnyAndNumber.ts, 17, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rb5 = 0 / 0; +>rb5 : Symbol(rb5, Decl(arithmeticOperatorWithAnyAndNumber.ts, 18, 3)) + +var rb6 = b / 0; +>rb6 : Symbol(rb6, Decl(arithmeticOperatorWithAnyAndNumber.ts, 19, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rb7 = 0 / b; +>rb7 : Symbol(rb7, Decl(arithmeticOperatorWithAnyAndNumber.ts, 20, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rb8 = b / b; +>rb8 : Symbol(rb8, Decl(arithmeticOperatorWithAnyAndNumber.ts, 21, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +// operator % +var rc1 = a % a; +>rc1 : Symbol(rc1, Decl(arithmeticOperatorWithAnyAndNumber.ts, 24, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rc2 = a % b; +>rc2 : Symbol(rc2, Decl(arithmeticOperatorWithAnyAndNumber.ts, 25, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rc3 = a % 0; +>rc3 : Symbol(rc3, Decl(arithmeticOperatorWithAnyAndNumber.ts, 26, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rc4 = 0 % a; +>rc4 : Symbol(rc4, Decl(arithmeticOperatorWithAnyAndNumber.ts, 27, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rc5 = 0 % 0; +>rc5 : Symbol(rc5, Decl(arithmeticOperatorWithAnyAndNumber.ts, 28, 3)) + +var rc6 = b % 0; +>rc6 : Symbol(rc6, Decl(arithmeticOperatorWithAnyAndNumber.ts, 29, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rc7 = 0 % b; +>rc7 : Symbol(rc7, Decl(arithmeticOperatorWithAnyAndNumber.ts, 30, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rc8 = b % b; +>rc8 : Symbol(rc8, Decl(arithmeticOperatorWithAnyAndNumber.ts, 31, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +// operator - +var rd1 = a - a; +>rd1 : Symbol(rd1, Decl(arithmeticOperatorWithAnyAndNumber.ts, 34, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rd2 = a - b; +>rd2 : Symbol(rd2, Decl(arithmeticOperatorWithAnyAndNumber.ts, 35, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rd3 = a - 0; +>rd3 : Symbol(rd3, Decl(arithmeticOperatorWithAnyAndNumber.ts, 36, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rd4 = 0 - a; +>rd4 : Symbol(rd4, Decl(arithmeticOperatorWithAnyAndNumber.ts, 37, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rd5 = 0 - 0; +>rd5 : Symbol(rd5, Decl(arithmeticOperatorWithAnyAndNumber.ts, 38, 3)) + +var rd6 = b - 0; +>rd6 : Symbol(rd6, Decl(arithmeticOperatorWithAnyAndNumber.ts, 39, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rd7 = 0 - b; +>rd7 : Symbol(rd7, Decl(arithmeticOperatorWithAnyAndNumber.ts, 40, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rd8 = b - b; +>rd8 : Symbol(rd8, Decl(arithmeticOperatorWithAnyAndNumber.ts, 41, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +// operator << +var re1 = a << a; +>re1 : Symbol(re1, Decl(arithmeticOperatorWithAnyAndNumber.ts, 44, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var re2 = a << b; +>re2 : Symbol(re2, Decl(arithmeticOperatorWithAnyAndNumber.ts, 45, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var re3 = a << 0; +>re3 : Symbol(re3, Decl(arithmeticOperatorWithAnyAndNumber.ts, 46, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var re4 = 0 << a; +>re4 : Symbol(re4, Decl(arithmeticOperatorWithAnyAndNumber.ts, 47, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var re5 = 0 << 0; +>re5 : Symbol(re5, Decl(arithmeticOperatorWithAnyAndNumber.ts, 48, 3)) + +var re6 = b << 0; +>re6 : Symbol(re6, Decl(arithmeticOperatorWithAnyAndNumber.ts, 49, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var re7 = 0 << b; +>re7 : Symbol(re7, Decl(arithmeticOperatorWithAnyAndNumber.ts, 50, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var re8 = b << b; +>re8 : Symbol(re8, Decl(arithmeticOperatorWithAnyAndNumber.ts, 51, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +// operator >> +var rf1 = a >> a; +>rf1 : Symbol(rf1, Decl(arithmeticOperatorWithAnyAndNumber.ts, 54, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rf2 = a >> b; +>rf2 : Symbol(rf2, Decl(arithmeticOperatorWithAnyAndNumber.ts, 55, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rf3 = a >> 0; +>rf3 : Symbol(rf3, Decl(arithmeticOperatorWithAnyAndNumber.ts, 56, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rf4 = 0 >> a; +>rf4 : Symbol(rf4, Decl(arithmeticOperatorWithAnyAndNumber.ts, 57, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rf5 = 0 >> 0; +>rf5 : Symbol(rf5, Decl(arithmeticOperatorWithAnyAndNumber.ts, 58, 3)) + +var rf6 = b >> 0; +>rf6 : Symbol(rf6, Decl(arithmeticOperatorWithAnyAndNumber.ts, 59, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rf7 = 0 >> b; +>rf7 : Symbol(rf7, Decl(arithmeticOperatorWithAnyAndNumber.ts, 60, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rf8 = b >> b; +>rf8 : Symbol(rf8, Decl(arithmeticOperatorWithAnyAndNumber.ts, 61, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +// operator >>> +var rg1 = a >>> a; +>rg1 : Symbol(rg1, Decl(arithmeticOperatorWithAnyAndNumber.ts, 64, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rg2 = a >>> b; +>rg2 : Symbol(rg2, Decl(arithmeticOperatorWithAnyAndNumber.ts, 65, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rg3 = a >>> 0; +>rg3 : Symbol(rg3, Decl(arithmeticOperatorWithAnyAndNumber.ts, 66, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rg4 = 0 >>> a; +>rg4 : Symbol(rg4, Decl(arithmeticOperatorWithAnyAndNumber.ts, 67, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rg5 = 0 >>> 0; +>rg5 : Symbol(rg5, Decl(arithmeticOperatorWithAnyAndNumber.ts, 68, 3)) + +var rg6 = b >>> 0; +>rg6 : Symbol(rg6, Decl(arithmeticOperatorWithAnyAndNumber.ts, 69, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rg7 = 0 >>> b; +>rg7 : Symbol(rg7, Decl(arithmeticOperatorWithAnyAndNumber.ts, 70, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rg8 = b >>> b; +>rg8 : Symbol(rg8, Decl(arithmeticOperatorWithAnyAndNumber.ts, 71, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +// operator & +var rh1 = a & a; +>rh1 : Symbol(rh1, Decl(arithmeticOperatorWithAnyAndNumber.ts, 74, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rh2 = a & b; +>rh2 : Symbol(rh2, Decl(arithmeticOperatorWithAnyAndNumber.ts, 75, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rh3 = a & 0; +>rh3 : Symbol(rh3, Decl(arithmeticOperatorWithAnyAndNumber.ts, 76, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rh4 = 0 & a; +>rh4 : Symbol(rh4, Decl(arithmeticOperatorWithAnyAndNumber.ts, 77, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rh5 = 0 & 0; +>rh5 : Symbol(rh5, Decl(arithmeticOperatorWithAnyAndNumber.ts, 78, 3)) + +var rh6 = b & 0; +>rh6 : Symbol(rh6, Decl(arithmeticOperatorWithAnyAndNumber.ts, 79, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rh7 = 0 & b; +>rh7 : Symbol(rh7, Decl(arithmeticOperatorWithAnyAndNumber.ts, 80, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rh8 = b & b; +>rh8 : Symbol(rh8, Decl(arithmeticOperatorWithAnyAndNumber.ts, 81, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +// operator ^ +var ri1 = a ^ a; +>ri1 : Symbol(ri1, Decl(arithmeticOperatorWithAnyAndNumber.ts, 84, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var ri2 = a ^ b; +>ri2 : Symbol(ri2, Decl(arithmeticOperatorWithAnyAndNumber.ts, 85, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var ri3 = a ^ 0; +>ri3 : Symbol(ri3, Decl(arithmeticOperatorWithAnyAndNumber.ts, 86, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var ri4 = 0 ^ a; +>ri4 : Symbol(ri4, Decl(arithmeticOperatorWithAnyAndNumber.ts, 87, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var ri5 = 0 ^ 0; +>ri5 : Symbol(ri5, Decl(arithmeticOperatorWithAnyAndNumber.ts, 88, 3)) + +var ri6 = b ^ 0; +>ri6 : Symbol(ri6, Decl(arithmeticOperatorWithAnyAndNumber.ts, 89, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var ri7 = 0 ^ b; +>ri7 : Symbol(ri7, Decl(arithmeticOperatorWithAnyAndNumber.ts, 90, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var ri8 = b ^ b; +>ri8 : Symbol(ri8, Decl(arithmeticOperatorWithAnyAndNumber.ts, 91, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +// operator | +var rj1 = a | a; +>rj1 : Symbol(rj1, Decl(arithmeticOperatorWithAnyAndNumber.ts, 94, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rj2 = a | b; +>rj2 : Symbol(rj2, Decl(arithmeticOperatorWithAnyAndNumber.ts, 95, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rj3 = a | 0; +>rj3 : Symbol(rj3, Decl(arithmeticOperatorWithAnyAndNumber.ts, 96, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rj4 = 0 | a; +>rj4 : Symbol(rj4, Decl(arithmeticOperatorWithAnyAndNumber.ts, 97, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rj5 = 0 | 0; +>rj5 : Symbol(rj5, Decl(arithmeticOperatorWithAnyAndNumber.ts, 98, 3)) + +var rj6 = b | 0; +>rj6 : Symbol(rj6, Decl(arithmeticOperatorWithAnyAndNumber.ts, 99, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rj7 = 0 | b; +>rj7 : Symbol(rj7, Decl(arithmeticOperatorWithAnyAndNumber.ts, 100, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rj8 = b | b; +>rj8 : Symbol(rj8, Decl(arithmeticOperatorWithAnyAndNumber.ts, 101, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + diff --git a/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.types b/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.types index f0120f328c4..8845a52760d 100644 --- a/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.types +++ b/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.types @@ -22,24 +22,30 @@ var ra3 = a * 0; >ra3 : number >a * 0 : number >a : any +>0 : number var ra4 = 0 * a; >ra4 : number >0 * a : number +>0 : number >a : any var ra5 = 0 * 0; >ra5 : number >0 * 0 : number +>0 : number +>0 : number var ra6 = b * 0; >ra6 : number >b * 0 : number >b : number +>0 : number var ra7 = 0 * b; >ra7 : number >0 * b : number +>0 : number >b : number var ra8 = b * b; @@ -65,24 +71,30 @@ var rb3 = a / 0; >rb3 : number >a / 0 : number >a : any +>0 : number var rb4 = 0 / a; >rb4 : number >0 / a : number +>0 : number >a : any var rb5 = 0 / 0; >rb5 : number >0 / 0 : number +>0 : number +>0 : number var rb6 = b / 0; >rb6 : number >b / 0 : number >b : number +>0 : number var rb7 = 0 / b; >rb7 : number >0 / b : number +>0 : number >b : number var rb8 = b / b; @@ -108,24 +120,30 @@ var rc3 = a % 0; >rc3 : number >a % 0 : number >a : any +>0 : number var rc4 = 0 % a; >rc4 : number >0 % a : number +>0 : number >a : any var rc5 = 0 % 0; >rc5 : number >0 % 0 : number +>0 : number +>0 : number var rc6 = b % 0; >rc6 : number >b % 0 : number >b : number +>0 : number var rc7 = 0 % b; >rc7 : number >0 % b : number +>0 : number >b : number var rc8 = b % b; @@ -151,24 +169,30 @@ var rd3 = a - 0; >rd3 : number >a - 0 : number >a : any +>0 : number var rd4 = 0 - a; >rd4 : number >0 - a : number +>0 : number >a : any var rd5 = 0 - 0; >rd5 : number >0 - 0 : number +>0 : number +>0 : number var rd6 = b - 0; >rd6 : number >b - 0 : number >b : number +>0 : number var rd7 = 0 - b; >rd7 : number >0 - b : number +>0 : number >b : number var rd8 = b - b; @@ -194,24 +218,30 @@ var re3 = a << 0; >re3 : number >a << 0 : number >a : any +>0 : number var re4 = 0 << a; >re4 : number >0 << a : number +>0 : number >a : any var re5 = 0 << 0; >re5 : number >0 << 0 : number +>0 : number +>0 : number var re6 = b << 0; >re6 : number >b << 0 : number >b : number +>0 : number var re7 = 0 << b; >re7 : number >0 << b : number +>0 : number >b : number var re8 = b << b; @@ -237,24 +267,30 @@ var rf3 = a >> 0; >rf3 : number >a >> 0 : number >a : any +>0 : number var rf4 = 0 >> a; >rf4 : number >0 >> a : number +>0 : number >a : any var rf5 = 0 >> 0; >rf5 : number >0 >> 0 : number +>0 : number +>0 : number var rf6 = b >> 0; >rf6 : number >b >> 0 : number >b : number +>0 : number var rf7 = 0 >> b; >rf7 : number >0 >> b : number +>0 : number >b : number var rf8 = b >> b; @@ -280,24 +316,30 @@ var rg3 = a >>> 0; >rg3 : number >a >>> 0 : number >a : any +>0 : number var rg4 = 0 >>> a; >rg4 : number >0 >>> a : number +>0 : number >a : any var rg5 = 0 >>> 0; >rg5 : number >0 >>> 0 : number +>0 : number +>0 : number var rg6 = b >>> 0; >rg6 : number >b >>> 0 : number >b : number +>0 : number var rg7 = 0 >>> b; >rg7 : number >0 >>> b : number +>0 : number >b : number var rg8 = b >>> b; @@ -323,24 +365,30 @@ var rh3 = a & 0; >rh3 : number >a & 0 : number >a : any +>0 : number var rh4 = 0 & a; >rh4 : number >0 & a : number +>0 : number >a : any var rh5 = 0 & 0; >rh5 : number >0 & 0 : number +>0 : number +>0 : number var rh6 = b & 0; >rh6 : number >b & 0 : number >b : number +>0 : number var rh7 = 0 & b; >rh7 : number >0 & b : number +>0 : number >b : number var rh8 = b & b; @@ -366,24 +414,30 @@ var ri3 = a ^ 0; >ri3 : number >a ^ 0 : number >a : any +>0 : number var ri4 = 0 ^ a; >ri4 : number >0 ^ a : number +>0 : number >a : any var ri5 = 0 ^ 0; >ri5 : number >0 ^ 0 : number +>0 : number +>0 : number var ri6 = b ^ 0; >ri6 : number >b ^ 0 : number >b : number +>0 : number var ri7 = 0 ^ b; >ri7 : number >0 ^ b : number +>0 : number >b : number var ri8 = b ^ b; @@ -409,24 +463,30 @@ var rj3 = a | 0; >rj3 : number >a | 0 : number >a : any +>0 : number var rj4 = 0 | a; >rj4 : number >0 | a : number +>0 : number >a : any var rj5 = 0 | 0; >rj5 : number >0 | 0 : number +>0 : number +>0 : number var rj6 = b | 0; >rj6 : number >b | 0 : number >b : number +>0 : number var rj7 = 0 | b; >rj7 : number >0 | b : number +>0 : number >b : number var rj8 = b | b; diff --git a/tests/baselines/reference/arithmeticOperatorWithEnum.symbols b/tests/baselines/reference/arithmeticOperatorWithEnum.symbols new file mode 100644 index 00000000000..066f429a181 --- /dev/null +++ b/tests/baselines/reference/arithmeticOperatorWithEnum.symbols @@ -0,0 +1,773 @@ +=== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithEnum.ts === +// operands of an enum type are treated as having the primitive type Number. + +enum E { +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) + + a, +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) + + b +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +} + +var a: any; +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var b: number; +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var c: E; +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) + +// operator * +var ra1 = c * a; +>ra1 : Symbol(ra1, Decl(arithmeticOperatorWithEnum.ts, 12, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var ra2 = c * b; +>ra2 : Symbol(ra2, Decl(arithmeticOperatorWithEnum.ts, 13, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var ra3 = c * c; +>ra3 : Symbol(ra3, Decl(arithmeticOperatorWithEnum.ts, 14, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var ra4 = a * c; +>ra4 : Symbol(ra4, Decl(arithmeticOperatorWithEnum.ts, 15, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var ra5 = b * c; +>ra5 : Symbol(ra5, Decl(arithmeticOperatorWithEnum.ts, 16, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var ra6 = E.a * a; +>ra6 : Symbol(ra6, Decl(arithmeticOperatorWithEnum.ts, 17, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var ra7 = E.a * b; +>ra7 : Symbol(ra7, Decl(arithmeticOperatorWithEnum.ts, 18, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var ra8 = E.a * E.b; +>ra8 : Symbol(ra8, Decl(arithmeticOperatorWithEnum.ts, 19, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var ra9 = E.a * 1; +>ra9 : Symbol(ra9, Decl(arithmeticOperatorWithEnum.ts, 20, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) + +var ra10 = a * E.b; +>ra10 : Symbol(ra10, Decl(arithmeticOperatorWithEnum.ts, 21, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var ra11 = b * E.b; +>ra11 : Symbol(ra11, Decl(arithmeticOperatorWithEnum.ts, 22, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var ra12 = 1 * E.b; +>ra12 : Symbol(ra12, Decl(arithmeticOperatorWithEnum.ts, 23, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +// operator / +var rb1 = c / a; +>rb1 : Symbol(rb1, Decl(arithmeticOperatorWithEnum.ts, 26, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rb2 = c / b; +>rb2 : Symbol(rb2, Decl(arithmeticOperatorWithEnum.ts, 27, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rb3 = c / c; +>rb3 : Symbol(rb3, Decl(arithmeticOperatorWithEnum.ts, 28, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rb4 = a / c; +>rb4 : Symbol(rb4, Decl(arithmeticOperatorWithEnum.ts, 29, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rb5 = b / c; +>rb5 : Symbol(rb5, Decl(arithmeticOperatorWithEnum.ts, 30, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rb6 = E.a / a; +>rb6 : Symbol(rb6, Decl(arithmeticOperatorWithEnum.ts, 31, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rb7 = E.a / b; +>rb7 : Symbol(rb7, Decl(arithmeticOperatorWithEnum.ts, 32, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rb8 = E.a / E.b; +>rb8 : Symbol(rb8, Decl(arithmeticOperatorWithEnum.ts, 33, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rb9 = E.a / 1; +>rb9 : Symbol(rb9, Decl(arithmeticOperatorWithEnum.ts, 34, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) + +var rb10 = a / E.b; +>rb10 : Symbol(rb10, Decl(arithmeticOperatorWithEnum.ts, 35, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rb11 = b / E.b; +>rb11 : Symbol(rb11, Decl(arithmeticOperatorWithEnum.ts, 36, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rb12 = 1 / E.b; +>rb12 : Symbol(rb12, Decl(arithmeticOperatorWithEnum.ts, 37, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +// operator % +var rc1 = c % a; +>rc1 : Symbol(rc1, Decl(arithmeticOperatorWithEnum.ts, 40, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rc2 = c % b; +>rc2 : Symbol(rc2, Decl(arithmeticOperatorWithEnum.ts, 41, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rc3 = c % c; +>rc3 : Symbol(rc3, Decl(arithmeticOperatorWithEnum.ts, 42, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rc4 = a % c; +>rc4 : Symbol(rc4, Decl(arithmeticOperatorWithEnum.ts, 43, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rc5 = b % c; +>rc5 : Symbol(rc5, Decl(arithmeticOperatorWithEnum.ts, 44, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rc6 = E.a % a; +>rc6 : Symbol(rc6, Decl(arithmeticOperatorWithEnum.ts, 45, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rc7 = E.a % b; +>rc7 : Symbol(rc7, Decl(arithmeticOperatorWithEnum.ts, 46, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rc8 = E.a % E.b; +>rc8 : Symbol(rc8, Decl(arithmeticOperatorWithEnum.ts, 47, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rc9 = E.a % 1; +>rc9 : Symbol(rc9, Decl(arithmeticOperatorWithEnum.ts, 48, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) + +var rc10 = a % E.b; +>rc10 : Symbol(rc10, Decl(arithmeticOperatorWithEnum.ts, 49, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rc11 = b % E.b; +>rc11 : Symbol(rc11, Decl(arithmeticOperatorWithEnum.ts, 50, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rc12 = 1 % E.b; +>rc12 : Symbol(rc12, Decl(arithmeticOperatorWithEnum.ts, 51, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +// operator - +var rd1 = c - a; +>rd1 : Symbol(rd1, Decl(arithmeticOperatorWithEnum.ts, 54, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rd2 = c - b; +>rd2 : Symbol(rd2, Decl(arithmeticOperatorWithEnum.ts, 55, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rd3 = c - c; +>rd3 : Symbol(rd3, Decl(arithmeticOperatorWithEnum.ts, 56, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rd4 = a - c; +>rd4 : Symbol(rd4, Decl(arithmeticOperatorWithEnum.ts, 57, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rd5 = b - c; +>rd5 : Symbol(rd5, Decl(arithmeticOperatorWithEnum.ts, 58, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rd6 = E.a - a; +>rd6 : Symbol(rd6, Decl(arithmeticOperatorWithEnum.ts, 59, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rd7 = E.a - b; +>rd7 : Symbol(rd7, Decl(arithmeticOperatorWithEnum.ts, 60, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rd8 = E.a - E.b; +>rd8 : Symbol(rd8, Decl(arithmeticOperatorWithEnum.ts, 61, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rd9 = E.a - 1; +>rd9 : Symbol(rd9, Decl(arithmeticOperatorWithEnum.ts, 62, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) + +var rd10 = a - E.b; +>rd10 : Symbol(rd10, Decl(arithmeticOperatorWithEnum.ts, 63, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rd11 = b - E.b; +>rd11 : Symbol(rd11, Decl(arithmeticOperatorWithEnum.ts, 64, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rd12 = 1 - E.b; +>rd12 : Symbol(rd12, Decl(arithmeticOperatorWithEnum.ts, 65, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +// operator << +var re1 = c << a; +>re1 : Symbol(re1, Decl(arithmeticOperatorWithEnum.ts, 68, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var re2 = c << b; +>re2 : Symbol(re2, Decl(arithmeticOperatorWithEnum.ts, 69, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var re3 = c << c; +>re3 : Symbol(re3, Decl(arithmeticOperatorWithEnum.ts, 70, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var re4 = a << c; +>re4 : Symbol(re4, Decl(arithmeticOperatorWithEnum.ts, 71, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var re5 = b << c; +>re5 : Symbol(re5, Decl(arithmeticOperatorWithEnum.ts, 72, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var re6 = E.a << a; +>re6 : Symbol(re6, Decl(arithmeticOperatorWithEnum.ts, 73, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var re7 = E.a << b; +>re7 : Symbol(re7, Decl(arithmeticOperatorWithEnum.ts, 74, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var re8 = E.a << E.b; +>re8 : Symbol(re8, Decl(arithmeticOperatorWithEnum.ts, 75, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var re9 = E.a << 1; +>re9 : Symbol(re9, Decl(arithmeticOperatorWithEnum.ts, 76, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) + +var re10 = a << E.b; +>re10 : Symbol(re10, Decl(arithmeticOperatorWithEnum.ts, 77, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var re11 = b << E.b; +>re11 : Symbol(re11, Decl(arithmeticOperatorWithEnum.ts, 78, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var re12 = 1 << E.b; +>re12 : Symbol(re12, Decl(arithmeticOperatorWithEnum.ts, 79, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +// operator >> +var rf1 = c >> a; +>rf1 : Symbol(rf1, Decl(arithmeticOperatorWithEnum.ts, 82, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rf2 = c >> b; +>rf2 : Symbol(rf2, Decl(arithmeticOperatorWithEnum.ts, 83, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rf3 = c >> c; +>rf3 : Symbol(rf3, Decl(arithmeticOperatorWithEnum.ts, 84, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rf4 = a >> c; +>rf4 : Symbol(rf4, Decl(arithmeticOperatorWithEnum.ts, 85, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rf5 = b >> c; +>rf5 : Symbol(rf5, Decl(arithmeticOperatorWithEnum.ts, 86, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rf6 = E.a >> a; +>rf6 : Symbol(rf6, Decl(arithmeticOperatorWithEnum.ts, 87, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rf7 = E.a >> b; +>rf7 : Symbol(rf7, Decl(arithmeticOperatorWithEnum.ts, 88, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rf8 = E.a >> E.b; +>rf8 : Symbol(rf8, Decl(arithmeticOperatorWithEnum.ts, 89, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rf9 = E.a >> 1; +>rf9 : Symbol(rf9, Decl(arithmeticOperatorWithEnum.ts, 90, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) + +var rf10 = a >> E.b; +>rf10 : Symbol(rf10, Decl(arithmeticOperatorWithEnum.ts, 91, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rf11 = b >> E.b; +>rf11 : Symbol(rf11, Decl(arithmeticOperatorWithEnum.ts, 92, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rf12 = 1 >> E.b; +>rf12 : Symbol(rf12, Decl(arithmeticOperatorWithEnum.ts, 93, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +// operator >>> +var rg1 = c >>> a; +>rg1 : Symbol(rg1, Decl(arithmeticOperatorWithEnum.ts, 96, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rg2 = c >>> b; +>rg2 : Symbol(rg2, Decl(arithmeticOperatorWithEnum.ts, 97, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rg3 = c >>> c; +>rg3 : Symbol(rg3, Decl(arithmeticOperatorWithEnum.ts, 98, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rg4 = a >>> c; +>rg4 : Symbol(rg4, Decl(arithmeticOperatorWithEnum.ts, 99, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rg5 = b >>> c; +>rg5 : Symbol(rg5, Decl(arithmeticOperatorWithEnum.ts, 100, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rg6 = E.a >>> a; +>rg6 : Symbol(rg6, Decl(arithmeticOperatorWithEnum.ts, 101, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rg7 = E.a >>> b; +>rg7 : Symbol(rg7, Decl(arithmeticOperatorWithEnum.ts, 102, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rg8 = E.a >>> E.b; +>rg8 : Symbol(rg8, Decl(arithmeticOperatorWithEnum.ts, 103, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rg9 = E.a >>> 1; +>rg9 : Symbol(rg9, Decl(arithmeticOperatorWithEnum.ts, 104, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) + +var rg10 = a >>> E.b; +>rg10 : Symbol(rg10, Decl(arithmeticOperatorWithEnum.ts, 105, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rg11 = b >>> E.b; +>rg11 : Symbol(rg11, Decl(arithmeticOperatorWithEnum.ts, 106, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rg12 = 1 >>> E.b; +>rg12 : Symbol(rg12, Decl(arithmeticOperatorWithEnum.ts, 107, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +// operator & +var rh1 = c & a; +>rh1 : Symbol(rh1, Decl(arithmeticOperatorWithEnum.ts, 110, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rh2 = c & b; +>rh2 : Symbol(rh2, Decl(arithmeticOperatorWithEnum.ts, 111, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rh3 = c & c; +>rh3 : Symbol(rh3, Decl(arithmeticOperatorWithEnum.ts, 112, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rh4 = a & c; +>rh4 : Symbol(rh4, Decl(arithmeticOperatorWithEnum.ts, 113, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rh5 = b & c; +>rh5 : Symbol(rh5, Decl(arithmeticOperatorWithEnum.ts, 114, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rh6 = E.a & a; +>rh6 : Symbol(rh6, Decl(arithmeticOperatorWithEnum.ts, 115, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rh7 = E.a & b; +>rh7 : Symbol(rh7, Decl(arithmeticOperatorWithEnum.ts, 116, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rh8 = E.a & E.b; +>rh8 : Symbol(rh8, Decl(arithmeticOperatorWithEnum.ts, 117, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rh9 = E.a & 1; +>rh9 : Symbol(rh9, Decl(arithmeticOperatorWithEnum.ts, 118, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) + +var rh10 = a & E.b; +>rh10 : Symbol(rh10, Decl(arithmeticOperatorWithEnum.ts, 119, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rh11 = b & E.b; +>rh11 : Symbol(rh11, Decl(arithmeticOperatorWithEnum.ts, 120, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rh12 = 1 & E.b; +>rh12 : Symbol(rh12, Decl(arithmeticOperatorWithEnum.ts, 121, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +// operator ^ +var ri1 = c ^ a; +>ri1 : Symbol(ri1, Decl(arithmeticOperatorWithEnum.ts, 124, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var ri2 = c ^ b; +>ri2 : Symbol(ri2, Decl(arithmeticOperatorWithEnum.ts, 125, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var ri3 = c ^ c; +>ri3 : Symbol(ri3, Decl(arithmeticOperatorWithEnum.ts, 126, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var ri4 = a ^ c; +>ri4 : Symbol(ri4, Decl(arithmeticOperatorWithEnum.ts, 127, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var ri5 = b ^ c; +>ri5 : Symbol(ri5, Decl(arithmeticOperatorWithEnum.ts, 128, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var ri6 = E.a ^ a; +>ri6 : Symbol(ri6, Decl(arithmeticOperatorWithEnum.ts, 129, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var ri7 = E.a ^ b; +>ri7 : Symbol(ri7, Decl(arithmeticOperatorWithEnum.ts, 130, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var ri8 = E.a ^ E.b; +>ri8 : Symbol(ri8, Decl(arithmeticOperatorWithEnum.ts, 131, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var ri9 = E.a ^ 1; +>ri9 : Symbol(ri9, Decl(arithmeticOperatorWithEnum.ts, 132, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) + +var ri10 = a ^ E.b; +>ri10 : Symbol(ri10, Decl(arithmeticOperatorWithEnum.ts, 133, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var ri11 = b ^ E.b; +>ri11 : Symbol(ri11, Decl(arithmeticOperatorWithEnum.ts, 134, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var ri12 = 1 ^ E.b; +>ri12 : Symbol(ri12, Decl(arithmeticOperatorWithEnum.ts, 135, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +// operator | +var rj1 = c | a; +>rj1 : Symbol(rj1, Decl(arithmeticOperatorWithEnum.ts, 138, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rj2 = c | b; +>rj2 : Symbol(rj2, Decl(arithmeticOperatorWithEnum.ts, 139, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rj3 = c | c; +>rj3 : Symbol(rj3, Decl(arithmeticOperatorWithEnum.ts, 140, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rj4 = a | c; +>rj4 : Symbol(rj4, Decl(arithmeticOperatorWithEnum.ts, 141, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rj5 = b | c; +>rj5 : Symbol(rj5, Decl(arithmeticOperatorWithEnum.ts, 142, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rj6 = E.a | a; +>rj6 : Symbol(rj6, Decl(arithmeticOperatorWithEnum.ts, 143, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rj7 = E.a | b; +>rj7 : Symbol(rj7, Decl(arithmeticOperatorWithEnum.ts, 144, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rj8 = E.a | E.b; +>rj8 : Symbol(rj8, Decl(arithmeticOperatorWithEnum.ts, 145, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rj9 = E.a | 1; +>rj9 : Symbol(rj9, Decl(arithmeticOperatorWithEnum.ts, 146, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) + +var rj10 = a | E.b; +>rj10 : Symbol(rj10, Decl(arithmeticOperatorWithEnum.ts, 147, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rj11 = b | E.b; +>rj11 : Symbol(rj11, Decl(arithmeticOperatorWithEnum.ts, 148, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rj12 = 1 | E.b; +>rj12 : Symbol(rj12, Decl(arithmeticOperatorWithEnum.ts, 149, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + diff --git a/tests/baselines/reference/arithmeticOperatorWithEnum.types b/tests/baselines/reference/arithmeticOperatorWithEnum.types index 2f4ebce8f32..3aca5c31798 100644 --- a/tests/baselines/reference/arithmeticOperatorWithEnum.types +++ b/tests/baselines/reference/arithmeticOperatorWithEnum.types @@ -84,6 +84,7 @@ var ra9 = E.a * 1; >E.a : E >E : typeof E >a : E +>1 : number var ra10 = a * E.b; >ra10 : number @@ -104,6 +105,7 @@ var ra11 = b * E.b; var ra12 = 1 * E.b; >ra12 : number >1 * E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -171,6 +173,7 @@ var rb9 = E.a / 1; >E.a : E >E : typeof E >a : E +>1 : number var rb10 = a / E.b; >rb10 : number @@ -191,6 +194,7 @@ var rb11 = b / E.b; var rb12 = 1 / E.b; >rb12 : number >1 / E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -258,6 +262,7 @@ var rc9 = E.a % 1; >E.a : E >E : typeof E >a : E +>1 : number var rc10 = a % E.b; >rc10 : number @@ -278,6 +283,7 @@ var rc11 = b % E.b; var rc12 = 1 % E.b; >rc12 : number >1 % E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -345,6 +351,7 @@ var rd9 = E.a - 1; >E.a : E >E : typeof E >a : E +>1 : number var rd10 = a - E.b; >rd10 : number @@ -365,6 +372,7 @@ var rd11 = b - E.b; var rd12 = 1 - E.b; >rd12 : number >1 - E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -432,6 +440,7 @@ var re9 = E.a << 1; >E.a : E >E : typeof E >a : E +>1 : number var re10 = a << E.b; >re10 : number @@ -452,6 +461,7 @@ var re11 = b << E.b; var re12 = 1 << E.b; >re12 : number >1 << E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -519,6 +529,7 @@ var rf9 = E.a >> 1; >E.a : E >E : typeof E >a : E +>1 : number var rf10 = a >> E.b; >rf10 : number @@ -539,6 +550,7 @@ var rf11 = b >> E.b; var rf12 = 1 >> E.b; >rf12 : number >1 >> E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -606,6 +618,7 @@ var rg9 = E.a >>> 1; >E.a : E >E : typeof E >a : E +>1 : number var rg10 = a >>> E.b; >rg10 : number @@ -626,6 +639,7 @@ var rg11 = b >>> E.b; var rg12 = 1 >>> E.b; >rg12 : number >1 >>> E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -693,6 +707,7 @@ var rh9 = E.a & 1; >E.a : E >E : typeof E >a : E +>1 : number var rh10 = a & E.b; >rh10 : number @@ -713,6 +728,7 @@ var rh11 = b & E.b; var rh12 = 1 & E.b; >rh12 : number >1 & E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -780,6 +796,7 @@ var ri9 = E.a ^ 1; >E.a : E >E : typeof E >a : E +>1 : number var ri10 = a ^ E.b; >ri10 : number @@ -800,6 +817,7 @@ var ri11 = b ^ E.b; var ri12 = 1 ^ E.b; >ri12 : number >1 ^ E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -867,6 +885,7 @@ var rj9 = E.a | 1; >E.a : E >E : typeof E >a : E +>1 : number var rj10 = a | E.b; >rj10 : number @@ -887,6 +906,7 @@ var rj11 = b | E.b; var rj12 = 1 | E.b; >rj12 : number >1 | E.b : number +>1 : number >E.b : E >E : typeof E >b : E diff --git a/tests/baselines/reference/arithmeticOperatorWithEnumUnion.symbols b/tests/baselines/reference/arithmeticOperatorWithEnumUnion.symbols new file mode 100644 index 00000000000..0fa9a5b8fe3 --- /dev/null +++ b/tests/baselines/reference/arithmeticOperatorWithEnumUnion.symbols @@ -0,0 +1,783 @@ +=== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithEnumUnion.ts === +// operands of an enum type are treated as having the primitive type Number. + +enum E { +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) + + a, +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) + + b +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +} +enum F { +>F : Symbol(F, Decl(arithmeticOperatorWithEnumUnion.ts, 5, 1)) + + c, +>c : Symbol(F.c, Decl(arithmeticOperatorWithEnumUnion.ts, 6, 8)) + + d +>d : Symbol(F.d, Decl(arithmeticOperatorWithEnumUnion.ts, 7, 6)) +} + +var a: any; +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var b: number; +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var c: E | F; +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>F : Symbol(F, Decl(arithmeticOperatorWithEnumUnion.ts, 5, 1)) + +// operator * +var ra1 = c * a; +>ra1 : Symbol(ra1, Decl(arithmeticOperatorWithEnumUnion.ts, 16, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var ra2 = c * b; +>ra2 : Symbol(ra2, Decl(arithmeticOperatorWithEnumUnion.ts, 17, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var ra3 = c * c; +>ra3 : Symbol(ra3, Decl(arithmeticOperatorWithEnumUnion.ts, 18, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var ra4 = a * c; +>ra4 : Symbol(ra4, Decl(arithmeticOperatorWithEnumUnion.ts, 19, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var ra5 = b * c; +>ra5 : Symbol(ra5, Decl(arithmeticOperatorWithEnumUnion.ts, 20, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var ra6 = E.a * a; +>ra6 : Symbol(ra6, Decl(arithmeticOperatorWithEnumUnion.ts, 21, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var ra7 = E.a * b; +>ra7 : Symbol(ra7, Decl(arithmeticOperatorWithEnumUnion.ts, 22, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var ra8 = E.a * E.b; +>ra8 : Symbol(ra8, Decl(arithmeticOperatorWithEnumUnion.ts, 23, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var ra9 = E.a * 1; +>ra9 : Symbol(ra9, Decl(arithmeticOperatorWithEnumUnion.ts, 24, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) + +var ra10 = a * E.b; +>ra10 : Symbol(ra10, Decl(arithmeticOperatorWithEnumUnion.ts, 25, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var ra11 = b * E.b; +>ra11 : Symbol(ra11, Decl(arithmeticOperatorWithEnumUnion.ts, 26, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var ra12 = 1 * E.b; +>ra12 : Symbol(ra12, Decl(arithmeticOperatorWithEnumUnion.ts, 27, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +// operator / +var rb1 = c / a; +>rb1 : Symbol(rb1, Decl(arithmeticOperatorWithEnumUnion.ts, 30, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rb2 = c / b; +>rb2 : Symbol(rb2, Decl(arithmeticOperatorWithEnumUnion.ts, 31, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rb3 = c / c; +>rb3 : Symbol(rb3, Decl(arithmeticOperatorWithEnumUnion.ts, 32, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rb4 = a / c; +>rb4 : Symbol(rb4, Decl(arithmeticOperatorWithEnumUnion.ts, 33, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rb5 = b / c; +>rb5 : Symbol(rb5, Decl(arithmeticOperatorWithEnumUnion.ts, 34, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rb6 = E.a / a; +>rb6 : Symbol(rb6, Decl(arithmeticOperatorWithEnumUnion.ts, 35, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rb7 = E.a / b; +>rb7 : Symbol(rb7, Decl(arithmeticOperatorWithEnumUnion.ts, 36, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rb8 = E.a / E.b; +>rb8 : Symbol(rb8, Decl(arithmeticOperatorWithEnumUnion.ts, 37, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rb9 = E.a / 1; +>rb9 : Symbol(rb9, Decl(arithmeticOperatorWithEnumUnion.ts, 38, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) + +var rb10 = a / E.b; +>rb10 : Symbol(rb10, Decl(arithmeticOperatorWithEnumUnion.ts, 39, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rb11 = b / E.b; +>rb11 : Symbol(rb11, Decl(arithmeticOperatorWithEnumUnion.ts, 40, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rb12 = 1 / E.b; +>rb12 : Symbol(rb12, Decl(arithmeticOperatorWithEnumUnion.ts, 41, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +// operator % +var rc1 = c % a; +>rc1 : Symbol(rc1, Decl(arithmeticOperatorWithEnumUnion.ts, 44, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rc2 = c % b; +>rc2 : Symbol(rc2, Decl(arithmeticOperatorWithEnumUnion.ts, 45, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rc3 = c % c; +>rc3 : Symbol(rc3, Decl(arithmeticOperatorWithEnumUnion.ts, 46, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rc4 = a % c; +>rc4 : Symbol(rc4, Decl(arithmeticOperatorWithEnumUnion.ts, 47, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rc5 = b % c; +>rc5 : Symbol(rc5, Decl(arithmeticOperatorWithEnumUnion.ts, 48, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rc6 = E.a % a; +>rc6 : Symbol(rc6, Decl(arithmeticOperatorWithEnumUnion.ts, 49, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rc7 = E.a % b; +>rc7 : Symbol(rc7, Decl(arithmeticOperatorWithEnumUnion.ts, 50, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rc8 = E.a % E.b; +>rc8 : Symbol(rc8, Decl(arithmeticOperatorWithEnumUnion.ts, 51, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rc9 = E.a % 1; +>rc9 : Symbol(rc9, Decl(arithmeticOperatorWithEnumUnion.ts, 52, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) + +var rc10 = a % E.b; +>rc10 : Symbol(rc10, Decl(arithmeticOperatorWithEnumUnion.ts, 53, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rc11 = b % E.b; +>rc11 : Symbol(rc11, Decl(arithmeticOperatorWithEnumUnion.ts, 54, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rc12 = 1 % E.b; +>rc12 : Symbol(rc12, Decl(arithmeticOperatorWithEnumUnion.ts, 55, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +// operator - +var rd1 = c - a; +>rd1 : Symbol(rd1, Decl(arithmeticOperatorWithEnumUnion.ts, 58, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rd2 = c - b; +>rd2 : Symbol(rd2, Decl(arithmeticOperatorWithEnumUnion.ts, 59, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rd3 = c - c; +>rd3 : Symbol(rd3, Decl(arithmeticOperatorWithEnumUnion.ts, 60, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rd4 = a - c; +>rd4 : Symbol(rd4, Decl(arithmeticOperatorWithEnumUnion.ts, 61, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rd5 = b - c; +>rd5 : Symbol(rd5, Decl(arithmeticOperatorWithEnumUnion.ts, 62, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rd6 = E.a - a; +>rd6 : Symbol(rd6, Decl(arithmeticOperatorWithEnumUnion.ts, 63, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rd7 = E.a - b; +>rd7 : Symbol(rd7, Decl(arithmeticOperatorWithEnumUnion.ts, 64, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rd8 = E.a - E.b; +>rd8 : Symbol(rd8, Decl(arithmeticOperatorWithEnumUnion.ts, 65, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rd9 = E.a - 1; +>rd9 : Symbol(rd9, Decl(arithmeticOperatorWithEnumUnion.ts, 66, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) + +var rd10 = a - E.b; +>rd10 : Symbol(rd10, Decl(arithmeticOperatorWithEnumUnion.ts, 67, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rd11 = b - E.b; +>rd11 : Symbol(rd11, Decl(arithmeticOperatorWithEnumUnion.ts, 68, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rd12 = 1 - E.b; +>rd12 : Symbol(rd12, Decl(arithmeticOperatorWithEnumUnion.ts, 69, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +// operator << +var re1 = c << a; +>re1 : Symbol(re1, Decl(arithmeticOperatorWithEnumUnion.ts, 72, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var re2 = c << b; +>re2 : Symbol(re2, Decl(arithmeticOperatorWithEnumUnion.ts, 73, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var re3 = c << c; +>re3 : Symbol(re3, Decl(arithmeticOperatorWithEnumUnion.ts, 74, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var re4 = a << c; +>re4 : Symbol(re4, Decl(arithmeticOperatorWithEnumUnion.ts, 75, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var re5 = b << c; +>re5 : Symbol(re5, Decl(arithmeticOperatorWithEnumUnion.ts, 76, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var re6 = E.a << a; +>re6 : Symbol(re6, Decl(arithmeticOperatorWithEnumUnion.ts, 77, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var re7 = E.a << b; +>re7 : Symbol(re7, Decl(arithmeticOperatorWithEnumUnion.ts, 78, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var re8 = E.a << E.b; +>re8 : Symbol(re8, Decl(arithmeticOperatorWithEnumUnion.ts, 79, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var re9 = E.a << 1; +>re9 : Symbol(re9, Decl(arithmeticOperatorWithEnumUnion.ts, 80, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) + +var re10 = a << E.b; +>re10 : Symbol(re10, Decl(arithmeticOperatorWithEnumUnion.ts, 81, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var re11 = b << E.b; +>re11 : Symbol(re11, Decl(arithmeticOperatorWithEnumUnion.ts, 82, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var re12 = 1 << E.b; +>re12 : Symbol(re12, Decl(arithmeticOperatorWithEnumUnion.ts, 83, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +// operator >> +var rf1 = c >> a; +>rf1 : Symbol(rf1, Decl(arithmeticOperatorWithEnumUnion.ts, 86, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rf2 = c >> b; +>rf2 : Symbol(rf2, Decl(arithmeticOperatorWithEnumUnion.ts, 87, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rf3 = c >> c; +>rf3 : Symbol(rf3, Decl(arithmeticOperatorWithEnumUnion.ts, 88, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rf4 = a >> c; +>rf4 : Symbol(rf4, Decl(arithmeticOperatorWithEnumUnion.ts, 89, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rf5 = b >> c; +>rf5 : Symbol(rf5, Decl(arithmeticOperatorWithEnumUnion.ts, 90, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rf6 = E.a >> a; +>rf6 : Symbol(rf6, Decl(arithmeticOperatorWithEnumUnion.ts, 91, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rf7 = E.a >> b; +>rf7 : Symbol(rf7, Decl(arithmeticOperatorWithEnumUnion.ts, 92, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rf8 = E.a >> E.b; +>rf8 : Symbol(rf8, Decl(arithmeticOperatorWithEnumUnion.ts, 93, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rf9 = E.a >> 1; +>rf9 : Symbol(rf9, Decl(arithmeticOperatorWithEnumUnion.ts, 94, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) + +var rf10 = a >> E.b; +>rf10 : Symbol(rf10, Decl(arithmeticOperatorWithEnumUnion.ts, 95, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rf11 = b >> E.b; +>rf11 : Symbol(rf11, Decl(arithmeticOperatorWithEnumUnion.ts, 96, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rf12 = 1 >> E.b; +>rf12 : Symbol(rf12, Decl(arithmeticOperatorWithEnumUnion.ts, 97, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +// operator >>> +var rg1 = c >>> a; +>rg1 : Symbol(rg1, Decl(arithmeticOperatorWithEnumUnion.ts, 100, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rg2 = c >>> b; +>rg2 : Symbol(rg2, Decl(arithmeticOperatorWithEnumUnion.ts, 101, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rg3 = c >>> c; +>rg3 : Symbol(rg3, Decl(arithmeticOperatorWithEnumUnion.ts, 102, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rg4 = a >>> c; +>rg4 : Symbol(rg4, Decl(arithmeticOperatorWithEnumUnion.ts, 103, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rg5 = b >>> c; +>rg5 : Symbol(rg5, Decl(arithmeticOperatorWithEnumUnion.ts, 104, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rg6 = E.a >>> a; +>rg6 : Symbol(rg6, Decl(arithmeticOperatorWithEnumUnion.ts, 105, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rg7 = E.a >>> b; +>rg7 : Symbol(rg7, Decl(arithmeticOperatorWithEnumUnion.ts, 106, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rg8 = E.a >>> E.b; +>rg8 : Symbol(rg8, Decl(arithmeticOperatorWithEnumUnion.ts, 107, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rg9 = E.a >>> 1; +>rg9 : Symbol(rg9, Decl(arithmeticOperatorWithEnumUnion.ts, 108, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) + +var rg10 = a >>> E.b; +>rg10 : Symbol(rg10, Decl(arithmeticOperatorWithEnumUnion.ts, 109, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rg11 = b >>> E.b; +>rg11 : Symbol(rg11, Decl(arithmeticOperatorWithEnumUnion.ts, 110, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rg12 = 1 >>> E.b; +>rg12 : Symbol(rg12, Decl(arithmeticOperatorWithEnumUnion.ts, 111, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +// operator & +var rh1 = c & a; +>rh1 : Symbol(rh1, Decl(arithmeticOperatorWithEnumUnion.ts, 114, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rh2 = c & b; +>rh2 : Symbol(rh2, Decl(arithmeticOperatorWithEnumUnion.ts, 115, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rh3 = c & c; +>rh3 : Symbol(rh3, Decl(arithmeticOperatorWithEnumUnion.ts, 116, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rh4 = a & c; +>rh4 : Symbol(rh4, Decl(arithmeticOperatorWithEnumUnion.ts, 117, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rh5 = b & c; +>rh5 : Symbol(rh5, Decl(arithmeticOperatorWithEnumUnion.ts, 118, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rh6 = E.a & a; +>rh6 : Symbol(rh6, Decl(arithmeticOperatorWithEnumUnion.ts, 119, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rh7 = E.a & b; +>rh7 : Symbol(rh7, Decl(arithmeticOperatorWithEnumUnion.ts, 120, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rh8 = E.a & E.b; +>rh8 : Symbol(rh8, Decl(arithmeticOperatorWithEnumUnion.ts, 121, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rh9 = E.a & 1; +>rh9 : Symbol(rh9, Decl(arithmeticOperatorWithEnumUnion.ts, 122, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) + +var rh10 = a & E.b; +>rh10 : Symbol(rh10, Decl(arithmeticOperatorWithEnumUnion.ts, 123, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rh11 = b & E.b; +>rh11 : Symbol(rh11, Decl(arithmeticOperatorWithEnumUnion.ts, 124, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rh12 = 1 & E.b; +>rh12 : Symbol(rh12, Decl(arithmeticOperatorWithEnumUnion.ts, 125, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +// operator ^ +var ri1 = c ^ a; +>ri1 : Symbol(ri1, Decl(arithmeticOperatorWithEnumUnion.ts, 128, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var ri2 = c ^ b; +>ri2 : Symbol(ri2, Decl(arithmeticOperatorWithEnumUnion.ts, 129, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var ri3 = c ^ c; +>ri3 : Symbol(ri3, Decl(arithmeticOperatorWithEnumUnion.ts, 130, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var ri4 = a ^ c; +>ri4 : Symbol(ri4, Decl(arithmeticOperatorWithEnumUnion.ts, 131, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var ri5 = b ^ c; +>ri5 : Symbol(ri5, Decl(arithmeticOperatorWithEnumUnion.ts, 132, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var ri6 = E.a ^ a; +>ri6 : Symbol(ri6, Decl(arithmeticOperatorWithEnumUnion.ts, 133, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var ri7 = E.a ^ b; +>ri7 : Symbol(ri7, Decl(arithmeticOperatorWithEnumUnion.ts, 134, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var ri8 = E.a ^ E.b; +>ri8 : Symbol(ri8, Decl(arithmeticOperatorWithEnumUnion.ts, 135, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var ri9 = E.a ^ 1; +>ri9 : Symbol(ri9, Decl(arithmeticOperatorWithEnumUnion.ts, 136, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) + +var ri10 = a ^ E.b; +>ri10 : Symbol(ri10, Decl(arithmeticOperatorWithEnumUnion.ts, 137, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var ri11 = b ^ E.b; +>ri11 : Symbol(ri11, Decl(arithmeticOperatorWithEnumUnion.ts, 138, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var ri12 = 1 ^ E.b; +>ri12 : Symbol(ri12, Decl(arithmeticOperatorWithEnumUnion.ts, 139, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +// operator | +var rj1 = c | a; +>rj1 : Symbol(rj1, Decl(arithmeticOperatorWithEnumUnion.ts, 142, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rj2 = c | b; +>rj2 : Symbol(rj2, Decl(arithmeticOperatorWithEnumUnion.ts, 143, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rj3 = c | c; +>rj3 : Symbol(rj3, Decl(arithmeticOperatorWithEnumUnion.ts, 144, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rj4 = a | c; +>rj4 : Symbol(rj4, Decl(arithmeticOperatorWithEnumUnion.ts, 145, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rj5 = b | c; +>rj5 : Symbol(rj5, Decl(arithmeticOperatorWithEnumUnion.ts, 146, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rj6 = E.a | a; +>rj6 : Symbol(rj6, Decl(arithmeticOperatorWithEnumUnion.ts, 147, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rj7 = E.a | b; +>rj7 : Symbol(rj7, Decl(arithmeticOperatorWithEnumUnion.ts, 148, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rj8 = E.a | E.b; +>rj8 : Symbol(rj8, Decl(arithmeticOperatorWithEnumUnion.ts, 149, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rj9 = E.a | 1; +>rj9 : Symbol(rj9, Decl(arithmeticOperatorWithEnumUnion.ts, 150, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) + +var rj10 = a | E.b; +>rj10 : Symbol(rj10, Decl(arithmeticOperatorWithEnumUnion.ts, 151, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rj11 = b | E.b; +>rj11 : Symbol(rj11, Decl(arithmeticOperatorWithEnumUnion.ts, 152, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rj12 = 1 | E.b; +>rj12 : Symbol(rj12, Decl(arithmeticOperatorWithEnumUnion.ts, 153, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + diff --git a/tests/baselines/reference/arithmeticOperatorWithEnumUnion.types b/tests/baselines/reference/arithmeticOperatorWithEnumUnion.types index 7b65ddf7f00..cb9bf3d45b0 100644 --- a/tests/baselines/reference/arithmeticOperatorWithEnumUnion.types +++ b/tests/baselines/reference/arithmeticOperatorWithEnumUnion.types @@ -94,6 +94,7 @@ var ra9 = E.a * 1; >E.a : E >E : typeof E >a : E +>1 : number var ra10 = a * E.b; >ra10 : number @@ -114,6 +115,7 @@ var ra11 = b * E.b; var ra12 = 1 * E.b; >ra12 : number >1 * E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -181,6 +183,7 @@ var rb9 = E.a / 1; >E.a : E >E : typeof E >a : E +>1 : number var rb10 = a / E.b; >rb10 : number @@ -201,6 +204,7 @@ var rb11 = b / E.b; var rb12 = 1 / E.b; >rb12 : number >1 / E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -268,6 +272,7 @@ var rc9 = E.a % 1; >E.a : E >E : typeof E >a : E +>1 : number var rc10 = a % E.b; >rc10 : number @@ -288,6 +293,7 @@ var rc11 = b % E.b; var rc12 = 1 % E.b; >rc12 : number >1 % E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -355,6 +361,7 @@ var rd9 = E.a - 1; >E.a : E >E : typeof E >a : E +>1 : number var rd10 = a - E.b; >rd10 : number @@ -375,6 +382,7 @@ var rd11 = b - E.b; var rd12 = 1 - E.b; >rd12 : number >1 - E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -442,6 +450,7 @@ var re9 = E.a << 1; >E.a : E >E : typeof E >a : E +>1 : number var re10 = a << E.b; >re10 : number @@ -462,6 +471,7 @@ var re11 = b << E.b; var re12 = 1 << E.b; >re12 : number >1 << E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -529,6 +539,7 @@ var rf9 = E.a >> 1; >E.a : E >E : typeof E >a : E +>1 : number var rf10 = a >> E.b; >rf10 : number @@ -549,6 +560,7 @@ var rf11 = b >> E.b; var rf12 = 1 >> E.b; >rf12 : number >1 >> E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -616,6 +628,7 @@ var rg9 = E.a >>> 1; >E.a : E >E : typeof E >a : E +>1 : number var rg10 = a >>> E.b; >rg10 : number @@ -636,6 +649,7 @@ var rg11 = b >>> E.b; var rg12 = 1 >>> E.b; >rg12 : number >1 >>> E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -703,6 +717,7 @@ var rh9 = E.a & 1; >E.a : E >E : typeof E >a : E +>1 : number var rh10 = a & E.b; >rh10 : number @@ -723,6 +738,7 @@ var rh11 = b & E.b; var rh12 = 1 & E.b; >rh12 : number >1 & E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -790,6 +806,7 @@ var ri9 = E.a ^ 1; >E.a : E >E : typeof E >a : E +>1 : number var ri10 = a ^ E.b; >ri10 : number @@ -810,6 +827,7 @@ var ri11 = b ^ E.b; var ri12 = 1 ^ E.b; >ri12 : number >1 ^ E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -877,6 +895,7 @@ var rj9 = E.a | 1; >E.a : E >E : typeof E >a : E +>1 : number var rj10 = a | E.b; >rj10 : number @@ -897,6 +916,7 @@ var rj11 = b | E.b; var rj12 = 1 | E.b; >rj12 : number >1 | E.b : number +>1 : number >E.b : E >E : typeof E >b : E diff --git a/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.symbols b/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.symbols new file mode 100644 index 00000000000..fe7e683bb8c --- /dev/null +++ b/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.symbols @@ -0,0 +1,370 @@ +=== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndValidOperands.ts === +// If one operand is the null or undefined value, it is treated as having the type of the +// other operand. + +enum E { +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) + + a, +>a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) + + b +>b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) +} + +var a: any; +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var b: number; +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +// operator * +var ra1 = null * a; +>ra1 : Symbol(ra1, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 12, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var ra2 = null * b; +>ra2 : Symbol(ra2, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 13, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var ra3 = null * 1; +>ra3 : Symbol(ra3, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 14, 3)) + +var ra4 = null * E.a; +>ra4 : Symbol(ra4, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 15, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) + +var ra5 = a * null; +>ra5 : Symbol(ra5, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 16, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var ra6 = b * null; +>ra6 : Symbol(ra6, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 17, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var ra7 = 0 * null; +>ra7 : Symbol(ra7, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 18, 3)) + +var ra8 = E.b * null; +>ra8 : Symbol(ra8, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 19, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) + +// operator / +var rb1 = null / a; +>rb1 : Symbol(rb1, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 22, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rb2 = null / b; +>rb2 : Symbol(rb2, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 23, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rb3 = null / 1; +>rb3 : Symbol(rb3, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 24, 3)) + +var rb4 = null / E.a; +>rb4 : Symbol(rb4, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 25, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) + +var rb5 = a / null; +>rb5 : Symbol(rb5, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 26, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rb6 = b / null; +>rb6 : Symbol(rb6, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 27, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rb7 = 0 / null; +>rb7 : Symbol(rb7, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 28, 3)) + +var rb8 = E.b / null; +>rb8 : Symbol(rb8, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 29, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) + +// operator % +var rc1 = null % a; +>rc1 : Symbol(rc1, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 32, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rc2 = null % b; +>rc2 : Symbol(rc2, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 33, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rc3 = null % 1; +>rc3 : Symbol(rc3, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 34, 3)) + +var rc4 = null % E.a; +>rc4 : Symbol(rc4, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 35, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) + +var rc5 = a % null; +>rc5 : Symbol(rc5, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 36, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rc6 = b % null; +>rc6 : Symbol(rc6, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 37, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rc7 = 0 % null; +>rc7 : Symbol(rc7, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 38, 3)) + +var rc8 = E.b % null; +>rc8 : Symbol(rc8, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 39, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) + +// operator - +var rd1 = null - a; +>rd1 : Symbol(rd1, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 42, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rd2 = null - b; +>rd2 : Symbol(rd2, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 43, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rd3 = null - 1; +>rd3 : Symbol(rd3, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 44, 3)) + +var rd4 = null - E.a; +>rd4 : Symbol(rd4, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 45, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) + +var rd5 = a - null; +>rd5 : Symbol(rd5, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 46, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rd6 = b - null; +>rd6 : Symbol(rd6, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 47, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rd7 = 0 - null; +>rd7 : Symbol(rd7, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 48, 3)) + +var rd8 = E.b - null; +>rd8 : Symbol(rd8, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 49, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) + +// operator << +var re1 = null << a; +>re1 : Symbol(re1, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 52, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var re2 = null << b; +>re2 : Symbol(re2, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 53, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var re3 = null << 1; +>re3 : Symbol(re3, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 54, 3)) + +var re4 = null << E.a; +>re4 : Symbol(re4, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 55, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) + +var re5 = a << null; +>re5 : Symbol(re5, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 56, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var re6 = b << null; +>re6 : Symbol(re6, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 57, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var re7 = 0 << null; +>re7 : Symbol(re7, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 58, 3)) + +var re8 = E.b << null; +>re8 : Symbol(re8, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 59, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) + +// operator >> +var rf1 = null >> a; +>rf1 : Symbol(rf1, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 62, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rf2 = null >> b; +>rf2 : Symbol(rf2, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 63, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rf3 = null >> 1; +>rf3 : Symbol(rf3, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 64, 3)) + +var rf4 = null >> E.a; +>rf4 : Symbol(rf4, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 65, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) + +var rf5 = a >> null; +>rf5 : Symbol(rf5, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 66, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rf6 = b >> null; +>rf6 : Symbol(rf6, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 67, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rf7 = 0 >> null; +>rf7 : Symbol(rf7, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 68, 3)) + +var rf8 = E.b >> null; +>rf8 : Symbol(rf8, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 69, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) + +// operator >>> +var rg1 = null >>> a; +>rg1 : Symbol(rg1, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 72, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rg2 = null >>> b; +>rg2 : Symbol(rg2, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 73, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rg3 = null >>> 1; +>rg3 : Symbol(rg3, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 74, 3)) + +var rg4 = null >>> E.a; +>rg4 : Symbol(rg4, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 75, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) + +var rg5 = a >>> null; +>rg5 : Symbol(rg5, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 76, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rg6 = b >>> null; +>rg6 : Symbol(rg6, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 77, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rg7 = 0 >>> null; +>rg7 : Symbol(rg7, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 78, 3)) + +var rg8 = E.b >>> null; +>rg8 : Symbol(rg8, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 79, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) + +// operator & +var rh1 = null & a; +>rh1 : Symbol(rh1, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 82, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rh2 = null & b; +>rh2 : Symbol(rh2, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 83, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rh3 = null & 1; +>rh3 : Symbol(rh3, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 84, 3)) + +var rh4 = null & E.a; +>rh4 : Symbol(rh4, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 85, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) + +var rh5 = a & null; +>rh5 : Symbol(rh5, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 86, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rh6 = b & null; +>rh6 : Symbol(rh6, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 87, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rh7 = 0 & null; +>rh7 : Symbol(rh7, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 88, 3)) + +var rh8 = E.b & null; +>rh8 : Symbol(rh8, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 89, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) + +// operator ^ +var ri1 = null ^ a; +>ri1 : Symbol(ri1, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 92, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var ri2 = null ^ b; +>ri2 : Symbol(ri2, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 93, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var ri3 = null ^ 1; +>ri3 : Symbol(ri3, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 94, 3)) + +var ri4 = null ^ E.a; +>ri4 : Symbol(ri4, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 95, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) + +var ri5 = a ^ null; +>ri5 : Symbol(ri5, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 96, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var ri6 = b ^ null; +>ri6 : Symbol(ri6, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 97, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var ri7 = 0 ^ null; +>ri7 : Symbol(ri7, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 98, 3)) + +var ri8 = E.b ^ null; +>ri8 : Symbol(ri8, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 99, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) + +// operator | +var rj1 = null | a; +>rj1 : Symbol(rj1, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 102, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rj2 = null | b; +>rj2 : Symbol(rj2, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 103, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rj3 = null | 1; +>rj3 : Symbol(rj3, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 104, 3)) + +var rj4 = null | E.a; +>rj4 : Symbol(rj4, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 105, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) + +var rj5 = a | null; +>rj5 : Symbol(rj5, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 106, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rj6 = b | null; +>rj6 : Symbol(rj6, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 107, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rj7 = 0 | null; +>rj7 : Symbol(rj7, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 108, 3)) + +var rj8 = E.b | null; +>rj8 : Symbol(rj8, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 109, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) + diff --git a/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.types b/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.types index 711ccd0c66c..521fb4d7313 100644 --- a/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.types +++ b/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.types @@ -22,20 +22,25 @@ var b: number; var ra1 = null * a; >ra1 : number >null * a : number +>null : null >a : any var ra2 = null * b; >ra2 : number >null * b : number +>null : null >b : number var ra3 = null * 1; >ra3 : number >null * 1 : number +>null : null +>1 : number var ra4 = null * E.a; >ra4 : number >null * E.a : number +>null : null >E.a : E >E : typeof E >a : E @@ -44,15 +49,19 @@ var ra5 = a * null; >ra5 : number >a * null : number >a : any +>null : null var ra6 = b * null; >ra6 : number >b * null : number >b : number +>null : null var ra7 = 0 * null; >ra7 : number >0 * null : number +>0 : number +>null : null var ra8 = E.b * null; >ra8 : number @@ -60,25 +69,31 @@ var ra8 = E.b * null; >E.b : E >E : typeof E >b : E +>null : null // operator / var rb1 = null / a; >rb1 : number >null / a : number +>null : null >a : any var rb2 = null / b; >rb2 : number >null / b : number +>null : null >b : number var rb3 = null / 1; >rb3 : number >null / 1 : number +>null : null +>1 : number var rb4 = null / E.a; >rb4 : number >null / E.a : number +>null : null >E.a : E >E : typeof E >a : E @@ -87,15 +102,19 @@ var rb5 = a / null; >rb5 : number >a / null : number >a : any +>null : null var rb6 = b / null; >rb6 : number >b / null : number >b : number +>null : null var rb7 = 0 / null; >rb7 : number >0 / null : number +>0 : number +>null : null var rb8 = E.b / null; >rb8 : number @@ -103,25 +122,31 @@ var rb8 = E.b / null; >E.b : E >E : typeof E >b : E +>null : null // operator % var rc1 = null % a; >rc1 : number >null % a : number +>null : null >a : any var rc2 = null % b; >rc2 : number >null % b : number +>null : null >b : number var rc3 = null % 1; >rc3 : number >null % 1 : number +>null : null +>1 : number var rc4 = null % E.a; >rc4 : number >null % E.a : number +>null : null >E.a : E >E : typeof E >a : E @@ -130,15 +155,19 @@ var rc5 = a % null; >rc5 : number >a % null : number >a : any +>null : null var rc6 = b % null; >rc6 : number >b % null : number >b : number +>null : null var rc7 = 0 % null; >rc7 : number >0 % null : number +>0 : number +>null : null var rc8 = E.b % null; >rc8 : number @@ -146,25 +175,31 @@ var rc8 = E.b % null; >E.b : E >E : typeof E >b : E +>null : null // operator - var rd1 = null - a; >rd1 : number >null - a : number +>null : null >a : any var rd2 = null - b; >rd2 : number >null - b : number +>null : null >b : number var rd3 = null - 1; >rd3 : number >null - 1 : number +>null : null +>1 : number var rd4 = null - E.a; >rd4 : number >null - E.a : number +>null : null >E.a : E >E : typeof E >a : E @@ -173,15 +208,19 @@ var rd5 = a - null; >rd5 : number >a - null : number >a : any +>null : null var rd6 = b - null; >rd6 : number >b - null : number >b : number +>null : null var rd7 = 0 - null; >rd7 : number >0 - null : number +>0 : number +>null : null var rd8 = E.b - null; >rd8 : number @@ -189,25 +228,31 @@ var rd8 = E.b - null; >E.b : E >E : typeof E >b : E +>null : null // operator << var re1 = null << a; >re1 : number >null << a : number +>null : null >a : any var re2 = null << b; >re2 : number >null << b : number +>null : null >b : number var re3 = null << 1; >re3 : number >null << 1 : number +>null : null +>1 : number var re4 = null << E.a; >re4 : number >null << E.a : number +>null : null >E.a : E >E : typeof E >a : E @@ -216,15 +261,19 @@ var re5 = a << null; >re5 : number >a << null : number >a : any +>null : null var re6 = b << null; >re6 : number >b << null : number >b : number +>null : null var re7 = 0 << null; >re7 : number >0 << null : number +>0 : number +>null : null var re8 = E.b << null; >re8 : number @@ -232,25 +281,31 @@ var re8 = E.b << null; >E.b : E >E : typeof E >b : E +>null : null // operator >> var rf1 = null >> a; >rf1 : number >null >> a : number +>null : null >a : any var rf2 = null >> b; >rf2 : number >null >> b : number +>null : null >b : number var rf3 = null >> 1; >rf3 : number >null >> 1 : number +>null : null +>1 : number var rf4 = null >> E.a; >rf4 : number >null >> E.a : number +>null : null >E.a : E >E : typeof E >a : E @@ -259,15 +314,19 @@ var rf5 = a >> null; >rf5 : number >a >> null : number >a : any +>null : null var rf6 = b >> null; >rf6 : number >b >> null : number >b : number +>null : null var rf7 = 0 >> null; >rf7 : number >0 >> null : number +>0 : number +>null : null var rf8 = E.b >> null; >rf8 : number @@ -275,25 +334,31 @@ var rf8 = E.b >> null; >E.b : E >E : typeof E >b : E +>null : null // operator >>> var rg1 = null >>> a; >rg1 : number >null >>> a : number +>null : null >a : any var rg2 = null >>> b; >rg2 : number >null >>> b : number +>null : null >b : number var rg3 = null >>> 1; >rg3 : number >null >>> 1 : number +>null : null +>1 : number var rg4 = null >>> E.a; >rg4 : number >null >>> E.a : number +>null : null >E.a : E >E : typeof E >a : E @@ -302,15 +367,19 @@ var rg5 = a >>> null; >rg5 : number >a >>> null : number >a : any +>null : null var rg6 = b >>> null; >rg6 : number >b >>> null : number >b : number +>null : null var rg7 = 0 >>> null; >rg7 : number >0 >>> null : number +>0 : number +>null : null var rg8 = E.b >>> null; >rg8 : number @@ -318,25 +387,31 @@ var rg8 = E.b >>> null; >E.b : E >E : typeof E >b : E +>null : null // operator & var rh1 = null & a; >rh1 : number >null & a : number +>null : null >a : any var rh2 = null & b; >rh2 : number >null & b : number +>null : null >b : number var rh3 = null & 1; >rh3 : number >null & 1 : number +>null : null +>1 : number var rh4 = null & E.a; >rh4 : number >null & E.a : number +>null : null >E.a : E >E : typeof E >a : E @@ -345,15 +420,19 @@ var rh5 = a & null; >rh5 : number >a & null : number >a : any +>null : null var rh6 = b & null; >rh6 : number >b & null : number >b : number +>null : null var rh7 = 0 & null; >rh7 : number >0 & null : number +>0 : number +>null : null var rh8 = E.b & null; >rh8 : number @@ -361,25 +440,31 @@ var rh8 = E.b & null; >E.b : E >E : typeof E >b : E +>null : null // operator ^ var ri1 = null ^ a; >ri1 : number >null ^ a : number +>null : null >a : any var ri2 = null ^ b; >ri2 : number >null ^ b : number +>null : null >b : number var ri3 = null ^ 1; >ri3 : number >null ^ 1 : number +>null : null +>1 : number var ri4 = null ^ E.a; >ri4 : number >null ^ E.a : number +>null : null >E.a : E >E : typeof E >a : E @@ -388,15 +473,19 @@ var ri5 = a ^ null; >ri5 : number >a ^ null : number >a : any +>null : null var ri6 = b ^ null; >ri6 : number >b ^ null : number >b : number +>null : null var ri7 = 0 ^ null; >ri7 : number >0 ^ null : number +>0 : number +>null : null var ri8 = E.b ^ null; >ri8 : number @@ -404,25 +493,31 @@ var ri8 = E.b ^ null; >E.b : E >E : typeof E >b : E +>null : null // operator | var rj1 = null | a; >rj1 : number >null | a : number +>null : null >a : any var rj2 = null | b; >rj2 : number >null | b : number +>null : null >b : number var rj3 = null | 1; >rj3 : number >null | 1 : number +>null : null +>1 : number var rj4 = null | E.a; >rj4 : number >null | E.a : number +>null : null >E.a : E >E : typeof E >a : E @@ -431,15 +526,19 @@ var rj5 = a | null; >rj5 : number >a | null : number >a : any +>null : null var rj6 = b | null; >rj6 : number >b | null : number >b : number +>null : null var rj7 = 0 | null; >rj7 : number >0 | null : number +>0 : number +>null : null var rj8 = E.b | null; >rj8 : number @@ -447,4 +546,5 @@ var rj8 = E.b | null; >E.b : E >E : typeof E >b : E +>null : null diff --git a/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.symbols b/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.symbols new file mode 100644 index 00000000000..5ba1d7f9728 --- /dev/null +++ b/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.symbols @@ -0,0 +1,450 @@ +=== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndValidOperands.ts === +// If one operand is the undefined or undefined value, it is treated as having the type of the +// other operand. + +enum E { +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) + + a, +>a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) + + b +>b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +} + +var a: any; +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) + +var b: number; +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) + +// operator * +var ra1 = undefined * a; +>ra1 : Symbol(ra1, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 12, 3)) +>undefined : Symbol(undefined) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) + +var ra2 = undefined * b; +>ra2 : Symbol(ra2, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 13, 3)) +>undefined : Symbol(undefined) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) + +var ra3 = undefined * 1; +>ra3 : Symbol(ra3, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 14, 3)) +>undefined : Symbol(undefined) + +var ra4 = undefined * E.a; +>ra4 : Symbol(ra4, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 15, 3)) +>undefined : Symbol(undefined) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) + +var ra5 = a * undefined; +>ra5 : Symbol(ra5, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 16, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) +>undefined : Symbol(undefined) + +var ra6 = b * undefined; +>ra6 : Symbol(ra6, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 17, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) +>undefined : Symbol(undefined) + +var ra7 = 0 * undefined; +>ra7 : Symbol(ra7, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 18, 3)) +>undefined : Symbol(undefined) + +var ra8 = E.b * undefined; +>ra8 : Symbol(ra8, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 19, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>undefined : Symbol(undefined) + +// operator / +var rb1 = undefined / a; +>rb1 : Symbol(rb1, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 22, 3)) +>undefined : Symbol(undefined) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) + +var rb2 = undefined / b; +>rb2 : Symbol(rb2, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 23, 3)) +>undefined : Symbol(undefined) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) + +var rb3 = undefined / 1; +>rb3 : Symbol(rb3, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 24, 3)) +>undefined : Symbol(undefined) + +var rb4 = undefined / E.a; +>rb4 : Symbol(rb4, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 25, 3)) +>undefined : Symbol(undefined) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) + +var rb5 = a / undefined; +>rb5 : Symbol(rb5, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 26, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) +>undefined : Symbol(undefined) + +var rb6 = b / undefined; +>rb6 : Symbol(rb6, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 27, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) +>undefined : Symbol(undefined) + +var rb7 = 0 / undefined; +>rb7 : Symbol(rb7, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 28, 3)) +>undefined : Symbol(undefined) + +var rb8 = E.b / undefined; +>rb8 : Symbol(rb8, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 29, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>undefined : Symbol(undefined) + +// operator % +var rc1 = undefined % a; +>rc1 : Symbol(rc1, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 32, 3)) +>undefined : Symbol(undefined) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) + +var rc2 = undefined % b; +>rc2 : Symbol(rc2, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 33, 3)) +>undefined : Symbol(undefined) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) + +var rc3 = undefined % 1; +>rc3 : Symbol(rc3, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 34, 3)) +>undefined : Symbol(undefined) + +var rc4 = undefined % E.a; +>rc4 : Symbol(rc4, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 35, 3)) +>undefined : Symbol(undefined) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) + +var rc5 = a % undefined; +>rc5 : Symbol(rc5, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 36, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) +>undefined : Symbol(undefined) + +var rc6 = b % undefined; +>rc6 : Symbol(rc6, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 37, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) +>undefined : Symbol(undefined) + +var rc7 = 0 % undefined; +>rc7 : Symbol(rc7, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 38, 3)) +>undefined : Symbol(undefined) + +var rc8 = E.b % undefined; +>rc8 : Symbol(rc8, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 39, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>undefined : Symbol(undefined) + +// operator - +var rd1 = undefined - a; +>rd1 : Symbol(rd1, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 42, 3)) +>undefined : Symbol(undefined) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) + +var rd2 = undefined - b; +>rd2 : Symbol(rd2, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 43, 3)) +>undefined : Symbol(undefined) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) + +var rd3 = undefined - 1; +>rd3 : Symbol(rd3, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 44, 3)) +>undefined : Symbol(undefined) + +var rd4 = undefined - E.a; +>rd4 : Symbol(rd4, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 45, 3)) +>undefined : Symbol(undefined) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) + +var rd5 = a - undefined; +>rd5 : Symbol(rd5, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 46, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) +>undefined : Symbol(undefined) + +var rd6 = b - undefined; +>rd6 : Symbol(rd6, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 47, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) +>undefined : Symbol(undefined) + +var rd7 = 0 - undefined; +>rd7 : Symbol(rd7, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 48, 3)) +>undefined : Symbol(undefined) + +var rd8 = E.b - undefined; +>rd8 : Symbol(rd8, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 49, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>undefined : Symbol(undefined) + +// operator << +var re1 = undefined << a; +>re1 : Symbol(re1, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 52, 3)) +>undefined : Symbol(undefined) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) + +var re2 = undefined << b; +>re2 : Symbol(re2, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 53, 3)) +>undefined : Symbol(undefined) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) + +var re3 = undefined << 1; +>re3 : Symbol(re3, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 54, 3)) +>undefined : Symbol(undefined) + +var re4 = undefined << E.a; +>re4 : Symbol(re4, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 55, 3)) +>undefined : Symbol(undefined) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) + +var re5 = a << undefined; +>re5 : Symbol(re5, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 56, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) +>undefined : Symbol(undefined) + +var re6 = b << undefined; +>re6 : Symbol(re6, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 57, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) +>undefined : Symbol(undefined) + +var re7 = 0 << undefined; +>re7 : Symbol(re7, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 58, 3)) +>undefined : Symbol(undefined) + +var re8 = E.b << undefined; +>re8 : Symbol(re8, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 59, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>undefined : Symbol(undefined) + +// operator >> +var rf1 = undefined >> a; +>rf1 : Symbol(rf1, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 62, 3)) +>undefined : Symbol(undefined) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) + +var rf2 = undefined >> b; +>rf2 : Symbol(rf2, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 63, 3)) +>undefined : Symbol(undefined) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) + +var rf3 = undefined >> 1; +>rf3 : Symbol(rf3, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 64, 3)) +>undefined : Symbol(undefined) + +var rf4 = undefined >> E.a; +>rf4 : Symbol(rf4, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 65, 3)) +>undefined : Symbol(undefined) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) + +var rf5 = a >> undefined; +>rf5 : Symbol(rf5, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 66, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) +>undefined : Symbol(undefined) + +var rf6 = b >> undefined; +>rf6 : Symbol(rf6, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 67, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) +>undefined : Symbol(undefined) + +var rf7 = 0 >> undefined; +>rf7 : Symbol(rf7, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 68, 3)) +>undefined : Symbol(undefined) + +var rf8 = E.b >> undefined; +>rf8 : Symbol(rf8, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 69, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>undefined : Symbol(undefined) + +// operator >>> +var rg1 = undefined >>> a; +>rg1 : Symbol(rg1, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 72, 3)) +>undefined : Symbol(undefined) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) + +var rg2 = undefined >>> b; +>rg2 : Symbol(rg2, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 73, 3)) +>undefined : Symbol(undefined) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) + +var rg3 = undefined >>> 1; +>rg3 : Symbol(rg3, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 74, 3)) +>undefined : Symbol(undefined) + +var rg4 = undefined >>> E.a; +>rg4 : Symbol(rg4, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 75, 3)) +>undefined : Symbol(undefined) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) + +var rg5 = a >>> undefined; +>rg5 : Symbol(rg5, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 76, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) +>undefined : Symbol(undefined) + +var rg6 = b >>> undefined; +>rg6 : Symbol(rg6, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 77, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) +>undefined : Symbol(undefined) + +var rg7 = 0 >>> undefined; +>rg7 : Symbol(rg7, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 78, 3)) +>undefined : Symbol(undefined) + +var rg8 = E.b >>> undefined; +>rg8 : Symbol(rg8, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 79, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>undefined : Symbol(undefined) + +// operator & +var rh1 = undefined & a; +>rh1 : Symbol(rh1, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 82, 3)) +>undefined : Symbol(undefined) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) + +var rh2 = undefined & b; +>rh2 : Symbol(rh2, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 83, 3)) +>undefined : Symbol(undefined) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) + +var rh3 = undefined & 1; +>rh3 : Symbol(rh3, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 84, 3)) +>undefined : Symbol(undefined) + +var rh4 = undefined & E.a; +>rh4 : Symbol(rh4, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 85, 3)) +>undefined : Symbol(undefined) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) + +var rh5 = a & undefined; +>rh5 : Symbol(rh5, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 86, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) +>undefined : Symbol(undefined) + +var rh6 = b & undefined; +>rh6 : Symbol(rh6, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 87, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) +>undefined : Symbol(undefined) + +var rh7 = 0 & undefined; +>rh7 : Symbol(rh7, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 88, 3)) +>undefined : Symbol(undefined) + +var rh8 = E.b & undefined; +>rh8 : Symbol(rh8, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 89, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>undefined : Symbol(undefined) + +// operator ^ +var ri1 = undefined ^ a; +>ri1 : Symbol(ri1, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 92, 3)) +>undefined : Symbol(undefined) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) + +var ri2 = undefined ^ b; +>ri2 : Symbol(ri2, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 93, 3)) +>undefined : Symbol(undefined) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) + +var ri3 = undefined ^ 1; +>ri3 : Symbol(ri3, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 94, 3)) +>undefined : Symbol(undefined) + +var ri4 = undefined ^ E.a; +>ri4 : Symbol(ri4, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 95, 3)) +>undefined : Symbol(undefined) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) + +var ri5 = a ^ undefined; +>ri5 : Symbol(ri5, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 96, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) +>undefined : Symbol(undefined) + +var ri6 = b ^ undefined; +>ri6 : Symbol(ri6, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 97, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) +>undefined : Symbol(undefined) + +var ri7 = 0 ^ undefined; +>ri7 : Symbol(ri7, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 98, 3)) +>undefined : Symbol(undefined) + +var ri8 = E.b ^ undefined; +>ri8 : Symbol(ri8, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 99, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>undefined : Symbol(undefined) + +// operator | +var rj1 = undefined | a; +>rj1 : Symbol(rj1, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 102, 3)) +>undefined : Symbol(undefined) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) + +var rj2 = undefined | b; +>rj2 : Symbol(rj2, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 103, 3)) +>undefined : Symbol(undefined) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) + +var rj3 = undefined | 1; +>rj3 : Symbol(rj3, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 104, 3)) +>undefined : Symbol(undefined) + +var rj4 = undefined | E.a; +>rj4 : Symbol(rj4, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 105, 3)) +>undefined : Symbol(undefined) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) + +var rj5 = a | undefined; +>rj5 : Symbol(rj5, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 106, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) +>undefined : Symbol(undefined) + +var rj6 = b | undefined; +>rj6 : Symbol(rj6, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 107, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) +>undefined : Symbol(undefined) + +var rj7 = 0 | undefined; +>rj7 : Symbol(rj7, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 108, 3)) +>undefined : Symbol(undefined) + +var rj8 = E.b | undefined; +>rj8 : Symbol(rj8, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 109, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.types b/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.types index 7db074df8bb..77dbe1c1441 100644 --- a/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.types +++ b/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.types @@ -35,6 +35,7 @@ var ra3 = undefined * 1; >ra3 : number >undefined * 1 : number >undefined : undefined +>1 : number var ra4 = undefined * E.a; >ra4 : number @@ -59,6 +60,7 @@ var ra6 = b * undefined; var ra7 = 0 * undefined; >ra7 : number >0 * undefined : number +>0 : number >undefined : undefined var ra8 = E.b * undefined; @@ -86,6 +88,7 @@ var rb3 = undefined / 1; >rb3 : number >undefined / 1 : number >undefined : undefined +>1 : number var rb4 = undefined / E.a; >rb4 : number @@ -110,6 +113,7 @@ var rb6 = b / undefined; var rb7 = 0 / undefined; >rb7 : number >0 / undefined : number +>0 : number >undefined : undefined var rb8 = E.b / undefined; @@ -137,6 +141,7 @@ var rc3 = undefined % 1; >rc3 : number >undefined % 1 : number >undefined : undefined +>1 : number var rc4 = undefined % E.a; >rc4 : number @@ -161,6 +166,7 @@ var rc6 = b % undefined; var rc7 = 0 % undefined; >rc7 : number >0 % undefined : number +>0 : number >undefined : undefined var rc8 = E.b % undefined; @@ -188,6 +194,7 @@ var rd3 = undefined - 1; >rd3 : number >undefined - 1 : number >undefined : undefined +>1 : number var rd4 = undefined - E.a; >rd4 : number @@ -212,6 +219,7 @@ var rd6 = b - undefined; var rd7 = 0 - undefined; >rd7 : number >0 - undefined : number +>0 : number >undefined : undefined var rd8 = E.b - undefined; @@ -239,6 +247,7 @@ var re3 = undefined << 1; >re3 : number >undefined << 1 : number >undefined : undefined +>1 : number var re4 = undefined << E.a; >re4 : number @@ -263,6 +272,7 @@ var re6 = b << undefined; var re7 = 0 << undefined; >re7 : number >0 << undefined : number +>0 : number >undefined : undefined var re8 = E.b << undefined; @@ -290,6 +300,7 @@ var rf3 = undefined >> 1; >rf3 : number >undefined >> 1 : number >undefined : undefined +>1 : number var rf4 = undefined >> E.a; >rf4 : number @@ -314,6 +325,7 @@ var rf6 = b >> undefined; var rf7 = 0 >> undefined; >rf7 : number >0 >> undefined : number +>0 : number >undefined : undefined var rf8 = E.b >> undefined; @@ -341,6 +353,7 @@ var rg3 = undefined >>> 1; >rg3 : number >undefined >>> 1 : number >undefined : undefined +>1 : number var rg4 = undefined >>> E.a; >rg4 : number @@ -365,6 +378,7 @@ var rg6 = b >>> undefined; var rg7 = 0 >>> undefined; >rg7 : number >0 >>> undefined : number +>0 : number >undefined : undefined var rg8 = E.b >>> undefined; @@ -392,6 +406,7 @@ var rh3 = undefined & 1; >rh3 : number >undefined & 1 : number >undefined : undefined +>1 : number var rh4 = undefined & E.a; >rh4 : number @@ -416,6 +431,7 @@ var rh6 = b & undefined; var rh7 = 0 & undefined; >rh7 : number >0 & undefined : number +>0 : number >undefined : undefined var rh8 = E.b & undefined; @@ -443,6 +459,7 @@ var ri3 = undefined ^ 1; >ri3 : number >undefined ^ 1 : number >undefined : undefined +>1 : number var ri4 = undefined ^ E.a; >ri4 : number @@ -467,6 +484,7 @@ var ri6 = b ^ undefined; var ri7 = 0 ^ undefined; >ri7 : number >0 ^ undefined : number +>0 : number >undefined : undefined var ri8 = E.b ^ undefined; @@ -494,6 +512,7 @@ var rj3 = undefined | 1; >rj3 : number >undefined | 1 : number >undefined : undefined +>1 : number var rj4 = undefined | E.a; >rj4 : number @@ -518,6 +537,7 @@ var rj6 = b | undefined; var rj7 = 0 | undefined; >rj7 : number >0 | undefined : number +>0 : number >undefined : undefined var rj8 = E.b | undefined; diff --git a/tests/baselines/reference/arrayAssignmentPatternWithAny.js b/tests/baselines/reference/arrayAssignmentPatternWithAny.js new file mode 100644 index 00000000000..c81b5f1f38d --- /dev/null +++ b/tests/baselines/reference/arrayAssignmentPatternWithAny.js @@ -0,0 +1,9 @@ +//// [arrayAssignmentPatternWithAny.ts] +var a: any; +var x: string; +[x] = a; + +//// [arrayAssignmentPatternWithAny.js] +var a; +var x; +x = a[0]; diff --git a/tests/baselines/reference/arrayAssignmentPatternWithAny.symbols b/tests/baselines/reference/arrayAssignmentPatternWithAny.symbols new file mode 100644 index 00000000000..a55febc1422 --- /dev/null +++ b/tests/baselines/reference/arrayAssignmentPatternWithAny.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/es6/destructuring/arrayAssignmentPatternWithAny.ts === +var a: any; +>a : Symbol(a, Decl(arrayAssignmentPatternWithAny.ts, 0, 3)) + +var x: string; +>x : Symbol(x, Decl(arrayAssignmentPatternWithAny.ts, 1, 3)) + +[x] = a; +>x : Symbol(x, Decl(arrayAssignmentPatternWithAny.ts, 1, 3)) +>a : Symbol(a, Decl(arrayAssignmentPatternWithAny.ts, 0, 3)) + diff --git a/tests/baselines/reference/arrayAssignmentPatternWithAny.types b/tests/baselines/reference/arrayAssignmentPatternWithAny.types new file mode 100644 index 00000000000..452fc0737a1 --- /dev/null +++ b/tests/baselines/reference/arrayAssignmentPatternWithAny.types @@ -0,0 +1,13 @@ +=== tests/cases/conformance/es6/destructuring/arrayAssignmentPatternWithAny.ts === +var a: any; +>a : any + +var x: string; +>x : string + +[x] = a; +>[x] = a : any +>[x] : [string] +>x : string +>a : any + diff --git a/tests/baselines/reference/arrayAssignmentTest6.symbols b/tests/baselines/reference/arrayAssignmentTest6.symbols new file mode 100644 index 00000000000..c4d4ba76a5f --- /dev/null +++ b/tests/baselines/reference/arrayAssignmentTest6.symbols @@ -0,0 +1,52 @@ +=== tests/cases/compiler/arrayAssignmentTest6.ts === +module Test { +>Test : Symbol(Test, Decl(arrayAssignmentTest6.ts, 0, 0)) + + interface IState { +>IState : Symbol(IState, Decl(arrayAssignmentTest6.ts, 0, 13)) + } + interface IToken { +>IToken : Symbol(IToken, Decl(arrayAssignmentTest6.ts, 2, 5)) + + startIndex: number; +>startIndex : Symbol(startIndex, Decl(arrayAssignmentTest6.ts, 3, 22)) + } + interface ILineTokens { +>ILineTokens : Symbol(ILineTokens, Decl(arrayAssignmentTest6.ts, 5, 5)) + + tokens: IToken[]; +>tokens : Symbol(tokens, Decl(arrayAssignmentTest6.ts, 6, 27)) +>IToken : Symbol(IToken, Decl(arrayAssignmentTest6.ts, 2, 5)) + + endState: IState; +>endState : Symbol(endState, Decl(arrayAssignmentTest6.ts, 7, 25)) +>IState : Symbol(IState, Decl(arrayAssignmentTest6.ts, 0, 13)) + } + interface IMode { +>IMode : Symbol(IMode, Decl(arrayAssignmentTest6.ts, 9, 5)) + + tokenize(line:string, state:IState, includeStates:boolean):ILineTokens; +>tokenize : Symbol(tokenize, Decl(arrayAssignmentTest6.ts, 10, 21)) +>line : Symbol(line, Decl(arrayAssignmentTest6.ts, 11, 17)) +>state : Symbol(state, Decl(arrayAssignmentTest6.ts, 11, 29)) +>IState : Symbol(IState, Decl(arrayAssignmentTest6.ts, 0, 13)) +>includeStates : Symbol(includeStates, Decl(arrayAssignmentTest6.ts, 11, 43)) +>ILineTokens : Symbol(ILineTokens, Decl(arrayAssignmentTest6.ts, 5, 5)) + } + export class Bug implements IMode { +>Bug : Symbol(Bug, Decl(arrayAssignmentTest6.ts, 12, 5)) +>IMode : Symbol(IMode, Decl(arrayAssignmentTest6.ts, 9, 5)) + + public tokenize(line:string, tokens:IToken[], includeStates:boolean):ILineTokens { +>tokenize : Symbol(tokenize, Decl(arrayAssignmentTest6.ts, 13, 39)) +>line : Symbol(line, Decl(arrayAssignmentTest6.ts, 14, 24)) +>tokens : Symbol(tokens, Decl(arrayAssignmentTest6.ts, 14, 36)) +>IToken : Symbol(IToken, Decl(arrayAssignmentTest6.ts, 2, 5)) +>includeStates : Symbol(includeStates, Decl(arrayAssignmentTest6.ts, 14, 53)) +>ILineTokens : Symbol(ILineTokens, Decl(arrayAssignmentTest6.ts, 5, 5)) + + return null; + } + } +} + diff --git a/tests/baselines/reference/arrayAssignmentTest6.types b/tests/baselines/reference/arrayAssignmentTest6.types index 0c932cb7556..411144d4426 100644 --- a/tests/baselines/reference/arrayAssignmentTest6.types +++ b/tests/baselines/reference/arrayAssignmentTest6.types @@ -46,6 +46,7 @@ module Test { >ILineTokens : ILineTokens return null; +>null : null } } } diff --git a/tests/baselines/reference/arrayAugment.symbols b/tests/baselines/reference/arrayAugment.symbols new file mode 100644 index 00000000000..8310729032f --- /dev/null +++ b/tests/baselines/reference/arrayAugment.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/arrayAugment.ts === +interface Array { +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(arrayAugment.ts, 0, 0)) +>T : Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(arrayAugment.ts, 0, 16)) + + split: (parts: number) => T[][]; +>split : Symbol(split, Decl(arrayAugment.ts, 0, 20)) +>parts : Symbol(parts, Decl(arrayAugment.ts, 1, 12)) +>T : Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(arrayAugment.ts, 0, 16)) +} + +var x = ['']; +>x : Symbol(x, Decl(arrayAugment.ts, 4, 3)) + +var y = x.split(4); +>y : Symbol(y, Decl(arrayAugment.ts, 5, 3), Decl(arrayAugment.ts, 6, 3)) +>x.split : Symbol(Array.split, Decl(arrayAugment.ts, 0, 20)) +>x : Symbol(x, Decl(arrayAugment.ts, 4, 3)) +>split : Symbol(Array.split, Decl(arrayAugment.ts, 0, 20)) + +var y: string[][]; // Expect no error here +>y : Symbol(y, Decl(arrayAugment.ts, 5, 3), Decl(arrayAugment.ts, 6, 3)) + diff --git a/tests/baselines/reference/arrayAugment.types b/tests/baselines/reference/arrayAugment.types index b338d7f5c5f..042b7265ec8 100644 --- a/tests/baselines/reference/arrayAugment.types +++ b/tests/baselines/reference/arrayAugment.types @@ -12,6 +12,7 @@ interface Array { var x = ['']; >x : string[] >[''] : string[] +>'' : string var y = x.split(4); >y : string[][] @@ -19,6 +20,7 @@ var y = x.split(4); >x.split : (parts: number) => string[][] >x : string[] >split : (parts: number) => string[][] +>4 : number var y: string[][]; // Expect no error here >y : string[][] diff --git a/tests/baselines/reference/arrayBestCommonTypes.symbols b/tests/baselines/reference/arrayBestCommonTypes.symbols new file mode 100644 index 00000000000..c4b42f66991 --- /dev/null +++ b/tests/baselines/reference/arrayBestCommonTypes.symbols @@ -0,0 +1,462 @@ +=== tests/cases/compiler/arrayBestCommonTypes.ts === +module EmptyTypes { +>EmptyTypes : Symbol(EmptyTypes, Decl(arrayBestCommonTypes.ts, 0, 0)) + + interface iface { } +>iface : Symbol(iface, Decl(arrayBestCommonTypes.ts, 0, 19)) + + class base implements iface { } +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 1, 23)) +>iface : Symbol(iface, Decl(arrayBestCommonTypes.ts, 0, 19)) + + class base2 implements iface { } +>base2 : Symbol(base2, Decl(arrayBestCommonTypes.ts, 2, 35)) +>iface : Symbol(iface, Decl(arrayBestCommonTypes.ts, 0, 19)) + + class derived extends base { } +>derived : Symbol(derived, Decl(arrayBestCommonTypes.ts, 3, 36)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 1, 23)) + + + class f { +>f : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) + + public voidIfAny(x: boolean, y?: boolean): number; +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 8, 25)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 8, 36)) + + public voidIfAny(x: string, y?: boolean): number; +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 9, 25)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 9, 35)) + + public voidIfAny(x: number, y?: boolean): number; +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 10, 25)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 10, 35)) + + public voidIfAny(x: any, y = false): any { return null; } +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 11, 25)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 11, 32)) + + public x() { +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 11, 65)) + + (this.voidIfAny([4, 2][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) + + (this.voidIfAny([4, 2, undefined][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>undefined : Symbol(undefined) + + (this.voidIfAny([undefined, 2, 4][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>undefined : Symbol(undefined) + + (this.voidIfAny([null, 2, 4][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) + + (this.voidIfAny([2, 4, null][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) + + (this.voidIfAny([undefined, 4, null][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>undefined : Symbol(undefined) + + (this.voidIfAny(['', "q"][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) + + (this.voidIfAny(['', "q", undefined][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>undefined : Symbol(undefined) + + (this.voidIfAny([undefined, "q", ''][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>undefined : Symbol(undefined) + + (this.voidIfAny([null, "q", ''][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) + + (this.voidIfAny(["q", '', null][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) + + (this.voidIfAny([undefined, '', null][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>undefined : Symbol(undefined) + + (this.voidIfAny([[3, 4], [null]][0][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) + + + var t1: { x: number; y: base; }[] = [{ x: 7, y: new derived() }, { x: 5, y: new base() }]; +>t1 : Symbol(t1, Decl(arrayBestCommonTypes.ts, 31, 15)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 31, 21)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 31, 32)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 1, 23)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 31, 50)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 31, 56)) +>derived : Symbol(derived, Decl(arrayBestCommonTypes.ts, 3, 36)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 31, 78)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 31, 84)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 1, 23)) + + var t2: { x: boolean; y: base; }[] = [{ x: true, y: new derived() }, { x: false, y: new base() }]; +>t2 : Symbol(t2, Decl(arrayBestCommonTypes.ts, 32, 15)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 32, 21)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 32, 33)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 1, 23)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 32, 51)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 32, 60)) +>derived : Symbol(derived, Decl(arrayBestCommonTypes.ts, 3, 36)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 32, 82)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 32, 92)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 1, 23)) + + var t3: { x: string; y: base; }[] = [{ x: undefined, y: new base() }, { x: '', y: new derived() }]; +>t3 : Symbol(t3, Decl(arrayBestCommonTypes.ts, 33, 15)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 33, 21)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 33, 32)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 1, 23)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 33, 50)) +>undefined : Symbol(undefined) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 33, 64)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 1, 23)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 33, 83)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 33, 90)) +>derived : Symbol(derived, Decl(arrayBestCommonTypes.ts, 3, 36)) + + var anyObj: any = null; +>anyObj : Symbol(anyObj, Decl(arrayBestCommonTypes.ts, 35, 15)) + + // Order matters here so test all the variants + var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }]; +>a1 : Symbol(a1, Decl(arrayBestCommonTypes.ts, 37, 15)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 37, 23)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 37, 29)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 37, 41)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 37, 49)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 37, 61)) +>anyObj : Symbol(anyObj, Decl(arrayBestCommonTypes.ts, 35, 15)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 37, 72)) + + var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }]; +>a2 : Symbol(a2, Decl(arrayBestCommonTypes.ts, 38, 15)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 38, 23)) +>anyObj : Symbol(anyObj, Decl(arrayBestCommonTypes.ts, 35, 15)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 38, 34)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 38, 46)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 38, 52)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 38, 64)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 38, 72)) + + var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }]; +>a3 : Symbol(a3, Decl(arrayBestCommonTypes.ts, 39, 15)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 39, 23)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 39, 29)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 39, 41)) +>anyObj : Symbol(anyObj, Decl(arrayBestCommonTypes.ts, 35, 15)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 39, 52)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 39, 64)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 39, 72)) + + var ifaceObj: iface = null; +>ifaceObj : Symbol(ifaceObj, Decl(arrayBestCommonTypes.ts, 41, 15)) +>iface : Symbol(iface, Decl(arrayBestCommonTypes.ts, 0, 19)) + + var baseObj = new base(); +>baseObj : Symbol(baseObj, Decl(arrayBestCommonTypes.ts, 42, 15)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 1, 23)) + + var base2Obj = new base2(); +>base2Obj : Symbol(base2Obj, Decl(arrayBestCommonTypes.ts, 43, 15)) +>base2 : Symbol(base2, Decl(arrayBestCommonTypes.ts, 2, 35)) + + var b1 = [baseObj, base2Obj, ifaceObj]; +>b1 : Symbol(b1, Decl(arrayBestCommonTypes.ts, 45, 15)) +>baseObj : Symbol(baseObj, Decl(arrayBestCommonTypes.ts, 42, 15)) +>base2Obj : Symbol(base2Obj, Decl(arrayBestCommonTypes.ts, 43, 15)) +>ifaceObj : Symbol(ifaceObj, Decl(arrayBestCommonTypes.ts, 41, 15)) + + var b2 = [base2Obj, baseObj, ifaceObj]; +>b2 : Symbol(b2, Decl(arrayBestCommonTypes.ts, 46, 15)) +>base2Obj : Symbol(base2Obj, Decl(arrayBestCommonTypes.ts, 43, 15)) +>baseObj : Symbol(baseObj, Decl(arrayBestCommonTypes.ts, 42, 15)) +>ifaceObj : Symbol(ifaceObj, Decl(arrayBestCommonTypes.ts, 41, 15)) + + var b3 = [baseObj, ifaceObj, base2Obj]; +>b3 : Symbol(b3, Decl(arrayBestCommonTypes.ts, 47, 15)) +>baseObj : Symbol(baseObj, Decl(arrayBestCommonTypes.ts, 42, 15)) +>ifaceObj : Symbol(ifaceObj, Decl(arrayBestCommonTypes.ts, 41, 15)) +>base2Obj : Symbol(base2Obj, Decl(arrayBestCommonTypes.ts, 43, 15)) + + var b4 = [ifaceObj, baseObj, base2Obj]; +>b4 : Symbol(b4, Decl(arrayBestCommonTypes.ts, 48, 15)) +>ifaceObj : Symbol(ifaceObj, Decl(arrayBestCommonTypes.ts, 41, 15)) +>baseObj : Symbol(baseObj, Decl(arrayBestCommonTypes.ts, 42, 15)) +>base2Obj : Symbol(base2Obj, Decl(arrayBestCommonTypes.ts, 43, 15)) + } + } +} + +module NonEmptyTypes { +>NonEmptyTypes : Symbol(NonEmptyTypes, Decl(arrayBestCommonTypes.ts, 51, 1)) + + interface iface { x: string; } +>iface : Symbol(iface, Decl(arrayBestCommonTypes.ts, 53, 22)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 54, 21)) + + class base implements iface { x: string; y: string; } +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 54, 34)) +>iface : Symbol(iface, Decl(arrayBestCommonTypes.ts, 53, 22)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 55, 33)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 55, 44)) + + class base2 implements iface { x: string; z: string; } +>base2 : Symbol(base2, Decl(arrayBestCommonTypes.ts, 55, 57)) +>iface : Symbol(iface, Decl(arrayBestCommonTypes.ts, 53, 22)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 56, 34)) +>z : Symbol(z, Decl(arrayBestCommonTypes.ts, 56, 45)) + + class derived extends base { a: string; } +>derived : Symbol(derived, Decl(arrayBestCommonTypes.ts, 56, 58)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 54, 34)) +>a : Symbol(a, Decl(arrayBestCommonTypes.ts, 57, 32)) + + + class f { +>f : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) + + public voidIfAny(x: boolean, y?: boolean): number; +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 61, 25)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 61, 36)) + + public voidIfAny(x: string, y?: boolean): number; +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 62, 25)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 62, 35)) + + public voidIfAny(x: number, y?: boolean): number; +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 63, 25)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 63, 35)) + + public voidIfAny(x: any, y = false): any { return null; } +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 64, 25)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 64, 32)) + + public x() { +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 64, 65)) + + (this.voidIfAny([4, 2][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) + + (this.voidIfAny([4, 2, undefined][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>undefined : Symbol(undefined) + + (this.voidIfAny([undefined, 2, 4][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>undefined : Symbol(undefined) + + (this.voidIfAny([null, 2, 4][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) + + (this.voidIfAny([2, 4, null][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) + + (this.voidIfAny([undefined, 4, null][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>undefined : Symbol(undefined) + + (this.voidIfAny(['', "q"][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) + + (this.voidIfAny(['', "q", undefined][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>undefined : Symbol(undefined) + + (this.voidIfAny([undefined, "q", ''][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>undefined : Symbol(undefined) + + (this.voidIfAny([null, "q", ''][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) + + (this.voidIfAny(["q", '', null][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) + + (this.voidIfAny([undefined, '', null][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>undefined : Symbol(undefined) + + (this.voidIfAny([[3, 4], [null]][0][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) + + + var t1: { x: number; y: base; }[] = [{ x: 7, y: new derived() }, { x: 5, y: new base() }]; +>t1 : Symbol(t1, Decl(arrayBestCommonTypes.ts, 84, 15)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 84, 21)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 84, 32)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 54, 34)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 84, 50)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 84, 56)) +>derived : Symbol(derived, Decl(arrayBestCommonTypes.ts, 56, 58)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 84, 78)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 84, 84)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 54, 34)) + + var t2: { x: boolean; y: base; }[] = [{ x: true, y: new derived() }, { x: false, y: new base() }]; +>t2 : Symbol(t2, Decl(arrayBestCommonTypes.ts, 85, 15)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 85, 21)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 85, 33)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 54, 34)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 85, 51)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 85, 60)) +>derived : Symbol(derived, Decl(arrayBestCommonTypes.ts, 56, 58)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 85, 82)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 85, 92)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 54, 34)) + + var t3: { x: string; y: base; }[] = [{ x: undefined, y: new base() }, { x: '', y: new derived() }]; +>t3 : Symbol(t3, Decl(arrayBestCommonTypes.ts, 86, 15)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 86, 21)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 86, 32)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 54, 34)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 86, 50)) +>undefined : Symbol(undefined) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 86, 64)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 54, 34)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 86, 83)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 86, 90)) +>derived : Symbol(derived, Decl(arrayBestCommonTypes.ts, 56, 58)) + + var anyObj: any = null; +>anyObj : Symbol(anyObj, Decl(arrayBestCommonTypes.ts, 88, 15)) + + // Order matters here so test all the variants + var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }]; +>a1 : Symbol(a1, Decl(arrayBestCommonTypes.ts, 90, 15)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 90, 23)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 90, 29)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 90, 41)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 90, 49)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 90, 61)) +>anyObj : Symbol(anyObj, Decl(arrayBestCommonTypes.ts, 88, 15)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 90, 72)) + + var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }]; +>a2 : Symbol(a2, Decl(arrayBestCommonTypes.ts, 91, 15)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 91, 23)) +>anyObj : Symbol(anyObj, Decl(arrayBestCommonTypes.ts, 88, 15)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 91, 34)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 91, 46)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 91, 52)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 91, 64)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 91, 72)) + + var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }]; +>a3 : Symbol(a3, Decl(arrayBestCommonTypes.ts, 92, 15)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 92, 23)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 92, 29)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 92, 41)) +>anyObj : Symbol(anyObj, Decl(arrayBestCommonTypes.ts, 88, 15)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 92, 52)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 92, 64)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 92, 72)) + + var ifaceObj: iface = null; +>ifaceObj : Symbol(ifaceObj, Decl(arrayBestCommonTypes.ts, 94, 15)) +>iface : Symbol(iface, Decl(arrayBestCommonTypes.ts, 53, 22)) + + var baseObj = new base(); +>baseObj : Symbol(baseObj, Decl(arrayBestCommonTypes.ts, 95, 15)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 54, 34)) + + var base2Obj = new base2(); +>base2Obj : Symbol(base2Obj, Decl(arrayBestCommonTypes.ts, 96, 15)) +>base2 : Symbol(base2, Decl(arrayBestCommonTypes.ts, 55, 57)) + + var b1 = [baseObj, base2Obj, ifaceObj]; +>b1 : Symbol(b1, Decl(arrayBestCommonTypes.ts, 98, 15)) +>baseObj : Symbol(baseObj, Decl(arrayBestCommonTypes.ts, 95, 15)) +>base2Obj : Symbol(base2Obj, Decl(arrayBestCommonTypes.ts, 96, 15)) +>ifaceObj : Symbol(ifaceObj, Decl(arrayBestCommonTypes.ts, 94, 15)) + + var b2 = [base2Obj, baseObj, ifaceObj]; +>b2 : Symbol(b2, Decl(arrayBestCommonTypes.ts, 99, 15)) +>base2Obj : Symbol(base2Obj, Decl(arrayBestCommonTypes.ts, 96, 15)) +>baseObj : Symbol(baseObj, Decl(arrayBestCommonTypes.ts, 95, 15)) +>ifaceObj : Symbol(ifaceObj, Decl(arrayBestCommonTypes.ts, 94, 15)) + + var b3 = [baseObj, ifaceObj, base2Obj]; +>b3 : Symbol(b3, Decl(arrayBestCommonTypes.ts, 100, 15)) +>baseObj : Symbol(baseObj, Decl(arrayBestCommonTypes.ts, 95, 15)) +>ifaceObj : Symbol(ifaceObj, Decl(arrayBestCommonTypes.ts, 94, 15)) +>base2Obj : Symbol(base2Obj, Decl(arrayBestCommonTypes.ts, 96, 15)) + + var b4 = [ifaceObj, baseObj, base2Obj]; +>b4 : Symbol(b4, Decl(arrayBestCommonTypes.ts, 101, 15)) +>ifaceObj : Symbol(ifaceObj, Decl(arrayBestCommonTypes.ts, 94, 15)) +>baseObj : Symbol(baseObj, Decl(arrayBestCommonTypes.ts, 95, 15)) +>base2Obj : Symbol(base2Obj, Decl(arrayBestCommonTypes.ts, 96, 15)) + } + } +} + + diff --git a/tests/baselines/reference/arrayBestCommonTypes.types b/tests/baselines/reference/arrayBestCommonTypes.types index 5e34380673d..5650efc9ae7 100644 --- a/tests/baselines/reference/arrayBestCommonTypes.types +++ b/tests/baselines/reference/arrayBestCommonTypes.types @@ -40,6 +40,8 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >x : any >y : boolean +>false : boolean +>null : null public x() { >x : () => void @@ -53,6 +55,9 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[4, 2][0] : number >[4, 2] : number[] +>4 : number +>2 : number +>0 : number (this.voidIfAny([4, 2, undefined][0])); >(this.voidIfAny([4, 2, undefined][0])) : number @@ -63,7 +68,10 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[4, 2, undefined][0] : number >[4, 2, undefined] : number[] +>4 : number +>2 : number >undefined : undefined +>0 : number (this.voidIfAny([undefined, 2, 4][0])); >(this.voidIfAny([undefined, 2, 4][0])) : number @@ -75,6 +83,9 @@ module EmptyTypes { >[undefined, 2, 4][0] : number >[undefined, 2, 4] : number[] >undefined : undefined +>2 : number +>4 : number +>0 : number (this.voidIfAny([null, 2, 4][0])); >(this.voidIfAny([null, 2, 4][0])) : number @@ -85,6 +96,10 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[null, 2, 4][0] : number >[null, 2, 4] : number[] +>null : null +>2 : number +>4 : number +>0 : number (this.voidIfAny([2, 4, null][0])); >(this.voidIfAny([2, 4, null][0])) : number @@ -95,6 +110,10 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[2, 4, null][0] : number >[2, 4, null] : number[] +>2 : number +>4 : number +>null : null +>0 : number (this.voidIfAny([undefined, 4, null][0])); >(this.voidIfAny([undefined, 4, null][0])) : number @@ -106,6 +125,9 @@ module EmptyTypes { >[undefined, 4, null][0] : number >[undefined, 4, null] : number[] >undefined : undefined +>4 : number +>null : null +>0 : number (this.voidIfAny(['', "q"][0])); >(this.voidIfAny(['', "q"][0])) : number @@ -116,6 +138,9 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >['', "q"][0] : string >['', "q"] : string[] +>'' : string +>"q" : string +>0 : number (this.voidIfAny(['', "q", undefined][0])); >(this.voidIfAny(['', "q", undefined][0])) : number @@ -126,7 +151,10 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >['', "q", undefined][0] : string >['', "q", undefined] : string[] +>'' : string +>"q" : string >undefined : undefined +>0 : number (this.voidIfAny([undefined, "q", ''][0])); >(this.voidIfAny([undefined, "q", ''][0])) : number @@ -138,6 +166,9 @@ module EmptyTypes { >[undefined, "q", ''][0] : string >[undefined, "q", ''] : string[] >undefined : undefined +>"q" : string +>'' : string +>0 : number (this.voidIfAny([null, "q", ''][0])); >(this.voidIfAny([null, "q", ''][0])) : number @@ -148,6 +179,10 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[null, "q", ''][0] : string >[null, "q", ''] : string[] +>null : null +>"q" : string +>'' : string +>0 : number (this.voidIfAny(["q", '', null][0])); >(this.voidIfAny(["q", '', null][0])) : number @@ -158,6 +193,10 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >["q", '', null][0] : string >["q", '', null] : string[] +>"q" : string +>'' : string +>null : null +>0 : number (this.voidIfAny([undefined, '', null][0])); >(this.voidIfAny([undefined, '', null][0])) : number @@ -169,6 +208,9 @@ module EmptyTypes { >[undefined, '', null][0] : string >[undefined, '', null] : string[] >undefined : undefined +>'' : string +>null : null +>0 : number (this.voidIfAny([[3, 4], [null]][0][0])); >(this.voidIfAny([[3, 4], [null]][0][0])) : number @@ -181,7 +223,12 @@ module EmptyTypes { >[[3, 4], [null]][0] : number[] >[[3, 4], [null]] : number[][] >[3, 4] : number[] +>3 : number +>4 : number >[null] : null[] +>null : null +>0 : number +>0 : number var t1: { x: number; y: base; }[] = [{ x: 7, y: new derived() }, { x: 5, y: new base() }]; @@ -192,11 +239,13 @@ module EmptyTypes { >[{ x: 7, y: new derived() }, { x: 5, y: new base() }] : { x: number; y: derived; }[] >{ x: 7, y: new derived() } : { x: number; y: derived; } >x : number +>7 : number >y : derived >new derived() : derived >derived : typeof derived >{ x: 5, y: new base() } : { x: number; y: base; } >x : number +>5 : number >y : base >new base() : base >base : typeof base @@ -209,11 +258,13 @@ module EmptyTypes { >[{ x: true, y: new derived() }, { x: false, y: new base() }] : { x: boolean; y: derived; }[] >{ x: true, y: new derived() } : { x: boolean; y: derived; } >x : boolean +>true : boolean >y : derived >new derived() : derived >derived : typeof derived >{ x: false, y: new base() } : { x: boolean; y: base; } >x : boolean +>false : boolean >y : base >new base() : base >base : typeof base @@ -232,12 +283,14 @@ module EmptyTypes { >base : typeof base >{ x: '', y: new derived() } : { x: string; y: derived; } >x : string +>'' : string >y : derived >new derived() : derived >derived : typeof derived var anyObj: any = null; >anyObj : any +>null : null // Order matters here so test all the variants var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }]; @@ -245,14 +298,19 @@ module EmptyTypes { >[{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }] : { x: any; y: string; }[] >{ x: 0, y: 'a' } : { x: number; y: string; } >x : number +>0 : number >y : string +>'a' : string >{ x: 'a', y: 'a' } : { x: string; y: string; } >x : string +>'a' : string >y : string +>'a' : string >{ x: anyObj, y: 'a' } : { x: any; y: string; } >x : any >anyObj : any >y : string +>'a' : string var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }]; >a2 : { x: any; y: string; }[] @@ -261,30 +319,41 @@ module EmptyTypes { >x : any >anyObj : any >y : string +>'a' : string >{ x: 0, y: 'a' } : { x: number; y: string; } >x : number +>0 : number >y : string +>'a' : string >{ x: 'a', y: 'a' } : { x: string; y: string; } >x : string +>'a' : string >y : string +>'a' : string var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }]; >a3 : { x: any; y: string; }[] >[{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }] : { x: any; y: string; }[] >{ x: 0, y: 'a' } : { x: number; y: string; } >x : number +>0 : number >y : string +>'a' : string >{ x: anyObj, y: 'a' } : { x: any; y: string; } >x : any >anyObj : any >y : string +>'a' : string >{ x: 'a', y: 'a' } : { x: string; y: string; } >x : string +>'a' : string >y : string +>'a' : string var ifaceObj: iface = null; >ifaceObj : iface >iface : iface +>null : null var baseObj = new base(); >baseObj : base @@ -374,6 +443,8 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >x : any >y : boolean +>false : boolean +>null : null public x() { >x : () => void @@ -387,6 +458,9 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[4, 2][0] : number >[4, 2] : number[] +>4 : number +>2 : number +>0 : number (this.voidIfAny([4, 2, undefined][0])); >(this.voidIfAny([4, 2, undefined][0])) : number @@ -397,7 +471,10 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[4, 2, undefined][0] : number >[4, 2, undefined] : number[] +>4 : number +>2 : number >undefined : undefined +>0 : number (this.voidIfAny([undefined, 2, 4][0])); >(this.voidIfAny([undefined, 2, 4][0])) : number @@ -409,6 +486,9 @@ module NonEmptyTypes { >[undefined, 2, 4][0] : number >[undefined, 2, 4] : number[] >undefined : undefined +>2 : number +>4 : number +>0 : number (this.voidIfAny([null, 2, 4][0])); >(this.voidIfAny([null, 2, 4][0])) : number @@ -419,6 +499,10 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[null, 2, 4][0] : number >[null, 2, 4] : number[] +>null : null +>2 : number +>4 : number +>0 : number (this.voidIfAny([2, 4, null][0])); >(this.voidIfAny([2, 4, null][0])) : number @@ -429,6 +513,10 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[2, 4, null][0] : number >[2, 4, null] : number[] +>2 : number +>4 : number +>null : null +>0 : number (this.voidIfAny([undefined, 4, null][0])); >(this.voidIfAny([undefined, 4, null][0])) : number @@ -440,6 +528,9 @@ module NonEmptyTypes { >[undefined, 4, null][0] : number >[undefined, 4, null] : number[] >undefined : undefined +>4 : number +>null : null +>0 : number (this.voidIfAny(['', "q"][0])); >(this.voidIfAny(['', "q"][0])) : number @@ -450,6 +541,9 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >['', "q"][0] : string >['', "q"] : string[] +>'' : string +>"q" : string +>0 : number (this.voidIfAny(['', "q", undefined][0])); >(this.voidIfAny(['', "q", undefined][0])) : number @@ -460,7 +554,10 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >['', "q", undefined][0] : string >['', "q", undefined] : string[] +>'' : string +>"q" : string >undefined : undefined +>0 : number (this.voidIfAny([undefined, "q", ''][0])); >(this.voidIfAny([undefined, "q", ''][0])) : number @@ -472,6 +569,9 @@ module NonEmptyTypes { >[undefined, "q", ''][0] : string >[undefined, "q", ''] : string[] >undefined : undefined +>"q" : string +>'' : string +>0 : number (this.voidIfAny([null, "q", ''][0])); >(this.voidIfAny([null, "q", ''][0])) : number @@ -482,6 +582,10 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[null, "q", ''][0] : string >[null, "q", ''] : string[] +>null : null +>"q" : string +>'' : string +>0 : number (this.voidIfAny(["q", '', null][0])); >(this.voidIfAny(["q", '', null][0])) : number @@ -492,6 +596,10 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >["q", '', null][0] : string >["q", '', null] : string[] +>"q" : string +>'' : string +>null : null +>0 : number (this.voidIfAny([undefined, '', null][0])); >(this.voidIfAny([undefined, '', null][0])) : number @@ -503,6 +611,9 @@ module NonEmptyTypes { >[undefined, '', null][0] : string >[undefined, '', null] : string[] >undefined : undefined +>'' : string +>null : null +>0 : number (this.voidIfAny([[3, 4], [null]][0][0])); >(this.voidIfAny([[3, 4], [null]][0][0])) : number @@ -515,7 +626,12 @@ module NonEmptyTypes { >[[3, 4], [null]][0] : number[] >[[3, 4], [null]] : number[][] >[3, 4] : number[] +>3 : number +>4 : number >[null] : null[] +>null : null +>0 : number +>0 : number var t1: { x: number; y: base; }[] = [{ x: 7, y: new derived() }, { x: 5, y: new base() }]; @@ -526,11 +642,13 @@ module NonEmptyTypes { >[{ x: 7, y: new derived() }, { x: 5, y: new base() }] : { x: number; y: base; }[] >{ x: 7, y: new derived() } : { x: number; y: derived; } >x : number +>7 : number >y : derived >new derived() : derived >derived : typeof derived >{ x: 5, y: new base() } : { x: number; y: base; } >x : number +>5 : number >y : base >new base() : base >base : typeof base @@ -543,11 +661,13 @@ module NonEmptyTypes { >[{ x: true, y: new derived() }, { x: false, y: new base() }] : { x: boolean; y: base; }[] >{ x: true, y: new derived() } : { x: boolean; y: derived; } >x : boolean +>true : boolean >y : derived >new derived() : derived >derived : typeof derived >{ x: false, y: new base() } : { x: boolean; y: base; } >x : boolean +>false : boolean >y : base >new base() : base >base : typeof base @@ -566,12 +686,14 @@ module NonEmptyTypes { >base : typeof base >{ x: '', y: new derived() } : { x: string; y: derived; } >x : string +>'' : string >y : derived >new derived() : derived >derived : typeof derived var anyObj: any = null; >anyObj : any +>null : null // Order matters here so test all the variants var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }]; @@ -579,14 +701,19 @@ module NonEmptyTypes { >[{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }] : { x: any; y: string; }[] >{ x: 0, y: 'a' } : { x: number; y: string; } >x : number +>0 : number >y : string +>'a' : string >{ x: 'a', y: 'a' } : { x: string; y: string; } >x : string +>'a' : string >y : string +>'a' : string >{ x: anyObj, y: 'a' } : { x: any; y: string; } >x : any >anyObj : any >y : string +>'a' : string var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }]; >a2 : { x: any; y: string; }[] @@ -595,30 +722,41 @@ module NonEmptyTypes { >x : any >anyObj : any >y : string +>'a' : string >{ x: 0, y: 'a' } : { x: number; y: string; } >x : number +>0 : number >y : string +>'a' : string >{ x: 'a', y: 'a' } : { x: string; y: string; } >x : string +>'a' : string >y : string +>'a' : string var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }]; >a3 : { x: any; y: string; }[] >[{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }] : { x: any; y: string; }[] >{ x: 0, y: 'a' } : { x: number; y: string; } >x : number +>0 : number >y : string +>'a' : string >{ x: anyObj, y: 'a' } : { x: any; y: string; } >x : any >anyObj : any >y : string +>'a' : string >{ x: 'a', y: 'a' } : { x: string; y: string; } >x : string +>'a' : string >y : string +>'a' : string var ifaceObj: iface = null; >ifaceObj : iface >iface : iface +>null : null var baseObj = new base(); >baseObj : base diff --git a/tests/baselines/reference/arrayBindingPatternOmittedExpressions.symbols b/tests/baselines/reference/arrayBindingPatternOmittedExpressions.symbols new file mode 100644 index 00000000000..41d04ee623a --- /dev/null +++ b/tests/baselines/reference/arrayBindingPatternOmittedExpressions.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/arrayBindingPatternOmittedExpressions.ts === + +var results: string[]; +>results : Symbol(results, Decl(arrayBindingPatternOmittedExpressions.ts, 1, 3)) + +{ + let [, b, , a] = results; +>b : Symbol(b, Decl(arrayBindingPatternOmittedExpressions.ts, 4, 10)) +>a : Symbol(a, Decl(arrayBindingPatternOmittedExpressions.ts, 4, 15)) +>results : Symbol(results, Decl(arrayBindingPatternOmittedExpressions.ts, 1, 3)) + + let x = { +>x : Symbol(x, Decl(arrayBindingPatternOmittedExpressions.ts, 5, 7)) + + a, +>a : Symbol(a, Decl(arrayBindingPatternOmittedExpressions.ts, 5, 13)) + + b +>b : Symbol(b, Decl(arrayBindingPatternOmittedExpressions.ts, 6, 10)) + } +} + + +function f([, a, , b, , , , s, , , ] = results) { +>f : Symbol(f, Decl(arrayBindingPatternOmittedExpressions.ts, 9, 1)) +>a : Symbol(a, Decl(arrayBindingPatternOmittedExpressions.ts, 12, 13)) +>b : Symbol(b, Decl(arrayBindingPatternOmittedExpressions.ts, 12, 18)) +>s : Symbol(s, Decl(arrayBindingPatternOmittedExpressions.ts, 12, 27)) +>results : Symbol(results, Decl(arrayBindingPatternOmittedExpressions.ts, 1, 3)) + + a = s[1]; +>a : Symbol(a, Decl(arrayBindingPatternOmittedExpressions.ts, 12, 13)) +>s : Symbol(s, Decl(arrayBindingPatternOmittedExpressions.ts, 12, 27)) + + b = s[2]; +>b : Symbol(b, Decl(arrayBindingPatternOmittedExpressions.ts, 12, 18)) +>s : Symbol(s, Decl(arrayBindingPatternOmittedExpressions.ts, 12, 27)) +} diff --git a/tests/baselines/reference/arrayBindingPatternOmittedExpressions.types b/tests/baselines/reference/arrayBindingPatternOmittedExpressions.types index ba1ac955b85..e83aa6a17de 100644 --- a/tests/baselines/reference/arrayBindingPatternOmittedExpressions.types +++ b/tests/baselines/reference/arrayBindingPatternOmittedExpressions.types @@ -5,7 +5,9 @@ var results: string[]; { let [, b, , a] = results; +> : undefined >b : string +> : undefined >a : string >results : string[] @@ -24,9 +26,16 @@ var results: string[]; function f([, a, , b, , , , s, , , ] = results) { >f : ([, a, , b, , , , s, , , ]?: string[]) => void +> : undefined >a : string +> : undefined >b : string +> : undefined +> : undefined +> : undefined >s : string +> : undefined +> : undefined >results : string[] a = s[1]; @@ -34,10 +43,12 @@ function f([, a, , b, , , , s, , , ] = results) { >a : string >s[1] : string >s : string +>1 : number b = s[2]; >b = s[2] : string >b : string >s[2] : string >s : string +>2 : number } diff --git a/tests/baselines/reference/arrayConcat2.symbols b/tests/baselines/reference/arrayConcat2.symbols new file mode 100644 index 00000000000..8c0af7be702 --- /dev/null +++ b/tests/baselines/reference/arrayConcat2.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/arrayConcat2.ts === +var a: string[] = []; +>a : Symbol(a, Decl(arrayConcat2.ts, 0, 3)) + +a.concat("hello", 'world'); +>a.concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) +>a : Symbol(a, Decl(arrayConcat2.ts, 0, 3)) +>concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) + +a.concat('Hello'); +>a.concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) +>a : Symbol(a, Decl(arrayConcat2.ts, 0, 3)) +>concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) + +var b = new Array(); +>b : Symbol(b, Decl(arrayConcat2.ts, 5, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +b.concat('hello'); +>b.concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) +>b : Symbol(b, Decl(arrayConcat2.ts, 5, 3)) +>concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) + diff --git a/tests/baselines/reference/arrayConcat2.types b/tests/baselines/reference/arrayConcat2.types index aa0e0478033..a49046c871f 100644 --- a/tests/baselines/reference/arrayConcat2.types +++ b/tests/baselines/reference/arrayConcat2.types @@ -8,12 +8,15 @@ a.concat("hello", 'world'); >a.concat : { (...items: U[]): string[]; (...items: string[]): string[]; } >a : string[] >concat : { (...items: U[]): string[]; (...items: string[]): string[]; } +>"hello" : string +>'world' : string a.concat('Hello'); >a.concat('Hello') : string[] >a.concat : { (...items: U[]): string[]; (...items: string[]): string[]; } >a : string[] >concat : { (...items: U[]): string[]; (...items: string[]): string[]; } +>'Hello' : string var b = new Array(); >b : string[] @@ -25,4 +28,5 @@ b.concat('hello'); >b.concat : { (...items: U[]): string[]; (...items: string[]): string[]; } >b : string[] >concat : { (...items: U[]): string[]; (...items: string[]): string[]; } +>'hello' : string diff --git a/tests/baselines/reference/arrayConcatMap.symbols b/tests/baselines/reference/arrayConcatMap.symbols new file mode 100644 index 00000000000..1ff4bc3bff5 --- /dev/null +++ b/tests/baselines/reference/arrayConcatMap.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/arrayConcatMap.ts === +var x = [].concat([{ a: 1 }], [{ a: 2 }]) +>x : Symbol(x, Decl(arrayConcatMap.ts, 0, 3)) +>[].concat([{ a: 1 }], [{ a: 2 }]) .map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>[].concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) +>concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) +>a : Symbol(a, Decl(arrayConcatMap.ts, 0, 20)) +>a : Symbol(a, Decl(arrayConcatMap.ts, 0, 32)) + + .map(b => b.a); +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>b : Symbol(b, Decl(arrayConcatMap.ts, 1, 15)) +>b : Symbol(b, Decl(arrayConcatMap.ts, 1, 15)) + diff --git a/tests/baselines/reference/arrayConcatMap.types b/tests/baselines/reference/arrayConcatMap.types index 92da3edf93f..11342ee848a 100644 --- a/tests/baselines/reference/arrayConcatMap.types +++ b/tests/baselines/reference/arrayConcatMap.types @@ -10,9 +10,11 @@ var x = [].concat([{ a: 1 }], [{ a: 2 }]) >[{ a: 1 }] : { a: number; }[] >{ a: 1 } : { a: number; } >a : number +>1 : number >[{ a: 2 }] : { a: number; }[] >{ a: 2 } : { a: number; } >a : number +>2 : number .map(b => b.a); >map : (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[] diff --git a/tests/baselines/reference/arrayConstructors1.symbols b/tests/baselines/reference/arrayConstructors1.symbols new file mode 100644 index 00000000000..cab2b0dc68a --- /dev/null +++ b/tests/baselines/reference/arrayConstructors1.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/arrayConstructors1.ts === +var x: string[]; +>x : Symbol(x, Decl(arrayConstructors1.ts, 0, 3)) + +x = new Array(1); +>x : Symbol(x, Decl(arrayConstructors1.ts, 0, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +x = new Array('hi', 'bye'); +>x : Symbol(x, Decl(arrayConstructors1.ts, 0, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +x = new Array('hi', 'bye'); +>x : Symbol(x, Decl(arrayConstructors1.ts, 0, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +var y: number[]; +>y : Symbol(y, Decl(arrayConstructors1.ts, 5, 3)) + +y = new Array(1); +>y : Symbol(y, Decl(arrayConstructors1.ts, 5, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +y = new Array(1,2); +>y : Symbol(y, Decl(arrayConstructors1.ts, 5, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +y = new Array(1, 2); +>y : Symbol(y, Decl(arrayConstructors1.ts, 5, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + diff --git a/tests/baselines/reference/arrayConstructors1.types b/tests/baselines/reference/arrayConstructors1.types index 6dbdc0cd8f2..89807cd0348 100644 --- a/tests/baselines/reference/arrayConstructors1.types +++ b/tests/baselines/reference/arrayConstructors1.types @@ -7,18 +7,23 @@ x = new Array(1); >x : string[] >new Array(1) : any[] >Array : ArrayConstructor +>1 : number x = new Array('hi', 'bye'); >x = new Array('hi', 'bye') : string[] >x : string[] >new Array('hi', 'bye') : string[] >Array : ArrayConstructor +>'hi' : string +>'bye' : string x = new Array('hi', 'bye'); >x = new Array('hi', 'bye') : string[] >x : string[] >new Array('hi', 'bye') : string[] >Array : ArrayConstructor +>'hi' : string +>'bye' : string var y: number[]; >y : number[] @@ -28,16 +33,21 @@ y = new Array(1); >y : number[] >new Array(1) : any[] >Array : ArrayConstructor +>1 : number y = new Array(1,2); >y = new Array(1,2) : number[] >y : number[] >new Array(1,2) : number[] >Array : ArrayConstructor +>1 : number +>2 : number y = new Array(1, 2); >y = new Array(1, 2) : number[] >y : number[] >new Array(1, 2) : number[] >Array : ArrayConstructor +>1 : number +>2 : number diff --git a/tests/baselines/reference/arrayLiteral.symbols b/tests/baselines/reference/arrayLiteral.symbols new file mode 100644 index 00000000000..77673863b64 --- /dev/null +++ b/tests/baselines/reference/arrayLiteral.symbols @@ -0,0 +1,37 @@ +=== tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayLiteral.ts === +// valid uses of array literals + +var x = []; +>x : Symbol(x, Decl(arrayLiteral.ts, 2, 3), Decl(arrayLiteral.ts, 3, 3)) + +var x = new Array(1); +>x : Symbol(x, Decl(arrayLiteral.ts, 2, 3), Decl(arrayLiteral.ts, 3, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +var y = [1]; +>y : Symbol(y, Decl(arrayLiteral.ts, 5, 3), Decl(arrayLiteral.ts, 6, 3), Decl(arrayLiteral.ts, 7, 3)) + +var y = [1, 2]; +>y : Symbol(y, Decl(arrayLiteral.ts, 5, 3), Decl(arrayLiteral.ts, 6, 3), Decl(arrayLiteral.ts, 7, 3)) + +var y = new Array(); +>y : Symbol(y, Decl(arrayLiteral.ts, 5, 3), Decl(arrayLiteral.ts, 6, 3), Decl(arrayLiteral.ts, 7, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +var x2: number[] = []; +>x2 : Symbol(x2, Decl(arrayLiteral.ts, 9, 3), Decl(arrayLiteral.ts, 10, 3)) + +var x2: number[] = new Array(1); +>x2 : Symbol(x2, Decl(arrayLiteral.ts, 9, 3), Decl(arrayLiteral.ts, 10, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +var y2: number[] = [1]; +>y2 : Symbol(y2, Decl(arrayLiteral.ts, 12, 3), Decl(arrayLiteral.ts, 13, 3), Decl(arrayLiteral.ts, 14, 3)) + +var y2: number[] = [1, 2]; +>y2 : Symbol(y2, Decl(arrayLiteral.ts, 12, 3), Decl(arrayLiteral.ts, 13, 3), Decl(arrayLiteral.ts, 14, 3)) + +var y2: number[] = new Array(); +>y2 : Symbol(y2, Decl(arrayLiteral.ts, 12, 3), Decl(arrayLiteral.ts, 13, 3), Decl(arrayLiteral.ts, 14, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + diff --git a/tests/baselines/reference/arrayLiteral.types b/tests/baselines/reference/arrayLiteral.types index a5ab7368937..a7b915de79d 100644 --- a/tests/baselines/reference/arrayLiteral.types +++ b/tests/baselines/reference/arrayLiteral.types @@ -9,14 +9,18 @@ var x = new Array(1); >x : any[] >new Array(1) : any[] >Array : ArrayConstructor +>1 : number var y = [1]; >y : number[] >[1] : number[] +>1 : number var y = [1, 2]; >y : number[] >[1, 2] : number[] +>1 : number +>2 : number var y = new Array(); >y : number[] @@ -31,14 +35,18 @@ var x2: number[] = new Array(1); >x2 : number[] >new Array(1) : any[] >Array : ArrayConstructor +>1 : number var y2: number[] = [1]; >y2 : number[] >[1] : number[] +>1 : number var y2: number[] = [1, 2]; >y2 : number[] >[1, 2] : number[] +>1 : number +>2 : number var y2: number[] = new Array(); >y2 : number[] diff --git a/tests/baselines/reference/arrayLiteral1.symbols b/tests/baselines/reference/arrayLiteral1.symbols new file mode 100644 index 00000000000..9f2e04138b7 --- /dev/null +++ b/tests/baselines/reference/arrayLiteral1.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/arrayLiteral1.ts === +var v30 = [1, 2]; +>v30 : Symbol(v30, Decl(arrayLiteral1.ts, 0, 3)) + diff --git a/tests/baselines/reference/arrayLiteral1.types b/tests/baselines/reference/arrayLiteral1.types index 79d00f5f46f..eb83fa87035 100644 --- a/tests/baselines/reference/arrayLiteral1.types +++ b/tests/baselines/reference/arrayLiteral1.types @@ -2,4 +2,6 @@ var v30 = [1, 2]; >v30 : number[] >[1, 2] : number[] +>1 : number +>2 : number diff --git a/tests/baselines/reference/arrayLiteral2.symbols b/tests/baselines/reference/arrayLiteral2.symbols new file mode 100644 index 00000000000..e06077736e5 --- /dev/null +++ b/tests/baselines/reference/arrayLiteral2.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/arrayLiteral2.ts === +var v30 = [1, 2], v31; +>v30 : Symbol(v30, Decl(arrayLiteral2.ts, 0, 3)) +>v31 : Symbol(v31, Decl(arrayLiteral2.ts, 0, 17)) + diff --git a/tests/baselines/reference/arrayLiteral2.types b/tests/baselines/reference/arrayLiteral2.types index cd370c0f1a9..1c3c81117d9 100644 --- a/tests/baselines/reference/arrayLiteral2.types +++ b/tests/baselines/reference/arrayLiteral2.types @@ -2,5 +2,7 @@ var v30 = [1, 2], v31; >v30 : number[] >[1, 2] : number[] +>1 : number +>2 : number >v31 : any diff --git a/tests/baselines/reference/arrayLiteralContextualType.symbols b/tests/baselines/reference/arrayLiteralContextualType.symbols new file mode 100644 index 00000000000..500c1d522f6 --- /dev/null +++ b/tests/baselines/reference/arrayLiteralContextualType.symbols @@ -0,0 +1,73 @@ +=== tests/cases/compiler/arrayLiteralContextualType.ts === +interface IAnimal { +>IAnimal : Symbol(IAnimal, Decl(arrayLiteralContextualType.ts, 0, 0)) + + name: string; +>name : Symbol(name, Decl(arrayLiteralContextualType.ts, 0, 19)) +} + +class Giraffe { +>Giraffe : Symbol(Giraffe, Decl(arrayLiteralContextualType.ts, 2, 1)) + + name = "Giraffe"; +>name : Symbol(name, Decl(arrayLiteralContextualType.ts, 4, 15)) + + neckLength = "3m"; +>neckLength : Symbol(neckLength, Decl(arrayLiteralContextualType.ts, 5, 21)) +} + +class Elephant { +>Elephant : Symbol(Elephant, Decl(arrayLiteralContextualType.ts, 7, 1)) + + name = "Elephant"; +>name : Symbol(name, Decl(arrayLiteralContextualType.ts, 9, 16)) + + trunkDiameter = "20cm"; +>trunkDiameter : Symbol(trunkDiameter, Decl(arrayLiteralContextualType.ts, 10, 22)) +} + +function foo(animals: IAnimal[]) { } +>foo : Symbol(foo, Decl(arrayLiteralContextualType.ts, 12, 1)) +>animals : Symbol(animals, Decl(arrayLiteralContextualType.ts, 14, 13)) +>IAnimal : Symbol(IAnimal, Decl(arrayLiteralContextualType.ts, 0, 0)) + +function bar(animals: { [n: number]: IAnimal }) { } +>bar : Symbol(bar, Decl(arrayLiteralContextualType.ts, 14, 36)) +>animals : Symbol(animals, Decl(arrayLiteralContextualType.ts, 15, 13)) +>n : Symbol(n, Decl(arrayLiteralContextualType.ts, 15, 25)) +>IAnimal : Symbol(IAnimal, Decl(arrayLiteralContextualType.ts, 0, 0)) + +foo([ +>foo : Symbol(foo, Decl(arrayLiteralContextualType.ts, 12, 1)) + + new Giraffe(), +>Giraffe : Symbol(Giraffe, Decl(arrayLiteralContextualType.ts, 2, 1)) + + new Elephant() +>Elephant : Symbol(Elephant, Decl(arrayLiteralContextualType.ts, 7, 1)) + +]); // Legal because of the contextual type IAnimal provided by the parameter +bar([ +>bar : Symbol(bar, Decl(arrayLiteralContextualType.ts, 14, 36)) + + new Giraffe(), +>Giraffe : Symbol(Giraffe, Decl(arrayLiteralContextualType.ts, 2, 1)) + + new Elephant() +>Elephant : Symbol(Elephant, Decl(arrayLiteralContextualType.ts, 7, 1)) + +]); // Legal because of the contextual type IAnimal provided by the parameter + +var arr = [new Giraffe(), new Elephant()]; +>arr : Symbol(arr, Decl(arrayLiteralContextualType.ts, 26, 3)) +>Giraffe : Symbol(Giraffe, Decl(arrayLiteralContextualType.ts, 2, 1)) +>Elephant : Symbol(Elephant, Decl(arrayLiteralContextualType.ts, 7, 1)) + +foo(arr); // ok because arr is Array not {}[] +>foo : Symbol(foo, Decl(arrayLiteralContextualType.ts, 12, 1)) +>arr : Symbol(arr, Decl(arrayLiteralContextualType.ts, 26, 3)) + +bar(arr); // ok because arr is Array not {}[] +>bar : Symbol(bar, Decl(arrayLiteralContextualType.ts, 14, 36)) +>arr : Symbol(arr, Decl(arrayLiteralContextualType.ts, 26, 3)) + diff --git a/tests/baselines/reference/arrayLiteralContextualType.types b/tests/baselines/reference/arrayLiteralContextualType.types index b6d8377d012..0513908929e 100644 --- a/tests/baselines/reference/arrayLiteralContextualType.types +++ b/tests/baselines/reference/arrayLiteralContextualType.types @@ -11,9 +11,11 @@ class Giraffe { name = "Giraffe"; >name : string +>"Giraffe" : string neckLength = "3m"; >neckLength : string +>"3m" : string } class Elephant { @@ -21,9 +23,11 @@ class Elephant { name = "Elephant"; >name : string +>"Elephant" : string trunkDiameter = "20cm"; >trunkDiameter : string +>"20cm" : string } function foo(animals: IAnimal[]) { } diff --git a/tests/baselines/reference/arrayLiteralInNonVarArgParameter.symbols b/tests/baselines/reference/arrayLiteralInNonVarArgParameter.symbols new file mode 100644 index 00000000000..9ce5cebf0c2 --- /dev/null +++ b/tests/baselines/reference/arrayLiteralInNonVarArgParameter.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/arrayLiteralInNonVarArgParameter.ts === +function panic(val: string[], ...opt: string[]) { } +>panic : Symbol(panic, Decl(arrayLiteralInNonVarArgParameter.ts, 0, 0)) +>val : Symbol(val, Decl(arrayLiteralInNonVarArgParameter.ts, 0, 15)) +>opt : Symbol(opt, Decl(arrayLiteralInNonVarArgParameter.ts, 0, 29)) + +panic([], 'one', 'two'); +>panic : Symbol(panic, Decl(arrayLiteralInNonVarArgParameter.ts, 0, 0)) + diff --git a/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types b/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types index 4743504c33e..fcbaa22bc6a 100644 --- a/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types +++ b/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types @@ -8,4 +8,6 @@ panic([], 'one', 'two'); >panic([], 'one', 'two') : void >panic : (val: string[], ...opt: string[]) => void >[] : undefined[] +>'one' : string +>'two' : string diff --git a/tests/baselines/reference/arrayLiteralSpread.symbols b/tests/baselines/reference/arrayLiteralSpread.symbols new file mode 100644 index 00000000000..d7bcee44fef --- /dev/null +++ b/tests/baselines/reference/arrayLiteralSpread.symbols @@ -0,0 +1,67 @@ +=== tests/cases/conformance/es6/spread/arrayLiteralSpread.ts === +function f0() { +>f0 : Symbol(f0, Decl(arrayLiteralSpread.ts, 0, 0)) + + var a = [1, 2, 3]; +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 1, 7)) + + var a1 = [...a]; +>a1 : Symbol(a1, Decl(arrayLiteralSpread.ts, 2, 7)) +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 1, 7)) + + var a2 = [1, ...a]; +>a2 : Symbol(a2, Decl(arrayLiteralSpread.ts, 3, 7)) +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 1, 7)) + + var a3 = [1, 2, ...a]; +>a3 : Symbol(a3, Decl(arrayLiteralSpread.ts, 4, 7)) +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 1, 7)) + + var a4 = [...a, 1]; +>a4 : Symbol(a4, Decl(arrayLiteralSpread.ts, 5, 7)) +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 1, 7)) + + var a5 = [...a, 1, 2]; +>a5 : Symbol(a5, Decl(arrayLiteralSpread.ts, 6, 7)) +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 1, 7)) + + var a6 = [1, 2, ...a, 1, 2]; +>a6 : Symbol(a6, Decl(arrayLiteralSpread.ts, 7, 7)) +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 1, 7)) + + var a7 = [1, ...a, 2, ...a]; +>a7 : Symbol(a7, Decl(arrayLiteralSpread.ts, 8, 7)) +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 1, 7)) +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 1, 7)) + + var a8 = [...a, ...a, ...a]; +>a8 : Symbol(a8, Decl(arrayLiteralSpread.ts, 9, 7)) +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 1, 7)) +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 1, 7)) +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 1, 7)) +} + +function f1() { +>f1 : Symbol(f1, Decl(arrayLiteralSpread.ts, 10, 1)) + + var a = [1, 2, 3]; +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 13, 7)) + + var b = ["hello", ...a, true]; +>b : Symbol(b, Decl(arrayLiteralSpread.ts, 14, 7), Decl(arrayLiteralSpread.ts, 15, 7)) +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 13, 7)) + + var b: (string | number | boolean)[]; +>b : Symbol(b, Decl(arrayLiteralSpread.ts, 14, 7), Decl(arrayLiteralSpread.ts, 15, 7)) +} + +function f2() { +>f2 : Symbol(f2, Decl(arrayLiteralSpread.ts, 16, 1)) + + var a = [...[...[...[...[...[]]]]]]; +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 19, 7)) + + var b = [...[...[...[...[...[5]]]]]]; +>b : Symbol(b, Decl(arrayLiteralSpread.ts, 20, 7)) +} + diff --git a/tests/baselines/reference/arrayLiteralSpread.types b/tests/baselines/reference/arrayLiteralSpread.types index 73d4f6013ed..7b9a34c0abe 100644 --- a/tests/baselines/reference/arrayLiteralSpread.types +++ b/tests/baselines/reference/arrayLiteralSpread.types @@ -5,6 +5,9 @@ function f0() { var a = [1, 2, 3]; >a : number[] >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number var a1 = [...a]; >a1 : number[] @@ -15,12 +18,15 @@ function f0() { var a2 = [1, ...a]; >a2 : number[] >[1, ...a] : number[] +>1 : number >...a : number >a : number[] var a3 = [1, 2, ...a]; >a3 : number[] >[1, 2, ...a] : number[] +>1 : number +>2 : number >...a : number >a : number[] @@ -29,24 +35,33 @@ function f0() { >[...a, 1] : number[] >...a : number >a : number[] +>1 : number var a5 = [...a, 1, 2]; >a5 : number[] >[...a, 1, 2] : number[] >...a : number >a : number[] +>1 : number +>2 : number var a6 = [1, 2, ...a, 1, 2]; >a6 : number[] >[1, 2, ...a, 1, 2] : number[] +>1 : number +>2 : number >...a : number >a : number[] +>1 : number +>2 : number var a7 = [1, ...a, 2, ...a]; >a7 : number[] >[1, ...a, 2, ...a] : number[] +>1 : number >...a : number >a : number[] +>2 : number >...a : number >a : number[] @@ -67,12 +82,17 @@ function f1() { var a = [1, 2, 3]; >a : number[] >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number var b = ["hello", ...a, true]; >b : (string | number | boolean)[] >["hello", ...a, true] : (string | number | boolean)[] +>"hello" : string >...a : number >a : number[] +>true : boolean var b: (string | number | boolean)[]; >b : (string | number | boolean)[] @@ -108,5 +128,6 @@ function f2() { >[...[5]] : number[] >...[5] : number >[5] : number[] +>5 : number } diff --git a/tests/baselines/reference/arrayLiteralTypeInference.symbols b/tests/baselines/reference/arrayLiteralTypeInference.symbols new file mode 100644 index 00000000000..005cb57f6c4 --- /dev/null +++ b/tests/baselines/reference/arrayLiteralTypeInference.symbols @@ -0,0 +1,113 @@ +=== tests/cases/compiler/arrayLiteralTypeInference.ts === +class Action { +>Action : Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(arrayLiteralTypeInference.ts, 0, 14)) +} + +class ActionA extends Action { +>ActionA : Symbol(ActionA, Decl(arrayLiteralTypeInference.ts, 2, 1)) +>Action : Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0)) + + value: string; +>value : Symbol(value, Decl(arrayLiteralTypeInference.ts, 4, 30)) +} + +class ActionB extends Action { +>ActionB : Symbol(ActionB, Decl(arrayLiteralTypeInference.ts, 6, 1)) +>Action : Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0)) + + trueNess: boolean; +>trueNess : Symbol(trueNess, Decl(arrayLiteralTypeInference.ts, 8, 30)) +} + +var x1: Action[] = [ +>x1 : Symbol(x1, Decl(arrayLiteralTypeInference.ts, 12, 3)) +>Action : Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0)) + + { id: 2, trueness: false }, +>id : Symbol(id, Decl(arrayLiteralTypeInference.ts, 13, 5)) +>trueness : Symbol(trueness, Decl(arrayLiteralTypeInference.ts, 13, 12)) + + { id: 3, name: "three" } +>id : Symbol(id, Decl(arrayLiteralTypeInference.ts, 14, 5)) +>name : Symbol(name, Decl(arrayLiteralTypeInference.ts, 14, 12)) + +] + +var x2: Action[] = [ +>x2 : Symbol(x2, Decl(arrayLiteralTypeInference.ts, 17, 3)) +>Action : Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0)) + + new ActionA(), +>ActionA : Symbol(ActionA, Decl(arrayLiteralTypeInference.ts, 2, 1)) + + new ActionB() +>ActionB : Symbol(ActionB, Decl(arrayLiteralTypeInference.ts, 6, 1)) + +] + +var x3: Action[] = [ +>x3 : Symbol(x3, Decl(arrayLiteralTypeInference.ts, 22, 3)) +>Action : Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0)) + + new Action(), +>Action : Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0)) + + new ActionA(), +>ActionA : Symbol(ActionA, Decl(arrayLiteralTypeInference.ts, 2, 1)) + + new ActionB() +>ActionB : Symbol(ActionB, Decl(arrayLiteralTypeInference.ts, 6, 1)) + +] + +var z1: { id: number }[] = +>z1 : Symbol(z1, Decl(arrayLiteralTypeInference.ts, 28, 3)) +>id : Symbol(id, Decl(arrayLiteralTypeInference.ts, 28, 9)) + + [ + { id: 2, trueness: false }, +>id : Symbol(id, Decl(arrayLiteralTypeInference.ts, 30, 9)) +>trueness : Symbol(trueness, Decl(arrayLiteralTypeInference.ts, 30, 16)) + + { id: 3, name: "three" } +>id : Symbol(id, Decl(arrayLiteralTypeInference.ts, 31, 9)) +>name : Symbol(name, Decl(arrayLiteralTypeInference.ts, 31, 16)) + + ] + +var z2: { id: number }[] = +>z2 : Symbol(z2, Decl(arrayLiteralTypeInference.ts, 34, 3)) +>id : Symbol(id, Decl(arrayLiteralTypeInference.ts, 34, 9)) + + [ + new ActionA(), +>ActionA : Symbol(ActionA, Decl(arrayLiteralTypeInference.ts, 2, 1)) + + new ActionB() +>ActionB : Symbol(ActionB, Decl(arrayLiteralTypeInference.ts, 6, 1)) + + ] + +var z3: { id: number }[] = +>z3 : Symbol(z3, Decl(arrayLiteralTypeInference.ts, 40, 3)) +>id : Symbol(id, Decl(arrayLiteralTypeInference.ts, 40, 9)) + + [ + new Action(), +>Action : Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0)) + + new ActionA(), +>ActionA : Symbol(ActionA, Decl(arrayLiteralTypeInference.ts, 2, 1)) + + new ActionB() +>ActionB : Symbol(ActionB, Decl(arrayLiteralTypeInference.ts, 6, 1)) + + ] + + + + + diff --git a/tests/baselines/reference/arrayLiteralTypeInference.types b/tests/baselines/reference/arrayLiteralTypeInference.types index adcc28c7440..660592fceb8 100644 --- a/tests/baselines/reference/arrayLiteralTypeInference.types +++ b/tests/baselines/reference/arrayLiteralTypeInference.types @@ -30,12 +30,16 @@ var x1: Action[] = [ { id: 2, trueness: false }, >{ id: 2, trueness: false } : { id: number; trueness: boolean; } >id : number +>2 : number >trueness : boolean +>false : boolean { id: 3, name: "three" } >{ id: 3, name: "three" } : { id: number; name: string; } >id : number +>3 : number >name : string +>"three" : string ] @@ -83,12 +87,16 @@ var z1: { id: number }[] = { id: 2, trueness: false }, >{ id: 2, trueness: false } : { id: number; trueness: boolean; } >id : number +>2 : number >trueness : boolean +>false : boolean { id: 3, name: "three" } >{ id: 3, name: "three" } : { id: number; name: string; } >id : number +>3 : number >name : string +>"three" : string ] diff --git a/tests/baselines/reference/arrayLiteralWidened.symbols b/tests/baselines/reference/arrayLiteralWidened.symbols new file mode 100644 index 00000000000..ba058aeded1 --- /dev/null +++ b/tests/baselines/reference/arrayLiteralWidened.symbols @@ -0,0 +1,32 @@ +=== tests/cases/conformance/types/typeRelationships/widenedTypes/arrayLiteralWidened.ts === +// array literals are widened upon assignment according to their element type + +var a = []; // any[] +>a : Symbol(a, Decl(arrayLiteralWidened.ts, 2, 3), Decl(arrayLiteralWidened.ts, 4, 3), Decl(arrayLiteralWidened.ts, 5, 3)) + +var a = [null, null]; +>a : Symbol(a, Decl(arrayLiteralWidened.ts, 2, 3), Decl(arrayLiteralWidened.ts, 4, 3), Decl(arrayLiteralWidened.ts, 5, 3)) + +var a = [undefined, undefined]; +>a : Symbol(a, Decl(arrayLiteralWidened.ts, 2, 3), Decl(arrayLiteralWidened.ts, 4, 3), Decl(arrayLiteralWidened.ts, 5, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +var b = [[], [null, null]]; // any[][] +>b : Symbol(b, Decl(arrayLiteralWidened.ts, 7, 3), Decl(arrayLiteralWidened.ts, 8, 3), Decl(arrayLiteralWidened.ts, 9, 3)) + +var b = [[], []]; +>b : Symbol(b, Decl(arrayLiteralWidened.ts, 7, 3), Decl(arrayLiteralWidened.ts, 8, 3), Decl(arrayLiteralWidened.ts, 9, 3)) + +var b = [[undefined, undefined]]; +>b : Symbol(b, Decl(arrayLiteralWidened.ts, 7, 3), Decl(arrayLiteralWidened.ts, 8, 3), Decl(arrayLiteralWidened.ts, 9, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +var c = [[[]]]; // any[][][] +>c : Symbol(c, Decl(arrayLiteralWidened.ts, 11, 3), Decl(arrayLiteralWidened.ts, 12, 3)) + +var c = [[[null]],[undefined]] +>c : Symbol(c, Decl(arrayLiteralWidened.ts, 11, 3), Decl(arrayLiteralWidened.ts, 12, 3)) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/arrayLiteralWidened.types b/tests/baselines/reference/arrayLiteralWidened.types index 6e89bc50892..9599db2dff5 100644 --- a/tests/baselines/reference/arrayLiteralWidened.types +++ b/tests/baselines/reference/arrayLiteralWidened.types @@ -8,6 +8,8 @@ var a = []; // any[] var a = [null, null]; >a : any[] >[null, null] : null[] +>null : null +>null : null var a = [undefined, undefined]; >a : any[] @@ -20,6 +22,8 @@ var b = [[], [null, null]]; // any[][] >[[], [null, null]] : null[][] >[] : undefined[] >[null, null] : null[] +>null : null +>null : null var b = [[], []]; >b : any[][] @@ -45,6 +49,7 @@ var c = [[[null]],[undefined]] >[[[null]],[undefined]] : null[][][] >[[null]] : null[][] >[null] : null[] +>null : null >[undefined] : undefined[] >undefined : undefined diff --git a/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.symbols b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.symbols new file mode 100644 index 00000000000..071596c9af1 --- /dev/null +++ b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.symbols @@ -0,0 +1,64 @@ +=== tests/cases/conformance/types/typeRelationships/bestCommonType/arrayLiteralWithMultipleBestCommonTypes.ts === +// when multiple best common types exist we will choose the first candidate + +var a: { x: number; y?: number }; +>a : Symbol(a, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 2, 3)) +>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 2, 8)) +>y : Symbol(y, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 2, 19)) + +var b: { x: number; z?: number }; +>b : Symbol(b, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 3, 3)) +>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 3, 8)) +>z : Symbol(z, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 3, 19)) + +var c: { x: number; a?: number }; +>c : Symbol(c, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 4, 3)) +>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 4, 8)) +>a : Symbol(a, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 4, 19)) + +var as = [a, b]; // { x: number; y?: number };[] +>as : Symbol(as, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 6, 3)) +>a : Symbol(a, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 2, 3)) +>b : Symbol(b, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 3, 3)) + +var bs = [b, a]; // { x: number; z?: number };[] +>bs : Symbol(bs, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 7, 3)) +>b : Symbol(b, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 3, 3)) +>a : Symbol(a, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 2, 3)) + +var cs = [a, b, c]; // { x: number; y?: number };[] +>cs : Symbol(cs, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 8, 3)) +>a : Symbol(a, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 2, 3)) +>b : Symbol(b, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 3, 3)) +>c : Symbol(c, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 4, 3)) + +var ds = [(x: Object) => 1, (x: string) => 2]; // { (x:Object) => number }[] +>ds : Symbol(ds, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 10, 3)) +>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 10, 11)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 10, 29)) + +var es = [(x: string) => 2, (x: Object) => 1]; // { (x:string) => number }[] +>es : Symbol(es, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 11, 3)) +>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 11, 11)) +>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 11, 29)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var fs = [(a: { x: number; y?: number }) => 1, (b: { x: number; z?: number }) => 2]; // (a: { x: number; y?: number }) => number[] +>fs : Symbol(fs, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 12, 3)) +>a : Symbol(a, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 12, 11)) +>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 12, 15)) +>y : Symbol(y, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 12, 26)) +>b : Symbol(b, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 12, 48)) +>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 12, 52)) +>z : Symbol(z, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 12, 63)) + +var gs = [(b: { x: number; z?: number }) => 2, (a: { x: number; y?: number }) => 1]; // (b: { x: number; z?: number }) => number[] +>gs : Symbol(gs, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 13, 3)) +>b : Symbol(b, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 13, 11)) +>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 13, 15)) +>z : Symbol(z, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 13, 26)) +>a : Symbol(a, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 13, 48)) +>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 13, 52)) +>y : Symbol(y, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 13, 63)) + diff --git a/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types index bc21ec39073..aad515b62ee 100644 --- a/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types +++ b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types @@ -41,17 +41,21 @@ var ds = [(x: Object) => 1, (x: string) => 2]; // { (x:Object) => number }[] >(x: Object) => 1 : (x: Object) => number >x : Object >Object : Object +>1 : number >(x: string) => 2 : (x: string) => number >x : string +>2 : number var es = [(x: string) => 2, (x: Object) => 1]; // { (x:string) => number }[] >es : ((x: string) => number)[] >[(x: string) => 2, (x: Object) => 1] : ((x: string) => number)[] >(x: string) => 2 : (x: string) => number >x : string +>2 : number >(x: Object) => 1 : (x: Object) => number >x : Object >Object : Object +>1 : number var fs = [(a: { x: number; y?: number }) => 1, (b: { x: number; z?: number }) => 2]; // (a: { x: number; y?: number }) => number[] >fs : (((a: { x: number; y?: number; }) => number) | ((b: { x: number; z?: number; }) => number))[] @@ -60,10 +64,12 @@ var fs = [(a: { x: number; y?: number }) => 1, (b: { x: number; z?: number }) => >a : { x: number; y?: number; } >x : number >y : number +>1 : number >(b: { x: number; z?: number }) => 2 : (b: { x: number; z?: number; }) => number >b : { x: number; z?: number; } >x : number >z : number +>2 : number var gs = [(b: { x: number; z?: number }) => 2, (a: { x: number; y?: number }) => 1]; // (b: { x: number; z?: number }) => number[] >gs : (((b: { x: number; z?: number; }) => number) | ((a: { x: number; y?: number; }) => number))[] @@ -72,8 +78,10 @@ var gs = [(b: { x: number; z?: number }) => 2, (a: { x: number; y?: number }) => >b : { x: number; z?: number; } >x : number >z : number +>2 : number >(a: { x: number; y?: number }) => 1 : (a: { x: number; y?: number; }) => number >a : { x: number; y?: number; } >x : number >y : number +>1 : number diff --git a/tests/baselines/reference/arrayLiterals.symbols b/tests/baselines/reference/arrayLiterals.symbols new file mode 100644 index 00000000000..b338e7ff6e6 --- /dev/null +++ b/tests/baselines/reference/arrayLiterals.symbols @@ -0,0 +1,94 @@ +=== tests/cases/conformance/expressions/arrayLiterals/arrayLiterals.ts === +// Empty array literal with no contextual type has type Undefined[] + +var arr1= [[], [1], ['']]; +>arr1 : Symbol(arr1, Decl(arrayLiterals.ts, 2, 3)) + +var arr2 = [[null], [1], ['']]; +>arr2 : Symbol(arr2, Decl(arrayLiterals.ts, 4, 3)) + + +// Array literal with elements of only EveryType E has type E[] +var stringArrArr = [[''], [""]]; +>stringArrArr : Symbol(stringArrArr, Decl(arrayLiterals.ts, 8, 3)) + +var stringArr = ['', ""]; +>stringArr : Symbol(stringArr, Decl(arrayLiterals.ts, 10, 3)) + +var numberArr = [0, 0.0, 0x00, 1e1]; +>numberArr : Symbol(numberArr, Decl(arrayLiterals.ts, 12, 3)) + +var boolArr = [false, true, false, true]; +>boolArr : Symbol(boolArr, Decl(arrayLiterals.ts, 14, 3)) + +class C { private p; } +>C : Symbol(C, Decl(arrayLiterals.ts, 14, 41)) +>p : Symbol(p, Decl(arrayLiterals.ts, 16, 9)) + +var classArr = [new C(), new C()]; +>classArr : Symbol(classArr, Decl(arrayLiterals.ts, 17, 3)) +>C : Symbol(C, Decl(arrayLiterals.ts, 14, 41)) +>C : Symbol(C, Decl(arrayLiterals.ts, 14, 41)) + +var classTypeArray = [C, C, C]; +>classTypeArray : Symbol(classTypeArray, Decl(arrayLiterals.ts, 19, 3), Decl(arrayLiterals.ts, 20, 3)) +>C : Symbol(C, Decl(arrayLiterals.ts, 14, 41)) +>C : Symbol(C, Decl(arrayLiterals.ts, 14, 41)) +>C : Symbol(C, Decl(arrayLiterals.ts, 14, 41)) + +var classTypeArray: Array; // Should OK, not be a parse error +>classTypeArray : Symbol(classTypeArray, Decl(arrayLiterals.ts, 19, 3), Decl(arrayLiterals.ts, 20, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>C : Symbol(C, Decl(arrayLiterals.ts, 14, 41)) + +// Contextual type C with numeric index signature makes array literal of EveryType E of type BCT(E,C)[] +var context1: { [n: number]: { a: string; b: number; }; } = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; +>context1 : Symbol(context1, Decl(arrayLiterals.ts, 23, 3)) +>n : Symbol(n, Decl(arrayLiterals.ts, 23, 17)) +>a : Symbol(a, Decl(arrayLiterals.ts, 23, 30)) +>b : Symbol(b, Decl(arrayLiterals.ts, 23, 41)) +>a : Symbol(a, Decl(arrayLiterals.ts, 23, 62)) +>b : Symbol(b, Decl(arrayLiterals.ts, 23, 69)) +>c : Symbol(c, Decl(arrayLiterals.ts, 23, 75)) +>a : Symbol(a, Decl(arrayLiterals.ts, 23, 86)) +>b : Symbol(b, Decl(arrayLiterals.ts, 23, 93)) +>c : Symbol(c, Decl(arrayLiterals.ts, 23, 99)) + +var context2 = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; +>context2 : Symbol(context2, Decl(arrayLiterals.ts, 24, 3)) +>a : Symbol(a, Decl(arrayLiterals.ts, 24, 17)) +>b : Symbol(b, Decl(arrayLiterals.ts, 24, 24)) +>c : Symbol(c, Decl(arrayLiterals.ts, 24, 30)) +>a : Symbol(a, Decl(arrayLiterals.ts, 24, 41)) +>b : Symbol(b, Decl(arrayLiterals.ts, 24, 48)) +>c : Symbol(c, Decl(arrayLiterals.ts, 24, 54)) + +// Contextual type C with numeric index signature of type Base makes array literal of Derived have type Base[] +class Base { private p; } +>Base : Symbol(Base, Decl(arrayLiterals.ts, 24, 63)) +>p : Symbol(p, Decl(arrayLiterals.ts, 27, 12)) + +class Derived1 extends Base { private m }; +>Derived1 : Symbol(Derived1, Decl(arrayLiterals.ts, 27, 25)) +>Base : Symbol(Base, Decl(arrayLiterals.ts, 24, 63)) +>m : Symbol(m, Decl(arrayLiterals.ts, 28, 29)) + +class Derived2 extends Base { private n }; +>Derived2 : Symbol(Derived2, Decl(arrayLiterals.ts, 28, 42)) +>Base : Symbol(Base, Decl(arrayLiterals.ts, 24, 63)) +>n : Symbol(n, Decl(arrayLiterals.ts, 29, 29)) + +var context3: Base[] = [new Derived1(), new Derived2()]; +>context3 : Symbol(context3, Decl(arrayLiterals.ts, 30, 3)) +>Base : Symbol(Base, Decl(arrayLiterals.ts, 24, 63)) +>Derived1 : Symbol(Derived1, Decl(arrayLiterals.ts, 27, 25)) +>Derived2 : Symbol(Derived2, Decl(arrayLiterals.ts, 28, 42)) + +// Contextual type C with numeric index signature of type Base makes array literal of Derived1 and Derived2 have type Base[] +var context4: Base[] = [new Derived1(), new Derived1()]; +>context4 : Symbol(context4, Decl(arrayLiterals.ts, 33, 3)) +>Base : Symbol(Base, Decl(arrayLiterals.ts, 24, 63)) +>Derived1 : Symbol(Derived1, Decl(arrayLiterals.ts, 27, 25)) +>Derived1 : Symbol(Derived1, Decl(arrayLiterals.ts, 27, 25)) + + diff --git a/tests/baselines/reference/arrayLiterals.types b/tests/baselines/reference/arrayLiterals.types index b22543d3edf..841de336965 100644 --- a/tests/baselines/reference/arrayLiterals.types +++ b/tests/baselines/reference/arrayLiterals.types @@ -6,14 +6,19 @@ var arr1= [[], [1], ['']]; >[[], [1], ['']] : (string[] | number[])[] >[] : undefined[] >[1] : number[] +>1 : number >[''] : string[] +>'' : string var arr2 = [[null], [1], ['']]; >arr2 : (string[] | number[])[] >[[null], [1], ['']] : (string[] | number[])[] >[null] : null[] +>null : null >[1] : number[] +>1 : number >[''] : string[] +>'' : string // Array literal with elements of only EveryType E has type E[] @@ -21,19 +26,31 @@ var stringArrArr = [[''], [""]]; >stringArrArr : string[][] >[[''], [""]] : string[][] >[''] : string[] +>'' : string >[""] : string[] +>"" : string var stringArr = ['', ""]; >stringArr : string[] >['', ""] : string[] +>'' : string +>"" : string var numberArr = [0, 0.0, 0x00, 1e1]; >numberArr : number[] >[0, 0.0, 0x00, 1e1] : number[] +>0 : number +>0.0 : number +>0x00 : number +>1e1 : number var boolArr = [false, true, false, true]; >boolArr : boolean[] >[false, true, false, true] : boolean[] +>false : boolean +>true : boolean +>false : boolean +>true : boolean class C { private p; } >C : C @@ -68,24 +85,36 @@ var context1: { [n: number]: { a: string; b: number; }; } = [{ a: '', b: 0, c: ' >[{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }] : ({ a: string; b: number; c: string; } | { a: string; b: number; c: number; })[] >{ a: '', b: 0, c: '' } : { a: string; b: number; c: string; } >a : string +>'' : string >b : number +>0 : number >c : string +>'' : string >{ a: "", b: 3, c: 0 } : { a: string; b: number; c: number; } >a : string +>"" : string >b : number +>3 : number >c : number +>0 : number var context2 = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; >context2 : ({ a: string; b: number; c: string; } | { a: string; b: number; c: number; })[] >[{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }] : ({ a: string; b: number; c: string; } | { a: string; b: number; c: number; })[] >{ a: '', b: 0, c: '' } : { a: string; b: number; c: string; } >a : string +>'' : string >b : number +>0 : number >c : string +>'' : string >{ a: "", b: 3, c: 0 } : { a: string; b: number; c: number; } >a : string +>"" : string >b : number +>3 : number >c : number +>0 : number // Contextual type C with numeric index signature of type Base makes array literal of Derived have type Base[] class Base { private p; } diff --git a/tests/baselines/reference/arrayLiterals.types.pull b/tests/baselines/reference/arrayLiterals.types.pull deleted file mode 100644 index bd06540aca3..00000000000 --- a/tests/baselines/reference/arrayLiterals.types.pull +++ /dev/null @@ -1,124 +0,0 @@ -=== tests/cases/conformance/expressions/arrayLiterals/arrayLiterals.ts === -// Empty array literal with no contextual type has type Undefined[] - -var arr1= [[], [1], ['']]; ->arr1 : (number[] | string[])[] ->[[], [1], ['']] : (number[] | string[])[] ->[] : undefined[] ->[1] : number[] ->[''] : string[] - -var arr2 = [[null], [1], ['']]; ->arr2 : (number[] | string[])[] ->[[null], [1], ['']] : (number[] | string[])[] ->[null] : null[] ->[1] : number[] ->[''] : string[] - - -// Array literal with elements of only EveryType E has type E[] -var stringArrArr = [[''], [""]]; ->stringArrArr : string[][] ->[[''], [""]] : string[][] ->[''] : string[] ->[""] : string[] - -var stringArr = ['', ""]; ->stringArr : string[] ->['', ""] : string[] - -var numberArr = [0, 0.0, 0x00, 1e1]; ->numberArr : number[] ->[0, 0.0, 0x00, 1e1] : number[] - -var boolArr = [false, true, false, true]; ->boolArr : boolean[] ->[false, true, false, true] : boolean[] - -class C { private p; } ->C : C ->p : any - -var classArr = [new C(), new C()]; ->classArr : C[] ->[new C(), new C()] : C[] ->new C() : C ->C : typeof C ->new C() : C ->C : typeof C - -var classTypeArray = [C, C, C]; ->classTypeArray : typeof C[] ->[C, C, C] : typeof C[] ->C : typeof C ->C : typeof C ->C : typeof C - -var classTypeArray: Array; // Should OK, not be a parse error ->classTypeArray : typeof C[] ->Array : T[] ->C : typeof C - -// Contextual type C with numeric index signature makes array literal of EveryType E of type BCT(E,C)[] -var context1: { [n: number]: { a: string; b: number; }; } = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; ->context1 : { [n: number]: { a: string; b: number; }; } ->n : number ->a : string ->b : number ->[{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }] : ({ a: string; b: number; c: string; } | { a: string; b: number; c: number; })[] ->{ a: '', b: 0, c: '' } : { a: string; b: number; c: string; } ->a : string ->b : number ->c : string ->{ a: "", b: 3, c: 0 } : { a: string; b: number; c: number; } ->a : string ->b : number ->c : number - -var context2 = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; ->context2 : ({ a: string; b: number; c: string; } | { a: string; b: number; c: number; })[] ->[{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }] : ({ a: string; b: number; c: string; } | { a: string; b: number; c: number; })[] ->{ a: '', b: 0, c: '' } : { a: string; b: number; c: string; } ->a : string ->b : number ->c : string ->{ a: "", b: 3, c: 0 } : { a: string; b: number; c: number; } ->a : string ->b : number ->c : number - -// Contextual type C with numeric index signature of type Base makes array literal of Derived have type Base[] -class Base { private p; } ->Base : Base ->p : any - -class Derived1 extends Base { private m }; ->Derived1 : Derived1 ->Base : Base ->m : any - -class Derived2 extends Base { private n }; ->Derived2 : Derived2 ->Base : Base ->n : any - -var context3: Base[] = [new Derived1(), new Derived2()]; ->context3 : Base[] ->Base : Base ->[new Derived1(), new Derived2()] : (Derived1 | Derived2)[] ->new Derived1() : Derived1 ->Derived1 : typeof Derived1 ->new Derived2() : Derived2 ->Derived2 : typeof Derived2 - -// Contextual type C with numeric index signature of type Base makes array literal of Derived1 and Derived2 have type Base[] -var context4: Base[] = [new Derived1(), new Derived1()]; ->context4 : Base[] ->Base : Base ->[new Derived1(), new Derived1()] : Derived1[] ->new Derived1() : Derived1 ->Derived1 : typeof Derived1 ->new Derived1() : Derived1 ->Derived1 : typeof Derived1 - - diff --git a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.symbols b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.symbols new file mode 100644 index 00000000000..cd597dc2b4e --- /dev/null +++ b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.symbols @@ -0,0 +1,79 @@ +=== tests/cases/conformance/types/typeRelationships/recursiveTypes/arrayLiteralsWithRecursiveGenerics.ts === +class List { +>List : Symbol(List, Decl(arrayLiteralsWithRecursiveGenerics.ts, 0, 0)) +>T : Symbol(T, Decl(arrayLiteralsWithRecursiveGenerics.ts, 0, 11)) + + data: T; +>data : Symbol(data, Decl(arrayLiteralsWithRecursiveGenerics.ts, 0, 15)) +>T : Symbol(T, Decl(arrayLiteralsWithRecursiveGenerics.ts, 0, 11)) + + next: List>; +>next : Symbol(next, Decl(arrayLiteralsWithRecursiveGenerics.ts, 1, 12)) +>List : Symbol(List, Decl(arrayLiteralsWithRecursiveGenerics.ts, 0, 0)) +>List : Symbol(List, Decl(arrayLiteralsWithRecursiveGenerics.ts, 0, 0)) +>T : Symbol(T, Decl(arrayLiteralsWithRecursiveGenerics.ts, 0, 11)) +} + +class DerivedList extends List { +>DerivedList : Symbol(DerivedList, Decl(arrayLiteralsWithRecursiveGenerics.ts, 3, 1)) +>U : Symbol(U, Decl(arrayLiteralsWithRecursiveGenerics.ts, 5, 18)) +>List : Symbol(List, Decl(arrayLiteralsWithRecursiveGenerics.ts, 0, 0)) +>U : Symbol(U, Decl(arrayLiteralsWithRecursiveGenerics.ts, 5, 18)) + + foo: U; +>foo : Symbol(foo, Decl(arrayLiteralsWithRecursiveGenerics.ts, 5, 38)) +>U : Symbol(U, Decl(arrayLiteralsWithRecursiveGenerics.ts, 5, 18)) + + // next: List> +} + +class MyList { +>MyList : Symbol(MyList, Decl(arrayLiteralsWithRecursiveGenerics.ts, 8, 1)) +>T : Symbol(T, Decl(arrayLiteralsWithRecursiveGenerics.ts, 10, 13)) + + data: T; +>data : Symbol(data, Decl(arrayLiteralsWithRecursiveGenerics.ts, 10, 17)) +>T : Symbol(T, Decl(arrayLiteralsWithRecursiveGenerics.ts, 10, 13)) + + next: MyList>; +>next : Symbol(next, Decl(arrayLiteralsWithRecursiveGenerics.ts, 11, 12)) +>MyList : Symbol(MyList, Decl(arrayLiteralsWithRecursiveGenerics.ts, 8, 1)) +>MyList : Symbol(MyList, Decl(arrayLiteralsWithRecursiveGenerics.ts, 8, 1)) +>T : Symbol(T, Decl(arrayLiteralsWithRecursiveGenerics.ts, 10, 13)) +} + +var list: List; +>list : Symbol(list, Decl(arrayLiteralsWithRecursiveGenerics.ts, 15, 3)) +>List : Symbol(List, Decl(arrayLiteralsWithRecursiveGenerics.ts, 0, 0)) + +var list2: List; +>list2 : Symbol(list2, Decl(arrayLiteralsWithRecursiveGenerics.ts, 16, 3)) +>List : Symbol(List, Decl(arrayLiteralsWithRecursiveGenerics.ts, 0, 0)) + +var myList: MyList; +>myList : Symbol(myList, Decl(arrayLiteralsWithRecursiveGenerics.ts, 17, 3)) +>MyList : Symbol(MyList, Decl(arrayLiteralsWithRecursiveGenerics.ts, 8, 1)) + +var xs = [list, myList]; // {}[] +>xs : Symbol(xs, Decl(arrayLiteralsWithRecursiveGenerics.ts, 19, 3)) +>list : Symbol(list, Decl(arrayLiteralsWithRecursiveGenerics.ts, 15, 3)) +>myList : Symbol(myList, Decl(arrayLiteralsWithRecursiveGenerics.ts, 17, 3)) + +var ys = [list, list2]; // {}[] +>ys : Symbol(ys, Decl(arrayLiteralsWithRecursiveGenerics.ts, 20, 3)) +>list : Symbol(list, Decl(arrayLiteralsWithRecursiveGenerics.ts, 15, 3)) +>list2 : Symbol(list2, Decl(arrayLiteralsWithRecursiveGenerics.ts, 16, 3)) + +var zs = [list, null]; // List[] +>zs : Symbol(zs, Decl(arrayLiteralsWithRecursiveGenerics.ts, 21, 3)) +>list : Symbol(list, Decl(arrayLiteralsWithRecursiveGenerics.ts, 15, 3)) + +var myDerivedList: DerivedList; +>myDerivedList : Symbol(myDerivedList, Decl(arrayLiteralsWithRecursiveGenerics.ts, 23, 3)) +>DerivedList : Symbol(DerivedList, Decl(arrayLiteralsWithRecursiveGenerics.ts, 3, 1)) + +var as = [list, myDerivedList]; // List[] +>as : Symbol(as, Decl(arrayLiteralsWithRecursiveGenerics.ts, 24, 3)) +>list : Symbol(list, Decl(arrayLiteralsWithRecursiveGenerics.ts, 15, 3)) +>myDerivedList : Symbol(myDerivedList, Decl(arrayLiteralsWithRecursiveGenerics.ts, 23, 3)) + diff --git a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.types b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.types index 1496e99adca..9b2abf25c2d 100644 --- a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.types +++ b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.types @@ -70,6 +70,7 @@ var zs = [list, null]; // List[] >zs : List[] >[list, null] : List[] >list : List +>null : null var myDerivedList: DerivedList; >myDerivedList : DerivedList diff --git a/tests/baselines/reference/arrayOfExportedClass.symbols b/tests/baselines/reference/arrayOfExportedClass.symbols new file mode 100644 index 00000000000..3d0905a1e2d --- /dev/null +++ b/tests/baselines/reference/arrayOfExportedClass.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/arrayOfExportedClass_1.ts === +/// +import Car = require('arrayOfExportedClass_0'); +>Car : Symbol(Car, Decl(arrayOfExportedClass_1.ts, 0, 0)) + +class Road { +>Road : Symbol(Road, Decl(arrayOfExportedClass_1.ts, 1, 47)) + + public cars: Car[]; +>cars : Symbol(cars, Decl(arrayOfExportedClass_1.ts, 3, 12)) +>Car : Symbol(Car, Decl(arrayOfExportedClass_1.ts, 0, 0)) + + public AddCars(cars: Car[]) { +>AddCars : Symbol(AddCars, Decl(arrayOfExportedClass_1.ts, 5, 23)) +>cars : Symbol(cars, Decl(arrayOfExportedClass_1.ts, 7, 19)) +>Car : Symbol(Car, Decl(arrayOfExportedClass_1.ts, 0, 0)) + + this.cars = cars; +>this.cars : Symbol(cars, Decl(arrayOfExportedClass_1.ts, 3, 12)) +>this : Symbol(Road, Decl(arrayOfExportedClass_1.ts, 1, 47)) +>cars : Symbol(cars, Decl(arrayOfExportedClass_1.ts, 3, 12)) +>cars : Symbol(cars, Decl(arrayOfExportedClass_1.ts, 7, 19)) + } +} + +export = Road; +>Road : Symbol(Road, Decl(arrayOfExportedClass_1.ts, 1, 47)) + +=== tests/cases/compiler/arrayOfExportedClass_0.ts === +class Car { +>Car : Symbol(Car, Decl(arrayOfExportedClass_0.ts, 0, 0)) + + foo: string; +>foo : Symbol(foo, Decl(arrayOfExportedClass_0.ts, 0, 11)) +} + +export = Car; +>Car : Symbol(Car, Decl(arrayOfExportedClass_0.ts, 0, 0)) + diff --git a/tests/baselines/reference/arrayOfFunctionTypes3.symbols b/tests/baselines/reference/arrayOfFunctionTypes3.symbols new file mode 100644 index 00000000000..d26effeb5b7 --- /dev/null +++ b/tests/baselines/reference/arrayOfFunctionTypes3.symbols @@ -0,0 +1,93 @@ +=== tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayOfFunctionTypes3.ts === +// valid uses of arrays of function types + +var x = [() => 1, () => { }]; +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 2, 3)) + +var r2 = x[0](); +>r2 : Symbol(r2, Decl(arrayOfFunctionTypes3.ts, 3, 3)) +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 2, 3)) + +class C { +>C : Symbol(C, Decl(arrayOfFunctionTypes3.ts, 3, 16)) + + foo: string; +>foo : Symbol(foo, Decl(arrayOfFunctionTypes3.ts, 5, 9)) +} +var y = [C, C]; +>y : Symbol(y, Decl(arrayOfFunctionTypes3.ts, 8, 3)) +>C : Symbol(C, Decl(arrayOfFunctionTypes3.ts, 3, 16)) +>C : Symbol(C, Decl(arrayOfFunctionTypes3.ts, 3, 16)) + +var r3 = new y[0](); +>r3 : Symbol(r3, Decl(arrayOfFunctionTypes3.ts, 9, 3)) +>y : Symbol(y, Decl(arrayOfFunctionTypes3.ts, 8, 3)) + +var a: { (x: number): number; (x: string): string; }; +>a : Symbol(a, Decl(arrayOfFunctionTypes3.ts, 11, 3)) +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 11, 10)) +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 11, 31)) + +var b: { (x: number): number; (x: string): string; }; +>b : Symbol(b, Decl(arrayOfFunctionTypes3.ts, 12, 3)) +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 12, 10)) +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 12, 31)) + +var c: { (x: number): number; (x: any): any; }; +>c : Symbol(c, Decl(arrayOfFunctionTypes3.ts, 13, 3)) +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 13, 10)) +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 13, 31)) + +var z = [a, b, c]; +>z : Symbol(z, Decl(arrayOfFunctionTypes3.ts, 14, 3)) +>a : Symbol(a, Decl(arrayOfFunctionTypes3.ts, 11, 3)) +>b : Symbol(b, Decl(arrayOfFunctionTypes3.ts, 12, 3)) +>c : Symbol(c, Decl(arrayOfFunctionTypes3.ts, 13, 3)) + +var r4 = z[0]; +>r4 : Symbol(r4, Decl(arrayOfFunctionTypes3.ts, 15, 3)) +>z : Symbol(z, Decl(arrayOfFunctionTypes3.ts, 14, 3)) + +var r5 = r4(''); // any not string +>r5 : Symbol(r5, Decl(arrayOfFunctionTypes3.ts, 16, 3)) +>r4 : Symbol(r4, Decl(arrayOfFunctionTypes3.ts, 15, 3)) + +var r5b = r4(1); +>r5b : Symbol(r5b, Decl(arrayOfFunctionTypes3.ts, 17, 3)) +>r4 : Symbol(r4, Decl(arrayOfFunctionTypes3.ts, 15, 3)) + +var a2: { (x: T): number; (x: string): string;}; +>a2 : Symbol(a2, Decl(arrayOfFunctionTypes3.ts, 19, 3)) +>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 19, 11)) +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 19, 14)) +>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 19, 11)) +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 19, 30)) + +var b2: { (x: T): number; (x: string): string; }; +>b2 : Symbol(b2, Decl(arrayOfFunctionTypes3.ts, 20, 3)) +>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 20, 11)) +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 20, 14)) +>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 20, 11)) +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 20, 30)) + +var c2: { (x: number): number; (x: T): any; }; +>c2 : Symbol(c2, Decl(arrayOfFunctionTypes3.ts, 21, 3)) +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 21, 11)) +>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 21, 32)) +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 21, 35)) +>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 21, 32)) + +var z2 = [a2, b2, c2]; +>z2 : Symbol(z2, Decl(arrayOfFunctionTypes3.ts, 23, 3)) +>a2 : Symbol(a2, Decl(arrayOfFunctionTypes3.ts, 19, 3)) +>b2 : Symbol(b2, Decl(arrayOfFunctionTypes3.ts, 20, 3)) +>c2 : Symbol(c2, Decl(arrayOfFunctionTypes3.ts, 21, 3)) + +var r6 = z2[0]; +>r6 : Symbol(r6, Decl(arrayOfFunctionTypes3.ts, 24, 3)) +>z2 : Symbol(z2, Decl(arrayOfFunctionTypes3.ts, 23, 3)) + +var r7 = r6(''); // any not string +>r7 : Symbol(r7, Decl(arrayOfFunctionTypes3.ts, 25, 3)) +>r6 : Symbol(r6, Decl(arrayOfFunctionTypes3.ts, 24, 3)) + diff --git a/tests/baselines/reference/arrayOfFunctionTypes3.types b/tests/baselines/reference/arrayOfFunctionTypes3.types index 3ef5334382c..0ed92991ed0 100644 --- a/tests/baselines/reference/arrayOfFunctionTypes3.types +++ b/tests/baselines/reference/arrayOfFunctionTypes3.types @@ -5,6 +5,7 @@ var x = [() => 1, () => { }]; >x : (() => void)[] >[() => 1, () => { }] : (() => void)[] >() => 1 : () => number +>1 : number >() => { } : () => void var r2 = x[0](); @@ -12,6 +13,7 @@ var r2 = x[0](); >x[0]() : void >x[0] : () => void >x : (() => void)[] +>0 : number class C { >C : C @@ -30,6 +32,7 @@ var r3 = new y[0](); >new y[0]() : C >y[0] : typeof C >y : typeof C[] +>0 : number var a: { (x: number): number; (x: string): string; }; >a : { (x: number): number; (x: string): string; } @@ -57,16 +60,19 @@ var r4 = z[0]; >r4 : { (x: number): number; (x: any): any; } >z[0] : { (x: number): number; (x: any): any; } >z : { (x: number): number; (x: any): any; }[] +>0 : number var r5 = r4(''); // any not string >r5 : any >r4('') : any >r4 : { (x: number): number; (x: any): any; } +>'' : string var r5b = r4(1); >r5b : number >r4(1) : number >r4 : { (x: number): number; (x: any): any; } +>1 : number var a2: { (x: T): number; (x: string): string;}; >a2 : { (x: T): number; (x: string): string; } @@ -100,9 +106,11 @@ var r6 = z2[0]; >r6 : { (x: number): number; (x: T): any; } >z2[0] : { (x: number): number; (x: T): any; } >z2 : { (x: number): number; (x: T): any; }[] +>0 : number var r7 = r6(''); // any not string >r7 : any >r6('') : any >r6 : { (x: number): number; (x: T): any; } +>'' : string diff --git a/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.symbols b/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.symbols new file mode 100644 index 00000000000..d9665e98eb5 --- /dev/null +++ b/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.symbols @@ -0,0 +1,89 @@ +=== tests/cases/compiler/arrayTypeInSignatureOfInterfaceAndClass.ts === +declare module WinJS { +>WinJS : Symbol(WinJS, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 0, 0)) + + class Promise { +>Promise : Symbol(Promise, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 0, 22)) +>T : Symbol(T, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 1, 18)) + + then(success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; +>then : Symbol(then, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 1, 22)) +>U : Symbol(U, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 2, 13)) +>success : Symbol(success, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 2, 16)) +>value : Symbol(value, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 2, 27)) +>T : Symbol(T, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 1, 18)) +>Promise : Symbol(Promise, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 0, 22)) +>U : Symbol(U, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 2, 13)) +>error : Symbol(error, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 2, 51)) +>error : Symbol(error, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 2, 61)) +>Promise : Symbol(Promise, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 0, 22)) +>U : Symbol(U, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 2, 13)) +>progress : Symbol(progress, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 2, 87)) +>progress : Symbol(progress, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 2, 100)) +>Promise : Symbol(Promise, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 0, 22)) +>U : Symbol(U, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 2, 13)) + } +} +declare module Data { +>Data : Symbol(Data, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 4, 1)) + + export interface IListItem { +>IListItem : Symbol(IListItem, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 5, 21)) +>T : Symbol(T, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 6, 31)) + + itemIndex: number; +>itemIndex : Symbol(itemIndex, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 6, 35)) + + key: any; +>key : Symbol(key, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 7, 26)) + + data: T; +>data : Symbol(data, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 8, 17)) +>T : Symbol(T, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 6, 31)) + + group: any; +>group : Symbol(group, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 9, 16)) + + isHeader: boolean; +>isHeader : Symbol(isHeader, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 10, 19)) + + cached: boolean; +>cached : Symbol(cached, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 11, 26)) + + isNonSourceData: boolean; +>isNonSourceData : Symbol(isNonSourceData, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 12, 24)) + + preventAugmentation: boolean; +>preventAugmentation : Symbol(preventAugmentation, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 13, 33)) + } + export interface IVirtualList { +>IVirtualList : Symbol(IVirtualList, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 15, 5)) +>T : Symbol(T, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 16, 34)) + + //removeIndices: WinJS.Promise[]>; + removeIndices(indices: number[], options?: any): WinJS.Promise[]>; +>removeIndices : Symbol(removeIndices, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 16, 38)) +>indices : Symbol(indices, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 18, 22)) +>options : Symbol(options, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 18, 40)) +>WinJS : Symbol(WinJS, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 0, 0)) +>Promise : Symbol(WinJS.Promise, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 0, 22)) +>IListItem : Symbol(IListItem, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 5, 21)) +>T : Symbol(T, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 16, 34)) + } + export class VirtualList implements IVirtualList { +>VirtualList : Symbol(VirtualList, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 19, 5)) +>T : Symbol(T, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 20, 29)) +>IVirtualList : Symbol(IVirtualList, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 15, 5)) +>T : Symbol(T, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 20, 29)) + + //removeIndices: WinJS.Promise[]>; + public removeIndices(indices: number[], options?: any): WinJS.Promise[]>; +>removeIndices : Symbol(removeIndices, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 20, 60)) +>indices : Symbol(indices, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 22, 29)) +>options : Symbol(options, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 22, 47)) +>WinJS : Symbol(WinJS, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 0, 0)) +>Promise : Symbol(WinJS.Promise, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 0, 22)) +>IListItem : Symbol(IListItem, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 5, 21)) +>T : Symbol(T, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 20, 29)) + } +} diff --git a/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.types b/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.types index 419db571c05..57a8c73e5e6 100644 --- a/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.types +++ b/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.types @@ -65,7 +65,7 @@ declare module Data { >removeIndices : (indices: number[], options?: any) => WinJS.Promise[]> >indices : number[] >options : any ->WinJS : unknown +>WinJS : any >Promise : WinJS.Promise >IListItem : IListItem >T : T @@ -81,7 +81,7 @@ declare module Data { >removeIndices : (indices: number[], options?: any) => WinJS.Promise[]> >indices : number[] >options : any ->WinJS : unknown +>WinJS : any >Promise : WinJS.Promise >IListItem : IListItem >T : T diff --git a/tests/baselines/reference/arrayconcat.symbols b/tests/baselines/reference/arrayconcat.symbols new file mode 100644 index 00000000000..64e63d7c2ec --- /dev/null +++ b/tests/baselines/reference/arrayconcat.symbols @@ -0,0 +1,81 @@ +=== tests/cases/compiler/arrayconcat.ts === +interface IOptions { +>IOptions : Symbol(IOptions, Decl(arrayconcat.ts, 0, 0)) + + name?: string; +>name : Symbol(name, Decl(arrayconcat.ts, 0, 20)) + + flag?: boolean; +>flag : Symbol(flag, Decl(arrayconcat.ts, 1, 18)) + + short?: string; +>short : Symbol(short, Decl(arrayconcat.ts, 2, 19)) + + usage?: string; +>usage : Symbol(usage, Decl(arrayconcat.ts, 3, 19)) + + set?: (s: string) => void; +>set : Symbol(set, Decl(arrayconcat.ts, 4, 19)) +>s : Symbol(s, Decl(arrayconcat.ts, 5, 11)) + + type?: string; +>type : Symbol(type, Decl(arrayconcat.ts, 5, 30)) + + experimental?: boolean; +>experimental : Symbol(experimental, Decl(arrayconcat.ts, 6, 18)) +} + +class parser { +>parser : Symbol(parser, Decl(arrayconcat.ts, 8, 1)) + + public options: IOptions[]; +>options : Symbol(options, Decl(arrayconcat.ts, 10, 14)) +>IOptions : Symbol(IOptions, Decl(arrayconcat.ts, 0, 0)) + + public m() { +>m : Symbol(m, Decl(arrayconcat.ts, 11, 28)) + + this.options = this.options.sort(function(a, b) { +>this.options : Symbol(options, Decl(arrayconcat.ts, 10, 14)) +>this : Symbol(parser, Decl(arrayconcat.ts, 8, 1)) +>options : Symbol(options, Decl(arrayconcat.ts, 10, 14)) +>this.options.sort : Symbol(Array.sort, Decl(lib.d.ts, 1054, 45)) +>this.options : Symbol(options, Decl(arrayconcat.ts, 10, 14)) +>this : Symbol(parser, Decl(arrayconcat.ts, 8, 1)) +>options : Symbol(options, Decl(arrayconcat.ts, 10, 14)) +>sort : Symbol(Array.sort, Decl(lib.d.ts, 1054, 45)) +>a : Symbol(a, Decl(arrayconcat.ts, 14, 44)) +>b : Symbol(b, Decl(arrayconcat.ts, 14, 46)) + + var aName = a.name.toLowerCase(); +>aName : Symbol(aName, Decl(arrayconcat.ts, 15, 15)) +>a.name.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, 399, 51)) +>a.name : Symbol(IOptions.name, Decl(arrayconcat.ts, 0, 20)) +>a : Symbol(a, Decl(arrayconcat.ts, 14, 44)) +>name : Symbol(IOptions.name, Decl(arrayconcat.ts, 0, 20)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, 399, 51)) + + var bName = b.name.toLowerCase(); +>bName : Symbol(bName, Decl(arrayconcat.ts, 16, 15)) +>b.name.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, 399, 51)) +>b.name : Symbol(IOptions.name, Decl(arrayconcat.ts, 0, 20)) +>b : Symbol(b, Decl(arrayconcat.ts, 14, 46)) +>name : Symbol(IOptions.name, Decl(arrayconcat.ts, 0, 20)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, 399, 51)) + + if (aName > bName) { +>aName : Symbol(aName, Decl(arrayconcat.ts, 15, 15)) +>bName : Symbol(bName, Decl(arrayconcat.ts, 16, 15)) + + return 1; + } else if (aName < bName) { +>aName : Symbol(aName, Decl(arrayconcat.ts, 15, 15)) +>bName : Symbol(bName, Decl(arrayconcat.ts, 16, 15)) + + return -1; + } else { + return 0; + } + }); + } +} diff --git a/tests/baselines/reference/arrayconcat.types b/tests/baselines/reference/arrayconcat.types index 37e7308aad9..3560272a363 100644 --- a/tests/baselines/reference/arrayconcat.types +++ b/tests/baselines/reference/arrayconcat.types @@ -74,6 +74,8 @@ class parser { >bName : string return 1; +>1 : number + } else if (aName < bName) { >aName < bName : boolean >aName : string @@ -81,9 +83,11 @@ class parser { return -1; >-1 : number +>1 : number } else { return 0; +>0 : number } }); } diff --git a/tests/baselines/reference/arrowFunctionExpressions.js b/tests/baselines/reference/arrowFunctionExpressions.js index 68516b52cb2..5e365291da7 100644 --- a/tests/baselines/reference/arrowFunctionExpressions.js +++ b/tests/baselines/reference/arrowFunctionExpressions.js @@ -13,6 +13,17 @@ var d = n => c = n; var d = (n) => c = n; var d: (n: any) => any; +// Binding patterns in arrow functions +var p1 = ([a]) => { }; +var p2 = ([...a]) => { }; +var p3 = ([, a]) => { }; +var p4 = ([, ...a]) => { }; +var p5 = ([a = 1]) => { }; +var p6 = ({ a }) => { }; +var p7 = ({ a: { b } }) => { }; +var p8 = ({ a = 1 }) => { }; +var p9 = ({ a: { b = 1 } = { b: 1 } }) => { }; +var p10 = ([{ value, done }]) => { }; // Arrow function used in class member initializer // Arrow function used in class member function @@ -100,6 +111,37 @@ var c; var d = function (n) { return c = n; }; var d = function (n) { return c = n; }; var d; +// Binding patterns in arrow functions +var p1 = function (_a) { + var a = _a[0]; +}; +var p2 = function (_a) { + var a = _a.slice(0); +}; +var p3 = function (_a) { + var a = _a[1]; +}; +var p4 = function (_a) { + var a = _a.slice(1); +}; +var p5 = function (_a) { + var _b = _a[0], a = _b === void 0 ? 1 : _b; +}; +var p6 = function (_a) { + var a = _a.a; +}; +var p7 = function (_a) { + var b = _a.a.b; +}; +var p8 = function (_a) { + var _b = _a.a, a = _b === void 0 ? 1 : _b; +}; +var p9 = function (_a) { + var _b = _a.a, _c = (_b === void 0 ? { b: 1 } : _b).b, b = _c === void 0 ? 1 : _c; +}; +var p10 = function (_a) { + var _b = _a[0], value = _b.value, done = _b.done; +}; // Arrow function used in class member initializer // Arrow function used in class member function var MyClass = (function () { diff --git a/tests/baselines/reference/arrowFunctionExpressions.symbols b/tests/baselines/reference/arrowFunctionExpressions.symbols new file mode 100644 index 00000000000..28945e1179f --- /dev/null +++ b/tests/baselines/reference/arrowFunctionExpressions.symbols @@ -0,0 +1,262 @@ +=== tests/cases/conformance/expressions/functions/arrowFunctionExpressions.ts === +// ArrowFormalParameters => AssignmentExpression is equivalent to ArrowFormalParameters => { return AssignmentExpression; } +var a = (p: string) => p.length; +>a : Symbol(a, Decl(arrowFunctionExpressions.ts, 1, 3), Decl(arrowFunctionExpressions.ts, 2, 3)) +>p : Symbol(p, Decl(arrowFunctionExpressions.ts, 1, 9)) +>p.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>p : Symbol(p, Decl(arrowFunctionExpressions.ts, 1, 9)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + +var a = (p: string) => { return p.length; } +>a : Symbol(a, Decl(arrowFunctionExpressions.ts, 1, 3), Decl(arrowFunctionExpressions.ts, 2, 3)) +>p : Symbol(p, Decl(arrowFunctionExpressions.ts, 2, 9)) +>p.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>p : Symbol(p, Decl(arrowFunctionExpressions.ts, 2, 9)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + +// Identifier => Block is equivalent to(Identifier) => Block +var b = j => { return 0; } +>b : Symbol(b, Decl(arrowFunctionExpressions.ts, 5, 3), Decl(arrowFunctionExpressions.ts, 6, 3)) +>j : Symbol(j, Decl(arrowFunctionExpressions.ts, 5, 7)) + +var b = (j) => { return 0; } +>b : Symbol(b, Decl(arrowFunctionExpressions.ts, 5, 3), Decl(arrowFunctionExpressions.ts, 6, 3)) +>j : Symbol(j, Decl(arrowFunctionExpressions.ts, 6, 9)) + +// Identifier => AssignmentExpression is equivalent to(Identifier) => AssignmentExpression +var c: number; +>c : Symbol(c, Decl(arrowFunctionExpressions.ts, 9, 3)) + +var d = n => c = n; +>d : Symbol(d, Decl(arrowFunctionExpressions.ts, 10, 3), Decl(arrowFunctionExpressions.ts, 11, 3), Decl(arrowFunctionExpressions.ts, 12, 3)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 10, 7)) +>c : Symbol(c, Decl(arrowFunctionExpressions.ts, 9, 3)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 10, 7)) + +var d = (n) => c = n; +>d : Symbol(d, Decl(arrowFunctionExpressions.ts, 10, 3), Decl(arrowFunctionExpressions.ts, 11, 3), Decl(arrowFunctionExpressions.ts, 12, 3)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 11, 9)) +>c : Symbol(c, Decl(arrowFunctionExpressions.ts, 9, 3)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 11, 9)) + +var d: (n: any) => any; +>d : Symbol(d, Decl(arrowFunctionExpressions.ts, 10, 3), Decl(arrowFunctionExpressions.ts, 11, 3), Decl(arrowFunctionExpressions.ts, 12, 3)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 12, 8)) + +// Binding patterns in arrow functions +var p1 = ([a]) => { }; +>p1 : Symbol(p1, Decl(arrowFunctionExpressions.ts, 15, 3)) +>a : Symbol(a, Decl(arrowFunctionExpressions.ts, 15, 11)) + +var p2 = ([...a]) => { }; +>p2 : Symbol(p2, Decl(arrowFunctionExpressions.ts, 16, 3)) +>a : Symbol(a, Decl(arrowFunctionExpressions.ts, 16, 11)) + +var p3 = ([, a]) => { }; +>p3 : Symbol(p3, Decl(arrowFunctionExpressions.ts, 17, 3)) +>a : Symbol(a, Decl(arrowFunctionExpressions.ts, 17, 12)) + +var p4 = ([, ...a]) => { }; +>p4 : Symbol(p4, Decl(arrowFunctionExpressions.ts, 18, 3)) +>a : Symbol(a, Decl(arrowFunctionExpressions.ts, 18, 12)) + +var p5 = ([a = 1]) => { }; +>p5 : Symbol(p5, Decl(arrowFunctionExpressions.ts, 19, 3)) +>a : Symbol(a, Decl(arrowFunctionExpressions.ts, 19, 11)) + +var p6 = ({ a }) => { }; +>p6 : Symbol(p6, Decl(arrowFunctionExpressions.ts, 20, 3)) +>a : Symbol(a, Decl(arrowFunctionExpressions.ts, 20, 11)) + +var p7 = ({ a: { b } }) => { }; +>p7 : Symbol(p7, Decl(arrowFunctionExpressions.ts, 21, 3)) +>b : Symbol(b, Decl(arrowFunctionExpressions.ts, 21, 16)) + +var p8 = ({ a = 1 }) => { }; +>p8 : Symbol(p8, Decl(arrowFunctionExpressions.ts, 22, 3)) +>a : Symbol(a, Decl(arrowFunctionExpressions.ts, 22, 11)) + +var p9 = ({ a: { b = 1 } = { b: 1 } }) => { }; +>p9 : Symbol(p9, Decl(arrowFunctionExpressions.ts, 23, 3)) +>b : Symbol(b, Decl(arrowFunctionExpressions.ts, 23, 16)) +>b : Symbol(b, Decl(arrowFunctionExpressions.ts, 23, 28)) + +var p10 = ([{ value, done }]) => { }; +>p10 : Symbol(p10, Decl(arrowFunctionExpressions.ts, 24, 3)) +>value : Symbol(value, Decl(arrowFunctionExpressions.ts, 24, 13)) +>done : Symbol(done, Decl(arrowFunctionExpressions.ts, 24, 20)) + +// Arrow function used in class member initializer +// Arrow function used in class member function +class MyClass { +>MyClass : Symbol(MyClass, Decl(arrowFunctionExpressions.ts, 24, 37)) + + m = (n) => n + 1; +>m : Symbol(m, Decl(arrowFunctionExpressions.ts, 28, 15)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 29, 9)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 29, 9)) + + p = (n) => n && this; +>p : Symbol(p, Decl(arrowFunctionExpressions.ts, 29, 21)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 30, 9)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 30, 9)) +>this : Symbol(MyClass, Decl(arrowFunctionExpressions.ts, 24, 37)) + + fn() { +>fn : Symbol(fn, Decl(arrowFunctionExpressions.ts, 30, 25)) + + var m = (n) => n + 1; +>m : Symbol(m, Decl(arrowFunctionExpressions.ts, 33, 11)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 33, 17)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 33, 17)) + + var p = (n) => n && this; +>p : Symbol(p, Decl(arrowFunctionExpressions.ts, 34, 11)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 34, 17)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 34, 17)) +>this : Symbol(MyClass, Decl(arrowFunctionExpressions.ts, 24, 37)) + } +} + +// Arrow function used in arrow function +var arrrr = () => (m: number) => () => (n: number) => m + n; +>arrrr : Symbol(arrrr, Decl(arrowFunctionExpressions.ts, 39, 3)) +>m : Symbol(m, Decl(arrowFunctionExpressions.ts, 39, 19)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 39, 40)) +>m : Symbol(m, Decl(arrowFunctionExpressions.ts, 39, 19)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 39, 40)) + +var e = arrrr()(3)()(4); +>e : Symbol(e, Decl(arrowFunctionExpressions.ts, 40, 3), Decl(arrowFunctionExpressions.ts, 41, 3)) +>arrrr : Symbol(arrrr, Decl(arrowFunctionExpressions.ts, 39, 3)) + +var e: number; +>e : Symbol(e, Decl(arrowFunctionExpressions.ts, 40, 3), Decl(arrowFunctionExpressions.ts, 41, 3)) + +// Arrow function used in arrow function used in function +function someFn() { +>someFn : Symbol(someFn, Decl(arrowFunctionExpressions.ts, 41, 14)) + + var arr = (n: number) => (p: number) => p * n; +>arr : Symbol(arr, Decl(arrowFunctionExpressions.ts, 45, 7)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 45, 15)) +>p : Symbol(p, Decl(arrowFunctionExpressions.ts, 45, 30)) +>p : Symbol(p, Decl(arrowFunctionExpressions.ts, 45, 30)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 45, 15)) + + arr(3)(4).toExponential(); +>arr(3)(4).toExponential : Symbol(Number.toExponential, Decl(lib.d.ts, 469, 45)) +>arr : Symbol(arr, Decl(arrowFunctionExpressions.ts, 45, 7)) +>toExponential : Symbol(Number.toExponential, Decl(lib.d.ts, 469, 45)) +} + +// Arrow function used in function +function someOtherFn() { +>someOtherFn : Symbol(someOtherFn, Decl(arrowFunctionExpressions.ts, 47, 1)) + + var arr = (n: number) => '' + n; +>arr : Symbol(arr, Decl(arrowFunctionExpressions.ts, 51, 7)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 51, 15)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 51, 15)) + + arr(4).charAt(0); +>arr(4).charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>arr : Symbol(arr, Decl(arrowFunctionExpressions.ts, 51, 7)) +>charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +} + +// Arrow function used in nested function in function +function outerFn() { +>outerFn : Symbol(outerFn, Decl(arrowFunctionExpressions.ts, 53, 1)) + + function innerFn() { +>innerFn : Symbol(innerFn, Decl(arrowFunctionExpressions.ts, 56, 20)) + + var arrowFn = () => { }; +>arrowFn : Symbol(arrowFn, Decl(arrowFunctionExpressions.ts, 58, 11)) + + var p = arrowFn(); +>p : Symbol(p, Decl(arrowFunctionExpressions.ts, 59, 11), Decl(arrowFunctionExpressions.ts, 60, 11)) +>arrowFn : Symbol(arrowFn, Decl(arrowFunctionExpressions.ts, 58, 11)) + + var p: void; +>p : Symbol(p, Decl(arrowFunctionExpressions.ts, 59, 11), Decl(arrowFunctionExpressions.ts, 60, 11)) + } +} + +// Arrow function used in nested function in arrow function +var f = (n: string) => { +>f : Symbol(f, Decl(arrowFunctionExpressions.ts, 65, 3)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 65, 9)) + + function fn(x: number) { +>fn : Symbol(fn, Decl(arrowFunctionExpressions.ts, 65, 24)) +>x : Symbol(x, Decl(arrowFunctionExpressions.ts, 66, 16)) + + return () => n + x; +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 65, 9)) +>x : Symbol(x, Decl(arrowFunctionExpressions.ts, 66, 16)) + } + return fn(4); +>fn : Symbol(fn, Decl(arrowFunctionExpressions.ts, 65, 24)) +} +var g = f('')(); +>g : Symbol(g, Decl(arrowFunctionExpressions.ts, 71, 3), Decl(arrowFunctionExpressions.ts, 72, 3)) +>f : Symbol(f, Decl(arrowFunctionExpressions.ts, 65, 3)) + +var g: string; +>g : Symbol(g, Decl(arrowFunctionExpressions.ts, 71, 3), Decl(arrowFunctionExpressions.ts, 72, 3)) + + +// Arrow function used in nested function in arrow function in nested function +function someOuterFn() { +>someOuterFn : Symbol(someOuterFn, Decl(arrowFunctionExpressions.ts, 72, 14)) + + var arr = (n: string) => { +>arr : Symbol(arr, Decl(arrowFunctionExpressions.ts, 77, 7)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 77, 15)) + + function innerFn() { +>innerFn : Symbol(innerFn, Decl(arrowFunctionExpressions.ts, 77, 30)) + + return () => n.length; +>n.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 77, 15)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + } + return innerFn; +>innerFn : Symbol(innerFn, Decl(arrowFunctionExpressions.ts, 77, 30)) + } + return arr; +>arr : Symbol(arr, Decl(arrowFunctionExpressions.ts, 77, 7)) +} +var h = someOuterFn()('')()(); +>h : Symbol(h, Decl(arrowFunctionExpressions.ts, 85, 3)) +>someOuterFn : Symbol(someOuterFn, Decl(arrowFunctionExpressions.ts, 72, 14)) + +h.toExponential(); +>h.toExponential : Symbol(Number.toExponential, Decl(lib.d.ts, 469, 45)) +>h : Symbol(h, Decl(arrowFunctionExpressions.ts, 85, 3)) +>toExponential : Symbol(Number.toExponential, Decl(lib.d.ts, 469, 45)) + +// Arrow function used in try/catch/finally in function +function tryCatchFn() { +>tryCatchFn : Symbol(tryCatchFn, Decl(arrowFunctionExpressions.ts, 86, 18)) + + try { + var x = () => this; +>x : Symbol(x, Decl(arrowFunctionExpressions.ts, 91, 11)) + + } catch (e) { +>e : Symbol(e, Decl(arrowFunctionExpressions.ts, 92, 13)) + + var t = () => e + this; +>t : Symbol(t, Decl(arrowFunctionExpressions.ts, 93, 11)) +>e : Symbol(e, Decl(arrowFunctionExpressions.ts, 92, 13)) + + } finally { + var m = () => this + ''; +>m : Symbol(m, Decl(arrowFunctionExpressions.ts, 95, 11)) + } +} + diff --git a/tests/baselines/reference/arrowFunctionExpressions.types b/tests/baselines/reference/arrowFunctionExpressions.types index 5807f6d6a7d..fc9fdb8a3bd 100644 --- a/tests/baselines/reference/arrowFunctionExpressions.types +++ b/tests/baselines/reference/arrowFunctionExpressions.types @@ -21,11 +21,13 @@ var b = j => { return 0; } >b : (j: any) => number >j => { return 0; } : (j: any) => number >j : any +>0 : number var b = (j) => { return 0; } >b : (j: any) => number >(j) => { return 0; } : (j: any) => number >j : any +>0 : number // Identifier => AssignmentExpression is equivalent to(Identifier) => AssignmentExpression var c: number; @@ -51,6 +53,67 @@ var d: (n: any) => any; >d : (n: any) => any >n : any +// Binding patterns in arrow functions +var p1 = ([a]) => { }; +>p1 : ([a]: [any]) => void +>([a]) => { } : ([a]: [any]) => void +>a : any + +var p2 = ([...a]) => { }; +>p2 : ([...a]: any[]) => void +>([...a]) => { } : ([...a]: any[]) => void +>a : any[] + +var p3 = ([, a]) => { }; +>p3 : ([, a]: [any, any]) => void +>([, a]) => { } : ([, a]: [any, any]) => void +> : undefined +>a : any + +var p4 = ([, ...a]) => { }; +>p4 : ([, ...a]: any[]) => void +>([, ...a]) => { } : ([, ...a]: any[]) => void +> : undefined +>a : any[] + +var p5 = ([a = 1]) => { }; +>p5 : ([a = 1]: [number]) => void +>([a = 1]) => { } : ([a = 1]: [number]) => void +>a : number +>1 : number + +var p6 = ({ a }) => { }; +>p6 : ({ a }: { a: any; }) => void +>({ a }) => { } : ({ a }: { a: any; }) => void +>a : any + +var p7 = ({ a: { b } }) => { }; +>p7 : ({ a: { b } }: { a: { b: any; }; }) => void +>({ a: { b } }) => { } : ({ a: { b } }: { a: { b: any; }; }) => void +>a : any +>b : any + +var p8 = ({ a = 1 }) => { }; +>p8 : ({ a = 1 }: { a?: number; }) => void +>({ a = 1 }) => { } : ({ a = 1 }: { a?: number; }) => void +>a : number +>1 : number + +var p9 = ({ a: { b = 1 } = { b: 1 } }) => { }; +>p9 : ({ a: { b = 1 } = { b: 1 } }: { a?: { b: number; }; }) => void +>({ a: { b = 1 } = { b: 1 } }) => { } : ({ a: { b = 1 } = { b: 1 } }: { a?: { b: number; }; }) => void +>a : any +>b : number +>1 : number +>{ b: 1 } : { b: number; } +>b : number +>1 : number + +var p10 = ([{ value, done }]) => { }; +>p10 : ([{ value, done }]: [{ value: any; done: any; }]) => void +>([{ value, done }]) => { } : ([{ value, done }]: [{ value: any; done: any; }]) => void +>value : any +>done : any // Arrow function used in class member initializer // Arrow function used in class member function @@ -63,6 +126,7 @@ class MyClass { >n : any >n + 1 : any >n : any +>1 : number p = (n) => n && this; >p : (n: any) => MyClass @@ -81,6 +145,7 @@ class MyClass { >n : any >n + 1 : any >n : any +>1 : number var p = (n) => n && this; >p : (n: any) => MyClass @@ -112,6 +177,8 @@ var e = arrrr()(3)()(4); >arrrr()(3) : () => (n: number) => number >arrrr() : (m: number) => () => (n: number) => number >arrrr : () => (m: number) => () => (n: number) => number +>3 : number +>4 : number var e: number; >e : number @@ -136,6 +203,8 @@ function someFn() { >arr(3)(4) : number >arr(3) : (p: number) => number >arr : (n: number) => (p: number) => number +>3 : number +>4 : number >toExponential : (fractionDigits?: number) => string } @@ -148,6 +217,7 @@ function someOtherFn() { >(n: number) => '' + n : (n: number) => string >n : number >'' + n : string +>'' : string >n : number arr(4).charAt(0); @@ -155,7 +225,9 @@ function someOtherFn() { >arr(4).charAt : (pos: number) => string >arr(4) : string >arr : (n: number) => string +>4 : number >charAt : (pos: number) => string +>0 : number } // Arrow function used in nested function in function @@ -198,12 +270,14 @@ var f = (n: string) => { return fn(4); >fn(4) : () => string >fn : (x: number) => () => string +>4 : number } var g = f('')(); >g : string >f('')() : string >f('') : () => string >f : (n: string) => () => string +>'' : string var g: string; >g : string @@ -240,6 +314,7 @@ var h = someOuterFn()('')()(); >someOuterFn()('') : () => () => number >someOuterFn() : (n: string) => () => () => number >someOuterFn : () => (n: string) => () => () => number +>'' : string h.toExponential(); >h.toExponential() : string @@ -273,6 +348,7 @@ function tryCatchFn() { >() => this + '' : () => string >this + '' : string >this : any +>'' : string } } diff --git a/tests/baselines/reference/arrowFunctionInExpressionStatement1.symbols b/tests/baselines/reference/arrowFunctionInExpressionStatement1.symbols new file mode 100644 index 00000000000..690ff3500c8 --- /dev/null +++ b/tests/baselines/reference/arrowFunctionInExpressionStatement1.symbols @@ -0,0 +1,3 @@ +=== tests/cases/compiler/arrowFunctionInExpressionStatement1.ts === +() => 0; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/arrowFunctionInExpressionStatement1.types b/tests/baselines/reference/arrowFunctionInExpressionStatement1.types index a5360a18fc0..a38a868f85b 100644 --- a/tests/baselines/reference/arrowFunctionInExpressionStatement1.types +++ b/tests/baselines/reference/arrowFunctionInExpressionStatement1.types @@ -1,4 +1,5 @@ === tests/cases/compiler/arrowFunctionInExpressionStatement1.ts === () => 0; >() => 0 : () => number +>0 : number diff --git a/tests/baselines/reference/arrowFunctionInExpressionStatement2.symbols b/tests/baselines/reference/arrowFunctionInExpressionStatement2.symbols new file mode 100644 index 00000000000..c9bbfde9974 --- /dev/null +++ b/tests/baselines/reference/arrowFunctionInExpressionStatement2.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/arrowFunctionInExpressionStatement2.ts === +module M { +>M : Symbol(M, Decl(arrowFunctionInExpressionStatement2.ts, 0, 0)) + + () => 0; +} diff --git a/tests/baselines/reference/arrowFunctionInExpressionStatement2.types b/tests/baselines/reference/arrowFunctionInExpressionStatement2.types index d4bb431fa8d..bfbd11e8c08 100644 --- a/tests/baselines/reference/arrowFunctionInExpressionStatement2.types +++ b/tests/baselines/reference/arrowFunctionInExpressionStatement2.types @@ -4,4 +4,5 @@ module M { () => 0; >() => 0 : () => number +>0 : number } diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody1.symbols b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody1.symbols new file mode 100644 index 00000000000..b4f68e045fe --- /dev/null +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody1.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/arrowFunctionWithObjectLiteralBody1.ts === +var v = a => {} +>v : Symbol(v, Decl(arrowFunctionWithObjectLiteralBody1.ts, 0, 3)) +>a : Symbol(a, Decl(arrowFunctionWithObjectLiteralBody1.ts, 0, 7)) + diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody2.symbols b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody2.symbols new file mode 100644 index 00000000000..1f8b83a23f1 --- /dev/null +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody2.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/arrowFunctionWithObjectLiteralBody2.ts === +var v = a => {} +>v : Symbol(v, Decl(arrowFunctionWithObjectLiteralBody2.ts, 0, 3)) +>a : Symbol(a, Decl(arrowFunctionWithObjectLiteralBody2.ts, 0, 7)) + diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody3.symbols b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody3.symbols new file mode 100644 index 00000000000..92122d16fc9 --- /dev/null +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody3.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/arrowFunctionWithObjectLiteralBody3.ts === +var v = a => {} +>v : Symbol(v, Decl(arrowFunctionWithObjectLiteralBody3.ts, 0, 3)) +>a : Symbol(a, Decl(arrowFunctionWithObjectLiteralBody3.ts, 0, 7)) + diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody4.symbols b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody4.symbols new file mode 100644 index 00000000000..74a6b6a2b9d --- /dev/null +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody4.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/arrowFunctionWithObjectLiteralBody4.ts === +var v = a => {} +>v : Symbol(v, Decl(arrowFunctionWithObjectLiteralBody4.ts, 0, 3)) +>a : Symbol(a, Decl(arrowFunctionWithObjectLiteralBody4.ts, 0, 7)) + diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.symbols b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.symbols new file mode 100644 index 00000000000..c1d1cf40d90 --- /dev/null +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/arrowFunctionWithObjectLiteralBody5.ts === +var a = () => { name: "foo", message: "bar" }; +>a : Symbol(a, Decl(arrowFunctionWithObjectLiteralBody5.ts, 0, 3)) +>Error : Symbol(Error, Decl(lib.d.ts, 876, 38), Decl(lib.d.ts, 889, 11)) +>name : Symbol(name, Decl(arrowFunctionWithObjectLiteralBody5.ts, 0, 22)) +>message : Symbol(message, Decl(arrowFunctionWithObjectLiteralBody5.ts, 0, 35)) + +var b = () => ({ name: "foo", message: "bar" }); +>b : Symbol(b, Decl(arrowFunctionWithObjectLiteralBody5.ts, 2, 3)) +>Error : Symbol(Error, Decl(lib.d.ts, 876, 38), Decl(lib.d.ts, 889, 11)) +>name : Symbol(name, Decl(arrowFunctionWithObjectLiteralBody5.ts, 2, 23)) +>message : Symbol(message, Decl(arrowFunctionWithObjectLiteralBody5.ts, 2, 36)) + +var c = () => ({ name: "foo", message: "bar" }); +>c : Symbol(c, Decl(arrowFunctionWithObjectLiteralBody5.ts, 4, 3)) +>name : Symbol(name, Decl(arrowFunctionWithObjectLiteralBody5.ts, 4, 16)) +>message : Symbol(message, Decl(arrowFunctionWithObjectLiteralBody5.ts, 4, 29)) + +var d = () => ((({ name: "foo", message: "bar" }))); +>d : Symbol(d, Decl(arrowFunctionWithObjectLiteralBody5.ts, 6, 3)) +>Error : Symbol(Error, Decl(lib.d.ts, 876, 38), Decl(lib.d.ts, 889, 11)) +>name : Symbol(name, Decl(arrowFunctionWithObjectLiteralBody5.ts, 6, 25)) +>message : Symbol(message, Decl(arrowFunctionWithObjectLiteralBody5.ts, 6, 38)) + diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.types b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.types index 15b3697732a..0093ace2d9c 100644 --- a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.types +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.types @@ -6,7 +6,9 @@ var a = () => { name: "foo", message: "bar" }; >Error : Error >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string +>"foo" : string >message : string +>"bar" : string var b = () => ({ name: "foo", message: "bar" }); >b : () => Error @@ -16,7 +18,9 @@ var b = () => ({ name: "foo", message: "bar" }); >Error : Error >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string +>"foo" : string >message : string +>"bar" : string var c = () => ({ name: "foo", message: "bar" }); >c : () => { name: string; message: string; } @@ -24,7 +28,9 @@ var c = () => ({ name: "foo", message: "bar" }); >({ name: "foo", message: "bar" }) : { name: string; message: string; } >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string +>"foo" : string >message : string +>"bar" : string var d = () => ((({ name: "foo", message: "bar" }))); >d : () => Error @@ -36,5 +42,7 @@ var d = () => ((({ name: "foo", message: "bar" }))); >({ name: "foo", message: "bar" }) : { name: string; message: string; } >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string +>"foo" : string >message : string +>"bar" : string diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.symbols b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.symbols new file mode 100644 index 00000000000..80530cde016 --- /dev/null +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/arrowFunctionWithObjectLiteralBody6.ts === +var a = () => { name: "foo", message: "bar" }; +>a : Symbol(a, Decl(arrowFunctionWithObjectLiteralBody6.ts, 0, 3)) +>Error : Symbol(Error, Decl(lib.d.ts, 876, 38), Decl(lib.d.ts, 889, 11)) +>name : Symbol(name, Decl(arrowFunctionWithObjectLiteralBody6.ts, 0, 22)) +>message : Symbol(message, Decl(arrowFunctionWithObjectLiteralBody6.ts, 0, 35)) + +var b = () => ({ name: "foo", message: "bar" }); +>b : Symbol(b, Decl(arrowFunctionWithObjectLiteralBody6.ts, 2, 3)) +>Error : Symbol(Error, Decl(lib.d.ts, 876, 38), Decl(lib.d.ts, 889, 11)) +>name : Symbol(name, Decl(arrowFunctionWithObjectLiteralBody6.ts, 2, 23)) +>message : Symbol(message, Decl(arrowFunctionWithObjectLiteralBody6.ts, 2, 36)) + +var c = () => ({ name: "foo", message: "bar" }); +>c : Symbol(c, Decl(arrowFunctionWithObjectLiteralBody6.ts, 4, 3)) +>name : Symbol(name, Decl(arrowFunctionWithObjectLiteralBody6.ts, 4, 16)) +>message : Symbol(message, Decl(arrowFunctionWithObjectLiteralBody6.ts, 4, 29)) + +var d = () => ((({ name: "foo", message: "bar" }))); +>d : Symbol(d, Decl(arrowFunctionWithObjectLiteralBody6.ts, 6, 3)) +>Error : Symbol(Error, Decl(lib.d.ts, 876, 38), Decl(lib.d.ts, 889, 11)) +>name : Symbol(name, Decl(arrowFunctionWithObjectLiteralBody6.ts, 6, 25)) +>message : Symbol(message, Decl(arrowFunctionWithObjectLiteralBody6.ts, 6, 38)) + diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.types b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.types index 14a45dca213..31d2a63fec0 100644 --- a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.types +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.types @@ -6,7 +6,9 @@ var a = () => { name: "foo", message: "bar" }; >Error : Error >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string +>"foo" : string >message : string +>"bar" : string var b = () => ({ name: "foo", message: "bar" }); >b : () => Error @@ -16,7 +18,9 @@ var b = () => ({ name: "foo", message: "bar" }); >Error : Error >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string +>"foo" : string >message : string +>"bar" : string var c = () => ({ name: "foo", message: "bar" }); >c : () => { name: string; message: string; } @@ -24,7 +28,9 @@ var c = () => ({ name: "foo", message: "bar" }); >({ name: "foo", message: "bar" }) : { name: string; message: string; } >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string +>"foo" : string >message : string +>"bar" : string var d = () => ((({ name: "foo", message: "bar" }))); >d : () => Error @@ -36,5 +42,7 @@ var d = () => ((({ name: "foo", message: "bar" }))); >({ name: "foo", message: "bar" }) : { name: string; message: string; } >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string +>"foo" : string >message : string +>"bar" : string diff --git a/tests/baselines/reference/asiAmbientFunctionDeclaration.symbols b/tests/baselines/reference/asiAmbientFunctionDeclaration.symbols new file mode 100644 index 00000000000..d32b9a67619 --- /dev/null +++ b/tests/baselines/reference/asiAmbientFunctionDeclaration.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/asiAmbientFunctionDeclaration.ts === +declare function foo() +>foo : Symbol(foo, Decl(asiAmbientFunctionDeclaration.ts, 0, 0)) + diff --git a/tests/baselines/reference/asiArith.symbols b/tests/baselines/reference/asiArith.symbols new file mode 100644 index 00000000000..40b15d0723e --- /dev/null +++ b/tests/baselines/reference/asiArith.symbols @@ -0,0 +1,45 @@ +=== tests/cases/compiler/asiArith.ts === +var x = 1; +>x : Symbol(x, Decl(asiArith.ts, 0, 3)) + +var y = 1; +>y : Symbol(y, Decl(asiArith.ts, 2, 3)) + +var z = +>z : Symbol(z, Decl(asiArith.ts, 4, 3)) + +x +>x : Symbol(x, Decl(asiArith.ts, 0, 3)) + ++ + ++ + ++ + +y +>y : Symbol(y, Decl(asiArith.ts, 2, 3)) + + +var a = 1; +>a : Symbol(a, Decl(asiArith.ts, 17, 3)) + +var b = 1; +>b : Symbol(b, Decl(asiArith.ts, 19, 3)) + +var c = +>c : Symbol(c, Decl(asiArith.ts, 21, 3)) + +x +>x : Symbol(x, Decl(asiArith.ts, 0, 3)) + +- + +- + +- + +y +>y : Symbol(y, Decl(asiArith.ts, 2, 3)) + + diff --git a/tests/baselines/reference/asiArith.types b/tests/baselines/reference/asiArith.types index d6c0c7abd71..13394d2f1c2 100644 --- a/tests/baselines/reference/asiArith.types +++ b/tests/baselines/reference/asiArith.types @@ -1,9 +1,11 @@ === tests/cases/compiler/asiArith.ts === var x = 1; >x : number +>1 : number var y = 1; >y : number +>1 : number var z = >z : number @@ -26,9 +28,11 @@ y var a = 1; >a : number +>1 : number var b = 1; >b : number +>1 : number var c = >c : number diff --git a/tests/baselines/reference/asiBreak.symbols b/tests/baselines/reference/asiBreak.symbols new file mode 100644 index 00000000000..355d27f2a43 --- /dev/null +++ b/tests/baselines/reference/asiBreak.symbols @@ -0,0 +1,3 @@ +=== tests/cases/compiler/asiBreak.ts === +while (true) break +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/asiBreak.types b/tests/baselines/reference/asiBreak.types index 355d27f2a43..af3d6a040d5 100644 --- a/tests/baselines/reference/asiBreak.types +++ b/tests/baselines/reference/asiBreak.types @@ -1,3 +1,4 @@ === tests/cases/compiler/asiBreak.ts === while (true) break -No type information for this code. \ No newline at end of file +>true : boolean + diff --git a/tests/baselines/reference/asiContinue.symbols b/tests/baselines/reference/asiContinue.symbols new file mode 100644 index 00000000000..5b3f0145377 --- /dev/null +++ b/tests/baselines/reference/asiContinue.symbols @@ -0,0 +1,3 @@ +=== tests/cases/compiler/asiContinue.ts === +while (true) continue +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/asiContinue.types b/tests/baselines/reference/asiContinue.types index 5b3f0145377..e2eb5ba107d 100644 --- a/tests/baselines/reference/asiContinue.types +++ b/tests/baselines/reference/asiContinue.types @@ -1,3 +1,4 @@ === tests/cases/compiler/asiContinue.ts === while (true) continue -No type information for this code. \ No newline at end of file +>true : boolean + diff --git a/tests/baselines/reference/asiInES6Classes.symbols b/tests/baselines/reference/asiInES6Classes.symbols new file mode 100644 index 00000000000..e6af356008d --- /dev/null +++ b/tests/baselines/reference/asiInES6Classes.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/asiInES6Classes.ts === +class Foo { +>Foo : Symbol(Foo, Decl(asiInES6Classes.ts, 0, 0)) + + + + defaults = { +>defaults : Symbol(defaults, Decl(asiInES6Classes.ts, 0, 11)) + + done: false +>done : Symbol(done, Decl(asiInES6Classes.ts, 4, 16)) + + } + + + + bar() { +>bar : Symbol(bar, Decl(asiInES6Classes.ts, 8, 5)) + + return 3; + + } + + + +} + diff --git a/tests/baselines/reference/asiInES6Classes.types b/tests/baselines/reference/asiInES6Classes.types index 90c7f71aba6..41940a0f477 100644 --- a/tests/baselines/reference/asiInES6Classes.types +++ b/tests/baselines/reference/asiInES6Classes.types @@ -10,6 +10,7 @@ class Foo { done: false >done : boolean +>false : boolean } @@ -19,6 +20,7 @@ class Foo { >bar : () => number return 3; +>3 : number } diff --git a/tests/baselines/reference/assign1.symbols b/tests/baselines/reference/assign1.symbols new file mode 100644 index 00000000000..f434da72670 --- /dev/null +++ b/tests/baselines/reference/assign1.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/assign1.ts === +module M { +>M : Symbol(M, Decl(assign1.ts, 0, 0)) + + interface I { +>I : Symbol(I, Decl(assign1.ts, 0, 10)) + + salt:number; +>salt : Symbol(salt, Decl(assign1.ts, 1, 17)) + + pepper:number; +>pepper : Symbol(pepper, Decl(assign1.ts, 2, 20)) + } + + var x:I={salt:2,pepper:0}; +>x : Symbol(x, Decl(assign1.ts, 6, 7)) +>I : Symbol(I, Decl(assign1.ts, 0, 10)) +>salt : Symbol(salt, Decl(assign1.ts, 6, 13)) +>pepper : Symbol(pepper, Decl(assign1.ts, 6, 20)) +} + diff --git a/tests/baselines/reference/assign1.types b/tests/baselines/reference/assign1.types index 32b93af647d..d600c4055af 100644 --- a/tests/baselines/reference/assign1.types +++ b/tests/baselines/reference/assign1.types @@ -17,6 +17,8 @@ module M { >I : I >{salt:2,pepper:0} : { salt: number; pepper: number; } >salt : number +>2 : number >pepper : number +>0 : number } diff --git a/tests/baselines/reference/assignEveryTypeToAny.symbols b/tests/baselines/reference/assignEveryTypeToAny.symbols new file mode 100644 index 00000000000..145e19664fd --- /dev/null +++ b/tests/baselines/reference/assignEveryTypeToAny.symbols @@ -0,0 +1,141 @@ +=== tests/cases/conformance/types/any/assignEveryTypeToAny.ts === +// all of these are valid + +var x: any; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) + +x = 1; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) + +var a = 2; +>a : Symbol(a, Decl(assignEveryTypeToAny.ts, 5, 3)) + +x = a; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>a : Symbol(a, Decl(assignEveryTypeToAny.ts, 5, 3)) + +x = true; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) + +var b = true; +>b : Symbol(b, Decl(assignEveryTypeToAny.ts, 9, 3)) + +x = b; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>b : Symbol(b, Decl(assignEveryTypeToAny.ts, 9, 3)) + +x = ""; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) + +var c = ""; +>c : Symbol(c, Decl(assignEveryTypeToAny.ts, 13, 3)) + +x = c; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>c : Symbol(c, Decl(assignEveryTypeToAny.ts, 13, 3)) + +var d: void; +>d : Symbol(d, Decl(assignEveryTypeToAny.ts, 16, 3)) + +x = d; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>d : Symbol(d, Decl(assignEveryTypeToAny.ts, 16, 3)) + +var e = undefined; +>e : Symbol(e, Decl(assignEveryTypeToAny.ts, 19, 3)) +>undefined : Symbol(undefined) + +x = e; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>e : Symbol(e, Decl(assignEveryTypeToAny.ts, 19, 3)) + +var e2: typeof undefined; +>e2 : Symbol(e2, Decl(assignEveryTypeToAny.ts, 22, 3)) +>undefined : Symbol(undefined) + +x = e2; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>e2 : Symbol(e2, Decl(assignEveryTypeToAny.ts, 22, 3)) + +enum E { +>E : Symbol(E, Decl(assignEveryTypeToAny.ts, 23, 7)) + + A +>A : Symbol(E.A, Decl(assignEveryTypeToAny.ts, 25, 8)) +} + +x = E.A; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>E.A : Symbol(E.A, Decl(assignEveryTypeToAny.ts, 25, 8)) +>E : Symbol(E, Decl(assignEveryTypeToAny.ts, 23, 7)) +>A : Symbol(E.A, Decl(assignEveryTypeToAny.ts, 25, 8)) + +var f = E.A; +>f : Symbol(f, Decl(assignEveryTypeToAny.ts, 30, 3)) +>E.A : Symbol(E.A, Decl(assignEveryTypeToAny.ts, 25, 8)) +>E : Symbol(E, Decl(assignEveryTypeToAny.ts, 23, 7)) +>A : Symbol(E.A, Decl(assignEveryTypeToAny.ts, 25, 8)) + +x = f; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>f : Symbol(f, Decl(assignEveryTypeToAny.ts, 30, 3)) + +interface I { +>I : Symbol(I, Decl(assignEveryTypeToAny.ts, 31, 6)) + + foo: string; +>foo : Symbol(foo, Decl(assignEveryTypeToAny.ts, 33, 13)) +} + +var g: I; +>g : Symbol(g, Decl(assignEveryTypeToAny.ts, 37, 3)) +>I : Symbol(I, Decl(assignEveryTypeToAny.ts, 31, 6)) + +x = g; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>g : Symbol(g, Decl(assignEveryTypeToAny.ts, 37, 3)) + +class C { +>C : Symbol(C, Decl(assignEveryTypeToAny.ts, 38, 6)) + + bar: string; +>bar : Symbol(bar, Decl(assignEveryTypeToAny.ts, 40, 9)) +} + +var h: C; +>h : Symbol(h, Decl(assignEveryTypeToAny.ts, 44, 3)) +>C : Symbol(C, Decl(assignEveryTypeToAny.ts, 38, 6)) + +x = h; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>h : Symbol(h, Decl(assignEveryTypeToAny.ts, 44, 3)) + +var i: { (): string }; +>i : Symbol(i, Decl(assignEveryTypeToAny.ts, 47, 3)) + +x = i; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>i : Symbol(i, Decl(assignEveryTypeToAny.ts, 47, 3)) + +x = { f() { return 1; } } +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>f : Symbol(f, Decl(assignEveryTypeToAny.ts, 49, 5)) + +x = { f(x: T) { return x; } } +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>f : Symbol(f, Decl(assignEveryTypeToAny.ts, 50, 5)) +>T : Symbol(T, Decl(assignEveryTypeToAny.ts, 50, 8)) +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 50, 11)) +>T : Symbol(T, Decl(assignEveryTypeToAny.ts, 50, 8)) +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 50, 11)) + +function j(a: T) { +>j : Symbol(j, Decl(assignEveryTypeToAny.ts, 50, 32)) +>T : Symbol(T, Decl(assignEveryTypeToAny.ts, 52, 11)) +>a : Symbol(a, Decl(assignEveryTypeToAny.ts, 52, 14)) +>T : Symbol(T, Decl(assignEveryTypeToAny.ts, 52, 11)) + + x = a; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>a : Symbol(a, Decl(assignEveryTypeToAny.ts, 52, 14)) +} diff --git a/tests/baselines/reference/assignEveryTypeToAny.types b/tests/baselines/reference/assignEveryTypeToAny.types index 129440fa463..dfff671a875 100644 --- a/tests/baselines/reference/assignEveryTypeToAny.types +++ b/tests/baselines/reference/assignEveryTypeToAny.types @@ -7,9 +7,11 @@ var x: any; x = 1; >x = 1 : number >x : any +>1 : number var a = 2; >a : number +>2 : number x = a; >x = a : number @@ -19,9 +21,11 @@ x = a; x = true; >x = true : boolean >x : any +>true : boolean var b = true; >b : boolean +>true : boolean x = b; >x = b : boolean @@ -31,9 +35,11 @@ x = b; x = ""; >x = "" : string >x : any +>"" : string var c = ""; >c : string +>"" : string x = c; >x = c : string @@ -136,6 +142,7 @@ x = { f() { return 1; } } >x : any >{ f() { return 1; } } : { f(): number; } >f : () => number +>1 : number x = { f(x: T) { return x; } } >x = { f(x: T) { return x; } } : { f(x: T): T; } diff --git a/tests/baselines/reference/assignToObjectTypeWithPrototypeProperty.symbols b/tests/baselines/reference/assignToObjectTypeWithPrototypeProperty.symbols new file mode 100644 index 00000000000..730560d0d81 --- /dev/null +++ b/tests/baselines/reference/assignToObjectTypeWithPrototypeProperty.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/assignToObjectTypeWithPrototypeProperty.ts === +class XEvent {} +>XEvent : Symbol(XEvent, Decl(assignToObjectTypeWithPrototypeProperty.ts, 0, 0)) + +var p: XEvent = XEvent.prototype; +>p : Symbol(p, Decl(assignToObjectTypeWithPrototypeProperty.ts, 1, 3)) +>XEvent : Symbol(XEvent, Decl(assignToObjectTypeWithPrototypeProperty.ts, 0, 0)) +>XEvent.prototype : Symbol(XEvent.prototype) +>XEvent : Symbol(XEvent, Decl(assignToObjectTypeWithPrototypeProperty.ts, 0, 0)) +>prototype : Symbol(XEvent.prototype) + +var x: {prototype: XEvent} = XEvent; +>x : Symbol(x, Decl(assignToObjectTypeWithPrototypeProperty.ts, 2, 3)) +>prototype : Symbol(prototype, Decl(assignToObjectTypeWithPrototypeProperty.ts, 2, 8)) +>XEvent : Symbol(XEvent, Decl(assignToObjectTypeWithPrototypeProperty.ts, 0, 0)) +>XEvent : Symbol(XEvent, Decl(assignToObjectTypeWithPrototypeProperty.ts, 0, 0)) + diff --git a/tests/baselines/reference/assignToPrototype1.symbols b/tests/baselines/reference/assignToPrototype1.symbols new file mode 100644 index 00000000000..ddb8e915043 --- /dev/null +++ b/tests/baselines/reference/assignToPrototype1.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/assignToPrototype1.ts === +declare class Point { +>Point : Symbol(Point, Decl(assignToPrototype1.ts, 0, 0)) + + add(dx: number, dy: number): void; +>add : Symbol(add, Decl(assignToPrototype1.ts, 0, 21)) +>dx : Symbol(dx, Decl(assignToPrototype1.ts, 1, 6)) +>dy : Symbol(dy, Decl(assignToPrototype1.ts, 1, 17)) +} + +Point.prototype.add = function(dx, dy) { +>Point.prototype.add : Symbol(Point.add, Decl(assignToPrototype1.ts, 0, 21)) +>Point.prototype : Symbol(Point.prototype) +>Point : Symbol(Point, Decl(assignToPrototype1.ts, 0, 0)) +>prototype : Symbol(Point.prototype) +>add : Symbol(Point.add, Decl(assignToPrototype1.ts, 0, 21)) +>dx : Symbol(dx, Decl(assignToPrototype1.ts, 4, 31)) +>dy : Symbol(dy, Decl(assignToPrototype1.ts, 4, 34)) + +}; diff --git a/tests/baselines/reference/assignmentCompatForEnums.symbols b/tests/baselines/reference/assignmentCompatForEnums.symbols new file mode 100644 index 00000000000..510c08e61f6 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatForEnums.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/assignmentCompatForEnums.ts === +enum TokenType { One, Two }; +>TokenType : Symbol(TokenType, Decl(assignmentCompatForEnums.ts, 0, 0)) +>One : Symbol(TokenType.One, Decl(assignmentCompatForEnums.ts, 0, 16)) +>Two : Symbol(TokenType.Two, Decl(assignmentCompatForEnums.ts, 0, 21)) + +var list = {}; +>list : Symbol(list, Decl(assignmentCompatForEnums.ts, 2, 3)) + + +function returnType(): TokenType { return null; } +>returnType : Symbol(returnType, Decl(assignmentCompatForEnums.ts, 2, 14)) +>TokenType : Symbol(TokenType, Decl(assignmentCompatForEnums.ts, 0, 0)) + +function foo() { +>foo : Symbol(foo, Decl(assignmentCompatForEnums.ts, 5, 49)) + + var x = returnType(); +>x : Symbol(x, Decl(assignmentCompatForEnums.ts, 8, 7), Decl(assignmentCompatForEnums.ts, 10, 7)) +>returnType : Symbol(returnType, Decl(assignmentCompatForEnums.ts, 2, 14)) + + var x: TokenType = list['one']; +>x : Symbol(x, Decl(assignmentCompatForEnums.ts, 8, 7), Decl(assignmentCompatForEnums.ts, 10, 7)) +>TokenType : Symbol(TokenType, Decl(assignmentCompatForEnums.ts, 0, 0)) +>list : Symbol(list, Decl(assignmentCompatForEnums.ts, 2, 3)) +} + + diff --git a/tests/baselines/reference/assignmentCompatForEnums.types b/tests/baselines/reference/assignmentCompatForEnums.types index 53e8caab638..e8b48bd02bd 100644 --- a/tests/baselines/reference/assignmentCompatForEnums.types +++ b/tests/baselines/reference/assignmentCompatForEnums.types @@ -12,6 +12,7 @@ var list = {}; function returnType(): TokenType { return null; } >returnType : () => TokenType >TokenType : TokenType +>null : null function foo() { >foo : () => void @@ -26,6 +27,7 @@ function foo() { >TokenType : TokenType >list['one'] : any >list : {} +>'one' : string } diff --git a/tests/baselines/reference/assignmentCompatOnNew.symbols b/tests/baselines/reference/assignmentCompatOnNew.symbols new file mode 100644 index 00000000000..524a22d2421 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatOnNew.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/assignmentCompatOnNew.ts === +class Foo{}; +>Foo : Symbol(Foo, Decl(assignmentCompatOnNew.ts, 0, 0)) + +function bar(x: {new(): Foo;}){} +>bar : Symbol(bar, Decl(assignmentCompatOnNew.ts, 0, 12)) +>x : Symbol(x, Decl(assignmentCompatOnNew.ts, 2, 13)) +>Foo : Symbol(Foo, Decl(assignmentCompatOnNew.ts, 0, 0)) + +bar(Foo); // Error, but should be allowed +>bar : Symbol(bar, Decl(assignmentCompatOnNew.ts, 0, 12)) +>Foo : Symbol(Foo, Decl(assignmentCompatOnNew.ts, 0, 0)) + diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures3.symbols b/tests/baselines/reference/assignmentCompatWithCallSignatures3.symbols new file mode 100644 index 00000000000..8218de9be79 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures3.symbols @@ -0,0 +1,529 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures3.ts === +// these are all permitted with the current rules, since we do not do contextual signature instantiation + +class Base { foo: string; } +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures3.ts, 2, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>bar : Symbol(bar, Decl(assignmentCompatWithCallSignatures3.ts, 3, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(assignmentCompatWithCallSignatures3.ts, 3, 43)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>baz : Symbol(baz, Decl(assignmentCompatWithCallSignatures3.ts, 4, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(assignmentCompatWithCallSignatures3.ts, 4, 47)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>bing : Symbol(bing, Decl(assignmentCompatWithCallSignatures3.ts, 5, 33)) + +var a: (x: number) => number[]; +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures3.ts, 7, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 7, 8)) + +var a2: (x: number) => string[]; +>a2 : Symbol(a2, Decl(assignmentCompatWithCallSignatures3.ts, 8, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 8, 9)) + +var a3: (x: number) => void; +>a3 : Symbol(a3, Decl(assignmentCompatWithCallSignatures3.ts, 9, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 9, 9)) + +var a4: (x: string, y: number) => string; +>a4 : Symbol(a4, Decl(assignmentCompatWithCallSignatures3.ts, 10, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 10, 9)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures3.ts, 10, 19)) + +var a5: (x: (arg: string) => number) => string; +>a5 : Symbol(a5, Decl(assignmentCompatWithCallSignatures3.ts, 11, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 11, 9)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures3.ts, 11, 13)) + +var a6: (x: (arg: Base) => Derived) => Base; +>a6 : Symbol(a6, Decl(assignmentCompatWithCallSignatures3.ts, 12, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 12, 9)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures3.ts, 12, 13)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) + +var a7: (x: (arg: Base) => Derived) => (r: Base) => Derived; +>a7 : Symbol(a7, Decl(assignmentCompatWithCallSignatures3.ts, 13, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 13, 9)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures3.ts, 13, 13)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>r : Symbol(r, Decl(assignmentCompatWithCallSignatures3.ts, 13, 40)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) + +var a8: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +>a8 : Symbol(a8, Decl(assignmentCompatWithCallSignatures3.ts, 14, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 14, 9)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures3.ts, 14, 13)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures3.ts, 14, 35)) +>arg2 : Symbol(arg2, Decl(assignmentCompatWithCallSignatures3.ts, 14, 40)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>r : Symbol(r, Decl(assignmentCompatWithCallSignatures3.ts, 14, 68)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) + +var a9: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +>a9 : Symbol(a9, Decl(assignmentCompatWithCallSignatures3.ts, 15, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 15, 9)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures3.ts, 15, 13)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures3.ts, 15, 35)) +>arg2 : Symbol(arg2, Decl(assignmentCompatWithCallSignatures3.ts, 15, 40)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>r : Symbol(r, Decl(assignmentCompatWithCallSignatures3.ts, 15, 68)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) + +var a10: (...x: Derived[]) => Derived; +>a10 : Symbol(a10, Decl(assignmentCompatWithCallSignatures3.ts, 16, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 16, 10)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) + +var a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base; +>a11 : Symbol(a11, Decl(assignmentCompatWithCallSignatures3.ts, 17, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 17, 10)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures3.ts, 17, 14)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures3.ts, 17, 29)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures3.ts, 17, 34)) +>bar : Symbol(bar, Decl(assignmentCompatWithCallSignatures3.ts, 17, 47)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) + +var a12: (x: Array, y: Array) => Array; +>a12 : Symbol(a12, Decl(assignmentCompatWithCallSignatures3.ts, 18, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 18, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures3.ts, 18, 25)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived2 : Symbol(Derived2, Decl(assignmentCompatWithCallSignatures3.ts, 3, 43)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) + +var a13: (x: Array, y: Array) => Array; +>a13 : Symbol(a13, Decl(assignmentCompatWithCallSignatures3.ts, 19, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 19, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures3.ts, 19, 25)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) + +var a14: (x: { a: string; b: number }) => Object; +>a14 : Symbol(a14, Decl(assignmentCompatWithCallSignatures3.ts, 20, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 20, 10)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures3.ts, 20, 14)) +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures3.ts, 20, 25)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var a15: { +>a15 : Symbol(a15, Decl(assignmentCompatWithCallSignatures3.ts, 21, 3)) + + (x: number): number[]; +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 22, 5)) + + (x: string): string[]; +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 23, 5)) +} +var a16: { +>a16 : Symbol(a16, Decl(assignmentCompatWithCallSignatures3.ts, 25, 3)) + + (x: T): number[]; +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 26, 5)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 26, 24)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 26, 5)) + + (x: U): number[]; +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 27, 5)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 27, 21)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 27, 5)) +} +var a17: { +>a17 : Symbol(a17, Decl(assignmentCompatWithCallSignatures3.ts, 29, 3)) + + (x: (a: number) => number): number[]; +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 30, 5)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures3.ts, 30, 9)) + + (x: (a: string) => string): string[]; +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 31, 5)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures3.ts, 31, 9)) + +}; +var a18: { +>a18 : Symbol(a18, Decl(assignmentCompatWithCallSignatures3.ts, 33, 3)) + + (x: { +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 34, 5)) + + (a: number): number; +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures3.ts, 35, 9)) + + (a: string): string; +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures3.ts, 36, 9)) + + }): any[]; + (x: { +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 38, 5)) + + (a: boolean): boolean; +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures3.ts, 39, 9)) + + (a: Date): Date; +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures3.ts, 40, 9)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + }): any[]; +} + +var b: (x: T) => T[]; +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures3.ts, 44, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 44, 8)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 44, 11)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 44, 8)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 44, 8)) + +a = b; // ok +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures3.ts, 7, 3)) +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures3.ts, 44, 3)) + +b = a; // ok +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures3.ts, 44, 3)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures3.ts, 7, 3)) + +var b2: (x: T) => string[]; +>b2 : Symbol(b2, Decl(assignmentCompatWithCallSignatures3.ts, 47, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 47, 9)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 47, 12)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 47, 9)) + +a2 = b2; // ok +>a2 : Symbol(a2, Decl(assignmentCompatWithCallSignatures3.ts, 8, 3)) +>b2 : Symbol(b2, Decl(assignmentCompatWithCallSignatures3.ts, 47, 3)) + +b2 = a2; // ok +>b2 : Symbol(b2, Decl(assignmentCompatWithCallSignatures3.ts, 47, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithCallSignatures3.ts, 8, 3)) + +var b3: (x: T) => T; +>b3 : Symbol(b3, Decl(assignmentCompatWithCallSignatures3.ts, 50, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 50, 9)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 50, 12)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 50, 9)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 50, 9)) + +a3 = b3; // ok +>a3 : Symbol(a3, Decl(assignmentCompatWithCallSignatures3.ts, 9, 3)) +>b3 : Symbol(b3, Decl(assignmentCompatWithCallSignatures3.ts, 50, 3)) + +b3 = a3; // ok +>b3 : Symbol(b3, Decl(assignmentCompatWithCallSignatures3.ts, 50, 3)) +>a3 : Symbol(a3, Decl(assignmentCompatWithCallSignatures3.ts, 9, 3)) + +var b4: (x: T, y: U) => T; +>b4 : Symbol(b4, Decl(assignmentCompatWithCallSignatures3.ts, 53, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 53, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 53, 11)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 53, 15)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 53, 9)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures3.ts, 53, 20)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 53, 11)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 53, 9)) + +a4 = b4; // ok +>a4 : Symbol(a4, Decl(assignmentCompatWithCallSignatures3.ts, 10, 3)) +>b4 : Symbol(b4, Decl(assignmentCompatWithCallSignatures3.ts, 53, 3)) + +b4 = a4; // ok +>b4 : Symbol(b4, Decl(assignmentCompatWithCallSignatures3.ts, 53, 3)) +>a4 : Symbol(a4, Decl(assignmentCompatWithCallSignatures3.ts, 10, 3)) + +var b5: (x: (arg: T) => U) => T; +>b5 : Symbol(b5, Decl(assignmentCompatWithCallSignatures3.ts, 56, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 56, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 56, 11)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 56, 15)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures3.ts, 56, 19)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 56, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 56, 11)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 56, 9)) + +a5 = b5; // ok +>a5 : Symbol(a5, Decl(assignmentCompatWithCallSignatures3.ts, 11, 3)) +>b5 : Symbol(b5, Decl(assignmentCompatWithCallSignatures3.ts, 56, 3)) + +b5 = a5; // ok +>b5 : Symbol(b5, Decl(assignmentCompatWithCallSignatures3.ts, 56, 3)) +>a5 : Symbol(a5, Decl(assignmentCompatWithCallSignatures3.ts, 11, 3)) + +var b6: (x: (arg: T) => U) => T; +>b6 : Symbol(b6, Decl(assignmentCompatWithCallSignatures3.ts, 59, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 59, 9)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 59, 24)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 59, 44)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures3.ts, 59, 48)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 59, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 59, 24)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 59, 9)) + +a6 = b6; // ok +>a6 : Symbol(a6, Decl(assignmentCompatWithCallSignatures3.ts, 12, 3)) +>b6 : Symbol(b6, Decl(assignmentCompatWithCallSignatures3.ts, 59, 3)) + +b6 = a6; // ok +>b6 : Symbol(b6, Decl(assignmentCompatWithCallSignatures3.ts, 59, 3)) +>a6 : Symbol(a6, Decl(assignmentCompatWithCallSignatures3.ts, 12, 3)) + +var b7: (x: (arg: T) => U) => (r: T) => U; +>b7 : Symbol(b7, Decl(assignmentCompatWithCallSignatures3.ts, 62, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 62, 9)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 62, 24)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 62, 44)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures3.ts, 62, 48)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 62, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 62, 24)) +>r : Symbol(r, Decl(assignmentCompatWithCallSignatures3.ts, 62, 66)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 62, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 62, 24)) + +a7 = b7; // ok +>a7 : Symbol(a7, Decl(assignmentCompatWithCallSignatures3.ts, 13, 3)) +>b7 : Symbol(b7, Decl(assignmentCompatWithCallSignatures3.ts, 62, 3)) + +b7 = a7; // ok +>b7 : Symbol(b7, Decl(assignmentCompatWithCallSignatures3.ts, 62, 3)) +>a7 : Symbol(a7, Decl(assignmentCompatWithCallSignatures3.ts, 13, 3)) + +var b8: (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; +>b8 : Symbol(b8, Decl(assignmentCompatWithCallSignatures3.ts, 65, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 65, 9)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 65, 24)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 65, 44)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures3.ts, 65, 48)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 65, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 65, 24)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures3.ts, 65, 61)) +>arg2 : Symbol(arg2, Decl(assignmentCompatWithCallSignatures3.ts, 65, 66)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 65, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 65, 24)) +>r : Symbol(r, Decl(assignmentCompatWithCallSignatures3.ts, 65, 85)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 65, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 65, 24)) + +a8 = b8; // ok +>a8 : Symbol(a8, Decl(assignmentCompatWithCallSignatures3.ts, 14, 3)) +>b8 : Symbol(b8, Decl(assignmentCompatWithCallSignatures3.ts, 65, 3)) + +b8 = a8; // ok +>b8 : Symbol(b8, Decl(assignmentCompatWithCallSignatures3.ts, 65, 3)) +>a8 : Symbol(a8, Decl(assignmentCompatWithCallSignatures3.ts, 14, 3)) + +var b9: (x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; +>b9 : Symbol(b9, Decl(assignmentCompatWithCallSignatures3.ts, 68, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 68, 9)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 68, 24)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 68, 44)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures3.ts, 68, 48)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 68, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 68, 24)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures3.ts, 68, 61)) +>arg2 : Symbol(arg2, Decl(assignmentCompatWithCallSignatures3.ts, 68, 66)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures3.ts, 68, 73)) +>bing : Symbol(bing, Decl(assignmentCompatWithCallSignatures3.ts, 68, 86)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 68, 24)) +>r : Symbol(r, Decl(assignmentCompatWithCallSignatures3.ts, 68, 113)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 68, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 68, 24)) + +a9 = b9; // ok +>a9 : Symbol(a9, Decl(assignmentCompatWithCallSignatures3.ts, 15, 3)) +>b9 : Symbol(b9, Decl(assignmentCompatWithCallSignatures3.ts, 68, 3)) + +b9 = a9; // ok +>b9 : Symbol(b9, Decl(assignmentCompatWithCallSignatures3.ts, 68, 3)) +>a9 : Symbol(a9, Decl(assignmentCompatWithCallSignatures3.ts, 15, 3)) + +var b10: (...x: T[]) => T; +>b10 : Symbol(b10, Decl(assignmentCompatWithCallSignatures3.ts, 71, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 71, 10)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 71, 29)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 71, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 71, 10)) + +a10 = b10; // ok +>a10 : Symbol(a10, Decl(assignmentCompatWithCallSignatures3.ts, 16, 3)) +>b10 : Symbol(b10, Decl(assignmentCompatWithCallSignatures3.ts, 71, 3)) + +b10 = a10; // ok +>b10 : Symbol(b10, Decl(assignmentCompatWithCallSignatures3.ts, 71, 3)) +>a10 : Symbol(a10, Decl(assignmentCompatWithCallSignatures3.ts, 16, 3)) + +var b11: (x: T, y: T) => T; +>b11 : Symbol(b11, Decl(assignmentCompatWithCallSignatures3.ts, 74, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 74, 10)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 74, 26)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 74, 10)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures3.ts, 74, 31)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 74, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 74, 10)) + +a11 = b11; // ok +>a11 : Symbol(a11, Decl(assignmentCompatWithCallSignatures3.ts, 17, 3)) +>b11 : Symbol(b11, Decl(assignmentCompatWithCallSignatures3.ts, 74, 3)) + +b11 = a11; // ok +>b11 : Symbol(b11, Decl(assignmentCompatWithCallSignatures3.ts, 74, 3)) +>a11 : Symbol(a11, Decl(assignmentCompatWithCallSignatures3.ts, 17, 3)) + +var b12: >(x: Array, y: T) => Array; +>b12 : Symbol(b12, Decl(assignmentCompatWithCallSignatures3.ts, 77, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 77, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 77, 33)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures3.ts, 77, 48)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 77, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) + +a12 = b12; // ok +>a12 : Symbol(a12, Decl(assignmentCompatWithCallSignatures3.ts, 18, 3)) +>b12 : Symbol(b12, Decl(assignmentCompatWithCallSignatures3.ts, 77, 3)) + +b12 = a12; // ok +>b12 : Symbol(b12, Decl(assignmentCompatWithCallSignatures3.ts, 77, 3)) +>a12 : Symbol(a12, Decl(assignmentCompatWithCallSignatures3.ts, 18, 3)) + +var b13: >(x: Array, y: T) => T; +>b13 : Symbol(b13, Decl(assignmentCompatWithCallSignatures3.ts, 80, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 80, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 80, 36)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures3.ts, 80, 51)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 80, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 80, 10)) + +a13 = b13; // ok +>a13 : Symbol(a13, Decl(assignmentCompatWithCallSignatures3.ts, 19, 3)) +>b13 : Symbol(b13, Decl(assignmentCompatWithCallSignatures3.ts, 80, 3)) + +b13 = a13; // ok +>b13 : Symbol(b13, Decl(assignmentCompatWithCallSignatures3.ts, 80, 3)) +>a13 : Symbol(a13, Decl(assignmentCompatWithCallSignatures3.ts, 19, 3)) + +var b14: (x: { a: T; b: T }) => T; +>b14 : Symbol(b14, Decl(assignmentCompatWithCallSignatures3.ts, 83, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 83, 10)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 83, 13)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures3.ts, 83, 17)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 83, 10)) +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures3.ts, 83, 23)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 83, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 83, 10)) + +a14 = b14; // ok +>a14 : Symbol(a14, Decl(assignmentCompatWithCallSignatures3.ts, 20, 3)) +>b14 : Symbol(b14, Decl(assignmentCompatWithCallSignatures3.ts, 83, 3)) + +b14 = a14; // ok +>b14 : Symbol(b14, Decl(assignmentCompatWithCallSignatures3.ts, 83, 3)) +>a14 : Symbol(a14, Decl(assignmentCompatWithCallSignatures3.ts, 20, 3)) + +var b15: (x: T) => T[]; +>b15 : Symbol(b15, Decl(assignmentCompatWithCallSignatures3.ts, 86, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 86, 10)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 86, 13)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 86, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 86, 10)) + +a15 = b15; // ok +>a15 : Symbol(a15, Decl(assignmentCompatWithCallSignatures3.ts, 21, 3)) +>b15 : Symbol(b15, Decl(assignmentCompatWithCallSignatures3.ts, 86, 3)) + +b15 = a15; // ok +>b15 : Symbol(b15, Decl(assignmentCompatWithCallSignatures3.ts, 86, 3)) +>a15 : Symbol(a15, Decl(assignmentCompatWithCallSignatures3.ts, 21, 3)) + +var b16: (x: T) => number[]; +>b16 : Symbol(b16, Decl(assignmentCompatWithCallSignatures3.ts, 89, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 89, 10)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 89, 26)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 89, 10)) + +a16 = b16; // ok +>a16 : Symbol(a16, Decl(assignmentCompatWithCallSignatures3.ts, 25, 3)) +>b16 : Symbol(b16, Decl(assignmentCompatWithCallSignatures3.ts, 89, 3)) + +b16 = a16; // ok +>b16 : Symbol(b16, Decl(assignmentCompatWithCallSignatures3.ts, 89, 3)) +>a16 : Symbol(a16, Decl(assignmentCompatWithCallSignatures3.ts, 25, 3)) + +var b17: (x: (a: T) => T) => T[]; // ok +>b17 : Symbol(b17, Decl(assignmentCompatWithCallSignatures3.ts, 92, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 92, 10)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 92, 13)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures3.ts, 92, 17)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 92, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 92, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 92, 10)) + +a17 = b17; // ok +>a17 : Symbol(a17, Decl(assignmentCompatWithCallSignatures3.ts, 29, 3)) +>b17 : Symbol(b17, Decl(assignmentCompatWithCallSignatures3.ts, 92, 3)) + +b17 = a17; // ok +>b17 : Symbol(b17, Decl(assignmentCompatWithCallSignatures3.ts, 92, 3)) +>a17 : Symbol(a17, Decl(assignmentCompatWithCallSignatures3.ts, 29, 3)) + +var b18: (x: (a: T) => T) => T[]; +>b18 : Symbol(b18, Decl(assignmentCompatWithCallSignatures3.ts, 95, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 95, 10)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 95, 13)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures3.ts, 95, 17)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 95, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 95, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 95, 10)) + +a18 = b18; // ok +>a18 : Symbol(a18, Decl(assignmentCompatWithCallSignatures3.ts, 33, 3)) +>b18 : Symbol(b18, Decl(assignmentCompatWithCallSignatures3.ts, 95, 3)) + +b18 = a18; // ok +>b18 : Symbol(b18, Decl(assignmentCompatWithCallSignatures3.ts, 95, 3)) +>a18 : Symbol(a18, Decl(assignmentCompatWithCallSignatures3.ts, 33, 3)) + diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures5.symbols b/tests/baselines/reference/assignmentCompatWithCallSignatures5.symbols new file mode 100644 index 00000000000..e26e95b0c0c --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures5.symbols @@ -0,0 +1,358 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures5.ts === +// checking assignment compat for function types. No errors in this file + +class Base { foo: string; } +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures5.ts, 0, 0)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures5.ts, 2, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures5.ts, 2, 27)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures5.ts, 0, 0)) +>bar : Symbol(bar, Decl(assignmentCompatWithCallSignatures5.ts, 3, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(assignmentCompatWithCallSignatures5.ts, 3, 43)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures5.ts, 2, 27)) +>baz : Symbol(baz, Decl(assignmentCompatWithCallSignatures5.ts, 4, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(assignmentCompatWithCallSignatures5.ts, 4, 47)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures5.ts, 0, 0)) +>bing : Symbol(bing, Decl(assignmentCompatWithCallSignatures5.ts, 5, 33)) + +var a: (x: T) => T[]; +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 7, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 7, 8)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 7, 11)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 7, 8)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 7, 8)) + +var a2: (x: T) => string[]; +>a2 : Symbol(a2, Decl(assignmentCompatWithCallSignatures5.ts, 8, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 8, 9)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 8, 12)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 8, 9)) + +var a3: (x: T) => void; +>a3 : Symbol(a3, Decl(assignmentCompatWithCallSignatures5.ts, 9, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 9, 9)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 9, 12)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 9, 9)) + +var a4: (x: T, y: U) => string; +>a4 : Symbol(a4, Decl(assignmentCompatWithCallSignatures5.ts, 10, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 10, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 10, 11)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 10, 14)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 10, 9)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures5.ts, 10, 19)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 10, 11)) + +var a5: (x: (arg: T) => U) => T; +>a5 : Symbol(a5, Decl(assignmentCompatWithCallSignatures5.ts, 11, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 11, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 11, 11)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 11, 14)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures5.ts, 11, 18)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 11, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 11, 11)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 11, 9)) + +var a6: (x: (arg: T) => Derived) => T; +>a6 : Symbol(a6, Decl(assignmentCompatWithCallSignatures5.ts, 12, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 12, 9)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures5.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 12, 25)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures5.ts, 12, 29)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 12, 9)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures5.ts, 2, 27)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 12, 9)) + +var a11: (x: { foo: T }, y: { foo: T; bar: T }) => Base; +>a11 : Symbol(a11, Decl(assignmentCompatWithCallSignatures5.ts, 13, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 13, 10)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 13, 13)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures5.ts, 13, 17)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 13, 10)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures5.ts, 13, 27)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures5.ts, 13, 32)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 13, 10)) +>bar : Symbol(bar, Decl(assignmentCompatWithCallSignatures5.ts, 13, 40)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 13, 10)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures5.ts, 0, 0)) + +var a15: (x: { a: T; b: T }) => T[]; +>a15 : Symbol(a15, Decl(assignmentCompatWithCallSignatures5.ts, 14, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 14, 10)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 14, 13)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 14, 17)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 14, 10)) +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures5.ts, 14, 23)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 14, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 14, 10)) + +var a16: (x: { a: T; b: T }) => T[]; +>a16 : Symbol(a16, Decl(assignmentCompatWithCallSignatures5.ts, 15, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 15, 10)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures5.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 15, 26)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 15, 30)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 15, 10)) +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures5.ts, 15, 36)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 15, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 15, 10)) + +var a17: { +>a17 : Symbol(a17, Decl(assignmentCompatWithCallSignatures5.ts, 16, 3)) + + (x: (a: T) => T): T[]; +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 17, 5)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures5.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 17, 24)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 17, 28)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 17, 5)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 17, 5)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 17, 5)) + + (x: (a: T) => T): T[]; +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 18, 5)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures5.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 18, 21)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 18, 25)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 18, 5)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 18, 5)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 18, 5)) + +}; +var a18: { +>a18 : Symbol(a18, Decl(assignmentCompatWithCallSignatures5.ts, 20, 3)) + + (x: { +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 21, 5)) + + (a: T): T; +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 22, 9)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures5.ts, 2, 27)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 22, 28)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 22, 9)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 22, 9)) + + (a: T): T; +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 23, 9)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures5.ts, 0, 0)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 23, 25)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 23, 9)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 23, 9)) + + }): any[]; + (x: { +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 25, 5)) + + (a: T): T; +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 26, 9)) +>Derived2 : Symbol(Derived2, Decl(assignmentCompatWithCallSignatures5.ts, 3, 43)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 26, 29)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 26, 9)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 26, 9)) + + (a: T): T; +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 27, 9)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures5.ts, 0, 0)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 27, 25)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 27, 9)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 27, 9)) + + }): any[]; +}; + +var b: (x: T) => T[]; +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures5.ts, 31, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 31, 8)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 31, 11)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 31, 8)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 31, 8)) + +a = b; // ok +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 7, 3)) +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures5.ts, 31, 3)) + +b = a; // ok +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures5.ts, 31, 3)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 7, 3)) + +var b2: (x: T) => string[]; +>b2 : Symbol(b2, Decl(assignmentCompatWithCallSignatures5.ts, 34, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 34, 9)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 34, 12)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 34, 9)) + +a2 = b2; // ok +>a2 : Symbol(a2, Decl(assignmentCompatWithCallSignatures5.ts, 8, 3)) +>b2 : Symbol(b2, Decl(assignmentCompatWithCallSignatures5.ts, 34, 3)) + +b2 = a2; // ok +>b2 : Symbol(b2, Decl(assignmentCompatWithCallSignatures5.ts, 34, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithCallSignatures5.ts, 8, 3)) + +var b3: (x: T) => T; +>b3 : Symbol(b3, Decl(assignmentCompatWithCallSignatures5.ts, 37, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 37, 9)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 37, 12)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 37, 9)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 37, 9)) + +a3 = b3; // ok +>a3 : Symbol(a3, Decl(assignmentCompatWithCallSignatures5.ts, 9, 3)) +>b3 : Symbol(b3, Decl(assignmentCompatWithCallSignatures5.ts, 37, 3)) + +b3 = a3; // ok +>b3 : Symbol(b3, Decl(assignmentCompatWithCallSignatures5.ts, 37, 3)) +>a3 : Symbol(a3, Decl(assignmentCompatWithCallSignatures5.ts, 9, 3)) + +var b4: (x: T, y: U) => string; +>b4 : Symbol(b4, Decl(assignmentCompatWithCallSignatures5.ts, 40, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 40, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 40, 11)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 40, 15)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 40, 9)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures5.ts, 40, 20)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 40, 11)) + +a4 = b4; // ok +>a4 : Symbol(a4, Decl(assignmentCompatWithCallSignatures5.ts, 10, 3)) +>b4 : Symbol(b4, Decl(assignmentCompatWithCallSignatures5.ts, 40, 3)) + +b4 = a4; // ok +>b4 : Symbol(b4, Decl(assignmentCompatWithCallSignatures5.ts, 40, 3)) +>a4 : Symbol(a4, Decl(assignmentCompatWithCallSignatures5.ts, 10, 3)) + +var b5: (x: (arg: T) => U) => T; +>b5 : Symbol(b5, Decl(assignmentCompatWithCallSignatures5.ts, 43, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 43, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 43, 11)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 43, 15)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures5.ts, 43, 19)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 43, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 43, 11)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 43, 9)) + +a5 = b5; // ok +>a5 : Symbol(a5, Decl(assignmentCompatWithCallSignatures5.ts, 11, 3)) +>b5 : Symbol(b5, Decl(assignmentCompatWithCallSignatures5.ts, 43, 3)) + +b5 = a5; // ok +>b5 : Symbol(b5, Decl(assignmentCompatWithCallSignatures5.ts, 43, 3)) +>a5 : Symbol(a5, Decl(assignmentCompatWithCallSignatures5.ts, 11, 3)) + +var b6: (x: (arg: T) => U) => T; +>b6 : Symbol(b6, Decl(assignmentCompatWithCallSignatures5.ts, 46, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 46, 9)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures5.ts, 0, 0)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 46, 24)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures5.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 46, 44)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures5.ts, 46, 48)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 46, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 46, 24)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 46, 9)) + +a6 = b6; // ok +>a6 : Symbol(a6, Decl(assignmentCompatWithCallSignatures5.ts, 12, 3)) +>b6 : Symbol(b6, Decl(assignmentCompatWithCallSignatures5.ts, 46, 3)) + +b6 = a6; // ok +>b6 : Symbol(b6, Decl(assignmentCompatWithCallSignatures5.ts, 46, 3)) +>a6 : Symbol(a6, Decl(assignmentCompatWithCallSignatures5.ts, 12, 3)) + +var b11: (x: { foo: T }, y: { foo: U; bar: U }) => Base; +>b11 : Symbol(b11, Decl(assignmentCompatWithCallSignatures5.ts, 49, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 49, 10)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 49, 12)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 49, 16)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures5.ts, 49, 20)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 49, 10)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures5.ts, 49, 30)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures5.ts, 49, 35)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 49, 12)) +>bar : Symbol(bar, Decl(assignmentCompatWithCallSignatures5.ts, 49, 43)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 49, 12)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures5.ts, 0, 0)) + +a11 = b11; // ok +>a11 : Symbol(a11, Decl(assignmentCompatWithCallSignatures5.ts, 13, 3)) +>b11 : Symbol(b11, Decl(assignmentCompatWithCallSignatures5.ts, 49, 3)) + +b11 = a11; // ok +>b11 : Symbol(b11, Decl(assignmentCompatWithCallSignatures5.ts, 49, 3)) +>a11 : Symbol(a11, Decl(assignmentCompatWithCallSignatures5.ts, 13, 3)) + +var b15: (x: { a: U; b: V; }) => U[]; +>b15 : Symbol(b15, Decl(assignmentCompatWithCallSignatures5.ts, 52, 3)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 52, 10)) +>V : Symbol(V, Decl(assignmentCompatWithCallSignatures5.ts, 52, 12)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 52, 16)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 52, 20)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 52, 10)) +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures5.ts, 52, 26)) +>V : Symbol(V, Decl(assignmentCompatWithCallSignatures5.ts, 52, 12)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 52, 10)) + +a15 = b15; // ok, T = U, T = V +>a15 : Symbol(a15, Decl(assignmentCompatWithCallSignatures5.ts, 14, 3)) +>b15 : Symbol(b15, Decl(assignmentCompatWithCallSignatures5.ts, 52, 3)) + +b15 = a15; // ok +>b15 : Symbol(b15, Decl(assignmentCompatWithCallSignatures5.ts, 52, 3)) +>a15 : Symbol(a15, Decl(assignmentCompatWithCallSignatures5.ts, 14, 3)) + +var b16: (x: { a: T; b: T }) => T[]; +>b16 : Symbol(b16, Decl(assignmentCompatWithCallSignatures5.ts, 55, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 55, 10)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 55, 13)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 55, 17)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 55, 10)) +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures5.ts, 55, 23)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 55, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 55, 10)) + +a15 = b16; // ok +>a15 : Symbol(a15, Decl(assignmentCompatWithCallSignatures5.ts, 14, 3)) +>b16 : Symbol(b16, Decl(assignmentCompatWithCallSignatures5.ts, 55, 3)) + +b15 = a16; // ok +>b15 : Symbol(b15, Decl(assignmentCompatWithCallSignatures5.ts, 52, 3)) +>a16 : Symbol(a16, Decl(assignmentCompatWithCallSignatures5.ts, 15, 3)) + +var b17: (x: (a: T) => T) => T[]; +>b17 : Symbol(b17, Decl(assignmentCompatWithCallSignatures5.ts, 58, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 58, 10)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 58, 13)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 58, 17)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 58, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 58, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 58, 10)) + +a17 = b17; // ok +>a17 : Symbol(a17, Decl(assignmentCompatWithCallSignatures5.ts, 16, 3)) +>b17 : Symbol(b17, Decl(assignmentCompatWithCallSignatures5.ts, 58, 3)) + +b17 = a17; // ok +>b17 : Symbol(b17, Decl(assignmentCompatWithCallSignatures5.ts, 58, 3)) +>a17 : Symbol(a17, Decl(assignmentCompatWithCallSignatures5.ts, 16, 3)) + +var b18: (x: (a: T) => T) => any[]; +>b18 : Symbol(b18, Decl(assignmentCompatWithCallSignatures5.ts, 61, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 61, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 61, 14)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 61, 17)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 61, 14)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 61, 14)) + +a18 = b18; // ok +>a18 : Symbol(a18, Decl(assignmentCompatWithCallSignatures5.ts, 20, 3)) +>b18 : Symbol(b18, Decl(assignmentCompatWithCallSignatures5.ts, 61, 3)) + +b18 = a18; // ok +>b18 : Symbol(b18, Decl(assignmentCompatWithCallSignatures5.ts, 61, 3)) +>a18 : Symbol(a18, Decl(assignmentCompatWithCallSignatures5.ts, 20, 3)) + diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures6.symbols b/tests/baselines/reference/assignmentCompatWithCallSignatures6.symbols new file mode 100644 index 00000000000..b7e6956ef65 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures6.symbols @@ -0,0 +1,259 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures6.ts === +// checking assignment compatibility relations for function types. All valid + +class Base { foo: string; } +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures6.ts, 0, 0)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures6.ts, 2, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures6.ts, 2, 27)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures6.ts, 0, 0)) +>bar : Symbol(bar, Decl(assignmentCompatWithCallSignatures6.ts, 3, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(assignmentCompatWithCallSignatures6.ts, 3, 43)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures6.ts, 2, 27)) +>baz : Symbol(baz, Decl(assignmentCompatWithCallSignatures6.ts, 4, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(assignmentCompatWithCallSignatures6.ts, 4, 47)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures6.ts, 0, 0)) +>bing : Symbol(bing, Decl(assignmentCompatWithCallSignatures6.ts, 5, 33)) + +interface A { +>A : Symbol(A, Decl(assignmentCompatWithCallSignatures6.ts, 5, 49)) + + a: (x: T) => T[]; +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures6.ts, 7, 13)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 8, 8)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 8, 11)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 8, 8)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 8, 8)) + + a2: (x: T) => string[]; +>a2 : Symbol(a2, Decl(assignmentCompatWithCallSignatures6.ts, 8, 24)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 9, 9)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 9, 12)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 9, 9)) + + a3: (x: T) => void; +>a3 : Symbol(a3, Decl(assignmentCompatWithCallSignatures6.ts, 9, 30)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 10, 9)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 10, 12)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 10, 9)) + + a4: (x: T, y: U) => string; +>a4 : Symbol(a4, Decl(assignmentCompatWithCallSignatures6.ts, 10, 26)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 11, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures6.ts, 11, 11)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 11, 14)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 11, 9)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures6.ts, 11, 19)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures6.ts, 11, 11)) + + a5: (x: (arg: T) => U) => T; +>a5 : Symbol(a5, Decl(assignmentCompatWithCallSignatures6.ts, 11, 36)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 12, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures6.ts, 12, 11)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 12, 14)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures6.ts, 12, 18)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 12, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures6.ts, 12, 11)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 12, 9)) + + a6: (x: (arg: T) => Derived) => T; +>a6 : Symbol(a6, Decl(assignmentCompatWithCallSignatures6.ts, 12, 37)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 13, 9)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures6.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 13, 25)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures6.ts, 13, 29)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 13, 9)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures6.ts, 2, 27)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 13, 9)) + + a11: (x: { foo: T }, y: { foo: T; bar: T }) => Base; +>a11 : Symbol(a11, Decl(assignmentCompatWithCallSignatures6.ts, 13, 54)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 14, 10)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 14, 13)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures6.ts, 14, 17)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 14, 10)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures6.ts, 14, 27)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures6.ts, 14, 32)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 14, 10)) +>bar : Symbol(bar, Decl(assignmentCompatWithCallSignatures6.ts, 14, 40)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 14, 10)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures6.ts, 0, 0)) + + a15: (x: { a: T; b: T }) => T[]; +>a15 : Symbol(a15, Decl(assignmentCompatWithCallSignatures6.ts, 14, 59)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 15, 10)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 15, 13)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures6.ts, 15, 17)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 15, 10)) +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures6.ts, 15, 23)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 15, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 15, 10)) + + a16: (x: { a: T; b: T }) => T[]; +>a16 : Symbol(a16, Decl(assignmentCompatWithCallSignatures6.ts, 15, 39)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 16, 10)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures6.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 16, 26)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures6.ts, 16, 30)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 16, 10)) +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures6.ts, 16, 36)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 16, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 16, 10)) +} + +var x: A; +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>A : Symbol(A, Decl(assignmentCompatWithCallSignatures6.ts, 5, 49)) + +var b: (x: T) => T[]; +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures6.ts, 21, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 21, 8)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 21, 11)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 21, 8)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 21, 8)) + +x.a = b; +>x.a : Symbol(A.a, Decl(assignmentCompatWithCallSignatures6.ts, 7, 13)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a : Symbol(A.a, Decl(assignmentCompatWithCallSignatures6.ts, 7, 13)) +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures6.ts, 21, 3)) + +b = x.a; +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures6.ts, 21, 3)) +>x.a : Symbol(A.a, Decl(assignmentCompatWithCallSignatures6.ts, 7, 13)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a : Symbol(A.a, Decl(assignmentCompatWithCallSignatures6.ts, 7, 13)) + +var b2: (x: T) => string[]; +>b2 : Symbol(b2, Decl(assignmentCompatWithCallSignatures6.ts, 24, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 24, 9)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 24, 12)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 24, 9)) + +x.a2 = b2; +>x.a2 : Symbol(A.a2, Decl(assignmentCompatWithCallSignatures6.ts, 8, 24)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a2 : Symbol(A.a2, Decl(assignmentCompatWithCallSignatures6.ts, 8, 24)) +>b2 : Symbol(b2, Decl(assignmentCompatWithCallSignatures6.ts, 24, 3)) + +b2 = x.a2; +>b2 : Symbol(b2, Decl(assignmentCompatWithCallSignatures6.ts, 24, 3)) +>x.a2 : Symbol(A.a2, Decl(assignmentCompatWithCallSignatures6.ts, 8, 24)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a2 : Symbol(A.a2, Decl(assignmentCompatWithCallSignatures6.ts, 8, 24)) + +var b3: (x: T) => T; +>b3 : Symbol(b3, Decl(assignmentCompatWithCallSignatures6.ts, 27, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 27, 9)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 27, 12)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 27, 9)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 27, 9)) + +x.a3 = b3; +>x.a3 : Symbol(A.a3, Decl(assignmentCompatWithCallSignatures6.ts, 9, 30)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a3 : Symbol(A.a3, Decl(assignmentCompatWithCallSignatures6.ts, 9, 30)) +>b3 : Symbol(b3, Decl(assignmentCompatWithCallSignatures6.ts, 27, 3)) + +b3 = x.a3; +>b3 : Symbol(b3, Decl(assignmentCompatWithCallSignatures6.ts, 27, 3)) +>x.a3 : Symbol(A.a3, Decl(assignmentCompatWithCallSignatures6.ts, 9, 30)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a3 : Symbol(A.a3, Decl(assignmentCompatWithCallSignatures6.ts, 9, 30)) + +var b4: (x: T, y: U) => string; +>b4 : Symbol(b4, Decl(assignmentCompatWithCallSignatures6.ts, 30, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 30, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures6.ts, 30, 11)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 30, 15)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 30, 9)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures6.ts, 30, 20)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures6.ts, 30, 11)) + +x.a4 = b4; +>x.a4 : Symbol(A.a4, Decl(assignmentCompatWithCallSignatures6.ts, 10, 26)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a4 : Symbol(A.a4, Decl(assignmentCompatWithCallSignatures6.ts, 10, 26)) +>b4 : Symbol(b4, Decl(assignmentCompatWithCallSignatures6.ts, 30, 3)) + +b4 = x.a4; +>b4 : Symbol(b4, Decl(assignmentCompatWithCallSignatures6.ts, 30, 3)) +>x.a4 : Symbol(A.a4, Decl(assignmentCompatWithCallSignatures6.ts, 10, 26)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a4 : Symbol(A.a4, Decl(assignmentCompatWithCallSignatures6.ts, 10, 26)) + +var b5: (x: (arg: T) => U) => T; +>b5 : Symbol(b5, Decl(assignmentCompatWithCallSignatures6.ts, 33, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 33, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures6.ts, 33, 11)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 33, 15)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures6.ts, 33, 19)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 33, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures6.ts, 33, 11)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 33, 9)) + +x.a5 = b5; +>x.a5 : Symbol(A.a5, Decl(assignmentCompatWithCallSignatures6.ts, 11, 36)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a5 : Symbol(A.a5, Decl(assignmentCompatWithCallSignatures6.ts, 11, 36)) +>b5 : Symbol(b5, Decl(assignmentCompatWithCallSignatures6.ts, 33, 3)) + +b5 = x.a5; +>b5 : Symbol(b5, Decl(assignmentCompatWithCallSignatures6.ts, 33, 3)) +>x.a5 : Symbol(A.a5, Decl(assignmentCompatWithCallSignatures6.ts, 11, 36)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a5 : Symbol(A.a5, Decl(assignmentCompatWithCallSignatures6.ts, 11, 36)) + +var b11: (x: { foo: T }, y: { foo: U; bar: U }) => Base; +>b11 : Symbol(b11, Decl(assignmentCompatWithCallSignatures6.ts, 36, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 36, 10)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures6.ts, 36, 12)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 36, 16)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures6.ts, 36, 20)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 36, 10)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures6.ts, 36, 30)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures6.ts, 36, 35)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures6.ts, 36, 12)) +>bar : Symbol(bar, Decl(assignmentCompatWithCallSignatures6.ts, 36, 43)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures6.ts, 36, 12)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures6.ts, 0, 0)) + +x.a11 = b11; +>x.a11 : Symbol(A.a11, Decl(assignmentCompatWithCallSignatures6.ts, 13, 54)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a11 : Symbol(A.a11, Decl(assignmentCompatWithCallSignatures6.ts, 13, 54)) +>b11 : Symbol(b11, Decl(assignmentCompatWithCallSignatures6.ts, 36, 3)) + +b11 = x.a11; +>b11 : Symbol(b11, Decl(assignmentCompatWithCallSignatures6.ts, 36, 3)) +>x.a11 : Symbol(A.a11, Decl(assignmentCompatWithCallSignatures6.ts, 13, 54)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a11 : Symbol(A.a11, Decl(assignmentCompatWithCallSignatures6.ts, 13, 54)) + +var b16: (x: { a: T; b: T }) => T[]; +>b16 : Symbol(b16, Decl(assignmentCompatWithCallSignatures6.ts, 39, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 39, 10)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 39, 13)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures6.ts, 39, 17)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 39, 10)) +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures6.ts, 39, 23)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 39, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 39, 10)) + +x.a16 = b16; +>x.a16 : Symbol(A.a16, Decl(assignmentCompatWithCallSignatures6.ts, 15, 39)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a16 : Symbol(A.a16, Decl(assignmentCompatWithCallSignatures6.ts, 15, 39)) +>b16 : Symbol(b16, Decl(assignmentCompatWithCallSignatures6.ts, 39, 3)) + +b16 = x.a16; +>b16 : Symbol(b16, Decl(assignmentCompatWithCallSignatures6.ts, 39, 3)) +>x.a16 : Symbol(A.a16, Decl(assignmentCompatWithCallSignatures6.ts, 15, 39)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a16 : Symbol(A.a16, Decl(assignmentCompatWithCallSignatures6.ts, 15, 39)) + diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.symbols b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.symbols new file mode 100644 index 00000000000..ef02b7a08d3 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.symbols @@ -0,0 +1,529 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures3.ts === +// checking assignment compatibility relations for function types. All of these are valid. + +class Base { foo: string; } +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>bar : Symbol(bar, Decl(assignmentCompatWithConstructSignatures3.ts, 3, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(assignmentCompatWithConstructSignatures3.ts, 3, 43)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>baz : Symbol(baz, Decl(assignmentCompatWithConstructSignatures3.ts, 4, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(assignmentCompatWithConstructSignatures3.ts, 4, 47)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>bing : Symbol(bing, Decl(assignmentCompatWithConstructSignatures3.ts, 5, 33)) + +var a: new (x: number) => number[]; +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures3.ts, 7, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 7, 12)) + +var a2: new (x: number) => string[]; +>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignatures3.ts, 8, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 8, 13)) + +var a3: new (x: number) => void; +>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignatures3.ts, 9, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 9, 13)) + +var a4: new (x: string, y: number) => string; +>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignatures3.ts, 10, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 10, 13)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures3.ts, 10, 23)) + +var a5: new (x: (arg: string) => number) => string; +>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignatures3.ts, 11, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 11, 13)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures3.ts, 11, 17)) + +var a6: new (x: (arg: Base) => Derived) => Base; +>a6 : Symbol(a6, Decl(assignmentCompatWithConstructSignatures3.ts, 12, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 12, 13)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures3.ts, 12, 17)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) + +var a7: new (x: (arg: Base) => Derived) => (r: Base) => Derived; +>a7 : Symbol(a7, Decl(assignmentCompatWithConstructSignatures3.ts, 13, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 13, 13)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures3.ts, 13, 17)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>r : Symbol(r, Decl(assignmentCompatWithConstructSignatures3.ts, 13, 44)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) + +var a8: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +>a8 : Symbol(a8, Decl(assignmentCompatWithConstructSignatures3.ts, 14, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 14, 13)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures3.ts, 14, 17)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures3.ts, 14, 39)) +>arg2 : Symbol(arg2, Decl(assignmentCompatWithConstructSignatures3.ts, 14, 44)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>r : Symbol(r, Decl(assignmentCompatWithConstructSignatures3.ts, 14, 72)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) + +var a9: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +>a9 : Symbol(a9, Decl(assignmentCompatWithConstructSignatures3.ts, 15, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 15, 13)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures3.ts, 15, 17)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures3.ts, 15, 39)) +>arg2 : Symbol(arg2, Decl(assignmentCompatWithConstructSignatures3.ts, 15, 44)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>r : Symbol(r, Decl(assignmentCompatWithConstructSignatures3.ts, 15, 72)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) + +var a10: new (...x: Derived[]) => Derived; +>a10 : Symbol(a10, Decl(assignmentCompatWithConstructSignatures3.ts, 16, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 16, 14)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) + +var a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base; +>a11 : Symbol(a11, Decl(assignmentCompatWithConstructSignatures3.ts, 17, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 17, 14)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures3.ts, 17, 18)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures3.ts, 17, 33)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures3.ts, 17, 38)) +>bar : Symbol(bar, Decl(assignmentCompatWithConstructSignatures3.ts, 17, 51)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) + +var a12: new (x: Array, y: Array) => Array; +>a12 : Symbol(a12, Decl(assignmentCompatWithConstructSignatures3.ts, 18, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 18, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures3.ts, 18, 29)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived2 : Symbol(Derived2, Decl(assignmentCompatWithConstructSignatures3.ts, 3, 43)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) + +var a13: new (x: Array, y: Array) => Array; +>a13 : Symbol(a13, Decl(assignmentCompatWithConstructSignatures3.ts, 19, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 19, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures3.ts, 19, 29)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) + +var a14: new (x: { a: string; b: number }) => Object; +>a14 : Symbol(a14, Decl(assignmentCompatWithConstructSignatures3.ts, 20, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 20, 14)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures3.ts, 20, 18)) +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures3.ts, 20, 29)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var a15: { +>a15 : Symbol(a15, Decl(assignmentCompatWithConstructSignatures3.ts, 21, 3)) + + new (x: number): number[]; +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 22, 9)) + + new (x: string): string[]; +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 23, 9)) +} +var a16: { +>a16 : Symbol(a16, Decl(assignmentCompatWithConstructSignatures3.ts, 25, 3)) + + new (x: T): number[]; +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 26, 9)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 26, 28)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 26, 9)) + + new (x: U): number[]; +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 27, 9)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 27, 25)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 27, 9)) +} +var a17: { +>a17 : Symbol(a17, Decl(assignmentCompatWithConstructSignatures3.ts, 29, 3)) + + new (x: new (a: number) => number): number[]; +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 30, 9)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures3.ts, 30, 17)) + + new (x: new (a: string) => string): string[]; +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 31, 9)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures3.ts, 31, 17)) + +}; +var a18: { +>a18 : Symbol(a18, Decl(assignmentCompatWithConstructSignatures3.ts, 33, 3)) + + new (x: { +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 34, 9)) + + new (a: number): number; +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures3.ts, 35, 13)) + + new (a: string): string; +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures3.ts, 36, 13)) + + }): any[]; + new (x: { +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 38, 9)) + + new (a: boolean): boolean; +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures3.ts, 39, 13)) + + new (a: Date): Date; +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures3.ts, 40, 13)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + }): any[]; +} + +var b: new (x: T) => T[]; +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures3.ts, 44, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 44, 12)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 44, 15)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 44, 12)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 44, 12)) + +a = b; // ok +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures3.ts, 7, 3)) +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures3.ts, 44, 3)) + +b = a; // ok +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures3.ts, 44, 3)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures3.ts, 7, 3)) + +var b2: new (x: T) => string[]; +>b2 : Symbol(b2, Decl(assignmentCompatWithConstructSignatures3.ts, 47, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 47, 13)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 47, 16)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 47, 13)) + +a2 = b2; // ok +>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignatures3.ts, 8, 3)) +>b2 : Symbol(b2, Decl(assignmentCompatWithConstructSignatures3.ts, 47, 3)) + +b2 = a2; // ok +>b2 : Symbol(b2, Decl(assignmentCompatWithConstructSignatures3.ts, 47, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignatures3.ts, 8, 3)) + +var b3: new (x: T) => T; +>b3 : Symbol(b3, Decl(assignmentCompatWithConstructSignatures3.ts, 50, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 50, 13)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 50, 16)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 50, 13)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 50, 13)) + +a3 = b3; // ok +>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignatures3.ts, 9, 3)) +>b3 : Symbol(b3, Decl(assignmentCompatWithConstructSignatures3.ts, 50, 3)) + +b3 = a3; // ok +>b3 : Symbol(b3, Decl(assignmentCompatWithConstructSignatures3.ts, 50, 3)) +>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignatures3.ts, 9, 3)) + +var b4: new (x: T, y: U) => T; +>b4 : Symbol(b4, Decl(assignmentCompatWithConstructSignatures3.ts, 53, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 53, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 53, 15)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 53, 19)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 53, 13)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures3.ts, 53, 24)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 53, 15)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 53, 13)) + +a4 = b4; // ok +>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignatures3.ts, 10, 3)) +>b4 : Symbol(b4, Decl(assignmentCompatWithConstructSignatures3.ts, 53, 3)) + +b4 = a4; // ok +>b4 : Symbol(b4, Decl(assignmentCompatWithConstructSignatures3.ts, 53, 3)) +>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignatures3.ts, 10, 3)) + +var b5: new (x: (arg: T) => U) => T; +>b5 : Symbol(b5, Decl(assignmentCompatWithConstructSignatures3.ts, 56, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 56, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 56, 15)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 56, 19)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures3.ts, 56, 23)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 56, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 56, 15)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 56, 13)) + +a5 = b5; // ok +>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignatures3.ts, 11, 3)) +>b5 : Symbol(b5, Decl(assignmentCompatWithConstructSignatures3.ts, 56, 3)) + +b5 = a5; // ok +>b5 : Symbol(b5, Decl(assignmentCompatWithConstructSignatures3.ts, 56, 3)) +>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignatures3.ts, 11, 3)) + +var b6: new (x: (arg: T) => U) => T; +>b6 : Symbol(b6, Decl(assignmentCompatWithConstructSignatures3.ts, 59, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 59, 13)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 59, 28)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 59, 48)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures3.ts, 59, 52)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 59, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 59, 28)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 59, 13)) + +a6 = b6; // ok +>a6 : Symbol(a6, Decl(assignmentCompatWithConstructSignatures3.ts, 12, 3)) +>b6 : Symbol(b6, Decl(assignmentCompatWithConstructSignatures3.ts, 59, 3)) + +b6 = a6; // ok +>b6 : Symbol(b6, Decl(assignmentCompatWithConstructSignatures3.ts, 59, 3)) +>a6 : Symbol(a6, Decl(assignmentCompatWithConstructSignatures3.ts, 12, 3)) + +var b7: new (x: (arg: T) => U) => (r: T) => U; +>b7 : Symbol(b7, Decl(assignmentCompatWithConstructSignatures3.ts, 62, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 62, 13)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 62, 28)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 62, 48)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures3.ts, 62, 52)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 62, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 62, 28)) +>r : Symbol(r, Decl(assignmentCompatWithConstructSignatures3.ts, 62, 70)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 62, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 62, 28)) + +a7 = b7; // ok +>a7 : Symbol(a7, Decl(assignmentCompatWithConstructSignatures3.ts, 13, 3)) +>b7 : Symbol(b7, Decl(assignmentCompatWithConstructSignatures3.ts, 62, 3)) + +b7 = a7; // ok +>b7 : Symbol(b7, Decl(assignmentCompatWithConstructSignatures3.ts, 62, 3)) +>a7 : Symbol(a7, Decl(assignmentCompatWithConstructSignatures3.ts, 13, 3)) + +var b8: new (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; +>b8 : Symbol(b8, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 13)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 28)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 48)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 52)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 28)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 65)) +>arg2 : Symbol(arg2, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 70)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 28)) +>r : Symbol(r, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 89)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 28)) + +a8 = b8; // ok +>a8 : Symbol(a8, Decl(assignmentCompatWithConstructSignatures3.ts, 14, 3)) +>b8 : Symbol(b8, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 3)) + +b8 = a8; // ok +>b8 : Symbol(b8, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 3)) +>a8 : Symbol(a8, Decl(assignmentCompatWithConstructSignatures3.ts, 14, 3)) + +var b9: new (x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; +>b9 : Symbol(b9, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 13)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 28)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 48)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 52)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 28)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 65)) +>arg2 : Symbol(arg2, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 70)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 77)) +>bing : Symbol(bing, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 90)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 28)) +>r : Symbol(r, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 117)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 28)) + +a9 = b9; // ok +>a9 : Symbol(a9, Decl(assignmentCompatWithConstructSignatures3.ts, 15, 3)) +>b9 : Symbol(b9, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 3)) + +b9 = a9; // ok +>b9 : Symbol(b9, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 3)) +>a9 : Symbol(a9, Decl(assignmentCompatWithConstructSignatures3.ts, 15, 3)) + +var b10: new (...x: T[]) => T; +>b10 : Symbol(b10, Decl(assignmentCompatWithConstructSignatures3.ts, 71, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 71, 14)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 71, 33)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 71, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 71, 14)) + +a10 = b10; // ok +>a10 : Symbol(a10, Decl(assignmentCompatWithConstructSignatures3.ts, 16, 3)) +>b10 : Symbol(b10, Decl(assignmentCompatWithConstructSignatures3.ts, 71, 3)) + +b10 = a10; // ok +>b10 : Symbol(b10, Decl(assignmentCompatWithConstructSignatures3.ts, 71, 3)) +>a10 : Symbol(a10, Decl(assignmentCompatWithConstructSignatures3.ts, 16, 3)) + +var b11: new (x: T, y: T) => T; +>b11 : Symbol(b11, Decl(assignmentCompatWithConstructSignatures3.ts, 74, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 74, 14)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 74, 30)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 74, 14)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures3.ts, 74, 35)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 74, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 74, 14)) + +a11 = b11; // ok +>a11 : Symbol(a11, Decl(assignmentCompatWithConstructSignatures3.ts, 17, 3)) +>b11 : Symbol(b11, Decl(assignmentCompatWithConstructSignatures3.ts, 74, 3)) + +b11 = a11; // ok +>b11 : Symbol(b11, Decl(assignmentCompatWithConstructSignatures3.ts, 74, 3)) +>a11 : Symbol(a11, Decl(assignmentCompatWithConstructSignatures3.ts, 17, 3)) + +var b12: new >(x: Array, y: T) => Array; +>b12 : Symbol(b12, Decl(assignmentCompatWithConstructSignatures3.ts, 77, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 77, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 77, 37)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures3.ts, 77, 52)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 77, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) + +a12 = b12; // ok +>a12 : Symbol(a12, Decl(assignmentCompatWithConstructSignatures3.ts, 18, 3)) +>b12 : Symbol(b12, Decl(assignmentCompatWithConstructSignatures3.ts, 77, 3)) + +b12 = a12; // ok +>b12 : Symbol(b12, Decl(assignmentCompatWithConstructSignatures3.ts, 77, 3)) +>a12 : Symbol(a12, Decl(assignmentCompatWithConstructSignatures3.ts, 18, 3)) + +var b13: new >(x: Array, y: T) => T; +>b13 : Symbol(b13, Decl(assignmentCompatWithConstructSignatures3.ts, 80, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 80, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 80, 40)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures3.ts, 80, 55)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 80, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 80, 14)) + +a13 = b13; // ok +>a13 : Symbol(a13, Decl(assignmentCompatWithConstructSignatures3.ts, 19, 3)) +>b13 : Symbol(b13, Decl(assignmentCompatWithConstructSignatures3.ts, 80, 3)) + +b13 = a13; // ok +>b13 : Symbol(b13, Decl(assignmentCompatWithConstructSignatures3.ts, 80, 3)) +>a13 : Symbol(a13, Decl(assignmentCompatWithConstructSignatures3.ts, 19, 3)) + +var b14: new (x: { a: T; b: T }) => T; +>b14 : Symbol(b14, Decl(assignmentCompatWithConstructSignatures3.ts, 83, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 83, 14)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 83, 17)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures3.ts, 83, 21)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 83, 14)) +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures3.ts, 83, 27)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 83, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 83, 14)) + +a14 = b14; // ok +>a14 : Symbol(a14, Decl(assignmentCompatWithConstructSignatures3.ts, 20, 3)) +>b14 : Symbol(b14, Decl(assignmentCompatWithConstructSignatures3.ts, 83, 3)) + +b14 = a14; // ok +>b14 : Symbol(b14, Decl(assignmentCompatWithConstructSignatures3.ts, 83, 3)) +>a14 : Symbol(a14, Decl(assignmentCompatWithConstructSignatures3.ts, 20, 3)) + +var b15: new (x: T) => T[]; +>b15 : Symbol(b15, Decl(assignmentCompatWithConstructSignatures3.ts, 86, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 86, 14)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 86, 17)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 86, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 86, 14)) + +a15 = b15; // ok +>a15 : Symbol(a15, Decl(assignmentCompatWithConstructSignatures3.ts, 21, 3)) +>b15 : Symbol(b15, Decl(assignmentCompatWithConstructSignatures3.ts, 86, 3)) + +b15 = a15; // ok +>b15 : Symbol(b15, Decl(assignmentCompatWithConstructSignatures3.ts, 86, 3)) +>a15 : Symbol(a15, Decl(assignmentCompatWithConstructSignatures3.ts, 21, 3)) + +var b16: new (x: T) => number[]; +>b16 : Symbol(b16, Decl(assignmentCompatWithConstructSignatures3.ts, 89, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 89, 14)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 89, 30)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 89, 14)) + +a16 = b16; // ok +>a16 : Symbol(a16, Decl(assignmentCompatWithConstructSignatures3.ts, 25, 3)) +>b16 : Symbol(b16, Decl(assignmentCompatWithConstructSignatures3.ts, 89, 3)) + +b16 = a16; // ok +>b16 : Symbol(b16, Decl(assignmentCompatWithConstructSignatures3.ts, 89, 3)) +>a16 : Symbol(a16, Decl(assignmentCompatWithConstructSignatures3.ts, 25, 3)) + +var b17: new (x: new (a: T) => T) => T[]; // ok +>b17 : Symbol(b17, Decl(assignmentCompatWithConstructSignatures3.ts, 92, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 92, 14)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 92, 17)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures3.ts, 92, 25)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 92, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 92, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 92, 14)) + +a17 = b17; // ok +>a17 : Symbol(a17, Decl(assignmentCompatWithConstructSignatures3.ts, 29, 3)) +>b17 : Symbol(b17, Decl(assignmentCompatWithConstructSignatures3.ts, 92, 3)) + +b17 = a17; // ok +>b17 : Symbol(b17, Decl(assignmentCompatWithConstructSignatures3.ts, 92, 3)) +>a17 : Symbol(a17, Decl(assignmentCompatWithConstructSignatures3.ts, 29, 3)) + +var b18: new (x: new (a: T) => T) => T[]; +>b18 : Symbol(b18, Decl(assignmentCompatWithConstructSignatures3.ts, 95, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 95, 14)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 95, 17)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures3.ts, 95, 25)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 95, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 95, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 95, 14)) + +a18 = b18; // ok +>a18 : Symbol(a18, Decl(assignmentCompatWithConstructSignatures3.ts, 33, 3)) +>b18 : Symbol(b18, Decl(assignmentCompatWithConstructSignatures3.ts, 95, 3)) + +b18 = a18; // ok +>b18 : Symbol(b18, Decl(assignmentCompatWithConstructSignatures3.ts, 95, 3)) +>a18 : Symbol(a18, Decl(assignmentCompatWithConstructSignatures3.ts, 33, 3)) + diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures5.symbols b/tests/baselines/reference/assignmentCompatWithConstructSignatures5.symbols new file mode 100644 index 00000000000..d2016b247b8 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures5.symbols @@ -0,0 +1,358 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures5.ts === +// checking assignment compat for function types. All valid + +class Base { foo: string; } +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures5.ts, 0, 0)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures5.ts, 2, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures5.ts, 2, 27)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures5.ts, 0, 0)) +>bar : Symbol(bar, Decl(assignmentCompatWithConstructSignatures5.ts, 3, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(assignmentCompatWithConstructSignatures5.ts, 3, 43)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures5.ts, 2, 27)) +>baz : Symbol(baz, Decl(assignmentCompatWithConstructSignatures5.ts, 4, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(assignmentCompatWithConstructSignatures5.ts, 4, 47)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures5.ts, 0, 0)) +>bing : Symbol(bing, Decl(assignmentCompatWithConstructSignatures5.ts, 5, 33)) + +var a: new (x: T) => T[]; +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 7, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 7, 12)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 7, 15)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 7, 12)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 7, 12)) + +var a2: new (x: T) => string[]; +>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignatures5.ts, 8, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 8, 13)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 8, 16)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 8, 13)) + +var a3: new (x: T) => void; +>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignatures5.ts, 9, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 9, 13)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 9, 16)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 9, 13)) + +var a4: new (x: T, y: U) => string; +>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignatures5.ts, 10, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 10, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 10, 15)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 10, 19)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 10, 13)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures5.ts, 10, 24)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 10, 15)) + +var a5: new (x: new (arg: T) => U) => T; +>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignatures5.ts, 11, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 11, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 11, 15)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 11, 19)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures5.ts, 11, 27)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 11, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 11, 15)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 11, 13)) + +var a6: new (x: new (arg: T) => Derived) => T; +>a6 : Symbol(a6, Decl(assignmentCompatWithConstructSignatures5.ts, 12, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 12, 13)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures5.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 12, 29)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures5.ts, 12, 37)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 12, 13)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures5.ts, 2, 27)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 12, 13)) + +var a11: new (x: { foo: T }, y: { foo: T; bar: T }) => Base; +>a11 : Symbol(a11, Decl(assignmentCompatWithConstructSignatures5.ts, 13, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 13, 14)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 13, 17)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures5.ts, 13, 21)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 13, 14)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures5.ts, 13, 31)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures5.ts, 13, 36)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 13, 14)) +>bar : Symbol(bar, Decl(assignmentCompatWithConstructSignatures5.ts, 13, 44)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 13, 14)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures5.ts, 0, 0)) + +var a15: new (x: { a: T; b: T }) => T[]; +>a15 : Symbol(a15, Decl(assignmentCompatWithConstructSignatures5.ts, 14, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 14, 14)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 14, 17)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 14, 21)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 14, 14)) +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures5.ts, 14, 27)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 14, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 14, 14)) + +var a16: new (x: { a: T; b: T }) => T[]; +>a16 : Symbol(a16, Decl(assignmentCompatWithConstructSignatures5.ts, 15, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 15, 14)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures5.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 15, 30)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 15, 34)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 15, 14)) +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures5.ts, 15, 40)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 15, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 15, 14)) + +var a17: { +>a17 : Symbol(a17, Decl(assignmentCompatWithConstructSignatures5.ts, 16, 3)) + + new (x: new (a: T) => T): T[]; +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 17, 9)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures5.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 17, 28)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 17, 36)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 17, 9)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 17, 9)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 17, 9)) + + new (x: new (a: T) => T): T[]; +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 18, 9)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures5.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 18, 25)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 18, 33)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 18, 9)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 18, 9)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 18, 9)) + +}; +var a18: { +>a18 : Symbol(a18, Decl(assignmentCompatWithConstructSignatures5.ts, 20, 3)) + + new (x: { +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 21, 9)) + + new (a: T): T; +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 22, 13)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures5.ts, 2, 27)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 22, 32)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 22, 13)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 22, 13)) + + new (a: T): T; +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 23, 13)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures5.ts, 0, 0)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 23, 29)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 23, 13)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 23, 13)) + + }): any[]; + new (x: { +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 25, 9)) + + new (a: T): T; +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 26, 13)) +>Derived2 : Symbol(Derived2, Decl(assignmentCompatWithConstructSignatures5.ts, 3, 43)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 26, 33)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 26, 13)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 26, 13)) + + new (a: T): T; +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 27, 13)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures5.ts, 0, 0)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 27, 29)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 27, 13)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 27, 13)) + + }): any[]; +}; + +var b: new (x: T) => T[]; +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures5.ts, 31, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 31, 12)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 31, 15)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 31, 12)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 31, 12)) + +a = b; // ok +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 7, 3)) +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures5.ts, 31, 3)) + +b = a; // ok +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures5.ts, 31, 3)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 7, 3)) + +var b2: new (x: T) => string[]; +>b2 : Symbol(b2, Decl(assignmentCompatWithConstructSignatures5.ts, 34, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 34, 13)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 34, 16)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 34, 13)) + +a2 = b2; // ok +>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignatures5.ts, 8, 3)) +>b2 : Symbol(b2, Decl(assignmentCompatWithConstructSignatures5.ts, 34, 3)) + +b2 = a2; // ok +>b2 : Symbol(b2, Decl(assignmentCompatWithConstructSignatures5.ts, 34, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignatures5.ts, 8, 3)) + +var b3: new (x: T) => T; +>b3 : Symbol(b3, Decl(assignmentCompatWithConstructSignatures5.ts, 37, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 37, 13)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 37, 16)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 37, 13)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 37, 13)) + +a3 = b3; // ok +>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignatures5.ts, 9, 3)) +>b3 : Symbol(b3, Decl(assignmentCompatWithConstructSignatures5.ts, 37, 3)) + +b3 = a3; // ok +>b3 : Symbol(b3, Decl(assignmentCompatWithConstructSignatures5.ts, 37, 3)) +>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignatures5.ts, 9, 3)) + +var b4: new (x: T, y: U) => string; +>b4 : Symbol(b4, Decl(assignmentCompatWithConstructSignatures5.ts, 40, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 40, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 40, 15)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 40, 19)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 40, 13)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures5.ts, 40, 24)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 40, 15)) + +a4 = b4; // ok +>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignatures5.ts, 10, 3)) +>b4 : Symbol(b4, Decl(assignmentCompatWithConstructSignatures5.ts, 40, 3)) + +b4 = a4; // ok +>b4 : Symbol(b4, Decl(assignmentCompatWithConstructSignatures5.ts, 40, 3)) +>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignatures5.ts, 10, 3)) + +var b5: new (x: new (arg: T) => U) => T; +>b5 : Symbol(b5, Decl(assignmentCompatWithConstructSignatures5.ts, 43, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 43, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 43, 15)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 43, 19)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures5.ts, 43, 27)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 43, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 43, 15)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 43, 13)) + +a5 = b5; // ok +>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignatures5.ts, 11, 3)) +>b5 : Symbol(b5, Decl(assignmentCompatWithConstructSignatures5.ts, 43, 3)) + +b5 = a5; // ok +>b5 : Symbol(b5, Decl(assignmentCompatWithConstructSignatures5.ts, 43, 3)) +>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignatures5.ts, 11, 3)) + +var b6: new (x: new (arg: T) => U) => T; +>b6 : Symbol(b6, Decl(assignmentCompatWithConstructSignatures5.ts, 46, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 46, 13)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures5.ts, 0, 0)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 46, 28)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures5.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 46, 48)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures5.ts, 46, 56)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 46, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 46, 28)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 46, 13)) + +a6 = b6; // ok +>a6 : Symbol(a6, Decl(assignmentCompatWithConstructSignatures5.ts, 12, 3)) +>b6 : Symbol(b6, Decl(assignmentCompatWithConstructSignatures5.ts, 46, 3)) + +b6 = a6; // ok +>b6 : Symbol(b6, Decl(assignmentCompatWithConstructSignatures5.ts, 46, 3)) +>a6 : Symbol(a6, Decl(assignmentCompatWithConstructSignatures5.ts, 12, 3)) + +var b11: new (x: { foo: T }, y: { foo: U; bar: U }) => Base; +>b11 : Symbol(b11, Decl(assignmentCompatWithConstructSignatures5.ts, 49, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 49, 14)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 49, 16)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 49, 20)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures5.ts, 49, 24)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 49, 14)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures5.ts, 49, 34)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures5.ts, 49, 39)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 49, 16)) +>bar : Symbol(bar, Decl(assignmentCompatWithConstructSignatures5.ts, 49, 47)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 49, 16)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures5.ts, 0, 0)) + +a11 = b11; // ok +>a11 : Symbol(a11, Decl(assignmentCompatWithConstructSignatures5.ts, 13, 3)) +>b11 : Symbol(b11, Decl(assignmentCompatWithConstructSignatures5.ts, 49, 3)) + +b11 = a11; // ok +>b11 : Symbol(b11, Decl(assignmentCompatWithConstructSignatures5.ts, 49, 3)) +>a11 : Symbol(a11, Decl(assignmentCompatWithConstructSignatures5.ts, 13, 3)) + +var b15: new (x: { a: U; b: V; }) => U[]; +>b15 : Symbol(b15, Decl(assignmentCompatWithConstructSignatures5.ts, 52, 3)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 52, 14)) +>V : Symbol(V, Decl(assignmentCompatWithConstructSignatures5.ts, 52, 16)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 52, 20)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 52, 24)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 52, 14)) +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures5.ts, 52, 30)) +>V : Symbol(V, Decl(assignmentCompatWithConstructSignatures5.ts, 52, 16)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 52, 14)) + +a15 = b15; // ok +>a15 : Symbol(a15, Decl(assignmentCompatWithConstructSignatures5.ts, 14, 3)) +>b15 : Symbol(b15, Decl(assignmentCompatWithConstructSignatures5.ts, 52, 3)) + +b15 = a15; // ok +>b15 : Symbol(b15, Decl(assignmentCompatWithConstructSignatures5.ts, 52, 3)) +>a15 : Symbol(a15, Decl(assignmentCompatWithConstructSignatures5.ts, 14, 3)) + +var b16: new (x: { a: T; b: T }) => T[]; +>b16 : Symbol(b16, Decl(assignmentCompatWithConstructSignatures5.ts, 55, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 55, 14)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 55, 17)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 55, 21)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 55, 14)) +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures5.ts, 55, 27)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 55, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 55, 14)) + +a15 = b16; // ok +>a15 : Symbol(a15, Decl(assignmentCompatWithConstructSignatures5.ts, 14, 3)) +>b16 : Symbol(b16, Decl(assignmentCompatWithConstructSignatures5.ts, 55, 3)) + +b15 = a16; // ok +>b15 : Symbol(b15, Decl(assignmentCompatWithConstructSignatures5.ts, 52, 3)) +>a16 : Symbol(a16, Decl(assignmentCompatWithConstructSignatures5.ts, 15, 3)) + +var b17: new (x: new (a: T) => T) => T[]; +>b17 : Symbol(b17, Decl(assignmentCompatWithConstructSignatures5.ts, 58, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 58, 14)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 58, 17)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 58, 25)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 58, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 58, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 58, 14)) + +a17 = b17; // ok +>a17 : Symbol(a17, Decl(assignmentCompatWithConstructSignatures5.ts, 16, 3)) +>b17 : Symbol(b17, Decl(assignmentCompatWithConstructSignatures5.ts, 58, 3)) + +b17 = a17; // ok +>b17 : Symbol(b17, Decl(assignmentCompatWithConstructSignatures5.ts, 58, 3)) +>a17 : Symbol(a17, Decl(assignmentCompatWithConstructSignatures5.ts, 16, 3)) + +var b18: new (x: new (a: T) => T) => any[]; +>b18 : Symbol(b18, Decl(assignmentCompatWithConstructSignatures5.ts, 61, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 61, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 61, 22)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 61, 25)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 61, 22)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 61, 22)) + +a18 = b18; // ok +>a18 : Symbol(a18, Decl(assignmentCompatWithConstructSignatures5.ts, 20, 3)) +>b18 : Symbol(b18, Decl(assignmentCompatWithConstructSignatures5.ts, 61, 3)) + +b18 = a18; // ok +>b18 : Symbol(b18, Decl(assignmentCompatWithConstructSignatures5.ts, 61, 3)) +>a18 : Symbol(a18, Decl(assignmentCompatWithConstructSignatures5.ts, 20, 3)) + diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures6.symbols b/tests/baselines/reference/assignmentCompatWithConstructSignatures6.symbols new file mode 100644 index 00000000000..1850406bfa8 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures6.symbols @@ -0,0 +1,259 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures6.ts === +// checking assignment compatibility relations for function types. All valid. + +class Base { foo: string; } +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures6.ts, 0, 0)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures6.ts, 2, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures6.ts, 2, 27)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures6.ts, 0, 0)) +>bar : Symbol(bar, Decl(assignmentCompatWithConstructSignatures6.ts, 3, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(assignmentCompatWithConstructSignatures6.ts, 3, 43)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures6.ts, 2, 27)) +>baz : Symbol(baz, Decl(assignmentCompatWithConstructSignatures6.ts, 4, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(assignmentCompatWithConstructSignatures6.ts, 4, 47)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures6.ts, 0, 0)) +>bing : Symbol(bing, Decl(assignmentCompatWithConstructSignatures6.ts, 5, 33)) + +interface A { +>A : Symbol(A, Decl(assignmentCompatWithConstructSignatures6.ts, 5, 49)) + + a: new (x: T) => T[]; +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures6.ts, 7, 13)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 8, 12)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 8, 15)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 8, 12)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 8, 12)) + + a2: new (x: T) => string[]; +>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignatures6.ts, 8, 28)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 9, 13)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 9, 16)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 9, 13)) + + a3: new (x: T) => void; +>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignatures6.ts, 9, 34)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 10, 13)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 10, 16)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 10, 13)) + + a4: new (x: T, y: U) => string; +>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignatures6.ts, 10, 30)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 15)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 19)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 13)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 24)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 15)) + + a5: new (x: (arg: T) => U) => T; +>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 41)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 12, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 12, 15)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 12, 19)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures6.ts, 12, 23)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 12, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 12, 15)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 12, 13)) + + a6: new (x: (arg: T) => Derived) => T; +>a6 : Symbol(a6, Decl(assignmentCompatWithConstructSignatures6.ts, 12, 42)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 13)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures6.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 29)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 33)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 13)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures6.ts, 2, 27)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 13)) + + a11: new (x: { foo: T }, y: { foo: T; bar: T }) => Base; +>a11 : Symbol(a11, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 58)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 14)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 17)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 21)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 14)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 31)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 36)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 14)) +>bar : Symbol(bar, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 44)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 14)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures6.ts, 0, 0)) + + a15: new (x: { a: T; b: T }) => T[]; +>a15 : Symbol(a15, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 63)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 14)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 17)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 21)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 14)) +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 27)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 14)) + + a16: new (x: { a: T; b: T }) => T[]; +>a16 : Symbol(a16, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 43)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 16, 14)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures6.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 16, 30)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures6.ts, 16, 34)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 16, 14)) +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures6.ts, 16, 40)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 16, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 16, 14)) +} + +var x: A; +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>A : Symbol(A, Decl(assignmentCompatWithConstructSignatures6.ts, 5, 49)) + +var b: new (x: T) => T[]; +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures6.ts, 21, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 21, 12)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 21, 15)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 21, 12)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 21, 12)) + +x.a = b; +>x.a : Symbol(A.a, Decl(assignmentCompatWithConstructSignatures6.ts, 7, 13)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a : Symbol(A.a, Decl(assignmentCompatWithConstructSignatures6.ts, 7, 13)) +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures6.ts, 21, 3)) + +b = x.a; +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures6.ts, 21, 3)) +>x.a : Symbol(A.a, Decl(assignmentCompatWithConstructSignatures6.ts, 7, 13)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a : Symbol(A.a, Decl(assignmentCompatWithConstructSignatures6.ts, 7, 13)) + +var b2: new (x: T) => string[]; +>b2 : Symbol(b2, Decl(assignmentCompatWithConstructSignatures6.ts, 24, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 24, 13)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 24, 16)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 24, 13)) + +x.a2 = b2; +>x.a2 : Symbol(A.a2, Decl(assignmentCompatWithConstructSignatures6.ts, 8, 28)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a2 : Symbol(A.a2, Decl(assignmentCompatWithConstructSignatures6.ts, 8, 28)) +>b2 : Symbol(b2, Decl(assignmentCompatWithConstructSignatures6.ts, 24, 3)) + +b2 = x.a2; +>b2 : Symbol(b2, Decl(assignmentCompatWithConstructSignatures6.ts, 24, 3)) +>x.a2 : Symbol(A.a2, Decl(assignmentCompatWithConstructSignatures6.ts, 8, 28)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a2 : Symbol(A.a2, Decl(assignmentCompatWithConstructSignatures6.ts, 8, 28)) + +var b3: new (x: T) => T; +>b3 : Symbol(b3, Decl(assignmentCompatWithConstructSignatures6.ts, 27, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 27, 13)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 27, 16)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 27, 13)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 27, 13)) + +x.a3 = b3; +>x.a3 : Symbol(A.a3, Decl(assignmentCompatWithConstructSignatures6.ts, 9, 34)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a3 : Symbol(A.a3, Decl(assignmentCompatWithConstructSignatures6.ts, 9, 34)) +>b3 : Symbol(b3, Decl(assignmentCompatWithConstructSignatures6.ts, 27, 3)) + +b3 = x.a3; +>b3 : Symbol(b3, Decl(assignmentCompatWithConstructSignatures6.ts, 27, 3)) +>x.a3 : Symbol(A.a3, Decl(assignmentCompatWithConstructSignatures6.ts, 9, 34)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a3 : Symbol(A.a3, Decl(assignmentCompatWithConstructSignatures6.ts, 9, 34)) + +var b4: new (x: T, y: U) => string; +>b4 : Symbol(b4, Decl(assignmentCompatWithConstructSignatures6.ts, 30, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 30, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 30, 15)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 30, 19)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 30, 13)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures6.ts, 30, 24)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 30, 15)) + +x.a4 = b4; +>x.a4 : Symbol(A.a4, Decl(assignmentCompatWithConstructSignatures6.ts, 10, 30)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a4 : Symbol(A.a4, Decl(assignmentCompatWithConstructSignatures6.ts, 10, 30)) +>b4 : Symbol(b4, Decl(assignmentCompatWithConstructSignatures6.ts, 30, 3)) + +b4 = x.a4; +>b4 : Symbol(b4, Decl(assignmentCompatWithConstructSignatures6.ts, 30, 3)) +>x.a4 : Symbol(A.a4, Decl(assignmentCompatWithConstructSignatures6.ts, 10, 30)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a4 : Symbol(A.a4, Decl(assignmentCompatWithConstructSignatures6.ts, 10, 30)) + +var b5: new (x: (arg: T) => U) => T; +>b5 : Symbol(b5, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 15)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 19)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 23)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 15)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 13)) + +x.a5 = b5; +>x.a5 : Symbol(A.a5, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 41)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a5 : Symbol(A.a5, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 41)) +>b5 : Symbol(b5, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 3)) + +b5 = x.a5; +>b5 : Symbol(b5, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 3)) +>x.a5 : Symbol(A.a5, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 41)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a5 : Symbol(A.a5, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 41)) + +var b11: new (x: { foo: T }, y: { foo: U; bar: U }) => Base; +>b11 : Symbol(b11, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 14)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 16)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 20)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 24)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 14)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 34)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 39)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 16)) +>bar : Symbol(bar, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 47)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 16)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures6.ts, 0, 0)) + +x.a11 = b11; +>x.a11 : Symbol(A.a11, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 58)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a11 : Symbol(A.a11, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 58)) +>b11 : Symbol(b11, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 3)) + +b11 = x.a11; +>b11 : Symbol(b11, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 3)) +>x.a11 : Symbol(A.a11, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 58)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a11 : Symbol(A.a11, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 58)) + +var b16: new (x: { a: T; b: T }) => T[]; +>b16 : Symbol(b16, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 14)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 17)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 21)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 14)) +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 27)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 14)) + +x.a16 = b16; +>x.a16 : Symbol(A.a16, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 43)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a16 : Symbol(A.a16, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 43)) +>b16 : Symbol(b16, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 3)) + +b16 = x.a16; +>b16 : Symbol(b16, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 3)) +>x.a16 : Symbol(A.a16, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 43)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a16 : Symbol(A.a16, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 43)) + diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures.symbols b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures.symbols new file mode 100644 index 00000000000..727e7ed911a --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures.symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignatures.ts === +// some complex cases of assignment compat of generic signatures that stress contextual signature instantiation + +var f: (x: S) => void +>f : Symbol(f, Decl(assignmentCompatWithGenericCallSignatures.ts, 2, 3)) +>S : Symbol(S, Decl(assignmentCompatWithGenericCallSignatures.ts, 2, 8)) +>p : Symbol(p, Decl(assignmentCompatWithGenericCallSignatures.ts, 2, 19)) +>x : Symbol(x, Decl(assignmentCompatWithGenericCallSignatures.ts, 2, 35)) +>S : Symbol(S, Decl(assignmentCompatWithGenericCallSignatures.ts, 2, 8)) + +var g: (x: T[]) => void +>g : Symbol(g, Decl(assignmentCompatWithGenericCallSignatures.ts, 3, 3)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures.ts, 3, 8)) +>p : Symbol(p, Decl(assignmentCompatWithGenericCallSignatures.ts, 3, 19)) +>x : Symbol(x, Decl(assignmentCompatWithGenericCallSignatures.ts, 3, 33)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures.ts, 3, 8)) + +f = g; // ok +>f : Symbol(f, Decl(assignmentCompatWithGenericCallSignatures.ts, 2, 3)) +>g : Symbol(g, Decl(assignmentCompatWithGenericCallSignatures.ts, 3, 3)) + +g = f; // ok +>g : Symbol(g, Decl(assignmentCompatWithGenericCallSignatures.ts, 3, 3)) +>f : Symbol(f, Decl(assignmentCompatWithGenericCallSignatures.ts, 2, 3)) + diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures2.symbols b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures2.symbols new file mode 100644 index 00000000000..73991a789a2 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures2.symbols @@ -0,0 +1,42 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignatures2.ts === +// some complex cases of assignment compat of generic signatures. No contextual signature instantiation + +interface A { +>A : Symbol(A, Decl(assignmentCompatWithGenericCallSignatures2.ts, 0, 0)) + + (x: T, ...y: T[][]): void +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures2.ts, 3, 5)) +>x : Symbol(x, Decl(assignmentCompatWithGenericCallSignatures2.ts, 3, 8)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures2.ts, 3, 5)) +>y : Symbol(y, Decl(assignmentCompatWithGenericCallSignatures2.ts, 3, 13)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures2.ts, 3, 5)) +} + +interface B { +>B : Symbol(B, Decl(assignmentCompatWithGenericCallSignatures2.ts, 4, 1)) + + (x: S, ...y: S[]): void +>S : Symbol(S, Decl(assignmentCompatWithGenericCallSignatures2.ts, 7, 5)) +>x : Symbol(x, Decl(assignmentCompatWithGenericCallSignatures2.ts, 7, 8)) +>S : Symbol(S, Decl(assignmentCompatWithGenericCallSignatures2.ts, 7, 5)) +>y : Symbol(y, Decl(assignmentCompatWithGenericCallSignatures2.ts, 7, 13)) +>S : Symbol(S, Decl(assignmentCompatWithGenericCallSignatures2.ts, 7, 5)) +} + +var a: A; +>a : Symbol(a, Decl(assignmentCompatWithGenericCallSignatures2.ts, 10, 3)) +>A : Symbol(A, Decl(assignmentCompatWithGenericCallSignatures2.ts, 0, 0)) + +var b: B; +>b : Symbol(b, Decl(assignmentCompatWithGenericCallSignatures2.ts, 11, 3)) +>B : Symbol(B, Decl(assignmentCompatWithGenericCallSignatures2.ts, 4, 1)) + +// Both ok +a = b; +>a : Symbol(a, Decl(assignmentCompatWithGenericCallSignatures2.ts, 10, 3)) +>b : Symbol(b, Decl(assignmentCompatWithGenericCallSignatures2.ts, 11, 3)) + +b = a; +>b : Symbol(b, Decl(assignmentCompatWithGenericCallSignatures2.ts, 11, 3)) +>a : Symbol(a, Decl(assignmentCompatWithGenericCallSignatures2.ts, 10, 3)) + diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures3.symbols b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures3.symbols new file mode 100644 index 00000000000..42a00f83df3 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures3.symbols @@ -0,0 +1,52 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignatures3.ts === +// some complex cases of assignment compat of generic signatures that stress contextual signature instantiation + +interface I { +>I : Symbol(I, Decl(assignmentCompatWithGenericCallSignatures3.ts, 0, 0)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures3.ts, 2, 12)) +>S : Symbol(S, Decl(assignmentCompatWithGenericCallSignatures3.ts, 2, 14)) + + (f: (x: T) => (y: S) => U): U +>U : Symbol(U, Decl(assignmentCompatWithGenericCallSignatures3.ts, 3, 5)) +>f : Symbol(f, Decl(assignmentCompatWithGenericCallSignatures3.ts, 3, 8)) +>x : Symbol(x, Decl(assignmentCompatWithGenericCallSignatures3.ts, 3, 12)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures3.ts, 2, 12)) +>y : Symbol(y, Decl(assignmentCompatWithGenericCallSignatures3.ts, 3, 22)) +>S : Symbol(S, Decl(assignmentCompatWithGenericCallSignatures3.ts, 2, 14)) +>U : Symbol(U, Decl(assignmentCompatWithGenericCallSignatures3.ts, 3, 5)) +>U : Symbol(U, Decl(assignmentCompatWithGenericCallSignatures3.ts, 3, 5)) +} + +var g: (x: T) => (y: S) => I +>g : Symbol(g, Decl(assignmentCompatWithGenericCallSignatures3.ts, 6, 3)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures3.ts, 6, 8)) +>x : Symbol(x, Decl(assignmentCompatWithGenericCallSignatures3.ts, 6, 11)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures3.ts, 6, 8)) +>S : Symbol(S, Decl(assignmentCompatWithGenericCallSignatures3.ts, 6, 21)) +>y : Symbol(y, Decl(assignmentCompatWithGenericCallSignatures3.ts, 6, 24)) +>S : Symbol(S, Decl(assignmentCompatWithGenericCallSignatures3.ts, 6, 21)) +>I : Symbol(I, Decl(assignmentCompatWithGenericCallSignatures3.ts, 0, 0)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures3.ts, 6, 8)) +>S : Symbol(S, Decl(assignmentCompatWithGenericCallSignatures3.ts, 6, 21)) + +var h: (x: T) => (y: S) => { (f: (x: T) => (y: S) => U): U } +>h : Symbol(h, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 3)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 8)) +>x : Symbol(x, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 11)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 8)) +>S : Symbol(S, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 21)) +>y : Symbol(y, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 24)) +>S : Symbol(S, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 21)) +>U : Symbol(U, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 36)) +>f : Symbol(f, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 39)) +>x : Symbol(x, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 43)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 8)) +>y : Symbol(y, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 53)) +>S : Symbol(S, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 21)) +>U : Symbol(U, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 36)) +>U : Symbol(U, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 36)) + +g = h // ok +>g : Symbol(g, Decl(assignmentCompatWithGenericCallSignatures3.ts, 6, 3)) +>h : Symbol(h, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 3)) + diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers.symbols b/tests/baselines/reference/assignmentCompatWithObjectMembers.symbols new file mode 100644 index 00000000000..181c4db641a --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers.symbols @@ -0,0 +1,268 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers.ts === +// members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M +// no errors expected + +module SimpleTypes { +>SimpleTypes : Symbol(SimpleTypes, Decl(assignmentCompatWithObjectMembers.ts, 0, 0)) + + class S { foo: string; } +>S : Symbol(S, Decl(assignmentCompatWithObjectMembers.ts, 3, 20)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 4, 13)) + + class T { foo: string; } +>T : Symbol(T, Decl(assignmentCompatWithObjectMembers.ts, 4, 28)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 5, 13)) + + var s: S; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 6, 7)) +>S : Symbol(S, Decl(assignmentCompatWithObjectMembers.ts, 3, 20)) + + var t: T; +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 7, 7)) +>T : Symbol(T, Decl(assignmentCompatWithObjectMembers.ts, 4, 28)) + + interface S2 { foo: string; } +>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers.ts, 7, 13)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 9, 18)) + + interface T2 { foo: string; } +>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers.ts, 9, 33)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 10, 18)) + + var s2: S2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 11, 7)) +>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers.ts, 7, 13)) + + var t2: T2; +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers.ts, 12, 7)) +>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers.ts, 9, 33)) + + var a: { foo: string; } +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 14, 7)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 14, 12)) + + var b: { foo: string; } +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 15, 7)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 15, 12)) + + var a2 = { foo: '' }; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 17, 7)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 17, 14)) + + var b2 = { foo: '' }; +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers.ts, 18, 7)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 18, 14)) + + s = t; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 6, 7)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 7, 7)) + + t = s; +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 7, 7)) +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 6, 7)) + + s = s2; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 6, 7)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 11, 7)) + + s = a2; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 6, 7)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 17, 7)) + + s2 = t2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 11, 7)) +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers.ts, 12, 7)) + + t2 = s2; +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers.ts, 12, 7)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 11, 7)) + + s2 = t; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 11, 7)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 7, 7)) + + s2 = b; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 11, 7)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 15, 7)) + + s2 = a2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 11, 7)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 17, 7)) + + a = b; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 14, 7)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 15, 7)) + + b = a; +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 15, 7)) +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 14, 7)) + + a = s; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 14, 7)) +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 6, 7)) + + a = s2; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 14, 7)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 11, 7)) + + a = a2; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 14, 7)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 17, 7)) + + a2 = b2; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 17, 7)) +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers.ts, 18, 7)) + + b2 = a2; +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers.ts, 18, 7)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 17, 7)) + + a2 = b; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 17, 7)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 15, 7)) + + a2 = t2; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 17, 7)) +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers.ts, 12, 7)) + + a2 = t; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 17, 7)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 7, 7)) +} + +module ObjectTypes { +>ObjectTypes : Symbol(ObjectTypes, Decl(assignmentCompatWithObjectMembers.ts, 42, 1)) + + class S { foo: S; } +>S : Symbol(S, Decl(assignmentCompatWithObjectMembers.ts, 44, 20)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 45, 13)) +>S : Symbol(S, Decl(assignmentCompatWithObjectMembers.ts, 44, 20)) + + class T { foo: T; } +>T : Symbol(T, Decl(assignmentCompatWithObjectMembers.ts, 45, 23)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 46, 13)) +>T : Symbol(T, Decl(assignmentCompatWithObjectMembers.ts, 45, 23)) + + var s: S; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 47, 7)) +>S : Symbol(S, Decl(assignmentCompatWithObjectMembers.ts, 44, 20)) + + var t: T; +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 48, 7)) +>T : Symbol(T, Decl(assignmentCompatWithObjectMembers.ts, 45, 23)) + + interface S2 { foo: S2; } +>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers.ts, 48, 13)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 50, 18)) +>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers.ts, 48, 13)) + + interface T2 { foo: T2; } +>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers.ts, 50, 29)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 51, 18)) +>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers.ts, 50, 29)) + + var s2: S2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 52, 7)) +>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers.ts, 48, 13)) + + var t2: T2; +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers.ts, 53, 7)) +>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers.ts, 50, 29)) + + var a: { foo: typeof a; } +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 55, 7)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 55, 12)) +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 55, 7)) + + var b: { foo: typeof b; } +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 56, 7)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 56, 12)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 56, 7)) + + var a2 = { foo: a2 }; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 58, 14)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7)) + + var b2 = { foo: b2 }; +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers.ts, 59, 7)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 59, 14)) +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers.ts, 59, 7)) + + s = t; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 47, 7)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 48, 7)) + + t = s; +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 48, 7)) +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 47, 7)) + + s = s2; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 47, 7)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 52, 7)) + + s = a2; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 47, 7)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7)) + + s2 = t2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 52, 7)) +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers.ts, 53, 7)) + + t2 = s2; +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers.ts, 53, 7)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 52, 7)) + + s2 = t; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 52, 7)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 48, 7)) + + s2 = b; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 52, 7)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 56, 7)) + + s2 = a2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 52, 7)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7)) + + a = b; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 55, 7)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 56, 7)) + + b = a; +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 56, 7)) +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 55, 7)) + + a = s; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 55, 7)) +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 47, 7)) + + a = s2; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 55, 7)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 52, 7)) + + a = a2; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 55, 7)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7)) + + a2 = b2; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7)) +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers.ts, 59, 7)) + + b2 = a2; +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers.ts, 59, 7)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7)) + + a2 = b; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 56, 7)) + + a2 = t2; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7)) +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers.ts, 53, 7)) + + a2 = t; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 48, 7)) + +} diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers.types b/tests/baselines/reference/assignmentCompatWithObjectMembers.types index 940b1d7071d..f56b0b1dc74 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers.types @@ -49,11 +49,13 @@ module SimpleTypes { >a2 : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string +>'' : string var b2 = { foo: '' }; >b2 : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string +>'' : string s = t; >s = t : T diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers2.symbols b/tests/baselines/reference/assignmentCompatWithObjectMembers2.symbols new file mode 100644 index 00000000000..ab3301c5e93 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers2.symbols @@ -0,0 +1,132 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers2.ts === +// members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M +// additional optional properties do not cause errors + +class S { foo: string; } +>S : Symbol(S, Decl(assignmentCompatWithObjectMembers2.ts, 0, 0)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers2.ts, 3, 9)) + +class T { foo: string; } +>T : Symbol(T, Decl(assignmentCompatWithObjectMembers2.ts, 3, 24)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers2.ts, 4, 9)) + +var s: S; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers2.ts, 5, 3)) +>S : Symbol(S, Decl(assignmentCompatWithObjectMembers2.ts, 0, 0)) + +var t: T; +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers2.ts, 6, 3)) +>T : Symbol(T, Decl(assignmentCompatWithObjectMembers2.ts, 3, 24)) + +interface S2 { foo: string; bar?: string } +>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers2.ts, 6, 9)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers2.ts, 8, 14)) +>bar : Symbol(bar, Decl(assignmentCompatWithObjectMembers2.ts, 8, 27)) + +interface T2 { foo: string; baz?: string } +>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers2.ts, 8, 42)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers2.ts, 9, 14)) +>baz : Symbol(baz, Decl(assignmentCompatWithObjectMembers2.ts, 9, 27)) + +var s2: S2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers2.ts, 10, 3)) +>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers2.ts, 6, 9)) + +var t2: T2; +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers2.ts, 11, 3)) +>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers2.ts, 8, 42)) + +var a: { foo: string; bar?: string } +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers2.ts, 13, 3)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers2.ts, 13, 8)) +>bar : Symbol(bar, Decl(assignmentCompatWithObjectMembers2.ts, 13, 21)) + +var b: { foo: string; baz?: string } +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers2.ts, 14, 3)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers2.ts, 14, 8)) +>baz : Symbol(baz, Decl(assignmentCompatWithObjectMembers2.ts, 14, 21)) + +var a2 = { foo: '' }; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers2.ts, 16, 3)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers2.ts, 16, 10)) + +var b2 = { foo: '' }; +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers2.ts, 17, 3)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers2.ts, 17, 10)) + +s = t; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers2.ts, 5, 3)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers2.ts, 6, 3)) + +t = s; +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers2.ts, 6, 3)) +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers2.ts, 5, 3)) + +s = s2; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers2.ts, 5, 3)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers2.ts, 10, 3)) + +s = a2; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers2.ts, 5, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers2.ts, 16, 3)) + +s2 = t2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers2.ts, 10, 3)) +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers2.ts, 11, 3)) + +t2 = s2; +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers2.ts, 11, 3)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers2.ts, 10, 3)) + +s2 = t; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers2.ts, 10, 3)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers2.ts, 6, 3)) + +s2 = b; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers2.ts, 10, 3)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers2.ts, 14, 3)) + +s2 = a2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers2.ts, 10, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers2.ts, 16, 3)) + +a = b; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers2.ts, 13, 3)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers2.ts, 14, 3)) + +b = a; +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers2.ts, 14, 3)) +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers2.ts, 13, 3)) + +a = s; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers2.ts, 13, 3)) +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers2.ts, 5, 3)) + +a = s2; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers2.ts, 13, 3)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers2.ts, 10, 3)) + +a = a2; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers2.ts, 13, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers2.ts, 16, 3)) + +a2 = b2; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers2.ts, 16, 3)) +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers2.ts, 17, 3)) + +b2 = a2; +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers2.ts, 17, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers2.ts, 16, 3)) + +a2 = b; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers2.ts, 16, 3)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers2.ts, 14, 3)) + +a2 = t2; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers2.ts, 16, 3)) +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers2.ts, 11, 3)) + +a2 = t; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers2.ts, 16, 3)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers2.ts, 6, 3)) + diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers2.types b/tests/baselines/reference/assignmentCompatWithObjectMembers2.types index 962b29732a5..560644f860e 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers2.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers2.types @@ -50,11 +50,13 @@ var a2 = { foo: '' }; >a2 : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string +>'' : string var b2 = { foo: '' }; >b2 : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string +>'' : string s = t; >s = t : T diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers3.symbols b/tests/baselines/reference/assignmentCompatWithObjectMembers3.symbols new file mode 100644 index 00000000000..861d38530bb --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers3.symbols @@ -0,0 +1,136 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers3.ts === +// members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M +// additional optional properties do not cause errors + +class S implements S2 { foo: string; } +>S : Symbol(S, Decl(assignmentCompatWithObjectMembers3.ts, 0, 0)) +>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers3.ts, 6, 9)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers3.ts, 3, 23)) + +class T implements T2 { foo: string; } +>T : Symbol(T, Decl(assignmentCompatWithObjectMembers3.ts, 3, 38)) +>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers3.ts, 8, 42)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers3.ts, 4, 23)) + +var s: S; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers3.ts, 5, 3)) +>S : Symbol(S, Decl(assignmentCompatWithObjectMembers3.ts, 0, 0)) + +var t: T; +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers3.ts, 6, 3)) +>T : Symbol(T, Decl(assignmentCompatWithObjectMembers3.ts, 3, 38)) + +interface S2 { foo: string; bar?: string } +>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers3.ts, 6, 9)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers3.ts, 8, 14)) +>bar : Symbol(bar, Decl(assignmentCompatWithObjectMembers3.ts, 8, 27)) + +interface T2 { foo: string; baz?: string } +>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers3.ts, 8, 42)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers3.ts, 9, 14)) +>baz : Symbol(baz, Decl(assignmentCompatWithObjectMembers3.ts, 9, 27)) + +var s2: S2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers3.ts, 10, 3)) +>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers3.ts, 6, 9)) + +var t2: T2; +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers3.ts, 11, 3)) +>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers3.ts, 8, 42)) + +var a: { foo: string; bar?: string } +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers3.ts, 13, 3)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers3.ts, 13, 8)) +>bar : Symbol(bar, Decl(assignmentCompatWithObjectMembers3.ts, 13, 21)) + +var b: { foo: string; baz?: string } +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers3.ts, 14, 3)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers3.ts, 14, 8)) +>baz : Symbol(baz, Decl(assignmentCompatWithObjectMembers3.ts, 14, 21)) + +var a2: S2 = { foo: '' }; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers3.ts, 16, 3)) +>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers3.ts, 6, 9)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers3.ts, 16, 14)) + +var b2: T2 = { foo: '' }; +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers3.ts, 17, 3)) +>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers3.ts, 8, 42)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers3.ts, 17, 14)) + +s = t; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers3.ts, 5, 3)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers3.ts, 6, 3)) + +t = s; +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers3.ts, 6, 3)) +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers3.ts, 5, 3)) + +s = s2; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers3.ts, 5, 3)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers3.ts, 10, 3)) + +s = a2; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers3.ts, 5, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers3.ts, 16, 3)) + +s2 = t2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers3.ts, 10, 3)) +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers3.ts, 11, 3)) + +t2 = s2; +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers3.ts, 11, 3)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers3.ts, 10, 3)) + +s2 = t; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers3.ts, 10, 3)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers3.ts, 6, 3)) + +s2 = b; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers3.ts, 10, 3)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers3.ts, 14, 3)) + +s2 = a2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers3.ts, 10, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers3.ts, 16, 3)) + +a = b; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers3.ts, 13, 3)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers3.ts, 14, 3)) + +b = a; +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers3.ts, 14, 3)) +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers3.ts, 13, 3)) + +a = s; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers3.ts, 13, 3)) +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers3.ts, 5, 3)) + +a = s2; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers3.ts, 13, 3)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers3.ts, 10, 3)) + +a = a2; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers3.ts, 13, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers3.ts, 16, 3)) + +a2 = b2; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers3.ts, 16, 3)) +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers3.ts, 17, 3)) + +b2 = a2; +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers3.ts, 17, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers3.ts, 16, 3)) + +a2 = b; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers3.ts, 16, 3)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers3.ts, 14, 3)) + +a2 = t2; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers3.ts, 16, 3)) +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers3.ts, 11, 3)) + +a2 = t; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers3.ts, 16, 3)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers3.ts, 6, 3)) + diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers3.types b/tests/baselines/reference/assignmentCompatWithObjectMembers3.types index 85a7e59ffbc..3046c2f609d 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers3.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers3.types @@ -53,12 +53,14 @@ var a2: S2 = { foo: '' }; >S2 : S2 >{ foo: '' } : { foo: string; } >foo : string +>'' : string var b2: T2 = { foo: '' }; >b2 : T2 >T2 : T2 >{ foo: '' } : { foo: string; } >foo : string +>'' : string s = t; >s = t : T diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.symbols b/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.symbols new file mode 100644 index 00000000000..e01bcee21c0 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.symbols @@ -0,0 +1,124 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersNumericNames.ts === +// members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M +// numeric named properties work correctly, no errors expected + +class S { 1: string; } +>S : Symbol(S, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 0, 0)) + +class T { 1.: string; } +>T : Symbol(T, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 3, 22)) + +var s: S; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 5, 3)) +>S : Symbol(S, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 0, 0)) + +var t: T; +>t : Symbol(t, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 6, 3)) +>T : Symbol(T, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 3, 22)) + +interface S2 { 1: string; bar?: string } +>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 6, 9)) +>bar : Symbol(bar, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 8, 25)) + +interface T2 { 1.0: string; baz?: string } +>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 8, 40)) +>baz : Symbol(baz, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 9, 27)) + +var s2: S2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 10, 3)) +>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 6, 9)) + +var t2: T2; +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 11, 3)) +>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 8, 40)) + +var a: { 1.: string; bar?: string } +>a : Symbol(a, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 13, 3)) +>bar : Symbol(bar, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 13, 20)) + +var b: { 1.0: string; baz?: string } +>b : Symbol(b, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 14, 3)) +>baz : Symbol(baz, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 14, 21)) + +var a2 = { 1.0: '' }; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 16, 3)) + +var b2 = { 1: '' }; +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 17, 3)) + +s = t; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 5, 3)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 6, 3)) + +t = s; +>t : Symbol(t, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 6, 3)) +>s : Symbol(s, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 5, 3)) + +s = s2; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 5, 3)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 10, 3)) + +s = a2; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 5, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 16, 3)) + +s2 = t2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 10, 3)) +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 11, 3)) + +t2 = s2; +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 11, 3)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 10, 3)) + +s2 = t; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 10, 3)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 6, 3)) + +s2 = b; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 10, 3)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 14, 3)) + +s2 = a2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 10, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 16, 3)) + +a = b; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 13, 3)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 14, 3)) + +b = a; +>b : Symbol(b, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 14, 3)) +>a : Symbol(a, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 13, 3)) + +a = s; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 13, 3)) +>s : Symbol(s, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 5, 3)) + +a = s2; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 13, 3)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 10, 3)) + +a = a2; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 13, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 16, 3)) + +a2 = b2; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 16, 3)) +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 17, 3)) + +b2 = a2; +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 17, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 16, 3)) + +a2 = b; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 16, 3)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 14, 3)) + +a2 = t2; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 16, 3)) +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 11, 3)) + +a2 = t; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 16, 3)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 6, 3)) + diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.types b/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.types index 4c76ce1e88a..440ef006e0a 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.types @@ -43,10 +43,12 @@ var b: { 1.0: string; baz?: string } var a2 = { 1.0: '' }; >a2 : { 1.0: string; } >{ 1.0: '' } : { 1.0: string; } +>'' : string var b2 = { 1: '' }; >b2 : { 1: string; } >{ 1: '' } : { 1: string; } +>'' : string s = t; >s = t : T diff --git a/tests/baselines/reference/assignmentCompatWithWithGenericConstructSignatures.symbols b/tests/baselines/reference/assignmentCompatWithWithGenericConstructSignatures.symbols new file mode 100644 index 00000000000..e6db879f441 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithWithGenericConstructSignatures.symbols @@ -0,0 +1,3 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithWithGenericConstructSignatures.ts === + +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability1.symbols b/tests/baselines/reference/assignmentCompatability1.symbols new file mode 100644 index 00000000000..07d3cf4c029 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability1.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/assignmentCompatability1.ts === +module __test1__ { +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability1.ts, 0, 0)) + + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability1.ts, 0, 18)) +>T : Symbol(T, Decl(assignmentCompatability1.ts, 1, 52)) +>U : Symbol(U, Decl(assignmentCompatability1.ts, 1, 54)) +>one : Symbol(one, Decl(assignmentCompatability1.ts, 1, 58)) +>T : Symbol(T, Decl(assignmentCompatability1.ts, 1, 52)) +>two : Symbol(two, Decl(assignmentCompatability1.ts, 1, 66)) +>U : Symbol(U, Decl(assignmentCompatability1.ts, 1, 54)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability1.ts, 1, 83)) +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability1.ts, 0, 18)) +>one : Symbol(one, Decl(assignmentCompatability1.ts, 1, 139)) + + export var __val__obj4 = obj4; +>__val__obj4 : Symbol(__val__obj4, Decl(assignmentCompatability1.ts, 2, 14)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability1.ts, 1, 83)) +} +module __test2__ { +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability1.ts, 3, 1)) + + export var aa = {};; +>aa : Symbol(aa, Decl(assignmentCompatability1.ts, 5, 14)) + + export var __val__aa = aa; +>__val__aa : Symbol(__val__aa, Decl(assignmentCompatability1.ts, 6, 14)) +>aa : Symbol(aa, Decl(assignmentCompatability1.ts, 5, 14)) +} +__test2__.__val__aa = __test1__.__val__obj4 +>__test2__.__val__aa : Symbol(__test2__.__val__aa, Decl(assignmentCompatability1.ts, 6, 14)) +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability1.ts, 3, 1)) +>__val__aa : Symbol(__test2__.__val__aa, Decl(assignmentCompatability1.ts, 6, 14)) +>__test1__.__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability1.ts, 2, 14)) +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability1.ts, 0, 0)) +>__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability1.ts, 2, 14)) + diff --git a/tests/baselines/reference/assignmentCompatability1.types b/tests/baselines/reference/assignmentCompatability1.types index 9949fc14bf5..66174a4036e 100644 --- a/tests/baselines/reference/assignmentCompatability1.types +++ b/tests/baselines/reference/assignmentCompatability1.types @@ -14,6 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number +>1 : number export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability2.symbols b/tests/baselines/reference/assignmentCompatability2.symbols new file mode 100644 index 00000000000..1ed6dd3c639 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability2.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/assignmentCompatability2.ts === +module __test1__ { +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability2.ts, 0, 0)) + + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability2.ts, 0, 18)) +>T : Symbol(T, Decl(assignmentCompatability2.ts, 1, 52)) +>U : Symbol(U, Decl(assignmentCompatability2.ts, 1, 54)) +>one : Symbol(one, Decl(assignmentCompatability2.ts, 1, 58)) +>T : Symbol(T, Decl(assignmentCompatability2.ts, 1, 52)) +>two : Symbol(two, Decl(assignmentCompatability2.ts, 1, 66)) +>U : Symbol(U, Decl(assignmentCompatability2.ts, 1, 54)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability2.ts, 1, 83)) +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability2.ts, 0, 18)) +>one : Symbol(one, Decl(assignmentCompatability2.ts, 1, 139)) + + export var __val__obj4 = obj4; +>__val__obj4 : Symbol(__val__obj4, Decl(assignmentCompatability2.ts, 2, 14)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability2.ts, 1, 83)) +} +module __test2__ { +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability2.ts, 3, 1)) + + export var aa:{};; +>aa : Symbol(aa, Decl(assignmentCompatability2.ts, 5, 14)) + + export var __val__aa = aa; +>__val__aa : Symbol(__val__aa, Decl(assignmentCompatability2.ts, 6, 14)) +>aa : Symbol(aa, Decl(assignmentCompatability2.ts, 5, 14)) +} +__test2__.__val__aa = __test1__.__val__obj4 +>__test2__.__val__aa : Symbol(__test2__.__val__aa, Decl(assignmentCompatability2.ts, 6, 14)) +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability2.ts, 3, 1)) +>__val__aa : Symbol(__test2__.__val__aa, Decl(assignmentCompatability2.ts, 6, 14)) +>__test1__.__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability2.ts, 2, 14)) +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability2.ts, 0, 0)) +>__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability2.ts, 2, 14)) + diff --git a/tests/baselines/reference/assignmentCompatability2.types b/tests/baselines/reference/assignmentCompatability2.types index 16da45c7e35..f46a81cf51f 100644 --- a/tests/baselines/reference/assignmentCompatability2.types +++ b/tests/baselines/reference/assignmentCompatability2.types @@ -14,6 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number +>1 : number export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability3.symbols b/tests/baselines/reference/assignmentCompatability3.symbols new file mode 100644 index 00000000000..c31d69e2f12 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability3.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/assignmentCompatability3.ts === +module __test1__ { +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability3.ts, 0, 0)) + + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability3.ts, 0, 18)) +>T : Symbol(T, Decl(assignmentCompatability3.ts, 1, 52)) +>U : Symbol(U, Decl(assignmentCompatability3.ts, 1, 54)) +>one : Symbol(one, Decl(assignmentCompatability3.ts, 1, 58)) +>T : Symbol(T, Decl(assignmentCompatability3.ts, 1, 52)) +>two : Symbol(two, Decl(assignmentCompatability3.ts, 1, 66)) +>U : Symbol(U, Decl(assignmentCompatability3.ts, 1, 54)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability3.ts, 1, 83)) +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability3.ts, 0, 18)) +>one : Symbol(one, Decl(assignmentCompatability3.ts, 1, 139)) + + export var __val__obj4 = obj4; +>__val__obj4 : Symbol(__val__obj4, Decl(assignmentCompatability3.ts, 2, 14)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability3.ts, 1, 83)) +} +module __test2__ { +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability3.ts, 3, 1)) + + export var obj = {one: 1}; +>obj : Symbol(obj, Decl(assignmentCompatability3.ts, 5, 14)) +>one : Symbol(one, Decl(assignmentCompatability3.ts, 5, 22)) + + export var __val__obj = obj; +>__val__obj : Symbol(__val__obj, Decl(assignmentCompatability3.ts, 6, 14)) +>obj : Symbol(obj, Decl(assignmentCompatability3.ts, 5, 14)) +} +__test2__.__val__obj = __test1__.__val__obj4 +>__test2__.__val__obj : Symbol(__test2__.__val__obj, Decl(assignmentCompatability3.ts, 6, 14)) +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability3.ts, 3, 1)) +>__val__obj : Symbol(__test2__.__val__obj, Decl(assignmentCompatability3.ts, 6, 14)) +>__test1__.__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability3.ts, 2, 14)) +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability3.ts, 0, 0)) +>__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability3.ts, 2, 14)) + diff --git a/tests/baselines/reference/assignmentCompatability3.types b/tests/baselines/reference/assignmentCompatability3.types index 61279b9c7fa..67e553235ed 100644 --- a/tests/baselines/reference/assignmentCompatability3.types +++ b/tests/baselines/reference/assignmentCompatability3.types @@ -14,6 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number +>1 : number export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional @@ -26,6 +27,7 @@ module __test2__ { >obj : { one: number; } >{one: 1} : { one: number; } >one : number +>1 : number export var __val__obj = obj; >__val__obj : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability4.symbols b/tests/baselines/reference/assignmentCompatability4.symbols new file mode 100644 index 00000000000..fe5e4a32dee --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability4.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/assignmentCompatability4.ts === +module __test1__ { +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability4.ts, 0, 0)) + + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability4.ts, 0, 18)) +>T : Symbol(T, Decl(assignmentCompatability4.ts, 1, 52)) +>U : Symbol(U, Decl(assignmentCompatability4.ts, 1, 54)) +>one : Symbol(one, Decl(assignmentCompatability4.ts, 1, 58)) +>T : Symbol(T, Decl(assignmentCompatability4.ts, 1, 52)) +>two : Symbol(two, Decl(assignmentCompatability4.ts, 1, 66)) +>U : Symbol(U, Decl(assignmentCompatability4.ts, 1, 54)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability4.ts, 1, 83)) +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability4.ts, 0, 18)) +>one : Symbol(one, Decl(assignmentCompatability4.ts, 1, 139)) + + export var __val__obj4 = obj4; +>__val__obj4 : Symbol(__val__obj4, Decl(assignmentCompatability4.ts, 2, 14)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability4.ts, 1, 83)) +} +module __test2__ { +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability4.ts, 3, 1)) + + export var aa:{one:number;};; +>aa : Symbol(aa, Decl(assignmentCompatability4.ts, 5, 14)) +>one : Symbol(one, Decl(assignmentCompatability4.ts, 5, 19)) + + export var __val__aa = aa; +>__val__aa : Symbol(__val__aa, Decl(assignmentCompatability4.ts, 6, 14)) +>aa : Symbol(aa, Decl(assignmentCompatability4.ts, 5, 14)) +} +__test2__.__val__aa = __test1__.__val__obj4 +>__test2__.__val__aa : Symbol(__test2__.__val__aa, Decl(assignmentCompatability4.ts, 6, 14)) +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability4.ts, 3, 1)) +>__val__aa : Symbol(__test2__.__val__aa, Decl(assignmentCompatability4.ts, 6, 14)) +>__test1__.__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability4.ts, 2, 14)) +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability4.ts, 0, 0)) +>__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability4.ts, 2, 14)) + diff --git a/tests/baselines/reference/assignmentCompatability4.types b/tests/baselines/reference/assignmentCompatability4.types index f7e5801e9b3..0cafbaa4dd7 100644 --- a/tests/baselines/reference/assignmentCompatability4.types +++ b/tests/baselines/reference/assignmentCompatability4.types @@ -14,6 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number +>1 : number export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability5.symbols b/tests/baselines/reference/assignmentCompatability5.symbols new file mode 100644 index 00000000000..15885d07892 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability5.symbols @@ -0,0 +1,44 @@ +=== tests/cases/compiler/assignmentCompatability5.ts === +module __test1__ { +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability5.ts, 0, 0)) + + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability5.ts, 0, 18)) +>T : Symbol(T, Decl(assignmentCompatability5.ts, 1, 52)) +>U : Symbol(U, Decl(assignmentCompatability5.ts, 1, 54)) +>one : Symbol(one, Decl(assignmentCompatability5.ts, 1, 58)) +>T : Symbol(T, Decl(assignmentCompatability5.ts, 1, 52)) +>two : Symbol(two, Decl(assignmentCompatability5.ts, 1, 66)) +>U : Symbol(U, Decl(assignmentCompatability5.ts, 1, 54)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability5.ts, 1, 83)) +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability5.ts, 0, 18)) +>one : Symbol(one, Decl(assignmentCompatability5.ts, 1, 139)) + + export var __val__obj4 = obj4; +>__val__obj4 : Symbol(__val__obj4, Decl(assignmentCompatability5.ts, 2, 14)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability5.ts, 1, 83)) +} +module __test2__ { +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability5.ts, 3, 1)) + + export interface interfaceOne { one: T; }; var obj1: interfaceOne = { one: 1 };; +>interfaceOne : Symbol(interfaceOne, Decl(assignmentCompatability5.ts, 4, 18)) +>T : Symbol(T, Decl(assignmentCompatability5.ts, 5, 52)) +>one : Symbol(one, Decl(assignmentCompatability5.ts, 5, 56)) +>T : Symbol(T, Decl(assignmentCompatability5.ts, 5, 52)) +>obj1 : Symbol(obj1, Decl(assignmentCompatability5.ts, 5, 86)) +>interfaceOne : Symbol(interfaceOne, Decl(assignmentCompatability5.ts, 4, 18)) +>one : Symbol(one, Decl(assignmentCompatability5.ts, 5, 117)) + + export var __val__obj1 = obj1; +>__val__obj1 : Symbol(__val__obj1, Decl(assignmentCompatability5.ts, 6, 14)) +>obj1 : Symbol(obj1, Decl(assignmentCompatability5.ts, 5, 86)) +} +__test2__.__val__obj1 = __test1__.__val__obj4 +>__test2__.__val__obj1 : Symbol(__test2__.__val__obj1, Decl(assignmentCompatability5.ts, 6, 14)) +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability5.ts, 3, 1)) +>__val__obj1 : Symbol(__test2__.__val__obj1, Decl(assignmentCompatability5.ts, 6, 14)) +>__test1__.__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability5.ts, 2, 14)) +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability5.ts, 0, 0)) +>__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability5.ts, 2, 14)) + diff --git a/tests/baselines/reference/assignmentCompatability5.types b/tests/baselines/reference/assignmentCompatability5.types index 80eda3e510b..8f8dbb0f649 100644 --- a/tests/baselines/reference/assignmentCompatability5.types +++ b/tests/baselines/reference/assignmentCompatability5.types @@ -14,6 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number +>1 : number export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional @@ -31,6 +32,7 @@ module __test2__ { >interfaceOne : interfaceOne >{ one: 1 } : { one: number; } >one : number +>1 : number export var __val__obj1 = obj1; >__val__obj1 : interfaceOne diff --git a/tests/baselines/reference/assignmentCompatability6.symbols b/tests/baselines/reference/assignmentCompatability6.symbols new file mode 100644 index 00000000000..4ddacd5cd8c --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability6.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/assignmentCompatability6.ts === +module __test1__ { +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability6.ts, 0, 0)) + + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability6.ts, 0, 18)) +>T : Symbol(T, Decl(assignmentCompatability6.ts, 1, 52)) +>U : Symbol(U, Decl(assignmentCompatability6.ts, 1, 54)) +>one : Symbol(one, Decl(assignmentCompatability6.ts, 1, 58)) +>T : Symbol(T, Decl(assignmentCompatability6.ts, 1, 52)) +>two : Symbol(two, Decl(assignmentCompatability6.ts, 1, 66)) +>U : Symbol(U, Decl(assignmentCompatability6.ts, 1, 54)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability6.ts, 1, 83)) +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability6.ts, 0, 18)) +>one : Symbol(one, Decl(assignmentCompatability6.ts, 1, 139)) + + export var __val__obj4 = obj4; +>__val__obj4 : Symbol(__val__obj4, Decl(assignmentCompatability6.ts, 2, 14)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability6.ts, 1, 83)) +} +module __test2__ { +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability6.ts, 3, 1)) + + export interface interfaceWithOptional { one?: T; }; var obj3: interfaceWithOptional = { };; +>interfaceWithOptional : Symbol(interfaceWithOptional, Decl(assignmentCompatability6.ts, 4, 18)) +>T : Symbol(T, Decl(assignmentCompatability6.ts, 5, 52)) +>one : Symbol(one, Decl(assignmentCompatability6.ts, 5, 56)) +>T : Symbol(T, Decl(assignmentCompatability6.ts, 5, 52)) +>obj3 : Symbol(obj3, Decl(assignmentCompatability6.ts, 5, 86)) +>interfaceWithOptional : Symbol(interfaceWithOptional, Decl(assignmentCompatability6.ts, 4, 18)) + + export var __val__obj3 = obj3; +>__val__obj3 : Symbol(__val__obj3, Decl(assignmentCompatability6.ts, 6, 14)) +>obj3 : Symbol(obj3, Decl(assignmentCompatability6.ts, 5, 86)) +} +__test2__.__val__obj3 = __test1__.__val__obj4 +>__test2__.__val__obj3 : Symbol(__test2__.__val__obj3, Decl(assignmentCompatability6.ts, 6, 14)) +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability6.ts, 3, 1)) +>__val__obj3 : Symbol(__test2__.__val__obj3, Decl(assignmentCompatability6.ts, 6, 14)) +>__test1__.__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability6.ts, 2, 14)) +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability6.ts, 0, 0)) +>__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability6.ts, 2, 14)) + diff --git a/tests/baselines/reference/assignmentCompatability6.types b/tests/baselines/reference/assignmentCompatability6.types index 5e9ae8c6a2f..1191ff8bc26 100644 --- a/tests/baselines/reference/assignmentCompatability6.types +++ b/tests/baselines/reference/assignmentCompatability6.types @@ -14,6 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number +>1 : number export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability7.symbols b/tests/baselines/reference/assignmentCompatability7.symbols new file mode 100644 index 00000000000..32a5be9f87f --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability7.symbols @@ -0,0 +1,47 @@ +=== tests/cases/compiler/assignmentCompatability7.ts === +module __test1__ { +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability7.ts, 0, 0)) + + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability7.ts, 0, 18)) +>T : Symbol(T, Decl(assignmentCompatability7.ts, 1, 52)) +>U : Symbol(U, Decl(assignmentCompatability7.ts, 1, 54)) +>one : Symbol(one, Decl(assignmentCompatability7.ts, 1, 58)) +>T : Symbol(T, Decl(assignmentCompatability7.ts, 1, 52)) +>two : Symbol(two, Decl(assignmentCompatability7.ts, 1, 66)) +>U : Symbol(U, Decl(assignmentCompatability7.ts, 1, 54)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability7.ts, 1, 83)) +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability7.ts, 0, 18)) +>one : Symbol(one, Decl(assignmentCompatability7.ts, 1, 139)) + + export var __val__obj4 = obj4; +>__val__obj4 : Symbol(__val__obj4, Decl(assignmentCompatability7.ts, 2, 14)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability7.ts, 1, 83)) +} +module __test2__ { +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability7.ts, 3, 1)) + + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability7.ts, 4, 18)) +>T : Symbol(T, Decl(assignmentCompatability7.ts, 5, 52)) +>U : Symbol(U, Decl(assignmentCompatability7.ts, 5, 54)) +>one : Symbol(one, Decl(assignmentCompatability7.ts, 5, 58)) +>T : Symbol(T, Decl(assignmentCompatability7.ts, 5, 52)) +>two : Symbol(two, Decl(assignmentCompatability7.ts, 5, 66)) +>U : Symbol(U, Decl(assignmentCompatability7.ts, 5, 54)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability7.ts, 5, 83)) +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability7.ts, 4, 18)) +>one : Symbol(one, Decl(assignmentCompatability7.ts, 5, 139)) + + export var __val__obj4 = obj4; +>__val__obj4 : Symbol(__val__obj4, Decl(assignmentCompatability7.ts, 6, 14)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability7.ts, 5, 83)) +} +__test2__.__val__obj4 = __test1__.__val__obj4 +>__test2__.__val__obj4 : Symbol(__test2__.__val__obj4, Decl(assignmentCompatability7.ts, 6, 14)) +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability7.ts, 3, 1)) +>__val__obj4 : Symbol(__test2__.__val__obj4, Decl(assignmentCompatability7.ts, 6, 14)) +>__test1__.__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability7.ts, 2, 14)) +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability7.ts, 0, 0)) +>__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability7.ts, 2, 14)) + diff --git a/tests/baselines/reference/assignmentCompatability7.types b/tests/baselines/reference/assignmentCompatability7.types index b7b2ab70566..77b67514473 100644 --- a/tests/baselines/reference/assignmentCompatability7.types +++ b/tests/baselines/reference/assignmentCompatability7.types @@ -14,6 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number +>1 : number export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional @@ -34,6 +35,7 @@ module __test2__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number +>1 : number export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability8.symbols b/tests/baselines/reference/assignmentCompatability8.symbols new file mode 100644 index 00000000000..ba30e4fee94 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability8.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/assignmentCompatability8.ts === +module __test1__ { +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability8.ts, 0, 0)) + + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability8.ts, 0, 18)) +>T : Symbol(T, Decl(assignmentCompatability8.ts, 1, 52)) +>U : Symbol(U, Decl(assignmentCompatability8.ts, 1, 54)) +>one : Symbol(one, Decl(assignmentCompatability8.ts, 1, 58)) +>T : Symbol(T, Decl(assignmentCompatability8.ts, 1, 52)) +>two : Symbol(two, Decl(assignmentCompatability8.ts, 1, 66)) +>U : Symbol(U, Decl(assignmentCompatability8.ts, 1, 54)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability8.ts, 1, 83)) +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability8.ts, 0, 18)) +>one : Symbol(one, Decl(assignmentCompatability8.ts, 1, 139)) + + export var __val__obj4 = obj4; +>__val__obj4 : Symbol(__val__obj4, Decl(assignmentCompatability8.ts, 2, 14)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability8.ts, 1, 83)) +} +module __test2__ { +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability8.ts, 3, 1)) + + export class classWithPublic { constructor(public one: T) {} } var x1 = new classWithPublic(1);; +>classWithPublic : Symbol(classWithPublic, Decl(assignmentCompatability8.ts, 4, 18)) +>T : Symbol(T, Decl(assignmentCompatability8.ts, 5, 44)) +>one : Symbol(one, Decl(assignmentCompatability8.ts, 5, 61)) +>T : Symbol(T, Decl(assignmentCompatability8.ts, 5, 44)) +>x1 : Symbol(x1, Decl(assignmentCompatability8.ts, 5, 107)) +>classWithPublic : Symbol(classWithPublic, Decl(assignmentCompatability8.ts, 4, 18)) + + export var __val__x1 = x1; +>__val__x1 : Symbol(__val__x1, Decl(assignmentCompatability8.ts, 6, 14)) +>x1 : Symbol(x1, Decl(assignmentCompatability8.ts, 5, 107)) +} +__test2__.__val__x1 = __test1__.__val__obj4 +>__test2__.__val__x1 : Symbol(__test2__.__val__x1, Decl(assignmentCompatability8.ts, 6, 14)) +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability8.ts, 3, 1)) +>__val__x1 : Symbol(__test2__.__val__x1, Decl(assignmentCompatability8.ts, 6, 14)) +>__test1__.__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability8.ts, 2, 14)) +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability8.ts, 0, 0)) +>__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability8.ts, 2, 14)) + diff --git a/tests/baselines/reference/assignmentCompatability8.types b/tests/baselines/reference/assignmentCompatability8.types index 1c009eea482..554f9b3caed 100644 --- a/tests/baselines/reference/assignmentCompatability8.types +++ b/tests/baselines/reference/assignmentCompatability8.types @@ -14,6 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number +>1 : number export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional @@ -30,6 +31,7 @@ module __test2__ { >x1 : classWithPublic >new classWithPublic(1) : classWithPublic >classWithPublic : typeof classWithPublic +>1 : number export var __val__x1 = x1; >__val__x1 : classWithPublic diff --git a/tests/baselines/reference/assignmentCompatability9.symbols b/tests/baselines/reference/assignmentCompatability9.symbols new file mode 100644 index 00000000000..7c49da7fea2 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability9.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/assignmentCompatability9.ts === +module __test1__ { +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability9.ts, 0, 0)) + + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability9.ts, 0, 18)) +>T : Symbol(T, Decl(assignmentCompatability9.ts, 1, 52)) +>U : Symbol(U, Decl(assignmentCompatability9.ts, 1, 54)) +>one : Symbol(one, Decl(assignmentCompatability9.ts, 1, 58)) +>T : Symbol(T, Decl(assignmentCompatability9.ts, 1, 52)) +>two : Symbol(two, Decl(assignmentCompatability9.ts, 1, 66)) +>U : Symbol(U, Decl(assignmentCompatability9.ts, 1, 54)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability9.ts, 1, 83)) +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability9.ts, 0, 18)) +>one : Symbol(one, Decl(assignmentCompatability9.ts, 1, 139)) + + export var __val__obj4 = obj4; +>__val__obj4 : Symbol(__val__obj4, Decl(assignmentCompatability9.ts, 2, 14)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability9.ts, 1, 83)) +} +module __test2__ { +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability9.ts, 3, 1)) + + export class classWithOptional { constructor(public one?: T) {} } var x3 = new classWithOptional();; +>classWithOptional : Symbol(classWithOptional, Decl(assignmentCompatability9.ts, 4, 18)) +>T : Symbol(T, Decl(assignmentCompatability9.ts, 5, 44)) +>one : Symbol(one, Decl(assignmentCompatability9.ts, 5, 61)) +>T : Symbol(T, Decl(assignmentCompatability9.ts, 5, 44)) +>x3 : Symbol(x3, Decl(assignmentCompatability9.ts, 5, 107)) +>classWithOptional : Symbol(classWithOptional, Decl(assignmentCompatability9.ts, 4, 18)) + + export var __val__x3 = x3; +>__val__x3 : Symbol(__val__x3, Decl(assignmentCompatability9.ts, 6, 14)) +>x3 : Symbol(x3, Decl(assignmentCompatability9.ts, 5, 107)) +} +__test2__.__val__x3 = __test1__.__val__obj4 +>__test2__.__val__x3 : Symbol(__test2__.__val__x3, Decl(assignmentCompatability9.ts, 6, 14)) +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability9.ts, 3, 1)) +>__val__x3 : Symbol(__test2__.__val__x3, Decl(assignmentCompatability9.ts, 6, 14)) +>__test1__.__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability9.ts, 2, 14)) +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability9.ts, 0, 0)) +>__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability9.ts, 2, 14)) + diff --git a/tests/baselines/reference/assignmentCompatability9.types b/tests/baselines/reference/assignmentCompatability9.types index a8235220bec..d8fe3a764a4 100644 --- a/tests/baselines/reference/assignmentCompatability9.types +++ b/tests/baselines/reference/assignmentCompatability9.types @@ -14,6 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number +>1 : number export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatibilityForConstrainedTypeParameters.symbols b/tests/baselines/reference/assignmentCompatibilityForConstrainedTypeParameters.symbols new file mode 100644 index 00000000000..7ca09f2c77d --- /dev/null +++ b/tests/baselines/reference/assignmentCompatibilityForConstrainedTypeParameters.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/assignmentCompatibilityForConstrainedTypeParameters.ts === +function foo() { +>foo : Symbol(foo, Decl(assignmentCompatibilityForConstrainedTypeParameters.ts, 0, 0)) +>T : Symbol(T, Decl(assignmentCompatibilityForConstrainedTypeParameters.ts, 0, 13)) +>bar : Symbol(bar, Decl(assignmentCompatibilityForConstrainedTypeParameters.ts, 0, 24)) + + function bar() { +>bar : Symbol(bar, Decl(assignmentCompatibilityForConstrainedTypeParameters.ts, 0, 43)) +>S : Symbol(S, Decl(assignmentCompatibilityForConstrainedTypeParameters.ts, 1, 15)) +>T : Symbol(T, Decl(assignmentCompatibilityForConstrainedTypeParameters.ts, 0, 13)) + + var x: S; +>x : Symbol(x, Decl(assignmentCompatibilityForConstrainedTypeParameters.ts, 2, 7)) +>S : Symbol(S, Decl(assignmentCompatibilityForConstrainedTypeParameters.ts, 1, 15)) + + var y: T; +>y : Symbol(y, Decl(assignmentCompatibilityForConstrainedTypeParameters.ts, 3, 7)) +>T : Symbol(T, Decl(assignmentCompatibilityForConstrainedTypeParameters.ts, 0, 13)) + + y = x; +>y : Symbol(y, Decl(assignmentCompatibilityForConstrainedTypeParameters.ts, 3, 7)) +>x : Symbol(x, Decl(assignmentCompatibilityForConstrainedTypeParameters.ts, 2, 7)) + } +} diff --git a/tests/baselines/reference/assignmentLHSIsReference.symbols b/tests/baselines/reference/assignmentLHSIsReference.symbols new file mode 100644 index 00000000000..b551557708f --- /dev/null +++ b/tests/baselines/reference/assignmentLHSIsReference.symbols @@ -0,0 +1,62 @@ +=== tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsReference.ts === +var value; +>value : Symbol(value, Decl(assignmentLHSIsReference.ts, 0, 3)) + +// identifiers: variable and parameter +var x1: number; +>x1 : Symbol(x1, Decl(assignmentLHSIsReference.ts, 3, 3)) + +x1 = value; +>x1 : Symbol(x1, Decl(assignmentLHSIsReference.ts, 3, 3)) +>value : Symbol(value, Decl(assignmentLHSIsReference.ts, 0, 3)) + +function fn1(x2: number) { +>fn1 : Symbol(fn1, Decl(assignmentLHSIsReference.ts, 4, 11)) +>x2 : Symbol(x2, Decl(assignmentLHSIsReference.ts, 6, 13)) + + x2 = value; +>x2 : Symbol(x2, Decl(assignmentLHSIsReference.ts, 6, 13)) +>value : Symbol(value, Decl(assignmentLHSIsReference.ts, 0, 3)) +} + +// property accesses +var x3: { a: string }; +>x3 : Symbol(x3, Decl(assignmentLHSIsReference.ts, 11, 3)) +>a : Symbol(a, Decl(assignmentLHSIsReference.ts, 11, 9)) + +x3.a = value; +>x3.a : Symbol(a, Decl(assignmentLHSIsReference.ts, 11, 9)) +>x3 : Symbol(x3, Decl(assignmentLHSIsReference.ts, 11, 3)) +>a : Symbol(a, Decl(assignmentLHSIsReference.ts, 11, 9)) +>value : Symbol(value, Decl(assignmentLHSIsReference.ts, 0, 3)) + +x3['a'] = value; +>x3 : Symbol(x3, Decl(assignmentLHSIsReference.ts, 11, 3)) +>'a' : Symbol(a, Decl(assignmentLHSIsReference.ts, 11, 9)) +>value : Symbol(value, Decl(assignmentLHSIsReference.ts, 0, 3)) + +// parentheses, the contained expression is reference +(x1) = value; +>x1 : Symbol(x1, Decl(assignmentLHSIsReference.ts, 3, 3)) +>value : Symbol(value, Decl(assignmentLHSIsReference.ts, 0, 3)) + +function fn2(x4: number) { +>fn2 : Symbol(fn2, Decl(assignmentLHSIsReference.ts, 16, 13)) +>x4 : Symbol(x4, Decl(assignmentLHSIsReference.ts, 18, 13)) + + (x4) = value; +>x4 : Symbol(x4, Decl(assignmentLHSIsReference.ts, 18, 13)) +>value : Symbol(value, Decl(assignmentLHSIsReference.ts, 0, 3)) +} + +(x3.a) = value; +>x3.a : Symbol(a, Decl(assignmentLHSIsReference.ts, 11, 9)) +>x3 : Symbol(x3, Decl(assignmentLHSIsReference.ts, 11, 3)) +>a : Symbol(a, Decl(assignmentLHSIsReference.ts, 11, 9)) +>value : Symbol(value, Decl(assignmentLHSIsReference.ts, 0, 3)) + +(x3['a']) = value; +>x3 : Symbol(x3, Decl(assignmentLHSIsReference.ts, 11, 3)) +>'a' : Symbol(a, Decl(assignmentLHSIsReference.ts, 11, 9)) +>value : Symbol(value, Decl(assignmentLHSIsReference.ts, 0, 3)) + diff --git a/tests/baselines/reference/assignmentLHSIsReference.types b/tests/baselines/reference/assignmentLHSIsReference.types index 0d7bfad3f06..47204740165 100644 --- a/tests/baselines/reference/assignmentLHSIsReference.types +++ b/tests/baselines/reference/assignmentLHSIsReference.types @@ -37,6 +37,7 @@ x3['a'] = value; >x3['a'] = value : any >x3['a'] : string >x3 : { a: string; } +>'a' : string >value : any // parentheses, the contained expression is reference @@ -70,5 +71,6 @@ function fn2(x4: number) { >(x3['a']) : string >x3['a'] : string >x3 : { a: string; } +>'a' : string >value : any diff --git a/tests/baselines/reference/assignmentRestElementWithErrorSourceType.errors.txt b/tests/baselines/reference/assignmentRestElementWithErrorSourceType.errors.txt new file mode 100644 index 00000000000..080aca5a7ac --- /dev/null +++ b/tests/baselines/reference/assignmentRestElementWithErrorSourceType.errors.txt @@ -0,0 +1,11 @@ +tests/cases/compiler/assignmentRestElementWithErrorSourceType.ts(2,5): error TS2304: Cannot find name 'c'. +tests/cases/compiler/assignmentRestElementWithErrorSourceType.ts(2,10): error TS2304: Cannot find name 'tupel'. + + +==== tests/cases/compiler/assignmentRestElementWithErrorSourceType.ts (2 errors) ==== + var tuple: [string, number]; + [...c] = tupel; // intentionally misspelled + ~ +!!! error TS2304: Cannot find name 'c'. + ~~~~~ +!!! error TS2304: Cannot find name 'tupel'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentRestElementWithErrorSourceType.js b/tests/baselines/reference/assignmentRestElementWithErrorSourceType.js new file mode 100644 index 00000000000..0a1109a14f7 --- /dev/null +++ b/tests/baselines/reference/assignmentRestElementWithErrorSourceType.js @@ -0,0 +1,7 @@ +//// [assignmentRestElementWithErrorSourceType.ts] +var tuple: [string, number]; +[...c] = tupel; // intentionally misspelled + +//// [assignmentRestElementWithErrorSourceType.js] +var tuple; +c = tupel.slice(0); // intentionally misspelled diff --git a/tests/baselines/reference/augmentArray.symbols b/tests/baselines/reference/augmentArray.symbols new file mode 100644 index 00000000000..8c52363d601 --- /dev/null +++ b/tests/baselines/reference/augmentArray.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/augmentArray.ts === +interface Array { +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(augmentArray.ts, 0, 0)) +>T : Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(augmentArray.ts, 0, 16)) + + (): any[]; +} diff --git a/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.symbols b/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.symbols new file mode 100644 index 00000000000..81c8b13d207 --- /dev/null +++ b/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.symbols @@ -0,0 +1,31 @@ +=== tests/cases/conformance/types/members/augmentedTypeBracketAccessIndexSignature.ts === +interface Foo { a } +>Foo : Symbol(Foo, Decl(augmentedTypeBracketAccessIndexSignature.ts, 0, 0)) +>a : Symbol(a, Decl(augmentedTypeBracketAccessIndexSignature.ts, 0, 15)) + +interface Bar { b } +>Bar : Symbol(Bar, Decl(augmentedTypeBracketAccessIndexSignature.ts, 0, 19)) +>b : Symbol(b, Decl(augmentedTypeBracketAccessIndexSignature.ts, 1, 15)) + +interface Object { +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11), Decl(augmentedTypeBracketAccessIndexSignature.ts, 1, 19)) + + [n: number]: Foo; +>n : Symbol(n, Decl(augmentedTypeBracketAccessIndexSignature.ts, 4, 5)) +>Foo : Symbol(Foo, Decl(augmentedTypeBracketAccessIndexSignature.ts, 0, 0)) +} + +interface Function { +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11), Decl(augmentedTypeBracketAccessIndexSignature.ts, 5, 1)) + + [n: number]: Bar; +>n : Symbol(n, Decl(augmentedTypeBracketAccessIndexSignature.ts, 8, 5)) +>Bar : Symbol(Bar, Decl(augmentedTypeBracketAccessIndexSignature.ts, 0, 19)) +} + +var a = {}[0]; // Should be Foo +>a : Symbol(a, Decl(augmentedTypeBracketAccessIndexSignature.ts, 11, 3)) + +var b = (() => { })[0]; // Should be Bar +>b : Symbol(b, Decl(augmentedTypeBracketAccessIndexSignature.ts, 12, 3)) + diff --git a/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.types b/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.types index 4e6b51730da..898da985aad 100644 --- a/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.types +++ b/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.types @@ -27,10 +27,12 @@ var a = {}[0]; // Should be Foo >a : any >{}[0] : any >{} : {} +>0 : number var b = (() => { })[0]; // Should be Bar >b : any >(() => { })[0] : any >(() => { }) : () => void >() => { } : () => void +>0 : number diff --git a/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.symbols b/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.symbols new file mode 100644 index 00000000000..cc9c2ba62ef --- /dev/null +++ b/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/augmentedTypeBracketNamedPropertyAccess.ts === +interface Object { +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11), Decl(augmentedTypeBracketNamedPropertyAccess.ts, 0, 0)) + + data: number; +>data : Symbol(data, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 0, 18)) +} +interface Function { +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11), Decl(augmentedTypeBracketNamedPropertyAccess.ts, 2, 1)) + + functionData: string; +>functionData : Symbol(functionData, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 3, 20)) +} +var o = {}; +>o : Symbol(o, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 6, 3)) + +var f = function () { }; +>f : Symbol(f, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 7, 3)) + +var r1 = o['data']; // Should be number +>r1 : Symbol(r1, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 9, 3)) +>o : Symbol(o, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 6, 3)) +>'data' : Symbol(Object.data, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 0, 18)) + +var r2 = o['functionData']; // Should be any (no property found) +>r2 : Symbol(r2, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 10, 3)) +>o : Symbol(o, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 6, 3)) + +var r3 = f['functionData']; // Should be string +>r3 : Symbol(r3, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 11, 3)) +>f : Symbol(f, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 7, 3)) +>'functionData' : Symbol(Function.functionData, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 3, 20)) + +var r4 = f['data']; // Should be number +>r4 : Symbol(r4, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 12, 3)) +>f : Symbol(f, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 7, 3)) +>'data' : Symbol(Object.data, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 0, 18)) + diff --git a/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.types b/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.types index 142b08928e3..c47c98ebc9c 100644 --- a/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.types +++ b/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.types @@ -23,19 +23,23 @@ var r1 = o['data']; // Should be number >r1 : number >o['data'] : number >o : {} +>'data' : string var r2 = o['functionData']; // Should be any (no property found) >r2 : any >o['functionData'] : any >o : {} +>'functionData' : string var r3 = f['functionData']; // Should be string >r3 : string >f['functionData'] : string >f : () => void +>'functionData' : string var r4 = f['data']; // Should be number >r4 : number >f['data'] : number >f : () => void +>'data' : string diff --git a/tests/baselines/reference/augmentedTypesClass3.symbols b/tests/baselines/reference/augmentedTypesClass3.symbols new file mode 100644 index 00000000000..62504a56f25 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesClass3.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/augmentedTypesClass3.ts === +// class then module +class c5 { public foo() { } } +>c5 : Symbol(c5, Decl(augmentedTypesClass3.ts, 0, 0), Decl(augmentedTypesClass3.ts, 1, 29)) +>foo : Symbol(foo, Decl(augmentedTypesClass3.ts, 1, 10)) + +module c5 { } // should be ok +>c5 : Symbol(c5, Decl(augmentedTypesClass3.ts, 0, 0), Decl(augmentedTypesClass3.ts, 1, 29)) + +class c5a { public foo() { } } +>c5a : Symbol(c5a, Decl(augmentedTypesClass3.ts, 2, 13), Decl(augmentedTypesClass3.ts, 4, 30)) +>foo : Symbol(foo, Decl(augmentedTypesClass3.ts, 4, 11)) + +module c5a { var y = 2; } // should be ok +>c5a : Symbol(c5a, Decl(augmentedTypesClass3.ts, 2, 13), Decl(augmentedTypesClass3.ts, 4, 30)) +>y : Symbol(y, Decl(augmentedTypesClass3.ts, 5, 16)) + +class c5b { public foo() { } } +>c5b : Symbol(c5b, Decl(augmentedTypesClass3.ts, 5, 25), Decl(augmentedTypesClass3.ts, 7, 30)) +>foo : Symbol(foo, Decl(augmentedTypesClass3.ts, 7, 11)) + +module c5b { export var y = 2; } // should be ok +>c5b : Symbol(c5b, Decl(augmentedTypesClass3.ts, 5, 25), Decl(augmentedTypesClass3.ts, 7, 30)) +>y : Symbol(y, Decl(augmentedTypesClass3.ts, 8, 23)) + +//// class then import +class c5c { public foo() { } } +>c5c : Symbol(c5c, Decl(augmentedTypesClass3.ts, 8, 32)) +>foo : Symbol(foo, Decl(augmentedTypesClass3.ts, 11, 11)) + +//import c5c = require(''); diff --git a/tests/baselines/reference/augmentedTypesClass3.types b/tests/baselines/reference/augmentedTypesClass3.types index b22899b03cf..bed118b5978 100644 --- a/tests/baselines/reference/augmentedTypesClass3.types +++ b/tests/baselines/reference/augmentedTypesClass3.types @@ -14,6 +14,7 @@ class c5a { public foo() { } } module c5a { var y = 2; } // should be ok >c5a : typeof c5a >y : number +>2 : number class c5b { public foo() { } } >c5b : c5b @@ -22,6 +23,7 @@ class c5b { public foo() { } } module c5b { export var y = 2; } // should be ok >c5b : typeof c5b >y : number +>2 : number //// class then import class c5c { public foo() { } } diff --git a/tests/baselines/reference/augmentedTypesExternalModule1.symbols b/tests/baselines/reference/augmentedTypesExternalModule1.symbols new file mode 100644 index 00000000000..3a909b91df5 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesExternalModule1.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/augmentedTypesExternalModule1.ts === +export var a = 1; +>a : Symbol(a, Decl(augmentedTypesExternalModule1.ts, 0, 10)) + +class c5 { public foo() { } } +>c5 : Symbol(c5, Decl(augmentedTypesExternalModule1.ts, 0, 17), Decl(augmentedTypesExternalModule1.ts, 1, 29)) +>foo : Symbol(foo, Decl(augmentedTypesExternalModule1.ts, 1, 10)) + +module c5 { } // should be ok everywhere +>c5 : Symbol(c5, Decl(augmentedTypesExternalModule1.ts, 0, 17), Decl(augmentedTypesExternalModule1.ts, 1, 29)) + diff --git a/tests/baselines/reference/augmentedTypesExternalModule1.types b/tests/baselines/reference/augmentedTypesExternalModule1.types index ec7e9194df6..e652ecb08e1 100644 --- a/tests/baselines/reference/augmentedTypesExternalModule1.types +++ b/tests/baselines/reference/augmentedTypesExternalModule1.types @@ -1,6 +1,7 @@ === tests/cases/compiler/augmentedTypesExternalModule1.ts === export var a = 1; >a : number +>1 : number class c5 { public foo() { } } >c5 : c5 diff --git a/tests/baselines/reference/augmentedTypesModules3b.symbols b/tests/baselines/reference/augmentedTypesModules3b.symbols new file mode 100644 index 00000000000..dd5456e4cf2 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesModules3b.symbols @@ -0,0 +1,51 @@ +=== tests/cases/compiler/augmentedTypesModules3b.ts === +class m3b { foo() { } } +>m3b : Symbol(m3b, Decl(augmentedTypesModules3b.ts, 0, 0), Decl(augmentedTypesModules3b.ts, 0, 23)) +>foo : Symbol(foo, Decl(augmentedTypesModules3b.ts, 0, 11)) + +module m3b { var y = 2; } +>m3b : Symbol(m3b, Decl(augmentedTypesModules3b.ts, 0, 0), Decl(augmentedTypesModules3b.ts, 0, 23)) +>y : Symbol(y, Decl(augmentedTypesModules3b.ts, 1, 16)) + +class m3c { foo() { } } +>m3c : Symbol(m3c, Decl(augmentedTypesModules3b.ts, 1, 25), Decl(augmentedTypesModules3b.ts, 3, 23)) +>foo : Symbol(foo, Decl(augmentedTypesModules3b.ts, 3, 11)) + +module m3c { export var y = 2; } +>m3c : Symbol(m3c, Decl(augmentedTypesModules3b.ts, 1, 25), Decl(augmentedTypesModules3b.ts, 3, 23)) +>y : Symbol(y, Decl(augmentedTypesModules3b.ts, 4, 23)) + +declare class m3d { foo(): void } +>m3d : Symbol(m3d, Decl(augmentedTypesModules3b.ts, 4, 32), Decl(augmentedTypesModules3b.ts, 6, 33)) +>foo : Symbol(foo, Decl(augmentedTypesModules3b.ts, 6, 19)) + +module m3d { export var y = 2; } +>m3d : Symbol(m3d, Decl(augmentedTypesModules3b.ts, 4, 32), Decl(augmentedTypesModules3b.ts, 6, 33)) +>y : Symbol(y, Decl(augmentedTypesModules3b.ts, 7, 23)) + +module m3e { export var y = 2; } +>m3e : Symbol(m3e, Decl(augmentedTypesModules3b.ts, 7, 32), Decl(augmentedTypesModules3b.ts, 9, 32)) +>y : Symbol(y, Decl(augmentedTypesModules3b.ts, 9, 23)) + +declare class m3e { foo(): void } +>m3e : Symbol(m3e, Decl(augmentedTypesModules3b.ts, 7, 32), Decl(augmentedTypesModules3b.ts, 9, 32)) +>foo : Symbol(foo, Decl(augmentedTypesModules3b.ts, 10, 19)) + +declare class m3f { foo(): void } +>m3f : Symbol(m3f, Decl(augmentedTypesModules3b.ts, 10, 33), Decl(augmentedTypesModules3b.ts, 12, 33)) +>foo : Symbol(foo, Decl(augmentedTypesModules3b.ts, 12, 19)) + +module m3f { export interface I { foo(): void } } +>m3f : Symbol(m3f, Decl(augmentedTypesModules3b.ts, 10, 33), Decl(augmentedTypesModules3b.ts, 12, 33)) +>I : Symbol(I, Decl(augmentedTypesModules3b.ts, 13, 12)) +>foo : Symbol(foo, Decl(augmentedTypesModules3b.ts, 13, 33)) + +declare class m3g { foo(): void } +>m3g : Symbol(m3g, Decl(augmentedTypesModules3b.ts, 13, 49), Decl(augmentedTypesModules3b.ts, 15, 33)) +>foo : Symbol(foo, Decl(augmentedTypesModules3b.ts, 15, 19)) + +module m3g { export class C { foo() { } } } +>m3g : Symbol(m3g, Decl(augmentedTypesModules3b.ts, 13, 49), Decl(augmentedTypesModules3b.ts, 15, 33)) +>C : Symbol(C, Decl(augmentedTypesModules3b.ts, 16, 12)) +>foo : Symbol(foo, Decl(augmentedTypesModules3b.ts, 16, 29)) + diff --git a/tests/baselines/reference/augmentedTypesModules3b.types b/tests/baselines/reference/augmentedTypesModules3b.types index af2c33c65da..38134c7c1c2 100644 --- a/tests/baselines/reference/augmentedTypesModules3b.types +++ b/tests/baselines/reference/augmentedTypesModules3b.types @@ -6,6 +6,7 @@ class m3b { foo() { } } module m3b { var y = 2; } >m3b : typeof m3b >y : number +>2 : number class m3c { foo() { } } >m3c : m3c @@ -14,6 +15,7 @@ class m3c { foo() { } } module m3c { export var y = 2; } >m3c : typeof m3c >y : number +>2 : number declare class m3d { foo(): void } >m3d : m3d @@ -22,10 +24,12 @@ declare class m3d { foo(): void } module m3d { export var y = 2; } >m3d : typeof m3d >y : number +>2 : number module m3e { export var y = 2; } >m3e : typeof m3e >y : number +>2 : number declare class m3e { foo(): void } >m3e : m3e diff --git a/tests/baselines/reference/augmentedTypesModules4.symbols b/tests/baselines/reference/augmentedTypesModules4.symbols new file mode 100644 index 00000000000..e0cee3e7c3a --- /dev/null +++ b/tests/baselines/reference/augmentedTypesModules4.symbols @@ -0,0 +1,54 @@ +=== tests/cases/compiler/augmentedTypesModules4.ts === +// module then enum +// should be errors +module m4 { } +>m4 : Symbol(m4, Decl(augmentedTypesModules4.ts, 0, 0), Decl(augmentedTypesModules4.ts, 2, 13)) + +enum m4 { } +>m4 : Symbol(m4, Decl(augmentedTypesModules4.ts, 0, 0), Decl(augmentedTypesModules4.ts, 2, 13)) + +module m4a { var y = 2; } +>m4a : Symbol(m4a, Decl(augmentedTypesModules4.ts, 3, 11), Decl(augmentedTypesModules4.ts, 5, 25)) +>y : Symbol(y, Decl(augmentedTypesModules4.ts, 5, 16)) + +enum m4a { One } +>m4a : Symbol(m4a, Decl(augmentedTypesModules4.ts, 3, 11), Decl(augmentedTypesModules4.ts, 5, 25)) +>One : Symbol(m4a.One, Decl(augmentedTypesModules4.ts, 6, 10)) + +module m4b { export var y = 2; } +>m4b : Symbol(m4b, Decl(augmentedTypesModules4.ts, 6, 16), Decl(augmentedTypesModules4.ts, 8, 32)) +>y : Symbol(y, Decl(augmentedTypesModules4.ts, 8, 23)) + +enum m4b { One } +>m4b : Symbol(m4b, Decl(augmentedTypesModules4.ts, 6, 16), Decl(augmentedTypesModules4.ts, 8, 32)) +>One : Symbol(m4b.One, Decl(augmentedTypesModules4.ts, 9, 10)) + +module m4c { interface I { foo(): void } } +>m4c : Symbol(m4c, Decl(augmentedTypesModules4.ts, 9, 16), Decl(augmentedTypesModules4.ts, 11, 42)) +>I : Symbol(I, Decl(augmentedTypesModules4.ts, 11, 12)) +>foo : Symbol(foo, Decl(augmentedTypesModules4.ts, 11, 26)) + +enum m4c { One } +>m4c : Symbol(m4c, Decl(augmentedTypesModules4.ts, 9, 16), Decl(augmentedTypesModules4.ts, 11, 42)) +>One : Symbol(m4c.One, Decl(augmentedTypesModules4.ts, 12, 10)) + +module m4d { class C { foo() { } } } +>m4d : Symbol(m4d, Decl(augmentedTypesModules4.ts, 12, 16), Decl(augmentedTypesModules4.ts, 14, 36)) +>C : Symbol(C, Decl(augmentedTypesModules4.ts, 14, 12)) +>foo : Symbol(foo, Decl(augmentedTypesModules4.ts, 14, 22)) + +enum m4d { One } +>m4d : Symbol(m4d, Decl(augmentedTypesModules4.ts, 12, 16), Decl(augmentedTypesModules4.ts, 14, 36)) +>One : Symbol(m4d.One, Decl(augmentedTypesModules4.ts, 15, 10)) + +//// module then module + +module m5 { export var y = 2; } +>m5 : Symbol(m5, Decl(augmentedTypesModules4.ts, 15, 16), Decl(augmentedTypesModules4.ts, 19, 31)) +>y : Symbol(y, Decl(augmentedTypesModules4.ts, 19, 22)) + +module m5 { export interface I { foo(): void } } // should already be reasonably well covered +>m5 : Symbol(m5, Decl(augmentedTypesModules4.ts, 15, 16), Decl(augmentedTypesModules4.ts, 19, 31)) +>I : Symbol(I, Decl(augmentedTypesModules4.ts, 20, 11)) +>foo : Symbol(foo, Decl(augmentedTypesModules4.ts, 20, 32)) + diff --git a/tests/baselines/reference/augmentedTypesModules4.types b/tests/baselines/reference/augmentedTypesModules4.types index bf8922a5761..15d7c28e1d6 100644 --- a/tests/baselines/reference/augmentedTypesModules4.types +++ b/tests/baselines/reference/augmentedTypesModules4.types @@ -10,6 +10,7 @@ enum m4 { } module m4a { var y = 2; } >m4a : typeof m4a >y : number +>2 : number enum m4a { One } >m4a : m4a @@ -18,6 +19,7 @@ enum m4a { One } module m4b { export var y = 2; } >m4b : typeof m4b >y : number +>2 : number enum m4b { One } >m4b : m4b @@ -46,6 +48,7 @@ enum m4d { One } module m5 { export var y = 2; } >m5 : typeof m5 >y : number +>2 : number module m5 { export interface I { foo(): void } } // should already be reasonably well covered >m5 : typeof m5 diff --git a/tests/baselines/reference/autoAsiForStaticsInClassDeclaration.symbols b/tests/baselines/reference/autoAsiForStaticsInClassDeclaration.symbols new file mode 100644 index 00000000000..199830dc191 --- /dev/null +++ b/tests/baselines/reference/autoAsiForStaticsInClassDeclaration.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/autoAsiForStaticsInClassDeclaration.ts === +class C { +>C : Symbol(C, Decl(autoAsiForStaticsInClassDeclaration.ts, 0, 0)) + + static x +>x : Symbol(C.x, Decl(autoAsiForStaticsInClassDeclaration.ts, 0, 9)) + + static y +>y : Symbol(C.y, Decl(autoAsiForStaticsInClassDeclaration.ts, 1, 12)) +} diff --git a/tests/baselines/reference/autonumberingInEnums.symbols b/tests/baselines/reference/autonumberingInEnums.symbols new file mode 100644 index 00000000000..8cfba4d1057 --- /dev/null +++ b/tests/baselines/reference/autonumberingInEnums.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/autonumberingInEnums.ts === +enum Foo { +>Foo : Symbol(Foo, Decl(autonumberingInEnums.ts, 0, 0), Decl(autonumberingInEnums.ts, 2, 1)) + + a = 1 +>a : Symbol(Foo.a, Decl(autonumberingInEnums.ts, 0, 10)) +} + +enum Foo { +>Foo : Symbol(Foo, Decl(autonumberingInEnums.ts, 0, 0), Decl(autonumberingInEnums.ts, 2, 1)) + + b // should work fine +>b : Symbol(Foo.b, Decl(autonumberingInEnums.ts, 4, 10)) +} diff --git a/tests/baselines/reference/autonumberingInEnums.types b/tests/baselines/reference/autonumberingInEnums.types index ce3366390e8..35d5a1505a5 100644 --- a/tests/baselines/reference/autonumberingInEnums.types +++ b/tests/baselines/reference/autonumberingInEnums.types @@ -4,6 +4,7 @@ enum Foo { a = 1 >a : Foo +>1 : number } enum Foo { diff --git a/tests/baselines/reference/avoid.symbols b/tests/baselines/reference/avoid.symbols new file mode 100644 index 00000000000..9b9440eea65 --- /dev/null +++ b/tests/baselines/reference/avoid.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/avoid.ts === +function f() { +>f : Symbol(f, Decl(avoid.ts, 0, 0)) + + var x=1; +>x : Symbol(x, Decl(avoid.ts, 1, 7)) +} + +var y=f(); // error void fn +>y : Symbol(y, Decl(avoid.ts, 4, 3)) +>f : Symbol(f, Decl(avoid.ts, 0, 0)) + +var why:any=f(); // error void fn +>why : Symbol(why, Decl(avoid.ts, 5, 3)) +>f : Symbol(f, Decl(avoid.ts, 0, 0)) + +var w:any; +>w : Symbol(w, Decl(avoid.ts, 6, 3)) + +w=f(); // error void fn +>w : Symbol(w, Decl(avoid.ts, 6, 3)) +>f : Symbol(f, Decl(avoid.ts, 0, 0)) + +class C { +>C : Symbol(C, Decl(avoid.ts, 7, 6)) + + g() { +>g : Symbol(g, Decl(avoid.ts, 9, 9)) + + } +} + +var z=new C().g(); // error void fn +>z : Symbol(z, Decl(avoid.ts, 15, 3)) +>new C().g : Symbol(C.g, Decl(avoid.ts, 9, 9)) +>C : Symbol(C, Decl(avoid.ts, 7, 6)) +>g : Symbol(C.g, Decl(avoid.ts, 9, 9)) + +var N=new f(); // ok with void fn +>N : Symbol(N, Decl(avoid.ts, 16, 3)) +>f : Symbol(f, Decl(avoid.ts, 0, 0)) + + diff --git a/tests/baselines/reference/avoid.types b/tests/baselines/reference/avoid.types index 853d93bdd79..25fe27a2ea0 100644 --- a/tests/baselines/reference/avoid.types +++ b/tests/baselines/reference/avoid.types @@ -4,6 +4,7 @@ function f() { var x=1; >x : number +>1 : number } var y=f(); // error void fn diff --git a/tests/baselines/reference/badOverloadError.symbols b/tests/baselines/reference/badOverloadError.symbols new file mode 100644 index 00000000000..86c0a332f8f --- /dev/null +++ b/tests/baselines/reference/badOverloadError.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/badOverloadError.ts === +function method() { +>method : Symbol(method, Decl(badOverloadError.ts, 0, 0)) + + var dictionary = <{ [index: string]: string; }>{}; +>dictionary : Symbol(dictionary, Decl(badOverloadError.ts, 1, 7)) +>index : Symbol(index, Decl(badOverloadError.ts, 1, 25)) +} + diff --git a/tests/baselines/reference/badThisBinding.symbols b/tests/baselines/reference/badThisBinding.symbols new file mode 100644 index 00000000000..c1ca8d1f481 --- /dev/null +++ b/tests/baselines/reference/badThisBinding.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/badThisBinding.ts === +declare function foo(a:any): any; +>foo : Symbol(foo, Decl(badThisBinding.ts, 0, 0)) +>a : Symbol(a, Decl(badThisBinding.ts, 0, 21)) + +declare function bar(a:any): any; +>bar : Symbol(bar, Decl(badThisBinding.ts, 0, 33)) +>a : Symbol(a, Decl(badThisBinding.ts, 1, 21)) + +class Greeter { +>Greeter : Symbol(Greeter, Decl(badThisBinding.ts, 1, 33)) + + constructor() { + foo(() => { +>foo : Symbol(foo, Decl(badThisBinding.ts, 0, 0)) + + bar(() => { +>bar : Symbol(bar, Decl(badThisBinding.ts, 0, 33)) + + var x = this; +>x : Symbol(x, Decl(badThisBinding.ts, 7, 19)) +>this : Symbol(Greeter, Decl(badThisBinding.ts, 1, 33)) + + }); + }); + } + +} diff --git a/tests/baselines/reference/baseIndexSignatureResolution.symbols b/tests/baselines/reference/baseIndexSignatureResolution.symbols new file mode 100644 index 00000000000..297f6b092f3 --- /dev/null +++ b/tests/baselines/reference/baseIndexSignatureResolution.symbols @@ -0,0 +1,49 @@ +=== tests/cases/compiler/baseIndexSignatureResolution.ts === +class Base { private a: string; } +>Base : Symbol(Base, Decl(baseIndexSignatureResolution.ts, 0, 0)) +>a : Symbol(a, Decl(baseIndexSignatureResolution.ts, 0, 12)) + +class Derived extends Base { private b: string; } +>Derived : Symbol(Derived, Decl(baseIndexSignatureResolution.ts, 0, 33)) +>Base : Symbol(Base, Decl(baseIndexSignatureResolution.ts, 0, 0)) +>b : Symbol(b, Decl(baseIndexSignatureResolution.ts, 1, 28)) + +// Note - commmenting "extends Foo" prevents the error +interface Foo { +>Foo : Symbol(Foo, Decl(baseIndexSignatureResolution.ts, 1, 49)) + + [i: number]: Base; +>i : Symbol(i, Decl(baseIndexSignatureResolution.ts, 5, 5)) +>Base : Symbol(Base, Decl(baseIndexSignatureResolution.ts, 0, 0)) +} +interface FooOf extends Foo { +>FooOf : Symbol(FooOf, Decl(baseIndexSignatureResolution.ts, 6, 1)) +>TBase : Symbol(TBase, Decl(baseIndexSignatureResolution.ts, 7, 16)) +>Base : Symbol(Base, Decl(baseIndexSignatureResolution.ts, 0, 0)) +>Foo : Symbol(Foo, Decl(baseIndexSignatureResolution.ts, 1, 49)) + + [i: number]: TBase; +>i : Symbol(i, Decl(baseIndexSignatureResolution.ts, 8, 5)) +>TBase : Symbol(TBase, Decl(baseIndexSignatureResolution.ts, 7, 16)) +} +var x: FooOf = null; +>x : Symbol(x, Decl(baseIndexSignatureResolution.ts, 10, 3)) +>FooOf : Symbol(FooOf, Decl(baseIndexSignatureResolution.ts, 6, 1)) +>Derived : Symbol(Derived, Decl(baseIndexSignatureResolution.ts, 0, 33)) + +var y: Derived = x[0]; +>y : Symbol(y, Decl(baseIndexSignatureResolution.ts, 11, 3)) +>Derived : Symbol(Derived, Decl(baseIndexSignatureResolution.ts, 0, 33)) +>x : Symbol(x, Decl(baseIndexSignatureResolution.ts, 10, 3)) + +/* +// Note - the equivalent for normal interface methods works fine: +interface A { + foo(): Base; +} +interface B extends A { + foo(): TBase; +} +var b: B = null; +var z: Derived = b.foo(); +*/ diff --git a/tests/baselines/reference/baseIndexSignatureResolution.types b/tests/baselines/reference/baseIndexSignatureResolution.types index 5a7ad14d2fa..90d143155fb 100644 --- a/tests/baselines/reference/baseIndexSignatureResolution.types +++ b/tests/baselines/reference/baseIndexSignatureResolution.types @@ -30,12 +30,14 @@ var x: FooOf = null; >x : FooOf >FooOf : FooOf >Derived : Derived +>null : null var y: Derived = x[0]; >y : Derived >Derived : Derived >x[0] : Derived >x : FooOf +>0 : number /* // Note - the equivalent for normal interface methods works fine: diff --git a/tests/baselines/reference/baseTypeAfterDerivedType.symbols b/tests/baselines/reference/baseTypeAfterDerivedType.symbols new file mode 100644 index 00000000000..b085e0a4152 --- /dev/null +++ b/tests/baselines/reference/baseTypeAfterDerivedType.symbols @@ -0,0 +1,35 @@ +=== tests/cases/compiler/baseTypeAfterDerivedType.ts === +interface Derived extends Base { +>Derived : Symbol(Derived, Decl(baseTypeAfterDerivedType.ts, 0, 0)) +>Base : Symbol(Base, Decl(baseTypeAfterDerivedType.ts, 2, 1)) + + method(...args: any[]): void; +>method : Symbol(method, Decl(baseTypeAfterDerivedType.ts, 0, 32)) +>args : Symbol(args, Decl(baseTypeAfterDerivedType.ts, 1, 11)) +} + +interface Base { +>Base : Symbol(Base, Decl(baseTypeAfterDerivedType.ts, 2, 1)) + + method(...args: any[]): void; +>method : Symbol(method, Decl(baseTypeAfterDerivedType.ts, 4, 16)) +>args : Symbol(args, Decl(baseTypeAfterDerivedType.ts, 5, 11)) +} + +class Derived2 implements Base2 { +>Derived2 : Symbol(Derived2, Decl(baseTypeAfterDerivedType.ts, 6, 1)) +>Base2 : Symbol(Base2, Decl(baseTypeAfterDerivedType.ts, 10, 1)) + + method(...args: any[]): void { } +>method : Symbol(method, Decl(baseTypeAfterDerivedType.ts, 8, 33)) +>args : Symbol(args, Decl(baseTypeAfterDerivedType.ts, 9, 11)) +} + +interface Base2 { +>Base2 : Symbol(Base2, Decl(baseTypeAfterDerivedType.ts, 10, 1)) + + method(...args: any[]): void; +>method : Symbol(method, Decl(baseTypeAfterDerivedType.ts, 12, 17)) +>args : Symbol(args, Decl(baseTypeAfterDerivedType.ts, 13, 11)) +} + diff --git a/tests/baselines/reference/baseTypeOrderChecking.symbols b/tests/baselines/reference/baseTypeOrderChecking.symbols new file mode 100644 index 00000000000..05d913f481e --- /dev/null +++ b/tests/baselines/reference/baseTypeOrderChecking.symbols @@ -0,0 +1,51 @@ +=== tests/cases/compiler/baseTypeOrderChecking.ts === +var someVariable: Class4; +>someVariable : Symbol(someVariable, Decl(baseTypeOrderChecking.ts, 0, 3)) +>Class4 : Symbol(Class4, Decl(baseTypeOrderChecking.ts, 26, 1)) +>Class2 : Symbol(Class2, Decl(baseTypeOrderChecking.ts, 8, 1)) + + + +class Class1 +>Class1 : Symbol(Class1, Decl(baseTypeOrderChecking.ts, 0, 33)) + +{ + +} + + + +class Class2 extends Class1 +>Class2 : Symbol(Class2, Decl(baseTypeOrderChecking.ts, 8, 1)) +>Class1 : Symbol(Class1, Decl(baseTypeOrderChecking.ts, 0, 33)) + +{ + +} + + + +class Class3 +>Class3 : Symbol(Class3, Decl(baseTypeOrderChecking.ts, 16, 1)) +>T : Symbol(T, Decl(baseTypeOrderChecking.ts, 20, 13)) + +{ + + public memberVariable: Class2; +>memberVariable : Symbol(memberVariable, Decl(baseTypeOrderChecking.ts, 22, 1)) +>Class2 : Symbol(Class2, Decl(baseTypeOrderChecking.ts, 8, 1)) + +} + + + +class Class4 extends Class3 +>Class4 : Symbol(Class4, Decl(baseTypeOrderChecking.ts, 26, 1)) +>T : Symbol(T, Decl(baseTypeOrderChecking.ts, 30, 13)) +>Class3 : Symbol(Class3, Decl(baseTypeOrderChecking.ts, 16, 1)) +>T : Symbol(T, Decl(baseTypeOrderChecking.ts, 30, 13)) + +{ + +} + diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.symbols b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.symbols new file mode 100644 index 00000000000..e6b6def0944 --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.symbols @@ -0,0 +1,101 @@ +=== tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfConditionalExpressions.ts === +// conditional expressions return the best common type of the branches plus contextual type (using the first candidate if multiple BCTs exist) +// no errors expected here + +var a: { x: number; y?: number }; +>a : Symbol(a, Decl(bestCommonTypeOfConditionalExpressions.ts, 3, 3)) +>x : Symbol(x, Decl(bestCommonTypeOfConditionalExpressions.ts, 3, 8)) +>y : Symbol(y, Decl(bestCommonTypeOfConditionalExpressions.ts, 3, 19)) + +var b: { x: number; z?: number }; +>b : Symbol(b, Decl(bestCommonTypeOfConditionalExpressions.ts, 4, 3)) +>x : Symbol(x, Decl(bestCommonTypeOfConditionalExpressions.ts, 4, 8)) +>z : Symbol(z, Decl(bestCommonTypeOfConditionalExpressions.ts, 4, 19)) + +class Base { foo: string; } +>Base : Symbol(Base, Decl(bestCommonTypeOfConditionalExpressions.ts, 4, 33)) +>foo : Symbol(foo, Decl(bestCommonTypeOfConditionalExpressions.ts, 6, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(bestCommonTypeOfConditionalExpressions.ts, 6, 27)) +>Base : Symbol(Base, Decl(bestCommonTypeOfConditionalExpressions.ts, 4, 33)) +>bar : Symbol(bar, Decl(bestCommonTypeOfConditionalExpressions.ts, 7, 28)) + +class Derived2 extends Base { baz: string; } +>Derived2 : Symbol(Derived2, Decl(bestCommonTypeOfConditionalExpressions.ts, 7, 43)) +>Base : Symbol(Base, Decl(bestCommonTypeOfConditionalExpressions.ts, 4, 33)) +>baz : Symbol(baz, Decl(bestCommonTypeOfConditionalExpressions.ts, 8, 29)) + +var base: Base; +>base : Symbol(base, Decl(bestCommonTypeOfConditionalExpressions.ts, 9, 3)) +>Base : Symbol(Base, Decl(bestCommonTypeOfConditionalExpressions.ts, 4, 33)) + +var derived: Derived; +>derived : Symbol(derived, Decl(bestCommonTypeOfConditionalExpressions.ts, 10, 3)) +>Derived : Symbol(Derived, Decl(bestCommonTypeOfConditionalExpressions.ts, 6, 27)) + +var derived2: Derived2; +>derived2 : Symbol(derived2, Decl(bestCommonTypeOfConditionalExpressions.ts, 11, 3)) +>Derived2 : Symbol(Derived2, Decl(bestCommonTypeOfConditionalExpressions.ts, 7, 43)) + +var r = true ? 1 : 2; +>r : Symbol(r, Decl(bestCommonTypeOfConditionalExpressions.ts, 13, 3)) + +var r3 = true ? 1 : {}; +>r3 : Symbol(r3, Decl(bestCommonTypeOfConditionalExpressions.ts, 14, 3)) + +var r4 = true ? a : b; // typeof a +>r4 : Symbol(r4, Decl(bestCommonTypeOfConditionalExpressions.ts, 15, 3)) +>a : Symbol(a, Decl(bestCommonTypeOfConditionalExpressions.ts, 3, 3)) +>b : Symbol(b, Decl(bestCommonTypeOfConditionalExpressions.ts, 4, 3)) + +var r5 = true ? b : a; // typeof b +>r5 : Symbol(r5, Decl(bestCommonTypeOfConditionalExpressions.ts, 16, 3)) +>b : Symbol(b, Decl(bestCommonTypeOfConditionalExpressions.ts, 4, 3)) +>a : Symbol(a, Decl(bestCommonTypeOfConditionalExpressions.ts, 3, 3)) + +var r6 = true ? (x: number) => { } : (x: Object) => { }; // returns number => void +>r6 : Symbol(r6, Decl(bestCommonTypeOfConditionalExpressions.ts, 17, 3)) +>x : Symbol(x, Decl(bestCommonTypeOfConditionalExpressions.ts, 17, 17)) +>x : Symbol(x, Decl(bestCommonTypeOfConditionalExpressions.ts, 17, 38)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var r7: (x: Object) => void = true ? (x: number) => { } : (x: Object) => { }; +>r7 : Symbol(r7, Decl(bestCommonTypeOfConditionalExpressions.ts, 18, 3)) +>x : Symbol(x, Decl(bestCommonTypeOfConditionalExpressions.ts, 18, 9)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>x : Symbol(x, Decl(bestCommonTypeOfConditionalExpressions.ts, 18, 38)) +>x : Symbol(x, Decl(bestCommonTypeOfConditionalExpressions.ts, 18, 59)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var r8 = true ? (x: Object) => { } : (x: number) => { }; // returns Object => void +>r8 : Symbol(r8, Decl(bestCommonTypeOfConditionalExpressions.ts, 19, 3)) +>x : Symbol(x, Decl(bestCommonTypeOfConditionalExpressions.ts, 19, 17)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>x : Symbol(x, Decl(bestCommonTypeOfConditionalExpressions.ts, 19, 38)) + +var r10: Base = true ? derived : derived2; // no error since we use the contextual type in BCT +>r10 : Symbol(r10, Decl(bestCommonTypeOfConditionalExpressions.ts, 20, 3)) +>Base : Symbol(Base, Decl(bestCommonTypeOfConditionalExpressions.ts, 4, 33)) +>derived : Symbol(derived, Decl(bestCommonTypeOfConditionalExpressions.ts, 10, 3)) +>derived2 : Symbol(derived2, Decl(bestCommonTypeOfConditionalExpressions.ts, 11, 3)) + +var r11 = true ? base : derived2; +>r11 : Symbol(r11, Decl(bestCommonTypeOfConditionalExpressions.ts, 21, 3)) +>base : Symbol(base, Decl(bestCommonTypeOfConditionalExpressions.ts, 9, 3)) +>derived2 : Symbol(derived2, Decl(bestCommonTypeOfConditionalExpressions.ts, 11, 3)) + +function foo5(t: T, u: U): Object { +>foo5 : Symbol(foo5, Decl(bestCommonTypeOfConditionalExpressions.ts, 21, 33)) +>T : Symbol(T, Decl(bestCommonTypeOfConditionalExpressions.ts, 23, 14)) +>U : Symbol(U, Decl(bestCommonTypeOfConditionalExpressions.ts, 23, 16)) +>t : Symbol(t, Decl(bestCommonTypeOfConditionalExpressions.ts, 23, 20)) +>T : Symbol(T, Decl(bestCommonTypeOfConditionalExpressions.ts, 23, 14)) +>u : Symbol(u, Decl(bestCommonTypeOfConditionalExpressions.ts, 23, 25)) +>U : Symbol(U, Decl(bestCommonTypeOfConditionalExpressions.ts, 23, 16)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + return true ? t : u; // BCT is Object +>t : Symbol(t, Decl(bestCommonTypeOfConditionalExpressions.ts, 23, 20)) +>u : Symbol(u, Decl(bestCommonTypeOfConditionalExpressions.ts, 23, 25)) +} diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types index eb94c140883..2a5ee6a2fe2 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types @@ -41,27 +41,35 @@ var derived2: Derived2; var r = true ? 1 : 2; >r : number >true ? 1 : 2 : number +>true : boolean +>1 : number +>2 : number var r3 = true ? 1 : {}; >r3 : {} >true ? 1 : {} : {} +>true : boolean +>1 : number >{} : {} var r4 = true ? a : b; // typeof a >r4 : { x: number; y?: number; } | { x: number; z?: number; } >true ? a : b : { x: number; y?: number; } | { x: number; z?: number; } +>true : boolean >a : { x: number; y?: number; } >b : { x: number; z?: number; } var r5 = true ? b : a; // typeof b >r5 : { x: number; y?: number; } | { x: number; z?: number; } >true ? b : a : { x: number; y?: number; } | { x: number; z?: number; } +>true : boolean >b : { x: number; z?: number; } >a : { x: number; y?: number; } var r6 = true ? (x: number) => { } : (x: Object) => { }; // returns number => void >r6 : (x: number) => void >true ? (x: number) => { } : (x: Object) => { } : (x: number) => void +>true : boolean >(x: number) => { } : (x: number) => void >x : number >(x: Object) => { } : (x: Object) => void @@ -73,6 +81,7 @@ var r7: (x: Object) => void = true ? (x: number) => { } : (x: Object) => { }; >x : Object >Object : Object >true ? (x: number) => { } : (x: Object) => { } : (x: number) => void +>true : boolean >(x: number) => { } : (x: number) => void >x : number >(x: Object) => { } : (x: Object) => void @@ -82,6 +91,7 @@ var r7: (x: Object) => void = true ? (x: number) => { } : (x: Object) => { }; var r8 = true ? (x: Object) => { } : (x: number) => { }; // returns Object => void >r8 : (x: Object) => void >true ? (x: Object) => { } : (x: number) => { } : (x: Object) => void +>true : boolean >(x: Object) => { } : (x: Object) => void >x : Object >Object : Object @@ -92,12 +102,14 @@ var r10: Base = true ? derived : derived2; // no error since we use the contextu >r10 : Base >Base : Base >true ? derived : derived2 : Derived | Derived2 +>true : boolean >derived : Derived >derived2 : Derived2 var r11 = true ? base : derived2; >r11 : Base >true ? base : derived2 : Base +>true : boolean >base : Base >derived2 : Derived2 @@ -113,6 +125,7 @@ function foo5(t: T, u: U): Object { return true ? t : u; // BCT is Object >true ? t : u : T | U +>true : boolean >t : T >u : U } diff --git a/tests/baselines/reference/bestCommonTypeOfTuple.symbols b/tests/baselines/reference/bestCommonTypeOfTuple.symbols new file mode 100644 index 00000000000..59549da0cac --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeOfTuple.symbols @@ -0,0 +1,84 @@ +=== tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple.ts === +function f1(x: number): string { return "foo"; } +>f1 : Symbol(f1, Decl(bestCommonTypeOfTuple.ts, 0, 0)) +>x : Symbol(x, Decl(bestCommonTypeOfTuple.ts, 0, 12)) + +function f2(x: number): number { return 10; } +>f2 : Symbol(f2, Decl(bestCommonTypeOfTuple.ts, 0, 48)) +>x : Symbol(x, Decl(bestCommonTypeOfTuple.ts, 2, 12)) + +function f3(x: number): boolean { return true; } +>f3 : Symbol(f3, Decl(bestCommonTypeOfTuple.ts, 2, 45)) +>x : Symbol(x, Decl(bestCommonTypeOfTuple.ts, 4, 12)) + +enum E1 { one } +>E1 : Symbol(E1, Decl(bestCommonTypeOfTuple.ts, 4, 48)) +>one : Symbol(E1.one, Decl(bestCommonTypeOfTuple.ts, 6, 9)) + +enum E2 { two } +>E2 : Symbol(E2, Decl(bestCommonTypeOfTuple.ts, 6, 15)) +>two : Symbol(E2.two, Decl(bestCommonTypeOfTuple.ts, 8, 9)) + + +var t1: [(x: number) => string, (x: number) => number]; +>t1 : Symbol(t1, Decl(bestCommonTypeOfTuple.ts, 11, 3)) +>x : Symbol(x, Decl(bestCommonTypeOfTuple.ts, 11, 10)) +>x : Symbol(x, Decl(bestCommonTypeOfTuple.ts, 11, 33)) + +var t2: [E1, E2]; +>t2 : Symbol(t2, Decl(bestCommonTypeOfTuple.ts, 12, 3)) +>E1 : Symbol(E1, Decl(bestCommonTypeOfTuple.ts, 4, 48)) +>E2 : Symbol(E2, Decl(bestCommonTypeOfTuple.ts, 6, 15)) + +var t3: [number, any]; +>t3 : Symbol(t3, Decl(bestCommonTypeOfTuple.ts, 13, 3)) + +var t4: [E1, E2, number]; +>t4 : Symbol(t4, Decl(bestCommonTypeOfTuple.ts, 14, 3)) +>E1 : Symbol(E1, Decl(bestCommonTypeOfTuple.ts, 4, 48)) +>E2 : Symbol(E2, Decl(bestCommonTypeOfTuple.ts, 6, 15)) + +// no error +t1 = [f1, f2]; +>t1 : Symbol(t1, Decl(bestCommonTypeOfTuple.ts, 11, 3)) +>f1 : Symbol(f1, Decl(bestCommonTypeOfTuple.ts, 0, 0)) +>f2 : Symbol(f2, Decl(bestCommonTypeOfTuple.ts, 0, 48)) + +t2 = [E1.one, E2.two]; +>t2 : Symbol(t2, Decl(bestCommonTypeOfTuple.ts, 12, 3)) +>E1.one : Symbol(E1.one, Decl(bestCommonTypeOfTuple.ts, 6, 9)) +>E1 : Symbol(E1, Decl(bestCommonTypeOfTuple.ts, 4, 48)) +>one : Symbol(E1.one, Decl(bestCommonTypeOfTuple.ts, 6, 9)) +>E2.two : Symbol(E2.two, Decl(bestCommonTypeOfTuple.ts, 8, 9)) +>E2 : Symbol(E2, Decl(bestCommonTypeOfTuple.ts, 6, 15)) +>two : Symbol(E2.two, Decl(bestCommonTypeOfTuple.ts, 8, 9)) + +t3 = [5, undefined]; +>t3 : Symbol(t3, Decl(bestCommonTypeOfTuple.ts, 13, 3)) +>undefined : Symbol(undefined) + +t4 = [E1.one, E2.two, 20]; +>t4 : Symbol(t4, Decl(bestCommonTypeOfTuple.ts, 14, 3)) +>E1.one : Symbol(E1.one, Decl(bestCommonTypeOfTuple.ts, 6, 9)) +>E1 : Symbol(E1, Decl(bestCommonTypeOfTuple.ts, 4, 48)) +>one : Symbol(E1.one, Decl(bestCommonTypeOfTuple.ts, 6, 9)) +>E2.two : Symbol(E2.two, Decl(bestCommonTypeOfTuple.ts, 8, 9)) +>E2 : Symbol(E2, Decl(bestCommonTypeOfTuple.ts, 6, 15)) +>two : Symbol(E2.two, Decl(bestCommonTypeOfTuple.ts, 8, 9)) + +var e1 = t1[2]; // {} +>e1 : Symbol(e1, Decl(bestCommonTypeOfTuple.ts, 21, 3)) +>t1 : Symbol(t1, Decl(bestCommonTypeOfTuple.ts, 11, 3)) + +var e2 = t2[2]; // {} +>e2 : Symbol(e2, Decl(bestCommonTypeOfTuple.ts, 22, 3)) +>t2 : Symbol(t2, Decl(bestCommonTypeOfTuple.ts, 12, 3)) + +var e3 = t3[2]; // any +>e3 : Symbol(e3, Decl(bestCommonTypeOfTuple.ts, 23, 3)) +>t3 : Symbol(t3, Decl(bestCommonTypeOfTuple.ts, 13, 3)) + +var e4 = t4[3]; // number +>e4 : Symbol(e4, Decl(bestCommonTypeOfTuple.ts, 24, 3)) +>t4 : Symbol(t4, Decl(bestCommonTypeOfTuple.ts, 14, 3)) + diff --git a/tests/baselines/reference/bestCommonTypeOfTuple.types b/tests/baselines/reference/bestCommonTypeOfTuple.types index 0516fc4af2b..7b7302a9cc2 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple.types +++ b/tests/baselines/reference/bestCommonTypeOfTuple.types @@ -2,14 +2,17 @@ function f1(x: number): string { return "foo"; } >f1 : (x: number) => string >x : number +>"foo" : string function f2(x: number): number { return 10; } >f2 : (x: number) => number >x : number +>10 : number function f3(x: number): boolean { return true; } >f3 : (x: number) => boolean >x : number +>true : boolean enum E1 { one } >E1 : E1 @@ -61,6 +64,7 @@ t3 = [5, undefined]; >t3 = [5, undefined] : [number, undefined] >t3 : [number, any] >[5, undefined] : [number, undefined] +>5 : number >undefined : undefined t4 = [E1.one, E2.two, 20]; @@ -73,24 +77,29 @@ t4 = [E1.one, E2.two, 20]; >E2.two : E2 >E2 : typeof E2 >two : E2 +>20 : number var e1 = t1[2]; // {} >e1 : ((x: number) => string) | ((x: number) => number) >t1[2] : ((x: number) => string) | ((x: number) => number) >t1 : [(x: number) => string, (x: number) => number] +>2 : number var e2 = t2[2]; // {} >e2 : E1 | E2 >t2[2] : E1 | E2 >t2 : [E1, E2] +>2 : number var e3 = t3[2]; // any >e3 : any >t3[2] : any >t3 : [number, any] +>2 : number var e4 = t4[3]; // number >e4 : number >t4[3] : number >t4 : [E1, E2, number] +>3 : number diff --git a/tests/baselines/reference/bestCommonTypeOfTuple2.symbols b/tests/baselines/reference/bestCommonTypeOfTuple2.symbols new file mode 100644 index 00000000000..842d07c417c --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeOfTuple2.symbols @@ -0,0 +1,85 @@ +=== tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple2.ts === +interface base { } +>base : Symbol(base, Decl(bestCommonTypeOfTuple2.ts, 0, 0)) + +interface base1 { i } +>base1 : Symbol(base1, Decl(bestCommonTypeOfTuple2.ts, 0, 18)) +>i : Symbol(i, Decl(bestCommonTypeOfTuple2.ts, 1, 17)) + +class C implements base { c } +>C : Symbol(C, Decl(bestCommonTypeOfTuple2.ts, 1, 21)) +>base : Symbol(base, Decl(bestCommonTypeOfTuple2.ts, 0, 0)) +>c : Symbol(c, Decl(bestCommonTypeOfTuple2.ts, 2, 25)) + +class D implements base { d } +>D : Symbol(D, Decl(bestCommonTypeOfTuple2.ts, 2, 29)) +>base : Symbol(base, Decl(bestCommonTypeOfTuple2.ts, 0, 0)) +>d : Symbol(d, Decl(bestCommonTypeOfTuple2.ts, 3, 25)) + +class E implements base { e } +>E : Symbol(E, Decl(bestCommonTypeOfTuple2.ts, 3, 29)) +>base : Symbol(base, Decl(bestCommonTypeOfTuple2.ts, 0, 0)) +>e : Symbol(e, Decl(bestCommonTypeOfTuple2.ts, 4, 25)) + +class F extends C { f } +>F : Symbol(F, Decl(bestCommonTypeOfTuple2.ts, 4, 29)) +>C : Symbol(C, Decl(bestCommonTypeOfTuple2.ts, 1, 21)) +>f : Symbol(f, Decl(bestCommonTypeOfTuple2.ts, 5, 19)) + +class C1 implements base1 { i = "foo"; c } +>C1 : Symbol(C1, Decl(bestCommonTypeOfTuple2.ts, 5, 23)) +>base1 : Symbol(base1, Decl(bestCommonTypeOfTuple2.ts, 0, 18)) +>i : Symbol(i, Decl(bestCommonTypeOfTuple2.ts, 7, 27)) +>c : Symbol(c, Decl(bestCommonTypeOfTuple2.ts, 7, 38)) + +class D1 extends C1 { i = "bar"; d } +>D1 : Symbol(D1, Decl(bestCommonTypeOfTuple2.ts, 7, 42)) +>C1 : Symbol(C1, Decl(bestCommonTypeOfTuple2.ts, 5, 23)) +>i : Symbol(i, Decl(bestCommonTypeOfTuple2.ts, 8, 21)) +>d : Symbol(d, Decl(bestCommonTypeOfTuple2.ts, 8, 32)) + +var t1: [C, base]; +>t1 : Symbol(t1, Decl(bestCommonTypeOfTuple2.ts, 10, 3)) +>C : Symbol(C, Decl(bestCommonTypeOfTuple2.ts, 1, 21)) +>base : Symbol(base, Decl(bestCommonTypeOfTuple2.ts, 0, 0)) + +var t2: [C, D]; +>t2 : Symbol(t2, Decl(bestCommonTypeOfTuple2.ts, 11, 3)) +>C : Symbol(C, Decl(bestCommonTypeOfTuple2.ts, 1, 21)) +>D : Symbol(D, Decl(bestCommonTypeOfTuple2.ts, 2, 29)) + +var t3: [C1, D1]; +>t3 : Symbol(t3, Decl(bestCommonTypeOfTuple2.ts, 12, 3)) +>C1 : Symbol(C1, Decl(bestCommonTypeOfTuple2.ts, 5, 23)) +>D1 : Symbol(D1, Decl(bestCommonTypeOfTuple2.ts, 7, 42)) + +var t4: [base1, C1]; +>t4 : Symbol(t4, Decl(bestCommonTypeOfTuple2.ts, 13, 3)) +>base1 : Symbol(base1, Decl(bestCommonTypeOfTuple2.ts, 0, 18)) +>C1 : Symbol(C1, Decl(bestCommonTypeOfTuple2.ts, 5, 23)) + +var t5: [C1, F] +>t5 : Symbol(t5, Decl(bestCommonTypeOfTuple2.ts, 14, 3)) +>C1 : Symbol(C1, Decl(bestCommonTypeOfTuple2.ts, 5, 23)) +>F : Symbol(F, Decl(bestCommonTypeOfTuple2.ts, 4, 29)) + +var e11 = t1[4]; // base +>e11 : Symbol(e11, Decl(bestCommonTypeOfTuple2.ts, 16, 3)) +>t1 : Symbol(t1, Decl(bestCommonTypeOfTuple2.ts, 10, 3)) + +var e21 = t2[4]; // {} +>e21 : Symbol(e21, Decl(bestCommonTypeOfTuple2.ts, 17, 3)) +>t2 : Symbol(t2, Decl(bestCommonTypeOfTuple2.ts, 11, 3)) + +var e31 = t3[4]; // C1 +>e31 : Symbol(e31, Decl(bestCommonTypeOfTuple2.ts, 18, 3)) +>t3 : Symbol(t3, Decl(bestCommonTypeOfTuple2.ts, 12, 3)) + +var e41 = t4[2]; // base1 +>e41 : Symbol(e41, Decl(bestCommonTypeOfTuple2.ts, 19, 3)) +>t4 : Symbol(t4, Decl(bestCommonTypeOfTuple2.ts, 13, 3)) + +var e51 = t5[2]; // {} +>e51 : Symbol(e51, Decl(bestCommonTypeOfTuple2.ts, 20, 3)) +>t5 : Symbol(t5, Decl(bestCommonTypeOfTuple2.ts, 14, 3)) + diff --git a/tests/baselines/reference/bestCommonTypeOfTuple2.types b/tests/baselines/reference/bestCommonTypeOfTuple2.types index a87407e98fc..32196fdf668 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple2.types +++ b/tests/baselines/reference/bestCommonTypeOfTuple2.types @@ -30,12 +30,14 @@ class C1 implements base1 { i = "foo"; c } >C1 : C1 >base1 : base1 >i : string +>"foo" : string >c : any class D1 extends C1 { i = "bar"; d } >D1 : D1 >C1 : C1 >i : string +>"bar" : string >d : any var t1: [C, base]; @@ -67,24 +69,29 @@ var e11 = t1[4]; // base >e11 : base >t1[4] : base >t1 : [C, base] +>4 : number var e21 = t2[4]; // {} >e21 : C | D >t2[4] : C | D >t2 : [C, D] +>4 : number var e31 = t3[4]; // C1 >e31 : C1 >t3[4] : C1 >t3 : [C1, D1] +>4 : number var e41 = t4[2]; // base1 >e41 : base1 >t4[2] : base1 >t4 : [base1, C1] +>2 : number var e51 = t5[2]; // {} >e51 : F | C1 >t5[2] : F | C1 >t5 : [C1, F] +>2 : number diff --git a/tests/baselines/reference/bestCommonTypeReturnStatement.symbols b/tests/baselines/reference/bestCommonTypeReturnStatement.symbols new file mode 100644 index 00000000000..43e04ef037d --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeReturnStatement.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/bestCommonTypeReturnStatement.ts === +interface IPromise { +>IPromise : Symbol(IPromise, Decl(bestCommonTypeReturnStatement.ts, 0, 0)) +>T : Symbol(T, Decl(bestCommonTypeReturnStatement.ts, 0, 19)) + + then(successCallback: (promiseValue: T) => any, errorCallback?: (reason: any) => any): IPromise; +>then : Symbol(then, Decl(bestCommonTypeReturnStatement.ts, 0, 23)) +>successCallback : Symbol(successCallback, Decl(bestCommonTypeReturnStatement.ts, 1, 9)) +>promiseValue : Symbol(promiseValue, Decl(bestCommonTypeReturnStatement.ts, 1, 27)) +>T : Symbol(T, Decl(bestCommonTypeReturnStatement.ts, 0, 19)) +>errorCallback : Symbol(errorCallback, Decl(bestCommonTypeReturnStatement.ts, 1, 51)) +>reason : Symbol(reason, Decl(bestCommonTypeReturnStatement.ts, 1, 69)) +>IPromise : Symbol(IPromise, Decl(bestCommonTypeReturnStatement.ts, 0, 0)) +} + +function f() { +>f : Symbol(f, Decl(bestCommonTypeReturnStatement.ts, 2, 1)) + + if (true) return b(); +>b : Symbol(b, Decl(bestCommonTypeReturnStatement.ts, 7, 1)) + + return d(); +>d : Symbol(d, Decl(bestCommonTypeReturnStatement.ts, 10, 45)) +} + + +function b(): IPromise { return null; } +>b : Symbol(b, Decl(bestCommonTypeReturnStatement.ts, 7, 1)) +>IPromise : Symbol(IPromise, Decl(bestCommonTypeReturnStatement.ts, 0, 0)) + +function d(): IPromise { return null; } +>d : Symbol(d, Decl(bestCommonTypeReturnStatement.ts, 10, 45)) +>IPromise : Symbol(IPromise, Decl(bestCommonTypeReturnStatement.ts, 0, 0)) + diff --git a/tests/baselines/reference/bestCommonTypeReturnStatement.types b/tests/baselines/reference/bestCommonTypeReturnStatement.types index 3c260ea709b..28974f064a5 100644 --- a/tests/baselines/reference/bestCommonTypeReturnStatement.types +++ b/tests/baselines/reference/bestCommonTypeReturnStatement.types @@ -17,6 +17,7 @@ function f() { >f : () => IPromise if (true) return b(); +>true : boolean >b() : IPromise >b : () => IPromise @@ -29,8 +30,10 @@ function f() { function b(): IPromise { return null; } >b : () => IPromise >IPromise : IPromise +>null : null function d(): IPromise { return null; } >d : () => IPromise >IPromise : IPromise +>null : null diff --git a/tests/baselines/reference/bestCommonTypeWithContextualTyping.symbols b/tests/baselines/reference/bestCommonTypeWithContextualTyping.symbols new file mode 100644 index 00000000000..cfa5310bd3c --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeWithContextualTyping.symbols @@ -0,0 +1,52 @@ +=== tests/cases/compiler/bestCommonTypeWithContextualTyping.ts === +interface Contextual { +>Contextual : Symbol(Contextual, Decl(bestCommonTypeWithContextualTyping.ts, 0, 0)) + + dummy; +>dummy : Symbol(dummy, Decl(bestCommonTypeWithContextualTyping.ts, 0, 22)) + + p?: number; +>p : Symbol(p, Decl(bestCommonTypeWithContextualTyping.ts, 1, 10)) +} + +interface Ellement { +>Ellement : Symbol(Ellement, Decl(bestCommonTypeWithContextualTyping.ts, 3, 1)) + + dummy; +>dummy : Symbol(dummy, Decl(bestCommonTypeWithContextualTyping.ts, 5, 20)) + + p: any; +>p : Symbol(p, Decl(bestCommonTypeWithContextualTyping.ts, 6, 10)) +} + +var e: Ellement; +>e : Symbol(e, Decl(bestCommonTypeWithContextualTyping.ts, 10, 3)) +>Ellement : Symbol(Ellement, Decl(bestCommonTypeWithContextualTyping.ts, 3, 1)) + +// 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: Contextual[] = [e]; // Ellement[] +>arr : Symbol(arr, Decl(bestCommonTypeWithContextualTyping.ts, 15, 3)) +>Contextual : Symbol(Contextual, Decl(bestCommonTypeWithContextualTyping.ts, 0, 0)) +>e : Symbol(e, Decl(bestCommonTypeWithContextualTyping.ts, 10, 3)) + +var obj: { [s: string]: Contextual } = { s: e }; // { s: Ellement; [s: string]: Ellement } +>obj : Symbol(obj, Decl(bestCommonTypeWithContextualTyping.ts, 16, 3)) +>s : Symbol(s, Decl(bestCommonTypeWithContextualTyping.ts, 16, 12)) +>Contextual : Symbol(Contextual, Decl(bestCommonTypeWithContextualTyping.ts, 0, 0)) +>s : Symbol(s, Decl(bestCommonTypeWithContextualTyping.ts, 16, 40)) +>e : Symbol(e, Decl(bestCommonTypeWithContextualTyping.ts, 10, 3)) + +var conditional: Contextual = null ? e : e; // Ellement +>conditional : Symbol(conditional, Decl(bestCommonTypeWithContextualTyping.ts, 18, 3)) +>Contextual : Symbol(Contextual, Decl(bestCommonTypeWithContextualTyping.ts, 0, 0)) +>e : Symbol(e, Decl(bestCommonTypeWithContextualTyping.ts, 10, 3)) +>e : Symbol(e, Decl(bestCommonTypeWithContextualTyping.ts, 10, 3)) + +var contextualOr: Contextual = e || e; // Ellement +>contextualOr : Symbol(contextualOr, Decl(bestCommonTypeWithContextualTyping.ts, 19, 3)) +>Contextual : Symbol(Contextual, Decl(bestCommonTypeWithContextualTyping.ts, 0, 0)) +>e : Symbol(e, Decl(bestCommonTypeWithContextualTyping.ts, 10, 3)) +>e : Symbol(e, Decl(bestCommonTypeWithContextualTyping.ts, 10, 3)) + diff --git a/tests/baselines/reference/bestCommonTypeWithContextualTyping.types b/tests/baselines/reference/bestCommonTypeWithContextualTyping.types index 606cbae9231..628fe82012a 100644 --- a/tests/baselines/reference/bestCommonTypeWithContextualTyping.types +++ b/tests/baselines/reference/bestCommonTypeWithContextualTyping.types @@ -44,6 +44,7 @@ var conditional: Contextual = null ? e : e; // Ellement >conditional : Contextual >Contextual : Contextual >null ? e : e : Ellement +>null : null >e : Ellement >e : Ellement diff --git a/tests/baselines/reference/bestCommonTypeWithOptionalProperties.symbols b/tests/baselines/reference/bestCommonTypeWithOptionalProperties.symbols new file mode 100644 index 00000000000..35e9534ddb5 --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeWithOptionalProperties.symbols @@ -0,0 +1,64 @@ +=== tests/cases/compiler/bestCommonTypeWithOptionalProperties.ts === +interface X { foo: string } +>X : Symbol(X, Decl(bestCommonTypeWithOptionalProperties.ts, 0, 0)) +>foo : Symbol(foo, Decl(bestCommonTypeWithOptionalProperties.ts, 0, 13)) + +interface Y extends X { bar?: number } +>Y : Symbol(Y, Decl(bestCommonTypeWithOptionalProperties.ts, 0, 27)) +>X : Symbol(X, Decl(bestCommonTypeWithOptionalProperties.ts, 0, 0)) +>bar : Symbol(bar, Decl(bestCommonTypeWithOptionalProperties.ts, 1, 23)) + +interface Z extends X { bar: string } +>Z : Symbol(Z, Decl(bestCommonTypeWithOptionalProperties.ts, 1, 38)) +>X : Symbol(X, Decl(bestCommonTypeWithOptionalProperties.ts, 0, 0)) +>bar : Symbol(bar, Decl(bestCommonTypeWithOptionalProperties.ts, 2, 23)) + +var x: X; +>x : Symbol(x, Decl(bestCommonTypeWithOptionalProperties.ts, 4, 3)) +>X : Symbol(X, Decl(bestCommonTypeWithOptionalProperties.ts, 0, 0)) + +var y: Y; +>y : Symbol(y, Decl(bestCommonTypeWithOptionalProperties.ts, 5, 3)) +>Y : Symbol(Y, Decl(bestCommonTypeWithOptionalProperties.ts, 0, 27)) + +var z: Z; +>z : Symbol(z, Decl(bestCommonTypeWithOptionalProperties.ts, 6, 3)) +>Z : Symbol(Z, Decl(bestCommonTypeWithOptionalProperties.ts, 1, 38)) + +// All these arrays should be X[] +var b1 = [x, y, z]; +>b1 : Symbol(b1, Decl(bestCommonTypeWithOptionalProperties.ts, 9, 3)) +>x : Symbol(x, Decl(bestCommonTypeWithOptionalProperties.ts, 4, 3)) +>y : Symbol(y, Decl(bestCommonTypeWithOptionalProperties.ts, 5, 3)) +>z : Symbol(z, Decl(bestCommonTypeWithOptionalProperties.ts, 6, 3)) + +var b2 = [x, z, y]; +>b2 : Symbol(b2, Decl(bestCommonTypeWithOptionalProperties.ts, 10, 3)) +>x : Symbol(x, Decl(bestCommonTypeWithOptionalProperties.ts, 4, 3)) +>z : Symbol(z, Decl(bestCommonTypeWithOptionalProperties.ts, 6, 3)) +>y : Symbol(y, Decl(bestCommonTypeWithOptionalProperties.ts, 5, 3)) + +var b3 = [y, x, z]; +>b3 : Symbol(b3, Decl(bestCommonTypeWithOptionalProperties.ts, 11, 3)) +>y : Symbol(y, Decl(bestCommonTypeWithOptionalProperties.ts, 5, 3)) +>x : Symbol(x, Decl(bestCommonTypeWithOptionalProperties.ts, 4, 3)) +>z : Symbol(z, Decl(bestCommonTypeWithOptionalProperties.ts, 6, 3)) + +var b4 = [y, z, x]; +>b4 : Symbol(b4, Decl(bestCommonTypeWithOptionalProperties.ts, 12, 3)) +>y : Symbol(y, Decl(bestCommonTypeWithOptionalProperties.ts, 5, 3)) +>z : Symbol(z, Decl(bestCommonTypeWithOptionalProperties.ts, 6, 3)) +>x : Symbol(x, Decl(bestCommonTypeWithOptionalProperties.ts, 4, 3)) + +var b5 = [z, x, y]; +>b5 : Symbol(b5, Decl(bestCommonTypeWithOptionalProperties.ts, 13, 3)) +>z : Symbol(z, Decl(bestCommonTypeWithOptionalProperties.ts, 6, 3)) +>x : Symbol(x, Decl(bestCommonTypeWithOptionalProperties.ts, 4, 3)) +>y : Symbol(y, Decl(bestCommonTypeWithOptionalProperties.ts, 5, 3)) + +var b6 = [z, y, x]; +>b6 : Symbol(b6, Decl(bestCommonTypeWithOptionalProperties.ts, 14, 3)) +>z : Symbol(z, Decl(bestCommonTypeWithOptionalProperties.ts, 6, 3)) +>y : Symbol(y, Decl(bestCommonTypeWithOptionalProperties.ts, 5, 3)) +>x : Symbol(x, Decl(bestCommonTypeWithOptionalProperties.ts, 4, 3)) + diff --git a/tests/baselines/reference/binaryArithmatic1.symbols b/tests/baselines/reference/binaryArithmatic1.symbols new file mode 100644 index 00000000000..380a2ce95c1 --- /dev/null +++ b/tests/baselines/reference/binaryArithmatic1.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/binaryArithmatic1.ts === +var v = 4 | null; +>v : Symbol(v, Decl(binaryArithmatic1.ts, 0, 3)) + diff --git a/tests/baselines/reference/binaryArithmatic1.types b/tests/baselines/reference/binaryArithmatic1.types index 2aec9528116..43f4f26de60 100644 --- a/tests/baselines/reference/binaryArithmatic1.types +++ b/tests/baselines/reference/binaryArithmatic1.types @@ -2,4 +2,6 @@ var v = 4 | null; >v : number >4 | null : number +>4 : number +>null : null diff --git a/tests/baselines/reference/binaryArithmatic2.symbols b/tests/baselines/reference/binaryArithmatic2.symbols new file mode 100644 index 00000000000..7c2756f30f6 --- /dev/null +++ b/tests/baselines/reference/binaryArithmatic2.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/binaryArithmatic2.ts === +var v = 4 | undefined; +>v : Symbol(v, Decl(binaryArithmatic2.ts, 0, 3)) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/binaryArithmatic2.types b/tests/baselines/reference/binaryArithmatic2.types index 9fe3350fc24..77cbce5b1e3 100644 --- a/tests/baselines/reference/binaryArithmatic2.types +++ b/tests/baselines/reference/binaryArithmatic2.types @@ -2,5 +2,6 @@ var v = 4 | undefined; >v : number >4 | undefined : number +>4 : number >undefined : undefined diff --git a/tests/baselines/reference/binaryIntegerLiteral.symbols b/tests/baselines/reference/binaryIntegerLiteral.symbols new file mode 100644 index 00000000000..31e28819657 --- /dev/null +++ b/tests/baselines/reference/binaryIntegerLiteral.symbols @@ -0,0 +1,117 @@ +=== tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteral.ts === +var bin1 = 0b11010; +>bin1 : Symbol(bin1, Decl(binaryIntegerLiteral.ts, 0, 3)) + +var bin2 = 0B11010; +>bin2 : Symbol(bin2, Decl(binaryIntegerLiteral.ts, 1, 3)) + +var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111; +>bin3 : Symbol(bin3, Decl(binaryIntegerLiteral.ts, 2, 3)) + +var bin4 = 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111; +>bin4 : Symbol(bin4, Decl(binaryIntegerLiteral.ts, 3, 3)) + +var obj1 = { +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteral.ts, 5, 3)) + + 0b11010: "Hello", + a: bin1, +>a : Symbol(a, Decl(binaryIntegerLiteral.ts, 6, 21)) +>bin1 : Symbol(bin1, Decl(binaryIntegerLiteral.ts, 0, 3)) + + bin1, +>bin1 : Symbol(bin1, Decl(binaryIntegerLiteral.ts, 7, 12)) + + b: 0b11010, +>b : Symbol(b, Decl(binaryIntegerLiteral.ts, 8, 9)) + + 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true, +} + +var obj2 = { +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteral.ts, 13, 3)) + + 0B11010: "World", + a: bin2, +>a : Symbol(a, Decl(binaryIntegerLiteral.ts, 14, 21)) +>bin2 : Symbol(bin2, Decl(binaryIntegerLiteral.ts, 1, 3)) + + bin2, +>bin2 : Symbol(bin2, Decl(binaryIntegerLiteral.ts, 15, 12)) + + b: 0B11010, +>b : Symbol(b, Decl(binaryIntegerLiteral.ts, 16, 9)) + + 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false, +} + +obj1[0b11010]; // string +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteral.ts, 5, 3)) +>0b11010 : Symbol(0b11010, Decl(binaryIntegerLiteral.ts, 5, 12)) + +obj1[26]; // string +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteral.ts, 5, 3)) +>26 : Symbol(0b11010, Decl(binaryIntegerLiteral.ts, 5, 12)) + +obj1["26"]; // string +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteral.ts, 5, 3)) +>"26" : Symbol(0b11010, Decl(binaryIntegerLiteral.ts, 5, 12)) + +obj1["0b11010"]; // any +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteral.ts, 5, 3)) + +obj1["a"]; // number +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteral.ts, 5, 3)) +>"a" : Symbol(a, Decl(binaryIntegerLiteral.ts, 6, 21)) + +obj1["b"]; // number +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteral.ts, 5, 3)) +>"b" : Symbol(b, Decl(binaryIntegerLiteral.ts, 8, 9)) + +obj1["bin1"]; // number +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteral.ts, 5, 3)) +>"bin1" : Symbol(bin1, Decl(binaryIntegerLiteral.ts, 7, 12)) + +obj1["Infinity"]; // boolean +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteral.ts, 5, 3)) +>"Infinity" : Symbol(0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111, Decl(binaryIntegerLiteral.ts, 9, 15)) + +obj2[0B11010]; // string +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteral.ts, 13, 3)) +>0B11010 : Symbol(0B11010, Decl(binaryIntegerLiteral.ts, 13, 12)) + +obj2[26]; // string +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteral.ts, 13, 3)) +>26 : Symbol(0B11010, Decl(binaryIntegerLiteral.ts, 13, 12)) + +obj2["26"]; // string +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteral.ts, 13, 3)) +>"26" : Symbol(0B11010, Decl(binaryIntegerLiteral.ts, 13, 12)) + +obj2["0B11010"]; // any +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteral.ts, 13, 3)) + +obj2["a"]; // number +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteral.ts, 13, 3)) +>"a" : Symbol(a, Decl(binaryIntegerLiteral.ts, 14, 21)) + +obj2["b"]; // number +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteral.ts, 13, 3)) +>"b" : Symbol(b, Decl(binaryIntegerLiteral.ts, 16, 9)) + +obj2["bin2"]; // number +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteral.ts, 13, 3)) +>"bin2" : Symbol(bin2, Decl(binaryIntegerLiteral.ts, 15, 12)) + +obj2[9.671406556917009e+24]; // boolean +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteral.ts, 13, 3)) +>9.671406556917009e+24 : Symbol(0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111, Decl(binaryIntegerLiteral.ts, 17, 15)) + +obj2["9.671406556917009e+24"]; // boolean +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteral.ts, 13, 3)) +>"9.671406556917009e+24" : Symbol(0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111, Decl(binaryIntegerLiteral.ts, 17, 15)) + +obj2["Infinity"]; // any +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteral.ts, 13, 3)) + + diff --git a/tests/baselines/reference/binaryIntegerLiteral.types b/tests/baselines/reference/binaryIntegerLiteral.types index f884ecc3a73..4ff3c3c28a3 100644 --- a/tests/baselines/reference/binaryIntegerLiteral.types +++ b/tests/baselines/reference/binaryIntegerLiteral.types @@ -1,21 +1,27 @@ === tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteral.ts === var bin1 = 0b11010; >bin1 : number +>0b11010 : number var bin2 = 0B11010; >bin2 : number +>0B11010 : number var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111; >bin3 : number +>0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111 : number var bin4 = 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111; >bin4 : number +>0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111 : number var obj1 = { >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } >{ 0b11010: "Hello", a: bin1, bin1, b: 0b11010, 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true,} : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } 0b11010: "Hello", +>"Hello" : string + a: bin1, >a : number >bin1 : number @@ -25,8 +31,10 @@ var obj1 = { b: 0b11010, >b : number +>0b11010 : number 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true, +>true : boolean } var obj2 = { @@ -34,6 +42,8 @@ var obj2 = { >{ 0B11010: "World", a: bin2, bin2, b: 0B11010, 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false,} : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } 0B11010: "World", +>"World" : string + a: bin2, >a : number >bin2 : number @@ -43,80 +53,100 @@ var obj2 = { b: 0B11010, >b : number +>0B11010 : number 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false, +>false : boolean } obj1[0b11010]; // string >obj1[0b11010] : string >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>0b11010 : number obj1[26]; // string >obj1[26] : string >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>26 : number obj1["26"]; // string >obj1["26"] : string >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"26" : string obj1["0b11010"]; // any >obj1["0b11010"] : any >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"0b11010" : string obj1["a"]; // number >obj1["a"] : number >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"a" : string obj1["b"]; // number >obj1["b"] : number >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"b" : string obj1["bin1"]; // number >obj1["bin1"] : number >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"bin1" : string obj1["Infinity"]; // boolean >obj1["Infinity"] : boolean >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"Infinity" : string obj2[0B11010]; // string >obj2[0B11010] : string >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>0B11010 : number obj2[26]; // string >obj2[26] : string >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>26 : number obj2["26"]; // string >obj2["26"] : string >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"26" : string obj2["0B11010"]; // any >obj2["0B11010"] : any >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"0B11010" : string obj2["a"]; // number >obj2["a"] : number >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"a" : string obj2["b"]; // number >obj2["b"] : number >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"b" : string obj2["bin2"]; // number >obj2["bin2"] : number >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"bin2" : string obj2[9.671406556917009e+24]; // boolean >obj2[9.671406556917009e+24] : boolean >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>9.671406556917009e+24 : number obj2["9.671406556917009e+24"]; // boolean >obj2["9.671406556917009e+24"] : boolean >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"9.671406556917009e+24" : string obj2["Infinity"]; // any >obj2["Infinity"] : any >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"Infinity" : string diff --git a/tests/baselines/reference/binaryIntegerLiteralES6.symbols b/tests/baselines/reference/binaryIntegerLiteralES6.symbols new file mode 100644 index 00000000000..4fb7aaff82d --- /dev/null +++ b/tests/baselines/reference/binaryIntegerLiteralES6.symbols @@ -0,0 +1,118 @@ +=== tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteralES6.ts === +var bin1 = 0b11010; +>bin1 : Symbol(bin1, Decl(binaryIntegerLiteralES6.ts, 0, 3)) + +var bin2 = 0B11010; +>bin2 : Symbol(bin2, Decl(binaryIntegerLiteralES6.ts, 1, 3)) + +var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111; +>bin3 : Symbol(bin3, Decl(binaryIntegerLiteralES6.ts, 2, 3)) + +var bin4 = 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111; +>bin4 : Symbol(bin4, Decl(binaryIntegerLiteralES6.ts, 3, 3)) + +var obj1 = { +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteralES6.ts, 5, 3)) + + 0b11010: "Hello", + a: bin1, +>a : Symbol(a, Decl(binaryIntegerLiteralES6.ts, 6, 21)) +>bin1 : Symbol(bin1, Decl(binaryIntegerLiteralES6.ts, 0, 3)) + + bin1, +>bin1 : Symbol(bin1, Decl(binaryIntegerLiteralES6.ts, 7, 12)) + + b: 0b11010, +>b : Symbol(b, Decl(binaryIntegerLiteralES6.ts, 8, 9)) + + 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true, +} + +var obj2 = { +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteralES6.ts, 13, 3)) + + 0B11010: "World", + a: bin2, +>a : Symbol(a, Decl(binaryIntegerLiteralES6.ts, 14, 21)) +>bin2 : Symbol(bin2, Decl(binaryIntegerLiteralES6.ts, 1, 3)) + + bin2, +>bin2 : Symbol(bin2, Decl(binaryIntegerLiteralES6.ts, 15, 12)) + + b: 0B11010, +>b : Symbol(b, Decl(binaryIntegerLiteralES6.ts, 16, 9)) + + 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false, +} + +obj1[0b11010]; // string +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteralES6.ts, 5, 3)) +>0b11010 : Symbol(0b11010, Decl(binaryIntegerLiteralES6.ts, 5, 12)) + +obj1[26]; // string +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteralES6.ts, 5, 3)) +>26 : Symbol(0b11010, Decl(binaryIntegerLiteralES6.ts, 5, 12)) + +obj1["26"]; // string +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteralES6.ts, 5, 3)) +>"26" : Symbol(0b11010, Decl(binaryIntegerLiteralES6.ts, 5, 12)) + +obj1["0b11010"]; // any +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteralES6.ts, 5, 3)) + +obj1["a"]; // number +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteralES6.ts, 5, 3)) +>"a" : Symbol(a, Decl(binaryIntegerLiteralES6.ts, 6, 21)) + +obj1["b"]; // number +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteralES6.ts, 5, 3)) +>"b" : Symbol(b, Decl(binaryIntegerLiteralES6.ts, 8, 9)) + +obj1["bin1"]; // number +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteralES6.ts, 5, 3)) +>"bin1" : Symbol(bin1, Decl(binaryIntegerLiteralES6.ts, 7, 12)) + +obj1["Infinity"]; // boolean +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteralES6.ts, 5, 3)) +>"Infinity" : Symbol(0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111, Decl(binaryIntegerLiteralES6.ts, 9, 15)) + +obj2[0B11010]; // string +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteralES6.ts, 13, 3)) +>0B11010 : Symbol(0B11010, Decl(binaryIntegerLiteralES6.ts, 13, 12)) + +obj2[26]; // string +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteralES6.ts, 13, 3)) +>26 : Symbol(0B11010, Decl(binaryIntegerLiteralES6.ts, 13, 12)) + +obj2["26"]; // string +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteralES6.ts, 13, 3)) +>"26" : Symbol(0B11010, Decl(binaryIntegerLiteralES6.ts, 13, 12)) + +obj2["0B11010"]; // any +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteralES6.ts, 13, 3)) + +obj2["a"]; // number +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteralES6.ts, 13, 3)) +>"a" : Symbol(a, Decl(binaryIntegerLiteralES6.ts, 14, 21)) + +obj2["b"]; // number +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteralES6.ts, 13, 3)) +>"b" : Symbol(b, Decl(binaryIntegerLiteralES6.ts, 16, 9)) + +obj2["bin2"]; // number +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteralES6.ts, 13, 3)) +>"bin2" : Symbol(bin2, Decl(binaryIntegerLiteralES6.ts, 15, 12)) + +obj2[9.671406556917009e+24]; // boolean +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteralES6.ts, 13, 3)) +>9.671406556917009e+24 : Symbol(0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111, Decl(binaryIntegerLiteralES6.ts, 17, 15)) + +obj2["9.671406556917009e+24"]; // boolean +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteralES6.ts, 13, 3)) +>"9.671406556917009e+24" : Symbol(0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111, Decl(binaryIntegerLiteralES6.ts, 17, 15)) + +obj2["Infinity"]; // any +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteralES6.ts, 13, 3)) + + + diff --git a/tests/baselines/reference/binaryIntegerLiteralES6.types b/tests/baselines/reference/binaryIntegerLiteralES6.types index 86036ecc42f..47bfe6f548d 100644 --- a/tests/baselines/reference/binaryIntegerLiteralES6.types +++ b/tests/baselines/reference/binaryIntegerLiteralES6.types @@ -1,21 +1,27 @@ === tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteralES6.ts === var bin1 = 0b11010; >bin1 : number +>0b11010 : number var bin2 = 0B11010; >bin2 : number +>0B11010 : number var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111; >bin3 : number +>0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111 : number var bin4 = 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111; >bin4 : number +>0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111 : number var obj1 = { >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } >{ 0b11010: "Hello", a: bin1, bin1, b: 0b11010, 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true,} : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } 0b11010: "Hello", +>"Hello" : string + a: bin1, >a : number >bin1 : number @@ -25,8 +31,10 @@ var obj1 = { b: 0b11010, >b : number +>0b11010 : number 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true, +>true : boolean } var obj2 = { @@ -34,6 +42,8 @@ var obj2 = { >{ 0B11010: "World", a: bin2, bin2, b: 0B11010, 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false,} : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } 0B11010: "World", +>"World" : string + a: bin2, >a : number >bin2 : number @@ -43,81 +53,101 @@ var obj2 = { b: 0B11010, >b : number +>0B11010 : number 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false, +>false : boolean } obj1[0b11010]; // string >obj1[0b11010] : string >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>0b11010 : number obj1[26]; // string >obj1[26] : string >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>26 : number obj1["26"]; // string >obj1["26"] : string >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"26" : string obj1["0b11010"]; // any >obj1["0b11010"] : any >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"0b11010" : string obj1["a"]; // number >obj1["a"] : number >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"a" : string obj1["b"]; // number >obj1["b"] : number >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"b" : string obj1["bin1"]; // number >obj1["bin1"] : number >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"bin1" : string obj1["Infinity"]; // boolean >obj1["Infinity"] : boolean >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"Infinity" : string obj2[0B11010]; // string >obj2[0B11010] : string >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>0B11010 : number obj2[26]; // string >obj2[26] : string >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>26 : number obj2["26"]; // string >obj2["26"] : string >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"26" : string obj2["0B11010"]; // any >obj2["0B11010"] : any >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"0B11010" : string obj2["a"]; // number >obj2["a"] : number >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"a" : string obj2["b"]; // number >obj2["b"] : number >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"b" : string obj2["bin2"]; // number >obj2["bin2"] : number >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"bin2" : string obj2[9.671406556917009e+24]; // boolean >obj2[9.671406556917009e+24] : boolean >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>9.671406556917009e+24 : number obj2["9.671406556917009e+24"]; // boolean >obj2["9.671406556917009e+24"] : boolean >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"9.671406556917009e+24" : string obj2["Infinity"]; // any >obj2["Infinity"] : any >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"Infinity" : string diff --git a/tests/baselines/reference/bind2.symbols b/tests/baselines/reference/bind2.symbols new file mode 100644 index 00000000000..f51d09abcdd --- /dev/null +++ b/tests/baselines/reference/bind2.symbols @@ -0,0 +1,3 @@ +=== tests/cases/compiler/bind2.ts === + +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/binopAssignmentShouldHaveType.symbols b/tests/baselines/reference/binopAssignmentShouldHaveType.symbols new file mode 100644 index 00000000000..d984647149e --- /dev/null +++ b/tests/baselines/reference/binopAssignmentShouldHaveType.symbols @@ -0,0 +1,41 @@ +=== tests/cases/compiler/binopAssignmentShouldHaveType.ts === +declare var console; +>console : Symbol(console, Decl(binopAssignmentShouldHaveType.ts, 0, 11)) + +"use strict"; +module Test { +>Test : Symbol(Test, Decl(binopAssignmentShouldHaveType.ts, 1, 13)) + + export class Bug { +>Bug : Symbol(Bug, Decl(binopAssignmentShouldHaveType.ts, 2, 13)) + + getName():string { +>getName : Symbol(getName, Decl(binopAssignmentShouldHaveType.ts, 3, 19)) + + return "name"; + } + bug() { +>bug : Symbol(bug, Decl(binopAssignmentShouldHaveType.ts, 6, 3)) + + var name:string= null; +>name : Symbol(name, Decl(binopAssignmentShouldHaveType.ts, 8, 6)) + + if ((name= this.getName()).length > 0) { +>(name= this.getName()).length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>name : Symbol(name, Decl(binopAssignmentShouldHaveType.ts, 8, 6)) +>this.getName : Symbol(getName, Decl(binopAssignmentShouldHaveType.ts, 3, 19)) +>this : Symbol(Bug, Decl(binopAssignmentShouldHaveType.ts, 2, 13)) +>getName : Symbol(getName, Decl(binopAssignmentShouldHaveType.ts, 3, 19)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + + console.log(name); +>console : Symbol(console, Decl(binopAssignmentShouldHaveType.ts, 0, 11)) +>name : Symbol(name, Decl(binopAssignmentShouldHaveType.ts, 8, 6)) + } + } + } +} + + + + diff --git a/tests/baselines/reference/binopAssignmentShouldHaveType.types b/tests/baselines/reference/binopAssignmentShouldHaveType.types index cf6966147bc..fdef2fbcabd 100644 --- a/tests/baselines/reference/binopAssignmentShouldHaveType.types +++ b/tests/baselines/reference/binopAssignmentShouldHaveType.types @@ -3,6 +3,8 @@ declare var console; >console : any "use strict"; +>"use strict" : string + module Test { >Test : typeof Test @@ -13,12 +15,14 @@ module Test { >getName : () => string return "name"; +>"name" : string } bug() { >bug : () => void var name:string= null; >name : string +>null : null if ((name= this.getName()).length > 0) { >(name= this.getName()).length > 0 : boolean @@ -31,6 +35,7 @@ module Test { >this : Bug >getName : () => string >length : number +>0 : number console.log(name); >console.log(name) : any diff --git a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.symbols b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.symbols new file mode 100644 index 00000000000..d6a29a11980 --- /dev/null +++ b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.symbols @@ -0,0 +1,89 @@ +=== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithBooleanType.ts === +// ~ operator on boolean type +var BOOLEAN: boolean; +>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 3)) + +function foo(): boolean { return true; } +>foo : Symbol(foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 21)) + +class A { +>A : Symbol(A, Decl(bitwiseNotOperatorWithBooleanType.ts, 3, 40)) + + public a: boolean; +>a : Symbol(a, Decl(bitwiseNotOperatorWithBooleanType.ts, 5, 9)) + + static foo() { return false; } +>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 22)) +} +module M { +>M : Symbol(M, Decl(bitwiseNotOperatorWithBooleanType.ts, 8, 1)) + + export var n: boolean; +>n : Symbol(n, Decl(bitwiseNotOperatorWithBooleanType.ts, 10, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithBooleanType.ts, 13, 3)) +>A : Symbol(A, Decl(bitwiseNotOperatorWithBooleanType.ts, 3, 40)) + +// boolean type var +var ResultIsNumber1 = ~BOOLEAN; +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithBooleanType.ts, 16, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 3)) + +// boolean type literal +var ResultIsNumber2 = ~true; +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithBooleanType.ts, 19, 3)) + +var ResultIsNumber3 = ~{ x: true, y: false }; +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithBooleanType.ts, 20, 3)) +>x : Symbol(x, Decl(bitwiseNotOperatorWithBooleanType.ts, 20, 24)) +>y : Symbol(y, Decl(bitwiseNotOperatorWithBooleanType.ts, 20, 33)) + +// boolean type expressions +var ResultIsNumber4 = ~objA.a; +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithBooleanType.ts, 23, 3)) +>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 5, 9)) +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithBooleanType.ts, 13, 3)) +>a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 5, 9)) + +var ResultIsNumber5 = ~M.n; +>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(bitwiseNotOperatorWithBooleanType.ts, 24, 3)) +>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 10, 14)) +>M : Symbol(M, Decl(bitwiseNotOperatorWithBooleanType.ts, 8, 1)) +>n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 10, 14)) + +var ResultIsNumber6 = ~foo(); +>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(bitwiseNotOperatorWithBooleanType.ts, 25, 3)) +>foo : Symbol(foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 21)) + +var ResultIsNumber7 = ~A.foo(); +>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(bitwiseNotOperatorWithBooleanType.ts, 26, 3)) +>A.foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 22)) +>A : Symbol(A, Decl(bitwiseNotOperatorWithBooleanType.ts, 3, 40)) +>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 22)) + +// multiple ~ operators +var ResultIsNumber8 = ~~BOOLEAN; +>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(bitwiseNotOperatorWithBooleanType.ts, 29, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 3)) + +// miss assignment operators +~true; +~BOOLEAN; +>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 3)) + +~foo(); +>foo : Symbol(foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 21)) + +~true, false; +~objA.a; +>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 5, 9)) +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithBooleanType.ts, 13, 3)) +>a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 5, 9)) + +~M.n; +>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 10, 14)) +>M : Symbol(M, Decl(bitwiseNotOperatorWithBooleanType.ts, 8, 1)) +>n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 10, 14)) + diff --git a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types index ce870dbc818..234c01e2241 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types @@ -5,6 +5,7 @@ var BOOLEAN: boolean; function foo(): boolean { return true; } >foo : () => boolean +>true : boolean class A { >A : A @@ -14,6 +15,7 @@ class A { static foo() { return false; } >foo : () => boolean +>false : boolean } module M { >M : typeof M @@ -37,13 +39,16 @@ var ResultIsNumber1 = ~BOOLEAN; var ResultIsNumber2 = ~true; >ResultIsNumber2 : number >~true : number +>true : boolean var ResultIsNumber3 = ~{ x: true, y: false }; >ResultIsNumber3 : number >~{ x: true, y: false } : number >{ x: true, y: false } : { x: boolean; y: boolean; } >x : boolean +>true : boolean >y : boolean +>false : boolean // boolean type expressions var ResultIsNumber4 = ~objA.a; @@ -84,6 +89,7 @@ var ResultIsNumber8 = ~~BOOLEAN; // miss assignment operators ~true; >~true : number +>true : boolean ~BOOLEAN; >~BOOLEAN : number @@ -97,6 +103,8 @@ var ResultIsNumber8 = ~~BOOLEAN; ~true, false; >~true, false : boolean >~true : number +>true : boolean +>false : boolean ~objA.a; >~objA.a : number diff --git a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.symbols b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.symbols new file mode 100644 index 00000000000..24783a153ae --- /dev/null +++ b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.symbols @@ -0,0 +1,51 @@ +=== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithEnumType.ts === +// ~ operator on enum type + +enum ENUM1 { A, B, "" }; +>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) +>A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12)) +>B : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 15)) + +// enum type var +var ResultIsNumber1 = ~ENUM1; +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithEnumType.ts, 5, 3)) +>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) + +// enum type expressions +var ResultIsNumber2 = ~ENUM1["A"]; +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithEnumType.ts, 8, 3)) +>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) +>"A" : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12)) + +var ResultIsNumber3 = ~(ENUM1.A + ENUM1["B"]); +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithEnumType.ts, 9, 3)) +>ENUM1.A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12)) +>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) +>A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12)) +>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) +>"B" : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 15)) + +// multiple ~ operators +var ResultIsNumber4 = ~~~(ENUM1["A"] + ENUM1.B); +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithEnumType.ts, 12, 3)) +>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) +>"A" : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12)) +>ENUM1.B : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 15)) +>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) +>B : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 15)) + +// miss assignment operators +~ENUM1; +>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) + +~ENUM1["A"]; +>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) +>"A" : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12)) + +~ENUM1.A, ~ENUM1["B"]; +>ENUM1.A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12)) +>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) +>A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12)) +>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) +>"B" : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 15)) + diff --git a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types index 71598c6f693..bb8be9b3f54 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types @@ -18,6 +18,7 @@ var ResultIsNumber2 = ~ENUM1["A"]; >~ENUM1["A"] : number >ENUM1["A"] : ENUM1 >ENUM1 : typeof ENUM1 +>"A" : string var ResultIsNumber3 = ~(ENUM1.A + ENUM1["B"]); >ResultIsNumber3 : number @@ -29,6 +30,7 @@ var ResultIsNumber3 = ~(ENUM1.A + ENUM1["B"]); >A : ENUM1 >ENUM1["B"] : ENUM1 >ENUM1 : typeof ENUM1 +>"B" : string // multiple ~ operators var ResultIsNumber4 = ~~~(ENUM1["A"] + ENUM1.B); @@ -40,6 +42,7 @@ var ResultIsNumber4 = ~~~(ENUM1["A"] + ENUM1.B); >ENUM1["A"] + ENUM1.B : number >ENUM1["A"] : ENUM1 >ENUM1 : typeof ENUM1 +>"A" : string >ENUM1.B : ENUM1 >ENUM1 : typeof ENUM1 >B : ENUM1 @@ -53,6 +56,7 @@ var ResultIsNumber4 = ~~~(ENUM1["A"] + ENUM1.B); >~ENUM1["A"] : number >ENUM1["A"] : ENUM1 >ENUM1 : typeof ENUM1 +>"A" : string ~ENUM1.A, ~ENUM1["B"]; >~ENUM1.A, ~ENUM1["B"] : number @@ -63,4 +67,5 @@ var ResultIsNumber4 = ~~~(ENUM1["A"] + ENUM1.B); >~ENUM1["B"] : number >ENUM1["B"] : ENUM1 >ENUM1 : typeof ENUM1 +>"B" : string diff --git a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.symbols b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.symbols new file mode 100644 index 00000000000..2cb37660135 --- /dev/null +++ b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.symbols @@ -0,0 +1,126 @@ +=== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithNumberType.ts === +// ~ operator on number type +var NUMBER: number; +>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3)) + +var NUMBER1: number[] = [1, 2]; +>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3)) + +function foo(): number { return 1; } +>foo : Symbol(foo, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 31)) + +class A { +>A : Symbol(A, Decl(bitwiseNotOperatorWithNumberType.ts, 4, 36)) + + public a: number; +>a : Symbol(a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9)) + + static foo() { return 1; } +>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 21)) +} +module M { +>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 9, 1)) + + export var n: number; +>n : Symbol(n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 14, 3)) +>A : Symbol(A, Decl(bitwiseNotOperatorWithNumberType.ts, 4, 36)) + +// number type var +var ResultIsNumber1 = ~NUMBER; +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithNumberType.ts, 17, 3)) +>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3)) + +var ResultIsNumber2 = ~NUMBER1; +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithNumberType.ts, 18, 3)) +>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3)) + +// number type literal +var ResultIsNumber3 = ~1; +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithNumberType.ts, 21, 3)) + +var ResultIsNumber4 = ~{ x: 1, y: 2}; +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithNumberType.ts, 22, 3)) +>x : Symbol(x, Decl(bitwiseNotOperatorWithNumberType.ts, 22, 24)) +>y : Symbol(y, Decl(bitwiseNotOperatorWithNumberType.ts, 22, 30)) + +var ResultIsNumber5 = ~{ x: 1, y: (n: number) => { return n; } }; +>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 3)) +>x : Symbol(x, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 24)) +>y : Symbol(y, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 30)) +>n : Symbol(n, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 35)) +>n : Symbol(n, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 35)) + +// number type expressions +var ResultIsNumber6 = ~objA.a; +>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(bitwiseNotOperatorWithNumberType.ts, 26, 3)) +>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9)) + +var ResultIsNumber7 = ~M.n; +>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(bitwiseNotOperatorWithNumberType.ts, 27, 3)) +>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14)) + +var ResultIsNumber8 = ~NUMBER1[0]; +>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(bitwiseNotOperatorWithNumberType.ts, 28, 3)) +>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3)) + +var ResultIsNumber9 = ~foo(); +>ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(bitwiseNotOperatorWithNumberType.ts, 29, 3)) +>foo : Symbol(foo, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 31)) + +var ResultIsNumber10 = ~A.foo(); +>ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(bitwiseNotOperatorWithNumberType.ts, 30, 3)) +>A.foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 21)) +>A : Symbol(A, Decl(bitwiseNotOperatorWithNumberType.ts, 4, 36)) +>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 21)) + +var ResultIsNumber11 = ~(NUMBER + NUMBER); +>ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(bitwiseNotOperatorWithNumberType.ts, 31, 3)) +>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3)) + +// multiple ~ operators +var ResultIsNumber12 = ~~NUMBER; +>ResultIsNumber12 : Symbol(ResultIsNumber12, Decl(bitwiseNotOperatorWithNumberType.ts, 34, 3)) +>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3)) + +var ResultIsNumber13 = ~~~(NUMBER + NUMBER); +>ResultIsNumber13 : Symbol(ResultIsNumber13, Decl(bitwiseNotOperatorWithNumberType.ts, 35, 3)) +>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3)) + +// miss assignment operators +~NUMBER; +>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3)) + +~NUMBER1; +>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3)) + +~foo(); +>foo : Symbol(foo, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 31)) + +~objA.a; +>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9)) + +~M.n; +>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14)) + +~objA.a, M.n; +>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9)) +>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14)) + diff --git a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types index 94207a56343..228bd43e593 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types @@ -6,9 +6,12 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] +>1 : number +>2 : number function foo(): number { return 1; } >foo : () => number +>1 : number class A { >A : A @@ -18,6 +21,7 @@ class A { static foo() { return 1; } >foo : () => number +>1 : number } module M { >M : typeof M @@ -46,19 +50,23 @@ var ResultIsNumber2 = ~NUMBER1; var ResultIsNumber3 = ~1; >ResultIsNumber3 : number >~1 : number +>1 : number var ResultIsNumber4 = ~{ x: 1, y: 2}; >ResultIsNumber4 : number >~{ x: 1, y: 2} : number >{ x: 1, y: 2} : { x: number; y: number; } >x : number +>1 : number >y : number +>2 : number var ResultIsNumber5 = ~{ x: 1, y: (n: number) => { return n; } }; >ResultIsNumber5 : number >~{ x: 1, y: (n: number) => { return n; } } : number >{ x: 1, y: (n: number) => { return n; } } : { x: number; y: (n: number) => number; } >x : number +>1 : number >y : (n: number) => number >(n: number) => { return n; } : (n: number) => number >n : number @@ -84,6 +92,7 @@ var ResultIsNumber8 = ~NUMBER1[0]; >~NUMBER1[0] : number >NUMBER1[0] : number >NUMBER1 : number[] +>0 : number var ResultIsNumber9 = ~foo(); >ResultIsNumber9 : number diff --git a/tests/baselines/reference/bitwiseNotOperatorWithStringType.symbols b/tests/baselines/reference/bitwiseNotOperatorWithStringType.symbols new file mode 100644 index 00000000000..1e2d28f51c2 --- /dev/null +++ b/tests/baselines/reference/bitwiseNotOperatorWithStringType.symbols @@ -0,0 +1,122 @@ +=== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithStringType.ts === +// ~ operator on string type +var STRING: string; +>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3)) + +var STRING1: string[] = ["", "abc"]; +>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3)) + +function foo(): string { return "abc"; } +>foo : Symbol(foo, Decl(bitwiseNotOperatorWithStringType.ts, 2, 36)) + +class A { +>A : Symbol(A, Decl(bitwiseNotOperatorWithStringType.ts, 4, 40)) + + public a: string; +>a : Symbol(a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9)) + + static foo() { return ""; } +>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithStringType.ts, 7, 21)) +} +module M { +>M : Symbol(M, Decl(bitwiseNotOperatorWithStringType.ts, 9, 1)) + + export var n: string; +>n : Symbol(n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithStringType.ts, 14, 3)) +>A : Symbol(A, Decl(bitwiseNotOperatorWithStringType.ts, 4, 40)) + +// string type var +var ResultIsNumber1 = ~STRING; +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithStringType.ts, 17, 3)) +>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3)) + +var ResultIsNumber2 = ~STRING1; +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithStringType.ts, 18, 3)) +>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3)) + +// string type literal +var ResultIsNumber3 = ~""; +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithStringType.ts, 21, 3)) + +var ResultIsNumber4 = ~{ x: "", y: "" }; +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithStringType.ts, 22, 3)) +>x : Symbol(x, Decl(bitwiseNotOperatorWithStringType.ts, 22, 24)) +>y : Symbol(y, Decl(bitwiseNotOperatorWithStringType.ts, 22, 31)) + +var ResultIsNumber5 = ~{ x: "", y: (s: string) => { return s; } }; +>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(bitwiseNotOperatorWithStringType.ts, 23, 3)) +>x : Symbol(x, Decl(bitwiseNotOperatorWithStringType.ts, 23, 24)) +>y : Symbol(y, Decl(bitwiseNotOperatorWithStringType.ts, 23, 31)) +>s : Symbol(s, Decl(bitwiseNotOperatorWithStringType.ts, 23, 36)) +>s : Symbol(s, Decl(bitwiseNotOperatorWithStringType.ts, 23, 36)) + +// string type expressions +var ResultIsNumber6 = ~objA.a; +>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(bitwiseNotOperatorWithStringType.ts, 26, 3)) +>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9)) +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithStringType.ts, 14, 3)) +>a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9)) + +var ResultIsNumber7 = ~M.n; +>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(bitwiseNotOperatorWithStringType.ts, 27, 3)) +>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14)) +>M : Symbol(M, Decl(bitwiseNotOperatorWithStringType.ts, 9, 1)) +>n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14)) + +var ResultIsNumber8 = ~STRING1[0]; +>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(bitwiseNotOperatorWithStringType.ts, 28, 3)) +>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3)) + +var ResultIsNumber9 = ~foo(); +>ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(bitwiseNotOperatorWithStringType.ts, 29, 3)) +>foo : Symbol(foo, Decl(bitwiseNotOperatorWithStringType.ts, 2, 36)) + +var ResultIsNumber10 = ~A.foo(); +>ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(bitwiseNotOperatorWithStringType.ts, 30, 3)) +>A.foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithStringType.ts, 7, 21)) +>A : Symbol(A, Decl(bitwiseNotOperatorWithStringType.ts, 4, 40)) +>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithStringType.ts, 7, 21)) + +var ResultIsNumber11 = ~(STRING + STRING); +>ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(bitwiseNotOperatorWithStringType.ts, 31, 3)) +>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3)) +>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3)) + +var ResultIsNumber12 = ~STRING.charAt(0); +>ResultIsNumber12 : Symbol(ResultIsNumber12, Decl(bitwiseNotOperatorWithStringType.ts, 32, 3)) +>STRING.charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3)) +>charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) + +// multiple ~ operators +var ResultIsNumber13 = ~~STRING; +>ResultIsNumber13 : Symbol(ResultIsNumber13, Decl(bitwiseNotOperatorWithStringType.ts, 35, 3)) +>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3)) + +var ResultIsNumber14 = ~~~(STRING + STRING); +>ResultIsNumber14 : Symbol(ResultIsNumber14, Decl(bitwiseNotOperatorWithStringType.ts, 36, 3)) +>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3)) +>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3)) + +//miss assignment operators +~STRING; +>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3)) + +~STRING1; +>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3)) + +~foo(); +>foo : Symbol(foo, Decl(bitwiseNotOperatorWithStringType.ts, 2, 36)) + +~objA.a,M.n; +>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9)) +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithStringType.ts, 14, 3)) +>a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9)) +>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14)) +>M : Symbol(M, Decl(bitwiseNotOperatorWithStringType.ts, 9, 1)) +>n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14)) + diff --git a/tests/baselines/reference/bitwiseNotOperatorWithStringType.types b/tests/baselines/reference/bitwiseNotOperatorWithStringType.types index dbe2f29631e..4f1ca481a1f 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithStringType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithStringType.types @@ -6,9 +6,12 @@ var STRING: string; var STRING1: string[] = ["", "abc"]; >STRING1 : string[] >["", "abc"] : string[] +>"" : string +>"abc" : string function foo(): string { return "abc"; } >foo : () => string +>"abc" : string class A { >A : A @@ -18,6 +21,7 @@ class A { static foo() { return ""; } >foo : () => string +>"" : string } module M { >M : typeof M @@ -46,19 +50,23 @@ var ResultIsNumber2 = ~STRING1; var ResultIsNumber3 = ~""; >ResultIsNumber3 : number >~"" : number +>"" : string var ResultIsNumber4 = ~{ x: "", y: "" }; >ResultIsNumber4 : number >~{ x: "", y: "" } : number >{ x: "", y: "" } : { x: string; y: string; } >x : string +>"" : string >y : string +>"" : string var ResultIsNumber5 = ~{ x: "", y: (s: string) => { return s; } }; >ResultIsNumber5 : number >~{ x: "", y: (s: string) => { return s; } } : number >{ x: "", y: (s: string) => { return s; } } : { x: string; y: (s: string) => string; } >x : string +>"" : string >y : (s: string) => string >(s: string) => { return s; } : (s: string) => string >s : string @@ -84,6 +92,7 @@ var ResultIsNumber8 = ~STRING1[0]; >~STRING1[0] : number >STRING1[0] : string >STRING1 : string[] +>0 : number var ResultIsNumber9 = ~foo(); >ResultIsNumber9 : number @@ -114,6 +123,7 @@ var ResultIsNumber12 = ~STRING.charAt(0); >STRING.charAt : (pos: number) => string >STRING : string >charAt : (pos: number) => string +>0 : number // multiple ~ operators var ResultIsNumber13 = ~~STRING; diff --git a/tests/baselines/reference/bom-utf16be.symbols b/tests/baselines/reference/bom-utf16be.symbols new file mode 100644 index 00000000000..e2a1f4c4c76 --- /dev/null +++ b/tests/baselines/reference/bom-utf16be.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/bom-utf16be.ts === +var x=10; +>x : Symbol(x, Decl(bom-utf16be.ts, 0, 3)) + diff --git a/tests/baselines/reference/bom-utf16be.types b/tests/baselines/reference/bom-utf16be.types index 04c6a5a61bb..1787d102245 100644 --- a/tests/baselines/reference/bom-utf16be.types +++ b/tests/baselines/reference/bom-utf16be.types @@ -1,4 +1,5 @@ === tests/cases/compiler/bom-utf16be.ts === var x=10; >x : number +>10 : number diff --git a/tests/baselines/reference/bom-utf16le.symbols b/tests/baselines/reference/bom-utf16le.symbols new file mode 100644 index 00000000000..396e7ec0d5c --- /dev/null +++ b/tests/baselines/reference/bom-utf16le.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/bom-utf16le.ts === +var x=10; +>x : Symbol(x, Decl(bom-utf16le.ts, 0, 3)) + diff --git a/tests/baselines/reference/bom-utf16le.types b/tests/baselines/reference/bom-utf16le.types index 15970945942..865c94eb82d 100644 --- a/tests/baselines/reference/bom-utf16le.types +++ b/tests/baselines/reference/bom-utf16le.types @@ -1,4 +1,5 @@ === tests/cases/compiler/bom-utf16le.ts === var x=10; >x : number +>10 : number diff --git a/tests/baselines/reference/bom-utf8.symbols b/tests/baselines/reference/bom-utf8.symbols new file mode 100644 index 00000000000..e13277c8953 --- /dev/null +++ b/tests/baselines/reference/bom-utf8.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/bom-utf8.ts === +var x=10; +>x : Symbol(x, Decl(bom-utf8.ts, 0, 3)) + diff --git a/tests/baselines/reference/bom-utf8.types b/tests/baselines/reference/bom-utf8.types index b8398f7b6b6..d96d0132383 100644 --- a/tests/baselines/reference/bom-utf8.types +++ b/tests/baselines/reference/bom-utf8.types @@ -1,4 +1,5 @@ === tests/cases/compiler/bom-utf8.ts === var x=10; >x : number +>10 : number diff --git a/tests/baselines/reference/booleanPropertyAccess.symbols b/tests/baselines/reference/booleanPropertyAccess.symbols new file mode 100644 index 00000000000..c552f268d01 --- /dev/null +++ b/tests/baselines/reference/booleanPropertyAccess.symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/types/primitives/boolean/booleanPropertyAccess.ts === +var x = true; +>x : Symbol(x, Decl(booleanPropertyAccess.ts, 0, 3)) + +var a = x.toString(); +>a : Symbol(a, Decl(booleanPropertyAccess.ts, 2, 3)) +>x.toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) +>x : Symbol(x, Decl(booleanPropertyAccess.ts, 0, 3)) +>toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) + +var b = x['toString'](); +>b : Symbol(b, Decl(booleanPropertyAccess.ts, 3, 3)) +>x : Symbol(x, Decl(booleanPropertyAccess.ts, 0, 3)) +>'toString' : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) + diff --git a/tests/baselines/reference/booleanPropertyAccess.types b/tests/baselines/reference/booleanPropertyAccess.types index d273e3b8852..2795b36cee5 100644 --- a/tests/baselines/reference/booleanPropertyAccess.types +++ b/tests/baselines/reference/booleanPropertyAccess.types @@ -1,6 +1,7 @@ === tests/cases/conformance/types/primitives/boolean/booleanPropertyAccess.ts === var x = true; >x : boolean +>true : boolean var a = x.toString(); >a : string @@ -14,4 +15,5 @@ var b = x['toString'](); >x['toString']() : string >x['toString'] : () => string >x : boolean +>'toString' : string diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement1.symbols b/tests/baselines/reference/breakInIterationOrSwitchStatement1.symbols new file mode 100644 index 00000000000..6a2bae2c2c4 --- /dev/null +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement1.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/breakInIterationOrSwitchStatement1.ts === +while (true) { +No type information for this code. break; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement1.types b/tests/baselines/reference/breakInIterationOrSwitchStatement1.types index 6a2bae2c2c4..545a20ecc55 100644 --- a/tests/baselines/reference/breakInIterationOrSwitchStatement1.types +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement1.types @@ -1,5 +1,6 @@ === tests/cases/compiler/breakInIterationOrSwitchStatement1.ts === while (true) { -No type information for this code. break; -No type information for this code.} -No type information for this code. \ No newline at end of file +>true : boolean + + break; +} diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement2.symbols b/tests/baselines/reference/breakInIterationOrSwitchStatement2.symbols new file mode 100644 index 00000000000..0f8928a664d --- /dev/null +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement2.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/breakInIterationOrSwitchStatement2.ts === +do { +No type information for this code. break; +No type information for this code.} +No type information for this code.while (true); +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement2.types b/tests/baselines/reference/breakInIterationOrSwitchStatement2.types index 0f8928a664d..5736be6c923 100644 --- a/tests/baselines/reference/breakInIterationOrSwitchStatement2.types +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement2.types @@ -1,6 +1,7 @@ === tests/cases/compiler/breakInIterationOrSwitchStatement2.ts === do { -No type information for this code. break; -No type information for this code.} -No type information for this code.while (true); -No type information for this code. \ No newline at end of file + break; +} +while (true); +>true : boolean + diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement3.symbols b/tests/baselines/reference/breakInIterationOrSwitchStatement3.symbols new file mode 100644 index 00000000000..5676b2deccd --- /dev/null +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement3.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/breakInIterationOrSwitchStatement3.ts === +for (;;) { +No type information for this code. break; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/breakTarget1.symbols b/tests/baselines/reference/breakTarget1.symbols new file mode 100644 index 00000000000..eda3b1cac35 --- /dev/null +++ b/tests/baselines/reference/breakTarget1.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/breakTarget1.ts === +target: +No type information for this code. break target; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/breakTarget1.types b/tests/baselines/reference/breakTarget1.types index eda3b1cac35..85efb331e10 100644 --- a/tests/baselines/reference/breakTarget1.types +++ b/tests/baselines/reference/breakTarget1.types @@ -1,4 +1,7 @@ === tests/cases/compiler/breakTarget1.ts === target: -No type information for this code. break target; -No type information for this code. \ No newline at end of file +>target : any + + break target; +>target : any + diff --git a/tests/baselines/reference/breakTarget2.symbols b/tests/baselines/reference/breakTarget2.symbols new file mode 100644 index 00000000000..6357695785b --- /dev/null +++ b/tests/baselines/reference/breakTarget2.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/breakTarget2.ts === +target: +No type information for this code.while (true) { +No type information for this code. break target; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/breakTarget2.types b/tests/baselines/reference/breakTarget2.types index 6357695785b..412203accd1 100644 --- a/tests/baselines/reference/breakTarget2.types +++ b/tests/baselines/reference/breakTarget2.types @@ -1,6 +1,10 @@ === tests/cases/compiler/breakTarget2.ts === target: -No type information for this code.while (true) { -No type information for this code. break target; -No type information for this code.} -No type information for this code. \ No newline at end of file +>target : any + +while (true) { +>true : boolean + + break target; +>target : any +} diff --git a/tests/baselines/reference/breakTarget3.symbols b/tests/baselines/reference/breakTarget3.symbols new file mode 100644 index 00000000000..580706bbd4a --- /dev/null +++ b/tests/baselines/reference/breakTarget3.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/breakTarget3.ts === +target1: +No type information for this code.target2: +No type information for this code.while (true) { +No type information for this code. break target1; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/breakTarget3.types b/tests/baselines/reference/breakTarget3.types index 580706bbd4a..785bf00ef6e 100644 --- a/tests/baselines/reference/breakTarget3.types +++ b/tests/baselines/reference/breakTarget3.types @@ -1,7 +1,13 @@ === tests/cases/compiler/breakTarget3.ts === target1: -No type information for this code.target2: -No type information for this code.while (true) { -No type information for this code. break target1; -No type information for this code.} -No type information for this code. \ No newline at end of file +>target1 : any + +target2: +>target2 : any + +while (true) { +>true : boolean + + break target1; +>target1 : any +} diff --git a/tests/baselines/reference/breakTarget4.symbols b/tests/baselines/reference/breakTarget4.symbols new file mode 100644 index 00000000000..aba35ddcfdf --- /dev/null +++ b/tests/baselines/reference/breakTarget4.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/breakTarget4.ts === +target1: +No type information for this code.target2: +No type information for this code.while (true) { +No type information for this code. break target2; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/breakTarget4.types b/tests/baselines/reference/breakTarget4.types index aba35ddcfdf..eb4c14f6386 100644 --- a/tests/baselines/reference/breakTarget4.types +++ b/tests/baselines/reference/breakTarget4.types @@ -1,7 +1,13 @@ === tests/cases/compiler/breakTarget4.ts === target1: -No type information for this code.target2: -No type information for this code.while (true) { -No type information for this code. break target2; -No type information for this code.} -No type information for this code. \ No newline at end of file +>target1 : any + +target2: +>target2 : any + +while (true) { +>true : boolean + + break target2; +>target2 : any +} diff --git a/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.symbols b/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.symbols new file mode 100644 index 00000000000..f1e724f38db --- /dev/null +++ b/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts === +interface I { +>I : Symbol(I, Decl(callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 0)) +>T : Symbol(T, Decl(callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 12)) + + (u: U): U; +>U : Symbol(U, Decl(callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 5)) +>T : Symbol(T, Decl(callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 12)) +>u : Symbol(u, Decl(callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 18)) +>U : Symbol(U, Decl(callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 5)) +>U : Symbol(U, Decl(callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 5)) +} +var i: I; +>i : Symbol(i, Decl(callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 3, 3)) +>I : Symbol(I, Decl(callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 0)) + +var y = i(""); // y should be string +>y : Symbol(y, Decl(callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 3)) +>i : Symbol(i, Decl(callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 3, 3)) + diff --git a/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.types b/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.types index 6349114bffe..fe7d3a6ad08 100644 --- a/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.types +++ b/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.types @@ -18,4 +18,5 @@ var y = i(""); // y should be string >y : string >i("") : string >i : I +>"" : string diff --git a/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.symbols b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.symbols new file mode 100644 index 00000000000..107650c530e --- /dev/null +++ b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.symbols @@ -0,0 +1,114 @@ +=== tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithZeroTypeArguments.ts === +// valid invocations of generic functions with no explicit type arguments provided + +function f(x: T): T { return null; } +>f : Symbol(f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 0, 0)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 2, 11)) +>x : Symbol(x, Decl(callGenericFunctionWithZeroTypeArguments.ts, 2, 14)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 2, 11)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 2, 11)) + +var r = f(1); +>r : Symbol(r, Decl(callGenericFunctionWithZeroTypeArguments.ts, 3, 3)) +>f : Symbol(f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 0, 0)) + +var f2 = (x: T): T => { return null; } +>f2 : Symbol(f2, Decl(callGenericFunctionWithZeroTypeArguments.ts, 5, 3)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 5, 10)) +>x : Symbol(x, Decl(callGenericFunctionWithZeroTypeArguments.ts, 5, 13)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 5, 10)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 5, 10)) + +var r2 = f2(1); +>r2 : Symbol(r2, Decl(callGenericFunctionWithZeroTypeArguments.ts, 6, 3)) +>f2 : Symbol(f2, Decl(callGenericFunctionWithZeroTypeArguments.ts, 5, 3)) + +var f3: { (x: T): T; } +>f3 : Symbol(f3, Decl(callGenericFunctionWithZeroTypeArguments.ts, 8, 3)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 8, 11)) +>x : Symbol(x, Decl(callGenericFunctionWithZeroTypeArguments.ts, 8, 14)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 8, 11)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 8, 11)) + +var r3 = f3(1); +>r3 : Symbol(r3, Decl(callGenericFunctionWithZeroTypeArguments.ts, 9, 3)) +>f3 : Symbol(f3, Decl(callGenericFunctionWithZeroTypeArguments.ts, 8, 3)) + +class C { +>C : Symbol(C, Decl(callGenericFunctionWithZeroTypeArguments.ts, 9, 15)) + + f(x: T): T { +>f : Symbol(f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 11, 9)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 12, 6)) +>x : Symbol(x, Decl(callGenericFunctionWithZeroTypeArguments.ts, 12, 9)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 12, 6)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 12, 6)) + + return null; + } +} +var r4 = (new C()).f(1); +>r4 : Symbol(r4, Decl(callGenericFunctionWithZeroTypeArguments.ts, 16, 3)) +>(new C()).f : Symbol(C.f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 11, 9)) +>C : Symbol(C, Decl(callGenericFunctionWithZeroTypeArguments.ts, 9, 15)) +>f : Symbol(C.f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 11, 9)) + +interface I { +>I : Symbol(I, Decl(callGenericFunctionWithZeroTypeArguments.ts, 16, 24)) + + f(x: T): T; +>f : Symbol(f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 18, 13)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 19, 6)) +>x : Symbol(x, Decl(callGenericFunctionWithZeroTypeArguments.ts, 19, 9)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 19, 6)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 19, 6)) +} +var i: I; +>i : Symbol(i, Decl(callGenericFunctionWithZeroTypeArguments.ts, 21, 3)) +>I : Symbol(I, Decl(callGenericFunctionWithZeroTypeArguments.ts, 16, 24)) + +var r5 = i.f(1); +>r5 : Symbol(r5, Decl(callGenericFunctionWithZeroTypeArguments.ts, 22, 3)) +>i.f : Symbol(I.f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 18, 13)) +>i : Symbol(i, Decl(callGenericFunctionWithZeroTypeArguments.ts, 21, 3)) +>f : Symbol(I.f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 18, 13)) + +class C2 { +>C2 : Symbol(C2, Decl(callGenericFunctionWithZeroTypeArguments.ts, 22, 16)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 24, 9)) + + f(x: T): T { +>f : Symbol(f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 24, 13)) +>x : Symbol(x, Decl(callGenericFunctionWithZeroTypeArguments.ts, 25, 6)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 24, 9)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 24, 9)) + + return null; + } +} +var r6 = (new C2()).f(1); +>r6 : Symbol(r6, Decl(callGenericFunctionWithZeroTypeArguments.ts, 29, 3)) +>(new C2()).f : Symbol(C2.f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 24, 13)) +>C2 : Symbol(C2, Decl(callGenericFunctionWithZeroTypeArguments.ts, 22, 16)) +>f : Symbol(C2.f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 24, 13)) + +interface I2 { +>I2 : Symbol(I2, Decl(callGenericFunctionWithZeroTypeArguments.ts, 29, 25)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 31, 13)) + + f(x: T): T; +>f : Symbol(f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 31, 17)) +>x : Symbol(x, Decl(callGenericFunctionWithZeroTypeArguments.ts, 32, 6)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 31, 13)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 31, 13)) +} +var i2: I2; +>i2 : Symbol(i2, Decl(callGenericFunctionWithZeroTypeArguments.ts, 34, 3)) +>I2 : Symbol(I2, Decl(callGenericFunctionWithZeroTypeArguments.ts, 29, 25)) + +var r7 = i2.f(1); +>r7 : Symbol(r7, Decl(callGenericFunctionWithZeroTypeArguments.ts, 35, 3)) +>i2.f : Symbol(I2.f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 31, 17)) +>i2 : Symbol(i2, Decl(callGenericFunctionWithZeroTypeArguments.ts, 34, 3)) +>f : Symbol(I2.f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 31, 17)) + diff --git a/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types index 34de901e3c0..e3bcb35805f 100644 --- a/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types +++ b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types @@ -7,11 +7,13 @@ function f(x: T): T { return null; } >x : T >T : T >T : T +>null : null var r = f(1); >r : number >f(1) : number >f : (x: T) => T +>1 : number var f2 = (x: T): T => { return null; } >f2 : (x: T) => T @@ -20,11 +22,13 @@ var f2 = (x: T): T => { return null; } >x : T >T : T >T : T +>null : null var r2 = f2(1); >r2 : number >f2(1) : number >f2 : (x: T) => T +>1 : number var f3: { (x: T): T; } >f3 : (x: T) => T @@ -37,6 +41,7 @@ var r3 = f3(1); >r3 : number >f3(1) : number >f3 : (x: T) => T +>1 : number class C { >C : C @@ -49,6 +54,7 @@ class C { >T : T return null; +>null : null } } var r4 = (new C()).f(1); @@ -59,6 +65,7 @@ var r4 = (new C()).f(1); >new C() : C >C : typeof C >f : (x: T) => T +>1 : number interface I { >I : I @@ -80,6 +87,7 @@ var r5 = i.f(1); >i.f : (x: T) => T >i : I >f : (x: T) => T +>1 : number class C2 { >C2 : C2 @@ -92,6 +100,7 @@ class C2 { >T : T return null; +>null : null } } var r6 = (new C2()).f(1); @@ -102,6 +111,7 @@ var r6 = (new C2()).f(1); >new C2() : C2<{}> >C2 : typeof C2 >f : (x: {}) => {} +>1 : number interface I2 { >I2 : I2 @@ -123,4 +133,5 @@ var r7 = i2.f(1); >i2.f : (x: number) => number >i2 : I2 >f : (x: number) => number +>1 : number diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance2.symbols b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.symbols new file mode 100644 index 00000000000..d0fe78cb178 --- /dev/null +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.symbols @@ -0,0 +1,398 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance2.ts === +// checking subtype relations for function types as it relates to contextual signature instantiation + +class Base { foo: string; } +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>bar : Symbol(bar, Decl(callSignatureAssignabilityInInheritance2.ts, 3, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(callSignatureAssignabilityInInheritance2.ts, 3, 43)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>baz : Symbol(baz, Decl(callSignatureAssignabilityInInheritance2.ts, 4, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(callSignatureAssignabilityInInheritance2.ts, 4, 47)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>bing : Symbol(bing, Decl(callSignatureAssignabilityInInheritance2.ts, 5, 33)) + +interface A { // T +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance2.ts, 5, 49)) + + // M's + a: (x: number) => number[]; +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance2.ts, 7, 13)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 9, 8)) + + a2: (x: number) => string[]; +>a2 : Symbol(a2, Decl(callSignatureAssignabilityInInheritance2.ts, 9, 31)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 10, 9)) + + a3: (x: number) => void; +>a3 : Symbol(a3, Decl(callSignatureAssignabilityInInheritance2.ts, 10, 32)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 11, 9)) + + a4: (x: string, y: number) => string; +>a4 : Symbol(a4, Decl(callSignatureAssignabilityInInheritance2.ts, 11, 28)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 12, 9)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance2.ts, 12, 19)) + + a5: (x: (arg: string) => number) => string; +>a5 : Symbol(a5, Decl(callSignatureAssignabilityInInheritance2.ts, 12, 41)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 13, 9)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance2.ts, 13, 13)) + + a6: (x: (arg: Base) => Derived) => Base; +>a6 : Symbol(a6, Decl(callSignatureAssignabilityInInheritance2.ts, 13, 47)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 14, 9)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance2.ts, 14, 13)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) + + a7: (x: (arg: Base) => Derived) => (r: Base) => Derived; +>a7 : Symbol(a7, Decl(callSignatureAssignabilityInInheritance2.ts, 14, 44)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 15, 9)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance2.ts, 15, 13)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>r : Symbol(r, Decl(callSignatureAssignabilityInInheritance2.ts, 15, 40)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a8: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +>a8 : Symbol(a8, Decl(callSignatureAssignabilityInInheritance2.ts, 15, 60)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 16, 9)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance2.ts, 16, 13)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance2.ts, 16, 35)) +>arg2 : Symbol(arg2, Decl(callSignatureAssignabilityInInheritance2.ts, 16, 40)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>r : Symbol(r, Decl(callSignatureAssignabilityInInheritance2.ts, 16, 68)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a9: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +>a9 : Symbol(a9, Decl(callSignatureAssignabilityInInheritance2.ts, 16, 88)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 17, 9)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance2.ts, 17, 13)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance2.ts, 17, 35)) +>arg2 : Symbol(arg2, Decl(callSignatureAssignabilityInInheritance2.ts, 17, 40)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>r : Symbol(r, Decl(callSignatureAssignabilityInInheritance2.ts, 17, 68)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a10: (...x: Derived[]) => Derived; +>a10 : Symbol(a10, Decl(callSignatureAssignabilityInInheritance2.ts, 17, 88)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 18, 10)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base; +>a11 : Symbol(a11, Decl(callSignatureAssignabilityInInheritance2.ts, 18, 38)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 19, 10)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance2.ts, 19, 14)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance2.ts, 19, 29)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance2.ts, 19, 34)) +>bar : Symbol(bar, Decl(callSignatureAssignabilityInInheritance2.ts, 19, 47)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) + + a12: (x: Array, y: Array) => Array; +>a12 : Symbol(a12, Decl(callSignatureAssignabilityInInheritance2.ts, 19, 71)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 20, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance2.ts, 20, 25)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived2 : Symbol(Derived2, Decl(callSignatureAssignabilityInInheritance2.ts, 3, 43)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a13: (x: Array, y: Array) => Array; +>a13 : Symbol(a13, Decl(callSignatureAssignabilityInInheritance2.ts, 20, 64)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 21, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance2.ts, 21, 25)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a14: (x: { a: string; b: number }) => Object; +>a14 : Symbol(a14, Decl(callSignatureAssignabilityInInheritance2.ts, 21, 63)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 22, 10)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance2.ts, 22, 14)) +>b : Symbol(b, Decl(callSignatureAssignabilityInInheritance2.ts, 22, 25)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + a15: { +>a15 : Symbol(a15, Decl(callSignatureAssignabilityInInheritance2.ts, 22, 49)) + + (x: number): number[]; +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 24, 9)) + + (x: string): string[]; +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 25, 9)) + + }; + a16: { +>a16 : Symbol(a16, Decl(callSignatureAssignabilityInInheritance2.ts, 26, 6)) + + (x: T): number[]; +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 28, 9)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 28, 28)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 28, 9)) + + (x: U): number[]; +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 29, 9)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 29, 25)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 29, 9)) + + }; + a17: { +>a17 : Symbol(a17, Decl(callSignatureAssignabilityInInheritance2.ts, 30, 6)) + + (x: (a: number) => number): number[]; +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 32, 9)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance2.ts, 32, 13)) + + (x: (a: string) => string): string[]; +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 33, 9)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance2.ts, 33, 13)) + + }; + a18: { +>a18 : Symbol(a18, Decl(callSignatureAssignabilityInInheritance2.ts, 34, 6)) + + (x: { +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 36, 9)) + + (a: number): number; +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance2.ts, 37, 13)) + + (a: string): string; +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance2.ts, 38, 13)) + + }): any[]; + (x: { +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 40, 9)) + + (a: boolean): boolean; +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance2.ts, 41, 13)) + + (a: Date): Date; +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance2.ts, 42, 13)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + }): any[]; + }; +} + +// S's +interface I extends A { +>I : Symbol(I, Decl(callSignatureAssignabilityInInheritance2.ts, 45, 1)) +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance2.ts, 5, 49)) + + // N's + a: (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance2.ts, 48, 23)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 50, 8)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 50, 11)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 50, 8)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 50, 8)) + + a2: (x: T) => string[]; // ok +>a2 : Symbol(a2, Decl(callSignatureAssignabilityInInheritance2.ts, 50, 24)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 51, 9)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 51, 12)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 51, 9)) + + a3: (x: T) => T; // ok since Base returns void +>a3 : Symbol(a3, Decl(callSignatureAssignabilityInInheritance2.ts, 51, 30)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 52, 9)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 52, 12)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 52, 9)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 52, 9)) + + a4: (x: T, y: U) => T; // ok, instantiation of N is a subtype of M, T is string, U is number +>a4 : Symbol(a4, Decl(callSignatureAssignabilityInInheritance2.ts, 52, 23)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 53, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 53, 11)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 53, 15)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 53, 9)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance2.ts, 53, 20)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 53, 11)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 53, 9)) + + a5: (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made +>a5 : Symbol(a5, Decl(callSignatureAssignabilityInInheritance2.ts, 53, 32)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 54, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 54, 11)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 54, 15)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance2.ts, 54, 19)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 54, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 54, 11)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 54, 9)) + + a6: (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy +>a6 : Symbol(a6, Decl(callSignatureAssignabilityInInheritance2.ts, 54, 38)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 55, 9)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 55, 24)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 55, 44)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance2.ts, 55, 48)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 55, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 55, 24)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 55, 9)) + + a7: (x: (arg: T) => U) => (r: T) => U; // ok +>a7 : Symbol(a7, Decl(callSignatureAssignabilityInInheritance2.ts, 55, 67)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 56, 9)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 56, 24)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 56, 44)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance2.ts, 56, 48)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 56, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 56, 24)) +>r : Symbol(r, Decl(callSignatureAssignabilityInInheritance2.ts, 56, 66)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 56, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 56, 24)) + + a8: (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; // ok +>a8 : Symbol(a8, Decl(callSignatureAssignabilityInInheritance2.ts, 56, 77)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 9)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 24)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 44)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 48)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 24)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 61)) +>arg2 : Symbol(arg2, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 66)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 24)) +>r : Symbol(r, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 85)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 24)) + + a9: (x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; // ok, same as a8 with compatible object literal +>a9 : Symbol(a9, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 96)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 9)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 24)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 44)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 48)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 24)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 61)) +>arg2 : Symbol(arg2, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 66)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 73)) +>bing : Symbol(bing, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 86)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 24)) +>r : Symbol(r, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 113)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 24)) + + a10: (...x: T[]) => T; // ok +>a10 : Symbol(a10, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 124)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 59, 10)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 59, 29)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 59, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 59, 10)) + + a11: (x: T, y: T) => T; // ok +>a11 : Symbol(a11, Decl(callSignatureAssignabilityInInheritance2.ts, 59, 45)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 60, 10)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 60, 26)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 60, 10)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance2.ts, 60, 31)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 60, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 60, 10)) + + a12: >(x: Array, y: T) => Array; // ok, less specific parameter type +>a12 : Symbol(a12, Decl(callSignatureAssignabilityInInheritance2.ts, 60, 43)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 61, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 61, 33)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance2.ts, 61, 48)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 61, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a13: >(x: Array, y: T) => T; // ok, T = Array, satisfies constraint, contextual signature instantiation succeeds +>a13 : Symbol(a13, Decl(callSignatureAssignabilityInInheritance2.ts, 61, 73)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 62, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 62, 36)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance2.ts, 62, 51)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 62, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 62, 10)) + + a14: (x: { a: T; b: T }) => T; // ok, best common type yields T = {} but that's satisfactory for this signature +>a14 : Symbol(a14, Decl(callSignatureAssignabilityInInheritance2.ts, 62, 63)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 63, 10)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 63, 13)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance2.ts, 63, 17)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 63, 10)) +>b : Symbol(b, Decl(callSignatureAssignabilityInInheritance2.ts, 63, 23)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 63, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 63, 10)) + + a15: (x: T) => T[]; // ok +>a15 : Symbol(a15, Decl(callSignatureAssignabilityInInheritance2.ts, 63, 37)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 64, 10)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 64, 13)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 64, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 64, 10)) + + a16: (x: T) => number[]; // ok +>a16 : Symbol(a16, Decl(callSignatureAssignabilityInInheritance2.ts, 64, 26)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 65, 10)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 65, 26)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 65, 10)) + + a17: (x: (a: T) => T) => T[]; // ok +>a17 : Symbol(a17, Decl(callSignatureAssignabilityInInheritance2.ts, 65, 44)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 66, 10)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 66, 13)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance2.ts, 66, 17)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 66, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 66, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 66, 10)) + + a18: (x: (a: T) => T) => T[]; // ok, no inferences for T but assignable to any +>a18 : Symbol(a18, Decl(callSignatureAssignabilityInInheritance2.ts, 66, 36)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 67, 10)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 67, 13)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance2.ts, 67, 17)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 67, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 67, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 67, 10)) +} diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance4.symbols b/tests/baselines/reference/callSignatureAssignabilityInInheritance4.symbols new file mode 100644 index 00000000000..f45d7f318d2 --- /dev/null +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance4.symbols @@ -0,0 +1,281 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance4.ts === +// checking subtype relations for function types as it relates to contextual signature instantiation + +class Base { foo: string; } +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance4.ts, 0, 0)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance4.ts, 2, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance4.ts, 2, 27)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance4.ts, 0, 0)) +>bar : Symbol(bar, Decl(callSignatureAssignabilityInInheritance4.ts, 3, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(callSignatureAssignabilityInInheritance4.ts, 3, 43)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance4.ts, 2, 27)) +>baz : Symbol(baz, Decl(callSignatureAssignabilityInInheritance4.ts, 4, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(callSignatureAssignabilityInInheritance4.ts, 4, 47)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance4.ts, 0, 0)) +>bing : Symbol(bing, Decl(callSignatureAssignabilityInInheritance4.ts, 5, 33)) + +interface A { // T +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance4.ts, 5, 49)) + + // M's + a: (x: T) => T[]; +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 7, 13)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 9, 8)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 9, 11)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 9, 8)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 9, 8)) + + a2: (x: T) => string[]; +>a2 : Symbol(a2, Decl(callSignatureAssignabilityInInheritance4.ts, 9, 24)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 10, 9)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 10, 12)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 10, 9)) + + a3: (x: T) => void; +>a3 : Symbol(a3, Decl(callSignatureAssignabilityInInheritance4.ts, 10, 30)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 11, 9)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 11, 12)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 11, 9)) + + a4: (x: T, y: U) => string; +>a4 : Symbol(a4, Decl(callSignatureAssignabilityInInheritance4.ts, 11, 26)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 12, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 12, 11)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 12, 14)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 12, 9)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance4.ts, 12, 19)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 12, 11)) + + a5: (x: (arg: T) => U) => T; +>a5 : Symbol(a5, Decl(callSignatureAssignabilityInInheritance4.ts, 12, 36)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 13, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 13, 11)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 13, 14)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance4.ts, 13, 18)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 13, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 13, 11)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 13, 9)) + + a6: (x: (arg: T) => Derived) => T; +>a6 : Symbol(a6, Decl(callSignatureAssignabilityInInheritance4.ts, 13, 37)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 14, 9)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance4.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 14, 25)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance4.ts, 14, 29)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 14, 9)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance4.ts, 2, 27)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 14, 9)) + + a11: (x: { foo: T }, y: { foo: T; bar: T }) => Base; +>a11 : Symbol(a11, Decl(callSignatureAssignabilityInInheritance4.ts, 14, 54)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 15, 10)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 15, 13)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance4.ts, 15, 17)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 15, 10)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance4.ts, 15, 27)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance4.ts, 15, 32)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 15, 10)) +>bar : Symbol(bar, Decl(callSignatureAssignabilityInInheritance4.ts, 15, 40)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 15, 10)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance4.ts, 0, 0)) + + a15: (x: { a: T; b: T }) => T[]; +>a15 : Symbol(a15, Decl(callSignatureAssignabilityInInheritance4.ts, 15, 59)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 16, 10)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 16, 13)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 16, 17)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 16, 10)) +>b : Symbol(b, Decl(callSignatureAssignabilityInInheritance4.ts, 16, 23)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 16, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 16, 10)) + + a16: (x: { a: T; b: T }) => T[]; +>a16 : Symbol(a16, Decl(callSignatureAssignabilityInInheritance4.ts, 16, 39)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 17, 10)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance4.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 17, 26)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 17, 30)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 17, 10)) +>b : Symbol(b, Decl(callSignatureAssignabilityInInheritance4.ts, 17, 36)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 17, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 17, 10)) + + a17: { +>a17 : Symbol(a17, Decl(callSignatureAssignabilityInInheritance4.ts, 17, 52)) + + (x: (a: T) => T): T[]; +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 19, 9)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance4.ts, 2, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 19, 28)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 19, 32)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 19, 9)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 19, 9)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 19, 9)) + + (x: (a: T) => T): T[]; +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 20, 9)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance4.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 20, 25)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 20, 29)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 20, 9)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 20, 9)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 20, 9)) + + }; + a18: { +>a18 : Symbol(a18, Decl(callSignatureAssignabilityInInheritance4.ts, 21, 6)) + + (x: { +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 23, 9)) + + (a: T): T; +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 24, 13)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance4.ts, 2, 27)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 24, 32)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 24, 13)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 24, 13)) + + (a: T): T; +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 25, 13)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance4.ts, 0, 0)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 25, 29)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 25, 13)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 25, 13)) + + }): any[]; + (x: { +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 27, 9)) + + (a: T): T; +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 28, 13)) +>Derived2 : Symbol(Derived2, Decl(callSignatureAssignabilityInInheritance4.ts, 3, 43)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 28, 33)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 28, 13)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 28, 13)) + + (a: T): T; +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 29, 13)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance4.ts, 0, 0)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 29, 29)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 29, 13)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 29, 13)) + + }): any[]; + }; +} + +// S's +interface I extends A { +>I : Symbol(I, Decl(callSignatureAssignabilityInInheritance4.ts, 32, 1)) +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance4.ts, 5, 49)) + + // N's + a: (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 35, 23)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 37, 8)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 37, 11)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 37, 8)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 37, 8)) + + a2: (x: T) => string[]; // ok +>a2 : Symbol(a2, Decl(callSignatureAssignabilityInInheritance4.ts, 37, 24)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 38, 9)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 38, 12)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 38, 9)) + + a3: (x: T) => T; // ok since Base returns void +>a3 : Symbol(a3, Decl(callSignatureAssignabilityInInheritance4.ts, 38, 30)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 39, 9)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 39, 12)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 39, 9)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 39, 9)) + + a4: (x: T, y: U) => string; // ok, instantiation of N is a subtype of M, T is string, U is number +>a4 : Symbol(a4, Decl(callSignatureAssignabilityInInheritance4.ts, 39, 23)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 40, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 40, 11)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 40, 15)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 40, 9)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance4.ts, 40, 20)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 40, 11)) + + a5: (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made +>a5 : Symbol(a5, Decl(callSignatureAssignabilityInInheritance4.ts, 40, 37)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 41, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 41, 11)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 41, 15)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance4.ts, 41, 19)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 41, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 41, 11)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 41, 9)) + + a6: (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy +>a6 : Symbol(a6, Decl(callSignatureAssignabilityInInheritance4.ts, 41, 38)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 42, 9)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance4.ts, 0, 0)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 42, 24)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance4.ts, 2, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 42, 44)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance4.ts, 42, 48)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 42, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 42, 24)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 42, 9)) + + a11: (x: { foo: T }, y: { foo: U; bar: U }) => Base; // ok +>a11 : Symbol(a11, Decl(callSignatureAssignabilityInInheritance4.ts, 42, 67)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 43, 10)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 43, 12)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 43, 16)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance4.ts, 43, 20)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 43, 10)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance4.ts, 43, 30)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance4.ts, 43, 35)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 43, 12)) +>bar : Symbol(bar, Decl(callSignatureAssignabilityInInheritance4.ts, 43, 43)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 43, 12)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance4.ts, 0, 0)) + + a15: (x: { a: U; b: V; }) => U[]; // ok, T = U, T = V +>a15 : Symbol(a15, Decl(callSignatureAssignabilityInInheritance4.ts, 43, 62)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 44, 10)) +>V : Symbol(V, Decl(callSignatureAssignabilityInInheritance4.ts, 44, 12)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 44, 16)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 44, 20)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 44, 10)) +>b : Symbol(b, Decl(callSignatureAssignabilityInInheritance4.ts, 44, 26)) +>V : Symbol(V, Decl(callSignatureAssignabilityInInheritance4.ts, 44, 12)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 44, 10)) + + a16: (x: { a: T; b: T }) => T[]; // ok, more general parameter type +>a16 : Symbol(a16, Decl(callSignatureAssignabilityInInheritance4.ts, 44, 43)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 45, 10)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 45, 13)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 45, 17)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 45, 10)) +>b : Symbol(b, Decl(callSignatureAssignabilityInInheritance4.ts, 45, 23)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 45, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 45, 10)) + + a17: (x: (a: T) => T) => T[]; // ok +>a17 : Symbol(a17, Decl(callSignatureAssignabilityInInheritance4.ts, 45, 39)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 46, 10)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 46, 13)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 46, 17)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 46, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 46, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 46, 10)) + + a18: (x: (a: T) => T) => any[]; // ok +>a18 : Symbol(a18, Decl(callSignatureAssignabilityInInheritance4.ts, 46, 36)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 47, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 47, 14)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 47, 17)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 47, 14)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 47, 14)) +} diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance5.symbols b/tests/baselines/reference/callSignatureAssignabilityInInheritance5.symbols new file mode 100644 index 00000000000..d5a68430887 --- /dev/null +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance5.symbols @@ -0,0 +1,314 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance5.ts === +// checking subtype relations for function types as it relates to contextual signature instantiation +// same as subtypingWithCallSignatures2 just with an extra level of indirection in the inheritance chain + +class Base { foo: string; } +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>bar : Symbol(bar, Decl(callSignatureAssignabilityInInheritance5.ts, 4, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(callSignatureAssignabilityInInheritance5.ts, 4, 43)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>baz : Symbol(baz, Decl(callSignatureAssignabilityInInheritance5.ts, 5, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(callSignatureAssignabilityInInheritance5.ts, 5, 47)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>bing : Symbol(bing, Decl(callSignatureAssignabilityInInheritance5.ts, 6, 33)) + +interface A { // T +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance5.ts, 6, 49)) + + // M's + a: (x: number) => number[]; +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance5.ts, 8, 13)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 10, 8)) + + a2: (x: number) => string[]; +>a2 : Symbol(a2, Decl(callSignatureAssignabilityInInheritance5.ts, 10, 31)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 11, 9)) + + a3: (x: number) => void; +>a3 : Symbol(a3, Decl(callSignatureAssignabilityInInheritance5.ts, 11, 32)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 12, 9)) + + a4: (x: string, y: number) => string; +>a4 : Symbol(a4, Decl(callSignatureAssignabilityInInheritance5.ts, 12, 28)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 13, 9)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance5.ts, 13, 19)) + + a5: (x: (arg: string) => number) => string; +>a5 : Symbol(a5, Decl(callSignatureAssignabilityInInheritance5.ts, 13, 41)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 14, 9)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance5.ts, 14, 13)) + + a6: (x: (arg: Base) => Derived) => Base; +>a6 : Symbol(a6, Decl(callSignatureAssignabilityInInheritance5.ts, 14, 47)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 15, 9)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance5.ts, 15, 13)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) + + a7: (x: (arg: Base) => Derived) => (r: Base) => Derived; +>a7 : Symbol(a7, Decl(callSignatureAssignabilityInInheritance5.ts, 15, 44)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 16, 9)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance5.ts, 16, 13)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>r : Symbol(r, Decl(callSignatureAssignabilityInInheritance5.ts, 16, 40)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a8: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +>a8 : Symbol(a8, Decl(callSignatureAssignabilityInInheritance5.ts, 16, 60)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 17, 9)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance5.ts, 17, 13)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance5.ts, 17, 35)) +>arg2 : Symbol(arg2, Decl(callSignatureAssignabilityInInheritance5.ts, 17, 40)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>r : Symbol(r, Decl(callSignatureAssignabilityInInheritance5.ts, 17, 68)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a9: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +>a9 : Symbol(a9, Decl(callSignatureAssignabilityInInheritance5.ts, 17, 88)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 18, 9)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance5.ts, 18, 13)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance5.ts, 18, 35)) +>arg2 : Symbol(arg2, Decl(callSignatureAssignabilityInInheritance5.ts, 18, 40)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>r : Symbol(r, Decl(callSignatureAssignabilityInInheritance5.ts, 18, 68)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a10: (...x: Derived[]) => Derived; +>a10 : Symbol(a10, Decl(callSignatureAssignabilityInInheritance5.ts, 18, 88)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 19, 10)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base; +>a11 : Symbol(a11, Decl(callSignatureAssignabilityInInheritance5.ts, 19, 38)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 20, 10)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance5.ts, 20, 14)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance5.ts, 20, 29)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance5.ts, 20, 34)) +>bar : Symbol(bar, Decl(callSignatureAssignabilityInInheritance5.ts, 20, 47)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) + + a12: (x: Array, y: Array) => Array; +>a12 : Symbol(a12, Decl(callSignatureAssignabilityInInheritance5.ts, 20, 71)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 21, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance5.ts, 21, 25)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived2 : Symbol(Derived2, Decl(callSignatureAssignabilityInInheritance5.ts, 4, 43)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a13: (x: Array, y: Array) => Array; +>a13 : Symbol(a13, Decl(callSignatureAssignabilityInInheritance5.ts, 21, 64)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 22, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance5.ts, 22, 25)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a14: (x: { a: string; b: number }) => Object; +>a14 : Symbol(a14, Decl(callSignatureAssignabilityInInheritance5.ts, 22, 63)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 23, 10)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance5.ts, 23, 14)) +>b : Symbol(b, Decl(callSignatureAssignabilityInInheritance5.ts, 23, 25)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +} + +interface B extends A { +>B : Symbol(B, Decl(callSignatureAssignabilityInInheritance5.ts, 24, 1)) +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance5.ts, 6, 49)) + + a: (x: T) => T[]; +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance5.ts, 26, 23)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 27, 8)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 27, 11)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 27, 8)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 27, 8)) +} + +// S's +interface I extends B { +>I : Symbol(I, Decl(callSignatureAssignabilityInInheritance5.ts, 28, 1)) +>B : Symbol(B, Decl(callSignatureAssignabilityInInheritance5.ts, 24, 1)) + + // N's + a: (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance5.ts, 31, 23)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 33, 8)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 33, 11)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 33, 8)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 33, 8)) + + a2: (x: T) => string[]; // ok +>a2 : Symbol(a2, Decl(callSignatureAssignabilityInInheritance5.ts, 33, 24)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 34, 9)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 34, 12)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 34, 9)) + + a3: (x: T) => T; // ok since Base returns void +>a3 : Symbol(a3, Decl(callSignatureAssignabilityInInheritance5.ts, 34, 30)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 35, 9)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 35, 12)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 35, 9)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 35, 9)) + + a4: (x: T, y: U) => T; // ok, instantiation of N is a subtype of M, T is string, U is number +>a4 : Symbol(a4, Decl(callSignatureAssignabilityInInheritance5.ts, 35, 23)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 36, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 36, 11)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 36, 15)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 36, 9)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance5.ts, 36, 20)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 36, 11)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 36, 9)) + + a5: (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made +>a5 : Symbol(a5, Decl(callSignatureAssignabilityInInheritance5.ts, 36, 32)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 37, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 37, 11)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 37, 15)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance5.ts, 37, 19)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 37, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 37, 11)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 37, 9)) + + a6: (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy +>a6 : Symbol(a6, Decl(callSignatureAssignabilityInInheritance5.ts, 37, 38)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 38, 9)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 38, 24)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 38, 44)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance5.ts, 38, 48)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 38, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 38, 24)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 38, 9)) + + a7: (x: (arg: T) => U) => (r: T) => U; // ok +>a7 : Symbol(a7, Decl(callSignatureAssignabilityInInheritance5.ts, 38, 67)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 39, 9)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 39, 24)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 39, 44)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance5.ts, 39, 48)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 39, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 39, 24)) +>r : Symbol(r, Decl(callSignatureAssignabilityInInheritance5.ts, 39, 66)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 39, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 39, 24)) + + a8: (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; // ok +>a8 : Symbol(a8, Decl(callSignatureAssignabilityInInheritance5.ts, 39, 77)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 9)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 24)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 44)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 48)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 24)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 61)) +>arg2 : Symbol(arg2, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 66)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 24)) +>r : Symbol(r, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 85)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 24)) + + a9: (x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; // ok, same as a8 with compatible object literal +>a9 : Symbol(a9, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 96)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 9)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 24)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 44)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 48)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 24)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 61)) +>arg2 : Symbol(arg2, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 66)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 73)) +>bing : Symbol(bing, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 86)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 24)) +>r : Symbol(r, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 113)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 24)) + + a10: (...x: T[]) => T; // ok +>a10 : Symbol(a10, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 124)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 42, 10)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 42, 29)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 42, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 42, 10)) + + a11: (x: T, y: T) => T; // ok +>a11 : Symbol(a11, Decl(callSignatureAssignabilityInInheritance5.ts, 42, 45)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 43, 10)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 43, 26)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 43, 10)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance5.ts, 43, 31)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 43, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 43, 10)) + + a12: >(x: Array, y: T) => Array; // ok, less specific parameter type +>a12 : Symbol(a12, Decl(callSignatureAssignabilityInInheritance5.ts, 43, 43)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 44, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 44, 33)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance5.ts, 44, 48)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 44, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a13: >(x: Array, y: T) => T; // ok, T = Array, satisfies constraint, contextual signature instantiation succeeds +>a13 : Symbol(a13, Decl(callSignatureAssignabilityInInheritance5.ts, 44, 73)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 45, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 45, 36)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance5.ts, 45, 51)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 45, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 45, 10)) + + a14: (x: { a: T; b: T }) => T; // ok, best common type yields T = {} but that's satisfactory for this signature +>a14 : Symbol(a14, Decl(callSignatureAssignabilityInInheritance5.ts, 45, 63)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 46, 10)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 46, 13)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance5.ts, 46, 17)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 46, 10)) +>b : Symbol(b, Decl(callSignatureAssignabilityInInheritance5.ts, 46, 23)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 46, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 46, 10)) +} diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance6.symbols b/tests/baselines/reference/callSignatureAssignabilityInInheritance6.symbols new file mode 100644 index 00000000000..1d4c99d89db --- /dev/null +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance6.symbols @@ -0,0 +1,209 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance6.ts === +// checking subtype relations for function types as it relates to contextual signature instantiation +// same as subtypingWithCallSignatures4 but using class type parameters instead of generic signatures +// all are errors + +class Base { foo: string; } +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance6.ts, 0, 0)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance6.ts, 4, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance6.ts, 4, 27)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance6.ts, 0, 0)) +>bar : Symbol(bar, Decl(callSignatureAssignabilityInInheritance6.ts, 5, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(callSignatureAssignabilityInInheritance6.ts, 5, 43)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance6.ts, 4, 27)) +>baz : Symbol(baz, Decl(callSignatureAssignabilityInInheritance6.ts, 6, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(callSignatureAssignabilityInInheritance6.ts, 6, 47)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance6.ts, 0, 0)) +>bing : Symbol(bing, Decl(callSignatureAssignabilityInInheritance6.ts, 7, 33)) + +interface A { // T +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance6.ts, 7, 49)) + + // M's + a: (x: T) => T[]; +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance6.ts, 9, 13)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 11, 8)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 11, 11)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 11, 8)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 11, 8)) + + a2: (x: T) => string[]; +>a2 : Symbol(a2, Decl(callSignatureAssignabilityInInheritance6.ts, 11, 24)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 12, 9)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 12, 12)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 12, 9)) + + a3: (x: T) => void; +>a3 : Symbol(a3, Decl(callSignatureAssignabilityInInheritance6.ts, 12, 30)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 13, 9)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 13, 12)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 13, 9)) + + a4: (x: T, y: U) => string; +>a4 : Symbol(a4, Decl(callSignatureAssignabilityInInheritance6.ts, 13, 26)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 14, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance6.ts, 14, 11)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 14, 14)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 14, 9)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance6.ts, 14, 19)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance6.ts, 14, 11)) + + a5: (x: (arg: T) => U) => T; +>a5 : Symbol(a5, Decl(callSignatureAssignabilityInInheritance6.ts, 14, 36)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 15, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance6.ts, 15, 11)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 15, 14)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance6.ts, 15, 18)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 15, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance6.ts, 15, 11)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 15, 9)) + + a6: (x: (arg: T) => Derived) => T; +>a6 : Symbol(a6, Decl(callSignatureAssignabilityInInheritance6.ts, 15, 37)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 16, 9)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance6.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 16, 25)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance6.ts, 16, 29)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 16, 9)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance6.ts, 4, 27)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 16, 9)) + + a11: (x: { foo: T }, y: { foo: T; bar: T }) => Base; +>a11 : Symbol(a11, Decl(callSignatureAssignabilityInInheritance6.ts, 16, 54)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 17, 10)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 17, 13)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance6.ts, 17, 17)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 17, 10)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance6.ts, 17, 27)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance6.ts, 17, 32)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 17, 10)) +>bar : Symbol(bar, Decl(callSignatureAssignabilityInInheritance6.ts, 17, 40)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 17, 10)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance6.ts, 0, 0)) + + a15: (x: { a: T; b: T }) => T[]; +>a15 : Symbol(a15, Decl(callSignatureAssignabilityInInheritance6.ts, 17, 59)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 18, 10)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 18, 13)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance6.ts, 18, 17)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 18, 10)) +>b : Symbol(b, Decl(callSignatureAssignabilityInInheritance6.ts, 18, 23)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 18, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 18, 10)) + + a16: (x: { a: T; b: T }) => T[]; +>a16 : Symbol(a16, Decl(callSignatureAssignabilityInInheritance6.ts, 18, 39)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 19, 10)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance6.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 19, 26)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance6.ts, 19, 30)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 19, 10)) +>b : Symbol(b, Decl(callSignatureAssignabilityInInheritance6.ts, 19, 36)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 19, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 19, 10)) +} + +// S's +interface I extends A { +>I : Symbol(I, Decl(callSignatureAssignabilityInInheritance6.ts, 20, 1)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 23, 12)) +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a: (x: T) => T[]; +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance6.ts, 23, 26)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 24, 8)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 23, 12)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 23, 12)) +} + +interface I2 extends A { +>I2 : Symbol(I2, Decl(callSignatureAssignabilityInInheritance6.ts, 25, 1)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 27, 13)) +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a2: (x: T) => string[]; +>a2 : Symbol(a2, Decl(callSignatureAssignabilityInInheritance6.ts, 27, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 28, 9)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 27, 13)) +} + +interface I3 extends A { +>I3 : Symbol(I3, Decl(callSignatureAssignabilityInInheritance6.ts, 29, 1)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 31, 13)) +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a3: (x: T) => T; +>a3 : Symbol(a3, Decl(callSignatureAssignabilityInInheritance6.ts, 31, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 32, 9)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 31, 13)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 31, 13)) +} + +interface I4 extends A { +>I4 : Symbol(I4, Decl(callSignatureAssignabilityInInheritance6.ts, 33, 1)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 35, 13)) +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a4: (x: T, y: U) => string; +>a4 : Symbol(a4, Decl(callSignatureAssignabilityInInheritance6.ts, 35, 27)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance6.ts, 36, 9)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 36, 12)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 35, 13)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance6.ts, 36, 17)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance6.ts, 36, 9)) +} + +interface I5 extends A { +>I5 : Symbol(I5, Decl(callSignatureAssignabilityInInheritance6.ts, 37, 1)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 39, 13)) +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a5: (x: (arg: T) => U) => T; +>a5 : Symbol(a5, Decl(callSignatureAssignabilityInInheritance6.ts, 39, 27)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance6.ts, 40, 9)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 40, 12)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance6.ts, 40, 16)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 39, 13)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance6.ts, 40, 9)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 39, 13)) +} + +interface I7 extends A { +>I7 : Symbol(I7, Decl(callSignatureAssignabilityInInheritance6.ts, 41, 1)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 43, 13)) +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a11: (x: { foo: T }, y: { foo: U; bar: U }) => Base; +>a11 : Symbol(a11, Decl(callSignatureAssignabilityInInheritance6.ts, 43, 27)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance6.ts, 44, 10)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 44, 13)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance6.ts, 44, 17)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 43, 13)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance6.ts, 44, 27)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance6.ts, 44, 32)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance6.ts, 44, 10)) +>bar : Symbol(bar, Decl(callSignatureAssignabilityInInheritance6.ts, 44, 40)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance6.ts, 44, 10)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance6.ts, 0, 0)) +} + +interface I9 extends A { +>I9 : Symbol(I9, Decl(callSignatureAssignabilityInInheritance6.ts, 45, 1)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 47, 13)) +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a16: (x: { a: T; b: T }) => T[]; +>a16 : Symbol(a16, Decl(callSignatureAssignabilityInInheritance6.ts, 47, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 48, 10)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance6.ts, 48, 14)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 47, 13)) +>b : Symbol(b, Decl(callSignatureAssignabilityInInheritance6.ts, 48, 20)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 47, 13)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 47, 13)) +} diff --git a/tests/baselines/reference/callSignatureFunctionOverload.symbols b/tests/baselines/reference/callSignatureFunctionOverload.symbols new file mode 100644 index 00000000000..f0318f1a77d --- /dev/null +++ b/tests/baselines/reference/callSignatureFunctionOverload.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/callSignatureFunctionOverload.ts === +var foo: { +>foo : Symbol(foo, Decl(callSignatureFunctionOverload.ts, 0, 3)) + + (name: string): string; +>name : Symbol(name, Decl(callSignatureFunctionOverload.ts, 1, 5)) + + (name: 'order'): string; +>name : Symbol(name, Decl(callSignatureFunctionOverload.ts, 2, 5)) + + (name: 'content'): string; +>name : Symbol(name, Decl(callSignatureFunctionOverload.ts, 3, 5)) + + (name: 'done'): string; +>name : Symbol(name, Decl(callSignatureFunctionOverload.ts, 4, 5)) +} + +var foo2: { +>foo2 : Symbol(foo2, Decl(callSignatureFunctionOverload.ts, 7, 3)) + + (name: string): string; +>name : Symbol(name, Decl(callSignatureFunctionOverload.ts, 8, 5)) + + (name: 'order'): string; +>name : Symbol(name, Decl(callSignatureFunctionOverload.ts, 9, 5)) + + (name: 'order'): string; +>name : Symbol(name, Decl(callSignatureFunctionOverload.ts, 10, 5)) + + (name: 'done'): string; +>name : Symbol(name, Decl(callSignatureFunctionOverload.ts, 11, 5)) +} + diff --git a/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.symbols b/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.symbols new file mode 100644 index 00000000000..4b499ec2667 --- /dev/null +++ b/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.symbols @@ -0,0 +1,50 @@ +=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithoutAnnotationsOrBody.ts === +// Call signatures without a return type annotation and function body return 'any' + +function foo(x) { } +>foo : Symbol(foo, Decl(callSignatureWithoutAnnotationsOrBody.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureWithoutAnnotationsOrBody.ts, 2, 13)) + +var r = foo(1); // void since there's a body +>r : Symbol(r, Decl(callSignatureWithoutAnnotationsOrBody.ts, 3, 3)) +>foo : Symbol(foo, Decl(callSignatureWithoutAnnotationsOrBody.ts, 0, 0)) + +interface I { +>I : Symbol(I, Decl(callSignatureWithoutAnnotationsOrBody.ts, 3, 15)) + + (); + f(); +>f : Symbol(f, Decl(callSignatureWithoutAnnotationsOrBody.ts, 6, 7)) +} +var i: I; +>i : Symbol(i, Decl(callSignatureWithoutAnnotationsOrBody.ts, 9, 3)) +>I : Symbol(I, Decl(callSignatureWithoutAnnotationsOrBody.ts, 3, 15)) + +var r2 = i(); +>r2 : Symbol(r2, Decl(callSignatureWithoutAnnotationsOrBody.ts, 10, 3)) +>i : Symbol(i, Decl(callSignatureWithoutAnnotationsOrBody.ts, 9, 3)) + +var r3 = i.f(); +>r3 : Symbol(r3, Decl(callSignatureWithoutAnnotationsOrBody.ts, 11, 3)) +>i.f : Symbol(I.f, Decl(callSignatureWithoutAnnotationsOrBody.ts, 6, 7)) +>i : Symbol(i, Decl(callSignatureWithoutAnnotationsOrBody.ts, 9, 3)) +>f : Symbol(I.f, Decl(callSignatureWithoutAnnotationsOrBody.ts, 6, 7)) + +var a: { +>a : Symbol(a, Decl(callSignatureWithoutAnnotationsOrBody.ts, 13, 3)) + + (); + f(); +>f : Symbol(f, Decl(callSignatureWithoutAnnotationsOrBody.ts, 14, 7)) + +}; +var r4 = a(); +>r4 : Symbol(r4, Decl(callSignatureWithoutAnnotationsOrBody.ts, 17, 3)) +>a : Symbol(a, Decl(callSignatureWithoutAnnotationsOrBody.ts, 13, 3)) + +var r5 = a.f(); +>r5 : Symbol(r5, Decl(callSignatureWithoutAnnotationsOrBody.ts, 18, 3)) +>a.f : Symbol(f, Decl(callSignatureWithoutAnnotationsOrBody.ts, 14, 7)) +>a : Symbol(a, Decl(callSignatureWithoutAnnotationsOrBody.ts, 13, 3)) +>f : Symbol(f, Decl(callSignatureWithoutAnnotationsOrBody.ts, 14, 7)) + diff --git a/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.types b/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.types index b8b608762f5..062961ac093 100644 --- a/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.types +++ b/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.types @@ -9,6 +9,7 @@ var r = foo(1); // void since there's a body >r : void >foo(1) : void >foo : (x: any) => void +>1 : number interface I { >I : I diff --git a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.symbols b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.symbols new file mode 100644 index 00000000000..1c5a6786ab7 --- /dev/null +++ b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.symbols @@ -0,0 +1,255 @@ +=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithoutReturnTypeAnnotationInference.ts === +// Call signatures without a return type should infer one from the function body (if present) + +// Simple types +function foo(x) { +>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 3, 13)) + + return 1; +} +var r = foo(1); +>r : Symbol(r, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 6, 3)) +>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 0, 0)) + +function foo2(x) { +>foo2 : Symbol(foo2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 6, 15)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 8, 14)) + + return foo(x); +>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 8, 14)) +} +var r2 = foo2(1); +>r2 : Symbol(r2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 11, 3)) +>foo2 : Symbol(foo2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 6, 15)) + +function foo3() { +>foo3 : Symbol(foo3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 11, 17)) + + return foo3(); +>foo3 : Symbol(foo3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 11, 17)) +} +var r3 = foo3(); +>r3 : Symbol(r3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 16, 3)) +>foo3 : Symbol(foo3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 11, 17)) + +function foo4(x: T) { +>foo4 : Symbol(foo4, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 16, 16)) +>T : Symbol(T, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 18, 14)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 18, 17)) +>T : Symbol(T, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 18, 14)) + + return x; +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 18, 17)) +} +var r4 = foo4(1); +>r4 : Symbol(r4, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 21, 3)) +>foo4 : Symbol(foo4, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 16, 16)) + +function foo5(x) { +>foo5 : Symbol(foo5, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 21, 17)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 23, 14)) + + if (true) { + return 1; + } else { + return 2; + } +} +var r5 = foo5(1); +>r5 : Symbol(r5, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 30, 3)) +>foo5 : Symbol(foo5, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 21, 17)) + +function foo6(x) { +>foo6 : Symbol(foo6, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 30, 17)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 32, 14)) + + try { + } + catch (e) { +>e : Symbol(e, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 35, 11)) + + return []; + } + finally { + return []; + } +} +var r6 = foo6(1); +>r6 : Symbol(r6, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 42, 3)) +>foo6 : Symbol(foo6, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 30, 17)) + +function foo7(x) { +>foo7 : Symbol(foo7, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 42, 17)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 44, 14)) + + return typeof x; +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 44, 14)) +} +var r7 = foo7(1); +>r7 : Symbol(r7, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 47, 3)) +>foo7 : Symbol(foo7, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 42, 17)) + +// object types +function foo8(x: number) { +>foo8 : Symbol(foo8, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 47, 17)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 50, 14)) + + return { x: x }; +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 51, 12)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 50, 14)) +} +var r8 = foo8(1); +>r8 : Symbol(r8, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 53, 3)) +>foo8 : Symbol(foo8, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 47, 17)) + +interface I { +>I : Symbol(I, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 53, 17)) + + foo: string; +>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 55, 13)) +} +function foo9(x: number) { +>foo9 : Symbol(foo9, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 57, 1)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 58, 14)) + + var i: I; +>i : Symbol(i, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 59, 7)) +>I : Symbol(I, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 53, 17)) + + return i; +>i : Symbol(i, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 59, 7)) +} +var r9 = foo9(1); +>r9 : Symbol(r9, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 62, 3)) +>foo9 : Symbol(foo9, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 57, 1)) + +class C { +>C : Symbol(C, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 62, 17)) + + foo: string; +>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 64, 9)) +} +function foo10(x: number) { +>foo10 : Symbol(foo10, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 66, 1)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 67, 15)) + + var c: C; +>c : Symbol(c, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 68, 7)) +>C : Symbol(C, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 62, 17)) + + return c; +>c : Symbol(c, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 68, 7)) +} +var r10 = foo10(1); +>r10 : Symbol(r10, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 71, 3)) +>foo10 : Symbol(foo10, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 66, 1)) + +module M { +>M : Symbol(M, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 71, 19)) + + export var x = 1; +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 74, 14)) + + export class C { foo: string } +>C : Symbol(C, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 74, 21)) +>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 75, 20)) +} +function foo11() { +>foo11 : Symbol(foo11, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 76, 1)) + + return M; +>M : Symbol(M, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 71, 19)) +} +var r11 = foo11(); +>r11 : Symbol(r11, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 80, 3)) +>foo11 : Symbol(foo11, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 76, 1)) + +// merged declarations +interface I2 { +>I2 : Symbol(I2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 80, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 85, 1)) + + x: number; +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 83, 14)) +} +interface I2 { +>I2 : Symbol(I2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 80, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 85, 1)) + + y: number; +>y : Symbol(y, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 86, 14)) +} +function foo12() { +>foo12 : Symbol(foo12, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 88, 1)) + + var i2: I2; +>i2 : Symbol(i2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 90, 7)) +>I2 : Symbol(I2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 80, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 85, 1)) + + return i2; +>i2 : Symbol(i2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 90, 7)) +} +var r12 = foo12(); +>r12 : Symbol(r12, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 93, 3)) +>foo12 : Symbol(foo12, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 88, 1)) + +function m1() { return 1; } +>m1 : Symbol(m1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 93, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 95, 27)) + +module m1 { export var y = 2; } +>m1 : Symbol(m1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 93, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 95, 27)) +>y : Symbol(y, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 96, 22)) + +function foo13() { +>foo13 : Symbol(foo13, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 96, 31)) + + return m1; +>m1 : Symbol(m1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 93, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 95, 27)) +} +var r13 = foo13(); +>r13 : Symbol(r13, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 100, 3)) +>foo13 : Symbol(foo13, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 96, 31)) + +class c1 { +>c1 : Symbol(c1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 100, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 105, 1)) + + foo: string; +>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 102, 10)) + + constructor(x) { } +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 104, 16)) +} +module c1 { +>c1 : Symbol(c1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 100, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 105, 1)) + + export var x = 1; +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 107, 14)) +} +function foo14() { +>foo14 : Symbol(foo14, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 108, 1)) + + return c1; +>c1 : Symbol(c1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 100, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 105, 1)) +} +var r14 = foo14(); +>r14 : Symbol(r14, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 112, 3)) +>foo14 : Symbol(foo14, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 108, 1)) + +enum e1 { A } +>e1 : Symbol(e1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 112, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 114, 13)) +>A : Symbol(e1.A, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 114, 9)) + +module e1 { export var y = 1; } +>e1 : Symbol(e1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 112, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 114, 13)) +>y : Symbol(y, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 115, 22)) + +function foo15() { +>foo15 : Symbol(foo15, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 115, 31)) + + return e1; +>e1 : Symbol(e1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 112, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 114, 13)) +} +var r15 = foo15(); +>r15 : Symbol(r15, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 119, 3)) +>foo15 : Symbol(foo15, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 115, 31)) + diff --git a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types index dc6a72cf897..760451eb9c1 100644 --- a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types +++ b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types @@ -7,11 +7,13 @@ function foo(x) { >x : any return 1; +>1 : number } var r = foo(1); >r : number >foo(1) : number >foo : (x: any) => number +>1 : number function foo2(x) { >foo2 : (x: any) => number @@ -26,6 +28,7 @@ var r2 = foo2(1); >r2 : number >foo2(1) : number >foo2 : (x: any) => number +>1 : number function foo3() { >foo3 : () => any @@ -52,21 +55,28 @@ var r4 = foo4(1); >r4 : number >foo4(1) : number >foo4 : (x: T) => T +>1 : number function foo5(x) { >foo5 : (x: any) => number >x : any if (true) { +>true : boolean + return 1; +>1 : number + } else { return 2; +>2 : number } } var r5 = foo5(1); >r5 : number >foo5(1) : number >foo5 : (x: any) => number +>1 : number function foo6(x) { >foo6 : (x: any) => any[] @@ -89,6 +99,7 @@ var r6 = foo6(1); >r6 : any[] >foo6(1) : any[] >foo6 : (x: any) => any[] +>1 : number function foo7(x) { >foo7 : (x: any) => string @@ -102,6 +113,7 @@ var r7 = foo7(1); >r7 : string >foo7(1) : string >foo7 : (x: any) => string +>1 : number // object types function foo8(x: number) { @@ -117,6 +129,7 @@ var r8 = foo8(1); >r8 : { x: number; } >foo8(1) : { x: number; } >foo8 : (x: number) => { x: number; } +>1 : number interface I { >I : I @@ -139,6 +152,7 @@ var r9 = foo9(1); >r9 : I >foo9(1) : I >foo9 : (x: number) => I +>1 : number class C { >C : C @@ -161,12 +175,14 @@ var r10 = foo10(1); >r10 : C >foo10(1) : C >foo10 : (x: number) => C +>1 : number module M { >M : typeof M export var x = 1; >x : number +>1 : number export class C { foo: string } >C : C @@ -213,10 +229,12 @@ var r12 = foo12(); function m1() { return 1; } >m1 : typeof m1 +>1 : number module m1 { export var y = 2; } >m1 : typeof m1 >y : number +>2 : number function foo13() { >foo13 : () => typeof m1 @@ -243,6 +261,7 @@ module c1 { export var x = 1; >x : number +>1 : number } function foo14() { >foo14 : () => typeof c1 @@ -262,6 +281,7 @@ enum e1 { A } module e1 { export var y = 1; } >e1 : typeof e1 >y : number +>1 : number function foo15() { >foo15 : () => typeof e1 diff --git a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType.symbols b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType.symbols new file mode 100644 index 00000000000..f2b9de48425 --- /dev/null +++ b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType.symbols @@ -0,0 +1,76 @@ +=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType.ts === +// Each pair of signatures in these types has a signature that should cause an error. +// Overloads, generic or not, that differ only by return type are an error. +interface I { +>I : Symbol(I, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 0, 0)) + + (x): number; +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 3, 5)) + + (x): void; // error +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 4, 5)) + + (x: T): number; +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 5, 5)) +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 5, 8)) +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 5, 5)) + + (x: T): string; // error +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 6, 5)) +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 6, 8)) +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 6, 5)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 7, 1)) + + (x: T): number; +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 10, 5)) +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 10, 8)) +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 10, 5)) + + (x: T): string; // error +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 11, 5)) +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 11, 8)) +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 11, 5)) +} + +interface I3 { +>I3 : Symbol(I3, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 12, 1)) +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 14, 13)) + + (x: T): number; +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 15, 5)) +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 14, 13)) + + (x: T): string; // error +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 16, 5)) +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 14, 13)) +} + +var a: { +>a : Symbol(a, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 19, 3)) + + (x, y): Object; +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 20, 5)) +>y : Symbol(y, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 20, 7)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + (x, y): any; // error +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 21, 5)) +>y : Symbol(y, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 21, 7)) +} + +var a2: { +>a2 : Symbol(a2, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 24, 3)) + + (x: T): number; +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 25, 5)) +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 25, 8)) +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 25, 5)) + + (x: T): string; // error +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 26, 5)) +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 26, 8)) +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 26, 5)) +} diff --git a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType3.symbols b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType3.symbols new file mode 100644 index 00000000000..dab2717aa0a --- /dev/null +++ b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType3.symbols @@ -0,0 +1,33 @@ +=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType3.ts === +// Normally it is an error to have multiple overloads with identical signatures in a single type declaration. +// Here the multiple overloads come from multiple merged declarations. + +interface I { +>I : Symbol(I, Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 0, 0), Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 5, 1)) + + (x: string): string; +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 4, 5)) +} + +interface I { +>I : Symbol(I, Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 0, 0), Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 5, 1)) + + (x: string): number; +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 8, 5)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 9, 1), Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 13, 1)) +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 11, 13), Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 15, 13)) + + (x: string): string; +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 12, 5)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 9, 1), Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 13, 1)) +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 11, 13), Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 15, 13)) + + (x: string): number; +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 16, 5)) +} diff --git a/tests/baselines/reference/callSignaturesWithOptionalParameters.symbols b/tests/baselines/reference/callSignaturesWithOptionalParameters.symbols new file mode 100644 index 00000000000..542bd425fb1 --- /dev/null +++ b/tests/baselines/reference/callSignaturesWithOptionalParameters.symbols @@ -0,0 +1,164 @@ +=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithOptionalParameters.ts === +// Optional parameters should be valid in all the below casts + +function foo(x?: number) { } +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 0, 0)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters.ts, 2, 13)) + +var f = function foo(x?: number) { } +>f : Symbol(f, Decl(callSignaturesWithOptionalParameters.ts, 3, 3)) +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 3, 7)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters.ts, 3, 21)) + +var f2 = (x: number, y?: number) => { } +>f2 : Symbol(f2, Decl(callSignaturesWithOptionalParameters.ts, 4, 3)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters.ts, 4, 10)) +>y : Symbol(y, Decl(callSignaturesWithOptionalParameters.ts, 4, 20)) + +foo(1); +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 0, 0)) + +foo(); +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 0, 0)) + +f(1); +>f : Symbol(f, Decl(callSignaturesWithOptionalParameters.ts, 3, 3)) + +f(); +>f : Symbol(f, Decl(callSignaturesWithOptionalParameters.ts, 3, 3)) + +f2(1); +>f2 : Symbol(f2, Decl(callSignaturesWithOptionalParameters.ts, 4, 3)) + +f2(1, 2); +>f2 : Symbol(f2, Decl(callSignaturesWithOptionalParameters.ts, 4, 3)) + +class C { +>C : Symbol(C, Decl(callSignaturesWithOptionalParameters.ts, 11, 9)) + + foo(x?: number) { } +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 13, 9)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters.ts, 14, 8)) +} + +var c: C; +>c : Symbol(c, Decl(callSignaturesWithOptionalParameters.ts, 17, 3)) +>C : Symbol(C, Decl(callSignaturesWithOptionalParameters.ts, 11, 9)) + +c.foo(); +>c.foo : Symbol(C.foo, Decl(callSignaturesWithOptionalParameters.ts, 13, 9)) +>c : Symbol(c, Decl(callSignaturesWithOptionalParameters.ts, 17, 3)) +>foo : Symbol(C.foo, Decl(callSignaturesWithOptionalParameters.ts, 13, 9)) + +c.foo(1); +>c.foo : Symbol(C.foo, Decl(callSignaturesWithOptionalParameters.ts, 13, 9)) +>c : Symbol(c, Decl(callSignaturesWithOptionalParameters.ts, 17, 3)) +>foo : Symbol(C.foo, Decl(callSignaturesWithOptionalParameters.ts, 13, 9)) + +interface I { +>I : Symbol(I, Decl(callSignaturesWithOptionalParameters.ts, 19, 9)) + + (x?: number); +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters.ts, 22, 5)) + + foo(x: number, y?: number); +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 22, 17)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters.ts, 23, 8)) +>y : Symbol(y, Decl(callSignaturesWithOptionalParameters.ts, 23, 18)) +} + +var i: I; +>i : Symbol(i, Decl(callSignaturesWithOptionalParameters.ts, 26, 3)) +>I : Symbol(I, Decl(callSignaturesWithOptionalParameters.ts, 19, 9)) + +i(); +>i : Symbol(i, Decl(callSignaturesWithOptionalParameters.ts, 26, 3)) + +i(1); +>i : Symbol(i, Decl(callSignaturesWithOptionalParameters.ts, 26, 3)) + +i.foo(1); +>i.foo : Symbol(I.foo, Decl(callSignaturesWithOptionalParameters.ts, 22, 17)) +>i : Symbol(i, Decl(callSignaturesWithOptionalParameters.ts, 26, 3)) +>foo : Symbol(I.foo, Decl(callSignaturesWithOptionalParameters.ts, 22, 17)) + +i.foo(1, 2); +>i.foo : Symbol(I.foo, Decl(callSignaturesWithOptionalParameters.ts, 22, 17)) +>i : Symbol(i, Decl(callSignaturesWithOptionalParameters.ts, 26, 3)) +>foo : Symbol(I.foo, Decl(callSignaturesWithOptionalParameters.ts, 22, 17)) + +var a: { +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters.ts, 32, 3)) + + (x?: number); +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters.ts, 33, 5)) + + foo(x?: number); +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 33, 17)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters.ts, 34, 8)) +} + +a(); +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters.ts, 32, 3)) + +a(1); +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters.ts, 32, 3)) + +a.foo(); +>a.foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 33, 17)) +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters.ts, 32, 3)) +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 33, 17)) + +a.foo(1); +>a.foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 33, 17)) +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters.ts, 32, 3)) +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 33, 17)) + +var b = { +>b : Symbol(b, Decl(callSignaturesWithOptionalParameters.ts, 42, 3)) + + foo(x?: number) { }, +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 42, 9)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters.ts, 43, 8)) + + a: function foo(x: number, y?: number) { }, +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters.ts, 43, 24)) +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 44, 6)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters.ts, 44, 20)) +>y : Symbol(y, Decl(callSignaturesWithOptionalParameters.ts, 44, 30)) + + b: (x?: number) => { } +>b : Symbol(b, Decl(callSignaturesWithOptionalParameters.ts, 44, 47)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters.ts, 45, 8)) +} + +b.foo(); +>b.foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 42, 9)) +>b : Symbol(b, Decl(callSignaturesWithOptionalParameters.ts, 42, 3)) +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 42, 9)) + +b.foo(1); +>b.foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 42, 9)) +>b : Symbol(b, Decl(callSignaturesWithOptionalParameters.ts, 42, 3)) +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 42, 9)) + +b.a(1); +>b.a : Symbol(a, Decl(callSignaturesWithOptionalParameters.ts, 43, 24)) +>b : Symbol(b, Decl(callSignaturesWithOptionalParameters.ts, 42, 3)) +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters.ts, 43, 24)) + +b.a(1, 2); +>b.a : Symbol(a, Decl(callSignaturesWithOptionalParameters.ts, 43, 24)) +>b : Symbol(b, Decl(callSignaturesWithOptionalParameters.ts, 42, 3)) +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters.ts, 43, 24)) + +b.b(); +>b.b : Symbol(b, Decl(callSignaturesWithOptionalParameters.ts, 44, 47)) +>b : Symbol(b, Decl(callSignaturesWithOptionalParameters.ts, 42, 3)) +>b : Symbol(b, Decl(callSignaturesWithOptionalParameters.ts, 44, 47)) + +b.b(1); +>b.b : Symbol(b, Decl(callSignaturesWithOptionalParameters.ts, 44, 47)) +>b : Symbol(b, Decl(callSignaturesWithOptionalParameters.ts, 42, 3)) +>b : Symbol(b, Decl(callSignaturesWithOptionalParameters.ts, 44, 47)) + diff --git a/tests/baselines/reference/callSignaturesWithOptionalParameters.types b/tests/baselines/reference/callSignaturesWithOptionalParameters.types index 818c52f79d0..4ade0e8afe4 100644 --- a/tests/baselines/reference/callSignaturesWithOptionalParameters.types +++ b/tests/baselines/reference/callSignaturesWithOptionalParameters.types @@ -20,6 +20,7 @@ var f2 = (x: number, y?: number) => { } foo(1); >foo(1) : void >foo : (x?: number) => void +>1 : number foo(); >foo() : void @@ -28,6 +29,7 @@ foo(); f(1); >f(1) : void >f : (x?: number) => void +>1 : number f(); >f() : void @@ -36,10 +38,13 @@ f(); f2(1); >f2(1) : void >f2 : (x: number, y?: number) => void +>1 : number f2(1, 2); >f2(1, 2) : void >f2 : (x: number, y?: number) => void +>1 : number +>2 : number class C { >C : C @@ -64,6 +69,7 @@ c.foo(1); >c.foo : (x?: number) => void >c : C >foo : (x?: number) => void +>1 : number interface I { >I : I @@ -88,18 +94,22 @@ i(); i(1); >i(1) : any >i : I +>1 : number i.foo(1); >i.foo(1) : any >i.foo : (x: number, y?: number) => any >i : I >foo : (x: number, y?: number) => any +>1 : number i.foo(1, 2); >i.foo(1, 2) : any >i.foo : (x: number, y?: number) => any >i : I >foo : (x: number, y?: number) => any +>1 : number +>2 : number var a: { >a : { (x?: number): any; foo(x?: number): any; } @@ -119,6 +129,7 @@ a(); a(1); >a(1) : any >a : { (x?: number): any; foo(x?: number): any; } +>1 : number a.foo(); >a.foo() : any @@ -131,6 +142,7 @@ a.foo(1); >a.foo : (x?: number) => any >a : { (x?: number): any; foo(x?: number): any; } >foo : (x?: number) => any +>1 : number var b = { >b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } @@ -164,18 +176,22 @@ b.foo(1); >b.foo : (x?: number) => void >b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } >foo : (x?: number) => void +>1 : number b.a(1); >b.a(1) : void >b.a : (x: number, y?: number) => void >b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } >a : (x: number, y?: number) => void +>1 : number b.a(1, 2); >b.a(1, 2) : void >b.a : (x: number, y?: number) => void >b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } >a : (x: number, y?: number) => void +>1 : number +>2 : number b.b(); >b.b() : void @@ -188,4 +204,5 @@ b.b(1); >b.b : (x?: number) => void >b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } >b : (x?: number) => void +>1 : number diff --git a/tests/baselines/reference/callSignaturesWithOptionalParameters2.symbols b/tests/baselines/reference/callSignaturesWithOptionalParameters2.symbols new file mode 100644 index 00000000000..e8609d66236 --- /dev/null +++ b/tests/baselines/reference/callSignaturesWithOptionalParameters2.symbols @@ -0,0 +1,183 @@ +=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithOptionalParameters2.ts === +// Optional parameters should be valid in all the below casts + +function foo(x?: number); +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 0, 0), Decl(callSignaturesWithOptionalParameters2.ts, 2, 25)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 2, 13)) + +function foo(x?: number) { } +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 0, 0), Decl(callSignaturesWithOptionalParameters2.ts, 2, 25)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 3, 13)) + +foo(1); +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 0, 0), Decl(callSignaturesWithOptionalParameters2.ts, 2, 25)) + +foo(); +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 0, 0), Decl(callSignaturesWithOptionalParameters2.ts, 2, 25)) + +function foo2(x: number); +>foo2 : Symbol(foo2, Decl(callSignaturesWithOptionalParameters2.ts, 6, 6), Decl(callSignaturesWithOptionalParameters2.ts, 8, 25), Decl(callSignaturesWithOptionalParameters2.ts, 9, 37)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 8, 14)) + +function foo2(x: number, y?: number); +>foo2 : Symbol(foo2, Decl(callSignaturesWithOptionalParameters2.ts, 6, 6), Decl(callSignaturesWithOptionalParameters2.ts, 8, 25), Decl(callSignaturesWithOptionalParameters2.ts, 9, 37)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 9, 14)) +>y : Symbol(y, Decl(callSignaturesWithOptionalParameters2.ts, 9, 24)) + +function foo2(x: number, y?: number) { } +>foo2 : Symbol(foo2, Decl(callSignaturesWithOptionalParameters2.ts, 6, 6), Decl(callSignaturesWithOptionalParameters2.ts, 8, 25), Decl(callSignaturesWithOptionalParameters2.ts, 9, 37)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 10, 14)) +>y : Symbol(y, Decl(callSignaturesWithOptionalParameters2.ts, 10, 24)) + +foo2(1); +>foo2 : Symbol(foo2, Decl(callSignaturesWithOptionalParameters2.ts, 6, 6), Decl(callSignaturesWithOptionalParameters2.ts, 8, 25), Decl(callSignaturesWithOptionalParameters2.ts, 9, 37)) + +foo2(1, 2); +>foo2 : Symbol(foo2, Decl(callSignaturesWithOptionalParameters2.ts, 6, 6), Decl(callSignaturesWithOptionalParameters2.ts, 8, 25), Decl(callSignaturesWithOptionalParameters2.ts, 9, 37)) + +class C { +>C : Symbol(C, Decl(callSignaturesWithOptionalParameters2.ts, 13, 11)) + + foo(x?: number); +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 15, 9), Decl(callSignaturesWithOptionalParameters2.ts, 16, 20)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 16, 8)) + + foo(x?: number) { } +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 15, 9), Decl(callSignaturesWithOptionalParameters2.ts, 16, 20)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 17, 8)) + + foo2(x: number); +>foo2 : Symbol(foo2, Decl(callSignaturesWithOptionalParameters2.ts, 17, 23), Decl(callSignaturesWithOptionalParameters2.ts, 19, 20), Decl(callSignaturesWithOptionalParameters2.ts, 20, 32)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 19, 9)) + + foo2(x: number, y?: number); +>foo2 : Symbol(foo2, Decl(callSignaturesWithOptionalParameters2.ts, 17, 23), Decl(callSignaturesWithOptionalParameters2.ts, 19, 20), Decl(callSignaturesWithOptionalParameters2.ts, 20, 32)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 20, 9)) +>y : Symbol(y, Decl(callSignaturesWithOptionalParameters2.ts, 20, 19)) + + foo2(x: number, y?: number) { } +>foo2 : Symbol(foo2, Decl(callSignaturesWithOptionalParameters2.ts, 17, 23), Decl(callSignaturesWithOptionalParameters2.ts, 19, 20), Decl(callSignaturesWithOptionalParameters2.ts, 20, 32)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 21, 9)) +>y : Symbol(y, Decl(callSignaturesWithOptionalParameters2.ts, 21, 19)) +} + +var c: C; +>c : Symbol(c, Decl(callSignaturesWithOptionalParameters2.ts, 24, 3)) +>C : Symbol(C, Decl(callSignaturesWithOptionalParameters2.ts, 13, 11)) + +c.foo(); +>c.foo : Symbol(C.foo, Decl(callSignaturesWithOptionalParameters2.ts, 15, 9), Decl(callSignaturesWithOptionalParameters2.ts, 16, 20)) +>c : Symbol(c, Decl(callSignaturesWithOptionalParameters2.ts, 24, 3)) +>foo : Symbol(C.foo, Decl(callSignaturesWithOptionalParameters2.ts, 15, 9), Decl(callSignaturesWithOptionalParameters2.ts, 16, 20)) + +c.foo(1); +>c.foo : Symbol(C.foo, Decl(callSignaturesWithOptionalParameters2.ts, 15, 9), Decl(callSignaturesWithOptionalParameters2.ts, 16, 20)) +>c : Symbol(c, Decl(callSignaturesWithOptionalParameters2.ts, 24, 3)) +>foo : Symbol(C.foo, Decl(callSignaturesWithOptionalParameters2.ts, 15, 9), Decl(callSignaturesWithOptionalParameters2.ts, 16, 20)) + +c.foo2(1); +>c.foo2 : Symbol(C.foo2, Decl(callSignaturesWithOptionalParameters2.ts, 17, 23), Decl(callSignaturesWithOptionalParameters2.ts, 19, 20), Decl(callSignaturesWithOptionalParameters2.ts, 20, 32)) +>c : Symbol(c, Decl(callSignaturesWithOptionalParameters2.ts, 24, 3)) +>foo2 : Symbol(C.foo2, Decl(callSignaturesWithOptionalParameters2.ts, 17, 23), Decl(callSignaturesWithOptionalParameters2.ts, 19, 20), Decl(callSignaturesWithOptionalParameters2.ts, 20, 32)) + +c.foo2(1, 2); +>c.foo2 : Symbol(C.foo2, Decl(callSignaturesWithOptionalParameters2.ts, 17, 23), Decl(callSignaturesWithOptionalParameters2.ts, 19, 20), Decl(callSignaturesWithOptionalParameters2.ts, 20, 32)) +>c : Symbol(c, Decl(callSignaturesWithOptionalParameters2.ts, 24, 3)) +>foo2 : Symbol(C.foo2, Decl(callSignaturesWithOptionalParameters2.ts, 17, 23), Decl(callSignaturesWithOptionalParameters2.ts, 19, 20), Decl(callSignaturesWithOptionalParameters2.ts, 20, 32)) + +interface I { +>I : Symbol(I, Decl(callSignaturesWithOptionalParameters2.ts, 29, 13)) + + (x?: number); +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 32, 5)) + + (x?: number, y?: number); +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 33, 5)) +>y : Symbol(y, Decl(callSignaturesWithOptionalParameters2.ts, 33, 16)) + + foo(x: number, y?: number); +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 33, 29), Decl(callSignaturesWithOptionalParameters2.ts, 34, 31)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 34, 8)) +>y : Symbol(y, Decl(callSignaturesWithOptionalParameters2.ts, 34, 18)) + + foo(x: number, y?: number, z?: number); +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 33, 29), Decl(callSignaturesWithOptionalParameters2.ts, 34, 31)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 35, 8)) +>y : Symbol(y, Decl(callSignaturesWithOptionalParameters2.ts, 35, 18)) +>z : Symbol(z, Decl(callSignaturesWithOptionalParameters2.ts, 35, 30)) +} + +var i: I; +>i : Symbol(i, Decl(callSignaturesWithOptionalParameters2.ts, 38, 3)) +>I : Symbol(I, Decl(callSignaturesWithOptionalParameters2.ts, 29, 13)) + +i(); +>i : Symbol(i, Decl(callSignaturesWithOptionalParameters2.ts, 38, 3)) + +i(1); +>i : Symbol(i, Decl(callSignaturesWithOptionalParameters2.ts, 38, 3)) + +i(1, 2); +>i : Symbol(i, Decl(callSignaturesWithOptionalParameters2.ts, 38, 3)) + +i.foo(1); +>i.foo : Symbol(I.foo, Decl(callSignaturesWithOptionalParameters2.ts, 33, 29), Decl(callSignaturesWithOptionalParameters2.ts, 34, 31)) +>i : Symbol(i, Decl(callSignaturesWithOptionalParameters2.ts, 38, 3)) +>foo : Symbol(I.foo, Decl(callSignaturesWithOptionalParameters2.ts, 33, 29), Decl(callSignaturesWithOptionalParameters2.ts, 34, 31)) + +i.foo(1, 2); +>i.foo : Symbol(I.foo, Decl(callSignaturesWithOptionalParameters2.ts, 33, 29), Decl(callSignaturesWithOptionalParameters2.ts, 34, 31)) +>i : Symbol(i, Decl(callSignaturesWithOptionalParameters2.ts, 38, 3)) +>foo : Symbol(I.foo, Decl(callSignaturesWithOptionalParameters2.ts, 33, 29), Decl(callSignaturesWithOptionalParameters2.ts, 34, 31)) + +i.foo(1, 2, 3); +>i.foo : Symbol(I.foo, Decl(callSignaturesWithOptionalParameters2.ts, 33, 29), Decl(callSignaturesWithOptionalParameters2.ts, 34, 31)) +>i : Symbol(i, Decl(callSignaturesWithOptionalParameters2.ts, 38, 3)) +>foo : Symbol(I.foo, Decl(callSignaturesWithOptionalParameters2.ts, 33, 29), Decl(callSignaturesWithOptionalParameters2.ts, 34, 31)) + +var a: { +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters2.ts, 46, 3)) + + (x?: number); +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 47, 5)) + + (x?: number, y?: number); +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 48, 5)) +>y : Symbol(y, Decl(callSignaturesWithOptionalParameters2.ts, 48, 16)) + + foo(x: number, y?: number); +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 48, 29), Decl(callSignaturesWithOptionalParameters2.ts, 49, 31)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 49, 8)) +>y : Symbol(y, Decl(callSignaturesWithOptionalParameters2.ts, 49, 18)) + + foo(x: number, y?: number, z?: number); +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 48, 29), Decl(callSignaturesWithOptionalParameters2.ts, 49, 31)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 50, 8)) +>y : Symbol(y, Decl(callSignaturesWithOptionalParameters2.ts, 50, 18)) +>z : Symbol(z, Decl(callSignaturesWithOptionalParameters2.ts, 50, 30)) +} + +a(); +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters2.ts, 46, 3)) + +a(1); +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters2.ts, 46, 3)) + +a(1, 2); +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters2.ts, 46, 3)) + +a.foo(1); +>a.foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 48, 29), Decl(callSignaturesWithOptionalParameters2.ts, 49, 31)) +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters2.ts, 46, 3)) +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 48, 29), Decl(callSignaturesWithOptionalParameters2.ts, 49, 31)) + +a.foo(1, 2); +>a.foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 48, 29), Decl(callSignaturesWithOptionalParameters2.ts, 49, 31)) +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters2.ts, 46, 3)) +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 48, 29), Decl(callSignaturesWithOptionalParameters2.ts, 49, 31)) + +a.foo(1, 2, 3); +>a.foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 48, 29), Decl(callSignaturesWithOptionalParameters2.ts, 49, 31)) +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters2.ts, 46, 3)) +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 48, 29), Decl(callSignaturesWithOptionalParameters2.ts, 49, 31)) + diff --git a/tests/baselines/reference/callSignaturesWithOptionalParameters2.types b/tests/baselines/reference/callSignaturesWithOptionalParameters2.types index 602edd911fe..f726840752e 100644 --- a/tests/baselines/reference/callSignaturesWithOptionalParameters2.types +++ b/tests/baselines/reference/callSignaturesWithOptionalParameters2.types @@ -12,6 +12,7 @@ function foo(x?: number) { } foo(1); >foo(1) : any >foo : (x?: number) => any +>1 : number foo(); >foo() : any @@ -34,10 +35,13 @@ function foo2(x: number, y?: number) { } foo2(1); >foo2(1) : any >foo2 : { (x: number): any; (x: number, y?: number): any; } +>1 : number foo2(1, 2); >foo2(1, 2) : any >foo2 : { (x: number): any; (x: number, y?: number): any; } +>1 : number +>2 : number class C { >C : C @@ -80,18 +84,22 @@ c.foo(1); >c.foo : (x?: number) => any >c : C >foo : (x?: number) => any +>1 : number c.foo2(1); >c.foo2(1) : any >c.foo2 : { (x: number): any; (x: number, y?: number): any; } >c : C >foo2 : { (x: number): any; (x: number, y?: number): any; } +>1 : number c.foo2(1, 2); >c.foo2(1, 2) : any >c.foo2 : { (x: number): any; (x: number, y?: number): any; } >c : C >foo2 : { (x: number): any; (x: number, y?: number): any; } +>1 : number +>2 : number interface I { >I : I @@ -126,28 +134,37 @@ i(); i(1); >i(1) : any >i : I +>1 : number i(1, 2); >i(1, 2) : any >i : I +>1 : number +>2 : number i.foo(1); >i.foo(1) : any >i.foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } >i : I >foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } +>1 : number i.foo(1, 2); >i.foo(1, 2) : any >i.foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } >i : I >foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } +>1 : number +>2 : number i.foo(1, 2, 3); >i.foo(1, 2, 3) : any >i.foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } >i : I >foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } +>1 : number +>2 : number +>3 : number var a: { >a : { (x?: number): any; (x?: number, y?: number): any; foo(x: number, y?: number): any; foo(x: number, y?: number, z?: number): any; } @@ -178,26 +195,35 @@ a(); a(1); >a(1) : any >a : { (x?: number): any; (x?: number, y?: number): any; foo(x: number, y?: number): any; foo(x: number, y?: number, z?: number): any; } +>1 : number a(1, 2); >a(1, 2) : any >a : { (x?: number): any; (x?: number, y?: number): any; foo(x: number, y?: number): any; foo(x: number, y?: number, z?: number): any; } +>1 : number +>2 : number a.foo(1); >a.foo(1) : any >a.foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } >a : { (x?: number): any; (x?: number, y?: number): any; foo(x: number, y?: number): any; foo(x: number, y?: number, z?: number): any; } >foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } +>1 : number a.foo(1, 2); >a.foo(1, 2) : any >a.foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } >a : { (x?: number): any; (x?: number, y?: number): any; foo(x: number, y?: number): any; foo(x: number, y?: number, z?: number): any; } >foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } +>1 : number +>2 : number a.foo(1, 2, 3); >a.foo(1, 2, 3) : any >a.foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } >a : { (x?: number): any; (x?: number, y?: number): any; foo(x: number, y?: number): any; foo(x: number, y?: number, z?: number): any; } >foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } +>1 : number +>2 : number +>3 : number diff --git a/tests/baselines/reference/callWithSpreadES6.symbols b/tests/baselines/reference/callWithSpreadES6.symbols new file mode 100644 index 00000000000..0dd186210b2 --- /dev/null +++ b/tests/baselines/reference/callWithSpreadES6.symbols @@ -0,0 +1,166 @@ +=== tests/cases/conformance/expressions/functionCalls/callWithSpreadES6.ts === + +interface X { +>X : Symbol(X, Decl(callWithSpreadES6.ts, 0, 0)) + + foo(x: number, y: number, ...z: string[]); +>foo : Symbol(foo, Decl(callWithSpreadES6.ts, 1, 13)) +>x : Symbol(x, Decl(callWithSpreadES6.ts, 2, 8)) +>y : Symbol(y, Decl(callWithSpreadES6.ts, 2, 18)) +>z : Symbol(z, Decl(callWithSpreadES6.ts, 2, 29)) +} + +function foo(x: number, y: number, ...z: string[]) { +>foo : Symbol(foo, Decl(callWithSpreadES6.ts, 3, 1)) +>x : Symbol(x, Decl(callWithSpreadES6.ts, 5, 13)) +>y : Symbol(y, Decl(callWithSpreadES6.ts, 5, 23)) +>z : Symbol(z, Decl(callWithSpreadES6.ts, 5, 34)) +} + +var a: string[]; +>a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3)) + +var z: number[]; +>z : Symbol(z, Decl(callWithSpreadES6.ts, 9, 3)) + +var obj: X; +>obj : Symbol(obj, Decl(callWithSpreadES6.ts, 10, 3)) +>X : Symbol(X, Decl(callWithSpreadES6.ts, 0, 0)) + +var xa: X[]; +>xa : Symbol(xa, Decl(callWithSpreadES6.ts, 11, 3)) +>X : Symbol(X, Decl(callWithSpreadES6.ts, 0, 0)) + +foo(1, 2, "abc"); +>foo : Symbol(foo, Decl(callWithSpreadES6.ts, 3, 1)) + +foo(1, 2, ...a); +>foo : Symbol(foo, Decl(callWithSpreadES6.ts, 3, 1)) +>a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3)) + +foo(1, 2, ...a, "abc"); +>foo : Symbol(foo, Decl(callWithSpreadES6.ts, 3, 1)) +>a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3)) + +obj.foo(1, 2, "abc"); +>obj.foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>obj : Symbol(obj, Decl(callWithSpreadES6.ts, 10, 3)) +>foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) + +obj.foo(1, 2, ...a); +>obj.foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>obj : Symbol(obj, Decl(callWithSpreadES6.ts, 10, 3)) +>foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3)) + +obj.foo(1, 2, ...a, "abc"); +>obj.foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>obj : Symbol(obj, Decl(callWithSpreadES6.ts, 10, 3)) +>foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3)) + +(obj.foo)(1, 2, "abc"); +>obj.foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>obj : Symbol(obj, Decl(callWithSpreadES6.ts, 10, 3)) +>foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) + +(obj.foo)(1, 2, ...a); +>obj.foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>obj : Symbol(obj, Decl(callWithSpreadES6.ts, 10, 3)) +>foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3)) + +(obj.foo)(1, 2, ...a, "abc"); +>obj.foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>obj : Symbol(obj, Decl(callWithSpreadES6.ts, 10, 3)) +>foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3)) + +xa[1].foo(1, 2, "abc"); +>xa[1].foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>xa : Symbol(xa, Decl(callWithSpreadES6.ts, 11, 3)) +>foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) + +xa[1].foo(1, 2, ...a); +>xa[1].foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>xa : Symbol(xa, Decl(callWithSpreadES6.ts, 11, 3)) +>foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3)) + +xa[1].foo(1, 2, ...a, "abc"); +>xa[1].foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>xa : Symbol(xa, Decl(callWithSpreadES6.ts, 11, 3)) +>foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3)) + +(xa[1].foo)(...[1, 2, "abc"]); +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11), Decl(lib.d.ts, 1325, 1)) +>xa[1].foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>xa : Symbol(xa, Decl(callWithSpreadES6.ts, 11, 3)) +>foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) + +class C { +>C : Symbol(C, Decl(callWithSpreadES6.ts, 29, 40)) + + constructor(x: number, y: number, ...z: string[]) { +>x : Symbol(x, Decl(callWithSpreadES6.ts, 32, 16)) +>y : Symbol(y, Decl(callWithSpreadES6.ts, 32, 26)) +>z : Symbol(z, Decl(callWithSpreadES6.ts, 32, 37)) + + this.foo(x, y); +>this.foo : Symbol(foo, Decl(callWithSpreadES6.ts, 35, 5)) +>this : Symbol(C, Decl(callWithSpreadES6.ts, 29, 40)) +>foo : Symbol(foo, Decl(callWithSpreadES6.ts, 35, 5)) +>x : Symbol(x, Decl(callWithSpreadES6.ts, 32, 16)) +>y : Symbol(y, Decl(callWithSpreadES6.ts, 32, 26)) + + this.foo(x, y, ...z); +>this.foo : Symbol(foo, Decl(callWithSpreadES6.ts, 35, 5)) +>this : Symbol(C, Decl(callWithSpreadES6.ts, 29, 40)) +>foo : Symbol(foo, Decl(callWithSpreadES6.ts, 35, 5)) +>x : Symbol(x, Decl(callWithSpreadES6.ts, 32, 16)) +>y : Symbol(y, Decl(callWithSpreadES6.ts, 32, 26)) +>z : Symbol(z, Decl(callWithSpreadES6.ts, 32, 37)) + } + foo(x: number, y: number, ...z: string[]) { +>foo : Symbol(foo, Decl(callWithSpreadES6.ts, 35, 5)) +>x : Symbol(x, Decl(callWithSpreadES6.ts, 36, 8)) +>y : Symbol(y, Decl(callWithSpreadES6.ts, 36, 18)) +>z : Symbol(z, Decl(callWithSpreadES6.ts, 36, 29)) + } +} + +class D extends C { +>D : Symbol(D, Decl(callWithSpreadES6.ts, 38, 1)) +>C : Symbol(C, Decl(callWithSpreadES6.ts, 29, 40)) + + constructor() { + super(1, 2); +>super : Symbol(C, Decl(callWithSpreadES6.ts, 29, 40)) + + super(1, 2, ...a); +>super : Symbol(C, Decl(callWithSpreadES6.ts, 29, 40)) +>a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3)) + } + foo() { +>foo : Symbol(foo, Decl(callWithSpreadES6.ts, 44, 5)) + + super.foo(1, 2); +>super.foo : Symbol(C.foo, Decl(callWithSpreadES6.ts, 35, 5)) +>super : Symbol(C, Decl(callWithSpreadES6.ts, 29, 40)) +>foo : Symbol(C.foo, Decl(callWithSpreadES6.ts, 35, 5)) + + super.foo(1, 2, ...a); +>super.foo : Symbol(C.foo, Decl(callWithSpreadES6.ts, 35, 5)) +>super : Symbol(C, Decl(callWithSpreadES6.ts, 29, 40)) +>foo : Symbol(C.foo, Decl(callWithSpreadES6.ts, 35, 5)) +>a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3)) + } +} + +// Only supported in when target is ES6 +var c = new C(1, 2, ...a); +>c : Symbol(c, Decl(callWithSpreadES6.ts, 52, 3)) +>C : Symbol(C, Decl(callWithSpreadES6.ts, 29, 40)) +>a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3)) + diff --git a/tests/baselines/reference/callWithSpreadES6.types b/tests/baselines/reference/callWithSpreadES6.types index 10dd611d213..71d3cf9b2df 100644 --- a/tests/baselines/reference/callWithSpreadES6.types +++ b/tests/baselines/reference/callWithSpreadES6.types @@ -34,30 +34,43 @@ var xa: X[]; foo(1, 2, "abc"); >foo(1, 2, "abc") : void >foo : (x: number, y: number, ...z: string[]) => void +>1 : number +>2 : number +>"abc" : string foo(1, 2, ...a); >foo(1, 2, ...a) : void >foo : (x: number, y: number, ...z: string[]) => void +>1 : number +>2 : number >...a : string >a : string[] foo(1, 2, ...a, "abc"); >foo(1, 2, ...a, "abc") : void >foo : (x: number, y: number, ...z: string[]) => void +>1 : number +>2 : number >...a : string >a : string[] +>"abc" : string obj.foo(1, 2, "abc"); >obj.foo(1, 2, "abc") : any >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any +>1 : number +>2 : number +>"abc" : string obj.foo(1, 2, ...a); >obj.foo(1, 2, ...a) : any >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any +>1 : number +>2 : number >...a : string >a : string[] @@ -66,8 +79,11 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any +>1 : number +>2 : number >...a : string >a : string[] +>"abc" : string (obj.foo)(1, 2, "abc"); >(obj.foo)(1, 2, "abc") : any @@ -75,6 +91,9 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any +>1 : number +>2 : number +>"abc" : string (obj.foo)(1, 2, ...a); >(obj.foo)(1, 2, ...a) : any @@ -82,6 +101,8 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any +>1 : number +>2 : number >...a : string >a : string[] @@ -91,22 +112,32 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any +>1 : number +>2 : number >...a : string >a : string[] +>"abc" : string xa[1].foo(1, 2, "abc"); >xa[1].foo(1, 2, "abc") : any >xa[1].foo : (x: number, y: number, ...z: string[]) => any >xa[1] : X >xa : X[] +>1 : number >foo : (x: number, y: number, ...z: string[]) => any +>1 : number +>2 : number +>"abc" : string xa[1].foo(1, 2, ...a); >xa[1].foo(1, 2, ...a) : any >xa[1].foo : (x: number, y: number, ...z: string[]) => any >xa[1] : X >xa : X[] +>1 : number >foo : (x: number, y: number, ...z: string[]) => any +>1 : number +>2 : number >...a : string >a : string[] @@ -115,9 +146,13 @@ xa[1].foo(1, 2, ...a, "abc"); >xa[1].foo : (x: number, y: number, ...z: string[]) => any >xa[1] : X >xa : X[] +>1 : number >foo : (x: number, y: number, ...z: string[]) => any +>1 : number +>2 : number >...a : string >a : string[] +>"abc" : string (xa[1].foo)(...[1, 2, "abc"]); >(xa[1].foo)(...[1, 2, "abc"]) : any @@ -127,9 +162,13 @@ xa[1].foo(1, 2, ...a, "abc"); >xa[1].foo : (x: number, y: number, ...z: string[]) => any >xa[1] : X >xa : X[] +>1 : number >foo : (x: number, y: number, ...z: string[]) => any >...[1, 2, "abc"] : string | number >[1, 2, "abc"] : (string | number)[] +>1 : number +>2 : number +>"abc" : string class C { >C : C @@ -173,10 +212,14 @@ class D extends C { super(1, 2); >super(1, 2) : void >super : typeof C +>1 : number +>2 : number super(1, 2, ...a); >super(1, 2, ...a) : void >super : typeof C +>1 : number +>2 : number >...a : string >a : string[] } @@ -188,12 +231,16 @@ class D extends C { >super.foo : (x: number, y: number, ...z: string[]) => void >super : C >foo : (x: number, y: number, ...z: string[]) => void +>1 : number +>2 : number super.foo(1, 2, ...a); >super.foo(1, 2, ...a) : void >super.foo : (x: number, y: number, ...z: string[]) => void >super : C >foo : (x: number, y: number, ...z: string[]) => void +>1 : number +>2 : number >...a : string >a : string[] } @@ -204,6 +251,8 @@ var c = new C(1, 2, ...a); >c : C >new C(1, 2, ...a) : C >C : typeof C +>1 : number +>2 : number >...a : string >a : string[] diff --git a/tests/baselines/reference/callbacksDontShareTypes.symbols b/tests/baselines/reference/callbacksDontShareTypes.symbols new file mode 100644 index 00000000000..80a5f234d38 --- /dev/null +++ b/tests/baselines/reference/callbacksDontShareTypes.symbols @@ -0,0 +1,100 @@ +=== tests/cases/compiler/callbacksDontShareTypes.ts === +interface Collection { +>Collection : Symbol(Collection, Decl(callbacksDontShareTypes.ts, 0, 0)) +>T : Symbol(T, Decl(callbacksDontShareTypes.ts, 0, 21)) + + length: number; +>length : Symbol(length, Decl(callbacksDontShareTypes.ts, 0, 25)) + + add(x: T): void; +>add : Symbol(add, Decl(callbacksDontShareTypes.ts, 1, 19)) +>x : Symbol(x, Decl(callbacksDontShareTypes.ts, 2, 8)) +>T : Symbol(T, Decl(callbacksDontShareTypes.ts, 0, 21)) + + remove(x: T): boolean; +>remove : Symbol(remove, Decl(callbacksDontShareTypes.ts, 2, 20)) +>x : Symbol(x, Decl(callbacksDontShareTypes.ts, 3, 11)) +>T : Symbol(T, Decl(callbacksDontShareTypes.ts, 0, 21)) +} +interface Combinators { +>Combinators : Symbol(Combinators, Decl(callbacksDontShareTypes.ts, 4, 1)) + + map(c: Collection, f: (x: T) => U): Collection; +>map : Symbol(map, Decl(callbacksDontShareTypes.ts, 5, 23), Decl(callbacksDontShareTypes.ts, 6, 63)) +>T : Symbol(T, Decl(callbacksDontShareTypes.ts, 6, 8)) +>U : Symbol(U, Decl(callbacksDontShareTypes.ts, 6, 10)) +>c : Symbol(c, Decl(callbacksDontShareTypes.ts, 6, 14)) +>Collection : Symbol(Collection, Decl(callbacksDontShareTypes.ts, 0, 0)) +>T : Symbol(T, Decl(callbacksDontShareTypes.ts, 6, 8)) +>f : Symbol(f, Decl(callbacksDontShareTypes.ts, 6, 31)) +>x : Symbol(x, Decl(callbacksDontShareTypes.ts, 6, 36)) +>T : Symbol(T, Decl(callbacksDontShareTypes.ts, 6, 8)) +>U : Symbol(U, Decl(callbacksDontShareTypes.ts, 6, 10)) +>Collection : Symbol(Collection, Decl(callbacksDontShareTypes.ts, 0, 0)) +>U : Symbol(U, Decl(callbacksDontShareTypes.ts, 6, 10)) + + map(c: Collection, f: (x: T) => any): Collection; +>map : Symbol(map, Decl(callbacksDontShareTypes.ts, 5, 23), Decl(callbacksDontShareTypes.ts, 6, 63)) +>T : Symbol(T, Decl(callbacksDontShareTypes.ts, 7, 8)) +>c : Symbol(c, Decl(callbacksDontShareTypes.ts, 7, 11)) +>Collection : Symbol(Collection, Decl(callbacksDontShareTypes.ts, 0, 0)) +>T : Symbol(T, Decl(callbacksDontShareTypes.ts, 7, 8)) +>f : Symbol(f, Decl(callbacksDontShareTypes.ts, 7, 28)) +>x : Symbol(x, Decl(callbacksDontShareTypes.ts, 7, 33)) +>T : Symbol(T, Decl(callbacksDontShareTypes.ts, 7, 8)) +>Collection : Symbol(Collection, Decl(callbacksDontShareTypes.ts, 0, 0)) +} + +var _: Combinators; +>_ : Symbol(_, Decl(callbacksDontShareTypes.ts, 10, 3)) +>Combinators : Symbol(Combinators, Decl(callbacksDontShareTypes.ts, 4, 1)) + +var c2: Collection; +>c2 : Symbol(c2, Decl(callbacksDontShareTypes.ts, 11, 3)) +>Collection : Symbol(Collection, Decl(callbacksDontShareTypes.ts, 0, 0)) + +var rf1 = (x: number) => { return x.toFixed() }; +>rf1 : Symbol(rf1, Decl(callbacksDontShareTypes.ts, 13, 3)) +>x : Symbol(x, Decl(callbacksDontShareTypes.ts, 13, 11)) +>x.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) +>x : Symbol(x, Decl(callbacksDontShareTypes.ts, 13, 11)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) + +var r1a = _.map(c2, (x) => { return x.toFixed() }); +>r1a : Symbol(r1a, Decl(callbacksDontShareTypes.ts, 14, 3)) +>_.map : Symbol(Combinators.map, Decl(callbacksDontShareTypes.ts, 5, 23), Decl(callbacksDontShareTypes.ts, 6, 63)) +>_ : Symbol(_, Decl(callbacksDontShareTypes.ts, 10, 3)) +>map : Symbol(Combinators.map, Decl(callbacksDontShareTypes.ts, 5, 23), Decl(callbacksDontShareTypes.ts, 6, 63)) +>c2 : Symbol(c2, Decl(callbacksDontShareTypes.ts, 11, 3)) +>x : Symbol(x, Decl(callbacksDontShareTypes.ts, 14, 21)) +>x.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) +>x : Symbol(x, Decl(callbacksDontShareTypes.ts, 14, 21)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) + +var r1b = _.map(c2, rf1); // this line should not cause the following 2 to have errors +>r1b : Symbol(r1b, Decl(callbacksDontShareTypes.ts, 15, 3)) +>_.map : Symbol(Combinators.map, Decl(callbacksDontShareTypes.ts, 5, 23), Decl(callbacksDontShareTypes.ts, 6, 63)) +>_ : Symbol(_, Decl(callbacksDontShareTypes.ts, 10, 3)) +>map : Symbol(Combinators.map, Decl(callbacksDontShareTypes.ts, 5, 23), Decl(callbacksDontShareTypes.ts, 6, 63)) +>c2 : Symbol(c2, Decl(callbacksDontShareTypes.ts, 11, 3)) +>rf1 : Symbol(rf1, Decl(callbacksDontShareTypes.ts, 13, 3)) + +var r5a = _.map(c2, (x) => { return x.toFixed() }); +>r5a : Symbol(r5a, Decl(callbacksDontShareTypes.ts, 16, 3)) +>_.map : Symbol(Combinators.map, Decl(callbacksDontShareTypes.ts, 5, 23), Decl(callbacksDontShareTypes.ts, 6, 63)) +>_ : Symbol(_, Decl(callbacksDontShareTypes.ts, 10, 3)) +>map : Symbol(Combinators.map, Decl(callbacksDontShareTypes.ts, 5, 23), Decl(callbacksDontShareTypes.ts, 6, 63)) +>c2 : Symbol(c2, Decl(callbacksDontShareTypes.ts, 11, 3)) +>x : Symbol(x, Decl(callbacksDontShareTypes.ts, 16, 37)) +>x.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) +>x : Symbol(x, Decl(callbacksDontShareTypes.ts, 16, 37)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) + +var r5b = _.map(c2, rf1); +>r5b : Symbol(r5b, Decl(callbacksDontShareTypes.ts, 17, 3)) +>_.map : Symbol(Combinators.map, Decl(callbacksDontShareTypes.ts, 5, 23), Decl(callbacksDontShareTypes.ts, 6, 63)) +>_ : Symbol(_, Decl(callbacksDontShareTypes.ts, 10, 3)) +>map : Symbol(Combinators.map, Decl(callbacksDontShareTypes.ts, 5, 23), Decl(callbacksDontShareTypes.ts, 6, 63)) +>c2 : Symbol(c2, Decl(callbacksDontShareTypes.ts, 11, 3)) +>rf1 : Symbol(rf1, Decl(callbacksDontShareTypes.ts, 13, 3)) + diff --git a/tests/baselines/reference/captureThisInSuperCall.symbols b/tests/baselines/reference/captureThisInSuperCall.symbols new file mode 100644 index 00000000000..bf1fd151b3c --- /dev/null +++ b/tests/baselines/reference/captureThisInSuperCall.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/captureThisInSuperCall.ts === +class A { +>A : Symbol(A, Decl(captureThisInSuperCall.ts, 0, 0)) + + constructor(p:any) {} +>p : Symbol(p, Decl(captureThisInSuperCall.ts, 1, 16)) +} + +class B extends A { +>B : Symbol(B, Decl(captureThisInSuperCall.ts, 2, 1)) +>A : Symbol(A, Decl(captureThisInSuperCall.ts, 0, 0)) + + constructor() { super({ test: () => this.someMethod()}); } +>super : Symbol(A, Decl(captureThisInSuperCall.ts, 0, 0)) +>test : Symbol(test, Decl(captureThisInSuperCall.ts, 5, 27)) +>this.someMethod : Symbol(someMethod, Decl(captureThisInSuperCall.ts, 5, 62)) +>this : Symbol(B, Decl(captureThisInSuperCall.ts, 2, 1)) +>someMethod : Symbol(someMethod, Decl(captureThisInSuperCall.ts, 5, 62)) + + someMethod() {} +>someMethod : Symbol(someMethod, Decl(captureThisInSuperCall.ts, 5, 62)) +} diff --git a/tests/baselines/reference/castExpressionParentheses.symbols b/tests/baselines/reference/castExpressionParentheses.symbols new file mode 100644 index 00000000000..7bc8169e40f --- /dev/null +++ b/tests/baselines/reference/castExpressionParentheses.symbols @@ -0,0 +1,68 @@ +=== tests/cases/compiler/castExpressionParentheses.ts === +declare var a; +>a : Symbol(a, Decl(castExpressionParentheses.ts, 0, 11)) + +// parentheses should be omitted +// literals +({a:0}); +>a : Symbol(a, Decl(castExpressionParentheses.ts, 4, 7)) + +([1,3,]); +("string"); +(23.0); +(/regexp/g); +(false); +(true); +(null); +// names and dotted names +(this); +(this.x); +((a).x); +>a : Symbol(a, Decl(castExpressionParentheses.ts, 0, 11)) + +(a); +>a : Symbol(a, Decl(castExpressionParentheses.ts, 0, 11)) + +(a[0]); +>a : Symbol(a, Decl(castExpressionParentheses.ts, 0, 11)) + +(a.b["0"]); +>a : Symbol(a, Decl(castExpressionParentheses.ts, 0, 11)) + +(a()).x; +>a : Symbol(a, Decl(castExpressionParentheses.ts, 0, 11)) + +declare var A; +>A : Symbol(A, Decl(castExpressionParentheses.ts, 21, 11)) + +// should keep the parentheses in emit +(new A).foo; +>A : Symbol(A, Decl(castExpressionParentheses.ts, 21, 11)) + +(typeof A).x; +>A : Symbol(A, Decl(castExpressionParentheses.ts, 21, 11)) + +(-A).x; +>A : Symbol(A, Decl(castExpressionParentheses.ts, 21, 11)) + +new (A()); +>A : Symbol(A, Decl(castExpressionParentheses.ts, 21, 11)) + +(()=> {})(); +>Tany : Symbol(Tany, Decl(castExpressionParentheses.ts, 28, 2)) + +(function foo() { })(); +>foo : Symbol(foo, Decl(castExpressionParentheses.ts, 29, 6)) + +(-A).x; +>A : Symbol(A, Decl(castExpressionParentheses.ts, 21, 11)) + +// nested cast, should keep one pair of parenthese +((-A)).x; +>A : Symbol(A, Decl(castExpressionParentheses.ts, 21, 11)) + +// nested parenthesized expression, should keep one pair of parenthese +((A)) +>A : Symbol(A, Decl(castExpressionParentheses.ts, 21, 11)) + + diff --git a/tests/baselines/reference/castExpressionParentheses.types b/tests/baselines/reference/castExpressionParentheses.types index 7004aef9c95..ab563a4e8b7 100644 --- a/tests/baselines/reference/castExpressionParentheses.types +++ b/tests/baselines/reference/castExpressionParentheses.types @@ -9,35 +9,44 @@ declare var a; >{a:0} : any >{a:0} : { a: number; } >a : number +>0 : number ([1,3,]); >([1,3,]) : any >[1,3,] : any >[1,3,] : number[] +>1 : number +>3 : number ("string"); >("string") : any >"string" : any +>"string" : string (23.0); >(23.0) : any >23.0 : any +>23.0 : number (/regexp/g); >(/regexp/g) : any >/regexp/g : any +>/regexp/g : RegExp (false); >(false) : any >false : any +>false : boolean (true); >(true) : any >true : any +>true : boolean (null); >(null) : any >null : any +>null : null // names and dotted names (this); @@ -72,6 +81,7 @@ declare var a; >a[0] : any >a[0] : any >a : any +>0 : number (a.b["0"]); >(a.b["0"]) : any @@ -80,6 +90,7 @@ declare var a; >a.b : any >a : any >b : any +>"0" : string (a()).x; >(a()).x : any diff --git a/tests/baselines/reference/castNewObjectBug.symbols b/tests/baselines/reference/castNewObjectBug.symbols new file mode 100644 index 00000000000..3db7f7e065a --- /dev/null +++ b/tests/baselines/reference/castNewObjectBug.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/castNewObjectBug.ts === +interface Foo { } +>Foo : Symbol(Foo, Decl(castNewObjectBug.ts, 0, 0)) + +var xx = new Object(); +>xx : Symbol(xx, Decl(castNewObjectBug.ts, 1, 3)) +>Foo : Symbol(Foo, Decl(castNewObjectBug.ts, 0, 0)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + diff --git a/tests/baselines/reference/castParentheses.symbols b/tests/baselines/reference/castParentheses.symbols new file mode 100644 index 00000000000..6447c8721e2 --- /dev/null +++ b/tests/baselines/reference/castParentheses.symbols @@ -0,0 +1,42 @@ +=== tests/cases/compiler/castParentheses.ts === +class a { +>a : Symbol(a, Decl(castParentheses.ts, 0, 0)) + + static b: any; +>b : Symbol(a.b, Decl(castParentheses.ts, 0, 9)) +} + +var b = (a); +>b : Symbol(b, Decl(castParentheses.ts, 4, 3), Decl(castParentheses.ts, 5, 3), Decl(castParentheses.ts, 6, 3), Decl(castParentheses.ts, 7, 3), Decl(castParentheses.ts, 8, 3), Decl(castParentheses.ts, 9, 3), Decl(castParentheses.ts, 10, 3)) +>a : Symbol(a, Decl(castParentheses.ts, 0, 0)) + +var b = (a).b; +>b : Symbol(b, Decl(castParentheses.ts, 4, 3), Decl(castParentheses.ts, 5, 3), Decl(castParentheses.ts, 6, 3), Decl(castParentheses.ts, 7, 3), Decl(castParentheses.ts, 8, 3), Decl(castParentheses.ts, 9, 3), Decl(castParentheses.ts, 10, 3)) +>a : Symbol(a, Decl(castParentheses.ts, 0, 0)) + +var b = (a.b).c; +>b : Symbol(b, Decl(castParentheses.ts, 4, 3), Decl(castParentheses.ts, 5, 3), Decl(castParentheses.ts, 6, 3), Decl(castParentheses.ts, 7, 3), Decl(castParentheses.ts, 8, 3), Decl(castParentheses.ts, 9, 3), Decl(castParentheses.ts, 10, 3)) +>a.b : Symbol(a.b, Decl(castParentheses.ts, 0, 9)) +>a : Symbol(a, Decl(castParentheses.ts, 0, 0)) +>b : Symbol(a.b, Decl(castParentheses.ts, 0, 9)) + +var b = (a.b()).c; +>b : Symbol(b, Decl(castParentheses.ts, 4, 3), Decl(castParentheses.ts, 5, 3), Decl(castParentheses.ts, 6, 3), Decl(castParentheses.ts, 7, 3), Decl(castParentheses.ts, 8, 3), Decl(castParentheses.ts, 9, 3), Decl(castParentheses.ts, 10, 3)) +>a.b : Symbol(a.b, Decl(castParentheses.ts, 0, 9)) +>a : Symbol(a, Decl(castParentheses.ts, 0, 0)) +>b : Symbol(a.b, Decl(castParentheses.ts, 0, 9)) + +var b = (new a); +>b : Symbol(b, Decl(castParentheses.ts, 4, 3), Decl(castParentheses.ts, 5, 3), Decl(castParentheses.ts, 6, 3), Decl(castParentheses.ts, 7, 3), Decl(castParentheses.ts, 8, 3), Decl(castParentheses.ts, 9, 3), Decl(castParentheses.ts, 10, 3)) +>a : Symbol(a, Decl(castParentheses.ts, 0, 0)) + +var b = (new a.b); +>b : Symbol(b, Decl(castParentheses.ts, 4, 3), Decl(castParentheses.ts, 5, 3), Decl(castParentheses.ts, 6, 3), Decl(castParentheses.ts, 7, 3), Decl(castParentheses.ts, 8, 3), Decl(castParentheses.ts, 9, 3), Decl(castParentheses.ts, 10, 3)) +>a.b : Symbol(a.b, Decl(castParentheses.ts, 0, 9)) +>a : Symbol(a, Decl(castParentheses.ts, 0, 0)) +>b : Symbol(a.b, Decl(castParentheses.ts, 0, 9)) + +var b = (new a).b +>b : Symbol(b, Decl(castParentheses.ts, 4, 3), Decl(castParentheses.ts, 5, 3), Decl(castParentheses.ts, 6, 3), Decl(castParentheses.ts, 7, 3), Decl(castParentheses.ts, 8, 3), Decl(castParentheses.ts, 9, 3), Decl(castParentheses.ts, 10, 3)) +>a : Symbol(a, Decl(castParentheses.ts, 0, 0)) + diff --git a/tests/baselines/reference/castTest.symbols b/tests/baselines/reference/castTest.symbols new file mode 100644 index 00000000000..e0bf154820e --- /dev/null +++ b/tests/baselines/reference/castTest.symbols @@ -0,0 +1,85 @@ +=== tests/cases/compiler/castTest.ts === + +var x : any = 0; +>x : Symbol(x, Decl(castTest.ts, 1, 3)) + +var z = x; +>z : Symbol(z, Decl(castTest.ts, 2, 3)) +>x : Symbol(x, Decl(castTest.ts, 1, 3)) + +var y = x + z; +>y : Symbol(y, Decl(castTest.ts, 3, 3)) +>x : Symbol(x, Decl(castTest.ts, 1, 3)) +>z : Symbol(z, Decl(castTest.ts, 2, 3)) + +var a = 0; +>a : Symbol(a, Decl(castTest.ts, 5, 3)) + +var b = true; +>b : Symbol(b, Decl(castTest.ts, 6, 3)) + +var s = ""; +>s : Symbol(s, Decl(castTest.ts, 7, 3)) + +var ar = null; +>ar : Symbol(ar, Decl(castTest.ts, 9, 3)) + +var f = <(res : number) => void>null; +>f : Symbol(f, Decl(castTest.ts, 11, 3)) +>res : Symbol(res, Decl(castTest.ts, 11, 10)) + +declare class Point +>Point : Symbol(Point, Decl(castTest.ts, 11, 37)) +{ + x: number; +>x : Symbol(x, Decl(castTest.ts, 14, 1)) + + y: number; +>y : Symbol(y, Decl(castTest.ts, 15, 14)) + + add(dx: number, dy: number): Point; +>add : Symbol(add, Decl(castTest.ts, 16, 14)) +>dx : Symbol(dx, Decl(castTest.ts, 17, 8)) +>dy : Symbol(dy, Decl(castTest.ts, 17, 19)) +>Point : Symbol(Point, Decl(castTest.ts, 11, 37)) + + mult(p: Point): Point; +>mult : Symbol(mult, Decl(castTest.ts, 17, 39)) +>p : Symbol(p, Decl(castTest.ts, 18, 9)) +>Point : Symbol(Point, Decl(castTest.ts, 11, 37)) +>Point : Symbol(Point, Decl(castTest.ts, 11, 37)) + + constructor(x: number, y: number); +>x : Symbol(x, Decl(castTest.ts, 19, 16)) +>y : Symbol(y, Decl(castTest.ts, 19, 26)) +} + +var p_cast = ({ +>p_cast : Symbol(p_cast, Decl(castTest.ts, 22, 3)) +>Point : Symbol(Point, Decl(castTest.ts, 11, 37)) + + x: 0, +>x : Symbol(x, Decl(castTest.ts, 22, 23)) + + y: 0, +>y : Symbol(y, Decl(castTest.ts, 23, 9)) + + add: function(dx, dy) { +>add : Symbol(add, Decl(castTest.ts, 24, 9)) +>dx : Symbol(dx, Decl(castTest.ts, 25, 18)) +>dy : Symbol(dy, Decl(castTest.ts, 25, 21)) + + return new Point(this.x + dx, this.y + dy); +>Point : Symbol(Point, Decl(castTest.ts, 11, 37)) +>dx : Symbol(dx, Decl(castTest.ts, 25, 18)) +>dy : Symbol(dy, Decl(castTest.ts, 25, 21)) + + }, + mult: function(p) { return p; } +>mult : Symbol(mult, Decl(castTest.ts, 27, 6)) +>p : Symbol(p, Decl(castTest.ts, 28, 19)) +>p : Symbol(p, Decl(castTest.ts, 28, 19)) + +}) + + diff --git a/tests/baselines/reference/castTest.types b/tests/baselines/reference/castTest.types index 8250bec362d..35698219fd4 100644 --- a/tests/baselines/reference/castTest.types +++ b/tests/baselines/reference/castTest.types @@ -2,6 +2,7 @@ var x : any = 0; >x : any +>0 : number var z = x; >z : number @@ -17,23 +18,28 @@ var y = x + z; var a = 0; >a : any >0 : any +>0 : number var b = true; >b : boolean >true : boolean +>true : boolean var s = ""; >s : string >"" : string +>"" : string var ar = null; >ar : any[] >null : any[] +>null : null var f = <(res : number) => void>null; >f : (res: number) => void ><(res : number) => void>null : (res: number) => void >res : number +>null : null declare class Point >Point : Point @@ -70,9 +76,11 @@ var p_cast = ({ x: 0, >x : number +>0 : number y: 0, >y : number +>0 : number add: function(dx, dy) { >add : (dx: number, dy: number) => Point diff --git a/tests/baselines/reference/catch.symbols b/tests/baselines/reference/catch.symbols new file mode 100644 index 00000000000..155d262af58 --- /dev/null +++ b/tests/baselines/reference/catch.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/catch.ts === +function f() { +>f : Symbol(f, Decl(catch.ts, 0, 0)) + + try {} catch(e) { } +>e : Symbol(e, Decl(catch.ts, 1, 17)) + + try {} catch(e) { } +>e : Symbol(e, Decl(catch.ts, 2, 17)) +} + diff --git a/tests/baselines/reference/cf.symbols b/tests/baselines/reference/cf.symbols new file mode 100644 index 00000000000..9c2d73f5134 --- /dev/null +++ b/tests/baselines/reference/cf.symbols @@ -0,0 +1,111 @@ +=== tests/cases/compiler/cf.ts === +function f() { +>f : Symbol(f, Decl(cf.ts, 0, 0)) + + var z; +>z : Symbol(z, Decl(cf.ts, 1, 7)) + + var x=10; +>x : Symbol(x, Decl(cf.ts, 2, 7)) + + var y=3; +>y : Symbol(y, Decl(cf.ts, 3, 7)) + + L1: for (var i=0;i<19;i++) { +>i : Symbol(i, Decl(cf.ts, 5, 16)) +>i : Symbol(i, Decl(cf.ts, 5, 16)) +>i : Symbol(i, Decl(cf.ts, 5, 16)) + + if (y==7) { +>y : Symbol(y, Decl(cf.ts, 3, 7)) + + continue L1; + x=11; +>x : Symbol(x, Decl(cf.ts, 2, 7)) + } + if (y==3) { +>y : Symbol(y, Decl(cf.ts, 3, 7)) + + y++; +>y : Symbol(y, Decl(cf.ts, 3, 7)) + } + else { + y--; +>y : Symbol(y, Decl(cf.ts, 3, 7)) + } + do { + y+=2; +>y : Symbol(y, Decl(cf.ts, 3, 7)) + + if (y==20) { +>y : Symbol(y, Decl(cf.ts, 3, 7)) + + break; + x=12; +>x : Symbol(x, Decl(cf.ts, 2, 7)) + } + } while (y<41); +>y : Symbol(y, Decl(cf.ts, 3, 7)) + + y++; +>y : Symbol(y, Decl(cf.ts, 3, 7)) + } + while (y>2) { +>y : Symbol(y, Decl(cf.ts, 3, 7)) + + y=y>>1; +>y : Symbol(y, Decl(cf.ts, 3, 7)) +>y : Symbol(y, Decl(cf.ts, 3, 7)) + } + L2: try { + L3: if (xx : Symbol(x, Decl(cf.ts, 2, 7)) +>y : Symbol(y, Decl(cf.ts, 3, 7)) + + break L2; + x=13; +>x : Symbol(x, Decl(cf.ts, 2, 7)) + } + else { + break L3; + x=14; +>x : Symbol(x, Decl(cf.ts, 2, 7)) + } + } + catch (e) { +>e : Symbol(e, Decl(cf.ts, 38, 11)) + + x++; +>x : Symbol(x, Decl(cf.ts, 2, 7)) + } + finally { + x+=3; +>x : Symbol(x, Decl(cf.ts, 2, 7)) + } + y++; +>y : Symbol(y, Decl(cf.ts, 3, 7)) + + for (var k=0;k<10;k++) { +>k : Symbol(k, Decl(cf.ts, 45, 12)) +>k : Symbol(k, Decl(cf.ts, 45, 12)) +>k : Symbol(k, Decl(cf.ts, 45, 12)) + + z; +>z : Symbol(z, Decl(cf.ts, 1, 7)) + + break; + } + for (k=0;k<10;k++) { +>k : Symbol(k, Decl(cf.ts, 45, 12)) +>k : Symbol(k, Decl(cf.ts, 45, 12)) +>k : Symbol(k, Decl(cf.ts, 45, 12)) + + if (k==6) { +>k : Symbol(k, Decl(cf.ts, 45, 12)) + + continue; + } + break; + } +} + diff --git a/tests/baselines/reference/cf.types b/tests/baselines/reference/cf.types index 62dcba0ba9a..397e3469ece 100644 --- a/tests/baselines/reference/cf.types +++ b/tests/baselines/reference/cf.types @@ -7,29 +7,39 @@ function f() { var x=10; >x : number +>10 : number var y=3; >y : number +>3 : number L1: for (var i=0;i<19;i++) { +>L1 : any >i : number +>0 : number >i<19 : boolean >i : number +>19 : number >i++ : number >i : number if (y==7) { >y==7 : boolean >y : number +>7 : number continue L1; +>L1 : any + x=11; >x=11 : number >x : number +>11 : number } if (y==3) { >y==3 : boolean >y : number +>3 : number y++; >y++ : number @@ -44,19 +54,23 @@ function f() { y+=2; >y+=2 : number >y : number +>2 : number if (y==20) { >y==20 : boolean >y : number +>20 : number break; x=12; >x=12 : number >x : number +>12 : number } } while (y<41); >y<41 : boolean >y : number +>41 : number y++; >y++ : number @@ -65,29 +79,40 @@ function f() { while (y>2) { >y>2 : boolean >y : number +>2 : number y=y>>1; >y=y>>1 : number >y : number >y>>1 : number >y : number +>1 : number } L2: try { +>L2 : any + L3: if (xL3 : any >xx : number >y : number break L2; +>L2 : any + x=13; >x=13 : number >x : number +>13 : number } else { break L3; +>L3 : any + x=14; >x=14 : number >x : number +>14 : number } } catch (e) { @@ -101,6 +126,7 @@ function f() { x+=3; >x+=3 : number >x : number +>3 : number } y++; >y++ : number @@ -108,8 +134,10 @@ function f() { for (var k=0;k<10;k++) { >k : number +>0 : number >k<10 : boolean >k : number +>10 : number >k++ : number >k : number @@ -121,14 +149,17 @@ function f() { for (k=0;k<10;k++) { >k=0 : number >k : number +>0 : number >k<10 : boolean >k : number +>10 : number >k++ : number >k : number if (k==6) { >k==6 : boolean >k : number +>6 : number continue; } diff --git a/tests/baselines/reference/chainedAssignment2.symbols b/tests/baselines/reference/chainedAssignment2.symbols new file mode 100644 index 00000000000..84eb8428a64 --- /dev/null +++ b/tests/baselines/reference/chainedAssignment2.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/chainedAssignment2.ts === +var a: string; +>a : Symbol(a, Decl(chainedAssignment2.ts, 0, 3)) + +var b: number; +>b : Symbol(b, Decl(chainedAssignment2.ts, 1, 3)) + +var c: boolean; +>c : Symbol(c, Decl(chainedAssignment2.ts, 2, 3)) + +var d: Date; +>d : Symbol(d, Decl(chainedAssignment2.ts, 3, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var e: RegExp; +>e : Symbol(e, Decl(chainedAssignment2.ts, 4, 3)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) + +a = b = c = d = e = null; +>a : Symbol(a, Decl(chainedAssignment2.ts, 0, 3)) +>b : Symbol(b, Decl(chainedAssignment2.ts, 1, 3)) +>c : Symbol(c, Decl(chainedAssignment2.ts, 2, 3)) +>d : Symbol(d, Decl(chainedAssignment2.ts, 3, 3)) +>e : Symbol(e, Decl(chainedAssignment2.ts, 4, 3)) + + diff --git a/tests/baselines/reference/chainedAssignment2.types b/tests/baselines/reference/chainedAssignment2.types index 3ddd7412b9c..c53c64143d9 100644 --- a/tests/baselines/reference/chainedAssignment2.types +++ b/tests/baselines/reference/chainedAssignment2.types @@ -27,5 +27,6 @@ a = b = c = d = e = null; >d : Date >e = null : null >e : RegExp +>null : null diff --git a/tests/baselines/reference/chainedImportAlias.symbols b/tests/baselines/reference/chainedImportAlias.symbols new file mode 100644 index 00000000000..3aebb4502f8 --- /dev/null +++ b/tests/baselines/reference/chainedImportAlias.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/chainedImportAlias_file1.ts === +import x = require('chainedImportAlias_file0'); +>x : Symbol(x, Decl(chainedImportAlias_file1.ts, 0, 0)) + +import y = x; +>y : Symbol(y, Decl(chainedImportAlias_file1.ts, 0, 47)) +>x : Symbol(x, Decl(chainedImportAlias_file0.ts, 0, 0)) + +y.m.foo(); +>y.m.foo : Symbol(x.m.foo, Decl(chainedImportAlias_file0.ts, 0, 17)) +>y.m : Symbol(x.m, Decl(chainedImportAlias_file0.ts, 0, 0)) +>y : Symbol(y, Decl(chainedImportAlias_file1.ts, 0, 47)) +>m : Symbol(x.m, Decl(chainedImportAlias_file0.ts, 0, 0)) +>foo : Symbol(x.m.foo, Decl(chainedImportAlias_file0.ts, 0, 17)) + +=== tests/cases/compiler/chainedImportAlias_file0.ts === +export module m { +>m : Symbol(m, Decl(chainedImportAlias_file0.ts, 0, 0)) + + export function foo() { } +>foo : Symbol(foo, Decl(chainedImportAlias_file0.ts, 0, 17)) +} + diff --git a/tests/baselines/reference/chainedSpecializationToObjectTypeLiteral.symbols b/tests/baselines/reference/chainedSpecializationToObjectTypeLiteral.symbols new file mode 100644 index 00000000000..5eb563d3ef6 --- /dev/null +++ b/tests/baselines/reference/chainedSpecializationToObjectTypeLiteral.symbols @@ -0,0 +1,67 @@ +=== tests/cases/compiler/chainedSpecializationToObjectTypeLiteral.ts === +interface Sequence { +>Sequence : Symbol(Sequence, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 0)) +>T : Symbol(T, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 19)) + + each(iterator: (value: T) => void): void; +>each : Symbol(each, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 23)) +>iterator : Symbol(iterator, Decl(chainedSpecializationToObjectTypeLiteral.ts, 1, 9)) +>value : Symbol(value, Decl(chainedSpecializationToObjectTypeLiteral.ts, 1, 20)) +>T : Symbol(T, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 19)) + + map(iterator: (value: T) => U): Sequence; +>map : Symbol(map, Decl(chainedSpecializationToObjectTypeLiteral.ts, 1, 45)) +>U : Symbol(U, Decl(chainedSpecializationToObjectTypeLiteral.ts, 2, 8)) +>iterator : Symbol(iterator, Decl(chainedSpecializationToObjectTypeLiteral.ts, 2, 11)) +>value : Symbol(value, Decl(chainedSpecializationToObjectTypeLiteral.ts, 2, 22)) +>T : Symbol(T, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 19)) +>U : Symbol(U, Decl(chainedSpecializationToObjectTypeLiteral.ts, 2, 8)) +>Sequence : Symbol(Sequence, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 0)) +>U : Symbol(U, Decl(chainedSpecializationToObjectTypeLiteral.ts, 2, 8)) + + filter(iterator: (value: T) => boolean): Sequence; +>filter : Symbol(filter, Decl(chainedSpecializationToObjectTypeLiteral.ts, 2, 51)) +>iterator : Symbol(iterator, Decl(chainedSpecializationToObjectTypeLiteral.ts, 3, 11)) +>value : Symbol(value, Decl(chainedSpecializationToObjectTypeLiteral.ts, 3, 22)) +>T : Symbol(T, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 19)) +>Sequence : Symbol(Sequence, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 0)) +>T : Symbol(T, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 19)) + + groupBy(keySelector: (value: T) => K): Sequence<{ key: K; items: T[]; }>; +>groupBy : Symbol(groupBy, Decl(chainedSpecializationToObjectTypeLiteral.ts, 3, 57)) +>K : Symbol(K, Decl(chainedSpecializationToObjectTypeLiteral.ts, 4, 12)) +>keySelector : Symbol(keySelector, Decl(chainedSpecializationToObjectTypeLiteral.ts, 4, 15)) +>value : Symbol(value, Decl(chainedSpecializationToObjectTypeLiteral.ts, 4, 29)) +>T : Symbol(T, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 19)) +>K : Symbol(K, Decl(chainedSpecializationToObjectTypeLiteral.ts, 4, 12)) +>Sequence : Symbol(Sequence, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 0)) +>key : Symbol(key, Decl(chainedSpecializationToObjectTypeLiteral.ts, 4, 56)) +>K : Symbol(K, Decl(chainedSpecializationToObjectTypeLiteral.ts, 4, 12)) +>items : Symbol(items, Decl(chainedSpecializationToObjectTypeLiteral.ts, 4, 64)) +>T : Symbol(T, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 19)) +} + +var s: Sequence; +>s : Symbol(s, Decl(chainedSpecializationToObjectTypeLiteral.ts, 7, 3)) +>Sequence : Symbol(Sequence, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 0)) + +var s2 = s.groupBy(s => s.length); +>s2 : Symbol(s2, Decl(chainedSpecializationToObjectTypeLiteral.ts, 8, 3)) +>s.groupBy : Symbol(Sequence.groupBy, Decl(chainedSpecializationToObjectTypeLiteral.ts, 3, 57)) +>s : Symbol(s, Decl(chainedSpecializationToObjectTypeLiteral.ts, 7, 3)) +>groupBy : Symbol(Sequence.groupBy, Decl(chainedSpecializationToObjectTypeLiteral.ts, 3, 57)) +>s : Symbol(s, Decl(chainedSpecializationToObjectTypeLiteral.ts, 8, 19)) +>s.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>s : Symbol(s, Decl(chainedSpecializationToObjectTypeLiteral.ts, 8, 19)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + +var s3 = s2.each(x => { x.key /* Type is K, should be number */ }); +>s3 : Symbol(s3, Decl(chainedSpecializationToObjectTypeLiteral.ts, 9, 3)) +>s2.each : Symbol(Sequence.each, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 23)) +>s2 : Symbol(s2, Decl(chainedSpecializationToObjectTypeLiteral.ts, 8, 3)) +>each : Symbol(Sequence.each, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 23)) +>x : Symbol(x, Decl(chainedSpecializationToObjectTypeLiteral.ts, 9, 17)) +>x.key : Symbol(key, Decl(chainedSpecializationToObjectTypeLiteral.ts, 4, 56)) +>x : Symbol(x, Decl(chainedSpecializationToObjectTypeLiteral.ts, 9, 17)) +>key : Symbol(key, Decl(chainedSpecializationToObjectTypeLiteral.ts, 4, 56)) + diff --git a/tests/baselines/reference/checkInfiniteExpansionTermination.symbols b/tests/baselines/reference/checkInfiniteExpansionTermination.symbols new file mode 100644 index 00000000000..52ba8ad698e --- /dev/null +++ b/tests/baselines/reference/checkInfiniteExpansionTermination.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/checkInfiniteExpansionTermination.ts === +// Regression test for #1002 +// Before fix this code would cause infinite loop + +interface IObservable { +>IObservable : Symbol(IObservable, Decl(checkInfiniteExpansionTermination.ts, 0, 0)) +>T : Symbol(T, Decl(checkInfiniteExpansionTermination.ts, 3, 22)) + + n: IObservable; // Needed, must be T[] +>n : Symbol(n, Decl(checkInfiniteExpansionTermination.ts, 3, 26)) +>IObservable : Symbol(IObservable, Decl(checkInfiniteExpansionTermination.ts, 0, 0)) +>T : Symbol(T, Decl(checkInfiniteExpansionTermination.ts, 3, 22)) +} + +// Needed +interface ISubject extends IObservable { } +>ISubject : Symbol(ISubject, Decl(checkInfiniteExpansionTermination.ts, 5, 1)) +>T : Symbol(T, Decl(checkInfiniteExpansionTermination.ts, 8, 19)) +>IObservable : Symbol(IObservable, Decl(checkInfiniteExpansionTermination.ts, 0, 0)) +>T : Symbol(T, Decl(checkInfiniteExpansionTermination.ts, 8, 19)) + +interface Foo { x } +>Foo : Symbol(Foo, Decl(checkInfiniteExpansionTermination.ts, 8, 48)) +>x : Symbol(x, Decl(checkInfiniteExpansionTermination.ts, 10, 15)) + +interface Bar { y } +>Bar : Symbol(Bar, Decl(checkInfiniteExpansionTermination.ts, 10, 19)) +>y : Symbol(y, Decl(checkInfiniteExpansionTermination.ts, 11, 15)) + +var values: IObservable; +>values : Symbol(values, Decl(checkInfiniteExpansionTermination.ts, 13, 3)) +>IObservable : Symbol(IObservable, Decl(checkInfiniteExpansionTermination.ts, 0, 0)) +>Foo : Symbol(Foo, Decl(checkInfiniteExpansionTermination.ts, 8, 48)) + +var values2: ISubject; +>values2 : Symbol(values2, Decl(checkInfiniteExpansionTermination.ts, 14, 3)) +>ISubject : Symbol(ISubject, Decl(checkInfiniteExpansionTermination.ts, 5, 1)) +>Bar : Symbol(Bar, Decl(checkInfiniteExpansionTermination.ts, 10, 19)) + +values = values2; +>values : Symbol(values, Decl(checkInfiniteExpansionTermination.ts, 13, 3)) +>values2 : Symbol(values2, Decl(checkInfiniteExpansionTermination.ts, 14, 3)) + diff --git a/tests/baselines/reference/checkInfiniteExpansionTermination2.symbols b/tests/baselines/reference/checkInfiniteExpansionTermination2.symbols new file mode 100644 index 00000000000..c4fe17a09a6 --- /dev/null +++ b/tests/baselines/reference/checkInfiniteExpansionTermination2.symbols @@ -0,0 +1,44 @@ +=== tests/cases/compiler/checkInfiniteExpansionTermination2.ts === +// Regression test for #1002 +// Before fix this code would cause infinite loop + +interface IObservable { +>IObservable : Symbol(IObservable, Decl(checkInfiniteExpansionTermination2.ts, 0, 0)) +>T : Symbol(T, Decl(checkInfiniteExpansionTermination2.ts, 3, 22)) + + n: IObservable; +>n : Symbol(n, Decl(checkInfiniteExpansionTermination2.ts, 3, 26)) +>IObservable : Symbol(IObservable, Decl(checkInfiniteExpansionTermination2.ts, 0, 0)) +>T : Symbol(T, Decl(checkInfiniteExpansionTermination2.ts, 3, 22)) +} +interface ISubject extends IObservable { } +>ISubject : Symbol(ISubject, Decl(checkInfiniteExpansionTermination2.ts, 5, 1)) +>T : Symbol(T, Decl(checkInfiniteExpansionTermination2.ts, 6, 19)) +>IObservable : Symbol(IObservable, Decl(checkInfiniteExpansionTermination2.ts, 0, 0)) +>T : Symbol(T, Decl(checkInfiniteExpansionTermination2.ts, 6, 19)) + +declare function combineLatest(x: IObservable[]): void; +>combineLatest : Symbol(combineLatest, Decl(checkInfiniteExpansionTermination2.ts, 6, 48), Decl(checkInfiniteExpansionTermination2.ts, 8, 71)) +>TOther : Symbol(TOther, Decl(checkInfiniteExpansionTermination2.ts, 8, 31)) +>x : Symbol(x, Decl(checkInfiniteExpansionTermination2.ts, 8, 39)) +>IObservable : Symbol(IObservable, Decl(checkInfiniteExpansionTermination2.ts, 0, 0)) +>TOther : Symbol(TOther, Decl(checkInfiniteExpansionTermination2.ts, 8, 31)) + +declare function combineLatest(): void; +>combineLatest : Symbol(combineLatest, Decl(checkInfiniteExpansionTermination2.ts, 6, 48), Decl(checkInfiniteExpansionTermination2.ts, 8, 71)) + +function fn() { +>fn : Symbol(fn, Decl(checkInfiniteExpansionTermination2.ts, 9, 39)) +>T : Symbol(T, Decl(checkInfiniteExpansionTermination2.ts, 11, 12)) + + var values: ISubject[] = []; +>values : Symbol(values, Decl(checkInfiniteExpansionTermination2.ts, 12, 7)) +>ISubject : Symbol(ISubject, Decl(checkInfiniteExpansionTermination2.ts, 5, 1)) + + // Hang when using , but not + combineLatest(values); +>combineLatest : Symbol(combineLatest, Decl(checkInfiniteExpansionTermination2.ts, 6, 48), Decl(checkInfiniteExpansionTermination2.ts, 8, 71)) +>T : Symbol(T, Decl(checkInfiniteExpansionTermination2.ts, 11, 12)) +>values : Symbol(values, Decl(checkInfiniteExpansionTermination2.ts, 12, 7)) +} + diff --git a/tests/baselines/reference/checkInterfaceBases.symbols b/tests/baselines/reference/checkInterfaceBases.symbols new file mode 100644 index 00000000000..6b5f987b0bc --- /dev/null +++ b/tests/baselines/reference/checkInterfaceBases.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/app.ts === +/// +interface SecondEvent { +>SecondEvent : Symbol(SecondEvent, Decl(app.ts, 0, 0)) + + data: any; +>data : Symbol(data, Decl(app.ts, 1, 23)) +} +interface Third extends JQueryEventObjectTest, SecondEvent {} +>Third : Symbol(Third, Decl(app.ts, 3, 1)) +>JQueryEventObjectTest : Symbol(JQueryEventObjectTest, Decl(jquery.d.ts, 0, 0)) +>SecondEvent : Symbol(SecondEvent, Decl(app.ts, 0, 0)) + +=== tests/cases/compiler/jquery.d.ts === +interface JQueryEventObjectTest { +>JQueryEventObjectTest : Symbol(JQueryEventObjectTest, Decl(jquery.d.ts, 0, 0)) + + data: any; +>data : Symbol(data, Decl(jquery.d.ts, 0, 33)) + + which: number; +>which : Symbol(which, Decl(jquery.d.ts, 1, 14)) + + metaKey: any; +>metaKey : Symbol(metaKey, Decl(jquery.d.ts, 2, 18)) +} + diff --git a/tests/baselines/reference/circularImportAlias.symbols b/tests/baselines/reference/circularImportAlias.symbols new file mode 100644 index 00000000000..6eaa4a7467e --- /dev/null +++ b/tests/baselines/reference/circularImportAlias.symbols @@ -0,0 +1,47 @@ +=== tests/cases/conformance/internalModules/importDeclarations/circularImportAlias.ts === +// expected no error + +module B { +>B : Symbol(a.b, Decl(circularImportAlias.ts, 0, 0)) + + export import a = A; +>a : Symbol(a, Decl(circularImportAlias.ts, 2, 10)) +>A : Symbol(a, Decl(circularImportAlias.ts, 7, 1)) + + export class D extends a.C { +>D : Symbol(D, Decl(circularImportAlias.ts, 3, 24)) +>a.C : Symbol(a.C, Decl(circularImportAlias.ts, 9, 10)) +>a : Symbol(a, Decl(circularImportAlias.ts, 2, 10)) +>C : Symbol(a.C, Decl(circularImportAlias.ts, 9, 10)) + + id: number; +>id : Symbol(id, Decl(circularImportAlias.ts, 4, 32)) + } +} + +module A { +>A : Symbol(b.a, Decl(circularImportAlias.ts, 7, 1)) + + export class C { name: string } +>C : Symbol(C, Decl(circularImportAlias.ts, 9, 10)) +>name : Symbol(name, Decl(circularImportAlias.ts, 10, 20)) + + export import b = B; +>b : Symbol(b, Decl(circularImportAlias.ts, 10, 35)) +>B : Symbol(b, Decl(circularImportAlias.ts, 0, 0)) +} + +var c: { name: string }; +>c : Symbol(c, Decl(circularImportAlias.ts, 14, 3), Decl(circularImportAlias.ts, 15, 3)) +>name : Symbol(name, Decl(circularImportAlias.ts, 14, 8)) + +var c = new B.a.C(); +>c : Symbol(c, Decl(circularImportAlias.ts, 14, 3), Decl(circularImportAlias.ts, 15, 3)) +>B.a.C : Symbol(A.C, Decl(circularImportAlias.ts, 9, 10)) +>B.a : Symbol(B.a, Decl(circularImportAlias.ts, 2, 10)) +>B : Symbol(B, Decl(circularImportAlias.ts, 0, 0)) +>a : Symbol(B.a, Decl(circularImportAlias.ts, 2, 10)) +>C : Symbol(A.C, Decl(circularImportAlias.ts, 9, 10)) + + + diff --git a/tests/baselines/reference/circularImportAlias.types b/tests/baselines/reference/circularImportAlias.types index b61f91d460e..3ab41f6187b 100644 --- a/tests/baselines/reference/circularImportAlias.types +++ b/tests/baselines/reference/circularImportAlias.types @@ -10,6 +10,7 @@ module B { export class D extends a.C { >D : D +>a.C : any >a : typeof a >C : a.C diff --git a/tests/baselines/reference/classAppearsToHaveMembersOfObject.symbols b/tests/baselines/reference/classAppearsToHaveMembersOfObject.symbols new file mode 100644 index 00000000000..c035b17bcc6 --- /dev/null +++ b/tests/baselines/reference/classAppearsToHaveMembersOfObject.symbols @@ -0,0 +1,30 @@ +=== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classAppearsToHaveMembersOfObject.ts === +class C { foo: string; } +>C : Symbol(C, Decl(classAppearsToHaveMembersOfObject.ts, 0, 0)) +>foo : Symbol(foo, Decl(classAppearsToHaveMembersOfObject.ts, 0, 9)) + +var c: C; +>c : Symbol(c, Decl(classAppearsToHaveMembersOfObject.ts, 2, 3)) +>C : Symbol(C, Decl(classAppearsToHaveMembersOfObject.ts, 0, 0)) + +var r = c.toString(); +>r : Symbol(r, Decl(classAppearsToHaveMembersOfObject.ts, 3, 3)) +>c.toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) +>c : Symbol(c, Decl(classAppearsToHaveMembersOfObject.ts, 2, 3)) +>toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) + +var r2 = c.hasOwnProperty(''); +>r2 : Symbol(r2, Decl(classAppearsToHaveMembersOfObject.ts, 4, 3)) +>c.hasOwnProperty : Symbol(Object.hasOwnProperty, Decl(lib.d.ts, 105, 22)) +>c : Symbol(c, Decl(classAppearsToHaveMembersOfObject.ts, 2, 3)) +>hasOwnProperty : Symbol(Object.hasOwnProperty, Decl(lib.d.ts, 105, 22)) + +var o: Object = c; +>o : Symbol(o, Decl(classAppearsToHaveMembersOfObject.ts, 5, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>c : Symbol(c, Decl(classAppearsToHaveMembersOfObject.ts, 2, 3)) + +var o2: {} = c; +>o2 : Symbol(o2, Decl(classAppearsToHaveMembersOfObject.ts, 6, 3)) +>c : Symbol(c, Decl(classAppearsToHaveMembersOfObject.ts, 2, 3)) + diff --git a/tests/baselines/reference/classAppearsToHaveMembersOfObject.types b/tests/baselines/reference/classAppearsToHaveMembersOfObject.types index fe4079bbfcf..65c37e7dfeb 100644 --- a/tests/baselines/reference/classAppearsToHaveMembersOfObject.types +++ b/tests/baselines/reference/classAppearsToHaveMembersOfObject.types @@ -20,6 +20,7 @@ var r2 = c.hasOwnProperty(''); >c.hasOwnProperty : (v: string) => boolean >c : C >hasOwnProperty : (v: string) => boolean +>'' : string var o: Object = c; >o : Object diff --git a/tests/baselines/reference/classConstructorParametersAccessibility3.symbols b/tests/baselines/reference/classConstructorParametersAccessibility3.symbols new file mode 100644 index 00000000000..b2888528e7e --- /dev/null +++ b/tests/baselines/reference/classConstructorParametersAccessibility3.symbols @@ -0,0 +1,35 @@ +=== tests/cases/conformance/classes/constructorDeclarations/classConstructorParametersAccessibility3.ts === +class Base { +>Base : Symbol(Base, Decl(classConstructorParametersAccessibility3.ts, 0, 0)) + + constructor(protected p: number) { } +>p : Symbol(p, Decl(classConstructorParametersAccessibility3.ts, 1, 16)) +} + +class Derived extends Base { +>Derived : Symbol(Derived, Decl(classConstructorParametersAccessibility3.ts, 2, 1)) +>Base : Symbol(Base, Decl(classConstructorParametersAccessibility3.ts, 0, 0)) + + constructor(public p: number) { +>p : Symbol(p, Decl(classConstructorParametersAccessibility3.ts, 5, 16)) + + super(p); +>super : Symbol(Base, Decl(classConstructorParametersAccessibility3.ts, 0, 0)) +>p : Symbol(p, Decl(classConstructorParametersAccessibility3.ts, 5, 16)) + + this.p; // OK +>this.p : Symbol(p, Decl(classConstructorParametersAccessibility3.ts, 5, 16)) +>this : Symbol(Derived, Decl(classConstructorParametersAccessibility3.ts, 2, 1)) +>p : Symbol(p, Decl(classConstructorParametersAccessibility3.ts, 5, 16)) + } +} + +var d: Derived; +>d : Symbol(d, Decl(classConstructorParametersAccessibility3.ts, 11, 3)) +>Derived : Symbol(Derived, Decl(classConstructorParametersAccessibility3.ts, 2, 1)) + +d.p; // public, OK +>d.p : Symbol(Derived.p, Decl(classConstructorParametersAccessibility3.ts, 5, 16)) +>d : Symbol(d, Decl(classConstructorParametersAccessibility3.ts, 11, 3)) +>p : Symbol(Derived.p, Decl(classConstructorParametersAccessibility3.ts, 5, 16)) + diff --git a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.symbols b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.symbols new file mode 100644 index 00000000000..c30ed9c674d --- /dev/null +++ b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/classDeclarationMergedInModuleWithContinuation.ts === +module M { +>M : Symbol(M, Decl(classDeclarationMergedInModuleWithContinuation.ts, 0, 0), Decl(classDeclarationMergedInModuleWithContinuation.ts, 5, 1)) + + export class N { } +>N : Symbol(N, Decl(classDeclarationMergedInModuleWithContinuation.ts, 0, 10), Decl(classDeclarationMergedInModuleWithContinuation.ts, 1, 22)) + + export module N { +>N : Symbol(N, Decl(classDeclarationMergedInModuleWithContinuation.ts, 0, 10), Decl(classDeclarationMergedInModuleWithContinuation.ts, 1, 22)) + + export var v = 0; +>v : Symbol(v, Decl(classDeclarationMergedInModuleWithContinuation.ts, 3, 18)) + } +} + +module M { +>M : Symbol(M, Decl(classDeclarationMergedInModuleWithContinuation.ts, 0, 0), Decl(classDeclarationMergedInModuleWithContinuation.ts, 5, 1)) + + export class O extends M.N { +>O : Symbol(O, Decl(classDeclarationMergedInModuleWithContinuation.ts, 7, 10)) +>M.N : Symbol(N, Decl(classDeclarationMergedInModuleWithContinuation.ts, 0, 10), Decl(classDeclarationMergedInModuleWithContinuation.ts, 1, 22)) +>M : Symbol(M, Decl(classDeclarationMergedInModuleWithContinuation.ts, 0, 0), Decl(classDeclarationMergedInModuleWithContinuation.ts, 5, 1)) +>N : Symbol(N, Decl(classDeclarationMergedInModuleWithContinuation.ts, 0, 10), Decl(classDeclarationMergedInModuleWithContinuation.ts, 1, 22)) + } +} diff --git a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.types b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.types index 623515a7ec0..f1be8e6d268 100644 --- a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.types +++ b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.types @@ -10,6 +10,7 @@ module M { export var v = 0; >v : number +>0 : number } } @@ -18,6 +19,7 @@ module M { export class O extends M.N { >O : O +>M.N : any >M : typeof M >N : N } diff --git a/tests/baselines/reference/classDoesNotDependOnBaseTypes.js b/tests/baselines/reference/classDoesNotDependOnBaseTypes.js new file mode 100644 index 00000000000..a62d5b1532b --- /dev/null +++ b/tests/baselines/reference/classDoesNotDependOnBaseTypes.js @@ -0,0 +1,38 @@ +//// [classDoesNotDependOnBaseTypes.ts] +var x: StringTree; +if (typeof x !== "string") { + x[0] = ""; + x[0] = new StringTreeCollection; +} + +type StringTree = string | StringTreeCollection; +class StringTreeCollectionBase { + [n: number]: StringTree; +} + +class StringTreeCollection extends StringTreeCollectionBase { } + +//// [classDoesNotDependOnBaseTypes.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 x; +if (typeof x !== "string") { + x[0] = ""; + x[0] = new StringTreeCollection; +} +var StringTreeCollectionBase = (function () { + function StringTreeCollectionBase() { + } + return StringTreeCollectionBase; +})(); +var StringTreeCollection = (function (_super) { + __extends(StringTreeCollection, _super); + function StringTreeCollection() { + _super.apply(this, arguments); + } + return StringTreeCollection; +})(StringTreeCollectionBase); diff --git a/tests/baselines/reference/classDoesNotDependOnBaseTypes.symbols b/tests/baselines/reference/classDoesNotDependOnBaseTypes.symbols new file mode 100644 index 00000000000..e45b00f1e8a --- /dev/null +++ b/tests/baselines/reference/classDoesNotDependOnBaseTypes.symbols @@ -0,0 +1,32 @@ +=== tests/cases/conformance/types/typeAliases/classDoesNotDependOnBaseTypes.ts === +var x: StringTree; +>x : Symbol(x, Decl(classDoesNotDependOnBaseTypes.ts, 0, 3)) +>StringTree : Symbol(StringTree, Decl(classDoesNotDependOnBaseTypes.ts, 4, 1)) + +if (typeof x !== "string") { +>x : Symbol(x, Decl(classDoesNotDependOnBaseTypes.ts, 0, 3)) + + x[0] = ""; +>x : Symbol(x, Decl(classDoesNotDependOnBaseTypes.ts, 0, 3)) + + x[0] = new StringTreeCollection; +>x : Symbol(x, Decl(classDoesNotDependOnBaseTypes.ts, 0, 3)) +>StringTreeCollection : Symbol(StringTreeCollection, Decl(classDoesNotDependOnBaseTypes.ts, 9, 1)) +} + +type StringTree = string | StringTreeCollection; +>StringTree : Symbol(StringTree, Decl(classDoesNotDependOnBaseTypes.ts, 4, 1)) +>StringTreeCollection : Symbol(StringTreeCollection, Decl(classDoesNotDependOnBaseTypes.ts, 9, 1)) + +class StringTreeCollectionBase { +>StringTreeCollectionBase : Symbol(StringTreeCollectionBase, Decl(classDoesNotDependOnBaseTypes.ts, 6, 48)) + + [n: number]: StringTree; +>n : Symbol(n, Decl(classDoesNotDependOnBaseTypes.ts, 8, 5)) +>StringTree : Symbol(StringTree, Decl(classDoesNotDependOnBaseTypes.ts, 4, 1)) +} + +class StringTreeCollection extends StringTreeCollectionBase { } +>StringTreeCollection : Symbol(StringTreeCollection, Decl(classDoesNotDependOnBaseTypes.ts, 9, 1)) +>StringTreeCollectionBase : Symbol(StringTreeCollectionBase, Decl(classDoesNotDependOnBaseTypes.ts, 6, 48)) + diff --git a/tests/baselines/reference/classDoesNotDependOnBaseTypes.types b/tests/baselines/reference/classDoesNotDependOnBaseTypes.types new file mode 100644 index 00000000000..c342f0ea002 --- /dev/null +++ b/tests/baselines/reference/classDoesNotDependOnBaseTypes.types @@ -0,0 +1,43 @@ +=== tests/cases/conformance/types/typeAliases/classDoesNotDependOnBaseTypes.ts === +var x: StringTree; +>x : string | StringTreeCollection +>StringTree : string | StringTreeCollection + +if (typeof x !== "string") { +>typeof x !== "string" : boolean +>typeof x : string +>x : string | StringTreeCollection +>"string" : string + + x[0] = ""; +>x[0] = "" : string +>x[0] : string | StringTreeCollection +>x : StringTreeCollection +>0 : number +>"" : string + + x[0] = new StringTreeCollection; +>x[0] = new StringTreeCollection : StringTreeCollection +>x[0] : string | StringTreeCollection +>x : StringTreeCollection +>0 : number +>new StringTreeCollection : StringTreeCollection +>StringTreeCollection : typeof StringTreeCollection +} + +type StringTree = string | StringTreeCollection; +>StringTree : string | StringTreeCollection +>StringTreeCollection : StringTreeCollection + +class StringTreeCollectionBase { +>StringTreeCollectionBase : StringTreeCollectionBase + + [n: number]: StringTree; +>n : number +>StringTree : string | StringTreeCollection +} + +class StringTreeCollection extends StringTreeCollectionBase { } +>StringTreeCollection : StringTreeCollection +>StringTreeCollectionBase : StringTreeCollectionBase + diff --git a/tests/baselines/reference/classDoesNotDependOnPrivateMember.symbols b/tests/baselines/reference/classDoesNotDependOnPrivateMember.symbols new file mode 100644 index 00000000000..ca042499c05 --- /dev/null +++ b/tests/baselines/reference/classDoesNotDependOnPrivateMember.symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/declarationEmit/classDoesNotDependOnPrivateMember.ts === +module M { +>M : Symbol(M, Decl(classDoesNotDependOnPrivateMember.ts, 0, 0)) + + interface I { } +>I : Symbol(I, Decl(classDoesNotDependOnPrivateMember.ts, 0, 10)) + + export class C { +>C : Symbol(C, Decl(classDoesNotDependOnPrivateMember.ts, 1, 19)) + + private x: I; +>x : Symbol(x, Decl(classDoesNotDependOnPrivateMember.ts, 2, 20)) +>I : Symbol(I, Decl(classDoesNotDependOnPrivateMember.ts, 0, 10)) + } +} diff --git a/tests/baselines/reference/classExtendingClass.symbols b/tests/baselines/reference/classExtendingClass.symbols new file mode 100644 index 00000000000..3c79887d163 --- /dev/null +++ b/tests/baselines/reference/classExtendingClass.symbols @@ -0,0 +1,108 @@ +=== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingClass.ts === +class C { +>C : Symbol(C, Decl(classExtendingClass.ts, 0, 0)) + + foo: string; +>foo : Symbol(foo, Decl(classExtendingClass.ts, 0, 9)) + + thing() { } +>thing : Symbol(thing, Decl(classExtendingClass.ts, 1, 16)) + + static other() { } +>other : Symbol(C.other, Decl(classExtendingClass.ts, 2, 15)) +} + +class D extends C { +>D : Symbol(D, Decl(classExtendingClass.ts, 4, 1)) +>C : Symbol(C, Decl(classExtendingClass.ts, 0, 0)) + + bar: string; +>bar : Symbol(bar, Decl(classExtendingClass.ts, 6, 19)) +} + +var d: D; +>d : Symbol(d, Decl(classExtendingClass.ts, 10, 3)) +>D : Symbol(D, Decl(classExtendingClass.ts, 4, 1)) + +var r = d.foo; +>r : Symbol(r, Decl(classExtendingClass.ts, 11, 3)) +>d.foo : Symbol(C.foo, Decl(classExtendingClass.ts, 0, 9)) +>d : Symbol(d, Decl(classExtendingClass.ts, 10, 3)) +>foo : Symbol(C.foo, Decl(classExtendingClass.ts, 0, 9)) + +var r2 = d.bar; +>r2 : Symbol(r2, Decl(classExtendingClass.ts, 12, 3)) +>d.bar : Symbol(D.bar, Decl(classExtendingClass.ts, 6, 19)) +>d : Symbol(d, Decl(classExtendingClass.ts, 10, 3)) +>bar : Symbol(D.bar, Decl(classExtendingClass.ts, 6, 19)) + +var r3 = d.thing(); +>r3 : Symbol(r3, Decl(classExtendingClass.ts, 13, 3)) +>d.thing : Symbol(C.thing, Decl(classExtendingClass.ts, 1, 16)) +>d : Symbol(d, Decl(classExtendingClass.ts, 10, 3)) +>thing : Symbol(C.thing, Decl(classExtendingClass.ts, 1, 16)) + +var r4 = D.other(); +>r4 : Symbol(r4, Decl(classExtendingClass.ts, 14, 3)) +>D.other : Symbol(C.other, Decl(classExtendingClass.ts, 2, 15)) +>D : Symbol(D, Decl(classExtendingClass.ts, 4, 1)) +>other : Symbol(C.other, Decl(classExtendingClass.ts, 2, 15)) + +class C2 { +>C2 : Symbol(C2, Decl(classExtendingClass.ts, 14, 19)) +>T : Symbol(T, Decl(classExtendingClass.ts, 16, 9)) + + foo: T; +>foo : Symbol(foo, Decl(classExtendingClass.ts, 16, 13)) +>T : Symbol(T, Decl(classExtendingClass.ts, 16, 9)) + + thing(x: T) { } +>thing : Symbol(thing, Decl(classExtendingClass.ts, 17, 11)) +>x : Symbol(x, Decl(classExtendingClass.ts, 18, 10)) +>T : Symbol(T, Decl(classExtendingClass.ts, 16, 9)) + + static other(x: T) { } +>other : Symbol(C2.other, Decl(classExtendingClass.ts, 18, 19)) +>T : Symbol(T, Decl(classExtendingClass.ts, 19, 17)) +>x : Symbol(x, Decl(classExtendingClass.ts, 19, 20)) +>T : Symbol(T, Decl(classExtendingClass.ts, 19, 17)) +} + +class D2 extends C2 { +>D2 : Symbol(D2, Decl(classExtendingClass.ts, 20, 1)) +>T : Symbol(T, Decl(classExtendingClass.ts, 22, 9)) +>C2 : Symbol(C2, Decl(classExtendingClass.ts, 14, 19)) +>T : Symbol(T, Decl(classExtendingClass.ts, 22, 9)) + + bar: string; +>bar : Symbol(bar, Decl(classExtendingClass.ts, 22, 27)) +} + +var d2: D2; +>d2 : Symbol(d2, Decl(classExtendingClass.ts, 26, 3)) +>D2 : Symbol(D2, Decl(classExtendingClass.ts, 20, 1)) + +var r5 = d2.foo; +>r5 : Symbol(r5, Decl(classExtendingClass.ts, 27, 3)) +>d2.foo : Symbol(C2.foo, Decl(classExtendingClass.ts, 16, 13)) +>d2 : Symbol(d2, Decl(classExtendingClass.ts, 26, 3)) +>foo : Symbol(C2.foo, Decl(classExtendingClass.ts, 16, 13)) + +var r6 = d2.bar; +>r6 : Symbol(r6, Decl(classExtendingClass.ts, 28, 3)) +>d2.bar : Symbol(D2.bar, Decl(classExtendingClass.ts, 22, 27)) +>d2 : Symbol(d2, Decl(classExtendingClass.ts, 26, 3)) +>bar : Symbol(D2.bar, Decl(classExtendingClass.ts, 22, 27)) + +var r7 = d2.thing(''); +>r7 : Symbol(r7, Decl(classExtendingClass.ts, 29, 3)) +>d2.thing : Symbol(C2.thing, Decl(classExtendingClass.ts, 17, 11)) +>d2 : Symbol(d2, Decl(classExtendingClass.ts, 26, 3)) +>thing : Symbol(C2.thing, Decl(classExtendingClass.ts, 17, 11)) + +var r8 = D2.other(1); +>r8 : Symbol(r8, Decl(classExtendingClass.ts, 30, 3)) +>D2.other : Symbol(C2.other, Decl(classExtendingClass.ts, 18, 19)) +>D2 : Symbol(D2, Decl(classExtendingClass.ts, 20, 1)) +>other : Symbol(C2.other, Decl(classExtendingClass.ts, 18, 19)) + diff --git a/tests/baselines/reference/classExtendingClass.types b/tests/baselines/reference/classExtendingClass.types index 7eaaaecf17f..f91493e97fd 100644 --- a/tests/baselines/reference/classExtendingClass.types +++ b/tests/baselines/reference/classExtendingClass.types @@ -102,6 +102,7 @@ var r7 = d2.thing(''); >d2.thing : (x: string) => void >d2 : D2 >thing : (x: string) => void +>'' : string var r8 = D2.other(1); >r8 : void @@ -109,4 +110,5 @@ var r8 = D2.other(1); >D2.other : (x: T) => void >D2 : typeof D2 >other : (x: T) => void +>1 : number diff --git a/tests/baselines/reference/classExtendingQualifiedName2.symbols b/tests/baselines/reference/classExtendingQualifiedName2.symbols new file mode 100644 index 00000000000..a4c33530817 --- /dev/null +++ b/tests/baselines/reference/classExtendingQualifiedName2.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/classExtendingQualifiedName2.ts === +module M { +>M : Symbol(M, Decl(classExtendingQualifiedName2.ts, 0, 0)) + + export class C { +>C : Symbol(C, Decl(classExtendingQualifiedName2.ts, 0, 10)) + } + + class D extends M.C { +>D : Symbol(D, Decl(classExtendingQualifiedName2.ts, 2, 5)) +>M.C : Symbol(C, Decl(classExtendingQualifiedName2.ts, 0, 10)) +>M : Symbol(M, Decl(classExtendingQualifiedName2.ts, 0, 0)) +>C : Symbol(C, Decl(classExtendingQualifiedName2.ts, 0, 10)) + } +} diff --git a/tests/baselines/reference/classExtendingQualifiedName2.types b/tests/baselines/reference/classExtendingQualifiedName2.types index ba96058d9b2..9f0c03db17d 100644 --- a/tests/baselines/reference/classExtendingQualifiedName2.types +++ b/tests/baselines/reference/classExtendingQualifiedName2.types @@ -8,6 +8,7 @@ module M { class D extends M.C { >D : D +>M.C : any >M : typeof M >C : C } diff --git a/tests/baselines/reference/classImplementingInterfaceIndexer.symbols b/tests/baselines/reference/classImplementingInterfaceIndexer.symbols new file mode 100644 index 00000000000..17fb9f9734b --- /dev/null +++ b/tests/baselines/reference/classImplementingInterfaceIndexer.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/classImplementingInterfaceIndexer.ts === +interface I { +>I : Symbol(I, Decl(classImplementingInterfaceIndexer.ts, 0, 0)) + + [index: string]: { prop } +>index : Symbol(index, Decl(classImplementingInterfaceIndexer.ts, 1, 5)) +>prop : Symbol(prop, Decl(classImplementingInterfaceIndexer.ts, 1, 22)) +} +class A implements I { +>A : Symbol(A, Decl(classImplementingInterfaceIndexer.ts, 2, 1)) +>I : Symbol(I, Decl(classImplementingInterfaceIndexer.ts, 0, 0)) + + [index: string]: { prop } +>index : Symbol(index, Decl(classImplementingInterfaceIndexer.ts, 4, 5)) +>prop : Symbol(prop, Decl(classImplementingInterfaceIndexer.ts, 4, 22)) +} diff --git a/tests/baselines/reference/classImplementsClass1.symbols b/tests/baselines/reference/classImplementsClass1.symbols new file mode 100644 index 00000000000..007f8b1741e --- /dev/null +++ b/tests/baselines/reference/classImplementsClass1.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/classImplementsClass1.ts === +class A { } +>A : Symbol(A, Decl(classImplementsClass1.ts, 0, 0)) + +class C implements A { } +>C : Symbol(C, Decl(classImplementsClass1.ts, 0, 11)) +>A : Symbol(A, Decl(classImplementsClass1.ts, 0, 0)) + diff --git a/tests/baselines/reference/classImplementsClass3.symbols b/tests/baselines/reference/classImplementsClass3.symbols new file mode 100644 index 00000000000..a1c565c8d53 --- /dev/null +++ b/tests/baselines/reference/classImplementsClass3.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/classImplementsClass3.ts === +class A { foo(): number { return 1; } } +>A : Symbol(A, Decl(classImplementsClass3.ts, 0, 0)) +>foo : Symbol(foo, Decl(classImplementsClass3.ts, 0, 9)) + +class C implements A { +>C : Symbol(C, Decl(classImplementsClass3.ts, 0, 39)) +>A : Symbol(A, Decl(classImplementsClass3.ts, 0, 0)) + + foo() { +>foo : Symbol(foo, Decl(classImplementsClass3.ts, 1, 22)) + + return 1; + } +} + +class C2 extends A {} +>C2 : Symbol(C2, Decl(classImplementsClass3.ts, 5, 1)) +>A : Symbol(A, Decl(classImplementsClass3.ts, 0, 0)) + +// no errors +var c: C; +>c : Symbol(c, Decl(classImplementsClass3.ts, 10, 3)) +>C : Symbol(C, Decl(classImplementsClass3.ts, 0, 39)) + +var c2: C2; +>c2 : Symbol(c2, Decl(classImplementsClass3.ts, 11, 3)) +>C2 : Symbol(C2, Decl(classImplementsClass3.ts, 5, 1)) + +c = c2; +>c : Symbol(c, Decl(classImplementsClass3.ts, 10, 3)) +>c2 : Symbol(c2, Decl(classImplementsClass3.ts, 11, 3)) + +c2 = c; +>c2 : Symbol(c2, Decl(classImplementsClass3.ts, 11, 3)) +>c : Symbol(c, Decl(classImplementsClass3.ts, 10, 3)) + diff --git a/tests/baselines/reference/classImplementsClass3.types b/tests/baselines/reference/classImplementsClass3.types index 182ac535966..6f97a96a56e 100644 --- a/tests/baselines/reference/classImplementsClass3.types +++ b/tests/baselines/reference/classImplementsClass3.types @@ -2,6 +2,7 @@ class A { foo(): number { return 1; } } >A : A >foo : () => number +>1 : number class C implements A { >C : C @@ -11,6 +12,7 @@ class C implements A { >foo : () => number return 1; +>1 : number } } diff --git a/tests/baselines/reference/classImplementsImportedInterface.symbols b/tests/baselines/reference/classImplementsImportedInterface.symbols new file mode 100644 index 00000000000..a629d3c005d --- /dev/null +++ b/tests/baselines/reference/classImplementsImportedInterface.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/classImplementsImportedInterface.ts === +module M1 { +>M1 : Symbol(M1, Decl(classImplementsImportedInterface.ts, 0, 0)) + + export interface I { +>I : Symbol(I, Decl(classImplementsImportedInterface.ts, 0, 11)) + + foo(); +>foo : Symbol(foo, Decl(classImplementsImportedInterface.ts, 1, 24)) + } +} + +module M2 { +>M2 : Symbol(M2, Decl(classImplementsImportedInterface.ts, 4, 1)) + + import T = M1.I; +>T : Symbol(T, Decl(classImplementsImportedInterface.ts, 6, 11)) +>M1 : Symbol(M1, Decl(classImplementsImportedInterface.ts, 0, 0)) +>I : Symbol(T, Decl(classImplementsImportedInterface.ts, 0, 11)) + + class C implements T { +>C : Symbol(C, Decl(classImplementsImportedInterface.ts, 7, 20)) +>T : Symbol(T, Decl(classImplementsImportedInterface.ts, 6, 11)) + + foo() {} +>foo : Symbol(foo, Decl(classImplementsImportedInterface.ts, 8, 26)) + } +} diff --git a/tests/baselines/reference/classImplementsImportedInterface.types b/tests/baselines/reference/classImplementsImportedInterface.types index 74b0e81eb60..ce1c4e96e18 100644 --- a/tests/baselines/reference/classImplementsImportedInterface.types +++ b/tests/baselines/reference/classImplementsImportedInterface.types @@ -1,6 +1,6 @@ === tests/cases/compiler/classImplementsImportedInterface.ts === module M1 { ->M1 : unknown +>M1 : any export interface I { >I : I @@ -14,8 +14,8 @@ module M2 { >M2 : typeof M2 import T = M1.I; ->T : unknown ->M1 : unknown +>T : any +>M1 : any >I : T class C implements T { diff --git a/tests/baselines/reference/classIndexer.symbols b/tests/baselines/reference/classIndexer.symbols new file mode 100644 index 00000000000..8274beda930 --- /dev/null +++ b/tests/baselines/reference/classIndexer.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/classIndexer.ts === +class C123 { +>C123 : Symbol(C123, Decl(classIndexer.ts, 0, 0)) + + [s: string]: number; +>s : Symbol(s, Decl(classIndexer.ts, 1, 5)) + + constructor() { + } +} diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping5.symbols b/tests/baselines/reference/classMemberInitializerWithLamdaScoping5.symbols new file mode 100644 index 00000000000..585bae5b3c3 --- /dev/null +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping5.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/classMemberInitializerWithLamdaScoping5.ts === +declare var console: { +>console : Symbol(console, Decl(classMemberInitializerWithLamdaScoping5.ts, 0, 11)) + + log(message?: any, ...optionalParams: any[]): void; +>log : Symbol(log, Decl(classMemberInitializerWithLamdaScoping5.ts, 0, 22)) +>message : Symbol(message, Decl(classMemberInitializerWithLamdaScoping5.ts, 1, 8)) +>optionalParams : Symbol(optionalParams, Decl(classMemberInitializerWithLamdaScoping5.ts, 1, 22)) + +}; +class Greeter { +>Greeter : Symbol(Greeter, Decl(classMemberInitializerWithLamdaScoping5.ts, 2, 2)) + + constructor(message: string) { +>message : Symbol(message, Decl(classMemberInitializerWithLamdaScoping5.ts, 4, 16)) + } + + messageHandler = (message: string) => { +>messageHandler : Symbol(messageHandler, Decl(classMemberInitializerWithLamdaScoping5.ts, 5, 5)) +>message : Symbol(message, Decl(classMemberInitializerWithLamdaScoping5.ts, 7, 22)) + + console.log(message); // This shouldnt be error +>console.log : Symbol(log, Decl(classMemberInitializerWithLamdaScoping5.ts, 0, 22)) +>console : Symbol(console, Decl(classMemberInitializerWithLamdaScoping5.ts, 0, 11)) +>log : Symbol(log, Decl(classMemberInitializerWithLamdaScoping5.ts, 0, 22)) +>message : Symbol(message, Decl(classMemberInitializerWithLamdaScoping5.ts, 7, 22)) + } +} diff --git a/tests/baselines/reference/classMethodWithKeywordName1.symbols b/tests/baselines/reference/classMethodWithKeywordName1.symbols new file mode 100644 index 00000000000..af280f41036 --- /dev/null +++ b/tests/baselines/reference/classMethodWithKeywordName1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/classMethodWithKeywordName1.ts === +class C { +>C : Symbol(C, Decl(classMethodWithKeywordName1.ts, 0, 0)) + + static try() {} +>try : Symbol(C.try, Decl(classMethodWithKeywordName1.ts, 0, 9)) +} diff --git a/tests/baselines/reference/classOrder1.symbols b/tests/baselines/reference/classOrder1.symbols new file mode 100644 index 00000000000..4f1541ba9cd --- /dev/null +++ b/tests/baselines/reference/classOrder1.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/classOrder1.ts === +class A { +>A : Symbol(A, Decl(classOrder1.ts, 0, 0)) + + public foo() { +>foo : Symbol(foo, Decl(classOrder1.ts, 0, 9)) + + /*WScript.Echo("Here!");*/ + } +} + +var a = new A(); +>a : Symbol(a, Decl(classOrder1.ts, 6, 3)) +>A : Symbol(A, Decl(classOrder1.ts, 0, 0)) + +a.foo(); +>a.foo : Symbol(A.foo, Decl(classOrder1.ts, 0, 9)) +>a : Symbol(a, Decl(classOrder1.ts, 6, 3)) +>foo : Symbol(A.foo, Decl(classOrder1.ts, 0, 9)) + + + diff --git a/tests/baselines/reference/classOrder2.symbols b/tests/baselines/reference/classOrder2.symbols new file mode 100644 index 00000000000..4ee49d269a9 --- /dev/null +++ b/tests/baselines/reference/classOrder2.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/classOrder2.ts === + +class A extends B { +>A : Symbol(A, Decl(classOrder2.ts, 0, 0)) +>B : Symbol(B, Decl(classOrder2.ts, 5, 1)) + + foo() { this.bar(); } +>foo : Symbol(foo, Decl(classOrder2.ts, 1, 19)) +>this.bar : Symbol(B.bar, Decl(classOrder2.ts, 7, 9)) +>this : Symbol(A, Decl(classOrder2.ts, 0, 0)) +>bar : Symbol(B.bar, Decl(classOrder2.ts, 7, 9)) + +} + +class B { +>B : Symbol(B, Decl(classOrder2.ts, 5, 1)) + + bar() { } +>bar : Symbol(bar, Decl(classOrder2.ts, 7, 9)) + +} + + +var a = new A(); +>a : Symbol(a, Decl(classOrder2.ts, 14, 3)) +>A : Symbol(A, Decl(classOrder2.ts, 0, 0)) + +a.foo(); +>a.foo : Symbol(A.foo, Decl(classOrder2.ts, 1, 19)) +>a : Symbol(a, Decl(classOrder2.ts, 14, 3)) +>foo : Symbol(A.foo, Decl(classOrder2.ts, 1, 19)) + + diff --git a/tests/baselines/reference/classOrderBug.symbols b/tests/baselines/reference/classOrderBug.symbols new file mode 100644 index 00000000000..9065909180b --- /dev/null +++ b/tests/baselines/reference/classOrderBug.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/classOrderBug.ts === +class bar { +>bar : Symbol(bar, Decl(classOrderBug.ts, 0, 0)) + + public baz: foo; +>baz : Symbol(baz, Decl(classOrderBug.ts, 0, 11)) +>foo : Symbol(foo, Decl(classOrderBug.ts, 10, 12)) + + constructor() { + + this.baz = new foo(); +>this.baz : Symbol(baz, Decl(classOrderBug.ts, 0, 11)) +>this : Symbol(bar, Decl(classOrderBug.ts, 0, 0)) +>baz : Symbol(baz, Decl(classOrderBug.ts, 0, 11)) +>foo : Symbol(foo, Decl(classOrderBug.ts, 10, 12)) + + } + +} + +class baz {} +>baz : Symbol(baz, Decl(classOrderBug.ts, 8, 1)) + +class foo extends baz {} +>foo : Symbol(foo, Decl(classOrderBug.ts, 10, 12)) +>baz : Symbol(baz, Decl(classOrderBug.ts, 8, 1)) + + + diff --git a/tests/baselines/reference/classSideInheritance2.symbols b/tests/baselines/reference/classSideInheritance2.symbols new file mode 100644 index 00000000000..697aba99832 --- /dev/null +++ b/tests/baselines/reference/classSideInheritance2.symbols @@ -0,0 +1,45 @@ +=== tests/cases/compiler/classSideInheritance2.ts === +interface IText { +>IText : Symbol(IText, Decl(classSideInheritance2.ts, 0, 0)) + + foo: number; +>foo : Symbol(foo, Decl(classSideInheritance2.ts, 0, 17)) +} + +interface TextSpan {} +>TextSpan : Symbol(TextSpan, Decl(classSideInheritance2.ts, 2, 1)) + +class SubText extends TextBase { +>SubText : Symbol(SubText, Decl(classSideInheritance2.ts, 4, 21)) +>TextBase : Symbol(TextBase, Decl(classSideInheritance2.ts, 11, 1)) + + constructor(text: IText, span: TextSpan) { +>text : Symbol(text, Decl(classSideInheritance2.ts, 8, 20)) +>IText : Symbol(IText, Decl(classSideInheritance2.ts, 0, 0)) +>span : Symbol(span, Decl(classSideInheritance2.ts, 8, 32)) +>TextSpan : Symbol(TextSpan, Decl(classSideInheritance2.ts, 2, 1)) + + super(); +>super : Symbol(TextBase, Decl(classSideInheritance2.ts, 11, 1)) + } +} + +class TextBase implements IText { +>TextBase : Symbol(TextBase, Decl(classSideInheritance2.ts, 11, 1)) +>IText : Symbol(IText, Decl(classSideInheritance2.ts, 0, 0)) + + public foo: number; +>foo : Symbol(foo, Decl(classSideInheritance2.ts, 13, 33)) + + public subText(span: TextSpan): IText { +>subText : Symbol(subText, Decl(classSideInheritance2.ts, 14, 27)) +>span : Symbol(span, Decl(classSideInheritance2.ts, 15, 23)) +>TextSpan : Symbol(TextSpan, Decl(classSideInheritance2.ts, 2, 1)) +>IText : Symbol(IText, Decl(classSideInheritance2.ts, 0, 0)) + + return new SubText(this, span); +>SubText : Symbol(SubText, Decl(classSideInheritance2.ts, 4, 21)) +>this : Symbol(TextBase, Decl(classSideInheritance2.ts, 11, 1)) +>span : Symbol(span, Decl(classSideInheritance2.ts, 15, 23)) + } +} diff --git a/tests/baselines/reference/classUpdateTests.errors.txt b/tests/baselines/reference/classUpdateTests.errors.txt index 5d5c4a36ab3..e7f34fec546 100644 --- a/tests/baselines/reference/classUpdateTests.errors.txt +++ b/tests/baselines/reference/classUpdateTests.errors.txt @@ -13,12 +13,14 @@ tests/cases/compiler/classUpdateTests.ts(95,1): error TS1128: Declaration or sta tests/cases/compiler/classUpdateTests.ts(99,3): error TS1129: Statement expected. tests/cases/compiler/classUpdateTests.ts(101,1): error TS1128: Declaration or statement expected. tests/cases/compiler/classUpdateTests.ts(105,3): error TS1129: Statement expected. -tests/cases/compiler/classUpdateTests.ts(105,15): error TS2339: Property 'p1' does not exist on type 'Q'. +tests/cases/compiler/classUpdateTests.ts(105,14): error TS1005: ';' expected. +tests/cases/compiler/classUpdateTests.ts(107,1): error TS1128: Declaration or statement expected. tests/cases/compiler/classUpdateTests.ts(111,3): error TS1129: Statement expected. -tests/cases/compiler/classUpdateTests.ts(111,16): error TS2339: Property 'p1' does not exist on type 'R'. +tests/cases/compiler/classUpdateTests.ts(111,15): error TS1005: ';' expected. +tests/cases/compiler/classUpdateTests.ts(113,1): error TS1128: Declaration or statement expected. -==== tests/cases/compiler/classUpdateTests.ts (16 errors) ==== +==== tests/cases/compiler/classUpdateTests.ts (18 errors) ==== // // test codegen for instance properties // @@ -158,17 +160,21 @@ tests/cases/compiler/classUpdateTests.ts(111,16): error TS2339: Property 'p1' do public this.p1 = 0; // ERROR ~~~~~~ !!! error TS1129: Statement expected. - ~~ -!!! error TS2339: Property 'p1' does not exist on type 'Q'. + ~ +!!! error TS1005: ';' expected. } } + ~ +!!! error TS1128: Declaration or statement expected. class R { constructor() { private this.p1 = 0; // ERROR ~~~~~~~ !!! error TS1129: Statement expected. - ~~ -!!! error TS2339: Property 'p1' does not exist on type 'R'. + ~ +!!! error TS1005: ';' expected. } - } \ No newline at end of file + } + ~ +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/classWithEmptyBody.symbols b/tests/baselines/reference/classWithEmptyBody.symbols new file mode 100644 index 00000000000..e08b0fe03af --- /dev/null +++ b/tests/baselines/reference/classWithEmptyBody.symbols @@ -0,0 +1,49 @@ +=== tests/cases/conformance/classes/classDeclarations/classBody/classWithEmptyBody.ts === +class C { +>C : Symbol(C, Decl(classWithEmptyBody.ts, 0, 0)) +} + +var c: C; +>c : Symbol(c, Decl(classWithEmptyBody.ts, 3, 3)) +>C : Symbol(C, Decl(classWithEmptyBody.ts, 0, 0)) + +var o: {} = c; +>o : Symbol(o, Decl(classWithEmptyBody.ts, 4, 3), Decl(classWithEmptyBody.ts, 16, 3)) +>c : Symbol(c, Decl(classWithEmptyBody.ts, 3, 3)) + +c = 1; +>c : Symbol(c, Decl(classWithEmptyBody.ts, 3, 3)) + +c = { foo: '' } +>c : Symbol(c, Decl(classWithEmptyBody.ts, 3, 3)) +>foo : Symbol(foo, Decl(classWithEmptyBody.ts, 6, 5)) + +c = () => { } +>c : Symbol(c, Decl(classWithEmptyBody.ts, 3, 3)) + +class D { +>D : Symbol(D, Decl(classWithEmptyBody.ts, 7, 13)) + + constructor() { + return 1; + } +} + +var d: D; +>d : Symbol(d, Decl(classWithEmptyBody.ts, 15, 3)) +>D : Symbol(D, Decl(classWithEmptyBody.ts, 7, 13)) + +var o: {} = d; +>o : Symbol(o, Decl(classWithEmptyBody.ts, 4, 3), Decl(classWithEmptyBody.ts, 16, 3)) +>d : Symbol(d, Decl(classWithEmptyBody.ts, 15, 3)) + +d = 1; +>d : Symbol(d, Decl(classWithEmptyBody.ts, 15, 3)) + +d = { foo: '' } +>d : Symbol(d, Decl(classWithEmptyBody.ts, 15, 3)) +>foo : Symbol(foo, Decl(classWithEmptyBody.ts, 18, 5)) + +d = () => { } +>d : Symbol(d, Decl(classWithEmptyBody.ts, 15, 3)) + diff --git a/tests/baselines/reference/classWithEmptyBody.types b/tests/baselines/reference/classWithEmptyBody.types index ccf3c8556e0..1ac111796e8 100644 --- a/tests/baselines/reference/classWithEmptyBody.types +++ b/tests/baselines/reference/classWithEmptyBody.types @@ -14,12 +14,14 @@ var o: {} = c; c = 1; >c = 1 : number >c : C +>1 : number c = { foo: '' } >c = { foo: '' } : { foo: string; } >c : C >{ foo: '' } : { foo: string; } >foo : string +>'' : string c = () => { } >c = () => { } : () => void @@ -31,6 +33,7 @@ class D { constructor() { return 1; +>1 : number } } @@ -45,12 +48,14 @@ var o: {} = d; d = 1; >d = 1 : number >d : D +>1 : number d = { foo: '' } >d = { foo: '' } : { foo: string; } >d : D >{ foo: '' } : { foo: string; } >foo : string +>'' : string d = () => { } >d = () => { } : () => void diff --git a/tests/baselines/reference/classWithNoConstructorOrBaseClass.symbols b/tests/baselines/reference/classWithNoConstructorOrBaseClass.symbols new file mode 100644 index 00000000000..0d26f892dec --- /dev/null +++ b/tests/baselines/reference/classWithNoConstructorOrBaseClass.symbols @@ -0,0 +1,42 @@ +=== tests/cases/conformance/classes/members/constructorFunctionTypes/classWithNoConstructorOrBaseClass.ts === +class C { +>C : Symbol(C, Decl(classWithNoConstructorOrBaseClass.ts, 0, 0)) + + x: string; +>x : Symbol(x, Decl(classWithNoConstructorOrBaseClass.ts, 0, 9)) +} + +var c = new C(); +>c : Symbol(c, Decl(classWithNoConstructorOrBaseClass.ts, 4, 3)) +>C : Symbol(C, Decl(classWithNoConstructorOrBaseClass.ts, 0, 0)) + +var r = C; +>r : Symbol(r, Decl(classWithNoConstructorOrBaseClass.ts, 5, 3)) +>C : Symbol(C, Decl(classWithNoConstructorOrBaseClass.ts, 0, 0)) + +class D { +>D : Symbol(D, Decl(classWithNoConstructorOrBaseClass.ts, 5, 10)) +>T : Symbol(T, Decl(classWithNoConstructorOrBaseClass.ts, 7, 8)) +>U : Symbol(U, Decl(classWithNoConstructorOrBaseClass.ts, 7, 10)) + + x: T; +>x : Symbol(x, Decl(classWithNoConstructorOrBaseClass.ts, 7, 14)) +>T : Symbol(T, Decl(classWithNoConstructorOrBaseClass.ts, 7, 8)) + + y: U; +>y : Symbol(y, Decl(classWithNoConstructorOrBaseClass.ts, 8, 9)) +>U : Symbol(U, Decl(classWithNoConstructorOrBaseClass.ts, 7, 10)) +} + +var d = new D(); +>d : Symbol(d, Decl(classWithNoConstructorOrBaseClass.ts, 12, 3)) +>D : Symbol(D, Decl(classWithNoConstructorOrBaseClass.ts, 5, 10)) + +var d2 = new D(); +>d2 : Symbol(d2, Decl(classWithNoConstructorOrBaseClass.ts, 13, 3)) +>D : Symbol(D, Decl(classWithNoConstructorOrBaseClass.ts, 5, 10)) + +var r2 = D; +>r2 : Symbol(r2, Decl(classWithNoConstructorOrBaseClass.ts, 14, 3)) +>D : Symbol(D, Decl(classWithNoConstructorOrBaseClass.ts, 5, 10)) + diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.symbols b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.symbols new file mode 100644 index 00000000000..7239eac77e6 --- /dev/null +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.symbols @@ -0,0 +1,71 @@ +=== tests/cases/conformance/types/namedTypes/classWithOnlyPublicMembersEquivalentToInterface.ts === +// no errors expected + +class C { +>C : Symbol(C, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 0, 0)) + + public x: string; +>x : Symbol(x, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 2, 9)) + + public y(a: number): number { return null; } +>y : Symbol(y, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 3, 21)) +>a : Symbol(a, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 4, 13)) + + public get z() { return 1; } +>z : Symbol(z, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 4, 48), Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 5, 32)) + + public set z(v) { } +>z : Symbol(z, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 4, 48), Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 5, 32)) +>v : Symbol(v, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 6, 17)) + + [x: string]: Object; +>x : Symbol(x, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 7, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + [x: number]: Object; +>x : Symbol(x, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 8, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + 0: number; +} + +interface I { +>I : Symbol(I, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 10, 1)) + + x: string; +>x : Symbol(x, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 12, 13)) + + y(b: number): number; +>y : Symbol(y, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 13, 14)) +>b : Symbol(b, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 14, 6)) + + z: number; +>z : Symbol(z, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 14, 25)) + + [x: string]: Object; +>x : Symbol(x, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 16, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + [x: number]: Object; +>x : Symbol(x, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 17, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + 0: number; +} + +var c: C; +>c : Symbol(c, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 21, 3)) +>C : Symbol(C, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 0, 0)) + +var i: I; +>i : Symbol(i, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 22, 3)) +>I : Symbol(I, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 10, 1)) + +c = i; +>c : Symbol(c, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 21, 3)) +>i : Symbol(i, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 22, 3)) + +i = c; +>i : Symbol(i, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 22, 3)) +>c : Symbol(c, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 21, 3)) + diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.types b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.types index 9f6d031bf20..94460dfdeaf 100644 --- a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.types +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.types @@ -10,9 +10,11 @@ class C { public y(a: number): number { return null; } >y : (a: number) => number >a : number +>null : null public get z() { return 1; } >z : number +>1 : number public set z(v) { } >z : number diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.symbols b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.symbols new file mode 100644 index 00000000000..48bcbfa5149 --- /dev/null +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.symbols @@ -0,0 +1,74 @@ +=== tests/cases/conformance/types/namedTypes/classWithOnlyPublicMembersEquivalentToInterface2.ts === +// no errors expected + +class C { +>C : Symbol(C, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 0, 0)) + + public x: string; +>x : Symbol(x, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 2, 9)) + + public y(a: number): number { return null; } +>y : Symbol(y, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 3, 21)) +>a : Symbol(a, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 4, 13)) + + public get z() { return 1; } +>z : Symbol(z, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 4, 48), Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 5, 32)) + + public set z(v) { } +>z : Symbol(z, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 4, 48), Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 5, 32)) +>v : Symbol(v, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 6, 17)) + + [x: string]: Object; +>x : Symbol(x, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 7, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + [x: number]: Object; +>x : Symbol(x, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 8, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + 0: number; + + public static foo: string; // doesn't effect equivalence +>foo : Symbol(C.foo, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 9, 14)) +} + +interface I { +>I : Symbol(I, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 12, 1)) + + x: string; +>x : Symbol(x, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 14, 13)) + + y(b: number): number; +>y : Symbol(y, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 15, 14)) +>b : Symbol(b, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 16, 6)) + + z: number; +>z : Symbol(z, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 16, 25)) + + [x: string]: Object; +>x : Symbol(x, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 18, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + [x: number]: Object; +>x : Symbol(x, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 19, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + 0: number; +} + +var c: C; +>c : Symbol(c, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 23, 3)) +>C : Symbol(C, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 0, 0)) + +var i: I; +>i : Symbol(i, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 24, 3)) +>I : Symbol(I, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 12, 1)) + +c = i; +>c : Symbol(c, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 23, 3)) +>i : Symbol(i, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 24, 3)) + +i = c; +>i : Symbol(i, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 24, 3)) +>c : Symbol(c, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 23, 3)) + diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.types b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.types index be504f895fd..b359713f292 100644 --- a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.types +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.types @@ -10,9 +10,11 @@ class C { public y(a: number): number { return null; } >y : (a: number) => number >a : number +>null : null public get z() { return 1; } >z : number +>1 : number public set z(v) { } >z : number diff --git a/tests/baselines/reference/classWithProtectedProperty.symbols b/tests/baselines/reference/classWithProtectedProperty.symbols new file mode 100644 index 00000000000..017233081b2 --- /dev/null +++ b/tests/baselines/reference/classWithProtectedProperty.symbols @@ -0,0 +1,92 @@ +=== tests/cases/conformance/types/members/classWithProtectedProperty.ts === +// accessing any protected outside the class is an error + +class C { +>C : Symbol(C, Decl(classWithProtectedProperty.ts, 0, 0)) + + protected x; +>x : Symbol(x, Decl(classWithProtectedProperty.ts, 2, 9)) + + protected a = ''; +>a : Symbol(a, Decl(classWithProtectedProperty.ts, 3, 16)) + + protected b: string = ''; +>b : Symbol(b, Decl(classWithProtectedProperty.ts, 4, 21)) + + protected c() { return '' } +>c : Symbol(c, Decl(classWithProtectedProperty.ts, 5, 29)) + + protected d = () => ''; +>d : Symbol(d, Decl(classWithProtectedProperty.ts, 6, 31)) + + protected static e; +>e : Symbol(C.e, Decl(classWithProtectedProperty.ts, 7, 27)) + + protected static f() { return '' } +>f : Symbol(C.f, Decl(classWithProtectedProperty.ts, 8, 23)) + + protected static g = () => ''; +>g : Symbol(C.g, Decl(classWithProtectedProperty.ts, 9, 38)) +} + +class D extends C { +>D : Symbol(D, Decl(classWithProtectedProperty.ts, 11, 1)) +>C : Symbol(C, Decl(classWithProtectedProperty.ts, 0, 0)) + + method() { +>method : Symbol(method, Decl(classWithProtectedProperty.ts, 13, 19)) + + // No errors + var d = new D(); +>d : Symbol(d, Decl(classWithProtectedProperty.ts, 16, 11)) +>D : Symbol(D, Decl(classWithProtectedProperty.ts, 11, 1)) + + var r1: string = d.x; +>r1 : Symbol(r1, Decl(classWithProtectedProperty.ts, 17, 11)) +>d.x : Symbol(C.x, Decl(classWithProtectedProperty.ts, 2, 9)) +>d : Symbol(d, Decl(classWithProtectedProperty.ts, 16, 11)) +>x : Symbol(C.x, Decl(classWithProtectedProperty.ts, 2, 9)) + + var r2: string = d.a; +>r2 : Symbol(r2, Decl(classWithProtectedProperty.ts, 18, 11)) +>d.a : Symbol(C.a, Decl(classWithProtectedProperty.ts, 3, 16)) +>d : Symbol(d, Decl(classWithProtectedProperty.ts, 16, 11)) +>a : Symbol(C.a, Decl(classWithProtectedProperty.ts, 3, 16)) + + var r3: string = d.b; +>r3 : Symbol(r3, Decl(classWithProtectedProperty.ts, 19, 11)) +>d.b : Symbol(C.b, Decl(classWithProtectedProperty.ts, 4, 21)) +>d : Symbol(d, Decl(classWithProtectedProperty.ts, 16, 11)) +>b : Symbol(C.b, Decl(classWithProtectedProperty.ts, 4, 21)) + + var r4: string = d.c(); +>r4 : Symbol(r4, Decl(classWithProtectedProperty.ts, 20, 11)) +>d.c : Symbol(C.c, Decl(classWithProtectedProperty.ts, 5, 29)) +>d : Symbol(d, Decl(classWithProtectedProperty.ts, 16, 11)) +>c : Symbol(C.c, Decl(classWithProtectedProperty.ts, 5, 29)) + + var r5: string = d.d(); +>r5 : Symbol(r5, Decl(classWithProtectedProperty.ts, 21, 11)) +>d.d : Symbol(C.d, Decl(classWithProtectedProperty.ts, 6, 31)) +>d : Symbol(d, Decl(classWithProtectedProperty.ts, 16, 11)) +>d : Symbol(C.d, Decl(classWithProtectedProperty.ts, 6, 31)) + + var r6: string = C.e; +>r6 : Symbol(r6, Decl(classWithProtectedProperty.ts, 22, 11)) +>C.e : Symbol(C.e, Decl(classWithProtectedProperty.ts, 7, 27)) +>C : Symbol(C, Decl(classWithProtectedProperty.ts, 0, 0)) +>e : Symbol(C.e, Decl(classWithProtectedProperty.ts, 7, 27)) + + var r7: string = C.f(); +>r7 : Symbol(r7, Decl(classWithProtectedProperty.ts, 23, 11)) +>C.f : Symbol(C.f, Decl(classWithProtectedProperty.ts, 8, 23)) +>C : Symbol(C, Decl(classWithProtectedProperty.ts, 0, 0)) +>f : Symbol(C.f, Decl(classWithProtectedProperty.ts, 8, 23)) + + var r8: string = C.g(); +>r8 : Symbol(r8, Decl(classWithProtectedProperty.ts, 24, 11)) +>C.g : Symbol(C.g, Decl(classWithProtectedProperty.ts, 9, 38)) +>C : Symbol(C, Decl(classWithProtectedProperty.ts, 0, 0)) +>g : Symbol(C.g, Decl(classWithProtectedProperty.ts, 9, 38)) + } +} diff --git a/tests/baselines/reference/classWithProtectedProperty.types b/tests/baselines/reference/classWithProtectedProperty.types index a091206cde0..1f53ea2aad9 100644 --- a/tests/baselines/reference/classWithProtectedProperty.types +++ b/tests/baselines/reference/classWithProtectedProperty.types @@ -9,26 +9,32 @@ class C { protected a = ''; >a : string +>'' : string protected b: string = ''; >b : string +>'' : string protected c() { return '' } >c : () => string +>'' : string protected d = () => ''; >d : () => string >() => '' : () => string +>'' : string protected static e; >e : any protected static f() { return '' } >f : () => string +>'' : string protected static g = () => ''; >g : () => string >() => '' : () => string +>'' : string } class D extends C { diff --git a/tests/baselines/reference/classWithPublicProperty.symbols b/tests/baselines/reference/classWithPublicProperty.symbols new file mode 100644 index 00000000000..0e3aa272e5d --- /dev/null +++ b/tests/baselines/reference/classWithPublicProperty.symbols @@ -0,0 +1,82 @@ +=== tests/cases/conformance/types/members/classWithPublicProperty.ts === +class C { +>C : Symbol(C, Decl(classWithPublicProperty.ts, 0, 0)) + + public x; +>x : Symbol(x, Decl(classWithPublicProperty.ts, 0, 9)) + + public a = ''; +>a : Symbol(a, Decl(classWithPublicProperty.ts, 1, 13)) + + public b: string = ''; +>b : Symbol(b, Decl(classWithPublicProperty.ts, 2, 18)) + + public c() { return '' } +>c : Symbol(c, Decl(classWithPublicProperty.ts, 3, 26)) + + public d = () => ''; +>d : Symbol(d, Decl(classWithPublicProperty.ts, 4, 28)) + + public static e; +>e : Symbol(C.e, Decl(classWithPublicProperty.ts, 5, 24)) + + public static f() { return '' } +>f : Symbol(C.f, Decl(classWithPublicProperty.ts, 6, 20)) + + public static g = () => ''; +>g : Symbol(C.g, Decl(classWithPublicProperty.ts, 7, 35)) +} + +// all of these are valid +var c = new C(); +>c : Symbol(c, Decl(classWithPublicProperty.ts, 12, 3)) +>C : Symbol(C, Decl(classWithPublicProperty.ts, 0, 0)) + +var r1: string = c.x; +>r1 : Symbol(r1, Decl(classWithPublicProperty.ts, 13, 3)) +>c.x : Symbol(C.x, Decl(classWithPublicProperty.ts, 0, 9)) +>c : Symbol(c, Decl(classWithPublicProperty.ts, 12, 3)) +>x : Symbol(C.x, Decl(classWithPublicProperty.ts, 0, 9)) + +var r2: string = c.a; +>r2 : Symbol(r2, Decl(classWithPublicProperty.ts, 14, 3)) +>c.a : Symbol(C.a, Decl(classWithPublicProperty.ts, 1, 13)) +>c : Symbol(c, Decl(classWithPublicProperty.ts, 12, 3)) +>a : Symbol(C.a, Decl(classWithPublicProperty.ts, 1, 13)) + +var r3: string = c.b; +>r3 : Symbol(r3, Decl(classWithPublicProperty.ts, 15, 3)) +>c.b : Symbol(C.b, Decl(classWithPublicProperty.ts, 2, 18)) +>c : Symbol(c, Decl(classWithPublicProperty.ts, 12, 3)) +>b : Symbol(C.b, Decl(classWithPublicProperty.ts, 2, 18)) + +var r4: string = c.c(); +>r4 : Symbol(r4, Decl(classWithPublicProperty.ts, 16, 3)) +>c.c : Symbol(C.c, Decl(classWithPublicProperty.ts, 3, 26)) +>c : Symbol(c, Decl(classWithPublicProperty.ts, 12, 3)) +>c : Symbol(C.c, Decl(classWithPublicProperty.ts, 3, 26)) + +var r5: string = c.d(); +>r5 : Symbol(r5, Decl(classWithPublicProperty.ts, 17, 3)) +>c.d : Symbol(C.d, Decl(classWithPublicProperty.ts, 4, 28)) +>c : Symbol(c, Decl(classWithPublicProperty.ts, 12, 3)) +>d : Symbol(C.d, Decl(classWithPublicProperty.ts, 4, 28)) + +var r6: string = C.e; +>r6 : Symbol(r6, Decl(classWithPublicProperty.ts, 18, 3)) +>C.e : Symbol(C.e, Decl(classWithPublicProperty.ts, 5, 24)) +>C : Symbol(C, Decl(classWithPublicProperty.ts, 0, 0)) +>e : Symbol(C.e, Decl(classWithPublicProperty.ts, 5, 24)) + +var r7: string = C.f(); +>r7 : Symbol(r7, Decl(classWithPublicProperty.ts, 19, 3)) +>C.f : Symbol(C.f, Decl(classWithPublicProperty.ts, 6, 20)) +>C : Symbol(C, Decl(classWithPublicProperty.ts, 0, 0)) +>f : Symbol(C.f, Decl(classWithPublicProperty.ts, 6, 20)) + +var r8: string = C.g(); +>r8 : Symbol(r8, Decl(classWithPublicProperty.ts, 20, 3)) +>C.g : Symbol(C.g, Decl(classWithPublicProperty.ts, 7, 35)) +>C : Symbol(C, Decl(classWithPublicProperty.ts, 0, 0)) +>g : Symbol(C.g, Decl(classWithPublicProperty.ts, 7, 35)) + diff --git a/tests/baselines/reference/classWithPublicProperty.types b/tests/baselines/reference/classWithPublicProperty.types index a5bdeb95f1a..09d3c0668d1 100644 --- a/tests/baselines/reference/classWithPublicProperty.types +++ b/tests/baselines/reference/classWithPublicProperty.types @@ -7,26 +7,32 @@ class C { public a = ''; >a : string +>'' : string public b: string = ''; >b : string +>'' : string public c() { return '' } >c : () => string +>'' : string public d = () => ''; >d : () => string >() => '' : () => string +>'' : string public static e; >e : any public static f() { return '' } >f : () => string +>'' : string public static g = () => ''; >g : () => string >() => '' : () => string +>'' : string } // all of these are valid diff --git a/tests/baselines/reference/classWithSemicolonClassElement1.symbols b/tests/baselines/reference/classWithSemicolonClassElement1.symbols new file mode 100644 index 00000000000..6925382630a --- /dev/null +++ b/tests/baselines/reference/classWithSemicolonClassElement1.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/classes/classDeclarations/classWithSemicolonClassElement1.ts === +class C { +>C : Symbol(C, Decl(classWithSemicolonClassElement1.ts, 0, 0)) + + ; +} diff --git a/tests/baselines/reference/classWithSemicolonClassElement2.symbols b/tests/baselines/reference/classWithSemicolonClassElement2.symbols new file mode 100644 index 00000000000..50b79a45164 --- /dev/null +++ b/tests/baselines/reference/classWithSemicolonClassElement2.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/classes/classDeclarations/classWithSemicolonClassElement2.ts === +class C { +>C : Symbol(C, Decl(classWithSemicolonClassElement2.ts, 0, 0)) + + ; + ; +} diff --git a/tests/baselines/reference/classWithSemicolonClassElementES61.symbols b/tests/baselines/reference/classWithSemicolonClassElementES61.symbols new file mode 100644 index 00000000000..eb8e4345098 --- /dev/null +++ b/tests/baselines/reference/classWithSemicolonClassElementES61.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/classDeclaration/classWithSemicolonClassElementES61.ts === +class C { +>C : Symbol(C, Decl(classWithSemicolonClassElementES61.ts, 0, 0)) + + ; +} diff --git a/tests/baselines/reference/classWithSemicolonClassElementES62.symbols b/tests/baselines/reference/classWithSemicolonClassElementES62.symbols new file mode 100644 index 00000000000..a1c69b61b77 --- /dev/null +++ b/tests/baselines/reference/classWithSemicolonClassElementES62.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/classDeclaration/classWithSemicolonClassElementES62.ts === +class C { +>C : Symbol(C, Decl(classWithSemicolonClassElementES62.ts, 0, 0)) + + ; + ; +} diff --git a/tests/baselines/reference/cloduleAcrossModuleDefinitions.symbols b/tests/baselines/reference/cloduleAcrossModuleDefinitions.symbols new file mode 100644 index 00000000000..7be8383355c --- /dev/null +++ b/tests/baselines/reference/cloduleAcrossModuleDefinitions.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/cloduleAcrossModuleDefinitions.ts === +module A { +>A : Symbol(A, Decl(cloduleAcrossModuleDefinitions.ts, 0, 0), Decl(cloduleAcrossModuleDefinitions.ts, 5, 1)) + + export class B { +>B : Symbol(B, Decl(cloduleAcrossModuleDefinitions.ts, 0, 10), Decl(cloduleAcrossModuleDefinitions.ts, 7, 10)) + + foo() { } +>foo : Symbol(foo, Decl(cloduleAcrossModuleDefinitions.ts, 1, 20)) + + static bar() { } +>bar : Symbol(B.bar, Decl(cloduleAcrossModuleDefinitions.ts, 2, 17)) + } +} + +module A { +>A : Symbol(A, Decl(cloduleAcrossModuleDefinitions.ts, 0, 0), Decl(cloduleAcrossModuleDefinitions.ts, 5, 1)) + + export module B { +>B : Symbol(B, Decl(cloduleAcrossModuleDefinitions.ts, 0, 10), Decl(cloduleAcrossModuleDefinitions.ts, 7, 10)) + + export var x = 1; +>x : Symbol(x, Decl(cloduleAcrossModuleDefinitions.ts, 9, 18)) + } +} + +var b: A.B; // ok +>b : Symbol(b, Decl(cloduleAcrossModuleDefinitions.ts, 13, 3)) +>A : Symbol(A, Decl(cloduleAcrossModuleDefinitions.ts, 0, 0), Decl(cloduleAcrossModuleDefinitions.ts, 5, 1)) +>B : Symbol(A.B, Decl(cloduleAcrossModuleDefinitions.ts, 0, 10), Decl(cloduleAcrossModuleDefinitions.ts, 7, 10)) + diff --git a/tests/baselines/reference/cloduleAcrossModuleDefinitions.types b/tests/baselines/reference/cloduleAcrossModuleDefinitions.types index cda79f73734..53ef8392774 100644 --- a/tests/baselines/reference/cloduleAcrossModuleDefinitions.types +++ b/tests/baselines/reference/cloduleAcrossModuleDefinitions.types @@ -21,11 +21,12 @@ module A { export var x = 1; >x : number +>1 : number } } var b: A.B; // ok >b : A.B ->A : unknown +>A : any >B : A.B diff --git a/tests/baselines/reference/cloduleAndTypeParameters.symbols b/tests/baselines/reference/cloduleAndTypeParameters.symbols new file mode 100644 index 00000000000..f2d96346495 --- /dev/null +++ b/tests/baselines/reference/cloduleAndTypeParameters.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/cloduleAndTypeParameters.ts === +class Foo { +>Foo : Symbol(Foo, Decl(cloduleAndTypeParameters.ts, 0, 0), Decl(cloduleAndTypeParameters.ts, 3, 1)) +>T : Symbol(T, Decl(cloduleAndTypeParameters.ts, 0, 10)) +>Foo : Symbol(Foo, Decl(cloduleAndTypeParameters.ts, 0, 0), Decl(cloduleAndTypeParameters.ts, 3, 1)) +>Bar : Symbol(Foo.Bar, Decl(cloduleAndTypeParameters.ts, 5, 12)) + + constructor() { + } +} + +module Foo { +>Foo : Symbol(Foo, Decl(cloduleAndTypeParameters.ts, 0, 0), Decl(cloduleAndTypeParameters.ts, 3, 1)) + + export interface Bar { +>Bar : Symbol(Bar, Decl(cloduleAndTypeParameters.ts, 5, 12)) + + bar(): void; +>bar : Symbol(bar, Decl(cloduleAndTypeParameters.ts, 6, 24)) + } + + export class Baz { +>Baz : Symbol(Baz, Decl(cloduleAndTypeParameters.ts, 8, 3)) + } +} diff --git a/tests/baselines/reference/cloduleAndTypeParameters.types b/tests/baselines/reference/cloduleAndTypeParameters.types index ad43bc90f2f..f7621b5d7f2 100644 --- a/tests/baselines/reference/cloduleAndTypeParameters.types +++ b/tests/baselines/reference/cloduleAndTypeParameters.types @@ -2,7 +2,7 @@ class Foo { >Foo : Foo >T : T ->Foo : unknown +>Foo : any >Bar : Foo.Bar constructor() { diff --git a/tests/baselines/reference/cloduleTest1.symbols b/tests/baselines/reference/cloduleTest1.symbols new file mode 100644 index 00000000000..01759cfa136 --- /dev/null +++ b/tests/baselines/reference/cloduleTest1.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/cloduleTest1.ts === + declare function $(selector: string): $; +>$ : Symbol($, Decl(cloduleTest1.ts, 0, 0), Decl(cloduleTest1.ts, 0, 42), Decl(cloduleTest1.ts, 3, 3)) +>selector : Symbol(selector, Decl(cloduleTest1.ts, 0, 21)) +>$ : Symbol($, Decl(cloduleTest1.ts, 0, 0), Decl(cloduleTest1.ts, 0, 42), Decl(cloduleTest1.ts, 3, 3)) + + interface $ { +>$ : Symbol($, Decl(cloduleTest1.ts, 0, 0), Decl(cloduleTest1.ts, 0, 42), Decl(cloduleTest1.ts, 3, 3)) + + addClass(className: string): $; +>addClass : Symbol(addClass, Decl(cloduleTest1.ts, 1, 15)) +>className : Symbol(className, Decl(cloduleTest1.ts, 2, 15)) +>$ : Symbol($, Decl(cloduleTest1.ts, 0, 0), Decl(cloduleTest1.ts, 0, 42), Decl(cloduleTest1.ts, 3, 3)) + } + module $ { +>$ : Symbol($, Decl(cloduleTest1.ts, 0, 0), Decl(cloduleTest1.ts, 0, 42), Decl(cloduleTest1.ts, 3, 3)) + + export interface AjaxSettings { +>AjaxSettings : Symbol(AjaxSettings, Decl(cloduleTest1.ts, 4, 12)) + } + export function ajax(options: AjaxSettings) { } +>ajax : Symbol(ajax, Decl(cloduleTest1.ts, 6, 5)) +>options : Symbol(options, Decl(cloduleTest1.ts, 7, 25)) +>AjaxSettings : Symbol(AjaxSettings, Decl(cloduleTest1.ts, 4, 12)) + } + var it: $ = $('.foo').addClass('bar'); +>it : Symbol(it, Decl(cloduleTest1.ts, 9, 5)) +>$ : Symbol($, Decl(cloduleTest1.ts, 0, 0), Decl(cloduleTest1.ts, 0, 42), Decl(cloduleTest1.ts, 3, 3)) +>$('.foo').addClass : Symbol($.addClass, Decl(cloduleTest1.ts, 1, 15)) +>$ : Symbol($, Decl(cloduleTest1.ts, 0, 0), Decl(cloduleTest1.ts, 0, 42), Decl(cloduleTest1.ts, 3, 3)) +>addClass : Symbol($.addClass, Decl(cloduleTest1.ts, 1, 15)) + diff --git a/tests/baselines/reference/cloduleTest1.types b/tests/baselines/reference/cloduleTest1.types index a92355b483a..67c1fd6120f 100644 --- a/tests/baselines/reference/cloduleTest1.types +++ b/tests/baselines/reference/cloduleTest1.types @@ -30,5 +30,7 @@ >$('.foo').addClass : (className: string) => $ >$('.foo') : $ >$ : typeof $ +>'.foo' : string >addClass : (className: string) => $ +>'bar' : string diff --git a/tests/baselines/reference/cloduleWithPriorUninstantiatedModule.symbols b/tests/baselines/reference/cloduleWithPriorUninstantiatedModule.symbols new file mode 100644 index 00000000000..7f93d361dd9 --- /dev/null +++ b/tests/baselines/reference/cloduleWithPriorUninstantiatedModule.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/cloduleWithPriorUninstantiatedModule.ts === +// Non-ambient & uninstantiated module. +module Moclodule { +>Moclodule : Symbol(Moclodule, Decl(cloduleWithPriorUninstantiatedModule.ts, 0, 0), Decl(cloduleWithPriorUninstantiatedModule.ts, 5, 1), Decl(cloduleWithPriorUninstantiatedModule.ts, 8, 1)) + + export interface Someinterface { +>Someinterface : Symbol(Someinterface, Decl(cloduleWithPriorUninstantiatedModule.ts, 1, 18)) + + foo(): void; +>foo : Symbol(foo, Decl(cloduleWithPriorUninstantiatedModule.ts, 2, 36)) + } +} + +class Moclodule { +>Moclodule : Symbol(Moclodule, Decl(cloduleWithPriorUninstantiatedModule.ts, 0, 0), Decl(cloduleWithPriorUninstantiatedModule.ts, 5, 1), Decl(cloduleWithPriorUninstantiatedModule.ts, 8, 1)) +} + +// Instantiated module. +module Moclodule { +>Moclodule : Symbol(Moclodule, Decl(cloduleWithPriorUninstantiatedModule.ts, 0, 0), Decl(cloduleWithPriorUninstantiatedModule.ts, 5, 1), Decl(cloduleWithPriorUninstantiatedModule.ts, 8, 1)) + + export class Manager { +>Manager : Symbol(Manager, Decl(cloduleWithPriorUninstantiatedModule.ts, 11, 18)) + } +} diff --git a/tests/baselines/reference/cloduleWithRecursiveReference.symbols b/tests/baselines/reference/cloduleWithRecursiveReference.symbols new file mode 100644 index 00000000000..22d5d64f72c --- /dev/null +++ b/tests/baselines/reference/cloduleWithRecursiveReference.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/cloduleWithRecursiveReference.ts === +module M +>M : Symbol(M, Decl(cloduleWithRecursiveReference.ts, 0, 0)) +{ + export class C { } +>C : Symbol(C, Decl(cloduleWithRecursiveReference.ts, 1, 1), Decl(cloduleWithRecursiveReference.ts, 2, 21)) + + export module C { +>C : Symbol(C, Decl(cloduleWithRecursiveReference.ts, 1, 1), Decl(cloduleWithRecursiveReference.ts, 2, 21)) + + export var C = M.C +>C : Symbol(C, Decl(cloduleWithRecursiveReference.ts, 4, 14)) +>M.C : Symbol(C, Decl(cloduleWithRecursiveReference.ts, 1, 1), Decl(cloduleWithRecursiveReference.ts, 2, 21)) +>M : Symbol(M, Decl(cloduleWithRecursiveReference.ts, 0, 0)) +>C : Symbol(C, Decl(cloduleWithRecursiveReference.ts, 1, 1), Decl(cloduleWithRecursiveReference.ts, 2, 21)) + } +} diff --git a/tests/baselines/reference/collisionArgumentsInType.symbols b/tests/baselines/reference/collisionArgumentsInType.symbols new file mode 100644 index 00000000000..94c9374c7cd --- /dev/null +++ b/tests/baselines/reference/collisionArgumentsInType.symbols @@ -0,0 +1,53 @@ +=== tests/cases/compiler/collisionArgumentsInType.ts === +var v1: (i: number, ...arguments) => void; // no error - no code gen +>v1 : Symbol(v1, Decl(collisionArgumentsInType.ts, 0, 3)) +>i : Symbol(i, Decl(collisionArgumentsInType.ts, 0, 9)) +>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 0, 19)) + +var v12: (arguments: number, ...restParameters) => void; // no error - no code gen +>v12 : Symbol(v12, Decl(collisionArgumentsInType.ts, 1, 3)) +>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 1, 10)) +>restParameters : Symbol(restParameters, Decl(collisionArgumentsInType.ts, 1, 28)) + +var v2: { +>v2 : Symbol(v2, Decl(collisionArgumentsInType.ts, 2, 3)) + + (arguments: number, ...restParameters); // no error - no code gen +>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 3, 5)) +>restParameters : Symbol(restParameters, Decl(collisionArgumentsInType.ts, 3, 23)) + + new (arguments: number, ...restParameters); // no error - no code gen +>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 4, 9)) +>restParameters : Symbol(restParameters, Decl(collisionArgumentsInType.ts, 4, 27)) + + foo(arguments: number, ...restParameters); // no error - no code gen +>foo : Symbol(foo, Decl(collisionArgumentsInType.ts, 4, 47)) +>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 5, 8)) +>restParameters : Symbol(restParameters, Decl(collisionArgumentsInType.ts, 5, 26)) + + prop: (arguments: number, ...restParameters) => void; // no error - no code gen +>prop : Symbol(prop, Decl(collisionArgumentsInType.ts, 5, 46)) +>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 6, 11)) +>restParameters : Symbol(restParameters, Decl(collisionArgumentsInType.ts, 6, 29)) +} +var v21: { +>v21 : Symbol(v21, Decl(collisionArgumentsInType.ts, 8, 3)) + + (i: number, ...arguments); // no error - no code gen +>i : Symbol(i, Decl(collisionArgumentsInType.ts, 9, 5)) +>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 9, 15)) + + new (i: number, ...arguments); // no error - no code gen +>i : Symbol(i, Decl(collisionArgumentsInType.ts, 10, 9)) +>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 10, 19)) + + foo(i: number, ...arguments); // no error - no code gen +>foo : Symbol(foo, Decl(collisionArgumentsInType.ts, 10, 34)) +>i : Symbol(i, Decl(collisionArgumentsInType.ts, 11, 8)) +>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 11, 18)) + + prop: (i: number, ...arguments) => void; // no error - no code gen +>prop : Symbol(prop, Decl(collisionArgumentsInType.ts, 11, 33)) +>i : Symbol(i, Decl(collisionArgumentsInType.ts, 12, 11)) +>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 12, 21)) +} diff --git a/tests/baselines/reference/collisionArgumentsInterfaceMembers.symbols b/tests/baselines/reference/collisionArgumentsInterfaceMembers.symbols new file mode 100644 index 00000000000..a8856c37a4c --- /dev/null +++ b/tests/baselines/reference/collisionArgumentsInterfaceMembers.symbols @@ -0,0 +1,63 @@ +=== tests/cases/compiler/collisionArgumentsInterfaceMembers.ts === +// call +interface i1 { +>i1 : Symbol(i1, Decl(collisionArgumentsInterfaceMembers.ts, 0, 0)) + + (i: number, ...arguments); // no error - no code gen +>i : Symbol(i, Decl(collisionArgumentsInterfaceMembers.ts, 2, 5)) +>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 2, 15)) +} +interface i12 { +>i12 : Symbol(i12, Decl(collisionArgumentsInterfaceMembers.ts, 3, 1)) + + (arguments: number, ...rest); // no error - no code gen +>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 5, 5)) +>rest : Symbol(rest, Decl(collisionArgumentsInterfaceMembers.ts, 5, 23)) +} +interface i1NoError { +>i1NoError : Symbol(i1NoError, Decl(collisionArgumentsInterfaceMembers.ts, 6, 1)) + + (arguments: number); // no error +>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 8, 5)) +} + +// new +interface i2 { +>i2 : Symbol(i2, Decl(collisionArgumentsInterfaceMembers.ts, 9, 1)) + + new (i: number, ...arguments); // no error - no code gen +>i : Symbol(i, Decl(collisionArgumentsInterfaceMembers.ts, 13, 9)) +>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 13, 19)) +} +interface i21 { +>i21 : Symbol(i21, Decl(collisionArgumentsInterfaceMembers.ts, 14, 1)) + + new (arguments: number, ...rest); // no error - no code gen +>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 16, 9)) +>rest : Symbol(rest, Decl(collisionArgumentsInterfaceMembers.ts, 16, 27)) +} +interface i2NoError { +>i2NoError : Symbol(i2NoError, Decl(collisionArgumentsInterfaceMembers.ts, 17, 1)) + + new (arguments: number); // no error +>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 19, 9)) +} + +// method +interface i3 { +>i3 : Symbol(i3, Decl(collisionArgumentsInterfaceMembers.ts, 20, 1)) + + foo(i: number, ...arguments); // no error - no code gen +>foo : Symbol(foo, Decl(collisionArgumentsInterfaceMembers.ts, 23, 14)) +>i : Symbol(i, Decl(collisionArgumentsInterfaceMembers.ts, 24, 8)) +>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 24, 18)) + + foo1(arguments: number, ...rest); // no error - no code gen +>foo1 : Symbol(foo1, Decl(collisionArgumentsInterfaceMembers.ts, 24, 33)) +>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 25, 9)) +>rest : Symbol(rest, Decl(collisionArgumentsInterfaceMembers.ts, 25, 27)) + + fooNoError(arguments: number); // no error +>fooNoError : Symbol(fooNoError, Decl(collisionArgumentsInterfaceMembers.ts, 25, 37)) +>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 26, 15)) +} diff --git a/tests/baselines/reference/collisionCodeGenEnumWithEnumMemberConflict.symbols b/tests/baselines/reference/collisionCodeGenEnumWithEnumMemberConflict.symbols new file mode 100644 index 00000000000..9f5bfa36485 --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenEnumWithEnumMemberConflict.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/collisionCodeGenEnumWithEnumMemberConflict.ts === +enum Color { +>Color : Symbol(Color, Decl(collisionCodeGenEnumWithEnumMemberConflict.ts, 0, 0)) + + Color, +>Color : Symbol(Color.Color, Decl(collisionCodeGenEnumWithEnumMemberConflict.ts, 0, 12)) + + Thing = Color +>Thing : Symbol(Color.Thing, Decl(collisionCodeGenEnumWithEnumMemberConflict.ts, 1, 10)) +>Color : Symbol(Color.Color, Decl(collisionCodeGenEnumWithEnumMemberConflict.ts, 0, 12)) +} diff --git a/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.symbols b/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.symbols new file mode 100644 index 00000000000..28665abd098 --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.symbols @@ -0,0 +1,48 @@ +=== tests/cases/compiler/collisionCodeGenModuleWithConstructorChildren.ts === +module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithConstructorChildren.ts, 6, 1), Decl(collisionCodeGenModuleWithConstructorChildren.ts, 13, 1)) + + export var x = 3; +>x : Symbol(x, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 1, 14)) + + class c { +>c : Symbol(c, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 1, 21)) + + constructor(M, p = x) { +>M : Symbol(M, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 3, 20)) +>p : Symbol(p, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 3, 22)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 1, 14)) + } + } +} + +module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithConstructorChildren.ts, 6, 1), Decl(collisionCodeGenModuleWithConstructorChildren.ts, 13, 1)) + + class d { +>d : Symbol(d, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 8, 10)) + + constructor(private M, p = x) { +>M : Symbol(M, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 10, 20)) +>p : Symbol(p, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 10, 30)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 1, 14)) + } + } +} + +module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithConstructorChildren.ts, 6, 1), Decl(collisionCodeGenModuleWithConstructorChildren.ts, 13, 1)) + + class d2 { +>d2 : Symbol(d2, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 15, 10)) + + constructor() { + var M = 10; +>M : Symbol(M, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 18, 15)) + + var p = x; +>p : Symbol(p, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 19, 15)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 1, 14)) + } + } +} diff --git a/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.types b/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.types index f63f7eeb4f2..9c6fbac1539 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.types @@ -4,6 +4,7 @@ module M { export var x = 3; >x : number +>3 : number class c { >c : c @@ -39,6 +40,7 @@ module M { constructor() { var M = 10; >M : number +>10 : number var p = x; >p : number diff --git a/tests/baselines/reference/collisionCodeGenModuleWithEnumMemberConflict.symbols b/tests/baselines/reference/collisionCodeGenModuleWithEnumMemberConflict.symbols new file mode 100644 index 00000000000..f44b0e5c11e --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithEnumMemberConflict.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/collisionCodeGenModuleWithEnumMemberConflict.ts === +module m1 { +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithEnumMemberConflict.ts, 0, 0)) + + enum e { +>e : Symbol(e, Decl(collisionCodeGenModuleWithEnumMemberConflict.ts, 0, 11)) + + m1, +>m1 : Symbol(e.m1, Decl(collisionCodeGenModuleWithEnumMemberConflict.ts, 1, 12)) + + m2 = m1 +>m2 : Symbol(e.m2, Decl(collisionCodeGenModuleWithEnumMemberConflict.ts, 2, 11)) +>m1 : Symbol(e.m1, Decl(collisionCodeGenModuleWithEnumMemberConflict.ts, 1, 12)) + } +} diff --git a/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.symbols b/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.symbols new file mode 100644 index 00000000000..eeac7be0fdf --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.symbols @@ -0,0 +1,44 @@ +=== tests/cases/compiler/collisionCodeGenModuleWithFunctionChildren.ts === +module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithFunctionChildren.ts, 3, 1), Decl(collisionCodeGenModuleWithFunctionChildren.ts, 10, 1)) + + export var x = 3; +>x : Symbol(x, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 1, 14)) + + function fn(M, p = x) { } +>fn : Symbol(fn, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 1, 21)) +>M : Symbol(M, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 2, 16)) +>p : Symbol(p, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 2, 18)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 1, 14)) +} + +module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithFunctionChildren.ts, 3, 1), Decl(collisionCodeGenModuleWithFunctionChildren.ts, 10, 1)) + + function fn2() { +>fn2 : Symbol(fn2, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 5, 10)) + + var M; +>M : Symbol(M, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 7, 11)) + + var p = x; +>p : Symbol(p, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 8, 11)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 1, 14)) + } +} + +module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithFunctionChildren.ts, 3, 1), Decl(collisionCodeGenModuleWithFunctionChildren.ts, 10, 1)) + + function fn3() { +>fn3 : Symbol(fn3, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 12, 10)) + + function M() { +>M : Symbol(M, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 13, 20)) + + var p = x; +>p : Symbol(p, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 15, 15)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 1, 14)) + } + } +} diff --git a/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.types b/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.types index 07ef123f642..5c99bc7b40b 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.types @@ -4,6 +4,7 @@ module M { export var x = 3; >x : number +>3 : number function fn(M, p = x) { } >fn : (M: any, p?: number) => void diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMemberClassConflict.symbols b/tests/baselines/reference/collisionCodeGenModuleWithMemberClassConflict.symbols new file mode 100644 index 00000000000..dba4163f16e --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithMemberClassConflict.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/collisionCodeGenModuleWithMemberClassConflict.ts === +module m1 { +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 0, 0)) + + export class m1 { +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 0, 11)) + } +} +var foo = new m1.m1(); +>foo : Symbol(foo, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 4, 3), Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 13, 3), Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 14, 3)) +>m1.m1 : Symbol(m1.m1, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 0, 11)) +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 0, 0)) +>m1 : Symbol(m1.m1, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 0, 11)) + +module m2 { +>m2 : Symbol(m2, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 4, 22)) + + export class m2 { +>m2 : Symbol(m2, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 6, 11)) + } + + export class _m2 { +>_m2 : Symbol(_m2, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 8, 5)) + } +} +var foo = new m2.m2(); +>foo : Symbol(foo, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 4, 3), Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 13, 3), Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 14, 3)) +>m2.m2 : Symbol(m2.m2, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 6, 11)) +>m2 : Symbol(m2, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 4, 22)) +>m2 : Symbol(m2.m2, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 6, 11)) + +var foo = new m2._m2(); +>foo : Symbol(foo, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 4, 3), Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 13, 3), Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 14, 3)) +>m2._m2 : Symbol(m2._m2, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 8, 5)) +>m2 : Symbol(m2, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 4, 22)) +>_m2 : Symbol(m2._m2, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 8, 5)) + diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMemberInterfaceConflict.symbols b/tests/baselines/reference/collisionCodeGenModuleWithMemberInterfaceConflict.symbols new file mode 100644 index 00000000000..c9fc2e8175f --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithMemberInterfaceConflict.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/collisionCodeGenModuleWithMemberInterfaceConflict.ts === +module m1 { +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithMemberInterfaceConflict.ts, 0, 0)) + + export interface m1 { +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithMemberInterfaceConflict.ts, 0, 11)) + } + export class m2 implements m1 { +>m2 : Symbol(m2, Decl(collisionCodeGenModuleWithMemberInterfaceConflict.ts, 2, 5)) +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithMemberInterfaceConflict.ts, 0, 11)) + } +} +var foo = new m1.m2(); +>foo : Symbol(foo, Decl(collisionCodeGenModuleWithMemberInterfaceConflict.ts, 6, 3)) +>m1.m2 : Symbol(m1.m2, Decl(collisionCodeGenModuleWithMemberInterfaceConflict.ts, 2, 5)) +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithMemberInterfaceConflict.ts, 0, 0)) +>m2 : Symbol(m1.m2, Decl(collisionCodeGenModuleWithMemberInterfaceConflict.ts, 2, 5)) + diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.symbols b/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.symbols new file mode 100644 index 00000000000..b2b5cb2e455 --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/collisionCodeGenModuleWithMemberVariable.ts === +module m1 { +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithMemberVariable.ts, 0, 0)) + + export var m1 = 10; +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithMemberVariable.ts, 1, 14)) + + var b = m1; +>b : Symbol(b, Decl(collisionCodeGenModuleWithMemberVariable.ts, 2, 7)) +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithMemberVariable.ts, 1, 14)) +} +var foo = m1.m1; +>foo : Symbol(foo, Decl(collisionCodeGenModuleWithMemberVariable.ts, 4, 3)) +>m1.m1 : Symbol(m1.m1, Decl(collisionCodeGenModuleWithMemberVariable.ts, 1, 14)) +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithMemberVariable.ts, 0, 0)) +>m1 : Symbol(m1.m1, Decl(collisionCodeGenModuleWithMemberVariable.ts, 1, 14)) + diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.types b/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.types index 86f0767959d..651ba5344ad 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.types @@ -4,6 +4,7 @@ module m1 { export var m1 = 10; >m1 : number +>10 : number var b = m1; >b : number diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.symbols b/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.symbols new file mode 100644 index 00000000000..02105ce42e6 --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.symbols @@ -0,0 +1,68 @@ +=== tests/cases/compiler/collisionCodeGenModuleWithMethodChildren.ts === +module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithMethodChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithMethodChildren.ts, 5, 1), Decl(collisionCodeGenModuleWithMethodChildren.ts, 14, 1), Decl(collisionCodeGenModuleWithMethodChildren.ts, 24, 1)) + + export var x = 3; +>x : Symbol(x, Decl(collisionCodeGenModuleWithMethodChildren.ts, 1, 14)) + + class c { +>c : Symbol(c, Decl(collisionCodeGenModuleWithMethodChildren.ts, 1, 21)) + + fn(M, p = x) { } +>fn : Symbol(fn, Decl(collisionCodeGenModuleWithMethodChildren.ts, 2, 13)) +>M : Symbol(M, Decl(collisionCodeGenModuleWithMethodChildren.ts, 3, 11)) +>p : Symbol(p, Decl(collisionCodeGenModuleWithMethodChildren.ts, 3, 13)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithMethodChildren.ts, 1, 14)) + } +} + +module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithMethodChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithMethodChildren.ts, 5, 1), Decl(collisionCodeGenModuleWithMethodChildren.ts, 14, 1), Decl(collisionCodeGenModuleWithMethodChildren.ts, 24, 1)) + + class d { +>d : Symbol(d, Decl(collisionCodeGenModuleWithMethodChildren.ts, 7, 10)) + + fn2() { +>fn2 : Symbol(fn2, Decl(collisionCodeGenModuleWithMethodChildren.ts, 8, 13)) + + var M; +>M : Symbol(M, Decl(collisionCodeGenModuleWithMethodChildren.ts, 10, 15)) + + var p = x; +>p : Symbol(p, Decl(collisionCodeGenModuleWithMethodChildren.ts, 11, 15)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithMethodChildren.ts, 1, 14)) + } + } +} + +module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithMethodChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithMethodChildren.ts, 5, 1), Decl(collisionCodeGenModuleWithMethodChildren.ts, 14, 1), Decl(collisionCodeGenModuleWithMethodChildren.ts, 24, 1)) + + class e { +>e : Symbol(e, Decl(collisionCodeGenModuleWithMethodChildren.ts, 16, 10)) + + fn3() { +>fn3 : Symbol(fn3, Decl(collisionCodeGenModuleWithMethodChildren.ts, 17, 13)) + + function M() { +>M : Symbol(M, Decl(collisionCodeGenModuleWithMethodChildren.ts, 18, 15)) + + var p = x; +>p : Symbol(p, Decl(collisionCodeGenModuleWithMethodChildren.ts, 20, 19)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithMethodChildren.ts, 1, 14)) + } + } + } +} + +module M { // Shouldnt bn _M +>M : Symbol(M, Decl(collisionCodeGenModuleWithMethodChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithMethodChildren.ts, 5, 1), Decl(collisionCodeGenModuleWithMethodChildren.ts, 14, 1), Decl(collisionCodeGenModuleWithMethodChildren.ts, 24, 1)) + + class f { +>f : Symbol(f, Decl(collisionCodeGenModuleWithMethodChildren.ts, 26, 10)) + + M() { +>M : Symbol(M, Decl(collisionCodeGenModuleWithMethodChildren.ts, 27, 13)) + } + } +} diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.types b/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.types index 3632806e9b3..e7c6d9021eb 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.types @@ -4,6 +4,7 @@ module M { export var x = 3; >x : number +>3 : number class c { >c : c diff --git a/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.symbols b/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.symbols new file mode 100644 index 00000000000..42cc1d51007 --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.symbols @@ -0,0 +1,91 @@ +=== tests/cases/compiler/collisionCodeGenModuleWithModuleChildren.ts === +module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithModuleChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithModuleChildren.ts, 6, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 15, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 24, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 33, 1)) + + export var x = 3; +>x : Symbol(x, Decl(collisionCodeGenModuleWithModuleChildren.ts, 1, 14)) + + module m1 { +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithModuleChildren.ts, 1, 21)) + + var M = 10; +>M : Symbol(M, Decl(collisionCodeGenModuleWithModuleChildren.ts, 3, 11)) + + var p = x; +>p : Symbol(p, Decl(collisionCodeGenModuleWithModuleChildren.ts, 4, 11)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithModuleChildren.ts, 1, 14)) + } +} + +module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithModuleChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithModuleChildren.ts, 6, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 15, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 24, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 33, 1)) + + module m2 { +>m2 : Symbol(m2, Decl(collisionCodeGenModuleWithModuleChildren.ts, 8, 10)) + + class M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithModuleChildren.ts, 9, 15)) + } + var p = x; +>p : Symbol(p, Decl(collisionCodeGenModuleWithModuleChildren.ts, 12, 11)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithModuleChildren.ts, 1, 14)) + + var p2 = new M(); +>p2 : Symbol(p2, Decl(collisionCodeGenModuleWithModuleChildren.ts, 13, 11)) +>M : Symbol(M, Decl(collisionCodeGenModuleWithModuleChildren.ts, 9, 15)) + } +} + +module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithModuleChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithModuleChildren.ts, 6, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 15, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 24, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 33, 1)) + + module m3 { +>m3 : Symbol(m3, Decl(collisionCodeGenModuleWithModuleChildren.ts, 17, 10)) + + function M() { +>M : Symbol(M, Decl(collisionCodeGenModuleWithModuleChildren.ts, 18, 15)) + } + var p = x; +>p : Symbol(p, Decl(collisionCodeGenModuleWithModuleChildren.ts, 21, 11)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithModuleChildren.ts, 1, 14)) + + var p2 = M(); +>p2 : Symbol(p2, Decl(collisionCodeGenModuleWithModuleChildren.ts, 22, 11)) +>M : Symbol(M, Decl(collisionCodeGenModuleWithModuleChildren.ts, 18, 15)) + } +} + +module M { // shouldnt be _M +>M : Symbol(M, Decl(collisionCodeGenModuleWithModuleChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithModuleChildren.ts, 6, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 15, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 24, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 33, 1)) + + module m3 { +>m3 : Symbol(m3, Decl(collisionCodeGenModuleWithModuleChildren.ts, 26, 10)) + + interface M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithModuleChildren.ts, 27, 15)) + } + var p = x; +>p : Symbol(p, Decl(collisionCodeGenModuleWithModuleChildren.ts, 30, 11)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithModuleChildren.ts, 1, 14)) + + var p2: M; +>p2 : Symbol(p2, Decl(collisionCodeGenModuleWithModuleChildren.ts, 31, 11)) +>M : Symbol(M, Decl(collisionCodeGenModuleWithModuleChildren.ts, 27, 15)) + } +} + +module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithModuleChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithModuleChildren.ts, 6, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 15, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 24, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 33, 1)) + + module m4 { +>m4 : Symbol(m4, Decl(collisionCodeGenModuleWithModuleChildren.ts, 35, 10)) + + module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithModuleChildren.ts, 36, 15)) + + var p = x; +>p : Symbol(p, Decl(collisionCodeGenModuleWithModuleChildren.ts, 38, 15)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithModuleChildren.ts, 1, 14)) + } + } +} diff --git a/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.types b/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.types index 7853bcbdb32..4ffaf6dad04 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.types @@ -4,12 +4,14 @@ module M { export var x = 3; >x : number +>3 : number module m1 { >m1 : typeof m1 var M = 10; >M : number +>10 : number var p = x; >p : number diff --git a/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.symbols b/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.symbols new file mode 100644 index 00000000000..6dfd0727a1c --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.symbols @@ -0,0 +1,83 @@ +=== tests/cases/compiler/collisionCodeGenModuleWithModuleReopening.ts === +module m1 { +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 0, 0), Decl(collisionCodeGenModuleWithModuleReopening.ts, 4, 22)) + + export class m1 { +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 0, 11)) + } +} +var foo = new m1.m1(); +>foo : Symbol(foo, Decl(collisionCodeGenModuleWithModuleReopening.ts, 4, 3)) +>m1.m1 : Symbol(m1.m1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 0, 11)) +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 0, 0), Decl(collisionCodeGenModuleWithModuleReopening.ts, 4, 22)) +>m1 : Symbol(m1.m1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 0, 11)) + +module m1 { +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 0, 0), Decl(collisionCodeGenModuleWithModuleReopening.ts, 4, 22)) + + export class c1 { +>c1 : Symbol(c1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 5, 11)) + } + var b = new c1(); +>b : Symbol(b, Decl(collisionCodeGenModuleWithModuleReopening.ts, 8, 7)) +>c1 : Symbol(c1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 5, 11)) + + var c = new m1(); +>c : Symbol(c, Decl(collisionCodeGenModuleWithModuleReopening.ts, 9, 7)) +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 0, 11)) +} +var foo2 = new m1.c1(); +>foo2 : Symbol(foo2, Decl(collisionCodeGenModuleWithModuleReopening.ts, 11, 3), Decl(collisionCodeGenModuleWithModuleReopening.ts, 28, 3)) +>m1.c1 : Symbol(m1.c1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 5, 11)) +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 0, 0), Decl(collisionCodeGenModuleWithModuleReopening.ts, 4, 22)) +>c1 : Symbol(m1.c1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 5, 11)) + +module m2 { +>m2 : Symbol(m2, Decl(collisionCodeGenModuleWithModuleReopening.ts, 11, 23), Decl(collisionCodeGenModuleWithModuleReopening.ts, 19, 23)) + + export class c1 { +>c1 : Symbol(c1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 13, 11)) + } + export var b10 = 10; +>b10 : Symbol(b10, Decl(collisionCodeGenModuleWithModuleReopening.ts, 16, 14)) + + var x = new c1(); +>x : Symbol(x, Decl(collisionCodeGenModuleWithModuleReopening.ts, 17, 7)) +>c1 : Symbol(c1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 13, 11)) +} +var foo3 = new m2.c1(); +>foo3 : Symbol(foo3, Decl(collisionCodeGenModuleWithModuleReopening.ts, 19, 3), Decl(collisionCodeGenModuleWithModuleReopening.ts, 27, 3)) +>m2.c1 : Symbol(m2.c1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 13, 11)) +>m2 : Symbol(m2, Decl(collisionCodeGenModuleWithModuleReopening.ts, 11, 23), Decl(collisionCodeGenModuleWithModuleReopening.ts, 19, 23)) +>c1 : Symbol(m2.c1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 13, 11)) + +module m2 { +>m2 : Symbol(m2, Decl(collisionCodeGenModuleWithModuleReopening.ts, 11, 23), Decl(collisionCodeGenModuleWithModuleReopening.ts, 19, 23)) + + export class m2 { +>m2 : Symbol(m2, Decl(collisionCodeGenModuleWithModuleReopening.ts, 20, 11)) + } + var b = new m2(); +>b : Symbol(b, Decl(collisionCodeGenModuleWithModuleReopening.ts, 23, 7)) +>m2 : Symbol(m2, Decl(collisionCodeGenModuleWithModuleReopening.ts, 20, 11)) + + var d = b10; +>d : Symbol(d, Decl(collisionCodeGenModuleWithModuleReopening.ts, 24, 7)) +>b10 : Symbol(b10, Decl(collisionCodeGenModuleWithModuleReopening.ts, 16, 14)) + + var c = new c1(); +>c : Symbol(c, Decl(collisionCodeGenModuleWithModuleReopening.ts, 25, 7)) +>c1 : Symbol(c1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 13, 11)) +} +var foo3 = new m2.c1(); +>foo3 : Symbol(foo3, Decl(collisionCodeGenModuleWithModuleReopening.ts, 19, 3), Decl(collisionCodeGenModuleWithModuleReopening.ts, 27, 3)) +>m2.c1 : Symbol(m2.c1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 13, 11)) +>m2 : Symbol(m2, Decl(collisionCodeGenModuleWithModuleReopening.ts, 11, 23), Decl(collisionCodeGenModuleWithModuleReopening.ts, 19, 23)) +>c1 : Symbol(m2.c1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 13, 11)) + +var foo2 = new m2.m2(); +>foo2 : Symbol(foo2, Decl(collisionCodeGenModuleWithModuleReopening.ts, 11, 3), Decl(collisionCodeGenModuleWithModuleReopening.ts, 28, 3)) +>m2.m2 : Symbol(m2.m2, Decl(collisionCodeGenModuleWithModuleReopening.ts, 20, 11)) +>m2 : Symbol(m2, Decl(collisionCodeGenModuleWithModuleReopening.ts, 11, 23), Decl(collisionCodeGenModuleWithModuleReopening.ts, 19, 23)) +>m2 : Symbol(m2.m2, Decl(collisionCodeGenModuleWithModuleReopening.ts, 20, 11)) + diff --git a/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.types b/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.types index 27520618366..b71eeb621d0 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.types @@ -44,6 +44,7 @@ module m2 { } export var b10 = 10; >b10 : number +>10 : number var x = new c1(); >x : c1 diff --git a/tests/baselines/reference/collisionCodeGenModuleWithPrivateMember.symbols b/tests/baselines/reference/collisionCodeGenModuleWithPrivateMember.symbols new file mode 100644 index 00000000000..dd8c8d5de3e --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithPrivateMember.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/collisionCodeGenModuleWithPrivateMember.ts === +module m1 { +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithPrivateMember.ts, 0, 0)) + + class m1 { +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithPrivateMember.ts, 0, 11)) + } + var x = new m1(); +>x : Symbol(x, Decl(collisionCodeGenModuleWithPrivateMember.ts, 3, 7)) +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithPrivateMember.ts, 0, 11)) + + export class c1 { +>c1 : Symbol(c1, Decl(collisionCodeGenModuleWithPrivateMember.ts, 3, 21)) + } +} +var foo = new m1.c1(); +>foo : Symbol(foo, Decl(collisionCodeGenModuleWithPrivateMember.ts, 7, 3)) +>m1.c1 : Symbol(m1.c1, Decl(collisionCodeGenModuleWithPrivateMember.ts, 3, 21)) +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithPrivateMember.ts, 0, 0)) +>c1 : Symbol(m1.c1, Decl(collisionCodeGenModuleWithPrivateMember.ts, 3, 21)) + diff --git a/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.symbols b/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.symbols new file mode 100644 index 00000000000..d62860b50e6 --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/collisionCodeGenModuleWithUnicodeNames.ts === +module 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 { +>才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 : Symbol(才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123, Decl(collisionCodeGenModuleWithUnicodeNames.ts, 0, 0)) + + export class 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 { +>才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 : Symbol(才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123, Decl(collisionCodeGenModuleWithUnicodeNames.ts, 0, 82)) + } +} + +var x = new 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123.才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123(); +>x : Symbol(x, Decl(collisionCodeGenModuleWithUnicodeNames.ts, 5, 3)) +>才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123.才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 : Symbol(才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123.才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123, Decl(collisionCodeGenModuleWithUnicodeNames.ts, 0, 82)) +>才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 : Symbol(才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123, Decl(collisionCodeGenModuleWithUnicodeNames.ts, 0, 0)) +>才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 : Symbol(才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123.才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123, Decl(collisionCodeGenModuleWithUnicodeNames.ts, 0, 82)) + + + diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientClass.symbols b/tests/baselines/reference/collisionExportsRequireAndAmbientClass.symbols new file mode 100644 index 00000000000..07aaf7d6c75 --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientClass.symbols @@ -0,0 +1,57 @@ +=== tests/cases/compiler/collisionExportsRequireAndAmbientClass_externalmodule.ts === +export declare class require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientClass_externalmodule.ts, 0, 0)) +} +export declare class exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientClass_externalmodule.ts, 1, 1)) +} +declare module m1 { +>m1 : Symbol(m1, Decl(collisionExportsRequireAndAmbientClass_externalmodule.ts, 3, 1)) + + class require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientClass_externalmodule.ts, 4, 19)) + } + class exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientClass_externalmodule.ts, 6, 5)) + } +} +module m2 { +>m2 : Symbol(m2, Decl(collisionExportsRequireAndAmbientClass_externalmodule.ts, 9, 1)) + + export declare class require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientClass_externalmodule.ts, 10, 11)) + } + export declare class exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientClass_externalmodule.ts, 12, 5)) + } +} + +=== tests/cases/compiler/collisionExportsRequireAndAmbientClass_globalFile.ts === +declare class require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientClass_globalFile.ts, 0, 0)) +} +declare class exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientClass_globalFile.ts, 1, 1)) +} +declare module m3 { +>m3 : Symbol(m3, Decl(collisionExportsRequireAndAmbientClass_globalFile.ts, 3, 1)) + + class require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientClass_globalFile.ts, 4, 19)) + } + class exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientClass_globalFile.ts, 6, 5)) + } +} +module m4 { +>m4 : Symbol(m4, Decl(collisionExportsRequireAndAmbientClass_globalFile.ts, 9, 1)) + + export declare class require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientClass_globalFile.ts, 10, 11)) + } + export declare class exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientClass_globalFile.ts, 12, 5)) + } + var a = 10; +>a : Symbol(a, Decl(collisionExportsRequireAndAmbientClass_globalFile.ts, 15, 7)) +} diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientClass.types b/tests/baselines/reference/collisionExportsRequireAndAmbientClass.types index 8212c6ffc61..0db9958d533 100644 --- a/tests/baselines/reference/collisionExportsRequireAndAmbientClass.types +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientClass.types @@ -54,4 +54,5 @@ module m4 { } var a = 10; >a : number +>10 : number } diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientEnum.symbols b/tests/baselines/reference/collisionExportsRequireAndAmbientEnum.symbols new file mode 100644 index 00000000000..b90dd277bb3 --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientEnum.symbols @@ -0,0 +1,127 @@ +=== tests/cases/compiler/collisionExportsRequireAndAmbientEnum_externalmodule.ts === +export declare enum require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 0, 0)) + + _thisVal1, +>_thisVal1 : Symbol(require._thisVal1, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 0, 29)) + + _thisVal2, +>_thisVal2 : Symbol(require._thisVal2, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 1, 14)) +} +export declare enum exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 3, 1)) + + _thisVal1, +>_thisVal1 : Symbol(exports._thisVal1, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 4, 29)) + + _thisVal2, +>_thisVal2 : Symbol(exports._thisVal2, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 5, 14)) +} +declare module m1 { +>m1 : Symbol(m1, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 7, 1)) + + enum require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 8, 19)) + + _thisVal1, +>_thisVal1 : Symbol(require._thisVal1, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 9, 18)) + + _thisVal2, +>_thisVal2 : Symbol(require._thisVal2, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 10, 18)) + } + enum exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 12, 5)) + + _thisVal1, +>_thisVal1 : Symbol(exports._thisVal1, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 13, 18)) + + _thisVal2, +>_thisVal2 : Symbol(exports._thisVal2, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 14, 18)) + } +} +module m2 { +>m2 : Symbol(m2, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 17, 1)) + + export declare enum require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 18, 11)) + + _thisVal1, +>_thisVal1 : Symbol(require._thisVal1, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 19, 33)) + + _thisVal2, +>_thisVal2 : Symbol(require._thisVal2, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 20, 18)) + } + export declare enum exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 22, 5)) + + _thisVal1, +>_thisVal1 : Symbol(exports._thisVal1, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 23, 33)) + + _thisVal2, +>_thisVal2 : Symbol(exports._thisVal2, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 24, 18)) + } +} + +=== tests/cases/compiler/collisionExportsRequireAndAmbientEnum_globalFile.ts === +declare enum require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 0, 0)) + + _thisVal1, +>_thisVal1 : Symbol(require._thisVal1, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 0, 22)) + + _thisVal2, +>_thisVal2 : Symbol(require._thisVal2, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 1, 14)) +} +declare enum exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 3, 1)) + + _thisVal1, +>_thisVal1 : Symbol(exports._thisVal1, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 4, 22)) + + _thisVal2, +>_thisVal2 : Symbol(exports._thisVal2, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 5, 14)) +} +declare module m3 { +>m3 : Symbol(m3, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 7, 1)) + + enum require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 8, 19)) + + _thisVal1, +>_thisVal1 : Symbol(require._thisVal1, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 9, 18)) + + _thisVal2, +>_thisVal2 : Symbol(require._thisVal2, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 10, 18)) + } + enum exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 12, 5)) + + _thisVal1, +>_thisVal1 : Symbol(exports._thisVal1, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 13, 18)) + + _thisVal2, +>_thisVal2 : Symbol(exports._thisVal2, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 14, 18)) + } +} +module m4 { +>m4 : Symbol(m4, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 17, 1)) + + export declare enum require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 18, 11)) + + _thisVal1, +>_thisVal1 : Symbol(require._thisVal1, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 19, 33)) + + _thisVal2, +>_thisVal2 : Symbol(require._thisVal2, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 20, 18)) + } + export declare enum exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 22, 5)) + + _thisVal1, +>_thisVal1 : Symbol(exports._thisVal1, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 23, 33)) + + _thisVal2, +>_thisVal2 : Symbol(exports._thisVal2, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 24, 18)) + } +} diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientFunction.symbols b/tests/baselines/reference/collisionExportsRequireAndAmbientFunction.symbols new file mode 100644 index 00000000000..807b9e64553 --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientFunction.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/collisionExportsRequireAndAmbientFunction.ts === +export declare function exports(): number; +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientFunction.ts, 0, 0)) + +export declare function require(): string[]; +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientFunction.ts, 0, 42)) + +declare module m1 { +>m1 : Symbol(m1, Decl(collisionExportsRequireAndAmbientFunction.ts, 2, 44)) + + function exports(): string; +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientFunction.ts, 4, 19)) + + function require(): number; +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientFunction.ts, 5, 31)) +} +module m2 { +>m2 : Symbol(m2, Decl(collisionExportsRequireAndAmbientFunction.ts, 7, 1)) + + export declare function exports(): string; +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientFunction.ts, 8, 11)) + + export declare function require(): string[]; +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientFunction.ts, 9, 46)) + + var a = 10; +>a : Symbol(a, Decl(collisionExportsRequireAndAmbientFunction.ts, 11, 7)) +} diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientFunction.types b/tests/baselines/reference/collisionExportsRequireAndAmbientFunction.types index 024bdff8ea3..76210f7dda0 100644 --- a/tests/baselines/reference/collisionExportsRequireAndAmbientFunction.types +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientFunction.types @@ -25,4 +25,5 @@ module m2 { var a = 10; >a : number +>10 : number } diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.symbols b/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.symbols new file mode 100644 index 00000000000..d3d8ad2befe --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/collisionExportsRequireAndAmbientFunctionInGlobalFile.ts === +declare function exports(): number; +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientFunctionInGlobalFile.ts, 0, 0)) + +declare function require(): string; +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientFunctionInGlobalFile.ts, 0, 35)) + +declare module m3 { +>m3 : Symbol(m3, Decl(collisionExportsRequireAndAmbientFunctionInGlobalFile.ts, 1, 35)) + + function exports(): string[]; +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientFunctionInGlobalFile.ts, 2, 19)) + + function require(): number[]; +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientFunctionInGlobalFile.ts, 3, 33)) +} +module m4 { +>m4 : Symbol(m4, Decl(collisionExportsRequireAndAmbientFunctionInGlobalFile.ts, 5, 1)) + + export declare function exports(): string; +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientFunctionInGlobalFile.ts, 6, 11)) + + export declare function require(): string; +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientFunctionInGlobalFile.ts, 7, 46)) + + var a = 10; +>a : Symbol(a, Decl(collisionExportsRequireAndAmbientFunctionInGlobalFile.ts, 9, 7)) +} diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.types b/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.types index 0ecde7f429f..9804380fd7a 100644 --- a/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.types +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.types @@ -25,4 +25,5 @@ module m4 { var a = 10; >a : number +>10 : number } diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientModule.symbols b/tests/baselines/reference/collisionExportsRequireAndAmbientModule.symbols new file mode 100644 index 00000000000..e888a419c42 --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientModule.symbols @@ -0,0 +1,159 @@ +=== tests/cases/compiler/collisionExportsRequireAndAmbientModule_externalmodule.ts === +export declare module require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 0, 0)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 0, 31)) + } + export class C { +>C : Symbol(C, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 2, 5)) + } +} +export function foo(): require.I { +>foo : Symbol(foo, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 5, 1)) +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 0, 0)) +>I : Symbol(require.I, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 0, 31)) + + return null; +} +export declare module exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 8, 1)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 9, 31)) + } + export class C { +>C : Symbol(C, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 11, 5)) + } +} +export function foo2(): exports.I { +>foo2 : Symbol(foo2, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 14, 1)) +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 8, 1)) +>I : Symbol(exports.I, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 9, 31)) + + return null; +} +declare module m1 { +>m1 : Symbol(m1, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 17, 1)) + + module require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 18, 19)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 19, 20)) + } + export class C { +>C : Symbol(C, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 21, 9)) + } + } + module exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 24, 5)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 25, 20)) + } + export class C { +>C : Symbol(C, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 27, 9)) + } + } +} +module m2 { +>m2 : Symbol(m2, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 31, 1)) + + export declare module require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 32, 11)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 33, 35)) + } + export class C { +>C : Symbol(C, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 35, 9)) + } + } + export declare module exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 38, 5)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 39, 35)) + } + export class C { +>C : Symbol(C, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 41, 9)) + } + } + var a = 10; +>a : Symbol(a, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 45, 7)) +} + +=== tests/cases/compiler/collisionExportsRequireAndAmbientModule_globalFile.ts === +declare module require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 0, 0)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 0, 24)) + } + export class C { +>C : Symbol(C, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 2, 5)) + } +} +declare module exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 5, 1)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 6, 24)) + } + export class C { +>C : Symbol(C, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 8, 5)) + } +} +declare module m3 { +>m3 : Symbol(m3, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 11, 1)) + + module require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 12, 19)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 13, 20)) + } + export class C { +>C : Symbol(C, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 15, 9)) + } + } + module exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 18, 5)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 19, 20)) + } + export class C { +>C : Symbol(C, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 21, 9)) + } + } +} +module m4 { +>m4 : Symbol(m4, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 25, 1)) + + export declare module require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 26, 11)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 27, 35)) + } + export class C { +>C : Symbol(C, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 29, 9)) + } + } + export declare module exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 32, 5)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 33, 35)) + } + export class C { +>C : Symbol(C, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 35, 9)) + } + } + + var a = 10; +>a : Symbol(a, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 40, 7)) +} + diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientModule.types b/tests/baselines/reference/collisionExportsRequireAndAmbientModule.types index 7e41093daaa..1c4c56de99c 100644 --- a/tests/baselines/reference/collisionExportsRequireAndAmbientModule.types +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientModule.types @@ -11,10 +11,11 @@ export declare module require { } export function foo(): require.I { >foo : () => require.I ->require : unknown +>require : any >I : require.I return null; +>null : null } export declare module exports { >exports : typeof exports @@ -28,10 +29,11 @@ export declare module exports { } export function foo2(): exports.I { >foo2 : () => exports.I ->exports : unknown +>exports : any >I : exports.I return null; +>null : null } declare module m1 { >m1 : typeof m1 @@ -82,6 +84,7 @@ module m2 { } var a = 10; >a : number +>10 : number } === tests/cases/compiler/collisionExportsRequireAndAmbientModule_globalFile.ts === @@ -155,5 +158,6 @@ module m4 { var a = 10; >a : number +>10 : number } diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientVar.symbols b/tests/baselines/reference/collisionExportsRequireAndAmbientVar.symbols new file mode 100644 index 00000000000..518d9ee8b63 --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientVar.symbols @@ -0,0 +1,57 @@ +=== tests/cases/compiler/collisionExportsRequireAndAmbientVar_externalmodule.ts === +export declare var exports: number; +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientVar_externalmodule.ts, 0, 18)) + +export declare var require: string; +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientVar_externalmodule.ts, 1, 18)) + +declare module m1 { +>m1 : Symbol(m1, Decl(collisionExportsRequireAndAmbientVar_externalmodule.ts, 1, 35)) + + var exports: string; +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientVar_externalmodule.ts, 3, 7)) + + var require: number; +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientVar_externalmodule.ts, 4, 7)) +} +module m2 { +>m2 : Symbol(m2, Decl(collisionExportsRequireAndAmbientVar_externalmodule.ts, 5, 1)) + + export declare var exports: number; +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientVar_externalmodule.ts, 7, 22)) + + export declare var require: string; +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientVar_externalmodule.ts, 8, 22)) + + var a = 10; +>a : Symbol(a, Decl(collisionExportsRequireAndAmbientVar_externalmodule.ts, 9, 7)) +} + +=== tests/cases/compiler/collisionExportsRequireAndAmbientVar_globalFile.ts === +declare var exports: number; +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientVar_globalFile.ts, 0, 11)) + +declare var require: string; +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientVar_globalFile.ts, 1, 11)) + +declare module m3 { +>m3 : Symbol(m3, Decl(collisionExportsRequireAndAmbientVar_globalFile.ts, 1, 28)) + + var exports: string; +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientVar_globalFile.ts, 3, 7)) + + var require: number; +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientVar_globalFile.ts, 4, 7)) +} +module m4 { +>m4 : Symbol(m4, Decl(collisionExportsRequireAndAmbientVar_globalFile.ts, 5, 1)) + + export declare var exports: string; +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientVar_globalFile.ts, 7, 22)) + + export declare var require: number; +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientVar_globalFile.ts, 8, 22)) + + var a = 10; +>a : Symbol(a, Decl(collisionExportsRequireAndAmbientVar_globalFile.ts, 9, 7)) +} diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientVar.types b/tests/baselines/reference/collisionExportsRequireAndAmbientVar.types index 1419df3504b..90a9b8968e5 100644 --- a/tests/baselines/reference/collisionExportsRequireAndAmbientVar.types +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientVar.types @@ -25,6 +25,7 @@ module m2 { var a = 10; >a : number +>10 : number } === tests/cases/compiler/collisionExportsRequireAndAmbientVar_globalFile.ts === @@ -54,4 +55,5 @@ module m4 { var a = 10; >a : number +>10 : number } diff --git a/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.symbols b/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.symbols new file mode 100644 index 00000000000..2fae606b76b --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/collisionExportsRequireAndFunctionInGlobalFile.ts === +function exports() { +>exports : Symbol(exports, Decl(collisionExportsRequireAndFunctionInGlobalFile.ts, 0, 0)) + + return 1; +} +function require() { +>require : Symbol(require, Decl(collisionExportsRequireAndFunctionInGlobalFile.ts, 2, 1)) + + return "require"; +} +module m3 { +>m3 : Symbol(m3, Decl(collisionExportsRequireAndFunctionInGlobalFile.ts, 5, 1)) + + function exports() { +>exports : Symbol(exports, Decl(collisionExportsRequireAndFunctionInGlobalFile.ts, 6, 11)) + + return 1; + } + function require() { +>require : Symbol(require, Decl(collisionExportsRequireAndFunctionInGlobalFile.ts, 9, 5)) + + return "require"; + } +} +module m4 { +>m4 : Symbol(m4, Decl(collisionExportsRequireAndFunctionInGlobalFile.ts, 13, 1)) + + export function exports() { +>exports : Symbol(exports, Decl(collisionExportsRequireAndFunctionInGlobalFile.ts, 14, 11)) + + return 1; + } + export function require() { +>require : Symbol(require, Decl(collisionExportsRequireAndFunctionInGlobalFile.ts, 17, 5)) + + return "require"; + } +} diff --git a/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.types b/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.types index ba804feb91a..3cc08359508 100644 --- a/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.types +++ b/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.types @@ -3,11 +3,13 @@ function exports() { >exports : () => number return 1; +>1 : number } function require() { >require : () => string return "require"; +>"require" : string } module m3 { >m3 : typeof m3 @@ -16,11 +18,13 @@ module m3 { >exports : () => number return 1; +>1 : number } function require() { >require : () => string return "require"; +>"require" : string } } module m4 { @@ -30,10 +34,12 @@ module m4 { >exports : () => number return 1; +>1 : number } export function require() { >require : () => string return "require"; +>"require" : string } } diff --git a/tests/baselines/reference/collisionExportsRequireAndInternalModuleAliasInGlobalFile.symbols b/tests/baselines/reference/collisionExportsRequireAndInternalModuleAliasInGlobalFile.symbols new file mode 100644 index 00000000000..08b8cf9c6a8 --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndInternalModuleAliasInGlobalFile.symbols @@ -0,0 +1,63 @@ +=== tests/cases/compiler/collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts === +module mOfGloalFile { +>mOfGloalFile : Symbol(mOfGloalFile, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 0)) + + export class c { +>c : Symbol(c, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 21)) + } +} +import exports = mOfGloalFile.c; +>exports : Symbol(exports, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 3, 1)) +>mOfGloalFile : Symbol(mOfGloalFile, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 0)) +>c : Symbol(exports, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 21)) + +import require = mOfGloalFile.c; +>require : Symbol(require, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 4, 32)) +>mOfGloalFile : Symbol(mOfGloalFile, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 0)) +>c : Symbol(exports, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 21)) + +new exports(); +>exports : Symbol(exports, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 3, 1)) + +new require(); +>require : Symbol(require, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 4, 32)) + +module m1 { +>m1 : Symbol(m1, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 7, 14)) + + import exports = mOfGloalFile.c; +>exports : Symbol(exports, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 9, 11)) +>mOfGloalFile : Symbol(mOfGloalFile, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 0)) +>c : Symbol(exports, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 21)) + + import require = mOfGloalFile.c; +>require : Symbol(require, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 10, 36)) +>mOfGloalFile : Symbol(mOfGloalFile, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 0)) +>c : Symbol(exports, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 21)) + + new exports(); +>exports : Symbol(exports, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 9, 11)) + + new require(); +>require : Symbol(require, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 10, 36)) +} + +module m2 { +>m2 : Symbol(m2, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 14, 1)) + + export import exports = mOfGloalFile.c; +>exports : Symbol(exports, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 16, 11)) +>mOfGloalFile : Symbol(mOfGloalFile, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 0)) +>c : Symbol(exports, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 21)) + + export import require = mOfGloalFile.c; +>require : Symbol(require, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 17, 43)) +>mOfGloalFile : Symbol(mOfGloalFile, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 0)) +>c : Symbol(exports, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 21)) + + new exports(); +>exports : Symbol(exports, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 16, 11)) + + new require(); +>require : Symbol(require, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 17, 43)) +} diff --git a/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.symbols b/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.symbols new file mode 100644 index 00000000000..409d1275677 --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/collisionExportsRequireAndUninstantiatedModule.ts === +export module require { // no error +>require : Symbol(require, Decl(collisionExportsRequireAndUninstantiatedModule.ts, 0, 0)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndUninstantiatedModule.ts, 0, 23)) + } +} +export function foo(): require.I { +>foo : Symbol(foo, Decl(collisionExportsRequireAndUninstantiatedModule.ts, 3, 1)) +>require : Symbol(require, Decl(collisionExportsRequireAndUninstantiatedModule.ts, 0, 0)) +>I : Symbol(require.I, Decl(collisionExportsRequireAndUninstantiatedModule.ts, 0, 23)) + + return null; +} +export module exports { // no error +>exports : Symbol(exports, Decl(collisionExportsRequireAndUninstantiatedModule.ts, 6, 1)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndUninstantiatedModule.ts, 7, 23)) + } +} +export function foo2(): exports.I { +>foo2 : Symbol(foo2, Decl(collisionExportsRequireAndUninstantiatedModule.ts, 10, 1)) +>exports : Symbol(exports, Decl(collisionExportsRequireAndUninstantiatedModule.ts, 6, 1)) +>I : Symbol(exports.I, Decl(collisionExportsRequireAndUninstantiatedModule.ts, 7, 23)) + + return null; +} diff --git a/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.types b/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.types index 59d90feda46..4b313bcd849 100644 --- a/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.types +++ b/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.types @@ -1,6 +1,6 @@ === tests/cases/compiler/collisionExportsRequireAndUninstantiatedModule.ts === export module require { // no error ->require : unknown +>require : any export interface I { >I : I @@ -8,13 +8,14 @@ export module require { // no error } export function foo(): require.I { >foo : () => require.I ->require : unknown +>require : any >I : require.I return null; +>null : null } export module exports { // no error ->exports : unknown +>exports : any export interface I { >I : I @@ -22,8 +23,9 @@ export module exports { // no error } export function foo2(): exports.I { >foo2 : () => exports.I ->exports : unknown +>exports : any >I : exports.I return null; +>null : null } diff --git a/tests/baselines/reference/collisionRestParameterArrowFunctions.symbols b/tests/baselines/reference/collisionRestParameterArrowFunctions.symbols new file mode 100644 index 00000000000..9a44f92b1f5 --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterArrowFunctions.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/collisionRestParameterArrowFunctions.ts === +var f1 = (_i: number, ...restParameters) => { //_i is error +>f1 : Symbol(f1, Decl(collisionRestParameterArrowFunctions.ts, 0, 3)) +>_i : Symbol(_i, Decl(collisionRestParameterArrowFunctions.ts, 0, 10), Decl(collisionRestParameterArrowFunctions.ts, 1, 7)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterArrowFunctions.ts, 0, 21)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterArrowFunctions.ts, 0, 10), Decl(collisionRestParameterArrowFunctions.ts, 1, 7)) +} +var f1NoError = (_i: number) => { // no error +>f1NoError : Symbol(f1NoError, Decl(collisionRestParameterArrowFunctions.ts, 3, 3)) +>_i : Symbol(_i, Decl(collisionRestParameterArrowFunctions.ts, 3, 17), Decl(collisionRestParameterArrowFunctions.ts, 4, 7)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterArrowFunctions.ts, 3, 17), Decl(collisionRestParameterArrowFunctions.ts, 4, 7)) +} + +var f2 = (...restParameters) => { +>f2 : Symbol(f2, Decl(collisionRestParameterArrowFunctions.ts, 7, 3)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterArrowFunctions.ts, 7, 10)) + + var _i = 10; // No Error +>_i : Symbol(_i, Decl(collisionRestParameterArrowFunctions.ts, 8, 7)) +} +var f2NoError = () => { +>f2NoError : Symbol(f2NoError, Decl(collisionRestParameterArrowFunctions.ts, 10, 3)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterArrowFunctions.ts, 11, 7)) +} diff --git a/tests/baselines/reference/collisionRestParameterArrowFunctions.types b/tests/baselines/reference/collisionRestParameterArrowFunctions.types index f2316c99583..dcd52e5f766 100644 --- a/tests/baselines/reference/collisionRestParameterArrowFunctions.types +++ b/tests/baselines/reference/collisionRestParameterArrowFunctions.types @@ -7,6 +7,7 @@ var f1 = (_i: number, ...restParameters) => { //_i is error var _i = 10; // no error >_i : number +>10 : number } var f1NoError = (_i: number) => { // no error >f1NoError : (_i: number) => void @@ -15,6 +16,7 @@ var f1NoError = (_i: number) => { // no error var _i = 10; // no error >_i : number +>10 : number } var f2 = (...restParameters) => { @@ -24,6 +26,7 @@ var f2 = (...restParameters) => { var _i = 10; // No Error >_i : number +>10 : number } var f2NoError = () => { >f2NoError : () => void @@ -31,4 +34,5 @@ var f2NoError = () => { var _i = 10; // no error >_i : number +>10 : number } diff --git a/tests/baselines/reference/collisionRestParameterClassConstructor.symbols b/tests/baselines/reference/collisionRestParameterClassConstructor.symbols new file mode 100644 index 00000000000..895cb0f8df4 --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterClassConstructor.symbols @@ -0,0 +1,137 @@ +=== tests/cases/compiler/collisionRestParameterClassConstructor.ts === +// Constructors +class c1 { +>c1 : Symbol(c1, Decl(collisionRestParameterClassConstructor.ts, 0, 0)) + + constructor(_i: number, ...restParameters) { //_i is error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 2, 16), Decl(collisionRestParameterClassConstructor.ts, 3, 11)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterClassConstructor.ts, 2, 27)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 2, 16), Decl(collisionRestParameterClassConstructor.ts, 3, 11)) + } +} +class c1NoError { +>c1NoError : Symbol(c1NoError, Decl(collisionRestParameterClassConstructor.ts, 5, 1)) + + constructor(_i: number) { // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 7, 16), Decl(collisionRestParameterClassConstructor.ts, 8, 11)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 7, 16), Decl(collisionRestParameterClassConstructor.ts, 8, 11)) + } +} + +class c2 { +>c2 : Symbol(c2, Decl(collisionRestParameterClassConstructor.ts, 10, 1)) + + constructor(...restParameters) { +>restParameters : Symbol(restParameters, Decl(collisionRestParameterClassConstructor.ts, 13, 16)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 14, 11)) + } +} +class c2NoError { +>c2NoError : Symbol(c2NoError, Decl(collisionRestParameterClassConstructor.ts, 16, 1)) + + constructor() { + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 19, 11)) + } +} + +class c3 { +>c3 : Symbol(c3, Decl(collisionRestParameterClassConstructor.ts, 21, 1)) + + constructor(public _i: number, ...restParameters) { //_i is error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 24, 16)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterClassConstructor.ts, 24, 34)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 24, 16), Decl(collisionRestParameterClassConstructor.ts, 25, 11)) + } +} +class c3NoError { +>c3NoError : Symbol(c3NoError, Decl(collisionRestParameterClassConstructor.ts, 27, 1)) + + constructor(public _i: number) { // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 29, 16)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 29, 16), Decl(collisionRestParameterClassConstructor.ts, 30, 11)) + } +} + +declare class c4 { +>c4 : Symbol(c4, Decl(collisionRestParameterClassConstructor.ts, 32, 1)) + + constructor(_i: number, ...restParameters); // No error - no code gen +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 35, 16)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterClassConstructor.ts, 35, 27)) +} +declare class c4NoError { +>c4NoError : Symbol(c4NoError, Decl(collisionRestParameterClassConstructor.ts, 36, 1)) + + constructor(_i: number); // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 38, 16)) +} + +class c5 { +>c5 : Symbol(c5, Decl(collisionRestParameterClassConstructor.ts, 39, 1)) + + constructor(_i: number, ...rest); // no codegen no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 42, 16)) +>rest : Symbol(rest, Decl(collisionRestParameterClassConstructor.ts, 42, 27)) + + constructor(_i: string, ...rest); // no codegen no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 43, 16)) +>rest : Symbol(rest, Decl(collisionRestParameterClassConstructor.ts, 43, 27)) + + constructor(_i: any, ...rest) { // error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 44, 16), Decl(collisionRestParameterClassConstructor.ts, 45, 11)) +>rest : Symbol(rest, Decl(collisionRestParameterClassConstructor.ts, 44, 24)) + + var _i: any; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 44, 16), Decl(collisionRestParameterClassConstructor.ts, 45, 11)) + } +} + +class c5NoError { +>c5NoError : Symbol(c5NoError, Decl(collisionRestParameterClassConstructor.ts, 47, 1)) + + constructor(_i: number); // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 50, 16)) + + constructor(_i: string); // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 51, 16)) + + constructor(_i: any) { // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 52, 16), Decl(collisionRestParameterClassConstructor.ts, 53, 11)) + + var _i: any; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 52, 16), Decl(collisionRestParameterClassConstructor.ts, 53, 11)) + } +} + +declare class c6 { +>c6 : Symbol(c6, Decl(collisionRestParameterClassConstructor.ts, 55, 1)) + + constructor(_i: number, ...rest); // no codegen no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 58, 16)) +>rest : Symbol(rest, Decl(collisionRestParameterClassConstructor.ts, 58, 27)) + + constructor(_i: string, ...rest); // no codegen no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 59, 16)) +>rest : Symbol(rest, Decl(collisionRestParameterClassConstructor.ts, 59, 27)) +} + +declare class c6NoError { +>c6NoError : Symbol(c6NoError, Decl(collisionRestParameterClassConstructor.ts, 60, 1)) + + constructor(_i: number); // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 63, 16)) + + constructor(_i: string); // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 64, 16)) +} diff --git a/tests/baselines/reference/collisionRestParameterClassConstructor.types b/tests/baselines/reference/collisionRestParameterClassConstructor.types index d0ceb9e0749..f86d6d80d21 100644 --- a/tests/baselines/reference/collisionRestParameterClassConstructor.types +++ b/tests/baselines/reference/collisionRestParameterClassConstructor.types @@ -9,6 +9,7 @@ class c1 { var _i = 10; // no error >_i : number +>10 : number } } class c1NoError { @@ -19,6 +20,7 @@ class c1NoError { var _i = 10; // no error >_i : number +>10 : number } } @@ -30,6 +32,7 @@ class c2 { var _i = 10; // no error >_i : number +>10 : number } } class c2NoError { @@ -38,6 +41,7 @@ class c2NoError { constructor() { var _i = 10; // no error >_i : number +>10 : number } } @@ -50,6 +54,7 @@ class c3 { var _i = 10; // no error >_i : number +>10 : number } } class c3NoError { @@ -60,6 +65,7 @@ class c3NoError { var _i = 10; // no error >_i : number +>10 : number } } diff --git a/tests/baselines/reference/collisionRestParameterClassMethod.symbols b/tests/baselines/reference/collisionRestParameterClassMethod.symbols new file mode 100644 index 00000000000..838736e33ce --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterClassMethod.symbols @@ -0,0 +1,103 @@ +=== tests/cases/compiler/collisionRestParameterClassMethod.ts === +class c1 { +>c1 : Symbol(c1, Decl(collisionRestParameterClassMethod.ts, 0, 0)) + + public foo(_i: number, ...restParameters) { //_i is error +>foo : Symbol(foo, Decl(collisionRestParameterClassMethod.ts, 0, 10)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 1, 15), Decl(collisionRestParameterClassMethod.ts, 2, 11)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterClassMethod.ts, 1, 26)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 1, 15), Decl(collisionRestParameterClassMethod.ts, 2, 11)) + } + public fooNoError(_i: number) { // no error +>fooNoError : Symbol(fooNoError, Decl(collisionRestParameterClassMethod.ts, 3, 5)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 4, 22), Decl(collisionRestParameterClassMethod.ts, 5, 11)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 4, 22), Decl(collisionRestParameterClassMethod.ts, 5, 11)) + } + public f4(_i: number, ...rest); // no codegen no error +>f4 : Symbol(f4, Decl(collisionRestParameterClassMethod.ts, 6, 5), Decl(collisionRestParameterClassMethod.ts, 7, 35), Decl(collisionRestParameterClassMethod.ts, 8, 35)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 7, 14)) +>rest : Symbol(rest, Decl(collisionRestParameterClassMethod.ts, 7, 25)) + + public f4(_i: string, ...rest); // no codegen no error +>f4 : Symbol(f4, Decl(collisionRestParameterClassMethod.ts, 6, 5), Decl(collisionRestParameterClassMethod.ts, 7, 35), Decl(collisionRestParameterClassMethod.ts, 8, 35)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 8, 14)) +>rest : Symbol(rest, Decl(collisionRestParameterClassMethod.ts, 8, 25)) + + public f4(_i: any, ...rest) { // error +>f4 : Symbol(f4, Decl(collisionRestParameterClassMethod.ts, 6, 5), Decl(collisionRestParameterClassMethod.ts, 7, 35), Decl(collisionRestParameterClassMethod.ts, 8, 35)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 9, 14), Decl(collisionRestParameterClassMethod.ts, 10, 11)) +>rest : Symbol(rest, Decl(collisionRestParameterClassMethod.ts, 9, 22)) + + var _i: any; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 9, 14), Decl(collisionRestParameterClassMethod.ts, 10, 11)) + } + + public f4NoError(_i: number); // no error +>f4NoError : Symbol(f4NoError, Decl(collisionRestParameterClassMethod.ts, 11, 5), Decl(collisionRestParameterClassMethod.ts, 13, 33), Decl(collisionRestParameterClassMethod.ts, 14, 33)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 13, 21)) + + public f4NoError(_i: string); // no error +>f4NoError : Symbol(f4NoError, Decl(collisionRestParameterClassMethod.ts, 11, 5), Decl(collisionRestParameterClassMethod.ts, 13, 33), Decl(collisionRestParameterClassMethod.ts, 14, 33)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 14, 21)) + + public f4NoError(_i: any) { // no error +>f4NoError : Symbol(f4NoError, Decl(collisionRestParameterClassMethod.ts, 11, 5), Decl(collisionRestParameterClassMethod.ts, 13, 33), Decl(collisionRestParameterClassMethod.ts, 14, 33)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 15, 21), Decl(collisionRestParameterClassMethod.ts, 16, 11)) + + var _i: any; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 15, 21), Decl(collisionRestParameterClassMethod.ts, 16, 11)) + } +} + +declare class c2 { +>c2 : Symbol(c2, Decl(collisionRestParameterClassMethod.ts, 18, 1)) + + public foo(_i: number, ...restParameters); // No error - no code gen +>foo : Symbol(foo, Decl(collisionRestParameterClassMethod.ts, 20, 18)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 21, 15)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterClassMethod.ts, 21, 26)) + + public fooNoError(_i: number); // no error +>fooNoError : Symbol(fooNoError, Decl(collisionRestParameterClassMethod.ts, 21, 46)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 22, 22)) + + public f4(_i: number, ...rest); // no codegen no error +>f4 : Symbol(f4, Decl(collisionRestParameterClassMethod.ts, 22, 34), Decl(collisionRestParameterClassMethod.ts, 24, 35)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 24, 14)) +>rest : Symbol(rest, Decl(collisionRestParameterClassMethod.ts, 24, 25)) + + public f4(_i: string, ...rest); // no codegen no error +>f4 : Symbol(f4, Decl(collisionRestParameterClassMethod.ts, 22, 34), Decl(collisionRestParameterClassMethod.ts, 24, 35)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 25, 14)) +>rest : Symbol(rest, Decl(collisionRestParameterClassMethod.ts, 25, 25)) + + public f4NoError(_i: number); // no error +>f4NoError : Symbol(f4NoError, Decl(collisionRestParameterClassMethod.ts, 25, 35), Decl(collisionRestParameterClassMethod.ts, 26, 33)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 26, 21)) + + public f4NoError(_i: string); // no error +>f4NoError : Symbol(f4NoError, Decl(collisionRestParameterClassMethod.ts, 25, 35), Decl(collisionRestParameterClassMethod.ts, 26, 33)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 27, 21)) +} + +class c3 { +>c3 : Symbol(c3, Decl(collisionRestParameterClassMethod.ts, 28, 1)) + + public foo(...restParameters) { +>foo : Symbol(foo, Decl(collisionRestParameterClassMethod.ts, 30, 10)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterClassMethod.ts, 31, 15)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 32, 11)) + } + public fooNoError() { +>fooNoError : Symbol(fooNoError, Decl(collisionRestParameterClassMethod.ts, 33, 5)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 35, 11)) + } +} diff --git a/tests/baselines/reference/collisionRestParameterClassMethod.types b/tests/baselines/reference/collisionRestParameterClassMethod.types index 2a4c23ae5a9..bc6b09dd795 100644 --- a/tests/baselines/reference/collisionRestParameterClassMethod.types +++ b/tests/baselines/reference/collisionRestParameterClassMethod.types @@ -9,6 +9,7 @@ class c1 { var _i = 10; // no error >_i : number +>10 : number } public fooNoError(_i: number) { // no error >fooNoError : (_i: number) => void @@ -16,6 +17,7 @@ class c1 { var _i = 10; // no error >_i : number +>10 : number } public f4(_i: number, ...rest); // no codegen no error >f4 : { (_i: number, ...rest: any[]): any; (_i: string, ...rest: any[]): any; } @@ -93,11 +95,13 @@ class c3 { var _i = 10; // no error >_i : number +>10 : number } public fooNoError() { >fooNoError : () => void var _i = 10; // no error >_i : number +>10 : number } } diff --git a/tests/baselines/reference/collisionRestParameterFunction.symbols b/tests/baselines/reference/collisionRestParameterFunction.symbols new file mode 100644 index 00000000000..918cc7534dd --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterFunction.symbols @@ -0,0 +1,88 @@ +=== tests/cases/compiler/collisionRestParameterFunction.ts === +// Functions +function f1(_i: number, ...restParameters) { //_i is error +>f1 : Symbol(f1, Decl(collisionRestParameterFunction.ts, 0, 0)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 1, 12), Decl(collisionRestParameterFunction.ts, 2, 7)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterFunction.ts, 1, 23)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 1, 12), Decl(collisionRestParameterFunction.ts, 2, 7)) +} +function f1NoError(_i: number) { // no error +>f1NoError : Symbol(f1NoError, Decl(collisionRestParameterFunction.ts, 3, 1)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 4, 19), Decl(collisionRestParameterFunction.ts, 5, 7)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 4, 19), Decl(collisionRestParameterFunction.ts, 5, 7)) +} + +declare function f2(_i: number, ...restParameters); // no error - no code gen +>f2 : Symbol(f2, Decl(collisionRestParameterFunction.ts, 6, 1)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 8, 20)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterFunction.ts, 8, 31)) + +declare function f2NoError(_i: number); // no error +>f2NoError : Symbol(f2NoError, Decl(collisionRestParameterFunction.ts, 8, 51)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 9, 27)) + +function f3(...restParameters) { +>f3 : Symbol(f3, Decl(collisionRestParameterFunction.ts, 9, 39)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterFunction.ts, 11, 12)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 12, 7)) +} +function f3NoError() { +>f3NoError : Symbol(f3NoError, Decl(collisionRestParameterFunction.ts, 13, 1)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 15, 7)) +} + +function f4(_i: number, ...rest); // no codegen no error +>f4 : Symbol(f4, Decl(collisionRestParameterFunction.ts, 16, 1), Decl(collisionRestParameterFunction.ts, 18, 33), Decl(collisionRestParameterFunction.ts, 19, 33)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 18, 12)) +>rest : Symbol(rest, Decl(collisionRestParameterFunction.ts, 18, 23)) + +function f4(_i: string, ...rest); // no codegen no error +>f4 : Symbol(f4, Decl(collisionRestParameterFunction.ts, 16, 1), Decl(collisionRestParameterFunction.ts, 18, 33), Decl(collisionRestParameterFunction.ts, 19, 33)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 19, 12)) +>rest : Symbol(rest, Decl(collisionRestParameterFunction.ts, 19, 23)) + +function f4(_i: any, ...rest) { // error +>f4 : Symbol(f4, Decl(collisionRestParameterFunction.ts, 16, 1), Decl(collisionRestParameterFunction.ts, 18, 33), Decl(collisionRestParameterFunction.ts, 19, 33)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 20, 12)) +>rest : Symbol(rest, Decl(collisionRestParameterFunction.ts, 20, 20)) +} + +function f4NoError(_i: number); // no error +>f4NoError : Symbol(f4NoError, Decl(collisionRestParameterFunction.ts, 21, 1), Decl(collisionRestParameterFunction.ts, 23, 31), Decl(collisionRestParameterFunction.ts, 24, 31)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 23, 19)) + +function f4NoError(_i: string); // no error +>f4NoError : Symbol(f4NoError, Decl(collisionRestParameterFunction.ts, 21, 1), Decl(collisionRestParameterFunction.ts, 23, 31), Decl(collisionRestParameterFunction.ts, 24, 31)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 24, 19)) + +function f4NoError(_i: any) { // no error +>f4NoError : Symbol(f4NoError, Decl(collisionRestParameterFunction.ts, 21, 1), Decl(collisionRestParameterFunction.ts, 23, 31), Decl(collisionRestParameterFunction.ts, 24, 31)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 25, 19)) +} + +declare function f5(_i: number, ...rest); // no codegen no error +>f5 : Symbol(f5, Decl(collisionRestParameterFunction.ts, 26, 1), Decl(collisionRestParameterFunction.ts, 28, 41)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 28, 20)) +>rest : Symbol(rest, Decl(collisionRestParameterFunction.ts, 28, 31)) + +declare function f5(_i: string, ...rest); // no codegen no error +>f5 : Symbol(f5, Decl(collisionRestParameterFunction.ts, 26, 1), Decl(collisionRestParameterFunction.ts, 28, 41)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 29, 20)) +>rest : Symbol(rest, Decl(collisionRestParameterFunction.ts, 29, 31)) + +declare function f6(_i: number); // no codegen no error +>f6 : Symbol(f6, Decl(collisionRestParameterFunction.ts, 29, 41), Decl(collisionRestParameterFunction.ts, 31, 32)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 31, 20)) + +declare function f6(_i: string); // no codegen no error +>f6 : Symbol(f6, Decl(collisionRestParameterFunction.ts, 29, 41), Decl(collisionRestParameterFunction.ts, 31, 32)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 32, 20)) + diff --git a/tests/baselines/reference/collisionRestParameterFunction.types b/tests/baselines/reference/collisionRestParameterFunction.types index f0d8abeac9d..d988f74c928 100644 --- a/tests/baselines/reference/collisionRestParameterFunction.types +++ b/tests/baselines/reference/collisionRestParameterFunction.types @@ -7,6 +7,7 @@ function f1(_i: number, ...restParameters) { //_i is error var _i = 10; // no error >_i : number +>10 : number } function f1NoError(_i: number) { // no error >f1NoError : (_i: number) => void @@ -14,6 +15,7 @@ function f1NoError(_i: number) { // no error var _i = 10; // no error >_i : number +>10 : number } declare function f2(_i: number, ...restParameters); // no error - no code gen @@ -31,12 +33,14 @@ function f3(...restParameters) { var _i = 10; // no error >_i : number +>10 : number } function f3NoError() { >f3NoError : () => void var _i = 10; // no error >_i : number +>10 : number } function f4(_i: number, ...rest); // no codegen no error diff --git a/tests/baselines/reference/collisionRestParameterFunctionExpressions.symbols b/tests/baselines/reference/collisionRestParameterFunctionExpressions.symbols new file mode 100644 index 00000000000..42339c0da95 --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterFunctionExpressions.symbols @@ -0,0 +1,62 @@ +=== tests/cases/compiler/collisionRestParameterFunctionExpressions.ts === +function foo() { +>foo : Symbol(foo, Decl(collisionRestParameterFunctionExpressions.ts, 0, 0)) + + function f1(_i: number, ...restParameters) { //_i is error +>f1 : Symbol(f1, Decl(collisionRestParameterFunctionExpressions.ts, 0, 16)) +>_i : Symbol(_i, Decl(collisionRestParameterFunctionExpressions.ts, 1, 16), Decl(collisionRestParameterFunctionExpressions.ts, 2, 11)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterFunctionExpressions.ts, 1, 27)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterFunctionExpressions.ts, 1, 16), Decl(collisionRestParameterFunctionExpressions.ts, 2, 11)) + } + function f1NoError(_i: number) { // no error +>f1NoError : Symbol(f1NoError, Decl(collisionRestParameterFunctionExpressions.ts, 3, 5)) +>_i : Symbol(_i, Decl(collisionRestParameterFunctionExpressions.ts, 4, 23), Decl(collisionRestParameterFunctionExpressions.ts, 5, 11)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterFunctionExpressions.ts, 4, 23), Decl(collisionRestParameterFunctionExpressions.ts, 5, 11)) + } + function f3(...restParameters) { +>f3 : Symbol(f3, Decl(collisionRestParameterFunctionExpressions.ts, 6, 5)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterFunctionExpressions.ts, 7, 16)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterFunctionExpressions.ts, 8, 11)) + } + function f3NoError() { +>f3NoError : Symbol(f3NoError, Decl(collisionRestParameterFunctionExpressions.ts, 9, 5)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterFunctionExpressions.ts, 11, 11)) + } + + function f4(_i: number, ...rest); // no codegen no error +>f4 : Symbol(f4, Decl(collisionRestParameterFunctionExpressions.ts, 12, 5), Decl(collisionRestParameterFunctionExpressions.ts, 14, 37), Decl(collisionRestParameterFunctionExpressions.ts, 15, 37)) +>_i : Symbol(_i, Decl(collisionRestParameterFunctionExpressions.ts, 14, 16)) +>rest : Symbol(rest, Decl(collisionRestParameterFunctionExpressions.ts, 14, 27)) + + function f4(_i: string, ...rest); // no codegen no error +>f4 : Symbol(f4, Decl(collisionRestParameterFunctionExpressions.ts, 12, 5), Decl(collisionRestParameterFunctionExpressions.ts, 14, 37), Decl(collisionRestParameterFunctionExpressions.ts, 15, 37)) +>_i : Symbol(_i, Decl(collisionRestParameterFunctionExpressions.ts, 15, 16)) +>rest : Symbol(rest, Decl(collisionRestParameterFunctionExpressions.ts, 15, 27)) + + function f4(_i: any, ...rest) { // error +>f4 : Symbol(f4, Decl(collisionRestParameterFunctionExpressions.ts, 12, 5), Decl(collisionRestParameterFunctionExpressions.ts, 14, 37), Decl(collisionRestParameterFunctionExpressions.ts, 15, 37)) +>_i : Symbol(_i, Decl(collisionRestParameterFunctionExpressions.ts, 16, 16)) +>rest : Symbol(rest, Decl(collisionRestParameterFunctionExpressions.ts, 16, 24)) + } + + function f4NoError(_i: number); // no error +>f4NoError : Symbol(f4NoError, Decl(collisionRestParameterFunctionExpressions.ts, 17, 5), Decl(collisionRestParameterFunctionExpressions.ts, 19, 35), Decl(collisionRestParameterFunctionExpressions.ts, 20, 35)) +>_i : Symbol(_i, Decl(collisionRestParameterFunctionExpressions.ts, 19, 23)) + + function f4NoError(_i: string); // no error +>f4NoError : Symbol(f4NoError, Decl(collisionRestParameterFunctionExpressions.ts, 17, 5), Decl(collisionRestParameterFunctionExpressions.ts, 19, 35), Decl(collisionRestParameterFunctionExpressions.ts, 20, 35)) +>_i : Symbol(_i, Decl(collisionRestParameterFunctionExpressions.ts, 20, 23)) + + function f4NoError(_i: any) { // no error +>f4NoError : Symbol(f4NoError, Decl(collisionRestParameterFunctionExpressions.ts, 17, 5), Decl(collisionRestParameterFunctionExpressions.ts, 19, 35), Decl(collisionRestParameterFunctionExpressions.ts, 20, 35)) +>_i : Symbol(_i, Decl(collisionRestParameterFunctionExpressions.ts, 21, 23)) + } +} diff --git a/tests/baselines/reference/collisionRestParameterFunctionExpressions.types b/tests/baselines/reference/collisionRestParameterFunctionExpressions.types index c6c52390894..f8ca0c18ed8 100644 --- a/tests/baselines/reference/collisionRestParameterFunctionExpressions.types +++ b/tests/baselines/reference/collisionRestParameterFunctionExpressions.types @@ -9,6 +9,7 @@ function foo() { var _i = 10; // no error >_i : number +>10 : number } function f1NoError(_i: number) { // no error >f1NoError : (_i: number) => void @@ -16,6 +17,7 @@ function foo() { var _i = 10; // no error >_i : number +>10 : number } function f3(...restParameters) { >f3 : (...restParameters: any[]) => void @@ -23,12 +25,14 @@ function foo() { var _i = 10; // no error >_i : number +>10 : number } function f3NoError() { >f3NoError : () => void var _i = 10; // no error >_i : number +>10 : number } function f4(_i: number, ...rest); // no codegen no error diff --git a/tests/baselines/reference/collisionRestParameterInType.symbols b/tests/baselines/reference/collisionRestParameterInType.symbols new file mode 100644 index 00000000000..efe0e89ad42 --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterInType.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/collisionRestParameterInType.ts === +var v1: (_i: number, ...restParameters) => void; // no error - no code gen +>v1 : Symbol(v1, Decl(collisionRestParameterInType.ts, 0, 3)) +>_i : Symbol(_i, Decl(collisionRestParameterInType.ts, 0, 9)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterInType.ts, 0, 20)) + +var v2: { +>v2 : Symbol(v2, Decl(collisionRestParameterInType.ts, 1, 3)) + + (_i: number, ...restParameters); // no error - no code gen +>_i : Symbol(_i, Decl(collisionRestParameterInType.ts, 2, 5)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterInType.ts, 2, 16)) + + new (_i: number, ...restParameters); // no error - no code gen +>_i : Symbol(_i, Decl(collisionRestParameterInType.ts, 3, 9)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterInType.ts, 3, 20)) + + foo(_i: number, ...restParameters); // no error - no code gen +>foo : Symbol(foo, Decl(collisionRestParameterInType.ts, 3, 40)) +>_i : Symbol(_i, Decl(collisionRestParameterInType.ts, 4, 8)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterInType.ts, 4, 19)) + + prop: (_i: number, ...restParameters) => void; // no error - no code gen +>prop : Symbol(prop, Decl(collisionRestParameterInType.ts, 4, 39)) +>_i : Symbol(_i, Decl(collisionRestParameterInType.ts, 5, 11)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterInType.ts, 5, 22)) +} diff --git a/tests/baselines/reference/collisionRestParameterInterfaceMembers.symbols b/tests/baselines/reference/collisionRestParameterInterfaceMembers.symbols new file mode 100644 index 00000000000..448346c0838 --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterInterfaceMembers.symbols @@ -0,0 +1,44 @@ +=== tests/cases/compiler/collisionRestParameterInterfaceMembers.ts === +// call +interface i1 { +>i1 : Symbol(i1, Decl(collisionRestParameterInterfaceMembers.ts, 0, 0)) + + (_i: number, ...restParameters); // no error - no code gen +>_i : Symbol(_i, Decl(collisionRestParameterInterfaceMembers.ts, 2, 5)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterInterfaceMembers.ts, 2, 16)) +} +interface i1NoError { +>i1NoError : Symbol(i1NoError, Decl(collisionRestParameterInterfaceMembers.ts, 3, 1)) + + (_i: number); // no error +>_i : Symbol(_i, Decl(collisionRestParameterInterfaceMembers.ts, 5, 5)) +} + +// new +interface i2 { +>i2 : Symbol(i2, Decl(collisionRestParameterInterfaceMembers.ts, 6, 1)) + + new (_i: number, ...restParameters); // no error - no code gen +>_i : Symbol(_i, Decl(collisionRestParameterInterfaceMembers.ts, 10, 9)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterInterfaceMembers.ts, 10, 20)) +} +interface i2NoError { +>i2NoError : Symbol(i2NoError, Decl(collisionRestParameterInterfaceMembers.ts, 11, 1)) + + new (_i: number); // no error +>_i : Symbol(_i, Decl(collisionRestParameterInterfaceMembers.ts, 13, 9)) +} + +// method +interface i3 { +>i3 : Symbol(i3, Decl(collisionRestParameterInterfaceMembers.ts, 14, 1)) + + foo (_i: number, ...restParameters); // no error - no code gen +>foo : Symbol(foo, Decl(collisionRestParameterInterfaceMembers.ts, 17, 14)) +>_i : Symbol(_i, Decl(collisionRestParameterInterfaceMembers.ts, 18, 9)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterInterfaceMembers.ts, 18, 20)) + + fooNoError (_i: number); // no error +>fooNoError : Symbol(fooNoError, Decl(collisionRestParameterInterfaceMembers.ts, 18, 40)) +>_i : Symbol(_i, Decl(collisionRestParameterInterfaceMembers.ts, 19, 16)) +} diff --git a/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.symbols b/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.symbols new file mode 100644 index 00000000000..ef033d796e4 --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/collisionRestParameterUnderscoreIUsage.ts === +declare var console: { log(msg?: string): void; }; +>console : Symbol(console, Decl(collisionRestParameterUnderscoreIUsage.ts, 0, 11)) +>log : Symbol(log, Decl(collisionRestParameterUnderscoreIUsage.ts, 0, 22)) +>msg : Symbol(msg, Decl(collisionRestParameterUnderscoreIUsage.ts, 0, 27)) + +var _i = "This is what I'd expect to see"; +>_i : Symbol(_i, Decl(collisionRestParameterUnderscoreIUsage.ts, 1, 3)) + +class Foo { +>Foo : Symbol(Foo, Decl(collisionRestParameterUnderscoreIUsage.ts, 1, 42)) + + constructor(...args: any[]) { +>args : Symbol(args, Decl(collisionRestParameterUnderscoreIUsage.ts, 3, 16)) + + console.log(_i); // This should result in error +>console.log : Symbol(log, Decl(collisionRestParameterUnderscoreIUsage.ts, 0, 22)) +>console : Symbol(console, Decl(collisionRestParameterUnderscoreIUsage.ts, 0, 11)) +>log : Symbol(log, Decl(collisionRestParameterUnderscoreIUsage.ts, 0, 22)) +>_i : Symbol(_i, Decl(collisionRestParameterUnderscoreIUsage.ts, 1, 3)) + } +} +new Foo(); +>Foo : Symbol(Foo, Decl(collisionRestParameterUnderscoreIUsage.ts, 1, 42)) + diff --git a/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.types b/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.types index c700f50aca4..fadc27dfa6c 100644 --- a/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.types +++ b/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.types @@ -6,6 +6,7 @@ declare var console: { log(msg?: string): void; }; var _i = "This is what I'd expect to see"; >_i : string +>"This is what I'd expect to see" : string class Foo { >Foo : Foo diff --git a/tests/baselines/reference/commaOperator1.symbols b/tests/baselines/reference/commaOperator1.symbols new file mode 100644 index 00000000000..ec4a1f6ceab --- /dev/null +++ b/tests/baselines/reference/commaOperator1.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/commaOperator1.ts === +var v1 = ((1, 2, 3), 4, 5, (6, 7)); +>v1 : Symbol(v1, Decl(commaOperator1.ts, 0, 3)) + +function f1() { +>f1 : Symbol(f1, Decl(commaOperator1.ts, 0, 35)) + + var a = 1; +>a : Symbol(a, Decl(commaOperator1.ts, 2, 7)) + + return a, v1, a; +>a : Symbol(a, Decl(commaOperator1.ts, 2, 7)) +>v1 : Symbol(v1, Decl(commaOperator1.ts, 0, 3)) +>a : Symbol(a, Decl(commaOperator1.ts, 2, 7)) +} + diff --git a/tests/baselines/reference/commaOperator1.types b/tests/baselines/reference/commaOperator1.types index 52a36e33024..8116fec8328 100644 --- a/tests/baselines/reference/commaOperator1.types +++ b/tests/baselines/reference/commaOperator1.types @@ -8,14 +8,22 @@ var v1 = ((1, 2, 3), 4, 5, (6, 7)); >(1, 2, 3) : number >1, 2, 3 : number >1, 2 : number +>1 : number +>2 : number +>3 : number +>4 : number +>5 : number >(6, 7) : number >6, 7 : number +>6 : number +>7 : number function f1() { >f1 : () => number var a = 1; >a : number +>1 : number return a, v1, a; >a, v1, a : number diff --git a/tests/baselines/reference/commaOperatorOtherValidOperation.symbols b/tests/baselines/reference/commaOperatorOtherValidOperation.symbols new file mode 100644 index 00000000000..da65d20fc30 --- /dev/null +++ b/tests/baselines/reference/commaOperatorOtherValidOperation.symbols @@ -0,0 +1,50 @@ +=== tests/cases/conformance/expressions/commaOperator/commaOperatorOtherValidOperation.ts === +//Comma operator in for loop +for (var i = 0, j = 10; i < j; i++, j--) +>i : Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 1, 8)) +>j : Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 1, 15)) +>i : Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 1, 8)) +>j : Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 1, 15)) +>i : Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 1, 8)) +>j : Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 1, 15)) +{ +} + +//Comma operator in fuction arguments and return +function foo(x: number, y: string) +>foo : Symbol(foo, Decl(commaOperatorOtherValidOperation.ts, 3, 1)) +>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 6, 13)) +>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 6, 23)) +{ + return x, y; +>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 6, 13)) +>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 6, 23)) +} +var resultIsString = foo(1, "123"); +>resultIsString : Symbol(resultIsString, Decl(commaOperatorOtherValidOperation.ts, 10, 3)) +>foo : Symbol(foo, Decl(commaOperatorOtherValidOperation.ts, 3, 1)) + +//TypeParameters +function foo1() +>foo1 : Symbol(foo1, Decl(commaOperatorOtherValidOperation.ts, 10, 35)) +>T1 : Symbol(T1, Decl(commaOperatorOtherValidOperation.ts, 13, 14)) +>T2 : Symbol(T2, Decl(commaOperatorOtherValidOperation.ts, 13, 17)) +{ + var x: T1; +>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 15, 7)) +>T1 : Symbol(T1, Decl(commaOperatorOtherValidOperation.ts, 13, 14)) + + var y: T2; +>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 16, 7)) +>T2 : Symbol(T2, Decl(commaOperatorOtherValidOperation.ts, 13, 17)) + + x, y; +>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 15, 7)) +>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 16, 7)) + + var resultIsT1 = (y, x); +>resultIsT1 : Symbol(resultIsT1, Decl(commaOperatorOtherValidOperation.ts, 18, 7)) +>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 16, 7)) +>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 15, 7)) +} + diff --git a/tests/baselines/reference/commaOperatorOtherValidOperation.types b/tests/baselines/reference/commaOperatorOtherValidOperation.types index e42991e7b5a..bc7bdd81157 100644 --- a/tests/baselines/reference/commaOperatorOtherValidOperation.types +++ b/tests/baselines/reference/commaOperatorOtherValidOperation.types @@ -2,7 +2,9 @@ //Comma operator in for loop for (var i = 0, j = 10; i < j; i++, j--) >i : number +>0 : number >j : number +>10 : number >i < j : boolean >i : number >j : number @@ -29,6 +31,8 @@ var resultIsString = foo(1, "123"); >resultIsString : string >foo(1, "123") : string >foo : (x: number, y: string) => string +>1 : number +>"123" : string //TypeParameters function foo1() diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.symbols b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.symbols new file mode 100644 index 00000000000..4b7f24a9048 --- /dev/null +++ b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.symbols @@ -0,0 +1,114 @@ +=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandAnyType.ts === +var ANY: any; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +var BOOLEAN: boolean; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) + +var NUMBER: number; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3)) + +var STRING: string; +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3)) + +var OBJECT: Object; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandAnyType.ts, 4, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +//The second operand type is any +ANY, ANY; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +BOOLEAN, ANY; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +NUMBER, ANY; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +STRING, ANY; +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +OBJECT, ANY; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandAnyType.ts, 4, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +//Return type is any +var resultIsAny1 = (ANY, ANY); +>resultIsAny1 : Symbol(resultIsAny1, Decl(commaOperatorWithSecondOperandAnyType.ts, 14, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +var resultIsAny2 = (BOOLEAN, ANY); +>resultIsAny2 : Symbol(resultIsAny2, Decl(commaOperatorWithSecondOperandAnyType.ts, 15, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +var resultIsAny3 = (NUMBER, ANY); +>resultIsAny3 : Symbol(resultIsAny3, Decl(commaOperatorWithSecondOperandAnyType.ts, 16, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +var resultIsAny4 = (STRING, ANY); +>resultIsAny4 : Symbol(resultIsAny4, Decl(commaOperatorWithSecondOperandAnyType.ts, 17, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +var resultIsAny5 = (OBJECT, ANY); +>resultIsAny5 : Symbol(resultIsAny5, Decl(commaOperatorWithSecondOperandAnyType.ts, 18, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandAnyType.ts, 4, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +//Literal and expression +var x: any; +>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3)) + +1, ANY; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +++NUMBER, ANY; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +"string", [null, 1]; +"string".charAt(0), [null, 1]; +>"string".charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) + +true, x("any"); +>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3)) + +!BOOLEAN, x.doSomeThing(); +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) +>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3)) + +var resultIsAny6 = (1, ANY); +>resultIsAny6 : Symbol(resultIsAny6, Decl(commaOperatorWithSecondOperandAnyType.ts, 30, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +var resultIsAny7 = (++NUMBER, ANY); +>resultIsAny7 : Symbol(resultIsAny7, Decl(commaOperatorWithSecondOperandAnyType.ts, 31, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +var resultIsAny8 = ("string", null); +>resultIsAny8 : Symbol(resultIsAny8, Decl(commaOperatorWithSecondOperandAnyType.ts, 32, 3)) + +var resultIsAny9 = ("string".charAt(0), undefined); +>resultIsAny9 : Symbol(resultIsAny9, Decl(commaOperatorWithSecondOperandAnyType.ts, 33, 3)) +>"string".charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>undefined : Symbol(undefined) + +var resultIsAny10 = (true, x("any")); +>resultIsAny10 : Symbol(resultIsAny10, Decl(commaOperatorWithSecondOperandAnyType.ts, 34, 3)) +>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3)) + +var resultIsAny11 = (!BOOLEAN, x.doSomeThing()); +>resultIsAny11 : Symbol(resultIsAny11, Decl(commaOperatorWithSecondOperandAnyType.ts, 35, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) +>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3)) + diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.types b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.types index a63e20cf673..a8217c2d248 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.types @@ -83,6 +83,7 @@ var x: any; 1, ANY; >1, ANY : any +>1 : number >ANY : any ++NUMBER, ANY; @@ -93,19 +94,28 @@ var x: any; "string", [null, 1]; >"string", [null, 1] : number[] +>"string" : string >[null, 1] : number[] +>null : null +>1 : number "string".charAt(0), [null, 1]; >"string".charAt(0), [null, 1] : number[] >"string".charAt(0) : string >"string".charAt : (pos: number) => string +>"string" : string >charAt : (pos: number) => string +>0 : number >[null, 1] : number[] +>null : null +>1 : number true, x("any"); >true, x("any") : any +>true : boolean >x("any") : any >x : any +>"any" : string !BOOLEAN, x.doSomeThing(); >!BOOLEAN, x.doSomeThing() : any @@ -120,6 +130,7 @@ var resultIsAny6 = (1, ANY); >resultIsAny6 : any >(1, ANY) : any >1, ANY : any +>1 : number >ANY : any var resultIsAny7 = (++NUMBER, ANY); @@ -134,6 +145,8 @@ var resultIsAny8 = ("string", null); >resultIsAny8 : any >("string", null) : null >"string", null : null +>"string" : string +>null : null var resultIsAny9 = ("string".charAt(0), undefined); >resultIsAny9 : any @@ -141,15 +154,19 @@ var resultIsAny9 = ("string".charAt(0), undefined); >"string".charAt(0), undefined : undefined >"string".charAt(0) : string >"string".charAt : (pos: number) => string +>"string" : string >charAt : (pos: number) => string +>0 : number >undefined : undefined var resultIsAny10 = (true, x("any")); >resultIsAny10 : any >(true, x("any")) : any >true, x("any") : any +>true : boolean >x("any") : any >x : any +>"any" : string var resultIsAny11 = (!BOOLEAN, x.doSomeThing()); >resultIsAny11 : any diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.symbols b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.symbols new file mode 100644 index 00000000000..bd520c1876d --- /dev/null +++ b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.symbols @@ -0,0 +1,110 @@ +=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandBooleanType.ts === +var ANY: any; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 0, 3)) + +var BOOLEAN: boolean; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +var NUMBER: number; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) + +var STRING: string; +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3)) + +var OBJECT: Object; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +//The second operand type is boolean +ANY, BOOLEAN; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 0, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +BOOLEAN, BOOLEAN; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +NUMBER, BOOLEAN; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +STRING, BOOLEAN; +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +OBJECT, BOOLEAN; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +//Return type is boolean +var resultIsBoolean1 = (ANY, BOOLEAN); +>resultIsBoolean1 : Symbol(resultIsBoolean1, Decl(commaOperatorWithSecondOperandBooleanType.ts, 14, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 0, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +var resultIsBoolean2 = (BOOLEAN, BOOLEAN); +>resultIsBoolean2 : Symbol(resultIsBoolean2, Decl(commaOperatorWithSecondOperandBooleanType.ts, 15, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +var resultIsBoolean3 = (NUMBER, BOOLEAN); +>resultIsBoolean3 : Symbol(resultIsBoolean3, Decl(commaOperatorWithSecondOperandBooleanType.ts, 16, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +var resultIsBoolean4 = (STRING, BOOLEAN); +>resultIsBoolean4 : Symbol(resultIsBoolean4, Decl(commaOperatorWithSecondOperandBooleanType.ts, 17, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +var resultIsBoolean5 = (OBJECT, BOOLEAN); +>resultIsBoolean5 : Symbol(resultIsBoolean5, Decl(commaOperatorWithSecondOperandBooleanType.ts, 18, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +//Literal and expression +null, BOOLEAN; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +ANY = undefined, BOOLEAN; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 0, 3)) +>undefined : Symbol(undefined) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +1, true; +++NUMBER, true; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) + +[1, 2, 3], !BOOLEAN; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +OBJECT = [1, 2, 3], BOOLEAN = false; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +var resultIsBoolean6 = (null, BOOLEAN); +>resultIsBoolean6 : Symbol(resultIsBoolean6, Decl(commaOperatorWithSecondOperandBooleanType.ts, 28, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +var resultIsBoolean7 = (ANY = undefined, BOOLEAN); +>resultIsBoolean7 : Symbol(resultIsBoolean7, Decl(commaOperatorWithSecondOperandBooleanType.ts, 29, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 0, 3)) +>undefined : Symbol(undefined) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +var resultIsBoolean8 = (1, true); +>resultIsBoolean8 : Symbol(resultIsBoolean8, Decl(commaOperatorWithSecondOperandBooleanType.ts, 30, 3)) + +var resultIsBoolean9 = (++NUMBER, true); +>resultIsBoolean9 : Symbol(resultIsBoolean9, Decl(commaOperatorWithSecondOperandBooleanType.ts, 31, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) + +var resultIsBoolean10 = ([1, 2, 3], !BOOLEAN); +>resultIsBoolean10 : Symbol(resultIsBoolean10, Decl(commaOperatorWithSecondOperandBooleanType.ts, 32, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +var resultIsBoolean11 = (OBJECT = [1, 2, 3], BOOLEAN = false); +>resultIsBoolean11 : Symbol(resultIsBoolean11, Decl(commaOperatorWithSecondOperandBooleanType.ts, 33, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types index 49a3fdc4cc5..dba5285d880 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types @@ -80,6 +80,7 @@ var resultIsBoolean5 = (OBJECT, BOOLEAN); //Literal and expression null, BOOLEAN; >null, BOOLEAN : boolean +>null : null >BOOLEAN : boolean ANY = undefined, BOOLEAN; @@ -91,15 +92,21 @@ ANY = undefined, BOOLEAN; 1, true; >1, true : boolean +>1 : number +>true : boolean ++NUMBER, true; >++NUMBER, true : boolean >++NUMBER : number >NUMBER : number +>true : boolean [1, 2, 3], !BOOLEAN; >[1, 2, 3], !BOOLEAN : boolean >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number >!BOOLEAN : boolean >BOOLEAN : boolean @@ -108,13 +115,18 @@ OBJECT = [1, 2, 3], BOOLEAN = false; >OBJECT = [1, 2, 3] : number[] >OBJECT : Object >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number >BOOLEAN = false : boolean >BOOLEAN : boolean +>false : boolean var resultIsBoolean6 = (null, BOOLEAN); >resultIsBoolean6 : boolean >(null, BOOLEAN) : boolean >null, BOOLEAN : boolean +>null : null >BOOLEAN : boolean var resultIsBoolean7 = (ANY = undefined, BOOLEAN); @@ -130,6 +142,8 @@ var resultIsBoolean8 = (1, true); >resultIsBoolean8 : boolean >(1, true) : boolean >1, true : boolean +>1 : number +>true : boolean var resultIsBoolean9 = (++NUMBER, true); >resultIsBoolean9 : boolean @@ -137,12 +151,16 @@ var resultIsBoolean9 = (++NUMBER, true); >++NUMBER, true : boolean >++NUMBER : number >NUMBER : number +>true : boolean var resultIsBoolean10 = ([1, 2, 3], !BOOLEAN); >resultIsBoolean10 : boolean >([1, 2, 3], !BOOLEAN) : boolean >[1, 2, 3], !BOOLEAN : boolean >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number >!BOOLEAN : boolean >BOOLEAN : boolean @@ -153,6 +171,10 @@ var resultIsBoolean11 = (OBJECT = [1, 2, 3], BOOLEAN = false); >OBJECT = [1, 2, 3] : number[] >OBJECT : Object >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number >BOOLEAN = false : boolean >BOOLEAN : boolean +>false : boolean diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.symbols b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.symbols new file mode 100644 index 00000000000..3da456eaa5f --- /dev/null +++ b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.symbols @@ -0,0 +1,114 @@ +=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandNumberType.ts === +var ANY: any; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 0, 3)) + +var BOOLEAN: boolean; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3)) + +var NUMBER: number; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +var STRING: string; +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) + +var OBJECT: Object; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +//The second operand type is number +ANY, NUMBER; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 0, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +BOOLEAN, NUMBER; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +NUMBER, NUMBER; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +STRING, NUMBER; +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +OBJECT, NUMBER; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +//Return type is number +var resultIsNumber1 = (ANY, NUMBER); +>resultIsNumber1 : Symbol(resultIsNumber1, Decl(commaOperatorWithSecondOperandNumberType.ts, 14, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 0, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +var resultIsNumber2 = (BOOLEAN, NUMBER); +>resultIsNumber2 : Symbol(resultIsNumber2, Decl(commaOperatorWithSecondOperandNumberType.ts, 15, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +var resultIsNumber3 = (NUMBER, NUMBER); +>resultIsNumber3 : Symbol(resultIsNumber3, Decl(commaOperatorWithSecondOperandNumberType.ts, 16, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +var resultIsNumber4 = (STRING, NUMBER); +>resultIsNumber4 : Symbol(resultIsNumber4, Decl(commaOperatorWithSecondOperandNumberType.ts, 17, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +var resultIsNumber5 = (OBJECT, NUMBER); +>resultIsNumber5 : Symbol(resultIsNumber5, Decl(commaOperatorWithSecondOperandNumberType.ts, 18, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +//Literal and expression +null, NUMBER; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +ANY = undefined, NUMBER; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 0, 3)) +>undefined : Symbol(undefined) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +true, 1; +BOOLEAN = false, 1; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3)) + +"", NUMBER = 1; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +STRING.trim(), NUMBER = 1; +>STRING.trim : Symbol(String.trim, Decl(lib.d.ts, 411, 32)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) +>trim : Symbol(String.trim, Decl(lib.d.ts, 411, 32)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +var resultIsNumber6 = (null, NUMBER); +>resultIsNumber6 : Symbol(resultIsNumber6, Decl(commaOperatorWithSecondOperandNumberType.ts, 28, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +var resultIsNumber7 = (ANY = undefined, NUMBER); +>resultIsNumber7 : Symbol(resultIsNumber7, Decl(commaOperatorWithSecondOperandNumberType.ts, 29, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 0, 3)) +>undefined : Symbol(undefined) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +var resultIsNumber8 = (true, 1); +>resultIsNumber8 : Symbol(resultIsNumber8, Decl(commaOperatorWithSecondOperandNumberType.ts, 30, 3)) + +var resultIsNumber9 = (BOOLEAN = false, 1); +>resultIsNumber9 : Symbol(resultIsNumber9, Decl(commaOperatorWithSecondOperandNumberType.ts, 31, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3)) + +var resultIsNumber10 = ("", NUMBER = 1); +>resultIsNumber10 : Symbol(resultIsNumber10, Decl(commaOperatorWithSecondOperandNumberType.ts, 32, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +var resultIsNumber11 = (STRING.trim(), NUMBER = 1); +>resultIsNumber11 : Symbol(resultIsNumber11, Decl(commaOperatorWithSecondOperandNumberType.ts, 33, 3)) +>STRING.trim : Symbol(String.trim, Decl(lib.d.ts, 411, 32)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) +>trim : Symbol(String.trim, Decl(lib.d.ts, 411, 32)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types index a144466d4c8..13aae51e0cb 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types @@ -80,6 +80,7 @@ var resultIsNumber5 = (OBJECT, NUMBER); //Literal and expression null, NUMBER; >null, NUMBER : number +>null : null >NUMBER : number ANY = undefined, NUMBER; @@ -91,16 +92,22 @@ ANY = undefined, NUMBER; true, 1; >true, 1 : number +>true : boolean +>1 : number BOOLEAN = false, 1; >BOOLEAN = false, 1 : number >BOOLEAN = false : boolean >BOOLEAN : boolean +>false : boolean +>1 : number "", NUMBER = 1; >"", NUMBER = 1 : number +>"" : string >NUMBER = 1 : number >NUMBER : number +>1 : number STRING.trim(), NUMBER = 1; >STRING.trim(), NUMBER = 1 : number @@ -110,11 +117,13 @@ STRING.trim(), NUMBER = 1; >trim : () => string >NUMBER = 1 : number >NUMBER : number +>1 : number var resultIsNumber6 = (null, NUMBER); >resultIsNumber6 : number >(null, NUMBER) : number >null, NUMBER : number +>null : null >NUMBER : number var resultIsNumber7 = (ANY = undefined, NUMBER); @@ -130,6 +139,8 @@ var resultIsNumber8 = (true, 1); >resultIsNumber8 : number >(true, 1) : number >true, 1 : number +>true : boolean +>1 : number var resultIsNumber9 = (BOOLEAN = false, 1); >resultIsNumber9 : number @@ -137,13 +148,17 @@ var resultIsNumber9 = (BOOLEAN = false, 1); >BOOLEAN = false, 1 : number >BOOLEAN = false : boolean >BOOLEAN : boolean +>false : boolean +>1 : number var resultIsNumber10 = ("", NUMBER = 1); >resultIsNumber10 : number >("", NUMBER = 1) : number >"", NUMBER = 1 : number +>"" : string >NUMBER = 1 : number >NUMBER : number +>1 : number var resultIsNumber11 = (STRING.trim(), NUMBER = 1); >resultIsNumber11 : number @@ -155,4 +170,5 @@ var resultIsNumber11 = (STRING.trim(), NUMBER = 1); >trim : () => string >NUMBER = 1 : number >NUMBER : number +>1 : number diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.symbols b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.symbols new file mode 100644 index 00000000000..42f24f77d50 --- /dev/null +++ b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.symbols @@ -0,0 +1,121 @@ +=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandObjectType.ts === +var ANY: any; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 0, 3)) + +var BOOLEAN: boolean; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3)) + +var NUMBER: number; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3)) + +var STRING: string; +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3)) + +var OBJECT: Object; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +class CLASS { +>CLASS : Symbol(CLASS, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 19)) + + num: number; +>num : Symbol(num, Decl(commaOperatorWithSecondOperandObjectType.ts, 6, 13)) +} + +//The second operand type is Object +ANY, OBJECT; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 0, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +BOOLEAN, OBJECT; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +NUMBER, OBJECT; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +STRING, OBJECT; +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +OBJECT, OBJECT; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +//Return type is Object +var resultIsObject1 = (ANY, OBJECT); +>resultIsObject1 : Symbol(resultIsObject1, Decl(commaOperatorWithSecondOperandObjectType.ts, 18, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 0, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +var resultIsObject2 = (BOOLEAN, OBJECT); +>resultIsObject2 : Symbol(resultIsObject2, Decl(commaOperatorWithSecondOperandObjectType.ts, 19, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +var resultIsObject3 = (NUMBER, OBJECT); +>resultIsObject3 : Symbol(resultIsObject3, Decl(commaOperatorWithSecondOperandObjectType.ts, 20, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +var resultIsObject4 = (STRING, OBJECT); +>resultIsObject4 : Symbol(resultIsObject4, Decl(commaOperatorWithSecondOperandObjectType.ts, 21, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +var resultIsObject5 = (OBJECT, OBJECT); +>resultIsObject5 : Symbol(resultIsObject5, Decl(commaOperatorWithSecondOperandObjectType.ts, 22, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +//Literal and expression +null, OBJECT +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +ANY = null, OBJECT +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 0, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +true, {} +!BOOLEAN, [] +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3)) + +"string", new Date() +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +STRING.toLowerCase(), new CLASS() +>STRING.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, 399, 51)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, 399, 51)) +>CLASS : Symbol(CLASS, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 19)) + +var resultIsObject6 = (null, OBJECT); +>resultIsObject6 : Symbol(resultIsObject6, Decl(commaOperatorWithSecondOperandObjectType.ts, 32, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +var resultIsObject7 = (ANY = null, OBJECT); +>resultIsObject7 : Symbol(resultIsObject7, Decl(commaOperatorWithSecondOperandObjectType.ts, 33, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 0, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +var resultIsObject8 = (true, {}); +>resultIsObject8 : Symbol(resultIsObject8, Decl(commaOperatorWithSecondOperandObjectType.ts, 34, 3)) + +var resultIsObject9 = (!BOOLEAN, { a: 1, b: "s" }); +>resultIsObject9 : Symbol(resultIsObject9, Decl(commaOperatorWithSecondOperandObjectType.ts, 35, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3)) +>a : Symbol(a, Decl(commaOperatorWithSecondOperandObjectType.ts, 35, 34)) +>b : Symbol(b, Decl(commaOperatorWithSecondOperandObjectType.ts, 35, 40)) + +var resultIsObject10 = ("string", new Date()); +>resultIsObject10 : Symbol(resultIsObject10, Decl(commaOperatorWithSecondOperandObjectType.ts, 36, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var resultIsObject11 = (STRING.toLowerCase(), new CLASS()); +>resultIsObject11 : Symbol(resultIsObject11, Decl(commaOperatorWithSecondOperandObjectType.ts, 37, 3)) +>STRING.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, 399, 51)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, 399, 51)) +>CLASS : Symbol(CLASS, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 19)) + diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.types b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.types index ba2663dd271..9c948da9699 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.types @@ -87,16 +87,19 @@ var resultIsObject5 = (OBJECT, OBJECT); //Literal and expression null, OBJECT >null, OBJECT : Object +>null : null >OBJECT : Object ANY = null, OBJECT >ANY = null, OBJECT : Object >ANY = null : null >ANY : any +>null : null >OBJECT : Object true, {} >true, {} : {} +>true : boolean >{} : {} !BOOLEAN, [] @@ -107,6 +110,7 @@ true, {} "string", new Date() >"string", new Date() : Date +>"string" : string >new Date() : Date >Date : DateConstructor @@ -123,6 +127,7 @@ var resultIsObject6 = (null, OBJECT); >resultIsObject6 : Object >(null, OBJECT) : Object >null, OBJECT : Object +>null : null >OBJECT : Object var resultIsObject7 = (ANY = null, OBJECT); @@ -131,12 +136,14 @@ var resultIsObject7 = (ANY = null, OBJECT); >ANY = null, OBJECT : Object >ANY = null : null >ANY : any +>null : null >OBJECT : Object var resultIsObject8 = (true, {}); >resultIsObject8 : {} >(true, {}) : {} >true, {} : {} +>true : boolean >{} : {} var resultIsObject9 = (!BOOLEAN, { a: 1, b: "s" }); @@ -147,12 +154,15 @@ var resultIsObject9 = (!BOOLEAN, { a: 1, b: "s" }); >BOOLEAN : boolean >{ a: 1, b: "s" } : { a: number; b: string; } >a : number +>1 : number >b : string +>"s" : string var resultIsObject10 = ("string", new Date()); >resultIsObject10 : Date >("string", new Date()) : Date >"string", new Date() : Date +>"string" : string >new Date() : Date >Date : DateConstructor diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.symbols b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.symbols new file mode 100644 index 00000000000..d0c800858f7 --- /dev/null +++ b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.symbols @@ -0,0 +1,120 @@ +=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandStringType.ts === +var ANY: any; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 0, 3)) + +var BOOLEAN: boolean; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3)) + +var NUMBER: number; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3)) + +var STRING: string; +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +var OBJECT: Object; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var resultIsString: string; +>resultIsString : Symbol(resultIsString, Decl(commaOperatorWithSecondOperandStringType.ts, 6, 3)) + +//The second operand is string +ANY, STRING; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 0, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +BOOLEAN, STRING; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +NUMBER, STRING; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +STRING, STRING; +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +OBJECT, STRING; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +//Return type is string +var resultIsString1 = (ANY, STRING); +>resultIsString1 : Symbol(resultIsString1, Decl(commaOperatorWithSecondOperandStringType.ts, 16, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 0, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +var resultIsString2 = (BOOLEAN, STRING); +>resultIsString2 : Symbol(resultIsString2, Decl(commaOperatorWithSecondOperandStringType.ts, 17, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +var resultIsString3 = (NUMBER, STRING); +>resultIsString3 : Symbol(resultIsString3, Decl(commaOperatorWithSecondOperandStringType.ts, 18, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +var resultIsString4 = (STRING, STRING); +>resultIsString4 : Symbol(resultIsString4, Decl(commaOperatorWithSecondOperandStringType.ts, 19, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +var resultIsString5 = (OBJECT, STRING); +>resultIsString5 : Symbol(resultIsString5, Decl(commaOperatorWithSecondOperandStringType.ts, 20, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +//Literal and expression +null, STRING; +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +ANY = new Date(), STRING; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 0, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +true, ""; +BOOLEAN == undefined, ""; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3)) +>undefined : Symbol(undefined) + +["a", "b"], NUMBER.toString(); +>NUMBER.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) + +OBJECT = new Object, STRING + "string"; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +var resultIsString6 = (null, STRING); +>resultIsString6 : Symbol(resultIsString6, Decl(commaOperatorWithSecondOperandStringType.ts, 30, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +var resultIsString7 = (ANY = new Date(), STRING); +>resultIsString7 : Symbol(resultIsString7, Decl(commaOperatorWithSecondOperandStringType.ts, 31, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 0, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +var resultIsString8 = (true, ""); +>resultIsString8 : Symbol(resultIsString8, Decl(commaOperatorWithSecondOperandStringType.ts, 32, 3)) + +var resultIsString9 = (BOOLEAN == undefined, ""); +>resultIsString9 : Symbol(resultIsString9, Decl(commaOperatorWithSecondOperandStringType.ts, 33, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3)) +>undefined : Symbol(undefined) + +var resultIsString10 = (["a", "b"], NUMBER.toString()); +>resultIsString10 : Symbol(resultIsString10, Decl(commaOperatorWithSecondOperandStringType.ts, 34, 3)) +>NUMBER.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) + +var resultIsString11 = (new Object, STRING + "string"); +>resultIsString11 : Symbol(resultIsString11, Decl(commaOperatorWithSecondOperandStringType.ts, 35, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.types b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.types index d5b2f50ca33..a28202876d2 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.types @@ -83,6 +83,7 @@ var resultIsString5 = (OBJECT, STRING); //Literal and expression null, STRING; >null, STRING : string +>null : null >STRING : string ANY = new Date(), STRING; @@ -95,16 +96,21 @@ ANY = new Date(), STRING; true, ""; >true, "" : string +>true : boolean +>"" : string BOOLEAN == undefined, ""; >BOOLEAN == undefined, "" : string >BOOLEAN == undefined : boolean >BOOLEAN : boolean >undefined : undefined +>"" : string ["a", "b"], NUMBER.toString(); >["a", "b"], NUMBER.toString() : string >["a", "b"] : string[] +>"a" : string +>"b" : string >NUMBER.toString() : string >NUMBER.toString : (radix?: number) => string >NUMBER : number @@ -118,11 +124,13 @@ OBJECT = new Object, STRING + "string"; >Object : ObjectConstructor >STRING + "string" : string >STRING : string +>"string" : string var resultIsString6 = (null, STRING); >resultIsString6 : string >(null, STRING) : string >null, STRING : string +>null : null >STRING : string var resultIsString7 = (ANY = new Date(), STRING); @@ -139,6 +147,8 @@ var resultIsString8 = (true, ""); >resultIsString8 : string >(true, "") : string >true, "" : string +>true : boolean +>"" : string var resultIsString9 = (BOOLEAN == undefined, ""); >resultIsString9 : string @@ -147,12 +157,15 @@ var resultIsString9 = (BOOLEAN == undefined, ""); >BOOLEAN == undefined : boolean >BOOLEAN : boolean >undefined : undefined +>"" : string var resultIsString10 = (["a", "b"], NUMBER.toString()); >resultIsString10 : string >(["a", "b"], NUMBER.toString()) : string >["a", "b"], NUMBER.toString() : string >["a", "b"] : string[] +>"a" : string +>"b" : string >NUMBER.toString() : string >NUMBER.toString : (radix?: number) => string >NUMBER : number @@ -166,4 +179,5 @@ var resultIsString11 = (new Object, STRING + "string"); >Object : ObjectConstructor >STRING + "string" : string >STRING : string +>"string" : string diff --git a/tests/baselines/reference/commaOperatorsMultipleOperators.symbols b/tests/baselines/reference/commaOperatorsMultipleOperators.symbols new file mode 100644 index 00000000000..bd39a21519f --- /dev/null +++ b/tests/baselines/reference/commaOperatorsMultipleOperators.symbols @@ -0,0 +1,94 @@ +=== tests/cases/conformance/expressions/commaOperator/commaOperatorsMultipleOperators.ts === +var ANY: any; +>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3)) + +var BOOLEAN: boolean; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) + +var NUMBER: number; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) + +var STRING: string; +>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) + +var OBJECT: Object; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +//Expected: work well +ANY, BOOLEAN, NUMBER; +>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) + +BOOLEAN, NUMBER, STRING; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) + +NUMBER, STRING, OBJECT; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) + +STRING, OBJECT, ANY; +>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3)) + +OBJECT, ANY, BOOLEAN; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) + +//Results should have the same type as the third operand +var resultIsAny1 = (STRING, OBJECT, ANY); +>resultIsAny1 : Symbol(resultIsAny1, Decl(commaOperatorsMultipleOperators.ts, 14, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3)) + +var resultIsBoolean1 = (OBJECT, ANY, BOOLEAN); +>resultIsBoolean1 : Symbol(resultIsBoolean1, Decl(commaOperatorsMultipleOperators.ts, 15, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) + +var resultIsNumber1 = (ANY, BOOLEAN, NUMBER); +>resultIsNumber1 : Symbol(resultIsNumber1, Decl(commaOperatorsMultipleOperators.ts, 16, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) + +var resultIsString1 = (BOOLEAN, NUMBER, STRING); +>resultIsString1 : Symbol(resultIsString1, Decl(commaOperatorsMultipleOperators.ts, 17, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) + +var resultIsObject1 = (NUMBER, STRING, OBJECT); +>resultIsObject1 : Symbol(resultIsObject1, Decl(commaOperatorsMultipleOperators.ts, 18, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) + +//Literal and expression +null, true, 1; +++NUMBER, STRING.charAt(0), new Object(); +>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) +>STRING.charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) +>charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var resultIsNumber2 = (null, true, 1); +>resultIsNumber2 : Symbol(resultIsNumber2, Decl(commaOperatorsMultipleOperators.ts, 24, 3)) + +var resultIsObject2 = (++NUMBER, STRING.charAt(0), new Object()); +>resultIsObject2 : Symbol(resultIsObject2, Decl(commaOperatorsMultipleOperators.ts, 25, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) +>STRING.charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) +>charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + diff --git a/tests/baselines/reference/commaOperatorsMultipleOperators.types b/tests/baselines/reference/commaOperatorsMultipleOperators.types index 12b90e8ec77..9a2c7c7e5c5 100644 --- a/tests/baselines/reference/commaOperatorsMultipleOperators.types +++ b/tests/baselines/reference/commaOperatorsMultipleOperators.types @@ -101,6 +101,9 @@ var resultIsObject1 = (NUMBER, STRING, OBJECT); null, true, 1; >null, true, 1 : number >null, true : boolean +>null : null +>true : boolean +>1 : number ++NUMBER, STRING.charAt(0), new Object(); >++NUMBER, STRING.charAt(0), new Object() : Object @@ -111,6 +114,7 @@ null, true, 1; >STRING.charAt : (pos: number) => string >STRING : string >charAt : (pos: number) => string +>0 : number >new Object() : Object >Object : ObjectConstructor @@ -119,6 +123,9 @@ var resultIsNumber2 = (null, true, 1); >(null, true, 1) : number >null, true, 1 : number >null, true : boolean +>null : null +>true : boolean +>1 : number var resultIsObject2 = (++NUMBER, STRING.charAt(0), new Object()); >resultIsObject2 : Object @@ -131,6 +138,7 @@ var resultIsObject2 = (++NUMBER, STRING.charAt(0), new Object()); >STRING.charAt : (pos: number) => string >STRING : string >charAt : (pos: number) => string +>0 : number >new Object() : Object >Object : ObjectConstructor diff --git a/tests/baselines/reference/commentBeforeStaticMethod1.symbols b/tests/baselines/reference/commentBeforeStaticMethod1.symbols new file mode 100644 index 00000000000..ef5bee04be6 --- /dev/null +++ b/tests/baselines/reference/commentBeforeStaticMethod1.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/commentBeforeStaticMethod1.ts === +class C { +>C : Symbol(C, Decl(commentBeforeStaticMethod1.ts, 0, 0)) + + /** + * Returns bar + */ + public static foo(): string { +>foo : Symbol(C.foo, Decl(commentBeforeStaticMethod1.ts, 0, 9)) + + return "bar"; + } +} diff --git a/tests/baselines/reference/commentBeforeStaticMethod1.types b/tests/baselines/reference/commentBeforeStaticMethod1.types index db674324306..1b16709a701 100644 --- a/tests/baselines/reference/commentBeforeStaticMethod1.types +++ b/tests/baselines/reference/commentBeforeStaticMethod1.types @@ -9,5 +9,6 @@ class C { >foo : () => string return "bar"; +>"bar" : string } } diff --git a/tests/baselines/reference/commentEmitAtEndOfFile1.symbols b/tests/baselines/reference/commentEmitAtEndOfFile1.symbols new file mode 100644 index 00000000000..1fc0ad09553 --- /dev/null +++ b/tests/baselines/reference/commentEmitAtEndOfFile1.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/commentEmitAtEndOfFile1.ts === +// test +var f = '' +>f : Symbol(f, Decl(commentEmitAtEndOfFile1.ts, 1, 3)) + +// test #2 +module foo { +>foo : Symbol(foo, Decl(commentEmitAtEndOfFile1.ts, 1, 10)) + + function bar() { } +>bar : Symbol(bar, Decl(commentEmitAtEndOfFile1.ts, 3, 12)) +} +// test #3 +module empty { +>empty : Symbol(empty, Decl(commentEmitAtEndOfFile1.ts, 5, 1)) +} +// test #4 diff --git a/tests/baselines/reference/commentEmitAtEndOfFile1.types b/tests/baselines/reference/commentEmitAtEndOfFile1.types index 76b5c868cb6..d88d7ffa5fc 100644 --- a/tests/baselines/reference/commentEmitAtEndOfFile1.types +++ b/tests/baselines/reference/commentEmitAtEndOfFile1.types @@ -2,6 +2,7 @@ // test var f = '' >f : string +>'' : string // test #2 module foo { @@ -12,6 +13,6 @@ module foo { } // test #3 module empty { ->empty : unknown +>empty : any } // test #4 diff --git a/tests/baselines/reference/commentEmitWithCommentOnLastLine.symbols b/tests/baselines/reference/commentEmitWithCommentOnLastLine.symbols new file mode 100644 index 00000000000..47ee947a500 --- /dev/null +++ b/tests/baselines/reference/commentEmitWithCommentOnLastLine.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/commentEmitWithCommentOnLastLine.ts === +var x: any; +>x : Symbol(x, Decl(commentEmitWithCommentOnLastLine.ts, 0, 3)) + +/* +var bar; +*/ diff --git a/tests/baselines/reference/commentInEmptyParameterList1.symbols b/tests/baselines/reference/commentInEmptyParameterList1.symbols new file mode 100644 index 00000000000..b5566029948 --- /dev/null +++ b/tests/baselines/reference/commentInEmptyParameterList1.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/commentInEmptyParameterList1.ts === +function foo(/** nothing */) { +>foo : Symbol(foo, Decl(commentInEmptyParameterList1.ts, 0, 0)) +} diff --git a/tests/baselines/reference/commentInMethodCall.symbols b/tests/baselines/reference/commentInMethodCall.symbols new file mode 100644 index 00000000000..ff286983e23 --- /dev/null +++ b/tests/baselines/reference/commentInMethodCall.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/commentInMethodCall.ts === +//commment here +var s: string[]; +>s : Symbol(s, Decl(commentInMethodCall.ts, 1, 3)) + +s.map(// do something +>s.map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>s : Symbol(s, Decl(commentInMethodCall.ts, 1, 3)) +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) + + function () { }); + diff --git a/tests/baselines/reference/commentOnAmbientClass1.symbols b/tests/baselines/reference/commentOnAmbientClass1.symbols new file mode 100644 index 00000000000..899c5f19a24 --- /dev/null +++ b/tests/baselines/reference/commentOnAmbientClass1.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/b.ts === +/// +declare class E extends C { +>E : Symbol(E, Decl(b.ts, 0, 0)) +>C : Symbol(C, Decl(a.ts, 0, 0)) +} +=== tests/cases/compiler/a.ts === +/*! Keep this pinned comment */ +declare class C { +>C : Symbol(C, Decl(a.ts, 0, 0)) +} + +// Don't keep this comment. +declare class D { +>D : Symbol(D, Decl(a.ts, 2, 1)) +} + diff --git a/tests/baselines/reference/commentOnAmbientEnum.symbols b/tests/baselines/reference/commentOnAmbientEnum.symbols new file mode 100644 index 00000000000..d86d490113d --- /dev/null +++ b/tests/baselines/reference/commentOnAmbientEnum.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/b.ts === +/// +declare enum E { +>E : Symbol(E, Decl(b.ts, 0, 0)) +} +=== tests/cases/compiler/a.ts === +/*! Keep this pinned comment */ +declare enum C { +>C : Symbol(C, Decl(a.ts, 0, 0)) + + a, +>a : Symbol(C.a, Decl(a.ts, 1, 16)) + + b, +>b : Symbol(C.b, Decl(a.ts, 2, 6)) + + c +>c : Symbol(C.c, Decl(a.ts, 3, 6)) +} + +// Don't keep this comment. +declare enum D { +>D : Symbol(D, Decl(a.ts, 5, 1)) +} + diff --git a/tests/baselines/reference/commentOnAmbientModule.symbols b/tests/baselines/reference/commentOnAmbientModule.symbols new file mode 100644 index 00000000000..c1412c17880 --- /dev/null +++ b/tests/baselines/reference/commentOnAmbientModule.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/b.ts === +/// +declare module E { +>E : Symbol(E, Decl(b.ts, 0, 0)) + + class foobar extends D.bar { +>foobar : Symbol(foobar, Decl(b.ts, 1, 18)) +>D.bar : Symbol(D.bar, Decl(a.ts, 6, 18)) +>D : Symbol(D, Decl(a.ts, 3, 1)) +>bar : Symbol(D.bar, Decl(a.ts, 6, 18)) + + foo(); +>foo : Symbol(foo, Decl(b.ts, 2, 32)) + } +} +=== tests/cases/compiler/a.ts === +/*! Keep this pinned comment */ +declare module C { +>C : Symbol(C, Decl(a.ts, 0, 0)) + + function foo(); +>foo : Symbol(foo, Decl(a.ts, 1, 18)) +} + +// Don't keep this comment. +declare module D { +>D : Symbol(D, Decl(a.ts, 3, 1)) + + class bar { } +>bar : Symbol(bar, Decl(a.ts, 6, 18)) +} + diff --git a/tests/baselines/reference/commentOnAmbientModule.types b/tests/baselines/reference/commentOnAmbientModule.types index f0056decc29..13d35cddcea 100644 --- a/tests/baselines/reference/commentOnAmbientModule.types +++ b/tests/baselines/reference/commentOnAmbientModule.types @@ -5,6 +5,7 @@ declare module E { class foobar extends D.bar { >foobar : foobar +>D.bar : any >D : typeof D >bar : D.bar diff --git a/tests/baselines/reference/commentOnAmbientVariable1.symbols b/tests/baselines/reference/commentOnAmbientVariable1.symbols new file mode 100644 index 00000000000..153653e7827 --- /dev/null +++ b/tests/baselines/reference/commentOnAmbientVariable1.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/commentOnAmbientVariable1.ts === +/*! Keep this pinned comment */ +declare var v: number; +>v : Symbol(v, Decl(commentOnAmbientVariable1.ts, 1, 11)) + +// Don't keep this comment. +declare var y: number; +>y : Symbol(y, Decl(commentOnAmbientVariable1.ts, 4, 11)) + diff --git a/tests/baselines/reference/commentOnAmbientVariable2.symbols b/tests/baselines/reference/commentOnAmbientVariable2.symbols new file mode 100644 index 00000000000..94100ce7b5b --- /dev/null +++ b/tests/baselines/reference/commentOnAmbientVariable2.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/commentOnAmbientVariable2_2.ts === +/// +declare var x: number; +>x : Symbol(x, Decl(commentOnAmbientVariable2_2.ts, 1, 11)) + +x = 2; +>x : Symbol(x, Decl(commentOnAmbientVariable2_2.ts, 1, 11)) + +=== tests/cases/compiler/commentOnAmbientVariable2_1.ts === +var y = 1; +>y : Symbol(y, Decl(commentOnAmbientVariable2_1.ts, 0, 3)) + diff --git a/tests/baselines/reference/commentOnAmbientVariable2.types b/tests/baselines/reference/commentOnAmbientVariable2.types index 68ca1459575..28760dca1ec 100644 --- a/tests/baselines/reference/commentOnAmbientVariable2.types +++ b/tests/baselines/reference/commentOnAmbientVariable2.types @@ -6,8 +6,10 @@ declare var x: number; x = 2; >x = 2 : number >x : number +>2 : number === tests/cases/compiler/commentOnAmbientVariable2_1.ts === var y = 1; >y : number +>1 : number diff --git a/tests/baselines/reference/commentOnAmbientfunction.symbols b/tests/baselines/reference/commentOnAmbientfunction.symbols new file mode 100644 index 00000000000..c6afb72eb9c --- /dev/null +++ b/tests/baselines/reference/commentOnAmbientfunction.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/b.ts === +/// +declare function foobar(a: typeof foo): typeof bar; +>foobar : Symbol(foobar, Decl(b.ts, 0, 0)) +>a : Symbol(a, Decl(b.ts, 1, 24)) +>foo : Symbol(foo, Decl(a.ts, 0, 0)) +>bar : Symbol(bar, Decl(a.ts, 1, 23)) + +=== tests/cases/compiler/a.ts === +/*! Keep this pinned comment */ +declare function foo(); +>foo : Symbol(foo, Decl(a.ts, 0, 0)) + +// Don't keep this comment. +declare function bar(); +>bar : Symbol(bar, Decl(a.ts, 1, 23)) + diff --git a/tests/baselines/reference/commentOnBlock1.symbols b/tests/baselines/reference/commentOnBlock1.symbols new file mode 100644 index 00000000000..5bdae83d3eb --- /dev/null +++ b/tests/baselines/reference/commentOnBlock1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/commentOnBlock1.ts === +// asdf +function f() { +>f : Symbol(f, Decl(commentOnBlock1.ts, 0, 0)) + + /*asdf*/{} +} diff --git a/tests/baselines/reference/commentOnClassMethod1.symbols b/tests/baselines/reference/commentOnClassMethod1.symbols new file mode 100644 index 00000000000..18caefb744b --- /dev/null +++ b/tests/baselines/reference/commentOnClassMethod1.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/commentOnClassMethod1.ts === +class WebControls { +>WebControls : Symbol(WebControls, Decl(commentOnClassMethod1.ts, 0, 0)) + + /** + * Render a control + */ + createControl(): any { +>createControl : Symbol(createControl, Decl(commentOnClassMethod1.ts, 0, 19)) + } +} diff --git a/tests/baselines/reference/commentOnElidedModule1.symbols b/tests/baselines/reference/commentOnElidedModule1.symbols new file mode 100644 index 00000000000..63ce4dadf97 --- /dev/null +++ b/tests/baselines/reference/commentOnElidedModule1.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/b.ts === +/// +module ElidedModule3 { +>ElidedModule3 : Symbol(ElidedModule3, Decl(b.ts, 0, 0)) +} +=== tests/cases/compiler/a.ts === +/*! Keep this pinned comment */ +module ElidedModule { +>ElidedModule : Symbol(ElidedModule, Decl(a.ts, 0, 0)) +} + +// Don't keep this comment. +module ElidedModule2 { +>ElidedModule2 : Symbol(ElidedModule2, Decl(a.ts, 2, 1)) +} + diff --git a/tests/baselines/reference/commentOnElidedModule1.types b/tests/baselines/reference/commentOnElidedModule1.types index 785336dff3d..8e095b8102f 100644 --- a/tests/baselines/reference/commentOnElidedModule1.types +++ b/tests/baselines/reference/commentOnElidedModule1.types @@ -1,16 +1,16 @@ === tests/cases/compiler/b.ts === /// module ElidedModule3 { ->ElidedModule3 : unknown +>ElidedModule3 : any } === tests/cases/compiler/a.ts === /*! Keep this pinned comment */ module ElidedModule { ->ElidedModule : unknown +>ElidedModule : any } // Don't keep this comment. module ElidedModule2 { ->ElidedModule2 : unknown +>ElidedModule2 : any } diff --git a/tests/baselines/reference/commentOnExpressionStatement1.symbols b/tests/baselines/reference/commentOnExpressionStatement1.symbols new file mode 100644 index 00000000000..f78660f0344 --- /dev/null +++ b/tests/baselines/reference/commentOnExpressionStatement1.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/commentOnExpressionStatement1.ts === + +No type information for this code.1 + 1; // Comment. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/commentOnExpressionStatement1.types b/tests/baselines/reference/commentOnExpressionStatement1.types index c39689ed381..11d5fe1c6b5 100644 --- a/tests/baselines/reference/commentOnExpressionStatement1.types +++ b/tests/baselines/reference/commentOnExpressionStatement1.types @@ -2,4 +2,6 @@ 1 + 1; // Comment. >1 + 1 : number +>1 : number +>1 : number diff --git a/tests/baselines/reference/commentOnIfStatement1.symbols b/tests/baselines/reference/commentOnIfStatement1.symbols new file mode 100644 index 00000000000..03f357c8ccf --- /dev/null +++ b/tests/baselines/reference/commentOnIfStatement1.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/commentOnIfStatement1.ts === + +No type information for this code.// Test +No type information for this code.if (true) { +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/commentOnIfStatement1.types b/tests/baselines/reference/commentOnIfStatement1.types index 03f357c8ccf..7b983156f4d 100644 --- a/tests/baselines/reference/commentOnIfStatement1.types +++ b/tests/baselines/reference/commentOnIfStatement1.types @@ -1,6 +1,6 @@ === tests/cases/compiler/commentOnIfStatement1.ts === -No type information for this code.// Test -No type information for this code.if (true) { -No type information for this code.} -No type information for this code. \ No newline at end of file +// Test +if (true) { +>true : boolean +} diff --git a/tests/baselines/reference/commentOnInterface1.symbols b/tests/baselines/reference/commentOnInterface1.symbols new file mode 100644 index 00000000000..9564d9b4cfa --- /dev/null +++ b/tests/baselines/reference/commentOnInterface1.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/b.ts === +/// +interface I3 { +>I3 : Symbol(I3, Decl(b.ts, 0, 0)) +} +=== tests/cases/compiler/a.ts === +/*! Keep this pinned comment */ +interface I { +>I : Symbol(I, Decl(a.ts, 0, 0)) +} + +// Don't keep this comment. +interface I2 { +>I2 : Symbol(I2, Decl(a.ts, 2, 1)) +} + diff --git a/tests/baselines/reference/commentOnParenthesizedExpressionOpenParen1.symbols b/tests/baselines/reference/commentOnParenthesizedExpressionOpenParen1.symbols new file mode 100644 index 00000000000..d3726f99af2 --- /dev/null +++ b/tests/baselines/reference/commentOnParenthesizedExpressionOpenParen1.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/commentOnParenthesizedExpressionOpenParen1.ts === +var j; +>j : Symbol(j, Decl(commentOnParenthesizedExpressionOpenParen1.ts, 0, 3)) + +var f: () => any; +>f : Symbol(f, Decl(commentOnParenthesizedExpressionOpenParen1.ts, 1, 3)) + +( /* Preserve */ j = f()); +>j : Symbol(j, Decl(commentOnParenthesizedExpressionOpenParen1.ts, 0, 3)) +>f : Symbol(f, Decl(commentOnParenthesizedExpressionOpenParen1.ts, 1, 3)) + diff --git a/tests/baselines/reference/commentOnSignature1.symbols b/tests/baselines/reference/commentOnSignature1.symbols new file mode 100644 index 00000000000..0d39565fb61 --- /dev/null +++ b/tests/baselines/reference/commentOnSignature1.symbols @@ -0,0 +1,62 @@ +=== tests/cases/compiler/b.ts === +/// +function foo2(n: number): void; +>foo2 : Symbol(foo2, Decl(b.ts, 0, 0), Decl(b.ts, 1, 31), Decl(b.ts, 3, 31)) +>n : Symbol(n, Decl(b.ts, 1, 14)) + +// Don't keep this comment. +function foo2(s: string): void; +>foo2 : Symbol(foo2, Decl(b.ts, 0, 0), Decl(b.ts, 1, 31), Decl(b.ts, 3, 31)) +>s : Symbol(s, Decl(b.ts, 3, 14)) + +function foo2(a: any): void { +>foo2 : Symbol(foo2, Decl(b.ts, 0, 0), Decl(b.ts, 1, 31), Decl(b.ts, 3, 31)) +>a : Symbol(a, Decl(b.ts, 4, 14)) +} +=== tests/cases/compiler/a.ts === +/*! Keep this pinned comment */ +function foo(n: number): void; +>foo : Symbol(foo, Decl(a.ts, 0, 0), Decl(a.ts, 1, 30), Decl(a.ts, 3, 30)) +>n : Symbol(n, Decl(a.ts, 1, 13)) + +// Don't keep this comment. +function foo(s: string): void; +>foo : Symbol(foo, Decl(a.ts, 0, 0), Decl(a.ts, 1, 30), Decl(a.ts, 3, 30)) +>s : Symbol(s, Decl(a.ts, 3, 13)) + +function foo(a: any): void { +>foo : Symbol(foo, Decl(a.ts, 0, 0), Decl(a.ts, 1, 30), Decl(a.ts, 3, 30)) +>a : Symbol(a, Decl(a.ts, 4, 13)) +} + +class c { +>c : Symbol(c, Decl(a.ts, 5, 1)) + + // dont keep this comment + constructor(a: string); +>a : Symbol(a, Decl(a.ts, 9, 16)) + + /*! keep this pinned comment */ + constructor(a: number); +>a : Symbol(a, Decl(a.ts, 11, 16)) + + constructor(a: any) { +>a : Symbol(a, Decl(a.ts, 12, 16)) + } + + // dont keep this comment + foo(a: string); +>foo : Symbol(foo, Decl(a.ts, 13, 5), Decl(a.ts, 16, 19), Decl(a.ts, 18, 19)) +>a : Symbol(a, Decl(a.ts, 16, 8)) + + /*! keep this pinned comment */ + foo(a: number); +>foo : Symbol(foo, Decl(a.ts, 13, 5), Decl(a.ts, 16, 19), Decl(a.ts, 18, 19)) +>a : Symbol(a, Decl(a.ts, 18, 8)) + + foo(a: any) { +>foo : Symbol(foo, Decl(a.ts, 13, 5), Decl(a.ts, 16, 19), Decl(a.ts, 18, 19)) +>a : Symbol(a, Decl(a.ts, 19, 8)) + } +} + diff --git a/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.symbols b/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.symbols new file mode 100644 index 00000000000..efbcb08496d --- /dev/null +++ b/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/commentOnSimpleArrowFunctionBody1.ts === +function Foo(x: any) +>Foo : Symbol(Foo, Decl(commentOnSimpleArrowFunctionBody1.ts, 0, 0)) +>x : Symbol(x, Decl(commentOnSimpleArrowFunctionBody1.ts, 0, 13)) +{ +} + +Foo(() => +>Foo : Symbol(Foo, Decl(commentOnSimpleArrowFunctionBody1.ts, 0, 0)) + + // do something + 127); + diff --git a/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.types b/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.types index 916a03eb65e..6dd530e438b 100644 --- a/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.types +++ b/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.types @@ -12,4 +12,5 @@ Foo(() => // do something 127); +>127 : number diff --git a/tests/baselines/reference/commentOnStaticMember1.symbols b/tests/baselines/reference/commentOnStaticMember1.symbols new file mode 100644 index 00000000000..4d575a17cb6 --- /dev/null +++ b/tests/baselines/reference/commentOnStaticMember1.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/commentOnStaticMember1.ts === +class Greeter { +>Greeter : Symbol(Greeter, Decl(commentOnStaticMember1.ts, 0, 0)) + + //Hello World + static foo(){ +>foo : Symbol(Greeter.foo, Decl(commentOnStaticMember1.ts, 0, 15)) + } +} diff --git a/tests/baselines/reference/commentsAtEndOfFile1.symbols b/tests/baselines/reference/commentsAtEndOfFile1.symbols new file mode 100644 index 00000000000..c09a435f1a7 --- /dev/null +++ b/tests/baselines/reference/commentsAtEndOfFile1.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/commentsAtEndOfFile1.ts === +Input: +No type information for this code.; +No type information for this code.//Testing two +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/commentsAtEndOfFile1.types b/tests/baselines/reference/commentsAtEndOfFile1.types index c09a435f1a7..6bac6757061 100644 --- a/tests/baselines/reference/commentsAtEndOfFile1.types +++ b/tests/baselines/reference/commentsAtEndOfFile1.types @@ -1,6 +1,7 @@ === tests/cases/compiler/commentsAtEndOfFile1.ts === Input: -No type information for this code.; -No type information for this code.//Testing two -No type information for this code. -No type information for this code. \ No newline at end of file +>Input : any + +; +//Testing two + diff --git a/tests/baselines/reference/commentsBeforeFunctionExpression1.symbols b/tests/baselines/reference/commentsBeforeFunctionExpression1.symbols new file mode 100644 index 00000000000..adeea60711e --- /dev/null +++ b/tests/baselines/reference/commentsBeforeFunctionExpression1.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/commentsBeforeFunctionExpression1.ts === +var v = { +>v : Symbol(v, Decl(commentsBeforeFunctionExpression1.ts, 0, 3)) + + f: /**own f*/ (a) => 0 +>f : Symbol(f, Decl(commentsBeforeFunctionExpression1.ts, 0, 9)) +>a : Symbol(a, Decl(commentsBeforeFunctionExpression1.ts, 1, 19)) +} + diff --git a/tests/baselines/reference/commentsBeforeFunctionExpression1.types b/tests/baselines/reference/commentsBeforeFunctionExpression1.types index 4580ca9ceeb..a057918a74d 100644 --- a/tests/baselines/reference/commentsBeforeFunctionExpression1.types +++ b/tests/baselines/reference/commentsBeforeFunctionExpression1.types @@ -7,5 +7,6 @@ var v = { >f : (a: any) => number >(a) => 0 : (a: any) => number >a : any +>0 : number } diff --git a/tests/baselines/reference/commentsBeforeVariableStatement1.symbols b/tests/baselines/reference/commentsBeforeVariableStatement1.symbols new file mode 100644 index 00000000000..ddbac8e4653 --- /dev/null +++ b/tests/baselines/reference/commentsBeforeVariableStatement1.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/commentsBeforeVariableStatement1.ts === +/** b's comment*/ +export var b: number; +>b : Symbol(b, Decl(commentsBeforeVariableStatement1.ts, 1, 10)) + diff --git a/tests/baselines/reference/commentsClass.symbols b/tests/baselines/reference/commentsClass.symbols new file mode 100644 index 00000000000..9364dc50b02 --- /dev/null +++ b/tests/baselines/reference/commentsClass.symbols @@ -0,0 +1,135 @@ +=== tests/cases/compiler/commentsClass.ts === + +/** This is class c2 without constuctor*/ +class c2 { +>c2 : Symbol(c2, Decl(commentsClass.ts, 0, 0)) + +} // trailing comment1 +var i2 = new c2(); +>i2 : Symbol(i2, Decl(commentsClass.ts, 4, 3)) +>c2 : Symbol(c2, Decl(commentsClass.ts, 0, 0)) + +var i2_c = c2; +>i2_c : Symbol(i2_c, Decl(commentsClass.ts, 5, 3)) +>c2 : Symbol(c2, Decl(commentsClass.ts, 0, 0)) + +class c3 { +>c3 : Symbol(c3, Decl(commentsClass.ts, 5, 14)) + + /** Constructor comment*/ + constructor() { + } // trailing comment of constructor +} /* trailing comment 2 */ +var i3 = new c3(); +>i3 : Symbol(i3, Decl(commentsClass.ts, 11, 3)) +>c3 : Symbol(c3, Decl(commentsClass.ts, 5, 14)) + +var i3_c = c3; +>i3_c : Symbol(i3_c, Decl(commentsClass.ts, 12, 3)) +>c3 : Symbol(c3, Decl(commentsClass.ts, 5, 14)) + +/** Class comment*/ +class c4 { +>c4 : Symbol(c4, Decl(commentsClass.ts, 12, 14)) + + /** Constructor comment*/ + constructor() { + } /* trailing comment of constructor 2*/ +} +var i4 = new c4(); +>i4 : Symbol(i4, Decl(commentsClass.ts, 19, 3)) +>c4 : Symbol(c4, Decl(commentsClass.ts, 12, 14)) + +var i4_c = c4; +>i4_c : Symbol(i4_c, Decl(commentsClass.ts, 20, 3)) +>c4 : Symbol(c4, Decl(commentsClass.ts, 12, 14)) + +/** Class with statics*/ +class c5 { +>c5 : Symbol(c5, Decl(commentsClass.ts, 20, 14)) + + static s1: number; +>s1 : Symbol(c5.s1, Decl(commentsClass.ts, 22, 10)) +} +var i5 = new c5(); +>i5 : Symbol(i5, Decl(commentsClass.ts, 25, 3)) +>c5 : Symbol(c5, Decl(commentsClass.ts, 20, 14)) + +var i5_c = c5; +>i5_c : Symbol(i5_c, Decl(commentsClass.ts, 26, 3)) +>c5 : Symbol(c5, Decl(commentsClass.ts, 20, 14)) + +/// class with statics and constructor +class c6 { /// class with statics and constructor2 +>c6 : Symbol(c6, Decl(commentsClass.ts, 26, 14)) + + /// s1 comment + static s1: number; /// s1 comment2 +>s1 : Symbol(c6.s1, Decl(commentsClass.ts, 29, 10)) + + /// constructor comment + constructor() { /// constructor comment2 + } +} +var i6 = new c6(); +>i6 : Symbol(i6, Decl(commentsClass.ts, 36, 3)) +>c6 : Symbol(c6, Decl(commentsClass.ts, 26, 14)) + +var i6_c = c6; +>i6_c : Symbol(i6_c, Decl(commentsClass.ts, 37, 3)) +>c6 : Symbol(c6, Decl(commentsClass.ts, 26, 14)) + +// class with statics and constructor +class c7 { +>c7 : Symbol(c7, Decl(commentsClass.ts, 37, 14)) + + // s1 comment + static s1: number; +>s1 : Symbol(c7.s1, Decl(commentsClass.ts, 40, 10)) + + // constructor comment + constructor() { + } +} +var i7 = new c7(); +>i7 : Symbol(i7, Decl(commentsClass.ts, 47, 3)) +>c7 : Symbol(c7, Decl(commentsClass.ts, 37, 14)) + +var i7_c = c7; +>i7_c : Symbol(i7_c, Decl(commentsClass.ts, 48, 3)) +>c7 : Symbol(c7, Decl(commentsClass.ts, 37, 14)) + +/** class with statics and constructor + */ +class c8 { +>c8 : Symbol(c8, Decl(commentsClass.ts, 48, 14)) + + /** s1 comment */ + static s1: number; /** s1 comment2 */ +>s1 : Symbol(c8.s1, Decl(commentsClass.ts, 52, 10)) + + /** constructor comment + */ + constructor() { + /** constructor comment2 + */ + } +} +var i8 = new c8(); +>i8 : Symbol(i8, Decl(commentsClass.ts, 62, 3)) +>c8 : Symbol(c8, Decl(commentsClass.ts, 48, 14)) + +var i8_c = c8; +>i8_c : Symbol(i8_c, Decl(commentsClass.ts, 63, 3)) +>c8 : Symbol(c8, Decl(commentsClass.ts, 48, 14)) + +class c9 { +>c9 : Symbol(c9, Decl(commentsClass.ts, 63, 14)) + + constructor() { + /// This is some detached comment + + // should emit this leading comment of } too + } +} + diff --git a/tests/baselines/reference/commentsClassMembers.symbols b/tests/baselines/reference/commentsClassMembers.symbols new file mode 100644 index 00000000000..dd014611df7 --- /dev/null +++ b/tests/baselines/reference/commentsClassMembers.symbols @@ -0,0 +1,706 @@ +=== tests/cases/compiler/commentsClassMembers.ts === + +/** This is comment for c1*/ +class c1 { +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) + + /** p1 is property of c1*/ + public p1: number; +>p1 : Symbol(p1, Decl(commentsClassMembers.ts, 2, 10)) + + /** sum with property*/ + public p2(/** number to add*/b: number) { +>p2 : Symbol(p2, Decl(commentsClassMembers.ts, 4, 22)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 6, 14)) + + return this.p1 + b; +>this.p1 : Symbol(p1, Decl(commentsClassMembers.ts, 2, 10)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>p1 : Symbol(p1, Decl(commentsClassMembers.ts, 2, 10)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 6, 14)) + + } /* trailing comment of method*/ + /** getter property*/ + public get p3() { +>p3 : Symbol(p3, Decl(commentsClassMembers.ts, 8, 5), Decl(commentsClassMembers.ts, 12, 5)) + + return this.p2(this.p1); +>this.p2 : Symbol(p2, Decl(commentsClassMembers.ts, 4, 22)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>p2 : Symbol(p2, Decl(commentsClassMembers.ts, 4, 22)) +>this.p1 : Symbol(p1, Decl(commentsClassMembers.ts, 2, 10)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>p1 : Symbol(p1, Decl(commentsClassMembers.ts, 2, 10)) + + }// trailing comment Getter + /** setter property*/ + public set p3(/** this is value*/value: number) { +>p3 : Symbol(p3, Decl(commentsClassMembers.ts, 8, 5), Decl(commentsClassMembers.ts, 12, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 14, 18)) + + this.p1 = this.p2(value); +>this.p1 : Symbol(p1, Decl(commentsClassMembers.ts, 2, 10)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>p1 : Symbol(p1, Decl(commentsClassMembers.ts, 2, 10)) +>this.p2 : Symbol(p2, Decl(commentsClassMembers.ts, 4, 22)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>p2 : Symbol(p2, Decl(commentsClassMembers.ts, 4, 22)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 14, 18)) + + }// trailing comment Setter + /** pp1 is property of c1*/ + private pp1: number; +>pp1 : Symbol(pp1, Decl(commentsClassMembers.ts, 16, 5)) + + /** sum with property*/ + private pp2(/** number to add*/b: number) { +>pp2 : Symbol(pp2, Decl(commentsClassMembers.ts, 18, 24)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 20, 16)) + + return this.p1 + b; +>this.p1 : Symbol(p1, Decl(commentsClassMembers.ts, 2, 10)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>p1 : Symbol(p1, Decl(commentsClassMembers.ts, 2, 10)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 20, 16)) + + } // trailing comment of method + /** getter property*/ + private get pp3() { +>pp3 : Symbol(pp3, Decl(commentsClassMembers.ts, 22, 5), Decl(commentsClassMembers.ts, 26, 5)) + + return this.pp2(this.pp1); +>this.pp2 : Symbol(pp2, Decl(commentsClassMembers.ts, 18, 24)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>pp2 : Symbol(pp2, Decl(commentsClassMembers.ts, 18, 24)) +>this.pp1 : Symbol(pp1, Decl(commentsClassMembers.ts, 16, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>pp1 : Symbol(pp1, Decl(commentsClassMembers.ts, 16, 5)) + } + /** setter property*/ + private set pp3( /** this is value*/value: number) { +>pp3 : Symbol(pp3, Decl(commentsClassMembers.ts, 22, 5), Decl(commentsClassMembers.ts, 26, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 28, 20)) + + this.pp1 = this.pp2(value); +>this.pp1 : Symbol(pp1, Decl(commentsClassMembers.ts, 16, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>pp1 : Symbol(pp1, Decl(commentsClassMembers.ts, 16, 5)) +>this.pp2 : Symbol(pp2, Decl(commentsClassMembers.ts, 18, 24)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>pp2 : Symbol(pp2, Decl(commentsClassMembers.ts, 18, 24)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 28, 20)) + } + /** Constructor method*/ + constructor() { + } + /** s1 is static property of c1*/ + static s1: number; +>s1 : Symbol(c1.s1, Decl(commentsClassMembers.ts, 33, 5)) + + /** static sum with property*/ + static s2(/** number to add*/b: number) { +>s2 : Symbol(c1.s2, Decl(commentsClassMembers.ts, 35, 22)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 37, 14)) + + return c1.s1 + b; +>c1.s1 : Symbol(c1.s1, Decl(commentsClassMembers.ts, 33, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s1 : Symbol(c1.s1, Decl(commentsClassMembers.ts, 33, 5)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 37, 14)) + } + /** static getter property*/ + static get s3() { +>s3 : Symbol(c1.s3, Decl(commentsClassMembers.ts, 39, 5), Decl(commentsClassMembers.ts, 43, 5)) + + return c1.s2(c1.s1); +>c1.s2 : Symbol(c1.s2, Decl(commentsClassMembers.ts, 35, 22)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s2 : Symbol(c1.s2, Decl(commentsClassMembers.ts, 35, 22)) +>c1.s1 : Symbol(c1.s1, Decl(commentsClassMembers.ts, 33, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s1 : Symbol(c1.s1, Decl(commentsClassMembers.ts, 33, 5)) + + } /*trailing comment 1 getter*/ + /** setter property*/ + static set s3( /** this is value*/value: number) { +>s3 : Symbol(c1.s3, Decl(commentsClassMembers.ts, 39, 5), Decl(commentsClassMembers.ts, 43, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 45, 18)) + + c1.s1 = c1.s2(value); +>c1.s1 : Symbol(c1.s1, Decl(commentsClassMembers.ts, 33, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s1 : Symbol(c1.s1, Decl(commentsClassMembers.ts, 33, 5)) +>c1.s2 : Symbol(c1.s2, Decl(commentsClassMembers.ts, 35, 22)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s2 : Symbol(c1.s2, Decl(commentsClassMembers.ts, 35, 22)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 45, 18)) + + }/*trailing comment 2 */ /*setter*/ + public nc_p1: number; +>nc_p1 : Symbol(nc_p1, Decl(commentsClassMembers.ts, 47, 5)) + + public nc_p2(b: number) { +>nc_p2 : Symbol(nc_p2, Decl(commentsClassMembers.ts, 48, 25)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 49, 17)) + + return this.nc_p1 + b; +>this.nc_p1 : Symbol(nc_p1, Decl(commentsClassMembers.ts, 47, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_p1 : Symbol(nc_p1, Decl(commentsClassMembers.ts, 47, 5)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 49, 17)) + } + public get nc_p3() { +>nc_p3 : Symbol(nc_p3, Decl(commentsClassMembers.ts, 51, 5), Decl(commentsClassMembers.ts, 54, 5)) + + return this.nc_p2(this.nc_p1); +>this.nc_p2 : Symbol(nc_p2, Decl(commentsClassMembers.ts, 48, 25)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_p2 : Symbol(nc_p2, Decl(commentsClassMembers.ts, 48, 25)) +>this.nc_p1 : Symbol(nc_p1, Decl(commentsClassMembers.ts, 47, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_p1 : Symbol(nc_p1, Decl(commentsClassMembers.ts, 47, 5)) + } + public set nc_p3(value: number) { +>nc_p3 : Symbol(nc_p3, Decl(commentsClassMembers.ts, 51, 5), Decl(commentsClassMembers.ts, 54, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 55, 21)) + + this.nc_p1 = this.nc_p2(value); +>this.nc_p1 : Symbol(nc_p1, Decl(commentsClassMembers.ts, 47, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_p1 : Symbol(nc_p1, Decl(commentsClassMembers.ts, 47, 5)) +>this.nc_p2 : Symbol(nc_p2, Decl(commentsClassMembers.ts, 48, 25)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_p2 : Symbol(nc_p2, Decl(commentsClassMembers.ts, 48, 25)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 55, 21)) + } + private nc_pp1: number; +>nc_pp1 : Symbol(nc_pp1, Decl(commentsClassMembers.ts, 57, 5)) + + private nc_pp2(b: number) { +>nc_pp2 : Symbol(nc_pp2, Decl(commentsClassMembers.ts, 58, 27)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 59, 19)) + + return this.nc_pp1 + b; +>this.nc_pp1 : Symbol(nc_pp1, Decl(commentsClassMembers.ts, 57, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_pp1 : Symbol(nc_pp1, Decl(commentsClassMembers.ts, 57, 5)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 59, 19)) + } + private get nc_pp3() { +>nc_pp3 : Symbol(nc_pp3, Decl(commentsClassMembers.ts, 61, 5), Decl(commentsClassMembers.ts, 64, 5)) + + return this.nc_pp2(this.nc_pp1); +>this.nc_pp2 : Symbol(nc_pp2, Decl(commentsClassMembers.ts, 58, 27)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_pp2 : Symbol(nc_pp2, Decl(commentsClassMembers.ts, 58, 27)) +>this.nc_pp1 : Symbol(nc_pp1, Decl(commentsClassMembers.ts, 57, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_pp1 : Symbol(nc_pp1, Decl(commentsClassMembers.ts, 57, 5)) + } + private set nc_pp3(value: number) { +>nc_pp3 : Symbol(nc_pp3, Decl(commentsClassMembers.ts, 61, 5), Decl(commentsClassMembers.ts, 64, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 65, 23)) + + this.nc_pp1 = this.nc_pp2(value); +>this.nc_pp1 : Symbol(nc_pp1, Decl(commentsClassMembers.ts, 57, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_pp1 : Symbol(nc_pp1, Decl(commentsClassMembers.ts, 57, 5)) +>this.nc_pp2 : Symbol(nc_pp2, Decl(commentsClassMembers.ts, 58, 27)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_pp2 : Symbol(nc_pp2, Decl(commentsClassMembers.ts, 58, 27)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 65, 23)) + } + static nc_s1: number; +>nc_s1 : Symbol(c1.nc_s1, Decl(commentsClassMembers.ts, 67, 5)) + + static nc_s2(b: number) { +>nc_s2 : Symbol(c1.nc_s2, Decl(commentsClassMembers.ts, 68, 25)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 69, 17)) + + return c1.nc_s1 + b; +>c1.nc_s1 : Symbol(c1.nc_s1, Decl(commentsClassMembers.ts, 67, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_s1 : Symbol(c1.nc_s1, Decl(commentsClassMembers.ts, 67, 5)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 69, 17)) + } + static get nc_s3() { +>nc_s3 : Symbol(c1.nc_s3, Decl(commentsClassMembers.ts, 71, 5), Decl(commentsClassMembers.ts, 74, 5)) + + return c1.nc_s2(c1.nc_s1); +>c1.nc_s2 : Symbol(c1.nc_s2, Decl(commentsClassMembers.ts, 68, 25)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_s2 : Symbol(c1.nc_s2, Decl(commentsClassMembers.ts, 68, 25)) +>c1.nc_s1 : Symbol(c1.nc_s1, Decl(commentsClassMembers.ts, 67, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_s1 : Symbol(c1.nc_s1, Decl(commentsClassMembers.ts, 67, 5)) + } + static set nc_s3(value: number) { +>nc_s3 : Symbol(c1.nc_s3, Decl(commentsClassMembers.ts, 71, 5), Decl(commentsClassMembers.ts, 74, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 75, 21)) + + c1.nc_s1 = c1.nc_s2(value); +>c1.nc_s1 : Symbol(c1.nc_s1, Decl(commentsClassMembers.ts, 67, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_s1 : Symbol(c1.nc_s1, Decl(commentsClassMembers.ts, 67, 5)) +>c1.nc_s2 : Symbol(c1.nc_s2, Decl(commentsClassMembers.ts, 68, 25)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_s2 : Symbol(c1.nc_s2, Decl(commentsClassMembers.ts, 68, 25)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 75, 21)) + } + + // p1 is property of c1 + public a_p1: number; +>a_p1 : Symbol(a_p1, Decl(commentsClassMembers.ts, 77, 5)) + + // sum with property + public a_p2(b: number) { +>a_p2 : Symbol(a_p2, Decl(commentsClassMembers.ts, 80, 24)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 82, 16)) + + return this.a_p1 + b; +>this.a_p1 : Symbol(a_p1, Decl(commentsClassMembers.ts, 77, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>a_p1 : Symbol(a_p1, Decl(commentsClassMembers.ts, 77, 5)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 82, 16)) + } + // getter property + public get a_p3() { +>a_p3 : Symbol(a_p3, Decl(commentsClassMembers.ts, 84, 5), Decl(commentsClassMembers.ts, 88, 5)) + + return this.a_p2(this.a_p1); +>this.a_p2 : Symbol(a_p2, Decl(commentsClassMembers.ts, 80, 24)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>a_p2 : Symbol(a_p2, Decl(commentsClassMembers.ts, 80, 24)) +>this.a_p1 : Symbol(a_p1, Decl(commentsClassMembers.ts, 77, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>a_p1 : Symbol(a_p1, Decl(commentsClassMembers.ts, 77, 5)) + } + // setter property + public set a_p3(value: number) { +>a_p3 : Symbol(a_p3, Decl(commentsClassMembers.ts, 84, 5), Decl(commentsClassMembers.ts, 88, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 90, 20)) + + this.a_p1 = this.a_p2(value); +>this.a_p1 : Symbol(a_p1, Decl(commentsClassMembers.ts, 77, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>a_p1 : Symbol(a_p1, Decl(commentsClassMembers.ts, 77, 5)) +>this.a_p2 : Symbol(a_p2, Decl(commentsClassMembers.ts, 80, 24)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>a_p2 : Symbol(a_p2, Decl(commentsClassMembers.ts, 80, 24)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 90, 20)) + } + // pp1 is property of c1 + private a_pp1: number; +>a_pp1 : Symbol(a_pp1, Decl(commentsClassMembers.ts, 92, 5)) + + // sum with property + private a_pp2(b: number) { +>a_pp2 : Symbol(a_pp2, Decl(commentsClassMembers.ts, 94, 26)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 96, 18)) + + return this.a_p1 + b; +>this.a_p1 : Symbol(a_p1, Decl(commentsClassMembers.ts, 77, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>a_p1 : Symbol(a_p1, Decl(commentsClassMembers.ts, 77, 5)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 96, 18)) + } + // getter property + private get a_pp3() { +>a_pp3 : Symbol(a_pp3, Decl(commentsClassMembers.ts, 98, 5), Decl(commentsClassMembers.ts, 102, 5)) + + return this.a_pp2(this.a_pp1); +>this.a_pp2 : Symbol(a_pp2, Decl(commentsClassMembers.ts, 94, 26)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>a_pp2 : Symbol(a_pp2, Decl(commentsClassMembers.ts, 94, 26)) +>this.a_pp1 : Symbol(a_pp1, Decl(commentsClassMembers.ts, 92, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>a_pp1 : Symbol(a_pp1, Decl(commentsClassMembers.ts, 92, 5)) + } + // setter property + private set a_pp3(value: number) { +>a_pp3 : Symbol(a_pp3, Decl(commentsClassMembers.ts, 98, 5), Decl(commentsClassMembers.ts, 102, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 104, 22)) + + this.a_pp1 = this.a_pp2(value); +>this.a_pp1 : Symbol(a_pp1, Decl(commentsClassMembers.ts, 92, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>a_pp1 : Symbol(a_pp1, Decl(commentsClassMembers.ts, 92, 5)) +>this.a_pp2 : Symbol(a_pp2, Decl(commentsClassMembers.ts, 94, 26)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>a_pp2 : Symbol(a_pp2, Decl(commentsClassMembers.ts, 94, 26)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 104, 22)) + } + + // s1 is static property of c1 + static a_s1: number; +>a_s1 : Symbol(c1.a_s1, Decl(commentsClassMembers.ts, 106, 5)) + + // static sum with property + static a_s2(b: number) { +>a_s2 : Symbol(c1.a_s2, Decl(commentsClassMembers.ts, 109, 24)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 111, 16)) + + return c1.a_s1 + b; +>c1.a_s1 : Symbol(c1.a_s1, Decl(commentsClassMembers.ts, 106, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>a_s1 : Symbol(c1.a_s1, Decl(commentsClassMembers.ts, 106, 5)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 111, 16)) + } + // static getter property + static get a_s3() { +>a_s3 : Symbol(c1.a_s3, Decl(commentsClassMembers.ts, 113, 5), Decl(commentsClassMembers.ts, 117, 5)) + + return c1.s2(c1.s1); +>c1.s2 : Symbol(c1.s2, Decl(commentsClassMembers.ts, 35, 22)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s2 : Symbol(c1.s2, Decl(commentsClassMembers.ts, 35, 22)) +>c1.s1 : Symbol(c1.s1, Decl(commentsClassMembers.ts, 33, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s1 : Symbol(c1.s1, Decl(commentsClassMembers.ts, 33, 5)) + } + + // setter property + static set a_s3(value: number) { +>a_s3 : Symbol(c1.a_s3, Decl(commentsClassMembers.ts, 113, 5), Decl(commentsClassMembers.ts, 117, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 120, 20)) + + c1.a_s1 = c1.a_s2(value); +>c1.a_s1 : Symbol(c1.a_s1, Decl(commentsClassMembers.ts, 106, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>a_s1 : Symbol(c1.a_s1, Decl(commentsClassMembers.ts, 106, 5)) +>c1.a_s2 : Symbol(c1.a_s2, Decl(commentsClassMembers.ts, 109, 24)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>a_s2 : Symbol(c1.a_s2, Decl(commentsClassMembers.ts, 109, 24)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 120, 20)) + } + + /** p1 is property of c1 */ + public b_p1: number; +>b_p1 : Symbol(b_p1, Decl(commentsClassMembers.ts, 122, 5)) + + /** sum with property */ + public b_p2(b: number) { +>b_p2 : Symbol(b_p2, Decl(commentsClassMembers.ts, 125, 24)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 127, 16)) + + return this.b_p1 + b; +>this.b_p1 : Symbol(b_p1, Decl(commentsClassMembers.ts, 122, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>b_p1 : Symbol(b_p1, Decl(commentsClassMembers.ts, 122, 5)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 127, 16)) + } + /** getter property */ + public get b_p3() { +>b_p3 : Symbol(b_p3, Decl(commentsClassMembers.ts, 129, 5), Decl(commentsClassMembers.ts, 133, 5)) + + return this.b_p2(this.b_p1); +>this.b_p2 : Symbol(b_p2, Decl(commentsClassMembers.ts, 125, 24)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>b_p2 : Symbol(b_p2, Decl(commentsClassMembers.ts, 125, 24)) +>this.b_p1 : Symbol(b_p1, Decl(commentsClassMembers.ts, 122, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>b_p1 : Symbol(b_p1, Decl(commentsClassMembers.ts, 122, 5)) + } + /** setter property */ + public set b_p3(value: number) { +>b_p3 : Symbol(b_p3, Decl(commentsClassMembers.ts, 129, 5), Decl(commentsClassMembers.ts, 133, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 135, 20)) + + this.b_p1 = this.b_p2(value); +>this.b_p1 : Symbol(b_p1, Decl(commentsClassMembers.ts, 122, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>b_p1 : Symbol(b_p1, Decl(commentsClassMembers.ts, 122, 5)) +>this.b_p2 : Symbol(b_p2, Decl(commentsClassMembers.ts, 125, 24)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>b_p2 : Symbol(b_p2, Decl(commentsClassMembers.ts, 125, 24)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 135, 20)) + } + /** pp1 is property of c1 */ + private b_pp1: number; +>b_pp1 : Symbol(b_pp1, Decl(commentsClassMembers.ts, 137, 5)) + + /** sum with property */ + private b_pp2(b: number) { +>b_pp2 : Symbol(b_pp2, Decl(commentsClassMembers.ts, 139, 26)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 141, 18)) + + return this.b_p1 + b; +>this.b_p1 : Symbol(b_p1, Decl(commentsClassMembers.ts, 122, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>b_p1 : Symbol(b_p1, Decl(commentsClassMembers.ts, 122, 5)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 141, 18)) + } + /** getter property */ + private get b_pp3() { +>b_pp3 : Symbol(b_pp3, Decl(commentsClassMembers.ts, 143, 5), Decl(commentsClassMembers.ts, 147, 5)) + + return this.b_pp2(this.b_pp1); +>this.b_pp2 : Symbol(b_pp2, Decl(commentsClassMembers.ts, 139, 26)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>b_pp2 : Symbol(b_pp2, Decl(commentsClassMembers.ts, 139, 26)) +>this.b_pp1 : Symbol(b_pp1, Decl(commentsClassMembers.ts, 137, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>b_pp1 : Symbol(b_pp1, Decl(commentsClassMembers.ts, 137, 5)) + } + /** setter property */ + private set b_pp3(value: number) { +>b_pp3 : Symbol(b_pp3, Decl(commentsClassMembers.ts, 143, 5), Decl(commentsClassMembers.ts, 147, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 149, 22)) + + this.b_pp1 = this.b_pp2(value); +>this.b_pp1 : Symbol(b_pp1, Decl(commentsClassMembers.ts, 137, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>b_pp1 : Symbol(b_pp1, Decl(commentsClassMembers.ts, 137, 5)) +>this.b_pp2 : Symbol(b_pp2, Decl(commentsClassMembers.ts, 139, 26)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>b_pp2 : Symbol(b_pp2, Decl(commentsClassMembers.ts, 139, 26)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 149, 22)) + } + + /** s1 is static property of c1 */ + static b_s1: number; +>b_s1 : Symbol(c1.b_s1, Decl(commentsClassMembers.ts, 151, 5)) + + /** static sum with property */ + static b_s2(b: number) { +>b_s2 : Symbol(c1.b_s2, Decl(commentsClassMembers.ts, 154, 24)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 156, 16)) + + return c1.b_s1 + b; +>c1.b_s1 : Symbol(c1.b_s1, Decl(commentsClassMembers.ts, 151, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>b_s1 : Symbol(c1.b_s1, Decl(commentsClassMembers.ts, 151, 5)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 156, 16)) + } + /** static getter property + */ + static get b_s3() { +>b_s3 : Symbol(c1.b_s3, Decl(commentsClassMembers.ts, 158, 5), Decl(commentsClassMembers.ts, 163, 5)) + + return c1.s2(c1.s1); +>c1.s2 : Symbol(c1.s2, Decl(commentsClassMembers.ts, 35, 22)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s2 : Symbol(c1.s2, Decl(commentsClassMembers.ts, 35, 22)) +>c1.s1 : Symbol(c1.s1, Decl(commentsClassMembers.ts, 33, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s1 : Symbol(c1.s1, Decl(commentsClassMembers.ts, 33, 5)) + } + + /** setter property + */ + static set b_s3(value: number) { +>b_s3 : Symbol(c1.b_s3, Decl(commentsClassMembers.ts, 158, 5), Decl(commentsClassMembers.ts, 163, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 167, 20)) + + /** setter */ + c1.b_s1 = c1.b_s2(value); +>c1.b_s1 : Symbol(c1.b_s1, Decl(commentsClassMembers.ts, 151, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>b_s1 : Symbol(c1.b_s1, Decl(commentsClassMembers.ts, 151, 5)) +>c1.b_s2 : Symbol(c1.b_s2, Decl(commentsClassMembers.ts, 154, 24)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>b_s2 : Symbol(c1.b_s2, Decl(commentsClassMembers.ts, 154, 24)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 167, 20)) + } +} +var i1 = new c1(); +>i1 : Symbol(i1, Decl(commentsClassMembers.ts, 172, 3)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) + +var i1_p = i1.p1; +>i1_p : Symbol(i1_p, Decl(commentsClassMembers.ts, 173, 3)) +>i1.p1 : Symbol(c1.p1, Decl(commentsClassMembers.ts, 2, 10)) +>i1 : Symbol(i1, Decl(commentsClassMembers.ts, 172, 3)) +>p1 : Symbol(c1.p1, Decl(commentsClassMembers.ts, 2, 10)) + +var i1_f = i1.p2; +>i1_f : Symbol(i1_f, Decl(commentsClassMembers.ts, 174, 3)) +>i1.p2 : Symbol(c1.p2, Decl(commentsClassMembers.ts, 4, 22)) +>i1 : Symbol(i1, Decl(commentsClassMembers.ts, 172, 3)) +>p2 : Symbol(c1.p2, Decl(commentsClassMembers.ts, 4, 22)) + +var i1_r = i1.p2(20); +>i1_r : Symbol(i1_r, Decl(commentsClassMembers.ts, 175, 3)) +>i1.p2 : Symbol(c1.p2, Decl(commentsClassMembers.ts, 4, 22)) +>i1 : Symbol(i1, Decl(commentsClassMembers.ts, 172, 3)) +>p2 : Symbol(c1.p2, Decl(commentsClassMembers.ts, 4, 22)) + +var i1_prop = i1.p3; +>i1_prop : Symbol(i1_prop, Decl(commentsClassMembers.ts, 176, 3)) +>i1.p3 : Symbol(c1.p3, Decl(commentsClassMembers.ts, 8, 5), Decl(commentsClassMembers.ts, 12, 5)) +>i1 : Symbol(i1, Decl(commentsClassMembers.ts, 172, 3)) +>p3 : Symbol(c1.p3, Decl(commentsClassMembers.ts, 8, 5), Decl(commentsClassMembers.ts, 12, 5)) + +i1.p3 = i1_prop; +>i1.p3 : Symbol(c1.p3, Decl(commentsClassMembers.ts, 8, 5), Decl(commentsClassMembers.ts, 12, 5)) +>i1 : Symbol(i1, Decl(commentsClassMembers.ts, 172, 3)) +>p3 : Symbol(c1.p3, Decl(commentsClassMembers.ts, 8, 5), Decl(commentsClassMembers.ts, 12, 5)) +>i1_prop : Symbol(i1_prop, Decl(commentsClassMembers.ts, 176, 3)) + +var i1_nc_p = i1.nc_p1; +>i1_nc_p : Symbol(i1_nc_p, Decl(commentsClassMembers.ts, 178, 3)) +>i1.nc_p1 : Symbol(c1.nc_p1, Decl(commentsClassMembers.ts, 47, 5)) +>i1 : Symbol(i1, Decl(commentsClassMembers.ts, 172, 3)) +>nc_p1 : Symbol(c1.nc_p1, Decl(commentsClassMembers.ts, 47, 5)) + +var i1_ncf = i1.nc_p2; +>i1_ncf : Symbol(i1_ncf, Decl(commentsClassMembers.ts, 179, 3)) +>i1.nc_p2 : Symbol(c1.nc_p2, Decl(commentsClassMembers.ts, 48, 25)) +>i1 : Symbol(i1, Decl(commentsClassMembers.ts, 172, 3)) +>nc_p2 : Symbol(c1.nc_p2, Decl(commentsClassMembers.ts, 48, 25)) + +var i1_ncr = i1.nc_p2(20); +>i1_ncr : Symbol(i1_ncr, Decl(commentsClassMembers.ts, 180, 3)) +>i1.nc_p2 : Symbol(c1.nc_p2, Decl(commentsClassMembers.ts, 48, 25)) +>i1 : Symbol(i1, Decl(commentsClassMembers.ts, 172, 3)) +>nc_p2 : Symbol(c1.nc_p2, Decl(commentsClassMembers.ts, 48, 25)) + +var i1_ncprop = i1.nc_p3; +>i1_ncprop : Symbol(i1_ncprop, Decl(commentsClassMembers.ts, 181, 3)) +>i1.nc_p3 : Symbol(c1.nc_p3, Decl(commentsClassMembers.ts, 51, 5), Decl(commentsClassMembers.ts, 54, 5)) +>i1 : Symbol(i1, Decl(commentsClassMembers.ts, 172, 3)) +>nc_p3 : Symbol(c1.nc_p3, Decl(commentsClassMembers.ts, 51, 5), Decl(commentsClassMembers.ts, 54, 5)) + +i1.nc_p3 = i1_ncprop; +>i1.nc_p3 : Symbol(c1.nc_p3, Decl(commentsClassMembers.ts, 51, 5), Decl(commentsClassMembers.ts, 54, 5)) +>i1 : Symbol(i1, Decl(commentsClassMembers.ts, 172, 3)) +>nc_p3 : Symbol(c1.nc_p3, Decl(commentsClassMembers.ts, 51, 5), Decl(commentsClassMembers.ts, 54, 5)) +>i1_ncprop : Symbol(i1_ncprop, Decl(commentsClassMembers.ts, 181, 3)) + +var i1_s_p = c1.s1; +>i1_s_p : Symbol(i1_s_p, Decl(commentsClassMembers.ts, 183, 3)) +>c1.s1 : Symbol(c1.s1, Decl(commentsClassMembers.ts, 33, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s1 : Symbol(c1.s1, Decl(commentsClassMembers.ts, 33, 5)) + +var i1_s_f = c1.s2; +>i1_s_f : Symbol(i1_s_f, Decl(commentsClassMembers.ts, 184, 3)) +>c1.s2 : Symbol(c1.s2, Decl(commentsClassMembers.ts, 35, 22)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s2 : Symbol(c1.s2, Decl(commentsClassMembers.ts, 35, 22)) + +var i1_s_r = c1.s2(20); +>i1_s_r : Symbol(i1_s_r, Decl(commentsClassMembers.ts, 185, 3)) +>c1.s2 : Symbol(c1.s2, Decl(commentsClassMembers.ts, 35, 22)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s2 : Symbol(c1.s2, Decl(commentsClassMembers.ts, 35, 22)) + +var i1_s_prop = c1.s3; +>i1_s_prop : Symbol(i1_s_prop, Decl(commentsClassMembers.ts, 186, 3)) +>c1.s3 : Symbol(c1.s3, Decl(commentsClassMembers.ts, 39, 5), Decl(commentsClassMembers.ts, 43, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s3 : Symbol(c1.s3, Decl(commentsClassMembers.ts, 39, 5), Decl(commentsClassMembers.ts, 43, 5)) + +c1.s3 = i1_s_prop; +>c1.s3 : Symbol(c1.s3, Decl(commentsClassMembers.ts, 39, 5), Decl(commentsClassMembers.ts, 43, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s3 : Symbol(c1.s3, Decl(commentsClassMembers.ts, 39, 5), Decl(commentsClassMembers.ts, 43, 5)) +>i1_s_prop : Symbol(i1_s_prop, Decl(commentsClassMembers.ts, 186, 3)) + +var i1_s_nc_p = c1.nc_s1; +>i1_s_nc_p : Symbol(i1_s_nc_p, Decl(commentsClassMembers.ts, 188, 3)) +>c1.nc_s1 : Symbol(c1.nc_s1, Decl(commentsClassMembers.ts, 67, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_s1 : Symbol(c1.nc_s1, Decl(commentsClassMembers.ts, 67, 5)) + +var i1_s_ncf = c1.nc_s2; +>i1_s_ncf : Symbol(i1_s_ncf, Decl(commentsClassMembers.ts, 189, 3)) +>c1.nc_s2 : Symbol(c1.nc_s2, Decl(commentsClassMembers.ts, 68, 25)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_s2 : Symbol(c1.nc_s2, Decl(commentsClassMembers.ts, 68, 25)) + +var i1_s_ncr = c1.nc_s2(20); +>i1_s_ncr : Symbol(i1_s_ncr, Decl(commentsClassMembers.ts, 190, 3)) +>c1.nc_s2 : Symbol(c1.nc_s2, Decl(commentsClassMembers.ts, 68, 25)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_s2 : Symbol(c1.nc_s2, Decl(commentsClassMembers.ts, 68, 25)) + +var i1_s_ncprop = c1.nc_s3; +>i1_s_ncprop : Symbol(i1_s_ncprop, Decl(commentsClassMembers.ts, 191, 3)) +>c1.nc_s3 : Symbol(c1.nc_s3, Decl(commentsClassMembers.ts, 71, 5), Decl(commentsClassMembers.ts, 74, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_s3 : Symbol(c1.nc_s3, Decl(commentsClassMembers.ts, 71, 5), Decl(commentsClassMembers.ts, 74, 5)) + +c1.nc_s3 = i1_s_ncprop; +>c1.nc_s3 : Symbol(c1.nc_s3, Decl(commentsClassMembers.ts, 71, 5), Decl(commentsClassMembers.ts, 74, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_s3 : Symbol(c1.nc_s3, Decl(commentsClassMembers.ts, 71, 5), Decl(commentsClassMembers.ts, 74, 5)) +>i1_s_ncprop : Symbol(i1_s_ncprop, Decl(commentsClassMembers.ts, 191, 3)) + +var i1_c = c1; +>i1_c : Symbol(i1_c, Decl(commentsClassMembers.ts, 193, 3)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) + +class cProperties { +>cProperties : Symbol(cProperties, Decl(commentsClassMembers.ts, 193, 14)) + + private val: number; +>val : Symbol(val, Decl(commentsClassMembers.ts, 194, 19)) + + /** getter only property*/ + public get p1() { +>p1 : Symbol(p1, Decl(commentsClassMembers.ts, 195, 24)) + + return this.val; +>this.val : Symbol(val, Decl(commentsClassMembers.ts, 194, 19)) +>this : Symbol(cProperties, Decl(commentsClassMembers.ts, 193, 14)) +>val : Symbol(val, Decl(commentsClassMembers.ts, 194, 19)) + + } // trailing comment of only getter + public get nc_p1() { +>nc_p1 : Symbol(nc_p1, Decl(commentsClassMembers.ts, 199, 5)) + + return this.val; +>this.val : Symbol(val, Decl(commentsClassMembers.ts, 194, 19)) +>this : Symbol(cProperties, Decl(commentsClassMembers.ts, 193, 14)) +>val : Symbol(val, Decl(commentsClassMembers.ts, 194, 19)) + } + /**setter only property*/ + public set p2(value: number) { +>p2 : Symbol(p2, Decl(commentsClassMembers.ts, 202, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 204, 18)) + + this.val = value; +>this.val : Symbol(val, Decl(commentsClassMembers.ts, 194, 19)) +>this : Symbol(cProperties, Decl(commentsClassMembers.ts, 193, 14)) +>val : Symbol(val, Decl(commentsClassMembers.ts, 194, 19)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 204, 18)) + } + public set nc_p2(value: number) { +>nc_p2 : Symbol(nc_p2, Decl(commentsClassMembers.ts, 206, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 207, 21)) + + this.val = value; +>this.val : Symbol(val, Decl(commentsClassMembers.ts, 194, 19)) +>this : Symbol(cProperties, Decl(commentsClassMembers.ts, 193, 14)) +>val : Symbol(val, Decl(commentsClassMembers.ts, 194, 19)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 207, 21)) + + } /* trailing comment of setter only*/ + + public x = 10; /*trailing comment for property*/ +>x : Symbol(x, Decl(commentsClassMembers.ts, 209, 5)) + + private y = 10; // trailing comment of // style +>y : Symbol(y, Decl(commentsClassMembers.ts, 211, 18)) +} +var cProperties_i = new cProperties(); +>cProperties_i : Symbol(cProperties_i, Decl(commentsClassMembers.ts, 214, 3)) +>cProperties : Symbol(cProperties, Decl(commentsClassMembers.ts, 193, 14)) + +cProperties_i.p2 = cProperties_i.p1; +>cProperties_i.p2 : Symbol(cProperties.p2, Decl(commentsClassMembers.ts, 202, 5)) +>cProperties_i : Symbol(cProperties_i, Decl(commentsClassMembers.ts, 214, 3)) +>p2 : Symbol(cProperties.p2, Decl(commentsClassMembers.ts, 202, 5)) +>cProperties_i.p1 : Symbol(cProperties.p1, Decl(commentsClassMembers.ts, 195, 24)) +>cProperties_i : Symbol(cProperties_i, Decl(commentsClassMembers.ts, 214, 3)) +>p1 : Symbol(cProperties.p1, Decl(commentsClassMembers.ts, 195, 24)) + +cProperties_i.nc_p2 = cProperties_i.nc_p1; +>cProperties_i.nc_p2 : Symbol(cProperties.nc_p2, Decl(commentsClassMembers.ts, 206, 5)) +>cProperties_i : Symbol(cProperties_i, Decl(commentsClassMembers.ts, 214, 3)) +>nc_p2 : Symbol(cProperties.nc_p2, Decl(commentsClassMembers.ts, 206, 5)) +>cProperties_i.nc_p1 : Symbol(cProperties.nc_p1, Decl(commentsClassMembers.ts, 199, 5)) +>cProperties_i : Symbol(cProperties_i, Decl(commentsClassMembers.ts, 214, 3)) +>nc_p1 : Symbol(cProperties.nc_p1, Decl(commentsClassMembers.ts, 199, 5)) + diff --git a/tests/baselines/reference/commentsClassMembers.types b/tests/baselines/reference/commentsClassMembers.types index d71ccd2e1e8..fbd514bf77b 100644 --- a/tests/baselines/reference/commentsClassMembers.types +++ b/tests/baselines/reference/commentsClassMembers.types @@ -574,6 +574,7 @@ var i1_r = i1.p2(20); >i1.p2 : (b: number) => number >i1 : c1 >p2 : (b: number) => number +>20 : number var i1_prop = i1.p3; >i1_prop : number @@ -606,6 +607,7 @@ var i1_ncr = i1.nc_p2(20); >i1.nc_p2 : (b: number) => number >i1 : c1 >nc_p2 : (b: number) => number +>20 : number var i1_ncprop = i1.nc_p3; >i1_ncprop : number @@ -638,6 +640,7 @@ var i1_s_r = c1.s2(20); >c1.s2 : (b: number) => number >c1 : typeof c1 >s2 : (b: number) => number +>20 : number var i1_s_prop = c1.s3; >i1_s_prop : number @@ -670,6 +673,7 @@ var i1_s_ncr = c1.nc_s2(20); >c1.nc_s2 : (b: number) => number >c1 : typeof c1 >nc_s2 : (b: number) => number +>20 : number var i1_s_ncprop = c1.nc_s3; >i1_s_ncprop : number @@ -739,9 +743,11 @@ class cProperties { public x = 10; /*trailing comment for property*/ >x : number +>10 : number private y = 10; // trailing comment of // style >y : number +>10 : number } var cProperties_i = new cProperties(); >cProperties_i : cProperties diff --git a/tests/baselines/reference/commentsCommentParsing.symbols b/tests/baselines/reference/commentsCommentParsing.symbols new file mode 100644 index 00000000000..abd98074b52 --- /dev/null +++ b/tests/baselines/reference/commentsCommentParsing.symbols @@ -0,0 +1,235 @@ +=== tests/cases/compiler/commentsCommentParsing.ts === + +/// This is simple /// comments +function simple() { +>simple : Symbol(simple, Decl(commentsCommentParsing.ts, 0, 0)) +} + +simple(); +>simple : Symbol(simple, Decl(commentsCommentParsing.ts, 0, 0)) + +/// multiLine /// Comments +/// This is example of multiline /// comments +/// Another multiLine +function multiLine() { +>multiLine : Symbol(multiLine, Decl(commentsCommentParsing.ts, 5, 9)) +} +multiLine(); +>multiLine : Symbol(multiLine, Decl(commentsCommentParsing.ts, 5, 9)) + +/** this is eg of single line jsdoc style comment */ +function jsDocSingleLine() { +>jsDocSingleLine : Symbol(jsDocSingleLine, Decl(commentsCommentParsing.ts, 12, 12)) +} +jsDocSingleLine(); +>jsDocSingleLine : Symbol(jsDocSingleLine, Decl(commentsCommentParsing.ts, 12, 12)) + + +/** this is multiple line jsdoc stule comment +*New line1 +*New Line2*/ +function jsDocMultiLine() { +>jsDocMultiLine : Symbol(jsDocMultiLine, Decl(commentsCommentParsing.ts, 17, 18)) +} +jsDocMultiLine(); +>jsDocMultiLine : Symbol(jsDocMultiLine, Decl(commentsCommentParsing.ts, 17, 18)) + +/** this is multiple line jsdoc stule comment +*New line1 +*New Line2*/ +/** Shoul mege this line as well +* and this too*/ /** Another this one too*/ +function jsDocMultiLineMerge() { +>jsDocMultiLineMerge : Symbol(jsDocMultiLineMerge, Decl(commentsCommentParsing.ts, 25, 17)) +} +jsDocMultiLineMerge(); +>jsDocMultiLineMerge : Symbol(jsDocMultiLineMerge, Decl(commentsCommentParsing.ts, 25, 17)) + + +/// Triple slash comment +/** jsdoc comment */ +function jsDocMixedComments1() { +>jsDocMixedComments1 : Symbol(jsDocMixedComments1, Decl(commentsCommentParsing.ts, 34, 22)) +} +jsDocMixedComments1(); +>jsDocMixedComments1 : Symbol(jsDocMixedComments1, Decl(commentsCommentParsing.ts, 34, 22)) + +/// Triple slash comment +/** jsdoc comment */ /*** another jsDocComment*/ +function jsDocMixedComments2() { +>jsDocMixedComments2 : Symbol(jsDocMixedComments2, Decl(commentsCommentParsing.ts, 41, 22)) +} +jsDocMixedComments2(); +>jsDocMixedComments2 : Symbol(jsDocMixedComments2, Decl(commentsCommentParsing.ts, 41, 22)) + +/** jsdoc comment */ /*** another jsDocComment*/ +/// Triple slash comment +function jsDocMixedComments3() { +>jsDocMixedComments3 : Symbol(jsDocMixedComments3, Decl(commentsCommentParsing.ts, 47, 22)) +} +jsDocMixedComments3(); +>jsDocMixedComments3 : Symbol(jsDocMixedComments3, Decl(commentsCommentParsing.ts, 47, 22)) + +/** jsdoc comment */ /*** another jsDocComment*/ +/// Triple slash comment +/// Triple slash comment 2 +function jsDocMixedComments4() { +>jsDocMixedComments4 : Symbol(jsDocMixedComments4, Decl(commentsCommentParsing.ts, 53, 22)) +} +jsDocMixedComments4(); +>jsDocMixedComments4 : Symbol(jsDocMixedComments4, Decl(commentsCommentParsing.ts, 53, 22)) + +/// Triple slash comment 1 +/** jsdoc comment */ /*** another jsDocComment*/ +/// Triple slash comment +/// Triple slash comment 2 +function jsDocMixedComments5() { +>jsDocMixedComments5 : Symbol(jsDocMixedComments5, Decl(commentsCommentParsing.ts, 60, 22)) +} +jsDocMixedComments5(); +>jsDocMixedComments5 : Symbol(jsDocMixedComments5, Decl(commentsCommentParsing.ts, 60, 22)) + +/*** another jsDocComment*/ +/// Triple slash comment 1 +/// Triple slash comment +/// Triple slash comment 2 +/** jsdoc comment */ +function jsDocMixedComments6() { +>jsDocMixedComments6 : Symbol(jsDocMixedComments6, Decl(commentsCommentParsing.ts, 68, 22)) +} +jsDocMixedComments6(); +>jsDocMixedComments6 : Symbol(jsDocMixedComments6, Decl(commentsCommentParsing.ts, 68, 22)) + +// This shoulnot be help comment +function noHelpComment1() { +>noHelpComment1 : Symbol(noHelpComment1, Decl(commentsCommentParsing.ts, 77, 22)) +} +noHelpComment1(); +>noHelpComment1 : Symbol(noHelpComment1, Decl(commentsCommentParsing.ts, 77, 22)) + +/* This shoulnot be help comment */ +function noHelpComment2() { +>noHelpComment2 : Symbol(noHelpComment2, Decl(commentsCommentParsing.ts, 82, 17)) +} +noHelpComment2(); +>noHelpComment2 : Symbol(noHelpComment2, Decl(commentsCommentParsing.ts, 82, 17)) + +function noHelpComment3() { +>noHelpComment3 : Symbol(noHelpComment3, Decl(commentsCommentParsing.ts, 87, 17)) +} +noHelpComment3(); +>noHelpComment3 : Symbol(noHelpComment3, Decl(commentsCommentParsing.ts, 87, 17)) + +/** Adds two integers and returns the result + * @param {number} a first number + * @param b second number + */ +function sum(a: number, b: number) { +>sum : Symbol(sum, Decl(commentsCommentParsing.ts, 91, 17)) +>a : Symbol(a, Decl(commentsCommentParsing.ts, 96, 13)) +>b : Symbol(b, Decl(commentsCommentParsing.ts, 96, 23)) + + return a + b; +>a : Symbol(a, Decl(commentsCommentParsing.ts, 96, 13)) +>b : Symbol(b, Decl(commentsCommentParsing.ts, 96, 23)) +} +sum(10, 20); +>sum : Symbol(sum, Decl(commentsCommentParsing.ts, 91, 17)) + +/** This is multiplication function*/ +/** @param */ +/** @param a first number*/ +/** @param b */ +/** @param c { + @param d @anotherTag*/ +/** @param e LastParam @anotherTag*/ +function multiply(a: number, b: number, c?: number, d?, e?) { +>multiply : Symbol(multiply, Decl(commentsCommentParsing.ts, 99, 12)) +>a : Symbol(a, Decl(commentsCommentParsing.ts, 107, 18)) +>b : Symbol(b, Decl(commentsCommentParsing.ts, 107, 28)) +>c : Symbol(c, Decl(commentsCommentParsing.ts, 107, 39)) +>d : Symbol(d, Decl(commentsCommentParsing.ts, 107, 51)) +>e : Symbol(e, Decl(commentsCommentParsing.ts, 107, 55)) +} +/** fn f1 with number +* @param { string} b about b +*/ +function f1(a: number); +>f1 : Symbol(f1, Decl(commentsCommentParsing.ts, 108, 1), Decl(commentsCommentParsing.ts, 112, 23), Decl(commentsCommentParsing.ts, 113, 23)) +>a : Symbol(a, Decl(commentsCommentParsing.ts, 112, 12)) + +function f1(b: string); +>f1 : Symbol(f1, Decl(commentsCommentParsing.ts, 108, 1), Decl(commentsCommentParsing.ts, 112, 23), Decl(commentsCommentParsing.ts, 113, 23)) +>b : Symbol(b, Decl(commentsCommentParsing.ts, 113, 12)) + +/**@param opt optional parameter*/ +function f1(aOrb, opt?) { +>f1 : Symbol(f1, Decl(commentsCommentParsing.ts, 108, 1), Decl(commentsCommentParsing.ts, 112, 23), Decl(commentsCommentParsing.ts, 113, 23)) +>aOrb : Symbol(aOrb, Decl(commentsCommentParsing.ts, 115, 12)) +>opt : Symbol(opt, Decl(commentsCommentParsing.ts, 115, 17)) + + return aOrb; +>aOrb : Symbol(aOrb, Decl(commentsCommentParsing.ts, 115, 12)) +} +/** This is subtract function +@param { a +*@param { number | } b this is about b +@param { { () => string; } } c this is optional param c +@param { { () => string; } d this is optional param d +@param { { () => string; } } e this is optional param e +@param { { { () => string; } } f this is optional param f +*/ +function subtract(a: number, b: number, c?: () => string, d?: () => string, e?: () => string, f?: () => string) { +>subtract : Symbol(subtract, Decl(commentsCommentParsing.ts, 117, 1)) +>a : Symbol(a, Decl(commentsCommentParsing.ts, 126, 18)) +>b : Symbol(b, Decl(commentsCommentParsing.ts, 126, 28)) +>c : Symbol(c, Decl(commentsCommentParsing.ts, 126, 39)) +>d : Symbol(d, Decl(commentsCommentParsing.ts, 126, 57)) +>e : Symbol(e, Decl(commentsCommentParsing.ts, 126, 75)) +>f : Symbol(f, Decl(commentsCommentParsing.ts, 126, 93)) +} +/** this is square function +@paramTag { number } a this is input number of paramTag +@param { number } a this is input number +@returnType { number } it is return type +*/ +function square(a: number) { +>square : Symbol(square, Decl(commentsCommentParsing.ts, 127, 1)) +>a : Symbol(a, Decl(commentsCommentParsing.ts, 133, 16)) + + return a * a; +>a : Symbol(a, Decl(commentsCommentParsing.ts, 133, 16)) +>a : Symbol(a, Decl(commentsCommentParsing.ts, 133, 16)) +} +/** this is divide function +@param { number} a this is a +@paramTag { number } g this is optional param g +@param { number} b this is b +*/ +function divide(a: number, b: number) { +>divide : Symbol(divide, Decl(commentsCommentParsing.ts, 135, 1)) +>a : Symbol(a, Decl(commentsCommentParsing.ts, 141, 16)) +>b : Symbol(b, Decl(commentsCommentParsing.ts, 141, 26)) +} +/** this is jsdoc style function with param tag as well as inline parameter help +*@param a it is first parameter +*@param c it is third parameter +*/ +function jsDocParamTest(/** this is inline comment for a */a: number, /** this is inline comment for b*/ b: number, c: number, d: number) { +>jsDocParamTest : Symbol(jsDocParamTest, Decl(commentsCommentParsing.ts, 142, 1)) +>a : Symbol(a, Decl(commentsCommentParsing.ts, 147, 24)) +>b : Symbol(b, Decl(commentsCommentParsing.ts, 147, 69)) +>c : Symbol(c, Decl(commentsCommentParsing.ts, 147, 115)) +>d : Symbol(d, Decl(commentsCommentParsing.ts, 147, 126)) + + return a + b + c + d; +>a : Symbol(a, Decl(commentsCommentParsing.ts, 147, 24)) +>b : Symbol(b, Decl(commentsCommentParsing.ts, 147, 69)) +>c : Symbol(c, Decl(commentsCommentParsing.ts, 147, 115)) +>d : Symbol(d, Decl(commentsCommentParsing.ts, 147, 126)) +} + +/**/ +class NoQuickInfoClass { +>NoQuickInfoClass : Symbol(NoQuickInfoClass, Decl(commentsCommentParsing.ts, 149, 1)) +} diff --git a/tests/baselines/reference/commentsCommentParsing.types b/tests/baselines/reference/commentsCommentParsing.types index a9194f9a63a..a6e24609642 100644 --- a/tests/baselines/reference/commentsCommentParsing.types +++ b/tests/baselines/reference/commentsCommentParsing.types @@ -151,6 +151,8 @@ function sum(a: number, b: number) { sum(10, 20); >sum(10, 20) : number >sum : (a: number, b: number) => number +>10 : number +>20 : number /** This is multiplication function*/ /** @param */ diff --git a/tests/baselines/reference/commentsDottedModuleName.symbols b/tests/baselines/reference/commentsDottedModuleName.symbols new file mode 100644 index 00000000000..99083b11e3c --- /dev/null +++ b/tests/baselines/reference/commentsDottedModuleName.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/commentsDottedModuleName.ts === + +/** this is multi declare module*/ +export module outerModule.InnerModule { +>outerModule : Symbol(outerModule, Decl(commentsDottedModuleName.ts, 0, 0)) +>InnerModule : Symbol(InnerModule, Decl(commentsDottedModuleName.ts, 2, 26)) + + /// class b comment + export class b { +>b : Symbol(b, Decl(commentsDottedModuleName.ts, 2, 39)) + } +} diff --git a/tests/baselines/reference/commentsEnums.symbols b/tests/baselines/reference/commentsEnums.symbols new file mode 100644 index 00000000000..0f5910f4ee7 --- /dev/null +++ b/tests/baselines/reference/commentsEnums.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/commentsEnums.ts === + +/** Enum of colors*/ +enum Colors { +>Colors : Symbol(Colors, Decl(commentsEnums.ts, 0, 0)) + + /** Fancy name for 'blue'*/ + Cornflower /* blue */, +>Cornflower : Symbol(Colors.Cornflower, Decl(commentsEnums.ts, 2, 13)) + + /** Fancy name for 'pink'*/ + FancyPink +>FancyPink : Symbol(Colors.FancyPink, Decl(commentsEnums.ts, 4, 26)) + +} // trailing comment +var x = Colors.Cornflower; +>x : Symbol(x, Decl(commentsEnums.ts, 8, 3)) +>Colors.Cornflower : Symbol(Colors.Cornflower, Decl(commentsEnums.ts, 2, 13)) +>Colors : Symbol(Colors, Decl(commentsEnums.ts, 0, 0)) +>Cornflower : Symbol(Colors.Cornflower, Decl(commentsEnums.ts, 2, 13)) + +x = Colors.FancyPink; +>x : Symbol(x, Decl(commentsEnums.ts, 8, 3)) +>Colors.FancyPink : Symbol(Colors.FancyPink, Decl(commentsEnums.ts, 4, 26)) +>Colors : Symbol(Colors, Decl(commentsEnums.ts, 0, 0)) +>FancyPink : Symbol(Colors.FancyPink, Decl(commentsEnums.ts, 4, 26)) + + diff --git a/tests/baselines/reference/commentsExternalModules.symbols b/tests/baselines/reference/commentsExternalModules.symbols new file mode 100644 index 00000000000..6f7852245dd --- /dev/null +++ b/tests/baselines/reference/commentsExternalModules.symbols @@ -0,0 +1,143 @@ +=== tests/cases/compiler/commentsExternalModules_1.ts === +/**This is on import declaration*/ +import extMod = require("commentsExternalModules_0"); // trailing comment1 +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) + +extMod.m1.fooExport(); +>extMod.m1.fooExport : Symbol(extMod.m1.fooExport, Decl(commentsExternalModules_0.ts, 16, 5)) +>extMod.m1 : Symbol(extMod.m1, Decl(commentsExternalModules_0.ts, 0, 0)) +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) +>m1 : Symbol(extMod.m1, Decl(commentsExternalModules_0.ts, 0, 0)) +>fooExport : Symbol(extMod.m1.fooExport, Decl(commentsExternalModules_0.ts, 16, 5)) + +var newVar = new extMod.m1.m2.c(); +>newVar : Symbol(newVar, Decl(commentsExternalModules_1.ts, 3, 3)) +>extMod.m1.m2.c : Symbol(extMod.m1.m2.c, Decl(commentsExternalModules_0.ts, 10, 22)) +>extMod.m1.m2 : Symbol(extMod.m1.m2, Decl(commentsExternalModules_0.ts, 8, 5)) +>extMod.m1 : Symbol(extMod.m1, Decl(commentsExternalModules_0.ts, 0, 0)) +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) +>m1 : Symbol(extMod.m1, Decl(commentsExternalModules_0.ts, 0, 0)) +>m2 : Symbol(extMod.m1.m2, Decl(commentsExternalModules_0.ts, 8, 5)) +>c : Symbol(extMod.m1.m2.c, Decl(commentsExternalModules_0.ts, 10, 22)) + +extMod.m4.fooExport(); +>extMod.m4.fooExport : Symbol(extMod.m4.fooExport, Decl(commentsExternalModules_0.ts, 42, 5)) +>extMod.m4 : Symbol(extMod.m4, Decl(commentsExternalModules_0.ts, 23, 26)) +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) +>m4 : Symbol(extMod.m4, Decl(commentsExternalModules_0.ts, 23, 26)) +>fooExport : Symbol(extMod.m4.fooExport, Decl(commentsExternalModules_0.ts, 42, 5)) + +var newVar2 = new extMod.m4.m2.c(); +>newVar2 : Symbol(newVar2, Decl(commentsExternalModules_1.ts, 5, 3)) +>extMod.m4.m2.c : Symbol(extMod.m4.m2.c, Decl(commentsExternalModules_0.ts, 36, 22)) +>extMod.m4.m2 : Symbol(extMod.m4.m2, Decl(commentsExternalModules_0.ts, 33, 5)) +>extMod.m4 : Symbol(extMod.m4, Decl(commentsExternalModules_0.ts, 23, 26)) +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) +>m4 : Symbol(extMod.m4, Decl(commentsExternalModules_0.ts, 23, 26)) +>m2 : Symbol(extMod.m4.m2, Decl(commentsExternalModules_0.ts, 33, 5)) +>c : Symbol(extMod.m4.m2.c, Decl(commentsExternalModules_0.ts, 36, 22)) + +=== tests/cases/compiler/commentsExternalModules_0.ts === + +/** Module comment*/ +export module m1 { +>m1 : Symbol(m1, Decl(commentsExternalModules_0.ts, 0, 0)) + + /** b's comment*/ + export var b: number; +>b : Symbol(b, Decl(commentsExternalModules_0.ts, 4, 14)) + + /** foo's comment*/ + function foo() { +>foo : Symbol(foo, Decl(commentsExternalModules_0.ts, 4, 25)) + + return b; +>b : Symbol(b, Decl(commentsExternalModules_0.ts, 4, 14)) + } + /** m2 comments*/ + export module m2 { +>m2 : Symbol(m2, Decl(commentsExternalModules_0.ts, 8, 5)) + + /** class comment;*/ + export class c { +>c : Symbol(c, Decl(commentsExternalModules_0.ts, 10, 22)) + + }; + /** i*/ + export var i = new c(); +>i : Symbol(i, Decl(commentsExternalModules_0.ts, 15, 18)) +>c : Symbol(c, Decl(commentsExternalModules_0.ts, 10, 22)) + } + /** exported function*/ + export function fooExport() { +>fooExport : Symbol(fooExport, Decl(commentsExternalModules_0.ts, 16, 5)) + + return foo(); +>foo : Symbol(foo, Decl(commentsExternalModules_0.ts, 4, 25)) + } +} +m1.fooExport(); +>m1.fooExport : Symbol(m1.fooExport, Decl(commentsExternalModules_0.ts, 16, 5)) +>m1 : Symbol(m1, Decl(commentsExternalModules_0.ts, 0, 0)) +>fooExport : Symbol(m1.fooExport, Decl(commentsExternalModules_0.ts, 16, 5)) + +var myvar = new m1.m2.c(); +>myvar : Symbol(myvar, Decl(commentsExternalModules_0.ts, 23, 3)) +>m1.m2.c : Symbol(m1.m2.c, Decl(commentsExternalModules_0.ts, 10, 22)) +>m1.m2 : Symbol(m1.m2, Decl(commentsExternalModules_0.ts, 8, 5)) +>m1 : Symbol(m1, Decl(commentsExternalModules_0.ts, 0, 0)) +>m2 : Symbol(m1.m2, Decl(commentsExternalModules_0.ts, 8, 5)) +>c : Symbol(m1.m2.c, Decl(commentsExternalModules_0.ts, 10, 22)) + +/** Module comment */ +export module m4 { +>m4 : Symbol(m4, Decl(commentsExternalModules_0.ts, 23, 26)) + + /** b's comment */ + export var b: number; +>b : Symbol(b, Decl(commentsExternalModules_0.ts, 28, 14)) + + /** foo's comment + */ + function foo() { +>foo : Symbol(foo, Decl(commentsExternalModules_0.ts, 28, 25)) + + return b; +>b : Symbol(b, Decl(commentsExternalModules_0.ts, 28, 14)) + } + /** m2 comments + */ + export module m2 { +>m2 : Symbol(m2, Decl(commentsExternalModules_0.ts, 33, 5)) + + /** class comment; */ + export class c { +>c : Symbol(c, Decl(commentsExternalModules_0.ts, 36, 22)) + + }; + /** i */ + export var i = new c(); +>i : Symbol(i, Decl(commentsExternalModules_0.ts, 41, 18)) +>c : Symbol(c, Decl(commentsExternalModules_0.ts, 36, 22)) + } + /** exported function */ + export function fooExport() { +>fooExport : Symbol(fooExport, Decl(commentsExternalModules_0.ts, 42, 5)) + + return foo(); +>foo : Symbol(foo, Decl(commentsExternalModules_0.ts, 28, 25)) + } +} +m4.fooExport(); +>m4.fooExport : Symbol(m4.fooExport, Decl(commentsExternalModules_0.ts, 42, 5)) +>m4 : Symbol(m4, Decl(commentsExternalModules_0.ts, 23, 26)) +>fooExport : Symbol(m4.fooExport, Decl(commentsExternalModules_0.ts, 42, 5)) + +var myvar2 = new m4.m2.c(); +>myvar2 : Symbol(myvar2, Decl(commentsExternalModules_0.ts, 49, 3)) +>m4.m2.c : Symbol(m4.m2.c, Decl(commentsExternalModules_0.ts, 36, 22)) +>m4.m2 : Symbol(m4.m2, Decl(commentsExternalModules_0.ts, 33, 5)) +>m4 : Symbol(m4, Decl(commentsExternalModules_0.ts, 23, 26)) +>m2 : Symbol(m4.m2, Decl(commentsExternalModules_0.ts, 33, 5)) +>c : Symbol(m4.m2.c, Decl(commentsExternalModules_0.ts, 36, 22)) + diff --git a/tests/baselines/reference/commentsExternalModules2.symbols b/tests/baselines/reference/commentsExternalModules2.symbols new file mode 100644 index 00000000000..cfd01db377d --- /dev/null +++ b/tests/baselines/reference/commentsExternalModules2.symbols @@ -0,0 +1,143 @@ +=== tests/cases/compiler/commentsExternalModules_1.ts === +/**This is on import declaration*/ +import extMod = require("commentsExternalModules2_0"); // trailing comment 1 +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) + +extMod.m1.fooExport(); +>extMod.m1.fooExport : Symbol(extMod.m1.fooExport, Decl(commentsExternalModules2_0.ts, 16, 5)) +>extMod.m1 : Symbol(extMod.m1, Decl(commentsExternalModules2_0.ts, 0, 0)) +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) +>m1 : Symbol(extMod.m1, Decl(commentsExternalModules2_0.ts, 0, 0)) +>fooExport : Symbol(extMod.m1.fooExport, Decl(commentsExternalModules2_0.ts, 16, 5)) + +export var newVar = new extMod.m1.m2.c(); +>newVar : Symbol(newVar, Decl(commentsExternalModules_1.ts, 3, 10)) +>extMod.m1.m2.c : Symbol(extMod.m1.m2.c, Decl(commentsExternalModules2_0.ts, 10, 22)) +>extMod.m1.m2 : Symbol(extMod.m1.m2, Decl(commentsExternalModules2_0.ts, 8, 5)) +>extMod.m1 : Symbol(extMod.m1, Decl(commentsExternalModules2_0.ts, 0, 0)) +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) +>m1 : Symbol(extMod.m1, Decl(commentsExternalModules2_0.ts, 0, 0)) +>m2 : Symbol(extMod.m1.m2, Decl(commentsExternalModules2_0.ts, 8, 5)) +>c : Symbol(extMod.m1.m2.c, Decl(commentsExternalModules2_0.ts, 10, 22)) + +extMod.m4.fooExport(); +>extMod.m4.fooExport : Symbol(extMod.m4.fooExport, Decl(commentsExternalModules2_0.ts, 42, 5)) +>extMod.m4 : Symbol(extMod.m4, Decl(commentsExternalModules2_0.ts, 23, 26)) +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) +>m4 : Symbol(extMod.m4, Decl(commentsExternalModules2_0.ts, 23, 26)) +>fooExport : Symbol(extMod.m4.fooExport, Decl(commentsExternalModules2_0.ts, 42, 5)) + +export var newVar2 = new extMod.m4.m2.c(); +>newVar2 : Symbol(newVar2, Decl(commentsExternalModules_1.ts, 5, 10)) +>extMod.m4.m2.c : Symbol(extMod.m4.m2.c, Decl(commentsExternalModules2_0.ts, 36, 22)) +>extMod.m4.m2 : Symbol(extMod.m4.m2, Decl(commentsExternalModules2_0.ts, 33, 5)) +>extMod.m4 : Symbol(extMod.m4, Decl(commentsExternalModules2_0.ts, 23, 26)) +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) +>m4 : Symbol(extMod.m4, Decl(commentsExternalModules2_0.ts, 23, 26)) +>m2 : Symbol(extMod.m4.m2, Decl(commentsExternalModules2_0.ts, 33, 5)) +>c : Symbol(extMod.m4.m2.c, Decl(commentsExternalModules2_0.ts, 36, 22)) + +=== tests/cases/compiler/commentsExternalModules2_0.ts === + +/** Module comment*/ +export module m1 { +>m1 : Symbol(m1, Decl(commentsExternalModules2_0.ts, 0, 0)) + + /** b's comment*/ + export var b: number; +>b : Symbol(b, Decl(commentsExternalModules2_0.ts, 4, 14)) + + /** foo's comment*/ + function foo() { +>foo : Symbol(foo, Decl(commentsExternalModules2_0.ts, 4, 25)) + + return b; +>b : Symbol(b, Decl(commentsExternalModules2_0.ts, 4, 14)) + } + /** m2 comments*/ + export module m2 { +>m2 : Symbol(m2, Decl(commentsExternalModules2_0.ts, 8, 5)) + + /** class comment;*/ + export class c { +>c : Symbol(c, Decl(commentsExternalModules2_0.ts, 10, 22)) + + }; + /** i*/ + export var i = new c(); +>i : Symbol(i, Decl(commentsExternalModules2_0.ts, 15, 18)) +>c : Symbol(c, Decl(commentsExternalModules2_0.ts, 10, 22)) + } + /** exported function*/ + export function fooExport() { +>fooExport : Symbol(fooExport, Decl(commentsExternalModules2_0.ts, 16, 5)) + + return foo(); +>foo : Symbol(foo, Decl(commentsExternalModules2_0.ts, 4, 25)) + } +} +m1.fooExport(); +>m1.fooExport : Symbol(m1.fooExport, Decl(commentsExternalModules2_0.ts, 16, 5)) +>m1 : Symbol(m1, Decl(commentsExternalModules2_0.ts, 0, 0)) +>fooExport : Symbol(m1.fooExport, Decl(commentsExternalModules2_0.ts, 16, 5)) + +var myvar = new m1.m2.c(); +>myvar : Symbol(myvar, Decl(commentsExternalModules2_0.ts, 23, 3)) +>m1.m2.c : Symbol(m1.m2.c, Decl(commentsExternalModules2_0.ts, 10, 22)) +>m1.m2 : Symbol(m1.m2, Decl(commentsExternalModules2_0.ts, 8, 5)) +>m1 : Symbol(m1, Decl(commentsExternalModules2_0.ts, 0, 0)) +>m2 : Symbol(m1.m2, Decl(commentsExternalModules2_0.ts, 8, 5)) +>c : Symbol(m1.m2.c, Decl(commentsExternalModules2_0.ts, 10, 22)) + +/** Module comment */ +export module m4 { +>m4 : Symbol(m4, Decl(commentsExternalModules2_0.ts, 23, 26)) + + /** b's comment */ + export var b: number; +>b : Symbol(b, Decl(commentsExternalModules2_0.ts, 28, 14)) + + /** foo's comment + */ + function foo() { +>foo : Symbol(foo, Decl(commentsExternalModules2_0.ts, 28, 25)) + + return b; +>b : Symbol(b, Decl(commentsExternalModules2_0.ts, 28, 14)) + } + /** m2 comments + */ + export module m2 { +>m2 : Symbol(m2, Decl(commentsExternalModules2_0.ts, 33, 5)) + + /** class comment; */ + export class c { +>c : Symbol(c, Decl(commentsExternalModules2_0.ts, 36, 22)) + + }; + /** i */ + export var i = new c(); +>i : Symbol(i, Decl(commentsExternalModules2_0.ts, 41, 18)) +>c : Symbol(c, Decl(commentsExternalModules2_0.ts, 36, 22)) + } + /** exported function */ + export function fooExport() { +>fooExport : Symbol(fooExport, Decl(commentsExternalModules2_0.ts, 42, 5)) + + return foo(); +>foo : Symbol(foo, Decl(commentsExternalModules2_0.ts, 28, 25)) + } +} +m4.fooExport(); +>m4.fooExport : Symbol(m4.fooExport, Decl(commentsExternalModules2_0.ts, 42, 5)) +>m4 : Symbol(m4, Decl(commentsExternalModules2_0.ts, 23, 26)) +>fooExport : Symbol(m4.fooExport, Decl(commentsExternalModules2_0.ts, 42, 5)) + +var myvar2 = new m4.m2.c(); +>myvar2 : Symbol(myvar2, Decl(commentsExternalModules2_0.ts, 49, 3)) +>m4.m2.c : Symbol(m4.m2.c, Decl(commentsExternalModules2_0.ts, 36, 22)) +>m4.m2 : Symbol(m4.m2, Decl(commentsExternalModules2_0.ts, 33, 5)) +>m4 : Symbol(m4, Decl(commentsExternalModules2_0.ts, 23, 26)) +>m2 : Symbol(m4.m2, Decl(commentsExternalModules2_0.ts, 33, 5)) +>c : Symbol(m4.m2.c, Decl(commentsExternalModules2_0.ts, 36, 22)) + diff --git a/tests/baselines/reference/commentsExternalModules3.symbols b/tests/baselines/reference/commentsExternalModules3.symbols new file mode 100644 index 00000000000..cfd01db377d --- /dev/null +++ b/tests/baselines/reference/commentsExternalModules3.symbols @@ -0,0 +1,143 @@ +=== tests/cases/compiler/commentsExternalModules_1.ts === +/**This is on import declaration*/ +import extMod = require("commentsExternalModules2_0"); // trailing comment 1 +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) + +extMod.m1.fooExport(); +>extMod.m1.fooExport : Symbol(extMod.m1.fooExport, Decl(commentsExternalModules2_0.ts, 16, 5)) +>extMod.m1 : Symbol(extMod.m1, Decl(commentsExternalModules2_0.ts, 0, 0)) +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) +>m1 : Symbol(extMod.m1, Decl(commentsExternalModules2_0.ts, 0, 0)) +>fooExport : Symbol(extMod.m1.fooExport, Decl(commentsExternalModules2_0.ts, 16, 5)) + +export var newVar = new extMod.m1.m2.c(); +>newVar : Symbol(newVar, Decl(commentsExternalModules_1.ts, 3, 10)) +>extMod.m1.m2.c : Symbol(extMod.m1.m2.c, Decl(commentsExternalModules2_0.ts, 10, 22)) +>extMod.m1.m2 : Symbol(extMod.m1.m2, Decl(commentsExternalModules2_0.ts, 8, 5)) +>extMod.m1 : Symbol(extMod.m1, Decl(commentsExternalModules2_0.ts, 0, 0)) +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) +>m1 : Symbol(extMod.m1, Decl(commentsExternalModules2_0.ts, 0, 0)) +>m2 : Symbol(extMod.m1.m2, Decl(commentsExternalModules2_0.ts, 8, 5)) +>c : Symbol(extMod.m1.m2.c, Decl(commentsExternalModules2_0.ts, 10, 22)) + +extMod.m4.fooExport(); +>extMod.m4.fooExport : Symbol(extMod.m4.fooExport, Decl(commentsExternalModules2_0.ts, 42, 5)) +>extMod.m4 : Symbol(extMod.m4, Decl(commentsExternalModules2_0.ts, 23, 26)) +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) +>m4 : Symbol(extMod.m4, Decl(commentsExternalModules2_0.ts, 23, 26)) +>fooExport : Symbol(extMod.m4.fooExport, Decl(commentsExternalModules2_0.ts, 42, 5)) + +export var newVar2 = new extMod.m4.m2.c(); +>newVar2 : Symbol(newVar2, Decl(commentsExternalModules_1.ts, 5, 10)) +>extMod.m4.m2.c : Symbol(extMod.m4.m2.c, Decl(commentsExternalModules2_0.ts, 36, 22)) +>extMod.m4.m2 : Symbol(extMod.m4.m2, Decl(commentsExternalModules2_0.ts, 33, 5)) +>extMod.m4 : Symbol(extMod.m4, Decl(commentsExternalModules2_0.ts, 23, 26)) +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) +>m4 : Symbol(extMod.m4, Decl(commentsExternalModules2_0.ts, 23, 26)) +>m2 : Symbol(extMod.m4.m2, Decl(commentsExternalModules2_0.ts, 33, 5)) +>c : Symbol(extMod.m4.m2.c, Decl(commentsExternalModules2_0.ts, 36, 22)) + +=== tests/cases/compiler/commentsExternalModules2_0.ts === + +/** Module comment*/ +export module m1 { +>m1 : Symbol(m1, Decl(commentsExternalModules2_0.ts, 0, 0)) + + /** b's comment*/ + export var b: number; +>b : Symbol(b, Decl(commentsExternalModules2_0.ts, 4, 14)) + + /** foo's comment*/ + function foo() { +>foo : Symbol(foo, Decl(commentsExternalModules2_0.ts, 4, 25)) + + return b; +>b : Symbol(b, Decl(commentsExternalModules2_0.ts, 4, 14)) + } + /** m2 comments*/ + export module m2 { +>m2 : Symbol(m2, Decl(commentsExternalModules2_0.ts, 8, 5)) + + /** class comment;*/ + export class c { +>c : Symbol(c, Decl(commentsExternalModules2_0.ts, 10, 22)) + + }; + /** i*/ + export var i = new c(); +>i : Symbol(i, Decl(commentsExternalModules2_0.ts, 15, 18)) +>c : Symbol(c, Decl(commentsExternalModules2_0.ts, 10, 22)) + } + /** exported function*/ + export function fooExport() { +>fooExport : Symbol(fooExport, Decl(commentsExternalModules2_0.ts, 16, 5)) + + return foo(); +>foo : Symbol(foo, Decl(commentsExternalModules2_0.ts, 4, 25)) + } +} +m1.fooExport(); +>m1.fooExport : Symbol(m1.fooExport, Decl(commentsExternalModules2_0.ts, 16, 5)) +>m1 : Symbol(m1, Decl(commentsExternalModules2_0.ts, 0, 0)) +>fooExport : Symbol(m1.fooExport, Decl(commentsExternalModules2_0.ts, 16, 5)) + +var myvar = new m1.m2.c(); +>myvar : Symbol(myvar, Decl(commentsExternalModules2_0.ts, 23, 3)) +>m1.m2.c : Symbol(m1.m2.c, Decl(commentsExternalModules2_0.ts, 10, 22)) +>m1.m2 : Symbol(m1.m2, Decl(commentsExternalModules2_0.ts, 8, 5)) +>m1 : Symbol(m1, Decl(commentsExternalModules2_0.ts, 0, 0)) +>m2 : Symbol(m1.m2, Decl(commentsExternalModules2_0.ts, 8, 5)) +>c : Symbol(m1.m2.c, Decl(commentsExternalModules2_0.ts, 10, 22)) + +/** Module comment */ +export module m4 { +>m4 : Symbol(m4, Decl(commentsExternalModules2_0.ts, 23, 26)) + + /** b's comment */ + export var b: number; +>b : Symbol(b, Decl(commentsExternalModules2_0.ts, 28, 14)) + + /** foo's comment + */ + function foo() { +>foo : Symbol(foo, Decl(commentsExternalModules2_0.ts, 28, 25)) + + return b; +>b : Symbol(b, Decl(commentsExternalModules2_0.ts, 28, 14)) + } + /** m2 comments + */ + export module m2 { +>m2 : Symbol(m2, Decl(commentsExternalModules2_0.ts, 33, 5)) + + /** class comment; */ + export class c { +>c : Symbol(c, Decl(commentsExternalModules2_0.ts, 36, 22)) + + }; + /** i */ + export var i = new c(); +>i : Symbol(i, Decl(commentsExternalModules2_0.ts, 41, 18)) +>c : Symbol(c, Decl(commentsExternalModules2_0.ts, 36, 22)) + } + /** exported function */ + export function fooExport() { +>fooExport : Symbol(fooExport, Decl(commentsExternalModules2_0.ts, 42, 5)) + + return foo(); +>foo : Symbol(foo, Decl(commentsExternalModules2_0.ts, 28, 25)) + } +} +m4.fooExport(); +>m4.fooExport : Symbol(m4.fooExport, Decl(commentsExternalModules2_0.ts, 42, 5)) +>m4 : Symbol(m4, Decl(commentsExternalModules2_0.ts, 23, 26)) +>fooExport : Symbol(m4.fooExport, Decl(commentsExternalModules2_0.ts, 42, 5)) + +var myvar2 = new m4.m2.c(); +>myvar2 : Symbol(myvar2, Decl(commentsExternalModules2_0.ts, 49, 3)) +>m4.m2.c : Symbol(m4.m2.c, Decl(commentsExternalModules2_0.ts, 36, 22)) +>m4.m2 : Symbol(m4.m2, Decl(commentsExternalModules2_0.ts, 33, 5)) +>m4 : Symbol(m4, Decl(commentsExternalModules2_0.ts, 23, 26)) +>m2 : Symbol(m4.m2, Decl(commentsExternalModules2_0.ts, 33, 5)) +>c : Symbol(m4.m2.c, Decl(commentsExternalModules2_0.ts, 36, 22)) + diff --git a/tests/baselines/reference/commentsFormatting.symbols b/tests/baselines/reference/commentsFormatting.symbols new file mode 100644 index 00000000000..a858d48ce67 --- /dev/null +++ b/tests/baselines/reference/commentsFormatting.symbols @@ -0,0 +1,93 @@ +=== tests/cases/compiler/commentsFormatting.ts === + +module m { +>m : Symbol(m, Decl(commentsFormatting.ts, 0, 0)) + + /** this is first line - aligned to class declaration +* this is 4 spaces left aligned + * this is 3 spaces left aligned + * this is 2 spaces left aligned + * this is 1 spaces left aligned + * this is at same level as first line + * this is 1 spaces right aligned + * this is 2 spaces right aligned + * this is 3 spaces right aligned + * this is 4 spaces right aligned + * this is 5 spaces right aligned + * this is 6 spaces right aligned + * this is 7 spaces right aligned + * this is 8 spaces right aligned */ + export class c { +>c : Symbol(c, Decl(commentsFormatting.ts, 1, 10)) + } + + /** this is first line - 4 spaces right aligned to class but in js file should be aligned to class declaration +* this is 8 spaces left aligned + * this is 7 spaces left aligned + * this is 6 spaces left aligned + * this is 5 spaces left aligned + * this is 4 spaces left aligned + * this is 3 spaces left aligned + * this is 2 spaces left aligned + * this is 1 spaces left aligned + * this is at same level as first line + * this is 1 spaces right aligned + * this is 2 spaces right aligned + * this is 3 spaces right aligned + * this is 4 spaces right aligned + * this is 5 spaces right aligned + * this is 6 spaces right aligned + * this is 7 spaces right aligned + * this is 8 spaces right aligned */ + export class c2 { +>c2 : Symbol(c2, Decl(commentsFormatting.ts, 17, 5)) + } + + /** this is comment with new lines in between + +this is 4 spaces left aligned but above line is empty + + this is 3 spaces left aligned but above line is empty + + this is 2 spaces left aligned but above line is empty + + this is 1 spaces left aligned but above line is empty + + this is at same level as first line but above line is empty + + this is 1 spaces right aligned but above line is empty + + this is 2 spaces right aligned but above line is empty + + this is 3 spaces right aligned but above line is empty + + this is 4 spaces right aligned but above line is empty + + + Above 2 lines are empty + + + + above 3 lines are empty*/ + export class c3 { +>c3 : Symbol(c3, Decl(commentsFormatting.ts, 38, 5)) + } + + /** this is first line - aligned to class declaration + * this is 0 space + tab + * this is 1 space + tab + * this is 2 spaces + tab + * this is 3 spaces + tab + * this is 4 spaces + tab + * this is 5 spaces + tab + * this is 6 spaces + tab + * this is 7 spaces + tab + * this is 8 spaces + tab + * this is 9 spaces + tab + * this is 10 spaces + tab + * this is 11 spaces + tab + * this is 12 spaces + tab */ + export class c4 { +>c4 : Symbol(c4, Decl(commentsFormatting.ts, 67, 5)) + } +} diff --git a/tests/baselines/reference/commentsFunction.symbols b/tests/baselines/reference/commentsFunction.symbols new file mode 100644 index 00000000000..dfc68eb6743 --- /dev/null +++ b/tests/baselines/reference/commentsFunction.symbols @@ -0,0 +1,109 @@ +=== tests/cases/compiler/commentsFunction.ts === + +/** This comment should appear for foo*/ +function foo() { +>foo : Symbol(foo, Decl(commentsFunction.ts, 0, 0)) + +} /* trailing comment of function */ +foo(); +>foo : Symbol(foo, Decl(commentsFunction.ts, 0, 0)) + +/** This is comment for function signature*/ +function fooWithParameters(/** this is comment about a*/a: string, +>fooWithParameters : Symbol(fooWithParameters, Decl(commentsFunction.ts, 4, 6)) +>a : Symbol(a, Decl(commentsFunction.ts, 6, 27)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(commentsFunction.ts, 6, 66)) + + var d = a; +>d : Symbol(d, Decl(commentsFunction.ts, 9, 7)) +>a : Symbol(a, Decl(commentsFunction.ts, 6, 27)) + +} // trailing comment of function +fooWithParameters("a", 10); +>fooWithParameters : Symbol(fooWithParameters, Decl(commentsFunction.ts, 4, 6)) + +/** fooFunc + * comment + */ +var fooFunc = function FooFunctionValue(/** fooFunctionValue param */ b: string) { +>fooFunc : Symbol(fooFunc, Decl(commentsFunction.ts, 15, 3)) +>FooFunctionValue : Symbol(FooFunctionValue, Decl(commentsFunction.ts, 15, 13)) +>b : Symbol(b, Decl(commentsFunction.ts, 15, 40)) + + return b; +>b : Symbol(b, Decl(commentsFunction.ts, 15, 40)) +} + +/// lamdaFoo var comment +var lambdaFoo = /** this is lambda comment*/ (/**param a*/a: number, /**param b*/b: number) => a + b; +>lambdaFoo : Symbol(lambdaFoo, Decl(commentsFunction.ts, 20, 3)) +>a : Symbol(a, Decl(commentsFunction.ts, 20, 46)) +>b : Symbol(b, Decl(commentsFunction.ts, 20, 68)) +>a : Symbol(a, Decl(commentsFunction.ts, 20, 46)) +>b : Symbol(b, Decl(commentsFunction.ts, 20, 68)) + +var lambddaNoVarComment = /** this is lambda multiplication*/ (/**param a*/a: number, /**param b*/b: number) => a * b; +>lambddaNoVarComment : Symbol(lambddaNoVarComment, Decl(commentsFunction.ts, 21, 3)) +>a : Symbol(a, Decl(commentsFunction.ts, 21, 63)) +>b : Symbol(b, Decl(commentsFunction.ts, 21, 85)) +>a : Symbol(a, Decl(commentsFunction.ts, 21, 63)) +>b : Symbol(b, Decl(commentsFunction.ts, 21, 85)) + +lambdaFoo(10, 20); +>lambdaFoo : Symbol(lambdaFoo, Decl(commentsFunction.ts, 20, 3)) + +lambddaNoVarComment(10, 20); +>lambddaNoVarComment : Symbol(lambddaNoVarComment, Decl(commentsFunction.ts, 21, 3)) + +function blah(a: string /* multiline trailing comment +>blah : Symbol(blah, Decl(commentsFunction.ts, 23, 28)) +>a : Symbol(a, Decl(commentsFunction.ts, 25, 14)) + +multiline */) { +} + +function blah2(a: string /* single line multiple trailing comments */ /* second */) { +>blah2 : Symbol(blah2, Decl(commentsFunction.ts, 27, 1)) +>a : Symbol(a, Decl(commentsFunction.ts, 29, 15)) +} + +function blah3(a: string // trailing commen single line +>blah3 : Symbol(blah3, Decl(commentsFunction.ts, 30, 1)) +>a : Symbol(a, Decl(commentsFunction.ts, 32, 15)) + + ) { +} + +lambdaFoo = (a, b) => a * b; // This is trailing comment +>lambdaFoo : Symbol(lambdaFoo, Decl(commentsFunction.ts, 20, 3)) +>a : Symbol(a, Decl(commentsFunction.ts, 36, 13)) +>b : Symbol(b, Decl(commentsFunction.ts, 36, 15)) +>a : Symbol(a, Decl(commentsFunction.ts, 36, 13)) +>b : Symbol(b, Decl(commentsFunction.ts, 36, 15)) + +/*leading comment*/() => 0; // Needs to be wrapped in parens to be a valid expression (not declaration) +/*leading comment*/(() => 0); //trailing comment + +function blah4(/*1*/a: string/*2*/,/*3*/b: string/*4*/) { +>blah4 : Symbol(blah4, Decl(commentsFunction.ts, 39, 29)) +>a : Symbol(a, Decl(commentsFunction.ts, 41, 15)) +>b : Symbol(b, Decl(commentsFunction.ts, 41, 35)) +} + +function foo1() { +>foo1 : Symbol(foo1, Decl(commentsFunction.ts, 42, 1)) + + // should emit this +} + +function foo2() { +>foo2 : Symbol(foo2, Decl(commentsFunction.ts, 47, 1)) + + /// This is some detached comment + + // should emit this leading comment of } too +} + diff --git a/tests/baselines/reference/commentsFunction.types b/tests/baselines/reference/commentsFunction.types index 6d37e1732e0..db5e518339d 100644 --- a/tests/baselines/reference/commentsFunction.types +++ b/tests/baselines/reference/commentsFunction.types @@ -26,6 +26,8 @@ function fooWithParameters(/** this is comment about a*/a: string, fooWithParameters("a", 10); >fooWithParameters("a", 10) : void >fooWithParameters : (a: string, b: number) => void +>"a" : string +>10 : number /** fooFunc * comment @@ -62,10 +64,14 @@ var lambddaNoVarComment = /** this is lambda multiplication*/ (/**param a*/a: nu lambdaFoo(10, 20); >lambdaFoo(10, 20) : number >lambdaFoo : (a: number, b: number) => number +>10 : number +>20 : number lambddaNoVarComment(10, 20); >lambddaNoVarComment(10, 20) : number >lambddaNoVarComment : (a: number, b: number) => number +>10 : number +>20 : number function blah(a: string /* multiline trailing comment >blah : (a: string) => void @@ -98,10 +104,12 @@ lambdaFoo = (a, b) => a * b; // This is trailing comment /*leading comment*/() => 0; // Needs to be wrapped in parens to be a valid expression (not declaration) >() => 0 : () => number +>0 : number /*leading comment*/(() => 0); //trailing comment >(() => 0) : () => number >() => 0 : () => number +>0 : number function blah4(/*1*/a: string/*2*/,/*3*/b: string/*4*/) { >blah4 : (a: string, b: string) => void diff --git a/tests/baselines/reference/commentsInheritance.symbols b/tests/baselines/reference/commentsInheritance.symbols new file mode 100644 index 00000000000..f702f40a0d4 --- /dev/null +++ b/tests/baselines/reference/commentsInheritance.symbols @@ -0,0 +1,311 @@ +=== tests/cases/compiler/commentsInheritance.ts === + +/** i1 is interface with properties*/ +interface i1 { +>i1 : Symbol(i1, Decl(commentsInheritance.ts, 0, 0)) + + /** i1_p1*/ + i1_p1: number; +>i1_p1 : Symbol(i1_p1, Decl(commentsInheritance.ts, 2, 14)) + + /** i1_f1*/ + i1_f1(): void; +>i1_f1 : Symbol(i1_f1, Decl(commentsInheritance.ts, 4, 18)) + + /** i1_l1*/ + i1_l1: () => void; +>i1_l1 : Symbol(i1_l1, Decl(commentsInheritance.ts, 6, 18)) + + // il_nc_p1 + i1_nc_p1: number; +>i1_nc_p1 : Symbol(i1_nc_p1, Decl(commentsInheritance.ts, 8, 22)) + + i1_nc_f1(): void; +>i1_nc_f1 : Symbol(i1_nc_f1, Decl(commentsInheritance.ts, 10, 21)) + + i1_nc_l1: () => void; +>i1_nc_l1 : Symbol(i1_nc_l1, Decl(commentsInheritance.ts, 11, 21)) + + p1: number; +>p1 : Symbol(p1, Decl(commentsInheritance.ts, 12, 25)) + + f1(): void; +>f1 : Symbol(f1, Decl(commentsInheritance.ts, 13, 15)) + + l1: () => void; +>l1 : Symbol(l1, Decl(commentsInheritance.ts, 14, 15)) + + nc_p1: number; +>nc_p1 : Symbol(nc_p1, Decl(commentsInheritance.ts, 15, 19)) + + nc_f1(): void; +>nc_f1 : Symbol(nc_f1, Decl(commentsInheritance.ts, 16, 18)) + + nc_l1: () => void; +>nc_l1 : Symbol(nc_l1, Decl(commentsInheritance.ts, 17, 18)) +} +class c1 implements i1 { +>c1 : Symbol(c1, Decl(commentsInheritance.ts, 19, 1)) +>i1 : Symbol(i1, Decl(commentsInheritance.ts, 0, 0)) + + public i1_p1: number; +>i1_p1 : Symbol(i1_p1, Decl(commentsInheritance.ts, 20, 24)) + + // i1_f1 + public i1_f1() { +>i1_f1 : Symbol(i1_f1, Decl(commentsInheritance.ts, 21, 25)) + } + public i1_l1: () => void; +>i1_l1 : Symbol(i1_l1, Decl(commentsInheritance.ts, 24, 5)) + + public i1_nc_p1: number; +>i1_nc_p1 : Symbol(i1_nc_p1, Decl(commentsInheritance.ts, 25, 29)) + + public i1_nc_f1() { +>i1_nc_f1 : Symbol(i1_nc_f1, Decl(commentsInheritance.ts, 26, 28)) + } + public i1_nc_l1: () => void; +>i1_nc_l1 : Symbol(i1_nc_l1, Decl(commentsInheritance.ts, 28, 5)) + + /** c1_p1*/ + public p1: number; +>p1 : Symbol(p1, Decl(commentsInheritance.ts, 29, 32)) + + /** c1_f1*/ + public f1() { +>f1 : Symbol(f1, Decl(commentsInheritance.ts, 31, 22)) + } + /** c1_l1*/ + public l1: () => void; +>l1 : Symbol(l1, Decl(commentsInheritance.ts, 34, 5)) + + /** c1_nc_p1*/ + public nc_p1: number; +>nc_p1 : Symbol(nc_p1, Decl(commentsInheritance.ts, 36, 26)) + + /** c1_nc_f1*/ + public nc_f1() { +>nc_f1 : Symbol(nc_f1, Decl(commentsInheritance.ts, 38, 25)) + } + /** c1_nc_l1*/ + public nc_l1: () => void; +>nc_l1 : Symbol(nc_l1, Decl(commentsInheritance.ts, 41, 5)) +} +var i1_i: i1; +>i1_i : Symbol(i1_i, Decl(commentsInheritance.ts, 45, 3)) +>i1 : Symbol(i1, Decl(commentsInheritance.ts, 0, 0)) + +var c1_i = new c1(); +>c1_i : Symbol(c1_i, Decl(commentsInheritance.ts, 46, 3)) +>c1 : Symbol(c1, Decl(commentsInheritance.ts, 19, 1)) + +// assign to interface +i1_i = c1_i; +>i1_i : Symbol(i1_i, Decl(commentsInheritance.ts, 45, 3)) +>c1_i : Symbol(c1_i, Decl(commentsInheritance.ts, 46, 3)) + +class c2 { +>c2 : Symbol(c2, Decl(commentsInheritance.ts, 48, 12)) + + /** c2 c2_p1*/ + public c2_p1: number; +>c2_p1 : Symbol(c2_p1, Decl(commentsInheritance.ts, 49, 10)) + + /** c2 c2_f1*/ + public c2_f1() { +>c2_f1 : Symbol(c2_f1, Decl(commentsInheritance.ts, 51, 25)) + } + /** c2 c2_prop*/ + public get c2_prop() { +>c2_prop : Symbol(c2_prop, Decl(commentsInheritance.ts, 54, 5)) + + return 10; + } + public c2_nc_p1: number; +>c2_nc_p1 : Symbol(c2_nc_p1, Decl(commentsInheritance.ts, 58, 5)) + + public c2_nc_f1() { +>c2_nc_f1 : Symbol(c2_nc_f1, Decl(commentsInheritance.ts, 59, 28)) + } + public get c2_nc_prop() { +>c2_nc_prop : Symbol(c2_nc_prop, Decl(commentsInheritance.ts, 61, 5)) + + return 10; + } + /** c2 p1*/ + public p1: number; +>p1 : Symbol(p1, Decl(commentsInheritance.ts, 64, 5)) + + /** c2 f1*/ + public f1() { +>f1 : Symbol(f1, Decl(commentsInheritance.ts, 66, 22)) + } + /** c2 prop*/ + public get prop() { +>prop : Symbol(prop, Decl(commentsInheritance.ts, 69, 5)) + + return 10; + } + public nc_p1: number; +>nc_p1 : Symbol(nc_p1, Decl(commentsInheritance.ts, 73, 5)) + + public nc_f1() { +>nc_f1 : Symbol(nc_f1, Decl(commentsInheritance.ts, 74, 25)) + } + public get nc_prop() { +>nc_prop : Symbol(nc_prop, Decl(commentsInheritance.ts, 76, 5)) + + return 10; + } + /** c2 constructor*/ + constructor(a: number) { +>a : Symbol(a, Decl(commentsInheritance.ts, 81, 16)) + + this.c2_p1 = a; +>this.c2_p1 : Symbol(c2_p1, Decl(commentsInheritance.ts, 49, 10)) +>this : Symbol(c2, Decl(commentsInheritance.ts, 48, 12)) +>c2_p1 : Symbol(c2_p1, Decl(commentsInheritance.ts, 49, 10)) +>a : Symbol(a, Decl(commentsInheritance.ts, 81, 16)) + } +} +class c3 extends c2 { +>c3 : Symbol(c3, Decl(commentsInheritance.ts, 84, 1)) +>c2 : Symbol(c2, Decl(commentsInheritance.ts, 48, 12)) + + constructor() { + super(10); +>super : Symbol(c2, Decl(commentsInheritance.ts, 48, 12)) + } + /** c3 p1*/ + public p1: number; +>p1 : Symbol(p1, Decl(commentsInheritance.ts, 88, 5)) + + /** c3 f1*/ + public f1() { +>f1 : Symbol(f1, Decl(commentsInheritance.ts, 90, 22)) + } + /** c3 prop*/ + public get prop() { +>prop : Symbol(prop, Decl(commentsInheritance.ts, 93, 5)) + + return 10; + } + public nc_p1: number; +>nc_p1 : Symbol(nc_p1, Decl(commentsInheritance.ts, 97, 5)) + + public nc_f1() { +>nc_f1 : Symbol(nc_f1, Decl(commentsInheritance.ts, 98, 25)) + } + public get nc_prop() { +>nc_prop : Symbol(nc_prop, Decl(commentsInheritance.ts, 100, 5)) + + return 10; + } +} +var c2_i = new c2(10); +>c2_i : Symbol(c2_i, Decl(commentsInheritance.ts, 105, 3)) +>c2 : Symbol(c2, Decl(commentsInheritance.ts, 48, 12)) + +var c3_i = new c3(); +>c3_i : Symbol(c3_i, Decl(commentsInheritance.ts, 106, 3)) +>c3 : Symbol(c3, Decl(commentsInheritance.ts, 84, 1)) + +// assign +c2_i = c3_i; +>c2_i : Symbol(c2_i, Decl(commentsInheritance.ts, 105, 3)) +>c3_i : Symbol(c3_i, Decl(commentsInheritance.ts, 106, 3)) + +class c4 extends c2 { +>c4 : Symbol(c4, Decl(commentsInheritance.ts, 108, 12)) +>c2 : Symbol(c2, Decl(commentsInheritance.ts, 48, 12)) +} +var c4_i = new c4(10); +>c4_i : Symbol(c4_i, Decl(commentsInheritance.ts, 111, 3)) +>c4 : Symbol(c4, Decl(commentsInheritance.ts, 108, 12)) + +interface i2 { +>i2 : Symbol(i2, Decl(commentsInheritance.ts, 111, 22)) + + /** i2_p1*/ + i2_p1: number; +>i2_p1 : Symbol(i2_p1, Decl(commentsInheritance.ts, 112, 14)) + + /** i2_f1*/ + i2_f1(): void; +>i2_f1 : Symbol(i2_f1, Decl(commentsInheritance.ts, 114, 18)) + + /** i2_l1*/ + i2_l1: () => void; +>i2_l1 : Symbol(i2_l1, Decl(commentsInheritance.ts, 116, 18)) + + // i2_nc_p1 + i2_nc_p1: number; +>i2_nc_p1 : Symbol(i2_nc_p1, Decl(commentsInheritance.ts, 118, 22)) + + i2_nc_f1(): void; +>i2_nc_f1 : Symbol(i2_nc_f1, Decl(commentsInheritance.ts, 120, 21)) + + i2_nc_l1: () => void; +>i2_nc_l1 : Symbol(i2_nc_l1, Decl(commentsInheritance.ts, 121, 21)) + + /** i2 p1*/ + p1: number; +>p1 : Symbol(p1, Decl(commentsInheritance.ts, 122, 25)) + + /** i2 f1*/ + f1(): void; +>f1 : Symbol(f1, Decl(commentsInheritance.ts, 124, 15)) + + /** i2 l1*/ + l1: () => void; +>l1 : Symbol(l1, Decl(commentsInheritance.ts, 126, 15)) + + nc_p1: number; +>nc_p1 : Symbol(nc_p1, Decl(commentsInheritance.ts, 128, 19)) + + nc_f1(): void; +>nc_f1 : Symbol(nc_f1, Decl(commentsInheritance.ts, 129, 18)) + + nc_l1: () => void; +>nc_l1 : Symbol(nc_l1, Decl(commentsInheritance.ts, 130, 18)) +} +interface i3 extends i2 { +>i3 : Symbol(i3, Decl(commentsInheritance.ts, 132, 1)) +>i2 : Symbol(i2, Decl(commentsInheritance.ts, 111, 22)) + + /** i3 p1 */ + p1: number; +>p1 : Symbol(p1, Decl(commentsInheritance.ts, 133, 25)) + + /** + * i3 f1 + */ + f1(): void; +>f1 : Symbol(f1, Decl(commentsInheritance.ts, 135, 15)) + + /** i3 l1*/ + l1: () => void; +>l1 : Symbol(l1, Decl(commentsInheritance.ts, 139, 15)) + + nc_p1: number; +>nc_p1 : Symbol(nc_p1, Decl(commentsInheritance.ts, 141, 19)) + + nc_f1(): void; +>nc_f1 : Symbol(nc_f1, Decl(commentsInheritance.ts, 142, 18)) + + nc_l1: () => void; +>nc_l1 : Symbol(nc_l1, Decl(commentsInheritance.ts, 143, 18)) +} +var i2_i: i2; +>i2_i : Symbol(i2_i, Decl(commentsInheritance.ts, 146, 3)) +>i2 : Symbol(i2, Decl(commentsInheritance.ts, 111, 22)) + +var i3_i: i3; +>i3_i : Symbol(i3_i, Decl(commentsInheritance.ts, 147, 3)) +>i3 : Symbol(i3, Decl(commentsInheritance.ts, 132, 1)) + +// assign to interface +i2_i = i3_i; +>i2_i : Symbol(i2_i, Decl(commentsInheritance.ts, 146, 3)) +>i3_i : Symbol(i3_i, Decl(commentsInheritance.ts, 147, 3)) + diff --git a/tests/baselines/reference/commentsInheritance.types b/tests/baselines/reference/commentsInheritance.types index b4db5767107..1c25f13937b 100644 --- a/tests/baselines/reference/commentsInheritance.types +++ b/tests/baselines/reference/commentsInheritance.types @@ -122,6 +122,7 @@ class c2 { >c2_prop : number return 10; +>10 : number } public c2_nc_p1: number; >c2_nc_p1 : number @@ -133,6 +134,7 @@ class c2 { >c2_nc_prop : number return 10; +>10 : number } /** c2 p1*/ public p1: number; @@ -147,6 +149,7 @@ class c2 { >prop : number return 10; +>10 : number } public nc_p1: number; >nc_p1 : number @@ -158,6 +161,7 @@ class c2 { >nc_prop : number return 10; +>10 : number } /** c2 constructor*/ constructor(a: number) { @@ -179,6 +183,7 @@ class c3 extends c2 { super(10); >super(10) : void >super : typeof c2 +>10 : number } /** c3 p1*/ public p1: number; @@ -193,6 +198,7 @@ class c3 extends c2 { >prop : number return 10; +>10 : number } public nc_p1: number; >nc_p1 : number @@ -204,12 +210,14 @@ class c3 extends c2 { >nc_prop : number return 10; +>10 : number } } var c2_i = new c2(10); >c2_i : c2 >new c2(10) : c2 >c2 : typeof c2 +>10 : number var c3_i = new c3(); >c3_i : c3 @@ -230,6 +238,7 @@ var c4_i = new c4(10); >c4_i : c4 >new c4(10) : c4 >c4 : typeof c4 +>10 : number interface i2 { >i2 : i2 diff --git a/tests/baselines/reference/commentsInterface.symbols b/tests/baselines/reference/commentsInterface.symbols new file mode 100644 index 00000000000..78d89989ed1 --- /dev/null +++ b/tests/baselines/reference/commentsInterface.symbols @@ -0,0 +1,224 @@ +=== tests/cases/compiler/commentsInterface.ts === +/** this is interface 1*/ +interface i1 { +>i1 : Symbol(i1, Decl(commentsInterface.ts, 0, 0)) +} +var i1_i: i1; +>i1_i : Symbol(i1_i, Decl(commentsInterface.ts, 3, 3)) +>i1 : Symbol(i1, Decl(commentsInterface.ts, 0, 0)) + +interface nc_i1 { +>nc_i1 : Symbol(nc_i1, Decl(commentsInterface.ts, 3, 13)) +} +var nc_i1_i: nc_i1; +>nc_i1_i : Symbol(nc_i1_i, Decl(commentsInterface.ts, 6, 3)) +>nc_i1 : Symbol(nc_i1, Decl(commentsInterface.ts, 3, 13)) + +/** this is interface 2 with memebers*/ +interface i2 { +>i2 : Symbol(i2, Decl(commentsInterface.ts, 6, 19)) + + /** this is x*/ + x: number; +>x : Symbol(x, Decl(commentsInterface.ts, 8, 14)) + + /** this is foo*/ + foo: (/**param help*/b: number) => string; +>foo : Symbol(foo, Decl(commentsInterface.ts, 10, 14)) +>b : Symbol(b, Decl(commentsInterface.ts, 12, 10)) + + /** this is indexer*/ + [/**string param*/i: string]: any; +>i : Symbol(i, Decl(commentsInterface.ts, 14, 5)) + + /**new method*/ + new (/** param*/i: i1); +>i : Symbol(i, Decl(commentsInterface.ts, 16, 9)) +>i1 : Symbol(i1, Decl(commentsInterface.ts, 0, 0)) + + nc_x: number; +>nc_x : Symbol(nc_x, Decl(commentsInterface.ts, 16, 27)) + + nc_foo: (b: number) => string; +>nc_foo : Symbol(nc_foo, Decl(commentsInterface.ts, 17, 17)) +>b : Symbol(b, Decl(commentsInterface.ts, 18, 13)) + + [i: number]: number; +>i : Symbol(i, Decl(commentsInterface.ts, 19, 5)) + + /** this is call signature*/ + (/**paramhelp a*/a: number,/**paramhelp b*/ b: number) : number; +>a : Symbol(a, Decl(commentsInterface.ts, 21, 5)) +>b : Symbol(b, Decl(commentsInterface.ts, 21, 31)) + + /** this is fnfoo*/ + fnfoo(/**param help*/b: number): string; +>fnfoo : Symbol(fnfoo, Decl(commentsInterface.ts, 21, 68)) +>b : Symbol(b, Decl(commentsInterface.ts, 23, 10)) + + nc_fnfoo(b: number): string; +>nc_fnfoo : Symbol(nc_fnfoo, Decl(commentsInterface.ts, 23, 44)) +>b : Symbol(b, Decl(commentsInterface.ts, 24, 13)) + + // nc_y + nc_y: number; +>nc_y : Symbol(nc_y, Decl(commentsInterface.ts, 24, 32)) +} +var i2_i: i2; +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) +>i2 : Symbol(i2, Decl(commentsInterface.ts, 6, 19)) + +var i2_i_x = i2_i.x; +>i2_i_x : Symbol(i2_i_x, Decl(commentsInterface.ts, 29, 3)) +>i2_i.x : Symbol(i2.x, Decl(commentsInterface.ts, 8, 14)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) +>x : Symbol(i2.x, Decl(commentsInterface.ts, 8, 14)) + +var i2_i_foo = i2_i.foo; +>i2_i_foo : Symbol(i2_i_foo, Decl(commentsInterface.ts, 30, 3)) +>i2_i.foo : Symbol(i2.foo, Decl(commentsInterface.ts, 10, 14)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) +>foo : Symbol(i2.foo, Decl(commentsInterface.ts, 10, 14)) + +var i2_i_foo_r = i2_i.foo(30); +>i2_i_foo_r : Symbol(i2_i_foo_r, Decl(commentsInterface.ts, 31, 3)) +>i2_i.foo : Symbol(i2.foo, Decl(commentsInterface.ts, 10, 14)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) +>foo : Symbol(i2.foo, Decl(commentsInterface.ts, 10, 14)) + +var i2_i_i2_si = i2_i["hello"]; +>i2_i_i2_si : Symbol(i2_i_i2_si, Decl(commentsInterface.ts, 32, 3)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) + +var i2_i_i2_ii = i2_i[30]; +>i2_i_i2_ii : Symbol(i2_i_i2_ii, Decl(commentsInterface.ts, 33, 3)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) + +var i2_i_n = new i2_i(i1_i); +>i2_i_n : Symbol(i2_i_n, Decl(commentsInterface.ts, 34, 3)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) +>i1_i : Symbol(i1_i, Decl(commentsInterface.ts, 3, 3)) + +var i2_i_nc_x = i2_i.nc_x; +>i2_i_nc_x : Symbol(i2_i_nc_x, Decl(commentsInterface.ts, 35, 3)) +>i2_i.nc_x : Symbol(i2.nc_x, Decl(commentsInterface.ts, 16, 27)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) +>nc_x : Symbol(i2.nc_x, Decl(commentsInterface.ts, 16, 27)) + +var i2_i_nc_foo = i2_i.nc_foo; +>i2_i_nc_foo : Symbol(i2_i_nc_foo, Decl(commentsInterface.ts, 36, 3)) +>i2_i.nc_foo : Symbol(i2.nc_foo, Decl(commentsInterface.ts, 17, 17)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) +>nc_foo : Symbol(i2.nc_foo, Decl(commentsInterface.ts, 17, 17)) + +var i2_i_nc_foo_r = i2_i.nc_foo(30); +>i2_i_nc_foo_r : Symbol(i2_i_nc_foo_r, Decl(commentsInterface.ts, 37, 3)) +>i2_i.nc_foo : Symbol(i2.nc_foo, Decl(commentsInterface.ts, 17, 17)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) +>nc_foo : Symbol(i2.nc_foo, Decl(commentsInterface.ts, 17, 17)) + +var i2_i_r = i2_i(10, 20); +>i2_i_r : Symbol(i2_i_r, Decl(commentsInterface.ts, 38, 3)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) + +var i2_i_fnfoo = i2_i.fnfoo; +>i2_i_fnfoo : Symbol(i2_i_fnfoo, Decl(commentsInterface.ts, 39, 3)) +>i2_i.fnfoo : Symbol(i2.fnfoo, Decl(commentsInterface.ts, 21, 68)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) +>fnfoo : Symbol(i2.fnfoo, Decl(commentsInterface.ts, 21, 68)) + +var i2_i_fnfoo_r = i2_i.fnfoo(10); +>i2_i_fnfoo_r : Symbol(i2_i_fnfoo_r, Decl(commentsInterface.ts, 40, 3)) +>i2_i.fnfoo : Symbol(i2.fnfoo, Decl(commentsInterface.ts, 21, 68)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) +>fnfoo : Symbol(i2.fnfoo, Decl(commentsInterface.ts, 21, 68)) + +var i2_i_nc_fnfoo = i2_i.nc_fnfoo; +>i2_i_nc_fnfoo : Symbol(i2_i_nc_fnfoo, Decl(commentsInterface.ts, 41, 3)) +>i2_i.nc_fnfoo : Symbol(i2.nc_fnfoo, Decl(commentsInterface.ts, 23, 44)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) +>nc_fnfoo : Symbol(i2.nc_fnfoo, Decl(commentsInterface.ts, 23, 44)) + +var i2_i_nc_fnfoo_r = i2_i.nc_fnfoo(10); +>i2_i_nc_fnfoo_r : Symbol(i2_i_nc_fnfoo_r, Decl(commentsInterface.ts, 42, 3)) +>i2_i.nc_fnfoo : Symbol(i2.nc_fnfoo, Decl(commentsInterface.ts, 23, 44)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) +>nc_fnfoo : Symbol(i2.nc_fnfoo, Decl(commentsInterface.ts, 23, 44)) + +interface i3 { +>i3 : Symbol(i3, Decl(commentsInterface.ts, 42, 40)) + + /** Comment i3 x*/ + x: number; +>x : Symbol(x, Decl(commentsInterface.ts, 43, 14)) + + /** Function i3 f*/ + f(/**number parameter*/a: number): string; +>f : Symbol(f, Decl(commentsInterface.ts, 45, 14)) +>a : Symbol(a, Decl(commentsInterface.ts, 47, 6)) + + /** i3 l*/ + l: (/**comment i3 l b*/b: number) => string; +>l : Symbol(l, Decl(commentsInterface.ts, 47, 46)) +>b : Symbol(b, Decl(commentsInterface.ts, 49, 8)) + + nc_x: number; +>nc_x : Symbol(nc_x, Decl(commentsInterface.ts, 49, 48)) + + nc_f(a: number): string; +>nc_f : Symbol(nc_f, Decl(commentsInterface.ts, 50, 17)) +>a : Symbol(a, Decl(commentsInterface.ts, 51, 9)) + + nc_l: (b: number) => string; +>nc_l : Symbol(nc_l, Decl(commentsInterface.ts, 51, 28)) +>b : Symbol(b, Decl(commentsInterface.ts, 52, 11)) +} +var i3_i: i3; +>i3_i : Symbol(i3_i, Decl(commentsInterface.ts, 54, 3)) +>i3 : Symbol(i3, Decl(commentsInterface.ts, 42, 40)) + +i3_i = { +>i3_i : Symbol(i3_i, Decl(commentsInterface.ts, 54, 3)) + + f: /**own f*/ (/**i3_i a*/a: number) => "Hello" + a, +>f : Symbol(f, Decl(commentsInterface.ts, 55, 8)) +>a : Symbol(a, Decl(commentsInterface.ts, 56, 19)) +>a : Symbol(a, Decl(commentsInterface.ts, 56, 19)) + + l: this.f, +>l : Symbol(l, Decl(commentsInterface.ts, 56, 56)) + + /** own x*/ + x: this.f(10), +>x : Symbol(x, Decl(commentsInterface.ts, 57, 14)) + + nc_x: this.l(this.x), +>nc_x : Symbol(nc_x, Decl(commentsInterface.ts, 59, 18)) + + nc_f: this.f, +>nc_f : Symbol(nc_f, Decl(commentsInterface.ts, 60, 25)) + + nc_l: this.l +>nc_l : Symbol(nc_l, Decl(commentsInterface.ts, 61, 17)) + +}; +i3_i.f(10); +>i3_i.f : Symbol(i3.f, Decl(commentsInterface.ts, 45, 14)) +>i3_i : Symbol(i3_i, Decl(commentsInterface.ts, 54, 3)) +>f : Symbol(i3.f, Decl(commentsInterface.ts, 45, 14)) + +i3_i.l(10); +>i3_i.l : Symbol(i3.l, Decl(commentsInterface.ts, 47, 46)) +>i3_i : Symbol(i3_i, Decl(commentsInterface.ts, 54, 3)) +>l : Symbol(i3.l, Decl(commentsInterface.ts, 47, 46)) + +i3_i.nc_f(10); +>i3_i.nc_f : Symbol(i3.nc_f, Decl(commentsInterface.ts, 50, 17)) +>i3_i : Symbol(i3_i, Decl(commentsInterface.ts, 54, 3)) +>nc_f : Symbol(i3.nc_f, Decl(commentsInterface.ts, 50, 17)) + +i3_i.nc_l(10); +>i3_i.nc_l : Symbol(i3.nc_l, Decl(commentsInterface.ts, 51, 28)) +>i3_i : Symbol(i3_i, Decl(commentsInterface.ts, 54, 3)) +>nc_l : Symbol(i3.nc_l, Decl(commentsInterface.ts, 51, 28)) + diff --git a/tests/baselines/reference/commentsInterface.types b/tests/baselines/reference/commentsInterface.types index 68d552882e2..13cc2b19f60 100644 --- a/tests/baselines/reference/commentsInterface.types +++ b/tests/baselines/reference/commentsInterface.types @@ -86,16 +86,19 @@ var i2_i_foo_r = i2_i.foo(30); >i2_i.foo : (b: number) => string >i2_i : i2 >foo : (b: number) => string +>30 : number var i2_i_i2_si = i2_i["hello"]; >i2_i_i2_si : any >i2_i["hello"] : any >i2_i : i2 +>"hello" : string var i2_i_i2_ii = i2_i[30]; >i2_i_i2_ii : number >i2_i[30] : number >i2_i : i2 +>30 : number var i2_i_n = new i2_i(i1_i); >i2_i_n : any @@ -121,11 +124,14 @@ var i2_i_nc_foo_r = i2_i.nc_foo(30); >i2_i.nc_foo : (b: number) => string >i2_i : i2 >nc_foo : (b: number) => string +>30 : number var i2_i_r = i2_i(10, 20); >i2_i_r : number >i2_i(10, 20) : number >i2_i : i2 +>10 : number +>20 : number var i2_i_fnfoo = i2_i.fnfoo; >i2_i_fnfoo : (b: number) => string @@ -139,6 +145,7 @@ var i2_i_fnfoo_r = i2_i.fnfoo(10); >i2_i.fnfoo : (b: number) => string >i2_i : i2 >fnfoo : (b: number) => string +>10 : number var i2_i_nc_fnfoo = i2_i.nc_fnfoo; >i2_i_nc_fnfoo : (b: number) => string @@ -152,6 +159,7 @@ var i2_i_nc_fnfoo_r = i2_i.nc_fnfoo(10); >i2_i.nc_fnfoo : (b: number) => string >i2_i : i2 >nc_fnfoo : (b: number) => string +>10 : number interface i3 { >i3 : i3 @@ -195,6 +203,7 @@ i3_i = { >(/**i3_i a*/a: number) => "Hello" + a : (a: number) => string >a : number >"Hello" + a : string +>"Hello" : string >a : number l: this.f, @@ -210,6 +219,7 @@ i3_i = { >this.f : any >this : any >f : any +>10 : number nc_x: this.l(this.x), >nc_x : any @@ -239,22 +249,26 @@ i3_i.f(10); >i3_i.f : (a: number) => string >i3_i : i3 >f : (a: number) => string +>10 : number i3_i.l(10); >i3_i.l(10) : string >i3_i.l : (b: number) => string >i3_i : i3 >l : (b: number) => string +>10 : number i3_i.nc_f(10); >i3_i.nc_f(10) : string >i3_i.nc_f : (a: number) => string >i3_i : i3 >nc_f : (a: number) => string +>10 : number i3_i.nc_l(10); >i3_i.nc_l(10) : string >i3_i.nc_l : (b: number) => string >i3_i : i3 >nc_l : (b: number) => string +>10 : number diff --git a/tests/baselines/reference/commentsModules.symbols b/tests/baselines/reference/commentsModules.symbols new file mode 100644 index 00000000000..9d962588d6a --- /dev/null +++ b/tests/baselines/reference/commentsModules.symbols @@ -0,0 +1,216 @@ +=== tests/cases/compiler/commentsModules.ts === +/** Module comment*/ +module m1 { +>m1 : Symbol(m1, Decl(commentsModules.ts, 0, 0)) + + /** b's comment*/ + export var b: number; +>b : Symbol(b, Decl(commentsModules.ts, 3, 14)) + + /** foo's comment*/ + function foo() { +>foo : Symbol(foo, Decl(commentsModules.ts, 3, 25)) + + return b; +>b : Symbol(b, Decl(commentsModules.ts, 3, 14)) + } + /** m2 comments*/ + export module m2 { +>m2 : Symbol(m2, Decl(commentsModules.ts, 7, 5)) + + /** class comment;*/ + export class c { +>c : Symbol(c, Decl(commentsModules.ts, 9, 22)) + + }; + /** i*/ + export var i = new c(); +>i : Symbol(i, Decl(commentsModules.ts, 14, 18)) +>c : Symbol(c, Decl(commentsModules.ts, 9, 22)) + } + /** exported function*/ + export function fooExport() { +>fooExport : Symbol(fooExport, Decl(commentsModules.ts, 15, 5)) + + return foo(); +>foo : Symbol(foo, Decl(commentsModules.ts, 3, 25)) + } + + // shouldn't appear + export function foo2Export(/**hm*/ a: string) { +>foo2Export : Symbol(foo2Export, Decl(commentsModules.ts, 19, 5)) +>a : Symbol(a, Decl(commentsModules.ts, 22, 31)) + } + + /** foo3Export + * comment + */ + export function foo3Export() { +>foo3Export : Symbol(foo3Export, Decl(commentsModules.ts, 23, 5)) + } + + /** foo4Export + * comment + */ + function foo4Export() { +>foo4Export : Symbol(foo4Export, Decl(commentsModules.ts, 29, 5)) + } +} // trailing comment module +m1.fooExport(); +>m1.fooExport : Symbol(m1.fooExport, Decl(commentsModules.ts, 15, 5)) +>m1 : Symbol(m1, Decl(commentsModules.ts, 0, 0)) +>fooExport : Symbol(m1.fooExport, Decl(commentsModules.ts, 15, 5)) + +var myvar = new m1.m2.c(); +>myvar : Symbol(myvar, Decl(commentsModules.ts, 38, 3)) +>m1.m2.c : Symbol(m1.m2.c, Decl(commentsModules.ts, 9, 22)) +>m1.m2 : Symbol(m1.m2, Decl(commentsModules.ts, 7, 5)) +>m1 : Symbol(m1, Decl(commentsModules.ts, 0, 0)) +>m2 : Symbol(m1.m2, Decl(commentsModules.ts, 7, 5)) +>c : Symbol(m1.m2.c, Decl(commentsModules.ts, 9, 22)) + +/** module comment of m2.m3*/ +module m2.m3 { +>m2 : Symbol(m2, Decl(commentsModules.ts, 38, 26)) +>m3 : Symbol(m3, Decl(commentsModules.ts, 40, 10)) + + /** Exported class comment*/ + export class c { +>c : Symbol(c, Decl(commentsModules.ts, 40, 14)) + } +} /* trailing dotted module comment*/ +new m2.m3.c(); +>m2.m3.c : Symbol(m2.m3.c, Decl(commentsModules.ts, 40, 14)) +>m2.m3 : Symbol(m2.m3, Decl(commentsModules.ts, 40, 10)) +>m2 : Symbol(m2, Decl(commentsModules.ts, 38, 26)) +>m3 : Symbol(m2.m3, Decl(commentsModules.ts, 40, 10)) +>c : Symbol(m2.m3.c, Decl(commentsModules.ts, 40, 14)) + +/** module comment of m3.m4.m5*/ +module m3.m4.m5 { +>m3 : Symbol(m3, Decl(commentsModules.ts, 45, 14)) +>m4 : Symbol(m4, Decl(commentsModules.ts, 47, 10)) +>m5 : Symbol(m5, Decl(commentsModules.ts, 47, 13)) + + /** Exported class comment*/ + export class c { +>c : Symbol(c, Decl(commentsModules.ts, 47, 17)) + } +} // trailing dotted module 2 +new m3.m4.m5.c(); +>m3.m4.m5.c : Symbol(m3.m4.m5.c, Decl(commentsModules.ts, 47, 17)) +>m3.m4.m5 : Symbol(m3.m4.m5, Decl(commentsModules.ts, 47, 13)) +>m3.m4 : Symbol(m3.m4, Decl(commentsModules.ts, 47, 10)) +>m3 : Symbol(m3, Decl(commentsModules.ts, 45, 14)) +>m4 : Symbol(m3.m4, Decl(commentsModules.ts, 47, 10)) +>m5 : Symbol(m3.m4.m5, Decl(commentsModules.ts, 47, 13)) +>c : Symbol(m3.m4.m5.c, Decl(commentsModules.ts, 47, 17)) + +/** module comment of m4.m5.m6*/ +module m4.m5.m6 { +>m4 : Symbol(m4, Decl(commentsModules.ts, 52, 17)) +>m5 : Symbol(m5, Decl(commentsModules.ts, 54, 10)) +>m6 : Symbol(m6, Decl(commentsModules.ts, 54, 13)) + + export module m7 { +>m7 : Symbol(m7, Decl(commentsModules.ts, 54, 17)) + + /** Exported class comment*/ + export class c { +>c : Symbol(c, Decl(commentsModules.ts, 55, 22)) + } + } /* trailing inner module */ /* multiple comments*/ +} +new m4.m5.m6.m7.c(); +>m4.m5.m6.m7.c : Symbol(m4.m5.m6.m7.c, Decl(commentsModules.ts, 55, 22)) +>m4.m5.m6.m7 : Symbol(m4.m5.m6.m7, Decl(commentsModules.ts, 54, 17)) +>m4.m5.m6 : Symbol(m4.m5.m6, Decl(commentsModules.ts, 54, 13)) +>m4.m5 : Symbol(m4.m5, Decl(commentsModules.ts, 54, 10)) +>m4 : Symbol(m4, Decl(commentsModules.ts, 52, 17)) +>m5 : Symbol(m4.m5, Decl(commentsModules.ts, 54, 10)) +>m6 : Symbol(m4.m5.m6, Decl(commentsModules.ts, 54, 13)) +>m7 : Symbol(m4.m5.m6.m7, Decl(commentsModules.ts, 54, 17)) +>c : Symbol(m4.m5.m6.m7.c, Decl(commentsModules.ts, 55, 22)) + +/** module comment of m5.m6.m7*/ +module m5.m6.m7 { +>m5 : Symbol(m5, Decl(commentsModules.ts, 61, 20)) +>m6 : Symbol(m6, Decl(commentsModules.ts, 63, 10)) +>m7 : Symbol(m7, Decl(commentsModules.ts, 63, 13)) + + /** module m8 comment*/ + export module m8 { +>m8 : Symbol(m8, Decl(commentsModules.ts, 63, 17)) + + /** Exported class comment*/ + export class c { +>c : Symbol(c, Decl(commentsModules.ts, 65, 22)) + } + } +} +new m5.m6.m7.m8.c(); +>m5.m6.m7.m8.c : Symbol(m5.m6.m7.m8.c, Decl(commentsModules.ts, 65, 22)) +>m5.m6.m7.m8 : Symbol(m5.m6.m7.m8, Decl(commentsModules.ts, 63, 17)) +>m5.m6.m7 : Symbol(m5.m6.m7, Decl(commentsModules.ts, 63, 13)) +>m5.m6 : Symbol(m5.m6, Decl(commentsModules.ts, 63, 10)) +>m5 : Symbol(m5, Decl(commentsModules.ts, 61, 20)) +>m6 : Symbol(m5.m6, Decl(commentsModules.ts, 63, 10)) +>m7 : Symbol(m5.m6.m7, Decl(commentsModules.ts, 63, 13)) +>m8 : Symbol(m5.m6.m7.m8, Decl(commentsModules.ts, 63, 17)) +>c : Symbol(m5.m6.m7.m8.c, Decl(commentsModules.ts, 65, 22)) + +module m6.m7 { +>m6 : Symbol(m6, Decl(commentsModules.ts, 71, 20)) +>m7 : Symbol(m7, Decl(commentsModules.ts, 72, 10)) + + export module m8 { +>m8 : Symbol(m8, Decl(commentsModules.ts, 72, 14)) + + /** Exported class comment*/ + export class c { +>c : Symbol(c, Decl(commentsModules.ts, 73, 22)) + } + } +} +new m6.m7.m8.c(); +>m6.m7.m8.c : Symbol(m6.m7.m8.c, Decl(commentsModules.ts, 73, 22)) +>m6.m7.m8 : Symbol(m6.m7.m8, Decl(commentsModules.ts, 72, 14)) +>m6.m7 : Symbol(m6.m7, Decl(commentsModules.ts, 72, 10)) +>m6 : Symbol(m6, Decl(commentsModules.ts, 71, 20)) +>m7 : Symbol(m6.m7, Decl(commentsModules.ts, 72, 10)) +>m8 : Symbol(m6.m7.m8, Decl(commentsModules.ts, 72, 14)) +>c : Symbol(m6.m7.m8.c, Decl(commentsModules.ts, 73, 22)) + +module m7.m8 { +>m7 : Symbol(m7, Decl(commentsModules.ts, 79, 17)) +>m8 : Symbol(m8, Decl(commentsModules.ts, 80, 10)) + + /** module m9 comment*/ + export module m9 { +>m9 : Symbol(m9, Decl(commentsModules.ts, 80, 14)) + + /** Exported class comment*/ + export class c { +>c : Symbol(c, Decl(commentsModules.ts, 82, 22)) + } + + /** class d */ + class d { +>d : Symbol(d, Decl(commentsModules.ts, 85, 9)) + } + + // class e + export class e { +>e : Symbol(e, Decl(commentsModules.ts, 89, 9)) + } + } +} +new m7.m8.m9.c(); +>m7.m8.m9.c : Symbol(m7.m8.m9.c, Decl(commentsModules.ts, 82, 22)) +>m7.m8.m9 : Symbol(m7.m8.m9, Decl(commentsModules.ts, 80, 14)) +>m7.m8 : Symbol(m7.m8, Decl(commentsModules.ts, 80, 10)) +>m7 : Symbol(m7, Decl(commentsModules.ts, 79, 17)) +>m8 : Symbol(m7.m8, Decl(commentsModules.ts, 80, 10)) +>m9 : Symbol(m7.m8.m9, Decl(commentsModules.ts, 80, 14)) +>c : Symbol(m7.m8.m9.c, Decl(commentsModules.ts, 82, 22)) + diff --git a/tests/baselines/reference/commentsMultiModuleMultiFile.symbols b/tests/baselines/reference/commentsMultiModuleMultiFile.symbols new file mode 100644 index 00000000000..1ca90840af4 --- /dev/null +++ b/tests/baselines/reference/commentsMultiModuleMultiFile.symbols @@ -0,0 +1,59 @@ +=== tests/cases/compiler/commentsMultiModuleMultiFile_1.ts === +import m = require('commentsMultiModuleMultiFile_0'); +>m : Symbol(m, Decl(commentsMultiModuleMultiFile_1.ts, 0, 0)) + +/** this is multi module 3 comment*/ +export module multiM { +>multiM : Symbol(multiM, Decl(commentsMultiModuleMultiFile_1.ts, 0, 53)) + + /** class d comment*/ + export class d { +>d : Symbol(d, Decl(commentsMultiModuleMultiFile_1.ts, 2, 22)) + } + + /// class f comment + export class f { +>f : Symbol(f, Decl(commentsMultiModuleMultiFile_1.ts, 5, 5)) + } +} +new multiM.d(); +>multiM.d : Symbol(multiM.d, Decl(commentsMultiModuleMultiFile_1.ts, 2, 22)) +>multiM : Symbol(multiM, Decl(commentsMultiModuleMultiFile_1.ts, 0, 53)) +>d : Symbol(multiM.d, Decl(commentsMultiModuleMultiFile_1.ts, 2, 22)) + +=== tests/cases/compiler/commentsMultiModuleMultiFile_0.ts === + +/** this is multi declare module*/ +export module multiM { +>multiM : Symbol(multiM, Decl(commentsMultiModuleMultiFile_0.ts, 0, 0), Decl(commentsMultiModuleMultiFile_0.ts, 6, 1)) + + /// class b comment + export class b { +>b : Symbol(b, Decl(commentsMultiModuleMultiFile_0.ts, 2, 22)) + } +} +/** thi is multi module 2*/ +export module multiM { +>multiM : Symbol(multiM, Decl(commentsMultiModuleMultiFile_0.ts, 0, 0), Decl(commentsMultiModuleMultiFile_0.ts, 6, 1)) + + /** class c comment*/ + export class c { +>c : Symbol(c, Decl(commentsMultiModuleMultiFile_0.ts, 8, 22)) + } + + // class e comment + export class e { +>e : Symbol(e, Decl(commentsMultiModuleMultiFile_0.ts, 11, 5)) + } +} + +new multiM.b(); +>multiM.b : Symbol(multiM.b, Decl(commentsMultiModuleMultiFile_0.ts, 2, 22)) +>multiM : Symbol(multiM, Decl(commentsMultiModuleMultiFile_0.ts, 0, 0), Decl(commentsMultiModuleMultiFile_0.ts, 6, 1)) +>b : Symbol(multiM.b, Decl(commentsMultiModuleMultiFile_0.ts, 2, 22)) + +new multiM.c(); +>multiM.c : Symbol(multiM.c, Decl(commentsMultiModuleMultiFile_0.ts, 8, 22)) +>multiM : Symbol(multiM, Decl(commentsMultiModuleMultiFile_0.ts, 0, 0), Decl(commentsMultiModuleMultiFile_0.ts, 6, 1)) +>c : Symbol(multiM.c, Decl(commentsMultiModuleMultiFile_0.ts, 8, 22)) + diff --git a/tests/baselines/reference/commentsMultiModuleSingleFile.symbols b/tests/baselines/reference/commentsMultiModuleSingleFile.symbols new file mode 100644 index 00000000000..678d9aaf830 --- /dev/null +++ b/tests/baselines/reference/commentsMultiModuleSingleFile.symbols @@ -0,0 +1,41 @@ +=== tests/cases/compiler/commentsMultiModuleSingleFile.ts === + +/** this is multi declare module*/ +module multiM { +>multiM : Symbol(multiM, Decl(commentsMultiModuleSingleFile.ts, 0, 0), Decl(commentsMultiModuleSingleFile.ts, 10, 1)) + + /** class b*/ + export class b { +>b : Symbol(b, Decl(commentsMultiModuleSingleFile.ts, 2, 15)) + } + + // class d + export class d { +>d : Symbol(d, Decl(commentsMultiModuleSingleFile.ts, 5, 5)) + } +} + +/// this is multi module 2 +module multiM { +>multiM : Symbol(multiM, Decl(commentsMultiModuleSingleFile.ts, 0, 0), Decl(commentsMultiModuleSingleFile.ts, 10, 1)) + + /** class c comment*/ + export class c { +>c : Symbol(c, Decl(commentsMultiModuleSingleFile.ts, 13, 15)) + } + + /// class e + export class e { +>e : Symbol(e, Decl(commentsMultiModuleSingleFile.ts, 16, 5)) + } +} +new multiM.b(); +>multiM.b : Symbol(multiM.b, Decl(commentsMultiModuleSingleFile.ts, 2, 15)) +>multiM : Symbol(multiM, Decl(commentsMultiModuleSingleFile.ts, 0, 0), Decl(commentsMultiModuleSingleFile.ts, 10, 1)) +>b : Symbol(multiM.b, Decl(commentsMultiModuleSingleFile.ts, 2, 15)) + +new multiM.c(); +>multiM.c : Symbol(multiM.c, Decl(commentsMultiModuleSingleFile.ts, 13, 15)) +>multiM : Symbol(multiM, Decl(commentsMultiModuleSingleFile.ts, 0, 0), Decl(commentsMultiModuleSingleFile.ts, 10, 1)) +>c : Symbol(multiM.c, Decl(commentsMultiModuleSingleFile.ts, 13, 15)) + diff --git a/tests/baselines/reference/commentsOnObjectLiteral3.symbols b/tests/baselines/reference/commentsOnObjectLiteral3.symbols new file mode 100644 index 00000000000..3d58fe2d6d7 --- /dev/null +++ b/tests/baselines/reference/commentsOnObjectLiteral3.symbols @@ -0,0 +1,35 @@ +=== tests/cases/compiler/commentsOnObjectLiteral3.ts === + +var v = { +>v : Symbol(v, Decl(commentsOnObjectLiteral3.ts, 1, 3)) + + //property + prop: 1 /* multiple trailing comments */ /*trailing comments*/, +>prop : Symbol(prop, Decl(commentsOnObjectLiteral3.ts, 1, 9)) + + //property + func: function () { +>func : Symbol(func, Decl(commentsOnObjectLiteral3.ts, 3, 64)) + + }, + //PropertyName + CallSignature + func1() { }, +>func1 : Symbol(func1, Decl(commentsOnObjectLiteral3.ts, 6, 3)) + + //getter + get a() { +>a : Symbol(a, Decl(commentsOnObjectLiteral3.ts, 8, 13), Decl(commentsOnObjectLiteral3.ts, 12, 18)) + + return this.prop; + } /*trailing 1*/, + //setter + set a(value) { +>a : Symbol(a, Decl(commentsOnObjectLiteral3.ts, 8, 13), Decl(commentsOnObjectLiteral3.ts, 12, 18)) +>value : Symbol(value, Decl(commentsOnObjectLiteral3.ts, 14, 7)) + + this.prop = value; +>value : Symbol(value, Decl(commentsOnObjectLiteral3.ts, 14, 7)) + + } // trailing 2 +}; + diff --git a/tests/baselines/reference/commentsOnObjectLiteral3.types b/tests/baselines/reference/commentsOnObjectLiteral3.types index e81bd646b5a..a63920fce0f 100644 --- a/tests/baselines/reference/commentsOnObjectLiteral3.types +++ b/tests/baselines/reference/commentsOnObjectLiteral3.types @@ -7,6 +7,7 @@ var v = { //property prop: 1 /* multiple trailing comments */ /*trailing comments*/, >prop : number +>1 : number //property func: function () { diff --git a/tests/baselines/reference/commentsOnObjectLiteral4.symbols b/tests/baselines/reference/commentsOnObjectLiteral4.symbols new file mode 100644 index 00000000000..c1762cb75c8 --- /dev/null +++ b/tests/baselines/reference/commentsOnObjectLiteral4.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/commentsOnObjectLiteral4.ts === + +var v = { +>v : Symbol(v, Decl(commentsOnObjectLiteral4.ts, 1, 3)) + + /** + * @type {number} + */ + get bar(): number { +>bar : Symbol(bar, Decl(commentsOnObjectLiteral4.ts, 1, 9)) + + return this._bar; + } +} diff --git a/tests/baselines/reference/commentsOnReturnStatement1.symbols b/tests/baselines/reference/commentsOnReturnStatement1.symbols new file mode 100644 index 00000000000..5c75e2e29d9 --- /dev/null +++ b/tests/baselines/reference/commentsOnReturnStatement1.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/commentsOnReturnStatement1.ts === +class DebugClass { +>DebugClass : Symbol(DebugClass, Decl(commentsOnReturnStatement1.ts, 0, 0)) + + public static debugFunc() { +>debugFunc : Symbol(DebugClass.debugFunc, Decl(commentsOnReturnStatement1.ts, 0, 18)) + + // Start Debugger Test Code + var i = 0; +>i : Symbol(i, Decl(commentsOnReturnStatement1.ts, 3, 11)) + + // End Debugger Test Code + return true; + } +} diff --git a/tests/baselines/reference/commentsOnReturnStatement1.types b/tests/baselines/reference/commentsOnReturnStatement1.types index 0d447b6536f..d44c91c0a8c 100644 --- a/tests/baselines/reference/commentsOnReturnStatement1.types +++ b/tests/baselines/reference/commentsOnReturnStatement1.types @@ -8,8 +8,10 @@ class DebugClass { // Start Debugger Test Code var i = 0; >i : number +>0 : number // End Debugger Test Code return true; +>true : boolean } } diff --git a/tests/baselines/reference/commentsOnStaticMembers.symbols b/tests/baselines/reference/commentsOnStaticMembers.symbols new file mode 100644 index 00000000000..4e59ba7bca9 --- /dev/null +++ b/tests/baselines/reference/commentsOnStaticMembers.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/commentsOnStaticMembers.ts === + +class test { +>test : Symbol(test, Decl(commentsOnStaticMembers.ts, 0, 0)) + + /** + * p1 comment appears in output + */ + public static p1: string = ""; +>p1 : Symbol(test.p1, Decl(commentsOnStaticMembers.ts, 1, 12)) + + /** + * p2 comment does not appear in output + */ + public static p2: string; +>p2 : Symbol(test.p2, Decl(commentsOnStaticMembers.ts, 5, 34)) + + /** + * p3 comment appears in output + */ + private static p3: string = ""; +>p3 : Symbol(test.p3, Decl(commentsOnStaticMembers.ts, 9, 29)) + + /** + * p4 comment does not appear in output + */ + private static p4: string; +>p4 : Symbol(test.p4, Decl(commentsOnStaticMembers.ts, 14, 35)) +} diff --git a/tests/baselines/reference/commentsOnStaticMembers.types b/tests/baselines/reference/commentsOnStaticMembers.types index 5c201c7709a..46a1ca211ff 100644 --- a/tests/baselines/reference/commentsOnStaticMembers.types +++ b/tests/baselines/reference/commentsOnStaticMembers.types @@ -8,6 +8,7 @@ class test { */ public static p1: string = ""; >p1 : string +>"" : string /** * p2 comment does not appear in output @@ -20,6 +21,7 @@ class test { */ private static p3: string = ""; >p3 : string +>"" : string /** * p4 comment does not appear in output diff --git a/tests/baselines/reference/commentsOverloads.symbols b/tests/baselines/reference/commentsOverloads.symbols new file mode 100644 index 00000000000..b504e35c5ac --- /dev/null +++ b/tests/baselines/reference/commentsOverloads.symbols @@ -0,0 +1,417 @@ +=== tests/cases/compiler/commentsOverloads.ts === +/** this is signature 1*/ +function f1(/**param a*/a: number): number; +>f1 : Symbol(f1, Decl(commentsOverloads.ts, 0, 0), Decl(commentsOverloads.ts, 1, 43), Decl(commentsOverloads.ts, 2, 31)) +>a : Symbol(a, Decl(commentsOverloads.ts, 1, 12)) + +function f1(b: string): number; +>f1 : Symbol(f1, Decl(commentsOverloads.ts, 0, 0), Decl(commentsOverloads.ts, 1, 43), Decl(commentsOverloads.ts, 2, 31)) +>b : Symbol(b, Decl(commentsOverloads.ts, 2, 12)) + +function f1(aOrb: any) { +>f1 : Symbol(f1, Decl(commentsOverloads.ts, 0, 0), Decl(commentsOverloads.ts, 1, 43), Decl(commentsOverloads.ts, 2, 31)) +>aOrb : Symbol(aOrb, Decl(commentsOverloads.ts, 3, 12)) + + return 10; +} +f1("hello"); +>f1 : Symbol(f1, Decl(commentsOverloads.ts, 0, 0), Decl(commentsOverloads.ts, 1, 43), Decl(commentsOverloads.ts, 2, 31)) + +f1(10); +>f1 : Symbol(f1, Decl(commentsOverloads.ts, 0, 0), Decl(commentsOverloads.ts, 1, 43), Decl(commentsOverloads.ts, 2, 31)) + +function f2(a: number): number; +>f2 : Symbol(f2, Decl(commentsOverloads.ts, 7, 7), Decl(commentsOverloads.ts, 8, 31), Decl(commentsOverloads.ts, 10, 31)) +>a : Symbol(a, Decl(commentsOverloads.ts, 8, 12)) + +/** this is signature 2*/ +function f2(b: string): number; +>f2 : Symbol(f2, Decl(commentsOverloads.ts, 7, 7), Decl(commentsOverloads.ts, 8, 31), Decl(commentsOverloads.ts, 10, 31)) +>b : Symbol(b, Decl(commentsOverloads.ts, 10, 12)) + +/** this is f2 var comment*/ +function f2(aOrb: any) { +>f2 : Symbol(f2, Decl(commentsOverloads.ts, 7, 7), Decl(commentsOverloads.ts, 8, 31), Decl(commentsOverloads.ts, 10, 31)) +>aOrb : Symbol(aOrb, Decl(commentsOverloads.ts, 12, 12)) + + return 10; +} +f2("hello"); +>f2 : Symbol(f2, Decl(commentsOverloads.ts, 7, 7), Decl(commentsOverloads.ts, 8, 31), Decl(commentsOverloads.ts, 10, 31)) + +f2(10); +>f2 : Symbol(f2, Decl(commentsOverloads.ts, 7, 7), Decl(commentsOverloads.ts, 8, 31), Decl(commentsOverloads.ts, 10, 31)) + +function f3(a: number): number; +>f3 : Symbol(f3, Decl(commentsOverloads.ts, 16, 7), Decl(commentsOverloads.ts, 17, 31), Decl(commentsOverloads.ts, 18, 31)) +>a : Symbol(a, Decl(commentsOverloads.ts, 17, 12)) + +function f3(b: string): number; +>f3 : Symbol(f3, Decl(commentsOverloads.ts, 16, 7), Decl(commentsOverloads.ts, 17, 31), Decl(commentsOverloads.ts, 18, 31)) +>b : Symbol(b, Decl(commentsOverloads.ts, 18, 12)) + +function f3(aOrb: any) { +>f3 : Symbol(f3, Decl(commentsOverloads.ts, 16, 7), Decl(commentsOverloads.ts, 17, 31), Decl(commentsOverloads.ts, 18, 31)) +>aOrb : Symbol(aOrb, Decl(commentsOverloads.ts, 19, 12)) + + return 10; +} +f3("hello"); +>f3 : Symbol(f3, Decl(commentsOverloads.ts, 16, 7), Decl(commentsOverloads.ts, 17, 31), Decl(commentsOverloads.ts, 18, 31)) + +f3(10); +>f3 : Symbol(f3, Decl(commentsOverloads.ts, 16, 7), Decl(commentsOverloads.ts, 17, 31), Decl(commentsOverloads.ts, 18, 31)) + +/** this is signature 4 - with number parameter*/ +function f4(/**param a*/a: number): number; +>f4 : Symbol(f4, Decl(commentsOverloads.ts, 23, 7), Decl(commentsOverloads.ts, 25, 43), Decl(commentsOverloads.ts, 27, 31)) +>a : Symbol(a, Decl(commentsOverloads.ts, 25, 12)) + +/** this is signature 4 - with string parameter*/ +function f4(b: string): number; +>f4 : Symbol(f4, Decl(commentsOverloads.ts, 23, 7), Decl(commentsOverloads.ts, 25, 43), Decl(commentsOverloads.ts, 27, 31)) +>b : Symbol(b, Decl(commentsOverloads.ts, 27, 12)) + +function f4(aOrb: any) { +>f4 : Symbol(f4, Decl(commentsOverloads.ts, 23, 7), Decl(commentsOverloads.ts, 25, 43), Decl(commentsOverloads.ts, 27, 31)) +>aOrb : Symbol(aOrb, Decl(commentsOverloads.ts, 28, 12)) + + return 10; +} +f4("hello"); +>f4 : Symbol(f4, Decl(commentsOverloads.ts, 23, 7), Decl(commentsOverloads.ts, 25, 43), Decl(commentsOverloads.ts, 27, 31)) + +f4(10); +>f4 : Symbol(f4, Decl(commentsOverloads.ts, 23, 7), Decl(commentsOverloads.ts, 25, 43), Decl(commentsOverloads.ts, 27, 31)) + +interface i1 { +>i1 : Symbol(i1, Decl(commentsOverloads.ts, 32, 7)) + + /**this signature 1*/ + (/**param a*/ a: number): number; +>a : Symbol(a, Decl(commentsOverloads.ts, 35, 5)) + + /**this is signature 2*/ + (b: string): number; +>b : Symbol(b, Decl(commentsOverloads.ts, 37, 5)) + + /** foo 1*/ + foo(a: number): number; +>foo : Symbol(foo, Decl(commentsOverloads.ts, 37, 24), Decl(commentsOverloads.ts, 39, 27), Decl(commentsOverloads.ts, 41, 27), Decl(commentsOverloads.ts, 43, 31)) +>a : Symbol(a, Decl(commentsOverloads.ts, 39, 8)) + + /** foo 2*/ + foo(b: string): number; +>foo : Symbol(foo, Decl(commentsOverloads.ts, 37, 24), Decl(commentsOverloads.ts, 39, 27), Decl(commentsOverloads.ts, 41, 27), Decl(commentsOverloads.ts, 43, 31)) +>b : Symbol(b, Decl(commentsOverloads.ts, 41, 8)) + + // foo 3 + foo(arr: number[]): number; +>foo : Symbol(foo, Decl(commentsOverloads.ts, 37, 24), Decl(commentsOverloads.ts, 39, 27), Decl(commentsOverloads.ts, 41, 27), Decl(commentsOverloads.ts, 43, 31)) +>arr : Symbol(arr, Decl(commentsOverloads.ts, 43, 8)) + + /** foo 4 */ + foo(arr: string[]): number; +>foo : Symbol(foo, Decl(commentsOverloads.ts, 37, 24), Decl(commentsOverloads.ts, 39, 27), Decl(commentsOverloads.ts, 41, 27), Decl(commentsOverloads.ts, 43, 31)) +>arr : Symbol(arr, Decl(commentsOverloads.ts, 45, 8)) + + foo2(a: number): number; +>foo2 : Symbol(foo2, Decl(commentsOverloads.ts, 45, 31), Decl(commentsOverloads.ts, 47, 28)) +>a : Symbol(a, Decl(commentsOverloads.ts, 47, 9)) + + /** foo2 2*/ + foo2(b: string): number; +>foo2 : Symbol(foo2, Decl(commentsOverloads.ts, 45, 31), Decl(commentsOverloads.ts, 47, 28)) +>b : Symbol(b, Decl(commentsOverloads.ts, 49, 9)) + + foo3(a: number): number; +>foo3 : Symbol(foo3, Decl(commentsOverloads.ts, 49, 28), Decl(commentsOverloads.ts, 50, 28)) +>a : Symbol(a, Decl(commentsOverloads.ts, 50, 9)) + + foo3(b: string): number; +>foo3 : Symbol(foo3, Decl(commentsOverloads.ts, 49, 28), Decl(commentsOverloads.ts, 50, 28)) +>b : Symbol(b, Decl(commentsOverloads.ts, 51, 9)) + + /** foo4 1*/ + foo4(a: number): number; +>foo4 : Symbol(foo4, Decl(commentsOverloads.ts, 51, 28), Decl(commentsOverloads.ts, 53, 28), Decl(commentsOverloads.ts, 54, 28)) +>a : Symbol(a, Decl(commentsOverloads.ts, 53, 9)) + + foo4(b: string): number; +>foo4 : Symbol(foo4, Decl(commentsOverloads.ts, 51, 28), Decl(commentsOverloads.ts, 53, 28), Decl(commentsOverloads.ts, 54, 28)) +>b : Symbol(b, Decl(commentsOverloads.ts, 54, 9)) + + /** foo4 any */ + foo4(c: any): any; +>foo4 : Symbol(foo4, Decl(commentsOverloads.ts, 51, 28), Decl(commentsOverloads.ts, 53, 28), Decl(commentsOverloads.ts, 54, 28)) +>c : Symbol(c, Decl(commentsOverloads.ts, 56, 9)) + + /// new 1 + new (a: string); +>a : Symbol(a, Decl(commentsOverloads.ts, 58, 9)) + + /** new 1*/ + new (b: number); +>b : Symbol(b, Decl(commentsOverloads.ts, 60, 9)) +} +var i1_i: i1; +>i1_i : Symbol(i1_i, Decl(commentsOverloads.ts, 62, 3)) +>i1 : Symbol(i1, Decl(commentsOverloads.ts, 32, 7)) + +interface i2 { +>i2 : Symbol(i2, Decl(commentsOverloads.ts, 62, 13)) + + new (a: string); +>a : Symbol(a, Decl(commentsOverloads.ts, 64, 9)) + + /** new 2*/ + new (b: number); +>b : Symbol(b, Decl(commentsOverloads.ts, 66, 9)) + + (a: number): number; +>a : Symbol(a, Decl(commentsOverloads.ts, 67, 5)) + + /**this is signature 2*/ + (b: string): number; +>b : Symbol(b, Decl(commentsOverloads.ts, 69, 5)) +} +var i2_i: i2; +>i2_i : Symbol(i2_i, Decl(commentsOverloads.ts, 71, 3)) +>i2 : Symbol(i2, Decl(commentsOverloads.ts, 62, 13)) + +interface i3 { +>i3 : Symbol(i3, Decl(commentsOverloads.ts, 71, 13)) + + /** new 1*/ + new (a: string); +>a : Symbol(a, Decl(commentsOverloads.ts, 74, 9)) + + /** new 2*/ + new (b: number); +>b : Symbol(b, Decl(commentsOverloads.ts, 76, 9)) + + /**this is signature 1*/ + (a: number): number; +>a : Symbol(a, Decl(commentsOverloads.ts, 78, 5)) + + (b: string): number; +>b : Symbol(b, Decl(commentsOverloads.ts, 79, 5)) +} +var i3_i: i3; +>i3_i : Symbol(i3_i, Decl(commentsOverloads.ts, 81, 3)) +>i3 : Symbol(i3, Decl(commentsOverloads.ts, 71, 13)) + +interface i4 { +>i4 : Symbol(i4, Decl(commentsOverloads.ts, 81, 13)) + + new (a: string); +>a : Symbol(a, Decl(commentsOverloads.ts, 83, 9)) + + new (b: number); +>b : Symbol(b, Decl(commentsOverloads.ts, 84, 9)) + + (a: number): number; +>a : Symbol(a, Decl(commentsOverloads.ts, 85, 5)) + + (b: string): number; +>b : Symbol(b, Decl(commentsOverloads.ts, 86, 5)) +} +class c { +>c : Symbol(c, Decl(commentsOverloads.ts, 87, 1)) + + public prop1(a: number): number; +>prop1 : Symbol(prop1, Decl(commentsOverloads.ts, 88, 9), Decl(commentsOverloads.ts, 89, 36), Decl(commentsOverloads.ts, 90, 36)) +>a : Symbol(a, Decl(commentsOverloads.ts, 89, 17)) + + public prop1(b: string): number; +>prop1 : Symbol(prop1, Decl(commentsOverloads.ts, 88, 9), Decl(commentsOverloads.ts, 89, 36), Decl(commentsOverloads.ts, 90, 36)) +>b : Symbol(b, Decl(commentsOverloads.ts, 90, 17)) + + public prop1(aorb: any) { +>prop1 : Symbol(prop1, Decl(commentsOverloads.ts, 88, 9), Decl(commentsOverloads.ts, 89, 36), Decl(commentsOverloads.ts, 90, 36)) +>aorb : Symbol(aorb, Decl(commentsOverloads.ts, 91, 17)) + + return 10; + } + /** prop2 1*/ + public prop2(a: number): number; +>prop2 : Symbol(prop2, Decl(commentsOverloads.ts, 93, 5), Decl(commentsOverloads.ts, 95, 36), Decl(commentsOverloads.ts, 96, 36)) +>a : Symbol(a, Decl(commentsOverloads.ts, 95, 17)) + + public prop2(b: string): number; +>prop2 : Symbol(prop2, Decl(commentsOverloads.ts, 93, 5), Decl(commentsOverloads.ts, 95, 36), Decl(commentsOverloads.ts, 96, 36)) +>b : Symbol(b, Decl(commentsOverloads.ts, 96, 17)) + + public prop2(aorb: any) { +>prop2 : Symbol(prop2, Decl(commentsOverloads.ts, 93, 5), Decl(commentsOverloads.ts, 95, 36), Decl(commentsOverloads.ts, 96, 36)) +>aorb : Symbol(aorb, Decl(commentsOverloads.ts, 97, 17)) + + return 10; + } + public prop3(a: number): number; +>prop3 : Symbol(prop3, Decl(commentsOverloads.ts, 99, 5), Decl(commentsOverloads.ts, 100, 36), Decl(commentsOverloads.ts, 102, 36)) +>a : Symbol(a, Decl(commentsOverloads.ts, 100, 17)) + + /** prop3 2*/ + public prop3(b: string): number; +>prop3 : Symbol(prop3, Decl(commentsOverloads.ts, 99, 5), Decl(commentsOverloads.ts, 100, 36), Decl(commentsOverloads.ts, 102, 36)) +>b : Symbol(b, Decl(commentsOverloads.ts, 102, 17)) + + public prop3(aorb: any) { +>prop3 : Symbol(prop3, Decl(commentsOverloads.ts, 99, 5), Decl(commentsOverloads.ts, 100, 36), Decl(commentsOverloads.ts, 102, 36)) +>aorb : Symbol(aorb, Decl(commentsOverloads.ts, 103, 17)) + + return 10; + } + /** prop4 1*/ + public prop4(a: number): number; +>prop4 : Symbol(prop4, Decl(commentsOverloads.ts, 105, 5), Decl(commentsOverloads.ts, 107, 36), Decl(commentsOverloads.ts, 109, 36)) +>a : Symbol(a, Decl(commentsOverloads.ts, 107, 17)) + + /** prop4 2*/ + public prop4(b: string): number; +>prop4 : Symbol(prop4, Decl(commentsOverloads.ts, 105, 5), Decl(commentsOverloads.ts, 107, 36), Decl(commentsOverloads.ts, 109, 36)) +>b : Symbol(b, Decl(commentsOverloads.ts, 109, 17)) + + public prop4(aorb: any) { +>prop4 : Symbol(prop4, Decl(commentsOverloads.ts, 105, 5), Decl(commentsOverloads.ts, 107, 36), Decl(commentsOverloads.ts, 109, 36)) +>aorb : Symbol(aorb, Decl(commentsOverloads.ts, 110, 17)) + + return 10; + } + /** prop5 1*/ + public prop5(a: number): number; +>prop5 : Symbol(prop5, Decl(commentsOverloads.ts, 112, 5), Decl(commentsOverloads.ts, 114, 36), Decl(commentsOverloads.ts, 116, 36)) +>a : Symbol(a, Decl(commentsOverloads.ts, 114, 17)) + + /** prop5 2*/ + public prop5(b: string): number; +>prop5 : Symbol(prop5, Decl(commentsOverloads.ts, 112, 5), Decl(commentsOverloads.ts, 114, 36), Decl(commentsOverloads.ts, 116, 36)) +>b : Symbol(b, Decl(commentsOverloads.ts, 116, 17)) + + /** Prop5 implementaion*/ + public prop5(aorb: any) { +>prop5 : Symbol(prop5, Decl(commentsOverloads.ts, 112, 5), Decl(commentsOverloads.ts, 114, 36), Decl(commentsOverloads.ts, 116, 36)) +>aorb : Symbol(aorb, Decl(commentsOverloads.ts, 118, 17)) + + return 10; + } +} +class c1 { +>c1 : Symbol(c1, Decl(commentsOverloads.ts, 121, 1)) + + constructor(a: number); +>a : Symbol(a, Decl(commentsOverloads.ts, 123, 16)) + + constructor(b: string); +>b : Symbol(b, Decl(commentsOverloads.ts, 124, 16)) + + constructor(aorb: any) { +>aorb : Symbol(aorb, Decl(commentsOverloads.ts, 125, 16)) + } +} +class c2 { +>c2 : Symbol(c2, Decl(commentsOverloads.ts, 127, 1)) + + /** c2 1*/ + constructor(a: number); +>a : Symbol(a, Decl(commentsOverloads.ts, 130, 16)) + + // c2 2 + constructor(b: string); +>b : Symbol(b, Decl(commentsOverloads.ts, 132, 16)) + + constructor(aorb: any) { +>aorb : Symbol(aorb, Decl(commentsOverloads.ts, 133, 16)) + } +} +class c3 { +>c3 : Symbol(c3, Decl(commentsOverloads.ts, 135, 1)) + + constructor(a: number); +>a : Symbol(a, Decl(commentsOverloads.ts, 137, 16)) + + /** c3 2*/ + constructor(b: string); +>b : Symbol(b, Decl(commentsOverloads.ts, 139, 16)) + + constructor(aorb: any) { +>aorb : Symbol(aorb, Decl(commentsOverloads.ts, 140, 16)) + } +} +class c4 { +>c4 : Symbol(c4, Decl(commentsOverloads.ts, 142, 1)) + + /** c4 1*/ + constructor(a: number); +>a : Symbol(a, Decl(commentsOverloads.ts, 145, 16)) + + /** c4 2*/ + constructor(b: string); +>b : Symbol(b, Decl(commentsOverloads.ts, 147, 16)) + + /** c4 3 */ + constructor(aorb: any) { +>aorb : Symbol(aorb, Decl(commentsOverloads.ts, 149, 16)) + } +} +class c5 { +>c5 : Symbol(c5, Decl(commentsOverloads.ts, 151, 1)) + + /** c5 1*/ + constructor(a: number); +>a : Symbol(a, Decl(commentsOverloads.ts, 154, 16)) + + /** c5 2*/ + constructor(b: string); +>b : Symbol(b, Decl(commentsOverloads.ts, 156, 16)) + + /** c5 implementation*/ + constructor(aorb: any) { +>aorb : Symbol(aorb, Decl(commentsOverloads.ts, 158, 16)) + } +} +var c_i = new c(); +>c_i : Symbol(c_i, Decl(commentsOverloads.ts, 161, 3)) +>c : Symbol(c, Decl(commentsOverloads.ts, 87, 1)) + +var c1_i_1 = new c1(10); +>c1_i_1 : Symbol(c1_i_1, Decl(commentsOverloads.ts, 163, 3)) +>c1 : Symbol(c1, Decl(commentsOverloads.ts, 121, 1)) + +var c1_i_2 = new c1("hello"); +>c1_i_2 : Symbol(c1_i_2, Decl(commentsOverloads.ts, 164, 3)) +>c1 : Symbol(c1, Decl(commentsOverloads.ts, 121, 1)) + +var c2_i_1 = new c2(10); +>c2_i_1 : Symbol(c2_i_1, Decl(commentsOverloads.ts, 165, 3)) +>c2 : Symbol(c2, Decl(commentsOverloads.ts, 127, 1)) + +var c2_i_2 = new c2("hello"); +>c2_i_2 : Symbol(c2_i_2, Decl(commentsOverloads.ts, 166, 3)) +>c2 : Symbol(c2, Decl(commentsOverloads.ts, 127, 1)) + +var c3_i_1 = new c3(10); +>c3_i_1 : Symbol(c3_i_1, Decl(commentsOverloads.ts, 167, 3)) +>c3 : Symbol(c3, Decl(commentsOverloads.ts, 135, 1)) + +var c3_i_2 = new c3("hello"); +>c3_i_2 : Symbol(c3_i_2, Decl(commentsOverloads.ts, 168, 3)) +>c3 : Symbol(c3, Decl(commentsOverloads.ts, 135, 1)) + +var c4_i_1 = new c4(10); +>c4_i_1 : Symbol(c4_i_1, Decl(commentsOverloads.ts, 169, 3)) +>c4 : Symbol(c4, Decl(commentsOverloads.ts, 142, 1)) + +var c4_i_2 = new c4("hello"); +>c4_i_2 : Symbol(c4_i_2, Decl(commentsOverloads.ts, 170, 3)) +>c4 : Symbol(c4, Decl(commentsOverloads.ts, 142, 1)) + +var c5_i_1 = new c5(10); +>c5_i_1 : Symbol(c5_i_1, Decl(commentsOverloads.ts, 171, 3)) +>c5 : Symbol(c5, Decl(commentsOverloads.ts, 151, 1)) + +var c5_i_2 = new c5("hello"); +>c5_i_2 : Symbol(c5_i_2, Decl(commentsOverloads.ts, 172, 3)) +>c5 : Symbol(c5, Decl(commentsOverloads.ts, 151, 1)) + diff --git a/tests/baselines/reference/commentsOverloads.types b/tests/baselines/reference/commentsOverloads.types index 9984c1b5b26..3281ab83ab6 100644 --- a/tests/baselines/reference/commentsOverloads.types +++ b/tests/baselines/reference/commentsOverloads.types @@ -13,14 +13,17 @@ function f1(aOrb: any) { >aOrb : any return 10; +>10 : number } f1("hello"); >f1("hello") : number >f1 : { (a: number): number; (b: string): number; } +>"hello" : string f1(10); >f1(10) : number >f1 : { (a: number): number; (b: string): number; } +>10 : number function f2(a: number): number; >f2 : { (a: number): number; (b: string): number; } @@ -37,14 +40,17 @@ function f2(aOrb: any) { >aOrb : any return 10; +>10 : number } f2("hello"); >f2("hello") : number >f2 : { (a: number): number; (b: string): number; } +>"hello" : string f2(10); >f2(10) : number >f2 : { (a: number): number; (b: string): number; } +>10 : number function f3(a: number): number; >f3 : { (a: number): number; (b: string): number; } @@ -59,14 +65,17 @@ function f3(aOrb: any) { >aOrb : any return 10; +>10 : number } f3("hello"); >f3("hello") : number >f3 : { (a: number): number; (b: string): number; } +>"hello" : string f3(10); >f3(10) : number >f3 : { (a: number): number; (b: string): number; } +>10 : number /** this is signature 4 - with number parameter*/ function f4(/**param a*/a: number): number; @@ -83,14 +92,17 @@ function f4(aOrb: any) { >aOrb : any return 10; +>10 : number } f4("hello"); >f4("hello") : number >f4 : { (a: number): number; (b: string): number; } +>"hello" : string f4(10); >f4(10) : number >f4 : { (a: number): number; (b: string): number; } +>10 : number interface i1 { >i1 : i1 @@ -240,6 +252,7 @@ class c { >aorb : any return 10; +>10 : number } /** prop2 1*/ public prop2(a: number): number; @@ -255,6 +268,7 @@ class c { >aorb : any return 10; +>10 : number } public prop3(a: number): number; >prop3 : { (a: number): number; (b: string): number; } @@ -270,6 +284,7 @@ class c { >aorb : any return 10; +>10 : number } /** prop4 1*/ public prop4(a: number): number; @@ -286,6 +301,7 @@ class c { >aorb : any return 10; +>10 : number } /** prop5 1*/ public prop5(a: number): number; @@ -303,6 +319,7 @@ class c { >aorb : any return 10; +>10 : number } } class c1 { @@ -388,49 +405,59 @@ var c1_i_1 = new c1(10); >c1_i_1 : c1 >new c1(10) : c1 >c1 : typeof c1 +>10 : number var c1_i_2 = new c1("hello"); >c1_i_2 : c1 >new c1("hello") : c1 >c1 : typeof c1 +>"hello" : string var c2_i_1 = new c2(10); >c2_i_1 : c2 >new c2(10) : c2 >c2 : typeof c2 +>10 : number var c2_i_2 = new c2("hello"); >c2_i_2 : c2 >new c2("hello") : c2 >c2 : typeof c2 +>"hello" : string var c3_i_1 = new c3(10); >c3_i_1 : c3 >new c3(10) : c3 >c3 : typeof c3 +>10 : number var c3_i_2 = new c3("hello"); >c3_i_2 : c3 >new c3("hello") : c3 >c3 : typeof c3 +>"hello" : string var c4_i_1 = new c4(10); >c4_i_1 : c4 >new c4(10) : c4 >c4 : typeof c4 +>10 : number var c4_i_2 = new c4("hello"); >c4_i_2 : c4 >new c4("hello") : c4 >c4 : typeof c4 +>"hello" : string var c5_i_1 = new c5(10); >c5_i_1 : c5 >new c5(10) : c5 >c5 : typeof c5 +>10 : number var c5_i_2 = new c5("hello"); >c5_i_2 : c5 >new c5("hello") : c5 >c5 : typeof c5 +>"hello" : string diff --git a/tests/baselines/reference/commentsPropertySignature1.symbols b/tests/baselines/reference/commentsPropertySignature1.symbols new file mode 100644 index 00000000000..2e97f701871 --- /dev/null +++ b/tests/baselines/reference/commentsPropertySignature1.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/commentsPropertySignature1.ts === +var a = { +>a : Symbol(a, Decl(commentsPropertySignature1.ts, 0, 3)) + + /** own x*/ + x: 0 +>x : Symbol(x, Decl(commentsPropertySignature1.ts, 0, 9)) + +}; + diff --git a/tests/baselines/reference/commentsPropertySignature1.types b/tests/baselines/reference/commentsPropertySignature1.types index 857b0c98ee5..09dad1eaefb 100644 --- a/tests/baselines/reference/commentsPropertySignature1.types +++ b/tests/baselines/reference/commentsPropertySignature1.types @@ -6,6 +6,7 @@ var a = { /** own x*/ x: 0 >x : number +>0 : number }; diff --git a/tests/baselines/reference/commentsTypeParameters.symbols b/tests/baselines/reference/commentsTypeParameters.symbols new file mode 100644 index 00000000000..466ca3ff9a9 --- /dev/null +++ b/tests/baselines/reference/commentsTypeParameters.symbols @@ -0,0 +1,46 @@ +=== tests/cases/compiler/commentsTypeParameters.ts === +class C { +>C : Symbol(C, Decl(commentsTypeParameters.ts, 0, 0)) +>T : Symbol(T, Decl(commentsTypeParameters.ts, 0, 8)) + + method(a: U) { +>method : Symbol(method, Decl(commentsTypeParameters.ts, 0, 47)) +>U : Symbol(U, Decl(commentsTypeParameters.ts, 1, 11)) +>T : Symbol(T, Decl(commentsTypeParameters.ts, 0, 8)) +>a : Symbol(a, Decl(commentsTypeParameters.ts, 1, 66)) +>U : Symbol(U, Decl(commentsTypeParameters.ts, 1, 11)) + } + static staticmethod(a: U) { +>staticmethod : Symbol(C.staticmethod, Decl(commentsTypeParameters.ts, 2, 5)) +>U : Symbol(U, Decl(commentsTypeParameters.ts, 3, 24)) +>a : Symbol(a, Decl(commentsTypeParameters.ts, 3, 69)) +>U : Symbol(U, Decl(commentsTypeParameters.ts, 3, 24)) + } + + private privatemethod(a: U) { +>privatemethod : Symbol(privatemethod, Decl(commentsTypeParameters.ts, 4, 5)) +>U : Symbol(U, Decl(commentsTypeParameters.ts, 6, 26)) +>T : Symbol(T, Decl(commentsTypeParameters.ts, 0, 8)) +>a : Symbol(a, Decl(commentsTypeParameters.ts, 6, 81)) +>U : Symbol(U, Decl(commentsTypeParameters.ts, 6, 26)) + } + private static privatestaticmethod(a: U) { +>privatestaticmethod : Symbol(C.privatestaticmethod, Decl(commentsTypeParameters.ts, 7, 5)) +>U : Symbol(U, Decl(commentsTypeParameters.ts, 8, 39)) +>a : Symbol(a, Decl(commentsTypeParameters.ts, 8, 84)) +>U : Symbol(U, Decl(commentsTypeParameters.ts, 8, 39)) + } +} + +function compare(a: T, b: T) { +>compare : Symbol(compare, Decl(commentsTypeParameters.ts, 10, 1)) +>T : Symbol(T, Decl(commentsTypeParameters.ts, 12, 17)) +>a : Symbol(a, Decl(commentsTypeParameters.ts, 12, 29)) +>T : Symbol(T, Decl(commentsTypeParameters.ts, 12, 17)) +>b : Symbol(b, Decl(commentsTypeParameters.ts, 12, 34)) +>T : Symbol(T, Decl(commentsTypeParameters.ts, 12, 17)) + + return a === b; +>a : Symbol(a, Decl(commentsTypeParameters.ts, 12, 29)) +>b : Symbol(b, Decl(commentsTypeParameters.ts, 12, 34)) +} diff --git a/tests/baselines/reference/commentsVarDecl.symbols b/tests/baselines/reference/commentsVarDecl.symbols new file mode 100644 index 00000000000..d2ec3d4edcd --- /dev/null +++ b/tests/baselines/reference/commentsVarDecl.symbols @@ -0,0 +1,71 @@ +=== tests/cases/compiler/commentsVarDecl.ts === + +/** Variable comments*/ +var myVariable = 10; // This trailing Comment1 +>myVariable : Symbol(myVariable, Decl(commentsVarDecl.ts, 2, 3)) + +/** This is another variable comment*/ +var anotherVariable = 30; +>anotherVariable : Symbol(anotherVariable, Decl(commentsVarDecl.ts, 5, 3)) + +// shouldn't appear +var aVar = ""; +>aVar : Symbol(aVar, Decl(commentsVarDecl.ts, 8, 3)) + +/** this is multiline comment + * All these variables are of number type */ +var anotherAnotherVariable = 70; /* these are multiple trailing comments */ /* multiple trailing comments */ +>anotherAnotherVariable : Symbol(anotherAnotherVariable, Decl(commentsVarDecl.ts, 12, 3)) + +/** Triple slash multiline comment*/ +/** another line in the comment*/ +/** comment line 2*/ +var x = 70; /* multiline trailing comment +>x : Symbol(x, Decl(commentsVarDecl.ts, 17, 3)) + +this is multiline trailing comment */ +/** Triple slash comment on the assignement shouldnt be in .d.ts file*/ +x = myVariable; +>x : Symbol(x, Decl(commentsVarDecl.ts, 17, 3)) +>myVariable : Symbol(myVariable, Decl(commentsVarDecl.ts, 2, 3)) + +/** triple slash comment1*/ +/** jsdocstyle comment - only this comment should be in .d.ts file*/ +var n = 30; +>n : Symbol(n, Decl(commentsVarDecl.ts, 24, 3)) + +/** var deckaration with comment on type as well*/ +var y = /** value comment */ 20; +>y : Symbol(y, Decl(commentsVarDecl.ts, 27, 3)) + +/// var deckaration with comment on type as well +var yy = +>yy : Symbol(yy, Decl(commentsVarDecl.ts, 30, 3)) + + /// value comment + 20; + +/** comment2 */ +var z = /** lambda comment */ (x: number, y: number) => x + y; +>z : Symbol(z, Decl(commentsVarDecl.ts, 35, 3)) +>x : Symbol(x, Decl(commentsVarDecl.ts, 35, 31)) +>y : Symbol(y, Decl(commentsVarDecl.ts, 35, 41)) +>x : Symbol(x, Decl(commentsVarDecl.ts, 35, 31)) +>y : Symbol(y, Decl(commentsVarDecl.ts, 35, 41)) + +var z2: /** type comment*/ (x: number) => string; +>z2 : Symbol(z2, Decl(commentsVarDecl.ts, 37, 3)) +>x : Symbol(x, Decl(commentsVarDecl.ts, 37, 28)) + +var x2 = z2; +>x2 : Symbol(x2, Decl(commentsVarDecl.ts, 39, 3)) +>z2 : Symbol(z2, Decl(commentsVarDecl.ts, 37, 3)) + +var n4: (x: number) => string; +>n4 : Symbol(n4, Decl(commentsVarDecl.ts, 41, 3)) +>x : Symbol(x, Decl(commentsVarDecl.ts, 41, 9)) + +n4 = z2; +>n4 : Symbol(n4, Decl(commentsVarDecl.ts, 41, 3)) +>z2 : Symbol(z2, Decl(commentsVarDecl.ts, 37, 3)) + diff --git a/tests/baselines/reference/commentsVarDecl.types b/tests/baselines/reference/commentsVarDecl.types index 50db8984b1b..033590b3445 100644 --- a/tests/baselines/reference/commentsVarDecl.types +++ b/tests/baselines/reference/commentsVarDecl.types @@ -3,25 +3,30 @@ /** Variable comments*/ var myVariable = 10; // This trailing Comment1 >myVariable : number +>10 : number /** This is another variable comment*/ var anotherVariable = 30; >anotherVariable : number +>30 : number // shouldn't appear var aVar = ""; >aVar : string +>"" : string /** this is multiline comment * All these variables are of number type */ var anotherAnotherVariable = 70; /* these are multiple trailing comments */ /* multiple trailing comments */ >anotherAnotherVariable : number +>70 : number /** Triple slash multiline comment*/ /** another line in the comment*/ /** comment line 2*/ var x = 70; /* multiline trailing comment >x : number +>70 : number this is multiline trailing comment */ /** Triple slash comment on the assignement shouldnt be in .d.ts file*/ @@ -34,10 +39,12 @@ x = myVariable; /** jsdocstyle comment - only this comment should be in .d.ts file*/ var n = 30; >n : number +>30 : number /** var deckaration with comment on type as well*/ var y = /** value comment */ 20; >y : number +>20 : number /// var deckaration with comment on type as well var yy = @@ -45,6 +52,7 @@ var yy = /// value comment 20; +>20 : number /** comment2 */ var z = /** lambda comment */ (x: number, y: number) => x + y; diff --git a/tests/baselines/reference/commentsVariableStatement1.symbols b/tests/baselines/reference/commentsVariableStatement1.symbols new file mode 100644 index 00000000000..54f382da793 --- /dev/null +++ b/tests/baselines/reference/commentsVariableStatement1.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/commentsVariableStatement1.ts === + +/** Comment */ +var v = 1; +>v : Symbol(v, Decl(commentsVariableStatement1.ts, 2, 3)) + diff --git a/tests/baselines/reference/commentsVariableStatement1.types b/tests/baselines/reference/commentsVariableStatement1.types index 7717be4a2a1..4bb6753db8a 100644 --- a/tests/baselines/reference/commentsVariableStatement1.types +++ b/tests/baselines/reference/commentsVariableStatement1.types @@ -3,4 +3,5 @@ /** Comment */ var v = 1; >v : number +>1 : number diff --git a/tests/baselines/reference/commentsdoNotEmitComments.symbols b/tests/baselines/reference/commentsdoNotEmitComments.symbols new file mode 100644 index 00000000000..a7ba4076d9d --- /dev/null +++ b/tests/baselines/reference/commentsdoNotEmitComments.symbols @@ -0,0 +1,161 @@ +=== tests/cases/compiler/commentsdoNotEmitComments.ts === + +/** Variable comments*/ +var myVariable = 10; +>myVariable : Symbol(myVariable, Decl(commentsdoNotEmitComments.ts, 2, 3)) + +/** function comments*/ +function foo(/** parameter comment*/p: number) { +>foo : Symbol(foo, Decl(commentsdoNotEmitComments.ts, 2, 20)) +>p : Symbol(p, Decl(commentsdoNotEmitComments.ts, 5, 13)) +} + +/** variable with function type comment*/ +var fooVar: () => void; +>fooVar : Symbol(fooVar, Decl(commentsdoNotEmitComments.ts, 9, 3)) + +foo(50); +>foo : Symbol(foo, Decl(commentsdoNotEmitComments.ts, 2, 20)) + +fooVar(); +>fooVar : Symbol(fooVar, Decl(commentsdoNotEmitComments.ts, 9, 3)) + +/**class comment*/ +class c { +>c : Symbol(c, Decl(commentsdoNotEmitComments.ts, 11, 9)) + + /** constructor comment*/ + constructor() { + } + + /** property comment */ + public b = 10; +>b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5)) + + /** function comment */ + public myFoo() { +>myFoo : Symbol(myFoo, Decl(commentsdoNotEmitComments.ts, 20, 18)) + + return this.b; +>this.b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5)) +>this : Symbol(c, Decl(commentsdoNotEmitComments.ts, 11, 9)) +>b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5)) + } + + /** getter comment*/ + public get prop1() { +>prop1 : Symbol(prop1, Decl(commentsdoNotEmitComments.ts, 25, 5), Decl(commentsdoNotEmitComments.ts, 30, 5)) + + return this.b; +>this.b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5)) +>this : Symbol(c, Decl(commentsdoNotEmitComments.ts, 11, 9)) +>b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5)) + } + + /** setter comment*/ + public set prop1(val: number) { +>prop1 : Symbol(prop1, Decl(commentsdoNotEmitComments.ts, 25, 5), Decl(commentsdoNotEmitComments.ts, 30, 5)) +>val : Symbol(val, Decl(commentsdoNotEmitComments.ts, 33, 21)) + + this.b = val; +>this.b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5)) +>this : Symbol(c, Decl(commentsdoNotEmitComments.ts, 11, 9)) +>b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5)) +>val : Symbol(val, Decl(commentsdoNotEmitComments.ts, 33, 21)) + } + + /** overload signature1*/ + public foo1(a: number): string; +>foo1 : Symbol(foo1, Decl(commentsdoNotEmitComments.ts, 35, 5), Decl(commentsdoNotEmitComments.ts, 38, 35), Decl(commentsdoNotEmitComments.ts, 40, 35)) +>a : Symbol(a, Decl(commentsdoNotEmitComments.ts, 38, 16)) + + /** Overload signature 2*/ + public foo1(b: string): string; +>foo1 : Symbol(foo1, Decl(commentsdoNotEmitComments.ts, 35, 5), Decl(commentsdoNotEmitComments.ts, 38, 35), Decl(commentsdoNotEmitComments.ts, 40, 35)) +>b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 40, 16)) + + /** overload implementation signature*/ + public foo1(aOrb) { +>foo1 : Symbol(foo1, Decl(commentsdoNotEmitComments.ts, 35, 5), Decl(commentsdoNotEmitComments.ts, 38, 35), Decl(commentsdoNotEmitComments.ts, 40, 35)) +>aOrb : Symbol(aOrb, Decl(commentsdoNotEmitComments.ts, 42, 16)) + + return aOrb.toString(); +>aOrb : Symbol(aOrb, Decl(commentsdoNotEmitComments.ts, 42, 16)) + } +} + +/**instance comment*/ +var i = new c(); +>i : Symbol(i, Decl(commentsdoNotEmitComments.ts, 48, 3)) +>c : Symbol(c, Decl(commentsdoNotEmitComments.ts, 11, 9)) + +/** interface comments*/ +interface i1 { +>i1 : Symbol(i1, Decl(commentsdoNotEmitComments.ts, 48, 16)) + + /** caller comments*/ + (a: number): number; +>a : Symbol(a, Decl(commentsdoNotEmitComments.ts, 53, 5)) + + /** new comments*/ + new (b: string); +>b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 56, 9)) + + /**indexer property*/ + [a: number]: string; +>a : Symbol(a, Decl(commentsdoNotEmitComments.ts, 59, 5)) + + /** function property;*/ + myFoo(/*param prop*/a: number): string; +>myFoo : Symbol(myFoo, Decl(commentsdoNotEmitComments.ts, 59, 24)) +>a : Symbol(a, Decl(commentsdoNotEmitComments.ts, 62, 10)) + + /** prop*/ + prop: string; +>prop : Symbol(prop, Decl(commentsdoNotEmitComments.ts, 62, 43)) +} + +/**interface instance comments*/ +var i1_i: i1; +>i1_i : Symbol(i1_i, Decl(commentsdoNotEmitComments.ts, 69, 3)) +>i1 : Symbol(i1, Decl(commentsdoNotEmitComments.ts, 48, 16)) + +/** this is module comment*/ +module m1 { +>m1 : Symbol(m1, Decl(commentsdoNotEmitComments.ts, 69, 13)) + + /** class b */ + export class b { +>b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 72, 11)) + + constructor(public x: number) { +>x : Symbol(x, Decl(commentsdoNotEmitComments.ts, 75, 20)) + + } + } + + /// module m2 + export module m2 { +>m2 : Symbol(m2, Decl(commentsdoNotEmitComments.ts, 78, 5)) + } +} + +/// this is x +declare var x; +>x : Symbol(x, Decl(commentsdoNotEmitComments.ts, 86, 11)) + + +/** const enum member value comment (generated by TS) */ +const enum color { red, green, blue } +>color : Symbol(color, Decl(commentsdoNotEmitComments.ts, 86, 14)) +>red : Symbol(color.red, Decl(commentsdoNotEmitComments.ts, 90, 18)) +>green : Symbol(color.green, Decl(commentsdoNotEmitComments.ts, 90, 23)) +>blue : Symbol(color.blue, Decl(commentsdoNotEmitComments.ts, 90, 30)) + +var shade: color = color.green; +>shade : Symbol(shade, Decl(commentsdoNotEmitComments.ts, 91, 3)) +>color : Symbol(color, Decl(commentsdoNotEmitComments.ts, 86, 14)) +>color.green : Symbol(color.green, Decl(commentsdoNotEmitComments.ts, 90, 23)) +>color : Symbol(color, Decl(commentsdoNotEmitComments.ts, 86, 14)) +>green : Symbol(color.green, Decl(commentsdoNotEmitComments.ts, 90, 23)) + diff --git a/tests/baselines/reference/commentsdoNotEmitComments.types b/tests/baselines/reference/commentsdoNotEmitComments.types index bbe3a685ca1..024f1c2a21f 100644 --- a/tests/baselines/reference/commentsdoNotEmitComments.types +++ b/tests/baselines/reference/commentsdoNotEmitComments.types @@ -3,6 +3,7 @@ /** Variable comments*/ var myVariable = 10; >myVariable : number +>10 : number /** function comments*/ function foo(/** parameter comment*/p: number) { @@ -17,6 +18,7 @@ var fooVar: () => void; foo(50); >foo(50) : void >foo : (p: number) => void +>50 : number fooVar(); >fooVar() : void @@ -33,6 +35,7 @@ class c { /** property comment */ public b = 10; >b : number +>10 : number /** function comment */ public myFoo() { @@ -143,7 +146,7 @@ module m1 { /// module m2 export module m2 { ->m2 : unknown +>m2 : any } } diff --git a/tests/baselines/reference/commentsemitComments.symbols b/tests/baselines/reference/commentsemitComments.symbols new file mode 100644 index 00000000000..6c0683d5372 --- /dev/null +++ b/tests/baselines/reference/commentsemitComments.symbols @@ -0,0 +1,146 @@ +=== tests/cases/compiler/commentsemitComments.ts === + +/** Variable comments*/ +var myVariable = 10; +>myVariable : Symbol(myVariable, Decl(commentsemitComments.ts, 2, 3)) + +/** function comments*/ +function foo(/** parameter comment*/p: number) { +>foo : Symbol(foo, Decl(commentsemitComments.ts, 2, 20)) +>p : Symbol(p, Decl(commentsemitComments.ts, 5, 13)) +} + +/** variable with function type comment*/ +var fooVar: () => void; +>fooVar : Symbol(fooVar, Decl(commentsemitComments.ts, 9, 3)) + +foo(50); +>foo : Symbol(foo, Decl(commentsemitComments.ts, 2, 20)) + +fooVar(); +>fooVar : Symbol(fooVar, Decl(commentsemitComments.ts, 9, 3)) + +/**class comment*/ +class c { +>c : Symbol(c, Decl(commentsemitComments.ts, 11, 9)) + + /** constructor comment*/ + constructor() { + } + + /** property comment */ + public b = 10; +>b : Symbol(b, Decl(commentsemitComments.ts, 17, 5)) + + /** function comment */ + public myFoo() { +>myFoo : Symbol(myFoo, Decl(commentsemitComments.ts, 20, 18)) + + return this.b; +>this.b : Symbol(b, Decl(commentsemitComments.ts, 17, 5)) +>this : Symbol(c, Decl(commentsemitComments.ts, 11, 9)) +>b : Symbol(b, Decl(commentsemitComments.ts, 17, 5)) + } + + /** getter comment*/ + public get prop1() { +>prop1 : Symbol(prop1, Decl(commentsemitComments.ts, 25, 5), Decl(commentsemitComments.ts, 30, 5)) + + return this.b; +>this.b : Symbol(b, Decl(commentsemitComments.ts, 17, 5)) +>this : Symbol(c, Decl(commentsemitComments.ts, 11, 9)) +>b : Symbol(b, Decl(commentsemitComments.ts, 17, 5)) + } + + /** setter comment*/ + public set prop1(val: number) { +>prop1 : Symbol(prop1, Decl(commentsemitComments.ts, 25, 5), Decl(commentsemitComments.ts, 30, 5)) +>val : Symbol(val, Decl(commentsemitComments.ts, 33, 21)) + + this.b = val; +>this.b : Symbol(b, Decl(commentsemitComments.ts, 17, 5)) +>this : Symbol(c, Decl(commentsemitComments.ts, 11, 9)) +>b : Symbol(b, Decl(commentsemitComments.ts, 17, 5)) +>val : Symbol(val, Decl(commentsemitComments.ts, 33, 21)) + } + + /** overload signature1*/ + public foo1(a: number): string; +>foo1 : Symbol(foo1, Decl(commentsemitComments.ts, 35, 5), Decl(commentsemitComments.ts, 38, 35), Decl(commentsemitComments.ts, 40, 35)) +>a : Symbol(a, Decl(commentsemitComments.ts, 38, 16)) + + /** Overload signature 2*/ + public foo1(b: string): string; +>foo1 : Symbol(foo1, Decl(commentsemitComments.ts, 35, 5), Decl(commentsemitComments.ts, 38, 35), Decl(commentsemitComments.ts, 40, 35)) +>b : Symbol(b, Decl(commentsemitComments.ts, 40, 16)) + + /** overload implementation signature*/ + public foo1(aOrb) { +>foo1 : Symbol(foo1, Decl(commentsemitComments.ts, 35, 5), Decl(commentsemitComments.ts, 38, 35), Decl(commentsemitComments.ts, 40, 35)) +>aOrb : Symbol(aOrb, Decl(commentsemitComments.ts, 42, 16)) + + return aOrb.toString(); +>aOrb : Symbol(aOrb, Decl(commentsemitComments.ts, 42, 16)) + } +} + +/**instance comment*/ +var i = new c(); +>i : Symbol(i, Decl(commentsemitComments.ts, 48, 3)) +>c : Symbol(c, Decl(commentsemitComments.ts, 11, 9)) + +/** interface comments*/ +interface i1 { +>i1 : Symbol(i1, Decl(commentsemitComments.ts, 48, 16)) + + /** caller comments*/ + (a: number): number; +>a : Symbol(a, Decl(commentsemitComments.ts, 53, 5)) + + /** new comments*/ + new (b: string); +>b : Symbol(b, Decl(commentsemitComments.ts, 56, 9)) + + /**indexer property*/ + [a: number]: string; +>a : Symbol(a, Decl(commentsemitComments.ts, 59, 5)) + + /** function property;*/ + myFoo(/*param prop*/a: number): string; +>myFoo : Symbol(myFoo, Decl(commentsemitComments.ts, 59, 24)) +>a : Symbol(a, Decl(commentsemitComments.ts, 62, 10)) + + /** prop*/ + prop: string; +>prop : Symbol(prop, Decl(commentsemitComments.ts, 62, 43)) +} + +/**interface instance comments*/ +var i1_i: i1; +>i1_i : Symbol(i1_i, Decl(commentsemitComments.ts, 69, 3)) +>i1 : Symbol(i1, Decl(commentsemitComments.ts, 48, 16)) + +/** this is module comment*/ +module m1 { +>m1 : Symbol(m1, Decl(commentsemitComments.ts, 69, 13)) + + /** class b */ + export class b { +>b : Symbol(b, Decl(commentsemitComments.ts, 72, 11)) + + constructor(public x: number) { +>x : Symbol(x, Decl(commentsemitComments.ts, 75, 20)) + + } + } + + /// module m2 + export module m2 { +>m2 : Symbol(m2, Decl(commentsemitComments.ts, 78, 5)) + } +} + +/// this is x +declare var x; +>x : Symbol(x, Decl(commentsemitComments.ts, 86, 11)) + diff --git a/tests/baselines/reference/commentsemitComments.types b/tests/baselines/reference/commentsemitComments.types index b87ef5ad6fd..2311ca09dd0 100644 --- a/tests/baselines/reference/commentsemitComments.types +++ b/tests/baselines/reference/commentsemitComments.types @@ -3,6 +3,7 @@ /** Variable comments*/ var myVariable = 10; >myVariable : number +>10 : number /** function comments*/ function foo(/** parameter comment*/p: number) { @@ -17,6 +18,7 @@ var fooVar: () => void; foo(50); >foo(50) : void >foo : (p: number) => void +>50 : number fooVar(); >fooVar() : void @@ -33,6 +35,7 @@ class c { /** property comment */ public b = 10; >b : number +>10 : number /** function comment */ public myFoo() { @@ -143,7 +146,7 @@ module m1 { /// module m2 export module m2 { ->m2 : unknown +>m2 : any } } diff --git a/tests/baselines/reference/commonJSImportAsPrimaryExpression.symbols b/tests/baselines/reference/commonJSImportAsPrimaryExpression.symbols new file mode 100644 index 00000000000..b640adc58a4 --- /dev/null +++ b/tests/baselines/reference/commonJSImportAsPrimaryExpression.symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/externalModules/foo_1.ts === +import foo = require("./foo_0"); +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) + +if(foo.C1.s1){ +>foo.C1.s1 : Symbol(foo.C1.s1, Decl(foo_0.ts, 1, 9)) +>foo.C1 : Symbol(foo.C1, Decl(foo_0.ts, 0, 0)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>C1 : Symbol(foo.C1, Decl(foo_0.ts, 0, 0)) +>s1 : Symbol(foo.C1.s1, Decl(foo_0.ts, 1, 9)) + + // Should cause runtime import +} + +=== tests/cases/conformance/externalModules/foo_0.ts === +export class C1 { +>C1 : Symbol(C1, Decl(foo_0.ts, 0, 0)) + + m1 = 42; +>m1 : Symbol(m1, Decl(foo_0.ts, 0, 17)) + + static s1 = true; +>s1 : Symbol(C1.s1, Decl(foo_0.ts, 1, 9)) +} + diff --git a/tests/baselines/reference/commonJSImportAsPrimaryExpression.types b/tests/baselines/reference/commonJSImportAsPrimaryExpression.types index 0d2e96afaa2..01d96b31fc7 100644 --- a/tests/baselines/reference/commonJSImportAsPrimaryExpression.types +++ b/tests/baselines/reference/commonJSImportAsPrimaryExpression.types @@ -18,8 +18,10 @@ export class C1 { m1 = 42; >m1 : number +>42 : number static s1 = true; >s1 : boolean +>true : boolean } diff --git a/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.symbols b/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.symbols new file mode 100644 index 00000000000..68a852c6165 --- /dev/null +++ b/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.symbols @@ -0,0 +1,81 @@ +=== tests/cases/conformance/externalModules/foo_1.ts === +import foo = require("./foo_0"); +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) + +// None of the below should cause a runtime dependency on foo_0 +import f = foo.M1; +>f : Symbol(f, Decl(foo_1.ts, 0, 32)) +>foo : Symbol(foo, Decl(foo_0.ts, 0, 0)) +>M1 : Symbol(foo.M1, Decl(foo_0.ts, 8, 1)) + +var i: f.I2; +>i : Symbol(i, Decl(foo_1.ts, 3, 3)) +>f : Symbol(f, Decl(foo_1.ts, 0, 32)) +>I2 : Symbol(f.I2, Decl(foo_0.ts, 10, 18)) + +var x: foo.C1 = <{m1: number}>{}; +>x : Symbol(x, Decl(foo_1.ts, 4, 3)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>C1 : Symbol(foo.C1, Decl(foo_0.ts, 0, 0)) +>m1 : Symbol(m1, Decl(foo_1.ts, 4, 18)) + +var y: typeof foo.C1.s1 = false; +>y : Symbol(y, Decl(foo_1.ts, 5, 3)) +>foo.C1.s1 : Symbol(foo.C1.s1, Decl(foo_0.ts, 1, 9)) +>foo.C1 : Symbol(foo.C1, Decl(foo_0.ts, 0, 0)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>C1 : Symbol(foo.C1, Decl(foo_0.ts, 0, 0)) +>s1 : Symbol(foo.C1.s1, Decl(foo_0.ts, 1, 9)) + +var z: foo.M1.I2; +>z : Symbol(z, Decl(foo_1.ts, 6, 3)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>M1 : Symbol(foo.M1, Decl(foo_0.ts, 8, 1)) +>I2 : Symbol(f.I2, Decl(foo_0.ts, 10, 18)) + +var e: number = 0; +>e : Symbol(e, Decl(foo_1.ts, 7, 3)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>E1 : Symbol(foo.E1, Decl(foo_0.ts, 14, 1)) + +=== tests/cases/conformance/externalModules/foo_0.ts === +export class C1 { +>C1 : Symbol(C1, Decl(foo_0.ts, 0, 0)) + + m1 = 42; +>m1 : Symbol(m1, Decl(foo_0.ts, 0, 17)) + + static s1 = true; +>s1 : Symbol(C1.s1, Decl(foo_0.ts, 1, 9)) +} + +export interface I1 { +>I1 : Symbol(I1, Decl(foo_0.ts, 3, 1)) + + name: string; +>name : Symbol(name, Decl(foo_0.ts, 5, 21)) + + age: number; +>age : Symbol(age, Decl(foo_0.ts, 6, 14)) +} + +export module M1 { +>M1 : Symbol(M1, Decl(foo_0.ts, 8, 1)) + + export interface I2 { +>I2 : Symbol(I2, Decl(foo_0.ts, 10, 18)) + + foo: string; +>foo : Symbol(foo, Decl(foo_0.ts, 11, 22)) + } +} + +export enum E1 { +>E1 : Symbol(E1, Decl(foo_0.ts, 14, 1)) + + A,B,C +>A : Symbol(E1.A, Decl(foo_0.ts, 16, 16)) +>B : Symbol(E1.B, Decl(foo_0.ts, 17, 3)) +>C : Symbol(E1.C, Decl(foo_0.ts, 17, 5)) +} + diff --git a/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.types b/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.types index bde0cb02b1e..6c3978d93aa 100644 --- a/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.types +++ b/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.types @@ -4,18 +4,18 @@ import foo = require("./foo_0"); // None of the below should cause a runtime dependency on foo_0 import f = foo.M1; ->f : unknown +>f : any >foo : typeof foo ->M1 : unknown +>M1 : any var i: f.I2; >i : f.I2 ->f : unknown +>f : any >I2 : f.I2 var x: foo.C1 = <{m1: number}>{}; >x : foo.C1 ->foo : unknown +>foo : any >C1 : foo.C1 ><{m1: number}>{} : { m1: number; } >m1 : number @@ -23,21 +23,25 @@ var x: foo.C1 = <{m1: number}>{}; var y: typeof foo.C1.s1 = false; >y : boolean +>foo.C1.s1 : boolean +>foo.C1 : typeof foo.C1 >foo : typeof foo >C1 : typeof foo.C1 >s1 : boolean +>false : boolean var z: foo.M1.I2; >z : f.I2 ->foo : unknown ->M1 : unknown +>foo : any +>M1 : any >I2 : f.I2 var e: number = 0; >e : number >0 : foo.E1 ->foo : unknown +>foo : any >E1 : foo.E1 +>0 : number === tests/cases/conformance/externalModules/foo_0.ts === export class C1 { @@ -45,9 +49,11 @@ export class C1 { m1 = 42; >m1 : number +>42 : number static s1 = true; >s1 : boolean +>true : boolean } export interface I1 { @@ -61,7 +67,7 @@ export interface I1 { } export module M1 { ->M1 : unknown +>M1 : any export interface I2 { >I2 : I2 diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.symbols b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.symbols new file mode 100644 index 00000000000..c6586cc3068 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.symbols @@ -0,0 +1,735 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithIdenticalObjects.ts === +class A1 { +>A1 : Symbol(A1, Decl(comparisonOperatorWithIdenticalObjects.ts, 0, 0)) + + public a: string; +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalObjects.ts, 0, 10)) + + public b: number; +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalObjects.ts, 1, 21)) + + public c: boolean; +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalObjects.ts, 2, 21)) + + public d: any; +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalObjects.ts, 3, 22)) + + public e: Object; +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalObjects.ts, 4, 18)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + public fn(a: string): string { +>fn : Symbol(fn, Decl(comparisonOperatorWithIdenticalObjects.ts, 5, 21)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalObjects.ts, 6, 14)) + + return null; + } +} +class B1 { +>B1 : Symbol(B1, Decl(comparisonOperatorWithIdenticalObjects.ts, 9, 1)) + + public a: string; +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalObjects.ts, 10, 10)) + + public b: number; +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalObjects.ts, 11, 21)) + + public c: boolean; +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalObjects.ts, 12, 21)) + + public d: any; +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalObjects.ts, 13, 22)) + + public e: Object; +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalObjects.ts, 14, 18)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + public fn(b: string): string { +>fn : Symbol(fn, Decl(comparisonOperatorWithIdenticalObjects.ts, 15, 21)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalObjects.ts, 16, 14)) + + return null; + } +} + +class Base { +>Base : Symbol(Base, Decl(comparisonOperatorWithIdenticalObjects.ts, 19, 1)) + + private a: string; +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalObjects.ts, 21, 12)) + + private fn(b: string): string { +>fn : Symbol(fn, Decl(comparisonOperatorWithIdenticalObjects.ts, 22, 22)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalObjects.ts, 23, 15)) + + return null; + } +} +class A2 extends Base { } +>A2 : Symbol(A2, Decl(comparisonOperatorWithIdenticalObjects.ts, 26, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithIdenticalObjects.ts, 19, 1)) + +class B2 extends Base { } +>B2 : Symbol(B2, Decl(comparisonOperatorWithIdenticalObjects.ts, 27, 25)) +>Base : Symbol(Base, Decl(comparisonOperatorWithIdenticalObjects.ts, 19, 1)) + +interface A3 { f(a: number): string; } +>A3 : Symbol(A3, Decl(comparisonOperatorWithIdenticalObjects.ts, 28, 25)) +>f : Symbol(f, Decl(comparisonOperatorWithIdenticalObjects.ts, 30, 14)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalObjects.ts, 30, 17)) + +interface B3 { f(a: number): string; } +>B3 : Symbol(B3, Decl(comparisonOperatorWithIdenticalObjects.ts, 30, 38)) +>f : Symbol(f, Decl(comparisonOperatorWithIdenticalObjects.ts, 31, 14)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalObjects.ts, 31, 17)) + +interface A4 { new (a: string): A1; } +>A4 : Symbol(A4, Decl(comparisonOperatorWithIdenticalObjects.ts, 31, 38)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalObjects.ts, 33, 20)) +>A1 : Symbol(A1, Decl(comparisonOperatorWithIdenticalObjects.ts, 0, 0)) + +interface B4 { new (a: string): B1; } +>B4 : Symbol(B4, Decl(comparisonOperatorWithIdenticalObjects.ts, 33, 37)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalObjects.ts, 34, 20)) +>B1 : Symbol(B1, Decl(comparisonOperatorWithIdenticalObjects.ts, 9, 1)) + +interface A5 { [x: number]: number; } +>A5 : Symbol(A5, Decl(comparisonOperatorWithIdenticalObjects.ts, 34, 37)) +>x : Symbol(x, Decl(comparisonOperatorWithIdenticalObjects.ts, 36, 16)) + +interface B5 { [x: number]: number; } +>B5 : Symbol(B5, Decl(comparisonOperatorWithIdenticalObjects.ts, 36, 37)) +>x : Symbol(x, Decl(comparisonOperatorWithIdenticalObjects.ts, 37, 16)) + +interface A6 { [x: string]: string; } +>A6 : Symbol(A6, Decl(comparisonOperatorWithIdenticalObjects.ts, 37, 37)) +>x : Symbol(x, Decl(comparisonOperatorWithIdenticalObjects.ts, 39, 16)) + +interface B6 { [x: string]: string; } +>B6 : Symbol(B6, Decl(comparisonOperatorWithIdenticalObjects.ts, 39, 37)) +>x : Symbol(x, Decl(comparisonOperatorWithIdenticalObjects.ts, 40, 16)) + +var a1: A1; +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) +>A1 : Symbol(A1, Decl(comparisonOperatorWithIdenticalObjects.ts, 0, 0)) + +var a2: A2; +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) +>A2 : Symbol(A2, Decl(comparisonOperatorWithIdenticalObjects.ts, 26, 1)) + +var a3: A3; +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) +>A3 : Symbol(A3, Decl(comparisonOperatorWithIdenticalObjects.ts, 28, 25)) + +var a4: A4; +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) +>A4 : Symbol(A4, Decl(comparisonOperatorWithIdenticalObjects.ts, 31, 38)) + +var a5: A5; +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) +>A5 : Symbol(A5, Decl(comparisonOperatorWithIdenticalObjects.ts, 34, 37)) + +var a6: A6; +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) +>A6 : Symbol(A6, Decl(comparisonOperatorWithIdenticalObjects.ts, 37, 37)) + +var b1: B1; +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) +>B1 : Symbol(B1, Decl(comparisonOperatorWithIdenticalObjects.ts, 9, 1)) + +var b2: B2; +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) +>B2 : Symbol(B2, Decl(comparisonOperatorWithIdenticalObjects.ts, 27, 25)) + +var b3: B3; +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) +>B3 : Symbol(B3, Decl(comparisonOperatorWithIdenticalObjects.ts, 30, 38)) + +var b4: B4; +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) +>B4 : Symbol(B4, Decl(comparisonOperatorWithIdenticalObjects.ts, 33, 37)) + +var b5: B5; +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) +>B5 : Symbol(B5, Decl(comparisonOperatorWithIdenticalObjects.ts, 36, 37)) + +var b6: B6; +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) +>B6 : Symbol(B6, Decl(comparisonOperatorWithIdenticalObjects.ts, 39, 37)) + +var base1: Base; +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) +>Base : Symbol(Base, Decl(comparisonOperatorWithIdenticalObjects.ts, 19, 1)) + +var base2: Base; +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) +>Base : Symbol(Base, Decl(comparisonOperatorWithIdenticalObjects.ts, 19, 1)) + +// operator < +var r1a1 = a1 < b1; +>r1a1 : Symbol(r1a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 60, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) + +var r1a2 = base1 < base2; +>r1a2 : Symbol(r1a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 61, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) + +var r1a3 = a2 < b2; +>r1a3 : Symbol(r1a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 62, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) + +var r1a4 = a3 < b3; +>r1a4 : Symbol(r1a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 63, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) + +var r1a5 = a4 < b4; +>r1a5 : Symbol(r1a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 64, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) + +var r1a6 = a5 < b5; +>r1a6 : Symbol(r1a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 65, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) + +var r1a7 = a6 < b6; +>r1a7 : Symbol(r1a7, Decl(comparisonOperatorWithIdenticalObjects.ts, 66, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) + +var r1b1 = b1 < a1; +>r1b1 : Symbol(r1b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 68, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) + +var r1b2 = base2 < base1; +>r1b2 : Symbol(r1b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 69, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) + +var r1b3 = b2 < a2; +>r1b3 : Symbol(r1b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 70, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) + +var r1b4 = b3 < a3; +>r1b4 : Symbol(r1b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 71, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) + +var r1b5 = b4 < a4; +>r1b5 : Symbol(r1b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 72, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) + +var r1b6 = b5 < a5; +>r1b6 : Symbol(r1b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 73, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) + +var r1b7 = b6 < a6; +>r1b7 : Symbol(r1b7, Decl(comparisonOperatorWithIdenticalObjects.ts, 74, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) + +// operator > +var r2a1 = a1 > b1; +>r2a1 : Symbol(r2a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 77, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) + +var r2a2 = base1 > base2; +>r2a2 : Symbol(r2a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 78, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) + +var r2a3 = a2 > b2; +>r2a3 : Symbol(r2a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 79, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) + +var r2a4 = a3 > b3; +>r2a4 : Symbol(r2a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 80, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) + +var r2a5 = a4 > b4; +>r2a5 : Symbol(r2a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 81, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) + +var r2a6 = a5 > b5; +>r2a6 : Symbol(r2a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 82, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) + +var r2a7 = a6 > b6; +>r2a7 : Symbol(r2a7, Decl(comparisonOperatorWithIdenticalObjects.ts, 83, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) + +var r2b1 = b1 > a1; +>r2b1 : Symbol(r2b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 85, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) + +var r2b2 = base2 > base1; +>r2b2 : Symbol(r2b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 86, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) + +var r2b3 = b2 > a2; +>r2b3 : Symbol(r2b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 87, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) + +var r2b4 = b3 > a3; +>r2b4 : Symbol(r2b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 88, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) + +var r2b5 = b4 > a4; +>r2b5 : Symbol(r2b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 89, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) + +var r2b6 = b5 > a5; +>r2b6 : Symbol(r2b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 90, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) + +var r2b7 = b6 > a6; +>r2b7 : Symbol(r2b7, Decl(comparisonOperatorWithIdenticalObjects.ts, 91, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) + +// operator <= +var r3a1 = a1 <= b1; +>r3a1 : Symbol(r3a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 94, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) + +var r3a2 = base1 <= base2; +>r3a2 : Symbol(r3a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 95, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) + +var r3a3 = a2 <= b2; +>r3a3 : Symbol(r3a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 96, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) + +var r3a4 = a3 <= b3; +>r3a4 : Symbol(r3a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 97, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) + +var r3a5 = a4 <= b4; +>r3a5 : Symbol(r3a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 98, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) + +var r3a6 = a5 <= b5; +>r3a6 : Symbol(r3a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 99, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) + +var r3a7 = a6 <= b6; +>r3a7 : Symbol(r3a7, Decl(comparisonOperatorWithIdenticalObjects.ts, 100, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) + +var r3b1 = b1 <= a1; +>r3b1 : Symbol(r3b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 102, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) + +var r3b2 = base2 <= base1; +>r3b2 : Symbol(r3b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 103, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) + +var r3b3 = b2 <= a2; +>r3b3 : Symbol(r3b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 104, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) + +var r3b4 = b3 <= a3; +>r3b4 : Symbol(r3b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 105, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) + +var r3b5 = b4 <= a4; +>r3b5 : Symbol(r3b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 106, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) + +var r3b6 = b5 <= a5; +>r3b6 : Symbol(r3b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 107, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) + +var r3b7 = b6 <= a6; +>r3b7 : Symbol(r3b7, Decl(comparisonOperatorWithIdenticalObjects.ts, 108, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) + +// operator >= +var r4a1 = a1 >= b1; +>r4a1 : Symbol(r4a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 111, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) + +var r4a2 = base1 >= base2; +>r4a2 : Symbol(r4a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 112, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) + +var r4a3 = a2 >= b2; +>r4a3 : Symbol(r4a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 113, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) + +var r4a4 = a3 >= b3; +>r4a4 : Symbol(r4a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 114, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) + +var r4a5 = a4 >= b4; +>r4a5 : Symbol(r4a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 115, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) + +var r4a6 = a5 >= b5; +>r4a6 : Symbol(r4a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 116, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) + +var r4a7 = a6 >= b6; +>r4a7 : Symbol(r4a7, Decl(comparisonOperatorWithIdenticalObjects.ts, 117, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) + +var r4b1 = b1 >= a1; +>r4b1 : Symbol(r4b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 119, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) + +var r4b2 = base2 >= base1; +>r4b2 : Symbol(r4b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 120, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) + +var r4b3 = b2 >= a2; +>r4b3 : Symbol(r4b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 121, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) + +var r4b4 = b3 >= a3; +>r4b4 : Symbol(r4b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 122, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) + +var r4b5 = b4 >= a4; +>r4b5 : Symbol(r4b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 123, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) + +var r4b6 = b5 >= a5; +>r4b6 : Symbol(r4b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 124, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) + +var r4b7 = b6 >= a6; +>r4b7 : Symbol(r4b7, Decl(comparisonOperatorWithIdenticalObjects.ts, 125, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) + +// operator == +var r5a1 = a1 == b1; +>r5a1 : Symbol(r5a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 128, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) + +var r5a2 = base1 == base2; +>r5a2 : Symbol(r5a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 129, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) + +var r5a3 = a2 == b2; +>r5a3 : Symbol(r5a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 130, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) + +var r5a4 = a3 == b3; +>r5a4 : Symbol(r5a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 131, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) + +var r5a5 = a4 == b4; +>r5a5 : Symbol(r5a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 132, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) + +var r5a6 = a5 == b5; +>r5a6 : Symbol(r5a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 133, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) + +var r5a7 = a6 == b6; +>r5a7 : Symbol(r5a7, Decl(comparisonOperatorWithIdenticalObjects.ts, 134, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) + +var r5b1 = b1 == a1; +>r5b1 : Symbol(r5b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 136, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) + +var r5b2 = base2 == base1; +>r5b2 : Symbol(r5b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 137, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) + +var r5b3 = b2 == a2; +>r5b3 : Symbol(r5b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 138, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) + +var r5b4 = b3 == a3; +>r5b4 : Symbol(r5b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 139, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) + +var r5b5 = b4 == a4; +>r5b5 : Symbol(r5b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 140, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) + +var r5b6 = b5 == a5; +>r5b6 : Symbol(r5b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 141, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) + +var r5b7 = b6 == a6; +>r5b7 : Symbol(r5b7, Decl(comparisonOperatorWithIdenticalObjects.ts, 142, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) + +// operator != +var r6a1 = a1 != b1; +>r6a1 : Symbol(r6a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 145, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) + +var r6a2 = base1 != base2; +>r6a2 : Symbol(r6a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 146, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) + +var r6a3 = a2 != b2; +>r6a3 : Symbol(r6a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 147, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) + +var r6a4 = a3 != b3; +>r6a4 : Symbol(r6a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 148, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) + +var r6a5 = a4 != b4; +>r6a5 : Symbol(r6a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 149, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) + +var r6a6 = a5 != b5; +>r6a6 : Symbol(r6a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 150, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) + +var r6a7 = a6 != b6; +>r6a7 : Symbol(r6a7, Decl(comparisonOperatorWithIdenticalObjects.ts, 151, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) + +var r6b1 = b1 != a1; +>r6b1 : Symbol(r6b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 153, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) + +var r6b2 = base2 != base1; +>r6b2 : Symbol(r6b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 154, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) + +var r6b3 = b2 != a2; +>r6b3 : Symbol(r6b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 155, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) + +var r6b4 = b3 != a3; +>r6b4 : Symbol(r6b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 156, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) + +var r6b5 = b4 != a4; +>r6b5 : Symbol(r6b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 157, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) + +var r6b6 = b5 != a5; +>r6b6 : Symbol(r6b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 158, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) + +var r6b7 = b6 != a6; +>r6b7 : Symbol(r6b7, Decl(comparisonOperatorWithIdenticalObjects.ts, 159, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) + +// operator === +var r7a1 = a1 === b1; +>r7a1 : Symbol(r7a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 162, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) + +var r7a2 = base1 === base2; +>r7a2 : Symbol(r7a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 163, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) + +var r7a3 = a2 === b2; +>r7a3 : Symbol(r7a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 164, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) + +var r7a4 = a3 === b3; +>r7a4 : Symbol(r7a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 165, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) + +var r7a5 = a4 === b4; +>r7a5 : Symbol(r7a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 166, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) + +var r7a6 = a5 === b5; +>r7a6 : Symbol(r7a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 167, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) + +var r7a7 = a6 === b6; +>r7a7 : Symbol(r7a7, Decl(comparisonOperatorWithIdenticalObjects.ts, 168, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) + +var r7b1 = b1 === a1; +>r7b1 : Symbol(r7b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 170, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) + +var r7b2 = base2 === base1; +>r7b2 : Symbol(r7b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 171, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) + +var r7b3 = b2 === a2; +>r7b3 : Symbol(r7b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 172, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) + +var r7b4 = b3 === a3; +>r7b4 : Symbol(r7b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 173, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) + +var r7b5 = b4 === a4; +>r7b5 : Symbol(r7b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 174, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) + +var r7b6 = b5 === a5; +>r7b6 : Symbol(r7b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 175, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) + +var r7b7 = b6 === a6; +>r7b7 : Symbol(r7b7, Decl(comparisonOperatorWithIdenticalObjects.ts, 176, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) + +// operator !== +var r8a1 = a1 !== b1; +>r8a1 : Symbol(r8a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 179, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) + +var r8a2 = base1 !== base2; +>r8a2 : Symbol(r8a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 180, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) + +var r8a3 = a2 !== b2; +>r8a3 : Symbol(r8a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 181, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) + +var r8a4 = a3 !== b3; +>r8a4 : Symbol(r8a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 182, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) + +var r8a5 = a4 !== b4; +>r8a5 : Symbol(r8a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 183, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) + +var r8a6 = a5 !== b5; +>r8a6 : Symbol(r8a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 184, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) + +var r8a7 = a6 !== b6; +>r8a7 : Symbol(r8a7, Decl(comparisonOperatorWithIdenticalObjects.ts, 185, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) + +var r8b1 = b1 !== a1; +>r8b1 : Symbol(r8b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 187, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) + +var r8b2 = base2 !== base1; +>r8b2 : Symbol(r8b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 188, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) + +var r8b3 = b2 !== a2; +>r8b3 : Symbol(r8b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 189, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) + +var r8b4 = b3 !== a3; +>r8b4 : Symbol(r8b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 190, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) + +var r8b5 = b4 !== a4; +>r8b5 : Symbol(r8b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 191, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) + +var r8b6 = b5 !== a5; +>r8b6 : Symbol(r8b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 192, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) + +var r8b7 = b6 !== a6; +>r8b7 : Symbol(r8b7, Decl(comparisonOperatorWithIdenticalObjects.ts, 193, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) + diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.types b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.types index 02316f94e54..7f202c38d3a 100644 --- a/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.types +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.types @@ -23,6 +23,7 @@ class A1 { >a : string return null; +>null : null } } class B1 { @@ -49,6 +50,7 @@ class B1 { >b : string return null; +>null : null } } @@ -63,6 +65,7 @@ class Base { >b : string return null; +>null : null } } class A2 extends Base { } diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.symbols b/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.symbols new file mode 100644 index 00000000000..72c912e80cc --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.symbols @@ -0,0 +1,295 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithIdenticalPrimitiveType.ts === +enum E { a, b, c } +>E : Symbol(E, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 0, 8)) +>b : Symbol(E.b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 0, 11)) +>c : Symbol(E.c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 0, 14)) + +var a: number; +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) + +var b: boolean; +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) + +var c: string; +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) + +var d: void; +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) + +var e: E; +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) +>E : Symbol(E, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 0, 0)) + +// operator < +var ra1 = a < a; +>ra1 : Symbol(ra1, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 9, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) + +var ra2 = b < b; +>ra2 : Symbol(ra2, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 10, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) + +var ra3 = c < c; +>ra3 : Symbol(ra3, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 11, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) + +var ra4 = d < d; +>ra4 : Symbol(ra4, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 12, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) + +var ra5 = e < e; +>ra5 : Symbol(ra5, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 13, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) + +var ra6 = null < null; +>ra6 : Symbol(ra6, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 14, 3)) + +var ra7 = undefined < undefined; +>ra7 : Symbol(ra7, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 15, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +// operator > +var rb1 = a > a; +>rb1 : Symbol(rb1, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 18, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) + +var rb2 = b > b; +>rb2 : Symbol(rb2, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 19, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) + +var rb3 = c > c; +>rb3 : Symbol(rb3, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 20, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) + +var rb4 = d > d; +>rb4 : Symbol(rb4, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 21, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) + +var rb5 = e > e; +>rb5 : Symbol(rb5, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 22, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) + +var rb6 = null > null; +>rb6 : Symbol(rb6, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 23, 3)) + +var rb7 = undefined > undefined; +>rb7 : Symbol(rb7, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 24, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +// operator <= +var rc1 = a <= a; +>rc1 : Symbol(rc1, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 27, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) + +var rc2 = b <= b; +>rc2 : Symbol(rc2, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 28, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) + +var rc3 = c <= c; +>rc3 : Symbol(rc3, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 29, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) + +var rc4 = d <= d; +>rc4 : Symbol(rc4, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 30, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) + +var rc5 = e <= e; +>rc5 : Symbol(rc5, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 31, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) + +var rc6 = null <= null; +>rc6 : Symbol(rc6, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 32, 3)) + +var rc7 = undefined <= undefined; +>rc7 : Symbol(rc7, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 33, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +// operator >= +var rd1 = a >= a; +>rd1 : Symbol(rd1, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 36, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) + +var rd2 = b >= b; +>rd2 : Symbol(rd2, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 37, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) + +var rd3 = c >= c; +>rd3 : Symbol(rd3, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 38, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) + +var rd4 = d >= d; +>rd4 : Symbol(rd4, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 39, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) + +var rd5 = e >= e; +>rd5 : Symbol(rd5, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 40, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) + +var rd6 = null >= null; +>rd6 : Symbol(rd6, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 41, 3)) + +var rd7 = undefined >= undefined; +>rd7 : Symbol(rd7, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 42, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +// operator == +var re1 = a == a; +>re1 : Symbol(re1, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 45, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) + +var re2 = b == b; +>re2 : Symbol(re2, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 46, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) + +var re3 = c == c; +>re3 : Symbol(re3, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 47, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) + +var re4 = d == d; +>re4 : Symbol(re4, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 48, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) + +var re5 = e == e; +>re5 : Symbol(re5, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 49, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) + +var re6 = null == null; +>re6 : Symbol(re6, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 50, 3)) + +var re7 = undefined == undefined; +>re7 : Symbol(re7, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 51, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +// operator != +var rf1 = a != a; +>rf1 : Symbol(rf1, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 54, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) + +var rf2 = b != b; +>rf2 : Symbol(rf2, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 55, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) + +var rf3 = c != c; +>rf3 : Symbol(rf3, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 56, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) + +var rf4 = d != d; +>rf4 : Symbol(rf4, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 57, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) + +var rf5 = e != e; +>rf5 : Symbol(rf5, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 58, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) + +var rf6 = null != null; +>rf6 : Symbol(rf6, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 59, 3)) + +var rf7 = undefined != undefined; +>rf7 : Symbol(rf7, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 60, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +// operator === +var rg1 = a === a; +>rg1 : Symbol(rg1, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 63, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) + +var rg2 = b === b; +>rg2 : Symbol(rg2, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 64, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) + +var rg3 = c === c; +>rg3 : Symbol(rg3, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 65, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) + +var rg4 = d === d; +>rg4 : Symbol(rg4, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 66, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) + +var rg5 = e === e; +>rg5 : Symbol(rg5, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 67, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) + +var rg6 = null === null; +>rg6 : Symbol(rg6, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 68, 3)) + +var rg7 = undefined === undefined; +>rg7 : Symbol(rg7, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 69, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +// operator !== +var rh1 = a !== a; +>rh1 : Symbol(rh1, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 72, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) + +var rh2 = b !== b; +>rh2 : Symbol(rh2, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 73, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) + +var rh3 = c !== c; +>rh3 : Symbol(rh3, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 74, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) + +var rh4 = d !== d; +>rh4 : Symbol(rh4, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 75, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) + +var rh5 = e !== e; +>rh5 : Symbol(rh5, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 76, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) + +var rh6 = null !== null; +>rh6 : Symbol(rh6, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 77, 3)) + +var rh7 = undefined !== undefined; +>rh7 : Symbol(rh7, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 78, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.types b/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.types index 8c823072ac3..a21af43e9c7 100644 --- a/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.types +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.types @@ -55,6 +55,8 @@ var ra5 = e < e; var ra6 = null < null; >ra6 : boolean >null < null : boolean +>null : null +>null : null var ra7 = undefined < undefined; >ra7 : boolean @@ -96,6 +98,8 @@ var rb5 = e > e; var rb6 = null > null; >rb6 : boolean >null > null : boolean +>null : null +>null : null var rb7 = undefined > undefined; >rb7 : boolean @@ -137,6 +141,8 @@ var rc5 = e <= e; var rc6 = null <= null; >rc6 : boolean >null <= null : boolean +>null : null +>null : null var rc7 = undefined <= undefined; >rc7 : boolean @@ -178,6 +184,8 @@ var rd5 = e >= e; var rd6 = null >= null; >rd6 : boolean >null >= null : boolean +>null : null +>null : null var rd7 = undefined >= undefined; >rd7 : boolean @@ -219,6 +227,8 @@ var re5 = e == e; var re6 = null == null; >re6 : boolean >null == null : boolean +>null : null +>null : null var re7 = undefined == undefined; >re7 : boolean @@ -260,6 +270,8 @@ var rf5 = e != e; var rf6 = null != null; >rf6 : boolean >null != null : boolean +>null : null +>null : null var rf7 = undefined != undefined; >rf7 : boolean @@ -301,6 +313,8 @@ var rg5 = e === e; var rg6 = null === null; >rg6 : boolean >null === null : boolean +>null : null +>null : null var rg7 = undefined === undefined; >rg7 : boolean @@ -342,6 +356,8 @@ var rh5 = e !== e; var rh6 = null !== null; >rh6 : boolean >null !== null : boolean +>null : null +>null : null var rh7 = undefined !== undefined; >rh7 : boolean diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalTypeParameter.symbols b/tests/baselines/reference/comparisonOperatorWithIdenticalTypeParameter.symbols new file mode 100644 index 00000000000..5dd728b39af --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalTypeParameter.symbols @@ -0,0 +1,47 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithIdenticalTypeParameter.ts === +function foo(t: T) { +>foo : Symbol(foo, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 0)) +>T : Symbol(T, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 13)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) +>T : Symbol(T, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 13)) + + var r1 = t < t; +>r1 : Symbol(r1, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 1, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) + + var r2 = t > t; +>r2 : Symbol(r2, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 2, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) + + var r3 = t <= t; +>r3 : Symbol(r3, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 3, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) + + var r4 = t >= t; +>r4 : Symbol(r4, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 4, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) + + var r5 = t == t; +>r5 : Symbol(r5, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 5, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) + + var r6 = t != t; +>r6 : Symbol(r6, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 6, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) + + var r7 = t === t; +>r7 : Symbol(r7, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 7, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) + + var r8 = t !== t; +>r8 : Symbol(r8, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 8, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) +} diff --git a/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.symbols b/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.symbols new file mode 100644 index 00000000000..7cf9a21d09b --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.symbols @@ -0,0 +1,687 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithOneOperandIsAny.ts === +var x: any; +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +enum E { a, b, c } +>E : Symbol(E, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 11)) +>a : Symbol(E.a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 2, 8)) +>b : Symbol(E.b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 2, 11)) +>c : Symbol(E.c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 2, 14)) + +function foo(t: T) { +>foo : Symbol(foo, Decl(comparisonOperatorWithOneOperandIsAny.ts, 2, 18)) +>T : Symbol(T, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 13)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) +>T : Symbol(T, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 13)) + + var foo_r1 = t < x; +>foo_r1 : Symbol(foo_r1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 5, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 14, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + + var foo_r2 = t > x; +>foo_r2 : Symbol(foo_r2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 6, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 15, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + + var foo_r3 = t <= x; +>foo_r3 : Symbol(foo_r3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 7, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 16, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + + var foo_r4 = t >= x; +>foo_r4 : Symbol(foo_r4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 8, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 17, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + + var foo_r5 = t == x; +>foo_r5 : Symbol(foo_r5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 9, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 18, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + + var foo_r6 = t != x; +>foo_r6 : Symbol(foo_r6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 10, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 19, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + + var foo_r7 = t === x; +>foo_r7 : Symbol(foo_r7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 11, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 20, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + + var foo_r8 = t !== x; +>foo_r8 : Symbol(foo_r8, Decl(comparisonOperatorWithOneOperandIsAny.ts, 12, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 21, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + + var foo_r1 = x < t; +>foo_r1 : Symbol(foo_r1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 5, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 14, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) + + var foo_r2 = x > t; +>foo_r2 : Symbol(foo_r2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 6, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 15, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) + + var foo_r3 = x <= t; +>foo_r3 : Symbol(foo_r3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 7, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 16, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) + + var foo_r4 = x >= t; +>foo_r4 : Symbol(foo_r4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 8, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 17, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) + + var foo_r5 = x == t; +>foo_r5 : Symbol(foo_r5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 9, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 18, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) + + var foo_r6 = x != t; +>foo_r6 : Symbol(foo_r6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 10, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 19, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) + + var foo_r7 = x === t; +>foo_r7 : Symbol(foo_r7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 11, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 20, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) + + var foo_r8 = x !== t; +>foo_r8 : Symbol(foo_r8, Decl(comparisonOperatorWithOneOperandIsAny.ts, 12, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 21, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) +} + +var a: boolean; +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) + +var b: number; +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) + +var c: string; +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) + +var d: void; +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) + +var e: E; +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) +>E : Symbol(E, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 11)) + +var f: {}; +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) + +var g: string[]; +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) + +// operator < +var r1a1 = x < a; +>r1a1 : Symbol(r1a1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 33, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) + +var r1a2 = x < b; +>r1a2 : Symbol(r1a2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 34, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) + +var r1a3 = x < c; +>r1a3 : Symbol(r1a3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 35, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) + +var r1a4 = x < d; +>r1a4 : Symbol(r1a4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 36, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) + +var r1a5 = x < e; +>r1a5 : Symbol(r1a5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 37, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) + +var r1a6 = x < f; +>r1a6 : Symbol(r1a6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 38, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) + +var r1a7 = x < g; +>r1a7 : Symbol(r1a7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 39, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) + +var r1b1 = a < x; +>r1b1 : Symbol(r1b1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 41, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r1b2 = b < x; +>r1b2 : Symbol(r1b2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 42, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r1b3 = c < x; +>r1b3 : Symbol(r1b3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 43, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r1b4 = d < x; +>r1b4 : Symbol(r1b4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 44, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r1b5 = e < x; +>r1b5 : Symbol(r1b5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 45, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r1b6 = f < x; +>r1b6 : Symbol(r1b6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 46, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r1b7 = g < x; +>r1b7 : Symbol(r1b7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 47, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +// operator > +var r2a1 = x > a; +>r2a1 : Symbol(r2a1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 50, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) + +var r2a2 = x > b; +>r2a2 : Symbol(r2a2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 51, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) + +var r2a3 = x > c; +>r2a3 : Symbol(r2a3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 52, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) + +var r2a4 = x > d; +>r2a4 : Symbol(r2a4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 53, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) + +var r2a5 = x > e; +>r2a5 : Symbol(r2a5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 54, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) + +var r2a6 = x > f; +>r2a6 : Symbol(r2a6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 55, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) + +var r2a7 = x > g; +>r2a7 : Symbol(r2a7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 56, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) + +var r2b1 = a > x; +>r2b1 : Symbol(r2b1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 58, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r2b2 = b > x; +>r2b2 : Symbol(r2b2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 59, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r2b3 = c > x; +>r2b3 : Symbol(r2b3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 60, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r2b4 = d > x; +>r2b4 : Symbol(r2b4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 61, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r2b5 = e > x; +>r2b5 : Symbol(r2b5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 62, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r2b6 = f > x; +>r2b6 : Symbol(r2b6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 63, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r2b7 = g > x; +>r2b7 : Symbol(r2b7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 64, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +// operator <= +var r3a1 = x <= a; +>r3a1 : Symbol(r3a1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 67, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) + +var r3a2 = x <= b; +>r3a2 : Symbol(r3a2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 68, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) + +var r3a3 = x <= c; +>r3a3 : Symbol(r3a3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 69, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) + +var r3a4 = x <= d; +>r3a4 : Symbol(r3a4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 70, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) + +var r3a5 = x <= e; +>r3a5 : Symbol(r3a5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 71, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) + +var r3a6 = x <= f; +>r3a6 : Symbol(r3a6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 72, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) + +var r3a7 = x <= g; +>r3a7 : Symbol(r3a7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 73, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) + +var r3b1 = a <= x; +>r3b1 : Symbol(r3b1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 75, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r3b2 = b <= x; +>r3b2 : Symbol(r3b2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 76, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r3b3 = c <= x; +>r3b3 : Symbol(r3b3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 77, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r3b4 = d <= x; +>r3b4 : Symbol(r3b4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 78, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r3b5 = e <= x; +>r3b5 : Symbol(r3b5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 79, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r3b6 = f <= x; +>r3b6 : Symbol(r3b6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 80, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r3b7 = g <= x; +>r3b7 : Symbol(r3b7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 81, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +// operator >= +var r4a1 = x >= a; +>r4a1 : Symbol(r4a1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 84, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) + +var r4a2 = x >= b; +>r4a2 : Symbol(r4a2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 85, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) + +var r4a3 = x >= c; +>r4a3 : Symbol(r4a3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 86, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) + +var r4a4 = x >= d; +>r4a4 : Symbol(r4a4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 87, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) + +var r4a5 = x >= e; +>r4a5 : Symbol(r4a5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 88, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) + +var r4a6 = x >= f; +>r4a6 : Symbol(r4a6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 89, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) + +var r4a7 = x >= g; +>r4a7 : Symbol(r4a7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 90, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) + +var r4b1 = a >= x; +>r4b1 : Symbol(r4b1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 92, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r4b2 = b >= x; +>r4b2 : Symbol(r4b2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 93, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r4b3 = c >= x; +>r4b3 : Symbol(r4b3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 94, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r4b4 = d >= x; +>r4b4 : Symbol(r4b4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 95, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r4b5 = e >= x; +>r4b5 : Symbol(r4b5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 96, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r4b6 = f >= x; +>r4b6 : Symbol(r4b6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 97, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r4b7 = g >= x; +>r4b7 : Symbol(r4b7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 98, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +// operator == +var r5a1 = x == a; +>r5a1 : Symbol(r5a1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 101, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) + +var r5a2 = x == b; +>r5a2 : Symbol(r5a2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 102, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) + +var r5a3 = x == c; +>r5a3 : Symbol(r5a3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 103, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) + +var r5a4 = x == d; +>r5a4 : Symbol(r5a4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 104, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) + +var r5a5 = x == e; +>r5a5 : Symbol(r5a5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 105, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) + +var r5a6 = x == f; +>r5a6 : Symbol(r5a6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 106, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) + +var r5a7 = x == g; +>r5a7 : Symbol(r5a7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 107, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) + +var r5b1 = a == x; +>r5b1 : Symbol(r5b1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 109, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r5b2 = b == x; +>r5b2 : Symbol(r5b2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 110, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r5b3 = c == x; +>r5b3 : Symbol(r5b3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 111, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r5b4 = d == x; +>r5b4 : Symbol(r5b4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 112, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r5b5 = e == x; +>r5b5 : Symbol(r5b5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 113, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r5b6 = f == x; +>r5b6 : Symbol(r5b6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 114, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r5b7 = g == x; +>r5b7 : Symbol(r5b7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 115, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +// operator != +var r6a1 = x != a; +>r6a1 : Symbol(r6a1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 118, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) + +var r6a2 = x != b; +>r6a2 : Symbol(r6a2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 119, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) + +var r6a3 = x != c; +>r6a3 : Symbol(r6a3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 120, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) + +var r6a4 = x != d; +>r6a4 : Symbol(r6a4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 121, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) + +var r6a5 = x != e; +>r6a5 : Symbol(r6a5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 122, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) + +var r6a6 = x != f; +>r6a6 : Symbol(r6a6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 123, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) + +var r6a7 = x != g; +>r6a7 : Symbol(r6a7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 124, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) + +var r6b1 = a != x; +>r6b1 : Symbol(r6b1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 126, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r6b2 = b != x; +>r6b2 : Symbol(r6b2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 127, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r6b3 = c != x; +>r6b3 : Symbol(r6b3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 128, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r6b4 = d != x; +>r6b4 : Symbol(r6b4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 129, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r6b5 = e != x; +>r6b5 : Symbol(r6b5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 130, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r6b6 = f != x; +>r6b6 : Symbol(r6b6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 131, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r6b7 = g != x; +>r6b7 : Symbol(r6b7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 132, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +// operator === +var r7a1 = x === a; +>r7a1 : Symbol(r7a1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 135, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) + +var r7a2 = x === b; +>r7a2 : Symbol(r7a2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 136, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) + +var r7a3 = x === c; +>r7a3 : Symbol(r7a3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 137, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) + +var r7a4 = x === d; +>r7a4 : Symbol(r7a4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 138, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) + +var r7a5 = x === e; +>r7a5 : Symbol(r7a5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 139, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) + +var r7a6 = x === f; +>r7a6 : Symbol(r7a6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 140, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) + +var r7a7 = x === g; +>r7a7 : Symbol(r7a7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 141, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) + +var r7b1 = a === x; +>r7b1 : Symbol(r7b1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 143, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r7b2 = b === x; +>r7b2 : Symbol(r7b2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 144, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r7b3 = c === x; +>r7b3 : Symbol(r7b3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 145, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r7b4 = d === x; +>r7b4 : Symbol(r7b4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 146, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r7b5 = e === x; +>r7b5 : Symbol(r7b5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 147, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r7b6 = f === x; +>r7b6 : Symbol(r7b6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 148, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r7b7 = g === x; +>r7b7 : Symbol(r7b7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 149, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +// operator !== +var r8a1 = x !== a; +>r8a1 : Symbol(r8a1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 152, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) + +var r8a2 = x !== b; +>r8a2 : Symbol(r8a2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 153, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) + +var r8a3 = x !== c; +>r8a3 : Symbol(r8a3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 154, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) + +var r8a4 = x !== d; +>r8a4 : Symbol(r8a4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 155, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) + +var r8a5 = x !== e; +>r8a5 : Symbol(r8a5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 156, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) + +var r8a6 = x !== f; +>r8a6 : Symbol(r8a6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 157, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) + +var r8a7 = x !== g; +>r8a7 : Symbol(r8a7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 158, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) + +var r8b1 = a !== x; +>r8b1 : Symbol(r8b1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 160, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r8b2 = b !== x; +>r8b2 : Symbol(r8b2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 161, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r8b3 = c !== x; +>r8b3 : Symbol(r8b3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 162, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r8b4 = d !== x; +>r8b4 : Symbol(r8b4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 163, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r8b5 = e !== x; +>r8b5 : Symbol(r8b5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 164, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r8b6 = f !== x; +>r8b6 : Symbol(r8b6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 165, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r8b7 = g !== x; +>r8b7 : Symbol(r8b7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 166, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + diff --git a/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.symbols b/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.symbols new file mode 100644 index 00000000000..1bc52a2a517 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.symbols @@ -0,0 +1,556 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithOneOperandIsNull.ts === +enum E { a, b, c } +>E : Symbol(E, Decl(comparisonOperatorWithOneOperandIsNull.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 0, 8)) +>b : Symbol(E.b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 0, 11)) +>c : Symbol(E.c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 0, 14)) + +function foo(t: T) { +>foo : Symbol(foo, Decl(comparisonOperatorWithOneOperandIsNull.ts, 0, 18)) +>T : Symbol(T, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 13)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) +>T : Symbol(T, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 13)) + + var foo_r1 = t < null; +>foo_r1 : Symbol(foo_r1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 3, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 12, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r2 = t > null; +>foo_r2 : Symbol(foo_r2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 4, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 13, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r3 = t <= null; +>foo_r3 : Symbol(foo_r3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 5, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 14, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r4 = t >= null; +>foo_r4 : Symbol(foo_r4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 6, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 15, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r5 = t == null; +>foo_r5 : Symbol(foo_r5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 7, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 16, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r6 = t != null; +>foo_r6 : Symbol(foo_r6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 8, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 17, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r7 = t === null; +>foo_r7 : Symbol(foo_r7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 9, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 18, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r8 = t !== null; +>foo_r8 : Symbol(foo_r8, Decl(comparisonOperatorWithOneOperandIsNull.ts, 10, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 19, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r1 = null < t; +>foo_r1 : Symbol(foo_r1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 3, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 12, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r2 = null > t; +>foo_r2 : Symbol(foo_r2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 4, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 13, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r3 = null <= t; +>foo_r3 : Symbol(foo_r3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 5, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 14, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r4 = null >= t; +>foo_r4 : Symbol(foo_r4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 6, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 15, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r5 = null == t; +>foo_r5 : Symbol(foo_r5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 7, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 16, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r6 = null != t; +>foo_r6 : Symbol(foo_r6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 8, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 17, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r7 = null === t; +>foo_r7 : Symbol(foo_r7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 9, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 18, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r8 = null !== t; +>foo_r8 : Symbol(foo_r8, Decl(comparisonOperatorWithOneOperandIsNull.ts, 10, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 19, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) +} + +var a: boolean; +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var b: number; +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var c: string; +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var d: void; +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var e: E; +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) +>E : Symbol(E, Decl(comparisonOperatorWithOneOperandIsNull.ts, 0, 0)) + +var f: {}; +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var g: string[]; +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +// operator < +var r1a1 = null < a; +>r1a1 : Symbol(r1a1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 31, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r1a2 = null < b; +>r1a2 : Symbol(r1a2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 32, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r1a3 = null < c; +>r1a3 : Symbol(r1a3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 33, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r1a4 = null < d; +>r1a4 : Symbol(r1a4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 34, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r1a5 = null < e; +>r1a5 : Symbol(r1a5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 35, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r1a6 = null < f; +>r1a6 : Symbol(r1a6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 36, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r1a7 = null < g; +>r1a7 : Symbol(r1a7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 37, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +var r1b1 = a < null; +>r1b1 : Symbol(r1b1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 39, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r1b2 = b < null; +>r1b2 : Symbol(r1b2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 40, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r1b3 = c < null; +>r1b3 : Symbol(r1b3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 41, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r1b4 = d < null; +>r1b4 : Symbol(r1b4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 42, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r1b5 = e < null; +>r1b5 : Symbol(r1b5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 43, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r1b6 = f < null; +>r1b6 : Symbol(r1b6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 44, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r1b7 = g < null; +>r1b7 : Symbol(r1b7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 45, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +// operator > +var r2a1 = null > a; +>r2a1 : Symbol(r2a1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 48, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r2a2 = null > b; +>r2a2 : Symbol(r2a2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 49, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r2a3 = null > c; +>r2a3 : Symbol(r2a3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 50, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r2a4 = null > d; +>r2a4 : Symbol(r2a4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 51, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r2a5 = null > e; +>r2a5 : Symbol(r2a5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 52, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r2a6 = null > f; +>r2a6 : Symbol(r2a6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 53, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r2a7 = null > g; +>r2a7 : Symbol(r2a7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 54, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +var r2b1 = a > null; +>r2b1 : Symbol(r2b1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 56, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r2b2 = b > null; +>r2b2 : Symbol(r2b2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 57, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r2b3 = c > null; +>r2b3 : Symbol(r2b3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 58, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r2b4 = d > null; +>r2b4 : Symbol(r2b4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 59, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r2b5 = e > null; +>r2b5 : Symbol(r2b5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 60, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r2b6 = f > null; +>r2b6 : Symbol(r2b6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 61, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r2b7 = g > null; +>r2b7 : Symbol(r2b7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 62, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +// operator <= +var r3a1 = null <= a; +>r3a1 : Symbol(r3a1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 65, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r3a2 = null <= b; +>r3a2 : Symbol(r3a2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 66, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r3a3 = null <= c; +>r3a3 : Symbol(r3a3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 67, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r3a4 = null <= d; +>r3a4 : Symbol(r3a4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 68, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r3a5 = null <= e; +>r3a5 : Symbol(r3a5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 69, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r3a6 = null <= f; +>r3a6 : Symbol(r3a6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 70, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r3a7 = null <= g; +>r3a7 : Symbol(r3a7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 71, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +var r3b1 = a <= null; +>r3b1 : Symbol(r3b1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 73, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r3b2 = b <= null; +>r3b2 : Symbol(r3b2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 74, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r3b3 = c <= null; +>r3b3 : Symbol(r3b3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 75, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r3b4 = d <= null; +>r3b4 : Symbol(r3b4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 76, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r3b5 = e <= null; +>r3b5 : Symbol(r3b5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 77, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r3b6 = f <= null; +>r3b6 : Symbol(r3b6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 78, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r3b7 = g <= null; +>r3b7 : Symbol(r3b7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 79, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +// operator >= +var r4a1 = null >= a; +>r4a1 : Symbol(r4a1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 82, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r4a2 = null >= b; +>r4a2 : Symbol(r4a2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 83, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r4a3 = null >= c; +>r4a3 : Symbol(r4a3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 84, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r4a4 = null >= d; +>r4a4 : Symbol(r4a4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 85, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r4a5 = null >= e; +>r4a5 : Symbol(r4a5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 86, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r4a6 = null >= f; +>r4a6 : Symbol(r4a6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 87, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r4a7 = null >= g; +>r4a7 : Symbol(r4a7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 88, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +var r4b1 = a >= null; +>r4b1 : Symbol(r4b1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 90, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r4b2 = b >= null; +>r4b2 : Symbol(r4b2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 91, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r4b3 = c >= null; +>r4b3 : Symbol(r4b3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 92, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r4b4 = d >= null; +>r4b4 : Symbol(r4b4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 93, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r4b5 = e >= null; +>r4b5 : Symbol(r4b5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 94, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r4b6 = f >= null; +>r4b6 : Symbol(r4b6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 95, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r4b7 = g >= null; +>r4b7 : Symbol(r4b7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 96, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +// operator == +var r5a1 = null == a; +>r5a1 : Symbol(r5a1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 99, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r5a2 = null == b; +>r5a2 : Symbol(r5a2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 100, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r5a3 = null == c; +>r5a3 : Symbol(r5a3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 101, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r5a4 = null == d; +>r5a4 : Symbol(r5a4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 102, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r5a5 = null == e; +>r5a5 : Symbol(r5a5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 103, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r5a6 = null == f; +>r5a6 : Symbol(r5a6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 104, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r5a7 = null == g; +>r5a7 : Symbol(r5a7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 105, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +var r5b1 = a == null; +>r5b1 : Symbol(r5b1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 107, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r5b2 = b == null; +>r5b2 : Symbol(r5b2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 108, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r5b3 = c == null; +>r5b3 : Symbol(r5b3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 109, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r5b4 = d == null; +>r5b4 : Symbol(r5b4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 110, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r5b5 = e == null; +>r5b5 : Symbol(r5b5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 111, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r5b6 = f == null; +>r5b6 : Symbol(r5b6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 112, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r5b7 = g == null; +>r5b7 : Symbol(r5b7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 113, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +// operator != +var r6a1 = null != a; +>r6a1 : Symbol(r6a1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 116, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r6a2 = null != b; +>r6a2 : Symbol(r6a2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 117, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r6a3 = null != c; +>r6a3 : Symbol(r6a3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 118, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r6a4 = null != d; +>r6a4 : Symbol(r6a4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 119, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r6a5 = null != e; +>r6a5 : Symbol(r6a5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 120, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r6a6 = null != f; +>r6a6 : Symbol(r6a6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 121, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r6a7 = null != g; +>r6a7 : Symbol(r6a7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 122, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +var r6b1 = a != null; +>r6b1 : Symbol(r6b1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 124, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r6b2 = b != null; +>r6b2 : Symbol(r6b2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 125, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r6b3 = c != null; +>r6b3 : Symbol(r6b3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 126, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r6b4 = d != null; +>r6b4 : Symbol(r6b4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 127, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r6b5 = e != null; +>r6b5 : Symbol(r6b5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 128, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r6b6 = f != null; +>r6b6 : Symbol(r6b6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 129, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r6b7 = g != null; +>r6b7 : Symbol(r6b7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 130, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +// operator === +var r7a1 = null === a; +>r7a1 : Symbol(r7a1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 133, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r7a2 = null === b; +>r7a2 : Symbol(r7a2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 134, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r7a3 = null === c; +>r7a3 : Symbol(r7a3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 135, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r7a4 = null === d; +>r7a4 : Symbol(r7a4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 136, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r7a5 = null === e; +>r7a5 : Symbol(r7a5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 137, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r7a6 = null === f; +>r7a6 : Symbol(r7a6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 138, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r7a7 = null === g; +>r7a7 : Symbol(r7a7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 139, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +var r7b1 = a === null; +>r7b1 : Symbol(r7b1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 141, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r7b2 = b === null; +>r7b2 : Symbol(r7b2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 142, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r7b3 = c === null; +>r7b3 : Symbol(r7b3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 143, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r7b4 = d === null; +>r7b4 : Symbol(r7b4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 144, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r7b5 = e === null; +>r7b5 : Symbol(r7b5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 145, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r7b6 = f === null; +>r7b6 : Symbol(r7b6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 146, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r7b7 = g === null; +>r7b7 : Symbol(r7b7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 147, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +// operator !== +var r8a1 = null !== a; +>r8a1 : Symbol(r8a1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 150, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r8a2 = null !== b; +>r8a2 : Symbol(r8a2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 151, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r8a3 = null !== c; +>r8a3 : Symbol(r8a3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 152, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r8a4 = null !== d; +>r8a4 : Symbol(r8a4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 153, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r8a5 = null !== e; +>r8a5 : Symbol(r8a5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 154, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r8a6 = null !== f; +>r8a6 : Symbol(r8a6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 155, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r8a7 = null !== g; +>r8a7 : Symbol(r8a7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 156, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +var r8b1 = a !== null; +>r8b1 : Symbol(r8b1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 158, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r8b2 = b !== null; +>r8b2 : Symbol(r8b2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 159, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r8b3 = c !== null; +>r8b3 : Symbol(r8b3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 160, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r8b4 = d !== null; +>r8b4 : Symbol(r8b4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 161, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r8b5 = e !== null; +>r8b5 : Symbol(r8b5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 162, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r8b6 = f !== null; +>r8b6 : Symbol(r8b6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 163, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r8b7 = g !== null; +>r8b7 : Symbol(r8b7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 164, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + diff --git a/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.types b/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.types index d1b30eb7f6a..12d9235d44b 100644 --- a/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.types +++ b/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.types @@ -15,80 +15,96 @@ function foo(t: T) { >foo_r1 : boolean >t < null : boolean >t : T +>null : null var foo_r2 = t > null; >foo_r2 : boolean >t > null : boolean >t : T +>null : null var foo_r3 = t <= null; >foo_r3 : boolean >t <= null : boolean >t : T +>null : null var foo_r4 = t >= null; >foo_r4 : boolean >t >= null : boolean >t : T +>null : null var foo_r5 = t == null; >foo_r5 : boolean >t == null : boolean >t : T +>null : null var foo_r6 = t != null; >foo_r6 : boolean >t != null : boolean >t : T +>null : null var foo_r7 = t === null; >foo_r7 : boolean >t === null : boolean >t : T +>null : null var foo_r8 = t !== null; >foo_r8 : boolean >t !== null : boolean >t : T +>null : null var foo_r1 = null < t; >foo_r1 : boolean >null < t : boolean +>null : null >t : T var foo_r2 = null > t; >foo_r2 : boolean >null > t : boolean +>null : null >t : T var foo_r3 = null <= t; >foo_r3 : boolean >null <= t : boolean +>null : null >t : T var foo_r4 = null >= t; >foo_r4 : boolean >null >= t : boolean +>null : null >t : T var foo_r5 = null == t; >foo_r5 : boolean >null == t : boolean +>null : null >t : T var foo_r6 = null != t; >foo_r6 : boolean >null != t : boolean +>null : null >t : T var foo_r7 = null === t; >foo_r7 : boolean >null === t : boolean +>null : null >t : T var foo_r8 = null !== t; >foo_r8 : boolean >null !== t : boolean +>null : null >t : T } @@ -118,567 +134,679 @@ var g: string[]; var r1a1 = null < a; >r1a1 : boolean >null < a : boolean +>null : null >a : boolean var r1a2 = null < b; >r1a2 : boolean >null < b : boolean +>null : null >b : number var r1a3 = null < c; >r1a3 : boolean >null < c : boolean +>null : null >c : string var r1a4 = null < d; >r1a4 : boolean >null < d : boolean +>null : null >d : void var r1a5 = null < e; >r1a5 : boolean >null < e : boolean +>null : null >e : E var r1a6 = null < f; >r1a6 : boolean >null < f : boolean +>null : null >f : {} var r1a7 = null < g; >r1a7 : boolean >null < g : boolean +>null : null >g : string[] var r1b1 = a < null; >r1b1 : boolean >a < null : boolean >a : boolean +>null : null var r1b2 = b < null; >r1b2 : boolean >b < null : boolean >b : number +>null : null var r1b3 = c < null; >r1b3 : boolean >c < null : boolean >c : string +>null : null var r1b4 = d < null; >r1b4 : boolean >d < null : boolean >d : void +>null : null var r1b5 = e < null; >r1b5 : boolean >e < null : boolean >e : E +>null : null var r1b6 = f < null; >r1b6 : boolean >f < null : boolean >f : {} +>null : null var r1b7 = g < null; >r1b7 : boolean >g < null : boolean >g : string[] +>null : null // operator > var r2a1 = null > a; >r2a1 : boolean >null > a : boolean +>null : null >a : boolean var r2a2 = null > b; >r2a2 : boolean >null > b : boolean +>null : null >b : number var r2a3 = null > c; >r2a3 : boolean >null > c : boolean +>null : null >c : string var r2a4 = null > d; >r2a4 : boolean >null > d : boolean +>null : null >d : void var r2a5 = null > e; >r2a5 : boolean >null > e : boolean +>null : null >e : E var r2a6 = null > f; >r2a6 : boolean >null > f : boolean +>null : null >f : {} var r2a7 = null > g; >r2a7 : boolean >null > g : boolean +>null : null >g : string[] var r2b1 = a > null; >r2b1 : boolean >a > null : boolean >a : boolean +>null : null var r2b2 = b > null; >r2b2 : boolean >b > null : boolean >b : number +>null : null var r2b3 = c > null; >r2b3 : boolean >c > null : boolean >c : string +>null : null var r2b4 = d > null; >r2b4 : boolean >d > null : boolean >d : void +>null : null var r2b5 = e > null; >r2b5 : boolean >e > null : boolean >e : E +>null : null var r2b6 = f > null; >r2b6 : boolean >f > null : boolean >f : {} +>null : null var r2b7 = g > null; >r2b7 : boolean >g > null : boolean >g : string[] +>null : null // operator <= var r3a1 = null <= a; >r3a1 : boolean >null <= a : boolean +>null : null >a : boolean var r3a2 = null <= b; >r3a2 : boolean >null <= b : boolean +>null : null >b : number var r3a3 = null <= c; >r3a3 : boolean >null <= c : boolean +>null : null >c : string var r3a4 = null <= d; >r3a4 : boolean >null <= d : boolean +>null : null >d : void var r3a5 = null <= e; >r3a5 : boolean >null <= e : boolean +>null : null >e : E var r3a6 = null <= f; >r3a6 : boolean >null <= f : boolean +>null : null >f : {} var r3a7 = null <= g; >r3a7 : boolean >null <= g : boolean +>null : null >g : string[] var r3b1 = a <= null; >r3b1 : boolean >a <= null : boolean >a : boolean +>null : null var r3b2 = b <= null; >r3b2 : boolean >b <= null : boolean >b : number +>null : null var r3b3 = c <= null; >r3b3 : boolean >c <= null : boolean >c : string +>null : null var r3b4 = d <= null; >r3b4 : boolean >d <= null : boolean >d : void +>null : null var r3b5 = e <= null; >r3b5 : boolean >e <= null : boolean >e : E +>null : null var r3b6 = f <= null; >r3b6 : boolean >f <= null : boolean >f : {} +>null : null var r3b7 = g <= null; >r3b7 : boolean >g <= null : boolean >g : string[] +>null : null // operator >= var r4a1 = null >= a; >r4a1 : boolean >null >= a : boolean +>null : null >a : boolean var r4a2 = null >= b; >r4a2 : boolean >null >= b : boolean +>null : null >b : number var r4a3 = null >= c; >r4a3 : boolean >null >= c : boolean +>null : null >c : string var r4a4 = null >= d; >r4a4 : boolean >null >= d : boolean +>null : null >d : void var r4a5 = null >= e; >r4a5 : boolean >null >= e : boolean +>null : null >e : E var r4a6 = null >= f; >r4a6 : boolean >null >= f : boolean +>null : null >f : {} var r4a7 = null >= g; >r4a7 : boolean >null >= g : boolean +>null : null >g : string[] var r4b1 = a >= null; >r4b1 : boolean >a >= null : boolean >a : boolean +>null : null var r4b2 = b >= null; >r4b2 : boolean >b >= null : boolean >b : number +>null : null var r4b3 = c >= null; >r4b3 : boolean >c >= null : boolean >c : string +>null : null var r4b4 = d >= null; >r4b4 : boolean >d >= null : boolean >d : void +>null : null var r4b5 = e >= null; >r4b5 : boolean >e >= null : boolean >e : E +>null : null var r4b6 = f >= null; >r4b6 : boolean >f >= null : boolean >f : {} +>null : null var r4b7 = g >= null; >r4b7 : boolean >g >= null : boolean >g : string[] +>null : null // operator == var r5a1 = null == a; >r5a1 : boolean >null == a : boolean +>null : null >a : boolean var r5a2 = null == b; >r5a2 : boolean >null == b : boolean +>null : null >b : number var r5a3 = null == c; >r5a3 : boolean >null == c : boolean +>null : null >c : string var r5a4 = null == d; >r5a4 : boolean >null == d : boolean +>null : null >d : void var r5a5 = null == e; >r5a5 : boolean >null == e : boolean +>null : null >e : E var r5a6 = null == f; >r5a6 : boolean >null == f : boolean +>null : null >f : {} var r5a7 = null == g; >r5a7 : boolean >null == g : boolean +>null : null >g : string[] var r5b1 = a == null; >r5b1 : boolean >a == null : boolean >a : boolean +>null : null var r5b2 = b == null; >r5b2 : boolean >b == null : boolean >b : number +>null : null var r5b3 = c == null; >r5b3 : boolean >c == null : boolean >c : string +>null : null var r5b4 = d == null; >r5b4 : boolean >d == null : boolean >d : void +>null : null var r5b5 = e == null; >r5b5 : boolean >e == null : boolean >e : E +>null : null var r5b6 = f == null; >r5b6 : boolean >f == null : boolean >f : {} +>null : null var r5b7 = g == null; >r5b7 : boolean >g == null : boolean >g : string[] +>null : null // operator != var r6a1 = null != a; >r6a1 : boolean >null != a : boolean +>null : null >a : boolean var r6a2 = null != b; >r6a2 : boolean >null != b : boolean +>null : null >b : number var r6a3 = null != c; >r6a3 : boolean >null != c : boolean +>null : null >c : string var r6a4 = null != d; >r6a4 : boolean >null != d : boolean +>null : null >d : void var r6a5 = null != e; >r6a5 : boolean >null != e : boolean +>null : null >e : E var r6a6 = null != f; >r6a6 : boolean >null != f : boolean +>null : null >f : {} var r6a7 = null != g; >r6a7 : boolean >null != g : boolean +>null : null >g : string[] var r6b1 = a != null; >r6b1 : boolean >a != null : boolean >a : boolean +>null : null var r6b2 = b != null; >r6b2 : boolean >b != null : boolean >b : number +>null : null var r6b3 = c != null; >r6b3 : boolean >c != null : boolean >c : string +>null : null var r6b4 = d != null; >r6b4 : boolean >d != null : boolean >d : void +>null : null var r6b5 = e != null; >r6b5 : boolean >e != null : boolean >e : E +>null : null var r6b6 = f != null; >r6b6 : boolean >f != null : boolean >f : {} +>null : null var r6b7 = g != null; >r6b7 : boolean >g != null : boolean >g : string[] +>null : null // operator === var r7a1 = null === a; >r7a1 : boolean >null === a : boolean +>null : null >a : boolean var r7a2 = null === b; >r7a2 : boolean >null === b : boolean +>null : null >b : number var r7a3 = null === c; >r7a3 : boolean >null === c : boolean +>null : null >c : string var r7a4 = null === d; >r7a4 : boolean >null === d : boolean +>null : null >d : void var r7a5 = null === e; >r7a5 : boolean >null === e : boolean +>null : null >e : E var r7a6 = null === f; >r7a6 : boolean >null === f : boolean +>null : null >f : {} var r7a7 = null === g; >r7a7 : boolean >null === g : boolean +>null : null >g : string[] var r7b1 = a === null; >r7b1 : boolean >a === null : boolean >a : boolean +>null : null var r7b2 = b === null; >r7b2 : boolean >b === null : boolean >b : number +>null : null var r7b3 = c === null; >r7b3 : boolean >c === null : boolean >c : string +>null : null var r7b4 = d === null; >r7b4 : boolean >d === null : boolean >d : void +>null : null var r7b5 = e === null; >r7b5 : boolean >e === null : boolean >e : E +>null : null var r7b6 = f === null; >r7b6 : boolean >f === null : boolean >f : {} +>null : null var r7b7 = g === null; >r7b7 : boolean >g === null : boolean >g : string[] +>null : null // operator !== var r8a1 = null !== a; >r8a1 : boolean >null !== a : boolean +>null : null >a : boolean var r8a2 = null !== b; >r8a2 : boolean >null !== b : boolean +>null : null >b : number var r8a3 = null !== c; >r8a3 : boolean >null !== c : boolean +>null : null >c : string var r8a4 = null !== d; >r8a4 : boolean >null !== d : boolean +>null : null >d : void var r8a5 = null !== e; >r8a5 : boolean >null !== e : boolean +>null : null >e : E var r8a6 = null !== f; >r8a6 : boolean >null !== f : boolean +>null : null >f : {} var r8a7 = null !== g; >r8a7 : boolean >null !== g : boolean +>null : null >g : string[] var r8b1 = a !== null; >r8b1 : boolean >a !== null : boolean >a : boolean +>null : null var r8b2 = b !== null; >r8b2 : boolean >b !== null : boolean >b : number +>null : null var r8b3 = c !== null; >r8b3 : boolean >c !== null : boolean >c : string +>null : null var r8b4 = d !== null; >r8b4 : boolean >d !== null : boolean >d : void +>null : null var r8b5 = e !== null; >r8b5 : boolean >e !== null : boolean >e : E +>null : null var r8b6 = f !== null; >r8b6 : boolean >f !== null : boolean >f : {} +>null : null var r8b7 = g !== null; >r8b7 : boolean >g !== null : boolean >g : string[] +>null : null diff --git a/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.symbols b/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.symbols new file mode 100644 index 00000000000..ef865c10abe --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.symbols @@ -0,0 +1,688 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithOneOperandIsUndefined.ts === +var x: typeof undefined; +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>undefined : Symbol(undefined) + +enum E { a, b, c } +>E : Symbol(E, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 24)) +>a : Symbol(E.a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 2, 8)) +>b : Symbol(E.b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 2, 11)) +>c : Symbol(E.c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 2, 14)) + +function foo(t: T) { +>foo : Symbol(foo, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 2, 18)) +>T : Symbol(T, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 13)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) +>T : Symbol(T, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 13)) + + var foo_r1 = t < x; +>foo_r1 : Symbol(foo_r1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 5, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 14, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + + var foo_r2 = t > x; +>foo_r2 : Symbol(foo_r2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 6, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 15, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + + var foo_r3 = t <= x; +>foo_r3 : Symbol(foo_r3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 7, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 16, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + + var foo_r4 = t >= x; +>foo_r4 : Symbol(foo_r4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 8, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 17, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + + var foo_r5 = t == x; +>foo_r5 : Symbol(foo_r5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 9, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 18, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + + var foo_r6 = t != x; +>foo_r6 : Symbol(foo_r6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 10, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 19, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + + var foo_r7 = t === x; +>foo_r7 : Symbol(foo_r7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 11, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 20, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + + var foo_r8 = t !== x; +>foo_r8 : Symbol(foo_r8, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 12, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 21, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + + var foo_r1 = x < t; +>foo_r1 : Symbol(foo_r1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 5, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 14, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) + + var foo_r2 = x > t; +>foo_r2 : Symbol(foo_r2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 6, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 15, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) + + var foo_r3 = x <= t; +>foo_r3 : Symbol(foo_r3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 7, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 16, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) + + var foo_r4 = x >= t; +>foo_r4 : Symbol(foo_r4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 8, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 17, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) + + var foo_r5 = x == t; +>foo_r5 : Symbol(foo_r5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 9, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 18, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) + + var foo_r6 = x != t; +>foo_r6 : Symbol(foo_r6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 10, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 19, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) + + var foo_r7 = x === t; +>foo_r7 : Symbol(foo_r7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 11, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 20, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) + + var foo_r8 = x !== t; +>foo_r8 : Symbol(foo_r8, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 12, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 21, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) +} + +var a: boolean; +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) + +var b: number; +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) + +var c: string; +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) + +var d: void; +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) + +var e: E; +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) +>E : Symbol(E, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 24)) + +var f: {}; +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) + +var g: string[]; +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) + +// operator < +var r1a1 = x < a; +>r1a1 : Symbol(r1a1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 33, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) + +var r1a2 = x < b; +>r1a2 : Symbol(r1a2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 34, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) + +var r1a3 = x < c; +>r1a3 : Symbol(r1a3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 35, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) + +var r1a4 = x < d; +>r1a4 : Symbol(r1a4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 36, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) + +var r1a5 = x < e; +>r1a5 : Symbol(r1a5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 37, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) + +var r1a6 = x < f; +>r1a6 : Symbol(r1a6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 38, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) + +var r1a7 = x < g; +>r1a7 : Symbol(r1a7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 39, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) + +var r1b1 = a < x; +>r1b1 : Symbol(r1b1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 41, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r1b2 = b < x; +>r1b2 : Symbol(r1b2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 42, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r1b3 = c < x; +>r1b3 : Symbol(r1b3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 43, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r1b4 = d < x; +>r1b4 : Symbol(r1b4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 44, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r1b5 = e < x; +>r1b5 : Symbol(r1b5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 45, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r1b6 = f < x; +>r1b6 : Symbol(r1b6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 46, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r1b7 = g < x; +>r1b7 : Symbol(r1b7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 47, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +// operator > +var r2a1 = x > a; +>r2a1 : Symbol(r2a1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 50, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) + +var r2a2 = x > b; +>r2a2 : Symbol(r2a2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 51, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) + +var r2a3 = x > c; +>r2a3 : Symbol(r2a3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 52, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) + +var r2a4 = x > d; +>r2a4 : Symbol(r2a4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 53, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) + +var r2a5 = x > e; +>r2a5 : Symbol(r2a5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 54, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) + +var r2a6 = x > f; +>r2a6 : Symbol(r2a6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 55, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) + +var r2a7 = x > g; +>r2a7 : Symbol(r2a7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 56, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) + +var r2b1 = a > x; +>r2b1 : Symbol(r2b1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 58, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r2b2 = b > x; +>r2b2 : Symbol(r2b2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 59, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r2b3 = c > x; +>r2b3 : Symbol(r2b3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 60, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r2b4 = d > x; +>r2b4 : Symbol(r2b4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 61, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r2b5 = e > x; +>r2b5 : Symbol(r2b5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 62, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r2b6 = f > x; +>r2b6 : Symbol(r2b6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 63, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r2b7 = g > x; +>r2b7 : Symbol(r2b7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 64, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +// operator <= +var r3a1 = x <= a; +>r3a1 : Symbol(r3a1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 67, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) + +var r3a2 = x <= b; +>r3a2 : Symbol(r3a2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 68, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) + +var r3a3 = x <= c; +>r3a3 : Symbol(r3a3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 69, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) + +var r3a4 = x <= d; +>r3a4 : Symbol(r3a4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 70, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) + +var r3a5 = x <= e; +>r3a5 : Symbol(r3a5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 71, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) + +var r3a6 = x <= f; +>r3a6 : Symbol(r3a6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 72, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) + +var r3a7 = x <= g; +>r3a7 : Symbol(r3a7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 73, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) + +var r3b1 = a <= x; +>r3b1 : Symbol(r3b1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 75, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r3b2 = b <= x; +>r3b2 : Symbol(r3b2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 76, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r3b3 = c <= x; +>r3b3 : Symbol(r3b3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 77, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r3b4 = d <= x; +>r3b4 : Symbol(r3b4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 78, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r3b5 = e <= x; +>r3b5 : Symbol(r3b5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 79, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r3b6 = f <= x; +>r3b6 : Symbol(r3b6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 80, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r3b7 = g <= x; +>r3b7 : Symbol(r3b7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 81, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +// operator >= +var r4a1 = x >= a; +>r4a1 : Symbol(r4a1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 84, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) + +var r4a2 = x >= b; +>r4a2 : Symbol(r4a2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 85, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) + +var r4a3 = x >= c; +>r4a3 : Symbol(r4a3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 86, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) + +var r4a4 = x >= d; +>r4a4 : Symbol(r4a4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 87, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) + +var r4a5 = x >= e; +>r4a5 : Symbol(r4a5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 88, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) + +var r4a6 = x >= f; +>r4a6 : Symbol(r4a6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 89, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) + +var r4a7 = x >= g; +>r4a7 : Symbol(r4a7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 90, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) + +var r4b1 = a >= x; +>r4b1 : Symbol(r4b1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 92, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r4b2 = b >= x; +>r4b2 : Symbol(r4b2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 93, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r4b3 = c >= x; +>r4b3 : Symbol(r4b3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 94, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r4b4 = d >= x; +>r4b4 : Symbol(r4b4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 95, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r4b5 = e >= x; +>r4b5 : Symbol(r4b5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 96, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r4b6 = f >= x; +>r4b6 : Symbol(r4b6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 97, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r4b7 = g >= x; +>r4b7 : Symbol(r4b7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 98, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +// operator == +var r5a1 = x == a; +>r5a1 : Symbol(r5a1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 101, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) + +var r5a2 = x == b; +>r5a2 : Symbol(r5a2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 102, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) + +var r5a3 = x == c; +>r5a3 : Symbol(r5a3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 103, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) + +var r5a4 = x == d; +>r5a4 : Symbol(r5a4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 104, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) + +var r5a5 = x == e; +>r5a5 : Symbol(r5a5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 105, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) + +var r5a6 = x == f; +>r5a6 : Symbol(r5a6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 106, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) + +var r5a7 = x == g; +>r5a7 : Symbol(r5a7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 107, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) + +var r5b1 = a == x; +>r5b1 : Symbol(r5b1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 109, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r5b2 = b == x; +>r5b2 : Symbol(r5b2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 110, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r5b3 = c == x; +>r5b3 : Symbol(r5b3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 111, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r5b4 = d == x; +>r5b4 : Symbol(r5b4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 112, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r5b5 = e == x; +>r5b5 : Symbol(r5b5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 113, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r5b6 = f == x; +>r5b6 : Symbol(r5b6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 114, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r5b7 = g == x; +>r5b7 : Symbol(r5b7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 115, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +// operator != +var r6a1 = x != a; +>r6a1 : Symbol(r6a1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 118, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) + +var r6a2 = x != b; +>r6a2 : Symbol(r6a2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 119, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) + +var r6a3 = x != c; +>r6a3 : Symbol(r6a3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 120, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) + +var r6a4 = x != d; +>r6a4 : Symbol(r6a4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 121, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) + +var r6a5 = x != e; +>r6a5 : Symbol(r6a5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 122, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) + +var r6a6 = x != f; +>r6a6 : Symbol(r6a6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 123, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) + +var r6a7 = x != g; +>r6a7 : Symbol(r6a7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 124, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) + +var r6b1 = a != x; +>r6b1 : Symbol(r6b1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 126, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r6b2 = b != x; +>r6b2 : Symbol(r6b2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 127, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r6b3 = c != x; +>r6b3 : Symbol(r6b3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 128, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r6b4 = d != x; +>r6b4 : Symbol(r6b4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 129, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r6b5 = e != x; +>r6b5 : Symbol(r6b5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 130, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r6b6 = f != x; +>r6b6 : Symbol(r6b6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 131, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r6b7 = g != x; +>r6b7 : Symbol(r6b7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 132, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +// operator === +var r7a1 = x === a; +>r7a1 : Symbol(r7a1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 135, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) + +var r7a2 = x === b; +>r7a2 : Symbol(r7a2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 136, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) + +var r7a3 = x === c; +>r7a3 : Symbol(r7a3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 137, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) + +var r7a4 = x === d; +>r7a4 : Symbol(r7a4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 138, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) + +var r7a5 = x === e; +>r7a5 : Symbol(r7a5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 139, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) + +var r7a6 = x === f; +>r7a6 : Symbol(r7a6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 140, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) + +var r7a7 = x === g; +>r7a7 : Symbol(r7a7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 141, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) + +var r7b1 = a === x; +>r7b1 : Symbol(r7b1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 143, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r7b2 = b === x; +>r7b2 : Symbol(r7b2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 144, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r7b3 = c === x; +>r7b3 : Symbol(r7b3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 145, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r7b4 = d === x; +>r7b4 : Symbol(r7b4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 146, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r7b5 = e === x; +>r7b5 : Symbol(r7b5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 147, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r7b6 = f === x; +>r7b6 : Symbol(r7b6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 148, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r7b7 = g === x; +>r7b7 : Symbol(r7b7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 149, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +// operator !== +var r8a1 = x !== a; +>r8a1 : Symbol(r8a1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 152, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) + +var r8a2 = x !== b; +>r8a2 : Symbol(r8a2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 153, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) + +var r8a3 = x !== c; +>r8a3 : Symbol(r8a3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 154, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) + +var r8a4 = x !== d; +>r8a4 : Symbol(r8a4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 155, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) + +var r8a5 = x !== e; +>r8a5 : Symbol(r8a5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 156, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) + +var r8a6 = x !== f; +>r8a6 : Symbol(r8a6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 157, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) + +var r8a7 = x !== g; +>r8a7 : Symbol(r8a7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 158, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) + +var r8b1 = a !== x; +>r8b1 : Symbol(r8b1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 160, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r8b2 = b !== x; +>r8b2 : Symbol(r8b2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 161, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r8b3 = c !== x; +>r8b3 : Symbol(r8b3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 162, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r8b4 = d !== x; +>r8b4 : Symbol(r8b4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 163, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r8b5 = e !== x; +>r8b5 : Symbol(r8b5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 164, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r8b6 = f !== x; +>r8b6 : Symbol(r8b6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 165, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r8b7 = g !== x; +>r8b7 : Symbol(r8b7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 166, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.symbols b/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.symbols new file mode 100644 index 00000000000..e197579ee9f --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.symbols @@ -0,0 +1,310 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithSubtypeEnumAndNumber.ts === +enum E { a, b, c } +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>b : Symbol(E.b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 11)) +>c : Symbol(E.c, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 14)) + +var a: E; +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) + +var b: number; +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +// operator < +var ra1 = a < b; +>ra1 : Symbol(ra1, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 6, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var ra2 = b < a; +>ra2 : Symbol(ra2, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 7, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) + +var ra3 = E.a < b; +>ra3 : Symbol(ra3, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 8, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var ra4 = b < E.a; +>ra4 : Symbol(ra4, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 9, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var ra5 = E.a < 0; +>ra5 : Symbol(ra5, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 10, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var ra6 = 0 < E.a; +>ra6 : Symbol(ra6, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 11, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +// operator > +var rb1 = a > b; +>rb1 : Symbol(rb1, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 14, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var rb2 = b > a; +>rb2 : Symbol(rb2, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 15, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) + +var rb3 = E.a > b; +>rb3 : Symbol(rb3, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 16, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var rb4 = b > E.a; +>rb4 : Symbol(rb4, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 17, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var rb5 = E.a > 0; +>rb5 : Symbol(rb5, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 18, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var rb6 = 0 > E.a; +>rb6 : Symbol(rb6, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 19, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +// operator <= +var rc1 = a <= b; +>rc1 : Symbol(rc1, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 22, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var rc2 = b <= a; +>rc2 : Symbol(rc2, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 23, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) + +var rc3 = E.a <= b; +>rc3 : Symbol(rc3, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 24, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var rc4 = b <= E.a; +>rc4 : Symbol(rc4, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 25, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var rc5 = E.a <= 0; +>rc5 : Symbol(rc5, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 26, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var rc6 = 0 <= E.a; +>rc6 : Symbol(rc6, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 27, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +// operator >= +var rd1 = a >= b; +>rd1 : Symbol(rd1, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 30, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var rd2 = b >= a; +>rd2 : Symbol(rd2, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 31, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) + +var rd3 = E.a >= b; +>rd3 : Symbol(rd3, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 32, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var rd4 = b >= E.a; +>rd4 : Symbol(rd4, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 33, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var rd5 = E.a >= 0; +>rd5 : Symbol(rd5, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 34, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var rd6 = 0 >= E.a; +>rd6 : Symbol(rd6, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 35, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +// operator == +var re1 = a == b; +>re1 : Symbol(re1, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 38, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var re2 = b == a; +>re2 : Symbol(re2, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 39, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) + +var re3 = E.a == b; +>re3 : Symbol(re3, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 40, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var re4 = b == E.a; +>re4 : Symbol(re4, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 41, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var re5 = E.a == 0; +>re5 : Symbol(re5, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 42, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var re6 = 0 == E.a; +>re6 : Symbol(re6, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 43, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +// operator != +var rf1 = a != b; +>rf1 : Symbol(rf1, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 46, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var rf2 = b != a; +>rf2 : Symbol(rf2, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 47, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) + +var rf3 = E.a != b; +>rf3 : Symbol(rf3, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 48, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var rf4 = b != E.a; +>rf4 : Symbol(rf4, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 49, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var rf5 = E.a != 0; +>rf5 : Symbol(rf5, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 50, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var rf6 = 0 != E.a; +>rf6 : Symbol(rf6, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 51, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +// operator === +var rg1 = a === b; +>rg1 : Symbol(rg1, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 54, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var rg2 = b === a; +>rg2 : Symbol(rg2, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 55, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) + +var rg3 = E.a === b; +>rg3 : Symbol(rg3, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 56, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var rg4 = b === E.a; +>rg4 : Symbol(rg4, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 57, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var rg5 = E.a === 0; +>rg5 : Symbol(rg5, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 58, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var rg6 = 0 === E.a; +>rg6 : Symbol(rg6, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 59, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +// operator !== +var rh1 = a !== b; +>rh1 : Symbol(rh1, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 62, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var rh2 = b !== a; +>rh2 : Symbol(rh2, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 63, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) + +var rh3 = E.a !== b; +>rh3 : Symbol(rh3, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 64, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var rh4 = b !== E.a; +>rh4 : Symbol(rh4, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 65, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var rh5 = E.a !== 0; +>rh5 : Symbol(rh5, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 66, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var rh6 = 0 !== E.a; +>rh6 : Symbol(rh6, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 67, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.types b/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.types index 2dfe5913a24..67077683d87 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.types +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.types @@ -47,10 +47,12 @@ var ra5 = E.a < 0; >E.a : E >E : typeof E >a : E +>0 : number var ra6 = 0 < E.a; >ra6 : boolean >0 < E.a : boolean +>0 : number >E.a : E >E : typeof E >a : E @@ -90,10 +92,12 @@ var rb5 = E.a > 0; >E.a : E >E : typeof E >a : E +>0 : number var rb6 = 0 > E.a; >rb6 : boolean >0 > E.a : boolean +>0 : number >E.a : E >E : typeof E >a : E @@ -133,10 +137,12 @@ var rc5 = E.a <= 0; >E.a : E >E : typeof E >a : E +>0 : number var rc6 = 0 <= E.a; >rc6 : boolean >0 <= E.a : boolean +>0 : number >E.a : E >E : typeof E >a : E @@ -176,10 +182,12 @@ var rd5 = E.a >= 0; >E.a : E >E : typeof E >a : E +>0 : number var rd6 = 0 >= E.a; >rd6 : boolean >0 >= E.a : boolean +>0 : number >E.a : E >E : typeof E >a : E @@ -219,10 +227,12 @@ var re5 = E.a == 0; >E.a : E >E : typeof E >a : E +>0 : number var re6 = 0 == E.a; >re6 : boolean >0 == E.a : boolean +>0 : number >E.a : E >E : typeof E >a : E @@ -262,10 +272,12 @@ var rf5 = E.a != 0; >E.a : E >E : typeof E >a : E +>0 : number var rf6 = 0 != E.a; >rf6 : boolean >0 != E.a : boolean +>0 : number >E.a : E >E : typeof E >a : E @@ -305,10 +317,12 @@ var rg5 = E.a === 0; >E.a : E >E : typeof E >a : E +>0 : number var rg6 = 0 === E.a; >rg6 : boolean >0 === E.a : boolean +>0 : number >E.a : E >E : typeof E >a : E @@ -348,10 +362,12 @@ var rh5 = E.a !== 0; >E.a : E >E : typeof E >a : E +>0 : number var rh6 = 0 !== E.a; >rh6 : boolean >0 !== E.a : boolean +>0 : number >E.a : E >E : typeof E >a : E diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.symbols b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.symbols new file mode 100644 index 00000000000..b82a68af007 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.symbols @@ -0,0 +1,1060 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithSubtypeObjectOnCallSignature.ts === +class Base { +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 0, 0)) + + public a: string; +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 0, 12)) +} + +class Derived extends Base { +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 2, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 0, 0)) + + public b: string; +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 4, 28)) +} + +var a1: { fn(): void }; +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 9)) + +var b1: { fn(): void }; +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 9)) + +var a2: { fn(a: number, b: string): void }; +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 9)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 13)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 23)) + +var b2: { fn(a: number, b: string): void }; +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 9)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 13)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 23)) + +var a3: { fn(a: number, b: string): void }; +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 9)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 13)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 23)) + +var b3: { fn(a: number): void }; +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 9)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 13)) + +var a4: { fn(a: number, b: string): void }; +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 9)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 13)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 23)) + +var b4: { fn(): void }; +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 9)) + +var a5: { fn(a: Base): void }; +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 9)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 13)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 0, 0)) + +var b5: { fn(a: Derived): void }; +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 9)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 13)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 2, 1)) + +var a6: { fn(a: Derived, b: Base): void }; +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 9)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 13)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 2, 1)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 24)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 0, 0)) + +var b6: { fn(a: Base, b: Derived): void }; +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 9)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 13)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 0, 0)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 21)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 2, 1)) + +var a7: { fn(): void }; +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 9)) + +var b7: { fn(): Base }; +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 9)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 0, 0)) + +var a8: { fn(): Base }; +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 9)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 0, 0)) + +var b8: { fn(): Base }; +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 9)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 0, 0)) + +var a9: { fn(): Base }; +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 9)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 0, 0)) + +var b9: { fn(): Derived }; +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 9)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 2, 1)) + +var a10: { fn(a?: Base): void }; +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 10)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 14)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 0, 0)) + +var b10: { fn(a?: Derived): void }; +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 10)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 14)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 2, 1)) + +var a11: { fn(...a: Base[]): void }; +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 10)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 14)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 0, 0)) + +var b11: { fn(...a: Derived[]): void }; +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 10)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 14)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 2, 1)) + +//var a12: { fn(t: T, u: U): T[] }; +//var b12: { fn(a: A, b: B): A[] }; + +// operator < +var r1a1 = a1 < b1; +>r1a1 : Symbol(r1a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 45, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) + +var r1a2 = a2 < b2; +>r1a2 : Symbol(r1a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 46, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) + +var r1a3 = a3 < b3; +>r1a3 : Symbol(r1a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 47, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) + +var r1a4 = a4 < b4; +>r1a4 : Symbol(r1a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 48, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) + +var r1a5 = a5 < b5; +>r1a5 : Symbol(r1a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 49, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) + +var r1a6 = a6 < b6; +>r1a6 : Symbol(r1a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 50, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) + +var r1a7 = a7 < b7; +>r1a7 : Symbol(r1a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 51, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) + +var r1a8 = a8 < b8; +>r1a8 : Symbol(r1a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 52, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) + +var r1a9 = a9 < b9; +>r1a9 : Symbol(r1a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 53, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) + +var r1a10 = a10 < b10; +>r1a10 : Symbol(r1a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 54, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) + +var r1a11 = a11 < b11; +>r1a11 : Symbol(r1a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 55, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) + +//var r1a12 = a12 < b12; + +var r1b1 = b1 < a1; +>r1b1 : Symbol(r1b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 58, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) + +var r1b2 = b2 < a2; +>r1b2 : Symbol(r1b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 59, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) + +var r1b3 = b3 < a3; +>r1b3 : Symbol(r1b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 60, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) + +var r1b4 = b4 < a4; +>r1b4 : Symbol(r1b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 61, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) + +var r1b5 = b5 < a5; +>r1b5 : Symbol(r1b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 62, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) + +var r1b6 = b6 < a6; +>r1b6 : Symbol(r1b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 63, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) + +var r1b7 = b7 < a7; +>r1b7 : Symbol(r1b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 64, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) + +var r1b8 = b8 < a8; +>r1b8 : Symbol(r1b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 65, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) + +var r1b9 = b9 < a9; +>r1b9 : Symbol(r1b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 66, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) + +var r1b10 = b10 < a10; +>r1b10 : Symbol(r1b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 67, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) + +var r1b11 = b11 < a11; +>r1b11 : Symbol(r1b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 68, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) + +//var r1b12 = b12 < a12; + +// operator > +var r2a1 = a1 > b1; +>r2a1 : Symbol(r2a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 72, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) + +var r2a2 = a2 > b2; +>r2a2 : Symbol(r2a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 73, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) + +var r2a3 = a3 > b3; +>r2a3 : Symbol(r2a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 74, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) + +var r2a4 = a4 > b4; +>r2a4 : Symbol(r2a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 75, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) + +var r2a5 = a5 > b5; +>r2a5 : Symbol(r2a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 76, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) + +var r2a6 = a6 > b6; +>r2a6 : Symbol(r2a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 77, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) + +var r2a7 = a7 > b7; +>r2a7 : Symbol(r2a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 78, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) + +var r2a8 = a8 > b8; +>r2a8 : Symbol(r2a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 79, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) + +var r2a9 = a9 > b9; +>r2a9 : Symbol(r2a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 80, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) + +var r2a10 = a10 > b10; +>r2a10 : Symbol(r2a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 81, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) + +var r2a11 = a11 > b11; +>r2a11 : Symbol(r2a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 82, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) + +//var r2a12 = a12 > b12; + +var r2b1 = b1 > a1; +>r2b1 : Symbol(r2b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 85, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) + +var r2b2 = b2 > a2; +>r2b2 : Symbol(r2b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 86, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) + +var r2b3 = b3 > a3; +>r2b3 : Symbol(r2b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 87, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) + +var r2b4 = b4 > a4; +>r2b4 : Symbol(r2b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 88, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) + +var r2b5 = b5 > a5; +>r2b5 : Symbol(r2b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 89, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) + +var r2b6 = b6 > a6; +>r2b6 : Symbol(r2b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 90, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) + +var r2b7 = b7 > a7; +>r2b7 : Symbol(r2b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 91, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) + +var r2b8 = b8 > a8; +>r2b8 : Symbol(r2b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 92, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) + +var r2b9 = b9 > a9; +>r2b9 : Symbol(r2b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 93, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) + +var r2b10 = b10 > a10; +>r2b10 : Symbol(r2b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 94, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) + +var r2b11 = b11 > a11; +>r2b11 : Symbol(r2b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 95, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) + +//var r2b12 = b12 > a12; + +// operator <= +var r3a1 = a1 <= b1; +>r3a1 : Symbol(r3a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 99, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) + +var r3a2 = a2 <= b2; +>r3a2 : Symbol(r3a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 100, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) + +var r3a3 = a3 <= b3; +>r3a3 : Symbol(r3a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 101, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) + +var r3a4 = a4 <= b4; +>r3a4 : Symbol(r3a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 102, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) + +var r3a5 = a5 <= b5; +>r3a5 : Symbol(r3a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 103, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) + +var r3a6 = a6 <= b6; +>r3a6 : Symbol(r3a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 104, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) + +var r3a7 = a7 <= b7; +>r3a7 : Symbol(r3a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 105, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) + +var r3a8 = a8 <= b8; +>r3a8 : Symbol(r3a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 106, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) + +var r3a9 = a9 <= b9; +>r3a9 : Symbol(r3a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 107, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) + +var r3a10 = a10 <= b10; +>r3a10 : Symbol(r3a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 108, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) + +var r3a11 = a11 <= b11; +>r3a11 : Symbol(r3a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 109, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) + +//var r3a12 = a12 <= b12; + +var r3b1 = b1 <= a1; +>r3b1 : Symbol(r3b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 112, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) + +var r3b2 = b2 <= a2; +>r3b2 : Symbol(r3b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 113, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) + +var r3b3 = b3 <= a3; +>r3b3 : Symbol(r3b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 114, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) + +var r3b4 = b4 <= a4; +>r3b4 : Symbol(r3b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 115, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) + +var r3b5 = b5 <= a5; +>r3b5 : Symbol(r3b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 116, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) + +var r3b6 = b6 <= a6; +>r3b6 : Symbol(r3b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 117, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) + +var r3b7 = b7 <= a7; +>r3b7 : Symbol(r3b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 118, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) + +var r3b8 = b8 <= a8; +>r3b8 : Symbol(r3b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 119, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) + +var r3b9 = b9 <= a9; +>r3b9 : Symbol(r3b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 120, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) + +var r3b10 = b10 <= a10; +>r3b10 : Symbol(r3b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 121, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) + +var r3b11 = b11 <= a11; +>r3b11 : Symbol(r3b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 122, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) + +//var r3b12 = b12 <= a12; + +// operator >= +var r4a1 = a1 >= b1; +>r4a1 : Symbol(r4a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 126, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) + +var r4a2 = a2 >= b2; +>r4a2 : Symbol(r4a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 127, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) + +var r4a3 = a3 >= b3; +>r4a3 : Symbol(r4a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 128, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) + +var r4a4 = a4 >= b4; +>r4a4 : Symbol(r4a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 129, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) + +var r4a5 = a5 >= b5; +>r4a5 : Symbol(r4a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 130, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) + +var r4a6 = a6 >= b6; +>r4a6 : Symbol(r4a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 131, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) + +var r4a7 = a7 >= b7; +>r4a7 : Symbol(r4a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 132, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) + +var r4a8 = a8 >= b8; +>r4a8 : Symbol(r4a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 133, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) + +var r4a9 = a9 >= b9; +>r4a9 : Symbol(r4a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 134, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) + +var r4a10 = a10 >= b10; +>r4a10 : Symbol(r4a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 135, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) + +var r4a11 = a11 >= b11; +>r4a11 : Symbol(r4a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 136, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) + +//var r4a12 = a12 >= b12; + +var r4b1 = b1 >= a1; +>r4b1 : Symbol(r4b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 139, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) + +var r4b2 = b2 >= a2; +>r4b2 : Symbol(r4b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 140, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) + +var r4b3 = b3 >= a3; +>r4b3 : Symbol(r4b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 141, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) + +var r4b4 = b4 >= a4; +>r4b4 : Symbol(r4b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 142, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) + +var r4b5 = b5 >= a5; +>r4b5 : Symbol(r4b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 143, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) + +var r4b6 = b6 >= a6; +>r4b6 : Symbol(r4b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 144, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) + +var r4b7 = b7 >= a7; +>r4b7 : Symbol(r4b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 145, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) + +var r4b8 = b8 >= a8; +>r4b8 : Symbol(r4b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 146, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) + +var r4b9 = b9 >= a9; +>r4b9 : Symbol(r4b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 147, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) + +var r4b10 = b10 >= a10; +>r4b10 : Symbol(r4b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 148, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) + +var r4b11 = b11 >= a11; +>r4b11 : Symbol(r4b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 149, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) + +//var r4b12 = b12 >= a12; + +// operator == +var r5a1 = a1 == b1; +>r5a1 : Symbol(r5a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 153, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) + +var r5a2 = a2 == b2; +>r5a2 : Symbol(r5a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 154, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) + +var r5a3 = a3 == b3; +>r5a3 : Symbol(r5a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 155, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) + +var r5a4 = a4 == b4; +>r5a4 : Symbol(r5a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 156, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) + +var r5a5 = a5 == b5; +>r5a5 : Symbol(r5a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 157, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) + +var r5a6 = a6 == b6; +>r5a6 : Symbol(r5a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 158, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) + +var r5a7 = a7 == b7; +>r5a7 : Symbol(r5a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 159, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) + +var r5a8 = a8 == b8; +>r5a8 : Symbol(r5a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 160, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) + +var r5a9 = a9 == b9; +>r5a9 : Symbol(r5a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 161, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) + +var r5a10 = a10 == b10; +>r5a10 : Symbol(r5a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 162, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) + +var r5a11 = a11 == b11; +>r5a11 : Symbol(r5a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 163, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) + +//var r5a12 = a12 == b12; + +var r5b1 = b1 == a1; +>r5b1 : Symbol(r5b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 166, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) + +var r5b2 = b2 == a2; +>r5b2 : Symbol(r5b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 167, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) + +var r5b3 = b3 == a3; +>r5b3 : Symbol(r5b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 168, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) + +var r5b4 = b4 == a4; +>r5b4 : Symbol(r5b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 169, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) + +var r5b5 = b5 == a5; +>r5b5 : Symbol(r5b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 170, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) + +var r5b6 = b6 == a6; +>r5b6 : Symbol(r5b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 171, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) + +var r5b7 = b7 == a7; +>r5b7 : Symbol(r5b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 172, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) + +var r5b8 = b8 == a8; +>r5b8 : Symbol(r5b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 173, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) + +var r5b9 = b9 == a9; +>r5b9 : Symbol(r5b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 174, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) + +var r5b10 = b10 == a10; +>r5b10 : Symbol(r5b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 175, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) + +var r5b11 = b11 == a11; +>r5b11 : Symbol(r5b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 176, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) + +//var r5b12 = b12 == a12; + +// operator != +var r6a1 = a1 != b1; +>r6a1 : Symbol(r6a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 180, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) + +var r6a2 = a2 != b2; +>r6a2 : Symbol(r6a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 181, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) + +var r6a3 = a3 != b3; +>r6a3 : Symbol(r6a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 182, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) + +var r6a4 = a4 != b4; +>r6a4 : Symbol(r6a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 183, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) + +var r6a5 = a5 != b5; +>r6a5 : Symbol(r6a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 184, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) + +var r6a6 = a6 != b6; +>r6a6 : Symbol(r6a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 185, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) + +var r6a7 = a7 != b7; +>r6a7 : Symbol(r6a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 186, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) + +var r6a8 = a8 != b8; +>r6a8 : Symbol(r6a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 187, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) + +var r6a9 = a9 != b9; +>r6a9 : Symbol(r6a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 188, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) + +var r6a10 = a10 != b10; +>r6a10 : Symbol(r6a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 189, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) + +var r6a11 = a11 != b11; +>r6a11 : Symbol(r6a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 190, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) + +//var r6a12 = a12 != b12; + +var r6b1 = b1 != a1; +>r6b1 : Symbol(r6b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 193, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) + +var r6b2 = b2 != a2; +>r6b2 : Symbol(r6b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 194, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) + +var r6b3 = b3 != a3; +>r6b3 : Symbol(r6b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 195, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) + +var r6b4 = b4 != a4; +>r6b4 : Symbol(r6b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 196, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) + +var r6b5 = b5 != a5; +>r6b5 : Symbol(r6b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 197, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) + +var r6b6 = b6 != a6; +>r6b6 : Symbol(r6b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 198, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) + +var r6b7 = b7 != a7; +>r6b7 : Symbol(r6b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 199, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) + +var r6b8 = b8 != a8; +>r6b8 : Symbol(r6b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 200, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) + +var r6b9 = b9 != a9; +>r6b9 : Symbol(r6b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 201, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) + +var r6b10 = b10 != a10; +>r6b10 : Symbol(r6b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 202, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) + +var r6b11 = b11 != a11; +>r6b11 : Symbol(r6b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 203, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) + +//var r6b12 = b12 != a12; + +// operator === +var r7a1 = a1 === b1; +>r7a1 : Symbol(r7a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 207, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) + +var r7a2 = a2 === b2; +>r7a2 : Symbol(r7a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 208, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) + +var r7a3 = a3 === b3; +>r7a3 : Symbol(r7a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 209, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) + +var r7a4 = a4 === b4; +>r7a4 : Symbol(r7a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 210, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) + +var r7a5 = a5 === b5; +>r7a5 : Symbol(r7a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 211, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) + +var r7a6 = a6 === b6; +>r7a6 : Symbol(r7a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 212, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) + +var r7a7 = a7 === b7; +>r7a7 : Symbol(r7a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 213, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) + +var r7a8 = a8 === b8; +>r7a8 : Symbol(r7a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 214, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) + +var r7a9 = a9 === b9; +>r7a9 : Symbol(r7a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 215, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) + +var r7a10 = a10 === b10; +>r7a10 : Symbol(r7a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 216, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) + +var r7a11 = a11 === b11; +>r7a11 : Symbol(r7a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 217, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) + +//var r7a12 = a12 === b12; + +var r7b1 = b1 === a1; +>r7b1 : Symbol(r7b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 220, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) + +var r7b2 = b2 === a2; +>r7b2 : Symbol(r7b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 221, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) + +var r7b3 = b3 === a3; +>r7b3 : Symbol(r7b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 222, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) + +var r7b4 = b4 === a4; +>r7b4 : Symbol(r7b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 223, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) + +var r7b5 = b5 === a5; +>r7b5 : Symbol(r7b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 224, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) + +var r7b6 = b6 === a6; +>r7b6 : Symbol(r7b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 225, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) + +var r7b7 = b7 === a7; +>r7b7 : Symbol(r7b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 226, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) + +var r7b8 = b8 === a8; +>r7b8 : Symbol(r7b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 227, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) + +var r7b9 = b9 === a9; +>r7b9 : Symbol(r7b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 228, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) + +var r7b10 = b10 === a10; +>r7b10 : Symbol(r7b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 229, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) + +var r7b11 = b11 === a11; +>r7b11 : Symbol(r7b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 230, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) + +//var r7b12 = b12 === a12; + +// operator !== +var r8a1 = a1 !== b1; +>r8a1 : Symbol(r8a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 234, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) + +var r8a2 = a2 !== b2; +>r8a2 : Symbol(r8a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 235, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) + +var r8a3 = a3 !== b3; +>r8a3 : Symbol(r8a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 236, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) + +var r8a4 = a4 !== b4; +>r8a4 : Symbol(r8a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 237, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) + +var r8a5 = a5 !== b5; +>r8a5 : Symbol(r8a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 238, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) + +var r8a6 = a6 !== b6; +>r8a6 : Symbol(r8a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 239, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) + +var r8a7 = a7 !== b7; +>r8a7 : Symbol(r8a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 240, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) + +var r8a8 = a8 !== b8; +>r8a8 : Symbol(r8a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 241, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) + +var r8a9 = a9 !== b9; +>r8a9 : Symbol(r8a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 242, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) + +var r8a10 = a10 !== b10; +>r8a10 : Symbol(r8a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 243, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) + +var r8a11 = a11 !== b11; +>r8a11 : Symbol(r8a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 244, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) + +//var r8a12 = a12 !== b12; + +var r8b1 = b1 !== a1; +>r8b1 : Symbol(r8b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 247, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) + +var r8b2 = b2 !== a2; +>r8b2 : Symbol(r8b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 248, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) + +var r8b3 = b3 !== a3; +>r8b3 : Symbol(r8b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 249, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) + +var r8b4 = b4 !== a4; +>r8b4 : Symbol(r8b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 250, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) + +var r8b5 = b5 !== a5; +>r8b5 : Symbol(r8b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 251, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) + +var r8b6 = b6 !== a6; +>r8b6 : Symbol(r8b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 252, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) + +var r8b7 = b7 !== a7; +>r8b7 : Symbol(r8b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 253, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) + +var r8b8 = b8 !== a8; +>r8b8 : Symbol(r8b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 254, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) + +var r8b9 = b9 !== a9; +>r8b9 : Symbol(r8b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 255, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) + +var r8b10 = b10 !== a10; +>r8b10 : Symbol(r8b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 256, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) + +var r8b11 = b11 !== a11; +>r8b11 : Symbol(r8b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 257, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) + +//var r8b12 = b12 !== a12; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.symbols b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.symbols new file mode 100644 index 00000000000..6dd08fc0529 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.symbols @@ -0,0 +1,879 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts === +class Base { +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + + public a: string; +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 12)) +} + +class Derived extends Base { +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 2, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + + public b: string; +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 4, 28)) +} + +var a1: { new (): Base }; +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var b1: { new (): Base }; +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var a2: { new (a: number, b: string): Base }; +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 15)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 25)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var b2: { new (a: number, b: string): Base }; +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 15)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 25)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var a3: { new (a: number, b: string): Base }; +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 15)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 25)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var b3: { new (a: number): Base }; +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 15)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var a4: { new (a: number, b: string): Base }; +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 15)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 25)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var b4: { new (): Base }; +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var a5: { new (a: Base): Base }; +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 15)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var b5: { new (a: Derived): Base }; +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 15)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 2, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var a6: { new (a: Derived, b: Base): Base }; +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 15)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 2, 1)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 26)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var b6: { new (a: Base, b: Derived): Base }; +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 15)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 23)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 2, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var a7: { new (): Base }; +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var b7: { new (): Derived }; +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 2, 1)) + +var a8: { new (a?: Base): Base }; +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 15)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var b8: { new (a?: Derived): Base }; +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 15)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 2, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var a9: { new (...a: Base[]): Base }; +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 15)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var b9: { new (...a: Derived[]): Base }; +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 15)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 2, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +//var a10: { (t: T, u: U): T[] }; +//var b10: { (a: A, b: B): A[] }; + +// operator < +var r1a1 = a1 < b1; +>r1a1 : Symbol(r1a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 39, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) + +var r1a2 = a2 < b2; +>r1a2 : Symbol(r1a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 40, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) + +var r1a3 = a3 < b3; +>r1a3 : Symbol(r1a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 41, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) + +var r1a4 = a4 < b4; +>r1a4 : Symbol(r1a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 42, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) + +var r1a5 = a5 < b5; +>r1a5 : Symbol(r1a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 43, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) + +var r1a6 = a6 < b6; +>r1a6 : Symbol(r1a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 44, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) + +var r1a7 = a7 < b7; +>r1a7 : Symbol(r1a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 45, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) + +var r1a8 = a8 < b8; +>r1a8 : Symbol(r1a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 46, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) + +var r1a9 = a9 < b9; +>r1a9 : Symbol(r1a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 47, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) + +//var r1a10 = a10 < b10; + +var r1b1 = b1 < a1; +>r1b1 : Symbol(r1b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 50, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) + +var r1b2 = b2 < a2; +>r1b2 : Symbol(r1b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 51, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) + +var r1b3 = b3 < a3; +>r1b3 : Symbol(r1b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 52, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) + +var r1b4 = b4 < a4; +>r1b4 : Symbol(r1b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 53, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) + +var r1b5 = b5 < a5; +>r1b5 : Symbol(r1b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 54, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) + +var r1b6 = b6 < a6; +>r1b6 : Symbol(r1b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 55, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) + +var r1b7 = b7 < a7; +>r1b7 : Symbol(r1b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 56, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) + +var r1b8 = b8 < a8; +>r1b8 : Symbol(r1b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 57, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) + +var r1b9 = b9 < a9; +>r1b9 : Symbol(r1b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 58, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) + +//var r1b10 = b10 < a10; + +// operator > +var r2a1 = a1 > b1; +>r2a1 : Symbol(r2a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 62, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) + +var r2a2 = a2 > b2; +>r2a2 : Symbol(r2a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 63, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) + +var r2a3 = a3 > b3; +>r2a3 : Symbol(r2a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 64, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) + +var r2a4 = a4 > b4; +>r2a4 : Symbol(r2a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 65, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) + +var r2a5 = a5 > b5; +>r2a5 : Symbol(r2a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 66, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) + +var r2a6 = a6 > b6; +>r2a6 : Symbol(r2a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 67, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) + +var r2a7 = a7 > b7; +>r2a7 : Symbol(r2a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 68, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) + +var r2a8 = a8 > b8; +>r2a8 : Symbol(r2a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 69, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) + +var r2a9 = a9 > b9; +>r2a9 : Symbol(r2a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 70, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) + +//var r2a10 = a10 > b10; + +var r2b1 = b1 > a1; +>r2b1 : Symbol(r2b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 73, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) + +var r2b2 = b2 > a2; +>r2b2 : Symbol(r2b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 74, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) + +var r2b3 = b3 > a3; +>r2b3 : Symbol(r2b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 75, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) + +var r2b4 = b4 > a4; +>r2b4 : Symbol(r2b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 76, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) + +var r2b5 = b5 > a5; +>r2b5 : Symbol(r2b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 77, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) + +var r2b6 = b6 > a6; +>r2b6 : Symbol(r2b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 78, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) + +var r2b7 = b7 > a7; +>r2b7 : Symbol(r2b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 79, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) + +var r2b8 = b8 > a8; +>r2b8 : Symbol(r2b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 80, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) + +var r2b9 = b9 > a9; +>r2b9 : Symbol(r2b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 81, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) + +//var r2b10 = b10 > a10; + +// operator <= +var r3a1 = a1 <= b1; +>r3a1 : Symbol(r3a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 85, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) + +var r3a2 = a2 <= b2; +>r3a2 : Symbol(r3a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 86, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) + +var r3a3 = a3 <= b3; +>r3a3 : Symbol(r3a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 87, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) + +var r3a4 = a4 <= b4; +>r3a4 : Symbol(r3a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 88, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) + +var r3a5 = a5 <= b5; +>r3a5 : Symbol(r3a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 89, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) + +var r3a6 = a6 <= b6; +>r3a6 : Symbol(r3a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 90, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) + +var r3a7 = a7 <= b7; +>r3a7 : Symbol(r3a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 91, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) + +var r3a8 = a8 <= b8; +>r3a8 : Symbol(r3a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 92, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) + +var r3a9 = a9 <= b9; +>r3a9 : Symbol(r3a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 93, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) + +//var r3a10 = a10 <= b10; + +var r3b1 = b1 <= a1; +>r3b1 : Symbol(r3b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 96, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) + +var r3b2 = b2 <= a2; +>r3b2 : Symbol(r3b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 97, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) + +var r3b3 = b3 <= a3; +>r3b3 : Symbol(r3b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 98, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) + +var r3b4 = b4 <= a4; +>r3b4 : Symbol(r3b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 99, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) + +var r3b5 = b5 <= a5; +>r3b5 : Symbol(r3b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 100, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) + +var r3b6 = b6 <= a6; +>r3b6 : Symbol(r3b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 101, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) + +var r3b7 = b7 <= a7; +>r3b7 : Symbol(r3b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 102, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) + +var r3b8 = b8 <= a8; +>r3b8 : Symbol(r3b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 103, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) + +var r3b9 = b9 <= a9; +>r3b9 : Symbol(r3b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 104, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) + +//var r3b10 = b10 <= a10; + +// operator >= +var r4a1 = a1 >= b1; +>r4a1 : Symbol(r4a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 108, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) + +var r4a2 = a2 >= b2; +>r4a2 : Symbol(r4a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 109, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) + +var r4a3 = a3 >= b3; +>r4a3 : Symbol(r4a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 110, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) + +var r4a4 = a4 >= b4; +>r4a4 : Symbol(r4a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 111, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) + +var r4a5 = a5 >= b5; +>r4a5 : Symbol(r4a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 112, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) + +var r4a6 = a6 >= b6; +>r4a6 : Symbol(r4a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 113, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) + +var r4a7 = a7 >= b7; +>r4a7 : Symbol(r4a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 114, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) + +var r4a8 = a8 >= b8; +>r4a8 : Symbol(r4a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 115, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) + +var r4a9 = a9 >= b9; +>r4a9 : Symbol(r4a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 116, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) + +//var r4a10 = a10 >= b10; + +var r4b1 = b1 >= a1; +>r4b1 : Symbol(r4b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 119, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) + +var r4b2 = b2 >= a2; +>r4b2 : Symbol(r4b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 120, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) + +var r4b3 = b3 >= a3; +>r4b3 : Symbol(r4b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 121, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) + +var r4b4 = b4 >= a4; +>r4b4 : Symbol(r4b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 122, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) + +var r4b5 = b5 >= a5; +>r4b5 : Symbol(r4b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 123, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) + +var r4b6 = b6 >= a6; +>r4b6 : Symbol(r4b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 124, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) + +var r4b7 = b7 >= a7; +>r4b7 : Symbol(r4b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 125, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) + +var r4b8 = b8 >= a8; +>r4b8 : Symbol(r4b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 126, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) + +var r4b9 = b9 >= a9; +>r4b9 : Symbol(r4b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 127, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) + +//var r4b10 = b10 >= a10; + +// operator == +var r5a1 = a1 == b1; +>r5a1 : Symbol(r5a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 131, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) + +var r5a2 = a2 == b2; +>r5a2 : Symbol(r5a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 132, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) + +var r5a3 = a3 == b3; +>r5a3 : Symbol(r5a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 133, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) + +var r5a4 = a4 == b4; +>r5a4 : Symbol(r5a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 134, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) + +var r5a5 = a5 == b5; +>r5a5 : Symbol(r5a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 135, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) + +var r5a6 = a6 == b6; +>r5a6 : Symbol(r5a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 136, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) + +var r5a7 = a7 == b7; +>r5a7 : Symbol(r5a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 137, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) + +var r5a8 = a8 == b8; +>r5a8 : Symbol(r5a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 138, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) + +var r5a9 = a9 == b9; +>r5a9 : Symbol(r5a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 139, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) + +//var r5a10 = a10 == b10; + +var r5b1 = b1 == a1; +>r5b1 : Symbol(r5b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 142, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) + +var r5b2 = b2 == a2; +>r5b2 : Symbol(r5b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 143, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) + +var r5b3 = b3 == a3; +>r5b3 : Symbol(r5b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 144, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) + +var r5b4 = b4 == a4; +>r5b4 : Symbol(r5b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 145, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) + +var r5b5 = b5 == a5; +>r5b5 : Symbol(r5b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 146, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) + +var r5b6 = b6 == a6; +>r5b6 : Symbol(r5b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 147, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) + +var r5b7 = b7 == a7; +>r5b7 : Symbol(r5b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 148, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) + +var r5b8 = b8 == a8; +>r5b8 : Symbol(r5b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 149, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) + +var r5b9 = b9 == a9; +>r5b9 : Symbol(r5b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 150, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) + +//var r5b10 = b10 == a10; + +// operator != +var r6a1 = a1 != b1; +>r6a1 : Symbol(r6a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 154, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) + +var r6a2 = a2 != b2; +>r6a2 : Symbol(r6a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 155, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) + +var r6a3 = a3 != b3; +>r6a3 : Symbol(r6a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 156, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) + +var r6a4 = a4 != b4; +>r6a4 : Symbol(r6a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 157, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) + +var r6a5 = a5 != b5; +>r6a5 : Symbol(r6a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 158, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) + +var r6a6 = a6 != b6; +>r6a6 : Symbol(r6a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 159, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) + +var r6a7 = a7 != b7; +>r6a7 : Symbol(r6a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 160, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) + +var r6a8 = a8 != b8; +>r6a8 : Symbol(r6a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 161, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) + +var r6a9 = a9 != b9; +>r6a9 : Symbol(r6a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 162, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) + +//var r6a10 = a10 != b10; + +var r6b1 = b1 != a1; +>r6b1 : Symbol(r6b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 165, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) + +var r6b2 = b2 != a2; +>r6b2 : Symbol(r6b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 166, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) + +var r6b3 = b3 != a3; +>r6b3 : Symbol(r6b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 167, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) + +var r6b4 = b4 != a4; +>r6b4 : Symbol(r6b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 168, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) + +var r6b5 = b5 != a5; +>r6b5 : Symbol(r6b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 169, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) + +var r6b6 = b6 != a6; +>r6b6 : Symbol(r6b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 170, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) + +var r6b7 = b7 != a7; +>r6b7 : Symbol(r6b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 171, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) + +var r6b8 = b8 != a8; +>r6b8 : Symbol(r6b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 172, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) + +var r6b9 = b9 != a9; +>r6b9 : Symbol(r6b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 173, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) + +//var r6b10 = b10 != a10; + +// operator === +var r7a1 = a1 === b1; +>r7a1 : Symbol(r7a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 177, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) + +var r7a2 = a2 === b2; +>r7a2 : Symbol(r7a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 178, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) + +var r7a3 = a3 === b3; +>r7a3 : Symbol(r7a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 179, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) + +var r7a4 = a4 === b4; +>r7a4 : Symbol(r7a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 180, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) + +var r7a5 = a5 === b5; +>r7a5 : Symbol(r7a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 181, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) + +var r7a6 = a6 === b6; +>r7a6 : Symbol(r7a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 182, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) + +var r7a7 = a7 === b7; +>r7a7 : Symbol(r7a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 183, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) + +var r7a8 = a8 === b8; +>r7a8 : Symbol(r7a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 184, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) + +var r7a9 = a9 === b9; +>r7a9 : Symbol(r7a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 185, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) + +//var r7a10 = a10 === b10; + +var r7b1 = b1 === a1; +>r7b1 : Symbol(r7b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 188, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) + +var r7b2 = b2 === a2; +>r7b2 : Symbol(r7b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 189, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) + +var r7b3 = b3 === a3; +>r7b3 : Symbol(r7b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 190, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) + +var r7b4 = b4 === a4; +>r7b4 : Symbol(r7b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 191, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) + +var r7b5 = b5 === a5; +>r7b5 : Symbol(r7b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 192, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) + +var r7b6 = b6 === a6; +>r7b6 : Symbol(r7b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 193, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) + +var r7b7 = b7 === a7; +>r7b7 : Symbol(r7b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 194, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) + +var r7b8 = b8 === a8; +>r7b8 : Symbol(r7b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 195, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) + +var r7b9 = b9 === a9; +>r7b9 : Symbol(r7b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 196, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) + +//var r7b10 = b10 === a10; + +// operator !== +var r8a1 = a1 !== b1; +>r8a1 : Symbol(r8a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 200, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) + +var r8a2 = a2 !== b2; +>r8a2 : Symbol(r8a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 201, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) + +var r8a3 = a3 !== b3; +>r8a3 : Symbol(r8a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 202, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) + +var r8a4 = a4 !== b4; +>r8a4 : Symbol(r8a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 203, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) + +var r8a5 = a5 !== b5; +>r8a5 : Symbol(r8a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 204, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) + +var r8a6 = a6 !== b6; +>r8a6 : Symbol(r8a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 205, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) + +var r8a7 = a7 !== b7; +>r8a7 : Symbol(r8a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 206, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) + +var r8a8 = a8 !== b8; +>r8a8 : Symbol(r8a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 207, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) + +var r8a9 = a9 !== b9; +>r8a9 : Symbol(r8a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 208, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) + +//var r8a10 = a10 !== b10; + +var r8b1 = b1 !== a1; +>r8b1 : Symbol(r8b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 211, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) + +var r8b2 = b2 !== a2; +>r8b2 : Symbol(r8b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 212, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) + +var r8b3 = b3 !== a3; +>r8b3 : Symbol(r8b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 213, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) + +var r8b4 = b4 !== a4; +>r8b4 : Symbol(r8b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 214, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) + +var r8b5 = b5 !== a5; +>r8b5 : Symbol(r8b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 215, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) + +var r8b6 = b6 !== a6; +>r8b6 : Symbol(r8b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 216, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) + +var r8b7 = b7 !== a7; +>r8b7 : Symbol(r8b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 217, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) + +var r8b8 = b8 !== a8; +>r8b8 : Symbol(r8b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 218, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) + +var r8b9 = b9 !== a9; +>r8b9 : Symbol(r8b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 219, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) + +//var r8b10 = b10 !== a10; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.symbols b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.symbols new file mode 100644 index 00000000000..be0537baee4 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.symbols @@ -0,0 +1,380 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithSubtypeObjectOnIndexSignature.ts === +class Base { +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 0, 0)) + + public a: string; +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 0, 12)) +} + +class Derived extends Base { +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 2, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 0, 0)) + + public b: string; +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 4, 28)) +} + +var a1: { [a: string]: string }; +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 11)) + +var b1: { [b: string]: string }; +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 11)) + +var a2: { [index: string]: Base }; +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) +>index : Symbol(index, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 11)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 0, 0)) + +var b2: { [index: string]: Derived }; +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) +>index : Symbol(index, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 11)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 2, 1)) + +var a3: { [index: number]: string }; +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) +>index : Symbol(index, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 11)) + +var b3: { [index: number]: string }; +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) +>index : Symbol(index, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 11)) + +var a4: { [index: number]: Base }; +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) +>index : Symbol(index, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 11)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 0, 0)) + +var b4: { [index: string]: Derived }; +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) +>index : Symbol(index, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 11)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 2, 1)) + +// operator < +var r1a1 = a1 < b1; +>r1a1 : Symbol(r1a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 21, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 22, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 23, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 24, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) + +var r1a1 = a2 < b2; +>r1a1 : Symbol(r1a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 21, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 22, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 23, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 24, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) + +var r1a1 = a3 < b3; +>r1a1 : Symbol(r1a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 21, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 22, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 23, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 24, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) + +var r1a1 = a4 < b4; +>r1a1 : Symbol(r1a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 21, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 22, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 23, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 24, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) + +var r1b1 = b1 < a1; +>r1b1 : Symbol(r1b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 26, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 27, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 28, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 29, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) + +var r1b1 = b2 < a2; +>r1b1 : Symbol(r1b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 26, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 27, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 28, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 29, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) + +var r1b1 = b3 < a3; +>r1b1 : Symbol(r1b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 26, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 27, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 28, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 29, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) + +var r1b1 = b4 < a4; +>r1b1 : Symbol(r1b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 26, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 27, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 28, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 29, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) + +// operator > +var r2a1 = a1 > b1; +>r2a1 : Symbol(r2a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 32, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 33, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 34, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 35, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) + +var r2a1 = a2 > b2; +>r2a1 : Symbol(r2a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 32, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 33, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 34, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 35, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) + +var r2a1 = a3 > b3; +>r2a1 : Symbol(r2a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 32, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 33, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 34, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 35, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) + +var r2a1 = a4 > b4; +>r2a1 : Symbol(r2a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 32, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 33, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 34, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 35, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) + +var r2b1 = b1 > a1; +>r2b1 : Symbol(r2b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 37, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 38, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 39, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 40, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) + +var r2b1 = b2 > a2; +>r2b1 : Symbol(r2b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 37, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 38, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 39, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 40, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) + +var r2b1 = b3 > a3; +>r2b1 : Symbol(r2b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 37, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 38, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 39, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 40, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) + +var r2b1 = b4 > a4; +>r2b1 : Symbol(r2b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 37, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 38, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 39, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 40, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) + +// operator <= +var r3a1 = a1 <= b1; +>r3a1 : Symbol(r3a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 43, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 44, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 45, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 46, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) + +var r3a1 = a2 <= b2; +>r3a1 : Symbol(r3a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 43, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 44, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 45, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 46, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) + +var r3a1 = a3 <= b3; +>r3a1 : Symbol(r3a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 43, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 44, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 45, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 46, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) + +var r3a1 = a4 <= b4; +>r3a1 : Symbol(r3a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 43, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 44, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 45, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 46, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) + +var r3b1 = b1 <= a1; +>r3b1 : Symbol(r3b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 48, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 49, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 50, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 51, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) + +var r3b1 = b2 <= a2; +>r3b1 : Symbol(r3b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 48, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 49, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 50, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 51, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) + +var r3b1 = b3 <= a3; +>r3b1 : Symbol(r3b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 48, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 49, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 50, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 51, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) + +var r3b1 = b4 <= a4; +>r3b1 : Symbol(r3b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 48, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 49, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 50, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 51, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) + +// operator >= +var r4a1 = a1 >= b1; +>r4a1 : Symbol(r4a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 54, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 55, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 56, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 57, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) + +var r4a1 = a2 >= b2; +>r4a1 : Symbol(r4a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 54, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 55, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 56, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 57, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) + +var r4a1 = a3 >= b3; +>r4a1 : Symbol(r4a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 54, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 55, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 56, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 57, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) + +var r4a1 = a4 >= b4; +>r4a1 : Symbol(r4a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 54, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 55, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 56, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 57, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) + +var r4b1 = b1 >= a1; +>r4b1 : Symbol(r4b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 59, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 60, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 61, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 62, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) + +var r4b1 = b2 >= a2; +>r4b1 : Symbol(r4b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 59, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 60, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 61, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 62, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) + +var r4b1 = b3 >= a3; +>r4b1 : Symbol(r4b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 59, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 60, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 61, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 62, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) + +var r4b1 = b4 >= a4; +>r4b1 : Symbol(r4b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 59, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 60, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 61, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 62, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) + +// operator == +var r5a1 = a1 == b1; +>r5a1 : Symbol(r5a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 65, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 66, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 67, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 68, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) + +var r5a1 = a2 == b2; +>r5a1 : Symbol(r5a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 65, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 66, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 67, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 68, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) + +var r5a1 = a3 == b3; +>r5a1 : Symbol(r5a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 65, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 66, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 67, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 68, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) + +var r5a1 = a4 == b4; +>r5a1 : Symbol(r5a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 65, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 66, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 67, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 68, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) + +var r5b1 = b1 == a1; +>r5b1 : Symbol(r5b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 70, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 71, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 72, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 73, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) + +var r5b1 = b2 == a2; +>r5b1 : Symbol(r5b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 70, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 71, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 72, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 73, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) + +var r5b1 = b3 == a3; +>r5b1 : Symbol(r5b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 70, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 71, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 72, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 73, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) + +var r5b1 = b4 == a4; +>r5b1 : Symbol(r5b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 70, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 71, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 72, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 73, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) + +// operator != +var r6a1 = a1 != b1; +>r6a1 : Symbol(r6a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 76, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 77, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 78, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 79, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) + +var r6a1 = a2 != b2; +>r6a1 : Symbol(r6a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 76, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 77, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 78, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 79, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) + +var r6a1 = a3 != b3; +>r6a1 : Symbol(r6a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 76, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 77, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 78, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 79, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) + +var r6a1 = a4 != b4; +>r6a1 : Symbol(r6a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 76, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 77, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 78, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 79, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) + +var r6b1 = b1 != a1; +>r6b1 : Symbol(r6b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 81, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 82, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 83, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 84, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) + +var r6b1 = b2 != a2; +>r6b1 : Symbol(r6b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 81, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 82, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 83, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 84, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) + +var r6b1 = b3 != a3; +>r6b1 : Symbol(r6b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 81, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 82, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 83, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 84, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) + +var r6b1 = b4 != a4; +>r6b1 : Symbol(r6b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 81, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 82, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 83, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 84, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) + +// operator === +var r7a1 = a1 === b1; +>r7a1 : Symbol(r7a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 87, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 88, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 89, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 90, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) + +var r7a1 = a2 === b2; +>r7a1 : Symbol(r7a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 87, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 88, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 89, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 90, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) + +var r7a1 = a3 === b3; +>r7a1 : Symbol(r7a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 87, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 88, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 89, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 90, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) + +var r7a1 = a4 === b4; +>r7a1 : Symbol(r7a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 87, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 88, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 89, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 90, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) + +var r7b1 = b1 === a1; +>r7b1 : Symbol(r7b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 92, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 93, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 94, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 95, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) + +var r7b1 = b2 === a2; +>r7b1 : Symbol(r7b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 92, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 93, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 94, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 95, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) + +var r7b1 = b3 === a3; +>r7b1 : Symbol(r7b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 92, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 93, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 94, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 95, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) + +var r7b1 = b4 === a4; +>r7b1 : Symbol(r7b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 92, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 93, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 94, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 95, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) + +// operator !== +var r8a1 = a1 !== b1; +>r8a1 : Symbol(r8a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 98, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 99, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 100, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 101, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) + +var r8a1 = a2 !== b2; +>r8a1 : Symbol(r8a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 98, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 99, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 100, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 101, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) + +var r8a1 = a3 !== b3; +>r8a1 : Symbol(r8a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 98, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 99, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 100, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 101, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) + +var r8a1 = a4 !== b4; +>r8a1 : Symbol(r8a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 98, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 99, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 100, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 101, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) + +var r8b1 = b1 !== a1; +>r8b1 : Symbol(r8b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 103, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 104, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 105, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 106, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) + +var r8b1 = b2 !== a2; +>r8b1 : Symbol(r8b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 103, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 104, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 105, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 106, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) + +var r8b1 = b3 !== a3; +>r8b1 : Symbol(r8b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 103, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 104, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 105, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 106, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) + +var r8b1 = b4 !== a4; +>r8b1 : Symbol(r8b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 103, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 104, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 105, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 106, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) + diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.symbols b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.symbols new file mode 100644 index 00000000000..635f926438f --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.symbols @@ -0,0 +1,631 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts === +class Base { +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 0, 0)) + + public a: string; +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 0, 12)) +} + +class Derived extends Base { +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 2, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 0, 0)) + + public b: string; +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 4, 28)) +} + +var a1: { fn(x: T): T }; +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 9)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 13)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 16)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 13)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 13)) + +var b1: { fn(x: string): string }; +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 9)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 13)) + +var a2: { fn(x: T): T }; +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 9)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 13)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 16)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 13)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 13)) + +var b2: { fn(x: string, y: number): string }; +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 9)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 13)) +>y : Symbol(y, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 23)) + +var a3: { fn(x: T, y: U): T }; +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 9)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 13)) +>U : Symbol(U, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 15)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 19)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 13)) +>y : Symbol(y, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 24)) +>U : Symbol(U, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 15)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 13)) + +var b3: { fn(x: string, y: number): string }; +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 9)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 13)) +>y : Symbol(y, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 23)) + +var a4: { fn(x?: T): T }; +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 9)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 13)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 16)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 13)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 13)) + +var b4: { fn(x?: string): string }; +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 9)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 13)) + +var a5: { fn(...x: T[]): T }; +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 9)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 13)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 16)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 13)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 13)) + +var b5: { fn(...x: string[]): string }; +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 9)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 13)) + +var a6: { fn(x: T, y: T): T }; +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 9)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 13)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 16)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 13)) +>y : Symbol(y, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 21)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 13)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 13)) + +var b6: { fn(x: string, y: number): {} }; +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 9)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 13)) +>y : Symbol(y, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 23)) + +//var a7: { fn(x: T, y: U): T }; +var b7: { fn(x: Base, y: Derived): Base }; +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 27, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 27, 9)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 27, 13)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 0, 0)) +>y : Symbol(y, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 27, 21)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 2, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 0, 0)) + +// operator < +var r1a1 = a1 < b1; +>r1a1 : Symbol(r1a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 30, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) + +var r1a2 = a2 < b2; +>r1a2 : Symbol(r1a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 31, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) + +var r1a3 = a3 < b3; +>r1a3 : Symbol(r1a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 32, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) + +var r1a4 = a4 < b4; +>r1a4 : Symbol(r1a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 33, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) + +var r1a5 = a5 < b5; +>r1a5 : Symbol(r1a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 34, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) + +var r1a6 = a6 < b6; +>r1a6 : Symbol(r1a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 35, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) + +//var r1a7 = a7 < b7; + +var r1b1 = b1 < a1; +>r1b1 : Symbol(r1b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 38, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) + +var r1b2 = b2 < a2; +>r1b2 : Symbol(r1b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 39, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) + +var r1b3 = b3 < a3; +>r1b3 : Symbol(r1b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 40, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) + +var r1b4 = b4 < a4; +>r1b4 : Symbol(r1b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 41, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) + +var r1b5 = b5 < a5; +>r1b5 : Symbol(r1b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 42, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) + +var r1b6 = b6 < a6; +>r1b6 : Symbol(r1b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 43, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) + +//var r1b7 = b7 < a7; + +// operator > +var r2a1 = a1 > b1; +>r2a1 : Symbol(r2a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 47, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) + +var r2a2 = a2 > b2; +>r2a2 : Symbol(r2a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 48, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) + +var r2a3 = a3 > b3; +>r2a3 : Symbol(r2a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 49, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) + +var r2a4 = a4 > b4; +>r2a4 : Symbol(r2a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 50, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) + +var r2a5 = a5 > b5; +>r2a5 : Symbol(r2a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 51, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) + +var r2a6 = a6 > b6; +>r2a6 : Symbol(r2a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 52, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) + +//var r2a7 = a7 > b7; + +var r2b1 = b1 > a1; +>r2b1 : Symbol(r2b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 55, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) + +var r2b2 = b2 > a2; +>r2b2 : Symbol(r2b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 56, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) + +var r2b3 = b3 > a3; +>r2b3 : Symbol(r2b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 57, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) + +var r2b4 = b4 > a4; +>r2b4 : Symbol(r2b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 58, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) + +var r2b5 = b5 > a5; +>r2b5 : Symbol(r2b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 59, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) + +var r2b6 = b6 > a6; +>r2b6 : Symbol(r2b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 60, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) + +//var r2b7 = b7 > a7; + +// operator <= +var r3a1 = a1 <= b1; +>r3a1 : Symbol(r3a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 64, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) + +var r3a2 = a2 <= b2; +>r3a2 : Symbol(r3a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 65, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) + +var r3a3 = a3 <= b3; +>r3a3 : Symbol(r3a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 66, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) + +var r3a4 = a4 <= b4; +>r3a4 : Symbol(r3a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 67, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) + +var r3a5 = a5 <= b5; +>r3a5 : Symbol(r3a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 68, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) + +var r3a6 = a6 <= b6; +>r3a6 : Symbol(r3a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 69, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) + +//var r3a7 = a7 <= b7; + +var r3b1 = b1 <= a1; +>r3b1 : Symbol(r3b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 72, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) + +var r3b2 = b2 <= a2; +>r3b2 : Symbol(r3b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 73, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) + +var r3b3 = b3 <= a3; +>r3b3 : Symbol(r3b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 74, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) + +var r3b4 = b4 <= a4; +>r3b4 : Symbol(r3b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 75, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) + +var r3b5 = b5 <= a5; +>r3b5 : Symbol(r3b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 76, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) + +var r3b6 = b6 <= a6; +>r3b6 : Symbol(r3b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 77, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) + +//var r3b7 = b7 <= a7; + +// operator >= +var r4a1 = a1 >= b1; +>r4a1 : Symbol(r4a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 81, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) + +var r4a2 = a2 >= b2; +>r4a2 : Symbol(r4a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 82, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) + +var r4a3 = a3 >= b3; +>r4a3 : Symbol(r4a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 83, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) + +var r4a4 = a4 >= b4; +>r4a4 : Symbol(r4a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 84, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) + +var r4a5 = a5 >= b5; +>r4a5 : Symbol(r4a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 85, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) + +var r4a6 = a6 >= b6; +>r4a6 : Symbol(r4a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 86, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) + +//var r4a7 = a7 >= b7; + +var r4b1 = b1 >= a1; +>r4b1 : Symbol(r4b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 89, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) + +var r4b2 = b2 >= a2; +>r4b2 : Symbol(r4b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 90, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) + +var r4b3 = b3 >= a3; +>r4b3 : Symbol(r4b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 91, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) + +var r4b4 = b4 >= a4; +>r4b4 : Symbol(r4b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 92, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) + +var r4b5 = b5 >= a5; +>r4b5 : Symbol(r4b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 93, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) + +var r4b6 = b6 >= a6; +>r4b6 : Symbol(r4b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 94, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) + +//var r4b7 = b7 >= a7; + +// operator == +var r5a1 = a1 == b1; +>r5a1 : Symbol(r5a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 98, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) + +var r5a2 = a2 == b2; +>r5a2 : Symbol(r5a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 99, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) + +var r5a3 = a3 == b3; +>r5a3 : Symbol(r5a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 100, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) + +var r5a4 = a4 == b4; +>r5a4 : Symbol(r5a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 101, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) + +var r5a5 = a5 == b5; +>r5a5 : Symbol(r5a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 102, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) + +var r5a6 = a6 == b6; +>r5a6 : Symbol(r5a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 103, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) + +//var r5a7 = a7 == b7; + +var r5b1 = b1 == a1; +>r5b1 : Symbol(r5b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 106, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) + +var r5b2 = b2 == a2; +>r5b2 : Symbol(r5b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 107, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) + +var r5b3 = b3 == a3; +>r5b3 : Symbol(r5b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 108, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) + +var r5b4 = b4 == a4; +>r5b4 : Symbol(r5b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 109, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) + +var r5b5 = b5 == a5; +>r5b5 : Symbol(r5b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 110, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) + +var r5b6 = b6 == a6; +>r5b6 : Symbol(r5b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 111, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) + +//var r5b7 = b7 == a7; + +// operator != +var r6a1 = a1 != b1; +>r6a1 : Symbol(r6a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 115, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) + +var r6a2 = a2 != b2; +>r6a2 : Symbol(r6a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 116, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) + +var r6a3 = a3 != b3; +>r6a3 : Symbol(r6a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 117, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) + +var r6a4 = a4 != b4; +>r6a4 : Symbol(r6a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 118, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) + +var r6a5 = a5 != b5; +>r6a5 : Symbol(r6a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 119, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) + +var r6a6 = a6 != b6; +>r6a6 : Symbol(r6a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 120, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) + +//var r6a7 = a7 != b7; + +var r6b1 = b1 != a1; +>r6b1 : Symbol(r6b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 123, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) + +var r6b2 = b2 != a2; +>r6b2 : Symbol(r6b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 124, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) + +var r6b3 = b3 != a3; +>r6b3 : Symbol(r6b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 125, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) + +var r6b4 = b4 != a4; +>r6b4 : Symbol(r6b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 126, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) + +var r6b5 = b5 != a5; +>r6b5 : Symbol(r6b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 127, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) + +var r6b6 = b6 != a6; +>r6b6 : Symbol(r6b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 128, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) + +//var r6b7 = b7 != a7; + +// operator === +var r7a1 = a1 === b1; +>r7a1 : Symbol(r7a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 132, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) + +var r7a2 = a2 === b2; +>r7a2 : Symbol(r7a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 133, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) + +var r7a3 = a3 === b3; +>r7a3 : Symbol(r7a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 134, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) + +var r7a4 = a4 === b4; +>r7a4 : Symbol(r7a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 135, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) + +var r7a5 = a5 === b5; +>r7a5 : Symbol(r7a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 136, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) + +var r7a6 = a6 === b6; +>r7a6 : Symbol(r7a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 137, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) + +//var r7a7 = a7 === b7; + +var r7b1 = b1 === a1; +>r7b1 : Symbol(r7b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 140, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) + +var r7b2 = b2 === a2; +>r7b2 : Symbol(r7b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 141, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) + +var r7b3 = b3 === a3; +>r7b3 : Symbol(r7b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 142, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) + +var r7b4 = b4 === a4; +>r7b4 : Symbol(r7b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 143, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) + +var r7b5 = b5 === a5; +>r7b5 : Symbol(r7b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 144, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) + +var r7b6 = b6 === a6; +>r7b6 : Symbol(r7b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 145, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) + +//var r7b7 = b7 === a7; + +// operator !== +var r8a1 = a1 !== b1; +>r8a1 : Symbol(r8a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 149, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) + +var r8a2 = a2 !== b2; +>r8a2 : Symbol(r8a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 150, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) + +var r8a3 = a3 !== b3; +>r8a3 : Symbol(r8a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 151, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) + +var r8a4 = a4 !== b4; +>r8a4 : Symbol(r8a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 152, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) + +var r8a5 = a5 !== b5; +>r8a5 : Symbol(r8a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 153, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) + +var r8a6 = a6 !== b6; +>r8a6 : Symbol(r8a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 154, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) + +//var r8a7 = a7 !== b7; + +var r8b1 = b1 !== a1; +>r8b1 : Symbol(r8b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 157, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) + +var r8b2 = b2 !== a2; +>r8b2 : Symbol(r8b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 158, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) + +var r8b3 = b3 !== a3; +>r8b3 : Symbol(r8b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 159, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) + +var r8b4 = b4 !== a4; +>r8b4 : Symbol(r8b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 160, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) + +var r8b5 = b5 !== a5; +>r8b5 : Symbol(r8b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 161, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) + +var r8b6 = b6 !== a6; +>r8b6 : Symbol(r8b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 162, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) + +//var r8b7 = b7 !== a7; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.symbols b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.symbols new file mode 100644 index 00000000000..11f28765873 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.symbols @@ -0,0 +1,618 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts === +class Base { +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 0, 0)) + + public a: string; +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 0, 12)) +} + +class Derived extends Base { +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 2, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 0, 0)) + + public b: string; +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 4, 28)) +} + +var a1: { new (x: T): T }; +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 15)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 18)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 15)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 15)) + +var b1: { new (x: string): string }; +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 15)) + +var a2: { new (x: T): T }; +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 15)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 18)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 15)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 15)) + +var b2: { new (x: string, y: number): string }; +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 15)) +>y : Symbol(y, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 25)) + +var a3: { new (x: T, y: U): T }; +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 15)) +>U : Symbol(U, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 17)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 21)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 15)) +>y : Symbol(y, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 26)) +>U : Symbol(U, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 17)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 15)) + +var b3: { new (x: string, y: number): string }; +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 15)) +>y : Symbol(y, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 25)) + +var a4: { new (x?: T): T }; +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 15)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 18)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 15)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 15)) + +var b4: { new (x?: string): string }; +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 15)) + +var a5: { new (...x: T[]): T }; +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 15)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 18)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 15)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 15)) + +var b5: { new (...x: string[]): string }; +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 15)) + +var a6: { new (x: T, y: T): T }; +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 15)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 18)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 15)) +>y : Symbol(y, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 23)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 15)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 15)) + +var b6: { new (x: string, y: number): {} }; +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 15)) +>y : Symbol(y, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 25)) + +//var a7: { new (x: T, y: U): T }; +var b7: { new (x: Base, y: Derived): Base }; +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 27, 15)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 0, 0)) +>y : Symbol(y, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 27, 23)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 2, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 0, 0)) + +// operator < +var r1a1 = a1 < b1; +>r1a1 : Symbol(r1a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 30, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) + +var r1a2 = a2 < b2; +>r1a2 : Symbol(r1a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 31, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) + +var r1a3 = a3 < b3; +>r1a3 : Symbol(r1a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 32, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) + +var r1a4 = a4 < b4; +>r1a4 : Symbol(r1a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 33, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) + +var r1a5 = a5 < b5; +>r1a5 : Symbol(r1a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 34, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) + +var r1a6 = a6 < b6; +>r1a6 : Symbol(r1a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 35, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) + +//var r1a7 = a7 < b7; + +var r1b1 = b1 < a1; +>r1b1 : Symbol(r1b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 38, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) + +var r1b2 = b2 < a2; +>r1b2 : Symbol(r1b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 39, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) + +var r1b3 = b3 < a3; +>r1b3 : Symbol(r1b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 40, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) + +var r1b4 = b4 < a4; +>r1b4 : Symbol(r1b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 41, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) + +var r1b5 = b5 < a5; +>r1b5 : Symbol(r1b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 42, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) + +var r1b6 = b6 < a6; +>r1b6 : Symbol(r1b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 43, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) + +//var r1b7 = b7 < a7; + +// operator > +var r2a1 = a1 > b1; +>r2a1 : Symbol(r2a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 47, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) + +var r2a2 = a2 > b2; +>r2a2 : Symbol(r2a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 48, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) + +var r2a3 = a3 > b3; +>r2a3 : Symbol(r2a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 49, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) + +var r2a4 = a4 > b4; +>r2a4 : Symbol(r2a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 50, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) + +var r2a5 = a5 > b5; +>r2a5 : Symbol(r2a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 51, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) + +var r2a6 = a6 > b6; +>r2a6 : Symbol(r2a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 52, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) + +//var r2a7 = a7 > b7; + +var r2b1 = b1 > a1; +>r2b1 : Symbol(r2b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 55, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) + +var r2b2 = b2 > a2; +>r2b2 : Symbol(r2b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 56, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) + +var r2b3 = b3 > a3; +>r2b3 : Symbol(r2b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 57, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) + +var r2b4 = b4 > a4; +>r2b4 : Symbol(r2b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 58, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) + +var r2b5 = b5 > a5; +>r2b5 : Symbol(r2b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 59, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) + +var r2b6 = b6 > a6; +>r2b6 : Symbol(r2b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 60, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) + +//var r2b7 = b7 > a7; + +// operator <= +var r3a1 = a1 <= b1; +>r3a1 : Symbol(r3a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 64, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) + +var r3a2 = a2 <= b2; +>r3a2 : Symbol(r3a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 65, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) + +var r3a3 = a3 <= b3; +>r3a3 : Symbol(r3a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 66, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) + +var r3a4 = a4 <= b4; +>r3a4 : Symbol(r3a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 67, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) + +var r3a5 = a5 <= b5; +>r3a5 : Symbol(r3a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 68, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) + +var r3a6 = a6 <= b6; +>r3a6 : Symbol(r3a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 69, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) + +//var r3a7 = a7 <= b7; + +var r3b1 = b1 <= a1; +>r3b1 : Symbol(r3b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 72, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) + +var r3b2 = b2 <= a2; +>r3b2 : Symbol(r3b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 73, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) + +var r3b3 = b3 <= a3; +>r3b3 : Symbol(r3b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 74, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) + +var r3b4 = b4 <= a4; +>r3b4 : Symbol(r3b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 75, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) + +var r3b5 = b5 <= a5; +>r3b5 : Symbol(r3b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 76, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) + +var r3b6 = b6 <= a6; +>r3b6 : Symbol(r3b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 77, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) + +//var r3b7 = b7 <= a7; + +// operator >= +var r4a1 = a1 >= b1; +>r4a1 : Symbol(r4a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 81, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) + +var r4a2 = a2 >= b2; +>r4a2 : Symbol(r4a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 82, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) + +var r4a3 = a3 >= b3; +>r4a3 : Symbol(r4a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 83, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) + +var r4a4 = a4 >= b4; +>r4a4 : Symbol(r4a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 84, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) + +var r4a5 = a5 >= b5; +>r4a5 : Symbol(r4a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 85, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) + +var r4a6 = a6 >= b6; +>r4a6 : Symbol(r4a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 86, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) + +//var r4a7 = a7 >= b7; + +var r4b1 = b1 >= a1; +>r4b1 : Symbol(r4b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 89, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) + +var r4b2 = b2 >= a2; +>r4b2 : Symbol(r4b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 90, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) + +var r4b3 = b3 >= a3; +>r4b3 : Symbol(r4b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 91, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) + +var r4b4 = b4 >= a4; +>r4b4 : Symbol(r4b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 92, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) + +var r4b5 = b5 >= a5; +>r4b5 : Symbol(r4b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 93, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) + +var r4b6 = b6 >= a6; +>r4b6 : Symbol(r4b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 94, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) + +//var r4b7 = b7 >= a7; + +// operator == +var r5a1 = a1 == b1; +>r5a1 : Symbol(r5a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 98, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) + +var r5a2 = a2 == b2; +>r5a2 : Symbol(r5a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 99, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) + +var r5a3 = a3 == b3; +>r5a3 : Symbol(r5a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 100, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) + +var r5a4 = a4 == b4; +>r5a4 : Symbol(r5a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 101, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) + +var r5a5 = a5 == b5; +>r5a5 : Symbol(r5a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 102, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) + +var r5a6 = a6 == b6; +>r5a6 : Symbol(r5a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 103, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) + +//var r5a7 = a7 == b7; + +var r5b1 = b1 == a1; +>r5b1 : Symbol(r5b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 106, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) + +var r5b2 = b2 == a2; +>r5b2 : Symbol(r5b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 107, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) + +var r5b3 = b3 == a3; +>r5b3 : Symbol(r5b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 108, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) + +var r5b4 = b4 == a4; +>r5b4 : Symbol(r5b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 109, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) + +var r5b5 = b5 == a5; +>r5b5 : Symbol(r5b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 110, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) + +var r5b6 = b6 == a6; +>r5b6 : Symbol(r5b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 111, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) + +//var r5b7 = b7 == a7; + +// operator != +var r6a1 = a1 != b1; +>r6a1 : Symbol(r6a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 115, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) + +var r6a2 = a2 != b2; +>r6a2 : Symbol(r6a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 116, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) + +var r6a3 = a3 != b3; +>r6a3 : Symbol(r6a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 117, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) + +var r6a4 = a4 != b4; +>r6a4 : Symbol(r6a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 118, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) + +var r6a5 = a5 != b5; +>r6a5 : Symbol(r6a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 119, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) + +var r6a6 = a6 != b6; +>r6a6 : Symbol(r6a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 120, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) + +//var r6a7 = a7 != b7; + +var r6b1 = b1 != a1; +>r6b1 : Symbol(r6b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 123, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) + +var r6b2 = b2 != a2; +>r6b2 : Symbol(r6b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 124, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) + +var r6b3 = b3 != a3; +>r6b3 : Symbol(r6b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 125, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) + +var r6b4 = b4 != a4; +>r6b4 : Symbol(r6b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 126, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) + +var r6b5 = b5 != a5; +>r6b5 : Symbol(r6b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 127, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) + +var r6b6 = b6 != a6; +>r6b6 : Symbol(r6b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 128, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) + +//var r6b7 = b7 != a7; + +// operator === +var r7a1 = a1 === b1; +>r7a1 : Symbol(r7a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 132, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) + +var r7a2 = a2 === b2; +>r7a2 : Symbol(r7a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 133, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) + +var r7a3 = a3 === b3; +>r7a3 : Symbol(r7a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 134, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) + +var r7a4 = a4 === b4; +>r7a4 : Symbol(r7a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 135, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) + +var r7a5 = a5 === b5; +>r7a5 : Symbol(r7a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 136, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) + +var r7a6 = a6 === b6; +>r7a6 : Symbol(r7a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 137, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) + +//var r7a7 = a7 === b7; + +var r7b1 = b1 === a1; +>r7b1 : Symbol(r7b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 140, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) + +var r7b2 = b2 === a2; +>r7b2 : Symbol(r7b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 141, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) + +var r7b3 = b3 === a3; +>r7b3 : Symbol(r7b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 142, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) + +var r7b4 = b4 === a4; +>r7b4 : Symbol(r7b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 143, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) + +var r7b5 = b5 === a5; +>r7b5 : Symbol(r7b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 144, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) + +var r7b6 = b6 === a6; +>r7b6 : Symbol(r7b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 145, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) + +//var r7b7 = b7 === a7; + +// operator !== +var r8a1 = a1 !== b1; +>r8a1 : Symbol(r8a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 149, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) + +var r8a2 = a2 !== b2; +>r8a2 : Symbol(r8a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 150, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) + +var r8a3 = a3 !== b3; +>r8a3 : Symbol(r8a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 151, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) + +var r8a4 = a4 !== b4; +>r8a4 : Symbol(r8a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 152, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) + +var r8a5 = a5 !== b5; +>r8a5 : Symbol(r8a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 153, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) + +var r8a6 = a6 !== b6; +>r8a6 : Symbol(r8a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 154, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) + +//var r8a7 = a7 !== b7; + +var r8b1 = b1 !== a1; +>r8b1 : Symbol(r8b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 157, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) + +var r8b2 = b2 !== a2; +>r8b2 : Symbol(r8b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 158, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) + +var r8b3 = b3 !== a3; +>r8b3 : Symbol(r8b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 159, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) + +var r8b4 = b4 !== a4; +>r8b4 : Symbol(r8b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 160, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) + +var r8b5 = b5 !== a5; +>r8b5 : Symbol(r8b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 161, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) + +var r8b6 = b6 !== a6; +>r8b6 : Symbol(r8b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 162, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) + +//var r8b7 = b7 !== a7; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnOptionalProperty.symbols b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnOptionalProperty.symbols new file mode 100644 index 00000000000..6c6a3fa3ae2 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnOptionalProperty.symbols @@ -0,0 +1,114 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts === +interface I { +>I : Symbol(I, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 0, 0)) + + a: string; +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 0, 13)) + + b?: number; +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 1, 14)) +} + +interface J { +>J : Symbol(J, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 3, 1)) + + a: string; +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 5, 13)) +} + +var a: I; +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) +>I : Symbol(I, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 0, 0)) + +var b: J; +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) +>J : Symbol(J, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 3, 1)) + +// operator < +var ra1 = a < b; +>ra1 : Symbol(ra1, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 13, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) + +var ra2 = b < a; +>ra2 : Symbol(ra2, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 14, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) + +// operator > +var rb1 = a > b; +>rb1 : Symbol(rb1, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 17, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) + +var rb2 = b > a; +>rb2 : Symbol(rb2, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 18, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) + +// operator <= +var rc1 = a <= b; +>rc1 : Symbol(rc1, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 21, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) + +var rc2 = b <= a; +>rc2 : Symbol(rc2, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 22, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) + +// operator >= +var rd1 = a >= b; +>rd1 : Symbol(rd1, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 25, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) + +var rd2 = b >= a; +>rd2 : Symbol(rd2, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 26, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) + +// operator == +var re1 = a == b; +>re1 : Symbol(re1, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 29, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) + +var re2 = b == a; +>re2 : Symbol(re2, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 30, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) + +// operator != +var rf1 = a != b; +>rf1 : Symbol(rf1, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 33, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) + +var rf2 = b != a; +>rf2 : Symbol(rf2, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 34, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) + +// operator === +var rg1 = a === b; +>rg1 : Symbol(rg1, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 37, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) + +var rg2 = b === a; +>rg2 : Symbol(rg2, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 38, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) + +// operator !== +var rh1 = a !== b; +>rh1 : Symbol(rh1, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 41, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) + +var rh2 = b !== a; +>rh2 : Symbol(rh2, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 42, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) + diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.symbols b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.symbols new file mode 100644 index 00000000000..52d6e35d65e --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.symbols @@ -0,0 +1,239 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithSubtypeObjectOnProperty.ts === +class Base { +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 0, 0)) + + public a: string; +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 0, 12)) +} + +class Derived extends Base { +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 2, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 0, 0)) + + public b: string; +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 4, 28)) +} + +class A1 { +>A1 : Symbol(A1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 6, 1)) + + public a: Base; +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 8, 10)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 0, 0)) + + public b: Base; +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 9, 19)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 0, 0)) +} + +class B1 { +>B1 : Symbol(B1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 11, 1)) + + public a: Base; +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 13, 10)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 0, 0)) + + public b: Derived; +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 14, 19)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 2, 1)) +} + +class A2 { +>A2 : Symbol(A2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 16, 1)) + + private a; +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 18, 10)) +} + +class B2 extends A2 { +>B2 : Symbol(B2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 20, 1)) +>A2 : Symbol(A2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 16, 1)) + + private b; +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 22, 21)) +} + +var a1: A1; +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) +>A1 : Symbol(A1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 6, 1)) + +var a2: A2; +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) +>A2 : Symbol(A2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 16, 1)) + +var b1: B1; +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) +>B1 : Symbol(B1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 11, 1)) + +var b2: B2; +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) +>B2 : Symbol(B2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 20, 1)) + +// operator < +var ra1 = a1 < b1; +>ra1 : Symbol(ra1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 32, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) + +var ra2 = a2 < b2; +>ra2 : Symbol(ra2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 33, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) + +var ra3 = b1 < a1; +>ra3 : Symbol(ra3, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 34, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) + +var ra4 = b2 < a2; +>ra4 : Symbol(ra4, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 35, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) + +// operator > +var rb1 = a1 > b1; +>rb1 : Symbol(rb1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 38, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) + +var rb2 = a2 > b2; +>rb2 : Symbol(rb2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 39, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) + +var rb3 = b1 > a1; +>rb3 : Symbol(rb3, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 40, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) + +var rb4 = b2 > a2; +>rb4 : Symbol(rb4, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 41, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) + +// operator <= +var rc1 = a1 <= b1; +>rc1 : Symbol(rc1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 44, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) + +var rc2 = a2 <= b2; +>rc2 : Symbol(rc2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 45, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) + +var rc3 = b1 <= a1; +>rc3 : Symbol(rc3, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 46, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) + +var rc4 = b2 <= a2; +>rc4 : Symbol(rc4, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 47, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) + +// operator >= +var rd1 = a1 >= b1; +>rd1 : Symbol(rd1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 50, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) + +var rd2 = a2 >= b2; +>rd2 : Symbol(rd2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 51, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) + +var rd3 = b1 >= a1; +>rd3 : Symbol(rd3, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 52, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) + +var rd4 = b2 >= a2; +>rd4 : Symbol(rd4, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 53, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) + +// operator == +var re1 = a1 == b1; +>re1 : Symbol(re1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 56, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) + +var re2 = a2 == b2; +>re2 : Symbol(re2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 57, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) + +var re3 = b1 == a1; +>re3 : Symbol(re3, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 58, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) + +var re4 = b2 == a2; +>re4 : Symbol(re4, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 59, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) + +// operator != +var rf1 = a1 != b1; +>rf1 : Symbol(rf1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 62, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) + +var rf2 = a2 != b2; +>rf2 : Symbol(rf2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 63, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) + +var rf3 = b1 != a1; +>rf3 : Symbol(rf3, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 64, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) + +var rf4 = b2 != a2; +>rf4 : Symbol(rf4, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 65, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) + +// operator === +var rg1 = a1 === b1; +>rg1 : Symbol(rg1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 68, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) + +var rg2 = a2 === b2; +>rg2 : Symbol(rg2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 69, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) + +var rg3 = b1 === a1; +>rg3 : Symbol(rg3, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 70, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) + +var rg4 = b2 === a2; +>rg4 : Symbol(rg4, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 71, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) + +// operator !== +var rh1 = a1 !== b1; +>rh1 : Symbol(rh1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 74, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) + +var rh2 = a2 !== b2; +>rh2 : Symbol(rh2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 75, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) + +var rh3 = b1 !== a1; +>rh3 : Symbol(rh3, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 76, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) + +var rh4 = b2 !== a2; +>rh4 : Symbol(rh4, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 77, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) + diff --git a/tests/baselines/reference/comparisonOperatorWithTwoOperandsAreAny.symbols b/tests/baselines/reference/comparisonOperatorWithTwoOperandsAreAny.symbols new file mode 100644 index 00000000000..9d6c0a9ca03 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithTwoOperandsAreAny.symbols @@ -0,0 +1,44 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTwoOperandsAreAny.ts === +var a: any; +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) + +var r1 = a < a; +>r1 : Symbol(r1, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 2, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) + +var r2 = a > a; +>r2 : Symbol(r2, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 3, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) + +var r3 = a <= a; +>r3 : Symbol(r3, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 4, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) + +var r4 = a >= a; +>r4 : Symbol(r4, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 5, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) + +var r5 = a == a; +>r5 : Symbol(r5, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 6, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) + +var r6 = a != a; +>r6 : Symbol(r6, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 7, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) + +var r7 = a === a; +>r7 : Symbol(r7, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 8, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) + +var r8 = a !== a; +>r8 : Symbol(r8, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 9, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) + diff --git a/tests/baselines/reference/complexClassRelationships.symbols b/tests/baselines/reference/complexClassRelationships.symbols new file mode 100644 index 00000000000..533c5171cf8 --- /dev/null +++ b/tests/baselines/reference/complexClassRelationships.symbols @@ -0,0 +1,117 @@ +=== tests/cases/compiler/complexClassRelationships.ts === +// There should be no errors in this file +class Derived extends Base { +>Derived : Symbol(Derived, Decl(complexClassRelationships.ts, 0, 0)) +>Base : Symbol(Base, Decl(complexClassRelationships.ts, 11, 1)) + + public static createEmpty(): Derived { +>createEmpty : Symbol(Derived.createEmpty, Decl(complexClassRelationships.ts, 1, 28)) +>Derived : Symbol(Derived, Decl(complexClassRelationships.ts, 0, 0)) + + var item = new Derived(); +>item : Symbol(item, Decl(complexClassRelationships.ts, 3, 11)) +>Derived : Symbol(Derived, Decl(complexClassRelationships.ts, 0, 0)) + + return item; +>item : Symbol(item, Decl(complexClassRelationships.ts, 3, 11)) + } +} +class BaseCollection { +>BaseCollection : Symbol(BaseCollection, Decl(complexClassRelationships.ts, 6, 1)) +>T : Symbol(T, Decl(complexClassRelationships.ts, 7, 21)) +>Base : Symbol(Base, Decl(complexClassRelationships.ts, 11, 1)) + + constructor(f: () => T) { +>f : Symbol(f, Decl(complexClassRelationships.ts, 8, 16)) +>T : Symbol(T, Decl(complexClassRelationships.ts, 7, 21)) + + (item: Thing) => { return [item.Components]; }; +>item : Symbol(item, Decl(complexClassRelationships.ts, 9, 9)) +>Thing : Symbol(Thing, Decl(complexClassRelationships.ts, 14, 1)) +>item.Components : Symbol(Thing.Components, Decl(complexClassRelationships.ts, 16, 13)) +>item : Symbol(item, Decl(complexClassRelationships.ts, 9, 9)) +>Components : Symbol(Thing.Components, Decl(complexClassRelationships.ts, 16, 13)) + } +} +class Base { +>Base : Symbol(Base, Decl(complexClassRelationships.ts, 11, 1)) + + ownerCollection: BaseCollection; +>ownerCollection : Symbol(ownerCollection, Decl(complexClassRelationships.ts, 12, 12)) +>BaseCollection : Symbol(BaseCollection, Decl(complexClassRelationships.ts, 6, 1)) +>Base : Symbol(Base, Decl(complexClassRelationships.ts, 11, 1)) +} + +class Thing { +>Thing : Symbol(Thing, Decl(complexClassRelationships.ts, 14, 1)) + + public get Components(): ComponentCollection { return null } +>Components : Symbol(Components, Decl(complexClassRelationships.ts, 16, 13)) +>ComponentCollection : Symbol(ComponentCollection, Decl(complexClassRelationships.ts, 18, 1)) +} + +class ComponentCollection { +>ComponentCollection : Symbol(ComponentCollection, Decl(complexClassRelationships.ts, 18, 1)) +>T : Symbol(T, Decl(complexClassRelationships.ts, 20, 26)) + + private static sortComponents(p: Foo) { +>sortComponents : Symbol(ComponentCollection.sortComponents, Decl(complexClassRelationships.ts, 20, 30)) +>p : Symbol(p, Decl(complexClassRelationships.ts, 21, 34)) +>Foo : Symbol(Foo, Decl(complexClassRelationships.ts, 24, 1)) + + return p.prop1; +>p.prop1 : Symbol(Foo.prop1, Decl(complexClassRelationships.ts, 26, 11)) +>p : Symbol(p, Decl(complexClassRelationships.ts, 21, 34)) +>prop1 : Symbol(Foo.prop1, Decl(complexClassRelationships.ts, 26, 11)) + } +} + +class Foo { +>Foo : Symbol(Foo, Decl(complexClassRelationships.ts, 24, 1)) + + public get prop1() { +>prop1 : Symbol(prop1, Decl(complexClassRelationships.ts, 26, 11)) + + return new GenericType(this); +>GenericType : Symbol(GenericType, Decl(complexClassRelationships.ts, 36, 1)) +>this : Symbol(Foo, Decl(complexClassRelationships.ts, 24, 1)) + } + public populate() { +>populate : Symbol(populate, Decl(complexClassRelationships.ts, 29, 5)) + + this.prop2; +>this.prop2 : Symbol(prop2, Decl(complexClassRelationships.ts, 32, 5)) +>this : Symbol(Foo, Decl(complexClassRelationships.ts, 24, 1)) +>prop2 : Symbol(prop2, Decl(complexClassRelationships.ts, 32, 5)) + } + public get prop2(): BaseCollection { +>prop2 : Symbol(prop2, Decl(complexClassRelationships.ts, 32, 5)) +>BaseCollection : Symbol(BaseCollection, Decl(complexClassRelationships.ts, 6, 1)) +>Derived : Symbol(Derived, Decl(complexClassRelationships.ts, 0, 0)) + + return new BaseCollection(Derived.createEmpty); +>BaseCollection : Symbol(BaseCollection, Decl(complexClassRelationships.ts, 6, 1)) +>Derived : Symbol(Derived, Decl(complexClassRelationships.ts, 0, 0)) +>Derived.createEmpty : Symbol(Derived.createEmpty, Decl(complexClassRelationships.ts, 1, 28)) +>Derived : Symbol(Derived, Decl(complexClassRelationships.ts, 0, 0)) +>createEmpty : Symbol(Derived.createEmpty, Decl(complexClassRelationships.ts, 1, 28)) + } +} + +class GenericType { +>GenericType : Symbol(GenericType, Decl(complexClassRelationships.ts, 36, 1)) +>T : Symbol(T, Decl(complexClassRelationships.ts, 38, 18)) + + constructor(parent: FooBase) { } +>parent : Symbol(parent, Decl(complexClassRelationships.ts, 39, 16)) +>FooBase : Symbol(FooBase, Decl(complexClassRelationships.ts, 40, 1)) +} + +class FooBase { +>FooBase : Symbol(FooBase, Decl(complexClassRelationships.ts, 40, 1)) + + public populate() { +>populate : Symbol(populate, Decl(complexClassRelationships.ts, 42, 15)) + + } +} diff --git a/tests/baselines/reference/complexClassRelationships.types b/tests/baselines/reference/complexClassRelationships.types index 69bee9caade..43d0232e30a 100644 --- a/tests/baselines/reference/complexClassRelationships.types +++ b/tests/baselines/reference/complexClassRelationships.types @@ -51,6 +51,7 @@ class Thing { public get Components(): ComponentCollection { return null } >Components : ComponentCollection >ComponentCollection : ComponentCollection +>null : null } class ComponentCollection { diff --git a/tests/baselines/reference/compositeGenericFunction.symbols b/tests/baselines/reference/compositeGenericFunction.symbols new file mode 100644 index 00000000000..520f1eaf4ca --- /dev/null +++ b/tests/baselines/reference/compositeGenericFunction.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/compositeGenericFunction.ts === +function f(value: T) { return value; }; +>f : Symbol(f, Decl(compositeGenericFunction.ts, 0, 0)) +>T : Symbol(T, Decl(compositeGenericFunction.ts, 0, 11)) +>value : Symbol(value, Decl(compositeGenericFunction.ts, 0, 14)) +>T : Symbol(T, Decl(compositeGenericFunction.ts, 0, 11)) +>value : Symbol(value, Decl(compositeGenericFunction.ts, 0, 14)) + +function h(func: (x: number) => R): R { return null; } +>h : Symbol(h, Decl(compositeGenericFunction.ts, 0, 42)) +>R : Symbol(R, Decl(compositeGenericFunction.ts, 2, 11)) +>func : Symbol(func, Decl(compositeGenericFunction.ts, 2, 14)) +>x : Symbol(x, Decl(compositeGenericFunction.ts, 2, 21)) +>R : Symbol(R, Decl(compositeGenericFunction.ts, 2, 11)) +>R : Symbol(R, Decl(compositeGenericFunction.ts, 2, 11)) + +var z: number = h(f); +>z : Symbol(z, Decl(compositeGenericFunction.ts, 4, 3), Decl(compositeGenericFunction.ts, 5, 3)) +>h : Symbol(h, Decl(compositeGenericFunction.ts, 0, 42)) +>f : Symbol(f, Decl(compositeGenericFunction.ts, 0, 0)) + +var z: number = h(f); +>z : Symbol(z, Decl(compositeGenericFunction.ts, 4, 3), Decl(compositeGenericFunction.ts, 5, 3)) +>h : Symbol(h, Decl(compositeGenericFunction.ts, 0, 42)) +>f : Symbol(f, Decl(compositeGenericFunction.ts, 0, 0)) + diff --git a/tests/baselines/reference/compositeGenericFunction.types b/tests/baselines/reference/compositeGenericFunction.types index 421b7bbe514..1957c3bb62d 100644 --- a/tests/baselines/reference/compositeGenericFunction.types +++ b/tests/baselines/reference/compositeGenericFunction.types @@ -13,6 +13,7 @@ function h(func: (x: number) => R): R { return null; } >x : number >R : R >R : R +>null : null var z: number = h(f); >z : number diff --git a/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.symbols b/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.symbols new file mode 100644 index 00000000000..cb2a0975e0b --- /dev/null +++ b/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.symbols @@ -0,0 +1,155 @@ +=== tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCanBeAssigned.ts === +enum E { a, b } +>E : Symbol(E, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 0)) +>a : Symbol(E.a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 8)) +>b : Symbol(E.b, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 11)) + +var a: any; +>a : Symbol(a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 2, 3)) + +var b: void; +>b : Symbol(b, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 3, 3)) + +var x1: any; +>x1 : Symbol(x1, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 5, 3)) + +x1 += a; +>x1 : Symbol(x1, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 5, 3)) +>a : Symbol(a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 2, 3)) + +x1 += b; +>x1 : Symbol(x1, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 5, 3)) +>b : Symbol(b, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 3, 3)) + +x1 += true; +>x1 : Symbol(x1, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 5, 3)) + +x1 += 0; +>x1 : Symbol(x1, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 5, 3)) + +x1 += ''; +>x1 : Symbol(x1, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 5, 3)) + +x1 += E.a; +>x1 : Symbol(x1, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 5, 3)) +>E.a : Symbol(E.a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 8)) +>E : Symbol(E, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 0)) +>a : Symbol(E.a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 8)) + +x1 += {}; +>x1 : Symbol(x1, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 5, 3)) + +x1 += null; +>x1 : Symbol(x1, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 5, 3)) + +x1 += undefined; +>x1 : Symbol(x1, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 5, 3)) +>undefined : Symbol(undefined) + +var x2: string; +>x2 : Symbol(x2, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 16, 3)) + +x2 += a; +>x2 : Symbol(x2, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 16, 3)) +>a : Symbol(a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 2, 3)) + +x2 += b; +>x2 : Symbol(x2, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 16, 3)) +>b : Symbol(b, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 3, 3)) + +x2 += true; +>x2 : Symbol(x2, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 16, 3)) + +x2 += 0; +>x2 : Symbol(x2, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 16, 3)) + +x2 += ''; +>x2 : Symbol(x2, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 16, 3)) + +x2 += E.a; +>x2 : Symbol(x2, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 16, 3)) +>E.a : Symbol(E.a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 8)) +>E : Symbol(E, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 0)) +>a : Symbol(E.a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 8)) + +x2 += {}; +>x2 : Symbol(x2, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 16, 3)) + +x2 += null; +>x2 : Symbol(x2, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 16, 3)) + +x2 += undefined; +>x2 : Symbol(x2, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 16, 3)) +>undefined : Symbol(undefined) + +var x3: number; +>x3 : Symbol(x3, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 27, 3)) + +x3 += a; +>x3 : Symbol(x3, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 27, 3)) +>a : Symbol(a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 2, 3)) + +x3 += 0; +>x3 : Symbol(x3, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 27, 3)) + +x3 += E.a; +>x3 : Symbol(x3, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 27, 3)) +>E.a : Symbol(E.a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 8)) +>E : Symbol(E, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 0)) +>a : Symbol(E.a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 8)) + +x3 += null; +>x3 : Symbol(x3, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 27, 3)) + +x3 += undefined; +>x3 : Symbol(x3, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 27, 3)) +>undefined : Symbol(undefined) + +var x4: E; +>x4 : Symbol(x4, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 34, 3)) +>E : Symbol(E, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 0)) + +x4 += a; +>x4 : Symbol(x4, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 34, 3)) +>a : Symbol(a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 2, 3)) + +x4 += 0; +>x4 : Symbol(x4, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 34, 3)) + +x4 += E.a; +>x4 : Symbol(x4, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 34, 3)) +>E.a : Symbol(E.a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 8)) +>E : Symbol(E, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 0)) +>a : Symbol(E.a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 8)) + +x4 += null; +>x4 : Symbol(x4, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 34, 3)) + +x4 += undefined; +>x4 : Symbol(x4, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 34, 3)) +>undefined : Symbol(undefined) + +var x5: boolean; +>x5 : Symbol(x5, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 41, 3)) + +x5 += a; +>x5 : Symbol(x5, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 41, 3)) +>a : Symbol(a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 2, 3)) + +var x6: {}; +>x6 : Symbol(x6, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 44, 3)) + +x6 += a; +>x6 : Symbol(x6, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 44, 3)) +>a : Symbol(a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 2, 3)) + +x6 += ''; +>x6 : Symbol(x6, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 44, 3)) + +var x7: void; +>x7 : Symbol(x7, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 48, 3)) + +x7 += a; +>x7 : Symbol(x7, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 48, 3)) +>a : Symbol(a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 2, 3)) + diff --git a/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.types b/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.types index 7b776389335..e40422450b4 100644 --- a/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.types +++ b/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.types @@ -26,14 +26,17 @@ x1 += b; x1 += true; >x1 += true : any >x1 : any +>true : boolean x1 += 0; >x1 += 0 : any >x1 : any +>0 : number x1 += ''; >x1 += '' : string >x1 : any +>'' : string x1 += E.a; >x1 += E.a : any @@ -50,6 +53,7 @@ x1 += {}; x1 += null; >x1 += null : any >x1 : any +>null : null x1 += undefined; >x1 += undefined : any @@ -72,14 +76,17 @@ x2 += b; x2 += true; >x2 += true : string >x2 : string +>true : boolean x2 += 0; >x2 += 0 : string >x2 : string +>0 : number x2 += ''; >x2 += '' : string >x2 : string +>'' : string x2 += E.a; >x2 += E.a : string @@ -96,6 +103,7 @@ x2 += {}; x2 += null; >x2 += null : string >x2 : string +>null : null x2 += undefined; >x2 += undefined : string @@ -113,6 +121,7 @@ x3 += a; x3 += 0; >x3 += 0 : number >x3 : number +>0 : number x3 += E.a; >x3 += E.a : number @@ -124,6 +133,7 @@ x3 += E.a; x3 += null; >x3 += null : number >x3 : number +>null : null x3 += undefined; >x3 += undefined : number @@ -142,6 +152,7 @@ x4 += a; x4 += 0; >x4 += 0 : number >x4 : E +>0 : number x4 += E.a; >x4 += E.a : number @@ -153,6 +164,7 @@ x4 += E.a; x4 += null; >x4 += null : number >x4 : E +>null : null x4 += undefined; >x4 += undefined : number @@ -178,6 +190,7 @@ x6 += a; x6 += ''; >x6 += '' : string >x6 : {} +>'' : string var x7: void; >x7 : void diff --git a/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.symbols b/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.symbols new file mode 100644 index 00000000000..b9d131217c9 --- /dev/null +++ b/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.symbols @@ -0,0 +1,84 @@ +=== tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentLHSCanBeAssigned.ts === +enum E { a, b, c } +>E : Symbol(E, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 0, 0)) +>a : Symbol(E.a, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 0, 8)) +>b : Symbol(E.b, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 0, 11)) +>c : Symbol(E.c, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 0, 14)) + +var a: any; +>a : Symbol(a, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 2, 3)) + +var b: number; +>b : Symbol(b, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 3, 3)) + +var c: E; +>c : Symbol(c, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 4, 3)) +>E : Symbol(E, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 0, 0)) + +var x1: any; +>x1 : Symbol(x1, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 6, 3)) + +x1 *= a; +>x1 : Symbol(x1, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 6, 3)) +>a : Symbol(a, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 2, 3)) + +x1 *= b; +>x1 : Symbol(x1, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 6, 3)) +>b : Symbol(b, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 3, 3)) + +x1 *= c; +>x1 : Symbol(x1, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 6, 3)) +>c : Symbol(c, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 4, 3)) + +x1 *= null; +>x1 : Symbol(x1, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 6, 3)) + +x1 *= undefined; +>x1 : Symbol(x1, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 6, 3)) +>undefined : Symbol(undefined) + +var x2: number; +>x2 : Symbol(x2, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 13, 3)) + +x2 *= a; +>x2 : Symbol(x2, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 13, 3)) +>a : Symbol(a, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 2, 3)) + +x2 *= b; +>x2 : Symbol(x2, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 13, 3)) +>b : Symbol(b, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 3, 3)) + +x2 *= c; +>x2 : Symbol(x2, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 13, 3)) +>c : Symbol(c, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 4, 3)) + +x2 *= null; +>x2 : Symbol(x2, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 13, 3)) + +x2 *= undefined; +>x2 : Symbol(x2, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 13, 3)) +>undefined : Symbol(undefined) + +var x3: E; +>x3 : Symbol(x3, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 20, 3)) +>E : Symbol(E, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 0, 0)) + +x3 *= a; +>x3 : Symbol(x3, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 20, 3)) +>a : Symbol(a, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 2, 3)) + +x3 *= b; +>x3 : Symbol(x3, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 20, 3)) +>b : Symbol(b, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 3, 3)) + +x3 *= c; +>x3 : Symbol(x3, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 20, 3)) +>c : Symbol(c, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 4, 3)) + +x3 *= null; +>x3 : Symbol(x3, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 20, 3)) + +x3 *= undefined; +>x3 : Symbol(x3, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 20, 3)) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.types b/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.types index c4345b97413..3b346bac53b 100644 --- a/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.types +++ b/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.types @@ -36,6 +36,7 @@ x1 *= c; x1 *= null; >x1 *= null : number >x1 : any +>null : null x1 *= undefined; >x1 *= undefined : number @@ -63,6 +64,7 @@ x2 *= c; x2 *= null; >x2 *= null : number >x2 : number +>null : null x2 *= undefined; >x2 *= undefined : number @@ -91,6 +93,7 @@ x3 *= c; x3 *= null; >x3 *= null : number >x3 : E +>null : null x3 *= undefined; >x3 *= undefined : number diff --git a/tests/baselines/reference/compoundAssignmentLHSIsReference.symbols b/tests/baselines/reference/compoundAssignmentLHSIsReference.symbols new file mode 100644 index 00000000000..e7c19e4d781 --- /dev/null +++ b/tests/baselines/reference/compoundAssignmentLHSIsReference.symbols @@ -0,0 +1,100 @@ +=== tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsReference.ts === +var value; +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + +// identifiers: variable and parameter +var x1: number; +>x1 : Symbol(x1, Decl(compoundAssignmentLHSIsReference.ts, 3, 3)) + +x1 *= value; +>x1 : Symbol(x1, Decl(compoundAssignmentLHSIsReference.ts, 3, 3)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + +x1 += value; +>x1 : Symbol(x1, Decl(compoundAssignmentLHSIsReference.ts, 3, 3)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + +function fn1(x2: number) { +>fn1 : Symbol(fn1, Decl(compoundAssignmentLHSIsReference.ts, 5, 12)) +>x2 : Symbol(x2, Decl(compoundAssignmentLHSIsReference.ts, 7, 13)) + + x2 *= value; +>x2 : Symbol(x2, Decl(compoundAssignmentLHSIsReference.ts, 7, 13)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + + x2 += value; +>x2 : Symbol(x2, Decl(compoundAssignmentLHSIsReference.ts, 7, 13)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) +} + +// property accesses +var x3: { a: number }; +>x3 : Symbol(x3, Decl(compoundAssignmentLHSIsReference.ts, 13, 3)) +>a : Symbol(a, Decl(compoundAssignmentLHSIsReference.ts, 13, 9)) + +x3.a *= value; +>x3.a : Symbol(a, Decl(compoundAssignmentLHSIsReference.ts, 13, 9)) +>x3 : Symbol(x3, Decl(compoundAssignmentLHSIsReference.ts, 13, 3)) +>a : Symbol(a, Decl(compoundAssignmentLHSIsReference.ts, 13, 9)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + +x3.a += value; +>x3.a : Symbol(a, Decl(compoundAssignmentLHSIsReference.ts, 13, 9)) +>x3 : Symbol(x3, Decl(compoundAssignmentLHSIsReference.ts, 13, 3)) +>a : Symbol(a, Decl(compoundAssignmentLHSIsReference.ts, 13, 9)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + +x3['a'] *= value; +>x3 : Symbol(x3, Decl(compoundAssignmentLHSIsReference.ts, 13, 3)) +>'a' : Symbol(a, Decl(compoundAssignmentLHSIsReference.ts, 13, 9)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + +x3['a'] += value; +>x3 : Symbol(x3, Decl(compoundAssignmentLHSIsReference.ts, 13, 3)) +>'a' : Symbol(a, Decl(compoundAssignmentLHSIsReference.ts, 13, 9)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + +// parentheses, the contained expression is reference +(x1) *= value; +>x1 : Symbol(x1, Decl(compoundAssignmentLHSIsReference.ts, 3, 3)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + +(x1) += value; +>x1 : Symbol(x1, Decl(compoundAssignmentLHSIsReference.ts, 3, 3)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + +function fn2(x4: number) { +>fn2 : Symbol(fn2, Decl(compoundAssignmentLHSIsReference.ts, 22, 14)) +>x4 : Symbol(x4, Decl(compoundAssignmentLHSIsReference.ts, 24, 13)) + + (x4) *= value; +>x4 : Symbol(x4, Decl(compoundAssignmentLHSIsReference.ts, 24, 13)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + + (x4) += value; +>x4 : Symbol(x4, Decl(compoundAssignmentLHSIsReference.ts, 24, 13)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) +} + +(x3.a) *= value; +>x3.a : Symbol(a, Decl(compoundAssignmentLHSIsReference.ts, 13, 9)) +>x3 : Symbol(x3, Decl(compoundAssignmentLHSIsReference.ts, 13, 3)) +>a : Symbol(a, Decl(compoundAssignmentLHSIsReference.ts, 13, 9)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + +(x3.a) += value; +>x3.a : Symbol(a, Decl(compoundAssignmentLHSIsReference.ts, 13, 9)) +>x3 : Symbol(x3, Decl(compoundAssignmentLHSIsReference.ts, 13, 3)) +>a : Symbol(a, Decl(compoundAssignmentLHSIsReference.ts, 13, 9)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + +(x3['a']) *= value; +>x3 : Symbol(x3, Decl(compoundAssignmentLHSIsReference.ts, 13, 3)) +>'a' : Symbol(a, Decl(compoundAssignmentLHSIsReference.ts, 13, 9)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + +(x3['a']) += value; +>x3 : Symbol(x3, Decl(compoundAssignmentLHSIsReference.ts, 13, 3)) +>'a' : Symbol(a, Decl(compoundAssignmentLHSIsReference.ts, 13, 9)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + diff --git a/tests/baselines/reference/compoundAssignmentLHSIsReference.types b/tests/baselines/reference/compoundAssignmentLHSIsReference.types index e30cf19f3e3..12c601d377f 100644 --- a/tests/baselines/reference/compoundAssignmentLHSIsReference.types +++ b/tests/baselines/reference/compoundAssignmentLHSIsReference.types @@ -54,12 +54,14 @@ x3['a'] *= value; >x3['a'] *= value : number >x3['a'] : number >x3 : { a: number; } +>'a' : string >value : any x3['a'] += value; >x3['a'] += value : any >x3['a'] : number >x3 : { a: number; } +>'a' : string >value : any // parentheses, the contained expression is reference @@ -113,6 +115,7 @@ function fn2(x4: number) { >(x3['a']) : number >x3['a'] : number >x3 : { a: number; } +>'a' : string >value : any (x3['a']) += value; @@ -120,5 +123,6 @@ function fn2(x4: number) { >(x3['a']) : number >x3['a'] : number >x3 : { a: number; } +>'a' : string >value : any diff --git a/tests/baselines/reference/compoundVarDecl1.symbols b/tests/baselines/reference/compoundVarDecl1.symbols new file mode 100644 index 00000000000..d76571f6f44 --- /dev/null +++ b/tests/baselines/reference/compoundVarDecl1.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/compoundVarDecl1.ts === +module Foo { var a = 1, b = 1; a = b + 2; } +>Foo : Symbol(Foo, Decl(compoundVarDecl1.ts, 0, 0)) +>a : Symbol(a, Decl(compoundVarDecl1.ts, 0, 16)) +>b : Symbol(b, Decl(compoundVarDecl1.ts, 0, 23)) +>a : Symbol(a, Decl(compoundVarDecl1.ts, 0, 16)) +>b : Symbol(b, Decl(compoundVarDecl1.ts, 0, 23)) + +var foo = 4, bar = 5; +>foo : Symbol(foo, Decl(compoundVarDecl1.ts, 2, 3)) +>bar : Symbol(bar, Decl(compoundVarDecl1.ts, 2, 12)) + diff --git a/tests/baselines/reference/compoundVarDecl1.types b/tests/baselines/reference/compoundVarDecl1.types index e9a04bff9b2..40f12ea52c0 100644 --- a/tests/baselines/reference/compoundVarDecl1.types +++ b/tests/baselines/reference/compoundVarDecl1.types @@ -2,13 +2,18 @@ module Foo { var a = 1, b = 1; a = b + 2; } >Foo : typeof Foo >a : number +>1 : number >b : number +>1 : number >a = b + 2 : number >a : number >b + 2 : number >b : number +>2 : number var foo = 4, bar = 5; >foo : number +>4 : number >bar : number +>5 : number diff --git a/tests/baselines/reference/computedPropertyNames10_ES5.symbols b/tests/baselines/reference/computedPropertyNames10_ES5.symbols new file mode 100644 index 00000000000..17d1f7ca117 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames10_ES5.symbols @@ -0,0 +1,40 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames10_ES5.ts === +var s: string; +>s : Symbol(s, Decl(computedPropertyNames10_ES5.ts, 0, 3)) + +var n: number; +>n : Symbol(n, Decl(computedPropertyNames10_ES5.ts, 1, 3)) + +var a: any; +>a : Symbol(a, Decl(computedPropertyNames10_ES5.ts, 2, 3)) + +var v = { +>v : Symbol(v, Decl(computedPropertyNames10_ES5.ts, 3, 3)) + + [s]() { }, +>s : Symbol(s, Decl(computedPropertyNames10_ES5.ts, 0, 3)) + + [n]() { }, +>n : Symbol(n, Decl(computedPropertyNames10_ES5.ts, 1, 3)) + + [s + s]() { }, +>s : Symbol(s, Decl(computedPropertyNames10_ES5.ts, 0, 3)) +>s : Symbol(s, Decl(computedPropertyNames10_ES5.ts, 0, 3)) + + [s + n]() { }, +>s : Symbol(s, Decl(computedPropertyNames10_ES5.ts, 0, 3)) +>n : Symbol(n, Decl(computedPropertyNames10_ES5.ts, 1, 3)) + + [+s]() { }, +>s : Symbol(s, Decl(computedPropertyNames10_ES5.ts, 0, 3)) + + [""]() { }, + [0]() { }, + [a]() { }, +>a : Symbol(a, Decl(computedPropertyNames10_ES5.ts, 2, 3)) + + [true]() { }, + [`hello bye`]() { }, + [`hello ${a} bye`]() { } +>a : Symbol(a, Decl(computedPropertyNames10_ES5.ts, 2, 3)) +} diff --git a/tests/baselines/reference/computedPropertyNames10_ES5.types b/tests/baselines/reference/computedPropertyNames10_ES5.types index cb49d5c3384..87648c1ed80 100644 --- a/tests/baselines/reference/computedPropertyNames10_ES5.types +++ b/tests/baselines/reference/computedPropertyNames10_ES5.types @@ -33,14 +33,22 @@ var v = { >s : string [""]() { }, +>"" : string + [0]() { }, +>0 : number + [a]() { }, >a : any [true]() { }, >true : any +>true : boolean [`hello bye`]() { }, +>`hello bye` : string + [`hello ${a} bye`]() { } +>`hello ${a} bye` : string >a : any } diff --git a/tests/baselines/reference/computedPropertyNames10_ES6.symbols b/tests/baselines/reference/computedPropertyNames10_ES6.symbols new file mode 100644 index 00000000000..4141b787208 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames10_ES6.symbols @@ -0,0 +1,40 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames10_ES6.ts === +var s: string; +>s : Symbol(s, Decl(computedPropertyNames10_ES6.ts, 0, 3)) + +var n: number; +>n : Symbol(n, Decl(computedPropertyNames10_ES6.ts, 1, 3)) + +var a: any; +>a : Symbol(a, Decl(computedPropertyNames10_ES6.ts, 2, 3)) + +var v = { +>v : Symbol(v, Decl(computedPropertyNames10_ES6.ts, 3, 3)) + + [s]() { }, +>s : Symbol(s, Decl(computedPropertyNames10_ES6.ts, 0, 3)) + + [n]() { }, +>n : Symbol(n, Decl(computedPropertyNames10_ES6.ts, 1, 3)) + + [s + s]() { }, +>s : Symbol(s, Decl(computedPropertyNames10_ES6.ts, 0, 3)) +>s : Symbol(s, Decl(computedPropertyNames10_ES6.ts, 0, 3)) + + [s + n]() { }, +>s : Symbol(s, Decl(computedPropertyNames10_ES6.ts, 0, 3)) +>n : Symbol(n, Decl(computedPropertyNames10_ES6.ts, 1, 3)) + + [+s]() { }, +>s : Symbol(s, Decl(computedPropertyNames10_ES6.ts, 0, 3)) + + [""]() { }, + [0]() { }, + [a]() { }, +>a : Symbol(a, Decl(computedPropertyNames10_ES6.ts, 2, 3)) + + [true]() { }, + [`hello bye`]() { }, + [`hello ${a} bye`]() { } +>a : Symbol(a, Decl(computedPropertyNames10_ES6.ts, 2, 3)) +} diff --git a/tests/baselines/reference/computedPropertyNames10_ES6.types b/tests/baselines/reference/computedPropertyNames10_ES6.types index 5dcc4783b5e..996dfc99fe9 100644 --- a/tests/baselines/reference/computedPropertyNames10_ES6.types +++ b/tests/baselines/reference/computedPropertyNames10_ES6.types @@ -33,14 +33,22 @@ var v = { >s : string [""]() { }, +>"" : string + [0]() { }, +>0 : number + [a]() { }, >a : any [true]() { }, >true : any +>true : boolean [`hello bye`]() { }, +>`hello bye` : string + [`hello ${a} bye`]() { } +>`hello ${a} bye` : string >a : any } diff --git a/tests/baselines/reference/computedPropertyNames11_ES5.symbols b/tests/baselines/reference/computedPropertyNames11_ES5.symbols new file mode 100644 index 00000000000..34326273e59 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames11_ES5.symbols @@ -0,0 +1,47 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts === +var s: string; +>s : Symbol(s, Decl(computedPropertyNames11_ES5.ts, 0, 3)) + +var n: number; +>n : Symbol(n, Decl(computedPropertyNames11_ES5.ts, 1, 3)) + +var a: any; +>a : Symbol(a, Decl(computedPropertyNames11_ES5.ts, 2, 3)) + +var v = { +>v : Symbol(v, Decl(computedPropertyNames11_ES5.ts, 3, 3)) + + get [s]() { return 0; }, +>s : Symbol(s, Decl(computedPropertyNames11_ES5.ts, 0, 3)) + + set [n](v) { }, +>n : Symbol(n, Decl(computedPropertyNames11_ES5.ts, 1, 3)) +>v : Symbol(v, Decl(computedPropertyNames11_ES5.ts, 5, 12)) + + get [s + s]() { return 0; }, +>s : Symbol(s, Decl(computedPropertyNames11_ES5.ts, 0, 3)) +>s : Symbol(s, Decl(computedPropertyNames11_ES5.ts, 0, 3)) + + set [s + n](v) { }, +>s : Symbol(s, Decl(computedPropertyNames11_ES5.ts, 0, 3)) +>n : Symbol(n, Decl(computedPropertyNames11_ES5.ts, 1, 3)) +>v : Symbol(v, Decl(computedPropertyNames11_ES5.ts, 7, 16)) + + get [+s]() { return 0; }, +>s : Symbol(s, Decl(computedPropertyNames11_ES5.ts, 0, 3)) + + set [""](v) { }, +>v : Symbol(v, Decl(computedPropertyNames11_ES5.ts, 9, 13)) + + get [0]() { return 0; }, + set [a](v) { }, +>a : Symbol(a, Decl(computedPropertyNames11_ES5.ts, 2, 3)) +>v : Symbol(v, Decl(computedPropertyNames11_ES5.ts, 11, 12)) + + get [true]() { return 0; }, + set [`hello bye`](v) { }, +>v : Symbol(v, Decl(computedPropertyNames11_ES5.ts, 13, 22)) + + get [`hello ${a} bye`]() { return 0; } +>a : Symbol(a, Decl(computedPropertyNames11_ES5.ts, 2, 3)) +} diff --git a/tests/baselines/reference/computedPropertyNames11_ES5.types b/tests/baselines/reference/computedPropertyNames11_ES5.types index ed3c51302b7..c3c59c2eb9c 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES5.types +++ b/tests/baselines/reference/computedPropertyNames11_ES5.types @@ -14,6 +14,7 @@ var v = { get [s]() { return 0; }, >s : string +>0 : number set [n](v) { }, >n : number @@ -23,6 +24,7 @@ var v = { >s + s : string >s : string >s : string +>0 : number set [s + n](v) { }, >s + n : string @@ -33,21 +35,31 @@ var v = { get [+s]() { return 0; }, >+s : number >s : string +>0 : number set [""](v) { }, +>"" : string >v : any get [0]() { return 0; }, +>0 : number +>0 : number + set [a](v) { }, >a : any >v : any get [true]() { return 0; }, >true : any +>true : boolean +>0 : number set [`hello bye`](v) { }, +>`hello bye` : string >v : any get [`hello ${a} bye`]() { return 0; } +>`hello ${a} bye` : string >a : any +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNames11_ES6.symbols b/tests/baselines/reference/computedPropertyNames11_ES6.symbols new file mode 100644 index 00000000000..73503eb2758 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames11_ES6.symbols @@ -0,0 +1,47 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES6.ts === +var s: string; +>s : Symbol(s, Decl(computedPropertyNames11_ES6.ts, 0, 3)) + +var n: number; +>n : Symbol(n, Decl(computedPropertyNames11_ES6.ts, 1, 3)) + +var a: any; +>a : Symbol(a, Decl(computedPropertyNames11_ES6.ts, 2, 3)) + +var v = { +>v : Symbol(v, Decl(computedPropertyNames11_ES6.ts, 3, 3)) + + get [s]() { return 0; }, +>s : Symbol(s, Decl(computedPropertyNames11_ES6.ts, 0, 3)) + + set [n](v) { }, +>n : Symbol(n, Decl(computedPropertyNames11_ES6.ts, 1, 3)) +>v : Symbol(v, Decl(computedPropertyNames11_ES6.ts, 5, 12)) + + get [s + s]() { return 0; }, +>s : Symbol(s, Decl(computedPropertyNames11_ES6.ts, 0, 3)) +>s : Symbol(s, Decl(computedPropertyNames11_ES6.ts, 0, 3)) + + set [s + n](v) { }, +>s : Symbol(s, Decl(computedPropertyNames11_ES6.ts, 0, 3)) +>n : Symbol(n, Decl(computedPropertyNames11_ES6.ts, 1, 3)) +>v : Symbol(v, Decl(computedPropertyNames11_ES6.ts, 7, 16)) + + get [+s]() { return 0; }, +>s : Symbol(s, Decl(computedPropertyNames11_ES6.ts, 0, 3)) + + set [""](v) { }, +>v : Symbol(v, Decl(computedPropertyNames11_ES6.ts, 9, 13)) + + get [0]() { return 0; }, + set [a](v) { }, +>a : Symbol(a, Decl(computedPropertyNames11_ES6.ts, 2, 3)) +>v : Symbol(v, Decl(computedPropertyNames11_ES6.ts, 11, 12)) + + get [true]() { return 0; }, + set [`hello bye`](v) { }, +>v : Symbol(v, Decl(computedPropertyNames11_ES6.ts, 13, 22)) + + get [`hello ${a} bye`]() { return 0; } +>a : Symbol(a, Decl(computedPropertyNames11_ES6.ts, 2, 3)) +} diff --git a/tests/baselines/reference/computedPropertyNames11_ES6.types b/tests/baselines/reference/computedPropertyNames11_ES6.types index a0b9e6eb99e..ef11511baae 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES6.types +++ b/tests/baselines/reference/computedPropertyNames11_ES6.types @@ -14,6 +14,7 @@ var v = { get [s]() { return 0; }, >s : string +>0 : number set [n](v) { }, >n : number @@ -23,6 +24,7 @@ var v = { >s + s : string >s : string >s : string +>0 : number set [s + n](v) { }, >s + n : string @@ -33,21 +35,31 @@ var v = { get [+s]() { return 0; }, >+s : number >s : string +>0 : number set [""](v) { }, +>"" : string >v : any get [0]() { return 0; }, +>0 : number +>0 : number + set [a](v) { }, >a : any >v : any get [true]() { return 0; }, >true : any +>true : boolean +>0 : number set [`hello bye`](v) { }, +>`hello bye` : string >v : any get [`hello ${a} bye`]() { return 0; } +>`hello ${a} bye` : string >a : any +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNames13_ES5.symbols b/tests/baselines/reference/computedPropertyNames13_ES5.symbols new file mode 100644 index 00000000000..ea2e1b025e5 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames13_ES5.symbols @@ -0,0 +1,40 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames13_ES5.ts === +var s: string; +>s : Symbol(s, Decl(computedPropertyNames13_ES5.ts, 0, 3)) + +var n: number; +>n : Symbol(n, Decl(computedPropertyNames13_ES5.ts, 1, 3)) + +var a: any; +>a : Symbol(a, Decl(computedPropertyNames13_ES5.ts, 2, 3)) + +class C { +>C : Symbol(C, Decl(computedPropertyNames13_ES5.ts, 2, 11)) + + [s]() {} +>s : Symbol(s, Decl(computedPropertyNames13_ES5.ts, 0, 3)) + + [n]() { } +>n : Symbol(n, Decl(computedPropertyNames13_ES5.ts, 1, 3)) + + static [s + s]() { } +>s : Symbol(s, Decl(computedPropertyNames13_ES5.ts, 0, 3)) +>s : Symbol(s, Decl(computedPropertyNames13_ES5.ts, 0, 3)) + + [s + n]() { } +>s : Symbol(s, Decl(computedPropertyNames13_ES5.ts, 0, 3)) +>n : Symbol(n, Decl(computedPropertyNames13_ES5.ts, 1, 3)) + + [+s]() { } +>s : Symbol(s, Decl(computedPropertyNames13_ES5.ts, 0, 3)) + + static [""]() { } + [0]() { } + [a]() { } +>a : Symbol(a, Decl(computedPropertyNames13_ES5.ts, 2, 3)) + + static [true]() { } + [`hello bye`]() { } + static [`hello ${a} bye`]() { } +>a : Symbol(a, Decl(computedPropertyNames13_ES5.ts, 2, 3)) +} diff --git a/tests/baselines/reference/computedPropertyNames13_ES5.types b/tests/baselines/reference/computedPropertyNames13_ES5.types index ff98a3189a7..59694df32a7 100644 --- a/tests/baselines/reference/computedPropertyNames13_ES5.types +++ b/tests/baselines/reference/computedPropertyNames13_ES5.types @@ -32,14 +32,22 @@ class C { >s : string static [""]() { } +>"" : string + [0]() { } +>0 : number + [a]() { } >a : any static [true]() { } >true : any +>true : boolean [`hello bye`]() { } +>`hello bye` : string + static [`hello ${a} bye`]() { } +>`hello ${a} bye` : string >a : any } diff --git a/tests/baselines/reference/computedPropertyNames13_ES6.symbols b/tests/baselines/reference/computedPropertyNames13_ES6.symbols new file mode 100644 index 00000000000..21f7700acef --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames13_ES6.symbols @@ -0,0 +1,40 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames13_ES6.ts === +var s: string; +>s : Symbol(s, Decl(computedPropertyNames13_ES6.ts, 0, 3)) + +var n: number; +>n : Symbol(n, Decl(computedPropertyNames13_ES6.ts, 1, 3)) + +var a: any; +>a : Symbol(a, Decl(computedPropertyNames13_ES6.ts, 2, 3)) + +class C { +>C : Symbol(C, Decl(computedPropertyNames13_ES6.ts, 2, 11)) + + [s]() {} +>s : Symbol(s, Decl(computedPropertyNames13_ES6.ts, 0, 3)) + + [n]() { } +>n : Symbol(n, Decl(computedPropertyNames13_ES6.ts, 1, 3)) + + static [s + s]() { } +>s : Symbol(s, Decl(computedPropertyNames13_ES6.ts, 0, 3)) +>s : Symbol(s, Decl(computedPropertyNames13_ES6.ts, 0, 3)) + + [s + n]() { } +>s : Symbol(s, Decl(computedPropertyNames13_ES6.ts, 0, 3)) +>n : Symbol(n, Decl(computedPropertyNames13_ES6.ts, 1, 3)) + + [+s]() { } +>s : Symbol(s, Decl(computedPropertyNames13_ES6.ts, 0, 3)) + + static [""]() { } + [0]() { } + [a]() { } +>a : Symbol(a, Decl(computedPropertyNames13_ES6.ts, 2, 3)) + + static [true]() { } + [`hello bye`]() { } + static [`hello ${a} bye`]() { } +>a : Symbol(a, Decl(computedPropertyNames13_ES6.ts, 2, 3)) +} diff --git a/tests/baselines/reference/computedPropertyNames13_ES6.types b/tests/baselines/reference/computedPropertyNames13_ES6.types index 78b2f3afc4a..a2d0f14e72c 100644 --- a/tests/baselines/reference/computedPropertyNames13_ES6.types +++ b/tests/baselines/reference/computedPropertyNames13_ES6.types @@ -32,14 +32,22 @@ class C { >s : string static [""]() { } +>"" : string + [0]() { } +>0 : number + [a]() { } >a : any static [true]() { } >true : any +>true : boolean [`hello bye`]() { } +>`hello bye` : string + static [`hello ${a} bye`]() { } +>`hello ${a} bye` : string >a : any } diff --git a/tests/baselines/reference/computedPropertyNames16_ES5.symbols b/tests/baselines/reference/computedPropertyNames16_ES5.symbols new file mode 100644 index 00000000000..62450e0aa4a --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames16_ES5.symbols @@ -0,0 +1,47 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames16_ES5.ts === +var s: string; +>s : Symbol(s, Decl(computedPropertyNames16_ES5.ts, 0, 3)) + +var n: number; +>n : Symbol(n, Decl(computedPropertyNames16_ES5.ts, 1, 3)) + +var a: any; +>a : Symbol(a, Decl(computedPropertyNames16_ES5.ts, 2, 3)) + +class C { +>C : Symbol(C, Decl(computedPropertyNames16_ES5.ts, 2, 11)) + + get [s]() { return 0;} +>s : Symbol(s, Decl(computedPropertyNames16_ES5.ts, 0, 3)) + + set [n](v) { } +>n : Symbol(n, Decl(computedPropertyNames16_ES5.ts, 1, 3)) +>v : Symbol(v, Decl(computedPropertyNames16_ES5.ts, 5, 12)) + + static get [s + s]() { return 0; } +>s : Symbol(s, Decl(computedPropertyNames16_ES5.ts, 0, 3)) +>s : Symbol(s, Decl(computedPropertyNames16_ES5.ts, 0, 3)) + + set [s + n](v) { } +>s : Symbol(s, Decl(computedPropertyNames16_ES5.ts, 0, 3)) +>n : Symbol(n, Decl(computedPropertyNames16_ES5.ts, 1, 3)) +>v : Symbol(v, Decl(computedPropertyNames16_ES5.ts, 7, 16)) + + get [+s]() { return 0; } +>s : Symbol(s, Decl(computedPropertyNames16_ES5.ts, 0, 3)) + + static set [""](v) { } +>v : Symbol(v, Decl(computedPropertyNames16_ES5.ts, 9, 20)) + + get [0]() { return 0; } + set [a](v) { } +>a : Symbol(a, Decl(computedPropertyNames16_ES5.ts, 2, 3)) +>v : Symbol(v, Decl(computedPropertyNames16_ES5.ts, 11, 12)) + + static get [true]() { return 0; } + set [`hello bye`](v) { } +>v : Symbol(v, Decl(computedPropertyNames16_ES5.ts, 13, 22)) + + get [`hello ${a} bye`]() { return 0; } +>a : Symbol(a, Decl(computedPropertyNames16_ES5.ts, 2, 3)) +} diff --git a/tests/baselines/reference/computedPropertyNames16_ES5.types b/tests/baselines/reference/computedPropertyNames16_ES5.types index 3914093c766..ab7ea23cffe 100644 --- a/tests/baselines/reference/computedPropertyNames16_ES5.types +++ b/tests/baselines/reference/computedPropertyNames16_ES5.types @@ -13,6 +13,7 @@ class C { get [s]() { return 0;} >s : string +>0 : number set [n](v) { } >n : number @@ -22,6 +23,7 @@ class C { >s + s : string >s : string >s : string +>0 : number set [s + n](v) { } >s + n : string @@ -32,21 +34,31 @@ class C { get [+s]() { return 0; } >+s : number >s : string +>0 : number static set [""](v) { } +>"" : string >v : any get [0]() { return 0; } +>0 : number +>0 : number + set [a](v) { } >a : any >v : any static get [true]() { return 0; } >true : any +>true : boolean +>0 : number set [`hello bye`](v) { } +>`hello bye` : string >v : any get [`hello ${a} bye`]() { return 0; } +>`hello ${a} bye` : string >a : any +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNames16_ES6.symbols b/tests/baselines/reference/computedPropertyNames16_ES6.symbols new file mode 100644 index 00000000000..dc241f67547 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames16_ES6.symbols @@ -0,0 +1,47 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames16_ES6.ts === +var s: string; +>s : Symbol(s, Decl(computedPropertyNames16_ES6.ts, 0, 3)) + +var n: number; +>n : Symbol(n, Decl(computedPropertyNames16_ES6.ts, 1, 3)) + +var a: any; +>a : Symbol(a, Decl(computedPropertyNames16_ES6.ts, 2, 3)) + +class C { +>C : Symbol(C, Decl(computedPropertyNames16_ES6.ts, 2, 11)) + + get [s]() { return 0;} +>s : Symbol(s, Decl(computedPropertyNames16_ES6.ts, 0, 3)) + + set [n](v) { } +>n : Symbol(n, Decl(computedPropertyNames16_ES6.ts, 1, 3)) +>v : Symbol(v, Decl(computedPropertyNames16_ES6.ts, 5, 12)) + + static get [s + s]() { return 0; } +>s : Symbol(s, Decl(computedPropertyNames16_ES6.ts, 0, 3)) +>s : Symbol(s, Decl(computedPropertyNames16_ES6.ts, 0, 3)) + + set [s + n](v) { } +>s : Symbol(s, Decl(computedPropertyNames16_ES6.ts, 0, 3)) +>n : Symbol(n, Decl(computedPropertyNames16_ES6.ts, 1, 3)) +>v : Symbol(v, Decl(computedPropertyNames16_ES6.ts, 7, 16)) + + get [+s]() { return 0; } +>s : Symbol(s, Decl(computedPropertyNames16_ES6.ts, 0, 3)) + + static set [""](v) { } +>v : Symbol(v, Decl(computedPropertyNames16_ES6.ts, 9, 20)) + + get [0]() { return 0; } + set [a](v) { } +>a : Symbol(a, Decl(computedPropertyNames16_ES6.ts, 2, 3)) +>v : Symbol(v, Decl(computedPropertyNames16_ES6.ts, 11, 12)) + + static get [true]() { return 0; } + set [`hello bye`](v) { } +>v : Symbol(v, Decl(computedPropertyNames16_ES6.ts, 13, 22)) + + get [`hello ${a} bye`]() { return 0; } +>a : Symbol(a, Decl(computedPropertyNames16_ES6.ts, 2, 3)) +} diff --git a/tests/baselines/reference/computedPropertyNames16_ES6.types b/tests/baselines/reference/computedPropertyNames16_ES6.types index 6503c75037d..c7286e6640e 100644 --- a/tests/baselines/reference/computedPropertyNames16_ES6.types +++ b/tests/baselines/reference/computedPropertyNames16_ES6.types @@ -13,6 +13,7 @@ class C { get [s]() { return 0;} >s : string +>0 : number set [n](v) { } >n : number @@ -22,6 +23,7 @@ class C { >s + s : string >s : string >s : string +>0 : number set [s + n](v) { } >s + n : string @@ -32,21 +34,31 @@ class C { get [+s]() { return 0; } >+s : number >s : string +>0 : number static set [""](v) { } +>"" : string >v : any get [0]() { return 0; } +>0 : number +>0 : number + set [a](v) { } >a : any >v : any static get [true]() { return 0; } >true : any +>true : boolean +>0 : number set [`hello bye`](v) { } +>`hello bye` : string >v : any get [`hello ${a} bye`]() { return 0; } +>`hello ${a} bye` : string >a : any +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNames18_ES5.symbols b/tests/baselines/reference/computedPropertyNames18_ES5.symbols new file mode 100644 index 00000000000..86d706bc44c --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames18_ES5.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames18_ES5.ts === +function foo() { +>foo : Symbol(foo, Decl(computedPropertyNames18_ES5.ts, 0, 0)) + + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames18_ES5.ts, 1, 7)) + + [this.bar]: 0 + } +} diff --git a/tests/baselines/reference/computedPropertyNames18_ES5.types b/tests/baselines/reference/computedPropertyNames18_ES5.types index 732de08e2d6..c60ab32d3f8 100644 --- a/tests/baselines/reference/computedPropertyNames18_ES5.types +++ b/tests/baselines/reference/computedPropertyNames18_ES5.types @@ -10,5 +10,6 @@ function foo() { >this.bar : any >this : any >bar : any +>0 : number } } diff --git a/tests/baselines/reference/computedPropertyNames18_ES6.symbols b/tests/baselines/reference/computedPropertyNames18_ES6.symbols new file mode 100644 index 00000000000..c530d1e811f --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames18_ES6.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames18_ES6.ts === +function foo() { +>foo : Symbol(foo, Decl(computedPropertyNames18_ES6.ts, 0, 0)) + + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames18_ES6.ts, 1, 7)) + + [this.bar]: 0 + } +} diff --git a/tests/baselines/reference/computedPropertyNames18_ES6.types b/tests/baselines/reference/computedPropertyNames18_ES6.types index af7081fa2ad..33a15b6c5a9 100644 --- a/tests/baselines/reference/computedPropertyNames18_ES6.types +++ b/tests/baselines/reference/computedPropertyNames18_ES6.types @@ -10,5 +10,6 @@ function foo() { >this.bar : any >this : any >bar : any +>0 : number } } diff --git a/tests/baselines/reference/computedPropertyNames1_ES5.symbols b/tests/baselines/reference/computedPropertyNames1_ES5.symbols new file mode 100644 index 00000000000..2bc11580c78 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames1_ES5.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames1_ES5.ts === +var v = { +>v : Symbol(v, Decl(computedPropertyNames1_ES5.ts, 0, 3)) + + get [0 + 1]() { return 0 }, + set [0 + 1](v: string) { } //No error +>v : Symbol(v, Decl(computedPropertyNames1_ES5.ts, 2, 16)) +} diff --git a/tests/baselines/reference/computedPropertyNames1_ES5.types b/tests/baselines/reference/computedPropertyNames1_ES5.types index 6627d53d1da..6c94c846f30 100644 --- a/tests/baselines/reference/computedPropertyNames1_ES5.types +++ b/tests/baselines/reference/computedPropertyNames1_ES5.types @@ -5,8 +5,13 @@ var v = { get [0 + 1]() { return 0 }, >0 + 1 : number +>0 : number +>1 : number +>0 : number set [0 + 1](v: string) { } //No error >0 + 1 : number +>0 : number +>1 : number >v : string } diff --git a/tests/baselines/reference/computedPropertyNames1_ES6.symbols b/tests/baselines/reference/computedPropertyNames1_ES6.symbols new file mode 100644 index 00000000000..5a1708b927d --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames1_ES6.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames1_ES6.ts === +var v = { +>v : Symbol(v, Decl(computedPropertyNames1_ES6.ts, 0, 3)) + + get [0 + 1]() { return 0 }, + set [0 + 1](v: string) { } //No error +>v : Symbol(v, Decl(computedPropertyNames1_ES6.ts, 2, 16)) +} diff --git a/tests/baselines/reference/computedPropertyNames1_ES6.types b/tests/baselines/reference/computedPropertyNames1_ES6.types index 966cfef579d..95e5a011ea2 100644 --- a/tests/baselines/reference/computedPropertyNames1_ES6.types +++ b/tests/baselines/reference/computedPropertyNames1_ES6.types @@ -5,8 +5,13 @@ var v = { get [0 + 1]() { return 0 }, >0 + 1 : number +>0 : number +>1 : number +>0 : number set [0 + 1](v: string) { } //No error >0 + 1 : number +>0 : number +>1 : number >v : string } diff --git a/tests/baselines/reference/computedPropertyNames20_ES5.symbols b/tests/baselines/reference/computedPropertyNames20_ES5.symbols new file mode 100644 index 00000000000..2ab61faa707 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames20_ES5.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames20_ES5.ts === +var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames20_ES5.ts, 0, 3)) + + [this.bar]: 0 +} diff --git a/tests/baselines/reference/computedPropertyNames20_ES5.types b/tests/baselines/reference/computedPropertyNames20_ES5.types index eb2bbf34b7e..91cc2c42963 100644 --- a/tests/baselines/reference/computedPropertyNames20_ES5.types +++ b/tests/baselines/reference/computedPropertyNames20_ES5.types @@ -7,4 +7,5 @@ var obj = { >this.bar : any >this : any >bar : any +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNames20_ES6.symbols b/tests/baselines/reference/computedPropertyNames20_ES6.symbols new file mode 100644 index 00000000000..f7ab8c84def --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames20_ES6.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames20_ES6.ts === +var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames20_ES6.ts, 0, 3)) + + [this.bar]: 0 +} diff --git a/tests/baselines/reference/computedPropertyNames20_ES6.types b/tests/baselines/reference/computedPropertyNames20_ES6.types index 2280c7c4820..4ef6f675cce 100644 --- a/tests/baselines/reference/computedPropertyNames20_ES6.types +++ b/tests/baselines/reference/computedPropertyNames20_ES6.types @@ -7,4 +7,5 @@ var obj = { >this.bar : any >this : any >bar : any +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNames22_ES5.symbols b/tests/baselines/reference/computedPropertyNames22_ES5.symbols new file mode 100644 index 00000000000..a1e08e5f487 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames22_ES5.symbols @@ -0,0 +1,19 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames22_ES5.ts === +class C { +>C : Symbol(C, Decl(computedPropertyNames22_ES5.ts, 0, 0)) + + bar() { +>bar : Symbol(bar, Decl(computedPropertyNames22_ES5.ts, 0, 9)) + + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames22_ES5.ts, 2, 11)) + + [this.bar()]() { } +>this.bar : Symbol(bar, Decl(computedPropertyNames22_ES5.ts, 0, 9)) +>this : Symbol(C, Decl(computedPropertyNames22_ES5.ts, 0, 0)) +>bar : Symbol(bar, Decl(computedPropertyNames22_ES5.ts, 0, 9)) + + }; + return 0; + } +} diff --git a/tests/baselines/reference/computedPropertyNames22_ES5.types b/tests/baselines/reference/computedPropertyNames22_ES5.types index 7afeeb75fa3..d3008669b4d 100644 --- a/tests/baselines/reference/computedPropertyNames22_ES5.types +++ b/tests/baselines/reference/computedPropertyNames22_ES5.types @@ -17,5 +17,6 @@ class C { }; return 0; +>0 : number } } diff --git a/tests/baselines/reference/computedPropertyNames22_ES6.symbols b/tests/baselines/reference/computedPropertyNames22_ES6.symbols new file mode 100644 index 00000000000..5940bfb4cfb --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames22_ES6.symbols @@ -0,0 +1,19 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames22_ES6.ts === +class C { +>C : Symbol(C, Decl(computedPropertyNames22_ES6.ts, 0, 0)) + + bar() { +>bar : Symbol(bar, Decl(computedPropertyNames22_ES6.ts, 0, 9)) + + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames22_ES6.ts, 2, 11)) + + [this.bar()]() { } +>this.bar : Symbol(bar, Decl(computedPropertyNames22_ES6.ts, 0, 9)) +>this : Symbol(C, Decl(computedPropertyNames22_ES6.ts, 0, 0)) +>bar : Symbol(bar, Decl(computedPropertyNames22_ES6.ts, 0, 9)) + + }; + return 0; + } +} diff --git a/tests/baselines/reference/computedPropertyNames22_ES6.types b/tests/baselines/reference/computedPropertyNames22_ES6.types index b65f276881f..0936eab29ab 100644 --- a/tests/baselines/reference/computedPropertyNames22_ES6.types +++ b/tests/baselines/reference/computedPropertyNames22_ES6.types @@ -17,5 +17,6 @@ class C { }; return 0; +>0 : number } } diff --git a/tests/baselines/reference/computedPropertyNames25_ES5.symbols b/tests/baselines/reference/computedPropertyNames25_ES5.symbols new file mode 100644 index 00000000000..e11753857cc --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames25_ES5.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames25_ES5.ts === +class Base { +>Base : Symbol(Base, Decl(computedPropertyNames25_ES5.ts, 0, 0)) + + bar() { +>bar : Symbol(bar, Decl(computedPropertyNames25_ES5.ts, 0, 12)) + + return 0; + } +} +class C extends Base { +>C : Symbol(C, Decl(computedPropertyNames25_ES5.ts, 4, 1)) +>Base : Symbol(Base, Decl(computedPropertyNames25_ES5.ts, 0, 0)) + + foo() { +>foo : Symbol(foo, Decl(computedPropertyNames25_ES5.ts, 5, 22)) + + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames25_ES5.ts, 7, 11)) + + [super.bar()]() { } +>super.bar : Symbol(Base.bar, Decl(computedPropertyNames25_ES5.ts, 0, 12)) +>super : Symbol(Base, Decl(computedPropertyNames25_ES5.ts, 0, 0)) +>bar : Symbol(Base.bar, Decl(computedPropertyNames25_ES5.ts, 0, 12)) + + }; + return 0; + } +} diff --git a/tests/baselines/reference/computedPropertyNames25_ES5.types b/tests/baselines/reference/computedPropertyNames25_ES5.types index 6f34ce35b44..6ca67cce410 100644 --- a/tests/baselines/reference/computedPropertyNames25_ES5.types +++ b/tests/baselines/reference/computedPropertyNames25_ES5.types @@ -6,6 +6,7 @@ class Base { >bar : () => number return 0; +>0 : number } } class C extends Base { @@ -27,5 +28,6 @@ class C extends Base { }; return 0; +>0 : number } } diff --git a/tests/baselines/reference/computedPropertyNames25_ES6.symbols b/tests/baselines/reference/computedPropertyNames25_ES6.symbols new file mode 100644 index 00000000000..8eb7393c6ac --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames25_ES6.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames25_ES6.ts === +class Base { +>Base : Symbol(Base, Decl(computedPropertyNames25_ES6.ts, 0, 0)) + + bar() { +>bar : Symbol(bar, Decl(computedPropertyNames25_ES6.ts, 0, 12)) + + return 0; + } +} +class C extends Base { +>C : Symbol(C, Decl(computedPropertyNames25_ES6.ts, 4, 1)) +>Base : Symbol(Base, Decl(computedPropertyNames25_ES6.ts, 0, 0)) + + foo() { +>foo : Symbol(foo, Decl(computedPropertyNames25_ES6.ts, 5, 22)) + + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames25_ES6.ts, 7, 11)) + + [super.bar()]() { } +>super.bar : Symbol(Base.bar, Decl(computedPropertyNames25_ES6.ts, 0, 12)) +>super : Symbol(Base, Decl(computedPropertyNames25_ES6.ts, 0, 0)) +>bar : Symbol(Base.bar, Decl(computedPropertyNames25_ES6.ts, 0, 12)) + + }; + return 0; + } +} diff --git a/tests/baselines/reference/computedPropertyNames25_ES6.types b/tests/baselines/reference/computedPropertyNames25_ES6.types index c008a6173cf..1c093ebc59f 100644 --- a/tests/baselines/reference/computedPropertyNames25_ES6.types +++ b/tests/baselines/reference/computedPropertyNames25_ES6.types @@ -6,6 +6,7 @@ class Base { >bar : () => number return 0; +>0 : number } } class C extends Base { @@ -27,5 +28,6 @@ class C extends Base { }; return 0; +>0 : number } } diff --git a/tests/baselines/reference/computedPropertyNames28_ES5.symbols b/tests/baselines/reference/computedPropertyNames28_ES5.symbols new file mode 100644 index 00000000000..2934c3d0401 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames28_ES5.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames28_ES5.ts === +class Base { +>Base : Symbol(Base, Decl(computedPropertyNames28_ES5.ts, 0, 0)) +} +class C extends Base { +>C : Symbol(C, Decl(computedPropertyNames28_ES5.ts, 1, 1)) +>Base : Symbol(Base, Decl(computedPropertyNames28_ES5.ts, 0, 0)) + + constructor() { + super(); +>super : Symbol(Base, Decl(computedPropertyNames28_ES5.ts, 0, 0)) + + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames28_ES5.ts, 5, 11)) + + [(super(), "prop")]() { } +>super : Symbol(Base, Decl(computedPropertyNames28_ES5.ts, 0, 0)) + + }; + } +} diff --git a/tests/baselines/reference/computedPropertyNames28_ES5.types b/tests/baselines/reference/computedPropertyNames28_ES5.types index 278576ab1ca..273dcd426d8 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES5.types +++ b/tests/baselines/reference/computedPropertyNames28_ES5.types @@ -20,6 +20,7 @@ class C extends Base { >super(), "prop" : string >super() : void >super : typeof Base +>"prop" : string }; } diff --git a/tests/baselines/reference/computedPropertyNames28_ES6.symbols b/tests/baselines/reference/computedPropertyNames28_ES6.symbols new file mode 100644 index 00000000000..6824f62e2a5 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames28_ES6.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames28_ES6.ts === +class Base { +>Base : Symbol(Base, Decl(computedPropertyNames28_ES6.ts, 0, 0)) +} +class C extends Base { +>C : Symbol(C, Decl(computedPropertyNames28_ES6.ts, 1, 1)) +>Base : Symbol(Base, Decl(computedPropertyNames28_ES6.ts, 0, 0)) + + constructor() { + super(); +>super : Symbol(Base, Decl(computedPropertyNames28_ES6.ts, 0, 0)) + + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames28_ES6.ts, 5, 11)) + + [(super(), "prop")]() { } +>super : Symbol(Base, Decl(computedPropertyNames28_ES6.ts, 0, 0)) + + }; + } +} diff --git a/tests/baselines/reference/computedPropertyNames28_ES6.types b/tests/baselines/reference/computedPropertyNames28_ES6.types index 842cdbd32e0..a34fb33f6c7 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES6.types +++ b/tests/baselines/reference/computedPropertyNames28_ES6.types @@ -20,6 +20,7 @@ class C extends Base { >super(), "prop" : string >super() : void >super : typeof Base +>"prop" : string }; } diff --git a/tests/baselines/reference/computedPropertyNames29_ES5.symbols b/tests/baselines/reference/computedPropertyNames29_ES5.symbols new file mode 100644 index 00000000000..c33a7390ce8 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames29_ES5.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames29_ES5.ts === +class C { +>C : Symbol(C, Decl(computedPropertyNames29_ES5.ts, 0, 0)) + + bar() { +>bar : Symbol(bar, Decl(computedPropertyNames29_ES5.ts, 0, 9)) + + () => { + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames29_ES5.ts, 3, 15)) + + [this.bar()]() { } // needs capture +>this.bar : Symbol(bar, Decl(computedPropertyNames29_ES5.ts, 0, 9)) +>this : Symbol(C, Decl(computedPropertyNames29_ES5.ts, 0, 0)) +>bar : Symbol(bar, Decl(computedPropertyNames29_ES5.ts, 0, 9)) + + }; + } + return 0; + } +} diff --git a/tests/baselines/reference/computedPropertyNames29_ES5.types b/tests/baselines/reference/computedPropertyNames29_ES5.types index e0da4b10da8..674343b3a1a 100644 --- a/tests/baselines/reference/computedPropertyNames29_ES5.types +++ b/tests/baselines/reference/computedPropertyNames29_ES5.types @@ -21,5 +21,6 @@ class C { }; } return 0; +>0 : number } } diff --git a/tests/baselines/reference/computedPropertyNames29_ES6.symbols b/tests/baselines/reference/computedPropertyNames29_ES6.symbols new file mode 100644 index 00000000000..41631ea63bb --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames29_ES6.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames29_ES6.ts === +class C { +>C : Symbol(C, Decl(computedPropertyNames29_ES6.ts, 0, 0)) + + bar() { +>bar : Symbol(bar, Decl(computedPropertyNames29_ES6.ts, 0, 9)) + + () => { + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames29_ES6.ts, 3, 15)) + + [this.bar()]() { } // needs capture +>this.bar : Symbol(bar, Decl(computedPropertyNames29_ES6.ts, 0, 9)) +>this : Symbol(C, Decl(computedPropertyNames29_ES6.ts, 0, 0)) +>bar : Symbol(bar, Decl(computedPropertyNames29_ES6.ts, 0, 9)) + + }; + } + return 0; + } +} diff --git a/tests/baselines/reference/computedPropertyNames29_ES6.types b/tests/baselines/reference/computedPropertyNames29_ES6.types index d520418749e..52f06bb9d88 100644 --- a/tests/baselines/reference/computedPropertyNames29_ES6.types +++ b/tests/baselines/reference/computedPropertyNames29_ES6.types @@ -21,5 +21,6 @@ class C { }; } return 0; +>0 : number } } diff --git a/tests/baselines/reference/computedPropertyNames31_ES5.symbols b/tests/baselines/reference/computedPropertyNames31_ES5.symbols new file mode 100644 index 00000000000..82a6acb286c --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames31_ES5.symbols @@ -0,0 +1,31 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames31_ES5.ts === +class Base { +>Base : Symbol(Base, Decl(computedPropertyNames31_ES5.ts, 0, 0)) + + bar() { +>bar : Symbol(bar, Decl(computedPropertyNames31_ES5.ts, 0, 12)) + + return 0; + } +} +class C extends Base { +>C : Symbol(C, Decl(computedPropertyNames31_ES5.ts, 4, 1)) +>Base : Symbol(Base, Decl(computedPropertyNames31_ES5.ts, 0, 0)) + + foo() { +>foo : Symbol(foo, Decl(computedPropertyNames31_ES5.ts, 5, 22)) + + () => { + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames31_ES5.ts, 8, 15)) + + [super.bar()]() { } // needs capture +>super.bar : Symbol(Base.bar, Decl(computedPropertyNames31_ES5.ts, 0, 12)) +>super : Symbol(Base, Decl(computedPropertyNames31_ES5.ts, 0, 0)) +>bar : Symbol(Base.bar, Decl(computedPropertyNames31_ES5.ts, 0, 12)) + + }; + } + return 0; + } +} diff --git a/tests/baselines/reference/computedPropertyNames31_ES5.types b/tests/baselines/reference/computedPropertyNames31_ES5.types index eb14b223ed3..6c0f2572a06 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES5.types +++ b/tests/baselines/reference/computedPropertyNames31_ES5.types @@ -6,6 +6,7 @@ class Base { >bar : () => number return 0; +>0 : number } } class C extends Base { @@ -31,5 +32,6 @@ class C extends Base { }; } return 0; +>0 : number } } diff --git a/tests/baselines/reference/computedPropertyNames31_ES6.js b/tests/baselines/reference/computedPropertyNames31_ES6.js index 2c63dcee077..d17423223e3 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES6.js +++ b/tests/baselines/reference/computedPropertyNames31_ES6.js @@ -23,7 +23,6 @@ class Base { } class C extends Base { foo() { - var _this = this; (() => { var obj = { [super.bar()]() { } // needs capture diff --git a/tests/baselines/reference/computedPropertyNames31_ES6.symbols b/tests/baselines/reference/computedPropertyNames31_ES6.symbols new file mode 100644 index 00000000000..778293bbb88 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames31_ES6.symbols @@ -0,0 +1,31 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames31_ES6.ts === +class Base { +>Base : Symbol(Base, Decl(computedPropertyNames31_ES6.ts, 0, 0)) + + bar() { +>bar : Symbol(bar, Decl(computedPropertyNames31_ES6.ts, 0, 12)) + + return 0; + } +} +class C extends Base { +>C : Symbol(C, Decl(computedPropertyNames31_ES6.ts, 4, 1)) +>Base : Symbol(Base, Decl(computedPropertyNames31_ES6.ts, 0, 0)) + + foo() { +>foo : Symbol(foo, Decl(computedPropertyNames31_ES6.ts, 5, 22)) + + () => { + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames31_ES6.ts, 8, 15)) + + [super.bar()]() { } // needs capture +>super.bar : Symbol(Base.bar, Decl(computedPropertyNames31_ES6.ts, 0, 12)) +>super : Symbol(Base, Decl(computedPropertyNames31_ES6.ts, 0, 0)) +>bar : Symbol(Base.bar, Decl(computedPropertyNames31_ES6.ts, 0, 12)) + + }; + } + return 0; + } +} diff --git a/tests/baselines/reference/computedPropertyNames31_ES6.types b/tests/baselines/reference/computedPropertyNames31_ES6.types index 9d835a1fac1..eaddc036812 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES6.types +++ b/tests/baselines/reference/computedPropertyNames31_ES6.types @@ -6,6 +6,7 @@ class Base { >bar : () => number return 0; +>0 : number } } class C extends Base { @@ -31,5 +32,6 @@ class C extends Base { }; } return 0; +>0 : number } } diff --git a/tests/baselines/reference/computedPropertyNames33_ES5.symbols b/tests/baselines/reference/computedPropertyNames33_ES5.symbols new file mode 100644 index 00000000000..ae6dd01e7bc --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames33_ES5.symbols @@ -0,0 +1,23 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames33_ES5.ts === +function foo() { return '' } +>foo : Symbol(foo, Decl(computedPropertyNames33_ES5.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNames33_ES5.ts, 0, 13)) + +class C { +>C : Symbol(C, Decl(computedPropertyNames33_ES5.ts, 0, 31)) +>T : Symbol(T, Decl(computedPropertyNames33_ES5.ts, 1, 8)) + + bar() { +>bar : Symbol(bar, Decl(computedPropertyNames33_ES5.ts, 1, 12)) + + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames33_ES5.ts, 3, 11)) + + [foo()]() { } +>foo : Symbol(foo, Decl(computedPropertyNames33_ES5.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNames33_ES5.ts, 1, 8)) + + }; + return 0; + } +} diff --git a/tests/baselines/reference/computedPropertyNames33_ES5.types b/tests/baselines/reference/computedPropertyNames33_ES5.types index a0d99ec8615..f44ac3ca769 100644 --- a/tests/baselines/reference/computedPropertyNames33_ES5.types +++ b/tests/baselines/reference/computedPropertyNames33_ES5.types @@ -2,6 +2,7 @@ function foo() { return '' } >foo : () => string >T : T +>'' : string class C { >C : C @@ -21,5 +22,6 @@ class C { }; return 0; +>0 : number } } diff --git a/tests/baselines/reference/computedPropertyNames33_ES6.symbols b/tests/baselines/reference/computedPropertyNames33_ES6.symbols new file mode 100644 index 00000000000..cf0b3abde96 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames33_ES6.symbols @@ -0,0 +1,23 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames33_ES6.ts === +function foo() { return '' } +>foo : Symbol(foo, Decl(computedPropertyNames33_ES6.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNames33_ES6.ts, 0, 13)) + +class C { +>C : Symbol(C, Decl(computedPropertyNames33_ES6.ts, 0, 31)) +>T : Symbol(T, Decl(computedPropertyNames33_ES6.ts, 1, 8)) + + bar() { +>bar : Symbol(bar, Decl(computedPropertyNames33_ES6.ts, 1, 12)) + + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames33_ES6.ts, 3, 11)) + + [foo()]() { } +>foo : Symbol(foo, Decl(computedPropertyNames33_ES6.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNames33_ES6.ts, 1, 8)) + + }; + return 0; + } +} diff --git a/tests/baselines/reference/computedPropertyNames33_ES6.types b/tests/baselines/reference/computedPropertyNames33_ES6.types index 331bd2b3e09..3081337c8bb 100644 --- a/tests/baselines/reference/computedPropertyNames33_ES6.types +++ b/tests/baselines/reference/computedPropertyNames33_ES6.types @@ -2,6 +2,7 @@ function foo() { return '' } >foo : () => string >T : T +>'' : string class C { >C : C @@ -21,5 +22,6 @@ class C { }; return 0; +>0 : number } } diff --git a/tests/baselines/reference/computedPropertyNames37_ES5.symbols b/tests/baselines/reference/computedPropertyNames37_ES5.symbols new file mode 100644 index 00000000000..7932b2c8fdc --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames37_ES5.symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames37_ES5.ts === +class Foo { x } +>Foo : Symbol(Foo, Decl(computedPropertyNames37_ES5.ts, 0, 0)) +>x : Symbol(x, Decl(computedPropertyNames37_ES5.ts, 0, 11)) + +class Foo2 { x; y } +>Foo2 : Symbol(Foo2, Decl(computedPropertyNames37_ES5.ts, 0, 15)) +>x : Symbol(x, Decl(computedPropertyNames37_ES5.ts, 1, 12)) +>y : Symbol(y, Decl(computedPropertyNames37_ES5.ts, 1, 15)) + +class C { +>C : Symbol(C, Decl(computedPropertyNames37_ES5.ts, 1, 19)) + + [s: number]: Foo2; +>s : Symbol(s, Decl(computedPropertyNames37_ES5.ts, 4, 5)) +>Foo2 : Symbol(Foo2, Decl(computedPropertyNames37_ES5.ts, 0, 15)) + + // Computed properties + get ["get1"]() { return new Foo } +>Foo : Symbol(Foo, Decl(computedPropertyNames37_ES5.ts, 0, 0)) + + set ["set1"](p: Foo2) { } +>p : Symbol(p, Decl(computedPropertyNames37_ES5.ts, 8, 17)) +>Foo2 : Symbol(Foo2, Decl(computedPropertyNames37_ES5.ts, 0, 15)) +} diff --git a/tests/baselines/reference/computedPropertyNames37_ES5.types b/tests/baselines/reference/computedPropertyNames37_ES5.types index a12324003bf..21b68c7c12c 100644 --- a/tests/baselines/reference/computedPropertyNames37_ES5.types +++ b/tests/baselines/reference/computedPropertyNames37_ES5.types @@ -17,10 +17,12 @@ class C { // Computed properties get ["get1"]() { return new Foo } +>"get1" : string >new Foo : Foo >Foo : typeof Foo set ["set1"](p: Foo2) { } +>"set1" : string >p : Foo2 >Foo2 : Foo2 } diff --git a/tests/baselines/reference/computedPropertyNames37_ES6.symbols b/tests/baselines/reference/computedPropertyNames37_ES6.symbols new file mode 100644 index 00000000000..f4439ef4f92 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames37_ES6.symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames37_ES6.ts === +class Foo { x } +>Foo : Symbol(Foo, Decl(computedPropertyNames37_ES6.ts, 0, 0)) +>x : Symbol(x, Decl(computedPropertyNames37_ES6.ts, 0, 11)) + +class Foo2 { x; y } +>Foo2 : Symbol(Foo2, Decl(computedPropertyNames37_ES6.ts, 0, 15)) +>x : Symbol(x, Decl(computedPropertyNames37_ES6.ts, 1, 12)) +>y : Symbol(y, Decl(computedPropertyNames37_ES6.ts, 1, 15)) + +class C { +>C : Symbol(C, Decl(computedPropertyNames37_ES6.ts, 1, 19)) + + [s: number]: Foo2; +>s : Symbol(s, Decl(computedPropertyNames37_ES6.ts, 4, 5)) +>Foo2 : Symbol(Foo2, Decl(computedPropertyNames37_ES6.ts, 0, 15)) + + // Computed properties + get ["get1"]() { return new Foo } +>Foo : Symbol(Foo, Decl(computedPropertyNames37_ES6.ts, 0, 0)) + + set ["set1"](p: Foo2) { } +>p : Symbol(p, Decl(computedPropertyNames37_ES6.ts, 8, 17)) +>Foo2 : Symbol(Foo2, Decl(computedPropertyNames37_ES6.ts, 0, 15)) +} diff --git a/tests/baselines/reference/computedPropertyNames37_ES6.types b/tests/baselines/reference/computedPropertyNames37_ES6.types index 288685f0e02..e436a54172b 100644 --- a/tests/baselines/reference/computedPropertyNames37_ES6.types +++ b/tests/baselines/reference/computedPropertyNames37_ES6.types @@ -17,10 +17,12 @@ class C { // Computed properties get ["get1"]() { return new Foo } +>"get1" : string >new Foo : Foo >Foo : typeof Foo set ["set1"](p: Foo2) { } +>"set1" : string >p : Foo2 >Foo2 : Foo2 } diff --git a/tests/baselines/reference/computedPropertyNames41_ES5.symbols b/tests/baselines/reference/computedPropertyNames41_ES5.symbols new file mode 100644 index 00000000000..e1438568f24 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames41_ES5.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames41_ES5.ts === +class Foo { x } +>Foo : Symbol(Foo, Decl(computedPropertyNames41_ES5.ts, 0, 0)) +>x : Symbol(x, Decl(computedPropertyNames41_ES5.ts, 0, 11)) + +class Foo2 { x; y } +>Foo2 : Symbol(Foo2, Decl(computedPropertyNames41_ES5.ts, 0, 15)) +>x : Symbol(x, Decl(computedPropertyNames41_ES5.ts, 1, 12)) +>y : Symbol(y, Decl(computedPropertyNames41_ES5.ts, 1, 15)) + +class C { +>C : Symbol(C, Decl(computedPropertyNames41_ES5.ts, 1, 19)) + + [s: string]: () => Foo2; +>s : Symbol(s, Decl(computedPropertyNames41_ES5.ts, 4, 5)) +>Foo2 : Symbol(Foo2, Decl(computedPropertyNames41_ES5.ts, 0, 15)) + + // Computed properties + static [""]() { return new Foo } +>Foo : Symbol(Foo, Decl(computedPropertyNames41_ES5.ts, 0, 0)) +} diff --git a/tests/baselines/reference/computedPropertyNames41_ES5.types b/tests/baselines/reference/computedPropertyNames41_ES5.types index aac087ee958..5aa7ae44404 100644 --- a/tests/baselines/reference/computedPropertyNames41_ES5.types +++ b/tests/baselines/reference/computedPropertyNames41_ES5.types @@ -17,6 +17,7 @@ class C { // Computed properties static [""]() { return new Foo } +>"" : string >new Foo : Foo >Foo : typeof Foo } diff --git a/tests/baselines/reference/computedPropertyNames41_ES6.symbols b/tests/baselines/reference/computedPropertyNames41_ES6.symbols new file mode 100644 index 00000000000..3f4a7dff621 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames41_ES6.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames41_ES6.ts === +class Foo { x } +>Foo : Symbol(Foo, Decl(computedPropertyNames41_ES6.ts, 0, 0)) +>x : Symbol(x, Decl(computedPropertyNames41_ES6.ts, 0, 11)) + +class Foo2 { x; y } +>Foo2 : Symbol(Foo2, Decl(computedPropertyNames41_ES6.ts, 0, 15)) +>x : Symbol(x, Decl(computedPropertyNames41_ES6.ts, 1, 12)) +>y : Symbol(y, Decl(computedPropertyNames41_ES6.ts, 1, 15)) + +class C { +>C : Symbol(C, Decl(computedPropertyNames41_ES6.ts, 1, 19)) + + [s: string]: () => Foo2; +>s : Symbol(s, Decl(computedPropertyNames41_ES6.ts, 4, 5)) +>Foo2 : Symbol(Foo2, Decl(computedPropertyNames41_ES6.ts, 0, 15)) + + // Computed properties + static [""]() { return new Foo } +>Foo : Symbol(Foo, Decl(computedPropertyNames41_ES6.ts, 0, 0)) +} diff --git a/tests/baselines/reference/computedPropertyNames41_ES6.types b/tests/baselines/reference/computedPropertyNames41_ES6.types index ffb3387d161..70bfcf12a75 100644 --- a/tests/baselines/reference/computedPropertyNames41_ES6.types +++ b/tests/baselines/reference/computedPropertyNames41_ES6.types @@ -17,6 +17,7 @@ class C { // Computed properties static [""]() { return new Foo } +>"" : string >new Foo : Foo >Foo : typeof Foo } diff --git a/tests/baselines/reference/computedPropertyNames46_ES5.symbols b/tests/baselines/reference/computedPropertyNames46_ES5.symbols new file mode 100644 index 00000000000..10a7cf0b528 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames46_ES5.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames46_ES5.ts === +var o = { +>o : Symbol(o, Decl(computedPropertyNames46_ES5.ts, 0, 3)) + + ["" || 0]: 0 +}; diff --git a/tests/baselines/reference/computedPropertyNames46_ES5.types b/tests/baselines/reference/computedPropertyNames46_ES5.types index bdc2f2cf644..394b22bd904 100644 --- a/tests/baselines/reference/computedPropertyNames46_ES5.types +++ b/tests/baselines/reference/computedPropertyNames46_ES5.types @@ -5,5 +5,8 @@ var o = { ["" || 0]: 0 >"" || 0 : string | number +>"" : string +>0 : number +>0 : number }; diff --git a/tests/baselines/reference/computedPropertyNames46_ES6.symbols b/tests/baselines/reference/computedPropertyNames46_ES6.symbols new file mode 100644 index 00000000000..3028eb8e225 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames46_ES6.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames46_ES6.ts === +var o = { +>o : Symbol(o, Decl(computedPropertyNames46_ES6.ts, 0, 3)) + + ["" || 0]: 0 +}; diff --git a/tests/baselines/reference/computedPropertyNames46_ES6.types b/tests/baselines/reference/computedPropertyNames46_ES6.types index 7abb10f1ba5..864fd81321d 100644 --- a/tests/baselines/reference/computedPropertyNames46_ES6.types +++ b/tests/baselines/reference/computedPropertyNames46_ES6.types @@ -5,5 +5,8 @@ var o = { ["" || 0]: 0 >"" || 0 : string | number +>"" : string +>0 : number +>0 : number }; diff --git a/tests/baselines/reference/computedPropertyNames47_ES5.symbols b/tests/baselines/reference/computedPropertyNames47_ES5.symbols new file mode 100644 index 00000000000..c124850e5a6 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames47_ES5.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames47_ES5.ts === +enum E1 { x } +>E1 : Symbol(E1, Decl(computedPropertyNames47_ES5.ts, 0, 0)) +>x : Symbol(E1.x, Decl(computedPropertyNames47_ES5.ts, 0, 9)) + +enum E2 { x } +>E2 : Symbol(E2, Decl(computedPropertyNames47_ES5.ts, 0, 13)) +>x : Symbol(E2.x, Decl(computedPropertyNames47_ES5.ts, 1, 9)) + +var o = { +>o : Symbol(o, Decl(computedPropertyNames47_ES5.ts, 2, 3)) + + [E1.x || E2.x]: 0 +>E1.x : Symbol(E1.x, Decl(computedPropertyNames47_ES5.ts, 0, 9)) +>E1 : Symbol(E1, Decl(computedPropertyNames47_ES5.ts, 0, 0)) +>x : Symbol(E1.x, Decl(computedPropertyNames47_ES5.ts, 0, 9)) +>E2.x : Symbol(E2.x, Decl(computedPropertyNames47_ES5.ts, 1, 9)) +>E2 : Symbol(E2, Decl(computedPropertyNames47_ES5.ts, 0, 13)) +>x : Symbol(E2.x, Decl(computedPropertyNames47_ES5.ts, 1, 9)) + +}; diff --git a/tests/baselines/reference/computedPropertyNames47_ES5.types b/tests/baselines/reference/computedPropertyNames47_ES5.types index c79f2b20946..6aa841ffd62 100644 --- a/tests/baselines/reference/computedPropertyNames47_ES5.types +++ b/tests/baselines/reference/computedPropertyNames47_ES5.types @@ -19,5 +19,6 @@ var o = { >E2.x : E2 >E2 : typeof E2 >x : E2 +>0 : number }; diff --git a/tests/baselines/reference/computedPropertyNames47_ES6.symbols b/tests/baselines/reference/computedPropertyNames47_ES6.symbols new file mode 100644 index 00000000000..ec0850d5b13 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames47_ES6.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames47_ES6.ts === +enum E1 { x } +>E1 : Symbol(E1, Decl(computedPropertyNames47_ES6.ts, 0, 0)) +>x : Symbol(E1.x, Decl(computedPropertyNames47_ES6.ts, 0, 9)) + +enum E2 { x } +>E2 : Symbol(E2, Decl(computedPropertyNames47_ES6.ts, 0, 13)) +>x : Symbol(E2.x, Decl(computedPropertyNames47_ES6.ts, 1, 9)) + +var o = { +>o : Symbol(o, Decl(computedPropertyNames47_ES6.ts, 2, 3)) + + [E1.x || E2.x]: 0 +>E1.x : Symbol(E1.x, Decl(computedPropertyNames47_ES6.ts, 0, 9)) +>E1 : Symbol(E1, Decl(computedPropertyNames47_ES6.ts, 0, 0)) +>x : Symbol(E1.x, Decl(computedPropertyNames47_ES6.ts, 0, 9)) +>E2.x : Symbol(E2.x, Decl(computedPropertyNames47_ES6.ts, 1, 9)) +>E2 : Symbol(E2, Decl(computedPropertyNames47_ES6.ts, 0, 13)) +>x : Symbol(E2.x, Decl(computedPropertyNames47_ES6.ts, 1, 9)) + +}; diff --git a/tests/baselines/reference/computedPropertyNames47_ES6.types b/tests/baselines/reference/computedPropertyNames47_ES6.types index 840d77754cf..f038b172ca1 100644 --- a/tests/baselines/reference/computedPropertyNames47_ES6.types +++ b/tests/baselines/reference/computedPropertyNames47_ES6.types @@ -19,5 +19,6 @@ var o = { >E2.x : E2 >E2 : typeof E2 >x : E2 +>0 : number }; diff --git a/tests/baselines/reference/computedPropertyNames48_ES5.symbols b/tests/baselines/reference/computedPropertyNames48_ES5.symbols new file mode 100644 index 00000000000..14f7cc6352d --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames48_ES5.symbols @@ -0,0 +1,39 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames48_ES5.ts === +declare function extractIndexer(p: { [n: number]: T }): T; +>extractIndexer : Symbol(extractIndexer, Decl(computedPropertyNames48_ES5.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNames48_ES5.ts, 0, 32)) +>p : Symbol(p, Decl(computedPropertyNames48_ES5.ts, 0, 35)) +>n : Symbol(n, Decl(computedPropertyNames48_ES5.ts, 0, 41)) +>T : Symbol(T, Decl(computedPropertyNames48_ES5.ts, 0, 32)) +>T : Symbol(T, Decl(computedPropertyNames48_ES5.ts, 0, 32)) + +enum E { x } +>E : Symbol(E, Decl(computedPropertyNames48_ES5.ts, 0, 61)) +>x : Symbol(E.x, Decl(computedPropertyNames48_ES5.ts, 2, 8)) + +var a: any; +>a : Symbol(a, Decl(computedPropertyNames48_ES5.ts, 4, 3)) + +extractIndexer({ +>extractIndexer : Symbol(extractIndexer, Decl(computedPropertyNames48_ES5.ts, 0, 0)) + + [a]: "" +>a : Symbol(a, Decl(computedPropertyNames48_ES5.ts, 4, 3)) + +}); // Should return string + +extractIndexer({ +>extractIndexer : Symbol(extractIndexer, Decl(computedPropertyNames48_ES5.ts, 0, 0)) + + [E.x]: "" +>E.x : Symbol(E.x, Decl(computedPropertyNames48_ES5.ts, 2, 8)) +>E : Symbol(E, Decl(computedPropertyNames48_ES5.ts, 0, 61)) +>x : Symbol(E.x, Decl(computedPropertyNames48_ES5.ts, 2, 8)) + +}); // Should return string + +extractIndexer({ +>extractIndexer : Symbol(extractIndexer, Decl(computedPropertyNames48_ES5.ts, 0, 0)) + + ["" || 0]: "" +}); // Should return any (widened form of undefined) diff --git a/tests/baselines/reference/computedPropertyNames48_ES5.types b/tests/baselines/reference/computedPropertyNames48_ES5.types index 3ff4c966e89..2b9131a11c8 100644 --- a/tests/baselines/reference/computedPropertyNames48_ES5.types +++ b/tests/baselines/reference/computedPropertyNames48_ES5.types @@ -21,6 +21,7 @@ extractIndexer({ [a]: "" >a : any +>"" : string }); // Should return string @@ -33,6 +34,7 @@ extractIndexer({ >E.x : E >E : typeof E >x : E +>"" : string }); // Should return string @@ -43,5 +45,8 @@ extractIndexer({ ["" || 0]: "" >"" || 0 : string | number +>"" : string +>0 : number +>"" : string }); // Should return any (widened form of undefined) diff --git a/tests/baselines/reference/computedPropertyNames48_ES6.symbols b/tests/baselines/reference/computedPropertyNames48_ES6.symbols new file mode 100644 index 00000000000..5d63c9f495d --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames48_ES6.symbols @@ -0,0 +1,39 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames48_ES6.ts === +declare function extractIndexer(p: { [n: number]: T }): T; +>extractIndexer : Symbol(extractIndexer, Decl(computedPropertyNames48_ES6.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNames48_ES6.ts, 0, 32)) +>p : Symbol(p, Decl(computedPropertyNames48_ES6.ts, 0, 35)) +>n : Symbol(n, Decl(computedPropertyNames48_ES6.ts, 0, 41)) +>T : Symbol(T, Decl(computedPropertyNames48_ES6.ts, 0, 32)) +>T : Symbol(T, Decl(computedPropertyNames48_ES6.ts, 0, 32)) + +enum E { x } +>E : Symbol(E, Decl(computedPropertyNames48_ES6.ts, 0, 61)) +>x : Symbol(E.x, Decl(computedPropertyNames48_ES6.ts, 2, 8)) + +var a: any; +>a : Symbol(a, Decl(computedPropertyNames48_ES6.ts, 4, 3)) + +extractIndexer({ +>extractIndexer : Symbol(extractIndexer, Decl(computedPropertyNames48_ES6.ts, 0, 0)) + + [a]: "" +>a : Symbol(a, Decl(computedPropertyNames48_ES6.ts, 4, 3)) + +}); // Should return string + +extractIndexer({ +>extractIndexer : Symbol(extractIndexer, Decl(computedPropertyNames48_ES6.ts, 0, 0)) + + [E.x]: "" +>E.x : Symbol(E.x, Decl(computedPropertyNames48_ES6.ts, 2, 8)) +>E : Symbol(E, Decl(computedPropertyNames48_ES6.ts, 0, 61)) +>x : Symbol(E.x, Decl(computedPropertyNames48_ES6.ts, 2, 8)) + +}); // Should return string + +extractIndexer({ +>extractIndexer : Symbol(extractIndexer, Decl(computedPropertyNames48_ES6.ts, 0, 0)) + + ["" || 0]: "" +}); // Should return any (widened form of undefined) diff --git a/tests/baselines/reference/computedPropertyNames48_ES6.types b/tests/baselines/reference/computedPropertyNames48_ES6.types index e10f078d11f..2b803b19bd6 100644 --- a/tests/baselines/reference/computedPropertyNames48_ES6.types +++ b/tests/baselines/reference/computedPropertyNames48_ES6.types @@ -21,6 +21,7 @@ extractIndexer({ [a]: "" >a : any +>"" : string }); // Should return string @@ -33,6 +34,7 @@ extractIndexer({ >E.x : E >E : typeof E >x : E +>"" : string }); // Should return string @@ -43,5 +45,8 @@ extractIndexer({ ["" || 0]: "" >"" || 0 : string | number +>"" : string +>0 : number +>"" : string }); // Should return any (widened form of undefined) diff --git a/tests/baselines/reference/computedPropertyNames4_ES5.symbols b/tests/baselines/reference/computedPropertyNames4_ES5.symbols new file mode 100644 index 00000000000..be201486286 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames4_ES5.symbols @@ -0,0 +1,42 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames4_ES5.ts === +var s: string; +>s : Symbol(s, Decl(computedPropertyNames4_ES5.ts, 0, 3)) + +var n: number; +>n : Symbol(n, Decl(computedPropertyNames4_ES5.ts, 1, 3)) + +var a: any; +>a : Symbol(a, Decl(computedPropertyNames4_ES5.ts, 2, 3)) + +var v = { +>v : Symbol(v, Decl(computedPropertyNames4_ES5.ts, 3, 3)) + + [s]: 0, +>s : Symbol(s, Decl(computedPropertyNames4_ES5.ts, 0, 3)) + + [n]: n, +>n : Symbol(n, Decl(computedPropertyNames4_ES5.ts, 1, 3)) +>n : Symbol(n, Decl(computedPropertyNames4_ES5.ts, 1, 3)) + + [s + s]: 1, +>s : Symbol(s, Decl(computedPropertyNames4_ES5.ts, 0, 3)) +>s : Symbol(s, Decl(computedPropertyNames4_ES5.ts, 0, 3)) + + [s + n]: 2, +>s : Symbol(s, Decl(computedPropertyNames4_ES5.ts, 0, 3)) +>n : Symbol(n, Decl(computedPropertyNames4_ES5.ts, 1, 3)) + + [+s]: s, +>s : Symbol(s, Decl(computedPropertyNames4_ES5.ts, 0, 3)) +>s : Symbol(s, Decl(computedPropertyNames4_ES5.ts, 0, 3)) + + [""]: 0, + [0]: 0, + [a]: 1, +>a : Symbol(a, Decl(computedPropertyNames4_ES5.ts, 2, 3)) + + [true]: 0, + [`hello bye`]: 0, + [`hello ${a} bye`]: 0 +>a : Symbol(a, Decl(computedPropertyNames4_ES5.ts, 2, 3)) +} diff --git a/tests/baselines/reference/computedPropertyNames4_ES5.types b/tests/baselines/reference/computedPropertyNames4_ES5.types index 7c26cae6444..51baca26586 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES5.types +++ b/tests/baselines/reference/computedPropertyNames4_ES5.types @@ -14,6 +14,7 @@ var v = { [s]: 0, >s : string +>0 : number [n]: n, >n : number @@ -23,11 +24,13 @@ var v = { >s + s : string >s : string >s : string +>1 : number [s + n]: 2, >s + n : string >s : string >n : number +>2 : number [+s]: s, >+s : number @@ -35,14 +38,28 @@ var v = { >s : string [""]: 0, +>"" : string +>0 : number + [0]: 0, +>0 : number +>0 : number + [a]: 1, >a : any +>1 : number [true]: 0, >true : any +>true : boolean +>0 : number [`hello bye`]: 0, +>`hello bye` : string +>0 : number + [`hello ${a} bye`]: 0 +>`hello ${a} bye` : string >a : any +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNames4_ES6.symbols b/tests/baselines/reference/computedPropertyNames4_ES6.symbols new file mode 100644 index 00000000000..b531a1b3d28 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames4_ES6.symbols @@ -0,0 +1,42 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames4_ES6.ts === +var s: string; +>s : Symbol(s, Decl(computedPropertyNames4_ES6.ts, 0, 3)) + +var n: number; +>n : Symbol(n, Decl(computedPropertyNames4_ES6.ts, 1, 3)) + +var a: any; +>a : Symbol(a, Decl(computedPropertyNames4_ES6.ts, 2, 3)) + +var v = { +>v : Symbol(v, Decl(computedPropertyNames4_ES6.ts, 3, 3)) + + [s]: 0, +>s : Symbol(s, Decl(computedPropertyNames4_ES6.ts, 0, 3)) + + [n]: n, +>n : Symbol(n, Decl(computedPropertyNames4_ES6.ts, 1, 3)) +>n : Symbol(n, Decl(computedPropertyNames4_ES6.ts, 1, 3)) + + [s + s]: 1, +>s : Symbol(s, Decl(computedPropertyNames4_ES6.ts, 0, 3)) +>s : Symbol(s, Decl(computedPropertyNames4_ES6.ts, 0, 3)) + + [s + n]: 2, +>s : Symbol(s, Decl(computedPropertyNames4_ES6.ts, 0, 3)) +>n : Symbol(n, Decl(computedPropertyNames4_ES6.ts, 1, 3)) + + [+s]: s, +>s : Symbol(s, Decl(computedPropertyNames4_ES6.ts, 0, 3)) +>s : Symbol(s, Decl(computedPropertyNames4_ES6.ts, 0, 3)) + + [""]: 0, + [0]: 0, + [a]: 1, +>a : Symbol(a, Decl(computedPropertyNames4_ES6.ts, 2, 3)) + + [true]: 0, + [`hello bye`]: 0, + [`hello ${a} bye`]: 0 +>a : Symbol(a, Decl(computedPropertyNames4_ES6.ts, 2, 3)) +} diff --git a/tests/baselines/reference/computedPropertyNames4_ES6.types b/tests/baselines/reference/computedPropertyNames4_ES6.types index 973dfbec3a5..05267049517 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES6.types +++ b/tests/baselines/reference/computedPropertyNames4_ES6.types @@ -14,6 +14,7 @@ var v = { [s]: 0, >s : string +>0 : number [n]: n, >n : number @@ -23,11 +24,13 @@ var v = { >s + s : string >s : string >s : string +>1 : number [s + n]: 2, >s + n : string >s : string >n : number +>2 : number [+s]: s, >+s : number @@ -35,14 +38,28 @@ var v = { >s : string [""]: 0, +>"" : string +>0 : number + [0]: 0, +>0 : number +>0 : number + [a]: 1, >a : any +>1 : number [true]: 0, >true : any +>true : boolean +>0 : number [`hello bye`]: 0, +>`hello bye` : string +>0 : number + [`hello ${a} bye`]: 0 +>`hello ${a} bye` : string >a : any +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNames7_ES5.symbols b/tests/baselines/reference/computedPropertyNames7_ES5.symbols new file mode 100644 index 00000000000..7f5e7c0fd46 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames7_ES5.symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames7_ES5.ts === +enum E { +>E : Symbol(E, Decl(computedPropertyNames7_ES5.ts, 0, 0)) + + member +>member : Symbol(E.member, Decl(computedPropertyNames7_ES5.ts, 0, 8)) +} +var v = { +>v : Symbol(v, Decl(computedPropertyNames7_ES5.ts, 3, 3)) + + [E.member]: 0 +>E.member : Symbol(E.member, Decl(computedPropertyNames7_ES5.ts, 0, 8)) +>E : Symbol(E, Decl(computedPropertyNames7_ES5.ts, 0, 0)) +>member : Symbol(E.member, Decl(computedPropertyNames7_ES5.ts, 0, 8)) +} diff --git a/tests/baselines/reference/computedPropertyNames7_ES5.types b/tests/baselines/reference/computedPropertyNames7_ES5.types index 209e07769c0..8ebd4d75668 100644 --- a/tests/baselines/reference/computedPropertyNames7_ES5.types +++ b/tests/baselines/reference/computedPropertyNames7_ES5.types @@ -13,4 +13,5 @@ var v = { >E.member : E >E : typeof E >member : E +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNames7_ES6.symbols b/tests/baselines/reference/computedPropertyNames7_ES6.symbols new file mode 100644 index 00000000000..b008d47a843 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames7_ES6.symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames7_ES6.ts === +enum E { +>E : Symbol(E, Decl(computedPropertyNames7_ES6.ts, 0, 0)) + + member +>member : Symbol(E.member, Decl(computedPropertyNames7_ES6.ts, 0, 8)) +} +var v = { +>v : Symbol(v, Decl(computedPropertyNames7_ES6.ts, 3, 3)) + + [E.member]: 0 +>E.member : Symbol(E.member, Decl(computedPropertyNames7_ES6.ts, 0, 8)) +>E : Symbol(E, Decl(computedPropertyNames7_ES6.ts, 0, 0)) +>member : Symbol(E.member, Decl(computedPropertyNames7_ES6.ts, 0, 8)) +} diff --git a/tests/baselines/reference/computedPropertyNames7_ES6.types b/tests/baselines/reference/computedPropertyNames7_ES6.types index 371176acc16..3a78b9c0ec6 100644 --- a/tests/baselines/reference/computedPropertyNames7_ES6.types +++ b/tests/baselines/reference/computedPropertyNames7_ES6.types @@ -13,4 +13,5 @@ var v = { >E.member : E >E : typeof E >member : E +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.symbols b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.symbols new file mode 100644 index 00000000000..a99a3899725 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType1_ES5.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType1_ES5.ts, 0, 0)) + + [s: string]: (x: string) => number; +>s : Symbol(s, Decl(computedPropertyNamesContextualType1_ES5.ts, 1, 5)) +>x : Symbol(x, Decl(computedPropertyNamesContextualType1_ES5.ts, 1, 18)) + + [s: number]: (x: any) => number; // Doesn't get hit +>s : Symbol(s, Decl(computedPropertyNamesContextualType1_ES5.ts, 2, 5)) +>x : Symbol(x, Decl(computedPropertyNamesContextualType1_ES5.ts, 2, 18)) +} + +var o: I = { +>o : Symbol(o, Decl(computedPropertyNamesContextualType1_ES5.ts, 5, 3)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType1_ES5.ts, 0, 0)) + + ["" + 0](y) { return y.length; }, +>y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES5.ts, 6, 13)) +>y.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES5.ts, 6, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + + ["" + 1]: y => y.length +>y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES5.ts, 7, 13)) +>y.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES5.ts, 7, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +} diff --git a/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.types index ad7ddc30567..bea7267d7d1 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.types @@ -18,6 +18,8 @@ var o: I = { ["" + 0](y) { return y.length; }, >"" + 0 : string +>"" : string +>0 : number >y : string >y.length : number >y : string @@ -25,6 +27,8 @@ var o: I = { ["" + 1]: y => y.length >"" + 1 : string +>"" : string +>1 : number >y => y.length : (y: string) => number >y : string >y.length : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.symbols new file mode 100644 index 00000000000..e386b8e9efa --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType1_ES6.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType1_ES6.ts, 0, 0)) + + [s: string]: (x: string) => number; +>s : Symbol(s, Decl(computedPropertyNamesContextualType1_ES6.ts, 1, 5)) +>x : Symbol(x, Decl(computedPropertyNamesContextualType1_ES6.ts, 1, 18)) + + [s: number]: (x: any) => number; // Doesn't get hit +>s : Symbol(s, Decl(computedPropertyNamesContextualType1_ES6.ts, 2, 5)) +>x : Symbol(x, Decl(computedPropertyNamesContextualType1_ES6.ts, 2, 18)) +} + +var o: I = { +>o : Symbol(o, Decl(computedPropertyNamesContextualType1_ES6.ts, 5, 3)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType1_ES6.ts, 0, 0)) + + ["" + 0](y) { return y.length; }, +>y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES6.ts, 6, 13)) +>y.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES6.ts, 6, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + + ["" + 1]: y => y.length +>y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES6.ts, 7, 13)) +>y.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES6.ts, 7, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +} diff --git a/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.types index 44bc8a51113..c8d0be6e833 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.types @@ -18,6 +18,8 @@ var o: I = { ["" + 0](y) { return y.length; }, >"" + 0 : string +>"" : string +>0 : number >y : string >y.length : number >y : string @@ -25,6 +27,8 @@ var o: I = { ["" + 1]: y => y.length >"" + 1 : string +>"" : string +>1 : number >y => y.length : (y: string) => number >y : string >y.length : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.symbols b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.symbols new file mode 100644 index 00000000000..fcd89e032e6 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType2_ES5.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType2_ES5.ts, 0, 0)) + + [s: string]: (x: any) => number; // Doesn't get hit +>s : Symbol(s, Decl(computedPropertyNamesContextualType2_ES5.ts, 1, 5)) +>x : Symbol(x, Decl(computedPropertyNamesContextualType2_ES5.ts, 1, 18)) + + [s: number]: (x: string) => number; +>s : Symbol(s, Decl(computedPropertyNamesContextualType2_ES5.ts, 2, 5)) +>x : Symbol(x, Decl(computedPropertyNamesContextualType2_ES5.ts, 2, 18)) +} + +var o: I = { +>o : Symbol(o, Decl(computedPropertyNamesContextualType2_ES5.ts, 5, 3)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType2_ES5.ts, 0, 0)) + + [+"foo"](y) { return y.length; }, +>y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES5.ts, 6, 13)) +>y.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES5.ts, 6, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + + [+"bar"]: y => y.length +>y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES5.ts, 7, 13)) +>y.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES5.ts, 7, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +} diff --git a/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.types index 0c1b9490abe..52de216b803 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.types @@ -18,6 +18,7 @@ var o: I = { [+"foo"](y) { return y.length; }, >+"foo" : number +>"foo" : string >y : string >y.length : number >y : string @@ -25,6 +26,7 @@ var o: I = { [+"bar"]: y => y.length >+"bar" : number +>"bar" : string >y => y.length : (y: string) => number >y : string >y.length : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.symbols new file mode 100644 index 00000000000..ce6be5194c0 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType2_ES6.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType2_ES6.ts, 0, 0)) + + [s: string]: (x: any) => number; // Doesn't get hit +>s : Symbol(s, Decl(computedPropertyNamesContextualType2_ES6.ts, 1, 5)) +>x : Symbol(x, Decl(computedPropertyNamesContextualType2_ES6.ts, 1, 18)) + + [s: number]: (x: string) => number; +>s : Symbol(s, Decl(computedPropertyNamesContextualType2_ES6.ts, 2, 5)) +>x : Symbol(x, Decl(computedPropertyNamesContextualType2_ES6.ts, 2, 18)) +} + +var o: I = { +>o : Symbol(o, Decl(computedPropertyNamesContextualType2_ES6.ts, 5, 3)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType2_ES6.ts, 0, 0)) + + [+"foo"](y) { return y.length; }, +>y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES6.ts, 6, 13)) +>y.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES6.ts, 6, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + + [+"bar"]: y => y.length +>y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES6.ts, 7, 13)) +>y.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES6.ts, 7, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +} diff --git a/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.types index 222004cf8e3..cbbe0edc6a1 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.types @@ -18,6 +18,7 @@ var o: I = { [+"foo"](y) { return y.length; }, >+"foo" : number +>"foo" : string >y : string >y.length : number >y : string @@ -25,6 +26,7 @@ var o: I = { [+"bar"]: y => y.length >+"bar" : number +>"bar" : string >y => y.length : (y: string) => number >y : string >y.length : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.symbols b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.symbols new file mode 100644 index 00000000000..d73c9c186d4 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType3_ES5.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType3_ES5.ts, 0, 0)) + + [s: string]: (x: string) => number; +>s : Symbol(s, Decl(computedPropertyNamesContextualType3_ES5.ts, 1, 5)) +>x : Symbol(x, Decl(computedPropertyNamesContextualType3_ES5.ts, 1, 18)) +} + +var o: I = { +>o : Symbol(o, Decl(computedPropertyNamesContextualType3_ES5.ts, 4, 3)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType3_ES5.ts, 0, 0)) + + [+"foo"](y) { return y.length; }, +>y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES5.ts, 5, 13)) +>y.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES5.ts, 5, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + + [+"bar"]: y => y.length +>y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES5.ts, 6, 13)) +>y.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES5.ts, 6, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +} diff --git a/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.types index 482d58c3ee0..5f647fb4c1b 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.types @@ -14,6 +14,7 @@ var o: I = { [+"foo"](y) { return y.length; }, >+"foo" : number +>"foo" : string >y : string >y.length : number >y : string @@ -21,6 +22,7 @@ var o: I = { [+"bar"]: y => y.length >+"bar" : number +>"bar" : string >y => y.length : (y: string) => number >y : string >y.length : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.symbols new file mode 100644 index 00000000000..48e93ee62f9 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType3_ES6.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType3_ES6.ts, 0, 0)) + + [s: string]: (x: string) => number; +>s : Symbol(s, Decl(computedPropertyNamesContextualType3_ES6.ts, 1, 5)) +>x : Symbol(x, Decl(computedPropertyNamesContextualType3_ES6.ts, 1, 18)) +} + +var o: I = { +>o : Symbol(o, Decl(computedPropertyNamesContextualType3_ES6.ts, 4, 3)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType3_ES6.ts, 0, 0)) + + [+"foo"](y) { return y.length; }, +>y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES6.ts, 5, 13)) +>y.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES6.ts, 5, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + + [+"bar"]: y => y.length +>y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES6.ts, 6, 13)) +>y.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES6.ts, 6, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +} diff --git a/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.types index bc36ad8ae2c..e872df6f1b2 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.types @@ -14,6 +14,7 @@ var o: I = { [+"foo"](y) { return y.length; }, >+"foo" : number +>"foo" : string >y : string >y.length : number >y : string @@ -21,6 +22,7 @@ var o: I = { [+"bar"]: y => y.length >+"bar" : number +>"bar" : string >y => y.length : (y: string) => number >y : string >y.length : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.symbols b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.symbols new file mode 100644 index 00000000000..f6f19f3fd61 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType4_ES5.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType4_ES5.ts, 0, 0)) + + [s: string]: any; +>s : Symbol(s, Decl(computedPropertyNamesContextualType4_ES5.ts, 1, 5)) + + [s: number]: any; +>s : Symbol(s, Decl(computedPropertyNamesContextualType4_ES5.ts, 2, 5)) +} + +var o: I = { +>o : Symbol(o, Decl(computedPropertyNamesContextualType4_ES5.ts, 5, 3)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType4_ES5.ts, 0, 0)) + + [""+"foo"]: "", + [""+"bar"]: 0 +} diff --git a/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.types index c1662397527..e5a57363ca0 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.types @@ -16,7 +16,13 @@ var o: I = { [""+"foo"]: "", >""+"foo" : string +>"" : string +>"foo" : string +>"" : string [""+"bar"]: 0 >""+"bar" : string +>"" : string +>"bar" : string +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.symbols new file mode 100644 index 00000000000..184a561425c --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType4_ES6.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType4_ES6.ts, 0, 0)) + + [s: string]: any; +>s : Symbol(s, Decl(computedPropertyNamesContextualType4_ES6.ts, 1, 5)) + + [s: number]: any; +>s : Symbol(s, Decl(computedPropertyNamesContextualType4_ES6.ts, 2, 5)) +} + +var o: I = { +>o : Symbol(o, Decl(computedPropertyNamesContextualType4_ES6.ts, 5, 3)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType4_ES6.ts, 0, 0)) + + [""+"foo"]: "", + [""+"bar"]: 0 +} diff --git a/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.types index 82424f9410c..bdfa569752b 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.types @@ -16,7 +16,13 @@ var o: I = { [""+"foo"]: "", >""+"foo" : string +>"" : string +>"foo" : string +>"" : string [""+"bar"]: 0 >""+"bar" : string +>"" : string +>"bar" : string +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.symbols b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.symbols new file mode 100644 index 00000000000..e93cf3f94a1 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType5_ES5.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType5_ES5.ts, 0, 0)) + + [s: string]: any; +>s : Symbol(s, Decl(computedPropertyNamesContextualType5_ES5.ts, 1, 5)) + + [s: number]: any; +>s : Symbol(s, Decl(computedPropertyNamesContextualType5_ES5.ts, 2, 5)) +} + +var o: I = { +>o : Symbol(o, Decl(computedPropertyNamesContextualType5_ES5.ts, 5, 3)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType5_ES5.ts, 0, 0)) + + [+"foo"]: "", + [+"bar"]: 0 +} diff --git a/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.types index bb382ca136e..e142fe937b9 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.types @@ -16,7 +16,11 @@ var o: I = { [+"foo"]: "", >+"foo" : number +>"foo" : string +>"" : string [+"bar"]: 0 >+"bar" : number +>"bar" : string +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.symbols new file mode 100644 index 00000000000..46212968874 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType5_ES6.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType5_ES6.ts, 0, 0)) + + [s: string]: any; +>s : Symbol(s, Decl(computedPropertyNamesContextualType5_ES6.ts, 1, 5)) + + [s: number]: any; +>s : Symbol(s, Decl(computedPropertyNamesContextualType5_ES6.ts, 2, 5)) +} + +var o: I = { +>o : Symbol(o, Decl(computedPropertyNamesContextualType5_ES6.ts, 5, 3)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType5_ES6.ts, 0, 0)) + + [+"foo"]: "", + [+"bar"]: 0 +} diff --git a/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.types index 6ab28f9583d..7b385b36770 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.types @@ -16,7 +16,11 @@ var o: I = { [+"foo"]: "", >+"foo" : number +>"foo" : string +>"" : string [+"bar"]: 0 >+"bar" : number +>"bar" : string +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.symbols b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.symbols new file mode 100644 index 00000000000..fb303b1f8b3 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType6_ES5.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType6_ES5.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType6_ES5.ts, 0, 12)) + + [s: string]: T; +>s : Symbol(s, Decl(computedPropertyNamesContextualType6_ES5.ts, 1, 5)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType6_ES5.ts, 0, 12)) +} + +declare function foo(obj: I): T +>foo : Symbol(foo, Decl(computedPropertyNamesContextualType6_ES5.ts, 2, 1)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType6_ES5.ts, 4, 21)) +>obj : Symbol(obj, Decl(computedPropertyNamesContextualType6_ES5.ts, 4, 24)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType6_ES5.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType6_ES5.ts, 4, 21)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType6_ES5.ts, 4, 21)) + +foo({ +>foo : Symbol(foo, Decl(computedPropertyNamesContextualType6_ES5.ts, 2, 1)) + + p: "", +>p : Symbol(p, Decl(computedPropertyNamesContextualType6_ES5.ts, 6, 5)) + + 0: () => { }, + ["hi" + "bye"]: true, + [0 + 1]: 0, + [+"hi"]: [0] +}); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types index 2e16c7cb140..52ff0c1001d 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types @@ -23,18 +23,27 @@ foo({ p: "", >p : string +>"" : string 0: () => { }, >() => { } : () => void ["hi" + "bye"]: true, >"hi" + "bye" : string +>"hi" : string +>"bye" : string +>true : boolean [0 + 1]: 0, >0 + 1 : number +>0 : number +>1 : number +>0 : number [+"hi"]: [0] >+"hi" : number +>"hi" : string >[0] : number[] +>0 : number }); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types.pull b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types.pull deleted file mode 100644 index ce7a4c0d026..00000000000 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types.pull +++ /dev/null @@ -1,40 +0,0 @@ -=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType6_ES5.ts === -interface I { ->I : I ->T : T - - [s: string]: T; ->s : string ->T : T -} - -declare function foo(obj: I): T ->foo : (obj: I) => T ->T : T ->obj : I ->I : I ->T : T ->T : T - -foo({ ->foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : string | number | boolean | (() => void) | number[] ->foo : (obj: I) => T ->{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: string | number | boolean | (() => void) | number[]; 0: () => void; p: string; } - - p: "", ->p : string - - 0: () => { }, ->() => { } : () => void - - ["hi" + "bye"]: true, ->"hi" + "bye" : string - - [0 + 1]: 0, ->0 + 1 : number - - [+"hi"]: [0] ->+"hi" : number ->[0] : number[] - -}); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.symbols new file mode 100644 index 00000000000..b3e371447e2 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType6_ES6.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType6_ES6.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType6_ES6.ts, 0, 12)) + + [s: string]: T; +>s : Symbol(s, Decl(computedPropertyNamesContextualType6_ES6.ts, 1, 5)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType6_ES6.ts, 0, 12)) +} + +declare function foo(obj: I): T +>foo : Symbol(foo, Decl(computedPropertyNamesContextualType6_ES6.ts, 2, 1)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType6_ES6.ts, 4, 21)) +>obj : Symbol(obj, Decl(computedPropertyNamesContextualType6_ES6.ts, 4, 24)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType6_ES6.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType6_ES6.ts, 4, 21)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType6_ES6.ts, 4, 21)) + +foo({ +>foo : Symbol(foo, Decl(computedPropertyNamesContextualType6_ES6.ts, 2, 1)) + + p: "", +>p : Symbol(p, Decl(computedPropertyNamesContextualType6_ES6.ts, 6, 5)) + + 0: () => { }, + ["hi" + "bye"]: true, + [0 + 1]: 0, + [+"hi"]: [0] +}); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types index 1684bfc573f..6998c9523cc 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types @@ -23,18 +23,27 @@ foo({ p: "", >p : string +>"" : string 0: () => { }, >() => { } : () => void ["hi" + "bye"]: true, >"hi" + "bye" : string +>"hi" : string +>"bye" : string +>true : boolean [0 + 1]: 0, >0 + 1 : number +>0 : number +>1 : number +>0 : number [+"hi"]: [0] >+"hi" : number +>"hi" : string >[0] : number[] +>0 : number }); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types.pull b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types.pull deleted file mode 100644 index 6722edacd64..00000000000 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types.pull +++ /dev/null @@ -1,40 +0,0 @@ -=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType6_ES6.ts === -interface I { ->I : I ->T : T - - [s: string]: T; ->s : string ->T : T -} - -declare function foo(obj: I): T ->foo : (obj: I) => T ->T : T ->obj : I ->I : I ->T : T ->T : T - -foo({ ->foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : string | number | boolean | (() => void) | number[] ->foo : (obj: I) => T ->{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: string | number | boolean | (() => void) | number[]; 0: () => void; p: string; } - - p: "", ->p : string - - 0: () => { }, ->() => { } : () => void - - ["hi" + "bye"]: true, ->"hi" + "bye" : string - - [0 + 1]: 0, ->0 + 1 : number - - [+"hi"]: [0] ->+"hi" : number ->[0] : number[] - -}); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.symbols b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.symbols new file mode 100644 index 00000000000..22e4cf2b45b --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType7_ES5.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType7_ES5.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType7_ES5.ts, 0, 12)) + + [s: number]: T; +>s : Symbol(s, Decl(computedPropertyNamesContextualType7_ES5.ts, 1, 5)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType7_ES5.ts, 0, 12)) +} + +declare function foo(obj: I): T +>foo : Symbol(foo, Decl(computedPropertyNamesContextualType7_ES5.ts, 2, 1)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType7_ES5.ts, 4, 21)) +>obj : Symbol(obj, Decl(computedPropertyNamesContextualType7_ES5.ts, 4, 24)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType7_ES5.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType7_ES5.ts, 4, 21)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType7_ES5.ts, 4, 21)) + +foo({ +>foo : Symbol(foo, Decl(computedPropertyNamesContextualType7_ES5.ts, 2, 1)) + + p: "", +>p : Symbol(p, Decl(computedPropertyNamesContextualType7_ES5.ts, 6, 5)) + + 0: () => { }, + ["hi" + "bye"]: true, + [0 + 1]: 0, + [+"hi"]: [0] +}); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types index 80ba2b9224f..1845d145966 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types @@ -23,18 +23,27 @@ foo({ p: "", >p : string +>"" : string 0: () => { }, >() => { } : () => void ["hi" + "bye"]: true, >"hi" + "bye" : string +>"hi" : string +>"bye" : string +>true : boolean [0 + 1]: 0, >0 + 1 : number +>0 : number +>1 : number +>0 : number [+"hi"]: [0] >+"hi" : number +>"hi" : string >[0] : number[] +>0 : number }); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types.pull b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types.pull deleted file mode 100644 index 3511e913585..00000000000 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types.pull +++ /dev/null @@ -1,40 +0,0 @@ -=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType7_ES5.ts === -interface I { ->I : I ->T : T - - [s: number]: T; ->s : number ->T : T -} - -declare function foo(obj: I): T ->foo : (obj: I) => T ->T : T ->obj : I ->I : I ->T : T ->T : T - -foo({ ->foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : number | (() => void) | number[] ->foo : (obj: I) => T ->{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: number]: number | (() => void) | number[]; 0: () => void; p: string; } - - p: "", ->p : string - - 0: () => { }, ->() => { } : () => void - - ["hi" + "bye"]: true, ->"hi" + "bye" : string - - [0 + 1]: 0, ->0 + 1 : number - - [+"hi"]: [0] ->+"hi" : number ->[0] : number[] - -}); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.symbols new file mode 100644 index 00000000000..7f33ebf58ad --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType7_ES6.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType7_ES6.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType7_ES6.ts, 0, 12)) + + [s: number]: T; +>s : Symbol(s, Decl(computedPropertyNamesContextualType7_ES6.ts, 1, 5)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType7_ES6.ts, 0, 12)) +} + +declare function foo(obj: I): T +>foo : Symbol(foo, Decl(computedPropertyNamesContextualType7_ES6.ts, 2, 1)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType7_ES6.ts, 4, 21)) +>obj : Symbol(obj, Decl(computedPropertyNamesContextualType7_ES6.ts, 4, 24)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType7_ES6.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType7_ES6.ts, 4, 21)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType7_ES6.ts, 4, 21)) + +foo({ +>foo : Symbol(foo, Decl(computedPropertyNamesContextualType7_ES6.ts, 2, 1)) + + p: "", +>p : Symbol(p, Decl(computedPropertyNamesContextualType7_ES6.ts, 6, 5)) + + 0: () => { }, + ["hi" + "bye"]: true, + [0 + 1]: 0, + [+"hi"]: [0] +}); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types index c9ed4437760..54d2afe4f61 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types @@ -23,18 +23,27 @@ foo({ p: "", >p : string +>"" : string 0: () => { }, >() => { } : () => void ["hi" + "bye"]: true, >"hi" + "bye" : string +>"hi" : string +>"bye" : string +>true : boolean [0 + 1]: 0, >0 + 1 : number +>0 : number +>1 : number +>0 : number [+"hi"]: [0] >+"hi" : number +>"hi" : string >[0] : number[] +>0 : number }); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types.pull b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types.pull deleted file mode 100644 index c548aed2bae..00000000000 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types.pull +++ /dev/null @@ -1,40 +0,0 @@ -=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType7_ES6.ts === -interface I { ->I : I ->T : T - - [s: number]: T; ->s : number ->T : T -} - -declare function foo(obj: I): T ->foo : (obj: I) => T ->T : T ->obj : I ->I : I ->T : T ->T : T - -foo({ ->foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : number | (() => void) | number[] ->foo : (obj: I) => T ->{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: number]: number | (() => void) | number[]; 0: () => void; p: string; } - - p: "", ->p : string - - 0: () => { }, ->() => { } : () => void - - ["hi" + "bye"]: true, ->"hi" + "bye" : string - - [0 + 1]: 0, ->0 + 1 : number - - [+"hi"]: [0] ->+"hi" : number ->[0] : number[] - -}); diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.symbols b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.symbols new file mode 100644 index 00000000000..cd10b9c77a1 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit1_ES5.ts === +class C { +>C : Symbol(C, Decl(computedPropertyNamesDeclarationEmit1_ES5.ts, 0, 0)) + + ["" + ""]() { } + get ["" + ""]() { return 0; } + set ["" + ""](x) { } +>x : Symbol(x, Decl(computedPropertyNamesDeclarationEmit1_ES5.ts, 3, 18)) +} diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.types index a5fe3dc0fa1..a05d5556495 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.types @@ -4,11 +4,18 @@ class C { ["" + ""]() { } >"" + "" : string +>"" : string +>"" : string get ["" + ""]() { return 0; } >"" + "" : string +>"" : string +>"" : string +>0 : number set ["" + ""](x) { } >"" + "" : string +>"" : string +>"" : string >x : any } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.symbols b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.symbols new file mode 100644 index 00000000000..96c9026d65b --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit1_ES6.ts === +class C { +>C : Symbol(C, Decl(computedPropertyNamesDeclarationEmit1_ES6.ts, 0, 0)) + + ["" + ""]() { } + get ["" + ""]() { return 0; } + set ["" + ""](x) { } +>x : Symbol(x, Decl(computedPropertyNamesDeclarationEmit1_ES6.ts, 3, 18)) +} diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.types index a48c85f8602..8b635956dcd 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.types @@ -4,11 +4,18 @@ class C { ["" + ""]() { } >"" + "" : string +>"" : string +>"" : string get ["" + ""]() { return 0; } >"" + "" : string +>"" : string +>"" : string +>0 : number set ["" + ""](x) { } >"" + "" : string +>"" : string +>"" : string >x : any } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.symbols b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.symbols new file mode 100644 index 00000000000..5f1fac066c4 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit2_ES5.ts === +class C { +>C : Symbol(C, Decl(computedPropertyNamesDeclarationEmit2_ES5.ts, 0, 0)) + + static ["" + ""]() { } + static get ["" + ""]() { return 0; } + static set ["" + ""](x) { } +>x : Symbol(x, Decl(computedPropertyNamesDeclarationEmit2_ES5.ts, 3, 25)) +} diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.types index 949d82596c7..c49010b2c09 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.types @@ -4,11 +4,18 @@ class C { static ["" + ""]() { } >"" + "" : string +>"" : string +>"" : string static get ["" + ""]() { return 0; } >"" + "" : string +>"" : string +>"" : string +>0 : number static set ["" + ""](x) { } >"" + "" : string +>"" : string +>"" : string >x : any } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.symbols b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.symbols new file mode 100644 index 00000000000..0797b7e6d7f --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit2_ES6.ts === +class C { +>C : Symbol(C, Decl(computedPropertyNamesDeclarationEmit2_ES6.ts, 0, 0)) + + static ["" + ""]() { } + static get ["" + ""]() { return 0; } + static set ["" + ""](x) { } +>x : Symbol(x, Decl(computedPropertyNamesDeclarationEmit2_ES6.ts, 3, 25)) +} diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.types index eec55608a08..0b0083b9a1a 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.types @@ -4,11 +4,18 @@ class C { static ["" + ""]() { } >"" + "" : string +>"" : string +>"" : string static get ["" + ""]() { return 0; } >"" + "" : string +>"" : string +>"" : string +>0 : number static set ["" + ""](x) { } >"" + "" : string +>"" : string +>"" : string >x : any } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.symbols b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.symbols new file mode 100644 index 00000000000..8d40d4c86c0 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit5_ES5.ts === +var v = { +>v : Symbol(v, Decl(computedPropertyNamesDeclarationEmit5_ES5.ts, 0, 3)) + + ["" + ""]: 0, + ["" + ""]() { }, + get ["" + ""]() { return 0; }, + set ["" + ""](x) { } +>x : Symbol(x, Decl(computedPropertyNamesDeclarationEmit5_ES5.ts, 4, 18)) +} diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.types index 3f5a7355a20..62faa5c2716 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.types @@ -5,14 +5,24 @@ var v = { ["" + ""]: 0, >"" + "" : string +>"" : string +>"" : string +>0 : number ["" + ""]() { }, >"" + "" : string +>"" : string +>"" : string get ["" + ""]() { return 0; }, >"" + "" : string +>"" : string +>"" : string +>0 : number set ["" + ""](x) { } >"" + "" : string +>"" : string +>"" : string >x : any } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.symbols b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.symbols new file mode 100644 index 00000000000..e9a7b4b28ab --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit5_ES6.ts === +var v = { +>v : Symbol(v, Decl(computedPropertyNamesDeclarationEmit5_ES6.ts, 0, 3)) + + ["" + ""]: 0, + ["" + ""]() { }, + get ["" + ""]() { return 0; }, + set ["" + ""](x) { } +>x : Symbol(x, Decl(computedPropertyNamesDeclarationEmit5_ES6.ts, 4, 18)) +} diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.types index 10b70587e32..3eb313d2687 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.types @@ -5,14 +5,24 @@ var v = { ["" + ""]: 0, >"" + "" : string +>"" : string +>"" : string +>0 : number ["" + ""]() { }, >"" + "" : string +>"" : string +>"" : string get ["" + ""]() { return 0; }, >"" + "" : string +>"" : string +>"" : string +>0 : number set ["" + ""](x) { } >"" + "" : string +>"" : string +>"" : string >x : any } diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.symbols b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.symbols new file mode 100644 index 00000000000..89463c12c44 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap1_ES5.ts === +class C { +>C : Symbol(C, Decl(computedPropertyNamesSourceMap1_ES5.ts, 0, 0)) + + ["hello"]() { + debugger; + } +} diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.types b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.types index 1c57d97a7e8..7f467698a62 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.types @@ -3,6 +3,8 @@ class C { >C : C ["hello"]() { +>"hello" : string + debugger; } } diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.symbols b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.symbols new file mode 100644 index 00000000000..45d2acb2b10 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap1_ES6.ts === +class C { +>C : Symbol(C, Decl(computedPropertyNamesSourceMap1_ES6.ts, 0, 0)) + + ["hello"]() { + debugger; + } +} diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.types b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.types index d5dc8a857a0..4a78685e8a9 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.types @@ -3,6 +3,8 @@ class C { >C : C ["hello"]() { +>"hello" : string + debugger; } } diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.symbols b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.symbols new file mode 100644 index 00000000000..b9a389da636 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap2_ES5.ts === +var v = { +>v : Symbol(v, Decl(computedPropertyNamesSourceMap2_ES5.ts, 0, 3)) + + ["hello"]() { + debugger; + } +} diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types index 1dcc49a8fae..9470aee8eb6 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types @@ -4,6 +4,8 @@ var v = { >{ ["hello"]() { debugger; }} : {} ["hello"]() { +>"hello" : string + debugger; } } diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.symbols b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.symbols new file mode 100644 index 00000000000..6c9d1e1d5fd --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap2_ES6.ts === +var v = { +>v : Symbol(v, Decl(computedPropertyNamesSourceMap2_ES6.ts, 0, 3)) + + ["hello"]() { + debugger; + } +} diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types index 9a1c71364a2..c4f02155a95 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types @@ -4,6 +4,8 @@ var v = { >{ ["hello"]() { debugger; }} : {} ["hello"]() { +>"hello" : string + debugger; } } diff --git a/tests/baselines/reference/computedPropertyNamesWithStaticProperty.symbols b/tests/baselines/reference/computedPropertyNamesWithStaticProperty.symbols new file mode 100644 index 00000000000..70edfd89a97 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesWithStaticProperty.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesWithStaticProperty.ts === +class C { +>C : Symbol(C, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 0)) + + static staticProp = 10; +>staticProp : Symbol(C.staticProp, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 9)) + + get [C.staticProp]() { +>C.staticProp : Symbol(C.staticProp, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 9)) +>C : Symbol(C, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 0)) +>staticProp : Symbol(C.staticProp, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 9)) + + return "hello"; + } + set [C.staticProp](x: string) { +>C.staticProp : Symbol(C.staticProp, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 9)) +>C : Symbol(C, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 0)) +>staticProp : Symbol(C.staticProp, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 9)) +>x : Symbol(x, Decl(computedPropertyNamesWithStaticProperty.ts, 5, 23)) + + var y = x; +>y : Symbol(y, Decl(computedPropertyNamesWithStaticProperty.ts, 6, 11)) +>x : Symbol(x, Decl(computedPropertyNamesWithStaticProperty.ts, 5, 23)) + } + [C.staticProp]() { } +>C.staticProp : Symbol(C.staticProp, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 9)) +>C : Symbol(C, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 0)) +>staticProp : Symbol(C.staticProp, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 9)) +} diff --git a/tests/baselines/reference/computedPropertyNamesWithStaticProperty.types b/tests/baselines/reference/computedPropertyNamesWithStaticProperty.types index b23d986f894..d003b6b32f1 100644 --- a/tests/baselines/reference/computedPropertyNamesWithStaticProperty.types +++ b/tests/baselines/reference/computedPropertyNamesWithStaticProperty.types @@ -4,6 +4,7 @@ class C { static staticProp = 10; >staticProp : number +>10 : number get [C.staticProp]() { >C.staticProp : number @@ -11,6 +12,7 @@ class C { >staticProp : number return "hello"; +>"hello" : string } set [C.staticProp](x: string) { >C.staticProp : number diff --git a/tests/baselines/reference/concatError.symbols b/tests/baselines/reference/concatError.symbols new file mode 100644 index 00000000000..6ed5ffd468f --- /dev/null +++ b/tests/baselines/reference/concatError.symbols @@ -0,0 +1,45 @@ +=== tests/cases/compiler/concatError.ts === + +var n1: number[]; +>n1 : Symbol(n1, Decl(concatError.ts, 1, 3)) + +/* +interface Array { + concat(...items: T[][]): T[]; // Note: This overload needs to be picked for arrays of arrays, even though both are applicable + concat(...items: T[]): T[]; +} +*/ +var fa: number[]; +>fa : Symbol(fa, Decl(concatError.ts, 8, 3)) + +fa = fa.concat([0]); +>fa : Symbol(fa, Decl(concatError.ts, 8, 3)) +>fa.concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) +>fa : Symbol(fa, Decl(concatError.ts, 8, 3)) +>concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) + +fa = fa.concat(0); +>fa : Symbol(fa, Decl(concatError.ts, 8, 3)) +>fa.concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) +>fa : Symbol(fa, Decl(concatError.ts, 8, 3)) +>concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) + + + + + +/* + + + + +declare class C { + public m(p1: C>): C; + //public p: T; +} + +var c: C; +var cc: C>; + +c = c.m(cc); +*/ diff --git a/tests/baselines/reference/concatError.types b/tests/baselines/reference/concatError.types index 46d74cfb6ec..c264e0b0204 100644 --- a/tests/baselines/reference/concatError.types +++ b/tests/baselines/reference/concatError.types @@ -20,6 +20,7 @@ fa = fa.concat([0]); >fa : number[] >concat : { (...items: U[]): number[]; (...items: number[]): number[]; } >[0] : number[] +>0 : number fa = fa.concat(0); >fa = fa.concat(0) : number[] @@ -28,6 +29,7 @@ fa = fa.concat(0); >fa.concat : { (...items: U[]): number[]; (...items: number[]): number[]; } >fa : number[] >concat : { (...items: U[]): number[]; (...items: number[]): number[]; } +>0 : number diff --git a/tests/baselines/reference/conditionalExpressions2.symbols b/tests/baselines/reference/conditionalExpressions2.symbols new file mode 100644 index 00000000000..63c8b417477 --- /dev/null +++ b/tests/baselines/reference/conditionalExpressions2.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/conditionalExpressions2.ts === +var a = false ? 1 : null; +>a : Symbol(a, Decl(conditionalExpressions2.ts, 0, 3)) + +var b = false ? undefined : 0; +>b : Symbol(b, Decl(conditionalExpressions2.ts, 1, 3)) +>undefined : Symbol(undefined) + +var c = false ? 1 : 0; +>c : Symbol(c, Decl(conditionalExpressions2.ts, 2, 3)) + +var d = false ? false : true; +>d : Symbol(d, Decl(conditionalExpressions2.ts, 3, 3)) + +var e = false ? "foo" : "bar"; +>e : Symbol(e, Decl(conditionalExpressions2.ts, 4, 3)) + +var f = false ? null : undefined; +>f : Symbol(f, Decl(conditionalExpressions2.ts, 5, 3)) +>undefined : Symbol(undefined) + +var g = true ? {g:5} : null; +>g : Symbol(g, Decl(conditionalExpressions2.ts, 6, 3)) +>g : Symbol(g, Decl(conditionalExpressions2.ts, 6, 16)) + +var h = [{h:5}, null]; +>h : Symbol(h, Decl(conditionalExpressions2.ts, 7, 3)) +>h : Symbol(h, Decl(conditionalExpressions2.ts, 7, 10)) + +function i() { if (true) { return { x: 5 }; } else { return null; } } +>i : Symbol(i, Decl(conditionalExpressions2.ts, 7, 22)) +>x : Symbol(x, Decl(conditionalExpressions2.ts, 8, 35)) + diff --git a/tests/baselines/reference/conditionalExpressions2.types b/tests/baselines/reference/conditionalExpressions2.types index 7fa483ad348..5f49410b1e4 100644 --- a/tests/baselines/reference/conditionalExpressions2.types +++ b/tests/baselines/reference/conditionalExpressions2.types @@ -2,43 +2,67 @@ var a = false ? 1 : null; >a : number >false ? 1 : null : number +>false : boolean +>1 : number +>null : null var b = false ? undefined : 0; >b : number >false ? undefined : 0 : number +>false : boolean >undefined : undefined +>0 : number var c = false ? 1 : 0; >c : number >false ? 1 : 0 : number +>false : boolean +>1 : number +>0 : number var d = false ? false : true; >d : boolean >false ? false : true : boolean +>false : boolean +>false : boolean +>true : boolean var e = false ? "foo" : "bar"; >e : string >false ? "foo" : "bar" : string +>false : boolean +>"foo" : string +>"bar" : string var f = false ? null : undefined; >f : any >false ? null : undefined : null +>false : boolean +>null : null >undefined : undefined var g = true ? {g:5} : null; >g : { g: number; } >true ? {g:5} : null : { g: number; } +>true : boolean >{g:5} : { g: number; } >g : number +>5 : number +>null : null var h = [{h:5}, null]; >h : { h: number; }[] >[{h:5}, null] : { h: number; }[] >{h:5} : { h: number; } >h : number +>5 : number +>null : null function i() { if (true) { return { x: 5 }; } else { return null; } } >i : () => { x: number; } +>true : boolean >{ x: 5 } : { x: number; } >x : number +>5 : number +>null : null diff --git a/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.symbols b/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.symbols new file mode 100644 index 00000000000..eade67512ad --- /dev/null +++ b/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.symbols @@ -0,0 +1,223 @@ +=== tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditionIsBooleanType.ts === +//Cond ? Expr1 : Expr2, Cond is of boolean type, Expr1 and Expr2 have the same type +var condBoolean: boolean; +>condBoolean : Symbol(condBoolean, Decl(conditionalOperatorConditionIsBooleanType.ts, 1, 3)) + +var exprAny1: any; +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsBooleanType.ts, 3, 3)) + +var exprBoolean1: boolean; +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) + +var exprNumber1: number; +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsBooleanType.ts, 5, 3)) + +var exprString1: string; +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) + +var exprIsObject1: Object; +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsBooleanType.ts, 7, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var exprAny2: any; +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsBooleanType.ts, 9, 3)) + +var exprBoolean2: boolean; +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsBooleanType.ts, 10, 3)) + +var exprNumber2: number; +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsBooleanType.ts, 11, 3)) + +var exprString2: string; +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsBooleanType.ts, 12, 3)) + +var exprIsObject2: Object; +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsBooleanType.ts, 13, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +//Cond is a boolean type variable +condBoolean ? exprAny1 : exprAny2; +>condBoolean : Symbol(condBoolean, Decl(conditionalOperatorConditionIsBooleanType.ts, 1, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsBooleanType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsBooleanType.ts, 9, 3)) + +condBoolean ? exprBoolean1 : exprBoolean2; +>condBoolean : Symbol(condBoolean, Decl(conditionalOperatorConditionIsBooleanType.ts, 1, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsBooleanType.ts, 10, 3)) + +condBoolean ? exprNumber1 : exprNumber2; +>condBoolean : Symbol(condBoolean, Decl(conditionalOperatorConditionIsBooleanType.ts, 1, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsBooleanType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsBooleanType.ts, 11, 3)) + +condBoolean ? exprString1 : exprString2; +>condBoolean : Symbol(condBoolean, Decl(conditionalOperatorConditionIsBooleanType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsBooleanType.ts, 12, 3)) + +condBoolean ? exprIsObject1 : exprIsObject2; +>condBoolean : Symbol(condBoolean, Decl(conditionalOperatorConditionIsBooleanType.ts, 1, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsBooleanType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsBooleanType.ts, 13, 3)) + +condBoolean ? exprString1 : exprBoolean1; // union +>condBoolean : Symbol(condBoolean, Decl(conditionalOperatorConditionIsBooleanType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) + +//Cond is a boolean type literal +true ? exprAny1 : exprAny2; +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsBooleanType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsBooleanType.ts, 9, 3)) + +false ? exprBoolean1 : exprBoolean2; +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsBooleanType.ts, 10, 3)) + +true ? exprNumber1 : exprNumber2; +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsBooleanType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsBooleanType.ts, 11, 3)) + +false ? exprString1 : exprString2; +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsBooleanType.ts, 12, 3)) + +true ? exprIsObject1 : exprIsObject2; +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsBooleanType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsBooleanType.ts, 13, 3)) + +true ? exprString1 : exprBoolean1; // union +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) + +//Cond is a boolean type expression +!true ? exprAny1 : exprAny2; +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsBooleanType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsBooleanType.ts, 9, 3)) + +typeof "123" == "string" ? exprBoolean1 : exprBoolean2; +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsBooleanType.ts, 10, 3)) + +2 > 1 ? exprNumber1 : exprNumber2; +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsBooleanType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsBooleanType.ts, 11, 3)) + +null === undefined ? exprString1 : exprString2; +>undefined : Symbol(undefined) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsBooleanType.ts, 12, 3)) + +true || false ? exprIsObject1 : exprIsObject2; +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsBooleanType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsBooleanType.ts, 13, 3)) + +null === undefined ? exprString1 : exprBoolean1; // union +>undefined : Symbol(undefined) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) + +//Results shoud be same as Expr1 and Expr2 +var resultIsAny1 = condBoolean ? exprAny1 : exprAny2; +>resultIsAny1 : Symbol(resultIsAny1, Decl(conditionalOperatorConditionIsBooleanType.ts, 40, 3)) +>condBoolean : Symbol(condBoolean, Decl(conditionalOperatorConditionIsBooleanType.ts, 1, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsBooleanType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsBooleanType.ts, 9, 3)) + +var resultIsBoolean1 = condBoolean ? exprBoolean1 : exprBoolean2; +>resultIsBoolean1 : Symbol(resultIsBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 41, 3)) +>condBoolean : Symbol(condBoolean, Decl(conditionalOperatorConditionIsBooleanType.ts, 1, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsBooleanType.ts, 10, 3)) + +var resultIsNumber1 = condBoolean ? exprNumber1 : exprNumber2; +>resultIsNumber1 : Symbol(resultIsNumber1, Decl(conditionalOperatorConditionIsBooleanType.ts, 42, 3)) +>condBoolean : Symbol(condBoolean, Decl(conditionalOperatorConditionIsBooleanType.ts, 1, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsBooleanType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsBooleanType.ts, 11, 3)) + +var resultIsString1 = condBoolean ? exprString1 : exprString2; +>resultIsString1 : Symbol(resultIsString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 43, 3)) +>condBoolean : Symbol(condBoolean, Decl(conditionalOperatorConditionIsBooleanType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsBooleanType.ts, 12, 3)) + +var resultIsObject1 = condBoolean ? exprIsObject1 : exprIsObject2; +>resultIsObject1 : Symbol(resultIsObject1, Decl(conditionalOperatorConditionIsBooleanType.ts, 44, 3)) +>condBoolean : Symbol(condBoolean, Decl(conditionalOperatorConditionIsBooleanType.ts, 1, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsBooleanType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsBooleanType.ts, 13, 3)) + +var resultIsStringOrBoolean1 = condBoolean ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean1 : Symbol(resultIsStringOrBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 45, 3)) +>condBoolean : Symbol(condBoolean, Decl(conditionalOperatorConditionIsBooleanType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) + +var resultIsAny2 = true ? exprAny1 : exprAny2; +>resultIsAny2 : Symbol(resultIsAny2, Decl(conditionalOperatorConditionIsBooleanType.ts, 47, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsBooleanType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsBooleanType.ts, 9, 3)) + +var resultIsBoolean2 = false ? exprBoolean1 : exprBoolean2; +>resultIsBoolean2 : Symbol(resultIsBoolean2, Decl(conditionalOperatorConditionIsBooleanType.ts, 48, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsBooleanType.ts, 10, 3)) + +var resultIsNumber2 = true ? exprNumber1 : exprNumber2; +>resultIsNumber2 : Symbol(resultIsNumber2, Decl(conditionalOperatorConditionIsBooleanType.ts, 49, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsBooleanType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsBooleanType.ts, 11, 3)) + +var resultIsString2 = false ? exprString1 : exprString2; +>resultIsString2 : Symbol(resultIsString2, Decl(conditionalOperatorConditionIsBooleanType.ts, 50, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsBooleanType.ts, 12, 3)) + +var resultIsObject2 = true ? exprIsObject1 : exprIsObject2; +>resultIsObject2 : Symbol(resultIsObject2, Decl(conditionalOperatorConditionIsBooleanType.ts, 51, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsBooleanType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsBooleanType.ts, 13, 3)) + +var resultIsStringOrBoolean2 = true ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean2 : Symbol(resultIsStringOrBoolean2, Decl(conditionalOperatorConditionIsBooleanType.ts, 52, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) + +var resultIsStringOrBoolean3 = false ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean3 : Symbol(resultIsStringOrBoolean3, Decl(conditionalOperatorConditionIsBooleanType.ts, 53, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) + +var resultIsAny3 = !true ? exprAny1 : exprAny2; +>resultIsAny3 : Symbol(resultIsAny3, Decl(conditionalOperatorConditionIsBooleanType.ts, 55, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsBooleanType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsBooleanType.ts, 9, 3)) + +var resultIsBoolean3 = typeof "123" == "string" ? exprBoolean1 : exprBoolean2; +>resultIsBoolean3 : Symbol(resultIsBoolean3, Decl(conditionalOperatorConditionIsBooleanType.ts, 56, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsBooleanType.ts, 10, 3)) + +var resultIsNumber3 = 2 > 1 ? exprNumber1 : exprNumber2; +>resultIsNumber3 : Symbol(resultIsNumber3, Decl(conditionalOperatorConditionIsBooleanType.ts, 57, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsBooleanType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsBooleanType.ts, 11, 3)) + +var resultIsString3 = null === undefined ? exprString1 : exprString2; +>resultIsString3 : Symbol(resultIsString3, Decl(conditionalOperatorConditionIsBooleanType.ts, 58, 3)) +>undefined : Symbol(undefined) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsBooleanType.ts, 12, 3)) + +var resultIsObject3 = true || false ? exprIsObject1 : exprIsObject2; +>resultIsObject3 : Symbol(resultIsObject3, Decl(conditionalOperatorConditionIsBooleanType.ts, 59, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsBooleanType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsBooleanType.ts, 13, 3)) + +var resultIsStringOrBoolean4 = typeof "123" === "string" ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean4 : Symbol(resultIsStringOrBoolean4, Decl(conditionalOperatorConditionIsBooleanType.ts, 60, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) + diff --git a/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.types b/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.types index 44fc9f5ed7b..4d28939b696 100644 --- a/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.types +++ b/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.types @@ -75,31 +75,37 @@ condBoolean ? exprString1 : exprBoolean1; // union //Cond is a boolean type literal true ? exprAny1 : exprAny2; >true ? exprAny1 : exprAny2 : any +>true : boolean >exprAny1 : any >exprAny2 : any false ? exprBoolean1 : exprBoolean2; >false ? exprBoolean1 : exprBoolean2 : boolean +>false : boolean >exprBoolean1 : boolean >exprBoolean2 : boolean true ? exprNumber1 : exprNumber2; >true ? exprNumber1 : exprNumber2 : number +>true : boolean >exprNumber1 : number >exprNumber2 : number false ? exprString1 : exprString2; >false ? exprString1 : exprString2 : string +>false : boolean >exprString1 : string >exprString2 : string true ? exprIsObject1 : exprIsObject2; >true ? exprIsObject1 : exprIsObject2 : Object +>true : boolean >exprIsObject1 : Object >exprIsObject2 : Object true ? exprString1 : exprBoolean1; // union >true ? exprString1 : exprBoolean1 : string | boolean +>true : boolean >exprString1 : string >exprBoolean1 : boolean @@ -107,6 +113,7 @@ true ? exprString1 : exprBoolean1; // union !true ? exprAny1 : exprAny2; >!true ? exprAny1 : exprAny2 : any >!true : boolean +>true : boolean >exprAny1 : any >exprAny2 : any @@ -114,18 +121,23 @@ typeof "123" == "string" ? exprBoolean1 : exprBoolean2; >typeof "123" == "string" ? exprBoolean1 : exprBoolean2 : boolean >typeof "123" == "string" : boolean >typeof "123" : string +>"123" : string +>"string" : string >exprBoolean1 : boolean >exprBoolean2 : boolean 2 > 1 ? exprNumber1 : exprNumber2; >2 > 1 ? exprNumber1 : exprNumber2 : number >2 > 1 : boolean +>2 : number +>1 : number >exprNumber1 : number >exprNumber2 : number null === undefined ? exprString1 : exprString2; >null === undefined ? exprString1 : exprString2 : string >null === undefined : boolean +>null : null >undefined : undefined >exprString1 : string >exprString2 : string @@ -133,12 +145,15 @@ null === undefined ? exprString1 : exprString2; true || false ? exprIsObject1 : exprIsObject2; >true || false ? exprIsObject1 : exprIsObject2 : Object >true || false : boolean +>true : boolean +>false : boolean >exprIsObject1 : Object >exprIsObject2 : Object null === undefined ? exprString1 : exprBoolean1; // union >null === undefined ? exprString1 : exprBoolean1 : string | boolean >null === undefined : boolean +>null : null >undefined : undefined >exprString1 : string >exprBoolean1 : boolean @@ -189,42 +204,49 @@ var resultIsStringOrBoolean1 = condBoolean ? exprString1 : exprBoolean1; // unio var resultIsAny2 = true ? exprAny1 : exprAny2; >resultIsAny2 : any >true ? exprAny1 : exprAny2 : any +>true : boolean >exprAny1 : any >exprAny2 : any var resultIsBoolean2 = false ? exprBoolean1 : exprBoolean2; >resultIsBoolean2 : boolean >false ? exprBoolean1 : exprBoolean2 : boolean +>false : boolean >exprBoolean1 : boolean >exprBoolean2 : boolean var resultIsNumber2 = true ? exprNumber1 : exprNumber2; >resultIsNumber2 : number >true ? exprNumber1 : exprNumber2 : number +>true : boolean >exprNumber1 : number >exprNumber2 : number var resultIsString2 = false ? exprString1 : exprString2; >resultIsString2 : string >false ? exprString1 : exprString2 : string +>false : boolean >exprString1 : string >exprString2 : string var resultIsObject2 = true ? exprIsObject1 : exprIsObject2; >resultIsObject2 : Object >true ? exprIsObject1 : exprIsObject2 : Object +>true : boolean >exprIsObject1 : Object >exprIsObject2 : Object var resultIsStringOrBoolean2 = true ? exprString1 : exprBoolean1; // union >resultIsStringOrBoolean2 : string | boolean >true ? exprString1 : exprBoolean1 : string | boolean +>true : boolean >exprString1 : string >exprBoolean1 : boolean var resultIsStringOrBoolean3 = false ? exprString1 : exprBoolean1; // union >resultIsStringOrBoolean3 : string | boolean >false ? exprString1 : exprBoolean1 : string | boolean +>false : boolean >exprString1 : string >exprBoolean1 : boolean @@ -232,6 +254,7 @@ var resultIsAny3 = !true ? exprAny1 : exprAny2; >resultIsAny3 : any >!true ? exprAny1 : exprAny2 : any >!true : boolean +>true : boolean >exprAny1 : any >exprAny2 : any @@ -240,6 +263,8 @@ var resultIsBoolean3 = typeof "123" == "string" ? exprBoolean1 : exprBoolean2; >typeof "123" == "string" ? exprBoolean1 : exprBoolean2 : boolean >typeof "123" == "string" : boolean >typeof "123" : string +>"123" : string +>"string" : string >exprBoolean1 : boolean >exprBoolean2 : boolean @@ -247,6 +272,8 @@ var resultIsNumber3 = 2 > 1 ? exprNumber1 : exprNumber2; >resultIsNumber3 : number >2 > 1 ? exprNumber1 : exprNumber2 : number >2 > 1 : boolean +>2 : number +>1 : number >exprNumber1 : number >exprNumber2 : number @@ -254,6 +281,7 @@ var resultIsString3 = null === undefined ? exprString1 : exprString2; >resultIsString3 : string >null === undefined ? exprString1 : exprString2 : string >null === undefined : boolean +>null : null >undefined : undefined >exprString1 : string >exprString2 : string @@ -262,6 +290,8 @@ var resultIsObject3 = true || false ? exprIsObject1 : exprIsObject2; >resultIsObject3 : Object >true || false ? exprIsObject1 : exprIsObject2 : Object >true || false : boolean +>true : boolean +>false : boolean >exprIsObject1 : Object >exprIsObject2 : Object @@ -270,6 +300,8 @@ var resultIsStringOrBoolean4 = typeof "123" === "string" ? exprString1 : exprBoo >typeof "123" === "string" ? exprString1 : exprBoolean1 : string | boolean >typeof "123" === "string" : boolean >typeof "123" : string +>"123" : string +>"string" : string >exprString1 : string >exprBoolean1 : boolean diff --git a/tests/baselines/reference/conditionalOperatorConditionIsNumberType.symbols b/tests/baselines/reference/conditionalOperatorConditionIsNumberType.symbols new file mode 100644 index 00000000000..8ece5961636 --- /dev/null +++ b/tests/baselines/reference/conditionalOperatorConditionIsNumberType.symbols @@ -0,0 +1,234 @@ +=== tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditionIsNumberType.ts === +//Cond ? Expr1 : Expr2, Cond is of number type, Expr1 and Expr2 have the same type +var condNumber: number; +>condNumber : Symbol(condNumber, Decl(conditionalOperatorConditionIsNumberType.ts, 1, 3)) + +var exprAny1: any; +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsNumberType.ts, 3, 3)) + +var exprBoolean1: boolean; +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 4, 3)) + +var exprNumber1: number; +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsNumberType.ts, 5, 3)) + +var exprString1: string; +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsNumberType.ts, 6, 3)) + +var exprIsObject1: Object; +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsNumberType.ts, 7, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var exprAny2: any; +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsNumberType.ts, 9, 3)) + +var exprBoolean2: boolean; +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsNumberType.ts, 10, 3)) + +var exprNumber2: number; +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsNumberType.ts, 11, 3)) + +var exprString2: string; +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsNumberType.ts, 12, 3)) + +var exprIsObject2: Object; +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsNumberType.ts, 13, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +//Cond is a number type variable +condNumber ? exprAny1 : exprAny2; +>condNumber : Symbol(condNumber, Decl(conditionalOperatorConditionIsNumberType.ts, 1, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsNumberType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsNumberType.ts, 9, 3)) + +condNumber ? exprBoolean1 : exprBoolean2; +>condNumber : Symbol(condNumber, Decl(conditionalOperatorConditionIsNumberType.ts, 1, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsNumberType.ts, 10, 3)) + +condNumber ? exprNumber1 : exprNumber2; +>condNumber : Symbol(condNumber, Decl(conditionalOperatorConditionIsNumberType.ts, 1, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsNumberType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsNumberType.ts, 11, 3)) + +condNumber ? exprString1 : exprString2; +>condNumber : Symbol(condNumber, Decl(conditionalOperatorConditionIsNumberType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsNumberType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsNumberType.ts, 12, 3)) + +condNumber ? exprIsObject1 : exprIsObject2; +>condNumber : Symbol(condNumber, Decl(conditionalOperatorConditionIsNumberType.ts, 1, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsNumberType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsNumberType.ts, 13, 3)) + +condNumber ? exprString1 : exprBoolean1; // Union +>condNumber : Symbol(condNumber, Decl(conditionalOperatorConditionIsNumberType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsNumberType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 4, 3)) + +//Cond is a number type literal +1 ? exprAny1 : exprAny2; +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsNumberType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsNumberType.ts, 9, 3)) + +0 ? exprBoolean1 : exprBoolean2; +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsNumberType.ts, 10, 3)) + +0.123456789 ? exprNumber1 : exprNumber2; +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsNumberType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsNumberType.ts, 11, 3)) + +- 10000000000000 ? exprString1 : exprString2; +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsNumberType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsNumberType.ts, 12, 3)) + +1000000000000 ? exprIsObject1 : exprIsObject2; +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsNumberType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsNumberType.ts, 13, 3)) + +10000 ? exprString1 : exprBoolean1; // Union +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsNumberType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 4, 3)) + +//Cond is a number type expression +function foo() { return 1 }; +>foo : Symbol(foo, Decl(conditionalOperatorConditionIsNumberType.ts, 29, 35)) + +var array = [1, 2, 3]; +>array : Symbol(array, Decl(conditionalOperatorConditionIsNumberType.ts, 33, 3)) + +1 * 0 ? exprAny1 : exprAny2; +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsNumberType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsNumberType.ts, 9, 3)) + +1 + 1 ? exprBoolean1 : exprBoolean2; +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsNumberType.ts, 10, 3)) + +"string".length ? exprNumber1 : exprNumber2; +>"string".length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsNumberType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsNumberType.ts, 11, 3)) + +foo() ? exprString1 : exprString2; +>foo : Symbol(foo, Decl(conditionalOperatorConditionIsNumberType.ts, 29, 35)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsNumberType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsNumberType.ts, 12, 3)) + +foo() / array[1] ? exprIsObject1 : exprIsObject2; +>foo : Symbol(foo, Decl(conditionalOperatorConditionIsNumberType.ts, 29, 35)) +>array : Symbol(array, Decl(conditionalOperatorConditionIsNumberType.ts, 33, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsNumberType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsNumberType.ts, 13, 3)) + +foo() ? exprString1 : exprBoolean1; // Union +>foo : Symbol(foo, Decl(conditionalOperatorConditionIsNumberType.ts, 29, 35)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsNumberType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 4, 3)) + +//Results shoud be same as Expr1 and Expr2 +var resultIsAny1 = condNumber ? exprAny1 : exprAny2; +>resultIsAny1 : Symbol(resultIsAny1, Decl(conditionalOperatorConditionIsNumberType.ts, 43, 3)) +>condNumber : Symbol(condNumber, Decl(conditionalOperatorConditionIsNumberType.ts, 1, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsNumberType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsNumberType.ts, 9, 3)) + +var resultIsBoolean1 = condNumber ? exprBoolean1 : exprBoolean2; +>resultIsBoolean1 : Symbol(resultIsBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 44, 3)) +>condNumber : Symbol(condNumber, Decl(conditionalOperatorConditionIsNumberType.ts, 1, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsNumberType.ts, 10, 3)) + +var resultIsNumber1 = condNumber ? exprNumber1 : exprNumber2; +>resultIsNumber1 : Symbol(resultIsNumber1, Decl(conditionalOperatorConditionIsNumberType.ts, 45, 3)) +>condNumber : Symbol(condNumber, Decl(conditionalOperatorConditionIsNumberType.ts, 1, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsNumberType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsNumberType.ts, 11, 3)) + +var resultIsString1 = condNumber ? exprString1 : exprString2; +>resultIsString1 : Symbol(resultIsString1, Decl(conditionalOperatorConditionIsNumberType.ts, 46, 3)) +>condNumber : Symbol(condNumber, Decl(conditionalOperatorConditionIsNumberType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsNumberType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsNumberType.ts, 12, 3)) + +var resultIsObject1 = condNumber ? exprIsObject1 : exprIsObject2; +>resultIsObject1 : Symbol(resultIsObject1, Decl(conditionalOperatorConditionIsNumberType.ts, 47, 3)) +>condNumber : Symbol(condNumber, Decl(conditionalOperatorConditionIsNumberType.ts, 1, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsNumberType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsNumberType.ts, 13, 3)) + +var resultIsStringOrBoolean1 = condNumber ? exprString1 : exprBoolean1; // Union +>resultIsStringOrBoolean1 : Symbol(resultIsStringOrBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 48, 3)) +>condNumber : Symbol(condNumber, Decl(conditionalOperatorConditionIsNumberType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsNumberType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 4, 3)) + +var resultIsAny2 = 1 ? exprAny1 : exprAny2; +>resultIsAny2 : Symbol(resultIsAny2, Decl(conditionalOperatorConditionIsNumberType.ts, 50, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsNumberType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsNumberType.ts, 9, 3)) + +var resultIsBoolean2 = 0 ? exprBoolean1 : exprBoolean2; +>resultIsBoolean2 : Symbol(resultIsBoolean2, Decl(conditionalOperatorConditionIsNumberType.ts, 51, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsNumberType.ts, 10, 3)) + +var resultIsNumber2 = 0.123456789 ? exprNumber1 : exprNumber2; +>resultIsNumber2 : Symbol(resultIsNumber2, Decl(conditionalOperatorConditionIsNumberType.ts, 52, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsNumberType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsNumberType.ts, 11, 3)) + +var resultIsString2 = - 10000000000000 ? exprString1 : exprString2; +>resultIsString2 : Symbol(resultIsString2, Decl(conditionalOperatorConditionIsNumberType.ts, 53, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsNumberType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsNumberType.ts, 12, 3)) + +var resultIsObject2 = 1000000000000 ? exprIsObject1 : exprIsObject2; +>resultIsObject2 : Symbol(resultIsObject2, Decl(conditionalOperatorConditionIsNumberType.ts, 54, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsNumberType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsNumberType.ts, 13, 3)) + +var resultIsStringOrBoolean2 = 10000 ? exprString1 : exprBoolean1; // Union +>resultIsStringOrBoolean2 : Symbol(resultIsStringOrBoolean2, Decl(conditionalOperatorConditionIsNumberType.ts, 55, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsNumberType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 4, 3)) + +var resultIsAny3 = 1 * 0 ? exprAny1 : exprAny2; +>resultIsAny3 : Symbol(resultIsAny3, Decl(conditionalOperatorConditionIsNumberType.ts, 57, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsNumberType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsNumberType.ts, 9, 3)) + +var resultIsBoolean3 = 1 + 1 ? exprBoolean1 : exprBoolean2; +>resultIsBoolean3 : Symbol(resultIsBoolean3, Decl(conditionalOperatorConditionIsNumberType.ts, 58, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsNumberType.ts, 10, 3)) + +var resultIsNumber3 = "string".length ? exprNumber1 : exprNumber2; +>resultIsNumber3 : Symbol(resultIsNumber3, Decl(conditionalOperatorConditionIsNumberType.ts, 59, 3)) +>"string".length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsNumberType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsNumberType.ts, 11, 3)) + +var resultIsString3 = foo() ? exprString1 : exprString2; +>resultIsString3 : Symbol(resultIsString3, Decl(conditionalOperatorConditionIsNumberType.ts, 60, 3)) +>foo : Symbol(foo, Decl(conditionalOperatorConditionIsNumberType.ts, 29, 35)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsNumberType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsNumberType.ts, 12, 3)) + +var resultIsObject3 = foo() / array[1] ? exprIsObject1 : exprIsObject2; +>resultIsObject3 : Symbol(resultIsObject3, Decl(conditionalOperatorConditionIsNumberType.ts, 61, 3)) +>foo : Symbol(foo, Decl(conditionalOperatorConditionIsNumberType.ts, 29, 35)) +>array : Symbol(array, Decl(conditionalOperatorConditionIsNumberType.ts, 33, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsNumberType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsNumberType.ts, 13, 3)) + +var resultIsStringOrBoolean3 = foo() / array[1] ? exprString1 : exprBoolean1; // Union +>resultIsStringOrBoolean3 : Symbol(resultIsStringOrBoolean3, Decl(conditionalOperatorConditionIsNumberType.ts, 62, 3)) +>foo : Symbol(foo, Decl(conditionalOperatorConditionIsNumberType.ts, 29, 35)) +>array : Symbol(array, Decl(conditionalOperatorConditionIsNumberType.ts, 33, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsNumberType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 4, 3)) + diff --git a/tests/baselines/reference/conditionalOperatorConditionIsNumberType.types b/tests/baselines/reference/conditionalOperatorConditionIsNumberType.types index 99a81081d6b..5951dc07350 100644 --- a/tests/baselines/reference/conditionalOperatorConditionIsNumberType.types +++ b/tests/baselines/reference/conditionalOperatorConditionIsNumberType.types @@ -75,58 +75,73 @@ condNumber ? exprString1 : exprBoolean1; // Union //Cond is a number type literal 1 ? exprAny1 : exprAny2; >1 ? exprAny1 : exprAny2 : any +>1 : number >exprAny1 : any >exprAny2 : any 0 ? exprBoolean1 : exprBoolean2; >0 ? exprBoolean1 : exprBoolean2 : boolean +>0 : number >exprBoolean1 : boolean >exprBoolean2 : boolean 0.123456789 ? exprNumber1 : exprNumber2; >0.123456789 ? exprNumber1 : exprNumber2 : number +>0.123456789 : number >exprNumber1 : number >exprNumber2 : number - 10000000000000 ? exprString1 : exprString2; >- 10000000000000 ? exprString1 : exprString2 : string >- 10000000000000 : number +>10000000000000 : number >exprString1 : string >exprString2 : string 1000000000000 ? exprIsObject1 : exprIsObject2; >1000000000000 ? exprIsObject1 : exprIsObject2 : Object +>1000000000000 : number >exprIsObject1 : Object >exprIsObject2 : Object 10000 ? exprString1 : exprBoolean1; // Union >10000 ? exprString1 : exprBoolean1 : string | boolean +>10000 : number >exprString1 : string >exprBoolean1 : boolean //Cond is a number type expression function foo() { return 1 }; >foo : () => number +>1 : number var array = [1, 2, 3]; >array : number[] >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number 1 * 0 ? exprAny1 : exprAny2; >1 * 0 ? exprAny1 : exprAny2 : any >1 * 0 : number +>1 : number +>0 : number >exprAny1 : any >exprAny2 : any 1 + 1 ? exprBoolean1 : exprBoolean2; >1 + 1 ? exprBoolean1 : exprBoolean2 : boolean >1 + 1 : number +>1 : number +>1 : number >exprBoolean1 : boolean >exprBoolean2 : boolean "string".length ? exprNumber1 : exprNumber2; >"string".length ? exprNumber1 : exprNumber2 : number >"string".length : number +>"string" : string >length : number >exprNumber1 : number >exprNumber2 : number @@ -145,6 +160,7 @@ foo() / array[1] ? exprIsObject1 : exprIsObject2; >foo : () => number >array[1] : number >array : number[] +>1 : number >exprIsObject1 : Object >exprIsObject2 : Object @@ -201,18 +217,21 @@ var resultIsStringOrBoolean1 = condNumber ? exprString1 : exprBoolean1; // Union var resultIsAny2 = 1 ? exprAny1 : exprAny2; >resultIsAny2 : any >1 ? exprAny1 : exprAny2 : any +>1 : number >exprAny1 : any >exprAny2 : any var resultIsBoolean2 = 0 ? exprBoolean1 : exprBoolean2; >resultIsBoolean2 : boolean >0 ? exprBoolean1 : exprBoolean2 : boolean +>0 : number >exprBoolean1 : boolean >exprBoolean2 : boolean var resultIsNumber2 = 0.123456789 ? exprNumber1 : exprNumber2; >resultIsNumber2 : number >0.123456789 ? exprNumber1 : exprNumber2 : number +>0.123456789 : number >exprNumber1 : number >exprNumber2 : number @@ -220,18 +239,21 @@ var resultIsString2 = - 10000000000000 ? exprString1 : exprString2; >resultIsString2 : string >- 10000000000000 ? exprString1 : exprString2 : string >- 10000000000000 : number +>10000000000000 : number >exprString1 : string >exprString2 : string var resultIsObject2 = 1000000000000 ? exprIsObject1 : exprIsObject2; >resultIsObject2 : Object >1000000000000 ? exprIsObject1 : exprIsObject2 : Object +>1000000000000 : number >exprIsObject1 : Object >exprIsObject2 : Object var resultIsStringOrBoolean2 = 10000 ? exprString1 : exprBoolean1; // Union >resultIsStringOrBoolean2 : string | boolean >10000 ? exprString1 : exprBoolean1 : string | boolean +>10000 : number >exprString1 : string >exprBoolean1 : boolean @@ -239,6 +261,8 @@ var resultIsAny3 = 1 * 0 ? exprAny1 : exprAny2; >resultIsAny3 : any >1 * 0 ? exprAny1 : exprAny2 : any >1 * 0 : number +>1 : number +>0 : number >exprAny1 : any >exprAny2 : any @@ -246,6 +270,8 @@ var resultIsBoolean3 = 1 + 1 ? exprBoolean1 : exprBoolean2; >resultIsBoolean3 : boolean >1 + 1 ? exprBoolean1 : exprBoolean2 : boolean >1 + 1 : number +>1 : number +>1 : number >exprBoolean1 : boolean >exprBoolean2 : boolean @@ -253,6 +279,7 @@ var resultIsNumber3 = "string".length ? exprNumber1 : exprNumber2; >resultIsNumber3 : number >"string".length ? exprNumber1 : exprNumber2 : number >"string".length : number +>"string" : string >length : number >exprNumber1 : number >exprNumber2 : number @@ -273,6 +300,7 @@ var resultIsObject3 = foo() / array[1] ? exprIsObject1 : exprIsObject2; >foo : () => number >array[1] : number >array : number[] +>1 : number >exprIsObject1 : Object >exprIsObject2 : Object @@ -284,6 +312,7 @@ var resultIsStringOrBoolean3 = foo() / array[1] ? exprString1 : exprBoolean1; // >foo : () => number >array[1] : number >array : number[] +>1 : number >exprString1 : string >exprBoolean1 : boolean diff --git a/tests/baselines/reference/conditionalOperatorConditionIsObjectType.symbols b/tests/baselines/reference/conditionalOperatorConditionIsObjectType.symbols new file mode 100644 index 00000000000..41f00e53b26 --- /dev/null +++ b/tests/baselines/reference/conditionalOperatorConditionIsObjectType.symbols @@ -0,0 +1,273 @@ +=== tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditionIsObjectType.ts === +//Cond ? Expr1 : Expr2, Cond is of object type, Expr1 and Expr2 have the same type +var condObject: Object; +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var exprAny1: any; +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsObjectType.ts, 3, 3)) + +var exprBoolean1: boolean; +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) + +var exprNumber1: number; +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsObjectType.ts, 5, 3)) + +var exprString1: string; +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsObjectType.ts, 6, 3)) + +var exprIsObject1: Object; +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsObjectType.ts, 7, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var exprAny2: any; +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsObjectType.ts, 9, 3)) + +var exprBoolean2: boolean; +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsObjectType.ts, 10, 3)) + +var exprNumber2: number; +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsObjectType.ts, 11, 3)) + +var exprString2: string; +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsObjectType.ts, 12, 3)) + +var exprIsObject2: Object; +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsObjectType.ts, 13, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +function foo() { }; +>foo : Symbol(foo, Decl(conditionalOperatorConditionIsObjectType.ts, 13, 26)) + +class C { static doIt: () => void }; +>C : Symbol(C, Decl(conditionalOperatorConditionIsObjectType.ts, 15, 19)) +>doIt : Symbol(C.doIt, Decl(conditionalOperatorConditionIsObjectType.ts, 16, 9)) + +//Cond is an object type variable +condObject ? exprAny1 : exprAny2; +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsObjectType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsObjectType.ts, 9, 3)) + +condObject ? exprBoolean1 : exprBoolean2; +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsObjectType.ts, 10, 3)) + +condObject ? exprNumber1 : exprNumber2; +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsObjectType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsObjectType.ts, 11, 3)) + +condObject ? exprString1 : exprString2; +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsObjectType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsObjectType.ts, 12, 3)) + +condObject ? exprIsObject1 : exprIsObject2; +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsObjectType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsObjectType.ts, 13, 3)) + +condObject ? exprString1 : exprBoolean1; // union +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsObjectType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) + +//Cond is an object type literal +((a: string) => a.length) ? exprAny1 : exprAny2; +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 27, 2)) +>a.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 27, 2)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsObjectType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsObjectType.ts, 9, 3)) + +((a: string) => a.length) ? exprBoolean1 : exprBoolean2; +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 28, 2)) +>a.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 28, 2)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsObjectType.ts, 10, 3)) + +({}) ? exprNumber1 : exprNumber2; +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsObjectType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsObjectType.ts, 11, 3)) + +({ a: 1, b: "s" }) ? exprString1 : exprString2; +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 30, 2)) +>b : Symbol(b, Decl(conditionalOperatorConditionIsObjectType.ts, 30, 8)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsObjectType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsObjectType.ts, 12, 3)) + +({ a: 1, b: "s" }) ? exprIsObject1 : exprIsObject2; +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 31, 2)) +>b : Symbol(b, Decl(conditionalOperatorConditionIsObjectType.ts, 31, 8)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsObjectType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsObjectType.ts, 13, 3)) + +({ a: 1, b: "s" }) ? exprString1: exprBoolean1; // union +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 32, 2)) +>b : Symbol(b, Decl(conditionalOperatorConditionIsObjectType.ts, 32, 8)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsObjectType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) + +//Cond is an object type expression +foo() ? exprAny1 : exprAny2; +>foo : Symbol(foo, Decl(conditionalOperatorConditionIsObjectType.ts, 13, 26)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsObjectType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsObjectType.ts, 9, 3)) + +new Date() ? exprBoolean1 : exprBoolean2; +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsObjectType.ts, 10, 3)) + +new C() ? exprNumber1 : exprNumber2; +>C : Symbol(C, Decl(conditionalOperatorConditionIsObjectType.ts, 15, 19)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsObjectType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsObjectType.ts, 11, 3)) + +C.doIt() ? exprString1 : exprString2; +>C.doIt : Symbol(C.doIt, Decl(conditionalOperatorConditionIsObjectType.ts, 16, 9)) +>C : Symbol(C, Decl(conditionalOperatorConditionIsObjectType.ts, 15, 19)) +>doIt : Symbol(C.doIt, Decl(conditionalOperatorConditionIsObjectType.ts, 16, 9)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsObjectType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsObjectType.ts, 12, 3)) + +condObject.valueOf() ? exprIsObject1 : exprIsObject2; +>condObject.valueOf : Symbol(Object.valueOf, Decl(lib.d.ts, 102, 29)) +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>valueOf : Symbol(Object.valueOf, Decl(lib.d.ts, 102, 29)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsObjectType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsObjectType.ts, 13, 3)) + +new Date() ? exprString1 : exprBoolean1; // union +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsObjectType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) + +//Results shoud be same as Expr1 and Expr2 +var resultIsAny1 = condObject ? exprAny1 : exprAny2; +>resultIsAny1 : Symbol(resultIsAny1, Decl(conditionalOperatorConditionIsObjectType.ts, 43, 3)) +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsObjectType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsObjectType.ts, 9, 3)) + +var resultIsBoolean1 = condObject ? exprBoolean1 : exprBoolean2; +>resultIsBoolean1 : Symbol(resultIsBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 44, 3)) +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsObjectType.ts, 10, 3)) + +var resultIsNumber1 = condObject ? exprNumber1 : exprNumber2; +>resultIsNumber1 : Symbol(resultIsNumber1, Decl(conditionalOperatorConditionIsObjectType.ts, 45, 3)) +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsObjectType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsObjectType.ts, 11, 3)) + +var resultIsString1 = condObject ? exprString1 : exprString2; +>resultIsString1 : Symbol(resultIsString1, Decl(conditionalOperatorConditionIsObjectType.ts, 46, 3)) +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsObjectType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsObjectType.ts, 12, 3)) + +var resultIsObject1 = condObject ? exprIsObject1 : exprIsObject2; +>resultIsObject1 : Symbol(resultIsObject1, Decl(conditionalOperatorConditionIsObjectType.ts, 47, 3)) +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsObjectType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsObjectType.ts, 13, 3)) + +var resultIsStringOrBoolean1 = condObject ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean1 : Symbol(resultIsStringOrBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 48, 3)) +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsObjectType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) + +var resultIsAny2 = ((a: string) => a.length) ? exprAny1 : exprAny2; +>resultIsAny2 : Symbol(resultIsAny2, Decl(conditionalOperatorConditionIsObjectType.ts, 50, 3)) +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 50, 21)) +>a.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 50, 21)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsObjectType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsObjectType.ts, 9, 3)) + +var resultIsBoolean2 = ((a: string) => a.length) ? exprBoolean1 : exprBoolean2; +>resultIsBoolean2 : Symbol(resultIsBoolean2, Decl(conditionalOperatorConditionIsObjectType.ts, 51, 3)) +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 51, 25)) +>a.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 51, 25)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsObjectType.ts, 10, 3)) + +var resultIsNumber2 = ({}) ? exprNumber1 : exprNumber2; +>resultIsNumber2 : Symbol(resultIsNumber2, Decl(conditionalOperatorConditionIsObjectType.ts, 52, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsObjectType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsObjectType.ts, 11, 3)) + +var resultIsString2 = ({ a: 1, b: "s" }) ? exprString1 : exprString2; +>resultIsString2 : Symbol(resultIsString2, Decl(conditionalOperatorConditionIsObjectType.ts, 53, 3)) +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 53, 24)) +>b : Symbol(b, Decl(conditionalOperatorConditionIsObjectType.ts, 53, 30)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsObjectType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsObjectType.ts, 12, 3)) + +var resultIsObject2 = ({ a: 1, b: "s" }) ? exprIsObject1 : exprIsObject2; +>resultIsObject2 : Symbol(resultIsObject2, Decl(conditionalOperatorConditionIsObjectType.ts, 54, 3)) +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 54, 24)) +>b : Symbol(b, Decl(conditionalOperatorConditionIsObjectType.ts, 54, 30)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsObjectType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsObjectType.ts, 13, 3)) + +var resultIsStringOrBoolean2 = ({ a: 1, b: "s" }) ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean2 : Symbol(resultIsStringOrBoolean2, Decl(conditionalOperatorConditionIsObjectType.ts, 55, 3)) +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 55, 33)) +>b : Symbol(b, Decl(conditionalOperatorConditionIsObjectType.ts, 55, 39)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsObjectType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) + +var resultIsAny3 = foo() ? exprAny1 : exprAny2; +>resultIsAny3 : Symbol(resultIsAny3, Decl(conditionalOperatorConditionIsObjectType.ts, 57, 3)) +>foo : Symbol(foo, Decl(conditionalOperatorConditionIsObjectType.ts, 13, 26)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsObjectType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsObjectType.ts, 9, 3)) + +var resultIsBoolean3 = new Date() ? exprBoolean1 : exprBoolean2; +>resultIsBoolean3 : Symbol(resultIsBoolean3, Decl(conditionalOperatorConditionIsObjectType.ts, 58, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsObjectType.ts, 10, 3)) + +var resultIsNumber3 = new C() ? exprNumber1 : exprNumber2; +>resultIsNumber3 : Symbol(resultIsNumber3, Decl(conditionalOperatorConditionIsObjectType.ts, 59, 3)) +>C : Symbol(C, Decl(conditionalOperatorConditionIsObjectType.ts, 15, 19)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsObjectType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsObjectType.ts, 11, 3)) + +var resultIsString3 = C.doIt() ? exprString1 : exprString2; +>resultIsString3 : Symbol(resultIsString3, Decl(conditionalOperatorConditionIsObjectType.ts, 60, 3)) +>C.doIt : Symbol(C.doIt, Decl(conditionalOperatorConditionIsObjectType.ts, 16, 9)) +>C : Symbol(C, Decl(conditionalOperatorConditionIsObjectType.ts, 15, 19)) +>doIt : Symbol(C.doIt, Decl(conditionalOperatorConditionIsObjectType.ts, 16, 9)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsObjectType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsObjectType.ts, 12, 3)) + +var resultIsObject3 = condObject.valueOf() ? exprIsObject1 : exprIsObject2; +>resultIsObject3 : Symbol(resultIsObject3, Decl(conditionalOperatorConditionIsObjectType.ts, 61, 3)) +>condObject.valueOf : Symbol(Object.valueOf, Decl(lib.d.ts, 102, 29)) +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>valueOf : Symbol(Object.valueOf, Decl(lib.d.ts, 102, 29)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsObjectType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsObjectType.ts, 13, 3)) + +var resultIsStringOrBoolean3 = C.doIt() ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean3 : Symbol(resultIsStringOrBoolean3, Decl(conditionalOperatorConditionIsObjectType.ts, 62, 3)) +>C.doIt : Symbol(C.doIt, Decl(conditionalOperatorConditionIsObjectType.ts, 16, 9)) +>C : Symbol(C, Decl(conditionalOperatorConditionIsObjectType.ts, 15, 19)) +>doIt : Symbol(C.doIt, Decl(conditionalOperatorConditionIsObjectType.ts, 16, 9)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsObjectType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) + diff --git a/tests/baselines/reference/conditionalOperatorConditionIsObjectType.types b/tests/baselines/reference/conditionalOperatorConditionIsObjectType.types index f99c591b593..14a0f375ead 100644 --- a/tests/baselines/reference/conditionalOperatorConditionIsObjectType.types +++ b/tests/baselines/reference/conditionalOperatorConditionIsObjectType.types @@ -115,7 +115,9 @@ condObject ? exprString1 : exprBoolean1; // union >({ a: 1, b: "s" }) : { a: number; b: string; } >{ a: 1, b: "s" } : { a: number; b: string; } >a : number +>1 : number >b : string +>"s" : string >exprString1 : string >exprString2 : string @@ -124,7 +126,9 @@ condObject ? exprString1 : exprBoolean1; // union >({ a: 1, b: "s" }) : { a: number; b: string; } >{ a: 1, b: "s" } : { a: number; b: string; } >a : number +>1 : number >b : string +>"s" : string >exprIsObject1 : Object >exprIsObject2 : Object @@ -133,7 +137,9 @@ condObject ? exprString1 : exprBoolean1; // union >({ a: 1, b: "s" }) : { a: number; b: string; } >{ a: 1, b: "s" } : { a: number; b: string; } >a : number +>1 : number >b : string +>"s" : string >exprString1 : string >exprBoolean1 : boolean @@ -265,7 +271,9 @@ var resultIsString2 = ({ a: 1, b: "s" }) ? exprString1 : exprString2; >({ a: 1, b: "s" }) : { a: number; b: string; } >{ a: 1, b: "s" } : { a: number; b: string; } >a : number +>1 : number >b : string +>"s" : string >exprString1 : string >exprString2 : string @@ -275,7 +283,9 @@ var resultIsObject2 = ({ a: 1, b: "s" }) ? exprIsObject1 : exprIsObject2; >({ a: 1, b: "s" }) : { a: number; b: string; } >{ a: 1, b: "s" } : { a: number; b: string; } >a : number +>1 : number >b : string +>"s" : string >exprIsObject1 : Object >exprIsObject2 : Object @@ -285,7 +295,9 @@ var resultIsStringOrBoolean2 = ({ a: 1, b: "s" }) ? exprString1 : exprBoolean1; >({ a: 1, b: "s" }) : { a: number; b: string; } >{ a: 1, b: "s" } : { a: number; b: string; } >a : number +>1 : number >b : string +>"s" : string >exprString1 : string >exprBoolean1 : boolean diff --git a/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.symbols b/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.symbols new file mode 100644 index 00000000000..aaaf4124eb6 --- /dev/null +++ b/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.symbols @@ -0,0 +1,251 @@ +=== tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditoinIsAnyType.ts === +//Cond ? Expr1 : Expr2, Cond is of any type, Expr1 and Expr2 have the same type +var condAny: any; +>condAny : Symbol(condAny, Decl(conditionalOperatorConditoinIsAnyType.ts, 1, 3)) + +var x: any; +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) + +var exprAny1: any; +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsAnyType.ts, 4, 3)) + +var exprBoolean1: boolean; +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) + +var exprNumber1: number; +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsAnyType.ts, 6, 3)) + +var exprString1: string; +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) + +var exprIsObject1: Object; +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsAnyType.ts, 8, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var exprAny2: any; +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsAnyType.ts, 10, 3)) + +var exprBoolean2: boolean; +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsAnyType.ts, 11, 3)) + +var exprNumber2: number; +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsAnyType.ts, 12, 3)) + +var exprString2: string; +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsAnyType.ts, 13, 3)) + +var exprIsObject2: Object; +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsAnyType.ts, 14, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +//Cond is an any type variable +condAny ? exprAny1 : exprAny2; +>condAny : Symbol(condAny, Decl(conditionalOperatorConditoinIsAnyType.ts, 1, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsAnyType.ts, 4, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsAnyType.ts, 10, 3)) + +condAny ? exprBoolean1 : exprBoolean2; +>condAny : Symbol(condAny, Decl(conditionalOperatorConditoinIsAnyType.ts, 1, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsAnyType.ts, 11, 3)) + +condAny ? exprNumber1 : exprNumber2; +>condAny : Symbol(condAny, Decl(conditionalOperatorConditoinIsAnyType.ts, 1, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsAnyType.ts, 6, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsAnyType.ts, 12, 3)) + +condAny ? exprString1 : exprString2; +>condAny : Symbol(condAny, Decl(conditionalOperatorConditoinIsAnyType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsAnyType.ts, 13, 3)) + +condAny ? exprIsObject1 : exprIsObject2; +>condAny : Symbol(condAny, Decl(conditionalOperatorConditoinIsAnyType.ts, 1, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsAnyType.ts, 8, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsAnyType.ts, 14, 3)) + +condAny ? exprString1 : exprBoolean1; // union +>condAny : Symbol(condAny, Decl(conditionalOperatorConditoinIsAnyType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) + +//Cond is an any type literal +null ? exprAny1 : exprAny2; +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsAnyType.ts, 4, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsAnyType.ts, 10, 3)) + +null ? exprBoolean1 : exprBoolean2; +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsAnyType.ts, 11, 3)) + +undefined ? exprNumber1 : exprNumber2; +>undefined : Symbol(undefined) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsAnyType.ts, 6, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsAnyType.ts, 12, 3)) + +[null, undefined] ? exprString1 : exprString2; +>undefined : Symbol(undefined) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsAnyType.ts, 13, 3)) + +[null, undefined] ? exprIsObject1 : exprIsObject2; +>undefined : Symbol(undefined) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsAnyType.ts, 8, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsAnyType.ts, 14, 3)) + +undefined ? exprString1 : exprBoolean1; // union +>undefined : Symbol(undefined) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) + +//Cond is an any type expression +x.doSomeThing() ? exprAny1 : exprAny2; +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsAnyType.ts, 4, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsAnyType.ts, 10, 3)) + +x("x") ? exprBoolean1 : exprBoolean2; +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsAnyType.ts, 11, 3)) + +x(x) ? exprNumber1 : exprNumber2; +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsAnyType.ts, 6, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsAnyType.ts, 12, 3)) + +x("x") ? exprString1 : exprString2; +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsAnyType.ts, 13, 3)) + +x.doSomeThing() ? exprIsObject1 : exprIsObject2; +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsAnyType.ts, 8, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsAnyType.ts, 14, 3)) + +x.doSomeThing() ? exprString1 : exprBoolean1; // union +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) + +//Results shoud be same as Expr1 and Expr2 +var resultIsAny1 = condAny ? exprAny1 : exprAny2; +>resultIsAny1 : Symbol(resultIsAny1, Decl(conditionalOperatorConditoinIsAnyType.ts, 41, 3)) +>condAny : Symbol(condAny, Decl(conditionalOperatorConditoinIsAnyType.ts, 1, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsAnyType.ts, 4, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsAnyType.ts, 10, 3)) + +var resultIsBoolean1 = condAny ? exprBoolean1 : exprBoolean2; +>resultIsBoolean1 : Symbol(resultIsBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 42, 3)) +>condAny : Symbol(condAny, Decl(conditionalOperatorConditoinIsAnyType.ts, 1, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsAnyType.ts, 11, 3)) + +var resultIsNumber1 = condAny ? exprNumber1 : exprNumber2; +>resultIsNumber1 : Symbol(resultIsNumber1, Decl(conditionalOperatorConditoinIsAnyType.ts, 43, 3)) +>condAny : Symbol(condAny, Decl(conditionalOperatorConditoinIsAnyType.ts, 1, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsAnyType.ts, 6, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsAnyType.ts, 12, 3)) + +var resultIsString1 = condAny ? exprString1 : exprString2; +>resultIsString1 : Symbol(resultIsString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 44, 3)) +>condAny : Symbol(condAny, Decl(conditionalOperatorConditoinIsAnyType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsAnyType.ts, 13, 3)) + +var resultIsObject1 = condAny ? exprIsObject1 : exprIsObject2; +>resultIsObject1 : Symbol(resultIsObject1, Decl(conditionalOperatorConditoinIsAnyType.ts, 45, 3)) +>condAny : Symbol(condAny, Decl(conditionalOperatorConditoinIsAnyType.ts, 1, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsAnyType.ts, 8, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsAnyType.ts, 14, 3)) + +var resultIsStringOrBoolean1 = condAny ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean1 : Symbol(resultIsStringOrBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 46, 3)) +>condAny : Symbol(condAny, Decl(conditionalOperatorConditoinIsAnyType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) + +var resultIsAny2 = null ? exprAny1 : exprAny2; +>resultIsAny2 : Symbol(resultIsAny2, Decl(conditionalOperatorConditoinIsAnyType.ts, 48, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsAnyType.ts, 4, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsAnyType.ts, 10, 3)) + +var resultIsBoolean2 = null ? exprBoolean1 : exprBoolean2; +>resultIsBoolean2 : Symbol(resultIsBoolean2, Decl(conditionalOperatorConditoinIsAnyType.ts, 49, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsAnyType.ts, 11, 3)) + +var resultIsNumber2 = undefined ? exprNumber1 : exprNumber2; +>resultIsNumber2 : Symbol(resultIsNumber2, Decl(conditionalOperatorConditoinIsAnyType.ts, 50, 3)) +>undefined : Symbol(undefined) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsAnyType.ts, 6, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsAnyType.ts, 12, 3)) + +var resultIsString2 = [null, undefined] ? exprString1 : exprString2; +>resultIsString2 : Symbol(resultIsString2, Decl(conditionalOperatorConditoinIsAnyType.ts, 51, 3)) +>undefined : Symbol(undefined) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsAnyType.ts, 13, 3)) + +var resultIsObject2 = [null, undefined] ? exprIsObject1 : exprIsObject2; +>resultIsObject2 : Symbol(resultIsObject2, Decl(conditionalOperatorConditoinIsAnyType.ts, 52, 3)) +>undefined : Symbol(undefined) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsAnyType.ts, 8, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsAnyType.ts, 14, 3)) + +var resultIsStringOrBoolean2 = null ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean2 : Symbol(resultIsStringOrBoolean2, Decl(conditionalOperatorConditoinIsAnyType.ts, 53, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) + +var resultIsStringOrBoolean3 = undefined ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean3 : Symbol(resultIsStringOrBoolean3, Decl(conditionalOperatorConditoinIsAnyType.ts, 54, 3)) +>undefined : Symbol(undefined) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) + +var resultIsStringOrBoolean4 = [null, undefined] ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean4 : Symbol(resultIsStringOrBoolean4, Decl(conditionalOperatorConditoinIsAnyType.ts, 55, 3)) +>undefined : Symbol(undefined) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) + +var resultIsAny3 = x.doSomeThing() ? exprAny1 : exprAny2; +>resultIsAny3 : Symbol(resultIsAny3, Decl(conditionalOperatorConditoinIsAnyType.ts, 57, 3)) +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsAnyType.ts, 4, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsAnyType.ts, 10, 3)) + +var resultIsBoolean3 = x("x") ? exprBoolean1 : exprBoolean2; +>resultIsBoolean3 : Symbol(resultIsBoolean3, Decl(conditionalOperatorConditoinIsAnyType.ts, 58, 3)) +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsAnyType.ts, 11, 3)) + +var resultIsNumber3 = x(x) ? exprNumber1 : exprNumber2; +>resultIsNumber3 : Symbol(resultIsNumber3, Decl(conditionalOperatorConditoinIsAnyType.ts, 59, 3)) +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsAnyType.ts, 6, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsAnyType.ts, 12, 3)) + +var resultIsString3 = x("x") ? exprString1 : exprString2; +>resultIsString3 : Symbol(resultIsString3, Decl(conditionalOperatorConditoinIsAnyType.ts, 60, 3)) +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsAnyType.ts, 13, 3)) + +var resultIsObject3 = x.doSomeThing() ? exprIsObject1 : exprIsObject2; +>resultIsObject3 : Symbol(resultIsObject3, Decl(conditionalOperatorConditoinIsAnyType.ts, 61, 3)) +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsAnyType.ts, 8, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsAnyType.ts, 14, 3)) + +var resultIsStringOrBoolean5 = x.doSomeThing() ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean5 : Symbol(resultIsStringOrBoolean5, Decl(conditionalOperatorConditoinIsAnyType.ts, 62, 3)) +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) + diff --git a/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.types b/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.types index 6542377795f..d79e570ec42 100644 --- a/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.types +++ b/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.types @@ -78,11 +78,13 @@ condAny ? exprString1 : exprBoolean1; // union //Cond is an any type literal null ? exprAny1 : exprAny2; >null ? exprAny1 : exprAny2 : any +>null : null >exprAny1 : any >exprAny2 : any null ? exprBoolean1 : exprBoolean2; >null ? exprBoolean1 : exprBoolean2 : boolean +>null : null >exprBoolean1 : boolean >exprBoolean2 : boolean @@ -95,6 +97,7 @@ undefined ? exprNumber1 : exprNumber2; [null, undefined] ? exprString1 : exprString2; >[null, undefined] ? exprString1 : exprString2 : string >[null, undefined] : null[] +>null : null >undefined : undefined >exprString1 : string >exprString2 : string @@ -102,6 +105,7 @@ undefined ? exprNumber1 : exprNumber2; [null, undefined] ? exprIsObject1 : exprIsObject2; >[null, undefined] ? exprIsObject1 : exprIsObject2 : Object >[null, undefined] : null[] +>null : null >undefined : undefined >exprIsObject1 : Object >exprIsObject2 : Object @@ -126,6 +130,7 @@ x("x") ? exprBoolean1 : exprBoolean2; >x("x") ? exprBoolean1 : exprBoolean2 : boolean >x("x") : any >x : any +>"x" : string >exprBoolean1 : boolean >exprBoolean2 : boolean @@ -141,6 +146,7 @@ x("x") ? exprString1 : exprString2; >x("x") ? exprString1 : exprString2 : string >x("x") : any >x : any +>"x" : string >exprString1 : string >exprString2 : string @@ -208,12 +214,14 @@ var resultIsStringOrBoolean1 = condAny ? exprString1 : exprBoolean1; // union var resultIsAny2 = null ? exprAny1 : exprAny2; >resultIsAny2 : any >null ? exprAny1 : exprAny2 : any +>null : null >exprAny1 : any >exprAny2 : any var resultIsBoolean2 = null ? exprBoolean1 : exprBoolean2; >resultIsBoolean2 : boolean >null ? exprBoolean1 : exprBoolean2 : boolean +>null : null >exprBoolean1 : boolean >exprBoolean2 : boolean @@ -228,6 +236,7 @@ var resultIsString2 = [null, undefined] ? exprString1 : exprString2; >resultIsString2 : string >[null, undefined] ? exprString1 : exprString2 : string >[null, undefined] : null[] +>null : null >undefined : undefined >exprString1 : string >exprString2 : string @@ -236,6 +245,7 @@ var resultIsObject2 = [null, undefined] ? exprIsObject1 : exprIsObject2; >resultIsObject2 : Object >[null, undefined] ? exprIsObject1 : exprIsObject2 : Object >[null, undefined] : null[] +>null : null >undefined : undefined >exprIsObject1 : Object >exprIsObject2 : Object @@ -243,6 +253,7 @@ var resultIsObject2 = [null, undefined] ? exprIsObject1 : exprIsObject2; var resultIsStringOrBoolean2 = null ? exprString1 : exprBoolean1; // union >resultIsStringOrBoolean2 : string | boolean >null ? exprString1 : exprBoolean1 : string | boolean +>null : null >exprString1 : string >exprBoolean1 : boolean @@ -257,6 +268,7 @@ var resultIsStringOrBoolean4 = [null, undefined] ? exprString1 : exprBoolean1; / >resultIsStringOrBoolean4 : string | boolean >[null, undefined] ? exprString1 : exprBoolean1 : string | boolean >[null, undefined] : null[] +>null : null >undefined : undefined >exprString1 : string >exprBoolean1 : boolean @@ -276,6 +288,7 @@ var resultIsBoolean3 = x("x") ? exprBoolean1 : exprBoolean2; >x("x") ? exprBoolean1 : exprBoolean2 : boolean >x("x") : any >x : any +>"x" : string >exprBoolean1 : boolean >exprBoolean2 : boolean @@ -293,6 +306,7 @@ var resultIsString3 = x("x") ? exprString1 : exprString2; >x("x") ? exprString1 : exprString2 : string >x("x") : any >x : any +>"x" : string >exprString1 : string >exprString2 : string diff --git a/tests/baselines/reference/conditionalOperatorConditoinIsStringType.symbols b/tests/baselines/reference/conditionalOperatorConditoinIsStringType.symbols new file mode 100644 index 00000000000..76845a80ce6 --- /dev/null +++ b/tests/baselines/reference/conditionalOperatorConditoinIsStringType.symbols @@ -0,0 +1,245 @@ +=== tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditoinIsStringType.ts === +//Cond ? Expr1 : Expr2, Cond is of string type, Expr1 and Expr2 have the same type +var condString: string; +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) + +var exprAny1: any; +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsStringType.ts, 3, 3)) + +var exprBoolean1: boolean; +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) + +var exprNumber1: number; +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsStringType.ts, 5, 3)) + +var exprString1: string; +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) + +var exprIsObject1: Object; +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsStringType.ts, 7, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var exprAny2: any; +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsStringType.ts, 9, 3)) + +var exprBoolean2: boolean; +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsStringType.ts, 10, 3)) + +var exprNumber2: number; +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsStringType.ts, 11, 3)) + +var exprString2: string; +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsStringType.ts, 12, 3)) + +var exprIsObject2: Object; +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsStringType.ts, 13, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +//Cond is a string type variable +condString ? exprAny1 : exprAny2; +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsStringType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsStringType.ts, 9, 3)) + +condString ? exprBoolean1 : exprBoolean2; +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsStringType.ts, 10, 3)) + +condString ? exprNumber1 : exprNumber2; +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsStringType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsStringType.ts, 11, 3)) + +condString ? exprString1 : exprString2; +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsStringType.ts, 12, 3)) + +condString ? exprIsObject1 : exprIsObject2; +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsStringType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsStringType.ts, 13, 3)) + +condString ? exprString1 : exprBoolean1; // union +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) + +//Cond is a string type literal +"" ? exprAny1 : exprAny2; +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsStringType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsStringType.ts, 9, 3)) + +"string" ? exprBoolean1 : exprBoolean2; +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsStringType.ts, 10, 3)) + +'c' ? exprNumber1 : exprNumber2; +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsStringType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsStringType.ts, 11, 3)) + +'string' ? exprString1 : exprString2; +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsStringType.ts, 12, 3)) + +" " ? exprIsObject1 : exprIsObject2; +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsStringType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsStringType.ts, 13, 3)) + +"hello " ? exprString1 : exprBoolean1; // union +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) + +//Cond is a string type expression +function foo() { return "string" }; +>foo : Symbol(foo, Decl(conditionalOperatorConditoinIsStringType.ts, 29, 38)) + +var array = ["1", "2", "3"]; +>array : Symbol(array, Decl(conditionalOperatorConditoinIsStringType.ts, 33, 3)) + +typeof condString ? exprAny1 : exprAny2; +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsStringType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsStringType.ts, 9, 3)) + +condString.toUpperCase ? exprBoolean1 : exprBoolean2; +>condString.toUpperCase : Symbol(String.toUpperCase, Decl(lib.d.ts, 405, 32)) +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>toUpperCase : Symbol(String.toUpperCase, Decl(lib.d.ts, 405, 32)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsStringType.ts, 10, 3)) + +condString + "string" ? exprNumber1 : exprNumber2; +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsStringType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsStringType.ts, 11, 3)) + +foo() ? exprString1 : exprString2; +>foo : Symbol(foo, Decl(conditionalOperatorConditoinIsStringType.ts, 29, 38)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsStringType.ts, 12, 3)) + +array[1] ? exprIsObject1 : exprIsObject2; +>array : Symbol(array, Decl(conditionalOperatorConditoinIsStringType.ts, 33, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsStringType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsStringType.ts, 13, 3)) + +foo() ? exprString1 : exprBoolean1; // union +>foo : Symbol(foo, Decl(conditionalOperatorConditoinIsStringType.ts, 29, 38)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) + +//Results shoud be same as Expr1 and Expr2 +var resultIsAny1 = condString ? exprAny1 : exprAny2; +>resultIsAny1 : Symbol(resultIsAny1, Decl(conditionalOperatorConditoinIsStringType.ts, 43, 3)) +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsStringType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsStringType.ts, 9, 3)) + +var resultIsBoolean1 = condString ? exprBoolean1 : exprBoolean2; +>resultIsBoolean1 : Symbol(resultIsBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 44, 3)) +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsStringType.ts, 10, 3)) + +var resultIsNumber1 = condString ? exprNumber1 : exprNumber2; +>resultIsNumber1 : Symbol(resultIsNumber1, Decl(conditionalOperatorConditoinIsStringType.ts, 45, 3)) +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsStringType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsStringType.ts, 11, 3)) + +var resultIsString1 = condString ? exprString1 : exprString2; +>resultIsString1 : Symbol(resultIsString1, Decl(conditionalOperatorConditoinIsStringType.ts, 46, 3)) +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsStringType.ts, 12, 3)) + +var resultIsObject1 = condString ? exprIsObject1 : exprIsObject2; +>resultIsObject1 : Symbol(resultIsObject1, Decl(conditionalOperatorConditoinIsStringType.ts, 47, 3)) +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsStringType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsStringType.ts, 13, 3)) + +var resultIsStringOrBoolean1 = condString ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean1 : Symbol(resultIsStringOrBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 48, 3)) +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) + +var resultIsAny2 = "" ? exprAny1 : exprAny2; +>resultIsAny2 : Symbol(resultIsAny2, Decl(conditionalOperatorConditoinIsStringType.ts, 50, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsStringType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsStringType.ts, 9, 3)) + +var resultIsBoolean2 = "string" ? exprBoolean1 : exprBoolean2; +>resultIsBoolean2 : Symbol(resultIsBoolean2, Decl(conditionalOperatorConditoinIsStringType.ts, 51, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsStringType.ts, 10, 3)) + +var resultIsNumber2 = 'c' ? exprNumber1 : exprNumber2; +>resultIsNumber2 : Symbol(resultIsNumber2, Decl(conditionalOperatorConditoinIsStringType.ts, 52, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsStringType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsStringType.ts, 11, 3)) + +var resultIsString2 = 'string' ? exprString1 : exprString2; +>resultIsString2 : Symbol(resultIsString2, Decl(conditionalOperatorConditoinIsStringType.ts, 53, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsStringType.ts, 12, 3)) + +var resultIsObject2 = " " ? exprIsObject1 : exprIsObject2; +>resultIsObject2 : Symbol(resultIsObject2, Decl(conditionalOperatorConditoinIsStringType.ts, 54, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsStringType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsStringType.ts, 13, 3)) + +var resultIsStringOrBoolean2 = "hello" ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean2 : Symbol(resultIsStringOrBoolean2, Decl(conditionalOperatorConditoinIsStringType.ts, 55, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) + +var resultIsAny3 = typeof condString ? exprAny1 : exprAny2; +>resultIsAny3 : Symbol(resultIsAny3, Decl(conditionalOperatorConditoinIsStringType.ts, 57, 3)) +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsStringType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsStringType.ts, 9, 3)) + +var resultIsBoolean3 = condString.toUpperCase ? exprBoolean1 : exprBoolean2; +>resultIsBoolean3 : Symbol(resultIsBoolean3, Decl(conditionalOperatorConditoinIsStringType.ts, 58, 3)) +>condString.toUpperCase : Symbol(String.toUpperCase, Decl(lib.d.ts, 405, 32)) +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>toUpperCase : Symbol(String.toUpperCase, Decl(lib.d.ts, 405, 32)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsStringType.ts, 10, 3)) + +var resultIsNumber3 = condString + "string" ? exprNumber1 : exprNumber2; +>resultIsNumber3 : Symbol(resultIsNumber3, Decl(conditionalOperatorConditoinIsStringType.ts, 59, 3)) +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsStringType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsStringType.ts, 11, 3)) + +var resultIsString3 = foo() ? exprString1 : exprString2; +>resultIsString3 : Symbol(resultIsString3, Decl(conditionalOperatorConditoinIsStringType.ts, 60, 3)) +>foo : Symbol(foo, Decl(conditionalOperatorConditoinIsStringType.ts, 29, 38)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsStringType.ts, 12, 3)) + +var resultIsObject3 = array[1] ? exprIsObject1 : exprIsObject2; +>resultIsObject3 : Symbol(resultIsObject3, Decl(conditionalOperatorConditoinIsStringType.ts, 61, 3)) +>array : Symbol(array, Decl(conditionalOperatorConditoinIsStringType.ts, 33, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsStringType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsStringType.ts, 13, 3)) + +var resultIsStringOrBoolean3 = typeof condString ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean3 : Symbol(resultIsStringOrBoolean3, Decl(conditionalOperatorConditoinIsStringType.ts, 62, 3)) +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) + +var resultIsStringOrBoolean4 = condString.toUpperCase ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean4 : Symbol(resultIsStringOrBoolean4, Decl(conditionalOperatorConditoinIsStringType.ts, 63, 3)) +>condString.toUpperCase : Symbol(String.toUpperCase, Decl(lib.d.ts, 405, 32)) +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>toUpperCase : Symbol(String.toUpperCase, Decl(lib.d.ts, 405, 32)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) + diff --git a/tests/baselines/reference/conditionalOperatorConditoinIsStringType.types b/tests/baselines/reference/conditionalOperatorConditoinIsStringType.types index 45a4db8d295..af5abb25063 100644 --- a/tests/baselines/reference/conditionalOperatorConditoinIsStringType.types +++ b/tests/baselines/reference/conditionalOperatorConditoinIsStringType.types @@ -75,41 +75,51 @@ condString ? exprString1 : exprBoolean1; // union //Cond is a string type literal "" ? exprAny1 : exprAny2; >"" ? exprAny1 : exprAny2 : any +>"" : string >exprAny1 : any >exprAny2 : any "string" ? exprBoolean1 : exprBoolean2; >"string" ? exprBoolean1 : exprBoolean2 : boolean +>"string" : string >exprBoolean1 : boolean >exprBoolean2 : boolean 'c' ? exprNumber1 : exprNumber2; >'c' ? exprNumber1 : exprNumber2 : number +>'c' : string >exprNumber1 : number >exprNumber2 : number 'string' ? exprString1 : exprString2; >'string' ? exprString1 : exprString2 : string +>'string' : string >exprString1 : string >exprString2 : string " " ? exprIsObject1 : exprIsObject2; >" " ? exprIsObject1 : exprIsObject2 : Object +>" " : string >exprIsObject1 : Object >exprIsObject2 : Object "hello " ? exprString1 : exprBoolean1; // union >"hello " ? exprString1 : exprBoolean1 : string | boolean +>"hello " : string >exprString1 : string >exprBoolean1 : boolean //Cond is a string type expression function foo() { return "string" }; >foo : () => string +>"string" : string var array = ["1", "2", "3"]; >array : string[] >["1", "2", "3"] : string[] +>"1" : string +>"2" : string +>"3" : string typeof condString ? exprAny1 : exprAny2; >typeof condString ? exprAny1 : exprAny2 : any @@ -130,6 +140,7 @@ condString + "string" ? exprNumber1 : exprNumber2; >condString + "string" ? exprNumber1 : exprNumber2 : number >condString + "string" : string >condString : string +>"string" : string >exprNumber1 : number >exprNumber2 : number @@ -144,6 +155,7 @@ array[1] ? exprIsObject1 : exprIsObject2; >array[1] ? exprIsObject1 : exprIsObject2 : Object >array[1] : string >array : string[] +>1 : number >exprIsObject1 : Object >exprIsObject2 : Object @@ -200,36 +212,42 @@ var resultIsStringOrBoolean1 = condString ? exprString1 : exprBoolean1; // union var resultIsAny2 = "" ? exprAny1 : exprAny2; >resultIsAny2 : any >"" ? exprAny1 : exprAny2 : any +>"" : string >exprAny1 : any >exprAny2 : any var resultIsBoolean2 = "string" ? exprBoolean1 : exprBoolean2; >resultIsBoolean2 : boolean >"string" ? exprBoolean1 : exprBoolean2 : boolean +>"string" : string >exprBoolean1 : boolean >exprBoolean2 : boolean var resultIsNumber2 = 'c' ? exprNumber1 : exprNumber2; >resultIsNumber2 : number >'c' ? exprNumber1 : exprNumber2 : number +>'c' : string >exprNumber1 : number >exprNumber2 : number var resultIsString2 = 'string' ? exprString1 : exprString2; >resultIsString2 : string >'string' ? exprString1 : exprString2 : string +>'string' : string >exprString1 : string >exprString2 : string var resultIsObject2 = " " ? exprIsObject1 : exprIsObject2; >resultIsObject2 : Object >" " ? exprIsObject1 : exprIsObject2 : Object +>" " : string >exprIsObject1 : Object >exprIsObject2 : Object var resultIsStringOrBoolean2 = "hello" ? exprString1 : exprBoolean1; // union >resultIsStringOrBoolean2 : string | boolean >"hello" ? exprString1 : exprBoolean1 : string | boolean +>"hello" : string >exprString1 : string >exprBoolean1 : boolean @@ -255,6 +273,7 @@ var resultIsNumber3 = condString + "string" ? exprNumber1 : exprNumber2; >condString + "string" ? exprNumber1 : exprNumber2 : number >condString + "string" : string >condString : string +>"string" : string >exprNumber1 : number >exprNumber2 : number @@ -271,6 +290,7 @@ var resultIsObject3 = array[1] ? exprIsObject1 : exprIsObject2; >array[1] ? exprIsObject1 : exprIsObject2 : Object >array[1] : string >array : string[] +>1 : number >exprIsObject1 : Object >exprIsObject2 : Object diff --git a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.symbols b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.symbols new file mode 100644 index 00000000000..e4c2e43013d --- /dev/null +++ b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.symbols @@ -0,0 +1,149 @@ +=== tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithIdenticalBCT.ts === +//Cond ? Expr1 : Expr2, Expr1 and Expr2 have identical best common type +class X { propertyX: any; propertyX1: number; propertyX2: string }; +>X : Symbol(X, Decl(conditionalOperatorWithIdenticalBCT.ts, 0, 0)) +>propertyX : Symbol(propertyX, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 9)) +>propertyX1 : Symbol(propertyX1, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 25)) +>propertyX2 : Symbol(propertyX2, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 45)) + +class A extends X { propertyA: number }; +>A : Symbol(A, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 67)) +>X : Symbol(X, Decl(conditionalOperatorWithIdenticalBCT.ts, 0, 0)) +>propertyA : Symbol(propertyA, Decl(conditionalOperatorWithIdenticalBCT.ts, 2, 19)) + +class B extends X { propertyB: string }; +>B : Symbol(B, Decl(conditionalOperatorWithIdenticalBCT.ts, 2, 40)) +>X : Symbol(X, Decl(conditionalOperatorWithIdenticalBCT.ts, 0, 0)) +>propertyB : Symbol(propertyB, Decl(conditionalOperatorWithIdenticalBCT.ts, 3, 19)) + +var x: X; +>x : Symbol(x, Decl(conditionalOperatorWithIdenticalBCT.ts, 5, 3)) +>X : Symbol(X, Decl(conditionalOperatorWithIdenticalBCT.ts, 0, 0)) + +var a: A; +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 6, 3)) +>A : Symbol(A, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 67)) + +var b: B; +>b : Symbol(b, Decl(conditionalOperatorWithIdenticalBCT.ts, 7, 3)) +>B : Symbol(B, Decl(conditionalOperatorWithIdenticalBCT.ts, 2, 40)) + +//Cond ? Expr1 : Expr2, Expr1 is supertype +//Be Not contextually typed +true ? x : a; +>x : Symbol(x, Decl(conditionalOperatorWithIdenticalBCT.ts, 5, 3)) +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 6, 3)) + +var result1 = true ? x : a; +>result1 : Symbol(result1, Decl(conditionalOperatorWithIdenticalBCT.ts, 12, 3)) +>x : Symbol(x, Decl(conditionalOperatorWithIdenticalBCT.ts, 5, 3)) +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 6, 3)) + +//Expr1 and Expr2 are literals +true ? {} : 1; +true ? { a: 1 } : { a: 2, b: 'string' }; +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 16, 8)) +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 16, 19)) +>b : Symbol(b, Decl(conditionalOperatorWithIdenticalBCT.ts, 16, 25)) + +var result2 = true ? {} : 1; +>result2 : Symbol(result2, Decl(conditionalOperatorWithIdenticalBCT.ts, 17, 3)) + +var result3 = true ? { a: 1 } : { a: 2, b: 'string' }; +>result3 : Symbol(result3, Decl(conditionalOperatorWithIdenticalBCT.ts, 18, 3)) +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 18, 22)) +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 18, 33)) +>b : Symbol(b, Decl(conditionalOperatorWithIdenticalBCT.ts, 18, 39)) + +//Contextually typed +var resultIsX1: X = true ? x : a; +>resultIsX1 : Symbol(resultIsX1, Decl(conditionalOperatorWithIdenticalBCT.ts, 21, 3)) +>X : Symbol(X, Decl(conditionalOperatorWithIdenticalBCT.ts, 0, 0)) +>x : Symbol(x, Decl(conditionalOperatorWithIdenticalBCT.ts, 5, 3)) +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 6, 3)) + +var result4: (t: A) => any = true ? (m) => m.propertyX : (n) => n.propertyA; +>result4 : Symbol(result4, Decl(conditionalOperatorWithIdenticalBCT.ts, 22, 3)) +>t : Symbol(t, Decl(conditionalOperatorWithIdenticalBCT.ts, 22, 14)) +>A : Symbol(A, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 67)) +>m : Symbol(m, Decl(conditionalOperatorWithIdenticalBCT.ts, 22, 37)) +>m.propertyX : Symbol(X.propertyX, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 9)) +>m : Symbol(m, Decl(conditionalOperatorWithIdenticalBCT.ts, 22, 37)) +>propertyX : Symbol(X.propertyX, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 9)) +>n : Symbol(n, Decl(conditionalOperatorWithIdenticalBCT.ts, 22, 58)) +>n.propertyA : Symbol(A.propertyA, Decl(conditionalOperatorWithIdenticalBCT.ts, 2, 19)) +>n : Symbol(n, Decl(conditionalOperatorWithIdenticalBCT.ts, 22, 58)) +>propertyA : Symbol(A.propertyA, Decl(conditionalOperatorWithIdenticalBCT.ts, 2, 19)) + +//Cond ? Expr1 : Expr2, Expr2 is supertype +//Be Not contextually typed +true ? a : x; +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 6, 3)) +>x : Symbol(x, Decl(conditionalOperatorWithIdenticalBCT.ts, 5, 3)) + +var result5 = true ? a : x; +>result5 : Symbol(result5, Decl(conditionalOperatorWithIdenticalBCT.ts, 27, 3)) +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 6, 3)) +>x : Symbol(x, Decl(conditionalOperatorWithIdenticalBCT.ts, 5, 3)) + +//Expr1 and Expr2 are literals +true ? 1 : {}; +true ? { a: 2, b: 'string' } : { a: 1 }; +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 31, 8)) +>b : Symbol(b, Decl(conditionalOperatorWithIdenticalBCT.ts, 31, 14)) +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 31, 32)) + +var result6 = true ? 1 : {}; +>result6 : Symbol(result6, Decl(conditionalOperatorWithIdenticalBCT.ts, 32, 3)) + +var result7 = true ? { a: 2, b: 'string' } : { a: 1 }; +>result7 : Symbol(result7, Decl(conditionalOperatorWithIdenticalBCT.ts, 33, 3)) +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 33, 22)) +>b : Symbol(b, Decl(conditionalOperatorWithIdenticalBCT.ts, 33, 28)) +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 33, 46)) + +//Contextually typed +var resultIsX2: X = true ? x : a; +>resultIsX2 : Symbol(resultIsX2, Decl(conditionalOperatorWithIdenticalBCT.ts, 36, 3)) +>X : Symbol(X, Decl(conditionalOperatorWithIdenticalBCT.ts, 0, 0)) +>x : Symbol(x, Decl(conditionalOperatorWithIdenticalBCT.ts, 5, 3)) +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 6, 3)) + +var result8: (t: A) => any = true ? (m) => m.propertyA : (n) => n.propertyX; +>result8 : Symbol(result8, Decl(conditionalOperatorWithIdenticalBCT.ts, 37, 3)) +>t : Symbol(t, Decl(conditionalOperatorWithIdenticalBCT.ts, 37, 14)) +>A : Symbol(A, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 67)) +>m : Symbol(m, Decl(conditionalOperatorWithIdenticalBCT.ts, 37, 37)) +>m.propertyA : Symbol(A.propertyA, Decl(conditionalOperatorWithIdenticalBCT.ts, 2, 19)) +>m : Symbol(m, Decl(conditionalOperatorWithIdenticalBCT.ts, 37, 37)) +>propertyA : Symbol(A.propertyA, Decl(conditionalOperatorWithIdenticalBCT.ts, 2, 19)) +>n : Symbol(n, Decl(conditionalOperatorWithIdenticalBCT.ts, 37, 58)) +>n.propertyX : Symbol(X.propertyX, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 9)) +>n : Symbol(n, Decl(conditionalOperatorWithIdenticalBCT.ts, 37, 58)) +>propertyX : Symbol(X.propertyX, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 9)) + +//Result = Cond ? Expr1 : Expr2, Result is supertype +//Contextually typed +var resultIsX3: X = true ? a : b; +>resultIsX3 : Symbol(resultIsX3, Decl(conditionalOperatorWithIdenticalBCT.ts, 41, 3)) +>X : Symbol(X, Decl(conditionalOperatorWithIdenticalBCT.ts, 0, 0)) +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 6, 3)) +>b : Symbol(b, Decl(conditionalOperatorWithIdenticalBCT.ts, 7, 3)) + +var result10: (t: X) => any = true ? (m) => m.propertyX1 : (n) => n.propertyX2; +>result10 : Symbol(result10, Decl(conditionalOperatorWithIdenticalBCT.ts, 42, 3)) +>t : Symbol(t, Decl(conditionalOperatorWithIdenticalBCT.ts, 42, 15)) +>X : Symbol(X, Decl(conditionalOperatorWithIdenticalBCT.ts, 0, 0)) +>m : Symbol(m, Decl(conditionalOperatorWithIdenticalBCT.ts, 42, 38)) +>m.propertyX1 : Symbol(X.propertyX1, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 25)) +>m : Symbol(m, Decl(conditionalOperatorWithIdenticalBCT.ts, 42, 38)) +>propertyX1 : Symbol(X.propertyX1, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 25)) +>n : Symbol(n, Decl(conditionalOperatorWithIdenticalBCT.ts, 42, 60)) +>n.propertyX2 : Symbol(X.propertyX2, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 45)) +>n : Symbol(n, Decl(conditionalOperatorWithIdenticalBCT.ts, 42, 60)) +>propertyX2 : Symbol(X.propertyX2, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 45)) + +//Expr1 and Expr2 are literals +var result11: any = true ? 1 : 'string'; +>result11 : Symbol(result11, Decl(conditionalOperatorWithIdenticalBCT.ts, 45, 3)) + diff --git a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types index f925f7f1db6..722ec13c684 100644 --- a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types +++ b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types @@ -32,47 +32,62 @@ var b: B; //Be Not contextually typed true ? x : a; >true ? x : a : X +>true : boolean >x : X >a : A var result1 = true ? x : a; >result1 : X >true ? x : a : X +>true : boolean >x : X >a : A //Expr1 and Expr2 are literals true ? {} : 1; >true ? {} : 1 : {} +>true : boolean >{} : {} +>1 : number true ? { a: 1 } : { a: 2, b: 'string' }; >true ? { a: 1 } : { a: 2, b: 'string' } : { a: number; } +>true : boolean >{ a: 1 } : { a: number; } >a : number +>1 : number >{ a: 2, b: 'string' } : { a: number; b: string; } >a : number +>2 : number >b : string +>'string' : string var result2 = true ? {} : 1; >result2 : {} >true ? {} : 1 : {} +>true : boolean >{} : {} +>1 : number var result3 = true ? { a: 1 } : { a: 2, b: 'string' }; >result3 : { a: number; } >true ? { a: 1 } : { a: 2, b: 'string' } : { a: number; } +>true : boolean >{ a: 1 } : { a: number; } >a : number +>1 : number >{ a: 2, b: 'string' } : { a: number; b: string; } >a : number +>2 : number >b : string +>'string' : string //Contextually typed var resultIsX1: X = true ? x : a; >resultIsX1 : X >X : X >true ? x : a : X +>true : boolean >x : X >a : A @@ -81,6 +96,7 @@ var result4: (t: A) => any = true ? (m) => m.propertyX : (n) => n.propertyA; >t : A >A : A >true ? (m) => m.propertyX : (n) => n.propertyA : (m: A) => any +>true : boolean >(m) => m.propertyX : (m: A) => any >m : A >m.propertyX : any @@ -96,47 +112,62 @@ var result4: (t: A) => any = true ? (m) => m.propertyX : (n) => n.propertyA; //Be Not contextually typed true ? a : x; >true ? a : x : X +>true : boolean >a : A >x : X var result5 = true ? a : x; >result5 : X >true ? a : x : X +>true : boolean >a : A >x : X //Expr1 and Expr2 are literals true ? 1 : {}; >true ? 1 : {} : {} +>true : boolean +>1 : number >{} : {} true ? { a: 2, b: 'string' } : { a: 1 }; >true ? { a: 2, b: 'string' } : { a: 1 } : { a: number; } +>true : boolean >{ a: 2, b: 'string' } : { a: number; b: string; } >a : number +>2 : number >b : string +>'string' : string >{ a: 1 } : { a: number; } >a : number +>1 : number var result6 = true ? 1 : {}; >result6 : {} >true ? 1 : {} : {} +>true : boolean +>1 : number >{} : {} var result7 = true ? { a: 2, b: 'string' } : { a: 1 }; >result7 : { a: number; } >true ? { a: 2, b: 'string' } : { a: 1 } : { a: number; } +>true : boolean >{ a: 2, b: 'string' } : { a: number; b: string; } >a : number +>2 : number >b : string +>'string' : string >{ a: 1 } : { a: number; } >a : number +>1 : number //Contextually typed var resultIsX2: X = true ? x : a; >resultIsX2 : X >X : X >true ? x : a : X +>true : boolean >x : X >a : A @@ -145,6 +176,7 @@ var result8: (t: A) => any = true ? (m) => m.propertyA : (n) => n.propertyX; >t : A >A : A >true ? (m) => m.propertyA : (n) => n.propertyX : (n: A) => any +>true : boolean >(m) => m.propertyA : (m: A) => number >m : A >m.propertyA : number @@ -162,6 +194,7 @@ var resultIsX3: X = true ? a : b; >resultIsX3 : X >X : X >true ? a : b : A | B +>true : boolean >a : A >b : B @@ -170,6 +203,7 @@ var result10: (t: X) => any = true ? (m) => m.propertyX1 : (n) => n.propertyX2; >t : X >X : X >true ? (m) => m.propertyX1 : (n) => n.propertyX2 : ((m: X) => number) | ((n: X) => string) +>true : boolean >(m) => m.propertyX1 : (m: X) => number >m : X >m.propertyX1 : number @@ -185,4 +219,7 @@ var result10: (t: X) => any = true ? (m) => m.propertyX1 : (n) => n.propertyX2; var result11: any = true ? 1 : 'string'; >result11 : any >true ? 1 : 'string' : string | number +>true : boolean +>1 : number +>'string' : string diff --git a/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.symbols b/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.symbols new file mode 100644 index 00000000000..85f6c7ee4eb --- /dev/null +++ b/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.symbols @@ -0,0 +1,71 @@ +=== tests/cases/compiler/conditionallyDuplicateOverloadsCausedByOverloadResolution.ts === +declare function foo(func: (x: string, y: string) => any): boolean; +>foo : Symbol(foo, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 0, 0), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 0, 67)) +>func : Symbol(func, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 0, 21)) +>x : Symbol(x, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 0, 28)) +>y : Symbol(y, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 0, 38)) + +declare function foo(func: (x: string, y: number) => any): string; +>foo : Symbol(foo, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 0, 0), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 0, 67)) +>func : Symbol(func, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 1, 21)) +>x : Symbol(x, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 1, 28)) +>y : Symbol(y, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 1, 38)) + +var out = foo((x, y) => { +>out : Symbol(out, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 3, 3)) +>foo : Symbol(foo, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 0, 0), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 0, 67)) +>x : Symbol(x, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 3, 15)) +>y : Symbol(y, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 3, 17)) + + function bar(a: typeof x): void; +>bar : Symbol(bar, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 3, 25), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 4, 36), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 5, 36)) +>a : Symbol(a, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 4, 17)) +>x : Symbol(x, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 3, 15)) + + function bar(b: typeof y): void; +>bar : Symbol(bar, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 3, 25), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 4, 36), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 5, 36)) +>b : Symbol(b, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 5, 17)) +>y : Symbol(y, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 3, 17)) + + function bar() { } +>bar : Symbol(bar, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 3, 25), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 4, 36), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 5, 36)) + + return bar; +>bar : Symbol(bar, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 3, 25), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 4, 36), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 5, 36)) + +}); + +declare function foo2(func: (x: string, y: string) => any): boolean; +>foo2 : Symbol(foo2, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 8, 3), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 10, 68)) +>func : Symbol(func, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 10, 22)) +>x : Symbol(x, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 10, 29)) +>y : Symbol(y, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 10, 39)) + +declare function foo2(func: (x: string, y: number) => any): string; +>foo2 : Symbol(foo2, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 8, 3), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 10, 68)) +>func : Symbol(func, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 11, 22)) +>x : Symbol(x, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 11, 29)) +>y : Symbol(y, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 11, 39)) + +var out2 = foo2((x, y) => { +>out2 : Symbol(out2, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 13, 3)) +>foo2 : Symbol(foo2, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 8, 3), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 10, 68)) +>x : Symbol(x, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 13, 17)) +>y : Symbol(y, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 13, 19)) + + var bar: { +>bar : Symbol(bar, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 14, 7)) + + (a: typeof x): void; +>a : Symbol(a, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 15, 9)) +>x : Symbol(x, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 13, 17)) + + (b: typeof y): void; +>b : Symbol(b, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 16, 9)) +>y : Symbol(y, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 13, 19)) + + }; + return bar; +>bar : Symbol(bar, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 14, 7)) + +}); diff --git a/tests/baselines/reference/conformanceFunctionOverloads.symbols b/tests/baselines/reference/conformanceFunctionOverloads.symbols new file mode 100644 index 00000000000..a80814ea93e --- /dev/null +++ b/tests/baselines/reference/conformanceFunctionOverloads.symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/functions/conformanceFunctionOverloads.ts === +// Function overloads do not emit code +No type information for this code. +No type information for this code.// Function overload signature with optional parameter +No type information for this code. +No type information for this code.// Function overload signature with optional parameter +No type information for this code. +No type information for this code.// Function overloads with generic and non-generic overloads +No type information for this code. +No type information for this code.// Function overloads whose only difference is returning different unconstrained generic parameters +No type information for this code. +No type information for this code.// Function overloads whose only difference is returning different constrained generic parameters +No type information for this code. +No type information for this code.// Function overloads that differ only by type parameter constraints +No type information for this code. +No type information for this code.// Function overloads with matching accessibility +No type information for this code. +No type information for this code.// Function overloads with matching export +No type information for this code. +No type information for this code.// Function overloads with more params than implementation signature +No type information for this code. +No type information for this code.// Function overloads where return types are same infinitely recursive type reference +No type information for this code. +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.symbols b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.symbols new file mode 100644 index 00000000000..db53aa8fb92 --- /dev/null +++ b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/constDeclarationShadowedByVarDeclaration2.ts === + +// No errors, const declaration is not shadowed +function outer() { +>outer : Symbol(outer, Decl(constDeclarationShadowedByVarDeclaration2.ts, 0, 0)) + + const x = 0; +>x : Symbol(x, Decl(constDeclarationShadowedByVarDeclaration2.ts, 3, 9)) + + function inner() { +>inner : Symbol(inner, Decl(constDeclarationShadowedByVarDeclaration2.ts, 3, 16)) + + var x = "inner"; +>x : Symbol(x, Decl(constDeclarationShadowedByVarDeclaration2.ts, 5, 11)) + } +} diff --git a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.types b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.types index 4217db45509..a5a7dd1d0cd 100644 --- a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.types +++ b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.types @@ -6,11 +6,13 @@ function outer() { const x = 0; >x : number +>0 : number function inner() { >inner : () => void var x = "inner"; >x : string +>"inner" : string } } diff --git a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.symbols b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.symbols new file mode 100644 index 00000000000..99e11e12967 --- /dev/null +++ b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/constDeclarationShadowedByVarDeclaration3.ts === +// Ensure only checking for const declarations shadowed by vars +class Rule { +>Rule : Symbol(Rule, Decl(constDeclarationShadowedByVarDeclaration3.ts, 0, 0)) + + public regex: RegExp = new RegExp(''); +>regex : Symbol(regex, Decl(constDeclarationShadowedByVarDeclaration3.ts, 1, 12)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) + + public name: string = ''; +>name : Symbol(name, Decl(constDeclarationShadowedByVarDeclaration3.ts, 2, 42)) + + constructor(name: string) { +>name : Symbol(name, Decl(constDeclarationShadowedByVarDeclaration3.ts, 5, 16)) + + this.name = name; +>this.name : Symbol(name, Decl(constDeclarationShadowedByVarDeclaration3.ts, 2, 42)) +>this : Symbol(Rule, Decl(constDeclarationShadowedByVarDeclaration3.ts, 0, 0)) +>name : Symbol(name, Decl(constDeclarationShadowedByVarDeclaration3.ts, 2, 42)) +>name : Symbol(name, Decl(constDeclarationShadowedByVarDeclaration3.ts, 5, 16)) + } +} diff --git a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.types b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.types index 8241b319d84..c5b9ec9a6f2 100644 --- a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.types +++ b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.types @@ -8,9 +8,11 @@ class Rule { >RegExp : RegExp >new RegExp('') : RegExp >RegExp : RegExpConstructor +>'' : string public name: string = ''; >name : string +>'' : string constructor(name: string) { >name : string diff --git a/tests/baselines/reference/constDeclarations-ambient.symbols b/tests/baselines/reference/constDeclarations-ambient.symbols new file mode 100644 index 00000000000..87dfecab0c0 --- /dev/null +++ b/tests/baselines/reference/constDeclarations-ambient.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/constDeclarations-ambient.ts === + +// No error +declare const c1: boolean; +>c1 : Symbol(c1, Decl(constDeclarations-ambient.ts, 2, 13)) + +declare const c2: number; +>c2 : Symbol(c2, Decl(constDeclarations-ambient.ts, 3, 13)) + +declare const c3, c4 :string, c5: any; +>c3 : Symbol(c3, Decl(constDeclarations-ambient.ts, 4, 13)) +>c4 : Symbol(c4, Decl(constDeclarations-ambient.ts, 4, 17)) +>c5 : Symbol(c5, Decl(constDeclarations-ambient.ts, 4, 29)) + +declare module M { +>M : Symbol(M, Decl(constDeclarations-ambient.ts, 4, 38)) + + const c6; +>c6 : Symbol(c6, Decl(constDeclarations-ambient.ts, 7, 9)) + + const c7: number; +>c7 : Symbol(c7, Decl(constDeclarations-ambient.ts, 8, 9)) +} diff --git a/tests/baselines/reference/constDeclarations-es5.symbols b/tests/baselines/reference/constDeclarations-es5.symbols new file mode 100644 index 00000000000..116dd06573b --- /dev/null +++ b/tests/baselines/reference/constDeclarations-es5.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/constDeclarations-es5.ts === + +const z7 = false; +>z7 : Symbol(z7, Decl(constDeclarations-es5.ts, 1, 5)) + +const z8: number = 23; +>z8 : Symbol(z8, Decl(constDeclarations-es5.ts, 2, 5)) + +const z9 = 0, z10 :string = "", z11 = null; +>z9 : Symbol(z9, Decl(constDeclarations-es5.ts, 3, 5)) +>z10 : Symbol(z10, Decl(constDeclarations-es5.ts, 3, 13)) +>z11 : Symbol(z11, Decl(constDeclarations-es5.ts, 3, 31)) + diff --git a/tests/baselines/reference/constDeclarations-es5.types b/tests/baselines/reference/constDeclarations-es5.types index be55dc0febc..a897c3f9cd0 100644 --- a/tests/baselines/reference/constDeclarations-es5.types +++ b/tests/baselines/reference/constDeclarations-es5.types @@ -2,12 +2,17 @@ const z7 = false; >z7 : boolean +>false : boolean const z8: number = 23; >z8 : number +>23 : number const z9 = 0, z10 :string = "", z11 = null; >z9 : number +>0 : number >z10 : string +>"" : string >z11 : any +>null : null diff --git a/tests/baselines/reference/constDeclarations-scopes2.symbols b/tests/baselines/reference/constDeclarations-scopes2.symbols new file mode 100644 index 00000000000..15e466e8ea1 --- /dev/null +++ b/tests/baselines/reference/constDeclarations-scopes2.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/constDeclarations-scopes2.ts === + +// global +const c = "string"; +>c : Symbol(c, Decl(constDeclarations-scopes2.ts, 2, 5)) + +var n: number; +>n : Symbol(n, Decl(constDeclarations-scopes2.ts, 4, 3)) + +var b: boolean; +>b : Symbol(b, Decl(constDeclarations-scopes2.ts, 5, 3)) + +// for scope +for (const c = 0; c < 10; n = c ) { +>c : Symbol(c, Decl(constDeclarations-scopes2.ts, 8, 10)) +>c : Symbol(c, Decl(constDeclarations-scopes2.ts, 8, 10)) +>n : Symbol(n, Decl(constDeclarations-scopes2.ts, 4, 3)) +>c : Symbol(c, Decl(constDeclarations-scopes2.ts, 8, 10)) + + // for block + const c = false; +>c : Symbol(c, Decl(constDeclarations-scopes2.ts, 10, 9)) + + b = c; +>b : Symbol(b, Decl(constDeclarations-scopes2.ts, 5, 3)) +>c : Symbol(c, Decl(constDeclarations-scopes2.ts, 10, 9)) +} + + diff --git a/tests/baselines/reference/constDeclarations-scopes2.types b/tests/baselines/reference/constDeclarations-scopes2.types index 9609ef8f44b..a6bbdee7612 100644 --- a/tests/baselines/reference/constDeclarations-scopes2.types +++ b/tests/baselines/reference/constDeclarations-scopes2.types @@ -3,6 +3,7 @@ // global const c = "string"; >c : string +>"string" : string var n: number; >n : number @@ -13,8 +14,10 @@ var b: boolean; // for scope for (const c = 0; c < 10; n = c ) { >c : number +>0 : number >c < 10 : boolean >c : number +>10 : number >n = c : number >n : number >c : number @@ -22,6 +25,7 @@ for (const c = 0; c < 10; n = c ) { // for block const c = false; >c : boolean +>false : boolean b = c; >b = c : boolean diff --git a/tests/baselines/reference/constDeclarations.symbols b/tests/baselines/reference/constDeclarations.symbols new file mode 100644 index 00000000000..01653620dd0 --- /dev/null +++ b/tests/baselines/reference/constDeclarations.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/constDeclarations.ts === + +// No error +const c1 = false; +>c1 : Symbol(c1, Decl(constDeclarations.ts, 2, 5)) + +const c2: number = 23; +>c2 : Symbol(c2, Decl(constDeclarations.ts, 3, 5)) + +const c3 = 0, c4 :string = "", c5 = null; +>c3 : Symbol(c3, Decl(constDeclarations.ts, 4, 5)) +>c4 : Symbol(c4, Decl(constDeclarations.ts, 4, 13)) +>c5 : Symbol(c5, Decl(constDeclarations.ts, 4, 30)) + + +for(const c4 = 0; c4 < 9; ) { break; } +>c4 : Symbol(c4, Decl(constDeclarations.ts, 7, 9)) +>c4 : Symbol(c4, Decl(constDeclarations.ts, 7, 9)) + + +for(const c5 = 0, c6 = 0; c5 < c6; ) { break; } +>c5 : Symbol(c5, Decl(constDeclarations.ts, 10, 9)) +>c6 : Symbol(c6, Decl(constDeclarations.ts, 10, 17)) +>c5 : Symbol(c5, Decl(constDeclarations.ts, 10, 9)) +>c6 : Symbol(c6, Decl(constDeclarations.ts, 10, 17)) + diff --git a/tests/baselines/reference/constDeclarations.types b/tests/baselines/reference/constDeclarations.types index e82a2f0035f..efdc534ef1c 100644 --- a/tests/baselines/reference/constDeclarations.types +++ b/tests/baselines/reference/constDeclarations.types @@ -3,25 +3,34 @@ // No error const c1 = false; >c1 : boolean +>false : boolean const c2: number = 23; >c2 : number +>23 : number const c3 = 0, c4 :string = "", c5 = null; >c3 : number +>0 : number >c4 : string +>"" : string >c5 : any +>null : null for(const c4 = 0; c4 < 9; ) { break; } >c4 : number +>0 : number >c4 < 9 : boolean >c4 : number +>9 : number for(const c5 = 0, c6 = 0; c5 < c6; ) { break; } >c5 : number +>0 : number >c6 : number +>0 : number >c5 < c6 : boolean >c5 : number >c6 : number diff --git a/tests/baselines/reference/constDeclarations2.symbols b/tests/baselines/reference/constDeclarations2.symbols new file mode 100644 index 00000000000..daeced31f77 --- /dev/null +++ b/tests/baselines/reference/constDeclarations2.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/constDeclarations2.ts === + +// No error +module M { +>M : Symbol(M, Decl(constDeclarations2.ts, 0, 0)) + + export const c1 = false; +>c1 : Symbol(c1, Decl(constDeclarations2.ts, 3, 16)) + + export const c2: number = 23; +>c2 : Symbol(c2, Decl(constDeclarations2.ts, 4, 16)) + + export const c3 = 0, c4 :string = "", c5 = null; +>c3 : Symbol(c3, Decl(constDeclarations2.ts, 5, 16)) +>c4 : Symbol(c4, Decl(constDeclarations2.ts, 5, 24)) +>c5 : Symbol(c5, Decl(constDeclarations2.ts, 5, 41)) +} + diff --git a/tests/baselines/reference/constDeclarations2.types b/tests/baselines/reference/constDeclarations2.types index c81eca96b0d..f8184b8f8e0 100644 --- a/tests/baselines/reference/constDeclarations2.types +++ b/tests/baselines/reference/constDeclarations2.types @@ -6,13 +6,18 @@ module M { export const c1 = false; >c1 : boolean +>false : boolean export const c2: number = 23; >c2 : number +>23 : number export const c3 = 0, c4 :string = "", c5 = null; >c3 : number +>0 : number >c4 : string +>"" : string >c5 : any +>null : null } diff --git a/tests/baselines/reference/constEnumDeclarations.symbols b/tests/baselines/reference/constEnumDeclarations.symbols new file mode 100644 index 00000000000..72b833e4fae --- /dev/null +++ b/tests/baselines/reference/constEnumDeclarations.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/constEnumDeclarations.ts === + +const enum E { +>E : Symbol(E, Decl(constEnumDeclarations.ts, 0, 0)) + + A = 1, +>A : Symbol(E.A, Decl(constEnumDeclarations.ts, 1, 14)) + + B = 2, +>B : Symbol(E.B, Decl(constEnumDeclarations.ts, 2, 10)) + + C = A | B +>C : Symbol(E.C, Decl(constEnumDeclarations.ts, 3, 10)) +>A : Symbol(E.A, Decl(constEnumDeclarations.ts, 1, 14)) +>B : Symbol(E.B, Decl(constEnumDeclarations.ts, 2, 10)) +} + +const enum E2 { +>E2 : Symbol(E2, Decl(constEnumDeclarations.ts, 5, 1)) + + A = 1, +>A : Symbol(E2.A, Decl(constEnumDeclarations.ts, 7, 15)) + + B, +>B : Symbol(E2.B, Decl(constEnumDeclarations.ts, 8, 10)) + + C +>C : Symbol(E2.C, Decl(constEnumDeclarations.ts, 9, 6)) +} diff --git a/tests/baselines/reference/constEnumDeclarations.types b/tests/baselines/reference/constEnumDeclarations.types index 9dc87eadef7..481c2673660 100644 --- a/tests/baselines/reference/constEnumDeclarations.types +++ b/tests/baselines/reference/constEnumDeclarations.types @@ -5,9 +5,11 @@ const enum E { A = 1, >A : E +>1 : number B = 2, >B : E +>2 : number C = A | B >C : E @@ -21,6 +23,7 @@ const enum E2 { A = 1, >A : E2 +>1 : number B, >B : E2 diff --git a/tests/baselines/reference/constEnumExternalModule.symbols b/tests/baselines/reference/constEnumExternalModule.symbols new file mode 100644 index 00000000000..2502d6e4f28 --- /dev/null +++ b/tests/baselines/reference/constEnumExternalModule.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/m2.ts === +import A = require('m1') +>A : Symbol(A, Decl(m2.ts, 0, 0)) + +var v = A.V; +>v : Symbol(v, Decl(m2.ts, 1, 3)) +>A.V : Symbol(A.V, Decl(m1.ts, 0, 14)) +>A : Symbol(A, Decl(m2.ts, 0, 0)) +>V : Symbol(A.V, Decl(m1.ts, 0, 14)) + +=== tests/cases/compiler/m1.ts === +const enum E { +>E : Symbol(E, Decl(m1.ts, 0, 0)) + + V = 100 +>V : Symbol(E.V, Decl(m1.ts, 0, 14)) +} + +export = E +>E : Symbol(E, Decl(m1.ts, 0, 0)) + diff --git a/tests/baselines/reference/constEnumExternalModule.types b/tests/baselines/reference/constEnumExternalModule.types index 9c7b43a24d4..5d03b77b1b7 100644 --- a/tests/baselines/reference/constEnumExternalModule.types +++ b/tests/baselines/reference/constEnumExternalModule.types @@ -14,6 +14,7 @@ const enum E { V = 100 >V : E +>100 : number } export = E diff --git a/tests/baselines/reference/constEnumOnlyModuleMerging.symbols b/tests/baselines/reference/constEnumOnlyModuleMerging.symbols new file mode 100644 index 00000000000..093ce28ab94 --- /dev/null +++ b/tests/baselines/reference/constEnumOnlyModuleMerging.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/constEnumOnlyModuleMerging.ts === +module Outer { +>Outer : Symbol(Outer, Decl(constEnumOnlyModuleMerging.ts, 0, 0), Decl(constEnumOnlyModuleMerging.ts, 2, 1)) + + export var x = 1; +>x : Symbol(x, Decl(constEnumOnlyModuleMerging.ts, 1, 14)) +} + +module Outer { +>Outer : Symbol(Outer, Decl(constEnumOnlyModuleMerging.ts, 0, 0), Decl(constEnumOnlyModuleMerging.ts, 2, 1)) + + export const enum A { X } +>A : Symbol(A, Decl(constEnumOnlyModuleMerging.ts, 4, 14)) +>X : Symbol(A.X, Decl(constEnumOnlyModuleMerging.ts, 5, 25)) +} + +module B { +>B : Symbol(B, Decl(constEnumOnlyModuleMerging.ts, 6, 1)) + + import O = Outer; +>O : Symbol(O, Decl(constEnumOnlyModuleMerging.ts, 8, 10)) +>Outer : Symbol(O, Decl(constEnumOnlyModuleMerging.ts, 0, 0), Decl(constEnumOnlyModuleMerging.ts, 2, 1)) + + var x = O.A.X; +>x : Symbol(x, Decl(constEnumOnlyModuleMerging.ts, 10, 7)) +>O.A.X : Symbol(O.A.X, Decl(constEnumOnlyModuleMerging.ts, 5, 25)) +>O.A : Symbol(O.A, Decl(constEnumOnlyModuleMerging.ts, 4, 14)) +>O : Symbol(O, Decl(constEnumOnlyModuleMerging.ts, 8, 10)) +>A : Symbol(O.A, Decl(constEnumOnlyModuleMerging.ts, 4, 14)) +>X : Symbol(O.A.X, Decl(constEnumOnlyModuleMerging.ts, 5, 25)) + + var y = O.x; +>y : Symbol(y, Decl(constEnumOnlyModuleMerging.ts, 11, 7)) +>O.x : Symbol(O.x, Decl(constEnumOnlyModuleMerging.ts, 1, 14)) +>O : Symbol(O, Decl(constEnumOnlyModuleMerging.ts, 8, 10)) +>x : Symbol(O.x, Decl(constEnumOnlyModuleMerging.ts, 1, 14)) +} diff --git a/tests/baselines/reference/constEnumOnlyModuleMerging.types b/tests/baselines/reference/constEnumOnlyModuleMerging.types index 30426e3fa4c..452c0f46add 100644 --- a/tests/baselines/reference/constEnumOnlyModuleMerging.types +++ b/tests/baselines/reference/constEnumOnlyModuleMerging.types @@ -4,6 +4,7 @@ module Outer { export var x = 1; >x : number +>1 : number } module Outer { diff --git a/tests/baselines/reference/constEnums.symbols b/tests/baselines/reference/constEnums.symbols new file mode 100644 index 00000000000..9f88fb63493 --- /dev/null +++ b/tests/baselines/reference/constEnums.symbols @@ -0,0 +1,524 @@ +=== tests/cases/compiler/constEnums.ts === +const enum Enum1 { +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) + + A0 = 100, +>A0 : Symbol(Enum1.A0, Decl(constEnums.ts, 0, 18)) +} + +const enum Enum1 { +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) + + // correct cases + A, +>A : Symbol(Enum1.A, Decl(constEnums.ts, 4, 18)) + + B, +>B : Symbol(Enum1.B, Decl(constEnums.ts, 6, 6)) + + C = 10, +>C : Symbol(Enum1.C, Decl(constEnums.ts, 7, 6)) + + D = A | B, +>D : Symbol(Enum1.D, Decl(constEnums.ts, 8, 11)) +>A : Symbol(Enum1.A, Decl(constEnums.ts, 4, 18)) +>B : Symbol(Enum1.B, Decl(constEnums.ts, 6, 6)) + + E = A | 1, +>E : Symbol(Enum1.E, Decl(constEnums.ts, 9, 14)) +>A : Symbol(Enum1.A, Decl(constEnums.ts, 4, 18)) + + F = 1 | A, +>F : Symbol(Enum1.F, Decl(constEnums.ts, 10, 14)) +>A : Symbol(Enum1.A, Decl(constEnums.ts, 4, 18)) + + G = (1 & 1), +>G : Symbol(Enum1.G, Decl(constEnums.ts, 11, 14)) + + H = ~(A | B), +>H : Symbol(Enum1.H, Decl(constEnums.ts, 12, 16)) +>A : Symbol(Enum1.A, Decl(constEnums.ts, 4, 18)) +>B : Symbol(Enum1.B, Decl(constEnums.ts, 6, 6)) + + I = A >>> 1, +>I : Symbol(Enum1.I, Decl(constEnums.ts, 13, 17)) +>A : Symbol(Enum1.A, Decl(constEnums.ts, 4, 18)) + + J = 1 & A, +>J : Symbol(Enum1.J, Decl(constEnums.ts, 14, 16)) +>A : Symbol(Enum1.A, Decl(constEnums.ts, 4, 18)) + + K = ~(1 | 5), +>K : Symbol(Enum1.K, Decl(constEnums.ts, 15, 14)) + + L = ~D, +>L : Symbol(Enum1.L, Decl(constEnums.ts, 16, 17)) +>D : Symbol(Enum1.D, Decl(constEnums.ts, 8, 11)) + + M = E << B, +>M : Symbol(Enum1.M, Decl(constEnums.ts, 17, 11)) +>E : Symbol(Enum1.E, Decl(constEnums.ts, 9, 14)) +>B : Symbol(Enum1.B, Decl(constEnums.ts, 6, 6)) + + N = E << 1, +>N : Symbol(Enum1.N, Decl(constEnums.ts, 18, 15)) +>E : Symbol(Enum1.E, Decl(constEnums.ts, 9, 14)) + + O = E >> B, +>O : Symbol(Enum1.O, Decl(constEnums.ts, 19, 15)) +>E : Symbol(Enum1.E, Decl(constEnums.ts, 9, 14)) +>B : Symbol(Enum1.B, Decl(constEnums.ts, 6, 6)) + + P = E >> 1, +>P : Symbol(Enum1.P, Decl(constEnums.ts, 20, 15)) +>E : Symbol(Enum1.E, Decl(constEnums.ts, 9, 14)) + + Q = -D, +>Q : Symbol(Enum1.Q, Decl(constEnums.ts, 21, 15)) +>D : Symbol(Enum1.D, Decl(constEnums.ts, 8, 11)) + + R = C & 5, +>R : Symbol(Enum1.R, Decl(constEnums.ts, 22, 11)) +>C : Symbol(Enum1.C, Decl(constEnums.ts, 7, 6)) + + S = 5 & C, +>S : Symbol(Enum1.S, Decl(constEnums.ts, 23, 14)) +>C : Symbol(Enum1.C, Decl(constEnums.ts, 7, 6)) + + T = C | D, +>T : Symbol(Enum1.T, Decl(constEnums.ts, 24, 14)) +>C : Symbol(Enum1.C, Decl(constEnums.ts, 7, 6)) +>D : Symbol(Enum1.D, Decl(constEnums.ts, 8, 11)) + + U = C | 1, +>U : Symbol(Enum1.U, Decl(constEnums.ts, 25, 14)) +>C : Symbol(Enum1.C, Decl(constEnums.ts, 7, 6)) + + V = 10 | D, +>V : Symbol(Enum1.V, Decl(constEnums.ts, 26, 14)) +>D : Symbol(Enum1.D, Decl(constEnums.ts, 8, 11)) + + W = Enum1.V, +>W : Symbol(Enum1.W, Decl(constEnums.ts, 27, 15)) +>Enum1.V : Symbol(Enum1.V, Decl(constEnums.ts, 26, 14)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>V : Symbol(Enum1.V, Decl(constEnums.ts, 26, 14)) + + // correct cases: reference to the enum member from different enum declaration + W1 = A0, +>W1 : Symbol(Enum1.W1, Decl(constEnums.ts, 28, 16)) +>A0 : Symbol(Enum1.A0, Decl(constEnums.ts, 0, 18)) + + W2 = Enum1.A0, +>W2 : Symbol(Enum1.W2, Decl(constEnums.ts, 31, 12)) +>Enum1.A0 : Symbol(Enum1.A0, Decl(constEnums.ts, 0, 18)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>A0 : Symbol(Enum1.A0, Decl(constEnums.ts, 0, 18)) + + W3 = Enum1["A0"], +>W3 : Symbol(Enum1.W3, Decl(constEnums.ts, 32, 18)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>"A0" : Symbol(Enum1.A0, Decl(constEnums.ts, 0, 18)) + + W4 = Enum1["W"], +>W4 : Symbol(Enum1.W4, Decl(constEnums.ts, 33, 21)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>"W" : Symbol(Enum1.W, Decl(constEnums.ts, 27, 15)) +} + + +module A { +>A : Symbol(A, Decl(constEnums.ts, 35, 1), Decl(constEnums.ts, 47, 1)) + + export module B { +>B : Symbol(B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) + + export module C { +>C : Symbol(C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) + + export const enum E { +>E : Symbol(E, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) + + V1 = 1, +>V1 : Symbol(I.V1, Decl(constEnums.ts, 41, 33)) + + V2 = A.B.C.E.V1 | 100 +>V2 : Symbol(I.V2, Decl(constEnums.ts, 42, 23)) +>A.B.C.E.V1 : Symbol(I.V1, Decl(constEnums.ts, 41, 33)) +>A.B.C.E : Symbol(E, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) +>A.B.C : Symbol(C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) +>A.B : Symbol(B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) +>A : Symbol(A, Decl(constEnums.ts, 35, 1), Decl(constEnums.ts, 47, 1)) +>B : Symbol(B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) +>C : Symbol(C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) +>E : Symbol(E, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) +>V1 : Symbol(I.V1, Decl(constEnums.ts, 41, 33)) + } + } + } +} + +module A { +>A : Symbol(A, Decl(constEnums.ts, 35, 1), Decl(constEnums.ts, 47, 1)) + + export module B { +>B : Symbol(B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) + + export module C { +>C : Symbol(C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) + + export const enum E { +>E : Symbol(E, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) + + V3 = A.B.C.E["V2"] & 200, +>V3 : Symbol(I.V3, Decl(constEnums.ts, 52, 33)) +>A.B.C.E : Symbol(E, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) +>A.B.C : Symbol(C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) +>A.B : Symbol(B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) +>A : Symbol(A, Decl(constEnums.ts, 35, 1), Decl(constEnums.ts, 47, 1)) +>B : Symbol(B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) +>C : Symbol(C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) +>E : Symbol(E, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) +>"V2" : Symbol(I.V2, Decl(constEnums.ts, 42, 23)) + } + } + } +} + +module A1 { +>A1 : Symbol(A1, Decl(constEnums.ts, 57, 1)) + + export module B { +>B : Symbol(B, Decl(constEnums.ts, 59, 11)) + + export module C { +>C : Symbol(C, Decl(constEnums.ts, 60, 21)) + + export const enum E { +>E : Symbol(E, Decl(constEnums.ts, 61, 25)) + + V1 = 10, +>V1 : Symbol(E.V1, Decl(constEnums.ts, 62, 33)) + + V2 = 110, +>V2 : Symbol(E.V2, Decl(constEnums.ts, 63, 24)) + } + } + } +} + +module A2 { +>A2 : Symbol(A2, Decl(constEnums.ts, 68, 1)) + + export module B { +>B : Symbol(B, Decl(constEnums.ts, 70, 11)) + + export module C { +>C : Symbol(C, Decl(constEnums.ts, 71, 21), Decl(constEnums.ts, 77, 9)) + + export const enum E { +>E : Symbol(E, Decl(constEnums.ts, 72, 25)) + + V1 = 10, +>V1 : Symbol(E.V1, Decl(constEnums.ts, 73, 33)) + + V2 = 110, +>V2 : Symbol(E.V2, Decl(constEnums.ts, 74, 24)) + } + } + // module C will be classified as value + export module C { +>C : Symbol(C, Decl(constEnums.ts, 71, 21), Decl(constEnums.ts, 77, 9)) + + var x = 1 +>x : Symbol(x, Decl(constEnums.ts, 80, 15)) + } + } +} + +import I = A.B.C.E; +>I : Symbol(I, Decl(constEnums.ts, 83, 1)) +>A : Symbol(A, Decl(constEnums.ts, 35, 1), Decl(constEnums.ts, 47, 1)) +>B : Symbol(A.B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) +>C : Symbol(A.B.C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) +>E : Symbol(I, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) + +import I1 = A1.B; +>I1 : Symbol(I1, Decl(constEnums.ts, 85, 19)) +>A1 : Symbol(A1, Decl(constEnums.ts, 57, 1)) +>B : Symbol(I1, Decl(constEnums.ts, 59, 11)) + +import I2 = A2.B; +>I2 : Symbol(I2, Decl(constEnums.ts, 86, 17)) +>A2 : Symbol(A2, Decl(constEnums.ts, 68, 1)) +>B : Symbol(I2, Decl(constEnums.ts, 70, 11)) + +function foo0(e: I): void { +>foo0 : Symbol(foo0, Decl(constEnums.ts, 87, 17)) +>e : Symbol(e, Decl(constEnums.ts, 89, 14)) +>I : Symbol(I, Decl(constEnums.ts, 83, 1)) + + if (e === I.V1) { +>e : Symbol(e, Decl(constEnums.ts, 89, 14)) +>I.V1 : Symbol(I.V1, Decl(constEnums.ts, 41, 33)) +>I : Symbol(I, Decl(constEnums.ts, 83, 1)) +>V1 : Symbol(I.V1, Decl(constEnums.ts, 41, 33)) + } + else if (e === I.V2) { +>e : Symbol(e, Decl(constEnums.ts, 89, 14)) +>I.V2 : Symbol(I.V2, Decl(constEnums.ts, 42, 23)) +>I : Symbol(I, Decl(constEnums.ts, 83, 1)) +>V2 : Symbol(I.V2, Decl(constEnums.ts, 42, 23)) + } +} + +function foo1(e: I1.C.E): void { +>foo1 : Symbol(foo1, Decl(constEnums.ts, 94, 1)) +>e : Symbol(e, Decl(constEnums.ts, 96, 14)) +>I1 : Symbol(I1, Decl(constEnums.ts, 85, 19)) +>C : Symbol(I1.C, Decl(constEnums.ts, 60, 21)) +>E : Symbol(I1.C.E, Decl(constEnums.ts, 61, 25)) + + if (e === I1.C.E.V1) { +>e : Symbol(e, Decl(constEnums.ts, 96, 14)) +>I1.C.E.V1 : Symbol(I1.C.E.V1, Decl(constEnums.ts, 62, 33)) +>I1.C.E : Symbol(I1.C.E, Decl(constEnums.ts, 61, 25)) +>I1.C : Symbol(I1.C, Decl(constEnums.ts, 60, 21)) +>I1 : Symbol(I1, Decl(constEnums.ts, 85, 19)) +>C : Symbol(I1.C, Decl(constEnums.ts, 60, 21)) +>E : Symbol(I1.C.E, Decl(constEnums.ts, 61, 25)) +>V1 : Symbol(I1.C.E.V1, Decl(constEnums.ts, 62, 33)) + } + else if (e === I1.C.E.V2) { +>e : Symbol(e, Decl(constEnums.ts, 96, 14)) +>I1.C.E.V2 : Symbol(I1.C.E.V2, Decl(constEnums.ts, 63, 24)) +>I1.C.E : Symbol(I1.C.E, Decl(constEnums.ts, 61, 25)) +>I1.C : Symbol(I1.C, Decl(constEnums.ts, 60, 21)) +>I1 : Symbol(I1, Decl(constEnums.ts, 85, 19)) +>C : Symbol(I1.C, Decl(constEnums.ts, 60, 21)) +>E : Symbol(I1.C.E, Decl(constEnums.ts, 61, 25)) +>V2 : Symbol(I1.C.E.V2, Decl(constEnums.ts, 63, 24)) + } +} + +function foo2(e: I2.C.E): void { +>foo2 : Symbol(foo2, Decl(constEnums.ts, 101, 1)) +>e : Symbol(e, Decl(constEnums.ts, 103, 14)) +>I2 : Symbol(I2, Decl(constEnums.ts, 86, 17)) +>C : Symbol(I2.C, Decl(constEnums.ts, 71, 21), Decl(constEnums.ts, 77, 9)) +>E : Symbol(I2.C.E, Decl(constEnums.ts, 72, 25)) + + if (e === I2.C.E.V1) { +>e : Symbol(e, Decl(constEnums.ts, 103, 14)) +>I2.C.E.V1 : Symbol(I2.C.E.V1, Decl(constEnums.ts, 73, 33)) +>I2.C.E : Symbol(I2.C.E, Decl(constEnums.ts, 72, 25)) +>I2.C : Symbol(I2.C, Decl(constEnums.ts, 71, 21), Decl(constEnums.ts, 77, 9)) +>I2 : Symbol(I2, Decl(constEnums.ts, 86, 17)) +>C : Symbol(I2.C, Decl(constEnums.ts, 71, 21), Decl(constEnums.ts, 77, 9)) +>E : Symbol(I2.C.E, Decl(constEnums.ts, 72, 25)) +>V1 : Symbol(I2.C.E.V1, Decl(constEnums.ts, 73, 33)) + } + else if (e === I2.C.E.V2) { +>e : Symbol(e, Decl(constEnums.ts, 103, 14)) +>I2.C.E.V2 : Symbol(I2.C.E.V2, Decl(constEnums.ts, 74, 24)) +>I2.C.E : Symbol(I2.C.E, Decl(constEnums.ts, 72, 25)) +>I2.C : Symbol(I2.C, Decl(constEnums.ts, 71, 21), Decl(constEnums.ts, 77, 9)) +>I2 : Symbol(I2, Decl(constEnums.ts, 86, 17)) +>C : Symbol(I2.C, Decl(constEnums.ts, 71, 21), Decl(constEnums.ts, 77, 9)) +>E : Symbol(I2.C.E, Decl(constEnums.ts, 72, 25)) +>V2 : Symbol(I2.C.E.V2, Decl(constEnums.ts, 74, 24)) + } +} + + +function foo(x: Enum1) { +>foo : Symbol(foo, Decl(constEnums.ts, 108, 1)) +>x : Symbol(x, Decl(constEnums.ts, 111, 13)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) + + switch (x) { +>x : Symbol(x, Decl(constEnums.ts, 111, 13)) + + case Enum1.A: +>Enum1.A : Symbol(Enum1.A, Decl(constEnums.ts, 4, 18)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>A : Symbol(Enum1.A, Decl(constEnums.ts, 4, 18)) + + case Enum1.B: +>Enum1.B : Symbol(Enum1.B, Decl(constEnums.ts, 6, 6)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>B : Symbol(Enum1.B, Decl(constEnums.ts, 6, 6)) + + case Enum1.C: +>Enum1.C : Symbol(Enum1.C, Decl(constEnums.ts, 7, 6)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>C : Symbol(Enum1.C, Decl(constEnums.ts, 7, 6)) + + case Enum1.D: +>Enum1.D : Symbol(Enum1.D, Decl(constEnums.ts, 8, 11)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>D : Symbol(Enum1.D, Decl(constEnums.ts, 8, 11)) + + case Enum1.E: +>Enum1.E : Symbol(Enum1.E, Decl(constEnums.ts, 9, 14)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>E : Symbol(Enum1.E, Decl(constEnums.ts, 9, 14)) + + case Enum1.F: +>Enum1.F : Symbol(Enum1.F, Decl(constEnums.ts, 10, 14)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>F : Symbol(Enum1.F, Decl(constEnums.ts, 10, 14)) + + case Enum1.G: +>Enum1.G : Symbol(Enum1.G, Decl(constEnums.ts, 11, 14)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>G : Symbol(Enum1.G, Decl(constEnums.ts, 11, 14)) + + case Enum1.H: +>Enum1.H : Symbol(Enum1.H, Decl(constEnums.ts, 12, 16)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>H : Symbol(Enum1.H, Decl(constEnums.ts, 12, 16)) + + case Enum1.I: +>Enum1.I : Symbol(Enum1.I, Decl(constEnums.ts, 13, 17)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>I : Symbol(Enum1.I, Decl(constEnums.ts, 13, 17)) + + case Enum1.J: +>Enum1.J : Symbol(Enum1.J, Decl(constEnums.ts, 14, 16)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>J : Symbol(Enum1.J, Decl(constEnums.ts, 14, 16)) + + case Enum1.K: +>Enum1.K : Symbol(Enum1.K, Decl(constEnums.ts, 15, 14)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>K : Symbol(Enum1.K, Decl(constEnums.ts, 15, 14)) + + case Enum1.L: +>Enum1.L : Symbol(Enum1.L, Decl(constEnums.ts, 16, 17)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>L : Symbol(Enum1.L, Decl(constEnums.ts, 16, 17)) + + case Enum1.M: +>Enum1.M : Symbol(Enum1.M, Decl(constEnums.ts, 17, 11)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>M : Symbol(Enum1.M, Decl(constEnums.ts, 17, 11)) + + case Enum1.N: +>Enum1.N : Symbol(Enum1.N, Decl(constEnums.ts, 18, 15)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>N : Symbol(Enum1.N, Decl(constEnums.ts, 18, 15)) + + case Enum1.O: +>Enum1.O : Symbol(Enum1.O, Decl(constEnums.ts, 19, 15)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>O : Symbol(Enum1.O, Decl(constEnums.ts, 19, 15)) + + case Enum1.P: +>Enum1.P : Symbol(Enum1.P, Decl(constEnums.ts, 20, 15)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>P : Symbol(Enum1.P, Decl(constEnums.ts, 20, 15)) + + case Enum1.Q: +>Enum1.Q : Symbol(Enum1.Q, Decl(constEnums.ts, 21, 15)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>Q : Symbol(Enum1.Q, Decl(constEnums.ts, 21, 15)) + + case Enum1.R: +>Enum1.R : Symbol(Enum1.R, Decl(constEnums.ts, 22, 11)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>R : Symbol(Enum1.R, Decl(constEnums.ts, 22, 11)) + + case Enum1.S: +>Enum1.S : Symbol(Enum1.S, Decl(constEnums.ts, 23, 14)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>S : Symbol(Enum1.S, Decl(constEnums.ts, 23, 14)) + + case Enum1["T"]: +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>"T" : Symbol(Enum1.T, Decl(constEnums.ts, 24, 14)) + + case Enum1.U: +>Enum1.U : Symbol(Enum1.U, Decl(constEnums.ts, 25, 14)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>U : Symbol(Enum1.U, Decl(constEnums.ts, 25, 14)) + + case Enum1.V: +>Enum1.V : Symbol(Enum1.V, Decl(constEnums.ts, 26, 14)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>V : Symbol(Enum1.V, Decl(constEnums.ts, 26, 14)) + + case Enum1.W: +>Enum1.W : Symbol(Enum1.W, Decl(constEnums.ts, 27, 15)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>W : Symbol(Enum1.W, Decl(constEnums.ts, 27, 15)) + + case Enum1.W1: +>Enum1.W1 : Symbol(Enum1.W1, Decl(constEnums.ts, 28, 16)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>W1 : Symbol(Enum1.W1, Decl(constEnums.ts, 28, 16)) + + case Enum1.W2: +>Enum1.W2 : Symbol(Enum1.W2, Decl(constEnums.ts, 31, 12)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>W2 : Symbol(Enum1.W2, Decl(constEnums.ts, 31, 12)) + + case Enum1.W3: +>Enum1.W3 : Symbol(Enum1.W3, Decl(constEnums.ts, 32, 18)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>W3 : Symbol(Enum1.W3, Decl(constEnums.ts, 32, 18)) + + case Enum1.W4: +>Enum1.W4 : Symbol(Enum1.W4, Decl(constEnums.ts, 33, 21)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>W4 : Symbol(Enum1.W4, Decl(constEnums.ts, 33, 21)) + + break; + } +} + +function bar(e: A.B.C.E): number { +>bar : Symbol(bar, Decl(constEnums.ts, 142, 1)) +>e : Symbol(e, Decl(constEnums.ts, 144, 13)) +>A : Symbol(A, Decl(constEnums.ts, 35, 1), Decl(constEnums.ts, 47, 1)) +>B : Symbol(A.B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) +>C : Symbol(A.B.C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) +>E : Symbol(I, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) + + switch (e) { +>e : Symbol(e, Decl(constEnums.ts, 144, 13)) + + case A.B.C.E.V1: return 1; +>A.B.C.E.V1 : Symbol(I.V1, Decl(constEnums.ts, 41, 33)) +>A.B.C.E : Symbol(I, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) +>A.B.C : Symbol(A.B.C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) +>A.B : Symbol(A.B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) +>A : Symbol(A, Decl(constEnums.ts, 35, 1), Decl(constEnums.ts, 47, 1)) +>B : Symbol(A.B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) +>C : Symbol(A.B.C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) +>E : Symbol(I, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) +>V1 : Symbol(I.V1, Decl(constEnums.ts, 41, 33)) + + case A.B.C.E.V2: return 1; +>A.B.C.E.V2 : Symbol(I.V2, Decl(constEnums.ts, 42, 23)) +>A.B.C.E : Symbol(I, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) +>A.B.C : Symbol(A.B.C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) +>A.B : Symbol(A.B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) +>A : Symbol(A, Decl(constEnums.ts, 35, 1), Decl(constEnums.ts, 47, 1)) +>B : Symbol(A.B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) +>C : Symbol(A.B.C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) +>E : Symbol(I, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) +>V2 : Symbol(I.V2, Decl(constEnums.ts, 42, 23)) + + case A.B.C.E.V3: return 1; +>A.B.C.E.V3 : Symbol(I.V3, Decl(constEnums.ts, 52, 33)) +>A.B.C.E : Symbol(I, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) +>A.B.C : Symbol(A.B.C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) +>A.B : Symbol(A.B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) +>A : Symbol(A, Decl(constEnums.ts, 35, 1), Decl(constEnums.ts, 47, 1)) +>B : Symbol(A.B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) +>C : Symbol(A.B.C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) +>E : Symbol(I, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) +>V3 : Symbol(I.V3, Decl(constEnums.ts, 52, 33)) + } +} diff --git a/tests/baselines/reference/constEnums.types b/tests/baselines/reference/constEnums.types index 396b2e1c32b..a59bd2d012a 100644 --- a/tests/baselines/reference/constEnums.types +++ b/tests/baselines/reference/constEnums.types @@ -4,6 +4,7 @@ const enum Enum1 { A0 = 100, >A0 : Enum1 +>100 : number } const enum Enum1 { @@ -18,6 +19,7 @@ const enum Enum1 { C = 10, >C : Enum1 +>10 : number D = A | B, >D : Enum1 @@ -29,16 +31,20 @@ const enum Enum1 { >E : Enum1 >A | 1 : number >A : Enum1 +>1 : number F = 1 | A, >F : Enum1 >1 | A : number +>1 : number >A : Enum1 G = (1 & 1), >G : Enum1 >(1 & 1) : number >1 & 1 : number +>1 : number +>1 : number H = ~(A | B), >H : Enum1 @@ -52,10 +58,12 @@ const enum Enum1 { >I : Enum1 >A >>> 1 : number >A : Enum1 +>1 : number J = 1 & A, >J : Enum1 >1 & A : number +>1 : number >A : Enum1 K = ~(1 | 5), @@ -63,6 +71,8 @@ const enum Enum1 { >~(1 | 5) : number >(1 | 5) : number >1 | 5 : number +>1 : number +>5 : number L = ~D, >L : Enum1 @@ -79,6 +89,7 @@ const enum Enum1 { >N : Enum1 >E << 1 : number >E : Enum1 +>1 : number O = E >> B, >O : Enum1 @@ -90,6 +101,7 @@ const enum Enum1 { >P : Enum1 >E >> 1 : number >E : Enum1 +>1 : number Q = -D, >Q : Enum1 @@ -100,10 +112,12 @@ const enum Enum1 { >R : Enum1 >C & 5 : number >C : Enum1 +>5 : number S = 5 & C, >S : Enum1 >5 & C : number +>5 : number >C : Enum1 T = C | D, @@ -116,10 +130,12 @@ const enum Enum1 { >U : Enum1 >C | 1 : number >C : Enum1 +>1 : number V = 10 | D, >V : Enum1 >10 | D : number +>10 : number >D : Enum1 W = Enum1.V, @@ -143,11 +159,13 @@ const enum Enum1 { >W3 : Enum1 >Enum1["A0"] : Enum1 >Enum1 : typeof Enum1 +>"A0" : string W4 = Enum1["W"], >W4 : Enum1 >Enum1["W"] : Enum1 >Enum1 : typeof Enum1 +>"W" : string } @@ -165,6 +183,7 @@ module A { V1 = 1, >V1 : E +>1 : number V2 = A.B.C.E.V1 | 100 >V2 : E @@ -178,6 +197,7 @@ module A { >C : typeof C >E : typeof E >V1 : E +>100 : number } } } @@ -206,6 +226,8 @@ module A { >B : typeof B >C : typeof C >E : typeof E +>"V2" : string +>200 : number } } } @@ -225,9 +247,11 @@ module A1 { V1 = 10, >V1 : E +>10 : number V2 = 110, >V2 : E +>110 : number } } } @@ -247,9 +271,11 @@ module A2 { V1 = 10, >V1 : E +>10 : number V2 = 110, >V2 : E +>110 : number } } // module C will be classified as value @@ -258,6 +284,7 @@ module A2 { var x = 1 >x : number +>1 : number } } } @@ -303,8 +330,8 @@ function foo0(e: I): void { function foo1(e: I1.C.E): void { >foo1 : (e: I1.C.E) => void >e : I1.C.E ->I1 : unknown ->C : unknown +>I1 : any +>C : any >E : I1.C.E if (e === I1.C.E.V1) { @@ -334,8 +361,8 @@ function foo1(e: I1.C.E): void { function foo2(e: I2.C.E): void { >foo2 : (e: I2.C.E) => void >e : I2.C.E ->I2 : unknown ->C : unknown +>I2 : any +>C : any >E : I2.C.E if (e === I2.C.E.V1) { @@ -469,6 +496,7 @@ function foo(x: Enum1) { case Enum1["T"]: >Enum1["T"] : Enum1 >Enum1 : typeof Enum1 +>"T" : string case Enum1.U: >Enum1.U : Enum1 @@ -512,9 +540,9 @@ function foo(x: Enum1) { function bar(e: A.B.C.E): number { >bar : (e: I) => number >e : I ->A : unknown ->B : unknown ->C : unknown +>A : any +>B : any +>C : any >E : I switch (e) { @@ -530,6 +558,7 @@ function bar(e: A.B.C.E): number { >C : typeof A.B.C >E : typeof I >V1 : I +>1 : number case A.B.C.E.V2: return 1; >A.B.C.E.V2 : I @@ -541,6 +570,7 @@ function bar(e: A.B.C.E): number { >C : typeof A.B.C >E : typeof I >V2 : I +>1 : number case A.B.C.E.V3: return 1; >A.B.C.E.V3 : I @@ -552,5 +582,6 @@ function bar(e: A.B.C.E): number { >C : typeof A.B.C >E : typeof I >V3 : I +>1 : number } } diff --git a/tests/baselines/reference/constantOverloadFunction.symbols b/tests/baselines/reference/constantOverloadFunction.symbols new file mode 100644 index 00000000000..60234623ed6 --- /dev/null +++ b/tests/baselines/reference/constantOverloadFunction.symbols @@ -0,0 +1,48 @@ +=== tests/cases/compiler/constantOverloadFunction.ts === +class Base { foo() { } } +>Base : Symbol(Base, Decl(constantOverloadFunction.ts, 0, 0)) +>foo : Symbol(foo, Decl(constantOverloadFunction.ts, 0, 12)) + +class Derived1 extends Base { bar() { } } +>Derived1 : Symbol(Derived1, Decl(constantOverloadFunction.ts, 0, 24)) +>Base : Symbol(Base, Decl(constantOverloadFunction.ts, 0, 0)) +>bar : Symbol(bar, Decl(constantOverloadFunction.ts, 1, 29)) + +class Derived2 extends Base { baz() { } } +>Derived2 : Symbol(Derived2, Decl(constantOverloadFunction.ts, 1, 41)) +>Base : Symbol(Base, Decl(constantOverloadFunction.ts, 0, 0)) +>baz : Symbol(baz, Decl(constantOverloadFunction.ts, 2, 29)) + +class Derived3 extends Base { biz() { } } +>Derived3 : Symbol(Derived3, Decl(constantOverloadFunction.ts, 2, 41)) +>Base : Symbol(Base, Decl(constantOverloadFunction.ts, 0, 0)) +>biz : Symbol(biz, Decl(constantOverloadFunction.ts, 3, 29)) + +function foo(tagName: 'canvas'): Derived1; +>foo : Symbol(foo, Decl(constantOverloadFunction.ts, 3, 41), Decl(constantOverloadFunction.ts, 5, 42), Decl(constantOverloadFunction.ts, 6, 40), Decl(constantOverloadFunction.ts, 7, 40), Decl(constantOverloadFunction.ts, 8, 36)) +>tagName : Symbol(tagName, Decl(constantOverloadFunction.ts, 5, 13)) +>Derived1 : Symbol(Derived1, Decl(constantOverloadFunction.ts, 0, 24)) + +function foo(tagName: 'div'): Derived2; +>foo : Symbol(foo, Decl(constantOverloadFunction.ts, 3, 41), Decl(constantOverloadFunction.ts, 5, 42), Decl(constantOverloadFunction.ts, 6, 40), Decl(constantOverloadFunction.ts, 7, 40), Decl(constantOverloadFunction.ts, 8, 36)) +>tagName : Symbol(tagName, Decl(constantOverloadFunction.ts, 6, 13)) +>Derived2 : Symbol(Derived2, Decl(constantOverloadFunction.ts, 1, 41)) + +function foo(tagName: 'span'): Derived3; +>foo : Symbol(foo, Decl(constantOverloadFunction.ts, 3, 41), Decl(constantOverloadFunction.ts, 5, 42), Decl(constantOverloadFunction.ts, 6, 40), Decl(constantOverloadFunction.ts, 7, 40), Decl(constantOverloadFunction.ts, 8, 36)) +>tagName : Symbol(tagName, Decl(constantOverloadFunction.ts, 7, 13)) +>Derived3 : Symbol(Derived3, Decl(constantOverloadFunction.ts, 2, 41)) + +function foo(tagName: string): Base; +>foo : Symbol(foo, Decl(constantOverloadFunction.ts, 3, 41), Decl(constantOverloadFunction.ts, 5, 42), Decl(constantOverloadFunction.ts, 6, 40), Decl(constantOverloadFunction.ts, 7, 40), Decl(constantOverloadFunction.ts, 8, 36)) +>tagName : Symbol(tagName, Decl(constantOverloadFunction.ts, 8, 13)) +>Base : Symbol(Base, Decl(constantOverloadFunction.ts, 0, 0)) + +function foo(tagName: any): Base { +>foo : Symbol(foo, Decl(constantOverloadFunction.ts, 3, 41), Decl(constantOverloadFunction.ts, 5, 42), Decl(constantOverloadFunction.ts, 6, 40), Decl(constantOverloadFunction.ts, 7, 40), Decl(constantOverloadFunction.ts, 8, 36)) +>tagName : Symbol(tagName, Decl(constantOverloadFunction.ts, 9, 13)) +>Base : Symbol(Base, Decl(constantOverloadFunction.ts, 0, 0)) + + return null; +} + diff --git a/tests/baselines/reference/constantOverloadFunction.types b/tests/baselines/reference/constantOverloadFunction.types index 1e74486cb32..d643d3a726d 100644 --- a/tests/baselines/reference/constantOverloadFunction.types +++ b/tests/baselines/reference/constantOverloadFunction.types @@ -44,5 +44,6 @@ function foo(tagName: any): Base { >Base : Base return null; +>null : null } diff --git a/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.symbols b/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.symbols new file mode 100644 index 00000000000..ad63e11b7ed --- /dev/null +++ b/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.symbols @@ -0,0 +1,44 @@ +=== tests/cases/compiler/constraintCheckInGenericBaseTypeReference.ts === +// No errors +class Constraint { +>Constraint : Symbol(Constraint, Decl(constraintCheckInGenericBaseTypeReference.ts, 0, 0)) + + public method() { } +>method : Symbol(method, Decl(constraintCheckInGenericBaseTypeReference.ts, 1, 18)) +} +class GenericBase { +>GenericBase : Symbol(GenericBase, Decl(constraintCheckInGenericBaseTypeReference.ts, 3, 1)) +>T : Symbol(T, Decl(constraintCheckInGenericBaseTypeReference.ts, 4, 18)) +>Constraint : Symbol(Constraint, Decl(constraintCheckInGenericBaseTypeReference.ts, 0, 0)) + + public items: any; +>items : Symbol(items, Decl(constraintCheckInGenericBaseTypeReference.ts, 4, 41)) +} +class Derived extends GenericBase { +>Derived : Symbol(Derived, Decl(constraintCheckInGenericBaseTypeReference.ts, 6, 1)) +>GenericBase : Symbol(GenericBase, Decl(constraintCheckInGenericBaseTypeReference.ts, 3, 1)) +>TypeArg : Symbol(TypeArg, Decl(constraintCheckInGenericBaseTypeReference.ts, 9, 1)) + +} +class TypeArg { +>TypeArg : Symbol(TypeArg, Decl(constraintCheckInGenericBaseTypeReference.ts, 9, 1)) + + public method() { +>method : Symbol(method, Decl(constraintCheckInGenericBaseTypeReference.ts, 10, 15)) + + Container.People.items; +>Container.People.items : Symbol(GenericBase.items, Decl(constraintCheckInGenericBaseTypeReference.ts, 4, 41)) +>Container.People : Symbol(Container.People, Decl(constraintCheckInGenericBaseTypeReference.ts, 16, 17)) +>Container : Symbol(Container, Decl(constraintCheckInGenericBaseTypeReference.ts, 14, 1)) +>People : Symbol(Container.People, Decl(constraintCheckInGenericBaseTypeReference.ts, 16, 17)) +>items : Symbol(GenericBase.items, Decl(constraintCheckInGenericBaseTypeReference.ts, 4, 41)) + } +} + +class Container { +>Container : Symbol(Container, Decl(constraintCheckInGenericBaseTypeReference.ts, 14, 1)) + + public static People: Derived +>People : Symbol(Container.People, Decl(constraintCheckInGenericBaseTypeReference.ts, 16, 17)) +>Derived : Symbol(Derived, Decl(constraintCheckInGenericBaseTypeReference.ts, 6, 1)) +} diff --git a/tests/baselines/reference/constraintPropagationThroughReturnTypes.symbols b/tests/baselines/reference/constraintPropagationThroughReturnTypes.symbols new file mode 100644 index 00000000000..50cccd22db0 --- /dev/null +++ b/tests/baselines/reference/constraintPropagationThroughReturnTypes.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/constraintPropagationThroughReturnTypes.ts === +function g(x: T): T { +>g : Symbol(g, Decl(constraintPropagationThroughReturnTypes.ts, 0, 0)) +>T : Symbol(T, Decl(constraintPropagationThroughReturnTypes.ts, 0, 11)) +>x : Symbol(x, Decl(constraintPropagationThroughReturnTypes.ts, 0, 14)) +>T : Symbol(T, Decl(constraintPropagationThroughReturnTypes.ts, 0, 11)) +>T : Symbol(T, Decl(constraintPropagationThroughReturnTypes.ts, 0, 11)) + + return x; +>x : Symbol(x, Decl(constraintPropagationThroughReturnTypes.ts, 0, 14)) +} + +function f(x: S) { +>f : Symbol(f, Decl(constraintPropagationThroughReturnTypes.ts, 2, 1)) +>S : Symbol(S, Decl(constraintPropagationThroughReturnTypes.ts, 4, 11)) +>foo : Symbol(foo, Decl(constraintPropagationThroughReturnTypes.ts, 4, 22)) +>x : Symbol(x, Decl(constraintPropagationThroughReturnTypes.ts, 4, 38)) +>S : Symbol(S, Decl(constraintPropagationThroughReturnTypes.ts, 4, 11)) + + var y = g(x); +>y : Symbol(y, Decl(constraintPropagationThroughReturnTypes.ts, 5, 5)) +>g : Symbol(g, Decl(constraintPropagationThroughReturnTypes.ts, 0, 0)) +>x : Symbol(x, Decl(constraintPropagationThroughReturnTypes.ts, 4, 38)) + + y; +>y : Symbol(y, Decl(constraintPropagationThroughReturnTypes.ts, 5, 5)) +} + diff --git a/tests/baselines/reference/constraintSatisfactionWithAny.symbols b/tests/baselines/reference/constraintSatisfactionWithAny.symbols new file mode 100644 index 00000000000..fdf1bdce7e8 --- /dev/null +++ b/tests/baselines/reference/constraintSatisfactionWithAny.symbols @@ -0,0 +1,138 @@ +=== tests/cases/conformance/types/typeParameters/typeArgumentLists/constraintSatisfactionWithAny.ts === +// any is not a valid type argument unless there is no constraint, or the constraint is any + +function foo(x: T): T { return null; } +>foo : Symbol(foo, Decl(constraintSatisfactionWithAny.ts, 0, 0)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 2, 13)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) +>x : Symbol(x, Decl(constraintSatisfactionWithAny.ts, 2, 31)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 2, 13)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 2, 13)) + +function foo2(x: T): T { return null; } +>foo2 : Symbol(foo2, Decl(constraintSatisfactionWithAny.ts, 2, 56)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 3, 14)) +>x : Symbol(x, Decl(constraintSatisfactionWithAny.ts, 3, 25)) +>x : Symbol(x, Decl(constraintSatisfactionWithAny.ts, 3, 39)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 3, 14)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 3, 14)) + +//function foo3(x: T): T { return null; } +function foo4(x: T) => void>(x: T): T { return null; } +>foo4 : Symbol(foo4, Decl(constraintSatisfactionWithAny.ts, 3, 64)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 5, 14)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 5, 25)) +>x : Symbol(x, Decl(constraintSatisfactionWithAny.ts, 5, 28)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 5, 25)) +>x : Symbol(x, Decl(constraintSatisfactionWithAny.ts, 5, 43)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 5, 14)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 5, 14)) + +var a; +>a : Symbol(a, Decl(constraintSatisfactionWithAny.ts, 6, 3)) + +foo(a); +>foo : Symbol(foo, Decl(constraintSatisfactionWithAny.ts, 0, 0)) +>a : Symbol(a, Decl(constraintSatisfactionWithAny.ts, 6, 3)) + +foo2(a); +>foo2 : Symbol(foo2, Decl(constraintSatisfactionWithAny.ts, 2, 56)) +>a : Symbol(a, Decl(constraintSatisfactionWithAny.ts, 6, 3)) + +//foo3(a); +foo4(a); +>foo4 : Symbol(foo4, Decl(constraintSatisfactionWithAny.ts, 3, 64)) +>a : Symbol(a, Decl(constraintSatisfactionWithAny.ts, 6, 3)) + +var b: number; +>b : Symbol(b, Decl(constraintSatisfactionWithAny.ts, 12, 3)) + +foo(b); +>foo : Symbol(foo, Decl(constraintSatisfactionWithAny.ts, 0, 0)) +>b : Symbol(b, Decl(constraintSatisfactionWithAny.ts, 12, 3)) + +foo2(b); +>foo2 : Symbol(foo2, Decl(constraintSatisfactionWithAny.ts, 2, 56)) +>b : Symbol(b, Decl(constraintSatisfactionWithAny.ts, 12, 3)) + +//foo3(b); +foo4(b); +>foo4 : Symbol(foo4, Decl(constraintSatisfactionWithAny.ts, 3, 64)) +>b : Symbol(b, Decl(constraintSatisfactionWithAny.ts, 12, 3)) + +//function foo5(x: T, y: U): T { return null; } +//foo5(a, a); +//foo5(b, b); + +class C { +>C : Symbol(C, Decl(constraintSatisfactionWithAny.ts, 16, 13)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 22, 8)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + + constructor(public x: T) { } +>x : Symbol(x, Decl(constraintSatisfactionWithAny.ts, 23, 16)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 22, 8)) +} + +var c1 = new C(a); +>c1 : Symbol(c1, Decl(constraintSatisfactionWithAny.ts, 26, 3)) +>C : Symbol(C, Decl(constraintSatisfactionWithAny.ts, 16, 13)) +>a : Symbol(a, Decl(constraintSatisfactionWithAny.ts, 6, 3)) + +var c2 = new C(b); +>c2 : Symbol(c2, Decl(constraintSatisfactionWithAny.ts, 27, 3)) +>C : Symbol(C, Decl(constraintSatisfactionWithAny.ts, 16, 13)) +>b : Symbol(b, Decl(constraintSatisfactionWithAny.ts, 12, 3)) + +class C2 { +>C2 : Symbol(C2, Decl(constraintSatisfactionWithAny.ts, 27, 23)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 29, 9)) +>x : Symbol(x, Decl(constraintSatisfactionWithAny.ts, 29, 20)) + + constructor(public x: T) { } +>x : Symbol(x, Decl(constraintSatisfactionWithAny.ts, 30, 16)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 29, 9)) +} + +var c3 = new C2(a); +>c3 : Symbol(c3, Decl(constraintSatisfactionWithAny.ts, 33, 3)) +>C2 : Symbol(C2, Decl(constraintSatisfactionWithAny.ts, 27, 23)) +>a : Symbol(a, Decl(constraintSatisfactionWithAny.ts, 6, 3)) + +var c4 = new C2(b); +>c4 : Symbol(c4, Decl(constraintSatisfactionWithAny.ts, 34, 3)) +>C2 : Symbol(C2, Decl(constraintSatisfactionWithAny.ts, 27, 23)) +>b : Symbol(b, Decl(constraintSatisfactionWithAny.ts, 12, 3)) + +//class C3 { +// constructor(public x: T) { } +//} + +//var c5 = new C3(a); +//var c6 = new C3(b); + +class C4(x:T) => T> { +>C4 : Symbol(C4, Decl(constraintSatisfactionWithAny.ts, 34, 24)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 43, 9)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 43, 20)) +>x : Symbol(x, Decl(constraintSatisfactionWithAny.ts, 43, 23)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 43, 20)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 43, 20)) + + constructor(public x: T) { } +>x : Symbol(x, Decl(constraintSatisfactionWithAny.ts, 44, 16)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 43, 9)) +} + +var c7 = new C4(a); +>c7 : Symbol(c7, Decl(constraintSatisfactionWithAny.ts, 47, 3)) +>C4 : Symbol(C4, Decl(constraintSatisfactionWithAny.ts, 34, 24)) +>a : Symbol(a, Decl(constraintSatisfactionWithAny.ts, 6, 3)) + +var c8 = new C4(b); +>c8 : Symbol(c8, Decl(constraintSatisfactionWithAny.ts, 48, 3)) +>C4 : Symbol(C4, Decl(constraintSatisfactionWithAny.ts, 34, 24)) +>b : Symbol(b, Decl(constraintSatisfactionWithAny.ts, 12, 3)) + + + diff --git a/tests/baselines/reference/constraintSatisfactionWithAny.types b/tests/baselines/reference/constraintSatisfactionWithAny.types index e007d3cec73..f3363fe1a90 100644 --- a/tests/baselines/reference/constraintSatisfactionWithAny.types +++ b/tests/baselines/reference/constraintSatisfactionWithAny.types @@ -8,6 +8,7 @@ function foo(x: T): T { return null; } >x : T >T : T >T : T +>null : null function foo2(x: T): T { return null; } >foo2 : (x: T) => T @@ -16,6 +17,7 @@ function foo2(x: T): T { return null; } >x : T >T : T >T : T +>null : null //function foo3(x: T): T { return null; } function foo4(x: T) => void>(x: T): T { return null; } @@ -27,6 +29,7 @@ function foo4(x: T) => void>(x: T): T { return null; } >x : T >T : T >T : T +>null : null var a; >a : any diff --git a/tests/baselines/reference/constraintSatisfactionWithEmptyObject.symbols b/tests/baselines/reference/constraintSatisfactionWithEmptyObject.symbols new file mode 100644 index 00000000000..fd5aae69b86 --- /dev/null +++ b/tests/baselines/reference/constraintSatisfactionWithEmptyObject.symbols @@ -0,0 +1,93 @@ +=== tests/cases/conformance/types/typeParameters/typeArgumentLists/constraintSatisfactionWithEmptyObject.ts === +// valid uses of a basic object constraint, no errors expected + +// Object constraint +function foo(x: T) { } +>foo : Symbol(foo, Decl(constraintSatisfactionWithEmptyObject.ts, 0, 0)) +>T : Symbol(T, Decl(constraintSatisfactionWithEmptyObject.ts, 3, 13)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>x : Symbol(x, Decl(constraintSatisfactionWithEmptyObject.ts, 3, 31)) +>T : Symbol(T, Decl(constraintSatisfactionWithEmptyObject.ts, 3, 13)) + +var r = foo({}); +>r : Symbol(r, Decl(constraintSatisfactionWithEmptyObject.ts, 4, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 6, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 21, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 23, 3)) +>foo : Symbol(foo, Decl(constraintSatisfactionWithEmptyObject.ts, 0, 0)) + +var a = {}; +>a : Symbol(a, Decl(constraintSatisfactionWithEmptyObject.ts, 5, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 22, 3)) + +var r = foo({}); +>r : Symbol(r, Decl(constraintSatisfactionWithEmptyObject.ts, 4, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 6, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 21, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 23, 3)) +>foo : Symbol(foo, Decl(constraintSatisfactionWithEmptyObject.ts, 0, 0)) + +class C { +>C : Symbol(C, Decl(constraintSatisfactionWithEmptyObject.ts, 6, 16)) +>T : Symbol(T, Decl(constraintSatisfactionWithEmptyObject.ts, 8, 8)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + constructor(public x: T) { } +>x : Symbol(x, Decl(constraintSatisfactionWithEmptyObject.ts, 9, 16)) +>T : Symbol(T, Decl(constraintSatisfactionWithEmptyObject.ts, 8, 8)) +} + +var r2 = new C({}); +>r2 : Symbol(r2, Decl(constraintSatisfactionWithEmptyObject.ts, 12, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 29, 3)) +>C : Symbol(C, Decl(constraintSatisfactionWithEmptyObject.ts, 6, 16)) + +interface I { +>I : Symbol(I, Decl(constraintSatisfactionWithEmptyObject.ts, 12, 19)) +>T : Symbol(T, Decl(constraintSatisfactionWithEmptyObject.ts, 14, 12)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + x: T; +>x : Symbol(x, Decl(constraintSatisfactionWithEmptyObject.ts, 14, 31)) +>T : Symbol(T, Decl(constraintSatisfactionWithEmptyObject.ts, 14, 12)) +} +var i: I<{}>; +>i : Symbol(i, Decl(constraintSatisfactionWithEmptyObject.ts, 17, 3)) +>I : Symbol(I, Decl(constraintSatisfactionWithEmptyObject.ts, 12, 19)) + +// {} constraint +function foo2(x: T) { } +>foo2 : Symbol(foo2, Decl(constraintSatisfactionWithEmptyObject.ts, 17, 13)) +>T : Symbol(T, Decl(constraintSatisfactionWithEmptyObject.ts, 20, 14)) +>x : Symbol(x, Decl(constraintSatisfactionWithEmptyObject.ts, 20, 28)) +>T : Symbol(T, Decl(constraintSatisfactionWithEmptyObject.ts, 20, 14)) + +var r = foo2({}); +>r : Symbol(r, Decl(constraintSatisfactionWithEmptyObject.ts, 4, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 6, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 21, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 23, 3)) +>foo2 : Symbol(foo2, Decl(constraintSatisfactionWithEmptyObject.ts, 17, 13)) + +var a = {}; +>a : Symbol(a, Decl(constraintSatisfactionWithEmptyObject.ts, 5, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 22, 3)) + +var r = foo2({}); +>r : Symbol(r, Decl(constraintSatisfactionWithEmptyObject.ts, 4, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 6, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 21, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 23, 3)) +>foo2 : Symbol(foo2, Decl(constraintSatisfactionWithEmptyObject.ts, 17, 13)) + +class C2 { +>C2 : Symbol(C2, Decl(constraintSatisfactionWithEmptyObject.ts, 23, 17)) +>T : Symbol(T, Decl(constraintSatisfactionWithEmptyObject.ts, 25, 9)) + + constructor(public x: T) { } +>x : Symbol(x, Decl(constraintSatisfactionWithEmptyObject.ts, 26, 16)) +>T : Symbol(T, Decl(constraintSatisfactionWithEmptyObject.ts, 25, 9)) +} + +var r2 = new C2({}); +>r2 : Symbol(r2, Decl(constraintSatisfactionWithEmptyObject.ts, 12, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 29, 3)) +>C2 : Symbol(C2, Decl(constraintSatisfactionWithEmptyObject.ts, 23, 17)) + +interface I2 { +>I2 : Symbol(I2, Decl(constraintSatisfactionWithEmptyObject.ts, 29, 20)) +>T : Symbol(T, Decl(constraintSatisfactionWithEmptyObject.ts, 31, 13)) + + x: T; +>x : Symbol(x, Decl(constraintSatisfactionWithEmptyObject.ts, 31, 28)) +>T : Symbol(T, Decl(constraintSatisfactionWithEmptyObject.ts, 31, 13)) +} +var i2: I2<{}>; +>i2 : Symbol(i2, Decl(constraintSatisfactionWithEmptyObject.ts, 34, 3)) +>I2 : Symbol(I2, Decl(constraintSatisfactionWithEmptyObject.ts, 29, 20)) + + diff --git a/tests/baselines/reference/constraintsUsedInPrototypeProperty.symbols b/tests/baselines/reference/constraintsUsedInPrototypeProperty.symbols new file mode 100644 index 00000000000..23a1c08398e --- /dev/null +++ b/tests/baselines/reference/constraintsUsedInPrototypeProperty.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/constraintsUsedInPrototypeProperty.ts === +class Foo { } +>Foo : Symbol(Foo, Decl(constraintsUsedInPrototypeProperty.ts, 0, 0)) +>T : Symbol(T, Decl(constraintsUsedInPrototypeProperty.ts, 0, 10)) +>U : Symbol(U, Decl(constraintsUsedInPrototypeProperty.ts, 0, 27)) +>V : Symbol(V, Decl(constraintsUsedInPrototypeProperty.ts, 0, 30)) + +Foo.prototype; // Foo +>Foo.prototype : Symbol(Foo.prototype) +>Foo : Symbol(Foo, Decl(constraintsUsedInPrototypeProperty.ts, 0, 0)) +>prototype : Symbol(Foo.prototype) + diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.symbols b/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.symbols new file mode 100644 index 00000000000..b85ae3e90d8 --- /dev/null +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.symbols @@ -0,0 +1,398 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance2.ts === +// checking subtype relations for function types as it relates to contextual signature instantiation + +class Base { foo: string; } +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>bar : Symbol(bar, Decl(constructSignatureAssignabilityInInheritance2.ts, 3, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(constructSignatureAssignabilityInInheritance2.ts, 3, 43)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>baz : Symbol(baz, Decl(constructSignatureAssignabilityInInheritance2.ts, 4, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(constructSignatureAssignabilityInInheritance2.ts, 4, 47)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>bing : Symbol(bing, Decl(constructSignatureAssignabilityInInheritance2.ts, 5, 33)) + +interface A { // T +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance2.ts, 5, 49)) + + // M's + a: new (x: number) => number[]; +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance2.ts, 7, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 9, 12)) + + a2: new (x: number) => string[]; +>a2 : Symbol(a2, Decl(constructSignatureAssignabilityInInheritance2.ts, 9, 35)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 10, 13)) + + a3: new (x: number) => void; +>a3 : Symbol(a3, Decl(constructSignatureAssignabilityInInheritance2.ts, 10, 36)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 11, 13)) + + a4: new (x: string, y: number) => string; +>a4 : Symbol(a4, Decl(constructSignatureAssignabilityInInheritance2.ts, 11, 32)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 12, 13)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance2.ts, 12, 23)) + + a5: new (x: (arg: string) => number) => string; +>a5 : Symbol(a5, Decl(constructSignatureAssignabilityInInheritance2.ts, 12, 45)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 13, 13)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance2.ts, 13, 17)) + + a6: new (x: (arg: Base) => Derived) => Base; +>a6 : Symbol(a6, Decl(constructSignatureAssignabilityInInheritance2.ts, 13, 51)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 14, 13)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance2.ts, 14, 17)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) + + a7: new (x: (arg: Base) => Derived) => (r: Base) => Derived; +>a7 : Symbol(a7, Decl(constructSignatureAssignabilityInInheritance2.ts, 14, 48)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 15, 13)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance2.ts, 15, 17)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>r : Symbol(r, Decl(constructSignatureAssignabilityInInheritance2.ts, 15, 44)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a8: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +>a8 : Symbol(a8, Decl(constructSignatureAssignabilityInInheritance2.ts, 15, 64)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 16, 13)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance2.ts, 16, 17)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance2.ts, 16, 39)) +>arg2 : Symbol(arg2, Decl(constructSignatureAssignabilityInInheritance2.ts, 16, 44)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>r : Symbol(r, Decl(constructSignatureAssignabilityInInheritance2.ts, 16, 72)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a9: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +>a9 : Symbol(a9, Decl(constructSignatureAssignabilityInInheritance2.ts, 16, 92)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 17, 13)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance2.ts, 17, 17)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance2.ts, 17, 39)) +>arg2 : Symbol(arg2, Decl(constructSignatureAssignabilityInInheritance2.ts, 17, 44)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>r : Symbol(r, Decl(constructSignatureAssignabilityInInheritance2.ts, 17, 72)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a10: new (...x: Derived[]) => Derived; +>a10 : Symbol(a10, Decl(constructSignatureAssignabilityInInheritance2.ts, 17, 92)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 18, 14)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base; +>a11 : Symbol(a11, Decl(constructSignatureAssignabilityInInheritance2.ts, 18, 42)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 19, 14)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance2.ts, 19, 18)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance2.ts, 19, 33)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance2.ts, 19, 38)) +>bar : Symbol(bar, Decl(constructSignatureAssignabilityInInheritance2.ts, 19, 51)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) + + a12: new (x: Array, y: Array) => Array; +>a12 : Symbol(a12, Decl(constructSignatureAssignabilityInInheritance2.ts, 19, 75)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 20, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance2.ts, 20, 29)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived2 : Symbol(Derived2, Decl(constructSignatureAssignabilityInInheritance2.ts, 3, 43)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a13: new (x: Array, y: Array) => Array; +>a13 : Symbol(a13, Decl(constructSignatureAssignabilityInInheritance2.ts, 20, 68)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 21, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance2.ts, 21, 29)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a14: new (x: { a: string; b: number }) => Object; +>a14 : Symbol(a14, Decl(constructSignatureAssignabilityInInheritance2.ts, 21, 67)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 22, 14)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance2.ts, 22, 18)) +>b : Symbol(b, Decl(constructSignatureAssignabilityInInheritance2.ts, 22, 29)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + a15: { +>a15 : Symbol(a15, Decl(constructSignatureAssignabilityInInheritance2.ts, 22, 53)) + + new (x: number): number[]; +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 24, 13)) + + new (x: string): string[]; +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 25, 13)) + + }; + a16: { +>a16 : Symbol(a16, Decl(constructSignatureAssignabilityInInheritance2.ts, 26, 6)) + + new (x: T): number[]; +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 28, 13)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 28, 32)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 28, 13)) + + new (x: U): number[]; +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 29, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 29, 29)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 29, 13)) + + }; + a17: { +>a17 : Symbol(a17, Decl(constructSignatureAssignabilityInInheritance2.ts, 30, 6)) + + new (x: new (a: number) => number): number[]; +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 32, 13)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance2.ts, 32, 21)) + + new (x: new (a: string) => string): string[]; +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 33, 13)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance2.ts, 33, 21)) + + }; + a18: { +>a18 : Symbol(a18, Decl(constructSignatureAssignabilityInInheritance2.ts, 34, 6)) + + new (x: { +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 36, 13)) + + new (a: number): number; +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance2.ts, 37, 17)) + + new (a: string): string; +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance2.ts, 38, 17)) + + }): any[]; + new (x: { +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 40, 13)) + + new (a: boolean): boolean; +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance2.ts, 41, 17)) + + new (a: Date): Date; +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance2.ts, 42, 17)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + }): any[]; + }; +} + +// S's +interface I extends A { +>I : Symbol(I, Decl(constructSignatureAssignabilityInInheritance2.ts, 45, 1)) +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance2.ts, 5, 49)) + + // N's + a: new (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance2.ts, 48, 23)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 50, 12)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 50, 15)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 50, 12)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 50, 12)) + + a2: new (x: T) => string[]; // ok +>a2 : Symbol(a2, Decl(constructSignatureAssignabilityInInheritance2.ts, 50, 28)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 51, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 51, 16)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 51, 13)) + + a3: new (x: T) => T; // ok since Base returns void +>a3 : Symbol(a3, Decl(constructSignatureAssignabilityInInheritance2.ts, 51, 34)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 52, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 52, 16)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 52, 13)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 52, 13)) + + a4: new (x: T, y: U) => T; // ok, instantiation of N is a subtype of M, T is string, U is number +>a4 : Symbol(a4, Decl(constructSignatureAssignabilityInInheritance2.ts, 52, 27)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 53, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 53, 15)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 53, 19)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 53, 13)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance2.ts, 53, 24)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 53, 15)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 53, 13)) + + a5: new (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made +>a5 : Symbol(a5, Decl(constructSignatureAssignabilityInInheritance2.ts, 53, 36)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 54, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 54, 15)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 54, 19)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance2.ts, 54, 23)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 54, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 54, 15)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 54, 13)) + + a6: new (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy +>a6 : Symbol(a6, Decl(constructSignatureAssignabilityInInheritance2.ts, 54, 42)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 55, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 55, 28)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 55, 48)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance2.ts, 55, 52)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 55, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 55, 28)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 55, 13)) + + a7: new (x: (arg: T) => U) => (r: T) => U; // ok +>a7 : Symbol(a7, Decl(constructSignatureAssignabilityInInheritance2.ts, 55, 71)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 56, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 56, 28)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 56, 48)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance2.ts, 56, 52)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 56, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 56, 28)) +>r : Symbol(r, Decl(constructSignatureAssignabilityInInheritance2.ts, 56, 70)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 56, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 56, 28)) + + a8: new (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; // ok +>a8 : Symbol(a8, Decl(constructSignatureAssignabilityInInheritance2.ts, 56, 81)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 28)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 48)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 52)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 28)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 65)) +>arg2 : Symbol(arg2, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 70)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 28)) +>r : Symbol(r, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 89)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 28)) + + a9: new (x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; // ok, same as a8 with compatible object literal +>a9 : Symbol(a9, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 100)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 28)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 48)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 52)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 28)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 65)) +>arg2 : Symbol(arg2, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 70)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 77)) +>bing : Symbol(bing, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 90)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 28)) +>r : Symbol(r, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 117)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 28)) + + a10: new (...x: T[]) => T; // ok +>a10 : Symbol(a10, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 128)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 59, 14)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 59, 33)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 59, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 59, 14)) + + a11: new (x: T, y: T) => T; // ok +>a11 : Symbol(a11, Decl(constructSignatureAssignabilityInInheritance2.ts, 59, 49)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 60, 14)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 60, 30)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 60, 14)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance2.ts, 60, 35)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 60, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 60, 14)) + + a12: new >(x: Array, y: T) => Array; // ok, less specific parameter type +>a12 : Symbol(a12, Decl(constructSignatureAssignabilityInInheritance2.ts, 60, 47)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 61, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 61, 37)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance2.ts, 61, 52)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 61, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a13: new >(x: Array, y: T) => T; // ok, T = Array, satisfies constraint, contextual signature instantiation succeeds +>a13 : Symbol(a13, Decl(constructSignatureAssignabilityInInheritance2.ts, 61, 77)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 62, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 62, 40)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance2.ts, 62, 55)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 62, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 62, 14)) + + a14: new (x: { a: T; b: T }) => T; // ok, best common type yields T = {} but that's satisfactory for this signature +>a14 : Symbol(a14, Decl(constructSignatureAssignabilityInInheritance2.ts, 62, 67)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 63, 14)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 63, 17)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance2.ts, 63, 21)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 63, 14)) +>b : Symbol(b, Decl(constructSignatureAssignabilityInInheritance2.ts, 63, 27)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 63, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 63, 14)) + + a15: new (x: T) => T[]; // ok +>a15 : Symbol(a15, Decl(constructSignatureAssignabilityInInheritance2.ts, 63, 41)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 64, 14)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 64, 17)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 64, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 64, 14)) + + a16: new (x: T) => number[]; // ok +>a16 : Symbol(a16, Decl(constructSignatureAssignabilityInInheritance2.ts, 64, 30)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 65, 14)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 65, 30)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 65, 14)) + + a17: new (x: new (a: T) => T) => T[]; // ok +>a17 : Symbol(a17, Decl(constructSignatureAssignabilityInInheritance2.ts, 65, 48)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 66, 14)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 66, 17)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance2.ts, 66, 25)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 66, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 66, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 66, 14)) + + a18: new (x: new (a: T) => T) => T[]; // ok, no inferences for T but assignable to any +>a18 : Symbol(a18, Decl(constructSignatureAssignabilityInInheritance2.ts, 66, 44)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 67, 14)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 67, 17)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance2.ts, 67, 25)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 67, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 67, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 67, 14)) +} diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.symbols b/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.symbols new file mode 100644 index 00000000000..33ae7e0f6d6 --- /dev/null +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.symbols @@ -0,0 +1,332 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance4.ts === +// checking subtype relations for function types as it relates to contextual signature instantiation + +class Base { foo: string; } +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance4.ts, 2, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance4.ts, 2, 27)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>bar : Symbol(bar, Decl(constructSignatureAssignabilityInInheritance4.ts, 3, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(constructSignatureAssignabilityInInheritance4.ts, 3, 43)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance4.ts, 2, 27)) +>baz : Symbol(baz, Decl(constructSignatureAssignabilityInInheritance4.ts, 4, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(constructSignatureAssignabilityInInheritance4.ts, 4, 47)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>bing : Symbol(bing, Decl(constructSignatureAssignabilityInInheritance4.ts, 5, 33)) + +interface A { // T +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance4.ts, 5, 49)) + + // M's + a: new (x: T) => T[]; +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 7, 13)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 9, 12)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 9, 15)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 9, 12)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 9, 12)) + + a2: new (x: T) => string[]; +>a2 : Symbol(a2, Decl(constructSignatureAssignabilityInInheritance4.ts, 9, 28)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 10, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 10, 16)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 10, 13)) + + a3: new (x: T) => void; +>a3 : Symbol(a3, Decl(constructSignatureAssignabilityInInheritance4.ts, 10, 34)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 11, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 11, 16)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 11, 13)) + + a4: new (x: T, y: U) => string; +>a4 : Symbol(a4, Decl(constructSignatureAssignabilityInInheritance4.ts, 11, 30)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 12, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 12, 15)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 12, 19)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 12, 13)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance4.ts, 12, 24)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 12, 15)) + + a5: new (x: (arg: T) => U) => T; +>a5 : Symbol(a5, Decl(constructSignatureAssignabilityInInheritance4.ts, 12, 41)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 13, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 13, 15)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 13, 19)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance4.ts, 13, 23)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 13, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 13, 15)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 13, 13)) + + a6: new (x: (arg: T) => Derived) => T; +>a6 : Symbol(a6, Decl(constructSignatureAssignabilityInInheritance4.ts, 13, 42)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 14, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 14, 29)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance4.ts, 14, 33)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 14, 13)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance4.ts, 2, 27)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 14, 13)) + + a11: new (x: { foo: T }, y: { foo: T; bar: T }) => Base; +>a11 : Symbol(a11, Decl(constructSignatureAssignabilityInInheritance4.ts, 14, 58)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 15, 14)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 15, 17)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance4.ts, 15, 21)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 15, 14)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance4.ts, 15, 31)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance4.ts, 15, 36)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 15, 14)) +>bar : Symbol(bar, Decl(constructSignatureAssignabilityInInheritance4.ts, 15, 44)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 15, 14)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) + + a15: new (x: { a: T; b: T }) => T[]; +>a15 : Symbol(a15, Decl(constructSignatureAssignabilityInInheritance4.ts, 15, 63)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 16, 14)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 16, 17)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 16, 21)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 16, 14)) +>b : Symbol(b, Decl(constructSignatureAssignabilityInInheritance4.ts, 16, 27)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 16, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 16, 14)) + + a16: new (x: { a: T; b: T }) => T[]; +>a16 : Symbol(a16, Decl(constructSignatureAssignabilityInInheritance4.ts, 16, 43)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 17, 14)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 17, 30)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 17, 34)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 17, 14)) +>b : Symbol(b, Decl(constructSignatureAssignabilityInInheritance4.ts, 17, 40)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 17, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 17, 14)) + + a17: { +>a17 : Symbol(a17, Decl(constructSignatureAssignabilityInInheritance4.ts, 17, 56)) + + new (x: T): T[]; +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 19, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 19, 29)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 19, 13)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 19, 13)) + + new (x: U): U[]; +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 20, 13)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance4.ts, 2, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 20, 32)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 20, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 20, 13)) + + }; + a18: { +>a18 : Symbol(a18, Decl(constructSignatureAssignabilityInInheritance4.ts, 21, 6)) + + new (x: T): number[]; +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 23, 13)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance4.ts, 2, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 23, 32)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 23, 13)) + + new (x: U): number[]; +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 24, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 24, 29)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 24, 13)) + + }; + a19: { +>a19 : Symbol(a19, Decl(constructSignatureAssignabilityInInheritance4.ts, 25, 6)) + + new (x: new (a: T) => T): T[]; +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 27, 13)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance4.ts, 2, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 27, 32)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 27, 40)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 27, 13)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 27, 13)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 27, 13)) + + new (x: new (a: U) => U): U[]; +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 28, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 28, 29)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 28, 37)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 28, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 28, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 28, 13)) + + }; + a20: { +>a20 : Symbol(a20, Decl(constructSignatureAssignabilityInInheritance4.ts, 29, 6)) + + new (x: { +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 31, 13)) + + new (a: T): T; +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 32, 17)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance4.ts, 2, 27)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 32, 36)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 32, 17)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 32, 17)) + + new (a: U): U; +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 33, 17)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 33, 33)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 33, 17)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 33, 17)) + + }): any[]; + new (x: { +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 35, 13)) + + new (a: T): T; +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 36, 17)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 36, 33)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 36, 17)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 36, 17)) + + new (a: U): U; +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 37, 17)) +>Derived2 : Symbol(Derived2, Decl(constructSignatureAssignabilityInInheritance4.ts, 3, 43)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 37, 37)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 37, 17)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 37, 17)) + + }): any[]; + }; +} + +// S's +interface I extends A { +>I : Symbol(I, Decl(constructSignatureAssignabilityInInheritance4.ts, 40, 1)) +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance4.ts, 5, 49)) + + // N's + a: new (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 43, 23)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 45, 12)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 45, 15)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 45, 12)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 45, 12)) + + a2: new (x: T) => string[]; // ok +>a2 : Symbol(a2, Decl(constructSignatureAssignabilityInInheritance4.ts, 45, 28)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 46, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 46, 16)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 46, 13)) + + a3: new (x: T) => T; // ok since Base returns void +>a3 : Symbol(a3, Decl(constructSignatureAssignabilityInInheritance4.ts, 46, 34)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 47, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 47, 16)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 47, 13)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 47, 13)) + + a4: new (x: T, y: U) => string; // ok, instantiation of N is a subtype of M, T is string, U is number +>a4 : Symbol(a4, Decl(constructSignatureAssignabilityInInheritance4.ts, 47, 27)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 48, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 48, 15)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 48, 19)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 48, 13)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance4.ts, 48, 24)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 48, 15)) + + a5: new (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made +>a5 : Symbol(a5, Decl(constructSignatureAssignabilityInInheritance4.ts, 48, 41)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 49, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 49, 15)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 49, 19)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance4.ts, 49, 23)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 49, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 49, 15)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 49, 13)) + + a6: new (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy +>a6 : Symbol(a6, Decl(constructSignatureAssignabilityInInheritance4.ts, 49, 42)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 50, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 50, 28)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance4.ts, 2, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 50, 48)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance4.ts, 50, 52)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 50, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 50, 28)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 50, 13)) + + a11: new (x: { foo: T }, y: { foo: U; bar: U }) => Base; // ok +>a11 : Symbol(a11, Decl(constructSignatureAssignabilityInInheritance4.ts, 50, 71)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 51, 14)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 51, 16)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 51, 20)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance4.ts, 51, 24)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 51, 14)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance4.ts, 51, 34)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance4.ts, 51, 39)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 51, 16)) +>bar : Symbol(bar, Decl(constructSignatureAssignabilityInInheritance4.ts, 51, 47)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 51, 16)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) + + a15: new (x: { a: U; b: V; }) => U[]; // ok, T = U, T = V +>a15 : Symbol(a15, Decl(constructSignatureAssignabilityInInheritance4.ts, 51, 66)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 52, 14)) +>V : Symbol(V, Decl(constructSignatureAssignabilityInInheritance4.ts, 52, 16)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 52, 20)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 52, 24)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 52, 14)) +>b : Symbol(b, Decl(constructSignatureAssignabilityInInheritance4.ts, 52, 30)) +>V : Symbol(V, Decl(constructSignatureAssignabilityInInheritance4.ts, 52, 16)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 52, 14)) + + a16: new (x: { a: T; b: T }) => T[]; // ok, more general parameter type +>a16 : Symbol(a16, Decl(constructSignatureAssignabilityInInheritance4.ts, 52, 47)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 53, 14)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 53, 17)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 53, 21)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 53, 14)) +>b : Symbol(b, Decl(constructSignatureAssignabilityInInheritance4.ts, 53, 27)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 53, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 53, 14)) + + a17: new (x: T) => T[]; // ok, more general parameter type +>a17 : Symbol(a17, Decl(constructSignatureAssignabilityInInheritance4.ts, 53, 43)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 54, 14)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 54, 30)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 54, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 54, 14)) + + a18: new (x: T) => number[]; // ok, more general parameter type +>a18 : Symbol(a18, Decl(constructSignatureAssignabilityInInheritance4.ts, 54, 43)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 55, 14)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 55, 30)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 55, 14)) + + a19: new (x: new (a: T) => T) => T[]; // ok +>a19 : Symbol(a19, Decl(constructSignatureAssignabilityInInheritance4.ts, 55, 48)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 56, 14)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 56, 30)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 56, 38)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 56, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 56, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 56, 14)) + + a20: new (x: new (a: T) => T) => any[]; // ok +>a20 : Symbol(a20, Decl(constructSignatureAssignabilityInInheritance4.ts, 56, 57)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 57, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 57, 22)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 57, 38)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 57, 22)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 57, 22)) +} diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.symbols b/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.symbols new file mode 100644 index 00000000000..2be72546bee --- /dev/null +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.symbols @@ -0,0 +1,314 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance5.ts === +// checking subtype relations for function types as it relates to contextual signature instantiation +// same as subtypingWithConstructSignatures2 just with an extra level of indirection in the inheritance chain + +class Base { foo: string; } +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>bar : Symbol(bar, Decl(constructSignatureAssignabilityInInheritance5.ts, 4, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(constructSignatureAssignabilityInInheritance5.ts, 4, 43)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>baz : Symbol(baz, Decl(constructSignatureAssignabilityInInheritance5.ts, 5, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(constructSignatureAssignabilityInInheritance5.ts, 5, 47)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>bing : Symbol(bing, Decl(constructSignatureAssignabilityInInheritance5.ts, 6, 33)) + +interface A { // T +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance5.ts, 6, 49)) + + // M's + a: new (x: number) => number[]; +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance5.ts, 8, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 10, 12)) + + a2: new (x: number) => string[]; +>a2 : Symbol(a2, Decl(constructSignatureAssignabilityInInheritance5.ts, 10, 35)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 11, 13)) + + a3: new (x: number) => void; +>a3 : Symbol(a3, Decl(constructSignatureAssignabilityInInheritance5.ts, 11, 36)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 12, 13)) + + a4: new (x: string, y: number) => string; +>a4 : Symbol(a4, Decl(constructSignatureAssignabilityInInheritance5.ts, 12, 32)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 13, 13)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance5.ts, 13, 23)) + + a5: new (x: (arg: string) => number) => string; +>a5 : Symbol(a5, Decl(constructSignatureAssignabilityInInheritance5.ts, 13, 45)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 14, 13)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance5.ts, 14, 17)) + + a6: new (x: (arg: Base) => Derived) => Base; +>a6 : Symbol(a6, Decl(constructSignatureAssignabilityInInheritance5.ts, 14, 51)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 15, 13)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance5.ts, 15, 17)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) + + a7: new (x: (arg: Base) => Derived) => (r: Base) => Derived; +>a7 : Symbol(a7, Decl(constructSignatureAssignabilityInInheritance5.ts, 15, 48)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 16, 13)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance5.ts, 16, 17)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>r : Symbol(r, Decl(constructSignatureAssignabilityInInheritance5.ts, 16, 44)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a8: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +>a8 : Symbol(a8, Decl(constructSignatureAssignabilityInInheritance5.ts, 16, 64)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 17, 13)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance5.ts, 17, 17)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance5.ts, 17, 39)) +>arg2 : Symbol(arg2, Decl(constructSignatureAssignabilityInInheritance5.ts, 17, 44)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>r : Symbol(r, Decl(constructSignatureAssignabilityInInheritance5.ts, 17, 72)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a9: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +>a9 : Symbol(a9, Decl(constructSignatureAssignabilityInInheritance5.ts, 17, 92)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 18, 13)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance5.ts, 18, 17)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance5.ts, 18, 39)) +>arg2 : Symbol(arg2, Decl(constructSignatureAssignabilityInInheritance5.ts, 18, 44)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>r : Symbol(r, Decl(constructSignatureAssignabilityInInheritance5.ts, 18, 72)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a10: new (...x: Derived[]) => Derived; +>a10 : Symbol(a10, Decl(constructSignatureAssignabilityInInheritance5.ts, 18, 92)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 19, 14)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base; +>a11 : Symbol(a11, Decl(constructSignatureAssignabilityInInheritance5.ts, 19, 42)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 20, 14)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance5.ts, 20, 18)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance5.ts, 20, 33)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance5.ts, 20, 38)) +>bar : Symbol(bar, Decl(constructSignatureAssignabilityInInheritance5.ts, 20, 51)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) + + a12: new (x: Array, y: Array) => Array; +>a12 : Symbol(a12, Decl(constructSignatureAssignabilityInInheritance5.ts, 20, 75)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 21, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance5.ts, 21, 29)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived2 : Symbol(Derived2, Decl(constructSignatureAssignabilityInInheritance5.ts, 4, 43)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a13: new (x: Array, y: Array) => Array; +>a13 : Symbol(a13, Decl(constructSignatureAssignabilityInInheritance5.ts, 21, 68)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 22, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance5.ts, 22, 29)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a14: new (x: { a: string; b: number }) => Object; +>a14 : Symbol(a14, Decl(constructSignatureAssignabilityInInheritance5.ts, 22, 67)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 23, 14)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance5.ts, 23, 18)) +>b : Symbol(b, Decl(constructSignatureAssignabilityInInheritance5.ts, 23, 29)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +} + +interface B extends A { +>B : Symbol(B, Decl(constructSignatureAssignabilityInInheritance5.ts, 24, 1)) +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance5.ts, 6, 49)) + + a: new (x: T) => T[]; +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance5.ts, 26, 23)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 27, 12)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 27, 15)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 27, 12)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 27, 12)) +} + +// S's +interface I extends B { +>I : Symbol(I, Decl(constructSignatureAssignabilityInInheritance5.ts, 28, 1)) +>B : Symbol(B, Decl(constructSignatureAssignabilityInInheritance5.ts, 24, 1)) + + // N's + a: new (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance5.ts, 31, 23)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 33, 12)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 33, 15)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 33, 12)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 33, 12)) + + a2: new (x: T) => string[]; // ok +>a2 : Symbol(a2, Decl(constructSignatureAssignabilityInInheritance5.ts, 33, 28)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 34, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 34, 16)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 34, 13)) + + a3: new (x: T) => T; // ok since Base returns void +>a3 : Symbol(a3, Decl(constructSignatureAssignabilityInInheritance5.ts, 34, 34)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 35, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 35, 16)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 35, 13)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 35, 13)) + + a4: new (x: T, y: U) => T; // ok, instantiation of N is a subtype of M, T is string, U is number +>a4 : Symbol(a4, Decl(constructSignatureAssignabilityInInheritance5.ts, 35, 27)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 36, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 36, 15)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 36, 19)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 36, 13)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance5.ts, 36, 24)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 36, 15)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 36, 13)) + + a5: new (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made +>a5 : Symbol(a5, Decl(constructSignatureAssignabilityInInheritance5.ts, 36, 36)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 37, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 37, 15)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 37, 19)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance5.ts, 37, 23)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 37, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 37, 15)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 37, 13)) + + a6: new (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy +>a6 : Symbol(a6, Decl(constructSignatureAssignabilityInInheritance5.ts, 37, 42)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 38, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 38, 28)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 38, 48)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance5.ts, 38, 52)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 38, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 38, 28)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 38, 13)) + + a7: new (x: (arg: T) => U) => (r: T) => U; // ok +>a7 : Symbol(a7, Decl(constructSignatureAssignabilityInInheritance5.ts, 38, 71)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 39, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 39, 28)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 39, 48)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance5.ts, 39, 52)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 39, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 39, 28)) +>r : Symbol(r, Decl(constructSignatureAssignabilityInInheritance5.ts, 39, 70)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 39, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 39, 28)) + + a8: new (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; // ok +>a8 : Symbol(a8, Decl(constructSignatureAssignabilityInInheritance5.ts, 39, 81)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 28)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 48)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 52)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 28)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 65)) +>arg2 : Symbol(arg2, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 70)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 28)) +>r : Symbol(r, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 89)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 28)) + + a9: new (x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; // ok, same as a8 with compatible object literal +>a9 : Symbol(a9, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 100)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 28)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 48)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 52)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 28)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 65)) +>arg2 : Symbol(arg2, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 70)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 77)) +>bing : Symbol(bing, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 90)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 28)) +>r : Symbol(r, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 117)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 28)) + + a10: new (...x: T[]) => T; // ok +>a10 : Symbol(a10, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 128)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 42, 14)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 42, 33)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 42, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 42, 14)) + + a11: new (x: T, y: T) => T; // ok +>a11 : Symbol(a11, Decl(constructSignatureAssignabilityInInheritance5.ts, 42, 49)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 43, 14)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 43, 30)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 43, 14)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance5.ts, 43, 35)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 43, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 43, 14)) + + a12: new >(x: Array, y: T) => Array; // ok, less specific parameter type +>a12 : Symbol(a12, Decl(constructSignatureAssignabilityInInheritance5.ts, 43, 47)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 44, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 44, 37)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance5.ts, 44, 52)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 44, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a13: new >(x: Array, y: T) => T; // ok, T = Array, satisfies constraint, contextual signature instantiation succeeds +>a13 : Symbol(a13, Decl(constructSignatureAssignabilityInInheritance5.ts, 44, 77)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 45, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 45, 40)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance5.ts, 45, 55)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 45, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 45, 14)) + + a14: new (x: { a: T; b: T }) => T; // ok, best common type yields T = {} but that's satisfactory for this signature +>a14 : Symbol(a14, Decl(constructSignatureAssignabilityInInheritance5.ts, 45, 67)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 46, 14)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 46, 17)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance5.ts, 46, 21)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 46, 14)) +>b : Symbol(b, Decl(constructSignatureAssignabilityInInheritance5.ts, 46, 27)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 46, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 46, 14)) +} diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.symbols b/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.symbols new file mode 100644 index 00000000000..6f80b15484c --- /dev/null +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.symbols @@ -0,0 +1,209 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance6.ts === +// checking subtype relations for function types as it relates to contextual signature instantiation +// same as subtypingWithConstructSignatures4 but using class type parameters instead of generic signatures +// all are errors + +class Base { foo: string; } +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance6.ts, 0, 0)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance6.ts, 4, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance6.ts, 4, 27)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance6.ts, 0, 0)) +>bar : Symbol(bar, Decl(constructSignatureAssignabilityInInheritance6.ts, 5, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(constructSignatureAssignabilityInInheritance6.ts, 5, 43)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance6.ts, 4, 27)) +>baz : Symbol(baz, Decl(constructSignatureAssignabilityInInheritance6.ts, 6, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(constructSignatureAssignabilityInInheritance6.ts, 6, 47)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance6.ts, 0, 0)) +>bing : Symbol(bing, Decl(constructSignatureAssignabilityInInheritance6.ts, 7, 33)) + +interface A { // T +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance6.ts, 7, 49)) + + // M's + a: new (x: T) => T[]; +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance6.ts, 9, 13)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 11, 12)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 11, 15)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 11, 12)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 11, 12)) + + a2: new (x: T) => string[]; +>a2 : Symbol(a2, Decl(constructSignatureAssignabilityInInheritance6.ts, 11, 28)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 12, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 12, 16)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 12, 13)) + + a3: new (x: T) => void; +>a3 : Symbol(a3, Decl(constructSignatureAssignabilityInInheritance6.ts, 12, 34)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 13, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 13, 16)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 13, 13)) + + a4: new (x: T, y: U) => string; +>a4 : Symbol(a4, Decl(constructSignatureAssignabilityInInheritance6.ts, 13, 30)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 14, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance6.ts, 14, 15)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 14, 19)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 14, 13)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance6.ts, 14, 24)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance6.ts, 14, 15)) + + a5: new (x: (arg: T) => U) => T; +>a5 : Symbol(a5, Decl(constructSignatureAssignabilityInInheritance6.ts, 14, 41)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 15, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance6.ts, 15, 15)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 15, 19)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance6.ts, 15, 23)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 15, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance6.ts, 15, 15)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 15, 13)) + + a6: new (x: (arg: T) => Derived) => T; +>a6 : Symbol(a6, Decl(constructSignatureAssignabilityInInheritance6.ts, 15, 42)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 16, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance6.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 16, 29)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance6.ts, 16, 33)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 16, 13)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance6.ts, 4, 27)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 16, 13)) + + a11: new (x: { foo: T }, y: { foo: T; bar: T }) => Base; +>a11 : Symbol(a11, Decl(constructSignatureAssignabilityInInheritance6.ts, 16, 58)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 17, 14)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 17, 17)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance6.ts, 17, 21)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 17, 14)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance6.ts, 17, 31)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance6.ts, 17, 36)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 17, 14)) +>bar : Symbol(bar, Decl(constructSignatureAssignabilityInInheritance6.ts, 17, 44)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 17, 14)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance6.ts, 0, 0)) + + a15: new (x: { a: T; b: T }) => T[]; +>a15 : Symbol(a15, Decl(constructSignatureAssignabilityInInheritance6.ts, 17, 63)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 18, 14)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 18, 17)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance6.ts, 18, 21)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 18, 14)) +>b : Symbol(b, Decl(constructSignatureAssignabilityInInheritance6.ts, 18, 27)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 18, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 18, 14)) + + a16: new (x: { a: T; b: T }) => T[]; +>a16 : Symbol(a16, Decl(constructSignatureAssignabilityInInheritance6.ts, 18, 43)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 19, 14)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance6.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 19, 30)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance6.ts, 19, 34)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 19, 14)) +>b : Symbol(b, Decl(constructSignatureAssignabilityInInheritance6.ts, 19, 40)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 19, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 19, 14)) +} + +// S's +interface I extends A { +>I : Symbol(I, Decl(constructSignatureAssignabilityInInheritance6.ts, 20, 1)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 23, 12)) +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a: new (x: T) => T[]; +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance6.ts, 23, 26)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 24, 12)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 23, 12)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 23, 12)) +} + +interface I2 extends A { +>I2 : Symbol(I2, Decl(constructSignatureAssignabilityInInheritance6.ts, 25, 1)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 27, 13)) +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a2: new (x: T) => string[]; +>a2 : Symbol(a2, Decl(constructSignatureAssignabilityInInheritance6.ts, 27, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 28, 13)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 27, 13)) +} + +interface I3 extends A { +>I3 : Symbol(I3, Decl(constructSignatureAssignabilityInInheritance6.ts, 29, 1)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 31, 13)) +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a3: new (x: T) => T; +>a3 : Symbol(a3, Decl(constructSignatureAssignabilityInInheritance6.ts, 31, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 32, 13)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 31, 13)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 31, 13)) +} + +interface I4 extends A { +>I4 : Symbol(I4, Decl(constructSignatureAssignabilityInInheritance6.ts, 33, 1)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 35, 13)) +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a4: new (x: T, y: U) => string; +>a4 : Symbol(a4, Decl(constructSignatureAssignabilityInInheritance6.ts, 35, 27)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance6.ts, 36, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 36, 16)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 35, 13)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance6.ts, 36, 21)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance6.ts, 36, 13)) +} + +interface I5 extends A { +>I5 : Symbol(I5, Decl(constructSignatureAssignabilityInInheritance6.ts, 37, 1)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 39, 13)) +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a5: new (x: (arg: T) => U) => T; +>a5 : Symbol(a5, Decl(constructSignatureAssignabilityInInheritance6.ts, 39, 27)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance6.ts, 40, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 40, 16)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance6.ts, 40, 20)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 39, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance6.ts, 40, 13)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 39, 13)) +} + +interface I7 extends A { +>I7 : Symbol(I7, Decl(constructSignatureAssignabilityInInheritance6.ts, 41, 1)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 43, 13)) +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a11: new (x: { foo: T }, y: { foo: U; bar: U }) => Base; +>a11 : Symbol(a11, Decl(constructSignatureAssignabilityInInheritance6.ts, 43, 27)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance6.ts, 44, 14)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 44, 17)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance6.ts, 44, 21)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 43, 13)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance6.ts, 44, 31)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance6.ts, 44, 36)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance6.ts, 44, 14)) +>bar : Symbol(bar, Decl(constructSignatureAssignabilityInInheritance6.ts, 44, 44)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance6.ts, 44, 14)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance6.ts, 0, 0)) +} + +interface I9 extends A { +>I9 : Symbol(I9, Decl(constructSignatureAssignabilityInInheritance6.ts, 45, 1)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 47, 13)) +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a16: new (x: { a: T; b: T }) => T[]; +>a16 : Symbol(a16, Decl(constructSignatureAssignabilityInInheritance6.ts, 47, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 48, 14)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance6.ts, 48, 18)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 47, 13)) +>b : Symbol(b, Decl(constructSignatureAssignabilityInInheritance6.ts, 48, 24)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 47, 13)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 47, 13)) +} diff --git a/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.symbols b/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.symbols new file mode 100644 index 00000000000..77ab51f057a --- /dev/null +++ b/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.symbols @@ -0,0 +1,152 @@ +=== tests/cases/conformance/types/objectTypeLiteral/constructSignatures/constructSignaturesWithIdenticalOverloads.ts === +// Duplicate overloads of construct signatures should generate errors + +class C { +>C : Symbol(C, Decl(constructSignaturesWithIdenticalOverloads.ts, 0, 0)) + + constructor(x: number, y: string); +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 3, 16)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 3, 26)) + + constructor(x: number, y: string); // error +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 4, 16)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 4, 26)) + + constructor(x: number) { } +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 5, 16)) +} + +var r1 = new C(1, ''); +>r1 : Symbol(r1, Decl(constructSignaturesWithIdenticalOverloads.ts, 8, 3)) +>C : Symbol(C, Decl(constructSignaturesWithIdenticalOverloads.ts, 0, 0)) + +class C2 { +>C2 : Symbol(C2, Decl(constructSignaturesWithIdenticalOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 10, 9)) + + constructor(x: T, y: string); +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 11, 16)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 10, 9)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 11, 21)) + + constructor(x: T, y: string); // error +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 12, 16)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 10, 9)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 12, 21)) + + constructor(x: T) { } +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 13, 16)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 10, 9)) +} + +var r2 = new C2(1, ''); +>r2 : Symbol(r2, Decl(constructSignaturesWithIdenticalOverloads.ts, 16, 3)) +>C2 : Symbol(C2, Decl(constructSignaturesWithIdenticalOverloads.ts, 8, 22)) + +interface I { +>I : Symbol(I, Decl(constructSignaturesWithIdenticalOverloads.ts, 16, 23)) + + new (x: number, y: string): C; +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 19, 9)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 19, 19)) +>C : Symbol(C, Decl(constructSignaturesWithIdenticalOverloads.ts, 0, 0)) + + new (x: number, y: string): C; // error +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 20, 9)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 20, 19)) +>C : Symbol(C, Decl(constructSignaturesWithIdenticalOverloads.ts, 0, 0)) +} + +var i: I; +>i : Symbol(i, Decl(constructSignaturesWithIdenticalOverloads.ts, 23, 3)) +>I : Symbol(I, Decl(constructSignaturesWithIdenticalOverloads.ts, 16, 23)) + +var r3 = new i(1, ''); +>r3 : Symbol(r3, Decl(constructSignaturesWithIdenticalOverloads.ts, 24, 3)) +>i : Symbol(i, Decl(constructSignaturesWithIdenticalOverloads.ts, 23, 3)) + +interface I2 { +>I2 : Symbol(I2, Decl(constructSignaturesWithIdenticalOverloads.ts, 24, 22)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 26, 13)) + + new (x: T, y: string): C2; +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 27, 9)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 26, 13)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 27, 14)) +>C2 : Symbol(C2, Decl(constructSignaturesWithIdenticalOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 26, 13)) + + new (x: T, y: string): C2; // error +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 28, 9)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 26, 13)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 28, 14)) +>C2 : Symbol(C2, Decl(constructSignaturesWithIdenticalOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 26, 13)) + + new (x: T, y: string): C2; +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 29, 9)) +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 29, 12)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 29, 9)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 29, 17)) +>C2 : Symbol(C2, Decl(constructSignaturesWithIdenticalOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 29, 9)) + + new (x: T, y: string): C2; // error +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 30, 9)) +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 30, 12)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 30, 9)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 30, 17)) +>C2 : Symbol(C2, Decl(constructSignaturesWithIdenticalOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 30, 9)) +} + +var i2: I2; +>i2 : Symbol(i2, Decl(constructSignaturesWithIdenticalOverloads.ts, 33, 3)) +>I2 : Symbol(I2, Decl(constructSignaturesWithIdenticalOverloads.ts, 24, 22)) + +var r4 = new i2(1, ''); +>r4 : Symbol(r4, Decl(constructSignaturesWithIdenticalOverloads.ts, 34, 3)) +>i2 : Symbol(i2, Decl(constructSignaturesWithIdenticalOverloads.ts, 33, 3)) + +var a: { +>a : Symbol(a, Decl(constructSignaturesWithIdenticalOverloads.ts, 36, 3)) + + new (x: number, y: string): C; +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 37, 9)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 37, 19)) +>C : Symbol(C, Decl(constructSignaturesWithIdenticalOverloads.ts, 0, 0)) + + new (x: number, y: string): C; // error +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 38, 9)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 38, 19)) +>C : Symbol(C, Decl(constructSignaturesWithIdenticalOverloads.ts, 0, 0)) +} + +var r5 = new a(1, ''); +>r5 : Symbol(r5, Decl(constructSignaturesWithIdenticalOverloads.ts, 41, 3)) +>a : Symbol(a, Decl(constructSignaturesWithIdenticalOverloads.ts, 36, 3)) + +var b: { +>b : Symbol(b, Decl(constructSignaturesWithIdenticalOverloads.ts, 43, 3)) + + new (x: T, y: string): C2; +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 44, 9)) +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 44, 12)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 44, 9)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 44, 17)) +>C2 : Symbol(C2, Decl(constructSignaturesWithIdenticalOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 44, 9)) + + new (x: T, y: string): C2; // error +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 45, 9)) +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 45, 12)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 45, 9)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 45, 17)) +>C2 : Symbol(C2, Decl(constructSignaturesWithIdenticalOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 45, 9)) +} + +var r6 = new b(1, ''); +>r6 : Symbol(r6, Decl(constructSignaturesWithIdenticalOverloads.ts, 48, 3)) +>b : Symbol(b, Decl(constructSignaturesWithIdenticalOverloads.ts, 43, 3)) + diff --git a/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.types b/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.types index a34c5365f2d..ca2cb6fefb7 100644 --- a/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.types +++ b/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.types @@ -20,6 +20,8 @@ var r1 = new C(1, ''); >r1 : C >new C(1, '') : C >C : typeof C +>1 : number +>'' : string class C2 { >C2 : C2 @@ -44,6 +46,8 @@ var r2 = new C2(1, ''); >r2 : C2 >new C2(1, '') : C2 >C2 : typeof C2 +>1 : number +>'' : string interface I { >I : I @@ -67,6 +71,8 @@ var r3 = new i(1, ''); >r3 : C >new i(1, '') : C >i : I +>1 : number +>'' : string interface I2 { >I2 : I2 @@ -111,6 +117,8 @@ var r4 = new i2(1, ''); >r4 : C2 >new i2(1, '') : C2 >i2 : I2 +>1 : number +>'' : string var a: { >a : { new (x: number, y: string): C; new (x: number, y: string): C; } @@ -130,6 +138,8 @@ var r5 = new a(1, ''); >r5 : C >new a(1, '') : C >a : { new (x: number, y: string): C; new (x: number, y: string): C; } +>1 : number +>'' : string var b: { >b : { new (x: T, y: string): C2; new (x: T, y: string): C2; } @@ -155,4 +165,6 @@ var r6 = new b(1, ''); >r6 : C2 >new b(1, '') : C2 >b : { new (x: T, y: string): C2; new (x: T, y: string): C2; } +>1 : number +>'' : string diff --git a/tests/baselines/reference/constructSignaturesWithOverloads.symbols b/tests/baselines/reference/constructSignaturesWithOverloads.symbols new file mode 100644 index 00000000000..9130cb3f38a --- /dev/null +++ b/tests/baselines/reference/constructSignaturesWithOverloads.symbols @@ -0,0 +1,153 @@ +=== tests/cases/conformance/types/objectTypeLiteral/constructSignatures/constructSignaturesWithOverloads.ts === +// No errors expected for basic overloads of construct signatures + +class C { +>C : Symbol(C, Decl(constructSignaturesWithOverloads.ts, 0, 0)) + + constructor(x: number, y?: string); +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 3, 16)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 3, 26)) + + constructor(x: number, y: string); +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 4, 16)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 4, 26)) + + constructor(x: number) { } +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 5, 16)) +} + +var r1 = new C(1, ''); +>r1 : Symbol(r1, Decl(constructSignaturesWithOverloads.ts, 8, 3)) +>C : Symbol(C, Decl(constructSignaturesWithOverloads.ts, 0, 0)) + +class C2 { +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 10, 9)) + + constructor(x: T, y?: string); +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 11, 16)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 10, 9)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 11, 21)) + + constructor(x: T, y: string); +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 12, 16)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 10, 9)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 12, 21)) + + constructor(x: T) { } +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 13, 16)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 10, 9)) +} + +var r2 = new C2(1, ''); +>r2 : Symbol(r2, Decl(constructSignaturesWithOverloads.ts, 16, 3)) +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloads.ts, 8, 22)) + +interface I { +>I : Symbol(I, Decl(constructSignaturesWithOverloads.ts, 16, 23)) + + new(x: number, y?: string): C; +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 19, 8)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 19, 18)) +>C : Symbol(C, Decl(constructSignaturesWithOverloads.ts, 0, 0)) + + new(x: number, y: string): C; +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 20, 8)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 20, 18)) +>C : Symbol(C, Decl(constructSignaturesWithOverloads.ts, 0, 0)) +} + +var i: I; +>i : Symbol(i, Decl(constructSignaturesWithOverloads.ts, 23, 3)) +>I : Symbol(I, Decl(constructSignaturesWithOverloads.ts, 16, 23)) + +var r3 = new i(1, ''); +>r3 : Symbol(r3, Decl(constructSignaturesWithOverloads.ts, 24, 3)) +>i : Symbol(i, Decl(constructSignaturesWithOverloads.ts, 23, 3)) + +interface I2 { +>I2 : Symbol(I2, Decl(constructSignaturesWithOverloads.ts, 24, 22)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 26, 13)) + + new (x: T, y?: string): C2; +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 27, 9)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 26, 13)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 27, 14)) +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 26, 13)) + + new (x: T, y: string): C2; +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 28, 9)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 26, 13)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 28, 14)) +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 26, 13)) + + new (x: T, y?: string): C2; +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 29, 9)) +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 29, 12)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 29, 9)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 29, 17)) +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 29, 9)) + + new (x: T, y: string): C2; +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 30, 9)) +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 30, 12)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 30, 9)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 30, 17)) +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 30, 9)) + +} + +var i2: I2; +>i2 : Symbol(i2, Decl(constructSignaturesWithOverloads.ts, 34, 3)) +>I2 : Symbol(I2, Decl(constructSignaturesWithOverloads.ts, 24, 22)) + +var r4 = new i2(1, ''); +>r4 : Symbol(r4, Decl(constructSignaturesWithOverloads.ts, 35, 3)) +>i2 : Symbol(i2, Decl(constructSignaturesWithOverloads.ts, 34, 3)) + +var a: { +>a : Symbol(a, Decl(constructSignaturesWithOverloads.ts, 37, 3)) + + new(x: number, y?: string): C; +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 38, 8)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 38, 18)) +>C : Symbol(C, Decl(constructSignaturesWithOverloads.ts, 0, 0)) + + new(x: number, y: string): C; +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 39, 8)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 39, 18)) +>C : Symbol(C, Decl(constructSignaturesWithOverloads.ts, 0, 0)) +} + +var r5 = new a(1, ''); +>r5 : Symbol(r5, Decl(constructSignaturesWithOverloads.ts, 42, 3)) +>a : Symbol(a, Decl(constructSignaturesWithOverloads.ts, 37, 3)) + +var b: { +>b : Symbol(b, Decl(constructSignaturesWithOverloads.ts, 44, 3)) + + new(x: T, y?: string): C2; +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 45, 8)) +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 45, 11)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 45, 8)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 45, 16)) +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 45, 8)) + + new(x: T, y: string): C2; +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 46, 8)) +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 46, 11)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 46, 8)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 46, 16)) +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 46, 8)) +} + +var r6 = new b(1, ''); +>r6 : Symbol(r6, Decl(constructSignaturesWithOverloads.ts, 49, 3)) +>b : Symbol(b, Decl(constructSignaturesWithOverloads.ts, 44, 3)) + diff --git a/tests/baselines/reference/constructSignaturesWithOverloads.types b/tests/baselines/reference/constructSignaturesWithOverloads.types index 0cd9b744ee7..8ff678c5de8 100644 --- a/tests/baselines/reference/constructSignaturesWithOverloads.types +++ b/tests/baselines/reference/constructSignaturesWithOverloads.types @@ -20,6 +20,8 @@ var r1 = new C(1, ''); >r1 : C >new C(1, '') : C >C : typeof C +>1 : number +>'' : string class C2 { >C2 : C2 @@ -44,6 +46,8 @@ var r2 = new C2(1, ''); >r2 : C2 >new C2(1, '') : C2 >C2 : typeof C2 +>1 : number +>'' : string interface I { >I : I @@ -67,6 +71,8 @@ var r3 = new i(1, ''); >r3 : C >new i(1, '') : C >i : I +>1 : number +>'' : string interface I2 { >I2 : I2 @@ -112,6 +118,8 @@ var r4 = new i2(1, ''); >r4 : C2 >new i2(1, '') : C2 >i2 : I2 +>1 : number +>'' : string var a: { >a : { new (x: number, y?: string): C; new (x: number, y: string): C; } @@ -131,6 +139,8 @@ var r5 = new a(1, ''); >r5 : C >new a(1, '') : C >a : { new (x: number, y?: string): C; new (x: number, y: string): C; } +>1 : number +>'' : string var b: { >b : { new (x: T, y?: string): C2; new (x: T, y: string): C2; } @@ -156,4 +166,6 @@ var r6 = new b(1, ''); >r6 : C2 >new b(1, '') : C2 >b : { new (x: T, y?: string): C2; new (x: T, y: string): C2; } +>1 : number +>'' : string diff --git a/tests/baselines/reference/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.symbols b/tests/baselines/reference/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.symbols new file mode 100644 index 00000000000..c231d9457c4 --- /dev/null +++ b/tests/baselines/reference/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.symbols @@ -0,0 +1,99 @@ +=== tests/cases/conformance/types/objectTypeLiteral/constructSignatures/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts === +// Error for construct signature overloads to differ only by return type + +class C { +>C : Symbol(C, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 0, 0)) + + constructor(x: number) { } +>x : Symbol(x, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 3, 16)) +} + +class C2 { +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 4, 1)) +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 6, 9)) + + constructor(x: T, y?: string) { } +>x : Symbol(x, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 7, 16)) +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 6, 9)) +>y : Symbol(y, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 7, 21)) +} + +interface I { +>I : Symbol(I, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 8, 1)) + + new(x: number, y: string): C; +>x : Symbol(x, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 11, 8)) +>y : Symbol(y, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 11, 18)) +>C : Symbol(C, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 0, 0)) + + new(x: number, y: string): C2; // error +>x : Symbol(x, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 12, 8)) +>y : Symbol(y, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 12, 18)) +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 4, 1)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 13, 1)) +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 15, 13)) + + new (x: T, y: string): C2; +>x : Symbol(x, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 16, 9)) +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 15, 13)) +>y : Symbol(y, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 16, 14)) +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 4, 1)) + + new (x: T, y: string): C; // error +>x : Symbol(x, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 17, 9)) +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 15, 13)) +>y : Symbol(y, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 17, 14)) +>C : Symbol(C, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 0, 0)) + + new (x: T, y: string): C2; +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 18, 9)) +>x : Symbol(x, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 18, 12)) +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 18, 9)) +>y : Symbol(y, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 18, 17)) +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 4, 1)) +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 18, 9)) + + new (x: T, y: string): C; // error +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 19, 9)) +>x : Symbol(x, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 19, 12)) +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 19, 9)) +>y : Symbol(y, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 19, 17)) +>C : Symbol(C, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 0, 0)) + +} + +var a: { +>a : Symbol(a, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 23, 3)) + + new (x: number, y: string): C2; +>x : Symbol(x, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 24, 9)) +>y : Symbol(y, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 24, 19)) +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 4, 1)) + + new (x: number, y: string): C; // error +>x : Symbol(x, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 25, 9)) +>y : Symbol(y, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 25, 19)) +>C : Symbol(C, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 0, 0)) +} + +var b: { +>b : Symbol(b, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 28, 3)) + + new (x: T, y: string): C2; +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 29, 9)) +>x : Symbol(x, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 29, 12)) +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 29, 9)) +>y : Symbol(y, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 29, 17)) +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 4, 1)) +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 29, 9)) + + new (x: T, y: string): C; // error +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 30, 9)) +>x : Symbol(x, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 30, 12)) +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 30, 9)) +>y : Symbol(y, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 30, 17)) +>C : Symbol(C, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 0, 0)) +} diff --git a/tests/baselines/reference/constructorArgWithGenericCallSignature.symbols b/tests/baselines/reference/constructorArgWithGenericCallSignature.symbols new file mode 100644 index 00000000000..ffb166e6681 --- /dev/null +++ b/tests/baselines/reference/constructorArgWithGenericCallSignature.symbols @@ -0,0 +1,44 @@ +=== tests/cases/compiler/constructorArgWithGenericCallSignature.ts === +module Test { +>Test : Symbol(Test, Decl(constructorArgWithGenericCallSignature.ts, 0, 0)) + + export interface MyFunc { +>MyFunc : Symbol(MyFunc, Decl(constructorArgWithGenericCallSignature.ts, 0, 13)) + + (value1: T): T; +>T : Symbol(T, Decl(constructorArgWithGenericCallSignature.ts, 2, 9)) +>value1 : Symbol(value1, Decl(constructorArgWithGenericCallSignature.ts, 2, 12)) +>T : Symbol(T, Decl(constructorArgWithGenericCallSignature.ts, 2, 9)) +>T : Symbol(T, Decl(constructorArgWithGenericCallSignature.ts, 2, 9)) + } + export class MyClass { +>MyClass : Symbol(MyClass, Decl(constructorArgWithGenericCallSignature.ts, 3, 5)) + + constructor(func: MyFunc) { } +>func : Symbol(func, Decl(constructorArgWithGenericCallSignature.ts, 5, 20)) +>MyFunc : Symbol(MyFunc, Decl(constructorArgWithGenericCallSignature.ts, 0, 13)) + } + + export function F(func: MyFunc) { } +>F : Symbol(F, Decl(constructorArgWithGenericCallSignature.ts, 6, 5)) +>func : Symbol(func, Decl(constructorArgWithGenericCallSignature.ts, 8, 19)) +>MyFunc : Symbol(MyFunc, Decl(constructorArgWithGenericCallSignature.ts, 0, 13)) +} +var func: Test.MyFunc; +>func : Symbol(func, Decl(constructorArgWithGenericCallSignature.ts, 10, 3)) +>Test : Symbol(Test, Decl(constructorArgWithGenericCallSignature.ts, 0, 0)) +>MyFunc : Symbol(Test.MyFunc, Decl(constructorArgWithGenericCallSignature.ts, 0, 13)) + +Test.F(func); // OK +>Test.F : Symbol(Test.F, Decl(constructorArgWithGenericCallSignature.ts, 6, 5)) +>Test : Symbol(Test, Decl(constructorArgWithGenericCallSignature.ts, 0, 0)) +>F : Symbol(Test.F, Decl(constructorArgWithGenericCallSignature.ts, 6, 5)) +>func : Symbol(func, Decl(constructorArgWithGenericCallSignature.ts, 10, 3)) + +var test = new Test.MyClass(func); // Should be OK +>test : Symbol(test, Decl(constructorArgWithGenericCallSignature.ts, 12, 3)) +>Test.MyClass : Symbol(Test.MyClass, Decl(constructorArgWithGenericCallSignature.ts, 3, 5)) +>Test : Symbol(Test, Decl(constructorArgWithGenericCallSignature.ts, 0, 0)) +>MyClass : Symbol(Test.MyClass, Decl(constructorArgWithGenericCallSignature.ts, 3, 5)) +>func : Symbol(func, Decl(constructorArgWithGenericCallSignature.ts, 10, 3)) + diff --git a/tests/baselines/reference/constructorArgWithGenericCallSignature.types b/tests/baselines/reference/constructorArgWithGenericCallSignature.types index a419f3a3427..5899ffe186a 100644 --- a/tests/baselines/reference/constructorArgWithGenericCallSignature.types +++ b/tests/baselines/reference/constructorArgWithGenericCallSignature.types @@ -26,7 +26,7 @@ module Test { } var func: Test.MyFunc; >func : Test.MyFunc ->Test : unknown +>Test : any >MyFunc : Test.MyFunc Test.F(func); // OK diff --git a/tests/baselines/reference/constructorArgs.symbols b/tests/baselines/reference/constructorArgs.symbols new file mode 100644 index 00000000000..083a094a4cd --- /dev/null +++ b/tests/baselines/reference/constructorArgs.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/constructorArgs.ts === +interface Options { +>Options : Symbol(Options, Decl(constructorArgs.ts, 0, 0)) + + value: number; +>value : Symbol(value, Decl(constructorArgs.ts, 0, 19)) +} + +class Super { +>Super : Symbol(Super, Decl(constructorArgs.ts, 2, 1)) + + constructor(value:number) { +>value : Symbol(value, Decl(constructorArgs.ts, 5, 13)) + } +} + +class Sub extends Super { +>Sub : Symbol(Sub, Decl(constructorArgs.ts, 7, 1)) +>Super : Symbol(Super, Decl(constructorArgs.ts, 2, 1)) + + constructor(public options:Options) { +>options : Symbol(options, Decl(constructorArgs.ts, 10, 13)) +>Options : Symbol(Options, Decl(constructorArgs.ts, 0, 0)) + + super(options.value); +>super : Symbol(Super, Decl(constructorArgs.ts, 2, 1)) +>options.value : Symbol(Options.value, Decl(constructorArgs.ts, 0, 19)) +>options : Symbol(options, Decl(constructorArgs.ts, 10, 13)) +>value : Symbol(Options.value, Decl(constructorArgs.ts, 0, 19)) + } +} + diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.symbols b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.symbols new file mode 100644 index 00000000000..8ca8fb6a5d8 --- /dev/null +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.symbols @@ -0,0 +1,38 @@ +=== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/constructorFunctionTypeIsAssignableToBaseType.ts === +class Base { +>Base : Symbol(Base, Decl(constructorFunctionTypeIsAssignableToBaseType.ts, 0, 0)) + + static foo: { +>foo : Symbol(Base.foo, Decl(constructorFunctionTypeIsAssignableToBaseType.ts, 0, 12)) + + bar: Object; +>bar : Symbol(bar, Decl(constructorFunctionTypeIsAssignableToBaseType.ts, 1, 17)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + } +} + +class Derived extends Base { +>Derived : Symbol(Derived, Decl(constructorFunctionTypeIsAssignableToBaseType.ts, 4, 1)) +>Base : Symbol(Base, Decl(constructorFunctionTypeIsAssignableToBaseType.ts, 0, 0)) + + // ok + static foo: { +>foo : Symbol(Derived.foo, Decl(constructorFunctionTypeIsAssignableToBaseType.ts, 6, 28)) + + bar: number; +>bar : Symbol(bar, Decl(constructorFunctionTypeIsAssignableToBaseType.ts, 8, 17)) + } +} + +class Derived2 extends Base { +>Derived2 : Symbol(Derived2, Decl(constructorFunctionTypeIsAssignableToBaseType.ts, 11, 1)) +>Base : Symbol(Base, Decl(constructorFunctionTypeIsAssignableToBaseType.ts, 0, 0)) + + // ok, use assignability here + static foo: { +>foo : Symbol(Derived2.foo, Decl(constructorFunctionTypeIsAssignableToBaseType.ts, 13, 29)) + + bar: any; +>bar : Symbol(bar, Decl(constructorFunctionTypeIsAssignableToBaseType.ts, 15, 17)) + } +} diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.symbols b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.symbols new file mode 100644 index 00000000000..e915b6e705d --- /dev/null +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.symbols @@ -0,0 +1,62 @@ +=== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/constructorFunctionTypeIsAssignableToBaseType2.ts === +// the constructor function itself does not need to be a subtype of the base type constructor function + +class Base { +>Base : Symbol(Base, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 0, 0)) + + static foo: { +>foo : Symbol(Base.foo, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 2, 12)) + + bar: Object; +>bar : Symbol(bar, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 3, 17)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + } + constructor(x: Object) { +>x : Symbol(x, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 6, 16)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + } +} + +class Derived extends Base { +>Derived : Symbol(Derived, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 8, 1)) +>Base : Symbol(Base, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 0, 0)) + + // ok + static foo: { +>foo : Symbol(Derived.foo, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 10, 28)) + + bar: number; +>bar : Symbol(bar, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 12, 17)) + } + + constructor(x: number) { +>x : Symbol(x, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 16, 16)) + + super(x); +>super : Symbol(Base, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 0, 0)) +>x : Symbol(x, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 16, 16)) + } +} + +class Derived2 extends Base { +>Derived2 : Symbol(Derived2, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 19, 1)) +>Base : Symbol(Base, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 0, 0)) + + static foo: { +>foo : Symbol(Derived2.foo, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 21, 29)) + + bar: number; +>bar : Symbol(bar, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 22, 17)) + } + + // ok, not enforcing assignability relation on this + constructor(x: any) { +>x : Symbol(x, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 27, 16)) + + super(x); +>super : Symbol(Base, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 0, 0)) +>x : Symbol(x, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 27, 16)) + + return 1; + } +} diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.types b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.types index 53853163827..e0e86df4a26 100644 --- a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.types +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.types @@ -60,5 +60,6 @@ class Derived2 extends Base { >x : any return 1; +>1 : number } } diff --git a/tests/baselines/reference/constructorHasPrototypeProperty.symbols b/tests/baselines/reference/constructorHasPrototypeProperty.symbols new file mode 100644 index 00000000000..0a90834ac51 --- /dev/null +++ b/tests/baselines/reference/constructorHasPrototypeProperty.symbols @@ -0,0 +1,100 @@ +=== tests/cases/conformance/classes/members/constructorFunctionTypes/constructorHasPrototypeProperty.ts === +module NonGeneric { +>NonGeneric : Symbol(NonGeneric, Decl(constructorHasPrototypeProperty.ts, 0, 0)) + + class C { +>C : Symbol(C, Decl(constructorHasPrototypeProperty.ts, 0, 19)) + + foo: string; +>foo : Symbol(foo, Decl(constructorHasPrototypeProperty.ts, 1, 13)) + } + + class D extends C { +>D : Symbol(D, Decl(constructorHasPrototypeProperty.ts, 3, 5)) +>C : Symbol(C, Decl(constructorHasPrototypeProperty.ts, 0, 19)) + + bar: string; +>bar : Symbol(bar, Decl(constructorHasPrototypeProperty.ts, 5, 23)) + } + + var r = C.prototype; +>r : Symbol(r, Decl(constructorHasPrototypeProperty.ts, 9, 7)) +>C.prototype : Symbol(C.prototype) +>C : Symbol(C, Decl(constructorHasPrototypeProperty.ts, 0, 19)) +>prototype : Symbol(C.prototype) + + r.foo; +>r.foo : Symbol(C.foo, Decl(constructorHasPrototypeProperty.ts, 1, 13)) +>r : Symbol(r, Decl(constructorHasPrototypeProperty.ts, 9, 7)) +>foo : Symbol(C.foo, Decl(constructorHasPrototypeProperty.ts, 1, 13)) + + var r2 = D.prototype; +>r2 : Symbol(r2, Decl(constructorHasPrototypeProperty.ts, 11, 7)) +>D.prototype : Symbol(D.prototype) +>D : Symbol(D, Decl(constructorHasPrototypeProperty.ts, 3, 5)) +>prototype : Symbol(D.prototype) + + r2.bar; +>r2.bar : Symbol(D.bar, Decl(constructorHasPrototypeProperty.ts, 5, 23)) +>r2 : Symbol(r2, Decl(constructorHasPrototypeProperty.ts, 11, 7)) +>bar : Symbol(D.bar, Decl(constructorHasPrototypeProperty.ts, 5, 23)) +} + +module Generic { +>Generic : Symbol(Generic, Decl(constructorHasPrototypeProperty.ts, 13, 1)) + + class C { +>C : Symbol(C, Decl(constructorHasPrototypeProperty.ts, 15, 16)) +>T : Symbol(T, Decl(constructorHasPrototypeProperty.ts, 16, 12)) +>U : Symbol(U, Decl(constructorHasPrototypeProperty.ts, 16, 14)) + + foo: T; +>foo : Symbol(foo, Decl(constructorHasPrototypeProperty.ts, 16, 18)) +>T : Symbol(T, Decl(constructorHasPrototypeProperty.ts, 16, 12)) + + bar: U; +>bar : Symbol(bar, Decl(constructorHasPrototypeProperty.ts, 17, 15)) +>U : Symbol(U, Decl(constructorHasPrototypeProperty.ts, 16, 14)) + } + + class D extends C { +>D : Symbol(D, Decl(constructorHasPrototypeProperty.ts, 19, 5)) +>T : Symbol(T, Decl(constructorHasPrototypeProperty.ts, 21, 12)) +>U : Symbol(U, Decl(constructorHasPrototypeProperty.ts, 21, 14)) +>C : Symbol(C, Decl(constructorHasPrototypeProperty.ts, 15, 16)) +>T : Symbol(T, Decl(constructorHasPrototypeProperty.ts, 21, 12)) +>U : Symbol(U, Decl(constructorHasPrototypeProperty.ts, 21, 14)) + + baz: T; +>baz : Symbol(baz, Decl(constructorHasPrototypeProperty.ts, 21, 33)) +>T : Symbol(T, Decl(constructorHasPrototypeProperty.ts, 21, 12)) + + bing: U; +>bing : Symbol(bing, Decl(constructorHasPrototypeProperty.ts, 22, 15)) +>U : Symbol(U, Decl(constructorHasPrototypeProperty.ts, 21, 14)) + } + + var r = C.prototype; // C +>r : Symbol(r, Decl(constructorHasPrototypeProperty.ts, 26, 7)) +>C.prototype : Symbol(C.prototype) +>C : Symbol(C, Decl(constructorHasPrototypeProperty.ts, 15, 16)) +>prototype : Symbol(C.prototype) + + var ra = r.foo; // any +>ra : Symbol(ra, Decl(constructorHasPrototypeProperty.ts, 27, 7)) +>r.foo : Symbol(C.foo, Decl(constructorHasPrototypeProperty.ts, 16, 18)) +>r : Symbol(r, Decl(constructorHasPrototypeProperty.ts, 26, 7)) +>foo : Symbol(C.foo, Decl(constructorHasPrototypeProperty.ts, 16, 18)) + + var r2 = D.prototype; // D +>r2 : Symbol(r2, Decl(constructorHasPrototypeProperty.ts, 28, 7)) +>D.prototype : Symbol(D.prototype) +>D : Symbol(D, Decl(constructorHasPrototypeProperty.ts, 19, 5)) +>prototype : Symbol(D.prototype) + + var rb = r2.baz; // any +>rb : Symbol(rb, Decl(constructorHasPrototypeProperty.ts, 29, 7)) +>r2.baz : Symbol(D.baz, Decl(constructorHasPrototypeProperty.ts, 21, 33)) +>r2 : Symbol(r2, Decl(constructorHasPrototypeProperty.ts, 28, 7)) +>baz : Symbol(D.baz, Decl(constructorHasPrototypeProperty.ts, 21, 33)) +} diff --git a/tests/baselines/reference/constructorImplementationWithDefaultValues.symbols b/tests/baselines/reference/constructorImplementationWithDefaultValues.symbols new file mode 100644 index 00000000000..384aa692da6 --- /dev/null +++ b/tests/baselines/reference/constructorImplementationWithDefaultValues.symbols @@ -0,0 +1,50 @@ +=== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues.ts === +class C { +>C : Symbol(C, Decl(constructorImplementationWithDefaultValues.ts, 0, 0)) + + constructor(x); +>x : Symbol(x, Decl(constructorImplementationWithDefaultValues.ts, 1, 16)) + + constructor(x = 1) { +>x : Symbol(x, Decl(constructorImplementationWithDefaultValues.ts, 2, 16)) + + var y = x; +>y : Symbol(y, Decl(constructorImplementationWithDefaultValues.ts, 3, 11)) +>x : Symbol(x, Decl(constructorImplementationWithDefaultValues.ts, 2, 16)) + } +} + +class D { +>D : Symbol(D, Decl(constructorImplementationWithDefaultValues.ts, 5, 1)) +>T : Symbol(T, Decl(constructorImplementationWithDefaultValues.ts, 7, 8)) + + constructor(x); +>x : Symbol(x, Decl(constructorImplementationWithDefaultValues.ts, 8, 16)) + + constructor(x:T = null) { +>x : Symbol(x, Decl(constructorImplementationWithDefaultValues.ts, 9, 16)) +>T : Symbol(T, Decl(constructorImplementationWithDefaultValues.ts, 7, 8)) + + var y = x; +>y : Symbol(y, Decl(constructorImplementationWithDefaultValues.ts, 10, 11)) +>x : Symbol(x, Decl(constructorImplementationWithDefaultValues.ts, 9, 16)) + } +} + +class E { +>E : Symbol(E, Decl(constructorImplementationWithDefaultValues.ts, 12, 1)) +>T : Symbol(T, Decl(constructorImplementationWithDefaultValues.ts, 14, 8)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + constructor(x); +>x : Symbol(x, Decl(constructorImplementationWithDefaultValues.ts, 15, 16)) + + constructor(x: T = null) { +>x : Symbol(x, Decl(constructorImplementationWithDefaultValues.ts, 16, 16)) +>T : Symbol(T, Decl(constructorImplementationWithDefaultValues.ts, 14, 8)) + + var y = x; +>y : Symbol(y, Decl(constructorImplementationWithDefaultValues.ts, 17, 11)) +>x : Symbol(x, Decl(constructorImplementationWithDefaultValues.ts, 16, 16)) + } +} diff --git a/tests/baselines/reference/constructorImplementationWithDefaultValues.types b/tests/baselines/reference/constructorImplementationWithDefaultValues.types index 6dc2b4f285b..fa99cc17fe0 100644 --- a/tests/baselines/reference/constructorImplementationWithDefaultValues.types +++ b/tests/baselines/reference/constructorImplementationWithDefaultValues.types @@ -7,6 +7,7 @@ class C { constructor(x = 1) { >x : number +>1 : number var y = x; >y : number @@ -24,6 +25,7 @@ class D { constructor(x:T = null) { >x : T >T : T +>null : null var y = x; >y : T @@ -42,6 +44,7 @@ class E { constructor(x: T = null) { >x : T >T : T +>null : null var y = x; >y : T diff --git a/tests/baselines/reference/constructorOverloads2.symbols b/tests/baselines/reference/constructorOverloads2.symbols new file mode 100644 index 00000000000..b2b9db6eda3 --- /dev/null +++ b/tests/baselines/reference/constructorOverloads2.symbols @@ -0,0 +1,67 @@ +=== tests/cases/compiler/constructorOverloads2.ts === +class FooBase { +>FooBase : Symbol(FooBase, Decl(constructorOverloads2.ts, 0, 0)) + + constructor(s: string); +>s : Symbol(s, Decl(constructorOverloads2.ts, 1, 16)) + + constructor(n: number); +>n : Symbol(n, Decl(constructorOverloads2.ts, 2, 16)) + + constructor(x: any) { +>x : Symbol(x, Decl(constructorOverloads2.ts, 3, 16)) + } + bar1() { /*WScript.Echo("base bar1");*/ } +>bar1 : Symbol(bar1, Decl(constructorOverloads2.ts, 4, 5)) +} + +class Foo extends FooBase { +>Foo : Symbol(Foo, Decl(constructorOverloads2.ts, 6, 1)) +>FooBase : Symbol(FooBase, Decl(constructorOverloads2.ts, 0, 0)) + + constructor(s: string); +>s : Symbol(s, Decl(constructorOverloads2.ts, 9, 16)) + + constructor(n: number); +>n : Symbol(n, Decl(constructorOverloads2.ts, 10, 16)) + + constructor(a:any); +>a : Symbol(a, Decl(constructorOverloads2.ts, 11, 16)) + + constructor(x: any, y?: any) { +>x : Symbol(x, Decl(constructorOverloads2.ts, 12, 16)) +>y : Symbol(y, Decl(constructorOverloads2.ts, 12, 23)) + + super(x); +>super : Symbol(FooBase, Decl(constructorOverloads2.ts, 0, 0)) +>x : Symbol(x, Decl(constructorOverloads2.ts, 12, 16)) + } + bar1() { /*WScript.Echo("bar1");*/ } +>bar1 : Symbol(bar1, Decl(constructorOverloads2.ts, 14, 5)) +} + +var f1 = new Foo("hey"); +>f1 : Symbol(f1, Decl(constructorOverloads2.ts, 18, 3)) +>Foo : Symbol(Foo, Decl(constructorOverloads2.ts, 6, 1)) + +var f2 = new Foo(0); +>f2 : Symbol(f2, Decl(constructorOverloads2.ts, 19, 3)) +>Foo : Symbol(Foo, Decl(constructorOverloads2.ts, 6, 1)) + +var f3 = new Foo(f1); +>f3 : Symbol(f3, Decl(constructorOverloads2.ts, 20, 3)) +>Foo : Symbol(Foo, Decl(constructorOverloads2.ts, 6, 1)) +>f1 : Symbol(f1, Decl(constructorOverloads2.ts, 18, 3)) + +var f4 = new Foo([f1,f2,f3]); +>f4 : Symbol(f4, Decl(constructorOverloads2.ts, 21, 3)) +>Foo : Symbol(Foo, Decl(constructorOverloads2.ts, 6, 1)) +>f1 : Symbol(f1, Decl(constructorOverloads2.ts, 18, 3)) +>f2 : Symbol(f2, Decl(constructorOverloads2.ts, 19, 3)) +>f3 : Symbol(f3, Decl(constructorOverloads2.ts, 20, 3)) + +f1.bar1(); +>f1.bar1 : Symbol(Foo.bar1, Decl(constructorOverloads2.ts, 14, 5)) +>f1 : Symbol(f1, Decl(constructorOverloads2.ts, 18, 3)) +>bar1 : Symbol(Foo.bar1, Decl(constructorOverloads2.ts, 14, 5)) + diff --git a/tests/baselines/reference/constructorOverloads2.types b/tests/baselines/reference/constructorOverloads2.types index 65da67f04fe..dde032c0fd2 100644 --- a/tests/baselines/reference/constructorOverloads2.types +++ b/tests/baselines/reference/constructorOverloads2.types @@ -45,11 +45,13 @@ var f1 = new Foo("hey"); >f1 : Foo >new Foo("hey") : Foo >Foo : typeof Foo +>"hey" : string var f2 = new Foo(0); >f2 : Foo >new Foo(0) : Foo >Foo : typeof Foo +>0 : number var f3 = new Foo(f1); >f3 : Foo diff --git a/tests/baselines/reference/constructorOverloadsWithOptionalParameters.symbols b/tests/baselines/reference/constructorOverloadsWithOptionalParameters.symbols new file mode 100644 index 00000000000..68cecd8f912 --- /dev/null +++ b/tests/baselines/reference/constructorOverloadsWithOptionalParameters.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorOverloadsWithOptionalParameters.ts === +class C { +>C : Symbol(C, Decl(constructorOverloadsWithOptionalParameters.ts, 0, 0)) + + foo: string; +>foo : Symbol(foo, Decl(constructorOverloadsWithOptionalParameters.ts, 0, 9)) + + constructor(x?, y?: any[]); +>x : Symbol(x, Decl(constructorOverloadsWithOptionalParameters.ts, 2, 16)) +>y : Symbol(y, Decl(constructorOverloadsWithOptionalParameters.ts, 2, 19)) + + constructor() { + } +} + +class D { +>D : Symbol(D, Decl(constructorOverloadsWithOptionalParameters.ts, 5, 1)) +>T : Symbol(T, Decl(constructorOverloadsWithOptionalParameters.ts, 7, 8)) + + foo: string; +>foo : Symbol(foo, Decl(constructorOverloadsWithOptionalParameters.ts, 7, 12)) + + constructor(x?, y?: any[]); +>x : Symbol(x, Decl(constructorOverloadsWithOptionalParameters.ts, 9, 16)) +>y : Symbol(y, Decl(constructorOverloadsWithOptionalParameters.ts, 9, 19)) + + constructor() { + } +} diff --git a/tests/baselines/reference/constructorReturningAPrimitive.symbols b/tests/baselines/reference/constructorReturningAPrimitive.symbols new file mode 100644 index 00000000000..6206b6d87b8 --- /dev/null +++ b/tests/baselines/reference/constructorReturningAPrimitive.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/constructorReturningAPrimitive.ts === +// technically not allowed by JavaScript but we don't have a 'not-primitive' constraint +// functionally only possible when your class is otherwise devoid of members so of little consequence in practice + +class A { +>A : Symbol(A, Decl(constructorReturningAPrimitive.ts, 0, 0)) + + constructor() { + return 1; + } +} + +var a = new A(); +>a : Symbol(a, Decl(constructorReturningAPrimitive.ts, 9, 3)) +>A : Symbol(A, Decl(constructorReturningAPrimitive.ts, 0, 0)) + +class B { +>B : Symbol(B, Decl(constructorReturningAPrimitive.ts, 9, 16)) +>T : Symbol(T, Decl(constructorReturningAPrimitive.ts, 11, 8)) + + constructor() { + var x: T; +>x : Symbol(x, Decl(constructorReturningAPrimitive.ts, 13, 11)) +>T : Symbol(T, Decl(constructorReturningAPrimitive.ts, 11, 8)) + + return x; +>x : Symbol(x, Decl(constructorReturningAPrimitive.ts, 13, 11)) + } +} + +var b = new B(); +>b : Symbol(b, Decl(constructorReturningAPrimitive.ts, 18, 3)) +>B : Symbol(B, Decl(constructorReturningAPrimitive.ts, 9, 16)) + diff --git a/tests/baselines/reference/constructorReturningAPrimitive.types b/tests/baselines/reference/constructorReturningAPrimitive.types index c4ca2ba7078..4b431cfb36b 100644 --- a/tests/baselines/reference/constructorReturningAPrimitive.types +++ b/tests/baselines/reference/constructorReturningAPrimitive.types @@ -7,6 +7,7 @@ class A { constructor() { return 1; +>1 : number } } diff --git a/tests/baselines/reference/constructorStaticParamName.errors.txt b/tests/baselines/reference/constructorStaticParamName.errors.txt index ac50edd22f1..bd5012d00c1 100644 --- a/tests/baselines/reference/constructorStaticParamName.errors.txt +++ b/tests/baselines/reference/constructorStaticParamName.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/constructorStaticParamName.ts(4,18): error TS1003: Identifier expected. +tests/cases/compiler/constructorStaticParamName.ts(4,18): error TS1213: Identifier expected. 'static' is a reserved word in strict mode. Class definitions are automatically in strict mode. ==== tests/cases/compiler/constructorStaticParamName.ts (1 errors) ==== @@ -7,6 +7,6 @@ tests/cases/compiler/constructorStaticParamName.ts(4,18): error TS1003: Identifi class test { constructor (static) { } ~~~~~~ -!!! error TS1003: Identifier expected. +!!! error TS1213: Identifier expected. 'static' is a reserved word in strict mode. Class definitions are automatically in strict mode. } \ No newline at end of file diff --git a/tests/baselines/reference/constructorStaticParamName.js b/tests/baselines/reference/constructorStaticParamName.js index 85b22867442..cf74aed2ebc 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() { + function test(static) { } return test; })(); diff --git a/tests/baselines/reference/constructorStaticParamNameErrors.errors.txt b/tests/baselines/reference/constructorStaticParamNameErrors.errors.txt index 4739f54397c..847bb575a98 100644 --- a/tests/baselines/reference/constructorStaticParamNameErrors.errors.txt +++ b/tests/baselines/reference/constructorStaticParamNameErrors.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/constructorStaticParamNameErrors.ts(4,18): error TS1003: Identifier expected. +tests/cases/compiler/constructorStaticParamNameErrors.ts(4,18): error TS1213: Identifier expected. 'static' is a reserved word in strict mode. Class definitions are automatically in strict mode. ==== tests/cases/compiler/constructorStaticParamNameErrors.ts (1 errors) ==== @@ -7,5 +7,5 @@ tests/cases/compiler/constructorStaticParamNameErrors.ts(4,18): error TS1003: Id class test { constructor (static) { } ~~~~~~ -!!! error TS1003: Identifier expected. +!!! error TS1213: Identifier expected. 'static' is a reserved word in strict mode. Class definitions are automatically in strict mode. } \ No newline at end of file diff --git a/tests/baselines/reference/constructorStaticParamNameErrors.js b/tests/baselines/reference/constructorStaticParamNameErrors.js index 0bb8985545c..43e70a8c3cf 100644 --- a/tests/baselines/reference/constructorStaticParamNameErrors.js +++ b/tests/baselines/reference/constructorStaticParamNameErrors.js @@ -9,7 +9,7 @@ class test { 'use strict'; // static as constructor parameter name should give error if 'use strict' var test = (function () { - function test() { + function test(static) { } return test; })(); diff --git a/tests/baselines/reference/constructorTypeWithTypeParameters.symbols b/tests/baselines/reference/constructorTypeWithTypeParameters.symbols new file mode 100644 index 00000000000..0ea9e854d77 --- /dev/null +++ b/tests/baselines/reference/constructorTypeWithTypeParameters.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/constructorTypeWithTypeParameters.ts === +declare var X: { +>X : Symbol(X, Decl(constructorTypeWithTypeParameters.ts, 0, 11)) + + new (): number; +>T : Symbol(T, Decl(constructorTypeWithTypeParameters.ts, 1, 9)) +} +declare var Y: { +>Y : Symbol(Y, Decl(constructorTypeWithTypeParameters.ts, 3, 11)) + + new (): number; +} +var anotherVar: new () => number; +>anotherVar : Symbol(anotherVar, Decl(constructorTypeWithTypeParameters.ts, 6, 3)) +>T : Symbol(T, Decl(constructorTypeWithTypeParameters.ts, 6, 21)) + diff --git a/tests/baselines/reference/constructorWithExpressionLessReturn.symbols b/tests/baselines/reference/constructorWithExpressionLessReturn.symbols new file mode 100644 index 00000000000..0d6f06a91a4 --- /dev/null +++ b/tests/baselines/reference/constructorWithExpressionLessReturn.symbols @@ -0,0 +1,41 @@ +=== tests/cases/conformance/classes/constructorDeclarations/constructorWithExpressionLessReturn.ts === +class C { +>C : Symbol(C, Decl(constructorWithExpressionLessReturn.ts, 0, 0)) + + constructor() { + return; + } +} + +class D { +>D : Symbol(D, Decl(constructorWithExpressionLessReturn.ts, 4, 1)) + + x: number; +>x : Symbol(x, Decl(constructorWithExpressionLessReturn.ts, 6, 9)) + + constructor() { + return; + } +} + +class E { +>E : Symbol(E, Decl(constructorWithExpressionLessReturn.ts, 11, 1)) + + constructor(public x: number) { +>x : Symbol(x, Decl(constructorWithExpressionLessReturn.ts, 14, 16)) + + return; + } +} + +class F { +>F : Symbol(F, Decl(constructorWithExpressionLessReturn.ts, 17, 1)) +>T : Symbol(T, Decl(constructorWithExpressionLessReturn.ts, 19, 8)) + + constructor(public x: T) { +>x : Symbol(x, Decl(constructorWithExpressionLessReturn.ts, 20, 16)) +>T : Symbol(T, Decl(constructorWithExpressionLessReturn.ts, 19, 8)) + + return; + } +} diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt index 75de7c32ebc..5d607c8f5b2 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt @@ -21,45 +21,23 @@ 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 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(108,24): error TS2365: Operator '+' cannot be applied to types 'number' and 'boolean'. 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(223,23): error TS2304: Cannot find name 'bool'. @@ -69,6 +47,7 @@ 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'. @@ -83,23 +62,27 @@ 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 TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error TS2304: Cannot find name 'string'. 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 (99 errors) ==== +==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (82 errors) ==== declare module "fs" { export class File { constructor(filename: string); @@ -214,8 +197,6 @@ 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 - @@ -255,11 +236,7 @@ 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; @@ -277,23 +254,11 @@ 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 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'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'boolean'. return 0; } - ~ -!!! error TS1128: Declaration or statement expected. /// /// Test different statements. Including if-else,swith,foreach,(un)checked,lock,using,try-catch-finally @@ -301,14 +266,6 @@ 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; @@ -352,14 +309,6 @@ 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; @@ -389,14 +338,6 @@ 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;/*+ - * / % & | ^*/ @@ -435,8 +376,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS } } - ~ -!!! error TS1128: Declaration or statement expected. interface IF { Foo(): bool; @@ -480,6 +419,8 @@ 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; @@ -529,6 +470,8 @@ 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. @@ -538,14 +481,20 @@ 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. ~~~~~~~~~~~~ @@ -555,7 +504,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS ~ !!! error TS1109: Expression expected. ~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! error TS2304: Cannot find name 'string'. ~ !!! error TS1005: ';' expected. } diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js index 4fb940bc9ec..b44d7faa5a6 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js @@ -342,7 +342,6 @@ var TypeScriptAllInOne; })(TypeScriptAllInOne || (TypeScriptAllInOne = {})); var BasicFeatures = (function () { function BasicFeatures() { - this.implements = 0; } /// /// Test various of variables. Including nullable,key world as variable,special format @@ -375,118 +374,120 @@ var BasicFeatures = (function () { var declare = 0; var constructor = 0; var get = 0; - var ; + 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; }; 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 () { ; }; + this.d = function () { yield 0; }; } Object.defineProperty(CLASS.prototype, "Property", { get: function () { return 0; }, diff --git a/tests/baselines/reference/contextualSigInstantiationRestParams.symbols b/tests/baselines/reference/contextualSigInstantiationRestParams.symbols new file mode 100644 index 00000000000..5b18899e5f2 --- /dev/null +++ b/tests/baselines/reference/contextualSigInstantiationRestParams.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/contextualSigInstantiationRestParams.ts === +declare function toInstantiate(a?: A, b?: B): B; +>toInstantiate : Symbol(toInstantiate, Decl(contextualSigInstantiationRestParams.ts, 0, 0)) +>A : Symbol(A, Decl(contextualSigInstantiationRestParams.ts, 0, 31)) +>B : Symbol(B, Decl(contextualSigInstantiationRestParams.ts, 0, 33)) +>a : Symbol(a, Decl(contextualSigInstantiationRestParams.ts, 0, 37)) +>A : Symbol(A, Decl(contextualSigInstantiationRestParams.ts, 0, 31)) +>b : Symbol(b, Decl(contextualSigInstantiationRestParams.ts, 0, 43)) +>B : Symbol(B, Decl(contextualSigInstantiationRestParams.ts, 0, 33)) +>B : Symbol(B, Decl(contextualSigInstantiationRestParams.ts, 0, 33)) + +declare function contextual(...s: string[]): string +>contextual : Symbol(contextual, Decl(contextualSigInstantiationRestParams.ts, 0, 54)) +>s : Symbol(s, Decl(contextualSigInstantiationRestParams.ts, 1, 28)) + +var sig: typeof contextual = toInstantiate; +>sig : Symbol(sig, Decl(contextualSigInstantiationRestParams.ts, 3, 3)) +>contextual : Symbol(contextual, Decl(contextualSigInstantiationRestParams.ts, 0, 54)) +>toInstantiate : Symbol(toInstantiate, Decl(contextualSigInstantiationRestParams.ts, 0, 0)) + diff --git a/tests/baselines/reference/contextualSignatureInstantiation.symbols b/tests/baselines/reference/contextualSignatureInstantiation.symbols new file mode 100644 index 00000000000..c16ffed84b7 --- /dev/null +++ b/tests/baselines/reference/contextualSignatureInstantiation.symbols @@ -0,0 +1,132 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/contextualSignatureInstantiation.ts === +// TypeScript Spec, section 4.12.2: +// If e is an expression of a function type that contains exactly one generic call signature and no other members, +// and T is a function type with exactly one non - generic call signature and no other members, then any inferences +// made for type parameters referenced by the parameters of T's call signature are fixed, and e's type is changed +// to a function type with e's call signature instantiated in the context of T's call signature (section 3.8.5). + +declare function foo(cb: (x: number, y: string) => T): T; +>foo : Symbol(foo, Decl(contextualSignatureInstantiation.ts, 0, 0)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 6, 21)) +>cb : Symbol(cb, Decl(contextualSignatureInstantiation.ts, 6, 24)) +>x : Symbol(x, Decl(contextualSignatureInstantiation.ts, 6, 29)) +>y : Symbol(y, Decl(contextualSignatureInstantiation.ts, 6, 39)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 6, 21)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 6, 21)) + +declare function bar(x: T, y: U, cb: (x: T, y: U) => V): V; +>bar : Symbol(bar, Decl(contextualSignatureInstantiation.ts, 6, 60)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 7, 21)) +>U : Symbol(U, Decl(contextualSignatureInstantiation.ts, 7, 23)) +>V : Symbol(V, Decl(contextualSignatureInstantiation.ts, 7, 26)) +>x : Symbol(x, Decl(contextualSignatureInstantiation.ts, 7, 30)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 7, 21)) +>y : Symbol(y, Decl(contextualSignatureInstantiation.ts, 7, 35)) +>U : Symbol(U, Decl(contextualSignatureInstantiation.ts, 7, 23)) +>cb : Symbol(cb, Decl(contextualSignatureInstantiation.ts, 7, 41)) +>x : Symbol(x, Decl(contextualSignatureInstantiation.ts, 7, 47)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 7, 21)) +>y : Symbol(y, Decl(contextualSignatureInstantiation.ts, 7, 52)) +>U : Symbol(U, Decl(contextualSignatureInstantiation.ts, 7, 23)) +>V : Symbol(V, Decl(contextualSignatureInstantiation.ts, 7, 26)) +>V : Symbol(V, Decl(contextualSignatureInstantiation.ts, 7, 26)) + +declare function baz(x: T, y: T, cb: (x: T, y: T) => U): U; +>baz : Symbol(baz, Decl(contextualSignatureInstantiation.ts, 7, 68)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 8, 21)) +>U : Symbol(U, Decl(contextualSignatureInstantiation.ts, 8, 23)) +>x : Symbol(x, Decl(contextualSignatureInstantiation.ts, 8, 27)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 8, 21)) +>y : Symbol(y, Decl(contextualSignatureInstantiation.ts, 8, 32)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 8, 21)) +>cb : Symbol(cb, Decl(contextualSignatureInstantiation.ts, 8, 38)) +>x : Symbol(x, Decl(contextualSignatureInstantiation.ts, 8, 44)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 8, 21)) +>y : Symbol(y, Decl(contextualSignatureInstantiation.ts, 8, 49)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 8, 21)) +>U : Symbol(U, Decl(contextualSignatureInstantiation.ts, 8, 23)) +>U : Symbol(U, Decl(contextualSignatureInstantiation.ts, 8, 23)) + +declare function g(x: T, y: T): T; +>g : Symbol(g, Decl(contextualSignatureInstantiation.ts, 8, 65)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 10, 19)) +>x : Symbol(x, Decl(contextualSignatureInstantiation.ts, 10, 22)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 10, 19)) +>y : Symbol(y, Decl(contextualSignatureInstantiation.ts, 10, 27)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 10, 19)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 10, 19)) + +declare function h(x: T, y: U): T[] | U[]; +>h : Symbol(h, Decl(contextualSignatureInstantiation.ts, 10, 37)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 11, 19)) +>U : Symbol(U, Decl(contextualSignatureInstantiation.ts, 11, 21)) +>x : Symbol(x, Decl(contextualSignatureInstantiation.ts, 11, 25)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 11, 19)) +>y : Symbol(y, Decl(contextualSignatureInstantiation.ts, 11, 30)) +>U : Symbol(U, Decl(contextualSignatureInstantiation.ts, 11, 21)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 11, 19)) +>U : Symbol(U, Decl(contextualSignatureInstantiation.ts, 11, 21)) + +var a: number; +>a : Symbol(a, Decl(contextualSignatureInstantiation.ts, 13, 3), Decl(contextualSignatureInstantiation.ts, 14, 3), Decl(contextualSignatureInstantiation.ts, 15, 3)) + +var a = bar(1, 1, g); // Should be number +>a : Symbol(a, Decl(contextualSignatureInstantiation.ts, 13, 3), Decl(contextualSignatureInstantiation.ts, 14, 3), Decl(contextualSignatureInstantiation.ts, 15, 3)) +>bar : Symbol(bar, Decl(contextualSignatureInstantiation.ts, 6, 60)) +>g : Symbol(g, Decl(contextualSignatureInstantiation.ts, 8, 65)) + +var a = baz(1, 1, g); // Should be number +>a : Symbol(a, Decl(contextualSignatureInstantiation.ts, 13, 3), Decl(contextualSignatureInstantiation.ts, 14, 3), Decl(contextualSignatureInstantiation.ts, 15, 3)) +>baz : Symbol(baz, Decl(contextualSignatureInstantiation.ts, 7, 68)) +>g : Symbol(g, Decl(contextualSignatureInstantiation.ts, 8, 65)) + +var b: number | string; +>b : Symbol(b, Decl(contextualSignatureInstantiation.ts, 17, 3), Decl(contextualSignatureInstantiation.ts, 18, 3), Decl(contextualSignatureInstantiation.ts, 19, 3), Decl(contextualSignatureInstantiation.ts, 20, 3), Decl(contextualSignatureInstantiation.ts, 21, 3)) + +var b = foo(g); // Should be number | string +>b : Symbol(b, Decl(contextualSignatureInstantiation.ts, 17, 3), Decl(contextualSignatureInstantiation.ts, 18, 3), Decl(contextualSignatureInstantiation.ts, 19, 3), Decl(contextualSignatureInstantiation.ts, 20, 3), Decl(contextualSignatureInstantiation.ts, 21, 3)) +>foo : Symbol(foo, Decl(contextualSignatureInstantiation.ts, 0, 0)) +>g : Symbol(g, Decl(contextualSignatureInstantiation.ts, 8, 65)) + +var b = bar(1, "one", g); // Should be number | string +>b : Symbol(b, Decl(contextualSignatureInstantiation.ts, 17, 3), Decl(contextualSignatureInstantiation.ts, 18, 3), Decl(contextualSignatureInstantiation.ts, 19, 3), Decl(contextualSignatureInstantiation.ts, 20, 3), Decl(contextualSignatureInstantiation.ts, 21, 3)) +>bar : Symbol(bar, Decl(contextualSignatureInstantiation.ts, 6, 60)) +>g : Symbol(g, Decl(contextualSignatureInstantiation.ts, 8, 65)) + +var b = bar("one", 1, g); // Should be number | string +>b : Symbol(b, Decl(contextualSignatureInstantiation.ts, 17, 3), Decl(contextualSignatureInstantiation.ts, 18, 3), Decl(contextualSignatureInstantiation.ts, 19, 3), Decl(contextualSignatureInstantiation.ts, 20, 3), Decl(contextualSignatureInstantiation.ts, 21, 3)) +>bar : Symbol(bar, Decl(contextualSignatureInstantiation.ts, 6, 60)) +>g : Symbol(g, Decl(contextualSignatureInstantiation.ts, 8, 65)) + +var b = baz(b, b, g); // Should be number | string +>b : Symbol(b, Decl(contextualSignatureInstantiation.ts, 17, 3), Decl(contextualSignatureInstantiation.ts, 18, 3), Decl(contextualSignatureInstantiation.ts, 19, 3), Decl(contextualSignatureInstantiation.ts, 20, 3), Decl(contextualSignatureInstantiation.ts, 21, 3)) +>baz : Symbol(baz, Decl(contextualSignatureInstantiation.ts, 7, 68)) +>b : Symbol(b, Decl(contextualSignatureInstantiation.ts, 17, 3), Decl(contextualSignatureInstantiation.ts, 18, 3), Decl(contextualSignatureInstantiation.ts, 19, 3), Decl(contextualSignatureInstantiation.ts, 20, 3), Decl(contextualSignatureInstantiation.ts, 21, 3)) +>b : Symbol(b, Decl(contextualSignatureInstantiation.ts, 17, 3), Decl(contextualSignatureInstantiation.ts, 18, 3), Decl(contextualSignatureInstantiation.ts, 19, 3), Decl(contextualSignatureInstantiation.ts, 20, 3), Decl(contextualSignatureInstantiation.ts, 21, 3)) +>g : Symbol(g, Decl(contextualSignatureInstantiation.ts, 8, 65)) + +var d: number[] | string[]; +>d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 23, 3), Decl(contextualSignatureInstantiation.ts, 24, 3), Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3)) + +var d = foo(h); // Should be number[] | string[] +>d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 23, 3), Decl(contextualSignatureInstantiation.ts, 24, 3), Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3)) +>foo : Symbol(foo, Decl(contextualSignatureInstantiation.ts, 0, 0)) +>h : Symbol(h, Decl(contextualSignatureInstantiation.ts, 10, 37)) + +var d = bar(1, "one", h); // Should be number[] | string[] +>d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 23, 3), Decl(contextualSignatureInstantiation.ts, 24, 3), Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3)) +>bar : Symbol(bar, Decl(contextualSignatureInstantiation.ts, 6, 60)) +>h : Symbol(h, Decl(contextualSignatureInstantiation.ts, 10, 37)) + +var d = bar("one", 1, h); // Should be number[] | string[] +>d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 23, 3), Decl(contextualSignatureInstantiation.ts, 24, 3), Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3)) +>bar : Symbol(bar, Decl(contextualSignatureInstantiation.ts, 6, 60)) +>h : Symbol(h, Decl(contextualSignatureInstantiation.ts, 10, 37)) + +var d = baz(d, d, g); // Should be number[] | string[] +>d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 23, 3), Decl(contextualSignatureInstantiation.ts, 24, 3), Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3)) +>baz : Symbol(baz, Decl(contextualSignatureInstantiation.ts, 7, 68)) +>d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 23, 3), Decl(contextualSignatureInstantiation.ts, 24, 3), Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3)) +>d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 23, 3), Decl(contextualSignatureInstantiation.ts, 24, 3), Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3)) +>g : Symbol(g, Decl(contextualSignatureInstantiation.ts, 8, 65)) + diff --git a/tests/baselines/reference/contextualSignatureInstantiation.types b/tests/baselines/reference/contextualSignatureInstantiation.types index 4363272622a..e7be6da51c5 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation.types +++ b/tests/baselines/reference/contextualSignatureInstantiation.types @@ -74,12 +74,16 @@ var a = bar(1, 1, g); // Should be number >a : number >bar(1, 1, g) : number >bar : (x: T, y: U, cb: (x: T, y: U) => V) => V +>1 : number +>1 : number >g : (x: T, y: T) => T var a = baz(1, 1, g); // Should be number >a : number >baz(1, 1, g) : number >baz : (x: T, y: T, cb: (x: T, y: T) => U) => U +>1 : number +>1 : number >g : (x: T, y: T) => T var b: number | string; @@ -95,12 +99,16 @@ var b = bar(1, "one", g); // Should be number | string >b : string | number >bar(1, "one", g) : string | number >bar : (x: T, y: U, cb: (x: T, y: U) => V) => V +>1 : number +>"one" : string >g : (x: T, y: T) => T var b = bar("one", 1, g); // Should be number | string >b : string | number >bar("one", 1, g) : string | number >bar : (x: T, y: U, cb: (x: T, y: U) => V) => V +>"one" : string +>1 : number >g : (x: T, y: T) => T var b = baz(b, b, g); // Should be number | string @@ -124,12 +132,16 @@ var d = bar(1, "one", h); // Should be number[] | string[] >d : string[] | number[] >bar(1, "one", h) : string[] | number[] >bar : (x: T, y: U, cb: (x: T, y: U) => V) => V +>1 : number +>"one" : string >h : (x: T, y: U) => T[] | U[] var d = bar("one", 1, h); // Should be number[] | string[] >d : string[] | number[] >bar("one", 1, h) : string[] | number[] >bar : (x: T, y: U, cb: (x: T, y: U) => V) => V +>"one" : string +>1 : number >h : (x: T, y: U) => T[] | U[] var d = baz(d, d, g); // Should be number[] | string[] diff --git a/tests/baselines/reference/contextualSignatureInstantiation.types.pull b/tests/baselines/reference/contextualSignatureInstantiation.types.pull deleted file mode 100644 index d7246ab79aa..00000000000 --- a/tests/baselines/reference/contextualSignatureInstantiation.types.pull +++ /dev/null @@ -1,142 +0,0 @@ -=== tests/cases/conformance/types/typeRelationships/typeInference/contextualSignatureInstantiation.ts === -// TypeScript Spec, section 4.12.2: -// If e is an expression of a function type that contains exactly one generic call signature and no other members, -// and T is a function type with exactly one non - generic call signature and no other members, then any inferences -// made for type parameters referenced by the parameters of T's call signature are fixed, and e's type is changed -// to a function type with e's call signature instantiated in the context of T's call signature (section 3.8.5). - -declare function foo(cb: (x: number, y: string) => T): T; ->foo : (cb: (x: number, y: string) => T) => T ->T : T ->cb : (x: number, y: string) => T ->x : number ->y : string ->T : T ->T : T - -declare function bar(x: T, y: U, cb: (x: T, y: U) => V): V; ->bar : (x: T, y: U, cb: (x: T, y: U) => V) => V ->T : T ->U : U ->V : V ->x : T ->T : T ->y : U ->U : U ->cb : (x: T, y: U) => V ->x : T ->T : T ->y : U ->U : U ->V : V ->V : V - -declare function baz(x: T, y: T, cb: (x: T, y: T) => U): U; ->baz : (x: T, y: T, cb: (x: T, y: T) => U) => U ->T : T ->U : U ->x : T ->T : T ->y : T ->T : T ->cb : (x: T, y: T) => U ->x : T ->T : T ->y : T ->T : T ->U : U ->U : U - -declare function g(x: T, y: T): T; ->g : (x: T, y: T) => T ->T : T ->x : T ->T : T ->y : T ->T : T ->T : T - -declare function h(x: T, y: U): T[] | U[]; ->h : (x: T, y: U) => T[] | U[] ->T : T ->U : U ->x : T ->T : T ->y : U ->U : U ->T : T ->U : U - -var a: number; ->a : number - -var a = bar(1, 1, g); // Should be number ->a : number ->bar(1, 1, g) : number ->bar : (x: T, y: U, cb: (x: T, y: U) => V) => V ->g : (x: T, y: T) => T - -var a = baz(1, 1, g); // Should be number ->a : number ->baz(1, 1, g) : number ->baz : (x: T, y: T, cb: (x: T, y: T) => U) => U ->g : (x: T, y: T) => T - -var b: number | string; ->b : string | number - -var b = foo(g); // Should be number | string ->b : string | number ->foo(g) : string | number ->foo : (cb: (x: number, y: string) => T) => T ->g : (x: T, y: T) => T - -var b = bar(1, "one", g); // Should be number | string ->b : string | number ->bar(1, "one", g) : string | number ->bar : (x: T, y: U, cb: (x: T, y: U) => V) => V ->g : (x: T, y: T) => T - -var b = bar("one", 1, g); // Should be number | string ->b : string | number ->bar("one", 1, g) : string | number ->bar : (x: T, y: U, cb: (x: T, y: U) => V) => V ->g : (x: T, y: T) => T - -var b = baz(b, b, g); // Should be number | string ->b : string | number ->baz(b, b, g) : string | number ->baz : (x: T, y: T, cb: (x: T, y: T) => U) => U ->b : string | number ->b : string | number ->g : (x: T, y: T) => T - -var d: number[] | string[]; ->d : number[] | string[] - -var d = foo(h); // Should be number[] | string[] ->d : number[] | string[] ->foo(h) : number[] | string[] ->foo : (cb: (x: number, y: string) => T) => T ->h : (x: T, y: U) => T[] | U[] - -var d = bar(1, "one", h); // Should be number[] | string[] ->d : number[] | string[] ->bar(1, "one", h) : number[] | string[] ->bar : (x: T, y: U, cb: (x: T, y: U) => V) => V ->h : (x: T, y: U) => T[] | U[] - -var d = bar("one", 1, h); // Should be number[] | string[] ->d : number[] | string[] ->bar("one", 1, h) : number[] | string[] ->bar : (x: T, y: U, cb: (x: T, y: U) => V) => V ->h : (x: T, y: U) => T[] | U[] - -var d = baz(d, d, g); // Should be number[] | string[] ->d : number[] | string[] ->baz(d, d, g) : number[] | string[] ->baz : (x: T, y: T, cb: (x: T, y: T) => U) => U ->d : number[] | string[] ->d : number[] | string[] ->g : (x: T, y: T) => T - diff --git a/tests/baselines/reference/contextualSignatureInstantiation1.symbols b/tests/baselines/reference/contextualSignatureInstantiation1.symbols new file mode 100644 index 00000000000..e56e997cffc --- /dev/null +++ b/tests/baselines/reference/contextualSignatureInstantiation1.symbols @@ -0,0 +1,56 @@ +=== tests/cases/compiler/contextualSignatureInstantiation1.ts === +declare function map(f: (x: S) => T): (a: S[]) => T[]; +>map : Symbol(map, Decl(contextualSignatureInstantiation1.ts, 0, 0)) +>S : Symbol(S, Decl(contextualSignatureInstantiation1.ts, 0, 21)) +>T : Symbol(T, Decl(contextualSignatureInstantiation1.ts, 0, 23)) +>f : Symbol(f, Decl(contextualSignatureInstantiation1.ts, 0, 27)) +>x : Symbol(x, Decl(contextualSignatureInstantiation1.ts, 0, 31)) +>S : Symbol(S, Decl(contextualSignatureInstantiation1.ts, 0, 21)) +>T : Symbol(T, Decl(contextualSignatureInstantiation1.ts, 0, 23)) +>a : Symbol(a, Decl(contextualSignatureInstantiation1.ts, 0, 45)) +>S : Symbol(S, Decl(contextualSignatureInstantiation1.ts, 0, 21)) +>T : Symbol(T, Decl(contextualSignatureInstantiation1.ts, 0, 23)) + +var e = (x: string, y?: K) => x.length; +>e : Symbol(e, Decl(contextualSignatureInstantiation1.ts, 1, 3)) +>K : Symbol(K, Decl(contextualSignatureInstantiation1.ts, 1, 9)) +>x : Symbol(x, Decl(contextualSignatureInstantiation1.ts, 1, 12)) +>y : Symbol(y, Decl(contextualSignatureInstantiation1.ts, 1, 22)) +>K : Symbol(K, Decl(contextualSignatureInstantiation1.ts, 1, 9)) +>x.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>x : Symbol(x, Decl(contextualSignatureInstantiation1.ts, 1, 12)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + +var r99 = map(e); // should be {}[] for S since a generic lambda is not inferentially typed +>r99 : Symbol(r99, Decl(contextualSignatureInstantiation1.ts, 2, 3)) +>map : Symbol(map, Decl(contextualSignatureInstantiation1.ts, 0, 0)) +>e : Symbol(e, Decl(contextualSignatureInstantiation1.ts, 1, 3)) + +declare function map2(f: (x: S) => T): (a: S[]) => T[]; +>map2 : Symbol(map2, Decl(contextualSignatureInstantiation1.ts, 2, 17)) +>S : Symbol(S, Decl(contextualSignatureInstantiation1.ts, 4, 22)) +>length : Symbol(length, Decl(contextualSignatureInstantiation1.ts, 4, 33)) +>T : Symbol(T, Decl(contextualSignatureInstantiation1.ts, 4, 51)) +>f : Symbol(f, Decl(contextualSignatureInstantiation1.ts, 4, 55)) +>x : Symbol(x, Decl(contextualSignatureInstantiation1.ts, 4, 59)) +>S : Symbol(S, Decl(contextualSignatureInstantiation1.ts, 4, 22)) +>T : Symbol(T, Decl(contextualSignatureInstantiation1.ts, 4, 51)) +>a : Symbol(a, Decl(contextualSignatureInstantiation1.ts, 4, 73)) +>S : Symbol(S, Decl(contextualSignatureInstantiation1.ts, 4, 22)) +>T : Symbol(T, Decl(contextualSignatureInstantiation1.ts, 4, 51)) + +var e2 = (x: string, y?: K) => x.length; +>e2 : Symbol(e2, Decl(contextualSignatureInstantiation1.ts, 5, 3)) +>K : Symbol(K, Decl(contextualSignatureInstantiation1.ts, 5, 10)) +>x : Symbol(x, Decl(contextualSignatureInstantiation1.ts, 5, 13)) +>y : Symbol(y, Decl(contextualSignatureInstantiation1.ts, 5, 23)) +>K : Symbol(K, Decl(contextualSignatureInstantiation1.ts, 5, 10)) +>x.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>x : Symbol(x, Decl(contextualSignatureInstantiation1.ts, 5, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + +var r100 = map2(e2); // type arg inference should fail for S since a generic lambda is not inferentially typed. Falls back to { length: number } +>r100 : Symbol(r100, Decl(contextualSignatureInstantiation1.ts, 6, 3)) +>map2 : Symbol(map2, Decl(contextualSignatureInstantiation1.ts, 2, 17)) +>e2 : Symbol(e2, Decl(contextualSignatureInstantiation1.ts, 5, 3)) + diff --git a/tests/baselines/reference/contextualSignatureInstantiation2.symbols b/tests/baselines/reference/contextualSignatureInstantiation2.symbols new file mode 100644 index 00000000000..62808982eb5 --- /dev/null +++ b/tests/baselines/reference/contextualSignatureInstantiation2.symbols @@ -0,0 +1,53 @@ +=== tests/cases/compiler/contextualSignatureInstantiation2.ts === +// dot f g x = f(g(x)) +var dot: (f: (_: T) => S) => (g: (_: U) => T) => (_: U) => S; +>dot : Symbol(dot, Decl(contextualSignatureInstantiation2.ts, 1, 3)) +>T : Symbol(T, Decl(contextualSignatureInstantiation2.ts, 1, 10)) +>S : Symbol(S, Decl(contextualSignatureInstantiation2.ts, 1, 12)) +>f : Symbol(f, Decl(contextualSignatureInstantiation2.ts, 1, 16)) +>_ : Symbol(_, Decl(contextualSignatureInstantiation2.ts, 1, 20)) +>T : Symbol(T, Decl(contextualSignatureInstantiation2.ts, 1, 10)) +>S : Symbol(S, Decl(contextualSignatureInstantiation2.ts, 1, 12)) +>U : Symbol(U, Decl(contextualSignatureInstantiation2.ts, 1, 36)) +>g : Symbol(g, Decl(contextualSignatureInstantiation2.ts, 1, 39)) +>_ : Symbol(_, Decl(contextualSignatureInstantiation2.ts, 1, 43)) +>U : Symbol(U, Decl(contextualSignatureInstantiation2.ts, 1, 36)) +>T : Symbol(T, Decl(contextualSignatureInstantiation2.ts, 1, 10)) +>_ : Symbol(_, Decl(contextualSignatureInstantiation2.ts, 1, 59)) +>U : Symbol(U, Decl(contextualSignatureInstantiation2.ts, 1, 36)) +>S : Symbol(S, Decl(contextualSignatureInstantiation2.ts, 1, 12)) + +dot = (f: (_: T) => S) => (g: (_: U) => T): (r:U) => S => (x) => f(g(x)); +>dot : Symbol(dot, Decl(contextualSignatureInstantiation2.ts, 1, 3)) +>T : Symbol(T, Decl(contextualSignatureInstantiation2.ts, 2, 7)) +>S : Symbol(S, Decl(contextualSignatureInstantiation2.ts, 2, 9)) +>f : Symbol(f, Decl(contextualSignatureInstantiation2.ts, 2, 13)) +>_ : Symbol(_, Decl(contextualSignatureInstantiation2.ts, 2, 17)) +>T : Symbol(T, Decl(contextualSignatureInstantiation2.ts, 2, 7)) +>S : Symbol(S, Decl(contextualSignatureInstantiation2.ts, 2, 9)) +>U : Symbol(U, Decl(contextualSignatureInstantiation2.ts, 2, 33)) +>g : Symbol(g, Decl(contextualSignatureInstantiation2.ts, 2, 36)) +>_ : Symbol(_, Decl(contextualSignatureInstantiation2.ts, 2, 40)) +>U : Symbol(U, Decl(contextualSignatureInstantiation2.ts, 2, 33)) +>T : Symbol(T, Decl(contextualSignatureInstantiation2.ts, 2, 7)) +>r : Symbol(r, Decl(contextualSignatureInstantiation2.ts, 2, 54)) +>U : Symbol(U, Decl(contextualSignatureInstantiation2.ts, 2, 33)) +>S : Symbol(S, Decl(contextualSignatureInstantiation2.ts, 2, 9)) +>x : Symbol(x, Decl(contextualSignatureInstantiation2.ts, 2, 68)) +>f : Symbol(f, Decl(contextualSignatureInstantiation2.ts, 2, 13)) +>g : Symbol(g, Decl(contextualSignatureInstantiation2.ts, 2, 36)) +>x : Symbol(x, Decl(contextualSignatureInstantiation2.ts, 2, 68)) + +var id: (x:T) => T; +>id : Symbol(id, Decl(contextualSignatureInstantiation2.ts, 3, 3)) +>T : Symbol(T, Decl(contextualSignatureInstantiation2.ts, 3, 9)) +>x : Symbol(x, Decl(contextualSignatureInstantiation2.ts, 3, 12)) +>T : Symbol(T, Decl(contextualSignatureInstantiation2.ts, 3, 9)) +>T : Symbol(T, Decl(contextualSignatureInstantiation2.ts, 3, 9)) + +var r23 = dot(id)(id); +>r23 : Symbol(r23, Decl(contextualSignatureInstantiation2.ts, 4, 3)) +>dot : Symbol(dot, Decl(contextualSignatureInstantiation2.ts, 1, 3)) +>id : Symbol(id, Decl(contextualSignatureInstantiation2.ts, 3, 3)) +>id : Symbol(id, Decl(contextualSignatureInstantiation2.ts, 3, 3)) + diff --git a/tests/baselines/reference/contextualSignatureInstantiation3.symbols b/tests/baselines/reference/contextualSignatureInstantiation3.symbols new file mode 100644 index 00000000000..7e90c6390ca --- /dev/null +++ b/tests/baselines/reference/contextualSignatureInstantiation3.symbols @@ -0,0 +1,76 @@ +=== tests/cases/compiler/contextualSignatureInstantiation3.ts === +function map(items: T[], f: (x: T) => U): U[]{ +>map : Symbol(map, Decl(contextualSignatureInstantiation3.ts, 0, 0)) +>T : Symbol(T, Decl(contextualSignatureInstantiation3.ts, 0, 13)) +>U : Symbol(U, Decl(contextualSignatureInstantiation3.ts, 0, 15)) +>items : Symbol(items, Decl(contextualSignatureInstantiation3.ts, 0, 19)) +>T : Symbol(T, Decl(contextualSignatureInstantiation3.ts, 0, 13)) +>f : Symbol(f, Decl(contextualSignatureInstantiation3.ts, 0, 30)) +>x : Symbol(x, Decl(contextualSignatureInstantiation3.ts, 0, 35)) +>T : Symbol(T, Decl(contextualSignatureInstantiation3.ts, 0, 13)) +>U : Symbol(U, Decl(contextualSignatureInstantiation3.ts, 0, 15)) +>U : Symbol(U, Decl(contextualSignatureInstantiation3.ts, 0, 15)) + + return items.map(f); +>items.map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>items : Symbol(items, Decl(contextualSignatureInstantiation3.ts, 0, 19)) +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>f : Symbol(f, Decl(contextualSignatureInstantiation3.ts, 0, 30)) +} + +function identity(x: T) { +>identity : Symbol(identity, Decl(contextualSignatureInstantiation3.ts, 2, 1)) +>T : Symbol(T, Decl(contextualSignatureInstantiation3.ts, 4, 18)) +>x : Symbol(x, Decl(contextualSignatureInstantiation3.ts, 4, 21)) +>T : Symbol(T, Decl(contextualSignatureInstantiation3.ts, 4, 18)) + + return x; +>x : Symbol(x, Decl(contextualSignatureInstantiation3.ts, 4, 21)) +} + +function singleton(x: T) { +>singleton : Symbol(singleton, Decl(contextualSignatureInstantiation3.ts, 6, 1)) +>T : Symbol(T, Decl(contextualSignatureInstantiation3.ts, 8, 19)) +>x : Symbol(x, Decl(contextualSignatureInstantiation3.ts, 8, 22)) +>T : Symbol(T, Decl(contextualSignatureInstantiation3.ts, 8, 19)) + + return [x]; +>x : Symbol(x, Decl(contextualSignatureInstantiation3.ts, 8, 22)) +} + +var xs = [1, 2, 3]; +>xs : Symbol(xs, Decl(contextualSignatureInstantiation3.ts, 12, 3)) + +// Have compiler check that we get the correct types +var v1: number[]; +>v1 : Symbol(v1, Decl(contextualSignatureInstantiation3.ts, 15, 3), Decl(contextualSignatureInstantiation3.ts, 16, 3), Decl(contextualSignatureInstantiation3.ts, 17, 3)) + +var v1 = xs.map(identity); // Error if not number[] +>v1 : Symbol(v1, Decl(contextualSignatureInstantiation3.ts, 15, 3), Decl(contextualSignatureInstantiation3.ts, 16, 3), Decl(contextualSignatureInstantiation3.ts, 17, 3)) +>xs.map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>xs : Symbol(xs, Decl(contextualSignatureInstantiation3.ts, 12, 3)) +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>identity : Symbol(identity, Decl(contextualSignatureInstantiation3.ts, 2, 1)) + +var v1 = map(xs, identity); // Error if not number[] +>v1 : Symbol(v1, Decl(contextualSignatureInstantiation3.ts, 15, 3), Decl(contextualSignatureInstantiation3.ts, 16, 3), Decl(contextualSignatureInstantiation3.ts, 17, 3)) +>map : Symbol(map, Decl(contextualSignatureInstantiation3.ts, 0, 0)) +>xs : Symbol(xs, Decl(contextualSignatureInstantiation3.ts, 12, 3)) +>identity : Symbol(identity, Decl(contextualSignatureInstantiation3.ts, 2, 1)) + +var v2: number[][]; +>v2 : Symbol(v2, Decl(contextualSignatureInstantiation3.ts, 19, 3), Decl(contextualSignatureInstantiation3.ts, 20, 3), Decl(contextualSignatureInstantiation3.ts, 21, 3)) + +var v2 = xs.map(singleton); // Error if not number[][] +>v2 : Symbol(v2, Decl(contextualSignatureInstantiation3.ts, 19, 3), Decl(contextualSignatureInstantiation3.ts, 20, 3), Decl(contextualSignatureInstantiation3.ts, 21, 3)) +>xs.map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>xs : Symbol(xs, Decl(contextualSignatureInstantiation3.ts, 12, 3)) +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>singleton : Symbol(singleton, Decl(contextualSignatureInstantiation3.ts, 6, 1)) + +var v2 = map(xs, singleton); // Error if not number[][] +>v2 : Symbol(v2, Decl(contextualSignatureInstantiation3.ts, 19, 3), Decl(contextualSignatureInstantiation3.ts, 20, 3), Decl(contextualSignatureInstantiation3.ts, 21, 3)) +>map : Symbol(map, Decl(contextualSignatureInstantiation3.ts, 0, 0)) +>xs : Symbol(xs, Decl(contextualSignatureInstantiation3.ts, 12, 3)) +>singleton : Symbol(singleton, Decl(contextualSignatureInstantiation3.ts, 6, 1)) + diff --git a/tests/baselines/reference/contextualSignatureInstantiation3.types b/tests/baselines/reference/contextualSignatureInstantiation3.types index c6ed5a7e97d..d01b2b1f8e4 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation3.types +++ b/tests/baselines/reference/contextualSignatureInstantiation3.types @@ -43,6 +43,9 @@ function singleton(x: T) { var xs = [1, 2, 3]; >xs : number[] >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number // Have compiler check that we get the correct types var v1: number[]; diff --git a/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.symbols b/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.symbols new file mode 100644 index 00000000000..db6f205b152 --- /dev/null +++ b/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts === +function f() { +>f : Symbol(f, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 0)) +>T : Symbol(T, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 11)) + + function g(u: U): U { return null } +>g : Symbol(g, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 17)) +>U : Symbol(U, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 15)) +>T : Symbol(T, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 11)) +>u : Symbol(u, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 28)) +>U : Symbol(U, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 15)) +>U : Symbol(U, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 15)) + + return g; +>g : Symbol(g, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 17)) +} +var h: (v: V, func: (v: V) => W) => W; +>h : Symbol(h, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 3)) +>V : Symbol(V, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 8)) +>W : Symbol(W, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 10)) +>v : Symbol(v, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 14)) +>V : Symbol(V, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 8)) +>func : Symbol(func, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 19)) +>v : Symbol(v, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 27)) +>V : Symbol(V, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 8)) +>W : Symbol(W, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 10)) +>W : Symbol(W, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 10)) + +var x = h("", f()); // Call should succeed and x should be string. All type parameters should be instantiated to string +>x : Symbol(x, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 5, 3)) +>h : Symbol(h, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 3)) +>f : Symbol(f, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 0)) + diff --git a/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.types b/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.types index 89ea3028d94..d0a6d49487b 100644 --- a/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.types +++ b/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.types @@ -10,6 +10,7 @@ function f() { >u : U >U : U >U : U +>null : null return g; >g : (u: U) => U @@ -30,6 +31,7 @@ var x = h("", f()); // Call should succeed and x should be string. All t >x : string >h("", f()) : string >h : (v: V, func: (v: V) => W) => W +>"" : string >f() : (u: U) => U >f : () => (u: U) => U diff --git a/tests/baselines/reference/contextualSignatureInstatiationContravariance.symbols b/tests/baselines/reference/contextualSignatureInstatiationContravariance.symbols new file mode 100644 index 00000000000..c19c61cdbb0 --- /dev/null +++ b/tests/baselines/reference/contextualSignatureInstatiationContravariance.symbols @@ -0,0 +1,46 @@ +=== tests/cases/compiler/contextualSignatureInstatiationContravariance.ts === +interface Animal { x } +>Animal : Symbol(Animal, Decl(contextualSignatureInstatiationContravariance.ts, 0, 0)) +>x : Symbol(x, Decl(contextualSignatureInstatiationContravariance.ts, 0, 18)) + +interface Giraffe extends Animal { y } +>Giraffe : Symbol(Giraffe, Decl(contextualSignatureInstatiationContravariance.ts, 0, 22)) +>Animal : Symbol(Animal, Decl(contextualSignatureInstatiationContravariance.ts, 0, 0)) +>y : Symbol(y, Decl(contextualSignatureInstatiationContravariance.ts, 1, 34)) + +interface Elephant extends Animal { y2 } +>Elephant : Symbol(Elephant, Decl(contextualSignatureInstatiationContravariance.ts, 1, 38)) +>Animal : Symbol(Animal, Decl(contextualSignatureInstatiationContravariance.ts, 0, 0)) +>y2 : Symbol(y2, Decl(contextualSignatureInstatiationContravariance.ts, 2, 35)) + +var f2: (x: T, y: T) => void; +>f2 : Symbol(f2, Decl(contextualSignatureInstatiationContravariance.ts, 4, 3)) +>T : Symbol(T, Decl(contextualSignatureInstatiationContravariance.ts, 4, 9)) +>Animal : Symbol(Animal, Decl(contextualSignatureInstatiationContravariance.ts, 0, 0)) +>x : Symbol(x, Decl(contextualSignatureInstatiationContravariance.ts, 4, 27)) +>T : Symbol(T, Decl(contextualSignatureInstatiationContravariance.ts, 4, 9)) +>y : Symbol(y, Decl(contextualSignatureInstatiationContravariance.ts, 4, 32)) +>T : Symbol(T, Decl(contextualSignatureInstatiationContravariance.ts, 4, 9)) + +var g2: (g: Giraffe, e: Elephant) => void; +>g2 : Symbol(g2, Decl(contextualSignatureInstatiationContravariance.ts, 6, 3)) +>g : Symbol(g, Decl(contextualSignatureInstatiationContravariance.ts, 6, 9)) +>Giraffe : Symbol(Giraffe, Decl(contextualSignatureInstatiationContravariance.ts, 0, 22)) +>e : Symbol(e, Decl(contextualSignatureInstatiationContravariance.ts, 6, 20)) +>Elephant : Symbol(Elephant, Decl(contextualSignatureInstatiationContravariance.ts, 1, 38)) + +g2 = f2; // valid because both Giraffe and Elephant satisfy the constraint. T is Animal +>g2 : Symbol(g2, Decl(contextualSignatureInstatiationContravariance.ts, 6, 3)) +>f2 : Symbol(f2, Decl(contextualSignatureInstatiationContravariance.ts, 4, 3)) + +var h2: (g1: Giraffe, g2: Giraffe) => void; +>h2 : Symbol(h2, Decl(contextualSignatureInstatiationContravariance.ts, 9, 3)) +>g1 : Symbol(g1, Decl(contextualSignatureInstatiationContravariance.ts, 9, 9)) +>Giraffe : Symbol(Giraffe, Decl(contextualSignatureInstatiationContravariance.ts, 0, 22)) +>g2 : Symbol(g2, Decl(contextualSignatureInstatiationContravariance.ts, 9, 21)) +>Giraffe : Symbol(Giraffe, Decl(contextualSignatureInstatiationContravariance.ts, 0, 22)) + +h2 = f2; // valid because Giraffe satisfies the constraint. It is safe in the traditional contravariant fashion. +>h2 : Symbol(h2, Decl(contextualSignatureInstatiationContravariance.ts, 9, 3)) +>f2 : Symbol(f2, Decl(contextualSignatureInstatiationContravariance.ts, 4, 3)) + diff --git a/tests/baselines/reference/contextualSignatureInstatiationCovariance.symbols b/tests/baselines/reference/contextualSignatureInstatiationCovariance.symbols new file mode 100644 index 00000000000..9b1b4c0c5f0 --- /dev/null +++ b/tests/baselines/reference/contextualSignatureInstatiationCovariance.symbols @@ -0,0 +1,46 @@ +=== tests/cases/compiler/contextualSignatureInstatiationCovariance.ts === +interface Animal { x } +>Animal : Symbol(Animal, Decl(contextualSignatureInstatiationCovariance.ts, 0, 0)) +>x : Symbol(x, Decl(contextualSignatureInstatiationCovariance.ts, 0, 18)) + +interface TallThing { x2 } +>TallThing : Symbol(TallThing, Decl(contextualSignatureInstatiationCovariance.ts, 0, 22)) +>x2 : Symbol(x2, Decl(contextualSignatureInstatiationCovariance.ts, 1, 21)) + +interface Giraffe extends Animal, TallThing { y } +>Giraffe : Symbol(Giraffe, Decl(contextualSignatureInstatiationCovariance.ts, 1, 26)) +>Animal : Symbol(Animal, Decl(contextualSignatureInstatiationCovariance.ts, 0, 0)) +>TallThing : Symbol(TallThing, Decl(contextualSignatureInstatiationCovariance.ts, 0, 22)) +>y : Symbol(y, Decl(contextualSignatureInstatiationCovariance.ts, 2, 45)) + +var f2: (x: T, y: T) => void; +>f2 : Symbol(f2, Decl(contextualSignatureInstatiationCovariance.ts, 4, 3)) +>T : Symbol(T, Decl(contextualSignatureInstatiationCovariance.ts, 4, 9)) +>Giraffe : Symbol(Giraffe, Decl(contextualSignatureInstatiationCovariance.ts, 1, 26)) +>x : Symbol(x, Decl(contextualSignatureInstatiationCovariance.ts, 4, 28)) +>T : Symbol(T, Decl(contextualSignatureInstatiationCovariance.ts, 4, 9)) +>y : Symbol(y, Decl(contextualSignatureInstatiationCovariance.ts, 4, 33)) +>T : Symbol(T, Decl(contextualSignatureInstatiationCovariance.ts, 4, 9)) + +var g2: (a: Animal, t: TallThing) => void; +>g2 : Symbol(g2, Decl(contextualSignatureInstatiationCovariance.ts, 6, 3)) +>a : Symbol(a, Decl(contextualSignatureInstatiationCovariance.ts, 6, 9)) +>Animal : Symbol(Animal, Decl(contextualSignatureInstatiationCovariance.ts, 0, 0)) +>t : Symbol(t, Decl(contextualSignatureInstatiationCovariance.ts, 6, 19)) +>TallThing : Symbol(TallThing, Decl(contextualSignatureInstatiationCovariance.ts, 0, 22)) + +g2 = f2; // While neither Animal nor TallThing satisfy the constraint, T is at worst a Giraffe and compatible with both via covariance. +>g2 : Symbol(g2, Decl(contextualSignatureInstatiationCovariance.ts, 6, 3)) +>f2 : Symbol(f2, Decl(contextualSignatureInstatiationCovariance.ts, 4, 3)) + +var h2: (a1: Animal, a2: Animal) => void; +>h2 : Symbol(h2, Decl(contextualSignatureInstatiationCovariance.ts, 9, 3)) +>a1 : Symbol(a1, Decl(contextualSignatureInstatiationCovariance.ts, 9, 9)) +>Animal : Symbol(Animal, Decl(contextualSignatureInstatiationCovariance.ts, 0, 0)) +>a2 : Symbol(a2, Decl(contextualSignatureInstatiationCovariance.ts, 9, 20)) +>Animal : Symbol(Animal, Decl(contextualSignatureInstatiationCovariance.ts, 0, 0)) + +h2 = f2; // Animal does not satisfy the constraint, but T is at worst a Giraffe and compatible with Animal via covariance. +>h2 : Symbol(h2, Decl(contextualSignatureInstatiationCovariance.ts, 9, 3)) +>f2 : Symbol(f2, Decl(contextualSignatureInstatiationCovariance.ts, 4, 3)) + diff --git a/tests/baselines/reference/contextualTypeAny.symbols b/tests/baselines/reference/contextualTypeAny.symbols new file mode 100644 index 00000000000..5132c948a2e --- /dev/null +++ b/tests/baselines/reference/contextualTypeAny.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/contextualTypeAny.ts === +var x: any; +>x : Symbol(x, Decl(contextualTypeAny.ts, 0, 3)) + +var obj: { [s: string]: number } = { p: "", q: x }; +>obj : Symbol(obj, Decl(contextualTypeAny.ts, 2, 3)) +>s : Symbol(s, Decl(contextualTypeAny.ts, 2, 12)) +>p : Symbol(p, Decl(contextualTypeAny.ts, 2, 36)) +>q : Symbol(q, Decl(contextualTypeAny.ts, 2, 43)) +>x : Symbol(x, Decl(contextualTypeAny.ts, 0, 3)) + +var arr: number[] = ["", x]; +>arr : Symbol(arr, Decl(contextualTypeAny.ts, 4, 3)) +>x : Symbol(x, Decl(contextualTypeAny.ts, 0, 3)) + diff --git a/tests/baselines/reference/contextualTypeAny.types b/tests/baselines/reference/contextualTypeAny.types index b21c3748eda..cace92d6567 100644 --- a/tests/baselines/reference/contextualTypeAny.types +++ b/tests/baselines/reference/contextualTypeAny.types @@ -7,11 +7,13 @@ var obj: { [s: string]: number } = { p: "", q: x }; >s : string >{ p: "", q: x } : { [x: string]: any; p: string; q: any; } >p : string +>"" : string >q : any >x : any var arr: number[] = ["", x]; >arr : number[] >["", x] : any[] +>"" : string >x : any diff --git a/tests/baselines/reference/contextualTypeAppliedToVarArgs.symbols b/tests/baselines/reference/contextualTypeAppliedToVarArgs.symbols new file mode 100644 index 00000000000..bf8774cc7f0 --- /dev/null +++ b/tests/baselines/reference/contextualTypeAppliedToVarArgs.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/contextualTypeAppliedToVarArgs.ts === +function delegate(instance: any, method: (...args: any[]) => any, data?: any): (...args: any[]) => any { +>delegate : Symbol(delegate, Decl(contextualTypeAppliedToVarArgs.ts, 0, 0)) +>instance : Symbol(instance, Decl(contextualTypeAppliedToVarArgs.ts, 0, 18)) +>method : Symbol(method, Decl(contextualTypeAppliedToVarArgs.ts, 0, 32)) +>args : Symbol(args, Decl(contextualTypeAppliedToVarArgs.ts, 0, 42)) +>data : Symbol(data, Decl(contextualTypeAppliedToVarArgs.ts, 0, 65)) +>args : Symbol(args, Decl(contextualTypeAppliedToVarArgs.ts, 0, 80)) + + return function () { }; +} + +class Foo{ +>Foo : Symbol(Foo, Decl(contextualTypeAppliedToVarArgs.ts, 2, 1)) + + + Bar() { +>Bar : Symbol(Bar, Decl(contextualTypeAppliedToVarArgs.ts, 4, 10)) + + delegate(this, function (source, args2) +>delegate : Symbol(delegate, Decl(contextualTypeAppliedToVarArgs.ts, 0, 0)) +>this : Symbol(Foo, Decl(contextualTypeAppliedToVarArgs.ts, 2, 1)) +>source : Symbol(source, Decl(contextualTypeAppliedToVarArgs.ts, 8, 33)) +>args2 : Symbol(args2, Decl(contextualTypeAppliedToVarArgs.ts, 8, 40)) + { + var a = source.node; +>a : Symbol(a, Decl(contextualTypeAppliedToVarArgs.ts, 10, 15)) +>source : Symbol(source, Decl(contextualTypeAppliedToVarArgs.ts, 8, 33)) + + var b = args2.node; +>b : Symbol(b, Decl(contextualTypeAppliedToVarArgs.ts, 11, 15)) +>args2 : Symbol(args2, Decl(contextualTypeAppliedToVarArgs.ts, 8, 40)) + + } ); + } +} + diff --git a/tests/baselines/reference/contextualTypeArrayReturnType.symbols b/tests/baselines/reference/contextualTypeArrayReturnType.symbols new file mode 100644 index 00000000000..ed0e22d698c --- /dev/null +++ b/tests/baselines/reference/contextualTypeArrayReturnType.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/contextualTypeArrayReturnType.ts === +interface IBookStyle { +>IBookStyle : Symbol(IBookStyle, Decl(contextualTypeArrayReturnType.ts, 0, 0)) + + initialLeftPageTransforms?: (width: number) => NamedTransform[]; +>initialLeftPageTransforms : Symbol(initialLeftPageTransforms, Decl(contextualTypeArrayReturnType.ts, 0, 22)) +>width : Symbol(width, Decl(contextualTypeArrayReturnType.ts, 1, 33)) +>NamedTransform : Symbol(NamedTransform, Decl(contextualTypeArrayReturnType.ts, 2, 1)) +} + +interface NamedTransform { +>NamedTransform : Symbol(NamedTransform, Decl(contextualTypeArrayReturnType.ts, 2, 1)) + + [name: string]: Transform3D; +>name : Symbol(name, Decl(contextualTypeArrayReturnType.ts, 5, 5)) +>Transform3D : Symbol(Transform3D, Decl(contextualTypeArrayReturnType.ts, 6, 1)) +} + +interface Transform3D { +>Transform3D : Symbol(Transform3D, Decl(contextualTypeArrayReturnType.ts, 6, 1)) + + cachedCss: string; +>cachedCss : Symbol(cachedCss, Decl(contextualTypeArrayReturnType.ts, 8, 23)) +} + +var style: IBookStyle = { +>style : Symbol(style, Decl(contextualTypeArrayReturnType.ts, 12, 3)) +>IBookStyle : Symbol(IBookStyle, Decl(contextualTypeArrayReturnType.ts, 0, 0)) + + initialLeftPageTransforms: (width: number) => { +>initialLeftPageTransforms : Symbol(initialLeftPageTransforms, Decl(contextualTypeArrayReturnType.ts, 12, 25)) +>width : Symbol(width, Decl(contextualTypeArrayReturnType.ts, 13, 32)) + + return [ + {'ry': null } + ]; + } +} + diff --git a/tests/baselines/reference/contextualTypeArrayReturnType.types b/tests/baselines/reference/contextualTypeArrayReturnType.types index ceb7aa53f67..f270b33f568 100644 --- a/tests/baselines/reference/contextualTypeArrayReturnType.types +++ b/tests/baselines/reference/contextualTypeArrayReturnType.types @@ -38,6 +38,7 @@ var style: IBookStyle = { {'ry': null } >{'ry': null } : { [x: string]: null; 'ry': null; } +>null : null ]; } diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.symbols b/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.symbols new file mode 100644 index 00000000000..172336603ab --- /dev/null +++ b/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.symbols @@ -0,0 +1,86 @@ +=== tests/cases/conformance/types/union/contextualTypeWithUnionTypeCallSignatures.ts === +//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. + +// Let S be the set of types in U that have call signatures. +// If S is not empty and the sets of call signatures of the types in S are identical ignoring return types, +// U has the same set of call signatures, but with return types that are unions of the return types of the respective call signatures from each type in S. + +interface IWithNoCallSignatures { +>IWithNoCallSignatures : Symbol(IWithNoCallSignatures, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 0, 0)) + + foo: string; +>foo : Symbol(foo, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 7, 33)) +} +interface IWithCallSignatures { +>IWithCallSignatures : Symbol(IWithCallSignatures, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 9, 1)) + + (a: number): string; +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 11, 5)) +} +interface IWithCallSignatures2 { +>IWithCallSignatures2 : Symbol(IWithCallSignatures2, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 12, 1)) + + (a: number): number; +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 14, 5)) +} +interface IWithCallSignatures3 { +>IWithCallSignatures3 : Symbol(IWithCallSignatures3, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 15, 1)) + + (b: string): number; +>b : Symbol(b, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 17, 5)) +} +interface IWithCallSignatures4 { +>IWithCallSignatures4 : Symbol(IWithCallSignatures4, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 18, 1)) + + (a: number): string; +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 20, 5)) + + (a: string, b: number): number; +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 21, 5)) +>b : Symbol(b, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 21, 15)) +} + +// With no call signature | callSignatures +var x: IWithNoCallSignatures | IWithCallSignatures = a => a.toString(); +>x : Symbol(x, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 25, 3)) +>IWithNoCallSignatures : Symbol(IWithNoCallSignatures, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 0, 0)) +>IWithCallSignatures : Symbol(IWithCallSignatures, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 9, 1)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 25, 52)) +>a.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 25, 52)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) + +// With call signatures with different return type +var x2: IWithCallSignatures | IWithCallSignatures2 = a => a.toString(); // Like iWithCallSignatures +>x2 : Symbol(x2, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 28, 3), Decl(contextualTypeWithUnionTypeCallSignatures.ts, 29, 3)) +>IWithCallSignatures : Symbol(IWithCallSignatures, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 9, 1)) +>IWithCallSignatures2 : Symbol(IWithCallSignatures2, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 12, 1)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 28, 52)) +>a.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 28, 52)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) + +var x2: IWithCallSignatures | IWithCallSignatures2 = a => a; // Like iWithCallSignatures2 +>x2 : Symbol(x2, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 28, 3), Decl(contextualTypeWithUnionTypeCallSignatures.ts, 29, 3)) +>IWithCallSignatures : Symbol(IWithCallSignatures, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 9, 1)) +>IWithCallSignatures2 : Symbol(IWithCallSignatures2, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 12, 1)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 29, 52)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 29, 52)) + +// With call signatures of mismatching parameter type +var x3: IWithCallSignatures | IWithCallSignatures3 = a => /*here a should be any*/ a.toString(); +>x3 : Symbol(x3, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 32, 3)) +>IWithCallSignatures : Symbol(IWithCallSignatures, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 9, 1)) +>IWithCallSignatures3 : Symbol(IWithCallSignatures3, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 15, 1)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 32, 52)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 32, 52)) + +// With call signature count mismatch +var x4: IWithCallSignatures | IWithCallSignatures4 = a => /*here a should be any*/ a.toString(); +>x4 : Symbol(x4, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 35, 3)) +>IWithCallSignatures : Symbol(IWithCallSignatures, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 9, 1)) +>IWithCallSignatures4 : Symbol(IWithCallSignatures4, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 18, 1)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 35, 52)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 35, 52)) + diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.symbols b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.symbols new file mode 100644 index 00000000000..c381377e523 --- /dev/null +++ b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.symbols @@ -0,0 +1,146 @@ +=== tests/cases/conformance/types/union/contextualTypeWithUnionTypeIndexSignatures.ts === +//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. +interface SomeType { +>SomeType : Symbol(SomeType, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 0, 0)) + + (a: number): number; +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 3, 5)) +} +interface SomeType2 { +>SomeType2 : Symbol(SomeType2, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 4, 1)) + + (a: number): string; +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 6, 5)) +} + +interface IWithNoStringIndexSignature { +>IWithNoStringIndexSignature : Symbol(IWithNoStringIndexSignature, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 7, 1)) + + foo: string; +>foo : Symbol(foo, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 9, 39)) +} +interface IWithNoNumberIndexSignature { +>IWithNoNumberIndexSignature : Symbol(IWithNoNumberIndexSignature, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 11, 1)) + + 0: string; +} +interface IWithStringIndexSignature1 { +>IWithStringIndexSignature1 : Symbol(IWithStringIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 14, 1)) + + [a: string]: SomeType; +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 16, 5)) +>SomeType : Symbol(SomeType, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 0, 0)) +} +interface IWithStringIndexSignature2 { +>IWithStringIndexSignature2 : Symbol(IWithStringIndexSignature2, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 17, 1)) + + [a: string]: SomeType2; +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 19, 5)) +>SomeType2 : Symbol(SomeType2, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 4, 1)) +} +interface IWithNumberIndexSignature1 { +>IWithNumberIndexSignature1 : Symbol(IWithNumberIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 20, 1)) + + [a: number]: SomeType; +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 22, 5)) +>SomeType : Symbol(SomeType, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 0, 0)) +} +interface IWithNumberIndexSignature2 { +>IWithNumberIndexSignature2 : Symbol(IWithNumberIndexSignature2, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 23, 1)) + + [a: number]: SomeType2; +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 25, 5)) +>SomeType2 : Symbol(SomeType2, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 4, 1)) +} + +// When an object literal is contextually typed by a type that includes a string index signature, +// the resulting type of the object literal includes a string index signature with the union type of +// the types of the properties declared in the object literal, or the Undefined type if the object literal +// is empty.Likewise, when an object literal is contextually typed by a type that includes a numeric index +// signature, the resulting type of the object literal includes a numeric index signature with the union type +// of the types of the numerically named properties(section 3.7.4) declared in the object literal, +// or the Undefined type if the object literal declares no numerically named properties. + +// 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: IWithNoStringIndexSignature | IWithStringIndexSignature1 = { z: a => a }; // a should be number +>x : Symbol(x, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 39, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 40, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 41, 3)) +>IWithNoStringIndexSignature : Symbol(IWithNoStringIndexSignature, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 7, 1)) +>IWithStringIndexSignature1 : Symbol(IWithStringIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 14, 1)) +>z : Symbol(z, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 39, 67)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 39, 70)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 39, 70)) + +var x: IWithNoStringIndexSignature | IWithStringIndexSignature1 = { foo: a => a }; // a should be any +>x : Symbol(x, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 39, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 40, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 41, 3)) +>IWithNoStringIndexSignature : Symbol(IWithNoStringIndexSignature, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 7, 1)) +>IWithStringIndexSignature1 : Symbol(IWithStringIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 14, 1)) +>foo : Symbol(foo, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 40, 67)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 40, 72)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 40, 72)) + +var x: IWithNoStringIndexSignature | IWithStringIndexSignature1 = { foo: "hello" }; +>x : Symbol(x, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 39, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 40, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 41, 3)) +>IWithNoStringIndexSignature : Symbol(IWithNoStringIndexSignature, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 7, 1)) +>IWithStringIndexSignature1 : Symbol(IWithStringIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 14, 1)) +>foo : Symbol(foo, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 41, 67)) + +var x2: IWithStringIndexSignature1 | IWithStringIndexSignature2 = { z: a => a.toString() }; // a should be number +>x2 : Symbol(x2, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 42, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 43, 3)) +>IWithStringIndexSignature1 : Symbol(IWithStringIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 14, 1)) +>IWithStringIndexSignature2 : Symbol(IWithStringIndexSignature2, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 17, 1)) +>z : Symbol(z, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 42, 67)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 42, 70)) +>a.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 42, 70)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) + +var x2: IWithStringIndexSignature1 | IWithStringIndexSignature2 = { z: a => a }; // a should be number +>x2 : Symbol(x2, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 42, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 43, 3)) +>IWithStringIndexSignature1 : Symbol(IWithStringIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 14, 1)) +>IWithStringIndexSignature2 : Symbol(IWithStringIndexSignature2, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 17, 1)) +>z : Symbol(z, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 43, 67)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 43, 70)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 43, 70)) + + +// 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: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 1: a => a }; // a should be number +>x3 : Symbol(x3, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 49, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 50, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 51, 3)) +>IWithNoNumberIndexSignature : Symbol(IWithNoNumberIndexSignature, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 11, 1)) +>IWithNumberIndexSignature1 : Symbol(IWithNumberIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 20, 1)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 49, 71)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 49, 71)) + +var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 0: a => a }; // a should be any +>x3 : Symbol(x3, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 49, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 50, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 51, 3)) +>IWithNoNumberIndexSignature : Symbol(IWithNoNumberIndexSignature, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 11, 1)) +>IWithNumberIndexSignature1 : Symbol(IWithNumberIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 20, 1)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 50, 71)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 50, 71)) + +var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 0: "hello" }; +>x3 : Symbol(x3, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 49, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 50, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 51, 3)) +>IWithNoNumberIndexSignature : Symbol(IWithNoNumberIndexSignature, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 11, 1)) +>IWithNumberIndexSignature1 : Symbol(IWithNumberIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 20, 1)) + +var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a.toString() }; // a should be number +>x4 : Symbol(x4, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 52, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 53, 3)) +>IWithNumberIndexSignature1 : Symbol(IWithNumberIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 20, 1)) +>IWithNumberIndexSignature2 : Symbol(IWithNumberIndexSignature2, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 23, 1)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 52, 70)) +>a.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 52, 70)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) + +var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a }; // a should be number +>x4 : Symbol(x4, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 52, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 53, 3)) +>IWithNumberIndexSignature1 : Symbol(IWithNumberIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 20, 1)) +>IWithNumberIndexSignature2 : Symbol(IWithNumberIndexSignature2, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 23, 1)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 53, 70)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 53, 70)) + diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types index 8a91fe18698..2f24ad08227 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types +++ b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types @@ -91,6 +91,7 @@ var x: IWithNoStringIndexSignature | IWithStringIndexSignature1 = { foo: "hello" >IWithStringIndexSignature1 : IWithStringIndexSignature1 >{ foo: "hello" } : { [x: string]: string; foo: string; } >foo : string +>"hello" : string var x2: IWithStringIndexSignature1 | IWithStringIndexSignature2 = { z: a => a.toString() }; // a should be number >x2 : IWithStringIndexSignature1 | IWithStringIndexSignature2 @@ -142,6 +143,7 @@ var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 0: "hello" >IWithNoNumberIndexSignature : IWithNoNumberIndexSignature >IWithNumberIndexSignature1 : IWithNumberIndexSignature1 >{ 0: "hello" } : { [x: number]: string; 0: string; } +>"hello" : string var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a.toString() }; // a should be number >x4 : IWithNumberIndexSignature1 | IWithNumberIndexSignature2 diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeMembers.symbols b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.symbols new file mode 100644 index 00000000000..3d7b8bf5a18 --- /dev/null +++ b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.symbols @@ -0,0 +1,394 @@ +=== tests/cases/conformance/types/union/contextualTypeWithUnionTypeMembers.ts === +//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. +interface I1 { +>I1 : Symbol(I1, Decl(contextualTypeWithUnionTypeMembers.ts, 0, 0)) +>T : Symbol(T, Decl(contextualTypeWithUnionTypeMembers.ts, 2, 13)) + + commonMethodType(a: string): string; +>commonMethodType : Symbol(commonMethodType, Decl(contextualTypeWithUnionTypeMembers.ts, 2, 17)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 3, 21)) + + commonPropertyType: string; +>commonPropertyType : Symbol(commonPropertyType, Decl(contextualTypeWithUnionTypeMembers.ts, 3, 40)) + + commonMethodWithTypeParameter(a: T): T; +>commonMethodWithTypeParameter : Symbol(commonMethodWithTypeParameter, Decl(contextualTypeWithUnionTypeMembers.ts, 4, 31)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 5, 34)) +>T : Symbol(T, Decl(contextualTypeWithUnionTypeMembers.ts, 2, 13)) +>T : Symbol(T, Decl(contextualTypeWithUnionTypeMembers.ts, 2, 13)) + + methodOnlyInI1(a: string): string; +>methodOnlyInI1 : Symbol(methodOnlyInI1, Decl(contextualTypeWithUnionTypeMembers.ts, 5, 43)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 7, 19)) + + propertyOnlyInI1: string; +>propertyOnlyInI1 : Symbol(propertyOnlyInI1, Decl(contextualTypeWithUnionTypeMembers.ts, 7, 38)) +} +interface I2 { +>I2 : Symbol(I2, Decl(contextualTypeWithUnionTypeMembers.ts, 9, 1)) +>T : Symbol(T, Decl(contextualTypeWithUnionTypeMembers.ts, 10, 13)) + + commonMethodType(a: string): string; +>commonMethodType : Symbol(commonMethodType, Decl(contextualTypeWithUnionTypeMembers.ts, 10, 17)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 11, 21)) + + commonPropertyType: string; +>commonPropertyType : Symbol(commonPropertyType, Decl(contextualTypeWithUnionTypeMembers.ts, 11, 40)) + + commonMethodWithTypeParameter(a: T): T; +>commonMethodWithTypeParameter : Symbol(commonMethodWithTypeParameter, Decl(contextualTypeWithUnionTypeMembers.ts, 12, 31)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 13, 34)) +>T : Symbol(T, Decl(contextualTypeWithUnionTypeMembers.ts, 10, 13)) +>T : Symbol(T, Decl(contextualTypeWithUnionTypeMembers.ts, 10, 13)) + + methodOnlyInI2(a: string): string; +>methodOnlyInI2 : Symbol(methodOnlyInI2, Decl(contextualTypeWithUnionTypeMembers.ts, 13, 43)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 15, 19)) + + propertyOnlyInI2: string; +>propertyOnlyInI2 : Symbol(propertyOnlyInI2, Decl(contextualTypeWithUnionTypeMembers.ts, 15, 38)) +} + +// Let S be the set of types in U that has a property P. +// If S is not empty, U has a property P of a union type of the types of P from each type in S. +var i1: I1; +>i1 : Symbol(i1, Decl(contextualTypeWithUnionTypeMembers.ts, 21, 3)) +>I1 : Symbol(I1, Decl(contextualTypeWithUnionTypeMembers.ts, 0, 0)) + +var i2: I2; +>i2 : Symbol(i2, Decl(contextualTypeWithUnionTypeMembers.ts, 22, 3)) +>I2 : Symbol(I2, Decl(contextualTypeWithUnionTypeMembers.ts, 9, 1)) + +var i1Ori2: I1 | I2 = i1; +>i1Ori2 : Symbol(i1Ori2, Decl(contextualTypeWithUnionTypeMembers.ts, 23, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 24, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 25, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 33, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 41, 3)) +>I1 : Symbol(I1, Decl(contextualTypeWithUnionTypeMembers.ts, 0, 0)) +>I2 : Symbol(I2, Decl(contextualTypeWithUnionTypeMembers.ts, 9, 1)) +>i1 : Symbol(i1, Decl(contextualTypeWithUnionTypeMembers.ts, 21, 3)) + +var i1Ori2: I1 | I2 = i2; +>i1Ori2 : Symbol(i1Ori2, Decl(contextualTypeWithUnionTypeMembers.ts, 23, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 24, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 25, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 33, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 41, 3)) +>I1 : Symbol(I1, Decl(contextualTypeWithUnionTypeMembers.ts, 0, 0)) +>I2 : Symbol(I2, Decl(contextualTypeWithUnionTypeMembers.ts, 9, 1)) +>i2 : Symbol(i2, Decl(contextualTypeWithUnionTypeMembers.ts, 22, 3)) + +var i1Ori2: I1 | I2 = { // Like i1 +>i1Ori2 : Symbol(i1Ori2, Decl(contextualTypeWithUnionTypeMembers.ts, 23, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 24, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 25, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 33, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 41, 3)) +>I1 : Symbol(I1, Decl(contextualTypeWithUnionTypeMembers.ts, 0, 0)) +>I2 : Symbol(I2, Decl(contextualTypeWithUnionTypeMembers.ts, 9, 1)) + + commonPropertyType: "hello", +>commonPropertyType : Symbol(commonPropertyType, Decl(contextualTypeWithUnionTypeMembers.ts, 25, 39)) + + commonMethodType: a=> a, +>commonMethodType : Symbol(commonMethodType, Decl(contextualTypeWithUnionTypeMembers.ts, 26, 32)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 27, 21)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 27, 21)) + + commonMethodWithTypeParameter: a => a, +>commonMethodWithTypeParameter : Symbol(commonMethodWithTypeParameter, Decl(contextualTypeWithUnionTypeMembers.ts, 27, 28)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 28, 34)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 28, 34)) + + methodOnlyInI1: a => a, +>methodOnlyInI1 : Symbol(methodOnlyInI1, Decl(contextualTypeWithUnionTypeMembers.ts, 28, 42)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 30, 19)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 30, 19)) + + propertyOnlyInI1: "Hello", +>propertyOnlyInI1 : Symbol(propertyOnlyInI1, Decl(contextualTypeWithUnionTypeMembers.ts, 30, 27)) + +}; +var i1Ori2: I1 | I2 = { // Like i2 +>i1Ori2 : Symbol(i1Ori2, Decl(contextualTypeWithUnionTypeMembers.ts, 23, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 24, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 25, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 33, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 41, 3)) +>I1 : Symbol(I1, Decl(contextualTypeWithUnionTypeMembers.ts, 0, 0)) +>I2 : Symbol(I2, Decl(contextualTypeWithUnionTypeMembers.ts, 9, 1)) + + commonPropertyType: "hello", +>commonPropertyType : Symbol(commonPropertyType, Decl(contextualTypeWithUnionTypeMembers.ts, 33, 39)) + + commonMethodType: a=> a, +>commonMethodType : Symbol(commonMethodType, Decl(contextualTypeWithUnionTypeMembers.ts, 34, 32)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 35, 21)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 35, 21)) + + commonMethodWithTypeParameter: a => a, +>commonMethodWithTypeParameter : Symbol(commonMethodWithTypeParameter, Decl(contextualTypeWithUnionTypeMembers.ts, 35, 28)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 36, 34)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 36, 34)) + + methodOnlyInI2: a => a, +>methodOnlyInI2 : Symbol(methodOnlyInI2, Decl(contextualTypeWithUnionTypeMembers.ts, 36, 42)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 38, 19)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 38, 19)) + + propertyOnlyInI2: "Hello", +>propertyOnlyInI2 : Symbol(propertyOnlyInI2, Decl(contextualTypeWithUnionTypeMembers.ts, 38, 27)) + +}; +var i1Ori2: I1 | I2 = { // Like i1 and i2 both +>i1Ori2 : Symbol(i1Ori2, Decl(contextualTypeWithUnionTypeMembers.ts, 23, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 24, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 25, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 33, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 41, 3)) +>I1 : Symbol(I1, Decl(contextualTypeWithUnionTypeMembers.ts, 0, 0)) +>I2 : Symbol(I2, Decl(contextualTypeWithUnionTypeMembers.ts, 9, 1)) + + commonPropertyType: "hello", +>commonPropertyType : Symbol(commonPropertyType, Decl(contextualTypeWithUnionTypeMembers.ts, 41, 39)) + + commonMethodType: a=> a, +>commonMethodType : Symbol(commonMethodType, Decl(contextualTypeWithUnionTypeMembers.ts, 42, 32)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 43, 21)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 43, 21)) + + commonMethodWithTypeParameter: a => a, +>commonMethodWithTypeParameter : Symbol(commonMethodWithTypeParameter, Decl(contextualTypeWithUnionTypeMembers.ts, 43, 28)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 44, 34)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 44, 34)) + + methodOnlyInI1: a => a, +>methodOnlyInI1 : Symbol(methodOnlyInI1, Decl(contextualTypeWithUnionTypeMembers.ts, 44, 42)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 45, 19)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 45, 19)) + + propertyOnlyInI1: "Hello", +>propertyOnlyInI1 : Symbol(propertyOnlyInI1, Decl(contextualTypeWithUnionTypeMembers.ts, 45, 27)) + + methodOnlyInI2: a => a, +>methodOnlyInI2 : Symbol(methodOnlyInI2, Decl(contextualTypeWithUnionTypeMembers.ts, 46, 30)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 47, 19)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 47, 19)) + + propertyOnlyInI2: "Hello", +>propertyOnlyInI2 : Symbol(propertyOnlyInI2, Decl(contextualTypeWithUnionTypeMembers.ts, 47, 27)) + +}; + +var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 +>arrayI1OrI2 : Symbol(arrayI1OrI2, Decl(contextualTypeWithUnionTypeMembers.ts, 51, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>I1 : Symbol(I1, Decl(contextualTypeWithUnionTypeMembers.ts, 0, 0)) +>I2 : Symbol(I2, Decl(contextualTypeWithUnionTypeMembers.ts, 9, 1)) +>i1 : Symbol(i1, Decl(contextualTypeWithUnionTypeMembers.ts, 21, 3)) +>i2 : Symbol(i2, Decl(contextualTypeWithUnionTypeMembers.ts, 22, 3)) + + commonPropertyType: "hello", +>commonPropertyType : Symbol(commonPropertyType, Decl(contextualTypeWithUnionTypeMembers.ts, 51, 60)) + + commonMethodType: a=> a, +>commonMethodType : Symbol(commonMethodType, Decl(contextualTypeWithUnionTypeMembers.ts, 52, 36)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 53, 25)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 53, 25)) + + commonMethodWithTypeParameter: a => a, +>commonMethodWithTypeParameter : Symbol(commonMethodWithTypeParameter, Decl(contextualTypeWithUnionTypeMembers.ts, 53, 32)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 54, 38)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 54, 38)) + + methodOnlyInI1: a => a, +>methodOnlyInI1 : Symbol(methodOnlyInI1, Decl(contextualTypeWithUnionTypeMembers.ts, 54, 46)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 56, 23)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 56, 23)) + + propertyOnlyInI1: "Hello", +>propertyOnlyInI1 : Symbol(propertyOnlyInI1, Decl(contextualTypeWithUnionTypeMembers.ts, 56, 31)) + + }, + { // Like i2 + commonPropertyType: "hello", +>commonPropertyType : Symbol(commonPropertyType, Decl(contextualTypeWithUnionTypeMembers.ts, 59, 5)) + + commonMethodType: a=> a, +>commonMethodType : Symbol(commonMethodType, Decl(contextualTypeWithUnionTypeMembers.ts, 60, 36)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 61, 25)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 61, 25)) + + commonMethodWithTypeParameter: a => a, +>commonMethodWithTypeParameter : Symbol(commonMethodWithTypeParameter, Decl(contextualTypeWithUnionTypeMembers.ts, 61, 32)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 62, 38)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 62, 38)) + + methodOnlyInI2: a => a, +>methodOnlyInI2 : Symbol(methodOnlyInI2, Decl(contextualTypeWithUnionTypeMembers.ts, 62, 46)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 64, 23)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 64, 23)) + + propertyOnlyInI2: "Hello", +>propertyOnlyInI2 : Symbol(propertyOnlyInI2, Decl(contextualTypeWithUnionTypeMembers.ts, 64, 31)) + + }, { // Like i1 and i2 both + commonPropertyType: "hello", +>commonPropertyType : Symbol(commonPropertyType, Decl(contextualTypeWithUnionTypeMembers.ts, 66, 8)) + + commonMethodType: a=> a, +>commonMethodType : Symbol(commonMethodType, Decl(contextualTypeWithUnionTypeMembers.ts, 67, 36)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 68, 25)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 68, 25)) + + commonMethodWithTypeParameter: a => a, +>commonMethodWithTypeParameter : Symbol(commonMethodWithTypeParameter, Decl(contextualTypeWithUnionTypeMembers.ts, 68, 32)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 69, 38)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 69, 38)) + + methodOnlyInI1: a => a, +>methodOnlyInI1 : Symbol(methodOnlyInI1, Decl(contextualTypeWithUnionTypeMembers.ts, 69, 46)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 70, 23)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 70, 23)) + + propertyOnlyInI1: "Hello", +>propertyOnlyInI1 : Symbol(propertyOnlyInI1, Decl(contextualTypeWithUnionTypeMembers.ts, 70, 31)) + + methodOnlyInI2: a => a, +>methodOnlyInI2 : Symbol(methodOnlyInI2, Decl(contextualTypeWithUnionTypeMembers.ts, 71, 34)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 72, 23)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 72, 23)) + + propertyOnlyInI2: "Hello", +>propertyOnlyInI2 : Symbol(propertyOnlyInI2, Decl(contextualTypeWithUnionTypeMembers.ts, 72, 31)) + + }]; + +interface I11 { +>I11 : Symbol(I11, Decl(contextualTypeWithUnionTypeMembers.ts, 74, 7)) + + commonMethodDifferentReturnType(a: string, b: number): string; +>commonMethodDifferentReturnType : Symbol(commonMethodDifferentReturnType, Decl(contextualTypeWithUnionTypeMembers.ts, 76, 15)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 77, 36)) +>b : Symbol(b, Decl(contextualTypeWithUnionTypeMembers.ts, 77, 46)) + + commonPropertyDifferentType: string; +>commonPropertyDifferentType : Symbol(commonPropertyDifferentType, Decl(contextualTypeWithUnionTypeMembers.ts, 77, 66)) +} +interface I21 { +>I21 : Symbol(I21, Decl(contextualTypeWithUnionTypeMembers.ts, 79, 1)) + + commonMethodDifferentReturnType(a: string, b: number): number; +>commonMethodDifferentReturnType : Symbol(commonMethodDifferentReturnType, Decl(contextualTypeWithUnionTypeMembers.ts, 80, 15)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 81, 36)) +>b : Symbol(b, Decl(contextualTypeWithUnionTypeMembers.ts, 81, 46)) + + commonPropertyDifferentType: number; +>commonPropertyDifferentType : Symbol(commonPropertyDifferentType, Decl(contextualTypeWithUnionTypeMembers.ts, 81, 66)) +} +var i11: I11; +>i11 : Symbol(i11, Decl(contextualTypeWithUnionTypeMembers.ts, 84, 3)) +>I11 : Symbol(I11, Decl(contextualTypeWithUnionTypeMembers.ts, 74, 7)) + +var i21: I21; +>i21 : Symbol(i21, Decl(contextualTypeWithUnionTypeMembers.ts, 85, 3)) +>I21 : Symbol(I21, Decl(contextualTypeWithUnionTypeMembers.ts, 79, 1)) + +var i11Ori21: I11 | I21 = i11; +>i11Ori21 : Symbol(i11Ori21, Decl(contextualTypeWithUnionTypeMembers.ts, 86, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 87, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 88, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 96, 3)) +>I11 : Symbol(I11, Decl(contextualTypeWithUnionTypeMembers.ts, 74, 7)) +>I21 : Symbol(I21, Decl(contextualTypeWithUnionTypeMembers.ts, 79, 1)) +>i11 : Symbol(i11, Decl(contextualTypeWithUnionTypeMembers.ts, 84, 3)) + +var i11Ori21: I11 | I21 = i21; +>i11Ori21 : Symbol(i11Ori21, Decl(contextualTypeWithUnionTypeMembers.ts, 86, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 87, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 88, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 96, 3)) +>I11 : Symbol(I11, Decl(contextualTypeWithUnionTypeMembers.ts, 74, 7)) +>I21 : Symbol(I21, Decl(contextualTypeWithUnionTypeMembers.ts, 79, 1)) +>i21 : Symbol(i21, Decl(contextualTypeWithUnionTypeMembers.ts, 85, 3)) + +var i11Ori21: I11 | I21 = { +>i11Ori21 : Symbol(i11Ori21, Decl(contextualTypeWithUnionTypeMembers.ts, 86, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 87, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 88, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 96, 3)) +>I11 : Symbol(I11, Decl(contextualTypeWithUnionTypeMembers.ts, 74, 7)) +>I21 : Symbol(I21, Decl(contextualTypeWithUnionTypeMembers.ts, 79, 1)) + + // Like i1 + commonMethodDifferentReturnType: (a, b) => { +>commonMethodDifferentReturnType : Symbol(commonMethodDifferentReturnType, Decl(contextualTypeWithUnionTypeMembers.ts, 88, 27)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 90, 38)) +>b : Symbol(b, Decl(contextualTypeWithUnionTypeMembers.ts, 90, 40)) + + var z = a.charAt(b); +>z : Symbol(z, Decl(contextualTypeWithUnionTypeMembers.ts, 91, 11)) +>a.charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 90, 38)) +>charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>b : Symbol(b, Decl(contextualTypeWithUnionTypeMembers.ts, 90, 40)) + + return z; +>z : Symbol(z, Decl(contextualTypeWithUnionTypeMembers.ts, 91, 11)) + + }, + commonPropertyDifferentType: "hello", +>commonPropertyDifferentType : Symbol(commonPropertyDifferentType, Decl(contextualTypeWithUnionTypeMembers.ts, 93, 6)) + +}; +var i11Ori21: I11 | I21 = { +>i11Ori21 : Symbol(i11Ori21, Decl(contextualTypeWithUnionTypeMembers.ts, 86, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 87, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 88, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 96, 3)) +>I11 : Symbol(I11, Decl(contextualTypeWithUnionTypeMembers.ts, 74, 7)) +>I21 : Symbol(I21, Decl(contextualTypeWithUnionTypeMembers.ts, 79, 1)) + + // Like i2 + commonMethodDifferentReturnType: (a, b) => { +>commonMethodDifferentReturnType : Symbol(commonMethodDifferentReturnType, Decl(contextualTypeWithUnionTypeMembers.ts, 96, 27)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 98, 38)) +>b : Symbol(b, Decl(contextualTypeWithUnionTypeMembers.ts, 98, 40)) + + var z = a.charCodeAt(b); +>z : Symbol(z, Decl(contextualTypeWithUnionTypeMembers.ts, 99, 11)) +>a.charCodeAt : Symbol(String.charCodeAt, Decl(lib.d.ts, 285, 32)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 98, 38)) +>charCodeAt : Symbol(String.charCodeAt, Decl(lib.d.ts, 285, 32)) +>b : Symbol(b, Decl(contextualTypeWithUnionTypeMembers.ts, 98, 40)) + + return z; +>z : Symbol(z, Decl(contextualTypeWithUnionTypeMembers.ts, 99, 11)) + + }, + commonPropertyDifferentType: 10, +>commonPropertyDifferentType : Symbol(commonPropertyDifferentType, Decl(contextualTypeWithUnionTypeMembers.ts, 101, 6)) + +}; +var arrayOrI11OrI21: Array = [i11, i21, i11 || i21, { +>arrayOrI11OrI21 : Symbol(arrayOrI11OrI21, Decl(contextualTypeWithUnionTypeMembers.ts, 104, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>I11 : Symbol(I11, Decl(contextualTypeWithUnionTypeMembers.ts, 74, 7)) +>I21 : Symbol(I21, Decl(contextualTypeWithUnionTypeMembers.ts, 79, 1)) +>i11 : Symbol(i11, Decl(contextualTypeWithUnionTypeMembers.ts, 84, 3)) +>i21 : Symbol(i21, Decl(contextualTypeWithUnionTypeMembers.ts, 85, 3)) +>i11 : Symbol(i11, Decl(contextualTypeWithUnionTypeMembers.ts, 84, 3)) +>i21 : Symbol(i21, Decl(contextualTypeWithUnionTypeMembers.ts, 85, 3)) + + // Like i1 + commonMethodDifferentReturnType: (a, b) => { +>commonMethodDifferentReturnType : Symbol(commonMethodDifferentReturnType, Decl(contextualTypeWithUnionTypeMembers.ts, 104, 64)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 106, 42)) +>b : Symbol(b, Decl(contextualTypeWithUnionTypeMembers.ts, 106, 44)) + + var z = a.charAt(b); +>z : Symbol(z, Decl(contextualTypeWithUnionTypeMembers.ts, 107, 15)) +>a.charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 106, 42)) +>charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>b : Symbol(b, Decl(contextualTypeWithUnionTypeMembers.ts, 106, 44)) + + return z; +>z : Symbol(z, Decl(contextualTypeWithUnionTypeMembers.ts, 107, 15)) + + }, + commonPropertyDifferentType: "hello", +>commonPropertyDifferentType : Symbol(commonPropertyDifferentType, Decl(contextualTypeWithUnionTypeMembers.ts, 109, 10)) + + }, { + // Like i2 + commonMethodDifferentReturnType: (a, b) => { +>commonMethodDifferentReturnType : Symbol(commonMethodDifferentReturnType, Decl(contextualTypeWithUnionTypeMembers.ts, 111, 8)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 113, 42)) +>b : Symbol(b, Decl(contextualTypeWithUnionTypeMembers.ts, 113, 44)) + + var z = a.charCodeAt(b); +>z : Symbol(z, Decl(contextualTypeWithUnionTypeMembers.ts, 114, 15)) +>a.charCodeAt : Symbol(String.charCodeAt, Decl(lib.d.ts, 285, 32)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 113, 42)) +>charCodeAt : Symbol(String.charCodeAt, Decl(lib.d.ts, 285, 32)) +>b : Symbol(b, Decl(contextualTypeWithUnionTypeMembers.ts, 113, 44)) + + return z; +>z : Symbol(z, Decl(contextualTypeWithUnionTypeMembers.ts, 114, 15)) + + }, + commonPropertyDifferentType: 10, +>commonPropertyDifferentType : Symbol(commonPropertyDifferentType, Decl(contextualTypeWithUnionTypeMembers.ts, 116, 10)) + + }]; diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types index 522d4a4a555..c51227fd13a 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types +++ b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types @@ -80,6 +80,7 @@ var i1Ori2: I1 | I2 = { // Like i1 commonPropertyType: "hello", >commonPropertyType : string +>"hello" : string commonMethodType: a=> a, >commonMethodType : (a: string) => string @@ -101,6 +102,7 @@ var i1Ori2: I1 | I2 = { // Like i1 propertyOnlyInI1: "Hello", >propertyOnlyInI1 : string +>"Hello" : string }; var i1Ori2: I1 | I2 = { // Like i2 @@ -111,6 +113,7 @@ var i1Ori2: I1 | I2 = { // Like i2 commonPropertyType: "hello", >commonPropertyType : string +>"hello" : string commonMethodType: a=> a, >commonMethodType : (a: string) => string @@ -132,6 +135,7 @@ var i1Ori2: I1 | I2 = { // Like i2 propertyOnlyInI2: "Hello", >propertyOnlyInI2 : string +>"Hello" : string }; var i1Ori2: I1 | I2 = { // Like i1 and i2 both @@ -142,6 +146,7 @@ var i1Ori2: I1 | I2 = { // Like i1 and i2 both commonPropertyType: "hello", >commonPropertyType : string +>"hello" : string commonMethodType: a=> a, >commonMethodType : (a: string) => string @@ -163,6 +168,7 @@ var i1Ori2: I1 | I2 = { // Like i1 and i2 both propertyOnlyInI1: "Hello", >propertyOnlyInI1 : string +>"Hello" : string methodOnlyInI2: a => a, >methodOnlyInI2 : (a: string) => string @@ -172,6 +178,7 @@ var i1Ori2: I1 | I2 = { // Like i1 and i2 both propertyOnlyInI2: "Hello", >propertyOnlyInI2 : string +>"Hello" : string }; @@ -187,6 +194,7 @@ var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 commonPropertyType: "hello", >commonPropertyType : string +>"hello" : string commonMethodType: a=> a, >commonMethodType : (a: string) => string @@ -208,6 +216,7 @@ var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 propertyOnlyInI1: "Hello", >propertyOnlyInI1 : string +>"Hello" : string }, { // Like i2 @@ -215,6 +224,7 @@ var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 commonPropertyType: "hello", >commonPropertyType : string +>"hello" : string commonMethodType: a=> a, >commonMethodType : (a: string) => string @@ -236,12 +246,14 @@ var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 propertyOnlyInI2: "Hello", >propertyOnlyInI2 : string +>"Hello" : string }, { // Like i1 and i2 both >{ // Like i1 and i2 both commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", } : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: string; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: string; } commonPropertyType: "hello", >commonPropertyType : string +>"hello" : string commonMethodType: a=> a, >commonMethodType : (a: string) => string @@ -263,6 +275,7 @@ var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 propertyOnlyInI1: "Hello", >propertyOnlyInI1 : string +>"Hello" : string methodOnlyInI2: a => a, >methodOnlyInI2 : (a: string) => string @@ -272,6 +285,7 @@ var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 propertyOnlyInI2: "Hello", >propertyOnlyInI2 : string +>"Hello" : string }]; @@ -344,6 +358,7 @@ var i11Ori21: I11 | I21 = { }, commonPropertyDifferentType: "hello", >commonPropertyDifferentType : string +>"hello" : string }; var i11Ori21: I11 | I21 = { @@ -373,6 +388,7 @@ var i11Ori21: I11 | I21 = { }, commonPropertyDifferentType: 10, >commonPropertyDifferentType : number +>10 : number }; var arrayOrI11OrI21: Array = [i11, i21, i11 || i21, { @@ -409,6 +425,7 @@ var arrayOrI11OrI21: Array = [i11, i21, i11 || i21, { }, commonPropertyDifferentType: "hello", >commonPropertyDifferentType : string +>"hello" : string }, { >{ // Like i2 commonMethodDifferentReturnType: (a, b) => { var z = a.charCodeAt(b); return z; }, commonPropertyDifferentType: 10, } : { commonMethodDifferentReturnType: (a: string, b: number) => number; commonPropertyDifferentType: number; } @@ -434,5 +451,6 @@ var arrayOrI11OrI21: Array = [i11, i21, i11 || i21, { }, commonPropertyDifferentType: 10, >commonPropertyDifferentType : number +>10 : number }]; diff --git a/tests/baselines/reference/contextualTyping1.symbols b/tests/baselines/reference/contextualTyping1.symbols new file mode 100644 index 00000000000..00c6fd57f2a --- /dev/null +++ b/tests/baselines/reference/contextualTyping1.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/contextualTyping1.ts === +var foo: {id:number;} = {id:4}; +>foo : Symbol(foo, Decl(contextualTyping1.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping1.ts, 0, 10)) +>id : Symbol(id, Decl(contextualTyping1.ts, 0, 25)) + diff --git a/tests/baselines/reference/contextualTyping1.types b/tests/baselines/reference/contextualTyping1.types index a9d2f982569..6b2a794f987 100644 --- a/tests/baselines/reference/contextualTyping1.types +++ b/tests/baselines/reference/contextualTyping1.types @@ -4,4 +4,5 @@ var foo: {id:number;} = {id:4}; >id : number >{id:4} : { id: number; } >id : number +>4 : number diff --git a/tests/baselines/reference/contextualTyping10.symbols b/tests/baselines/reference/contextualTyping10.symbols new file mode 100644 index 00000000000..130116264e0 --- /dev/null +++ b/tests/baselines/reference/contextualTyping10.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/contextualTyping10.ts === +class foo { public bar:{id:number;}[] = [{id:1}, {id:2}]; } +>foo : Symbol(foo, Decl(contextualTyping10.ts, 0, 0)) +>bar : Symbol(bar, Decl(contextualTyping10.ts, 0, 11)) +>id : Symbol(id, Decl(contextualTyping10.ts, 0, 24)) +>id : Symbol(id, Decl(contextualTyping10.ts, 0, 42)) +>id : Symbol(id, Decl(contextualTyping10.ts, 0, 50)) + diff --git a/tests/baselines/reference/contextualTyping10.types b/tests/baselines/reference/contextualTyping10.types index e3a6c2bcf4a..938f2731a30 100644 --- a/tests/baselines/reference/contextualTyping10.types +++ b/tests/baselines/reference/contextualTyping10.types @@ -6,6 +6,8 @@ class foo { public bar:{id:number;}[] = [{id:1}, {id:2}]; } >[{id:1}, {id:2}] : { id: number; }[] >{id:1} : { id: number; } >id : number +>1 : number >{id:2} : { id: number; } >id : number +>2 : number diff --git a/tests/baselines/reference/contextualTyping12.symbols b/tests/baselines/reference/contextualTyping12.symbols new file mode 100644 index 00000000000..bafef4c8e0a --- /dev/null +++ b/tests/baselines/reference/contextualTyping12.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/contextualTyping12.ts === +class foo { public bar:{id:number;}[] = [{id:1}, {id:2, name:"foo"}]; } +>foo : Symbol(foo, Decl(contextualTyping12.ts, 0, 0)) +>bar : Symbol(bar, Decl(contextualTyping12.ts, 0, 11)) +>id : Symbol(id, Decl(contextualTyping12.ts, 0, 24)) +>id : Symbol(id, Decl(contextualTyping12.ts, 0, 42)) +>id : Symbol(id, Decl(contextualTyping12.ts, 0, 50)) +>name : Symbol(name, Decl(contextualTyping12.ts, 0, 55)) + diff --git a/tests/baselines/reference/contextualTyping12.types b/tests/baselines/reference/contextualTyping12.types index 31d4e990938..68e2663fb6a 100644 --- a/tests/baselines/reference/contextualTyping12.types +++ b/tests/baselines/reference/contextualTyping12.types @@ -6,7 +6,10 @@ class foo { public bar:{id:number;}[] = [{id:1}, {id:2, name:"foo"}]; } >[{id:1}, {id:2, name:"foo"}] : { id: number; }[] >{id:1} : { id: number; } >id : number +>1 : number >{id:2, name:"foo"} : { id: number; name: string; } >id : number +>2 : number >name : string +>"foo" : string diff --git a/tests/baselines/reference/contextualTyping13.symbols b/tests/baselines/reference/contextualTyping13.symbols new file mode 100644 index 00000000000..e60131e8433 --- /dev/null +++ b/tests/baselines/reference/contextualTyping13.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/contextualTyping13.ts === +var foo:(a:number)=>number = function(a){return a}; +>foo : Symbol(foo, Decl(contextualTyping13.ts, 0, 3)) +>a : Symbol(a, Decl(contextualTyping13.ts, 0, 9)) +>a : Symbol(a, Decl(contextualTyping13.ts, 0, 38)) +>a : Symbol(a, Decl(contextualTyping13.ts, 0, 38)) + diff --git a/tests/baselines/reference/contextualTyping14.symbols b/tests/baselines/reference/contextualTyping14.symbols new file mode 100644 index 00000000000..7de67445ca8 --- /dev/null +++ b/tests/baselines/reference/contextualTyping14.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/contextualTyping14.ts === +class foo { public bar:(a:number)=>number = function(a){return a}; } +>foo : Symbol(foo, Decl(contextualTyping14.ts, 0, 0)) +>bar : Symbol(bar, Decl(contextualTyping14.ts, 0, 11)) +>a : Symbol(a, Decl(contextualTyping14.ts, 0, 24)) +>a : Symbol(a, Decl(contextualTyping14.ts, 0, 53)) +>a : Symbol(a, Decl(contextualTyping14.ts, 0, 53)) + diff --git a/tests/baselines/reference/contextualTyping15.symbols b/tests/baselines/reference/contextualTyping15.symbols new file mode 100644 index 00000000000..902fb03dc70 --- /dev/null +++ b/tests/baselines/reference/contextualTyping15.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/contextualTyping15.ts === +class foo { public bar: { (): number; (i: number): number; } = function() { return 1 }; } +>foo : Symbol(foo, Decl(contextualTyping15.ts, 0, 0)) +>bar : Symbol(bar, Decl(contextualTyping15.ts, 0, 11)) +>i : Symbol(i, Decl(contextualTyping15.ts, 0, 39)) + diff --git a/tests/baselines/reference/contextualTyping15.types b/tests/baselines/reference/contextualTyping15.types index c039504efbe..ed4fdad3bfc 100644 --- a/tests/baselines/reference/contextualTyping15.types +++ b/tests/baselines/reference/contextualTyping15.types @@ -4,4 +4,5 @@ class foo { public bar: { (): number; (i: number): number; } = function() { retu >bar : { (): number; (i: number): number; } >i : number >function() { return 1 } : () => number +>1 : number diff --git a/tests/baselines/reference/contextualTyping16.symbols b/tests/baselines/reference/contextualTyping16.symbols new file mode 100644 index 00000000000..9f88ce4c151 --- /dev/null +++ b/tests/baselines/reference/contextualTyping16.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/contextualTyping16.ts === +var foo: {id:number;} = {id:4}; foo = {id:5}; +>foo : Symbol(foo, Decl(contextualTyping16.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping16.ts, 0, 10)) +>id : Symbol(id, Decl(contextualTyping16.ts, 0, 25)) +>foo : Symbol(foo, Decl(contextualTyping16.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping16.ts, 0, 39)) + diff --git a/tests/baselines/reference/contextualTyping16.types b/tests/baselines/reference/contextualTyping16.types index 9e11cd5bf3b..63f93649208 100644 --- a/tests/baselines/reference/contextualTyping16.types +++ b/tests/baselines/reference/contextualTyping16.types @@ -4,8 +4,10 @@ var foo: {id:number;} = {id:4}; foo = {id:5}; >id : number >{id:4} : { id: number; } >id : number +>4 : number >foo = {id:5} : { id: number; } >foo : { id: number; } >{id:5} : { id: number; } >id : number +>5 : number diff --git a/tests/baselines/reference/contextualTyping17.symbols b/tests/baselines/reference/contextualTyping17.symbols new file mode 100644 index 00000000000..55631494105 --- /dev/null +++ b/tests/baselines/reference/contextualTyping17.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/contextualTyping17.ts === +var foo: {id:number;} = {id:4}; foo = {id: 5, name:"foo"}; +>foo : Symbol(foo, Decl(contextualTyping17.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping17.ts, 0, 10)) +>id : Symbol(id, Decl(contextualTyping17.ts, 0, 25)) +>foo : Symbol(foo, Decl(contextualTyping17.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping17.ts, 0, 39)) +>name : Symbol(name, Decl(contextualTyping17.ts, 0, 45)) + diff --git a/tests/baselines/reference/contextualTyping17.types b/tests/baselines/reference/contextualTyping17.types index 63b18af94ab..649bc339ba1 100644 --- a/tests/baselines/reference/contextualTyping17.types +++ b/tests/baselines/reference/contextualTyping17.types @@ -4,9 +4,12 @@ var foo: {id:number;} = {id:4}; foo = {id: 5, name:"foo"}; >id : number >{id:4} : { id: number; } >id : number +>4 : number >foo = {id: 5, name:"foo"} : { id: number; name: string; } >foo : { id: number; } >{id: 5, name:"foo"} : { id: number; name: string; } >id : number +>5 : number >name : string +>"foo" : string diff --git a/tests/baselines/reference/contextualTyping18.symbols b/tests/baselines/reference/contextualTyping18.symbols new file mode 100644 index 00000000000..a5506cfe900 --- /dev/null +++ b/tests/baselines/reference/contextualTyping18.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/contextualTyping18.ts === +var foo: {id:number;} = <{id:number;}>({ }); foo = {id: 5}; +>foo : Symbol(foo, Decl(contextualTyping18.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping18.ts, 0, 10)) +>id : Symbol(id, Decl(contextualTyping18.ts, 0, 26)) +>foo : Symbol(foo, Decl(contextualTyping18.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping18.ts, 0, 52)) + diff --git a/tests/baselines/reference/contextualTyping18.types b/tests/baselines/reference/contextualTyping18.types index 0c3cd5fd963..0bef546022d 100644 --- a/tests/baselines/reference/contextualTyping18.types +++ b/tests/baselines/reference/contextualTyping18.types @@ -10,4 +10,5 @@ var foo: {id:number;} = <{id:number;}>({ }); foo = {id: 5}; >foo : { id: number; } >{id: 5} : { id: number; } >id : number +>5 : number diff --git a/tests/baselines/reference/contextualTyping19.symbols b/tests/baselines/reference/contextualTyping19.symbols new file mode 100644 index 00000000000..cee3a6e7d24 --- /dev/null +++ b/tests/baselines/reference/contextualTyping19.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/contextualTyping19.ts === +var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, {id:2}]; +>foo : Symbol(foo, Decl(contextualTyping19.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping19.ts, 0, 9)) +>id : Symbol(id, Decl(contextualTyping19.ts, 0, 27)) +>foo : Symbol(foo, Decl(contextualTyping19.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping19.ts, 0, 43)) +>id : Symbol(id, Decl(contextualTyping19.ts, 0, 51)) + diff --git a/tests/baselines/reference/contextualTyping19.types b/tests/baselines/reference/contextualTyping19.types index 6b07986e6e6..d384a68749a 100644 --- a/tests/baselines/reference/contextualTyping19.types +++ b/tests/baselines/reference/contextualTyping19.types @@ -5,11 +5,14 @@ var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, {id:2}]; >[{id:1}] : { id: number; }[] >{id:1} : { id: number; } >id : number +>1 : number >foo = [{id:1}, {id:2}] : { id: number; }[] >foo : { id: number; }[] >[{id:1}, {id:2}] : { id: number; }[] >{id:1} : { id: number; } >id : number +>1 : number >{id:2} : { id: number; } >id : number +>2 : number diff --git a/tests/baselines/reference/contextualTyping2.symbols b/tests/baselines/reference/contextualTyping2.symbols new file mode 100644 index 00000000000..9c102092979 --- /dev/null +++ b/tests/baselines/reference/contextualTyping2.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/contextualTyping2.ts === +var foo: {id:number;} = {id:4, name:"foo"}; +>foo : Symbol(foo, Decl(contextualTyping2.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping2.ts, 0, 10)) +>id : Symbol(id, Decl(contextualTyping2.ts, 0, 25)) +>name : Symbol(name, Decl(contextualTyping2.ts, 0, 30)) + diff --git a/tests/baselines/reference/contextualTyping2.types b/tests/baselines/reference/contextualTyping2.types index 3474a284982..0658247c089 100644 --- a/tests/baselines/reference/contextualTyping2.types +++ b/tests/baselines/reference/contextualTyping2.types @@ -4,5 +4,7 @@ var foo: {id:number;} = {id:4, name:"foo"}; >id : number >{id:4, name:"foo"} : { id: number; name: string; } >id : number +>4 : number >name : string +>"foo" : string diff --git a/tests/baselines/reference/contextualTyping20.symbols b/tests/baselines/reference/contextualTyping20.symbols new file mode 100644 index 00000000000..505c6a04a59 --- /dev/null +++ b/tests/baselines/reference/contextualTyping20.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/contextualTyping20.ts === +var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, {id:2, name:"foo"}]; +>foo : Symbol(foo, Decl(contextualTyping20.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping20.ts, 0, 9)) +>id : Symbol(id, Decl(contextualTyping20.ts, 0, 27)) +>foo : Symbol(foo, Decl(contextualTyping20.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping20.ts, 0, 43)) +>id : Symbol(id, Decl(contextualTyping20.ts, 0, 51)) +>name : Symbol(name, Decl(contextualTyping20.ts, 0, 56)) + diff --git a/tests/baselines/reference/contextualTyping20.types b/tests/baselines/reference/contextualTyping20.types index e233e745cc6..be863db836b 100644 --- a/tests/baselines/reference/contextualTyping20.types +++ b/tests/baselines/reference/contextualTyping20.types @@ -5,12 +5,16 @@ var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, {id:2, name:"foo"}]; >[{id:1}] : { id: number; }[] >{id:1} : { id: number; } >id : number +>1 : number >foo = [{id:1}, {id:2, name:"foo"}] : { id: number; }[] >foo : { id: number; }[] >[{id:1}, {id:2, name:"foo"}] : { id: number; }[] >{id:1} : { id: number; } >id : number +>1 : number >{id:2, name:"foo"} : { id: number; name: string; } >id : number +>2 : number >name : string +>"foo" : string diff --git a/tests/baselines/reference/contextualTyping22.symbols b/tests/baselines/reference/contextualTyping22.symbols new file mode 100644 index 00000000000..9a7817a8260 --- /dev/null +++ b/tests/baselines/reference/contextualTyping22.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/contextualTyping22.ts === +var foo:(a:number)=>number = function(a){return a}; foo = function(b){return b}; +>foo : Symbol(foo, Decl(contextualTyping22.ts, 0, 3)) +>a : Symbol(a, Decl(contextualTyping22.ts, 0, 9)) +>a : Symbol(a, Decl(contextualTyping22.ts, 0, 38)) +>a : Symbol(a, Decl(contextualTyping22.ts, 0, 38)) +>foo : Symbol(foo, Decl(contextualTyping22.ts, 0, 3)) +>b : Symbol(b, Decl(contextualTyping22.ts, 0, 67)) +>b : Symbol(b, Decl(contextualTyping22.ts, 0, 67)) + diff --git a/tests/baselines/reference/contextualTyping23.symbols b/tests/baselines/reference/contextualTyping23.symbols new file mode 100644 index 00000000000..bb0daeeee18 --- /dev/null +++ b/tests/baselines/reference/contextualTyping23.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/contextualTyping23.ts === +var foo:(a:{():number; (i:number):number; })=>number; foo = function(a){return 5}; +>foo : Symbol(foo, Decl(contextualTyping23.ts, 0, 3)) +>a : Symbol(a, Decl(contextualTyping23.ts, 0, 9)) +>i : Symbol(i, Decl(contextualTyping23.ts, 0, 24)) +>foo : Symbol(foo, Decl(contextualTyping23.ts, 0, 3)) +>a : Symbol(a, Decl(contextualTyping23.ts, 0, 69)) + diff --git a/tests/baselines/reference/contextualTyping23.types b/tests/baselines/reference/contextualTyping23.types index 7e0d86920ea..0bb8b7a58e7 100644 --- a/tests/baselines/reference/contextualTyping23.types +++ b/tests/baselines/reference/contextualTyping23.types @@ -7,4 +7,5 @@ var foo:(a:{():number; (i:number):number; })=>number; foo = function(a){return 5 >foo : (a: { (): number; (i: number): number; }) => number >function(a){return 5} : (a: { (): number; (i: number): number; }) => number >a : { (): number; (i: number): number; } +>5 : number diff --git a/tests/baselines/reference/contextualTyping25.symbols b/tests/baselines/reference/contextualTyping25.symbols new file mode 100644 index 00000000000..5446a3c7515 --- /dev/null +++ b/tests/baselines/reference/contextualTyping25.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/contextualTyping25.ts === +function foo(param:{id:number;}){}; foo(<{id:number;}>({})); +>foo : Symbol(foo, Decl(contextualTyping25.ts, 0, 0)) +>param : Symbol(param, Decl(contextualTyping25.ts, 0, 13)) +>id : Symbol(id, Decl(contextualTyping25.ts, 0, 20)) +>foo : Symbol(foo, Decl(contextualTyping25.ts, 0, 0)) +>id : Symbol(id, Decl(contextualTyping25.ts, 0, 42)) + diff --git a/tests/baselines/reference/contextualTyping26.symbols b/tests/baselines/reference/contextualTyping26.symbols new file mode 100644 index 00000000000..ccecd501837 --- /dev/null +++ b/tests/baselines/reference/contextualTyping26.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/contextualTyping26.ts === +function foo(param:{id:number;}){}; foo(<{id:number;}>({})); +>foo : Symbol(foo, Decl(contextualTyping26.ts, 0, 0)) +>param : Symbol(param, Decl(contextualTyping26.ts, 0, 13)) +>id : Symbol(id, Decl(contextualTyping26.ts, 0, 20)) +>foo : Symbol(foo, Decl(contextualTyping26.ts, 0, 0)) +>id : Symbol(id, Decl(contextualTyping26.ts, 0, 42)) + diff --git a/tests/baselines/reference/contextualTyping27.symbols b/tests/baselines/reference/contextualTyping27.symbols new file mode 100644 index 00000000000..0ff8486c1d9 --- /dev/null +++ b/tests/baselines/reference/contextualTyping27.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/contextualTyping27.ts === +function foo(param:{id:number;}){}; foo(<{id:number;}>({})); +>foo : Symbol(foo, Decl(contextualTyping27.ts, 0, 0)) +>param : Symbol(param, Decl(contextualTyping27.ts, 0, 13)) +>id : Symbol(id, Decl(contextualTyping27.ts, 0, 20)) +>foo : Symbol(foo, Decl(contextualTyping27.ts, 0, 0)) +>id : Symbol(id, Decl(contextualTyping27.ts, 0, 42)) + diff --git a/tests/baselines/reference/contextualTyping28.symbols b/tests/baselines/reference/contextualTyping28.symbols new file mode 100644 index 00000000000..5824da20a03 --- /dev/null +++ b/tests/baselines/reference/contextualTyping28.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/contextualTyping28.ts === +function foo(param:number[]){}; foo([1]); +>foo : Symbol(foo, Decl(contextualTyping28.ts, 0, 0)) +>param : Symbol(param, Decl(contextualTyping28.ts, 0, 13)) +>foo : Symbol(foo, Decl(contextualTyping28.ts, 0, 0)) + diff --git a/tests/baselines/reference/contextualTyping28.types b/tests/baselines/reference/contextualTyping28.types index 6019fde4a6b..e4833fd8838 100644 --- a/tests/baselines/reference/contextualTyping28.types +++ b/tests/baselines/reference/contextualTyping28.types @@ -5,4 +5,5 @@ function foo(param:number[]){}; foo([1]); >foo([1]) : void >foo : (param: number[]) => void >[1] : number[] +>1 : number diff --git a/tests/baselines/reference/contextualTyping29.symbols b/tests/baselines/reference/contextualTyping29.symbols new file mode 100644 index 00000000000..eb255bfd76b --- /dev/null +++ b/tests/baselines/reference/contextualTyping29.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/contextualTyping29.ts === +function foo(param:number[]){}; foo([1, 3]); +>foo : Symbol(foo, Decl(contextualTyping29.ts, 0, 0)) +>param : Symbol(param, Decl(contextualTyping29.ts, 0, 13)) +>foo : Symbol(foo, Decl(contextualTyping29.ts, 0, 0)) + diff --git a/tests/baselines/reference/contextualTyping29.types b/tests/baselines/reference/contextualTyping29.types index 9666e60e959..96695a6d0ba 100644 --- a/tests/baselines/reference/contextualTyping29.types +++ b/tests/baselines/reference/contextualTyping29.types @@ -5,4 +5,6 @@ function foo(param:number[]){}; foo([1, 3]); >foo([1, 3]) : void >foo : (param: number[]) => void >[1, 3] : number[] +>1 : number +>3 : number diff --git a/tests/baselines/reference/contextualTyping3.symbols b/tests/baselines/reference/contextualTyping3.symbols new file mode 100644 index 00000000000..584c399e4da --- /dev/null +++ b/tests/baselines/reference/contextualTyping3.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/contextualTyping3.ts === +class foo { public bar:{id:number;} = {id:5}; } +>foo : Symbol(foo, Decl(contextualTyping3.ts, 0, 0)) +>bar : Symbol(bar, Decl(contextualTyping3.ts, 0, 11)) +>id : Symbol(id, Decl(contextualTyping3.ts, 0, 24)) +>id : Symbol(id, Decl(contextualTyping3.ts, 0, 39)) + diff --git a/tests/baselines/reference/contextualTyping3.types b/tests/baselines/reference/contextualTyping3.types index ef00a78f5b4..81c201ee572 100644 --- a/tests/baselines/reference/contextualTyping3.types +++ b/tests/baselines/reference/contextualTyping3.types @@ -5,4 +5,5 @@ class foo { public bar:{id:number;} = {id:5}; } >id : number >{id:5} : { id: number; } >id : number +>5 : number diff --git a/tests/baselines/reference/contextualTyping31.symbols b/tests/baselines/reference/contextualTyping31.symbols new file mode 100644 index 00000000000..6891de8b49f --- /dev/null +++ b/tests/baselines/reference/contextualTyping31.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/contextualTyping31.ts === +function foo(param:number[]){}; foo([1]); +>foo : Symbol(foo, Decl(contextualTyping31.ts, 0, 0)) +>param : Symbol(param, Decl(contextualTyping31.ts, 0, 13)) +>foo : Symbol(foo, Decl(contextualTyping31.ts, 0, 0)) + diff --git a/tests/baselines/reference/contextualTyping31.types b/tests/baselines/reference/contextualTyping31.types index e37bacd33f3..22a8f08cf90 100644 --- a/tests/baselines/reference/contextualTyping31.types +++ b/tests/baselines/reference/contextualTyping31.types @@ -5,4 +5,5 @@ function foo(param:number[]){}; foo([1]); >foo([1]) : void >foo : (param: number[]) => void >[1] : number[] +>1 : number diff --git a/tests/baselines/reference/contextualTyping32.symbols b/tests/baselines/reference/contextualTyping32.symbols new file mode 100644 index 00000000000..f4ceeb93491 --- /dev/null +++ b/tests/baselines/reference/contextualTyping32.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/contextualTyping32.ts === +function foo(param: {():number; (i:number):number; }[]) { }; foo([function(){return 1;}, function(){return 4}]); +>foo : Symbol(foo, Decl(contextualTyping32.ts, 0, 0)) +>param : Symbol(param, Decl(contextualTyping32.ts, 0, 13)) +>i : Symbol(i, Decl(contextualTyping32.ts, 0, 33)) +>foo : Symbol(foo, Decl(contextualTyping32.ts, 0, 0)) + diff --git a/tests/baselines/reference/contextualTyping32.types b/tests/baselines/reference/contextualTyping32.types index c273be967e3..59f6040cf7f 100644 --- a/tests/baselines/reference/contextualTyping32.types +++ b/tests/baselines/reference/contextualTyping32.types @@ -7,5 +7,7 @@ function foo(param: {():number; (i:number):number; }[]) { }; foo([function(){ret >foo : (param: { (): number; (i: number): number; }[]) => void >[function(){return 1;}, function(){return 4}] : (() => number)[] >function(){return 1;} : () => number +>1 : number >function(){return 4} : () => number +>4 : number diff --git a/tests/baselines/reference/contextualTyping34.symbols b/tests/baselines/reference/contextualTyping34.symbols new file mode 100644 index 00000000000..6ea9f09f94b --- /dev/null +++ b/tests/baselines/reference/contextualTyping34.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/contextualTyping34.ts === +var foo = <{ id: number;}> ({id:4}); +>foo : Symbol(foo, Decl(contextualTyping34.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping34.ts, 0, 12)) +>id : Symbol(id, Decl(contextualTyping34.ts, 0, 29)) + diff --git a/tests/baselines/reference/contextualTyping34.types b/tests/baselines/reference/contextualTyping34.types index dde11b7d4b1..6bc6b622fc8 100644 --- a/tests/baselines/reference/contextualTyping34.types +++ b/tests/baselines/reference/contextualTyping34.types @@ -6,4 +6,5 @@ var foo = <{ id: number;}> ({id:4}); >({id:4}) : { id: number; } >{id:4} : { id: number; } >id : number +>4 : number diff --git a/tests/baselines/reference/contextualTyping35.symbols b/tests/baselines/reference/contextualTyping35.symbols new file mode 100644 index 00000000000..cb985100891 --- /dev/null +++ b/tests/baselines/reference/contextualTyping35.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/contextualTyping35.ts === +var foo = <{ id: number;}> {id:4, name: "as"}; +>foo : Symbol(foo, Decl(contextualTyping35.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping35.ts, 0, 12)) +>id : Symbol(id, Decl(contextualTyping35.ts, 0, 28)) +>name : Symbol(name, Decl(contextualTyping35.ts, 0, 33)) + diff --git a/tests/baselines/reference/contextualTyping35.types b/tests/baselines/reference/contextualTyping35.types index ea07f429176..08bb6b27b8e 100644 --- a/tests/baselines/reference/contextualTyping35.types +++ b/tests/baselines/reference/contextualTyping35.types @@ -5,5 +5,7 @@ var foo = <{ id: number;}> {id:4, name: "as"}; >id : number >{id:4, name: "as"} : { id: number; name: string; } >id : number +>4 : number >name : string +>"as" : string diff --git a/tests/baselines/reference/contextualTyping36.symbols b/tests/baselines/reference/contextualTyping36.symbols new file mode 100644 index 00000000000..28ceac9738c --- /dev/null +++ b/tests/baselines/reference/contextualTyping36.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/contextualTyping36.ts === +var foo = <{ id: number; }[]>[{ id: 4 }, <{ id: number; }>({ })]; +>foo : Symbol(foo, Decl(contextualTyping36.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping36.ts, 0, 12)) +>id : Symbol(id, Decl(contextualTyping36.ts, 0, 31)) +>id : Symbol(id, Decl(contextualTyping36.ts, 0, 43)) + diff --git a/tests/baselines/reference/contextualTyping36.types b/tests/baselines/reference/contextualTyping36.types index 8fb3f147f0a..6c93ed30a9f 100644 --- a/tests/baselines/reference/contextualTyping36.types +++ b/tests/baselines/reference/contextualTyping36.types @@ -6,6 +6,7 @@ var foo = <{ id: number; }[]>[{ id: 4 }, <{ id: number; }>({ })]; >[{ id: 4 }, <{ id: number; }>({ })] : { id: number; }[] >{ id: 4 } : { id: number; } >id : number +>4 : number ><{ id: number; }>({ }) : { id: number; } >id : number >({ }) : {} diff --git a/tests/baselines/reference/contextualTyping37.symbols b/tests/baselines/reference/contextualTyping37.symbols new file mode 100644 index 00000000000..083704750cb --- /dev/null +++ b/tests/baselines/reference/contextualTyping37.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/contextualTyping37.ts === +var foo = <{ id: number; }[]>[{ foo: "s" }, { }]; +>foo : Symbol(foo, Decl(contextualTyping37.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping37.ts, 0, 12)) +>foo : Symbol(foo, Decl(contextualTyping37.ts, 0, 31)) + diff --git a/tests/baselines/reference/contextualTyping37.types b/tests/baselines/reference/contextualTyping37.types index 2180e74b5a1..299b4400137 100644 --- a/tests/baselines/reference/contextualTyping37.types +++ b/tests/baselines/reference/contextualTyping37.types @@ -6,5 +6,6 @@ var foo = <{ id: number; }[]>[{ foo: "s" }, { }]; >[{ foo: "s" }, { }] : {}[] >{ foo: "s" } : { foo: string; } >foo : string +>"s" : string >{ } : {} diff --git a/tests/baselines/reference/contextualTyping38.symbols b/tests/baselines/reference/contextualTyping38.symbols new file mode 100644 index 00000000000..f208cad698a --- /dev/null +++ b/tests/baselines/reference/contextualTyping38.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/contextualTyping38.ts === +var foo = <{ (): number; }> function(a) { return a }; +>foo : Symbol(foo, Decl(contextualTyping38.ts, 0, 3)) +>a : Symbol(a, Decl(contextualTyping38.ts, 0, 37)) +>a : Symbol(a, Decl(contextualTyping38.ts, 0, 37)) + diff --git a/tests/baselines/reference/contextualTyping4.symbols b/tests/baselines/reference/contextualTyping4.symbols new file mode 100644 index 00000000000..c5dcd4f1577 --- /dev/null +++ b/tests/baselines/reference/contextualTyping4.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/contextualTyping4.ts === +class foo { public bar:{id:number;} = {id:5, name:"foo"}; } +>foo : Symbol(foo, Decl(contextualTyping4.ts, 0, 0)) +>bar : Symbol(bar, Decl(contextualTyping4.ts, 0, 11)) +>id : Symbol(id, Decl(contextualTyping4.ts, 0, 24)) +>id : Symbol(id, Decl(contextualTyping4.ts, 0, 39)) +>name : Symbol(name, Decl(contextualTyping4.ts, 0, 44)) + diff --git a/tests/baselines/reference/contextualTyping4.types b/tests/baselines/reference/contextualTyping4.types index 6af7adb86f3..757c67745f1 100644 --- a/tests/baselines/reference/contextualTyping4.types +++ b/tests/baselines/reference/contextualTyping4.types @@ -5,5 +5,7 @@ class foo { public bar:{id:number;} = {id:5, name:"foo"}; } >id : number >{id:5, name:"foo"} : { id: number; name: string; } >id : number +>5 : number >name : string +>"foo" : string diff --git a/tests/baselines/reference/contextualTyping40.symbols b/tests/baselines/reference/contextualTyping40.symbols new file mode 100644 index 00000000000..8606cdd4c41 --- /dev/null +++ b/tests/baselines/reference/contextualTyping40.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/contextualTyping40.ts === +var foo = <{():number; (i:number):number; }> function(){return 1;}; +>foo : Symbol(foo, Decl(contextualTyping40.ts, 0, 3)) +>i : Symbol(i, Decl(contextualTyping40.ts, 0, 24)) + diff --git a/tests/baselines/reference/contextualTyping40.types b/tests/baselines/reference/contextualTyping40.types index f659cdc8c92..1889d79f139 100644 --- a/tests/baselines/reference/contextualTyping40.types +++ b/tests/baselines/reference/contextualTyping40.types @@ -4,4 +4,5 @@ var foo = <{():number; (i:number):number; }> function(){return 1;}; ><{():number; (i:number):number; }> function(){return 1;} : { (): number; (i: number): number; } >i : number >function(){return 1;} : () => number +>1 : number diff --git a/tests/baselines/reference/contextualTyping6.symbols b/tests/baselines/reference/contextualTyping6.symbols new file mode 100644 index 00000000000..23af71d7dba --- /dev/null +++ b/tests/baselines/reference/contextualTyping6.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/contextualTyping6.ts === +var foo:{id:number;}[] = [{id:1}, {id:2}]; +>foo : Symbol(foo, Decl(contextualTyping6.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping6.ts, 0, 9)) +>id : Symbol(id, Decl(contextualTyping6.ts, 0, 27)) +>id : Symbol(id, Decl(contextualTyping6.ts, 0, 35)) + diff --git a/tests/baselines/reference/contextualTyping6.types b/tests/baselines/reference/contextualTyping6.types index ab63159924f..b79811a948a 100644 --- a/tests/baselines/reference/contextualTyping6.types +++ b/tests/baselines/reference/contextualTyping6.types @@ -5,6 +5,8 @@ var foo:{id:number;}[] = [{id:1}, {id:2}]; >[{id:1}, {id:2}] : { id: number; }[] >{id:1} : { id: number; } >id : number +>1 : number >{id:2} : { id: number; } >id : number +>2 : number diff --git a/tests/baselines/reference/contextualTyping7.symbols b/tests/baselines/reference/contextualTyping7.symbols new file mode 100644 index 00000000000..679c1945f33 --- /dev/null +++ b/tests/baselines/reference/contextualTyping7.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/contextualTyping7.ts === +var foo:{id:number;}[] = [<{id:number;}>({})]; +>foo : Symbol(foo, Decl(contextualTyping7.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping7.ts, 0, 9)) +>id : Symbol(id, Decl(contextualTyping7.ts, 0, 28)) + diff --git a/tests/baselines/reference/contextualTyping8.symbols b/tests/baselines/reference/contextualTyping8.symbols new file mode 100644 index 00000000000..7dadb937ea1 --- /dev/null +++ b/tests/baselines/reference/contextualTyping8.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/contextualTyping8.ts === +var foo:{id:number;}[] = [<{id:number;}>({})]; +>foo : Symbol(foo, Decl(contextualTyping8.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping8.ts, 0, 9)) +>id : Symbol(id, Decl(contextualTyping8.ts, 0, 28)) + diff --git a/tests/baselines/reference/contextualTyping9.symbols b/tests/baselines/reference/contextualTyping9.symbols new file mode 100644 index 00000000000..f9ef2220c20 --- /dev/null +++ b/tests/baselines/reference/contextualTyping9.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/contextualTyping9.ts === +var foo:{id:number;}[] = [{id:1}, {id:2, name:"foo"}]; +>foo : Symbol(foo, Decl(contextualTyping9.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping9.ts, 0, 9)) +>id : Symbol(id, Decl(contextualTyping9.ts, 0, 27)) +>id : Symbol(id, Decl(contextualTyping9.ts, 0, 35)) +>name : Symbol(name, Decl(contextualTyping9.ts, 0, 40)) + diff --git a/tests/baselines/reference/contextualTyping9.types b/tests/baselines/reference/contextualTyping9.types index 9d63203583d..46480d64b30 100644 --- a/tests/baselines/reference/contextualTyping9.types +++ b/tests/baselines/reference/contextualTyping9.types @@ -5,7 +5,10 @@ var foo:{id:number;}[] = [{id:1}, {id:2, name:"foo"}]; >[{id:1}, {id:2, name:"foo"}] : { id: number; }[] >{id:1} : { id: number; } >id : number +>1 : number >{id:2, name:"foo"} : { id: number; name: string; } >id : number +>2 : number >name : string +>"foo" : string diff --git a/tests/baselines/reference/contextualTypingArrayOfLambdas.symbols b/tests/baselines/reference/contextualTypingArrayOfLambdas.symbols new file mode 100644 index 00000000000..79355e0a7c6 --- /dev/null +++ b/tests/baselines/reference/contextualTypingArrayOfLambdas.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/contextualTypingArrayOfLambdas.ts === +class A { +>A : Symbol(A, Decl(contextualTypingArrayOfLambdas.ts, 0, 0)) + + foo: string; +>foo : Symbol(foo, Decl(contextualTypingArrayOfLambdas.ts, 0, 9)) +} + +class B extends A { +>B : Symbol(B, Decl(contextualTypingArrayOfLambdas.ts, 2, 1)) +>A : Symbol(A, Decl(contextualTypingArrayOfLambdas.ts, 0, 0)) + + bar: string; +>bar : Symbol(bar, Decl(contextualTypingArrayOfLambdas.ts, 4, 19)) +} + +class C extends A { +>C : Symbol(C, Decl(contextualTypingArrayOfLambdas.ts, 6, 1)) +>A : Symbol(A, Decl(contextualTypingArrayOfLambdas.ts, 0, 0)) + + baz: string; +>baz : Symbol(baz, Decl(contextualTypingArrayOfLambdas.ts, 8, 19)) +} + +var xs = [(x: A) => { }, (x: B) => { }, (x: C) => { }]; +>xs : Symbol(xs, Decl(contextualTypingArrayOfLambdas.ts, 12, 3)) +>x : Symbol(x, Decl(contextualTypingArrayOfLambdas.ts, 12, 11)) +>A : Symbol(A, Decl(contextualTypingArrayOfLambdas.ts, 0, 0)) +>x : Symbol(x, Decl(contextualTypingArrayOfLambdas.ts, 12, 26)) +>B : Symbol(B, Decl(contextualTypingArrayOfLambdas.ts, 2, 1)) +>x : Symbol(x, Decl(contextualTypingArrayOfLambdas.ts, 12, 41)) +>C : Symbol(C, Decl(contextualTypingArrayOfLambdas.ts, 6, 1)) + diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression.symbols b/tests/baselines/reference/contextualTypingOfConditionalExpression.symbols new file mode 100644 index 00000000000..56c3abe0627 --- /dev/null +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression.symbols @@ -0,0 +1,47 @@ +=== tests/cases/compiler/contextualTypingOfConditionalExpression.ts === +var x: (a: number) => void = true ? (a) => a.toExponential() : (b) => b.toFixed(); +>x : Symbol(x, Decl(contextualTypingOfConditionalExpression.ts, 0, 3)) +>a : Symbol(a, Decl(contextualTypingOfConditionalExpression.ts, 0, 8)) +>a : Symbol(a, Decl(contextualTypingOfConditionalExpression.ts, 0, 37)) +>a.toExponential : Symbol(Number.toExponential, Decl(lib.d.ts, 469, 45)) +>a : Symbol(a, Decl(contextualTypingOfConditionalExpression.ts, 0, 37)) +>toExponential : Symbol(Number.toExponential, Decl(lib.d.ts, 469, 45)) +>b : Symbol(b, Decl(contextualTypingOfConditionalExpression.ts, 0, 64)) +>b.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) +>b : Symbol(b, Decl(contextualTypingOfConditionalExpression.ts, 0, 64)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) + +class A { +>A : Symbol(A, Decl(contextualTypingOfConditionalExpression.ts, 0, 82)) + + foo: number; +>foo : Symbol(foo, Decl(contextualTypingOfConditionalExpression.ts, 2, 9)) +} +class B extends A { +>B : Symbol(B, Decl(contextualTypingOfConditionalExpression.ts, 4, 1)) +>A : Symbol(A, Decl(contextualTypingOfConditionalExpression.ts, 0, 82)) + + bar: number; +>bar : Symbol(bar, Decl(contextualTypingOfConditionalExpression.ts, 5, 19)) +} +class C extends A { +>C : Symbol(C, Decl(contextualTypingOfConditionalExpression.ts, 7, 1)) +>A : Symbol(A, Decl(contextualTypingOfConditionalExpression.ts, 0, 82)) + + baz: number; +>baz : Symbol(baz, Decl(contextualTypingOfConditionalExpression.ts, 8, 19)) +} + +var x2: (a: A) => void = true ? (a) => a.foo : (b) => b.foo; +>x2 : Symbol(x2, Decl(contextualTypingOfConditionalExpression.ts, 12, 3)) +>a : Symbol(a, Decl(contextualTypingOfConditionalExpression.ts, 12, 9)) +>A : Symbol(A, Decl(contextualTypingOfConditionalExpression.ts, 0, 82)) +>a : Symbol(a, Decl(contextualTypingOfConditionalExpression.ts, 12, 33)) +>a.foo : Symbol(A.foo, Decl(contextualTypingOfConditionalExpression.ts, 2, 9)) +>a : Symbol(a, Decl(contextualTypingOfConditionalExpression.ts, 12, 33)) +>foo : Symbol(A.foo, Decl(contextualTypingOfConditionalExpression.ts, 2, 9)) +>b : Symbol(b, Decl(contextualTypingOfConditionalExpression.ts, 12, 48)) +>b.foo : Symbol(A.foo, Decl(contextualTypingOfConditionalExpression.ts, 2, 9)) +>b : Symbol(b, Decl(contextualTypingOfConditionalExpression.ts, 12, 48)) +>foo : Symbol(A.foo, Decl(contextualTypingOfConditionalExpression.ts, 2, 9)) + diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression.types b/tests/baselines/reference/contextualTypingOfConditionalExpression.types index 2cd2b671b40..a2e29a0e66b 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression.types +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression.types @@ -3,6 +3,7 @@ var x: (a: number) => void = true ? (a) => a.toExponential() : (b) => b.toFixed( >x : (a: number) => void >a : number >true ? (a) => a.toExponential() : (b) => b.toFixed() : (a: number) => string +>true : boolean >(a) => a.toExponential() : (a: number) => string >a : number >a.toExponential() : string @@ -42,6 +43,7 @@ var x2: (a: A) => void = true ? (a) => a.foo : (b) => b.foo; >a : A >A : A >true ? (a) => a.foo : (b) => b.foo : (a: A) => number +>true : boolean >(a) => a.foo : (a: A) => number >a : A >a.foo : number diff --git a/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures.symbols b/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures.symbols new file mode 100644 index 00000000000..3a0c8e5db97 --- /dev/null +++ b/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/contextualTypingOfLambdaWithMultipleSignatures.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 0, 0)) + + getFoo(n: number): void; +>getFoo : Symbol(getFoo, Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 0, 15), Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 1, 28)) +>n : Symbol(n, Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 1, 11)) + + getFoo(s: string): void; +>getFoo : Symbol(getFoo, Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 0, 15), Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 1, 28)) +>s : Symbol(s, Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 2, 11)) +} + +var foo: Foo; +>foo : Symbol(foo, Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 5, 3)) +>Foo : Symbol(Foo, Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 0, 0)) + +foo.getFoo = bar => { }; +>foo.getFoo : Symbol(Foo.getFoo, Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 0, 15), Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 1, 28)) +>foo : Symbol(foo, Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 5, 3)) +>getFoo : Symbol(Foo.getFoo, Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 0, 15), Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 1, 28)) +>bar : Symbol(bar, Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 6, 12)) + diff --git a/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures2.symbols b/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures2.symbols new file mode 100644 index 00000000000..f44d33e1ba8 --- /dev/null +++ b/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures2.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/contextualTypingOfLambdaWithMultipleSignatures2.ts === +var f: { +>f : Symbol(f, Decl(contextualTypingOfLambdaWithMultipleSignatures2.ts, 0, 3)) + + (x: string): string; +>x : Symbol(x, Decl(contextualTypingOfLambdaWithMultipleSignatures2.ts, 1, 5)) + + (x: number): string +>x : Symbol(x, Decl(contextualTypingOfLambdaWithMultipleSignatures2.ts, 2, 5)) + +}; + +f = (a) => { return a.asdf } +>f : Symbol(f, Decl(contextualTypingOfLambdaWithMultipleSignatures2.ts, 0, 3)) +>a : Symbol(a, Decl(contextualTypingOfLambdaWithMultipleSignatures2.ts, 5, 5)) +>a : Symbol(a, Decl(contextualTypingOfLambdaWithMultipleSignatures2.ts, 5, 5)) + diff --git a/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.symbols b/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.symbols new file mode 100644 index 00000000000..62870f575c7 --- /dev/null +++ b/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/contextualTypingTwoInstancesOfSameTypeParameter.ts === +function f6(x: (a: T) => T) { +>f6 : Symbol(f6, Decl(contextualTypingTwoInstancesOfSameTypeParameter.ts, 0, 0)) +>T : Symbol(T, Decl(contextualTypingTwoInstancesOfSameTypeParameter.ts, 0, 12)) +>x : Symbol(x, Decl(contextualTypingTwoInstancesOfSameTypeParameter.ts, 0, 15)) +>a : Symbol(a, Decl(contextualTypingTwoInstancesOfSameTypeParameter.ts, 0, 19)) +>T : Symbol(T, Decl(contextualTypingTwoInstancesOfSameTypeParameter.ts, 0, 12)) +>T : Symbol(T, Decl(contextualTypingTwoInstancesOfSameTypeParameter.ts, 0, 12)) + + return null; +} +f6(x => f6(y => x = y)); +>f6 : Symbol(f6, Decl(contextualTypingTwoInstancesOfSameTypeParameter.ts, 0, 0)) +>x : Symbol(x, Decl(contextualTypingTwoInstancesOfSameTypeParameter.ts, 3, 3)) +>f6 : Symbol(f6, Decl(contextualTypingTwoInstancesOfSameTypeParameter.ts, 0, 0)) +>y : Symbol(y, Decl(contextualTypingTwoInstancesOfSameTypeParameter.ts, 3, 11)) +>x : Symbol(x, Decl(contextualTypingTwoInstancesOfSameTypeParameter.ts, 3, 3)) +>y : Symbol(y, Decl(contextualTypingTwoInstancesOfSameTypeParameter.ts, 3, 11)) + diff --git a/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.types b/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.types index 0e5c25a9282..264735a995a 100644 --- a/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.types +++ b/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.types @@ -8,6 +8,7 @@ function f6(x: (a: T) => T) { >T : T return null; +>null : null } f6(x => f6(y => x = y)); >f6(x => f6(y => x = y)) : any diff --git a/tests/baselines/reference/contextualTypingWithGenericAndNonGenericSignature.symbols b/tests/baselines/reference/contextualTypingWithGenericAndNonGenericSignature.symbols new file mode 100644 index 00000000000..d7ba6f0ddc3 --- /dev/null +++ b/tests/baselines/reference/contextualTypingWithGenericAndNonGenericSignature.symbols @@ -0,0 +1,51 @@ +=== tests/cases/compiler/contextualTypingWithGenericAndNonGenericSignature.ts === +//• 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 : Symbol(f2, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 2, 3)) + + (x: string, y: number): string; +>x : Symbol(x, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 3, 5)) +>y : Symbol(y, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 3, 15)) + + (x: T, y: U): T +>T : Symbol(T, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 4, 5)) +>U : Symbol(U, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 4, 7)) +>x : Symbol(x, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 4, 11)) +>T : Symbol(T, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 4, 5)) +>y : Symbol(y, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 4, 16)) +>U : Symbol(U, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 4, 7)) +>T : Symbol(T, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 4, 5)) + +}; + +f2 = (x, y) => { return x } +>f2 : Symbol(f2, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 2, 3)) +>x : Symbol(x, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 7, 6)) +>y : Symbol(y, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 7, 8)) +>x : Symbol(x, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 7, 6)) + +var f3: { +>f3 : Symbol(f3, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 9, 3)) + + (x: T, y: U): T +>T : Symbol(T, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 10, 5)) +>U : Symbol(U, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 10, 7)) +>x : Symbol(x, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 10, 11)) +>T : Symbol(T, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 10, 5)) +>y : Symbol(y, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 10, 16)) +>U : Symbol(U, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 10, 7)) +>T : Symbol(T, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 10, 5)) + + (x: string, y: number): string; +>x : Symbol(x, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 11, 5)) +>y : Symbol(y, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 11, 15)) + +}; + +f3 = (x, y) => { return x } +>f3 : Symbol(f3, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 9, 3)) +>x : Symbol(x, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 14, 6)) +>y : Symbol(y, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 14, 8)) +>x : Symbol(x, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 14, 6)) + diff --git a/tests/baselines/reference/contextualTypingWithGenericSignature.symbols b/tests/baselines/reference/contextualTypingWithGenericSignature.symbols new file mode 100644 index 00000000000..c416a5ca19f --- /dev/null +++ b/tests/baselines/reference/contextualTypingWithGenericSignature.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/contextualTypingWithGenericSignature.ts === +// 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 : Symbol(f2, Decl(contextualTypingWithGenericSignature.ts, 2, 3)) + + (x: T, y: U): T +>T : Symbol(T, Decl(contextualTypingWithGenericSignature.ts, 3, 5)) +>U : Symbol(U, Decl(contextualTypingWithGenericSignature.ts, 3, 7)) +>x : Symbol(x, Decl(contextualTypingWithGenericSignature.ts, 3, 11)) +>T : Symbol(T, Decl(contextualTypingWithGenericSignature.ts, 3, 5)) +>y : Symbol(y, Decl(contextualTypingWithGenericSignature.ts, 3, 16)) +>U : Symbol(U, Decl(contextualTypingWithGenericSignature.ts, 3, 7)) +>T : Symbol(T, Decl(contextualTypingWithGenericSignature.ts, 3, 5)) + +}; + +f2 = (x, y) => { return x } +>f2 : Symbol(f2, Decl(contextualTypingWithGenericSignature.ts, 2, 3)) +>x : Symbol(x, Decl(contextualTypingWithGenericSignature.ts, 6, 6)) +>y : Symbol(y, Decl(contextualTypingWithGenericSignature.ts, 6, 8)) +>x : Symbol(x, Decl(contextualTypingWithGenericSignature.ts, 6, 6)) + diff --git a/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.symbols b/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.symbols new file mode 100644 index 00000000000..810f407e1b2 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.symbols @@ -0,0 +1,38 @@ +=== tests/cases/conformance/expressions/functions/contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts === +declare function foo(x: (y: string) => (y2: number) => void); +>foo : Symbol(foo, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 0, 0)) +>x : Symbol(x, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 0, 21)) +>y : Symbol(y, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 0, 25)) +>y2 : Symbol(y2, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 0, 40)) + +// Contextually type the parameter even if there is a return annotation +foo((y): (y2: number) => void => { +>foo : Symbol(foo, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 0, 0)) +>y : Symbol(y, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 3, 5)) +>y2 : Symbol(y2, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 3, 10)) + + var z = y.charAt(0); // Should be string +>z : Symbol(z, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 4, 7)) +>y.charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>y : Symbol(y, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 3, 5)) +>charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) + + return null; +}); + +foo((y: string) => { +>foo : Symbol(foo, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 0, 0)) +>y : Symbol(y, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 8, 5)) + + return y2 => { +>y2 : Symbol(y2, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 9, 10)) + + var z = y2.toFixed(); // Should be string +>z : Symbol(z, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 10, 11)) +>y2.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) +>y2 : Symbol(y2, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 9, 10)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) + + return 0; + }; +}); diff --git a/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.types b/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.types index 09c317c64a0..94b184f65da 100644 --- a/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.types +++ b/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.types @@ -19,8 +19,11 @@ foo((y): (y2: number) => void => { >y.charAt : (pos: number) => string >y : string >charAt : (pos: number) => string +>0 : number return null; +>null : null + }); foo((y: string) => { @@ -41,5 +44,7 @@ foo((y: string) => { >toFixed : (fractionDigits?: number) => string return 0; +>0 : number + }; }); diff --git a/tests/baselines/reference/contextuallyTypingOrOperator.symbols b/tests/baselines/reference/contextuallyTypingOrOperator.symbols new file mode 100644 index 00000000000..18019aea7cb --- /dev/null +++ b/tests/baselines/reference/contextuallyTypingOrOperator.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/contextuallyTypingOrOperator.ts === +var v: { a: (_: string) => number } = { a: s => s.length } || { a: s => 1 }; +>v : Symbol(v, Decl(contextuallyTypingOrOperator.ts, 0, 3)) +>a : Symbol(a, Decl(contextuallyTypingOrOperator.ts, 0, 8)) +>_ : Symbol(_, Decl(contextuallyTypingOrOperator.ts, 0, 13)) +>a : Symbol(a, Decl(contextuallyTypingOrOperator.ts, 0, 39)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator.ts, 0, 42)) +>s.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator.ts, 0, 42)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>a : Symbol(a, Decl(contextuallyTypingOrOperator.ts, 0, 63)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator.ts, 0, 66)) + +var v2 = (s: string) => s.length || function (s) { s.length }; +>v2 : Symbol(v2, Decl(contextuallyTypingOrOperator.ts, 2, 3)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator.ts, 2, 10)) +>s.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator.ts, 2, 10)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator.ts, 2, 46)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator.ts, 2, 46)) + +var v3 = (s: string) => s.length || function (s: number) { return 1 }; +>v3 : Symbol(v3, Decl(contextuallyTypingOrOperator.ts, 4, 3)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator.ts, 4, 10)) +>s.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator.ts, 4, 10)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator.ts, 4, 46)) + +var v4 = (s: number) => 1 || function (s: string) { return s.length }; +>v4 : Symbol(v4, Decl(contextuallyTypingOrOperator.ts, 5, 3)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator.ts, 5, 10)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator.ts, 5, 39)) +>s.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator.ts, 5, 39)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + diff --git a/tests/baselines/reference/contextuallyTypingOrOperator.types b/tests/baselines/reference/contextuallyTypingOrOperator.types index 47b78f5691d..676ad04bfa9 100644 --- a/tests/baselines/reference/contextuallyTypingOrOperator.types +++ b/tests/baselines/reference/contextuallyTypingOrOperator.types @@ -15,6 +15,7 @@ var v: { a: (_: string) => number } = { a: s => s.length } || { a: s => 1 }; >a : (s: string) => number >s => 1 : (s: string) => number >s : string +>1 : number var v2 = (s: string) => s.length || function (s) { s.length }; >v2 : (s: string) => number | ((s: any) => void) @@ -40,12 +41,14 @@ var v3 = (s: string) => s.length || function (s: number) { return 1 }; >length : number >function (s: number) { return 1 } : (s: number) => number >s : number +>1 : number var v4 = (s: number) => 1 || function (s: string) { return s.length }; >v4 : (s: number) => number | ((s: string) => number) >(s: number) => 1 || function (s: string) { return s.length } : (s: number) => number | ((s: string) => number) >s : number >1 || function (s: string) { return s.length } : number | ((s: string) => number) +>1 : number >function (s: string) { return s.length } : (s: string) => number >s : string >s.length : number diff --git a/tests/baselines/reference/contextuallyTypingOrOperator2.symbols b/tests/baselines/reference/contextuallyTypingOrOperator2.symbols new file mode 100644 index 00000000000..99e328fd64a --- /dev/null +++ b/tests/baselines/reference/contextuallyTypingOrOperator2.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/contextuallyTypingOrOperator2.ts === +var v: { a: (_: string) => number } = { a: s => s.length } || { a: s => 1 }; +>v : Symbol(v, Decl(contextuallyTypingOrOperator2.ts, 0, 3)) +>a : Symbol(a, Decl(contextuallyTypingOrOperator2.ts, 0, 8)) +>_ : Symbol(_, Decl(contextuallyTypingOrOperator2.ts, 0, 13)) +>a : Symbol(a, Decl(contextuallyTypingOrOperator2.ts, 0, 39)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator2.ts, 0, 42)) +>s.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator2.ts, 0, 42)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>a : Symbol(a, Decl(contextuallyTypingOrOperator2.ts, 0, 63)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator2.ts, 0, 66)) + +var v2 = (s: string) => s.length || function (s) { s.aaa }; +>v2 : Symbol(v2, Decl(contextuallyTypingOrOperator2.ts, 2, 3)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator2.ts, 2, 10)) +>s.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator2.ts, 2, 10)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator2.ts, 2, 46)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator2.ts, 2, 46)) + diff --git a/tests/baselines/reference/contextuallyTypingOrOperator2.types b/tests/baselines/reference/contextuallyTypingOrOperator2.types index 65ed442d5e9..2a73ccc9c9d 100644 --- a/tests/baselines/reference/contextuallyTypingOrOperator2.types +++ b/tests/baselines/reference/contextuallyTypingOrOperator2.types @@ -15,6 +15,7 @@ var v: { a: (_: string) => number } = { a: s => s.length } || { a: s => 1 }; >a : (s: string) => number >s => 1 : (s: string) => number >s : string +>1 : number var v2 = (s: string) => s.length || function (s) { s.aaa }; >v2 : (s: string) => number | ((s: any) => void) diff --git a/tests/baselines/reference/continueInIterationStatement1.symbols b/tests/baselines/reference/continueInIterationStatement1.symbols new file mode 100644 index 00000000000..210de69f6bb --- /dev/null +++ b/tests/baselines/reference/continueInIterationStatement1.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/continueInIterationStatement1.ts === +while (true) { +No type information for this code. continue; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/continueInIterationStatement1.types b/tests/baselines/reference/continueInIterationStatement1.types index 210de69f6bb..4fcf3794844 100644 --- a/tests/baselines/reference/continueInIterationStatement1.types +++ b/tests/baselines/reference/continueInIterationStatement1.types @@ -1,5 +1,6 @@ === tests/cases/compiler/continueInIterationStatement1.ts === while (true) { -No type information for this code. continue; -No type information for this code.} -No type information for this code. \ No newline at end of file +>true : boolean + + continue; +} diff --git a/tests/baselines/reference/continueInIterationStatement2.symbols b/tests/baselines/reference/continueInIterationStatement2.symbols new file mode 100644 index 00000000000..5cb4b62f39a --- /dev/null +++ b/tests/baselines/reference/continueInIterationStatement2.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/continueInIterationStatement2.ts === +do { +No type information for this code. continue; +No type information for this code.} +No type information for this code.while (true); +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/continueInIterationStatement2.types b/tests/baselines/reference/continueInIterationStatement2.types index 5cb4b62f39a..4a3d50c7501 100644 --- a/tests/baselines/reference/continueInIterationStatement2.types +++ b/tests/baselines/reference/continueInIterationStatement2.types @@ -1,6 +1,7 @@ === tests/cases/compiler/continueInIterationStatement2.ts === do { -No type information for this code. continue; -No type information for this code.} -No type information for this code.while (true); -No type information for this code. \ No newline at end of file + continue; +} +while (true); +>true : boolean + diff --git a/tests/baselines/reference/continueInIterationStatement3.symbols b/tests/baselines/reference/continueInIterationStatement3.symbols new file mode 100644 index 00000000000..f4df3a295fb --- /dev/null +++ b/tests/baselines/reference/continueInIterationStatement3.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/continueInIterationStatement3.ts === +for (;;) { +No type information for this code. continue; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/continueLabel.symbols b/tests/baselines/reference/continueLabel.symbols new file mode 100644 index 00000000000..d6bf335185a --- /dev/null +++ b/tests/baselines/reference/continueLabel.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/continueLabel.ts === +label1: for(var i = 0; i < 1; i++) { +>i : Symbol(i, Decl(continueLabel.ts, 0, 15)) +>i : Symbol(i, Decl(continueLabel.ts, 0, 15)) +>i : Symbol(i, Decl(continueLabel.ts, 0, 15)) + + continue label1; +} diff --git a/tests/baselines/reference/continueLabel.types b/tests/baselines/reference/continueLabel.types index 79c5381f08a..a25f3311607 100644 --- a/tests/baselines/reference/continueLabel.types +++ b/tests/baselines/reference/continueLabel.types @@ -1,10 +1,14 @@ === tests/cases/compiler/continueLabel.ts === label1: for(var i = 0; i < 1; i++) { +>label1 : any >i : number +>0 : number >i < 1 : boolean >i : number +>1 : number >i++ : number >i : number continue label1; +>label1 : any } diff --git a/tests/baselines/reference/continueTarget2.symbols b/tests/baselines/reference/continueTarget2.symbols new file mode 100644 index 00000000000..16f45c402cd --- /dev/null +++ b/tests/baselines/reference/continueTarget2.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/continueTarget2.ts === +target: +No type information for this code.while (true) { +No type information for this code. continue target; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/continueTarget2.types b/tests/baselines/reference/continueTarget2.types index 16f45c402cd..1e9a2325642 100644 --- a/tests/baselines/reference/continueTarget2.types +++ b/tests/baselines/reference/continueTarget2.types @@ -1,6 +1,10 @@ === tests/cases/compiler/continueTarget2.ts === target: -No type information for this code.while (true) { -No type information for this code. continue target; -No type information for this code.} -No type information for this code. \ No newline at end of file +>target : any + +while (true) { +>true : boolean + + continue target; +>target : any +} diff --git a/tests/baselines/reference/continueTarget3.symbols b/tests/baselines/reference/continueTarget3.symbols new file mode 100644 index 00000000000..a1b930f2f5a --- /dev/null +++ b/tests/baselines/reference/continueTarget3.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/continueTarget3.ts === +target1: +No type information for this code.target2: +No type information for this code.while (true) { +No type information for this code. continue target1; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/continueTarget3.types b/tests/baselines/reference/continueTarget3.types index a1b930f2f5a..3336b47772c 100644 --- a/tests/baselines/reference/continueTarget3.types +++ b/tests/baselines/reference/continueTarget3.types @@ -1,7 +1,13 @@ === tests/cases/compiler/continueTarget3.ts === target1: -No type information for this code.target2: -No type information for this code.while (true) { -No type information for this code. continue target1; -No type information for this code.} -No type information for this code. \ No newline at end of file +>target1 : any + +target2: +>target2 : any + +while (true) { +>true : boolean + + continue target1; +>target1 : any +} diff --git a/tests/baselines/reference/continueTarget4.symbols b/tests/baselines/reference/continueTarget4.symbols new file mode 100644 index 00000000000..ea1989a3e4d --- /dev/null +++ b/tests/baselines/reference/continueTarget4.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/continueTarget4.ts === +target1: +No type information for this code.target2: +No type information for this code.while (true) { +No type information for this code. continue target2; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/continueTarget4.types b/tests/baselines/reference/continueTarget4.types index ea1989a3e4d..5d2b7c29bbe 100644 --- a/tests/baselines/reference/continueTarget4.types +++ b/tests/baselines/reference/continueTarget4.types @@ -1,7 +1,13 @@ === tests/cases/compiler/continueTarget4.ts === target1: -No type information for this code.target2: -No type information for this code.while (true) { -No type information for this code. continue target2; -No type information for this code.} -No type information for this code. \ No newline at end of file +>target1 : any + +target2: +>target2 : any + +while (true) { +>true : boolean + + continue target2; +>target2 : any +} diff --git a/tests/baselines/reference/convertKeywords.symbols b/tests/baselines/reference/convertKeywords.symbols new file mode 100644 index 00000000000..e2d5668bf1d --- /dev/null +++ b/tests/baselines/reference/convertKeywords.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/convertKeywords.ts === +var abstract; +>abstract : Symbol(abstract, Decl(convertKeywords.ts, 0, 3)) + + + diff --git a/tests/baselines/reference/convertKeywordsYes.errors.txt b/tests/baselines/reference/convertKeywordsYes.errors.txt index 932fda09be8..7218e1fd12c 100644 --- a/tests/baselines/reference/convertKeywordsYes.errors.txt +++ b/tests/baselines/reference/convertKeywordsYes.errors.txt @@ -1,21 +1,15 @@ -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(292,11): error TS1213: Identifier expected. 'implements' is a reserved word in strict mode. Class definitions are automatically in strict mode. +tests/cases/compiler/convertKeywordsYes.ts(293,11): error TS1213: Identifier expected. 'interface' is a reserved word in strict mode. Class definitions are automatically in strict mode. +tests/cases/compiler/convertKeywordsYes.ts(294,11): error TS1213: Identifier expected. 'let' is a reserved word in strict mode. Class definitions are automatically in strict mode. +tests/cases/compiler/convertKeywordsYes.ts(296,11): error TS1213: Identifier expected. 'package' is a reserved word in strict mode. Class definitions are automatically in strict mode. +tests/cases/compiler/convertKeywordsYes.ts(297,11): error TS1213: Identifier expected. 'private' is a reserved word in strict mode. Class definitions are automatically in strict mode. +tests/cases/compiler/convertKeywordsYes.ts(298,11): error TS1213: Identifier expected. 'protected' is a reserved word in strict mode. Class definitions are automatically in strict mode. +tests/cases/compiler/convertKeywordsYes.ts(299,11): error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode. +tests/cases/compiler/convertKeywordsYes.ts(301,11): error TS1213: Identifier expected. 'static' is a reserved word in strict mode. Class definitions are automatically in strict mode. +tests/cases/compiler/convertKeywordsYes.ts(303,11): error TS1213: Identifier expected. 'yield' is a reserved word in strict mode. Class definitions are automatically in strict mode. -==== tests/cases/compiler/convertKeywordsYes.ts (15 errors) ==== +==== tests/cases/compiler/convertKeywordsYes.ts (9 errors) ==== // reserved ES5 future in strict mode var constructor = 0; @@ -308,46 +302,34 @@ tests/cases/compiler/convertKeywordsYes.ts(303,17): error TS1005: ';' expected. module bigModule { class constructor { } class implements { } + ~~~~~~~~~~ +!!! error TS1213: Identifier expected. 'implements' is a reserved word in strict mode. Class definitions are automatically in strict mode. class interface { } ~~~~~~~~~ -!!! error TS1005: '{' expected. - ~ -!!! error TS1005: ';' expected. +!!! error TS1213: Identifier expected. 'interface' is a reserved word in strict mode. Class definitions are automatically in strict mode. class let { } ~~~ -!!! error TS1005: '{' expected. +!!! error TS1213: Identifier expected. 'let' is a reserved word in strict mode. Class definitions are automatically in strict mode. class module { } class package { } ~~~~~~~ -!!! error TS1005: '{' expected. - ~ -!!! error TS1005: ';' expected. +!!! error TS1213: Identifier expected. 'package' is a reserved word in strict mode. Class definitions are automatically in strict mode. class private { } ~~~~~~~ -!!! error TS1005: '{' expected. - ~ -!!! error TS1005: ';' expected. +!!! error TS1213: Identifier expected. 'private' is a reserved word in strict mode. Class definitions are automatically in strict mode. class protected { } ~~~~~~~~~ -!!! error TS1005: '{' expected. - ~ -!!! error TS1005: ';' expected. +!!! error TS1213: Identifier expected. 'protected' is a reserved word in strict mode. Class definitions are automatically in strict mode. class public { } ~~~~~~ -!!! error TS1005: '{' expected. - ~ -!!! error TS1005: ';' expected. +!!! error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode. class set { } class static { } ~~~~~~ -!!! error TS1005: '{' expected. - ~ -!!! error TS1005: ';' expected. +!!! error TS1213: Identifier expected. 'static' is a reserved word in strict mode. Class definitions are automatically in strict mode. class get { } class yield { } ~~~~~ -!!! error TS1005: '{' expected. - ~ -!!! error TS1005: ';' expected. +!!! error TS1213: Identifier expected. 'yield' is a reserved word in strict mode. Class definitions are automatically in strict mode. class declare { } } \ No newline at end of file diff --git a/tests/baselines/reference/convertKeywordsYes.js b/tests/baselines/reference/convertKeywordsYes.js index 2b17e744b66..a68f751f434 100644 --- a/tests/baselines/reference/convertKeywordsYes.js +++ b/tests/baselines/reference/convertKeywordsYes.js @@ -505,81 +505,66 @@ var bigModule; } return constructor; })(); - var default_1 = (function () { - function default_1() { + var implements = (function () { + function implements() { } - return default_1; + return implements; })(); - var default_2 = (function () { - function default_2() { + var interface = (function () { + function interface() { } - return default_2; + return interface; })(); - interface; - { } - var default_3 = (function () { - function default_3() { + var let = (function () { + function let() { } - return default_3; + return let; })(); - var _a = void 0; var module = (function () { function module() { } return module; })(); - var default_4 = (function () { - function default_4() { + var package = (function () { + function package() { } - return default_4; + return package; })(); - package; - { } - var default_5 = (function () { - function default_5() { + var private = (function () { + function private() { } - return default_5; + return private; })(); - private; - { } - var default_6 = (function () { - function default_6() { + var protected = (function () { + function protected() { } - return default_6; + return protected; })(); - protected; - { } - var default_7 = (function () { - function default_7() { + var public = (function () { + function public() { } - return default_7; + return public; })(); - public; - { } var set = (function () { function set() { } return set; })(); - var default_8 = (function () { - function default_8() { + var static = (function () { + function static() { } - return default_8; + return static; })(); - static; - { } var get = (function () { function get() { } return get; })(); - var default_9 = (function () { - function default_9() { + var yield = (function () { + function yield() { } - return default_9; + return yield; })(); - yield; - { } var declare = (function () { function declare() { } diff --git a/tests/baselines/reference/covariance1.symbols b/tests/baselines/reference/covariance1.symbols new file mode 100644 index 00000000000..db055e20bc6 --- /dev/null +++ b/tests/baselines/reference/covariance1.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/covariance1.ts === +module M { +>M : Symbol(M, Decl(covariance1.ts, 0, 0)) + + interface X { m1:number; } +>X : Symbol(X, Decl(covariance1.ts, 0, 10)) +>m1 : Symbol(m1, Decl(covariance1.ts, 2, 17)) + + export class XX implements X { constructor(public m1:number) { } } +>XX : Symbol(XX, Decl(covariance1.ts, 2, 30)) +>X : Symbol(X, Decl(covariance1.ts, 0, 10)) +>m1 : Symbol(m1, Decl(covariance1.ts, 3, 47)) + + interface Y { x:X; } +>Y : Symbol(Y, Decl(covariance1.ts, 3, 70)) +>x : Symbol(x, Decl(covariance1.ts, 5, 17)) +>X : Symbol(X, Decl(covariance1.ts, 0, 10)) + + export function f(y:Y) { } +>f : Symbol(f, Decl(covariance1.ts, 5, 24)) +>y : Symbol(y, Decl(covariance1.ts, 7, 22)) +>Y : Symbol(Y, Decl(covariance1.ts, 3, 70)) + + var a:X; +>a : Symbol(a, Decl(covariance1.ts, 9, 7)) +>X : Symbol(X, Decl(covariance1.ts, 0, 10)) + + f({x:a}); // ok +>f : Symbol(f, Decl(covariance1.ts, 5, 24)) +>x : Symbol(x, Decl(covariance1.ts, 10, 7)) +>a : Symbol(a, Decl(covariance1.ts, 9, 7)) + + var b:XX; +>b : Symbol(b, Decl(covariance1.ts, 12, 7)) +>XX : Symbol(XX, Decl(covariance1.ts, 2, 30)) + + f({x:b}); // ok covariant subtype +>f : Symbol(f, Decl(covariance1.ts, 5, 24)) +>x : Symbol(x, Decl(covariance1.ts, 13, 7)) +>b : Symbol(b, Decl(covariance1.ts, 12, 7)) +} + + diff --git a/tests/baselines/reference/crashInResolveInterface.symbols b/tests/baselines/reference/crashInResolveInterface.symbols new file mode 100644 index 00000000000..c10bf0b26a8 --- /dev/null +++ b/tests/baselines/reference/crashInResolveInterface.symbols @@ -0,0 +1,50 @@ +=== tests/cases/compiler/file2.ts === +/// +declare var c: C; +>c : Symbol(c, Decl(file2.ts, 1, 11)) +>C : Symbol(C, Decl(file2.ts, 1, 17), Decl(file2.ts, 4, 1)) + +interface C { +>C : Symbol(C, Decl(file2.ts, 1, 17), Decl(file2.ts, 4, 1)) + + count(countTitle?: string): void; +>count : Symbol(count, Decl(file2.ts, 2, 13)) +>countTitle : Symbol(countTitle, Decl(file2.ts, 3, 10)) +} +interface C { +>C : Symbol(C, Decl(file2.ts, 1, 17), Decl(file2.ts, 4, 1)) + + log(message?: any, ...optionalParams: any[]): void; +>log : Symbol(log, Decl(file2.ts, 5, 13)) +>message : Symbol(message, Decl(file2.ts, 6, 8)) +>optionalParams : Symbol(optionalParams, Decl(file2.ts, 6, 22)) +} + +=== tests/cases/compiler/file1.ts === +interface Q { +>Q : Symbol(Q, Decl(file1.ts, 0, 0)) +>T : Symbol(T, Decl(file1.ts, 0, 12)) + + each(action: (item: T, index: number) => void): void; +>each : Symbol(each, Decl(file1.ts, 0, 16)) +>action : Symbol(action, Decl(file1.ts, 1, 9)) +>item : Symbol(item, Decl(file1.ts, 1, 18)) +>T : Symbol(T, Decl(file1.ts, 0, 12)) +>index : Symbol(index, Decl(file1.ts, 1, 26)) +} +var q1: Q<{ a: number; }>; +>q1 : Symbol(q1, Decl(file1.ts, 3, 3)) +>Q : Symbol(Q, Decl(file1.ts, 0, 0)) +>a : Symbol(a, Decl(file1.ts, 3, 11)) + +var x = q1.each(x => c.log(x)); +>x : Symbol(x, Decl(file1.ts, 4, 3)) +>q1.each : Symbol(Q.each, Decl(file1.ts, 0, 16)) +>q1 : Symbol(q1, Decl(file1.ts, 3, 3)) +>each : Symbol(Q.each, Decl(file1.ts, 0, 16)) +>x : Symbol(x, Decl(file1.ts, 4, 16)) +>c.log : Symbol(C.log, Decl(file2.ts, 5, 13)) +>c : Symbol(c, Decl(file2.ts, 1, 11)) +>log : Symbol(C.log, Decl(file2.ts, 5, 13)) +>x : Symbol(x, Decl(file1.ts, 4, 16)) + diff --git a/tests/baselines/reference/crashInresolveReturnStatement.symbols b/tests/baselines/reference/crashInresolveReturnStatement.symbols new file mode 100644 index 00000000000..359a62c7842 --- /dev/null +++ b/tests/baselines/reference/crashInresolveReturnStatement.symbols @@ -0,0 +1,40 @@ +=== tests/cases/compiler/crashInresolveReturnStatement.ts === +class WorkItemToolbar { +>WorkItemToolbar : Symbol(WorkItemToolbar, Decl(crashInresolveReturnStatement.ts, 0, 0)) + + public onToolbarItemClick() { +>onToolbarItemClick : Symbol(onToolbarItemClick, Decl(crashInresolveReturnStatement.ts, 0, 23)) + + WITDialogs.createCopyOfWorkItem(); +>WITDialogs.createCopyOfWorkItem : Symbol(WITDialogs.createCopyOfWorkItem, Decl(crashInresolveReturnStatement.ts, 12, 18)) +>WITDialogs : Symbol(WITDialogs, Decl(crashInresolveReturnStatement.ts, 11, 1)) +>createCopyOfWorkItem : Symbol(WITDialogs.createCopyOfWorkItem, Decl(crashInresolveReturnStatement.ts, 12, 18)) + } +} +class CreateCopyOfWorkItemDialog { +>CreateCopyOfWorkItemDialog : Symbol(CreateCopyOfWorkItemDialog, Decl(crashInresolveReturnStatement.ts, 4, 1)) + + public getDialogResult() { +>getDialogResult : Symbol(getDialogResult, Decl(crashInresolveReturnStatement.ts, 5, 34)) + + return null; + } +} +function createWorkItemDialog(dialogType: P0) { +>createWorkItemDialog : Symbol(createWorkItemDialog, Decl(crashInresolveReturnStatement.ts, 9, 1)) +>P0 : Symbol(P0, Decl(crashInresolveReturnStatement.ts, 10, 30)) +>dialogType : Symbol(dialogType, Decl(crashInresolveReturnStatement.ts, 10, 34)) +>P0 : Symbol(P0, Decl(crashInresolveReturnStatement.ts, 10, 30)) +} +class WITDialogs { +>WITDialogs : Symbol(WITDialogs, Decl(crashInresolveReturnStatement.ts, 11, 1)) + + public static createCopyOfWorkItem() { +>createCopyOfWorkItem : Symbol(WITDialogs.createCopyOfWorkItem, Decl(crashInresolveReturnStatement.ts, 12, 18)) + + createWorkItemDialog(CreateCopyOfWorkItemDialog); +>createWorkItemDialog : Symbol(createWorkItemDialog, Decl(crashInresolveReturnStatement.ts, 9, 1)) +>CreateCopyOfWorkItemDialog : Symbol(CreateCopyOfWorkItemDialog, Decl(crashInresolveReturnStatement.ts, 4, 1)) + } +} + diff --git a/tests/baselines/reference/crashInresolveReturnStatement.types b/tests/baselines/reference/crashInresolveReturnStatement.types index 6d31f15569b..5a43d916edc 100644 --- a/tests/baselines/reference/crashInresolveReturnStatement.types +++ b/tests/baselines/reference/crashInresolveReturnStatement.types @@ -19,6 +19,7 @@ class CreateCopyOfWorkItemDialog { >getDialogResult : () => any return null; +>null : null } } function createWorkItemDialog(dialogType: P0) { diff --git a/tests/baselines/reference/cyclicModuleImport.symbols b/tests/baselines/reference/cyclicModuleImport.symbols new file mode 100644 index 00000000000..86337812aad --- /dev/null +++ b/tests/baselines/reference/cyclicModuleImport.symbols @@ -0,0 +1,40 @@ +=== tests/cases/compiler/cyclicModuleImport.ts === +declare module "SubModule" { + import MainModule = require('MainModule'); +>MainModule : Symbol(MainModule, Decl(cyclicModuleImport.ts, 0, 28)) + + class SubModule { +>SubModule : Symbol(SubModule, Decl(cyclicModuleImport.ts, 1, 46)) + + public static StaticVar: number; +>StaticVar : Symbol(SubModule.StaticVar, Decl(cyclicModuleImport.ts, 2, 21)) + + public InstanceVar: number; +>InstanceVar : Symbol(InstanceVar, Decl(cyclicModuleImport.ts, 3, 40)) + + public main: MainModule; +>main : Symbol(main, Decl(cyclicModuleImport.ts, 4, 35)) +>MainModule : Symbol(MainModule, Decl(cyclicModuleImport.ts, 0, 28)) + + constructor(); + } + export = SubModule; +>SubModule : Symbol(SubModule, Decl(cyclicModuleImport.ts, 1, 46)) +} +declare module "MainModule" { + import SubModule = require('SubModule'); +>SubModule : Symbol(SubModule, Decl(cyclicModuleImport.ts, 10, 29)) + + class MainModule { +>MainModule : Symbol(MainModule, Decl(cyclicModuleImport.ts, 11, 44)) + + public SubModule: SubModule; +>SubModule : Symbol(SubModule, Decl(cyclicModuleImport.ts, 12, 22)) +>SubModule : Symbol(SubModule, Decl(cyclicModuleImport.ts, 10, 29)) + + constructor(); + } + export = MainModule; +>MainModule : Symbol(MainModule, Decl(cyclicModuleImport.ts, 11, 44)) +} + diff --git a/tests/baselines/reference/debugger.symbols b/tests/baselines/reference/debugger.symbols new file mode 100644 index 00000000000..9c11d0e2598 --- /dev/null +++ b/tests/baselines/reference/debugger.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/debugger.ts === +debugger; + +function foo() { +>foo : Symbol(foo, Decl(debugger.ts, 0, 9)) + + debugger; + +} diff --git a/tests/baselines/reference/debuggerEmit.symbols b/tests/baselines/reference/debuggerEmit.symbols new file mode 100644 index 00000000000..b8f6228a99d --- /dev/null +++ b/tests/baselines/reference/debuggerEmit.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/debuggerEmit.ts === +var x = function () { debugger; } +>x : Symbol(x, Decl(debuggerEmit.ts, 0, 3)) + +x(); +>x : Symbol(x, Decl(debuggerEmit.ts, 0, 3)) + diff --git a/tests/baselines/reference/declFileAccessors.symbols b/tests/baselines/reference/declFileAccessors.symbols new file mode 100644 index 00000000000..7275dd8c191 --- /dev/null +++ b/tests/baselines/reference/declFileAccessors.symbols @@ -0,0 +1,160 @@ +=== tests/cases/compiler/declFileAccessors_0.ts === + +/** This is comment for c1*/ +export class c1 { +>c1 : Symbol(c1, Decl(declFileAccessors_0.ts, 0, 0)) + + /** getter property*/ + public get p3() { +>p3 : Symbol(p3, Decl(declFileAccessors_0.ts, 2, 17), Decl(declFileAccessors_0.ts, 6, 5)) + + return 10; + } + /** setter property*/ + public set p3(/** this is value*/value: number) { +>p3 : Symbol(p3, Decl(declFileAccessors_0.ts, 2, 17), Decl(declFileAccessors_0.ts, 6, 5)) +>value : Symbol(value, Decl(declFileAccessors_0.ts, 8, 18)) + } + /** private getter property*/ + private get pp3() { +>pp3 : Symbol(pp3, Decl(declFileAccessors_0.ts, 9, 5), Decl(declFileAccessors_0.ts, 13, 5)) + + return 10; + } + /** private setter property*/ + private set pp3(/** this is value*/value: number) { +>pp3 : Symbol(pp3, Decl(declFileAccessors_0.ts, 9, 5), Decl(declFileAccessors_0.ts, 13, 5)) +>value : Symbol(value, Decl(declFileAccessors_0.ts, 15, 20)) + } + /** static getter property*/ + static get s3() { +>s3 : Symbol(c1.s3, Decl(declFileAccessors_0.ts, 16, 5), Decl(declFileAccessors_0.ts, 20, 5)) + + return 10; + } + /** setter property*/ + static set s3( /** this is value*/value: number) { +>s3 : Symbol(c1.s3, Decl(declFileAccessors_0.ts, 16, 5), Decl(declFileAccessors_0.ts, 20, 5)) +>value : Symbol(value, Decl(declFileAccessors_0.ts, 22, 18)) + } + public get nc_p3() { +>nc_p3 : Symbol(nc_p3, Decl(declFileAccessors_0.ts, 23, 5), Decl(declFileAccessors_0.ts, 26, 5)) + + return 10; + } + public set nc_p3(value: number) { +>nc_p3 : Symbol(nc_p3, Decl(declFileAccessors_0.ts, 23, 5), Decl(declFileAccessors_0.ts, 26, 5)) +>value : Symbol(value, Decl(declFileAccessors_0.ts, 27, 21)) + } + private get nc_pp3() { +>nc_pp3 : Symbol(nc_pp3, Decl(declFileAccessors_0.ts, 28, 5), Decl(declFileAccessors_0.ts, 31, 5)) + + return 10; + } + private set nc_pp3(value: number) { +>nc_pp3 : Symbol(nc_pp3, Decl(declFileAccessors_0.ts, 28, 5), Decl(declFileAccessors_0.ts, 31, 5)) +>value : Symbol(value, Decl(declFileAccessors_0.ts, 32, 23)) + } + static get nc_s3() { +>nc_s3 : Symbol(c1.nc_s3, Decl(declFileAccessors_0.ts, 33, 5), Decl(declFileAccessors_0.ts, 36, 5)) + + return ""; + } + static set nc_s3(value: string) { +>nc_s3 : Symbol(c1.nc_s3, Decl(declFileAccessors_0.ts, 33, 5), Decl(declFileAccessors_0.ts, 36, 5)) +>value : Symbol(value, Decl(declFileAccessors_0.ts, 37, 21)) + } + + // Only getter property + public get onlyGetter() { +>onlyGetter : Symbol(onlyGetter, Decl(declFileAccessors_0.ts, 38, 5)) + + return 10; + } + + // Only setter property + public set onlySetter(value: number) { +>onlySetter : Symbol(onlySetter, Decl(declFileAccessors_0.ts, 43, 5)) +>value : Symbol(value, Decl(declFileAccessors_0.ts, 46, 26)) + } +} + +=== tests/cases/compiler/declFileAccessors_1.ts === +/** This is comment for c2 - the global class*/ +class c2 { +>c2 : Symbol(c2, Decl(declFileAccessors_1.ts, 0, 0)) + + /** getter property*/ + public get p3() { +>p3 : Symbol(p3, Decl(declFileAccessors_1.ts, 1, 10), Decl(declFileAccessors_1.ts, 5, 5)) + + return 10; + } + /** setter property*/ + public set p3(/** this is value*/value: number) { +>p3 : Symbol(p3, Decl(declFileAccessors_1.ts, 1, 10), Decl(declFileAccessors_1.ts, 5, 5)) +>value : Symbol(value, Decl(declFileAccessors_1.ts, 7, 18)) + } + /** private getter property*/ + private get pp3() { +>pp3 : Symbol(pp3, Decl(declFileAccessors_1.ts, 8, 5), Decl(declFileAccessors_1.ts, 12, 5)) + + return 10; + } + /** private setter property*/ + private set pp3(/** this is value*/value: number) { +>pp3 : Symbol(pp3, Decl(declFileAccessors_1.ts, 8, 5), Decl(declFileAccessors_1.ts, 12, 5)) +>value : Symbol(value, Decl(declFileAccessors_1.ts, 14, 20)) + } + /** static getter property*/ + static get s3() { +>s3 : Symbol(c2.s3, Decl(declFileAccessors_1.ts, 15, 5), Decl(declFileAccessors_1.ts, 19, 5)) + + return 10; + } + /** setter property*/ + static set s3( /** this is value*/value: number) { +>s3 : Symbol(c2.s3, Decl(declFileAccessors_1.ts, 15, 5), Decl(declFileAccessors_1.ts, 19, 5)) +>value : Symbol(value, Decl(declFileAccessors_1.ts, 21, 18)) + } + public get nc_p3() { +>nc_p3 : Symbol(nc_p3, Decl(declFileAccessors_1.ts, 22, 5), Decl(declFileAccessors_1.ts, 25, 5)) + + return 10; + } + public set nc_p3(value: number) { +>nc_p3 : Symbol(nc_p3, Decl(declFileAccessors_1.ts, 22, 5), Decl(declFileAccessors_1.ts, 25, 5)) +>value : Symbol(value, Decl(declFileAccessors_1.ts, 26, 21)) + } + private get nc_pp3() { +>nc_pp3 : Symbol(nc_pp3, Decl(declFileAccessors_1.ts, 27, 5), Decl(declFileAccessors_1.ts, 30, 5)) + + return 10; + } + private set nc_pp3(value: number) { +>nc_pp3 : Symbol(nc_pp3, Decl(declFileAccessors_1.ts, 27, 5), Decl(declFileAccessors_1.ts, 30, 5)) +>value : Symbol(value, Decl(declFileAccessors_1.ts, 31, 23)) + } + static get nc_s3() { +>nc_s3 : Symbol(c2.nc_s3, Decl(declFileAccessors_1.ts, 32, 5), Decl(declFileAccessors_1.ts, 35, 5)) + + return ""; + } + static set nc_s3(value: string) { +>nc_s3 : Symbol(c2.nc_s3, Decl(declFileAccessors_1.ts, 32, 5), Decl(declFileAccessors_1.ts, 35, 5)) +>value : Symbol(value, Decl(declFileAccessors_1.ts, 36, 21)) + } + + // Only getter property + public get onlyGetter() { +>onlyGetter : Symbol(onlyGetter, Decl(declFileAccessors_1.ts, 37, 5)) + + return 10; + } + + // Only setter property + public set onlySetter(value: number) { +>onlySetter : Symbol(onlySetter, Decl(declFileAccessors_1.ts, 42, 5)) +>value : Symbol(value, Decl(declFileAccessors_1.ts, 45, 26)) + } +} diff --git a/tests/baselines/reference/declFileAccessors.types b/tests/baselines/reference/declFileAccessors.types index 2d8524a21c3..00b10f7bf40 100644 --- a/tests/baselines/reference/declFileAccessors.types +++ b/tests/baselines/reference/declFileAccessors.types @@ -9,6 +9,7 @@ export class c1 { >p3 : number return 10; +>10 : number } /** setter property*/ public set p3(/** this is value*/value: number) { @@ -20,6 +21,7 @@ export class c1 { >pp3 : number return 10; +>10 : number } /** private setter property*/ private set pp3(/** this is value*/value: number) { @@ -31,6 +33,7 @@ export class c1 { >s3 : number return 10; +>10 : number } /** setter property*/ static set s3( /** this is value*/value: number) { @@ -41,6 +44,7 @@ export class c1 { >nc_p3 : number return 10; +>10 : number } public set nc_p3(value: number) { >nc_p3 : number @@ -50,6 +54,7 @@ export class c1 { >nc_pp3 : number return 10; +>10 : number } private set nc_pp3(value: number) { >nc_pp3 : number @@ -59,6 +64,7 @@ export class c1 { >nc_s3 : string return ""; +>"" : string } static set nc_s3(value: string) { >nc_s3 : string @@ -70,6 +76,7 @@ export class c1 { >onlyGetter : number return 10; +>10 : number } // Only setter property @@ -89,6 +96,7 @@ class c2 { >p3 : number return 10; +>10 : number } /** setter property*/ public set p3(/** this is value*/value: number) { @@ -100,6 +108,7 @@ class c2 { >pp3 : number return 10; +>10 : number } /** private setter property*/ private set pp3(/** this is value*/value: number) { @@ -111,6 +120,7 @@ class c2 { >s3 : number return 10; +>10 : number } /** setter property*/ static set s3( /** this is value*/value: number) { @@ -121,6 +131,7 @@ class c2 { >nc_p3 : number return 10; +>10 : number } public set nc_p3(value: number) { >nc_p3 : number @@ -130,6 +141,7 @@ class c2 { >nc_pp3 : number return 10; +>10 : number } private set nc_pp3(value: number) { >nc_pp3 : number @@ -139,6 +151,7 @@ class c2 { >nc_s3 : string return ""; +>"" : string } static set nc_s3(value: string) { >nc_s3 : string @@ -150,6 +163,7 @@ class c2 { >onlyGetter : number return 10; +>10 : number } // Only setter property diff --git a/tests/baselines/reference/declFileAliasUseBeforeDeclaration.symbols b/tests/baselines/reference/declFileAliasUseBeforeDeclaration.symbols new file mode 100644 index 00000000000..ee7795ae455 --- /dev/null +++ b/tests/baselines/reference/declFileAliasUseBeforeDeclaration.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/declFileAliasUseBeforeDeclaration_test.ts === +export function bar(a: foo.Foo) { } +>bar : Symbol(bar, Decl(declFileAliasUseBeforeDeclaration_test.ts, 0, 0)) +>a : Symbol(a, Decl(declFileAliasUseBeforeDeclaration_test.ts, 0, 20)) +>foo : Symbol(foo, Decl(declFileAliasUseBeforeDeclaration_test.ts, 0, 35)) +>Foo : Symbol(foo.Foo, Decl(declFileAliasUseBeforeDeclaration_foo.ts, 0, 0)) + +import foo = require("declFileAliasUseBeforeDeclaration_foo"); +>foo : Symbol(foo, Decl(declFileAliasUseBeforeDeclaration_test.ts, 0, 35)) + +=== tests/cases/compiler/declFileAliasUseBeforeDeclaration_foo.ts === + +export class Foo { } +>Foo : Symbol(Foo, Decl(declFileAliasUseBeforeDeclaration_foo.ts, 0, 0)) + diff --git a/tests/baselines/reference/declFileAliasUseBeforeDeclaration.types b/tests/baselines/reference/declFileAliasUseBeforeDeclaration.types index 800df4ada49..c21d98d90d5 100644 --- a/tests/baselines/reference/declFileAliasUseBeforeDeclaration.types +++ b/tests/baselines/reference/declFileAliasUseBeforeDeclaration.types @@ -2,7 +2,7 @@ export function bar(a: foo.Foo) { } >bar : (a: foo.Foo) => void >a : foo.Foo ->foo : unknown +>foo : any >Foo : foo.Foo import foo = require("declFileAliasUseBeforeDeclaration_foo"); diff --git a/tests/baselines/reference/declFileAliasUseBeforeDeclaration2.symbols b/tests/baselines/reference/declFileAliasUseBeforeDeclaration2.symbols new file mode 100644 index 00000000000..c0ad98bbe3d --- /dev/null +++ b/tests/baselines/reference/declFileAliasUseBeforeDeclaration2.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/declFileAliasUseBeforeDeclaration2.ts === + +declare module "test" { + module A { +>A : Symbol(A, Decl(declFileAliasUseBeforeDeclaration2.ts, 1, 23)) + + class C { +>C : Symbol(C, Decl(declFileAliasUseBeforeDeclaration2.ts, 2, 14)) + } + } + class B extends E { +>B : Symbol(B, Decl(declFileAliasUseBeforeDeclaration2.ts, 5, 5)) +>E : Symbol(E, Decl(declFileAliasUseBeforeDeclaration2.ts, 7, 5)) + } + import E = A.C; +>E : Symbol(E, Decl(declFileAliasUseBeforeDeclaration2.ts, 7, 5)) +>A : Symbol(A, Decl(declFileAliasUseBeforeDeclaration2.ts, 1, 23)) +>C : Symbol(E, Decl(declFileAliasUseBeforeDeclaration2.ts, 2, 14)) +} diff --git a/tests/baselines/reference/declFileAmbientExternalModuleWithSingleExportedModule.symbols b/tests/baselines/reference/declFileAmbientExternalModuleWithSingleExportedModule.symbols new file mode 100644 index 00000000000..4a4077836cd --- /dev/null +++ b/tests/baselines/reference/declFileAmbientExternalModuleWithSingleExportedModule.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/declFileAmbientExternalModuleWithSingleExportedModule_1.ts === +/// +import SubModule = require('SubModule'); +>SubModule : Symbol(SubModule, Decl(declFileAmbientExternalModuleWithSingleExportedModule_1.ts, 0, 0)) + +export var x: SubModule.m.m3.c; +>x : Symbol(x, Decl(declFileAmbientExternalModuleWithSingleExportedModule_1.ts, 2, 10)) +>SubModule : Symbol(SubModule, Decl(declFileAmbientExternalModuleWithSingleExportedModule_1.ts, 0, 0)) +>m : Symbol(SubModule.m, Decl(declFileAmbientExternalModuleWithSingleExportedModule_0.ts, 1, 28)) +>m3 : Symbol(SubModule.m.m3, Decl(declFileAmbientExternalModuleWithSingleExportedModule_0.ts, 2, 21)) +>c : Symbol(SubModule.m.m3.c, Decl(declFileAmbientExternalModuleWithSingleExportedModule_0.ts, 3, 26)) + + +=== tests/cases/compiler/declFileAmbientExternalModuleWithSingleExportedModule_0.ts === + +declare module "SubModule" { + export module m { +>m : Symbol(m, Decl(declFileAmbientExternalModuleWithSingleExportedModule_0.ts, 1, 28)) + + export module m3 { +>m3 : Symbol(m3, Decl(declFileAmbientExternalModuleWithSingleExportedModule_0.ts, 2, 21)) + + interface c { +>c : Symbol(c, Decl(declFileAmbientExternalModuleWithSingleExportedModule_0.ts, 3, 26)) + } + } + } +} + diff --git a/tests/baselines/reference/declFileAmbientExternalModuleWithSingleExportedModule.types b/tests/baselines/reference/declFileAmbientExternalModuleWithSingleExportedModule.types index 420f1550d7a..792f1f0282f 100644 --- a/tests/baselines/reference/declFileAmbientExternalModuleWithSingleExportedModule.types +++ b/tests/baselines/reference/declFileAmbientExternalModuleWithSingleExportedModule.types @@ -5,9 +5,9 @@ import SubModule = require('SubModule'); export var x: SubModule.m.m3.c; >x : SubModule.m.m3.c ->SubModule : unknown ->m : unknown ->m3 : unknown +>SubModule : any +>m : any +>m3 : any >c : SubModule.m.m3.c @@ -15,10 +15,10 @@ export var x: SubModule.m.m3.c; declare module "SubModule" { export module m { ->m : unknown +>m : any export module m3 { ->m3 : unknown +>m3 : any interface c { >c : c diff --git a/tests/baselines/reference/declFileCallSignatures.symbols b/tests/baselines/reference/declFileCallSignatures.symbols new file mode 100644 index 00000000000..cf1697dc4c0 --- /dev/null +++ b/tests/baselines/reference/declFileCallSignatures.symbols @@ -0,0 +1,117 @@ +=== tests/cases/compiler/declFileCallSignatures_0.ts === + +export interface ICallSignature { +>ICallSignature : Symbol(ICallSignature, Decl(declFileCallSignatures_0.ts, 0, 0)) + + /** This comment should appear for foo*/ + (): string; +} + +export interface ICallSignatureWithParameters { +>ICallSignatureWithParameters : Symbol(ICallSignatureWithParameters, Decl(declFileCallSignatures_0.ts, 4, 1)) + + /** This is comment for function signature*/ + (/** this is comment about a*/a: string, +>a : Symbol(a, Decl(declFileCallSignatures_0.ts, 8, 5)) + + /** this is comment for b*/ + b: number): void; +>b : Symbol(b, Decl(declFileCallSignatures_0.ts, 8, 44)) +} + +export interface ICallSignatureWithRestParameters { +>ICallSignatureWithRestParameters : Symbol(ICallSignatureWithRestParameters, Decl(declFileCallSignatures_0.ts, 11, 1)) + + (a: string, ...rests: string[]): string; +>a : Symbol(a, Decl(declFileCallSignatures_0.ts, 14, 5)) +>rests : Symbol(rests, Decl(declFileCallSignatures_0.ts, 14, 15)) +} + +export interface ICallSignatureWithOverloads { +>ICallSignatureWithOverloads : Symbol(ICallSignatureWithOverloads, Decl(declFileCallSignatures_0.ts, 15, 1)) + + (a: string): string; +>a : Symbol(a, Decl(declFileCallSignatures_0.ts, 18, 5)) + + (a: number): number; +>a : Symbol(a, Decl(declFileCallSignatures_0.ts, 19, 5)) +} + +export interface ICallSignatureWithTypeParameters { +>ICallSignatureWithTypeParameters : Symbol(ICallSignatureWithTypeParameters, Decl(declFileCallSignatures_0.ts, 20, 1)) +>T : Symbol(T, Decl(declFileCallSignatures_0.ts, 22, 50)) + + /** This comment should appear for foo*/ + (a: T): string; +>a : Symbol(a, Decl(declFileCallSignatures_0.ts, 24, 5)) +>T : Symbol(T, Decl(declFileCallSignatures_0.ts, 22, 50)) +} + +export interface ICallSignatureWithOwnTypeParametes { +>ICallSignatureWithOwnTypeParametes : Symbol(ICallSignatureWithOwnTypeParametes, Decl(declFileCallSignatures_0.ts, 25, 1)) + + (a: T): string; +>T : Symbol(T, Decl(declFileCallSignatures_0.ts, 28, 5)) +>ICallSignature : Symbol(ICallSignature, Decl(declFileCallSignatures_0.ts, 0, 0)) +>a : Symbol(a, Decl(declFileCallSignatures_0.ts, 28, 31)) +>T : Symbol(T, Decl(declFileCallSignatures_0.ts, 28, 5)) +} + +=== tests/cases/compiler/declFileCallSignatures_1.ts === +interface IGlobalCallSignature { +>IGlobalCallSignature : Symbol(IGlobalCallSignature, Decl(declFileCallSignatures_1.ts, 0, 0)) + + /** This comment should appear for foo*/ + (): string; +} + +interface IGlobalCallSignatureWithParameters { +>IGlobalCallSignatureWithParameters : Symbol(IGlobalCallSignatureWithParameters, Decl(declFileCallSignatures_1.ts, 3, 1)) + + /** This is comment for function signature*/ + (/** this is comment about a*/a: string, +>a : Symbol(a, Decl(declFileCallSignatures_1.ts, 7, 5)) + + /** this is comment for b*/ + b: number): void; +>b : Symbol(b, Decl(declFileCallSignatures_1.ts, 7, 44)) +} + +interface IGlobalCallSignatureWithRestParameters { +>IGlobalCallSignatureWithRestParameters : Symbol(IGlobalCallSignatureWithRestParameters, Decl(declFileCallSignatures_1.ts, 10, 1)) + + (a: string, ...rests: string[]): string; +>a : Symbol(a, Decl(declFileCallSignatures_1.ts, 14, 5)) +>rests : Symbol(rests, Decl(declFileCallSignatures_1.ts, 14, 15)) + +} + +interface IGlobalCallSignatureWithOverloads { +>IGlobalCallSignatureWithOverloads : Symbol(IGlobalCallSignatureWithOverloads, Decl(declFileCallSignatures_1.ts, 16, 1)) + + (a: string): string; +>a : Symbol(a, Decl(declFileCallSignatures_1.ts, 19, 5)) + + (a: number): number; +>a : Symbol(a, Decl(declFileCallSignatures_1.ts, 20, 5)) +} + +interface IGlobalCallSignatureWithTypeParameters { +>IGlobalCallSignatureWithTypeParameters : Symbol(IGlobalCallSignatureWithTypeParameters, Decl(declFileCallSignatures_1.ts, 21, 1)) +>T : Symbol(T, Decl(declFileCallSignatures_1.ts, 23, 49)) + + /** This comment should appear for foo*/ + (a: T): string; +>a : Symbol(a, Decl(declFileCallSignatures_1.ts, 25, 5)) +>T : Symbol(T, Decl(declFileCallSignatures_1.ts, 23, 49)) +} + +interface IGlobalCallSignatureWithOwnTypeParametes { +>IGlobalCallSignatureWithOwnTypeParametes : Symbol(IGlobalCallSignatureWithOwnTypeParametes, Decl(declFileCallSignatures_1.ts, 26, 1)) + + (a: T): string; +>T : Symbol(T, Decl(declFileCallSignatures_1.ts, 29, 5)) +>IGlobalCallSignature : Symbol(IGlobalCallSignature, Decl(declFileCallSignatures_1.ts, 0, 0)) +>a : Symbol(a, Decl(declFileCallSignatures_1.ts, 29, 37)) +>T : Symbol(T, Decl(declFileCallSignatures_1.ts, 29, 5)) +} diff --git a/tests/baselines/reference/declFileClassWithIndexSignature.symbols b/tests/baselines/reference/declFileClassWithIndexSignature.symbols new file mode 100644 index 00000000000..2487a2fae00 --- /dev/null +++ b/tests/baselines/reference/declFileClassWithIndexSignature.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/declFileClassWithIndexSignature.ts === + +class BlockIntrinsics { +>BlockIntrinsics : Symbol(BlockIntrinsics, Decl(declFileClassWithIndexSignature.ts, 0, 0)) + + [s: string]: string; +>s : Symbol(s, Decl(declFileClassWithIndexSignature.ts, 2, 5)) +} diff --git a/tests/baselines/reference/declFileClassWithStaticMethodReturningConstructor.symbols b/tests/baselines/reference/declFileClassWithStaticMethodReturningConstructor.symbols new file mode 100644 index 00000000000..af1f56642bc --- /dev/null +++ b/tests/baselines/reference/declFileClassWithStaticMethodReturningConstructor.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/declFileClassWithStaticMethodReturningConstructor.ts === + +export class Enhancement { +>Enhancement : Symbol(Enhancement, Decl(declFileClassWithStaticMethodReturningConstructor.ts, 0, 0)) + + public static getType() { +>getType : Symbol(Enhancement.getType, Decl(declFileClassWithStaticMethodReturningConstructor.ts, 1, 26)) + + return this; +>this : Symbol(Enhancement, Decl(declFileClassWithStaticMethodReturningConstructor.ts, 0, 0)) + } +} diff --git a/tests/baselines/reference/declFileConstructSignatures.symbols b/tests/baselines/reference/declFileConstructSignatures.symbols new file mode 100644 index 00000000000..a6d98f6feca --- /dev/null +++ b/tests/baselines/reference/declFileConstructSignatures.symbols @@ -0,0 +1,121 @@ +=== tests/cases/compiler/declFileConstructSignatures_0.ts === + +export interface IConstructSignature { +>IConstructSignature : Symbol(IConstructSignature, Decl(declFileConstructSignatures_0.ts, 0, 0)) + + /** This comment should appear for foo*/ + new (): string; +} + +export interface IConstructSignatureWithParameters { +>IConstructSignatureWithParameters : Symbol(IConstructSignatureWithParameters, Decl(declFileConstructSignatures_0.ts, 4, 1)) + + /** This is comment for function signature*/ + new (/** this is comment about a*/a: string, +>a : Symbol(a, Decl(declFileConstructSignatures_0.ts, 8, 9)) + + /** this is comment for b*/ + b: number); +>b : Symbol(b, Decl(declFileConstructSignatures_0.ts, 8, 48)) +} + +export interface IConstructSignatureWithRestParameters { +>IConstructSignatureWithRestParameters : Symbol(IConstructSignatureWithRestParameters, Decl(declFileConstructSignatures_0.ts, 11, 1)) + + new (a: string, ...rests: string[]): string; +>a : Symbol(a, Decl(declFileConstructSignatures_0.ts, 14, 9)) +>rests : Symbol(rests, Decl(declFileConstructSignatures_0.ts, 14, 19)) +} + +export interface IConstructSignatureWithOverloads { +>IConstructSignatureWithOverloads : Symbol(IConstructSignatureWithOverloads, Decl(declFileConstructSignatures_0.ts, 15, 1)) + + new (a: string): string; +>a : Symbol(a, Decl(declFileConstructSignatures_0.ts, 18, 9)) + + new (a: number): number; +>a : Symbol(a, Decl(declFileConstructSignatures_0.ts, 19, 9)) +} + +export interface IConstructSignatureWithTypeParameters { +>IConstructSignatureWithTypeParameters : Symbol(IConstructSignatureWithTypeParameters, Decl(declFileConstructSignatures_0.ts, 20, 1)) +>T : Symbol(T, Decl(declFileConstructSignatures_0.ts, 22, 55)) + + /** This comment should appear for foo*/ + new (a: T): T; +>a : Symbol(a, Decl(declFileConstructSignatures_0.ts, 24, 9)) +>T : Symbol(T, Decl(declFileConstructSignatures_0.ts, 22, 55)) +>T : Symbol(T, Decl(declFileConstructSignatures_0.ts, 22, 55)) +} + +export interface IConstructSignatureWithOwnTypeParametes { +>IConstructSignatureWithOwnTypeParametes : Symbol(IConstructSignatureWithOwnTypeParametes, Decl(declFileConstructSignatures_0.ts, 25, 1)) + + new (a: T): T; +>T : Symbol(T, Decl(declFileConstructSignatures_0.ts, 28, 9)) +>IConstructSignature : Symbol(IConstructSignature, Decl(declFileConstructSignatures_0.ts, 0, 0)) +>a : Symbol(a, Decl(declFileConstructSignatures_0.ts, 28, 40)) +>T : Symbol(T, Decl(declFileConstructSignatures_0.ts, 28, 9)) +>T : Symbol(T, Decl(declFileConstructSignatures_0.ts, 28, 9)) +} + +=== tests/cases/compiler/declFileConstructSignatures_1.ts === +interface IGlobalConstructSignature { +>IGlobalConstructSignature : Symbol(IGlobalConstructSignature, Decl(declFileConstructSignatures_1.ts, 0, 0)) + + /** This comment should appear for foo*/ + new (): string; +} + +interface IGlobalConstructSignatureWithParameters { +>IGlobalConstructSignatureWithParameters : Symbol(IGlobalConstructSignatureWithParameters, Decl(declFileConstructSignatures_1.ts, 3, 1)) + + /** This is comment for function signature*/ + new (/** this is comment about a*/a: string, +>a : Symbol(a, Decl(declFileConstructSignatures_1.ts, 7, 9)) + + /** this is comment for b*/ + b: number); +>b : Symbol(b, Decl(declFileConstructSignatures_1.ts, 7, 48)) +} + +interface IGlobalConstructSignatureWithRestParameters { +>IGlobalConstructSignatureWithRestParameters : Symbol(IGlobalConstructSignatureWithRestParameters, Decl(declFileConstructSignatures_1.ts, 10, 1)) + + new (a: string, ...rests: string[]): string; +>a : Symbol(a, Decl(declFileConstructSignatures_1.ts, 14, 9)) +>rests : Symbol(rests, Decl(declFileConstructSignatures_1.ts, 14, 19)) + +} + +interface IGlobalConstructSignatureWithOverloads { +>IGlobalConstructSignatureWithOverloads : Symbol(IGlobalConstructSignatureWithOverloads, Decl(declFileConstructSignatures_1.ts, 16, 1)) + + new (a: string): string; +>a : Symbol(a, Decl(declFileConstructSignatures_1.ts, 19, 9)) + + new (a: number): number; +>a : Symbol(a, Decl(declFileConstructSignatures_1.ts, 20, 9)) +} + +interface IGlobalConstructSignatureWithTypeParameters { +>IGlobalConstructSignatureWithTypeParameters : Symbol(IGlobalConstructSignatureWithTypeParameters, Decl(declFileConstructSignatures_1.ts, 21, 1)) +>T : Symbol(T, Decl(declFileConstructSignatures_1.ts, 23, 54)) + + /** This comment should appear for foo*/ + new (a: T): T; +>a : Symbol(a, Decl(declFileConstructSignatures_1.ts, 25, 9)) +>T : Symbol(T, Decl(declFileConstructSignatures_1.ts, 23, 54)) +>T : Symbol(T, Decl(declFileConstructSignatures_1.ts, 23, 54)) +} + +interface IGlobalConstructSignatureWithOwnTypeParametes { +>IGlobalConstructSignatureWithOwnTypeParametes : Symbol(IGlobalConstructSignatureWithOwnTypeParametes, Decl(declFileConstructSignatures_1.ts, 26, 1)) + + new (a: T): T; +>T : Symbol(T, Decl(declFileConstructSignatures_1.ts, 29, 9)) +>IGlobalConstructSignature : Symbol(IGlobalConstructSignature, Decl(declFileConstructSignatures_1.ts, 0, 0)) +>a : Symbol(a, Decl(declFileConstructSignatures_1.ts, 29, 46)) +>T : Symbol(T, Decl(declFileConstructSignatures_1.ts, 29, 9)) +>T : Symbol(T, Decl(declFileConstructSignatures_1.ts, 29, 9)) +} diff --git a/tests/baselines/reference/declFileConstructors.symbols b/tests/baselines/reference/declFileConstructors.symbols new file mode 100644 index 00000000000..bc8f349bb82 --- /dev/null +++ b/tests/baselines/reference/declFileConstructors.symbols @@ -0,0 +1,172 @@ +=== tests/cases/compiler/declFileConstructors_0.ts === + +export class SimpleConstructor { +>SimpleConstructor : Symbol(SimpleConstructor, Decl(declFileConstructors_0.ts, 0, 0)) + + /** This comment should appear for foo*/ + constructor() { + } +} +export class ConstructorWithParameters { +>ConstructorWithParameters : Symbol(ConstructorWithParameters, Decl(declFileConstructors_0.ts, 5, 1)) + + /** This is comment for function signature*/ + constructor(/** this is comment about a*/a: string, +>a : Symbol(a, Decl(declFileConstructors_0.ts, 8, 16)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(declFileConstructors_0.ts, 8, 55)) + + var d = a; +>d : Symbol(d, Decl(declFileConstructors_0.ts, 11, 11)) +>a : Symbol(a, Decl(declFileConstructors_0.ts, 8, 16)) + } +} + +export class ConstructorWithRestParamters { +>ConstructorWithRestParamters : Symbol(ConstructorWithRestParamters, Decl(declFileConstructors_0.ts, 13, 1)) + + constructor(a: string, ...rests: string[]) { +>a : Symbol(a, Decl(declFileConstructors_0.ts, 16, 16)) +>rests : Symbol(rests, Decl(declFileConstructors_0.ts, 16, 26)) + + return a + rests.join(""); +>a : Symbol(a, Decl(declFileConstructors_0.ts, 16, 16)) +>rests.join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +>rests : Symbol(rests, Decl(declFileConstructors_0.ts, 16, 26)) +>join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) + } +} + +export class ConstructorWithOverloads { +>ConstructorWithOverloads : Symbol(ConstructorWithOverloads, Decl(declFileConstructors_0.ts, 19, 1)) + + constructor(a: string); +>a : Symbol(a, Decl(declFileConstructors_0.ts, 22, 16)) + + constructor(a: number); +>a : Symbol(a, Decl(declFileConstructors_0.ts, 23, 16)) + + constructor(a: any) { +>a : Symbol(a, Decl(declFileConstructors_0.ts, 24, 16)) + } +} + +export class ConstructorWithPublicParameterProperty { +>ConstructorWithPublicParameterProperty : Symbol(ConstructorWithPublicParameterProperty, Decl(declFileConstructors_0.ts, 26, 1)) + + constructor(public x: string) { +>x : Symbol(x, Decl(declFileConstructors_0.ts, 29, 16)) + } +} + +export class ConstructorWithPrivateParameterProperty { +>ConstructorWithPrivateParameterProperty : Symbol(ConstructorWithPrivateParameterProperty, Decl(declFileConstructors_0.ts, 31, 1)) + + constructor(private x: string) { +>x : Symbol(x, Decl(declFileConstructors_0.ts, 34, 16)) + } +} + +export class ConstructorWithOptionalParameterProperty { +>ConstructorWithOptionalParameterProperty : Symbol(ConstructorWithOptionalParameterProperty, Decl(declFileConstructors_0.ts, 36, 1)) + + constructor(public x?: string) { +>x : Symbol(x, Decl(declFileConstructors_0.ts, 39, 16)) + } +} + +export class ConstructorWithParameterInitializer { +>ConstructorWithParameterInitializer : Symbol(ConstructorWithParameterInitializer, Decl(declFileConstructors_0.ts, 41, 1)) + + constructor(public x = "hello") { +>x : Symbol(x, Decl(declFileConstructors_0.ts, 44, 16)) + } +} + +=== tests/cases/compiler/declFileConstructors_1.ts === +class GlobalSimpleConstructor { +>GlobalSimpleConstructor : Symbol(GlobalSimpleConstructor, Decl(declFileConstructors_1.ts, 0, 0)) + + /** This comment should appear for foo*/ + constructor() { + } +} +class GlobalConstructorWithParameters { +>GlobalConstructorWithParameters : Symbol(GlobalConstructorWithParameters, Decl(declFileConstructors_1.ts, 4, 1)) + + /** This is comment for function signature*/ + constructor(/** this is comment about a*/a: string, +>a : Symbol(a, Decl(declFileConstructors_1.ts, 7, 16)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(declFileConstructors_1.ts, 7, 55)) + + var d = a; +>d : Symbol(d, Decl(declFileConstructors_1.ts, 10, 11)) +>a : Symbol(a, Decl(declFileConstructors_1.ts, 7, 16)) + } +} + +class GlobalConstructorWithRestParamters { +>GlobalConstructorWithRestParamters : Symbol(GlobalConstructorWithRestParamters, Decl(declFileConstructors_1.ts, 12, 1)) + + constructor(a: string, ...rests: string[]) { +>a : Symbol(a, Decl(declFileConstructors_1.ts, 15, 16)) +>rests : Symbol(rests, Decl(declFileConstructors_1.ts, 15, 26)) + + return a + rests.join(""); +>a : Symbol(a, Decl(declFileConstructors_1.ts, 15, 16)) +>rests.join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +>rests : Symbol(rests, Decl(declFileConstructors_1.ts, 15, 26)) +>join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) + } +} + +class GlobalConstructorWithOverloads { +>GlobalConstructorWithOverloads : Symbol(GlobalConstructorWithOverloads, Decl(declFileConstructors_1.ts, 18, 1)) + + constructor(a: string); +>a : Symbol(a, Decl(declFileConstructors_1.ts, 21, 16)) + + constructor(a: number); +>a : Symbol(a, Decl(declFileConstructors_1.ts, 22, 16)) + + constructor(a: any) { +>a : Symbol(a, Decl(declFileConstructors_1.ts, 23, 16)) + } +} + +class GlobalConstructorWithPublicParameterProperty { +>GlobalConstructorWithPublicParameterProperty : Symbol(GlobalConstructorWithPublicParameterProperty, Decl(declFileConstructors_1.ts, 25, 1)) + + constructor(public x: string) { +>x : Symbol(x, Decl(declFileConstructors_1.ts, 28, 16)) + } +} + +class GlobalConstructorWithPrivateParameterProperty { +>GlobalConstructorWithPrivateParameterProperty : Symbol(GlobalConstructorWithPrivateParameterProperty, Decl(declFileConstructors_1.ts, 30, 1)) + + constructor(private x: string) { +>x : Symbol(x, Decl(declFileConstructors_1.ts, 33, 16)) + } +} + +class GlobalConstructorWithOptionalParameterProperty { +>GlobalConstructorWithOptionalParameterProperty : Symbol(GlobalConstructorWithOptionalParameterProperty, Decl(declFileConstructors_1.ts, 35, 1)) + + constructor(public x?: string) { +>x : Symbol(x, Decl(declFileConstructors_1.ts, 38, 16)) + } +} + +class GlobalConstructorWithParameterInitializer { +>GlobalConstructorWithParameterInitializer : Symbol(GlobalConstructorWithParameterInitializer, Decl(declFileConstructors_1.ts, 40, 1)) + + constructor(public x = "hello") { +>x : Symbol(x, Decl(declFileConstructors_1.ts, 43, 16)) + } +} diff --git a/tests/baselines/reference/declFileConstructors.types b/tests/baselines/reference/declFileConstructors.types index 723830bdeea..68782eb3617 100644 --- a/tests/baselines/reference/declFileConstructors.types +++ b/tests/baselines/reference/declFileConstructors.types @@ -38,6 +38,7 @@ export class ConstructorWithRestParamters { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string +>"" : string } } @@ -84,6 +85,7 @@ export class ConstructorWithParameterInitializer { constructor(public x = "hello") { >x : string +>"hello" : string } } @@ -126,6 +128,7 @@ class GlobalConstructorWithRestParamters { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string +>"" : string } } @@ -172,5 +175,6 @@ class GlobalConstructorWithParameterInitializer { constructor(public x = "hello") { >x : string +>"hello" : string } } diff --git a/tests/baselines/reference/declFileEnumUsedAsValue.symbols b/tests/baselines/reference/declFileEnumUsedAsValue.symbols new file mode 100644 index 00000000000..d24852c6260 --- /dev/null +++ b/tests/baselines/reference/declFileEnumUsedAsValue.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/declFileEnumUsedAsValue.ts === + +enum e { +>e : Symbol(e, Decl(declFileEnumUsedAsValue.ts, 0, 0)) + + a, +>a : Symbol(e.a, Decl(declFileEnumUsedAsValue.ts, 1, 8)) + + b, +>b : Symbol(e.b, Decl(declFileEnumUsedAsValue.ts, 2, 6)) + + c +>c : Symbol(e.c, Decl(declFileEnumUsedAsValue.ts, 3, 6)) +} +var x = e; +>x : Symbol(x, Decl(declFileEnumUsedAsValue.ts, 6, 3)) +>e : Symbol(e, Decl(declFileEnumUsedAsValue.ts, 0, 0)) + diff --git a/tests/baselines/reference/declFileEnums.symbols b/tests/baselines/reference/declFileEnums.symbols new file mode 100644 index 00000000000..22d5ee6bb63 --- /dev/null +++ b/tests/baselines/reference/declFileEnums.symbols @@ -0,0 +1,76 @@ +=== tests/cases/compiler/declFileEnums.ts === + +enum e1 { +>e1 : Symbol(e1, Decl(declFileEnums.ts, 0, 0)) + + a, +>a : Symbol(e1.a, Decl(declFileEnums.ts, 1, 9)) + + b, +>b : Symbol(e1.b, Decl(declFileEnums.ts, 2, 6)) + + c +>c : Symbol(e1.c, Decl(declFileEnums.ts, 3, 6)) +} + +enum e2 { +>e2 : Symbol(e2, Decl(declFileEnums.ts, 5, 1)) + + a = 10, +>a : Symbol(e2.a, Decl(declFileEnums.ts, 7, 9)) + + b = a + 2, +>b : Symbol(e2.b, Decl(declFileEnums.ts, 8, 11)) +>a : Symbol(e2.a, Decl(declFileEnums.ts, 7, 9)) + + c = 10, +>c : Symbol(e2.c, Decl(declFileEnums.ts, 9, 14)) +} + +enum e3 { +>e3 : Symbol(e3, Decl(declFileEnums.ts, 11, 1)) + + a = 10, +>a : Symbol(e3.a, Decl(declFileEnums.ts, 13, 9)) + + b = Math.PI, +>b : Symbol(e3.b, Decl(declFileEnums.ts, 14, 11)) +>Math.PI : Symbol(Math.PI, Decl(lib.d.ts, 534, 19)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>PI : Symbol(Math.PI, Decl(lib.d.ts, 534, 19)) + + c = a + 3 +>c : Symbol(e3.c, Decl(declFileEnums.ts, 15, 16)) +>a : Symbol(e3.a, Decl(declFileEnums.ts, 13, 9)) +} + +enum e4 { +>e4 : Symbol(e4, Decl(declFileEnums.ts, 17, 1)) + + a, +>a : Symbol(e4.a, Decl(declFileEnums.ts, 19, 9)) + + b, +>b : Symbol(e4.b, Decl(declFileEnums.ts, 20, 6)) + + c, +>c : Symbol(e4.c, Decl(declFileEnums.ts, 21, 6)) + + d = 10, +>d : Symbol(e4.d, Decl(declFileEnums.ts, 22, 6)) + + e +>e : Symbol(e4.e, Decl(declFileEnums.ts, 23, 11)) +} + +enum e5 { +>e5 : Symbol(e5, Decl(declFileEnums.ts, 25, 1)) + + "Friday", + "Saturday", + "Sunday", + "Weekend days" +} + + + diff --git a/tests/baselines/reference/declFileEnums.types b/tests/baselines/reference/declFileEnums.types index d4d7230e930..5fb0d0736be 100644 --- a/tests/baselines/reference/declFileEnums.types +++ b/tests/baselines/reference/declFileEnums.types @@ -18,14 +18,17 @@ enum e2 { a = 10, >a : e2 +>10 : number b = a + 2, >b : e2 >a + 2 : number >a : e2 +>2 : number c = 10, >c : e2 +>10 : number } enum e3 { @@ -33,6 +36,7 @@ enum e3 { a = 10, >a : e3 +>10 : number b = Math.PI, >b : e3 @@ -44,6 +48,7 @@ enum e3 { >c : e3 >a + 3 : number >a : e3 +>3 : number } enum e4 { @@ -60,6 +65,7 @@ enum e4 { d = 10, >d : e4 +>10 : number e >e : e4 diff --git a/tests/baselines/reference/declFileExportAssignmentImportInternalModule.symbols b/tests/baselines/reference/declFileExportAssignmentImportInternalModule.symbols new file mode 100644 index 00000000000..5953d446478 --- /dev/null +++ b/tests/baselines/reference/declFileExportAssignmentImportInternalModule.symbols @@ -0,0 +1,58 @@ +=== tests/cases/compiler/declFileExportAssignmentImportInternalModule.ts === +module m3 { +>m3 : Symbol(m3, Decl(declFileExportAssignmentImportInternalModule.ts, 0, 0)) + + export module m2 { +>m2 : Symbol(m2, Decl(declFileExportAssignmentImportInternalModule.ts, 0, 11)) + + export interface connectModule { +>connectModule : Symbol(connectModule, Decl(declFileExportAssignmentImportInternalModule.ts, 1, 22)) + + (res, req, next): void; +>res : Symbol(res, Decl(declFileExportAssignmentImportInternalModule.ts, 3, 13)) +>req : Symbol(req, Decl(declFileExportAssignmentImportInternalModule.ts, 3, 17)) +>next : Symbol(next, Decl(declFileExportAssignmentImportInternalModule.ts, 3, 22)) + } + export interface connectExport { +>connectExport : Symbol(connectExport, Decl(declFileExportAssignmentImportInternalModule.ts, 4, 9)) + + use: (mod: connectModule) => connectExport; +>use : Symbol(use, Decl(declFileExportAssignmentImportInternalModule.ts, 5, 40)) +>mod : Symbol(mod, Decl(declFileExportAssignmentImportInternalModule.ts, 6, 18)) +>connectModule : Symbol(connectModule, Decl(declFileExportAssignmentImportInternalModule.ts, 1, 22)) +>connectExport : Symbol(connectExport, Decl(declFileExportAssignmentImportInternalModule.ts, 4, 9)) + + listen: (port: number) => void; +>listen : Symbol(listen, Decl(declFileExportAssignmentImportInternalModule.ts, 6, 55)) +>port : Symbol(port, Decl(declFileExportAssignmentImportInternalModule.ts, 7, 21)) + } + + } + + export var server: { +>server : Symbol(server, Decl(declFileExportAssignmentImportInternalModule.ts, 12, 14)) + + (): m2.connectExport; +>m2 : Symbol(m2, Decl(declFileExportAssignmentImportInternalModule.ts, 0, 11)) +>connectExport : Symbol(m2.connectExport, Decl(declFileExportAssignmentImportInternalModule.ts, 4, 9)) + + test1: m2.connectModule; +>test1 : Symbol(test1, Decl(declFileExportAssignmentImportInternalModule.ts, 13, 29)) +>m2 : Symbol(m2, Decl(declFileExportAssignmentImportInternalModule.ts, 0, 11)) +>connectModule : Symbol(m2.connectModule, Decl(declFileExportAssignmentImportInternalModule.ts, 1, 22)) + + test2(): m2.connectModule; +>test2 : Symbol(test2, Decl(declFileExportAssignmentImportInternalModule.ts, 14, 32)) +>m2 : Symbol(m2, Decl(declFileExportAssignmentImportInternalModule.ts, 0, 11)) +>connectModule : Symbol(m2.connectModule, Decl(declFileExportAssignmentImportInternalModule.ts, 1, 22)) + + }; +} + +import m = m3 +>m : Symbol(m, Decl(declFileExportAssignmentImportInternalModule.ts, 17, 1)) +>m3 : Symbol(m3, Decl(declFileExportAssignmentImportInternalModule.ts, 0, 0)) + +export = m; +>m : Symbol(m, Decl(declFileExportAssignmentImportInternalModule.ts, 17, 1)) + diff --git a/tests/baselines/reference/declFileExportAssignmentImportInternalModule.types b/tests/baselines/reference/declFileExportAssignmentImportInternalModule.types index e0bf172e584..6c3b7d82664 100644 --- a/tests/baselines/reference/declFileExportAssignmentImportInternalModule.types +++ b/tests/baselines/reference/declFileExportAssignmentImportInternalModule.types @@ -3,7 +3,7 @@ module m3 { >m3 : typeof m3 export module m2 { ->m2 : unknown +>m2 : any export interface connectModule { >connectModule : connectModule @@ -33,17 +33,17 @@ module m3 { >server : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; } (): m2.connectExport; ->m2 : unknown +>m2 : any >connectExport : m2.connectExport test1: m2.connectModule; >test1 : m2.connectModule ->m2 : unknown +>m2 : any >connectModule : m2.connectModule test2(): m2.connectModule; >test2 : () => m2.connectModule ->m2 : unknown +>m2 : any >connectModule : m2.connectModule }; diff --git a/tests/baselines/reference/declFileExportAssignmentOfGenericInterface.symbols b/tests/baselines/reference/declFileExportAssignmentOfGenericInterface.symbols new file mode 100644 index 00000000000..d8801ff3fe3 --- /dev/null +++ b/tests/baselines/reference/declFileExportAssignmentOfGenericInterface.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/declFileExportAssignmentOfGenericInterface_1.ts === +import a = require('declFileExportAssignmentOfGenericInterface_0'); +>a : Symbol(a, Decl(declFileExportAssignmentOfGenericInterface_1.ts, 0, 0)) + +export var x: a>; +>x : Symbol(x, Decl(declFileExportAssignmentOfGenericInterface_1.ts, 1, 10)) +>a : Symbol(a, Decl(declFileExportAssignmentOfGenericInterface_1.ts, 0, 0)) +>a : Symbol(a, Decl(declFileExportAssignmentOfGenericInterface_1.ts, 0, 0)) + +x.a; +>x.a : Symbol(a.a, Decl(declFileExportAssignmentOfGenericInterface_0.ts, 1, 18)) +>x : Symbol(x, Decl(declFileExportAssignmentOfGenericInterface_1.ts, 1, 10)) +>a : Symbol(a.a, Decl(declFileExportAssignmentOfGenericInterface_0.ts, 1, 18)) + +=== tests/cases/compiler/declFileExportAssignmentOfGenericInterface_0.ts === + +interface Foo { +>Foo : Symbol(Foo, Decl(declFileExportAssignmentOfGenericInterface_0.ts, 0, 0)) +>T : Symbol(T, Decl(declFileExportAssignmentOfGenericInterface_0.ts, 1, 14)) + + a: string; +>a : Symbol(a, Decl(declFileExportAssignmentOfGenericInterface_0.ts, 1, 18)) +} +export = Foo; +>Foo : Symbol(Foo, Decl(declFileExportAssignmentOfGenericInterface_0.ts, 0, 0)) + diff --git a/tests/baselines/reference/declFileExportAssignmentOfGenericInterface.types b/tests/baselines/reference/declFileExportAssignmentOfGenericInterface.types index 1d77f8ee7a3..59c604540b9 100644 --- a/tests/baselines/reference/declFileExportAssignmentOfGenericInterface.types +++ b/tests/baselines/reference/declFileExportAssignmentOfGenericInterface.types @@ -1,6 +1,6 @@ === tests/cases/compiler/declFileExportAssignmentOfGenericInterface_1.ts === import a = require('declFileExportAssignmentOfGenericInterface_0'); ->a : unknown +>a : any export var x: a>; >x : a> diff --git a/tests/baselines/reference/declFileExportImportChain.symbols b/tests/baselines/reference/declFileExportImportChain.symbols new file mode 100644 index 00000000000..6e59fa2c167 --- /dev/null +++ b/tests/baselines/reference/declFileExportImportChain.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/declFileExportImportChain_d.ts === +import c = require("declFileExportImportChain_c"); +>c : Symbol(c, Decl(declFileExportImportChain_d.ts, 0, 0)) + +export var x: c.b1.a.m2.c1; +>x : Symbol(x, Decl(declFileExportImportChain_d.ts, 1, 10)) +>c : Symbol(c, Decl(declFileExportImportChain_d.ts, 0, 0)) +>b1 : Symbol(c.b1, Decl(declFileExportImportChain_c.ts, 0, 0)) +>a : Symbol(c.b1.a, Decl(declFileExportImportChain_b.ts, 0, 0)) +>m2 : Symbol(c.b1.a.m2, Decl(declFileExportImportChain_a.ts, 1, 11)) +>c1 : Symbol(c.b1.a.m2.c1, Decl(declFileExportImportChain_a.ts, 2, 22)) + +=== tests/cases/compiler/declFileExportImportChain_a.ts === + +module m1 { +>m1 : Symbol(m1, Decl(declFileExportImportChain_a.ts, 0, 0)) + + export module m2 { +>m2 : Symbol(m2, Decl(declFileExportImportChain_a.ts, 1, 11)) + + export class c1 { +>c1 : Symbol(c1, Decl(declFileExportImportChain_a.ts, 2, 22)) + } + } +} +export = m1; +>m1 : Symbol(m1, Decl(declFileExportImportChain_a.ts, 0, 0)) + +=== tests/cases/compiler/declFileExportImportChain_b.ts === +export import a = require("declFileExportImportChain_a"); +>a : Symbol(a, Decl(declFileExportImportChain_b.ts, 0, 0)) + +=== tests/cases/compiler/declFileExportImportChain_b1.ts === +import b = require("declFileExportImportChain_b"); +>b : Symbol(b, Decl(declFileExportImportChain_b1.ts, 0, 0)) + +export = b; +>b : Symbol(b, Decl(declFileExportImportChain_b1.ts, 0, 0)) + +=== tests/cases/compiler/declFileExportImportChain_c.ts === +export import b1 = require("declFileExportImportChain_b1"); +>b1 : Symbol(b1, Decl(declFileExportImportChain_c.ts, 0, 0)) + diff --git a/tests/baselines/reference/declFileExportImportChain.types b/tests/baselines/reference/declFileExportImportChain.types index df71d32d4d9..f9601adb147 100644 --- a/tests/baselines/reference/declFileExportImportChain.types +++ b/tests/baselines/reference/declFileExportImportChain.types @@ -4,10 +4,10 @@ import c = require("declFileExportImportChain_c"); export var x: c.b1.a.m2.c1; >x : c.b1.a.m2.c1 ->c : unknown ->b1 : unknown ->a : unknown ->m2 : unknown +>c : any +>b1 : any +>a : any +>m2 : any >c1 : c.b1.a.m2.c1 === tests/cases/compiler/declFileExportImportChain_a.ts === diff --git a/tests/baselines/reference/declFileExportImportChain2.symbols b/tests/baselines/reference/declFileExportImportChain2.symbols new file mode 100644 index 00000000000..e5a80c87f9e --- /dev/null +++ b/tests/baselines/reference/declFileExportImportChain2.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/declFileExportImportChain2_d.ts === +import c = require("declFileExportImportChain2_c"); +>c : Symbol(c, Decl(declFileExportImportChain2_d.ts, 0, 0)) + +export var x: c.b.m2.c1; +>x : Symbol(x, Decl(declFileExportImportChain2_d.ts, 1, 10)) +>c : Symbol(c, Decl(declFileExportImportChain2_d.ts, 0, 0)) +>b : Symbol(c.b, Decl(declFileExportImportChain2_c.ts, 0, 0)) +>m2 : Symbol(c.b.m2, Decl(declFileExportImportChain2_a.ts, 1, 11)) +>c1 : Symbol(c.b.m2.c1, Decl(declFileExportImportChain2_a.ts, 2, 22)) + +=== tests/cases/compiler/declFileExportImportChain2_a.ts === + +module m1 { +>m1 : Symbol(m1, Decl(declFileExportImportChain2_a.ts, 0, 0)) + + export module m2 { +>m2 : Symbol(m2, Decl(declFileExportImportChain2_a.ts, 1, 11)) + + export class c1 { +>c1 : Symbol(c1, Decl(declFileExportImportChain2_a.ts, 2, 22)) + } + } +} +export = m1; +>m1 : Symbol(m1, Decl(declFileExportImportChain2_a.ts, 0, 0)) + +=== tests/cases/compiler/declFileExportImportChain2_b.ts === +import a = require("declFileExportImportChain2_a"); +>a : Symbol(a, Decl(declFileExportImportChain2_b.ts, 0, 0)) + +export = a; +>a : Symbol(a, Decl(declFileExportImportChain2_b.ts, 0, 0)) + +=== tests/cases/compiler/declFileExportImportChain2_c.ts === +export import b = require("declFileExportImportChain2_b"); +>b : Symbol(b, Decl(declFileExportImportChain2_c.ts, 0, 0)) + diff --git a/tests/baselines/reference/declFileExportImportChain2.types b/tests/baselines/reference/declFileExportImportChain2.types index a0e3f1c31a1..9c583180404 100644 --- a/tests/baselines/reference/declFileExportImportChain2.types +++ b/tests/baselines/reference/declFileExportImportChain2.types @@ -4,9 +4,9 @@ import c = require("declFileExportImportChain2_c"); export var x: c.b.m2.c1; >x : c.b.m2.c1 ->c : unknown ->b : unknown ->m2 : unknown +>c : any +>b : any +>m2 : any >c1 : c.b.m2.c1 === tests/cases/compiler/declFileExportImportChain2_a.ts === diff --git a/tests/baselines/reference/declFileForClassWithMultipleBaseClasses.symbols b/tests/baselines/reference/declFileForClassWithMultipleBaseClasses.symbols new file mode 100644 index 00000000000..e20542996b2 --- /dev/null +++ b/tests/baselines/reference/declFileForClassWithMultipleBaseClasses.symbols @@ -0,0 +1,54 @@ +=== tests/cases/compiler/declFileForClassWithMultipleBaseClasses.ts === + +class A { +>A : Symbol(A, Decl(declFileForClassWithMultipleBaseClasses.ts, 0, 0)) + + foo() { } +>foo : Symbol(foo, Decl(declFileForClassWithMultipleBaseClasses.ts, 1, 9)) +} + +class B { +>B : Symbol(B, Decl(declFileForClassWithMultipleBaseClasses.ts, 3, 1)) + + bar() { } +>bar : Symbol(bar, Decl(declFileForClassWithMultipleBaseClasses.ts, 5, 9)) +} + +interface I { +>I : Symbol(I, Decl(declFileForClassWithMultipleBaseClasses.ts, 7, 1), Decl(declFileForClassWithMultipleBaseClasses.ts, 23, 1)) + + baz(); +>baz : Symbol(baz, Decl(declFileForClassWithMultipleBaseClasses.ts, 9, 13)) +} + +interface J { +>J : Symbol(J, Decl(declFileForClassWithMultipleBaseClasses.ts, 11, 1)) + + bat(); +>bat : Symbol(bat, Decl(declFileForClassWithMultipleBaseClasses.ts, 13, 13)) +} + + +class D implements I, J { +>D : Symbol(D, Decl(declFileForClassWithMultipleBaseClasses.ts, 15, 1)) +>I : Symbol(I, Decl(declFileForClassWithMultipleBaseClasses.ts, 7, 1), Decl(declFileForClassWithMultipleBaseClasses.ts, 23, 1)) +>J : Symbol(J, Decl(declFileForClassWithMultipleBaseClasses.ts, 11, 1)) + + baz() { } +>baz : Symbol(baz, Decl(declFileForClassWithMultipleBaseClasses.ts, 18, 25)) + + bat() { } +>bat : Symbol(bat, Decl(declFileForClassWithMultipleBaseClasses.ts, 19, 13)) + + foo() { } +>foo : Symbol(foo, Decl(declFileForClassWithMultipleBaseClasses.ts, 20, 13)) + + bar() { } +>bar : Symbol(bar, Decl(declFileForClassWithMultipleBaseClasses.ts, 21, 13)) +} + +interface I extends A, B { +>I : Symbol(I, Decl(declFileForClassWithMultipleBaseClasses.ts, 7, 1), Decl(declFileForClassWithMultipleBaseClasses.ts, 23, 1)) +>A : Symbol(A, Decl(declFileForClassWithMultipleBaseClasses.ts, 0, 0)) +>B : Symbol(B, Decl(declFileForClassWithMultipleBaseClasses.ts, 3, 1)) +} diff --git a/tests/baselines/reference/declFileForClassWithPrivateOverloadedFunction.symbols b/tests/baselines/reference/declFileForClassWithPrivateOverloadedFunction.symbols new file mode 100644 index 00000000000..f28a8c2bfc7 --- /dev/null +++ b/tests/baselines/reference/declFileForClassWithPrivateOverloadedFunction.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/declFileForClassWithPrivateOverloadedFunction.ts === + +class C { +>C : Symbol(C, Decl(declFileForClassWithPrivateOverloadedFunction.ts, 0, 0)) + + private foo(x: number); +>foo : Symbol(foo, Decl(declFileForClassWithPrivateOverloadedFunction.ts, 1, 9), Decl(declFileForClassWithPrivateOverloadedFunction.ts, 2, 27), Decl(declFileForClassWithPrivateOverloadedFunction.ts, 3, 27)) +>x : Symbol(x, Decl(declFileForClassWithPrivateOverloadedFunction.ts, 2, 16)) + + private foo(x: string); +>foo : Symbol(foo, Decl(declFileForClassWithPrivateOverloadedFunction.ts, 1, 9), Decl(declFileForClassWithPrivateOverloadedFunction.ts, 2, 27), Decl(declFileForClassWithPrivateOverloadedFunction.ts, 3, 27)) +>x : Symbol(x, Decl(declFileForClassWithPrivateOverloadedFunction.ts, 3, 16)) + + private foo(x: any) { } +>foo : Symbol(foo, Decl(declFileForClassWithPrivateOverloadedFunction.ts, 1, 9), Decl(declFileForClassWithPrivateOverloadedFunction.ts, 2, 27), Decl(declFileForClassWithPrivateOverloadedFunction.ts, 3, 27)) +>x : Symbol(x, Decl(declFileForClassWithPrivateOverloadedFunction.ts, 4, 16)) +} diff --git a/tests/baselines/reference/declFileForExportedImport.symbols b/tests/baselines/reference/declFileForExportedImport.symbols new file mode 100644 index 00000000000..fb7b7cd343f --- /dev/null +++ b/tests/baselines/reference/declFileForExportedImport.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/declFileForExportedImport_1.ts === +/// +export import a = require('declFileForExportedImport_0'); +>a : Symbol(a, Decl(declFileForExportedImport_1.ts, 0, 0)) + +var y = a.x; +>y : Symbol(y, Decl(declFileForExportedImport_1.ts, 2, 3)) +>a.x : Symbol(a.x, Decl(declFileForExportedImport_0.ts, 0, 10)) +>a : Symbol(a, Decl(declFileForExportedImport_1.ts, 0, 0)) +>x : Symbol(a.x, Decl(declFileForExportedImport_0.ts, 0, 10)) + +export import b = a; +>b : Symbol(b, Decl(declFileForExportedImport_1.ts, 2, 12)) +>a : Symbol(a, Decl(declFileForExportedImport_0.ts, 0, 0)) + +var z = b.x; +>z : Symbol(z, Decl(declFileForExportedImport_1.ts, 5, 3)) +>b.x : Symbol(a.x, Decl(declFileForExportedImport_0.ts, 0, 10)) +>b : Symbol(b, Decl(declFileForExportedImport_1.ts, 2, 12)) +>x : Symbol(a.x, Decl(declFileForExportedImport_0.ts, 0, 10)) + +=== tests/cases/compiler/declFileForExportedImport_0.ts === +export var x: number; +>x : Symbol(x, Decl(declFileForExportedImport_0.ts, 0, 10)) + diff --git a/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.symbols b/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.symbols new file mode 100644 index 00000000000..329363ec364 --- /dev/null +++ b/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/declFileForFunctionTypeAsTypeParameter.ts === + +class X { +>X : Symbol(X, Decl(declFileForFunctionTypeAsTypeParameter.ts, 0, 0)) +>T : Symbol(T, Decl(declFileForFunctionTypeAsTypeParameter.ts, 1, 8)) +} +class C extends X<() => number> { +>C : Symbol(C, Decl(declFileForFunctionTypeAsTypeParameter.ts, 2, 1)) +>X : Symbol(X, Decl(declFileForFunctionTypeAsTypeParameter.ts, 0, 0)) +} +interface I extends X<() => number> { +>I : Symbol(I, Decl(declFileForFunctionTypeAsTypeParameter.ts, 4, 1)) +>X : Symbol(X, Decl(declFileForFunctionTypeAsTypeParameter.ts, 0, 0)) +} + + diff --git a/tests/baselines/reference/declFileForInterfaceWithOptionalFunction.symbols b/tests/baselines/reference/declFileForInterfaceWithOptionalFunction.symbols new file mode 100644 index 00000000000..bcec395c80d --- /dev/null +++ b/tests/baselines/reference/declFileForInterfaceWithOptionalFunction.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/declFileForInterfaceWithOptionalFunction.ts === + +interface I { +>I : Symbol(I, Decl(declFileForInterfaceWithOptionalFunction.ts, 0, 0)) + + foo? (x?); +>foo : Symbol(foo, Decl(declFileForInterfaceWithOptionalFunction.ts, 1, 13)) +>x : Symbol(x, Decl(declFileForInterfaceWithOptionalFunction.ts, 2, 10)) + + foo2? (x?: number): number; +>foo2 : Symbol(foo2, Decl(declFileForInterfaceWithOptionalFunction.ts, 2, 14)) +>x : Symbol(x, Decl(declFileForInterfaceWithOptionalFunction.ts, 3, 11)) +} diff --git a/tests/baselines/reference/declFileForInterfaceWithRestParams.symbols b/tests/baselines/reference/declFileForInterfaceWithRestParams.symbols new file mode 100644 index 00000000000..9a0fb4a71da --- /dev/null +++ b/tests/baselines/reference/declFileForInterfaceWithRestParams.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/declFileForInterfaceWithRestParams.ts === + +interface I { +>I : Symbol(I, Decl(declFileForInterfaceWithRestParams.ts, 0, 0)) + + foo(...x): typeof x; +>foo : Symbol(foo, Decl(declFileForInterfaceWithRestParams.ts, 1, 13)) +>x : Symbol(x, Decl(declFileForInterfaceWithRestParams.ts, 2, 8)) +>x : Symbol(x, Decl(declFileForInterfaceWithRestParams.ts, 2, 8)) + + foo2(a: number, ...x): typeof x; +>foo2 : Symbol(foo2, Decl(declFileForInterfaceWithRestParams.ts, 2, 24)) +>a : Symbol(a, Decl(declFileForInterfaceWithRestParams.ts, 3, 9)) +>x : Symbol(x, Decl(declFileForInterfaceWithRestParams.ts, 3, 19)) +>x : Symbol(x, Decl(declFileForInterfaceWithRestParams.ts, 3, 19)) + + foo3(b: string, ...x: string[]): typeof x; +>foo3 : Symbol(foo3, Decl(declFileForInterfaceWithRestParams.ts, 3, 36)) +>b : Symbol(b, Decl(declFileForInterfaceWithRestParams.ts, 4, 9)) +>x : Symbol(x, Decl(declFileForInterfaceWithRestParams.ts, 4, 19)) +>x : Symbol(x, Decl(declFileForInterfaceWithRestParams.ts, 4, 19)) +} diff --git a/tests/baselines/reference/declFileForTypeParameters.symbols b/tests/baselines/reference/declFileForTypeParameters.symbols new file mode 100644 index 00000000000..41c567d89df --- /dev/null +++ b/tests/baselines/reference/declFileForTypeParameters.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/declFileForTypeParameters.ts === + +class C { +>C : Symbol(C, Decl(declFileForTypeParameters.ts, 0, 0)) +>T : Symbol(T, Decl(declFileForTypeParameters.ts, 1, 8)) + + x: T; +>x : Symbol(x, Decl(declFileForTypeParameters.ts, 1, 12)) +>T : Symbol(T, Decl(declFileForTypeParameters.ts, 1, 8)) + + foo(a: T): T { +>foo : Symbol(foo, Decl(declFileForTypeParameters.ts, 2, 9)) +>a : Symbol(a, Decl(declFileForTypeParameters.ts, 3, 8)) +>T : Symbol(T, Decl(declFileForTypeParameters.ts, 1, 8)) +>T : Symbol(T, Decl(declFileForTypeParameters.ts, 1, 8)) + + return this.x; +>this.x : Symbol(x, Decl(declFileForTypeParameters.ts, 1, 12)) +>this : Symbol(C, Decl(declFileForTypeParameters.ts, 0, 0)) +>x : Symbol(x, Decl(declFileForTypeParameters.ts, 1, 12)) + } +} diff --git a/tests/baselines/reference/declFileForVarList.symbols b/tests/baselines/reference/declFileForVarList.symbols new file mode 100644 index 00000000000..9e2fdd3ac6b --- /dev/null +++ b/tests/baselines/reference/declFileForVarList.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/declFileForVarList.ts === + +var x, y, z = 1; +>x : Symbol(x, Decl(declFileForVarList.ts, 1, 3)) +>y : Symbol(y, Decl(declFileForVarList.ts, 1, 6)) +>z : Symbol(z, Decl(declFileForVarList.ts, 1, 9)) + +var x1 = 1, y2 = 2, z2 = 3; +>x1 : Symbol(x1, Decl(declFileForVarList.ts, 2, 3)) +>y2 : Symbol(y2, Decl(declFileForVarList.ts, 2, 11)) +>z2 : Symbol(z2, Decl(declFileForVarList.ts, 2, 19)) + diff --git a/tests/baselines/reference/declFileForVarList.types b/tests/baselines/reference/declFileForVarList.types index 6e148efa1c2..5e55104666b 100644 --- a/tests/baselines/reference/declFileForVarList.types +++ b/tests/baselines/reference/declFileForVarList.types @@ -4,9 +4,13 @@ var x, y, z = 1; >x : any >y : any >z : number +>1 : number var x1 = 1, y2 = 2, z2 = 3; >x1 : number +>1 : number >y2 : number +>2 : number >z2 : number +>3 : number diff --git a/tests/baselines/reference/declFileFunctions.symbols b/tests/baselines/reference/declFileFunctions.symbols new file mode 100644 index 00000000000..ff04d211557 --- /dev/null +++ b/tests/baselines/reference/declFileFunctions.symbols @@ -0,0 +1,148 @@ +=== tests/cases/compiler/declFileFunctions_0.ts === + +/** This comment should appear for foo*/ +export function foo() { +>foo : Symbol(foo, Decl(declFileFunctions_0.ts, 0, 0)) +} +/** This is comment for function signature*/ +export function fooWithParameters(/** this is comment about a*/a: string, +>fooWithParameters : Symbol(fooWithParameters, Decl(declFileFunctions_0.ts, 3, 1)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 5, 34)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(declFileFunctions_0.ts, 5, 73)) + + var d = a; +>d : Symbol(d, Decl(declFileFunctions_0.ts, 8, 7)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 5, 34)) +} +export function fooWithRestParameters(a: string, ...rests: string[]) { +>fooWithRestParameters : Symbol(fooWithRestParameters, Decl(declFileFunctions_0.ts, 9, 1)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 10, 38)) +>rests : Symbol(rests, Decl(declFileFunctions_0.ts, 10, 48)) + + return a + rests.join(""); +>a : Symbol(a, Decl(declFileFunctions_0.ts, 10, 38)) +>rests.join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +>rests : Symbol(rests, Decl(declFileFunctions_0.ts, 10, 48)) +>join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +} + +export function fooWithOverloads(a: string): string; +>fooWithOverloads : Symbol(fooWithOverloads, Decl(declFileFunctions_0.ts, 12, 1), Decl(declFileFunctions_0.ts, 14, 52), Decl(declFileFunctions_0.ts, 15, 52)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 14, 33)) + +export function fooWithOverloads(a: number): number; +>fooWithOverloads : Symbol(fooWithOverloads, Decl(declFileFunctions_0.ts, 12, 1), Decl(declFileFunctions_0.ts, 14, 52), Decl(declFileFunctions_0.ts, 15, 52)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 15, 33)) + +export function fooWithOverloads(a: any): any { +>fooWithOverloads : Symbol(fooWithOverloads, Decl(declFileFunctions_0.ts, 12, 1), Decl(declFileFunctions_0.ts, 14, 52), Decl(declFileFunctions_0.ts, 15, 52)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 16, 33)) + + return a; +>a : Symbol(a, Decl(declFileFunctions_0.ts, 16, 33)) +} + +export function fooWithSingleOverload(a: string): string; +>fooWithSingleOverload : Symbol(fooWithSingleOverload, Decl(declFileFunctions_0.ts, 18, 1), Decl(declFileFunctions_0.ts, 20, 57)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 20, 38)) + +export function fooWithSingleOverload(a: any) { +>fooWithSingleOverload : Symbol(fooWithSingleOverload, Decl(declFileFunctions_0.ts, 18, 1), Decl(declFileFunctions_0.ts, 20, 57)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 21, 38)) + + return a; +>a : Symbol(a, Decl(declFileFunctions_0.ts, 21, 38)) +} + +/** This comment should appear for nonExportedFoo*/ +function nonExportedFoo() { +>nonExportedFoo : Symbol(nonExportedFoo, Decl(declFileFunctions_0.ts, 23, 1)) +} +/** This is comment for function signature*/ +function nonExportedFooWithParameters(/** this is comment about a*/a: string, +>nonExportedFooWithParameters : Symbol(nonExportedFooWithParameters, Decl(declFileFunctions_0.ts, 27, 1)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 29, 38)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(declFileFunctions_0.ts, 29, 77)) + + var d = a; +>d : Symbol(d, Decl(declFileFunctions_0.ts, 32, 7)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 29, 38)) +} +function nonExportedFooWithRestParameters(a: string, ...rests: string[]) { +>nonExportedFooWithRestParameters : Symbol(nonExportedFooWithRestParameters, Decl(declFileFunctions_0.ts, 33, 1)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 34, 42)) +>rests : Symbol(rests, Decl(declFileFunctions_0.ts, 34, 52)) + + return a + rests.join(""); +>a : Symbol(a, Decl(declFileFunctions_0.ts, 34, 42)) +>rests.join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +>rests : Symbol(rests, Decl(declFileFunctions_0.ts, 34, 52)) +>join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +} + +function nonExportedFooWithOverloads(a: string): string; +>nonExportedFooWithOverloads : Symbol(nonExportedFooWithOverloads, Decl(declFileFunctions_0.ts, 36, 1), Decl(declFileFunctions_0.ts, 38, 56), Decl(declFileFunctions_0.ts, 39, 56)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 38, 37)) + +function nonExportedFooWithOverloads(a: number): number; +>nonExportedFooWithOverloads : Symbol(nonExportedFooWithOverloads, Decl(declFileFunctions_0.ts, 36, 1), Decl(declFileFunctions_0.ts, 38, 56), Decl(declFileFunctions_0.ts, 39, 56)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 39, 37)) + +function nonExportedFooWithOverloads(a: any): any { +>nonExportedFooWithOverloads : Symbol(nonExportedFooWithOverloads, Decl(declFileFunctions_0.ts, 36, 1), Decl(declFileFunctions_0.ts, 38, 56), Decl(declFileFunctions_0.ts, 39, 56)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 40, 37)) + + return a; +>a : Symbol(a, Decl(declFileFunctions_0.ts, 40, 37)) +} + +=== tests/cases/compiler/declFileFunctions_1.ts === +/** This comment should appear for foo*/ +function globalfoo() { +>globalfoo : Symbol(globalfoo, Decl(declFileFunctions_1.ts, 0, 0)) +} +/** This is comment for function signature*/ +function globalfooWithParameters(/** this is comment about a*/a: string, +>globalfooWithParameters : Symbol(globalfooWithParameters, Decl(declFileFunctions_1.ts, 2, 1)) +>a : Symbol(a, Decl(declFileFunctions_1.ts, 4, 33)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(declFileFunctions_1.ts, 4, 72)) + + var d = a; +>d : Symbol(d, Decl(declFileFunctions_1.ts, 7, 7)) +>a : Symbol(a, Decl(declFileFunctions_1.ts, 4, 33)) +} +function globalfooWithRestParameters(a: string, ...rests: string[]) { +>globalfooWithRestParameters : Symbol(globalfooWithRestParameters, Decl(declFileFunctions_1.ts, 8, 1)) +>a : Symbol(a, Decl(declFileFunctions_1.ts, 9, 37)) +>rests : Symbol(rests, Decl(declFileFunctions_1.ts, 9, 47)) + + return a + rests.join(""); +>a : Symbol(a, Decl(declFileFunctions_1.ts, 9, 37)) +>rests.join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +>rests : Symbol(rests, Decl(declFileFunctions_1.ts, 9, 47)) +>join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +} +function globalfooWithOverloads(a: string): string; +>globalfooWithOverloads : Symbol(globalfooWithOverloads, Decl(declFileFunctions_1.ts, 11, 1), Decl(declFileFunctions_1.ts, 12, 51), Decl(declFileFunctions_1.ts, 13, 51)) +>a : Symbol(a, Decl(declFileFunctions_1.ts, 12, 32)) + +function globalfooWithOverloads(a: number): number; +>globalfooWithOverloads : Symbol(globalfooWithOverloads, Decl(declFileFunctions_1.ts, 11, 1), Decl(declFileFunctions_1.ts, 12, 51), Decl(declFileFunctions_1.ts, 13, 51)) +>a : Symbol(a, Decl(declFileFunctions_1.ts, 13, 32)) + +function globalfooWithOverloads(a: any): any { +>globalfooWithOverloads : Symbol(globalfooWithOverloads, Decl(declFileFunctions_1.ts, 11, 1), Decl(declFileFunctions_1.ts, 12, 51), Decl(declFileFunctions_1.ts, 13, 51)) +>a : Symbol(a, Decl(declFileFunctions_1.ts, 14, 32)) + + return a; +>a : Symbol(a, Decl(declFileFunctions_1.ts, 14, 32)) +} diff --git a/tests/baselines/reference/declFileFunctions.types b/tests/baselines/reference/declFileFunctions.types index bfbe658a758..b9e94f7ffcd 100644 --- a/tests/baselines/reference/declFileFunctions.types +++ b/tests/baselines/reference/declFileFunctions.types @@ -29,6 +29,7 @@ export function fooWithRestParameters(a: string, ...rests: string[]) { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string +>"" : string } export function fooWithOverloads(a: string): string; @@ -88,6 +89,7 @@ function nonExportedFooWithRestParameters(a: string, ...rests: string[]) { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string +>"" : string } function nonExportedFooWithOverloads(a: string): string; @@ -136,6 +138,7 @@ function globalfooWithRestParameters(a: string, ...rests: string[]) { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string +>"" : string } function globalfooWithOverloads(a: string): string; >globalfooWithOverloads : { (a: string): string; (a: number): number; } diff --git a/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.symbols b/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.symbols new file mode 100644 index 00000000000..c732a6ad233 --- /dev/null +++ b/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/declFileGenericClassWithGenericExtendedClass.ts === +interface IFoo { +>IFoo : Symbol(IFoo, Decl(declFileGenericClassWithGenericExtendedClass.ts, 0, 0)) + + baz: Baz; +>baz : Symbol(baz, Decl(declFileGenericClassWithGenericExtendedClass.ts, 0, 16)) +>Baz : Symbol(Baz, Decl(declFileGenericClassWithGenericExtendedClass.ts, 7, 1)) +} +class Base { } +>Base : Symbol(Base, Decl(declFileGenericClassWithGenericExtendedClass.ts, 2, 1)) +>T : Symbol(T, Decl(declFileGenericClassWithGenericExtendedClass.ts, 3, 11)) + +class Derived extends Base { } +>Derived : Symbol(Derived, Decl(declFileGenericClassWithGenericExtendedClass.ts, 3, 17)) +>T : Symbol(T, Decl(declFileGenericClassWithGenericExtendedClass.ts, 4, 14)) +>Base : Symbol(Base, Decl(declFileGenericClassWithGenericExtendedClass.ts, 2, 1)) +>T : Symbol(T, Decl(declFileGenericClassWithGenericExtendedClass.ts, 4, 14)) + +interface IBar { +>IBar : Symbol(IBar, Decl(declFileGenericClassWithGenericExtendedClass.ts, 4, 36)) +>T : Symbol(T, Decl(declFileGenericClassWithGenericExtendedClass.ts, 5, 15)) + + derived: Derived; +>derived : Symbol(derived, Decl(declFileGenericClassWithGenericExtendedClass.ts, 5, 19)) +>Derived : Symbol(Derived, Decl(declFileGenericClassWithGenericExtendedClass.ts, 3, 17)) +>T : Symbol(T, Decl(declFileGenericClassWithGenericExtendedClass.ts, 5, 15)) +} +class Baz implements IBar { +>Baz : Symbol(Baz, Decl(declFileGenericClassWithGenericExtendedClass.ts, 7, 1)) +>IBar : Symbol(IBar, Decl(declFileGenericClassWithGenericExtendedClass.ts, 4, 36)) +>Baz : Symbol(Baz, Decl(declFileGenericClassWithGenericExtendedClass.ts, 7, 1)) + + derived: Derived; +>derived : Symbol(derived, Decl(declFileGenericClassWithGenericExtendedClass.ts, 8, 32)) +>Derived : Symbol(Derived, Decl(declFileGenericClassWithGenericExtendedClass.ts, 3, 17)) +>Baz : Symbol(Baz, Decl(declFileGenericClassWithGenericExtendedClass.ts, 7, 1)) +} + diff --git a/tests/baselines/reference/declFileGenericType.symbols b/tests/baselines/reference/declFileGenericType.symbols new file mode 100644 index 00000000000..38460fcb143 --- /dev/null +++ b/tests/baselines/reference/declFileGenericType.symbols @@ -0,0 +1,165 @@ +=== tests/cases/compiler/declFileGenericType.ts === +export module C { +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) + + export class A{ } +>A : Symbol(A, Decl(declFileGenericType.ts, 0, 17)) +>T : Symbol(T, Decl(declFileGenericType.ts, 1, 19)) + + export class B { } +>B : Symbol(B, Decl(declFileGenericType.ts, 1, 24)) + + export function F(x: T): A { return null; } +>F : Symbol(F, Decl(declFileGenericType.ts, 2, 22)) +>T : Symbol(T, Decl(declFileGenericType.ts, 4, 22)) +>x : Symbol(x, Decl(declFileGenericType.ts, 4, 25)) +>T : Symbol(T, Decl(declFileGenericType.ts, 4, 22)) +>A : Symbol(A, Decl(declFileGenericType.ts, 0, 17)) +>B : Symbol(B, Decl(declFileGenericType.ts, 1, 24)) + + export function F2(x: T): C.A { return null; } +>F2 : Symbol(F2, Decl(declFileGenericType.ts, 4, 53)) +>T : Symbol(T, Decl(declFileGenericType.ts, 5, 23)) +>x : Symbol(x, Decl(declFileGenericType.ts, 5, 26)) +>T : Symbol(T, Decl(declFileGenericType.ts, 5, 23)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>A : Symbol(A, Decl(declFileGenericType.ts, 0, 17)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>B : Symbol(B, Decl(declFileGenericType.ts, 1, 24)) + + export function F3(x: T): C.A[] { return null; } +>F3 : Symbol(F3, Decl(declFileGenericType.ts, 5, 58)) +>T : Symbol(T, Decl(declFileGenericType.ts, 6, 23)) +>x : Symbol(x, Decl(declFileGenericType.ts, 6, 26)) +>T : Symbol(T, Decl(declFileGenericType.ts, 6, 23)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>A : Symbol(A, Decl(declFileGenericType.ts, 0, 17)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>B : Symbol(B, Decl(declFileGenericType.ts, 1, 24)) + + export function F4>(x: T): Array> { return null; } +>F4 : Symbol(F4, Decl(declFileGenericType.ts, 6, 60)) +>T : Symbol(T, Decl(declFileGenericType.ts, 7, 23)) +>A : Symbol(A, Decl(declFileGenericType.ts, 0, 17)) +>B : Symbol(B, Decl(declFileGenericType.ts, 1, 24)) +>x : Symbol(x, Decl(declFileGenericType.ts, 7, 39)) +>T : Symbol(T, Decl(declFileGenericType.ts, 7, 23)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>A : Symbol(A, Decl(declFileGenericType.ts, 0, 17)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>B : Symbol(B, Decl(declFileGenericType.ts, 1, 24)) + + export function F5(): T { return null; } +>F5 : Symbol(F5, Decl(declFileGenericType.ts, 7, 78)) +>T : Symbol(T, Decl(declFileGenericType.ts, 9, 23)) +>T : Symbol(T, Decl(declFileGenericType.ts, 9, 23)) + + export function F6>(x: T): T { return null; } +>F6 : Symbol(F6, Decl(declFileGenericType.ts, 9, 47)) +>T : Symbol(T, Decl(declFileGenericType.ts, 11, 23)) +>A : Symbol(A, Decl(declFileGenericType.ts, 0, 17)) +>B : Symbol(B, Decl(declFileGenericType.ts, 1, 24)) +>x : Symbol(x, Decl(declFileGenericType.ts, 11, 39)) +>T : Symbol(T, Decl(declFileGenericType.ts, 11, 23)) +>T : Symbol(T, Decl(declFileGenericType.ts, 11, 23)) + + export class D{ +>D : Symbol(D, Decl(declFileGenericType.ts, 11, 64)) +>T : Symbol(T, Decl(declFileGenericType.ts, 13, 19)) + + constructor(public val: T) { } +>val : Symbol(val, Decl(declFileGenericType.ts, 15, 20)) +>T : Symbol(T, Decl(declFileGenericType.ts, 13, 19)) + + } +} + +export var a: C.A; +>a : Symbol(a, Decl(declFileGenericType.ts, 20, 10)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>A : Symbol(C.A, Decl(declFileGenericType.ts, 0, 17)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>B : Symbol(C.B, Decl(declFileGenericType.ts, 1, 24)) + +export var b = C.F; +>b : Symbol(b, Decl(declFileGenericType.ts, 22, 10)) +>C.F : Symbol(C.F, Decl(declFileGenericType.ts, 2, 22)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>F : Symbol(C.F, Decl(declFileGenericType.ts, 2, 22)) + +export var c = C.F2; +>c : Symbol(c, Decl(declFileGenericType.ts, 23, 10)) +>C.F2 : Symbol(C.F2, Decl(declFileGenericType.ts, 4, 53)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>F2 : Symbol(C.F2, Decl(declFileGenericType.ts, 4, 53)) + +export var d = C.F3; +>d : Symbol(d, Decl(declFileGenericType.ts, 24, 10)) +>C.F3 : Symbol(C.F3, Decl(declFileGenericType.ts, 5, 58)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>F3 : Symbol(C.F3, Decl(declFileGenericType.ts, 5, 58)) + +export var e = C.F4; +>e : Symbol(e, Decl(declFileGenericType.ts, 25, 10)) +>C.F4 : Symbol(C.F4, Decl(declFileGenericType.ts, 6, 60)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>F4 : Symbol(C.F4, Decl(declFileGenericType.ts, 6, 60)) + +export var x = (new C.D>(new C.A())).val; +>x : Symbol(x, Decl(declFileGenericType.ts, 27, 10)) +>(new C.D>(new C.A())).val : Symbol(C.D.val, Decl(declFileGenericType.ts, 15, 20)) +>C.D : Symbol(C.D, Decl(declFileGenericType.ts, 11, 64)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>D : Symbol(C.D, Decl(declFileGenericType.ts, 11, 64)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>A : Symbol(C.A, Decl(declFileGenericType.ts, 0, 17)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>B : Symbol(C.B, Decl(declFileGenericType.ts, 1, 24)) +>C.A : Symbol(C.A, Decl(declFileGenericType.ts, 0, 17)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>A : Symbol(C.A, Decl(declFileGenericType.ts, 0, 17)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>B : Symbol(C.B, Decl(declFileGenericType.ts, 1, 24)) +>val : Symbol(C.D.val, Decl(declFileGenericType.ts, 15, 20)) + +export function f>() { } +>f : Symbol(f, Decl(declFileGenericType.ts, 27, 55)) +>T : Symbol(T, Decl(declFileGenericType.ts, 29, 18)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>A : Symbol(C.A, Decl(declFileGenericType.ts, 0, 17)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>B : Symbol(C.B, Decl(declFileGenericType.ts, 1, 24)) + +export var g = C.F5>(); +>g : Symbol(g, Decl(declFileGenericType.ts, 31, 10)) +>C.F5 : Symbol(C.F5, Decl(declFileGenericType.ts, 7, 78)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>F5 : Symbol(C.F5, Decl(declFileGenericType.ts, 7, 78)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>A : Symbol(C.A, Decl(declFileGenericType.ts, 0, 17)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>B : Symbol(C.B, Decl(declFileGenericType.ts, 1, 24)) + +export class h extends C.A{ } +>h : Symbol(h, Decl(declFileGenericType.ts, 31, 32)) +>C.A : Symbol(C.A, Decl(declFileGenericType.ts, 0, 17)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>A : Symbol(C.A, Decl(declFileGenericType.ts, 0, 17)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>B : Symbol(C.B, Decl(declFileGenericType.ts, 1, 24)) + +export interface i extends C.A { } +>i : Symbol(i, Decl(declFileGenericType.ts, 33, 34)) +>C.A : Symbol(C.A, Decl(declFileGenericType.ts, 0, 17)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>A : Symbol(C.A, Decl(declFileGenericType.ts, 0, 17)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>B : Symbol(C.B, Decl(declFileGenericType.ts, 1, 24)) + +export var j = C.F6; +>j : Symbol(j, Decl(declFileGenericType.ts, 37, 10)) +>C.F6 : Symbol(C.F6, Decl(declFileGenericType.ts, 9, 47)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>F6 : Symbol(C.F6, Decl(declFileGenericType.ts, 9, 47)) + diff --git a/tests/baselines/reference/declFileGenericType.types b/tests/baselines/reference/declFileGenericType.types index 50026cc3aeb..7aa20187890 100644 --- a/tests/baselines/reference/declFileGenericType.types +++ b/tests/baselines/reference/declFileGenericType.types @@ -16,26 +16,29 @@ export module C { >T : T >A : A >B : B +>null : null export function F2(x: T): C.A { return null; } >F2 : (x: T) => A >T : T >x : T >T : T ->C : unknown +>C : any >A : A ->C : unknown +>C : any >B : B +>null : null export function F3(x: T): C.A[] { return null; } >F3 : (x: T) => A[] >T : T >x : T >T : T ->C : unknown +>C : any >A : A ->C : unknown +>C : any >B : B +>null : null export function F4>(x: T): Array> { return null; } >F4 : >(x: T) => A[] @@ -45,15 +48,17 @@ export module C { >x : T >T : T >Array : T[] ->C : unknown +>C : any >A : A ->C : unknown +>C : any >B : B +>null : null export function F5(): T { return null; } >F5 : () => T >T : T >T : T +>null : null export function F6>(x: T): T { return null; } >F6 : >(x: T) => T @@ -63,6 +68,7 @@ export module C { >x : T >T : T >T : T +>null : null export class D{ >D : D @@ -77,9 +83,9 @@ export module C { export var a: C.A; >a : C.A ->C : unknown +>C : any >A : C.A ->C : unknown +>C : any >B : C.B export var b = C.F; @@ -114,24 +120,24 @@ export var x = (new C.D>(new C.A())).val; >C.D : typeof C.D >C : typeof C >D : typeof C.D ->C : unknown +>C : any >A : C.A ->C : unknown +>C : any >B : C.B >new C.A() : C.A >C.A : typeof C.A >C : typeof C >A : typeof C.A ->C : unknown +>C : any >B : C.B >val : C.A export function f>() { } >f : >() => void >T : T ->C : unknown +>C : any >A : C.A ->C : unknown +>C : any >B : C.B export var g = C.F5>(); @@ -140,23 +146,25 @@ export var g = C.F5>(); >C.F5 : () => T >C : typeof C >F5 : () => T ->C : unknown +>C : any >A : C.A ->C : unknown +>C : any >B : C.B export class h extends C.A{ } >h : h +>C.A : any >C : typeof C >A : C.A ->C : unknown +>C : any >B : C.B export interface i extends C.A { } >i : i +>C.A : any >C : typeof C >A : C.A ->C : unknown +>C : any >B : C.B export var j = C.F6; diff --git a/tests/baselines/reference/declFileGenericType2.symbols b/tests/baselines/reference/declFileGenericType2.symbols new file mode 100644 index 00000000000..fa1b63a2ac4 --- /dev/null +++ b/tests/baselines/reference/declFileGenericType2.symbols @@ -0,0 +1,147 @@ +=== tests/cases/compiler/declFileGenericType2.ts === + +declare module templa.mvc { +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) + + interface IModel { +>IModel : Symbol(IModel, Decl(declFileGenericType2.ts, 1, 27)) + } +} +declare module templa.mvc { +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) + + interface IController { +>IController : Symbol(IController, Decl(declFileGenericType2.ts, 5, 27)) +>ModelType : Symbol(ModelType, Decl(declFileGenericType2.ts, 6, 26)) +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>IModel : Symbol(IModel, Decl(declFileGenericType2.ts, 1, 27)) + } +} +declare module templa.mvc { +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) + + class AbstractController implements mvc.IController { +>AbstractController : Symbol(AbstractController, Decl(declFileGenericType2.ts, 9, 27)) +>ModelType : Symbol(ModelType, Decl(declFileGenericType2.ts, 10, 29)) +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>IModel : Symbol(IModel, Decl(declFileGenericType2.ts, 1, 27)) +>mvc.IController : Symbol(IController, Decl(declFileGenericType2.ts, 5, 27)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>IController : Symbol(IController, Decl(declFileGenericType2.ts, 5, 27)) +>ModelType : Symbol(ModelType, Decl(declFileGenericType2.ts, 10, 29)) + } +} +declare module templa.mvc.composite { +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>composite : Symbol(composite, Decl(declFileGenericType2.ts, 13, 26)) + + interface ICompositeControllerModel extends mvc.IModel { +>ICompositeControllerModel : Symbol(ICompositeControllerModel, Decl(declFileGenericType2.ts, 13, 37)) +>mvc.IModel : Symbol(IModel, Decl(declFileGenericType2.ts, 1, 27)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>IModel : Symbol(IModel, Decl(declFileGenericType2.ts, 1, 27)) + + getControllers(): mvc.IController[]; +>getControllers : Symbol(getControllers, Decl(declFileGenericType2.ts, 14, 60)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>IController : Symbol(IController, Decl(declFileGenericType2.ts, 5, 27)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>IModel : Symbol(IModel, Decl(declFileGenericType2.ts, 1, 27)) + } +} +module templa.dom.mvc { +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>dom : Symbol(dom, Decl(declFileGenericType2.ts, 18, 14), Decl(declFileGenericType2.ts, 23, 14), Decl(declFileGenericType2.ts, 32, 14)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 18, 18), Decl(declFileGenericType2.ts, 23, 18), Decl(declFileGenericType2.ts, 32, 18)) + + export interface IElementController extends templa.mvc.IController { +>IElementController : Symbol(IElementController, Decl(declFileGenericType2.ts, 18, 23)) +>ModelType : Symbol(ModelType, Decl(declFileGenericType2.ts, 19, 40)) +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>IModel : Symbol(templa.mvc.IModel, Decl(declFileGenericType2.ts, 1, 27)) +>templa.mvc.IController : Symbol(templa.mvc.IController, Decl(declFileGenericType2.ts, 5, 27)) +>templa.mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>IController : Symbol(templa.mvc.IController, Decl(declFileGenericType2.ts, 5, 27)) +>ModelType : Symbol(ModelType, Decl(declFileGenericType2.ts, 19, 40)) + } +} +// Module +module templa.dom.mvc { +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>dom : Symbol(dom, Decl(declFileGenericType2.ts, 18, 14), Decl(declFileGenericType2.ts, 23, 14), Decl(declFileGenericType2.ts, 32, 14)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 18, 18), Decl(declFileGenericType2.ts, 23, 18), Decl(declFileGenericType2.ts, 32, 18)) + + export class AbstractElementController extends templa.mvc.AbstractController implements IElementController { +>AbstractElementController : Symbol(AbstractElementController, Decl(declFileGenericType2.ts, 23, 23)) +>ModelType : Symbol(ModelType, Decl(declFileGenericType2.ts, 25, 43)) +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>IModel : Symbol(templa.mvc.IModel, Decl(declFileGenericType2.ts, 1, 27)) +>templa.mvc.AbstractController : Symbol(templa.mvc.AbstractController, Decl(declFileGenericType2.ts, 9, 27)) +>templa.mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>AbstractController : Symbol(templa.mvc.AbstractController, Decl(declFileGenericType2.ts, 9, 27)) +>ModelType : Symbol(ModelType, Decl(declFileGenericType2.ts, 25, 43)) +>IElementController : Symbol(IElementController, Decl(declFileGenericType2.ts, 18, 23)) +>ModelType : Symbol(ModelType, Decl(declFileGenericType2.ts, 25, 43)) + + constructor() { + super(); +>super : Symbol(templa.mvc.AbstractController, Decl(declFileGenericType2.ts, 9, 27)) + } + } +} +// Module +module templa.dom.mvc.composite { +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>dom : Symbol(dom, Decl(declFileGenericType2.ts, 18, 14), Decl(declFileGenericType2.ts, 23, 14), Decl(declFileGenericType2.ts, 32, 14)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 18, 18), Decl(declFileGenericType2.ts, 23, 18), Decl(declFileGenericType2.ts, 32, 18)) +>composite : Symbol(composite, Decl(declFileGenericType2.ts, 32, 22)) + + export class AbstractCompositeElementController extends templa.dom.mvc.AbstractElementController { +>AbstractCompositeElementController : Symbol(AbstractCompositeElementController, Decl(declFileGenericType2.ts, 32, 33)) +>ModelType : Symbol(ModelType, Decl(declFileGenericType2.ts, 33, 52)) +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>composite : Symbol(templa.mvc.composite, Decl(declFileGenericType2.ts, 13, 26)) +>ICompositeControllerModel : Symbol(templa.mvc.composite.ICompositeControllerModel, Decl(declFileGenericType2.ts, 13, 37)) +>templa.dom.mvc.AbstractElementController : Symbol(AbstractElementController, Decl(declFileGenericType2.ts, 23, 23)) +>templa.dom.mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 18, 18), Decl(declFileGenericType2.ts, 23, 18), Decl(declFileGenericType2.ts, 32, 18)) +>templa.dom : Symbol(dom, Decl(declFileGenericType2.ts, 18, 14), Decl(declFileGenericType2.ts, 23, 14), Decl(declFileGenericType2.ts, 32, 14)) +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>dom : Symbol(dom, Decl(declFileGenericType2.ts, 18, 14), Decl(declFileGenericType2.ts, 23, 14), Decl(declFileGenericType2.ts, 32, 14)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 18, 18), Decl(declFileGenericType2.ts, 23, 18), Decl(declFileGenericType2.ts, 32, 18)) +>AbstractElementController : Symbol(AbstractElementController, Decl(declFileGenericType2.ts, 23, 23)) +>ModelType : Symbol(ModelType, Decl(declFileGenericType2.ts, 33, 52)) + + public _controllers: templa.mvc.IController[]; +>_controllers : Symbol(_controllers, Decl(declFileGenericType2.ts, 33, 179)) +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>IController : Symbol(templa.mvc.IController, Decl(declFileGenericType2.ts, 5, 27)) +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>IModel : Symbol(templa.mvc.IModel, Decl(declFileGenericType2.ts, 1, 27)) + + constructor() { + super(); +>super : Symbol(AbstractElementController, Decl(declFileGenericType2.ts, 23, 23)) + + this._controllers = []; +>this._controllers : Symbol(_controllers, Decl(declFileGenericType2.ts, 33, 179)) +>this : Symbol(AbstractCompositeElementController, Decl(declFileGenericType2.ts, 32, 33)) +>_controllers : Symbol(_controllers, Decl(declFileGenericType2.ts, 33, 179)) + } + } +} + diff --git a/tests/baselines/reference/declFileGenericType2.types b/tests/baselines/reference/declFileGenericType2.types index fed2caca7ac..e1e1aa0bbfb 100644 --- a/tests/baselines/reference/declFileGenericType2.types +++ b/tests/baselines/reference/declFileGenericType2.types @@ -15,8 +15,8 @@ declare module templa.mvc { interface IController { >IController : IController >ModelType : ModelType ->templa : unknown ->mvc : unknown +>templa : any +>mvc : any >IModel : IModel } } @@ -27,9 +27,10 @@ declare module templa.mvc { class AbstractController implements mvc.IController { >AbstractController : AbstractController >ModelType : ModelType ->templa : unknown ->mvc : unknown +>templa : any +>mvc : any >IModel : IModel +>mvc.IController : any >mvc : typeof mvc >IController : IController >ModelType : ModelType @@ -38,18 +39,19 @@ declare module templa.mvc { declare module templa.mvc.composite { >templa : typeof templa >mvc : typeof mvc ->composite : unknown +>composite : any interface ICompositeControllerModel extends mvc.IModel { >ICompositeControllerModel : ICompositeControllerModel +>mvc.IModel : any >mvc : typeof mvc >IModel : IModel getControllers(): mvc.IController[]; >getControllers : () => IController[] ->mvc : unknown +>mvc : any >IController : IController ->mvc : unknown +>mvc : any >IModel : IModel } } @@ -61,9 +63,11 @@ module templa.dom.mvc { export interface IElementController extends templa.mvc.IController { >IElementController : IElementController >ModelType : ModelType ->templa : unknown ->mvc : unknown +>templa : any +>mvc : any >IModel : templa.mvc.IModel +>templa.mvc.IController : any +>templa.mvc : typeof templa.mvc >templa : typeof templa >mvc : typeof templa.mvc >IController : templa.mvc.IController @@ -79,9 +83,11 @@ module templa.dom.mvc { export class AbstractElementController extends templa.mvc.AbstractController implements IElementController { >AbstractElementController : AbstractElementController >ModelType : ModelType ->templa : unknown ->mvc : unknown +>templa : any +>mvc : any >IModel : templa.mvc.IModel +>templa.mvc.AbstractController : any +>templa.mvc : typeof templa.mvc >templa : typeof templa >mvc : typeof templa.mvc >AbstractController : templa.mvc.AbstractController @@ -106,10 +112,13 @@ module templa.dom.mvc.composite { export class AbstractCompositeElementController extends templa.dom.mvc.AbstractElementController { >AbstractCompositeElementController : AbstractCompositeElementController >ModelType : ModelType ->templa : unknown ->mvc : unknown ->composite : unknown +>templa : any +>mvc : any +>composite : any >ICompositeControllerModel : templa.mvc.composite.ICompositeControllerModel +>templa.dom.mvc.AbstractElementController : any +>templa.dom.mvc : typeof mvc +>templa.dom : typeof dom >templa : typeof templa >dom : typeof dom >mvc : typeof mvc @@ -118,11 +127,11 @@ module templa.dom.mvc.composite { public _controllers: templa.mvc.IController[]; >_controllers : templa.mvc.IController[] ->templa : unknown ->mvc : unknown +>templa : any +>mvc : any >IController : templa.mvc.IController ->templa : unknown ->mvc : unknown +>templa : any +>mvc : any >IModel : templa.mvc.IModel constructor() { diff --git a/tests/baselines/reference/declFileImportChainInExportAssignment.symbols b/tests/baselines/reference/declFileImportChainInExportAssignment.symbols new file mode 100644 index 00000000000..12e05bed75a --- /dev/null +++ b/tests/baselines/reference/declFileImportChainInExportAssignment.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/declFileImportChainInExportAssignment.ts === +module m { +>m : Symbol(m, Decl(declFileImportChainInExportAssignment.ts, 0, 0)) + + export module c { +>c : Symbol(c, Decl(declFileImportChainInExportAssignment.ts, 0, 10)) + + export class c { +>c : Symbol(c, Decl(declFileImportChainInExportAssignment.ts, 1, 21)) + } + } +} +import a = m.c; +>a : Symbol(a, Decl(declFileImportChainInExportAssignment.ts, 5, 1)) +>m : Symbol(m, Decl(declFileImportChainInExportAssignment.ts, 0, 0)) +>c : Symbol(a, Decl(declFileImportChainInExportAssignment.ts, 0, 10)) + +import b = a; +>b : Symbol(b, Decl(declFileImportChainInExportAssignment.ts, 6, 15)) +>a : Symbol(a, Decl(declFileImportChainInExportAssignment.ts, 0, 10)) + +export = b; +>b : Symbol(b, Decl(declFileImportChainInExportAssignment.ts, 6, 15)) + diff --git a/tests/baselines/reference/declFileImportModuleWithExportAssignment.symbols b/tests/baselines/reference/declFileImportModuleWithExportAssignment.symbols new file mode 100644 index 00000000000..62d9d599939 --- /dev/null +++ b/tests/baselines/reference/declFileImportModuleWithExportAssignment.symbols @@ -0,0 +1,63 @@ +=== tests/cases/compiler/declFileImportModuleWithExportAssignment_1.ts === +/**This is on import declaration*/ +import a1 = require("declFileImportModuleWithExportAssignment_0"); +>a1 : Symbol(a1, Decl(declFileImportModuleWithExportAssignment_1.ts, 0, 0)) + +export var a = a1; +>a : Symbol(a, Decl(declFileImportModuleWithExportAssignment_1.ts, 2, 10)) +>a1 : Symbol(a1, Decl(declFileImportModuleWithExportAssignment_1.ts, 0, 0)) + +a.test1(null, null, null); +>a.test1 : Symbol(test1, Decl(declFileImportModuleWithExportAssignment_0.ts, 12, 25)) +>a : Symbol(a, Decl(declFileImportModuleWithExportAssignment_1.ts, 2, 10)) +>test1 : Symbol(test1, Decl(declFileImportModuleWithExportAssignment_0.ts, 12, 25)) + +=== tests/cases/compiler/declFileImportModuleWithExportAssignment_0.ts === + +module m2 { +>m2 : Symbol(m2, Decl(declFileImportModuleWithExportAssignment_0.ts, 0, 0), Decl(declFileImportModuleWithExportAssignment_0.ts, 11, 3)) + + export interface connectModule { +>connectModule : Symbol(connectModule, Decl(declFileImportModuleWithExportAssignment_0.ts, 1, 11)) + + (res, req, next): void; +>res : Symbol(res, Decl(declFileImportModuleWithExportAssignment_0.ts, 3, 9)) +>req : Symbol(req, Decl(declFileImportModuleWithExportAssignment_0.ts, 3, 13)) +>next : Symbol(next, Decl(declFileImportModuleWithExportAssignment_0.ts, 3, 18)) + } + export interface connectExport { +>connectExport : Symbol(connectExport, Decl(declFileImportModuleWithExportAssignment_0.ts, 4, 5)) + + use: (mod: connectModule) => connectExport; +>use : Symbol(use, Decl(declFileImportModuleWithExportAssignment_0.ts, 5, 36)) +>mod : Symbol(mod, Decl(declFileImportModuleWithExportAssignment_0.ts, 6, 14)) +>connectModule : Symbol(connectModule, Decl(declFileImportModuleWithExportAssignment_0.ts, 1, 11)) +>connectExport : Symbol(connectExport, Decl(declFileImportModuleWithExportAssignment_0.ts, 4, 5)) + + listen: (port: number) => void; +>listen : Symbol(listen, Decl(declFileImportModuleWithExportAssignment_0.ts, 6, 51)) +>port : Symbol(port, Decl(declFileImportModuleWithExportAssignment_0.ts, 7, 17)) + } + +} +var m2: { +>m2 : Symbol(m2, Decl(declFileImportModuleWithExportAssignment_0.ts, 0, 0), Decl(declFileImportModuleWithExportAssignment_0.ts, 11, 3)) + + (): m2.connectExport; +>m2 : Symbol(m2, Decl(declFileImportModuleWithExportAssignment_0.ts, 0, 0), Decl(declFileImportModuleWithExportAssignment_0.ts, 11, 3)) +>connectExport : Symbol(m2.connectExport, Decl(declFileImportModuleWithExportAssignment_0.ts, 4, 5)) + + test1: m2.connectModule; +>test1 : Symbol(test1, Decl(declFileImportModuleWithExportAssignment_0.ts, 12, 25)) +>m2 : Symbol(m2, Decl(declFileImportModuleWithExportAssignment_0.ts, 0, 0), Decl(declFileImportModuleWithExportAssignment_0.ts, 11, 3)) +>connectModule : Symbol(m2.connectModule, Decl(declFileImportModuleWithExportAssignment_0.ts, 1, 11)) + + test2(): m2.connectModule; +>test2 : Symbol(test2, Decl(declFileImportModuleWithExportAssignment_0.ts, 13, 28)) +>m2 : Symbol(m2, Decl(declFileImportModuleWithExportAssignment_0.ts, 0, 0), Decl(declFileImportModuleWithExportAssignment_0.ts, 11, 3)) +>connectModule : Symbol(m2.connectModule, Decl(declFileImportModuleWithExportAssignment_0.ts, 1, 11)) + +}; +export = m2; +>m2 : Symbol(m2, Decl(declFileImportModuleWithExportAssignment_0.ts, 0, 0), Decl(declFileImportModuleWithExportAssignment_0.ts, 11, 3)) + diff --git a/tests/baselines/reference/declFileImportModuleWithExportAssignment.types b/tests/baselines/reference/declFileImportModuleWithExportAssignment.types index 15201baa487..d3082311c1d 100644 --- a/tests/baselines/reference/declFileImportModuleWithExportAssignment.types +++ b/tests/baselines/reference/declFileImportModuleWithExportAssignment.types @@ -12,6 +12,9 @@ a.test1(null, null, null); >a.test1 : a1.connectModule >a : { (): a1.connectExport; test1: a1.connectModule; test2(): a1.connectModule; } >test1 : a1.connectModule +>null : null +>null : null +>null : null === tests/cases/compiler/declFileImportModuleWithExportAssignment_0.ts === @@ -45,17 +48,17 @@ var m2: { >m2 : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; } (): m2.connectExport; ->m2 : unknown +>m2 : any >connectExport : m2.connectExport test1: m2.connectModule; >test1 : m2.connectModule ->m2 : unknown +>m2 : any >connectModule : m2.connectModule test2(): m2.connectModule; >test2 : () => m2.connectModule ->m2 : unknown +>m2 : any >connectModule : m2.connectModule }; diff --git a/tests/baselines/reference/declFileImportedTypeUseInTypeArgPosition.symbols b/tests/baselines/reference/declFileImportedTypeUseInTypeArgPosition.symbols new file mode 100644 index 00000000000..9efd94c029e --- /dev/null +++ b/tests/baselines/reference/declFileImportedTypeUseInTypeArgPosition.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/declFileImportedTypeUseInTypeArgPosition.ts === +class List { } +>List : Symbol(List, Decl(declFileImportedTypeUseInTypeArgPosition.ts, 0, 0)) +>T : Symbol(T, Decl(declFileImportedTypeUseInTypeArgPosition.ts, 0, 11)) + +declare module 'mod1' { + class Foo { +>Foo : Symbol(Foo, Decl(declFileImportedTypeUseInTypeArgPosition.ts, 1, 23)) + } +} + +declare module 'moo' { + import x = require('mod1'); +>x : Symbol(x, Decl(declFileImportedTypeUseInTypeArgPosition.ts, 6, 22)) + + export var p: List; +>p : Symbol(p, Decl(declFileImportedTypeUseInTypeArgPosition.ts, 8, 14)) +>List : Symbol(List, Decl(declFileImportedTypeUseInTypeArgPosition.ts, 0, 0)) +>x : Symbol(x, Decl(declFileImportedTypeUseInTypeArgPosition.ts, 6, 22)) +>Foo : Symbol(x.Foo, Decl(declFileImportedTypeUseInTypeArgPosition.ts, 1, 23)) +} + + + diff --git a/tests/baselines/reference/declFileImportedTypeUseInTypeArgPosition.types b/tests/baselines/reference/declFileImportedTypeUseInTypeArgPosition.types index f5d443d0c57..317f071efc0 100644 --- a/tests/baselines/reference/declFileImportedTypeUseInTypeArgPosition.types +++ b/tests/baselines/reference/declFileImportedTypeUseInTypeArgPosition.types @@ -16,7 +16,7 @@ declare module 'moo' { export var p: List; >p : List >List : List ->x : unknown +>x : any >Foo : x.Foo } diff --git a/tests/baselines/reference/declFileIndexSignatures.symbols b/tests/baselines/reference/declFileIndexSignatures.symbols new file mode 100644 index 00000000000..e89cfc79b0d --- /dev/null +++ b/tests/baselines/reference/declFileIndexSignatures.symbols @@ -0,0 +1,66 @@ +=== tests/cases/compiler/declFileIndexSignatures_0.ts === + +export interface IStringIndexSignature { +>IStringIndexSignature : Symbol(IStringIndexSignature, Decl(declFileIndexSignatures_0.ts, 0, 0)) + + [s: string]: string; +>s : Symbol(s, Decl(declFileIndexSignatures_0.ts, 2, 5)) +} +export interface INumberIndexSignature { +>INumberIndexSignature : Symbol(INumberIndexSignature, Decl(declFileIndexSignatures_0.ts, 3, 1)) + + [n: number]: number; +>n : Symbol(n, Decl(declFileIndexSignatures_0.ts, 5, 5)) +} + +export interface IBothIndexSignature { +>IBothIndexSignature : Symbol(IBothIndexSignature, Decl(declFileIndexSignatures_0.ts, 6, 1)) + + [s: string]: any; +>s : Symbol(s, Decl(declFileIndexSignatures_0.ts, 9, 5)) + + [n: number]: number; +>n : Symbol(n, Decl(declFileIndexSignatures_0.ts, 10, 5)) +} + +export interface IIndexSignatureWithTypeParameter { +>IIndexSignatureWithTypeParameter : Symbol(IIndexSignatureWithTypeParameter, Decl(declFileIndexSignatures_0.ts, 11, 1)) +>T : Symbol(T, Decl(declFileIndexSignatures_0.ts, 13, 50)) + + [a: string]: T; +>a : Symbol(a, Decl(declFileIndexSignatures_0.ts, 14, 5)) +>T : Symbol(T, Decl(declFileIndexSignatures_0.ts, 13, 50)) +} + +=== tests/cases/compiler/declFileIndexSignatures_1.ts === +interface IGlobalStringIndexSignature { +>IGlobalStringIndexSignature : Symbol(IGlobalStringIndexSignature, Decl(declFileIndexSignatures_1.ts, 0, 0)) + + [s: string]: string; +>s : Symbol(s, Decl(declFileIndexSignatures_1.ts, 1, 5)) +} +interface IGlobalNumberIndexSignature { +>IGlobalNumberIndexSignature : Symbol(IGlobalNumberIndexSignature, Decl(declFileIndexSignatures_1.ts, 2, 1)) + + [n: number]: number; +>n : Symbol(n, Decl(declFileIndexSignatures_1.ts, 4, 5)) +} + +interface IGlobalBothIndexSignature { +>IGlobalBothIndexSignature : Symbol(IGlobalBothIndexSignature, Decl(declFileIndexSignatures_1.ts, 5, 1)) + + [s: string]: any; +>s : Symbol(s, Decl(declFileIndexSignatures_1.ts, 8, 5)) + + [n: number]: number; +>n : Symbol(n, Decl(declFileIndexSignatures_1.ts, 9, 5)) +} + +interface IGlobalIndexSignatureWithTypeParameter { +>IGlobalIndexSignatureWithTypeParameter : Symbol(IGlobalIndexSignatureWithTypeParameter, Decl(declFileIndexSignatures_1.ts, 10, 1)) +>T : Symbol(T, Decl(declFileIndexSignatures_1.ts, 12, 49)) + + [a: string]: T; +>a : Symbol(a, Decl(declFileIndexSignatures_1.ts, 13, 5)) +>T : Symbol(T, Decl(declFileIndexSignatures_1.ts, 12, 49)) +} diff --git a/tests/baselines/reference/declFileInternalAliases.symbols b/tests/baselines/reference/declFileInternalAliases.symbols new file mode 100644 index 00000000000..b41c09a7548 --- /dev/null +++ b/tests/baselines/reference/declFileInternalAliases.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/declFileInternalAliases.ts === +module m { +>m : Symbol(m, Decl(declFileInternalAliases.ts, 0, 0)) + + export class c { +>c : Symbol(c, Decl(declFileInternalAliases.ts, 0, 10)) + } +} +module m1 { +>m1 : Symbol(m1, Decl(declFileInternalAliases.ts, 3, 1)) + + import x = m.c; +>x : Symbol(x, Decl(declFileInternalAliases.ts, 4, 11)) +>m : Symbol(m, Decl(declFileInternalAliases.ts, 0, 0)) +>c : Symbol(x, Decl(declFileInternalAliases.ts, 0, 10)) + + export var d = new x(); // emit the type as m.c +>d : Symbol(d, Decl(declFileInternalAliases.ts, 6, 14)) +>x : Symbol(x, Decl(declFileInternalAliases.ts, 4, 11)) +} +module m2 { +>m2 : Symbol(m2, Decl(declFileInternalAliases.ts, 7, 1)) + + export import x = m.c; +>x : Symbol(x, Decl(declFileInternalAliases.ts, 8, 11)) +>m : Symbol(m, Decl(declFileInternalAliases.ts, 0, 0)) +>c : Symbol(x, Decl(declFileInternalAliases.ts, 0, 10)) + + export var d = new x(); // emit the type as x +>d : Symbol(d, Decl(declFileInternalAliases.ts, 10, 14)) +>x : Symbol(x, Decl(declFileInternalAliases.ts, 8, 11)) +} diff --git a/tests/baselines/reference/declFileMethods.symbols b/tests/baselines/reference/declFileMethods.symbols new file mode 100644 index 00000000000..f0426e46026 --- /dev/null +++ b/tests/baselines/reference/declFileMethods.symbols @@ -0,0 +1,431 @@ +=== tests/cases/compiler/declFileMethods_0.ts === + +export class c1 { +>c1 : Symbol(c1, Decl(declFileMethods_0.ts, 0, 0)) + + /** This comment should appear for foo*/ + public foo() { +>foo : Symbol(foo, Decl(declFileMethods_0.ts, 1, 17)) + } + /** This is comment for function signature*/ + public fooWithParameters(/** this is comment about a*/a: string, +>fooWithParameters : Symbol(fooWithParameters, Decl(declFileMethods_0.ts, 4, 5)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 6, 29)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(declFileMethods_0.ts, 6, 68)) + + var d = a; +>d : Symbol(d, Decl(declFileMethods_0.ts, 9, 11)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 6, 29)) + } + public fooWithRestParameters(a: string, ...rests: string[]) { +>fooWithRestParameters : Symbol(fooWithRestParameters, Decl(declFileMethods_0.ts, 10, 5)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 11, 33)) +>rests : Symbol(rests, Decl(declFileMethods_0.ts, 11, 43)) + + return a + rests.join(""); +>a : Symbol(a, Decl(declFileMethods_0.ts, 11, 33)) +>rests.join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +>rests : Symbol(rests, Decl(declFileMethods_0.ts, 11, 43)) +>join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) + } + + public fooWithOverloads(a: string): string; +>fooWithOverloads : Symbol(fooWithOverloads, Decl(declFileMethods_0.ts, 13, 5), Decl(declFileMethods_0.ts, 15, 47), Decl(declFileMethods_0.ts, 16, 47)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 15, 28)) + + public fooWithOverloads(a: number): number; +>fooWithOverloads : Symbol(fooWithOverloads, Decl(declFileMethods_0.ts, 13, 5), Decl(declFileMethods_0.ts, 15, 47), Decl(declFileMethods_0.ts, 16, 47)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 16, 28)) + + public fooWithOverloads(a: any): any { +>fooWithOverloads : Symbol(fooWithOverloads, Decl(declFileMethods_0.ts, 13, 5), Decl(declFileMethods_0.ts, 15, 47), Decl(declFileMethods_0.ts, 16, 47)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 17, 28)) + + return a; +>a : Symbol(a, Decl(declFileMethods_0.ts, 17, 28)) + } + + + /** This comment should appear for privateFoo*/ + private privateFoo() { +>privateFoo : Symbol(privateFoo, Decl(declFileMethods_0.ts, 19, 5)) + } + /** This is comment for function signature*/ + private privateFooWithParameters(/** this is comment about a*/a: string, +>privateFooWithParameters : Symbol(privateFooWithParameters, Decl(declFileMethods_0.ts, 24, 5)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 26, 37)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(declFileMethods_0.ts, 26, 76)) + + var d = a; +>d : Symbol(d, Decl(declFileMethods_0.ts, 29, 11)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 26, 37)) + } + private privateFooWithRestParameters(a: string, ...rests: string[]) { +>privateFooWithRestParameters : Symbol(privateFooWithRestParameters, Decl(declFileMethods_0.ts, 30, 5)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 31, 41)) +>rests : Symbol(rests, Decl(declFileMethods_0.ts, 31, 51)) + + return a + rests.join(""); +>a : Symbol(a, Decl(declFileMethods_0.ts, 31, 41)) +>rests.join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +>rests : Symbol(rests, Decl(declFileMethods_0.ts, 31, 51)) +>join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) + } + private privateFooWithOverloads(a: string): string; +>privateFooWithOverloads : Symbol(privateFooWithOverloads, Decl(declFileMethods_0.ts, 33, 5), Decl(declFileMethods_0.ts, 34, 55), Decl(declFileMethods_0.ts, 35, 55)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 34, 36)) + + private privateFooWithOverloads(a: number): number; +>privateFooWithOverloads : Symbol(privateFooWithOverloads, Decl(declFileMethods_0.ts, 33, 5), Decl(declFileMethods_0.ts, 34, 55), Decl(declFileMethods_0.ts, 35, 55)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 35, 36)) + + private privateFooWithOverloads(a: any): any { +>privateFooWithOverloads : Symbol(privateFooWithOverloads, Decl(declFileMethods_0.ts, 33, 5), Decl(declFileMethods_0.ts, 34, 55), Decl(declFileMethods_0.ts, 35, 55)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 36, 36)) + + return a; +>a : Symbol(a, Decl(declFileMethods_0.ts, 36, 36)) + } + + + /** This comment should appear for static foo*/ + static staticFoo() { +>staticFoo : Symbol(c1.staticFoo, Decl(declFileMethods_0.ts, 38, 5)) + } + /** This is comment for function signature*/ + static staticFooWithParameters(/** this is comment about a*/a: string, +>staticFooWithParameters : Symbol(c1.staticFooWithParameters, Decl(declFileMethods_0.ts, 43, 5)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 45, 35)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(declFileMethods_0.ts, 45, 74)) + + var d = a; +>d : Symbol(d, Decl(declFileMethods_0.ts, 48, 11)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 45, 35)) + } + static staticFooWithRestParameters(a: string, ...rests: string[]) { +>staticFooWithRestParameters : Symbol(c1.staticFooWithRestParameters, Decl(declFileMethods_0.ts, 49, 5)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 50, 39)) +>rests : Symbol(rests, Decl(declFileMethods_0.ts, 50, 49)) + + return a + rests.join(""); +>a : Symbol(a, Decl(declFileMethods_0.ts, 50, 39)) +>rests.join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +>rests : Symbol(rests, Decl(declFileMethods_0.ts, 50, 49)) +>join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) + } + static staticFooWithOverloads(a: string): string; +>staticFooWithOverloads : Symbol(c1.staticFooWithOverloads, Decl(declFileMethods_0.ts, 52, 5), Decl(declFileMethods_0.ts, 53, 53), Decl(declFileMethods_0.ts, 54, 53)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 53, 34)) + + static staticFooWithOverloads(a: number): number; +>staticFooWithOverloads : Symbol(c1.staticFooWithOverloads, Decl(declFileMethods_0.ts, 52, 5), Decl(declFileMethods_0.ts, 53, 53), Decl(declFileMethods_0.ts, 54, 53)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 54, 34)) + + static staticFooWithOverloads(a: any): any { +>staticFooWithOverloads : Symbol(c1.staticFooWithOverloads, Decl(declFileMethods_0.ts, 52, 5), Decl(declFileMethods_0.ts, 53, 53), Decl(declFileMethods_0.ts, 54, 53)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 55, 34)) + + return a; +>a : Symbol(a, Decl(declFileMethods_0.ts, 55, 34)) + } + + + /** This comment should appear for privateStaticFoo*/ + private static privateStaticFoo() { +>privateStaticFoo : Symbol(c1.privateStaticFoo, Decl(declFileMethods_0.ts, 57, 5)) + } + /** This is comment for function signature*/ + private static privateStaticFooWithParameters(/** this is comment about a*/a: string, +>privateStaticFooWithParameters : Symbol(c1.privateStaticFooWithParameters, Decl(declFileMethods_0.ts, 62, 5)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 64, 50)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(declFileMethods_0.ts, 64, 89)) + + var d = a; +>d : Symbol(d, Decl(declFileMethods_0.ts, 67, 11)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 64, 50)) + } + private static privateStaticFooWithRestParameters(a: string, ...rests: string[]) { +>privateStaticFooWithRestParameters : Symbol(c1.privateStaticFooWithRestParameters, Decl(declFileMethods_0.ts, 68, 5)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 69, 54)) +>rests : Symbol(rests, Decl(declFileMethods_0.ts, 69, 64)) + + return a + rests.join(""); +>a : Symbol(a, Decl(declFileMethods_0.ts, 69, 54)) +>rests.join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +>rests : Symbol(rests, Decl(declFileMethods_0.ts, 69, 64)) +>join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) + } + private static privateStaticFooWithOverloads(a: string): string; +>privateStaticFooWithOverloads : Symbol(c1.privateStaticFooWithOverloads, Decl(declFileMethods_0.ts, 71, 5), Decl(declFileMethods_0.ts, 72, 68), Decl(declFileMethods_0.ts, 73, 68)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 72, 49)) + + private static privateStaticFooWithOverloads(a: number): number; +>privateStaticFooWithOverloads : Symbol(c1.privateStaticFooWithOverloads, Decl(declFileMethods_0.ts, 71, 5), Decl(declFileMethods_0.ts, 72, 68), Decl(declFileMethods_0.ts, 73, 68)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 73, 49)) + + private static privateStaticFooWithOverloads(a: any): any { +>privateStaticFooWithOverloads : Symbol(c1.privateStaticFooWithOverloads, Decl(declFileMethods_0.ts, 71, 5), Decl(declFileMethods_0.ts, 72, 68), Decl(declFileMethods_0.ts, 73, 68)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 74, 49)) + + return a; +>a : Symbol(a, Decl(declFileMethods_0.ts, 74, 49)) + } +} + +export interface I1 { +>I1 : Symbol(I1, Decl(declFileMethods_0.ts, 77, 1)) + + /** This comment should appear for foo*/ + foo(): string; +>foo : Symbol(foo, Decl(declFileMethods_0.ts, 79, 21)) + + /** This is comment for function signature*/ + fooWithParameters(/** this is comment about a*/a: string, +>fooWithParameters : Symbol(fooWithParameters, Decl(declFileMethods_0.ts, 81, 18)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 84, 22)) + + /** this is comment for b*/ + b: number): void; +>b : Symbol(b, Decl(declFileMethods_0.ts, 84, 61)) + + fooWithRestParameters(a: string, ...rests: string[]): string; +>fooWithRestParameters : Symbol(fooWithRestParameters, Decl(declFileMethods_0.ts, 86, 25)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 88, 26)) +>rests : Symbol(rests, Decl(declFileMethods_0.ts, 88, 36)) + + fooWithOverloads(a: string): string; +>fooWithOverloads : Symbol(fooWithOverloads, Decl(declFileMethods_0.ts, 88, 65), Decl(declFileMethods_0.ts, 90, 40)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 90, 21)) + + fooWithOverloads(a: number): number; +>fooWithOverloads : Symbol(fooWithOverloads, Decl(declFileMethods_0.ts, 88, 65), Decl(declFileMethods_0.ts, 90, 40)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 91, 21)) +} + +=== tests/cases/compiler/declFileMethods_1.ts === +class c2 { +>c2 : Symbol(c2, Decl(declFileMethods_1.ts, 0, 0)) + + /** This comment should appear for foo*/ + public foo() { +>foo : Symbol(foo, Decl(declFileMethods_1.ts, 0, 10)) + } + /** This is comment for function signature*/ + public fooWithParameters(/** this is comment about a*/a: string, +>fooWithParameters : Symbol(fooWithParameters, Decl(declFileMethods_1.ts, 3, 5)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 5, 29)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(declFileMethods_1.ts, 5, 68)) + + var d = a; +>d : Symbol(d, Decl(declFileMethods_1.ts, 8, 11)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 5, 29)) + } + public fooWithRestParameters(a: string, ...rests: string[]) { +>fooWithRestParameters : Symbol(fooWithRestParameters, Decl(declFileMethods_1.ts, 9, 5)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 10, 33)) +>rests : Symbol(rests, Decl(declFileMethods_1.ts, 10, 43)) + + return a + rests.join(""); +>a : Symbol(a, Decl(declFileMethods_1.ts, 10, 33)) +>rests.join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +>rests : Symbol(rests, Decl(declFileMethods_1.ts, 10, 43)) +>join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) + } + + public fooWithOverloads(a: string): string; +>fooWithOverloads : Symbol(fooWithOverloads, Decl(declFileMethods_1.ts, 12, 5), Decl(declFileMethods_1.ts, 14, 47), Decl(declFileMethods_1.ts, 15, 47)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 14, 28)) + + public fooWithOverloads(a: number): number; +>fooWithOverloads : Symbol(fooWithOverloads, Decl(declFileMethods_1.ts, 12, 5), Decl(declFileMethods_1.ts, 14, 47), Decl(declFileMethods_1.ts, 15, 47)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 15, 28)) + + public fooWithOverloads(a: any): any { +>fooWithOverloads : Symbol(fooWithOverloads, Decl(declFileMethods_1.ts, 12, 5), Decl(declFileMethods_1.ts, 14, 47), Decl(declFileMethods_1.ts, 15, 47)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 16, 28)) + + return a; +>a : Symbol(a, Decl(declFileMethods_1.ts, 16, 28)) + } + + + /** This comment should appear for privateFoo*/ + private privateFoo() { +>privateFoo : Symbol(privateFoo, Decl(declFileMethods_1.ts, 18, 5)) + } + /** This is comment for function signature*/ + private privateFooWithParameters(/** this is comment about a*/a: string, +>privateFooWithParameters : Symbol(privateFooWithParameters, Decl(declFileMethods_1.ts, 23, 5)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 25, 37)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(declFileMethods_1.ts, 25, 76)) + + var d = a; +>d : Symbol(d, Decl(declFileMethods_1.ts, 28, 11)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 25, 37)) + } + private privateFooWithRestParameters(a: string, ...rests: string[]) { +>privateFooWithRestParameters : Symbol(privateFooWithRestParameters, Decl(declFileMethods_1.ts, 29, 5)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 30, 41)) +>rests : Symbol(rests, Decl(declFileMethods_1.ts, 30, 51)) + + return a + rests.join(""); +>a : Symbol(a, Decl(declFileMethods_1.ts, 30, 41)) +>rests.join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +>rests : Symbol(rests, Decl(declFileMethods_1.ts, 30, 51)) +>join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) + } + private privateFooWithOverloads(a: string): string; +>privateFooWithOverloads : Symbol(privateFooWithOverloads, Decl(declFileMethods_1.ts, 32, 5), Decl(declFileMethods_1.ts, 33, 55), Decl(declFileMethods_1.ts, 34, 55)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 33, 36)) + + private privateFooWithOverloads(a: number): number; +>privateFooWithOverloads : Symbol(privateFooWithOverloads, Decl(declFileMethods_1.ts, 32, 5), Decl(declFileMethods_1.ts, 33, 55), Decl(declFileMethods_1.ts, 34, 55)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 34, 36)) + + private privateFooWithOverloads(a: any): any { +>privateFooWithOverloads : Symbol(privateFooWithOverloads, Decl(declFileMethods_1.ts, 32, 5), Decl(declFileMethods_1.ts, 33, 55), Decl(declFileMethods_1.ts, 34, 55)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 35, 36)) + + return a; +>a : Symbol(a, Decl(declFileMethods_1.ts, 35, 36)) + } + + + /** This comment should appear for static foo*/ + static staticFoo() { +>staticFoo : Symbol(c2.staticFoo, Decl(declFileMethods_1.ts, 37, 5)) + } + /** This is comment for function signature*/ + static staticFooWithParameters(/** this is comment about a*/a: string, +>staticFooWithParameters : Symbol(c2.staticFooWithParameters, Decl(declFileMethods_1.ts, 42, 5)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 44, 35)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(declFileMethods_1.ts, 44, 74)) + + var d = a; +>d : Symbol(d, Decl(declFileMethods_1.ts, 47, 11)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 44, 35)) + } + static staticFooWithRestParameters(a: string, ...rests: string[]) { +>staticFooWithRestParameters : Symbol(c2.staticFooWithRestParameters, Decl(declFileMethods_1.ts, 48, 5)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 49, 39)) +>rests : Symbol(rests, Decl(declFileMethods_1.ts, 49, 49)) + + return a + rests.join(""); +>a : Symbol(a, Decl(declFileMethods_1.ts, 49, 39)) +>rests.join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +>rests : Symbol(rests, Decl(declFileMethods_1.ts, 49, 49)) +>join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) + } + static staticFooWithOverloads(a: string): string; +>staticFooWithOverloads : Symbol(c2.staticFooWithOverloads, Decl(declFileMethods_1.ts, 51, 5), Decl(declFileMethods_1.ts, 52, 53), Decl(declFileMethods_1.ts, 53, 53)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 52, 34)) + + static staticFooWithOverloads(a: number): number; +>staticFooWithOverloads : Symbol(c2.staticFooWithOverloads, Decl(declFileMethods_1.ts, 51, 5), Decl(declFileMethods_1.ts, 52, 53), Decl(declFileMethods_1.ts, 53, 53)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 53, 34)) + + static staticFooWithOverloads(a: any): any { +>staticFooWithOverloads : Symbol(c2.staticFooWithOverloads, Decl(declFileMethods_1.ts, 51, 5), Decl(declFileMethods_1.ts, 52, 53), Decl(declFileMethods_1.ts, 53, 53)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 54, 34)) + + return a; +>a : Symbol(a, Decl(declFileMethods_1.ts, 54, 34)) + } + + + /** This comment should appear for privateStaticFoo*/ + private static privateStaticFoo() { +>privateStaticFoo : Symbol(c2.privateStaticFoo, Decl(declFileMethods_1.ts, 56, 5)) + } + /** This is comment for function signature*/ + private static privateStaticFooWithParameters(/** this is comment about a*/a: string, +>privateStaticFooWithParameters : Symbol(c2.privateStaticFooWithParameters, Decl(declFileMethods_1.ts, 61, 5)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 63, 50)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(declFileMethods_1.ts, 63, 89)) + + var d = a; +>d : Symbol(d, Decl(declFileMethods_1.ts, 66, 11)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 63, 50)) + } + private static privateStaticFooWithRestParameters(a: string, ...rests: string[]) { +>privateStaticFooWithRestParameters : Symbol(c2.privateStaticFooWithRestParameters, Decl(declFileMethods_1.ts, 67, 5)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 68, 54)) +>rests : Symbol(rests, Decl(declFileMethods_1.ts, 68, 64)) + + return a + rests.join(""); +>a : Symbol(a, Decl(declFileMethods_1.ts, 68, 54)) +>rests.join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +>rests : Symbol(rests, Decl(declFileMethods_1.ts, 68, 64)) +>join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) + } + private static privateStaticFooWithOverloads(a: string): string; +>privateStaticFooWithOverloads : Symbol(c2.privateStaticFooWithOverloads, Decl(declFileMethods_1.ts, 70, 5), Decl(declFileMethods_1.ts, 71, 68), Decl(declFileMethods_1.ts, 72, 68)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 71, 49)) + + private static privateStaticFooWithOverloads(a: number): number; +>privateStaticFooWithOverloads : Symbol(c2.privateStaticFooWithOverloads, Decl(declFileMethods_1.ts, 70, 5), Decl(declFileMethods_1.ts, 71, 68), Decl(declFileMethods_1.ts, 72, 68)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 72, 49)) + + private static privateStaticFooWithOverloads(a: any): any { +>privateStaticFooWithOverloads : Symbol(c2.privateStaticFooWithOverloads, Decl(declFileMethods_1.ts, 70, 5), Decl(declFileMethods_1.ts, 71, 68), Decl(declFileMethods_1.ts, 72, 68)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 73, 49)) + + return a; +>a : Symbol(a, Decl(declFileMethods_1.ts, 73, 49)) + } +} + +interface I2 { +>I2 : Symbol(I2, Decl(declFileMethods_1.ts, 76, 1)) + + /** This comment should appear for foo*/ + foo(): string; +>foo : Symbol(foo, Decl(declFileMethods_1.ts, 78, 14)) + + /** This is comment for function signature*/ + fooWithParameters(/** this is comment about a*/a: string, +>fooWithParameters : Symbol(fooWithParameters, Decl(declFileMethods_1.ts, 80, 18)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 83, 22)) + + /** this is comment for b*/ + b: number): void; +>b : Symbol(b, Decl(declFileMethods_1.ts, 83, 61)) + + fooWithRestParameters(a: string, ...rests: string[]): string; +>fooWithRestParameters : Symbol(fooWithRestParameters, Decl(declFileMethods_1.ts, 85, 25)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 87, 26)) +>rests : Symbol(rests, Decl(declFileMethods_1.ts, 87, 36)) + + fooWithOverloads(a: string): string; +>fooWithOverloads : Symbol(fooWithOverloads, Decl(declFileMethods_1.ts, 87, 65), Decl(declFileMethods_1.ts, 89, 40)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 89, 21)) + + fooWithOverloads(a: number): number; +>fooWithOverloads : Symbol(fooWithOverloads, Decl(declFileMethods_1.ts, 87, 65), Decl(declFileMethods_1.ts, 89, 40)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 90, 21)) +} + diff --git a/tests/baselines/reference/declFileMethods.types b/tests/baselines/reference/declFileMethods.types index 6432540f5a4..ecd7b8e0cff 100644 --- a/tests/baselines/reference/declFileMethods.types +++ b/tests/baselines/reference/declFileMethods.types @@ -32,6 +32,7 @@ export class c1 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string +>"" : string } public fooWithOverloads(a: string): string; @@ -80,6 +81,7 @@ export class c1 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string +>"" : string } private privateFooWithOverloads(a: string): string; >privateFooWithOverloads : { (a: string): string; (a: number): number; } @@ -127,6 +129,7 @@ export class c1 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string +>"" : string } static staticFooWithOverloads(a: string): string; >staticFooWithOverloads : { (a: string): string; (a: number): number; } @@ -174,6 +177,7 @@ export class c1 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string +>"" : string } private static privateStaticFooWithOverloads(a: string): string; >privateStaticFooWithOverloads : { (a: string): string; (a: number): number; } @@ -255,6 +259,7 @@ class c2 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string +>"" : string } public fooWithOverloads(a: string): string; @@ -303,6 +308,7 @@ class c2 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string +>"" : string } private privateFooWithOverloads(a: string): string; >privateFooWithOverloads : { (a: string): string; (a: number): number; } @@ -350,6 +356,7 @@ class c2 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string +>"" : string } static staticFooWithOverloads(a: string): string; >staticFooWithOverloads : { (a: string): string; (a: number): number; } @@ -397,6 +404,7 @@ class c2 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string +>"" : string } private static privateStaticFooWithOverloads(a: string): string; >privateStaticFooWithOverloads : { (a: string): string; (a: number): number; } diff --git a/tests/baselines/reference/declFileModuleAssignmentInObjectLiteralProperty.symbols b/tests/baselines/reference/declFileModuleAssignmentInObjectLiteralProperty.symbols new file mode 100644 index 00000000000..b47f6faeb50 --- /dev/null +++ b/tests/baselines/reference/declFileModuleAssignmentInObjectLiteralProperty.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/declFileModuleAssignmentInObjectLiteralProperty.ts === + +module m1 { +>m1 : Symbol(m1, Decl(declFileModuleAssignmentInObjectLiteralProperty.ts, 0, 0)) + + export class c { +>c : Symbol(c, Decl(declFileModuleAssignmentInObjectLiteralProperty.ts, 1, 11)) + } +} +var d = { +>d : Symbol(d, Decl(declFileModuleAssignmentInObjectLiteralProperty.ts, 5, 3)) + + m1: { m: m1 }, +>m1 : Symbol(m1, Decl(declFileModuleAssignmentInObjectLiteralProperty.ts, 5, 9)) +>m : Symbol(m, Decl(declFileModuleAssignmentInObjectLiteralProperty.ts, 6, 9)) +>m1 : Symbol(m1, Decl(declFileModuleAssignmentInObjectLiteralProperty.ts, 0, 0)) + + m2: { c: m1.c }, +>m2 : Symbol(m2, Decl(declFileModuleAssignmentInObjectLiteralProperty.ts, 6, 18)) +>c : Symbol(c, Decl(declFileModuleAssignmentInObjectLiteralProperty.ts, 7, 9)) +>m1.c : Symbol(m1.c, Decl(declFileModuleAssignmentInObjectLiteralProperty.ts, 1, 11)) +>m1 : Symbol(m1, Decl(declFileModuleAssignmentInObjectLiteralProperty.ts, 0, 0)) +>c : Symbol(m1.c, Decl(declFileModuleAssignmentInObjectLiteralProperty.ts, 1, 11)) + +}; diff --git a/tests/baselines/reference/declFileModuleContinuation.symbols b/tests/baselines/reference/declFileModuleContinuation.symbols new file mode 100644 index 00000000000..6a1b0492f1d --- /dev/null +++ b/tests/baselines/reference/declFileModuleContinuation.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/declFileModuleContinuation.ts === +module A.C { +>A : Symbol(A, Decl(declFileModuleContinuation.ts, 0, 0), Decl(declFileModuleContinuation.ts, 3, 1)) +>C : Symbol(C, Decl(declFileModuleContinuation.ts, 0, 9)) + + export interface Z { +>Z : Symbol(Z, Decl(declFileModuleContinuation.ts, 0, 12)) + } +} + +module A.B.C { +>A : Symbol(A, Decl(declFileModuleContinuation.ts, 0, 0), Decl(declFileModuleContinuation.ts, 3, 1)) +>B : Symbol(B, Decl(declFileModuleContinuation.ts, 5, 9)) +>C : Symbol(C, Decl(declFileModuleContinuation.ts, 5, 11)) + + export class W implements A.C.Z { +>W : Symbol(W, Decl(declFileModuleContinuation.ts, 5, 14)) +>A.C.Z : Symbol(A.C.Z, Decl(declFileModuleContinuation.ts, 0, 12)) +>A.C : Symbol(C, Decl(declFileModuleContinuation.ts, 0, 9)) +>A : Symbol(A, Decl(declFileModuleContinuation.ts, 0, 0), Decl(declFileModuleContinuation.ts, 3, 1)) +>C : Symbol(C, Decl(declFileModuleContinuation.ts, 0, 9)) +>Z : Symbol(A.C.Z, Decl(declFileModuleContinuation.ts, 0, 12)) + } +} diff --git a/tests/baselines/reference/declFileModuleContinuation.types b/tests/baselines/reference/declFileModuleContinuation.types index 0080d7cbbf3..f2a1295d5bd 100644 --- a/tests/baselines/reference/declFileModuleContinuation.types +++ b/tests/baselines/reference/declFileModuleContinuation.types @@ -1,7 +1,7 @@ === tests/cases/compiler/declFileModuleContinuation.ts === module A.C { >A : typeof A ->C : unknown +>C : any export interface Z { >Z : Z @@ -15,8 +15,10 @@ module A.B.C { export class W implements A.C.Z { >W : W +>A.C.Z : any +>A.C : any >A : typeof A ->C : unknown +>C : any >Z : A.C.Z } } diff --git a/tests/baselines/reference/declFileModuleWithPropertyOfTypeModule.symbols b/tests/baselines/reference/declFileModuleWithPropertyOfTypeModule.symbols new file mode 100644 index 00000000000..ee69745e8d3 --- /dev/null +++ b/tests/baselines/reference/declFileModuleWithPropertyOfTypeModule.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/declFileModuleWithPropertyOfTypeModule.ts === + +module m { +>m : Symbol(m, Decl(declFileModuleWithPropertyOfTypeModule.ts, 0, 0)) + + export class c { +>c : Symbol(c, Decl(declFileModuleWithPropertyOfTypeModule.ts, 1, 10)) + } + + export var a = m; +>a : Symbol(a, Decl(declFileModuleWithPropertyOfTypeModule.ts, 5, 14)) +>m : Symbol(m, Decl(declFileModuleWithPropertyOfTypeModule.ts, 0, 0)) +} diff --git a/tests/baselines/reference/declFileOptionalInterfaceMethod.symbols b/tests/baselines/reference/declFileOptionalInterfaceMethod.symbols new file mode 100644 index 00000000000..2bf0c640fe5 --- /dev/null +++ b/tests/baselines/reference/declFileOptionalInterfaceMethod.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/declFileOptionalInterfaceMethod.ts === +interface X { +>X : Symbol(X, Decl(declFileOptionalInterfaceMethod.ts, 0, 0)) + + f? (); +>f : Symbol(f, Decl(declFileOptionalInterfaceMethod.ts, 0, 13)) +>T : Symbol(T, Decl(declFileOptionalInterfaceMethod.ts, 1, 8)) +} + diff --git a/tests/baselines/reference/declFilePrivateMethodOverloads.symbols b/tests/baselines/reference/declFilePrivateMethodOverloads.symbols new file mode 100644 index 00000000000..4f02212d79e --- /dev/null +++ b/tests/baselines/reference/declFilePrivateMethodOverloads.symbols @@ -0,0 +1,76 @@ +=== tests/cases/compiler/declFilePrivateMethodOverloads.ts === + +interface IContext { +>IContext : Symbol(IContext, Decl(declFilePrivateMethodOverloads.ts, 0, 0)) + + someMethod(); +>someMethod : Symbol(someMethod, Decl(declFilePrivateMethodOverloads.ts, 1, 20)) +} +class c1 { +>c1 : Symbol(c1, Decl(declFilePrivateMethodOverloads.ts, 3, 1)) + + private _forEachBindingContext(bindingContext: IContext, fn: (bindingContext: IContext) => void); +>_forEachBindingContext : Symbol(_forEachBindingContext, Decl(declFilePrivateMethodOverloads.ts, 4, 10), Decl(declFilePrivateMethodOverloads.ts, 5, 101), Decl(declFilePrivateMethodOverloads.ts, 6, 113)) +>bindingContext : Symbol(bindingContext, Decl(declFilePrivateMethodOverloads.ts, 5, 35)) +>IContext : Symbol(IContext, Decl(declFilePrivateMethodOverloads.ts, 0, 0)) +>fn : Symbol(fn, Decl(declFilePrivateMethodOverloads.ts, 5, 60)) +>bindingContext : Symbol(bindingContext, Decl(declFilePrivateMethodOverloads.ts, 5, 66)) +>IContext : Symbol(IContext, Decl(declFilePrivateMethodOverloads.ts, 0, 0)) + + private _forEachBindingContext(bindingContextArray: Array, fn: (bindingContext: IContext) => void); +>_forEachBindingContext : Symbol(_forEachBindingContext, Decl(declFilePrivateMethodOverloads.ts, 4, 10), Decl(declFilePrivateMethodOverloads.ts, 5, 101), Decl(declFilePrivateMethodOverloads.ts, 6, 113)) +>bindingContextArray : Symbol(bindingContextArray, Decl(declFilePrivateMethodOverloads.ts, 6, 35)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>IContext : Symbol(IContext, Decl(declFilePrivateMethodOverloads.ts, 0, 0)) +>fn : Symbol(fn, Decl(declFilePrivateMethodOverloads.ts, 6, 72)) +>bindingContext : Symbol(bindingContext, Decl(declFilePrivateMethodOverloads.ts, 6, 78)) +>IContext : Symbol(IContext, Decl(declFilePrivateMethodOverloads.ts, 0, 0)) + + private _forEachBindingContext(context, fn: (bindingContext: IContext) => void): void { +>_forEachBindingContext : Symbol(_forEachBindingContext, Decl(declFilePrivateMethodOverloads.ts, 4, 10), Decl(declFilePrivateMethodOverloads.ts, 5, 101), Decl(declFilePrivateMethodOverloads.ts, 6, 113)) +>context : Symbol(context, Decl(declFilePrivateMethodOverloads.ts, 7, 35)) +>fn : Symbol(fn, Decl(declFilePrivateMethodOverloads.ts, 7, 43)) +>bindingContext : Symbol(bindingContext, Decl(declFilePrivateMethodOverloads.ts, 7, 49)) +>IContext : Symbol(IContext, Decl(declFilePrivateMethodOverloads.ts, 0, 0)) + + // Function here + } + + private overloadWithArityDifference(bindingContext: IContext); +>overloadWithArityDifference : Symbol(overloadWithArityDifference, Decl(declFilePrivateMethodOverloads.ts, 9, 5), Decl(declFilePrivateMethodOverloads.ts, 11, 66), Decl(declFilePrivateMethodOverloads.ts, 12, 118)) +>bindingContext : Symbol(bindingContext, Decl(declFilePrivateMethodOverloads.ts, 11, 40)) +>IContext : Symbol(IContext, Decl(declFilePrivateMethodOverloads.ts, 0, 0)) + + private overloadWithArityDifference(bindingContextArray: Array, fn: (bindingContext: IContext) => void); +>overloadWithArityDifference : Symbol(overloadWithArityDifference, Decl(declFilePrivateMethodOverloads.ts, 9, 5), Decl(declFilePrivateMethodOverloads.ts, 11, 66), Decl(declFilePrivateMethodOverloads.ts, 12, 118)) +>bindingContextArray : Symbol(bindingContextArray, Decl(declFilePrivateMethodOverloads.ts, 12, 40)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>IContext : Symbol(IContext, Decl(declFilePrivateMethodOverloads.ts, 0, 0)) +>fn : Symbol(fn, Decl(declFilePrivateMethodOverloads.ts, 12, 77)) +>bindingContext : Symbol(bindingContext, Decl(declFilePrivateMethodOverloads.ts, 12, 83)) +>IContext : Symbol(IContext, Decl(declFilePrivateMethodOverloads.ts, 0, 0)) + + private overloadWithArityDifference(context): void { +>overloadWithArityDifference : Symbol(overloadWithArityDifference, Decl(declFilePrivateMethodOverloads.ts, 9, 5), Decl(declFilePrivateMethodOverloads.ts, 11, 66), Decl(declFilePrivateMethodOverloads.ts, 12, 118)) +>context : Symbol(context, Decl(declFilePrivateMethodOverloads.ts, 13, 40)) + + // Function here + } +} +declare class c2 { +>c2 : Symbol(c2, Decl(declFilePrivateMethodOverloads.ts, 16, 1)) + + private overload1(context, fn); +>overload1 : Symbol(overload1, Decl(declFilePrivateMethodOverloads.ts, 17, 18)) +>context : Symbol(context, Decl(declFilePrivateMethodOverloads.ts, 18, 22)) +>fn : Symbol(fn, Decl(declFilePrivateMethodOverloads.ts, 18, 30)) + + private overload2(context); +>overload2 : Symbol(overload2, Decl(declFilePrivateMethodOverloads.ts, 18, 35), Decl(declFilePrivateMethodOverloads.ts, 20, 31)) +>context : Symbol(context, Decl(declFilePrivateMethodOverloads.ts, 20, 22)) + + private overload2(context, fn); +>overload2 : Symbol(overload2, Decl(declFilePrivateMethodOverloads.ts, 18, 35), Decl(declFilePrivateMethodOverloads.ts, 20, 31)) +>context : Symbol(context, Decl(declFilePrivateMethodOverloads.ts, 21, 22)) +>fn : Symbol(fn, Decl(declFilePrivateMethodOverloads.ts, 21, 30)) +} diff --git a/tests/baselines/reference/declFileRegressionTests.symbols b/tests/baselines/reference/declFileRegressionTests.symbols new file mode 100644 index 00000000000..ea8f9e2fe2a --- /dev/null +++ b/tests/baselines/reference/declFileRegressionTests.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/declFileRegressionTests.ts === +// 'null' not converted to 'any' in d.ts +// function types not piped through correctly +var n = { w: null, x: '', y: () => { }, z: 32 }; +>n : Symbol(n, Decl(declFileRegressionTests.ts, 2, 3)) +>w : Symbol(w, Decl(declFileRegressionTests.ts, 2, 9)) +>x : Symbol(x, Decl(declFileRegressionTests.ts, 2, 18)) +>y : Symbol(y, Decl(declFileRegressionTests.ts, 2, 25)) +>z : Symbol(z, Decl(declFileRegressionTests.ts, 2, 39)) + + diff --git a/tests/baselines/reference/declFileRegressionTests.types b/tests/baselines/reference/declFileRegressionTests.types index 8d058769c0a..7b8933e1def 100644 --- a/tests/baselines/reference/declFileRegressionTests.types +++ b/tests/baselines/reference/declFileRegressionTests.types @@ -5,9 +5,12 @@ var n = { w: null, x: '', y: () => { }, z: 32 }; >n : { w: any; x: string; y: () => void; z: number; } >{ w: null, x: '', y: () => { }, z: 32 } : { w: null; x: string; y: () => void; z: number; } >w : null +>null : null >x : string +>'' : string >y : () => void >() => { } : () => void >z : number +>32 : number diff --git a/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.symbols b/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.symbols new file mode 100644 index 00000000000..49758e4ceb1 --- /dev/null +++ b/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/declFileRestParametersOfFunctionAndFunctionType.ts === + +function f1(...args) { } +>f1 : Symbol(f1, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 0, 0)) +>args : Symbol(args, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 1, 12)) + +function f2(x: (...args) => void) { } +>f2 : Symbol(f2, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 1, 24)) +>x : Symbol(x, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 2, 12)) +>args : Symbol(args, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 2, 16)) + +function f3(x: { (...args): void }) { } +>f3 : Symbol(f3, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 2, 37)) +>x : Symbol(x, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 3, 12)) +>args : Symbol(args, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 3, 18)) + +function f4 void>() { } +>f4 : Symbol(f4, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 3, 39)) +>T : Symbol(T, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 4, 12)) +>args : Symbol(args, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 4, 23)) + +function f5() { } +>f5 : Symbol(f5, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 4, 46)) +>T : Symbol(T, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 5, 12)) +>args : Symbol(args, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 5, 25)) + +var f6 = () => { return [10]; } +>f6 : Symbol(f6, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 6, 3)) + + + diff --git a/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.types b/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.types index ecb7c002089..0bfa5b6312c 100644 --- a/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.types +++ b/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.types @@ -29,6 +29,7 @@ var f6 = () => { return [10]; } >() => { return [10]; } : () => any[] >[10] : any[] >10 : any +>10 : number diff --git a/tests/baselines/reference/declFileTypeAnnotationArrayType.symbols b/tests/baselines/reference/declFileTypeAnnotationArrayType.symbols new file mode 100644 index 00000000000..9092189c3c7 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationArrayType.symbols @@ -0,0 +1,105 @@ +=== tests/cases/compiler/declFileTypeAnnotationArrayType.ts === + +class c { +>c : Symbol(c, Decl(declFileTypeAnnotationArrayType.ts, 0, 0)) +} +module m { +>m : Symbol(m, Decl(declFileTypeAnnotationArrayType.ts, 2, 1)) + + export class c { +>c : Symbol(c, Decl(declFileTypeAnnotationArrayType.ts, 3, 10)) + } + export class g { +>g : Symbol(g, Decl(declFileTypeAnnotationArrayType.ts, 5, 5)) +>T : Symbol(T, Decl(declFileTypeAnnotationArrayType.ts, 6, 19)) + } +} +class g { +>g : Symbol(g, Decl(declFileTypeAnnotationArrayType.ts, 8, 1)) +>T : Symbol(T, Decl(declFileTypeAnnotationArrayType.ts, 9, 8)) +} + +// Just the name +function foo(): c[] { +>foo : Symbol(foo, Decl(declFileTypeAnnotationArrayType.ts, 10, 1)) +>c : Symbol(c, Decl(declFileTypeAnnotationArrayType.ts, 0, 0)) + + return [new c()]; +>c : Symbol(c, Decl(declFileTypeAnnotationArrayType.ts, 0, 0)) +} +function foo2() { +>foo2 : Symbol(foo2, Decl(declFileTypeAnnotationArrayType.ts, 15, 1)) + + return [new c()]; +>c : Symbol(c, Decl(declFileTypeAnnotationArrayType.ts, 0, 0)) +} + +// Qualified name +function foo3(): m.c[] { +>foo3 : Symbol(foo3, Decl(declFileTypeAnnotationArrayType.ts, 18, 1)) +>m : Symbol(m, Decl(declFileTypeAnnotationArrayType.ts, 2, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationArrayType.ts, 3, 10)) + + return [new m.c()]; +>m.c : Symbol(m.c, Decl(declFileTypeAnnotationArrayType.ts, 3, 10)) +>m : Symbol(m, Decl(declFileTypeAnnotationArrayType.ts, 2, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationArrayType.ts, 3, 10)) +} +function foo4() { +>foo4 : Symbol(foo4, Decl(declFileTypeAnnotationArrayType.ts, 23, 1)) + + return m.c; +>m.c : Symbol(m.c, Decl(declFileTypeAnnotationArrayType.ts, 3, 10)) +>m : Symbol(m, Decl(declFileTypeAnnotationArrayType.ts, 2, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationArrayType.ts, 3, 10)) +} + +// Just the name with type arguments +function foo5(): g[] { +>foo5 : Symbol(foo5, Decl(declFileTypeAnnotationArrayType.ts, 26, 1)) +>g : Symbol(g, Decl(declFileTypeAnnotationArrayType.ts, 8, 1)) + + return [new g()]; +>g : Symbol(g, Decl(declFileTypeAnnotationArrayType.ts, 8, 1)) +} +function foo6() { +>foo6 : Symbol(foo6, Decl(declFileTypeAnnotationArrayType.ts, 31, 1)) + + return [new g()]; +>g : Symbol(g, Decl(declFileTypeAnnotationArrayType.ts, 8, 1)) +} + +// Qualified name with type arguments +function foo7(): m.g[] { +>foo7 : Symbol(foo7, Decl(declFileTypeAnnotationArrayType.ts, 34, 1)) +>m : Symbol(m, Decl(declFileTypeAnnotationArrayType.ts, 2, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationArrayType.ts, 5, 5)) + + return [new m.g()]; +>m.g : Symbol(m.g, Decl(declFileTypeAnnotationArrayType.ts, 5, 5)) +>m : Symbol(m, Decl(declFileTypeAnnotationArrayType.ts, 2, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationArrayType.ts, 5, 5)) +} +function foo8() { +>foo8 : Symbol(foo8, Decl(declFileTypeAnnotationArrayType.ts, 39, 1)) + + return [new m.g()]; +>m.g : Symbol(m.g, Decl(declFileTypeAnnotationArrayType.ts, 5, 5)) +>m : Symbol(m, Decl(declFileTypeAnnotationArrayType.ts, 2, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationArrayType.ts, 5, 5)) +} + +// Array of function types +function foo9(): (()=>c)[] { +>foo9 : Symbol(foo9, Decl(declFileTypeAnnotationArrayType.ts, 42, 1)) +>c : Symbol(c, Decl(declFileTypeAnnotationArrayType.ts, 0, 0)) + + return [() => new c()]; +>c : Symbol(c, Decl(declFileTypeAnnotationArrayType.ts, 0, 0)) +} +function foo10() { +>foo10 : Symbol(foo10, Decl(declFileTypeAnnotationArrayType.ts, 47, 1)) + + return [() => new c()]; +>c : Symbol(c, Decl(declFileTypeAnnotationArrayType.ts, 0, 0)) +} diff --git a/tests/baselines/reference/declFileTypeAnnotationArrayType.types b/tests/baselines/reference/declFileTypeAnnotationArrayType.types index 860d13af47c..7a9d65b8a1f 100644 --- a/tests/baselines/reference/declFileTypeAnnotationArrayType.types +++ b/tests/baselines/reference/declFileTypeAnnotationArrayType.types @@ -41,7 +41,7 @@ function foo2() { // Qualified name function foo3(): m.c[] { >foo3 : () => m.c[] ->m : unknown +>m : any >c : m.c return [new m.c()]; @@ -82,7 +82,7 @@ function foo6() { // Qualified name with type arguments function foo7(): m.g[] { >foo7 : () => m.g[] ->m : unknown +>m : any >g : m.g return [new m.g()]; diff --git a/tests/baselines/reference/declFileTypeAnnotationBuiltInType.symbols b/tests/baselines/reference/declFileTypeAnnotationBuiltInType.symbols new file mode 100644 index 00000000000..62de15530b7 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationBuiltInType.symbols @@ -0,0 +1,63 @@ +=== tests/cases/compiler/declFileTypeAnnotationBuiltInType.ts === + +// string +function foo(): string { +>foo : Symbol(foo, Decl(declFileTypeAnnotationBuiltInType.ts, 0, 0)) + + return ""; +} +function foo2() { +>foo2 : Symbol(foo2, Decl(declFileTypeAnnotationBuiltInType.ts, 4, 1)) + + return ""; +} + +// number +function foo3(): number { +>foo3 : Symbol(foo3, Decl(declFileTypeAnnotationBuiltInType.ts, 7, 1)) + + return 10; +} +function foo4() { +>foo4 : Symbol(foo4, Decl(declFileTypeAnnotationBuiltInType.ts, 12, 1)) + + return 10; +} + +// boolean +function foo5(): boolean { +>foo5 : Symbol(foo5, Decl(declFileTypeAnnotationBuiltInType.ts, 15, 1)) + + return true; +} +function foo6() { +>foo6 : Symbol(foo6, Decl(declFileTypeAnnotationBuiltInType.ts, 20, 1)) + + return false; +} + +// void +function foo7(): void { +>foo7 : Symbol(foo7, Decl(declFileTypeAnnotationBuiltInType.ts, 23, 1)) + + return; +} +function foo8() { +>foo8 : Symbol(foo8, Decl(declFileTypeAnnotationBuiltInType.ts, 28, 1)) + + return; +} + +// any +function foo9(): any { +>foo9 : Symbol(foo9, Decl(declFileTypeAnnotationBuiltInType.ts, 31, 1)) + + return undefined; +>undefined : Symbol(undefined) +} +function foo10() { +>foo10 : Symbol(foo10, Decl(declFileTypeAnnotationBuiltInType.ts, 36, 1)) + + return undefined; +>undefined : Symbol(undefined) +} diff --git a/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types b/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types index ce4f5654a89..a1b2d9edd43 100644 --- a/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types +++ b/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types @@ -5,11 +5,13 @@ function foo(): string { >foo : () => string return ""; +>"" : string } function foo2() { >foo2 : () => string return ""; +>"" : string } // number @@ -17,11 +19,13 @@ function foo3(): number { >foo3 : () => number return 10; +>10 : number } function foo4() { >foo4 : () => number return 10; +>10 : number } // boolean @@ -29,11 +33,13 @@ function foo5(): boolean { >foo5 : () => boolean return true; +>true : boolean } function foo6() { >foo6 : () => boolean return false; +>false : boolean } // void diff --git a/tests/baselines/reference/declFileTypeAnnotationParenType.symbols b/tests/baselines/reference/declFileTypeAnnotationParenType.symbols new file mode 100644 index 00000000000..bc5668b70bd --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationParenType.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/declFileTypeAnnotationParenType.ts === + +class c { +>c : Symbol(c, Decl(declFileTypeAnnotationParenType.ts, 0, 0)) + + private p: string; +>p : Symbol(p, Decl(declFileTypeAnnotationParenType.ts, 1, 9)) +} + +var x: (() => c)[] = [() => new c()]; +>x : Symbol(x, Decl(declFileTypeAnnotationParenType.ts, 5, 3)) +>c : Symbol(c, Decl(declFileTypeAnnotationParenType.ts, 0, 0)) +>c : Symbol(c, Decl(declFileTypeAnnotationParenType.ts, 0, 0)) + +var y = [() => new c()]; +>y : Symbol(y, Decl(declFileTypeAnnotationParenType.ts, 6, 3)) +>c : Symbol(c, Decl(declFileTypeAnnotationParenType.ts, 0, 0)) + +var k: (() => c) | string = (() => new c()) || ""; +>k : Symbol(k, Decl(declFileTypeAnnotationParenType.ts, 8, 3)) +>c : Symbol(c, Decl(declFileTypeAnnotationParenType.ts, 0, 0)) +>c : Symbol(c, Decl(declFileTypeAnnotationParenType.ts, 0, 0)) + +var l = (() => new c()) || ""; +>l : Symbol(l, Decl(declFileTypeAnnotationParenType.ts, 9, 3)) +>c : Symbol(c, Decl(declFileTypeAnnotationParenType.ts, 0, 0)) + diff --git a/tests/baselines/reference/declFileTypeAnnotationParenType.types b/tests/baselines/reference/declFileTypeAnnotationParenType.types index c904f1b3e5a..31b6ad03751 100644 --- a/tests/baselines/reference/declFileTypeAnnotationParenType.types +++ b/tests/baselines/reference/declFileTypeAnnotationParenType.types @@ -30,6 +30,7 @@ var k: (() => c) | string = (() => new c()) || ""; >() => new c() : () => c >new c() : c >c : typeof c +>"" : string var l = (() => new c()) || ""; >l : string | (() => c) @@ -38,4 +39,5 @@ var l = (() => new c()) || ""; >() => new c() : () => c >new c() : c >c : typeof c +>"" : string diff --git a/tests/baselines/reference/declFileTypeAnnotationStringLiteral.symbols b/tests/baselines/reference/declFileTypeAnnotationStringLiteral.symbols new file mode 100644 index 00000000000..7250567039a --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationStringLiteral.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/declFileTypeAnnotationStringLiteral.ts === + +function foo(a: "hello"): number; +>foo : Symbol(foo, Decl(declFileTypeAnnotationStringLiteral.ts, 0, 0), Decl(declFileTypeAnnotationStringLiteral.ts, 1, 33), Decl(declFileTypeAnnotationStringLiteral.ts, 2, 32), Decl(declFileTypeAnnotationStringLiteral.ts, 3, 41)) +>a : Symbol(a, Decl(declFileTypeAnnotationStringLiteral.ts, 1, 13)) + +function foo(a: "name"): string; +>foo : Symbol(foo, Decl(declFileTypeAnnotationStringLiteral.ts, 0, 0), Decl(declFileTypeAnnotationStringLiteral.ts, 1, 33), Decl(declFileTypeAnnotationStringLiteral.ts, 2, 32), Decl(declFileTypeAnnotationStringLiteral.ts, 3, 41)) +>a : Symbol(a, Decl(declFileTypeAnnotationStringLiteral.ts, 2, 13)) + +function foo(a: string): string | number; +>foo : Symbol(foo, Decl(declFileTypeAnnotationStringLiteral.ts, 0, 0), Decl(declFileTypeAnnotationStringLiteral.ts, 1, 33), Decl(declFileTypeAnnotationStringLiteral.ts, 2, 32), Decl(declFileTypeAnnotationStringLiteral.ts, 3, 41)) +>a : Symbol(a, Decl(declFileTypeAnnotationStringLiteral.ts, 3, 13)) + +function foo(a: string): string | number { +>foo : Symbol(foo, Decl(declFileTypeAnnotationStringLiteral.ts, 0, 0), Decl(declFileTypeAnnotationStringLiteral.ts, 1, 33), Decl(declFileTypeAnnotationStringLiteral.ts, 2, 32), Decl(declFileTypeAnnotationStringLiteral.ts, 3, 41)) +>a : Symbol(a, Decl(declFileTypeAnnotationStringLiteral.ts, 4, 13)) + + if (a === "hello") { +>a : Symbol(a, Decl(declFileTypeAnnotationStringLiteral.ts, 4, 13)) + + return a.length; +>a.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>a : Symbol(a, Decl(declFileTypeAnnotationStringLiteral.ts, 4, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + } + + return a; +>a : Symbol(a, Decl(declFileTypeAnnotationStringLiteral.ts, 4, 13)) +} diff --git a/tests/baselines/reference/declFileTypeAnnotationStringLiteral.types b/tests/baselines/reference/declFileTypeAnnotationStringLiteral.types index d50d95f988b..3041b92cf6d 100644 --- a/tests/baselines/reference/declFileTypeAnnotationStringLiteral.types +++ b/tests/baselines/reference/declFileTypeAnnotationStringLiteral.types @@ -19,6 +19,7 @@ function foo(a: string): string | number { if (a === "hello") { >a === "hello" : boolean >a : string +>"hello" : string return a.length; >a.length : number diff --git a/tests/baselines/reference/declFileTypeAnnotationTupleType.symbols b/tests/baselines/reference/declFileTypeAnnotationTupleType.symbols new file mode 100644 index 00000000000..9eea6dfd9f9 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTupleType.symbols @@ -0,0 +1,52 @@ +=== tests/cases/compiler/declFileTypeAnnotationTupleType.ts === + +class c { +>c : Symbol(c, Decl(declFileTypeAnnotationTupleType.ts, 0, 0)) +} +module m { +>m : Symbol(m, Decl(declFileTypeAnnotationTupleType.ts, 2, 1)) + + export class c { +>c : Symbol(c, Decl(declFileTypeAnnotationTupleType.ts, 3, 10)) + } + export class g { +>g : Symbol(g, Decl(declFileTypeAnnotationTupleType.ts, 5, 5)) +>T : Symbol(T, Decl(declFileTypeAnnotationTupleType.ts, 6, 19)) + } +} +class g { +>g : Symbol(g, Decl(declFileTypeAnnotationTupleType.ts, 8, 1)) +>T : Symbol(T, Decl(declFileTypeAnnotationTupleType.ts, 9, 8)) +} + +// Just the name +var k: [c, m.c] = [new c(), new m.c()]; +>k : Symbol(k, Decl(declFileTypeAnnotationTupleType.ts, 13, 3)) +>c : Symbol(c, Decl(declFileTypeAnnotationTupleType.ts, 0, 0)) +>m : Symbol(m, Decl(declFileTypeAnnotationTupleType.ts, 2, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationTupleType.ts, 3, 10)) +>c : Symbol(c, Decl(declFileTypeAnnotationTupleType.ts, 0, 0)) +>m.c : Symbol(m.c, Decl(declFileTypeAnnotationTupleType.ts, 3, 10)) +>m : Symbol(m, Decl(declFileTypeAnnotationTupleType.ts, 2, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationTupleType.ts, 3, 10)) + +var l = k; +>l : Symbol(l, Decl(declFileTypeAnnotationTupleType.ts, 14, 3)) +>k : Symbol(k, Decl(declFileTypeAnnotationTupleType.ts, 13, 3)) + +var x: [g, m.g, () => c] = [new g(), new m.g(), () => new c()]; +>x : Symbol(x, Decl(declFileTypeAnnotationTupleType.ts, 16, 3)) +>g : Symbol(g, Decl(declFileTypeAnnotationTupleType.ts, 8, 1)) +>m : Symbol(m, Decl(declFileTypeAnnotationTupleType.ts, 2, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationTupleType.ts, 5, 5)) +>c : Symbol(c, Decl(declFileTypeAnnotationTupleType.ts, 0, 0)) +>g : Symbol(g, Decl(declFileTypeAnnotationTupleType.ts, 8, 1)) +>m.g : Symbol(m.g, Decl(declFileTypeAnnotationTupleType.ts, 5, 5)) +>m : Symbol(m, Decl(declFileTypeAnnotationTupleType.ts, 2, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationTupleType.ts, 5, 5)) +>c : Symbol(c, Decl(declFileTypeAnnotationTupleType.ts, 0, 0)) + +var y = x; +>y : Symbol(y, Decl(declFileTypeAnnotationTupleType.ts, 17, 3)) +>x : Symbol(x, Decl(declFileTypeAnnotationTupleType.ts, 16, 3)) + diff --git a/tests/baselines/reference/declFileTypeAnnotationTupleType.types b/tests/baselines/reference/declFileTypeAnnotationTupleType.types index 88cf5a0c743..aad0760fade 100644 --- a/tests/baselines/reference/declFileTypeAnnotationTupleType.types +++ b/tests/baselines/reference/declFileTypeAnnotationTupleType.types @@ -23,7 +23,7 @@ class g { var k: [c, m.c] = [new c(), new m.c()]; >k : [c, m.c] >c : c ->m : unknown +>m : any >c : m.c >[new c(), new m.c()] : [c, m.c] >new c() : c @@ -40,7 +40,7 @@ var l = k; var x: [g, m.g, () => c] = [new g(), new m.g(), () => new c()]; >x : [g, m.g, () => c] >g : g ->m : unknown +>m : any >g : m.g >c : c >[new g(), new m.g(), () => new c()] : [g, m.g, () => c] diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeAlias.symbols b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.symbols new file mode 100644 index 00000000000..27507817a77 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.symbols @@ -0,0 +1,63 @@ +=== tests/cases/compiler/declFileTypeAnnotationTypeAlias.ts === + +module M { +>M : Symbol(M, Decl(declFileTypeAnnotationTypeAlias.ts, 0, 0), Decl(declFileTypeAnnotationTypeAlias.ts, 22, 1)) + + export type Value = string | number | boolean; +>Value : Symbol(Value, Decl(declFileTypeAnnotationTypeAlias.ts, 1, 10)) + + export var x: Value; +>x : Symbol(x, Decl(declFileTypeAnnotationTypeAlias.ts, 3, 14)) +>Value : Symbol(Value, Decl(declFileTypeAnnotationTypeAlias.ts, 1, 10)) + + export class c { +>c : Symbol(c, Decl(declFileTypeAnnotationTypeAlias.ts, 3, 24)) + } + + export type C = c; +>C : Symbol(C, Decl(declFileTypeAnnotationTypeAlias.ts, 6, 5)) +>c : Symbol(c, Decl(declFileTypeAnnotationTypeAlias.ts, 3, 24)) + + export module m { +>m : Symbol(m, Decl(declFileTypeAnnotationTypeAlias.ts, 8, 22)) + + export class c { +>c : Symbol(c, Decl(declFileTypeAnnotationTypeAlias.ts, 10, 21)) + } + } + + export type MC = m.c; +>MC : Symbol(MC, Decl(declFileTypeAnnotationTypeAlias.ts, 13, 5)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeAlias.ts, 8, 22)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationTypeAlias.ts, 10, 21)) + + export type fc = () => c; +>fc : Symbol(fc, Decl(declFileTypeAnnotationTypeAlias.ts, 15, 25)) +>c : Symbol(c, Decl(declFileTypeAnnotationTypeAlias.ts, 3, 24)) +} + +interface Window { +>Window : Symbol(Window, Decl(declFileTypeAnnotationTypeAlias.ts, 18, 1)) + + someMethod(); +>someMethod : Symbol(someMethod, Decl(declFileTypeAnnotationTypeAlias.ts, 20, 18)) +} + +module M { +>M : Symbol(M, Decl(declFileTypeAnnotationTypeAlias.ts, 0, 0), Decl(declFileTypeAnnotationTypeAlias.ts, 22, 1)) + + export type W = Window | string; +>W : Symbol(W, Decl(declFileTypeAnnotationTypeAlias.ts, 24, 10)) +>Window : Symbol(Window, Decl(declFileTypeAnnotationTypeAlias.ts, 18, 1)) + + export module N { +>N : Symbol(N, Decl(declFileTypeAnnotationTypeAlias.ts, 25, 36)) + + export class Window { } +>Window : Symbol(Window, Decl(declFileTypeAnnotationTypeAlias.ts, 26, 21)) + + export var p: W; +>p : Symbol(p, Decl(declFileTypeAnnotationTypeAlias.ts, 28, 18)) +>W : Symbol(W, Decl(declFileTypeAnnotationTypeAlias.ts, 24, 10)) + } +} diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeAlias.types b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.types index aa475068bf0..beef88c0ca2 100644 --- a/tests/baselines/reference/declFileTypeAnnotationTypeAlias.types +++ b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.types @@ -28,7 +28,7 @@ module M { export type MC = m.c; >MC : m.c ->m : unknown +>m : any >c : m.c export type fc = () => c; diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.symbols b/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.symbols new file mode 100644 index 00000000000..6a3f2100fab --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.symbols @@ -0,0 +1,85 @@ +=== tests/cases/compiler/declFileTypeAnnotationTypeLiteral.ts === + +class c { +>c : Symbol(c, Decl(declFileTypeAnnotationTypeLiteral.ts, 0, 0)) +} +class g { +>g : Symbol(g, Decl(declFileTypeAnnotationTypeLiteral.ts, 2, 1)) +>T : Symbol(T, Decl(declFileTypeAnnotationTypeLiteral.ts, 3, 8)) +} +module m { +>m : Symbol(m, Decl(declFileTypeAnnotationTypeLiteral.ts, 4, 1)) + + export class c { +>c : Symbol(c, Decl(declFileTypeAnnotationTypeLiteral.ts, 5, 10)) + } +} + +// Object literal with everything +var x: { +>x : Symbol(x, Decl(declFileTypeAnnotationTypeLiteral.ts, 11, 3)) + + // Call signatures + (a: number): c; +>a : Symbol(a, Decl(declFileTypeAnnotationTypeLiteral.ts, 13, 5)) +>c : Symbol(c, Decl(declFileTypeAnnotationTypeLiteral.ts, 0, 0)) + + (a: string): g; +>a : Symbol(a, Decl(declFileTypeAnnotationTypeLiteral.ts, 14, 5)) +>g : Symbol(g, Decl(declFileTypeAnnotationTypeLiteral.ts, 2, 1)) + + // Construct signatures + new (a: number): c; +>a : Symbol(a, Decl(declFileTypeAnnotationTypeLiteral.ts, 17, 9)) +>c : Symbol(c, Decl(declFileTypeAnnotationTypeLiteral.ts, 0, 0)) + + new (a: string): m.c; +>a : Symbol(a, Decl(declFileTypeAnnotationTypeLiteral.ts, 18, 9)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeLiteral.ts, 4, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationTypeLiteral.ts, 5, 10)) + + // Indexers + [n: number]: c; +>n : Symbol(n, Decl(declFileTypeAnnotationTypeLiteral.ts, 21, 5)) +>c : Symbol(c, Decl(declFileTypeAnnotationTypeLiteral.ts, 0, 0)) + + [n: string]: c; +>n : Symbol(n, Decl(declFileTypeAnnotationTypeLiteral.ts, 22, 5)) +>c : Symbol(c, Decl(declFileTypeAnnotationTypeLiteral.ts, 0, 0)) + + // Properties + a: c; +>a : Symbol(a, Decl(declFileTypeAnnotationTypeLiteral.ts, 22, 19)) +>c : Symbol(c, Decl(declFileTypeAnnotationTypeLiteral.ts, 0, 0)) + + b: g; +>b : Symbol(b, Decl(declFileTypeAnnotationTypeLiteral.ts, 25, 9)) +>g : Symbol(g, Decl(declFileTypeAnnotationTypeLiteral.ts, 2, 1)) + + // methods + m1(): g; +>m1 : Symbol(m1, Decl(declFileTypeAnnotationTypeLiteral.ts, 26, 17)) +>g : Symbol(g, Decl(declFileTypeAnnotationTypeLiteral.ts, 2, 1)) + + m2(a: string, b?: number, ...c: c[]): string; +>m2 : Symbol(m2, Decl(declFileTypeAnnotationTypeLiteral.ts, 29, 20)) +>a : Symbol(a, Decl(declFileTypeAnnotationTypeLiteral.ts, 30, 7)) +>b : Symbol(b, Decl(declFileTypeAnnotationTypeLiteral.ts, 30, 17)) +>c : Symbol(c, Decl(declFileTypeAnnotationTypeLiteral.ts, 30, 29)) +>c : Symbol(c, Decl(declFileTypeAnnotationTypeLiteral.ts, 0, 0)) + +}; + + +// Function type +var y: (a: string) => string; +>y : Symbol(y, Decl(declFileTypeAnnotationTypeLiteral.ts, 35, 3)) +>a : Symbol(a, Decl(declFileTypeAnnotationTypeLiteral.ts, 35, 8)) + +// constructor type +var z: new (a: string) => m.c; +>z : Symbol(z, Decl(declFileTypeAnnotationTypeLiteral.ts, 38, 3)) +>a : Symbol(a, Decl(declFileTypeAnnotationTypeLiteral.ts, 38, 12)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeLiteral.ts, 4, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationTypeLiteral.ts, 5, 10)) + diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.types b/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.types index 30d14b77286..e2092008358 100644 --- a/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.types +++ b/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.types @@ -35,7 +35,7 @@ var x: { new (a: string): m.c; >a : string ->m : unknown +>m : any >c : m.c // Indexers @@ -80,6 +80,6 @@ var y: (a: string) => string; var z: new (a: string) => m.c; >z : new (a: string) => m.c >a : string ->m : unknown +>m : any >c : m.c diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeQuery.symbols b/tests/baselines/reference/declFileTypeAnnotationTypeQuery.symbols new file mode 100644 index 00000000000..f5970ce15f5 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeQuery.symbols @@ -0,0 +1,92 @@ +=== tests/cases/compiler/declFileTypeAnnotationTypeQuery.ts === + +class c { +>c : Symbol(c, Decl(declFileTypeAnnotationTypeQuery.ts, 0, 0)) +} +module m { +>m : Symbol(m, Decl(declFileTypeAnnotationTypeQuery.ts, 2, 1)) + + export class c { +>c : Symbol(c, Decl(declFileTypeAnnotationTypeQuery.ts, 3, 10)) + } + export class g { +>g : Symbol(g, Decl(declFileTypeAnnotationTypeQuery.ts, 5, 5)) +>T : Symbol(T, Decl(declFileTypeAnnotationTypeQuery.ts, 6, 19)) + } +} +class g { +>g : Symbol(g, Decl(declFileTypeAnnotationTypeQuery.ts, 8, 1)) +>T : Symbol(T, Decl(declFileTypeAnnotationTypeQuery.ts, 9, 8)) +} + +// Just the name +function foo(): typeof c { +>foo : Symbol(foo, Decl(declFileTypeAnnotationTypeQuery.ts, 10, 1)) +>c : Symbol(c, Decl(declFileTypeAnnotationTypeQuery.ts, 0, 0)) + + return c; +>c : Symbol(c, Decl(declFileTypeAnnotationTypeQuery.ts, 0, 0)) +} +function foo2() { +>foo2 : Symbol(foo2, Decl(declFileTypeAnnotationTypeQuery.ts, 15, 1)) + + return c; +>c : Symbol(c, Decl(declFileTypeAnnotationTypeQuery.ts, 0, 0)) +} + +// Qualified name +function foo3(): typeof m.c { +>foo3 : Symbol(foo3, Decl(declFileTypeAnnotationTypeQuery.ts, 18, 1)) +>m.c : Symbol(m.c, Decl(declFileTypeAnnotationTypeQuery.ts, 3, 10)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeQuery.ts, 2, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationTypeQuery.ts, 3, 10)) + + return m.c; +>m.c : Symbol(m.c, Decl(declFileTypeAnnotationTypeQuery.ts, 3, 10)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeQuery.ts, 2, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationTypeQuery.ts, 3, 10)) +} +function foo4() { +>foo4 : Symbol(foo4, Decl(declFileTypeAnnotationTypeQuery.ts, 23, 1)) + + return m.c; +>m.c : Symbol(m.c, Decl(declFileTypeAnnotationTypeQuery.ts, 3, 10)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeQuery.ts, 2, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationTypeQuery.ts, 3, 10)) +} + +// Just the name with type arguments +function foo5(): typeof g { +>foo5 : Symbol(foo5, Decl(declFileTypeAnnotationTypeQuery.ts, 26, 1)) +>g : Symbol(g, Decl(declFileTypeAnnotationTypeQuery.ts, 8, 1)) + + return g; +>g : Symbol(g, Decl(declFileTypeAnnotationTypeQuery.ts, 8, 1)) +} +function foo6() { +>foo6 : Symbol(foo6, Decl(declFileTypeAnnotationTypeQuery.ts, 31, 1)) + + return g; +>g : Symbol(g, Decl(declFileTypeAnnotationTypeQuery.ts, 8, 1)) +} + +// Qualified name with type arguments +function foo7(): typeof m.g { +>foo7 : Symbol(foo7, Decl(declFileTypeAnnotationTypeQuery.ts, 34, 1)) +>m.g : Symbol(m.g, Decl(declFileTypeAnnotationTypeQuery.ts, 5, 5)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeQuery.ts, 2, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationTypeQuery.ts, 5, 5)) + + return m.g +>m.g : Symbol(m.g, Decl(declFileTypeAnnotationTypeQuery.ts, 5, 5)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeQuery.ts, 2, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationTypeQuery.ts, 5, 5)) +} +function foo8() { +>foo8 : Symbol(foo8, Decl(declFileTypeAnnotationTypeQuery.ts, 39, 1)) + + return m.g +>m.g : Symbol(m.g, Decl(declFileTypeAnnotationTypeQuery.ts, 5, 5)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeQuery.ts, 2, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationTypeQuery.ts, 5, 5)) +} diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeQuery.types b/tests/baselines/reference/declFileTypeAnnotationTypeQuery.types index c7b5c421de1..01fce150ab8 100644 --- a/tests/baselines/reference/declFileTypeAnnotationTypeQuery.types +++ b/tests/baselines/reference/declFileTypeAnnotationTypeQuery.types @@ -37,6 +37,7 @@ function foo2() { // Qualified name function foo3(): typeof m.c { >foo3 : () => typeof m.c +>m.c : typeof m.c >m : typeof m >c : typeof m.c @@ -72,6 +73,7 @@ function foo6() { // Qualified name with type arguments function foo7(): typeof m.g { >foo7 : () => typeof m.g +>m.g : typeof m.g >m : typeof m >g : typeof m.g diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeReference.symbols b/tests/baselines/reference/declFileTypeAnnotationTypeReference.symbols new file mode 100644 index 00000000000..c6e27ecdceb --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeReference.symbols @@ -0,0 +1,90 @@ +=== tests/cases/compiler/declFileTypeAnnotationTypeReference.ts === + +class c { +>c : Symbol(c, Decl(declFileTypeAnnotationTypeReference.ts, 0, 0)) +} +module m { +>m : Symbol(m, Decl(declFileTypeAnnotationTypeReference.ts, 2, 1)) + + export class c { +>c : Symbol(c, Decl(declFileTypeAnnotationTypeReference.ts, 3, 10)) + } + export class g { +>g : Symbol(g, Decl(declFileTypeAnnotationTypeReference.ts, 5, 5)) +>T : Symbol(T, Decl(declFileTypeAnnotationTypeReference.ts, 6, 19)) + } +} +class g { +>g : Symbol(g, Decl(declFileTypeAnnotationTypeReference.ts, 8, 1)) +>T : Symbol(T, Decl(declFileTypeAnnotationTypeReference.ts, 9, 8)) +} + +// Just the name +function foo(): c { +>foo : Symbol(foo, Decl(declFileTypeAnnotationTypeReference.ts, 10, 1)) +>c : Symbol(c, Decl(declFileTypeAnnotationTypeReference.ts, 0, 0)) + + return new c(); +>c : Symbol(c, Decl(declFileTypeAnnotationTypeReference.ts, 0, 0)) +} +function foo2() { +>foo2 : Symbol(foo2, Decl(declFileTypeAnnotationTypeReference.ts, 15, 1)) + + return new c(); +>c : Symbol(c, Decl(declFileTypeAnnotationTypeReference.ts, 0, 0)) +} + +// Qualified name +function foo3(): m.c { +>foo3 : Symbol(foo3, Decl(declFileTypeAnnotationTypeReference.ts, 18, 1)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeReference.ts, 2, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationTypeReference.ts, 3, 10)) + + return new m.c(); +>m.c : Symbol(m.c, Decl(declFileTypeAnnotationTypeReference.ts, 3, 10)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeReference.ts, 2, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationTypeReference.ts, 3, 10)) +} +function foo4() { +>foo4 : Symbol(foo4, Decl(declFileTypeAnnotationTypeReference.ts, 23, 1)) + + return new m.c(); +>m.c : Symbol(m.c, Decl(declFileTypeAnnotationTypeReference.ts, 3, 10)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeReference.ts, 2, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationTypeReference.ts, 3, 10)) +} + +// Just the name with type arguments +function foo5(): g { +>foo5 : Symbol(foo5, Decl(declFileTypeAnnotationTypeReference.ts, 26, 1)) +>g : Symbol(g, Decl(declFileTypeAnnotationTypeReference.ts, 8, 1)) + + return new g(); +>g : Symbol(g, Decl(declFileTypeAnnotationTypeReference.ts, 8, 1)) +} +function foo6() { +>foo6 : Symbol(foo6, Decl(declFileTypeAnnotationTypeReference.ts, 31, 1)) + + return new g(); +>g : Symbol(g, Decl(declFileTypeAnnotationTypeReference.ts, 8, 1)) +} + +// Qualified name with type arguments +function foo7(): m.g { +>foo7 : Symbol(foo7, Decl(declFileTypeAnnotationTypeReference.ts, 34, 1)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeReference.ts, 2, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationTypeReference.ts, 5, 5)) + + return new m.g(); +>m.g : Symbol(m.g, Decl(declFileTypeAnnotationTypeReference.ts, 5, 5)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeReference.ts, 2, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationTypeReference.ts, 5, 5)) +} +function foo8() { +>foo8 : Symbol(foo8, Decl(declFileTypeAnnotationTypeReference.ts, 39, 1)) + + return new m.g(); +>m.g : Symbol(m.g, Decl(declFileTypeAnnotationTypeReference.ts, 5, 5)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeReference.ts, 2, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationTypeReference.ts, 5, 5)) +} diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeReference.types b/tests/baselines/reference/declFileTypeAnnotationTypeReference.types index 765c86c3415..1d85ad19293 100644 --- a/tests/baselines/reference/declFileTypeAnnotationTypeReference.types +++ b/tests/baselines/reference/declFileTypeAnnotationTypeReference.types @@ -39,7 +39,7 @@ function foo2() { // Qualified name function foo3(): m.c { >foo3 : () => m.c ->m : unknown +>m : any >c : m.c return new m.c(); @@ -78,7 +78,7 @@ function foo6() { // Qualified name with type arguments function foo7(): m.g { >foo7 : () => m.g ->m : unknown +>m : any >g : m.g return new m.g(); diff --git a/tests/baselines/reference/declFileTypeAnnotationUnionType.symbols b/tests/baselines/reference/declFileTypeAnnotationUnionType.symbols new file mode 100644 index 00000000000..f57df197579 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationUnionType.symbols @@ -0,0 +1,71 @@ +=== tests/cases/compiler/declFileTypeAnnotationUnionType.ts === + +class c { +>c : Symbol(c, Decl(declFileTypeAnnotationUnionType.ts, 0, 0)) + + private p: string; +>p : Symbol(p, Decl(declFileTypeAnnotationUnionType.ts, 1, 9)) +} +module m { +>m : Symbol(m, Decl(declFileTypeAnnotationUnionType.ts, 3, 1)) + + export class c { +>c : Symbol(c, Decl(declFileTypeAnnotationUnionType.ts, 4, 10)) + + private q: string; +>q : Symbol(q, Decl(declFileTypeAnnotationUnionType.ts, 5, 20)) + } + export class g { +>g : Symbol(g, Decl(declFileTypeAnnotationUnionType.ts, 7, 5)) +>T : Symbol(T, Decl(declFileTypeAnnotationUnionType.ts, 8, 19)) + + private r: string; +>r : Symbol(r, Decl(declFileTypeAnnotationUnionType.ts, 8, 23)) + } +} +class g { +>g : Symbol(g, Decl(declFileTypeAnnotationUnionType.ts, 11, 1)) +>T : Symbol(T, Decl(declFileTypeAnnotationUnionType.ts, 12, 8)) + + private s: string; +>s : Symbol(s, Decl(declFileTypeAnnotationUnionType.ts, 12, 12)) +} + +// Just the name +var k: c | m.c = new c() || new m.c(); +>k : Symbol(k, Decl(declFileTypeAnnotationUnionType.ts, 17, 3)) +>c : Symbol(c, Decl(declFileTypeAnnotationUnionType.ts, 0, 0)) +>m : Symbol(m, Decl(declFileTypeAnnotationUnionType.ts, 3, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationUnionType.ts, 4, 10)) +>c : Symbol(c, Decl(declFileTypeAnnotationUnionType.ts, 0, 0)) +>m.c : Symbol(m.c, Decl(declFileTypeAnnotationUnionType.ts, 4, 10)) +>m : Symbol(m, Decl(declFileTypeAnnotationUnionType.ts, 3, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationUnionType.ts, 4, 10)) + +var l = new c() || new m.c(); +>l : Symbol(l, Decl(declFileTypeAnnotationUnionType.ts, 18, 3)) +>c : Symbol(c, Decl(declFileTypeAnnotationUnionType.ts, 0, 0)) +>m.c : Symbol(m.c, Decl(declFileTypeAnnotationUnionType.ts, 4, 10)) +>m : Symbol(m, Decl(declFileTypeAnnotationUnionType.ts, 3, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationUnionType.ts, 4, 10)) + +var x: g | m.g | (() => c) = new g() || new m.g() || (() => new c()); +>x : Symbol(x, Decl(declFileTypeAnnotationUnionType.ts, 20, 3)) +>g : Symbol(g, Decl(declFileTypeAnnotationUnionType.ts, 11, 1)) +>m : Symbol(m, Decl(declFileTypeAnnotationUnionType.ts, 3, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationUnionType.ts, 7, 5)) +>c : Symbol(c, Decl(declFileTypeAnnotationUnionType.ts, 0, 0)) +>g : Symbol(g, Decl(declFileTypeAnnotationUnionType.ts, 11, 1)) +>m.g : Symbol(m.g, Decl(declFileTypeAnnotationUnionType.ts, 7, 5)) +>m : Symbol(m, Decl(declFileTypeAnnotationUnionType.ts, 3, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationUnionType.ts, 7, 5)) +>c : Symbol(c, Decl(declFileTypeAnnotationUnionType.ts, 0, 0)) + +var y = new g() || new m.g() || (() => new c()); +>y : Symbol(y, Decl(declFileTypeAnnotationUnionType.ts, 21, 3)) +>g : Symbol(g, Decl(declFileTypeAnnotationUnionType.ts, 11, 1)) +>m.g : Symbol(m.g, Decl(declFileTypeAnnotationUnionType.ts, 7, 5)) +>m : Symbol(m, Decl(declFileTypeAnnotationUnionType.ts, 3, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationUnionType.ts, 7, 5)) +>c : Symbol(c, Decl(declFileTypeAnnotationUnionType.ts, 0, 0)) + diff --git a/tests/baselines/reference/declFileTypeAnnotationUnionType.types b/tests/baselines/reference/declFileTypeAnnotationUnionType.types index 1dce3690bf8..a412f60b36e 100644 --- a/tests/baselines/reference/declFileTypeAnnotationUnionType.types +++ b/tests/baselines/reference/declFileTypeAnnotationUnionType.types @@ -35,7 +35,7 @@ class g { var k: c | m.c = new c() || new m.c(); >k : c | m.c >c : c ->m : unknown +>m : any >c : m.c >new c() || new m.c() : c | m.c >new c() : c @@ -58,7 +58,7 @@ var l = new c() || new m.c(); var x: g | m.g | (() => c) = new g() || new m.g() || (() => new c()); >x : g | m.g | (() => c) >g : g ->m : unknown +>m : any >g : m.g >c : c >new g() || new m.g() || (() => new c()) : g | m.g | (() => c) diff --git a/tests/baselines/reference/declFileTypeofClass.symbols b/tests/baselines/reference/declFileTypeofClass.symbols new file mode 100644 index 00000000000..26adfcc8ee4 --- /dev/null +++ b/tests/baselines/reference/declFileTypeofClass.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/declFileTypeofClass.ts === + +class c { +>c : Symbol(c, Decl(declFileTypeofClass.ts, 0, 0)) + + static x : string; +>x : Symbol(c.x, Decl(declFileTypeofClass.ts, 1, 9)) + + private static y: number; +>y : Symbol(c.y, Decl(declFileTypeofClass.ts, 2, 22)) + + private x3: string; +>x3 : Symbol(x3, Decl(declFileTypeofClass.ts, 3, 29)) + + public y3: number; +>y3 : Symbol(y3, Decl(declFileTypeofClass.ts, 4, 23)) +} + +var x: c; +>x : Symbol(x, Decl(declFileTypeofClass.ts, 8, 3)) +>c : Symbol(c, Decl(declFileTypeofClass.ts, 0, 0)) + +var y = c; +>y : Symbol(y, Decl(declFileTypeofClass.ts, 9, 3)) +>c : Symbol(c, Decl(declFileTypeofClass.ts, 0, 0)) + +var z: typeof c; +>z : Symbol(z, Decl(declFileTypeofClass.ts, 10, 3)) +>c : Symbol(c, Decl(declFileTypeofClass.ts, 0, 0)) + +class genericC +>genericC : Symbol(genericC, Decl(declFileTypeofClass.ts, 10, 16)) +>T : Symbol(T, Decl(declFileTypeofClass.ts, 11, 15)) +{ +} +var genericX = genericC; +>genericX : Symbol(genericX, Decl(declFileTypeofClass.ts, 14, 3)) +>genericC : Symbol(genericC, Decl(declFileTypeofClass.ts, 10, 16)) + diff --git a/tests/baselines/reference/declFileTypeofEnum.symbols b/tests/baselines/reference/declFileTypeofEnum.symbols new file mode 100644 index 00000000000..9980167788a --- /dev/null +++ b/tests/baselines/reference/declFileTypeofEnum.symbols @@ -0,0 +1,41 @@ +=== tests/cases/compiler/declFileTypeofEnum.ts === + +enum days { +>days : Symbol(days, Decl(declFileTypeofEnum.ts, 0, 0)) + + monday, +>monday : Symbol(days.monday, Decl(declFileTypeofEnum.ts, 1, 11)) + + tuesday, +>tuesday : Symbol(days.tuesday, Decl(declFileTypeofEnum.ts, 2, 11)) + + wednesday, +>wednesday : Symbol(days.wednesday, Decl(declFileTypeofEnum.ts, 3, 12)) + + thursday, +>thursday : Symbol(days.thursday, Decl(declFileTypeofEnum.ts, 4, 14)) + + friday, +>friday : Symbol(days.friday, Decl(declFileTypeofEnum.ts, 5, 13)) + + saturday, +>saturday : Symbol(days.saturday, Decl(declFileTypeofEnum.ts, 6, 11)) + + sunday +>sunday : Symbol(days.sunday, Decl(declFileTypeofEnum.ts, 7, 13)) +} + +var weekendDay = days.saturday; +>weekendDay : Symbol(weekendDay, Decl(declFileTypeofEnum.ts, 11, 3)) +>days.saturday : Symbol(days.saturday, Decl(declFileTypeofEnum.ts, 6, 11)) +>days : Symbol(days, Decl(declFileTypeofEnum.ts, 0, 0)) +>saturday : Symbol(days.saturday, Decl(declFileTypeofEnum.ts, 6, 11)) + +var daysOfMonth = days; +>daysOfMonth : Symbol(daysOfMonth, Decl(declFileTypeofEnum.ts, 12, 3)) +>days : Symbol(days, Decl(declFileTypeofEnum.ts, 0, 0)) + +var daysOfYear: typeof days; +>daysOfYear : Symbol(daysOfYear, Decl(declFileTypeofEnum.ts, 13, 3)) +>days : Symbol(days, Decl(declFileTypeofEnum.ts, 0, 0)) + diff --git a/tests/baselines/reference/declFileTypeofFunction.symbols b/tests/baselines/reference/declFileTypeofFunction.symbols new file mode 100644 index 00000000000..649c09cba06 --- /dev/null +++ b/tests/baselines/reference/declFileTypeofFunction.symbols @@ -0,0 +1,82 @@ +=== tests/cases/compiler/declFileTypeofFunction.ts === + +function f(n: typeof f): string; +>f : Symbol(f, Decl(declFileTypeofFunction.ts, 0, 0), Decl(declFileTypeofFunction.ts, 1, 32), Decl(declFileTypeofFunction.ts, 2, 32)) +>n : Symbol(n, Decl(declFileTypeofFunction.ts, 1, 11)) +>f : Symbol(f, Decl(declFileTypeofFunction.ts, 0, 0), Decl(declFileTypeofFunction.ts, 1, 32), Decl(declFileTypeofFunction.ts, 2, 32)) + +function f(n: typeof g): string; +>f : Symbol(f, Decl(declFileTypeofFunction.ts, 0, 0), Decl(declFileTypeofFunction.ts, 1, 32), Decl(declFileTypeofFunction.ts, 2, 32)) +>n : Symbol(n, Decl(declFileTypeofFunction.ts, 2, 11)) +>g : Symbol(g, Decl(declFileTypeofFunction.ts, 3, 34), Decl(declFileTypeofFunction.ts, 4, 32), Decl(declFileTypeofFunction.ts, 5, 32)) + +function f() { return undefined; } +>f : Symbol(f, Decl(declFileTypeofFunction.ts, 0, 0), Decl(declFileTypeofFunction.ts, 1, 32), Decl(declFileTypeofFunction.ts, 2, 32)) +>undefined : Symbol(undefined) + +function g(n: typeof g): number; +>g : Symbol(g, Decl(declFileTypeofFunction.ts, 3, 34), Decl(declFileTypeofFunction.ts, 4, 32), Decl(declFileTypeofFunction.ts, 5, 32)) +>n : Symbol(n, Decl(declFileTypeofFunction.ts, 4, 11)) +>g : Symbol(g, Decl(declFileTypeofFunction.ts, 3, 34), Decl(declFileTypeofFunction.ts, 4, 32), Decl(declFileTypeofFunction.ts, 5, 32)) + +function g(n: typeof f): number; +>g : Symbol(g, Decl(declFileTypeofFunction.ts, 3, 34), Decl(declFileTypeofFunction.ts, 4, 32), Decl(declFileTypeofFunction.ts, 5, 32)) +>n : Symbol(n, Decl(declFileTypeofFunction.ts, 5, 11)) +>f : Symbol(f, Decl(declFileTypeofFunction.ts, 0, 0), Decl(declFileTypeofFunction.ts, 1, 32), Decl(declFileTypeofFunction.ts, 2, 32)) + +function g() { return undefined; } +>g : Symbol(g, Decl(declFileTypeofFunction.ts, 3, 34), Decl(declFileTypeofFunction.ts, 4, 32), Decl(declFileTypeofFunction.ts, 5, 32)) +>undefined : Symbol(undefined) + +var b: () => typeof b; +>b : Symbol(b, Decl(declFileTypeofFunction.ts, 8, 3)) +>b : Symbol(b, Decl(declFileTypeofFunction.ts, 8, 3)) + +function b1() { +>b1 : Symbol(b1, Decl(declFileTypeofFunction.ts, 8, 22)) + + return b1; +>b1 : Symbol(b1, Decl(declFileTypeofFunction.ts, 8, 22)) +} + +function foo(): typeof foo { +>foo : Symbol(foo, Decl(declFileTypeofFunction.ts, 12, 1)) +>foo : Symbol(foo, Decl(declFileTypeofFunction.ts, 12, 1)) + + return null; +} +var foo1: typeof foo; +>foo1 : Symbol(foo1, Decl(declFileTypeofFunction.ts, 17, 3)) +>foo : Symbol(foo, Decl(declFileTypeofFunction.ts, 12, 1)) + +var foo2 = foo; +>foo2 : Symbol(foo2, Decl(declFileTypeofFunction.ts, 18, 3)) +>foo : Symbol(foo, Decl(declFileTypeofFunction.ts, 12, 1)) + +var foo3 = function () { +>foo3 : Symbol(foo3, Decl(declFileTypeofFunction.ts, 20, 3)) + + return foo3; +>foo3 : Symbol(foo3, Decl(declFileTypeofFunction.ts, 20, 3)) +} +var x = () => { +>x : Symbol(x, Decl(declFileTypeofFunction.ts, 23, 3)) + + return x; +>x : Symbol(x, Decl(declFileTypeofFunction.ts, 23, 3)) +} + +function foo5(x: number) { +>foo5 : Symbol(foo5, Decl(declFileTypeofFunction.ts, 25, 1)) +>x : Symbol(x, Decl(declFileTypeofFunction.ts, 27, 14)) + + function bar(x: number) { +>bar : Symbol(bar, Decl(declFileTypeofFunction.ts, 27, 26)) +>x : Symbol(x, Decl(declFileTypeofFunction.ts, 28, 17)) + + return x; +>x : Symbol(x, Decl(declFileTypeofFunction.ts, 28, 17)) + } + return bar; +>bar : Symbol(bar, Decl(declFileTypeofFunction.ts, 27, 26)) +} diff --git a/tests/baselines/reference/declFileTypeofFunction.types b/tests/baselines/reference/declFileTypeofFunction.types index bede9ba254b..b47b07035d1 100644 --- a/tests/baselines/reference/declFileTypeofFunction.types +++ b/tests/baselines/reference/declFileTypeofFunction.types @@ -44,6 +44,7 @@ function foo(): typeof foo { >foo : () => typeof foo return null; +>null : null } var foo1: typeof foo; >foo1 : () => typeof foo diff --git a/tests/baselines/reference/declFileTypeofInAnonymousType.symbols b/tests/baselines/reference/declFileTypeofInAnonymousType.symbols new file mode 100644 index 00000000000..426f953d6f2 --- /dev/null +++ b/tests/baselines/reference/declFileTypeofInAnonymousType.symbols @@ -0,0 +1,77 @@ +=== tests/cases/compiler/declFileTypeofInAnonymousType.ts === + +module m1 { +>m1 : Symbol(m1, Decl(declFileTypeofInAnonymousType.ts, 0, 0)) + + export class c { +>c : Symbol(c, Decl(declFileTypeofInAnonymousType.ts, 1, 11)) + } + export enum e { +>e : Symbol(e, Decl(declFileTypeofInAnonymousType.ts, 3, 5)) + + weekday, +>weekday : Symbol(e.weekday, Decl(declFileTypeofInAnonymousType.ts, 4, 19)) + + weekend, +>weekend : Symbol(e.weekend, Decl(declFileTypeofInAnonymousType.ts, 5, 16)) + + holiday +>holiday : Symbol(e.holiday, Decl(declFileTypeofInAnonymousType.ts, 6, 16)) + } +} +var a: { c: m1.c; }; +>a : Symbol(a, Decl(declFileTypeofInAnonymousType.ts, 10, 3)) +>c : Symbol(c, Decl(declFileTypeofInAnonymousType.ts, 10, 8)) +>m1 : Symbol(m1, Decl(declFileTypeofInAnonymousType.ts, 0, 0)) +>c : Symbol(m1.c, Decl(declFileTypeofInAnonymousType.ts, 1, 11)) + +var b = { +>b : Symbol(b, Decl(declFileTypeofInAnonymousType.ts, 11, 3)) + + c: m1.c, +>c : Symbol(c, Decl(declFileTypeofInAnonymousType.ts, 11, 9)) +>m1.c : Symbol(m1.c, Decl(declFileTypeofInAnonymousType.ts, 1, 11)) +>m1 : Symbol(m1, Decl(declFileTypeofInAnonymousType.ts, 0, 0)) +>c : Symbol(m1.c, Decl(declFileTypeofInAnonymousType.ts, 1, 11)) + + m1: m1 +>m1 : Symbol(m1, Decl(declFileTypeofInAnonymousType.ts, 12, 12)) +>m1 : Symbol(m1, Decl(declFileTypeofInAnonymousType.ts, 0, 0)) + +}; +var c = { m1: m1 }; +>c : Symbol(c, Decl(declFileTypeofInAnonymousType.ts, 15, 3)) +>m1 : Symbol(m1, Decl(declFileTypeofInAnonymousType.ts, 15, 9)) +>m1 : Symbol(m1, Decl(declFileTypeofInAnonymousType.ts, 0, 0)) + +var d = { +>d : Symbol(d, Decl(declFileTypeofInAnonymousType.ts, 16, 3)) + + m: { mod: m1 }, +>m : Symbol(m, Decl(declFileTypeofInAnonymousType.ts, 16, 9)) +>mod : Symbol(mod, Decl(declFileTypeofInAnonymousType.ts, 17, 8)) +>m1 : Symbol(m1, Decl(declFileTypeofInAnonymousType.ts, 0, 0)) + + mc: { cl: m1.c }, +>mc : Symbol(mc, Decl(declFileTypeofInAnonymousType.ts, 17, 19)) +>cl : Symbol(cl, Decl(declFileTypeofInAnonymousType.ts, 18, 9)) +>m1.c : Symbol(m1.c, Decl(declFileTypeofInAnonymousType.ts, 1, 11)) +>m1 : Symbol(m1, Decl(declFileTypeofInAnonymousType.ts, 0, 0)) +>c : Symbol(m1.c, Decl(declFileTypeofInAnonymousType.ts, 1, 11)) + + me: { en: m1.e }, +>me : Symbol(me, Decl(declFileTypeofInAnonymousType.ts, 18, 21)) +>en : Symbol(en, Decl(declFileTypeofInAnonymousType.ts, 19, 9)) +>m1.e : Symbol(m1.e, Decl(declFileTypeofInAnonymousType.ts, 3, 5)) +>m1 : Symbol(m1, Decl(declFileTypeofInAnonymousType.ts, 0, 0)) +>e : Symbol(m1.e, Decl(declFileTypeofInAnonymousType.ts, 3, 5)) + + mh: m1.e.holiday +>mh : Symbol(mh, Decl(declFileTypeofInAnonymousType.ts, 19, 21)) +>m1.e.holiday : Symbol(m1.e.holiday, Decl(declFileTypeofInAnonymousType.ts, 6, 16)) +>m1.e : Symbol(m1.e, Decl(declFileTypeofInAnonymousType.ts, 3, 5)) +>m1 : Symbol(m1, Decl(declFileTypeofInAnonymousType.ts, 0, 0)) +>e : Symbol(m1.e, Decl(declFileTypeofInAnonymousType.ts, 3, 5)) +>holiday : Symbol(m1.e.holiday, Decl(declFileTypeofInAnonymousType.ts, 6, 16)) + +}; diff --git a/tests/baselines/reference/declFileTypeofInAnonymousType.types b/tests/baselines/reference/declFileTypeofInAnonymousType.types index 39ea7383ca4..fa9d0bcbd17 100644 --- a/tests/baselines/reference/declFileTypeofInAnonymousType.types +++ b/tests/baselines/reference/declFileTypeofInAnonymousType.types @@ -22,7 +22,7 @@ module m1 { var a: { c: m1.c; }; >a : { c: m1.c; } >c : m1.c ->m1 : unknown +>m1 : any >c : m1.c var b = { diff --git a/tests/baselines/reference/declFileTypeofModule.symbols b/tests/baselines/reference/declFileTypeofModule.symbols new file mode 100644 index 00000000000..c84185b105d --- /dev/null +++ b/tests/baselines/reference/declFileTypeofModule.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/declFileTypeofModule.ts === + +module m1 { +>m1 : Symbol(m1, Decl(declFileTypeofModule.ts, 0, 0)) + + export var c: string; +>c : Symbol(c, Decl(declFileTypeofModule.ts, 2, 14)) +} +var m1_1 = m1; +>m1_1 : Symbol(m1_1, Decl(declFileTypeofModule.ts, 4, 3)) +>m1 : Symbol(m1, Decl(declFileTypeofModule.ts, 0, 0)) + +var m1_2: typeof m1; +>m1_2 : Symbol(m1_2, Decl(declFileTypeofModule.ts, 5, 3)) +>m1 : Symbol(m1, Decl(declFileTypeofModule.ts, 0, 0)) + +module m2 { +>m2 : Symbol(m2, Decl(declFileTypeofModule.ts, 5, 20)) + + export var d: typeof m2; +>d : Symbol(d, Decl(declFileTypeofModule.ts, 8, 14)) +>m2 : Symbol(m2, Decl(declFileTypeofModule.ts, 5, 20)) +} + +var m2_1 = m2; +>m2_1 : Symbol(m2_1, Decl(declFileTypeofModule.ts, 11, 3)) +>m2 : Symbol(m2, Decl(declFileTypeofModule.ts, 5, 20)) + +var m2_2: typeof m2; +>m2_2 : Symbol(m2_2, Decl(declFileTypeofModule.ts, 12, 3)) +>m2 : Symbol(m2, Decl(declFileTypeofModule.ts, 5, 20)) + diff --git a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.symbols b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.symbols new file mode 100644 index 00000000000..d2548af7c4f --- /dev/null +++ b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.symbols @@ -0,0 +1,56 @@ +=== tests/cases/compiler/declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts === + +declare module A.B.Base { +>A : Symbol(A, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 0, 0)) +>B : Symbol(B, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 1, 17)) +>Base : Symbol(Base, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 1, 19)) + + export class W { +>W : Symbol(W, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 1, 25)) + + id: number; +>id : Symbol(id, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 2, 20)) + } +} +module X.Y.base { +>X : Symbol(X, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 5, 1), Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 11, 1)) +>Y : Symbol(Y, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 6, 9), Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 13, 9)) +>base : Symbol(base, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 6, 11), Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 13, 11)) + + export class W extends A.B.Base.W { +>W : Symbol(W, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 6, 17)) +>A.B.Base.W : Symbol(A.B.Base.W, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 1, 25)) +>A.B.Base : Symbol(A.B.Base, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 1, 19)) +>A.B : Symbol(A.B, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 1, 17)) +>A : Symbol(A, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 0, 0)) +>B : Symbol(A.B, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 1, 17)) +>Base : Symbol(A.B.Base, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 1, 19)) +>W : Symbol(A.B.Base.W, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 1, 25)) + + name: string; +>name : Symbol(name, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 8, 39)) + } +} + +module X.Y.base.Z { +>X : Symbol(X, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 5, 1), Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 11, 1)) +>Y : Symbol(Y, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 6, 9), Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 13, 9)) +>base : Symbol(base, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 6, 11), Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 13, 11)) +>Z : Symbol(Z, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 13, 16)) + + export class W extends X.Y.base.W { +>W : Symbol(W, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 13, 19)) +>TValue : Symbol(TValue, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 15, 19)) +>X.Y.base.W : Symbol(W, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 6, 17)) +>X.Y.base : Symbol(base, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 6, 11), Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 13, 11)) +>X.Y : Symbol(Y, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 6, 9), Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 13, 9)) +>X : Symbol(X, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 5, 1), Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 11, 1)) +>Y : Symbol(Y, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 6, 9), Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 13, 9)) +>base : Symbol(base, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 6, 11), Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 13, 11)) +>W : Symbol(W, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 6, 17)) + + value: boolean; +>value : Symbol(value, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 15, 47)) + } +} + diff --git a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.types b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.types index 818a31b26d5..56e1d07d0ec 100644 --- a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.types +++ b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.types @@ -19,6 +19,9 @@ module X.Y.base { export class W extends A.B.Base.W { >W : W +>A.B.Base.W : any +>A.B.Base : typeof A.B.Base +>A.B : typeof A.B >A : typeof A >B : typeof A.B >Base : typeof A.B.Base @@ -38,6 +41,9 @@ module X.Y.base.Z { export class W extends X.Y.base.W { >W : W >TValue : TValue +>X.Y.base.W : any +>X.Y.base : typeof base +>X.Y : typeof Y >X : typeof X >Y : typeof Y >base : typeof base diff --git a/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.symbols b/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.symbols new file mode 100644 index 00000000000..e5016ec9baa --- /dev/null +++ b/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/declFileWithExtendsClauseThatHasItsContainerNameConflict.ts === + +declare module A.B.C { +>A : Symbol(A, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 0, 0), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 4, 1), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 11, 1)) +>B : Symbol(B, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 1, 17), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 6, 9), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 13, 9)) +>C : Symbol(C, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 1, 19), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 13, 11)) + + class B { +>B : Symbol(B, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 1, 22)) + } +} + +module A.B { +>A : Symbol(A, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 0, 0), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 4, 1), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 11, 1)) +>B : Symbol(B, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 1, 17), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 6, 9), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 13, 9)) + + export class EventManager { +>EventManager : Symbol(EventManager, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 6, 12)) + + id: number; +>id : Symbol(id, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 7, 31)) + + } +} + +module A.B.C { +>A : Symbol(A, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 0, 0), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 4, 1), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 11, 1)) +>B : Symbol(B, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 1, 17), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 6, 9), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 13, 9)) +>C : Symbol(C, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 1, 19), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 13, 11)) + + export class ContextMenu extends EventManager { +>ContextMenu : Symbol(ContextMenu, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 13, 14)) +>EventManager : Symbol(EventManager, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 6, 12)) + + name: string; +>name : Symbol(name, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 14, 51)) + } +} diff --git a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.symbols b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.symbols new file mode 100644 index 00000000000..15e9c6c6e85 --- /dev/null +++ b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/declFileWithInternalModuleNameConflictsInExtendsClause1.ts === + +module X.A.C { +>X : Symbol(X, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 0, 0), Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 4, 1)) +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 1, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 5, 9)) +>C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 1, 11)) + + export interface Z { +>Z : Symbol(Z, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 1, 14)) + } +} +module X.A.B.C { +>X : Symbol(X, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 0, 0), Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 4, 1)) +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 1, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 5, 9)) +>B : Symbol(B, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 5, 11)) +>C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 5, 13)) + + module A { +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 5, 16)) + } + export class W implements X.A.C.Z { // This needs to be refered as X.A.C.Z as A has conflict +>W : Symbol(W, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 7, 5)) +>X.A.C.Z : Symbol(X.A.C.Z, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 1, 14)) +>X.A.C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 1, 11)) +>X.A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 1, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 5, 9)) +>X : Symbol(X, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 0, 0), Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 4, 1)) +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 1, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 5, 9)) +>C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 1, 11)) +>Z : Symbol(X.A.C.Z, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 1, 14)) + } +} diff --git a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.types b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.types index b2a1c154412..f6fb6dae297 100644 --- a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.types +++ b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.types @@ -3,7 +3,7 @@ module X.A.C { >X : typeof X >A : typeof A ->C : unknown +>C : any export interface Z { >Z : Z @@ -16,13 +16,16 @@ module X.A.B.C { >C : typeof C module A { ->A : unknown +>A : any } 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.A.C.Z : any +>X.A.C : any +>X.A : typeof A >X : typeof X >A : typeof A ->C : unknown +>C : any >Z : X.A.C.Z } } diff --git a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.symbols b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.symbols new file mode 100644 index 00000000000..f0ce1ff2f97 --- /dev/null +++ b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/declFileWithInternalModuleNameConflictsInExtendsClause2.ts === + +module X.A.C { +>X : Symbol(X, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 0, 0), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 4, 1), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 8, 1)) +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 1, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 5, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 10, 9)) +>C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 1, 11)) + + export interface Z { +>Z : Symbol(Z, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 1, 14)) + } +} +module X.A.B.C { +>X : Symbol(X, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 0, 0), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 4, 1), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 8, 1)) +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 1, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 5, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 10, 9)) +>B : Symbol(B, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 5, 11), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 10, 11)) +>C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 5, 13), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 10, 13)) + + export class W implements A.C.Z { // This can refer to it as A.C.Z +>W : Symbol(W, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 5, 16)) +>A.C.Z : Symbol(A.C.Z, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 1, 14)) +>A.C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 1, 11)) +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 1, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 5, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 10, 9)) +>C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 1, 11)) +>Z : Symbol(A.C.Z, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 1, 14)) + } +} + +module X.A.B.C { +>X : Symbol(X, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 0, 0), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 4, 1), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 8, 1)) +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 1, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 5, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 10, 9)) +>B : Symbol(B, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 5, 11), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 10, 11)) +>C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 5, 13), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 10, 13)) + + module A { +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 10, 16)) + } +} diff --git a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.types b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.types index e43d0b78f57..a59a6930743 100644 --- a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.types +++ b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.types @@ -3,7 +3,7 @@ module X.A.C { >X : typeof X >A : typeof A ->C : unknown +>C : any export interface Z { >Z : Z @@ -17,8 +17,10 @@ module X.A.B.C { export class W implements A.C.Z { // This can refer to it as A.C.Z >W : W +>A.C.Z : any +>A.C : any >A : typeof A ->C : unknown +>C : any >Z : A.C.Z } } @@ -30,6 +32,6 @@ module X.A.B.C { >C : typeof C module A { ->A : unknown +>A : any } } diff --git a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.symbols b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.symbols new file mode 100644 index 00000000000..6d2a63b86ca --- /dev/null +++ b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/declFileWithInternalModuleNameConflictsInExtendsClause3.ts === + +module X.A.C { +>X : Symbol(X, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 0, 0), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 4, 1), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 8, 1)) +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 1, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 5, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 10, 9)) +>C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 1, 11)) + + export interface Z { +>Z : Symbol(Z, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 1, 14)) + } +} +module X.A.B.C { +>X : Symbol(X, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 0, 0), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 4, 1), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 8, 1)) +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 1, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 5, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 10, 9)) +>B : Symbol(B, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 5, 11), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 10, 11)) +>C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 5, 13), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 10, 13)) + + export class W implements X.A.C.Z { // This needs to be refered as X.A.C.Z as A has conflict +>W : Symbol(W, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 5, 16)) +>X.A.C.Z : Symbol(X.A.C.Z, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 1, 14)) +>X.A.C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 1, 11)) +>X.A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 1, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 5, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 10, 9)) +>X : Symbol(X, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 0, 0), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 4, 1), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 8, 1)) +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 1, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 5, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 10, 9)) +>C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 1, 11)) +>Z : Symbol(X.A.C.Z, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 1, 14)) + } +} + +module X.A.B.C { +>X : Symbol(X, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 0, 0), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 4, 1), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 8, 1)) +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 1, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 5, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 10, 9)) +>B : Symbol(B, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 5, 11), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 10, 11)) +>C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 5, 13), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 10, 13)) + + export module A { +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 10, 16)) + } +} diff --git a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.types b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.types index d45c2cf0523..f263cd96af8 100644 --- a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.types +++ b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.types @@ -3,7 +3,7 @@ module X.A.C { >X : typeof X >A : typeof A ->C : unknown +>C : any export interface Z { >Z : Z @@ -17,9 +17,12 @@ 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.A.C.Z : any +>X.A.C : any +>X.A : typeof A >X : typeof X >A : typeof A ->C : unknown +>C : any >Z : X.A.C.Z } } @@ -31,6 +34,6 @@ module X.A.B.C { >C : typeof C export module A { ->A : unknown +>A : any } } diff --git a/tests/baselines/reference/declInput3.symbols b/tests/baselines/reference/declInput3.symbols new file mode 100644 index 00000000000..06f35db0164 --- /dev/null +++ b/tests/baselines/reference/declInput3.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/declInput3.ts === +interface bar2 { +>bar2 : Symbol(bar2, Decl(declInput3.ts, 0, 0)) + +} + +class bar { +>bar : Symbol(bar, Decl(declInput3.ts, 2, 1)) + + public f() { return ''; } +>f : Symbol(f, Decl(declInput3.ts, 4, 11)) + + public g() { return {a: null, b: undefined, c: void 4 }; } +>g : Symbol(g, Decl(declInput3.ts, 5, 27)) +>a : Symbol(a, Decl(declInput3.ts, 6, 23)) +>bar : Symbol(bar, Decl(declInput3.ts, 2, 1)) +>b : Symbol(b, Decl(declInput3.ts, 6, 36)) +>undefined : Symbol(undefined) +>c : Symbol(c, Decl(declInput3.ts, 6, 50)) + + public h(x = 4, y = null, z = '') { x++; } +>h : Symbol(h, Decl(declInput3.ts, 6, 65)) +>x : Symbol(x, Decl(declInput3.ts, 7, 11)) +>y : Symbol(y, Decl(declInput3.ts, 7, 17)) +>z : Symbol(z, Decl(declInput3.ts, 7, 27)) +>x : Symbol(x, Decl(declInput3.ts, 7, 11)) +} + diff --git a/tests/baselines/reference/declInput3.types b/tests/baselines/reference/declInput3.types index df69422f55b..0dcbc6bd3cd 100644 --- a/tests/baselines/reference/declInput3.types +++ b/tests/baselines/reference/declInput3.types @@ -9,6 +9,7 @@ class bar { public f() { return ''; } >f : () => string +>'' : string public g() { return {a: null, b: undefined, c: void 4 }; } >g : () => { a: bar; b: any; c: any; } @@ -16,16 +17,21 @@ class bar { >a : bar >null : bar >bar : bar +>null : null >b : undefined >undefined : undefined >c : undefined >void 4 : undefined +>4 : number public h(x = 4, y = null, z = '') { x++; } >h : (x?: number, y?: any, z?: string) => void >x : number +>4 : number >y : any +>null : null >z : string +>'' : string >x++ : number >x : number } diff --git a/tests/baselines/reference/declInput4.symbols b/tests/baselines/reference/declInput4.symbols new file mode 100644 index 00000000000..01af5987a7d --- /dev/null +++ b/tests/baselines/reference/declInput4.symbols @@ -0,0 +1,47 @@ +=== tests/cases/compiler/declInput4.ts === +module M { +>M : Symbol(M, Decl(declInput4.ts, 0, 0)) + + class C { } +>C : Symbol(C, Decl(declInput4.ts, 0, 10)) + + export class E {} +>E : Symbol(E, Decl(declInput4.ts, 1, 15)) + + export interface I1 {} +>I1 : Symbol(I1, Decl(declInput4.ts, 2, 21)) + + interface I2 {} +>I2 : Symbol(I2, Decl(declInput4.ts, 3, 26)) + + export class D { +>D : Symbol(D, Decl(declInput4.ts, 4, 19)) + + public m1: number; +>m1 : Symbol(m1, Decl(declInput4.ts, 5, 20)) + + public m2: string; +>m2 : Symbol(m2, Decl(declInput4.ts, 6, 26)) + + public m23: E; +>m23 : Symbol(m23, Decl(declInput4.ts, 7, 26)) +>E : Symbol(E, Decl(declInput4.ts, 1, 15)) + + public m24: I1; +>m24 : Symbol(m24, Decl(declInput4.ts, 8, 22)) +>I1 : Symbol(I1, Decl(declInput4.ts, 2, 21)) + + public m232(): E { return null;} +>m232 : Symbol(m232, Decl(declInput4.ts, 9, 23)) +>E : Symbol(E, Decl(declInput4.ts, 1, 15)) + + public m242(): I1 { return null; } +>m242 : Symbol(m242, Decl(declInput4.ts, 10, 40)) +>I1 : Symbol(I1, Decl(declInput4.ts, 2, 21)) + + public m26(i:I1) {} +>m26 : Symbol(m26, Decl(declInput4.ts, 11, 42)) +>i : Symbol(i, Decl(declInput4.ts, 12, 19)) +>I1 : Symbol(I1, Decl(declInput4.ts, 2, 21)) + } +} diff --git a/tests/baselines/reference/declInput4.types b/tests/baselines/reference/declInput4.types index 7f5c5a81197..dd6915c162d 100644 --- a/tests/baselines/reference/declInput4.types +++ b/tests/baselines/reference/declInput4.types @@ -34,10 +34,12 @@ module M { public m232(): E { return null;} >m232 : () => E >E : E +>null : null public m242(): I1 { return null; } >m242 : () => I1 >I1 : I1 +>null : null public m26(i:I1) {} >m26 : (i: I1) => void diff --git a/tests/baselines/reference/declarationEmitDefaultExport1.symbols b/tests/baselines/reference/declarationEmitDefaultExport1.symbols new file mode 100644 index 00000000000..a90faac829c --- /dev/null +++ b/tests/baselines/reference/declarationEmitDefaultExport1.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/declarationEmitDefaultExport1.ts === +export default class C { +>C : Symbol(C, Decl(declarationEmitDefaultExport1.ts, 0, 0)) +} diff --git a/tests/baselines/reference/declarationEmitDefaultExport2.symbols b/tests/baselines/reference/declarationEmitDefaultExport2.symbols new file mode 100644 index 00000000000..b82e6cfb923 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDefaultExport2.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/declarationEmitDefaultExport2.ts === +export default class { +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmitDefaultExport3.symbols b/tests/baselines/reference/declarationEmitDefaultExport3.symbols new file mode 100644 index 00000000000..f69bbfcf0e7 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDefaultExport3.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/declarationEmitDefaultExport3.ts === +export default function foo() { +>foo : Symbol(foo, Decl(declarationEmitDefaultExport3.ts, 0, 0)) + + return "" +} diff --git a/tests/baselines/reference/declarationEmitDefaultExport3.types b/tests/baselines/reference/declarationEmitDefaultExport3.types index 0bde6eff915..91ee71f61ac 100644 --- a/tests/baselines/reference/declarationEmitDefaultExport3.types +++ b/tests/baselines/reference/declarationEmitDefaultExport3.types @@ -3,4 +3,5 @@ export default function foo() { >foo : () => string return "" +>"" : string } diff --git a/tests/baselines/reference/declarationEmitDefaultExport4.symbols b/tests/baselines/reference/declarationEmitDefaultExport4.symbols new file mode 100644 index 00000000000..8043af36b76 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDefaultExport4.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/declarationEmitDefaultExport4.ts === +export default function () { +No type information for this code. return 1; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmitDefaultExport4.types b/tests/baselines/reference/declarationEmitDefaultExport4.types index 8043af36b76..ab97484176d 100644 --- a/tests/baselines/reference/declarationEmitDefaultExport4.types +++ b/tests/baselines/reference/declarationEmitDefaultExport4.types @@ -1,5 +1,5 @@ === tests/cases/compiler/declarationEmitDefaultExport4.ts === export default function () { -No type information for this code. return 1; -No type information for this code.} -No type information for this code. \ No newline at end of file + return 1; +>1 : number +} diff --git a/tests/baselines/reference/declarationEmitDefaultExport5.js b/tests/baselines/reference/declarationEmitDefaultExport5.js index a8794d92c63..701318b14d7 100644 --- a/tests/baselines/reference/declarationEmitDefaultExport5.js +++ b/tests/baselines/reference/declarationEmitDefaultExport5.js @@ -7,4 +7,5 @@ export default 1 + 2; //// [declarationEmitDefaultExport5.d.ts] -export default : number; +declare var _default: number; +export default _default; diff --git a/tests/baselines/reference/declarationEmitDefaultExport5.symbols b/tests/baselines/reference/declarationEmitDefaultExport5.symbols new file mode 100644 index 00000000000..2ede4a5941a --- /dev/null +++ b/tests/baselines/reference/declarationEmitDefaultExport5.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/declarationEmitDefaultExport5.ts === +export default 1 + 2; +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmitDefaultExport5.types b/tests/baselines/reference/declarationEmitDefaultExport5.types index 702cc51f71e..d2b177cc084 100644 --- a/tests/baselines/reference/declarationEmitDefaultExport5.types +++ b/tests/baselines/reference/declarationEmitDefaultExport5.types @@ -1,4 +1,6 @@ === tests/cases/compiler/declarationEmitDefaultExport5.ts === export default 1 + 2; >1 + 2 : number +>1 : number +>2 : number diff --git a/tests/baselines/reference/declarationEmitDefaultExport6.js b/tests/baselines/reference/declarationEmitDefaultExport6.js index d328458366e..d56609e8534 100644 --- a/tests/baselines/reference/declarationEmitDefaultExport6.js +++ b/tests/baselines/reference/declarationEmitDefaultExport6.js @@ -12,4 +12,5 @@ export default new A(); //// [declarationEmitDefaultExport6.d.ts] export declare class A { } -export default : A; +declare var _default: A; +export default _default; diff --git a/tests/baselines/reference/declarationEmitDefaultExport6.symbols b/tests/baselines/reference/declarationEmitDefaultExport6.symbols new file mode 100644 index 00000000000..fb52f276f95 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDefaultExport6.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/declarationEmitDefaultExport6.ts === +export class A {} +>A : Symbol(A, Decl(declarationEmitDefaultExport6.ts, 0, 0)) + +export default new A(); +>A : Symbol(A, Decl(declarationEmitDefaultExport6.ts, 0, 0)) + diff --git a/tests/baselines/reference/declarationEmitDefaultExport8.js b/tests/baselines/reference/declarationEmitDefaultExport8.js new file mode 100644 index 00000000000..c023f3be7d3 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDefaultExport8.js @@ -0,0 +1,18 @@ +//// [declarationEmitDefaultExport8.ts] + +var _default = 1; +export {_default as d} +export default 1 + 2; + + +//// [declarationEmitDefaultExport8.js] +var _default = 1; +export { _default as d }; +export default 1 + 2; + + +//// [declarationEmitDefaultExport8.d.ts] +declare var _default: number; +export { _default as d }; +declare var _default_1: number; +export default _default_1; diff --git a/tests/baselines/reference/declarationEmitDefaultExport8.symbols b/tests/baselines/reference/declarationEmitDefaultExport8.symbols new file mode 100644 index 00000000000..be886b5a289 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDefaultExport8.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/declarationEmitDefaultExport8.ts === + +var _default = 1; +>_default : Symbol(_default, Decl(declarationEmitDefaultExport8.ts, 1, 3)) + +export {_default as d} +>_default : Symbol(d, Decl(declarationEmitDefaultExport8.ts, 2, 8)) +>d : Symbol(d, Decl(declarationEmitDefaultExport8.ts, 2, 8)) + +export default 1 + 2; + diff --git a/tests/baselines/reference/declarationEmitDefaultExport8.types b/tests/baselines/reference/declarationEmitDefaultExport8.types new file mode 100644 index 00000000000..bd99ee14530 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDefaultExport8.types @@ -0,0 +1,15 @@ +=== tests/cases/compiler/declarationEmitDefaultExport8.ts === + +var _default = 1; +>_default : number +>1 : number + +export {_default as d} +>_default : number +>d : number + +export default 1 + 2; +>1 + 2 : number +>1 : number +>2 : number + diff --git a/tests/baselines/reference/declarationEmitDestructuring1.symbols b/tests/baselines/reference/declarationEmitDestructuring1.symbols new file mode 100644 index 00000000000..10920128eee --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuring1.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/declarationEmitDestructuring1.ts === +function foo([a, b, c]: [string, string, string]): void { } +>foo : Symbol(foo, Decl(declarationEmitDestructuring1.ts, 0, 0)) +>a : Symbol(a, Decl(declarationEmitDestructuring1.ts, 0, 14)) +>b : Symbol(b, Decl(declarationEmitDestructuring1.ts, 0, 16)) +>c : Symbol(c, Decl(declarationEmitDestructuring1.ts, 0, 19)) + +function far([a, [b], [[c]]]: [number, boolean[], string[][]]): void { } +>far : Symbol(far, Decl(declarationEmitDestructuring1.ts, 0, 59)) +>a : Symbol(a, Decl(declarationEmitDestructuring1.ts, 1, 14)) +>b : Symbol(b, Decl(declarationEmitDestructuring1.ts, 1, 18)) +>c : Symbol(c, Decl(declarationEmitDestructuring1.ts, 1, 24)) + +function bar({a1, b1, c1}: { a1: number, b1: boolean, c1: string }): void { } +>bar : Symbol(bar, Decl(declarationEmitDestructuring1.ts, 1, 72)) +>a1 : Symbol(a1, Decl(declarationEmitDestructuring1.ts, 2, 14)) +>b1 : Symbol(b1, Decl(declarationEmitDestructuring1.ts, 2, 17)) +>c1 : Symbol(c1, Decl(declarationEmitDestructuring1.ts, 2, 21)) +>a1 : Symbol(a1, Decl(declarationEmitDestructuring1.ts, 2, 28)) +>b1 : Symbol(b1, Decl(declarationEmitDestructuring1.ts, 2, 40)) +>c1 : Symbol(c1, Decl(declarationEmitDestructuring1.ts, 2, 53)) + +function baz({a2, b2: {b1, c1}}: { a2: number, b2: { b1: boolean, c1: string } }): void { } +>baz : Symbol(baz, Decl(declarationEmitDestructuring1.ts, 2, 77)) +>a2 : Symbol(a2, Decl(declarationEmitDestructuring1.ts, 3, 14)) +>b1 : Symbol(b1, Decl(declarationEmitDestructuring1.ts, 3, 23)) +>c1 : Symbol(c1, Decl(declarationEmitDestructuring1.ts, 3, 26)) +>a2 : Symbol(a2, Decl(declarationEmitDestructuring1.ts, 3, 34)) +>b2 : Symbol(b2, Decl(declarationEmitDestructuring1.ts, 3, 46)) +>b1 : Symbol(b1, Decl(declarationEmitDestructuring1.ts, 3, 52)) +>c1 : Symbol(c1, Decl(declarationEmitDestructuring1.ts, 3, 65)) + diff --git a/tests/baselines/reference/declarationEmitDestructuring1.types b/tests/baselines/reference/declarationEmitDestructuring1.types index 6b22f25b54b..abba67981d8 100644 --- a/tests/baselines/reference/declarationEmitDestructuring1.types +++ b/tests/baselines/reference/declarationEmitDestructuring1.types @@ -23,7 +23,7 @@ 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 { } >baz : ({a2, b2: {b1, c1}}: { a2: number; b2: { b1: boolean; c1: string; }; }) => void >a2 : number ->b2 : unknown +>b2 : any >b1 : boolean >c1 : string >a2 : number diff --git a/tests/baselines/reference/declarationEmitDestructuring2.symbols b/tests/baselines/reference/declarationEmitDestructuring2.symbols new file mode 100644 index 00000000000..9cf35c1d866 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuring2.symbols @@ -0,0 +1,40 @@ +=== 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 : Symbol(f, Decl(declarationEmitDestructuring2.ts, 0, 0)) +>x : Symbol(x, Decl(declarationEmitDestructuring2.ts, 0, 12)) +>a : Symbol(a, Decl(declarationEmitDestructuring2.ts, 0, 24)) +>b : Symbol(b, Decl(declarationEmitDestructuring2.ts, 0, 26)) +>c : Symbol(c, Decl(declarationEmitDestructuring2.ts, 0, 29)) +>d : Symbol(d, Decl(declarationEmitDestructuring2.ts, 0, 32)) +>x : Symbol(x, Decl(declarationEmitDestructuring2.ts, 0, 55)) +>y : Symbol(y, Decl(declarationEmitDestructuring2.ts, 0, 62)) + +function g([a, b, c, d] = [1, 2, 3, 4]) { } +>g : Symbol(g, Decl(declarationEmitDestructuring2.ts, 0, 85)) +>a : Symbol(a, Decl(declarationEmitDestructuring2.ts, 1, 12)) +>b : Symbol(b, Decl(declarationEmitDestructuring2.ts, 1, 14)) +>c : Symbol(c, Decl(declarationEmitDestructuring2.ts, 1, 17)) +>d : Symbol(d, Decl(declarationEmitDestructuring2.ts, 1, 20)) + +function h([a, [b], [[c]], {x = 10, y: [a, b, c], z: {a1, b1}}]){ } +>h : Symbol(h, Decl(declarationEmitDestructuring2.ts, 1, 43)) +>a : Symbol(a, Decl(declarationEmitDestructuring2.ts, 2, 12), Decl(declarationEmitDestructuring2.ts, 2, 40)) +>b : Symbol(b, Decl(declarationEmitDestructuring2.ts, 2, 16), Decl(declarationEmitDestructuring2.ts, 2, 42)) +>c : Symbol(c, Decl(declarationEmitDestructuring2.ts, 2, 22), Decl(declarationEmitDestructuring2.ts, 2, 45)) +>x : Symbol(x, Decl(declarationEmitDestructuring2.ts, 2, 28)) +>a : Symbol(a, Decl(declarationEmitDestructuring2.ts, 2, 12), Decl(declarationEmitDestructuring2.ts, 2, 40)) +>b : Symbol(b, Decl(declarationEmitDestructuring2.ts, 2, 16), Decl(declarationEmitDestructuring2.ts, 2, 42)) +>c : Symbol(c, Decl(declarationEmitDestructuring2.ts, 2, 22), Decl(declarationEmitDestructuring2.ts, 2, 45)) +>a1 : Symbol(a1, Decl(declarationEmitDestructuring2.ts, 2, 54)) +>b1 : Symbol(b1, Decl(declarationEmitDestructuring2.ts, 2, 57)) + +function h1([a, [b], [[c]], {x = 10, y = [1, 2, 3], z: {a1, b1}}]){ } +>h1 : Symbol(h1, Decl(declarationEmitDestructuring2.ts, 2, 67)) +>a : Symbol(a, Decl(declarationEmitDestructuring2.ts, 3, 13)) +>b : Symbol(b, Decl(declarationEmitDestructuring2.ts, 3, 17)) +>c : Symbol(c, Decl(declarationEmitDestructuring2.ts, 3, 23)) +>x : Symbol(x, Decl(declarationEmitDestructuring2.ts, 3, 29)) +>y : Symbol(y, Decl(declarationEmitDestructuring2.ts, 3, 36)) +>a1 : Symbol(a1, Decl(declarationEmitDestructuring2.ts, 3, 56)) +>b1 : Symbol(b1, Decl(declarationEmitDestructuring2.ts, 3, 59)) + diff --git a/tests/baselines/reference/declarationEmitDestructuring2.types b/tests/baselines/reference/declarationEmitDestructuring2.types index 3368d4e72fd..619ad13d084 100644 --- a/tests/baselines/reference/declarationEmitDestructuring2.types +++ b/tests/baselines/reference/declarationEmitDestructuring2.types @@ -2,16 +2,26 @@ 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 +>10 : number +>y : any >a : number >b : number >c : number >d : number >[1, 2, 3, 4] : [number, number, number, number] +>1 : number +>2 : number +>3 : number +>4 : number >{ x: 10, y: [2, 4, 6, 8] } : { x: number; y: [number, number, number, number]; } >x : number +>10 : number >y : [number, number, number, number] >[2, 4, 6, 8] : [number, number, number, number] +>2 : number +>4 : number +>6 : number +>8 : number function g([a, b, c, d] = [1, 2, 3, 4]) { } >g : ([a, b, c, d]?: [number, number, number, number]) => void @@ -20,6 +30,10 @@ function g([a, b, c, d] = [1, 2, 3, 4]) { } >c : number >d : number >[1, 2, 3, 4] : [number, number, number, number] +>1 : number +>2 : number +>3 : number +>4 : 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 @@ -27,11 +41,12 @@ function h([a, [b], [[c]], {x = 10, y: [a, b, c], z: {a1, b1}}]){ } >b : any >c : any >x : number ->y : unknown +>10 : number +>y : any >a : any >b : any >c : any ->z : unknown +>z : any >a1 : any >b1 : any @@ -41,9 +56,13 @@ function h1([a, [b], [[c]], {x = 10, y = [1, 2, 3], z: {a1, b1}}]){ } >b : any >c : any >x : number +>10 : number >y : number[] >[1, 2, 3] : number[] ->z : unknown +>1 : number +>2 : number +>3 : number +>z : any >a1 : any >b1 : any diff --git a/tests/baselines/reference/declarationEmitDestructuring3.symbols b/tests/baselines/reference/declarationEmitDestructuring3.symbols new file mode 100644 index 00000000000..76a1c6a003b --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuring3.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/declarationEmitDestructuring3.ts === +function bar([x, z, ...w]) { } +>bar : Symbol(bar, Decl(declarationEmitDestructuring3.ts, 0, 0)) +>x : Symbol(x, Decl(declarationEmitDestructuring3.ts, 0, 14)) +>z : Symbol(z, Decl(declarationEmitDestructuring3.ts, 0, 16)) +>w : Symbol(w, Decl(declarationEmitDestructuring3.ts, 0, 19)) + +function foo([x, ...y] = [1, "string", true]) { } +>foo : Symbol(foo, Decl(declarationEmitDestructuring3.ts, 0, 30)) +>x : Symbol(x, Decl(declarationEmitDestructuring3.ts, 1, 14)) +>y : Symbol(y, Decl(declarationEmitDestructuring3.ts, 1, 16)) + + diff --git a/tests/baselines/reference/declarationEmitDestructuring3.types b/tests/baselines/reference/declarationEmitDestructuring3.types index 57764f53eee..da9fc6d6606 100644 --- a/tests/baselines/reference/declarationEmitDestructuring3.types +++ b/tests/baselines/reference/declarationEmitDestructuring3.types @@ -10,5 +10,8 @@ function foo([x, ...y] = [1, "string", true]) { } >x : string | number | boolean >y : (string | number | boolean)[] >[1, "string", true] : (string | number | boolean)[] +>1 : number +>"string" : string +>true : boolean diff --git a/tests/baselines/reference/declarationEmitDestructuring4.symbols b/tests/baselines/reference/declarationEmitDestructuring4.symbols new file mode 100644 index 00000000000..9f2eb162b6f --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuring4.symbols @@ -0,0 +1,21 @@ +=== 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 : Symbol(baz, Decl(declarationEmitDestructuring4.ts, 0, 0)) + +function baz1([] = [1,2,3]) { } +>baz1 : Symbol(baz1, Decl(declarationEmitDestructuring4.ts, 3, 20)) + +function baz2([[]] = [[1,2,3]]) { } +>baz2 : Symbol(baz2, Decl(declarationEmitDestructuring4.ts, 4, 31)) + +function baz3({}) { } +>baz3 : Symbol(baz3, Decl(declarationEmitDestructuring4.ts, 5, 35)) + +function baz4({} = { x: 10 }) { } +>baz4 : Symbol(baz4, Decl(declarationEmitDestructuring4.ts, 7, 21)) +>x : Symbol(x, Decl(declarationEmitDestructuring4.ts, 8, 20)) + + diff --git a/tests/baselines/reference/declarationEmitDestructuring4.types b/tests/baselines/reference/declarationEmitDestructuring4.types index 6a90eda1702..9621d61e02b 100644 --- a/tests/baselines/reference/declarationEmitDestructuring4.types +++ b/tests/baselines/reference/declarationEmitDestructuring4.types @@ -8,11 +8,17 @@ function baz([]) { } function baz1([] = [1,2,3]) { } >baz1 : ([]?: number[]) => void >[1,2,3] : number[] +>1 : number +>2 : number +>3 : number function baz2([[]] = [[1,2,3]]) { } >baz2 : ([[]]?: [number[]]) => void >[[1,2,3]] : [number[]] >[1,2,3] : number[] +>1 : number +>2 : number +>3 : number function baz3({}) { } >baz3 : ({}: {}) => void @@ -21,5 +27,6 @@ function baz4({} = { x: 10 }) { } >baz4 : ({}?: { x: number; }) => void >{ x: 10 } : { x: number; } >x : number +>10 : number diff --git a/tests/baselines/reference/declarationEmitDestructuring5.symbols b/tests/baselines/reference/declarationEmitDestructuring5.symbols new file mode 100644 index 00000000000..6e12358b80c --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuring5.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/declarationEmitDestructuring5.ts === +function baz([, z, , ]) { } +>baz : Symbol(baz, Decl(declarationEmitDestructuring5.ts, 0, 0)) +>z : Symbol(z, Decl(declarationEmitDestructuring5.ts, 0, 15)) + +function foo([, b, ]: [any, any]): void { } +>foo : Symbol(foo, Decl(declarationEmitDestructuring5.ts, 0, 27)) +>b : Symbol(b, Decl(declarationEmitDestructuring5.ts, 1, 15)) + +function bar([z, , , ]) { } +>bar : Symbol(bar, Decl(declarationEmitDestructuring5.ts, 1, 43)) +>z : Symbol(z, Decl(declarationEmitDestructuring5.ts, 2, 14)) + +function bar1([z, , , ] = [1, 3, 4, 6, 7]) { } +>bar1 : Symbol(bar1, Decl(declarationEmitDestructuring5.ts, 2, 27)) +>z : Symbol(z, Decl(declarationEmitDestructuring5.ts, 3, 15)) + +function bar2([,,z, , , ]) { } +>bar2 : Symbol(bar2, Decl(declarationEmitDestructuring5.ts, 3, 46)) +>z : Symbol(z, Decl(declarationEmitDestructuring5.ts, 4, 17)) + diff --git a/tests/baselines/reference/declarationEmitDestructuring5.types b/tests/baselines/reference/declarationEmitDestructuring5.types index 375440bea0b..f09b1ebf50c 100644 --- a/tests/baselines/reference/declarationEmitDestructuring5.types +++ b/tests/baselines/reference/declarationEmitDestructuring5.types @@ -1,22 +1,38 @@ === tests/cases/compiler/declarationEmitDestructuring5.ts === function baz([, z, , ]) { } >baz : ([, z, , ]: [any, any, any]) => void +> : undefined >z : any +> : undefined function foo([, b, ]: [any, any]): void { } >foo : ([, b, ]: [any, any]) => void +> : undefined >b : any function bar([z, , , ]) { } >bar : ([z, , , ]: [any, any, any]) => void >z : any +> : undefined +> : undefined function bar1([z, , , ] = [1, 3, 4, 6, 7]) { } >bar1 : ([z, , , ]?: [number, number, number, number, number]) => void >z : number +> : undefined +> : undefined >[1, 3, 4, 6, 7] : [number, number, number, number, number] +>1 : number +>3 : number +>4 : number +>6 : number +>7 : number function bar2([,,z, , , ]) { } >bar2 : ([,,z, , , ]: [any, any, any, any, any]) => void +> : undefined +> : undefined >z : any +> : undefined +> : undefined diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.js b/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.js index 088bb4e849f..9a9be8c69da 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.js +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.js @@ -11,7 +11,7 @@ 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 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"]; diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.symbols b/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.symbols new file mode 100644 index 00000000000..e9d80c89f6e --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/declarationEmitDestructuringArrayPattern1.ts === + +var [] = [1, "hello"]; // Dont emit anything +var [x] = [1, "hello"]; // emit x: number +>x : Symbol(x, Decl(declarationEmitDestructuringArrayPattern1.ts, 2, 5)) + +var [x1, y1] = [1, "hello"]; // emit x1: number, y1: string +>x1 : Symbol(x1, Decl(declarationEmitDestructuringArrayPattern1.ts, 3, 5)) +>y1 : Symbol(y1, Decl(declarationEmitDestructuringArrayPattern1.ts, 3, 8)) + +var [, , z1] = [0, 1, 2]; // emit z1: number +>z1 : Symbol(z1, Decl(declarationEmitDestructuringArrayPattern1.ts, 4, 8)) + +var a = [1, "hello"]; +>a : Symbol(a, Decl(declarationEmitDestructuringArrayPattern1.ts, 6, 3)) + +var [x2] = a; // emit x2: number | string +>x2 : Symbol(x2, Decl(declarationEmitDestructuringArrayPattern1.ts, 7, 5)) +>a : Symbol(a, Decl(declarationEmitDestructuringArrayPattern1.ts, 6, 3)) + +var [x3, y3, z3] = a; // emit x3, y3, z3 +>x3 : Symbol(x3, Decl(declarationEmitDestructuringArrayPattern1.ts, 8, 5)) +>y3 : Symbol(y3, Decl(declarationEmitDestructuringArrayPattern1.ts, 8, 8)) +>z3 : Symbol(z3, Decl(declarationEmitDestructuringArrayPattern1.ts, 8, 12)) +>a : Symbol(a, Decl(declarationEmitDestructuringArrayPattern1.ts, 6, 3)) + diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.types b/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.types index 9f6f4c9857d..0feeaf2db1a 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.types +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.types @@ -2,23 +2,36 @@ var [] = [1, "hello"]; // Dont emit anything >[1, "hello"] : (string | number)[] +>1 : number +>"hello" : string var [x] = [1, "hello"]; // emit x: number >x : number >[1, "hello"] : [number, string] +>1 : number +>"hello" : string var [x1, y1] = [1, "hello"]; // emit x1: number, y1: string >x1 : number >y1 : string >[1, "hello"] : [number, string] +>1 : number +>"hello" : string var [, , z1] = [0, 1, 2]; // emit z1: number +> : undefined +> : undefined >z1 : number >[0, 1, 2] : [number, number, number] +>0 : number +>1 : number +>2 : number var a = [1, "hello"]; >a : (string | number)[] >[1, "hello"] : (string | number)[] +>1 : number +>"hello" : string var [x2] = a; // emit x2: number | string >x2 : string | number diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.symbols b/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.symbols new file mode 100644 index 00000000000..9e0e48f89e8 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/declarationEmitDestructuringArrayPattern2.ts === +var [x10, [y10, [z10]]] = [1, ["hello", [true]]]; +>x10 : Symbol(x10, Decl(declarationEmitDestructuringArrayPattern2.ts, 0, 5)) +>y10 : Symbol(y10, Decl(declarationEmitDestructuringArrayPattern2.ts, 0, 11)) +>z10 : Symbol(z10, Decl(declarationEmitDestructuringArrayPattern2.ts, 0, 17)) + +var [x11 = 0, y11 = ""] = [1, "hello"]; +>x11 : Symbol(x11, Decl(declarationEmitDestructuringArrayPattern2.ts, 2, 5)) +>y11 : Symbol(y11, Decl(declarationEmitDestructuringArrayPattern2.ts, 2, 13)) + +var [a11, b11, c11] = []; +>a11 : Symbol(a11, Decl(declarationEmitDestructuringArrayPattern2.ts, 3, 5)) +>b11 : Symbol(b11, Decl(declarationEmitDestructuringArrayPattern2.ts, 3, 9)) +>c11 : Symbol(c11, Decl(declarationEmitDestructuringArrayPattern2.ts, 3, 14)) + +var [a2, [b2, { x12, y12: c2 }]=["abc", { x12: 10, y12: false }]] = [1, ["hello", { x12: 5, y12: true }]]; +>a2 : Symbol(a2, Decl(declarationEmitDestructuringArrayPattern2.ts, 5, 5)) +>b2 : Symbol(b2, Decl(declarationEmitDestructuringArrayPattern2.ts, 5, 10)) +>x12 : Symbol(x12, Decl(declarationEmitDestructuringArrayPattern2.ts, 5, 15)) +>c2 : Symbol(c2, Decl(declarationEmitDestructuringArrayPattern2.ts, 5, 20)) +>x12 : Symbol(x12, Decl(declarationEmitDestructuringArrayPattern2.ts, 5, 41)) +>y12 : Symbol(y12, Decl(declarationEmitDestructuringArrayPattern2.ts, 5, 50)) +>x12 : Symbol(x12, Decl(declarationEmitDestructuringArrayPattern2.ts, 5, 83)) +>y12 : Symbol(y12, Decl(declarationEmitDestructuringArrayPattern2.ts, 5, 91)) + +var [x13, y13] = [1, "hello"]; +>x13 : Symbol(x13, Decl(declarationEmitDestructuringArrayPattern2.ts, 7, 5)) +>y13 : Symbol(y13, Decl(declarationEmitDestructuringArrayPattern2.ts, 7, 9)) + +var [a3, b3] = [[x13, y13], { x: x13, y: y13 }]; +>a3 : Symbol(a3, Decl(declarationEmitDestructuringArrayPattern2.ts, 8, 5)) +>b3 : Symbol(b3, Decl(declarationEmitDestructuringArrayPattern2.ts, 8, 8)) +>x13 : Symbol(x13, Decl(declarationEmitDestructuringArrayPattern2.ts, 7, 5)) +>y13 : Symbol(y13, Decl(declarationEmitDestructuringArrayPattern2.ts, 7, 9)) +>x : Symbol(x, Decl(declarationEmitDestructuringArrayPattern2.ts, 8, 29)) +>x13 : Symbol(x13, Decl(declarationEmitDestructuringArrayPattern2.ts, 7, 5)) +>y : Symbol(y, Decl(declarationEmitDestructuringArrayPattern2.ts, 8, 37)) +>y13 : Symbol(y13, Decl(declarationEmitDestructuringArrayPattern2.ts, 7, 9)) + diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.types b/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.types index 2b40a388e3b..9fce72751cf 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.types +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.types @@ -4,13 +4,20 @@ var [x10, [y10, [z10]]] = [1, ["hello", [true]]]; >y10 : string >z10 : boolean >[1, ["hello", [true]]] : [number, [string, [boolean]]] +>1 : number >["hello", [true]] : [string, [boolean]] +>"hello" : string >[true] : [boolean] +>true : boolean var [x11 = 0, y11 = ""] = [1, "hello"]; >x11 : number +>0 : number >y11 : string +>"" : string >[1, "hello"] : [number, string] +>1 : number +>"hello" : string var [a11, b11, c11] = []; >a11 : any @@ -22,22 +29,31 @@ var [a2, [b2, { x12, y12: c2 }]=["abc", { x12: 10, y12: false }]] = [1, ["hello" >a2 : number >b2 : string >x12 : number ->y12 : unknown +>y12 : any >c2 : boolean >["abc", { x12: 10, y12: false }] : [string, { x12: number; y12: boolean; }] +>"abc" : string >{ x12: 10, y12: false } : { x12: number; y12: boolean; } >x12 : number +>10 : number >y12 : boolean +>false : boolean >[1, ["hello", { x12: 5, y12: true }]] : [number, [string, { x12: number; y12: boolean; }]] +>1 : number >["hello", { x12: 5, y12: true }] : [string, { x12: number; y12: boolean; }] +>"hello" : string >{ x12: 5, y12: true } : { x12: number; y12: boolean; } >x12 : number +>5 : number >y12 : boolean +>true : boolean var [x13, y13] = [1, "hello"]; >x13 : number >y13 : string >[1, "hello"] : [number, string] +>1 : number +>"hello" : string var [a3, b3] = [[x13, y13], { x: x13, y: y13 }]; >a3 : (string | number)[] diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.symbols b/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.symbols new file mode 100644 index 00000000000..af0f758684e --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/declarationEmitDestructuringArrayPattern3.ts === +module M { +>M : Symbol(M, Decl(declarationEmitDestructuringArrayPattern3.ts, 0, 0)) + + export var [a, b] = [1, 2]; +>a : Symbol(a, Decl(declarationEmitDestructuringArrayPattern3.ts, 1, 16)) +>b : Symbol(b, Decl(declarationEmitDestructuringArrayPattern3.ts, 1, 18)) +} diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.types b/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.types index 4852a7e37fb..406494aa13b 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.types +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.types @@ -6,4 +6,6 @@ module M { >a : number >b : number >[1, 2] : [number, number] +>1 : number +>2 : number } diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.js b/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.js index f19a4a840bf..1bd07e7b974 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.js +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.js @@ -10,14 +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 a5 = [1, 2, 3].slice(0); +var _a = [1, 2, 3], x14 = _a[0], a6 = _a.slice(1); +var _b = [1, 2, 3], x15 = _b[0], y15 = _b[1], a7 = _b.slice(2); +var _c = [1, 2, 3], x16 = _c[0], y16 = _c[1], z16 = _c[2], a8 = _c.slice(3); +var a9 = [1, "hello", true].slice(0); +var _d = [1, "hello", true], x17 = _d[0], a10 = _d.slice(1); +var _e = [1, "hello", true], x18 = _e[0], y18 = _e[1], a12 = _e.slice(2); +var _f = [1, "hello", true], x19 = _f[0], y19 = _f[1], z19 = _f[2], a13 = _f.slice(3); //// [declarationEmitDestructuringArrayPattern4.d.ts] diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.symbols b/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.symbols new file mode 100644 index 00000000000..b83f5a5d2d1 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/declarationEmitDestructuringArrayPattern4.ts === +var [...a5] = [1, 2, 3]; +>a5 : Symbol(a5, Decl(declarationEmitDestructuringArrayPattern4.ts, 0, 5)) + +var [x14, ...a6] = [1, 2, 3]; +>x14 : Symbol(x14, Decl(declarationEmitDestructuringArrayPattern4.ts, 1, 5)) +>a6 : Symbol(a6, Decl(declarationEmitDestructuringArrayPattern4.ts, 1, 9)) + +var [x15, y15, ...a7] = [1, 2, 3]; +>x15 : Symbol(x15, Decl(declarationEmitDestructuringArrayPattern4.ts, 2, 5)) +>y15 : Symbol(y15, Decl(declarationEmitDestructuringArrayPattern4.ts, 2, 9)) +>a7 : Symbol(a7, Decl(declarationEmitDestructuringArrayPattern4.ts, 2, 14)) + +var [x16, y16, z16, ...a8] = [1, 2, 3]; +>x16 : Symbol(x16, Decl(declarationEmitDestructuringArrayPattern4.ts, 3, 5)) +>y16 : Symbol(y16, Decl(declarationEmitDestructuringArrayPattern4.ts, 3, 9)) +>z16 : Symbol(z16, Decl(declarationEmitDestructuringArrayPattern4.ts, 3, 14)) +>a8 : Symbol(a8, Decl(declarationEmitDestructuringArrayPattern4.ts, 3, 19)) + +var [...a9] = [1, "hello", true]; +>a9 : Symbol(a9, Decl(declarationEmitDestructuringArrayPattern4.ts, 5, 5)) + +var [x17, ...a10] = [1, "hello", true]; +>x17 : Symbol(x17, Decl(declarationEmitDestructuringArrayPattern4.ts, 6, 5)) +>a10 : Symbol(a10, Decl(declarationEmitDestructuringArrayPattern4.ts, 6, 9)) + +var [x18, y18, ...a12] = [1, "hello", true]; +>x18 : Symbol(x18, Decl(declarationEmitDestructuringArrayPattern4.ts, 7, 5)) +>y18 : Symbol(y18, Decl(declarationEmitDestructuringArrayPattern4.ts, 7, 9)) +>a12 : Symbol(a12, Decl(declarationEmitDestructuringArrayPattern4.ts, 7, 14)) + +var [x19, y19, z19, ...a13] = [1, "hello", true]; +>x19 : Symbol(x19, Decl(declarationEmitDestructuringArrayPattern4.ts, 8, 5)) +>y19 : Symbol(y19, Decl(declarationEmitDestructuringArrayPattern4.ts, 8, 9)) +>z19 : Symbol(z19, Decl(declarationEmitDestructuringArrayPattern4.ts, 8, 14)) +>a13 : Symbol(a13, Decl(declarationEmitDestructuringArrayPattern4.ts, 8, 19)) + diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.types b/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.types index d6d0fa758d7..2cc56abcb05 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.types +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.types @@ -2,17 +2,26 @@ var [...a5] = [1, 2, 3]; >a5 : number[] >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number var [x14, ...a6] = [1, 2, 3]; >x14 : number >a6 : number[] >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number var [x15, y15, ...a7] = [1, 2, 3]; >x15 : number >y15 : number >a7 : number[] >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number var [x16, y16, z16, ...a8] = [1, 2, 3]; >x16 : number @@ -20,21 +29,33 @@ var [x16, y16, z16, ...a8] = [1, 2, 3]; >z16 : number >a8 : number[] >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number var [...a9] = [1, "hello", true]; >a9 : (string | number | boolean)[] >[1, "hello", true] : (string | number | boolean)[] +>1 : number +>"hello" : string +>true : boolean var [x17, ...a10] = [1, "hello", true]; >x17 : string | number | boolean >a10 : (string | number | boolean)[] >[1, "hello", true] : (string | number | boolean)[] +>1 : number +>"hello" : string +>true : boolean var [x18, y18, ...a12] = [1, "hello", true]; >x18 : string | number | boolean >y18 : string | number | boolean >a12 : (string | number | boolean)[] >[1, "hello", true] : (string | number | boolean)[] +>1 : number +>"hello" : string +>true : boolean var [x19, y19, z19, ...a13] = [1, "hello", true]; >x19 : string | number | boolean @@ -42,4 +63,7 @@ var [x19, y19, z19, ...a13] = [1, "hello", true]; >z19 : string | number | boolean >a13 : (string | number | boolean)[] >[1, "hello", true] : (string | number | boolean)[] +>1 : number +>"hello" : string +>true : boolean diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.symbols b/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.symbols new file mode 100644 index 00000000000..d30aab7832c --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/declarationEmitDestructuringArrayPattern5.ts === +var [, , z] = [1, 2, 4]; +>z : Symbol(z, Decl(declarationEmitDestructuringArrayPattern5.ts, 0, 8)) + +var [, a, , ] = [3, 4, 5]; +>a : Symbol(a, Decl(declarationEmitDestructuringArrayPattern5.ts, 1, 6)) + +var [, , [, b, ]] = [3,5,[0, 1]]; +>b : Symbol(b, Decl(declarationEmitDestructuringArrayPattern5.ts, 2, 11)) + diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types b/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types index 6352917682e..fa5720f4da7 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types @@ -1,14 +1,31 @@ === tests/cases/compiler/declarationEmitDestructuringArrayPattern5.ts === var [, , z] = [1, 2, 4]; +> : undefined +> : undefined >z : number >[1, 2, 4] : [number, number, number] +>1 : number +>2 : number +>4 : number var [, a, , ] = [3, 4, 5]; +> : undefined >a : number +> : undefined >[3, 4, 5] : [number, number, number] +>3 : number +>4 : number +>5 : number var [, , [, b, ]] = [3,5,[0, 1]]; +> : undefined +> : undefined +> : undefined >b : number >[3,5,[0, 1]] : [number, number, [number, number]] +>3 : number +>5 : number >[0, 1] : [number, number] +>0 : number +>1 : number diff --git a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.js b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.js index d94da79ad9a..38b0a14af5c 100644 --- a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.js +++ b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.js @@ -24,11 +24,11 @@ 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 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 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() { diff --git a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.symbols b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.symbols new file mode 100644 index 00000000000..3cb4ef28c2b --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.symbols @@ -0,0 +1,80 @@ +=== tests/cases/compiler/declarationEmitDestructuringObjectLiteralPattern.ts === + +var { } = { x: 5, y: "hello" }; +>x : Symbol(x, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 1, 11)) +>y : Symbol(y, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 1, 17)) + +var { x4 } = { x4: 5, y4: "hello" }; +>x4 : Symbol(x4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 2, 5)) +>x4 : Symbol(x4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 2, 14)) +>y4 : Symbol(y4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 2, 21)) + +var { y5 } = { x5: 5, y5: "hello" }; +>y5 : Symbol(y5, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 3, 5)) +>x5 : Symbol(x5, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 3, 14)) +>y5 : Symbol(y5, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 3, 21)) + +var { x6, y6 } = { x6: 5, y6: "hello" }; +>x6 : Symbol(x6, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 4, 5)) +>y6 : Symbol(y6, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 4, 9)) +>x6 : Symbol(x6, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 4, 18)) +>y6 : Symbol(y6, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 4, 25)) + +var { x7: a1 } = { x7: 5, y7: "hello" }; +>a1 : Symbol(a1, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 5, 5)) +>x7 : Symbol(x7, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 5, 18)) +>y7 : Symbol(y7, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 5, 25)) + +var { y8: b1 } = { x8: 5, y8: "hello" }; +>b1 : Symbol(b1, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 6, 5)) +>x8 : Symbol(x8, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 6, 18)) +>y8 : Symbol(y8, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 6, 25)) + +var { x9: a2, y9: b2 } = { x9: 5, y9: "hello" }; +>a2 : Symbol(a2, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 7, 5)) +>b2 : Symbol(b2, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 7, 13)) +>x9 : Symbol(x9, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 7, 26)) +>y9 : Symbol(y9, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 7, 33)) + +var { a: x11, b: { a: y11, b: { a: z11 }}} = { a: 1, b: { a: "hello", b: { a: true } } }; +>x11 : Symbol(x11, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 9, 5)) +>y11 : Symbol(y11, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 9, 18)) +>z11 : Symbol(z11, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 9, 31)) +>a : Symbol(a, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 9, 46)) +>b : Symbol(b, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 9, 52)) +>a : Symbol(a, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 9, 57)) +>b : Symbol(b, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 9, 69)) +>a : Symbol(a, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 9, 74)) + +function f15() { +>f15 : Symbol(f15, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 9, 89)) + + var a4 = "hello"; +>a4 : Symbol(a4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 12, 7)) + + var b4 = 1; +>b4 : Symbol(b4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 13, 7)) + + var c4 = true; +>c4 : Symbol(c4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 14, 7)) + + return { a4, b4, c4 }; +>a4 : Symbol(a4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 15, 12)) +>b4 : Symbol(b4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 15, 16)) +>c4 : Symbol(c4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 15, 20)) +} +var { a4, b4, c4 } = f15(); +>a4 : Symbol(a4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 17, 5)) +>b4 : Symbol(b4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 17, 9)) +>c4 : Symbol(c4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 17, 13)) +>f15 : Symbol(f15, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 9, 89)) + +module m { +>m : Symbol(m, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 17, 27)) + + export var { a4, b4, c4 } = f15(); +>a4 : Symbol(a4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 20, 16)) +>b4 : Symbol(b4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 20, 20)) +>c4 : Symbol(c4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 20, 24)) +>f15 : Symbol(f15, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 9, 89)) +} diff --git a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.types b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.types index b3c422e4958..0911a27838b 100644 --- a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.types +++ b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.types @@ -3,79 +3,99 @@ var { } = { x: 5, y: "hello" }; >{ x: 5, y: "hello" } : { x: number; y: string; } >x : number +>5 : number >y : string +>"hello" : string var { x4 } = { x4: 5, y4: "hello" }; >x4 : number >{ x4: 5, y4: "hello" } : { x4: number; y4: string; } >x4 : number +>5 : number >y4 : string +>"hello" : string var { y5 } = { x5: 5, y5: "hello" }; >y5 : string >{ x5: 5, y5: "hello" } : { x5: number; y5: string; } >x5 : number +>5 : number >y5 : string +>"hello" : string var { x6, y6 } = { x6: 5, y6: "hello" }; >x6 : number >y6 : string >{ x6: 5, y6: "hello" } : { x6: number; y6: string; } >x6 : number +>5 : number >y6 : string +>"hello" : string var { x7: a1 } = { x7: 5, y7: "hello" }; ->x7 : unknown +>x7 : any >a1 : number >{ x7: 5, y7: "hello" } : { x7: number; y7: string; } >x7 : number +>5 : number >y7 : string +>"hello" : string var { y8: b1 } = { x8: 5, y8: "hello" }; ->y8 : unknown +>y8 : any >b1 : string >{ x8: 5, y8: "hello" } : { x8: number; y8: string; } >x8 : number +>5 : number >y8 : string +>"hello" : string var { x9: a2, y9: b2 } = { x9: 5, y9: "hello" }; ->x9 : unknown +>x9 : any >a2 : number ->y9 : unknown +>y9 : any >b2 : string >{ x9: 5, y9: "hello" } : { x9: number; y9: string; } >x9 : number +>5 : number >y9 : string +>"hello" : string var { a: x11, b: { a: y11, b: { a: z11 }}} = { a: 1, b: { a: "hello", b: { a: true } } }; ->a : unknown +>a : any >x11 : number ->b : unknown ->a : unknown +>b : any +>a : any >y11 : string ->b : unknown ->a : unknown +>b : any +>a : any >z11 : boolean >{ a: 1, b: { a: "hello", b: { a: true } } } : { a: number; b: { a: string; b: { a: boolean; }; }; } >a : number +>1 : number >b : { a: string; b: { a: boolean; }; } >{ a: "hello", b: { a: true } } : { a: string; b: { a: boolean; }; } >a : string +>"hello" : string >b : { a: boolean; } >{ a: true } : { a: boolean; } >a : boolean +>true : boolean function f15() { >f15 : () => { a4: string; b4: number; c4: boolean; } var a4 = "hello"; >a4 : string +>"hello" : string var b4 = 1; >b4 : number +>1 : number var c4 = true; >c4 : boolean +>true : boolean return { a4, b4, c4 }; >{ a4, b4, c4 } : { a4: string; b4: number; c4: boolean; } diff --git a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.js b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.js index 2c14e743039..264e56fe58c 100644 --- a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.js +++ b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.js @@ -10,11 +10,11 @@ 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 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 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; diff --git a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.symbols b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.symbols new file mode 100644 index 00000000000..a4c43a07bc8 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/declarationEmitDestructuringObjectLiteralPattern1.ts === + +var { } = { x: 5, y: "hello" }; +>x : Symbol(x, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 1, 11)) +>y : Symbol(y, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 1, 17)) + +var { x4 } = { x4: 5, y4: "hello" }; +>x4 : Symbol(x4, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 2, 5)) +>x4 : Symbol(x4, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 2, 14)) +>y4 : Symbol(y4, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 2, 21)) + +var { y5 } = { x5: 5, y5: "hello" }; +>y5 : Symbol(y5, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 3, 5)) +>x5 : Symbol(x5, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 3, 14)) +>y5 : Symbol(y5, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 3, 21)) + +var { x6, y6 } = { x6: 5, y6: "hello" }; +>x6 : Symbol(x6, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 4, 5)) +>y6 : Symbol(y6, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 4, 9)) +>x6 : Symbol(x6, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 4, 18)) +>y6 : Symbol(y6, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 4, 25)) + +var { x7: a1 } = { x7: 5, y7: "hello" }; +>a1 : Symbol(a1, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 5, 5)) +>x7 : Symbol(x7, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 5, 18)) +>y7 : Symbol(y7, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 5, 25)) + +var { y8: b1 } = { x8: 5, y8: "hello" }; +>b1 : Symbol(b1, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 6, 5)) +>x8 : Symbol(x8, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 6, 18)) +>y8 : Symbol(y8, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 6, 25)) + +var { x9: a2, y9: b2 } = { x9: 5, y9: "hello" }; +>a2 : Symbol(a2, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 7, 5)) +>b2 : Symbol(b2, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 7, 13)) +>x9 : Symbol(x9, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 7, 26)) +>y9 : Symbol(y9, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 7, 33)) + diff --git a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.types b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.types index cc2094c68f4..5411f36fa9a 100644 --- a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.types +++ b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.types @@ -3,47 +3,61 @@ var { } = { x: 5, y: "hello" }; >{ x: 5, y: "hello" } : { x: number; y: string; } >x : number +>5 : number >y : string +>"hello" : string var { x4 } = { x4: 5, y4: "hello" }; >x4 : number >{ x4: 5, y4: "hello" } : { x4: number; y4: string; } >x4 : number +>5 : number >y4 : string +>"hello" : string var { y5 } = { x5: 5, y5: "hello" }; >y5 : string >{ x5: 5, y5: "hello" } : { x5: number; y5: string; } >x5 : number +>5 : number >y5 : string +>"hello" : string var { x6, y6 } = { x6: 5, y6: "hello" }; >x6 : number >y6 : string >{ x6: 5, y6: "hello" } : { x6: number; y6: string; } >x6 : number +>5 : number >y6 : string +>"hello" : string var { x7: a1 } = { x7: 5, y7: "hello" }; ->x7 : unknown +>x7 : any >a1 : number >{ x7: 5, y7: "hello" } : { x7: number; y7: string; } >x7 : number +>5 : number >y7 : string +>"hello" : string var { y8: b1 } = { x8: 5, y8: "hello" }; ->y8 : unknown +>y8 : any >b1 : string >{ x8: 5, y8: "hello" } : { x8: number; y8: string; } >x8 : number +>5 : number >y8 : string +>"hello" : string var { x9: a2, y9: b2 } = { x9: 5, y9: "hello" }; ->x9 : unknown +>x9 : any >a2 : number ->y9 : unknown +>y9 : any >b2 : string >{ x9: 5, y9: "hello" } : { x9: number; y9: string; } >x9 : number +>5 : number >y9 : string +>"hello" : string diff --git a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.symbols b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.symbols new file mode 100644 index 00000000000..76440b60038 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.symbols @@ -0,0 +1,44 @@ +=== tests/cases/compiler/declarationEmitDestructuringObjectLiteralPattern2.ts === + +var { a: x11, b: { a: y11, b: { a: z11 }}} = { a: 1, b: { a: "hello", b: { a: true } } }; +>x11 : Symbol(x11, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 1, 5)) +>y11 : Symbol(y11, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 1, 18)) +>z11 : Symbol(z11, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 1, 31)) +>a : Symbol(a, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 1, 46)) +>b : Symbol(b, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 1, 52)) +>a : Symbol(a, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 1, 57)) +>b : Symbol(b, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 1, 69)) +>a : Symbol(a, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 1, 74)) + +function f15() { +>f15 : Symbol(f15, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 1, 89)) + + var a4 = "hello"; +>a4 : Symbol(a4, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 4, 7)) + + var b4 = 1; +>b4 : Symbol(b4, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 5, 7)) + + var c4 = true; +>c4 : Symbol(c4, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 6, 7)) + + return { a4, b4, c4 }; +>a4 : Symbol(a4, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 7, 12)) +>b4 : Symbol(b4, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 7, 16)) +>c4 : Symbol(c4, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 7, 20)) +} +var { a4, b4, c4 } = f15(); +>a4 : Symbol(a4, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 9, 5)) +>b4 : Symbol(b4, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 9, 9)) +>c4 : Symbol(c4, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 9, 13)) +>f15 : Symbol(f15, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 1, 89)) + +module m { +>m : Symbol(m, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 9, 27)) + + export var { a4, b4, c4 } = f15(); +>a4 : Symbol(a4, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 12, 16)) +>b4 : Symbol(b4, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 12, 20)) +>c4 : Symbol(c4, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 12, 24)) +>f15 : Symbol(f15, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 1, 89)) +} diff --git a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.types b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.types index 68394686e31..49d4e2e837c 100644 --- a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.types +++ b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.types @@ -1,34 +1,40 @@ === tests/cases/compiler/declarationEmitDestructuringObjectLiteralPattern2.ts === var { a: x11, b: { a: y11, b: { a: z11 }}} = { a: 1, b: { a: "hello", b: { a: true } } }; ->a : unknown +>a : any >x11 : number ->b : unknown ->a : unknown +>b : any +>a : any >y11 : string ->b : unknown ->a : unknown +>b : any +>a : any >z11 : boolean >{ a: 1, b: { a: "hello", b: { a: true } } } : { a: number; b: { a: string; b: { a: boolean; }; }; } >a : number +>1 : number >b : { a: string; b: { a: boolean; }; } >{ a: "hello", b: { a: true } } : { a: string; b: { a: boolean; }; } >a : string +>"hello" : string >b : { a: boolean; } >{ a: true } : { a: boolean; } >a : boolean +>true : boolean function f15() { >f15 : () => { a4: string; b4: number; c4: boolean; } var a4 = "hello"; >a4 : string +>"hello" : string var b4 = 1; >b4 : number +>1 : number var c4 = true; >c4 : boolean +>true : boolean return { a4, b4, c4 }; >{ a4, b4, c4 } : { a4: string; b4: number; c4: boolean; } diff --git a/tests/baselines/reference/declarationEmitDestructuringOptionalBindingParametersInOverloads.symbols b/tests/baselines/reference/declarationEmitDestructuringOptionalBindingParametersInOverloads.symbols new file mode 100644 index 00000000000..fbe26452476 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringOptionalBindingParametersInOverloads.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/declarationEmitDestructuringOptionalBindingParametersInOverloads.ts === + +function foo([x, y, z] ?: [string, number, boolean]); +>foo : Symbol(foo, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 0, 0), Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 1, 53)) +>x : Symbol(x, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 1, 14)) +>y : Symbol(y, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 1, 16)) +>z : Symbol(z, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 1, 19)) + +function foo(...rest: any[]) { +>foo : Symbol(foo, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 0, 0), Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 1, 53)) +>rest : Symbol(rest, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 2, 13)) +} + +function foo2( { x, y, z }?: { x: string; y: number; z: boolean }); +>foo2 : Symbol(foo2, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 3, 1), Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 5, 67)) +>x : Symbol(x, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 5, 16)) +>y : Symbol(y, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 5, 19)) +>z : Symbol(z, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 5, 22)) +>x : Symbol(x, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 5, 30)) +>y : Symbol(y, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 5, 41)) +>z : Symbol(z, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 5, 52)) + +function foo2(...rest: any[]) { +>foo2 : Symbol(foo2, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 3, 1), Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 5, 67)) +>rest : Symbol(rest, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 6, 14)) + +} diff --git a/tests/baselines/reference/declarationEmitImportInExportAssignmentModule.symbols b/tests/baselines/reference/declarationEmitImportInExportAssignmentModule.symbols new file mode 100644 index 00000000000..c4c92d547f3 --- /dev/null +++ b/tests/baselines/reference/declarationEmitImportInExportAssignmentModule.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/declarationEmitImportInExportAssignmentModule.ts === + +module m { +>m : Symbol(m, Decl(declarationEmitImportInExportAssignmentModule.ts, 0, 0)) + + export module c { +>c : Symbol(x, Decl(declarationEmitImportInExportAssignmentModule.ts, 1, 10)) + + export class c { +>c : Symbol(c, Decl(declarationEmitImportInExportAssignmentModule.ts, 2, 21)) + } + } + import x = c; +>x : Symbol(x, Decl(declarationEmitImportInExportAssignmentModule.ts, 5, 5)) +>c : Symbol(x, Decl(declarationEmitImportInExportAssignmentModule.ts, 1, 10)) + + export var a: typeof x; +>a : Symbol(a, Decl(declarationEmitImportInExportAssignmentModule.ts, 7, 14)) +>x : Symbol(x, Decl(declarationEmitImportInExportAssignmentModule.ts, 5, 5)) +} +export = m; +>m : Symbol(m, Decl(declarationEmitImportInExportAssignmentModule.ts, 0, 0)) + diff --git a/tests/baselines/reference/declarationEmit_array-types-from-generic-array-usage.symbols b/tests/baselines/reference/declarationEmit_array-types-from-generic-array-usage.symbols new file mode 100644 index 00000000000..4f79e47277b --- /dev/null +++ b/tests/baselines/reference/declarationEmit_array-types-from-generic-array-usage.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/declarationEmit_array-types-from-generic-array-usage.ts === +interface A extends Array { } +>A : Symbol(A, Decl(declarationEmit_array-types-from-generic-array-usage.ts, 0, 0)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + diff --git a/tests/baselines/reference/declarationEmit_invalidReference.symbols b/tests/baselines/reference/declarationEmit_invalidReference.symbols new file mode 100644 index 00000000000..b23bf697661 --- /dev/null +++ b/tests/baselines/reference/declarationEmit_invalidReference.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/declarationEmit_invalidReference.ts === +/// +var x = 0; +>x : Symbol(x, Decl(declarationEmit_invalidReference.ts, 1, 3)) + diff --git a/tests/baselines/reference/declarationEmit_invalidReference.types b/tests/baselines/reference/declarationEmit_invalidReference.types index 1fe465887ed..35d623c3c05 100644 --- a/tests/baselines/reference/declarationEmit_invalidReference.types +++ b/tests/baselines/reference/declarationEmit_invalidReference.types @@ -2,4 +2,5 @@ /// var x = 0; >x : number +>0 : number diff --git a/tests/baselines/reference/declarationEmit_nameConflicts.symbols b/tests/baselines/reference/declarationEmit_nameConflicts.symbols new file mode 100644 index 00000000000..a626ed05b15 --- /dev/null +++ b/tests/baselines/reference/declarationEmit_nameConflicts.symbols @@ -0,0 +1,153 @@ +=== tests/cases/compiler/declarationEmit_nameConflicts_0.ts === +import im = require('declarationEmit_nameConflicts_1'); +>im : Symbol(im, Decl(declarationEmit_nameConflicts_0.ts, 0, 0)) + +export module M { +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) + + export function f() { } +>f : Symbol(f, Decl(declarationEmit_nameConflicts_0.ts, 1, 17)) + + export class C { } +>C : Symbol(C, Decl(declarationEmit_nameConflicts_0.ts, 2, 27)) + + export module N { +>N : Symbol(N, Decl(declarationEmit_nameConflicts_0.ts, 3, 22)) + + export function g() { }; +>g : Symbol(g, Decl(declarationEmit_nameConflicts_0.ts, 4, 21)) + + export interface I { } +>I : Symbol(I, Decl(declarationEmit_nameConflicts_0.ts, 5, 32)) + } + + export import a = M.f; +>a : Symbol(a, Decl(declarationEmit_nameConflicts_0.ts, 7, 5)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) +>f : Symbol(f, Decl(declarationEmit_nameConflicts_0.ts, 1, 17)) + + export import b = M.C; +>b : Symbol(b, Decl(declarationEmit_nameConflicts_0.ts, 9, 26)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) +>C : Symbol(C, Decl(declarationEmit_nameConflicts_0.ts, 2, 27)) + + export import c = N; +>c : Symbol(c, Decl(declarationEmit_nameConflicts_0.ts, 10, 26)) +>N : Symbol(N, Decl(declarationEmit_nameConflicts_0.ts, 3, 22)) + + export import d = im; +>d : Symbol(d, Decl(declarationEmit_nameConflicts_0.ts, 11, 24)) +>im : Symbol(d, Decl(declarationEmit_nameConflicts_1.ts, 0, 0)) +} + +export module M.P { +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) +>P : Symbol(P, Decl(declarationEmit_nameConflicts_0.ts, 15, 16)) + + export function f() { } +>f : Symbol(f, Decl(declarationEmit_nameConflicts_0.ts, 15, 19)) + + export class C { } +>C : Symbol(C, Decl(declarationEmit_nameConflicts_0.ts, 16, 27)) + + export module N { +>N : Symbol(N, Decl(declarationEmit_nameConflicts_0.ts, 17, 22)) + + export function g() { }; +>g : Symbol(g, Decl(declarationEmit_nameConflicts_0.ts, 18, 21)) + + export interface I { } +>I : Symbol(I, Decl(declarationEmit_nameConflicts_0.ts, 19, 32)) + } + export import im = M.P.f; +>im : Symbol(im, Decl(declarationEmit_nameConflicts_0.ts, 21, 5)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) +>P : Symbol(P, Decl(declarationEmit_nameConflicts_0.ts, 15, 16)) +>f : Symbol(f, Decl(declarationEmit_nameConflicts_0.ts, 15, 19)) + + export var a = M.a; // emitted incorrectly as typeof f +>a : Symbol(a, Decl(declarationEmit_nameConflicts_0.ts, 23, 14)) +>M.a : Symbol(a, Decl(declarationEmit_nameConflicts_0.ts, 7, 5)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) +>a : Symbol(a, Decl(declarationEmit_nameConflicts_0.ts, 7, 5)) + + export var b = M.b; // ok +>b : Symbol(b, Decl(declarationEmit_nameConflicts_0.ts, 24, 14)) +>M.b : Symbol(b, Decl(declarationEmit_nameConflicts_0.ts, 9, 26)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) +>b : Symbol(b, Decl(declarationEmit_nameConflicts_0.ts, 9, 26)) + + export var c = M.c; // ok +>c : Symbol(c, Decl(declarationEmit_nameConflicts_0.ts, 25, 14)) +>M.c : Symbol(c, Decl(declarationEmit_nameConflicts_0.ts, 10, 26)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) +>c : Symbol(c, Decl(declarationEmit_nameConflicts_0.ts, 10, 26)) + + export var g = M.c.g; // ok +>g : Symbol(g, Decl(declarationEmit_nameConflicts_0.ts, 26, 14)) +>M.c.g : Symbol(c.g, Decl(declarationEmit_nameConflicts_0.ts, 4, 21)) +>M.c : Symbol(c, Decl(declarationEmit_nameConflicts_0.ts, 10, 26)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) +>c : Symbol(c, Decl(declarationEmit_nameConflicts_0.ts, 10, 26)) +>g : Symbol(c.g, Decl(declarationEmit_nameConflicts_0.ts, 4, 21)) + + export var d = M.d; // emitted incorrectly as typeof im +>d : Symbol(d, Decl(declarationEmit_nameConflicts_0.ts, 27, 14)) +>M.d : Symbol(d, Decl(declarationEmit_nameConflicts_0.ts, 11, 24)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) +>d : Symbol(d, Decl(declarationEmit_nameConflicts_0.ts, 11, 24)) +} + +export module M.Q { +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) +>Q : Symbol(Q, Decl(declarationEmit_nameConflicts_0.ts, 30, 16)) + + export function f() { } +>f : Symbol(f, Decl(declarationEmit_nameConflicts_0.ts, 30, 19)) + + export class C { } +>C : Symbol(C, Decl(declarationEmit_nameConflicts_0.ts, 31, 27)) + + export module N { +>N : Symbol(N, Decl(declarationEmit_nameConflicts_0.ts, 32, 22)) + + export function g() { }; +>g : Symbol(g, Decl(declarationEmit_nameConflicts_0.ts, 33, 21)) + + export interface I { } +>I : Symbol(I, Decl(declarationEmit_nameConflicts_0.ts, 34, 32)) + } + export interface b extends M.b { } // ok +>b : Symbol(b, Decl(declarationEmit_nameConflicts_0.ts, 36, 5)) +>M.b : Symbol(b, Decl(declarationEmit_nameConflicts_0.ts, 9, 26)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) +>b : Symbol(b, Decl(declarationEmit_nameConflicts_0.ts, 9, 26)) + + export interface I extends M.c.I { } // ok +>I : Symbol(I, Decl(declarationEmit_nameConflicts_0.ts, 37, 38)) +>M.c.I : Symbol(M.c.I, Decl(declarationEmit_nameConflicts_0.ts, 5, 32)) +>M.c : Symbol(c, Decl(declarationEmit_nameConflicts_0.ts, 10, 26)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) +>c : Symbol(c, Decl(declarationEmit_nameConflicts_0.ts, 10, 26)) +>I : Symbol(M.c.I, Decl(declarationEmit_nameConflicts_0.ts, 5, 32)) + + export module c { +>c : Symbol(c, Decl(declarationEmit_nameConflicts_0.ts, 38, 40)) + + export interface I extends M.c.I { } // ok +>I : Symbol(I, Decl(declarationEmit_nameConflicts_0.ts, 39, 21)) +>M.c.I : Symbol(M.c.I, Decl(declarationEmit_nameConflicts_0.ts, 5, 32)) +>M.c : Symbol(c, Decl(declarationEmit_nameConflicts_0.ts, 10, 26)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) +>c : Symbol(c, Decl(declarationEmit_nameConflicts_0.ts, 10, 26)) +>I : Symbol(M.c.I, Decl(declarationEmit_nameConflicts_0.ts, 5, 32)) + } +} +=== tests/cases/compiler/declarationEmit_nameConflicts_1.ts === +module f { export class c { } } +>f : Symbol(f, Decl(declarationEmit_nameConflicts_1.ts, 0, 0)) +>c : Symbol(c, Decl(declarationEmit_nameConflicts_1.ts, 0, 10)) + +export = f; +>f : Symbol(f, Decl(declarationEmit_nameConflicts_1.ts, 0, 0)) + diff --git a/tests/baselines/reference/declarationEmit_nameConflicts.types b/tests/baselines/reference/declarationEmit_nameConflicts.types index e38c831493d..dacd657706d 100644 --- a/tests/baselines/reference/declarationEmit_nameConflicts.types +++ b/tests/baselines/reference/declarationEmit_nameConflicts.types @@ -119,20 +119,25 @@ export module M.Q { } export interface b extends M.b { } // ok >b : b +>M.b : any >M : typeof M >b : M.C export interface I extends M.c.I { } // ok >I : I +>M.c.I : any +>M.c : typeof M.N >M : typeof M >c : typeof M.N >I : M.c.I export module c { ->c : unknown +>c : any export interface I extends M.c.I { } // ok >I : I +>M.c.I : any +>M.c : typeof M.N >M : typeof M >c : typeof M.N >I : M.c.I diff --git a/tests/baselines/reference/declarationEmit_nameConflicts2.symbols b/tests/baselines/reference/declarationEmit_nameConflicts2.symbols new file mode 100644 index 00000000000..801ad3e7cfc --- /dev/null +++ b/tests/baselines/reference/declarationEmit_nameConflicts2.symbols @@ -0,0 +1,68 @@ +=== tests/cases/compiler/declarationEmit_nameConflicts2.ts === +module X.Y.base { +>X : Symbol(X, Decl(declarationEmit_nameConflicts2.ts, 0, 0), Decl(declarationEmit_nameConflicts2.ts, 7, 1)) +>Y : Symbol(Y, Decl(declarationEmit_nameConflicts2.ts, 0, 9), Decl(declarationEmit_nameConflicts2.ts, 9, 9)) +>base : Symbol(base, Decl(declarationEmit_nameConflicts2.ts, 0, 11), Decl(declarationEmit_nameConflicts2.ts, 9, 11)) + + export function f() { } +>f : Symbol(f, Decl(declarationEmit_nameConflicts2.ts, 0, 17)) + + export class C { } +>C : Symbol(C, Decl(declarationEmit_nameConflicts2.ts, 1, 27)) + + export module M { +>M : Symbol(M, Decl(declarationEmit_nameConflicts2.ts, 2, 22)) + + export var v; +>v : Symbol(v, Decl(declarationEmit_nameConflicts2.ts, 4, 18)) + } + export enum E { } +>E : Symbol(E, Decl(declarationEmit_nameConflicts2.ts, 5, 5)) +} + +module X.Y.base.Z { +>X : Symbol(X, Decl(declarationEmit_nameConflicts2.ts, 0, 0), Decl(declarationEmit_nameConflicts2.ts, 7, 1)) +>Y : Symbol(Y, Decl(declarationEmit_nameConflicts2.ts, 0, 9), Decl(declarationEmit_nameConflicts2.ts, 9, 9)) +>base : Symbol(base, Decl(declarationEmit_nameConflicts2.ts, 0, 11), Decl(declarationEmit_nameConflicts2.ts, 9, 11)) +>Z : Symbol(Z, Decl(declarationEmit_nameConflicts2.ts, 9, 16)) + + export var f = X.Y.base.f; // Should be base.f +>f : Symbol(f, Decl(declarationEmit_nameConflicts2.ts, 10, 14)) +>X.Y.base.f : Symbol(f, Decl(declarationEmit_nameConflicts2.ts, 0, 17)) +>X.Y.base : Symbol(base, Decl(declarationEmit_nameConflicts2.ts, 0, 11), Decl(declarationEmit_nameConflicts2.ts, 9, 11)) +>X.Y : Symbol(Y, Decl(declarationEmit_nameConflicts2.ts, 0, 9), Decl(declarationEmit_nameConflicts2.ts, 9, 9)) +>X : Symbol(X, Decl(declarationEmit_nameConflicts2.ts, 0, 0), Decl(declarationEmit_nameConflicts2.ts, 7, 1)) +>Y : Symbol(Y, Decl(declarationEmit_nameConflicts2.ts, 0, 9), Decl(declarationEmit_nameConflicts2.ts, 9, 9)) +>base : Symbol(base, Decl(declarationEmit_nameConflicts2.ts, 0, 11), Decl(declarationEmit_nameConflicts2.ts, 9, 11)) +>f : Symbol(f, Decl(declarationEmit_nameConflicts2.ts, 0, 17)) + + export var C = X.Y.base.C; // Should be base.C +>C : Symbol(C, Decl(declarationEmit_nameConflicts2.ts, 11, 14)) +>X.Y.base.C : Symbol(C, Decl(declarationEmit_nameConflicts2.ts, 1, 27)) +>X.Y.base : Symbol(base, Decl(declarationEmit_nameConflicts2.ts, 0, 11), Decl(declarationEmit_nameConflicts2.ts, 9, 11)) +>X.Y : Symbol(Y, Decl(declarationEmit_nameConflicts2.ts, 0, 9), Decl(declarationEmit_nameConflicts2.ts, 9, 9)) +>X : Symbol(X, Decl(declarationEmit_nameConflicts2.ts, 0, 0), Decl(declarationEmit_nameConflicts2.ts, 7, 1)) +>Y : Symbol(Y, Decl(declarationEmit_nameConflicts2.ts, 0, 9), Decl(declarationEmit_nameConflicts2.ts, 9, 9)) +>base : Symbol(base, Decl(declarationEmit_nameConflicts2.ts, 0, 11), Decl(declarationEmit_nameConflicts2.ts, 9, 11)) +>C : Symbol(C, Decl(declarationEmit_nameConflicts2.ts, 1, 27)) + + export var M = X.Y.base.M; // Should be base.M +>M : Symbol(M, Decl(declarationEmit_nameConflicts2.ts, 12, 14)) +>X.Y.base.M : Symbol(M, Decl(declarationEmit_nameConflicts2.ts, 2, 22)) +>X.Y.base : Symbol(base, Decl(declarationEmit_nameConflicts2.ts, 0, 11), Decl(declarationEmit_nameConflicts2.ts, 9, 11)) +>X.Y : Symbol(Y, Decl(declarationEmit_nameConflicts2.ts, 0, 9), Decl(declarationEmit_nameConflicts2.ts, 9, 9)) +>X : Symbol(X, Decl(declarationEmit_nameConflicts2.ts, 0, 0), Decl(declarationEmit_nameConflicts2.ts, 7, 1)) +>Y : Symbol(Y, Decl(declarationEmit_nameConflicts2.ts, 0, 9), Decl(declarationEmit_nameConflicts2.ts, 9, 9)) +>base : Symbol(base, Decl(declarationEmit_nameConflicts2.ts, 0, 11), Decl(declarationEmit_nameConflicts2.ts, 9, 11)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts2.ts, 2, 22)) + + export var E = X.Y.base.E; // Should be base.E +>E : Symbol(E, Decl(declarationEmit_nameConflicts2.ts, 13, 14)) +>X.Y.base.E : Symbol(E, Decl(declarationEmit_nameConflicts2.ts, 5, 5)) +>X.Y.base : Symbol(base, Decl(declarationEmit_nameConflicts2.ts, 0, 11), Decl(declarationEmit_nameConflicts2.ts, 9, 11)) +>X.Y : Symbol(Y, Decl(declarationEmit_nameConflicts2.ts, 0, 9), Decl(declarationEmit_nameConflicts2.ts, 9, 9)) +>X : Symbol(X, Decl(declarationEmit_nameConflicts2.ts, 0, 0), Decl(declarationEmit_nameConflicts2.ts, 7, 1)) +>Y : Symbol(Y, Decl(declarationEmit_nameConflicts2.ts, 0, 9), Decl(declarationEmit_nameConflicts2.ts, 9, 9)) +>base : Symbol(base, Decl(declarationEmit_nameConflicts2.ts, 0, 11), Decl(declarationEmit_nameConflicts2.ts, 9, 11)) +>E : Symbol(E, Decl(declarationEmit_nameConflicts2.ts, 5, 5)) +} diff --git a/tests/baselines/reference/declarationEmit_nameConflicts3.symbols b/tests/baselines/reference/declarationEmit_nameConflicts3.symbols new file mode 100644 index 00000000000..051ffe59365 --- /dev/null +++ b/tests/baselines/reference/declarationEmit_nameConflicts3.symbols @@ -0,0 +1,76 @@ +=== tests/cases/compiler/declarationEmit_nameConflicts3.ts === +module M { +>M : Symbol(M, Decl(declarationEmit_nameConflicts3.ts, 0, 0), Decl(declarationEmit_nameConflicts3.ts, 11, 1)) + + export interface D { } +>D : Symbol(D, Decl(declarationEmit_nameConflicts3.ts, 0, 10), Decl(declarationEmit_nameConflicts3.ts, 1, 26)) + + export module D { +>D : Symbol(D, Decl(declarationEmit_nameConflicts3.ts, 0, 10), Decl(declarationEmit_nameConflicts3.ts, 1, 26)) + + export function f() { } +>f : Symbol(f, Decl(declarationEmit_nameConflicts3.ts, 2, 21)) + } + export module C { +>C : Symbol(C, Decl(declarationEmit_nameConflicts3.ts, 4, 5)) + + export function f() { } +>f : Symbol(f, Decl(declarationEmit_nameConflicts3.ts, 5, 21)) + } + export module E { +>E : Symbol(E, Decl(declarationEmit_nameConflicts3.ts, 7, 5)) + + export function f() { } +>f : Symbol(f, Decl(declarationEmit_nameConflicts3.ts, 8, 21)) + } +} + +module M.P { +>M : Symbol(M, Decl(declarationEmit_nameConflicts3.ts, 0, 0), Decl(declarationEmit_nameConflicts3.ts, 11, 1)) +>P : Symbol(P, Decl(declarationEmit_nameConflicts3.ts, 13, 9)) + + export class C { +>C : Symbol(C, Decl(declarationEmit_nameConflicts3.ts, 13, 12)) + + static f() { } +>f : Symbol(C.f, Decl(declarationEmit_nameConflicts3.ts, 14, 20)) + } + export class E extends C { } +>E : Symbol(E, Decl(declarationEmit_nameConflicts3.ts, 16, 5)) +>C : Symbol(C, Decl(declarationEmit_nameConflicts3.ts, 13, 12)) + + export enum D { +>D : Symbol(D, Decl(declarationEmit_nameConflicts3.ts, 17, 32)) + + f +>f : Symbol(D.f, Decl(declarationEmit_nameConflicts3.ts, 18, 19)) + } + export var v: M.D; // ok +>v : Symbol(v, Decl(declarationEmit_nameConflicts3.ts, 21, 14)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts3.ts, 0, 0), Decl(declarationEmit_nameConflicts3.ts, 11, 1)) +>D : Symbol(D, Decl(declarationEmit_nameConflicts3.ts, 0, 10), Decl(declarationEmit_nameConflicts3.ts, 1, 26)) + + export var w = M.D.f; // error, should be typeof M.D.f +>w : Symbol(w, Decl(declarationEmit_nameConflicts3.ts, 22, 14)) +>M.D.f : Symbol(D.f, Decl(declarationEmit_nameConflicts3.ts, 2, 21)) +>M.D : Symbol(D, Decl(declarationEmit_nameConflicts3.ts, 0, 10), Decl(declarationEmit_nameConflicts3.ts, 1, 26)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts3.ts, 0, 0), Decl(declarationEmit_nameConflicts3.ts, 11, 1)) +>D : Symbol(D, Decl(declarationEmit_nameConflicts3.ts, 0, 10), Decl(declarationEmit_nameConflicts3.ts, 1, 26)) +>f : Symbol(D.f, Decl(declarationEmit_nameConflicts3.ts, 2, 21)) + + export var x = M.C.f; // error, should be typeof M.C.f +>x : Symbol(x, Decl(declarationEmit_nameConflicts3.ts, 23, 14), Decl(declarationEmit_nameConflicts3.ts, 24, 14)) +>M.C.f : Symbol(C.f, Decl(declarationEmit_nameConflicts3.ts, 5, 21)) +>M.C : Symbol(C, Decl(declarationEmit_nameConflicts3.ts, 4, 5)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts3.ts, 0, 0), Decl(declarationEmit_nameConflicts3.ts, 11, 1)) +>C : Symbol(C, Decl(declarationEmit_nameConflicts3.ts, 4, 5)) +>f : Symbol(C.f, Decl(declarationEmit_nameConflicts3.ts, 5, 21)) + + export var x = M.E.f; // error, should be typeof M.E.f +>x : Symbol(x, Decl(declarationEmit_nameConflicts3.ts, 23, 14), Decl(declarationEmit_nameConflicts3.ts, 24, 14)) +>M.E.f : Symbol(E.f, Decl(declarationEmit_nameConflicts3.ts, 8, 21)) +>M.E : Symbol(E, Decl(declarationEmit_nameConflicts3.ts, 7, 5)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts3.ts, 0, 0), Decl(declarationEmit_nameConflicts3.ts, 11, 1)) +>E : Symbol(E, Decl(declarationEmit_nameConflicts3.ts, 7, 5)) +>f : Symbol(E.f, Decl(declarationEmit_nameConflicts3.ts, 8, 21)) +} diff --git a/tests/baselines/reference/declarationEmit_nameConflicts3.types b/tests/baselines/reference/declarationEmit_nameConflicts3.types index 50fd6ecdd1b..8d52bda68f5 100644 --- a/tests/baselines/reference/declarationEmit_nameConflicts3.types +++ b/tests/baselines/reference/declarationEmit_nameConflicts3.types @@ -47,7 +47,7 @@ module M.P { } export var v: M.D; // ok >v : M.D ->M : unknown +>M : any >D : M.D export var w = M.D.f; // error, should be typeof M.D.f diff --git a/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.symbols b/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.symbols new file mode 100644 index 00000000000..26c8875a236 --- /dev/null +++ b/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/declarationEmit_nameConflictsWithAlias.ts === +export module C { export interface I { } } +>C : Symbol(C, Decl(declarationEmit_nameConflictsWithAlias.ts, 0, 0)) +>I : Symbol(I, Decl(declarationEmit_nameConflictsWithAlias.ts, 0, 17)) + +export import v = C; +>v : Symbol(v, Decl(declarationEmit_nameConflictsWithAlias.ts, 0, 42)) +>C : Symbol(C, Decl(declarationEmit_nameConflictsWithAlias.ts, 0, 0)) + +export module M { +>M : Symbol(M, Decl(declarationEmit_nameConflictsWithAlias.ts, 1, 20)) + + export module C { export interface I { } } +>C : Symbol(C, Decl(declarationEmit_nameConflictsWithAlias.ts, 2, 17)) +>I : Symbol(I, Decl(declarationEmit_nameConflictsWithAlias.ts, 3, 21)) + + export var w: v.I; // Gets emitted as C.I, which is the wrong interface +>w : Symbol(w, Decl(declarationEmit_nameConflictsWithAlias.ts, 4, 14)) +>v : Symbol(v, Decl(declarationEmit_nameConflictsWithAlias.ts, 0, 42)) +>I : Symbol(v.I, Decl(declarationEmit_nameConflictsWithAlias.ts, 0, 17)) +} diff --git a/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.types b/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.types index 50c45a44a19..744869f0e3a 100644 --- a/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.types +++ b/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.types @@ -1,21 +1,21 @@ === tests/cases/compiler/declarationEmit_nameConflictsWithAlias.ts === export module C { export interface I { } } ->C : unknown +>C : any >I : I export import v = C; ->v : unknown ->C : unknown +>v : any +>C : any export module M { >M : typeof M export module C { export interface I { } } ->C : unknown +>C : any >I : I export var w: v.I; // Gets emitted as C.I, which is the wrong interface >w : v.I ->v : unknown +>v : any >I : v.I } diff --git a/tests/baselines/reference/declarationEmit_protectedMembers.symbols b/tests/baselines/reference/declarationEmit_protectedMembers.symbols new file mode 100644 index 00000000000..cbf3db094ea --- /dev/null +++ b/tests/baselines/reference/declarationEmit_protectedMembers.symbols @@ -0,0 +1,114 @@ +=== tests/cases/compiler/declarationEmit_protectedMembers.ts === + +// Class with protected members +class C1 { +>C1 : Symbol(C1, Decl(declarationEmit_protectedMembers.ts, 0, 0)) + + protected x: number; +>x : Symbol(x, Decl(declarationEmit_protectedMembers.ts, 2, 10)) + + protected f() { +>f : Symbol(f, Decl(declarationEmit_protectedMembers.ts, 3, 24)) + + return this.x; +>this.x : Symbol(x, Decl(declarationEmit_protectedMembers.ts, 2, 10)) +>this : Symbol(C1, Decl(declarationEmit_protectedMembers.ts, 0, 0)) +>x : Symbol(x, Decl(declarationEmit_protectedMembers.ts, 2, 10)) + } + + protected set accessor(a: number) { } +>accessor : Symbol(accessor, Decl(declarationEmit_protectedMembers.ts, 7, 5), Decl(declarationEmit_protectedMembers.ts, 9, 41)) +>a : Symbol(a, Decl(declarationEmit_protectedMembers.ts, 9, 27)) + + protected get accessor() { return 0; } +>accessor : Symbol(accessor, Decl(declarationEmit_protectedMembers.ts, 7, 5), Decl(declarationEmit_protectedMembers.ts, 9, 41)) + + protected static sx: number; +>sx : Symbol(C1.sx, Decl(declarationEmit_protectedMembers.ts, 10, 42)) + + protected static sf() { +>sf : Symbol(C1.sf, Decl(declarationEmit_protectedMembers.ts, 12, 32)) + + return this.sx; +>this.sx : Symbol(C1.sx, Decl(declarationEmit_protectedMembers.ts, 10, 42)) +>this : Symbol(C1, Decl(declarationEmit_protectedMembers.ts, 0, 0)) +>sx : Symbol(C1.sx, Decl(declarationEmit_protectedMembers.ts, 10, 42)) + } + + protected static set staticSetter(a: number) { } +>staticSetter : Symbol(C1.staticSetter, Decl(declarationEmit_protectedMembers.ts, 16, 5)) +>a : Symbol(a, Decl(declarationEmit_protectedMembers.ts, 18, 38)) + + protected static get staticGetter() { return 0; } +>staticGetter : Symbol(C1.staticGetter, Decl(declarationEmit_protectedMembers.ts, 18, 52)) +} + +// Derived class overriding protected members +class C2 extends C1 { +>C2 : Symbol(C2, Decl(declarationEmit_protectedMembers.ts, 20, 1)) +>C1 : Symbol(C1, Decl(declarationEmit_protectedMembers.ts, 0, 0)) + + protected f() { +>f : Symbol(f, Decl(declarationEmit_protectedMembers.ts, 23, 21)) + + return super.f() + this.x; +>super.f : Symbol(C1.f, Decl(declarationEmit_protectedMembers.ts, 3, 24)) +>super : Symbol(C1, Decl(declarationEmit_protectedMembers.ts, 0, 0)) +>f : Symbol(C1.f, Decl(declarationEmit_protectedMembers.ts, 3, 24)) +>this.x : Symbol(C1.x, Decl(declarationEmit_protectedMembers.ts, 2, 10)) +>this : Symbol(C2, Decl(declarationEmit_protectedMembers.ts, 20, 1)) +>x : Symbol(C1.x, Decl(declarationEmit_protectedMembers.ts, 2, 10)) + } + protected static sf() { +>sf : Symbol(C2.sf, Decl(declarationEmit_protectedMembers.ts, 26, 5)) + + return super.sf() + this.sx; +>super.sf : Symbol(C1.sf, Decl(declarationEmit_protectedMembers.ts, 12, 32)) +>super : Symbol(C1, Decl(declarationEmit_protectedMembers.ts, 0, 0)) +>sf : Symbol(C1.sf, Decl(declarationEmit_protectedMembers.ts, 12, 32)) +>this.sx : Symbol(C1.sx, Decl(declarationEmit_protectedMembers.ts, 10, 42)) +>this : Symbol(C2, Decl(declarationEmit_protectedMembers.ts, 20, 1)) +>sx : Symbol(C1.sx, Decl(declarationEmit_protectedMembers.ts, 10, 42)) + } +} + +// Derived class making protected members public +class C3 extends C2 { +>C3 : Symbol(C3, Decl(declarationEmit_protectedMembers.ts, 30, 1)) +>C2 : Symbol(C2, Decl(declarationEmit_protectedMembers.ts, 20, 1)) + + x: number; +>x : Symbol(x, Decl(declarationEmit_protectedMembers.ts, 33, 21)) + + static sx: number; +>sx : Symbol(C3.sx, Decl(declarationEmit_protectedMembers.ts, 34, 14)) + + f() { +>f : Symbol(f, Decl(declarationEmit_protectedMembers.ts, 35, 22)) + + return super.f(); +>super.f : Symbol(C2.f, Decl(declarationEmit_protectedMembers.ts, 23, 21)) +>super : Symbol(C2, Decl(declarationEmit_protectedMembers.ts, 20, 1)) +>f : Symbol(C2.f, Decl(declarationEmit_protectedMembers.ts, 23, 21)) + } + static sf() { +>sf : Symbol(C3.sf, Decl(declarationEmit_protectedMembers.ts, 38, 5)) + + return super.sf(); +>super.sf : Symbol(C2.sf, Decl(declarationEmit_protectedMembers.ts, 26, 5)) +>super : Symbol(C2, Decl(declarationEmit_protectedMembers.ts, 20, 1)) +>sf : Symbol(C2.sf, Decl(declarationEmit_protectedMembers.ts, 26, 5)) + } + + static get staticGetter() { return 1; } +>staticGetter : Symbol(C3.staticGetter, Decl(declarationEmit_protectedMembers.ts, 41, 5)) +} + +// Protected properties in constructors +class C4 { +>C4 : Symbol(C4, Decl(declarationEmit_protectedMembers.ts, 44, 1)) + + constructor(protected a: number, protected b) { } +>a : Symbol(a, Decl(declarationEmit_protectedMembers.ts, 48, 16)) +>b : Symbol(b, Decl(declarationEmit_protectedMembers.ts, 48, 36)) +} diff --git a/tests/baselines/reference/declarationEmit_protectedMembers.types b/tests/baselines/reference/declarationEmit_protectedMembers.types index 28217b0c070..89aa3f56332 100644 --- a/tests/baselines/reference/declarationEmit_protectedMembers.types +++ b/tests/baselines/reference/declarationEmit_protectedMembers.types @@ -22,6 +22,7 @@ class C1 { protected get accessor() { return 0; } >accessor : number +>0 : number protected static sx: number; >sx : number @@ -41,6 +42,7 @@ class C1 { protected static get staticGetter() { return 0; } >staticGetter : number +>0 : number } // Derived class overriding protected members @@ -108,6 +110,7 @@ class C3 extends C2 { static get staticGetter() { return 1; } >staticGetter : number +>1 : number } // Protected properties in constructors diff --git a/tests/baselines/reference/declarationInAmbientContext.symbols b/tests/baselines/reference/declarationInAmbientContext.symbols new file mode 100644 index 00000000000..4ab3aad99bf --- /dev/null +++ b/tests/baselines/reference/declarationInAmbientContext.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/destructuring/declarationInAmbientContext.ts === +declare var [a, b]; // Error, destructuring declaration not allowed in ambient context +>a : Symbol(a, Decl(declarationInAmbientContext.ts, 0, 13)) +>b : Symbol(b, Decl(declarationInAmbientContext.ts, 0, 15)) + +declare var {c, d}; // Error, destructuring declaration not allowed in ambient context +>c : Symbol(c, Decl(declarationInAmbientContext.ts, 1, 13)) +>d : Symbol(d, Decl(declarationInAmbientContext.ts, 1, 15)) + diff --git a/tests/baselines/reference/declarationsAndAssignments.js b/tests/baselines/reference/declarationsAndAssignments.js index 032f4cb0e63..5c47756e7fe 100644 --- a/tests/baselines/reference/declarationsAndAssignments.js +++ b/tests/baselines/reference/declarationsAndAssignments.js @@ -183,7 +183,7 @@ function f21() { //// [declarationsAndAssignments.js] function f0() { var _a = [1, "hello"]; - var x = ([1, "hello"])[0]; + 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]; @@ -201,13 +201,13 @@ function f1() { } function f2() { var _a = { x: 5, y: "hello" }; - var x = ({ x: 5, y: "hello" }).x; - var y = ({ x: 5, y: "hello" }).y; + 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 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; @@ -312,7 +312,7 @@ function f19() { _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]; + _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; } @@ -321,28 +321,28 @@ 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 _e, _f, _g, _h; + var a = [1, 2, 3].slice(0); + var _a = [1, 2, 3], x = _a[0], a = _a.slice(1); + var _b = [1, 2, 3], x = _b[0], y = _b[1], a = _b.slice(2); + var _c = [1, 2, 3], x = _c[0], y = _c[1], z = _c[2], a = _c.slice(3); + a = [1, 2, 3].slice(0); + _d = [1, 2, 3], x = _d[0], a = _d.slice(1); + _e = [1, 2, 3], x = _e[0], y = _e[1], a = _e.slice(2); + _f = [1, 2, 3], x = _f[0], y = _f[1], z = _f[2], a = _f.slice(3); + var _d, _e, _f; } function f21() { var a; 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 _e, _f, _g, _h; + var a = [1, "hello", true].slice(0); + var _a = [1, "hello", true], x = _a[0], a = _a.slice(1); + var _b = [1, "hello", true], x = _b[0], y = _b[1], a = _b.slice(2); + var _c = [1, "hello", true], x = _c[0], y = _c[1], z = _c[2], a = _c.slice(3); + a = [1, "hello", true].slice(0); + _d = [1, "hello", true], x = _d[0], a = _d.slice(1); + _e = [1, "hello", true], x = _e[0], y = _e[1], a = _e.slice(2); + _f = [1, "hello", true], x = _f[0], y = _f[1], z = _f[2], a = _f.slice(3); + var _d, _e, _f; } diff --git a/tests/baselines/reference/declareDottedExtend.symbols b/tests/baselines/reference/declareDottedExtend.symbols new file mode 100644 index 00000000000..c9695ecb342 --- /dev/null +++ b/tests/baselines/reference/declareDottedExtend.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/declareDottedExtend.ts === +declare module A.B +>A : Symbol(A, Decl(declareDottedExtend.ts, 0, 0)) +>B : Symbol(B, Decl(declareDottedExtend.ts, 0, 17)) +{ + export class C{ } +>C : Symbol(C, Decl(declareDottedExtend.ts, 1, 1)) +} + +import ab = A.B; +>ab : Symbol(ab, Decl(declareDottedExtend.ts, 3, 1)) +>A : Symbol(A, Decl(declareDottedExtend.ts, 0, 0)) +>B : Symbol(ab, Decl(declareDottedExtend.ts, 0, 17)) + +class D extends ab.C{ } +>D : Symbol(D, Decl(declareDottedExtend.ts, 5, 16)) +>ab.C : Symbol(ab.C, Decl(declareDottedExtend.ts, 1, 1)) +>ab : Symbol(ab, Decl(declareDottedExtend.ts, 3, 1)) +>C : Symbol(ab.C, Decl(declareDottedExtend.ts, 1, 1)) + +class E extends A.B.C{ } +>E : Symbol(E, Decl(declareDottedExtend.ts, 7, 23)) +>A.B.C : Symbol(ab.C, Decl(declareDottedExtend.ts, 1, 1)) +>A.B : Symbol(ab, Decl(declareDottedExtend.ts, 0, 17)) +>A : Symbol(A, Decl(declareDottedExtend.ts, 0, 0)) +>B : Symbol(ab, Decl(declareDottedExtend.ts, 0, 17)) +>C : Symbol(ab.C, Decl(declareDottedExtend.ts, 1, 1)) + diff --git a/tests/baselines/reference/declareDottedExtend.types b/tests/baselines/reference/declareDottedExtend.types index 6b529b5e00d..7df6c9ecb7c 100644 --- a/tests/baselines/reference/declareDottedExtend.types +++ b/tests/baselines/reference/declareDottedExtend.types @@ -14,11 +14,14 @@ import ab = A.B; class D extends ab.C{ } >D : D +>ab.C : any >ab : typeof ab >C : ab.C class E extends A.B.C{ } >E : E +>A.B.C : any +>A.B : typeof ab >A : typeof A >B : typeof ab >C : ab.C diff --git a/tests/baselines/reference/declareDottedModuleName.symbols b/tests/baselines/reference/declareDottedModuleName.symbols new file mode 100644 index 00000000000..de69bc1dc8e --- /dev/null +++ b/tests/baselines/reference/declareDottedModuleName.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/declareDottedModuleName.ts === +module M { +>M : Symbol(M, Decl(declareDottedModuleName.ts, 0, 0), Decl(declareDottedModuleName.ts, 2, 1)) + + module P.Q { } // This shouldnt be emitted +>P : Symbol(P, Decl(declareDottedModuleName.ts, 0, 10)) +>Q : Symbol(Q, Decl(declareDottedModuleName.ts, 1, 13)) +} + +module M { +>M : Symbol(M, Decl(declareDottedModuleName.ts, 0, 0), Decl(declareDottedModuleName.ts, 2, 1)) + + export module R.S { } //This should be emitted +>R : Symbol(R, Decl(declareDottedModuleName.ts, 4, 10)) +>S : Symbol(S, Decl(declareDottedModuleName.ts, 5, 20)) +} + +module T.U { // This needs to be emitted +>T : Symbol(T, Decl(declareDottedModuleName.ts, 6, 1)) +>U : Symbol(U, Decl(declareDottedModuleName.ts, 8, 9)) +} diff --git a/tests/baselines/reference/declareDottedModuleName.types b/tests/baselines/reference/declareDottedModuleName.types index 8ccd2298847..54786f9e747 100644 --- a/tests/baselines/reference/declareDottedModuleName.types +++ b/tests/baselines/reference/declareDottedModuleName.types @@ -1,21 +1,21 @@ === tests/cases/compiler/declareDottedModuleName.ts === module M { ->M : unknown +>M : any module P.Q { } // This shouldnt be emitted ->P : unknown ->Q : unknown +>P : any +>Q : any } module M { ->M : unknown +>M : any export module R.S { } //This should be emitted ->R : unknown ->S : unknown +>R : any +>S : any } module T.U { // This needs to be emitted ->T : unknown ->U : unknown +>T : any +>U : any } diff --git a/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.symbols b/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.symbols new file mode 100644 index 00000000000..881728ce641 --- /dev/null +++ b/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.symbols @@ -0,0 +1,41 @@ +=== tests/cases/compiler/declareExternalModuleWithExportAssignedFundule.ts === +declare module "express" { + + export = express; +>express : Symbol(express, Decl(declareExternalModuleWithExportAssignedFundule.ts, 2, 21), Decl(declareExternalModuleWithExportAssignedFundule.ts, 4, 46)) + + function express(): express.ExpressServer; +>express : Symbol(express, Decl(declareExternalModuleWithExportAssignedFundule.ts, 2, 21), Decl(declareExternalModuleWithExportAssignedFundule.ts, 4, 46)) +>express : Symbol(express, Decl(declareExternalModuleWithExportAssignedFundule.ts, 2, 21), Decl(declareExternalModuleWithExportAssignedFundule.ts, 4, 46)) +>ExpressServer : Symbol(express.ExpressServer, Decl(declareExternalModuleWithExportAssignedFundule.ts, 6, 20)) + + module express { +>express : Symbol(express, Decl(declareExternalModuleWithExportAssignedFundule.ts, 2, 21), Decl(declareExternalModuleWithExportAssignedFundule.ts, 4, 46)) + + export interface ExpressServer { +>ExpressServer : Symbol(ExpressServer, Decl(declareExternalModuleWithExportAssignedFundule.ts, 6, 20)) + + enable(name: string): ExpressServer; +>enable : Symbol(enable, Decl(declareExternalModuleWithExportAssignedFundule.ts, 8, 40)) +>name : Symbol(name, Decl(declareExternalModuleWithExportAssignedFundule.ts, 10, 19)) +>ExpressServer : Symbol(ExpressServer, Decl(declareExternalModuleWithExportAssignedFundule.ts, 6, 20)) + + post(path: RegExp, handler: (req: Function) => void ): void; +>post : Symbol(post, Decl(declareExternalModuleWithExportAssignedFundule.ts, 10, 48)) +>path : Symbol(path, Decl(declareExternalModuleWithExportAssignedFundule.ts, 12, 17)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) +>handler : Symbol(handler, Decl(declareExternalModuleWithExportAssignedFundule.ts, 12, 30)) +>req : Symbol(req, Decl(declareExternalModuleWithExportAssignedFundule.ts, 12, 41)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) + + } + + export class ExpressServerRequest { +>ExpressServerRequest : Symbol(ExpressServerRequest, Decl(declareExternalModuleWithExportAssignedFundule.ts, 14, 9)) + + } + + } + +} + diff --git a/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.types b/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.types index 70718471d50..2206c804448 100644 --- a/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.types +++ b/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.types @@ -6,7 +6,7 @@ declare module "express" { function express(): express.ExpressServer; >express : typeof express ->express : unknown +>express : any >ExpressServer : express.ExpressServer module express { diff --git a/tests/baselines/reference/declareFileExportAssignment.symbols b/tests/baselines/reference/declareFileExportAssignment.symbols new file mode 100644 index 00000000000..bb626e9eeab --- /dev/null +++ b/tests/baselines/reference/declareFileExportAssignment.symbols @@ -0,0 +1,50 @@ +=== tests/cases/compiler/declareFileExportAssignment.ts === +module m2 { +>m2 : Symbol(m2, Decl(declareFileExportAssignment.ts, 0, 0), Decl(declareFileExportAssignment.ts, 11, 3)) + + export interface connectModule { +>connectModule : Symbol(connectModule, Decl(declareFileExportAssignment.ts, 0, 11)) + + (res, req, next): void; +>res : Symbol(res, Decl(declareFileExportAssignment.ts, 2, 9)) +>req : Symbol(req, Decl(declareFileExportAssignment.ts, 2, 13)) +>next : Symbol(next, Decl(declareFileExportAssignment.ts, 2, 18)) + } + export interface connectExport { +>connectExport : Symbol(connectExport, Decl(declareFileExportAssignment.ts, 3, 5)) + + use: (mod: connectModule) => connectExport; +>use : Symbol(use, Decl(declareFileExportAssignment.ts, 4, 36)) +>mod : Symbol(mod, Decl(declareFileExportAssignment.ts, 5, 14)) +>connectModule : Symbol(connectModule, Decl(declareFileExportAssignment.ts, 0, 11)) +>connectExport : Symbol(connectExport, Decl(declareFileExportAssignment.ts, 3, 5)) + + listen: (port: number) => void; +>listen : Symbol(listen, Decl(declareFileExportAssignment.ts, 5, 51)) +>port : Symbol(port, Decl(declareFileExportAssignment.ts, 6, 17)) + } + +} + +var m2: { +>m2 : Symbol(m2, Decl(declareFileExportAssignment.ts, 0, 0), Decl(declareFileExportAssignment.ts, 11, 3)) + + (): m2.connectExport; +>m2 : Symbol(m2, Decl(declareFileExportAssignment.ts, 0, 0), Decl(declareFileExportAssignment.ts, 11, 3)) +>connectExport : Symbol(m2.connectExport, Decl(declareFileExportAssignment.ts, 3, 5)) + + test1: m2.connectModule; +>test1 : Symbol(test1, Decl(declareFileExportAssignment.ts, 12, 25)) +>m2 : Symbol(m2, Decl(declareFileExportAssignment.ts, 0, 0), Decl(declareFileExportAssignment.ts, 11, 3)) +>connectModule : Symbol(m2.connectModule, Decl(declareFileExportAssignment.ts, 0, 11)) + + test2(): m2.connectModule; +>test2 : Symbol(test2, Decl(declareFileExportAssignment.ts, 13, 28)) +>m2 : Symbol(m2, Decl(declareFileExportAssignment.ts, 0, 0), Decl(declareFileExportAssignment.ts, 11, 3)) +>connectModule : Symbol(m2.connectModule, Decl(declareFileExportAssignment.ts, 0, 11)) + +}; + +export = m2; +>m2 : Symbol(m2, Decl(declareFileExportAssignment.ts, 0, 0), Decl(declareFileExportAssignment.ts, 11, 3)) + diff --git a/tests/baselines/reference/declareFileExportAssignment.types b/tests/baselines/reference/declareFileExportAssignment.types index f30586b07e3..cf9377b2904 100644 --- a/tests/baselines/reference/declareFileExportAssignment.types +++ b/tests/baselines/reference/declareFileExportAssignment.types @@ -30,17 +30,17 @@ var m2: { >m2 : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; } (): m2.connectExport; ->m2 : unknown +>m2 : any >connectExport : m2.connectExport test1: m2.connectModule; >test1 : m2.connectModule ->m2 : unknown +>m2 : any >connectModule : m2.connectModule test2(): m2.connectModule; >test2 : () => m2.connectModule ->m2 : unknown +>m2 : any >connectModule : m2.connectModule }; diff --git a/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.symbols b/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.symbols new file mode 100644 index 00000000000..e829c3d2f92 --- /dev/null +++ b/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.symbols @@ -0,0 +1,51 @@ +=== tests/cases/compiler/declareFileExportAssignmentWithVarFromVariableStatement.ts === +module m2 { +>m2 : Symbol(m2, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 0, 0), Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 11, 11)) + + export interface connectModule { +>connectModule : Symbol(connectModule, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 0, 11)) + + (res, req, next): void; +>res : Symbol(res, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 2, 9)) +>req : Symbol(req, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 2, 13)) +>next : Symbol(next, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 2, 18)) + } + export interface connectExport { +>connectExport : Symbol(connectExport, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 3, 5)) + + use: (mod: connectModule) => connectExport; +>use : Symbol(use, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 4, 36)) +>mod : Symbol(mod, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 5, 14)) +>connectModule : Symbol(connectModule, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 0, 11)) +>connectExport : Symbol(connectExport, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 3, 5)) + + listen: (port: number) => void; +>listen : Symbol(listen, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 5, 51)) +>port : Symbol(port, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 6, 17)) + } + +} + +var x = 10, m2: { +>x : Symbol(x, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 11, 3)) +>m2 : Symbol(m2, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 0, 0), Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 11, 11)) + + (): m2.connectExport; +>m2 : Symbol(m2, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 0, 0), Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 11, 11)) +>connectExport : Symbol(m2.connectExport, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 3, 5)) + + test1: m2.connectModule; +>test1 : Symbol(test1, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 12, 25)) +>m2 : Symbol(m2, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 0, 0), Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 11, 11)) +>connectModule : Symbol(m2.connectModule, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 0, 11)) + + test2(): m2.connectModule; +>test2 : Symbol(test2, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 13, 28)) +>m2 : Symbol(m2, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 0, 0), Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 11, 11)) +>connectModule : Symbol(m2.connectModule, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 0, 11)) + +}; + +export = m2; +>m2 : Symbol(m2, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 0, 0), Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 11, 11)) + diff --git a/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types b/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types index 675dc38c869..c33ed5219a8 100644 --- a/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types +++ b/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types @@ -28,20 +28,21 @@ module m2 { var x = 10, m2: { >x : number +>10 : number >m2 : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; } (): m2.connectExport; ->m2 : unknown +>m2 : any >connectExport : m2.connectExport test1: m2.connectModule; >test1 : m2.connectModule ->m2 : unknown +>m2 : any >connectModule : m2.connectModule test2(): m2.connectModule; >test2 : () => m2.connectModule ->m2 : unknown +>m2 : any >connectModule : m2.connectModule }; diff --git a/tests/baselines/reference/declaredExternalModule.symbols b/tests/baselines/reference/declaredExternalModule.symbols new file mode 100644 index 00000000000..e6fde33f2d0 --- /dev/null +++ b/tests/baselines/reference/declaredExternalModule.symbols @@ -0,0 +1,45 @@ +=== tests/cases/compiler/declaredExternalModule.ts === +declare module 'connect' { + + interface connectModule { +>connectModule : Symbol(connectModule, Decl(declaredExternalModule.ts, 0, 26)) + + (res, req, next): void; +>res : Symbol(res, Decl(declaredExternalModule.ts, 4, 9)) +>req : Symbol(req, Decl(declaredExternalModule.ts, 4, 13)) +>next : Symbol(next, Decl(declaredExternalModule.ts, 4, 18)) + + } + + interface connectExport { +>connectExport : Symbol(connectExport, Decl(declaredExternalModule.ts, 6, 5)) + + use: (mod: connectModule) => connectExport; +>use : Symbol(use, Decl(declaredExternalModule.ts, 8, 29)) +>mod : Symbol(mod, Decl(declaredExternalModule.ts, 10, 14)) +>connectModule : Symbol(connectModule, Decl(declaredExternalModule.ts, 0, 26)) +>connectExport : Symbol(connectExport, Decl(declaredExternalModule.ts, 6, 5)) + + listen: (port: number) => void; +>listen : Symbol(listen, Decl(declaredExternalModule.ts, 10, 51)) +>port : Symbol(port, Decl(declaredExternalModule.ts, 12, 17)) + + } + + var server: { +>server : Symbol(server, Decl(declaredExternalModule.ts, 16, 7)) + + (): connectExport; +>connectExport : Symbol(connectExport, Decl(declaredExternalModule.ts, 6, 5)) + + test1: connectModule; // No error +>test1 : Symbol(test1, Decl(declaredExternalModule.ts, 18, 26)) +>connectModule : Symbol(connectModule, Decl(declaredExternalModule.ts, 0, 26)) + + test2(): connectModule; // ERROR: Return type of method from exported interface has or is using private type ''connect'.connectModule'. +>test2 : Symbol(test2, Decl(declaredExternalModule.ts, 20, 29)) +>connectModule : Symbol(connectModule, Decl(declaredExternalModule.ts, 0, 26)) + + }; +} + diff --git a/tests/baselines/reference/declaredExternalModuleWithExportAssignment.symbols b/tests/baselines/reference/declaredExternalModuleWithExportAssignment.symbols new file mode 100644 index 00000000000..360f57d7a9a --- /dev/null +++ b/tests/baselines/reference/declaredExternalModuleWithExportAssignment.symbols @@ -0,0 +1,44 @@ +=== tests/cases/compiler/declaredExternalModuleWithExportAssignment.ts === +declare module 'connect' { + interface connectModule { +>connectModule : Symbol(connectModule, Decl(declaredExternalModuleWithExportAssignment.ts, 0, 26)) + + (res, req, next): void; +>res : Symbol(res, Decl(declaredExternalModuleWithExportAssignment.ts, 2, 9)) +>req : Symbol(req, Decl(declaredExternalModuleWithExportAssignment.ts, 2, 13)) +>next : Symbol(next, Decl(declaredExternalModuleWithExportAssignment.ts, 2, 18)) + } + + interface connectExport { +>connectExport : Symbol(connectExport, Decl(declaredExternalModuleWithExportAssignment.ts, 3, 5)) + + use: (mod: connectModule) => connectExport; +>use : Symbol(use, Decl(declaredExternalModuleWithExportAssignment.ts, 5, 29)) +>mod : Symbol(mod, Decl(declaredExternalModuleWithExportAssignment.ts, 6, 14)) +>connectModule : Symbol(connectModule, Decl(declaredExternalModuleWithExportAssignment.ts, 0, 26)) +>connectExport : Symbol(connectExport, Decl(declaredExternalModuleWithExportAssignment.ts, 3, 5)) + + listen: (port: number) => void; +>listen : Symbol(listen, Decl(declaredExternalModuleWithExportAssignment.ts, 6, 51)) +>port : Symbol(port, Decl(declaredExternalModuleWithExportAssignment.ts, 7, 17)) + } + + var server: { +>server : Symbol(server, Decl(declaredExternalModuleWithExportAssignment.ts, 10, 7)) + + (): connectExport; +>connectExport : Symbol(connectExport, Decl(declaredExternalModuleWithExportAssignment.ts, 3, 5)) + + test1: connectModule; +>test1 : Symbol(test1, Decl(declaredExternalModuleWithExportAssignment.ts, 11, 26)) +>connectModule : Symbol(connectModule, Decl(declaredExternalModuleWithExportAssignment.ts, 0, 26)) + + test2(): connectModule; +>test2 : Symbol(test2, Decl(declaredExternalModuleWithExportAssignment.ts, 12, 29)) +>connectModule : Symbol(connectModule, Decl(declaredExternalModuleWithExportAssignment.ts, 0, 26)) + + }; + export = server; +>server : Symbol(server, Decl(declaredExternalModuleWithExportAssignment.ts, 10, 7)) +} + diff --git a/tests/baselines/reference/decoratedClassFromExternalModule.js b/tests/baselines/reference/decoratedClassFromExternalModule.js new file mode 100644 index 00000000000..a58eb01a426 --- /dev/null +++ b/tests/baselines/reference/decoratedClassFromExternalModule.js @@ -0,0 +1,28 @@ +//// [tests/cases/conformance/decorators/class/decoratedClassFromExternalModule.ts] //// + +//// [decorated.ts] +function decorate() { } + +@decorate +export default class Decorated { } + +//// [undecorated.ts] +import Decorated from 'decorated'; + +//// [decorated.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); + } +}; +function decorate() { } +let Decorated = class { +}; +Object.defineProperty(Decorated, "name", { value: "Decorated", configurable: true }); +Decorated = __decorate([ + decorate +], Decorated); +export default Decorated; +//// [undecorated.js] diff --git a/tests/baselines/reference/decoratedClassFromExternalModule.symbols b/tests/baselines/reference/decoratedClassFromExternalModule.symbols new file mode 100644 index 00000000000..aa17dde616a --- /dev/null +++ b/tests/baselines/reference/decoratedClassFromExternalModule.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/decorators/class/decorated.ts === +function decorate() { } +>decorate : Symbol(decorate, Decl(decorated.ts, 0, 0)) + +@decorate +>decorate : Symbol(decorate, Decl(decorated.ts, 0, 0)) + +export default class Decorated { } +>Decorated : Symbol(Decorated, Decl(decorated.ts, 0, 23)) + +=== tests/cases/conformance/decorators/class/undecorated.ts === +import Decorated from 'decorated'; +>Decorated : Symbol(Decorated, Decl(undecorated.ts, 0, 6)) + diff --git a/tests/baselines/reference/decoratedClassFromExternalModule.types b/tests/baselines/reference/decoratedClassFromExternalModule.types new file mode 100644 index 00000000000..4234b6a4b15 --- /dev/null +++ b/tests/baselines/reference/decoratedClassFromExternalModule.types @@ -0,0 +1,14 @@ +=== tests/cases/conformance/decorators/class/decorated.ts === +function decorate() { } +>decorate : () => void + +@decorate +>decorate : () => void + +export default class Decorated { } +>Decorated : Decorated + +=== tests/cases/conformance/decorators/class/undecorated.ts === +import Decorated from 'decorated'; +>Decorated : typeof Decorated + diff --git a/tests/baselines/reference/decoratorOnClass1.symbols b/tests/baselines/reference/decoratorOnClass1.symbols new file mode 100644 index 00000000000..580bf2999ee --- /dev/null +++ b/tests/baselines/reference/decoratorOnClass1.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/decorators/class/decoratorOnClass1.ts === +declare function dec(target: T): T; +>dec : Symbol(dec, Decl(decoratorOnClass1.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClass1.ts, 0, 21)) +>target : Symbol(target, Decl(decoratorOnClass1.ts, 0, 24)) +>T : Symbol(T, Decl(decoratorOnClass1.ts, 0, 21)) +>T : Symbol(T, Decl(decoratorOnClass1.ts, 0, 21)) + +@dec +>dec : Symbol(dec, Decl(decoratorOnClass1.ts, 0, 0)) + +class C { +>C : Symbol(C, Decl(decoratorOnClass1.ts, 0, 38)) +} diff --git a/tests/baselines/reference/decoratorOnClass1.types b/tests/baselines/reference/decoratorOnClass1.types index 19e066586da..91c9feb4e35 100644 --- a/tests/baselines/reference/decoratorOnClass1.types +++ b/tests/baselines/reference/decoratorOnClass1.types @@ -7,7 +7,7 @@ declare function dec(target: T): T; >T : T @dec ->dec : unknown +>dec : (target: T) => T class C { >C : C diff --git a/tests/baselines/reference/decoratorOnClass2.symbols b/tests/baselines/reference/decoratorOnClass2.symbols new file mode 100644 index 00000000000..9fadb25b055 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClass2.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/decorators/class/decoratorOnClass2.ts === +declare function dec(target: T): T; +>dec : Symbol(dec, Decl(decoratorOnClass2.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClass2.ts, 0, 21)) +>target : Symbol(target, Decl(decoratorOnClass2.ts, 0, 24)) +>T : Symbol(T, Decl(decoratorOnClass2.ts, 0, 21)) +>T : Symbol(T, Decl(decoratorOnClass2.ts, 0, 21)) + +@dec +>dec : Symbol(dec, Decl(decoratorOnClass2.ts, 0, 0)) + +export class C { +>C : Symbol(C, Decl(decoratorOnClass2.ts, 0, 38)) +} diff --git a/tests/baselines/reference/decoratorOnClass2.types b/tests/baselines/reference/decoratorOnClass2.types index 43102ee9122..48565b74b43 100644 --- a/tests/baselines/reference/decoratorOnClass2.types +++ b/tests/baselines/reference/decoratorOnClass2.types @@ -7,7 +7,7 @@ declare function dec(target: T): T; >T : T @dec ->dec : unknown +>dec : (target: T) => T export class C { >C : C diff --git a/tests/baselines/reference/decoratorOnClass4.symbols b/tests/baselines/reference/decoratorOnClass4.symbols new file mode 100644 index 00000000000..7ecec97ec75 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClass4.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/decorators/class/decoratorOnClass4.ts === +declare function dec(): (target: T) => T; +>dec : Symbol(dec, Decl(decoratorOnClass4.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClass4.ts, 0, 25)) +>target : Symbol(target, Decl(decoratorOnClass4.ts, 0, 28)) +>T : Symbol(T, Decl(decoratorOnClass4.ts, 0, 25)) +>T : Symbol(T, Decl(decoratorOnClass4.ts, 0, 25)) + +@dec() +>dec : Symbol(dec, Decl(decoratorOnClass4.ts, 0, 0)) + +class C { +>C : Symbol(C, Decl(decoratorOnClass4.ts, 0, 44)) +} diff --git a/tests/baselines/reference/decoratorOnClass5.symbols b/tests/baselines/reference/decoratorOnClass5.symbols new file mode 100644 index 00000000000..7291d593842 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClass5.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/decorators/class/decoratorOnClass5.ts === +declare function dec(): (target: T) => T; +>dec : Symbol(dec, Decl(decoratorOnClass5.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClass5.ts, 0, 25)) +>target : Symbol(target, Decl(decoratorOnClass5.ts, 0, 28)) +>T : Symbol(T, Decl(decoratorOnClass5.ts, 0, 25)) +>T : Symbol(T, Decl(decoratorOnClass5.ts, 0, 25)) + +@dec() +>dec : Symbol(dec, Decl(decoratorOnClass5.ts, 0, 0)) + +class C { +>C : Symbol(C, Decl(decoratorOnClass5.ts, 0, 44)) +} diff --git a/tests/baselines/reference/decoratorOnClassAccessor1.symbols b/tests/baselines/reference/decoratorOnClassAccessor1.symbols new file mode 100644 index 00000000000..933dff1b4c5 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassAccessor1.symbols @@ -0,0 +1,19 @@ +=== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor1.ts === +declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; +>dec : Symbol(dec, Decl(decoratorOnClassAccessor1.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassAccessor1.ts, 0, 21)) +>target : Symbol(target, Decl(decoratorOnClassAccessor1.ts, 0, 24)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassAccessor1.ts, 0, 36)) +>descriptor : Symbol(descriptor, Decl(decoratorOnClassAccessor1.ts, 0, 57)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassAccessor1.ts, 0, 21)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassAccessor1.ts, 0, 21)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassAccessor1.ts, 0, 126)) + + @dec get accessor() { return 1; } +>dec : Symbol(dec, Decl(decoratorOnClassAccessor1.ts, 0, 0)) +>accessor : Symbol(accessor, Decl(decoratorOnClassAccessor1.ts, 2, 9)) +} diff --git a/tests/baselines/reference/decoratorOnClassAccessor1.types b/tests/baselines/reference/decoratorOnClassAccessor1.types index fd592d7d294..e5ba5149d7a 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor1.types +++ b/tests/baselines/reference/decoratorOnClassAccessor1.types @@ -14,6 +14,7 @@ class C { >C : C @dec get accessor() { return 1; } ->dec : unknown +>dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor >accessor : number +>1 : number } diff --git a/tests/baselines/reference/decoratorOnClassAccessor2.symbols b/tests/baselines/reference/decoratorOnClassAccessor2.symbols new file mode 100644 index 00000000000..5738bb50bb8 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassAccessor2.symbols @@ -0,0 +1,19 @@ +=== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor2.ts === +declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; +>dec : Symbol(dec, Decl(decoratorOnClassAccessor2.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassAccessor2.ts, 0, 21)) +>target : Symbol(target, Decl(decoratorOnClassAccessor2.ts, 0, 24)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassAccessor2.ts, 0, 36)) +>descriptor : Symbol(descriptor, Decl(decoratorOnClassAccessor2.ts, 0, 57)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassAccessor2.ts, 0, 21)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassAccessor2.ts, 0, 21)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassAccessor2.ts, 0, 126)) + + @dec public get accessor() { return 1; } +>dec : Symbol(dec, Decl(decoratorOnClassAccessor2.ts, 0, 0)) +>accessor : Symbol(accessor, Decl(decoratorOnClassAccessor2.ts, 2, 9)) +} diff --git a/tests/baselines/reference/decoratorOnClassAccessor2.types b/tests/baselines/reference/decoratorOnClassAccessor2.types index 32bb503d889..32902ce7ca0 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor2.types +++ b/tests/baselines/reference/decoratorOnClassAccessor2.types @@ -14,6 +14,7 @@ class C { >C : C @dec public get accessor() { return 1; } ->dec : unknown +>dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor >accessor : number +>1 : number } diff --git a/tests/baselines/reference/decoratorOnClassAccessor3.errors.txt b/tests/baselines/reference/decoratorOnClassAccessor3.errors.txt index 1a1e6503355..98b96b9b1c4 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor3.errors.txt +++ b/tests/baselines/reference/decoratorOnClassAccessor3.errors.txt @@ -1,4 +1,4 @@ -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,12): error TS1005: ';' expected. ==== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts (1 errors) ==== @@ -6,6 +6,6 @@ tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts(4 class C { public @dec get accessor() { return 1; } - ~~~~~~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. + ~ +!!! error TS1005: ';' expected. } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassAccessor4.symbols b/tests/baselines/reference/decoratorOnClassAccessor4.symbols new file mode 100644 index 00000000000..1100df1c081 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassAccessor4.symbols @@ -0,0 +1,20 @@ +=== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor4.ts === +declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; +>dec : Symbol(dec, Decl(decoratorOnClassAccessor4.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassAccessor4.ts, 0, 21)) +>target : Symbol(target, Decl(decoratorOnClassAccessor4.ts, 0, 24)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassAccessor4.ts, 0, 36)) +>descriptor : Symbol(descriptor, Decl(decoratorOnClassAccessor4.ts, 0, 57)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassAccessor4.ts, 0, 21)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassAccessor4.ts, 0, 21)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassAccessor4.ts, 0, 126)) + + @dec set accessor(value: number) { } +>dec : Symbol(dec, Decl(decoratorOnClassAccessor4.ts, 0, 0)) +>accessor : Symbol(accessor, Decl(decoratorOnClassAccessor4.ts, 2, 9)) +>value : Symbol(value, Decl(decoratorOnClassAccessor4.ts, 3, 22)) +} diff --git a/tests/baselines/reference/decoratorOnClassAccessor4.types b/tests/baselines/reference/decoratorOnClassAccessor4.types index 40dd43d7e62..59399c5ea31 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor4.types +++ b/tests/baselines/reference/decoratorOnClassAccessor4.types @@ -14,7 +14,7 @@ class C { >C : C @dec set accessor(value: number) { } ->dec : unknown +>dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor >accessor : number >value : number } diff --git a/tests/baselines/reference/decoratorOnClassAccessor5.symbols b/tests/baselines/reference/decoratorOnClassAccessor5.symbols new file mode 100644 index 00000000000..8d9927776c2 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassAccessor5.symbols @@ -0,0 +1,20 @@ +=== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor5.ts === +declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; +>dec : Symbol(dec, Decl(decoratorOnClassAccessor5.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassAccessor5.ts, 0, 21)) +>target : Symbol(target, Decl(decoratorOnClassAccessor5.ts, 0, 24)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassAccessor5.ts, 0, 36)) +>descriptor : Symbol(descriptor, Decl(decoratorOnClassAccessor5.ts, 0, 57)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassAccessor5.ts, 0, 21)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassAccessor5.ts, 0, 21)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassAccessor5.ts, 0, 126)) + + @dec public set accessor(value: number) { } +>dec : Symbol(dec, Decl(decoratorOnClassAccessor5.ts, 0, 0)) +>accessor : Symbol(accessor, Decl(decoratorOnClassAccessor5.ts, 2, 9)) +>value : Symbol(value, Decl(decoratorOnClassAccessor5.ts, 3, 29)) +} diff --git a/tests/baselines/reference/decoratorOnClassAccessor5.types b/tests/baselines/reference/decoratorOnClassAccessor5.types index 4b167fe8df1..8fe5ee55368 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor5.types +++ b/tests/baselines/reference/decoratorOnClassAccessor5.types @@ -14,7 +14,7 @@ class C { >C : C @dec public set accessor(value: number) { } ->dec : unknown +>dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor >accessor : number >value : number } diff --git a/tests/baselines/reference/decoratorOnClassAccessor6.errors.txt b/tests/baselines/reference/decoratorOnClassAccessor6.errors.txt index f43827c0e4b..e430b4cf1ee 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor6.errors.txt +++ b/tests/baselines/reference/decoratorOnClassAccessor6.errors.txt @@ -1,4 +1,4 @@ -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,12): error TS1005: ';' expected. ==== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts (1 errors) ==== @@ -6,6 +6,6 @@ tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts(4 class C { public @dec set accessor(value: number) { } - ~~~~~~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. + ~ +!!! error TS1005: ';' expected. } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassConstructorParameter1.symbols b/tests/baselines/reference/decoratorOnClassConstructorParameter1.symbols new file mode 100644 index 00000000000..a863f74e2ff --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassConstructorParameter1.symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/decorators/class/constructor/parameter/decoratorOnClassConstructorParameter1.ts === +declare function dec(target: Function, propertyKey: string | symbol, parameterIndex: number): void; +>dec : Symbol(dec, Decl(decoratorOnClassConstructorParameter1.ts, 0, 0)) +>target : Symbol(target, Decl(decoratorOnClassConstructorParameter1.ts, 0, 21)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassConstructorParameter1.ts, 0, 38)) +>parameterIndex : Symbol(parameterIndex, Decl(decoratorOnClassConstructorParameter1.ts, 0, 68)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassConstructorParameter1.ts, 0, 99)) + + constructor(@dec p: number) {} +>dec : Symbol(dec, Decl(decoratorOnClassConstructorParameter1.ts, 0, 0)) +>p : Symbol(p, Decl(decoratorOnClassConstructorParameter1.ts, 3, 16)) +} diff --git a/tests/baselines/reference/decoratorOnClassConstructorParameter1.types b/tests/baselines/reference/decoratorOnClassConstructorParameter1.types index d5ce51269bc..a325945d8a2 100644 --- a/tests/baselines/reference/decoratorOnClassConstructorParameter1.types +++ b/tests/baselines/reference/decoratorOnClassConstructorParameter1.types @@ -10,6 +10,6 @@ class C { >C : C constructor(@dec p: number) {} ->dec : unknown +>dec : (target: Function, propertyKey: string | symbol, parameterIndex: number) => void >p : number } diff --git a/tests/baselines/reference/decoratorOnClassConstructorParameter4.errors.txt b/tests/baselines/reference/decoratorOnClassConstructorParameter4.errors.txt index 61ff1433662..5969cfca069 100644 --- a/tests/baselines/reference/decoratorOnClassConstructorParameter4.errors.txt +++ b/tests/baselines/reference/decoratorOnClassConstructorParameter4.errors.txt @@ -1,14 +1,11 @@ -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 (2 errors) ==== +==== tests/cases/conformance/decorators/class/constructor/parameter/decoratorOnClassConstructorParameter4.ts (1 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 638cb1cda7e..9d2b4a690ab 100644 --- a/tests/baselines/reference/decoratorOnClassConstructorParameter4.js +++ b/tests/baselines/reference/decoratorOnClassConstructorParameter4.js @@ -15,7 +15,7 @@ var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.deco }; var __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } }; var C = (function () { - function C(, p) { + function C(public, p) { } C = __decorate([ __param(1, dec) diff --git a/tests/baselines/reference/decoratorOnClassMethod1.symbols b/tests/baselines/reference/decoratorOnClassMethod1.symbols new file mode 100644 index 00000000000..f1463115f49 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod1.symbols @@ -0,0 +1,19 @@ +=== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod1.ts === +declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; +>dec : Symbol(dec, Decl(decoratorOnClassMethod1.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassMethod1.ts, 0, 21)) +>target : Symbol(target, Decl(decoratorOnClassMethod1.ts, 0, 24)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassMethod1.ts, 0, 36)) +>descriptor : Symbol(descriptor, Decl(decoratorOnClassMethod1.ts, 0, 57)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod1.ts, 0, 21)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod1.ts, 0, 21)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassMethod1.ts, 0, 126)) + + @dec method() {} +>dec : Symbol(dec, Decl(decoratorOnClassMethod1.ts, 0, 0)) +>method : Symbol(method, Decl(decoratorOnClassMethod1.ts, 2, 9)) +} diff --git a/tests/baselines/reference/decoratorOnClassMethod1.types b/tests/baselines/reference/decoratorOnClassMethod1.types index 760f758bbff..fc7f27c5dfb 100644 --- a/tests/baselines/reference/decoratorOnClassMethod1.types +++ b/tests/baselines/reference/decoratorOnClassMethod1.types @@ -14,6 +14,6 @@ class C { >C : C @dec method() {} ->dec : unknown +>dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor >method : () => void } diff --git a/tests/baselines/reference/decoratorOnClassMethod11.js b/tests/baselines/reference/decoratorOnClassMethod11.js index 71d4298f02c..f8276de2fe3 100644 --- a/tests/baselines/reference/decoratorOnClassMethod11.js +++ b/tests/baselines/reference/decoratorOnClassMethod11.js @@ -1,11 +1,11 @@ //// [decoratorOnClassMethod11.ts] -module M { - class C { - decorator(target: Object, key: string): void { } - - @this.decorator - method() { } - } +module M { + class C { + decorator(target: Object, key: string): void { } + + @this.decorator + method() { } + } } //// [decoratorOnClassMethod11.js] diff --git a/tests/baselines/reference/decoratorOnClassMethod13.symbols b/tests/baselines/reference/decoratorOnClassMethod13.symbols new file mode 100644 index 00000000000..af3819924f4 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod13.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod13.ts === +declare function dec(): (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor; +>dec : Symbol(dec, Decl(decoratorOnClassMethod13.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassMethod13.ts, 0, 25)) +>target : Symbol(target, Decl(decoratorOnClassMethod13.ts, 0, 28)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassMethod13.ts, 0, 40)) +>descriptor : Symbol(descriptor, Decl(decoratorOnClassMethod13.ts, 0, 61)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod13.ts, 0, 25)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod13.ts, 0, 25)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassMethod13.ts, 0, 132)) + + @dec ["1"]() { } +>dec : Symbol(dec, Decl(decoratorOnClassMethod13.ts, 0, 0)) + + @dec ["b"]() { } +>dec : Symbol(dec, Decl(decoratorOnClassMethod13.ts, 0, 0)) +} diff --git a/tests/baselines/reference/decoratorOnClassMethod13.types b/tests/baselines/reference/decoratorOnClassMethod13.types index 8c34805792f..2858f8877bd 100644 --- a/tests/baselines/reference/decoratorOnClassMethod13.types +++ b/tests/baselines/reference/decoratorOnClassMethod13.types @@ -14,8 +14,10 @@ class C { >C : C @dec ["1"]() { } ->dec : unknown +>dec : () => (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor +>"1" : string @dec ["b"]() { } ->dec : unknown +>dec : () => (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor +>"b" : string } diff --git a/tests/baselines/reference/decoratorOnClassMethod2.symbols b/tests/baselines/reference/decoratorOnClassMethod2.symbols new file mode 100644 index 00000000000..e7942d3ae45 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod2.symbols @@ -0,0 +1,19 @@ +=== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod2.ts === +declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; +>dec : Symbol(dec, Decl(decoratorOnClassMethod2.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassMethod2.ts, 0, 21)) +>target : Symbol(target, Decl(decoratorOnClassMethod2.ts, 0, 24)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassMethod2.ts, 0, 36)) +>descriptor : Symbol(descriptor, Decl(decoratorOnClassMethod2.ts, 0, 57)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod2.ts, 0, 21)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod2.ts, 0, 21)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassMethod2.ts, 0, 126)) + + @dec public method() {} +>dec : Symbol(dec, Decl(decoratorOnClassMethod2.ts, 0, 0)) +>method : Symbol(method, Decl(decoratorOnClassMethod2.ts, 2, 9)) +} diff --git a/tests/baselines/reference/decoratorOnClassMethod2.types b/tests/baselines/reference/decoratorOnClassMethod2.types index 98539648cd0..b83605c9c3c 100644 --- a/tests/baselines/reference/decoratorOnClassMethod2.types +++ b/tests/baselines/reference/decoratorOnClassMethod2.types @@ -14,6 +14,6 @@ class C { >C : C @dec public method() {} ->dec : unknown +>dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor >method : () => void } diff --git a/tests/baselines/reference/decoratorOnClassMethod3.errors.txt b/tests/baselines/reference/decoratorOnClassMethod3.errors.txt index 2775ab9f144..4881502a02e 100644 --- a/tests/baselines/reference/decoratorOnClassMethod3.errors.txt +++ b/tests/baselines/reference/decoratorOnClassMethod3.errors.txt @@ -1,4 +1,4 @@ -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,12): error TS1005: ';' expected. ==== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts (1 errors) ==== @@ -6,6 +6,6 @@ tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts(4,5): class C { public @dec method() {} - ~~~~~~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. + ~ +!!! error TS1005: ';' expected. } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassMethod4.symbols b/tests/baselines/reference/decoratorOnClassMethod4.symbols new file mode 100644 index 00000000000..688bc03775a --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod4.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod4.ts === +declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; +>dec : Symbol(dec, Decl(decoratorOnClassMethod4.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassMethod4.ts, 0, 21)) +>target : Symbol(target, Decl(decoratorOnClassMethod4.ts, 0, 24)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassMethod4.ts, 0, 36)) +>descriptor : Symbol(descriptor, Decl(decoratorOnClassMethod4.ts, 0, 57)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod4.ts, 0, 21)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod4.ts, 0, 21)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassMethod4.ts, 0, 126)) + + @dec ["method"]() {} +>dec : Symbol(dec, Decl(decoratorOnClassMethod4.ts, 0, 0)) +} diff --git a/tests/baselines/reference/decoratorOnClassMethod4.types b/tests/baselines/reference/decoratorOnClassMethod4.types index 6d55e01e97a..026508257a5 100644 --- a/tests/baselines/reference/decoratorOnClassMethod4.types +++ b/tests/baselines/reference/decoratorOnClassMethod4.types @@ -14,5 +14,6 @@ class C { >C : C @dec ["method"]() {} ->dec : unknown +>dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor +>"method" : string } diff --git a/tests/baselines/reference/decoratorOnClassMethod5.symbols b/tests/baselines/reference/decoratorOnClassMethod5.symbols new file mode 100644 index 00000000000..6356ca35449 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod5.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod5.ts === +declare function dec(): (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor; +>dec : Symbol(dec, Decl(decoratorOnClassMethod5.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassMethod5.ts, 0, 25)) +>target : Symbol(target, Decl(decoratorOnClassMethod5.ts, 0, 28)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassMethod5.ts, 0, 40)) +>descriptor : Symbol(descriptor, Decl(decoratorOnClassMethod5.ts, 0, 61)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod5.ts, 0, 25)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod5.ts, 0, 25)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassMethod5.ts, 0, 132)) + + @dec() ["method"]() {} +>dec : Symbol(dec, Decl(decoratorOnClassMethod5.ts, 0, 0)) +} diff --git a/tests/baselines/reference/decoratorOnClassMethod5.types b/tests/baselines/reference/decoratorOnClassMethod5.types index d87de2b351a..d55ddd832b9 100644 --- a/tests/baselines/reference/decoratorOnClassMethod5.types +++ b/tests/baselines/reference/decoratorOnClassMethod5.types @@ -16,4 +16,5 @@ class C { @dec() ["method"]() {} >dec() : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor >dec : () => (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor +>"method" : string } diff --git a/tests/baselines/reference/decoratorOnClassMethod6.symbols b/tests/baselines/reference/decoratorOnClassMethod6.symbols new file mode 100644 index 00000000000..8dcdd99a8e9 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod6.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts === +declare function dec(): (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor; +>dec : Symbol(dec, Decl(decoratorOnClassMethod6.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassMethod6.ts, 0, 25)) +>target : Symbol(target, Decl(decoratorOnClassMethod6.ts, 0, 28)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassMethod6.ts, 0, 40)) +>descriptor : Symbol(descriptor, Decl(decoratorOnClassMethod6.ts, 0, 61)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod6.ts, 0, 25)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod6.ts, 0, 25)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassMethod6.ts, 0, 132)) + + @dec ["method"]() {} +>dec : Symbol(dec, Decl(decoratorOnClassMethod6.ts, 0, 0)) +} diff --git a/tests/baselines/reference/decoratorOnClassMethod6.types b/tests/baselines/reference/decoratorOnClassMethod6.types index 4e6629cd60a..9da71791763 100644 --- a/tests/baselines/reference/decoratorOnClassMethod6.types +++ b/tests/baselines/reference/decoratorOnClassMethod6.types @@ -14,5 +14,6 @@ class C { >C : C @dec ["method"]() {} ->dec : unknown +>dec : () => (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor +>"method" : string } diff --git a/tests/baselines/reference/decoratorOnClassMethod7.symbols b/tests/baselines/reference/decoratorOnClassMethod7.symbols new file mode 100644 index 00000000000..75c3bee294d --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod7.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod7.ts === +declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; +>dec : Symbol(dec, Decl(decoratorOnClassMethod7.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassMethod7.ts, 0, 21)) +>target : Symbol(target, Decl(decoratorOnClassMethod7.ts, 0, 24)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassMethod7.ts, 0, 36)) +>descriptor : Symbol(descriptor, Decl(decoratorOnClassMethod7.ts, 0, 57)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod7.ts, 0, 21)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod7.ts, 0, 21)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassMethod7.ts, 0, 126)) + + @dec public ["method"]() {} +>dec : Symbol(dec, Decl(decoratorOnClassMethod7.ts, 0, 0)) +} diff --git a/tests/baselines/reference/decoratorOnClassMethod7.types b/tests/baselines/reference/decoratorOnClassMethod7.types index 7e426cb773c..8a72e24bd5b 100644 --- a/tests/baselines/reference/decoratorOnClassMethod7.types +++ b/tests/baselines/reference/decoratorOnClassMethod7.types @@ -14,5 +14,6 @@ class C { >C : C @dec public ["method"]() {} ->dec : unknown +>dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor +>"method" : string } diff --git a/tests/baselines/reference/decoratorOnClassMethod8.symbols b/tests/baselines/reference/decoratorOnClassMethod8.symbols new file mode 100644 index 00000000000..84b68b81421 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod8.symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod8.ts === +declare function dec(target: T): T; +>dec : Symbol(dec, Decl(decoratorOnClassMethod8.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassMethod8.ts, 0, 21)) +>target : Symbol(target, Decl(decoratorOnClassMethod8.ts, 0, 24)) +>T : Symbol(T, Decl(decoratorOnClassMethod8.ts, 0, 21)) +>T : Symbol(T, Decl(decoratorOnClassMethod8.ts, 0, 21)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassMethod8.ts, 0, 38)) + + @dec method() {} +>dec : Symbol(dec, Decl(decoratorOnClassMethod8.ts, 0, 0)) +>method : Symbol(method, Decl(decoratorOnClassMethod8.ts, 2, 9)) +} diff --git a/tests/baselines/reference/decoratorOnClassMethod8.types b/tests/baselines/reference/decoratorOnClassMethod8.types index f932ab8696f..20890b09846 100644 --- a/tests/baselines/reference/decoratorOnClassMethod8.types +++ b/tests/baselines/reference/decoratorOnClassMethod8.types @@ -10,6 +10,6 @@ class C { >C : C @dec method() {} ->dec : unknown +>dec : (target: T) => T >method : () => void } diff --git a/tests/baselines/reference/decoratorOnClassMethodParameter1.symbols b/tests/baselines/reference/decoratorOnClassMethodParameter1.symbols new file mode 100644 index 00000000000..0ced8829766 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethodParameter1.symbols @@ -0,0 +1,16 @@ +=== tests/cases/conformance/decorators/class/method/parameter/decoratorOnClassMethodParameter1.ts === +declare function dec(target: Function, propertyKey: string | symbol, parameterIndex: number): void; +>dec : Symbol(dec, Decl(decoratorOnClassMethodParameter1.ts, 0, 0)) +>target : Symbol(target, Decl(decoratorOnClassMethodParameter1.ts, 0, 21)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassMethodParameter1.ts, 0, 38)) +>parameterIndex : Symbol(parameterIndex, Decl(decoratorOnClassMethodParameter1.ts, 0, 68)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassMethodParameter1.ts, 0, 99)) + + method(@dec p: number) {} +>method : Symbol(method, Decl(decoratorOnClassMethodParameter1.ts, 2, 9)) +>dec : Symbol(dec, Decl(decoratorOnClassMethodParameter1.ts, 0, 0)) +>p : Symbol(p, Decl(decoratorOnClassMethodParameter1.ts, 3, 11)) +} diff --git a/tests/baselines/reference/decoratorOnClassMethodParameter1.types b/tests/baselines/reference/decoratorOnClassMethodParameter1.types index cf7bfd352bf..0b75471471f 100644 --- a/tests/baselines/reference/decoratorOnClassMethodParameter1.types +++ b/tests/baselines/reference/decoratorOnClassMethodParameter1.types @@ -11,6 +11,6 @@ class C { method(@dec p: number) {} >method : (p: number) => void ->dec : unknown +>dec : (target: Function, propertyKey: string | symbol, parameterIndex: number) => void >p : number } diff --git a/tests/baselines/reference/decoratorOnClassProperty1.symbols b/tests/baselines/reference/decoratorOnClassProperty1.symbols new file mode 100644 index 00000000000..1cf97d5ec3b --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassProperty1.symbols @@ -0,0 +1,13 @@ +=== tests/cases/conformance/decorators/class/property/decoratorOnClassProperty1.ts === +declare function dec(target: any, propertyKey: string): void; +>dec : Symbol(dec, Decl(decoratorOnClassProperty1.ts, 0, 0)) +>target : Symbol(target, Decl(decoratorOnClassProperty1.ts, 0, 21)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassProperty1.ts, 0, 33)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassProperty1.ts, 0, 61)) + + @dec prop; +>dec : Symbol(dec, Decl(decoratorOnClassProperty1.ts, 0, 0)) +>prop : Symbol(prop, Decl(decoratorOnClassProperty1.ts, 2, 9)) +} diff --git a/tests/baselines/reference/decoratorOnClassProperty1.types b/tests/baselines/reference/decoratorOnClassProperty1.types index 651085c7ac4..e974397e532 100644 --- a/tests/baselines/reference/decoratorOnClassProperty1.types +++ b/tests/baselines/reference/decoratorOnClassProperty1.types @@ -8,6 +8,6 @@ class C { >C : C @dec prop; ->dec : unknown +>dec : (target: any, propertyKey: string) => void >prop : any } diff --git a/tests/baselines/reference/decoratorOnClassProperty10.symbols b/tests/baselines/reference/decoratorOnClassProperty10.symbols new file mode 100644 index 00000000000..22af0bd8b50 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassProperty10.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/decorators/class/property/decoratorOnClassProperty10.ts === +declare function dec(): (target: any, propertyKey: string) => void; +>dec : Symbol(dec, Decl(decoratorOnClassProperty10.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassProperty10.ts, 0, 25)) +>target : Symbol(target, Decl(decoratorOnClassProperty10.ts, 0, 28)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassProperty10.ts, 0, 40)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassProperty10.ts, 0, 70)) + + @dec() prop; +>dec : Symbol(dec, Decl(decoratorOnClassProperty10.ts, 0, 0)) +>prop : Symbol(prop, Decl(decoratorOnClassProperty10.ts, 2, 9)) +} diff --git a/tests/baselines/reference/decoratorOnClassProperty11.symbols b/tests/baselines/reference/decoratorOnClassProperty11.symbols new file mode 100644 index 00000000000..c7d6e39c713 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassProperty11.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts === +declare function dec(): (target: any, propertyKey: string) => void; +>dec : Symbol(dec, Decl(decoratorOnClassProperty11.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassProperty11.ts, 0, 25)) +>target : Symbol(target, Decl(decoratorOnClassProperty11.ts, 0, 28)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassProperty11.ts, 0, 40)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassProperty11.ts, 0, 70)) + + @dec prop; +>dec : Symbol(dec, Decl(decoratorOnClassProperty11.ts, 0, 0)) +>prop : Symbol(prop, Decl(decoratorOnClassProperty11.ts, 2, 9)) +} diff --git a/tests/baselines/reference/decoratorOnClassProperty11.types b/tests/baselines/reference/decoratorOnClassProperty11.types index 5377e53c31c..5caa467d3ba 100644 --- a/tests/baselines/reference/decoratorOnClassProperty11.types +++ b/tests/baselines/reference/decoratorOnClassProperty11.types @@ -9,6 +9,6 @@ class C { >C : C @dec prop; ->dec : unknown +>dec : () => (target: any, propertyKey: string) => void >prop : any } diff --git a/tests/baselines/reference/decoratorOnClassProperty2.symbols b/tests/baselines/reference/decoratorOnClassProperty2.symbols new file mode 100644 index 00000000000..3383fb1418a --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassProperty2.symbols @@ -0,0 +1,13 @@ +=== tests/cases/conformance/decorators/class/property/decoratorOnClassProperty2.ts === +declare function dec(target: any, propertyKey: string): void; +>dec : Symbol(dec, Decl(decoratorOnClassProperty2.ts, 0, 0)) +>target : Symbol(target, Decl(decoratorOnClassProperty2.ts, 0, 21)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassProperty2.ts, 0, 33)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassProperty2.ts, 0, 61)) + + @dec public prop; +>dec : Symbol(dec, Decl(decoratorOnClassProperty2.ts, 0, 0)) +>prop : Symbol(prop, Decl(decoratorOnClassProperty2.ts, 2, 9)) +} diff --git a/tests/baselines/reference/decoratorOnClassProperty2.types b/tests/baselines/reference/decoratorOnClassProperty2.types index 2d5c9fe07d7..78d35004f8f 100644 --- a/tests/baselines/reference/decoratorOnClassProperty2.types +++ b/tests/baselines/reference/decoratorOnClassProperty2.types @@ -8,6 +8,6 @@ class C { >C : C @dec public prop; ->dec : unknown +>dec : (target: any, propertyKey: string) => void >prop : any } diff --git a/tests/baselines/reference/decoratorOnClassProperty3.errors.txt b/tests/baselines/reference/decoratorOnClassProperty3.errors.txt index a6321c55426..12d0efb78d7 100644 --- a/tests/baselines/reference/decoratorOnClassProperty3.errors.txt +++ b/tests/baselines/reference/decoratorOnClassProperty3.errors.txt @@ -1,4 +1,4 @@ -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,12): error TS1005: ';' expected. ==== tests/cases/conformance/decorators/class/property/decoratorOnClassProperty3.ts (1 errors) ==== @@ -6,6 +6,6 @@ tests/cases/conformance/decorators/class/property/decoratorOnClassProperty3.ts(4 class C { public @dec prop; - ~~~~~~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. + ~ +!!! error TS1005: ';' expected. } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassProperty6.symbols b/tests/baselines/reference/decoratorOnClassProperty6.symbols new file mode 100644 index 00000000000..7b9857e0a19 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassProperty6.symbols @@ -0,0 +1,13 @@ +=== tests/cases/conformance/decorators/class/property/decoratorOnClassProperty6.ts === +declare function dec(target: Function): void; +>dec : Symbol(dec, Decl(decoratorOnClassProperty6.ts, 0, 0)) +>target : Symbol(target, Decl(decoratorOnClassProperty6.ts, 0, 21)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassProperty6.ts, 0, 45)) + + @dec prop; +>dec : Symbol(dec, Decl(decoratorOnClassProperty6.ts, 0, 0)) +>prop : Symbol(prop, Decl(decoratorOnClassProperty6.ts, 2, 9)) +} diff --git a/tests/baselines/reference/decoratorOnClassProperty6.types b/tests/baselines/reference/decoratorOnClassProperty6.types index 2c8c41abf78..59d03678330 100644 --- a/tests/baselines/reference/decoratorOnClassProperty6.types +++ b/tests/baselines/reference/decoratorOnClassProperty6.types @@ -8,6 +8,6 @@ class C { >C : C @dec prop; ->dec : unknown +>dec : (target: Function) => void >prop : any } diff --git a/tests/baselines/reference/decrementOperatorWithAnyOtherType.symbols b/tests/baselines/reference/decrementOperatorWithAnyOtherType.symbols new file mode 100644 index 00000000000..594e6d50ac4 --- /dev/null +++ b/tests/baselines/reference/decrementOperatorWithAnyOtherType.symbols @@ -0,0 +1,154 @@ +=== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherType.ts === +// -- operator on any type + +var ANY: any; +>ANY : Symbol(ANY, Decl(decrementOperatorWithAnyOtherType.ts, 2, 3)) + +var ANY1; +>ANY1 : Symbol(ANY1, Decl(decrementOperatorWithAnyOtherType.ts, 3, 3)) + +var ANY2: any[] = ["", ""]; +>ANY2 : Symbol(ANY2, Decl(decrementOperatorWithAnyOtherType.ts, 4, 3)) + +var obj = {x:1,y:null}; +>obj : Symbol(obj, Decl(decrementOperatorWithAnyOtherType.ts, 5, 3)) +>x : Symbol(x, Decl(decrementOperatorWithAnyOtherType.ts, 5, 11)) +>y : Symbol(y, Decl(decrementOperatorWithAnyOtherType.ts, 5, 15)) + +class A { +>A : Symbol(A, Decl(decrementOperatorWithAnyOtherType.ts, 5, 23)) + + public a: any; +>a : Symbol(a, Decl(decrementOperatorWithAnyOtherType.ts, 6, 9)) +} +module M { +>M : Symbol(M, Decl(decrementOperatorWithAnyOtherType.ts, 8, 1)) + + export var n: any; +>n : Symbol(n, Decl(decrementOperatorWithAnyOtherType.ts, 10, 14)) +} +var objA = new A(); +>objA : Symbol(objA, Decl(decrementOperatorWithAnyOtherType.ts, 12, 3)) +>A : Symbol(A, Decl(decrementOperatorWithAnyOtherType.ts, 5, 23)) + +// any type var +var ResultIsNumber1 = --ANY; +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(decrementOperatorWithAnyOtherType.ts, 15, 3)) +>ANY : Symbol(ANY, Decl(decrementOperatorWithAnyOtherType.ts, 2, 3)) + +var ResultIsNumber2 = --ANY1; +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(decrementOperatorWithAnyOtherType.ts, 16, 3)) +>ANY1 : Symbol(ANY1, Decl(decrementOperatorWithAnyOtherType.ts, 3, 3)) + +var ResultIsNumber3 = ANY1--; +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(decrementOperatorWithAnyOtherType.ts, 18, 3)) +>ANY1 : Symbol(ANY1, Decl(decrementOperatorWithAnyOtherType.ts, 3, 3)) + +var ResultIsNumber4 = ANY1--; +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(decrementOperatorWithAnyOtherType.ts, 19, 3)) +>ANY1 : Symbol(ANY1, Decl(decrementOperatorWithAnyOtherType.ts, 3, 3)) + +// expressions +var ResultIsNumber5 = --ANY2[0]; +>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(decrementOperatorWithAnyOtherType.ts, 22, 3)) +>ANY2 : Symbol(ANY2, Decl(decrementOperatorWithAnyOtherType.ts, 4, 3)) + +var ResultIsNumber6 = --obj.x; +>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(decrementOperatorWithAnyOtherType.ts, 23, 3)) +>obj.x : Symbol(x, Decl(decrementOperatorWithAnyOtherType.ts, 5, 11)) +>obj : Symbol(obj, Decl(decrementOperatorWithAnyOtherType.ts, 5, 3)) +>x : Symbol(x, Decl(decrementOperatorWithAnyOtherType.ts, 5, 11)) + +var ResultIsNumber7 = --obj.y; +>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(decrementOperatorWithAnyOtherType.ts, 24, 3)) +>obj.y : Symbol(y, Decl(decrementOperatorWithAnyOtherType.ts, 5, 15)) +>obj : Symbol(obj, Decl(decrementOperatorWithAnyOtherType.ts, 5, 3)) +>y : Symbol(y, Decl(decrementOperatorWithAnyOtherType.ts, 5, 15)) + +var ResultIsNumber8 = --objA.a; +>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(decrementOperatorWithAnyOtherType.ts, 25, 3)) +>objA.a : Symbol(A.a, Decl(decrementOperatorWithAnyOtherType.ts, 6, 9)) +>objA : Symbol(objA, Decl(decrementOperatorWithAnyOtherType.ts, 12, 3)) +>a : Symbol(A.a, Decl(decrementOperatorWithAnyOtherType.ts, 6, 9)) + +var ResultIsNumber = --M.n; +>ResultIsNumber : Symbol(ResultIsNumber, Decl(decrementOperatorWithAnyOtherType.ts, 26, 3)) +>M.n : Symbol(M.n, Decl(decrementOperatorWithAnyOtherType.ts, 10, 14)) +>M : Symbol(M, Decl(decrementOperatorWithAnyOtherType.ts, 8, 1)) +>n : Symbol(M.n, Decl(decrementOperatorWithAnyOtherType.ts, 10, 14)) + +var ResultIsNumber9 = ANY2[0]--; +>ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(decrementOperatorWithAnyOtherType.ts, 28, 3)) +>ANY2 : Symbol(ANY2, Decl(decrementOperatorWithAnyOtherType.ts, 4, 3)) + +var ResultIsNumber10 = obj.x--; +>ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(decrementOperatorWithAnyOtherType.ts, 29, 3)) +>obj.x : Symbol(x, Decl(decrementOperatorWithAnyOtherType.ts, 5, 11)) +>obj : Symbol(obj, Decl(decrementOperatorWithAnyOtherType.ts, 5, 3)) +>x : Symbol(x, Decl(decrementOperatorWithAnyOtherType.ts, 5, 11)) + +var ResultIsNumber11 = obj.y--; +>ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(decrementOperatorWithAnyOtherType.ts, 30, 3)) +>obj.y : Symbol(y, Decl(decrementOperatorWithAnyOtherType.ts, 5, 15)) +>obj : Symbol(obj, Decl(decrementOperatorWithAnyOtherType.ts, 5, 3)) +>y : Symbol(y, Decl(decrementOperatorWithAnyOtherType.ts, 5, 15)) + +var ResultIsNumber12 = objA.a--; +>ResultIsNumber12 : Symbol(ResultIsNumber12, Decl(decrementOperatorWithAnyOtherType.ts, 31, 3)) +>objA.a : Symbol(A.a, Decl(decrementOperatorWithAnyOtherType.ts, 6, 9)) +>objA : Symbol(objA, Decl(decrementOperatorWithAnyOtherType.ts, 12, 3)) +>a : Symbol(A.a, Decl(decrementOperatorWithAnyOtherType.ts, 6, 9)) + +var ResultIsNumber13 = M.n--; +>ResultIsNumber13 : Symbol(ResultIsNumber13, Decl(decrementOperatorWithAnyOtherType.ts, 32, 3)) +>M.n : Symbol(M.n, Decl(decrementOperatorWithAnyOtherType.ts, 10, 14)) +>M : Symbol(M, Decl(decrementOperatorWithAnyOtherType.ts, 8, 1)) +>n : Symbol(M.n, Decl(decrementOperatorWithAnyOtherType.ts, 10, 14)) + +// miss assignment opertors +--ANY; +>ANY : Symbol(ANY, Decl(decrementOperatorWithAnyOtherType.ts, 2, 3)) + +--ANY1; +>ANY1 : Symbol(ANY1, Decl(decrementOperatorWithAnyOtherType.ts, 3, 3)) + +--ANY2[0]; +>ANY2 : Symbol(ANY2, Decl(decrementOperatorWithAnyOtherType.ts, 4, 3)) + +--ANY, --ANY1; +>ANY : Symbol(ANY, Decl(decrementOperatorWithAnyOtherType.ts, 2, 3)) +>ANY1 : Symbol(ANY1, Decl(decrementOperatorWithAnyOtherType.ts, 3, 3)) + +--objA.a; +>objA.a : Symbol(A.a, Decl(decrementOperatorWithAnyOtherType.ts, 6, 9)) +>objA : Symbol(objA, Decl(decrementOperatorWithAnyOtherType.ts, 12, 3)) +>a : Symbol(A.a, Decl(decrementOperatorWithAnyOtherType.ts, 6, 9)) + +--M.n; +>M.n : Symbol(M.n, Decl(decrementOperatorWithAnyOtherType.ts, 10, 14)) +>M : Symbol(M, Decl(decrementOperatorWithAnyOtherType.ts, 8, 1)) +>n : Symbol(M.n, Decl(decrementOperatorWithAnyOtherType.ts, 10, 14)) + +ANY--; +>ANY : Symbol(ANY, Decl(decrementOperatorWithAnyOtherType.ts, 2, 3)) + +ANY1--; +>ANY1 : Symbol(ANY1, Decl(decrementOperatorWithAnyOtherType.ts, 3, 3)) + +ANY2[0]--; +>ANY2 : Symbol(ANY2, Decl(decrementOperatorWithAnyOtherType.ts, 4, 3)) + +ANY--, ANY1--; +>ANY : Symbol(ANY, Decl(decrementOperatorWithAnyOtherType.ts, 2, 3)) +>ANY1 : Symbol(ANY1, Decl(decrementOperatorWithAnyOtherType.ts, 3, 3)) + +objA.a--; +>objA.a : Symbol(A.a, Decl(decrementOperatorWithAnyOtherType.ts, 6, 9)) +>objA : Symbol(objA, Decl(decrementOperatorWithAnyOtherType.ts, 12, 3)) +>a : Symbol(A.a, Decl(decrementOperatorWithAnyOtherType.ts, 6, 9)) + +M.n--; +>M.n : Symbol(M.n, Decl(decrementOperatorWithAnyOtherType.ts, 10, 14)) +>M : Symbol(M, Decl(decrementOperatorWithAnyOtherType.ts, 8, 1)) +>n : Symbol(M.n, Decl(decrementOperatorWithAnyOtherType.ts, 10, 14)) + diff --git a/tests/baselines/reference/decrementOperatorWithAnyOtherType.types b/tests/baselines/reference/decrementOperatorWithAnyOtherType.types index ab21dd9db5c..65eea6d1a71 100644 --- a/tests/baselines/reference/decrementOperatorWithAnyOtherType.types +++ b/tests/baselines/reference/decrementOperatorWithAnyOtherType.types @@ -10,12 +10,16 @@ var ANY1; var ANY2: any[] = ["", ""]; >ANY2 : any[] >["", ""] : string[] +>"" : string +>"" : string var obj = {x:1,y:null}; >obj : { x: number; y: any; } >{x:1,y:null} : { x: number; y: null; } >x : number +>1 : number >y : null +>null : null class A { >A : A @@ -61,6 +65,7 @@ var ResultIsNumber5 = --ANY2[0]; >--ANY2[0] : number >ANY2[0] : any >ANY2 : any[] +>0 : number var ResultIsNumber6 = --obj.x; >ResultIsNumber6 : number @@ -95,6 +100,7 @@ var ResultIsNumber9 = ANY2[0]--; >ANY2[0]-- : number >ANY2[0] : any >ANY2 : any[] +>0 : number var ResultIsNumber10 = obj.x--; >ResultIsNumber10 : number @@ -137,6 +143,7 @@ var ResultIsNumber13 = M.n--; >--ANY2[0] : number >ANY2[0] : any >ANY2 : any[] +>0 : number --ANY, --ANY1; >--ANY, --ANY1 : number @@ -169,6 +176,7 @@ ANY2[0]--; >ANY2[0]-- : number >ANY2[0] : any >ANY2 : any[] +>0 : number ANY--, ANY1--; >ANY--, ANY1-- : number diff --git a/tests/baselines/reference/decrementOperatorWithNumberType.symbols b/tests/baselines/reference/decrementOperatorWithNumberType.symbols new file mode 100644 index 00000000000..40d9a67735e --- /dev/null +++ b/tests/baselines/reference/decrementOperatorWithNumberType.symbols @@ -0,0 +1,112 @@ +=== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithNumberType.ts === +// -- operator on number type +var NUMBER: number; +>NUMBER : Symbol(NUMBER, Decl(decrementOperatorWithNumberType.ts, 1, 3)) + +var NUMBER1: number[] = [1, 2]; +>NUMBER1 : Symbol(NUMBER1, Decl(decrementOperatorWithNumberType.ts, 2, 3)) + +class A { +>A : Symbol(A, Decl(decrementOperatorWithNumberType.ts, 2, 31)) + + public a: number; +>a : Symbol(a, Decl(decrementOperatorWithNumberType.ts, 4, 9)) +} +module M { +>M : Symbol(M, Decl(decrementOperatorWithNumberType.ts, 6, 1)) + + export var n: number; +>n : Symbol(n, Decl(decrementOperatorWithNumberType.ts, 8, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(decrementOperatorWithNumberType.ts, 11, 3)) +>A : Symbol(A, Decl(decrementOperatorWithNumberType.ts, 2, 31)) + +// number type var +var ResultIsNumber1 = --NUMBER; +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(decrementOperatorWithNumberType.ts, 14, 3)) +>NUMBER : Symbol(NUMBER, Decl(decrementOperatorWithNumberType.ts, 1, 3)) + +var ResultIsNumber2 = NUMBER--; +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(decrementOperatorWithNumberType.ts, 16, 3)) +>NUMBER : Symbol(NUMBER, Decl(decrementOperatorWithNumberType.ts, 1, 3)) + +// expressions +var ResultIsNumber3 = --objA.a; +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(decrementOperatorWithNumberType.ts, 19, 3)) +>objA.a : Symbol(A.a, Decl(decrementOperatorWithNumberType.ts, 4, 9)) +>objA : Symbol(objA, Decl(decrementOperatorWithNumberType.ts, 11, 3)) +>a : Symbol(A.a, Decl(decrementOperatorWithNumberType.ts, 4, 9)) + +var ResultIsNumber4 = --M.n; +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(decrementOperatorWithNumberType.ts, 20, 3)) +>M.n : Symbol(M.n, Decl(decrementOperatorWithNumberType.ts, 8, 14)) +>M : Symbol(M, Decl(decrementOperatorWithNumberType.ts, 6, 1)) +>n : Symbol(M.n, Decl(decrementOperatorWithNumberType.ts, 8, 14)) + +var ResultIsNumber5 = objA.a--; +>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(decrementOperatorWithNumberType.ts, 22, 3)) +>objA.a : Symbol(A.a, Decl(decrementOperatorWithNumberType.ts, 4, 9)) +>objA : Symbol(objA, Decl(decrementOperatorWithNumberType.ts, 11, 3)) +>a : Symbol(A.a, Decl(decrementOperatorWithNumberType.ts, 4, 9)) + +var ResultIsNumber6 = M.n--; +>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(decrementOperatorWithNumberType.ts, 23, 3)) +>M.n : Symbol(M.n, Decl(decrementOperatorWithNumberType.ts, 8, 14)) +>M : Symbol(M, Decl(decrementOperatorWithNumberType.ts, 6, 1)) +>n : Symbol(M.n, Decl(decrementOperatorWithNumberType.ts, 8, 14)) + +var ResultIsNumber7 = NUMBER1[0]--; +>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(decrementOperatorWithNumberType.ts, 24, 3)) +>NUMBER1 : Symbol(NUMBER1, Decl(decrementOperatorWithNumberType.ts, 2, 3)) + +// miss assignment operators +--NUMBER; +>NUMBER : Symbol(NUMBER, Decl(decrementOperatorWithNumberType.ts, 1, 3)) + +--NUMBER1[0]; +>NUMBER1 : Symbol(NUMBER1, Decl(decrementOperatorWithNumberType.ts, 2, 3)) + +--objA.a; +>objA.a : Symbol(A.a, Decl(decrementOperatorWithNumberType.ts, 4, 9)) +>objA : Symbol(objA, Decl(decrementOperatorWithNumberType.ts, 11, 3)) +>a : Symbol(A.a, Decl(decrementOperatorWithNumberType.ts, 4, 9)) + +--M.n; +>M.n : Symbol(M.n, Decl(decrementOperatorWithNumberType.ts, 8, 14)) +>M : Symbol(M, Decl(decrementOperatorWithNumberType.ts, 6, 1)) +>n : Symbol(M.n, Decl(decrementOperatorWithNumberType.ts, 8, 14)) + +--objA.a, M.n; +>objA.a : Symbol(A.a, Decl(decrementOperatorWithNumberType.ts, 4, 9)) +>objA : Symbol(objA, Decl(decrementOperatorWithNumberType.ts, 11, 3)) +>a : Symbol(A.a, Decl(decrementOperatorWithNumberType.ts, 4, 9)) +>M.n : Symbol(M.n, Decl(decrementOperatorWithNumberType.ts, 8, 14)) +>M : Symbol(M, Decl(decrementOperatorWithNumberType.ts, 6, 1)) +>n : Symbol(M.n, Decl(decrementOperatorWithNumberType.ts, 8, 14)) + +NUMBER--; +>NUMBER : Symbol(NUMBER, Decl(decrementOperatorWithNumberType.ts, 1, 3)) + +NUMBER1[0]--; +>NUMBER1 : Symbol(NUMBER1, Decl(decrementOperatorWithNumberType.ts, 2, 3)) + +objA.a--; +>objA.a : Symbol(A.a, Decl(decrementOperatorWithNumberType.ts, 4, 9)) +>objA : Symbol(objA, Decl(decrementOperatorWithNumberType.ts, 11, 3)) +>a : Symbol(A.a, Decl(decrementOperatorWithNumberType.ts, 4, 9)) + +M.n--; +>M.n : Symbol(M.n, Decl(decrementOperatorWithNumberType.ts, 8, 14)) +>M : Symbol(M, Decl(decrementOperatorWithNumberType.ts, 6, 1)) +>n : Symbol(M.n, Decl(decrementOperatorWithNumberType.ts, 8, 14)) + +objA.a--, M.n--; +>objA.a : Symbol(A.a, Decl(decrementOperatorWithNumberType.ts, 4, 9)) +>objA : Symbol(objA, Decl(decrementOperatorWithNumberType.ts, 11, 3)) +>a : Symbol(A.a, Decl(decrementOperatorWithNumberType.ts, 4, 9)) +>M.n : Symbol(M.n, Decl(decrementOperatorWithNumberType.ts, 8, 14)) +>M : Symbol(M, Decl(decrementOperatorWithNumberType.ts, 6, 1)) +>n : Symbol(M.n, Decl(decrementOperatorWithNumberType.ts, 8, 14)) + diff --git a/tests/baselines/reference/decrementOperatorWithNumberType.types b/tests/baselines/reference/decrementOperatorWithNumberType.types index d619db84e46..f990ad18fc7 100644 --- a/tests/baselines/reference/decrementOperatorWithNumberType.types +++ b/tests/baselines/reference/decrementOperatorWithNumberType.types @@ -6,6 +6,8 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] +>1 : number +>2 : number class A { >A : A @@ -70,6 +72,7 @@ var ResultIsNumber7 = NUMBER1[0]--; >NUMBER1[0]-- : number >NUMBER1[0] : number >NUMBER1 : number[] +>0 : number // miss assignment operators --NUMBER; @@ -80,6 +83,7 @@ var ResultIsNumber7 = NUMBER1[0]--; >--NUMBER1[0] : number >NUMBER1[0] : number >NUMBER1 : number[] +>0 : number --objA.a; >--objA.a : number @@ -111,6 +115,7 @@ NUMBER1[0]--; >NUMBER1[0]-- : number >NUMBER1[0] : number >NUMBER1 : number[] +>0 : number objA.a--; >objA.a-- : number diff --git a/tests/baselines/reference/defaultIndexProps1.symbols b/tests/baselines/reference/defaultIndexProps1.symbols new file mode 100644 index 00000000000..e294b9e7dba --- /dev/null +++ b/tests/baselines/reference/defaultIndexProps1.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/defaultIndexProps1.ts === +class Foo { +>Foo : Symbol(Foo, Decl(defaultIndexProps1.ts, 0, 0)) + + public v = "Yo"; +>v : Symbol(v, Decl(defaultIndexProps1.ts, 0, 11)) +} + +var f = new Foo(); +>f : Symbol(f, Decl(defaultIndexProps1.ts, 4, 3)) +>Foo : Symbol(Foo, Decl(defaultIndexProps1.ts, 0, 0)) + +var q = f["v"]; +>q : Symbol(q, Decl(defaultIndexProps1.ts, 6, 3)) +>f : Symbol(f, Decl(defaultIndexProps1.ts, 4, 3)) +>"v" : Symbol(Foo.v, Decl(defaultIndexProps1.ts, 0, 11)) + +var o = {v:"Yo2"}; +>o : Symbol(o, Decl(defaultIndexProps1.ts, 8, 3)) +>v : Symbol(v, Decl(defaultIndexProps1.ts, 8, 9)) + +var q2 = o["v"]; +>q2 : Symbol(q2, Decl(defaultIndexProps1.ts, 10, 3)) +>o : Symbol(o, Decl(defaultIndexProps1.ts, 8, 3)) +>"v" : Symbol(v, Decl(defaultIndexProps1.ts, 8, 9)) + diff --git a/tests/baselines/reference/defaultIndexProps1.types b/tests/baselines/reference/defaultIndexProps1.types index 9bb9c4a32c2..0b188a40c20 100644 --- a/tests/baselines/reference/defaultIndexProps1.types +++ b/tests/baselines/reference/defaultIndexProps1.types @@ -4,6 +4,7 @@ class Foo { public v = "Yo"; >v : string +>"Yo" : string } var f = new Foo(); @@ -15,14 +16,17 @@ var q = f["v"]; >q : string >f["v"] : string >f : Foo +>"v" : string var o = {v:"Yo2"}; >o : { v: string; } >{v:"Yo2"} : { v: string; } >v : string +>"Yo2" : string var q2 = o["v"]; >q2 : string >o["v"] : string >o : { v: string; } +>"v" : string diff --git a/tests/baselines/reference/defaultIndexProps2.symbols b/tests/baselines/reference/defaultIndexProps2.symbols new file mode 100644 index 00000000000..53d433351c3 --- /dev/null +++ b/tests/baselines/reference/defaultIndexProps2.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/defaultIndexProps2.ts === +class Foo { +>Foo : Symbol(Foo, Decl(defaultIndexProps2.ts, 0, 0)) + + public v = "Yo"; +>v : Symbol(v, Decl(defaultIndexProps2.ts, 0, 11)) +} + +var f = new Foo(); +>f : Symbol(f, Decl(defaultIndexProps2.ts, 4, 3)) +>Foo : Symbol(Foo, Decl(defaultIndexProps2.ts, 0, 0)) + +// WScript.Echo(f[0]); + +var o = {v:"Yo2"}; +>o : Symbol(o, Decl(defaultIndexProps2.ts, 8, 3)) +>v : Symbol(v, Decl(defaultIndexProps2.ts, 8, 9)) + +// WScript.Echo(o[0]); + +1[0]; +var q = "s"[0]; +>q : Symbol(q, Decl(defaultIndexProps2.ts, 13, 3)) + diff --git a/tests/baselines/reference/defaultIndexProps2.types b/tests/baselines/reference/defaultIndexProps2.types index 26850bd1456..3b0d8278966 100644 --- a/tests/baselines/reference/defaultIndexProps2.types +++ b/tests/baselines/reference/defaultIndexProps2.types @@ -4,6 +4,7 @@ class Foo { public v = "Yo"; >v : string +>"Yo" : string } var f = new Foo(); @@ -17,13 +18,18 @@ var o = {v:"Yo2"}; >o : { v: string; } >{v:"Yo2"} : { v: string; } >v : string +>"Yo2" : string // WScript.Echo(o[0]); 1[0]; >1[0] : any +>1 : number +>0 : number var q = "s"[0]; >q : string >"s"[0] : string +>"s" : string +>0 : number diff --git a/tests/baselines/reference/deleteOperatorWithBooleanType.symbols b/tests/baselines/reference/deleteOperatorWithBooleanType.symbols new file mode 100644 index 00000000000..71cb78760f6 --- /dev/null +++ b/tests/baselines/reference/deleteOperatorWithBooleanType.symbols @@ -0,0 +1,89 @@ +=== tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithBooleanType.ts === +// delete operator on boolean type +var BOOLEAN: boolean; +>BOOLEAN : Symbol(BOOLEAN, Decl(deleteOperatorWithBooleanType.ts, 1, 3)) + +function foo(): boolean { return true; } +>foo : Symbol(foo, Decl(deleteOperatorWithBooleanType.ts, 1, 21)) + +class A { +>A : Symbol(A, Decl(deleteOperatorWithBooleanType.ts, 3, 40)) + + public a: boolean; +>a : Symbol(a, Decl(deleteOperatorWithBooleanType.ts, 5, 9)) + + static foo() { return false; } +>foo : Symbol(A.foo, Decl(deleteOperatorWithBooleanType.ts, 6, 22)) +} +module M { +>M : Symbol(M, Decl(deleteOperatorWithBooleanType.ts, 8, 1)) + + export var n: boolean; +>n : Symbol(n, Decl(deleteOperatorWithBooleanType.ts, 10, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(deleteOperatorWithBooleanType.ts, 13, 3)) +>A : Symbol(A, Decl(deleteOperatorWithBooleanType.ts, 3, 40)) + +// boolean type var +var ResultIsBoolean1 = delete BOOLEAN; +>ResultIsBoolean1 : Symbol(ResultIsBoolean1, Decl(deleteOperatorWithBooleanType.ts, 16, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(deleteOperatorWithBooleanType.ts, 1, 3)) + +// boolean type literal +var ResultIsBoolean2 = delete true; +>ResultIsBoolean2 : Symbol(ResultIsBoolean2, Decl(deleteOperatorWithBooleanType.ts, 19, 3)) + +var ResultIsBoolean3 = delete { x: true, y: false }; +>ResultIsBoolean3 : Symbol(ResultIsBoolean3, Decl(deleteOperatorWithBooleanType.ts, 20, 3)) +>x : Symbol(x, Decl(deleteOperatorWithBooleanType.ts, 20, 31)) +>y : Symbol(y, Decl(deleteOperatorWithBooleanType.ts, 20, 40)) + +// boolean type expressions +var ResultIsBoolean4 = delete objA.a; +>ResultIsBoolean4 : Symbol(ResultIsBoolean4, Decl(deleteOperatorWithBooleanType.ts, 23, 3)) +>objA.a : Symbol(A.a, Decl(deleteOperatorWithBooleanType.ts, 5, 9)) +>objA : Symbol(objA, Decl(deleteOperatorWithBooleanType.ts, 13, 3)) +>a : Symbol(A.a, Decl(deleteOperatorWithBooleanType.ts, 5, 9)) + +var ResultIsBoolean5 = delete M.n; +>ResultIsBoolean5 : Symbol(ResultIsBoolean5, Decl(deleteOperatorWithBooleanType.ts, 24, 3)) +>M.n : Symbol(M.n, Decl(deleteOperatorWithBooleanType.ts, 10, 14)) +>M : Symbol(M, Decl(deleteOperatorWithBooleanType.ts, 8, 1)) +>n : Symbol(M.n, Decl(deleteOperatorWithBooleanType.ts, 10, 14)) + +var ResultIsBoolean6 = delete foo(); +>ResultIsBoolean6 : Symbol(ResultIsBoolean6, Decl(deleteOperatorWithBooleanType.ts, 25, 3)) +>foo : Symbol(foo, Decl(deleteOperatorWithBooleanType.ts, 1, 21)) + +var ResultIsBoolean7 = delete A.foo(); +>ResultIsBoolean7 : Symbol(ResultIsBoolean7, Decl(deleteOperatorWithBooleanType.ts, 26, 3)) +>A.foo : Symbol(A.foo, Decl(deleteOperatorWithBooleanType.ts, 6, 22)) +>A : Symbol(A, Decl(deleteOperatorWithBooleanType.ts, 3, 40)) +>foo : Symbol(A.foo, Decl(deleteOperatorWithBooleanType.ts, 6, 22)) + +// multiple delete operator +var ResultIsBoolean8 = delete delete BOOLEAN; +>ResultIsBoolean8 : Symbol(ResultIsBoolean8, Decl(deleteOperatorWithBooleanType.ts, 29, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(deleteOperatorWithBooleanType.ts, 1, 3)) + +// miss assignment operators +delete true; +delete BOOLEAN; +>BOOLEAN : Symbol(BOOLEAN, Decl(deleteOperatorWithBooleanType.ts, 1, 3)) + +delete foo(); +>foo : Symbol(foo, Decl(deleteOperatorWithBooleanType.ts, 1, 21)) + +delete true, false; +delete objA.a; +>objA.a : Symbol(A.a, Decl(deleteOperatorWithBooleanType.ts, 5, 9)) +>objA : Symbol(objA, Decl(deleteOperatorWithBooleanType.ts, 13, 3)) +>a : Symbol(A.a, Decl(deleteOperatorWithBooleanType.ts, 5, 9)) + +delete M.n; +>M.n : Symbol(M.n, Decl(deleteOperatorWithBooleanType.ts, 10, 14)) +>M : Symbol(M, Decl(deleteOperatorWithBooleanType.ts, 8, 1)) +>n : Symbol(M.n, Decl(deleteOperatorWithBooleanType.ts, 10, 14)) + diff --git a/tests/baselines/reference/deleteOperatorWithBooleanType.types b/tests/baselines/reference/deleteOperatorWithBooleanType.types index fa8c375b0a5..068c67031ef 100644 --- a/tests/baselines/reference/deleteOperatorWithBooleanType.types +++ b/tests/baselines/reference/deleteOperatorWithBooleanType.types @@ -5,6 +5,7 @@ var BOOLEAN: boolean; function foo(): boolean { return true; } >foo : () => boolean +>true : boolean class A { >A : A @@ -14,6 +15,7 @@ class A { static foo() { return false; } >foo : () => boolean +>false : boolean } module M { >M : typeof M @@ -37,13 +39,16 @@ var ResultIsBoolean1 = delete BOOLEAN; var ResultIsBoolean2 = delete true; >ResultIsBoolean2 : boolean >delete true : boolean +>true : boolean var ResultIsBoolean3 = delete { x: true, y: false }; >ResultIsBoolean3 : boolean >delete { x: true, y: false } : boolean >{ x: true, y: false } : { x: boolean; y: boolean; } >x : boolean +>true : boolean >y : boolean +>false : boolean // boolean type expressions var ResultIsBoolean4 = delete objA.a; @@ -84,6 +89,7 @@ var ResultIsBoolean8 = delete delete BOOLEAN; // miss assignment operators delete true; >delete true : boolean +>true : boolean delete BOOLEAN; >delete BOOLEAN : boolean @@ -97,6 +103,8 @@ delete foo(); delete true, false; >delete true, false : boolean >delete true : boolean +>true : boolean +>false : boolean delete objA.a; >delete objA.a : boolean diff --git a/tests/baselines/reference/deleteOperatorWithEnumType.symbols b/tests/baselines/reference/deleteOperatorWithEnumType.symbols new file mode 100644 index 00000000000..bdef75325da --- /dev/null +++ b/tests/baselines/reference/deleteOperatorWithEnumType.symbols @@ -0,0 +1,59 @@ +=== tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithEnumType.ts === +// delete operator on enum type + +enum ENUM { }; +>ENUM : Symbol(ENUM, Decl(deleteOperatorWithEnumType.ts, 0, 0)) + +enum ENUM1 { A, B, "" }; +>ENUM1 : Symbol(ENUM1, Decl(deleteOperatorWithEnumType.ts, 2, 14)) +>A : Symbol(ENUM1.A, Decl(deleteOperatorWithEnumType.ts, 3, 12)) +>B : Symbol(ENUM1.B, Decl(deleteOperatorWithEnumType.ts, 3, 15)) + +// enum type var +var ResultIsBoolean1 = delete ENUM; +>ResultIsBoolean1 : Symbol(ResultIsBoolean1, Decl(deleteOperatorWithEnumType.ts, 6, 3)) +>ENUM : Symbol(ENUM, Decl(deleteOperatorWithEnumType.ts, 0, 0)) + +var ResultIsBoolean2 = delete ENUM1; +>ResultIsBoolean2 : Symbol(ResultIsBoolean2, Decl(deleteOperatorWithEnumType.ts, 7, 3)) +>ENUM1 : Symbol(ENUM1, Decl(deleteOperatorWithEnumType.ts, 2, 14)) + +// enum type expressions +var ResultIsBoolean3 = delete ENUM1["A"]; +>ResultIsBoolean3 : Symbol(ResultIsBoolean3, Decl(deleteOperatorWithEnumType.ts, 10, 3)) +>ENUM1 : Symbol(ENUM1, Decl(deleteOperatorWithEnumType.ts, 2, 14)) +>"A" : Symbol(ENUM1.A, Decl(deleteOperatorWithEnumType.ts, 3, 12)) + +var ResultIsBoolean4 = delete (ENUM[0] + ENUM1["B"]); +>ResultIsBoolean4 : Symbol(ResultIsBoolean4, Decl(deleteOperatorWithEnumType.ts, 11, 3)) +>ENUM : Symbol(ENUM, Decl(deleteOperatorWithEnumType.ts, 0, 0)) +>ENUM1 : Symbol(ENUM1, Decl(deleteOperatorWithEnumType.ts, 2, 14)) +>"B" : Symbol(ENUM1.B, Decl(deleteOperatorWithEnumType.ts, 3, 15)) + +// multiple delete operators +var ResultIsBoolean5 = delete delete ENUM; +>ResultIsBoolean5 : Symbol(ResultIsBoolean5, Decl(deleteOperatorWithEnumType.ts, 14, 3)) +>ENUM : Symbol(ENUM, Decl(deleteOperatorWithEnumType.ts, 0, 0)) + +var ResultIsBoolean6 = delete delete delete (ENUM[0] + ENUM1["B"]); +>ResultIsBoolean6 : Symbol(ResultIsBoolean6, Decl(deleteOperatorWithEnumType.ts, 15, 3)) +>ENUM : Symbol(ENUM, Decl(deleteOperatorWithEnumType.ts, 0, 0)) +>ENUM1 : Symbol(ENUM1, Decl(deleteOperatorWithEnumType.ts, 2, 14)) +>"B" : Symbol(ENUM1.B, Decl(deleteOperatorWithEnumType.ts, 3, 15)) + +// miss assignment operators +delete ENUM; +>ENUM : Symbol(ENUM, Decl(deleteOperatorWithEnumType.ts, 0, 0)) + +delete ENUM1; +>ENUM1 : Symbol(ENUM1, Decl(deleteOperatorWithEnumType.ts, 2, 14)) + +delete ENUM1.B; +>ENUM1.B : Symbol(ENUM1.B, Decl(deleteOperatorWithEnumType.ts, 3, 15)) +>ENUM1 : Symbol(ENUM1, Decl(deleteOperatorWithEnumType.ts, 2, 14)) +>B : Symbol(ENUM1.B, Decl(deleteOperatorWithEnumType.ts, 3, 15)) + +delete ENUM, ENUM1; +>ENUM : Symbol(ENUM, Decl(deleteOperatorWithEnumType.ts, 0, 0)) +>ENUM1 : Symbol(ENUM1, Decl(deleteOperatorWithEnumType.ts, 2, 14)) + diff --git a/tests/baselines/reference/deleteOperatorWithEnumType.types b/tests/baselines/reference/deleteOperatorWithEnumType.types index e436ac3373f..d3266a6aa6c 100644 --- a/tests/baselines/reference/deleteOperatorWithEnumType.types +++ b/tests/baselines/reference/deleteOperatorWithEnumType.types @@ -26,6 +26,7 @@ var ResultIsBoolean3 = delete ENUM1["A"]; >delete ENUM1["A"] : boolean >ENUM1["A"] : ENUM1 >ENUM1 : typeof ENUM1 +>"A" : string var ResultIsBoolean4 = delete (ENUM[0] + ENUM1["B"]); >ResultIsBoolean4 : boolean @@ -34,8 +35,10 @@ var ResultIsBoolean4 = delete (ENUM[0] + ENUM1["B"]); >ENUM[0] + ENUM1["B"] : string >ENUM[0] : string >ENUM : typeof ENUM +>0 : number >ENUM1["B"] : ENUM1 >ENUM1 : typeof ENUM1 +>"B" : string // multiple delete operators var ResultIsBoolean5 = delete delete ENUM; @@ -53,8 +56,10 @@ var ResultIsBoolean6 = delete delete delete (ENUM[0] + ENUM1["B"]); >ENUM[0] + ENUM1["B"] : string >ENUM[0] : string >ENUM : typeof ENUM +>0 : number >ENUM1["B"] : ENUM1 >ENUM1 : typeof ENUM1 +>"B" : string // miss assignment operators delete ENUM; diff --git a/tests/baselines/reference/deleteOperatorWithNumberType.symbols b/tests/baselines/reference/deleteOperatorWithNumberType.symbols new file mode 100644 index 00000000000..589b1f91db2 --- /dev/null +++ b/tests/baselines/reference/deleteOperatorWithNumberType.symbols @@ -0,0 +1,127 @@ +=== tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithNumberType.ts === +// delete operator on number type +var NUMBER: number; +>NUMBER : Symbol(NUMBER, Decl(deleteOperatorWithNumberType.ts, 1, 3)) + +var NUMBER1: number[] = [1, 2]; +>NUMBER1 : Symbol(NUMBER1, Decl(deleteOperatorWithNumberType.ts, 2, 3)) + +function foo(): number { return 1; } +>foo : Symbol(foo, Decl(deleteOperatorWithNumberType.ts, 2, 31)) + +class A { +>A : Symbol(A, Decl(deleteOperatorWithNumberType.ts, 4, 36)) + + public a: number; +>a : Symbol(a, Decl(deleteOperatorWithNumberType.ts, 6, 9)) + + static foo() { return 1; } +>foo : Symbol(A.foo, Decl(deleteOperatorWithNumberType.ts, 7, 21)) +} +module M { +>M : Symbol(M, Decl(deleteOperatorWithNumberType.ts, 9, 1)) + + export var n: number; +>n : Symbol(n, Decl(deleteOperatorWithNumberType.ts, 11, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(deleteOperatorWithNumberType.ts, 14, 3)) +>A : Symbol(A, Decl(deleteOperatorWithNumberType.ts, 4, 36)) + +// number type var +var ResultIsBoolean1 = delete NUMBER; +>ResultIsBoolean1 : Symbol(ResultIsBoolean1, Decl(deleteOperatorWithNumberType.ts, 17, 3)) +>NUMBER : Symbol(NUMBER, Decl(deleteOperatorWithNumberType.ts, 1, 3)) + +var ResultIsBoolean2 = delete NUMBER1; +>ResultIsBoolean2 : Symbol(ResultIsBoolean2, Decl(deleteOperatorWithNumberType.ts, 18, 3)) +>NUMBER1 : Symbol(NUMBER1, Decl(deleteOperatorWithNumberType.ts, 2, 3)) + +// number type literal +var ResultIsBoolean3 = delete 1; +>ResultIsBoolean3 : Symbol(ResultIsBoolean3, Decl(deleteOperatorWithNumberType.ts, 21, 3)) + +var ResultIsBoolean4 = delete { x: 1, y: 2}; +>ResultIsBoolean4 : Symbol(ResultIsBoolean4, Decl(deleteOperatorWithNumberType.ts, 22, 3)) +>x : Symbol(x, Decl(deleteOperatorWithNumberType.ts, 22, 31)) +>y : Symbol(y, Decl(deleteOperatorWithNumberType.ts, 22, 37)) + +var ResultIsBoolean5 = delete { x: 1, y: (n: number) => { return n; } }; +>ResultIsBoolean5 : Symbol(ResultIsBoolean5, Decl(deleteOperatorWithNumberType.ts, 23, 3)) +>x : Symbol(x, Decl(deleteOperatorWithNumberType.ts, 23, 31)) +>y : Symbol(y, Decl(deleteOperatorWithNumberType.ts, 23, 37)) +>n : Symbol(n, Decl(deleteOperatorWithNumberType.ts, 23, 42)) +>n : Symbol(n, Decl(deleteOperatorWithNumberType.ts, 23, 42)) + +// number type expressions +var ResultIsBoolean6 = delete objA.a; +>ResultIsBoolean6 : Symbol(ResultIsBoolean6, Decl(deleteOperatorWithNumberType.ts, 26, 3)) +>objA.a : Symbol(A.a, Decl(deleteOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(deleteOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(deleteOperatorWithNumberType.ts, 6, 9)) + +var ResultIsBoolean7 = delete M.n; +>ResultIsBoolean7 : Symbol(ResultIsBoolean7, Decl(deleteOperatorWithNumberType.ts, 27, 3)) +>M.n : Symbol(M.n, Decl(deleteOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(deleteOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(deleteOperatorWithNumberType.ts, 11, 14)) + +var ResultIsBoolean8 = delete NUMBER1[0]; +>ResultIsBoolean8 : Symbol(ResultIsBoolean8, Decl(deleteOperatorWithNumberType.ts, 28, 3)) +>NUMBER1 : Symbol(NUMBER1, Decl(deleteOperatorWithNumberType.ts, 2, 3)) + +var ResultIsBoolean9 = delete foo(); +>ResultIsBoolean9 : Symbol(ResultIsBoolean9, Decl(deleteOperatorWithNumberType.ts, 29, 3)) +>foo : Symbol(foo, Decl(deleteOperatorWithNumberType.ts, 2, 31)) + +var ResultIsBoolean10 = delete A.foo(); +>ResultIsBoolean10 : Symbol(ResultIsBoolean10, Decl(deleteOperatorWithNumberType.ts, 30, 3)) +>A.foo : Symbol(A.foo, Decl(deleteOperatorWithNumberType.ts, 7, 21)) +>A : Symbol(A, Decl(deleteOperatorWithNumberType.ts, 4, 36)) +>foo : Symbol(A.foo, Decl(deleteOperatorWithNumberType.ts, 7, 21)) + +var ResultIsBoolean11 = delete (NUMBER + NUMBER); +>ResultIsBoolean11 : Symbol(ResultIsBoolean11, Decl(deleteOperatorWithNumberType.ts, 31, 3)) +>NUMBER : Symbol(NUMBER, Decl(deleteOperatorWithNumberType.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(deleteOperatorWithNumberType.ts, 1, 3)) + +// multiple delete operator +var ResultIsBoolean12 = delete delete NUMBER; +>ResultIsBoolean12 : Symbol(ResultIsBoolean12, Decl(deleteOperatorWithNumberType.ts, 34, 3)) +>NUMBER : Symbol(NUMBER, Decl(deleteOperatorWithNumberType.ts, 1, 3)) + +var ResultIsBoolean13 = delete delete delete (NUMBER + NUMBER); +>ResultIsBoolean13 : Symbol(ResultIsBoolean13, Decl(deleteOperatorWithNumberType.ts, 35, 3)) +>NUMBER : Symbol(NUMBER, Decl(deleteOperatorWithNumberType.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(deleteOperatorWithNumberType.ts, 1, 3)) + +// miss assignment operators +delete 1; +delete NUMBER; +>NUMBER : Symbol(NUMBER, Decl(deleteOperatorWithNumberType.ts, 1, 3)) + +delete NUMBER1; +>NUMBER1 : Symbol(NUMBER1, Decl(deleteOperatorWithNumberType.ts, 2, 3)) + +delete foo(); +>foo : Symbol(foo, Decl(deleteOperatorWithNumberType.ts, 2, 31)) + +delete objA.a; +>objA.a : Symbol(A.a, Decl(deleteOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(deleteOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(deleteOperatorWithNumberType.ts, 6, 9)) + +delete M.n; +>M.n : Symbol(M.n, Decl(deleteOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(deleteOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(deleteOperatorWithNumberType.ts, 11, 14)) + +delete objA.a, M.n; +>objA.a : Symbol(A.a, Decl(deleteOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(deleteOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(deleteOperatorWithNumberType.ts, 6, 9)) +>M.n : Symbol(M.n, Decl(deleteOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(deleteOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(deleteOperatorWithNumberType.ts, 11, 14)) + diff --git a/tests/baselines/reference/deleteOperatorWithNumberType.types b/tests/baselines/reference/deleteOperatorWithNumberType.types index 542efe04c34..e631745d089 100644 --- a/tests/baselines/reference/deleteOperatorWithNumberType.types +++ b/tests/baselines/reference/deleteOperatorWithNumberType.types @@ -6,9 +6,12 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] +>1 : number +>2 : number function foo(): number { return 1; } >foo : () => number +>1 : number class A { >A : A @@ -18,6 +21,7 @@ class A { static foo() { return 1; } >foo : () => number +>1 : number } module M { >M : typeof M @@ -46,19 +50,23 @@ var ResultIsBoolean2 = delete NUMBER1; var ResultIsBoolean3 = delete 1; >ResultIsBoolean3 : boolean >delete 1 : boolean +>1 : number var ResultIsBoolean4 = delete { x: 1, y: 2}; >ResultIsBoolean4 : boolean >delete { x: 1, y: 2} : boolean >{ x: 1, y: 2} : { x: number; y: number; } >x : number +>1 : number >y : number +>2 : number var ResultIsBoolean5 = delete { x: 1, y: (n: number) => { return n; } }; >ResultIsBoolean5 : boolean >delete { x: 1, y: (n: number) => { return n; } } : boolean >{ x: 1, y: (n: number) => { return n; } } : { x: number; y: (n: number) => number; } >x : number +>1 : number >y : (n: number) => number >(n: number) => { return n; } : (n: number) => number >n : number @@ -84,6 +92,7 @@ var ResultIsBoolean8 = delete NUMBER1[0]; >delete NUMBER1[0] : boolean >NUMBER1[0] : number >NUMBER1 : number[] +>0 : number var ResultIsBoolean9 = delete foo(); >ResultIsBoolean9 : boolean @@ -127,6 +136,7 @@ var ResultIsBoolean13 = delete delete delete (NUMBER + NUMBER); // miss assignment operators delete 1; >delete 1 : boolean +>1 : number delete NUMBER; >delete NUMBER : boolean diff --git a/tests/baselines/reference/deleteOperatorWithStringType.symbols b/tests/baselines/reference/deleteOperatorWithStringType.symbols new file mode 100644 index 00000000000..a13ddd5fa39 --- /dev/null +++ b/tests/baselines/reference/deleteOperatorWithStringType.symbols @@ -0,0 +1,123 @@ +=== tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithStringType.ts === +// delete operator on string type +var STRING: string; +>STRING : Symbol(STRING, Decl(deleteOperatorWithStringType.ts, 1, 3)) + +var STRING1: string[] = ["", "abc"]; +>STRING1 : Symbol(STRING1, Decl(deleteOperatorWithStringType.ts, 2, 3)) + +function foo(): string { return "abc"; } +>foo : Symbol(foo, Decl(deleteOperatorWithStringType.ts, 2, 36)) + +class A { +>A : Symbol(A, Decl(deleteOperatorWithStringType.ts, 4, 40)) + + public a: string; +>a : Symbol(a, Decl(deleteOperatorWithStringType.ts, 6, 9)) + + static foo() { return ""; } +>foo : Symbol(A.foo, Decl(deleteOperatorWithStringType.ts, 7, 21)) +} +module M { +>M : Symbol(M, Decl(deleteOperatorWithStringType.ts, 9, 1)) + + export var n: string; +>n : Symbol(n, Decl(deleteOperatorWithStringType.ts, 11, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(deleteOperatorWithStringType.ts, 14, 3)) +>A : Symbol(A, Decl(deleteOperatorWithStringType.ts, 4, 40)) + +// string type var +var ResultIsBoolean1 = delete STRING; +>ResultIsBoolean1 : Symbol(ResultIsBoolean1, Decl(deleteOperatorWithStringType.ts, 17, 3)) +>STRING : Symbol(STRING, Decl(deleteOperatorWithStringType.ts, 1, 3)) + +var ResultIsBoolean2 = delete STRING1; +>ResultIsBoolean2 : Symbol(ResultIsBoolean2, Decl(deleteOperatorWithStringType.ts, 18, 3)) +>STRING1 : Symbol(STRING1, Decl(deleteOperatorWithStringType.ts, 2, 3)) + +// string type literal +var ResultIsBoolean3 = delete ""; +>ResultIsBoolean3 : Symbol(ResultIsBoolean3, Decl(deleteOperatorWithStringType.ts, 21, 3)) + +var ResultIsBoolean4 = delete { x: "", y: "" }; +>ResultIsBoolean4 : Symbol(ResultIsBoolean4, Decl(deleteOperatorWithStringType.ts, 22, 3)) +>x : Symbol(x, Decl(deleteOperatorWithStringType.ts, 22, 31)) +>y : Symbol(y, Decl(deleteOperatorWithStringType.ts, 22, 38)) + +var ResultIsBoolean5 = delete { x: "", y: (s: string) => { return s; } }; +>ResultIsBoolean5 : Symbol(ResultIsBoolean5, Decl(deleteOperatorWithStringType.ts, 23, 3)) +>x : Symbol(x, Decl(deleteOperatorWithStringType.ts, 23, 31)) +>y : Symbol(y, Decl(deleteOperatorWithStringType.ts, 23, 38)) +>s : Symbol(s, Decl(deleteOperatorWithStringType.ts, 23, 43)) +>s : Symbol(s, Decl(deleteOperatorWithStringType.ts, 23, 43)) + +// string type expressions +var ResultIsBoolean6 = delete objA.a; +>ResultIsBoolean6 : Symbol(ResultIsBoolean6, Decl(deleteOperatorWithStringType.ts, 26, 3)) +>objA.a : Symbol(A.a, Decl(deleteOperatorWithStringType.ts, 6, 9)) +>objA : Symbol(objA, Decl(deleteOperatorWithStringType.ts, 14, 3)) +>a : Symbol(A.a, Decl(deleteOperatorWithStringType.ts, 6, 9)) + +var ResultIsBoolean7 = delete M.n; +>ResultIsBoolean7 : Symbol(ResultIsBoolean7, Decl(deleteOperatorWithStringType.ts, 27, 3)) +>M.n : Symbol(M.n, Decl(deleteOperatorWithStringType.ts, 11, 14)) +>M : Symbol(M, Decl(deleteOperatorWithStringType.ts, 9, 1)) +>n : Symbol(M.n, Decl(deleteOperatorWithStringType.ts, 11, 14)) + +var ResultIsBoolean8 = delete STRING1[0]; +>ResultIsBoolean8 : Symbol(ResultIsBoolean8, Decl(deleteOperatorWithStringType.ts, 28, 3)) +>STRING1 : Symbol(STRING1, Decl(deleteOperatorWithStringType.ts, 2, 3)) + +var ResultIsBoolean9 = delete foo(); +>ResultIsBoolean9 : Symbol(ResultIsBoolean9, Decl(deleteOperatorWithStringType.ts, 29, 3)) +>foo : Symbol(foo, Decl(deleteOperatorWithStringType.ts, 2, 36)) + +var ResultIsBoolean10 = delete A.foo(); +>ResultIsBoolean10 : Symbol(ResultIsBoolean10, Decl(deleteOperatorWithStringType.ts, 30, 3)) +>A.foo : Symbol(A.foo, Decl(deleteOperatorWithStringType.ts, 7, 21)) +>A : Symbol(A, Decl(deleteOperatorWithStringType.ts, 4, 40)) +>foo : Symbol(A.foo, Decl(deleteOperatorWithStringType.ts, 7, 21)) + +var ResultIsBoolean11 = delete (STRING + STRING); +>ResultIsBoolean11 : Symbol(ResultIsBoolean11, Decl(deleteOperatorWithStringType.ts, 31, 3)) +>STRING : Symbol(STRING, Decl(deleteOperatorWithStringType.ts, 1, 3)) +>STRING : Symbol(STRING, Decl(deleteOperatorWithStringType.ts, 1, 3)) + +var ResultIsBoolean12 = delete STRING.charAt(0); +>ResultIsBoolean12 : Symbol(ResultIsBoolean12, Decl(deleteOperatorWithStringType.ts, 32, 3)) +>STRING.charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>STRING : Symbol(STRING, Decl(deleteOperatorWithStringType.ts, 1, 3)) +>charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) + +// multiple delete operator +var ResultIsBoolean13 = delete delete STRING; +>ResultIsBoolean13 : Symbol(ResultIsBoolean13, Decl(deleteOperatorWithStringType.ts, 35, 3)) +>STRING : Symbol(STRING, Decl(deleteOperatorWithStringType.ts, 1, 3)) + +var ResultIsBoolean14 = delete delete delete (STRING + STRING); +>ResultIsBoolean14 : Symbol(ResultIsBoolean14, Decl(deleteOperatorWithStringType.ts, 36, 3)) +>STRING : Symbol(STRING, Decl(deleteOperatorWithStringType.ts, 1, 3)) +>STRING : Symbol(STRING, Decl(deleteOperatorWithStringType.ts, 1, 3)) + +// miss assignment operators +delete ""; +delete STRING; +>STRING : Symbol(STRING, Decl(deleteOperatorWithStringType.ts, 1, 3)) + +delete STRING1; +>STRING1 : Symbol(STRING1, Decl(deleteOperatorWithStringType.ts, 2, 3)) + +delete foo(); +>foo : Symbol(foo, Decl(deleteOperatorWithStringType.ts, 2, 36)) + +delete objA.a,M.n; +>objA.a : Symbol(A.a, Decl(deleteOperatorWithStringType.ts, 6, 9)) +>objA : Symbol(objA, Decl(deleteOperatorWithStringType.ts, 14, 3)) +>a : Symbol(A.a, Decl(deleteOperatorWithStringType.ts, 6, 9)) +>M.n : Symbol(M.n, Decl(deleteOperatorWithStringType.ts, 11, 14)) +>M : Symbol(M, Decl(deleteOperatorWithStringType.ts, 9, 1)) +>n : Symbol(M.n, Decl(deleteOperatorWithStringType.ts, 11, 14)) + diff --git a/tests/baselines/reference/deleteOperatorWithStringType.types b/tests/baselines/reference/deleteOperatorWithStringType.types index f86afc39c49..0492aeff176 100644 --- a/tests/baselines/reference/deleteOperatorWithStringType.types +++ b/tests/baselines/reference/deleteOperatorWithStringType.types @@ -6,9 +6,12 @@ var STRING: string; var STRING1: string[] = ["", "abc"]; >STRING1 : string[] >["", "abc"] : string[] +>"" : string +>"abc" : string function foo(): string { return "abc"; } >foo : () => string +>"abc" : string class A { >A : A @@ -18,6 +21,7 @@ class A { static foo() { return ""; } >foo : () => string +>"" : string } module M { >M : typeof M @@ -46,19 +50,23 @@ var ResultIsBoolean2 = delete STRING1; var ResultIsBoolean3 = delete ""; >ResultIsBoolean3 : boolean >delete "" : boolean +>"" : string var ResultIsBoolean4 = delete { x: "", y: "" }; >ResultIsBoolean4 : boolean >delete { x: "", y: "" } : boolean >{ x: "", y: "" } : { x: string; y: string; } >x : string +>"" : string >y : string +>"" : string var ResultIsBoolean5 = delete { x: "", y: (s: string) => { return s; } }; >ResultIsBoolean5 : boolean >delete { x: "", y: (s: string) => { return s; } } : boolean >{ x: "", y: (s: string) => { return s; } } : { x: string; y: (s: string) => string; } >x : string +>"" : string >y : (s: string) => string >(s: string) => { return s; } : (s: string) => string >s : string @@ -84,6 +92,7 @@ var ResultIsBoolean8 = delete STRING1[0]; >delete STRING1[0] : boolean >STRING1[0] : string >STRING1 : string[] +>0 : number var ResultIsBoolean9 = delete foo(); >ResultIsBoolean9 : boolean @@ -114,6 +123,7 @@ var ResultIsBoolean12 = delete STRING.charAt(0); >STRING.charAt : (pos: number) => string >STRING : string >charAt : (pos: number) => string +>0 : number // multiple delete operator var ResultIsBoolean13 = delete delete STRING; @@ -135,6 +145,7 @@ var ResultIsBoolean14 = delete delete delete (STRING + STRING); // miss assignment operators delete ""; >delete "" : boolean +>"" : string delete STRING; >delete STRING : boolean diff --git a/tests/baselines/reference/dependencyViaImportAlias.symbols b/tests/baselines/reference/dependencyViaImportAlias.symbols new file mode 100644 index 00000000000..8855b8d6451 --- /dev/null +++ b/tests/baselines/reference/dependencyViaImportAlias.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/B.ts === +import a = require('A'); +>a : Symbol(a, Decl(B.ts, 0, 0)) + +import A = a.A; +>A : Symbol(A, Decl(B.ts, 0, 24)) +>a : Symbol(a, Decl(A.ts, 0, 0)) +>A : Symbol(a.A, Decl(A.ts, 0, 0)) + +export = A; +>A : Symbol(A, Decl(B.ts, 0, 24)) + +=== tests/cases/compiler/A.ts === +export class A { +>A : Symbol(A, Decl(A.ts, 0, 0)) +} diff --git a/tests/baselines/reference/deprecatedBool.symbols b/tests/baselines/reference/deprecatedBool.symbols new file mode 100644 index 00000000000..c9c27ca945a --- /dev/null +++ b/tests/baselines/reference/deprecatedBool.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/deprecatedBool.ts === +var b4: boolean; +>b4 : Symbol(b4, Decl(deprecatedBool.ts, 0, 3)) + +var bool: boolean; +>bool : Symbol(bool, Decl(deprecatedBool.ts, 1, 3)) + diff --git a/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.symbols b/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.symbols new file mode 100644 index 00000000000..dd384838694 --- /dev/null +++ b/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.symbols @@ -0,0 +1,34 @@ +=== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesIndexersWithAssignmentCompatibility.ts === +class Base { +>Base : Symbol(Base, Decl(derivedClassOverridesIndexersWithAssignmentCompatibility.ts, 0, 0)) + + [x: string]: Object; +>x : Symbol(x, Decl(derivedClassOverridesIndexersWithAssignmentCompatibility.ts, 1, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +} + +// ok, use assignment compatibility +class Derived extends Base { +>Derived : Symbol(Derived, Decl(derivedClassOverridesIndexersWithAssignmentCompatibility.ts, 2, 1)) +>Base : Symbol(Base, Decl(derivedClassOverridesIndexersWithAssignmentCompatibility.ts, 0, 0)) + + [x: string]: any; +>x : Symbol(x, Decl(derivedClassOverridesIndexersWithAssignmentCompatibility.ts, 6, 5)) +} + +class Base2 { +>Base2 : Symbol(Base2, Decl(derivedClassOverridesIndexersWithAssignmentCompatibility.ts, 7, 1)) + + [x: number]: Object; +>x : Symbol(x, Decl(derivedClassOverridesIndexersWithAssignmentCompatibility.ts, 10, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +} + +// ok, use assignment compatibility +class Derived2 extends Base2 { +>Derived2 : Symbol(Derived2, Decl(derivedClassOverridesIndexersWithAssignmentCompatibility.ts, 11, 1)) +>Base2 : Symbol(Base2, Decl(derivedClassOverridesIndexersWithAssignmentCompatibility.ts, 7, 1)) + + [x: number]: any; +>x : Symbol(x, Decl(derivedClassOverridesIndexersWithAssignmentCompatibility.ts, 15, 5)) +} diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers.symbols b/tests/baselines/reference/derivedClassOverridesProtectedMembers.symbols new file mode 100644 index 00000000000..3c826325b91 --- /dev/null +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers.symbols @@ -0,0 +1,122 @@ +=== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers.ts === + +var x: { foo: string; } +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers.ts, 1, 3)) +>foo : Symbol(foo, Decl(derivedClassOverridesProtectedMembers.ts, 1, 8)) + +var y: { foo: string; bar: string; } +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers.ts, 2, 3)) +>foo : Symbol(foo, Decl(derivedClassOverridesProtectedMembers.ts, 2, 8)) +>bar : Symbol(bar, Decl(derivedClassOverridesProtectedMembers.ts, 2, 21)) + +class Base { +>Base : Symbol(Base, Decl(derivedClassOverridesProtectedMembers.ts, 2, 36)) + + protected a: typeof x; +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers.ts, 4, 12)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers.ts, 1, 3)) + + protected b(a: typeof x) { } +>b : Symbol(b, Decl(derivedClassOverridesProtectedMembers.ts, 5, 26)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers.ts, 6, 16)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers.ts, 1, 3)) + + protected get c() { return x; } +>c : Symbol(c, Decl(derivedClassOverridesProtectedMembers.ts, 6, 32), Decl(derivedClassOverridesProtectedMembers.ts, 7, 35)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers.ts, 1, 3)) + + protected set c(v: typeof x) { } +>c : Symbol(c, Decl(derivedClassOverridesProtectedMembers.ts, 6, 32), Decl(derivedClassOverridesProtectedMembers.ts, 7, 35)) +>v : Symbol(v, Decl(derivedClassOverridesProtectedMembers.ts, 8, 20)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers.ts, 1, 3)) + + protected d: (a: typeof x) => void; +>d : Symbol(d, Decl(derivedClassOverridesProtectedMembers.ts, 8, 36)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers.ts, 9, 18)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers.ts, 1, 3)) + + protected static r: typeof x; +>r : Symbol(Base.r, Decl(derivedClassOverridesProtectedMembers.ts, 9, 39)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers.ts, 1, 3)) + + protected static s(a: typeof x) { } +>s : Symbol(Base.s, Decl(derivedClassOverridesProtectedMembers.ts, 11, 33)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers.ts, 12, 23)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers.ts, 1, 3)) + + protected static get t() { return x; } +>t : Symbol(Base.t, Decl(derivedClassOverridesProtectedMembers.ts, 12, 39), Decl(derivedClassOverridesProtectedMembers.ts, 13, 42)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers.ts, 1, 3)) + + protected static set t(v: typeof x) { } +>t : Symbol(Base.t, Decl(derivedClassOverridesProtectedMembers.ts, 12, 39), Decl(derivedClassOverridesProtectedMembers.ts, 13, 42)) +>v : Symbol(v, Decl(derivedClassOverridesProtectedMembers.ts, 14, 27)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers.ts, 1, 3)) + + protected static u: (a: typeof x) => void; +>u : Symbol(Base.u, Decl(derivedClassOverridesProtectedMembers.ts, 14, 43)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers.ts, 15, 25)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers.ts, 1, 3)) + + constructor(a: typeof x) { } +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers.ts, 17, 16)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers.ts, 1, 3)) +} + +class Derived extends Base { +>Derived : Symbol(Derived, Decl(derivedClassOverridesProtectedMembers.ts, 18, 1)) +>Base : Symbol(Base, Decl(derivedClassOverridesProtectedMembers.ts, 2, 36)) + + protected a: typeof y; +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers.ts, 20, 28)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers.ts, 2, 3)) + + protected b(a: typeof y) { } +>b : Symbol(b, Decl(derivedClassOverridesProtectedMembers.ts, 21, 26)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers.ts, 22, 16)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers.ts, 2, 3)) + + protected get c() { return y; } +>c : Symbol(c, Decl(derivedClassOverridesProtectedMembers.ts, 22, 32), Decl(derivedClassOverridesProtectedMembers.ts, 23, 35)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers.ts, 2, 3)) + + protected set c(v: typeof y) { } +>c : Symbol(c, Decl(derivedClassOverridesProtectedMembers.ts, 22, 32), Decl(derivedClassOverridesProtectedMembers.ts, 23, 35)) +>v : Symbol(v, Decl(derivedClassOverridesProtectedMembers.ts, 24, 20)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers.ts, 2, 3)) + + protected d: (a: typeof y) => void; +>d : Symbol(d, Decl(derivedClassOverridesProtectedMembers.ts, 24, 36)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers.ts, 25, 18)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers.ts, 2, 3)) + + protected static r: typeof y; +>r : Symbol(Derived.r, Decl(derivedClassOverridesProtectedMembers.ts, 25, 39)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers.ts, 2, 3)) + + protected static s(a: typeof y) { } +>s : Symbol(Derived.s, Decl(derivedClassOverridesProtectedMembers.ts, 27, 33)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers.ts, 28, 23)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers.ts, 2, 3)) + + protected static get t() { return y; } +>t : Symbol(Derived.t, Decl(derivedClassOverridesProtectedMembers.ts, 28, 39), Decl(derivedClassOverridesProtectedMembers.ts, 29, 42)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers.ts, 2, 3)) + + protected static set t(a: typeof y) { } +>t : Symbol(Derived.t, Decl(derivedClassOverridesProtectedMembers.ts, 28, 39), Decl(derivedClassOverridesProtectedMembers.ts, 29, 42)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers.ts, 30, 27)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers.ts, 2, 3)) + + protected static u: (a: typeof y) => void; +>u : Symbol(Derived.u, Decl(derivedClassOverridesProtectedMembers.ts, 30, 43)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers.ts, 31, 25)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers.ts, 2, 3)) + + constructor(a: typeof y) { super(x) } +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers.ts, 33, 16)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers.ts, 2, 3)) +>super : Symbol(Base, Decl(derivedClassOverridesProtectedMembers.ts, 2, 36)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers.ts, 1, 3)) +} + diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.symbols b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.symbols new file mode 100644 index 00000000000..59d062f459c --- /dev/null +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.symbols @@ -0,0 +1,228 @@ +=== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers2.ts === +var x: { foo: string; } +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) +>foo : Symbol(foo, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 8)) + +var y: { foo: string; bar: string; } +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) +>foo : Symbol(foo, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 8)) +>bar : Symbol(bar, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 21)) + +class Base { +>Base : Symbol(Base, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 36)) + + protected a: typeof x; +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 3, 12)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) + + protected b(a: typeof x) { } +>b : Symbol(b, Decl(derivedClassOverridesProtectedMembers2.ts, 4, 26)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 5, 16)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) + + protected get c() { return x; } +>c : Symbol(c, Decl(derivedClassOverridesProtectedMembers2.ts, 5, 32), Decl(derivedClassOverridesProtectedMembers2.ts, 6, 35)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) + + protected set c(v: typeof x) { } +>c : Symbol(c, Decl(derivedClassOverridesProtectedMembers2.ts, 5, 32), Decl(derivedClassOverridesProtectedMembers2.ts, 6, 35)) +>v : Symbol(v, Decl(derivedClassOverridesProtectedMembers2.ts, 7, 20)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) + + protected d: (a: typeof x) => void ; +>d : Symbol(d, Decl(derivedClassOverridesProtectedMembers2.ts, 7, 36)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 8, 18)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) + + protected static r: typeof x; +>r : Symbol(Base.r, Decl(derivedClassOverridesProtectedMembers2.ts, 8, 40)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) + + protected static s(a: typeof x) { } +>s : Symbol(Base.s, Decl(derivedClassOverridesProtectedMembers2.ts, 10, 33)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 11, 23)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) + + protected static get t() { return x; } +>t : Symbol(Base.t, Decl(derivedClassOverridesProtectedMembers2.ts, 11, 39), Decl(derivedClassOverridesProtectedMembers2.ts, 12, 42)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) + + protected static set t(v: typeof x) { } +>t : Symbol(Base.t, Decl(derivedClassOverridesProtectedMembers2.ts, 11, 39), Decl(derivedClassOverridesProtectedMembers2.ts, 12, 42)) +>v : Symbol(v, Decl(derivedClassOverridesProtectedMembers2.ts, 13, 27)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) + + protected static u: (a: typeof x) => void ; +>u : Symbol(Base.u, Decl(derivedClassOverridesProtectedMembers2.ts, 13, 43)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 14, 25)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) + +constructor(a: typeof x) { } +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 16, 12)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) +} + +// Increase visibility of all protected members to public +class Derived extends Base { +>Derived : Symbol(Derived, Decl(derivedClassOverridesProtectedMembers2.ts, 17, 1)) +>Base : Symbol(Base, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 36)) + + a: typeof y; +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 20, 28)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + + b(a: typeof y) { } +>b : Symbol(b, Decl(derivedClassOverridesProtectedMembers2.ts, 21, 16)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 22, 6)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + + get c() { return y; } +>c : Symbol(c, Decl(derivedClassOverridesProtectedMembers2.ts, 22, 22), Decl(derivedClassOverridesProtectedMembers2.ts, 23, 25)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + + set c(v: typeof y) { } +>c : Symbol(c, Decl(derivedClassOverridesProtectedMembers2.ts, 22, 22), Decl(derivedClassOverridesProtectedMembers2.ts, 23, 25)) +>v : Symbol(v, Decl(derivedClassOverridesProtectedMembers2.ts, 24, 10)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + + d: (a: typeof y) => void; +>d : Symbol(d, Decl(derivedClassOverridesProtectedMembers2.ts, 24, 26)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 25, 8)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + + static r: typeof y; +>r : Symbol(Derived.r, Decl(derivedClassOverridesProtectedMembers2.ts, 25, 29)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + + static s(a: typeof y) { } +>s : Symbol(Derived.s, Decl(derivedClassOverridesProtectedMembers2.ts, 27, 23)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 28, 13)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + + static get t() { return y; } +>t : Symbol(Derived.t, Decl(derivedClassOverridesProtectedMembers2.ts, 28, 29), Decl(derivedClassOverridesProtectedMembers2.ts, 29, 32)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + + static set t(a: typeof y) { } +>t : Symbol(Derived.t, Decl(derivedClassOverridesProtectedMembers2.ts, 28, 29), Decl(derivedClassOverridesProtectedMembers2.ts, 29, 32)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 30, 17)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + + static u: (a: typeof y) => void; +>u : Symbol(Derived.u, Decl(derivedClassOverridesProtectedMembers2.ts, 30, 33)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 31, 15)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + + constructor(a: typeof y) { super(a); } +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 33, 16)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) +>super : Symbol(Base, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 36)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 33, 16)) +} + +var d: Derived = new Derived(y); +>d : Symbol(d, Decl(derivedClassOverridesProtectedMembers2.ts, 36, 3)) +>Derived : Symbol(Derived, Decl(derivedClassOverridesProtectedMembers2.ts, 17, 1)) +>Derived : Symbol(Derived, Decl(derivedClassOverridesProtectedMembers2.ts, 17, 1)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + +var r1 = d.a; +>r1 : Symbol(r1, Decl(derivedClassOverridesProtectedMembers2.ts, 37, 3)) +>d.a : Symbol(Derived.a, Decl(derivedClassOverridesProtectedMembers2.ts, 20, 28)) +>d : Symbol(d, Decl(derivedClassOverridesProtectedMembers2.ts, 36, 3)) +>a : Symbol(Derived.a, Decl(derivedClassOverridesProtectedMembers2.ts, 20, 28)) + +var r2 = d.b(y); +>r2 : Symbol(r2, Decl(derivedClassOverridesProtectedMembers2.ts, 38, 3)) +>d.b : Symbol(Derived.b, Decl(derivedClassOverridesProtectedMembers2.ts, 21, 16)) +>d : Symbol(d, Decl(derivedClassOverridesProtectedMembers2.ts, 36, 3)) +>b : Symbol(Derived.b, Decl(derivedClassOverridesProtectedMembers2.ts, 21, 16)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + +var r3 = d.c; +>r3 : Symbol(r3, Decl(derivedClassOverridesProtectedMembers2.ts, 39, 3)) +>d.c : Symbol(Derived.c, Decl(derivedClassOverridesProtectedMembers2.ts, 22, 22), Decl(derivedClassOverridesProtectedMembers2.ts, 23, 25)) +>d : Symbol(d, Decl(derivedClassOverridesProtectedMembers2.ts, 36, 3)) +>c : Symbol(Derived.c, Decl(derivedClassOverridesProtectedMembers2.ts, 22, 22), Decl(derivedClassOverridesProtectedMembers2.ts, 23, 25)) + +var r3a = d.d; +>r3a : Symbol(r3a, Decl(derivedClassOverridesProtectedMembers2.ts, 40, 3)) +>d.d : Symbol(Derived.d, Decl(derivedClassOverridesProtectedMembers2.ts, 24, 26)) +>d : Symbol(d, Decl(derivedClassOverridesProtectedMembers2.ts, 36, 3)) +>d : Symbol(Derived.d, Decl(derivedClassOverridesProtectedMembers2.ts, 24, 26)) + +d.c = y; +>d.c : Symbol(Derived.c, Decl(derivedClassOverridesProtectedMembers2.ts, 22, 22), Decl(derivedClassOverridesProtectedMembers2.ts, 23, 25)) +>d : Symbol(d, Decl(derivedClassOverridesProtectedMembers2.ts, 36, 3)) +>c : Symbol(Derived.c, Decl(derivedClassOverridesProtectedMembers2.ts, 22, 22), Decl(derivedClassOverridesProtectedMembers2.ts, 23, 25)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + +var r4 = Derived.r; +>r4 : Symbol(r4, Decl(derivedClassOverridesProtectedMembers2.ts, 42, 3)) +>Derived.r : Symbol(Derived.r, Decl(derivedClassOverridesProtectedMembers2.ts, 25, 29)) +>Derived : Symbol(Derived, Decl(derivedClassOverridesProtectedMembers2.ts, 17, 1)) +>r : Symbol(Derived.r, Decl(derivedClassOverridesProtectedMembers2.ts, 25, 29)) + +var r5 = Derived.s(y); +>r5 : Symbol(r5, Decl(derivedClassOverridesProtectedMembers2.ts, 43, 3)) +>Derived.s : Symbol(Derived.s, Decl(derivedClassOverridesProtectedMembers2.ts, 27, 23)) +>Derived : Symbol(Derived, Decl(derivedClassOverridesProtectedMembers2.ts, 17, 1)) +>s : Symbol(Derived.s, Decl(derivedClassOverridesProtectedMembers2.ts, 27, 23)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + +var r6 = Derived.t; +>r6 : Symbol(r6, Decl(derivedClassOverridesProtectedMembers2.ts, 44, 3)) +>Derived.t : Symbol(Derived.t, Decl(derivedClassOverridesProtectedMembers2.ts, 28, 29), Decl(derivedClassOverridesProtectedMembers2.ts, 29, 32)) +>Derived : Symbol(Derived, Decl(derivedClassOverridesProtectedMembers2.ts, 17, 1)) +>t : Symbol(Derived.t, Decl(derivedClassOverridesProtectedMembers2.ts, 28, 29), Decl(derivedClassOverridesProtectedMembers2.ts, 29, 32)) + +var r6a = Derived.u; +>r6a : Symbol(r6a, Decl(derivedClassOverridesProtectedMembers2.ts, 45, 3)) +>Derived.u : Symbol(Derived.u, Decl(derivedClassOverridesProtectedMembers2.ts, 30, 33)) +>Derived : Symbol(Derived, Decl(derivedClassOverridesProtectedMembers2.ts, 17, 1)) +>u : Symbol(Derived.u, Decl(derivedClassOverridesProtectedMembers2.ts, 30, 33)) + +Derived.t = y; +>Derived.t : Symbol(Derived.t, Decl(derivedClassOverridesProtectedMembers2.ts, 28, 29), Decl(derivedClassOverridesProtectedMembers2.ts, 29, 32)) +>Derived : Symbol(Derived, Decl(derivedClassOverridesProtectedMembers2.ts, 17, 1)) +>t : Symbol(Derived.t, Decl(derivedClassOverridesProtectedMembers2.ts, 28, 29), Decl(derivedClassOverridesProtectedMembers2.ts, 29, 32)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + +class Base2 { +>Base2 : Symbol(Base2, Decl(derivedClassOverridesProtectedMembers2.ts, 46, 14)) + + [i: string]: Object; +>i : Symbol(i, Decl(derivedClassOverridesProtectedMembers2.ts, 49, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + [i: number]: typeof x; +>i : Symbol(i, Decl(derivedClassOverridesProtectedMembers2.ts, 50, 5)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) +} + +class Derived2 extends Base2 { +>Derived2 : Symbol(Derived2, Decl(derivedClassOverridesProtectedMembers2.ts, 51, 1)) +>Base2 : Symbol(Base2, Decl(derivedClassOverridesProtectedMembers2.ts, 46, 14)) + + [i: string]: typeof x; +>i : Symbol(i, Decl(derivedClassOverridesProtectedMembers2.ts, 54, 5)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) + + [i: number]: typeof y; +>i : Symbol(i, Decl(derivedClassOverridesProtectedMembers2.ts, 55, 5)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) +} + +var d2: Derived2; +>d2 : Symbol(d2, Decl(derivedClassOverridesProtectedMembers2.ts, 58, 3)) +>Derived2 : Symbol(Derived2, Decl(derivedClassOverridesProtectedMembers2.ts, 51, 1)) + +var r7 = d2['']; +>r7 : Symbol(r7, Decl(derivedClassOverridesProtectedMembers2.ts, 59, 3)) +>d2 : Symbol(d2, Decl(derivedClassOverridesProtectedMembers2.ts, 58, 3)) + +var r8 = d2[1]; +>r8 : Symbol(r8, Decl(derivedClassOverridesProtectedMembers2.ts, 60, 3)) +>d2 : Symbol(d2, Decl(derivedClassOverridesProtectedMembers2.ts, 58, 3)) + + diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.types b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.types index 3b6eb55256e..2799555a3a2 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.types +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.types @@ -227,10 +227,12 @@ var r7 = d2['']; >r7 : { foo: string; } >d2[''] : { foo: string; } >d2 : Derived2 +>'' : string var r8 = d2[1]; >r8 : { foo: string; bar: string; } >d2[1] : { foo: string; bar: string; } >d2 : Derived2 +>1 : number diff --git a/tests/baselines/reference/derivedClassOverridesWithoutSubtype.symbols b/tests/baselines/reference/derivedClassOverridesWithoutSubtype.symbols new file mode 100644 index 00000000000..452da91f034 --- /dev/null +++ b/tests/baselines/reference/derivedClassOverridesWithoutSubtype.symbols @@ -0,0 +1,46 @@ +=== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesWithoutSubtype.ts === +class Base { +>Base : Symbol(Base, Decl(derivedClassOverridesWithoutSubtype.ts, 0, 0)) + + x: { +>x : Symbol(x, Decl(derivedClassOverridesWithoutSubtype.ts, 0, 12)) + + foo: string; +>foo : Symbol(foo, Decl(derivedClassOverridesWithoutSubtype.ts, 1, 8)) + } +} + +class Derived extends Base { +>Derived : Symbol(Derived, Decl(derivedClassOverridesWithoutSubtype.ts, 4, 1)) +>Base : Symbol(Base, Decl(derivedClassOverridesWithoutSubtype.ts, 0, 0)) + + x: { +>x : Symbol(x, Decl(derivedClassOverridesWithoutSubtype.ts, 6, 28)) + + foo: any; +>foo : Symbol(foo, Decl(derivedClassOverridesWithoutSubtype.ts, 7, 8)) + } +} + +class Base2 { +>Base2 : Symbol(Base2, Decl(derivedClassOverridesWithoutSubtype.ts, 10, 1)) + + static y: { +>y : Symbol(Base2.y, Decl(derivedClassOverridesWithoutSubtype.ts, 12, 13)) + + foo: string; +>foo : Symbol(foo, Decl(derivedClassOverridesWithoutSubtype.ts, 13, 15)) + } +} + +class Derived2 extends Base2 { +>Derived2 : Symbol(Derived2, Decl(derivedClassOverridesWithoutSubtype.ts, 16, 1)) +>Base2 : Symbol(Base2, Decl(derivedClassOverridesWithoutSubtype.ts, 10, 1)) + + static y: { +>y : Symbol(Derived2.y, Decl(derivedClassOverridesWithoutSubtype.ts, 18, 30)) + + foo: any; +>foo : Symbol(foo, Decl(derivedClassOverridesWithoutSubtype.ts, 19, 15)) + } +} diff --git a/tests/baselines/reference/derivedClasses.symbols b/tests/baselines/reference/derivedClasses.symbols new file mode 100644 index 00000000000..f265c2dce53 --- /dev/null +++ b/tests/baselines/reference/derivedClasses.symbols @@ -0,0 +1,77 @@ +=== tests/cases/compiler/derivedClasses.ts === +class Red extends Color { +>Red : Symbol(Red, Decl(derivedClasses.ts, 0, 0)) +>Color : Symbol(Color, Decl(derivedClasses.ts, 5, 1)) + + public shade() { +>shade : Symbol(shade, Decl(derivedClasses.ts, 0, 25)) + + var getHue = () => { return this.hue(); }; +>getHue : Symbol(getHue, Decl(derivedClasses.ts, 2, 8)) +>this.hue : Symbol(Color.hue, Decl(derivedClasses.ts, 8, 43)) +>this : Symbol(Red, Decl(derivedClasses.ts, 0, 0)) +>hue : Symbol(Color.hue, Decl(derivedClasses.ts, 8, 43)) + + return getHue() + " red"; +>getHue : Symbol(getHue, Decl(derivedClasses.ts, 2, 8)) + } +} + +class Color { +>Color : Symbol(Color, Decl(derivedClasses.ts, 5, 1)) + + public shade() { return "some shade"; } +>shade : Symbol(shade, Decl(derivedClasses.ts, 7, 13)) + + public hue() { return "some hue"; } +>hue : Symbol(hue, Decl(derivedClasses.ts, 8, 43)) +} + +class Blue extends Color { +>Blue : Symbol(Blue, Decl(derivedClasses.ts, 10, 1)) +>Color : Symbol(Color, Decl(derivedClasses.ts, 5, 1)) + + public shade() { +>shade : Symbol(shade, Decl(derivedClasses.ts, 12, 26)) + + var getHue = () => { return this.hue(); }; +>getHue : Symbol(getHue, Decl(derivedClasses.ts, 15, 8)) +>this.hue : Symbol(Color.hue, Decl(derivedClasses.ts, 8, 43)) +>this : Symbol(Blue, Decl(derivedClasses.ts, 10, 1)) +>hue : Symbol(Color.hue, Decl(derivedClasses.ts, 8, 43)) + + return getHue() + " blue"; +>getHue : Symbol(getHue, Decl(derivedClasses.ts, 15, 8)) + } +} + +var r = new Red(); +>r : Symbol(r, Decl(derivedClasses.ts, 20, 3)) +>Red : Symbol(Red, Decl(derivedClasses.ts, 0, 0)) + +var b = new Blue(); +>b : Symbol(b, Decl(derivedClasses.ts, 21, 3)) +>Blue : Symbol(Blue, Decl(derivedClasses.ts, 10, 1)) + +r.shade(); +>r.shade : Symbol(Red.shade, Decl(derivedClasses.ts, 0, 25)) +>r : Symbol(r, Decl(derivedClasses.ts, 20, 3)) +>shade : Symbol(Red.shade, Decl(derivedClasses.ts, 0, 25)) + +r.hue(); +>r.hue : Symbol(Color.hue, Decl(derivedClasses.ts, 8, 43)) +>r : Symbol(r, Decl(derivedClasses.ts, 20, 3)) +>hue : Symbol(Color.hue, Decl(derivedClasses.ts, 8, 43)) + +b.shade(); +>b.shade : Symbol(Blue.shade, Decl(derivedClasses.ts, 12, 26)) +>b : Symbol(b, Decl(derivedClasses.ts, 21, 3)) +>shade : Symbol(Blue.shade, Decl(derivedClasses.ts, 12, 26)) + +b.hue(); +>b.hue : Symbol(Color.hue, Decl(derivedClasses.ts, 8, 43)) +>b : Symbol(b, Decl(derivedClasses.ts, 21, 3)) +>hue : Symbol(Color.hue, Decl(derivedClasses.ts, 8, 43)) + + + diff --git a/tests/baselines/reference/derivedClasses.types b/tests/baselines/reference/derivedClasses.types index ce054b99223..906cfb2741c 100644 --- a/tests/baselines/reference/derivedClasses.types +++ b/tests/baselines/reference/derivedClasses.types @@ -18,6 +18,7 @@ class Red extends Color { >getHue() + " red" : string >getHue() : string >getHue : () => string +>" red" : string } } @@ -26,9 +27,11 @@ class Color { public shade() { return "some shade"; } >shade : () => string +>"some shade" : string public hue() { return "some hue"; } >hue : () => string +>"some hue" : string } class Blue extends Color { @@ -50,6 +53,7 @@ class Blue extends Color { >getHue() + " blue" : string >getHue() : string >getHue : () => string +>" blue" : string } } diff --git a/tests/baselines/reference/derivedInterfaceDoesNotHideBaseSignatures.symbols b/tests/baselines/reference/derivedInterfaceDoesNotHideBaseSignatures.symbols new file mode 100644 index 00000000000..5cd63ba9008 --- /dev/null +++ b/tests/baselines/reference/derivedInterfaceDoesNotHideBaseSignatures.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceDoesNotHideBaseSignatures.ts === +// Derived interfaces no longer hide signatures from base types, so these signatures are always compatible. +interface Base { +>Base : Symbol(Base, Decl(derivedInterfaceDoesNotHideBaseSignatures.ts, 0, 0)) + + (): string; + new (x: string): number; +>x : Symbol(x, Decl(derivedInterfaceDoesNotHideBaseSignatures.ts, 3, 9)) +} + +interface Derived extends Base { +>Derived : Symbol(Derived, Decl(derivedInterfaceDoesNotHideBaseSignatures.ts, 4, 1)) +>Base : Symbol(Base, Decl(derivedInterfaceDoesNotHideBaseSignatures.ts, 0, 0)) + + (): number; + new (x: string): string; +>x : Symbol(x, Decl(derivedInterfaceDoesNotHideBaseSignatures.ts, 8, 9)) +} diff --git a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.symbols b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.symbols new file mode 100644 index 00000000000..e935d7bf66a --- /dev/null +++ b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.symbols @@ -0,0 +1,56 @@ +=== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts === +class Base { +>Base : Symbol(Base, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 0, 0)) + + foo(x: { a: number }): { a: number } { +>foo : Symbol(foo, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 0, 12)) +>x : Symbol(x, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 1, 8)) +>a : Symbol(a, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 1, 12)) +>a : Symbol(a, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 1, 28)) + + return null; + } +} + +class Derived extends Base { +>Derived : Symbol(Derived, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 4, 1)) +>Base : Symbol(Base, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 0, 0)) + + foo(x: { a: number; b: number }): { a: number; b: number } { +>foo : Symbol(foo, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 6, 28)) +>x : Symbol(x, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 7, 8)) +>a : Symbol(a, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 7, 12)) +>b : Symbol(b, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 7, 23)) +>a : Symbol(a, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 7, 39)) +>b : Symbol(b, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 7, 50)) + + return null; + } + + bar() { +>bar : Symbol(bar, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 9, 5)) + + var r = super.foo({ a: 1 }); // { a: number } +>r : Symbol(r, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 12, 11)) +>super.foo : Symbol(Base.foo, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 0, 12)) +>super : Symbol(Base, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 0, 0)) +>foo : Symbol(Base.foo, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 0, 12)) +>a : Symbol(a, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 12, 27)) + + var r2 = super.foo({ a: 1, b: 2 }); // { a: number } +>r2 : Symbol(r2, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 13, 11)) +>super.foo : Symbol(Base.foo, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 0, 12)) +>super : Symbol(Base, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 0, 0)) +>foo : Symbol(Base.foo, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 0, 12)) +>a : Symbol(a, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 13, 28)) +>b : Symbol(b, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 13, 34)) + + var r3 = this.foo({ a: 1, b: 2 }); // { a: number; b: number; } +>r3 : Symbol(r3, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 14, 11)) +>this.foo : Symbol(foo, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 6, 28)) +>this : Symbol(Derived, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 4, 1)) +>foo : Symbol(foo, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 6, 28)) +>a : Symbol(a, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 14, 27)) +>b : Symbol(b, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 14, 33)) + } +} diff --git a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.types b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.types index 4f1ff1780dc..d8d9f657255 100644 --- a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.types +++ b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.types @@ -9,6 +9,7 @@ class Base { >a : number return null; +>null : null } } @@ -25,6 +26,7 @@ class Derived extends Base { >b : number return null; +>null : null } bar() { @@ -38,6 +40,7 @@ class Derived extends Base { >foo : (x: { a: number; }) => { a: number; } >{ a: 1 } : { a: number; } >a : number +>1 : number var r2 = super.foo({ a: 1, b: 2 }); // { a: number } >r2 : { a: number; } @@ -47,7 +50,9 @@ class Derived extends Base { >foo : (x: { a: number; }) => { a: number; } >{ a: 1, b: 2 } : { a: number; b: number; } >a : number +>1 : number >b : number +>2 : number var r3 = this.foo({ a: 1, b: 2 }); // { a: number; b: number; } >r3 : { a: number; b: number; } @@ -57,6 +62,8 @@ class Derived extends Base { >foo : (x: { a: number; b: number; }) => { a: number; b: number; } >{ a: 1, b: 2 } : { a: number; b: number; } >a : number +>1 : number >b : number +>2 : number } } diff --git a/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.symbols b/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.symbols new file mode 100644 index 00000000000..e0f41b72f76 --- /dev/null +++ b/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.symbols @@ -0,0 +1,52 @@ +=== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/derivedTypeDoesNotRequireExtendsClause.ts === +class Base { +>Base : Symbol(Base, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 0, 0)) + + foo: string; +>foo : Symbol(foo, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 0, 12)) +} + +class Derived { +>Derived : Symbol(Derived, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 2, 1)) + + foo: string; +>foo : Symbol(foo, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 4, 15)) + + bar: number; +>bar : Symbol(bar, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 5, 16)) +} + +class Derived2 extends Base { +>Derived2 : Symbol(Derived2, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 7, 1)) +>Base : Symbol(Base, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 0, 0)) + + bar: string; +>bar : Symbol(bar, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 9, 29)) +} + +var b: Base; +>b : Symbol(b, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 13, 3)) +>Base : Symbol(Base, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 0, 0)) + +var d1: Derived; +>d1 : Symbol(d1, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 14, 3)) +>Derived : Symbol(Derived, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 2, 1)) + +var d2: Derived2; +>d2 : Symbol(d2, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 15, 3)) +>Derived2 : Symbol(Derived2, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 7, 1)) + +b = d1; +>b : Symbol(b, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 13, 3)) +>d1 : Symbol(d1, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 14, 3)) + +b = d2; +>b : Symbol(b, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 13, 3)) +>d2 : Symbol(d2, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 15, 3)) + +var r: Base[] = [d1, d2]; +>r : Symbol(r, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 19, 3)) +>Base : Symbol(Base, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 0, 0)) +>d1 : Symbol(d1, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 14, 3)) +>d2 : Symbol(d2, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 15, 3)) + diff --git a/tests/baselines/reference/destructuringWithNewExpression.js b/tests/baselines/reference/destructuringWithNewExpression.js new file mode 100644 index 00000000000..310129674b1 --- /dev/null +++ b/tests/baselines/reference/destructuringWithNewExpression.js @@ -0,0 +1,15 @@ +//// [destructuringWithNewExpression.ts] +class C { + x = 0; +} + +var { x } = new C; + +//// [destructuringWithNewExpression.js] +var C = (function () { + function C() { + this.x = 0; + } + return C; +})(); +var x = (new C).x; diff --git a/tests/baselines/reference/destructuringWithNewExpression.symbols b/tests/baselines/reference/destructuringWithNewExpression.symbols new file mode 100644 index 00000000000..c7dce468485 --- /dev/null +++ b/tests/baselines/reference/destructuringWithNewExpression.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/destructuringWithNewExpression.ts === +class C { +>C : Symbol(C, Decl(destructuringWithNewExpression.ts, 0, 0)) + + x = 0; +>x : Symbol(x, Decl(destructuringWithNewExpression.ts, 0, 9)) +} + +var { x } = new C; +>x : Symbol(x, Decl(destructuringWithNewExpression.ts, 4, 5)) +>C : Symbol(C, Decl(destructuringWithNewExpression.ts, 0, 0)) + diff --git a/tests/baselines/reference/destructuringWithNewExpression.types b/tests/baselines/reference/destructuringWithNewExpression.types new file mode 100644 index 00000000000..1d36746a44d --- /dev/null +++ b/tests/baselines/reference/destructuringWithNewExpression.types @@ -0,0 +1,14 @@ +=== tests/cases/compiler/destructuringWithNewExpression.ts === +class C { +>C : C + + x = 0; +>x : number +>0 : number +} + +var { x } = new C; +>x : number +>new C : C +>C : typeof C + diff --git a/tests/baselines/reference/destructuringWithNumberLiteral.js b/tests/baselines/reference/destructuringWithNumberLiteral.js new file mode 100644 index 00000000000..8804b850cc3 --- /dev/null +++ b/tests/baselines/reference/destructuringWithNumberLiteral.js @@ -0,0 +1,5 @@ +//// [destructuringWithNumberLiteral.ts] +var { toExponential } = 0; + +//// [destructuringWithNumberLiteral.js] +var toExponential = (0).toExponential; diff --git a/tests/baselines/reference/destructuringWithNumberLiteral.symbols b/tests/baselines/reference/destructuringWithNumberLiteral.symbols new file mode 100644 index 00000000000..6190dc15052 --- /dev/null +++ b/tests/baselines/reference/destructuringWithNumberLiteral.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/destructuringWithNumberLiteral.ts === +var { toExponential } = 0; +>toExponential : Symbol(toExponential, Decl(destructuringWithNumberLiteral.ts, 0, 5)) + diff --git a/tests/baselines/reference/destructuringWithNumberLiteral.types b/tests/baselines/reference/destructuringWithNumberLiteral.types new file mode 100644 index 00000000000..7fe902c622e --- /dev/null +++ b/tests/baselines/reference/destructuringWithNumberLiteral.types @@ -0,0 +1,5 @@ +=== tests/cases/compiler/destructuringWithNumberLiteral.ts === +var { toExponential } = 0; +>toExponential : (fractionDigits?: number) => string +>0 : number + diff --git a/tests/baselines/reference/detachedCommentAtStartOfConstructor1.symbols b/tests/baselines/reference/detachedCommentAtStartOfConstructor1.symbols new file mode 100644 index 00000000000..9590abaa460 --- /dev/null +++ b/tests/baselines/reference/detachedCommentAtStartOfConstructor1.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/detachedCommentAtStartOfConstructor1.ts === +class TestFile { +>TestFile : Symbol(TestFile, Decl(detachedCommentAtStartOfConstructor1.ts, 0, 0)) + + public message: string; +>message : Symbol(message, Decl(detachedCommentAtStartOfConstructor1.ts, 0, 16)) + + public name; +>name : Symbol(name, Decl(detachedCommentAtStartOfConstructor1.ts, 1, 27)) + + constructor(message: string) { +>message : Symbol(message, Decl(detachedCommentAtStartOfConstructor1.ts, 3, 16)) + + /// Test summary + /// + var getMessage = () => message + this.name; +>getMessage : Symbol(getMessage, Decl(detachedCommentAtStartOfConstructor1.ts, 6, 11)) +>message : Symbol(message, Decl(detachedCommentAtStartOfConstructor1.ts, 3, 16)) +>this.name : Symbol(name, Decl(detachedCommentAtStartOfConstructor1.ts, 1, 27)) +>this : Symbol(TestFile, Decl(detachedCommentAtStartOfConstructor1.ts, 0, 0)) +>name : Symbol(name, Decl(detachedCommentAtStartOfConstructor1.ts, 1, 27)) + + this.message = getMessage(); +>this.message : Symbol(message, Decl(detachedCommentAtStartOfConstructor1.ts, 0, 16)) +>this : Symbol(TestFile, Decl(detachedCommentAtStartOfConstructor1.ts, 0, 0)) +>message : Symbol(message, Decl(detachedCommentAtStartOfConstructor1.ts, 0, 16)) +>getMessage : Symbol(getMessage, Decl(detachedCommentAtStartOfConstructor1.ts, 6, 11)) + } +} diff --git a/tests/baselines/reference/detachedCommentAtStartOfConstructor2.symbols b/tests/baselines/reference/detachedCommentAtStartOfConstructor2.symbols new file mode 100644 index 00000000000..78af9430034 --- /dev/null +++ b/tests/baselines/reference/detachedCommentAtStartOfConstructor2.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/detachedCommentAtStartOfConstructor2.ts === +class TestFile { +>TestFile : Symbol(TestFile, Decl(detachedCommentAtStartOfConstructor2.ts, 0, 0)) + + public message: string; +>message : Symbol(message, Decl(detachedCommentAtStartOfConstructor2.ts, 0, 16)) + + public name: string; +>name : Symbol(name, Decl(detachedCommentAtStartOfConstructor2.ts, 1, 27)) + + constructor(message: string) { +>message : Symbol(message, Decl(detachedCommentAtStartOfConstructor2.ts, 3, 16)) + + /// Test summary + /// + + var getMessage = () => message + this.name; +>getMessage : Symbol(getMessage, Decl(detachedCommentAtStartOfConstructor2.ts, 7, 11)) +>message : Symbol(message, Decl(detachedCommentAtStartOfConstructor2.ts, 3, 16)) +>this.name : Symbol(name, Decl(detachedCommentAtStartOfConstructor2.ts, 1, 27)) +>this : Symbol(TestFile, Decl(detachedCommentAtStartOfConstructor2.ts, 0, 0)) +>name : Symbol(name, Decl(detachedCommentAtStartOfConstructor2.ts, 1, 27)) + + this.message = getMessage(); +>this.message : Symbol(message, Decl(detachedCommentAtStartOfConstructor2.ts, 0, 16)) +>this : Symbol(TestFile, Decl(detachedCommentAtStartOfConstructor2.ts, 0, 0)) +>message : Symbol(message, Decl(detachedCommentAtStartOfConstructor2.ts, 0, 16)) +>getMessage : Symbol(getMessage, Decl(detachedCommentAtStartOfConstructor2.ts, 7, 11)) + } +} diff --git a/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction1.symbols b/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction1.symbols new file mode 100644 index 00000000000..aa34885d79b --- /dev/null +++ b/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction1.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/detachedCommentAtStartOfLambdaFunction1.ts === +class TestFile { +>TestFile : Symbol(TestFile, Decl(detachedCommentAtStartOfLambdaFunction1.ts, 0, 0)) + + name: string; +>name : Symbol(name, Decl(detachedCommentAtStartOfLambdaFunction1.ts, 0, 16)) + + foo(message: string): () => string { +>foo : Symbol(foo, Decl(detachedCommentAtStartOfLambdaFunction1.ts, 1, 17)) +>message : Symbol(message, Decl(detachedCommentAtStartOfLambdaFunction1.ts, 2, 8)) + + return (...x: string[]) => +>x : Symbol(x, Decl(detachedCommentAtStartOfLambdaFunction1.ts, 3, 16)) + + /// Test summary + /// + /// + message + this.name; +>message : Symbol(message, Decl(detachedCommentAtStartOfLambdaFunction1.ts, 2, 8)) +>this.name : Symbol(name, Decl(detachedCommentAtStartOfLambdaFunction1.ts, 0, 16)) +>this : Symbol(TestFile, Decl(detachedCommentAtStartOfLambdaFunction1.ts, 0, 0)) +>name : Symbol(name, Decl(detachedCommentAtStartOfLambdaFunction1.ts, 0, 16)) + } +} diff --git a/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction2.symbols b/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction2.symbols new file mode 100644 index 00000000000..29cef430c3a --- /dev/null +++ b/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction2.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/detachedCommentAtStartOfLambdaFunction2.ts === +class TestFile { +>TestFile : Symbol(TestFile, Decl(detachedCommentAtStartOfLambdaFunction2.ts, 0, 0)) + + name: string; +>name : Symbol(name, Decl(detachedCommentAtStartOfLambdaFunction2.ts, 0, 16)) + + foo(message: string): () => string { +>foo : Symbol(foo, Decl(detachedCommentAtStartOfLambdaFunction2.ts, 1, 17)) +>message : Symbol(message, Decl(detachedCommentAtStartOfLambdaFunction2.ts, 2, 8)) + + return (...x: string[]) => +>x : Symbol(x, Decl(detachedCommentAtStartOfLambdaFunction2.ts, 3, 16)) + + /// Test summary + /// + /// + + message + this.name; +>message : Symbol(message, Decl(detachedCommentAtStartOfLambdaFunction2.ts, 2, 8)) +>this.name : Symbol(name, Decl(detachedCommentAtStartOfLambdaFunction2.ts, 0, 16)) +>this : Symbol(TestFile, Decl(detachedCommentAtStartOfLambdaFunction2.ts, 0, 0)) +>name : Symbol(name, Decl(detachedCommentAtStartOfLambdaFunction2.ts, 0, 16)) + } +} diff --git a/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.symbols b/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.symbols new file mode 100644 index 00000000000..7aaf3b98f4a --- /dev/null +++ b/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/doNotWidenAtObjectLiteralPropertyAssignment.ts === +interface ITestEventInterval { +>ITestEventInterval : Symbol(ITestEventInterval, Decl(doNotWidenAtObjectLiteralPropertyAssignment.ts, 0, 0)) + + begin: number; +>begin : Symbol(begin, Decl(doNotWidenAtObjectLiteralPropertyAssignment.ts, 0, 30)) +} + +interface IIntervalTreeNode { +>IIntervalTreeNode : Symbol(IIntervalTreeNode, Decl(doNotWidenAtObjectLiteralPropertyAssignment.ts, 2, 1)) + + interval: ITestEventInterval; +>interval : Symbol(interval, Decl(doNotWidenAtObjectLiteralPropertyAssignment.ts, 4, 29)) +>ITestEventInterval : Symbol(ITestEventInterval, Decl(doNotWidenAtObjectLiteralPropertyAssignment.ts, 0, 0)) + + children?: IIntervalTreeNode[]; +>children : Symbol(children, Decl(doNotWidenAtObjectLiteralPropertyAssignment.ts, 5, 33)) +>IIntervalTreeNode : Symbol(IIntervalTreeNode, Decl(doNotWidenAtObjectLiteralPropertyAssignment.ts, 2, 1)) +} + +var test: IIntervalTreeNode[] = [{ interval: { begin: 0 }, children: null }]; // was error here because best common type is {} +>test : Symbol(test, Decl(doNotWidenAtObjectLiteralPropertyAssignment.ts, 9, 3)) +>IIntervalTreeNode : Symbol(IIntervalTreeNode, Decl(doNotWidenAtObjectLiteralPropertyAssignment.ts, 2, 1)) +>interval : Symbol(interval, Decl(doNotWidenAtObjectLiteralPropertyAssignment.ts, 9, 34)) +>begin : Symbol(begin, Decl(doNotWidenAtObjectLiteralPropertyAssignment.ts, 9, 46)) +>children : Symbol(children, Decl(doNotWidenAtObjectLiteralPropertyAssignment.ts, 9, 58)) + diff --git a/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.types b/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.types index cd8c03fd6a6..f151b5841c0 100644 --- a/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.types +++ b/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.types @@ -26,5 +26,7 @@ var test: IIntervalTreeNode[] = [{ interval: { begin: 0 }, children: null }]; // >interval : { begin: number; } >{ begin: 0 } : { begin: number; } >begin : number +>0 : number >children : null +>null : null diff --git a/tests/baselines/reference/doWhileBreakStatements.symbols b/tests/baselines/reference/doWhileBreakStatements.symbols new file mode 100644 index 00000000000..7d9db9a5ebb --- /dev/null +++ b/tests/baselines/reference/doWhileBreakStatements.symbols @@ -0,0 +1,41 @@ +=== tests/cases/conformance/statements/breakStatements/doWhileBreakStatements.ts === +do { + break; +} while(true) + +ONE: +do { + break ONE; +} +while (true) + +TWO: +THREE: +do { + break THREE; +}while (true) + +FOUR: +do { + FIVE: + do { + break FOUR; + }while (true) +}while (true) + +do { + SIX: + do break SIX; while(true) +}while (true) + +SEVEN: +do do do break SEVEN; while (true) while (true) while (true) + +EIGHT: +do{ + var fn = function () { } +>fn : Symbol(fn, Decl(doWhileBreakStatements.ts, 34, 7)) + + break EIGHT; +}while(true) + diff --git a/tests/baselines/reference/doWhileBreakStatements.types b/tests/baselines/reference/doWhileBreakStatements.types index c32adda7f4b..c3ca932910a 100644 --- a/tests/baselines/reference/doWhileBreakStatements.types +++ b/tests/baselines/reference/doWhileBreakStatements.types @@ -2,41 +2,79 @@ do { break; } while(true) +>true : boolean ONE: +>ONE : any + do { break ONE; +>ONE : any } while (true) +>true : boolean TWO: +>TWO : any + THREE: +>THREE : any + do { break THREE; +>THREE : any + }while (true) +>true : boolean FOUR: +>FOUR : any + do { FIVE: +>FIVE : any + do { break FOUR; +>FOUR : any + }while (true) +>true : boolean + }while (true) +>true : boolean do { SIX: +>SIX : any + do break SIX; while(true) +>SIX : any +>true : boolean + }while (true) +>true : boolean SEVEN: +>SEVEN : any + do do do break SEVEN; while (true) while (true) while (true) +>SEVEN : any +>true : boolean +>true : boolean +>true : boolean EIGHT: +>EIGHT : any + do{ var fn = function () { } >fn : () => void >function () { } : () => void break EIGHT; +>EIGHT : any + }while(true) +>true : boolean diff --git a/tests/baselines/reference/doWhileContinueStatements.symbols b/tests/baselines/reference/doWhileContinueStatements.symbols new file mode 100644 index 00000000000..e4c6d577d5a --- /dev/null +++ b/tests/baselines/reference/doWhileContinueStatements.symbols @@ -0,0 +1,41 @@ +=== tests/cases/conformance/statements/continueStatements/doWhileContinueStatements.ts === +do { + continue; +} while(true) + +ONE: +do { + continue ONE; +} +while (true) + +TWO: +THREE: +do { + continue THREE; +}while (true) + +FOUR: +do { + FIVE: + do { + continue FOUR; + }while (true) +}while (true) + +do { + SIX: + do continue SIX; while(true) +}while (true) + +SEVEN: +do do do continue SEVEN; while (true) while (true) while (true) + +EIGHT: +do{ + var fn = function () { } +>fn : Symbol(fn, Decl(doWhileContinueStatements.ts, 34, 7)) + + continue EIGHT; +}while(true) + diff --git a/tests/baselines/reference/doWhileContinueStatements.types b/tests/baselines/reference/doWhileContinueStatements.types index 398a8508e31..90c9f59842a 100644 --- a/tests/baselines/reference/doWhileContinueStatements.types +++ b/tests/baselines/reference/doWhileContinueStatements.types @@ -2,41 +2,79 @@ do { continue; } while(true) +>true : boolean ONE: +>ONE : any + do { continue ONE; +>ONE : any } while (true) +>true : boolean TWO: +>TWO : any + THREE: +>THREE : any + do { continue THREE; +>THREE : any + }while (true) +>true : boolean FOUR: +>FOUR : any + do { FIVE: +>FIVE : any + do { continue FOUR; +>FOUR : any + }while (true) +>true : boolean + }while (true) +>true : boolean do { SIX: +>SIX : any + do continue SIX; while(true) +>SIX : any +>true : boolean + }while (true) +>true : boolean SEVEN: +>SEVEN : any + do do do continue SEVEN; while (true) while (true) while (true) +>SEVEN : any +>true : boolean +>true : boolean +>true : boolean EIGHT: +>EIGHT : any + do{ var fn = function () { } >fn : () => void >function () { } : () => void continue EIGHT; +>EIGHT : any + }while(true) +>true : boolean diff --git a/tests/baselines/reference/doWhileLoop.symbols b/tests/baselines/reference/doWhileLoop.symbols new file mode 100644 index 00000000000..ec213e46ec2 --- /dev/null +++ b/tests/baselines/reference/doWhileLoop.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/doWhileLoop.ts === +do { } while (false); +var n; +>n : Symbol(n, Decl(doWhileLoop.ts, 1, 3)) + diff --git a/tests/baselines/reference/doWhileLoop.types b/tests/baselines/reference/doWhileLoop.types index 93f17659c64..9d1767b45aa 100644 --- a/tests/baselines/reference/doWhileLoop.types +++ b/tests/baselines/reference/doWhileLoop.types @@ -1,5 +1,7 @@ === tests/cases/compiler/doWhileLoop.ts === do { } while (false); +>false : boolean + var n; >n : any diff --git a/tests/baselines/reference/dottedModuleName2.symbols b/tests/baselines/reference/dottedModuleName2.symbols new file mode 100644 index 00000000000..a26de2987ba --- /dev/null +++ b/tests/baselines/reference/dottedModuleName2.symbols @@ -0,0 +1,76 @@ +=== tests/cases/compiler/dottedModuleName2.ts === +module A.B { +>A : Symbol(A, Decl(dottedModuleName2.ts, 0, 0), Decl(dottedModuleName2.ts, 18, 21)) +>B : Symbol(B, Decl(dottedModuleName2.ts, 0, 9), Decl(dottedModuleName2.ts, 21, 9)) + + export var x = 1; +>x : Symbol(x, Decl(dottedModuleName2.ts, 2, 12)) + +} + + + +module AA { export module B { +>AA : Symbol(AA, Decl(dottedModuleName2.ts, 4, 1)) +>B : Symbol(B, Decl(dottedModuleName2.ts, 8, 11)) + + export var x = 1; +>x : Symbol(x, Decl(dottedModuleName2.ts, 10, 12)) + +} } + + + +var tmpOK = AA.B.x; +>tmpOK : Symbol(tmpOK, Decl(dottedModuleName2.ts, 16, 3)) +>AA.B.x : Symbol(AA.B.x, Decl(dottedModuleName2.ts, 10, 12)) +>AA.B : Symbol(AA.B, Decl(dottedModuleName2.ts, 8, 11)) +>AA : Symbol(AA, Decl(dottedModuleName2.ts, 4, 1)) +>B : Symbol(AA.B, Decl(dottedModuleName2.ts, 8, 11)) +>x : Symbol(AA.B.x, Decl(dottedModuleName2.ts, 10, 12)) + +var tmpError = A.B.x; +>tmpError : Symbol(tmpError, Decl(dottedModuleName2.ts, 18, 3)) +>A.B.x : Symbol(A.B.x, Decl(dottedModuleName2.ts, 2, 12)) +>A.B : Symbol(A.B, Decl(dottedModuleName2.ts, 0, 9), Decl(dottedModuleName2.ts, 21, 9)) +>A : Symbol(A, Decl(dottedModuleName2.ts, 0, 0), Decl(dottedModuleName2.ts, 18, 21)) +>B : Symbol(A.B, Decl(dottedModuleName2.ts, 0, 9), Decl(dottedModuleName2.ts, 21, 9)) +>x : Symbol(A.B.x, Decl(dottedModuleName2.ts, 2, 12)) + + +module A.B.C +>A : Symbol(A, Decl(dottedModuleName2.ts, 0, 0), Decl(dottedModuleName2.ts, 18, 21)) +>B : Symbol(B, Decl(dottedModuleName2.ts, 0, 9), Decl(dottedModuleName2.ts, 21, 9)) +>C : Symbol(C, Decl(dottedModuleName2.ts, 21, 11)) + +{ + + export var x = 1; +>x : Symbol(x, Decl(dottedModuleName2.ts, 25, 14)) + +} + + + +module M +>M : Symbol(M, Decl(dottedModuleName2.ts, 27, 1)) + +{ + + import X1 = A; +>X1 : Symbol(X1, Decl(dottedModuleName2.ts, 33, 1)) +>A : Symbol(X1, Decl(dottedModuleName2.ts, 0, 0), Decl(dottedModuleName2.ts, 18, 21)) + + import X2 = A.B; +>X2 : Symbol(X2, Decl(dottedModuleName2.ts, 35, 18)) +>A : Symbol(X1, Decl(dottedModuleName2.ts, 0, 0), Decl(dottedModuleName2.ts, 18, 21)) +>B : Symbol(X1.B, Decl(dottedModuleName2.ts, 0, 9), Decl(dottedModuleName2.ts, 21, 9)) + + import X3 = A.B.C; +>X3 : Symbol(X3, Decl(dottedModuleName2.ts, 37, 20)) +>A : Symbol(X1, Decl(dottedModuleName2.ts, 0, 0), Decl(dottedModuleName2.ts, 18, 21)) +>B : Symbol(X1.B, Decl(dottedModuleName2.ts, 0, 9), Decl(dottedModuleName2.ts, 21, 9)) +>C : Symbol(X2.C, Decl(dottedModuleName2.ts, 21, 11)) + +} + diff --git a/tests/baselines/reference/dottedModuleName2.types b/tests/baselines/reference/dottedModuleName2.types index e5a9806dd11..869bbfb4cfc 100644 --- a/tests/baselines/reference/dottedModuleName2.types +++ b/tests/baselines/reference/dottedModuleName2.types @@ -5,6 +5,7 @@ module A.B { export var x = 1; >x : number +>1 : number } @@ -16,6 +17,7 @@ module AA { export module B { export var x = 1; >x : number +>1 : number } } @@ -47,13 +49,14 @@ module A.B.C export var x = 1; >x : number +>1 : number } module M ->M : unknown +>M : any { diff --git a/tests/baselines/reference/dottedSymbolResolution1.symbols b/tests/baselines/reference/dottedSymbolResolution1.symbols new file mode 100644 index 00000000000..25ff8a6fe92 --- /dev/null +++ b/tests/baselines/reference/dottedSymbolResolution1.symbols @@ -0,0 +1,81 @@ +=== tests/cases/compiler/dottedSymbolResolution1.ts === +interface JQuery { +>JQuery : Symbol(JQuery, Decl(dottedSymbolResolution1.ts, 0, 0)) + + find(selector: string): JQuery; +>find : Symbol(find, Decl(dottedSymbolResolution1.ts, 0, 18)) +>selector : Symbol(selector, Decl(dottedSymbolResolution1.ts, 1, 9)) +>JQuery : Symbol(JQuery, Decl(dottedSymbolResolution1.ts, 0, 0)) +} + +interface JQueryStatic { +>JQueryStatic : Symbol(JQueryStatic, Decl(dottedSymbolResolution1.ts, 2, 1)) + + (selector: string): JQuery; +>selector : Symbol(selector, Decl(dottedSymbolResolution1.ts, 6, 5)) +>JQuery : Symbol(JQuery, Decl(dottedSymbolResolution1.ts, 0, 0)) + + (object: JQuery): JQuery; +>object : Symbol(object, Decl(dottedSymbolResolution1.ts, 7, 5)) +>JQuery : Symbol(JQuery, Decl(dottedSymbolResolution1.ts, 0, 0)) +>JQuery : Symbol(JQuery, Decl(dottedSymbolResolution1.ts, 0, 0)) +} + +class Base { foo() { } } +>Base : Symbol(Base, Decl(dottedSymbolResolution1.ts, 8, 1)) +>foo : Symbol(foo, Decl(dottedSymbolResolution1.ts, 10, 12)) + +function each(collection: string, callback: (indexInArray: any, valueOfElement: any) => any): any; +>each : Symbol(each, Decl(dottedSymbolResolution1.ts, 10, 24), Decl(dottedSymbolResolution1.ts, 12, 98), Decl(dottedSymbolResolution1.ts, 13, 102)) +>collection : Symbol(collection, Decl(dottedSymbolResolution1.ts, 12, 14)) +>callback : Symbol(callback, Decl(dottedSymbolResolution1.ts, 12, 33)) +>indexInArray : Symbol(indexInArray, Decl(dottedSymbolResolution1.ts, 12, 45)) +>valueOfElement : Symbol(valueOfElement, Decl(dottedSymbolResolution1.ts, 12, 63)) + +function each(collection: JQuery, callback: (indexInArray: number, valueOfElement: Base) => any): any; +>each : Symbol(each, Decl(dottedSymbolResolution1.ts, 10, 24), Decl(dottedSymbolResolution1.ts, 12, 98), Decl(dottedSymbolResolution1.ts, 13, 102)) +>collection : Symbol(collection, Decl(dottedSymbolResolution1.ts, 13, 14)) +>JQuery : Symbol(JQuery, Decl(dottedSymbolResolution1.ts, 0, 0)) +>callback : Symbol(callback, Decl(dottedSymbolResolution1.ts, 13, 33)) +>indexInArray : Symbol(indexInArray, Decl(dottedSymbolResolution1.ts, 13, 45)) +>valueOfElement : Symbol(valueOfElement, Decl(dottedSymbolResolution1.ts, 13, 66)) +>Base : Symbol(Base, Decl(dottedSymbolResolution1.ts, 8, 1)) + +function each(collection: any, callback: (indexInArray: any, valueOfElement: any) => any): any { +>each : Symbol(each, Decl(dottedSymbolResolution1.ts, 10, 24), Decl(dottedSymbolResolution1.ts, 12, 98), Decl(dottedSymbolResolution1.ts, 13, 102)) +>collection : Symbol(collection, Decl(dottedSymbolResolution1.ts, 14, 14)) +>callback : Symbol(callback, Decl(dottedSymbolResolution1.ts, 14, 30)) +>indexInArray : Symbol(indexInArray, Decl(dottedSymbolResolution1.ts, 14, 42)) +>valueOfElement : Symbol(valueOfElement, Decl(dottedSymbolResolution1.ts, 14, 60)) + + return null; +} + +function _setBarAndText(): void { +>_setBarAndText : Symbol(_setBarAndText, Decl(dottedSymbolResolution1.ts, 16, 1)) + + var x: JQuery, $: JQueryStatic +>x : Symbol(x, Decl(dottedSymbolResolution1.ts, 19, 7)) +>JQuery : Symbol(JQuery, Decl(dottedSymbolResolution1.ts, 0, 0)) +>$ : Symbol($, Decl(dottedSymbolResolution1.ts, 19, 18)) +>JQueryStatic : Symbol(JQueryStatic, Decl(dottedSymbolResolution1.ts, 2, 1)) + + each(x.find(" "), function () { +>each : Symbol(each, Decl(dottedSymbolResolution1.ts, 10, 24), Decl(dottedSymbolResolution1.ts, 12, 98), Decl(dottedSymbolResolution1.ts, 13, 102)) +>x.find : Symbol(JQuery.find, Decl(dottedSymbolResolution1.ts, 0, 18)) +>x : Symbol(x, Decl(dottedSymbolResolution1.ts, 19, 7)) +>find : Symbol(JQuery.find, Decl(dottedSymbolResolution1.ts, 0, 18)) + + var $this: JQuery = $(''), +>$this : Symbol($this, Decl(dottedSymbolResolution1.ts, 21, 11)) +>JQuery : Symbol(JQuery, Decl(dottedSymbolResolution1.ts, 0, 0)) +>$ : Symbol($, Decl(dottedSymbolResolution1.ts, 19, 18)) + + thisBar = $this.find(".fx-usagebars-calloutbar-this"); // bug lead to 'could not find dotted symbol' here +>thisBar : Symbol(thisBar, Decl(dottedSymbolResolution1.ts, 21, 34)) +>$this.find : Symbol(JQuery.find, Decl(dottedSymbolResolution1.ts, 0, 18)) +>$this : Symbol($this, Decl(dottedSymbolResolution1.ts, 21, 11)) +>find : Symbol(JQuery.find, Decl(dottedSymbolResolution1.ts, 0, 18)) + + } ); +} diff --git a/tests/baselines/reference/dottedSymbolResolution1.types b/tests/baselines/reference/dottedSymbolResolution1.types index 776b9704e73..cf5a5e3ba9d 100644 --- a/tests/baselines/reference/dottedSymbolResolution1.types +++ b/tests/baselines/reference/dottedSymbolResolution1.types @@ -49,6 +49,7 @@ function each(collection: any, callback: (indexInArray: any, valueOfElement: any >valueOfElement : any return null; +>null : null } function _setBarAndText(): void { @@ -67,6 +68,7 @@ function _setBarAndText(): void { >x.find : (selector: string) => JQuery >x : JQuery >find : (selector: string) => JQuery +>" " : string >function () { var $this: JQuery = $(''), thisBar = $this.find(".fx-usagebars-calloutbar-this"); // bug lead to 'could not find dotted symbol' here } : () => void var $this: JQuery = $(''), @@ -74,6 +76,7 @@ function _setBarAndText(): void { >JQuery : JQuery >$('') : JQuery >$ : JQueryStatic +>'' : string thisBar = $this.find(".fx-usagebars-calloutbar-this"); // bug lead to 'could not find dotted symbol' here >thisBar : JQuery @@ -81,6 +84,7 @@ function _setBarAndText(): void { >$this.find : (selector: string) => JQuery >$this : JQuery >find : (selector: string) => JQuery +>".fx-usagebars-calloutbar-this" : string } ); } diff --git a/tests/baselines/reference/downlevelLetConst10.symbols b/tests/baselines/reference/downlevelLetConst10.symbols new file mode 100644 index 00000000000..ba0aac7adb5 --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst10.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/downlevelLetConst10.ts === +let a: number = 1 +>a : Symbol(a, Decl(downlevelLetConst10.ts, 0, 3)) + diff --git a/tests/baselines/reference/downlevelLetConst10.types b/tests/baselines/reference/downlevelLetConst10.types index 05fe3029455..3d700b0694d 100644 --- a/tests/baselines/reference/downlevelLetConst10.types +++ b/tests/baselines/reference/downlevelLetConst10.types @@ -1,4 +1,5 @@ === tests/cases/compiler/downlevelLetConst10.ts === let a: number = 1 >a : number +>1 : number diff --git a/tests/baselines/reference/downlevelLetConst12.js b/tests/baselines/reference/downlevelLetConst12.js index 6437d17accb..bd0ab2fb46f 100644 --- a/tests/baselines/reference/downlevelLetConst12.js +++ b/tests/baselines/reference/downlevelLetConst12.js @@ -16,7 +16,7 @@ const {a: baz4} = { a: 1 }; // top level let\const should not be renamed var foo; var bar = 1; -var baz = ([])[0]; -var baz2 = ({ a: 1 }).a; -var baz3 = ([])[0]; -var baz4 = ({ a: 1 }).a; +var baz = [][0]; +var baz2 = { a: 1 }.a; +var baz3 = [][0]; +var baz4 = { a: 1 }.a; diff --git a/tests/baselines/reference/downlevelLetConst12.symbols b/tests/baselines/reference/downlevelLetConst12.symbols new file mode 100644 index 00000000000..d1c7fe3ea5b --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst12.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/downlevelLetConst12.ts === + +'use strict' +// top level let\const should not be renamed +let foo; +>foo : Symbol(foo, Decl(downlevelLetConst12.ts, 3, 3)) + +const bar = 1; +>bar : Symbol(bar, Decl(downlevelLetConst12.ts, 4, 5)) + +let [baz] = []; +>baz : Symbol(baz, Decl(downlevelLetConst12.ts, 6, 5)) + +let {a: baz2} = { a: 1 }; +>baz2 : Symbol(baz2, Decl(downlevelLetConst12.ts, 7, 5)) +>a : Symbol(a, Decl(downlevelLetConst12.ts, 7, 17)) + +const [baz3] = [] +>baz3 : Symbol(baz3, Decl(downlevelLetConst12.ts, 9, 7)) + +const {a: baz4} = { a: 1 }; +>baz4 : Symbol(baz4, Decl(downlevelLetConst12.ts, 10, 7)) +>a : Symbol(a, Decl(downlevelLetConst12.ts, 10, 19)) + diff --git a/tests/baselines/reference/downlevelLetConst12.types b/tests/baselines/reference/downlevelLetConst12.types index 90a814e0753..51d3b8eb086 100644 --- a/tests/baselines/reference/downlevelLetConst12.types +++ b/tests/baselines/reference/downlevelLetConst12.types @@ -1,30 +1,35 @@ === tests/cases/compiler/downlevelLetConst12.ts === 'use strict' +>'use strict' : string + // top level let\const should not be renamed let foo; >foo : any const bar = 1; >bar : number +>1 : number let [baz] = []; >baz : any >[] : undefined[] let {a: baz2} = { a: 1 }; ->a : unknown +>a : any >baz2 : number >{ a: 1 } : { a: number; } >a : number +>1 : number const [baz3] = [] >baz3 : any >[] : undefined[] const {a: baz4} = { a: 1 }; ->a : unknown +>a : any >baz4 : number >{ a: 1 } : { a: number; } >a : number +>1 : number diff --git a/tests/baselines/reference/downlevelLetConst13.js b/tests/baselines/reference/downlevelLetConst13.js index 8324d697e95..b6baf850800 100644 --- a/tests/baselines/reference/downlevelLetConst13.js +++ b/tests/baselines/reference/downlevelLetConst13.js @@ -24,16 +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/downlevelLetConst13.symbols b/tests/baselines/reference/downlevelLetConst13.symbols new file mode 100644 index 00000000000..1b06184f2b3 --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst13.symbols @@ -0,0 +1,48 @@ +=== tests/cases/compiler/downlevelLetConst13.ts === + +'use strict' +// exported let\const bindings should not be renamed + +export let foo = 10; +>foo : Symbol(foo, Decl(downlevelLetConst13.ts, 4, 10)) + +export const bar = "123" +>bar : Symbol(bar, Decl(downlevelLetConst13.ts, 5, 12)) + +export let [bar1] = [1]; +>bar1 : Symbol(bar1, Decl(downlevelLetConst13.ts, 6, 12)) + +export const [bar2] = [2]; +>bar2 : Symbol(bar2, Decl(downlevelLetConst13.ts, 7, 14)) + +export let {a: bar3} = { a: 1 }; +>bar3 : Symbol(bar3, Decl(downlevelLetConst13.ts, 8, 12)) +>a : Symbol(a, Decl(downlevelLetConst13.ts, 8, 24)) + +export const {a: bar4} = { a: 1 }; +>bar4 : Symbol(bar4, Decl(downlevelLetConst13.ts, 9, 14)) +>a : Symbol(a, Decl(downlevelLetConst13.ts, 9, 26)) + +export module M { +>M : Symbol(M, Decl(downlevelLetConst13.ts, 9, 34)) + + export let baz = 100; +>baz : Symbol(baz, Decl(downlevelLetConst13.ts, 12, 14)) + + export const baz2 = true; +>baz2 : Symbol(baz2, Decl(downlevelLetConst13.ts, 13, 16)) + + export let [bar5] = [1]; +>bar5 : Symbol(bar5, Decl(downlevelLetConst13.ts, 14, 16)) + + export const [bar6] = [2]; +>bar6 : Symbol(bar6, Decl(downlevelLetConst13.ts, 15, 18)) + + export let {a: bar7} = { a: 1 }; +>bar7 : Symbol(bar7, Decl(downlevelLetConst13.ts, 16, 16)) +>a : Symbol(a, Decl(downlevelLetConst13.ts, 16, 28)) + + export const {a: bar8} = { a: 1 }; +>bar8 : Symbol(bar8, Decl(downlevelLetConst13.ts, 17, 18)) +>a : Symbol(a, Decl(downlevelLetConst13.ts, 17, 30)) +} diff --git a/tests/baselines/reference/downlevelLetConst13.types b/tests/baselines/reference/downlevelLetConst13.types index e72e3936f43..0453d3a6ad3 100644 --- a/tests/baselines/reference/downlevelLetConst13.types +++ b/tests/baselines/reference/downlevelLetConst13.types @@ -1,60 +1,74 @@ === tests/cases/compiler/downlevelLetConst13.ts === 'use strict' +>'use strict' : string + // exported let\const bindings should not be renamed export let foo = 10; >foo : number +>10 : number export const bar = "123" >bar : string +>"123" : string export let [bar1] = [1]; >bar1 : number >[1] : [number] +>1 : number export const [bar2] = [2]; >bar2 : number >[2] : [number] +>2 : number export let {a: bar3} = { a: 1 }; ->a : unknown +>a : any >bar3 : number >{ a: 1 } : { a: number; } >a : number +>1 : number export const {a: bar4} = { a: 1 }; ->a : unknown +>a : any >bar4 : number >{ a: 1 } : { a: number; } >a : number +>1 : number export module M { >M : typeof M export let baz = 100; >baz : number +>100 : number export const baz2 = true; >baz2 : boolean +>true : boolean export let [bar5] = [1]; >bar5 : number >[1] : [number] +>1 : number export const [bar6] = [2]; >bar6 : number >[2] : [number] +>2 : number export let {a: bar7} = { a: 1 }; ->a : unknown +>a : any >bar7 : number >{ a: 1 } : { a: number; } >a : number +>1 : number export const {a: bar8} = { a: 1 }; ->a : unknown +>a : any >bar8 : number >{ a: 1 } : { a: number; } >a : number +>1 : number } diff --git a/tests/baselines/reference/downlevelLetConst14.js b/tests/baselines/reference/downlevelLetConst14.js index d45cf10d3a7..cddfb967217 100644 --- a/tests/baselines/reference/downlevelLetConst14.js +++ b/tests/baselines/reference/downlevelLetConst14.js @@ -61,13 +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); @@ -79,10 +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); } @@ -95,10 +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/downlevelLetConst14.symbols b/tests/baselines/reference/downlevelLetConst14.symbols new file mode 100644 index 00000000000..bf3450af71c --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst14.symbols @@ -0,0 +1,147 @@ +=== tests/cases/compiler/downlevelLetConst14.ts === +'use strict' +declare function use(a: any); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>a : Symbol(a, Decl(downlevelLetConst14.ts, 1, 21)) + +var x = 10; +>x : Symbol(x, Decl(downlevelLetConst14.ts, 3, 3)) + +var z0, z1, z2, z3; +>z0 : Symbol(z0, Decl(downlevelLetConst14.ts, 4, 3)) +>z1 : Symbol(z1, Decl(downlevelLetConst14.ts, 4, 7)) +>z2 : Symbol(z2, Decl(downlevelLetConst14.ts, 4, 11)) +>z3 : Symbol(z3, Decl(downlevelLetConst14.ts, 4, 15)) +{ + let x = 20; +>x : Symbol(x, Decl(downlevelLetConst14.ts, 6, 7)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst14.ts, 6, 7)) + + let [z0] = [1]; +>z0 : Symbol(z0, Decl(downlevelLetConst14.ts, 9, 9)) + + use(z0); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>z0 : Symbol(z0, Decl(downlevelLetConst14.ts, 9, 9)) + + let [z1] = [1] +>z1 : Symbol(z1, Decl(downlevelLetConst14.ts, 11, 9)) + + use(z1); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>z1 : Symbol(z1, Decl(downlevelLetConst14.ts, 11, 9)) + + let {a: z2} = { a: 1 }; +>z2 : Symbol(z2, Decl(downlevelLetConst14.ts, 13, 9)) +>a : Symbol(a, Decl(downlevelLetConst14.ts, 13, 19)) + + use(z2); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>z2 : Symbol(z2, Decl(downlevelLetConst14.ts, 13, 9)) + + let {a: z3} = { a: 1 }; +>z3 : Symbol(z3, Decl(downlevelLetConst14.ts, 15, 9)) +>a : Symbol(a, Decl(downlevelLetConst14.ts, 15, 19)) + + use(z3); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>z3 : Symbol(z3, Decl(downlevelLetConst14.ts, 15, 9)) +} +use(x); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst14.ts, 3, 3)) + +use(z0); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>z0 : Symbol(z0, Decl(downlevelLetConst14.ts, 4, 3)) + +use(z1); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>z1 : Symbol(z1, Decl(downlevelLetConst14.ts, 4, 7)) + +use(z2); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>z2 : Symbol(z2, Decl(downlevelLetConst14.ts, 4, 11)) + +use(z3); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>z3 : Symbol(z3, Decl(downlevelLetConst14.ts, 4, 15)) + +var z6; +>z6 : Symbol(z6, Decl(downlevelLetConst14.ts, 23, 3)) + +var y = true; +>y : Symbol(y, Decl(downlevelLetConst14.ts, 24, 3)) +{ + let y = ""; +>y : Symbol(y, Decl(downlevelLetConst14.ts, 26, 7)) + + let [z6] = [true] +>z6 : Symbol(z6, Decl(downlevelLetConst14.ts, 27, 9)) + { + let y = 1; +>y : Symbol(y, Decl(downlevelLetConst14.ts, 29, 11)) + + let {a: z6} = {a: 1} +>z6 : Symbol(z6, Decl(downlevelLetConst14.ts, 30, 13)) +>a : Symbol(a, Decl(downlevelLetConst14.ts, 30, 23)) + + use(y); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>y : Symbol(y, Decl(downlevelLetConst14.ts, 29, 11)) + + use(z6); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>z6 : Symbol(z6, Decl(downlevelLetConst14.ts, 30, 13)) + } + use(y); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>y : Symbol(y, Decl(downlevelLetConst14.ts, 26, 7)) + + use(z6); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>z6 : Symbol(z6, Decl(downlevelLetConst14.ts, 27, 9)) +} +use(y); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>y : Symbol(y, Decl(downlevelLetConst14.ts, 24, 3)) + +use(z6); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>z6 : Symbol(z6, Decl(downlevelLetConst14.ts, 23, 3)) + +var z = false; +>z : Symbol(z, Decl(downlevelLetConst14.ts, 40, 3)) + +var z5 = 1; +>z5 : Symbol(z5, Decl(downlevelLetConst14.ts, 41, 3)) +{ + let z = ""; +>z : Symbol(z, Decl(downlevelLetConst14.ts, 43, 7)) + + let [z5] = [5]; +>z5 : Symbol(z5, Decl(downlevelLetConst14.ts, 44, 9)) + { + let _z = 1; +>_z : Symbol(_z, Decl(downlevelLetConst14.ts, 46, 11)) + + let {a: _z5} = { a: 1 }; +>_z5 : Symbol(_z5, Decl(downlevelLetConst14.ts, 47, 13)) +>a : Symbol(a, Decl(downlevelLetConst14.ts, 47, 24)) + + // try to step on generated name + use(_z); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>_z : Symbol(_z, Decl(downlevelLetConst14.ts, 46, 11)) + } + use(z); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>z : Symbol(z, Decl(downlevelLetConst14.ts, 43, 7)) +} +use(y); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>y : Symbol(y, Decl(downlevelLetConst14.ts, 24, 3)) + diff --git a/tests/baselines/reference/downlevelLetConst14.types b/tests/baselines/reference/downlevelLetConst14.types index 05b66948830..ea6aadfe2a8 100644 --- a/tests/baselines/reference/downlevelLetConst14.types +++ b/tests/baselines/reference/downlevelLetConst14.types @@ -1,11 +1,14 @@ === tests/cases/compiler/downlevelLetConst14.ts === 'use strict' +>'use strict' : string + declare function use(a: any); >use : (a: any) => any >a : any var x = 10; >x : number +>10 : number var z0, z1, z2, z3; >z0 : any @@ -15,6 +18,7 @@ var z0, z1, z2, z3; { let x = 20; >x : number +>20 : number use(x); >use(x) : any @@ -24,6 +28,7 @@ var z0, z1, z2, z3; let [z0] = [1]; >z0 : number >[1] : [number] +>1 : number use(z0); >use(z0) : any @@ -33,6 +38,7 @@ var z0, z1, z2, z3; let [z1] = [1] >z1 : number >[1] : [number] +>1 : number use(z1); >use(z1) : any @@ -40,10 +46,11 @@ var z0, z1, z2, z3; >z1 : number let {a: z2} = { a: 1 }; ->a : unknown +>a : any >z2 : number >{ a: 1 } : { a: number; } >a : number +>1 : number use(z2); >use(z2) : any @@ -51,10 +58,11 @@ var z0, z1, z2, z3; >z2 : number let {a: z3} = { a: 1 }; ->a : unknown +>a : any >z3 : number >{ a: 1 } : { a: number; } >a : number +>1 : number use(z3); >use(z3) : any @@ -91,22 +99,27 @@ var z6; var y = true; >y : boolean +>true : boolean { let y = ""; >y : string +>"" : string let [z6] = [true] >z6 : boolean >[true] : [boolean] +>true : boolean { let y = 1; >y : number +>1 : number let {a: z6} = {a: 1} ->a : unknown +>a : any >z6 : number >{a: 1} : { a: number; } >a : number +>1 : number use(y); >use(y) : any @@ -140,25 +153,31 @@ use(z6); var z = false; >z : boolean +>false : boolean var z5 = 1; >z5 : number +>1 : number { let z = ""; >z : string +>"" : string let [z5] = [5]; >z5 : number >[5] : [number] +>5 : number { let _z = 1; >_z : number +>1 : number let {a: _z5} = { a: 1 }; ->a : unknown +>a : any >_z5 : number >{ a: 1 } : { a: number; } >a : number +>1 : number // try to step on generated name use(_z); diff --git a/tests/baselines/reference/downlevelLetConst15.js b/tests/baselines/reference/downlevelLetConst15.js index 99522542d38..807f49bf84e 100644 --- a/tests/baselines/reference/downlevelLetConst15.js +++ b/tests/baselines/reference/downlevelLetConst15.js @@ -61,13 +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); @@ -79,10 +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); } @@ -95,10 +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.symbols b/tests/baselines/reference/downlevelLetConst15.symbols new file mode 100644 index 00000000000..159e5a6d676 --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst15.symbols @@ -0,0 +1,149 @@ +=== tests/cases/compiler/downlevelLetConst15.ts === +'use strict' +declare function use(a: any); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>a : Symbol(a, Decl(downlevelLetConst15.ts, 1, 21)) + +var x = 10; +>x : Symbol(x, Decl(downlevelLetConst15.ts, 3, 3)) + +var z0, z1, z2, z3; +>z0 : Symbol(z0, Decl(downlevelLetConst15.ts, 4, 3)) +>z1 : Symbol(z1, Decl(downlevelLetConst15.ts, 4, 7)) +>z2 : Symbol(z2, Decl(downlevelLetConst15.ts, 4, 11)) +>z3 : Symbol(z3, Decl(downlevelLetConst15.ts, 4, 15)) +{ + const x = 20; +>x : Symbol(x, Decl(downlevelLetConst15.ts, 6, 9)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst15.ts, 6, 9)) + + const [z0] = [1]; +>z0 : Symbol(z0, Decl(downlevelLetConst15.ts, 9, 11)) + + use(z0); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>z0 : Symbol(z0, Decl(downlevelLetConst15.ts, 9, 11)) + + const [{a: z1}] = [{a: 1}] +>z1 : Symbol(z1, Decl(downlevelLetConst15.ts, 11, 12)) +>a : Symbol(a, Decl(downlevelLetConst15.ts, 11, 24)) + + use(z1); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>z1 : Symbol(z1, Decl(downlevelLetConst15.ts, 11, 12)) + + const {a: z2} = { a: 1 }; +>z2 : Symbol(z2, Decl(downlevelLetConst15.ts, 13, 11)) +>a : Symbol(a, Decl(downlevelLetConst15.ts, 13, 21)) + + use(z2); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>z2 : Symbol(z2, Decl(downlevelLetConst15.ts, 13, 11)) + + const {a: {b: z3}} = { a: {b: 1} }; +>z3 : Symbol(z3, Decl(downlevelLetConst15.ts, 15, 15)) +>a : Symbol(a, Decl(downlevelLetConst15.ts, 15, 26)) +>b : Symbol(b, Decl(downlevelLetConst15.ts, 15, 31)) + + use(z3); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>z3 : Symbol(z3, Decl(downlevelLetConst15.ts, 15, 15)) +} +use(x); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst15.ts, 3, 3)) + +use(z0); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>z0 : Symbol(z0, Decl(downlevelLetConst15.ts, 4, 3)) + +use(z1); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>z1 : Symbol(z1, Decl(downlevelLetConst15.ts, 4, 7)) + +use(z2); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>z2 : Symbol(z2, Decl(downlevelLetConst15.ts, 4, 11)) + +use(z3); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>z3 : Symbol(z3, Decl(downlevelLetConst15.ts, 4, 15)) + +var z6; +>z6 : Symbol(z6, Decl(downlevelLetConst15.ts, 23, 3)) + +var y = true; +>y : Symbol(y, Decl(downlevelLetConst15.ts, 24, 3)) +{ + const y = ""; +>y : Symbol(y, Decl(downlevelLetConst15.ts, 26, 9)) + + const [z6] = [true] +>z6 : Symbol(z6, Decl(downlevelLetConst15.ts, 27, 11)) + { + const y = 1; +>y : Symbol(y, Decl(downlevelLetConst15.ts, 29, 13)) + + const {a: z6} = { a: 1 } +>z6 : Symbol(z6, Decl(downlevelLetConst15.ts, 30, 15)) +>a : Symbol(a, Decl(downlevelLetConst15.ts, 30, 25)) + + use(y); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>y : Symbol(y, Decl(downlevelLetConst15.ts, 29, 13)) + + use(z6); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>z6 : Symbol(z6, Decl(downlevelLetConst15.ts, 30, 15)) + } + use(y); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>y : Symbol(y, Decl(downlevelLetConst15.ts, 26, 9)) + + use(z6); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>z6 : Symbol(z6, Decl(downlevelLetConst15.ts, 27, 11)) +} +use(y); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>y : Symbol(y, Decl(downlevelLetConst15.ts, 24, 3)) + +use(z6); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>z6 : Symbol(z6, Decl(downlevelLetConst15.ts, 23, 3)) + +var z = false; +>z : Symbol(z, Decl(downlevelLetConst15.ts, 40, 3)) + +var z5 = 1; +>z5 : Symbol(z5, Decl(downlevelLetConst15.ts, 41, 3)) +{ + const z = ""; +>z : Symbol(z, Decl(downlevelLetConst15.ts, 43, 9)) + + const [z5] = [5]; +>z5 : Symbol(z5, Decl(downlevelLetConst15.ts, 44, 11)) + { + const _z = 1; +>_z : Symbol(_z, Decl(downlevelLetConst15.ts, 46, 13)) + + const {a: _z5} = { a: 1 }; +>_z5 : Symbol(_z5, Decl(downlevelLetConst15.ts, 47, 15)) +>a : Symbol(a, Decl(downlevelLetConst15.ts, 47, 26)) + + // try to step on generated name + use(_z); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>_z : Symbol(_z, Decl(downlevelLetConst15.ts, 46, 13)) + } + use(z); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>z : Symbol(z, Decl(downlevelLetConst15.ts, 43, 9)) +} +use(y); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>y : Symbol(y, Decl(downlevelLetConst15.ts, 24, 3)) + diff --git a/tests/baselines/reference/downlevelLetConst15.types b/tests/baselines/reference/downlevelLetConst15.types index 008d132ab70..72b29e3fe66 100644 --- a/tests/baselines/reference/downlevelLetConst15.types +++ b/tests/baselines/reference/downlevelLetConst15.types @@ -1,11 +1,14 @@ === tests/cases/compiler/downlevelLetConst15.ts === 'use strict' +>'use strict' : string + declare function use(a: any); >use : (a: any) => any >a : any var x = 10; >x : number +>10 : number var z0, z1, z2, z3; >z0 : any @@ -15,6 +18,7 @@ var z0, z1, z2, z3; { const x = 20; >x : number +>20 : number use(x); >use(x) : any @@ -24,6 +28,7 @@ var z0, z1, z2, z3; const [z0] = [1]; >z0 : number >[1] : [number] +>1 : number use(z0); >use(z0) : any @@ -31,11 +36,12 @@ var z0, z1, z2, z3; >z0 : number const [{a: z1}] = [{a: 1}] ->a : unknown +>a : any >z1 : number >[{a: 1}] : [{ a: number; }] >{a: 1} : { a: number; } >a : number +>1 : number use(z1); >use(z1) : any @@ -43,10 +49,11 @@ var z0, z1, z2, z3; >z1 : number const {a: z2} = { a: 1 }; ->a : unknown +>a : any >z2 : number >{ a: 1 } : { a: number; } >a : number +>1 : number use(z2); >use(z2) : any @@ -54,13 +61,14 @@ var z0, z1, z2, z3; >z2 : number const {a: {b: z3}} = { a: {b: 1} }; ->a : unknown ->b : unknown +>a : any +>b : any >z3 : number >{ a: {b: 1} } : { a: { b: number; }; } >a : { b: number; } >{b: 1} : { b: number; } >b : number +>1 : number use(z3); >use(z3) : any @@ -97,22 +105,27 @@ var z6; var y = true; >y : boolean +>true : boolean { const y = ""; >y : string +>"" : string const [z6] = [true] >z6 : boolean >[true] : [boolean] +>true : boolean { const y = 1; >y : number +>1 : number const {a: z6} = { a: 1 } ->a : unknown +>a : any >z6 : number >{ a: 1 } : { a: number; } >a : number +>1 : number use(y); >use(y) : any @@ -146,25 +159,31 @@ use(z6); var z = false; >z : boolean +>false : boolean var z5 = 1; >z5 : number +>1 : number { const z = ""; >z : string +>"" : string const [z5] = [5]; >z5 : number >[5] : [number] +>5 : number { const _z = 1; >_z : number +>1 : number const {a: _z5} = { a: 1 }; ->a : unknown +>a : any >_z5 : number >{ a: 1 } : { a: number; } >a : number +>1 : number // try to step on generated name use(_z); diff --git a/tests/baselines/reference/downlevelLetConst16.js b/tests/baselines/reference/downlevelLetConst16.js index 4765b50e0a1..874fc121191 100644 --- a/tests/baselines/reference/downlevelLetConst16.js +++ b/tests/baselines/reference/downlevelLetConst16.js @@ -238,18 +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); @@ -260,18 +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); @@ -284,18 +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); @@ -305,18 +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); @@ -325,9 +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; @@ -335,9 +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); @@ -346,9 +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; @@ -356,9 +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); @@ -369,10 +369,10 @@ function foo3() { for (var x_7 = void 0;;) { use(x_7); } - for (var y_7 = ([])[0];;) { + 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); @@ -381,10 +381,10 @@ function foo4() { for (var x_8 = 1;;) { use(x_8); } - for (var y_8 = ([])[0];;) { + 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/downlevelLetConst17.symbols b/tests/baselines/reference/downlevelLetConst17.symbols new file mode 100644 index 00000000000..809a835774c --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst17.symbols @@ -0,0 +1,134 @@ +=== tests/cases/compiler/downlevelLetConst17.ts === +'use strict' + +declare function use(a: any); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>a : Symbol(a, Decl(downlevelLetConst17.ts, 2, 21)) + +var x; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 4, 3)) + +for (let x = 10; ;) { +>x : Symbol(x, Decl(downlevelLetConst17.ts, 5, 8)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 5, 8)) +} +use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 4, 3)) + +for (const x = 10; ;) { +>x : Symbol(x, Decl(downlevelLetConst17.ts, 10, 10)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 10, 10)) +} + +for (; ;) { + let x = 10; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 15, 7)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 15, 7)) + + x = 1; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 15, 7)) +} + +for (; ;) { + const x = 10; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 21, 9)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 21, 9)) +} + +for (let x; ;) { +>x : Symbol(x, Decl(downlevelLetConst17.ts, 25, 8)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 25, 8)) + + x = 1; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 25, 8)) +} + +for (; ;) { + let x; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 31, 7)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 31, 7)) + + x = 1; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 31, 7)) +} + +while (true) { + let x; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 37, 7)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 37, 7)) +} + +while (true) { + const x = true; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 42, 9)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 42, 9)) +} + +do { + let x; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 47, 7)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 47, 7)) + +} while (true); + +do { + let x; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 52, 7)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 52, 7)) + +} while (true); + +for (let x in []) { +>x : Symbol(x, Decl(downlevelLetConst17.ts, 56, 8)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 56, 8)) +} + +for (const x in []) { +>x : Symbol(x, Decl(downlevelLetConst17.ts, 60, 10)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 60, 10)) +} + +for (const x of []) { +>x : Symbol(x, Decl(downlevelLetConst17.ts, 64, 10)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 64, 10)) +} diff --git a/tests/baselines/reference/downlevelLetConst17.types b/tests/baselines/reference/downlevelLetConst17.types index 0c5a8eaa86b..824abcc76be 100644 --- a/tests/baselines/reference/downlevelLetConst17.types +++ b/tests/baselines/reference/downlevelLetConst17.types @@ -1,5 +1,6 @@ === tests/cases/compiler/downlevelLetConst17.ts === 'use strict' +>'use strict' : string declare function use(a: any); >use : (a: any) => any @@ -10,6 +11,7 @@ var x; for (let x = 10; ;) { >x : number +>10 : number use(x); >use(x) : any @@ -23,6 +25,7 @@ use(x); for (const x = 10; ;) { >x : number +>10 : number use(x); >use(x) : any @@ -33,6 +36,7 @@ for (const x = 10; ;) { for (; ;) { let x = 10; >x : number +>10 : number use(x); >use(x) : any @@ -42,11 +46,13 @@ for (; ;) { x = 1; >x = 1 : number >x : number +>1 : number } for (; ;) { const x = 10; >x : number +>10 : number use(x); >use(x) : any @@ -65,6 +71,7 @@ for (let x; ;) { x = 1; >x = 1 : number >x : any +>1 : number } for (; ;) { @@ -79,9 +86,12 @@ for (; ;) { x = 1; >x = 1 : number >x : any +>1 : number } while (true) { +>true : boolean + let x; >x : any @@ -92,8 +102,11 @@ while (true) { } while (true) { +>true : boolean + const x = true; >x : boolean +>true : boolean use(x); >use(x) : any @@ -111,6 +124,7 @@ do { >x : any } while (true); +>true : boolean do { let x; @@ -122,6 +136,7 @@ do { >x : any } while (true); +>true : boolean for (let x in []) { >x : any diff --git a/tests/baselines/reference/downlevelLetConst19.symbols b/tests/baselines/reference/downlevelLetConst19.symbols new file mode 100644 index 00000000000..9ed23e43447 --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst19.symbols @@ -0,0 +1,42 @@ +=== tests/cases/compiler/downlevelLetConst19.ts === +'use strict' +declare function use(a: any); +>use : Symbol(use, Decl(downlevelLetConst19.ts, 0, 12)) +>a : Symbol(a, Decl(downlevelLetConst19.ts, 1, 21)) + +var x; +>x : Symbol(x, Decl(downlevelLetConst19.ts, 2, 3)) + +function a() { +>a : Symbol(a, Decl(downlevelLetConst19.ts, 2, 6)) + { + let x; +>x : Symbol(x, Decl(downlevelLetConst19.ts, 5, 7)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst19.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst19.ts, 5, 7)) + + function b() { +>b : Symbol(b, Decl(downlevelLetConst19.ts, 6, 11)) + { + let x; +>x : Symbol(x, Decl(downlevelLetConst19.ts, 10, 15)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst19.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst19.ts, 10, 15)) + } + use(x); +>use : Symbol(use, Decl(downlevelLetConst19.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst19.ts, 5, 7)) + } + } + use(x) +>use : Symbol(use, Decl(downlevelLetConst19.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst19.ts, 2, 3)) +} +use(x) +>use : Symbol(use, Decl(downlevelLetConst19.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst19.ts, 2, 3)) + diff --git a/tests/baselines/reference/downlevelLetConst19.types b/tests/baselines/reference/downlevelLetConst19.types index 492d10b59c9..687033c195a 100644 --- a/tests/baselines/reference/downlevelLetConst19.types +++ b/tests/baselines/reference/downlevelLetConst19.types @@ -1,5 +1,7 @@ === tests/cases/compiler/downlevelLetConst19.ts === 'use strict' +>'use strict' : string + declare function use(a: any); >use : (a: any) => any >a : any diff --git a/tests/baselines/reference/downlevelLetConst3.symbols b/tests/baselines/reference/downlevelLetConst3.symbols new file mode 100644 index 00000000000..26732da3352 --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst3.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/downlevelLetConst3.ts === +const a = 1 +>a : Symbol(a, Decl(downlevelLetConst3.ts, 0, 5)) + diff --git a/tests/baselines/reference/downlevelLetConst3.types b/tests/baselines/reference/downlevelLetConst3.types index 6cd3f85e074..cf8def45e3c 100644 --- a/tests/baselines/reference/downlevelLetConst3.types +++ b/tests/baselines/reference/downlevelLetConst3.types @@ -1,4 +1,5 @@ === tests/cases/compiler/downlevelLetConst3.ts === const a = 1 >a : number +>1 : number diff --git a/tests/baselines/reference/downlevelLetConst5.symbols b/tests/baselines/reference/downlevelLetConst5.symbols new file mode 100644 index 00000000000..93181df78de --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst5.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/downlevelLetConst5.ts === +const a: number = 1 +>a : Symbol(a, Decl(downlevelLetConst5.ts, 0, 5)) + diff --git a/tests/baselines/reference/downlevelLetConst5.types b/tests/baselines/reference/downlevelLetConst5.types index dd8cdf9fcdd..2cdf6ff53cc 100644 --- a/tests/baselines/reference/downlevelLetConst5.types +++ b/tests/baselines/reference/downlevelLetConst5.types @@ -1,4 +1,5 @@ === tests/cases/compiler/downlevelLetConst5.ts === const a: number = 1 >a : number +>1 : number diff --git a/tests/baselines/reference/downlevelLetConst7.symbols b/tests/baselines/reference/downlevelLetConst7.symbols new file mode 100644 index 00000000000..1db555c4273 --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst7.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/downlevelLetConst7.ts === +let a +>a : Symbol(a, Decl(downlevelLetConst7.ts, 0, 3)) + diff --git a/tests/baselines/reference/downlevelLetConst8.symbols b/tests/baselines/reference/downlevelLetConst8.symbols new file mode 100644 index 00000000000..68e8e06c2c1 --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst8.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/downlevelLetConst8.ts === +let a = 1 +>a : Symbol(a, Decl(downlevelLetConst8.ts, 0, 3)) + diff --git a/tests/baselines/reference/downlevelLetConst8.types b/tests/baselines/reference/downlevelLetConst8.types index a3b9986bbc8..c941d673503 100644 --- a/tests/baselines/reference/downlevelLetConst8.types +++ b/tests/baselines/reference/downlevelLetConst8.types @@ -1,4 +1,5 @@ === tests/cases/compiler/downlevelLetConst8.ts === let a = 1 >a : number +>1 : number diff --git a/tests/baselines/reference/downlevelLetConst9.symbols b/tests/baselines/reference/downlevelLetConst9.symbols new file mode 100644 index 00000000000..7b11987ea08 --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst9.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/downlevelLetConst9.ts === +let a: number +>a : Symbol(a, Decl(downlevelLetConst9.ts, 0, 3)) + diff --git a/tests/baselines/reference/duplicateAnonymousInners1.symbols b/tests/baselines/reference/duplicateAnonymousInners1.symbols new file mode 100644 index 00000000000..8cf2a3301c3 --- /dev/null +++ b/tests/baselines/reference/duplicateAnonymousInners1.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/duplicateAnonymousInners1.ts === +module Foo { +>Foo : Symbol(Foo, Decl(duplicateAnonymousInners1.ts, 0, 0), Decl(duplicateAnonymousInners1.ts, 10, 1)) + + class Helper { +>Helper : Symbol(Helper, Decl(duplicateAnonymousInners1.ts, 0, 12)) + + } + + class Inner {} +>Inner : Symbol(Inner, Decl(duplicateAnonymousInners1.ts, 4, 5)) + + // Inner should show up in intellisense + + export var Outer=0; +>Outer : Symbol(Outer, Decl(duplicateAnonymousInners1.ts, 9, 14)) +} + + +module Foo { +>Foo : Symbol(Foo, Decl(duplicateAnonymousInners1.ts, 0, 0), Decl(duplicateAnonymousInners1.ts, 10, 1)) + + // Should not be an error + class Helper { +>Helper : Symbol(Helper, Decl(duplicateAnonymousInners1.ts, 13, 12)) + + } + + // Inner should not show up in intellisense + // Outer should show up in intellisense + +} + diff --git a/tests/baselines/reference/duplicateAnonymousInners1.types b/tests/baselines/reference/duplicateAnonymousInners1.types index 7c63fb4163b..6840e5a14f6 100644 --- a/tests/baselines/reference/duplicateAnonymousInners1.types +++ b/tests/baselines/reference/duplicateAnonymousInners1.types @@ -14,6 +14,7 @@ module Foo { export var Outer=0; >Outer : number +>0 : number } diff --git a/tests/baselines/reference/duplicateAnonymousModuleClasses.symbols b/tests/baselines/reference/duplicateAnonymousModuleClasses.symbols new file mode 100644 index 00000000000..60120c09375 --- /dev/null +++ b/tests/baselines/reference/duplicateAnonymousModuleClasses.symbols @@ -0,0 +1,71 @@ +=== tests/cases/compiler/duplicateAnonymousModuleClasses.ts === +module F { +>F : Symbol(F, Decl(duplicateAnonymousModuleClasses.ts, 0, 0), Decl(duplicateAnonymousModuleClasses.ts, 6, 1)) + + class Helper { +>Helper : Symbol(Helper, Decl(duplicateAnonymousModuleClasses.ts, 0, 10)) + + } + +} + + +module F { +>F : Symbol(F, Decl(duplicateAnonymousModuleClasses.ts, 0, 0), Decl(duplicateAnonymousModuleClasses.ts, 6, 1)) + + // Should not be an error + class Helper { +>Helper : Symbol(Helper, Decl(duplicateAnonymousModuleClasses.ts, 9, 10)) + + } + +} + +module Foo { +>Foo : Symbol(Foo, Decl(duplicateAnonymousModuleClasses.ts, 16, 1), Decl(duplicateAnonymousModuleClasses.ts, 24, 1)) + + class Helper { +>Helper : Symbol(Helper, Decl(duplicateAnonymousModuleClasses.ts, 18, 12)) + + } + +} + + +module Foo { +>Foo : Symbol(Foo, Decl(duplicateAnonymousModuleClasses.ts, 16, 1), Decl(duplicateAnonymousModuleClasses.ts, 24, 1)) + + // Should not be an error + class Helper { +>Helper : Symbol(Helper, Decl(duplicateAnonymousModuleClasses.ts, 27, 12)) + + } + +} + +module Gar { +>Gar : Symbol(Gar, Decl(duplicateAnonymousModuleClasses.ts, 34, 1)) + + module Foo { +>Foo : Symbol(Foo, Decl(duplicateAnonymousModuleClasses.ts, 36, 12), Decl(duplicateAnonymousModuleClasses.ts, 43, 5)) + + class Helper { +>Helper : Symbol(Helper, Decl(duplicateAnonymousModuleClasses.ts, 37, 16)) + + } + + } + + + module Foo { +>Foo : Symbol(Foo, Decl(duplicateAnonymousModuleClasses.ts, 36, 12), Decl(duplicateAnonymousModuleClasses.ts, 43, 5)) + + // Should not be an error + class Helper { +>Helper : Symbol(Helper, Decl(duplicateAnonymousModuleClasses.ts, 46, 16)) + + } + + } +} + diff --git a/tests/baselines/reference/duplicateConstructSignature.symbols b/tests/baselines/reference/duplicateConstructSignature.symbols new file mode 100644 index 00000000000..e34f9738d8b --- /dev/null +++ b/tests/baselines/reference/duplicateConstructSignature.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/duplicateConstructSignature.ts === +interface I { +>I : Symbol(I, Decl(duplicateConstructSignature.ts, 0, 0)) + + (): number; + (): string; +} diff --git a/tests/baselines/reference/duplicateConstructSignature2.symbols b/tests/baselines/reference/duplicateConstructSignature2.symbols new file mode 100644 index 00000000000..f07e3f39b4c --- /dev/null +++ b/tests/baselines/reference/duplicateConstructSignature2.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/duplicateConstructSignature2.ts === +interface I { +>I : Symbol(I, Decl(duplicateConstructSignature2.ts, 0, 0)) +>T : Symbol(T, Decl(duplicateConstructSignature2.ts, 0, 12)) + + (x: T): number; +>x : Symbol(x, Decl(duplicateConstructSignature2.ts, 1, 5)) +>T : Symbol(T, Decl(duplicateConstructSignature2.ts, 0, 12)) + + (x: T): string; +>x : Symbol(x, Decl(duplicateConstructSignature2.ts, 2, 5)) +>T : Symbol(T, Decl(duplicateConstructSignature2.ts, 0, 12)) +} diff --git a/tests/baselines/reference/duplicateConstructorOverloadSignature.symbols b/tests/baselines/reference/duplicateConstructorOverloadSignature.symbols new file mode 100644 index 00000000000..a5313302e13 --- /dev/null +++ b/tests/baselines/reference/duplicateConstructorOverloadSignature.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/duplicateConstructorOverloadSignature.ts === +class C { +>C : Symbol(C, Decl(duplicateConstructorOverloadSignature.ts, 0, 0)) + + constructor(x: number); +>x : Symbol(x, Decl(duplicateConstructorOverloadSignature.ts, 1, 16)) + + constructor(x: number); +>x : Symbol(x, Decl(duplicateConstructorOverloadSignature.ts, 2, 16)) + + constructor(x: any) { } +>x : Symbol(x, Decl(duplicateConstructorOverloadSignature.ts, 3, 16)) +} diff --git a/tests/baselines/reference/duplicateConstructorOverloadSignature2.symbols b/tests/baselines/reference/duplicateConstructorOverloadSignature2.symbols new file mode 100644 index 00000000000..c3c08ece56d --- /dev/null +++ b/tests/baselines/reference/duplicateConstructorOverloadSignature2.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/duplicateConstructorOverloadSignature2.ts === +class C { +>C : Symbol(C, Decl(duplicateConstructorOverloadSignature2.ts, 0, 0)) +>T : Symbol(T, Decl(duplicateConstructorOverloadSignature2.ts, 0, 8)) + + constructor(x: T); +>x : Symbol(x, Decl(duplicateConstructorOverloadSignature2.ts, 1, 16)) +>T : Symbol(T, Decl(duplicateConstructorOverloadSignature2.ts, 0, 8)) + + constructor(x: T); +>x : Symbol(x, Decl(duplicateConstructorOverloadSignature2.ts, 2, 16)) +>T : Symbol(T, Decl(duplicateConstructorOverloadSignature2.ts, 0, 8)) + + constructor(x: any) { } +>x : Symbol(x, Decl(duplicateConstructorOverloadSignature2.ts, 3, 16)) +} diff --git a/tests/baselines/reference/duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.symbols b/tests/baselines/reference/duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.symbols new file mode 100644 index 00000000000..61cc569b965 --- /dev/null +++ b/tests/baselines/reference/duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.symbols @@ -0,0 +1,3 @@ +=== tests/cases/compiler/duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.ts === + +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/duplicateLabel3.symbols b/tests/baselines/reference/duplicateLabel3.symbols new file mode 100644 index 00000000000..07d0ded2923 --- /dev/null +++ b/tests/baselines/reference/duplicateLabel3.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/duplicateLabel3.ts === +target: +while (true) { + function f() { +>f : Symbol(f, Decl(duplicateLabel3.ts, 1, 14)) + + target: + while (true) { + } + } +} diff --git a/tests/baselines/reference/duplicateLabel3.types b/tests/baselines/reference/duplicateLabel3.types index d4a26fa22a0..8d75b08c768 100644 --- a/tests/baselines/reference/duplicateLabel3.types +++ b/tests/baselines/reference/duplicateLabel3.types @@ -1,11 +1,18 @@ === tests/cases/compiler/duplicateLabel3.ts === target: +>target : any + while (true) { +>true : boolean + function f() { >f : () => void target: +>target : any + while (true) { +>true : boolean } } } diff --git a/tests/baselines/reference/duplicateLabel4.symbols b/tests/baselines/reference/duplicateLabel4.symbols new file mode 100644 index 00000000000..c671abcef35 --- /dev/null +++ b/tests/baselines/reference/duplicateLabel4.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/duplicateLabel4.ts === +target: +No type information for this code.while (true) { +No type information for this code.} +No type information for this code. +No type information for this code.target: +No type information for this code.while (true) { +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/duplicateLabel4.types b/tests/baselines/reference/duplicateLabel4.types index c671abcef35..9238986b582 100644 --- a/tests/baselines/reference/duplicateLabel4.types +++ b/tests/baselines/reference/duplicateLabel4.types @@ -1,9 +1,14 @@ === tests/cases/compiler/duplicateLabel4.ts === target: -No type information for this code.while (true) { -No type information for this code.} -No type information for this code. -No type information for this code.target: -No type information for this code.while (true) { -No type information for this code.} -No type information for this code. \ No newline at end of file +>target : any + +while (true) { +>true : boolean +} + +target: +>target : any + +while (true) { +>true : boolean +} diff --git a/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.symbols b/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.symbols new file mode 100644 index 00000000000..41916162553 --- /dev/null +++ b/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.symbols @@ -0,0 +1,54 @@ +=== tests/cases/compiler/duplicateOverloadInTypeAugmentation1.ts === +interface Array { +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 0)) +>T : Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) + + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, +>reduce : Symbol(reduce, Decl(lib.d.ts, 1129, 93), Decl(lib.d.ts, 1136, 120), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 20), Decl(duplicateOverloadInTypeAugmentation1.ts, 2, 29)) +>callbackfn : Symbol(callbackfn, Decl(duplicateOverloadInTypeAugmentation1.ts, 1, 11)) +>previousValue : Symbol(previousValue, Decl(duplicateOverloadInTypeAugmentation1.ts, 1, 24)) +>T : Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) +>currentValue : Symbol(currentValue, Decl(duplicateOverloadInTypeAugmentation1.ts, 1, 41)) +>T : Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) +>currentIndex : Symbol(currentIndex, Decl(duplicateOverloadInTypeAugmentation1.ts, 1, 58)) +>array : Symbol(array, Decl(duplicateOverloadInTypeAugmentation1.ts, 1, 80)) +>T : Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) +>T : Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) + + initialValue?: T): T; +>initialValue : Symbol(initialValue, Decl(duplicateOverloadInTypeAugmentation1.ts, 1, 98)) +>T : Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) +>T : Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) + + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, +>reduce : Symbol(reduce, Decl(lib.d.ts, 1129, 93), Decl(lib.d.ts, 1136, 120), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 20), Decl(duplicateOverloadInTypeAugmentation1.ts, 2, 29)) +>U : Symbol(U, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 11)) +>callbackfn : Symbol(callbackfn, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 14)) +>previousValue : Symbol(previousValue, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 27)) +>U : Symbol(U, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 11)) +>currentValue : Symbol(currentValue, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 44)) +>T : Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) +>currentIndex : Symbol(currentIndex, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 61)) +>array : Symbol(array, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 83)) +>T : Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) +>U : Symbol(U, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 11)) + + initialValue: U): U; +>initialValue : Symbol(initialValue, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 101)) +>U : Symbol(U, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 11)) +>U : Symbol(U, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 11)) +} +var a: Array; +>a : Symbol(a, Decl(duplicateOverloadInTypeAugmentation1.ts, 6, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 0)) + +var r5 = a.reduce((x, y) => x + y); +>r5 : Symbol(r5, Decl(duplicateOverloadInTypeAugmentation1.ts, 7, 3)) +>a.reduce : Symbol(Array.reduce, Decl(lib.d.ts, 1129, 93), Decl(lib.d.ts, 1136, 120), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 20), Decl(duplicateOverloadInTypeAugmentation1.ts, 2, 29)) +>a : Symbol(a, Decl(duplicateOverloadInTypeAugmentation1.ts, 6, 3)) +>reduce : Symbol(Array.reduce, Decl(lib.d.ts, 1129, 93), Decl(lib.d.ts, 1136, 120), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 20), Decl(duplicateOverloadInTypeAugmentation1.ts, 2, 29)) +>x : Symbol(x, Decl(duplicateOverloadInTypeAugmentation1.ts, 7, 19)) +>y : Symbol(y, Decl(duplicateOverloadInTypeAugmentation1.ts, 7, 21)) +>x : Symbol(x, Decl(duplicateOverloadInTypeAugmentation1.ts, 7, 19)) +>y : Symbol(y, Decl(duplicateOverloadInTypeAugmentation1.ts, 7, 21)) + diff --git a/tests/baselines/reference/duplicateVarAndImport.symbols b/tests/baselines/reference/duplicateVarAndImport.symbols new file mode 100644 index 00000000000..597713b1f30 --- /dev/null +++ b/tests/baselines/reference/duplicateVarAndImport.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/duplicateVarAndImport.ts === +// no error since module is not instantiated + +var a; +>a : Symbol(a, Decl(duplicateVarAndImport.ts, 2, 3), Decl(duplicateVarAndImport.ts, 3, 12)) + +module M { } +>M : Symbol(M, Decl(duplicateVarAndImport.ts, 2, 6)) + +import a = M; +>a : Symbol(a, Decl(duplicateVarAndImport.ts, 2, 3), Decl(duplicateVarAndImport.ts, 3, 12)) +>M : Symbol(M, Decl(duplicateVarAndImport.ts, 2, 6)) + diff --git a/tests/baselines/reference/duplicateVarAndImport.types b/tests/baselines/reference/duplicateVarAndImport.types index 10db2738dde..4e60c4ecf20 100644 --- a/tests/baselines/reference/duplicateVarAndImport.types +++ b/tests/baselines/reference/duplicateVarAndImport.types @@ -5,9 +5,9 @@ var a; >a : any module M { } ->M : unknown +>M : any import a = M; >a : any ->M : unknown +>M : any diff --git a/tests/baselines/reference/duplicateVariableDeclaration1.symbols b/tests/baselines/reference/duplicateVariableDeclaration1.symbols new file mode 100644 index 00000000000..02b85a89a1f --- /dev/null +++ b/tests/baselines/reference/duplicateVariableDeclaration1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/duplicateVariableDeclaration1.ts === +var v +>v : Symbol(v, Decl(duplicateVariableDeclaration1.ts, 0, 3), Decl(duplicateVariableDeclaration1.ts, 1, 3)) + +var v +>v : Symbol(v, Decl(duplicateVariableDeclaration1.ts, 0, 3), Decl(duplicateVariableDeclaration1.ts, 1, 3)) + diff --git a/tests/baselines/reference/duplicateVariablesByScope.symbols b/tests/baselines/reference/duplicateVariablesByScope.symbols new file mode 100644 index 00000000000..bc94dc9b807 --- /dev/null +++ b/tests/baselines/reference/duplicateVariablesByScope.symbols @@ -0,0 +1,56 @@ +=== tests/cases/compiler/duplicateVariablesByScope.ts === +// duplicate local variables are only reported at global scope + +module M { +>M : Symbol(M, Decl(duplicateVariablesByScope.ts, 0, 0)) + + for (var j = 0; j < 10; j++) { +>j : Symbol(j, Decl(duplicateVariablesByScope.ts, 3, 12), Decl(duplicateVariablesByScope.ts, 6, 12)) +>j : Symbol(j, Decl(duplicateVariablesByScope.ts, 3, 12), Decl(duplicateVariablesByScope.ts, 6, 12)) +>j : Symbol(j, Decl(duplicateVariablesByScope.ts, 3, 12), Decl(duplicateVariablesByScope.ts, 6, 12)) + } + + for (var j = 0; j < 10; j++) { +>j : Symbol(j, Decl(duplicateVariablesByScope.ts, 3, 12), Decl(duplicateVariablesByScope.ts, 6, 12)) +>j : Symbol(j, Decl(duplicateVariablesByScope.ts, 3, 12), Decl(duplicateVariablesByScope.ts, 6, 12)) +>j : Symbol(j, Decl(duplicateVariablesByScope.ts, 3, 12), Decl(duplicateVariablesByScope.ts, 6, 12)) + } +} + +function foo() { +>foo : Symbol(foo, Decl(duplicateVariablesByScope.ts, 8, 1)) + + var x = 2; +>x : Symbol(x, Decl(duplicateVariablesByScope.ts, 11, 7), Decl(duplicateVariablesByScope.ts, 12, 7)) + + var x = 1; +>x : Symbol(x, Decl(duplicateVariablesByScope.ts, 11, 7), Decl(duplicateVariablesByScope.ts, 12, 7)) + + if (true) { + var result = 1; +>result : Symbol(result, Decl(duplicateVariablesByScope.ts, 14, 11), Decl(duplicateVariablesByScope.ts, 17, 11)) + } + else { + var result = 2; +>result : Symbol(result, Decl(duplicateVariablesByScope.ts, 14, 11), Decl(duplicateVariablesByScope.ts, 17, 11)) + } +} + +class C { +>C : Symbol(C, Decl(duplicateVariablesByScope.ts, 19, 1)) + + foo() { +>foo : Symbol(foo, Decl(duplicateVariablesByScope.ts, 21, 9)) + + try { + var x = 1; +>x : Symbol(x, Decl(duplicateVariablesByScope.ts, 24, 15), Decl(duplicateVariablesByScope.ts, 27, 15)) + } + catch (e) { +>e : Symbol(e, Decl(duplicateVariablesByScope.ts, 26, 15)) + + var x = 2; +>x : Symbol(x, Decl(duplicateVariablesByScope.ts, 24, 15), Decl(duplicateVariablesByScope.ts, 27, 15)) + } + } +} diff --git a/tests/baselines/reference/duplicateVariablesByScope.types b/tests/baselines/reference/duplicateVariablesByScope.types index ec20d665ad8..42d8cae2a3c 100644 --- a/tests/baselines/reference/duplicateVariablesByScope.types +++ b/tests/baselines/reference/duplicateVariablesByScope.types @@ -6,16 +6,20 @@ module M { for (var j = 0; j < 10; j++) { >j : number +>0 : number >j < 10 : boolean >j : number +>10 : number >j++ : number >j : number } for (var j = 0; j < 10; j++) { >j : number +>0 : number >j < 10 : boolean >j : number +>10 : number >j++ : number >j : number } @@ -26,17 +30,23 @@ function foo() { var x = 2; >x : number +>2 : number var x = 1; >x : number +>1 : number if (true) { +>true : boolean + var result = 1; >result : number +>1 : number } else { var result = 2; >result : number +>2 : number } } @@ -49,12 +59,14 @@ class C { try { var x = 1; >x : number +>1 : number } catch (e) { >e : any var x = 2; >x : number +>2 : number } } } diff --git a/tests/baselines/reference/dynamicModuleTypecheckError.symbols b/tests/baselines/reference/dynamicModuleTypecheckError.symbols new file mode 100644 index 00000000000..ff141fe72e2 --- /dev/null +++ b/tests/baselines/reference/dynamicModuleTypecheckError.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/dynamicModuleTypecheckError.ts === +export var x = 1; +>x : Symbol(x, Decl(dynamicModuleTypecheckError.ts, 0, 10)) + +for(var i = 0; i < 30; i++) { +>i : Symbol(i, Decl(dynamicModuleTypecheckError.ts, 2, 7)) +>i : Symbol(i, Decl(dynamicModuleTypecheckError.ts, 2, 7)) +>i : Symbol(i, Decl(dynamicModuleTypecheckError.ts, 2, 7)) + + x = i * 1000; // should not be an error here +>x : Symbol(x, Decl(dynamicModuleTypecheckError.ts, 0, 10)) +>i : Symbol(i, Decl(dynamicModuleTypecheckError.ts, 2, 7)) + +} + diff --git a/tests/baselines/reference/dynamicModuleTypecheckError.types b/tests/baselines/reference/dynamicModuleTypecheckError.types index c7d213d1661..e50107f328b 100644 --- a/tests/baselines/reference/dynamicModuleTypecheckError.types +++ b/tests/baselines/reference/dynamicModuleTypecheckError.types @@ -1,11 +1,14 @@ === tests/cases/compiler/dynamicModuleTypecheckError.ts === export var x = 1; >x : number +>1 : number for(var i = 0; i < 30; i++) { >i : number +>0 : number >i < 30 : boolean >i : number +>30 : number >i++ : number >i : number @@ -14,6 +17,7 @@ for(var i = 0; i < 30; i++) { >x : number >i * 1000 : number >i : number +>1000 : number } diff --git a/tests/baselines/reference/elidingImportNames.symbols b/tests/baselines/reference/elidingImportNames.symbols new file mode 100644 index 00000000000..02646b5c3e2 --- /dev/null +++ b/tests/baselines/reference/elidingImportNames.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/elidingImportNames_test.ts === + +import a = require('elidingImportNames_main'); // alias used in typeof +>a : Symbol(a, Decl(elidingImportNames_test.ts, 0, 0)) + +var b = a; +>b : Symbol(b, Decl(elidingImportNames_test.ts, 2, 3)) +>a : Symbol(a, Decl(elidingImportNames_test.ts, 0, 0)) + +var x: typeof a; +>x : Symbol(x, Decl(elidingImportNames_test.ts, 3, 3)) +>a : Symbol(a, Decl(elidingImportNames_test.ts, 0, 0)) + +import a2 = require('elidingImportNames_main1'); // alias not used in typeof +>a2 : Symbol(a2, Decl(elidingImportNames_test.ts, 3, 16)) + +var b2 = a2; +>b2 : Symbol(b2, Decl(elidingImportNames_test.ts, 5, 3)) +>a2 : Symbol(a2, Decl(elidingImportNames_test.ts, 3, 16)) + + +=== tests/cases/compiler/elidingImportNames_main.ts === +export var main = 10; +>main : Symbol(main, Decl(elidingImportNames_main.ts, 0, 10)) + +=== tests/cases/compiler/elidingImportNames_main1.ts === +export var main = 10; +>main : Symbol(main, Decl(elidingImportNames_main1.ts, 0, 10)) + diff --git a/tests/baselines/reference/elidingImportNames.types b/tests/baselines/reference/elidingImportNames.types index ad93c72860b..65bd16a6d97 100644 --- a/tests/baselines/reference/elidingImportNames.types +++ b/tests/baselines/reference/elidingImportNames.types @@ -22,8 +22,10 @@ var b2 = a2; === tests/cases/compiler/elidingImportNames_main.ts === export var main = 10; >main : number +>10 : number === tests/cases/compiler/elidingImportNames_main1.ts === export var main = 10; >main : number +>10 : number diff --git a/tests/baselines/reference/emitArrowFunction.symbols b/tests/baselines/reference/emitArrowFunction.symbols new file mode 100644 index 00000000000..33de13d877c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunction.symbols @@ -0,0 +1,31 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunction.ts === +var f1 = () => { } +>f1 : Symbol(f1, Decl(emitArrowFunction.ts, 0, 3)) + +var f2 = (x: string, y: string) => { } +>f2 : Symbol(f2, Decl(emitArrowFunction.ts, 1, 3)) +>x : Symbol(x, Decl(emitArrowFunction.ts, 1, 10)) +>y : Symbol(y, Decl(emitArrowFunction.ts, 1, 20)) + +var f3 = (x: string, y: number, ...rest) => { } +>f3 : Symbol(f3, Decl(emitArrowFunction.ts, 2, 3)) +>x : Symbol(x, Decl(emitArrowFunction.ts, 2, 10)) +>y : Symbol(y, Decl(emitArrowFunction.ts, 2, 20)) +>rest : Symbol(rest, Decl(emitArrowFunction.ts, 2, 31)) + +var f4 = (x: string, y: number, z = 10) => { } +>f4 : Symbol(f4, Decl(emitArrowFunction.ts, 3, 3)) +>x : Symbol(x, Decl(emitArrowFunction.ts, 3, 10)) +>y : Symbol(y, Decl(emitArrowFunction.ts, 3, 20)) +>z : Symbol(z, Decl(emitArrowFunction.ts, 3, 31)) + +function foo(func: () => boolean) { } +>foo : Symbol(foo, Decl(emitArrowFunction.ts, 3, 46)) +>func : Symbol(func, Decl(emitArrowFunction.ts, 4, 13)) + +foo(() => true); +>foo : Symbol(foo, Decl(emitArrowFunction.ts, 3, 46)) + +foo(() => { return false; }); +>foo : Symbol(foo, Decl(emitArrowFunction.ts, 3, 46)) + diff --git a/tests/baselines/reference/emitArrowFunction.types b/tests/baselines/reference/emitArrowFunction.types index 030ed0cde60..2ac9ef07af4 100644 --- a/tests/baselines/reference/emitArrowFunction.types +++ b/tests/baselines/reference/emitArrowFunction.types @@ -22,6 +22,7 @@ var f4 = (x: string, y: number, z = 10) => { } >x : string >y : number >z : number +>10 : number function foo(func: () => boolean) { } >foo : (func: () => boolean) => void @@ -31,9 +32,11 @@ foo(() => true); >foo(() => true) : void >foo : (func: () => boolean) => void >() => true : () => boolean +>true : boolean foo(() => { return false; }); >foo(() => { return false; }) : void >foo : (func: () => boolean) => void >() => { return false; } : () => boolean +>false : boolean diff --git a/tests/baselines/reference/emitArrowFunctionAsIs.symbols b/tests/baselines/reference/emitArrowFunctionAsIs.symbols new file mode 100644 index 00000000000..d853996ccd9 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionAsIs.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionAsIs.ts === +var arrow1 = a => { }; +>arrow1 : Symbol(arrow1, Decl(emitArrowFunctionAsIs.ts, 0, 3)) +>a : Symbol(a, Decl(emitArrowFunctionAsIs.ts, 0, 12)) + +var arrow2 = (a) => { }; +>arrow2 : Symbol(arrow2, Decl(emitArrowFunctionAsIs.ts, 1, 3)) +>a : Symbol(a, Decl(emitArrowFunctionAsIs.ts, 1, 14)) + +var arrow3 = (a, b) => { }; +>arrow3 : Symbol(arrow3, Decl(emitArrowFunctionAsIs.ts, 3, 3)) +>a : Symbol(a, Decl(emitArrowFunctionAsIs.ts, 3, 14)) +>b : Symbol(b, Decl(emitArrowFunctionAsIs.ts, 3, 16)) + diff --git a/tests/baselines/reference/emitArrowFunctionAsIsES6.symbols b/tests/baselines/reference/emitArrowFunctionAsIsES6.symbols new file mode 100644 index 00000000000..c435db55648 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionAsIsES6.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionAsIsES6.ts === +var arrow1 = a => { }; +>arrow1 : Symbol(arrow1, Decl(emitArrowFunctionAsIsES6.ts, 0, 3)) +>a : Symbol(a, Decl(emitArrowFunctionAsIsES6.ts, 0, 12)) + +var arrow2 = (a) => { }; +>arrow2 : Symbol(arrow2, Decl(emitArrowFunctionAsIsES6.ts, 1, 3)) +>a : Symbol(a, Decl(emitArrowFunctionAsIsES6.ts, 1, 14)) + +var arrow3 = (a, b) => { }; +>arrow3 : Symbol(arrow3, Decl(emitArrowFunctionAsIsES6.ts, 3, 3)) +>a : Symbol(a, Decl(emitArrowFunctionAsIsES6.ts, 3, 14)) +>b : Symbol(b, Decl(emitArrowFunctionAsIsES6.ts, 3, 16)) + diff --git a/tests/baselines/reference/emitArrowFunctionES6.js b/tests/baselines/reference/emitArrowFunctionES6.js index 603b2737fc5..f9f5669c92e 100644 --- a/tests/baselines/reference/emitArrowFunctionES6.js +++ b/tests/baselines/reference/emitArrowFunctionES6.js @@ -6,6 +6,18 @@ var f4 = (x: string, y: number, z=10) => { } function foo(func: () => boolean) { } foo(() => true); foo(() => { return false; }); + +// Binding patterns in arrow functions +var p1 = ([a]) => { }; +var p2 = ([...a]) => { }; +var p3 = ([, a]) => { }; +var p4 = ([, ...a]) => { }; +var p5 = ([a = 1]) => { }; +var p6 = ({ a }) => { }; +var p7 = ({ a: { b } }) => { }; +var p8 = ({ a = 1 }) => { }; +var p9 = ({ a: { b = 1 } = { b: 1 } }) => { }; +var p10 = ([{ value, done }]) => { }; //// [emitArrowFunctionES6.js] @@ -16,3 +28,14 @@ var f4 = (x, y, z = 10) => { }; function foo(func) { } foo(() => true); foo(() => { return false; }); +// Binding patterns in arrow functions +var p1 = ([a]) => { }; +var p2 = ([...a]) => { }; +var p3 = ([, a]) => { }; +var p4 = ([, ...a]) => { }; +var p5 = ([a = 1]) => { }; +var p6 = ({ a }) => { }; +var p7 = ({ a: { b } }) => { }; +var p8 = ({ a = 1 }) => { }; +var p9 = ({ a: { b = 1 } = { b: 1 } }) => { }; +var p10 = ([{ value, done }]) => { }; diff --git a/tests/baselines/reference/emitArrowFunctionES6.symbols b/tests/baselines/reference/emitArrowFunctionES6.symbols new file mode 100644 index 00000000000..06f83f7f6f0 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionES6.symbols @@ -0,0 +1,74 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionES6.ts === +var f1 = () => { } +>f1 : Symbol(f1, Decl(emitArrowFunctionES6.ts, 0, 3)) + +var f2 = (x: string, y: string) => { } +>f2 : Symbol(f2, Decl(emitArrowFunctionES6.ts, 1, 3)) +>x : Symbol(x, Decl(emitArrowFunctionES6.ts, 1, 10)) +>y : Symbol(y, Decl(emitArrowFunctionES6.ts, 1, 20)) + +var f3 = (x: string, y: number, ...rest) => { } +>f3 : Symbol(f3, Decl(emitArrowFunctionES6.ts, 2, 3)) +>x : Symbol(x, Decl(emitArrowFunctionES6.ts, 2, 10)) +>y : Symbol(y, Decl(emitArrowFunctionES6.ts, 2, 20)) +>rest : Symbol(rest, Decl(emitArrowFunctionES6.ts, 2, 31)) + +var f4 = (x: string, y: number, z=10) => { } +>f4 : Symbol(f4, Decl(emitArrowFunctionES6.ts, 3, 3)) +>x : Symbol(x, Decl(emitArrowFunctionES6.ts, 3, 10)) +>y : Symbol(y, Decl(emitArrowFunctionES6.ts, 3, 20)) +>z : Symbol(z, Decl(emitArrowFunctionES6.ts, 3, 31)) + +function foo(func: () => boolean) { } +>foo : Symbol(foo, Decl(emitArrowFunctionES6.ts, 3, 44)) +>func : Symbol(func, Decl(emitArrowFunctionES6.ts, 4, 13)) + +foo(() => true); +>foo : Symbol(foo, Decl(emitArrowFunctionES6.ts, 3, 44)) + +foo(() => { return false; }); +>foo : Symbol(foo, Decl(emitArrowFunctionES6.ts, 3, 44)) + +// Binding patterns in arrow functions +var p1 = ([a]) => { }; +>p1 : Symbol(p1, Decl(emitArrowFunctionES6.ts, 9, 3)) +>a : Symbol(a, Decl(emitArrowFunctionES6.ts, 9, 11)) + +var p2 = ([...a]) => { }; +>p2 : Symbol(p2, Decl(emitArrowFunctionES6.ts, 10, 3)) +>a : Symbol(a, Decl(emitArrowFunctionES6.ts, 10, 11)) + +var p3 = ([, a]) => { }; +>p3 : Symbol(p3, Decl(emitArrowFunctionES6.ts, 11, 3)) +>a : Symbol(a, Decl(emitArrowFunctionES6.ts, 11, 12)) + +var p4 = ([, ...a]) => { }; +>p4 : Symbol(p4, Decl(emitArrowFunctionES6.ts, 12, 3)) +>a : Symbol(a, Decl(emitArrowFunctionES6.ts, 12, 12)) + +var p5 = ([a = 1]) => { }; +>p5 : Symbol(p5, Decl(emitArrowFunctionES6.ts, 13, 3)) +>a : Symbol(a, Decl(emitArrowFunctionES6.ts, 13, 11)) + +var p6 = ({ a }) => { }; +>p6 : Symbol(p6, Decl(emitArrowFunctionES6.ts, 14, 3)) +>a : Symbol(a, Decl(emitArrowFunctionES6.ts, 14, 11)) + +var p7 = ({ a: { b } }) => { }; +>p7 : Symbol(p7, Decl(emitArrowFunctionES6.ts, 15, 3)) +>b : Symbol(b, Decl(emitArrowFunctionES6.ts, 15, 16)) + +var p8 = ({ a = 1 }) => { }; +>p8 : Symbol(p8, Decl(emitArrowFunctionES6.ts, 16, 3)) +>a : Symbol(a, Decl(emitArrowFunctionES6.ts, 16, 11)) + +var p9 = ({ a: { b = 1 } = { b: 1 } }) => { }; +>p9 : Symbol(p9, Decl(emitArrowFunctionES6.ts, 17, 3)) +>b : Symbol(b, Decl(emitArrowFunctionES6.ts, 17, 16)) +>b : Symbol(b, Decl(emitArrowFunctionES6.ts, 17, 28)) + +var p10 = ([{ value, done }]) => { }; +>p10 : Symbol(p10, Decl(emitArrowFunctionES6.ts, 18, 3)) +>value : Symbol(value, Decl(emitArrowFunctionES6.ts, 18, 13)) +>done : Symbol(done, Decl(emitArrowFunctionES6.ts, 18, 20)) + diff --git a/tests/baselines/reference/emitArrowFunctionES6.types b/tests/baselines/reference/emitArrowFunctionES6.types index 1f0c1941bdb..e2ad176fd7d 100644 --- a/tests/baselines/reference/emitArrowFunctionES6.types +++ b/tests/baselines/reference/emitArrowFunctionES6.types @@ -22,6 +22,7 @@ var f4 = (x: string, y: number, z=10) => { } >x : string >y : number >z : number +>10 : number function foo(func: () => boolean) { } >foo : (func: () => boolean) => void @@ -31,9 +32,73 @@ foo(() => true); >foo(() => true) : void >foo : (func: () => boolean) => void >() => true : () => boolean +>true : boolean foo(() => { return false; }); >foo(() => { return false; }) : void >foo : (func: () => boolean) => void >() => { return false; } : () => boolean +>false : boolean + +// Binding patterns in arrow functions +var p1 = ([a]) => { }; +>p1 : ([a]: [any]) => void +>([a]) => { } : ([a]: [any]) => void +>a : any + +var p2 = ([...a]) => { }; +>p2 : ([...a]: Iterable) => void +>([...a]) => { } : ([...a]: Iterable) => void +>a : any[] + +var p3 = ([, a]) => { }; +>p3 : ([, a]: [any, any]) => void +>([, a]) => { } : ([, a]: [any, any]) => void +> : undefined +>a : any + +var p4 = ([, ...a]) => { }; +>p4 : ([, ...a]: Iterable) => void +>([, ...a]) => { } : ([, ...a]: Iterable) => void +> : undefined +>a : any[] + +var p5 = ([a = 1]) => { }; +>p5 : ([a = 1]: [number]) => void +>([a = 1]) => { } : ([a = 1]: [number]) => void +>a : number +>1 : number + +var p6 = ({ a }) => { }; +>p6 : ({ a }: { a: any; }) => void +>({ a }) => { } : ({ a }: { a: any; }) => void +>a : any + +var p7 = ({ a: { b } }) => { }; +>p7 : ({ a: { b } }: { a: { b: any; }; }) => void +>({ a: { b } }) => { } : ({ a: { b } }: { a: { b: any; }; }) => void +>a : any +>b : any + +var p8 = ({ a = 1 }) => { }; +>p8 : ({ a = 1 }: { a?: number; }) => void +>({ a = 1 }) => { } : ({ a = 1 }: { a?: number; }) => void +>a : number +>1 : number + +var p9 = ({ a: { b = 1 } = { b: 1 } }) => { }; +>p9 : ({ a: { b = 1 } = { b: 1 } }: { a?: { b: number; }; }) => void +>({ a: { b = 1 } = { b: 1 } }) => { } : ({ a: { b = 1 } = { b: 1 } }: { a?: { b: number; }; }) => void +>a : any +>b : number +>1 : number +>{ b: 1 } : { b: number; } +>b : number +>1 : number + +var p10 = ([{ value, done }]) => { }; +>p10 : ([{ value, done }]: [{ value: any; done: any; }]) => void +>([{ value, done }]) => { } : ([{ value, done }]: [{ value: any; done: any; }]) => void +>value : any +>done : any diff --git a/tests/baselines/reference/emitArrowFunctionThisCapturing.symbols b/tests/baselines/reference/emitArrowFunctionThisCapturing.symbols new file mode 100644 index 00000000000..ad62a0df5be --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionThisCapturing.symbols @@ -0,0 +1,26 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionThisCapturing.ts === +var f1 = () => { +>f1 : Symbol(f1, Decl(emitArrowFunctionThisCapturing.ts, 0, 3)) + + this.age = 10 +}; + +var f2 = (x: string) => { +>f2 : Symbol(f2, Decl(emitArrowFunctionThisCapturing.ts, 4, 3)) +>x : Symbol(x, Decl(emitArrowFunctionThisCapturing.ts, 4, 10)) + + this.name = x +>x : Symbol(x, Decl(emitArrowFunctionThisCapturing.ts, 4, 10)) +} + +function foo(func: () => boolean) { } +>foo : Symbol(foo, Decl(emitArrowFunctionThisCapturing.ts, 6, 1)) +>func : Symbol(func, Decl(emitArrowFunctionThisCapturing.ts, 8, 13)) + +foo(() => { +>foo : Symbol(foo, Decl(emitArrowFunctionThisCapturing.ts, 6, 1)) + + this.age = 100; + return true; +}); + diff --git a/tests/baselines/reference/emitArrowFunctionThisCapturing.types b/tests/baselines/reference/emitArrowFunctionThisCapturing.types index 433f38e5ecc..2cfe06579af 100644 --- a/tests/baselines/reference/emitArrowFunctionThisCapturing.types +++ b/tests/baselines/reference/emitArrowFunctionThisCapturing.types @@ -8,6 +8,7 @@ var f1 = () => { >this.age : any >this : any >age : any +>10 : number }; @@ -38,7 +39,10 @@ foo(() => { >this.age : any >this : any >age : any +>100 : number return true; +>true : boolean + }); diff --git a/tests/baselines/reference/emitArrowFunctionThisCapturingES6.symbols b/tests/baselines/reference/emitArrowFunctionThisCapturingES6.symbols new file mode 100644 index 00000000000..0e8855dd680 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionThisCapturingES6.symbols @@ -0,0 +1,26 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionThisCapturingES6.ts === +var f1 = () => { +>f1 : Symbol(f1, Decl(emitArrowFunctionThisCapturingES6.ts, 0, 3)) + + this.age = 10 +}; + +var f2 = (x: string) => { +>f2 : Symbol(f2, Decl(emitArrowFunctionThisCapturingES6.ts, 4, 3)) +>x : Symbol(x, Decl(emitArrowFunctionThisCapturingES6.ts, 4, 10)) + + this.name = x +>x : Symbol(x, Decl(emitArrowFunctionThisCapturingES6.ts, 4, 10)) +} + +function foo(func: () => boolean){ } +>foo : Symbol(foo, Decl(emitArrowFunctionThisCapturingES6.ts, 6, 1)) +>func : Symbol(func, Decl(emitArrowFunctionThisCapturingES6.ts, 8, 13)) + +foo(() => { +>foo : Symbol(foo, Decl(emitArrowFunctionThisCapturingES6.ts, 6, 1)) + + this.age = 100; + return true; +}); + diff --git a/tests/baselines/reference/emitArrowFunctionThisCapturingES6.types b/tests/baselines/reference/emitArrowFunctionThisCapturingES6.types index 989130ef280..cc5405cebb4 100644 --- a/tests/baselines/reference/emitArrowFunctionThisCapturingES6.types +++ b/tests/baselines/reference/emitArrowFunctionThisCapturingES6.types @@ -8,6 +8,7 @@ var f1 = () => { >this.age : any >this : any >age : any +>10 : number }; @@ -38,7 +39,10 @@ foo(() => { >this.age : any >this : any >age : any +>100 : number return true; +>true : boolean + }); diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.errors.txt deleted file mode 100644 index 2f5ca2a387c..00000000000 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.errors.txt +++ /dev/null @@ -1,46 +0,0 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(2,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(7,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(13,13): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(19,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - - -==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts (4 errors) ==== - var a = () => { - var arg = arguments[0]; // error - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - } - - var b = function () { - var a = () => { - var arg = arguments[0]; // error - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - } - } - - function baz() { - () => { - var arg = arguments[0]; - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - } - } - - function foo(inputFunc: () => void) { } - foo(() => { - var arg = arguments[0]; // error - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - }); - - function bar() { - var arg = arguments[0]; // no error - } - - - () => { - function foo() { - var arg = arguments[0]; // no error - } - } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01.errors.txt similarity index 53% rename from tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.errors.txt rename to tests/baselines/reference/emitArrowFunctionWhenUsingArguments01.errors.txt index 26f204d3ee6..1137835c2c2 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.errors.txt +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01.errors.txt @@ -1,21 +1,21 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(2,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(7,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(13,13): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(19,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01.ts(2,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01.ts(7,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01.ts(13,13): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01.ts(19,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. -==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts (4 errors) ==== +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01.ts (4 errors) ==== var a = () => { var arg = arguments[0]; // error ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. } var b = function () { var a = () => { var arg = arguments[0]; // error ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. } } @@ -23,7 +23,7 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6 () => { var arg = arguments[0]; ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. } } @@ -31,7 +31,7 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6 foo(() => { var arg = arguments[0]; // error ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. }); function bar() { diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01.js similarity index 78% rename from tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.js rename to tests/baselines/reference/emitArrowFunctionWhenUsingArguments01.js index 2f84d0843de..40a2748fdae 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.js +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01.js @@ -1,4 +1,4 @@ -//// [emitArrowFunctionWhenUsingArgumentsES6.ts] +//// [emitArrowFunctionWhenUsingArguments01.ts] var a = () => { var arg = arguments[0]; // error } @@ -31,28 +31,28 @@ function bar() { } } -//// [emitArrowFunctionWhenUsingArgumentsES6.js] -var a = () => { +//// [emitArrowFunctionWhenUsingArguments01.js] +var a = function () { var arg = arguments[0]; // error }; var b = function () { - var a = () => { + var a = function () { var arg = arguments[0]; // error }; }; function baz() { - (() => { + (function () { var arg = arguments[0]; }); } function foo(inputFunc) { } -foo(() => { +foo(function () { var arg = arguments[0]; // error }); function bar() { var arg = arguments[0]; // no error } -(() => { +(function () { function foo() { var arg = arguments[0]; // no error } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.js similarity index 86% rename from tests/baselines/reference/emitArrowFunctionWhenUsingArguments.js rename to tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.js index 589449fad62..6641e28b867 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.js +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.js @@ -1,4 +1,4 @@ -//// [emitArrowFunctionWhenUsingArguments.ts] +//// [emitArrowFunctionWhenUsingArguments01_ES6.ts] var a = () => { var arg = arguments[0]; // error } @@ -31,7 +31,7 @@ function bar() { } } -//// [emitArrowFunctionWhenUsingArguments.js] +//// [emitArrowFunctionWhenUsingArguments01_ES6.js] var a = () => { var arg = arguments[0]; // error }; diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.symbols new file mode 100644 index 00000000000..698b32da7ad --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.symbols @@ -0,0 +1,62 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01_ES6.ts === +var a = () => { +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 0, 3)) + + var arg = arguments[0]; // error +>arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 1, 7)) +>arguments : Symbol(arguments) +} + +var b = function () { +>b : Symbol(b, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 4, 3)) + + var a = () => { +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 5, 7)) + + var arg = arguments[0]; // error +>arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 6, 11)) +>arguments : Symbol(arguments) + } +} + +function baz() { +>baz : Symbol(baz, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 8, 1)) + + () => { + var arg = arguments[0]; +>arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 12, 5)) +>arguments : Symbol(arguments) + } +} + +function foo(inputFunc: () => void) { } +>foo : Symbol(foo, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 14, 1)) +>inputFunc : Symbol(inputFunc, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 16, 13)) + +foo(() => { +>foo : Symbol(foo, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 14, 1)) + + var arg = arguments[0]; // error +>arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 18, 7)) +>arguments : Symbol(arguments) + +}); + +function bar() { +>bar : Symbol(bar, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 19, 3)) + + var arg = arguments[0]; // no error +>arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 22, 7)) +>arguments : Symbol(arguments) +} + + +() => { + function foo() { +>foo : Symbol(foo, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 26, 7)) + + var arg = arguments[0]; // no error +>arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 28, 5)) +>arguments : Symbol(arguments) + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.types new file mode 100644 index 00000000000..669bf411e63 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.types @@ -0,0 +1,83 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01_ES6.ts === +var a = () => { +>a : () => void +>() => { var arg = arguments[0]; // error} : () => void + + var arg = arguments[0]; // error +>arg : any +>arguments[0] : any +>arguments : IArguments +>0 : number +} + +var b = function () { +>b : () => void +>function () { var a = () => { var arg = arguments[0]; // error }} : () => void + + var a = () => { +>a : () => void +>() => { var arg = arguments[0]; // error } : () => void + + var arg = arguments[0]; // error +>arg : any +>arguments[0] : any +>arguments : IArguments +>0 : number + } +} + +function baz() { +>baz : () => void + + () => { +>() => { var arg = arguments[0]; } : () => void + + var arg = arguments[0]; +>arg : any +>arguments[0] : any +>arguments : IArguments +>0 : number + } +} + +function foo(inputFunc: () => void) { } +>foo : (inputFunc: () => void) => void +>inputFunc : () => void + +foo(() => { +>foo(() => { var arg = arguments[0]; // error}) : void +>foo : (inputFunc: () => void) => void +>() => { var arg = arguments[0]; // error} : () => void + + var arg = arguments[0]; // error +>arg : any +>arguments[0] : any +>arguments : IArguments +>0 : number + +}); + +function bar() { +>bar : () => void + + var arg = arguments[0]; // no error +>arg : any +>arguments[0] : any +>arguments : IArguments +>0 : number +} + + +() => { +>() => { function foo() { var arg = arguments[0]; // no error }} : () => void + + function foo() { +>foo : () => void + + var arg = arguments[0]; // no error +>arg : any +>arguments[0] : any +>arguments : IArguments +>0 : number + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02.errors.txt new file mode 100644 index 00000000000..55f0ce2230a --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02.ts(2,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02.ts (1 errors) ==== + + var a = () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02.js new file mode 100644 index 00000000000..b6774dd5407 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02.js @@ -0,0 +1,6 @@ +//// [emitArrowFunctionWhenUsingArguments02.ts] + +var a = () => arguments; + +//// [emitArrowFunctionWhenUsingArguments02.js] +var a = function () { return arguments; }; diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.js new file mode 100644 index 00000000000..0f35b8898b2 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.js @@ -0,0 +1,6 @@ +//// [emitArrowFunctionWhenUsingArguments02_ES6.ts] + +var a = () => arguments; + +//// [emitArrowFunctionWhenUsingArguments02_ES6.js] +var a = () => arguments; diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.symbols new file mode 100644 index 00000000000..e403a2c3da1 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02_ES6.ts === + +var a = () => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments02_ES6.ts, 1, 3)) +>arguments : Symbol(arguments) + diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.types new file mode 100644 index 00000000000..fe5ac353ce6 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02_ES6.ts === + +var a = () => arguments; +>a : () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments + diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03.errors.txt new file mode 100644 index 00000000000..d914e14d93a --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03.ts(3,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03.ts (1 errors) ==== + + var arguments; + var a = () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03.js new file mode 100644 index 00000000000..5b57f7acf0d --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03.js @@ -0,0 +1,8 @@ +//// [emitArrowFunctionWhenUsingArguments03.ts] + +var arguments; +var a = () => arguments; + +//// [emitArrowFunctionWhenUsingArguments03.js] +var arguments; +var a = function () { return arguments; }; diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.js new file mode 100644 index 00000000000..d4d35e7abdc --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.js @@ -0,0 +1,8 @@ +//// [emitArrowFunctionWhenUsingArguments03_ES6.ts] + +var arguments; +var a = () => arguments; + +//// [emitArrowFunctionWhenUsingArguments03_ES6.js] +var arguments; +var a = () => arguments; diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.symbols new file mode 100644 index 00000000000..08bae382794 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03_ES6.ts === + +var arguments; +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments03_ES6.ts, 1, 3)) + +var a = () => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments03_ES6.ts, 2, 3)) +>arguments : Symbol(arguments) + diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.types new file mode 100644 index 00000000000..33a45a39af1 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.types @@ -0,0 +1,10 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03_ES6.ts === + +var arguments; +>arguments : any + +var a = () => arguments; +>a : () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments + diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04.errors.txt new file mode 100644 index 00000000000..12e416f893f --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04.ts(4,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04.ts (1 errors) ==== + + function f() { + var arguments; + var a = () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04.js new file mode 100644 index 00000000000..588610a4022 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04.js @@ -0,0 +1,12 @@ +//// [emitArrowFunctionWhenUsingArguments04.ts] + +function f() { + var arguments; + var a = () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments04.js] +function f() { + var arguments; + var a = function () { return arguments; }; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.js new file mode 100644 index 00000000000..63e896039c9 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.js @@ -0,0 +1,12 @@ +//// [emitArrowFunctionWhenUsingArguments04_ES6.ts] + +function f() { + var arguments; + var a = () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments04_ES6.js] +function f() { + var arguments; + var a = () => arguments; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.symbols new file mode 100644 index 00000000000..708615a95c6 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04_ES6.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments04_ES6.ts, 0, 0)) + + var arguments; +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments04_ES6.ts, 2, 7)) + + var a = () => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments04_ES6.ts, 3, 7)) +>arguments : Symbol(arguments) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.types new file mode 100644 index 00000000000..495ca1582e6 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.types @@ -0,0 +1,13 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04_ES6.ts === + +function f() { +>f : () => void + + var arguments; +>arguments : any + + var a = () => arguments; +>a : () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05.errors.txt new file mode 100644 index 00000000000..4256dab30c2 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05.ts(3,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05.ts (1 errors) ==== + + function f(arguments) { + var a = () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05.js new file mode 100644 index 00000000000..b4ed2b383b7 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments05.ts] + +function f(arguments) { + var a = () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments05.js] +function f(arguments) { + var a = function () { return arguments; }; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.js new file mode 100644 index 00000000000..9fe68e9bb48 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments05_ES6.ts] + +function f(arguments) { + var a = () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments05_ES6.js] +function f(arguments) { + var a = () => arguments; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.symbols new file mode 100644 index 00000000000..379a5cf92f1 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05_ES6.ts === + +function f(arguments) { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments05_ES6.ts, 0, 0)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments05_ES6.ts, 1, 11)) + + var a = () => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments05_ES6.ts, 2, 7)) +>arguments : Symbol(arguments) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.types new file mode 100644 index 00000000000..4e9da2f642b --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.types @@ -0,0 +1,11 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05_ES6.ts === + +function f(arguments) { +>f : (arguments: any) => void +>arguments : any + + var a = () => arguments; +>a : () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06.errors.txt new file mode 100644 index 00000000000..5b078f22f44 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06.ts(3,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06.ts (1 errors) ==== + + function f(arguments) { + var a = () => () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06.js new file mode 100644 index 00000000000..d004b77e947 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments06.ts] + +function f(arguments) { + var a = () => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments06.js] +function f(arguments) { + var a = function () { return function () { return arguments; }; }; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.js new file mode 100644 index 00000000000..6b83e0c60d9 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments06_ES6.ts] + +function f(arguments) { + var a = () => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments06_ES6.js] +function f(arguments) { + var a = () => () => arguments; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.symbols new file mode 100644 index 00000000000..e59f487f864 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06_ES6.ts === + +function f(arguments) { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments06_ES6.ts, 0, 0)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments06_ES6.ts, 1, 11)) + + var a = () => () => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments06_ES6.ts, 2, 7)) +>arguments : Symbol(arguments) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.types new file mode 100644 index 00000000000..82571174a1e --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.types @@ -0,0 +1,12 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06_ES6.ts === + +function f(arguments) { +>f : (arguments: any) => void +>arguments : any + + var a = () => () => arguments; +>a : () => () => IArguments +>() => () => arguments : () => () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07.errors.txt new file mode 100644 index 00000000000..da1f7dd28f9 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07.ts(3,34): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07.ts (1 errors) ==== + + function f(arguments) { + var a = (arguments) => () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07.js new file mode 100644 index 00000000000..7f06036dfc1 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments07.ts] + +function f(arguments) { + var a = (arguments) => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments07.js] +function f(arguments) { + var a = function (arguments) { return function () { return arguments; }; }; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.js new file mode 100644 index 00000000000..bdc8cf82d44 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments07_ES6.ts] + +function f(arguments) { + var a = (arguments) => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments07_ES6.js] +function f(arguments) { + var a = (arguments) => () => arguments; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.symbols new file mode 100644 index 00000000000..5de21ffbebd --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07_ES6.ts === + +function f(arguments) { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments07_ES6.ts, 0, 0)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments07_ES6.ts, 1, 11)) + + var a = (arguments) => () => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments07_ES6.ts, 2, 7)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments07_ES6.ts, 2, 13)) +>arguments : Symbol(arguments) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.types new file mode 100644 index 00000000000..967631cc57b --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.types @@ -0,0 +1,13 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07_ES6.ts === + +function f(arguments) { +>f : (arguments: any) => void +>arguments : any + + var a = (arguments) => () => arguments; +>a : (arguments: any) => () => IArguments +>(arguments) => () => arguments : (arguments: any) => () => IArguments +>arguments : any +>() => arguments : () => IArguments +>arguments : IArguments +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.js new file mode 100644 index 00000000000..dbb89d4eb6b --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments08.ts] + +function f(arguments) { + var a = () => (arguments) => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments08.js] +function f(arguments) { + var a = function () { return function (arguments) { return arguments; }; }; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.symbols new file mode 100644 index 00000000000..80f7f507978 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments08.ts === + +function f(arguments) { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments08.ts, 0, 0)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments08.ts, 1, 11)) + + var a = () => (arguments) => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments08.ts, 2, 7)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments08.ts, 2, 19)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments08.ts, 2, 19)) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.types new file mode 100644 index 00000000000..4b6d1e19b4a --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.types @@ -0,0 +1,13 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments08.ts === + +function f(arguments) { +>f : (arguments: any) => void +>arguments : any + + var a = () => (arguments) => arguments; +>a : () => (arguments: any) => any +>() => (arguments) => arguments : () => (arguments: any) => any +>(arguments) => arguments : (arguments: any) => any +>arguments : any +>arguments : any +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.js new file mode 100644 index 00000000000..ee568185c0a --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments08_ES6.ts] + +function f(arguments) { + var a = () => (arguments) => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments08_ES6.js] +function f(arguments) { + var a = () => (arguments) => arguments; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.symbols new file mode 100644 index 00000000000..bfbb055cc32 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments08_ES6.ts === + +function f(arguments) { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments08_ES6.ts, 0, 0)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments08_ES6.ts, 1, 11)) + + var a = () => (arguments) => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments08_ES6.ts, 2, 7)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments08_ES6.ts, 2, 19)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments08_ES6.ts, 2, 19)) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.types new file mode 100644 index 00000000000..ffa0f7f0bca --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.types @@ -0,0 +1,13 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments08_ES6.ts === + +function f(arguments) { +>f : (arguments: any) => void +>arguments : any + + var a = () => (arguments) => arguments; +>a : () => (arguments: any) => any +>() => (arguments) => arguments : () => (arguments: any) => any +>(arguments) => arguments : (arguments: any) => any +>arguments : any +>arguments : any +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09.errors.txt new file mode 100644 index 00000000000..72239150cf3 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09.ts(3,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09.ts (1 errors) ==== + + function f(_arguments) { + var a = () => () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09.js new file mode 100644 index 00000000000..c879e6f1ce9 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments09.ts] + +function f(_arguments) { + var a = () => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments09.js] +function f(_arguments) { + var a = function () { return function () { return arguments; }; }; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.js new file mode 100644 index 00000000000..15932510d39 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments09_ES6.ts] + +function f(_arguments) { + var a = () => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments09_ES6.js] +function f(_arguments) { + var a = () => () => arguments; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.symbols new file mode 100644 index 00000000000..ff8f114c052 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09_ES6.ts === + +function f(_arguments) { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments09_ES6.ts, 0, 0)) +>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments09_ES6.ts, 1, 11)) + + var a = () => () => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments09_ES6.ts, 2, 7)) +>arguments : Symbol(arguments) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.types new file mode 100644 index 00000000000..77f44eebfca --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.types @@ -0,0 +1,12 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09_ES6.ts === + +function f(_arguments) { +>f : (_arguments: any) => void +>_arguments : any + + var a = () => () => arguments; +>a : () => () => IArguments +>() => () => arguments : () => () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10.errors.txt new file mode 100644 index 00000000000..254ad2cbc4d --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10.ts(4,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10.ts (1 errors) ==== + + function f() { + var _arguments = 10; + var a = () => () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10.js new file mode 100644 index 00000000000..a0da99f796c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10.js @@ -0,0 +1,12 @@ +//// [emitArrowFunctionWhenUsingArguments10.ts] + +function f() { + var _arguments = 10; + var a = () => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments10.js] +function f() { + var _arguments = 10; + var a = function () { return function () { return arguments; }; }; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.js new file mode 100644 index 00000000000..83d2b735829 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.js @@ -0,0 +1,12 @@ +//// [emitArrowFunctionWhenUsingArguments10_ES6.ts] + +function f() { + var _arguments = 10; + var a = () => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments10_ES6.js] +function f() { + var _arguments = 10; + var a = () => () => arguments; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.symbols new file mode 100644 index 00000000000..1d9965fa6ad --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10_ES6.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments10_ES6.ts, 0, 0)) + + var _arguments = 10; +>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments10_ES6.ts, 2, 7)) + + var a = () => () => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments10_ES6.ts, 3, 7)) +>arguments : Symbol(arguments) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.types new file mode 100644 index 00000000000..dd567d3bdca --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.types @@ -0,0 +1,15 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10_ES6.ts === + +function f() { +>f : () => void + + var _arguments = 10; +>_arguments : number +>10 : number + + var a = () => () => arguments; +>a : () => () => IArguments +>() => () => arguments : () => () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11.errors.txt new file mode 100644 index 00000000000..0606a7784b3 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11.ts(4,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11.ts (1 errors) ==== + + function f(arguments) { + var _arguments = 10; + var a = () => () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11.js new file mode 100644 index 00000000000..13c1c771c34 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11.js @@ -0,0 +1,12 @@ +//// [emitArrowFunctionWhenUsingArguments11.ts] + +function f(arguments) { + var _arguments = 10; + var a = () => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments11.js] +function f(arguments) { + var _arguments = 10; + var a = function () { return function () { return arguments; }; }; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.js new file mode 100644 index 00000000000..9616d2d351c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.js @@ -0,0 +1,12 @@ +//// [emitArrowFunctionWhenUsingArguments11_ES6.ts] + +function f(arguments) { + var _arguments = 10; + var a = () => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments11_ES6.js] +function f(arguments) { + var _arguments = 10; + var a = () => () => arguments; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.symbols new file mode 100644 index 00000000000..a8f9c86c1b2 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.symbols @@ -0,0 +1,13 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11_ES6.ts === + +function f(arguments) { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments11_ES6.ts, 0, 0)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments11_ES6.ts, 1, 11)) + + var _arguments = 10; +>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments11_ES6.ts, 2, 7)) + + var a = () => () => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments11_ES6.ts, 3, 7)) +>arguments : Symbol(arguments) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.types new file mode 100644 index 00000000000..b977a77010c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.types @@ -0,0 +1,16 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11_ES6.ts === + +function f(arguments) { +>f : (arguments: any) => void +>arguments : any + + var _arguments = 10; +>_arguments : number +>10 : number + + var a = () => () => arguments; +>a : () => () => IArguments +>() => () => arguments : () => () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.errors.txt new file mode 100644 index 00000000000..4b2dd76a5d0 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.errors.txt @@ -0,0 +1,15 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12.ts(3,7): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12.ts(4,23): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12.ts (2 errors) ==== + + class C { + f(arguments) { + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. + var a = () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.js new file mode 100644 index 00000000000..df4fddd3b32 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.js @@ -0,0 +1,17 @@ +//// [emitArrowFunctionWhenUsingArguments12.ts] + +class C { + f(arguments) { + var a = () => arguments; + } +} + +//// [emitArrowFunctionWhenUsingArguments12.js] +var C = (function () { + function C() { + } + C.prototype.f = function (arguments) { + var a = function () { return arguments; }; + }; + return C; +})(); diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.errors.txt new file mode 100644 index 00000000000..8a3018ceb9c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.errors.txt @@ -0,0 +1,12 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12_ES6.ts(3,7): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12_ES6.ts (1 errors) ==== + + class C { + f(arguments) { + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. + var a = () => arguments; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.js new file mode 100644 index 00000000000..8e7631f6fed --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.js @@ -0,0 +1,14 @@ +//// [emitArrowFunctionWhenUsingArguments12_ES6.ts] + +class C { + f(arguments) { + var a = () => arguments; + } +} + +//// [emitArrowFunctionWhenUsingArguments12_ES6.js] +class C { + f(arguments) { + var a = () => arguments; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.js new file mode 100644 index 00000000000..ead0a96dacd --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.js @@ -0,0 +1,12 @@ +//// [emitArrowFunctionWhenUsingArguments13.ts] + +function f() { + var _arguments = 10; + var a = (arguments) => () => _arguments; +} + +//// [emitArrowFunctionWhenUsingArguments13.js] +function f() { + var _arguments = 10; + var a = function (arguments) { return function () { return _arguments; }; }; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.symbols new file mode 100644 index 00000000000..b46d8ab1a63 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.symbols @@ -0,0 +1,13 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments13.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments13.ts, 0, 0)) + + var _arguments = 10; +>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments13.ts, 2, 7)) + + var a = (arguments) => () => _arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments13.ts, 3, 7)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments13.ts, 3, 13)) +>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments13.ts, 2, 7)) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.types new file mode 100644 index 00000000000..6e5a7555315 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.types @@ -0,0 +1,16 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments13.ts === + +function f() { +>f : () => void + + var _arguments = 10; +>_arguments : number +>10 : number + + var a = (arguments) => () => _arguments; +>a : (arguments: any) => () => number +>(arguments) => () => _arguments : (arguments: any) => () => number +>arguments : any +>() => _arguments : () => number +>_arguments : number +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.js new file mode 100644 index 00000000000..818d27a1f57 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.js @@ -0,0 +1,12 @@ +//// [emitArrowFunctionWhenUsingArguments13_ES6.ts] + +function f() { + var _arguments = 10; + var a = (arguments) => () => _arguments; +} + +//// [emitArrowFunctionWhenUsingArguments13_ES6.js] +function f() { + var _arguments = 10; + var a = (arguments) => () => _arguments; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.symbols new file mode 100644 index 00000000000..5c4ec4cb687 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.symbols @@ -0,0 +1,13 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments13_ES6.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments13_ES6.ts, 0, 0)) + + var _arguments = 10; +>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments13_ES6.ts, 2, 7)) + + var a = (arguments) => () => _arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments13_ES6.ts, 3, 7)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments13_ES6.ts, 3, 13)) +>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments13_ES6.ts, 2, 7)) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.types new file mode 100644 index 00000000000..294f5c692e4 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.types @@ -0,0 +1,16 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments13_ES6.ts === + +function f() { +>f : () => void + + var _arguments = 10; +>_arguments : number +>10 : number + + var a = (arguments) => () => _arguments; +>a : (arguments: any) => () => number +>(arguments) => () => _arguments : (arguments: any) => () => number +>arguments : any +>() => _arguments : () => number +>_arguments : number +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14.errors.txt new file mode 100644 index 00000000000..8e38cb9d4d3 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14.ts (1 errors) ==== + + function f() { + if (Math.random()) { + const arguments = 100; + return () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14.js new file mode 100644 index 00000000000..bd94a2fda9c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14.js @@ -0,0 +1,16 @@ +//// [emitArrowFunctionWhenUsingArguments14.ts] + +function f() { + if (Math.random()) { + const arguments = 100; + return () => arguments; + } +} + +//// [emitArrowFunctionWhenUsingArguments14.js] +function f() { + if (Math.random()) { + var arguments_1 = 100; + return function () { return arguments; }; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.js new file mode 100644 index 00000000000..cea4589debb --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.js @@ -0,0 +1,16 @@ +//// [emitArrowFunctionWhenUsingArguments14_ES6.ts] + +function f() { + if (Math.random()) { + let arguments = 100; + return () => arguments; + } +} + +//// [emitArrowFunctionWhenUsingArguments14_ES6.js] +function f() { + if (Math.random()) { + let arguments = 100; + return () => arguments; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.symbols new file mode 100644 index 00000000000..623cc4c9690 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.symbols @@ -0,0 +1,17 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14_ES6.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments14_ES6.ts, 0, 0)) + + if (Math.random()) { +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1664, 1)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) + + let arguments = 100; +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments14_ES6.ts, 3, 11)) + + return () => arguments; +>arguments : Symbol(arguments) + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.types new file mode 100644 index 00000000000..29989ea0f9c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.types @@ -0,0 +1,20 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14_ES6.ts === + +function f() { +>f : () => () => IArguments + + if (Math.random()) { +>Math.random() : number +>Math.random : () => number +>Math : Math +>random : () => number + + let arguments = 100; +>arguments : number +>100 : number + + return () => arguments; +>() => arguments : () => IArguments +>arguments : IArguments + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15.errors.txt new file mode 100644 index 00000000000..02fb22861c5 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15.errors.txt @@ -0,0 +1,14 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15.ts(6,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15.ts (1 errors) ==== + + function f() { + var arguments = "hello"; + if (Math.random()) { + const arguments = 100; + return () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15.js new file mode 100644 index 00000000000..bc5f7dca7ee --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15.js @@ -0,0 +1,18 @@ +//// [emitArrowFunctionWhenUsingArguments15.ts] + +function f() { + var arguments = "hello"; + if (Math.random()) { + const arguments = 100; + return () => arguments; + } +} + +//// [emitArrowFunctionWhenUsingArguments15.js] +function f() { + var arguments = "hello"; + if (Math.random()) { + var arguments_1 = 100; + return function () { return arguments; }; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.js new file mode 100644 index 00000000000..0fa3c9d5f64 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.js @@ -0,0 +1,18 @@ +//// [emitArrowFunctionWhenUsingArguments15_ES6.ts] + +function f() { + var arguments = "hello"; + if (Math.random()) { + const arguments = 100; + return () => arguments; + } +} + +//// [emitArrowFunctionWhenUsingArguments15_ES6.js] +function f() { + var arguments = "hello"; + if (Math.random()) { + const arguments = 100; + return () => arguments; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.symbols new file mode 100644 index 00000000000..d140c21284c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.symbols @@ -0,0 +1,20 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15_ES6.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments15_ES6.ts, 0, 0)) + + var arguments = "hello"; +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments15_ES6.ts, 2, 7)) + + if (Math.random()) { +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1664, 1)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) + + const arguments = 100; +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments15_ES6.ts, 4, 13)) + + return () => arguments; +>arguments : Symbol(arguments) + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.types new file mode 100644 index 00000000000..0bb34b22eef --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.types @@ -0,0 +1,24 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15_ES6.ts === + +function f() { +>f : () => () => IArguments + + var arguments = "hello"; +>arguments : string +>"hello" : string + + if (Math.random()) { +>Math.random() : number +>Math.random : () => number +>Math : Math +>random : () => number + + const arguments = 100; +>arguments : number +>100 : number + + return () => arguments; +>() => arguments : () => IArguments +>arguments : IArguments + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16.errors.txt new file mode 100644 index 00000000000..4480e0f570a --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16.errors.txt @@ -0,0 +1,14 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16.ts (1 errors) ==== + + function f() { + var arguments = "hello"; + if (Math.random()) { + return () => arguments[0]; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + } + var arguments = "world"; + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16.js new file mode 100644 index 00000000000..0a87a3c6ac2 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16.js @@ -0,0 +1,18 @@ +//// [emitArrowFunctionWhenUsingArguments16.ts] + +function f() { + var arguments = "hello"; + if (Math.random()) { + return () => arguments[0]; + } + var arguments = "world"; +} + +//// [emitArrowFunctionWhenUsingArguments16.js] +function f() { + var arguments = "hello"; + if (Math.random()) { + return function () { return arguments[0]; }; + } + var arguments = "world"; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.js new file mode 100644 index 00000000000..b9aaf7240a7 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.js @@ -0,0 +1,18 @@ +//// [emitArrowFunctionWhenUsingArguments16_ES6.ts] + +function f() { + var arguments = "hello"; + if (Math.random()) { + return () => arguments[0]; + } + var arguments = "world"; +} + +//// [emitArrowFunctionWhenUsingArguments16_ES6.js] +function f() { + var arguments = "hello"; + if (Math.random()) { + return () => arguments[0]; + } + var arguments = "world"; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.symbols new file mode 100644 index 00000000000..e970b527d56 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.symbols @@ -0,0 +1,19 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16_ES6.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 0, 0)) + + var arguments = "hello"; +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 2, 7), Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 6, 7)) + + if (Math.random()) { +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1664, 1)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) + + return () => arguments[0]; +>arguments : Symbol(arguments) + } + var arguments = "world"; +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 2, 7), Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 6, 7)) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.types new file mode 100644 index 00000000000..41c6b87fb42 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.types @@ -0,0 +1,25 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16_ES6.ts === + +function f() { +>f : () => () => any + + var arguments = "hello"; +>arguments : string +>"hello" : string + + if (Math.random()) { +>Math.random() : number +>Math.random : () => number +>Math : Math +>random : () => number + + return () => arguments[0]; +>() => arguments[0] : () => any +>arguments[0] : any +>arguments : IArguments +>0 : number + } + var arguments = "world"; +>arguments : string +>"world" : string +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.errors.txt new file mode 100644 index 00000000000..a54d52e3475 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.errors.txt @@ -0,0 +1,14 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17.ts (1 errors) ==== + + function f() { + var { arguments } = { arguments: "hello" }; + if (Math.random()) { + return () => arguments[0]; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + } + var arguments = "world"; + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.js new file mode 100644 index 00000000000..8a845ab0cb2 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.js @@ -0,0 +1,18 @@ +//// [emitArrowFunctionWhenUsingArguments17.ts] + +function f() { + var { arguments } = { arguments: "hello" }; + if (Math.random()) { + return () => arguments[0]; + } + var arguments = "world"; +} + +//// [emitArrowFunctionWhenUsingArguments17.js] +function f() { + var arguments = { arguments: "hello" }.arguments; + if (Math.random()) { + return function () { return arguments[0]; }; + } + var arguments = "world"; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.js new file mode 100644 index 00000000000..1d1a8ece338 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.js @@ -0,0 +1,18 @@ +//// [emitArrowFunctionWhenUsingArguments17_ES6.ts] + +function f() { + var { arguments } = { arguments: "hello" }; + if (Math.random()) { + return () => arguments[0]; + } + var arguments = "world"; +} + +//// [emitArrowFunctionWhenUsingArguments17_ES6.js] +function f() { + var { arguments } = { arguments: "hello" }; + if (Math.random()) { + return () => arguments[0]; + } + var arguments = "world"; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.symbols new file mode 100644 index 00000000000..8612e0896d1 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.symbols @@ -0,0 +1,20 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17_ES6.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 0, 0)) + + var { arguments } = { arguments: "hello" }; +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 2, 9), Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 6, 7)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 2, 25)) + + if (Math.random()) { +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1664, 1)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) + + return () => arguments[0]; +>arguments : Symbol(arguments) + } + var arguments = "world"; +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 2, 9), Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 6, 7)) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.types new file mode 100644 index 00000000000..f62a2dce84c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.types @@ -0,0 +1,27 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17_ES6.ts === + +function f() { +>f : () => () => any + + var { arguments } = { arguments: "hello" }; +>arguments : string +>{ arguments: "hello" } : { arguments: string; } +>arguments : string +>"hello" : string + + if (Math.random()) { +>Math.random() : number +>Math.random : () => number +>Math : Math +>random : () => number + + return () => arguments[0]; +>() => arguments[0] : () => any +>arguments[0] : any +>arguments : IArguments +>0 : number + } + var arguments = "world"; +>arguments : string +>"world" : string +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.errors.txt new file mode 100644 index 00000000000..2595b22801f --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18.ts (1 errors) ==== + + function f() { + var { arguments: args } = { arguments }; + if (Math.random()) { + return () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.js new file mode 100644 index 00000000000..dc40302892b --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.js @@ -0,0 +1,16 @@ +//// [emitArrowFunctionWhenUsingArguments18.ts] + +function f() { + var { arguments: args } = { arguments }; + if (Math.random()) { + return () => arguments; + } +} + +//// [emitArrowFunctionWhenUsingArguments18.js] +function f() { + var args = { arguments: arguments }.arguments; + if (Math.random()) { + return function () { return arguments; }; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.js new file mode 100644 index 00000000000..ae9e7e4ef10 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.js @@ -0,0 +1,16 @@ +//// [emitArrowFunctionWhenUsingArguments18_ES6.ts] + +function f() { + var { arguments: args } = { arguments }; + if (Math.random()) { + return () => arguments; + } +} + +//// [emitArrowFunctionWhenUsingArguments18_ES6.js] +function f() { + var { arguments: args } = { arguments }; + if (Math.random()) { + return () => arguments; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.symbols new file mode 100644 index 00000000000..96f9712635c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18_ES6.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments18_ES6.ts, 0, 0)) + + var { arguments: args } = { arguments }; +>args : Symbol(args, Decl(emitArrowFunctionWhenUsingArguments18_ES6.ts, 2, 9)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments18_ES6.ts, 2, 31)) + + if (Math.random()) { +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1664, 1)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) + + return () => arguments; +>arguments : Symbol(arguments) + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.types new file mode 100644 index 00000000000..f2fe76e8926 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.types @@ -0,0 +1,22 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18_ES6.ts === + +function f() { +>f : () => () => IArguments + + var { arguments: args } = { arguments }; +>arguments : any +>args : IArguments +>{ arguments } : { arguments: IArguments; } +>arguments : IArguments + + if (Math.random()) { +>Math.random() : number +>Math.random : () => number +>Math : Math +>random : () => number + + return () => arguments; +>() => arguments : () => IArguments +>arguments : IArguments + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19.errors.txt new file mode 100644 index 00000000000..e6496443e7e --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19.errors.txt @@ -0,0 +1,20 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19.ts(6,33): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19.ts (1 errors) ==== + + function f() { + function g() { + var _arguments = 10; // No capture in 'g', so no conflict. + function h() { + var capture = () => arguments; // Should trigger an '_arguments' capture into function 'h' + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + foo(_arguments); // Error as this does not resolve to the user defined '_arguments' + } + } + + function foo(x: any) { + return 100; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19.js new file mode 100644 index 00000000000..566c0aa49cd --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19.js @@ -0,0 +1,29 @@ +//// [emitArrowFunctionWhenUsingArguments19.ts] + +function f() { + function g() { + var _arguments = 10; // No capture in 'g', so no conflict. + function h() { + var capture = () => arguments; // Should trigger an '_arguments' capture into function 'h' + foo(_arguments); // Error as this does not resolve to the user defined '_arguments' + } + } + + function foo(x: any) { + return 100; + } +} + +//// [emitArrowFunctionWhenUsingArguments19.js] +function f() { + function g() { + var _arguments = 10; // No capture in 'g', so no conflict. + function h() { + var capture = function () { return arguments; }; // Should trigger an '_arguments' capture into function 'h' + foo(_arguments); // Error as this does not resolve to the user defined '_arguments' + } + } + function foo(x) { + return 100; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.js new file mode 100644 index 00000000000..e41aed4f4bf --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.js @@ -0,0 +1,29 @@ +//// [emitArrowFunctionWhenUsingArguments19_ES6.ts] + +function f() { + function g() { + var _arguments = 10; // No capture in 'g', so no conflict. + function h() { + var capture = () => arguments; // Should trigger an '_arguments' capture into function 'h' + foo(_arguments); // Error as this does not resolve to the user defined '_arguments' + } + } + + function foo(x: any) { + return 100; + } +} + +//// [emitArrowFunctionWhenUsingArguments19_ES6.js] +function f() { + function g() { + var _arguments = 10; // No capture in 'g', so no conflict. + function h() { + var capture = () => arguments; // Should trigger an '_arguments' capture into function 'h' + foo(_arguments); // Error as this does not resolve to the user defined '_arguments' + } + } + function foo(x) { + return 100; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.symbols new file mode 100644 index 00000000000..9e6392daaf1 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.symbols @@ -0,0 +1,31 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19_ES6.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 0, 0)) + + function g() { +>g : Symbol(g, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 1, 14)) + + var _arguments = 10; // No capture in 'g', so no conflict. +>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 3, 11)) + + function h() { +>h : Symbol(h, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 3, 28)) + + var capture = () => arguments; // Should trigger an '_arguments' capture into function 'h' +>capture : Symbol(capture, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 5, 15)) +>arguments : Symbol(arguments) + + foo(_arguments); // Error as this does not resolve to the user defined '_arguments' +>foo : Symbol(foo, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 8, 5)) +>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 3, 11)) + } + } + + function foo(x: any) { +>foo : Symbol(foo, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 8, 5)) +>x : Symbol(x, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 10, 17)) + + return 100; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.types new file mode 100644 index 00000000000..a672389720a --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.types @@ -0,0 +1,35 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19_ES6.ts === + +function f() { +>f : () => void + + function g() { +>g : () => void + + var _arguments = 10; // No capture in 'g', so no conflict. +>_arguments : number +>10 : number + + function h() { +>h : () => void + + var capture = () => arguments; // Should trigger an '_arguments' capture into function 'h' +>capture : () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments + + foo(_arguments); // Error as this does not resolve to the user defined '_arguments' +>foo(_arguments) : number +>foo : (x: any) => number +>_arguments : number + } + } + + function foo(x: any) { +>foo : (x: any) => number +>x : any + + return 100; +>100 : number + } +} diff --git a/tests/baselines/reference/emitArrowFunctionsAsIs.symbols b/tests/baselines/reference/emitArrowFunctionsAsIs.symbols new file mode 100644 index 00000000000..73c68bd194d --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionsAsIs.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionsAsIs.ts === +var arrow1 = a => { }; +>arrow1 : Symbol(arrow1, Decl(emitArrowFunctionsAsIs.ts, 0, 3)) +>a : Symbol(a, Decl(emitArrowFunctionsAsIs.ts, 0, 12)) + +var arrow2 = (a) => { }; +>arrow2 : Symbol(arrow2, Decl(emitArrowFunctionsAsIs.ts, 1, 3)) +>a : Symbol(a, Decl(emitArrowFunctionsAsIs.ts, 1, 14)) + +var arrow3 = (a, b) => { }; +>arrow3 : Symbol(arrow3, Decl(emitArrowFunctionsAsIs.ts, 3, 3)) +>a : Symbol(a, Decl(emitArrowFunctionsAsIs.ts, 3, 14)) +>b : Symbol(b, Decl(emitArrowFunctionsAsIs.ts, 3, 16)) + diff --git a/tests/baselines/reference/emitArrowFunctionsAsIsES6.symbols b/tests/baselines/reference/emitArrowFunctionsAsIsES6.symbols new file mode 100644 index 00000000000..73f4df744e8 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionsAsIsES6.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionsAsIsES6.ts === +var arrow1 = a => { }; +>arrow1 : Symbol(arrow1, Decl(emitArrowFunctionsAsIsES6.ts, 0, 3)) +>a : Symbol(a, Decl(emitArrowFunctionsAsIsES6.ts, 0, 12)) + +var arrow2 = (a) => { }; +>arrow2 : Symbol(arrow2, Decl(emitArrowFunctionsAsIsES6.ts, 1, 3)) +>a : Symbol(a, Decl(emitArrowFunctionsAsIsES6.ts, 1, 14)) + +var arrow3 = (a, b) => { }; +>arrow3 : Symbol(arrow3, Decl(emitArrowFunctionsAsIsES6.ts, 3, 3)) +>a : Symbol(a, Decl(emitArrowFunctionsAsIsES6.ts, 3, 14)) +>b : Symbol(b, Decl(emitArrowFunctionsAsIsES6.ts, 3, 16)) + diff --git a/tests/baselines/reference/emitBOM.symbols b/tests/baselines/reference/emitBOM.symbols new file mode 100644 index 00000000000..85f495580d7 --- /dev/null +++ b/tests/baselines/reference/emitBOM.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/emitBOM.ts === + +// JS and d.ts output should have a BOM but not the sourcemap +var x; +>x : Symbol(x, Decl(emitBOM.ts, 2, 3)) + diff --git a/tests/baselines/reference/emitClassDeclarationOverloadInES6.symbols b/tests/baselines/reference/emitClassDeclarationOverloadInES6.symbols new file mode 100644 index 00000000000..8a3b157d546 --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationOverloadInES6.symbols @@ -0,0 +1,22 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationOverloadInES6.ts === +class C { +>C : Symbol(C, Decl(emitClassDeclarationOverloadInES6.ts, 0, 0)) + + constructor(y: any) +>y : Symbol(y, Decl(emitClassDeclarationOverloadInES6.ts, 1, 16)) + + constructor(x: number) { +>x : Symbol(x, Decl(emitClassDeclarationOverloadInES6.ts, 2, 16)) + } +} + +class D { +>D : Symbol(D, Decl(emitClassDeclarationOverloadInES6.ts, 4, 1)) + + constructor(y: any) +>y : Symbol(y, Decl(emitClassDeclarationOverloadInES6.ts, 7, 16)) + + constructor(x: number, z="hello") {} +>x : Symbol(x, Decl(emitClassDeclarationOverloadInES6.ts, 8, 16)) +>z : Symbol(z, Decl(emitClassDeclarationOverloadInES6.ts, 8, 26)) +} diff --git a/tests/baselines/reference/emitClassDeclarationOverloadInES6.types b/tests/baselines/reference/emitClassDeclarationOverloadInES6.types index 850a5aa5456..94cc2c88ddc 100644 --- a/tests/baselines/reference/emitClassDeclarationOverloadInES6.types +++ b/tests/baselines/reference/emitClassDeclarationOverloadInES6.types @@ -19,4 +19,5 @@ class D { constructor(x: number, z="hello") {} >x : number >z : string +>"hello" : string } diff --git a/tests/baselines/reference/emitClassDeclarationWithConstructorInES6.symbols b/tests/baselines/reference/emitClassDeclarationWithConstructorInES6.symbols new file mode 100644 index 00000000000..8186b029471 --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithConstructorInES6.symbols @@ -0,0 +1,58 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithConstructorInES6.ts === +class A { +>A : Symbol(A, Decl(emitClassDeclarationWithConstructorInES6.ts, 0, 0)) + + y: number; +>y : Symbol(y, Decl(emitClassDeclarationWithConstructorInES6.ts, 0, 9)) + + constructor(x: number) { +>x : Symbol(x, Decl(emitClassDeclarationWithConstructorInES6.ts, 2, 16)) + } + foo(a: any); +>foo : Symbol(foo, Decl(emitClassDeclarationWithConstructorInES6.ts, 3, 5), Decl(emitClassDeclarationWithConstructorInES6.ts, 4, 16)) +>a : Symbol(a, Decl(emitClassDeclarationWithConstructorInES6.ts, 4, 8)) + + foo() { } +>foo : Symbol(foo, Decl(emitClassDeclarationWithConstructorInES6.ts, 3, 5), Decl(emitClassDeclarationWithConstructorInES6.ts, 4, 16)) +} + +class B { +>B : Symbol(B, Decl(emitClassDeclarationWithConstructorInES6.ts, 6, 1)) + + y: number; +>y : Symbol(y, Decl(emitClassDeclarationWithConstructorInES6.ts, 8, 9)) + + x: string = "hello"; +>x : Symbol(x, Decl(emitClassDeclarationWithConstructorInES6.ts, 9, 14)) + + _bar: string; +>_bar : Symbol(_bar, Decl(emitClassDeclarationWithConstructorInES6.ts, 10, 24)) + + constructor(x: number, z = "hello", ...args) { +>x : Symbol(x, Decl(emitClassDeclarationWithConstructorInES6.ts, 13, 16)) +>z : Symbol(z, Decl(emitClassDeclarationWithConstructorInES6.ts, 13, 26)) +>args : Symbol(args, Decl(emitClassDeclarationWithConstructorInES6.ts, 13, 39)) + + this.y = 10; +>this.y : Symbol(y, Decl(emitClassDeclarationWithConstructorInES6.ts, 8, 9)) +>this : Symbol(B, Decl(emitClassDeclarationWithConstructorInES6.ts, 6, 1)) +>y : Symbol(y, Decl(emitClassDeclarationWithConstructorInES6.ts, 8, 9)) + } + baz(...args): string; +>baz : Symbol(baz, Decl(emitClassDeclarationWithConstructorInES6.ts, 15, 5), Decl(emitClassDeclarationWithConstructorInES6.ts, 16, 25)) +>args : Symbol(args, Decl(emitClassDeclarationWithConstructorInES6.ts, 16, 8)) + + baz(z: string, v: number): string { +>baz : Symbol(baz, Decl(emitClassDeclarationWithConstructorInES6.ts, 15, 5), Decl(emitClassDeclarationWithConstructorInES6.ts, 16, 25)) +>z : Symbol(z, Decl(emitClassDeclarationWithConstructorInES6.ts, 17, 8)) +>v : Symbol(v, Decl(emitClassDeclarationWithConstructorInES6.ts, 17, 18)) + + return this._bar; +>this._bar : Symbol(_bar, Decl(emitClassDeclarationWithConstructorInES6.ts, 10, 24)) +>this : Symbol(B, Decl(emitClassDeclarationWithConstructorInES6.ts, 6, 1)) +>_bar : Symbol(_bar, Decl(emitClassDeclarationWithConstructorInES6.ts, 10, 24)) + } +} + + + diff --git a/tests/baselines/reference/emitClassDeclarationWithConstructorInES6.types b/tests/baselines/reference/emitClassDeclarationWithConstructorInES6.types index 10244bf6170..ecb48cb3047 100644 --- a/tests/baselines/reference/emitClassDeclarationWithConstructorInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithConstructorInES6.types @@ -24,6 +24,7 @@ class B { x: string = "hello"; >x : string +>"hello" : string _bar: string; >_bar : string @@ -31,6 +32,7 @@ class B { constructor(x: number, z = "hello", ...args) { >x : number >z : string +>"hello" : string >args : any[] this.y = 10; @@ -38,6 +40,7 @@ class B { >this.y : number >this : B >y : number +>10 : number } baz(...args): string; >baz : (...args: any[]) => string diff --git a/tests/baselines/reference/emitClassDeclarationWithExtensionAndTypeArgumentInES6.symbols b/tests/baselines/reference/emitClassDeclarationWithExtensionAndTypeArgumentInES6.symbols new file mode 100644 index 00000000000..f93b3bafcd3 --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithExtensionAndTypeArgumentInES6.symbols @@ -0,0 +1,28 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts === +class B { +>B : Symbol(B, Decl(emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts, 0, 0)) +>T : Symbol(T, Decl(emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts, 0, 8)) + + constructor(a: T) { } +>a : Symbol(a, Decl(emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts, 1, 16)) +>T : Symbol(T, Decl(emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts, 0, 8)) +} +class C extends B { } +>C : Symbol(C, Decl(emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts, 2, 1)) +>B : Symbol(B, Decl(emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts, 0, 0)) + +class D extends B { +>D : Symbol(D, Decl(emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts, 3, 29)) +>B : Symbol(B, Decl(emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts, 0, 0)) + + constructor(a: any) +>a : Symbol(a, Decl(emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts, 5, 16)) + + constructor(b: number) { +>b : Symbol(b, Decl(emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts, 6, 16)) + + super(b); +>super : Symbol(B, Decl(emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts, 0, 0)) +>b : Symbol(b, Decl(emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts, 6, 16)) + } +} diff --git a/tests/baselines/reference/emitClassDeclarationWithExtensionInES6.symbols b/tests/baselines/reference/emitClassDeclarationWithExtensionInES6.symbols new file mode 100644 index 00000000000..586a924a260 --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithExtensionInES6.symbols @@ -0,0 +1,57 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithExtensionInES6.ts === +class B { +>B : Symbol(B, Decl(emitClassDeclarationWithExtensionInES6.ts, 0, 0)) + + baz(a: string, y = 10) { } +>baz : Symbol(baz, Decl(emitClassDeclarationWithExtensionInES6.ts, 0, 9)) +>a : Symbol(a, Decl(emitClassDeclarationWithExtensionInES6.ts, 1, 8)) +>y : Symbol(y, Decl(emitClassDeclarationWithExtensionInES6.ts, 1, 18)) +} +class C extends B { +>C : Symbol(C, Decl(emitClassDeclarationWithExtensionInES6.ts, 2, 1)) +>B : Symbol(B, Decl(emitClassDeclarationWithExtensionInES6.ts, 0, 0)) + + foo() { } +>foo : Symbol(foo, Decl(emitClassDeclarationWithExtensionInES6.ts, 3, 19)) + + baz(a: string, y:number) { +>baz : Symbol(baz, Decl(emitClassDeclarationWithExtensionInES6.ts, 4, 13)) +>a : Symbol(a, Decl(emitClassDeclarationWithExtensionInES6.ts, 5, 8)) +>y : Symbol(y, Decl(emitClassDeclarationWithExtensionInES6.ts, 5, 18)) + + super.baz(a, y); +>super.baz : Symbol(B.baz, Decl(emitClassDeclarationWithExtensionInES6.ts, 0, 9)) +>super : Symbol(B, Decl(emitClassDeclarationWithExtensionInES6.ts, 0, 0)) +>baz : Symbol(B.baz, Decl(emitClassDeclarationWithExtensionInES6.ts, 0, 9)) +>a : Symbol(a, Decl(emitClassDeclarationWithExtensionInES6.ts, 5, 8)) +>y : Symbol(y, Decl(emitClassDeclarationWithExtensionInES6.ts, 5, 18)) + } +} +class D extends C { +>D : Symbol(D, Decl(emitClassDeclarationWithExtensionInES6.ts, 8, 1)) +>C : Symbol(C, Decl(emitClassDeclarationWithExtensionInES6.ts, 2, 1)) + + constructor() { + super(); +>super : Symbol(C, Decl(emitClassDeclarationWithExtensionInES6.ts, 2, 1)) + } + + foo() { +>foo : Symbol(foo, Decl(emitClassDeclarationWithExtensionInES6.ts, 12, 5)) + + super.foo(); +>super.foo : Symbol(C.foo, Decl(emitClassDeclarationWithExtensionInES6.ts, 3, 19)) +>super : Symbol(C, Decl(emitClassDeclarationWithExtensionInES6.ts, 2, 1)) +>foo : Symbol(C.foo, Decl(emitClassDeclarationWithExtensionInES6.ts, 3, 19)) + } + + baz() { +>baz : Symbol(baz, Decl(emitClassDeclarationWithExtensionInES6.ts, 16, 5)) + + super.baz("hello", 10); +>super.baz : Symbol(C.baz, Decl(emitClassDeclarationWithExtensionInES6.ts, 4, 13)) +>super : Symbol(C, Decl(emitClassDeclarationWithExtensionInES6.ts, 2, 1)) +>baz : Symbol(C.baz, Decl(emitClassDeclarationWithExtensionInES6.ts, 4, 13)) + } +} + diff --git a/tests/baselines/reference/emitClassDeclarationWithExtensionInES6.types b/tests/baselines/reference/emitClassDeclarationWithExtensionInES6.types index a1549be5df4..7267af2fde0 100644 --- a/tests/baselines/reference/emitClassDeclarationWithExtensionInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithExtensionInES6.types @@ -6,6 +6,7 @@ class B { >baz : (a: string, y?: number) => void >a : string >y : number +>10 : number } class C extends B { >C : C @@ -56,6 +57,8 @@ class D extends C { >super.baz : (a: string, y: number) => void >super : C >baz : (a: string, y: number) => void +>"hello" : string +>10 : number } } diff --git a/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.symbols b/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.symbols new file mode 100644 index 00000000000..2d249348f9b --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.symbols @@ -0,0 +1,48 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithGetterSetterInES6.ts === +class C { +>C : Symbol(C, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 0, 0)) + + _name: string; +>_name : Symbol(_name, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 0, 9)) + + get name(): string { +>name : Symbol(name, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 1, 18)) + + return this._name; +>this._name : Symbol(_name, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 0, 9)) +>this : Symbol(C, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 0, 0)) +>_name : Symbol(_name, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 0, 9)) + } + static get name2(): string { +>name2 : Symbol(C.name2, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 4, 5)) + + return "BYE"; + } + static get ["computedname"]() { + return ""; + } + get ["computedname"]() { + return ""; + } + get ["computedname"]() { + return ""; + } + + set ["computedname"](x: any) { +>x : Symbol(x, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 18, 25)) + } + set ["computedname"](y: string) { +>y : Symbol(y, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 20, 25)) + } + + set foo(a: string) { } +>foo : Symbol(foo, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 21, 5)) +>a : Symbol(a, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 23, 12)) + + static set bar(b: number) { } +>bar : Symbol(C.bar, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 23, 26)) +>b : Symbol(b, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 24, 19)) + + static set ["computedname"](b: string) { } +>b : Symbol(b, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 25, 32)) +} diff --git a/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.types b/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.types index 83d4fcd0d80..b26d6b3dd81 100644 --- a/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.types @@ -17,21 +17,33 @@ class C { >name2 : string return "BYE"; +>"BYE" : string } static get ["computedname"]() { +>"computedname" : string + return ""; +>"" : string } get ["computedname"]() { +>"computedname" : string + return ""; +>"" : string } get ["computedname"]() { +>"computedname" : string + return ""; +>"" : string } set ["computedname"](x: any) { +>"computedname" : string >x : any } set ["computedname"](y: string) { +>"computedname" : string >y : string } @@ -44,5 +56,6 @@ class C { >b : number static set ["computedname"](b: string) { } +>"computedname" : string >b : string } diff --git a/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.symbols b/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.symbols new file mode 100644 index 00000000000..fdceb9831c1 --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.symbols @@ -0,0 +1,19 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithLiteralPropertyNameInES6.ts === +class B { +>B : Symbol(B, Decl(emitClassDeclarationWithLiteralPropertyNameInES6.ts, 0, 0)) + + "hello" = 10; + 0b110 = "world"; + 0o23534 = "WORLD"; + 20 = "twenty"; + "foo"() { } + 0b1110() {} + 11() { } + interface() { } +>interface : Symbol(interface, Decl(emitClassDeclarationWithLiteralPropertyNameInES6.ts, 7, 12)) + + static "hi" = 10000; + static 22 = "twenty-two"; + static 0b101 = "binary"; + static 0o3235 = "octal"; +} diff --git a/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.types b/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.types index 65ba8f7d2b9..d4bc18539dd 100644 --- a/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.types @@ -3,9 +3,17 @@ class B { >B : B "hello" = 10; +>10 : number + 0b110 = "world"; +>"world" : string + 0o23534 = "WORLD"; +>"WORLD" : string + 20 = "twenty"; +>"twenty" : string + "foo"() { } 0b1110() {} 11() { } @@ -13,7 +21,14 @@ class B { >interface : () => void static "hi" = 10000; +>10000 : number + static 22 = "twenty-two"; +>"twenty-two" : string + static 0b101 = "binary"; +>"binary" : string + static 0o3235 = "octal"; +>"octal" : string } diff --git a/tests/baselines/reference/emitClassDeclarationWithMethodInES6.symbols b/tests/baselines/reference/emitClassDeclarationWithMethodInES6.symbols new file mode 100644 index 00000000000..b7a4dbbf341 --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithMethodInES6.symbols @@ -0,0 +1,56 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithMethodInES6.ts === +class D { +>D : Symbol(D, Decl(emitClassDeclarationWithMethodInES6.ts, 0, 0)) + + _bar: string; +>_bar : Symbol(_bar, Decl(emitClassDeclarationWithMethodInES6.ts, 0, 9)) + + foo() { } +>foo : Symbol(foo, Decl(emitClassDeclarationWithMethodInES6.ts, 1, 17)) + + ["computedName"]() { } + ["computedName"](a: string) { } +>a : Symbol(a, Decl(emitClassDeclarationWithMethodInES6.ts, 4, 21)) + + ["computedName"](a: string): number { return 1; } +>a : Symbol(a, Decl(emitClassDeclarationWithMethodInES6.ts, 5, 21)) + + bar(): string { +>bar : Symbol(bar, Decl(emitClassDeclarationWithMethodInES6.ts, 5, 53)) + + return this._bar; +>this._bar : Symbol(_bar, Decl(emitClassDeclarationWithMethodInES6.ts, 0, 9)) +>this : Symbol(D, Decl(emitClassDeclarationWithMethodInES6.ts, 0, 0)) +>_bar : Symbol(_bar, Decl(emitClassDeclarationWithMethodInES6.ts, 0, 9)) + } + baz(a: any, x: string): string { +>baz : Symbol(baz, Decl(emitClassDeclarationWithMethodInES6.ts, 8, 5)) +>a : Symbol(a, Decl(emitClassDeclarationWithMethodInES6.ts, 9, 8)) +>x : Symbol(x, Decl(emitClassDeclarationWithMethodInES6.ts, 9, 15)) + + return "HELLO"; + } + static ["computedname"]() { } + static ["computedname"](a: string) { } +>a : Symbol(a, Decl(emitClassDeclarationWithMethodInES6.ts, 13, 28)) + + static ["computedname"](a: string): boolean { return true; } +>a : Symbol(a, Decl(emitClassDeclarationWithMethodInES6.ts, 14, 28)) + + static staticMethod() { +>staticMethod : Symbol(D.staticMethod, Decl(emitClassDeclarationWithMethodInES6.ts, 14, 64)) + + var x = 1 + 2; +>x : Symbol(x, Decl(emitClassDeclarationWithMethodInES6.ts, 16, 11)) + + return x +>x : Symbol(x, Decl(emitClassDeclarationWithMethodInES6.ts, 16, 11)) + } + static foo(a: string) { } +>foo : Symbol(D.foo, Decl(emitClassDeclarationWithMethodInES6.ts, 18, 5)) +>a : Symbol(a, Decl(emitClassDeclarationWithMethodInES6.ts, 19, 15)) + + static bar(a: string): number { return 1; } +>bar : Symbol(D.bar, Decl(emitClassDeclarationWithMethodInES6.ts, 19, 29)) +>a : Symbol(a, Decl(emitClassDeclarationWithMethodInES6.ts, 20, 15)) +} diff --git a/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types b/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types index f26a9f87e6d..d3e75c9235c 100644 --- a/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types @@ -9,11 +9,16 @@ class D { >foo : () => void ["computedName"]() { } +>"computedName" : string + ["computedName"](a: string) { } +>"computedName" : string >a : string ["computedName"](a: string): number { return 1; } +>"computedName" : string >a : string +>1 : number bar(): string { >bar : () => string @@ -29,13 +34,19 @@ class D { >x : string return "HELLO"; +>"HELLO" : string } static ["computedname"]() { } +>"computedname" : string + static ["computedname"](a: string) { } +>"computedname" : string >a : string static ["computedname"](a: string): boolean { return true; } +>"computedname" : string >a : string +>true : boolean static staticMethod() { >staticMethod : () => number @@ -43,6 +54,8 @@ class D { var x = 1 + 2; >x : number >1 + 2 : number +>1 : number +>2 : number return x >x : number @@ -54,4 +67,5 @@ class D { static bar(a: string): number { return 1; } >bar : (a: string) => number >a : string +>1 : number } diff --git a/tests/baselines/reference/emitClassDeclarationWithPropertyAssignmentInES6.symbols b/tests/baselines/reference/emitClassDeclarationWithPropertyAssignmentInES6.symbols new file mode 100644 index 00000000000..67878625bda --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithPropertyAssignmentInES6.symbols @@ -0,0 +1,53 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithPropertyAssignmentInES6.ts === +class C { +>C : Symbol(C, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 0, 0)) + + x: string = "Hello world"; +>x : Symbol(x, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 0, 9)) +} + +class D { +>D : Symbol(D, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 2, 1)) + + x: string = "Hello world"; +>x : Symbol(x, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 4, 9)) + + y: number; +>y : Symbol(y, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 5, 30)) + + constructor() { + this.y = 10; +>this.y : Symbol(y, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 5, 30)) +>this : Symbol(D, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 2, 1)) +>y : Symbol(y, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 5, 30)) + } +} + +class E extends D{ +>E : Symbol(E, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 10, 1)) +>D : Symbol(D, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 2, 1)) + + z: boolean = true; +>z : Symbol(z, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 12, 18)) +} + +class F extends D{ +>F : Symbol(F, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 14, 1)) +>D : Symbol(D, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 2, 1)) + + z: boolean = true; +>z : Symbol(z, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 16, 18)) + + j: string; +>j : Symbol(j, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 17, 22)) + + constructor() { + super(); +>super : Symbol(D, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 2, 1)) + + this.j = "HI"; +>this.j : Symbol(j, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 17, 22)) +>this : Symbol(F, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 14, 1)) +>j : Symbol(j, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 17, 22)) + } +} diff --git a/tests/baselines/reference/emitClassDeclarationWithPropertyAssignmentInES6.types b/tests/baselines/reference/emitClassDeclarationWithPropertyAssignmentInES6.types index 5e7ebbc167c..f3504d655ed 100644 --- a/tests/baselines/reference/emitClassDeclarationWithPropertyAssignmentInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithPropertyAssignmentInES6.types @@ -4,6 +4,7 @@ class C { x: string = "Hello world"; >x : string +>"Hello world" : string } class D { @@ -11,6 +12,7 @@ class D { x: string = "Hello world"; >x : string +>"Hello world" : string y: number; >y : number @@ -21,6 +23,7 @@ class D { >this.y : number >this : D >y : number +>10 : number } } @@ -30,6 +33,7 @@ class E extends D{ z: boolean = true; >z : boolean +>true : boolean } class F extends D{ @@ -38,6 +42,7 @@ class F extends D{ z: boolean = true; >z : boolean +>true : boolean j: string; >j : string @@ -52,5 +57,6 @@ class F extends D{ >this.j : string >this : F >j : string +>"HI" : string } } diff --git a/tests/baselines/reference/emitClassDeclarationWithStaticPropertyAssignmentInES6.symbols b/tests/baselines/reference/emitClassDeclarationWithStaticPropertyAssignmentInES6.symbols new file mode 100644 index 00000000000..1b64646f788 --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithStaticPropertyAssignmentInES6.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithStaticPropertyAssignmentInES6.ts === +class C { +>C : Symbol(C, Decl(emitClassDeclarationWithStaticPropertyAssignmentInES6.ts, 0, 0)) + + static z: string = "Foo"; +>z : Symbol(C.z, Decl(emitClassDeclarationWithStaticPropertyAssignmentInES6.ts, 0, 9)) +} + +class D { +>D : Symbol(D, Decl(emitClassDeclarationWithStaticPropertyAssignmentInES6.ts, 2, 1)) + + x = 20000; +>x : Symbol(x, Decl(emitClassDeclarationWithStaticPropertyAssignmentInES6.ts, 4, 9)) + + static b = true; +>b : Symbol(D.b, Decl(emitClassDeclarationWithStaticPropertyAssignmentInES6.ts, 5, 14)) +} + diff --git a/tests/baselines/reference/emitClassDeclarationWithStaticPropertyAssignmentInES6.types b/tests/baselines/reference/emitClassDeclarationWithStaticPropertyAssignmentInES6.types index 6003b85b590..58d328e3e5d 100644 --- a/tests/baselines/reference/emitClassDeclarationWithStaticPropertyAssignmentInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithStaticPropertyAssignmentInES6.types @@ -4,6 +4,7 @@ class C { static z: string = "Foo"; >z : string +>"Foo" : string } class D { @@ -11,8 +12,10 @@ class D { x = 20000; >x : number +>20000 : number static b = true; >b : boolean +>true : boolean } diff --git a/tests/baselines/reference/emitClassDeclarationWithSuperMethodCall01.js b/tests/baselines/reference/emitClassDeclarationWithSuperMethodCall01.js new file mode 100644 index 00000000000..77b91730156 --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithSuperMethodCall01.js @@ -0,0 +1,23 @@ +//// [emitClassDeclarationWithSuperMethodCall01.ts] + +class Parent { + foo() { + } +} + +class Foo extends Parent { + foo() { + var x = () => super.foo(); + } +} + +//// [emitClassDeclarationWithSuperMethodCall01.js] +class Parent { + foo() { + } +} +class Foo extends Parent { + foo() { + var x = () => super.foo(); + } +} diff --git a/tests/baselines/reference/emitClassDeclarationWithSuperMethodCall01.symbols b/tests/baselines/reference/emitClassDeclarationWithSuperMethodCall01.symbols new file mode 100644 index 00000000000..13ce54e0641 --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithSuperMethodCall01.symbols @@ -0,0 +1,24 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithSuperMethodCall01.ts === + +class Parent { +>Parent : Symbol(Parent, Decl(emitClassDeclarationWithSuperMethodCall01.ts, 0, 0)) + + foo() { +>foo : Symbol(foo, Decl(emitClassDeclarationWithSuperMethodCall01.ts, 1, 14)) + } +} + +class Foo extends Parent { +>Foo : Symbol(Foo, Decl(emitClassDeclarationWithSuperMethodCall01.ts, 4, 1)) +>Parent : Symbol(Parent, Decl(emitClassDeclarationWithSuperMethodCall01.ts, 0, 0)) + + foo() { +>foo : Symbol(foo, Decl(emitClassDeclarationWithSuperMethodCall01.ts, 6, 26)) + + var x = () => super.foo(); +>x : Symbol(x, Decl(emitClassDeclarationWithSuperMethodCall01.ts, 8, 11)) +>super.foo : Symbol(Parent.foo, Decl(emitClassDeclarationWithSuperMethodCall01.ts, 1, 14)) +>super : Symbol(Parent, Decl(emitClassDeclarationWithSuperMethodCall01.ts, 0, 0)) +>foo : Symbol(Parent.foo, Decl(emitClassDeclarationWithSuperMethodCall01.ts, 1, 14)) + } +} diff --git a/tests/baselines/reference/emitClassDeclarationWithSuperMethodCall01.types b/tests/baselines/reference/emitClassDeclarationWithSuperMethodCall01.types new file mode 100644 index 00000000000..8b68af897ac --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithSuperMethodCall01.types @@ -0,0 +1,26 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithSuperMethodCall01.ts === + +class Parent { +>Parent : Parent + + foo() { +>foo : () => void + } +} + +class Foo extends Parent { +>Foo : Foo +>Parent : Parent + + foo() { +>foo : () => void + + var x = () => super.foo(); +>x : () => void +>() => super.foo() : () => void +>super.foo() : void +>super.foo : () => void +>super : Parent +>foo : () => void + } +} diff --git a/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.symbols b/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.symbols new file mode 100644 index 00000000000..32220451b9c --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.symbols @@ -0,0 +1,49 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithThisKeywordInES6.ts === +class B { +>B : Symbol(B, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 0)) + + x = 10; +>x : Symbol(x, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 9)) + + constructor() { + this.x = 10; +>this.x : Symbol(x, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 9)) +>this : Symbol(B, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 0)) +>x : Symbol(x, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 9)) + } + static log(a: number) { } +>log : Symbol(B.log, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 4, 5)) +>a : Symbol(a, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 5, 15)) + + foo() { +>foo : Symbol(foo, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 5, 29)) + + B.log(this.x); +>B.log : Symbol(B.log, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 4, 5)) +>B : Symbol(B, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 0)) +>log : Symbol(B.log, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 4, 5)) +>this.x : Symbol(x, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 9)) +>this : Symbol(B, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 0)) +>x : Symbol(x, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 9)) + } + + get X() { +>X : Symbol(X, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 8, 5)) + + return this.x; +>this.x : Symbol(x, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 9)) +>this : Symbol(B, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 0)) +>x : Symbol(x, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 9)) + } + + set bX(y: number) { +>bX : Symbol(bX, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 12, 5)) +>y : Symbol(y, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 14, 11)) + + this.x = y; +>this.x : Symbol(x, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 9)) +>this : Symbol(B, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 0)) +>x : Symbol(x, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 9)) +>y : Symbol(y, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 14, 11)) + } +} diff --git a/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.types b/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.types index bb0f7e99939..14c57a60bc4 100644 --- a/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.types @@ -4,6 +4,7 @@ class B { x = 10; >x : number +>10 : number constructor() { this.x = 10; @@ -11,6 +12,7 @@ class B { >this.x : number >this : B >x : number +>10 : number } static log(a: number) { } >log : (a: number) => void diff --git a/tests/baselines/reference/emitClassDeclarationWithTypeArgumentAndOverloadInES6.symbols b/tests/baselines/reference/emitClassDeclarationWithTypeArgumentAndOverloadInES6.symbols new file mode 100644 index 00000000000..092dbf10c7b --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithTypeArgumentAndOverloadInES6.symbols @@ -0,0 +1,73 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts === +class B { +>B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 0)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 8)) + + x: T; +>x : Symbol(x, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 12)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 8)) + + B: T; +>B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 1, 9)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 8)) + + constructor(a: any) +>a : Symbol(a, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 4, 16)) + + constructor(a: any,b: T) +>a : Symbol(a, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 5, 16)) +>b : Symbol(b, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 5, 23)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 8)) + + constructor(a: T) { this.B = a;} +>a : Symbol(a, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 6, 16)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 8)) +>this.B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 1, 9)) +>this : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 0)) +>B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 1, 9)) +>a : Symbol(a, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 6, 16)) + + foo(a: T) +>foo : Symbol(foo, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 6, 36), Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 8, 13), Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 9, 15), Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 10, 18)) +>a : Symbol(a, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 8, 8)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 8)) + + foo(a: any) +>foo : Symbol(foo, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 6, 36), Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 8, 13), Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 9, 15), Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 10, 18)) +>a : Symbol(a, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 9, 8)) + + foo(b: string) +>foo : Symbol(foo, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 6, 36), Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 8, 13), Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 9, 15), Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 10, 18)) +>b : Symbol(b, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 10, 8)) + + foo(): T { +>foo : Symbol(foo, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 6, 36), Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 8, 13), Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 9, 15), Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 10, 18)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 8)) + + return this.x; +>this.x : Symbol(x, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 12)) +>this : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 0)) +>x : Symbol(x, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 12)) + } + + get BB(): T { +>BB : Symbol(BB, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 13, 5)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 8)) + + return this.B; +>this.B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 1, 9)) +>this : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 0)) +>B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 1, 9)) + } + set BBWith(c: T) { +>BBWith : Symbol(BBWith, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 17, 5)) +>c : Symbol(c, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 18, 15)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 8)) + + this.B = c; +>this.B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 1, 9)) +>this : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 0)) +>B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 1, 9)) +>c : Symbol(c, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 18, 15)) + } +} diff --git a/tests/baselines/reference/emitClassDeclarationWithTypeArgumentInES6.symbols b/tests/baselines/reference/emitClassDeclarationWithTypeArgumentInES6.symbols new file mode 100644 index 00000000000..58f44b69f01 --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithTypeArgumentInES6.symbols @@ -0,0 +1,51 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithTypeArgumentInES6.ts === +class B { +>B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 0)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 8)) + + x: T; +>x : Symbol(x, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 12)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 8)) + + B: T; +>B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 1, 9)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 8)) + + constructor(a: T) { this.B = a;} +>a : Symbol(a, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 3, 16)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 8)) +>this.B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 1, 9)) +>this : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 0)) +>B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 1, 9)) +>a : Symbol(a, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 3, 16)) + + foo(): T { +>foo : Symbol(foo, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 3, 36)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 8)) + + return this.x; +>this.x : Symbol(x, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 12)) +>this : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 0)) +>x : Symbol(x, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 12)) + } + get BB(): T { +>BB : Symbol(BB, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 6, 5)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 8)) + + return this.B; +>this.B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 1, 9)) +>this : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 0)) +>B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 1, 9)) + } + set BBWith(c: T) { +>BBWith : Symbol(BBWith, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 9, 5)) +>c : Symbol(c, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 10, 15)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 8)) + + this.B = c; +>this.B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 1, 9)) +>this : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 0)) +>B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 1, 9)) +>c : Symbol(c, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 10, 15)) + } +} diff --git a/tests/baselines/reference/emitCommentsOnlyFile.symbols b/tests/baselines/reference/emitCommentsOnlyFile.symbols new file mode 100644 index 00000000000..38b23eb128d --- /dev/null +++ b/tests/baselines/reference/emitCommentsOnlyFile.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/emitCommentsOnlyFile.ts === + +No type information for this code./** +No type information for this code.* @name Foo +No type information for this code.* @class +No type information for this code.*/ +No type information for this code./**#@+ +No type information for this code.* @memberOf Foo# +No type information for this code.* @field +No type information for this code.*/ +No type information for this code./** +No type information for this code.* @name bar +No type information for this code.* @type Object[] +No type information for this code.*/ +No type information for this code./**#@-*/ +No type information for this code./** +No type information for this code.* @name Foo2 +No type information for this code.* @class +No type information for this code.*/ +No type information for this code./**#@+ +No type information for this code.* @memberOf Foo2# +No type information for this code.* @field +No type information for this code.*/ +No type information for this code./** +No type information for this code.* @name bar +No type information for this code.* @type Object[] +No type information for this code.*/ +No type information for this code./**#@-*/ +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/emitDefaultParametersFunction.symbols b/tests/baselines/reference/emitDefaultParametersFunction.symbols new file mode 100644 index 00000000000..c6c68ca1c70 --- /dev/null +++ b/tests/baselines/reference/emitDefaultParametersFunction.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/es6/defaultParameters/emitDefaultParametersFunction.ts === +function foo(x: string, y = 10) { } +>foo : Symbol(foo, Decl(emitDefaultParametersFunction.ts, 0, 0)) +>x : Symbol(x, Decl(emitDefaultParametersFunction.ts, 0, 13)) +>y : Symbol(y, Decl(emitDefaultParametersFunction.ts, 0, 23)) + +function baz(x: string, y = 5, ...rest) { } +>baz : Symbol(baz, Decl(emitDefaultParametersFunction.ts, 0, 35)) +>x : Symbol(x, Decl(emitDefaultParametersFunction.ts, 1, 13)) +>y : Symbol(y, Decl(emitDefaultParametersFunction.ts, 1, 23)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunction.ts, 1, 30)) + +function bar(y = 10) { } +>bar : Symbol(bar, Decl(emitDefaultParametersFunction.ts, 1, 43)) +>y : Symbol(y, Decl(emitDefaultParametersFunction.ts, 2, 13)) + +function bar1(y = 10, ...rest) { } +>bar1 : Symbol(bar1, Decl(emitDefaultParametersFunction.ts, 2, 24)) +>y : Symbol(y, Decl(emitDefaultParametersFunction.ts, 3, 14)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunction.ts, 3, 21)) + diff --git a/tests/baselines/reference/emitDefaultParametersFunction.types b/tests/baselines/reference/emitDefaultParametersFunction.types index a8dec6335a9..5c27d3ddf3d 100644 --- a/tests/baselines/reference/emitDefaultParametersFunction.types +++ b/tests/baselines/reference/emitDefaultParametersFunction.types @@ -3,19 +3,23 @@ function foo(x: string, y = 10) { } >foo : (x: string, y?: number) => void >x : string >y : number +>10 : number function baz(x: string, y = 5, ...rest) { } >baz : (x: string, y?: number, ...rest: any[]) => void >x : string >y : number +>5 : number >rest : any[] function bar(y = 10) { } >bar : (y?: number) => void >y : number +>10 : number function bar1(y = 10, ...rest) { } >bar1 : (y?: number, ...rest: any[]) => void >y : number +>10 : number >rest : any[] diff --git a/tests/baselines/reference/emitDefaultParametersFunctionES6.symbols b/tests/baselines/reference/emitDefaultParametersFunctionES6.symbols new file mode 100644 index 00000000000..49e1cad020e --- /dev/null +++ b/tests/baselines/reference/emitDefaultParametersFunctionES6.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/es6/defaultParameters/emitDefaultParametersFunctionES6.ts === +function foo(x: string, y = 10) { } +>foo : Symbol(foo, Decl(emitDefaultParametersFunctionES6.ts, 0, 0)) +>x : Symbol(x, Decl(emitDefaultParametersFunctionES6.ts, 0, 13)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionES6.ts, 0, 23)) + +function baz(x: string, y = 5, ...rest) { } +>baz : Symbol(baz, Decl(emitDefaultParametersFunctionES6.ts, 0, 35)) +>x : Symbol(x, Decl(emitDefaultParametersFunctionES6.ts, 1, 13)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionES6.ts, 1, 23)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionES6.ts, 1, 30)) + +function bar(y = 10) { } +>bar : Symbol(bar, Decl(emitDefaultParametersFunctionES6.ts, 1, 43)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionES6.ts, 2, 13)) + +function bar1(y = 10, ...rest) { } +>bar1 : Symbol(bar1, Decl(emitDefaultParametersFunctionES6.ts, 2, 24)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionES6.ts, 3, 14)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionES6.ts, 3, 21)) + diff --git a/tests/baselines/reference/emitDefaultParametersFunctionES6.types b/tests/baselines/reference/emitDefaultParametersFunctionES6.types index 1c67032264f..e3124c75333 100644 --- a/tests/baselines/reference/emitDefaultParametersFunctionES6.types +++ b/tests/baselines/reference/emitDefaultParametersFunctionES6.types @@ -3,19 +3,23 @@ function foo(x: string, y = 10) { } >foo : (x: string, y?: number) => void >x : string >y : number +>10 : number function baz(x: string, y = 5, ...rest) { } >baz : (x: string, y?: number, ...rest: any[]) => void >x : string >y : number +>5 : number >rest : any[] function bar(y = 10) { } >bar : (y?: number) => void >y : number +>10 : number function bar1(y = 10, ...rest) { } >bar1 : (y?: number, ...rest: any[]) => void >y : number +>10 : number >rest : any[] diff --git a/tests/baselines/reference/emitDefaultParametersFunctionExpression.symbols b/tests/baselines/reference/emitDefaultParametersFunctionExpression.symbols new file mode 100644 index 00000000000..59c9c220787 --- /dev/null +++ b/tests/baselines/reference/emitDefaultParametersFunctionExpression.symbols @@ -0,0 +1,38 @@ +=== tests/cases/conformance/es6/defaultParameters/emitDefaultParametersFunctionExpression.ts === +var lambda1 = (y = "hello") => { } +>lambda1 : Symbol(lambda1, Decl(emitDefaultParametersFunctionExpression.ts, 0, 3)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionExpression.ts, 0, 15)) + +var lambda2 = (x: number, y = "hello") => { } +>lambda2 : Symbol(lambda2, Decl(emitDefaultParametersFunctionExpression.ts, 1, 3)) +>x : Symbol(x, Decl(emitDefaultParametersFunctionExpression.ts, 1, 15)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionExpression.ts, 1, 25)) + +var lambda3 = (x: number, y = "hello", ...rest) => { } +>lambda3 : Symbol(lambda3, Decl(emitDefaultParametersFunctionExpression.ts, 2, 3)) +>x : Symbol(x, Decl(emitDefaultParametersFunctionExpression.ts, 2, 15)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionExpression.ts, 2, 25)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionExpression.ts, 2, 38)) + +var lambda4 = (y = "hello", ...rest) => { } +>lambda4 : Symbol(lambda4, Decl(emitDefaultParametersFunctionExpression.ts, 3, 3)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionExpression.ts, 3, 15)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionExpression.ts, 3, 27)) + +var x = function (str = "hello", ...rest) { } +>x : Symbol(x, Decl(emitDefaultParametersFunctionExpression.ts, 5, 3)) +>str : Symbol(str, Decl(emitDefaultParametersFunctionExpression.ts, 5, 18)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionExpression.ts, 5, 32)) + +var y = (function (num = 10, boo = false, ...rest) { })() +>y : Symbol(y, Decl(emitDefaultParametersFunctionExpression.ts, 6, 3)) +>num : Symbol(num, Decl(emitDefaultParametersFunctionExpression.ts, 6, 19)) +>boo : Symbol(boo, Decl(emitDefaultParametersFunctionExpression.ts, 6, 28)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionExpression.ts, 6, 41)) + +var z = (function (num: number, boo = false, ...rest) { })(10) +>z : Symbol(z, Decl(emitDefaultParametersFunctionExpression.ts, 7, 3)) +>num : Symbol(num, Decl(emitDefaultParametersFunctionExpression.ts, 7, 19)) +>boo : Symbol(boo, Decl(emitDefaultParametersFunctionExpression.ts, 7, 31)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionExpression.ts, 7, 44)) + diff --git a/tests/baselines/reference/emitDefaultParametersFunctionExpression.types b/tests/baselines/reference/emitDefaultParametersFunctionExpression.types index 5c223ff1344..61ba3200e36 100644 --- a/tests/baselines/reference/emitDefaultParametersFunctionExpression.types +++ b/tests/baselines/reference/emitDefaultParametersFunctionExpression.types @@ -3,30 +3,35 @@ var lambda1 = (y = "hello") => { } >lambda1 : (y?: string) => void >(y = "hello") => { } : (y?: string) => void >y : string +>"hello" : string var lambda2 = (x: number, y = "hello") => { } >lambda2 : (x: number, y?: string) => void >(x: number, y = "hello") => { } : (x: number, y?: string) => void >x : number >y : string +>"hello" : string var lambda3 = (x: number, y = "hello", ...rest) => { } >lambda3 : (x: number, y?: string, ...rest: any[]) => void >(x: number, y = "hello", ...rest) => { } : (x: number, y?: string, ...rest: any[]) => void >x : number >y : string +>"hello" : string >rest : any[] var lambda4 = (y = "hello", ...rest) => { } >lambda4 : (y?: string, ...rest: any[]) => void >(y = "hello", ...rest) => { } : (y?: string, ...rest: any[]) => void >y : string +>"hello" : string >rest : any[] var x = function (str = "hello", ...rest) { } >x : (str?: string, ...rest: any[]) => void >function (str = "hello", ...rest) { } : (str?: string, ...rest: any[]) => void >str : string +>"hello" : string >rest : any[] var y = (function (num = 10, boo = false, ...rest) { })() @@ -35,7 +40,9 @@ var y = (function (num = 10, boo = false, ...rest) { })() >(function (num = 10, boo = false, ...rest) { }) : (num?: number, boo?: boolean, ...rest: any[]) => void >function (num = 10, boo = false, ...rest) { } : (num?: number, boo?: boolean, ...rest: any[]) => void >num : number +>10 : number >boo : boolean +>false : boolean >rest : any[] var z = (function (num: number, boo = false, ...rest) { })(10) @@ -45,5 +52,7 @@ var z = (function (num: number, boo = false, ...rest) { })(10) >function (num: number, boo = false, ...rest) { } : (num: number, boo?: boolean, ...rest: any[]) => void >num : number >boo : boolean +>false : boolean >rest : any[] +>10 : number diff --git a/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.symbols b/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.symbols new file mode 100644 index 00000000000..36eef9b9a1d --- /dev/null +++ b/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.symbols @@ -0,0 +1,38 @@ +=== tests/cases/conformance/es6/defaultParameters/emitDefaultParametersFunctionExpressionES6.ts === +var lambda1 = (y = "hello") => { } +>lambda1 : Symbol(lambda1, Decl(emitDefaultParametersFunctionExpressionES6.ts, 0, 3)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionExpressionES6.ts, 0, 15)) + +var lambda2 = (x: number, y = "hello") => { } +>lambda2 : Symbol(lambda2, Decl(emitDefaultParametersFunctionExpressionES6.ts, 1, 3)) +>x : Symbol(x, Decl(emitDefaultParametersFunctionExpressionES6.ts, 1, 15)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionExpressionES6.ts, 1, 25)) + +var lambda3 = (x: number, y = "hello", ...rest) => { } +>lambda3 : Symbol(lambda3, Decl(emitDefaultParametersFunctionExpressionES6.ts, 2, 3)) +>x : Symbol(x, Decl(emitDefaultParametersFunctionExpressionES6.ts, 2, 15)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionExpressionES6.ts, 2, 25)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionExpressionES6.ts, 2, 38)) + +var lambda4 = (y = "hello", ...rest) => { } +>lambda4 : Symbol(lambda4, Decl(emitDefaultParametersFunctionExpressionES6.ts, 3, 3)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionExpressionES6.ts, 3, 15)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionExpressionES6.ts, 3, 27)) + +var x = function (str = "hello", ...rest) { } +>x : Symbol(x, Decl(emitDefaultParametersFunctionExpressionES6.ts, 5, 3)) +>str : Symbol(str, Decl(emitDefaultParametersFunctionExpressionES6.ts, 5, 18)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionExpressionES6.ts, 5, 32)) + +var y = (function (num = 10, boo = false, ...rest) { })() +>y : Symbol(y, Decl(emitDefaultParametersFunctionExpressionES6.ts, 6, 3)) +>num : Symbol(num, Decl(emitDefaultParametersFunctionExpressionES6.ts, 6, 19)) +>boo : Symbol(boo, Decl(emitDefaultParametersFunctionExpressionES6.ts, 6, 28)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionExpressionES6.ts, 6, 41)) + +var z = (function (num: number, boo = false, ...rest) { })(10) +>z : Symbol(z, Decl(emitDefaultParametersFunctionExpressionES6.ts, 7, 3)) +>num : Symbol(num, Decl(emitDefaultParametersFunctionExpressionES6.ts, 7, 19)) +>boo : Symbol(boo, Decl(emitDefaultParametersFunctionExpressionES6.ts, 7, 31)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionExpressionES6.ts, 7, 44)) + diff --git a/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.types b/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.types index 9b8805dfa2b..76f2c863a26 100644 --- a/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.types +++ b/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.types @@ -3,30 +3,35 @@ var lambda1 = (y = "hello") => { } >lambda1 : (y?: string) => void >(y = "hello") => { } : (y?: string) => void >y : string +>"hello" : string var lambda2 = (x: number, y = "hello") => { } >lambda2 : (x: number, y?: string) => void >(x: number, y = "hello") => { } : (x: number, y?: string) => void >x : number >y : string +>"hello" : string var lambda3 = (x: number, y = "hello", ...rest) => { } >lambda3 : (x: number, y?: string, ...rest: any[]) => void >(x: number, y = "hello", ...rest) => { } : (x: number, y?: string, ...rest: any[]) => void >x : number >y : string +>"hello" : string >rest : any[] var lambda4 = (y = "hello", ...rest) => { } >lambda4 : (y?: string, ...rest: any[]) => void >(y = "hello", ...rest) => { } : (y?: string, ...rest: any[]) => void >y : string +>"hello" : string >rest : any[] var x = function (str = "hello", ...rest) { } >x : (str?: string, ...rest: any[]) => void >function (str = "hello", ...rest) { } : (str?: string, ...rest: any[]) => void >str : string +>"hello" : string >rest : any[] var y = (function (num = 10, boo = false, ...rest) { })() @@ -35,7 +40,9 @@ var y = (function (num = 10, boo = false, ...rest) { })() >(function (num = 10, boo = false, ...rest) { }) : (num?: number, boo?: boolean, ...rest: any[]) => void >function (num = 10, boo = false, ...rest) { } : (num?: number, boo?: boolean, ...rest: any[]) => void >num : number +>10 : number >boo : boolean +>false : boolean >rest : any[] var z = (function (num: number, boo = false, ...rest) { })(10) @@ -45,5 +52,7 @@ var z = (function (num: number, boo = false, ...rest) { })(10) >function (num: number, boo = false, ...rest) { } : (num: number, boo?: boolean, ...rest: any[]) => void >num : number >boo : boolean +>false : boolean >rest : any[] +>10 : number diff --git a/tests/baselines/reference/emitDefaultParametersFunctionProperty.symbols b/tests/baselines/reference/emitDefaultParametersFunctionProperty.symbols new file mode 100644 index 00000000000..f377e8bd696 --- /dev/null +++ b/tests/baselines/reference/emitDefaultParametersFunctionProperty.symbols @@ -0,0 +1,27 @@ +=== tests/cases/conformance/es6/defaultParameters/emitDefaultParametersFunctionProperty.ts === +var obj2 = { +>obj2 : Symbol(obj2, Decl(emitDefaultParametersFunctionProperty.ts, 0, 3)) + + func1(y = 10, ...rest) { }, +>func1 : Symbol(func1, Decl(emitDefaultParametersFunctionProperty.ts, 0, 12)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionProperty.ts, 1, 10)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionProperty.ts, 1, 17)) + + func2(x = "hello") { }, +>func2 : Symbol(func2, Decl(emitDefaultParametersFunctionProperty.ts, 1, 31)) +>x : Symbol(x, Decl(emitDefaultParametersFunctionProperty.ts, 2, 10)) + + func3(x: string, z: number, y = "hello") { }, +>func3 : Symbol(func3, Decl(emitDefaultParametersFunctionProperty.ts, 2, 27)) +>x : Symbol(x, Decl(emitDefaultParametersFunctionProperty.ts, 3, 10)) +>z : Symbol(z, Decl(emitDefaultParametersFunctionProperty.ts, 3, 20)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionProperty.ts, 3, 31)) + + func4(x: string, z: number, y = "hello", ...rest) { }, +>func4 : Symbol(func4, Decl(emitDefaultParametersFunctionProperty.ts, 3, 49)) +>x : Symbol(x, Decl(emitDefaultParametersFunctionProperty.ts, 4, 10)) +>z : Symbol(z, Decl(emitDefaultParametersFunctionProperty.ts, 4, 20)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionProperty.ts, 4, 31)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionProperty.ts, 4, 44)) +} + diff --git a/tests/baselines/reference/emitDefaultParametersFunctionProperty.types b/tests/baselines/reference/emitDefaultParametersFunctionProperty.types index 7c1ea6a5da3..8a703fd114f 100644 --- a/tests/baselines/reference/emitDefaultParametersFunctionProperty.types +++ b/tests/baselines/reference/emitDefaultParametersFunctionProperty.types @@ -6,23 +6,27 @@ var obj2 = { func1(y = 10, ...rest) { }, >func1 : (y?: number, ...rest: any[]) => void >y : number +>10 : number >rest : any[] func2(x = "hello") { }, >func2 : (x?: string) => void >x : string +>"hello" : string func3(x: string, z: number, y = "hello") { }, >func3 : (x: string, z: number, y?: string) => void >x : string >z : number >y : string +>"hello" : string func4(x: string, z: number, y = "hello", ...rest) { }, >func4 : (x: string, z: number, y?: string, ...rest: any[]) => void >x : string >z : number >y : string +>"hello" : string >rest : any[] } diff --git a/tests/baselines/reference/emitDefaultParametersFunctionPropertyES6.symbols b/tests/baselines/reference/emitDefaultParametersFunctionPropertyES6.symbols new file mode 100644 index 00000000000..88bad28bbf8 --- /dev/null +++ b/tests/baselines/reference/emitDefaultParametersFunctionPropertyES6.symbols @@ -0,0 +1,26 @@ +=== tests/cases/conformance/es6/defaultParameters/emitDefaultParametersFunctionPropertyES6.ts === +var obj2 = { +>obj2 : Symbol(obj2, Decl(emitDefaultParametersFunctionPropertyES6.ts, 0, 3)) + + func1(y = 10, ...rest) { }, +>func1 : Symbol(func1, Decl(emitDefaultParametersFunctionPropertyES6.ts, 0, 12)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionPropertyES6.ts, 1, 10)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionPropertyES6.ts, 1, 17)) + + func2(x = "hello") { }, +>func2 : Symbol(func2, Decl(emitDefaultParametersFunctionPropertyES6.ts, 1, 31)) +>x : Symbol(x, Decl(emitDefaultParametersFunctionPropertyES6.ts, 2, 10)) + + func3(x: string, z: number, y = "hello") { }, +>func3 : Symbol(func3, Decl(emitDefaultParametersFunctionPropertyES6.ts, 2, 27)) +>x : Symbol(x, Decl(emitDefaultParametersFunctionPropertyES6.ts, 3, 10)) +>z : Symbol(z, Decl(emitDefaultParametersFunctionPropertyES6.ts, 3, 20)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionPropertyES6.ts, 3, 31)) + + func4(x: string, z: number, y = "hello", ...rest) { }, +>func4 : Symbol(func4, Decl(emitDefaultParametersFunctionPropertyES6.ts, 3, 49)) +>x : Symbol(x, Decl(emitDefaultParametersFunctionPropertyES6.ts, 4, 10)) +>z : Symbol(z, Decl(emitDefaultParametersFunctionPropertyES6.ts, 4, 20)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionPropertyES6.ts, 4, 31)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionPropertyES6.ts, 4, 44)) +} diff --git a/tests/baselines/reference/emitDefaultParametersFunctionPropertyES6.types b/tests/baselines/reference/emitDefaultParametersFunctionPropertyES6.types index ed80158ffd1..1edd505c0b5 100644 --- a/tests/baselines/reference/emitDefaultParametersFunctionPropertyES6.types +++ b/tests/baselines/reference/emitDefaultParametersFunctionPropertyES6.types @@ -6,22 +6,26 @@ var obj2 = { func1(y = 10, ...rest) { }, >func1 : (y?: number, ...rest: any[]) => void >y : number +>10 : number >rest : any[] func2(x = "hello") { }, >func2 : (x?: string) => void >x : string +>"hello" : string func3(x: string, z: number, y = "hello") { }, >func3 : (x: string, z: number, y?: string) => void >x : string >z : number >y : string +>"hello" : string func4(x: string, z: number, y = "hello", ...rest) { }, >func4 : (x: string, z: number, y?: string, ...rest: any[]) => void >x : string >z : number >y : string +>"hello" : string >rest : any[] } diff --git a/tests/baselines/reference/emitDefaultParametersMethod.symbols b/tests/baselines/reference/emitDefaultParametersMethod.symbols new file mode 100644 index 00000000000..866380e2dd5 --- /dev/null +++ b/tests/baselines/reference/emitDefaultParametersMethod.symbols @@ -0,0 +1,46 @@ +=== tests/cases/conformance/es6/defaultParameters/emitDefaultParametersMethod.ts === +class C { +>C : Symbol(C, Decl(emitDefaultParametersMethod.ts, 0, 0)) + + constructor(t: boolean, z: string, x: number, y = "hello") { } +>t : Symbol(t, Decl(emitDefaultParametersMethod.ts, 1, 16)) +>z : Symbol(z, Decl(emitDefaultParametersMethod.ts, 1, 27)) +>x : Symbol(x, Decl(emitDefaultParametersMethod.ts, 1, 38)) +>y : Symbol(y, Decl(emitDefaultParametersMethod.ts, 1, 49)) + + public foo(x: string, t = false) { } +>foo : Symbol(foo, Decl(emitDefaultParametersMethod.ts, 1, 66)) +>x : Symbol(x, Decl(emitDefaultParametersMethod.ts, 3, 15)) +>t : Symbol(t, Decl(emitDefaultParametersMethod.ts, 3, 25)) + + public foo1(x: string, t = false, ...rest) { } +>foo1 : Symbol(foo1, Decl(emitDefaultParametersMethod.ts, 3, 40)) +>x : Symbol(x, Decl(emitDefaultParametersMethod.ts, 4, 16)) +>t : Symbol(t, Decl(emitDefaultParametersMethod.ts, 4, 26)) +>rest : Symbol(rest, Decl(emitDefaultParametersMethod.ts, 4, 37)) + + public bar(t = false) { } +>bar : Symbol(bar, Decl(emitDefaultParametersMethod.ts, 4, 50)) +>t : Symbol(t, Decl(emitDefaultParametersMethod.ts, 5, 15)) + + public boo(t = false, ...rest) { } +>boo : Symbol(boo, Decl(emitDefaultParametersMethod.ts, 5, 29)) +>t : Symbol(t, Decl(emitDefaultParametersMethod.ts, 6, 15)) +>rest : Symbol(rest, Decl(emitDefaultParametersMethod.ts, 6, 25)) +} + +class D { +>D : Symbol(D, Decl(emitDefaultParametersMethod.ts, 7, 1)) + + constructor(y = "hello") { } +>y : Symbol(y, Decl(emitDefaultParametersMethod.ts, 10, 16)) +} + +class E { +>E : Symbol(E, Decl(emitDefaultParametersMethod.ts, 11, 1)) + + constructor(y = "hello", ...rest) { } +>y : Symbol(y, Decl(emitDefaultParametersMethod.ts, 14, 16)) +>rest : Symbol(rest, Decl(emitDefaultParametersMethod.ts, 14, 28)) +} + diff --git a/tests/baselines/reference/emitDefaultParametersMethod.types b/tests/baselines/reference/emitDefaultParametersMethod.types index 5b2f08d4f70..ce7dd2542fa 100644 --- a/tests/baselines/reference/emitDefaultParametersMethod.types +++ b/tests/baselines/reference/emitDefaultParametersMethod.types @@ -7,25 +7,30 @@ class C { >z : string >x : number >y : string +>"hello" : string public foo(x: string, t = false) { } >foo : (x: string, t?: boolean) => void >x : string >t : boolean +>false : boolean public foo1(x: string, t = false, ...rest) { } >foo1 : (x: string, t?: boolean, ...rest: any[]) => void >x : string >t : boolean +>false : boolean >rest : any[] public bar(t = false) { } >bar : (t?: boolean) => void >t : boolean +>false : boolean public boo(t = false, ...rest) { } >boo : (t?: boolean, ...rest: any[]) => void >t : boolean +>false : boolean >rest : any[] } @@ -34,6 +39,7 @@ class D { constructor(y = "hello") { } >y : string +>"hello" : string } class E { @@ -41,6 +47,7 @@ class E { constructor(y = "hello", ...rest) { } >y : string +>"hello" : string >rest : any[] } diff --git a/tests/baselines/reference/emitDefaultParametersMethodES6.symbols b/tests/baselines/reference/emitDefaultParametersMethodES6.symbols new file mode 100644 index 00000000000..ce23b016bcf --- /dev/null +++ b/tests/baselines/reference/emitDefaultParametersMethodES6.symbols @@ -0,0 +1,45 @@ +=== tests/cases/conformance/es6/defaultParameters/emitDefaultParametersMethodES6.ts === +class C { +>C : Symbol(C, Decl(emitDefaultParametersMethodES6.ts, 0, 0)) + + constructor(t: boolean, z: string, x: number, y = "hello") { } +>t : Symbol(t, Decl(emitDefaultParametersMethodES6.ts, 1, 16)) +>z : Symbol(z, Decl(emitDefaultParametersMethodES6.ts, 1, 27)) +>x : Symbol(x, Decl(emitDefaultParametersMethodES6.ts, 1, 38)) +>y : Symbol(y, Decl(emitDefaultParametersMethodES6.ts, 1, 49)) + + public foo(x: string, t = false) { } +>foo : Symbol(foo, Decl(emitDefaultParametersMethodES6.ts, 1, 66)) +>x : Symbol(x, Decl(emitDefaultParametersMethodES6.ts, 3, 15)) +>t : Symbol(t, Decl(emitDefaultParametersMethodES6.ts, 3, 25)) + + public foo1(x: string, t = false, ...rest) { } +>foo1 : Symbol(foo1, Decl(emitDefaultParametersMethodES6.ts, 3, 40)) +>x : Symbol(x, Decl(emitDefaultParametersMethodES6.ts, 4, 16)) +>t : Symbol(t, Decl(emitDefaultParametersMethodES6.ts, 4, 26)) +>rest : Symbol(rest, Decl(emitDefaultParametersMethodES6.ts, 4, 37)) + + public bar(t = false) { } +>bar : Symbol(bar, Decl(emitDefaultParametersMethodES6.ts, 4, 50)) +>t : Symbol(t, Decl(emitDefaultParametersMethodES6.ts, 5, 15)) + + public boo(t = false, ...rest) { } +>boo : Symbol(boo, Decl(emitDefaultParametersMethodES6.ts, 5, 29)) +>t : Symbol(t, Decl(emitDefaultParametersMethodES6.ts, 6, 15)) +>rest : Symbol(rest, Decl(emitDefaultParametersMethodES6.ts, 6, 25)) +} + +class D { +>D : Symbol(D, Decl(emitDefaultParametersMethodES6.ts, 7, 1)) + + constructor(y = "hello") { } +>y : Symbol(y, Decl(emitDefaultParametersMethodES6.ts, 10, 16)) +} + +class E { +>E : Symbol(E, Decl(emitDefaultParametersMethodES6.ts, 11, 1)) + + constructor(y = "hello", ...rest) { } +>y : Symbol(y, Decl(emitDefaultParametersMethodES6.ts, 14, 16)) +>rest : Symbol(rest, Decl(emitDefaultParametersMethodES6.ts, 14, 28)) +} diff --git a/tests/baselines/reference/emitDefaultParametersMethodES6.types b/tests/baselines/reference/emitDefaultParametersMethodES6.types index 54312714b1d..09096d153bf 100644 --- a/tests/baselines/reference/emitDefaultParametersMethodES6.types +++ b/tests/baselines/reference/emitDefaultParametersMethodES6.types @@ -7,25 +7,30 @@ class C { >z : string >x : number >y : string +>"hello" : string public foo(x: string, t = false) { } >foo : (x: string, t?: boolean) => void >x : string >t : boolean +>false : boolean public foo1(x: string, t = false, ...rest) { } >foo1 : (x: string, t?: boolean, ...rest: any[]) => void >x : string >t : boolean +>false : boolean >rest : any[] public bar(t = false) { } >bar : (t?: boolean) => void >t : boolean +>false : boolean public boo(t = false, ...rest) { } >boo : (t?: boolean, ...rest: any[]) => void >t : boolean +>false : boolean >rest : any[] } @@ -34,6 +39,7 @@ class D { constructor(y = "hello") { } >y : string +>"hello" : string } class E { @@ -41,5 +47,6 @@ class E { constructor(y = "hello", ...rest) { } >y : string +>"hello" : string >rest : any[] } diff --git a/tests/baselines/reference/emitMemberAccessExpression.symbols b/tests/baselines/reference/emitMemberAccessExpression.symbols new file mode 100644 index 00000000000..64302521706 --- /dev/null +++ b/tests/baselines/reference/emitMemberAccessExpression.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/emitMemberAccessExpression_file3.ts === +/// +/// +declare var OData: any; +>OData : Symbol(OData, Decl(emitMemberAccessExpression_file3.ts, 2, 11)) + +module Microsoft.PeopleAtWork.Model { +>Microsoft : Symbol(Microsoft, Decl(emitMemberAccessExpression_file2.ts, 1, 13), Decl(emitMemberAccessExpression_file3.ts, 2, 23)) +>PeopleAtWork : Symbol(PeopleAtWork, Decl(emitMemberAccessExpression_file2.ts, 2, 17), Decl(emitMemberAccessExpression_file3.ts, 3, 17)) +>Model : Symbol(Model, Decl(emitMemberAccessExpression_file2.ts, 2, 30), Decl(emitMemberAccessExpression_file3.ts, 3, 30)) + + export class KnockoutExtentions { +>KnockoutExtentions : Symbol(KnockoutExtentions, Decl(emitMemberAccessExpression_file3.ts, 3, 37)) + } +} +=== tests/cases/compiler/emitMemberAccessExpression_file1.ts === +/// +No type information for this code."use strict"; +No type information for this code. +No type information for this code.=== tests/cases/compiler/emitMemberAccessExpression_file2.ts === +/// +"use strict"; +module Microsoft.PeopleAtWork.Model { +>Microsoft : Symbol(Microsoft, Decl(emitMemberAccessExpression_file2.ts, 1, 13), Decl(emitMemberAccessExpression_file3.ts, 2, 23)) +>PeopleAtWork : Symbol(PeopleAtWork, Decl(emitMemberAccessExpression_file2.ts, 2, 17), Decl(emitMemberAccessExpression_file3.ts, 3, 17)) +>Model : Symbol(Model, Decl(emitMemberAccessExpression_file2.ts, 2, 30), Decl(emitMemberAccessExpression_file3.ts, 3, 30)) + + export class _Person { +>_Person : Symbol(_Person, Decl(emitMemberAccessExpression_file2.ts, 2, 37)) + + public populate(raw: any) { +>populate : Symbol(populate, Decl(emitMemberAccessExpression_file2.ts, 3, 26)) +>raw : Symbol(raw, Decl(emitMemberAccessExpression_file2.ts, 4, 24)) + + var res = Model.KnockoutExtentions; +>res : Symbol(res, Decl(emitMemberAccessExpression_file2.ts, 5, 15)) +>Model.KnockoutExtentions : Symbol(KnockoutExtentions, Decl(emitMemberAccessExpression_file3.ts, 3, 37)) +>Model : Symbol(Model, Decl(emitMemberAccessExpression_file2.ts, 2, 30), Decl(emitMemberAccessExpression_file3.ts, 3, 30)) +>KnockoutExtentions : Symbol(KnockoutExtentions, Decl(emitMemberAccessExpression_file3.ts, 3, 37)) + } + } +} + diff --git a/tests/baselines/reference/emitMemberAccessExpression.types b/tests/baselines/reference/emitMemberAccessExpression.types index 9f7c98332e9..7a32e452aec 100644 --- a/tests/baselines/reference/emitMemberAccessExpression.types +++ b/tests/baselines/reference/emitMemberAccessExpression.types @@ -15,11 +15,14 @@ module Microsoft.PeopleAtWork.Model { } === tests/cases/compiler/emitMemberAccessExpression_file1.ts === /// -No type information for this code."use strict"; -No type information for this code. -No type information for this code.=== tests/cases/compiler/emitMemberAccessExpression_file2.ts === +"use strict"; +>"use strict" : string + +=== tests/cases/compiler/emitMemberAccessExpression_file2.ts === /// "use strict"; +>"use strict" : string + module Microsoft.PeopleAtWork.Model { >Microsoft : typeof Microsoft >PeopleAtWork : typeof PeopleAtWork diff --git a/tests/baselines/reference/emitPostComments.symbols b/tests/baselines/reference/emitPostComments.symbols new file mode 100644 index 00000000000..296d8081058 --- /dev/null +++ b/tests/baselines/reference/emitPostComments.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/emitPostComments.ts === + +var y = 10; +>y : Symbol(y, Decl(emitPostComments.ts, 1, 3)) + +/** +* @name Foo +* @class +*/ +/**#@+ +* @memberOf Foo# +* @field +*/ +/** +* @name bar +* @type Object[] +*/ +/**#@-*/ +/** +* @name Foo2 +* @class +*/ +/**#@+ +* @memberOf Foo2# +* @field +*/ +/** +* @name bar +* @type Object[] +*/ +/**#@-*/ + diff --git a/tests/baselines/reference/emitPostComments.types b/tests/baselines/reference/emitPostComments.types index 4173e584031..5b5a05931d4 100644 --- a/tests/baselines/reference/emitPostComments.types +++ b/tests/baselines/reference/emitPostComments.types @@ -2,6 +2,7 @@ var y = 10; >y : number +>10 : number /** * @name Foo diff --git a/tests/baselines/reference/emitPreComments.symbols b/tests/baselines/reference/emitPreComments.symbols new file mode 100644 index 00000000000..c90547bb6b8 --- /dev/null +++ b/tests/baselines/reference/emitPreComments.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/emitPreComments.ts === + +// This is pre comment +var y = 10; +>y : Symbol(y, Decl(emitPreComments.ts, 2, 3)) + +/** +* @name Foo +* @class +*/ +/**#@+ +* @memberOf Foo# +* @field +*/ +/** +* @name bar +* @type Object[] +*/ +/**#@-*/ +/** +* @name Foo2 +* @class +*/ +/**#@+ +* @memberOf Foo2# +* @field +*/ +/** +* @name bar +* @type Object[] +*/ +/**#@-*/ + diff --git a/tests/baselines/reference/emitPreComments.types b/tests/baselines/reference/emitPreComments.types index 6ab0c7b1bf9..c0378350de3 100644 --- a/tests/baselines/reference/emitPreComments.types +++ b/tests/baselines/reference/emitPreComments.types @@ -3,6 +3,7 @@ // This is pre comment var y = 10; >y : number +>10 : number /** * @name Foo diff --git a/tests/baselines/reference/emitRestParametersFunction.symbols b/tests/baselines/reference/emitRestParametersFunction.symbols new file mode 100644 index 00000000000..c9f9587d805 --- /dev/null +++ b/tests/baselines/reference/emitRestParametersFunction.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/es6/restParameters/emitRestParametersFunction.ts === +function bar(...rest) { } +>bar : Symbol(bar, Decl(emitRestParametersFunction.ts, 0, 0)) +>rest : Symbol(rest, Decl(emitRestParametersFunction.ts, 0, 13)) + +function foo(x: number, y: string, ...rest) { } +>foo : Symbol(foo, Decl(emitRestParametersFunction.ts, 0, 25)) +>x : Symbol(x, Decl(emitRestParametersFunction.ts, 1, 13)) +>y : Symbol(y, Decl(emitRestParametersFunction.ts, 1, 23)) +>rest : Symbol(rest, Decl(emitRestParametersFunction.ts, 1, 34)) + diff --git a/tests/baselines/reference/emitRestParametersFunctionES6.symbols b/tests/baselines/reference/emitRestParametersFunctionES6.symbols new file mode 100644 index 00000000000..efe743eb316 --- /dev/null +++ b/tests/baselines/reference/emitRestParametersFunctionES6.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/es6/restParameters/emitRestParametersFunctionES6.ts === +function bar(...rest) { } +>bar : Symbol(bar, Decl(emitRestParametersFunctionES6.ts, 0, 0)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionES6.ts, 0, 13)) + +function foo(x: number, y: string, ...rest) { } +>foo : Symbol(foo, Decl(emitRestParametersFunctionES6.ts, 0, 25)) +>x : Symbol(x, Decl(emitRestParametersFunctionES6.ts, 1, 13)) +>y : Symbol(y, Decl(emitRestParametersFunctionES6.ts, 1, 23)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionES6.ts, 1, 34)) + diff --git a/tests/baselines/reference/emitRestParametersFunctionExpression.symbols b/tests/baselines/reference/emitRestParametersFunctionExpression.symbols new file mode 100644 index 00000000000..8a42e7b5296 --- /dev/null +++ b/tests/baselines/reference/emitRestParametersFunctionExpression.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/restParameters/emitRestParametersFunctionExpression.ts === +var funcExp = (...rest) => { } +>funcExp : Symbol(funcExp, Decl(emitRestParametersFunctionExpression.ts, 0, 3)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionExpression.ts, 0, 15)) + +var funcExp1 = (X: number, ...rest) => { } +>funcExp1 : Symbol(funcExp1, Decl(emitRestParametersFunctionExpression.ts, 1, 3)) +>X : Symbol(X, Decl(emitRestParametersFunctionExpression.ts, 1, 16)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionExpression.ts, 1, 26)) + +var funcExp2 = function (...rest) { } +>funcExp2 : Symbol(funcExp2, Decl(emitRestParametersFunctionExpression.ts, 2, 3)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionExpression.ts, 2, 25)) + +var funcExp3 = (function (...rest) { })() +>funcExp3 : Symbol(funcExp3, Decl(emitRestParametersFunctionExpression.ts, 3, 3)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionExpression.ts, 3, 26)) + diff --git a/tests/baselines/reference/emitRestParametersFunctionExpressionES6.symbols b/tests/baselines/reference/emitRestParametersFunctionExpressionES6.symbols new file mode 100644 index 00000000000..cf39ed21a88 --- /dev/null +++ b/tests/baselines/reference/emitRestParametersFunctionExpressionES6.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/restParameters/emitRestParametersFunctionExpressionES6.ts === +var funcExp = (...rest) => { } +>funcExp : Symbol(funcExp, Decl(emitRestParametersFunctionExpressionES6.ts, 0, 3)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionExpressionES6.ts, 0, 15)) + +var funcExp1 = (X: number, ...rest) => { } +>funcExp1 : Symbol(funcExp1, Decl(emitRestParametersFunctionExpressionES6.ts, 1, 3)) +>X : Symbol(X, Decl(emitRestParametersFunctionExpressionES6.ts, 1, 16)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionExpressionES6.ts, 1, 26)) + +var funcExp2 = function (...rest) { } +>funcExp2 : Symbol(funcExp2, Decl(emitRestParametersFunctionExpressionES6.ts, 2, 3)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionExpressionES6.ts, 2, 25)) + +var funcExp3 = (function (...rest) { })() +>funcExp3 : Symbol(funcExp3, Decl(emitRestParametersFunctionExpressionES6.ts, 3, 3)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionExpressionES6.ts, 3, 26)) + diff --git a/tests/baselines/reference/emitRestParametersFunctionProperty.symbols b/tests/baselines/reference/emitRestParametersFunctionProperty.symbols new file mode 100644 index 00000000000..2a0505831b9 --- /dev/null +++ b/tests/baselines/reference/emitRestParametersFunctionProperty.symbols @@ -0,0 +1,16 @@ +=== tests/cases/conformance/es6/restParameters/emitRestParametersFunctionProperty.ts === +var obj: { +>obj : Symbol(obj, Decl(emitRestParametersFunctionProperty.ts, 0, 3)) + + func1: (...rest) => void +>func1 : Symbol(func1, Decl(emitRestParametersFunctionProperty.ts, 0, 10)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionProperty.ts, 1, 12)) +} + +var obj2 = { +>obj2 : Symbol(obj2, Decl(emitRestParametersFunctionProperty.ts, 4, 3)) + + func(...rest) { } +>func : Symbol(func, Decl(emitRestParametersFunctionProperty.ts, 4, 12)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionProperty.ts, 5, 9)) +} diff --git a/tests/baselines/reference/emitRestParametersFunctionPropertyES6.symbols b/tests/baselines/reference/emitRestParametersFunctionPropertyES6.symbols new file mode 100644 index 00000000000..a6b00757eec --- /dev/null +++ b/tests/baselines/reference/emitRestParametersFunctionPropertyES6.symbols @@ -0,0 +1,16 @@ +=== tests/cases/conformance/es6/restParameters/emitRestParametersFunctionPropertyES6.ts === +var obj: { +>obj : Symbol(obj, Decl(emitRestParametersFunctionPropertyES6.ts, 0, 3)) + + func1: (...rest) => void +>func1 : Symbol(func1, Decl(emitRestParametersFunctionPropertyES6.ts, 0, 10)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionPropertyES6.ts, 1, 12)) +} + +var obj2 = { +>obj2 : Symbol(obj2, Decl(emitRestParametersFunctionPropertyES6.ts, 4, 3)) + + func(...rest) { } +>func : Symbol(func, Decl(emitRestParametersFunctionPropertyES6.ts, 4, 12)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionPropertyES6.ts, 5, 9)) +} diff --git a/tests/baselines/reference/emitRestParametersMethod.symbols b/tests/baselines/reference/emitRestParametersMethod.symbols new file mode 100644 index 00000000000..2bfbda925bf --- /dev/null +++ b/tests/baselines/reference/emitRestParametersMethod.symbols @@ -0,0 +1,33 @@ +=== tests/cases/conformance/es6/restParameters/emitRestParametersMethod.ts === +class C { +>C : Symbol(C, Decl(emitRestParametersMethod.ts, 0, 0)) + + constructor(name: string, ...rest) { } +>name : Symbol(name, Decl(emitRestParametersMethod.ts, 1, 16)) +>rest : Symbol(rest, Decl(emitRestParametersMethod.ts, 1, 29)) + + public bar(...rest) { } +>bar : Symbol(bar, Decl(emitRestParametersMethod.ts, 1, 42)) +>rest : Symbol(rest, Decl(emitRestParametersMethod.ts, 3, 15)) + + public foo(x: number, ...rest) { } +>foo : Symbol(foo, Decl(emitRestParametersMethod.ts, 3, 27)) +>x : Symbol(x, Decl(emitRestParametersMethod.ts, 4, 15)) +>rest : Symbol(rest, Decl(emitRestParametersMethod.ts, 4, 25)) +} + +class D { +>D : Symbol(D, Decl(emitRestParametersMethod.ts, 5, 1)) + + constructor(...rest) { } +>rest : Symbol(rest, Decl(emitRestParametersMethod.ts, 8, 16)) + + public bar(...rest) { } +>bar : Symbol(bar, Decl(emitRestParametersMethod.ts, 8, 28)) +>rest : Symbol(rest, Decl(emitRestParametersMethod.ts, 10, 15)) + + public foo(x: number, ...rest) { } +>foo : Symbol(foo, Decl(emitRestParametersMethod.ts, 10, 27)) +>x : Symbol(x, Decl(emitRestParametersMethod.ts, 11, 15)) +>rest : Symbol(rest, Decl(emitRestParametersMethod.ts, 11, 25)) +} diff --git a/tests/baselines/reference/emitRestParametersMethodES6.symbols b/tests/baselines/reference/emitRestParametersMethodES6.symbols new file mode 100644 index 00000000000..e79ab9bb26e --- /dev/null +++ b/tests/baselines/reference/emitRestParametersMethodES6.symbols @@ -0,0 +1,34 @@ +=== tests/cases/conformance/es6/restParameters/emitRestParametersMethodES6.ts === +class C { +>C : Symbol(C, Decl(emitRestParametersMethodES6.ts, 0, 0)) + + constructor(name: string, ...rest) { } +>name : Symbol(name, Decl(emitRestParametersMethodES6.ts, 1, 16)) +>rest : Symbol(rest, Decl(emitRestParametersMethodES6.ts, 1, 29)) + + public bar(...rest) { } +>bar : Symbol(bar, Decl(emitRestParametersMethodES6.ts, 1, 42)) +>rest : Symbol(rest, Decl(emitRestParametersMethodES6.ts, 3, 15)) + + public foo(x: number, ...rest) { } +>foo : Symbol(foo, Decl(emitRestParametersMethodES6.ts, 3, 27)) +>x : Symbol(x, Decl(emitRestParametersMethodES6.ts, 4, 15)) +>rest : Symbol(rest, Decl(emitRestParametersMethodES6.ts, 4, 25)) +} + +class D { +>D : Symbol(D, Decl(emitRestParametersMethodES6.ts, 5, 1)) + + constructor(...rest) { } +>rest : Symbol(rest, Decl(emitRestParametersMethodES6.ts, 8, 16)) + + public bar(...rest) { } +>bar : Symbol(bar, Decl(emitRestParametersMethodES6.ts, 8, 28)) +>rest : Symbol(rest, Decl(emitRestParametersMethodES6.ts, 10, 15)) + + public foo(x: number, ...rest) { } +>foo : Symbol(foo, Decl(emitRestParametersMethodES6.ts, 10, 27)) +>x : Symbol(x, Decl(emitRestParametersMethodES6.ts, 11, 15)) +>rest : Symbol(rest, Decl(emitRestParametersMethodES6.ts, 11, 25)) +} + diff --git a/tests/baselines/reference/emptyEnum.symbols b/tests/baselines/reference/emptyEnum.symbols new file mode 100644 index 00000000000..c586c8879f5 --- /dev/null +++ b/tests/baselines/reference/emptyEnum.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/emptyEnum.ts === +enum E { +>E : Symbol(E, Decl(emptyEnum.ts, 0, 0)) +} diff --git a/tests/baselines/reference/emptyExpr.symbols b/tests/baselines/reference/emptyExpr.symbols new file mode 100644 index 00000000000..e699404332f --- /dev/null +++ b/tests/baselines/reference/emptyExpr.symbols @@ -0,0 +1,3 @@ +=== tests/cases/compiler/emptyExpr.ts === +[{},] +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/emptyFile-declaration.symbols b/tests/baselines/reference/emptyFile-declaration.symbols new file mode 100644 index 00000000000..496fbbb807d --- /dev/null +++ b/tests/baselines/reference/emptyFile-declaration.symbols @@ -0,0 +1,3 @@ +=== tests/cases/compiler/emptyFile-declaration.ts === + +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/emptyFile-souremap.symbols b/tests/baselines/reference/emptyFile-souremap.symbols new file mode 100644 index 00000000000..5c7f48cfb49 --- /dev/null +++ b/tests/baselines/reference/emptyFile-souremap.symbols @@ -0,0 +1,3 @@ +=== tests/cases/compiler/emptyFile-souremap.ts === + +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/emptyFile.symbols b/tests/baselines/reference/emptyFile.symbols new file mode 100644 index 00000000000..95478466b8a --- /dev/null +++ b/tests/baselines/reference/emptyFile.symbols @@ -0,0 +1,3 @@ +=== tests/cases/compiler/emptyFile.ts === + +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/emptyIndexer.symbols b/tests/baselines/reference/emptyIndexer.symbols new file mode 100644 index 00000000000..6c3bad02349 --- /dev/null +++ b/tests/baselines/reference/emptyIndexer.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/emptyIndexer.ts === +interface I1 { +>I1 : Symbol(I1, Decl(emptyIndexer.ts, 0, 0)) + + m(): number; +>m : Symbol(m, Decl(emptyIndexer.ts, 0, 14)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(emptyIndexer.ts, 2, 1)) + + [s:string]: I1; +>s : Symbol(s, Decl(emptyIndexer.ts, 5, 2)) +>I1 : Symbol(I1, Decl(emptyIndexer.ts, 0, 0)) +} + + +var x: I2; +>x : Symbol(x, Decl(emptyIndexer.ts, 9, 3)) +>I2 : Symbol(I2, Decl(emptyIndexer.ts, 2, 1)) + +var n = x[''].m(); // should not crash compiler +>n : Symbol(n, Decl(emptyIndexer.ts, 11, 3)) +>x[''].m : Symbol(I1.m, Decl(emptyIndexer.ts, 0, 14)) +>x : Symbol(x, Decl(emptyIndexer.ts, 9, 3)) +>m : Symbol(I1.m, Decl(emptyIndexer.ts, 0, 14)) + diff --git a/tests/baselines/reference/emptyIndexer.types b/tests/baselines/reference/emptyIndexer.types index 949e7370e78..5361ed4d7f4 100644 --- a/tests/baselines/reference/emptyIndexer.types +++ b/tests/baselines/reference/emptyIndexer.types @@ -25,5 +25,6 @@ var n = x[''].m(); // should not crash compiler >x[''].m : () => number >x[''] : I1 >x : I2 +>'' : string >m : () => number diff --git a/tests/baselines/reference/enumBasics.symbols b/tests/baselines/reference/enumBasics.symbols new file mode 100644 index 00000000000..32bbfc3124e --- /dev/null +++ b/tests/baselines/reference/enumBasics.symbols @@ -0,0 +1,210 @@ +=== tests/cases/conformance/enums/enumBasics.ts === +// Enum without initializers have first member = 0 and successive members = N + 1 +enum E1 { +>E1 : Symbol(E1, Decl(enumBasics.ts, 0, 0)) + + A, +>A : Symbol(E1.A, Decl(enumBasics.ts, 1, 9)) + + B, +>B : Symbol(E1.B, Decl(enumBasics.ts, 2, 6)) + + C +>C : Symbol(E1.C, Decl(enumBasics.ts, 3, 6)) +} + +// Enum type is a subtype of Number +var x: number = E1.A; +>x : Symbol(x, Decl(enumBasics.ts, 8, 3)) +>E1.A : Symbol(E1.A, Decl(enumBasics.ts, 1, 9)) +>E1 : Symbol(E1, Decl(enumBasics.ts, 0, 0)) +>A : Symbol(E1.A, Decl(enumBasics.ts, 1, 9)) + +// Enum object type is anonymous with properties of the enum type and numeric indexer +var e = E1; +>e : Symbol(e, Decl(enumBasics.ts, 11, 3), Decl(enumBasics.ts, 12, 3), Decl(enumBasics.ts, 18, 3)) +>E1 : Symbol(E1, Decl(enumBasics.ts, 0, 0)) + +var e: { +>e : Symbol(e, Decl(enumBasics.ts, 11, 3), Decl(enumBasics.ts, 12, 3), Decl(enumBasics.ts, 18, 3)) + + A: E1; +>A : Symbol(A, Decl(enumBasics.ts, 12, 8)) +>E1 : Symbol(E1, Decl(enumBasics.ts, 0, 0)) + + B: E1; +>B : Symbol(B, Decl(enumBasics.ts, 13, 10)) +>E1 : Symbol(E1, Decl(enumBasics.ts, 0, 0)) + + C: E1; +>C : Symbol(C, Decl(enumBasics.ts, 14, 10)) +>E1 : Symbol(E1, Decl(enumBasics.ts, 0, 0)) + + [n: number]: string; +>n : Symbol(n, Decl(enumBasics.ts, 16, 5)) + +}; +var e: typeof E1; +>e : Symbol(e, Decl(enumBasics.ts, 11, 3), Decl(enumBasics.ts, 12, 3), Decl(enumBasics.ts, 18, 3)) +>E1 : Symbol(E1, Decl(enumBasics.ts, 0, 0)) + +// Reverse mapping of enum returns string name of property +var s = E1[e.A]; +>s : Symbol(s, Decl(enumBasics.ts, 21, 3), Decl(enumBasics.ts, 22, 3)) +>E1 : Symbol(E1, Decl(enumBasics.ts, 0, 0)) +>e.A : Symbol(E1.A, Decl(enumBasics.ts, 1, 9)) +>e : Symbol(e, Decl(enumBasics.ts, 11, 3), Decl(enumBasics.ts, 12, 3), Decl(enumBasics.ts, 18, 3)) +>A : Symbol(E1.A, Decl(enumBasics.ts, 1, 9)) + +var s: string; +>s : Symbol(s, Decl(enumBasics.ts, 21, 3), Decl(enumBasics.ts, 22, 3)) + + +// Enum with only constant members +enum E2 { +>E2 : Symbol(E2, Decl(enumBasics.ts, 22, 14)) + + A = 1, B = 2, C = 3 +>A : Symbol(E2.A, Decl(enumBasics.ts, 26, 9)) +>B : Symbol(E2.B, Decl(enumBasics.ts, 27, 10)) +>C : Symbol(E2.C, Decl(enumBasics.ts, 27, 17)) +} + +// Enum with only computed members +enum E3 { +>E3 : Symbol(E3, Decl(enumBasics.ts, 28, 1)) + + X = 'foo'.length, Y = 4 + 3, Z = +'foo' +>X : Symbol(E3.X, Decl(enumBasics.ts, 31, 9)) +>'foo'.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>Y : Symbol(E3.Y, Decl(enumBasics.ts, 32, 21)) +>Z : Symbol(E3.Z, Decl(enumBasics.ts, 32, 32)) +} + +// Enum with constant members followed by computed members +enum E4 { +>E4 : Symbol(E4, Decl(enumBasics.ts, 33, 1)) + + X = 0, Y, Z = 'foo'.length +>X : Symbol(E4.X, Decl(enumBasics.ts, 36, 9)) +>Y : Symbol(E4.Y, Decl(enumBasics.ts, 37, 10)) +>Z : Symbol(E4.Z, Decl(enumBasics.ts, 37, 13)) +>'foo'.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +} + +// Enum with > 2 constant members with no initializer for first member, non zero initializer for second element +enum E5 { +>E5 : Symbol(E5, Decl(enumBasics.ts, 38, 1)) + + A, +>A : Symbol(E5.A, Decl(enumBasics.ts, 41, 9)) + + B = 3, +>B : Symbol(E5.B, Decl(enumBasics.ts, 42, 6)) + + C // 4 +>C : Symbol(E5.C, Decl(enumBasics.ts, 43, 10)) +} + +enum E6 { +>E6 : Symbol(E6, Decl(enumBasics.ts, 45, 1)) + + A, +>A : Symbol(E6.A, Decl(enumBasics.ts, 47, 9)) + + B = 0, +>B : Symbol(E6.B, Decl(enumBasics.ts, 48, 6)) + + C // 1 +>C : Symbol(E6.C, Decl(enumBasics.ts, 49, 10)) +} + +// Enum with computed member initializer of type 'any' +enum E7 { +>E7 : Symbol(E7, Decl(enumBasics.ts, 51, 1)) + + A = 'foo'['foo'] +>A : Symbol(E7.A, Decl(enumBasics.ts, 54, 9)) +} + +// Enum with computed member initializer of type number +enum E8 { +>E8 : Symbol(E8, Decl(enumBasics.ts, 56, 1)) + + B = 'foo'['foo'] +>B : Symbol(E8.B, Decl(enumBasics.ts, 59, 9)) +} + +//Enum with computed member intializer of same enum type +enum E9 { +>E9 : Symbol(E9, Decl(enumBasics.ts, 61, 1)) + + A, +>A : Symbol(E9.A, Decl(enumBasics.ts, 64, 9)) + + B = A +>B : Symbol(E9.B, Decl(enumBasics.ts, 65, 6)) +>A : Symbol(E9.A, Decl(enumBasics.ts, 64, 9)) +} + +// (refer to .js to validate) +// Enum constant members are propagated +var doNotPropagate = [ +>doNotPropagate : Symbol(doNotPropagate, Decl(enumBasics.ts, 71, 3)) + + E8.B, E7.A, E4.Z, E3.X, E3.Y, E3.Z +>E8.B : Symbol(E8.B, Decl(enumBasics.ts, 59, 9)) +>E8 : Symbol(E8, Decl(enumBasics.ts, 56, 1)) +>B : Symbol(E8.B, Decl(enumBasics.ts, 59, 9)) +>E7.A : Symbol(E7.A, Decl(enumBasics.ts, 54, 9)) +>E7 : Symbol(E7, Decl(enumBasics.ts, 51, 1)) +>A : Symbol(E7.A, Decl(enumBasics.ts, 54, 9)) +>E4.Z : Symbol(E4.Z, Decl(enumBasics.ts, 37, 13)) +>E4 : Symbol(E4, Decl(enumBasics.ts, 33, 1)) +>Z : Symbol(E4.Z, Decl(enumBasics.ts, 37, 13)) +>E3.X : Symbol(E3.X, Decl(enumBasics.ts, 31, 9)) +>E3 : Symbol(E3, Decl(enumBasics.ts, 28, 1)) +>X : Symbol(E3.X, Decl(enumBasics.ts, 31, 9)) +>E3.Y : Symbol(E3.Y, Decl(enumBasics.ts, 32, 21)) +>E3 : Symbol(E3, Decl(enumBasics.ts, 28, 1)) +>Y : Symbol(E3.Y, Decl(enumBasics.ts, 32, 21)) +>E3.Z : Symbol(E3.Z, Decl(enumBasics.ts, 32, 32)) +>E3 : Symbol(E3, Decl(enumBasics.ts, 28, 1)) +>Z : Symbol(E3.Z, Decl(enumBasics.ts, 32, 32)) + +]; +// Enum computed members are not propagated +var doPropagate = [ +>doPropagate : Symbol(doPropagate, Decl(enumBasics.ts, 75, 3)) + + E9.A, E9.B, E6.B, E6.C, E6.A, E5.A, E5.B, E5.C +>E9.A : Symbol(E9.A, Decl(enumBasics.ts, 64, 9)) +>E9 : Symbol(E9, Decl(enumBasics.ts, 61, 1)) +>A : Symbol(E9.A, Decl(enumBasics.ts, 64, 9)) +>E9.B : Symbol(E9.B, Decl(enumBasics.ts, 65, 6)) +>E9 : Symbol(E9, Decl(enumBasics.ts, 61, 1)) +>B : Symbol(E9.B, Decl(enumBasics.ts, 65, 6)) +>E6.B : Symbol(E6.B, Decl(enumBasics.ts, 48, 6)) +>E6 : Symbol(E6, Decl(enumBasics.ts, 45, 1)) +>B : Symbol(E6.B, Decl(enumBasics.ts, 48, 6)) +>E6.C : Symbol(E6.C, Decl(enumBasics.ts, 49, 10)) +>E6 : Symbol(E6, Decl(enumBasics.ts, 45, 1)) +>C : Symbol(E6.C, Decl(enumBasics.ts, 49, 10)) +>E6.A : Symbol(E6.A, Decl(enumBasics.ts, 47, 9)) +>E6 : Symbol(E6, Decl(enumBasics.ts, 45, 1)) +>A : Symbol(E6.A, Decl(enumBasics.ts, 47, 9)) +>E5.A : Symbol(E5.A, Decl(enumBasics.ts, 41, 9)) +>E5 : Symbol(E5, Decl(enumBasics.ts, 38, 1)) +>A : Symbol(E5.A, Decl(enumBasics.ts, 41, 9)) +>E5.B : Symbol(E5.B, Decl(enumBasics.ts, 42, 6)) +>E5 : Symbol(E5, Decl(enumBasics.ts, 38, 1)) +>B : Symbol(E5.B, Decl(enumBasics.ts, 42, 6)) +>E5.C : Symbol(E5.C, Decl(enumBasics.ts, 43, 10)) +>E5 : Symbol(E5, Decl(enumBasics.ts, 38, 1)) +>C : Symbol(E5.C, Decl(enumBasics.ts, 43, 10)) + +]; + + diff --git a/tests/baselines/reference/enumBasics.types b/tests/baselines/reference/enumBasics.types index c0d7fb9bed1..6a147f01062 100644 --- a/tests/baselines/reference/enumBasics.types +++ b/tests/baselines/reference/enumBasics.types @@ -67,8 +67,11 @@ enum E2 { A = 1, B = 2, C = 3 >A : E2 +>1 : number >B : E2 +>2 : number >C : E2 +>3 : number } // Enum with only computed members @@ -78,11 +81,15 @@ enum E3 { X = 'foo'.length, Y = 4 + 3, Z = +'foo' >X : E3 >'foo'.length : number +>'foo' : string >length : number >Y : E3 >4 + 3 : number +>4 : number +>3 : number >Z : E3 >+'foo' : number +>'foo' : string } // Enum with constant members followed by computed members @@ -91,9 +98,11 @@ enum E4 { X = 0, Y, Z = 'foo'.length >X : E4 +>0 : number >Y : E4 >Z : E4 >'foo'.length : number +>'foo' : string >length : number } @@ -106,6 +115,7 @@ enum E5 { B = 3, >B : E5 +>3 : number C // 4 >C : E5 @@ -119,6 +129,7 @@ enum E6 { B = 0, >B : E6 +>0 : number C // 1 >C : E6 @@ -131,6 +142,8 @@ enum E7 { A = 'foo'['foo'] >A : E7 >'foo'['foo'] : any +>'foo' : string +>'foo' : string } // Enum with computed member initializer of type number @@ -140,6 +153,8 @@ enum E8 { B = 'foo'['foo'] >B : E8 >'foo'['foo'] : any +>'foo' : string +>'foo' : string } //Enum with computed member intializer of same enum type diff --git a/tests/baselines/reference/enumCodeGenNewLines1.symbols b/tests/baselines/reference/enumCodeGenNewLines1.symbols new file mode 100644 index 00000000000..c995cd60f75 --- /dev/null +++ b/tests/baselines/reference/enumCodeGenNewLines1.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/enumCodeGenNewLines1.ts === +enum foo { +>foo : Symbol(foo, Decl(enumCodeGenNewLines1.ts, 0, 0)) + + b = 1, +>b : Symbol(foo.b, Decl(enumCodeGenNewLines1.ts, 0, 10)) + + c = 2, +>c : Symbol(foo.c, Decl(enumCodeGenNewLines1.ts, 1, 8)) + + d = 3 +>d : Symbol(foo.d, Decl(enumCodeGenNewLines1.ts, 2, 8)) +} + diff --git a/tests/baselines/reference/enumCodeGenNewLines1.types b/tests/baselines/reference/enumCodeGenNewLines1.types index 51c09daa0ff..6321511ef2d 100644 --- a/tests/baselines/reference/enumCodeGenNewLines1.types +++ b/tests/baselines/reference/enumCodeGenNewLines1.types @@ -4,11 +4,14 @@ enum foo { b = 1, >b : foo +>1 : number c = 2, >c : foo +>2 : number d = 3 >d : foo +>3 : number } diff --git a/tests/baselines/reference/enumDecl1.symbols b/tests/baselines/reference/enumDecl1.symbols new file mode 100644 index 00000000000..fc8d900ff04 --- /dev/null +++ b/tests/baselines/reference/enumDecl1.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/enumDecl1.ts === + +declare module mAmbient { +>mAmbient : Symbol(mAmbient, Decl(enumDecl1.ts, 0, 0)) + + enum e { +>e : Symbol(e, Decl(enumDecl1.ts, 1, 25)) + + x, +>x : Symbol(e.x, Decl(enumDecl1.ts, 2, 12)) + + y, +>y : Symbol(e.y, Decl(enumDecl1.ts, 3, 10)) + + z +>z : Symbol(e.z, Decl(enumDecl1.ts, 4, 10)) + } +} + diff --git a/tests/baselines/reference/enumFromExternalModule.symbols b/tests/baselines/reference/enumFromExternalModule.symbols new file mode 100644 index 00000000000..90ff7cd7aac --- /dev/null +++ b/tests/baselines/reference/enumFromExternalModule.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/enumFromExternalModule_1.ts === +/// +import f = require('enumFromExternalModule_0'); +>f : Symbol(f, Decl(enumFromExternalModule_1.ts, 0, 0)) + +var x = f.Mode.Open; +>x : Symbol(x, Decl(enumFromExternalModule_1.ts, 3, 3)) +>f.Mode.Open : Symbol(f.Mode.Open, Decl(enumFromExternalModule_0.ts, 0, 18)) +>f.Mode : Symbol(f.Mode, Decl(enumFromExternalModule_0.ts, 0, 0)) +>f : Symbol(f, Decl(enumFromExternalModule_1.ts, 0, 0)) +>Mode : Symbol(f.Mode, Decl(enumFromExternalModule_0.ts, 0, 0)) +>Open : Symbol(f.Mode.Open, Decl(enumFromExternalModule_0.ts, 0, 18)) + +=== tests/cases/compiler/enumFromExternalModule_0.ts === +export enum Mode { Open } +>Mode : Symbol(Mode, Decl(enumFromExternalModule_0.ts, 0, 0)) +>Open : Symbol(Mode.Open, Decl(enumFromExternalModule_0.ts, 0, 18)) + diff --git a/tests/baselines/reference/enumIndexer.symbols b/tests/baselines/reference/enumIndexer.symbols new file mode 100644 index 00000000000..3f65044c2ec --- /dev/null +++ b/tests/baselines/reference/enumIndexer.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/enumIndexer.ts === +enum MyEnumType { +>MyEnumType : Symbol(MyEnumType, Decl(enumIndexer.ts, 0, 0)) + + foo, bar +>foo : Symbol(MyEnumType.foo, Decl(enumIndexer.ts, 0, 17)) +>bar : Symbol(MyEnumType.bar, Decl(enumIndexer.ts, 1, 8)) +} +var _arr = [{ key: 'foo' }, { key: 'bar' }] +>_arr : Symbol(_arr, Decl(enumIndexer.ts, 3, 3)) +>key : Symbol(key, Decl(enumIndexer.ts, 3, 13)) +>key : Symbol(key, Decl(enumIndexer.ts, 3, 29)) + +var enumValue = MyEnumType.foo; +>enumValue : Symbol(enumValue, Decl(enumIndexer.ts, 4, 3)) +>MyEnumType.foo : Symbol(MyEnumType.foo, Decl(enumIndexer.ts, 0, 17)) +>MyEnumType : Symbol(MyEnumType, Decl(enumIndexer.ts, 0, 0)) +>foo : Symbol(MyEnumType.foo, Decl(enumIndexer.ts, 0, 17)) + +var x = _arr.map(o => MyEnumType[o.key] === enumValue); // these are not same type +>x : Symbol(x, Decl(enumIndexer.ts, 5, 3)) +>_arr.map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>_arr : Symbol(_arr, Decl(enumIndexer.ts, 3, 3)) +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>o : Symbol(o, Decl(enumIndexer.ts, 5, 17)) +>MyEnumType : Symbol(MyEnumType, Decl(enumIndexer.ts, 0, 0)) +>o.key : Symbol(key, Decl(enumIndexer.ts, 3, 13)) +>o : Symbol(o, Decl(enumIndexer.ts, 5, 17)) +>key : Symbol(key, Decl(enumIndexer.ts, 3, 13)) +>enumValue : Symbol(enumValue, Decl(enumIndexer.ts, 4, 3)) + diff --git a/tests/baselines/reference/enumIndexer.types b/tests/baselines/reference/enumIndexer.types index cbd7c3274a6..cbc43176b01 100644 --- a/tests/baselines/reference/enumIndexer.types +++ b/tests/baselines/reference/enumIndexer.types @@ -11,8 +11,10 @@ var _arr = [{ key: 'foo' }, { key: 'bar' }] >[{ key: 'foo' }, { key: 'bar' }] : { key: string; }[] >{ key: 'foo' } : { key: string; } >key : string +>'foo' : string >{ key: 'bar' } : { key: string; } >key : string +>'bar' : string var enumValue = MyEnumType.foo; >enumValue : MyEnumType diff --git a/tests/baselines/reference/enumMapBackIntoItself.symbols b/tests/baselines/reference/enumMapBackIntoItself.symbols new file mode 100644 index 00000000000..49464c5522d --- /dev/null +++ b/tests/baselines/reference/enumMapBackIntoItself.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/enumMapBackIntoItself.ts === +enum TShirtSize { +>TShirtSize : Symbol(TShirtSize, Decl(enumMapBackIntoItself.ts, 0, 0)) + + Small, +>Small : Symbol(TShirtSize.Small, Decl(enumMapBackIntoItself.ts, 0, 17)) + + Medium, +>Medium : Symbol(TShirtSize.Medium, Decl(enumMapBackIntoItself.ts, 1, 9)) + + Large +>Large : Symbol(TShirtSize.Large, Decl(enumMapBackIntoItself.ts, 2, 10)) +} +var mySize = TShirtSize.Large; +>mySize : Symbol(mySize, Decl(enumMapBackIntoItself.ts, 5, 3)) +>TShirtSize.Large : Symbol(TShirtSize.Large, Decl(enumMapBackIntoItself.ts, 2, 10)) +>TShirtSize : Symbol(TShirtSize, Decl(enumMapBackIntoItself.ts, 0, 0)) +>Large : Symbol(TShirtSize.Large, Decl(enumMapBackIntoItself.ts, 2, 10)) + +var test = TShirtSize[mySize]; +>test : Symbol(test, Decl(enumMapBackIntoItself.ts, 6, 3)) +>TShirtSize : Symbol(TShirtSize, Decl(enumMapBackIntoItself.ts, 0, 0)) +>mySize : Symbol(mySize, Decl(enumMapBackIntoItself.ts, 5, 3)) + +// specifically checking output here, bug was that test used to be undefined at runtime +test + '' +>test : Symbol(test, Decl(enumMapBackIntoItself.ts, 6, 3)) + diff --git a/tests/baselines/reference/enumMapBackIntoItself.types b/tests/baselines/reference/enumMapBackIntoItself.types index d97dbcf85db..ab26094512b 100644 --- a/tests/baselines/reference/enumMapBackIntoItself.types +++ b/tests/baselines/reference/enumMapBackIntoItself.types @@ -27,4 +27,5 @@ var test = TShirtSize[mySize]; test + '' >test + '' : string >test : string +>'' : string diff --git a/tests/baselines/reference/enumMerging.symbols b/tests/baselines/reference/enumMerging.symbols new file mode 100644 index 00000000000..414dd839952 --- /dev/null +++ b/tests/baselines/reference/enumMerging.symbols @@ -0,0 +1,201 @@ +=== tests/cases/conformance/enums/enumMerging.ts === +// Enum with only constant members across 2 declarations with the same root module +// Enum with initializer in all declarations with constant members with the same root module +module M1 { +>M1 : Symbol(M1, Decl(enumMerging.ts, 0, 0)) + + enum EImpl1 { +>EImpl1 : Symbol(EImpl1, Decl(enumMerging.ts, 2, 11), Decl(enumMerging.ts, 5, 5)) + + A, B, C +>A : Symbol(EImpl1.A, Decl(enumMerging.ts, 3, 17)) +>B : Symbol(EImpl1.B, Decl(enumMerging.ts, 4, 10)) +>C : Symbol(EImpl1.C, Decl(enumMerging.ts, 4, 13)) + } + + enum EImpl1 { +>EImpl1 : Symbol(EImpl1, Decl(enumMerging.ts, 2, 11), Decl(enumMerging.ts, 5, 5)) + + D = 1, E, F +>D : Symbol(EImpl1.D, Decl(enumMerging.ts, 7, 17)) +>E : Symbol(EImpl1.E, Decl(enumMerging.ts, 8, 14)) +>F : Symbol(EImpl1.F, Decl(enumMerging.ts, 8, 17)) + } + + export enum EConst1 { +>EConst1 : Symbol(EConst1, Decl(enumMerging.ts, 9, 5), Decl(enumMerging.ts, 13, 5)) + + A = 3, B = 2, C = 1 +>A : Symbol(EConst1.A, Decl(enumMerging.ts, 11, 25)) +>B : Symbol(EConst1.B, Decl(enumMerging.ts, 12, 14)) +>C : Symbol(EConst1.C, Decl(enumMerging.ts, 12, 21)) + } + + export enum EConst1 { +>EConst1 : Symbol(EConst1, Decl(enumMerging.ts, 9, 5), Decl(enumMerging.ts, 13, 5)) + + D = 7, E = 9, F = 8 +>D : Symbol(EConst1.D, Decl(enumMerging.ts, 15, 25)) +>E : Symbol(EConst1.E, Decl(enumMerging.ts, 16, 14)) +>F : Symbol(EConst1.F, Decl(enumMerging.ts, 16, 21)) + } + + var x = [EConst1.A, EConst1.B, EConst1.C, EConst1.D, EConst1.E, EConst1.F]; +>x : Symbol(x, Decl(enumMerging.ts, 19, 7)) +>EConst1.A : Symbol(EConst1.A, Decl(enumMerging.ts, 11, 25)) +>EConst1 : Symbol(EConst1, Decl(enumMerging.ts, 9, 5), Decl(enumMerging.ts, 13, 5)) +>A : Symbol(EConst1.A, Decl(enumMerging.ts, 11, 25)) +>EConst1.B : Symbol(EConst1.B, Decl(enumMerging.ts, 12, 14)) +>EConst1 : Symbol(EConst1, Decl(enumMerging.ts, 9, 5), Decl(enumMerging.ts, 13, 5)) +>B : Symbol(EConst1.B, Decl(enumMerging.ts, 12, 14)) +>EConst1.C : Symbol(EConst1.C, Decl(enumMerging.ts, 12, 21)) +>EConst1 : Symbol(EConst1, Decl(enumMerging.ts, 9, 5), Decl(enumMerging.ts, 13, 5)) +>C : Symbol(EConst1.C, Decl(enumMerging.ts, 12, 21)) +>EConst1.D : Symbol(EConst1.D, Decl(enumMerging.ts, 15, 25)) +>EConst1 : Symbol(EConst1, Decl(enumMerging.ts, 9, 5), Decl(enumMerging.ts, 13, 5)) +>D : Symbol(EConst1.D, Decl(enumMerging.ts, 15, 25)) +>EConst1.E : Symbol(EConst1.E, Decl(enumMerging.ts, 16, 14)) +>EConst1 : Symbol(EConst1, Decl(enumMerging.ts, 9, 5), Decl(enumMerging.ts, 13, 5)) +>E : Symbol(EConst1.E, Decl(enumMerging.ts, 16, 14)) +>EConst1.F : Symbol(EConst1.F, Decl(enumMerging.ts, 16, 21)) +>EConst1 : Symbol(EConst1, Decl(enumMerging.ts, 9, 5), Decl(enumMerging.ts, 13, 5)) +>F : Symbol(EConst1.F, Decl(enumMerging.ts, 16, 21)) +} + +// Enum with only computed members across 2 declarations with the same root module +module M2 { +>M2 : Symbol(M2, Decl(enumMerging.ts, 20, 1)) + + export enum EComp2 { +>EComp2 : Symbol(EComp2, Decl(enumMerging.ts, 23, 11), Decl(enumMerging.ts, 26, 5)) + + A = 'foo'.length, B = 'foo'.length, C = 'foo'.length +>A : Symbol(EComp2.A, Decl(enumMerging.ts, 24, 24)) +>'foo'.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>B : Symbol(EComp2.B, Decl(enumMerging.ts, 25, 25)) +>'foo'.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>C : Symbol(EComp2.C, Decl(enumMerging.ts, 25, 43)) +>'foo'.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + } + + export enum EComp2 { +>EComp2 : Symbol(EComp2, Decl(enumMerging.ts, 23, 11), Decl(enumMerging.ts, 26, 5)) + + D = 'foo'.length, E = 'foo'.length, F = 'foo'.length +>D : Symbol(EComp2.D, Decl(enumMerging.ts, 28, 24)) +>'foo'.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>E : Symbol(EComp2.E, Decl(enumMerging.ts, 29, 25)) +>'foo'.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>F : Symbol(EComp2.F, Decl(enumMerging.ts, 29, 43)) +>'foo'.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + } + + var x = [EComp2.A, EComp2.B, EComp2.C, EComp2.D, EComp2.E, EComp2.F]; +>x : Symbol(x, Decl(enumMerging.ts, 32, 7)) +>EComp2.A : Symbol(EComp2.A, Decl(enumMerging.ts, 24, 24)) +>EComp2 : Symbol(EComp2, Decl(enumMerging.ts, 23, 11), Decl(enumMerging.ts, 26, 5)) +>A : Symbol(EComp2.A, Decl(enumMerging.ts, 24, 24)) +>EComp2.B : Symbol(EComp2.B, Decl(enumMerging.ts, 25, 25)) +>EComp2 : Symbol(EComp2, Decl(enumMerging.ts, 23, 11), Decl(enumMerging.ts, 26, 5)) +>B : Symbol(EComp2.B, Decl(enumMerging.ts, 25, 25)) +>EComp2.C : Symbol(EComp2.C, Decl(enumMerging.ts, 25, 43)) +>EComp2 : Symbol(EComp2, Decl(enumMerging.ts, 23, 11), Decl(enumMerging.ts, 26, 5)) +>C : Symbol(EComp2.C, Decl(enumMerging.ts, 25, 43)) +>EComp2.D : Symbol(EComp2.D, Decl(enumMerging.ts, 28, 24)) +>EComp2 : Symbol(EComp2, Decl(enumMerging.ts, 23, 11), Decl(enumMerging.ts, 26, 5)) +>D : Symbol(EComp2.D, Decl(enumMerging.ts, 28, 24)) +>EComp2.E : Symbol(EComp2.E, Decl(enumMerging.ts, 29, 25)) +>EComp2 : Symbol(EComp2, Decl(enumMerging.ts, 23, 11), Decl(enumMerging.ts, 26, 5)) +>E : Symbol(EComp2.E, Decl(enumMerging.ts, 29, 25)) +>EComp2.F : Symbol(EComp2.F, Decl(enumMerging.ts, 29, 43)) +>EComp2 : Symbol(EComp2, Decl(enumMerging.ts, 23, 11), Decl(enumMerging.ts, 26, 5)) +>F : Symbol(EComp2.F, Decl(enumMerging.ts, 29, 43)) +} + +// Enum with initializer in only one of two declarations with constant members with the same root module +module M3 { +>M3 : Symbol(M3, Decl(enumMerging.ts, 33, 1)) + + enum EInit { +>EInit : Symbol(EInit, Decl(enumMerging.ts, 36, 11), Decl(enumMerging.ts, 40, 5)) + + A, +>A : Symbol(EInit.A, Decl(enumMerging.ts, 37, 16)) + + B +>B : Symbol(EInit.B, Decl(enumMerging.ts, 38, 10)) + } + + enum EInit { +>EInit : Symbol(EInit, Decl(enumMerging.ts, 36, 11), Decl(enumMerging.ts, 40, 5)) + + C = 1, D, E +>C : Symbol(EInit.C, Decl(enumMerging.ts, 42, 16)) +>D : Symbol(EInit.D, Decl(enumMerging.ts, 43, 14)) +>E : Symbol(EInit.E, Decl(enumMerging.ts, 43, 17)) + } +} + +// Enums with same name but different root module +module M4 { +>M4 : Symbol(M4, Decl(enumMerging.ts, 45, 1)) + + export enum Color { Red, Green, Blue } +>Color : Symbol(Color, Decl(enumMerging.ts, 48, 11)) +>Red : Symbol(Color.Red, Decl(enumMerging.ts, 49, 23)) +>Green : Symbol(Color.Green, Decl(enumMerging.ts, 49, 28)) +>Blue : Symbol(Color.Blue, Decl(enumMerging.ts, 49, 35)) +} +module M5 { +>M5 : Symbol(M5, Decl(enumMerging.ts, 50, 1)) + + export enum Color { Red, Green, Blue } +>Color : Symbol(Color, Decl(enumMerging.ts, 51, 11)) +>Red : Symbol(Color.Red, Decl(enumMerging.ts, 52, 23)) +>Green : Symbol(Color.Green, Decl(enumMerging.ts, 52, 28)) +>Blue : Symbol(Color.Blue, Decl(enumMerging.ts, 52, 35)) +} + +module M6.A { +>M6 : Symbol(M6, Decl(enumMerging.ts, 53, 1), Decl(enumMerging.ts, 57, 1)) +>A : Symbol(A, Decl(enumMerging.ts, 55, 10), Decl(enumMerging.ts, 58, 11)) + + export enum Color { Red, Green, Blue } +>Color : Symbol(Color, Decl(enumMerging.ts, 55, 13), Decl(enumMerging.ts, 59, 21)) +>Red : Symbol(Color.Red, Decl(enumMerging.ts, 56, 23)) +>Green : Symbol(Color.Green, Decl(enumMerging.ts, 56, 28)) +>Blue : Symbol(Color.Blue, Decl(enumMerging.ts, 56, 35)) +} +module M6 { +>M6 : Symbol(M6, Decl(enumMerging.ts, 53, 1), Decl(enumMerging.ts, 57, 1)) + + export module A { +>A : Symbol(A, Decl(enumMerging.ts, 55, 10), Decl(enumMerging.ts, 58, 11)) + + export enum Color { Yellow = 1 } +>Color : Symbol(Color, Decl(enumMerging.ts, 55, 13), Decl(enumMerging.ts, 59, 21)) +>Yellow : Symbol(Color.Yellow, Decl(enumMerging.ts, 60, 27)) + } + var t = A.Color.Yellow; +>t : Symbol(t, Decl(enumMerging.ts, 62, 7)) +>A.Color.Yellow : Symbol(A.Color.Yellow, Decl(enumMerging.ts, 60, 27)) +>A.Color : Symbol(A.Color, Decl(enumMerging.ts, 55, 13), Decl(enumMerging.ts, 59, 21)) +>A : Symbol(A, Decl(enumMerging.ts, 55, 10), Decl(enumMerging.ts, 58, 11)) +>Color : Symbol(A.Color, Decl(enumMerging.ts, 55, 13), Decl(enumMerging.ts, 59, 21)) +>Yellow : Symbol(A.Color.Yellow, Decl(enumMerging.ts, 60, 27)) + + t = A.Color.Red; +>t : Symbol(t, Decl(enumMerging.ts, 62, 7)) +>A.Color.Red : Symbol(A.Color.Red, Decl(enumMerging.ts, 56, 23)) +>A.Color : Symbol(A.Color, Decl(enumMerging.ts, 55, 13), Decl(enumMerging.ts, 59, 21)) +>A : Symbol(A, Decl(enumMerging.ts, 55, 10), Decl(enumMerging.ts, 58, 11)) +>Color : Symbol(A.Color, Decl(enumMerging.ts, 55, 13), Decl(enumMerging.ts, 59, 21)) +>Red : Symbol(A.Color.Red, Decl(enumMerging.ts, 56, 23)) +} + diff --git a/tests/baselines/reference/enumMerging.types b/tests/baselines/reference/enumMerging.types index c61f9e17739..85eb360249f 100644 --- a/tests/baselines/reference/enumMerging.types +++ b/tests/baselines/reference/enumMerging.types @@ -18,6 +18,7 @@ module M1 { D = 1, E, F >D : EImpl1 +>1 : number >E : EImpl1 >F : EImpl1 } @@ -27,8 +28,11 @@ module M1 { A = 3, B = 2, C = 1 >A : EConst1 +>3 : number >B : EConst1 +>2 : number >C : EConst1 +>1 : number } export enum EConst1 { @@ -36,8 +40,11 @@ module M1 { D = 7, E = 9, F = 8 >D : EConst1 +>7 : number >E : EConst1 +>9 : number >F : EConst1 +>8 : number } var x = [EConst1.A, EConst1.B, EConst1.C, EConst1.D, EConst1.E, EConst1.F]; @@ -73,12 +80,15 @@ module M2 { A = 'foo'.length, B = 'foo'.length, C = 'foo'.length >A : EComp2 >'foo'.length : number +>'foo' : string >length : number >B : EComp2 >'foo'.length : number +>'foo' : string >length : number >C : EComp2 >'foo'.length : number +>'foo' : string >length : number } @@ -88,12 +98,15 @@ module M2 { D = 'foo'.length, E = 'foo'.length, F = 'foo'.length >D : EComp2 >'foo'.length : number +>'foo' : string >length : number >E : EComp2 >'foo'.length : number +>'foo' : string >length : number >F : EComp2 >'foo'.length : number +>'foo' : string >length : number } @@ -139,6 +152,7 @@ module M3 { C = 1, D, E >C : EInit +>1 : number >D : EInit >E : EInit } @@ -183,6 +197,7 @@ module M6 { export enum Color { Yellow = 1 } >Color : Color >Yellow : Color +>1 : number } var t = A.Color.Yellow; >t : A.Color diff --git a/tests/baselines/reference/enumNegativeLiteral1.symbols b/tests/baselines/reference/enumNegativeLiteral1.symbols new file mode 100644 index 00000000000..cfb7c52ecb2 --- /dev/null +++ b/tests/baselines/reference/enumNegativeLiteral1.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/enumNegativeLiteral1.ts === +enum E { +>E : Symbol(E, Decl(enumNegativeLiteral1.ts, 0, 0)) + + a = -5, b, c +>a : Symbol(E.a, Decl(enumNegativeLiteral1.ts, 0, 8)) +>b : Symbol(E.b, Decl(enumNegativeLiteral1.ts, 1, 11)) +>c : Symbol(E.c, Decl(enumNegativeLiteral1.ts, 1, 14)) +} + diff --git a/tests/baselines/reference/enumNegativeLiteral1.types b/tests/baselines/reference/enumNegativeLiteral1.types index 329c54e276b..31ecbc11aa2 100644 --- a/tests/baselines/reference/enumNegativeLiteral1.types +++ b/tests/baselines/reference/enumNegativeLiteral1.types @@ -5,6 +5,7 @@ enum E { a = -5, b, c >a : E >-5 : number +>5 : number >b : E >c : E } diff --git a/tests/baselines/reference/enumNumbering1.symbols b/tests/baselines/reference/enumNumbering1.symbols new file mode 100644 index 00000000000..7722b5bad78 --- /dev/null +++ b/tests/baselines/reference/enumNumbering1.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/enumNumbering1.ts === +enum Test { +>Test : Symbol(Test, Decl(enumNumbering1.ts, 0, 0)) + + A, +>A : Symbol(Test.A, Decl(enumNumbering1.ts, 0, 11)) + + B, +>B : Symbol(Test.B, Decl(enumNumbering1.ts, 1, 6)) + + C = Math.floor(Math.random() * 1000), +>C : Symbol(Test.C, Decl(enumNumbering1.ts, 2, 6)) +>Math.floor : Symbol(Math.floor, Decl(lib.d.ts, 582, 27)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>floor : Symbol(Math.floor, Decl(lib.d.ts, 582, 27)) +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) + + D = 10, +>D : Symbol(Test.D, Decl(enumNumbering1.ts, 3, 41)) + + E // Error but shouldn't be +>E : Symbol(Test.E, Decl(enumNumbering1.ts, 4, 11)) +} + diff --git a/tests/baselines/reference/enumNumbering1.types b/tests/baselines/reference/enumNumbering1.types index 00e8eb95da9..81bb0325b7a 100644 --- a/tests/baselines/reference/enumNumbering1.types +++ b/tests/baselines/reference/enumNumbering1.types @@ -19,9 +19,11 @@ enum Test { >Math.random : () => number >Math : Math >random : () => number +>1000 : number D = 10, >D : Test +>10 : number E // Error but shouldn't be >E : Test diff --git a/tests/baselines/reference/enumOperations.symbols b/tests/baselines/reference/enumOperations.symbols new file mode 100644 index 00000000000..392b8bd648f --- /dev/null +++ b/tests/baselines/reference/enumOperations.symbols @@ -0,0 +1,53 @@ +=== tests/cases/compiler/enumOperations.ts === +enum Enum { None = 0 } +>Enum : Symbol(Enum, Decl(enumOperations.ts, 0, 0)) +>None : Symbol(Enum.None, Decl(enumOperations.ts, 0, 11)) + +var enumType: Enum = Enum.None; +>enumType : Symbol(enumType, Decl(enumOperations.ts, 1, 3)) +>Enum : Symbol(Enum, Decl(enumOperations.ts, 0, 0)) +>Enum.None : Symbol(Enum.None, Decl(enumOperations.ts, 0, 11)) +>Enum : Symbol(Enum, Decl(enumOperations.ts, 0, 0)) +>None : Symbol(Enum.None, Decl(enumOperations.ts, 0, 11)) + +var numberType: number = 0; +>numberType : Symbol(numberType, Decl(enumOperations.ts, 2, 3)) + +var anyType: any = 0; +>anyType : Symbol(anyType, Decl(enumOperations.ts, 3, 3)) + +enumType ^ numberType; +>enumType : Symbol(enumType, Decl(enumOperations.ts, 1, 3)) +>numberType : Symbol(numberType, Decl(enumOperations.ts, 2, 3)) + +numberType ^ anyType; +>numberType : Symbol(numberType, Decl(enumOperations.ts, 2, 3)) +>anyType : Symbol(anyType, Decl(enumOperations.ts, 3, 3)) + +enumType & anyType; +>enumType : Symbol(enumType, Decl(enumOperations.ts, 1, 3)) +>anyType : Symbol(anyType, Decl(enumOperations.ts, 3, 3)) + +enumType | anyType; +>enumType : Symbol(enumType, Decl(enumOperations.ts, 1, 3)) +>anyType : Symbol(anyType, Decl(enumOperations.ts, 3, 3)) + +enumType ^ anyType; +>enumType : Symbol(enumType, Decl(enumOperations.ts, 1, 3)) +>anyType : Symbol(anyType, Decl(enumOperations.ts, 3, 3)) + +~anyType; +>anyType : Symbol(anyType, Decl(enumOperations.ts, 3, 3)) + +enumType <enumType : Symbol(enumType, Decl(enumOperations.ts, 1, 3)) +>anyType : Symbol(anyType, Decl(enumOperations.ts, 3, 3)) + +enumType >>anyType; +>enumType : Symbol(enumType, Decl(enumOperations.ts, 1, 3)) +>anyType : Symbol(anyType, Decl(enumOperations.ts, 3, 3)) + +enumType >>>anyType; +>enumType : Symbol(enumType, Decl(enumOperations.ts, 1, 3)) +>anyType : Symbol(anyType, Decl(enumOperations.ts, 3, 3)) + diff --git a/tests/baselines/reference/enumOperations.types b/tests/baselines/reference/enumOperations.types index df36d293cf3..232ecc5e71b 100644 --- a/tests/baselines/reference/enumOperations.types +++ b/tests/baselines/reference/enumOperations.types @@ -2,6 +2,7 @@ enum Enum { None = 0 } >Enum : Enum >None : Enum +>0 : number var enumType: Enum = Enum.None; >enumType : Enum @@ -12,9 +13,11 @@ var enumType: Enum = Enum.None; var numberType: number = 0; >numberType : number +>0 : number var anyType: any = 0; >anyType : any +>0 : number enumType ^ numberType; >enumType ^ numberType : number diff --git a/tests/baselines/reference/enumWithQuotedElementName1.symbols b/tests/baselines/reference/enumWithQuotedElementName1.symbols new file mode 100644 index 00000000000..48f861f9726 --- /dev/null +++ b/tests/baselines/reference/enumWithQuotedElementName1.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/enumWithQuotedElementName1.ts === +enum E { +>E : Symbol(E, Decl(enumWithQuotedElementName1.ts, 0, 0)) + + 'fo"o', +} diff --git a/tests/baselines/reference/enumWithQuotedElementName2.symbols b/tests/baselines/reference/enumWithQuotedElementName2.symbols new file mode 100644 index 00000000000..245eaa55748 --- /dev/null +++ b/tests/baselines/reference/enumWithQuotedElementName2.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/enumWithQuotedElementName2.ts === +enum E { +>E : Symbol(E, Decl(enumWithQuotedElementName2.ts, 0, 0)) + + "fo'o", +} diff --git a/tests/baselines/reference/enumWithUnicodeEscape1.symbols b/tests/baselines/reference/enumWithUnicodeEscape1.symbols new file mode 100644 index 00000000000..a146f87247d --- /dev/null +++ b/tests/baselines/reference/enumWithUnicodeEscape1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/enumWithUnicodeEscape1.ts === +enum E { +>E : Symbol(E, Decl(enumWithUnicodeEscape1.ts, 0, 0)) + + 'gold \u2730' +} + diff --git a/tests/baselines/reference/enumsWithMultipleDeclarations3.symbols b/tests/baselines/reference/enumsWithMultipleDeclarations3.symbols new file mode 100644 index 00000000000..b9e575db9c1 --- /dev/null +++ b/tests/baselines/reference/enumsWithMultipleDeclarations3.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/enumsWithMultipleDeclarations3.ts === +module E { +>E : Symbol(E, Decl(enumsWithMultipleDeclarations3.ts, 0, 0), Decl(enumsWithMultipleDeclarations3.ts, 1, 1)) +} + +enum E { +>E : Symbol(E, Decl(enumsWithMultipleDeclarations3.ts, 0, 0), Decl(enumsWithMultipleDeclarations3.ts, 1, 1)) + + A +>A : Symbol(E.A, Decl(enumsWithMultipleDeclarations3.ts, 3, 8)) +} diff --git a/tests/baselines/reference/errorRecoveryInClassDeclaration.errors.txt b/tests/baselines/reference/errorRecoveryInClassDeclaration.errors.txt new file mode 100644 index 00000000000..0835a7f256d --- /dev/null +++ b/tests/baselines/reference/errorRecoveryInClassDeclaration.errors.txt @@ -0,0 +1,25 @@ +tests/cases/compiler/errorRecoveryInClassDeclaration.ts(3,17): error TS2304: Cannot find name 'foo'. +tests/cases/compiler/errorRecoveryInClassDeclaration.ts(4,13): error TS2304: Cannot find name 'public'. +tests/cases/compiler/errorRecoveryInClassDeclaration.ts(4,20): error TS1005: ',' expected. +tests/cases/compiler/errorRecoveryInClassDeclaration.ts(4,20): error TS2304: Cannot find name 'blaz'. +tests/cases/compiler/errorRecoveryInClassDeclaration.ts(4,27): error TS1005: ',' expected. + + +==== tests/cases/compiler/errorRecoveryInClassDeclaration.ts (5 errors) ==== + class C { + public bar() { + var v = foo( + ~~~ +!!! error TS2304: Cannot find name 'foo'. + public blaz() {} + ~~~~~~ +!!! error TS2304: Cannot find name 'public'. + ~~~~ +!!! error TS1005: ',' expected. + ~~~~ +!!! error TS2304: Cannot find name 'blaz'. + ~ +!!! error TS1005: ',' expected. + ); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/errorRecoveryInClassDeclaration.js b/tests/baselines/reference/errorRecoveryInClassDeclaration.js new file mode 100644 index 00000000000..7f95bed19f9 --- /dev/null +++ b/tests/baselines/reference/errorRecoveryInClassDeclaration.js @@ -0,0 +1,18 @@ +//// [errorRecoveryInClassDeclaration.ts] +class C { + public bar() { + var v = foo( + public blaz() {} + ); + } +} + +//// [errorRecoveryInClassDeclaration.js] +var C = (function () { + function C() { + } + C.prototype.bar = function () { + var v = foo(public, blaz(), {}); + }; + return C; +})(); diff --git a/tests/baselines/reference/es3-amd.symbols b/tests/baselines/reference/es3-amd.symbols new file mode 100644 index 00000000000..f6d1211ad4e --- /dev/null +++ b/tests/baselines/reference/es3-amd.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/es3-amd.ts === + +class A +>A : Symbol(A, Decl(es3-amd.ts, 0, 0)) +{ + constructor () + { + + } + + public B() +>B : Symbol(B, Decl(es3-amd.ts, 6, 5)) + { + return 42; + } +} diff --git a/tests/baselines/reference/es3-amd.types b/tests/baselines/reference/es3-amd.types index c43d29ac6dc..1e9fdbd582f 100644 --- a/tests/baselines/reference/es3-amd.types +++ b/tests/baselines/reference/es3-amd.types @@ -12,5 +12,6 @@ class A >B : () => number { return 42; +>42 : number } } diff --git a/tests/baselines/reference/es3-declaration-amd.symbols b/tests/baselines/reference/es3-declaration-amd.symbols new file mode 100644 index 00000000000..aec4af2bb60 --- /dev/null +++ b/tests/baselines/reference/es3-declaration-amd.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/es3-declaration-amd.ts === + +class A +>A : Symbol(A, Decl(es3-declaration-amd.ts, 0, 0)) +{ + constructor () + { + + } + + public B() +>B : Symbol(B, Decl(es3-declaration-amd.ts, 6, 5)) + { + return 42; + } +} diff --git a/tests/baselines/reference/es3-declaration-amd.types b/tests/baselines/reference/es3-declaration-amd.types index 0ee63040166..daf0bb5d74e 100644 --- a/tests/baselines/reference/es3-declaration-amd.types +++ b/tests/baselines/reference/es3-declaration-amd.types @@ -12,5 +12,6 @@ class A >B : () => number { return 42; +>42 : number } } diff --git a/tests/baselines/reference/es3-sourcemap-amd.symbols b/tests/baselines/reference/es3-sourcemap-amd.symbols new file mode 100644 index 00000000000..ca20348a0f5 --- /dev/null +++ b/tests/baselines/reference/es3-sourcemap-amd.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/es3-sourcemap-amd.ts === + +class A +>A : Symbol(A, Decl(es3-sourcemap-amd.ts, 0, 0)) +{ + constructor () + { + + } + + public B() +>B : Symbol(B, Decl(es3-sourcemap-amd.ts, 6, 5)) + { + return 42; + } +} diff --git a/tests/baselines/reference/es3-sourcemap-amd.types b/tests/baselines/reference/es3-sourcemap-amd.types index 5301120e2df..d3f712211e4 100644 --- a/tests/baselines/reference/es3-sourcemap-amd.types +++ b/tests/baselines/reference/es3-sourcemap-amd.types @@ -12,5 +12,6 @@ class A >B : () => number { return 42; +>42 : number } } diff --git a/tests/baselines/reference/es5-amd.symbols b/tests/baselines/reference/es5-amd.symbols new file mode 100644 index 00000000000..cf99349fc1d --- /dev/null +++ b/tests/baselines/reference/es5-amd.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/es5-amd.ts === + +class A +>A : Symbol(A, Decl(es5-amd.ts, 0, 0)) +{ + constructor () + { + + } + + public B() +>B : Symbol(B, Decl(es5-amd.ts, 6, 5)) + { + return 42; + } +} diff --git a/tests/baselines/reference/es5-amd.types b/tests/baselines/reference/es5-amd.types index 289289d3c0b..7dd9e8b281a 100644 --- a/tests/baselines/reference/es5-amd.types +++ b/tests/baselines/reference/es5-amd.types @@ -12,5 +12,6 @@ class A >B : () => number { return 42; +>42 : number } } diff --git a/tests/baselines/reference/es5-declaration-amd.symbols b/tests/baselines/reference/es5-declaration-amd.symbols new file mode 100644 index 00000000000..a2504a0ea84 --- /dev/null +++ b/tests/baselines/reference/es5-declaration-amd.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/es5-declaration-amd.ts === + +class A +>A : Symbol(A, Decl(es5-declaration-amd.ts, 0, 0)) +{ + constructor () + { + + } + + public B() +>B : Symbol(B, Decl(es5-declaration-amd.ts, 6, 5)) + { + return 42; + } +} diff --git a/tests/baselines/reference/es5-declaration-amd.types b/tests/baselines/reference/es5-declaration-amd.types index 50815e8e6bc..ead96c35de1 100644 --- a/tests/baselines/reference/es5-declaration-amd.types +++ b/tests/baselines/reference/es5-declaration-amd.types @@ -12,5 +12,6 @@ class A >B : () => number { return 42; +>42 : number } } diff --git a/tests/baselines/reference/es5-souremap-amd.symbols b/tests/baselines/reference/es5-souremap-amd.symbols new file mode 100644 index 00000000000..14b22cc74c6 --- /dev/null +++ b/tests/baselines/reference/es5-souremap-amd.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/es5-souremap-amd.ts === + +class A +>A : Symbol(A, Decl(es5-souremap-amd.ts, 0, 0)) +{ + constructor () + { + + } + + public B() +>B : Symbol(B, Decl(es5-souremap-amd.ts, 6, 5)) + { + return 42; + } +} diff --git a/tests/baselines/reference/es5-souremap-amd.types b/tests/baselines/reference/es5-souremap-amd.types index 242e6508026..67606d7f1ff 100644 --- a/tests/baselines/reference/es5-souremap-amd.types +++ b/tests/baselines/reference/es5-souremap-amd.types @@ -12,5 +12,6 @@ class A >B : () => number { return 42; +>42 : number } } diff --git a/tests/baselines/reference/es5ExportDefaultClassDeclaration.symbols b/tests/baselines/reference/es5ExportDefaultClassDeclaration.symbols new file mode 100644 index 00000000000..24196766dfa --- /dev/null +++ b/tests/baselines/reference/es5ExportDefaultClassDeclaration.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/es5ExportDefaultClassDeclaration.ts === + +export default class C { +>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration.ts, 0, 0)) + + method() { } +>method : Symbol(method, Decl(es5ExportDefaultClassDeclaration.ts, 1, 24)) +} + diff --git a/tests/baselines/reference/es5ExportDefaultClassDeclaration2.symbols b/tests/baselines/reference/es5ExportDefaultClassDeclaration2.symbols new file mode 100644 index 00000000000..0780ff7a3c8 --- /dev/null +++ b/tests/baselines/reference/es5ExportDefaultClassDeclaration2.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/es5ExportDefaultClassDeclaration2.ts === + +export default class { + method() { } +>method : Symbol(method, Decl(es5ExportDefaultClassDeclaration2.ts, 1, 22)) +} + diff --git a/tests/baselines/reference/es5ExportDefaultClassDeclaration3.symbols b/tests/baselines/reference/es5ExportDefaultClassDeclaration3.symbols new file mode 100644 index 00000000000..b5262b94688 --- /dev/null +++ b/tests/baselines/reference/es5ExportDefaultClassDeclaration3.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/es5ExportDefaultClassDeclaration3.ts === + +var before: C = new C(); +>before : Symbol(before, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 3)) +>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 24)) +>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 24)) + +export default class C { +>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 24)) + + method(): C { +>method : Symbol(method, Decl(es5ExportDefaultClassDeclaration3.ts, 3, 24)) +>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 24)) + + return new C(); +>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 24)) + } +} + +var after: C = new C(); +>after : Symbol(after, Decl(es5ExportDefaultClassDeclaration3.ts, 9, 3)) +>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 24)) +>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 24)) + +var t: typeof C = C; +>t : Symbol(t, Decl(es5ExportDefaultClassDeclaration3.ts, 11, 3)) +>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 24)) +>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 24)) + + diff --git a/tests/baselines/reference/es5ExportDefaultClassDeclaration4.js b/tests/baselines/reference/es5ExportDefaultClassDeclaration4.js new file mode 100644 index 00000000000..118367dd111 --- /dev/null +++ b/tests/baselines/reference/es5ExportDefaultClassDeclaration4.js @@ -0,0 +1,28 @@ +//// [es5ExportDefaultClassDeclaration4.ts] + +declare module "foo" { + export var before: C; + + export default class C { + method(): C; + } + + export var after: C; + + export var t: typeof C; +} + + + +//// [es5ExportDefaultClassDeclaration4.js] + + +//// [es5ExportDefaultClassDeclaration4.d.ts] +declare module "foo" { + var before: C; + class C { + method(): C; + } + var after: C; + var t: typeof C; +} diff --git a/tests/baselines/reference/es5ExportDefaultClassDeclaration4.symbols b/tests/baselines/reference/es5ExportDefaultClassDeclaration4.symbols new file mode 100644 index 00000000000..6c30ffed858 --- /dev/null +++ b/tests/baselines/reference/es5ExportDefaultClassDeclaration4.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/es5ExportDefaultClassDeclaration4.ts === + +declare module "foo" { + export var before: C; +>before : Symbol(before, Decl(es5ExportDefaultClassDeclaration4.ts, 2, 14)) +>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration4.ts, 2, 25)) + + export default class C { +>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration4.ts, 2, 25)) + + method(): C; +>method : Symbol(method, Decl(es5ExportDefaultClassDeclaration4.ts, 4, 28)) +>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration4.ts, 2, 25)) + } + + export var after: C; +>after : Symbol(after, Decl(es5ExportDefaultClassDeclaration4.ts, 8, 14)) +>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration4.ts, 2, 25)) + + export var t: typeof C; +>t : Symbol(t, Decl(es5ExportDefaultClassDeclaration4.ts, 10, 14)) +>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration4.ts, 2, 25)) +} + + diff --git a/tests/baselines/reference/es5ExportDefaultClassDeclaration4.types b/tests/baselines/reference/es5ExportDefaultClassDeclaration4.types new file mode 100644 index 00000000000..de27b4b5fb0 --- /dev/null +++ b/tests/baselines/reference/es5ExportDefaultClassDeclaration4.types @@ -0,0 +1,25 @@ +=== tests/cases/compiler/es5ExportDefaultClassDeclaration4.ts === + +declare module "foo" { + export var before: C; +>before : C +>C : C + + export default class C { +>C : C + + method(): C; +>method : () => C +>C : C + } + + export var after: C; +>after : C +>C : C + + export var t: typeof C; +>t : typeof C +>C : typeof C +} + + diff --git a/tests/baselines/reference/es5ExportDefaultExpression.js b/tests/baselines/reference/es5ExportDefaultExpression.js index 1e14ae0bffd..944b6fc71a5 100644 --- a/tests/baselines/reference/es5ExportDefaultExpression.js +++ b/tests/baselines/reference/es5ExportDefaultExpression.js @@ -8,4 +8,5 @@ exports.default = (1 + 2); //// [es5ExportDefaultExpression.d.ts] -export default : number; +declare var _default: number; +export default _default; diff --git a/tests/baselines/reference/es5ExportDefaultExpression.symbols b/tests/baselines/reference/es5ExportDefaultExpression.symbols new file mode 100644 index 00000000000..3f9f11e283a --- /dev/null +++ b/tests/baselines/reference/es5ExportDefaultExpression.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/es5ExportDefaultExpression.ts === + +No type information for this code.export default (1 + 2); +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/es5ExportDefaultExpression.types b/tests/baselines/reference/es5ExportDefaultExpression.types index 2f4e2b57284..6b371a2fc73 100644 --- a/tests/baselines/reference/es5ExportDefaultExpression.types +++ b/tests/baselines/reference/es5ExportDefaultExpression.types @@ -3,4 +3,6 @@ export default (1 + 2); >(1 + 2) : number >1 + 2 : number +>1 : number +>2 : number diff --git a/tests/baselines/reference/es5ExportDefaultFunctionDeclaration.symbols b/tests/baselines/reference/es5ExportDefaultFunctionDeclaration.symbols new file mode 100644 index 00000000000..6c80a2532e3 --- /dev/null +++ b/tests/baselines/reference/es5ExportDefaultFunctionDeclaration.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/es5ExportDefaultFunctionDeclaration.ts === + +export default function f() { } +>f : Symbol(f, Decl(es5ExportDefaultFunctionDeclaration.ts, 0, 0)) + diff --git a/tests/baselines/reference/es5ExportDefaultFunctionDeclaration2.symbols b/tests/baselines/reference/es5ExportDefaultFunctionDeclaration2.symbols new file mode 100644 index 00000000000..1b9f9d26151 --- /dev/null +++ b/tests/baselines/reference/es5ExportDefaultFunctionDeclaration2.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/es5ExportDefaultFunctionDeclaration2.ts === + +No type information for this code.export default function () { } +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/es5ExportDefaultFunctionDeclaration3.symbols b/tests/baselines/reference/es5ExportDefaultFunctionDeclaration3.symbols new file mode 100644 index 00000000000..921a3304e01 --- /dev/null +++ b/tests/baselines/reference/es5ExportDefaultFunctionDeclaration3.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/es5ExportDefaultFunctionDeclaration3.ts === + +var before: typeof func = func(); +>before : Symbol(before, Decl(es5ExportDefaultFunctionDeclaration3.ts, 1, 3)) +>func : Symbol(func, Decl(es5ExportDefaultFunctionDeclaration3.ts, 1, 33)) +>func : Symbol(func, Decl(es5ExportDefaultFunctionDeclaration3.ts, 1, 33)) + +export default function func(): typeof func { +>func : Symbol(func, Decl(es5ExportDefaultFunctionDeclaration3.ts, 1, 33)) +>func : Symbol(func, Decl(es5ExportDefaultFunctionDeclaration3.ts, 1, 33)) + + return func; +>func : Symbol(func, Decl(es5ExportDefaultFunctionDeclaration3.ts, 1, 33)) +} + +var after: typeof func = func(); +>after : Symbol(after, Decl(es5ExportDefaultFunctionDeclaration3.ts, 7, 3)) +>func : Symbol(func, Decl(es5ExportDefaultFunctionDeclaration3.ts, 1, 33)) +>func : Symbol(func, Decl(es5ExportDefaultFunctionDeclaration3.ts, 1, 33)) + diff --git a/tests/baselines/reference/es5ExportDefaultFunctionDeclaration4.js b/tests/baselines/reference/es5ExportDefaultFunctionDeclaration4.js new file mode 100644 index 00000000000..a8bdc7d79ef --- /dev/null +++ b/tests/baselines/reference/es5ExportDefaultFunctionDeclaration4.js @@ -0,0 +1,19 @@ +//// [es5ExportDefaultFunctionDeclaration4.ts] + +declare module "bar" { + var before: typeof func; + + export default function func(): typeof func; + + var after: typeof func; +} + +//// [es5ExportDefaultFunctionDeclaration4.js] + + +//// [es5ExportDefaultFunctionDeclaration4.d.ts] +declare module "bar" { + var before: typeof func; + function func(): typeof func; + var after: typeof func; +} diff --git a/tests/baselines/reference/es5ExportDefaultFunctionDeclaration4.symbols b/tests/baselines/reference/es5ExportDefaultFunctionDeclaration4.symbols new file mode 100644 index 00000000000..940c095d11f --- /dev/null +++ b/tests/baselines/reference/es5ExportDefaultFunctionDeclaration4.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/es5ExportDefaultFunctionDeclaration4.ts === + +declare module "bar" { + var before: typeof func; +>before : Symbol(before, Decl(es5ExportDefaultFunctionDeclaration4.ts, 2, 7)) +>func : Symbol(func, Decl(es5ExportDefaultFunctionDeclaration4.ts, 2, 28)) + + export default function func(): typeof func; +>func : Symbol(func, Decl(es5ExportDefaultFunctionDeclaration4.ts, 2, 28)) +>func : Symbol(func, Decl(es5ExportDefaultFunctionDeclaration4.ts, 2, 28)) + + var after: typeof func; +>after : Symbol(after, Decl(es5ExportDefaultFunctionDeclaration4.ts, 6, 7)) +>func : Symbol(func, Decl(es5ExportDefaultFunctionDeclaration4.ts, 2, 28)) +} diff --git a/tests/baselines/reference/es5ExportDefaultFunctionDeclaration4.types b/tests/baselines/reference/es5ExportDefaultFunctionDeclaration4.types new file mode 100644 index 00000000000..163311fbd14 --- /dev/null +++ b/tests/baselines/reference/es5ExportDefaultFunctionDeclaration4.types @@ -0,0 +1,15 @@ +=== tests/cases/compiler/es5ExportDefaultFunctionDeclaration4.ts === + +declare module "bar" { + var before: typeof func; +>before : () => typeof func +>func : () => typeof func + + export default function func(): typeof func; +>func : () => typeof func +>func : () => typeof func + + var after: typeof func; +>after : () => typeof func +>func : () => typeof func +} diff --git a/tests/baselines/reference/es5ExportDefaultIdentifier.symbols b/tests/baselines/reference/es5ExportDefaultIdentifier.symbols new file mode 100644 index 00000000000..78b9a54947a --- /dev/null +++ b/tests/baselines/reference/es5ExportDefaultIdentifier.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/es5ExportDefaultIdentifier.ts === + +export function f() { } +>f : Symbol(f, Decl(es5ExportDefaultIdentifier.ts, 0, 0)) + +export default f; +>f : Symbol(f, Decl(es5ExportDefaultIdentifier.ts, 0, 0)) + diff --git a/tests/baselines/reference/es5ExportEqualsDts.symbols b/tests/baselines/reference/es5ExportEqualsDts.symbols new file mode 100644 index 00000000000..52bf357d177 --- /dev/null +++ b/tests/baselines/reference/es5ExportEqualsDts.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/es5ExportEqualsDts.ts === + +class A { +>A : Symbol(A, Decl(es5ExportEqualsDts.ts, 0, 0), Decl(es5ExportEqualsDts.ts, 6, 1)) + + foo() { +>foo : Symbol(foo, Decl(es5ExportEqualsDts.ts, 1, 9)) + + var aVal: A.B; +>aVal : Symbol(aVal, Decl(es5ExportEqualsDts.ts, 3, 11)) +>A : Symbol(A, Decl(es5ExportEqualsDts.ts, 0, 0), Decl(es5ExportEqualsDts.ts, 6, 1)) +>B : Symbol(A.B, Decl(es5ExportEqualsDts.ts, 8, 10)) + + return aVal; +>aVal : Symbol(aVal, Decl(es5ExportEqualsDts.ts, 3, 11)) + } +} + +module A { +>A : Symbol(A, Decl(es5ExportEqualsDts.ts, 0, 0), Decl(es5ExportEqualsDts.ts, 6, 1)) + + export interface B { } +>B : Symbol(B, Decl(es5ExportEqualsDts.ts, 8, 10)) +} + +export = A +>A : Symbol(A, Decl(es5ExportEqualsDts.ts, 0, 0), Decl(es5ExportEqualsDts.ts, 6, 1)) + diff --git a/tests/baselines/reference/es5ExportEqualsDts.types b/tests/baselines/reference/es5ExportEqualsDts.types index 58b35a0d7ce..265fda6c76c 100644 --- a/tests/baselines/reference/es5ExportEqualsDts.types +++ b/tests/baselines/reference/es5ExportEqualsDts.types @@ -8,7 +8,7 @@ class A { var aVal: A.B; >aVal : A.B ->A : unknown +>A : any >B : A.B return aVal; diff --git a/tests/baselines/reference/es5ModuleWithModuleGenAmd.symbols b/tests/baselines/reference/es5ModuleWithModuleGenAmd.symbols new file mode 100644 index 00000000000..1a853eb37d0 --- /dev/null +++ b/tests/baselines/reference/es5ModuleWithModuleGenAmd.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/es5ModuleWithModuleGenAmd.ts === +export class A +>A : Symbol(A, Decl(es5ModuleWithModuleGenAmd.ts, 0, 0)) +{ + constructor () + { + } + + public B() +>B : Symbol(B, Decl(es5ModuleWithModuleGenAmd.ts, 4, 5)) + { + return 42; + } +} diff --git a/tests/baselines/reference/es5ModuleWithModuleGenAmd.types b/tests/baselines/reference/es5ModuleWithModuleGenAmd.types index e3453587a12..4ae6698d06a 100644 --- a/tests/baselines/reference/es5ModuleWithModuleGenAmd.types +++ b/tests/baselines/reference/es5ModuleWithModuleGenAmd.types @@ -10,5 +10,6 @@ export class A >B : () => number { return 42; +>42 : number } } diff --git a/tests/baselines/reference/es5ModuleWithModuleGenCommonjs.symbols b/tests/baselines/reference/es5ModuleWithModuleGenCommonjs.symbols new file mode 100644 index 00000000000..a69ce05f1ae --- /dev/null +++ b/tests/baselines/reference/es5ModuleWithModuleGenCommonjs.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/es5ModuleWithModuleGenCommonjs.ts === +export class A +>A : Symbol(A, Decl(es5ModuleWithModuleGenCommonjs.ts, 0, 0)) +{ + constructor () + { + } + + public B() +>B : Symbol(B, Decl(es5ModuleWithModuleGenCommonjs.ts, 4, 5)) + { + return 42; + } +} diff --git a/tests/baselines/reference/es5ModuleWithModuleGenCommonjs.types b/tests/baselines/reference/es5ModuleWithModuleGenCommonjs.types index 721df9afe58..425afed82d2 100644 --- a/tests/baselines/reference/es5ModuleWithModuleGenCommonjs.types +++ b/tests/baselines/reference/es5ModuleWithModuleGenCommonjs.types @@ -10,5 +10,6 @@ export class A >B : () => number { return 42; +>42 : number } } diff --git a/tests/baselines/reference/es6ClassSuperCodegenBug.symbols b/tests/baselines/reference/es6ClassSuperCodegenBug.symbols new file mode 100644 index 00000000000..d520ec3ceb1 --- /dev/null +++ b/tests/baselines/reference/es6ClassSuperCodegenBug.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/es6ClassSuperCodegenBug.ts === +class A { +>A : Symbol(A, Decl(es6ClassSuperCodegenBug.ts, 0, 0)) + + constructor(str1:string, str2:string) {} +>str1 : Symbol(str1, Decl(es6ClassSuperCodegenBug.ts, 1, 13)) +>str2 : Symbol(str2, Decl(es6ClassSuperCodegenBug.ts, 1, 25)) +} +class B extends A { +>B : Symbol(B, Decl(es6ClassSuperCodegenBug.ts, 2, 1)) +>A : Symbol(A, Decl(es6ClassSuperCodegenBug.ts, 0, 0)) + + constructor() { + if (true) { + super('a1', 'b1'); +>super : Symbol(A, Decl(es6ClassSuperCodegenBug.ts, 0, 0)) + + } else { + super('a2', 'b2'); +>super : Symbol(A, Decl(es6ClassSuperCodegenBug.ts, 0, 0)) + } + } +} + diff --git a/tests/baselines/reference/es6ClassSuperCodegenBug.types b/tests/baselines/reference/es6ClassSuperCodegenBug.types index 7b8a4abadfe..bdf8ebde8f2 100644 --- a/tests/baselines/reference/es6ClassSuperCodegenBug.types +++ b/tests/baselines/reference/es6ClassSuperCodegenBug.types @@ -12,14 +12,20 @@ class B extends A { constructor() { if (true) { +>true : boolean + super('a1', 'b1'); >super('a1', 'b1') : void >super : typeof A +>'a1' : string +>'b1' : string } else { super('a2', 'b2'); >super('a2', 'b2') : void >super : typeof A +>'a2' : string +>'b2' : string } } } diff --git a/tests/baselines/reference/es6ClassTest3.symbols b/tests/baselines/reference/es6ClassTest3.symbols new file mode 100644 index 00000000000..cf2284e95ee --- /dev/null +++ b/tests/baselines/reference/es6ClassTest3.symbols @@ -0,0 +1,35 @@ +=== tests/cases/compiler/es6ClassTest3.ts === +module M { +>M : Symbol(M, Decl(es6ClassTest3.ts, 0, 0)) + + class Visibility { +>Visibility : Symbol(Visibility, Decl(es6ClassTest3.ts, 0, 10)) + + public foo() { }; +>foo : Symbol(foo, Decl(es6ClassTest3.ts, 1, 19)) + + private bar() { }; +>bar : Symbol(bar, Decl(es6ClassTest3.ts, 2, 22)) + + private x: number; +>x : Symbol(x, Decl(es6ClassTest3.ts, 3, 23)) + + public y: number; +>y : Symbol(y, Decl(es6ClassTest3.ts, 4, 26)) + + public z: number; +>z : Symbol(z, Decl(es6ClassTest3.ts, 5, 22)) + + constructor() { + this.x = 1; +>this.x : Symbol(x, Decl(es6ClassTest3.ts, 3, 23)) +>this : Symbol(Visibility, Decl(es6ClassTest3.ts, 0, 10)) +>x : Symbol(x, Decl(es6ClassTest3.ts, 3, 23)) + + this.y = 2; +>this.y : Symbol(y, Decl(es6ClassTest3.ts, 4, 26)) +>this : Symbol(Visibility, Decl(es6ClassTest3.ts, 0, 10)) +>y : Symbol(y, Decl(es6ClassTest3.ts, 4, 26)) + } + } +} diff --git a/tests/baselines/reference/es6ClassTest3.types b/tests/baselines/reference/es6ClassTest3.types index ba0f2036f0e..d73007f211b 100644 --- a/tests/baselines/reference/es6ClassTest3.types +++ b/tests/baselines/reference/es6ClassTest3.types @@ -26,12 +26,14 @@ module M { >this.x : number >this : Visibility >x : number +>1 : number this.y = 2; >this.y = 2 : number >this.y : number >this : Visibility >y : number +>2 : number } } } diff --git a/tests/baselines/reference/es6ClassTest4.symbols b/tests/baselines/reference/es6ClassTest4.symbols new file mode 100644 index 00000000000..41a329a3d51 --- /dev/null +++ b/tests/baselines/reference/es6ClassTest4.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/es6ClassTest4.ts === +declare class Point +>Point : Symbol(Point, Decl(es6ClassTest4.ts, 0, 0)) +{ + x: number; +>x : Symbol(x, Decl(es6ClassTest4.ts, 1, 1)) + + y: number; +>y : Symbol(y, Decl(es6ClassTest4.ts, 2, 14)) + + add(dx: number, dy: number): Point; +>add : Symbol(add, Decl(es6ClassTest4.ts, 3, 14)) +>dx : Symbol(dx, Decl(es6ClassTest4.ts, 4, 8)) +>dy : Symbol(dy, Decl(es6ClassTest4.ts, 4, 19)) +>Point : Symbol(Point, Decl(es6ClassTest4.ts, 0, 0)) + + mult(p: Point): Point; +>mult : Symbol(mult, Decl(es6ClassTest4.ts, 4, 39)) +>p : Symbol(p, Decl(es6ClassTest4.ts, 5, 9)) +>Point : Symbol(Point, Decl(es6ClassTest4.ts, 0, 0)) +>Point : Symbol(Point, Decl(es6ClassTest4.ts, 0, 0)) + + static origin: Point; +>origin : Symbol(Point.origin, Decl(es6ClassTest4.ts, 5, 26)) +>Point : Symbol(Point, Decl(es6ClassTest4.ts, 0, 0)) + + constructor(x: number, y: number); +>x : Symbol(x, Decl(es6ClassTest4.ts, 7, 16)) +>y : Symbol(y, Decl(es6ClassTest4.ts, 7, 26)) +} + diff --git a/tests/baselines/reference/es6ClassTest5.symbols b/tests/baselines/reference/es6ClassTest5.symbols new file mode 100644 index 00000000000..89c6921e163 --- /dev/null +++ b/tests/baselines/reference/es6ClassTest5.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/es6ClassTest5.ts === +class C1T5 { +>C1T5 : Symbol(C1T5, Decl(es6ClassTest5.ts, 0, 0)) + + foo: (i: number, s: string) => number = +>foo : Symbol(foo, Decl(es6ClassTest5.ts, 0, 12)) +>i : Symbol(i, Decl(es6ClassTest5.ts, 1, 10)) +>s : Symbol(s, Decl(es6ClassTest5.ts, 1, 20)) + + (i) => { +>i : Symbol(i, Decl(es6ClassTest5.ts, 2, 6)) + + return i; +>i : Symbol(i, Decl(es6ClassTest5.ts, 2, 6)) + } +} +module C2T5 {} +>C2T5 : Symbol(C2T5, Decl(es6ClassTest5.ts, 5, 1)) + +class bigClass { +>bigClass : Symbol(bigClass, Decl(es6ClassTest5.ts, 6, 14)) + + public break = 1; +>break : Symbol(break, Decl(es6ClassTest5.ts, 8, 17)) +} + diff --git a/tests/baselines/reference/es6ClassTest5.types b/tests/baselines/reference/es6ClassTest5.types index e04be3e8c43..087a80170ed 100644 --- a/tests/baselines/reference/es6ClassTest5.types +++ b/tests/baselines/reference/es6ClassTest5.types @@ -16,12 +16,13 @@ class C1T5 { } } module C2T5 {} ->C2T5 : unknown +>C2T5 : any class bigClass { >bigClass : bigClass public break = 1; >break : number +>1 : number } diff --git a/tests/baselines/reference/es6ClassTest7.symbols b/tests/baselines/reference/es6ClassTest7.symbols new file mode 100644 index 00000000000..02ba6e43186 --- /dev/null +++ b/tests/baselines/reference/es6ClassTest7.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/es6ClassTest7.ts === +declare module M { +>M : Symbol(M, Decl(es6ClassTest7.ts, 0, 0)) + + export class Foo { +>Foo : Symbol(Foo, Decl(es6ClassTest7.ts, 0, 18)) + } +} + +class Bar extends M.Foo { +>Bar : Symbol(Bar, Decl(es6ClassTest7.ts, 3, 1)) +>M.Foo : Symbol(M.Foo, Decl(es6ClassTest7.ts, 0, 18)) +>M : Symbol(M, Decl(es6ClassTest7.ts, 0, 0)) +>Foo : Symbol(M.Foo, Decl(es6ClassTest7.ts, 0, 18)) +} + diff --git a/tests/baselines/reference/es6ClassTest7.types b/tests/baselines/reference/es6ClassTest7.types index 2ad5e88179c..f92ddad6e82 100644 --- a/tests/baselines/reference/es6ClassTest7.types +++ b/tests/baselines/reference/es6ClassTest7.types @@ -9,6 +9,7 @@ declare module M { class Bar extends M.Foo { >Bar : Bar +>M.Foo : any >M : typeof M >Foo : M.Foo } diff --git a/tests/baselines/reference/es6ClassTest8.symbols b/tests/baselines/reference/es6ClassTest8.symbols new file mode 100644 index 00000000000..b02b80e7017 --- /dev/null +++ b/tests/baselines/reference/es6ClassTest8.symbols @@ -0,0 +1,162 @@ +=== tests/cases/compiler/es6ClassTest8.ts === +function f1(x:any) {return x;} +>f1 : Symbol(f1, Decl(es6ClassTest8.ts, 0, 0)) +>x : Symbol(x, Decl(es6ClassTest8.ts, 0, 12)) +>x : Symbol(x, Decl(es6ClassTest8.ts, 0, 12)) + +class C { +>C : Symbol(C, Decl(es6ClassTest8.ts, 0, 30)) + + constructor() { + var bar:any = (function() { +>bar : Symbol(bar, Decl(es6ClassTest8.ts, 4, 11)) + + return bar; // 'bar' should be resolvable +>bar : Symbol(bar, Decl(es6ClassTest8.ts, 4, 11)) + + }); + var b = f1(f1(bar)); +>b : Symbol(b, Decl(es6ClassTest8.ts, 7, 11)) +>f1 : Symbol(f1, Decl(es6ClassTest8.ts, 0, 0)) +>f1 : Symbol(f1, Decl(es6ClassTest8.ts, 0, 0)) +>bar : Symbol(bar, Decl(es6ClassTest8.ts, 4, 11)) + } + +} + +class Vector { +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) + + static norm(v:Vector):Vector {return null;} +>norm : Symbol(Vector.norm, Decl(es6ClassTest8.ts, 12, 14)) +>v : Symbol(v, Decl(es6ClassTest8.ts, 13, 16)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) + + static minus(v1:Vector, v2:Vector):Vector {return null;} +>minus : Symbol(Vector.minus, Decl(es6ClassTest8.ts, 13, 47)) +>v1 : Symbol(v1, Decl(es6ClassTest8.ts, 14, 17)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>v2 : Symbol(v2, Decl(es6ClassTest8.ts, 14, 27)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) + + static times(v1:Vector, v2:Vector):Vector {return null;} +>times : Symbol(Vector.times, Decl(es6ClassTest8.ts, 14, 60)) +>v1 : Symbol(v1, Decl(es6ClassTest8.ts, 15, 17)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>v2 : Symbol(v2, Decl(es6ClassTest8.ts, 15, 27)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) + + static cross(v1:Vector, v2:Vector):Vector {return null;} +>cross : Symbol(Vector.cross, Decl(es6ClassTest8.ts, 15, 60)) +>v1 : Symbol(v1, Decl(es6ClassTest8.ts, 16, 17)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>v2 : Symbol(v2, Decl(es6ClassTest8.ts, 16, 27)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) + + constructor(public x: number, +>x : Symbol(x, Decl(es6ClassTest8.ts, 18, 16)) + + public y: number, +>y : Symbol(y, Decl(es6ClassTest8.ts, 18, 33)) + + public z: number) { +>z : Symbol(z, Decl(es6ClassTest8.ts, 19, 33)) + } + + static dot(v1:Vector, v2:Vector):Vector {return null;} +>dot : Symbol(Vector.dot, Decl(es6ClassTest8.ts, 21, 5)) +>v1 : Symbol(v1, Decl(es6ClassTest8.ts, 23, 15)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>v2 : Symbol(v2, Decl(es6ClassTest8.ts, 23, 25)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) + +} + +class Camera { +>Camera : Symbol(Camera, Decl(es6ClassTest8.ts, 25, 1)) + + public forward: Vector; +>forward : Symbol(forward, Decl(es6ClassTest8.ts, 27, 14)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) + + public right: Vector; +>right : Symbol(right, Decl(es6ClassTest8.ts, 28, 27)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) + + public up: Vector; +>up : Symbol(up, Decl(es6ClassTest8.ts, 29, 25)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) + + constructor(public pos: Vector, lookAt: Vector) { +>pos : Symbol(pos, Decl(es6ClassTest8.ts, 31, 16)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>lookAt : Symbol(lookAt, Decl(es6ClassTest8.ts, 31, 35)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) + + var down = new Vector(0.0, -1.0, 0.0); +>down : Symbol(down, Decl(es6ClassTest8.ts, 32, 11)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) + + this.forward = Vector.norm(Vector.minus(lookAt,this.pos)); +>this.forward : Symbol(forward, Decl(es6ClassTest8.ts, 27, 14)) +>this : Symbol(Camera, Decl(es6ClassTest8.ts, 25, 1)) +>forward : Symbol(forward, Decl(es6ClassTest8.ts, 27, 14)) +>Vector.norm : Symbol(Vector.norm, Decl(es6ClassTest8.ts, 12, 14)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>norm : Symbol(Vector.norm, Decl(es6ClassTest8.ts, 12, 14)) +>Vector.minus : Symbol(Vector.minus, Decl(es6ClassTest8.ts, 13, 47)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>minus : Symbol(Vector.minus, Decl(es6ClassTest8.ts, 13, 47)) +>lookAt : Symbol(lookAt, Decl(es6ClassTest8.ts, 31, 35)) +>this.pos : Symbol(pos, Decl(es6ClassTest8.ts, 31, 16)) +>this : Symbol(Camera, Decl(es6ClassTest8.ts, 25, 1)) +>pos : Symbol(pos, Decl(es6ClassTest8.ts, 31, 16)) + + this.right = Vector.times(down, Vector.norm(Vector.cross(this.forward, down))); +>this.right : Symbol(right, Decl(es6ClassTest8.ts, 28, 27)) +>this : Symbol(Camera, Decl(es6ClassTest8.ts, 25, 1)) +>right : Symbol(right, Decl(es6ClassTest8.ts, 28, 27)) +>Vector.times : Symbol(Vector.times, Decl(es6ClassTest8.ts, 14, 60)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>times : Symbol(Vector.times, Decl(es6ClassTest8.ts, 14, 60)) +>down : Symbol(down, Decl(es6ClassTest8.ts, 32, 11)) +>Vector.norm : Symbol(Vector.norm, Decl(es6ClassTest8.ts, 12, 14)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>norm : Symbol(Vector.norm, Decl(es6ClassTest8.ts, 12, 14)) +>Vector.cross : Symbol(Vector.cross, Decl(es6ClassTest8.ts, 15, 60)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>cross : Symbol(Vector.cross, Decl(es6ClassTest8.ts, 15, 60)) +>this.forward : Symbol(forward, Decl(es6ClassTest8.ts, 27, 14)) +>this : Symbol(Camera, Decl(es6ClassTest8.ts, 25, 1)) +>forward : Symbol(forward, Decl(es6ClassTest8.ts, 27, 14)) +>down : Symbol(down, Decl(es6ClassTest8.ts, 32, 11)) + + this.up = Vector.times(down, Vector.norm(Vector.cross(this.forward, this.right))); +>this.up : Symbol(up, Decl(es6ClassTest8.ts, 29, 25)) +>this : Symbol(Camera, Decl(es6ClassTest8.ts, 25, 1)) +>up : Symbol(up, Decl(es6ClassTest8.ts, 29, 25)) +>Vector.times : Symbol(Vector.times, Decl(es6ClassTest8.ts, 14, 60)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>times : Symbol(Vector.times, Decl(es6ClassTest8.ts, 14, 60)) +>down : Symbol(down, Decl(es6ClassTest8.ts, 32, 11)) +>Vector.norm : Symbol(Vector.norm, Decl(es6ClassTest8.ts, 12, 14)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>norm : Symbol(Vector.norm, Decl(es6ClassTest8.ts, 12, 14)) +>Vector.cross : Symbol(Vector.cross, Decl(es6ClassTest8.ts, 15, 60)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>cross : Symbol(Vector.cross, Decl(es6ClassTest8.ts, 15, 60)) +>this.forward : Symbol(forward, Decl(es6ClassTest8.ts, 27, 14)) +>this : Symbol(Camera, Decl(es6ClassTest8.ts, 25, 1)) +>forward : Symbol(forward, Decl(es6ClassTest8.ts, 27, 14)) +>this.right : Symbol(right, Decl(es6ClassTest8.ts, 28, 27)) +>this : Symbol(Camera, Decl(es6ClassTest8.ts, 25, 1)) +>right : Symbol(right, Decl(es6ClassTest8.ts, 28, 27)) + } +} + + diff --git a/tests/baselines/reference/es6ClassTest8.types b/tests/baselines/reference/es6ClassTest8.types index e5133c88d7e..622f81f1d10 100644 --- a/tests/baselines/reference/es6ClassTest8.types +++ b/tests/baselines/reference/es6ClassTest8.types @@ -36,6 +36,7 @@ class Vector { >v : Vector >Vector : Vector >Vector : Vector +>null : null static minus(v1:Vector, v2:Vector):Vector {return null;} >minus : (v1: Vector, v2: Vector) => Vector @@ -44,6 +45,7 @@ class Vector { >v2 : Vector >Vector : Vector >Vector : Vector +>null : null static times(v1:Vector, v2:Vector):Vector {return null;} >times : (v1: Vector, v2: Vector) => Vector @@ -52,6 +54,7 @@ class Vector { >v2 : Vector >Vector : Vector >Vector : Vector +>null : null static cross(v1:Vector, v2:Vector):Vector {return null;} >cross : (v1: Vector, v2: Vector) => Vector @@ -60,6 +63,7 @@ class Vector { >v2 : Vector >Vector : Vector >Vector : Vector +>null : null constructor(public x: number, >x : number @@ -78,6 +82,7 @@ class Vector { >v2 : Vector >Vector : Vector >Vector : Vector +>null : null } @@ -106,7 +111,10 @@ class Camera { >down : Vector >new Vector(0.0, -1.0, 0.0) : Vector >Vector : typeof Vector +>0.0 : number >-1.0 : number +>1.0 : number +>0.0 : number this.forward = Vector.norm(Vector.minus(lookAt,this.pos)); >this.forward = Vector.norm(Vector.minus(lookAt,this.pos)) : Vector diff --git a/tests/baselines/reference/es6ExportAll.symbols b/tests/baselines/reference/es6ExportAll.symbols new file mode 100644 index 00000000000..c2a575f5e5c --- /dev/null +++ b/tests/baselines/reference/es6ExportAll.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/server.ts === + +export class c { +>c : Symbol(c, Decl(server.ts, 0, 0)) +} +export interface i { +>i : Symbol(i, Decl(server.ts, 2, 1)) +} +export module m { +>m : Symbol(m, Decl(server.ts, 4, 1)) + + export var x = 10; +>x : Symbol(x, Decl(server.ts, 6, 14)) +} +export var x = 10; +>x : Symbol(x, Decl(server.ts, 8, 10)) + +export module uninstantiated { +>uninstantiated : Symbol(uninstantiated, Decl(server.ts, 8, 18)) +} + +=== tests/cases/compiler/client.ts === +export * from "server"; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/es6ExportAll.types b/tests/baselines/reference/es6ExportAll.types index 99e8fde9d40..876ff152e2c 100644 --- a/tests/baselines/reference/es6ExportAll.types +++ b/tests/baselines/reference/es6ExportAll.types @@ -11,12 +11,14 @@ export module m { export var x = 10; >x : number +>10 : number } export var x = 10; >x : number +>10 : number export module uninstantiated { ->uninstantiated : unknown +>uninstantiated : any } === tests/cases/compiler/client.ts === diff --git a/tests/baselines/reference/es6ExportAllInEs5.symbols b/tests/baselines/reference/es6ExportAllInEs5.symbols new file mode 100644 index 00000000000..c2a575f5e5c --- /dev/null +++ b/tests/baselines/reference/es6ExportAllInEs5.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/server.ts === + +export class c { +>c : Symbol(c, Decl(server.ts, 0, 0)) +} +export interface i { +>i : Symbol(i, Decl(server.ts, 2, 1)) +} +export module m { +>m : Symbol(m, Decl(server.ts, 4, 1)) + + export var x = 10; +>x : Symbol(x, Decl(server.ts, 6, 14)) +} +export var x = 10; +>x : Symbol(x, Decl(server.ts, 8, 10)) + +export module uninstantiated { +>uninstantiated : Symbol(uninstantiated, Decl(server.ts, 8, 18)) +} + +=== tests/cases/compiler/client.ts === +export * from "server"; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/es6ExportAllInEs5.types b/tests/baselines/reference/es6ExportAllInEs5.types index 99e8fde9d40..876ff152e2c 100644 --- a/tests/baselines/reference/es6ExportAllInEs5.types +++ b/tests/baselines/reference/es6ExportAllInEs5.types @@ -11,12 +11,14 @@ export module m { export var x = 10; >x : number +>10 : number } export var x = 10; >x : number +>10 : number export module uninstantiated { ->uninstantiated : unknown +>uninstantiated : any } === tests/cases/compiler/client.ts === diff --git a/tests/baselines/reference/es6ExportClause.symbols b/tests/baselines/reference/es6ExportClause.symbols new file mode 100644 index 00000000000..fe4de21a00f --- /dev/null +++ b/tests/baselines/reference/es6ExportClause.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/es6ExportClause.ts === + +class c { +>c : Symbol(c, Decl(es6ExportClause.ts, 0, 0)) +} +interface i { +>i : Symbol(i, Decl(es6ExportClause.ts, 2, 1)) +} +module m { +>m : Symbol(m, Decl(es6ExportClause.ts, 4, 1)) + + export var x = 10; +>x : Symbol(x, Decl(es6ExportClause.ts, 6, 14)) +} +var x = 10; +>x : Symbol(x, Decl(es6ExportClause.ts, 8, 3)) + +module uninstantiated { +>uninstantiated : Symbol(uninstantiated, Decl(es6ExportClause.ts, 8, 11)) +} +export { c }; +>c : Symbol(c, Decl(es6ExportClause.ts, 11, 8)) + +export { c as c2 }; +>c : Symbol(c2, Decl(es6ExportClause.ts, 12, 8)) +>c2 : Symbol(c2, Decl(es6ExportClause.ts, 12, 8)) + +export { i, m as instantiatedModule }; +>i : Symbol(i, Decl(es6ExportClause.ts, 13, 8)) +>m : Symbol(instantiatedModule, Decl(es6ExportClause.ts, 13, 11)) +>instantiatedModule : Symbol(instantiatedModule, Decl(es6ExportClause.ts, 13, 11)) + +export { uninstantiated }; +>uninstantiated : Symbol(uninstantiated, Decl(es6ExportClause.ts, 14, 8)) + +export { x }; +>x : Symbol(x, Decl(es6ExportClause.ts, 15, 8)) + diff --git a/tests/baselines/reference/es6ExportClause.types b/tests/baselines/reference/es6ExportClause.types index 24b9859e0e8..b0d544201a4 100644 --- a/tests/baselines/reference/es6ExportClause.types +++ b/tests/baselines/reference/es6ExportClause.types @@ -11,12 +11,14 @@ module m { export var x = 10; >x : number +>10 : number } var x = 10; >x : number +>10 : number module uninstantiated { ->uninstantiated : unknown +>uninstantiated : any } export { c }; >c : typeof c @@ -26,12 +28,12 @@ export { c as c2 }; >c2 : typeof c export { i, m as instantiatedModule }; ->i : unknown +>i : any >m : typeof m >instantiatedModule : typeof m export { uninstantiated }; ->uninstantiated : unknown +>uninstantiated : any export { x }; >x : number diff --git a/tests/baselines/reference/es6ExportClauseInEs5.symbols b/tests/baselines/reference/es6ExportClauseInEs5.symbols new file mode 100644 index 00000000000..5590b907eec --- /dev/null +++ b/tests/baselines/reference/es6ExportClauseInEs5.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/es6ExportClauseInEs5.ts === + +class c { +>c : Symbol(c, Decl(es6ExportClauseInEs5.ts, 0, 0)) +} +interface i { +>i : Symbol(i, Decl(es6ExportClauseInEs5.ts, 2, 1)) +} +module m { +>m : Symbol(m, Decl(es6ExportClauseInEs5.ts, 4, 1)) + + export var x = 10; +>x : Symbol(x, Decl(es6ExportClauseInEs5.ts, 6, 14)) +} +var x = 10; +>x : Symbol(x, Decl(es6ExportClauseInEs5.ts, 8, 3)) + +module uninstantiated { +>uninstantiated : Symbol(uninstantiated, Decl(es6ExportClauseInEs5.ts, 8, 11)) +} +export { c }; +>c : Symbol(c, Decl(es6ExportClauseInEs5.ts, 11, 8)) + +export { c as c2 }; +>c : Symbol(c2, Decl(es6ExportClauseInEs5.ts, 12, 8)) +>c2 : Symbol(c2, Decl(es6ExportClauseInEs5.ts, 12, 8)) + +export { i, m as instantiatedModule }; +>i : Symbol(i, Decl(es6ExportClauseInEs5.ts, 13, 8)) +>m : Symbol(instantiatedModule, Decl(es6ExportClauseInEs5.ts, 13, 11)) +>instantiatedModule : Symbol(instantiatedModule, Decl(es6ExportClauseInEs5.ts, 13, 11)) + +export { uninstantiated }; +>uninstantiated : Symbol(uninstantiated, Decl(es6ExportClauseInEs5.ts, 14, 8)) + +export { x }; +>x : Symbol(x, Decl(es6ExportClauseInEs5.ts, 15, 8)) + diff --git a/tests/baselines/reference/es6ExportClauseInEs5.types b/tests/baselines/reference/es6ExportClauseInEs5.types index 8caedfa5ceb..c6ef9033bf1 100644 --- a/tests/baselines/reference/es6ExportClauseInEs5.types +++ b/tests/baselines/reference/es6ExportClauseInEs5.types @@ -11,12 +11,14 @@ module m { export var x = 10; >x : number +>10 : number } var x = 10; >x : number +>10 : number module uninstantiated { ->uninstantiated : unknown +>uninstantiated : any } export { c }; >c : typeof c @@ -26,12 +28,12 @@ export { c as c2 }; >c2 : typeof c export { i, m as instantiatedModule }; ->i : unknown +>i : any >m : typeof m >instantiatedModule : typeof m export { uninstantiated }; ->uninstantiated : unknown +>uninstantiated : any export { x }; >x : number diff --git a/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.symbols b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.symbols new file mode 100644 index 00000000000..731a0fdcc30 --- /dev/null +++ b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.symbols @@ -0,0 +1,40 @@ +=== tests/cases/compiler/server.ts === + +export class c { +>c : Symbol(c, Decl(server.ts, 0, 0)) +} +export interface i { +>i : Symbol(i, Decl(server.ts, 2, 1)) +} +export module m { +>m : Symbol(m, Decl(server.ts, 4, 1)) + + export var x = 10; +>x : Symbol(x, Decl(server.ts, 6, 14)) +} +export var x = 10; +>x : Symbol(x, Decl(server.ts, 8, 10)) + +export module uninstantiated { +>uninstantiated : Symbol(uninstantiated, Decl(server.ts, 8, 18)) +} + +=== tests/cases/compiler/client.ts === +export { c } from "server"; +>c : Symbol(c, Decl(client.ts, 0, 8)) + +export { c as c2 } from "server"; +>c : Symbol(c2, Decl(client.ts, 1, 8)) +>c2 : Symbol(c2, Decl(client.ts, 1, 8)) + +export { i, m as instantiatedModule } from "server"; +>i : Symbol(i, Decl(client.ts, 2, 8)) +>m : Symbol(instantiatedModule, Decl(client.ts, 2, 11)) +>instantiatedModule : Symbol(instantiatedModule, Decl(client.ts, 2, 11)) + +export { uninstantiated } from "server"; +>uninstantiated : Symbol(uninstantiated, Decl(client.ts, 3, 8)) + +export { x } from "server"; +>x : Symbol(x, Decl(client.ts, 4, 8)) + diff --git a/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.types b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.types index c0087dccd94..9d87ec9925d 100644 --- a/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.types +++ b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.types @@ -11,12 +11,14 @@ export module m { export var x = 10; >x : number +>10 : number } export var x = 10; >x : number +>10 : number export module uninstantiated { ->uninstantiated : unknown +>uninstantiated : any } === tests/cases/compiler/client.ts === @@ -28,12 +30,12 @@ export { c as c2 } from "server"; >c2 : typeof c export { i, m as instantiatedModule } from "server"; ->i : unknown +>i : any >m : typeof instantiatedModule >instantiatedModule : typeof instantiatedModule export { uninstantiated } from "server"; ->uninstantiated : unknown +>uninstantiated : any export { x } from "server"; >x : number diff --git a/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.symbols b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.symbols new file mode 100644 index 00000000000..731a0fdcc30 --- /dev/null +++ b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.symbols @@ -0,0 +1,40 @@ +=== tests/cases/compiler/server.ts === + +export class c { +>c : Symbol(c, Decl(server.ts, 0, 0)) +} +export interface i { +>i : Symbol(i, Decl(server.ts, 2, 1)) +} +export module m { +>m : Symbol(m, Decl(server.ts, 4, 1)) + + export var x = 10; +>x : Symbol(x, Decl(server.ts, 6, 14)) +} +export var x = 10; +>x : Symbol(x, Decl(server.ts, 8, 10)) + +export module uninstantiated { +>uninstantiated : Symbol(uninstantiated, Decl(server.ts, 8, 18)) +} + +=== tests/cases/compiler/client.ts === +export { c } from "server"; +>c : Symbol(c, Decl(client.ts, 0, 8)) + +export { c as c2 } from "server"; +>c : Symbol(c2, Decl(client.ts, 1, 8)) +>c2 : Symbol(c2, Decl(client.ts, 1, 8)) + +export { i, m as instantiatedModule } from "server"; +>i : Symbol(i, Decl(client.ts, 2, 8)) +>m : Symbol(instantiatedModule, Decl(client.ts, 2, 11)) +>instantiatedModule : Symbol(instantiatedModule, Decl(client.ts, 2, 11)) + +export { uninstantiated } from "server"; +>uninstantiated : Symbol(uninstantiated, Decl(client.ts, 3, 8)) + +export { x } from "server"; +>x : Symbol(x, Decl(client.ts, 4, 8)) + diff --git a/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.types b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.types index c0087dccd94..9d87ec9925d 100644 --- a/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.types +++ b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.types @@ -11,12 +11,14 @@ export module m { export var x = 10; >x : number +>10 : number } export var x = 10; >x : number +>10 : number export module uninstantiated { ->uninstantiated : unknown +>uninstantiated : any } === tests/cases/compiler/client.ts === @@ -28,12 +30,12 @@ export { c as c2 } from "server"; >c2 : typeof c export { i, m as instantiatedModule } from "server"; ->i : unknown +>i : any >m : typeof instantiatedModule >instantiatedModule : typeof instantiatedModule export { uninstantiated } from "server"; ->uninstantiated : unknown +>uninstantiated : any export { x } from "server"; >x : number diff --git a/tests/baselines/reference/es6ExportDefaultClassDeclaration.symbols b/tests/baselines/reference/es6ExportDefaultClassDeclaration.symbols new file mode 100644 index 00000000000..02aa5575190 --- /dev/null +++ b/tests/baselines/reference/es6ExportDefaultClassDeclaration.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/es6ExportDefaultClassDeclaration.ts === + +export default class C { +>C : Symbol(C, Decl(es6ExportDefaultClassDeclaration.ts, 0, 0)) + + method() { } +>method : Symbol(method, Decl(es6ExportDefaultClassDeclaration.ts, 1, 24)) +} + diff --git a/tests/baselines/reference/es6ExportDefaultClassDeclaration2.symbols b/tests/baselines/reference/es6ExportDefaultClassDeclaration2.symbols new file mode 100644 index 00000000000..168c402d3e4 --- /dev/null +++ b/tests/baselines/reference/es6ExportDefaultClassDeclaration2.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/es6ExportDefaultClassDeclaration2.ts === + +export default class { + method() { } +>method : Symbol(method, Decl(es6ExportDefaultClassDeclaration2.ts, 1, 22)) +} + diff --git a/tests/baselines/reference/es6ExportDefaultExpression.js b/tests/baselines/reference/es6ExportDefaultExpression.js index 322e09bc46f..100182b9f28 100644 --- a/tests/baselines/reference/es6ExportDefaultExpression.js +++ b/tests/baselines/reference/es6ExportDefaultExpression.js @@ -8,4 +8,5 @@ export default (1 + 2); //// [es6ExportDefaultExpression.d.ts] -export default : number; +declare var _default: number; +export default _default; diff --git a/tests/baselines/reference/es6ExportDefaultExpression.symbols b/tests/baselines/reference/es6ExportDefaultExpression.symbols new file mode 100644 index 00000000000..f80acc12900 --- /dev/null +++ b/tests/baselines/reference/es6ExportDefaultExpression.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/es6ExportDefaultExpression.ts === + +No type information for this code.export default (1 + 2); +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/es6ExportDefaultExpression.types b/tests/baselines/reference/es6ExportDefaultExpression.types index 3b056b8d9f9..6f7665c2800 100644 --- a/tests/baselines/reference/es6ExportDefaultExpression.types +++ b/tests/baselines/reference/es6ExportDefaultExpression.types @@ -3,4 +3,6 @@ export default (1 + 2); >(1 + 2) : number >1 + 2 : number +>1 : number +>2 : number diff --git a/tests/baselines/reference/es6ExportDefaultFunctionDeclaration.symbols b/tests/baselines/reference/es6ExportDefaultFunctionDeclaration.symbols new file mode 100644 index 00000000000..4050ac97545 --- /dev/null +++ b/tests/baselines/reference/es6ExportDefaultFunctionDeclaration.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/es6ExportDefaultFunctionDeclaration.ts === + +export default function f() { } +>f : Symbol(f, Decl(es6ExportDefaultFunctionDeclaration.ts, 0, 0)) + diff --git a/tests/baselines/reference/es6ExportDefaultFunctionDeclaration2.symbols b/tests/baselines/reference/es6ExportDefaultFunctionDeclaration2.symbols new file mode 100644 index 00000000000..3cb2fc9b1cd --- /dev/null +++ b/tests/baselines/reference/es6ExportDefaultFunctionDeclaration2.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/es6ExportDefaultFunctionDeclaration2.ts === + +No type information for this code.export default function () { } +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/es6ExportDefaultIdentifier.symbols b/tests/baselines/reference/es6ExportDefaultIdentifier.symbols new file mode 100644 index 00000000000..29b932aaeda --- /dev/null +++ b/tests/baselines/reference/es6ExportDefaultIdentifier.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/es6ExportDefaultIdentifier.ts === + +export function f() { } +>f : Symbol(f, Decl(es6ExportDefaultIdentifier.ts, 0, 0)) + +export default f; +>f : Symbol(f, Decl(es6ExportDefaultIdentifier.ts, 0, 0)) + diff --git a/tests/baselines/reference/es6ImportDefaultBinding.symbols b/tests/baselines/reference/es6ImportDefaultBinding.symbols new file mode 100644 index 00000000000..d1e76d7075a --- /dev/null +++ b/tests/baselines/reference/es6ImportDefaultBinding.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/es6ImportDefaultBinding_0.ts === + +var a = 10; +>a : Symbol(a, Decl(es6ImportDefaultBinding_0.ts, 1, 3)) + +export default a; +>a : Symbol(a, Decl(es6ImportDefaultBinding_0.ts, 1, 3)) + +=== tests/cases/compiler/es6ImportDefaultBinding_1.ts === +import defaultBinding from "es6ImportDefaultBinding_0"; +>defaultBinding : Symbol(defaultBinding, Decl(es6ImportDefaultBinding_1.ts, 0, 6)) + +var x = defaultBinding; +>x : Symbol(x, Decl(es6ImportDefaultBinding_1.ts, 1, 3)) +>defaultBinding : Symbol(defaultBinding, Decl(es6ImportDefaultBinding_1.ts, 0, 6)) + +import defaultBinding2 from "es6ImportDefaultBinding_0"; // elide this import since defaultBinding2 is not used +>defaultBinding2 : Symbol(defaultBinding2, Decl(es6ImportDefaultBinding_1.ts, 2, 6)) + diff --git a/tests/baselines/reference/es6ImportDefaultBinding.types b/tests/baselines/reference/es6ImportDefaultBinding.types index 13504101a2c..6aa71ddf6ff 100644 --- a/tests/baselines/reference/es6ImportDefaultBinding.types +++ b/tests/baselines/reference/es6ImportDefaultBinding.types @@ -2,6 +2,7 @@ var a = 10; >a : number +>10 : number export default a; >a : number diff --git a/tests/baselines/reference/es6ImportDefaultBindingAmd.symbols b/tests/baselines/reference/es6ImportDefaultBindingAmd.symbols new file mode 100644 index 00000000000..cab731104bd --- /dev/null +++ b/tests/baselines/reference/es6ImportDefaultBindingAmd.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/es6ImportDefaultBindingAmd_0.ts === + +var a = 10; +>a : Symbol(a, Decl(es6ImportDefaultBindingAmd_0.ts, 1, 3)) + +export default a; +>a : Symbol(a, Decl(es6ImportDefaultBindingAmd_0.ts, 1, 3)) + +=== tests/cases/compiler/es6ImportDefaultBindingAmd_1.ts === +import defaultBinding from "es6ImportDefaultBindingAmd_0"; +>defaultBinding : Symbol(defaultBinding, Decl(es6ImportDefaultBindingAmd_1.ts, 0, 6)) + +var x = defaultBinding; +>x : Symbol(x, Decl(es6ImportDefaultBindingAmd_1.ts, 1, 3)) +>defaultBinding : Symbol(defaultBinding, Decl(es6ImportDefaultBindingAmd_1.ts, 0, 6)) + +import defaultBinding2 from "es6ImportDefaultBindingAmd_0"; // elide this import since defaultBinding2 is not used +>defaultBinding2 : Symbol(defaultBinding2, Decl(es6ImportDefaultBindingAmd_1.ts, 2, 6)) + diff --git a/tests/baselines/reference/es6ImportDefaultBindingAmd.types b/tests/baselines/reference/es6ImportDefaultBindingAmd.types index 323ed557d8b..740ff2c0e14 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingAmd.types +++ b/tests/baselines/reference/es6ImportDefaultBindingAmd.types @@ -2,6 +2,7 @@ var a = 10; >a : number +>10 : number export default a; >a : number diff --git a/tests/baselines/reference/es6ImportDefaultBindingDts.symbols b/tests/baselines/reference/es6ImportDefaultBindingDts.symbols new file mode 100644 index 00000000000..1ca93aa6641 --- /dev/null +++ b/tests/baselines/reference/es6ImportDefaultBindingDts.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/server.ts === + +class c { } +>c : Symbol(c, Decl(server.ts, 0, 0)) + +export default c; +>c : Symbol(c, Decl(server.ts, 0, 0)) + +=== tests/cases/compiler/client.ts === +import defaultBinding from "server"; +>defaultBinding : Symbol(defaultBinding, Decl(client.ts, 0, 6)) + +export var x = new defaultBinding(); +>x : Symbol(x, Decl(client.ts, 1, 10)) +>defaultBinding : Symbol(defaultBinding, Decl(client.ts, 0, 6)) + +import defaultBinding2 from "server"; // elide this import since defaultBinding2 is not used +>defaultBinding2 : Symbol(defaultBinding2, Decl(client.ts, 2, 6)) + diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.js b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.js index eef23579212..641941db9e5 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.js +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.js @@ -45,5 +45,6 @@ var x1 = m; export declare var a: number; export declare var x: number; export declare var m: number; -export default : {}; +declare var _default: {}; +export default _default; //// [es6ImportDefaultBindingFollowedWithNamedImport_1.d.ts] diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportWithExport.js b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportWithExport.js index 0d5f38c0be4..90521007735 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportWithExport.js +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportWithExport.js @@ -44,7 +44,8 @@ define(["require", "exports", "server", "server", "server", "server", "server"], export declare var a: number; export declare var x: number; export declare var m: number; -export default : {}; +declare var _default: {}; +export default _default; //// [client.d.ts] export declare var x1: number; export declare var x1: number; diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1.symbols b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1.symbols new file mode 100644 index 00000000000..a62cdfec873 --- /dev/null +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding_0.ts === + +var a = 10; +>a : Symbol(a, Decl(es6ImportDefaultBindingFollowedWithNamespaceBinding_0.ts, 1, 3)) + +export default a; +>a : Symbol(a, Decl(es6ImportDefaultBindingFollowedWithNamespaceBinding_0.ts, 1, 3)) + +=== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding_1.ts === +import defaultBinding, * as nameSpaceBinding from "es6ImportDefaultBindingFollowedWithNamespaceBinding_0"; +>defaultBinding : Symbol(defaultBinding, Decl(es6ImportDefaultBindingFollowedWithNamespaceBinding_1.ts, 0, 6)) +>nameSpaceBinding : Symbol(nameSpaceBinding, Decl(es6ImportDefaultBindingFollowedWithNamespaceBinding_1.ts, 0, 22)) + +var x: number = defaultBinding; +>x : Symbol(x, Decl(es6ImportDefaultBindingFollowedWithNamespaceBinding_1.ts, 1, 3)) +>defaultBinding : Symbol(defaultBinding, Decl(es6ImportDefaultBindingFollowedWithNamespaceBinding_1.ts, 0, 6)) + diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1.types b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1.types index c0c3f891c9e..6d3f015c783 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1.types +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1.types @@ -2,6 +2,7 @@ var a = 10; >a : number +>10 : number export default a; >a : number diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1InEs5.symbols b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1InEs5.symbols new file mode 100644 index 00000000000..d4a9c289e60 --- /dev/null +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1InEs5.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_0.ts === + +var a = 10; +>a : Symbol(a, Decl(es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_0.ts, 1, 3)) + +export default a; +>a : Symbol(a, Decl(es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_0.ts, 1, 3)) + +=== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_1.ts === +import defaultBinding, * as nameSpaceBinding from "es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_0"; +>defaultBinding : Symbol(defaultBinding, Decl(es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_1.ts, 0, 6)) +>nameSpaceBinding : Symbol(nameSpaceBinding, Decl(es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_1.ts, 0, 22)) + +var x: number = defaultBinding; +>x : Symbol(x, Decl(es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_1.ts, 1, 3)) +>defaultBinding : Symbol(defaultBinding, Decl(es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_1.ts, 0, 6)) + diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1InEs5.types b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1InEs5.types index ad2b865bc01..4a05b57e304 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1InEs5.types +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1InEs5.types @@ -2,6 +2,7 @@ var a = 10; >a : number +>10 : number export default a; >a : number diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingDts1.symbols b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingDts1.symbols new file mode 100644 index 00000000000..28f1e4cc4d7 --- /dev/null +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingDts1.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/server.ts === + +class a { } +>a : Symbol(a, Decl(server.ts, 0, 0)) + +export default a; +>a : Symbol(a, Decl(server.ts, 0, 0)) + +=== tests/cases/compiler/client.ts === +import defaultBinding, * as nameSpaceBinding from "server"; +>defaultBinding : Symbol(defaultBinding, Decl(client.ts, 0, 6)) +>nameSpaceBinding : Symbol(nameSpaceBinding, Decl(client.ts, 0, 22)) + +export var x = new defaultBinding(); +>x : Symbol(x, Decl(client.ts, 1, 10)) +>defaultBinding : Symbol(defaultBinding, Decl(client.ts, 0, 6)) + diff --git a/tests/baselines/reference/es6ImportNameSpaceImportAmd.symbols b/tests/baselines/reference/es6ImportNameSpaceImportAmd.symbols new file mode 100644 index 00000000000..24c67cd6f47 --- /dev/null +++ b/tests/baselines/reference/es6ImportNameSpaceImportAmd.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/es6ImportNameSpaceImportAmd_0.ts === + +export var a = 10; +>a : Symbol(a, Decl(es6ImportNameSpaceImportAmd_0.ts, 1, 10)) + +=== tests/cases/compiler/es6ImportNameSpaceImportAmd_1.ts === +import * as nameSpaceBinding from "es6ImportNameSpaceImportAmd_0"; +>nameSpaceBinding : Symbol(nameSpaceBinding, Decl(es6ImportNameSpaceImportAmd_1.ts, 0, 6)) + +var x = nameSpaceBinding.a; +>x : Symbol(x, Decl(es6ImportNameSpaceImportAmd_1.ts, 1, 3)) +>nameSpaceBinding.a : Symbol(nameSpaceBinding.a, Decl(es6ImportNameSpaceImportAmd_0.ts, 1, 10)) +>nameSpaceBinding : Symbol(nameSpaceBinding, Decl(es6ImportNameSpaceImportAmd_1.ts, 0, 6)) +>a : Symbol(nameSpaceBinding.a, Decl(es6ImportNameSpaceImportAmd_0.ts, 1, 10)) + +import * as nameSpaceBinding2 from "es6ImportNameSpaceImportAmd_0"; // elide this +>nameSpaceBinding2 : Symbol(nameSpaceBinding2, Decl(es6ImportNameSpaceImportAmd_1.ts, 2, 6)) + diff --git a/tests/baselines/reference/es6ImportNameSpaceImportAmd.types b/tests/baselines/reference/es6ImportNameSpaceImportAmd.types index 623a7e8e160..beb6860c73e 100644 --- a/tests/baselines/reference/es6ImportNameSpaceImportAmd.types +++ b/tests/baselines/reference/es6ImportNameSpaceImportAmd.types @@ -2,6 +2,7 @@ export var a = 10; >a : number +>10 : number === tests/cases/compiler/es6ImportNameSpaceImportAmd_1.ts === import * as nameSpaceBinding from "es6ImportNameSpaceImportAmd_0"; diff --git a/tests/baselines/reference/es6ImportNameSpaceImportDts.symbols b/tests/baselines/reference/es6ImportNameSpaceImportDts.symbols new file mode 100644 index 00000000000..8104cbcce50 --- /dev/null +++ b/tests/baselines/reference/es6ImportNameSpaceImportDts.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/server.ts === + +export class c { }; +>c : Symbol(c, Decl(server.ts, 0, 0)) + +=== tests/cases/compiler/client.ts === +import * as nameSpaceBinding from "server"; +>nameSpaceBinding : Symbol(nameSpaceBinding, Decl(client.ts, 0, 6)) + +export var x = new nameSpaceBinding.c(); +>x : Symbol(x, Decl(client.ts, 1, 10)) +>nameSpaceBinding.c : Symbol(nameSpaceBinding.c, Decl(server.ts, 0, 0)) +>nameSpaceBinding : Symbol(nameSpaceBinding, Decl(client.ts, 0, 6)) +>c : Symbol(nameSpaceBinding.c, Decl(server.ts, 0, 0)) + +import * as nameSpaceBinding2 from "server"; // unreferenced +>nameSpaceBinding2 : Symbol(nameSpaceBinding2, Decl(client.ts, 2, 6)) + diff --git a/tests/baselines/reference/es6ImportNameSpaceImportInEs5.symbols b/tests/baselines/reference/es6ImportNameSpaceImportInEs5.symbols new file mode 100644 index 00000000000..119787de817 --- /dev/null +++ b/tests/baselines/reference/es6ImportNameSpaceImportInEs5.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/es6ImportNameSpaceImportInEs5_0.ts === + +export var a = 10; +>a : Symbol(a, Decl(es6ImportNameSpaceImportInEs5_0.ts, 1, 10)) + +=== tests/cases/compiler/es6ImportNameSpaceImportInEs5_1.ts === +import * as nameSpaceBinding from "es6ImportNameSpaceImportInEs5_0"; +>nameSpaceBinding : Symbol(nameSpaceBinding, Decl(es6ImportNameSpaceImportInEs5_1.ts, 0, 6)) + +var x = nameSpaceBinding.a; +>x : Symbol(x, Decl(es6ImportNameSpaceImportInEs5_1.ts, 1, 3)) +>nameSpaceBinding.a : Symbol(nameSpaceBinding.a, Decl(es6ImportNameSpaceImportInEs5_0.ts, 1, 10)) +>nameSpaceBinding : Symbol(nameSpaceBinding, Decl(es6ImportNameSpaceImportInEs5_1.ts, 0, 6)) +>a : Symbol(nameSpaceBinding.a, Decl(es6ImportNameSpaceImportInEs5_0.ts, 1, 10)) + +import * as nameSpaceBinding2 from "es6ImportNameSpaceImportInEs5_0"; // elide this +>nameSpaceBinding2 : Symbol(nameSpaceBinding2, Decl(es6ImportNameSpaceImportInEs5_1.ts, 2, 6)) + diff --git a/tests/baselines/reference/es6ImportNameSpaceImportInEs5.types b/tests/baselines/reference/es6ImportNameSpaceImportInEs5.types index 6ba725f2494..01531cd233d 100644 --- a/tests/baselines/reference/es6ImportNameSpaceImportInEs5.types +++ b/tests/baselines/reference/es6ImportNameSpaceImportInEs5.types @@ -2,6 +2,7 @@ export var a = 10; >a : number +>10 : number === tests/cases/compiler/es6ImportNameSpaceImportInEs5_1.ts === import * as nameSpaceBinding from "es6ImportNameSpaceImportInEs5_0"; diff --git a/tests/baselines/reference/es6ImportNameSpaceImportNoNamedExports.symbols b/tests/baselines/reference/es6ImportNameSpaceImportNoNamedExports.symbols new file mode 100644 index 00000000000..6a443d1fa00 --- /dev/null +++ b/tests/baselines/reference/es6ImportNameSpaceImportNoNamedExports.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/es6ImportNameSpaceImportNoNamedExports_0.ts === + +var a = 10; +>a : Symbol(a, Decl(es6ImportNameSpaceImportNoNamedExports_0.ts, 1, 3)) + +export = a; +>a : Symbol(a, Decl(es6ImportNameSpaceImportNoNamedExports_0.ts, 1, 3)) + +=== tests/cases/compiler/es6ImportNameSpaceImportNoNamedExports_1.ts === +import * as nameSpaceBinding from "es6ImportNameSpaceImportNoNamedExports_0"; // error +>nameSpaceBinding : Symbol(nameSpaceBinding, Decl(es6ImportNameSpaceImportNoNamedExports_1.ts, 0, 6)) + diff --git a/tests/baselines/reference/es6ImportNameSpaceImportNoNamedExports.types b/tests/baselines/reference/es6ImportNameSpaceImportNoNamedExports.types index e1f2e89bbd8..2cc4844dd42 100644 --- a/tests/baselines/reference/es6ImportNameSpaceImportNoNamedExports.types +++ b/tests/baselines/reference/es6ImportNameSpaceImportNoNamedExports.types @@ -2,6 +2,7 @@ var a = 10; >a : number +>10 : number export = a; >a : number diff --git a/tests/baselines/reference/es6ImportNamedImportAmd.symbols b/tests/baselines/reference/es6ImportNamedImportAmd.symbols new file mode 100644 index 00000000000..2feaf603f40 --- /dev/null +++ b/tests/baselines/reference/es6ImportNamedImportAmd.symbols @@ -0,0 +1,123 @@ +=== tests/cases/compiler/es6ImportNamedImportAmd_0.ts === + +export var a = 10; +>a : Symbol(a, Decl(es6ImportNamedImportAmd_0.ts, 1, 10)) + +export var x = a; +>x : Symbol(x, Decl(es6ImportNamedImportAmd_0.ts, 2, 10)) +>a : Symbol(a, Decl(es6ImportNamedImportAmd_0.ts, 1, 10)) + +export var m = a; +>m : Symbol(m, Decl(es6ImportNamedImportAmd_0.ts, 3, 10)) +>a : Symbol(a, Decl(es6ImportNamedImportAmd_0.ts, 1, 10)) + +export var a1 = 10; +>a1 : Symbol(a1, Decl(es6ImportNamedImportAmd_0.ts, 4, 10)) + +export var x1 = 10; +>x1 : Symbol(x1, Decl(es6ImportNamedImportAmd_0.ts, 5, 10)) + +export var z1 = 10; +>z1 : Symbol(z1, Decl(es6ImportNamedImportAmd_0.ts, 6, 10)) + +export var z2 = 10; +>z2 : Symbol(z2, Decl(es6ImportNamedImportAmd_0.ts, 7, 10)) + +export var aaaa = 10; +>aaaa : Symbol(aaaa, Decl(es6ImportNamedImportAmd_0.ts, 8, 10)) + +=== tests/cases/compiler/es6ImportNamedImportAmd_1.ts === +import { } from "es6ImportNamedImportAmd_0"; +import { a } from "es6ImportNamedImportAmd_0"; +>a : Symbol(a, Decl(es6ImportNamedImportAmd_1.ts, 1, 8)) + +var xxxx = a; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportAmd_1.ts, 2, 3), Decl(es6ImportNamedImportAmd_1.ts, 4, 3), Decl(es6ImportNamedImportAmd_1.ts, 6, 3), Decl(es6ImportNamedImportAmd_1.ts, 7, 3), Decl(es6ImportNamedImportAmd_1.ts, 9, 3), Decl(es6ImportNamedImportAmd_1.ts, 11, 3), Decl(es6ImportNamedImportAmd_1.ts, 13, 3), Decl(es6ImportNamedImportAmd_1.ts, 14, 3), Decl(es6ImportNamedImportAmd_1.ts, 16, 3), Decl(es6ImportNamedImportAmd_1.ts, 17, 3)) +>a : Symbol(a, Decl(es6ImportNamedImportAmd_1.ts, 1, 8)) + +import { a as b } from "es6ImportNamedImportAmd_0"; +>a : Symbol(b, Decl(es6ImportNamedImportAmd_1.ts, 3, 8)) +>b : Symbol(b, Decl(es6ImportNamedImportAmd_1.ts, 3, 8)) + +var xxxx = b; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportAmd_1.ts, 2, 3), Decl(es6ImportNamedImportAmd_1.ts, 4, 3), Decl(es6ImportNamedImportAmd_1.ts, 6, 3), Decl(es6ImportNamedImportAmd_1.ts, 7, 3), Decl(es6ImportNamedImportAmd_1.ts, 9, 3), Decl(es6ImportNamedImportAmd_1.ts, 11, 3), Decl(es6ImportNamedImportAmd_1.ts, 13, 3), Decl(es6ImportNamedImportAmd_1.ts, 14, 3), Decl(es6ImportNamedImportAmd_1.ts, 16, 3), Decl(es6ImportNamedImportAmd_1.ts, 17, 3)) +>b : Symbol(b, Decl(es6ImportNamedImportAmd_1.ts, 3, 8)) + +import { x, a as y } from "es6ImportNamedImportAmd_0"; +>x : Symbol(x, Decl(es6ImportNamedImportAmd_1.ts, 5, 8)) +>a : Symbol(y, Decl(es6ImportNamedImportAmd_1.ts, 5, 11)) +>y : Symbol(y, Decl(es6ImportNamedImportAmd_1.ts, 5, 11)) + +var xxxx = x; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportAmd_1.ts, 2, 3), Decl(es6ImportNamedImportAmd_1.ts, 4, 3), Decl(es6ImportNamedImportAmd_1.ts, 6, 3), Decl(es6ImportNamedImportAmd_1.ts, 7, 3), Decl(es6ImportNamedImportAmd_1.ts, 9, 3), Decl(es6ImportNamedImportAmd_1.ts, 11, 3), Decl(es6ImportNamedImportAmd_1.ts, 13, 3), Decl(es6ImportNamedImportAmd_1.ts, 14, 3), Decl(es6ImportNamedImportAmd_1.ts, 16, 3), Decl(es6ImportNamedImportAmd_1.ts, 17, 3)) +>x : Symbol(x, Decl(es6ImportNamedImportAmd_1.ts, 5, 8)) + +var xxxx = y; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportAmd_1.ts, 2, 3), Decl(es6ImportNamedImportAmd_1.ts, 4, 3), Decl(es6ImportNamedImportAmd_1.ts, 6, 3), Decl(es6ImportNamedImportAmd_1.ts, 7, 3), Decl(es6ImportNamedImportAmd_1.ts, 9, 3), Decl(es6ImportNamedImportAmd_1.ts, 11, 3), Decl(es6ImportNamedImportAmd_1.ts, 13, 3), Decl(es6ImportNamedImportAmd_1.ts, 14, 3), Decl(es6ImportNamedImportAmd_1.ts, 16, 3), Decl(es6ImportNamedImportAmd_1.ts, 17, 3)) +>y : Symbol(y, Decl(es6ImportNamedImportAmd_1.ts, 5, 11)) + +import { x as z, } from "es6ImportNamedImportAmd_0"; +>x : Symbol(z, Decl(es6ImportNamedImportAmd_1.ts, 8, 8)) +>z : Symbol(z, Decl(es6ImportNamedImportAmd_1.ts, 8, 8)) + +var xxxx = z; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportAmd_1.ts, 2, 3), Decl(es6ImportNamedImportAmd_1.ts, 4, 3), Decl(es6ImportNamedImportAmd_1.ts, 6, 3), Decl(es6ImportNamedImportAmd_1.ts, 7, 3), Decl(es6ImportNamedImportAmd_1.ts, 9, 3), Decl(es6ImportNamedImportAmd_1.ts, 11, 3), Decl(es6ImportNamedImportAmd_1.ts, 13, 3), Decl(es6ImportNamedImportAmd_1.ts, 14, 3), Decl(es6ImportNamedImportAmd_1.ts, 16, 3), Decl(es6ImportNamedImportAmd_1.ts, 17, 3)) +>z : Symbol(z, Decl(es6ImportNamedImportAmd_1.ts, 8, 8)) + +import { m, } from "es6ImportNamedImportAmd_0"; +>m : Symbol(m, Decl(es6ImportNamedImportAmd_1.ts, 10, 8)) + +var xxxx = m; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportAmd_1.ts, 2, 3), Decl(es6ImportNamedImportAmd_1.ts, 4, 3), Decl(es6ImportNamedImportAmd_1.ts, 6, 3), Decl(es6ImportNamedImportAmd_1.ts, 7, 3), Decl(es6ImportNamedImportAmd_1.ts, 9, 3), Decl(es6ImportNamedImportAmd_1.ts, 11, 3), Decl(es6ImportNamedImportAmd_1.ts, 13, 3), Decl(es6ImportNamedImportAmd_1.ts, 14, 3), Decl(es6ImportNamedImportAmd_1.ts, 16, 3), Decl(es6ImportNamedImportAmd_1.ts, 17, 3)) +>m : Symbol(m, Decl(es6ImportNamedImportAmd_1.ts, 10, 8)) + +import { a1, x1 } from "es6ImportNamedImportAmd_0"; +>a1 : Symbol(a1, Decl(es6ImportNamedImportAmd_1.ts, 12, 8)) +>x1 : Symbol(x1, Decl(es6ImportNamedImportAmd_1.ts, 12, 12)) + +var xxxx = a1; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportAmd_1.ts, 2, 3), Decl(es6ImportNamedImportAmd_1.ts, 4, 3), Decl(es6ImportNamedImportAmd_1.ts, 6, 3), Decl(es6ImportNamedImportAmd_1.ts, 7, 3), Decl(es6ImportNamedImportAmd_1.ts, 9, 3), Decl(es6ImportNamedImportAmd_1.ts, 11, 3), Decl(es6ImportNamedImportAmd_1.ts, 13, 3), Decl(es6ImportNamedImportAmd_1.ts, 14, 3), Decl(es6ImportNamedImportAmd_1.ts, 16, 3), Decl(es6ImportNamedImportAmd_1.ts, 17, 3)) +>a1 : Symbol(a1, Decl(es6ImportNamedImportAmd_1.ts, 12, 8)) + +var xxxx = x1; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportAmd_1.ts, 2, 3), Decl(es6ImportNamedImportAmd_1.ts, 4, 3), Decl(es6ImportNamedImportAmd_1.ts, 6, 3), Decl(es6ImportNamedImportAmd_1.ts, 7, 3), Decl(es6ImportNamedImportAmd_1.ts, 9, 3), Decl(es6ImportNamedImportAmd_1.ts, 11, 3), Decl(es6ImportNamedImportAmd_1.ts, 13, 3), Decl(es6ImportNamedImportAmd_1.ts, 14, 3), Decl(es6ImportNamedImportAmd_1.ts, 16, 3), Decl(es6ImportNamedImportAmd_1.ts, 17, 3)) +>x1 : Symbol(x1, Decl(es6ImportNamedImportAmd_1.ts, 12, 12)) + +import { a1 as a11, x1 as x11 } from "es6ImportNamedImportAmd_0"; +>a1 : Symbol(a11, Decl(es6ImportNamedImportAmd_1.ts, 15, 8)) +>a11 : Symbol(a11, Decl(es6ImportNamedImportAmd_1.ts, 15, 8)) +>x1 : Symbol(x11, Decl(es6ImportNamedImportAmd_1.ts, 15, 19)) +>x11 : Symbol(x11, Decl(es6ImportNamedImportAmd_1.ts, 15, 19)) + +var xxxx = a11; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportAmd_1.ts, 2, 3), Decl(es6ImportNamedImportAmd_1.ts, 4, 3), Decl(es6ImportNamedImportAmd_1.ts, 6, 3), Decl(es6ImportNamedImportAmd_1.ts, 7, 3), Decl(es6ImportNamedImportAmd_1.ts, 9, 3), Decl(es6ImportNamedImportAmd_1.ts, 11, 3), Decl(es6ImportNamedImportAmd_1.ts, 13, 3), Decl(es6ImportNamedImportAmd_1.ts, 14, 3), Decl(es6ImportNamedImportAmd_1.ts, 16, 3), Decl(es6ImportNamedImportAmd_1.ts, 17, 3)) +>a11 : Symbol(a11, Decl(es6ImportNamedImportAmd_1.ts, 15, 8)) + +var xxxx = x11; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportAmd_1.ts, 2, 3), Decl(es6ImportNamedImportAmd_1.ts, 4, 3), Decl(es6ImportNamedImportAmd_1.ts, 6, 3), Decl(es6ImportNamedImportAmd_1.ts, 7, 3), Decl(es6ImportNamedImportAmd_1.ts, 9, 3), Decl(es6ImportNamedImportAmd_1.ts, 11, 3), Decl(es6ImportNamedImportAmd_1.ts, 13, 3), Decl(es6ImportNamedImportAmd_1.ts, 14, 3), Decl(es6ImportNamedImportAmd_1.ts, 16, 3), Decl(es6ImportNamedImportAmd_1.ts, 17, 3)) +>x11 : Symbol(x11, Decl(es6ImportNamedImportAmd_1.ts, 15, 19)) + +import { z1 } from "es6ImportNamedImportAmd_0"; +>z1 : Symbol(z1, Decl(es6ImportNamedImportAmd_1.ts, 18, 8)) + +var z111 = z1; +>z111 : Symbol(z111, Decl(es6ImportNamedImportAmd_1.ts, 19, 3)) +>z1 : Symbol(z1, Decl(es6ImportNamedImportAmd_1.ts, 18, 8)) + +import { z2 as z3 } from "es6ImportNamedImportAmd_0"; +>z2 : Symbol(z3, Decl(es6ImportNamedImportAmd_1.ts, 20, 8)) +>z3 : Symbol(z3, Decl(es6ImportNamedImportAmd_1.ts, 20, 8)) + +var z2 = z3; // z2 shouldn't give redeclare error +>z2 : Symbol(z2, Decl(es6ImportNamedImportAmd_1.ts, 21, 3)) +>z3 : Symbol(z3, Decl(es6ImportNamedImportAmd_1.ts, 20, 8)) + +// These are elided +import { aaaa } from "es6ImportNamedImportAmd_0"; +>aaaa : Symbol(aaaa, Decl(es6ImportNamedImportAmd_1.ts, 24, 8)) + +// These are elided +import { aaaa as bbbb } from "es6ImportNamedImportAmd_0"; +>aaaa : Symbol(bbbb, Decl(es6ImportNamedImportAmd_1.ts, 26, 8)) +>bbbb : Symbol(bbbb, Decl(es6ImportNamedImportAmd_1.ts, 26, 8)) + diff --git a/tests/baselines/reference/es6ImportNamedImportAmd.types b/tests/baselines/reference/es6ImportNamedImportAmd.types index 4a0abe853e0..45ca9c08547 100644 --- a/tests/baselines/reference/es6ImportNamedImportAmd.types +++ b/tests/baselines/reference/es6ImportNamedImportAmd.types @@ -2,6 +2,7 @@ export var a = 10; >a : number +>10 : number export var x = a; >x : number @@ -13,18 +14,23 @@ export var m = a; export var a1 = 10; >a1 : number +>10 : number export var x1 = 10; >x1 : number +>10 : number export var z1 = 10; >z1 : number +>10 : number export var z2 = 10; >z2 : number +>10 : number export var aaaa = 10; >aaaa : number +>10 : number === tests/cases/compiler/es6ImportNamedImportAmd_1.ts === import { } from "es6ImportNamedImportAmd_0"; diff --git a/tests/baselines/reference/es6ImportNamedImportDts.symbols b/tests/baselines/reference/es6ImportNamedImportDts.symbols new file mode 100644 index 00000000000..2e3b2735b3d --- /dev/null +++ b/tests/baselines/reference/es6ImportNamedImportDts.symbols @@ -0,0 +1,138 @@ +=== tests/cases/compiler/server.ts === + +export class a { } +>a : Symbol(a, Decl(server.ts, 0, 0)) + +export class a11 { } +>a11 : Symbol(a11, Decl(server.ts, 1, 18)) + +export class a12 { } +>a12 : Symbol(a12, Decl(server.ts, 2, 20)) + +export class x { } +>x : Symbol(x, Decl(server.ts, 3, 20)) + +export class x11 { } +>x11 : Symbol(x11, Decl(server.ts, 4, 18)) + +export class m { } +>m : Symbol(m, Decl(server.ts, 5, 20)) + +export class a1 { } +>a1 : Symbol(a1, Decl(server.ts, 6, 18)) + +export class x1 { } +>x1 : Symbol(x1, Decl(server.ts, 7, 19)) + +export class a111 { } +>a111 : Symbol(a111, Decl(server.ts, 8, 19)) + +export class x111 { } +>x111 : Symbol(x111, Decl(server.ts, 9, 21)) + +export class z1 { } +>z1 : Symbol(z1, Decl(server.ts, 10, 21)) + +export class z2 { } +>z2 : Symbol(z2, Decl(server.ts, 11, 19)) + +export class aaaa { } +>aaaa : Symbol(aaaa, Decl(server.ts, 12, 19)) + +export class aaaa1 { } +>aaaa1 : Symbol(aaaa1, Decl(server.ts, 13, 21)) + +=== tests/cases/compiler/client.ts === +import { } from "server"; +import { a } from "server"; +>a : Symbol(a, Decl(client.ts, 1, 8)) + +export var xxxx = new a(); +>xxxx : Symbol(xxxx, Decl(client.ts, 2, 10)) +>a : Symbol(a, Decl(client.ts, 1, 8)) + +import { a11 as b } from "server"; +>a11 : Symbol(b, Decl(client.ts, 3, 8)) +>b : Symbol(b, Decl(client.ts, 3, 8)) + +export var xxxx1 = new b(); +>xxxx1 : Symbol(xxxx1, Decl(client.ts, 4, 10)) +>b : Symbol(b, Decl(client.ts, 3, 8)) + +import { x, a12 as y } from "server"; +>x : Symbol(x, Decl(client.ts, 5, 8)) +>a12 : Symbol(y, Decl(client.ts, 5, 11)) +>y : Symbol(y, Decl(client.ts, 5, 11)) + +export var xxxx2 = new x(); +>xxxx2 : Symbol(xxxx2, Decl(client.ts, 6, 10)) +>x : Symbol(x, Decl(client.ts, 5, 8)) + +export var xxxx3 = new y(); +>xxxx3 : Symbol(xxxx3, Decl(client.ts, 7, 10)) +>y : Symbol(y, Decl(client.ts, 5, 11)) + +import { x11 as z, } from "server"; +>x11 : Symbol(z, Decl(client.ts, 8, 8)) +>z : Symbol(z, Decl(client.ts, 8, 8)) + +export var xxxx4 = new z(); +>xxxx4 : Symbol(xxxx4, Decl(client.ts, 9, 10)) +>z : Symbol(z, Decl(client.ts, 8, 8)) + +import { m, } from "server"; +>m : Symbol(m, Decl(client.ts, 10, 8)) + +export var xxxx5 = new m(); +>xxxx5 : Symbol(xxxx5, Decl(client.ts, 11, 10)) +>m : Symbol(m, Decl(client.ts, 10, 8)) + +import { a1, x1 } from "server"; +>a1 : Symbol(a1, Decl(client.ts, 12, 8)) +>x1 : Symbol(x1, Decl(client.ts, 12, 12)) + +export var xxxx6 = new a1(); +>xxxx6 : Symbol(xxxx6, Decl(client.ts, 13, 10)) +>a1 : Symbol(a1, Decl(client.ts, 12, 8)) + +export var xxxx7 = new x1(); +>xxxx7 : Symbol(xxxx7, Decl(client.ts, 14, 10)) +>x1 : Symbol(x1, Decl(client.ts, 12, 12)) + +import { a111 as a11, x111 as x11 } from "server"; +>a111 : Symbol(a11, Decl(client.ts, 15, 8)) +>a11 : Symbol(a11, Decl(client.ts, 15, 8)) +>x111 : Symbol(x11, Decl(client.ts, 15, 21)) +>x11 : Symbol(x11, Decl(client.ts, 15, 21)) + +export var xxxx8 = new a11(); +>xxxx8 : Symbol(xxxx8, Decl(client.ts, 16, 10)) +>a11 : Symbol(a11, Decl(client.ts, 15, 8)) + +export var xxxx9 = new x11(); +>xxxx9 : Symbol(xxxx9, Decl(client.ts, 17, 10)) +>x11 : Symbol(x11, Decl(client.ts, 15, 21)) + +import { z1 } from "server"; +>z1 : Symbol(z1, Decl(client.ts, 18, 8)) + +export var z111 = new z1(); +>z111 : Symbol(z111, Decl(client.ts, 19, 10)) +>z1 : Symbol(z1, Decl(client.ts, 18, 8)) + +import { z2 as z3 } from "server"; +>z2 : Symbol(z3, Decl(client.ts, 20, 8)) +>z3 : Symbol(z3, Decl(client.ts, 20, 8)) + +export var z2 = new z3(); // z2 shouldn't give redeclare error +>z2 : Symbol(z2, Decl(client.ts, 21, 10)) +>z3 : Symbol(z3, Decl(client.ts, 20, 8)) + +// not referenced +import { aaaa } from "server"; +>aaaa : Symbol(aaaa, Decl(client.ts, 24, 8)) + +import { aaaa1 as bbbb } from "server"; +>aaaa1 : Symbol(bbbb, Decl(client.ts, 25, 8)) +>bbbb : Symbol(bbbb, Decl(client.ts, 25, 8)) + diff --git a/tests/baselines/reference/es6ImportNamedImportInEs5.symbols b/tests/baselines/reference/es6ImportNamedImportInEs5.symbols new file mode 100644 index 00000000000..546487514ce --- /dev/null +++ b/tests/baselines/reference/es6ImportNamedImportInEs5.symbols @@ -0,0 +1,123 @@ +=== tests/cases/compiler/es6ImportNamedImportInEs5_0.ts === + +export var a = 10; +>a : Symbol(a, Decl(es6ImportNamedImportInEs5_0.ts, 1, 10)) + +export var x = a; +>x : Symbol(x, Decl(es6ImportNamedImportInEs5_0.ts, 2, 10)) +>a : Symbol(a, Decl(es6ImportNamedImportInEs5_0.ts, 1, 10)) + +export var m = a; +>m : Symbol(m, Decl(es6ImportNamedImportInEs5_0.ts, 3, 10)) +>a : Symbol(a, Decl(es6ImportNamedImportInEs5_0.ts, 1, 10)) + +export var a1 = 10; +>a1 : Symbol(a1, Decl(es6ImportNamedImportInEs5_0.ts, 4, 10)) + +export var x1 = 10; +>x1 : Symbol(x1, Decl(es6ImportNamedImportInEs5_0.ts, 5, 10)) + +export var z1 = 10; +>z1 : Symbol(z1, Decl(es6ImportNamedImportInEs5_0.ts, 6, 10)) + +export var z2 = 10; +>z2 : Symbol(z2, Decl(es6ImportNamedImportInEs5_0.ts, 7, 10)) + +export var aaaa = 10; +>aaaa : Symbol(aaaa, Decl(es6ImportNamedImportInEs5_0.ts, 8, 10)) + +=== tests/cases/compiler/es6ImportNamedImportInEs5_1.ts === +import { } from "es6ImportNamedImportInEs5_0"; +import { a } from "es6ImportNamedImportInEs5_0"; +>a : Symbol(a, Decl(es6ImportNamedImportInEs5_1.ts, 1, 8)) + +var xxxx = a; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportInEs5_1.ts, 2, 3), Decl(es6ImportNamedImportInEs5_1.ts, 4, 3), Decl(es6ImportNamedImportInEs5_1.ts, 6, 3), Decl(es6ImportNamedImportInEs5_1.ts, 7, 3), Decl(es6ImportNamedImportInEs5_1.ts, 9, 3), Decl(es6ImportNamedImportInEs5_1.ts, 11, 3), Decl(es6ImportNamedImportInEs5_1.ts, 13, 3), Decl(es6ImportNamedImportInEs5_1.ts, 14, 3), Decl(es6ImportNamedImportInEs5_1.ts, 16, 3), Decl(es6ImportNamedImportInEs5_1.ts, 17, 3)) +>a : Symbol(a, Decl(es6ImportNamedImportInEs5_1.ts, 1, 8)) + +import { a as b } from "es6ImportNamedImportInEs5_0"; +>a : Symbol(b, Decl(es6ImportNamedImportInEs5_1.ts, 3, 8)) +>b : Symbol(b, Decl(es6ImportNamedImportInEs5_1.ts, 3, 8)) + +var xxxx = b; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportInEs5_1.ts, 2, 3), Decl(es6ImportNamedImportInEs5_1.ts, 4, 3), Decl(es6ImportNamedImportInEs5_1.ts, 6, 3), Decl(es6ImportNamedImportInEs5_1.ts, 7, 3), Decl(es6ImportNamedImportInEs5_1.ts, 9, 3), Decl(es6ImportNamedImportInEs5_1.ts, 11, 3), Decl(es6ImportNamedImportInEs5_1.ts, 13, 3), Decl(es6ImportNamedImportInEs5_1.ts, 14, 3), Decl(es6ImportNamedImportInEs5_1.ts, 16, 3), Decl(es6ImportNamedImportInEs5_1.ts, 17, 3)) +>b : Symbol(b, Decl(es6ImportNamedImportInEs5_1.ts, 3, 8)) + +import { x, a as y } from "es6ImportNamedImportInEs5_0"; +>x : Symbol(x, Decl(es6ImportNamedImportInEs5_1.ts, 5, 8)) +>a : Symbol(y, Decl(es6ImportNamedImportInEs5_1.ts, 5, 11)) +>y : Symbol(y, Decl(es6ImportNamedImportInEs5_1.ts, 5, 11)) + +var xxxx = x; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportInEs5_1.ts, 2, 3), Decl(es6ImportNamedImportInEs5_1.ts, 4, 3), Decl(es6ImportNamedImportInEs5_1.ts, 6, 3), Decl(es6ImportNamedImportInEs5_1.ts, 7, 3), Decl(es6ImportNamedImportInEs5_1.ts, 9, 3), Decl(es6ImportNamedImportInEs5_1.ts, 11, 3), Decl(es6ImportNamedImportInEs5_1.ts, 13, 3), Decl(es6ImportNamedImportInEs5_1.ts, 14, 3), Decl(es6ImportNamedImportInEs5_1.ts, 16, 3), Decl(es6ImportNamedImportInEs5_1.ts, 17, 3)) +>x : Symbol(x, Decl(es6ImportNamedImportInEs5_1.ts, 5, 8)) + +var xxxx = y; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportInEs5_1.ts, 2, 3), Decl(es6ImportNamedImportInEs5_1.ts, 4, 3), Decl(es6ImportNamedImportInEs5_1.ts, 6, 3), Decl(es6ImportNamedImportInEs5_1.ts, 7, 3), Decl(es6ImportNamedImportInEs5_1.ts, 9, 3), Decl(es6ImportNamedImportInEs5_1.ts, 11, 3), Decl(es6ImportNamedImportInEs5_1.ts, 13, 3), Decl(es6ImportNamedImportInEs5_1.ts, 14, 3), Decl(es6ImportNamedImportInEs5_1.ts, 16, 3), Decl(es6ImportNamedImportInEs5_1.ts, 17, 3)) +>y : Symbol(y, Decl(es6ImportNamedImportInEs5_1.ts, 5, 11)) + +import { x as z, } from "es6ImportNamedImportInEs5_0"; +>x : Symbol(z, Decl(es6ImportNamedImportInEs5_1.ts, 8, 8)) +>z : Symbol(z, Decl(es6ImportNamedImportInEs5_1.ts, 8, 8)) + +var xxxx = z; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportInEs5_1.ts, 2, 3), Decl(es6ImportNamedImportInEs5_1.ts, 4, 3), Decl(es6ImportNamedImportInEs5_1.ts, 6, 3), Decl(es6ImportNamedImportInEs5_1.ts, 7, 3), Decl(es6ImportNamedImportInEs5_1.ts, 9, 3), Decl(es6ImportNamedImportInEs5_1.ts, 11, 3), Decl(es6ImportNamedImportInEs5_1.ts, 13, 3), Decl(es6ImportNamedImportInEs5_1.ts, 14, 3), Decl(es6ImportNamedImportInEs5_1.ts, 16, 3), Decl(es6ImportNamedImportInEs5_1.ts, 17, 3)) +>z : Symbol(z, Decl(es6ImportNamedImportInEs5_1.ts, 8, 8)) + +import { m, } from "es6ImportNamedImportInEs5_0"; +>m : Symbol(m, Decl(es6ImportNamedImportInEs5_1.ts, 10, 8)) + +var xxxx = m; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportInEs5_1.ts, 2, 3), Decl(es6ImportNamedImportInEs5_1.ts, 4, 3), Decl(es6ImportNamedImportInEs5_1.ts, 6, 3), Decl(es6ImportNamedImportInEs5_1.ts, 7, 3), Decl(es6ImportNamedImportInEs5_1.ts, 9, 3), Decl(es6ImportNamedImportInEs5_1.ts, 11, 3), Decl(es6ImportNamedImportInEs5_1.ts, 13, 3), Decl(es6ImportNamedImportInEs5_1.ts, 14, 3), Decl(es6ImportNamedImportInEs5_1.ts, 16, 3), Decl(es6ImportNamedImportInEs5_1.ts, 17, 3)) +>m : Symbol(m, Decl(es6ImportNamedImportInEs5_1.ts, 10, 8)) + +import { a1, x1 } from "es6ImportNamedImportInEs5_0"; +>a1 : Symbol(a1, Decl(es6ImportNamedImportInEs5_1.ts, 12, 8)) +>x1 : Symbol(x1, Decl(es6ImportNamedImportInEs5_1.ts, 12, 12)) + +var xxxx = a1; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportInEs5_1.ts, 2, 3), Decl(es6ImportNamedImportInEs5_1.ts, 4, 3), Decl(es6ImportNamedImportInEs5_1.ts, 6, 3), Decl(es6ImportNamedImportInEs5_1.ts, 7, 3), Decl(es6ImportNamedImportInEs5_1.ts, 9, 3), Decl(es6ImportNamedImportInEs5_1.ts, 11, 3), Decl(es6ImportNamedImportInEs5_1.ts, 13, 3), Decl(es6ImportNamedImportInEs5_1.ts, 14, 3), Decl(es6ImportNamedImportInEs5_1.ts, 16, 3), Decl(es6ImportNamedImportInEs5_1.ts, 17, 3)) +>a1 : Symbol(a1, Decl(es6ImportNamedImportInEs5_1.ts, 12, 8)) + +var xxxx = x1; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportInEs5_1.ts, 2, 3), Decl(es6ImportNamedImportInEs5_1.ts, 4, 3), Decl(es6ImportNamedImportInEs5_1.ts, 6, 3), Decl(es6ImportNamedImportInEs5_1.ts, 7, 3), Decl(es6ImportNamedImportInEs5_1.ts, 9, 3), Decl(es6ImportNamedImportInEs5_1.ts, 11, 3), Decl(es6ImportNamedImportInEs5_1.ts, 13, 3), Decl(es6ImportNamedImportInEs5_1.ts, 14, 3), Decl(es6ImportNamedImportInEs5_1.ts, 16, 3), Decl(es6ImportNamedImportInEs5_1.ts, 17, 3)) +>x1 : Symbol(x1, Decl(es6ImportNamedImportInEs5_1.ts, 12, 12)) + +import { a1 as a11, x1 as x11 } from "es6ImportNamedImportInEs5_0"; +>a1 : Symbol(a11, Decl(es6ImportNamedImportInEs5_1.ts, 15, 8)) +>a11 : Symbol(a11, Decl(es6ImportNamedImportInEs5_1.ts, 15, 8)) +>x1 : Symbol(x11, Decl(es6ImportNamedImportInEs5_1.ts, 15, 19)) +>x11 : Symbol(x11, Decl(es6ImportNamedImportInEs5_1.ts, 15, 19)) + +var xxxx = a11; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportInEs5_1.ts, 2, 3), Decl(es6ImportNamedImportInEs5_1.ts, 4, 3), Decl(es6ImportNamedImportInEs5_1.ts, 6, 3), Decl(es6ImportNamedImportInEs5_1.ts, 7, 3), Decl(es6ImportNamedImportInEs5_1.ts, 9, 3), Decl(es6ImportNamedImportInEs5_1.ts, 11, 3), Decl(es6ImportNamedImportInEs5_1.ts, 13, 3), Decl(es6ImportNamedImportInEs5_1.ts, 14, 3), Decl(es6ImportNamedImportInEs5_1.ts, 16, 3), Decl(es6ImportNamedImportInEs5_1.ts, 17, 3)) +>a11 : Symbol(a11, Decl(es6ImportNamedImportInEs5_1.ts, 15, 8)) + +var xxxx = x11; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportInEs5_1.ts, 2, 3), Decl(es6ImportNamedImportInEs5_1.ts, 4, 3), Decl(es6ImportNamedImportInEs5_1.ts, 6, 3), Decl(es6ImportNamedImportInEs5_1.ts, 7, 3), Decl(es6ImportNamedImportInEs5_1.ts, 9, 3), Decl(es6ImportNamedImportInEs5_1.ts, 11, 3), Decl(es6ImportNamedImportInEs5_1.ts, 13, 3), Decl(es6ImportNamedImportInEs5_1.ts, 14, 3), Decl(es6ImportNamedImportInEs5_1.ts, 16, 3), Decl(es6ImportNamedImportInEs5_1.ts, 17, 3)) +>x11 : Symbol(x11, Decl(es6ImportNamedImportInEs5_1.ts, 15, 19)) + +import { z1 } from "es6ImportNamedImportInEs5_0"; +>z1 : Symbol(z1, Decl(es6ImportNamedImportInEs5_1.ts, 18, 8)) + +var z111 = z1; +>z111 : Symbol(z111, Decl(es6ImportNamedImportInEs5_1.ts, 19, 3)) +>z1 : Symbol(z1, Decl(es6ImportNamedImportInEs5_1.ts, 18, 8)) + +import { z2 as z3 } from "es6ImportNamedImportInEs5_0"; +>z2 : Symbol(z3, Decl(es6ImportNamedImportInEs5_1.ts, 20, 8)) +>z3 : Symbol(z3, Decl(es6ImportNamedImportInEs5_1.ts, 20, 8)) + +var z2 = z3; // z2 shouldn't give redeclare error +>z2 : Symbol(z2, Decl(es6ImportNamedImportInEs5_1.ts, 21, 3)) +>z3 : Symbol(z3, Decl(es6ImportNamedImportInEs5_1.ts, 20, 8)) + +// These are elided +import { aaaa } from "es6ImportNamedImportInEs5_0"; +>aaaa : Symbol(aaaa, Decl(es6ImportNamedImportInEs5_1.ts, 24, 8)) + +// These are elided +import { aaaa as bbbb } from "es6ImportNamedImportInEs5_0"; +>aaaa : Symbol(bbbb, Decl(es6ImportNamedImportInEs5_1.ts, 26, 8)) +>bbbb : Symbol(bbbb, Decl(es6ImportNamedImportInEs5_1.ts, 26, 8)) + diff --git a/tests/baselines/reference/es6ImportNamedImportInEs5.types b/tests/baselines/reference/es6ImportNamedImportInEs5.types index f60644b2621..95f784c5eac 100644 --- a/tests/baselines/reference/es6ImportNamedImportInEs5.types +++ b/tests/baselines/reference/es6ImportNamedImportInEs5.types @@ -2,6 +2,7 @@ export var a = 10; >a : number +>10 : number export var x = a; >x : number @@ -13,18 +14,23 @@ export var m = a; export var a1 = 10; >a1 : number +>10 : number export var x1 = 10; >x1 : number +>10 : number export var z1 = 10; >z1 : number +>10 : number export var z2 = 10; >z2 : number +>10 : number export var aaaa = 10; >aaaa : number +>10 : number === tests/cases/compiler/es6ImportNamedImportInEs5_1.ts === import { } from "es6ImportNamedImportInEs5_0"; diff --git a/tests/baselines/reference/es6ImportNamedImportInIndirectExportAssignment.symbols b/tests/baselines/reference/es6ImportNamedImportInIndirectExportAssignment.symbols new file mode 100644 index 00000000000..2598735d6d8 --- /dev/null +++ b/tests/baselines/reference/es6ImportNamedImportInIndirectExportAssignment.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/es6ImportNamedImportInIndirectExportAssignment_0.ts === + +export module a { +>a : Symbol(a, Decl(es6ImportNamedImportInIndirectExportAssignment_0.ts, 0, 0)) + + export class c { +>c : Symbol(c, Decl(es6ImportNamedImportInIndirectExportAssignment_0.ts, 1, 17)) + } +} + +=== tests/cases/compiler/es6ImportNamedImportInIndirectExportAssignment_1.ts === +import { a } from "es6ImportNamedImportInIndirectExportAssignment_0"; +>a : Symbol(a, Decl(es6ImportNamedImportInIndirectExportAssignment_1.ts, 0, 8)) + +import x = a; +>x : Symbol(x, Decl(es6ImportNamedImportInIndirectExportAssignment_1.ts, 0, 69)) +>a : Symbol(a, Decl(es6ImportNamedImportInIndirectExportAssignment_0.ts, 0, 0)) + +export = x; +>x : Symbol(x, Decl(es6ImportNamedImportInIndirectExportAssignment_1.ts, 0, 69)) + diff --git a/tests/baselines/reference/es6ImportNamedImportWithTypesAndValues.symbols b/tests/baselines/reference/es6ImportNamedImportWithTypesAndValues.symbols new file mode 100644 index 00000000000..e294124c6f4 --- /dev/null +++ b/tests/baselines/reference/es6ImportNamedImportWithTypesAndValues.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/server.ts === + +export interface I { +>I : Symbol(I, Decl(server.ts, 0, 0)) + + prop: string; +>prop : Symbol(prop, Decl(server.ts, 1, 20)) +} +export interface I2 { +>I2 : Symbol(I2, Decl(server.ts, 3, 1)) + + prop2: string; +>prop2 : Symbol(prop2, Decl(server.ts, 4, 21)) +} +export class C implements I { +>C : Symbol(C, Decl(server.ts, 6, 1)) +>I : Symbol(I, Decl(server.ts, 0, 0)) + + prop = "hello"; +>prop : Symbol(prop, Decl(server.ts, 7, 29)) +} +export class C2 implements I2 { +>C2 : Symbol(C2, Decl(server.ts, 9, 1)) +>I2 : Symbol(I2, Decl(server.ts, 3, 1)) + + prop2 = "world"; +>prop2 : Symbol(prop2, Decl(server.ts, 10, 31)) +} + +=== tests/cases/compiler/client.ts === +import { C, I, C2 } from "server"; // Shouldnt emit I and C2 into the js file and emit C and I in .d.ts file +>C : Symbol(C, Decl(client.ts, 0, 8)) +>I : Symbol(I, Decl(client.ts, 0, 11)) +>C2 : Symbol(C2, Decl(client.ts, 0, 14)) + +export type cValInterface = I; +>cValInterface : Symbol(cValInterface, Decl(client.ts, 0, 34)) +>I : Symbol(I, Decl(client.ts, 0, 11)) + +export var cVal = new C(); +>cVal : Symbol(cVal, Decl(client.ts, 2, 10)) +>C : Symbol(C, Decl(client.ts, 0, 8)) + diff --git a/tests/baselines/reference/es6ImportNamedImportWithTypesAndValues.types b/tests/baselines/reference/es6ImportNamedImportWithTypesAndValues.types index 62917e5ff36..12e5271c8b0 100644 --- a/tests/baselines/reference/es6ImportNamedImportWithTypesAndValues.types +++ b/tests/baselines/reference/es6ImportNamedImportWithTypesAndValues.types @@ -18,6 +18,7 @@ export class C implements I { prop = "hello"; >prop : string +>"hello" : string } export class C2 implements I2 { >C2 : C2 @@ -25,12 +26,13 @@ export class C2 implements I2 { prop2 = "world"; >prop2 : string +>"world" : string } === tests/cases/compiler/client.ts === import { C, I, C2 } from "server"; // Shouldnt emit I and C2 into the js file and emit C and I in .d.ts file >C : typeof C ->I : unknown +>I : any >C2 : typeof C2 export type cValInterface = I; diff --git a/tests/baselines/reference/es6ImportWithoutFromClause.symbols b/tests/baselines/reference/es6ImportWithoutFromClause.symbols new file mode 100644 index 00000000000..31eafdf655c --- /dev/null +++ b/tests/baselines/reference/es6ImportWithoutFromClause.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/es6ImportWithoutFromClause_0.ts === + +export var a = 10; +>a : Symbol(a, Decl(es6ImportWithoutFromClause_0.ts, 1, 10)) + +=== tests/cases/compiler/es6ImportWithoutFromClause_1.ts === +import "es6ImportWithoutFromClause_0"; +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/es6ImportWithoutFromClause.types b/tests/baselines/reference/es6ImportWithoutFromClause.types index 3cc5067891a..d46a4a7487c 100644 --- a/tests/baselines/reference/es6ImportWithoutFromClause.types +++ b/tests/baselines/reference/es6ImportWithoutFromClause.types @@ -2,6 +2,7 @@ export var a = 10; >a : number +>10 : number === tests/cases/compiler/es6ImportWithoutFromClause_1.ts === import "es6ImportWithoutFromClause_0"; diff --git a/tests/baselines/reference/es6ImportWithoutFromClauseAmd.js b/tests/baselines/reference/es6ImportWithoutFromClauseAmd.js index 7b10da7cc9f..b52c94a5c10 100644 --- a/tests/baselines/reference/es6ImportWithoutFromClauseAmd.js +++ b/tests/baselines/reference/es6ImportWithoutFromClauseAmd.js @@ -22,7 +22,7 @@ define(["require", "exports"], function (require, exports) { exports.b = 10; }); //// [es6ImportWithoutFromClauseAmd_2.js] -define(["require", "exports", "es6ImportWithoutFromClauseAmd_0", "es6ImportWithoutFromClauseAmd_2"], function (require, exports, , ) { +define(["require", "exports", "es6ImportWithoutFromClauseAmd_0", "es6ImportWithoutFromClauseAmd_2"], function (require, exports) { var _a = 10; var _b = 10; }); diff --git a/tests/baselines/reference/es6ImportWithoutFromClauseAmd.symbols b/tests/baselines/reference/es6ImportWithoutFromClauseAmd.symbols new file mode 100644 index 00000000000..36e1e79f0b5 --- /dev/null +++ b/tests/baselines/reference/es6ImportWithoutFromClauseAmd.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/es6ImportWithoutFromClauseAmd_0.ts === + +export var a = 10; +>a : Symbol(a, Decl(es6ImportWithoutFromClauseAmd_0.ts, 1, 10)) + +=== tests/cases/compiler/es6ImportWithoutFromClauseAmd_1.ts === +export var b = 10; +>b : Symbol(b, Decl(es6ImportWithoutFromClauseAmd_1.ts, 0, 10)) + +=== tests/cases/compiler/es6ImportWithoutFromClauseAmd_2.ts === +import "es6ImportWithoutFromClauseAmd_0"; +import "es6ImportWithoutFromClauseAmd_2"; +var _a = 10; +>_a : Symbol(_a, Decl(es6ImportWithoutFromClauseAmd_2.ts, 2, 3)) + +var _b = 10; +>_b : Symbol(_b, Decl(es6ImportWithoutFromClauseAmd_2.ts, 3, 3)) + diff --git a/tests/baselines/reference/es6ImportWithoutFromClauseAmd.types b/tests/baselines/reference/es6ImportWithoutFromClauseAmd.types index c3d09388916..3314b12d189 100644 --- a/tests/baselines/reference/es6ImportWithoutFromClauseAmd.types +++ b/tests/baselines/reference/es6ImportWithoutFromClauseAmd.types @@ -2,17 +2,21 @@ export var a = 10; >a : number +>10 : number === tests/cases/compiler/es6ImportWithoutFromClauseAmd_1.ts === export var b = 10; >b : number +>10 : number === tests/cases/compiler/es6ImportWithoutFromClauseAmd_2.ts === import "es6ImportWithoutFromClauseAmd_0"; import "es6ImportWithoutFromClauseAmd_2"; var _a = 10; >_a : number +>10 : number var _b = 10; >_b : number +>10 : number diff --git a/tests/baselines/reference/es6ImportWithoutFromClauseInEs5.symbols b/tests/baselines/reference/es6ImportWithoutFromClauseInEs5.symbols new file mode 100644 index 00000000000..c8db6eff479 --- /dev/null +++ b/tests/baselines/reference/es6ImportWithoutFromClauseInEs5.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/es6ImportWithoutFromClauseInEs5_0.ts === + +export var a = 10; +>a : Symbol(a, Decl(es6ImportWithoutFromClauseInEs5_0.ts, 1, 10)) + +=== tests/cases/compiler/es6ImportWithoutFromClauseInEs5_1.ts === +import "es6ImportWithoutFromClauseInEs5_0"; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/es6ImportWithoutFromClauseInEs5.types b/tests/baselines/reference/es6ImportWithoutFromClauseInEs5.types index 3d674f9c22c..ee95c07bb75 100644 --- a/tests/baselines/reference/es6ImportWithoutFromClauseInEs5.types +++ b/tests/baselines/reference/es6ImportWithoutFromClauseInEs5.types @@ -2,6 +2,7 @@ export var a = 10; >a : number +>10 : number === tests/cases/compiler/es6ImportWithoutFromClauseInEs5_1.ts === import "es6ImportWithoutFromClauseInEs5_0"; diff --git a/tests/baselines/reference/es6ImportWithoutFromClauseNonInstantiatedModule.symbols b/tests/baselines/reference/es6ImportWithoutFromClauseNonInstantiatedModule.symbols new file mode 100644 index 00000000000..0fe8e68e1a3 --- /dev/null +++ b/tests/baselines/reference/es6ImportWithoutFromClauseNonInstantiatedModule.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/es6ImportWithoutFromClauseNonInstantiatedModule_0.ts === + +export interface i { +>i : Symbol(i, Decl(es6ImportWithoutFromClauseNonInstantiatedModule_0.ts, 0, 0)) +} + +=== tests/cases/compiler/es6ImportWithoutFromClauseNonInstantiatedModule_1.ts === +import "es6ImportWithoutFromClauseNonInstantiatedModule_0"; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/es6Module.symbols b/tests/baselines/reference/es6Module.symbols new file mode 100644 index 00000000000..8887adfff37 --- /dev/null +++ b/tests/baselines/reference/es6Module.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/es6Module.ts === +export class A +>A : Symbol(A, Decl(es6Module.ts, 0, 0)) +{ + constructor () + { + } + + public B() +>B : Symbol(B, Decl(es6Module.ts, 4, 5)) + { + return 42; + } +} diff --git a/tests/baselines/reference/es6Module.types b/tests/baselines/reference/es6Module.types index 93910200215..b55b58e8883 100644 --- a/tests/baselines/reference/es6Module.types +++ b/tests/baselines/reference/es6Module.types @@ -10,5 +10,6 @@ export class A >B : () => number { return 42; +>42 : number } } diff --git a/tests/baselines/reference/es6ModuleClassDeclaration.symbols b/tests/baselines/reference/es6ModuleClassDeclaration.symbols new file mode 100644 index 00000000000..5ad84b94f0a --- /dev/null +++ b/tests/baselines/reference/es6ModuleClassDeclaration.symbols @@ -0,0 +1,222 @@ +=== tests/cases/compiler/es6ModuleClassDeclaration.ts === +export class c { +>c : Symbol(c, Decl(es6ModuleClassDeclaration.ts, 0, 0)) + + constructor() { + } + private x = 10; +>x : Symbol(x, Decl(es6ModuleClassDeclaration.ts, 2, 5)) + + public y = 30; +>y : Symbol(y, Decl(es6ModuleClassDeclaration.ts, 3, 19)) + + static k = 20; +>k : Symbol(c.k, Decl(es6ModuleClassDeclaration.ts, 4, 18)) + + private static l = 30; +>l : Symbol(c.l, Decl(es6ModuleClassDeclaration.ts, 5, 18)) + + private method1() { +>method1 : Symbol(method1, Decl(es6ModuleClassDeclaration.ts, 6, 26)) + } + public method2() { +>method2 : Symbol(method2, Decl(es6ModuleClassDeclaration.ts, 8, 5)) + } + static method3() { +>method3 : Symbol(c.method3, Decl(es6ModuleClassDeclaration.ts, 10, 5)) + } + private static method4() { +>method4 : Symbol(c.method4, Decl(es6ModuleClassDeclaration.ts, 12, 5)) + } +} +class c2 { +>c2 : Symbol(c2, Decl(es6ModuleClassDeclaration.ts, 15, 1)) + + constructor() { + } + private x = 10; +>x : Symbol(x, Decl(es6ModuleClassDeclaration.ts, 18, 5)) + + public y = 30; +>y : Symbol(y, Decl(es6ModuleClassDeclaration.ts, 19, 19)) + + static k = 20; +>k : Symbol(c2.k, Decl(es6ModuleClassDeclaration.ts, 20, 18)) + + private static l = 30; +>l : Symbol(c2.l, Decl(es6ModuleClassDeclaration.ts, 21, 18)) + + private method1() { +>method1 : Symbol(method1, Decl(es6ModuleClassDeclaration.ts, 22, 26)) + } + public method2() { +>method2 : Symbol(method2, Decl(es6ModuleClassDeclaration.ts, 24, 5)) + } + static method3() { +>method3 : Symbol(c2.method3, Decl(es6ModuleClassDeclaration.ts, 26, 5)) + } + private static method4() { +>method4 : Symbol(c2.method4, Decl(es6ModuleClassDeclaration.ts, 28, 5)) + } +} +new c(); +>c : Symbol(c, Decl(es6ModuleClassDeclaration.ts, 0, 0)) + +new c2(); +>c2 : Symbol(c2, Decl(es6ModuleClassDeclaration.ts, 15, 1)) + +export module m1 { +>m1 : Symbol(m1, Decl(es6ModuleClassDeclaration.ts, 33, 9)) + + export class c3 { +>c3 : Symbol(c3, Decl(es6ModuleClassDeclaration.ts, 35, 18)) + + constructor() { + } + private x = 10; +>x : Symbol(x, Decl(es6ModuleClassDeclaration.ts, 38, 9)) + + public y = 30; +>y : Symbol(y, Decl(es6ModuleClassDeclaration.ts, 39, 23)) + + static k = 20; +>k : Symbol(c3.k, Decl(es6ModuleClassDeclaration.ts, 40, 22)) + + private static l = 30; +>l : Symbol(c3.l, Decl(es6ModuleClassDeclaration.ts, 41, 22)) + + private method1() { +>method1 : Symbol(method1, Decl(es6ModuleClassDeclaration.ts, 42, 30)) + } + public method2() { +>method2 : Symbol(method2, Decl(es6ModuleClassDeclaration.ts, 44, 9)) + } + static method3() { +>method3 : Symbol(c3.method3, Decl(es6ModuleClassDeclaration.ts, 46, 9)) + } + private static method4() { +>method4 : Symbol(c3.method4, Decl(es6ModuleClassDeclaration.ts, 48, 9)) + } + } + class c4 { +>c4 : Symbol(c4, Decl(es6ModuleClassDeclaration.ts, 51, 5)) + + constructor() { + } + private x = 10; +>x : Symbol(x, Decl(es6ModuleClassDeclaration.ts, 54, 9)) + + public y = 30; +>y : Symbol(y, Decl(es6ModuleClassDeclaration.ts, 55, 23)) + + static k = 20; +>k : Symbol(c4.k, Decl(es6ModuleClassDeclaration.ts, 56, 22)) + + private static l = 30; +>l : Symbol(c4.l, Decl(es6ModuleClassDeclaration.ts, 57, 22)) + + private method1() { +>method1 : Symbol(method1, Decl(es6ModuleClassDeclaration.ts, 58, 30)) + } + public method2() { +>method2 : Symbol(method2, Decl(es6ModuleClassDeclaration.ts, 60, 9)) + } + static method3() { +>method3 : Symbol(c4.method3, Decl(es6ModuleClassDeclaration.ts, 62, 9)) + } + private static method4() { +>method4 : Symbol(c4.method4, Decl(es6ModuleClassDeclaration.ts, 64, 9)) + } + } + new c(); +>c : Symbol(c, Decl(es6ModuleClassDeclaration.ts, 0, 0)) + + new c2(); +>c2 : Symbol(c2, Decl(es6ModuleClassDeclaration.ts, 15, 1)) + + new c3(); +>c3 : Symbol(c3, Decl(es6ModuleClassDeclaration.ts, 35, 18)) + + new c4(); +>c4 : Symbol(c4, Decl(es6ModuleClassDeclaration.ts, 51, 5)) +} +module m2 { +>m2 : Symbol(m2, Decl(es6ModuleClassDeclaration.ts, 72, 1)) + + export class c3 { +>c3 : Symbol(c3, Decl(es6ModuleClassDeclaration.ts, 73, 11)) + + constructor() { + } + private x = 10; +>x : Symbol(x, Decl(es6ModuleClassDeclaration.ts, 76, 9)) + + public y = 30; +>y : Symbol(y, Decl(es6ModuleClassDeclaration.ts, 77, 23)) + + static k = 20; +>k : Symbol(c3.k, Decl(es6ModuleClassDeclaration.ts, 78, 22)) + + private static l = 30; +>l : Symbol(c3.l, Decl(es6ModuleClassDeclaration.ts, 79, 22)) + + private method1() { +>method1 : Symbol(method1, Decl(es6ModuleClassDeclaration.ts, 80, 30)) + } + public method2() { +>method2 : Symbol(method2, Decl(es6ModuleClassDeclaration.ts, 82, 9)) + } + static method3() { +>method3 : Symbol(c3.method3, Decl(es6ModuleClassDeclaration.ts, 84, 9)) + } + private static method4() { +>method4 : Symbol(c3.method4, Decl(es6ModuleClassDeclaration.ts, 86, 9)) + } + } + class c4 { +>c4 : Symbol(c4, Decl(es6ModuleClassDeclaration.ts, 89, 5)) + + constructor() { + } + private x = 10; +>x : Symbol(x, Decl(es6ModuleClassDeclaration.ts, 92, 9)) + + public y = 30; +>y : Symbol(y, Decl(es6ModuleClassDeclaration.ts, 93, 23)) + + static k = 20; +>k : Symbol(c4.k, Decl(es6ModuleClassDeclaration.ts, 94, 22)) + + private static l = 30; +>l : Symbol(c4.l, Decl(es6ModuleClassDeclaration.ts, 95, 22)) + + private method1() { +>method1 : Symbol(method1, Decl(es6ModuleClassDeclaration.ts, 96, 30)) + } + public method2() { +>method2 : Symbol(method2, Decl(es6ModuleClassDeclaration.ts, 98, 9)) + } + static method3() { +>method3 : Symbol(c4.method3, Decl(es6ModuleClassDeclaration.ts, 100, 9)) + } + private static method4() { +>method4 : Symbol(c4.method4, Decl(es6ModuleClassDeclaration.ts, 102, 9)) + } + } + new c(); +>c : Symbol(c, Decl(es6ModuleClassDeclaration.ts, 0, 0)) + + new c2(); +>c2 : Symbol(c2, Decl(es6ModuleClassDeclaration.ts, 15, 1)) + + new c3(); +>c3 : Symbol(c3, Decl(es6ModuleClassDeclaration.ts, 73, 11)) + + new c4(); +>c4 : Symbol(c4, Decl(es6ModuleClassDeclaration.ts, 89, 5)) + + new m1.c3(); +>m1.c3 : Symbol(m1.c3, Decl(es6ModuleClassDeclaration.ts, 35, 18)) +>m1 : Symbol(m1, Decl(es6ModuleClassDeclaration.ts, 33, 9)) +>c3 : Symbol(m1.c3, Decl(es6ModuleClassDeclaration.ts, 35, 18)) +} diff --git a/tests/baselines/reference/es6ModuleClassDeclaration.types b/tests/baselines/reference/es6ModuleClassDeclaration.types index 09d50c4e542..e354d266abe 100644 --- a/tests/baselines/reference/es6ModuleClassDeclaration.types +++ b/tests/baselines/reference/es6ModuleClassDeclaration.types @@ -6,15 +6,19 @@ export class c { } private x = 10; >x : number +>10 : number public y = 30; >y : number +>30 : number static k = 20; >k : number +>20 : number private static l = 30; >l : number +>30 : number private method1() { >method1 : () => void @@ -36,15 +40,19 @@ class c2 { } private x = 10; >x : number +>10 : number public y = 30; >y : number +>30 : number static k = 20; >k : number +>20 : number private static l = 30; >l : number +>30 : number private method1() { >method1 : () => void @@ -77,15 +85,19 @@ export module m1 { } private x = 10; >x : number +>10 : number public y = 30; >y : number +>30 : number static k = 20; >k : number +>20 : number private static l = 30; >l : number +>30 : number private method1() { >method1 : () => void @@ -107,15 +119,19 @@ export module m1 { } private x = 10; >x : number +>10 : number public y = 30; >y : number +>30 : number static k = 20; >k : number +>20 : number private static l = 30; >l : number +>30 : number private method1() { >method1 : () => void @@ -156,15 +172,19 @@ module m2 { } private x = 10; >x : number +>10 : number public y = 30; >y : number +>30 : number static k = 20; >k : number +>20 : number private static l = 30; >l : number +>30 : number private method1() { >method1 : () => void @@ -186,15 +206,19 @@ module m2 { } private x = 10; >x : number +>10 : number public y = 30; >y : number +>30 : number static k = 20; >k : number +>20 : number private static l = 30; >l : number +>30 : number private method1() { >method1 : () => void diff --git a/tests/baselines/reference/es6ModuleConst.symbols b/tests/baselines/reference/es6ModuleConst.symbols new file mode 100644 index 00000000000..539188ce1cc --- /dev/null +++ b/tests/baselines/reference/es6ModuleConst.symbols @@ -0,0 +1,70 @@ +=== tests/cases/compiler/es6ModuleConst.ts === +export const a = "hello"; +>a : Symbol(a, Decl(es6ModuleConst.ts, 0, 12)) + +export const x: string = a, y = x; +>x : Symbol(x, Decl(es6ModuleConst.ts, 1, 12)) +>a : Symbol(a, Decl(es6ModuleConst.ts, 0, 12)) +>y : Symbol(y, Decl(es6ModuleConst.ts, 1, 27)) +>x : Symbol(x, Decl(es6ModuleConst.ts, 1, 12)) + +const b = y; +>b : Symbol(b, Decl(es6ModuleConst.ts, 2, 5)) +>y : Symbol(y, Decl(es6ModuleConst.ts, 1, 27)) + +const c: string = b, d = c; +>c : Symbol(c, Decl(es6ModuleConst.ts, 3, 5)) +>b : Symbol(b, Decl(es6ModuleConst.ts, 2, 5)) +>d : Symbol(d, Decl(es6ModuleConst.ts, 3, 20)) +>c : Symbol(c, Decl(es6ModuleConst.ts, 3, 5)) + +export module m1 { +>m1 : Symbol(m1, Decl(es6ModuleConst.ts, 3, 27)) + + export const k = a; +>k : Symbol(k, Decl(es6ModuleConst.ts, 5, 16)) +>a : Symbol(a, Decl(es6ModuleConst.ts, 0, 12)) + + export const l: string = b, m = k; +>l : Symbol(l, Decl(es6ModuleConst.ts, 6, 16)) +>b : Symbol(b, Decl(es6ModuleConst.ts, 2, 5)) +>m : Symbol(m, Decl(es6ModuleConst.ts, 6, 31)) +>k : Symbol(k, Decl(es6ModuleConst.ts, 5, 16)) + + const n = m1.k; +>n : Symbol(n, Decl(es6ModuleConst.ts, 7, 9)) +>m1.k : Symbol(k, Decl(es6ModuleConst.ts, 5, 16)) +>m1 : Symbol(m1, Decl(es6ModuleConst.ts, 3, 27)) +>k : Symbol(k, Decl(es6ModuleConst.ts, 5, 16)) + + const o: string = n, p = k; +>o : Symbol(o, Decl(es6ModuleConst.ts, 8, 9)) +>n : Symbol(n, Decl(es6ModuleConst.ts, 7, 9)) +>p : Symbol(p, Decl(es6ModuleConst.ts, 8, 24)) +>k : Symbol(k, Decl(es6ModuleConst.ts, 5, 16)) +} +module m2 { +>m2 : Symbol(m2, Decl(es6ModuleConst.ts, 9, 1)) + + export const k = a; +>k : Symbol(k, Decl(es6ModuleConst.ts, 11, 16)) +>a : Symbol(a, Decl(es6ModuleConst.ts, 0, 12)) + + export const l: string = b, m = k; +>l : Symbol(l, Decl(es6ModuleConst.ts, 12, 16)) +>b : Symbol(b, Decl(es6ModuleConst.ts, 2, 5)) +>m : Symbol(m, Decl(es6ModuleConst.ts, 12, 31)) +>k : Symbol(k, Decl(es6ModuleConst.ts, 11, 16)) + + const n = m1.k; +>n : Symbol(n, Decl(es6ModuleConst.ts, 13, 9)) +>m1.k : Symbol(m1.k, Decl(es6ModuleConst.ts, 5, 16)) +>m1 : Symbol(m1, Decl(es6ModuleConst.ts, 3, 27)) +>k : Symbol(m1.k, Decl(es6ModuleConst.ts, 5, 16)) + + const o: string = n, p = k; +>o : Symbol(o, Decl(es6ModuleConst.ts, 14, 9)) +>n : Symbol(n, Decl(es6ModuleConst.ts, 13, 9)) +>p : Symbol(p, Decl(es6ModuleConst.ts, 14, 24)) +>k : Symbol(k, Decl(es6ModuleConst.ts, 11, 16)) +} diff --git a/tests/baselines/reference/es6ModuleConst.types b/tests/baselines/reference/es6ModuleConst.types index cceb74a5e1e..99b9f7c2980 100644 --- a/tests/baselines/reference/es6ModuleConst.types +++ b/tests/baselines/reference/es6ModuleConst.types @@ -1,6 +1,7 @@ === tests/cases/compiler/es6ModuleConst.ts === export const a = "hello"; >a : string +>"hello" : string export const x: string = a, y = x; >x : string diff --git a/tests/baselines/reference/es6ModuleConstEnumDeclaration.symbols b/tests/baselines/reference/es6ModuleConstEnumDeclaration.symbols new file mode 100644 index 00000000000..391ef85c599 --- /dev/null +++ b/tests/baselines/reference/es6ModuleConstEnumDeclaration.symbols @@ -0,0 +1,147 @@ +=== tests/cases/compiler/es6ModuleConstEnumDeclaration.ts === +export const enum e1 { +>e1 : Symbol(e1, Decl(es6ModuleConstEnumDeclaration.ts, 0, 0)) + + a, +>a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration.ts, 0, 22)) + + b, +>b : Symbol(e1.b, Decl(es6ModuleConstEnumDeclaration.ts, 1, 6)) + + c +>c : Symbol(e1.c, Decl(es6ModuleConstEnumDeclaration.ts, 2, 6)) +} +const enum e2 { +>e2 : Symbol(e2, Decl(es6ModuleConstEnumDeclaration.ts, 4, 1)) + + x, +>x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration.ts, 5, 15)) + + y, +>y : Symbol(e2.y, Decl(es6ModuleConstEnumDeclaration.ts, 6, 6)) + + z +>z : Symbol(e2.z, Decl(es6ModuleConstEnumDeclaration.ts, 7, 6)) +} +var x = e1.a; +>x : Symbol(x, Decl(es6ModuleConstEnumDeclaration.ts, 10, 3)) +>e1.a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration.ts, 0, 22)) +>e1 : Symbol(e1, Decl(es6ModuleConstEnumDeclaration.ts, 0, 0)) +>a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration.ts, 0, 22)) + +var y = e2.x; +>y : Symbol(y, Decl(es6ModuleConstEnumDeclaration.ts, 11, 3)) +>e2.x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration.ts, 5, 15)) +>e2 : Symbol(e2, Decl(es6ModuleConstEnumDeclaration.ts, 4, 1)) +>x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration.ts, 5, 15)) + +export module m1 { +>m1 : Symbol(m1, Decl(es6ModuleConstEnumDeclaration.ts, 11, 13)) + + export const enum e3 { +>e3 : Symbol(e3, Decl(es6ModuleConstEnumDeclaration.ts, 12, 18)) + + a, +>a : Symbol(e3.a, Decl(es6ModuleConstEnumDeclaration.ts, 13, 26)) + + b, +>b : Symbol(e3.b, Decl(es6ModuleConstEnumDeclaration.ts, 14, 10)) + + c +>c : Symbol(e3.c, Decl(es6ModuleConstEnumDeclaration.ts, 15, 10)) + } + const enum e4 { +>e4 : Symbol(e4, Decl(es6ModuleConstEnumDeclaration.ts, 17, 5)) + + x, +>x : Symbol(e4.x, Decl(es6ModuleConstEnumDeclaration.ts, 18, 19)) + + y, +>y : Symbol(e4.y, Decl(es6ModuleConstEnumDeclaration.ts, 19, 10)) + + z +>z : Symbol(e4.z, Decl(es6ModuleConstEnumDeclaration.ts, 20, 10)) + } + var x1 = e1.a; +>x1 : Symbol(x1, Decl(es6ModuleConstEnumDeclaration.ts, 23, 7)) +>e1.a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration.ts, 0, 22)) +>e1 : Symbol(e1, Decl(es6ModuleConstEnumDeclaration.ts, 0, 0)) +>a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration.ts, 0, 22)) + + var y1 = e2.x; +>y1 : Symbol(y1, Decl(es6ModuleConstEnumDeclaration.ts, 24, 7)) +>e2.x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration.ts, 5, 15)) +>e2 : Symbol(e2, Decl(es6ModuleConstEnumDeclaration.ts, 4, 1)) +>x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration.ts, 5, 15)) + + var x2 = e3.a; +>x2 : Symbol(x2, Decl(es6ModuleConstEnumDeclaration.ts, 25, 7)) +>e3.a : Symbol(e3.a, Decl(es6ModuleConstEnumDeclaration.ts, 13, 26)) +>e3 : Symbol(e3, Decl(es6ModuleConstEnumDeclaration.ts, 12, 18)) +>a : Symbol(e3.a, Decl(es6ModuleConstEnumDeclaration.ts, 13, 26)) + + var y2 = e4.x; +>y2 : Symbol(y2, Decl(es6ModuleConstEnumDeclaration.ts, 26, 7)) +>e4.x : Symbol(e4.x, Decl(es6ModuleConstEnumDeclaration.ts, 18, 19)) +>e4 : Symbol(e4, Decl(es6ModuleConstEnumDeclaration.ts, 17, 5)) +>x : Symbol(e4.x, Decl(es6ModuleConstEnumDeclaration.ts, 18, 19)) +} +module m2 { +>m2 : Symbol(m2, Decl(es6ModuleConstEnumDeclaration.ts, 27, 1)) + + export const enum e5 { +>e5 : Symbol(e5, Decl(es6ModuleConstEnumDeclaration.ts, 28, 11)) + + a, +>a : Symbol(e5.a, Decl(es6ModuleConstEnumDeclaration.ts, 29, 26)) + + b, +>b : Symbol(e5.b, Decl(es6ModuleConstEnumDeclaration.ts, 30, 10)) + + c +>c : Symbol(e5.c, Decl(es6ModuleConstEnumDeclaration.ts, 31, 10)) + } + const enum e6 { +>e6 : Symbol(e6, Decl(es6ModuleConstEnumDeclaration.ts, 33, 5)) + + x, +>x : Symbol(e6.x, Decl(es6ModuleConstEnumDeclaration.ts, 34, 19)) + + y, +>y : Symbol(e6.y, Decl(es6ModuleConstEnumDeclaration.ts, 35, 10)) + + z +>z : Symbol(e6.z, Decl(es6ModuleConstEnumDeclaration.ts, 36, 10)) + } + var x1 = e1.a; +>x1 : Symbol(x1, Decl(es6ModuleConstEnumDeclaration.ts, 39, 7)) +>e1.a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration.ts, 0, 22)) +>e1 : Symbol(e1, Decl(es6ModuleConstEnumDeclaration.ts, 0, 0)) +>a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration.ts, 0, 22)) + + var y1 = e2.x; +>y1 : Symbol(y1, Decl(es6ModuleConstEnumDeclaration.ts, 40, 7)) +>e2.x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration.ts, 5, 15)) +>e2 : Symbol(e2, Decl(es6ModuleConstEnumDeclaration.ts, 4, 1)) +>x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration.ts, 5, 15)) + + var x2 = e5.a; +>x2 : Symbol(x2, Decl(es6ModuleConstEnumDeclaration.ts, 41, 7)) +>e5.a : Symbol(e5.a, Decl(es6ModuleConstEnumDeclaration.ts, 29, 26)) +>e5 : Symbol(e5, Decl(es6ModuleConstEnumDeclaration.ts, 28, 11)) +>a : Symbol(e5.a, Decl(es6ModuleConstEnumDeclaration.ts, 29, 26)) + + var y2 = e6.x; +>y2 : Symbol(y2, Decl(es6ModuleConstEnumDeclaration.ts, 42, 7)) +>e6.x : Symbol(e6.x, Decl(es6ModuleConstEnumDeclaration.ts, 34, 19)) +>e6 : Symbol(e6, Decl(es6ModuleConstEnumDeclaration.ts, 33, 5)) +>x : Symbol(e6.x, Decl(es6ModuleConstEnumDeclaration.ts, 34, 19)) + + var x3 = m1.e3.a; +>x3 : Symbol(x3, Decl(es6ModuleConstEnumDeclaration.ts, 43, 7)) +>m1.e3.a : Symbol(m1.e3.a, Decl(es6ModuleConstEnumDeclaration.ts, 13, 26)) +>m1.e3 : Symbol(m1.e3, Decl(es6ModuleConstEnumDeclaration.ts, 12, 18)) +>m1 : Symbol(m1, Decl(es6ModuleConstEnumDeclaration.ts, 11, 13)) +>e3 : Symbol(m1.e3, Decl(es6ModuleConstEnumDeclaration.ts, 12, 18)) +>a : Symbol(m1.e3.a, Decl(es6ModuleConstEnumDeclaration.ts, 13, 26)) +} diff --git a/tests/baselines/reference/es6ModuleConstEnumDeclaration2.symbols b/tests/baselines/reference/es6ModuleConstEnumDeclaration2.symbols new file mode 100644 index 00000000000..2e756cf2875 --- /dev/null +++ b/tests/baselines/reference/es6ModuleConstEnumDeclaration2.symbols @@ -0,0 +1,148 @@ +=== tests/cases/compiler/es6ModuleConstEnumDeclaration2.ts === + +export const enum e1 { +>e1 : Symbol(e1, Decl(es6ModuleConstEnumDeclaration2.ts, 0, 0)) + + a, +>a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration2.ts, 1, 22)) + + b, +>b : Symbol(e1.b, Decl(es6ModuleConstEnumDeclaration2.ts, 2, 6)) + + c +>c : Symbol(e1.c, Decl(es6ModuleConstEnumDeclaration2.ts, 3, 6)) +} +const enum e2 { +>e2 : Symbol(e2, Decl(es6ModuleConstEnumDeclaration2.ts, 5, 1)) + + x, +>x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration2.ts, 6, 15)) + + y, +>y : Symbol(e2.y, Decl(es6ModuleConstEnumDeclaration2.ts, 7, 6)) + + z +>z : Symbol(e2.z, Decl(es6ModuleConstEnumDeclaration2.ts, 8, 6)) +} +var x = e1.a; +>x : Symbol(x, Decl(es6ModuleConstEnumDeclaration2.ts, 11, 3)) +>e1.a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration2.ts, 1, 22)) +>e1 : Symbol(e1, Decl(es6ModuleConstEnumDeclaration2.ts, 0, 0)) +>a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration2.ts, 1, 22)) + +var y = e2.x; +>y : Symbol(y, Decl(es6ModuleConstEnumDeclaration2.ts, 12, 3)) +>e2.x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration2.ts, 6, 15)) +>e2 : Symbol(e2, Decl(es6ModuleConstEnumDeclaration2.ts, 5, 1)) +>x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration2.ts, 6, 15)) + +export module m1 { +>m1 : Symbol(m1, Decl(es6ModuleConstEnumDeclaration2.ts, 12, 13)) + + export const enum e3 { +>e3 : Symbol(e3, Decl(es6ModuleConstEnumDeclaration2.ts, 13, 18)) + + a, +>a : Symbol(e3.a, Decl(es6ModuleConstEnumDeclaration2.ts, 14, 26)) + + b, +>b : Symbol(e3.b, Decl(es6ModuleConstEnumDeclaration2.ts, 15, 10)) + + c +>c : Symbol(e3.c, Decl(es6ModuleConstEnumDeclaration2.ts, 16, 10)) + } + const enum e4 { +>e4 : Symbol(e4, Decl(es6ModuleConstEnumDeclaration2.ts, 18, 5)) + + x, +>x : Symbol(e4.x, Decl(es6ModuleConstEnumDeclaration2.ts, 19, 19)) + + y, +>y : Symbol(e4.y, Decl(es6ModuleConstEnumDeclaration2.ts, 20, 10)) + + z +>z : Symbol(e4.z, Decl(es6ModuleConstEnumDeclaration2.ts, 21, 10)) + } + var x1 = e1.a; +>x1 : Symbol(x1, Decl(es6ModuleConstEnumDeclaration2.ts, 24, 7)) +>e1.a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration2.ts, 1, 22)) +>e1 : Symbol(e1, Decl(es6ModuleConstEnumDeclaration2.ts, 0, 0)) +>a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration2.ts, 1, 22)) + + var y1 = e2.x; +>y1 : Symbol(y1, Decl(es6ModuleConstEnumDeclaration2.ts, 25, 7)) +>e2.x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration2.ts, 6, 15)) +>e2 : Symbol(e2, Decl(es6ModuleConstEnumDeclaration2.ts, 5, 1)) +>x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration2.ts, 6, 15)) + + var x2 = e3.a; +>x2 : Symbol(x2, Decl(es6ModuleConstEnumDeclaration2.ts, 26, 7)) +>e3.a : Symbol(e3.a, Decl(es6ModuleConstEnumDeclaration2.ts, 14, 26)) +>e3 : Symbol(e3, Decl(es6ModuleConstEnumDeclaration2.ts, 13, 18)) +>a : Symbol(e3.a, Decl(es6ModuleConstEnumDeclaration2.ts, 14, 26)) + + var y2 = e4.x; +>y2 : Symbol(y2, Decl(es6ModuleConstEnumDeclaration2.ts, 27, 7)) +>e4.x : Symbol(e4.x, Decl(es6ModuleConstEnumDeclaration2.ts, 19, 19)) +>e4 : Symbol(e4, Decl(es6ModuleConstEnumDeclaration2.ts, 18, 5)) +>x : Symbol(e4.x, Decl(es6ModuleConstEnumDeclaration2.ts, 19, 19)) +} +module m2 { +>m2 : Symbol(m2, Decl(es6ModuleConstEnumDeclaration2.ts, 28, 1)) + + export const enum e5 { +>e5 : Symbol(e5, Decl(es6ModuleConstEnumDeclaration2.ts, 29, 11)) + + a, +>a : Symbol(e5.a, Decl(es6ModuleConstEnumDeclaration2.ts, 30, 26)) + + b, +>b : Symbol(e5.b, Decl(es6ModuleConstEnumDeclaration2.ts, 31, 10)) + + c +>c : Symbol(e5.c, Decl(es6ModuleConstEnumDeclaration2.ts, 32, 10)) + } + const enum e6 { +>e6 : Symbol(e6, Decl(es6ModuleConstEnumDeclaration2.ts, 34, 5)) + + x, +>x : Symbol(e6.x, Decl(es6ModuleConstEnumDeclaration2.ts, 35, 19)) + + y, +>y : Symbol(e6.y, Decl(es6ModuleConstEnumDeclaration2.ts, 36, 10)) + + z +>z : Symbol(e6.z, Decl(es6ModuleConstEnumDeclaration2.ts, 37, 10)) + } + var x1 = e1.a; +>x1 : Symbol(x1, Decl(es6ModuleConstEnumDeclaration2.ts, 40, 7)) +>e1.a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration2.ts, 1, 22)) +>e1 : Symbol(e1, Decl(es6ModuleConstEnumDeclaration2.ts, 0, 0)) +>a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration2.ts, 1, 22)) + + var y1 = e2.x; +>y1 : Symbol(y1, Decl(es6ModuleConstEnumDeclaration2.ts, 41, 7)) +>e2.x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration2.ts, 6, 15)) +>e2 : Symbol(e2, Decl(es6ModuleConstEnumDeclaration2.ts, 5, 1)) +>x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration2.ts, 6, 15)) + + var x2 = e5.a; +>x2 : Symbol(x2, Decl(es6ModuleConstEnumDeclaration2.ts, 42, 7)) +>e5.a : Symbol(e5.a, Decl(es6ModuleConstEnumDeclaration2.ts, 30, 26)) +>e5 : Symbol(e5, Decl(es6ModuleConstEnumDeclaration2.ts, 29, 11)) +>a : Symbol(e5.a, Decl(es6ModuleConstEnumDeclaration2.ts, 30, 26)) + + var y2 = e6.x; +>y2 : Symbol(y2, Decl(es6ModuleConstEnumDeclaration2.ts, 43, 7)) +>e6.x : Symbol(e6.x, Decl(es6ModuleConstEnumDeclaration2.ts, 35, 19)) +>e6 : Symbol(e6, Decl(es6ModuleConstEnumDeclaration2.ts, 34, 5)) +>x : Symbol(e6.x, Decl(es6ModuleConstEnumDeclaration2.ts, 35, 19)) + + var x3 = m1.e3.a; +>x3 : Symbol(x3, Decl(es6ModuleConstEnumDeclaration2.ts, 44, 7)) +>m1.e3.a : Symbol(m1.e3.a, Decl(es6ModuleConstEnumDeclaration2.ts, 14, 26)) +>m1.e3 : Symbol(m1.e3, Decl(es6ModuleConstEnumDeclaration2.ts, 13, 18)) +>m1 : Symbol(m1, Decl(es6ModuleConstEnumDeclaration2.ts, 12, 13)) +>e3 : Symbol(m1.e3, Decl(es6ModuleConstEnumDeclaration2.ts, 13, 18)) +>a : Symbol(m1.e3.a, Decl(es6ModuleConstEnumDeclaration2.ts, 14, 26)) +} diff --git a/tests/baselines/reference/es6ModuleEnumDeclaration.symbols b/tests/baselines/reference/es6ModuleEnumDeclaration.symbols new file mode 100644 index 00000000000..eb7dd8bfb29 --- /dev/null +++ b/tests/baselines/reference/es6ModuleEnumDeclaration.symbols @@ -0,0 +1,147 @@ +=== tests/cases/compiler/es6ModuleEnumDeclaration.ts === +export enum e1 { +>e1 : Symbol(e1, Decl(es6ModuleEnumDeclaration.ts, 0, 0)) + + a, +>a : Symbol(e1.a, Decl(es6ModuleEnumDeclaration.ts, 0, 16)) + + b, +>b : Symbol(e1.b, Decl(es6ModuleEnumDeclaration.ts, 1, 6)) + + c +>c : Symbol(e1.c, Decl(es6ModuleEnumDeclaration.ts, 2, 6)) +} +enum e2 { +>e2 : Symbol(e2, Decl(es6ModuleEnumDeclaration.ts, 4, 1)) + + x, +>x : Symbol(e2.x, Decl(es6ModuleEnumDeclaration.ts, 5, 9)) + + y, +>y : Symbol(e2.y, Decl(es6ModuleEnumDeclaration.ts, 6, 6)) + + z +>z : Symbol(e2.z, Decl(es6ModuleEnumDeclaration.ts, 7, 6)) +} +var x = e1.a; +>x : Symbol(x, Decl(es6ModuleEnumDeclaration.ts, 10, 3)) +>e1.a : Symbol(e1.a, Decl(es6ModuleEnumDeclaration.ts, 0, 16)) +>e1 : Symbol(e1, Decl(es6ModuleEnumDeclaration.ts, 0, 0)) +>a : Symbol(e1.a, Decl(es6ModuleEnumDeclaration.ts, 0, 16)) + +var y = e2.x; +>y : Symbol(y, Decl(es6ModuleEnumDeclaration.ts, 11, 3)) +>e2.x : Symbol(e2.x, Decl(es6ModuleEnumDeclaration.ts, 5, 9)) +>e2 : Symbol(e2, Decl(es6ModuleEnumDeclaration.ts, 4, 1)) +>x : Symbol(e2.x, Decl(es6ModuleEnumDeclaration.ts, 5, 9)) + +export module m1 { +>m1 : Symbol(m1, Decl(es6ModuleEnumDeclaration.ts, 11, 13)) + + export enum e3 { +>e3 : Symbol(e3, Decl(es6ModuleEnumDeclaration.ts, 12, 18)) + + a, +>a : Symbol(e3.a, Decl(es6ModuleEnumDeclaration.ts, 13, 20)) + + b, +>b : Symbol(e3.b, Decl(es6ModuleEnumDeclaration.ts, 14, 10)) + + c +>c : Symbol(e3.c, Decl(es6ModuleEnumDeclaration.ts, 15, 10)) + } + enum e4 { +>e4 : Symbol(e4, Decl(es6ModuleEnumDeclaration.ts, 17, 5)) + + x, +>x : Symbol(e4.x, Decl(es6ModuleEnumDeclaration.ts, 18, 13)) + + y, +>y : Symbol(e4.y, Decl(es6ModuleEnumDeclaration.ts, 19, 10)) + + z +>z : Symbol(e4.z, Decl(es6ModuleEnumDeclaration.ts, 20, 10)) + } + var x1 = e1.a; +>x1 : Symbol(x1, Decl(es6ModuleEnumDeclaration.ts, 23, 7)) +>e1.a : Symbol(e1.a, Decl(es6ModuleEnumDeclaration.ts, 0, 16)) +>e1 : Symbol(e1, Decl(es6ModuleEnumDeclaration.ts, 0, 0)) +>a : Symbol(e1.a, Decl(es6ModuleEnumDeclaration.ts, 0, 16)) + + var y1 = e2.x; +>y1 : Symbol(y1, Decl(es6ModuleEnumDeclaration.ts, 24, 7)) +>e2.x : Symbol(e2.x, Decl(es6ModuleEnumDeclaration.ts, 5, 9)) +>e2 : Symbol(e2, Decl(es6ModuleEnumDeclaration.ts, 4, 1)) +>x : Symbol(e2.x, Decl(es6ModuleEnumDeclaration.ts, 5, 9)) + + var x2 = e3.a; +>x2 : Symbol(x2, Decl(es6ModuleEnumDeclaration.ts, 25, 7)) +>e3.a : Symbol(e3.a, Decl(es6ModuleEnumDeclaration.ts, 13, 20)) +>e3 : Symbol(e3, Decl(es6ModuleEnumDeclaration.ts, 12, 18)) +>a : Symbol(e3.a, Decl(es6ModuleEnumDeclaration.ts, 13, 20)) + + var y2 = e4.x; +>y2 : Symbol(y2, Decl(es6ModuleEnumDeclaration.ts, 26, 7)) +>e4.x : Symbol(e4.x, Decl(es6ModuleEnumDeclaration.ts, 18, 13)) +>e4 : Symbol(e4, Decl(es6ModuleEnumDeclaration.ts, 17, 5)) +>x : Symbol(e4.x, Decl(es6ModuleEnumDeclaration.ts, 18, 13)) +} +module m2 { +>m2 : Symbol(m2, Decl(es6ModuleEnumDeclaration.ts, 27, 1)) + + export enum e5 { +>e5 : Symbol(e5, Decl(es6ModuleEnumDeclaration.ts, 28, 11)) + + a, +>a : Symbol(e5.a, Decl(es6ModuleEnumDeclaration.ts, 29, 20)) + + b, +>b : Symbol(e5.b, Decl(es6ModuleEnumDeclaration.ts, 30, 10)) + + c +>c : Symbol(e5.c, Decl(es6ModuleEnumDeclaration.ts, 31, 10)) + } + enum e6 { +>e6 : Symbol(e6, Decl(es6ModuleEnumDeclaration.ts, 33, 5)) + + x, +>x : Symbol(e6.x, Decl(es6ModuleEnumDeclaration.ts, 34, 13)) + + y, +>y : Symbol(e6.y, Decl(es6ModuleEnumDeclaration.ts, 35, 10)) + + z +>z : Symbol(e6.z, Decl(es6ModuleEnumDeclaration.ts, 36, 10)) + } + var x1 = e1.a; +>x1 : Symbol(x1, Decl(es6ModuleEnumDeclaration.ts, 39, 7)) +>e1.a : Symbol(e1.a, Decl(es6ModuleEnumDeclaration.ts, 0, 16)) +>e1 : Symbol(e1, Decl(es6ModuleEnumDeclaration.ts, 0, 0)) +>a : Symbol(e1.a, Decl(es6ModuleEnumDeclaration.ts, 0, 16)) + + var y1 = e2.x; +>y1 : Symbol(y1, Decl(es6ModuleEnumDeclaration.ts, 40, 7)) +>e2.x : Symbol(e2.x, Decl(es6ModuleEnumDeclaration.ts, 5, 9)) +>e2 : Symbol(e2, Decl(es6ModuleEnumDeclaration.ts, 4, 1)) +>x : Symbol(e2.x, Decl(es6ModuleEnumDeclaration.ts, 5, 9)) + + var x2 = e5.a; +>x2 : Symbol(x2, Decl(es6ModuleEnumDeclaration.ts, 41, 7)) +>e5.a : Symbol(e5.a, Decl(es6ModuleEnumDeclaration.ts, 29, 20)) +>e5 : Symbol(e5, Decl(es6ModuleEnumDeclaration.ts, 28, 11)) +>a : Symbol(e5.a, Decl(es6ModuleEnumDeclaration.ts, 29, 20)) + + var y2 = e6.x; +>y2 : Symbol(y2, Decl(es6ModuleEnumDeclaration.ts, 42, 7)) +>e6.x : Symbol(e6.x, Decl(es6ModuleEnumDeclaration.ts, 34, 13)) +>e6 : Symbol(e6, Decl(es6ModuleEnumDeclaration.ts, 33, 5)) +>x : Symbol(e6.x, Decl(es6ModuleEnumDeclaration.ts, 34, 13)) + + var x3 = m1.e3.a; +>x3 : Symbol(x3, Decl(es6ModuleEnumDeclaration.ts, 43, 7)) +>m1.e3.a : Symbol(m1.e3.a, Decl(es6ModuleEnumDeclaration.ts, 13, 20)) +>m1.e3 : Symbol(m1.e3, Decl(es6ModuleEnumDeclaration.ts, 12, 18)) +>m1 : Symbol(m1, Decl(es6ModuleEnumDeclaration.ts, 11, 13)) +>e3 : Symbol(m1.e3, Decl(es6ModuleEnumDeclaration.ts, 12, 18)) +>a : Symbol(m1.e3.a, Decl(es6ModuleEnumDeclaration.ts, 13, 20)) +} diff --git a/tests/baselines/reference/es6ModuleFunctionDeclaration.symbols b/tests/baselines/reference/es6ModuleFunctionDeclaration.symbols new file mode 100644 index 00000000000..e58c40ed3ef --- /dev/null +++ b/tests/baselines/reference/es6ModuleFunctionDeclaration.symbols @@ -0,0 +1,60 @@ +=== tests/cases/compiler/es6ModuleFunctionDeclaration.ts === +export function foo() { +>foo : Symbol(foo, Decl(es6ModuleFunctionDeclaration.ts, 0, 0)) +} +function foo2() { +>foo2 : Symbol(foo2, Decl(es6ModuleFunctionDeclaration.ts, 1, 1)) +} +foo(); +>foo : Symbol(foo, Decl(es6ModuleFunctionDeclaration.ts, 0, 0)) + +foo2(); +>foo2 : Symbol(foo2, Decl(es6ModuleFunctionDeclaration.ts, 1, 1)) + +export module m1 { +>m1 : Symbol(m1, Decl(es6ModuleFunctionDeclaration.ts, 5, 7)) + + export function foo3() { +>foo3 : Symbol(foo3, Decl(es6ModuleFunctionDeclaration.ts, 7, 18)) + } + function foo4() { +>foo4 : Symbol(foo4, Decl(es6ModuleFunctionDeclaration.ts, 9, 5)) + } + foo(); +>foo : Symbol(foo, Decl(es6ModuleFunctionDeclaration.ts, 0, 0)) + + foo2(); +>foo2 : Symbol(foo2, Decl(es6ModuleFunctionDeclaration.ts, 1, 1)) + + foo3(); +>foo3 : Symbol(foo3, Decl(es6ModuleFunctionDeclaration.ts, 7, 18)) + + foo4(); +>foo4 : Symbol(foo4, Decl(es6ModuleFunctionDeclaration.ts, 9, 5)) +} +module m2 { +>m2 : Symbol(m2, Decl(es6ModuleFunctionDeclaration.ts, 16, 1)) + + export function foo3() { +>foo3 : Symbol(foo3, Decl(es6ModuleFunctionDeclaration.ts, 17, 11)) + } + function foo4() { +>foo4 : Symbol(foo4, Decl(es6ModuleFunctionDeclaration.ts, 19, 5)) + } + foo(); +>foo : Symbol(foo, Decl(es6ModuleFunctionDeclaration.ts, 0, 0)) + + foo2(); +>foo2 : Symbol(foo2, Decl(es6ModuleFunctionDeclaration.ts, 1, 1)) + + foo3(); +>foo3 : Symbol(foo3, Decl(es6ModuleFunctionDeclaration.ts, 17, 11)) + + foo4(); +>foo4 : Symbol(foo4, Decl(es6ModuleFunctionDeclaration.ts, 19, 5)) + + m1.foo3(); +>m1.foo3 : Symbol(m1.foo3, Decl(es6ModuleFunctionDeclaration.ts, 7, 18)) +>m1 : Symbol(m1, Decl(es6ModuleFunctionDeclaration.ts, 5, 7)) +>foo3 : Symbol(m1.foo3, Decl(es6ModuleFunctionDeclaration.ts, 7, 18)) +} diff --git a/tests/baselines/reference/es6ModuleInternalImport.symbols b/tests/baselines/reference/es6ModuleInternalImport.symbols new file mode 100644 index 00000000000..146549d5767 --- /dev/null +++ b/tests/baselines/reference/es6ModuleInternalImport.symbols @@ -0,0 +1,77 @@ +=== tests/cases/compiler/es6ModuleInternalImport.ts === +export module m { +>m : Symbol(m, Decl(es6ModuleInternalImport.ts, 0, 0)) + + export var a = 10; +>a : Symbol(a, Decl(es6ModuleInternalImport.ts, 1, 14)) +} +export import a1 = m.a; +>a1 : Symbol(a1, Decl(es6ModuleInternalImport.ts, 2, 1)) +>m : Symbol(m, Decl(es6ModuleInternalImport.ts, 0, 0)) +>a : Symbol(a2, Decl(es6ModuleInternalImport.ts, 1, 14)) + +import a2 = m.a; +>a2 : Symbol(a2, Decl(es6ModuleInternalImport.ts, 3, 23)) +>m : Symbol(m, Decl(es6ModuleInternalImport.ts, 0, 0)) +>a : Symbol(a2, Decl(es6ModuleInternalImport.ts, 1, 14)) + +var x = a1 + a2; +>x : Symbol(x, Decl(es6ModuleInternalImport.ts, 5, 3)) +>a1 : Symbol(a1, Decl(es6ModuleInternalImport.ts, 2, 1)) +>a2 : Symbol(a2, Decl(es6ModuleInternalImport.ts, 3, 23)) + +export module m1 { +>m1 : Symbol(m1, Decl(es6ModuleInternalImport.ts, 5, 16)) + + export import a3 = m.a; +>a3 : Symbol(a3, Decl(es6ModuleInternalImport.ts, 6, 18)) +>m : Symbol(m, Decl(es6ModuleInternalImport.ts, 0, 0)) +>a : Symbol(a4, Decl(es6ModuleInternalImport.ts, 1, 14)) + + import a4 = m.a; +>a4 : Symbol(a4, Decl(es6ModuleInternalImport.ts, 7, 27)) +>m : Symbol(m, Decl(es6ModuleInternalImport.ts, 0, 0)) +>a : Symbol(a4, Decl(es6ModuleInternalImport.ts, 1, 14)) + + var x = a1 + a2; +>x : Symbol(x, Decl(es6ModuleInternalImport.ts, 9, 7)) +>a1 : Symbol(a1, Decl(es6ModuleInternalImport.ts, 2, 1)) +>a2 : Symbol(a2, Decl(es6ModuleInternalImport.ts, 3, 23)) + + var x2 = a3 + a4; +>x2 : Symbol(x2, Decl(es6ModuleInternalImport.ts, 10, 7)) +>a3 : Symbol(a3, Decl(es6ModuleInternalImport.ts, 6, 18)) +>a4 : Symbol(a4, Decl(es6ModuleInternalImport.ts, 7, 27)) +} +module m2 { +>m2 : Symbol(m2, Decl(es6ModuleInternalImport.ts, 11, 1)) + + export import a3 = m.a; +>a3 : Symbol(a3, Decl(es6ModuleInternalImport.ts, 12, 11)) +>m : Symbol(m, Decl(es6ModuleInternalImport.ts, 0, 0)) +>a : Symbol(a4, Decl(es6ModuleInternalImport.ts, 1, 14)) + + import a4 = m.a; +>a4 : Symbol(a4, Decl(es6ModuleInternalImport.ts, 13, 27)) +>m : Symbol(m, Decl(es6ModuleInternalImport.ts, 0, 0)) +>a : Symbol(a4, Decl(es6ModuleInternalImport.ts, 1, 14)) + + var x = a1 + a2; +>x : Symbol(x, Decl(es6ModuleInternalImport.ts, 15, 7)) +>a1 : Symbol(a1, Decl(es6ModuleInternalImport.ts, 2, 1)) +>a2 : Symbol(a2, Decl(es6ModuleInternalImport.ts, 3, 23)) + + var x2 = a3 + a4; +>x2 : Symbol(x2, Decl(es6ModuleInternalImport.ts, 16, 7)) +>a3 : Symbol(a3, Decl(es6ModuleInternalImport.ts, 12, 11)) +>a4 : Symbol(a4, Decl(es6ModuleInternalImport.ts, 13, 27)) + + var x4 = m1.a3 + m2.a3; +>x4 : Symbol(x4, Decl(es6ModuleInternalImport.ts, 17, 7)) +>m1.a3 : Symbol(m1.a3, Decl(es6ModuleInternalImport.ts, 6, 18)) +>m1 : Symbol(m1, Decl(es6ModuleInternalImport.ts, 5, 16)) +>a3 : Symbol(m1.a3, Decl(es6ModuleInternalImport.ts, 6, 18)) +>m2.a3 : Symbol(a3, Decl(es6ModuleInternalImport.ts, 12, 11)) +>m2 : Symbol(m2, Decl(es6ModuleInternalImport.ts, 11, 1)) +>a3 : Symbol(a3, Decl(es6ModuleInternalImport.ts, 12, 11)) +} diff --git a/tests/baselines/reference/es6ModuleInternalImport.types b/tests/baselines/reference/es6ModuleInternalImport.types index 50db69d8edb..5d7fd527afd 100644 --- a/tests/baselines/reference/es6ModuleInternalImport.types +++ b/tests/baselines/reference/es6ModuleInternalImport.types @@ -4,6 +4,7 @@ export module m { export var a = 10; >a : number +>10 : number } export import a1 = m.a; >a1 : number diff --git a/tests/baselines/reference/es6ModuleLet.symbols b/tests/baselines/reference/es6ModuleLet.symbols new file mode 100644 index 00000000000..f81f128e850 --- /dev/null +++ b/tests/baselines/reference/es6ModuleLet.symbols @@ -0,0 +1,70 @@ +=== tests/cases/compiler/es6ModuleLet.ts === +export let a = "hello"; +>a : Symbol(a, Decl(es6ModuleLet.ts, 0, 10)) + +export let x: string = a, y = x; +>x : Symbol(x, Decl(es6ModuleLet.ts, 1, 10)) +>a : Symbol(a, Decl(es6ModuleLet.ts, 0, 10)) +>y : Symbol(y, Decl(es6ModuleLet.ts, 1, 25)) +>x : Symbol(x, Decl(es6ModuleLet.ts, 1, 10)) + +let b = y; +>b : Symbol(b, Decl(es6ModuleLet.ts, 2, 3)) +>y : Symbol(y, Decl(es6ModuleLet.ts, 1, 25)) + +let c: string = b, d = c; +>c : Symbol(c, Decl(es6ModuleLet.ts, 3, 3)) +>b : Symbol(b, Decl(es6ModuleLet.ts, 2, 3)) +>d : Symbol(d, Decl(es6ModuleLet.ts, 3, 18)) +>c : Symbol(c, Decl(es6ModuleLet.ts, 3, 3)) + +export module m1 { +>m1 : Symbol(m1, Decl(es6ModuleLet.ts, 3, 25)) + + export let k = a; +>k : Symbol(k, Decl(es6ModuleLet.ts, 5, 14)) +>a : Symbol(a, Decl(es6ModuleLet.ts, 0, 10)) + + export let l: string = b, m = k; +>l : Symbol(l, Decl(es6ModuleLet.ts, 6, 14)) +>b : Symbol(b, Decl(es6ModuleLet.ts, 2, 3)) +>m : Symbol(m, Decl(es6ModuleLet.ts, 6, 29)) +>k : Symbol(k, Decl(es6ModuleLet.ts, 5, 14)) + + let n = m1.k; +>n : Symbol(n, Decl(es6ModuleLet.ts, 7, 7)) +>m1.k : Symbol(k, Decl(es6ModuleLet.ts, 5, 14)) +>m1 : Symbol(m1, Decl(es6ModuleLet.ts, 3, 25)) +>k : Symbol(k, Decl(es6ModuleLet.ts, 5, 14)) + + let o: string = n, p = k; +>o : Symbol(o, Decl(es6ModuleLet.ts, 8, 7)) +>n : Symbol(n, Decl(es6ModuleLet.ts, 7, 7)) +>p : Symbol(p, Decl(es6ModuleLet.ts, 8, 22)) +>k : Symbol(k, Decl(es6ModuleLet.ts, 5, 14)) +} +module m2 { +>m2 : Symbol(m2, Decl(es6ModuleLet.ts, 9, 1)) + + export let k = a; +>k : Symbol(k, Decl(es6ModuleLet.ts, 11, 14)) +>a : Symbol(a, Decl(es6ModuleLet.ts, 0, 10)) + + export let l: string = b, m = k; +>l : Symbol(l, Decl(es6ModuleLet.ts, 12, 14)) +>b : Symbol(b, Decl(es6ModuleLet.ts, 2, 3)) +>m : Symbol(m, Decl(es6ModuleLet.ts, 12, 29)) +>k : Symbol(k, Decl(es6ModuleLet.ts, 11, 14)) + + let n = m1.k; +>n : Symbol(n, Decl(es6ModuleLet.ts, 13, 7)) +>m1.k : Symbol(m1.k, Decl(es6ModuleLet.ts, 5, 14)) +>m1 : Symbol(m1, Decl(es6ModuleLet.ts, 3, 25)) +>k : Symbol(m1.k, Decl(es6ModuleLet.ts, 5, 14)) + + let o: string = n, p = k; +>o : Symbol(o, Decl(es6ModuleLet.ts, 14, 7)) +>n : Symbol(n, Decl(es6ModuleLet.ts, 13, 7)) +>p : Symbol(p, Decl(es6ModuleLet.ts, 14, 22)) +>k : Symbol(k, Decl(es6ModuleLet.ts, 11, 14)) +} diff --git a/tests/baselines/reference/es6ModuleLet.types b/tests/baselines/reference/es6ModuleLet.types index 4b30c89cc81..9e670c0a1e1 100644 --- a/tests/baselines/reference/es6ModuleLet.types +++ b/tests/baselines/reference/es6ModuleLet.types @@ -1,6 +1,7 @@ === tests/cases/compiler/es6ModuleLet.ts === export let a = "hello"; >a : string +>"hello" : string export let x: string = a, y = x; >x : string diff --git a/tests/baselines/reference/es6ModuleModuleDeclaration.symbols b/tests/baselines/reference/es6ModuleModuleDeclaration.symbols new file mode 100644 index 00000000000..9fb3cbb2524 --- /dev/null +++ b/tests/baselines/reference/es6ModuleModuleDeclaration.symbols @@ -0,0 +1,57 @@ +=== tests/cases/compiler/es6ModuleModuleDeclaration.ts === +export module m1 { +>m1 : Symbol(m1, Decl(es6ModuleModuleDeclaration.ts, 0, 0)) + + export var a = 10; +>a : Symbol(a, Decl(es6ModuleModuleDeclaration.ts, 1, 14)) + + var b = 10; +>b : Symbol(b, Decl(es6ModuleModuleDeclaration.ts, 2, 7)) + + export module innerExportedModule { +>innerExportedModule : Symbol(innerExportedModule, Decl(es6ModuleModuleDeclaration.ts, 2, 15)) + + export var k = 10; +>k : Symbol(k, Decl(es6ModuleModuleDeclaration.ts, 4, 18)) + + var l = 10; +>l : Symbol(l, Decl(es6ModuleModuleDeclaration.ts, 5, 11)) + } + export module innerNonExportedModule { +>innerNonExportedModule : Symbol(innerNonExportedModule, Decl(es6ModuleModuleDeclaration.ts, 6, 5)) + + export var x = 10; +>x : Symbol(x, Decl(es6ModuleModuleDeclaration.ts, 8, 18)) + + var y = 10; +>y : Symbol(y, Decl(es6ModuleModuleDeclaration.ts, 9, 11)) + } +} +module m2 { +>m2 : Symbol(m2, Decl(es6ModuleModuleDeclaration.ts, 11, 1)) + + export var a = 10; +>a : Symbol(a, Decl(es6ModuleModuleDeclaration.ts, 13, 14)) + + var b = 10; +>b : Symbol(b, Decl(es6ModuleModuleDeclaration.ts, 14, 7)) + + export module innerExportedModule { +>innerExportedModule : Symbol(innerExportedModule, Decl(es6ModuleModuleDeclaration.ts, 14, 15)) + + export var k = 10; +>k : Symbol(k, Decl(es6ModuleModuleDeclaration.ts, 16, 18)) + + var l = 10; +>l : Symbol(l, Decl(es6ModuleModuleDeclaration.ts, 17, 11)) + } + export module innerNonExportedModule { +>innerNonExportedModule : Symbol(innerNonExportedModule, Decl(es6ModuleModuleDeclaration.ts, 18, 5)) + + export var x = 10; +>x : Symbol(x, Decl(es6ModuleModuleDeclaration.ts, 20, 18)) + + var y = 10; +>y : Symbol(y, Decl(es6ModuleModuleDeclaration.ts, 21, 11)) + } +} diff --git a/tests/baselines/reference/es6ModuleModuleDeclaration.types b/tests/baselines/reference/es6ModuleModuleDeclaration.types index c174fe6f8c7..6fb5a7c98f5 100644 --- a/tests/baselines/reference/es6ModuleModuleDeclaration.types +++ b/tests/baselines/reference/es6ModuleModuleDeclaration.types @@ -4,27 +4,33 @@ export module m1 { export var a = 10; >a : number +>10 : number var b = 10; >b : number +>10 : number export module innerExportedModule { >innerExportedModule : typeof innerExportedModule export var k = 10; >k : number +>10 : number var l = 10; >l : number +>10 : number } export module innerNonExportedModule { >innerNonExportedModule : typeof innerNonExportedModule export var x = 10; >x : number +>10 : number var y = 10; >y : number +>10 : number } } module m2 { @@ -32,26 +38,32 @@ module m2 { export var a = 10; >a : number +>10 : number var b = 10; >b : number +>10 : number export module innerExportedModule { >innerExportedModule : typeof innerExportedModule export var k = 10; >k : number +>10 : number var l = 10; >l : number +>10 : number } export module innerNonExportedModule { >innerNonExportedModule : typeof innerNonExportedModule export var x = 10; >x : number +>10 : number var y = 10; >y : number +>10 : number } } diff --git a/tests/baselines/reference/es6ModuleVariableStatement.symbols b/tests/baselines/reference/es6ModuleVariableStatement.symbols new file mode 100644 index 00000000000..744dd580ba4 --- /dev/null +++ b/tests/baselines/reference/es6ModuleVariableStatement.symbols @@ -0,0 +1,70 @@ +=== tests/cases/compiler/es6ModuleVariableStatement.ts === +export var a = "hello"; +>a : Symbol(a, Decl(es6ModuleVariableStatement.ts, 0, 10)) + +export var x: string = a, y = x; +>x : Symbol(x, Decl(es6ModuleVariableStatement.ts, 1, 10)) +>a : Symbol(a, Decl(es6ModuleVariableStatement.ts, 0, 10)) +>y : Symbol(y, Decl(es6ModuleVariableStatement.ts, 1, 25)) +>x : Symbol(x, Decl(es6ModuleVariableStatement.ts, 1, 10)) + +var b = y; +>b : Symbol(b, Decl(es6ModuleVariableStatement.ts, 2, 3)) +>y : Symbol(y, Decl(es6ModuleVariableStatement.ts, 1, 25)) + +var c: string = b, d = c; +>c : Symbol(c, Decl(es6ModuleVariableStatement.ts, 3, 3)) +>b : Symbol(b, Decl(es6ModuleVariableStatement.ts, 2, 3)) +>d : Symbol(d, Decl(es6ModuleVariableStatement.ts, 3, 18)) +>c : Symbol(c, Decl(es6ModuleVariableStatement.ts, 3, 3)) + +export module m1 { +>m1 : Symbol(m1, Decl(es6ModuleVariableStatement.ts, 3, 25)) + + export var k = a; +>k : Symbol(k, Decl(es6ModuleVariableStatement.ts, 5, 14)) +>a : Symbol(a, Decl(es6ModuleVariableStatement.ts, 0, 10)) + + export var l: string = b, m = k; +>l : Symbol(l, Decl(es6ModuleVariableStatement.ts, 6, 14)) +>b : Symbol(b, Decl(es6ModuleVariableStatement.ts, 2, 3)) +>m : Symbol(m, Decl(es6ModuleVariableStatement.ts, 6, 29)) +>k : Symbol(k, Decl(es6ModuleVariableStatement.ts, 5, 14)) + + var n = m1.k; +>n : Symbol(n, Decl(es6ModuleVariableStatement.ts, 7, 7)) +>m1.k : Symbol(k, Decl(es6ModuleVariableStatement.ts, 5, 14)) +>m1 : Symbol(m1, Decl(es6ModuleVariableStatement.ts, 3, 25)) +>k : Symbol(k, Decl(es6ModuleVariableStatement.ts, 5, 14)) + + var o: string = n, p = k; +>o : Symbol(o, Decl(es6ModuleVariableStatement.ts, 8, 7)) +>n : Symbol(n, Decl(es6ModuleVariableStatement.ts, 7, 7)) +>p : Symbol(p, Decl(es6ModuleVariableStatement.ts, 8, 22)) +>k : Symbol(k, Decl(es6ModuleVariableStatement.ts, 5, 14)) +} +module m2 { +>m2 : Symbol(m2, Decl(es6ModuleVariableStatement.ts, 9, 1)) + + export var k = a; +>k : Symbol(k, Decl(es6ModuleVariableStatement.ts, 11, 14)) +>a : Symbol(a, Decl(es6ModuleVariableStatement.ts, 0, 10)) + + export var l: string = b, m = k; +>l : Symbol(l, Decl(es6ModuleVariableStatement.ts, 12, 14)) +>b : Symbol(b, Decl(es6ModuleVariableStatement.ts, 2, 3)) +>m : Symbol(m, Decl(es6ModuleVariableStatement.ts, 12, 29)) +>k : Symbol(k, Decl(es6ModuleVariableStatement.ts, 11, 14)) + + var n = m1.k; +>n : Symbol(n, Decl(es6ModuleVariableStatement.ts, 13, 7)) +>m1.k : Symbol(m1.k, Decl(es6ModuleVariableStatement.ts, 5, 14)) +>m1 : Symbol(m1, Decl(es6ModuleVariableStatement.ts, 3, 25)) +>k : Symbol(m1.k, Decl(es6ModuleVariableStatement.ts, 5, 14)) + + var o: string = n, p = k; +>o : Symbol(o, Decl(es6ModuleVariableStatement.ts, 14, 7)) +>n : Symbol(n, Decl(es6ModuleVariableStatement.ts, 13, 7)) +>p : Symbol(p, Decl(es6ModuleVariableStatement.ts, 14, 22)) +>k : Symbol(k, Decl(es6ModuleVariableStatement.ts, 11, 14)) +} diff --git a/tests/baselines/reference/es6ModuleVariableStatement.types b/tests/baselines/reference/es6ModuleVariableStatement.types index a10d8f6cacb..520430199e4 100644 --- a/tests/baselines/reference/es6ModuleVariableStatement.types +++ b/tests/baselines/reference/es6ModuleVariableStatement.types @@ -1,6 +1,7 @@ === tests/cases/compiler/es6ModuleVariableStatement.ts === export var a = "hello"; >a : string +>"hello" : string export var x: string = a, y = x; >x : string diff --git a/tests/baselines/reference/escapedIdentifiers.symbols b/tests/baselines/reference/escapedIdentifiers.symbols new file mode 100644 index 00000000000..6c84b25647f --- /dev/null +++ b/tests/baselines/reference/escapedIdentifiers.symbols @@ -0,0 +1,260 @@ +=== tests/cases/compiler/escapedIdentifiers.ts === +/* + 0 .. \u0030 + 9 .. \u0039 + + A .. \u0041 + Z .. \u005a + + a .. \u0061 + z .. \u00za +*/ + +// var decl +var \u0061 = 1; +>\u0061 : Symbol(\u0061, Decl(escapedIdentifiers.ts, 12, 3)) + +a ++; +>a : Symbol(\u0061, Decl(escapedIdentifiers.ts, 12, 3)) + +\u0061 ++; +>\u0061 : Symbol(\u0061, Decl(escapedIdentifiers.ts, 12, 3)) + +var b = 1; +>b : Symbol(b, Decl(escapedIdentifiers.ts, 16, 3)) + +b ++; +>b : Symbol(b, Decl(escapedIdentifiers.ts, 16, 3)) + +\u0062 ++; +>\u0062 : Symbol(b, Decl(escapedIdentifiers.ts, 16, 3)) + +// modules +module moduleType1 { +>moduleType1 : Symbol(moduleType1, Decl(escapedIdentifiers.ts, 18, 10)) + + export var baz1: number; +>baz1 : Symbol(baz1, Decl(escapedIdentifiers.ts, 22, 14)) +} +module moduleType\u0032 { +>moduleType\u0032 : Symbol(moduleType\u0032, Decl(escapedIdentifiers.ts, 23, 1)) + + export var baz2: number; +>baz2 : Symbol(baz2, Decl(escapedIdentifiers.ts, 25, 14)) +} + +moduleType1.baz1 = 3; +>moduleType1.baz1 : Symbol(moduleType1.baz1, Decl(escapedIdentifiers.ts, 22, 14)) +>moduleType1 : Symbol(moduleType1, Decl(escapedIdentifiers.ts, 18, 10)) +>baz1 : Symbol(moduleType1.baz1, Decl(escapedIdentifiers.ts, 22, 14)) + +moduleType\u0031.baz1 = 3; +>moduleType\u0031.baz1 : Symbol(moduleType1.baz1, Decl(escapedIdentifiers.ts, 22, 14)) +>moduleType\u0031 : Symbol(moduleType1, Decl(escapedIdentifiers.ts, 18, 10)) +>baz1 : Symbol(moduleType1.baz1, Decl(escapedIdentifiers.ts, 22, 14)) + +moduleType2.baz2 = 3; +>moduleType2.baz2 : Symbol(moduleType\u0032.baz2, Decl(escapedIdentifiers.ts, 25, 14)) +>moduleType2 : Symbol(moduleType\u0032, Decl(escapedIdentifiers.ts, 23, 1)) +>baz2 : Symbol(moduleType\u0032.baz2, Decl(escapedIdentifiers.ts, 25, 14)) + +moduleType\u0032.baz2 = 3; +>moduleType\u0032.baz2 : Symbol(moduleType\u0032.baz2, Decl(escapedIdentifiers.ts, 25, 14)) +>moduleType\u0032 : Symbol(moduleType\u0032, Decl(escapedIdentifiers.ts, 23, 1)) +>baz2 : Symbol(moduleType\u0032.baz2, Decl(escapedIdentifiers.ts, 25, 14)) + +// classes + +class classType1 { +>classType1 : Symbol(classType1, Decl(escapedIdentifiers.ts, 31, 26)) + + public foo1: number; +>foo1 : Symbol(foo1, Decl(escapedIdentifiers.ts, 35, 18)) +} +class classType\u0032 { +>classType\u0032 : Symbol(classType\u0032, Decl(escapedIdentifiers.ts, 37, 1)) + + public foo2: number; +>foo2 : Symbol(foo2, Decl(escapedIdentifiers.ts, 38, 23)) +} + +var classType1Object1 = new classType1(); +>classType1Object1 : Symbol(classType1Object1, Decl(escapedIdentifiers.ts, 42, 3)) +>classType1 : Symbol(classType1, Decl(escapedIdentifiers.ts, 31, 26)) + +classType1Object1.foo1 = 2; +>classType1Object1.foo1 : Symbol(classType1.foo1, Decl(escapedIdentifiers.ts, 35, 18)) +>classType1Object1 : Symbol(classType1Object1, Decl(escapedIdentifiers.ts, 42, 3)) +>foo1 : Symbol(classType1.foo1, Decl(escapedIdentifiers.ts, 35, 18)) + +var classType1Object2 = new classType\u0031(); +>classType1Object2 : Symbol(classType1Object2, Decl(escapedIdentifiers.ts, 44, 3)) +>classType\u0031 : Symbol(classType1, Decl(escapedIdentifiers.ts, 31, 26)) + +classType1Object2.foo1 = 2; +>classType1Object2.foo1 : Symbol(classType1.foo1, Decl(escapedIdentifiers.ts, 35, 18)) +>classType1Object2 : Symbol(classType1Object2, Decl(escapedIdentifiers.ts, 44, 3)) +>foo1 : Symbol(classType1.foo1, Decl(escapedIdentifiers.ts, 35, 18)) + +var classType2Object1 = new classType2(); +>classType2Object1 : Symbol(classType2Object1, Decl(escapedIdentifiers.ts, 46, 3)) +>classType2 : Symbol(classType\u0032, Decl(escapedIdentifiers.ts, 37, 1)) + +classType2Object1.foo2 = 2; +>classType2Object1.foo2 : Symbol(classType\u0032.foo2, Decl(escapedIdentifiers.ts, 38, 23)) +>classType2Object1 : Symbol(classType2Object1, Decl(escapedIdentifiers.ts, 46, 3)) +>foo2 : Symbol(classType\u0032.foo2, Decl(escapedIdentifiers.ts, 38, 23)) + +var classType2Object2 = new classType\u0032(); +>classType2Object2 : Symbol(classType2Object2, Decl(escapedIdentifiers.ts, 48, 3)) +>classType\u0032 : Symbol(classType\u0032, Decl(escapedIdentifiers.ts, 37, 1)) + +classType2Object2.foo2 = 2; +>classType2Object2.foo2 : Symbol(classType\u0032.foo2, Decl(escapedIdentifiers.ts, 38, 23)) +>classType2Object2 : Symbol(classType2Object2, Decl(escapedIdentifiers.ts, 48, 3)) +>foo2 : Symbol(classType\u0032.foo2, Decl(escapedIdentifiers.ts, 38, 23)) + +// interfaces +interface interfaceType1 { +>interfaceType1 : Symbol(interfaceType1, Decl(escapedIdentifiers.ts, 49, 27)) + + bar1: number; +>bar1 : Symbol(bar1, Decl(escapedIdentifiers.ts, 52, 26)) +} +interface interfaceType\u0032 { +>interfaceType\u0032 : Symbol(interfaceType\u0032, Decl(escapedIdentifiers.ts, 54, 1)) + + bar2: number; +>bar2 : Symbol(bar2, Decl(escapedIdentifiers.ts, 55, 31)) +} + +var interfaceType1Object1 = { bar1: 0 }; +>interfaceType1Object1 : Symbol(interfaceType1Object1, Decl(escapedIdentifiers.ts, 59, 3)) +>interfaceType1 : Symbol(interfaceType1, Decl(escapedIdentifiers.ts, 49, 27)) +>bar1 : Symbol(bar1, Decl(escapedIdentifiers.ts, 59, 45)) + +interfaceType1Object1.bar1 = 2; +>interfaceType1Object1.bar1 : Symbol(interfaceType1.bar1, Decl(escapedIdentifiers.ts, 52, 26)) +>interfaceType1Object1 : Symbol(interfaceType1Object1, Decl(escapedIdentifiers.ts, 59, 3)) +>bar1 : Symbol(interfaceType1.bar1, Decl(escapedIdentifiers.ts, 52, 26)) + +var interfaceType1Object2 = { bar1: 0 }; +>interfaceType1Object2 : Symbol(interfaceType1Object2, Decl(escapedIdentifiers.ts, 61, 3)) +>interfaceType\u0031 : Symbol(interfaceType1, Decl(escapedIdentifiers.ts, 49, 27)) +>bar1 : Symbol(bar1, Decl(escapedIdentifiers.ts, 61, 50)) + +interfaceType1Object2.bar1 = 2; +>interfaceType1Object2.bar1 : Symbol(interfaceType1.bar1, Decl(escapedIdentifiers.ts, 52, 26)) +>interfaceType1Object2 : Symbol(interfaceType1Object2, Decl(escapedIdentifiers.ts, 61, 3)) +>bar1 : Symbol(interfaceType1.bar1, Decl(escapedIdentifiers.ts, 52, 26)) + +var interfaceType2Object1 = { bar2: 0 }; +>interfaceType2Object1 : Symbol(interfaceType2Object1, Decl(escapedIdentifiers.ts, 63, 3)) +>interfaceType2 : Symbol(interfaceType\u0032, Decl(escapedIdentifiers.ts, 54, 1)) +>bar2 : Symbol(bar2, Decl(escapedIdentifiers.ts, 63, 45)) + +interfaceType2Object1.bar2 = 2; +>interfaceType2Object1.bar2 : Symbol(interfaceType\u0032.bar2, Decl(escapedIdentifiers.ts, 55, 31)) +>interfaceType2Object1 : Symbol(interfaceType2Object1, Decl(escapedIdentifiers.ts, 63, 3)) +>bar2 : Symbol(interfaceType\u0032.bar2, Decl(escapedIdentifiers.ts, 55, 31)) + +var interfaceType2Object2 = { bar2: 0 }; +>interfaceType2Object2 : Symbol(interfaceType2Object2, Decl(escapedIdentifiers.ts, 65, 3)) +>interfaceType\u0032 : Symbol(interfaceType\u0032, Decl(escapedIdentifiers.ts, 54, 1)) +>bar2 : Symbol(bar2, Decl(escapedIdentifiers.ts, 65, 50)) + +interfaceType2Object2.bar2 = 2; +>interfaceType2Object2.bar2 : Symbol(interfaceType\u0032.bar2, Decl(escapedIdentifiers.ts, 55, 31)) +>interfaceType2Object2 : Symbol(interfaceType2Object2, Decl(escapedIdentifiers.ts, 65, 3)) +>bar2 : Symbol(interfaceType\u0032.bar2, Decl(escapedIdentifiers.ts, 55, 31)) + + +// arguments +class testClass { +>testClass : Symbol(testClass, Decl(escapedIdentifiers.ts, 66, 31)) + + public func(arg1: number, arg\u0032: string, arg\u0033: boolean, arg4: number) { +>func : Symbol(func, Decl(escapedIdentifiers.ts, 70, 17)) +>arg1 : Symbol(arg1, Decl(escapedIdentifiers.ts, 71, 16)) +>arg\u0032 : Symbol(arg\u0032, Decl(escapedIdentifiers.ts, 71, 29)) +>arg\u0033 : Symbol(arg\u0033, Decl(escapedIdentifiers.ts, 71, 48)) +>arg4 : Symbol(arg4, Decl(escapedIdentifiers.ts, 71, 68)) + + arg\u0031 = 1; +>arg\u0031 : Symbol(arg1, Decl(escapedIdentifiers.ts, 71, 16)) + + arg2 = 'string'; +>arg2 : Symbol(arg\u0032, Decl(escapedIdentifiers.ts, 71, 29)) + + arg\u0033 = true; +>arg\u0033 : Symbol(arg\u0033, Decl(escapedIdentifiers.ts, 71, 48)) + + arg4 = 2; +>arg4 : Symbol(arg4, Decl(escapedIdentifiers.ts, 71, 68)) + } +} + +// constructors +class constructorTestClass { +>constructorTestClass : Symbol(constructorTestClass, Decl(escapedIdentifiers.ts, 77, 1)) + + constructor (public arg1: number,public arg\u0032: string,public arg\u0033: boolean,public arg4: number) { +>arg1 : Symbol(arg1, Decl(escapedIdentifiers.ts, 81, 17)) +>arg\u0032 : Symbol(arg\u0032, Decl(escapedIdentifiers.ts, 81, 37)) +>arg\u0033 : Symbol(arg\u0033, Decl(escapedIdentifiers.ts, 81, 62)) +>arg4 : Symbol(arg4, Decl(escapedIdentifiers.ts, 81, 88)) + } +} +var constructorTestObject = new constructorTestClass(1, 'string', true, 2); +>constructorTestObject : Symbol(constructorTestObject, Decl(escapedIdentifiers.ts, 84, 3)) +>constructorTestClass : Symbol(constructorTestClass, Decl(escapedIdentifiers.ts, 77, 1)) + +constructorTestObject.arg\u0031 = 1; +>constructorTestObject.arg\u0031 : Symbol(constructorTestClass.arg1, Decl(escapedIdentifiers.ts, 81, 17)) +>constructorTestObject : Symbol(constructorTestObject, Decl(escapedIdentifiers.ts, 84, 3)) +>arg\u0031 : Symbol(constructorTestClass.arg1, Decl(escapedIdentifiers.ts, 81, 17)) + +constructorTestObject.arg2 = 'string'; +>constructorTestObject.arg2 : Symbol(constructorTestClass.arg\u0032, Decl(escapedIdentifiers.ts, 81, 37)) +>constructorTestObject : Symbol(constructorTestObject, Decl(escapedIdentifiers.ts, 84, 3)) +>arg2 : Symbol(constructorTestClass.arg\u0032, Decl(escapedIdentifiers.ts, 81, 37)) + +constructorTestObject.arg\u0033 = true; +>constructorTestObject.arg\u0033 : Symbol(constructorTestClass.arg\u0033, Decl(escapedIdentifiers.ts, 81, 62)) +>constructorTestObject : Symbol(constructorTestObject, Decl(escapedIdentifiers.ts, 84, 3)) +>arg\u0033 : Symbol(constructorTestClass.arg\u0033, Decl(escapedIdentifiers.ts, 81, 62)) + +constructorTestObject.arg4 = 2; +>constructorTestObject.arg4 : Symbol(constructorTestClass.arg4, Decl(escapedIdentifiers.ts, 81, 88)) +>constructorTestObject : Symbol(constructorTestObject, Decl(escapedIdentifiers.ts, 84, 3)) +>arg4 : Symbol(constructorTestClass.arg4, Decl(escapedIdentifiers.ts, 81, 88)) + +// Lables + +l\u0061bel1: + while (false) + { + while(false) + continue label1; // it will go to next iteration of outer loop + } + +label2: + while (false) + { + while(false) + continue l\u0061bel2; // it will go to next iteration of outer loop + } + +label3: + while (false) + { + while(false) + continue label3; // it will go to next iteration of outer loop + } + +l\u0061bel4: + while (false) + { + while(false) + continue l\u0061bel4; // it will go to next iteration of outer loop + } diff --git a/tests/baselines/reference/escapedIdentifiers.types b/tests/baselines/reference/escapedIdentifiers.types index d0b6b1f5c42..b32d21a48cb 100644 --- a/tests/baselines/reference/escapedIdentifiers.types +++ b/tests/baselines/reference/escapedIdentifiers.types @@ -13,6 +13,7 @@ // var decl var \u0061 = 1; >\u0061 : number +>1 : number a ++; >a ++ : number @@ -24,6 +25,7 @@ a ++; var b = 1; >b : number +>1 : number b ++; >b ++ : number @@ -52,24 +54,28 @@ moduleType1.baz1 = 3; >moduleType1.baz1 : number >moduleType1 : typeof moduleType1 >baz1 : number +>3 : number moduleType\u0031.baz1 = 3; >moduleType\u0031.baz1 = 3 : number >moduleType\u0031.baz1 : number >moduleType\u0031 : typeof moduleType1 >baz1 : number +>3 : number moduleType2.baz2 = 3; >moduleType2.baz2 = 3 : number >moduleType2.baz2 : number >moduleType2 : typeof moduleType\u0032 >baz2 : number +>3 : number moduleType\u0032.baz2 = 3; >moduleType\u0032.baz2 = 3 : number >moduleType\u0032.baz2 : number >moduleType\u0032 : typeof moduleType\u0032 >baz2 : number +>3 : number // classes @@ -96,6 +102,7 @@ classType1Object1.foo1 = 2; >classType1Object1.foo1 : number >classType1Object1 : classType1 >foo1 : number +>2 : number var classType1Object2 = new classType\u0031(); >classType1Object2 : classType1 @@ -107,6 +114,7 @@ classType1Object2.foo1 = 2; >classType1Object2.foo1 : number >classType1Object2 : classType1 >foo1 : number +>2 : number var classType2Object1 = new classType2(); >classType2Object1 : classType\u0032 @@ -118,6 +126,7 @@ classType2Object1.foo2 = 2; >classType2Object1.foo2 : number >classType2Object1 : classType\u0032 >foo2 : number +>2 : number var classType2Object2 = new classType\u0032(); >classType2Object2 : classType\u0032 @@ -129,6 +138,7 @@ classType2Object2.foo2 = 2; >classType2Object2.foo2 : number >classType2Object2 : classType\u0032 >foo2 : number +>2 : number // interfaces interface interfaceType1 { @@ -150,12 +160,14 @@ var interfaceType1Object1 = { bar1: 0 }; >interfaceType1 : interfaceType1 >{ bar1: 0 } : { bar1: number; } >bar1 : number +>0 : number interfaceType1Object1.bar1 = 2; >interfaceType1Object1.bar1 = 2 : number >interfaceType1Object1.bar1 : number >interfaceType1Object1 : interfaceType1 >bar1 : number +>2 : number var interfaceType1Object2 = { bar1: 0 }; >interfaceType1Object2 : interfaceType1 @@ -163,12 +175,14 @@ var interfaceType1Object2 = { bar1: 0 }; >interfaceType\u0031 : interfaceType1 >{ bar1: 0 } : { bar1: number; } >bar1 : number +>0 : number interfaceType1Object2.bar1 = 2; >interfaceType1Object2.bar1 = 2 : number >interfaceType1Object2.bar1 : number >interfaceType1Object2 : interfaceType1 >bar1 : number +>2 : number var interfaceType2Object1 = { bar2: 0 }; >interfaceType2Object1 : interfaceType\u0032 @@ -176,12 +190,14 @@ var interfaceType2Object1 = { bar2: 0 }; >interfaceType2 : interfaceType\u0032 >{ bar2: 0 } : { bar2: number; } >bar2 : number +>0 : number interfaceType2Object1.bar2 = 2; >interfaceType2Object1.bar2 = 2 : number >interfaceType2Object1.bar2 : number >interfaceType2Object1 : interfaceType\u0032 >bar2 : number +>2 : number var interfaceType2Object2 = { bar2: 0 }; >interfaceType2Object2 : interfaceType\u0032 @@ -189,12 +205,14 @@ var interfaceType2Object2 = { bar2: 0 }; >interfaceType\u0032 : interfaceType\u0032 >{ bar2: 0 } : { bar2: number; } >bar2 : number +>0 : number interfaceType2Object2.bar2 = 2; >interfaceType2Object2.bar2 = 2 : number >interfaceType2Object2.bar2 : number >interfaceType2Object2 : interfaceType\u0032 >bar2 : number +>2 : number // arguments @@ -211,18 +229,22 @@ class testClass { arg\u0031 = 1; >arg\u0031 = 1 : number >arg\u0031 : number +>1 : number arg2 = 'string'; >arg2 = 'string' : string >arg2 : string +>'string' : string arg\u0033 = true; >arg\u0033 = true : boolean >arg\u0033 : boolean +>true : boolean arg4 = 2; >arg4 = 2 : number >arg4 : number +>2 : number } } @@ -241,57 +263,89 @@ var constructorTestObject = new constructorTestClass(1, 'string', true, 2); >constructorTestObject : constructorTestClass >new constructorTestClass(1, 'string', true, 2) : constructorTestClass >constructorTestClass : typeof constructorTestClass +>1 : number +>'string' : string +>true : boolean +>2 : number constructorTestObject.arg\u0031 = 1; >constructorTestObject.arg\u0031 = 1 : number >constructorTestObject.arg\u0031 : number >constructorTestObject : constructorTestClass >arg\u0031 : number +>1 : number constructorTestObject.arg2 = 'string'; >constructorTestObject.arg2 = 'string' : string >constructorTestObject.arg2 : string >constructorTestObject : constructorTestClass >arg2 : string +>'string' : string constructorTestObject.arg\u0033 = true; >constructorTestObject.arg\u0033 = true : boolean >constructorTestObject.arg\u0033 : boolean >constructorTestObject : constructorTestClass >arg\u0033 : boolean +>true : boolean constructorTestObject.arg4 = 2; >constructorTestObject.arg4 = 2 : number >constructorTestObject.arg4 : number >constructorTestObject : constructorTestClass >arg4 : number +>2 : number // Lables l\u0061bel1: +>l\u0061bel1 : any + while (false) +>false : boolean { while(false) +>false : boolean + continue label1; // it will go to next iteration of outer loop +>label1 : any } label2: +>label2 : any + while (false) +>false : boolean { while(false) +>false : boolean + continue l\u0061bel2; // it will go to next iteration of outer loop +>l\u0061bel2 : any } label3: +>label3 : any + while (false) +>false : boolean { while(false) +>false : boolean + continue label3; // it will go to next iteration of outer loop +>label3 : any } l\u0061bel4: +>l\u0061bel4 : any + while (false) +>false : boolean { while(false) +>false : boolean + continue l\u0061bel4; // it will go to next iteration of outer loop +>l\u0061bel4 : any } diff --git a/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.symbols b/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.symbols new file mode 100644 index 00000000000..b629c5bd875 --- /dev/null +++ b/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.symbols @@ -0,0 +1,79 @@ +=== tests/cases/compiler/escapedReservedCompilerNamedIdentifier.ts === +// double underscores +var __proto__ = 10; +>__proto__ : Symbol(__proto__, Decl(escapedReservedCompilerNamedIdentifier.ts, 1, 3)) + +var o = { +>o : Symbol(o, Decl(escapedReservedCompilerNamedIdentifier.ts, 2, 3)) + + "__proto__": 0 +}; +var b = o["__proto__"]; +>b : Symbol(b, Decl(escapedReservedCompilerNamedIdentifier.ts, 5, 3)) +>o : Symbol(o, Decl(escapedReservedCompilerNamedIdentifier.ts, 2, 3)) +>"__proto__" : Symbol("__proto__", Decl(escapedReservedCompilerNamedIdentifier.ts, 2, 9)) + +var o1 = { +>o1 : Symbol(o1, Decl(escapedReservedCompilerNamedIdentifier.ts, 6, 3)) + + __proto__: 0 +>__proto__ : Symbol(__proto__, Decl(escapedReservedCompilerNamedIdentifier.ts, 6, 10)) + +}; +var b1 = o1["__proto__"]; +>b1 : Symbol(b1, Decl(escapedReservedCompilerNamedIdentifier.ts, 9, 3)) +>o1 : Symbol(o1, Decl(escapedReservedCompilerNamedIdentifier.ts, 6, 3)) +>"__proto__" : Symbol(__proto__, Decl(escapedReservedCompilerNamedIdentifier.ts, 6, 10)) + +// Triple underscores +var ___proto__ = 10; +>___proto__ : Symbol(___proto__, Decl(escapedReservedCompilerNamedIdentifier.ts, 11, 3)) + +var o2 = { +>o2 : Symbol(o2, Decl(escapedReservedCompilerNamedIdentifier.ts, 12, 3)) + + "___proto__": 0 +}; +var b2 = o2["___proto__"]; +>b2 : Symbol(b2, Decl(escapedReservedCompilerNamedIdentifier.ts, 15, 3)) +>o2 : Symbol(o2, Decl(escapedReservedCompilerNamedIdentifier.ts, 12, 3)) +>"___proto__" : Symbol("___proto__", Decl(escapedReservedCompilerNamedIdentifier.ts, 12, 10)) + +var o3 = { +>o3 : Symbol(o3, Decl(escapedReservedCompilerNamedIdentifier.ts, 16, 3)) + + ___proto__: 0 +>___proto__ : Symbol(___proto__, Decl(escapedReservedCompilerNamedIdentifier.ts, 16, 10)) + +}; +var b3 = o3["___proto__"]; +>b3 : Symbol(b3, Decl(escapedReservedCompilerNamedIdentifier.ts, 19, 3)) +>o3 : Symbol(o3, Decl(escapedReservedCompilerNamedIdentifier.ts, 16, 3)) +>"___proto__" : Symbol(___proto__, Decl(escapedReservedCompilerNamedIdentifier.ts, 16, 10)) + +// One underscore +var _proto__ = 10; +>_proto__ : Symbol(_proto__, Decl(escapedReservedCompilerNamedIdentifier.ts, 21, 3)) + +var o4 = { +>o4 : Symbol(o4, Decl(escapedReservedCompilerNamedIdentifier.ts, 22, 3)) + + "_proto__": 0 +}; +var b4 = o4["_proto__"]; +>b4 : Symbol(b4, Decl(escapedReservedCompilerNamedIdentifier.ts, 25, 3)) +>o4 : Symbol(o4, Decl(escapedReservedCompilerNamedIdentifier.ts, 22, 3)) +>"_proto__" : Symbol("_proto__", Decl(escapedReservedCompilerNamedIdentifier.ts, 22, 10)) + +var o5 = { +>o5 : Symbol(o5, Decl(escapedReservedCompilerNamedIdentifier.ts, 26, 3)) + + _proto__: 0 +>_proto__ : Symbol(_proto__, Decl(escapedReservedCompilerNamedIdentifier.ts, 26, 10)) + +}; +var b5 = o5["_proto__"]; +>b5 : Symbol(b5, Decl(escapedReservedCompilerNamedIdentifier.ts, 29, 3)) +>o5 : Symbol(o5, Decl(escapedReservedCompilerNamedIdentifier.ts, 26, 3)) +>"_proto__" : Symbol(_proto__, Decl(escapedReservedCompilerNamedIdentifier.ts, 26, 10)) + diff --git a/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.types b/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.types index f54c7b80757..1ebbf8aedb2 100644 --- a/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.types +++ b/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.types @@ -2,17 +2,21 @@ // double underscores var __proto__ = 10; >__proto__ : number +>10 : number var o = { >o : { "__proto__": number; } >{ "__proto__": 0} : { "__proto__": number; } "__proto__": 0 +>0 : number + }; var b = o["__proto__"]; >b : number >o["__proto__"] : number >o : { "__proto__": number; } +>"__proto__" : string var o1 = { >o1 : { __proto__: number; } @@ -20,27 +24,33 @@ var o1 = { __proto__: 0 >__proto__ : number +>0 : number }; var b1 = o1["__proto__"]; >b1 : number >o1["__proto__"] : number >o1 : { __proto__: number; } +>"__proto__" : string // Triple underscores var ___proto__ = 10; >___proto__ : number +>10 : number var o2 = { >o2 : { "___proto__": number; } >{ "___proto__": 0} : { "___proto__": number; } "___proto__": 0 +>0 : number + }; var b2 = o2["___proto__"]; >b2 : number >o2["___proto__"] : number >o2 : { "___proto__": number; } +>"___proto__" : string var o3 = { >o3 : { ___proto__: number; } @@ -48,27 +58,33 @@ var o3 = { ___proto__: 0 >___proto__ : number +>0 : number }; var b3 = o3["___proto__"]; >b3 : number >o3["___proto__"] : number >o3 : { ___proto__: number; } +>"___proto__" : string // One underscore var _proto__ = 10; >_proto__ : number +>10 : number var o4 = { >o4 : { "_proto__": number; } >{ "_proto__": 0} : { "_proto__": number; } "_proto__": 0 +>0 : number + }; var b4 = o4["_proto__"]; >b4 : number >o4["_proto__"] : number >o4 : { "_proto__": number; } +>"_proto__" : string var o5 = { >o5 : { _proto__: number; } @@ -76,10 +92,12 @@ var o5 = { _proto__: 0 >_proto__ : number +>0 : number }; var b5 = o5["_proto__"]; >b5 : number >o5["_proto__"] : number >o5 : { _proto__: number; } +>"_proto__" : string diff --git a/tests/baselines/reference/everyTypeAssignableToAny.symbols b/tests/baselines/reference/everyTypeAssignableToAny.symbols new file mode 100644 index 00000000000..275a58641d2 --- /dev/null +++ b/tests/baselines/reference/everyTypeAssignableToAny.symbols @@ -0,0 +1,193 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/everyTypeAssignableToAny.ts === +var a: any; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) + +class C { +>C : Symbol(C, Decl(everyTypeAssignableToAny.ts, 0, 11)) + + foo: string; +>foo : Symbol(foo, Decl(everyTypeAssignableToAny.ts, 2, 9)) +} +var ac: C; +>ac : Symbol(ac, Decl(everyTypeAssignableToAny.ts, 5, 3)) +>C : Symbol(C, Decl(everyTypeAssignableToAny.ts, 0, 11)) + +interface I { +>I : Symbol(I, Decl(everyTypeAssignableToAny.ts, 5, 10)) + + foo: string; +>foo : Symbol(foo, Decl(everyTypeAssignableToAny.ts, 6, 13)) +} +var ai: I; +>ai : Symbol(ai, Decl(everyTypeAssignableToAny.ts, 9, 3)) +>I : Symbol(I, Decl(everyTypeAssignableToAny.ts, 5, 10)) + +enum E { A } +>E : Symbol(E, Decl(everyTypeAssignableToAny.ts, 9, 10)) +>A : Symbol(E.A, Decl(everyTypeAssignableToAny.ts, 11, 8)) + +var ae: E; +>ae : Symbol(ae, Decl(everyTypeAssignableToAny.ts, 12, 3)) +>E : Symbol(E, Decl(everyTypeAssignableToAny.ts, 9, 10)) + +var b: number; +>b : Symbol(b, Decl(everyTypeAssignableToAny.ts, 14, 3)) + +var c: string; +>c : Symbol(c, Decl(everyTypeAssignableToAny.ts, 15, 3)) + +var d: boolean; +>d : Symbol(d, Decl(everyTypeAssignableToAny.ts, 16, 3)) + +var e: Date; +>e : Symbol(e, Decl(everyTypeAssignableToAny.ts, 17, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var f: any; +>f : Symbol(f, Decl(everyTypeAssignableToAny.ts, 18, 3)) + +var g: void; +>g : Symbol(g, Decl(everyTypeAssignableToAny.ts, 19, 3)) + +var h: Object; +>h : Symbol(h, Decl(everyTypeAssignableToAny.ts, 20, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var i: {}; +>i : Symbol(i, Decl(everyTypeAssignableToAny.ts, 21, 3)) + +var j: () => {}; +>j : Symbol(j, Decl(everyTypeAssignableToAny.ts, 22, 3)) + +var k: Function; +>k : Symbol(k, Decl(everyTypeAssignableToAny.ts, 23, 3)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) + +var l: (x: number) => string; +>l : Symbol(l, Decl(everyTypeAssignableToAny.ts, 24, 3)) +>x : Symbol(x, Decl(everyTypeAssignableToAny.ts, 24, 8)) + +var m: number[]; +>m : Symbol(m, Decl(everyTypeAssignableToAny.ts, 25, 3)) + +var n: { foo: string }; +>n : Symbol(n, Decl(everyTypeAssignableToAny.ts, 26, 3)) +>foo : Symbol(foo, Decl(everyTypeAssignableToAny.ts, 26, 8)) + +var o: (x: T) => T; +>o : Symbol(o, Decl(everyTypeAssignableToAny.ts, 27, 3)) +>T : Symbol(T, Decl(everyTypeAssignableToAny.ts, 27, 8)) +>x : Symbol(x, Decl(everyTypeAssignableToAny.ts, 27, 11)) +>T : Symbol(T, Decl(everyTypeAssignableToAny.ts, 27, 8)) +>T : Symbol(T, Decl(everyTypeAssignableToAny.ts, 27, 8)) + +var p: Number; +>p : Symbol(p, Decl(everyTypeAssignableToAny.ts, 28, 3)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +var q: String; +>q : Symbol(q, Decl(everyTypeAssignableToAny.ts, 29, 3)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +a = b; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>b : Symbol(b, Decl(everyTypeAssignableToAny.ts, 14, 3)) + +a = c; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>c : Symbol(c, Decl(everyTypeAssignableToAny.ts, 15, 3)) + +a = d; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>d : Symbol(d, Decl(everyTypeAssignableToAny.ts, 16, 3)) + +a = e; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>e : Symbol(e, Decl(everyTypeAssignableToAny.ts, 17, 3)) + +a = f; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>f : Symbol(f, Decl(everyTypeAssignableToAny.ts, 18, 3)) + +a = g; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>g : Symbol(g, Decl(everyTypeAssignableToAny.ts, 19, 3)) + +a = h; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>h : Symbol(h, Decl(everyTypeAssignableToAny.ts, 20, 3)) + +a = i; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>i : Symbol(i, Decl(everyTypeAssignableToAny.ts, 21, 3)) + +a = j; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>j : Symbol(j, Decl(everyTypeAssignableToAny.ts, 22, 3)) + +a = k; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>k : Symbol(k, Decl(everyTypeAssignableToAny.ts, 23, 3)) + +a = l; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>l : Symbol(l, Decl(everyTypeAssignableToAny.ts, 24, 3)) + +a = m; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>m : Symbol(m, Decl(everyTypeAssignableToAny.ts, 25, 3)) + +a = o; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>o : Symbol(o, Decl(everyTypeAssignableToAny.ts, 27, 3)) + +a = p; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>p : Symbol(p, Decl(everyTypeAssignableToAny.ts, 28, 3)) + +a = q; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>q : Symbol(q, Decl(everyTypeAssignableToAny.ts, 29, 3)) + +a = ac; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>ac : Symbol(ac, Decl(everyTypeAssignableToAny.ts, 5, 3)) + +a = ai; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>ai : Symbol(ai, Decl(everyTypeAssignableToAny.ts, 9, 3)) + +a = ae; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>ae : Symbol(ae, Decl(everyTypeAssignableToAny.ts, 12, 3)) + +function foo(x: T, y: U, z: V) { +>foo : Symbol(foo, Decl(everyTypeAssignableToAny.ts, 48, 7)) +>T : Symbol(T, Decl(everyTypeAssignableToAny.ts, 50, 13)) +>U : Symbol(U, Decl(everyTypeAssignableToAny.ts, 50, 15)) +>V : Symbol(V, Decl(everyTypeAssignableToAny.ts, 50, 32)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>x : Symbol(x, Decl(everyTypeAssignableToAny.ts, 50, 49)) +>T : Symbol(T, Decl(everyTypeAssignableToAny.ts, 50, 13)) +>y : Symbol(y, Decl(everyTypeAssignableToAny.ts, 50, 54)) +>U : Symbol(U, Decl(everyTypeAssignableToAny.ts, 50, 15)) +>z : Symbol(z, Decl(everyTypeAssignableToAny.ts, 50, 60)) +>V : Symbol(V, Decl(everyTypeAssignableToAny.ts, 50, 32)) + + a = x; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>x : Symbol(x, Decl(everyTypeAssignableToAny.ts, 50, 49)) + + a = y; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>y : Symbol(y, Decl(everyTypeAssignableToAny.ts, 50, 54)) + + a = z; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>z : Symbol(z, Decl(everyTypeAssignableToAny.ts, 50, 60)) +} +//function foo(x: T, y: U, z: V) { +// a = x; +// a = y; +// a = z; +//} diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.symbols b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.symbols new file mode 100644 index 00000000000..489903750f5 --- /dev/null +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.symbols @@ -0,0 +1,146 @@ +=== tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInitializer.ts === +interface I { +>I : Symbol(I, Decl(everyTypeWithAnnotationAndInitializer.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(everyTypeWithAnnotationAndInitializer.ts, 0, 13)) +} + +class C implements I { +>C : Symbol(C, Decl(everyTypeWithAnnotationAndInitializer.ts, 2, 1)) +>I : Symbol(I, Decl(everyTypeWithAnnotationAndInitializer.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(everyTypeWithAnnotationAndInitializer.ts, 4, 22)) +} + +class D{ +>D : Symbol(D, Decl(everyTypeWithAnnotationAndInitializer.ts, 6, 1)) +>T : Symbol(T, Decl(everyTypeWithAnnotationAndInitializer.ts, 8, 8)) + + source: T; +>source : Symbol(source, Decl(everyTypeWithAnnotationAndInitializer.ts, 8, 11)) +>T : Symbol(T, Decl(everyTypeWithAnnotationAndInitializer.ts, 8, 8)) + + recurse: D; +>recurse : Symbol(recurse, Decl(everyTypeWithAnnotationAndInitializer.ts, 9, 14)) +>D : Symbol(D, Decl(everyTypeWithAnnotationAndInitializer.ts, 6, 1)) +>T : Symbol(T, Decl(everyTypeWithAnnotationAndInitializer.ts, 8, 8)) + + wrapped: D> +>wrapped : Symbol(wrapped, Decl(everyTypeWithAnnotationAndInitializer.ts, 10, 18)) +>D : Symbol(D, Decl(everyTypeWithAnnotationAndInitializer.ts, 6, 1)) +>D : Symbol(D, Decl(everyTypeWithAnnotationAndInitializer.ts, 6, 1)) +>T : Symbol(T, Decl(everyTypeWithAnnotationAndInitializer.ts, 8, 8)) +} + +function F(x: string): number { return 42; } +>F : Symbol(F, Decl(everyTypeWithAnnotationAndInitializer.ts, 12, 1)) +>x : Symbol(x, Decl(everyTypeWithAnnotationAndInitializer.ts, 14, 11)) + +module M { +>M : Symbol(M, Decl(everyTypeWithAnnotationAndInitializer.ts, 14, 44)) + + export class A { +>A : Symbol(A, Decl(everyTypeWithAnnotationAndInitializer.ts, 16, 10)) + + name: string; +>name : Symbol(name, Decl(everyTypeWithAnnotationAndInitializer.ts, 17, 20)) + } + + export function F2(x: number): string { return x.toString(); } +>F2 : Symbol(F2, Decl(everyTypeWithAnnotationAndInitializer.ts, 19, 5)) +>x : Symbol(x, Decl(everyTypeWithAnnotationAndInitializer.ts, 21, 23)) +>x.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>x : Symbol(x, Decl(everyTypeWithAnnotationAndInitializer.ts, 21, 23)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +} + +var aNumber: number = 9.9; +>aNumber : Symbol(aNumber, Decl(everyTypeWithAnnotationAndInitializer.ts, 24, 3)) + +var aString: string = 'this is a string'; +>aString : Symbol(aString, Decl(everyTypeWithAnnotationAndInitializer.ts, 25, 3)) + +var aDate: Date = new Date(12); +>aDate : Symbol(aDate, Decl(everyTypeWithAnnotationAndInitializer.ts, 26, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var anObject: Object = new Object(); +>anObject : Symbol(anObject, Decl(everyTypeWithAnnotationAndInitializer.ts, 27, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var anAny: any = null; +>anAny : Symbol(anAny, Decl(everyTypeWithAnnotationAndInitializer.ts, 29, 3)) + +var aSecondAny: any = undefined; +>aSecondAny : Symbol(aSecondAny, Decl(everyTypeWithAnnotationAndInitializer.ts, 30, 3)) +>undefined : Symbol(undefined) + +var aVoid: void = undefined; +>aVoid : Symbol(aVoid, Decl(everyTypeWithAnnotationAndInitializer.ts, 31, 3)) +>undefined : Symbol(undefined) + +var anInterface: I = new C(); +>anInterface : Symbol(anInterface, Decl(everyTypeWithAnnotationAndInitializer.ts, 33, 3)) +>I : Symbol(I, Decl(everyTypeWithAnnotationAndInitializer.ts, 0, 0)) +>C : Symbol(C, Decl(everyTypeWithAnnotationAndInitializer.ts, 2, 1)) + +var aClass: C = new C(); +>aClass : Symbol(aClass, Decl(everyTypeWithAnnotationAndInitializer.ts, 34, 3)) +>C : Symbol(C, Decl(everyTypeWithAnnotationAndInitializer.ts, 2, 1)) +>C : Symbol(C, Decl(everyTypeWithAnnotationAndInitializer.ts, 2, 1)) + +var aGenericClass: D = new D(); +>aGenericClass : Symbol(aGenericClass, Decl(everyTypeWithAnnotationAndInitializer.ts, 35, 3)) +>D : Symbol(D, Decl(everyTypeWithAnnotationAndInitializer.ts, 6, 1)) +>D : Symbol(D, Decl(everyTypeWithAnnotationAndInitializer.ts, 6, 1)) + +var anObjectLiteral: I = { id: 12 }; +>anObjectLiteral : Symbol(anObjectLiteral, Decl(everyTypeWithAnnotationAndInitializer.ts, 36, 3)) +>I : Symbol(I, Decl(everyTypeWithAnnotationAndInitializer.ts, 0, 0)) +>id : Symbol(id, Decl(everyTypeWithAnnotationAndInitializer.ts, 36, 26)) + +var anOtherObjectLiteral: { id: number } = new C(); +>anOtherObjectLiteral : Symbol(anOtherObjectLiteral, Decl(everyTypeWithAnnotationAndInitializer.ts, 37, 3)) +>id : Symbol(id, Decl(everyTypeWithAnnotationAndInitializer.ts, 37, 27)) +>C : Symbol(C, Decl(everyTypeWithAnnotationAndInitializer.ts, 2, 1)) + +var aFunction: typeof F = F; +>aFunction : Symbol(aFunction, Decl(everyTypeWithAnnotationAndInitializer.ts, 39, 3)) +>F : Symbol(F, Decl(everyTypeWithAnnotationAndInitializer.ts, 12, 1)) +>F : Symbol(F, Decl(everyTypeWithAnnotationAndInitializer.ts, 12, 1)) + +var anOtherFunction: (x: string) => number = F; +>anOtherFunction : Symbol(anOtherFunction, Decl(everyTypeWithAnnotationAndInitializer.ts, 40, 3)) +>x : Symbol(x, Decl(everyTypeWithAnnotationAndInitializer.ts, 40, 22)) +>F : Symbol(F, Decl(everyTypeWithAnnotationAndInitializer.ts, 12, 1)) + +var aLambda: typeof F = (x) => 2; +>aLambda : Symbol(aLambda, Decl(everyTypeWithAnnotationAndInitializer.ts, 41, 3)) +>F : Symbol(F, Decl(everyTypeWithAnnotationAndInitializer.ts, 12, 1)) +>x : Symbol(x, Decl(everyTypeWithAnnotationAndInitializer.ts, 41, 25)) + +var aModule: typeof M = M; +>aModule : Symbol(aModule, Decl(everyTypeWithAnnotationAndInitializer.ts, 43, 3)) +>M : Symbol(M, Decl(everyTypeWithAnnotationAndInitializer.ts, 14, 44)) +>M : Symbol(M, Decl(everyTypeWithAnnotationAndInitializer.ts, 14, 44)) + +var aClassInModule: M.A = new M.A(); +>aClassInModule : Symbol(aClassInModule, Decl(everyTypeWithAnnotationAndInitializer.ts, 44, 3)) +>M : Symbol(M, Decl(everyTypeWithAnnotationAndInitializer.ts, 14, 44)) +>A : Symbol(M.A, Decl(everyTypeWithAnnotationAndInitializer.ts, 16, 10)) +>M.A : Symbol(M.A, Decl(everyTypeWithAnnotationAndInitializer.ts, 16, 10)) +>M : Symbol(M, Decl(everyTypeWithAnnotationAndInitializer.ts, 14, 44)) +>A : Symbol(M.A, Decl(everyTypeWithAnnotationAndInitializer.ts, 16, 10)) + +var aFunctionInModule: typeof M.F2 = (x) => 'this is a string'; +>aFunctionInModule : Symbol(aFunctionInModule, Decl(everyTypeWithAnnotationAndInitializer.ts, 45, 3)) +>M.F2 : Symbol(M.F2, Decl(everyTypeWithAnnotationAndInitializer.ts, 19, 5)) +>M : Symbol(M, Decl(everyTypeWithAnnotationAndInitializer.ts, 14, 44)) +>F2 : Symbol(M.F2, Decl(everyTypeWithAnnotationAndInitializer.ts, 19, 5)) +>x : Symbol(x, Decl(everyTypeWithAnnotationAndInitializer.ts, 45, 38)) + + diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types index c707e694468..0e7059f4eed 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types @@ -37,6 +37,7 @@ class D{ function F(x: string): number { return 42; } >F : (x: string) => number >x : string +>42 : number module M { >M : typeof M @@ -59,15 +60,18 @@ module M { var aNumber: number = 9.9; >aNumber : number +>9.9 : number var aString: string = 'this is a string'; >aString : string +>'this is a string' : string var aDate: Date = new Date(12); >aDate : Date >Date : Date >new Date(12) : Date >Date : DateConstructor +>12 : number var anObject: Object = new Object(); >anObject : Object @@ -77,6 +81,7 @@ var anObject: Object = new Object(); var anAny: any = null; >anAny : any +>null : null var aSecondAny: any = undefined; >aSecondAny : any @@ -109,6 +114,7 @@ var anObjectLiteral: I = { id: 12 }; >I : I >{ id: 12 } : { id: number; } >id : number +>12 : number var anOtherObjectLiteral: { id: number } = new C(); >anOtherObjectLiteral : { id: number; } @@ -131,6 +137,7 @@ var aLambda: typeof F = (x) => 2; >F : (x: string) => number >(x) => 2 : (x: string) => number >x : string +>2 : number var aModule: typeof M = M; >aModule : typeof M @@ -139,7 +146,7 @@ var aModule: typeof M = M; var aClassInModule: M.A = new M.A(); >aClassInModule : M.A ->M : unknown +>M : any >A : M.A >new M.A() : M.A >M.A : typeof M.A @@ -148,9 +155,11 @@ var aClassInModule: M.A = new M.A(); var aFunctionInModule: typeof M.F2 = (x) => 'this is a string'; >aFunctionInModule : (x: number) => string +>M.F2 : (x: number) => string >M : typeof M >F2 : (x: number) => string >(x) => 'this is a string' : (x: number) => string >x : number +>'this is a string' : string diff --git a/tests/baselines/reference/everyTypeWithInitializer.symbols b/tests/baselines/reference/everyTypeWithInitializer.symbols new file mode 100644 index 00000000000..0a22252164b --- /dev/null +++ b/tests/baselines/reference/everyTypeWithInitializer.symbols @@ -0,0 +1,125 @@ +=== tests/cases/conformance/statements/VariableStatements/everyTypeWithInitializer.ts === +interface I { +>I : Symbol(I, Decl(everyTypeWithInitializer.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(everyTypeWithInitializer.ts, 0, 13)) +} + +class C implements I { +>C : Symbol(C, Decl(everyTypeWithInitializer.ts, 2, 1)) +>I : Symbol(I, Decl(everyTypeWithInitializer.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(everyTypeWithInitializer.ts, 4, 22)) +} + +class D{ +>D : Symbol(D, Decl(everyTypeWithInitializer.ts, 6, 1)) +>T : Symbol(T, Decl(everyTypeWithInitializer.ts, 8, 8)) + + source: T; +>source : Symbol(source, Decl(everyTypeWithInitializer.ts, 8, 11)) +>T : Symbol(T, Decl(everyTypeWithInitializer.ts, 8, 8)) + + recurse: D; +>recurse : Symbol(recurse, Decl(everyTypeWithInitializer.ts, 9, 14)) +>D : Symbol(D, Decl(everyTypeWithInitializer.ts, 6, 1)) +>T : Symbol(T, Decl(everyTypeWithInitializer.ts, 8, 8)) + + wrapped: D> +>wrapped : Symbol(wrapped, Decl(everyTypeWithInitializer.ts, 10, 18)) +>D : Symbol(D, Decl(everyTypeWithInitializer.ts, 6, 1)) +>D : Symbol(D, Decl(everyTypeWithInitializer.ts, 6, 1)) +>T : Symbol(T, Decl(everyTypeWithInitializer.ts, 8, 8)) +} + +function F(x: string): number { return 42; } +>F : Symbol(F, Decl(everyTypeWithInitializer.ts, 12, 1)) +>x : Symbol(x, Decl(everyTypeWithInitializer.ts, 14, 11)) + +module M { +>M : Symbol(M, Decl(everyTypeWithInitializer.ts, 14, 44)) + + export class A { +>A : Symbol(A, Decl(everyTypeWithInitializer.ts, 16, 10)) + + name: string; +>name : Symbol(name, Decl(everyTypeWithInitializer.ts, 17, 20)) + } + + export function F2(x: number): string { return x.toString(); } +>F2 : Symbol(F2, Decl(everyTypeWithInitializer.ts, 19, 5)) +>x : Symbol(x, Decl(everyTypeWithInitializer.ts, 21, 23)) +>x.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>x : Symbol(x, Decl(everyTypeWithInitializer.ts, 21, 23)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +} + +var aNumber = 9.9; +>aNumber : Symbol(aNumber, Decl(everyTypeWithInitializer.ts, 24, 3)) + +var aString = 'this is a string'; +>aString : Symbol(aString, Decl(everyTypeWithInitializer.ts, 25, 3)) + +var aDate = new Date(12); +>aDate : Symbol(aDate, Decl(everyTypeWithInitializer.ts, 26, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var anObject = new Object(); +>anObject : Symbol(anObject, Decl(everyTypeWithInitializer.ts, 27, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var anAny = null; +>anAny : Symbol(anAny, Decl(everyTypeWithInitializer.ts, 29, 3)) + +var anOtherAny = new C(); +>anOtherAny : Symbol(anOtherAny, Decl(everyTypeWithInitializer.ts, 30, 3)) +>C : Symbol(C, Decl(everyTypeWithInitializer.ts, 2, 1)) + +var anUndefined = undefined; +>anUndefined : Symbol(anUndefined, Decl(everyTypeWithInitializer.ts, 31, 3)) +>undefined : Symbol(undefined) + + +var aClass = new C(); +>aClass : Symbol(aClass, Decl(everyTypeWithInitializer.ts, 34, 3)) +>C : Symbol(C, Decl(everyTypeWithInitializer.ts, 2, 1)) + +var aGenericClass = new D(); +>aGenericClass : Symbol(aGenericClass, Decl(everyTypeWithInitializer.ts, 35, 3)) +>D : Symbol(D, Decl(everyTypeWithInitializer.ts, 6, 1)) + +var anObjectLiteral = { id: 12 }; +>anObjectLiteral : Symbol(anObjectLiteral, Decl(everyTypeWithInitializer.ts, 36, 3)) +>id : Symbol(id, Decl(everyTypeWithInitializer.ts, 36, 23)) + +var aFunction = F; +>aFunction : Symbol(aFunction, Decl(everyTypeWithInitializer.ts, 38, 3)) +>F : Symbol(F, Decl(everyTypeWithInitializer.ts, 12, 1)) + +var aLambda = (x) => 2; +>aLambda : Symbol(aLambda, Decl(everyTypeWithInitializer.ts, 39, 3)) +>x : Symbol(x, Decl(everyTypeWithInitializer.ts, 39, 15)) + +var aModule = M; +>aModule : Symbol(aModule, Decl(everyTypeWithInitializer.ts, 41, 3)) +>M : Symbol(M, Decl(everyTypeWithInitializer.ts, 14, 44)) + +var aClassInModule = new M.A(); +>aClassInModule : Symbol(aClassInModule, Decl(everyTypeWithInitializer.ts, 42, 3)) +>M.A : Symbol(M.A, Decl(everyTypeWithInitializer.ts, 16, 10)) +>M : Symbol(M, Decl(everyTypeWithInitializer.ts, 14, 44)) +>A : Symbol(M.A, Decl(everyTypeWithInitializer.ts, 16, 10)) + +var aFunctionInModule = M.F2; +>aFunctionInModule : Symbol(aFunctionInModule, Decl(everyTypeWithInitializer.ts, 43, 3)) +>M.F2 : Symbol(M.F2, Decl(everyTypeWithInitializer.ts, 19, 5)) +>M : Symbol(M, Decl(everyTypeWithInitializer.ts, 14, 44)) +>F2 : Symbol(M.F2, Decl(everyTypeWithInitializer.ts, 19, 5)) + +// no initializer or annotation, so this is an 'any' +var x; +>x : Symbol(x, Decl(everyTypeWithInitializer.ts, 46, 3)) + + diff --git a/tests/baselines/reference/everyTypeWithInitializer.types b/tests/baselines/reference/everyTypeWithInitializer.types index 7a0318718e4..abc0e770e35 100644 --- a/tests/baselines/reference/everyTypeWithInitializer.types +++ b/tests/baselines/reference/everyTypeWithInitializer.types @@ -37,6 +37,7 @@ class D{ function F(x: string): number { return 42; } >F : (x: string) => number >x : string +>42 : number module M { >M : typeof M @@ -59,14 +60,17 @@ module M { var aNumber = 9.9; >aNumber : number +>9.9 : number var aString = 'this is a string'; >aString : string +>'this is a string' : string var aDate = new Date(12); >aDate : Date >new Date(12) : Date >Date : DateConstructor +>12 : number var anObject = new Object(); >anObject : Object @@ -75,6 +79,7 @@ var anObject = new Object(); var anAny = null; >anAny : any +>null : null var anOtherAny = new C(); >anOtherAny : any @@ -101,6 +106,7 @@ var anObjectLiteral = { id: 12 }; >anObjectLiteral : { id: number; } >{ id: 12 } : { id: number; } >id : number +>12 : number var aFunction = F; >aFunction : (x: string) => number @@ -110,6 +116,7 @@ var aLambda = (x) => 2; >aLambda : (x: any) => number >(x) => 2 : (x: any) => number >x : any +>2 : number var aModule = M; >aModule : typeof M diff --git a/tests/baselines/reference/exportAndImport-es3-amd.js b/tests/baselines/reference/exportAndImport-es3-amd.js new file mode 100644 index 00000000000..a4552e70d68 --- /dev/null +++ b/tests/baselines/reference/exportAndImport-es3-amd.js @@ -0,0 +1,27 @@ +//// [tests/cases/conformance/es6/modules/exportAndImport-es3-amd.ts] //// + +//// [m1.ts] + +export default function f1() { +} + +//// [m2.ts] +import f1 from "./m1"; +export default function f2() { + f1(); +} + + +//// [m1.js] +define(["require", "exports"], function (require, exports) { + function f1() { + } + exports["default"] = f1; +}); +//// [m2.js] +define(["require", "exports", "./m1"], function (require, exports, m1_1) { + function f2() { + m1_1["default"](); + } + exports["default"] = f2; +}); diff --git a/tests/baselines/reference/exportAndImport-es3-amd.symbols b/tests/baselines/reference/exportAndImport-es3-amd.symbols new file mode 100644 index 00000000000..66e51659841 --- /dev/null +++ b/tests/baselines/reference/exportAndImport-es3-amd.symbols @@ -0,0 +1,17 @@ +=== tests/cases/conformance/es6/modules/m1.ts === + +export default function f1() { +>f1 : Symbol(f1, Decl(m1.ts, 0, 0)) +} + +=== tests/cases/conformance/es6/modules/m2.ts === +import f1 from "./m1"; +>f1 : Symbol(f1, Decl(m2.ts, 0, 6)) + +export default function f2() { +>f2 : Symbol(f2, Decl(m2.ts, 0, 22)) + + f1(); +>f1 : Symbol(f1, Decl(m2.ts, 0, 6)) +} + diff --git a/tests/baselines/reference/exportAndImport-es3-amd.types b/tests/baselines/reference/exportAndImport-es3-amd.types new file mode 100644 index 00000000000..48136c8779d --- /dev/null +++ b/tests/baselines/reference/exportAndImport-es3-amd.types @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/modules/m1.ts === + +export default function f1() { +>f1 : () => void +} + +=== tests/cases/conformance/es6/modules/m2.ts === +import f1 from "./m1"; +>f1 : () => void + +export default function f2() { +>f2 : () => void + + f1(); +>f1() : void +>f1 : () => void +} + diff --git a/tests/baselines/reference/exportAndImport-es3.js b/tests/baselines/reference/exportAndImport-es3.js new file mode 100644 index 00000000000..5f467509b68 --- /dev/null +++ b/tests/baselines/reference/exportAndImport-es3.js @@ -0,0 +1,24 @@ +//// [tests/cases/conformance/es6/modules/exportAndImport-es3.ts] //// + +//// [m1.ts] + +export default function f1() { +} + +//// [m2.ts] +import f1 from "./m1"; +export default function f2() { + f1(); +} + + +//// [m1.js] +function f1() { +} +exports["default"] = f1; +//// [m2.js] +var m1_1 = require("./m1"); +function f2() { + m1_1["default"](); +} +exports["default"] = f2; diff --git a/tests/baselines/reference/exportAndImport-es3.symbols b/tests/baselines/reference/exportAndImport-es3.symbols new file mode 100644 index 00000000000..746f89927b2 --- /dev/null +++ b/tests/baselines/reference/exportAndImport-es3.symbols @@ -0,0 +1,17 @@ +=== tests/cases/conformance/es6/modules/m1.ts === + +export default function f1() { +>f1 : Symbol(f1, Decl(m1.ts, 0, 0)) +} + +=== tests/cases/conformance/es6/modules/m2.ts === +import f1 from "./m1"; +>f1 : Symbol(f1, Decl(m2.ts, 0, 6)) + +export default function f2() { +>f2 : Symbol(f2, Decl(m2.ts, 0, 22)) + + f1(); +>f1 : Symbol(f1, Decl(m2.ts, 0, 6)) +} + diff --git a/tests/baselines/reference/exportAndImport-es3.types b/tests/baselines/reference/exportAndImport-es3.types new file mode 100644 index 00000000000..9bae430e231 --- /dev/null +++ b/tests/baselines/reference/exportAndImport-es3.types @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/modules/m1.ts === + +export default function f1() { +>f1 : () => void +} + +=== tests/cases/conformance/es6/modules/m2.ts === +import f1 from "./m1"; +>f1 : () => void + +export default function f2() { +>f2 : () => void + + f1(); +>f1() : void +>f1 : () => void +} + diff --git a/tests/baselines/reference/exportAndImport-es5-amd.js b/tests/baselines/reference/exportAndImport-es5-amd.js new file mode 100644 index 00000000000..4966af874f7 --- /dev/null +++ b/tests/baselines/reference/exportAndImport-es5-amd.js @@ -0,0 +1,27 @@ +//// [tests/cases/conformance/es6/modules/exportAndImport-es5-amd.ts] //// + +//// [m1.ts] + +export default function f1() { +} + +//// [m2.ts] +import f1 from "./m1"; +export default function f2() { + f1(); +} + + +//// [m1.js] +define(["require", "exports"], function (require, exports) { + function f1() { + } + exports.default = f1; +}); +//// [m2.js] +define(["require", "exports", "./m1"], function (require, exports, m1_1) { + function f2() { + m1_1.default(); + } + exports.default = f2; +}); diff --git a/tests/baselines/reference/exportAndImport-es5-amd.symbols b/tests/baselines/reference/exportAndImport-es5-amd.symbols new file mode 100644 index 00000000000..66e51659841 --- /dev/null +++ b/tests/baselines/reference/exportAndImport-es5-amd.symbols @@ -0,0 +1,17 @@ +=== tests/cases/conformance/es6/modules/m1.ts === + +export default function f1() { +>f1 : Symbol(f1, Decl(m1.ts, 0, 0)) +} + +=== tests/cases/conformance/es6/modules/m2.ts === +import f1 from "./m1"; +>f1 : Symbol(f1, Decl(m2.ts, 0, 6)) + +export default function f2() { +>f2 : Symbol(f2, Decl(m2.ts, 0, 22)) + + f1(); +>f1 : Symbol(f1, Decl(m2.ts, 0, 6)) +} + diff --git a/tests/baselines/reference/exportAndImport-es5-amd.types b/tests/baselines/reference/exportAndImport-es5-amd.types new file mode 100644 index 00000000000..48136c8779d --- /dev/null +++ b/tests/baselines/reference/exportAndImport-es5-amd.types @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/modules/m1.ts === + +export default function f1() { +>f1 : () => void +} + +=== tests/cases/conformance/es6/modules/m2.ts === +import f1 from "./m1"; +>f1 : () => void + +export default function f2() { +>f2 : () => void + + f1(); +>f1() : void +>f1 : () => void +} + diff --git a/tests/baselines/reference/exportAndImport-es5.js b/tests/baselines/reference/exportAndImport-es5.js new file mode 100644 index 00000000000..02d0e43e5a9 --- /dev/null +++ b/tests/baselines/reference/exportAndImport-es5.js @@ -0,0 +1,24 @@ +//// [tests/cases/conformance/es6/modules/exportAndImport-es5.ts] //// + +//// [m1.ts] + +export default function f1() { +} + +//// [m2.ts] +import f1 from "./m1"; +export default function f2() { + f1(); +} + + +//// [m1.js] +function f1() { +} +exports.default = f1; +//// [m2.js] +var m1_1 = require("./m1"); +function f2() { + m1_1.default(); +} +exports.default = f2; diff --git a/tests/baselines/reference/exportAndImport-es5.symbols b/tests/baselines/reference/exportAndImport-es5.symbols new file mode 100644 index 00000000000..66e51659841 --- /dev/null +++ b/tests/baselines/reference/exportAndImport-es5.symbols @@ -0,0 +1,17 @@ +=== tests/cases/conformance/es6/modules/m1.ts === + +export default function f1() { +>f1 : Symbol(f1, Decl(m1.ts, 0, 0)) +} + +=== tests/cases/conformance/es6/modules/m2.ts === +import f1 from "./m1"; +>f1 : Symbol(f1, Decl(m2.ts, 0, 6)) + +export default function f2() { +>f2 : Symbol(f2, Decl(m2.ts, 0, 22)) + + f1(); +>f1 : Symbol(f1, Decl(m2.ts, 0, 6)) +} + diff --git a/tests/baselines/reference/exportAndImport-es5.types b/tests/baselines/reference/exportAndImport-es5.types new file mode 100644 index 00000000000..48136c8779d --- /dev/null +++ b/tests/baselines/reference/exportAndImport-es5.types @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/modules/m1.ts === + +export default function f1() { +>f1 : () => void +} + +=== tests/cases/conformance/es6/modules/m2.ts === +import f1 from "./m1"; +>f1 : () => void + +export default function f2() { +>f2 : () => void + + f1(); +>f1() : void +>f1 : () => void +} + diff --git a/tests/baselines/reference/exportAssignClassAndModule.symbols b/tests/baselines/reference/exportAssignClassAndModule.symbols new file mode 100644 index 00000000000..9f38ed80b1b --- /dev/null +++ b/tests/baselines/reference/exportAssignClassAndModule.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/exportAssignClassAndModule_1.ts === +/// +import Foo = require('exportAssignClassAndModule_0'); +>Foo : Symbol(Foo, Decl(exportAssignClassAndModule_1.ts, 0, 0)) + +var z: Foo.Bar; +>z : Symbol(z, Decl(exportAssignClassAndModule_1.ts, 3, 3)) +>Foo : Symbol(Foo, Decl(exportAssignClassAndModule_1.ts, 0, 0)) +>Bar : Symbol(Foo.Bar, Decl(exportAssignClassAndModule_0.ts, 3, 12)) + +var zz: Foo; +>zz : Symbol(zz, Decl(exportAssignClassAndModule_1.ts, 4, 3)) +>Foo : Symbol(Foo, Decl(exportAssignClassAndModule_1.ts, 0, 0)) + +zz.x; +>zz.x : Symbol(Foo.x, Decl(exportAssignClassAndModule_0.ts, 0, 11)) +>zz : Symbol(zz, Decl(exportAssignClassAndModule_1.ts, 4, 3)) +>x : Symbol(Foo.x, Decl(exportAssignClassAndModule_0.ts, 0, 11)) + +=== tests/cases/compiler/exportAssignClassAndModule_0.ts === +class Foo { +>Foo : Symbol(Foo, Decl(exportAssignClassAndModule_0.ts, 0, 0), Decl(exportAssignClassAndModule_0.ts, 2, 1)) + + x: Foo.Bar; +>x : Symbol(x, Decl(exportAssignClassAndModule_0.ts, 0, 11)) +>Foo : Symbol(Foo, Decl(exportAssignClassAndModule_0.ts, 0, 0), Decl(exportAssignClassAndModule_0.ts, 2, 1)) +>Bar : Symbol(Foo.Bar, Decl(exportAssignClassAndModule_0.ts, 3, 12)) +} +module Foo { +>Foo : Symbol(Foo, Decl(exportAssignClassAndModule_0.ts, 0, 0), Decl(exportAssignClassAndModule_0.ts, 2, 1)) + + export interface Bar { +>Bar : Symbol(Bar, Decl(exportAssignClassAndModule_0.ts, 3, 12)) + } +} +export = Foo; +>Foo : Symbol(Foo, Decl(exportAssignClassAndModule_0.ts, 0, 0), Decl(exportAssignClassAndModule_0.ts, 2, 1)) + diff --git a/tests/baselines/reference/exportAssignClassAndModule.types b/tests/baselines/reference/exportAssignClassAndModule.types index dc4a19f345c..aa1ede6b2d4 100644 --- a/tests/baselines/reference/exportAssignClassAndModule.types +++ b/tests/baselines/reference/exportAssignClassAndModule.types @@ -5,7 +5,7 @@ import Foo = require('exportAssignClassAndModule_0'); var z: Foo.Bar; >z : Foo.Bar ->Foo : unknown +>Foo : any >Bar : Foo.Bar var zz: Foo; @@ -23,7 +23,7 @@ class Foo { x: Foo.Bar; >x : Foo.Bar ->Foo : unknown +>Foo : any >Bar : Foo.Bar } module Foo { diff --git a/tests/baselines/reference/exportAssignValueAndType.symbols b/tests/baselines/reference/exportAssignValueAndType.symbols new file mode 100644 index 00000000000..b6d5b5b3bb6 --- /dev/null +++ b/tests/baselines/reference/exportAssignValueAndType.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/exportAssignValueAndType.ts === +declare module http { +>http : Symbol(http, Decl(exportAssignValueAndType.ts, 0, 0)) + + export interface Server { openPort: number; } +>Server : Symbol(Server, Decl(exportAssignValueAndType.ts, 0, 21)) +>openPort : Symbol(openPort, Decl(exportAssignValueAndType.ts, 1, 26)) +} + +interface server { +>server : Symbol(server, Decl(exportAssignValueAndType.ts, 2, 1), Decl(exportAssignValueAndType.ts, 10, 3)) + + (): http.Server; +>http : Symbol(http, Decl(exportAssignValueAndType.ts, 0, 0)) +>Server : Symbol(http.Server, Decl(exportAssignValueAndType.ts, 0, 21)) + + startTime: Date; +>startTime : Symbol(startTime, Decl(exportAssignValueAndType.ts, 5, 20)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +} + +var x = 5; +>x : Symbol(x, Decl(exportAssignValueAndType.ts, 9, 3)) + +var server = new Date(); +>server : Symbol(server, Decl(exportAssignValueAndType.ts, 2, 1), Decl(exportAssignValueAndType.ts, 10, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +export = server; +>server : Symbol(server, Decl(exportAssignValueAndType.ts, 2, 1), Decl(exportAssignValueAndType.ts, 10, 3)) + + diff --git a/tests/baselines/reference/exportAssignValueAndType.types b/tests/baselines/reference/exportAssignValueAndType.types index fca84f399ec..2dc7442b9ac 100644 --- a/tests/baselines/reference/exportAssignValueAndType.types +++ b/tests/baselines/reference/exportAssignValueAndType.types @@ -1,6 +1,6 @@ === tests/cases/compiler/exportAssignValueAndType.ts === declare module http { ->http : unknown +>http : any export interface Server { openPort: number; } >Server : Server @@ -11,7 +11,7 @@ interface server { >server : server (): http.Server; ->http : unknown +>http : any >Server : http.Server startTime: Date; @@ -21,6 +21,7 @@ interface server { var x = 5; >x : number +>5 : number var server = new Date(); >server : Date diff --git a/tests/baselines/reference/exportAssignedTypeAsTypeAnnotation.symbols b/tests/baselines/reference/exportAssignedTypeAsTypeAnnotation.symbols new file mode 100644 index 00000000000..2c286e8518d --- /dev/null +++ b/tests/baselines/reference/exportAssignedTypeAsTypeAnnotation.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/exportAssignedTypeAsTypeAnnotation_1.ts === +/// +import test = require('exportAssignedTypeAsTypeAnnotation_0'); +>test : Symbol(test, Decl(exportAssignedTypeAsTypeAnnotation_1.ts, 0, 0)) + +var t2: test; // should not raise a 'container type' error +>t2 : Symbol(t2, Decl(exportAssignedTypeAsTypeAnnotation_1.ts, 2, 3)) +>test : Symbol(test, Decl(exportAssignedTypeAsTypeAnnotation_1.ts, 0, 0)) + +=== tests/cases/compiler/exportAssignedTypeAsTypeAnnotation_0.ts === + +interface x { +>x : Symbol(x, Decl(exportAssignedTypeAsTypeAnnotation_0.ts, 0, 0)) + + (): Date; +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + foo: string; +>foo : Symbol(foo, Decl(exportAssignedTypeAsTypeAnnotation_0.ts, 2, 13)) +} +export = x; +>x : Symbol(x, Decl(exportAssignedTypeAsTypeAnnotation_0.ts, 0, 0)) + diff --git a/tests/baselines/reference/exportAssignedTypeAsTypeAnnotation.types b/tests/baselines/reference/exportAssignedTypeAsTypeAnnotation.types index 8ac473f970a..553dbe35c4f 100644 --- a/tests/baselines/reference/exportAssignedTypeAsTypeAnnotation.types +++ b/tests/baselines/reference/exportAssignedTypeAsTypeAnnotation.types @@ -1,7 +1,7 @@ === tests/cases/compiler/exportAssignedTypeAsTypeAnnotation_1.ts === /// import test = require('exportAssignedTypeAsTypeAnnotation_0'); ->test : unknown +>test : any var t2: test; // should not raise a 'container type' error >t2 : test diff --git a/tests/baselines/reference/exportAssignmentCircularModules.symbols b/tests/baselines/reference/exportAssignmentCircularModules.symbols new file mode 100644 index 00000000000..5e2d5470c90 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentCircularModules.symbols @@ -0,0 +1,48 @@ +=== tests/cases/conformance/externalModules/foo_2.ts === +import foo0 = require("./foo_0"); +>foo0 : Symbol(foo0, Decl(foo_2.ts, 0, 0)) + +module Foo { +>Foo : Symbol(Foo, Decl(foo_2.ts, 0, 33)) + + export var x = foo0.x; +>x : Symbol(x, Decl(foo_2.ts, 2, 11)) +>foo0.x : Symbol(foo0.x, Decl(foo_0.ts, 2, 11)) +>foo0 : Symbol(foo0, Decl(foo_2.ts, 0, 0)) +>x : Symbol(foo0.x, Decl(foo_0.ts, 2, 11)) +} +export = Foo; +>Foo : Symbol(Foo, Decl(foo_2.ts, 0, 33)) + +=== tests/cases/conformance/externalModules/foo_0.ts === +import foo1 = require('./foo_1'); +>foo1 : Symbol(foo1, Decl(foo_0.ts, 0, 0)) + +module Foo { +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 33)) + + export var x = foo1.x; +>x : Symbol(x, Decl(foo_0.ts, 2, 11)) +>foo1.x : Symbol(foo1.x, Decl(foo_1.ts, 2, 11)) +>foo1 : Symbol(foo1, Decl(foo_0.ts, 0, 0)) +>x : Symbol(foo1.x, Decl(foo_1.ts, 2, 11)) +} +export = Foo; +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 33)) + +=== tests/cases/conformance/externalModules/foo_1.ts === +import foo2 = require("./foo_2"); +>foo2 : Symbol(foo2, Decl(foo_1.ts, 0, 0)) + +module Foo { +>Foo : Symbol(Foo, Decl(foo_1.ts, 0, 33)) + + export var x = foo2.x; +>x : Symbol(x, Decl(foo_1.ts, 2, 11)) +>foo2.x : Symbol(foo2.x, Decl(foo_2.ts, 2, 11)) +>foo2 : Symbol(foo2, Decl(foo_1.ts, 0, 0)) +>x : Symbol(foo2.x, Decl(foo_2.ts, 2, 11)) +} +export = Foo; +>Foo : Symbol(Foo, Decl(foo_1.ts, 0, 33)) + diff --git a/tests/baselines/reference/exportAssignmentClass.symbols b/tests/baselines/reference/exportAssignmentClass.symbols new file mode 100644 index 00000000000..d0935ca8f8c --- /dev/null +++ b/tests/baselines/reference/exportAssignmentClass.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/exportAssignmentClass_B.ts === +import D = require("exportAssignmentClass_A"); +>D : Symbol(D, Decl(exportAssignmentClass_B.ts, 0, 0)) + +var d = new D(); +>d : Symbol(d, Decl(exportAssignmentClass_B.ts, 2, 3)) +>D : Symbol(D, Decl(exportAssignmentClass_B.ts, 0, 0)) + +var x = d.p; +>x : Symbol(x, Decl(exportAssignmentClass_B.ts, 3, 3)) +>d.p : Symbol(D.p, Decl(exportAssignmentClass_A.ts, 0, 9)) +>d : Symbol(d, Decl(exportAssignmentClass_B.ts, 2, 3)) +>p : Symbol(D.p, Decl(exportAssignmentClass_A.ts, 0, 9)) + +=== tests/cases/compiler/exportAssignmentClass_A.ts === +class C { public p = 0; } +>C : Symbol(C, Decl(exportAssignmentClass_A.ts, 0, 0)) +>p : Symbol(p, Decl(exportAssignmentClass_A.ts, 0, 9)) + +export = C; +>C : Symbol(C, Decl(exportAssignmentClass_A.ts, 0, 0)) + diff --git a/tests/baselines/reference/exportAssignmentClass.types b/tests/baselines/reference/exportAssignmentClass.types index c7c3f38d7ea..b724c837244 100644 --- a/tests/baselines/reference/exportAssignmentClass.types +++ b/tests/baselines/reference/exportAssignmentClass.types @@ -17,6 +17,7 @@ var x = d.p; class C { public p = 0; } >C : C >p : number +>0 : number export = C; >C : C diff --git a/tests/baselines/reference/exportAssignmentEnum.symbols b/tests/baselines/reference/exportAssignmentEnum.symbols new file mode 100644 index 00000000000..07eb5f7b907 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentEnum.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/exportAssignmentEnum_B.ts === +import EnumE = require("exportAssignmentEnum_A"); +>EnumE : Symbol(EnumE, Decl(exportAssignmentEnum_B.ts, 0, 0)) + +var a = EnumE.A; +>a : Symbol(a, Decl(exportAssignmentEnum_B.ts, 2, 3)) +>EnumE.A : Symbol(EnumE.A, Decl(exportAssignmentEnum_A.ts, 0, 8)) +>EnumE : Symbol(EnumE, Decl(exportAssignmentEnum_B.ts, 0, 0)) +>A : Symbol(EnumE.A, Decl(exportAssignmentEnum_A.ts, 0, 8)) + +var b = EnumE.B; +>b : Symbol(b, Decl(exportAssignmentEnum_B.ts, 3, 3)) +>EnumE.B : Symbol(EnumE.B, Decl(exportAssignmentEnum_A.ts, 1, 3)) +>EnumE : Symbol(EnumE, Decl(exportAssignmentEnum_B.ts, 0, 0)) +>B : Symbol(EnumE.B, Decl(exportAssignmentEnum_A.ts, 1, 3)) + +var c = EnumE.C; +>c : Symbol(c, Decl(exportAssignmentEnum_B.ts, 4, 3)) +>EnumE.C : Symbol(EnumE.C, Decl(exportAssignmentEnum_A.ts, 2, 3)) +>EnumE : Symbol(EnumE, Decl(exportAssignmentEnum_B.ts, 0, 0)) +>C : Symbol(EnumE.C, Decl(exportAssignmentEnum_A.ts, 2, 3)) + +=== tests/cases/compiler/exportAssignmentEnum_A.ts === +enum E { +>E : Symbol(E, Decl(exportAssignmentEnum_A.ts, 0, 0)) + + A, +>A : Symbol(E.A, Decl(exportAssignmentEnum_A.ts, 0, 8)) + + B, +>B : Symbol(E.B, Decl(exportAssignmentEnum_A.ts, 1, 3)) + + C, +>C : Symbol(E.C, Decl(exportAssignmentEnum_A.ts, 2, 3)) +} + +export = E; +>E : Symbol(E, Decl(exportAssignmentEnum_A.ts, 0, 0)) + diff --git a/tests/baselines/reference/exportAssignmentError.symbols b/tests/baselines/reference/exportAssignmentError.symbols new file mode 100644 index 00000000000..482ad586dc2 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentError.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/exportAssignmentError.ts === +module M { +>M : Symbol(M, Decl(exportAssignmentError.ts, 0, 0)) + + export var x; +>x : Symbol(x, Decl(exportAssignmentError.ts, 1, 11)) +} + +import M2 = M; +>M2 : Symbol(M2, Decl(exportAssignmentError.ts, 2, 1)) +>M : Symbol(M, Decl(exportAssignmentError.ts, 0, 0)) + +export = M2; // should not error +>M2 : Symbol(M2, Decl(exportAssignmentError.ts, 2, 1)) + diff --git a/tests/baselines/reference/exportAssignmentFunction.symbols b/tests/baselines/reference/exportAssignmentFunction.symbols new file mode 100644 index 00000000000..749c7d61949 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentFunction.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/exportAssignmentFunction_B.ts === +import fooFunc = require("exportAssignmentFunction_A"); +>fooFunc : Symbol(fooFunc, Decl(exportAssignmentFunction_B.ts, 0, 0)) + +var n: number = fooFunc(); +>n : Symbol(n, Decl(exportAssignmentFunction_B.ts, 2, 3)) +>fooFunc : Symbol(fooFunc, Decl(exportAssignmentFunction_B.ts, 0, 0)) + +=== tests/cases/compiler/exportAssignmentFunction_A.ts === +function foo() { return 0; } +>foo : Symbol(foo, Decl(exportAssignmentFunction_A.ts, 0, 0)) + +export = foo; +>foo : Symbol(foo, Decl(exportAssignmentFunction_A.ts, 0, 0)) + diff --git a/tests/baselines/reference/exportAssignmentFunction.types b/tests/baselines/reference/exportAssignmentFunction.types index 023a8c234d2..bd10465d221 100644 --- a/tests/baselines/reference/exportAssignmentFunction.types +++ b/tests/baselines/reference/exportAssignmentFunction.types @@ -10,6 +10,7 @@ var n: number = fooFunc(); === tests/cases/compiler/exportAssignmentFunction_A.ts === function foo() { return 0; } >foo : () => number +>0 : number export = foo; >foo : () => number diff --git a/tests/baselines/reference/exportAssignmentGenericType.symbols b/tests/baselines/reference/exportAssignmentGenericType.symbols new file mode 100644 index 00000000000..ca228e7092e --- /dev/null +++ b/tests/baselines/reference/exportAssignmentGenericType.symbols @@ -0,0 +1,26 @@ +=== tests/cases/conformance/externalModules/foo_1.ts === +import foo = require("./foo_0"); +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) + +var x = new foo(); +>x : Symbol(x, Decl(foo_1.ts, 1, 3)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) + +var y:number = x.test; +>y : Symbol(y, Decl(foo_1.ts, 2, 3)) +>x.test : Symbol(foo.test, Decl(foo_0.ts, 0, 13)) +>x : Symbol(x, Decl(foo_1.ts, 1, 3)) +>test : Symbol(foo.test, Decl(foo_0.ts, 0, 13)) + +=== tests/cases/conformance/externalModules/foo_0.ts === +class Foo{ +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0)) +>T : Symbol(T, Decl(foo_0.ts, 0, 10)) + + test: T; +>test : Symbol(test, Decl(foo_0.ts, 0, 13)) +>T : Symbol(T, Decl(foo_0.ts, 0, 10)) +} +export = Foo; +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0)) + diff --git a/tests/baselines/reference/exportAssignmentInterface.symbols b/tests/baselines/reference/exportAssignmentInterface.symbols new file mode 100644 index 00000000000..22f344a2cb9 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentInterface.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/exportAssignmentInterface_B.ts === +import I1 = require("exportAssignmentInterface_A"); +>I1 : Symbol(I1, Decl(exportAssignmentInterface_B.ts, 0, 0)) + +var i: I1; +>i : Symbol(i, Decl(exportAssignmentInterface_B.ts, 2, 3)) +>I1 : Symbol(I1, Decl(exportAssignmentInterface_B.ts, 0, 0)) + +var n: number = i.p1; +>n : Symbol(n, Decl(exportAssignmentInterface_B.ts, 4, 3)) +>i.p1 : Symbol(I1.p1, Decl(exportAssignmentInterface_A.ts, 0, 13)) +>i : Symbol(i, Decl(exportAssignmentInterface_B.ts, 2, 3)) +>p1 : Symbol(I1.p1, Decl(exportAssignmentInterface_A.ts, 0, 13)) + +=== tests/cases/compiler/exportAssignmentInterface_A.ts === +interface A { +>A : Symbol(A, Decl(exportAssignmentInterface_A.ts, 0, 0)) + + p1: number; +>p1 : Symbol(p1, Decl(exportAssignmentInterface_A.ts, 0, 13)) +} + +export = A; +>A : Symbol(A, Decl(exportAssignmentInterface_A.ts, 0, 0)) + diff --git a/tests/baselines/reference/exportAssignmentInterface.types b/tests/baselines/reference/exportAssignmentInterface.types index f4ed92d9471..efd75daca79 100644 --- a/tests/baselines/reference/exportAssignmentInterface.types +++ b/tests/baselines/reference/exportAssignmentInterface.types @@ -1,6 +1,6 @@ === tests/cases/compiler/exportAssignmentInterface_B.ts === import I1 = require("exportAssignmentInterface_A"); ->I1 : unknown +>I1 : any var i: I1; >i : I1 diff --git a/tests/baselines/reference/exportAssignmentInternalModule.symbols b/tests/baselines/reference/exportAssignmentInternalModule.symbols new file mode 100644 index 00000000000..37667aa5c43 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentInternalModule.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/exportAssignmentInternalModule_B.ts === +import modM = require("exportAssignmentInternalModule_A"); +>modM : Symbol(modM, Decl(exportAssignmentInternalModule_B.ts, 0, 0)) + +var n: number = modM.x; +>n : Symbol(n, Decl(exportAssignmentInternalModule_B.ts, 2, 3)) +>modM.x : Symbol(modM.x, Decl(exportAssignmentInternalModule_A.ts, 1, 11)) +>modM : Symbol(modM, Decl(exportAssignmentInternalModule_B.ts, 0, 0)) +>x : Symbol(modM.x, Decl(exportAssignmentInternalModule_A.ts, 1, 11)) + +=== tests/cases/compiler/exportAssignmentInternalModule_A.ts === +module M { +>M : Symbol(M, Decl(exportAssignmentInternalModule_A.ts, 0, 0)) + + export var x; +>x : Symbol(x, Decl(exportAssignmentInternalModule_A.ts, 1, 11)) +} + +export = M; +>M : Symbol(M, Decl(exportAssignmentInternalModule_A.ts, 0, 0)) + diff --git a/tests/baselines/reference/exportAssignmentMergedInterface.symbols b/tests/baselines/reference/exportAssignmentMergedInterface.symbols new file mode 100644 index 00000000000..a199ed4e6c5 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentMergedInterface.symbols @@ -0,0 +1,63 @@ +=== tests/cases/conformance/externalModules/foo_1.ts === +import foo = require("./foo_0"); +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) + +var x: foo; +>x : Symbol(x, Decl(foo_1.ts, 1, 3)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) + +x("test"); +>x : Symbol(x, Decl(foo_1.ts, 1, 3)) + +x(42); +>x : Symbol(x, Decl(foo_1.ts, 1, 3)) + +var y: string = x.b; +>y : Symbol(y, Decl(foo_1.ts, 4, 3)) +>x.b : Symbol(foo.b, Decl(foo_0.ts, 1, 19)) +>x : Symbol(x, Decl(foo_1.ts, 1, 3)) +>b : Symbol(foo.b, Decl(foo_0.ts, 1, 19)) + +if(!!x.c){ } +>x.c : Symbol(foo.c, Decl(foo_0.ts, 5, 21)) +>x : Symbol(x, Decl(foo_1.ts, 1, 3)) +>c : Symbol(foo.c, Decl(foo_0.ts, 5, 21)) + +var z = {x: 1, y: 2}; +>z : Symbol(z, Decl(foo_1.ts, 6, 3)) +>x : Symbol(x, Decl(foo_1.ts, 6, 9)) +>y : Symbol(y, Decl(foo_1.ts, 6, 14)) + +z = x.d; +>z : Symbol(z, Decl(foo_1.ts, 6, 3)) +>x.d : Symbol(foo.d, Decl(foo_0.ts, 6, 12)) +>x : Symbol(x, Decl(foo_1.ts, 1, 3)) +>d : Symbol(foo.d, Decl(foo_0.ts, 6, 12)) + +=== tests/cases/conformance/externalModules/foo_0.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 3, 1)) + + (a: string): void; +>a : Symbol(a, Decl(foo_0.ts, 1, 2)) + + b: string; +>b : Symbol(b, Decl(foo_0.ts, 1, 19)) +} +interface Foo { +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 3, 1)) + + (a: number): number; +>a : Symbol(a, Decl(foo_0.ts, 5, 2)) + + c: boolean; +>c : Symbol(c, Decl(foo_0.ts, 5, 21)) + + d: {x: number; y: number}; +>d : Symbol(d, Decl(foo_0.ts, 6, 12)) +>x : Symbol(x, Decl(foo_0.ts, 7, 5)) +>y : Symbol(y, Decl(foo_0.ts, 7, 15)) +} +export = Foo; +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 3, 1)) + diff --git a/tests/baselines/reference/exportAssignmentMergedInterface.types b/tests/baselines/reference/exportAssignmentMergedInterface.types index d0fb5383b29..52978783f6d 100644 --- a/tests/baselines/reference/exportAssignmentMergedInterface.types +++ b/tests/baselines/reference/exportAssignmentMergedInterface.types @@ -1,6 +1,6 @@ === tests/cases/conformance/externalModules/foo_1.ts === import foo = require("./foo_0"); ->foo : unknown +>foo : any var x: foo; >x : foo @@ -9,10 +9,12 @@ var x: foo; x("test"); >x("test") : void >x : foo +>"test" : string x(42); >x(42) : number >x : foo +>42 : number var y: string = x.b; >y : string @@ -31,7 +33,9 @@ var z = {x: 1, y: 2}; >z : { x: number; y: number; } >{x: 1, y: 2} : { x: number; y: number; } >x : number +>1 : number >y : number +>2 : number z = x.d; >z = x.d : { x: number; y: number; } diff --git a/tests/baselines/reference/exportAssignmentMergedModule.symbols b/tests/baselines/reference/exportAssignmentMergedModule.symbols new file mode 100644 index 00000000000..2fe8d01764b --- /dev/null +++ b/tests/baselines/reference/exportAssignmentMergedModule.symbols @@ -0,0 +1,57 @@ +=== tests/cases/conformance/externalModules/foo_1.ts === +import foo = require("./foo_0"); +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) + +var a: number = foo.a(); +>a : Symbol(a, Decl(foo_1.ts, 1, 3)) +>foo.a : Symbol(foo.a, Decl(foo_0.ts, 0, 12)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>a : Symbol(foo.a, Decl(foo_0.ts, 0, 12)) + +if(!!foo.b){ +>foo.b : Symbol(foo.b, Decl(foo_0.ts, 4, 11)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>b : Symbol(foo.b, Decl(foo_0.ts, 4, 11)) + + foo.Test.answer = foo.c(42); +>foo.Test.answer : Symbol(foo.Test.answer, Decl(foo_0.ts, 11, 12)) +>foo.Test : Symbol(foo.Test, Decl(foo_0.ts, 9, 2)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>Test : Symbol(foo.Test, Decl(foo_0.ts, 9, 2)) +>answer : Symbol(foo.Test.answer, Decl(foo_0.ts, 11, 12)) +>foo.c : Symbol(foo.c, Decl(foo_0.ts, 6, 12)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>c : Symbol(foo.c, Decl(foo_0.ts, 6, 12)) +} +=== tests/cases/conformance/externalModules/foo_0.ts === +module Foo { +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 5, 1)) + + export function a(){ +>a : Symbol(a, Decl(foo_0.ts, 0, 12)) + + return 5; + } + export var b = true; +>b : Symbol(b, Decl(foo_0.ts, 4, 11)) +} +module Foo { +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 5, 1)) + + export function c(a: number){ +>c : Symbol(c, Decl(foo_0.ts, 6, 12)) +>a : Symbol(a, Decl(foo_0.ts, 7, 19)) + + return a; +>a : Symbol(a, Decl(foo_0.ts, 7, 19)) + } + export module Test { +>Test : Symbol(Test, Decl(foo_0.ts, 9, 2)) + + export var answer = 42; +>answer : Symbol(answer, Decl(foo_0.ts, 11, 12)) + } +} +export = Foo; +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 5, 1)) + diff --git a/tests/baselines/reference/exportAssignmentMergedModule.types b/tests/baselines/reference/exportAssignmentMergedModule.types index d72f173a439..39f0d8d859e 100644 --- a/tests/baselines/reference/exportAssignmentMergedModule.types +++ b/tests/baselines/reference/exportAssignmentMergedModule.types @@ -27,6 +27,7 @@ if(!!foo.b){ >foo.c : (a: number) => number >foo : typeof foo >c : (a: number) => number +>42 : number } === tests/cases/conformance/externalModules/foo_0.ts === module Foo { @@ -36,9 +37,11 @@ module Foo { >a : () => number return 5; +>5 : number } export var b = true; >b : boolean +>true : boolean } module Foo { >Foo : typeof Foo @@ -55,6 +58,7 @@ module Foo { export var answer = 42; >answer : number +>42 : number } } export = Foo; diff --git a/tests/baselines/reference/exportAssignmentOfGenericType1.symbols b/tests/baselines/reference/exportAssignmentOfGenericType1.symbols new file mode 100644 index 00000000000..8ae7dbc73a9 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentOfGenericType1.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/exportAssignmentOfGenericType1_1.ts === +/// +import q = require("exportAssignmentOfGenericType1_0"); +>q : Symbol(q, Decl(exportAssignmentOfGenericType1_1.ts, 0, 0)) + +class M extends q { } +>M : Symbol(M, Decl(exportAssignmentOfGenericType1_1.ts, 1, 55)) +>q : Symbol(q, Decl(exportAssignmentOfGenericType1_1.ts, 0, 0)) + +var m: M; +>m : Symbol(m, Decl(exportAssignmentOfGenericType1_1.ts, 4, 3)) +>M : Symbol(M, Decl(exportAssignmentOfGenericType1_1.ts, 1, 55)) + +var r: string = m.foo; +>r : Symbol(r, Decl(exportAssignmentOfGenericType1_1.ts, 5, 3)) +>m.foo : Symbol(q.foo, Decl(exportAssignmentOfGenericType1_0.ts, 1, 12)) +>m : Symbol(m, Decl(exportAssignmentOfGenericType1_1.ts, 4, 3)) +>foo : Symbol(q.foo, Decl(exportAssignmentOfGenericType1_0.ts, 1, 12)) + +=== tests/cases/compiler/exportAssignmentOfGenericType1_0.ts === +export = T; +>T : Symbol(T, Decl(exportAssignmentOfGenericType1_0.ts, 0, 11)) + +class T { foo: X; } +>T : Symbol(T, Decl(exportAssignmentOfGenericType1_0.ts, 0, 11)) +>X : Symbol(X, Decl(exportAssignmentOfGenericType1_0.ts, 1, 8)) +>foo : Symbol(foo, Decl(exportAssignmentOfGenericType1_0.ts, 1, 12)) +>X : Symbol(X, Decl(exportAssignmentOfGenericType1_0.ts, 1, 8)) + diff --git a/tests/baselines/reference/exportAssignmentTopLevelClodule.symbols b/tests/baselines/reference/exportAssignmentTopLevelClodule.symbols new file mode 100644 index 00000000000..d672457f451 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentTopLevelClodule.symbols @@ -0,0 +1,30 @@ +=== tests/cases/conformance/externalModules/foo_1.ts === +import foo = require("./foo_0"); +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) + +if(foo.answer === 42){ +>foo.answer : Symbol(foo.answer, Decl(foo_0.ts, 4, 11)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>answer : Symbol(foo.answer, Decl(foo_0.ts, 4, 11)) + + var x = new foo(); +>x : Symbol(x, Decl(foo_1.ts, 2, 4)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +} + +=== tests/cases/conformance/externalModules/foo_0.ts === +class Foo { +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 2, 1)) + + test = "test"; +>test : Symbol(test, Decl(foo_0.ts, 0, 11)) +} +module Foo { +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 2, 1)) + + export var answer = 42; +>answer : Symbol(answer, Decl(foo_0.ts, 4, 11)) +} +export = Foo; +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 2, 1)) + diff --git a/tests/baselines/reference/exportAssignmentTopLevelClodule.types b/tests/baselines/reference/exportAssignmentTopLevelClodule.types index 80a56cd7b5f..93ce39c3b60 100644 --- a/tests/baselines/reference/exportAssignmentTopLevelClodule.types +++ b/tests/baselines/reference/exportAssignmentTopLevelClodule.types @@ -7,6 +7,7 @@ if(foo.answer === 42){ >foo.answer : number >foo : typeof foo >answer : number +>42 : number var x = new foo(); >x : foo @@ -20,12 +21,14 @@ class Foo { test = "test"; >test : string +>"test" : string } module Foo { >Foo : typeof Foo export var answer = 42; >answer : number +>42 : number } export = Foo; >Foo : Foo diff --git a/tests/baselines/reference/exportAssignmentTopLevelEnumdule.symbols b/tests/baselines/reference/exportAssignmentTopLevelEnumdule.symbols new file mode 100644 index 00000000000..6ad539f5f8e --- /dev/null +++ b/tests/baselines/reference/exportAssignmentTopLevelEnumdule.symbols @@ -0,0 +1,39 @@ +=== tests/cases/conformance/externalModules/foo_1.ts === +import foo = require("./foo_0"); +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) + +var color: foo; +>color : Symbol(color, Decl(foo_1.ts, 1, 3)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) + +if(color === foo.green){ +>color : Symbol(color, Decl(foo_1.ts, 1, 3)) +>foo.green : Symbol(foo.green, Decl(foo_0.ts, 1, 5)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>green : Symbol(foo.green, Decl(foo_0.ts, 1, 5)) + + color = foo.answer; +>color : Symbol(color, Decl(foo_1.ts, 1, 3)) +>foo.answer : Symbol(foo.answer, Decl(foo_0.ts, 4, 11)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>answer : Symbol(foo.answer, Decl(foo_0.ts, 4, 11)) +} + +=== tests/cases/conformance/externalModules/foo_0.ts === +enum foo { +>foo : Symbol(foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 2, 1)) + + red, green, blue +>red : Symbol(foo.red, Decl(foo_0.ts, 0, 10)) +>green : Symbol(foo.green, Decl(foo_0.ts, 1, 5)) +>blue : Symbol(foo.blue, Decl(foo_0.ts, 1, 12)) +} +module foo { +>foo : Symbol(foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 2, 1)) + + export var answer = 42; +>answer : Symbol(answer, Decl(foo_0.ts, 4, 11)) +} +export = foo; +>foo : Symbol(foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 2, 1)) + diff --git a/tests/baselines/reference/exportAssignmentTopLevelEnumdule.types b/tests/baselines/reference/exportAssignmentTopLevelEnumdule.types index 4ee49f6d20f..d60fc878319 100644 --- a/tests/baselines/reference/exportAssignmentTopLevelEnumdule.types +++ b/tests/baselines/reference/exportAssignmentTopLevelEnumdule.types @@ -35,6 +35,7 @@ module foo { export var answer = 42; >answer : number +>42 : number } export = foo; >foo : foo diff --git a/tests/baselines/reference/exportAssignmentTopLevelFundule.symbols b/tests/baselines/reference/exportAssignmentTopLevelFundule.symbols new file mode 100644 index 00000000000..672c8ca6231 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentTopLevelFundule.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/externalModules/foo_1.ts === +import foo = require("./foo_0"); +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) + +if(foo.answer === 42){ +>foo.answer : Symbol(foo.answer, Decl(foo_0.ts, 4, 11)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>answer : Symbol(foo.answer, Decl(foo_0.ts, 4, 11)) + + var x = foo(); +>x : Symbol(x, Decl(foo_1.ts, 2, 4)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +} + +=== tests/cases/conformance/externalModules/foo_0.ts === +function foo() { +>foo : Symbol(foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 2, 1)) + + return "test"; +} +module foo { +>foo : Symbol(foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 2, 1)) + + export var answer = 42; +>answer : Symbol(answer, Decl(foo_0.ts, 4, 11)) +} +export = foo; +>foo : Symbol(foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 2, 1)) + diff --git a/tests/baselines/reference/exportAssignmentTopLevelFundule.types b/tests/baselines/reference/exportAssignmentTopLevelFundule.types index 982e87e59f3..3464f4294a0 100644 --- a/tests/baselines/reference/exportAssignmentTopLevelFundule.types +++ b/tests/baselines/reference/exportAssignmentTopLevelFundule.types @@ -7,6 +7,7 @@ if(foo.answer === 42){ >foo.answer : number >foo : typeof foo >answer : number +>42 : number var x = foo(); >x : string @@ -19,12 +20,14 @@ function foo() { >foo : typeof foo return "test"; +>"test" : string } module foo { >foo : typeof foo export var answer = 42; >answer : number +>42 : number } export = foo; >foo : typeof foo diff --git a/tests/baselines/reference/exportAssignmentTopLevelIdentifier.symbols b/tests/baselines/reference/exportAssignmentTopLevelIdentifier.symbols new file mode 100644 index 00000000000..55b3d3718f9 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentTopLevelIdentifier.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/externalModules/foo_1.ts === +import foo = require("./foo_0"); +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) + +if(foo.answer === 42){ +>foo.answer : Symbol(foo.answer, Decl(foo_0.ts, 1, 11)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>answer : Symbol(foo.answer, Decl(foo_0.ts, 1, 11)) + +} + +=== tests/cases/conformance/externalModules/foo_0.ts === +module Foo { +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0)) + + export var answer = 42; +>answer : Symbol(answer, Decl(foo_0.ts, 1, 11)) +} +export = Foo; +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0)) + diff --git a/tests/baselines/reference/exportAssignmentTopLevelIdentifier.types b/tests/baselines/reference/exportAssignmentTopLevelIdentifier.types index 09d881715dd..34971ca9cd6 100644 --- a/tests/baselines/reference/exportAssignmentTopLevelIdentifier.types +++ b/tests/baselines/reference/exportAssignmentTopLevelIdentifier.types @@ -7,6 +7,7 @@ if(foo.answer === 42){ >foo.answer : number >foo : typeof foo >answer : number +>42 : number } @@ -16,6 +17,7 @@ module Foo { export var answer = 42; >answer : number +>42 : number } export = Foo; >Foo : typeof Foo diff --git a/tests/baselines/reference/exportAssignmentVariable.symbols b/tests/baselines/reference/exportAssignmentVariable.symbols new file mode 100644 index 00000000000..b819678d080 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentVariable.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/exportAssignmentVariable_B.ts === +import y = require("exportAssignmentVariable_A"); +>y : Symbol(y, Decl(exportAssignmentVariable_B.ts, 0, 0)) + +var n: number = y; +>n : Symbol(n, Decl(exportAssignmentVariable_B.ts, 2, 3)) +>y : Symbol(y, Decl(exportAssignmentVariable_B.ts, 0, 0)) + +=== tests/cases/compiler/exportAssignmentVariable_A.ts === +var x = 0; +>x : Symbol(x, Decl(exportAssignmentVariable_A.ts, 0, 3)) + +export = x; +>x : Symbol(x, Decl(exportAssignmentVariable_A.ts, 0, 3)) + diff --git a/tests/baselines/reference/exportAssignmentVariable.types b/tests/baselines/reference/exportAssignmentVariable.types index 36f02f60a95..71f0afdea68 100644 --- a/tests/baselines/reference/exportAssignmentVariable.types +++ b/tests/baselines/reference/exportAssignmentVariable.types @@ -9,6 +9,7 @@ var n: number = y; === tests/cases/compiler/exportAssignmentVariable_A.ts === var x = 0; >x : number +>0 : number export = x; >x : number diff --git a/tests/baselines/reference/exportAssignmentWithImportStatementPrivacyError.symbols b/tests/baselines/reference/exportAssignmentWithImportStatementPrivacyError.symbols new file mode 100644 index 00000000000..80a48dff3ad --- /dev/null +++ b/tests/baselines/reference/exportAssignmentWithImportStatementPrivacyError.symbols @@ -0,0 +1,57 @@ +=== tests/cases/compiler/exportAssignmentWithImportStatementPrivacyError.ts === +module m2 { +>m2 : Symbol(m2, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 0, 0)) + + export interface connectModule { +>connectModule : Symbol(connectModule, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 0, 11)) + + (res, req, next): void; +>res : Symbol(res, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 2, 9)) +>req : Symbol(req, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 2, 13)) +>next : Symbol(next, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 2, 18)) + } + export interface connectExport { +>connectExport : Symbol(connectExport, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 3, 5)) + + use: (mod: connectModule) => connectExport; +>use : Symbol(use, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 4, 36)) +>mod : Symbol(mod, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 5, 14)) +>connectModule : Symbol(connectModule, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 0, 11)) +>connectExport : Symbol(connectExport, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 3, 5)) + + listen: (port: number) => void; +>listen : Symbol(listen, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 5, 51)) +>port : Symbol(port, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 6, 17)) + } + +} + +module M { +>M : Symbol(M, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 9, 1)) + + export var server: { +>server : Symbol(server, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 12, 14)) + + (): m2.connectExport; +>m2 : Symbol(m2, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 0, 0)) +>connectExport : Symbol(m2.connectExport, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 3, 5)) + + test1: m2.connectModule; +>test1 : Symbol(test1, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 13, 29)) +>m2 : Symbol(m2, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 0, 0)) +>connectModule : Symbol(m2.connectModule, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 0, 11)) + + test2(): m2.connectModule; +>test2 : Symbol(test2, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 14, 32)) +>m2 : Symbol(m2, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 0, 0)) +>connectModule : Symbol(m2.connectModule, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 0, 11)) + + }; +} +import M22 = M; +>M22 : Symbol(M22, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 17, 1)) +>M : Symbol(M, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 9, 1)) + +export = M; +>M : Symbol(M, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 9, 1)) + diff --git a/tests/baselines/reference/exportAssignmentWithImportStatementPrivacyError.types b/tests/baselines/reference/exportAssignmentWithImportStatementPrivacyError.types index 7d6c7166655..9008cc267c8 100644 --- a/tests/baselines/reference/exportAssignmentWithImportStatementPrivacyError.types +++ b/tests/baselines/reference/exportAssignmentWithImportStatementPrivacyError.types @@ -1,6 +1,6 @@ === tests/cases/compiler/exportAssignmentWithImportStatementPrivacyError.ts === module m2 { ->m2 : unknown +>m2 : any export interface connectModule { >connectModule : connectModule @@ -33,17 +33,17 @@ module M { >server : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; } (): m2.connectExport; ->m2 : unknown +>m2 : any >connectExport : m2.connectExport test1: m2.connectModule; >test1 : m2.connectModule ->m2 : unknown +>m2 : any >connectModule : m2.connectModule test2(): m2.connectModule; >test2 : () => m2.connectModule ->m2 : unknown +>m2 : any >connectModule : m2.connectModule }; diff --git a/tests/baselines/reference/exportAssignmentWithPrivacyError.symbols b/tests/baselines/reference/exportAssignmentWithPrivacyError.symbols new file mode 100644 index 00000000000..f69a4e00823 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentWithPrivacyError.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/exportAssignmentWithPrivacyError.ts === +interface connectmodule { +>connectmodule : Symbol(connectmodule, Decl(exportAssignmentWithPrivacyError.ts, 0, 0)) + + (res, req, next): void; +>res : Symbol(res, Decl(exportAssignmentWithPrivacyError.ts, 1, 5)) +>req : Symbol(req, Decl(exportAssignmentWithPrivacyError.ts, 1, 9)) +>next : Symbol(next, Decl(exportAssignmentWithPrivacyError.ts, 1, 14)) +} +interface connectexport { +>connectexport : Symbol(connectexport, Decl(exportAssignmentWithPrivacyError.ts, 2, 1)) + + use: (mod: connectmodule) => connectexport; +>use : Symbol(use, Decl(exportAssignmentWithPrivacyError.ts, 3, 25)) +>mod : Symbol(mod, Decl(exportAssignmentWithPrivacyError.ts, 4, 10)) +>connectmodule : Symbol(connectmodule, Decl(exportAssignmentWithPrivacyError.ts, 0, 0)) +>connectexport : Symbol(connectexport, Decl(exportAssignmentWithPrivacyError.ts, 2, 1)) + + listen: (port: number) => void; +>listen : Symbol(listen, Decl(exportAssignmentWithPrivacyError.ts, 4, 47)) +>port : Symbol(port, Decl(exportAssignmentWithPrivacyError.ts, 5, 13)) +} + +var server: { +>server : Symbol(server, Decl(exportAssignmentWithPrivacyError.ts, 8, 3)) + + (): connectexport; +>connectexport : Symbol(connectexport, Decl(exportAssignmentWithPrivacyError.ts, 2, 1)) + + test1: connectmodule; +>test1 : Symbol(test1, Decl(exportAssignmentWithPrivacyError.ts, 9, 22)) +>connectmodule : Symbol(connectmodule, Decl(exportAssignmentWithPrivacyError.ts, 0, 0)) + + test2(): connectmodule; +>test2 : Symbol(test2, Decl(exportAssignmentWithPrivacyError.ts, 10, 25)) +>connectmodule : Symbol(connectmodule, Decl(exportAssignmentWithPrivacyError.ts, 0, 0)) + +}; + +export = server; +>server : Symbol(server, Decl(exportAssignmentWithPrivacyError.ts, 8, 3)) + + diff --git a/tests/baselines/reference/exportAssignmentWithoutIdentifier1.symbols b/tests/baselines/reference/exportAssignmentWithoutIdentifier1.symbols new file mode 100644 index 00000000000..bcbf5eb1f60 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentWithoutIdentifier1.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/exportAssignmentWithoutIdentifier1.ts === +function Greeter() { +>Greeter : Symbol(Greeter, Decl(exportAssignmentWithoutIdentifier1.ts, 0, 0)) + + //... +} +Greeter.prototype.greet = function () { +>Greeter.prototype : Symbol(Function.prototype, Decl(lib.d.ts, 249, 48)) +>Greeter : Symbol(Greeter, Decl(exportAssignmentWithoutIdentifier1.ts, 0, 0)) +>prototype : Symbol(Function.prototype, Decl(lib.d.ts, 249, 48)) + + //... +} +export = new Greeter(); +>Greeter : Symbol(Greeter, Decl(exportAssignmentWithoutIdentifier1.ts, 0, 0)) + diff --git a/tests/baselines/reference/exportCodeGen.symbols b/tests/baselines/reference/exportCodeGen.symbols new file mode 100644 index 00000000000..fbc70cf8324 --- /dev/null +++ b/tests/baselines/reference/exportCodeGen.symbols @@ -0,0 +1,109 @@ +=== tests/cases/conformance/internalModules/codeGeneration/exportCodeGen.ts === + +// should replace all refs to 'x' in the body, +// with fully qualified +module A { +>A : Symbol(A, Decl(exportCodeGen.ts, 0, 0)) + + export var x = 12; +>x : Symbol(x, Decl(exportCodeGen.ts, 4, 14)) + + function lt12() { +>lt12 : Symbol(lt12, Decl(exportCodeGen.ts, 4, 22)) + + return x < 12; +>x : Symbol(x, Decl(exportCodeGen.ts, 4, 14)) + } +} + +// should not fully qualify 'x' +module B { +>B : Symbol(B, Decl(exportCodeGen.ts, 8, 1)) + + var x = 12; +>x : Symbol(x, Decl(exportCodeGen.ts, 12, 7)) + + function lt12() { +>lt12 : Symbol(lt12, Decl(exportCodeGen.ts, 12, 15)) + + return x < 12; +>x : Symbol(x, Decl(exportCodeGen.ts, 12, 7)) + } +} + +// not copied, since not exported +module C { +>C : Symbol(C, Decl(exportCodeGen.ts, 16, 1)) + + function no() { +>no : Symbol(no, Decl(exportCodeGen.ts, 19, 10)) + + return false; + } +} + +// copies, since exported +module D { +>D : Symbol(D, Decl(exportCodeGen.ts, 23, 1)) + + export function yes() { +>yes : Symbol(yes, Decl(exportCodeGen.ts, 26, 10)) + + return true; + } +} + +// validate all exportable statements +module E { +>E : Symbol(E, Decl(exportCodeGen.ts, 30, 1)) + + export enum Color { Red } +>Color : Symbol(Color, Decl(exportCodeGen.ts, 33, 10)) +>Red : Symbol(Color.Red, Decl(exportCodeGen.ts, 34, 23)) + + export function fn() { } +>fn : Symbol(fn, Decl(exportCodeGen.ts, 34, 29)) + + export interface I { id: number } +>I : Symbol(I, Decl(exportCodeGen.ts, 35, 28)) +>id : Symbol(id, Decl(exportCodeGen.ts, 36, 24)) + + export class C { name: string } +>C : Symbol(C, Decl(exportCodeGen.ts, 36, 37)) +>name : Symbol(name, Decl(exportCodeGen.ts, 37, 20)) + + export module M { +>M : Symbol(M, Decl(exportCodeGen.ts, 37, 35)) + + export var x = 42; +>x : Symbol(x, Decl(exportCodeGen.ts, 39, 18)) + } +} + +// validate all exportable statements, +// which are not exported +module F { +>F : Symbol(F, Decl(exportCodeGen.ts, 41, 1)) + + enum Color { Red } +>Color : Symbol(Color, Decl(exportCodeGen.ts, 45, 10)) +>Red : Symbol(Color.Red, Decl(exportCodeGen.ts, 46, 16)) + + function fn() { } +>fn : Symbol(fn, Decl(exportCodeGen.ts, 46, 22)) + + interface I { id: number } +>I : Symbol(I, Decl(exportCodeGen.ts, 47, 21)) +>id : Symbol(id, Decl(exportCodeGen.ts, 48, 17)) + + class C { name: string } +>C : Symbol(C, Decl(exportCodeGen.ts, 48, 30)) +>name : Symbol(name, Decl(exportCodeGen.ts, 49, 13)) + + module M { +>M : Symbol(M, Decl(exportCodeGen.ts, 49, 28)) + + var x = 42; +>x : Symbol(x, Decl(exportCodeGen.ts, 51, 11)) + } +} diff --git a/tests/baselines/reference/exportCodeGen.types b/tests/baselines/reference/exportCodeGen.types index 89cb16fdf4c..e08678a76da 100644 --- a/tests/baselines/reference/exportCodeGen.types +++ b/tests/baselines/reference/exportCodeGen.types @@ -7,6 +7,7 @@ module A { export var x = 12; >x : number +>12 : number function lt12() { >lt12 : () => boolean @@ -14,6 +15,7 @@ module A { return x < 12; >x < 12 : boolean >x : number +>12 : number } } @@ -23,6 +25,7 @@ module B { var x = 12; >x : number +>12 : number function lt12() { >lt12 : () => boolean @@ -30,6 +33,7 @@ module B { return x < 12; >x < 12 : boolean >x : number +>12 : number } } @@ -41,6 +45,7 @@ module C { >no : () => boolean return false; +>false : boolean } } @@ -52,6 +57,7 @@ module D { >yes : () => boolean return true; +>true : boolean } } @@ -79,6 +85,7 @@ module E { export var x = 42; >x : number +>42 : number } } @@ -107,5 +114,6 @@ module F { var x = 42; >x : number +>42 : number } } diff --git a/tests/baselines/reference/exportDefaultForNonInstantiatedModule.symbols b/tests/baselines/reference/exportDefaultForNonInstantiatedModule.symbols new file mode 100644 index 00000000000..eb0836fd519 --- /dev/null +++ b/tests/baselines/reference/exportDefaultForNonInstantiatedModule.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/exportDefaultForNonInstantiatedModule.ts === + +module m { +>m : Symbol(m, Decl(exportDefaultForNonInstantiatedModule.ts, 0, 0)) + + export interface foo { +>foo : Symbol(foo, Decl(exportDefaultForNonInstantiatedModule.ts, 1, 10)) + } +} +// Should not be emitted +export default m; +>m : Symbol(m, Decl(exportDefaultForNonInstantiatedModule.ts, 0, 0)) + diff --git a/tests/baselines/reference/exportDefaultForNonInstantiatedModule.types b/tests/baselines/reference/exportDefaultForNonInstantiatedModule.types index 940bb44658e..6ec8f9868a3 100644 --- a/tests/baselines/reference/exportDefaultForNonInstantiatedModule.types +++ b/tests/baselines/reference/exportDefaultForNonInstantiatedModule.types @@ -1,7 +1,7 @@ === tests/cases/compiler/exportDefaultForNonInstantiatedModule.ts === module m { ->m : unknown +>m : any export interface foo { >foo : foo @@ -9,5 +9,5 @@ module m { } // Should not be emitted export default m; ->m : unknown +>m : any diff --git a/tests/baselines/reference/exportDefaultTypeAnnoation.errors.txt b/tests/baselines/reference/exportDefaultTypeAnnoation.errors.txt deleted file mode 100644 index 71ff4261ffe..00000000000 --- a/tests/baselines/reference/exportDefaultTypeAnnoation.errors.txt +++ /dev/null @@ -1,8 +0,0 @@ -tests/cases/compiler/exportDefaultTypeAnnoation.ts(2,18): error TS1201: A type annotation on an export statement is only allowed in an ambient external module declaration. - - -==== tests/cases/compiler/exportDefaultTypeAnnoation.ts (1 errors) ==== - - export default : number; - ~~~~~~ -!!! error TS1201: A type annotation on an export statement is only allowed in an ambient external module declaration. \ No newline at end of file diff --git a/tests/baselines/reference/exportDefaultTypeAnnoation.js b/tests/baselines/reference/exportDefaultTypeAnnoation.js deleted file mode 100644 index 71a829ac284..00000000000 --- a/tests/baselines/reference/exportDefaultTypeAnnoation.js +++ /dev/null @@ -1,6 +0,0 @@ -//// [exportDefaultTypeAnnoation.ts] - -export default : number; - -//// [exportDefaultTypeAnnoation.js] -exports.default = ; diff --git a/tests/baselines/reference/exportDefaultTypeAnnoation2.js b/tests/baselines/reference/exportDefaultTypeAnnoation2.js deleted file mode 100644 index 2c918954702..00000000000 --- a/tests/baselines/reference/exportDefaultTypeAnnoation2.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [exportDefaultTypeAnnoation2.ts] - -declare module "mod" { - export default : number; -} - -//// [exportDefaultTypeAnnoation2.js] diff --git a/tests/baselines/reference/exportDefaultTypeAnnoation2.types b/tests/baselines/reference/exportDefaultTypeAnnoation2.types deleted file mode 100644 index 53ca78586cc..00000000000 --- a/tests/baselines/reference/exportDefaultTypeAnnoation2.types +++ /dev/null @@ -1,6 +0,0 @@ -=== tests/cases/compiler/exportDefaultTypeAnnoation2.ts === - -No type information for this code.declare module "mod" { -No type information for this code. export default : number; -No type information for this code.} -No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/exportDefaultTypeAnnoation3.errors.txt b/tests/baselines/reference/exportDefaultTypeAnnoation3.errors.txt deleted file mode 100644 index 326713e059e..00000000000 --- a/tests/baselines/reference/exportDefaultTypeAnnoation3.errors.txt +++ /dev/null @@ -1,21 +0,0 @@ -tests/cases/compiler/reference1.ts(2,5): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/reference2.ts(2,5): error TS2322: Type 'number' is not assignable to type 'string'. - - -==== tests/cases/compiler/mod.d.ts (0 errors) ==== - - declare module "mod" { - export default : number; - } - -==== tests/cases/compiler/reference1.ts (1 errors) ==== - import d from "mod"; - var s: string = d; // Error - ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. - -==== tests/cases/compiler/reference2.ts (1 errors) ==== - import { default as d } from "mod"; - var s: string = d; // Error - ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/exportDefaultTypeAnnoation3.js b/tests/baselines/reference/exportDefaultTypeAnnoation3.js deleted file mode 100644 index 1f95e669de5..00000000000 --- a/tests/baselines/reference/exportDefaultTypeAnnoation3.js +++ /dev/null @@ -1,22 +0,0 @@ -//// [tests/cases/compiler/exportDefaultTypeAnnoation3.ts] //// - -//// [mod.d.ts] - -declare module "mod" { - export default : number; -} - -//// [reference1.ts] -import d from "mod"; -var s: string = d; // Error - -//// [reference2.ts] -import { default as d } from "mod"; -var s: string = d; // Error - -//// [reference1.js] -var mod_1 = require("mod"); -var s = mod_1.default; // Error -//// [reference2.js] -var mod_1 = require("mod"); -var s = mod_1.default; // Error diff --git a/tests/baselines/reference/exportEqualCallable.symbols b/tests/baselines/reference/exportEqualCallable.symbols new file mode 100644 index 00000000000..df1c6da8c7b --- /dev/null +++ b/tests/baselines/reference/exportEqualCallable.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/exportEqualCallable_1.ts === +/// +import connect = require('exportEqualCallable_0'); +>connect : Symbol(connect, Decl(exportEqualCallable_1.ts, 0, 0)) + +connect(); +>connect : Symbol(connect, Decl(exportEqualCallable_1.ts, 0, 0)) + +=== tests/cases/compiler/exportEqualCallable_0.ts === + +var server: { +>server : Symbol(server, Decl(exportEqualCallable_0.ts, 1, 3)) + + (): any; +}; +export = server; +>server : Symbol(server, Decl(exportEqualCallable_0.ts, 1, 3)) + diff --git a/tests/baselines/reference/exportEqualNamespaces.symbols b/tests/baselines/reference/exportEqualNamespaces.symbols new file mode 100644 index 00000000000..f6f0767d414 --- /dev/null +++ b/tests/baselines/reference/exportEqualNamespaces.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/exportEqualNamespaces.ts === +declare module server { +>server : Symbol(server, Decl(exportEqualNamespaces.ts, 0, 0), Decl(exportEqualNamespaces.ts, 2, 1), Decl(exportEqualNamespaces.ts, 10, 3)) + + interface Server extends Object { } +>Server : Symbol(Server, Decl(exportEqualNamespaces.ts, 0, 23)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +} + +interface server { +>server : Symbol(server, Decl(exportEqualNamespaces.ts, 0, 0), Decl(exportEqualNamespaces.ts, 2, 1), Decl(exportEqualNamespaces.ts, 10, 3)) + + (): server.Server; +>server : Symbol(server, Decl(exportEqualNamespaces.ts, 0, 0), Decl(exportEqualNamespaces.ts, 2, 1), Decl(exportEqualNamespaces.ts, 10, 3)) +>Server : Symbol(server.Server, Decl(exportEqualNamespaces.ts, 0, 23)) + + startTime: Date; +>startTime : Symbol(startTime, Decl(exportEqualNamespaces.ts, 5, 22)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +} + +var x = 5; +>x : Symbol(x, Decl(exportEqualNamespaces.ts, 9, 3)) + +var server = new Date(); +>server : Symbol(server, Decl(exportEqualNamespaces.ts, 0, 0), Decl(exportEqualNamespaces.ts, 2, 1), Decl(exportEqualNamespaces.ts, 10, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +export = server; +>server : Symbol(server, Decl(exportEqualNamespaces.ts, 0, 0), Decl(exportEqualNamespaces.ts, 2, 1), Decl(exportEqualNamespaces.ts, 10, 3)) + diff --git a/tests/baselines/reference/exportEqualNamespaces.types b/tests/baselines/reference/exportEqualNamespaces.types index 0f3091c1b8a..0e27102c015 100644 --- a/tests/baselines/reference/exportEqualNamespaces.types +++ b/tests/baselines/reference/exportEqualNamespaces.types @@ -11,7 +11,7 @@ interface server { >server : server (): server.Server; ->server : unknown +>server : any >Server : server.Server startTime: Date; @@ -21,6 +21,7 @@ interface server { var x = 5; >x : number +>5 : number var server = new Date(); >server : Date diff --git a/tests/baselines/reference/exportImport.symbols b/tests/baselines/reference/exportImport.symbols new file mode 100644 index 00000000000..02132338834 --- /dev/null +++ b/tests/baselines/reference/exportImport.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/consumer.ts === +import e = require('./exporter'); +>e : Symbol(e, Decl(consumer.ts, 0, 0)) + +export function w(): e.w { // Should be OK +>w : Symbol(w, Decl(consumer.ts, 0, 33)) +>e : Symbol(e, Decl(consumer.ts, 0, 0)) +>w : Symbol(e.w, Decl(exporter.ts, 0, 0)) + + return new e.w(); +>e.w : Symbol(e.w, Decl(exporter.ts, 0, 0)) +>e : Symbol(e, Decl(consumer.ts, 0, 0)) +>w : Symbol(e.w, Decl(exporter.ts, 0, 0)) +} +=== tests/cases/compiler/w1.ts === + +export = Widget1 +>Widget1 : Symbol(Widget1, Decl(w1.ts, 1, 16)) + +class Widget1 { name = 'one'; } +>Widget1 : Symbol(Widget1, Decl(w1.ts, 1, 16)) +>name : Symbol(name, Decl(w1.ts, 2, 15)) + +=== tests/cases/compiler/exporter.ts === +export import w = require('./w1'); +>w : Symbol(w, Decl(exporter.ts, 0, 0)) + diff --git a/tests/baselines/reference/exportImport.types b/tests/baselines/reference/exportImport.types index 9899103d779..a6361d3cbac 100644 --- a/tests/baselines/reference/exportImport.types +++ b/tests/baselines/reference/exportImport.types @@ -4,7 +4,7 @@ import e = require('./exporter'); export function w(): e.w { // Should be OK >w : () => e.w ->e : unknown +>e : any >w : e.w return new e.w(); @@ -21,6 +21,7 @@ export = Widget1 class Widget1 { name = 'one'; } >Widget1 : Widget1 >name : string +>'one' : string === tests/cases/compiler/exporter.ts === export import w = require('./w1'); diff --git a/tests/baselines/reference/exportImportAlias.symbols b/tests/baselines/reference/exportImportAlias.symbols new file mode 100644 index 00000000000..131f53919ab --- /dev/null +++ b/tests/baselines/reference/exportImportAlias.symbols @@ -0,0 +1,171 @@ +=== tests/cases/conformance/internalModules/importDeclarations/exportImportAlias.ts === +// expect no errors here + +module A { +>A : Symbol(A, Decl(exportImportAlias.ts, 0, 0)) + + export var x = 'hello world' +>x : Symbol(x, Decl(exportImportAlias.ts, 4, 14)) + + export class Point { +>Point : Symbol(Point, Decl(exportImportAlias.ts, 4, 32)) + + constructor(public x: number, public y: number) { } +>x : Symbol(x, Decl(exportImportAlias.ts, 6, 20)) +>y : Symbol(y, Decl(exportImportAlias.ts, 6, 37)) + } + export module B { +>B : Symbol(B, Decl(exportImportAlias.ts, 7, 5)) + + export interface Id { +>Id : Symbol(Id, Decl(exportImportAlias.ts, 8, 21)) + + name: string; +>name : Symbol(name, Decl(exportImportAlias.ts, 9, 29)) + } + } +} + +module C { +>C : Symbol(C, Decl(exportImportAlias.ts, 13, 1)) + + export import a = A; +>a : Symbol(a, Decl(exportImportAlias.ts, 15, 10)) +>A : Symbol(a, Decl(exportImportAlias.ts, 0, 0)) +} + +var a: string = C.a.x; +>a : Symbol(a, Decl(exportImportAlias.ts, 19, 3)) +>C.a.x : Symbol(A.x, Decl(exportImportAlias.ts, 4, 14)) +>C.a : Symbol(C.a, Decl(exportImportAlias.ts, 15, 10)) +>C : Symbol(C, Decl(exportImportAlias.ts, 13, 1)) +>a : Symbol(C.a, Decl(exportImportAlias.ts, 15, 10)) +>x : Symbol(A.x, Decl(exportImportAlias.ts, 4, 14)) + +var b: { x: number; y: number; } = new C.a.Point(0, 0); +>b : Symbol(b, Decl(exportImportAlias.ts, 20, 3)) +>x : Symbol(x, Decl(exportImportAlias.ts, 20, 8)) +>y : Symbol(y, Decl(exportImportAlias.ts, 20, 19)) +>C.a.Point : Symbol(A.Point, Decl(exportImportAlias.ts, 4, 32)) +>C.a : Symbol(C.a, Decl(exportImportAlias.ts, 15, 10)) +>C : Symbol(C, Decl(exportImportAlias.ts, 13, 1)) +>a : Symbol(C.a, Decl(exportImportAlias.ts, 15, 10)) +>Point : Symbol(A.Point, Decl(exportImportAlias.ts, 4, 32)) + +var c: { name: string }; +>c : Symbol(c, Decl(exportImportAlias.ts, 21, 3), Decl(exportImportAlias.ts, 22, 3)) +>name : Symbol(name, Decl(exportImportAlias.ts, 21, 8)) + +var c: C.a.B.Id; +>c : Symbol(c, Decl(exportImportAlias.ts, 21, 3), Decl(exportImportAlias.ts, 22, 3)) +>C : Symbol(C, Decl(exportImportAlias.ts, 13, 1)) +>a : Symbol(C.a, Decl(exportImportAlias.ts, 15, 10)) +>B : Symbol(A.B, Decl(exportImportAlias.ts, 7, 5)) +>Id : Symbol(A.B.Id, Decl(exportImportAlias.ts, 8, 21)) + +module X { +>X : Symbol(X, Decl(exportImportAlias.ts, 22, 16)) + + export function Y() { +>Y : Symbol(Y, Decl(exportImportAlias.ts, 24, 10), Decl(exportImportAlias.ts, 27, 5)) + + return 42; + } + + export module Y { +>Y : Symbol(Y, Decl(exportImportAlias.ts, 24, 10), Decl(exportImportAlias.ts, 27, 5)) + + export class Point { +>Point : Symbol(Point, Decl(exportImportAlias.ts, 29, 21)) + + constructor(public x: number, public y: number) { } +>x : Symbol(x, Decl(exportImportAlias.ts, 31, 24)) +>y : Symbol(y, Decl(exportImportAlias.ts, 31, 41)) + } + } +} + +module Z { +>Z : Symbol(Z, Decl(exportImportAlias.ts, 34, 1)) + + // 'y' should be a fundule here + export import y = X.Y; +>y : Symbol(y, Decl(exportImportAlias.ts, 36, 10)) +>X : Symbol(X, Decl(exportImportAlias.ts, 22, 16)) +>Y : Symbol(y, Decl(exportImportAlias.ts, 24, 10), Decl(exportImportAlias.ts, 27, 5)) +} + +var m: number = Z.y(); +>m : Symbol(m, Decl(exportImportAlias.ts, 42, 3)) +>Z.y : Symbol(Z.y, Decl(exportImportAlias.ts, 36, 10)) +>Z : Symbol(Z, Decl(exportImportAlias.ts, 34, 1)) +>y : Symbol(Z.y, Decl(exportImportAlias.ts, 36, 10)) + +var n: { x: number; y: number; } = new Z.y.Point(0, 0); +>n : Symbol(n, Decl(exportImportAlias.ts, 43, 3)) +>x : Symbol(x, Decl(exportImportAlias.ts, 43, 8)) +>y : Symbol(y, Decl(exportImportAlias.ts, 43, 19)) +>Z.y.Point : Symbol(X.Y.Point, Decl(exportImportAlias.ts, 29, 21)) +>Z.y : Symbol(Z.y, Decl(exportImportAlias.ts, 36, 10)) +>Z : Symbol(Z, Decl(exportImportAlias.ts, 34, 1)) +>y : Symbol(Z.y, Decl(exportImportAlias.ts, 36, 10)) +>Point : Symbol(X.Y.Point, Decl(exportImportAlias.ts, 29, 21)) + +module K { +>K : Symbol(K, Decl(exportImportAlias.ts, 43, 55)) + + export class L { +>L : Symbol(L, Decl(exportImportAlias.ts, 45, 10), Decl(exportImportAlias.ts, 48, 5)) + + constructor(public name: string) { } +>name : Symbol(name, Decl(exportImportAlias.ts, 47, 20)) + } + + export module L { +>L : Symbol(L, Decl(exportImportAlias.ts, 45, 10), Decl(exportImportAlias.ts, 48, 5)) + + export var y = 12; +>y : Symbol(y, Decl(exportImportAlias.ts, 51, 18)) + + export interface Point { +>Point : Symbol(Point, Decl(exportImportAlias.ts, 51, 26)) + + x: number; +>x : Symbol(x, Decl(exportImportAlias.ts, 52, 32)) + + y: number; +>y : Symbol(y, Decl(exportImportAlias.ts, 53, 22)) + } + } +} + +module M { +>M : Symbol(M, Decl(exportImportAlias.ts, 57, 1)) + + export import D = K.L; +>D : Symbol(D, Decl(exportImportAlias.ts, 59, 10)) +>K : Symbol(K, Decl(exportImportAlias.ts, 43, 55)) +>L : Symbol(D, Decl(exportImportAlias.ts, 45, 10), Decl(exportImportAlias.ts, 48, 5)) +} + +var o: { name: string }; +>o : Symbol(o, Decl(exportImportAlias.ts, 63, 3), Decl(exportImportAlias.ts, 64, 3)) +>name : Symbol(name, Decl(exportImportAlias.ts, 63, 8)) + +var o = new M.D('Hello'); +>o : Symbol(o, Decl(exportImportAlias.ts, 63, 3), Decl(exportImportAlias.ts, 64, 3)) +>M.D : Symbol(M.D, Decl(exportImportAlias.ts, 59, 10)) +>M : Symbol(M, Decl(exportImportAlias.ts, 57, 1)) +>D : Symbol(M.D, Decl(exportImportAlias.ts, 59, 10)) + +var p: { x: number; y: number; } +>p : Symbol(p, Decl(exportImportAlias.ts, 66, 3), Decl(exportImportAlias.ts, 67, 3)) +>x : Symbol(x, Decl(exportImportAlias.ts, 66, 8)) +>y : Symbol(y, Decl(exportImportAlias.ts, 66, 19)) + +var p: M.D.Point; +>p : Symbol(p, Decl(exportImportAlias.ts, 66, 3), Decl(exportImportAlias.ts, 67, 3)) +>M : Symbol(M, Decl(exportImportAlias.ts, 57, 1)) +>D : Symbol(M.D, Decl(exportImportAlias.ts, 59, 10)) +>Point : Symbol(K.L.Point, Decl(exportImportAlias.ts, 51, 26)) + diff --git a/tests/baselines/reference/exportImportAlias.types b/tests/baselines/reference/exportImportAlias.types index 0834d664861..f0c21d461bc 100644 --- a/tests/baselines/reference/exportImportAlias.types +++ b/tests/baselines/reference/exportImportAlias.types @@ -6,6 +6,7 @@ module A { export var x = 'hello world' >x : string +>'hello world' : string export class Point { >Point : Point @@ -15,7 +16,7 @@ module A { >y : number } export module B { ->B : unknown +>B : any export interface Id { >Id : Id @@ -52,6 +53,8 @@ var b: { x: number; y: number; } = new C.a.Point(0, 0); >C : typeof C >a : typeof A >Point : typeof A.Point +>0 : number +>0 : number var c: { name: string }; >c : { name: string; } @@ -59,9 +62,9 @@ var c: { name: string }; var c: C.a.B.Id; >c : { name: string; } ->C : unknown ->a : unknown ->B : unknown +>C : any +>a : any +>B : any >Id : A.B.Id module X { @@ -71,6 +74,7 @@ module X { >Y : typeof Y return 42; +>42 : number } export module Y { @@ -113,6 +117,8 @@ var n: { x: number; y: number; } = new Z.y.Point(0, 0); >Z : typeof Z >y : typeof X.Y >Point : typeof X.Y.Point +>0 : number +>0 : number module K { >K : typeof K @@ -129,6 +135,7 @@ module K { export var y = 12; >y : number +>12 : number export interface Point { >Point : Point @@ -161,6 +168,7 @@ var o = new M.D('Hello'); >M.D : typeof K.L >M : typeof M >D : typeof K.L +>'Hello' : string var p: { x: number; y: number; } >p : { x: number; y: number; } @@ -169,7 +177,7 @@ var p: { x: number; y: number; } var p: M.D.Point; >p : { x: number; y: number; } ->M : unknown ->D : unknown +>M : any +>D : any >Point : K.L.Point diff --git a/tests/baselines/reference/exportImportAndClodule.symbols b/tests/baselines/reference/exportImportAndClodule.symbols new file mode 100644 index 00000000000..23995243bf9 --- /dev/null +++ b/tests/baselines/reference/exportImportAndClodule.symbols @@ -0,0 +1,56 @@ +=== tests/cases/compiler/exportImportAndClodule.ts === +module K { +>K : Symbol(K, Decl(exportImportAndClodule.ts, 0, 0)) + + export class L { +>L : Symbol(L, Decl(exportImportAndClodule.ts, 0, 10), Decl(exportImportAndClodule.ts, 3, 5)) + + constructor(public name: string) { } +>name : Symbol(name, Decl(exportImportAndClodule.ts, 2, 20)) + } + export module L { +>L : Symbol(L, Decl(exportImportAndClodule.ts, 0, 10), Decl(exportImportAndClodule.ts, 3, 5)) + + export var y = 12; +>y : Symbol(y, Decl(exportImportAndClodule.ts, 5, 18)) + + export interface Point { +>Point : Symbol(Point, Decl(exportImportAndClodule.ts, 5, 26)) + + x: number; +>x : Symbol(x, Decl(exportImportAndClodule.ts, 6, 32)) + + y: number; +>y : Symbol(y, Decl(exportImportAndClodule.ts, 7, 22)) + } + } +} +module M { +>M : Symbol(M, Decl(exportImportAndClodule.ts, 11, 1)) + + export import D = K.L; +>D : Symbol(D, Decl(exportImportAndClodule.ts, 12, 10)) +>K : Symbol(K, Decl(exportImportAndClodule.ts, 0, 0)) +>L : Symbol(D, Decl(exportImportAndClodule.ts, 0, 10), Decl(exportImportAndClodule.ts, 3, 5)) +} +var o: { name: string }; +>o : Symbol(o, Decl(exportImportAndClodule.ts, 15, 3), Decl(exportImportAndClodule.ts, 16, 3)) +>name : Symbol(name, Decl(exportImportAndClodule.ts, 15, 8)) + +var o = new M.D('Hello'); +>o : Symbol(o, Decl(exportImportAndClodule.ts, 15, 3), Decl(exportImportAndClodule.ts, 16, 3)) +>M.D : Symbol(M.D, Decl(exportImportAndClodule.ts, 12, 10)) +>M : Symbol(M, Decl(exportImportAndClodule.ts, 11, 1)) +>D : Symbol(M.D, Decl(exportImportAndClodule.ts, 12, 10)) + +var p: { x: number; y: number; } +>p : Symbol(p, Decl(exportImportAndClodule.ts, 17, 3), Decl(exportImportAndClodule.ts, 18, 3)) +>x : Symbol(x, Decl(exportImportAndClodule.ts, 17, 8)) +>y : Symbol(y, Decl(exportImportAndClodule.ts, 17, 19)) + +var p: M.D.Point; +>p : Symbol(p, Decl(exportImportAndClodule.ts, 17, 3), Decl(exportImportAndClodule.ts, 18, 3)) +>M : Symbol(M, Decl(exportImportAndClodule.ts, 11, 1)) +>D : Symbol(M.D, Decl(exportImportAndClodule.ts, 12, 10)) +>Point : Symbol(K.L.Point, Decl(exportImportAndClodule.ts, 5, 26)) + diff --git a/tests/baselines/reference/exportImportAndClodule.types b/tests/baselines/reference/exportImportAndClodule.types index 7d233e72e77..36ca259666c 100644 --- a/tests/baselines/reference/exportImportAndClodule.types +++ b/tests/baselines/reference/exportImportAndClodule.types @@ -13,6 +13,7 @@ module K { export var y = 12; >y : number +>12 : number export interface Point { >Point : Point @@ -43,6 +44,7 @@ var o = new M.D('Hello'); >M.D : typeof K.L >M : typeof M >D : typeof K.L +>'Hello' : string var p: { x: number; y: number; } >p : { x: number; y: number; } @@ -51,7 +53,7 @@ var p: { x: number; y: number; } var p: M.D.Point; >p : { x: number; y: number; } ->M : unknown ->D : unknown +>M : any +>D : any >Point : K.L.Point diff --git a/tests/baselines/reference/exportImportMultipleFiles.symbols b/tests/baselines/reference/exportImportMultipleFiles.symbols new file mode 100644 index 00000000000..f0870cdf396 --- /dev/null +++ b/tests/baselines/reference/exportImportMultipleFiles.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/exportImportMultipleFiles_userCode.ts === +import lib = require('./exportImportMultipleFiles_library'); +>lib : Symbol(lib, Decl(exportImportMultipleFiles_userCode.ts, 0, 0)) + +lib.math.add(3, 4); // Shouldnt be error +>lib.math.add : Symbol(lib.math.add, Decl(exportImportMultipleFiles_math.ts, 0, 0)) +>lib.math : Symbol(lib.math, Decl(exportImportMultipleFiles_library.ts, 0, 0)) +>lib : Symbol(lib, Decl(exportImportMultipleFiles_userCode.ts, 0, 0)) +>math : Symbol(lib.math, Decl(exportImportMultipleFiles_library.ts, 0, 0)) +>add : Symbol(lib.math.add, Decl(exportImportMultipleFiles_math.ts, 0, 0)) + +=== tests/cases/compiler/exportImportMultipleFiles_math.ts === +export function add(a, b) { return a + b; } +>add : Symbol(add, Decl(exportImportMultipleFiles_math.ts, 0, 0)) +>a : Symbol(a, Decl(exportImportMultipleFiles_math.ts, 0, 20)) +>b : Symbol(b, Decl(exportImportMultipleFiles_math.ts, 0, 22)) +>a : Symbol(a, Decl(exportImportMultipleFiles_math.ts, 0, 20)) +>b : Symbol(b, Decl(exportImportMultipleFiles_math.ts, 0, 22)) + +=== tests/cases/compiler/exportImportMultipleFiles_library.ts === +export import math = require("exportImportMultipleFiles_math"); +>math : Symbol(math, Decl(exportImportMultipleFiles_library.ts, 0, 0)) + +math.add(3, 4); // OK +>math.add : Symbol(math.add, Decl(exportImportMultipleFiles_math.ts, 0, 0)) +>math : Symbol(math, Decl(exportImportMultipleFiles_library.ts, 0, 0)) +>add : Symbol(math.add, Decl(exportImportMultipleFiles_math.ts, 0, 0)) + diff --git a/tests/baselines/reference/exportImportMultipleFiles.types b/tests/baselines/reference/exportImportMultipleFiles.types index adafcef2dba..6ac5e7641ea 100644 --- a/tests/baselines/reference/exportImportMultipleFiles.types +++ b/tests/baselines/reference/exportImportMultipleFiles.types @@ -9,6 +9,8 @@ lib.math.add(3, 4); // Shouldnt be error >lib : typeof lib >math : typeof lib.math >add : (a: any, b: any) => any +>3 : number +>4 : number === tests/cases/compiler/exportImportMultipleFiles_math.ts === export function add(a, b) { return a + b; } @@ -28,4 +30,6 @@ math.add(3, 4); // OK >math.add : (a: any, b: any) => any >math : typeof math >add : (a: any, b: any) => any +>3 : number +>4 : number diff --git a/tests/baselines/reference/exportImportNonInstantiatedModule.symbols b/tests/baselines/reference/exportImportNonInstantiatedModule.symbols new file mode 100644 index 00000000000..6e044368bfb --- /dev/null +++ b/tests/baselines/reference/exportImportNonInstantiatedModule.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/exportImportNonInstantiatedModule.ts === +module A { +>A : Symbol(A, Decl(exportImportNonInstantiatedModule.ts, 0, 0)) + + export interface I { x: number } +>I : Symbol(I, Decl(exportImportNonInstantiatedModule.ts, 0, 10)) +>x : Symbol(x, Decl(exportImportNonInstantiatedModule.ts, 1, 24)) +} + +module B { +>B : Symbol(B, Decl(exportImportNonInstantiatedModule.ts, 2, 1)) + + export import A1 = A +>A1 : Symbol(A1, Decl(exportImportNonInstantiatedModule.ts, 4, 10)) +>A : Symbol(A1, Decl(exportImportNonInstantiatedModule.ts, 0, 0)) + +} + +var x: B.A1.I = { x: 1 }; +>x : Symbol(x, Decl(exportImportNonInstantiatedModule.ts, 9, 3)) +>B : Symbol(B, Decl(exportImportNonInstantiatedModule.ts, 2, 1)) +>A1 : Symbol(B.A1, Decl(exportImportNonInstantiatedModule.ts, 4, 10)) +>I : Symbol(A.I, Decl(exportImportNonInstantiatedModule.ts, 0, 10)) +>x : Symbol(x, Decl(exportImportNonInstantiatedModule.ts, 9, 17)) + diff --git a/tests/baselines/reference/exportImportNonInstantiatedModule.types b/tests/baselines/reference/exportImportNonInstantiatedModule.types index d1210cba6fe..0b1da72dad8 100644 --- a/tests/baselines/reference/exportImportNonInstantiatedModule.types +++ b/tests/baselines/reference/exportImportNonInstantiatedModule.types @@ -1,6 +1,6 @@ === tests/cases/compiler/exportImportNonInstantiatedModule.ts === module A { ->A : unknown +>A : any export interface I { x: number } >I : I @@ -11,16 +11,17 @@ module B { >B : typeof B export import A1 = A ->A1 : unknown ->A : unknown +>A1 : any +>A : any } var x: B.A1.I = { x: 1 }; >x : A.I ->B : unknown ->A1 : unknown +>B : any +>A1 : any >I : A.I >{ x: 1 } : { x: number; } >x : number +>1 : number diff --git a/tests/baselines/reference/exportImportNonInstantiatedModule2.symbols b/tests/baselines/reference/exportImportNonInstantiatedModule2.symbols new file mode 100644 index 00000000000..02ccf97b161 --- /dev/null +++ b/tests/baselines/reference/exportImportNonInstantiatedModule2.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/consumer.ts === +import e = require('./exporter'); +>e : Symbol(e, Decl(consumer.ts, 0, 0)) + +export function w(): e.w { // Should be OK +>w : Symbol(w, Decl(consumer.ts, 0, 33)) +>e : Symbol(e, Decl(consumer.ts, 0, 0)) +>w : Symbol(e.w, Decl(exporter.ts, 0, 0)) + + return {name: 'value' }; +>name : Symbol(name, Decl(consumer.ts, 3, 12)) +} +=== tests/cases/compiler/w1.ts === + +export = Widget1 +>Widget1 : Symbol(Widget1, Decl(w1.ts, 1, 16)) + +interface Widget1 { name: string; } +>Widget1 : Symbol(Widget1, Decl(w1.ts, 1, 16)) +>name : Symbol(name, Decl(w1.ts, 2, 19)) + +=== tests/cases/compiler/exporter.ts === +export import w = require('./w1'); +>w : Symbol(w, Decl(exporter.ts, 0, 0)) + diff --git a/tests/baselines/reference/exportImportNonInstantiatedModule2.types b/tests/baselines/reference/exportImportNonInstantiatedModule2.types index c11eac715a9..34f0810c12d 100644 --- a/tests/baselines/reference/exportImportNonInstantiatedModule2.types +++ b/tests/baselines/reference/exportImportNonInstantiatedModule2.types @@ -4,12 +4,13 @@ import e = require('./exporter'); export function w(): e.w { // Should be OK >w : () => e.w ->e : unknown +>e : any >w : e.w return {name: 'value' }; >{name: 'value' } : { name: string; } >name : string +>'value' : string } === tests/cases/compiler/w1.ts === @@ -22,5 +23,5 @@ interface Widget1 { name: string; } === tests/cases/compiler/exporter.ts === export import w = require('./w1'); ->w : unknown +>w : any diff --git a/tests/baselines/reference/exportPrivateType.symbols b/tests/baselines/reference/exportPrivateType.symbols new file mode 100644 index 00000000000..ecb71869b39 --- /dev/null +++ b/tests/baselines/reference/exportPrivateType.symbols @@ -0,0 +1,70 @@ +=== tests/cases/compiler/exportPrivateType.ts === +module foo { +>foo : Symbol(foo, Decl(exportPrivateType.ts, 0, 0)) + + class C1 { +>C1 : Symbol(C1, Decl(exportPrivateType.ts, 0, 12)) + + x: string; +>x : Symbol(x, Decl(exportPrivateType.ts, 1, 14)) + + y: C1; +>y : Symbol(y, Decl(exportPrivateType.ts, 2, 18)) +>C1 : Symbol(C1, Decl(exportPrivateType.ts, 0, 12)) + } + + class C2 { +>C2 : Symbol(C2, Decl(exportPrivateType.ts, 4, 5)) + + test() { return true; } +>test : Symbol(test, Decl(exportPrivateType.ts, 6, 14)) + } + + interface I1 { +>I1 : Symbol(I1, Decl(exportPrivateType.ts, 8, 5)) + + (a: string, b: string): string; +>a : Symbol(a, Decl(exportPrivateType.ts, 11, 9)) +>b : Symbol(b, Decl(exportPrivateType.ts, 11, 19)) + + (x: number, y: number): I1; +>x : Symbol(x, Decl(exportPrivateType.ts, 12, 9)) +>y : Symbol(y, Decl(exportPrivateType.ts, 12, 19)) +>I1 : Symbol(I1, Decl(exportPrivateType.ts, 8, 5)) + } + + interface I2 { +>I2 : Symbol(I2, Decl(exportPrivateType.ts, 13, 5)) + + x: string; +>x : Symbol(x, Decl(exportPrivateType.ts, 15, 18)) + + y: number; +>y : Symbol(y, Decl(exportPrivateType.ts, 16, 18)) + } + + // None of the types are exported, so per section 10.3, should all be errors + export var e: C1; +>e : Symbol(e, Decl(exportPrivateType.ts, 21, 14)) +>C1 : Symbol(C1, Decl(exportPrivateType.ts, 0, 12)) + + export var f: I1; +>f : Symbol(f, Decl(exportPrivateType.ts, 22, 14)) +>I1 : Symbol(I1, Decl(exportPrivateType.ts, 8, 5)) + + export var g: C2; +>g : Symbol(g, Decl(exportPrivateType.ts, 23, 14)) +>C2 : Symbol(C2, Decl(exportPrivateType.ts, 4, 5)) + + export var h: I2; +>h : Symbol(h, Decl(exportPrivateType.ts, 24, 14)) +>I2 : Symbol(I2, Decl(exportPrivateType.ts, 13, 5)) +} + +var y = foo.g; // Exported variable 'y' has or is using private type 'foo.C2'. +>y : Symbol(y, Decl(exportPrivateType.ts, 27, 3)) +>foo.g : Symbol(foo.g, Decl(exportPrivateType.ts, 23, 14)) +>foo : Symbol(foo, Decl(exportPrivateType.ts, 0, 0)) +>g : Symbol(foo.g, Decl(exportPrivateType.ts, 23, 14)) + + diff --git a/tests/baselines/reference/exportPrivateType.types b/tests/baselines/reference/exportPrivateType.types index 87751b273a7..a91577c2b9c 100644 --- a/tests/baselines/reference/exportPrivateType.types +++ b/tests/baselines/reference/exportPrivateType.types @@ -18,6 +18,7 @@ module foo { test() { return true; } >test : () => boolean +>true : boolean } interface I1 { diff --git a/tests/baselines/reference/exportVisibility.symbols b/tests/baselines/reference/exportVisibility.symbols new file mode 100644 index 00000000000..05785abd4f0 --- /dev/null +++ b/tests/baselines/reference/exportVisibility.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/exportVisibility.ts === +export class Foo { +>Foo : Symbol(Foo, Decl(exportVisibility.ts, 0, 0)) +} + +export var foo = new Foo(); +>foo : Symbol(foo, Decl(exportVisibility.ts, 3, 10)) +>Foo : Symbol(Foo, Decl(exportVisibility.ts, 0, 0)) + +export function test(foo: Foo) { +>test : Symbol(test, Decl(exportVisibility.ts, 3, 27)) +>foo : Symbol(foo, Decl(exportVisibility.ts, 5, 21)) +>Foo : Symbol(Foo, Decl(exportVisibility.ts, 0, 0)) + + return true; +} + diff --git a/tests/baselines/reference/exportVisibility.types b/tests/baselines/reference/exportVisibility.types index 59936828275..cf1e092473e 100644 --- a/tests/baselines/reference/exportVisibility.types +++ b/tests/baselines/reference/exportVisibility.types @@ -14,5 +14,6 @@ export function test(foo: Foo) { >Foo : Foo return true; +>true : boolean } diff --git a/tests/baselines/reference/exportedInterfaceInaccessibleInCallbackInModule.symbols b/tests/baselines/reference/exportedInterfaceInaccessibleInCallbackInModule.symbols new file mode 100644 index 00000000000..3127de7b6a2 --- /dev/null +++ b/tests/baselines/reference/exportedInterfaceInaccessibleInCallbackInModule.symbols @@ -0,0 +1,42 @@ +=== tests/cases/compiler/exportedInterfaceInaccessibleInCallbackInModule.ts === +export interface ProgressCallback { +>ProgressCallback : Symbol(ProgressCallback, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 0, 0)) + + (progress:any):any; +>progress : Symbol(progress, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 1, 2)) +} + +// --- Generic promise +export declare class TPromise { +>TPromise : Symbol(TPromise, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 2, 1)) +>V : Symbol(V, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 5, 30)) + + constructor(init:(complete: (value:V)=>void, error:(err:any)=>void, progress:ProgressCallback)=>void, oncancel?: any); +>init : Symbol(init, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 7, 13)) +>complete : Symbol(complete, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 7, 19)) +>value : Symbol(value, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 7, 30)) +>V : Symbol(V, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 5, 30)) +>error : Symbol(error, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 7, 45)) +>err : Symbol(err, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 7, 53)) +>progress : Symbol(progress, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 7, 68)) +>ProgressCallback : Symbol(ProgressCallback, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 0, 0)) +>oncancel : Symbol(oncancel, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 7, 102)) + + // removing this method fixes the error squiggle..... + public then(success?: (value:V)=>TPromise, error?: (err:any)=>TPromise, progress?:ProgressCallback): TPromise; +>then : Symbol(then, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 7, 119)) +>U : Symbol(U, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 10, 13)) +>success : Symbol(success, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 10, 16)) +>value : Symbol(value, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 10, 27)) +>V : Symbol(V, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 5, 30)) +>TPromise : Symbol(TPromise, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 2, 1)) +>U : Symbol(U, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 10, 13)) +>error : Symbol(error, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 10, 49)) +>err : Symbol(err, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 10, 59)) +>TPromise : Symbol(TPromise, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 2, 1)) +>U : Symbol(U, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 10, 13)) +>progress : Symbol(progress, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 10, 81)) +>ProgressCallback : Symbol(ProgressCallback, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 0, 0)) +>TPromise : Symbol(TPromise, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 2, 1)) +>U : Symbol(U, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 10, 13)) +} diff --git a/tests/baselines/reference/exportedVariable1.symbols b/tests/baselines/reference/exportedVariable1.symbols new file mode 100644 index 00000000000..96c4b0210ba --- /dev/null +++ b/tests/baselines/reference/exportedVariable1.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/exportedVariable1.ts === +export var foo = {name: "Bill"}; +>foo : Symbol(foo, Decl(exportedVariable1.ts, 0, 10)) +>name : Symbol(name, Decl(exportedVariable1.ts, 0, 18)) + +var upper = foo.name.toUpperCase(); +>upper : Symbol(upper, Decl(exportedVariable1.ts, 1, 3)) +>foo.name.toUpperCase : Symbol(String.toUpperCase, Decl(lib.d.ts, 405, 32)) +>foo.name : Symbol(name, Decl(exportedVariable1.ts, 0, 18)) +>foo : Symbol(foo, Decl(exportedVariable1.ts, 0, 10)) +>name : Symbol(name, Decl(exportedVariable1.ts, 0, 18)) +>toUpperCase : Symbol(String.toUpperCase, Decl(lib.d.ts, 405, 32)) + diff --git a/tests/baselines/reference/exportedVariable1.types b/tests/baselines/reference/exportedVariable1.types index a02cbc5b36a..fa7017fefa8 100644 --- a/tests/baselines/reference/exportedVariable1.types +++ b/tests/baselines/reference/exportedVariable1.types @@ -3,6 +3,7 @@ export var foo = {name: "Bill"}; >foo : { name: string; } >{name: "Bill"} : { name: string; } >name : string +>"Bill" : string var upper = foo.name.toUpperCase(); >upper : string diff --git a/tests/baselines/reference/exportsAndImports1-amd.symbols b/tests/baselines/reference/exportsAndImports1-amd.symbols new file mode 100644 index 00000000000..dc90c8c7bf9 --- /dev/null +++ b/tests/baselines/reference/exportsAndImports1-amd.symbols @@ -0,0 +1,101 @@ +=== tests/cases/conformance/es6/modules/t1.ts === + +var v = 1; +>v : Symbol(v, Decl(t1.ts, 1, 3)) + +function f() { } +>f : Symbol(f, Decl(t1.ts, 1, 10)) + +class C { +>C : Symbol(C, Decl(t1.ts, 2, 16)) +} +interface I { +>I : Symbol(I, Decl(t1.ts, 4, 1)) +} +enum E { +>E : Symbol(E, Decl(t1.ts, 6, 1)) + + A, B, C +>A : Symbol(E.A, Decl(t1.ts, 7, 8)) +>B : Symbol(E.B, Decl(t1.ts, 8, 6)) +>C : Symbol(E.C, Decl(t1.ts, 8, 9)) +} +const enum D { +>D : Symbol(D, Decl(t1.ts, 9, 1)) + + A, B, C +>A : Symbol(D.A, Decl(t1.ts, 10, 14)) +>B : Symbol(D.B, Decl(t1.ts, 11, 6)) +>C : Symbol(D.C, Decl(t1.ts, 11, 9)) +} +module M { +>M : Symbol(M, Decl(t1.ts, 12, 1)) + + export var x; +>x : Symbol(x, Decl(t1.ts, 14, 14)) +} +module N { +>N : Symbol(N, Decl(t1.ts, 15, 1)) + + export interface I { +>I : Symbol(I, Decl(t1.ts, 16, 10)) + } +} +type T = number; +>T : Symbol(T, Decl(t1.ts, 19, 1)) + +import a = M.x; +>a : Symbol(a, Decl(t1.ts, 20, 16)) +>M : Symbol(M, Decl(t1.ts, 12, 1)) +>x : Symbol(a, Decl(t1.ts, 14, 14)) + +export { v, f, C, I, E, D, M, N, T, a }; +>v : Symbol(v, Decl(t1.ts, 23, 8)) +>f : Symbol(f, Decl(t1.ts, 23, 11)) +>C : Symbol(C, Decl(t1.ts, 23, 14)) +>I : Symbol(I, Decl(t1.ts, 23, 17)) +>E : Symbol(E, Decl(t1.ts, 23, 20)) +>D : Symbol(D, Decl(t1.ts, 23, 23)) +>M : Symbol(M, Decl(t1.ts, 23, 26)) +>N : Symbol(N, Decl(t1.ts, 23, 29)) +>T : Symbol(T, Decl(t1.ts, 23, 32)) +>a : Symbol(a, Decl(t1.ts, 23, 35)) + +=== tests/cases/conformance/es6/modules/t2.ts === +export { v, f, C, I, E, D, M, N, T, a } from "./t1"; +>v : Symbol(v, Decl(t2.ts, 0, 8)) +>f : Symbol(f, Decl(t2.ts, 0, 11)) +>C : Symbol(C, Decl(t2.ts, 0, 14)) +>I : Symbol(I, Decl(t2.ts, 0, 17)) +>E : Symbol(E, Decl(t2.ts, 0, 20)) +>D : Symbol(D, Decl(t2.ts, 0, 23)) +>M : Symbol(M, Decl(t2.ts, 0, 26)) +>N : Symbol(N, Decl(t2.ts, 0, 29)) +>T : Symbol(T, Decl(t2.ts, 0, 32)) +>a : Symbol(a, Decl(t2.ts, 0, 35)) + +=== tests/cases/conformance/es6/modules/t3.ts === +import { v, f, C, I, E, D, M, N, T, a } from "./t1"; +>v : Symbol(v, Decl(t3.ts, 0, 8)) +>f : Symbol(f, Decl(t3.ts, 0, 11)) +>C : Symbol(C, Decl(t3.ts, 0, 14)) +>I : Symbol(I, Decl(t3.ts, 0, 17)) +>E : Symbol(E, Decl(t3.ts, 0, 20)) +>D : Symbol(D, Decl(t3.ts, 0, 23)) +>M : Symbol(M, Decl(t3.ts, 0, 26)) +>N : Symbol(N, Decl(t3.ts, 0, 29)) +>T : Symbol(T, Decl(t3.ts, 0, 32)) +>a : Symbol(a, Decl(t3.ts, 0, 35)) + +export { v, f, C, I, E, D, M, N, T, a }; +>v : Symbol(v, Decl(t3.ts, 1, 8)) +>f : Symbol(f, Decl(t3.ts, 1, 11)) +>C : Symbol(C, Decl(t3.ts, 1, 14)) +>I : Symbol(I, Decl(t3.ts, 1, 17)) +>E : Symbol(E, Decl(t3.ts, 1, 20)) +>D : Symbol(D, Decl(t3.ts, 1, 23)) +>M : Symbol(M, Decl(t3.ts, 1, 26)) +>N : Symbol(N, Decl(t3.ts, 1, 29)) +>T : Symbol(T, Decl(t3.ts, 1, 32)) +>a : Symbol(a, Decl(t3.ts, 1, 35)) + diff --git a/tests/baselines/reference/exportsAndImports1-amd.types b/tests/baselines/reference/exportsAndImports1-amd.types index 0b35b04e22e..4ba83121541 100644 --- a/tests/baselines/reference/exportsAndImports1-amd.types +++ b/tests/baselines/reference/exportsAndImports1-amd.types @@ -2,6 +2,7 @@ var v = 1; >v : number +>1 : number function f() { } >f : () => void @@ -35,7 +36,7 @@ module M { >x : any } module N { ->N : unknown +>N : any export interface I { >I : I @@ -53,12 +54,12 @@ export { v, f, C, I, E, D, M, N, T, a }; >v : number >f : () => void >C : typeof C ->I : unknown +>I : any >E : typeof E >D : typeof D >M : typeof M ->N : unknown ->T : unknown +>N : any +>T : any >a : any === tests/cases/conformance/es6/modules/t2.ts === @@ -66,12 +67,12 @@ export { v, f, C, I, E, D, M, N, T, a } from "./t1"; >v : number >f : () => void >C : typeof C ->I : unknown +>I : any >E : typeof E >D : typeof D >M : typeof M ->N : unknown ->T : unknown +>N : any +>T : any >a : any === tests/cases/conformance/es6/modules/t3.ts === @@ -79,23 +80,23 @@ import { v, f, C, I, E, D, M, N, T, a } from "./t1"; >v : number >f : () => void >C : typeof C ->I : unknown +>I : any >E : typeof E >D : typeof D >M : typeof M ->N : unknown ->T : unknown +>N : any +>T : any >a : any export { v, f, C, I, E, D, M, N, T, a }; >v : number >f : () => void >C : typeof C ->I : unknown +>I : any >E : typeof E >D : typeof D >M : typeof M ->N : unknown ->T : unknown +>N : any +>T : any >a : any diff --git a/tests/baselines/reference/exportsAndImports1.symbols b/tests/baselines/reference/exportsAndImports1.symbols new file mode 100644 index 00000000000..dc90c8c7bf9 --- /dev/null +++ b/tests/baselines/reference/exportsAndImports1.symbols @@ -0,0 +1,101 @@ +=== tests/cases/conformance/es6/modules/t1.ts === + +var v = 1; +>v : Symbol(v, Decl(t1.ts, 1, 3)) + +function f() { } +>f : Symbol(f, Decl(t1.ts, 1, 10)) + +class C { +>C : Symbol(C, Decl(t1.ts, 2, 16)) +} +interface I { +>I : Symbol(I, Decl(t1.ts, 4, 1)) +} +enum E { +>E : Symbol(E, Decl(t1.ts, 6, 1)) + + A, B, C +>A : Symbol(E.A, Decl(t1.ts, 7, 8)) +>B : Symbol(E.B, Decl(t1.ts, 8, 6)) +>C : Symbol(E.C, Decl(t1.ts, 8, 9)) +} +const enum D { +>D : Symbol(D, Decl(t1.ts, 9, 1)) + + A, B, C +>A : Symbol(D.A, Decl(t1.ts, 10, 14)) +>B : Symbol(D.B, Decl(t1.ts, 11, 6)) +>C : Symbol(D.C, Decl(t1.ts, 11, 9)) +} +module M { +>M : Symbol(M, Decl(t1.ts, 12, 1)) + + export var x; +>x : Symbol(x, Decl(t1.ts, 14, 14)) +} +module N { +>N : Symbol(N, Decl(t1.ts, 15, 1)) + + export interface I { +>I : Symbol(I, Decl(t1.ts, 16, 10)) + } +} +type T = number; +>T : Symbol(T, Decl(t1.ts, 19, 1)) + +import a = M.x; +>a : Symbol(a, Decl(t1.ts, 20, 16)) +>M : Symbol(M, Decl(t1.ts, 12, 1)) +>x : Symbol(a, Decl(t1.ts, 14, 14)) + +export { v, f, C, I, E, D, M, N, T, a }; +>v : Symbol(v, Decl(t1.ts, 23, 8)) +>f : Symbol(f, Decl(t1.ts, 23, 11)) +>C : Symbol(C, Decl(t1.ts, 23, 14)) +>I : Symbol(I, Decl(t1.ts, 23, 17)) +>E : Symbol(E, Decl(t1.ts, 23, 20)) +>D : Symbol(D, Decl(t1.ts, 23, 23)) +>M : Symbol(M, Decl(t1.ts, 23, 26)) +>N : Symbol(N, Decl(t1.ts, 23, 29)) +>T : Symbol(T, Decl(t1.ts, 23, 32)) +>a : Symbol(a, Decl(t1.ts, 23, 35)) + +=== tests/cases/conformance/es6/modules/t2.ts === +export { v, f, C, I, E, D, M, N, T, a } from "./t1"; +>v : Symbol(v, Decl(t2.ts, 0, 8)) +>f : Symbol(f, Decl(t2.ts, 0, 11)) +>C : Symbol(C, Decl(t2.ts, 0, 14)) +>I : Symbol(I, Decl(t2.ts, 0, 17)) +>E : Symbol(E, Decl(t2.ts, 0, 20)) +>D : Symbol(D, Decl(t2.ts, 0, 23)) +>M : Symbol(M, Decl(t2.ts, 0, 26)) +>N : Symbol(N, Decl(t2.ts, 0, 29)) +>T : Symbol(T, Decl(t2.ts, 0, 32)) +>a : Symbol(a, Decl(t2.ts, 0, 35)) + +=== tests/cases/conformance/es6/modules/t3.ts === +import { v, f, C, I, E, D, M, N, T, a } from "./t1"; +>v : Symbol(v, Decl(t3.ts, 0, 8)) +>f : Symbol(f, Decl(t3.ts, 0, 11)) +>C : Symbol(C, Decl(t3.ts, 0, 14)) +>I : Symbol(I, Decl(t3.ts, 0, 17)) +>E : Symbol(E, Decl(t3.ts, 0, 20)) +>D : Symbol(D, Decl(t3.ts, 0, 23)) +>M : Symbol(M, Decl(t3.ts, 0, 26)) +>N : Symbol(N, Decl(t3.ts, 0, 29)) +>T : Symbol(T, Decl(t3.ts, 0, 32)) +>a : Symbol(a, Decl(t3.ts, 0, 35)) + +export { v, f, C, I, E, D, M, N, T, a }; +>v : Symbol(v, Decl(t3.ts, 1, 8)) +>f : Symbol(f, Decl(t3.ts, 1, 11)) +>C : Symbol(C, Decl(t3.ts, 1, 14)) +>I : Symbol(I, Decl(t3.ts, 1, 17)) +>E : Symbol(E, Decl(t3.ts, 1, 20)) +>D : Symbol(D, Decl(t3.ts, 1, 23)) +>M : Symbol(M, Decl(t3.ts, 1, 26)) +>N : Symbol(N, Decl(t3.ts, 1, 29)) +>T : Symbol(T, Decl(t3.ts, 1, 32)) +>a : Symbol(a, Decl(t3.ts, 1, 35)) + diff --git a/tests/baselines/reference/exportsAndImports1.types b/tests/baselines/reference/exportsAndImports1.types index 0b35b04e22e..4ba83121541 100644 --- a/tests/baselines/reference/exportsAndImports1.types +++ b/tests/baselines/reference/exportsAndImports1.types @@ -2,6 +2,7 @@ var v = 1; >v : number +>1 : number function f() { } >f : () => void @@ -35,7 +36,7 @@ module M { >x : any } module N { ->N : unknown +>N : any export interface I { >I : I @@ -53,12 +54,12 @@ export { v, f, C, I, E, D, M, N, T, a }; >v : number >f : () => void >C : typeof C ->I : unknown +>I : any >E : typeof E >D : typeof D >M : typeof M ->N : unknown ->T : unknown +>N : any +>T : any >a : any === tests/cases/conformance/es6/modules/t2.ts === @@ -66,12 +67,12 @@ export { v, f, C, I, E, D, M, N, T, a } from "./t1"; >v : number >f : () => void >C : typeof C ->I : unknown +>I : any >E : typeof E >D : typeof D >M : typeof M ->N : unknown ->T : unknown +>N : any +>T : any >a : any === tests/cases/conformance/es6/modules/t3.ts === @@ -79,23 +80,23 @@ import { v, f, C, I, E, D, M, N, T, a } from "./t1"; >v : number >f : () => void >C : typeof C ->I : unknown +>I : any >E : typeof E >D : typeof D >M : typeof M ->N : unknown ->T : unknown +>N : any +>T : any >a : any export { v, f, C, I, E, D, M, N, T, a }; >v : number >f : () => void >C : typeof C ->I : unknown +>I : any >E : typeof E >D : typeof D >M : typeof M ->N : unknown ->T : unknown +>N : any +>T : any >a : any diff --git a/tests/baselines/reference/exportsAndImports2-amd.symbols b/tests/baselines/reference/exportsAndImports2-amd.symbols new file mode 100644 index 00000000000..8b53794abae --- /dev/null +++ b/tests/baselines/reference/exportsAndImports2-amd.symbols @@ -0,0 +1,26 @@ +=== tests/cases/conformance/es6/modules/t1.ts === + +export var x = "x"; +>x : Symbol(x, Decl(t1.ts, 1, 10)) + +export var y = "y"; +>y : Symbol(y, Decl(t1.ts, 2, 10)) + +=== tests/cases/conformance/es6/modules/t2.ts === +export { x as y, y as x } from "./t1"; +>x : Symbol(y, Decl(t2.ts, 0, 8)) +>y : Symbol(y, Decl(t2.ts, 0, 8)) +>y : Symbol(x, Decl(t2.ts, 0, 16)) +>x : Symbol(x, Decl(t2.ts, 0, 16)) + +=== tests/cases/conformance/es6/modules/t3.ts === +import { x, y } from "./t1"; +>x : Symbol(x, Decl(t3.ts, 0, 8)) +>y : Symbol(y, Decl(t3.ts, 0, 11)) + +export { x as y, y as x }; +>x : Symbol(y, Decl(t3.ts, 1, 8)) +>y : Symbol(y, Decl(t3.ts, 1, 8)) +>y : Symbol(x, Decl(t3.ts, 1, 16)) +>x : Symbol(x, Decl(t3.ts, 1, 16)) + diff --git a/tests/baselines/reference/exportsAndImports2-amd.types b/tests/baselines/reference/exportsAndImports2-amd.types index ebfc097da5a..32de763c567 100644 --- a/tests/baselines/reference/exportsAndImports2-amd.types +++ b/tests/baselines/reference/exportsAndImports2-amd.types @@ -2,9 +2,11 @@ export var x = "x"; >x : string +>"x" : string export var y = "y"; >y : string +>"y" : string === tests/cases/conformance/es6/modules/t2.ts === export { x as y, y as x } from "./t1"; diff --git a/tests/baselines/reference/exportsAndImports2.symbols b/tests/baselines/reference/exportsAndImports2.symbols new file mode 100644 index 00000000000..8b53794abae --- /dev/null +++ b/tests/baselines/reference/exportsAndImports2.symbols @@ -0,0 +1,26 @@ +=== tests/cases/conformance/es6/modules/t1.ts === + +export var x = "x"; +>x : Symbol(x, Decl(t1.ts, 1, 10)) + +export var y = "y"; +>y : Symbol(y, Decl(t1.ts, 2, 10)) + +=== tests/cases/conformance/es6/modules/t2.ts === +export { x as y, y as x } from "./t1"; +>x : Symbol(y, Decl(t2.ts, 0, 8)) +>y : Symbol(y, Decl(t2.ts, 0, 8)) +>y : Symbol(x, Decl(t2.ts, 0, 16)) +>x : Symbol(x, Decl(t2.ts, 0, 16)) + +=== tests/cases/conformance/es6/modules/t3.ts === +import { x, y } from "./t1"; +>x : Symbol(x, Decl(t3.ts, 0, 8)) +>y : Symbol(y, Decl(t3.ts, 0, 11)) + +export { x as y, y as x }; +>x : Symbol(y, Decl(t3.ts, 1, 8)) +>y : Symbol(y, Decl(t3.ts, 1, 8)) +>y : Symbol(x, Decl(t3.ts, 1, 16)) +>x : Symbol(x, Decl(t3.ts, 1, 16)) + diff --git a/tests/baselines/reference/exportsAndImports2.types b/tests/baselines/reference/exportsAndImports2.types index ebfc097da5a..32de763c567 100644 --- a/tests/baselines/reference/exportsAndImports2.types +++ b/tests/baselines/reference/exportsAndImports2.types @@ -2,9 +2,11 @@ export var x = "x"; >x : string +>"x" : string export var y = "y"; >y : string +>"y" : string === tests/cases/conformance/es6/modules/t2.ts === export { x as y, y as x } from "./t1"; diff --git a/tests/baselines/reference/exportsAndImports3-amd.symbols b/tests/baselines/reference/exportsAndImports3-amd.symbols new file mode 100644 index 00000000000..4ab418a9bef --- /dev/null +++ b/tests/baselines/reference/exportsAndImports3-amd.symbols @@ -0,0 +1,131 @@ +=== tests/cases/conformance/es6/modules/t1.ts === + +export var v = 1; +>v : Symbol(v, Decl(t1.ts, 1, 10)) + +export function f() { } +>f : Symbol(f, Decl(t1.ts, 1, 17)) + +export class C { +>C : Symbol(C, Decl(t1.ts, 2, 23)) +} +export interface I { +>I : Symbol(I, Decl(t1.ts, 4, 1)) +} +export enum E { +>E : Symbol(E, Decl(t1.ts, 6, 1)) + + A, B, C +>A : Symbol(E1.A, Decl(t1.ts, 7, 15)) +>B : Symbol(E1.B, Decl(t1.ts, 8, 6)) +>C : Symbol(E1.C, Decl(t1.ts, 8, 9)) +} +export const enum D { +>D : Symbol(D, Decl(t1.ts, 9, 1)) + + A, B, C +>A : Symbol(D1.A, Decl(t1.ts, 10, 21)) +>B : Symbol(D1.B, Decl(t1.ts, 11, 6)) +>C : Symbol(D1.C, Decl(t1.ts, 11, 9)) +} +export module M { +>M : Symbol(M, Decl(t1.ts, 12, 1)) + + export var x; +>x : Symbol(x, Decl(t1.ts, 14, 14)) +} +export module N { +>N : Symbol(N, Decl(t1.ts, 15, 1)) + + export interface I { +>I : Symbol(I, Decl(t1.ts, 16, 17)) + } +} +export type T = number; +>T : Symbol(T, Decl(t1.ts, 19, 1)) + +export import a = M.x; +>a : Symbol(a, Decl(t1.ts, 20, 23)) +>M : Symbol(M, Decl(t1.ts, 12, 1)) +>x : Symbol(a, Decl(t1.ts, 14, 14)) + +export { v as v1, f as f1, C as C1, I as I1, E as E1, D as D1, M as M1, N as N1, T as T1, a as a1 }; +>v : Symbol(v1, Decl(t1.ts, 23, 8)) +>v1 : Symbol(v1, Decl(t1.ts, 23, 8)) +>f : Symbol(f1, Decl(t1.ts, 23, 17)) +>f1 : Symbol(f1, Decl(t1.ts, 23, 17)) +>C : Symbol(C1, Decl(t1.ts, 23, 26)) +>C1 : Symbol(C1, Decl(t1.ts, 23, 26)) +>I : Symbol(I1, Decl(t1.ts, 23, 35)) +>I1 : Symbol(I1, Decl(t1.ts, 23, 35)) +>E : Symbol(E1, Decl(t1.ts, 23, 44)) +>E1 : Symbol(E1, Decl(t1.ts, 23, 44)) +>D : Symbol(D1, Decl(t1.ts, 23, 53)) +>D1 : Symbol(D1, Decl(t1.ts, 23, 53)) +>M : Symbol(M1, Decl(t1.ts, 23, 62)) +>M1 : Symbol(M1, Decl(t1.ts, 23, 62)) +>N : Symbol(N1, Decl(t1.ts, 23, 71)) +>N1 : Symbol(N1, Decl(t1.ts, 23, 71)) +>T : Symbol(T1, Decl(t1.ts, 23, 80)) +>T1 : Symbol(T1, Decl(t1.ts, 23, 80)) +>a : Symbol(a1, Decl(t1.ts, 23, 89)) +>a1 : Symbol(a1, Decl(t1.ts, 23, 89)) + +=== tests/cases/conformance/es6/modules/t2.ts === +export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1"; +>v1 : Symbol(v, Decl(t2.ts, 0, 8)) +>v : Symbol(v, Decl(t2.ts, 0, 8)) +>f1 : Symbol(f, Decl(t2.ts, 0, 17)) +>f : Symbol(f, Decl(t2.ts, 0, 17)) +>C1 : Symbol(C, Decl(t2.ts, 0, 26)) +>C : Symbol(C, Decl(t2.ts, 0, 26)) +>I1 : Symbol(I, Decl(t2.ts, 0, 35)) +>I : Symbol(I, Decl(t2.ts, 0, 35)) +>E1 : Symbol(E, Decl(t2.ts, 0, 44)) +>E : Symbol(E, Decl(t2.ts, 0, 44)) +>D1 : Symbol(D, Decl(t2.ts, 0, 53)) +>D : Symbol(D, Decl(t2.ts, 0, 53)) +>M1 : Symbol(M, Decl(t2.ts, 0, 62)) +>M : Symbol(M, Decl(t2.ts, 0, 62)) +>N1 : Symbol(N, Decl(t2.ts, 0, 71)) +>N : Symbol(N, Decl(t2.ts, 0, 71)) +>T1 : Symbol(T, Decl(t2.ts, 0, 80)) +>T : Symbol(T, Decl(t2.ts, 0, 80)) +>a1 : Symbol(a, Decl(t2.ts, 0, 89)) +>a : Symbol(a, Decl(t2.ts, 0, 89)) + +=== tests/cases/conformance/es6/modules/t3.ts === +import { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1"; +>v1 : Symbol(v, Decl(t3.ts, 0, 8)) +>v : Symbol(v, Decl(t3.ts, 0, 8)) +>f1 : Symbol(f, Decl(t3.ts, 0, 17)) +>f : Symbol(f, Decl(t3.ts, 0, 17)) +>C1 : Symbol(C, Decl(t3.ts, 0, 26)) +>C : Symbol(C, Decl(t3.ts, 0, 26)) +>I1 : Symbol(I, Decl(t3.ts, 0, 35)) +>I : Symbol(I, Decl(t3.ts, 0, 35)) +>E1 : Symbol(E, Decl(t3.ts, 0, 44)) +>E : Symbol(E, Decl(t3.ts, 0, 44)) +>D1 : Symbol(D, Decl(t3.ts, 0, 53)) +>D : Symbol(D, Decl(t3.ts, 0, 53)) +>M1 : Symbol(M, Decl(t3.ts, 0, 62)) +>M : Symbol(M, Decl(t3.ts, 0, 62)) +>N1 : Symbol(N, Decl(t3.ts, 0, 71)) +>N : Symbol(N, Decl(t3.ts, 0, 71)) +>T1 : Symbol(T, Decl(t3.ts, 0, 80)) +>T : Symbol(T, Decl(t3.ts, 0, 80)) +>a1 : Symbol(a, Decl(t3.ts, 0, 89)) +>a : Symbol(a, Decl(t3.ts, 0, 89)) + +export { v, f, C, I, E, D, M, N, T, a }; +>v : Symbol(v, Decl(t3.ts, 1, 8)) +>f : Symbol(f, Decl(t3.ts, 1, 11)) +>C : Symbol(C, Decl(t3.ts, 1, 14)) +>I : Symbol(I, Decl(t3.ts, 1, 17)) +>E : Symbol(E, Decl(t3.ts, 1, 20)) +>D : Symbol(D, Decl(t3.ts, 1, 23)) +>M : Symbol(M, Decl(t3.ts, 1, 26)) +>N : Symbol(N, Decl(t3.ts, 1, 29)) +>T : Symbol(T, Decl(t3.ts, 1, 32)) +>a : Symbol(a, Decl(t3.ts, 1, 35)) + diff --git a/tests/baselines/reference/exportsAndImports3-amd.types b/tests/baselines/reference/exportsAndImports3-amd.types index 86e21cfd084..0b8235d969c 100644 --- a/tests/baselines/reference/exportsAndImports3-amd.types +++ b/tests/baselines/reference/exportsAndImports3-amd.types @@ -2,6 +2,7 @@ export var v = 1; >v : number +>1 : number export function f() { } >f : () => void @@ -35,7 +36,7 @@ export module M { >x : any } export module N { ->N : unknown +>N : any export interface I { >I : I @@ -56,18 +57,18 @@ export { v as v1, f as f1, C as C1, I as I1, E as E1, D as D1, M as M1, N as N1, >f1 : () => void >C : typeof C >C1 : typeof C ->I : unknown ->I1 : unknown +>I : any +>I1 : any >E : typeof E >E1 : typeof E >D : typeof D >D1 : typeof D >M : typeof M >M1 : typeof M ->N : unknown ->N1 : unknown ->T : unknown ->T1 : unknown +>N : any +>N1 : any +>T : any +>T1 : any >a : any >a1 : any @@ -79,18 +80,18 @@ export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, >f : () => void >C1 : typeof C >C : typeof C ->I1 : unknown ->I : unknown +>I1 : any +>I : any >E1 : typeof E >E : typeof E >D1 : typeof D >D : typeof D >M1 : typeof M >M : typeof M ->N1 : unknown ->N : unknown ->T1 : unknown ->T : unknown +>N1 : any +>N : any +>T1 : any +>T : any >a1 : any >a : any @@ -102,18 +103,18 @@ import { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, >f : () => void >C1 : typeof C >C : typeof C ->I1 : unknown ->I : unknown +>I1 : any +>I : any >E1 : typeof E >E : typeof E >D1 : typeof D >D : typeof D >M1 : typeof M >M : typeof M ->N1 : unknown ->N : unknown ->T1 : unknown ->T : unknown +>N1 : any +>N : any +>T1 : any +>T : any >a1 : any >a : any @@ -121,11 +122,11 @@ export { v, f, C, I, E, D, M, N, T, a }; >v : number >f : () => void >C : typeof C ->I : unknown +>I : any >E : typeof E >D : typeof D >M : typeof M ->N : unknown ->T : unknown +>N : any +>T : any >a : any diff --git a/tests/baselines/reference/exportsAndImports3.symbols b/tests/baselines/reference/exportsAndImports3.symbols new file mode 100644 index 00000000000..4ab418a9bef --- /dev/null +++ b/tests/baselines/reference/exportsAndImports3.symbols @@ -0,0 +1,131 @@ +=== tests/cases/conformance/es6/modules/t1.ts === + +export var v = 1; +>v : Symbol(v, Decl(t1.ts, 1, 10)) + +export function f() { } +>f : Symbol(f, Decl(t1.ts, 1, 17)) + +export class C { +>C : Symbol(C, Decl(t1.ts, 2, 23)) +} +export interface I { +>I : Symbol(I, Decl(t1.ts, 4, 1)) +} +export enum E { +>E : Symbol(E, Decl(t1.ts, 6, 1)) + + A, B, C +>A : Symbol(E1.A, Decl(t1.ts, 7, 15)) +>B : Symbol(E1.B, Decl(t1.ts, 8, 6)) +>C : Symbol(E1.C, Decl(t1.ts, 8, 9)) +} +export const enum D { +>D : Symbol(D, Decl(t1.ts, 9, 1)) + + A, B, C +>A : Symbol(D1.A, Decl(t1.ts, 10, 21)) +>B : Symbol(D1.B, Decl(t1.ts, 11, 6)) +>C : Symbol(D1.C, Decl(t1.ts, 11, 9)) +} +export module M { +>M : Symbol(M, Decl(t1.ts, 12, 1)) + + export var x; +>x : Symbol(x, Decl(t1.ts, 14, 14)) +} +export module N { +>N : Symbol(N, Decl(t1.ts, 15, 1)) + + export interface I { +>I : Symbol(I, Decl(t1.ts, 16, 17)) + } +} +export type T = number; +>T : Symbol(T, Decl(t1.ts, 19, 1)) + +export import a = M.x; +>a : Symbol(a, Decl(t1.ts, 20, 23)) +>M : Symbol(M, Decl(t1.ts, 12, 1)) +>x : Symbol(a, Decl(t1.ts, 14, 14)) + +export { v as v1, f as f1, C as C1, I as I1, E as E1, D as D1, M as M1, N as N1, T as T1, a as a1 }; +>v : Symbol(v1, Decl(t1.ts, 23, 8)) +>v1 : Symbol(v1, Decl(t1.ts, 23, 8)) +>f : Symbol(f1, Decl(t1.ts, 23, 17)) +>f1 : Symbol(f1, Decl(t1.ts, 23, 17)) +>C : Symbol(C1, Decl(t1.ts, 23, 26)) +>C1 : Symbol(C1, Decl(t1.ts, 23, 26)) +>I : Symbol(I1, Decl(t1.ts, 23, 35)) +>I1 : Symbol(I1, Decl(t1.ts, 23, 35)) +>E : Symbol(E1, Decl(t1.ts, 23, 44)) +>E1 : Symbol(E1, Decl(t1.ts, 23, 44)) +>D : Symbol(D1, Decl(t1.ts, 23, 53)) +>D1 : Symbol(D1, Decl(t1.ts, 23, 53)) +>M : Symbol(M1, Decl(t1.ts, 23, 62)) +>M1 : Symbol(M1, Decl(t1.ts, 23, 62)) +>N : Symbol(N1, Decl(t1.ts, 23, 71)) +>N1 : Symbol(N1, Decl(t1.ts, 23, 71)) +>T : Symbol(T1, Decl(t1.ts, 23, 80)) +>T1 : Symbol(T1, Decl(t1.ts, 23, 80)) +>a : Symbol(a1, Decl(t1.ts, 23, 89)) +>a1 : Symbol(a1, Decl(t1.ts, 23, 89)) + +=== tests/cases/conformance/es6/modules/t2.ts === +export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1"; +>v1 : Symbol(v, Decl(t2.ts, 0, 8)) +>v : Symbol(v, Decl(t2.ts, 0, 8)) +>f1 : Symbol(f, Decl(t2.ts, 0, 17)) +>f : Symbol(f, Decl(t2.ts, 0, 17)) +>C1 : Symbol(C, Decl(t2.ts, 0, 26)) +>C : Symbol(C, Decl(t2.ts, 0, 26)) +>I1 : Symbol(I, Decl(t2.ts, 0, 35)) +>I : Symbol(I, Decl(t2.ts, 0, 35)) +>E1 : Symbol(E, Decl(t2.ts, 0, 44)) +>E : Symbol(E, Decl(t2.ts, 0, 44)) +>D1 : Symbol(D, Decl(t2.ts, 0, 53)) +>D : Symbol(D, Decl(t2.ts, 0, 53)) +>M1 : Symbol(M, Decl(t2.ts, 0, 62)) +>M : Symbol(M, Decl(t2.ts, 0, 62)) +>N1 : Symbol(N, Decl(t2.ts, 0, 71)) +>N : Symbol(N, Decl(t2.ts, 0, 71)) +>T1 : Symbol(T, Decl(t2.ts, 0, 80)) +>T : Symbol(T, Decl(t2.ts, 0, 80)) +>a1 : Symbol(a, Decl(t2.ts, 0, 89)) +>a : Symbol(a, Decl(t2.ts, 0, 89)) + +=== tests/cases/conformance/es6/modules/t3.ts === +import { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1"; +>v1 : Symbol(v, Decl(t3.ts, 0, 8)) +>v : Symbol(v, Decl(t3.ts, 0, 8)) +>f1 : Symbol(f, Decl(t3.ts, 0, 17)) +>f : Symbol(f, Decl(t3.ts, 0, 17)) +>C1 : Symbol(C, Decl(t3.ts, 0, 26)) +>C : Symbol(C, Decl(t3.ts, 0, 26)) +>I1 : Symbol(I, Decl(t3.ts, 0, 35)) +>I : Symbol(I, Decl(t3.ts, 0, 35)) +>E1 : Symbol(E, Decl(t3.ts, 0, 44)) +>E : Symbol(E, Decl(t3.ts, 0, 44)) +>D1 : Symbol(D, Decl(t3.ts, 0, 53)) +>D : Symbol(D, Decl(t3.ts, 0, 53)) +>M1 : Symbol(M, Decl(t3.ts, 0, 62)) +>M : Symbol(M, Decl(t3.ts, 0, 62)) +>N1 : Symbol(N, Decl(t3.ts, 0, 71)) +>N : Symbol(N, Decl(t3.ts, 0, 71)) +>T1 : Symbol(T, Decl(t3.ts, 0, 80)) +>T : Symbol(T, Decl(t3.ts, 0, 80)) +>a1 : Symbol(a, Decl(t3.ts, 0, 89)) +>a : Symbol(a, Decl(t3.ts, 0, 89)) + +export { v, f, C, I, E, D, M, N, T, a }; +>v : Symbol(v, Decl(t3.ts, 1, 8)) +>f : Symbol(f, Decl(t3.ts, 1, 11)) +>C : Symbol(C, Decl(t3.ts, 1, 14)) +>I : Symbol(I, Decl(t3.ts, 1, 17)) +>E : Symbol(E, Decl(t3.ts, 1, 20)) +>D : Symbol(D, Decl(t3.ts, 1, 23)) +>M : Symbol(M, Decl(t3.ts, 1, 26)) +>N : Symbol(N, Decl(t3.ts, 1, 29)) +>T : Symbol(T, Decl(t3.ts, 1, 32)) +>a : Symbol(a, Decl(t3.ts, 1, 35)) + diff --git a/tests/baselines/reference/exportsAndImports3.types b/tests/baselines/reference/exportsAndImports3.types index 86e21cfd084..0b8235d969c 100644 --- a/tests/baselines/reference/exportsAndImports3.types +++ b/tests/baselines/reference/exportsAndImports3.types @@ -2,6 +2,7 @@ export var v = 1; >v : number +>1 : number export function f() { } >f : () => void @@ -35,7 +36,7 @@ export module M { >x : any } export module N { ->N : unknown +>N : any export interface I { >I : I @@ -56,18 +57,18 @@ export { v as v1, f as f1, C as C1, I as I1, E as E1, D as D1, M as M1, N as N1, >f1 : () => void >C : typeof C >C1 : typeof C ->I : unknown ->I1 : unknown +>I : any +>I1 : any >E : typeof E >E1 : typeof E >D : typeof D >D1 : typeof D >M : typeof M >M1 : typeof M ->N : unknown ->N1 : unknown ->T : unknown ->T1 : unknown +>N : any +>N1 : any +>T : any +>T1 : any >a : any >a1 : any @@ -79,18 +80,18 @@ export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, >f : () => void >C1 : typeof C >C : typeof C ->I1 : unknown ->I : unknown +>I1 : any +>I : any >E1 : typeof E >E : typeof E >D1 : typeof D >D : typeof D >M1 : typeof M >M : typeof M ->N1 : unknown ->N : unknown ->T1 : unknown ->T : unknown +>N1 : any +>N : any +>T1 : any +>T : any >a1 : any >a : any @@ -102,18 +103,18 @@ import { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, >f : () => void >C1 : typeof C >C : typeof C ->I1 : unknown ->I : unknown +>I1 : any +>I : any >E1 : typeof E >E : typeof E >D1 : typeof D >D : typeof D >M1 : typeof M >M : typeof M ->N1 : unknown ->N : unknown ->T1 : unknown ->T : unknown +>N1 : any +>N : any +>T1 : any +>T : any >a1 : any >a : any @@ -121,11 +122,11 @@ export { v, f, C, I, E, D, M, N, T, a }; >v : number >f : () => void >C : typeof C ->I : unknown +>I : any >E : typeof E >D : typeof D >M : typeof M ->N : unknown ->T : unknown +>N : any +>T : any >a : any diff --git a/tests/baselines/reference/exportsAndImports4-amd.symbols b/tests/baselines/reference/exportsAndImports4-amd.symbols new file mode 100644 index 00000000000..0204d9bd586 --- /dev/null +++ b/tests/baselines/reference/exportsAndImports4-amd.symbols @@ -0,0 +1,68 @@ +=== tests/cases/conformance/es6/modules/t3.ts === +import a = require("./t1"); +>a : Symbol(a, Decl(t3.ts, 0, 0)) + +a.default; +>a.default : Symbol(a.default, Decl(t1.ts, 0, 0)) +>a : Symbol(a, Decl(t3.ts, 0, 0)) +>default : Symbol(a.default, Decl(t1.ts, 0, 0)) + +import b from "./t1"; +>b : Symbol(b, Decl(t3.ts, 2, 6)) + +b; +>b : Symbol(b, Decl(t3.ts, 2, 6)) + +import * as c from "./t1"; +>c : Symbol(c, Decl(t3.ts, 4, 6)) + +c.default; +>c.default : Symbol(a.default, Decl(t1.ts, 0, 0)) +>c : Symbol(c, Decl(t3.ts, 4, 6)) +>default : Symbol(a.default, Decl(t1.ts, 0, 0)) + +import { default as d } from "./t1"; +>default : Symbol(d, Decl(t3.ts, 6, 8)) +>d : Symbol(d, Decl(t3.ts, 6, 8)) + +d; +>d : Symbol(d, Decl(t3.ts, 6, 8)) + +import e1, * as e2 from "./t1"; +>e1 : Symbol(e1, Decl(t3.ts, 8, 6)) +>e2 : Symbol(e2, Decl(t3.ts, 8, 10)) + +e1; +>e1 : Symbol(e1, Decl(t3.ts, 8, 6)) + +e2.default; +>e2.default : Symbol(a.default, Decl(t1.ts, 0, 0)) +>e2 : Symbol(e2, Decl(t3.ts, 8, 10)) +>default : Symbol(a.default, Decl(t1.ts, 0, 0)) + +import f1, { default as f2 } from "./t1"; +>f1 : Symbol(f1, Decl(t3.ts, 11, 6)) +>default : Symbol(f2, Decl(t3.ts, 11, 12)) +>f2 : Symbol(f2, Decl(t3.ts, 11, 12)) + +f1; +>f1 : Symbol(f1, Decl(t3.ts, 11, 6)) + +f2; +>f2 : Symbol(f2, Decl(t3.ts, 11, 12)) + +export { a, b, c, d, e1, e2, f1, f2 }; +>a : Symbol(a, Decl(t3.ts, 14, 8)) +>b : Symbol(b, Decl(t3.ts, 14, 11)) +>c : Symbol(c, Decl(t3.ts, 14, 14)) +>d : Symbol(d, Decl(t3.ts, 14, 17)) +>e1 : Symbol(e1, Decl(t3.ts, 14, 20)) +>e2 : Symbol(e2, Decl(t3.ts, 14, 24)) +>f1 : Symbol(f1, Decl(t3.ts, 14, 28)) +>f2 : Symbol(f2, Decl(t3.ts, 14, 32)) + +=== tests/cases/conformance/es6/modules/t1.ts === + +No type information for this code.export default "hello"; +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/exportsAndImports4.symbols b/tests/baselines/reference/exportsAndImports4.symbols new file mode 100644 index 00000000000..0204d9bd586 --- /dev/null +++ b/tests/baselines/reference/exportsAndImports4.symbols @@ -0,0 +1,68 @@ +=== tests/cases/conformance/es6/modules/t3.ts === +import a = require("./t1"); +>a : Symbol(a, Decl(t3.ts, 0, 0)) + +a.default; +>a.default : Symbol(a.default, Decl(t1.ts, 0, 0)) +>a : Symbol(a, Decl(t3.ts, 0, 0)) +>default : Symbol(a.default, Decl(t1.ts, 0, 0)) + +import b from "./t1"; +>b : Symbol(b, Decl(t3.ts, 2, 6)) + +b; +>b : Symbol(b, Decl(t3.ts, 2, 6)) + +import * as c from "./t1"; +>c : Symbol(c, Decl(t3.ts, 4, 6)) + +c.default; +>c.default : Symbol(a.default, Decl(t1.ts, 0, 0)) +>c : Symbol(c, Decl(t3.ts, 4, 6)) +>default : Symbol(a.default, Decl(t1.ts, 0, 0)) + +import { default as d } from "./t1"; +>default : Symbol(d, Decl(t3.ts, 6, 8)) +>d : Symbol(d, Decl(t3.ts, 6, 8)) + +d; +>d : Symbol(d, Decl(t3.ts, 6, 8)) + +import e1, * as e2 from "./t1"; +>e1 : Symbol(e1, Decl(t3.ts, 8, 6)) +>e2 : Symbol(e2, Decl(t3.ts, 8, 10)) + +e1; +>e1 : Symbol(e1, Decl(t3.ts, 8, 6)) + +e2.default; +>e2.default : Symbol(a.default, Decl(t1.ts, 0, 0)) +>e2 : Symbol(e2, Decl(t3.ts, 8, 10)) +>default : Symbol(a.default, Decl(t1.ts, 0, 0)) + +import f1, { default as f2 } from "./t1"; +>f1 : Symbol(f1, Decl(t3.ts, 11, 6)) +>default : Symbol(f2, Decl(t3.ts, 11, 12)) +>f2 : Symbol(f2, Decl(t3.ts, 11, 12)) + +f1; +>f1 : Symbol(f1, Decl(t3.ts, 11, 6)) + +f2; +>f2 : Symbol(f2, Decl(t3.ts, 11, 12)) + +export { a, b, c, d, e1, e2, f1, f2 }; +>a : Symbol(a, Decl(t3.ts, 14, 8)) +>b : Symbol(b, Decl(t3.ts, 14, 11)) +>c : Symbol(c, Decl(t3.ts, 14, 14)) +>d : Symbol(d, Decl(t3.ts, 14, 17)) +>e1 : Symbol(e1, Decl(t3.ts, 14, 20)) +>e2 : Symbol(e2, Decl(t3.ts, 14, 24)) +>f1 : Symbol(f1, Decl(t3.ts, 14, 28)) +>f2 : Symbol(f2, Decl(t3.ts, 14, 32)) + +=== tests/cases/conformance/es6/modules/t1.ts === + +No type information for this code.export default "hello"; +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/extBaseClass1.symbols b/tests/baselines/reference/extBaseClass1.symbols new file mode 100644 index 00000000000..416fa910f31 --- /dev/null +++ b/tests/baselines/reference/extBaseClass1.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/extBaseClass1.ts === +module M { +>M : Symbol(M, Decl(extBaseClass1.ts, 0, 0), Decl(extBaseClass1.ts, 7, 1)) + + export class B { +>B : Symbol(B, Decl(extBaseClass1.ts, 0, 10)) + + public x=10; +>x : Symbol(x, Decl(extBaseClass1.ts, 1, 20)) + } + + export class C extends B { +>C : Symbol(C, Decl(extBaseClass1.ts, 3, 5)) +>B : Symbol(B, Decl(extBaseClass1.ts, 0, 10)) + } +} + +module M { +>M : Symbol(M, Decl(extBaseClass1.ts, 0, 0), Decl(extBaseClass1.ts, 7, 1)) + + export class C2 extends B { +>C2 : Symbol(C2, Decl(extBaseClass1.ts, 9, 10)) +>B : Symbol(B, Decl(extBaseClass1.ts, 0, 10)) + } +} + +module N { +>N : Symbol(N, Decl(extBaseClass1.ts, 12, 1)) + + export class C3 extends M.B { +>C3 : Symbol(C3, Decl(extBaseClass1.ts, 14, 10)) +>M.B : Symbol(M.B, Decl(extBaseClass1.ts, 0, 10)) +>M : Symbol(M, Decl(extBaseClass1.ts, 0, 0), Decl(extBaseClass1.ts, 7, 1)) +>B : Symbol(M.B, Decl(extBaseClass1.ts, 0, 10)) + } +} + diff --git a/tests/baselines/reference/extBaseClass1.types b/tests/baselines/reference/extBaseClass1.types index d160db9a06e..b476e1b4206 100644 --- a/tests/baselines/reference/extBaseClass1.types +++ b/tests/baselines/reference/extBaseClass1.types @@ -7,6 +7,7 @@ module M { public x=10; >x : number +>10 : number } export class C extends B { @@ -29,6 +30,7 @@ module N { export class C3 extends M.B { >C3 : C3 +>M.B : any >M : typeof M >B : M.B } diff --git a/tests/baselines/reference/extendAndImplementTheSameBaseType.symbols b/tests/baselines/reference/extendAndImplementTheSameBaseType.symbols new file mode 100644 index 00000000000..c211fa4955b --- /dev/null +++ b/tests/baselines/reference/extendAndImplementTheSameBaseType.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/extendAndImplementTheSameBaseType.ts === +class C { +>C : Symbol(C, Decl(extendAndImplementTheSameBaseType.ts, 0, 0)) + + foo: number +>foo : Symbol(foo, Decl(extendAndImplementTheSameBaseType.ts, 0, 9)) + + bar() {} +>bar : Symbol(bar, Decl(extendAndImplementTheSameBaseType.ts, 1, 15)) +} +class D extends C implements C { +>D : Symbol(D, Decl(extendAndImplementTheSameBaseType.ts, 3, 1)) +>C : Symbol(C, Decl(extendAndImplementTheSameBaseType.ts, 0, 0)) +>C : Symbol(C, Decl(extendAndImplementTheSameBaseType.ts, 0, 0)) + + baz() { } +>baz : Symbol(baz, Decl(extendAndImplementTheSameBaseType.ts, 4, 32)) +} + +var c: C; +>c : Symbol(c, Decl(extendAndImplementTheSameBaseType.ts, 8, 3)) +>C : Symbol(C, Decl(extendAndImplementTheSameBaseType.ts, 0, 0)) + +var d: D = new D(); +>d : Symbol(d, Decl(extendAndImplementTheSameBaseType.ts, 9, 3)) +>D : Symbol(D, Decl(extendAndImplementTheSameBaseType.ts, 3, 1)) +>D : Symbol(D, Decl(extendAndImplementTheSameBaseType.ts, 3, 1)) + +d.bar(); +>d.bar : Symbol(C.bar, Decl(extendAndImplementTheSameBaseType.ts, 1, 15)) +>d : Symbol(d, Decl(extendAndImplementTheSameBaseType.ts, 9, 3)) +>bar : Symbol(C.bar, Decl(extendAndImplementTheSameBaseType.ts, 1, 15)) + +d.baz(); +>d.baz : Symbol(D.baz, Decl(extendAndImplementTheSameBaseType.ts, 4, 32)) +>d : Symbol(d, Decl(extendAndImplementTheSameBaseType.ts, 9, 3)) +>baz : Symbol(D.baz, Decl(extendAndImplementTheSameBaseType.ts, 4, 32)) + +d.foo; +>d.foo : Symbol(C.foo, Decl(extendAndImplementTheSameBaseType.ts, 0, 9)) +>d : Symbol(d, Decl(extendAndImplementTheSameBaseType.ts, 9, 3)) +>foo : Symbol(C.foo, Decl(extendAndImplementTheSameBaseType.ts, 0, 9)) + diff --git a/tests/baselines/reference/extendBaseClassBeforeItsDeclared.symbols b/tests/baselines/reference/extendBaseClassBeforeItsDeclared.symbols new file mode 100644 index 00000000000..88aca935113 --- /dev/null +++ b/tests/baselines/reference/extendBaseClassBeforeItsDeclared.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/extendBaseClassBeforeItsDeclared.ts === +class derived extends base { } +>derived : Symbol(derived, Decl(extendBaseClassBeforeItsDeclared.ts, 0, 0)) +>base : Symbol(base, Decl(extendBaseClassBeforeItsDeclared.ts, 0, 30)) + +class base { constructor (public n: number) { } } +>base : Symbol(base, Decl(extendBaseClassBeforeItsDeclared.ts, 0, 30)) +>n : Symbol(n, Decl(extendBaseClassBeforeItsDeclared.ts, 2, 26)) + diff --git a/tests/baselines/reference/extendBooleanInterface.symbols b/tests/baselines/reference/extendBooleanInterface.symbols new file mode 100644 index 00000000000..8e123eb050e --- /dev/null +++ b/tests/baselines/reference/extendBooleanInterface.symbols @@ -0,0 +1,40 @@ +=== tests/cases/conformance/types/primitives/boolean/extendBooleanInterface.ts === +interface Boolean { +>Boolean : Symbol(Boolean, Decl(lib.d.ts, 443, 38), Decl(lib.d.ts, 456, 11), Decl(extendBooleanInterface.ts, 0, 0)) + + doStuff(): string; +>doStuff : Symbol(doStuff, Decl(extendBooleanInterface.ts, 0, 19)) + + doOtherStuff(x: T): T; +>doOtherStuff : Symbol(doOtherStuff, Decl(extendBooleanInterface.ts, 1, 22)) +>T : Symbol(T, Decl(extendBooleanInterface.ts, 2, 17)) +>x : Symbol(x, Decl(extendBooleanInterface.ts, 2, 20)) +>T : Symbol(T, Decl(extendBooleanInterface.ts, 2, 17)) +>T : Symbol(T, Decl(extendBooleanInterface.ts, 2, 17)) +} + +var x = true; +>x : Symbol(x, Decl(extendBooleanInterface.ts, 5, 3)) + +var a: string = x.doStuff(); +>a : Symbol(a, Decl(extendBooleanInterface.ts, 6, 3)) +>x.doStuff : Symbol(Boolean.doStuff, Decl(extendBooleanInterface.ts, 0, 19)) +>x : Symbol(x, Decl(extendBooleanInterface.ts, 5, 3)) +>doStuff : Symbol(Boolean.doStuff, Decl(extendBooleanInterface.ts, 0, 19)) + +var b: string = x.doOtherStuff('hm'); +>b : Symbol(b, Decl(extendBooleanInterface.ts, 7, 3)) +>x.doOtherStuff : Symbol(Boolean.doOtherStuff, Decl(extendBooleanInterface.ts, 1, 22)) +>x : Symbol(x, Decl(extendBooleanInterface.ts, 5, 3)) +>doOtherStuff : Symbol(Boolean.doOtherStuff, Decl(extendBooleanInterface.ts, 1, 22)) + +var c: string = x['doStuff'](); +>c : Symbol(c, Decl(extendBooleanInterface.ts, 8, 3)) +>x : Symbol(x, Decl(extendBooleanInterface.ts, 5, 3)) +>'doStuff' : Symbol(Boolean.doStuff, Decl(extendBooleanInterface.ts, 0, 19)) + +var d: string = x['doOtherStuff']('hm'); +>d : Symbol(d, Decl(extendBooleanInterface.ts, 9, 3)) +>x : Symbol(x, Decl(extendBooleanInterface.ts, 5, 3)) +>'doOtherStuff' : Symbol(Boolean.doOtherStuff, Decl(extendBooleanInterface.ts, 1, 22)) + diff --git a/tests/baselines/reference/extendBooleanInterface.types b/tests/baselines/reference/extendBooleanInterface.types index 2d94680599a..8f91deba713 100644 --- a/tests/baselines/reference/extendBooleanInterface.types +++ b/tests/baselines/reference/extendBooleanInterface.types @@ -15,6 +15,7 @@ interface Boolean { var x = true; >x : boolean +>true : boolean var a: string = x.doStuff(); >a : string @@ -29,16 +30,20 @@ var b: string = x.doOtherStuff('hm'); >x.doOtherStuff : (x: T) => T >x : boolean >doOtherStuff : (x: T) => T +>'hm' : string var c: string = x['doStuff'](); >c : string >x['doStuff']() : string >x['doStuff'] : () => string >x : boolean +>'doStuff' : string var d: string = x['doOtherStuff']('hm'); >d : string >x['doOtherStuff']('hm') : string >x['doOtherStuff'] : (x: T) => T >x : boolean +>'doOtherStuff' : string +>'hm' : string diff --git a/tests/baselines/reference/extendNumberInterface.symbols b/tests/baselines/reference/extendNumberInterface.symbols new file mode 100644 index 00000000000..56d2f8b0014 --- /dev/null +++ b/tests/baselines/reference/extendNumberInterface.symbols @@ -0,0 +1,40 @@ +=== tests/cases/conformance/types/primitives/number/extendNumberInterface.ts === +interface Number { +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11), Decl(extendNumberInterface.ts, 0, 0)) + + doStuff(): string; +>doStuff : Symbol(doStuff, Decl(extendNumberInterface.ts, 0, 18)) + + doOtherStuff(x:T): T; +>doOtherStuff : Symbol(doOtherStuff, Decl(extendNumberInterface.ts, 1, 22)) +>T : Symbol(T, Decl(extendNumberInterface.ts, 2, 17)) +>x : Symbol(x, Decl(extendNumberInterface.ts, 2, 20)) +>T : Symbol(T, Decl(extendNumberInterface.ts, 2, 17)) +>T : Symbol(T, Decl(extendNumberInterface.ts, 2, 17)) +} + +var x = 1; +>x : Symbol(x, Decl(extendNumberInterface.ts, 5, 3)) + +var a: string = x.doStuff(); +>a : Symbol(a, Decl(extendNumberInterface.ts, 6, 3)) +>x.doStuff : Symbol(Number.doStuff, Decl(extendNumberInterface.ts, 0, 18)) +>x : Symbol(x, Decl(extendNumberInterface.ts, 5, 3)) +>doStuff : Symbol(Number.doStuff, Decl(extendNumberInterface.ts, 0, 18)) + +var b: string = x.doOtherStuff('hm'); +>b : Symbol(b, Decl(extendNumberInterface.ts, 7, 3)) +>x.doOtherStuff : Symbol(Number.doOtherStuff, Decl(extendNumberInterface.ts, 1, 22)) +>x : Symbol(x, Decl(extendNumberInterface.ts, 5, 3)) +>doOtherStuff : Symbol(Number.doOtherStuff, Decl(extendNumberInterface.ts, 1, 22)) + +var c: string = x['doStuff'](); +>c : Symbol(c, Decl(extendNumberInterface.ts, 8, 3)) +>x : Symbol(x, Decl(extendNumberInterface.ts, 5, 3)) +>'doStuff' : Symbol(Number.doStuff, Decl(extendNumberInterface.ts, 0, 18)) + +var d: string = x['doOtherStuff']('hm'); +>d : Symbol(d, Decl(extendNumberInterface.ts, 9, 3)) +>x : Symbol(x, Decl(extendNumberInterface.ts, 5, 3)) +>'doOtherStuff' : Symbol(Number.doOtherStuff, Decl(extendNumberInterface.ts, 1, 22)) + diff --git a/tests/baselines/reference/extendNumberInterface.types b/tests/baselines/reference/extendNumberInterface.types index f109e05be89..97ef307bab8 100644 --- a/tests/baselines/reference/extendNumberInterface.types +++ b/tests/baselines/reference/extendNumberInterface.types @@ -15,6 +15,7 @@ interface Number { var x = 1; >x : number +>1 : number var a: string = x.doStuff(); >a : string @@ -29,16 +30,20 @@ var b: string = x.doOtherStuff('hm'); >x.doOtherStuff : (x: T) => T >x : number >doOtherStuff : (x: T) => T +>'hm' : string var c: string = x['doStuff'](); >c : string >x['doStuff']() : string >x['doStuff'] : () => string >x : number +>'doStuff' : string var d: string = x['doOtherStuff']('hm'); >d : string >x['doOtherStuff']('hm') : string >x['doOtherStuff'] : (x: T) => T >x : number +>'doOtherStuff' : string +>'hm' : string diff --git a/tests/baselines/reference/extendStringInterface.symbols b/tests/baselines/reference/extendStringInterface.symbols new file mode 100644 index 00000000000..a72773647a8 --- /dev/null +++ b/tests/baselines/reference/extendStringInterface.symbols @@ -0,0 +1,40 @@ +=== tests/cases/conformance/types/primitives/string/extendStringInterface.ts === +interface String { +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(extendStringInterface.ts, 0, 0)) + + doStuff(): string; +>doStuff : Symbol(doStuff, Decl(extendStringInterface.ts, 0, 18)) + + doOtherStuff(x:T): T; +>doOtherStuff : Symbol(doOtherStuff, Decl(extendStringInterface.ts, 1, 22)) +>T : Symbol(T, Decl(extendStringInterface.ts, 2, 17)) +>x : Symbol(x, Decl(extendStringInterface.ts, 2, 20)) +>T : Symbol(T, Decl(extendStringInterface.ts, 2, 17)) +>T : Symbol(T, Decl(extendStringInterface.ts, 2, 17)) +} + +var x = ''; +>x : Symbol(x, Decl(extendStringInterface.ts, 5, 3)) + +var a: string = x.doStuff(); +>a : Symbol(a, Decl(extendStringInterface.ts, 6, 3)) +>x.doStuff : Symbol(String.doStuff, Decl(extendStringInterface.ts, 0, 18)) +>x : Symbol(x, Decl(extendStringInterface.ts, 5, 3)) +>doStuff : Symbol(String.doStuff, Decl(extendStringInterface.ts, 0, 18)) + +var b: string = x.doOtherStuff('hm'); +>b : Symbol(b, Decl(extendStringInterface.ts, 7, 3)) +>x.doOtherStuff : Symbol(String.doOtherStuff, Decl(extendStringInterface.ts, 1, 22)) +>x : Symbol(x, Decl(extendStringInterface.ts, 5, 3)) +>doOtherStuff : Symbol(String.doOtherStuff, Decl(extendStringInterface.ts, 1, 22)) + +var c: string = x['doStuff'](); +>c : Symbol(c, Decl(extendStringInterface.ts, 8, 3)) +>x : Symbol(x, Decl(extendStringInterface.ts, 5, 3)) +>'doStuff' : Symbol(String.doStuff, Decl(extendStringInterface.ts, 0, 18)) + +var d: string = x['doOtherStuff']('hm'); +>d : Symbol(d, Decl(extendStringInterface.ts, 9, 3)) +>x : Symbol(x, Decl(extendStringInterface.ts, 5, 3)) +>'doOtherStuff' : Symbol(String.doOtherStuff, Decl(extendStringInterface.ts, 1, 22)) + diff --git a/tests/baselines/reference/extendStringInterface.types b/tests/baselines/reference/extendStringInterface.types index 3cf9f72f5f2..edfd8239015 100644 --- a/tests/baselines/reference/extendStringInterface.types +++ b/tests/baselines/reference/extendStringInterface.types @@ -15,6 +15,7 @@ interface String { var x = ''; >x : string +>'' : string var a: string = x.doStuff(); >a : string @@ -29,16 +30,20 @@ var b: string = x.doOtherStuff('hm'); >x.doOtherStuff : (x: T) => T >x : string >doOtherStuff : (x: T) => T +>'hm' : string var c: string = x['doStuff'](); >c : string >x['doStuff']() : string >x['doStuff'] : () => string >x : string +>'doStuff' : string var d: string = x['doOtherStuff']('hm'); >d : string >x['doOtherStuff']('hm') : string >x['doOtherStuff'] : (x: T) => T >x : string +>'doOtherStuff' : string +>'hm' : string diff --git a/tests/baselines/reference/extendedInterfaceGenericType.symbols b/tests/baselines/reference/extendedInterfaceGenericType.symbols new file mode 100644 index 00000000000..47e17b1e6a1 --- /dev/null +++ b/tests/baselines/reference/extendedInterfaceGenericType.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/extendedInterfaceGenericType.ts === +interface Alpha { +>Alpha : Symbol(Alpha, Decl(extendedInterfaceGenericType.ts, 0, 0)) +>T : Symbol(T, Decl(extendedInterfaceGenericType.ts, 0, 16)) + + takesArgOfT(arg: T): Alpha; +>takesArgOfT : Symbol(takesArgOfT, Decl(extendedInterfaceGenericType.ts, 0, 20)) +>arg : Symbol(arg, Decl(extendedInterfaceGenericType.ts, 1, 16)) +>T : Symbol(T, Decl(extendedInterfaceGenericType.ts, 0, 16)) +>Alpha : Symbol(Alpha, Decl(extendedInterfaceGenericType.ts, 0, 0)) +>T : Symbol(T, Decl(extendedInterfaceGenericType.ts, 0, 16)) + + makeBetaOfNumber(): Beta; +>makeBetaOfNumber : Symbol(makeBetaOfNumber, Decl(extendedInterfaceGenericType.ts, 1, 34)) +>Beta : Symbol(Beta, Decl(extendedInterfaceGenericType.ts, 3, 1)) +} +interface Beta extends Alpha { +>Beta : Symbol(Beta, Decl(extendedInterfaceGenericType.ts, 3, 1)) +>T : Symbol(T, Decl(extendedInterfaceGenericType.ts, 4, 15)) +>Alpha : Symbol(Alpha, Decl(extendedInterfaceGenericType.ts, 0, 0)) +>T : Symbol(T, Decl(extendedInterfaceGenericType.ts, 4, 15)) +} + +var alpha: Alpha; +>alpha : Symbol(alpha, Decl(extendedInterfaceGenericType.ts, 7, 3)) +>Alpha : Symbol(Alpha, Decl(extendedInterfaceGenericType.ts, 0, 0)) + +var betaOfNumber = alpha.makeBetaOfNumber(); +>betaOfNumber : Symbol(betaOfNumber, Decl(extendedInterfaceGenericType.ts, 8, 3)) +>alpha.makeBetaOfNumber : Symbol(Alpha.makeBetaOfNumber, Decl(extendedInterfaceGenericType.ts, 1, 34)) +>alpha : Symbol(alpha, Decl(extendedInterfaceGenericType.ts, 7, 3)) +>makeBetaOfNumber : Symbol(Alpha.makeBetaOfNumber, Decl(extendedInterfaceGenericType.ts, 1, 34)) + +betaOfNumber.takesArgOfT(5); +>betaOfNumber.takesArgOfT : Symbol(Alpha.takesArgOfT, Decl(extendedInterfaceGenericType.ts, 0, 20)) +>betaOfNumber : Symbol(betaOfNumber, Decl(extendedInterfaceGenericType.ts, 8, 3)) +>takesArgOfT : Symbol(Alpha.takesArgOfT, Decl(extendedInterfaceGenericType.ts, 0, 20)) + diff --git a/tests/baselines/reference/extendedInterfaceGenericType.types b/tests/baselines/reference/extendedInterfaceGenericType.types index 17fd949215a..a536ec75190 100644 --- a/tests/baselines/reference/extendedInterfaceGenericType.types +++ b/tests/baselines/reference/extendedInterfaceGenericType.types @@ -37,4 +37,5 @@ betaOfNumber.takesArgOfT(5); >betaOfNumber.takesArgOfT : (arg: number) => Alpha >betaOfNumber : Beta >takesArgOfT : (arg: number) => Alpha +>5 : number diff --git a/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.symbols b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.symbols new file mode 100644 index 00000000000..02d57509a55 --- /dev/null +++ b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.symbols @@ -0,0 +1,80 @@ +=== tests/cases/compiler/extendingClassFromAliasAndUsageInIndexer_main.ts === +import Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone"); +>Backbone : Symbol(Backbone, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 0, 0)) + +import moduleA = require("extendingClassFromAliasAndUsageInIndexer_moduleA"); +>moduleA : Symbol(moduleA, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 0, 79)) + +import moduleB = require("extendingClassFromAliasAndUsageInIndexer_moduleB"); +>moduleB : Symbol(moduleB, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 1, 77)) + +interface IHasVisualizationModel { +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 2, 77)) + + VisualizationModel: typeof Backbone.Model; +>VisualizationModel : Symbol(VisualizationModel, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 3, 34)) +>Backbone.Model : Symbol(Backbone.Model, Decl(extendingClassFromAliasAndUsageInIndexer_backbone.ts, 0, 0)) +>Backbone : Symbol(Backbone, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 0, 0)) +>Model : Symbol(Backbone.Model, Decl(extendingClassFromAliasAndUsageInIndexer_backbone.ts, 0, 0)) +} +var moduleATyped: IHasVisualizationModel = moduleA; +>moduleATyped : Symbol(moduleATyped, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 6, 3)) +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 2, 77)) +>moduleA : Symbol(moduleA, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 0, 79)) + +var moduleMap: { [key: string]: IHasVisualizationModel } = { +>moduleMap : Symbol(moduleMap, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 7, 3)) +>key : Symbol(key, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 7, 18)) +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 2, 77)) + + "moduleA": moduleA, +>moduleA : Symbol(moduleA, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 0, 79)) + + "moduleB": moduleB +>moduleB : Symbol(moduleB, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 1, 77)) + +}; +var moduleName: string; +>moduleName : Symbol(moduleName, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 11, 3)) + +var visModel = new moduleMap[moduleName].VisualizationModel(); +>visModel : Symbol(visModel, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 12, 3)) +>moduleMap[moduleName].VisualizationModel : Symbol(IHasVisualizationModel.VisualizationModel, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 3, 34)) +>moduleMap : Symbol(moduleMap, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 7, 3)) +>moduleName : Symbol(moduleName, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 11, 3)) +>VisualizationModel : Symbol(IHasVisualizationModel.VisualizationModel, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 3, 34)) + +=== tests/cases/compiler/extendingClassFromAliasAndUsageInIndexer_backbone.ts === +export class Model { +>Model : Symbol(Model, Decl(extendingClassFromAliasAndUsageInIndexer_backbone.ts, 0, 0)) + + public someData: string; +>someData : Symbol(someData, Decl(extendingClassFromAliasAndUsageInIndexer_backbone.ts, 0, 20)) +} + +=== tests/cases/compiler/extendingClassFromAliasAndUsageInIndexer_moduleA.ts === +import Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone"); +>Backbone : Symbol(Backbone, Decl(extendingClassFromAliasAndUsageInIndexer_moduleA.ts, 0, 0)) + +export class VisualizationModel extends Backbone.Model { +>VisualizationModel : Symbol(VisualizationModel, Decl(extendingClassFromAliasAndUsageInIndexer_moduleA.ts, 0, 79)) +>Backbone.Model : Symbol(Backbone.Model, Decl(extendingClassFromAliasAndUsageInIndexer_backbone.ts, 0, 0)) +>Backbone : Symbol(Backbone, Decl(extendingClassFromAliasAndUsageInIndexer_moduleA.ts, 0, 0)) +>Model : Symbol(Backbone.Model, Decl(extendingClassFromAliasAndUsageInIndexer_backbone.ts, 0, 0)) + + // interesting stuff here +} + +=== tests/cases/compiler/extendingClassFromAliasAndUsageInIndexer_moduleB.ts === +import Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone"); +>Backbone : Symbol(Backbone, Decl(extendingClassFromAliasAndUsageInIndexer_moduleB.ts, 0, 0)) + +export class VisualizationModel extends Backbone.Model { +>VisualizationModel : Symbol(VisualizationModel, Decl(extendingClassFromAliasAndUsageInIndexer_moduleB.ts, 0, 79)) +>Backbone.Model : Symbol(Backbone.Model, Decl(extendingClassFromAliasAndUsageInIndexer_backbone.ts, 0, 0)) +>Backbone : Symbol(Backbone, Decl(extendingClassFromAliasAndUsageInIndexer_moduleB.ts, 0, 0)) +>Model : Symbol(Backbone.Model, Decl(extendingClassFromAliasAndUsageInIndexer_backbone.ts, 0, 0)) + + // different interesting stuff here +} + diff --git a/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.types b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.types index 769f6f5a602..5b9154516c5 100644 --- a/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.types +++ b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.types @@ -13,6 +13,7 @@ interface IHasVisualizationModel { VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model +>Backbone.Model : typeof Backbone.Model >Backbone : typeof Backbone >Model : typeof Backbone.Model } @@ -60,6 +61,7 @@ import Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel +>Backbone.Model : any >Backbone : typeof Backbone >Model : Backbone.Model @@ -72,6 +74,7 @@ import Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel +>Backbone.Model : any >Backbone : typeof Backbone >Model : Backbone.Model diff --git a/tests/baselines/reference/externFunc.symbols b/tests/baselines/reference/externFunc.symbols new file mode 100644 index 00000000000..1a02596d7db --- /dev/null +++ b/tests/baselines/reference/externFunc.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/externFunc.ts === +declare function parseInt(s:string):number; +>parseInt : Symbol(parseInt, Decl(lib.d.ts, 28, 38), Decl(externFunc.ts, 0, 0)) +>s : Symbol(s, Decl(externFunc.ts, 0, 26)) + +parseInt("2"); +>parseInt : Symbol(parseInt, Decl(lib.d.ts, 28, 38), Decl(externFunc.ts, 0, 0)) + diff --git a/tests/baselines/reference/externFunc.types b/tests/baselines/reference/externFunc.types index 5aac52ac125..ab417859ea5 100644 --- a/tests/baselines/reference/externFunc.types +++ b/tests/baselines/reference/externFunc.types @@ -6,4 +6,5 @@ declare function parseInt(s:string):number; parseInt("2"); >parseInt("2") : number >parseInt : { (s: string, radix?: number): number; (s: string): number; } +>"2" : string diff --git a/tests/baselines/reference/externModuleClobber.symbols b/tests/baselines/reference/externModuleClobber.symbols new file mode 100644 index 00000000000..af4b19ad7c9 --- /dev/null +++ b/tests/baselines/reference/externModuleClobber.symbols @@ -0,0 +1,36 @@ +=== tests/cases/compiler/externModuleClobber.ts === +declare module EM { +>EM : Symbol(EM, Decl(externModuleClobber.ts, 0, 0)) + + export class Position { } +>Position : Symbol(Position, Decl(externModuleClobber.ts, 0, 19)) + + export class EC { +>EC : Symbol(EC, Decl(externModuleClobber.ts, 1, 26)) + + public getPosition() : EM.Position; +>getPosition : Symbol(getPosition, Decl(externModuleClobber.ts, 3, 18)) +>EM : Symbol(EM, Decl(externModuleClobber.ts, 0, 0)) +>Position : Symbol(Position, Decl(externModuleClobber.ts, 0, 19)) + } +} + +var x:EM.Position; +>x : Symbol(x, Decl(externModuleClobber.ts, 8, 3)) +>EM : Symbol(EM, Decl(externModuleClobber.ts, 0, 0)) +>Position : Symbol(EM.Position, Decl(externModuleClobber.ts, 0, 19)) + +var ec:EM.EC = new EM.EC(); +>ec : Symbol(ec, Decl(externModuleClobber.ts, 9, 3)) +>EM : Symbol(EM, Decl(externModuleClobber.ts, 0, 0)) +>EC : Symbol(EM.EC, Decl(externModuleClobber.ts, 1, 26)) +>EM.EC : Symbol(EM.EC, Decl(externModuleClobber.ts, 1, 26)) +>EM : Symbol(EM, Decl(externModuleClobber.ts, 0, 0)) +>EC : Symbol(EM.EC, Decl(externModuleClobber.ts, 1, 26)) + +x = ec.getPosition(); +>x : Symbol(x, Decl(externModuleClobber.ts, 8, 3)) +>ec.getPosition : Symbol(EM.EC.getPosition, Decl(externModuleClobber.ts, 3, 18)) +>ec : Symbol(ec, Decl(externModuleClobber.ts, 9, 3)) +>getPosition : Symbol(EM.EC.getPosition, Decl(externModuleClobber.ts, 3, 18)) + diff --git a/tests/baselines/reference/externModuleClobber.types b/tests/baselines/reference/externModuleClobber.types index d1a7ba32651..dae050aec40 100644 --- a/tests/baselines/reference/externModuleClobber.types +++ b/tests/baselines/reference/externModuleClobber.types @@ -10,19 +10,19 @@ declare module EM { public getPosition() : EM.Position; >getPosition : () => Position ->EM : unknown +>EM : any >Position : Position } } var x:EM.Position; >x : EM.Position ->EM : unknown +>EM : any >Position : EM.Position var ec:EM.EC = new EM.EC(); >ec : EM.EC ->EM : unknown +>EM : any >EC : EM.EC >new EM.EC() : EM.EC >EM.EC : typeof EM.EC diff --git a/tests/baselines/reference/externalModuleAssignToVar.symbols b/tests/baselines/reference/externalModuleAssignToVar.symbols new file mode 100644 index 00000000000..373dd3f793e --- /dev/null +++ b/tests/baselines/reference/externalModuleAssignToVar.symbols @@ -0,0 +1,61 @@ +=== tests/cases/compiler/externalModuleAssignToVar_core.ts === +/// +import ext = require('externalModuleAssignToVar_core_require'); +>ext : Symbol(ext, Decl(externalModuleAssignToVar_core.ts, 0, 0)) + +var y1: { C: new() => ext.C; } = ext; +>y1 : Symbol(y1, Decl(externalModuleAssignToVar_core.ts, 2, 3)) +>C : Symbol(C, Decl(externalModuleAssignToVar_core.ts, 2, 9)) +>ext : Symbol(ext, Decl(externalModuleAssignToVar_core.ts, 0, 0)) +>C : Symbol(ext.C, Decl(externalModuleAssignToVar_core_require.ts, 0, 0)) +>ext : Symbol(ext, Decl(externalModuleAssignToVar_core.ts, 0, 0)) + +y1 = ext; // ok +>y1 : Symbol(y1, Decl(externalModuleAssignToVar_core.ts, 2, 3)) +>ext : Symbol(ext, Decl(externalModuleAssignToVar_core.ts, 0, 0)) + +import ext2 = require('externalModuleAssignToVar_core_require2'); +>ext2 : Symbol(ext2, Decl(externalModuleAssignToVar_core.ts, 3, 9)) + +var y2: new() => ext2 = ext2; +>y2 : Symbol(y2, Decl(externalModuleAssignToVar_core.ts, 6, 3)) +>ext2 : Symbol(ext2, Decl(externalModuleAssignToVar_core.ts, 3, 9)) +>ext2 : Symbol(ext2, Decl(externalModuleAssignToVar_core.ts, 3, 9)) + +y2 = ext2; // ok +>y2 : Symbol(y2, Decl(externalModuleAssignToVar_core.ts, 6, 3)) +>ext2 : Symbol(ext2, Decl(externalModuleAssignToVar_core.ts, 3, 9)) + +import ext3 = require('externalModuleAssignToVar_ext'); +>ext3 : Symbol(ext3, Decl(externalModuleAssignToVar_core.ts, 7, 10)) + +var y3: new () => ext3 = ext3; +>y3 : Symbol(y3, Decl(externalModuleAssignToVar_core.ts, 10, 3)) +>ext3 : Symbol(ext3, Decl(externalModuleAssignToVar_core.ts, 7, 10)) +>ext3 : Symbol(ext3, Decl(externalModuleAssignToVar_core.ts, 7, 10)) + +y3 = ext3; // ok +>y3 : Symbol(y3, Decl(externalModuleAssignToVar_core.ts, 10, 3)) +>ext3 : Symbol(ext3, Decl(externalModuleAssignToVar_core.ts, 7, 10)) + +=== tests/cases/compiler/externalModuleAssignToVar_ext.ts === +class D { foo: string; } +>D : Symbol(D, Decl(externalModuleAssignToVar_ext.ts, 0, 0)) +>foo : Symbol(foo, Decl(externalModuleAssignToVar_ext.ts, 0, 9)) + +export = D; +>D : Symbol(D, Decl(externalModuleAssignToVar_ext.ts, 0, 0)) + +=== tests/cases/compiler/externalModuleAssignToVar_core_require.ts === +export class C { bar: string; } +>C : Symbol(C, Decl(externalModuleAssignToVar_core_require.ts, 0, 0)) +>bar : Symbol(bar, Decl(externalModuleAssignToVar_core_require.ts, 0, 16)) + +=== tests/cases/compiler/externalModuleAssignToVar_core_require2.ts === +class C { baz: string; } +>C : Symbol(C, Decl(externalModuleAssignToVar_core_require2.ts, 0, 0)) +>baz : Symbol(baz, Decl(externalModuleAssignToVar_core_require2.ts, 0, 9)) + +export = C; +>C : Symbol(C, Decl(externalModuleAssignToVar_core_require2.ts, 0, 0)) + diff --git a/tests/baselines/reference/externalModuleAssignToVar.types b/tests/baselines/reference/externalModuleAssignToVar.types index 8bcc6cdf3e6..c25e2d78460 100644 --- a/tests/baselines/reference/externalModuleAssignToVar.types +++ b/tests/baselines/reference/externalModuleAssignToVar.types @@ -6,7 +6,7 @@ import ext = require('externalModuleAssignToVar_core_require'); var y1: { C: new() => ext.C; } = ext; >y1 : { C: new () => ext.C; } >C : new () => ext.C ->ext : unknown +>ext : any >C : ext.C >ext : typeof ext diff --git a/tests/baselines/reference/externalModuleQualification.symbols b/tests/baselines/reference/externalModuleQualification.symbols new file mode 100644 index 00000000000..dc056802c76 --- /dev/null +++ b/tests/baselines/reference/externalModuleQualification.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/externalModuleQualification.ts === +export var ID = "test"; +>ID : Symbol(ID, Decl(externalModuleQualification.ts, 0, 10)) + +export class DiffEditor { +>DiffEditor : Symbol(DiffEditor, Decl(externalModuleQualification.ts, 0, 23)) +>A : Symbol(A, Decl(externalModuleQualification.ts, 1, 24)) +>B : Symbol(B, Decl(externalModuleQualification.ts, 1, 26)) +>C : Symbol(C, Decl(externalModuleQualification.ts, 1, 29)) + + private previousDiffAction: NavigateAction; +>previousDiffAction : Symbol(previousDiffAction, Decl(externalModuleQualification.ts, 1, 34)) +>NavigateAction : Symbol(NavigateAction, Decl(externalModuleQualification.ts, 5, 1)) + + constructor(id: string = ID) { +>id : Symbol(id, Decl(externalModuleQualification.ts, 3, 16)) +>ID : Symbol(ID, Decl(externalModuleQualification.ts, 0, 10)) + } +} +class NavigateAction { +>NavigateAction : Symbol(NavigateAction, Decl(externalModuleQualification.ts, 5, 1)) + + f(editor: DiffEditor) { +>f : Symbol(f, Decl(externalModuleQualification.ts, 6, 22)) +>editor : Symbol(editor, Decl(externalModuleQualification.ts, 7, 6)) +>DiffEditor : Symbol(DiffEditor, Decl(externalModuleQualification.ts, 0, 23)) + } +} + diff --git a/tests/baselines/reference/externalModuleQualification.types b/tests/baselines/reference/externalModuleQualification.types index ba8fc516fb8..a7b70697209 100644 --- a/tests/baselines/reference/externalModuleQualification.types +++ b/tests/baselines/reference/externalModuleQualification.types @@ -1,6 +1,7 @@ === tests/cases/compiler/externalModuleQualification.ts === export var ID = "test"; >ID : string +>"test" : string export class DiffEditor { >DiffEditor : DiffEditor diff --git a/tests/baselines/reference/externalModuleReferenceDoubleUnderscore1.symbols b/tests/baselines/reference/externalModuleReferenceDoubleUnderscore1.symbols new file mode 100644 index 00000000000..02e5e6cfc5a --- /dev/null +++ b/tests/baselines/reference/externalModuleReferenceDoubleUnderscore1.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/externalModuleReferenceDoubleUnderscore1.ts === +declare module 'timezonecomplete' { + import basics = require("__timezonecomplete/basics"); +>basics : Symbol(basics, Decl(externalModuleReferenceDoubleUnderscore1.ts, 0, 35)) + + export import TimeUnit = basics.TimeUnit; +>TimeUnit : Symbol(TimeUnit, Decl(externalModuleReferenceDoubleUnderscore1.ts, 1, 57)) +>basics : Symbol(basics, Decl(externalModuleReferenceDoubleUnderscore1.ts, 3, 1)) +>TimeUnit : Symbol(basics.TimeUnit, Decl(externalModuleReferenceDoubleUnderscore1.ts, 5, 44)) +} + +declare module '__timezonecomplete/basics' { + export enum TimeUnit { +>TimeUnit : Symbol(TimeUnit, Decl(externalModuleReferenceDoubleUnderscore1.ts, 5, 44)) + + Second = 0, +>Second : Symbol(TimeUnit.Second, Decl(externalModuleReferenceDoubleUnderscore1.ts, 6, 26)) + + Minute = 1, +>Minute : Symbol(TimeUnit.Minute, Decl(externalModuleReferenceDoubleUnderscore1.ts, 7, 19)) + + Hour = 2, +>Hour : Symbol(TimeUnit.Hour, Decl(externalModuleReferenceDoubleUnderscore1.ts, 8, 19)) + + Day = 3, +>Day : Symbol(TimeUnit.Day, Decl(externalModuleReferenceDoubleUnderscore1.ts, 9, 17)) + + Week = 4, +>Week : Symbol(TimeUnit.Week, Decl(externalModuleReferenceDoubleUnderscore1.ts, 10, 16)) + + Month = 5, +>Month : Symbol(TimeUnit.Month, Decl(externalModuleReferenceDoubleUnderscore1.ts, 11, 17)) + + Year = 6, +>Year : Symbol(TimeUnit.Year, Decl(externalModuleReferenceDoubleUnderscore1.ts, 12, 18)) + } +} diff --git a/tests/baselines/reference/externalModuleReferenceDoubleUnderscore1.types b/tests/baselines/reference/externalModuleReferenceDoubleUnderscore1.types index e255e64d467..8d2c9b65991 100644 --- a/tests/baselines/reference/externalModuleReferenceDoubleUnderscore1.types +++ b/tests/baselines/reference/externalModuleReferenceDoubleUnderscore1.types @@ -15,23 +15,30 @@ declare module '__timezonecomplete/basics' { Second = 0, >Second : TimeUnit +>0 : number Minute = 1, >Minute : TimeUnit +>1 : number Hour = 2, >Hour : TimeUnit +>2 : number Day = 3, >Day : TimeUnit +>3 : number Week = 4, >Week : TimeUnit +>4 : number Month = 5, >Month : TimeUnit +>5 : number Year = 6, >Year : TimeUnit +>6 : number } } diff --git a/tests/baselines/reference/externalModuleReferenceOfImportDeclarationWithExportModifier.symbols b/tests/baselines/reference/externalModuleReferenceOfImportDeclarationWithExportModifier.symbols new file mode 100644 index 00000000000..f81febef320 --- /dev/null +++ b/tests/baselines/reference/externalModuleReferenceOfImportDeclarationWithExportModifier.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/externalModuleReferenceOfImportDeclarationWithExportModifier_1.ts === +export import file1 = require('externalModuleReferenceOfImportDeclarationWithExportModifier_0'); +>file1 : Symbol(file1, Decl(externalModuleReferenceOfImportDeclarationWithExportModifier_1.ts, 0, 0)) + +file1.foo(); +>file1.foo : Symbol(file1.foo, Decl(externalModuleReferenceOfImportDeclarationWithExportModifier_0.ts, 0, 0)) +>file1 : Symbol(file1, Decl(externalModuleReferenceOfImportDeclarationWithExportModifier_1.ts, 0, 0)) +>foo : Symbol(file1.foo, Decl(externalModuleReferenceOfImportDeclarationWithExportModifier_0.ts, 0, 0)) + +=== tests/cases/compiler/externalModuleReferenceOfImportDeclarationWithExportModifier_0.ts === +export function foo() { }; +>foo : Symbol(foo, Decl(externalModuleReferenceOfImportDeclarationWithExportModifier_0.ts, 0, 0)) + diff --git a/tests/baselines/reference/externalModuleResolution.symbols b/tests/baselines/reference/externalModuleResolution.symbols new file mode 100644 index 00000000000..d23b57e5061 --- /dev/null +++ b/tests/baselines/reference/externalModuleResolution.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/consumer.ts === +import x = require('./foo'); +>x : Symbol(x, Decl(consumer.ts, 0, 0)) + +x.Y // .ts should be picked +>x.Y : Symbol(x.Y, Decl(foo.ts, 1, 14)) +>x : Symbol(x, Decl(consumer.ts, 0, 0)) +>Y : Symbol(x.Y, Decl(foo.ts, 1, 14)) + +=== tests/cases/compiler/foo.ts === +module M2 { +>M2 : Symbol(M2, Decl(foo.ts, 0, 0)) + + export var Y = 1; +>Y : Symbol(Y, Decl(foo.ts, 1, 14)) +} +export = M2 +>M2 : Symbol(M2, Decl(foo.ts, 0, 0)) + diff --git a/tests/baselines/reference/externalModuleResolution.types b/tests/baselines/reference/externalModuleResolution.types index 929695b2203..45e2aef6883 100644 --- a/tests/baselines/reference/externalModuleResolution.types +++ b/tests/baselines/reference/externalModuleResolution.types @@ -13,6 +13,7 @@ module M2 { export var Y = 1; >Y : number +>1 : number } export = M2 >M2 : typeof M2 diff --git a/tests/baselines/reference/externalModuleResolution2.symbols b/tests/baselines/reference/externalModuleResolution2.symbols new file mode 100644 index 00000000000..f77a676ac6a --- /dev/null +++ b/tests/baselines/reference/externalModuleResolution2.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/consumer.ts === +import x = require('./foo'); +>x : Symbol(x, Decl(consumer.ts, 0, 0)) + +x.X // .ts should be picked +>x.X : Symbol(x.X, Decl(foo.ts, 1, 14)) +>x : Symbol(x, Decl(consumer.ts, 0, 0)) +>X : Symbol(x.X, Decl(foo.ts, 1, 14)) + +=== tests/cases/compiler/foo.ts === +module M2 { +>M2 : Symbol(M2, Decl(foo.ts, 0, 0)) + + export var X = 1; +>X : Symbol(X, Decl(foo.ts, 1, 14)) +} +export = M2 +>M2 : Symbol(M2, Decl(foo.ts, 0, 0)) + diff --git a/tests/baselines/reference/externalModuleResolution2.types b/tests/baselines/reference/externalModuleResolution2.types index 09b33fb2bee..9f48b8b38f1 100644 --- a/tests/baselines/reference/externalModuleResolution2.types +++ b/tests/baselines/reference/externalModuleResolution2.types @@ -13,6 +13,7 @@ module M2 { export var X = 1; >X : number +>1 : number } export = M2 >M2 : typeof M2 diff --git a/tests/baselines/reference/fatArrowSelf.symbols b/tests/baselines/reference/fatArrowSelf.symbols new file mode 100644 index 00000000000..4008b648ae6 --- /dev/null +++ b/tests/baselines/reference/fatArrowSelf.symbols @@ -0,0 +1,57 @@ +=== tests/cases/compiler/fatArrowSelf.ts === +module Events { +>Events : Symbol(Events, Decl(fatArrowSelf.ts, 0, 0)) + + export interface ListenerCallback { +>ListenerCallback : Symbol(ListenerCallback, Decl(fatArrowSelf.ts, 0, 15)) + + (value:any):void; +>value : Symbol(value, Decl(fatArrowSelf.ts, 2, 9)) + } + export class EventEmitter { +>EventEmitter : Symbol(EventEmitter, Decl(fatArrowSelf.ts, 3, 5)) + + public addListener(type:string, listener:ListenerCallback) { +>addListener : Symbol(addListener, Decl(fatArrowSelf.ts, 4, 31)) +>type : Symbol(type, Decl(fatArrowSelf.ts, 5, 28)) +>listener : Symbol(listener, Decl(fatArrowSelf.ts, 5, 40)) +>ListenerCallback : Symbol(ListenerCallback, Decl(fatArrowSelf.ts, 0, 15)) + } + } +} + +module Consumer { +>Consumer : Symbol(Consumer, Decl(fatArrowSelf.ts, 8, 1)) + + class EventEmitterConsummer { +>EventEmitterConsummer : Symbol(EventEmitterConsummer, Decl(fatArrowSelf.ts, 10, 17)) + + constructor (private emitter: Events.EventEmitter) { } +>emitter : Symbol(emitter, Decl(fatArrowSelf.ts, 12, 21)) +>Events : Symbol(Events, Decl(fatArrowSelf.ts, 0, 0)) +>EventEmitter : Symbol(Events.EventEmitter, Decl(fatArrowSelf.ts, 3, 5)) + + private register() { +>register : Symbol(register, Decl(fatArrowSelf.ts, 12, 62)) + + this.emitter.addListener('change', (e) => { +>this.emitter.addListener : Symbol(Events.EventEmitter.addListener, Decl(fatArrowSelf.ts, 4, 31)) +>this.emitter : Symbol(emitter, Decl(fatArrowSelf.ts, 12, 21)) +>this : Symbol(EventEmitterConsummer, Decl(fatArrowSelf.ts, 10, 17)) +>emitter : Symbol(emitter, Decl(fatArrowSelf.ts, 12, 21)) +>addListener : Symbol(Events.EventEmitter.addListener, Decl(fatArrowSelf.ts, 4, 31)) +>e : Symbol(e, Decl(fatArrowSelf.ts, 15, 48)) + + this.changed(); +>this.changed : Symbol(changed, Decl(fatArrowSelf.ts, 18, 9)) +>this : Symbol(EventEmitterConsummer, Decl(fatArrowSelf.ts, 10, 17)) +>changed : Symbol(changed, Decl(fatArrowSelf.ts, 18, 9)) + + }); + } + + private changed() { +>changed : Symbol(changed, Decl(fatArrowSelf.ts, 18, 9)) + } + } +} diff --git a/tests/baselines/reference/fatArrowSelf.types b/tests/baselines/reference/fatArrowSelf.types index 912e0cd78a7..c4b2936fd37 100644 --- a/tests/baselines/reference/fatArrowSelf.types +++ b/tests/baselines/reference/fatArrowSelf.types @@ -28,7 +28,7 @@ module Consumer { constructor (private emitter: Events.EventEmitter) { } >emitter : Events.EventEmitter ->Events : unknown +>Events : any >EventEmitter : Events.EventEmitter private register() { @@ -41,6 +41,7 @@ module Consumer { >this : EventEmitterConsummer >emitter : Events.EventEmitter >addListener : (type: string, listener: Events.ListenerCallback) => void +>'change' : string >(e) => { this.changed(); } : (e: any) => void >e : any diff --git a/tests/baselines/reference/fatArrowfunctionAsType.symbols b/tests/baselines/reference/fatArrowfunctionAsType.symbols new file mode 100644 index 00000000000..9764149bade --- /dev/null +++ b/tests/baselines/reference/fatArrowfunctionAsType.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/fatArrowfunctionAsType.ts === +declare var b: (x: T) => void ; +>b : Symbol(b, Decl(fatArrowfunctionAsType.ts, 0, 11)) +>T : Symbol(T, Decl(fatArrowfunctionAsType.ts, 0, 16)) +>x : Symbol(x, Decl(fatArrowfunctionAsType.ts, 0, 19)) +>T : Symbol(T, Decl(fatArrowfunctionAsType.ts, 0, 16)) + +var c: (x: T) => void = function (x: T) { return 42; } +>c : Symbol(c, Decl(fatArrowfunctionAsType.ts, 2, 3)) +>T : Symbol(T, Decl(fatArrowfunctionAsType.ts, 2, 8)) +>x : Symbol(x, Decl(fatArrowfunctionAsType.ts, 2, 11)) +>T : Symbol(T, Decl(fatArrowfunctionAsType.ts, 2, 8)) +>T : Symbol(T, Decl(fatArrowfunctionAsType.ts, 2, 37)) +>x : Symbol(x, Decl(fatArrowfunctionAsType.ts, 2, 40)) +>T : Symbol(T, Decl(fatArrowfunctionAsType.ts, 2, 37)) + +b = c; +>b : Symbol(b, Decl(fatArrowfunctionAsType.ts, 0, 11)) +>c : Symbol(c, Decl(fatArrowfunctionAsType.ts, 2, 3)) + diff --git a/tests/baselines/reference/fatArrowfunctionAsType.types b/tests/baselines/reference/fatArrowfunctionAsType.types index 31f8c128611..a165048695f 100644 --- a/tests/baselines/reference/fatArrowfunctionAsType.types +++ b/tests/baselines/reference/fatArrowfunctionAsType.types @@ -14,6 +14,7 @@ var c: (x: T) => void = function (x: T) { return 42; } >T : T >x : T >T : T +>42 : number b = c; >b = c : (x: T) => void diff --git a/tests/baselines/reference/fatarrowfunctions.symbols b/tests/baselines/reference/fatarrowfunctions.symbols new file mode 100644 index 00000000000..6ed865b0914 --- /dev/null +++ b/tests/baselines/reference/fatarrowfunctions.symbols @@ -0,0 +1,168 @@ +=== tests/cases/compiler/fatarrowfunctions.ts === + +function foo(x:any) { +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 1, 13)) + + return x(); +>x : Symbol(x, Decl(fatarrowfunctions.ts, 1, 13)) +} + + +foo((x:number,y,z)=>{return x+y+z;}); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 6, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 6, 14)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 6, 16)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 6, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 6, 14)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 6, 16)) + +foo((x,y,z)=>{return x+y+z;}); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 7, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 7, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 7, 9)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 7, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 7, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 7, 9)) + +foo((x,y:number,z)=>{return x+y+z;}); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 8, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 8, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 8, 16)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 8, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 8, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 8, 16)) + +foo((x,y:number,z:number)=>{return x+y+z;}); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 9, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 9, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 9, 16)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 9, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 9, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 9, 16)) + +foo((x,y,z:number)=>{return x+y+z;}); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 10, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 10, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 10, 9)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 10, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 10, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 10, 9)) + +foo(()=>{return 0;}); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) + +foo((x:number,y,z)=>x+y+z); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 13, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 13, 14)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 13, 16)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 13, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 13, 14)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 13, 16)) + +foo((x,y,z)=>x+y+z); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 14, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 14, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 14, 9)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 14, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 14, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 14, 9)) + +foo((x,y:number,z)=>{return x+y+z;}); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 15, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 15, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 15, 16)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 15, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 15, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 15, 16)) + +foo((x,y:number,z:number)=>{return x+y+z;}); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 16, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 16, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 16, 16)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 16, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 16, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 16, 16)) + +foo((x,y,z:number)=>{return x+y+z;}); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 17, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 17, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 17, 9)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 17, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 17, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 17, 9)) + +foo(()=>{return 0;}); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) + + +foo(((x) => x)); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 21, 6)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 21, 6)) + +foo(x => x*x); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 23, 4)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 23, 4)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 23, 4)) + +var y = x => x*x; +>y : Symbol(y, Decl(fatarrowfunctions.ts, 25, 3)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 25, 7)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 25, 7)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 25, 7)) + +var z = (x:number) => x*x; +>z : Symbol(z, Decl(fatarrowfunctions.ts, 26, 3)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 26, 9)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 26, 9)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 26, 9)) + +var w = () => 3; +>w : Symbol(w, Decl(fatarrowfunctions.ts, 28, 3)) + +function ternaryTest(isWhile:boolean) { +>ternaryTest : Symbol(ternaryTest, Decl(fatarrowfunctions.ts, 28, 16)) +>isWhile : Symbol(isWhile, Decl(fatarrowfunctions.ts, 30, 21)) + + var f = isWhile ? function (n) { return n > 0; } : function (n) { return n === 0; }; +>f : Symbol(f, Decl(fatarrowfunctions.ts, 32, 19)) +>isWhile : Symbol(isWhile, Decl(fatarrowfunctions.ts, 30, 21)) +>n : Symbol(n, Decl(fatarrowfunctions.ts, 32, 44)) +>n : Symbol(n, Decl(fatarrowfunctions.ts, 32, 44)) +>n : Symbol(n, Decl(fatarrowfunctions.ts, 32, 77)) +>n : Symbol(n, Decl(fatarrowfunctions.ts, 32, 77)) + +} + +declare function setTimeout(expression: any, msec?: number, language?: any): number; +>setTimeout : Symbol(setTimeout, Decl(fatarrowfunctions.ts, 34, 1)) +>expression : Symbol(expression, Decl(fatarrowfunctions.ts, 36, 28)) +>msec : Symbol(msec, Decl(fatarrowfunctions.ts, 36, 44)) +>language : Symbol(language, Decl(fatarrowfunctions.ts, 36, 59)) + +var messenger = { +>messenger : Symbol(messenger, Decl(fatarrowfunctions.ts, 38, 3)) + + message: "Hello World", +>message : Symbol(message, Decl(fatarrowfunctions.ts, 38, 17)) + + start: function() { +>start : Symbol(start, Decl(fatarrowfunctions.ts, 39, 27)) + + setTimeout(() => { this.message.toString(); }, 3000); +>setTimeout : Symbol(setTimeout, Decl(fatarrowfunctions.ts, 34, 1)) + } +}; + diff --git a/tests/baselines/reference/fatarrowfunctions.types b/tests/baselines/reference/fatarrowfunctions.types index 1b819b8496a..e48b63e50ee 100644 --- a/tests/baselines/reference/fatarrowfunctions.types +++ b/tests/baselines/reference/fatarrowfunctions.types @@ -79,6 +79,7 @@ foo(()=>{return 0;}); >foo(()=>{return 0;}) : any >foo : (x: any) => any >()=>{return 0;} : () => number +>0 : number foo((x:number,y,z)=>x+y+z); >foo((x:number,y,z)=>x+y+z) : any @@ -149,6 +150,7 @@ foo(()=>{return 0;}); >foo(()=>{return 0;}) : any >foo : (x: any) => any >()=>{return 0;} : () => number +>0 : number foo(((x) => x)); @@ -187,6 +189,7 @@ var z = (x:number) => x*x; var w = () => 3; >w : () => number >() => 3 : () => number +>3 : number function ternaryTest(isWhile:boolean) { >ternaryTest : (isWhile: boolean) => void @@ -200,10 +203,12 @@ function ternaryTest(isWhile:boolean) { >n : any >n > 0 : boolean >n : any +>0 : number >function (n) { return n === 0; } : (n: any) => boolean >n : any >n === 0 : boolean >n : any +>0 : number } @@ -219,6 +224,7 @@ var messenger = { message: "Hello World", >message : string +>"Hello World" : string start: function() { >start : () => void @@ -234,6 +240,7 @@ var messenger = { >this : any >message : any >toString : any +>3000 : number } }; diff --git a/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.symbols b/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.symbols new file mode 100644 index 00000000000..731e8558bab --- /dev/null +++ b/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/fatarrowfunctionsInFunctionParameterDefaults.ts === +function fn(x = () => this, y = x()) { +>fn : Symbol(fn, Decl(fatarrowfunctionsInFunctionParameterDefaults.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctionsInFunctionParameterDefaults.ts, 0, 12)) +>y : Symbol(y, Decl(fatarrowfunctionsInFunctionParameterDefaults.ts, 0, 27)) +>x : Symbol(x, Decl(fatarrowfunctionsInFunctionParameterDefaults.ts, 0, 12)) + + // should be 4 + return y; +>y : Symbol(y, Decl(fatarrowfunctionsInFunctionParameterDefaults.ts, 0, 27)) + +} + +fn.call(4); // Should be 4 +>fn.call : Symbol(Function.call, Decl(lib.d.ts, 234, 45)) +>fn : Symbol(fn, Decl(fatarrowfunctionsInFunctionParameterDefaults.ts, 0, 0)) +>call : Symbol(Function.call, Decl(lib.d.ts, 234, 45)) + diff --git a/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.types b/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.types index cf561eb08af..55d72e854d3 100644 --- a/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.types +++ b/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.types @@ -19,4 +19,5 @@ fn.call(4); // Should be 4 >fn.call : (thisArg: any, ...argArray: any[]) => any >fn : (x?: () => any, y?: any) => any >call : (thisArg: any, ...argArray: any[]) => any +>4 : number diff --git a/tests/baselines/reference/fatarrowfunctionsInFunctions.symbols b/tests/baselines/reference/fatarrowfunctionsInFunctions.symbols new file mode 100644 index 00000000000..0a86affc215 --- /dev/null +++ b/tests/baselines/reference/fatarrowfunctionsInFunctions.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/fatarrowfunctionsInFunctions.ts === +declare function setTimeout(expression: any, msec?: number, language?: any): number; +>setTimeout : Symbol(setTimeout, Decl(fatarrowfunctionsInFunctions.ts, 0, 0)) +>expression : Symbol(expression, Decl(fatarrowfunctionsInFunctions.ts, 0, 28)) +>msec : Symbol(msec, Decl(fatarrowfunctionsInFunctions.ts, 0, 44)) +>language : Symbol(language, Decl(fatarrowfunctionsInFunctions.ts, 0, 59)) + +var messenger = { +>messenger : Symbol(messenger, Decl(fatarrowfunctionsInFunctions.ts, 2, 3)) + + message: "Hello World", +>message : Symbol(message, Decl(fatarrowfunctionsInFunctions.ts, 2, 17)) + + start: function() { +>start : Symbol(start, Decl(fatarrowfunctionsInFunctions.ts, 3, 27)) + + var _self = this; +>_self : Symbol(_self, Decl(fatarrowfunctionsInFunctions.ts, 5, 11)) + + setTimeout(function() { +>setTimeout : Symbol(setTimeout, Decl(fatarrowfunctionsInFunctions.ts, 0, 0)) + + _self.message.toString(); +>_self : Symbol(_self, Decl(fatarrowfunctionsInFunctions.ts, 5, 11)) + + }, 3000); + } +}; +messenger.start(); +>messenger.start : Symbol(start, Decl(fatarrowfunctionsInFunctions.ts, 3, 27)) +>messenger : Symbol(messenger, Decl(fatarrowfunctionsInFunctions.ts, 2, 3)) +>start : Symbol(start, Decl(fatarrowfunctionsInFunctions.ts, 3, 27)) + diff --git a/tests/baselines/reference/fatarrowfunctionsInFunctions.types b/tests/baselines/reference/fatarrowfunctionsInFunctions.types index a8633eb1a8c..00abaec9f25 100644 --- a/tests/baselines/reference/fatarrowfunctionsInFunctions.types +++ b/tests/baselines/reference/fatarrowfunctionsInFunctions.types @@ -11,6 +11,7 @@ var messenger = { message: "Hello World", >message : string +>"Hello World" : string start: function() { >start : () => void @@ -34,6 +35,7 @@ var messenger = { >toString : any }, 3000); +>3000 : number } }; messenger.start(); diff --git a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors1.js b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors1.js index 428a085ca56..e746b24a066 100644 --- a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors1.js +++ b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors1.js @@ -24,7 +24,6 @@ return 103; }); (function () { - if (arg === void 0) { arg = []; } var arg = []; for (var _i = 0; _i < arguments.length; _i++) { arg[_i - 0] = arguments[_i]; diff --git a/tests/baselines/reference/fileReferencesWithNoExtensions.symbols b/tests/baselines/reference/fileReferencesWithNoExtensions.symbols new file mode 100644 index 00000000000..cbf2b27882c --- /dev/null +++ b/tests/baselines/reference/fileReferencesWithNoExtensions.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/t.ts === +/// +/// +/// +var a = aa; // Check that a.ts is referenced +>a : Symbol(a, Decl(t.ts, 3, 3)) +>aa : Symbol(aa, Decl(a.ts, 0, 3)) + +var b = bb; // Check that b.d.ts is referenced +>b : Symbol(b, Decl(t.ts, 4, 3)) +>bb : Symbol(bb, Decl(b.d.ts, 0, 11)) + +var c = cc; // Check that c.ts has precedence over c.d.ts +>c : Symbol(c, Decl(t.ts, 5, 3)) +>cc : Symbol(cc, Decl(c.ts, 0, 3)) + +=== tests/cases/compiler/a.ts === +var aa = 1; +>aa : Symbol(aa, Decl(a.ts, 0, 3)) + +=== tests/cases/compiler/b.d.ts === +declare var bb: number; +>bb : Symbol(bb, Decl(b.d.ts, 0, 11)) + +=== tests/cases/compiler/c.ts === +var cc = 1; +>cc : Symbol(cc, Decl(c.ts, 0, 3)) + +=== tests/cases/compiler/c.d.ts === +declare var xx: number; +>xx : Symbol(xx, Decl(c.d.ts, 0, 11)) + diff --git a/tests/baselines/reference/fileReferencesWithNoExtensions.types b/tests/baselines/reference/fileReferencesWithNoExtensions.types index ec58e338345..7b56dbe0d20 100644 --- a/tests/baselines/reference/fileReferencesWithNoExtensions.types +++ b/tests/baselines/reference/fileReferencesWithNoExtensions.types @@ -17,6 +17,7 @@ var c = cc; // Check that c.ts has precedence over c.d.ts === tests/cases/compiler/a.ts === var aa = 1; >aa : number +>1 : number === tests/cases/compiler/b.d.ts === declare var bb: number; @@ -25,6 +26,7 @@ declare var bb: number; === tests/cases/compiler/c.ts === var cc = 1; >cc : number +>1 : number === tests/cases/compiler/c.d.ts === declare var xx: number; diff --git a/tests/baselines/reference/fileWithNextLine1.symbols b/tests/baselines/reference/fileWithNextLine1.symbols new file mode 100644 index 00000000000..07a8779a486 --- /dev/null +++ b/tests/baselines/reference/fileWithNextLine1.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/fileWithNextLine1.ts === +// Note: there is a nextline (0x85) in the string +// 0. It should be counted as a space and should not cause an error. +var v = '…'; +>v : Symbol(v, Decl(fileWithNextLine1.ts, 2, 3)) + diff --git a/tests/baselines/reference/fileWithNextLine1.types b/tests/baselines/reference/fileWithNextLine1.types index 721b3d6fb10..2afb1f2ae37 100644 --- a/tests/baselines/reference/fileWithNextLine1.types +++ b/tests/baselines/reference/fileWithNextLine1.types @@ -3,4 +3,5 @@ // 0. It should be counted as a space and should not cause an error. var v = '…'; >v : string +>'…' : string diff --git a/tests/baselines/reference/fileWithNextLine2.symbols b/tests/baselines/reference/fileWithNextLine2.symbols new file mode 100644 index 00000000000..a9c6d65a9cb --- /dev/null +++ b/tests/baselines/reference/fileWithNextLine2.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/fileWithNextLine2.ts === +// Note: there is a nextline (0x85) char between the = and the 0. +// it should be treated like a space +var v =…0; +>v : Symbol(v, Decl(fileWithNextLine2.ts, 2, 3)) + diff --git a/tests/baselines/reference/fileWithNextLine2.types b/tests/baselines/reference/fileWithNextLine2.types index 8a6de1a4b2f..c3e1fd642cf 100644 --- a/tests/baselines/reference/fileWithNextLine2.types +++ b/tests/baselines/reference/fileWithNextLine2.types @@ -3,4 +3,5 @@ // it should be treated like a space var v =…0; >v : number +>0 : number diff --git a/tests/baselines/reference/fillInMissingTypeArgsOnConstructCalls.symbols b/tests/baselines/reference/fillInMissingTypeArgsOnConstructCalls.symbols new file mode 100644 index 00000000000..eff8999a0f7 --- /dev/null +++ b/tests/baselines/reference/fillInMissingTypeArgsOnConstructCalls.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/fillInMissingTypeArgsOnConstructCalls.ts === +class A{ +>A : Symbol(A, Decl(fillInMissingTypeArgsOnConstructCalls.ts, 0, 0)) +>T : Symbol(T, Decl(fillInMissingTypeArgsOnConstructCalls.ts, 0, 8)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + list: T ; +>list : Symbol(list, Decl(fillInMissingTypeArgsOnConstructCalls.ts, 0, 26)) +>T : Symbol(T, Decl(fillInMissingTypeArgsOnConstructCalls.ts, 0, 8)) +} +var a = new A(); +>a : Symbol(a, Decl(fillInMissingTypeArgsOnConstructCalls.ts, 3, 3)) +>A : Symbol(A, Decl(fillInMissingTypeArgsOnConstructCalls.ts, 0, 0)) + diff --git a/tests/baselines/reference/for-of1.symbols b/tests/baselines/reference/for-of1.symbols new file mode 100644 index 00000000000..05ce10d440b --- /dev/null +++ b/tests/baselines/reference/for-of1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of1.ts === +var v; +>v : Symbol(v, Decl(for-of1.ts, 0, 3)) + +for (v of []) { } +>v : Symbol(v, Decl(for-of1.ts, 0, 3)) + diff --git a/tests/baselines/reference/for-of13.symbols b/tests/baselines/reference/for-of13.symbols new file mode 100644 index 00000000000..c9d3c4d254c --- /dev/null +++ b/tests/baselines/reference/for-of13.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of13.ts === +var v: string; +>v : Symbol(v, Decl(for-of13.ts, 0, 3)) + +for (v of [""].values()) { } +>v : Symbol(v, Decl(for-of13.ts, 0, 3)) +>[""].values : Symbol(Array.values, Decl(lib.d.ts, 1423, 37)) +>values : Symbol(Array.values, Decl(lib.d.ts, 1423, 37)) + diff --git a/tests/baselines/reference/for-of13.types b/tests/baselines/reference/for-of13.types index 4bb29c1e0ab..e176b1bbf0c 100644 --- a/tests/baselines/reference/for-of13.types +++ b/tests/baselines/reference/for-of13.types @@ -7,5 +7,6 @@ for (v of [""].values()) { } >[""].values() : IterableIterator >[""].values : () => IterableIterator >[""] : string[] +>"" : string >values : () => IterableIterator diff --git a/tests/baselines/reference/for-of18.symbols b/tests/baselines/reference/for-of18.symbols new file mode 100644 index 00000000000..180766144c8 --- /dev/null +++ b/tests/baselines/reference/for-of18.symbols @@ -0,0 +1,32 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of18.ts === +var v: string; +>v : Symbol(v, Decl(for-of18.ts, 0, 3)) + +for (v of new StringIterator) { } // Should succeed +>v : Symbol(v, Decl(for-of18.ts, 0, 3)) +>StringIterator : Symbol(StringIterator, Decl(for-of18.ts, 1, 33)) + +class StringIterator { +>StringIterator : Symbol(StringIterator, Decl(for-of18.ts, 1, 33)) + + next() { +>next : Symbol(next, Decl(for-of18.ts, 3, 22)) + + return { + value: "", +>value : Symbol(value, Decl(for-of18.ts, 5, 16)) + + done: false +>done : Symbol(done, Decl(for-of18.ts, 6, 22)) + + }; + } + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(StringIterator, Decl(for-of18.ts, 1, 33)) + } +} diff --git a/tests/baselines/reference/for-of18.types b/tests/baselines/reference/for-of18.types index 9ade9359475..5b2be7edc3e 100644 --- a/tests/baselines/reference/for-of18.types +++ b/tests/baselines/reference/for-of18.types @@ -18,9 +18,11 @@ class StringIterator { value: "", >value : string +>"" : string done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/for-of19.symbols b/tests/baselines/reference/for-of19.symbols new file mode 100644 index 00000000000..5dd58d671a7 --- /dev/null +++ b/tests/baselines/reference/for-of19.symbols @@ -0,0 +1,37 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of19.ts === +for (var v of new FooIterator) { +>v : Symbol(v, Decl(for-of19.ts, 0, 8)) +>FooIterator : Symbol(FooIterator, Decl(for-of19.ts, 4, 13)) + + v; +>v : Symbol(v, Decl(for-of19.ts, 0, 8)) +} + +class Foo { } +>Foo : Symbol(Foo, Decl(for-of19.ts, 2, 1)) + +class FooIterator { +>FooIterator : Symbol(FooIterator, Decl(for-of19.ts, 4, 13)) + + next() { +>next : Symbol(next, Decl(for-of19.ts, 5, 19)) + + return { + value: new Foo, +>value : Symbol(value, Decl(for-of19.ts, 7, 16)) +>Foo : Symbol(Foo, Decl(for-of19.ts, 2, 1)) + + done: false +>done : Symbol(done, Decl(for-of19.ts, 8, 27)) + + }; + } + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(FooIterator, Decl(for-of19.ts, 4, 13)) + } +} diff --git a/tests/baselines/reference/for-of19.types b/tests/baselines/reference/for-of19.types index 49172b09d83..02ef786ddd9 100644 --- a/tests/baselines/reference/for-of19.types +++ b/tests/baselines/reference/for-of19.types @@ -27,6 +27,7 @@ class FooIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/for-of20.symbols b/tests/baselines/reference/for-of20.symbols new file mode 100644 index 00000000000..50c191a7ac0 --- /dev/null +++ b/tests/baselines/reference/for-of20.symbols @@ -0,0 +1,37 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of20.ts === +for (let v of new FooIterator) { +>v : Symbol(v, Decl(for-of20.ts, 0, 8)) +>FooIterator : Symbol(FooIterator, Decl(for-of20.ts, 4, 13)) + + v; +>v : Symbol(v, Decl(for-of20.ts, 0, 8)) +} + +class Foo { } +>Foo : Symbol(Foo, Decl(for-of20.ts, 2, 1)) + +class FooIterator { +>FooIterator : Symbol(FooIterator, Decl(for-of20.ts, 4, 13)) + + next() { +>next : Symbol(next, Decl(for-of20.ts, 5, 19)) + + return { + value: new Foo, +>value : Symbol(value, Decl(for-of20.ts, 7, 16)) +>Foo : Symbol(Foo, Decl(for-of20.ts, 2, 1)) + + done: false +>done : Symbol(done, Decl(for-of20.ts, 8, 27)) + + }; + } + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(FooIterator, Decl(for-of20.ts, 4, 13)) + } +} diff --git a/tests/baselines/reference/for-of20.types b/tests/baselines/reference/for-of20.types index e967869fbd0..3da6fd484b1 100644 --- a/tests/baselines/reference/for-of20.types +++ b/tests/baselines/reference/for-of20.types @@ -27,6 +27,7 @@ class FooIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/for-of21.symbols b/tests/baselines/reference/for-of21.symbols new file mode 100644 index 00000000000..0fbef87af15 --- /dev/null +++ b/tests/baselines/reference/for-of21.symbols @@ -0,0 +1,37 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of21.ts === +for (const v of new FooIterator) { +>v : Symbol(v, Decl(for-of21.ts, 0, 10)) +>FooIterator : Symbol(FooIterator, Decl(for-of21.ts, 4, 13)) + + v; +>v : Symbol(v, Decl(for-of21.ts, 0, 10)) +} + +class Foo { } +>Foo : Symbol(Foo, Decl(for-of21.ts, 2, 1)) + +class FooIterator { +>FooIterator : Symbol(FooIterator, Decl(for-of21.ts, 4, 13)) + + next() { +>next : Symbol(next, Decl(for-of21.ts, 5, 19)) + + return { + value: new Foo, +>value : Symbol(value, Decl(for-of21.ts, 7, 16)) +>Foo : Symbol(Foo, Decl(for-of21.ts, 2, 1)) + + done: false +>done : Symbol(done, Decl(for-of21.ts, 8, 27)) + + }; + } + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(FooIterator, Decl(for-of21.ts, 4, 13)) + } +} diff --git a/tests/baselines/reference/for-of21.types b/tests/baselines/reference/for-of21.types index 362f92577e2..a0cc50e99d7 100644 --- a/tests/baselines/reference/for-of21.types +++ b/tests/baselines/reference/for-of21.types @@ -27,6 +27,7 @@ class FooIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/for-of22.symbols b/tests/baselines/reference/for-of22.symbols new file mode 100644 index 00000000000..9714f615a79 --- /dev/null +++ b/tests/baselines/reference/for-of22.symbols @@ -0,0 +1,38 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of22.ts === +v; +>v : Symbol(v, Decl(for-of22.ts, 1, 8)) + +for (var v of new FooIterator) { +>v : Symbol(v, Decl(for-of22.ts, 1, 8)) +>FooIterator : Symbol(FooIterator, Decl(for-of22.ts, 5, 13)) + +} + +class Foo { } +>Foo : Symbol(Foo, Decl(for-of22.ts, 3, 1)) + +class FooIterator { +>FooIterator : Symbol(FooIterator, Decl(for-of22.ts, 5, 13)) + + next() { +>next : Symbol(next, Decl(for-of22.ts, 6, 19)) + + return { + value: new Foo, +>value : Symbol(value, Decl(for-of22.ts, 8, 16)) +>Foo : Symbol(Foo, Decl(for-of22.ts, 3, 1)) + + done: false +>done : Symbol(done, Decl(for-of22.ts, 9, 27)) + + }; + } + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(FooIterator, Decl(for-of22.ts, 5, 13)) + } +} diff --git a/tests/baselines/reference/for-of22.types b/tests/baselines/reference/for-of22.types index bb2d5569bfc..09e85798554 100644 --- a/tests/baselines/reference/for-of22.types +++ b/tests/baselines/reference/for-of22.types @@ -28,6 +28,7 @@ class FooIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/for-of23.symbols b/tests/baselines/reference/for-of23.symbols new file mode 100644 index 00000000000..328cb41ad29 --- /dev/null +++ b/tests/baselines/reference/for-of23.symbols @@ -0,0 +1,37 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of23.ts === +for (const v of new FooIterator) { +>v : Symbol(v, Decl(for-of23.ts, 0, 10)) +>FooIterator : Symbol(FooIterator, Decl(for-of23.ts, 4, 13)) + + const v = 0; // new scope +>v : Symbol(v, Decl(for-of23.ts, 1, 9)) +} + +class Foo { } +>Foo : Symbol(Foo, Decl(for-of23.ts, 2, 1)) + +class FooIterator { +>FooIterator : Symbol(FooIterator, Decl(for-of23.ts, 4, 13)) + + next() { +>next : Symbol(next, Decl(for-of23.ts, 5, 19)) + + return { + value: new Foo, +>value : Symbol(value, Decl(for-of23.ts, 7, 16)) +>Foo : Symbol(Foo, Decl(for-of23.ts, 2, 1)) + + done: false +>done : Symbol(done, Decl(for-of23.ts, 8, 27)) + + }; + } + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(FooIterator, Decl(for-of23.ts, 4, 13)) + } +} diff --git a/tests/baselines/reference/for-of23.types b/tests/baselines/reference/for-of23.types index b490616edc8..37515c0b70a 100644 --- a/tests/baselines/reference/for-of23.types +++ b/tests/baselines/reference/for-of23.types @@ -6,6 +6,7 @@ for (const v of new FooIterator) { const v = 0; // new scope >v : number +>0 : number } class Foo { } @@ -27,6 +28,7 @@ class FooIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/for-of24.symbols b/tests/baselines/reference/for-of24.symbols new file mode 100644 index 00000000000..cd2546f7278 --- /dev/null +++ b/tests/baselines/reference/for-of24.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of24.ts === +var x: any; +>x : Symbol(x, Decl(for-of24.ts, 0, 3)) + +for (var v of x) { } +>v : Symbol(v, Decl(for-of24.ts, 1, 8)) +>x : Symbol(x, Decl(for-of24.ts, 0, 3)) + diff --git a/tests/baselines/reference/for-of25.symbols b/tests/baselines/reference/for-of25.symbols new file mode 100644 index 00000000000..1a0b660fc1e --- /dev/null +++ b/tests/baselines/reference/for-of25.symbols @@ -0,0 +1,20 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of25.ts === +var x: any; +>x : Symbol(x, Decl(for-of25.ts, 0, 3)) + +for (var v of new StringIterator) { } +>v : Symbol(v, Decl(for-of25.ts, 1, 8)) +>StringIterator : Symbol(StringIterator, Decl(for-of25.ts, 1, 37)) + +class StringIterator { +>StringIterator : Symbol(StringIterator, Decl(for-of25.ts, 1, 37)) + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return x; +>x : Symbol(x, Decl(for-of25.ts, 0, 3)) + } +} diff --git a/tests/baselines/reference/for-of26.symbols b/tests/baselines/reference/for-of26.symbols new file mode 100644 index 00000000000..a2c21c95146 --- /dev/null +++ b/tests/baselines/reference/for-of26.symbols @@ -0,0 +1,26 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of26.ts === +var x: any; +>x : Symbol(x, Decl(for-of26.ts, 0, 3)) + +for (var v of new StringIterator) { } +>v : Symbol(v, Decl(for-of26.ts, 1, 8)) +>StringIterator : Symbol(StringIterator, Decl(for-of26.ts, 1, 37)) + +class StringIterator { +>StringIterator : Symbol(StringIterator, Decl(for-of26.ts, 1, 37)) + + next() { +>next : Symbol(next, Decl(for-of26.ts, 3, 22)) + + return x; +>x : Symbol(x, Decl(for-of26.ts, 0, 3)) + } + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(StringIterator, Decl(for-of26.ts, 1, 37)) + } +} diff --git a/tests/baselines/reference/for-of27.symbols b/tests/baselines/reference/for-of27.symbols new file mode 100644 index 00000000000..e03b580551d --- /dev/null +++ b/tests/baselines/reference/for-of27.symbols @@ -0,0 +1,13 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of27.ts === +for (var v of new StringIterator) { } +>v : Symbol(v, Decl(for-of27.ts, 0, 8)) +>StringIterator : Symbol(StringIterator, Decl(for-of27.ts, 0, 37)) + +class StringIterator { +>StringIterator : Symbol(StringIterator, Decl(for-of27.ts, 0, 37)) + + [Symbol.iterator]: any; +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +} diff --git a/tests/baselines/reference/for-of28.symbols b/tests/baselines/reference/for-of28.symbols new file mode 100644 index 00000000000..9d6b912bd94 --- /dev/null +++ b/tests/baselines/reference/for-of28.symbols @@ -0,0 +1,20 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of28.ts === +for (var v of new StringIterator) { } +>v : Symbol(v, Decl(for-of28.ts, 0, 8)) +>StringIterator : Symbol(StringIterator, Decl(for-of28.ts, 0, 37)) + +class StringIterator { +>StringIterator : Symbol(StringIterator, Decl(for-of28.ts, 0, 37)) + + next: any; +>next : Symbol(next, Decl(for-of28.ts, 2, 22)) + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(StringIterator, Decl(for-of28.ts, 0, 37)) + } +} diff --git a/tests/baselines/reference/for-of36.symbols b/tests/baselines/reference/for-of36.symbols new file mode 100644 index 00000000000..f1924540340 --- /dev/null +++ b/tests/baselines/reference/for-of36.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of36.ts === +var tuple: [string, boolean] = ["", true]; +>tuple : Symbol(tuple, Decl(for-of36.ts, 0, 3)) + +for (var v of tuple) { +>v : Symbol(v, Decl(for-of36.ts, 1, 8)) +>tuple : Symbol(tuple, Decl(for-of36.ts, 0, 3)) + + v; +>v : Symbol(v, Decl(for-of36.ts, 1, 8)) +} diff --git a/tests/baselines/reference/for-of36.types b/tests/baselines/reference/for-of36.types index da03367ba5d..e23ea79d0a9 100644 --- a/tests/baselines/reference/for-of36.types +++ b/tests/baselines/reference/for-of36.types @@ -2,6 +2,8 @@ var tuple: [string, boolean] = ["", true]; >tuple : [string, boolean] >["", true] : [string, boolean] +>"" : string +>true : boolean for (var v of tuple) { >v : string | boolean diff --git a/tests/baselines/reference/for-of37.symbols b/tests/baselines/reference/for-of37.symbols new file mode 100644 index 00000000000..86841971be7 --- /dev/null +++ b/tests/baselines/reference/for-of37.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of37.ts === +var map = new Map([["", true]]); +>map : Symbol(map, Decl(for-of37.ts, 0, 3)) +>Map : Symbol(Map, Decl(lib.d.ts, 1837, 1), Decl(lib.d.ts, 1859, 11)) + +for (var v of map) { +>v : Symbol(v, Decl(for-of37.ts, 1, 8)) +>map : Symbol(map, Decl(for-of37.ts, 0, 3)) + + v; +>v : Symbol(v, Decl(for-of37.ts, 1, 8)) +} diff --git a/tests/baselines/reference/for-of37.types b/tests/baselines/reference/for-of37.types index f137db79af0..89272742f62 100644 --- a/tests/baselines/reference/for-of37.types +++ b/tests/baselines/reference/for-of37.types @@ -5,6 +5,8 @@ var map = new Map([["", true]]); >Map : MapConstructor >[["", true]] : [string, boolean][] >["", true] : [string, boolean] +>"" : string +>true : boolean for (var v of map) { >v : [string, boolean] diff --git a/tests/baselines/reference/for-of38.symbols b/tests/baselines/reference/for-of38.symbols new file mode 100644 index 00000000000..5ee81f2eb15 --- /dev/null +++ b/tests/baselines/reference/for-of38.symbols @@ -0,0 +1,16 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of38.ts === +var map = new Map([["", true]]); +>map : Symbol(map, Decl(for-of38.ts, 0, 3)) +>Map : Symbol(Map, Decl(lib.d.ts, 1837, 1), Decl(lib.d.ts, 1859, 11)) + +for (var [k, v] of map) { +>k : Symbol(k, Decl(for-of38.ts, 1, 10)) +>v : Symbol(v, Decl(for-of38.ts, 1, 12)) +>map : Symbol(map, Decl(for-of38.ts, 0, 3)) + + k; +>k : Symbol(k, Decl(for-of38.ts, 1, 10)) + + v; +>v : Symbol(v, Decl(for-of38.ts, 1, 12)) +} diff --git a/tests/baselines/reference/for-of38.types b/tests/baselines/reference/for-of38.types index cdd1e05dd7e..f8b7555781f 100644 --- a/tests/baselines/reference/for-of38.types +++ b/tests/baselines/reference/for-of38.types @@ -5,6 +5,8 @@ var map = new Map([["", true]]); >Map : MapConstructor >[["", true]] : [string, boolean][] >["", true] : [string, boolean] +>"" : string +>true : boolean for (var [k, v] of map) { >k : string diff --git a/tests/baselines/reference/for-of4.symbols b/tests/baselines/reference/for-of4.symbols new file mode 100644 index 00000000000..af291f47c98 --- /dev/null +++ b/tests/baselines/reference/for-of4.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of4.ts === +for (var v of [0]) { +>v : Symbol(v, Decl(for-of4.ts, 0, 8)) + + v; +>v : Symbol(v, Decl(for-of4.ts, 0, 8)) +} diff --git a/tests/baselines/reference/for-of4.types b/tests/baselines/reference/for-of4.types index 2076fae84fc..5b8990797ba 100644 --- a/tests/baselines/reference/for-of4.types +++ b/tests/baselines/reference/for-of4.types @@ -2,6 +2,7 @@ for (var v of [0]) { >v : number >[0] : number[] +>0 : number v; >v : number diff --git a/tests/baselines/reference/for-of40.symbols b/tests/baselines/reference/for-of40.symbols new file mode 100644 index 00000000000..a9c0b3fbc30 --- /dev/null +++ b/tests/baselines/reference/for-of40.symbols @@ -0,0 +1,16 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of40.ts === +var map = new Map([["", true]]); +>map : Symbol(map, Decl(for-of40.ts, 0, 3)) +>Map : Symbol(Map, Decl(lib.d.ts, 1837, 1), Decl(lib.d.ts, 1859, 11)) + +for (var [k = "", v = false] of map) { +>k : Symbol(k, Decl(for-of40.ts, 1, 10)) +>v : Symbol(v, Decl(for-of40.ts, 1, 17)) +>map : Symbol(map, Decl(for-of40.ts, 0, 3)) + + k; +>k : Symbol(k, Decl(for-of40.ts, 1, 10)) + + v; +>v : Symbol(v, Decl(for-of40.ts, 1, 17)) +} diff --git a/tests/baselines/reference/for-of40.types b/tests/baselines/reference/for-of40.types index c0fe7cbbc02..6693514ec53 100644 --- a/tests/baselines/reference/for-of40.types +++ b/tests/baselines/reference/for-of40.types @@ -5,10 +5,14 @@ var map = new Map([["", true]]); >Map : MapConstructor >[["", true]] : [string, boolean][] >["", true] : [string, boolean] +>"" : string +>true : boolean for (var [k = "", v = false] of map) { >k : string +>"" : string >v : boolean +>false : boolean >map : Map k; diff --git a/tests/baselines/reference/for-of41.symbols b/tests/baselines/reference/for-of41.symbols new file mode 100644 index 00000000000..cf8db913919 --- /dev/null +++ b/tests/baselines/reference/for-of41.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of41.ts === +var array = [{x: [0], y: {p: ""}}] +>array : Symbol(array, Decl(for-of41.ts, 0, 3)) +>x : Symbol(x, Decl(for-of41.ts, 0, 14)) +>y : Symbol(y, Decl(for-of41.ts, 0, 21)) +>p : Symbol(p, Decl(for-of41.ts, 0, 26)) + +for (var {x: [a], y: {p}} of array) { +>a : Symbol(a, Decl(for-of41.ts, 1, 14)) +>p : Symbol(p, Decl(for-of41.ts, 1, 22)) +>array : Symbol(array, Decl(for-of41.ts, 0, 3)) + + a; +>a : Symbol(a, Decl(for-of41.ts, 1, 14)) + + p; +>p : Symbol(p, Decl(for-of41.ts, 1, 22)) +} diff --git a/tests/baselines/reference/for-of41.types b/tests/baselines/reference/for-of41.types index 54e58aa1ec7..31e3e253002 100644 --- a/tests/baselines/reference/for-of41.types +++ b/tests/baselines/reference/for-of41.types @@ -5,14 +5,16 @@ var array = [{x: [0], y: {p: ""}}] >{x: [0], y: {p: ""}} : { x: number[]; y: { p: string; }; } >x : number[] >[0] : number[] +>0 : number >y : { p: string; } >{p: ""} : { p: string; } >p : string +>"" : string for (var {x: [a], y: {p}} of array) { ->x : unknown +>x : any >a : number ->y : unknown +>y : any >p : string >array : { x: number[]; y: { p: string; }; }[] diff --git a/tests/baselines/reference/for-of42.symbols b/tests/baselines/reference/for-of42.symbols new file mode 100644 index 00000000000..b310fb1044f --- /dev/null +++ b/tests/baselines/reference/for-of42.symbols @@ -0,0 +1,17 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of42.ts === +var array = [{ x: "", y: 0 }] +>array : Symbol(array, Decl(for-of42.ts, 0, 3)) +>x : Symbol(x, Decl(for-of42.ts, 0, 14)) +>y : Symbol(y, Decl(for-of42.ts, 0, 21)) + +for (var {x: a, y: b} of array) { +>a : Symbol(a, Decl(for-of42.ts, 1, 10)) +>b : Symbol(b, Decl(for-of42.ts, 1, 15)) +>array : Symbol(array, Decl(for-of42.ts, 0, 3)) + + a; +>a : Symbol(a, Decl(for-of42.ts, 1, 10)) + + b; +>b : Symbol(b, Decl(for-of42.ts, 1, 15)) +} diff --git a/tests/baselines/reference/for-of42.types b/tests/baselines/reference/for-of42.types index 1a819452770..64327bcc27f 100644 --- a/tests/baselines/reference/for-of42.types +++ b/tests/baselines/reference/for-of42.types @@ -4,12 +4,14 @@ var array = [{ x: "", y: 0 }] >[{ x: "", y: 0 }] : { x: string; y: number; }[] >{ x: "", y: 0 } : { x: string; y: number; } >x : string +>"" : string >y : number +>0 : number for (var {x: a, y: b} of array) { ->x : unknown +>x : any >a : string ->y : unknown +>y : any >b : number >array : { x: string; y: number; }[] diff --git a/tests/baselines/reference/for-of44.symbols b/tests/baselines/reference/for-of44.symbols new file mode 100644 index 00000000000..e01aad51d54 --- /dev/null +++ b/tests/baselines/reference/for-of44.symbols @@ -0,0 +1,16 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of44.ts === +var array: [number, string | boolean | symbol][] = [[0, ""], [0, true], [1, Symbol()]] +>array : Symbol(array, Decl(for-of44.ts, 0, 3)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) + +for (var [num, strBoolSym] of array) { +>num : Symbol(num, Decl(for-of44.ts, 1, 10)) +>strBoolSym : Symbol(strBoolSym, Decl(for-of44.ts, 1, 14)) +>array : Symbol(array, Decl(for-of44.ts, 0, 3)) + + num; +>num : Symbol(num, Decl(for-of44.ts, 1, 10)) + + strBoolSym; +>strBoolSym : Symbol(strBoolSym, Decl(for-of44.ts, 1, 14)) +} diff --git a/tests/baselines/reference/for-of44.types b/tests/baselines/reference/for-of44.types index 078b49bd309..e6f4e0450b3 100644 --- a/tests/baselines/reference/for-of44.types +++ b/tests/baselines/reference/for-of44.types @@ -3,8 +3,13 @@ var array: [number, string | boolean | symbol][] = [[0, ""], [0, true], [1, Symb >array : [number, string | boolean | symbol][] >[[0, ""], [0, true], [1, Symbol()]] : ([number, string] | [number, boolean] | [number, symbol])[] >[0, ""] : [number, string] +>0 : number +>"" : string >[0, true] : [number, boolean] +>0 : number +>true : boolean >[1, Symbol()] : [number, symbol] +>1 : number >Symbol() : symbol >Symbol : SymbolConstructor diff --git a/tests/baselines/reference/for-of45.symbols b/tests/baselines/reference/for-of45.symbols new file mode 100644 index 00000000000..e86ee110362 --- /dev/null +++ b/tests/baselines/reference/for-of45.symbols @@ -0,0 +1,20 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of45.ts === +var k: string, v: boolean; +>k : Symbol(k, Decl(for-of45.ts, 0, 3)) +>v : Symbol(v, Decl(for-of45.ts, 0, 14)) + +var map = new Map([["", true]]); +>map : Symbol(map, Decl(for-of45.ts, 1, 3)) +>Map : Symbol(Map, Decl(lib.d.ts, 1837, 1), Decl(lib.d.ts, 1859, 11)) + +for ([k = "", v = false] of map) { +>k : Symbol(k, Decl(for-of45.ts, 0, 3)) +>v : Symbol(v, Decl(for-of45.ts, 0, 14)) +>map : Symbol(map, Decl(for-of45.ts, 1, 3)) + + k; +>k : Symbol(k, Decl(for-of45.ts, 0, 3)) + + v; +>v : Symbol(v, Decl(for-of45.ts, 0, 14)) +} diff --git a/tests/baselines/reference/for-of45.types b/tests/baselines/reference/for-of45.types index 8ac4b9fa7e9..b71e062eccf 100644 --- a/tests/baselines/reference/for-of45.types +++ b/tests/baselines/reference/for-of45.types @@ -9,13 +9,17 @@ var map = new Map([["", true]]); >Map : MapConstructor >[["", true]] : [string, boolean][] >["", true] : [string, boolean] +>"" : string +>true : boolean for ([k = "", v = false] of map) { >[k = "", v = false] : (string | boolean)[] >k = "" : string >k : string +>"" : string >v = false : boolean >v : boolean +>false : boolean >map : Map k; diff --git a/tests/baselines/reference/for-of49.errors.txt b/tests/baselines/reference/for-of49.errors.txt index d5bc314e678..aaf29f5bfe3 100644 --- a/tests/baselines/reference/for-of49.errors.txt +++ b/tests/baselines/reference/for-of49.errors.txt @@ -1,12 +1,14 @@ -tests/cases/conformance/es6/for-ofStatements/for-of49.ts(3,13): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/es6/for-ofStatements/for-of49.ts(3,14): error TS2322: Type 'string | boolean' is not assignable to type 'boolean'. + Type 'string' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/for-ofStatements/for-of49.ts (1 errors) ==== var k: string, v: boolean; var map = new Map([["", true]]); for ([k, ...[v]] of map) { - ~~~ -!!! error TS2364: Invalid left-hand side of assignment expression. + ~ +!!! error TS2322: Type 'string | boolean' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. k; v; } \ No newline at end of file diff --git a/tests/baselines/reference/for-of5.symbols b/tests/baselines/reference/for-of5.symbols new file mode 100644 index 00000000000..776759b3a37 --- /dev/null +++ b/tests/baselines/reference/for-of5.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of5.ts === +for (let v of [0]) { +>v : Symbol(v, Decl(for-of5.ts, 0, 8)) + + v; +>v : Symbol(v, Decl(for-of5.ts, 0, 8)) +} diff --git a/tests/baselines/reference/for-of5.types b/tests/baselines/reference/for-of5.types index feac5ef9e52..921c327c185 100644 --- a/tests/baselines/reference/for-of5.types +++ b/tests/baselines/reference/for-of5.types @@ -2,6 +2,7 @@ for (let v of [0]) { >v : number >[0] : number[] +>0 : number v; >v : number diff --git a/tests/baselines/reference/for-of50.symbols b/tests/baselines/reference/for-of50.symbols new file mode 100644 index 00000000000..9076f63300e --- /dev/null +++ b/tests/baselines/reference/for-of50.symbols @@ -0,0 +1,16 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of50.ts === +var map = new Map([["", true]]); +>map : Symbol(map, Decl(for-of50.ts, 0, 3)) +>Map : Symbol(Map, Decl(lib.d.ts, 1837, 1), Decl(lib.d.ts, 1859, 11)) + +for (const [k, v] of map) { +>k : Symbol(k, Decl(for-of50.ts, 1, 12)) +>v : Symbol(v, Decl(for-of50.ts, 1, 14)) +>map : Symbol(map, Decl(for-of50.ts, 0, 3)) + + k; +>k : Symbol(k, Decl(for-of50.ts, 1, 12)) + + v; +>v : Symbol(v, Decl(for-of50.ts, 1, 14)) +} diff --git a/tests/baselines/reference/for-of50.types b/tests/baselines/reference/for-of50.types index a38f3855174..5d5dac7abed 100644 --- a/tests/baselines/reference/for-of50.types +++ b/tests/baselines/reference/for-of50.types @@ -5,6 +5,8 @@ var map = new Map([["", true]]); >Map : MapConstructor >[["", true]] : [string, boolean][] >["", true] : [string, boolean] +>"" : string +>true : boolean for (const [k, v] of map) { >k : string diff --git a/tests/baselines/reference/for-of53.symbols b/tests/baselines/reference/for-of53.symbols new file mode 100644 index 00000000000..949b2624985 --- /dev/null +++ b/tests/baselines/reference/for-of53.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of53.ts === +for (let v of []) { +>v : Symbol(v, Decl(for-of53.ts, 0, 8)) + + var v; +>v : Symbol(v, Decl(for-of53.ts, 1, 7)) +} diff --git a/tests/baselines/reference/for-of56.symbols b/tests/baselines/reference/for-of56.symbols new file mode 100644 index 00000000000..4e754075922 --- /dev/null +++ b/tests/baselines/reference/for-of56.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of56.ts === +for (var let of []) {} +>let : Symbol(let, Decl(for-of56.ts, 0, 8)) + diff --git a/tests/baselines/reference/for-of57.symbols b/tests/baselines/reference/for-of57.symbols new file mode 100644 index 00000000000..60e87b25587 --- /dev/null +++ b/tests/baselines/reference/for-of57.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of57.ts === +var iter: Iterable; +>iter : Symbol(iter, Decl(for-of57.ts, 0, 3)) +>Iterable : Symbol(Iterable, Decl(lib.d.ts, 1633, 1)) + +for (let num of iter) { } +>num : Symbol(num, Decl(for-of57.ts, 1, 8)) +>iter : Symbol(iter, Decl(for-of57.ts, 0, 3)) + diff --git a/tests/baselines/reference/for-of8.symbols b/tests/baselines/reference/for-of8.symbols new file mode 100644 index 00000000000..a7190fc5d13 --- /dev/null +++ b/tests/baselines/reference/for-of8.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of8.ts === +v; +>v : Symbol(v, Decl(for-of8.ts, 1, 8)) + +for (var v of [0]) { } +>v : Symbol(v, Decl(for-of8.ts, 1, 8)) + diff --git a/tests/baselines/reference/for-of8.types b/tests/baselines/reference/for-of8.types index 5f239d141fe..36bb20ef6b0 100644 --- a/tests/baselines/reference/for-of8.types +++ b/tests/baselines/reference/for-of8.types @@ -5,4 +5,5 @@ v; for (var v of [0]) { } >v : number >[0] : number[] +>0 : number diff --git a/tests/baselines/reference/for-of9.symbols b/tests/baselines/reference/for-of9.symbols new file mode 100644 index 00000000000..5fc2f76f3a6 --- /dev/null +++ b/tests/baselines/reference/for-of9.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of9.ts === +var v: string; +>v : Symbol(v, Decl(for-of9.ts, 0, 3)) + +for (v of ["hello"]) { } +>v : Symbol(v, Decl(for-of9.ts, 0, 3)) + +for (v of "hello") { } +>v : Symbol(v, Decl(for-of9.ts, 0, 3)) + diff --git a/tests/baselines/reference/for-of9.types b/tests/baselines/reference/for-of9.types index 55c8167094f..bf06bf46034 100644 --- a/tests/baselines/reference/for-of9.types +++ b/tests/baselines/reference/for-of9.types @@ -5,7 +5,9 @@ var v: string; for (v of ["hello"]) { } >v : string >["hello"] : string[] +>"hello" : string for (v of "hello") { } >v : string +>"hello" : string diff --git a/tests/baselines/reference/forBreakStatements.symbols b/tests/baselines/reference/forBreakStatements.symbols new file mode 100644 index 00000000000..76db9309a39 --- /dev/null +++ b/tests/baselines/reference/forBreakStatements.symbols @@ -0,0 +1,40 @@ +=== tests/cases/conformance/statements/breakStatements/forBreakStatements.ts === +for (; ;) { + break; +} + +ONE: +for (; ;) { + break ONE; +} + +TWO: +THREE: +for (; ;) { + break THREE; +} + +FOUR: +for (; ;) { + FIVE: + for (; ;) { + break FOUR; + } +} + +for (; ;) { + SIX: + for (; ;) break SIX; +} + +SEVEN: +for (; ;) for (; ;) for (; ;) break SEVEN; + +EIGHT: +for (; ;) { + var fn = function () { } +>fn : Symbol(fn, Decl(forBreakStatements.ts, 33, 7)) + + break EIGHT; +} + diff --git a/tests/baselines/reference/forBreakStatements.types b/tests/baselines/reference/forBreakStatements.types index dafaae9cce7..8469a85bd19 100644 --- a/tests/baselines/reference/forBreakStatements.types +++ b/tests/baselines/reference/forBreakStatements.types @@ -4,38 +4,60 @@ for (; ;) { } ONE: +>ONE : any + for (; ;) { break ONE; +>ONE : any } TWO: +>TWO : any + THREE: +>THREE : any + for (; ;) { break THREE; +>THREE : any } FOUR: +>FOUR : any + for (; ;) { FIVE: +>FIVE : any + for (; ;) { break FOUR; +>FOUR : any } } for (; ;) { SIX: +>SIX : any + for (; ;) break SIX; +>SIX : any } SEVEN: +>SEVEN : any + for (; ;) for (; ;) for (; ;) break SEVEN; +>SEVEN : any EIGHT: +>EIGHT : any + for (; ;) { var fn = function () { } >fn : () => void >function () { } : () => void break EIGHT; +>EIGHT : any } diff --git a/tests/baselines/reference/forContinueStatements.symbols b/tests/baselines/reference/forContinueStatements.symbols new file mode 100644 index 00000000000..e24eb2aaa92 --- /dev/null +++ b/tests/baselines/reference/forContinueStatements.symbols @@ -0,0 +1,40 @@ +=== tests/cases/conformance/statements/continueStatements/forContinueStatements.ts === +for (; ;) { + continue; +} + +ONE: +for (; ;) { + continue ONE; +} + +TWO: +THREE: +for (; ;) { + continue THREE; +} + +FOUR: +for (; ;) { + FIVE: + for (; ;) { + continue FOUR; + } +} + +for (; ;) { + SIX: + for (; ;) continue SIX; +} + +SEVEN: +for (; ;) for (; ;) for (; ;) continue SEVEN; + +EIGHT: +for (; ;) { + var fn = function () { } +>fn : Symbol(fn, Decl(forContinueStatements.ts, 33, 7)) + + continue EIGHT; +} + diff --git a/tests/baselines/reference/forContinueStatements.types b/tests/baselines/reference/forContinueStatements.types index 60fd7115362..79b78e83345 100644 --- a/tests/baselines/reference/forContinueStatements.types +++ b/tests/baselines/reference/forContinueStatements.types @@ -4,38 +4,60 @@ for (; ;) { } ONE: +>ONE : any + for (; ;) { continue ONE; +>ONE : any } TWO: +>TWO : any + THREE: +>THREE : any + for (; ;) { continue THREE; +>THREE : any } FOUR: +>FOUR : any + for (; ;) { FIVE: +>FIVE : any + for (; ;) { continue FOUR; +>FOUR : any } } for (; ;) { SIX: +>SIX : any + for (; ;) continue SIX; +>SIX : any } SEVEN: +>SEVEN : any + for (; ;) for (; ;) for (; ;) continue SEVEN; +>SEVEN : any EIGHT: +>EIGHT : any + for (; ;) { var fn = function () { } >fn : () => void >function () { } : () => void continue EIGHT; +>EIGHT : any } diff --git a/tests/baselines/reference/forInBreakStatements.symbols b/tests/baselines/reference/forInBreakStatements.symbols new file mode 100644 index 00000000000..7984edc3fd6 --- /dev/null +++ b/tests/baselines/reference/forInBreakStatements.symbols @@ -0,0 +1,58 @@ +=== tests/cases/conformance/statements/breakStatements/forInBreakStatements.ts === +for(var x in {}) { +>x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) + + break; +} + +ONE: +for(var x in {}) { +>x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) + + break ONE; +} + +TWO: +THREE: +for(var x in {}) { +>x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) + + break THREE; +} + +FOUR: +for(var x in {}) { +>x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) + + FIVE: + for(var x in {}) { +>x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) + + break FOUR; + } +} + +for(var x in {}) { +>x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) + + SIX: + for(var x in {}) break SIX; +>x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) +} + +SEVEN: +for (var x in {}) for (var x in {}) for (var x in {}) break SEVEN; +>x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) +>x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) +>x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) + +EIGHT: +for (var x in {}){ +>x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) + + var fn = function () { } +>fn : Symbol(fn, Decl(forInBreakStatements.ts, 33, 7)) + + break EIGHT; +} + diff --git a/tests/baselines/reference/forInBreakStatements.types b/tests/baselines/reference/forInBreakStatements.types index 8d0cf0ace3c..05ea8e35feb 100644 --- a/tests/baselines/reference/forInBreakStatements.types +++ b/tests/baselines/reference/forInBreakStatements.types @@ -7,33 +7,46 @@ for(var x in {}) { } ONE: +>ONE : any + for(var x in {}) { >x : any >{} : {} break ONE; +>ONE : any } TWO: +>TWO : any + THREE: +>THREE : any + for(var x in {}) { >x : any >{} : {} break THREE; +>THREE : any } FOUR: +>FOUR : any + for(var x in {}) { >x : any >{} : {} FIVE: +>FIVE : any + for(var x in {}) { >x : any >{} : {} break FOUR; +>FOUR : any } } @@ -42,12 +55,17 @@ for(var x in {}) { >{} : {} SIX: +>SIX : any + for(var x in {}) break SIX; >x : any >{} : {} +>SIX : any } SEVEN: +>SEVEN : any + for (var x in {}) for (var x in {}) for (var x in {}) break SEVEN; >x : any >{} : {} @@ -55,8 +73,11 @@ for (var x in {}) for (var x in {}) for (var x in {}) break SEVEN; >{} : {} >x : any >{} : {} +>SEVEN : any EIGHT: +>EIGHT : any + for (var x in {}){ >x : any >{} : {} @@ -66,5 +87,6 @@ for (var x in {}){ >function () { } : () => void break EIGHT; +>EIGHT : any } diff --git a/tests/baselines/reference/forInContinueStatements.symbols b/tests/baselines/reference/forInContinueStatements.symbols new file mode 100644 index 00000000000..88129a50d21 --- /dev/null +++ b/tests/baselines/reference/forInContinueStatements.symbols @@ -0,0 +1,58 @@ +=== tests/cases/conformance/statements/continueStatements/forInContinueStatements.ts === +for(var x in {}) { +>x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) + + continue; +} + +ONE: +for(var x in {}) { +>x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) + + continue ONE; +} + +TWO: +THREE: +for(var x in {}) { +>x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) + + continue THREE; +} + +FOUR: +for(var x in {}) { +>x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) + + FIVE: + for(var x in {}) { +>x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) + + continue FOUR; + } +} + +for(var x in {}) { +>x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) + + SIX: + for(var x in {}) continue SIX; +>x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) +} + +SEVEN: +for (var x in {}) for (var x in {}) for (var x in {}) continue SEVEN; +>x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) +>x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) +>x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) + +EIGHT: +for (var x in {}){ +>x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) + + var fn = function () { } +>fn : Symbol(fn, Decl(forInContinueStatements.ts, 33, 7)) + + continue EIGHT; +} + diff --git a/tests/baselines/reference/forInContinueStatements.types b/tests/baselines/reference/forInContinueStatements.types index 3751c11aaa9..95637345fa6 100644 --- a/tests/baselines/reference/forInContinueStatements.types +++ b/tests/baselines/reference/forInContinueStatements.types @@ -7,33 +7,46 @@ for(var x in {}) { } ONE: +>ONE : any + for(var x in {}) { >x : any >{} : {} continue ONE; +>ONE : any } TWO: +>TWO : any + THREE: +>THREE : any + for(var x in {}) { >x : any >{} : {} continue THREE; +>THREE : any } FOUR: +>FOUR : any + for(var x in {}) { >x : any >{} : {} FIVE: +>FIVE : any + for(var x in {}) { >x : any >{} : {} continue FOUR; +>FOUR : any } } @@ -42,12 +55,17 @@ for(var x in {}) { >{} : {} SIX: +>SIX : any + for(var x in {}) continue SIX; >x : any >{} : {} +>SIX : any } SEVEN: +>SEVEN : any + for (var x in {}) for (var x in {}) for (var x in {}) continue SEVEN; >x : any >{} : {} @@ -55,8 +73,11 @@ for (var x in {}) for (var x in {}) for (var x in {}) continue SEVEN; >{} : {} >x : any >{} : {} +>SEVEN : any EIGHT: +>EIGHT : any + for (var x in {}){ >x : any >{} : {} @@ -66,5 +87,6 @@ for (var x in {}){ >function () { } : () => void continue EIGHT; +>EIGHT : any } diff --git a/tests/baselines/reference/forInModule.symbols b/tests/baselines/reference/forInModule.symbols new file mode 100644 index 00000000000..e540725f69f --- /dev/null +++ b/tests/baselines/reference/forInModule.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/forInModule.ts === +module Foo { +>Foo : Symbol(Foo, Decl(forInModule.ts, 0, 0)) + + for (var i = 0; i < 1; i++) { +>i : Symbol(i, Decl(forInModule.ts, 1, 9)) +>i : Symbol(i, Decl(forInModule.ts, 1, 9)) +>i : Symbol(i, Decl(forInModule.ts, 1, 9)) + + i+i; +>i : Symbol(i, Decl(forInModule.ts, 1, 9)) +>i : Symbol(i, Decl(forInModule.ts, 1, 9)) + } +} diff --git a/tests/baselines/reference/forInModule.types b/tests/baselines/reference/forInModule.types index 7de39df3b33..d78a511206b 100644 --- a/tests/baselines/reference/forInModule.types +++ b/tests/baselines/reference/forInModule.types @@ -4,8 +4,10 @@ module Foo { for (var i = 0; i < 1; i++) { >i : number +>0 : number >i < 1 : boolean >i : number +>1 : number >i++ : number >i : number diff --git a/tests/baselines/reference/forInStatement1.symbols b/tests/baselines/reference/forInStatement1.symbols new file mode 100644 index 00000000000..ab4003bb0d2 --- /dev/null +++ b/tests/baselines/reference/forInStatement1.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/forInStatement1.ts === +var expr: any; +>expr : Symbol(expr, Decl(forInStatement1.ts, 0, 3)) + +for (var a in expr) { +>a : Symbol(a, Decl(forInStatement1.ts, 1, 8)) +>expr : Symbol(expr, Decl(forInStatement1.ts, 0, 3)) +} diff --git a/tests/baselines/reference/forInStatement3.symbols b/tests/baselines/reference/forInStatement3.symbols new file mode 100644 index 00000000000..24896d89cfc --- /dev/null +++ b/tests/baselines/reference/forInStatement3.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/forInStatement3.ts === +function F() { +>F : Symbol(F, Decl(forInStatement3.ts, 0, 0)) +>T : Symbol(T, Decl(forInStatement3.ts, 0, 11)) + + var expr: T; +>expr : Symbol(expr, Decl(forInStatement3.ts, 1, 5)) +>T : Symbol(T, Decl(forInStatement3.ts, 0, 11)) + + for (var a in expr) { +>a : Symbol(a, Decl(forInStatement3.ts, 2, 10)) +>expr : Symbol(expr, Decl(forInStatement3.ts, 1, 5)) + } +} diff --git a/tests/baselines/reference/forInStatement5.symbols b/tests/baselines/reference/forInStatement5.symbols new file mode 100644 index 00000000000..2705ea3285c --- /dev/null +++ b/tests/baselines/reference/forInStatement5.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/forInStatement5.ts === +var a: string; +>a : Symbol(a, Decl(forInStatement5.ts, 0, 3)) + +var expr: any; +>expr : Symbol(expr, Decl(forInStatement5.ts, 1, 3)) + +for (a in expr) { +>a : Symbol(a, Decl(forInStatement5.ts, 0, 3)) +>expr : Symbol(expr, Decl(forInStatement5.ts, 1, 3)) +} diff --git a/tests/baselines/reference/forInStatement6.symbols b/tests/baselines/reference/forInStatement6.symbols new file mode 100644 index 00000000000..8e218969959 --- /dev/null +++ b/tests/baselines/reference/forInStatement6.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/forInStatement6.ts === +var a: any; +>a : Symbol(a, Decl(forInStatement6.ts, 0, 3)) + +var expr: any; +>expr : Symbol(expr, Decl(forInStatement6.ts, 1, 3)) + +for (a in expr) { +>a : Symbol(a, Decl(forInStatement6.ts, 0, 3)) +>expr : Symbol(expr, Decl(forInStatement6.ts, 1, 3)) +} diff --git a/tests/baselines/reference/forStatements.symbols b/tests/baselines/reference/forStatements.symbols new file mode 100644 index 00000000000..6f7c6d6cdbe --- /dev/null +++ b/tests/baselines/reference/forStatements.symbols @@ -0,0 +1,145 @@ +=== tests/cases/conformance/statements/forStatements/forStatements.ts === +interface I { +>I : Symbol(I, Decl(forStatements.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(forStatements.ts, 0, 13)) +} + +class C implements I { +>C : Symbol(C, Decl(forStatements.ts, 2, 1)) +>I : Symbol(I, Decl(forStatements.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(forStatements.ts, 4, 22)) +} + +class D{ +>D : Symbol(D, Decl(forStatements.ts, 6, 1)) +>T : Symbol(T, Decl(forStatements.ts, 8, 8)) + + source: T; +>source : Symbol(source, Decl(forStatements.ts, 8, 11)) +>T : Symbol(T, Decl(forStatements.ts, 8, 8)) + + recurse: D; +>recurse : Symbol(recurse, Decl(forStatements.ts, 9, 14)) +>D : Symbol(D, Decl(forStatements.ts, 6, 1)) +>T : Symbol(T, Decl(forStatements.ts, 8, 8)) + + wrapped: D> +>wrapped : Symbol(wrapped, Decl(forStatements.ts, 10, 18)) +>D : Symbol(D, Decl(forStatements.ts, 6, 1)) +>D : Symbol(D, Decl(forStatements.ts, 6, 1)) +>T : Symbol(T, Decl(forStatements.ts, 8, 8)) +} + +function F(x: string): number { return 42; } +>F : Symbol(F, Decl(forStatements.ts, 12, 1)) +>x : Symbol(x, Decl(forStatements.ts, 14, 11)) + +module M { +>M : Symbol(M, Decl(forStatements.ts, 14, 44)) + + export class A { +>A : Symbol(A, Decl(forStatements.ts, 16, 10)) + + name: string; +>name : Symbol(name, Decl(forStatements.ts, 17, 20)) + } + + export function F2(x: number): string { return x.toString(); } +>F2 : Symbol(F2, Decl(forStatements.ts, 19, 5)) +>x : Symbol(x, Decl(forStatements.ts, 21, 23)) +>x.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>x : Symbol(x, Decl(forStatements.ts, 21, 23)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +} + +for(var aNumber: number = 9.9;;){} +>aNumber : Symbol(aNumber, Decl(forStatements.ts, 24, 7)) + +for(var aString: string = 'this is a string';;){} +>aString : Symbol(aString, Decl(forStatements.ts, 25, 7)) + +for(var aDate: Date = new Date(12);;){} +>aDate : Symbol(aDate, Decl(forStatements.ts, 26, 7)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +for(var anObject: Object = new Object();;){} +>anObject : Symbol(anObject, Decl(forStatements.ts, 27, 7)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +for(var anAny: any = null;;){} +>anAny : Symbol(anAny, Decl(forStatements.ts, 29, 7)) + +for(var aSecondAny: any = undefined;;){} +>aSecondAny : Symbol(aSecondAny, Decl(forStatements.ts, 30, 7)) +>undefined : Symbol(undefined) + +for(var aVoid: void = undefined;;){} +>aVoid : Symbol(aVoid, Decl(forStatements.ts, 31, 7)) +>undefined : Symbol(undefined) + +for(var anInterface: I = new C();;){} +>anInterface : Symbol(anInterface, Decl(forStatements.ts, 33, 7)) +>I : Symbol(I, Decl(forStatements.ts, 0, 0)) +>C : Symbol(C, Decl(forStatements.ts, 2, 1)) + +for(var aClass: C = new C();;){} +>aClass : Symbol(aClass, Decl(forStatements.ts, 34, 7)) +>C : Symbol(C, Decl(forStatements.ts, 2, 1)) +>C : Symbol(C, Decl(forStatements.ts, 2, 1)) + +for(var aGenericClass: D = new D();;){} +>aGenericClass : Symbol(aGenericClass, Decl(forStatements.ts, 35, 7)) +>D : Symbol(D, Decl(forStatements.ts, 6, 1)) +>D : Symbol(D, Decl(forStatements.ts, 6, 1)) + +for(var anObjectLiteral: I = { id: 12 };;){} +>anObjectLiteral : Symbol(anObjectLiteral, Decl(forStatements.ts, 36, 7)) +>I : Symbol(I, Decl(forStatements.ts, 0, 0)) +>id : Symbol(id, Decl(forStatements.ts, 36, 30)) + +for(var anOtherObjectLiteral: { id: number } = new C();;){} +>anOtherObjectLiteral : Symbol(anOtherObjectLiteral, Decl(forStatements.ts, 37, 7)) +>id : Symbol(id, Decl(forStatements.ts, 37, 31)) +>C : Symbol(C, Decl(forStatements.ts, 2, 1)) + +for(var aFunction: typeof F = F;;){} +>aFunction : Symbol(aFunction, Decl(forStatements.ts, 39, 7)) +>F : Symbol(F, Decl(forStatements.ts, 12, 1)) +>F : Symbol(F, Decl(forStatements.ts, 12, 1)) + +for(var anOtherFunction: (x: string) => number = F;;){} +>anOtherFunction : Symbol(anOtherFunction, Decl(forStatements.ts, 40, 7)) +>x : Symbol(x, Decl(forStatements.ts, 40, 26)) +>F : Symbol(F, Decl(forStatements.ts, 12, 1)) + +for(var aLambda: typeof F = (x) => 2;;){} +>aLambda : Symbol(aLambda, Decl(forStatements.ts, 41, 7)) +>F : Symbol(F, Decl(forStatements.ts, 12, 1)) +>x : Symbol(x, Decl(forStatements.ts, 41, 29)) + +for(var aModule: typeof M = M;;){} +>aModule : Symbol(aModule, Decl(forStatements.ts, 43, 7)) +>M : Symbol(M, Decl(forStatements.ts, 14, 44)) +>M : Symbol(M, Decl(forStatements.ts, 14, 44)) + +for(var aClassInModule: M.A = new M.A();;){} +>aClassInModule : Symbol(aClassInModule, Decl(forStatements.ts, 44, 7)) +>M : Symbol(M, Decl(forStatements.ts, 14, 44)) +>A : Symbol(M.A, Decl(forStatements.ts, 16, 10)) +>M.A : Symbol(M.A, Decl(forStatements.ts, 16, 10)) +>M : Symbol(M, Decl(forStatements.ts, 14, 44)) +>A : Symbol(M.A, Decl(forStatements.ts, 16, 10)) + +for(var aFunctionInModule: typeof M.F2 = (x) => 'this is a string';;){} +>aFunctionInModule : Symbol(aFunctionInModule, Decl(forStatements.ts, 45, 7)) +>M.F2 : Symbol(M.F2, Decl(forStatements.ts, 19, 5)) +>M : Symbol(M, Decl(forStatements.ts, 14, 44)) +>F2 : Symbol(M.F2, Decl(forStatements.ts, 19, 5)) +>x : Symbol(x, Decl(forStatements.ts, 45, 42)) + diff --git a/tests/baselines/reference/forStatements.types b/tests/baselines/reference/forStatements.types index a5563a190ec..3fbcf2dbfb2 100644 --- a/tests/baselines/reference/forStatements.types +++ b/tests/baselines/reference/forStatements.types @@ -37,6 +37,7 @@ class D{ function F(x: string): number { return 42; } >F : (x: string) => number >x : string +>42 : number module M { >M : typeof M @@ -59,15 +60,18 @@ module M { for(var aNumber: number = 9.9;;){} >aNumber : number +>9.9 : number for(var aString: string = 'this is a string';;){} >aString : string +>'this is a string' : string for(var aDate: Date = new Date(12);;){} >aDate : Date >Date : Date >new Date(12) : Date >Date : DateConstructor +>12 : number for(var anObject: Object = new Object();;){} >anObject : Object @@ -77,6 +81,7 @@ for(var anObject: Object = new Object();;){} for(var anAny: any = null;;){} >anAny : any +>null : null for(var aSecondAny: any = undefined;;){} >aSecondAny : any @@ -109,6 +114,7 @@ for(var anObjectLiteral: I = { id: 12 };;){} >I : I >{ id: 12 } : { id: number; } >id : number +>12 : number for(var anOtherObjectLiteral: { id: number } = new C();;){} >anOtherObjectLiteral : { id: number; } @@ -131,6 +137,7 @@ for(var aLambda: typeof F = (x) => 2;;){} >F : (x: string) => number >(x) => 2 : (x: string) => number >x : string +>2 : number for(var aModule: typeof M = M;;){} >aModule : typeof M @@ -139,7 +146,7 @@ for(var aModule: typeof M = M;;){} for(var aClassInModule: M.A = new M.A();;){} >aClassInModule : M.A ->M : unknown +>M : any >A : M.A >new M.A() : M.A >M.A : typeof M.A @@ -148,8 +155,10 @@ for(var aClassInModule: M.A = new M.A();;){} for(var aFunctionInModule: typeof M.F2 = (x) => 'this is a string';;){} >aFunctionInModule : (x: number) => string +>M.F2 : (x: number) => string >M : typeof M >F2 : (x: number) => string >(x) => 'this is a string' : (x: number) => string >x : number +>'this is a string' : string diff --git a/tests/baselines/reference/forStatementsMultipleValidDecl.symbols b/tests/baselines/reference/forStatementsMultipleValidDecl.symbols new file mode 100644 index 00000000000..6a98fbf133e --- /dev/null +++ b/tests/baselines/reference/forStatementsMultipleValidDecl.symbols @@ -0,0 +1,110 @@ +=== tests/cases/conformance/statements/forStatements/forStatementsMultipleValidDecl.ts === +// all expected to be valid + +for (var x: number; ;) { } +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 2, 8), Decl(forStatementsMultipleValidDecl.ts, 3, 8), Decl(forStatementsMultipleValidDecl.ts, 5, 8)) + +for (var x = 2; ;) { } +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 2, 8), Decl(forStatementsMultipleValidDecl.ts, 3, 8), Decl(forStatementsMultipleValidDecl.ts, 5, 8)) + +for (var x = undefined; ;) { } +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 2, 8), Decl(forStatementsMultipleValidDecl.ts, 3, 8), Decl(forStatementsMultipleValidDecl.ts, 5, 8)) +>undefined : Symbol(undefined) + +// new declaration space, making redeclaring x as a string valid +function declSpace() { +>declSpace : Symbol(declSpace, Decl(forStatementsMultipleValidDecl.ts, 5, 38)) + + for (var x = 'this is a string'; ;) { } +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 8, 12)) +} +interface Point { x: number; y: number; } +>Point : Symbol(Point, Decl(forStatementsMultipleValidDecl.ts, 9, 1)) +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 10, 17)) +>y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 10, 28)) + +for (var p: Point; ;) { } +>p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 12, 8), Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8)) +>Point : Symbol(Point, Decl(forStatementsMultipleValidDecl.ts, 9, 1)) + +for (var p = { x: 1, y: 2 }; ;) { } +>p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 12, 8), Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8)) +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 13, 14)) +>y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 13, 20)) + +for (var p: Point = { x: 0, y: undefined }; ;) { } +>p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 12, 8), Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8)) +>Point : Symbol(Point, Decl(forStatementsMultipleValidDecl.ts, 9, 1)) +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 14, 21)) +>y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 14, 27)) +>undefined : Symbol(undefined) + +for (var p = { x: 1, y: undefined }; ;) { } +>p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 12, 8), Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8)) +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 15, 14)) +>y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 15, 20)) +>undefined : Symbol(undefined) + +for (var p: { x: number; y: number; } = { x: 1, y: 2 }; ;) { } +>p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 12, 8), Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8)) +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 16, 13)) +>y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 16, 24)) +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 16, 41)) +>y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 16, 47)) + +for (var p = <{ x: number; y: number; }>{ x: 0, y: undefined }; ;) { } +>p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 12, 8), Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8)) +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 17, 15)) +>y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 17, 26)) +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 17, 41)) +>y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 17, 47)) +>undefined : Symbol(undefined) + +for (var p: typeof p; ;) { } +>p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 12, 8), Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8)) +>p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 12, 8), Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8)) + +for (var fn = function (s: string) { return 42; }; ;) { } +>fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 20, 8), Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8)) +>s : Symbol(s, Decl(forStatementsMultipleValidDecl.ts, 20, 24)) + +for (var fn = (s: string) => 3; ;) { } +>fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 20, 8), Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8)) +>s : Symbol(s, Decl(forStatementsMultipleValidDecl.ts, 21, 15)) + +for (var fn: (s: string) => number; ;) { } +>fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 20, 8), Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8)) +>s : Symbol(s, Decl(forStatementsMultipleValidDecl.ts, 22, 14)) + +for (var fn: { (s: string): number }; ;) { } +>fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 20, 8), Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8)) +>s : Symbol(s, Decl(forStatementsMultipleValidDecl.ts, 23, 16)) + +for (var fn = <(s: string) => number> null; ;) { } +>fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 20, 8), Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8)) +>s : Symbol(s, Decl(forStatementsMultipleValidDecl.ts, 24, 16)) + +for (var fn: typeof fn; ;) { } +>fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 20, 8), Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8)) +>fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 20, 8), Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8)) + +for (var a: string[]; ;) { } +>a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 27, 8), Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8)) + +for (var a = ['a', 'b']; ;) { } +>a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 27, 8), Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8)) + +for (var a = []; ;) { } +>a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 27, 8), Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8)) + +for (var a: string[] = []; ;) { } +>a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 27, 8), Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8)) + +for (var a = new Array(); ;) { } +>a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 27, 8), Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +for (var a: typeof a; ;) { } +>a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 27, 8), Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8)) +>a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 27, 8), Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8)) + diff --git a/tests/baselines/reference/forStatementsMultipleValidDecl.types b/tests/baselines/reference/forStatementsMultipleValidDecl.types index 988a1c8a6d3..9b9af5b850e 100644 --- a/tests/baselines/reference/forStatementsMultipleValidDecl.types +++ b/tests/baselines/reference/forStatementsMultipleValidDecl.types @@ -6,6 +6,7 @@ for (var x: number; ;) { } for (var x = 2; ;) { } >x : number +>2 : number for (var x = undefined; ;) { } >x : number @@ -18,6 +19,7 @@ function declSpace() { for (var x = 'this is a string'; ;) { } >x : string +>'this is a string' : string } interface Point { x: number; y: number; } >Point : Point @@ -32,13 +34,16 @@ for (var p = { x: 1, y: 2 }; ;) { } >p : Point >{ x: 1, y: 2 } : { x: number; y: number; } >x : number +>1 : number >y : number +>2 : number for (var p: Point = { x: 0, y: undefined }; ;) { } >p : Point >Point : Point >{ x: 0, y: undefined } : { x: number; y: undefined; } >x : number +>0 : number >y : undefined >undefined : undefined @@ -46,6 +51,7 @@ for (var p = { x: 1, y: undefined }; ;) { } >p : Point >{ x: 1, y: undefined } : { x: number; y: number; } >x : number +>1 : number >y : number >undefined : number >undefined : undefined @@ -56,7 +62,9 @@ for (var p: { x: number; y: number; } = { x: 1, y: 2 }; ;) { } >y : number >{ x: 1, y: 2 } : { x: number; y: number; } >x : number +>1 : number >y : number +>2 : number for (var p = <{ x: number; y: number; }>{ x: 0, y: undefined }; ;) { } >p : Point @@ -65,6 +73,7 @@ for (var p = <{ x: number; y: number; }>{ x: 0, y: undefined }; ;) { } >y : number >{ x: 0, y: undefined } : { x: number; y: undefined; } >x : number +>0 : number >y : undefined >undefined : undefined @@ -76,11 +85,13 @@ for (var fn = function (s: string) { return 42; }; ;) { } >fn : (s: string) => number >function (s: string) { return 42; } : (s: string) => number >s : string +>42 : number for (var fn = (s: string) => 3; ;) { } >fn : (s: string) => number >(s: string) => 3 : (s: string) => number >s : string +>3 : number for (var fn: (s: string) => number; ;) { } >fn : (s: string) => number @@ -94,6 +105,7 @@ for (var fn = <(s: string) => number> null; ;) { } >fn : (s: string) => number ><(s: string) => number> null : (s: string) => number >s : string +>null : null for (var fn: typeof fn; ;) { } >fn : (s: string) => number @@ -105,6 +117,8 @@ for (var a: string[]; ;) { } for (var a = ['a', 'b']; ;) { } >a : string[] >['a', 'b'] : string[] +>'a' : string +>'b' : string for (var a = []; ;) { } >a : string[] diff --git a/tests/baselines/reference/fromAsIdentifier1.symbols b/tests/baselines/reference/fromAsIdentifier1.symbols new file mode 100644 index 00000000000..517980a0bfc --- /dev/null +++ b/tests/baselines/reference/fromAsIdentifier1.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/fromAsIdentifier1.ts === +var from; +>from : Symbol(from, Decl(fromAsIdentifier1.ts, 0, 3)) + diff --git a/tests/baselines/reference/fromAsIdentifier2.symbols b/tests/baselines/reference/fromAsIdentifier2.symbols new file mode 100644 index 00000000000..f55e374ba6b --- /dev/null +++ b/tests/baselines/reference/fromAsIdentifier2.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/fromAsIdentifier2.ts === +"use strict"; +var from; +>from : Symbol(from, Decl(fromAsIdentifier2.ts, 1, 3)) + diff --git a/tests/baselines/reference/fromAsIdentifier2.types b/tests/baselines/reference/fromAsIdentifier2.types index 5faf9ec6f6c..ae605f79268 100644 --- a/tests/baselines/reference/fromAsIdentifier2.types +++ b/tests/baselines/reference/fromAsIdentifier2.types @@ -1,5 +1,7 @@ === tests/cases/compiler/fromAsIdentifier2.ts === "use strict"; +>"use strict" : string + var from; >from : any diff --git a/tests/baselines/reference/funcdecl.symbols b/tests/baselines/reference/funcdecl.symbols new file mode 100644 index 00000000000..2538e3a9a04 --- /dev/null +++ b/tests/baselines/reference/funcdecl.symbols @@ -0,0 +1,155 @@ +=== tests/cases/compiler/funcdecl.ts === +function simpleFunc() { +>simpleFunc : Symbol(simpleFunc, Decl(funcdecl.ts, 0, 0)) + + return "this is my simple func"; +} +var simpleFuncVar = simpleFunc; +>simpleFuncVar : Symbol(simpleFuncVar, Decl(funcdecl.ts, 3, 3)) +>simpleFunc : Symbol(simpleFunc, Decl(funcdecl.ts, 0, 0)) + +function anotherFuncNoReturn() { +>anotherFuncNoReturn : Symbol(anotherFuncNoReturn, Decl(funcdecl.ts, 3, 31)) +} +var anotherFuncNoReturnVar = anotherFuncNoReturn; +>anotherFuncNoReturnVar : Symbol(anotherFuncNoReturnVar, Decl(funcdecl.ts, 7, 3)) +>anotherFuncNoReturn : Symbol(anotherFuncNoReturn, Decl(funcdecl.ts, 3, 31)) + +function withReturn() : string{ +>withReturn : Symbol(withReturn, Decl(funcdecl.ts, 7, 49)) + + return "Hello"; +} +var withReturnVar = withReturn; +>withReturnVar : Symbol(withReturnVar, Decl(funcdecl.ts, 12, 3)) +>withReturn : Symbol(withReturn, Decl(funcdecl.ts, 7, 49)) + +function withParams(a : string) : string{ +>withParams : Symbol(withParams, Decl(funcdecl.ts, 12, 31)) +>a : Symbol(a, Decl(funcdecl.ts, 14, 20)) + + return a; +>a : Symbol(a, Decl(funcdecl.ts, 14, 20)) +} +var withparamsVar = withParams; +>withparamsVar : Symbol(withparamsVar, Decl(funcdecl.ts, 17, 3)) +>withParams : Symbol(withParams, Decl(funcdecl.ts, 12, 31)) + +function withMultiParams(a : number, b, c: Object) { +>withMultiParams : Symbol(withMultiParams, Decl(funcdecl.ts, 17, 31)) +>a : Symbol(a, Decl(funcdecl.ts, 19, 25)) +>b : Symbol(b, Decl(funcdecl.ts, 19, 36)) +>c : Symbol(c, Decl(funcdecl.ts, 19, 39)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + return a; +>a : Symbol(a, Decl(funcdecl.ts, 19, 25)) +} +var withMultiParamsVar = withMultiParams; +>withMultiParamsVar : Symbol(withMultiParamsVar, Decl(funcdecl.ts, 22, 3)) +>withMultiParams : Symbol(withMultiParams, Decl(funcdecl.ts, 17, 31)) + +function withOptionalParams(a?: string) { +>withOptionalParams : Symbol(withOptionalParams, Decl(funcdecl.ts, 22, 41)) +>a : Symbol(a, Decl(funcdecl.ts, 24, 28)) +} +var withOptionalParamsVar = withOptionalParams; +>withOptionalParamsVar : Symbol(withOptionalParamsVar, Decl(funcdecl.ts, 26, 3)) +>withOptionalParams : Symbol(withOptionalParams, Decl(funcdecl.ts, 22, 41)) + +function withInitializedParams(a: string, b0, b = 30, c = "string value") { +>withInitializedParams : Symbol(withInitializedParams, Decl(funcdecl.ts, 26, 47)) +>a : Symbol(a, Decl(funcdecl.ts, 28, 31)) +>b0 : Symbol(b0, Decl(funcdecl.ts, 28, 41)) +>b : Symbol(b, Decl(funcdecl.ts, 28, 45)) +>c : Symbol(c, Decl(funcdecl.ts, 28, 53)) +} +var withInitializedParamsVar = withInitializedParams; +>withInitializedParamsVar : Symbol(withInitializedParamsVar, Decl(funcdecl.ts, 30, 3)) +>withInitializedParams : Symbol(withInitializedParams, Decl(funcdecl.ts, 26, 47)) + +function withOptionalInitializedParams(a: string, c: string = "hello string") { +>withOptionalInitializedParams : Symbol(withOptionalInitializedParams, Decl(funcdecl.ts, 30, 53)) +>a : Symbol(a, Decl(funcdecl.ts, 32, 39)) +>c : Symbol(c, Decl(funcdecl.ts, 32, 49)) +} +var withOptionalInitializedParamsVar = withOptionalInitializedParams; +>withOptionalInitializedParamsVar : Symbol(withOptionalInitializedParamsVar, Decl(funcdecl.ts, 34, 3)) +>withOptionalInitializedParams : Symbol(withOptionalInitializedParams, Decl(funcdecl.ts, 30, 53)) + +function withRestParams(a: string, ... myRestParameter : number[]) { +>withRestParams : Symbol(withRestParams, Decl(funcdecl.ts, 34, 69)) +>a : Symbol(a, Decl(funcdecl.ts, 36, 24)) +>myRestParameter : Symbol(myRestParameter, Decl(funcdecl.ts, 36, 34)) + + return myRestParameter; +>myRestParameter : Symbol(myRestParameter, Decl(funcdecl.ts, 36, 34)) +} +var withRestParamsVar = withRestParams; +>withRestParamsVar : Symbol(withRestParamsVar, Decl(funcdecl.ts, 39, 3)) +>withRestParams : Symbol(withRestParams, Decl(funcdecl.ts, 34, 69)) + +function overload1(n: number) : string; +>overload1 : Symbol(overload1, Decl(funcdecl.ts, 39, 39), Decl(funcdecl.ts, 41, 39), Decl(funcdecl.ts, 42, 39)) +>n : Symbol(n, Decl(funcdecl.ts, 41, 19)) + +function overload1(s: string) : string; +>overload1 : Symbol(overload1, Decl(funcdecl.ts, 39, 39), Decl(funcdecl.ts, 41, 39), Decl(funcdecl.ts, 42, 39)) +>s : Symbol(s, Decl(funcdecl.ts, 42, 19)) + +function overload1(ns: any) { +>overload1 : Symbol(overload1, Decl(funcdecl.ts, 39, 39), Decl(funcdecl.ts, 41, 39), Decl(funcdecl.ts, 42, 39)) +>ns : Symbol(ns, Decl(funcdecl.ts, 43, 19)) + + return ns.toString(); +>ns : Symbol(ns, Decl(funcdecl.ts, 43, 19)) +} +var withOverloadSignature = overload1; +>withOverloadSignature : Symbol(withOverloadSignature, Decl(funcdecl.ts, 46, 3)) +>overload1 : Symbol(overload1, Decl(funcdecl.ts, 39, 39), Decl(funcdecl.ts, 41, 39), Decl(funcdecl.ts, 42, 39)) + +function f(n: () => void) { } +>f : Symbol(f, Decl(funcdecl.ts, 46, 38)) +>n : Symbol(n, Decl(funcdecl.ts, 48, 11)) + +module m2 { +>m2 : Symbol(m2, Decl(funcdecl.ts, 48, 29)) + + export function foo(n: () => void ) { +>foo : Symbol(foo, Decl(funcdecl.ts, 50, 11)) +>n : Symbol(n, Decl(funcdecl.ts, 51, 24)) + } + +} + +m2.foo(() => { +>m2.foo : Symbol(m2.foo, Decl(funcdecl.ts, 50, 11)) +>m2 : Symbol(m2, Decl(funcdecl.ts, 48, 29)) +>foo : Symbol(m2.foo, Decl(funcdecl.ts, 50, 11)) + + var b = 30; +>b : Symbol(b, Decl(funcdecl.ts, 58, 7)) + + return b; +>b : Symbol(b, Decl(funcdecl.ts, 58, 7)) + +}); + + +declare function fooAmbient(n: number): string; +>fooAmbient : Symbol(fooAmbient, Decl(funcdecl.ts, 60, 3)) +>n : Symbol(n, Decl(funcdecl.ts, 63, 28)) + +declare function overloadAmbient(n: number): string; +>overloadAmbient : Symbol(overloadAmbient, Decl(funcdecl.ts, 63, 47), Decl(funcdecl.ts, 65, 52)) +>n : Symbol(n, Decl(funcdecl.ts, 65, 33)) + +declare function overloadAmbient(s: string): string; +>overloadAmbient : Symbol(overloadAmbient, Decl(funcdecl.ts, 63, 47), Decl(funcdecl.ts, 65, 52)) +>s : Symbol(s, Decl(funcdecl.ts, 66, 33)) + +var f2 = () => { +>f2 : Symbol(f2, Decl(funcdecl.ts, 68, 3)) + + return "string"; +} diff --git a/tests/baselines/reference/funcdecl.types b/tests/baselines/reference/funcdecl.types index bbfd14bd220..94c310d7b25 100644 --- a/tests/baselines/reference/funcdecl.types +++ b/tests/baselines/reference/funcdecl.types @@ -3,6 +3,7 @@ function simpleFunc() { >simpleFunc : () => string return "this is my simple func"; +>"this is my simple func" : string } var simpleFuncVar = simpleFunc; >simpleFuncVar : () => string @@ -19,6 +20,7 @@ function withReturn() : string{ >withReturn : () => string return "Hello"; +>"Hello" : string } var withReturnVar = withReturn; >withReturnVar : () => string @@ -62,7 +64,9 @@ function withInitializedParams(a: string, b0, b = 30, c = "string value") { >a : string >b0 : any >b : number +>30 : number >c : string +>"string value" : string } var withInitializedParamsVar = withInitializedParams; >withInitializedParamsVar : (a: string, b0: any, b?: number, c?: string) => void @@ -72,6 +76,7 @@ function withOptionalInitializedParams(a: string, c: string = "hello string") { >withOptionalInitializedParams : (a: string, c?: string) => void >a : string >c : string +>"hello string" : string } var withOptionalInitializedParamsVar = withOptionalInitializedParams; >withOptionalInitializedParamsVar : (a: string, c?: string) => void @@ -134,6 +139,7 @@ m2.foo(() => { var b = 30; >b : number +>30 : number return b; >b : number @@ -158,4 +164,5 @@ var f2 = () => { >() => { return "string";} : () => string return "string"; +>"string" : string } diff --git a/tests/baselines/reference/functionAssignmentError.symbols b/tests/baselines/reference/functionAssignmentError.symbols new file mode 100644 index 00000000000..b0d57ac4102 --- /dev/null +++ b/tests/baselines/reference/functionAssignmentError.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/functionAssignmentError.ts === +var func = function (){return "ONE";}; +>func : Symbol(func, Decl(functionAssignmentError.ts, 0, 3)) + +func = function (){return "ONE";}; +>func : Symbol(func, Decl(functionAssignmentError.ts, 0, 3)) + diff --git a/tests/baselines/reference/functionAssignmentError.types b/tests/baselines/reference/functionAssignmentError.types index 63996db0e40..6430aa10fc4 100644 --- a/tests/baselines/reference/functionAssignmentError.types +++ b/tests/baselines/reference/functionAssignmentError.types @@ -2,9 +2,11 @@ var func = function (){return "ONE";}; >func : () => string >function (){return "ONE";} : () => string +>"ONE" : string func = function (){return "ONE";}; >func = function (){return "ONE";} : () => string >func : () => string >function (){return "ONE";} : () => string +>"ONE" : string diff --git a/tests/baselines/reference/functionCall1.symbols b/tests/baselines/reference/functionCall1.symbols new file mode 100644 index 00000000000..522a2bae5f2 --- /dev/null +++ b/tests/baselines/reference/functionCall1.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/functionCall1.ts === +function foo():any{return ""}; +>foo : Symbol(foo, Decl(functionCall1.ts, 0, 0)) + +var x = foo(); +>x : Symbol(x, Decl(functionCall1.ts, 1, 3)) +>foo : Symbol(foo, Decl(functionCall1.ts, 0, 0)) + diff --git a/tests/baselines/reference/functionCall1.types b/tests/baselines/reference/functionCall1.types index 1b06379860c..777fcd79f91 100644 --- a/tests/baselines/reference/functionCall1.types +++ b/tests/baselines/reference/functionCall1.types @@ -1,6 +1,7 @@ === tests/cases/compiler/functionCall1.ts === function foo():any{return ""}; >foo : () => any +>"" : string var x = foo(); >x : any diff --git a/tests/baselines/reference/functionCall2.symbols b/tests/baselines/reference/functionCall2.symbols new file mode 100644 index 00000000000..91f5a3127cd --- /dev/null +++ b/tests/baselines/reference/functionCall2.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/functionCall2.ts === +function foo():number{return 1}; +>foo : Symbol(foo, Decl(functionCall2.ts, 0, 0)) + +var x = foo(); +>x : Symbol(x, Decl(functionCall2.ts, 1, 3)) +>foo : Symbol(foo, Decl(functionCall2.ts, 0, 0)) + diff --git a/tests/baselines/reference/functionCall2.types b/tests/baselines/reference/functionCall2.types index 92bb0f0be23..152d54cb186 100644 --- a/tests/baselines/reference/functionCall2.types +++ b/tests/baselines/reference/functionCall2.types @@ -1,6 +1,7 @@ === tests/cases/compiler/functionCall2.ts === function foo():number{return 1}; >foo : () => number +>1 : number var x = foo(); >x : number diff --git a/tests/baselines/reference/functionCall3.symbols b/tests/baselines/reference/functionCall3.symbols new file mode 100644 index 00000000000..bd16e3e543e --- /dev/null +++ b/tests/baselines/reference/functionCall3.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/functionCall3.ts === +function foo():any[]{return [1];} +>foo : Symbol(foo, Decl(functionCall3.ts, 0, 0)) + +var x = foo(); +>x : Symbol(x, Decl(functionCall3.ts, 1, 3)) +>foo : Symbol(foo, Decl(functionCall3.ts, 0, 0)) + diff --git a/tests/baselines/reference/functionCall3.types b/tests/baselines/reference/functionCall3.types index ea47de3e6d9..b58803ae666 100644 --- a/tests/baselines/reference/functionCall3.types +++ b/tests/baselines/reference/functionCall3.types @@ -2,6 +2,7 @@ function foo():any[]{return [1];} >foo : () => any[] >[1] : number[] +>1 : number var x = foo(); >x : any[] diff --git a/tests/baselines/reference/functionCall4.symbols b/tests/baselines/reference/functionCall4.symbols new file mode 100644 index 00000000000..2eee1fbbab5 --- /dev/null +++ b/tests/baselines/reference/functionCall4.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/functionCall4.ts === +function foo():any{return ""}; +>foo : Symbol(foo, Decl(functionCall4.ts, 0, 0)) + +function bar():()=>any{return foo}; +>bar : Symbol(bar, Decl(functionCall4.ts, 0, 30)) +>foo : Symbol(foo, Decl(functionCall4.ts, 0, 0)) + +var x = bar(); +>x : Symbol(x, Decl(functionCall4.ts, 2, 3)) +>bar : Symbol(bar, Decl(functionCall4.ts, 0, 30)) + diff --git a/tests/baselines/reference/functionCall4.types b/tests/baselines/reference/functionCall4.types index 37a0b980a00..ea60c759a7d 100644 --- a/tests/baselines/reference/functionCall4.types +++ b/tests/baselines/reference/functionCall4.types @@ -1,6 +1,7 @@ === tests/cases/compiler/functionCall4.ts === function foo():any{return ""}; >foo : () => any +>"" : string function bar():()=>any{return foo}; >bar : () => () => any diff --git a/tests/baselines/reference/functionCall5.symbols b/tests/baselines/reference/functionCall5.symbols new file mode 100644 index 00000000000..de166231204 --- /dev/null +++ b/tests/baselines/reference/functionCall5.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/functionCall5.ts === +module m1 { export class c1 { public a; }} +>m1 : Symbol(m1, Decl(functionCall5.ts, 0, 0)) +>c1 : Symbol(c1, Decl(functionCall5.ts, 0, 11)) +>a : Symbol(a, Decl(functionCall5.ts, 0, 29)) + +function foo():m1.c1{return new m1.c1();}; +>foo : Symbol(foo, Decl(functionCall5.ts, 0, 42)) +>m1 : Symbol(m1, Decl(functionCall5.ts, 0, 0)) +>c1 : Symbol(m1.c1, Decl(functionCall5.ts, 0, 11)) +>m1.c1 : Symbol(m1.c1, Decl(functionCall5.ts, 0, 11)) +>m1 : Symbol(m1, Decl(functionCall5.ts, 0, 0)) +>c1 : Symbol(m1.c1, Decl(functionCall5.ts, 0, 11)) + +var x = foo(); +>x : Symbol(x, Decl(functionCall5.ts, 2, 3)) +>foo : Symbol(foo, Decl(functionCall5.ts, 0, 42)) + diff --git a/tests/baselines/reference/functionCall5.types b/tests/baselines/reference/functionCall5.types index e5578ef3c34..b55150fc1a7 100644 --- a/tests/baselines/reference/functionCall5.types +++ b/tests/baselines/reference/functionCall5.types @@ -6,7 +6,7 @@ module m1 { export class c1 { public a; }} function foo():m1.c1{return new m1.c1();}; >foo : () => m1.c1 ->m1 : unknown +>m1 : any >c1 : m1.c1 >new m1.c1() : m1.c1 >m1.c1 : typeof m1.c1 diff --git a/tests/baselines/reference/functionConstraintSatisfaction.symbols b/tests/baselines/reference/functionConstraintSatisfaction.symbols new file mode 100644 index 00000000000..eb71bb78e25 --- /dev/null +++ b/tests/baselines/reference/functionConstraintSatisfaction.symbols @@ -0,0 +1,227 @@ +=== tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction.ts === +// satisfaction of a constraint to Function, no errors expected + +function foo(x: T): T { return x; } +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 2, 13)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 2, 33)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 2, 13)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 2, 13)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 2, 33)) + +interface I { +>I : Symbol(I, Decl(functionConstraintSatisfaction.ts, 2, 55)) + + (): string; +} +var i: I; +>i : Symbol(i, Decl(functionConstraintSatisfaction.ts, 7, 3)) +>I : Symbol(I, Decl(functionConstraintSatisfaction.ts, 2, 55)) + +class C { +>C : Symbol(C, Decl(functionConstraintSatisfaction.ts, 7, 9)) + + foo: string; +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 9, 9)) +} + +var a: { (): string }; +>a : Symbol(a, Decl(functionConstraintSatisfaction.ts, 13, 3)) + +var b: { new (): string }; +>b : Symbol(b, Decl(functionConstraintSatisfaction.ts, 14, 3)) + +var c: { (): string; (x): string }; +>c : Symbol(c, Decl(functionConstraintSatisfaction.ts, 15, 3)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 15, 22)) + +var r = foo(new Function()); +>r : Symbol(r, Decl(functionConstraintSatisfaction.ts, 17, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) + +var r1 = foo((x) => x); +>r1 : Symbol(r1, Decl(functionConstraintSatisfaction.ts, 18, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 18, 14)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 18, 14)) + +var r2 = foo((x: string[]) => x); +>r2 : Symbol(r2, Decl(functionConstraintSatisfaction.ts, 19, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 19, 14)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 19, 14)) + +var r3 = foo(function (x) { return x }); +>r3 : Symbol(r3, Decl(functionConstraintSatisfaction.ts, 20, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 20, 23)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 20, 23)) + +var r4 = foo(function (x: string[]) { return x }); +>r4 : Symbol(r4, Decl(functionConstraintSatisfaction.ts, 21, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 21, 23)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 21, 23)) + +var r5 = foo(i); +>r5 : Symbol(r5, Decl(functionConstraintSatisfaction.ts, 22, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>i : Symbol(i, Decl(functionConstraintSatisfaction.ts, 7, 3)) + +var r6 = foo(C); +>r6 : Symbol(r6, Decl(functionConstraintSatisfaction.ts, 23, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>C : Symbol(C, Decl(functionConstraintSatisfaction.ts, 7, 9)) + +var r7 = foo(b); +>r7 : Symbol(r7, Decl(functionConstraintSatisfaction.ts, 24, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>b : Symbol(b, Decl(functionConstraintSatisfaction.ts, 14, 3)) + +var r8 = foo(c); +>r8 : Symbol(r8, Decl(functionConstraintSatisfaction.ts, 25, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>c : Symbol(c, Decl(functionConstraintSatisfaction.ts, 15, 3)) + +interface I2 { +>I2 : Symbol(I2, Decl(functionConstraintSatisfaction.ts, 25, 16)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 27, 13)) + + (x: T): T; +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 28, 5)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 27, 13)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 27, 13)) +} +var i2: I2; +>i2 : Symbol(i2, Decl(functionConstraintSatisfaction.ts, 30, 3)) +>I2 : Symbol(I2, Decl(functionConstraintSatisfaction.ts, 25, 16)) + +class C2 { +>C2 : Symbol(C2, Decl(functionConstraintSatisfaction.ts, 30, 19)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 32, 9)) + + foo: T; +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 32, 13)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 32, 9)) +} + +var a2: { (x: T): T }; +>a2 : Symbol(a2, Decl(functionConstraintSatisfaction.ts, 36, 3)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 36, 11)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 36, 14)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 36, 11)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 36, 11)) + +var b2: { new (x: T): T }; +>b2 : Symbol(b2, Decl(functionConstraintSatisfaction.ts, 37, 3)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 37, 15)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 37, 18)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 37, 15)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 37, 15)) + +var c2: { (x: T): T; (x: T, y: T): T }; +>c2 : Symbol(c2, Decl(functionConstraintSatisfaction.ts, 38, 3)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 38, 11)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 38, 14)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 38, 11)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 38, 11)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 38, 25)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 38, 28)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 38, 25)) +>y : Symbol(y, Decl(functionConstraintSatisfaction.ts, 38, 33)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 38, 25)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 38, 25)) + +var r9 = foo((x: U) => x); +>r9 : Symbol(r9, Decl(functionConstraintSatisfaction.ts, 40, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>U : Symbol(U, Decl(functionConstraintSatisfaction.ts, 40, 14)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 40, 17)) +>U : Symbol(U, Decl(functionConstraintSatisfaction.ts, 40, 14)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 40, 17)) + +var r10 = foo(function (x: U) { return x; }); +>r10 : Symbol(r10, Decl(functionConstraintSatisfaction.ts, 41, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>U : Symbol(U, Decl(functionConstraintSatisfaction.ts, 41, 24)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 41, 27)) +>U : Symbol(U, Decl(functionConstraintSatisfaction.ts, 41, 24)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 41, 27)) + +var r11 = foo((x: U) => x); +>r11 : Symbol(r11, Decl(functionConstraintSatisfaction.ts, 42, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>U : Symbol(U, Decl(functionConstraintSatisfaction.ts, 42, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 42, 31)) +>U : Symbol(U, Decl(functionConstraintSatisfaction.ts, 42, 15)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 42, 31)) + +var r12 = foo((x: U, y: V) => x); +>r12 : Symbol(r12, Decl(functionConstraintSatisfaction.ts, 43, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>U : Symbol(U, Decl(functionConstraintSatisfaction.ts, 43, 15)) +>V : Symbol(V, Decl(functionConstraintSatisfaction.ts, 43, 17)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 43, 21)) +>U : Symbol(U, Decl(functionConstraintSatisfaction.ts, 43, 15)) +>y : Symbol(y, Decl(functionConstraintSatisfaction.ts, 43, 26)) +>V : Symbol(V, Decl(functionConstraintSatisfaction.ts, 43, 17)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 43, 21)) + +var r13 = foo(i2); +>r13 : Symbol(r13, Decl(functionConstraintSatisfaction.ts, 44, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>i2 : Symbol(i2, Decl(functionConstraintSatisfaction.ts, 30, 3)) + +var r14 = foo(C2); +>r14 : Symbol(r14, Decl(functionConstraintSatisfaction.ts, 45, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>C2 : Symbol(C2, Decl(functionConstraintSatisfaction.ts, 30, 19)) + +var r15 = foo(b2); +>r15 : Symbol(r15, Decl(functionConstraintSatisfaction.ts, 46, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>b2 : Symbol(b2, Decl(functionConstraintSatisfaction.ts, 37, 3)) + +var r16 = foo(c2); +>r16 : Symbol(r16, Decl(functionConstraintSatisfaction.ts, 47, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>c2 : Symbol(c2, Decl(functionConstraintSatisfaction.ts, 38, 3)) + +interface F2 extends Function { foo: string; } +>F2 : Symbol(F2, Decl(functionConstraintSatisfaction.ts, 47, 18)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 49, 31)) + +var f2: F2; +>f2 : Symbol(f2, Decl(functionConstraintSatisfaction.ts, 50, 3)) +>F2 : Symbol(F2, Decl(functionConstraintSatisfaction.ts, 47, 18)) + +var r17 = foo(f2); +>r17 : Symbol(r17, Decl(functionConstraintSatisfaction.ts, 51, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>f2 : Symbol(f2, Decl(functionConstraintSatisfaction.ts, 50, 3)) + +function foo2(x: T, y: U) { +>foo2 : Symbol(foo2, Decl(functionConstraintSatisfaction.ts, 51, 18)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 53, 14)) +>U : Symbol(U, Decl(functionConstraintSatisfaction.ts, 53, 37)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 53, 62)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 53, 14)) +>y : Symbol(y, Decl(functionConstraintSatisfaction.ts, 53, 67)) +>U : Symbol(U, Decl(functionConstraintSatisfaction.ts, 53, 37)) + + foo(x); +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 53, 62)) + + foo(y); +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>y : Symbol(y, Decl(functionConstraintSatisfaction.ts, 53, 67)) +} +//function foo2(x: T, y: U) { +// foo(x); +// foo(y); +//} diff --git a/tests/baselines/reference/functionConstraintSatisfaction3.symbols b/tests/baselines/reference/functionConstraintSatisfaction3.symbols new file mode 100644 index 00000000000..74f3a65aa8e --- /dev/null +++ b/tests/baselines/reference/functionConstraintSatisfaction3.symbols @@ -0,0 +1,147 @@ +=== tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction3.ts === +// satisfaction of a constraint to Function, no errors expected + +function foo string>(x: T): T { return x; } +>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 2, 13)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 2, 24)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 2, 46)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 2, 13)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 2, 13)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 2, 46)) + +interface I { +>I : Symbol(I, Decl(functionConstraintSatisfaction3.ts, 2, 68)) + + (): string; +} +var i: I; +>i : Symbol(i, Decl(functionConstraintSatisfaction3.ts, 7, 3)) +>I : Symbol(I, Decl(functionConstraintSatisfaction3.ts, 2, 68)) + +class C { +>C : Symbol(C, Decl(functionConstraintSatisfaction3.ts, 7, 9)) + + foo: string; +>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 9, 9)) +} + +var a: { (): string }; +>a : Symbol(a, Decl(functionConstraintSatisfaction3.ts, 13, 3)) + +var b: { new (): string }; +>b : Symbol(b, Decl(functionConstraintSatisfaction3.ts, 14, 3)) + +var c: { (): string; (x): string }; +>c : Symbol(c, Decl(functionConstraintSatisfaction3.ts, 15, 3)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 15, 22)) + +var r1 = foo((x) => x); +>r1 : Symbol(r1, Decl(functionConstraintSatisfaction3.ts, 17, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 17, 14)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 17, 14)) + +var r2 = foo((x: string) => x); +>r2 : Symbol(r2, Decl(functionConstraintSatisfaction3.ts, 18, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 18, 14)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 18, 14)) + +var r3 = foo(function (x) { return x }); +>r3 : Symbol(r3, Decl(functionConstraintSatisfaction3.ts, 19, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 19, 23)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 19, 23)) + +var r4 = foo(function (x: string) { return x }); +>r4 : Symbol(r4, Decl(functionConstraintSatisfaction3.ts, 20, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 20, 23)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 20, 23)) + +var r5 = foo(i); +>r5 : Symbol(r5, Decl(functionConstraintSatisfaction3.ts, 21, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0)) +>i : Symbol(i, Decl(functionConstraintSatisfaction3.ts, 7, 3)) + +var r8 = foo(c); +>r8 : Symbol(r8, Decl(functionConstraintSatisfaction3.ts, 22, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0)) +>c : Symbol(c, Decl(functionConstraintSatisfaction3.ts, 15, 3)) + +interface I2 { +>I2 : Symbol(I2, Decl(functionConstraintSatisfaction3.ts, 22, 16)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 24, 13)) + + (x: T): T; +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 25, 5)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 24, 13)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 24, 13)) +} +var i2: I2; +>i2 : Symbol(i2, Decl(functionConstraintSatisfaction3.ts, 27, 3)) +>I2 : Symbol(I2, Decl(functionConstraintSatisfaction3.ts, 22, 16)) + +class C2 { +>C2 : Symbol(C2, Decl(functionConstraintSatisfaction3.ts, 27, 19)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 29, 9)) + + foo: T; +>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 29, 13)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 29, 9)) +} + +var a2: { (x: T): T }; +>a2 : Symbol(a2, Decl(functionConstraintSatisfaction3.ts, 33, 3)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 33, 11)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 33, 14)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 33, 11)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 33, 11)) + +var b2: { new (x: T): T }; +>b2 : Symbol(b2, Decl(functionConstraintSatisfaction3.ts, 34, 3)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 34, 15)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 34, 18)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 34, 15)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 34, 15)) + +var c2: { (x: T): T; (x: T, y: T): T }; +>c2 : Symbol(c2, Decl(functionConstraintSatisfaction3.ts, 35, 3)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 35, 11)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 35, 14)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 35, 11)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 35, 11)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 35, 25)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 35, 28)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 35, 25)) +>y : Symbol(y, Decl(functionConstraintSatisfaction3.ts, 35, 33)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 35, 25)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 35, 25)) + +var r9 = foo(function (x: U) { return x; }); +>r9 : Symbol(r9, Decl(functionConstraintSatisfaction3.ts, 37, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0)) +>U : Symbol(U, Decl(functionConstraintSatisfaction3.ts, 37, 23)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 37, 26)) +>U : Symbol(U, Decl(functionConstraintSatisfaction3.ts, 37, 23)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 37, 26)) + +var r10 = foo((x: U) => x); +>r10 : Symbol(r10, Decl(functionConstraintSatisfaction3.ts, 38, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0)) +>U : Symbol(U, Decl(functionConstraintSatisfaction3.ts, 38, 15)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 38, 33)) +>U : Symbol(U, Decl(functionConstraintSatisfaction3.ts, 38, 15)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 38, 33)) + +var r12 = foo(i2); +>r12 : Symbol(r12, Decl(functionConstraintSatisfaction3.ts, 39, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0)) +>i2 : Symbol(i2, Decl(functionConstraintSatisfaction3.ts, 27, 3)) + +var r15 = foo(c2); +>r15 : Symbol(r15, Decl(functionConstraintSatisfaction3.ts, 40, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0)) +>c2 : Symbol(c2, Decl(functionConstraintSatisfaction3.ts, 35, 3)) + diff --git a/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.symbols b/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.symbols new file mode 100644 index 00000000000..cf504147346 --- /dev/null +++ b/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/functionDeclarationWithArgumentOfTypeFunctionTypeArray.ts === +function foo(args: { (x): number }[]) { +>foo : Symbol(foo, Decl(functionDeclarationWithArgumentOfTypeFunctionTypeArray.ts, 0, 0)) +>args : Symbol(args, Decl(functionDeclarationWithArgumentOfTypeFunctionTypeArray.ts, 0, 13)) +>x : Symbol(x, Decl(functionDeclarationWithArgumentOfTypeFunctionTypeArray.ts, 0, 22)) + + return args.length; +>args.length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>args : Symbol(args, Decl(functionDeclarationWithArgumentOfTypeFunctionTypeArray.ts, 0, 13)) +>length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +} + diff --git a/tests/baselines/reference/functionExpressionAndLambdaMatchesFunction.symbols b/tests/baselines/reference/functionExpressionAndLambdaMatchesFunction.symbols new file mode 100644 index 00000000000..db66aa5618b --- /dev/null +++ b/tests/baselines/reference/functionExpressionAndLambdaMatchesFunction.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/functionExpressionAndLambdaMatchesFunction.ts === +class CDoc { +>CDoc : Symbol(CDoc, Decl(functionExpressionAndLambdaMatchesFunction.ts, 0, 0)) + + constructor() { + function doSomething(a: Function) { +>doSomething : Symbol(doSomething, Decl(functionExpressionAndLambdaMatchesFunction.ts, 1, 23)) +>a : Symbol(a, Decl(functionExpressionAndLambdaMatchesFunction.ts, 2, 29)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) + } + doSomething(() => undefined); +>doSomething : Symbol(doSomething, Decl(functionExpressionAndLambdaMatchesFunction.ts, 1, 23)) +>undefined : Symbol(undefined) + + doSomething(function () { }); +>doSomething : Symbol(doSomething, Decl(functionExpressionAndLambdaMatchesFunction.ts, 1, 23)) + } +} + diff --git a/tests/baselines/reference/functionExpressionReturningItself.symbols b/tests/baselines/reference/functionExpressionReturningItself.symbols new file mode 100644 index 00000000000..ba4d29f275a --- /dev/null +++ b/tests/baselines/reference/functionExpressionReturningItself.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/functionExpressionReturningItself.ts === +var x = function somefn() { return somefn; }; +>x : Symbol(x, Decl(functionExpressionReturningItself.ts, 0, 3)) +>somefn : Symbol(somefn, Decl(functionExpressionReturningItself.ts, 0, 7)) +>somefn : Symbol(somefn, Decl(functionExpressionReturningItself.ts, 0, 7)) + diff --git a/tests/baselines/reference/functionImplementations.symbols b/tests/baselines/reference/functionImplementations.symbols new file mode 100644 index 00000000000..f9205f37650 --- /dev/null +++ b/tests/baselines/reference/functionImplementations.symbols @@ -0,0 +1,344 @@ +=== tests/cases/conformance/functions/functionImplementations.ts === +// FunctionExpression with no return type annotation and no return statement returns void +var v: void = function () { } (); +>v : Symbol(v, Decl(functionImplementations.ts, 1, 3)) + +// FunctionExpression f with no return type annotation and directly references f in its body returns any +var a: any = function f() { +>a : Symbol(a, Decl(functionImplementations.ts, 4, 3), Decl(functionImplementations.ts, 7, 3), Decl(functionImplementations.ts, 12, 3), Decl(functionImplementations.ts, 24, 3), Decl(functionImplementations.ts, 25, 3), Decl(functionImplementations.ts, 84, 3)) +>f : Symbol(f, Decl(functionImplementations.ts, 4, 12)) + + return f; +>f : Symbol(f, Decl(functionImplementations.ts, 4, 12)) + +}; +var a: any = function f() { +>a : Symbol(a, Decl(functionImplementations.ts, 4, 3), Decl(functionImplementations.ts, 7, 3), Decl(functionImplementations.ts, 12, 3), Decl(functionImplementations.ts, 24, 3), Decl(functionImplementations.ts, 25, 3), Decl(functionImplementations.ts, 84, 3)) +>f : Symbol(f, Decl(functionImplementations.ts, 7, 12)) + + return f(); +>f : Symbol(f, Decl(functionImplementations.ts, 7, 12)) + +}; + +// FunctionExpression f with no return type annotation and indirectly references f in its body returns any +var a: any = function f() { +>a : Symbol(a, Decl(functionImplementations.ts, 4, 3), Decl(functionImplementations.ts, 7, 3), Decl(functionImplementations.ts, 12, 3), Decl(functionImplementations.ts, 24, 3), Decl(functionImplementations.ts, 25, 3), Decl(functionImplementations.ts, 84, 3)) +>f : Symbol(f, Decl(functionImplementations.ts, 12, 12)) + + var x = f; +>x : Symbol(x, Decl(functionImplementations.ts, 13, 7)) +>f : Symbol(f, Decl(functionImplementations.ts, 12, 12)) + + return x; +>x : Symbol(x, Decl(functionImplementations.ts, 13, 7)) + +}; + +// Two mutually recursive function implementations with no return type annotations +function rec1() { +>rec1 : Symbol(rec1, Decl(functionImplementations.ts, 15, 2)) + + return rec2(); +>rec2 : Symbol(rec2, Decl(functionImplementations.ts, 20, 1)) +} +function rec2() { +>rec2 : Symbol(rec2, Decl(functionImplementations.ts, 20, 1)) + + return rec1(); +>rec1 : Symbol(rec1, Decl(functionImplementations.ts, 15, 2)) +} +var a = rec1(); +>a : Symbol(a, Decl(functionImplementations.ts, 4, 3), Decl(functionImplementations.ts, 7, 3), Decl(functionImplementations.ts, 12, 3), Decl(functionImplementations.ts, 24, 3), Decl(functionImplementations.ts, 25, 3), Decl(functionImplementations.ts, 84, 3)) +>rec1 : Symbol(rec1, Decl(functionImplementations.ts, 15, 2)) + +var a = rec2(); +>a : Symbol(a, Decl(functionImplementations.ts, 4, 3), Decl(functionImplementations.ts, 7, 3), Decl(functionImplementations.ts, 12, 3), Decl(functionImplementations.ts, 24, 3), Decl(functionImplementations.ts, 25, 3), Decl(functionImplementations.ts, 84, 3)) +>rec2 : Symbol(rec2, Decl(functionImplementations.ts, 20, 1)) + +// Two mutually recursive function implementations with return type annotation in one +function rec3(): number { +>rec3 : Symbol(rec3, Decl(functionImplementations.ts, 25, 15)) + + return rec4(); +>rec4 : Symbol(rec4, Decl(functionImplementations.ts, 30, 1)) +} +function rec4() { +>rec4 : Symbol(rec4, Decl(functionImplementations.ts, 30, 1)) + + return rec3(); +>rec3 : Symbol(rec3, Decl(functionImplementations.ts, 25, 15)) +} +var n: number; +>n : Symbol(n, Decl(functionImplementations.ts, 34, 3), Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 39, 3), Decl(functionImplementations.ts, 56, 3), Decl(functionImplementations.ts, 61, 3), Decl(functionImplementations.ts, 66, 3)) + +var n = rec3(); +>n : Symbol(n, Decl(functionImplementations.ts, 34, 3), Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 39, 3), Decl(functionImplementations.ts, 56, 3), Decl(functionImplementations.ts, 61, 3), Decl(functionImplementations.ts, 66, 3)) +>rec3 : Symbol(rec3, Decl(functionImplementations.ts, 25, 15)) + +var n = rec4(); +>n : Symbol(n, Decl(functionImplementations.ts, 34, 3), Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 39, 3), Decl(functionImplementations.ts, 56, 3), Decl(functionImplementations.ts, 61, 3), Decl(functionImplementations.ts, 66, 3)) +>rec4 : Symbol(rec4, Decl(functionImplementations.ts, 30, 1)) + +// FunctionExpression with no return type annotation and returns a number +var n = function () { +>n : Symbol(n, Decl(functionImplementations.ts, 34, 3), Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 39, 3), Decl(functionImplementations.ts, 56, 3), Decl(functionImplementations.ts, 61, 3), Decl(functionImplementations.ts, 66, 3)) + + return 3; +} (); + +// FunctionExpression with no return type annotation and returns null +var nu = null; +>nu : Symbol(nu, Decl(functionImplementations.ts, 44, 3), Decl(functionImplementations.ts, 45, 3)) + +var nu = function () { +>nu : Symbol(nu, Decl(functionImplementations.ts, 44, 3), Decl(functionImplementations.ts, 45, 3)) + + return null; +} (); + +// FunctionExpression with no return type annotation and returns undefined +var un = undefined; +>un : Symbol(un, Decl(functionImplementations.ts, 50, 3), Decl(functionImplementations.ts, 51, 3)) +>undefined : Symbol(undefined) + +var un = function () { +>un : Symbol(un, Decl(functionImplementations.ts, 50, 3), Decl(functionImplementations.ts, 51, 3)) + + return undefined; +>undefined : Symbol(undefined) + +} (); + +// FunctionExpression with no return type annotation and returns a type parameter type +var n = function (x: T) { +>n : Symbol(n, Decl(functionImplementations.ts, 34, 3), Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 39, 3), Decl(functionImplementations.ts, 56, 3), Decl(functionImplementations.ts, 61, 3), Decl(functionImplementations.ts, 66, 3)) +>T : Symbol(T, Decl(functionImplementations.ts, 56, 18)) +>x : Symbol(x, Decl(functionImplementations.ts, 56, 21)) +>T : Symbol(T, Decl(functionImplementations.ts, 56, 18)) + + return x; +>x : Symbol(x, Decl(functionImplementations.ts, 56, 21)) + +} (4); + +// FunctionExpression with no return type annotation and returns a constrained type parameter type +var n = function (x: T) { +>n : Symbol(n, Decl(functionImplementations.ts, 34, 3), Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 39, 3), Decl(functionImplementations.ts, 56, 3), Decl(functionImplementations.ts, 61, 3), Decl(functionImplementations.ts, 66, 3)) +>T : Symbol(T, Decl(functionImplementations.ts, 61, 18)) +>x : Symbol(x, Decl(functionImplementations.ts, 61, 32)) +>T : Symbol(T, Decl(functionImplementations.ts, 61, 18)) + + return x; +>x : Symbol(x, Decl(functionImplementations.ts, 61, 32)) + +} (4); + +// FunctionExpression with no return type annotation with multiple return statements with identical types +var n = function () { +>n : Symbol(n, Decl(functionImplementations.ts, 34, 3), Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 39, 3), Decl(functionImplementations.ts, 56, 3), Decl(functionImplementations.ts, 61, 3), Decl(functionImplementations.ts, 66, 3)) + + return 3; + return 5; +}(); + +// Otherwise, the inferred return type is the first of the types of the return statement expressions +// in the function body that is a supertype of each of the others, +// ignoring return statements with no expressions. +// A compile - time error occurs if no return statement expression has a type that is a supertype of each of the others. +// FunctionExpression with no return type annotation with multiple return statements with subtype relation between returns +class Base { private m; } +>Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) +>m : Symbol(m, Decl(functionImplementations.ts, 76, 12)) + +class Derived extends Base { private q; } +>Derived : Symbol(Derived, Decl(functionImplementations.ts, 76, 25)) +>Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) +>q : Symbol(q, Decl(functionImplementations.ts, 77, 28)) + +var b: Base; +>b : Symbol(b, Decl(functionImplementations.ts, 78, 3), Decl(functionImplementations.ts, 79, 3)) +>Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) + +var b = function () { +>b : Symbol(b, Decl(functionImplementations.ts, 78, 3), Decl(functionImplementations.ts, 79, 3)) + + return new Base(); return new Derived(); +>Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) +>Derived : Symbol(Derived, Decl(functionImplementations.ts, 76, 25)) + +} (); + +// FunctionExpression with no return type annotation with multiple return statements with one a recursive call +var a = function f() { +>a : Symbol(a, Decl(functionImplementations.ts, 4, 3), Decl(functionImplementations.ts, 7, 3), Decl(functionImplementations.ts, 12, 3), Decl(functionImplementations.ts, 24, 3), Decl(functionImplementations.ts, 25, 3), Decl(functionImplementations.ts, 84, 3)) +>f : Symbol(f, Decl(functionImplementations.ts, 84, 7)) + + return new Base(); return new Derived(); return f(); // ? +>Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) +>Derived : Symbol(Derived, Decl(functionImplementations.ts, 76, 25)) +>f : Symbol(f, Decl(functionImplementations.ts, 84, 7)) + +} (); + +// FunctionExpression with non -void return type annotation with a single throw statement +undefined === function (): number { +>undefined : Symbol(undefined) + + throw undefined; +>undefined : Symbol(undefined) + +}; + +// Type of 'this' in function implementation is 'any' +function thisFunc() { +>thisFunc : Symbol(thisFunc, Decl(functionImplementations.ts, 91, 2)) + + var x = this; +>x : Symbol(x, Decl(functionImplementations.ts, 95, 7), Decl(functionImplementations.ts, 96, 7)) + + var x: any; +>x : Symbol(x, Decl(functionImplementations.ts, 95, 7), Decl(functionImplementations.ts, 96, 7)) +} + +// Function signature with optional parameter, no type annotation and initializer has initializer's type +function opt1(n = 4) { +>opt1 : Symbol(opt1, Decl(functionImplementations.ts, 97, 1)) +>n : Symbol(n, Decl(functionImplementations.ts, 100, 14)) + + var m = n; +>m : Symbol(m, Decl(functionImplementations.ts, 101, 7), Decl(functionImplementations.ts, 102, 7)) +>n : Symbol(n, Decl(functionImplementations.ts, 100, 14)) + + var m: number; +>m : Symbol(m, Decl(functionImplementations.ts, 101, 7), Decl(functionImplementations.ts, 102, 7)) +} + +// Function signature with optional parameter, no type annotation and initializer has initializer's widened type +function opt2(n = { x: null, y: undefined }) { +>opt2 : Symbol(opt2, Decl(functionImplementations.ts, 103, 1)) +>n : Symbol(n, Decl(functionImplementations.ts, 106, 14)) +>x : Symbol(x, Decl(functionImplementations.ts, 106, 19)) +>y : Symbol(y, Decl(functionImplementations.ts, 106, 28)) +>undefined : Symbol(undefined) + + var m = n; +>m : Symbol(m, Decl(functionImplementations.ts, 107, 7), Decl(functionImplementations.ts, 108, 7)) +>n : Symbol(n, Decl(functionImplementations.ts, 106, 14)) + + var m: { x: any; y: any }; +>m : Symbol(m, Decl(functionImplementations.ts, 107, 7), Decl(functionImplementations.ts, 108, 7)) +>x : Symbol(x, Decl(functionImplementations.ts, 108, 12)) +>y : Symbol(y, Decl(functionImplementations.ts, 108, 20)) +} + +// Function signature with initializer referencing other parameter to the left +function opt3(n: number, m = n) { +>opt3 : Symbol(opt3, Decl(functionImplementations.ts, 109, 1)) +>n : Symbol(n, Decl(functionImplementations.ts, 112, 14)) +>m : Symbol(m, Decl(functionImplementations.ts, 112, 24)) +>n : Symbol(n, Decl(functionImplementations.ts, 112, 14)) + + var y = m; +>y : Symbol(y, Decl(functionImplementations.ts, 113, 7), Decl(functionImplementations.ts, 114, 7)) +>m : Symbol(m, Decl(functionImplementations.ts, 112, 24)) + + var y: number; +>y : Symbol(y, Decl(functionImplementations.ts, 113, 7), Decl(functionImplementations.ts, 114, 7)) +} + +// Function signature with optional parameter has correct codegen +// (tested above) + +// FunctionExpression with non -void return type annotation return with no expression +function f6(): number { +>f6 : Symbol(f6, Decl(functionImplementations.ts, 115, 1)) + + return; +} + +class Derived2 extends Base { private r: string; } +>Derived2 : Symbol(Derived2, Decl(functionImplementations.ts, 123, 1)) +>Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) +>r : Symbol(r, Decl(functionImplementations.ts, 125, 29)) + +class AnotherClass { private x } +>AnotherClass : Symbol(AnotherClass, Decl(functionImplementations.ts, 125, 50)) +>x : Symbol(x, Decl(functionImplementations.ts, 126, 20)) + +// if f is a contextually typed function expression, the inferred return type is the union type +// of the types of the return statement expressions in the function body, +// ignoring return statements with no expressions. +var f7: (x: number) => string | number = x => { // should be (x: number) => number | string +>f7 : Symbol(f7, Decl(functionImplementations.ts, 130, 3)) +>x : Symbol(x, Decl(functionImplementations.ts, 130, 9)) +>x : Symbol(x, Decl(functionImplementations.ts, 130, 40)) + + if (x < 0) { return x; } +>x : Symbol(x, Decl(functionImplementations.ts, 130, 40)) +>x : Symbol(x, Decl(functionImplementations.ts, 130, 40)) + + return x.toString(); +>x.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>x : Symbol(x, Decl(functionImplementations.ts, 130, 40)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +} +var f8: (x: number) => any = x => { // should be (x: number) => Base +>f8 : Symbol(f8, Decl(functionImplementations.ts, 134, 3)) +>x : Symbol(x, Decl(functionImplementations.ts, 134, 9)) +>x : Symbol(x, Decl(functionImplementations.ts, 134, 28)) + + return new Base(); +>Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) + + return new Derived2(); +>Derived2 : Symbol(Derived2, Decl(functionImplementations.ts, 123, 1)) +} +var f9: (x: number) => any = x => { // should be (x: number) => Base +>f9 : Symbol(f9, Decl(functionImplementations.ts, 138, 3)) +>x : Symbol(x, Decl(functionImplementations.ts, 138, 9)) +>x : Symbol(x, Decl(functionImplementations.ts, 138, 28)) + + return new Base(); +>Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) + + return new Derived(); +>Derived : Symbol(Derived, Decl(functionImplementations.ts, 76, 25)) + + return new Derived2(); +>Derived2 : Symbol(Derived2, Decl(functionImplementations.ts, 123, 1)) +} +var f10: (x: number) => any = x => { // should be (x: number) => Derived | Derived1 +>f10 : Symbol(f10, Decl(functionImplementations.ts, 143, 3)) +>x : Symbol(x, Decl(functionImplementations.ts, 143, 10)) +>x : Symbol(x, Decl(functionImplementations.ts, 143, 29)) + + return new Derived(); +>Derived : Symbol(Derived, Decl(functionImplementations.ts, 76, 25)) + + return new Derived2(); +>Derived2 : Symbol(Derived2, Decl(functionImplementations.ts, 123, 1)) +} +var f11: (x: number) => any = x => { // should be (x: number) => Base | AnotherClass +>f11 : Symbol(f11, Decl(functionImplementations.ts, 147, 3)) +>x : Symbol(x, Decl(functionImplementations.ts, 147, 10)) +>x : Symbol(x, Decl(functionImplementations.ts, 147, 29)) + + return new Base(); +>Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) + + return new AnotherClass(); +>AnotherClass : Symbol(AnotherClass, Decl(functionImplementations.ts, 125, 50)) +} +var f12: (x: number) => any = x => { // should be (x: number) => Base | AnotherClass +>f12 : Symbol(f12, Decl(functionImplementations.ts, 151, 3)) +>x : Symbol(x, Decl(functionImplementations.ts, 151, 10)) +>x : Symbol(x, Decl(functionImplementations.ts, 151, 29)) + + return new Base(); +>Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) + + return; // should be ignored + return new AnotherClass(); +>AnotherClass : Symbol(AnotherClass, Decl(functionImplementations.ts, 125, 50)) +} diff --git a/tests/baselines/reference/functionImplementations.types b/tests/baselines/reference/functionImplementations.types index 04144e3a65b..f277821d696 100644 --- a/tests/baselines/reference/functionImplementations.types +++ b/tests/baselines/reference/functionImplementations.types @@ -101,11 +101,14 @@ var n = function () { >function () { return 3;} : () => number return 3; +>3 : number + } (); // FunctionExpression with no return type annotation and returns null var nu = null; >nu : any +>null : null var nu = function () { >nu : any @@ -113,6 +116,8 @@ var nu = function () { >function () { return null;} : () => any return null; +>null : null + } (); // FunctionExpression with no return type annotation and returns undefined @@ -143,6 +148,7 @@ var n = function (x: T) { >x : T } (4); +>4 : number // FunctionExpression with no return type annotation and returns a constrained type parameter type var n = function (x: T) { @@ -157,6 +163,7 @@ var n = function (x: T) { >x : T } (4); +>4 : number // FunctionExpression with no return type annotation with multiple return statements with identical types var n = function () { @@ -165,7 +172,11 @@ var n = function () { >function () { return 3; return 5;} : () => number return 3; +>3 : number + return 5; +>5 : number + }(); // Otherwise, the inferred return type is the first of the types of the return statement expressions @@ -243,6 +254,7 @@ function thisFunc() { function opt1(n = 4) { >opt1 : (n?: number) => void >n : number +>4 : number var m = n; >m : number @@ -258,6 +270,7 @@ function opt2(n = { x: null, y: undefined }) { >n : { x: any; y: any; } >{ x: null, y: undefined } : { x: null; y: undefined; } >x : null +>null : null >y : undefined >undefined : undefined @@ -317,6 +330,7 @@ var f7: (x: number) => string | number = x => { // should be (x: number) => numb if (x < 0) { return x; } >x < 0 : boolean >x : number +>0 : number >x : number return x.toString(); diff --git a/tests/baselines/reference/functionInIfStatementInModule.symbols b/tests/baselines/reference/functionInIfStatementInModule.symbols new file mode 100644 index 00000000000..5d297fceb4e --- /dev/null +++ b/tests/baselines/reference/functionInIfStatementInModule.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/functionInIfStatementInModule.ts === + +module Midori +>Midori : Symbol(Midori, Decl(functionInIfStatementInModule.ts, 0, 0)) +{ + if (false) { + function Foo(src) +>Foo : Symbol(Foo, Decl(functionInIfStatementInModule.ts, 3, 16)) +>src : Symbol(src, Decl(functionInIfStatementInModule.ts, 4, 21)) + { + } + } +} + diff --git a/tests/baselines/reference/functionInIfStatementInModule.types b/tests/baselines/reference/functionInIfStatementInModule.types index 773fd9c4186..11cdd80f0a1 100644 --- a/tests/baselines/reference/functionInIfStatementInModule.types +++ b/tests/baselines/reference/functionInIfStatementInModule.types @@ -4,6 +4,8 @@ module Midori >Midori : typeof Midori { if (false) { +>false : boolean + function Foo(src) >Foo : (src: any) => void >src : any diff --git a/tests/baselines/reference/functionLiteral.symbols b/tests/baselines/reference/functionLiteral.symbols new file mode 100644 index 00000000000..3a8a4cfbad7 --- /dev/null +++ b/tests/baselines/reference/functionLiteral.symbols @@ -0,0 +1,39 @@ +=== tests/cases/conformance/types/specifyingTypes/typeLiterals/functionLiteral.ts === +// basic valid forms of function literals + +var x = () => 1; +>x : Symbol(x, Decl(functionLiteral.ts, 2, 3), Decl(functionLiteral.ts, 3, 3)) + +var x: { +>x : Symbol(x, Decl(functionLiteral.ts, 2, 3), Decl(functionLiteral.ts, 3, 3)) + + (): number; +} + +var y: { (x: string): string; }; +>y : Symbol(y, Decl(functionLiteral.ts, 7, 3), Decl(functionLiteral.ts, 8, 3)) +>x : Symbol(x, Decl(functionLiteral.ts, 7, 10)) + +var y: (x: string) => string; +>y : Symbol(y, Decl(functionLiteral.ts, 7, 3), Decl(functionLiteral.ts, 8, 3)) +>x : Symbol(x, Decl(functionLiteral.ts, 8, 8)) + +var y2: { (x: T): T; } = (x: T) => x +>y2 : Symbol(y2, Decl(functionLiteral.ts, 9, 3)) +>T : Symbol(T, Decl(functionLiteral.ts, 9, 11)) +>x : Symbol(x, Decl(functionLiteral.ts, 9, 14)) +>T : Symbol(T, Decl(functionLiteral.ts, 9, 11)) +>T : Symbol(T, Decl(functionLiteral.ts, 9, 11)) +>T : Symbol(T, Decl(functionLiteral.ts, 9, 29)) +>x : Symbol(x, Decl(functionLiteral.ts, 9, 32)) +>T : Symbol(T, Decl(functionLiteral.ts, 9, 29)) +>x : Symbol(x, Decl(functionLiteral.ts, 9, 32)) + +var z: { new (x: number): number; }; +>z : Symbol(z, Decl(functionLiteral.ts, 11, 3), Decl(functionLiteral.ts, 12, 3)) +>x : Symbol(x, Decl(functionLiteral.ts, 11, 14)) + +var z: new (x: number) => number; +>z : Symbol(z, Decl(functionLiteral.ts, 11, 3), Decl(functionLiteral.ts, 12, 3)) +>x : Symbol(x, Decl(functionLiteral.ts, 12, 12)) + diff --git a/tests/baselines/reference/functionLiteral.types b/tests/baselines/reference/functionLiteral.types index 7a57f0b1e1b..06c811093c3 100644 --- a/tests/baselines/reference/functionLiteral.types +++ b/tests/baselines/reference/functionLiteral.types @@ -4,6 +4,7 @@ var x = () => 1; >x : () => number >() => 1 : () => number +>1 : number var x: { >x : () => number diff --git a/tests/baselines/reference/functionLiteralForOverloads.symbols b/tests/baselines/reference/functionLiteralForOverloads.symbols new file mode 100644 index 00000000000..205945b73ea --- /dev/null +++ b/tests/baselines/reference/functionLiteralForOverloads.symbols @@ -0,0 +1,65 @@ +=== tests/cases/conformance/types/specifyingTypes/typeLiterals/functionLiteralForOverloads.ts === +// basic uses of function literals with overloads + +var f: { +>f : Symbol(f, Decl(functionLiteralForOverloads.ts, 2, 3)) + + (x: string): string; +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 3, 5)) + + (x: number): number; +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 4, 5)) + +} = (x) => x; +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 5, 5)) +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 5, 5)) + +var f2: { +>f2 : Symbol(f2, Decl(functionLiteralForOverloads.ts, 7, 3)) + + (x: string): string; +>T : Symbol(T, Decl(functionLiteralForOverloads.ts, 8, 5)) +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 8, 8)) + + (x: number): number; +>T : Symbol(T, Decl(functionLiteralForOverloads.ts, 9, 5)) +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 9, 8)) + +} = (x) => x; +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 10, 5)) +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 10, 5)) + +var f3: { +>f3 : Symbol(f3, Decl(functionLiteralForOverloads.ts, 12, 3)) + + (x: T): string; +>T : Symbol(T, Decl(functionLiteralForOverloads.ts, 13, 5)) +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 13, 8)) +>T : Symbol(T, Decl(functionLiteralForOverloads.ts, 13, 5)) + + (x: T): number; +>T : Symbol(T, Decl(functionLiteralForOverloads.ts, 14, 5)) +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 14, 8)) +>T : Symbol(T, Decl(functionLiteralForOverloads.ts, 14, 5)) + +} = (x) => x; +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 15, 5)) +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 15, 5)) + +var f4: { +>f4 : Symbol(f4, Decl(functionLiteralForOverloads.ts, 17, 3)) + + (x: string): T; +>T : Symbol(T, Decl(functionLiteralForOverloads.ts, 18, 5)) +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 18, 8)) +>T : Symbol(T, Decl(functionLiteralForOverloads.ts, 18, 5)) + + (x: number): T; +>T : Symbol(T, Decl(functionLiteralForOverloads.ts, 19, 5)) +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 19, 8)) +>T : Symbol(T, Decl(functionLiteralForOverloads.ts, 19, 5)) + +} = (x) => x; +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 20, 5)) +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 20, 5)) + diff --git a/tests/baselines/reference/functionLiteralForOverloads2.symbols b/tests/baselines/reference/functionLiteralForOverloads2.symbols new file mode 100644 index 00000000000..c42926384d5 --- /dev/null +++ b/tests/baselines/reference/functionLiteralForOverloads2.symbols @@ -0,0 +1,78 @@ +=== tests/cases/conformance/types/specifyingTypes/typeLiterals/functionLiteralForOverloads2.ts === +// basic uses of function literals with constructor overloads + +class C { +>C : Symbol(C, Decl(functionLiteralForOverloads2.ts, 0, 0)) + + constructor(x: string); +>x : Symbol(x, Decl(functionLiteralForOverloads2.ts, 3, 16)) + + constructor(x: number); +>x : Symbol(x, Decl(functionLiteralForOverloads2.ts, 4, 16)) + + constructor(x) { } +>x : Symbol(x, Decl(functionLiteralForOverloads2.ts, 5, 16)) +} + +class D { +>D : Symbol(D, Decl(functionLiteralForOverloads2.ts, 6, 1)) +>T : Symbol(T, Decl(functionLiteralForOverloads2.ts, 8, 8)) + + constructor(x: string); +>x : Symbol(x, Decl(functionLiteralForOverloads2.ts, 9, 16)) + + constructor(x: number); +>x : Symbol(x, Decl(functionLiteralForOverloads2.ts, 10, 16)) + + constructor(x) { } +>x : Symbol(x, Decl(functionLiteralForOverloads2.ts, 11, 16)) +} + +var f: { +>f : Symbol(f, Decl(functionLiteralForOverloads2.ts, 14, 3)) + + new(x: string): C; +>x : Symbol(x, Decl(functionLiteralForOverloads2.ts, 15, 8)) +>C : Symbol(C, Decl(functionLiteralForOverloads2.ts, 0, 0)) + + new(x: number): C; +>x : Symbol(x, Decl(functionLiteralForOverloads2.ts, 16, 8)) +>C : Symbol(C, Decl(functionLiteralForOverloads2.ts, 0, 0)) + +} = C; +>C : Symbol(C, Decl(functionLiteralForOverloads2.ts, 0, 0)) + +var f2: { +>f2 : Symbol(f2, Decl(functionLiteralForOverloads2.ts, 19, 3)) + + new(x: string): C; +>T : Symbol(T, Decl(functionLiteralForOverloads2.ts, 20, 8)) +>x : Symbol(x, Decl(functionLiteralForOverloads2.ts, 20, 11)) +>C : Symbol(C, Decl(functionLiteralForOverloads2.ts, 0, 0)) + + new(x: number): C; +>T : Symbol(T, Decl(functionLiteralForOverloads2.ts, 21, 8)) +>x : Symbol(x, Decl(functionLiteralForOverloads2.ts, 21, 11)) +>C : Symbol(C, Decl(functionLiteralForOverloads2.ts, 0, 0)) + +} = C; +>C : Symbol(C, Decl(functionLiteralForOverloads2.ts, 0, 0)) + +var f3: { +>f3 : Symbol(f3, Decl(functionLiteralForOverloads2.ts, 24, 3)) + + new(x: string): D; +>T : Symbol(T, Decl(functionLiteralForOverloads2.ts, 25, 8)) +>x : Symbol(x, Decl(functionLiteralForOverloads2.ts, 25, 11)) +>D : Symbol(D, Decl(functionLiteralForOverloads2.ts, 6, 1)) +>T : Symbol(T, Decl(functionLiteralForOverloads2.ts, 25, 8)) + + new(x: number): D; +>T : Symbol(T, Decl(functionLiteralForOverloads2.ts, 26, 8)) +>x : Symbol(x, Decl(functionLiteralForOverloads2.ts, 26, 11)) +>D : Symbol(D, Decl(functionLiteralForOverloads2.ts, 6, 1)) +>T : Symbol(T, Decl(functionLiteralForOverloads2.ts, 26, 8)) + +} = D; +>D : Symbol(D, Decl(functionLiteralForOverloads2.ts, 6, 1)) + diff --git a/tests/baselines/reference/functionLiterals.symbols b/tests/baselines/reference/functionLiterals.symbols new file mode 100644 index 00000000000..64e212f2d60 --- /dev/null +++ b/tests/baselines/reference/functionLiterals.symbols @@ -0,0 +1,228 @@ +=== tests/cases/conformance/types/objectTypeLiteral/methodSignatures/functionLiterals.ts === +// PropName(ParamList):ReturnType is equivalent to PropName: { (ParamList): ReturnType } + +var b: { +>b : Symbol(b, Decl(functionLiterals.ts, 2, 3)) + + func1(x: number): number; // Method signature +>func1 : Symbol(func1, Decl(functionLiterals.ts, 2, 8)) +>x : Symbol(x, Decl(functionLiterals.ts, 3, 10)) + + func2: (x: number) => number; // Function type literal +>func2 : Symbol(func2, Decl(functionLiterals.ts, 3, 29)) +>x : Symbol(x, Decl(functionLiterals.ts, 4, 12)) + + func3: { (x: number): number }; // Object type literal +>func3 : Symbol(func3, Decl(functionLiterals.ts, 4, 33)) +>x : Symbol(x, Decl(functionLiterals.ts, 5, 14)) +} + +// no errors +b.func1 = b.func2; +>b.func1 : Symbol(func1, Decl(functionLiterals.ts, 2, 8)) +>b : Symbol(b, Decl(functionLiterals.ts, 2, 3)) +>func1 : Symbol(func1, Decl(functionLiterals.ts, 2, 8)) +>b.func2 : Symbol(func2, Decl(functionLiterals.ts, 3, 29)) +>b : Symbol(b, Decl(functionLiterals.ts, 2, 3)) +>func2 : Symbol(func2, Decl(functionLiterals.ts, 3, 29)) + +b.func1 = b.func3; +>b.func1 : Symbol(func1, Decl(functionLiterals.ts, 2, 8)) +>b : Symbol(b, Decl(functionLiterals.ts, 2, 3)) +>func1 : Symbol(func1, Decl(functionLiterals.ts, 2, 8)) +>b.func3 : Symbol(func3, Decl(functionLiterals.ts, 4, 33)) +>b : Symbol(b, Decl(functionLiterals.ts, 2, 3)) +>func3 : Symbol(func3, Decl(functionLiterals.ts, 4, 33)) + +b.func2 = b.func1; +>b.func2 : Symbol(func2, Decl(functionLiterals.ts, 3, 29)) +>b : Symbol(b, Decl(functionLiterals.ts, 2, 3)) +>func2 : Symbol(func2, Decl(functionLiterals.ts, 3, 29)) +>b.func1 : Symbol(func1, Decl(functionLiterals.ts, 2, 8)) +>b : Symbol(b, Decl(functionLiterals.ts, 2, 3)) +>func1 : Symbol(func1, Decl(functionLiterals.ts, 2, 8)) + +b.func2 = b.func3; +>b.func2 : Symbol(func2, Decl(functionLiterals.ts, 3, 29)) +>b : Symbol(b, Decl(functionLiterals.ts, 2, 3)) +>func2 : Symbol(func2, Decl(functionLiterals.ts, 3, 29)) +>b.func3 : Symbol(func3, Decl(functionLiterals.ts, 4, 33)) +>b : Symbol(b, Decl(functionLiterals.ts, 2, 3)) +>func3 : Symbol(func3, Decl(functionLiterals.ts, 4, 33)) + +b.func3 = b.func1; +>b.func3 : Symbol(func3, Decl(functionLiterals.ts, 4, 33)) +>b : Symbol(b, Decl(functionLiterals.ts, 2, 3)) +>func3 : Symbol(func3, Decl(functionLiterals.ts, 4, 33)) +>b.func1 : Symbol(func1, Decl(functionLiterals.ts, 2, 8)) +>b : Symbol(b, Decl(functionLiterals.ts, 2, 3)) +>func1 : Symbol(func1, Decl(functionLiterals.ts, 2, 8)) + +b.func3 = b.func2; +>b.func3 : Symbol(func3, Decl(functionLiterals.ts, 4, 33)) +>b : Symbol(b, Decl(functionLiterals.ts, 2, 3)) +>func3 : Symbol(func3, Decl(functionLiterals.ts, 4, 33)) +>b.func2 : Symbol(func2, Decl(functionLiterals.ts, 3, 29)) +>b : Symbol(b, Decl(functionLiterals.ts, 2, 3)) +>func2 : Symbol(func2, Decl(functionLiterals.ts, 3, 29)) + +var c: { +>c : Symbol(c, Decl(functionLiterals.ts, 16, 3)) + + func4(x: number): number; +>func4 : Symbol(func4, Decl(functionLiterals.ts, 16, 8), Decl(functionLiterals.ts, 17, 29)) +>x : Symbol(x, Decl(functionLiterals.ts, 17, 10)) + + func4(s: string): string; +>func4 : Symbol(func4, Decl(functionLiterals.ts, 16, 8), Decl(functionLiterals.ts, 17, 29)) +>s : Symbol(s, Decl(functionLiterals.ts, 18, 10)) + + func5: { +>func5 : Symbol(func5, Decl(functionLiterals.ts, 18, 29)) + + (x: number): number; +>x : Symbol(x, Decl(functionLiterals.ts, 20, 9)) + + (s: string): string; +>s : Symbol(s, Decl(functionLiterals.ts, 21, 9)) + + }; +}; + +// no errors +c.func4 = c.func5; +>c.func4 : Symbol(func4, Decl(functionLiterals.ts, 16, 8), Decl(functionLiterals.ts, 17, 29)) +>c : Symbol(c, Decl(functionLiterals.ts, 16, 3)) +>func4 : Symbol(func4, Decl(functionLiterals.ts, 16, 8), Decl(functionLiterals.ts, 17, 29)) +>c.func5 : Symbol(func5, Decl(functionLiterals.ts, 18, 29)) +>c : Symbol(c, Decl(functionLiterals.ts, 16, 3)) +>func5 : Symbol(func5, Decl(functionLiterals.ts, 18, 29)) + +c.func5 = c.func4; +>c.func5 : Symbol(func5, Decl(functionLiterals.ts, 18, 29)) +>c : Symbol(c, Decl(functionLiterals.ts, 16, 3)) +>func5 : Symbol(func5, Decl(functionLiterals.ts, 18, 29)) +>c.func4 : Symbol(func4, Decl(functionLiterals.ts, 16, 8), Decl(functionLiterals.ts, 17, 29)) +>c : Symbol(c, Decl(functionLiterals.ts, 16, 3)) +>func4 : Symbol(func4, Decl(functionLiterals.ts, 16, 8), Decl(functionLiterals.ts, 17, 29)) + +// generic versions +var b2: { +>b2 : Symbol(b2, Decl(functionLiterals.ts, 30, 3)) + + func1(x: T): number; // Method signature +>func1 : Symbol(func1, Decl(functionLiterals.ts, 30, 9)) +>T : Symbol(T, Decl(functionLiterals.ts, 31, 10)) +>x : Symbol(x, Decl(functionLiterals.ts, 31, 13)) +>T : Symbol(T, Decl(functionLiterals.ts, 31, 10)) + + func2: (x: T) => number; // Function type literal +>func2 : Symbol(func2, Decl(functionLiterals.ts, 31, 27)) +>T : Symbol(T, Decl(functionLiterals.ts, 32, 12)) +>x : Symbol(x, Decl(functionLiterals.ts, 32, 15)) +>T : Symbol(T, Decl(functionLiterals.ts, 32, 12)) + + func3: { (x: T): number }; // Object type literal +>func3 : Symbol(func3, Decl(functionLiterals.ts, 32, 31)) +>T : Symbol(T, Decl(functionLiterals.ts, 33, 14)) +>x : Symbol(x, Decl(functionLiterals.ts, 33, 17)) +>T : Symbol(T, Decl(functionLiterals.ts, 33, 14)) +} + +// no errors +b2.func1 = b2.func2; +>b2.func1 : Symbol(func1, Decl(functionLiterals.ts, 30, 9)) +>b2 : Symbol(b2, Decl(functionLiterals.ts, 30, 3)) +>func1 : Symbol(func1, Decl(functionLiterals.ts, 30, 9)) +>b2.func2 : Symbol(func2, Decl(functionLiterals.ts, 31, 27)) +>b2 : Symbol(b2, Decl(functionLiterals.ts, 30, 3)) +>func2 : Symbol(func2, Decl(functionLiterals.ts, 31, 27)) + +b2.func1 = b2.func3; +>b2.func1 : Symbol(func1, Decl(functionLiterals.ts, 30, 9)) +>b2 : Symbol(b2, Decl(functionLiterals.ts, 30, 3)) +>func1 : Symbol(func1, Decl(functionLiterals.ts, 30, 9)) +>b2.func3 : Symbol(func3, Decl(functionLiterals.ts, 32, 31)) +>b2 : Symbol(b2, Decl(functionLiterals.ts, 30, 3)) +>func3 : Symbol(func3, Decl(functionLiterals.ts, 32, 31)) + +b2.func2 = b2.func1; +>b2.func2 : Symbol(func2, Decl(functionLiterals.ts, 31, 27)) +>b2 : Symbol(b2, Decl(functionLiterals.ts, 30, 3)) +>func2 : Symbol(func2, Decl(functionLiterals.ts, 31, 27)) +>b2.func1 : Symbol(func1, Decl(functionLiterals.ts, 30, 9)) +>b2 : Symbol(b2, Decl(functionLiterals.ts, 30, 3)) +>func1 : Symbol(func1, Decl(functionLiterals.ts, 30, 9)) + +b2.func2 = b2.func3; +>b2.func2 : Symbol(func2, Decl(functionLiterals.ts, 31, 27)) +>b2 : Symbol(b2, Decl(functionLiterals.ts, 30, 3)) +>func2 : Symbol(func2, Decl(functionLiterals.ts, 31, 27)) +>b2.func3 : Symbol(func3, Decl(functionLiterals.ts, 32, 31)) +>b2 : Symbol(b2, Decl(functionLiterals.ts, 30, 3)) +>func3 : Symbol(func3, Decl(functionLiterals.ts, 32, 31)) + +b2.func3 = b2.func1; +>b2.func3 : Symbol(func3, Decl(functionLiterals.ts, 32, 31)) +>b2 : Symbol(b2, Decl(functionLiterals.ts, 30, 3)) +>func3 : Symbol(func3, Decl(functionLiterals.ts, 32, 31)) +>b2.func1 : Symbol(func1, Decl(functionLiterals.ts, 30, 9)) +>b2 : Symbol(b2, Decl(functionLiterals.ts, 30, 3)) +>func1 : Symbol(func1, Decl(functionLiterals.ts, 30, 9)) + +b2.func3 = b2.func2; +>b2.func3 : Symbol(func3, Decl(functionLiterals.ts, 32, 31)) +>b2 : Symbol(b2, Decl(functionLiterals.ts, 30, 3)) +>func3 : Symbol(func3, Decl(functionLiterals.ts, 32, 31)) +>b2.func2 : Symbol(func2, Decl(functionLiterals.ts, 31, 27)) +>b2 : Symbol(b2, Decl(functionLiterals.ts, 30, 3)) +>func2 : Symbol(func2, Decl(functionLiterals.ts, 31, 27)) + +var c2: { +>c2 : Symbol(c2, Decl(functionLiterals.ts, 44, 3)) + + func4(x: T): number; +>func4 : Symbol(func4, Decl(functionLiterals.ts, 44, 9), Decl(functionLiterals.ts, 45, 27)) +>T : Symbol(T, Decl(functionLiterals.ts, 45, 10)) +>x : Symbol(x, Decl(functionLiterals.ts, 45, 13)) +>T : Symbol(T, Decl(functionLiterals.ts, 45, 10)) + + func4(s: T): string; +>func4 : Symbol(func4, Decl(functionLiterals.ts, 44, 9), Decl(functionLiterals.ts, 45, 27)) +>T : Symbol(T, Decl(functionLiterals.ts, 46, 10)) +>s : Symbol(s, Decl(functionLiterals.ts, 46, 13)) +>T : Symbol(T, Decl(functionLiterals.ts, 46, 10)) + + func5: { +>func5 : Symbol(func5, Decl(functionLiterals.ts, 46, 27)) + + (x: T): number; +>T : Symbol(T, Decl(functionLiterals.ts, 48, 9)) +>x : Symbol(x, Decl(functionLiterals.ts, 48, 12)) +>T : Symbol(T, Decl(functionLiterals.ts, 48, 9)) + + (s: T): string; +>T : Symbol(T, Decl(functionLiterals.ts, 49, 9)) +>s : Symbol(s, Decl(functionLiterals.ts, 49, 12)) +>T : Symbol(T, Decl(functionLiterals.ts, 49, 9)) + + }; +}; + +// no errors +c2.func4 = c2.func5; +>c2.func4 : Symbol(func4, Decl(functionLiterals.ts, 44, 9), Decl(functionLiterals.ts, 45, 27)) +>c2 : Symbol(c2, Decl(functionLiterals.ts, 44, 3)) +>func4 : Symbol(func4, Decl(functionLiterals.ts, 44, 9), Decl(functionLiterals.ts, 45, 27)) +>c2.func5 : Symbol(func5, Decl(functionLiterals.ts, 46, 27)) +>c2 : Symbol(c2, Decl(functionLiterals.ts, 44, 3)) +>func5 : Symbol(func5, Decl(functionLiterals.ts, 46, 27)) + +c2.func5 = c2.func4; +>c2.func5 : Symbol(func5, Decl(functionLiterals.ts, 46, 27)) +>c2 : Symbol(c2, Decl(functionLiterals.ts, 44, 3)) +>func5 : Symbol(func5, Decl(functionLiterals.ts, 46, 27)) +>c2.func4 : Symbol(func4, Decl(functionLiterals.ts, 44, 9), Decl(functionLiterals.ts, 45, 27)) +>c2 : Symbol(c2, Decl(functionLiterals.ts, 44, 3)) +>func4 : Symbol(func4, Decl(functionLiterals.ts, 44, 9), Decl(functionLiterals.ts, 45, 27)) + diff --git a/tests/baselines/reference/functionMergedWithModule.symbols b/tests/baselines/reference/functionMergedWithModule.symbols new file mode 100644 index 00000000000..d22d7725317 --- /dev/null +++ b/tests/baselines/reference/functionMergedWithModule.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/functionMergedWithModule.ts === +function foo(title: string) { +>foo : Symbol(foo, Decl(functionMergedWithModule.ts, 0, 0), Decl(functionMergedWithModule.ts, 2, 1), Decl(functionMergedWithModule.ts, 7, 1)) +>title : Symbol(title, Decl(functionMergedWithModule.ts, 0, 13)) + + var x = 10; +>x : Symbol(x, Decl(functionMergedWithModule.ts, 1, 7)) +} + +module foo.Bar { +>foo : Symbol(foo, Decl(functionMergedWithModule.ts, 0, 0), Decl(functionMergedWithModule.ts, 2, 1), Decl(functionMergedWithModule.ts, 7, 1)) +>Bar : Symbol(Bar, Decl(functionMergedWithModule.ts, 4, 11)) + + export function f() { +>f : Symbol(f, Decl(functionMergedWithModule.ts, 4, 16)) + } +} + +module foo.Baz { +>foo : Symbol(foo, Decl(functionMergedWithModule.ts, 0, 0), Decl(functionMergedWithModule.ts, 2, 1), Decl(functionMergedWithModule.ts, 7, 1)) +>Baz : Symbol(Baz, Decl(functionMergedWithModule.ts, 9, 11)) + + export function g() { +>g : Symbol(g, Decl(functionMergedWithModule.ts, 9, 16)) + + Bar.f(); +>Bar.f : Symbol(Bar.f, Decl(functionMergedWithModule.ts, 4, 16)) +>Bar : Symbol(Bar, Decl(functionMergedWithModule.ts, 4, 11)) +>f : Symbol(Bar.f, Decl(functionMergedWithModule.ts, 4, 16)) + } +} diff --git a/tests/baselines/reference/functionMergedWithModule.types b/tests/baselines/reference/functionMergedWithModule.types index d0c711ab39a..ec0143f2923 100644 --- a/tests/baselines/reference/functionMergedWithModule.types +++ b/tests/baselines/reference/functionMergedWithModule.types @@ -5,6 +5,7 @@ function foo(title: string) { var x = 10; >x : number +>10 : number } module foo.Bar { diff --git a/tests/baselines/reference/functionOnlyHasThrow.symbols b/tests/baselines/reference/functionOnlyHasThrow.symbols new file mode 100644 index 00000000000..fc8d60a58be --- /dev/null +++ b/tests/baselines/reference/functionOnlyHasThrow.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/functionOnlyHasThrow.ts === +function clone():number { +>clone : Symbol(clone, Decl(functionOnlyHasThrow.ts, 0, 0)) + + throw new Error("To be implemented"); +>Error : Symbol(Error, Decl(lib.d.ts, 876, 38), Decl(lib.d.ts, 889, 11)) +} diff --git a/tests/baselines/reference/functionOnlyHasThrow.types b/tests/baselines/reference/functionOnlyHasThrow.types index d37284f547c..c4e8cce38a2 100644 --- a/tests/baselines/reference/functionOnlyHasThrow.types +++ b/tests/baselines/reference/functionOnlyHasThrow.types @@ -5,4 +5,5 @@ function clone():number { throw new Error("To be implemented"); >new Error("To be implemented") : Error >Error : ErrorConstructor +>"To be implemented" : string } diff --git a/tests/baselines/reference/functionOverloads10.symbols b/tests/baselines/reference/functionOverloads10.symbols new file mode 100644 index 00000000000..b2eda9bda8a --- /dev/null +++ b/tests/baselines/reference/functionOverloads10.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/functionOverloads10.ts === +function foo(foo:string, bar:number); +>foo : Symbol(foo, Decl(functionOverloads10.ts, 0, 0), Decl(functionOverloads10.ts, 0, 37), Decl(functionOverloads10.ts, 1, 25)) +>foo : Symbol(foo, Decl(functionOverloads10.ts, 0, 13)) +>bar : Symbol(bar, Decl(functionOverloads10.ts, 0, 24)) + +function foo(foo:string); +>foo : Symbol(foo, Decl(functionOverloads10.ts, 0, 0), Decl(functionOverloads10.ts, 0, 37), Decl(functionOverloads10.ts, 1, 25)) +>foo : Symbol(foo, Decl(functionOverloads10.ts, 1, 13)) + +function foo(foo:any){ } +>foo : Symbol(foo, Decl(functionOverloads10.ts, 0, 0), Decl(functionOverloads10.ts, 0, 37), Decl(functionOverloads10.ts, 1, 25)) +>foo : Symbol(foo, Decl(functionOverloads10.ts, 2, 13)) + diff --git a/tests/baselines/reference/functionOverloads12.symbols b/tests/baselines/reference/functionOverloads12.symbols new file mode 100644 index 00000000000..583e7f5c045 --- /dev/null +++ b/tests/baselines/reference/functionOverloads12.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/functionOverloads12.ts === +function foo():string; +>foo : Symbol(foo, Decl(functionOverloads12.ts, 0, 0), Decl(functionOverloads12.ts, 0, 22), Decl(functionOverloads12.ts, 1, 22)) + +function foo():number; +>foo : Symbol(foo, Decl(functionOverloads12.ts, 0, 0), Decl(functionOverloads12.ts, 0, 22), Decl(functionOverloads12.ts, 1, 22)) + +function foo():any { if (true) return ""; else return 0;} +>foo : Symbol(foo, Decl(functionOverloads12.ts, 0, 0), Decl(functionOverloads12.ts, 0, 22), Decl(functionOverloads12.ts, 1, 22)) + diff --git a/tests/baselines/reference/functionOverloads12.types b/tests/baselines/reference/functionOverloads12.types index 6e4c2d9189e..20f5ee5d556 100644 --- a/tests/baselines/reference/functionOverloads12.types +++ b/tests/baselines/reference/functionOverloads12.types @@ -7,4 +7,7 @@ function foo():number; function foo():any { if (true) return ""; else return 0;} >foo : { (): string; (): number; } +>true : boolean +>"" : string +>0 : number diff --git a/tests/baselines/reference/functionOverloads13.symbols b/tests/baselines/reference/functionOverloads13.symbols new file mode 100644 index 00000000000..c2aa01c9329 --- /dev/null +++ b/tests/baselines/reference/functionOverloads13.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/functionOverloads13.ts === +function foo(bar:number):string; +>foo : Symbol(foo, Decl(functionOverloads13.ts, 0, 0), Decl(functionOverloads13.ts, 0, 32), Decl(functionOverloads13.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads13.ts, 0, 13)) + +function foo(bar:number):number; +>foo : Symbol(foo, Decl(functionOverloads13.ts, 0, 0), Decl(functionOverloads13.ts, 0, 32), Decl(functionOverloads13.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads13.ts, 1, 13)) + +function foo(bar?:number):any { return "" } +>foo : Symbol(foo, Decl(functionOverloads13.ts, 0, 0), Decl(functionOverloads13.ts, 0, 32), Decl(functionOverloads13.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads13.ts, 2, 13)) + diff --git a/tests/baselines/reference/functionOverloads13.types b/tests/baselines/reference/functionOverloads13.types index ee65bc296e7..f26067c7eb8 100644 --- a/tests/baselines/reference/functionOverloads13.types +++ b/tests/baselines/reference/functionOverloads13.types @@ -10,4 +10,5 @@ function foo(bar:number):number; function foo(bar?:number):any { return "" } >foo : { (bar: number): string; (bar: number): number; } >bar : number +>"" : string diff --git a/tests/baselines/reference/functionOverloads14.symbols b/tests/baselines/reference/functionOverloads14.symbols new file mode 100644 index 00000000000..4f4c3e4750b --- /dev/null +++ b/tests/baselines/reference/functionOverloads14.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/functionOverloads14.ts === +function foo():{a:number;} +>foo : Symbol(foo, Decl(functionOverloads14.ts, 0, 0), Decl(functionOverloads14.ts, 0, 26), Decl(functionOverloads14.ts, 1, 26)) +>a : Symbol(a, Decl(functionOverloads14.ts, 0, 16)) + +function foo():{a:string;} +>foo : Symbol(foo, Decl(functionOverloads14.ts, 0, 0), Decl(functionOverloads14.ts, 0, 26), Decl(functionOverloads14.ts, 1, 26)) +>a : Symbol(a, Decl(functionOverloads14.ts, 1, 16)) + +function foo():{a:any;} { return {a:1} } +>foo : Symbol(foo, Decl(functionOverloads14.ts, 0, 0), Decl(functionOverloads14.ts, 0, 26), Decl(functionOverloads14.ts, 1, 26)) +>a : Symbol(a, Decl(functionOverloads14.ts, 2, 16)) +>a : Symbol(a, Decl(functionOverloads14.ts, 2, 34)) + diff --git a/tests/baselines/reference/functionOverloads14.types b/tests/baselines/reference/functionOverloads14.types index 562c43965c7..032ed700545 100644 --- a/tests/baselines/reference/functionOverloads14.types +++ b/tests/baselines/reference/functionOverloads14.types @@ -12,4 +12,5 @@ function foo():{a:any;} { return {a:1} } >a : any >{a:1} : { a: number; } >a : number +>1 : number diff --git a/tests/baselines/reference/functionOverloads15.symbols b/tests/baselines/reference/functionOverloads15.symbols new file mode 100644 index 00000000000..520480ad1a6 --- /dev/null +++ b/tests/baselines/reference/functionOverloads15.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/functionOverloads15.ts === +function foo(foo:{a:string; b:number;}):string; +>foo : Symbol(foo, Decl(functionOverloads15.ts, 0, 0), Decl(functionOverloads15.ts, 0, 47), Decl(functionOverloads15.ts, 1, 47)) +>foo : Symbol(foo, Decl(functionOverloads15.ts, 0, 13)) +>a : Symbol(a, Decl(functionOverloads15.ts, 0, 18)) +>b : Symbol(b, Decl(functionOverloads15.ts, 0, 27)) + +function foo(foo:{a:string; b:number;}):number; +>foo : Symbol(foo, Decl(functionOverloads15.ts, 0, 0), Decl(functionOverloads15.ts, 0, 47), Decl(functionOverloads15.ts, 1, 47)) +>foo : Symbol(foo, Decl(functionOverloads15.ts, 1, 13)) +>a : Symbol(a, Decl(functionOverloads15.ts, 1, 18)) +>b : Symbol(b, Decl(functionOverloads15.ts, 1, 27)) + +function foo(foo:{a:string; b?:number;}):any { return "" } +>foo : Symbol(foo, Decl(functionOverloads15.ts, 0, 0), Decl(functionOverloads15.ts, 0, 47), Decl(functionOverloads15.ts, 1, 47)) +>foo : Symbol(foo, Decl(functionOverloads15.ts, 2, 13)) +>a : Symbol(a, Decl(functionOverloads15.ts, 2, 18)) +>b : Symbol(b, Decl(functionOverloads15.ts, 2, 27)) + diff --git a/tests/baselines/reference/functionOverloads15.types b/tests/baselines/reference/functionOverloads15.types index 6ca5b6709cb..8fe428e9a40 100644 --- a/tests/baselines/reference/functionOverloads15.types +++ b/tests/baselines/reference/functionOverloads15.types @@ -16,4 +16,5 @@ function foo(foo:{a:string; b?:number;}):any { return "" } >foo : { a: string; b?: number; } >a : string >b : number +>"" : string diff --git a/tests/baselines/reference/functionOverloads16.symbols b/tests/baselines/reference/functionOverloads16.symbols new file mode 100644 index 00000000000..97f7dfe7e74 --- /dev/null +++ b/tests/baselines/reference/functionOverloads16.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/functionOverloads16.ts === +function foo(foo:{a:string;}):string; +>foo : Symbol(foo, Decl(functionOverloads16.ts, 0, 0), Decl(functionOverloads16.ts, 0, 37), Decl(functionOverloads16.ts, 1, 37)) +>foo : Symbol(foo, Decl(functionOverloads16.ts, 0, 13)) +>a : Symbol(a, Decl(functionOverloads16.ts, 0, 18)) + +function foo(foo:{a:string;}):number; +>foo : Symbol(foo, Decl(functionOverloads16.ts, 0, 0), Decl(functionOverloads16.ts, 0, 37), Decl(functionOverloads16.ts, 1, 37)) +>foo : Symbol(foo, Decl(functionOverloads16.ts, 1, 13)) +>a : Symbol(a, Decl(functionOverloads16.ts, 1, 18)) + +function foo(foo:{a:string; b?:number;}):any { return "" } +>foo : Symbol(foo, Decl(functionOverloads16.ts, 0, 0), Decl(functionOverloads16.ts, 0, 37), Decl(functionOverloads16.ts, 1, 37)) +>foo : Symbol(foo, Decl(functionOverloads16.ts, 2, 13)) +>a : Symbol(a, Decl(functionOverloads16.ts, 2, 18)) +>b : Symbol(b, Decl(functionOverloads16.ts, 2, 27)) + diff --git a/tests/baselines/reference/functionOverloads16.types b/tests/baselines/reference/functionOverloads16.types index 6974d0dab98..e6c6ceb57a6 100644 --- a/tests/baselines/reference/functionOverloads16.types +++ b/tests/baselines/reference/functionOverloads16.types @@ -14,4 +14,5 @@ function foo(foo:{a:string; b?:number;}):any { return "" } >foo : { a: string; b?: number; } >a : string >b : number +>"" : string diff --git a/tests/baselines/reference/functionOverloads21.symbols b/tests/baselines/reference/functionOverloads21.symbols new file mode 100644 index 00000000000..9e772c8aed8 --- /dev/null +++ b/tests/baselines/reference/functionOverloads21.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/functionOverloads21.ts === +function foo(bar:{a:number;}[]); +>foo : Symbol(foo, Decl(functionOverloads21.ts, 0, 0), Decl(functionOverloads21.ts, 0, 32), Decl(functionOverloads21.ts, 1, 42)) +>bar : Symbol(bar, Decl(functionOverloads21.ts, 0, 13)) +>a : Symbol(a, Decl(functionOverloads21.ts, 0, 18)) + +function foo(bar:{a:number; b:string;}[]); +>foo : Symbol(foo, Decl(functionOverloads21.ts, 0, 0), Decl(functionOverloads21.ts, 0, 32), Decl(functionOverloads21.ts, 1, 42)) +>bar : Symbol(bar, Decl(functionOverloads21.ts, 1, 13)) +>a : Symbol(a, Decl(functionOverloads21.ts, 1, 18)) +>b : Symbol(b, Decl(functionOverloads21.ts, 1, 27)) + +function foo(bar:{a:any; b?:string;}[]) { return 0 } +>foo : Symbol(foo, Decl(functionOverloads21.ts, 0, 0), Decl(functionOverloads21.ts, 0, 32), Decl(functionOverloads21.ts, 1, 42)) +>bar : Symbol(bar, Decl(functionOverloads21.ts, 2, 13)) +>a : Symbol(a, Decl(functionOverloads21.ts, 2, 18)) +>b : Symbol(b, Decl(functionOverloads21.ts, 2, 24)) + diff --git a/tests/baselines/reference/functionOverloads21.types b/tests/baselines/reference/functionOverloads21.types index dc9e28b7b57..3b4cf261ea9 100644 --- a/tests/baselines/reference/functionOverloads21.types +++ b/tests/baselines/reference/functionOverloads21.types @@ -15,4 +15,5 @@ function foo(bar:{a:any; b?:string;}[]) { return 0 } >bar : { a: any; b?: string; }[] >a : any >b : string +>0 : number diff --git a/tests/baselines/reference/functionOverloads23.symbols b/tests/baselines/reference/functionOverloads23.symbols new file mode 100644 index 00000000000..bc79c1b4e2b --- /dev/null +++ b/tests/baselines/reference/functionOverloads23.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/functionOverloads23.ts === +function foo(bar:(b:string)=>void); +>foo : Symbol(foo, Decl(functionOverloads23.ts, 0, 0), Decl(functionOverloads23.ts, 0, 35), Decl(functionOverloads23.ts, 1, 35)) +>bar : Symbol(bar, Decl(functionOverloads23.ts, 0, 13)) +>b : Symbol(b, Decl(functionOverloads23.ts, 0, 18)) + +function foo(bar:(a:number)=>void); +>foo : Symbol(foo, Decl(functionOverloads23.ts, 0, 0), Decl(functionOverloads23.ts, 0, 35), Decl(functionOverloads23.ts, 1, 35)) +>bar : Symbol(bar, Decl(functionOverloads23.ts, 1, 13)) +>a : Symbol(a, Decl(functionOverloads23.ts, 1, 18)) + +function foo(bar:(a?)=>void) { return 0 } +>foo : Symbol(foo, Decl(functionOverloads23.ts, 0, 0), Decl(functionOverloads23.ts, 0, 35), Decl(functionOverloads23.ts, 1, 35)) +>bar : Symbol(bar, Decl(functionOverloads23.ts, 2, 13)) +>a : Symbol(a, Decl(functionOverloads23.ts, 2, 18)) + diff --git a/tests/baselines/reference/functionOverloads23.types b/tests/baselines/reference/functionOverloads23.types index 40b67a78c55..ee510a336e1 100644 --- a/tests/baselines/reference/functionOverloads23.types +++ b/tests/baselines/reference/functionOverloads23.types @@ -13,4 +13,5 @@ function foo(bar:(a?)=>void) { return 0 } >foo : { (bar: (b: string) => void): any; (bar: (a: number) => void): any; } >bar : (a?: any) => void >a : any +>0 : number diff --git a/tests/baselines/reference/functionOverloads24.symbols b/tests/baselines/reference/functionOverloads24.symbols new file mode 100644 index 00000000000..0753e1f832b --- /dev/null +++ b/tests/baselines/reference/functionOverloads24.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/functionOverloads24.ts === +function foo(bar:number):(b:string)=>void; +>foo : Symbol(foo, Decl(functionOverloads24.ts, 0, 0), Decl(functionOverloads24.ts, 0, 42), Decl(functionOverloads24.ts, 1, 42)) +>bar : Symbol(bar, Decl(functionOverloads24.ts, 0, 13)) +>b : Symbol(b, Decl(functionOverloads24.ts, 0, 26)) + +function foo(bar:string):(a:number)=>void; +>foo : Symbol(foo, Decl(functionOverloads24.ts, 0, 0), Decl(functionOverloads24.ts, 0, 42), Decl(functionOverloads24.ts, 1, 42)) +>bar : Symbol(bar, Decl(functionOverloads24.ts, 1, 13)) +>a : Symbol(a, Decl(functionOverloads24.ts, 1, 26)) + +function foo(bar:any):(a)=>void { return function(){} } +>foo : Symbol(foo, Decl(functionOverloads24.ts, 0, 0), Decl(functionOverloads24.ts, 0, 42), Decl(functionOverloads24.ts, 1, 42)) +>bar : Symbol(bar, Decl(functionOverloads24.ts, 2, 13)) +>a : Symbol(a, Decl(functionOverloads24.ts, 2, 23)) + diff --git a/tests/baselines/reference/functionOverloads25.symbols b/tests/baselines/reference/functionOverloads25.symbols new file mode 100644 index 00000000000..9eeae4b3ce5 --- /dev/null +++ b/tests/baselines/reference/functionOverloads25.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/functionOverloads25.ts === +function foo():string; +>foo : Symbol(foo, Decl(functionOverloads25.ts, 0, 0), Decl(functionOverloads25.ts, 0, 22), Decl(functionOverloads25.ts, 1, 32)) + +function foo(bar:string):number; +>foo : Symbol(foo, Decl(functionOverloads25.ts, 0, 0), Decl(functionOverloads25.ts, 0, 22), Decl(functionOverloads25.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads25.ts, 1, 13)) + +function foo(bar?:any):any{ return '' }; +>foo : Symbol(foo, Decl(functionOverloads25.ts, 0, 0), Decl(functionOverloads25.ts, 0, 22), Decl(functionOverloads25.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads25.ts, 2, 13)) + +var x = foo(); +>x : Symbol(x, Decl(functionOverloads25.ts, 3, 3)) +>foo : Symbol(foo, Decl(functionOverloads25.ts, 0, 0), Decl(functionOverloads25.ts, 0, 22), Decl(functionOverloads25.ts, 1, 32)) + diff --git a/tests/baselines/reference/functionOverloads25.types b/tests/baselines/reference/functionOverloads25.types index ace77ebc9e4..5b5c3781e74 100644 --- a/tests/baselines/reference/functionOverloads25.types +++ b/tests/baselines/reference/functionOverloads25.types @@ -9,6 +9,7 @@ function foo(bar:string):number; function foo(bar?:any):any{ return '' }; >foo : { (): string; (bar: string): number; } >bar : any +>'' : string var x = foo(); >x : string diff --git a/tests/baselines/reference/functionOverloads26.symbols b/tests/baselines/reference/functionOverloads26.symbols new file mode 100644 index 00000000000..b5e48390a2c --- /dev/null +++ b/tests/baselines/reference/functionOverloads26.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/functionOverloads26.ts === +function foo():string; +>foo : Symbol(foo, Decl(functionOverloads26.ts, 0, 0), Decl(functionOverloads26.ts, 0, 22), Decl(functionOverloads26.ts, 1, 32)) + +function foo(bar:string):number; +>foo : Symbol(foo, Decl(functionOverloads26.ts, 0, 0), Decl(functionOverloads26.ts, 0, 22), Decl(functionOverloads26.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads26.ts, 1, 13)) + +function foo(bar?:any):any{ return '' } +>foo : Symbol(foo, Decl(functionOverloads26.ts, 0, 0), Decl(functionOverloads26.ts, 0, 22), Decl(functionOverloads26.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads26.ts, 2, 13)) + +var x = foo('baz'); +>x : Symbol(x, Decl(functionOverloads26.ts, 3, 3)) +>foo : Symbol(foo, Decl(functionOverloads26.ts, 0, 0), Decl(functionOverloads26.ts, 0, 22), Decl(functionOverloads26.ts, 1, 32)) + diff --git a/tests/baselines/reference/functionOverloads26.types b/tests/baselines/reference/functionOverloads26.types index 402003d7e7b..9345507b72e 100644 --- a/tests/baselines/reference/functionOverloads26.types +++ b/tests/baselines/reference/functionOverloads26.types @@ -9,9 +9,11 @@ function foo(bar:string):number; function foo(bar?:any):any{ return '' } >foo : { (): string; (bar: string): number; } >bar : any +>'' : string var x = foo('baz'); >x : number >foo('baz') : number >foo : { (): string; (bar: string): number; } +>'baz' : string diff --git a/tests/baselines/reference/functionOverloads28.symbols b/tests/baselines/reference/functionOverloads28.symbols new file mode 100644 index 00000000000..643bc4d5993 --- /dev/null +++ b/tests/baselines/reference/functionOverloads28.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/functionOverloads28.ts === +function foo():string; +>foo : Symbol(foo, Decl(functionOverloads28.ts, 0, 0), Decl(functionOverloads28.ts, 0, 22), Decl(functionOverloads28.ts, 1, 32)) + +function foo(bar:string):number; +>foo : Symbol(foo, Decl(functionOverloads28.ts, 0, 0), Decl(functionOverloads28.ts, 0, 22), Decl(functionOverloads28.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads28.ts, 1, 13)) + +function foo(bar?:any):any{ return '' } +>foo : Symbol(foo, Decl(functionOverloads28.ts, 0, 0), Decl(functionOverloads28.ts, 0, 22), Decl(functionOverloads28.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads28.ts, 2, 13)) + +var t:any; var x = foo(t); +>t : Symbol(t, Decl(functionOverloads28.ts, 3, 3)) +>x : Symbol(x, Decl(functionOverloads28.ts, 3, 14)) +>foo : Symbol(foo, Decl(functionOverloads28.ts, 0, 0), Decl(functionOverloads28.ts, 0, 22), Decl(functionOverloads28.ts, 1, 32)) +>t : Symbol(t, Decl(functionOverloads28.ts, 3, 3)) + diff --git a/tests/baselines/reference/functionOverloads28.types b/tests/baselines/reference/functionOverloads28.types index 034d35c64f7..ae4ab6c0664 100644 --- a/tests/baselines/reference/functionOverloads28.types +++ b/tests/baselines/reference/functionOverloads28.types @@ -9,6 +9,7 @@ function foo(bar:string):number; function foo(bar?:any):any{ return '' } >foo : { (): string; (bar: string): number; } >bar : any +>'' : string var t:any; var x = foo(t); >t : any diff --git a/tests/baselines/reference/functionOverloads30.symbols b/tests/baselines/reference/functionOverloads30.symbols new file mode 100644 index 00000000000..828c9149a12 --- /dev/null +++ b/tests/baselines/reference/functionOverloads30.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/functionOverloads30.ts === +function foo(bar:string):string; +>foo : Symbol(foo, Decl(functionOverloads30.ts, 0, 0), Decl(functionOverloads30.ts, 0, 32), Decl(functionOverloads30.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads30.ts, 0, 13)) + +function foo(bar:number):number; +>foo : Symbol(foo, Decl(functionOverloads30.ts, 0, 0), Decl(functionOverloads30.ts, 0, 32), Decl(functionOverloads30.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads30.ts, 1, 13)) + +function foo(bar:any):any{ return bar } +>foo : Symbol(foo, Decl(functionOverloads30.ts, 0, 0), Decl(functionOverloads30.ts, 0, 32), Decl(functionOverloads30.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads30.ts, 2, 13)) +>bar : Symbol(bar, Decl(functionOverloads30.ts, 2, 13)) + +var x = foo('bar'); +>x : Symbol(x, Decl(functionOverloads30.ts, 3, 3)) +>foo : Symbol(foo, Decl(functionOverloads30.ts, 0, 0), Decl(functionOverloads30.ts, 0, 32), Decl(functionOverloads30.ts, 1, 32)) + diff --git a/tests/baselines/reference/functionOverloads30.types b/tests/baselines/reference/functionOverloads30.types index 80d43c952d9..a97bc0bb74d 100644 --- a/tests/baselines/reference/functionOverloads30.types +++ b/tests/baselines/reference/functionOverloads30.types @@ -16,4 +16,5 @@ var x = foo('bar'); >x : string >foo('bar') : string >foo : { (bar: string): string; (bar: number): number; } +>'bar' : string diff --git a/tests/baselines/reference/functionOverloads31.symbols b/tests/baselines/reference/functionOverloads31.symbols new file mode 100644 index 00000000000..e869e9f21b7 --- /dev/null +++ b/tests/baselines/reference/functionOverloads31.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/functionOverloads31.ts === +function foo(bar:string):string; +>foo : Symbol(foo, Decl(functionOverloads31.ts, 0, 0), Decl(functionOverloads31.ts, 0, 32), Decl(functionOverloads31.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads31.ts, 0, 13)) + +function foo(bar:number):number; +>foo : Symbol(foo, Decl(functionOverloads31.ts, 0, 0), Decl(functionOverloads31.ts, 0, 32), Decl(functionOverloads31.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads31.ts, 1, 13)) + +function foo(bar:any):any{ return bar } +>foo : Symbol(foo, Decl(functionOverloads31.ts, 0, 0), Decl(functionOverloads31.ts, 0, 32), Decl(functionOverloads31.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads31.ts, 2, 13)) +>bar : Symbol(bar, Decl(functionOverloads31.ts, 2, 13)) + +var x = foo(5); +>x : Symbol(x, Decl(functionOverloads31.ts, 3, 3)) +>foo : Symbol(foo, Decl(functionOverloads31.ts, 0, 0), Decl(functionOverloads31.ts, 0, 32), Decl(functionOverloads31.ts, 1, 32)) + diff --git a/tests/baselines/reference/functionOverloads31.types b/tests/baselines/reference/functionOverloads31.types index 4d7816166bc..c85470ebd65 100644 --- a/tests/baselines/reference/functionOverloads31.types +++ b/tests/baselines/reference/functionOverloads31.types @@ -16,4 +16,5 @@ var x = foo(5); >x : number >foo(5) : number >foo : { (bar: string): string; (bar: number): number; } +>5 : number diff --git a/tests/baselines/reference/functionOverloads32.symbols b/tests/baselines/reference/functionOverloads32.symbols new file mode 100644 index 00000000000..6f0f013abf7 --- /dev/null +++ b/tests/baselines/reference/functionOverloads32.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/functionOverloads32.ts === +function foo(bar:string):string; +>foo : Symbol(foo, Decl(functionOverloads32.ts, 0, 0), Decl(functionOverloads32.ts, 0, 32), Decl(functionOverloads32.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads32.ts, 0, 13)) + +function foo(bar:number):number; +>foo : Symbol(foo, Decl(functionOverloads32.ts, 0, 0), Decl(functionOverloads32.ts, 0, 32), Decl(functionOverloads32.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads32.ts, 1, 13)) + +function foo(bar:any):any{ return bar } +>foo : Symbol(foo, Decl(functionOverloads32.ts, 0, 0), Decl(functionOverloads32.ts, 0, 32), Decl(functionOverloads32.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads32.ts, 2, 13)) +>bar : Symbol(bar, Decl(functionOverloads32.ts, 2, 13)) + +var baz:number; var x = foo(baz); +>baz : Symbol(baz, Decl(functionOverloads32.ts, 3, 3)) +>x : Symbol(x, Decl(functionOverloads32.ts, 3, 19)) +>foo : Symbol(foo, Decl(functionOverloads32.ts, 0, 0), Decl(functionOverloads32.ts, 0, 32), Decl(functionOverloads32.ts, 1, 32)) +>baz : Symbol(baz, Decl(functionOverloads32.ts, 3, 3)) + diff --git a/tests/baselines/reference/functionOverloads33.symbols b/tests/baselines/reference/functionOverloads33.symbols new file mode 100644 index 00000000000..0ba6733a0f7 --- /dev/null +++ b/tests/baselines/reference/functionOverloads33.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/functionOverloads33.ts === +function foo(bar:string):string; +>foo : Symbol(foo, Decl(functionOverloads33.ts, 0, 0), Decl(functionOverloads33.ts, 0, 32), Decl(functionOverloads33.ts, 1, 29)) +>bar : Symbol(bar, Decl(functionOverloads33.ts, 0, 13)) + +function foo(bar:any):number; +>foo : Symbol(foo, Decl(functionOverloads33.ts, 0, 0), Decl(functionOverloads33.ts, 0, 32), Decl(functionOverloads33.ts, 1, 29)) +>bar : Symbol(bar, Decl(functionOverloads33.ts, 1, 13)) + +function foo(bar:any):any{ return bar } +>foo : Symbol(foo, Decl(functionOverloads33.ts, 0, 0), Decl(functionOverloads33.ts, 0, 32), Decl(functionOverloads33.ts, 1, 29)) +>bar : Symbol(bar, Decl(functionOverloads33.ts, 2, 13)) +>bar : Symbol(bar, Decl(functionOverloads33.ts, 2, 13)) + +var x = foo(5); +>x : Symbol(x, Decl(functionOverloads33.ts, 3, 3)) +>foo : Symbol(foo, Decl(functionOverloads33.ts, 0, 0), Decl(functionOverloads33.ts, 0, 32), Decl(functionOverloads33.ts, 1, 29)) + diff --git a/tests/baselines/reference/functionOverloads33.types b/tests/baselines/reference/functionOverloads33.types index 0199277180d..3d57c983305 100644 --- a/tests/baselines/reference/functionOverloads33.types +++ b/tests/baselines/reference/functionOverloads33.types @@ -16,4 +16,5 @@ var x = foo(5); >x : number >foo(5) : number >foo : { (bar: string): string; (bar: any): number; } +>5 : number diff --git a/tests/baselines/reference/functionOverloads35.symbols b/tests/baselines/reference/functionOverloads35.symbols new file mode 100644 index 00000000000..44a65a452f4 --- /dev/null +++ b/tests/baselines/reference/functionOverloads35.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/functionOverloads35.ts === +function foo(bar:{a:number;}):number; +>foo : Symbol(foo, Decl(functionOverloads35.ts, 0, 0), Decl(functionOverloads35.ts, 0, 37), Decl(functionOverloads35.ts, 1, 37)) +>bar : Symbol(bar, Decl(functionOverloads35.ts, 0, 13)) +>a : Symbol(a, Decl(functionOverloads35.ts, 0, 18)) + +function foo(bar:{a:string;}):string; +>foo : Symbol(foo, Decl(functionOverloads35.ts, 0, 0), Decl(functionOverloads35.ts, 0, 37), Decl(functionOverloads35.ts, 1, 37)) +>bar : Symbol(bar, Decl(functionOverloads35.ts, 1, 13)) +>a : Symbol(a, Decl(functionOverloads35.ts, 1, 18)) + +function foo(bar:{a:any;}):any{ return bar } +>foo : Symbol(foo, Decl(functionOverloads35.ts, 0, 0), Decl(functionOverloads35.ts, 0, 37), Decl(functionOverloads35.ts, 1, 37)) +>bar : Symbol(bar, Decl(functionOverloads35.ts, 2, 13)) +>a : Symbol(a, Decl(functionOverloads35.ts, 2, 18)) +>bar : Symbol(bar, Decl(functionOverloads35.ts, 2, 13)) + +var x = foo({a:1}); +>x : Symbol(x, Decl(functionOverloads35.ts, 3, 3)) +>foo : Symbol(foo, Decl(functionOverloads35.ts, 0, 0), Decl(functionOverloads35.ts, 0, 37), Decl(functionOverloads35.ts, 1, 37)) +>a : Symbol(a, Decl(functionOverloads35.ts, 3, 13)) + diff --git a/tests/baselines/reference/functionOverloads35.types b/tests/baselines/reference/functionOverloads35.types index 567f9512e3d..1b811cf4246 100644 --- a/tests/baselines/reference/functionOverloads35.types +++ b/tests/baselines/reference/functionOverloads35.types @@ -21,4 +21,5 @@ var x = foo({a:1}); >foo : { (bar: { a: number; }): number; (bar: { a: string; }): string; } >{a:1} : { a: number; } >a : number +>1 : number diff --git a/tests/baselines/reference/functionOverloads36.symbols b/tests/baselines/reference/functionOverloads36.symbols new file mode 100644 index 00000000000..fa6df8fafac --- /dev/null +++ b/tests/baselines/reference/functionOverloads36.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/functionOverloads36.ts === +function foo(bar:{a:number;}):number; +>foo : Symbol(foo, Decl(functionOverloads36.ts, 0, 0), Decl(functionOverloads36.ts, 0, 37), Decl(functionOverloads36.ts, 1, 37)) +>bar : Symbol(bar, Decl(functionOverloads36.ts, 0, 13)) +>a : Symbol(a, Decl(functionOverloads36.ts, 0, 18)) + +function foo(bar:{a:string;}):string; +>foo : Symbol(foo, Decl(functionOverloads36.ts, 0, 0), Decl(functionOverloads36.ts, 0, 37), Decl(functionOverloads36.ts, 1, 37)) +>bar : Symbol(bar, Decl(functionOverloads36.ts, 1, 13)) +>a : Symbol(a, Decl(functionOverloads36.ts, 1, 18)) + +function foo(bar:{a:any;}):any{ return bar } +>foo : Symbol(foo, Decl(functionOverloads36.ts, 0, 0), Decl(functionOverloads36.ts, 0, 37), Decl(functionOverloads36.ts, 1, 37)) +>bar : Symbol(bar, Decl(functionOverloads36.ts, 2, 13)) +>a : Symbol(a, Decl(functionOverloads36.ts, 2, 18)) +>bar : Symbol(bar, Decl(functionOverloads36.ts, 2, 13)) + +var x = foo({a:'foo'}); +>x : Symbol(x, Decl(functionOverloads36.ts, 3, 3)) +>foo : Symbol(foo, Decl(functionOverloads36.ts, 0, 0), Decl(functionOverloads36.ts, 0, 37), Decl(functionOverloads36.ts, 1, 37)) +>a : Symbol(a, Decl(functionOverloads36.ts, 3, 13)) + diff --git a/tests/baselines/reference/functionOverloads36.types b/tests/baselines/reference/functionOverloads36.types index 8118a1c113a..c8c1f7cede8 100644 --- a/tests/baselines/reference/functionOverloads36.types +++ b/tests/baselines/reference/functionOverloads36.types @@ -21,4 +21,5 @@ var x = foo({a:'foo'}); >foo : { (bar: { a: number; }): number; (bar: { a: string; }): string; } >{a:'foo'} : { a: string; } >a : string +>'foo' : string diff --git a/tests/baselines/reference/functionOverloads38.symbols b/tests/baselines/reference/functionOverloads38.symbols new file mode 100644 index 00000000000..460ea753776 --- /dev/null +++ b/tests/baselines/reference/functionOverloads38.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/functionOverloads38.ts === +function foo(bar:{a:number;}[]):string; +>foo : Symbol(foo, Decl(functionOverloads38.ts, 0, 0), Decl(functionOverloads38.ts, 0, 39), Decl(functionOverloads38.ts, 1, 40)) +>bar : Symbol(bar, Decl(functionOverloads38.ts, 0, 13)) +>a : Symbol(a, Decl(functionOverloads38.ts, 0, 18)) + +function foo(bar:{a:boolean;}[]):number; +>foo : Symbol(foo, Decl(functionOverloads38.ts, 0, 0), Decl(functionOverloads38.ts, 0, 39), Decl(functionOverloads38.ts, 1, 40)) +>bar : Symbol(bar, Decl(functionOverloads38.ts, 1, 13)) +>a : Symbol(a, Decl(functionOverloads38.ts, 1, 18)) + +function foo(bar:{a:any;}[]):any{ return bar } +>foo : Symbol(foo, Decl(functionOverloads38.ts, 0, 0), Decl(functionOverloads38.ts, 0, 39), Decl(functionOverloads38.ts, 1, 40)) +>bar : Symbol(bar, Decl(functionOverloads38.ts, 2, 13)) +>a : Symbol(a, Decl(functionOverloads38.ts, 2, 18)) +>bar : Symbol(bar, Decl(functionOverloads38.ts, 2, 13)) + +var x = foo([{a:1}]); +>x : Symbol(x, Decl(functionOverloads38.ts, 3, 3)) +>foo : Symbol(foo, Decl(functionOverloads38.ts, 0, 0), Decl(functionOverloads38.ts, 0, 39), Decl(functionOverloads38.ts, 1, 40)) +>a : Symbol(a, Decl(functionOverloads38.ts, 3, 14)) + diff --git a/tests/baselines/reference/functionOverloads38.types b/tests/baselines/reference/functionOverloads38.types index 852191ba07f..d718569c9bf 100644 --- a/tests/baselines/reference/functionOverloads38.types +++ b/tests/baselines/reference/functionOverloads38.types @@ -22,4 +22,5 @@ var x = foo([{a:1}]); >[{a:1}] : { a: number; }[] >{a:1} : { a: number; } >a : number +>1 : number diff --git a/tests/baselines/reference/functionOverloads39.symbols b/tests/baselines/reference/functionOverloads39.symbols new file mode 100644 index 00000000000..37bb56117d5 --- /dev/null +++ b/tests/baselines/reference/functionOverloads39.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/functionOverloads39.ts === +function foo(bar:{a:number;}[]):string; +>foo : Symbol(foo, Decl(functionOverloads39.ts, 0, 0), Decl(functionOverloads39.ts, 0, 39), Decl(functionOverloads39.ts, 1, 40)) +>bar : Symbol(bar, Decl(functionOverloads39.ts, 0, 13)) +>a : Symbol(a, Decl(functionOverloads39.ts, 0, 18)) + +function foo(bar:{a:boolean;}[]):number; +>foo : Symbol(foo, Decl(functionOverloads39.ts, 0, 0), Decl(functionOverloads39.ts, 0, 39), Decl(functionOverloads39.ts, 1, 40)) +>bar : Symbol(bar, Decl(functionOverloads39.ts, 1, 13)) +>a : Symbol(a, Decl(functionOverloads39.ts, 1, 18)) + +function foo(bar:{a:any;}[]):any{ return bar } +>foo : Symbol(foo, Decl(functionOverloads39.ts, 0, 0), Decl(functionOverloads39.ts, 0, 39), Decl(functionOverloads39.ts, 1, 40)) +>bar : Symbol(bar, Decl(functionOverloads39.ts, 2, 13)) +>a : Symbol(a, Decl(functionOverloads39.ts, 2, 18)) +>bar : Symbol(bar, Decl(functionOverloads39.ts, 2, 13)) + +var x = foo([{a:true}]); +>x : Symbol(x, Decl(functionOverloads39.ts, 3, 3)) +>foo : Symbol(foo, Decl(functionOverloads39.ts, 0, 0), Decl(functionOverloads39.ts, 0, 39), Decl(functionOverloads39.ts, 1, 40)) +>a : Symbol(a, Decl(functionOverloads39.ts, 3, 14)) + diff --git a/tests/baselines/reference/functionOverloads39.types b/tests/baselines/reference/functionOverloads39.types index 70eee2b5163..78c0e78bca1 100644 --- a/tests/baselines/reference/functionOverloads39.types +++ b/tests/baselines/reference/functionOverloads39.types @@ -22,4 +22,5 @@ var x = foo([{a:true}]); >[{a:true}] : { a: boolean; }[] >{a:true} : { a: boolean; } >a : boolean +>true : boolean diff --git a/tests/baselines/reference/functionOverloads42.symbols b/tests/baselines/reference/functionOverloads42.symbols new file mode 100644 index 00000000000..6cca9a552f2 --- /dev/null +++ b/tests/baselines/reference/functionOverloads42.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/functionOverloads42.ts === +function foo(bar:{a:number;}[]):string; +>foo : Symbol(foo, Decl(functionOverloads42.ts, 0, 0), Decl(functionOverloads42.ts, 0, 39), Decl(functionOverloads42.ts, 1, 36)) +>bar : Symbol(bar, Decl(functionOverloads42.ts, 0, 13)) +>a : Symbol(a, Decl(functionOverloads42.ts, 0, 18)) + +function foo(bar:{a:any;}[]):number; +>foo : Symbol(foo, Decl(functionOverloads42.ts, 0, 0), Decl(functionOverloads42.ts, 0, 39), Decl(functionOverloads42.ts, 1, 36)) +>bar : Symbol(bar, Decl(functionOverloads42.ts, 1, 13)) +>a : Symbol(a, Decl(functionOverloads42.ts, 1, 18)) + +function foo(bar:{a:any;}[]):any{ return bar } +>foo : Symbol(foo, Decl(functionOverloads42.ts, 0, 0), Decl(functionOverloads42.ts, 0, 39), Decl(functionOverloads42.ts, 1, 36)) +>bar : Symbol(bar, Decl(functionOverloads42.ts, 2, 13)) +>a : Symbol(a, Decl(functionOverloads42.ts, 2, 18)) +>bar : Symbol(bar, Decl(functionOverloads42.ts, 2, 13)) + +var x = foo([{a:'s'}]); +>x : Symbol(x, Decl(functionOverloads42.ts, 3, 3)) +>foo : Symbol(foo, Decl(functionOverloads42.ts, 0, 0), Decl(functionOverloads42.ts, 0, 39), Decl(functionOverloads42.ts, 1, 36)) +>a : Symbol(a, Decl(functionOverloads42.ts, 3, 14)) + diff --git a/tests/baselines/reference/functionOverloads42.types b/tests/baselines/reference/functionOverloads42.types index 6641a28c87a..32e99d46aa1 100644 --- a/tests/baselines/reference/functionOverloads42.types +++ b/tests/baselines/reference/functionOverloads42.types @@ -22,4 +22,5 @@ var x = foo([{a:'s'}]); >[{a:'s'}] : { a: string; }[] >{a:'s'} : { a: string; } >a : string +>'s' : string diff --git a/tests/baselines/reference/functionOverloads6.symbols b/tests/baselines/reference/functionOverloads6.symbols new file mode 100644 index 00000000000..390339753a6 --- /dev/null +++ b/tests/baselines/reference/functionOverloads6.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/functionOverloads6.ts === +class foo { +>foo : Symbol(foo, Decl(functionOverloads6.ts, 0, 0)) + + static fnOverload(); +>fnOverload : Symbol(foo.fnOverload, Decl(functionOverloads6.ts, 0, 11), Decl(functionOverloads6.ts, 1, 23), Decl(functionOverloads6.ts, 2, 33)) + + static fnOverload(foo:string); +>fnOverload : Symbol(foo.fnOverload, Decl(functionOverloads6.ts, 0, 11), Decl(functionOverloads6.ts, 1, 23), Decl(functionOverloads6.ts, 2, 33)) +>foo : Symbol(foo, Decl(functionOverloads6.ts, 2, 21)) + + static fnOverload(foo?: any){ } +>fnOverload : Symbol(foo.fnOverload, Decl(functionOverloads6.ts, 0, 11), Decl(functionOverloads6.ts, 1, 23), Decl(functionOverloads6.ts, 2, 33)) +>foo : Symbol(foo, Decl(functionOverloads6.ts, 3, 21)) +} + diff --git a/tests/baselines/reference/functionOverloads7.symbols b/tests/baselines/reference/functionOverloads7.symbols new file mode 100644 index 00000000000..1d2fe3ea6a2 --- /dev/null +++ b/tests/baselines/reference/functionOverloads7.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/functionOverloads7.ts === +class foo { +>foo : Symbol(foo, Decl(functionOverloads7.ts, 0, 0)) + + private bar(); +>bar : Symbol(bar, Decl(functionOverloads7.ts, 0, 11), Decl(functionOverloads7.ts, 1, 17), Decl(functionOverloads7.ts, 2, 28)) + + private bar(foo: string); +>bar : Symbol(bar, Decl(functionOverloads7.ts, 0, 11), Decl(functionOverloads7.ts, 1, 17), Decl(functionOverloads7.ts, 2, 28)) +>foo : Symbol(foo, Decl(functionOverloads7.ts, 2, 15)) + + private bar(foo?: any){ return "foo" } +>bar : Symbol(bar, Decl(functionOverloads7.ts, 0, 11), Decl(functionOverloads7.ts, 1, 17), Decl(functionOverloads7.ts, 2, 28)) +>foo : Symbol(foo, Decl(functionOverloads7.ts, 3, 15)) + + public n() { +>n : Symbol(n, Decl(functionOverloads7.ts, 3, 41)) + + var foo = this.bar(); +>foo : Symbol(foo, Decl(functionOverloads7.ts, 5, 8)) +>this.bar : Symbol(bar, Decl(functionOverloads7.ts, 0, 11), Decl(functionOverloads7.ts, 1, 17), Decl(functionOverloads7.ts, 2, 28)) +>this : Symbol(foo, Decl(functionOverloads7.ts, 0, 0)) +>bar : Symbol(bar, Decl(functionOverloads7.ts, 0, 11), Decl(functionOverloads7.ts, 1, 17), Decl(functionOverloads7.ts, 2, 28)) + + foo = this.bar("test"); +>foo : Symbol(foo, Decl(functionOverloads7.ts, 5, 8)) +>this.bar : Symbol(bar, Decl(functionOverloads7.ts, 0, 11), Decl(functionOverloads7.ts, 1, 17), Decl(functionOverloads7.ts, 2, 28)) +>this : Symbol(foo, Decl(functionOverloads7.ts, 0, 0)) +>bar : Symbol(bar, Decl(functionOverloads7.ts, 0, 11), Decl(functionOverloads7.ts, 1, 17), Decl(functionOverloads7.ts, 2, 28)) + } +} + diff --git a/tests/baselines/reference/functionOverloads7.types b/tests/baselines/reference/functionOverloads7.types index fed669c8943..c57f042b354 100644 --- a/tests/baselines/reference/functionOverloads7.types +++ b/tests/baselines/reference/functionOverloads7.types @@ -12,6 +12,7 @@ class foo { private bar(foo?: any){ return "foo" } >bar : { (): any; (foo: string): any; } >foo : any +>"foo" : string public n() { >n : () => void @@ -30,6 +31,7 @@ class foo { >this.bar : { (): any; (foo: string): any; } >this : foo >bar : { (): any; (foo: string): any; } +>"test" : string } } diff --git a/tests/baselines/reference/functionOverloads8.symbols b/tests/baselines/reference/functionOverloads8.symbols new file mode 100644 index 00000000000..39acaddcd4f --- /dev/null +++ b/tests/baselines/reference/functionOverloads8.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/functionOverloads8.ts === +function foo(); +>foo : Symbol(foo, Decl(functionOverloads8.ts, 0, 0), Decl(functionOverloads8.ts, 0, 15), Decl(functionOverloads8.ts, 1, 25)) + +function foo(foo:string); +>foo : Symbol(foo, Decl(functionOverloads8.ts, 0, 0), Decl(functionOverloads8.ts, 0, 15), Decl(functionOverloads8.ts, 1, 25)) +>foo : Symbol(foo, Decl(functionOverloads8.ts, 1, 13)) + +function foo(foo?:any){ return '' } +>foo : Symbol(foo, Decl(functionOverloads8.ts, 0, 0), Decl(functionOverloads8.ts, 0, 15), Decl(functionOverloads8.ts, 1, 25)) +>foo : Symbol(foo, Decl(functionOverloads8.ts, 2, 13)) + diff --git a/tests/baselines/reference/functionOverloads8.types b/tests/baselines/reference/functionOverloads8.types index e342db5d174..4751533e2af 100644 --- a/tests/baselines/reference/functionOverloads8.types +++ b/tests/baselines/reference/functionOverloads8.types @@ -9,4 +9,5 @@ function foo(foo:string); function foo(foo?:any){ return '' } >foo : { (): any; (foo: string): any; } >foo : any +>'' : string diff --git a/tests/baselines/reference/functionOverloads9.symbols b/tests/baselines/reference/functionOverloads9.symbols new file mode 100644 index 00000000000..0fe6fe731a8 --- /dev/null +++ b/tests/baselines/reference/functionOverloads9.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/functionOverloads9.ts === +function foo(foo:string); +>foo : Symbol(foo, Decl(functionOverloads9.ts, 0, 0), Decl(functionOverloads9.ts, 0, 25)) +>foo : Symbol(foo, Decl(functionOverloads9.ts, 0, 13)) + +function foo(foo?:string){ return '' }; +>foo : Symbol(foo, Decl(functionOverloads9.ts, 0, 0), Decl(functionOverloads9.ts, 0, 25)) +>foo : Symbol(foo, Decl(functionOverloads9.ts, 1, 13)) + +var x = foo('foo'); +>x : Symbol(x, Decl(functionOverloads9.ts, 2, 3)) +>foo : Symbol(foo, Decl(functionOverloads9.ts, 0, 0), Decl(functionOverloads9.ts, 0, 25)) + diff --git a/tests/baselines/reference/functionOverloads9.types b/tests/baselines/reference/functionOverloads9.types index a844aee7df1..88586c32eb2 100644 --- a/tests/baselines/reference/functionOverloads9.types +++ b/tests/baselines/reference/functionOverloads9.types @@ -6,9 +6,11 @@ function foo(foo:string); function foo(foo?:string){ return '' }; >foo : (foo: string) => any >foo : string +>'' : string var x = foo('foo'); >x : any >foo('foo') : any >foo : (foo: string) => any +>'foo' : string diff --git a/tests/baselines/reference/functionOverloadsOnGenericArity1.symbols b/tests/baselines/reference/functionOverloadsOnGenericArity1.symbols new file mode 100644 index 00000000000..d4721e5ec08 --- /dev/null +++ b/tests/baselines/reference/functionOverloadsOnGenericArity1.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/functionOverloadsOnGenericArity1.ts === +// overloading on arity not allowed +interface C { +>C : Symbol(C, Decl(functionOverloadsOnGenericArity1.ts, 0, 0)) + + f(): string; +>f : Symbol(f, Decl(functionOverloadsOnGenericArity1.ts, 1, 13), Decl(functionOverloadsOnGenericArity1.ts, 2, 18)) +>T : Symbol(T, Decl(functionOverloadsOnGenericArity1.ts, 2, 5)) + + f(): string; +>f : Symbol(f, Decl(functionOverloadsOnGenericArity1.ts, 1, 13), Decl(functionOverloadsOnGenericArity1.ts, 2, 18)) +>T : Symbol(T, Decl(functionOverloadsOnGenericArity1.ts, 3, 5)) +>U : Symbol(U, Decl(functionOverloadsOnGenericArity1.ts, 3, 7)) + + (): string; +>T : Symbol(T, Decl(functionOverloadsOnGenericArity1.ts, 5, 4)) + + (): string; +>T : Symbol(T, Decl(functionOverloadsOnGenericArity1.ts, 6, 4)) +>U : Symbol(U, Decl(functionOverloadsOnGenericArity1.ts, 6, 6)) + + new (): string; +>T : Symbol(T, Decl(functionOverloadsOnGenericArity1.ts, 8, 7)) + + new (): string; +>T : Symbol(T, Decl(functionOverloadsOnGenericArity1.ts, 9, 7)) +>U : Symbol(U, Decl(functionOverloadsOnGenericArity1.ts, 9, 9)) +} + diff --git a/tests/baselines/reference/functionOverloadsOnGenericArity2.symbols b/tests/baselines/reference/functionOverloadsOnGenericArity2.symbols new file mode 100644 index 00000000000..93a56c86035 --- /dev/null +++ b/tests/baselines/reference/functionOverloadsOnGenericArity2.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/functionOverloadsOnGenericArity2.ts === +interface I { +>I : Symbol(I, Decl(functionOverloadsOnGenericArity2.ts, 0, 0)) + + then(p: string): string; +>then : Symbol(then, Decl(functionOverloadsOnGenericArity2.ts, 0, 13), Decl(functionOverloadsOnGenericArity2.ts, 1, 28), Decl(functionOverloadsOnGenericArity2.ts, 2, 31)) +>p : Symbol(p, Decl(functionOverloadsOnGenericArity2.ts, 1, 9)) + + then(p: string): string; +>then : Symbol(then, Decl(functionOverloadsOnGenericArity2.ts, 0, 13), Decl(functionOverloadsOnGenericArity2.ts, 1, 28), Decl(functionOverloadsOnGenericArity2.ts, 2, 31)) +>U : Symbol(U, Decl(functionOverloadsOnGenericArity2.ts, 2, 9)) +>p : Symbol(p, Decl(functionOverloadsOnGenericArity2.ts, 2, 12)) + + then(p: string): Date; +>then : Symbol(then, Decl(functionOverloadsOnGenericArity2.ts, 0, 13), Decl(functionOverloadsOnGenericArity2.ts, 1, 28), Decl(functionOverloadsOnGenericArity2.ts, 2, 31)) +>U : Symbol(U, Decl(functionOverloadsOnGenericArity2.ts, 3, 9)) +>T : Symbol(T, Decl(functionOverloadsOnGenericArity2.ts, 3, 11)) +>p : Symbol(p, Decl(functionOverloadsOnGenericArity2.ts, 3, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +} diff --git a/tests/baselines/reference/functionOverloadsRecursiveGenericReturnType.symbols b/tests/baselines/reference/functionOverloadsRecursiveGenericReturnType.symbols new file mode 100644 index 00000000000..42ed87e64d1 --- /dev/null +++ b/tests/baselines/reference/functionOverloadsRecursiveGenericReturnType.symbols @@ -0,0 +1,48 @@ +=== tests/cases/compiler/functionOverloadsRecursiveGenericReturnType.ts === +class B{ +>B : Symbol(B, Decl(functionOverloadsRecursiveGenericReturnType.ts, 0, 0)) +>V : Symbol(V, Decl(functionOverloadsRecursiveGenericReturnType.ts, 0, 8)) + + private id: V; +>id : Symbol(id, Decl(functionOverloadsRecursiveGenericReturnType.ts, 0, 11)) +>V : Symbol(V, Decl(functionOverloadsRecursiveGenericReturnType.ts, 0, 8)) +} + +class A{ +>A : Symbol(A, Decl(functionOverloadsRecursiveGenericReturnType.ts, 2, 1)) +>U : Symbol(U, Decl(functionOverloadsRecursiveGenericReturnType.ts, 4, 8)) + + GetEnumerator: () => B; +>GetEnumerator : Symbol(GetEnumerator, Decl(functionOverloadsRecursiveGenericReturnType.ts, 4, 11)) +>B : Symbol(B, Decl(functionOverloadsRecursiveGenericReturnType.ts, 0, 0)) +>U : Symbol(U, Decl(functionOverloadsRecursiveGenericReturnType.ts, 4, 8)) +} + +function Choice(args: T[]): A; +>Choice : Symbol(Choice, Decl(functionOverloadsRecursiveGenericReturnType.ts, 6, 1), Decl(functionOverloadsRecursiveGenericReturnType.ts, 8, 36), Decl(functionOverloadsRecursiveGenericReturnType.ts, 9, 41)) +>T : Symbol(T, Decl(functionOverloadsRecursiveGenericReturnType.ts, 8, 16)) +>args : Symbol(args, Decl(functionOverloadsRecursiveGenericReturnType.ts, 8, 19)) +>T : Symbol(T, Decl(functionOverloadsRecursiveGenericReturnType.ts, 8, 16)) +>A : Symbol(A, Decl(functionOverloadsRecursiveGenericReturnType.ts, 2, 1)) +>T : Symbol(T, Decl(functionOverloadsRecursiveGenericReturnType.ts, 8, 16)) + +function Choice(...v_args: T[]): A; +>Choice : Symbol(Choice, Decl(functionOverloadsRecursiveGenericReturnType.ts, 6, 1), Decl(functionOverloadsRecursiveGenericReturnType.ts, 8, 36), Decl(functionOverloadsRecursiveGenericReturnType.ts, 9, 41)) +>T : Symbol(T, Decl(functionOverloadsRecursiveGenericReturnType.ts, 9, 16)) +>v_args : Symbol(v_args, Decl(functionOverloadsRecursiveGenericReturnType.ts, 9, 19)) +>T : Symbol(T, Decl(functionOverloadsRecursiveGenericReturnType.ts, 9, 16)) +>A : Symbol(A, Decl(functionOverloadsRecursiveGenericReturnType.ts, 2, 1)) +>T : Symbol(T, Decl(functionOverloadsRecursiveGenericReturnType.ts, 9, 16)) + +function Choice(...v_args: any[]): A{ +>Choice : Symbol(Choice, Decl(functionOverloadsRecursiveGenericReturnType.ts, 6, 1), Decl(functionOverloadsRecursiveGenericReturnType.ts, 8, 36), Decl(functionOverloadsRecursiveGenericReturnType.ts, 9, 41)) +>T : Symbol(T, Decl(functionOverloadsRecursiveGenericReturnType.ts, 10, 16)) +>v_args : Symbol(v_args, Decl(functionOverloadsRecursiveGenericReturnType.ts, 10, 19)) +>A : Symbol(A, Decl(functionOverloadsRecursiveGenericReturnType.ts, 2, 1)) +>T : Symbol(T, Decl(functionOverloadsRecursiveGenericReturnType.ts, 10, 16)) + + return new A(); +>A : Symbol(A, Decl(functionOverloadsRecursiveGenericReturnType.ts, 2, 1)) +>T : Symbol(T, Decl(functionOverloadsRecursiveGenericReturnType.ts, 10, 16)) +} + diff --git a/tests/baselines/reference/functionReturn.symbols b/tests/baselines/reference/functionReturn.symbols new file mode 100644 index 00000000000..9c6b794b3d0 --- /dev/null +++ b/tests/baselines/reference/functionReturn.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/functionReturn.ts === +function f0(): void { } +>f0 : Symbol(f0, Decl(functionReturn.ts, 0, 0)) + +function f1() { +>f1 : Symbol(f1, Decl(functionReturn.ts, 0, 23)) + + var n: any = f0(); +>n : Symbol(n, Decl(functionReturn.ts, 2, 7)) +>f0 : Symbol(f0, Decl(functionReturn.ts, 0, 0)) +} +function f2(): any { } +>f2 : Symbol(f2, Decl(functionReturn.ts, 3, 1)) + +function f3(): string { return; } +>f3 : Symbol(f3, Decl(functionReturn.ts, 4, 22)) + +function f4(): string { +>f4 : Symbol(f4, Decl(functionReturn.ts, 5, 33)) + + return ''; + return; +} +function f5(): string { +>f5 : Symbol(f5, Decl(functionReturn.ts, 9, 1)) + + return ''; + return undefined; +>undefined : Symbol(undefined) +} diff --git a/tests/baselines/reference/functionReturn.types b/tests/baselines/reference/functionReturn.types index 0c1ee8eafc2..6fc9d680db9 100644 --- a/tests/baselines/reference/functionReturn.types +++ b/tests/baselines/reference/functionReturn.types @@ -20,12 +20,16 @@ function f4(): string { >f4 : () => string return ''; +>'' : string + return; } function f5(): string { >f5 : () => string return ''; +>'' : string + return undefined; >undefined : undefined } diff --git a/tests/baselines/reference/functionReturningItself.symbols b/tests/baselines/reference/functionReturningItself.symbols new file mode 100644 index 00000000000..64e72d20c92 --- /dev/null +++ b/tests/baselines/reference/functionReturningItself.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/functionReturningItself.ts === +function somefn() { +>somefn : Symbol(somefn, Decl(functionReturningItself.ts, 0, 0)) + + return somefn; +>somefn : Symbol(somefn, Decl(functionReturningItself.ts, 0, 0)) +} diff --git a/tests/baselines/reference/functionSubtypingOfVarArgs.symbols b/tests/baselines/reference/functionSubtypingOfVarArgs.symbols new file mode 100644 index 00000000000..334766dc10c --- /dev/null +++ b/tests/baselines/reference/functionSubtypingOfVarArgs.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/functionSubtypingOfVarArgs.ts === +class EventBase { +>EventBase : Symbol(EventBase, Decl(functionSubtypingOfVarArgs.ts, 0, 0)) + + private _listeners = []; +>_listeners : Symbol(_listeners, Decl(functionSubtypingOfVarArgs.ts, 0, 17)) + + add(listener: (...args: any[]) => void): void { +>add : Symbol(add, Decl(functionSubtypingOfVarArgs.ts, 1, 28)) +>listener : Symbol(listener, Decl(functionSubtypingOfVarArgs.ts, 3, 8)) +>args : Symbol(args, Decl(functionSubtypingOfVarArgs.ts, 3, 19)) + + this._listeners.push(listener); +>this._listeners.push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29)) +>this._listeners : Symbol(_listeners, Decl(functionSubtypingOfVarArgs.ts, 0, 17)) +>this : Symbol(EventBase, Decl(functionSubtypingOfVarArgs.ts, 0, 0)) +>_listeners : Symbol(_listeners, Decl(functionSubtypingOfVarArgs.ts, 0, 17)) +>push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29)) +>listener : Symbol(listener, Decl(functionSubtypingOfVarArgs.ts, 3, 8)) + } +} + +class StringEvent extends EventBase { // should work +>StringEvent : Symbol(StringEvent, Decl(functionSubtypingOfVarArgs.ts, 6, 1)) +>EventBase : Symbol(EventBase, Decl(functionSubtypingOfVarArgs.ts, 0, 0)) + + add(listener: (items: string) => void ) { // valid, items is subtype of args +>add : Symbol(add, Decl(functionSubtypingOfVarArgs.ts, 8, 37)) +>listener : Symbol(listener, Decl(functionSubtypingOfVarArgs.ts, 9, 8)) +>items : Symbol(items, Decl(functionSubtypingOfVarArgs.ts, 9, 19)) + + super.add(listener); +>super.add : Symbol(EventBase.add, Decl(functionSubtypingOfVarArgs.ts, 1, 28)) +>super : Symbol(EventBase, Decl(functionSubtypingOfVarArgs.ts, 0, 0)) +>add : Symbol(EventBase.add, Decl(functionSubtypingOfVarArgs.ts, 1, 28)) +>listener : Symbol(listener, Decl(functionSubtypingOfVarArgs.ts, 9, 8)) + } +} + diff --git a/tests/baselines/reference/functionSubtypingOfVarArgs2.symbols b/tests/baselines/reference/functionSubtypingOfVarArgs2.symbols new file mode 100644 index 00000000000..227264f9617 --- /dev/null +++ b/tests/baselines/reference/functionSubtypingOfVarArgs2.symbols @@ -0,0 +1,41 @@ +=== tests/cases/compiler/functionSubtypingOfVarArgs2.ts === +class EventBase { +>EventBase : Symbol(EventBase, Decl(functionSubtypingOfVarArgs2.ts, 0, 0)) + + private _listeners: { (...args: any[]): void; }[] = []; +>_listeners : Symbol(_listeners, Decl(functionSubtypingOfVarArgs2.ts, 0, 17)) +>args : Symbol(args, Decl(functionSubtypingOfVarArgs2.ts, 1, 27)) + + add(listener: (...args: any[]) => void): void { +>add : Symbol(add, Decl(functionSubtypingOfVarArgs2.ts, 1, 59)) +>listener : Symbol(listener, Decl(functionSubtypingOfVarArgs2.ts, 3, 8)) +>args : Symbol(args, Decl(functionSubtypingOfVarArgs2.ts, 3, 19)) + + this._listeners.push(listener); +>this._listeners.push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29)) +>this._listeners : Symbol(_listeners, Decl(functionSubtypingOfVarArgs2.ts, 0, 17)) +>this : Symbol(EventBase, Decl(functionSubtypingOfVarArgs2.ts, 0, 0)) +>_listeners : Symbol(_listeners, Decl(functionSubtypingOfVarArgs2.ts, 0, 17)) +>push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29)) +>listener : Symbol(listener, Decl(functionSubtypingOfVarArgs2.ts, 3, 8)) + } +} + +class StringEvent extends EventBase { +>StringEvent : Symbol(StringEvent, Decl(functionSubtypingOfVarArgs2.ts, 6, 1)) +>EventBase : Symbol(EventBase, Decl(functionSubtypingOfVarArgs2.ts, 0, 0)) + + add(listener: (items: string, moreitems: number) => void ) { +>add : Symbol(add, Decl(functionSubtypingOfVarArgs2.ts, 8, 37)) +>listener : Symbol(listener, Decl(functionSubtypingOfVarArgs2.ts, 9, 8)) +>items : Symbol(items, Decl(functionSubtypingOfVarArgs2.ts, 9, 19)) +>moreitems : Symbol(moreitems, Decl(functionSubtypingOfVarArgs2.ts, 9, 33)) + + super.add(listener); +>super.add : Symbol(EventBase.add, Decl(functionSubtypingOfVarArgs2.ts, 1, 59)) +>super : Symbol(EventBase, Decl(functionSubtypingOfVarArgs2.ts, 0, 0)) +>add : Symbol(EventBase.add, Decl(functionSubtypingOfVarArgs2.ts, 1, 59)) +>listener : Symbol(listener, Decl(functionSubtypingOfVarArgs2.ts, 9, 8)) + } +} + diff --git a/tests/baselines/reference/functionType.symbols b/tests/baselines/reference/functionType.symbols new file mode 100644 index 00000000000..f972b6fc8a1 --- /dev/null +++ b/tests/baselines/reference/functionType.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/functionType.ts === +function salt() {} +>salt : Symbol(salt, Decl(functionType.ts, 0, 0)) + +salt.apply("hello", []); +>salt.apply : Symbol(Function.apply, Decl(lib.d.ts, 228, 20)) +>salt : Symbol(salt, Decl(functionType.ts, 0, 0)) +>apply : Symbol(Function.apply, Decl(lib.d.ts, 228, 20)) + +(new Function("return 5"))(); +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) + + + diff --git a/tests/baselines/reference/functionType.types b/tests/baselines/reference/functionType.types index 29a940db205..e7ea7a47edf 100644 --- a/tests/baselines/reference/functionType.types +++ b/tests/baselines/reference/functionType.types @@ -7,6 +7,7 @@ salt.apply("hello", []); >salt.apply : (thisArg: any, argArray?: any) => any >salt : () => void >apply : (thisArg: any, argArray?: any) => any +>"hello" : string >[] : undefined[] (new Function("return 5"))(); @@ -14,6 +15,7 @@ salt.apply("hello", []); >(new Function("return 5")) : Function >new Function("return 5") : Function >Function : FunctionConstructor +>"return 5" : string diff --git a/tests/baselines/reference/functionTypeArgumentArrayAssignment.symbols b/tests/baselines/reference/functionTypeArgumentArrayAssignment.symbols new file mode 100644 index 00000000000..4b597bea9ae --- /dev/null +++ b/tests/baselines/reference/functionTypeArgumentArrayAssignment.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/functionTypeArgumentArrayAssignment.ts === +module test { +>test : Symbol(test, Decl(functionTypeArgumentArrayAssignment.ts, 0, 0)) + + interface Array { +>Array : Symbol(Array, Decl(functionTypeArgumentArrayAssignment.ts, 0, 13)) +>T : Symbol(T, Decl(functionTypeArgumentArrayAssignment.ts, 1, 20)) + + foo: T; +>foo : Symbol(foo, Decl(functionTypeArgumentArrayAssignment.ts, 1, 24)) +>T : Symbol(T, Decl(functionTypeArgumentArrayAssignment.ts, 1, 20)) + + length: number; +>length : Symbol(length, Decl(functionTypeArgumentArrayAssignment.ts, 2, 15)) + } + + function map() { +>map : Symbol(map, Decl(functionTypeArgumentArrayAssignment.ts, 4, 5)) +>U : Symbol(U, Decl(functionTypeArgumentArrayAssignment.ts, 6, 17)) + + var ys: U[] = []; +>ys : Symbol(ys, Decl(functionTypeArgumentArrayAssignment.ts, 7, 11)) +>U : Symbol(U, Decl(functionTypeArgumentArrayAssignment.ts, 6, 17)) + } +} + diff --git a/tests/baselines/reference/functionWithAnyReturnTypeAndNoReturnExpression.symbols b/tests/baselines/reference/functionWithAnyReturnTypeAndNoReturnExpression.symbols new file mode 100644 index 00000000000..71a678b6c93 --- /dev/null +++ b/tests/baselines/reference/functionWithAnyReturnTypeAndNoReturnExpression.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/functionWithAnyReturnTypeAndNoReturnExpression.ts === +// All should be allowed +function f(): any { } +>f : Symbol(f, Decl(functionWithAnyReturnTypeAndNoReturnExpression.ts, 0, 0)) + +var f2: () => any = () => { }; +>f2 : Symbol(f2, Decl(functionWithAnyReturnTypeAndNoReturnExpression.ts, 2, 3)) + +var f3 = (): any => { }; +>f3 : Symbol(f3, Decl(functionWithAnyReturnTypeAndNoReturnExpression.ts, 3, 3)) + diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements1.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements1.symbols new file mode 100644 index 00000000000..f10320b4ca9 --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements1.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements1.ts === +function foo(x = 0) { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements1.ts, 0, 0)) +>x : Symbol(x, Decl(functionWithDefaultParameterWithNoStatements1.ts, 0, 13)) + diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements1.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements1.types index d5c114c9216..d695157db40 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements1.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements1.types @@ -2,4 +2,5 @@ function foo(x = 0) { } >foo : (x?: number) => void >x : number +>0 : number diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements10.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements10.symbols new file mode 100644 index 00000000000..2d68fc0007c --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements10.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements10.ts === +function foo(a = [0]) { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements10.ts, 0, 0)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements10.ts, 0, 13)) + +function bar(a = [0]) { +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements10.ts, 0, 25)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements10.ts, 2, 13)) +} diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements10.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements10.types index df28a085d85..8f8f03fafb1 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements10.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements10.types @@ -3,9 +3,11 @@ function foo(a = [0]) { } >foo : (a?: number[]) => void >a : number[] >[0] : number[] +>0 : number function bar(a = [0]) { >bar : (a?: number[]) => void >a : number[] >[0] : number[] +>0 : number } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements11.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements11.symbols new file mode 100644 index 00000000000..c73cf6ce4d8 --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements11.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements11.ts === +var v: any[]; +>v : Symbol(v, Decl(functionWithDefaultParameterWithNoStatements11.ts, 0, 3)) + +function foo(a = v[0]) { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements11.ts, 0, 13)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements11.ts, 2, 13)) +>v : Symbol(v, Decl(functionWithDefaultParameterWithNoStatements11.ts, 0, 3)) + +function bar(a = v[0]) { +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements11.ts, 2, 26)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements11.ts, 4, 13)) +>v : Symbol(v, Decl(functionWithDefaultParameterWithNoStatements11.ts, 0, 3)) +} diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements11.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements11.types index 5e522855e4b..e0a87bb2656 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements11.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements11.types @@ -7,10 +7,12 @@ function foo(a = v[0]) { } >a : any >v[0] : any >v : any[] +>0 : number function bar(a = v[0]) { >bar : (a?: any) => void >a : any >v[0] : any >v : any[] +>0 : number } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements12.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements12.symbols new file mode 100644 index 00000000000..49d428ce430 --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements12.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements12.ts === +var v: any[]; +>v : Symbol(v, Decl(functionWithDefaultParameterWithNoStatements12.ts, 0, 3)) + +function foo(a = (v)) { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements12.ts, 0, 13)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements12.ts, 2, 13)) +>v : Symbol(v, Decl(functionWithDefaultParameterWithNoStatements12.ts, 0, 3)) + +function bar(a = (v)) { +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements12.ts, 2, 25)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements12.ts, 4, 13)) +>v : Symbol(v, Decl(functionWithDefaultParameterWithNoStatements12.ts, 0, 3)) +} diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements13.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements13.symbols new file mode 100644 index 00000000000..3a2d5490967 --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements13.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements13.ts === +var v: any[]; +>v : Symbol(v, Decl(functionWithDefaultParameterWithNoStatements13.ts, 0, 3)) + +function foo(a = [1 + 1]) { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements13.ts, 0, 13)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements13.ts, 2, 13)) + +function bar(a = [1 + 1]) { +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements13.ts, 2, 29)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements13.ts, 4, 13)) +} diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements13.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements13.types index eccf0a92856..58c2009886a 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements13.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements13.types @@ -7,10 +7,14 @@ function foo(a = [1 + 1]) { } >a : number[] >[1 + 1] : number[] >1 + 1 : number +>1 : number +>1 : number function bar(a = [1 + 1]) { >bar : (a?: number[]) => void >a : number[] >[1 + 1] : number[] >1 + 1 : number +>1 : number +>1 : number } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements14.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements14.symbols new file mode 100644 index 00000000000..5d9d9598179 --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements14.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements14.ts === +var v: any[]; +>v : Symbol(v, Decl(functionWithDefaultParameterWithNoStatements14.ts, 0, 3)) + +function foo(a = v[1 + 1]) { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements14.ts, 0, 13)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements14.ts, 2, 13)) +>v : Symbol(v, Decl(functionWithDefaultParameterWithNoStatements14.ts, 0, 3)) + +function bar(a = v[1 + 1]) { +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements14.ts, 2, 30)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements14.ts, 4, 13)) +>v : Symbol(v, Decl(functionWithDefaultParameterWithNoStatements14.ts, 0, 3)) +} diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements14.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements14.types index c155b335e9a..2a5fbab6919 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements14.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements14.types @@ -8,6 +8,8 @@ function foo(a = v[1 + 1]) { } >v[1 + 1] : any >v : any[] >1 + 1 : number +>1 : number +>1 : number function bar(a = v[1 + 1]) { >bar : (a?: any) => void @@ -15,4 +17,6 @@ function bar(a = v[1 + 1]) { >v[1 + 1] : any >v : any[] >1 + 1 : number +>1 : number +>1 : number } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements15.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements15.symbols new file mode 100644 index 00000000000..37126ef4888 --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements15.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements15.ts === +var v: any[]; +>v : Symbol(v, Decl(functionWithDefaultParameterWithNoStatements15.ts, 0, 3)) + +function foo(a = (1 + 1)) { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements15.ts, 0, 13)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements15.ts, 2, 13)) + +function bar(a = (1 + 1)) { +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements15.ts, 2, 29)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements15.ts, 4, 13)) +} diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements15.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements15.types index a782b4bd15c..e35f5a5f4e0 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements15.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements15.types @@ -7,10 +7,14 @@ function foo(a = (1 + 1)) { } >a : number >(1 + 1) : number >1 + 1 : number +>1 : number +>1 : number function bar(a = (1 + 1)) { >bar : (a?: number) => void >a : number >(1 + 1) : number >1 + 1 : number +>1 : number +>1 : number } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements16.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements16.symbols new file mode 100644 index 00000000000..e9611c323ae --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements16.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements16.ts === +var v: any[]; +>v : Symbol(v, Decl(functionWithDefaultParameterWithNoStatements16.ts, 0, 3)) + +function foo(a = bar()) { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements16.ts, 0, 13)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements16.ts, 2, 13)) +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements16.ts, 2, 27)) + +function bar(a = foo()) { +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements16.ts, 2, 27)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements16.ts, 4, 13)) +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements16.ts, 0, 13)) +} diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements2.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements2.symbols new file mode 100644 index 00000000000..5c45a1be95d --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements2.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements2.ts === +function foo(x = 0) { +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements2.ts, 0, 0)) +>x : Symbol(x, Decl(functionWithDefaultParameterWithNoStatements2.ts, 0, 13)) +} diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements2.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements2.types index 9be77e7d82e..76b6b56dfa4 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements2.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements2.types @@ -2,4 +2,5 @@ function foo(x = 0) { >foo : (x?: number) => void >x : number +>0 : number } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements3.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements3.symbols new file mode 100644 index 00000000000..967241abca4 --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements3.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements3.ts === +function foo(a = "") { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements3.ts, 0, 0)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements3.ts, 0, 13)) + +function bar(a = "") { +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements3.ts, 0, 24)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements3.ts, 2, 13)) +} diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements3.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements3.types index 77895ae1cc9..4254c0d28a9 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements3.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements3.types @@ -2,8 +2,10 @@ function foo(a = "") { } >foo : (a?: string) => void >a : string +>"" : string function bar(a = "") { >bar : (a?: string) => void >a : string +>"" : string } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements4.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements4.symbols new file mode 100644 index 00000000000..8fedab52972 --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements4.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements4.ts === +function foo(a = ``) { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements4.ts, 0, 0)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements4.ts, 0, 13)) + +function bar(a = ``) { +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements4.ts, 0, 24)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements4.ts, 2, 13)) +} diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements4.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements4.types index 7071c956db2..bfc627fa60a 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements4.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements4.types @@ -2,8 +2,10 @@ function foo(a = ``) { } >foo : (a?: string) => void >a : string +>`` : string function bar(a = ``) { >bar : (a?: string) => void >a : string +>`` : string } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements5.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements5.symbols new file mode 100644 index 00000000000..8c1c44ed8ce --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements5.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements5.ts === +function foo(a = 0) { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements5.ts, 0, 0)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements5.ts, 0, 13)) + +function bar(a = 0) { +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements5.ts, 0, 23)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements5.ts, 2, 13)) +} diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements5.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements5.types index b7d53b544fa..99e93927e0a 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements5.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements5.types @@ -2,8 +2,10 @@ function foo(a = 0) { } >foo : (a?: number) => void >a : number +>0 : number function bar(a = 0) { >bar : (a?: number) => void >a : number +>0 : number } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements6.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements6.symbols new file mode 100644 index 00000000000..c9f0cc1c63b --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements6.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements6.ts === +function foo(a = true) { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements6.ts, 0, 0)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements6.ts, 0, 13)) + +function bar(a = true) { +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements6.ts, 0, 26)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements6.ts, 2, 13)) +} diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements6.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements6.types index b430bc70953..6100a6dedce 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements6.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements6.types @@ -2,8 +2,10 @@ function foo(a = true) { } >foo : (a?: boolean) => void >a : boolean +>true : boolean function bar(a = true) { >bar : (a?: boolean) => void >a : boolean +>true : boolean } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements7.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements7.symbols new file mode 100644 index 00000000000..c91bc726486 --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements7.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements7.ts === +function foo(a = false) { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements7.ts, 0, 0)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements7.ts, 0, 13)) + +function bar(a = false) { +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements7.ts, 0, 27)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements7.ts, 2, 13)) +} diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements7.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements7.types index baf83c870a9..866087a9f9b 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements7.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements7.types @@ -2,8 +2,10 @@ function foo(a = false) { } >foo : (a?: boolean) => void >a : boolean +>false : boolean function bar(a = false) { >bar : (a?: boolean) => void >a : boolean +>false : boolean } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements8.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements8.symbols new file mode 100644 index 00000000000..54df7f64ae1 --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements8.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements8.ts === +function foo(a = undefined) { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements8.ts, 0, 0)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements8.ts, 0, 13)) +>undefined : Symbol(undefined) + +function bar(a = undefined) { +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements8.ts, 0, 31)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements8.ts, 2, 13)) +>undefined : Symbol(undefined) +} diff --git a/tests/baselines/reference/funduleExportedClassIsUsedBeforeDeclaration.symbols b/tests/baselines/reference/funduleExportedClassIsUsedBeforeDeclaration.symbols new file mode 100644 index 00000000000..9a6aff630ce --- /dev/null +++ b/tests/baselines/reference/funduleExportedClassIsUsedBeforeDeclaration.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/funduleExportedClassIsUsedBeforeDeclaration.ts === +interface A { // interface before module declaration +>A : Symbol(A, Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 0, 0)) + + (): B.C; // uses defined below class in module +>B : Symbol(B, Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 2, 1), Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 3, 26)) +>C : Symbol(B.C, Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 4, 18)) +} +declare function B(): B.C; // function merged with module +>B : Symbol(B, Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 2, 1), Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 3, 26)) +>B : Symbol(B, Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 2, 1), Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 3, 26)) +>C : Symbol(B.C, Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 4, 18)) + +declare module B { +>B : Symbol(B, Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 2, 1), Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 3, 26)) + + export class C { // class defined in module +>C : Symbol(C, Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 4, 18)) + } +} +new B.C(); +>B.C : Symbol(B.C, Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 4, 18)) +>B : Symbol(B, Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 2, 1), Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 3, 26)) +>C : Symbol(B.C, Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 4, 18)) + diff --git a/tests/baselines/reference/funduleExportedClassIsUsedBeforeDeclaration.types b/tests/baselines/reference/funduleExportedClassIsUsedBeforeDeclaration.types index fa457680f07..74c1be3eb2c 100644 --- a/tests/baselines/reference/funduleExportedClassIsUsedBeforeDeclaration.types +++ b/tests/baselines/reference/funduleExportedClassIsUsedBeforeDeclaration.types @@ -3,12 +3,12 @@ interface A { // interface before module declaration >A : A (): B.C; // uses defined below class in module ->B : unknown +>B : any >C : B.C } declare function B(): B.C; // function merged with module >B : typeof B ->B : unknown +>B : any >C : B.C declare module B { diff --git a/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.symbols b/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.symbols new file mode 100644 index 00000000000..1f7a82628d3 --- /dev/null +++ b/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/funduleOfFunctionWithoutReturnTypeAnnotation.ts === +function fn() { +>fn : Symbol(fn, Decl(funduleOfFunctionWithoutReturnTypeAnnotation.ts, 0, 0), Decl(funduleOfFunctionWithoutReturnTypeAnnotation.ts, 2, 1)) + + return fn.n; +>fn.n : Symbol(fn.n, Decl(funduleOfFunctionWithoutReturnTypeAnnotation.ts, 4, 14)) +>fn : Symbol(fn, Decl(funduleOfFunctionWithoutReturnTypeAnnotation.ts, 0, 0), Decl(funduleOfFunctionWithoutReturnTypeAnnotation.ts, 2, 1)) +>n : Symbol(fn.n, Decl(funduleOfFunctionWithoutReturnTypeAnnotation.ts, 4, 14)) +} +module fn { +>fn : Symbol(fn, Decl(funduleOfFunctionWithoutReturnTypeAnnotation.ts, 0, 0), Decl(funduleOfFunctionWithoutReturnTypeAnnotation.ts, 2, 1)) + + export var n = 1; +>n : Symbol(n, Decl(funduleOfFunctionWithoutReturnTypeAnnotation.ts, 4, 14)) +} + diff --git a/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.types b/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.types index 9284ce3e19d..2d71370c2ac 100644 --- a/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.types +++ b/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.types @@ -12,5 +12,6 @@ module fn { export var n = 1; >n : number +>1 : number } diff --git a/tests/baselines/reference/funduleUsedAcrossFileBoundary.symbols b/tests/baselines/reference/funduleUsedAcrossFileBoundary.symbols new file mode 100644 index 00000000000..e0ca752d307 --- /dev/null +++ b/tests/baselines/reference/funduleUsedAcrossFileBoundary.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/funduleUsedAcrossFileBoundary_file1.ts === +declare function Q(value: T): string; +>Q : Symbol(Q, Decl(funduleUsedAcrossFileBoundary_file1.ts, 0, 0), Decl(funduleUsedAcrossFileBoundary_file1.ts, 0, 40)) +>T : Symbol(T, Decl(funduleUsedAcrossFileBoundary_file1.ts, 0, 19)) +>value : Symbol(value, Decl(funduleUsedAcrossFileBoundary_file1.ts, 0, 22)) +>T : Symbol(T, Decl(funduleUsedAcrossFileBoundary_file1.ts, 0, 19)) + +declare module Q { +>Q : Symbol(Q, Decl(funduleUsedAcrossFileBoundary_file1.ts, 0, 0), Decl(funduleUsedAcrossFileBoundary_file1.ts, 0, 40)) + + interface Promise { +>Promise : Symbol(Promise, Decl(funduleUsedAcrossFileBoundary_file1.ts, 1, 18)) +>T : Symbol(T, Decl(funduleUsedAcrossFileBoundary_file1.ts, 2, 22)) + + foo: string; +>foo : Symbol(foo, Decl(funduleUsedAcrossFileBoundary_file1.ts, 2, 26)) + } + export function defer(): string; +>defer : Symbol(defer, Decl(funduleUsedAcrossFileBoundary_file1.ts, 4, 5)) +>T : Symbol(T, Decl(funduleUsedAcrossFileBoundary_file1.ts, 5, 26)) +} + +=== tests/cases/compiler/funduleUsedAcrossFileBoundary_file2.ts === +function promiseWithCancellation(promise: Q.Promise) { +>promiseWithCancellation : Symbol(promiseWithCancellation, Decl(funduleUsedAcrossFileBoundary_file2.ts, 0, 0)) +>T : Symbol(T, Decl(funduleUsedAcrossFileBoundary_file2.ts, 0, 33)) +>promise : Symbol(promise, Decl(funduleUsedAcrossFileBoundary_file2.ts, 0, 36)) +>Q : Symbol(Q, Decl(funduleUsedAcrossFileBoundary_file1.ts, 0, 0), Decl(funduleUsedAcrossFileBoundary_file1.ts, 0, 40)) +>Promise : Symbol(Q.Promise, Decl(funduleUsedAcrossFileBoundary_file1.ts, 1, 18)) +>T : Symbol(T, Decl(funduleUsedAcrossFileBoundary_file2.ts, 0, 33)) + + var deferred = Q.defer(); // used to be an error +>deferred : Symbol(deferred, Decl(funduleUsedAcrossFileBoundary_file2.ts, 1, 7)) +>Q.defer : Symbol(Q.defer, Decl(funduleUsedAcrossFileBoundary_file1.ts, 4, 5)) +>Q : Symbol(Q, Decl(funduleUsedAcrossFileBoundary_file1.ts, 0, 0), Decl(funduleUsedAcrossFileBoundary_file1.ts, 0, 40)) +>defer : Symbol(Q.defer, Decl(funduleUsedAcrossFileBoundary_file1.ts, 4, 5)) +>T : Symbol(T, Decl(funduleUsedAcrossFileBoundary_file2.ts, 0, 33)) +} diff --git a/tests/baselines/reference/funduleUsedAcrossFileBoundary.types b/tests/baselines/reference/funduleUsedAcrossFileBoundary.types index 09fc76a257b..60da1786f5e 100644 --- a/tests/baselines/reference/funduleUsedAcrossFileBoundary.types +++ b/tests/baselines/reference/funduleUsedAcrossFileBoundary.types @@ -25,7 +25,7 @@ function promiseWithCancellation(promise: Q.Promise) { >promiseWithCancellation : (promise: Q.Promise) => void >T : T >promise : Q.Promise ->Q : unknown +>Q : any >Promise : Q.Promise >T : T diff --git a/tests/baselines/reference/generatedContextualTyping.symbols b/tests/baselines/reference/generatedContextualTyping.symbols new file mode 100644 index 00000000000..287b7be66d0 --- /dev/null +++ b/tests/baselines/reference/generatedContextualTyping.symbols @@ -0,0 +1,2831 @@ +=== tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts === +class Base { private p; } +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>p : Symbol(p, Decl(generatedContextualTyping.ts, 0, 12)) + +class Derived1 extends Base { private m; } +>Derived1 : Symbol(Derived1, Decl(generatedContextualTyping.ts, 0, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>m : Symbol(m, Decl(generatedContextualTyping.ts, 1, 29)) + +class Derived2 extends Base { private n; } +>Derived2 : Symbol(Derived2, Decl(generatedContextualTyping.ts, 1, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 2, 29)) + +interface Genric { func(n: T[]); } +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>T : Symbol(T, Decl(generatedContextualTyping.ts, 3, 17)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 3, 21)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 3, 27)) +>T : Symbol(T, Decl(generatedContextualTyping.ts, 3, 17)) + +var b = new Base(), d1 = new Derived1(), d2 = new Derived2(); +>b : Symbol(b, Decl(generatedContextualTyping.ts, 4, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>Derived1 : Symbol(Derived1, Decl(generatedContextualTyping.ts, 0, 25)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>Derived2 : Symbol(Derived2, Decl(generatedContextualTyping.ts, 1, 42)) + +var x1: () => Base[] = () => [d1, d2]; +>x1 : Symbol(x1, Decl(generatedContextualTyping.ts, 5, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x2: () => Base[] = function() { return [d1, d2] }; +>x2 : Symbol(x2, Decl(generatedContextualTyping.ts, 6, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x3: () => Base[] = function named() { return [d1, d2] }; +>x3 : Symbol(x3, Decl(generatedContextualTyping.ts, 7, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 7, 22)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x4: { (): Base[]; } = () => [d1, d2]; +>x4 : Symbol(x4, Decl(generatedContextualTyping.ts, 8, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x5: { (): Base[]; } = function() { return [d1, d2] }; +>x5 : Symbol(x5, Decl(generatedContextualTyping.ts, 9, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x6: { (): Base[]; } = function named() { return [d1, d2] }; +>x6 : Symbol(x6, Decl(generatedContextualTyping.ts, 10, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 10, 25)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x7: Base[] = [d1, d2]; +>x7 : Symbol(x7, Decl(generatedContextualTyping.ts, 11, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x8: Array = [d1, d2]; +>x8 : Symbol(x8, Decl(generatedContextualTyping.ts, 12, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x9: { [n: number]: Base; } = [d1, d2]; +>x9 : Symbol(x9, Decl(generatedContextualTyping.ts, 13, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 13, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x10: {n: Base[]; } = { n: [d1, d2] }; +>x10 : Symbol(x10, Decl(generatedContextualTyping.ts, 14, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 14, 10)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 14, 27)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x11: (s: Base[]) => any = n => { var n: Base[]; return null; }; +>x11 : Symbol(x11, Decl(generatedContextualTyping.ts, 15, 3)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 15, 10)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 15, 29), Decl(generatedContextualTyping.ts, 15, 40)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 15, 29), Decl(generatedContextualTyping.ts, 15, 40)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +var x12: Genric = { func: n => { return [d1, d2]; } }; +>x12 : Symbol(x12, Decl(generatedContextualTyping.ts, 16, 3)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 16, 25)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 16, 31)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x13 { member: () => Base[] = () => [d1, d2] } +>x13 : Symbol(x13, Decl(generatedContextualTyping.ts, 16, 60)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 17, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x14 { member: () => Base[] = function() { return [d1, d2] } } +>x14 : Symbol(x14, Decl(generatedContextualTyping.ts, 17, 51)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 18, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x15 { member: () => Base[] = function named() { return [d1, d2] } } +>x15 : Symbol(x15, Decl(generatedContextualTyping.ts, 18, 67)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 19, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 19, 34)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x16 { member: { (): Base[]; } = () => [d1, d2] } +>x16 : Symbol(x16, Decl(generatedContextualTyping.ts, 19, 73)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 20, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x17 { member: { (): Base[]; } = function() { return [d1, d2] } } +>x17 : Symbol(x17, Decl(generatedContextualTyping.ts, 20, 54)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 21, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x18 { member: { (): Base[]; } = function named() { return [d1, d2] } } +>x18 : Symbol(x18, Decl(generatedContextualTyping.ts, 21, 70)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 22, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 22, 37)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x19 { member: Base[] = [d1, d2] } +>x19 : Symbol(x19, Decl(generatedContextualTyping.ts, 22, 76)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 23, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x20 { member: Array = [d1, d2] } +>x20 : Symbol(x20, Decl(generatedContextualTyping.ts, 23, 39)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 24, 11)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x21 { member: { [n: number]: Base; } = [d1, d2] } +>x21 : Symbol(x21, Decl(generatedContextualTyping.ts, 24, 44)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 25, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 25, 23)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x22 { member: {n: Base[]; } = { n: [d1, d2] } } +>x22 : Symbol(x22, Decl(generatedContextualTyping.ts, 25, 55)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 26, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 26, 21)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 26, 38)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x23 { member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +>x23 : Symbol(x23, Decl(generatedContextualTyping.ts, 26, 54)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 27, 11)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 27, 21)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 27, 40), Decl(generatedContextualTyping.ts, 27, 51)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 27, 40), Decl(generatedContextualTyping.ts, 27, 51)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +class x24 { member: Genric = { func: n => { return [d1, d2]; } } } +>x24 : Symbol(x24, Decl(generatedContextualTyping.ts, 27, 79)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 28, 11)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 28, 36)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 28, 42)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x25 { private member: () => Base[] = () => [d1, d2] } +>x25 : Symbol(x25, Decl(generatedContextualTyping.ts, 28, 72)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 29, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x26 { private member: () => Base[] = function() { return [d1, d2] } } +>x26 : Symbol(x26, Decl(generatedContextualTyping.ts, 29, 59)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 30, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x27 { private member: () => Base[] = function named() { return [d1, d2] } } +>x27 : Symbol(x27, Decl(generatedContextualTyping.ts, 30, 75)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 31, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 31, 42)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x28 { private member: { (): Base[]; } = () => [d1, d2] } +>x28 : Symbol(x28, Decl(generatedContextualTyping.ts, 31, 81)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 32, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x29 { private member: { (): Base[]; } = function() { return [d1, d2] } } +>x29 : Symbol(x29, Decl(generatedContextualTyping.ts, 32, 62)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 33, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x30 { private member: { (): Base[]; } = function named() { return [d1, d2] } } +>x30 : Symbol(x30, Decl(generatedContextualTyping.ts, 33, 78)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 34, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 34, 45)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x31 { private member: Base[] = [d1, d2] } +>x31 : Symbol(x31, Decl(generatedContextualTyping.ts, 34, 84)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 35, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x32 { private member: Array = [d1, d2] } +>x32 : Symbol(x32, Decl(generatedContextualTyping.ts, 35, 47)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 36, 11)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x33 { private member: { [n: number]: Base; } = [d1, d2] } +>x33 : Symbol(x33, Decl(generatedContextualTyping.ts, 36, 52)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 37, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 37, 31)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x34 { private member: {n: Base[]; } = { n: [d1, d2] } } +>x34 : Symbol(x34, Decl(generatedContextualTyping.ts, 37, 63)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 38, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 38, 29)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 38, 46)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x35 { private member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +>x35 : Symbol(x35, Decl(generatedContextualTyping.ts, 38, 62)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 39, 11)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 39, 29)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 39, 48), Decl(generatedContextualTyping.ts, 39, 59)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 39, 48), Decl(generatedContextualTyping.ts, 39, 59)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +class x36 { private member: Genric = { func: n => { return [d1, d2]; } } } +>x36 : Symbol(x36, Decl(generatedContextualTyping.ts, 39, 87)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 40, 11)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 40, 44)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 40, 50)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x37 { public member: () => Base[] = () => [d1, d2] } +>x37 : Symbol(x37, Decl(generatedContextualTyping.ts, 40, 80)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 41, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x38 { public member: () => Base[] = function() { return [d1, d2] } } +>x38 : Symbol(x38, Decl(generatedContextualTyping.ts, 41, 58)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 42, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x39 { public member: () => Base[] = function named() { return [d1, d2] } } +>x39 : Symbol(x39, Decl(generatedContextualTyping.ts, 42, 74)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 43, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 43, 41)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x40 { public member: { (): Base[]; } = () => [d1, d2] } +>x40 : Symbol(x40, Decl(generatedContextualTyping.ts, 43, 80)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 44, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x41 { public member: { (): Base[]; } = function() { return [d1, d2] } } +>x41 : Symbol(x41, Decl(generatedContextualTyping.ts, 44, 61)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 45, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x42 { public member: { (): Base[]; } = function named() { return [d1, d2] } } +>x42 : Symbol(x42, Decl(generatedContextualTyping.ts, 45, 77)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 46, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 46, 44)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x43 { public member: Base[] = [d1, d2] } +>x43 : Symbol(x43, Decl(generatedContextualTyping.ts, 46, 83)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 47, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x44 { public member: Array = [d1, d2] } +>x44 : Symbol(x44, Decl(generatedContextualTyping.ts, 47, 46)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 48, 11)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x45 { public member: { [n: number]: Base; } = [d1, d2] } +>x45 : Symbol(x45, Decl(generatedContextualTyping.ts, 48, 51)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 49, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 49, 30)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x46 { public member: {n: Base[]; } = { n: [d1, d2] } } +>x46 : Symbol(x46, Decl(generatedContextualTyping.ts, 49, 62)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 50, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 50, 28)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 50, 45)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x47 { public member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +>x47 : Symbol(x47, Decl(generatedContextualTyping.ts, 50, 61)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 51, 11)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 51, 28)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 51, 47), Decl(generatedContextualTyping.ts, 51, 58)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 51, 47), Decl(generatedContextualTyping.ts, 51, 58)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +class x48 { public member: Genric = { func: n => { return [d1, d2]; } } } +>x48 : Symbol(x48, Decl(generatedContextualTyping.ts, 51, 86)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 52, 11)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 52, 43)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 52, 49)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x49 { static member: () => Base[] = () => [d1, d2] } +>x49 : Symbol(x49, Decl(generatedContextualTyping.ts, 52, 79)) +>member : Symbol(x49.member, Decl(generatedContextualTyping.ts, 53, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x50 { static member: () => Base[] = function() { return [d1, d2] } } +>x50 : Symbol(x50, Decl(generatedContextualTyping.ts, 53, 58)) +>member : Symbol(x50.member, Decl(generatedContextualTyping.ts, 54, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x51 { static member: () => Base[] = function named() { return [d1, d2] } } +>x51 : Symbol(x51, Decl(generatedContextualTyping.ts, 54, 74)) +>member : Symbol(x51.member, Decl(generatedContextualTyping.ts, 55, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 55, 41)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x52 { static member: { (): Base[]; } = () => [d1, d2] } +>x52 : Symbol(x52, Decl(generatedContextualTyping.ts, 55, 80)) +>member : Symbol(x52.member, Decl(generatedContextualTyping.ts, 56, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x53 { static member: { (): Base[]; } = function() { return [d1, d2] } } +>x53 : Symbol(x53, Decl(generatedContextualTyping.ts, 56, 61)) +>member : Symbol(x53.member, Decl(generatedContextualTyping.ts, 57, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x54 { static member: { (): Base[]; } = function named() { return [d1, d2] } } +>x54 : Symbol(x54, Decl(generatedContextualTyping.ts, 57, 77)) +>member : Symbol(x54.member, Decl(generatedContextualTyping.ts, 58, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 58, 44)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x55 { static member: Base[] = [d1, d2] } +>x55 : Symbol(x55, Decl(generatedContextualTyping.ts, 58, 83)) +>member : Symbol(x55.member, Decl(generatedContextualTyping.ts, 59, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x56 { static member: Array = [d1, d2] } +>x56 : Symbol(x56, Decl(generatedContextualTyping.ts, 59, 46)) +>member : Symbol(x56.member, Decl(generatedContextualTyping.ts, 60, 11)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x57 { static member: { [n: number]: Base; } = [d1, d2] } +>x57 : Symbol(x57, Decl(generatedContextualTyping.ts, 60, 51)) +>member : Symbol(x57.member, Decl(generatedContextualTyping.ts, 61, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 61, 30)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x58 { static member: {n: Base[]; } = { n: [d1, d2] } } +>x58 : Symbol(x58, Decl(generatedContextualTyping.ts, 61, 62)) +>member : Symbol(x58.member, Decl(generatedContextualTyping.ts, 62, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 62, 28)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 62, 45)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x59 { static member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +>x59 : Symbol(x59, Decl(generatedContextualTyping.ts, 62, 61)) +>member : Symbol(x59.member, Decl(generatedContextualTyping.ts, 63, 11)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 63, 28)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 63, 47), Decl(generatedContextualTyping.ts, 63, 58)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 63, 47), Decl(generatedContextualTyping.ts, 63, 58)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +class x60 { static member: Genric = { func: n => { return [d1, d2]; } } } +>x60 : Symbol(x60, Decl(generatedContextualTyping.ts, 63, 86)) +>member : Symbol(x60.member, Decl(generatedContextualTyping.ts, 64, 11)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 64, 43)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 64, 49)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x61 { private static member: () => Base[] = () => [d1, d2] } +>x61 : Symbol(x61, Decl(generatedContextualTyping.ts, 64, 79)) +>member : Symbol(x61.member, Decl(generatedContextualTyping.ts, 65, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x62 { private static member: () => Base[] = function() { return [d1, d2] } } +>x62 : Symbol(x62, Decl(generatedContextualTyping.ts, 65, 66)) +>member : Symbol(x62.member, Decl(generatedContextualTyping.ts, 66, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x63 { private static member: () => Base[] = function named() { return [d1, d2] } } +>x63 : Symbol(x63, Decl(generatedContextualTyping.ts, 66, 82)) +>member : Symbol(x63.member, Decl(generatedContextualTyping.ts, 67, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 67, 49)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x64 { private static member: { (): Base[]; } = () => [d1, d2] } +>x64 : Symbol(x64, Decl(generatedContextualTyping.ts, 67, 88)) +>member : Symbol(x64.member, Decl(generatedContextualTyping.ts, 68, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x65 { private static member: { (): Base[]; } = function() { return [d1, d2] } } +>x65 : Symbol(x65, Decl(generatedContextualTyping.ts, 68, 69)) +>member : Symbol(x65.member, Decl(generatedContextualTyping.ts, 69, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x66 { private static member: { (): Base[]; } = function named() { return [d1, d2] } } +>x66 : Symbol(x66, Decl(generatedContextualTyping.ts, 69, 85)) +>member : Symbol(x66.member, Decl(generatedContextualTyping.ts, 70, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 70, 52)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x67 { private static member: Base[] = [d1, d2] } +>x67 : Symbol(x67, Decl(generatedContextualTyping.ts, 70, 91)) +>member : Symbol(x67.member, Decl(generatedContextualTyping.ts, 71, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x68 { private static member: Array = [d1, d2] } +>x68 : Symbol(x68, Decl(generatedContextualTyping.ts, 71, 54)) +>member : Symbol(x68.member, Decl(generatedContextualTyping.ts, 72, 11)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x69 { private static member: { [n: number]: Base; } = [d1, d2] } +>x69 : Symbol(x69, Decl(generatedContextualTyping.ts, 72, 59)) +>member : Symbol(x69.member, Decl(generatedContextualTyping.ts, 73, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 73, 38)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x70 { private static member: {n: Base[]; } = { n: [d1, d2] } } +>x70 : Symbol(x70, Decl(generatedContextualTyping.ts, 73, 70)) +>member : Symbol(x70.member, Decl(generatedContextualTyping.ts, 74, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 74, 36)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 74, 53)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x71 { private static member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +>x71 : Symbol(x71, Decl(generatedContextualTyping.ts, 74, 69)) +>member : Symbol(x71.member, Decl(generatedContextualTyping.ts, 75, 11)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 75, 36)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 75, 55), Decl(generatedContextualTyping.ts, 75, 66)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 75, 55), Decl(generatedContextualTyping.ts, 75, 66)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +class x72 { private static member: Genric = { func: n => { return [d1, d2]; } } } +>x72 : Symbol(x72, Decl(generatedContextualTyping.ts, 75, 94)) +>member : Symbol(x72.member, Decl(generatedContextualTyping.ts, 76, 11)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 76, 51)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 76, 57)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x73 { public static member: () => Base[] = () => [d1, d2] } +>x73 : Symbol(x73, Decl(generatedContextualTyping.ts, 76, 87)) +>member : Symbol(x73.member, Decl(generatedContextualTyping.ts, 77, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x74 { public static member: () => Base[] = function() { return [d1, d2] } } +>x74 : Symbol(x74, Decl(generatedContextualTyping.ts, 77, 65)) +>member : Symbol(x74.member, Decl(generatedContextualTyping.ts, 78, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x75 { public static member: () => Base[] = function named() { return [d1, d2] } } +>x75 : Symbol(x75, Decl(generatedContextualTyping.ts, 78, 81)) +>member : Symbol(x75.member, Decl(generatedContextualTyping.ts, 79, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 79, 48)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x76 { public static member: { (): Base[]; } = () => [d1, d2] } +>x76 : Symbol(x76, Decl(generatedContextualTyping.ts, 79, 87)) +>member : Symbol(x76.member, Decl(generatedContextualTyping.ts, 80, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x77 { public static member: { (): Base[]; } = function() { return [d1, d2] } } +>x77 : Symbol(x77, Decl(generatedContextualTyping.ts, 80, 68)) +>member : Symbol(x77.member, Decl(generatedContextualTyping.ts, 81, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x78 { public static member: { (): Base[]; } = function named() { return [d1, d2] } } +>x78 : Symbol(x78, Decl(generatedContextualTyping.ts, 81, 84)) +>member : Symbol(x78.member, Decl(generatedContextualTyping.ts, 82, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 82, 51)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x79 { public static member: Base[] = [d1, d2] } +>x79 : Symbol(x79, Decl(generatedContextualTyping.ts, 82, 90)) +>member : Symbol(x79.member, Decl(generatedContextualTyping.ts, 83, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x80 { public static member: Array = [d1, d2] } +>x80 : Symbol(x80, Decl(generatedContextualTyping.ts, 83, 53)) +>member : Symbol(x80.member, Decl(generatedContextualTyping.ts, 84, 11)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x81 { public static member: { [n: number]: Base; } = [d1, d2] } +>x81 : Symbol(x81, Decl(generatedContextualTyping.ts, 84, 58)) +>member : Symbol(x81.member, Decl(generatedContextualTyping.ts, 85, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 85, 37)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x82 { public static member: {n: Base[]; } = { n: [d1, d2] } } +>x82 : Symbol(x82, Decl(generatedContextualTyping.ts, 85, 69)) +>member : Symbol(x82.member, Decl(generatedContextualTyping.ts, 86, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 86, 35)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 86, 52)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x83 { public static member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +>x83 : Symbol(x83, Decl(generatedContextualTyping.ts, 86, 68)) +>member : Symbol(x83.member, Decl(generatedContextualTyping.ts, 87, 11)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 87, 35)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 87, 54), Decl(generatedContextualTyping.ts, 87, 65)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 87, 54), Decl(generatedContextualTyping.ts, 87, 65)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +class x84 { public static member: Genric = { func: n => { return [d1, d2]; } } } +>x84 : Symbol(x84, Decl(generatedContextualTyping.ts, 87, 93)) +>member : Symbol(x84.member, Decl(generatedContextualTyping.ts, 88, 11)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 88, 50)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 88, 56)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x85 { constructor(parm: () => Base[] = () => [d1, d2]) { } } +>x85 : Symbol(x85, Decl(generatedContextualTyping.ts, 88, 86)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 89, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x86 { constructor(parm: () => Base[] = function() { return [d1, d2] }) { } } +>x86 : Symbol(x86, Decl(generatedContextualTyping.ts, 89, 66)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 90, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x87 { constructor(parm: () => Base[] = function named() { return [d1, d2] }) { } } +>x87 : Symbol(x87, Decl(generatedContextualTyping.ts, 90, 82)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 91, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 91, 44)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x88 { constructor(parm: { (): Base[]; } = () => [d1, d2]) { } } +>x88 : Symbol(x88, Decl(generatedContextualTyping.ts, 91, 88)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 92, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x89 { constructor(parm: { (): Base[]; } = function() { return [d1, d2] }) { } } +>x89 : Symbol(x89, Decl(generatedContextualTyping.ts, 92, 69)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 93, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x90 { constructor(parm: { (): Base[]; } = function named() { return [d1, d2] }) { } } +>x90 : Symbol(x90, Decl(generatedContextualTyping.ts, 93, 85)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 94, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 94, 47)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x91 { constructor(parm: Base[] = [d1, d2]) { } } +>x91 : Symbol(x91, Decl(generatedContextualTyping.ts, 94, 91)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 95, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x92 { constructor(parm: Array = [d1, d2]) { } } +>x92 : Symbol(x92, Decl(generatedContextualTyping.ts, 95, 54)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 96, 24)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x93 { constructor(parm: { [n: number]: Base; } = [d1, d2]) { } } +>x93 : Symbol(x93, Decl(generatedContextualTyping.ts, 96, 59)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 97, 24)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 97, 33)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x94 { constructor(parm: {n: Base[]; } = { n: [d1, d2] }) { } } +>x94 : Symbol(x94, Decl(generatedContextualTyping.ts, 97, 70)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 98, 24)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 98, 31)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 98, 48)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x95 { constructor(parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } } +>x95 : Symbol(x95, Decl(generatedContextualTyping.ts, 98, 69)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 99, 24)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 99, 31)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 99, 50), Decl(generatedContextualTyping.ts, 99, 61)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 99, 50), Decl(generatedContextualTyping.ts, 99, 61)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +class x96 { constructor(parm: Genric = { func: n => { return [d1, d2]; } }) { } } +>x96 : Symbol(x96, Decl(generatedContextualTyping.ts, 99, 94)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 100, 24)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 100, 46)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 100, 52)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x97 { constructor(public parm: () => Base[] = () => [d1, d2]) { } } +>x97 : Symbol(x97, Decl(generatedContextualTyping.ts, 100, 87)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 101, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x98 { constructor(public parm: () => Base[] = function() { return [d1, d2] }) { } } +>x98 : Symbol(x98, Decl(generatedContextualTyping.ts, 101, 73)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 102, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x99 { constructor(public parm: () => Base[] = function named() { return [d1, d2] }) { } } +>x99 : Symbol(x99, Decl(generatedContextualTyping.ts, 102, 89)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 103, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 103, 51)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x100 { constructor(public parm: { (): Base[]; } = () => [d1, d2]) { } } +>x100 : Symbol(x100, Decl(generatedContextualTyping.ts, 103, 95)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 104, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x101 { constructor(public parm: { (): Base[]; } = function() { return [d1, d2] }) { } } +>x101 : Symbol(x101, Decl(generatedContextualTyping.ts, 104, 77)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 105, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x102 { constructor(public parm: { (): Base[]; } = function named() { return [d1, d2] }) { } } +>x102 : Symbol(x102, Decl(generatedContextualTyping.ts, 105, 93)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 106, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 106, 55)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x103 { constructor(public parm: Base[] = [d1, d2]) { } } +>x103 : Symbol(x103, Decl(generatedContextualTyping.ts, 106, 99)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 107, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x104 { constructor(public parm: Array = [d1, d2]) { } } +>x104 : Symbol(x104, Decl(generatedContextualTyping.ts, 107, 62)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 108, 25)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x105 { constructor(public parm: { [n: number]: Base; } = [d1, d2]) { } } +>x105 : Symbol(x105, Decl(generatedContextualTyping.ts, 108, 67)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 109, 25)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 109, 41)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x106 { constructor(public parm: {n: Base[]; } = { n: [d1, d2] }) { } } +>x106 : Symbol(x106, Decl(generatedContextualTyping.ts, 109, 78)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 110, 25)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 110, 39)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 110, 56)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x107 { constructor(public parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } } +>x107 : Symbol(x107, Decl(generatedContextualTyping.ts, 110, 77)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 111, 25)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 111, 39)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 111, 58), Decl(generatedContextualTyping.ts, 111, 69)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 111, 58), Decl(generatedContextualTyping.ts, 111, 69)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +class x108 { constructor(public parm: Genric = { func: n => { return [d1, d2]; } }) { } } +>x108 : Symbol(x108, Decl(generatedContextualTyping.ts, 111, 102)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 112, 25)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 112, 54)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 112, 60)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x109 { constructor(private parm: () => Base[] = () => [d1, d2]) { } } +>x109 : Symbol(x109, Decl(generatedContextualTyping.ts, 112, 95)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 113, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x110 { constructor(private parm: () => Base[] = function() { return [d1, d2] }) { } } +>x110 : Symbol(x110, Decl(generatedContextualTyping.ts, 113, 75)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 114, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x111 { constructor(private parm: () => Base[] = function named() { return [d1, d2] }) { } } +>x111 : Symbol(x111, Decl(generatedContextualTyping.ts, 114, 91)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 115, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 115, 53)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x112 { constructor(private parm: { (): Base[]; } = () => [d1, d2]) { } } +>x112 : Symbol(x112, Decl(generatedContextualTyping.ts, 115, 97)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 116, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x113 { constructor(private parm: { (): Base[]; } = function() { return [d1, d2] }) { } } +>x113 : Symbol(x113, Decl(generatedContextualTyping.ts, 116, 78)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 117, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x114 { constructor(private parm: { (): Base[]; } = function named() { return [d1, d2] }) { } } +>x114 : Symbol(x114, Decl(generatedContextualTyping.ts, 117, 94)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 118, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 118, 56)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x115 { constructor(private parm: Base[] = [d1, d2]) { } } +>x115 : Symbol(x115, Decl(generatedContextualTyping.ts, 118, 100)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 119, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x116 { constructor(private parm: Array = [d1, d2]) { } } +>x116 : Symbol(x116, Decl(generatedContextualTyping.ts, 119, 63)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 120, 25)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x117 { constructor(private parm: { [n: number]: Base; } = [d1, d2]) { } } +>x117 : Symbol(x117, Decl(generatedContextualTyping.ts, 120, 68)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 121, 25)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 121, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x118 { constructor(private parm: {n: Base[]; } = { n: [d1, d2] }) { } } +>x118 : Symbol(x118, Decl(generatedContextualTyping.ts, 121, 79)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 122, 25)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 122, 40)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 122, 57)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x119 { constructor(private parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } } +>x119 : Symbol(x119, Decl(generatedContextualTyping.ts, 122, 78)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 123, 25)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 123, 40)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 123, 59), Decl(generatedContextualTyping.ts, 123, 70)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 123, 59), Decl(generatedContextualTyping.ts, 123, 70)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +class x120 { constructor(private parm: Genric = { func: n => { return [d1, d2]; } }) { } } +>x120 : Symbol(x120, Decl(generatedContextualTyping.ts, 123, 103)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 124, 25)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 124, 55)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 124, 61)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x121(parm: () => Base[] = () => [d1, d2]) { } +>x121 : Symbol(x121, Decl(generatedContextualTyping.ts, 124, 96)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 125, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x122(parm: () => Base[] = function() { return [d1, d2] }) { } +>x122 : Symbol(x122, Decl(generatedContextualTyping.ts, 125, 54)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 126, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x123(parm: () => Base[] = function named() { return [d1, d2] }) { } +>x123 : Symbol(x123, Decl(generatedContextualTyping.ts, 126, 70)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 127, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 127, 34)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x124(parm: { (): Base[]; } = () => [d1, d2]) { } +>x124 : Symbol(x124, Decl(generatedContextualTyping.ts, 127, 76)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 128, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x125(parm: { (): Base[]; } = function() { return [d1, d2] }) { } +>x125 : Symbol(x125, Decl(generatedContextualTyping.ts, 128, 57)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 129, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x126(parm: { (): Base[]; } = function named() { return [d1, d2] }) { } +>x126 : Symbol(x126, Decl(generatedContextualTyping.ts, 129, 73)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 130, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 130, 37)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x127(parm: Base[] = [d1, d2]) { } +>x127 : Symbol(x127, Decl(generatedContextualTyping.ts, 130, 79)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 131, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x128(parm: Array = [d1, d2]) { } +>x128 : Symbol(x128, Decl(generatedContextualTyping.ts, 131, 42)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 132, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x129(parm: { [n: number]: Base; } = [d1, d2]) { } +>x129 : Symbol(x129, Decl(generatedContextualTyping.ts, 132, 47)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 133, 14)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 133, 23)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x130(parm: {n: Base[]; } = { n: [d1, d2] }) { } +>x130 : Symbol(x130, Decl(generatedContextualTyping.ts, 133, 58)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 134, 14)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 134, 21)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 134, 38)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x131(parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } +>x131 : Symbol(x131, Decl(generatedContextualTyping.ts, 134, 57)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 135, 14)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 135, 21)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 135, 40), Decl(generatedContextualTyping.ts, 135, 51)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 135, 40), Decl(generatedContextualTyping.ts, 135, 51)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +function x132(parm: Genric = { func: n => { return [d1, d2]; } }) { } +>x132 : Symbol(x132, Decl(generatedContextualTyping.ts, 135, 82)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 136, 14)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 136, 36)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 136, 42)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x133(): () => Base[] { return () => [d1, d2]; } +>x133 : Symbol(x133, Decl(generatedContextualTyping.ts, 136, 75)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x134(): () => Base[] { return function() { return [d1, d2] }; } +>x134 : Symbol(x134, Decl(generatedContextualTyping.ts, 137, 56)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x135(): () => Base[] { return function named() { return [d1, d2] }; } +>x135 : Symbol(x135, Decl(generatedContextualTyping.ts, 138, 72)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 139, 38)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x136(): { (): Base[]; } { return () => [d1, d2]; } +>x136 : Symbol(x136, Decl(generatedContextualTyping.ts, 139, 78)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x137(): { (): Base[]; } { return function() { return [d1, d2] }; } +>x137 : Symbol(x137, Decl(generatedContextualTyping.ts, 140, 59)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x138(): { (): Base[]; } { return function named() { return [d1, d2] }; } +>x138 : Symbol(x138, Decl(generatedContextualTyping.ts, 141, 75)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 142, 41)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x139(): Base[] { return [d1, d2]; } +>x139 : Symbol(x139, Decl(generatedContextualTyping.ts, 142, 81)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x140(): Array { return [d1, d2]; } +>x140 : Symbol(x140, Decl(generatedContextualTyping.ts, 143, 44)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x141(): { [n: number]: Base; } { return [d1, d2]; } +>x141 : Symbol(x141, Decl(generatedContextualTyping.ts, 144, 49)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 145, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x142(): {n: Base[]; } { return { n: [d1, d2] }; } +>x142 : Symbol(x142, Decl(generatedContextualTyping.ts, 145, 60)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 146, 18)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 146, 42)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x143(): (s: Base[]) => any { return n => { var n: Base[]; return null; }; } +>x143 : Symbol(x143, Decl(generatedContextualTyping.ts, 146, 59)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 147, 18)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 147, 44), Decl(generatedContextualTyping.ts, 147, 55)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 147, 44), Decl(generatedContextualTyping.ts, 147, 55)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +function x144(): Genric { return { func: n => { return [d1, d2]; } }; } +>x144 : Symbol(x144, Decl(generatedContextualTyping.ts, 147, 84)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 148, 40)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 148, 46)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x145(): () => Base[] { return () => [d1, d2]; return () => [d1, d2]; } +>x145 : Symbol(x145, Decl(generatedContextualTyping.ts, 148, 77)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x146(): () => Base[] { return function() { return [d1, d2] }; return function() { return [d1, d2] }; } +>x146 : Symbol(x146, Decl(generatedContextualTyping.ts, 149, 79)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x147(): () => Base[] { return function named() { return [d1, d2] }; return function named() { return [d1, d2] }; } +>x147 : Symbol(x147, Decl(generatedContextualTyping.ts, 150, 111)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 151, 38)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 151, 83)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x148(): { (): Base[]; } { return () => [d1, d2]; return () => [d1, d2]; } +>x148 : Symbol(x148, Decl(generatedContextualTyping.ts, 151, 123)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x149(): { (): Base[]; } { return function() { return [d1, d2] }; return function() { return [d1, d2] }; } +>x149 : Symbol(x149, Decl(generatedContextualTyping.ts, 152, 82)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x150(): { (): Base[]; } { return function named() { return [d1, d2] }; return function named() { return [d1, d2] }; } +>x150 : Symbol(x150, Decl(generatedContextualTyping.ts, 153, 114)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 154, 41)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 154, 86)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x151(): Base[] { return [d1, d2]; return [d1, d2]; } +>x151 : Symbol(x151, Decl(generatedContextualTyping.ts, 154, 126)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x152(): Array { return [d1, d2]; return [d1, d2]; } +>x152 : Symbol(x152, Decl(generatedContextualTyping.ts, 155, 61)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x153(): { [n: number]: Base; } { return [d1, d2]; return [d1, d2]; } +>x153 : Symbol(x153, Decl(generatedContextualTyping.ts, 156, 66)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 157, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x154(): {n: Base[]; } { return { n: [d1, d2] }; return { n: [d1, d2] }; } +>x154 : Symbol(x154, Decl(generatedContextualTyping.ts, 157, 77)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 158, 18)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 158, 42)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 158, 66)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x155(): (s: Base[]) => any { return n => { var n: Base[]; return null; }; return n => { var n: Base[]; return null; }; } +>x155 : Symbol(x155, Decl(generatedContextualTyping.ts, 158, 83)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 159, 18)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 159, 44), Decl(generatedContextualTyping.ts, 159, 55)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 159, 44), Decl(generatedContextualTyping.ts, 159, 55)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 159, 89), Decl(generatedContextualTyping.ts, 159, 100)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 159, 89), Decl(generatedContextualTyping.ts, 159, 100)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +function x156(): Genric { return { func: n => { return [d1, d2]; } }; return { func: n => { return [d1, d2]; } }; } +>x156 : Symbol(x156, Decl(generatedContextualTyping.ts, 159, 129)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 160, 40)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 160, 46)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 160, 84)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 160, 90)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x157: () => () => Base[] = () => { return () => [d1, d2]; }; +>x157 : Symbol(x157, Decl(generatedContextualTyping.ts, 161, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x158: () => () => Base[] = () => { return function() { return [d1, d2] }; }; +>x158 : Symbol(x158, Decl(generatedContextualTyping.ts, 162, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x159: () => () => Base[] = () => { return function named() { return [d1, d2] }; }; +>x159 : Symbol(x159, Decl(generatedContextualTyping.ts, 163, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 163, 45)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x160: () => { (): Base[]; } = () => { return () => [d1, d2]; }; +>x160 : Symbol(x160, Decl(generatedContextualTyping.ts, 164, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x161: () => { (): Base[]; } = () => { return function() { return [d1, d2] }; }; +>x161 : Symbol(x161, Decl(generatedContextualTyping.ts, 165, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x162: () => { (): Base[]; } = () => { return function named() { return [d1, d2] }; }; +>x162 : Symbol(x162, Decl(generatedContextualTyping.ts, 166, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 166, 48)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x163: () => Base[] = () => { return [d1, d2]; }; +>x163 : Symbol(x163, Decl(generatedContextualTyping.ts, 167, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x164: () => Array = () => { return [d1, d2]; }; +>x164 : Symbol(x164, Decl(generatedContextualTyping.ts, 168, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x165: () => { [n: number]: Base; } = () => { return [d1, d2]; }; +>x165 : Symbol(x165, Decl(generatedContextualTyping.ts, 169, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 169, 19)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x166: () => {n: Base[]; } = () => { return { n: [d1, d2] }; }; +>x166 : Symbol(x166, Decl(generatedContextualTyping.ts, 170, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 170, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 170, 49)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x167: () => (s: Base[]) => any = () => { return n => { var n: Base[]; return null; }; }; +>x167 : Symbol(x167, Decl(generatedContextualTyping.ts, 171, 3)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 171, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 171, 51), Decl(generatedContextualTyping.ts, 171, 62)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 171, 51), Decl(generatedContextualTyping.ts, 171, 62)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +var x168: () => Genric = () => { return { func: n => { return [d1, d2]; } }; }; +>x168 : Symbol(x168, Decl(generatedContextualTyping.ts, 172, 3)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 172, 47)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 172, 53)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x169: () => () => Base[] = function() { return () => [d1, d2]; }; +>x169 : Symbol(x169, Decl(generatedContextualTyping.ts, 173, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x170: () => () => Base[] = function() { return function() { return [d1, d2] }; }; +>x170 : Symbol(x170, Decl(generatedContextualTyping.ts, 174, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x171: () => () => Base[] = function() { return function named() { return [d1, d2] }; }; +>x171 : Symbol(x171, Decl(generatedContextualTyping.ts, 175, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 175, 50)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x172: () => { (): Base[]; } = function() { return () => [d1, d2]; }; +>x172 : Symbol(x172, Decl(generatedContextualTyping.ts, 176, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x173: () => { (): Base[]; } = function() { return function() { return [d1, d2] }; }; +>x173 : Symbol(x173, Decl(generatedContextualTyping.ts, 177, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x174: () => { (): Base[]; } = function() { return function named() { return [d1, d2] }; }; +>x174 : Symbol(x174, Decl(generatedContextualTyping.ts, 178, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 178, 53)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x175: () => Base[] = function() { return [d1, d2]; }; +>x175 : Symbol(x175, Decl(generatedContextualTyping.ts, 179, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x176: () => Array = function() { return [d1, d2]; }; +>x176 : Symbol(x176, Decl(generatedContextualTyping.ts, 180, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x177: () => { [n: number]: Base; } = function() { return [d1, d2]; }; +>x177 : Symbol(x177, Decl(generatedContextualTyping.ts, 181, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 181, 19)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x178: () => {n: Base[]; } = function() { return { n: [d1, d2] }; }; +>x178 : Symbol(x178, Decl(generatedContextualTyping.ts, 182, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 182, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 182, 54)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x179: () => (s: Base[]) => any = function() { return n => { var n: Base[]; return null; }; }; +>x179 : Symbol(x179, Decl(generatedContextualTyping.ts, 183, 3)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 183, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 183, 56), Decl(generatedContextualTyping.ts, 183, 67)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 183, 56), Decl(generatedContextualTyping.ts, 183, 67)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +var x180: () => Genric = function() { return { func: n => { return [d1, d2]; } }; }; +>x180 : Symbol(x180, Decl(generatedContextualTyping.ts, 184, 3)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 184, 52)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 184, 58)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x181 { var t: () => Base[] = () => [d1, d2]; } +>x181 : Symbol(x181, Decl(generatedContextualTyping.ts, 184, 90)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 185, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x182 { var t: () => Base[] = function() { return [d1, d2] }; } +>x182 : Symbol(x182, Decl(generatedContextualTyping.ts, 185, 53)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 186, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x183 { var t: () => Base[] = function named() { return [d1, d2] }; } +>x183 : Symbol(x183, Decl(generatedContextualTyping.ts, 186, 69)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 187, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 187, 35)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x184 { var t: { (): Base[]; } = () => [d1, d2]; } +>x184 : Symbol(x184, Decl(generatedContextualTyping.ts, 187, 75)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 188, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x185 { var t: { (): Base[]; } = function() { return [d1, d2] }; } +>x185 : Symbol(x185, Decl(generatedContextualTyping.ts, 188, 56)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 189, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x186 { var t: { (): Base[]; } = function named() { return [d1, d2] }; } +>x186 : Symbol(x186, Decl(generatedContextualTyping.ts, 189, 72)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 190, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 190, 38)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x187 { var t: Base[] = [d1, d2]; } +>x187 : Symbol(x187, Decl(generatedContextualTyping.ts, 190, 78)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 191, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x188 { var t: Array = [d1, d2]; } +>x188 : Symbol(x188, Decl(generatedContextualTyping.ts, 191, 41)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 192, 17)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x189 { var t: { [n: number]: Base; } = [d1, d2]; } +>x189 : Symbol(x189, Decl(generatedContextualTyping.ts, 192, 46)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 193, 17)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 193, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x190 { var t: {n: Base[]; } = { n: [d1, d2] }; } +>x190 : Symbol(x190, Decl(generatedContextualTyping.ts, 193, 57)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 194, 17)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 194, 22)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 194, 39)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x191 { var t: (s: Base[]) => any = n => { var n: Base[]; return null; }; } +>x191 : Symbol(x191, Decl(generatedContextualTyping.ts, 194, 56)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 195, 17)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 195, 22)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 195, 41), Decl(generatedContextualTyping.ts, 195, 52)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 195, 41), Decl(generatedContextualTyping.ts, 195, 52)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +module x192 { var t: Genric = { func: n => { return [d1, d2]; } }; } +>x192 : Symbol(x192, Decl(generatedContextualTyping.ts, 195, 81)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 196, 17)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 196, 37)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 196, 43)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x193 { export var t: () => Base[] = () => [d1, d2]; } +>x193 : Symbol(x193, Decl(generatedContextualTyping.ts, 196, 74)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 197, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x194 { export var t: () => Base[] = function() { return [d1, d2] }; } +>x194 : Symbol(x194, Decl(generatedContextualTyping.ts, 197, 60)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 198, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x195 { export var t: () => Base[] = function named() { return [d1, d2] }; } +>x195 : Symbol(x195, Decl(generatedContextualTyping.ts, 198, 76)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 199, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 199, 42)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x196 { export var t: { (): Base[]; } = () => [d1, d2]; } +>x196 : Symbol(x196, Decl(generatedContextualTyping.ts, 199, 82)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 200, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x197 { export var t: { (): Base[]; } = function() { return [d1, d2] }; } +>x197 : Symbol(x197, Decl(generatedContextualTyping.ts, 200, 63)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 201, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x198 { export var t: { (): Base[]; } = function named() { return [d1, d2] }; } +>x198 : Symbol(x198, Decl(generatedContextualTyping.ts, 201, 79)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 202, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 202, 45)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x199 { export var t: Base[] = [d1, d2]; } +>x199 : Symbol(x199, Decl(generatedContextualTyping.ts, 202, 85)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 203, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x200 { export var t: Array = [d1, d2]; } +>x200 : Symbol(x200, Decl(generatedContextualTyping.ts, 203, 48)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 204, 24)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x201 { export var t: { [n: number]: Base; } = [d1, d2]; } +>x201 : Symbol(x201, Decl(generatedContextualTyping.ts, 204, 53)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 205, 24)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 205, 31)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x202 { export var t: {n: Base[]; } = { n: [d1, d2] }; } +>x202 : Symbol(x202, Decl(generatedContextualTyping.ts, 205, 64)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 206, 24)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 206, 29)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 206, 46)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x203 { export var t: (s: Base[]) => any = n => { var n: Base[]; return null; }; } +>x203 : Symbol(x203, Decl(generatedContextualTyping.ts, 206, 63)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 207, 24)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 207, 29)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 207, 48), Decl(generatedContextualTyping.ts, 207, 59)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 207, 48), Decl(generatedContextualTyping.ts, 207, 59)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +module x204 { export var t: Genric = { func: n => { return [d1, d2]; } }; } +>x204 : Symbol(x204, Decl(generatedContextualTyping.ts, 207, 88)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 208, 24)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 208, 44)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 208, 50)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x206 = <() => Base[]>function() { return [d1, d2] }; +>x206 : Symbol(x206, Decl(generatedContextualTyping.ts, 209, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x207 = <() => Base[]>function named() { return [d1, d2] }; +>x207 : Symbol(x207, Decl(generatedContextualTyping.ts, 210, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 210, 25)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x209 = <{ (): Base[]; }>function() { return [d1, d2] }; +>x209 : Symbol(x209, Decl(generatedContextualTyping.ts, 211, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x210 = <{ (): Base[]; }>function named() { return [d1, d2] }; +>x210 : Symbol(x210, Decl(generatedContextualTyping.ts, 212, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 212, 28)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x211 = [d1, d2]; +>x211 : Symbol(x211, Decl(generatedContextualTyping.ts, 213, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x212 = >[d1, d2]; +>x212 : Symbol(x212, Decl(generatedContextualTyping.ts, 214, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x213 = <{ [n: number]: Base; }>[d1, d2]; +>x213 : Symbol(x213, Decl(generatedContextualTyping.ts, 215, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 215, 15)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x214 = <{n: Base[]; } >{ n: [d1, d2] }; +>x214 : Symbol(x214, Decl(generatedContextualTyping.ts, 216, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 216, 13)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 216, 28)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x216 = >{ func: n => { return [d1, d2]; } }; +>x216 : Symbol(x216, Decl(generatedContextualTyping.ts, 217, 3)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 217, 26)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 217, 32)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x217 = (<() => Base[]>undefined) || function() { return [d1, d2] }; +>x217 : Symbol(x217, Decl(generatedContextualTyping.ts, 218, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x218 = (<() => Base[]>undefined) || function named() { return [d1, d2] }; +>x218 : Symbol(x218, Decl(generatedContextualTyping.ts, 219, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 219, 39)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x219 = (<{ (): Base[]; }>undefined) || function() { return [d1, d2] }; +>x219 : Symbol(x219, Decl(generatedContextualTyping.ts, 220, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x220 = (<{ (): Base[]; }>undefined) || function named() { return [d1, d2] }; +>x220 : Symbol(x220, Decl(generatedContextualTyping.ts, 221, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 221, 42)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x221 = (undefined) || [d1, d2]; +>x221 : Symbol(x221, Decl(generatedContextualTyping.ts, 222, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x222 = (>undefined) || [d1, d2]; +>x222 : Symbol(x222, Decl(generatedContextualTyping.ts, 223, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x223 = (<{ [n: number]: Base; }>undefined) || [d1, d2]; +>x223 : Symbol(x223, Decl(generatedContextualTyping.ts, 224, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 224, 16)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x224 = (<{n: Base[]; } >undefined) || { n: [d1, d2] }; +>x224 : Symbol(x224, Decl(generatedContextualTyping.ts, 225, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 225, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 225, 43)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x225: () => Base[]; x225 = () => [d1, d2]; +>x225 : Symbol(x225, Decl(generatedContextualTyping.ts, 226, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x225 : Symbol(x225, Decl(generatedContextualTyping.ts, 226, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x226: () => Base[]; x226 = function() { return [d1, d2] }; +>x226 : Symbol(x226, Decl(generatedContextualTyping.ts, 227, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x226 : Symbol(x226, Decl(generatedContextualTyping.ts, 227, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x227: () => Base[]; x227 = function named() { return [d1, d2] }; +>x227 : Symbol(x227, Decl(generatedContextualTyping.ts, 228, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x227 : Symbol(x227, Decl(generatedContextualTyping.ts, 228, 3)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 228, 30)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x228: { (): Base[]; }; x228 = () => [d1, d2]; +>x228 : Symbol(x228, Decl(generatedContextualTyping.ts, 229, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x228 : Symbol(x228, Decl(generatedContextualTyping.ts, 229, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x229: { (): Base[]; }; x229 = function() { return [d1, d2] }; +>x229 : Symbol(x229, Decl(generatedContextualTyping.ts, 230, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x229 : Symbol(x229, Decl(generatedContextualTyping.ts, 230, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x230: { (): Base[]; }; x230 = function named() { return [d1, d2] }; +>x230 : Symbol(x230, Decl(generatedContextualTyping.ts, 231, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x230 : Symbol(x230, Decl(generatedContextualTyping.ts, 231, 3)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 231, 33)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x231: Base[]; x231 = [d1, d2]; +>x231 : Symbol(x231, Decl(generatedContextualTyping.ts, 232, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x231 : Symbol(x231, Decl(generatedContextualTyping.ts, 232, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x232: Array; x232 = [d1, d2]; +>x232 : Symbol(x232, Decl(generatedContextualTyping.ts, 233, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x232 : Symbol(x232, Decl(generatedContextualTyping.ts, 233, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x233: { [n: number]: Base; }; x233 = [d1, d2]; +>x233 : Symbol(x233, Decl(generatedContextualTyping.ts, 234, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 234, 13)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x233 : Symbol(x233, Decl(generatedContextualTyping.ts, 234, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x234: {n: Base[]; } ; x234 = { n: [d1, d2] }; +>x234 : Symbol(x234, Decl(generatedContextualTyping.ts, 235, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 235, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x234 : Symbol(x234, Decl(generatedContextualTyping.ts, 235, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 235, 34)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x235: (s: Base[]) => any; x235 = n => { var n: Base[]; return null; }; +>x235 : Symbol(x235, Decl(generatedContextualTyping.ts, 236, 3)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 236, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x235 : Symbol(x235, Decl(generatedContextualTyping.ts, 236, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 236, 36), Decl(generatedContextualTyping.ts, 236, 47)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 236, 36), Decl(generatedContextualTyping.ts, 236, 47)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +var x236: Genric; x236 = { func: n => { return [d1, d2]; } }; +>x236 : Symbol(x236, Decl(generatedContextualTyping.ts, 237, 3)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x236 : Symbol(x236, Decl(generatedContextualTyping.ts, 237, 3)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 237, 32)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 237, 38)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x237: { n: () => Base[]; } = { n: () => [d1, d2] }; +>x237 : Symbol(x237, Decl(generatedContextualTyping.ts, 238, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 238, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 238, 34)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x238: { n: () => Base[]; } = { n: function() { return [d1, d2] } }; +>x238 : Symbol(x238, Decl(generatedContextualTyping.ts, 239, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 239, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 239, 34)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x239: { n: () => Base[]; } = { n: function named() { return [d1, d2] } }; +>x239 : Symbol(x239, Decl(generatedContextualTyping.ts, 240, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 240, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 240, 34)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 240, 37)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x240: { n: { (): Base[]; }; } = { n: () => [d1, d2] }; +>x240 : Symbol(x240, Decl(generatedContextualTyping.ts, 241, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 241, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 241, 37)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x241: { n: { (): Base[]; }; } = { n: function() { return [d1, d2] } }; +>x241 : Symbol(x241, Decl(generatedContextualTyping.ts, 242, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 242, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 242, 37)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x242: { n: { (): Base[]; }; } = { n: function named() { return [d1, d2] } }; +>x242 : Symbol(x242, Decl(generatedContextualTyping.ts, 243, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 243, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 243, 37)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 243, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x243: { n: Base[]; } = { n: [d1, d2] }; +>x243 : Symbol(x243, Decl(generatedContextualTyping.ts, 244, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 244, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 244, 28)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x244: { n: Array; } = { n: [d1, d2] }; +>x244 : Symbol(x244, Decl(generatedContextualTyping.ts, 245, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 245, 11)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 245, 33)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x245: { n: { [n: number]: Base; }; } = { n: [d1, d2] }; +>x245 : Symbol(x245, Decl(generatedContextualTyping.ts, 246, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 246, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 246, 18)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 246, 44)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x246: { n: {n: Base[]; } ; } = { n: { n: [d1, d2] } }; +>x246 : Symbol(x246, Decl(generatedContextualTyping.ts, 247, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 247, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 247, 16)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 247, 36)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 247, 41)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x247: { n: (s: Base[]) => any; } = { n: n => { var n: Base[]; return null; } }; +>x247 : Symbol(x247, Decl(generatedContextualTyping.ts, 248, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 248, 11)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 248, 16)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 248, 40)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 248, 43), Decl(generatedContextualTyping.ts, 248, 54)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 248, 43), Decl(generatedContextualTyping.ts, 248, 54)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +var x248: { n: Genric; } = { n: { func: n => { return [d1, d2]; } } }; +>x248 : Symbol(x248, Decl(generatedContextualTyping.ts, 249, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 249, 11)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 249, 34)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 249, 39)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 249, 45)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x252: { (): Base[]; }[] = [() => [d1, d2]]; +>x252 : Symbol(x252, Decl(generatedContextualTyping.ts, 250, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x253: { (): Base[]; }[] = [function() { return [d1, d2] }]; +>x253 : Symbol(x253, Decl(generatedContextualTyping.ts, 251, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x254: { (): Base[]; }[] = [function named() { return [d1, d2] }]; +>x254 : Symbol(x254, Decl(generatedContextualTyping.ts, 252, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 252, 31)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x255: Base[][] = [[d1, d2]]; +>x255 : Symbol(x255, Decl(generatedContextualTyping.ts, 253, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x256: Array[] = [[d1, d2]]; +>x256 : Symbol(x256, Decl(generatedContextualTyping.ts, 254, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x257: { [n: number]: Base; }[] = [[d1, d2]]; +>x257 : Symbol(x257, Decl(generatedContextualTyping.ts, 255, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 255, 13)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x258: {n: Base[]; } [] = [{ n: [d1, d2] }]; +>x258 : Symbol(x258, Decl(generatedContextualTyping.ts, 256, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 256, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 256, 31)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x260: Genric[] = [{ func: n => { return [d1, d2]; } }]; +>x260 : Symbol(x260, Decl(generatedContextualTyping.ts, 257, 3)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 257, 29)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 257, 35)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x261: () => Base[] = function() { return [d1, d2] } || undefined; +>x261 : Symbol(x261, Decl(generatedContextualTyping.ts, 258, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x262: () => Base[] = function named() { return [d1, d2] } || undefined; +>x262 : Symbol(x262, Decl(generatedContextualTyping.ts, 259, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 259, 24)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x263: { (): Base[]; } = function() { return [d1, d2] } || undefined; +>x263 : Symbol(x263, Decl(generatedContextualTyping.ts, 260, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x264: { (): Base[]; } = function named() { return [d1, d2] } || undefined; +>x264 : Symbol(x264, Decl(generatedContextualTyping.ts, 261, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 261, 27)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x265: Base[] = [d1, d2] || undefined; +>x265 : Symbol(x265, Decl(generatedContextualTyping.ts, 262, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x266: Array = [d1, d2] || undefined; +>x266 : Symbol(x266, Decl(generatedContextualTyping.ts, 263, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x267: { [n: number]: Base; } = [d1, d2] || undefined; +>x267 : Symbol(x267, Decl(generatedContextualTyping.ts, 264, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 264, 13)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x268: {n: Base[]; } = { n: [d1, d2] } || undefined; +>x268 : Symbol(x268, Decl(generatedContextualTyping.ts, 265, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 265, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 265, 28)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x269: () => Base[] = undefined || function() { return [d1, d2] }; +>x269 : Symbol(x269, Decl(generatedContextualTyping.ts, 266, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x270: () => Base[] = undefined || function named() { return [d1, d2] }; +>x270 : Symbol(x270, Decl(generatedContextualTyping.ts, 267, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 267, 37)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x271: { (): Base[]; } = undefined || function() { return [d1, d2] }; +>x271 : Symbol(x271, Decl(generatedContextualTyping.ts, 268, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x272: { (): Base[]; } = undefined || function named() { return [d1, d2] }; +>x272 : Symbol(x272, Decl(generatedContextualTyping.ts, 269, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 269, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x273: Base[] = undefined || [d1, d2]; +>x273 : Symbol(x273, Decl(generatedContextualTyping.ts, 270, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x274: Array = undefined || [d1, d2]; +>x274 : Symbol(x274, Decl(generatedContextualTyping.ts, 271, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x275: { [n: number]: Base; } = undefined || [d1, d2]; +>x275 : Symbol(x275, Decl(generatedContextualTyping.ts, 272, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 272, 13)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x276: {n: Base[]; } = undefined || { n: [d1, d2] }; +>x276 : Symbol(x276, Decl(generatedContextualTyping.ts, 273, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 273, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 273, 41)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x277: () => Base[] = function() { return [d1, d2] } || function() { return [d1, d2] }; +>x277 : Symbol(x277, Decl(generatedContextualTyping.ts, 274, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x278: () => Base[] = function named() { return [d1, d2] } || function named() { return [d1, d2] }; +>x278 : Symbol(x278, Decl(generatedContextualTyping.ts, 275, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 275, 24)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 275, 64)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x279: { (): Base[]; } = function() { return [d1, d2] } || function() { return [d1, d2] }; +>x279 : Symbol(x279, Decl(generatedContextualTyping.ts, 276, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x280: { (): Base[]; } = function named() { return [d1, d2] } || function named() { return [d1, d2] }; +>x280 : Symbol(x280, Decl(generatedContextualTyping.ts, 277, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 277, 27)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 277, 67)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x281: Base[] = [d1, d2] || [d1, d2]; +>x281 : Symbol(x281, Decl(generatedContextualTyping.ts, 278, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x282: Array = [d1, d2] || [d1, d2]; +>x282 : Symbol(x282, Decl(generatedContextualTyping.ts, 279, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x283: { [n: number]: Base; } = [d1, d2] || [d1, d2]; +>x283 : Symbol(x283, Decl(generatedContextualTyping.ts, 280, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 280, 13)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x284: {n: Base[]; } = { n: [d1, d2] } || { n: [d1, d2] }; +>x284 : Symbol(x284, Decl(generatedContextualTyping.ts, 281, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 281, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 281, 28)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 281, 47)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x285: () => Base[] = true ? () => [d1, d2] : () => [d1, d2]; +>x285 : Symbol(x285, Decl(generatedContextualTyping.ts, 282, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x286: () => Base[] = true ? function() { return [d1, d2] } : function() { return [d1, d2] }; +>x286 : Symbol(x286, Decl(generatedContextualTyping.ts, 283, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x287: () => Base[] = true ? function named() { return [d1, d2] } : function named() { return [d1, d2] }; +>x287 : Symbol(x287, Decl(generatedContextualTyping.ts, 284, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 284, 31)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 284, 70)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x288: { (): Base[]; } = true ? () => [d1, d2] : () => [d1, d2]; +>x288 : Symbol(x288, Decl(generatedContextualTyping.ts, 285, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x289: { (): Base[]; } = true ? function() { return [d1, d2] } : function() { return [d1, d2] }; +>x289 : Symbol(x289, Decl(generatedContextualTyping.ts, 286, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x290: { (): Base[]; } = true ? function named() { return [d1, d2] } : function named() { return [d1, d2] }; +>x290 : Symbol(x290, Decl(generatedContextualTyping.ts, 287, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 287, 34)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 287, 73)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x291: Base[] = true ? [d1, d2] : [d1, d2]; +>x291 : Symbol(x291, Decl(generatedContextualTyping.ts, 288, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x292: Array = true ? [d1, d2] : [d1, d2]; +>x292 : Symbol(x292, Decl(generatedContextualTyping.ts, 289, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x293: { [n: number]: Base; } = true ? [d1, d2] : [d1, d2]; +>x293 : Symbol(x293, Decl(generatedContextualTyping.ts, 290, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 290, 13)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x294: {n: Base[]; } = true ? { n: [d1, d2] } : { n: [d1, d2] }; +>x294 : Symbol(x294, Decl(generatedContextualTyping.ts, 291, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 291, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 291, 35)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 291, 53)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x295: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : n => { var n: Base[]; return null; }; +>x295 : Symbol(x295, Decl(generatedContextualTyping.ts, 292, 3)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 292, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 292, 37), Decl(generatedContextualTyping.ts, 292, 48)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 292, 37), Decl(generatedContextualTyping.ts, 292, 48)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 292, 76), Decl(generatedContextualTyping.ts, 292, 87)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 292, 76), Decl(generatedContextualTyping.ts, 292, 87)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +var x296: Genric = true ? { func: n => { return [d1, d2]; } } : { func: n => { return [d1, d2]; } }; +>x296 : Symbol(x296, Decl(generatedContextualTyping.ts, 293, 3)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 293, 33)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 293, 39)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 293, 71)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 293, 77)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x297: () => Base[] = true ? undefined : () => [d1, d2]; +>x297 : Symbol(x297, Decl(generatedContextualTyping.ts, 294, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x298: () => Base[] = true ? undefined : function() { return [d1, d2] }; +>x298 : Symbol(x298, Decl(generatedContextualTyping.ts, 295, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x299: () => Base[] = true ? undefined : function named() { return [d1, d2] }; +>x299 : Symbol(x299, Decl(generatedContextualTyping.ts, 296, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 296, 43)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x300: { (): Base[]; } = true ? undefined : () => [d1, d2]; +>x300 : Symbol(x300, Decl(generatedContextualTyping.ts, 297, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x301: { (): Base[]; } = true ? undefined : function() { return [d1, d2] }; +>x301 : Symbol(x301, Decl(generatedContextualTyping.ts, 298, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x302: { (): Base[]; } = true ? undefined : function named() { return [d1, d2] }; +>x302 : Symbol(x302, Decl(generatedContextualTyping.ts, 299, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 299, 46)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x303: Base[] = true ? undefined : [d1, d2]; +>x303 : Symbol(x303, Decl(generatedContextualTyping.ts, 300, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x304: Array = true ? undefined : [d1, d2]; +>x304 : Symbol(x304, Decl(generatedContextualTyping.ts, 301, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x305: { [n: number]: Base; } = true ? undefined : [d1, d2]; +>x305 : Symbol(x305, Decl(generatedContextualTyping.ts, 302, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 302, 13)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x306: {n: Base[]; } = true ? undefined : { n: [d1, d2] }; +>x306 : Symbol(x306, Decl(generatedContextualTyping.ts, 303, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 303, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 303, 47)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x307: (s: Base[]) => any = true ? undefined : n => { var n: Base[]; return null; }; +>x307 : Symbol(x307, Decl(generatedContextualTyping.ts, 304, 3)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 304, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 304, 49), Decl(generatedContextualTyping.ts, 304, 60)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 304, 49), Decl(generatedContextualTyping.ts, 304, 60)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +var x308: Genric = true ? undefined : { func: n => { return [d1, d2]; } }; +>x308 : Symbol(x308, Decl(generatedContextualTyping.ts, 305, 3)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 305, 45)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 305, 51)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x309: () => Base[] = true ? () => [d1, d2] : undefined; +>x309 : Symbol(x309, Decl(generatedContextualTyping.ts, 306, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x310: () => Base[] = true ? function() { return [d1, d2] } : undefined; +>x310 : Symbol(x310, Decl(generatedContextualTyping.ts, 307, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x311: () => Base[] = true ? function named() { return [d1, d2] } : undefined; +>x311 : Symbol(x311, Decl(generatedContextualTyping.ts, 308, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 308, 31)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x312: { (): Base[]; } = true ? () => [d1, d2] : undefined; +>x312 : Symbol(x312, Decl(generatedContextualTyping.ts, 309, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x313: { (): Base[]; } = true ? function() { return [d1, d2] } : undefined; +>x313 : Symbol(x313, Decl(generatedContextualTyping.ts, 310, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x314: { (): Base[]; } = true ? function named() { return [d1, d2] } : undefined; +>x314 : Symbol(x314, Decl(generatedContextualTyping.ts, 311, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 311, 34)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x315: Base[] = true ? [d1, d2] : undefined; +>x315 : Symbol(x315, Decl(generatedContextualTyping.ts, 312, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x316: Array = true ? [d1, d2] : undefined; +>x316 : Symbol(x316, Decl(generatedContextualTyping.ts, 313, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x317: { [n: number]: Base; } = true ? [d1, d2] : undefined; +>x317 : Symbol(x317, Decl(generatedContextualTyping.ts, 314, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 314, 13)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x318: {n: Base[]; } = true ? { n: [d1, d2] } : undefined; +>x318 : Symbol(x318, Decl(generatedContextualTyping.ts, 315, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 315, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 315, 35)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x319: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : undefined; +>x319 : Symbol(x319, Decl(generatedContextualTyping.ts, 316, 3)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 316, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 316, 37), Decl(generatedContextualTyping.ts, 316, 48)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 316, 37), Decl(generatedContextualTyping.ts, 316, 48)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) + +var x320: Genric = true ? { func: n => { return [d1, d2]; } } : undefined; +>x320 : Symbol(x320, Decl(generatedContextualTyping.ts, 317, 3)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 317, 33)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 317, 39)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +function x321(n: () => Base[]) { }; x321(() => [d1, d2]); +>x321 : Symbol(x321, Decl(generatedContextualTyping.ts, 317, 80)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 318, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x321 : Symbol(x321, Decl(generatedContextualTyping.ts, 317, 80)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x322(n: () => Base[]) { }; x322(function() { return [d1, d2] }); +>x322 : Symbol(x322, Decl(generatedContextualTyping.ts, 318, 57)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 319, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x322 : Symbol(x322, Decl(generatedContextualTyping.ts, 318, 57)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x323(n: () => Base[]) { }; x323(function named() { return [d1, d2] }); +>x323 : Symbol(x323, Decl(generatedContextualTyping.ts, 319, 73)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 320, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x323 : Symbol(x323, Decl(generatedContextualTyping.ts, 319, 73)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 320, 41)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x324(n: { (): Base[]; }) { }; x324(() => [d1, d2]); +>x324 : Symbol(x324, Decl(generatedContextualTyping.ts, 320, 79)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 321, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x324 : Symbol(x324, Decl(generatedContextualTyping.ts, 320, 79)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x325(n: { (): Base[]; }) { }; x325(function() { return [d1, d2] }); +>x325 : Symbol(x325, Decl(generatedContextualTyping.ts, 321, 60)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 322, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x325 : Symbol(x325, Decl(generatedContextualTyping.ts, 321, 60)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x326(n: { (): Base[]; }) { }; x326(function named() { return [d1, d2] }); +>x326 : Symbol(x326, Decl(generatedContextualTyping.ts, 322, 76)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 323, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x326 : Symbol(x326, Decl(generatedContextualTyping.ts, 322, 76)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 323, 44)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x327(n: Base[]) { }; x327([d1, d2]); +>x327 : Symbol(x327, Decl(generatedContextualTyping.ts, 323, 82)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 324, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x327 : Symbol(x327, Decl(generatedContextualTyping.ts, 323, 82)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x328(n: Array) { }; x328([d1, d2]); +>x328 : Symbol(x328, Decl(generatedContextualTyping.ts, 324, 45)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 325, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x328 : Symbol(x328, Decl(generatedContextualTyping.ts, 324, 45)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x329(n: { [n: number]: Base; }) { }; x329([d1, d2]); +>x329 : Symbol(x329, Decl(generatedContextualTyping.ts, 325, 50)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 326, 14)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 326, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x329 : Symbol(x329, Decl(generatedContextualTyping.ts, 325, 50)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x330(n: {n: Base[]; } ) { }; x330({ n: [d1, d2] }); +>x330 : Symbol(x330, Decl(generatedContextualTyping.ts, 326, 61)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 327, 14)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 327, 18)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x330 : Symbol(x330, Decl(generatedContextualTyping.ts, 326, 61)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 327, 44)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x331(n: (s: Base[]) => any) { }; x331(n => { var n: Base[]; return null; }); +>x331 : Symbol(x331, Decl(generatedContextualTyping.ts, 327, 60)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 328, 14)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 328, 18)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x331 : Symbol(x331, Decl(generatedContextualTyping.ts, 327, 60)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 328, 47), Decl(generatedContextualTyping.ts, 328, 57)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 328, 47), Decl(generatedContextualTyping.ts, 328, 57)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +function x332(n: Genric) { }; x332({ func: n => { return [d1, d2]; } }); +>x332 : Symbol(x332, Decl(generatedContextualTyping.ts, 328, 85)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 329, 14)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x332 : Symbol(x332, Decl(generatedContextualTyping.ts, 328, 85)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 329, 42)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 329, 48)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x333 = (n: () => Base[]) => n; x333(() => [d1, d2]); +>x333 : Symbol(x333, Decl(generatedContextualTyping.ts, 330, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 330, 12)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 330, 12)) +>x333 : Symbol(x333, Decl(generatedContextualTyping.ts, 330, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x334 = (n: () => Base[]) => n; x334(function() { return [d1, d2] }); +>x334 : Symbol(x334, Decl(generatedContextualTyping.ts, 331, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 331, 12)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 331, 12)) +>x334 : Symbol(x334, Decl(generatedContextualTyping.ts, 331, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x335 = (n: () => Base[]) => n; x335(function named() { return [d1, d2] }); +>x335 : Symbol(x335, Decl(generatedContextualTyping.ts, 332, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 332, 12)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 332, 12)) +>x335 : Symbol(x335, Decl(generatedContextualTyping.ts, 332, 3)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 332, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x336 = (n: { (): Base[]; }) => n; x336(() => [d1, d2]); +>x336 : Symbol(x336, Decl(generatedContextualTyping.ts, 333, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 333, 12)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 333, 12)) +>x336 : Symbol(x336, Decl(generatedContextualTyping.ts, 333, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x337 = (n: { (): Base[]; }) => n; x337(function() { return [d1, d2] }); +>x337 : Symbol(x337, Decl(generatedContextualTyping.ts, 334, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 334, 12)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 334, 12)) +>x337 : Symbol(x337, Decl(generatedContextualTyping.ts, 334, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x338 = (n: { (): Base[]; }) => n; x338(function named() { return [d1, d2] }); +>x338 : Symbol(x338, Decl(generatedContextualTyping.ts, 335, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 335, 12)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 335, 12)) +>x338 : Symbol(x338, Decl(generatedContextualTyping.ts, 335, 3)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 335, 43)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x339 = (n: Base[]) => n; x339([d1, d2]); +>x339 : Symbol(x339, Decl(generatedContextualTyping.ts, 336, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 336, 12)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 336, 12)) +>x339 : Symbol(x339, Decl(generatedContextualTyping.ts, 336, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x340 = (n: Array) => n; x340([d1, d2]); +>x340 : Symbol(x340, Decl(generatedContextualTyping.ts, 337, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 337, 12)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 337, 12)) +>x340 : Symbol(x340, Decl(generatedContextualTyping.ts, 337, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x341 = (n: { [n: number]: Base; }) => n; x341([d1, d2]); +>x341 : Symbol(x341, Decl(generatedContextualTyping.ts, 338, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 338, 12)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 338, 18)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 338, 12)) +>x341 : Symbol(x341, Decl(generatedContextualTyping.ts, 338, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x342 = (n: {n: Base[]; } ) => n; x342({ n: [d1, d2] }); +>x342 : Symbol(x342, Decl(generatedContextualTyping.ts, 339, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 339, 12)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 339, 16)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 339, 12)) +>x342 : Symbol(x342, Decl(generatedContextualTyping.ts, 339, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 339, 43)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x343 = (n: (s: Base[]) => any) => n; x343(n => { var n: Base[]; return null; }); +>x343 : Symbol(x343, Decl(generatedContextualTyping.ts, 340, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 340, 12)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 340, 16)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 340, 12)) +>x343 : Symbol(x343, Decl(generatedContextualTyping.ts, 340, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 340, 46), Decl(generatedContextualTyping.ts, 340, 56)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 340, 46), Decl(generatedContextualTyping.ts, 340, 56)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +var x344 = (n: Genric) => n; x344({ func: n => { return [d1, d2]; } }); +>x344 : Symbol(x344, Decl(generatedContextualTyping.ts, 341, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 341, 12)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 341, 12)) +>x344 : Symbol(x344, Decl(generatedContextualTyping.ts, 341, 3)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 341, 41)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 341, 47)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x345 = function(n: () => Base[]) { }; x345(() => [d1, d2]); +>x345 : Symbol(x345, Decl(generatedContextualTyping.ts, 342, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 342, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x345 : Symbol(x345, Decl(generatedContextualTyping.ts, 342, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x346 = function(n: () => Base[]) { }; x346(function() { return [d1, d2] }); +>x346 : Symbol(x346, Decl(generatedContextualTyping.ts, 343, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 343, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x346 : Symbol(x346, Decl(generatedContextualTyping.ts, 343, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x347 = function(n: () => Base[]) { }; x347(function named() { return [d1, d2] }); +>x347 : Symbol(x347, Decl(generatedContextualTyping.ts, 344, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 344, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x347 : Symbol(x347, Decl(generatedContextualTyping.ts, 344, 3)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 344, 47)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x348 = function(n: { (): Base[]; }) { }; x348(() => [d1, d2]); +>x348 : Symbol(x348, Decl(generatedContextualTyping.ts, 345, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 345, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x348 : Symbol(x348, Decl(generatedContextualTyping.ts, 345, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x349 = function(n: { (): Base[]; }) { }; x349(function() { return [d1, d2] }); +>x349 : Symbol(x349, Decl(generatedContextualTyping.ts, 346, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 346, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x349 : Symbol(x349, Decl(generatedContextualTyping.ts, 346, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x350 = function(n: { (): Base[]; }) { }; x350(function named() { return [d1, d2] }); +>x350 : Symbol(x350, Decl(generatedContextualTyping.ts, 347, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 347, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x350 : Symbol(x350, Decl(generatedContextualTyping.ts, 347, 3)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 347, 50)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x351 = function(n: Base[]) { }; x351([d1, d2]); +>x351 : Symbol(x351, Decl(generatedContextualTyping.ts, 348, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 348, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x351 : Symbol(x351, Decl(generatedContextualTyping.ts, 348, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x352 = function(n: Array) { }; x352([d1, d2]); +>x352 : Symbol(x352, Decl(generatedContextualTyping.ts, 349, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 349, 20)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x352 : Symbol(x352, Decl(generatedContextualTyping.ts, 349, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x353 = function(n: { [n: number]: Base; }) { }; x353([d1, d2]); +>x353 : Symbol(x353, Decl(generatedContextualTyping.ts, 350, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 350, 20)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 350, 26)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x353 : Symbol(x353, Decl(generatedContextualTyping.ts, 350, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x354 = function(n: {n: Base[]; } ) { }; x354({ n: [d1, d2] }); +>x354 : Symbol(x354, Decl(generatedContextualTyping.ts, 351, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 351, 20)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 351, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x354 : Symbol(x354, Decl(generatedContextualTyping.ts, 351, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 351, 50)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x355 = function(n: (s: Base[]) => any) { }; x355(n => { var n: Base[]; return null; }); +>x355 : Symbol(x355, Decl(generatedContextualTyping.ts, 352, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 352, 20)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 352, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x355 : Symbol(x355, Decl(generatedContextualTyping.ts, 352, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 352, 53), Decl(generatedContextualTyping.ts, 352, 63)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 352, 53), Decl(generatedContextualTyping.ts, 352, 63)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +var x356 = function(n: Genric) { }; x356({ func: n => { return [d1, d2]; } }); +>x356 : Symbol(x356, Decl(generatedContextualTyping.ts, 353, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 353, 20)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x356 : Symbol(x356, Decl(generatedContextualTyping.ts, 353, 3)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 353, 48)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 353, 54)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + diff --git a/tests/baselines/reference/generatedContextualTyping.types b/tests/baselines/reference/generatedContextualTyping.types index 423c5d6653b..e8f434d31a8 100644 --- a/tests/baselines/reference/generatedContextualTyping.types +++ b/tests/baselines/reference/generatedContextualTyping.types @@ -122,6 +122,7 @@ var x11: (s: Base[]) => any = n => { var n: Base[]; return null; }; >n : Base[] >n : Base[] >Base : Base +>null : null var x12: Genric = { func: n => { return [d1, d2]; } }; >x12 : Genric @@ -237,6 +238,7 @@ class x23 { member: (s: Base[]) => any = n => { var n: Base[]; return null; } } >n : Base[] >n : Base[] >Base : Base +>null : null class x24 { member: Genric = { func: n => { return [d1, d2]; } } } >x24 : x24 @@ -353,6 +355,7 @@ class x35 { private member: (s: Base[]) => any = n => { var n: Base[]; return nu >n : Base[] >n : Base[] >Base : Base +>null : null class x36 { private member: Genric = { func: n => { return [d1, d2]; } } } >x36 : x36 @@ -469,6 +472,7 @@ class x47 { public member: (s: Base[]) => any = n => { var n: Base[]; return nul >n : Base[] >n : Base[] >Base : Base +>null : null class x48 { public member: Genric = { func: n => { return [d1, d2]; } } } >x48 : x48 @@ -585,6 +589,7 @@ class x59 { static member: (s: Base[]) => any = n => { var n: Base[]; return nul >n : Base[] >n : Base[] >Base : Base +>null : null class x60 { static member: Genric = { func: n => { return [d1, d2]; } } } >x60 : x60 @@ -701,6 +706,7 @@ class x71 { private static member: (s: Base[]) => any = n => { var n: Base[]; re >n : Base[] >n : Base[] >Base : Base +>null : null class x72 { private static member: Genric = { func: n => { return [d1, d2]; } } } >x72 : x72 @@ -817,6 +823,7 @@ class x83 { public static member: (s: Base[]) => any = n => { var n: Base[]; ret >n : Base[] >n : Base[] >Base : Base +>null : null class x84 { public static member: Genric = { func: n => { return [d1, d2]; } } } >x84 : x84 @@ -933,6 +940,7 @@ class x95 { constructor(parm: (s: Base[]) => any = n => { var n: Base[]; return >n : Base[] >n : Base[] >Base : Base +>null : null class x96 { constructor(parm: Genric = { func: n => { return [d1, d2]; } }) { } } >x96 : x96 @@ -1049,6 +1057,7 @@ class x107 { constructor(public parm: (s: Base[]) => any = n => { var n: Base[]; >n : Base[] >n : Base[] >Base : Base +>null : null class x108 { constructor(public parm: Genric = { func: n => { return [d1, d2]; } }) { } } >x108 : x108 @@ -1165,6 +1174,7 @@ class x119 { constructor(private parm: (s: Base[]) => any = n => { var n: Base[] >n : Base[] >n : Base[] >Base : Base +>null : null class x120 { constructor(private parm: Genric = { func: n => { return [d1, d2]; } }) { } } >x120 : x120 @@ -1281,6 +1291,7 @@ function x131(parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { >n : Base[] >n : Base[] >Base : Base +>null : null function x132(parm: Genric = { func: n => { return [d1, d2]; } }) { } >x132 : (parm?: Genric) => void @@ -1386,6 +1397,7 @@ function x143(): (s: Base[]) => any { return n => { var n: Base[]; return null; >n : Base[] >n : Base[] >Base : Base +>null : null function x144(): Genric { return { func: n => { return [d1, d2]; } }; } >x144 : () => Genric @@ -1530,10 +1542,12 @@ function x155(): (s: Base[]) => any { return n => { var n: Base[]; return null; >n : Base[] >n : Base[] >Base : Base +>null : null >n => { var n: Base[]; return null; } : (n: Base[]) => any >n : Base[] >n : Base[] >Base : Base +>null : null function x156(): Genric { return { func: n => { return [d1, d2]; } }; return { func: n => { return [d1, d2]; } }; } >x156 : () => Genric @@ -1656,6 +1670,7 @@ var x167: () => (s: Base[]) => any = () => { return n => { var n: Base[]; return >n : Base[] >n : Base[] >Base : Base +>null : null var x168: () => Genric = () => { return { func: n => { return [d1, d2]; } }; }; >x168 : () => Genric @@ -1772,6 +1787,7 @@ var x179: () => (s: Base[]) => any = function() { return n => { var n: Base[]; r >n : Base[] >n : Base[] >Base : Base +>null : null var x180: () => Genric = function() { return { func: n => { return [d1, d2]; } }; }; >x180 : () => Genric @@ -1888,6 +1904,7 @@ module x191 { var t: (s: Base[]) => any = n => { var n: Base[]; return null; }; >n : Base[] >n : Base[] >Base : Base +>null : null module x192 { var t: Genric = { func: n => { return [d1, d2]; } }; } >x192 : typeof x192 @@ -2004,6 +2021,7 @@ module x203 { export var t: (s: Base[]) => any = n => { var n: Base[]; return nu >n : Base[] >n : Base[] >Base : Base +>null : null module x204 { export var t: Genric = { func: n => { return [d1, d2]; } }; } >x204 : typeof x204 @@ -2318,6 +2336,7 @@ var x235: (s: Base[]) => any; x235 = n => { var n: Base[]; return null; }; >n : Base[] >n : Base[] >Base : Base +>null : null var x236: Genric; x236 = { func: n => { return [d1, d2]; } }; >x236 : Genric @@ -2457,6 +2476,7 @@ var x247: { n: (s: Base[]) => any; } = { n: n => { var n: Base[]; return null; } >n : Base[] >n : Base[] >Base : Base +>null : null var x248: { n: Genric; } = { n: { func: n => { return [d1, d2]; } } }; >x248 : { n: Genric; } @@ -2828,6 +2848,7 @@ var x285: () => Base[] = true ? () => [d1, d2] : () => [d1, d2]; >x285 : () => Base[] >Base : Base >true ? () => [d1, d2] : () => [d1, d2] : () => (Derived1 | Derived2)[] +>true : boolean >() => [d1, d2] : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -2841,6 +2862,7 @@ var x286: () => Base[] = true ? function() { return [d1, d2] } : function() { re >x286 : () => Base[] >Base : Base >true ? function() { return [d1, d2] } : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>true : boolean >function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -2854,6 +2876,7 @@ var x287: () => Base[] = true ? function named() { return [d1, d2] } : function >x287 : () => Base[] >Base : Base >true ? function named() { return [d1, d2] } : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>true : boolean >function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >named : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -2869,6 +2892,7 @@ var x288: { (): Base[]; } = true ? () => [d1, d2] : () => [d1, d2]; >x288 : () => Base[] >Base : Base >true ? () => [d1, d2] : () => [d1, d2] : () => (Derived1 | Derived2)[] +>true : boolean >() => [d1, d2] : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -2882,6 +2906,7 @@ var x289: { (): Base[]; } = true ? function() { return [d1, d2] } : function() { >x289 : () => Base[] >Base : Base >true ? function() { return [d1, d2] } : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>true : boolean >function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -2895,6 +2920,7 @@ var x290: { (): Base[]; } = true ? function named() { return [d1, d2] } : functi >x290 : () => Base[] >Base : Base >true ? function named() { return [d1, d2] } : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>true : boolean >function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >named : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -2910,6 +2936,7 @@ var x291: Base[] = true ? [d1, d2] : [d1, d2]; >x291 : Base[] >Base : Base >true ? [d1, d2] : [d1, d2] : (Derived1 | Derived2)[] +>true : boolean >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2922,6 +2949,7 @@ var x292: Array = true ? [d1, d2] : [d1, d2]; >Array : T[] >Base : Base >true ? [d1, d2] : [d1, d2] : (Derived1 | Derived2)[] +>true : boolean >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2934,6 +2962,7 @@ var x293: { [n: number]: Base; } = true ? [d1, d2] : [d1, d2]; >n : number >Base : Base >true ? [d1, d2] : [d1, d2] : (Derived1 | Derived2)[] +>true : boolean >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2946,6 +2975,7 @@ var x294: {n: Base[]; } = true ? { n: [d1, d2] } : { n: [d1, d2] }; >n : Base[] >Base : Base >true ? { n: [d1, d2] } : { n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>true : boolean >{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } >n : (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -2962,20 +2992,24 @@ var x295: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : n = >s : Base[] >Base : Base >true ? n => { var n: Base[]; return null; } : n => { var n: Base[]; return null; } : (n: Base[]) => any +>true : boolean >n => { var n: Base[]; return null; } : (n: Base[]) => any >n : Base[] >n : Base[] >Base : Base +>null : null >n => { var n: Base[]; return null; } : (n: Base[]) => any >n : Base[] >n : Base[] >Base : Base +>null : null var x296: Genric = true ? { func: n => { return [d1, d2]; } } : { func: n => { return [d1, d2]; } }; >x296 : Genric >Genric : Genric >Base : Base >true ? { func: n => { return [d1, d2]; } } : { func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>true : boolean >{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } >func : (n: Base[]) => (Derived1 | Derived2)[] >n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] @@ -2995,6 +3029,7 @@ var x297: () => Base[] = true ? undefined : () => [d1, d2]; >x297 : () => Base[] >Base : Base >true ? undefined : () => [d1, d2] : () => (Derived1 | Derived2)[] +>true : boolean >undefined : undefined >() => [d1, d2] : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3005,6 +3040,7 @@ var x298: () => Base[] = true ? undefined : function() { return [d1, d2] }; >x298 : () => Base[] >Base : Base >true ? undefined : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>true : boolean >undefined : undefined >function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3015,6 +3051,7 @@ var x299: () => Base[] = true ? undefined : function named() { return [d1, d2] } >x299 : () => Base[] >Base : Base >true ? undefined : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>true : boolean >undefined : undefined >function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >named : () => (Derived1 | Derived2)[] @@ -3026,6 +3063,7 @@ var x300: { (): Base[]; } = true ? undefined : () => [d1, d2]; >x300 : () => Base[] >Base : Base >true ? undefined : () => [d1, d2] : () => (Derived1 | Derived2)[] +>true : boolean >undefined : undefined >() => [d1, d2] : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3036,6 +3074,7 @@ var x301: { (): Base[]; } = true ? undefined : function() { return [d1, d2] }; >x301 : () => Base[] >Base : Base >true ? undefined : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>true : boolean >undefined : undefined >function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3046,6 +3085,7 @@ var x302: { (): Base[]; } = true ? undefined : function named() { return [d1, d2 >x302 : () => Base[] >Base : Base >true ? undefined : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>true : boolean >undefined : undefined >function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >named : () => (Derived1 | Derived2)[] @@ -3057,6 +3097,7 @@ var x303: Base[] = true ? undefined : [d1, d2]; >x303 : Base[] >Base : Base >true ? undefined : [d1, d2] : (Derived1 | Derived2)[] +>true : boolean >undefined : undefined >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3067,6 +3108,7 @@ var x304: Array = true ? undefined : [d1, d2]; >Array : T[] >Base : Base >true ? undefined : [d1, d2] : (Derived1 | Derived2)[] +>true : boolean >undefined : undefined >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3077,6 +3119,7 @@ var x305: { [n: number]: Base; } = true ? undefined : [d1, d2]; >n : number >Base : Base >true ? undefined : [d1, d2] : (Derived1 | Derived2)[] +>true : boolean >undefined : undefined >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3087,6 +3130,7 @@ var x306: {n: Base[]; } = true ? undefined : { n: [d1, d2] }; >n : Base[] >Base : Base >true ? undefined : { n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>true : boolean >undefined : undefined >{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } >n : (Derived1 | Derived2)[] @@ -3099,17 +3143,20 @@ var x307: (s: Base[]) => any = true ? undefined : n => { var n: Base[]; return n >s : Base[] >Base : Base >true ? undefined : n => { var n: Base[]; return null; } : (n: Base[]) => any +>true : boolean >undefined : undefined >n => { var n: Base[]; return null; } : (n: Base[]) => any >n : Base[] >n : Base[] >Base : Base +>null : null var x308: Genric = true ? undefined : { func: n => { return [d1, d2]; } }; >x308 : Genric >Genric : Genric >Base : Base >true ? undefined : { func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>true : boolean >undefined : undefined >{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } >func : (n: Base[]) => (Derived1 | Derived2)[] @@ -3123,6 +3170,7 @@ var x309: () => Base[] = true ? () => [d1, d2] : undefined; >x309 : () => Base[] >Base : Base >true ? () => [d1, d2] : undefined : () => (Derived1 | Derived2)[] +>true : boolean >() => [d1, d2] : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3133,6 +3181,7 @@ var x310: () => Base[] = true ? function() { return [d1, d2] } : undefined; >x310 : () => Base[] >Base : Base >true ? function() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] +>true : boolean >function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3143,6 +3192,7 @@ var x311: () => Base[] = true ? function named() { return [d1, d2] } : undefined >x311 : () => Base[] >Base : Base >true ? function named() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] +>true : boolean >function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >named : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3154,6 +3204,7 @@ var x312: { (): Base[]; } = true ? () => [d1, d2] : undefined; >x312 : () => Base[] >Base : Base >true ? () => [d1, d2] : undefined : () => (Derived1 | Derived2)[] +>true : boolean >() => [d1, d2] : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3164,6 +3215,7 @@ var x313: { (): Base[]; } = true ? function() { return [d1, d2] } : undefined; >x313 : () => Base[] >Base : Base >true ? function() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] +>true : boolean >function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3174,6 +3226,7 @@ var x314: { (): Base[]; } = true ? function named() { return [d1, d2] } : undefi >x314 : () => Base[] >Base : Base >true ? function named() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] +>true : boolean >function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >named : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3185,6 +3238,7 @@ var x315: Base[] = true ? [d1, d2] : undefined; >x315 : Base[] >Base : Base >true ? [d1, d2] : undefined : (Derived1 | Derived2)[] +>true : boolean >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3195,6 +3249,7 @@ var x316: Array = true ? [d1, d2] : undefined; >Array : T[] >Base : Base >true ? [d1, d2] : undefined : (Derived1 | Derived2)[] +>true : boolean >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3205,6 +3260,7 @@ var x317: { [n: number]: Base; } = true ? [d1, d2] : undefined; >n : number >Base : Base >true ? [d1, d2] : undefined : (Derived1 | Derived2)[] +>true : boolean >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3215,6 +3271,7 @@ var x318: {n: Base[]; } = true ? { n: [d1, d2] } : undefined; >n : Base[] >Base : Base >true ? { n: [d1, d2] } : undefined : { n: (Derived1 | Derived2)[]; } +>true : boolean >{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } >n : (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3227,10 +3284,12 @@ var x319: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : und >s : Base[] >Base : Base >true ? n => { var n: Base[]; return null; } : undefined : (n: Base[]) => any +>true : boolean >n => { var n: Base[]; return null; } : (n: Base[]) => any >n : Base[] >n : Base[] >Base : Base +>null : null >undefined : undefined var x320: Genric = true ? { func: n => { return [d1, d2]; } } : undefined; @@ -3238,6 +3297,7 @@ var x320: Genric = true ? { func: n => { return [d1, d2]; } } : undefined; >Genric : Genric >Base : Base >true ? { func: n => { return [d1, d2]; } } : undefined : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>true : boolean >{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } >func : (n: Base[]) => (Derived1 | Derived2)[] >n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] @@ -3371,6 +3431,7 @@ function x331(n: (s: Base[]) => any) { }; x331(n => { var n: Base[]; return null >n : Base[] >n : Base[] >Base : Base +>null : null function x332(n: Genric) { }; x332({ func: n => { return [d1, d2]; } }); >x332 : (n: Genric) => void @@ -3533,6 +3594,7 @@ var x343 = (n: (s: Base[]) => any) => n; x343(n => { var n: Base[]; return null; >n : Base[] >n : Base[] >Base : Base +>null : null var x344 = (n: Genric) => n; x344({ func: n => { return [d1, d2]; } }); >x344 : (n: Genric) => Genric @@ -3686,6 +3748,7 @@ var x355 = function(n: (s: Base[]) => any) { }; x355(n => { var n: Base[]; retur >n : Base[] >n : Base[] >Base : Base +>null : null var x356 = function(n: Genric) { }; x356({ func: n => { return [d1, d2]; } }); >x356 : (n: Genric) => void diff --git a/tests/baselines/reference/generativeRecursionWithTypeOf.symbols b/tests/baselines/reference/generativeRecursionWithTypeOf.symbols new file mode 100644 index 00000000000..630923d2c59 --- /dev/null +++ b/tests/baselines/reference/generativeRecursionWithTypeOf.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/generativeRecursionWithTypeOf.ts === +class C { +>C : Symbol(C, Decl(generativeRecursionWithTypeOf.ts, 0, 0)) +>T : Symbol(T, Decl(generativeRecursionWithTypeOf.ts, 0, 8)) + + static foo(x: number) { } +>foo : Symbol(C.foo, Decl(generativeRecursionWithTypeOf.ts, 0, 12)) +>x : Symbol(x, Decl(generativeRecursionWithTypeOf.ts, 1, 15)) + + type: T; +>type : Symbol(type, Decl(generativeRecursionWithTypeOf.ts, 1, 29)) +>T : Symbol(T, Decl(generativeRecursionWithTypeOf.ts, 0, 8)) +} + +module M { +>M : Symbol(M, Decl(generativeRecursionWithTypeOf.ts, 3, 1)) + + export function f(x: typeof C) { +>f : Symbol(f, Decl(generativeRecursionWithTypeOf.ts, 5, 10)) +>x : Symbol(x, Decl(generativeRecursionWithTypeOf.ts, 6, 22)) +>C : Symbol(C, Decl(generativeRecursionWithTypeOf.ts, 0, 0)) + + return new x(); +>x : Symbol(x, Decl(generativeRecursionWithTypeOf.ts, 6, 22)) +>x : Symbol(x, Decl(generativeRecursionWithTypeOf.ts, 6, 22)) + } +} diff --git a/tests/baselines/reference/generatorES6_1.errors.txt b/tests/baselines/reference/generatorES6_1.errors.txt new file mode 100644 index 00000000000..b02da7f0b53 --- /dev/null +++ b/tests/baselines/reference/generatorES6_1.errors.txt @@ -0,0 +1,12 @@ +tests/cases/compiler/generatorES6_1.ts(1,9): error TS9001: Generators are not currently supported. +tests/cases/compiler/generatorES6_1.ts(2,5): error TS9000: 'yield' expressions are not currently supported. + + +==== tests/cases/compiler/generatorES6_1.ts (2 errors) ==== + function* foo() { + ~ +!!! error TS9001: Generators are not currently supported. + yield + ~~~~~ +!!! error TS9000: 'yield' expressions are not currently supported. + } \ No newline at end of file diff --git a/tests/baselines/reference/generatorES6_1.js b/tests/baselines/reference/generatorES6_1.js new file mode 100644 index 00000000000..ee9a7d43fac --- /dev/null +++ b/tests/baselines/reference/generatorES6_1.js @@ -0,0 +1,9 @@ +//// [generatorES6_1.ts] +function* foo() { + yield +} + +//// [generatorES6_1.js] +function* foo() { + yield; +} diff --git a/tests/baselines/reference/generatorES6_2.errors.txt b/tests/baselines/reference/generatorES6_2.errors.txt new file mode 100644 index 00000000000..8d956fc7f63 --- /dev/null +++ b/tests/baselines/reference/generatorES6_2.errors.txt @@ -0,0 +1,14 @@ +tests/cases/compiler/generatorES6_2.ts(2,12): error TS9001: Generators are not currently supported. +tests/cases/compiler/generatorES6_2.ts(3,9): error TS9000: 'yield' expressions are not currently supported. + + +==== tests/cases/compiler/generatorES6_2.ts (2 errors) ==== + class C { + public * foo() { + ~ +!!! error TS9001: Generators are not currently supported. + yield 1 + ~~~~~ +!!! error TS9000: 'yield' expressions are not currently supported. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/generatorES6_2.js b/tests/baselines/reference/generatorES6_2.js new file mode 100644 index 00000000000..b0a004e38ed --- /dev/null +++ b/tests/baselines/reference/generatorES6_2.js @@ -0,0 +1,13 @@ +//// [generatorES6_2.ts] +class C { + public * foo() { + yield 1 + } +} + +//// [generatorES6_2.js] +class C { + *foo() { + yield 1; + } +} diff --git a/tests/baselines/reference/generatorES6_3.errors.txt b/tests/baselines/reference/generatorES6_3.errors.txt new file mode 100644 index 00000000000..e1c1d918ce6 --- /dev/null +++ b/tests/baselines/reference/generatorES6_3.errors.txt @@ -0,0 +1,12 @@ +tests/cases/compiler/generatorES6_3.ts(1,17): error TS9001: Generators are not currently supported. +tests/cases/compiler/generatorES6_3.ts(2,5): error TS9000: 'yield' expressions are not currently supported. + + +==== tests/cases/compiler/generatorES6_3.ts (2 errors) ==== + var v = function*() { + ~ +!!! error TS9001: Generators are not currently supported. + yield 0 + ~~~~~ +!!! error TS9000: 'yield' expressions are not currently supported. + } \ No newline at end of file diff --git a/tests/baselines/reference/generatorES6_3.js b/tests/baselines/reference/generatorES6_3.js new file mode 100644 index 00000000000..87fbe271f3c --- /dev/null +++ b/tests/baselines/reference/generatorES6_3.js @@ -0,0 +1,9 @@ +//// [generatorES6_3.ts] +var v = function*() { + yield 0 +} + +//// [generatorES6_3.js] +var v = function* () { + yield 0; +}; diff --git a/tests/baselines/reference/generatorES6_4.errors.txt b/tests/baselines/reference/generatorES6_4.errors.txt new file mode 100644 index 00000000000..37c375e9728 --- /dev/null +++ b/tests/baselines/reference/generatorES6_4.errors.txt @@ -0,0 +1,14 @@ +tests/cases/compiler/generatorES6_4.ts(2,4): error TS9001: Generators are not currently supported. +tests/cases/compiler/generatorES6_4.ts(3,8): error TS9000: 'yield' expressions are not currently supported. + + +==== tests/cases/compiler/generatorES6_4.ts (2 errors) ==== + var v = { + *foo() { + ~ +!!! error TS9001: Generators are not currently supported. + yield 0 + ~~~~~ +!!! error TS9000: 'yield' expressions are not currently supported. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/generatorES6_4.js b/tests/baselines/reference/generatorES6_4.js new file mode 100644 index 00000000000..6c4109071e1 --- /dev/null +++ b/tests/baselines/reference/generatorES6_4.js @@ -0,0 +1,13 @@ +//// [generatorES6_4.ts] +var v = { + *foo() { + yield 0 + } +} + +//// [generatorES6_4.js] +var v = { + *foo() { + yield 0; + } +}; diff --git a/tests/baselines/reference/generatorES6_5.errors.txt b/tests/baselines/reference/generatorES6_5.errors.txt new file mode 100644 index 00000000000..f6fa8a5bc18 --- /dev/null +++ b/tests/baselines/reference/generatorES6_5.errors.txt @@ -0,0 +1,12 @@ +tests/cases/compiler/generatorES6_5.ts(1,9): error TS9001: Generators are not currently supported. +tests/cases/compiler/generatorES6_5.ts(2,5): error TS9000: 'yield' expressions are not currently supported. + + +==== tests/cases/compiler/generatorES6_5.ts (2 errors) ==== + function* foo() { + ~ +!!! error TS9001: Generators are not currently supported. + yield a ? b : c; + ~~~~~ +!!! error TS9000: 'yield' expressions are not currently supported. + } \ No newline at end of file diff --git a/tests/baselines/reference/generatorES6_5.js b/tests/baselines/reference/generatorES6_5.js new file mode 100644 index 00000000000..de76f8e6e23 --- /dev/null +++ b/tests/baselines/reference/generatorES6_5.js @@ -0,0 +1,9 @@ +//// [generatorES6_5.ts] +function* foo() { + yield a ? b : c; +} + +//// [generatorES6_5.js] +function* foo() { + yield a ? b : c; +} diff --git a/tests/baselines/reference/generatorES6_6.errors.txt b/tests/baselines/reference/generatorES6_6.errors.txt new file mode 100644 index 00000000000..1f568aeb9e4 --- /dev/null +++ b/tests/baselines/reference/generatorES6_6.errors.txt @@ -0,0 +1,14 @@ +tests/cases/compiler/generatorES6_6.ts(2,3): error TS9001: Generators are not currently supported. +tests/cases/compiler/generatorES6_6.ts(3,13): error TS9000: 'yield' expressions are not currently supported. + + +==== tests/cases/compiler/generatorES6_6.ts (2 errors) ==== + class C { + *[Symbol.iterator]() { + ~ +!!! error TS9001: Generators are not currently supported. + let a = yield 1; + ~~~~~ +!!! error TS9000: 'yield' expressions are not currently supported. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/generatorES6_6.js b/tests/baselines/reference/generatorES6_6.js new file mode 100644 index 00000000000..d121d167e50 --- /dev/null +++ b/tests/baselines/reference/generatorES6_6.js @@ -0,0 +1,13 @@ +//// [generatorES6_6.ts] +class C { + *[Symbol.iterator]() { + let a = yield 1; + } +} + +//// [generatorES6_6.js] +class C { + *[Symbol.iterator]() { + let a = yield 1; + } +} diff --git a/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName2.symbols b/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName2.symbols new file mode 100644 index 00000000000..05b131090c0 --- /dev/null +++ b/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName2.symbols @@ -0,0 +1,54 @@ +=== tests/cases/conformance/interfaces/declarationMerging/genericAndNonGenericInterfaceWithTheSameName2.ts === +// generic and non-generic interfaces with the same name do not merge + +module M { +>M : Symbol(M, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 0, 0)) + + interface A { +>A : Symbol(A, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 2, 10)) +>T : Symbol(T, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 3, 16)) + + bar: T; +>bar : Symbol(bar, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 3, 20)) +>T : Symbol(T, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 3, 16)) + } +} + +module M2 { +>M2 : Symbol(M2, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 6, 1)) + + interface A { // ok +>A : Symbol(A, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 8, 11)) + + foo: string; +>foo : Symbol(foo, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 9, 17)) + } +} + +module N { +>N : Symbol(N, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 12, 1)) + + module M { +>M : Symbol(M, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 14, 10)) + + interface A { +>A : Symbol(A, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 15, 14)) +>T : Symbol(T, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 16, 20)) + + bar: T; +>bar : Symbol(bar, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 16, 24)) +>T : Symbol(T, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 16, 20)) + } + } + + module M2 { +>M2 : Symbol(M2, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 19, 5)) + + interface A { // ok +>A : Symbol(A, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 21, 15)) + + foo: string; +>foo : Symbol(foo, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 22, 21)) + } + } +} diff --git a/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName2.types b/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName2.types index b15da5e995c..623ac0f9705 100644 --- a/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName2.types +++ b/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName2.types @@ -2,7 +2,7 @@ // generic and non-generic interfaces with the same name do not merge module M { ->M : unknown +>M : any interface A { >A : A @@ -15,7 +15,7 @@ module M { } module M2 { ->M2 : unknown +>M2 : any interface A { // ok >A : A @@ -26,10 +26,10 @@ module M2 { } module N { ->N : unknown +>N : any module M { ->M : unknown +>M : any interface A { >A : A @@ -42,7 +42,7 @@ module N { } module M2 { ->M2 : unknown +>M2 : any interface A { // ok >A : A diff --git a/tests/baselines/reference/genericAndNonGenericOverload1.symbols b/tests/baselines/reference/genericAndNonGenericOverload1.symbols new file mode 100644 index 00000000000..dff05785114 --- /dev/null +++ b/tests/baselines/reference/genericAndNonGenericOverload1.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/genericAndNonGenericOverload1.ts === +interface callable2 { +>callable2 : Symbol(callable2, Decl(genericAndNonGenericOverload1.ts, 0, 0)) +>T : Symbol(T, Decl(genericAndNonGenericOverload1.ts, 0, 20)) + + (a: T): T; +>a : Symbol(a, Decl(genericAndNonGenericOverload1.ts, 1, 5)) +>T : Symbol(T, Decl(genericAndNonGenericOverload1.ts, 0, 20)) +>T : Symbol(T, Decl(genericAndNonGenericOverload1.ts, 0, 20)) + + (a: T): Z; +>Z : Symbol(Z, Decl(genericAndNonGenericOverload1.ts, 2, 5)) +>a : Symbol(a, Decl(genericAndNonGenericOverload1.ts, 2, 8)) +>T : Symbol(T, Decl(genericAndNonGenericOverload1.ts, 0, 20)) +>Z : Symbol(Z, Decl(genericAndNonGenericOverload1.ts, 2, 5)) +} +var c2: callable2; +>c2 : Symbol(c2, Decl(genericAndNonGenericOverload1.ts, 4, 3)) +>callable2 : Symbol(callable2, Decl(genericAndNonGenericOverload1.ts, 0, 0)) + +c2(1); +>c2 : Symbol(c2, Decl(genericAndNonGenericOverload1.ts, 4, 3)) + diff --git a/tests/baselines/reference/genericAndNonGenericOverload1.types b/tests/baselines/reference/genericAndNonGenericOverload1.types index 67cc8a01f18..28eeb2d4da0 100644 --- a/tests/baselines/reference/genericAndNonGenericOverload1.types +++ b/tests/baselines/reference/genericAndNonGenericOverload1.types @@ -21,4 +21,5 @@ var c2: callable2; c2(1); >c2(1) : string >c2 : callable2 +>1 : number diff --git a/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.symbols b/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.symbols new file mode 100644 index 00000000000..b38008c38ce --- /dev/null +++ b/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.symbols @@ -0,0 +1,63 @@ +=== tests/cases/compiler/genericArgumentCallSigAssignmentCompat.ts === +module Underscore { +>Underscore : Symbol(Underscore, Decl(genericArgumentCallSigAssignmentCompat.ts, 0, 0)) + + export interface Iterator { +>Iterator : Symbol(Iterator, Decl(genericArgumentCallSigAssignmentCompat.ts, 0, 19)) +>T : Symbol(T, Decl(genericArgumentCallSigAssignmentCompat.ts, 1, 30)) +>U : Symbol(U, Decl(genericArgumentCallSigAssignmentCompat.ts, 1, 32)) + + (value: T, index: any, list: any): U; +>value : Symbol(value, Decl(genericArgumentCallSigAssignmentCompat.ts, 2, 9)) +>T : Symbol(T, Decl(genericArgumentCallSigAssignmentCompat.ts, 1, 30)) +>index : Symbol(index, Decl(genericArgumentCallSigAssignmentCompat.ts, 2, 18)) +>list : Symbol(list, Decl(genericArgumentCallSigAssignmentCompat.ts, 2, 30)) +>U : Symbol(U, Decl(genericArgumentCallSigAssignmentCompat.ts, 1, 32)) + } + + export interface Static { +>Static : Symbol(Static, Decl(genericArgumentCallSigAssignmentCompat.ts, 3, 5)) + + all(list: T[], iterator?: Iterator, context?: any): boolean; +>all : Symbol(all, Decl(genericArgumentCallSigAssignmentCompat.ts, 5, 29)) +>T : Symbol(T, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 12)) +>list : Symbol(list, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 15)) +>T : Symbol(T, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 12)) +>iterator : Symbol(iterator, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 25)) +>Iterator : Symbol(Iterator, Decl(genericArgumentCallSigAssignmentCompat.ts, 0, 19)) +>T : Symbol(T, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 12)) +>context : Symbol(context, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 58)) + + identity(value: T): T; +>identity : Symbol(identity, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 83)) +>T : Symbol(T, Decl(genericArgumentCallSigAssignmentCompat.ts, 7, 17)) +>value : Symbol(value, Decl(genericArgumentCallSigAssignmentCompat.ts, 7, 20)) +>T : Symbol(T, Decl(genericArgumentCallSigAssignmentCompat.ts, 7, 17)) +>T : Symbol(T, Decl(genericArgumentCallSigAssignmentCompat.ts, 7, 17)) + } +} + +declare var _: Underscore.Static; +>_ : Symbol(_, Decl(genericArgumentCallSigAssignmentCompat.ts, 11, 11)) +>Underscore : Symbol(Underscore, Decl(genericArgumentCallSigAssignmentCompat.ts, 0, 0)) +>Static : Symbol(Underscore.Static, Decl(genericArgumentCallSigAssignmentCompat.ts, 3, 5)) + +// 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 : Symbol(Underscore.Static.all, Decl(genericArgumentCallSigAssignmentCompat.ts, 5, 29)) +>_ : Symbol(_, Decl(genericArgumentCallSigAssignmentCompat.ts, 11, 11)) +>all : Symbol(Underscore.Static.all, Decl(genericArgumentCallSigAssignmentCompat.ts, 5, 29)) +>_.identity : Symbol(Underscore.Static.identity, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 83)) +>_ : Symbol(_, Decl(genericArgumentCallSigAssignmentCompat.ts, 11, 11)) +>identity : Symbol(Underscore.Static.identity, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 83)) + +// Ok, because fixing makes us infer boolean for T +_.all([true], _.identity); +>_.all : Symbol(Underscore.Static.all, Decl(genericArgumentCallSigAssignmentCompat.ts, 5, 29)) +>_ : Symbol(_, Decl(genericArgumentCallSigAssignmentCompat.ts, 11, 11)) +>all : Symbol(Underscore.Static.all, Decl(genericArgumentCallSigAssignmentCompat.ts, 5, 29)) +>_.identity : Symbol(Underscore.Static.identity, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 83)) +>_ : Symbol(_, Decl(genericArgumentCallSigAssignmentCompat.ts, 11, 11)) +>identity : Symbol(Underscore.Static.identity, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 83)) + diff --git a/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types b/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types index 768b8846880..c5fd984d327 100644 --- a/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types +++ b/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types @@ -1,6 +1,6 @@ === tests/cases/compiler/genericArgumentCallSigAssignmentCompat.ts === module Underscore { ->Underscore : unknown +>Underscore : any export interface Iterator { >Iterator : Iterator @@ -39,7 +39,7 @@ module Underscore { declare var _: Underscore.Static; >_ : Underscore.Static ->Underscore : unknown +>Underscore : any >Static : Underscore.Static // No error, Call signatures of types '(value: T) => T' and 'Underscore.Iterator<{}, boolean>' are compatible when instantiated with any. @@ -50,6 +50,10 @@ _.all([true, 1, null, 'yes'], _.identity); >_ : Underscore.Static >all : (list: T[], iterator?: Underscore.Iterator, context?: any) => boolean >[true, 1, null, 'yes'] : (string | number | boolean)[] +>true : boolean +>1 : number +>null : null +>'yes' : string >_.identity : (value: T) => T >_ : Underscore.Static >identity : (value: T) => T @@ -61,6 +65,7 @@ _.all([true], _.identity); >_ : Underscore.Static >all : (list: T[], iterator?: Underscore.Iterator, context?: any) => boolean >[true] : boolean[] +>true : boolean >_.identity : (value: T) => T >_ : Underscore.Static >identity : (value: T) => T diff --git a/tests/baselines/reference/genericArray0.symbols b/tests/baselines/reference/genericArray0.symbols new file mode 100644 index 00000000000..8870d60cde8 --- /dev/null +++ b/tests/baselines/reference/genericArray0.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/genericArray0.ts === + + +var x:number[]; +>x : Symbol(x, Decl(genericArray0.ts, 2, 3)) + + +var y = x; +>y : Symbol(y, Decl(genericArray0.ts, 5, 3)) +>x : Symbol(x, Decl(genericArray0.ts, 2, 3)) + +function map() { +>map : Symbol(map, Decl(genericArray0.ts, 5, 10)) +>U : Symbol(U, Decl(genericArray0.ts, 7, 13)) + + var ys: U[] = []; +>ys : Symbol(ys, Decl(genericArray0.ts, 8, 7)) +>U : Symbol(U, Decl(genericArray0.ts, 7, 13)) +} + diff --git a/tests/baselines/reference/genericArray1.symbols b/tests/baselines/reference/genericArray1.symbols new file mode 100644 index 00000000000..b403bd2b720 --- /dev/null +++ b/tests/baselines/reference/genericArray1.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/genericArray1.ts === +/* +var n: number[]; + +interface Array { +map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; +} + +interface String{ + length: number; +} +*/ + +var lengths = ["a", "b", "c"].map(x => x.length); +>lengths : Symbol(lengths, Decl(genericArray1.ts, 12, 3)) +>["a", "b", "c"].map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>x : Symbol(x, Decl(genericArray1.ts, 12, 34)) +>x.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>x : Symbol(x, Decl(genericArray1.ts, 12, 34)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + diff --git a/tests/baselines/reference/genericArray1.types b/tests/baselines/reference/genericArray1.types index 09dbc55771d..bf44c88f518 100644 --- a/tests/baselines/reference/genericArray1.types +++ b/tests/baselines/reference/genericArray1.types @@ -16,6 +16,9 @@ var lengths = ["a", "b", "c"].map(x => x.length); >["a", "b", "c"].map(x => x.length) : number[] >["a", "b", "c"].map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] >["a", "b", "c"] : string[] +>"a" : string +>"b" : string +>"c" : string >map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] >x => x.length : (x: string) => number >x : string diff --git a/tests/baselines/reference/genericArrayPropertyAssignment.symbols b/tests/baselines/reference/genericArrayPropertyAssignment.symbols new file mode 100644 index 00000000000..2c2c202779b --- /dev/null +++ b/tests/baselines/reference/genericArrayPropertyAssignment.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/genericArrayPropertyAssignment.ts === +function isEmpty(list: {length:number;}) +>isEmpty : Symbol(isEmpty, Decl(genericArrayPropertyAssignment.ts, 0, 0)) +>list : Symbol(list, Decl(genericArrayPropertyAssignment.ts, 0, 17)) +>length : Symbol(length, Decl(genericArrayPropertyAssignment.ts, 0, 24)) +{ +return list.length ===0; +>list.length : Symbol(length, Decl(genericArrayPropertyAssignment.ts, 0, 24)) +>list : Symbol(list, Decl(genericArrayPropertyAssignment.ts, 0, 17)) +>length : Symbol(length, Decl(genericArrayPropertyAssignment.ts, 0, 24)) +} + +isEmpty([]); // error +>isEmpty : Symbol(isEmpty, Decl(genericArrayPropertyAssignment.ts, 0, 0)) + + diff --git a/tests/baselines/reference/genericArrayPropertyAssignment.types b/tests/baselines/reference/genericArrayPropertyAssignment.types index ab3f47de813..6db56dde381 100644 --- a/tests/baselines/reference/genericArrayPropertyAssignment.types +++ b/tests/baselines/reference/genericArrayPropertyAssignment.types @@ -9,6 +9,7 @@ return list.length ===0; >list.length : number >list : { length: number; } >length : number +>0 : number } isEmpty([]); // error diff --git a/tests/baselines/reference/genericBaseClassLiteralProperty.symbols b/tests/baselines/reference/genericBaseClassLiteralProperty.symbols new file mode 100644 index 00000000000..f499e243eaa --- /dev/null +++ b/tests/baselines/reference/genericBaseClassLiteralProperty.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/genericBaseClassLiteralProperty.ts === +class BaseClass { +>BaseClass : Symbol(BaseClass, Decl(genericBaseClassLiteralProperty.ts, 0, 0)) +>T : Symbol(T, Decl(genericBaseClassLiteralProperty.ts, 0, 16)) + + public _getValue1: { (): T; }; +>_getValue1 : Symbol(_getValue1, Decl(genericBaseClassLiteralProperty.ts, 0, 20)) +>T : Symbol(T, Decl(genericBaseClassLiteralProperty.ts, 0, 16)) + + public _getValue2: () => T; +>_getValue2 : Symbol(_getValue2, Decl(genericBaseClassLiteralProperty.ts, 1, 34)) +>T : Symbol(T, Decl(genericBaseClassLiteralProperty.ts, 0, 16)) +} + +class SubClass extends BaseClass { +>SubClass : Symbol(SubClass, Decl(genericBaseClassLiteralProperty.ts, 3, 1)) +>BaseClass : Symbol(BaseClass, Decl(genericBaseClassLiteralProperty.ts, 0, 0)) + + public Error(): void { +>Error : Symbol(Error, Decl(genericBaseClassLiteralProperty.ts, 5, 42)) + + var x : number = this._getValue1(); +>x : Symbol(x, Decl(genericBaseClassLiteralProperty.ts, 8, 11)) +>this._getValue1 : Symbol(BaseClass._getValue1, Decl(genericBaseClassLiteralProperty.ts, 0, 20)) +>this : Symbol(SubClass, Decl(genericBaseClassLiteralProperty.ts, 3, 1)) +>_getValue1 : Symbol(BaseClass._getValue1, Decl(genericBaseClassLiteralProperty.ts, 0, 20)) + + var y : number = this._getValue2(); +>y : Symbol(y, Decl(genericBaseClassLiteralProperty.ts, 9, 11)) +>this._getValue2 : Symbol(BaseClass._getValue2, Decl(genericBaseClassLiteralProperty.ts, 1, 34)) +>this : Symbol(SubClass, Decl(genericBaseClassLiteralProperty.ts, 3, 1)) +>_getValue2 : Symbol(BaseClass._getValue2, Decl(genericBaseClassLiteralProperty.ts, 1, 34)) + } +} diff --git a/tests/baselines/reference/genericBaseClassLiteralProperty2.symbols b/tests/baselines/reference/genericBaseClassLiteralProperty2.symbols new file mode 100644 index 00000000000..5ddccd40e38 --- /dev/null +++ b/tests/baselines/reference/genericBaseClassLiteralProperty2.symbols @@ -0,0 +1,40 @@ +=== tests/cases/compiler/genericBaseClassLiteralProperty2.ts === +class CollectionItem2 { } +>CollectionItem2 : Symbol(CollectionItem2, Decl(genericBaseClassLiteralProperty2.ts, 0, 0)) + +class BaseCollection2 { +>BaseCollection2 : Symbol(BaseCollection2, Decl(genericBaseClassLiteralProperty2.ts, 0, 25)) +>TItem : Symbol(TItem, Decl(genericBaseClassLiteralProperty2.ts, 2, 22)) +>CollectionItem2 : Symbol(CollectionItem2, Decl(genericBaseClassLiteralProperty2.ts, 0, 0)) + + _itemsByKey: { [key: string]: TItem; }; +>_itemsByKey : Symbol(_itemsByKey, Decl(genericBaseClassLiteralProperty2.ts, 2, 54)) +>key : Symbol(key, Decl(genericBaseClassLiteralProperty2.ts, 3, 20)) +>TItem : Symbol(TItem, Decl(genericBaseClassLiteralProperty2.ts, 2, 22)) + + constructor() { + this._itemsByKey = {}; +>this._itemsByKey : Symbol(_itemsByKey, Decl(genericBaseClassLiteralProperty2.ts, 2, 54)) +>this : Symbol(BaseCollection2, Decl(genericBaseClassLiteralProperty2.ts, 0, 25)) +>_itemsByKey : Symbol(_itemsByKey, Decl(genericBaseClassLiteralProperty2.ts, 2, 54)) + } +} + +class DataView2 extends BaseCollection2 { +>DataView2 : Symbol(DataView2, Decl(genericBaseClassLiteralProperty2.ts, 7, 1)) +>BaseCollection2 : Symbol(BaseCollection2, Decl(genericBaseClassLiteralProperty2.ts, 0, 25)) +>CollectionItem2 : Symbol(CollectionItem2, Decl(genericBaseClassLiteralProperty2.ts, 0, 0)) + + fillItems(item: CollectionItem2) { +>fillItems : Symbol(fillItems, Decl(genericBaseClassLiteralProperty2.ts, 9, 58)) +>item : Symbol(item, Decl(genericBaseClassLiteralProperty2.ts, 10, 14)) +>CollectionItem2 : Symbol(CollectionItem2, Decl(genericBaseClassLiteralProperty2.ts, 0, 0)) + + this._itemsByKey['dummy'] = item; +>this._itemsByKey : Symbol(BaseCollection2._itemsByKey, Decl(genericBaseClassLiteralProperty2.ts, 2, 54)) +>this : Symbol(DataView2, Decl(genericBaseClassLiteralProperty2.ts, 7, 1)) +>_itemsByKey : Symbol(BaseCollection2._itemsByKey, Decl(genericBaseClassLiteralProperty2.ts, 2, 54)) +>item : Symbol(item, Decl(genericBaseClassLiteralProperty2.ts, 10, 14)) + } +} + diff --git a/tests/baselines/reference/genericBaseClassLiteralProperty2.types b/tests/baselines/reference/genericBaseClassLiteralProperty2.types index 2ade6437fe7..4576ffb05de 100644 --- a/tests/baselines/reference/genericBaseClassLiteralProperty2.types +++ b/tests/baselines/reference/genericBaseClassLiteralProperty2.types @@ -38,6 +38,7 @@ class DataView2 extends BaseCollection2 { >this._itemsByKey : { [key: string]: CollectionItem2; } >this : DataView2 >_itemsByKey : { [key: string]: CollectionItem2; } +>'dummy' : string >item : CollectionItem2 } } diff --git a/tests/baselines/reference/genericCallTypeArgumentInference.symbols b/tests/baselines/reference/genericCallTypeArgumentInference.symbols new file mode 100644 index 00000000000..2e86bda4ca4 --- /dev/null +++ b/tests/baselines/reference/genericCallTypeArgumentInference.symbols @@ -0,0 +1,346 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallTypeArgumentInference.ts === +// Basic type inference with generic calls, no errors expected + +function foo(t: T) { +>foo : Symbol(foo, Decl(genericCallTypeArgumentInference.ts, 0, 0)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 2, 13)) +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 2, 16)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 2, 13)) + + return t; +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 2, 16)) +} + +var r = foo(''); // string +>r : Symbol(r, Decl(genericCallTypeArgumentInference.ts, 6, 3)) +>foo : Symbol(foo, Decl(genericCallTypeArgumentInference.ts, 0, 0)) + +function foo2(t: T, u: U) { +>foo2 : Symbol(foo2, Decl(genericCallTypeArgumentInference.ts, 6, 16)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 8, 14)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 8, 16)) +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 8, 20)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 8, 14)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 8, 25)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 8, 16)) + + return u; +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 8, 25)) +} + +function foo2b(u: U) { +>foo2b : Symbol(foo2b, Decl(genericCallTypeArgumentInference.ts, 10, 1)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 12, 15)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 12, 17)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 12, 21)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 12, 17)) + + var x: T; +>x : Symbol(x, Decl(genericCallTypeArgumentInference.ts, 13, 7)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 12, 15)) + + return x; +>x : Symbol(x, Decl(genericCallTypeArgumentInference.ts, 13, 7)) +} + +var r2 = foo2('', 1); // number +>r2 : Symbol(r2, Decl(genericCallTypeArgumentInference.ts, 17, 3)) +>foo2 : Symbol(foo2, Decl(genericCallTypeArgumentInference.ts, 6, 16)) + +var r3 = foo2b(1); // {} +>r3 : Symbol(r3, Decl(genericCallTypeArgumentInference.ts, 18, 3)) +>foo2b : Symbol(foo2b, Decl(genericCallTypeArgumentInference.ts, 10, 1)) + +class C { +>C : Symbol(C, Decl(genericCallTypeArgumentInference.ts, 18, 18)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 20, 8)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 20, 10)) + + constructor(public t: T, public u: U) { +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 21, 16)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 20, 8)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 21, 28)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 20, 10)) + } + + foo(t: T, u: U) { +>foo : Symbol(foo, Decl(genericCallTypeArgumentInference.ts, 22, 5)) +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 24, 8)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 20, 8)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 24, 13)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 20, 10)) + + return t; +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 24, 8)) + } + + foo2(t: T, u: U) { +>foo2 : Symbol(foo2, Decl(genericCallTypeArgumentInference.ts, 26, 5)) +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 28, 9)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 20, 8)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 28, 14)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 20, 10)) + + return u; +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 28, 14)) + } + + foo3(t: T, u: U) { +>foo3 : Symbol(foo3, Decl(genericCallTypeArgumentInference.ts, 30, 5)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 32, 9)) +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 32, 12)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 32, 9)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 32, 17)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 20, 10)) + + return t; +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 32, 12)) + } + + foo4(t: T, u: U) { +>foo4 : Symbol(foo4, Decl(genericCallTypeArgumentInference.ts, 34, 5)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 36, 9)) +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 36, 12)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 20, 8)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 36, 17)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 36, 9)) + + return t; +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 36, 12)) + } + + foo5(t: T, u: U) { +>foo5 : Symbol(foo5, Decl(genericCallTypeArgumentInference.ts, 38, 5)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 40, 9)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 40, 11)) +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 40, 14)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 40, 9)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 40, 19)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 40, 11)) + + return t; +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 40, 14)) + } + + foo6() { +>foo6 : Symbol(foo6, Decl(genericCallTypeArgumentInference.ts, 42, 5)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 44, 9)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 44, 11)) + + var x: T; +>x : Symbol(x, Decl(genericCallTypeArgumentInference.ts, 45, 11)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 44, 9)) + + return x; +>x : Symbol(x, Decl(genericCallTypeArgumentInference.ts, 45, 11)) + } + + foo7(u: U) { +>foo7 : Symbol(foo7, Decl(genericCallTypeArgumentInference.ts, 47, 5)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 49, 9)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 49, 11)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 49, 15)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 49, 11)) + + var x: T; +>x : Symbol(x, Decl(genericCallTypeArgumentInference.ts, 50, 11)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 49, 9)) + + return x; +>x : Symbol(x, Decl(genericCallTypeArgumentInference.ts, 50, 11)) + } + + foo8() { +>foo8 : Symbol(foo8, Decl(genericCallTypeArgumentInference.ts, 52, 5)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 54, 9)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 54, 11)) + + var x: T; +>x : Symbol(x, Decl(genericCallTypeArgumentInference.ts, 55, 11)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 54, 9)) + + return x; +>x : Symbol(x, Decl(genericCallTypeArgumentInference.ts, 55, 11)) + } +} + +var c = new C('', 1); +>c : Symbol(c, Decl(genericCallTypeArgumentInference.ts, 60, 3)) +>C : Symbol(C, Decl(genericCallTypeArgumentInference.ts, 18, 18)) + +var r4 = c.foo('', 1); // string +>r4 : Symbol(r4, Decl(genericCallTypeArgumentInference.ts, 61, 3), Decl(genericCallTypeArgumentInference.ts, 83, 3)) +>c.foo : Symbol(C.foo, Decl(genericCallTypeArgumentInference.ts, 22, 5)) +>c : Symbol(c, Decl(genericCallTypeArgumentInference.ts, 60, 3)) +>foo : Symbol(C.foo, Decl(genericCallTypeArgumentInference.ts, 22, 5)) + +var r5 = c.foo2('', 1); // number +>r5 : Symbol(r5, Decl(genericCallTypeArgumentInference.ts, 62, 3), Decl(genericCallTypeArgumentInference.ts, 84, 3)) +>c.foo2 : Symbol(C.foo2, Decl(genericCallTypeArgumentInference.ts, 26, 5)) +>c : Symbol(c, Decl(genericCallTypeArgumentInference.ts, 60, 3)) +>foo2 : Symbol(C.foo2, Decl(genericCallTypeArgumentInference.ts, 26, 5)) + +var r6 = c.foo3(true, 1); // boolean +>r6 : Symbol(r6, Decl(genericCallTypeArgumentInference.ts, 63, 3), Decl(genericCallTypeArgumentInference.ts, 85, 3)) +>c.foo3 : Symbol(C.foo3, Decl(genericCallTypeArgumentInference.ts, 30, 5)) +>c : Symbol(c, Decl(genericCallTypeArgumentInference.ts, 60, 3)) +>foo3 : Symbol(C.foo3, Decl(genericCallTypeArgumentInference.ts, 30, 5)) + +var r7 = c.foo4('', true); // string +>r7 : Symbol(r7, Decl(genericCallTypeArgumentInference.ts, 64, 3), Decl(genericCallTypeArgumentInference.ts, 86, 3)) +>c.foo4 : Symbol(C.foo4, Decl(genericCallTypeArgumentInference.ts, 34, 5)) +>c : Symbol(c, Decl(genericCallTypeArgumentInference.ts, 60, 3)) +>foo4 : Symbol(C.foo4, Decl(genericCallTypeArgumentInference.ts, 34, 5)) + +var r8 = c.foo5(true, 1); // boolean +>r8 : Symbol(r8, Decl(genericCallTypeArgumentInference.ts, 65, 3), Decl(genericCallTypeArgumentInference.ts, 87, 3)) +>c.foo5 : Symbol(C.foo5, Decl(genericCallTypeArgumentInference.ts, 38, 5)) +>c : Symbol(c, Decl(genericCallTypeArgumentInference.ts, 60, 3)) +>foo5 : Symbol(C.foo5, Decl(genericCallTypeArgumentInference.ts, 38, 5)) + +var r9 = c.foo6(); // {} +>r9 : Symbol(r9, Decl(genericCallTypeArgumentInference.ts, 66, 3), Decl(genericCallTypeArgumentInference.ts, 88, 3)) +>c.foo6 : Symbol(C.foo6, Decl(genericCallTypeArgumentInference.ts, 42, 5)) +>c : Symbol(c, Decl(genericCallTypeArgumentInference.ts, 60, 3)) +>foo6 : Symbol(C.foo6, Decl(genericCallTypeArgumentInference.ts, 42, 5)) + +var r10 = c.foo7(''); // {} +>r10 : Symbol(r10, Decl(genericCallTypeArgumentInference.ts, 67, 3), Decl(genericCallTypeArgumentInference.ts, 89, 3)) +>c.foo7 : Symbol(C.foo7, Decl(genericCallTypeArgumentInference.ts, 47, 5)) +>c : Symbol(c, Decl(genericCallTypeArgumentInference.ts, 60, 3)) +>foo7 : Symbol(C.foo7, Decl(genericCallTypeArgumentInference.ts, 47, 5)) + +var r11 = c.foo8(); // {} +>r11 : Symbol(r11, Decl(genericCallTypeArgumentInference.ts, 68, 3), Decl(genericCallTypeArgumentInference.ts, 90, 3)) +>c.foo8 : Symbol(C.foo8, Decl(genericCallTypeArgumentInference.ts, 52, 5)) +>c : Symbol(c, Decl(genericCallTypeArgumentInference.ts, 60, 3)) +>foo8 : Symbol(C.foo8, Decl(genericCallTypeArgumentInference.ts, 52, 5)) + +interface I { +>I : Symbol(I, Decl(genericCallTypeArgumentInference.ts, 68, 19)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 70, 12)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 70, 14)) + + new (t: T, u: U); +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 71, 9)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 70, 12)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 71, 14)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 70, 14)) + + foo(t: T, u: U): T; +>foo : Symbol(foo, Decl(genericCallTypeArgumentInference.ts, 71, 21)) +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 72, 8)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 70, 12)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 72, 13)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 70, 14)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 70, 12)) + + foo2(t: T, u: U): U; +>foo2 : Symbol(foo2, Decl(genericCallTypeArgumentInference.ts, 72, 23)) +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 73, 9)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 70, 12)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 73, 14)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 70, 14)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 70, 14)) + + foo3(t: T, u: U): T; +>foo3 : Symbol(foo3, Decl(genericCallTypeArgumentInference.ts, 73, 24)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 74, 9)) +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 74, 12)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 74, 9)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 74, 17)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 70, 14)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 74, 9)) + + foo4(t: T, u: U): T; +>foo4 : Symbol(foo4, Decl(genericCallTypeArgumentInference.ts, 74, 27)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 75, 9)) +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 75, 12)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 70, 12)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 75, 17)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 75, 9)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 70, 12)) + + foo5(t: T, u: U): T; +>foo5 : Symbol(foo5, Decl(genericCallTypeArgumentInference.ts, 75, 27)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 76, 9)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 76, 11)) +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 76, 15)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 76, 9)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 76, 20)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 76, 11)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 76, 9)) + + foo6(): T; +>foo6 : Symbol(foo6, Decl(genericCallTypeArgumentInference.ts, 76, 30)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 77, 9)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 77, 11)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 77, 9)) + + foo7(u: U): T; +>foo7 : Symbol(foo7, Decl(genericCallTypeArgumentInference.ts, 77, 20)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 78, 9)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 78, 11)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 78, 15)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 78, 11)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 78, 9)) + + foo8(): T; +>foo8 : Symbol(foo8, Decl(genericCallTypeArgumentInference.ts, 78, 24)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 79, 9)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 79, 11)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 79, 9)) +} + +var i: I; +>i : Symbol(i, Decl(genericCallTypeArgumentInference.ts, 82, 3)) +>I : Symbol(I, Decl(genericCallTypeArgumentInference.ts, 68, 19)) + +var r4 = i.foo('', 1); // string +>r4 : Symbol(r4, Decl(genericCallTypeArgumentInference.ts, 61, 3), Decl(genericCallTypeArgumentInference.ts, 83, 3)) +>i.foo : Symbol(I.foo, Decl(genericCallTypeArgumentInference.ts, 71, 21)) +>i : Symbol(i, Decl(genericCallTypeArgumentInference.ts, 82, 3)) +>foo : Symbol(I.foo, Decl(genericCallTypeArgumentInference.ts, 71, 21)) + +var r5 = i.foo2('', 1); // number +>r5 : Symbol(r5, Decl(genericCallTypeArgumentInference.ts, 62, 3), Decl(genericCallTypeArgumentInference.ts, 84, 3)) +>i.foo2 : Symbol(I.foo2, Decl(genericCallTypeArgumentInference.ts, 72, 23)) +>i : Symbol(i, Decl(genericCallTypeArgumentInference.ts, 82, 3)) +>foo2 : Symbol(I.foo2, Decl(genericCallTypeArgumentInference.ts, 72, 23)) + +var r6 = i.foo3(true, 1); // boolean +>r6 : Symbol(r6, Decl(genericCallTypeArgumentInference.ts, 63, 3), Decl(genericCallTypeArgumentInference.ts, 85, 3)) +>i.foo3 : Symbol(I.foo3, Decl(genericCallTypeArgumentInference.ts, 73, 24)) +>i : Symbol(i, Decl(genericCallTypeArgumentInference.ts, 82, 3)) +>foo3 : Symbol(I.foo3, Decl(genericCallTypeArgumentInference.ts, 73, 24)) + +var r7 = i.foo4('', true); // string +>r7 : Symbol(r7, Decl(genericCallTypeArgumentInference.ts, 64, 3), Decl(genericCallTypeArgumentInference.ts, 86, 3)) +>i.foo4 : Symbol(I.foo4, Decl(genericCallTypeArgumentInference.ts, 74, 27)) +>i : Symbol(i, Decl(genericCallTypeArgumentInference.ts, 82, 3)) +>foo4 : Symbol(I.foo4, Decl(genericCallTypeArgumentInference.ts, 74, 27)) + +var r8 = i.foo5(true, 1); // boolean +>r8 : Symbol(r8, Decl(genericCallTypeArgumentInference.ts, 65, 3), Decl(genericCallTypeArgumentInference.ts, 87, 3)) +>i.foo5 : Symbol(I.foo5, Decl(genericCallTypeArgumentInference.ts, 75, 27)) +>i : Symbol(i, Decl(genericCallTypeArgumentInference.ts, 82, 3)) +>foo5 : Symbol(I.foo5, Decl(genericCallTypeArgumentInference.ts, 75, 27)) + +var r9 = i.foo6(); // {} +>r9 : Symbol(r9, Decl(genericCallTypeArgumentInference.ts, 66, 3), Decl(genericCallTypeArgumentInference.ts, 88, 3)) +>i.foo6 : Symbol(I.foo6, Decl(genericCallTypeArgumentInference.ts, 76, 30)) +>i : Symbol(i, Decl(genericCallTypeArgumentInference.ts, 82, 3)) +>foo6 : Symbol(I.foo6, Decl(genericCallTypeArgumentInference.ts, 76, 30)) + +var r10 = i.foo7(''); // {} +>r10 : Symbol(r10, Decl(genericCallTypeArgumentInference.ts, 67, 3), Decl(genericCallTypeArgumentInference.ts, 89, 3)) +>i.foo7 : Symbol(I.foo7, Decl(genericCallTypeArgumentInference.ts, 77, 20)) +>i : Symbol(i, Decl(genericCallTypeArgumentInference.ts, 82, 3)) +>foo7 : Symbol(I.foo7, Decl(genericCallTypeArgumentInference.ts, 77, 20)) + +var r11 = i.foo8(); // {} +>r11 : Symbol(r11, Decl(genericCallTypeArgumentInference.ts, 68, 3), Decl(genericCallTypeArgumentInference.ts, 90, 3)) +>i.foo8 : Symbol(I.foo8, Decl(genericCallTypeArgumentInference.ts, 78, 24)) +>i : Symbol(i, Decl(genericCallTypeArgumentInference.ts, 82, 3)) +>foo8 : Symbol(I.foo8, Decl(genericCallTypeArgumentInference.ts, 78, 24)) + diff --git a/tests/baselines/reference/genericCallTypeArgumentInference.types b/tests/baselines/reference/genericCallTypeArgumentInference.types index ced2daee38d..0208ec74f1e 100644 --- a/tests/baselines/reference/genericCallTypeArgumentInference.types +++ b/tests/baselines/reference/genericCallTypeArgumentInference.types @@ -15,6 +15,7 @@ var r = foo(''); // string >r : string >foo('') : string >foo : (t: T) => T +>'' : string function foo2(t: T, u: U) { >foo2 : (t: T, u: U) => U @@ -48,11 +49,14 @@ var r2 = foo2('', 1); // number >r2 : number >foo2('', 1) : number >foo2 : (t: T, u: U) => U +>'' : string +>1 : number var r3 = foo2b(1); // {} >r3 : {} >foo2b(1) : {} >foo2b : (u: U) => T +>1 : number class C { >C : C @@ -171,6 +175,8 @@ var c = new C('', 1); >c : C >new C('', 1) : C >C : typeof C +>'' : string +>1 : number var r4 = c.foo('', 1); // string >r4 : string @@ -178,6 +184,8 @@ var r4 = c.foo('', 1); // string >c.foo : (t: string, u: number) => string >c : C >foo : (t: string, u: number) => string +>'' : string +>1 : number var r5 = c.foo2('', 1); // number >r5 : number @@ -185,6 +193,8 @@ var r5 = c.foo2('', 1); // number >c.foo2 : (t: string, u: number) => number >c : C >foo2 : (t: string, u: number) => number +>'' : string +>1 : number var r6 = c.foo3(true, 1); // boolean >r6 : boolean @@ -192,6 +202,8 @@ var r6 = c.foo3(true, 1); // boolean >c.foo3 : (t: T, u: number) => T >c : C >foo3 : (t: T, u: number) => T +>true : boolean +>1 : number var r7 = c.foo4('', true); // string >r7 : string @@ -199,6 +211,8 @@ var r7 = c.foo4('', true); // string >c.foo4 : (t: string, u: U) => string >c : C >foo4 : (t: string, u: U) => string +>'' : string +>true : boolean var r8 = c.foo5(true, 1); // boolean >r8 : boolean @@ -206,6 +220,8 @@ var r8 = c.foo5(true, 1); // boolean >c.foo5 : (t: T, u: U) => T >c : C >foo5 : (t: T, u: U) => T +>true : boolean +>1 : number var r9 = c.foo6(); // {} >r9 : {} @@ -220,6 +236,7 @@ var r10 = c.foo7(''); // {} >c.foo7 : (u: U) => T >c : C >foo7 : (u: U) => T +>'' : string var r11 = c.foo8(); // {} >r11 : {} @@ -314,6 +331,8 @@ var r4 = i.foo('', 1); // string >i.foo : (t: string, u: number) => string >i : I >foo : (t: string, u: number) => string +>'' : string +>1 : number var r5 = i.foo2('', 1); // number >r5 : number @@ -321,6 +340,8 @@ var r5 = i.foo2('', 1); // number >i.foo2 : (t: string, u: number) => number >i : I >foo2 : (t: string, u: number) => number +>'' : string +>1 : number var r6 = i.foo3(true, 1); // boolean >r6 : boolean @@ -328,6 +349,8 @@ var r6 = i.foo3(true, 1); // boolean >i.foo3 : (t: T, u: number) => T >i : I >foo3 : (t: T, u: number) => T +>true : boolean +>1 : number var r7 = i.foo4('', true); // string >r7 : string @@ -335,6 +358,8 @@ var r7 = i.foo4('', true); // string >i.foo4 : (t: string, u: U) => string >i : I >foo4 : (t: string, u: U) => string +>'' : string +>true : boolean var r8 = i.foo5(true, 1); // boolean >r8 : boolean @@ -342,6 +367,8 @@ var r8 = i.foo5(true, 1); // boolean >i.foo5 : (t: T, u: U) => T >i : I >foo5 : (t: T, u: U) => T +>true : boolean +>1 : number var r9 = i.foo6(); // {} >r9 : {} @@ -356,6 +383,7 @@ var r10 = i.foo7(''); // {} >i.foo7 : (u: U) => T >i : I >foo7 : (u: U) => T +>'' : string var r11 = i.foo8(); // {} >r11 : {} diff --git a/tests/baselines/reference/genericCallWithArrayLiteralArgs.symbols b/tests/baselines/reference/genericCallWithArrayLiteralArgs.symbols new file mode 100644 index 00000000000..49ccf7ad595 --- /dev/null +++ b/tests/baselines/reference/genericCallWithArrayLiteralArgs.symbols @@ -0,0 +1,44 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithArrayLiteralArgs.ts === +function foo(t: T) { +>foo : Symbol(foo, Decl(genericCallWithArrayLiteralArgs.ts, 0, 0)) +>T : Symbol(T, Decl(genericCallWithArrayLiteralArgs.ts, 0, 13)) +>t : Symbol(t, Decl(genericCallWithArrayLiteralArgs.ts, 0, 16)) +>T : Symbol(T, Decl(genericCallWithArrayLiteralArgs.ts, 0, 13)) + + return t; +>t : Symbol(t, Decl(genericCallWithArrayLiteralArgs.ts, 0, 16)) +} + +var r = foo([1, 2]); // number[] +>r : Symbol(r, Decl(genericCallWithArrayLiteralArgs.ts, 4, 3), Decl(genericCallWithArrayLiteralArgs.ts, 5, 3)) +>foo : Symbol(foo, Decl(genericCallWithArrayLiteralArgs.ts, 0, 0)) + +var r = foo([1, 2]); // number[] +>r : Symbol(r, Decl(genericCallWithArrayLiteralArgs.ts, 4, 3), Decl(genericCallWithArrayLiteralArgs.ts, 5, 3)) +>foo : Symbol(foo, Decl(genericCallWithArrayLiteralArgs.ts, 0, 0)) + +var ra = foo([1, 2]); // any[] +>ra : Symbol(ra, Decl(genericCallWithArrayLiteralArgs.ts, 6, 3)) +>foo : Symbol(foo, Decl(genericCallWithArrayLiteralArgs.ts, 0, 0)) + +var r2 = foo([]); // any[] +>r2 : Symbol(r2, Decl(genericCallWithArrayLiteralArgs.ts, 7, 3)) +>foo : Symbol(foo, Decl(genericCallWithArrayLiteralArgs.ts, 0, 0)) + +var r3 = foo([]); // number[] +>r3 : Symbol(r3, Decl(genericCallWithArrayLiteralArgs.ts, 8, 3)) +>foo : Symbol(foo, Decl(genericCallWithArrayLiteralArgs.ts, 0, 0)) + +var r4 = foo([1, '']); // {}[] +>r4 : Symbol(r4, Decl(genericCallWithArrayLiteralArgs.ts, 9, 3)) +>foo : Symbol(foo, Decl(genericCallWithArrayLiteralArgs.ts, 0, 0)) + +var r5 = foo([1, '']); // any[] +>r5 : Symbol(r5, Decl(genericCallWithArrayLiteralArgs.ts, 10, 3)) +>foo : Symbol(foo, Decl(genericCallWithArrayLiteralArgs.ts, 0, 0)) + +var r6 = foo([1, '']); // Object[] +>r6 : Symbol(r6, Decl(genericCallWithArrayLiteralArgs.ts, 11, 3)) +>foo : Symbol(foo, Decl(genericCallWithArrayLiteralArgs.ts, 0, 0)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + diff --git a/tests/baselines/reference/genericCallWithArrayLiteralArgs.types b/tests/baselines/reference/genericCallWithArrayLiteralArgs.types index f4965940436..48a7150ef44 100644 --- a/tests/baselines/reference/genericCallWithArrayLiteralArgs.types +++ b/tests/baselines/reference/genericCallWithArrayLiteralArgs.types @@ -14,18 +14,24 @@ var r = foo([1, 2]); // number[] >foo([1, 2]) : number[] >foo : (t: T) => T >[1, 2] : number[] +>1 : number +>2 : number var r = foo([1, 2]); // number[] >r : number[] >foo([1, 2]) : number[] >foo : (t: T) => T >[1, 2] : number[] +>1 : number +>2 : number var ra = foo([1, 2]); // any[] >ra : any[] >foo([1, 2]) : any[] >foo : (t: T) => T >[1, 2] : number[] +>1 : number +>2 : number var r2 = foo([]); // any[] >r2 : any[] @@ -44,12 +50,16 @@ var r4 = foo([1, '']); // {}[] >foo([1, '']) : (string | number)[] >foo : (t: T) => T >[1, ''] : (string | number)[] +>1 : number +>'' : string var r5 = foo([1, '']); // any[] >r5 : any[] >foo([1, '']) : any[] >foo : (t: T) => T >[1, ''] : (string | number)[] +>1 : number +>'' : string var r6 = foo([1, '']); // Object[] >r6 : Object[] @@ -57,4 +67,6 @@ var r6 = foo([1, '']); // Object[] >foo : (t: T) => T >Object : Object >[1, ''] : (string | number)[] +>1 : number +>'' : string diff --git a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.symbols b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.symbols new file mode 100644 index 00000000000..5d419b8f992 --- /dev/null +++ b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.symbols @@ -0,0 +1,465 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstraintsTypeArgumentInference.ts === +// Basic type inference with generic calls and constraints, no errors expected + +class Base { foo: string; } +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) +>foo : Symbol(foo, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) +>bar : Symbol(bar, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 3, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 3, 43)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) +>baz : Symbol(baz, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 4, 32)) + +var b: Base; +>b : Symbol(b, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 5, 3)) +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) + +var d1: Derived; +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) + +var d2: Derived2; +>d2 : Symbol(d2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 3)) +>Derived2 : Symbol(Derived2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 3, 43)) + +function foo(t: T) { +>foo : Symbol(foo, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 17)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 9, 13)) +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 9, 29)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 9, 13)) + + return t; +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 9, 29)) +} + +var r = foo(b); // Base +>r : Symbol(r, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 13, 3)) +>foo : Symbol(foo, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 17)) +>b : Symbol(b, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 5, 3)) + +var r2 = foo(d1); // Derived +>r2 : Symbol(r2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 14, 3)) +>foo : Symbol(foo, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 17)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) + +function foo2(t: T, u: U) { +>foo2 : Symbol(foo2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 14, 17)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 16, 14)) +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 16, 29)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 16, 49)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 16, 14)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 16, 54)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 16, 29)) + + return u; +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 16, 54)) +} + +function foo2b(u: U) { +>foo2b : Symbol(foo2b, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 18, 1)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 20, 15)) +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 20, 30)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 20, 50)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 20, 30)) + + var x: T; +>x : Symbol(x, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 21, 7)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 20, 15)) + + return x; +>x : Symbol(x, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 21, 7)) +} + +function foo2c() { +>foo2c : Symbol(foo2c, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 23, 1)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 25, 15)) +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 25, 30)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) + + var x: T; +>x : Symbol(x, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 26, 7)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 25, 15)) + + return x; +>x : Symbol(x, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 26, 7)) +} + +var r3 = foo2b(d1); // Base +>r3 : Symbol(r3, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 30, 3)) +>foo2b : Symbol(foo2b, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 18, 1)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) + +var r3b = foo2c(); // Base +>r3b : Symbol(r3b, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 31, 3)) +>foo2c : Symbol(foo2c, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 23, 1)) + +class C { +>C : Symbol(C, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 31, 18)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 33, 8)) +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 33, 23)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) + + constructor(public t: T, public u: U) { +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 34, 16)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 33, 8)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 34, 28)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 33, 23)) + } + + foo(t: T, u: U) { +>foo : Symbol(foo, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 35, 5)) +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 37, 8)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 33, 8)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 37, 13)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 33, 23)) + + return t; +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 37, 8)) + } + + foo2(t: T, u: U) { +>foo2 : Symbol(foo2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 39, 5)) +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 41, 9)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 33, 8)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 41, 14)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 33, 23)) + + return u; +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 41, 14)) + } + + foo3(t: T, u: U) { +>foo3 : Symbol(foo3, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 43, 5)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 45, 9)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 45, 28)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 45, 9)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 45, 33)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 33, 23)) + + return t; +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 45, 28)) + } + + foo4(t: T, u: U) { +>foo4 : Symbol(foo4, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 47, 5)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 49, 9)) +>Derived2 : Symbol(Derived2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 3, 43)) +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 49, 29)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 33, 8)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 49, 34)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 49, 9)) + + return t; +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 49, 29)) + } + + foo5(t: T, u: U) { +>foo5 : Symbol(foo5, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 51, 5)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 53, 9)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 53, 27)) +>Derived2 : Symbol(Derived2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 3, 43)) +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 53, 48)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 53, 9)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 53, 53)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 53, 27)) + + return t; +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 53, 48)) + } + + foo6() { +>foo6 : Symbol(foo6, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 55, 5)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 57, 9)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 57, 27)) +>Derived2 : Symbol(Derived2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 3, 43)) + + var x: T; +>x : Symbol(x, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 58, 11)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 57, 9)) + + return x; +>x : Symbol(x, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 58, 11)) + } + + foo7(u: U) { +>foo7 : Symbol(foo7, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 60, 5)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 62, 9)) +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 62, 24)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 62, 44)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 62, 24)) + + var x: T; +>x : Symbol(x, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 63, 11)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 62, 9)) + + return x; +>x : Symbol(x, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 63, 11)) + } + + foo8() { +>foo8 : Symbol(foo8, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 65, 5)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 67, 9)) +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 67, 24)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) + + var x: T; +>x : Symbol(x, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 68, 11)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 67, 9)) + + return x; +>x : Symbol(x, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 68, 11)) + } +} + +var c = new C(b, d1); +>c : Symbol(c, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 73, 3)) +>C : Symbol(C, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 31, 18)) +>b : Symbol(b, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 5, 3)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) + +var r4 = c.foo(d1, d2); // Base +>r4 : Symbol(r4, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 74, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 97, 3)) +>c.foo : Symbol(C.foo, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 35, 5)) +>c : Symbol(c, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 73, 3)) +>foo : Symbol(C.foo, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 35, 5)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) +>d2 : Symbol(d2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 3)) + +var r5 = c.foo2(b, d2); // Derived +>r5 : Symbol(r5, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 75, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 98, 3)) +>c.foo2 : Symbol(C.foo2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 39, 5)) +>c : Symbol(c, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 73, 3)) +>foo2 : Symbol(C.foo2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 39, 5)) +>b : Symbol(b, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 5, 3)) +>d2 : Symbol(d2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 3)) + +var r6 = c.foo3(d1, d1); // Derived +>r6 : Symbol(r6, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 76, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 99, 3)) +>c.foo3 : Symbol(C.foo3, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 43, 5)) +>c : Symbol(c, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 73, 3)) +>foo3 : Symbol(C.foo3, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 43, 5)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) + +var r7 = c.foo4(d1, d2); // Base +>r7 : Symbol(r7, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 77, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 100, 3)) +>c.foo4 : Symbol(C.foo4, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 47, 5)) +>c : Symbol(c, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 73, 3)) +>foo4 : Symbol(C.foo4, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 47, 5)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) +>d2 : Symbol(d2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 3)) + +var r8 = c.foo5(d1, d2); // Derived +>r8 : Symbol(r8, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 78, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 101, 3)) +>c.foo5 : Symbol(C.foo5, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 51, 5)) +>c : Symbol(c, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 73, 3)) +>foo5 : Symbol(C.foo5, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 51, 5)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) +>d2 : Symbol(d2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 3)) + +var r8b = c.foo5(d2, d2); // Derived2 +>r8b : Symbol(r8b, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 79, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 102, 3)) +>c.foo5 : Symbol(C.foo5, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 51, 5)) +>c : Symbol(c, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 73, 3)) +>foo5 : Symbol(C.foo5, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 51, 5)) +>d2 : Symbol(d2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 3)) +>d2 : Symbol(d2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 3)) + +var r9 = c.foo6(); // Derived +>r9 : Symbol(r9, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 80, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 103, 3)) +>c.foo6 : Symbol(C.foo6, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 55, 5)) +>c : Symbol(c, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 73, 3)) +>foo6 : Symbol(C.foo6, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 55, 5)) + +var r10 = c.foo7(d1); // Base +>r10 : Symbol(r10, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 81, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 104, 3)) +>c.foo7 : Symbol(C.foo7, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 60, 5)) +>c : Symbol(c, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 73, 3)) +>foo7 : Symbol(C.foo7, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 60, 5)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) + +var r11 = c.foo8(); // Base +>r11 : Symbol(r11, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 82, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 105, 3)) +>c.foo8 : Symbol(C.foo8, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 65, 5)) +>c : Symbol(c, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 73, 3)) +>foo8 : Symbol(C.foo8, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 65, 5)) + +interface I { +>I : Symbol(I, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 82, 19)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 84, 12)) +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 84, 27)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) + + new (t: T, u: U); +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 85, 9)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 84, 12)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 85, 14)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 84, 27)) + + foo(t: T, u: U): T; +>foo : Symbol(foo, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 85, 21)) +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 86, 8)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 84, 12)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 86, 13)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 84, 27)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 84, 12)) + + foo2(t: T, u: U): U; +>foo2 : Symbol(foo2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 86, 23)) +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 87, 9)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 84, 12)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 87, 14)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 84, 27)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 84, 27)) + + foo3(t: T, u: U): T; +>foo3 : Symbol(foo3, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 87, 24)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 88, 9)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 88, 28)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 88, 9)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 88, 33)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 84, 27)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 88, 9)) + + foo4(t: T, u: U): T; +>foo4 : Symbol(foo4, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 88, 43)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 89, 9)) +>Derived2 : Symbol(Derived2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 3, 43)) +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 89, 29)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 84, 12)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 89, 34)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 89, 9)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 84, 12)) + + foo5(t: T, u: U): T; +>foo5 : Symbol(foo5, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 89, 44)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 90, 9)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 90, 27)) +>Derived2 : Symbol(Derived2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 3, 43)) +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 90, 48)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 90, 9)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 90, 53)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 90, 27)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 90, 9)) + + foo6(): T; +>foo6 : Symbol(foo6, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 90, 63)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 91, 9)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 91, 27)) +>Derived2 : Symbol(Derived2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 3, 43)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 91, 9)) + + foo7(u: U): T; +>foo7 : Symbol(foo7, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 91, 53)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 92, 9)) +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 92, 24)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 92, 44)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 92, 24)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 92, 9)) + + foo8(): T; +>foo8 : Symbol(foo8, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 92, 53)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 93, 9)) +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 93, 24)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 93, 9)) +} + +var i: I; +>i : Symbol(i, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 96, 3)) +>I : Symbol(I, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 82, 19)) +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) + +var r4 = i.foo(d1, d2); // Base +>r4 : Symbol(r4, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 74, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 97, 3)) +>i.foo : Symbol(I.foo, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 85, 21)) +>i : Symbol(i, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 96, 3)) +>foo : Symbol(I.foo, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 85, 21)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) +>d2 : Symbol(d2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 3)) + +var r5 = i.foo2(b, d2); // Derived +>r5 : Symbol(r5, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 75, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 98, 3)) +>i.foo2 : Symbol(I.foo2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 86, 23)) +>i : Symbol(i, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 96, 3)) +>foo2 : Symbol(I.foo2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 86, 23)) +>b : Symbol(b, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 5, 3)) +>d2 : Symbol(d2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 3)) + +var r6 = i.foo3(d1, d1); // Derived +>r6 : Symbol(r6, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 76, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 99, 3)) +>i.foo3 : Symbol(I.foo3, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 87, 24)) +>i : Symbol(i, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 96, 3)) +>foo3 : Symbol(I.foo3, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 87, 24)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) + +var r7 = i.foo4(d1, d2); // Base +>r7 : Symbol(r7, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 77, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 100, 3)) +>i.foo4 : Symbol(I.foo4, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 88, 43)) +>i : Symbol(i, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 96, 3)) +>foo4 : Symbol(I.foo4, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 88, 43)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) +>d2 : Symbol(d2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 3)) + +var r8 = i.foo5(d1, d2); // Derived +>r8 : Symbol(r8, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 78, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 101, 3)) +>i.foo5 : Symbol(I.foo5, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 89, 44)) +>i : Symbol(i, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 96, 3)) +>foo5 : Symbol(I.foo5, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 89, 44)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) +>d2 : Symbol(d2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 3)) + +var r8b = i.foo5(d2, d2); // Derived2 +>r8b : Symbol(r8b, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 79, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 102, 3)) +>i.foo5 : Symbol(I.foo5, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 89, 44)) +>i : Symbol(i, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 96, 3)) +>foo5 : Symbol(I.foo5, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 89, 44)) +>d2 : Symbol(d2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 3)) +>d2 : Symbol(d2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 3)) + +var r9 = i.foo6(); // Derived +>r9 : Symbol(r9, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 80, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 103, 3)) +>i.foo6 : Symbol(I.foo6, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 90, 63)) +>i : Symbol(i, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 96, 3)) +>foo6 : Symbol(I.foo6, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 90, 63)) + +var r10 = i.foo7(d1); // Base +>r10 : Symbol(r10, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 81, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 104, 3)) +>i.foo7 : Symbol(I.foo7, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 91, 53)) +>i : Symbol(i, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 96, 3)) +>foo7 : Symbol(I.foo7, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 91, 53)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) + +var r11 = i.foo8(); // Base +>r11 : Symbol(r11, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 82, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 105, 3)) +>i.foo8 : Symbol(I.foo8, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 92, 53)) +>i : Symbol(i, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 96, 3)) +>foo8 : Symbol(I.foo8, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 92, 53)) + diff --git a/tests/baselines/reference/genericCallWithFixedArguments.symbols b/tests/baselines/reference/genericCallWithFixedArguments.symbols new file mode 100644 index 00000000000..c47c5ef8f06 --- /dev/null +++ b/tests/baselines/reference/genericCallWithFixedArguments.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/genericCallWithFixedArguments.ts === +class A { foo() { } } +>A : Symbol(A, Decl(genericCallWithFixedArguments.ts, 0, 0)) +>foo : Symbol(foo, Decl(genericCallWithFixedArguments.ts, 0, 9)) + +class B { bar() { }} +>B : Symbol(B, Decl(genericCallWithFixedArguments.ts, 0, 21)) +>bar : Symbol(bar, Decl(genericCallWithFixedArguments.ts, 1, 9)) + +function g(x) { } +>g : Symbol(g, Decl(genericCallWithFixedArguments.ts, 1, 20)) +>T : Symbol(T, Decl(genericCallWithFixedArguments.ts, 3, 11)) +>U : Symbol(U, Decl(genericCallWithFixedArguments.ts, 3, 13)) +>x : Symbol(x, Decl(genericCallWithFixedArguments.ts, 3, 17)) + +g(7) // the parameter list is fixed, so this should not error +>g : Symbol(g, Decl(genericCallWithFixedArguments.ts, 1, 20)) +>A : Symbol(A, Decl(genericCallWithFixedArguments.ts, 0, 0)) +>B : Symbol(B, Decl(genericCallWithFixedArguments.ts, 0, 21)) + + diff --git a/tests/baselines/reference/genericCallWithFixedArguments.types b/tests/baselines/reference/genericCallWithFixedArguments.types index acfad45a0f2..f22dbc01252 100644 --- a/tests/baselines/reference/genericCallWithFixedArguments.types +++ b/tests/baselines/reference/genericCallWithFixedArguments.types @@ -18,5 +18,6 @@ g(7) // the parameter list is fixed, so this should not error >g : (x: any) => void >A : A >B : B +>7 : number diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments3.symbols b/tests/baselines/reference/genericCallWithFunctionTypedArguments3.symbols new file mode 100644 index 00000000000..c8b34a73471 --- /dev/null +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments3.symbols @@ -0,0 +1,54 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments3.ts === +// No inference is made from function typed arguments which have multiple call signatures + +var a: { +>a : Symbol(a, Decl(genericCallWithFunctionTypedArguments3.ts, 2, 3)) + + (x: boolean): boolean; +>x : Symbol(x, Decl(genericCallWithFunctionTypedArguments3.ts, 3, 5)) + + (x: string): any; +>x : Symbol(x, Decl(genericCallWithFunctionTypedArguments3.ts, 4, 5)) +} + +function foo4(cb: (x: T) => U) { +>foo4 : Symbol(foo4, Decl(genericCallWithFunctionTypedArguments3.ts, 5, 1)) +>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments3.ts, 7, 14)) +>U : Symbol(U, Decl(genericCallWithFunctionTypedArguments3.ts, 7, 16)) +>cb : Symbol(cb, Decl(genericCallWithFunctionTypedArguments3.ts, 7, 20)) +>x : Symbol(x, Decl(genericCallWithFunctionTypedArguments3.ts, 7, 25)) +>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments3.ts, 7, 14)) +>U : Symbol(U, Decl(genericCallWithFunctionTypedArguments3.ts, 7, 16)) + + var u: U; +>u : Symbol(u, Decl(genericCallWithFunctionTypedArguments3.ts, 8, 7)) +>U : Symbol(U, Decl(genericCallWithFunctionTypedArguments3.ts, 7, 16)) + + return u; +>u : Symbol(u, Decl(genericCallWithFunctionTypedArguments3.ts, 8, 7)) +} + +var r = foo4(a); // T is {} (candidates boolean and string), U is any (candidates any and boolean) +>r : Symbol(r, Decl(genericCallWithFunctionTypedArguments3.ts, 12, 3)) +>foo4 : Symbol(foo4, Decl(genericCallWithFunctionTypedArguments3.ts, 5, 1)) +>a : Symbol(a, Decl(genericCallWithFunctionTypedArguments3.ts, 2, 3)) + +var b: { +>b : Symbol(b, Decl(genericCallWithFunctionTypedArguments3.ts, 14, 3)) + + (x: boolean): T; +>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments3.ts, 15, 5)) +>x : Symbol(x, Decl(genericCallWithFunctionTypedArguments3.ts, 15, 8)) +>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments3.ts, 15, 5)) + + (x: T): any; +>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments3.ts, 16, 5)) +>x : Symbol(x, Decl(genericCallWithFunctionTypedArguments3.ts, 16, 8)) +>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments3.ts, 16, 5)) +} + +var r2 = foo4(b); // T is {} (candidates boolean and {}), U is any (candidates any and {}) +>r2 : Symbol(r2, Decl(genericCallWithFunctionTypedArguments3.ts, 19, 3)) +>foo4 : Symbol(foo4, Decl(genericCallWithFunctionTypedArguments3.ts, 5, 1)) +>b : Symbol(b, Decl(genericCallWithFunctionTypedArguments3.ts, 14, 3)) + diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments4.symbols b/tests/baselines/reference/genericCallWithFunctionTypedArguments4.symbols new file mode 100644 index 00000000000..9aa87c28240 --- /dev/null +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments4.symbols @@ -0,0 +1,64 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments4.ts === +// No inference is made from function typed arguments which have multiple call signatures + +class C { foo: string } +>C : Symbol(C, Decl(genericCallWithFunctionTypedArguments4.ts, 0, 0)) +>foo : Symbol(foo, Decl(genericCallWithFunctionTypedArguments4.ts, 2, 9)) + +class D { bar: string } +>D : Symbol(D, Decl(genericCallWithFunctionTypedArguments4.ts, 2, 23)) +>bar : Symbol(bar, Decl(genericCallWithFunctionTypedArguments4.ts, 3, 9)) + +var a: { +>a : Symbol(a, Decl(genericCallWithFunctionTypedArguments4.ts, 4, 3)) + + new(x: boolean): C; +>x : Symbol(x, Decl(genericCallWithFunctionTypedArguments4.ts, 5, 8)) +>C : Symbol(C, Decl(genericCallWithFunctionTypedArguments4.ts, 0, 0)) + + new(x: string): D; +>x : Symbol(x, Decl(genericCallWithFunctionTypedArguments4.ts, 6, 8)) +>D : Symbol(D, Decl(genericCallWithFunctionTypedArguments4.ts, 2, 23)) +} + +function foo4(cb: new(x: T) => U) { +>foo4 : Symbol(foo4, Decl(genericCallWithFunctionTypedArguments4.ts, 7, 1)) +>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments4.ts, 9, 14)) +>U : Symbol(U, Decl(genericCallWithFunctionTypedArguments4.ts, 9, 16)) +>cb : Symbol(cb, Decl(genericCallWithFunctionTypedArguments4.ts, 9, 20)) +>x : Symbol(x, Decl(genericCallWithFunctionTypedArguments4.ts, 9, 28)) +>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments4.ts, 9, 14)) +>U : Symbol(U, Decl(genericCallWithFunctionTypedArguments4.ts, 9, 16)) + + var u: U; +>u : Symbol(u, Decl(genericCallWithFunctionTypedArguments4.ts, 10, 7)) +>U : Symbol(U, Decl(genericCallWithFunctionTypedArguments4.ts, 9, 16)) + + return u; +>u : Symbol(u, Decl(genericCallWithFunctionTypedArguments4.ts, 10, 7)) +} + +var r = foo4(a); // T is {} (candidates boolean and string), U is {} (candidates C and D) +>r : Symbol(r, Decl(genericCallWithFunctionTypedArguments4.ts, 14, 3)) +>foo4 : Symbol(foo4, Decl(genericCallWithFunctionTypedArguments4.ts, 7, 1)) +>a : Symbol(a, Decl(genericCallWithFunctionTypedArguments4.ts, 4, 3)) + +var b: { +>b : Symbol(b, Decl(genericCallWithFunctionTypedArguments4.ts, 16, 3)) + + new(x: boolean): T; +>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments4.ts, 17, 8)) +>x : Symbol(x, Decl(genericCallWithFunctionTypedArguments4.ts, 17, 11)) +>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments4.ts, 17, 8)) + + new(x: T): any; +>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments4.ts, 18, 8)) +>x : Symbol(x, Decl(genericCallWithFunctionTypedArguments4.ts, 18, 11)) +>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments4.ts, 18, 8)) +} + +var r2 = foo4(b); // T is {} (candidates boolean and {}), U is any (candidates any and {}) +>r2 : Symbol(r2, Decl(genericCallWithFunctionTypedArguments4.ts, 21, 3)) +>foo4 : Symbol(foo4, Decl(genericCallWithFunctionTypedArguments4.ts, 7, 1)) +>b : Symbol(b, Decl(genericCallWithFunctionTypedArguments4.ts, 16, 3)) + diff --git a/tests/baselines/reference/genericCallWithNonGenericArgs1.symbols b/tests/baselines/reference/genericCallWithNonGenericArgs1.symbols new file mode 100644 index 00000000000..78a0bec0108 --- /dev/null +++ b/tests/baselines/reference/genericCallWithNonGenericArgs1.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/genericCallWithNonGenericArgs1.ts === +function f(x: any) { } +>f : Symbol(f, Decl(genericCallWithNonGenericArgs1.ts, 0, 0)) +>T : Symbol(T, Decl(genericCallWithNonGenericArgs1.ts, 0, 11)) +>x : Symbol(x, Decl(genericCallWithNonGenericArgs1.ts, 0, 14)) + +f(null) +>f : Symbol(f, Decl(genericCallWithNonGenericArgs1.ts, 0, 0)) + diff --git a/tests/baselines/reference/genericCallWithNonGenericArgs1.types b/tests/baselines/reference/genericCallWithNonGenericArgs1.types index f08f8503075..75d86728132 100644 --- a/tests/baselines/reference/genericCallWithNonGenericArgs1.types +++ b/tests/baselines/reference/genericCallWithNonGenericArgs1.types @@ -7,4 +7,5 @@ function f(x: any) { } f(null) >f(null) : void >f : (x: any) => void +>null : null diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgs2.symbols b/tests/baselines/reference/genericCallWithObjectTypeArgs2.symbols new file mode 100644 index 00000000000..f567499d4c9 --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgs2.symbols @@ -0,0 +1,114 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgs2.ts === +class Base { +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgs2.ts, 0, 0)) + + x: string; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgs2.ts, 0, 12)) +} +class Derived extends Base { +>Derived : Symbol(Derived, Decl(genericCallWithObjectTypeArgs2.ts, 2, 1)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgs2.ts, 0, 0)) + + y: string; +>y : Symbol(y, Decl(genericCallWithObjectTypeArgs2.ts, 3, 28)) +} +class Derived2 extends Base { +>Derived2 : Symbol(Derived2, Decl(genericCallWithObjectTypeArgs2.ts, 5, 1)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgs2.ts, 0, 0)) + + z: string; +>z : Symbol(z, Decl(genericCallWithObjectTypeArgs2.ts, 6, 29)) +} + +// returns {}[] +function f(a: { x: T; y: U }) { +>f : Symbol(f, Decl(genericCallWithObjectTypeArgs2.ts, 8, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgs2.ts, 11, 11)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgs2.ts, 0, 0)) +>U : Symbol(U, Decl(genericCallWithObjectTypeArgs2.ts, 11, 26)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgs2.ts, 0, 0)) +>a : Symbol(a, Decl(genericCallWithObjectTypeArgs2.ts, 11, 43)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgs2.ts, 11, 47)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgs2.ts, 11, 11)) +>y : Symbol(y, Decl(genericCallWithObjectTypeArgs2.ts, 11, 53)) +>U : Symbol(U, Decl(genericCallWithObjectTypeArgs2.ts, 11, 26)) + + return [a.x, a.y]; +>a.x : Symbol(x, Decl(genericCallWithObjectTypeArgs2.ts, 11, 47)) +>a : Symbol(a, Decl(genericCallWithObjectTypeArgs2.ts, 11, 43)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgs2.ts, 11, 47)) +>a.y : Symbol(y, Decl(genericCallWithObjectTypeArgs2.ts, 11, 53)) +>a : Symbol(a, Decl(genericCallWithObjectTypeArgs2.ts, 11, 43)) +>y : Symbol(y, Decl(genericCallWithObjectTypeArgs2.ts, 11, 53)) +} + +var r = f({ x: new Derived(), y: new Derived2() }); // {}[] +>r : Symbol(r, Decl(genericCallWithObjectTypeArgs2.ts, 15, 3)) +>f : Symbol(f, Decl(genericCallWithObjectTypeArgs2.ts, 8, 1)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgs2.ts, 15, 11)) +>Derived : Symbol(Derived, Decl(genericCallWithObjectTypeArgs2.ts, 2, 1)) +>y : Symbol(y, Decl(genericCallWithObjectTypeArgs2.ts, 15, 29)) +>Derived2 : Symbol(Derived2, Decl(genericCallWithObjectTypeArgs2.ts, 5, 1)) + +var r2 = f({ x: new Base(), y: new Derived2() }); // {}[] +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgs2.ts, 16, 3)) +>f : Symbol(f, Decl(genericCallWithObjectTypeArgs2.ts, 8, 1)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgs2.ts, 16, 12)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgs2.ts, 0, 0)) +>y : Symbol(y, Decl(genericCallWithObjectTypeArgs2.ts, 16, 27)) +>Derived2 : Symbol(Derived2, Decl(genericCallWithObjectTypeArgs2.ts, 5, 1)) + + +function f2(a: { x: T; y: U }) { +>f2 : Symbol(f2, Decl(genericCallWithObjectTypeArgs2.ts, 16, 49)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgs2.ts, 19, 12)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgs2.ts, 0, 0)) +>U : Symbol(U, Decl(genericCallWithObjectTypeArgs2.ts, 19, 27)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgs2.ts, 0, 0)) +>a : Symbol(a, Decl(genericCallWithObjectTypeArgs2.ts, 19, 44)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgs2.ts, 19, 48)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgs2.ts, 19, 12)) +>y : Symbol(y, Decl(genericCallWithObjectTypeArgs2.ts, 19, 54)) +>U : Symbol(U, Decl(genericCallWithObjectTypeArgs2.ts, 19, 27)) + + return (x: T) => a.y; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgs2.ts, 20, 12)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgs2.ts, 19, 12)) +>a.y : Symbol(y, Decl(genericCallWithObjectTypeArgs2.ts, 19, 54)) +>a : Symbol(a, Decl(genericCallWithObjectTypeArgs2.ts, 19, 44)) +>y : Symbol(y, Decl(genericCallWithObjectTypeArgs2.ts, 19, 54)) +} + +var r3 = f2({ x: new Derived(), y: new Derived2() }); // Derived => Derived2 +>r3 : Symbol(r3, Decl(genericCallWithObjectTypeArgs2.ts, 23, 3)) +>f2 : Symbol(f2, Decl(genericCallWithObjectTypeArgs2.ts, 16, 49)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgs2.ts, 23, 13)) +>Derived : Symbol(Derived, Decl(genericCallWithObjectTypeArgs2.ts, 2, 1)) +>y : Symbol(y, Decl(genericCallWithObjectTypeArgs2.ts, 23, 31)) +>Derived2 : Symbol(Derived2, Decl(genericCallWithObjectTypeArgs2.ts, 5, 1)) + +interface I { +>I : Symbol(I, Decl(genericCallWithObjectTypeArgs2.ts, 23, 53)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgs2.ts, 25, 12)) +>U : Symbol(U, Decl(genericCallWithObjectTypeArgs2.ts, 25, 14)) + + x: T; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgs2.ts, 25, 19)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgs2.ts, 25, 12)) + + y: U; +>y : Symbol(y, Decl(genericCallWithObjectTypeArgs2.ts, 26, 9)) +>U : Symbol(U, Decl(genericCallWithObjectTypeArgs2.ts, 25, 14)) +} + +var i: I; +>i : Symbol(i, Decl(genericCallWithObjectTypeArgs2.ts, 30, 3)) +>I : Symbol(I, Decl(genericCallWithObjectTypeArgs2.ts, 23, 53)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgs2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(genericCallWithObjectTypeArgs2.ts, 2, 1)) + +var r4 = f2(i); // Base => Derived +>r4 : Symbol(r4, Decl(genericCallWithObjectTypeArgs2.ts, 31, 3)) +>f2 : Symbol(f2, Decl(genericCallWithObjectTypeArgs2.ts, 16, 49)) +>i : Symbol(i, Decl(genericCallWithObjectTypeArgs2.ts, 30, 3)) + diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints.symbols b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints.symbols new file mode 100644 index 00000000000..50f20f55bea --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints.symbols @@ -0,0 +1,102 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints.ts === +// Generic call with constraints infering type parameter from object member properties +// No errors expected + +class C { +>C : Symbol(C, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 0, 0)) + + x: string; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 3, 9)) +} + +class D { +>D : Symbol(D, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 5, 1)) + + x: string; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 7, 9)) + + y: string; +>y : Symbol(y, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 8, 14)) +} + +class X { +>X : Symbol(X, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 12, 8)) + + x: T; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 12, 12)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 12, 8)) +} + +function foo(t: X, t2: X) { +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 14, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 16, 13)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 16, 24)) +>t : Symbol(t, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 16, 38)) +>X : Symbol(X, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 16, 13)) +>t2 : Symbol(t2, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 16, 46)) +>X : Symbol(X, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 16, 13)) + + var x: T; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 17, 7)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 16, 13)) + + return x; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 17, 7)) +} + +var c1 = new X(); +>c1 : Symbol(c1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 21, 3)) +>X : Symbol(X, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>C : Symbol(C, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 0, 0)) + +var d1 = new X(); +>d1 : Symbol(d1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 22, 3)) +>X : Symbol(X, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>D : Symbol(D, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 5, 1)) + +var r = foo(c1, d1); +>r : Symbol(r, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 23, 3), Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 31, 3)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 14, 1)) +>c1 : Symbol(c1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 21, 3)) +>d1 : Symbol(d1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 22, 3)) + +var r2 = foo(c1, c1); +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 24, 3), Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 32, 3)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 14, 1)) +>c1 : Symbol(c1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 21, 3)) +>c1 : Symbol(c1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 21, 3)) + +function foo2(t: X, t2: X) { +>foo2 : Symbol(foo2, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 24, 21)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 26, 14)) +>C : Symbol(C, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 0, 0)) +>t : Symbol(t, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 26, 27)) +>X : Symbol(X, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 26, 14)) +>t2 : Symbol(t2, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 26, 35)) +>X : Symbol(X, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 26, 14)) + + var x: T; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 27, 7)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 26, 14)) + + return x; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 27, 7)) +} + +var r = foo2(c1, d1); +>r : Symbol(r, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 23, 3), Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 31, 3)) +>foo2 : Symbol(foo2, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 24, 21)) +>c1 : Symbol(c1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 21, 3)) +>d1 : Symbol(d1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 22, 3)) + +var r2 = foo2(c1, c1); +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 24, 3), Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 32, 3)) +>foo2 : Symbol(foo2, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 24, 21)) +>c1 : Symbol(c1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 21, 3)) +>c1 : Symbol(c1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 21, 3)) + diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.symbols b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.symbols new file mode 100644 index 00000000000..864927a3a8c --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.symbols @@ -0,0 +1,124 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints2.ts === +// Generic call with constraints infering type parameter from object member properties +// No errors expected + +class Base { +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 0, 0)) + + x: string; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 3, 12)) +} +class Derived extends Base { +>Derived : Symbol(Derived, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 5, 1)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 0, 0)) + + y: string; +>y : Symbol(y, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 6, 28)) +} + +function f(x: { foo: T; bar: T }) { +>f : Symbol(f, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 8, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 10, 11)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 0, 0)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 10, 27)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 10, 31)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 10, 11)) +>bar : Symbol(bar, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 10, 39)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 10, 11)) + + var r: T; +>r : Symbol(r, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 11, 7)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 10, 11)) + + return r; +>r : Symbol(r, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 11, 7)) +} +var r = f({ foo: new Base(), bar: new Derived() }); +>r : Symbol(r, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 14, 3)) +>f : Symbol(f, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 8, 1)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 14, 11)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 0, 0)) +>bar : Symbol(bar, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 14, 28)) +>Derived : Symbol(Derived, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 5, 1)) + +var r2 = f({ foo: new Derived(), bar: new Derived() }); +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 15, 3)) +>f : Symbol(f, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 8, 1)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 15, 12)) +>Derived : Symbol(Derived, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 5, 1)) +>bar : Symbol(bar, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 15, 32)) +>Derived : Symbol(Derived, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 5, 1)) + + +interface I { +>I : Symbol(I, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 15, 55)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 18, 12)) + + a: T; +>a : Symbol(a, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 18, 16)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 18, 12)) +} +function f2(x: I) { +>f2 : Symbol(f2, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 20, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 21, 12)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 0, 0)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 21, 28)) +>I : Symbol(I, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 15, 55)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 21, 12)) + + var r: T; +>r : Symbol(r, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 22, 7)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 21, 12)) + + return r; +>r : Symbol(r, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 22, 7)) +} +var i: I; +>i : Symbol(i, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 25, 3)) +>I : Symbol(I, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 15, 55)) +>Derived : Symbol(Derived, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 5, 1)) + +var r3 = f2(i); +>r3 : Symbol(r3, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 26, 3)) +>f2 : Symbol(f2, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 20, 1)) +>i : Symbol(i, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 25, 3)) + + +function f3(x: T, y: (a: T) => T) { +>f3 : Symbol(f3, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 26, 15)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 29, 12)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 0, 0)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 29, 28)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 29, 12)) +>y : Symbol(y, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 29, 33)) +>a : Symbol(a, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 29, 38)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 29, 12)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 29, 12)) + + return y(null); +>y : Symbol(y, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 29, 33)) +} +var r4 = f3(new Base(), x => x); +>r4 : Symbol(r4, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 32, 3)) +>f3 : Symbol(f3, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 26, 15)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 0, 0)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 32, 23)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 32, 23)) + +var r5 = f3(new Derived(), x => x); +>r5 : Symbol(r5, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 33, 3)) +>f3 : Symbol(f3, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 26, 15)) +>Derived : Symbol(Derived, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 5, 1)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 33, 26)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 33, 26)) + +var r6 = f3(null, null); // any +>r6 : Symbol(r6, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 35, 3)) +>f3 : Symbol(f3, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 26, 15)) + +var r7 = f3(null, x => x); // any +>r7 : Symbol(r7, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 36, 3)) +>f3 : Symbol(f3, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 26, 15)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 36, 17)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 36, 17)) + diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.types index 29706ba7e3d..8ffa07252bc 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.types @@ -107,6 +107,7 @@ function f3(x: T, y: (a: T) => T) { return y(null); >y(null) : T >y : (a: T) => T +>null : null } var r4 = f3(new Base(), x => x); >r4 : Base @@ -132,11 +133,14 @@ var r6 = f3(null, null); // any >r6 : any >f3(null, null) : any >f3 : (x: T, y: (a: T) => T) => T +>null : null +>null : null var r7 = f3(null, x => x); // any >r7 : any >f3(null, x => x) : any >f3 : (x: T, y: (a: T) => T) => T +>null : null >x => x : (x: any) => any >x : any >x : any diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.symbols b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.symbols new file mode 100644 index 00000000000..14a91401efb --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.symbols @@ -0,0 +1,62 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexers.ts === +// Type inference infers from indexers in target type, no errors expected + +function foo(x: T) { +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 0, 0)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 2, 13)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 2, 16)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 2, 13)) + + return x; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 2, 16)) +} + +var a: { +>a : Symbol(a, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 6, 3)) + + [x: string]: Object; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 7, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + [x: number]: Date; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 8, 5)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +}; +var r = foo(a); +>r : Symbol(r, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 10, 3)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 0, 0)) +>a : Symbol(a, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 6, 3)) + +function other(arg: T) { +>other : Symbol(other, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 10, 15)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 12, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>arg : Symbol(arg, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 12, 31)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 12, 15)) + + var b: { +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 13, 7)) + + [x: string]: Object; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 14, 9)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + [x: number]: T +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 15, 9)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 12, 15)) + + }; + var r2 = foo(b); +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 17, 7)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 0, 0)) +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 13, 7)) + + var d = r2[1]; +>d : Symbol(d, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 18, 7)) +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 17, 7)) + + var e = r2['1']; +>e : Symbol(e, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 19, 7)) +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 17, 7)) +} diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.types index 9a7ca1dbb91..e1659323033 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.types @@ -58,9 +58,11 @@ function other(arg: T) { >d : T >r2[1] : T >r2 : { [x: string]: Object; [x: number]: T; } +>1 : number var e = r2['1']; >e : Object >r2['1'] : Object >r2 : { [x: string]: Object; [x: number]: T; } +>'1' : string } diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.symbols b/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.symbols new file mode 100644 index 00000000000..77787e77299 --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.symbols @@ -0,0 +1,95 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndNumericIndexer.ts === +// Type inference infers from indexers in target type, no errors expected + +function foo(x: T) { +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 0, 0)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 2, 13)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 2, 16)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 2, 13)) + + return x; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 2, 16)) +} + +var a: { [x: number]: Date }; +>a : Symbol(a, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 6, 3)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 6, 10)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var r = foo(a); +>r : Symbol(r, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 7, 3)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 0, 0)) +>a : Symbol(a, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 6, 3)) + +function other(arg: T) { +>other : Symbol(other, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 7, 15)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 9, 15)) +>arg : Symbol(arg, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 9, 18)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 9, 15)) + + var b: { [x: number]: T }; +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 10, 7)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 10, 14)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 9, 15)) + + var r2 = foo(b); // T +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 11, 7)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 0, 0)) +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 10, 7)) +} + +function other2(arg: T) { +>other2 : Symbol(other2, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 12, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 14, 16)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>arg : Symbol(arg, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 14, 32)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 14, 16)) + + var b: { [x: number]: T }; +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 15, 7)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 15, 14)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 14, 16)) + + var r2 = foo(b); +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 16, 7)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 0, 0)) +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 15, 7)) + + var d = r2[1]; +>d : Symbol(d, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 17, 7)) +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 16, 7)) +} + +function other3(arg: T) { +>other3 : Symbol(other3, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 18, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 20, 16)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>U : Symbol(U, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 20, 31)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>arg : Symbol(arg, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 20, 48)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 20, 16)) + + var b: { [x: number]: T }; +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 21, 7)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 21, 14)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 20, 16)) + + var r2 = foo(b); +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 22, 7)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 0, 0)) +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 21, 7)) + + var d = r2[1]; +>d : Symbol(d, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 23, 7)) +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 22, 7)) + + // BUG 821629 + //var u: U = r2[1]; // ok +} +//function other3(arg: T) { +// var b: { [x: number]: T }; +// var r2 = foo(b); +// var d = r2[1]; +// // BUG 821629 +// //var u: U = r2[1]; // ok +//} diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.types index f4b3f5960f0..71e943c1ad3 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.types @@ -62,6 +62,7 @@ function other2(arg: T) { >d : T >r2[1] : T >r2 : { [x: number]: T; } +>1 : number } function other3(arg: T) { @@ -88,6 +89,7 @@ function other3(arg: T) { >d : T >r2[1] : T >r2 : { [x: number]: T; } +>1 : number // BUG 821629 //var u: U = r2[1]; // ok diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.symbols b/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.symbols new file mode 100644 index 00000000000..62b7c82b8e3 --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.symbols @@ -0,0 +1,98 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndStringIndexer.ts === +// Type inference infers from indexers in target type, no errors expected + +function foo(x: T) { +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 0, 0)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 2, 13)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 2, 16)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 2, 13)) + + return x; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 2, 16)) +} + +var a: { [x: string]: Date }; +>a : Symbol(a, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 6, 3)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 6, 10)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var r = foo(a); +>r : Symbol(r, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 7, 3)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 0, 0)) +>a : Symbol(a, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 6, 3)) + +function other(arg: T) { +>other : Symbol(other, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 7, 15)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 9, 15)) +>arg : Symbol(arg, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 9, 18)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 9, 15)) + + var b: { [x: string]: T }; +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 10, 7)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 10, 14)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 9, 15)) + + var r2 = foo(b); // T +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 11, 7)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 0, 0)) +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 10, 7)) +} + +function other2(arg: T) { +>other2 : Symbol(other2, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 12, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 14, 16)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>arg : Symbol(arg, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 14, 32)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 14, 16)) + + var b: { [x: string]: T }; +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 15, 7)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 15, 14)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 14, 16)) + + var r2 = foo(b); +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 16, 7)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 0, 0)) +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 15, 7)) + + var d: Date = r2['hm']; // ok +>d : Symbol(d, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 17, 7)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 16, 7)) +} + +function other3(arg: T) { +>other3 : Symbol(other3, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 18, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 20, 16)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>U : Symbol(U, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 20, 31)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>arg : Symbol(arg, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 20, 48)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 20, 16)) + + var b: { [x: string]: T }; +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 21, 7)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 21, 14)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 20, 16)) + + var r2 = foo(b); +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 22, 7)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 0, 0)) +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 21, 7)) + + var d: Date = r2['hm']; // ok +>d : Symbol(d, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 23, 7)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 22, 7)) + + // BUG 821629 + //var u: U = r2['hm']; // ok +} + +//function other3(arg: T) { +// var b: { [x: string]: T }; +// var r2 = foo(b); +// var d: Date = r2['hm']; // ok +// // BUG 821629 +// //var u: U = r2['hm']; // ok +//} diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.types index e52e6cff113..196103f422b 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.types @@ -63,6 +63,7 @@ function other2(arg: T) { >Date : Date >r2['hm'] : T >r2 : { [x: string]: T; } +>'hm' : string } function other3(arg: T) { @@ -90,6 +91,7 @@ function other3(arg: T) { >Date : Date >r2['hm'] : T >r2 : { [x: string]: T; } +>'hm' : string // BUG 821629 //var u: U = r2['hm']; // ok diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.symbols b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.symbols new file mode 100644 index 00000000000..1d32c55fd33 --- /dev/null +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.symbols @@ -0,0 +1,163 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedFunctionTypedArguments.ts === +// Function typed arguments with multiple signatures must be passed an implementation that matches all of them +// Inferences are made quadratic-pairwise to and from these overload sets + +module NonGenericParameter { +>NonGenericParameter : Symbol(NonGenericParameter, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 0, 0)) + + var a: { +>a : Symbol(a, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 4, 7)) + + (x: boolean): boolean; +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 5, 9)) + + (x: string): string; +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 6, 9)) + } + + function foo4(cb: typeof a) { +>foo4 : Symbol(foo4, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 7, 5)) +>cb : Symbol(cb, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 9, 18)) +>a : Symbol(a, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 4, 7)) + + return cb; +>cb : Symbol(cb, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 9, 18)) + } + + var r = foo4(a); +>r : Symbol(r, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 13, 7)) +>foo4 : Symbol(foo4, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 7, 5)) +>a : Symbol(a, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 4, 7)) + + var r2 = foo4((x: T) => x); +>r2 : Symbol(r2, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 14, 7)) +>foo4 : Symbol(foo4, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 7, 5)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 14, 19)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 14, 22)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 14, 19)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 14, 22)) + + var r4 = foo4(x => x); +>r4 : Symbol(r4, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 15, 7)) +>foo4 : Symbol(foo4, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 7, 5)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 15, 18)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 15, 18)) +} + +module GenericParameter { +>GenericParameter : Symbol(GenericParameter, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 16, 1)) + + function foo5(cb: { (x: T): string; (x: number): T }) { +>foo5 : Symbol(foo5, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 18, 25)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 19, 18)) +>cb : Symbol(cb, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 19, 21)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 19, 28)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 19, 18)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 19, 44)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 19, 18)) + + return cb; +>cb : Symbol(cb, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 19, 21)) + } + + var r5 = foo5(x => x); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed]. T is any +>r5 : Symbol(r5, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 23, 7)) +>foo5 : Symbol(foo5, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 18, 25)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 23, 18)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 23, 18)) + + var a: { (x: T): string; (x: number): T; } +>a : Symbol(a, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 7), Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 7)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 14)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 17)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 14)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 33)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 36)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 33)) + + var r7 = foo5(a); // any => string (+1 overload) +>r7 : Symbol(r7, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 25, 7)) +>foo5 : Symbol(foo5, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 18, 25)) +>a : Symbol(a, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 7), Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 7)) + + function foo6(cb: { (x: T): string; (x: T, y?: T): string }) { +>foo6 : Symbol(foo6, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 25, 21)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 27, 18)) +>cb : Symbol(cb, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 27, 21)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 27, 28)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 27, 18)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 27, 44)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 27, 18)) +>y : Symbol(y, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 27, 49)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 27, 18)) + + return cb; +>cb : Symbol(cb, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 27, 21)) + } + + var r8 = foo6(x => x); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed]. T is any +>r8 : Symbol(r8, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 31, 7)) +>foo6 : Symbol(foo6, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 25, 21)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 31, 18)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 31, 18)) + + var r9 = foo6((x: T) => ''); // any => string (+1 overload) +>r9 : Symbol(r9, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 32, 7)) +>foo6 : Symbol(foo6, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 25, 21)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 32, 19)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 32, 22)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 32, 19)) + + var r11 = foo6((x: T, y?: T) => ''); // any => string (+1 overload) +>r11 : Symbol(r11, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 7)) +>foo6 : Symbol(foo6, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 25, 21)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 20)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 23)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 20)) +>y : Symbol(y, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 28)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 20)) + + function foo7(x:T, cb: { (x: T): string; (x: T, y?: T): string }) { +>foo7 : Symbol(foo7, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 43)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 18)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 21)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 18)) +>cb : Symbol(cb, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 25)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 33)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 18)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 49)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 18)) +>y : Symbol(y, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 54)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 18)) + + return cb; +>cb : Symbol(cb, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 25)) + } + + var r12 = foo7(1, (x) => x); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] +>r12 : Symbol(r12, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 39, 7)) +>foo7 : Symbol(foo7, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 43)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 39, 23)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 39, 23)) + + var r13 = foo7(1, (x: T) => ''); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] +>r13 : Symbol(r13, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 40, 7)) +>foo7 : Symbol(foo7, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 43)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 40, 23)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 40, 26)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 40, 23)) + + var a: { (x: T): string; (x: number): T; } +>a : Symbol(a, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 7), Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 7)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 14)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 17)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 14)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 33)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 36)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 33)) + + var r14 = foo7(1, a); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] +>r14 : Symbol(r14, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 42, 7)) +>foo7 : Symbol(foo7, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 43)) +>a : Symbol(a, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 7), Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 7)) +} diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types index ad491206be6..dbdecbec3e4 100644 --- a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types @@ -119,6 +119,7 @@ module GenericParameter { >T : T >x : T >T : T +>'' : string var r11 = foo6((x: T, y?: T) => ''); // any => string (+1 overload) >r11 : { (x: any): string; (x: any, y?: any): string; } @@ -130,6 +131,7 @@ module GenericParameter { >T : T >y : T >T : T +>'' : string function foo7(x:T, cb: { (x: T): string; (x: T, y?: T): string }) { >foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } @@ -152,6 +154,7 @@ module GenericParameter { >r12 : { (x: any): string; (x: any, y?: any): string; } >foo7(1, (x) => x) : { (x: any): string; (x: any, y?: any): string; } >foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } +>1 : number >(x) => x : (x: any) => any >x : any >x : any @@ -160,10 +163,12 @@ module GenericParameter { >r13 : { (x: any): string; (x: any, y?: any): string; } >foo7(1, (x: T) => '') : { (x: any): string; (x: any, y?: any): string; } >foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } +>1 : number >(x: T) => '' : (x: T) => string >T : T >x : T >T : T +>'' : string var a: { (x: T): string; (x: number): T; } >a : { (x: T): string; (x: number): T; } @@ -178,5 +183,6 @@ module GenericParameter { >r14 : { (x: any): string; (x: any, y?: any): string; } >foo7(1, a) : { (x: any): string; (x: any, y?: any): string; } >foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } +>1 : number >a : { (x: T): string; (x: number): T; } } diff --git a/tests/baselines/reference/genericCallbacksAndClassHierarchy.symbols b/tests/baselines/reference/genericCallbacksAndClassHierarchy.symbols new file mode 100644 index 00000000000..be46c49a9ca --- /dev/null +++ b/tests/baselines/reference/genericCallbacksAndClassHierarchy.symbols @@ -0,0 +1,79 @@ +=== tests/cases/compiler/genericCallbacksAndClassHierarchy.ts === +module M { +>M : Symbol(M, Decl(genericCallbacksAndClassHierarchy.ts, 0, 0)) + + export interface I { +>I : Symbol(I, Decl(genericCallbacksAndClassHierarchy.ts, 0, 10)) +>T : Symbol(T, Decl(genericCallbacksAndClassHierarchy.ts, 1, 23)) + + subscribe(callback: (newValue: T) => void ): any; +>subscribe : Symbol(subscribe, Decl(genericCallbacksAndClassHierarchy.ts, 1, 27)) +>callback : Symbol(callback, Decl(genericCallbacksAndClassHierarchy.ts, 2, 18)) +>newValue : Symbol(newValue, Decl(genericCallbacksAndClassHierarchy.ts, 2, 29)) +>T : Symbol(T, Decl(genericCallbacksAndClassHierarchy.ts, 1, 23)) + } + export class C1 { +>C1 : Symbol(C1, Decl(genericCallbacksAndClassHierarchy.ts, 3, 5)) +>T : Symbol(T, Decl(genericCallbacksAndClassHierarchy.ts, 4, 20)) + + public value: I; +>value : Symbol(value, Decl(genericCallbacksAndClassHierarchy.ts, 4, 24)) +>I : Symbol(I, Decl(genericCallbacksAndClassHierarchy.ts, 0, 10)) +>T : Symbol(T, Decl(genericCallbacksAndClassHierarchy.ts, 4, 20)) + } + export class A { +>A : Symbol(A, Decl(genericCallbacksAndClassHierarchy.ts, 6, 5)) +>T : Symbol(T, Decl(genericCallbacksAndClassHierarchy.ts, 7, 19)) + + public dummy: any; +>dummy : Symbol(dummy, Decl(genericCallbacksAndClassHierarchy.ts, 7, 23)) + } + export class B extends C1> { } +>B : Symbol(B, Decl(genericCallbacksAndClassHierarchy.ts, 9, 5)) +>T : Symbol(T, Decl(genericCallbacksAndClassHierarchy.ts, 10, 19)) +>C1 : Symbol(C1, Decl(genericCallbacksAndClassHierarchy.ts, 3, 5)) +>A : Symbol(A, Decl(genericCallbacksAndClassHierarchy.ts, 6, 5)) +>T : Symbol(T, Decl(genericCallbacksAndClassHierarchy.ts, 10, 19)) + + export class D { +>D : Symbol(D, Decl(genericCallbacksAndClassHierarchy.ts, 10, 42)) +>T : Symbol(T, Decl(genericCallbacksAndClassHierarchy.ts, 11, 19)) + + _subscribe(viewModel: B): void { +>_subscribe : Symbol(_subscribe, Decl(genericCallbacksAndClassHierarchy.ts, 11, 23)) +>viewModel : Symbol(viewModel, Decl(genericCallbacksAndClassHierarchy.ts, 12, 19)) +>B : Symbol(B, Decl(genericCallbacksAndClassHierarchy.ts, 9, 5)) +>T : Symbol(T, Decl(genericCallbacksAndClassHierarchy.ts, 11, 19)) + + var f = (newValue: A) => { }; +>f : Symbol(f, Decl(genericCallbacksAndClassHierarchy.ts, 13, 15)) +>newValue : Symbol(newValue, Decl(genericCallbacksAndClassHierarchy.ts, 13, 21)) +>A : Symbol(A, Decl(genericCallbacksAndClassHierarchy.ts, 6, 5)) +>T : Symbol(T, Decl(genericCallbacksAndClassHierarchy.ts, 11, 19)) + + var v: I> = viewModel.value; +>v : Symbol(v, Decl(genericCallbacksAndClassHierarchy.ts, 15, 15)) +>I : Symbol(I, Decl(genericCallbacksAndClassHierarchy.ts, 0, 10)) +>A : Symbol(A, Decl(genericCallbacksAndClassHierarchy.ts, 6, 5)) +>T : Symbol(T, Decl(genericCallbacksAndClassHierarchy.ts, 11, 19)) +>viewModel.value : Symbol(C1.value, Decl(genericCallbacksAndClassHierarchy.ts, 4, 24)) +>viewModel : Symbol(viewModel, Decl(genericCallbacksAndClassHierarchy.ts, 12, 19)) +>value : Symbol(C1.value, Decl(genericCallbacksAndClassHierarchy.ts, 4, 24)) + + // both of these should work + v.subscribe(f); +>v.subscribe : Symbol(I.subscribe, Decl(genericCallbacksAndClassHierarchy.ts, 1, 27)) +>v : Symbol(v, Decl(genericCallbacksAndClassHierarchy.ts, 15, 15)) +>subscribe : Symbol(I.subscribe, Decl(genericCallbacksAndClassHierarchy.ts, 1, 27)) +>f : Symbol(f, Decl(genericCallbacksAndClassHierarchy.ts, 13, 15)) + + v.subscribe((newValue: A) => { }); +>v.subscribe : Symbol(I.subscribe, Decl(genericCallbacksAndClassHierarchy.ts, 1, 27)) +>v : Symbol(v, Decl(genericCallbacksAndClassHierarchy.ts, 15, 15)) +>subscribe : Symbol(I.subscribe, Decl(genericCallbacksAndClassHierarchy.ts, 1, 27)) +>newValue : Symbol(newValue, Decl(genericCallbacksAndClassHierarchy.ts, 19, 25)) +>A : Symbol(A, Decl(genericCallbacksAndClassHierarchy.ts, 6, 5)) +>T : Symbol(T, Decl(genericCallbacksAndClassHierarchy.ts, 11, 19)) + } + } +} diff --git a/tests/baselines/reference/genericClassImplementingGenericInterfaceFromAnotherModule.symbols b/tests/baselines/reference/genericClassImplementingGenericInterfaceFromAnotherModule.symbols new file mode 100644 index 00000000000..ba75ebdc045 --- /dev/null +++ b/tests/baselines/reference/genericClassImplementingGenericInterfaceFromAnotherModule.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/genericClassImplementingGenericInterfaceFromAnotherModule.ts === +module foo { +>foo : Symbol(foo, Decl(genericClassImplementingGenericInterfaceFromAnotherModule.ts, 0, 0)) + + export interface IFoo { } +>IFoo : Symbol(IFoo, Decl(genericClassImplementingGenericInterfaceFromAnotherModule.ts, 0, 12)) +>T : Symbol(T, Decl(genericClassImplementingGenericInterfaceFromAnotherModule.ts, 1, 26)) +} +module bar { +>bar : Symbol(bar, Decl(genericClassImplementingGenericInterfaceFromAnotherModule.ts, 2, 1)) + + export class Foo implements foo.IFoo { } +>Foo : Symbol(Foo, Decl(genericClassImplementingGenericInterfaceFromAnotherModule.ts, 3, 12)) +>T : Symbol(T, Decl(genericClassImplementingGenericInterfaceFromAnotherModule.ts, 4, 21)) +>foo.IFoo : Symbol(foo.IFoo, Decl(genericClassImplementingGenericInterfaceFromAnotherModule.ts, 0, 12)) +>foo : Symbol(foo, Decl(genericClassImplementingGenericInterfaceFromAnotherModule.ts, 0, 0)) +>IFoo : Symbol(foo.IFoo, Decl(genericClassImplementingGenericInterfaceFromAnotherModule.ts, 0, 12)) +>T : Symbol(T, Decl(genericClassImplementingGenericInterfaceFromAnotherModule.ts, 4, 21)) +} + diff --git a/tests/baselines/reference/genericClassImplementingGenericInterfaceFromAnotherModule.types b/tests/baselines/reference/genericClassImplementingGenericInterfaceFromAnotherModule.types index 337485dee2c..b5552cd36a8 100644 --- a/tests/baselines/reference/genericClassImplementingGenericInterfaceFromAnotherModule.types +++ b/tests/baselines/reference/genericClassImplementingGenericInterfaceFromAnotherModule.types @@ -1,6 +1,6 @@ === tests/cases/compiler/genericClassImplementingGenericInterfaceFromAnotherModule.ts === module foo { ->foo : unknown +>foo : any export interface IFoo { } >IFoo : IFoo @@ -12,7 +12,8 @@ module bar { export class Foo implements foo.IFoo { } >Foo : Foo >T : T ->foo : unknown +>foo.IFoo : any +>foo : any >IFoo : foo.IFoo >T : T } diff --git a/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.symbols b/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.symbols new file mode 100644 index 00000000000..d2e173b8078 --- /dev/null +++ b/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/genericClassInheritsConstructorFromNonGenericClass.ts === +class A extends B { } +>A : Symbol(A, Decl(genericClassInheritsConstructorFromNonGenericClass.ts, 0, 0)) +>B : Symbol(B, Decl(genericClassInheritsConstructorFromNonGenericClass.ts, 0, 29)) + +class B extends C { } +>B : Symbol(B, Decl(genericClassInheritsConstructorFromNonGenericClass.ts, 0, 29)) +>U : Symbol(U, Decl(genericClassInheritsConstructorFromNonGenericClass.ts, 1, 8)) +>C : Symbol(C, Decl(genericClassInheritsConstructorFromNonGenericClass.ts, 1, 24)) + +class C { +>C : Symbol(C, Decl(genericClassInheritsConstructorFromNonGenericClass.ts, 1, 24)) + + constructor(p: string) { } +>p : Symbol(p, Decl(genericClassInheritsConstructorFromNonGenericClass.ts, 3, 16)) +} diff --git a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.symbols b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.symbols new file mode 100644 index 00000000000..291f439c9a9 --- /dev/null +++ b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.symbols @@ -0,0 +1,256 @@ +=== tests/cases/compiler/genericClassPropertyInheritanceSpecialization.ts === +interface KnockoutObservableBase { +>KnockoutObservableBase : Symbol(KnockoutObservableBase, Decl(genericClassPropertyInheritanceSpecialization.ts, 0, 0)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 0, 33)) + + peek(): T; +>peek : Symbol(peek, Decl(genericClassPropertyInheritanceSpecialization.ts, 0, 37)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 0, 33)) + + (): T; +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 0, 33)) + + (value: T): void; +>value : Symbol(value, Decl(genericClassPropertyInheritanceSpecialization.ts, 3, 5)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 0, 33)) +} + +interface KnockoutObservable extends KnockoutObservableBase { +>KnockoutObservable : Symbol(KnockoutObservable, Decl(genericClassPropertyInheritanceSpecialization.ts, 4, 1)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 6, 29)) +>KnockoutObservableBase : Symbol(KnockoutObservableBase, Decl(genericClassPropertyInheritanceSpecialization.ts, 0, 0)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 6, 29)) + + equalityComparer(a: T, b: T): boolean; +>equalityComparer : Symbol(equalityComparer, Decl(genericClassPropertyInheritanceSpecialization.ts, 6, 67)) +>a : Symbol(a, Decl(genericClassPropertyInheritanceSpecialization.ts, 7, 21)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 6, 29)) +>b : Symbol(b, Decl(genericClassPropertyInheritanceSpecialization.ts, 7, 26)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 6, 29)) + + valueHasMutated(): void; +>valueHasMutated : Symbol(valueHasMutated, Decl(genericClassPropertyInheritanceSpecialization.ts, 7, 42)) + + valueWillMutate(): void; +>valueWillMutate : Symbol(valueWillMutate, Decl(genericClassPropertyInheritanceSpecialization.ts, 8, 28)) +} + +interface KnockoutObservableArray extends KnockoutObservable { +>KnockoutObservableArray : Symbol(KnockoutObservableArray, Decl(genericClassPropertyInheritanceSpecialization.ts, 10, 1)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) +>KnockoutObservable : Symbol(KnockoutObservable, Decl(genericClassPropertyInheritanceSpecialization.ts, 4, 1)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) + + indexOf(searchElement: T, fromIndex?: number): number; +>indexOf : Symbol(indexOf, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 70)) +>searchElement : Symbol(searchElement, Decl(genericClassPropertyInheritanceSpecialization.ts, 13, 12)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) +>fromIndex : Symbol(fromIndex, Decl(genericClassPropertyInheritanceSpecialization.ts, 13, 29)) + + slice(start: number, end?: number): T[]; +>slice : Symbol(slice, Decl(genericClassPropertyInheritanceSpecialization.ts, 13, 58)) +>start : Symbol(start, Decl(genericClassPropertyInheritanceSpecialization.ts, 14, 10)) +>end : Symbol(end, Decl(genericClassPropertyInheritanceSpecialization.ts, 14, 24)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) + + splice(start: number, deleteCount?: number, ...items: T[]): T[]; +>splice : Symbol(splice, Decl(genericClassPropertyInheritanceSpecialization.ts, 14, 44)) +>start : Symbol(start, Decl(genericClassPropertyInheritanceSpecialization.ts, 15, 11)) +>deleteCount : Symbol(deleteCount, Decl(genericClassPropertyInheritanceSpecialization.ts, 15, 25)) +>items : Symbol(items, Decl(genericClassPropertyInheritanceSpecialization.ts, 15, 47)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) + + pop(): T; +>pop : Symbol(pop, Decl(genericClassPropertyInheritanceSpecialization.ts, 15, 68)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) + + push(...items: T[]): void; +>push : Symbol(push, Decl(genericClassPropertyInheritanceSpecialization.ts, 16, 13)) +>items : Symbol(items, Decl(genericClassPropertyInheritanceSpecialization.ts, 17, 9)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) + + shift(): T; +>shift : Symbol(shift, Decl(genericClassPropertyInheritanceSpecialization.ts, 17, 30)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) + + unshift(...items: T[]): number; +>unshift : Symbol(unshift, Decl(genericClassPropertyInheritanceSpecialization.ts, 18, 15)) +>items : Symbol(items, Decl(genericClassPropertyInheritanceSpecialization.ts, 19, 12)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) + + reverse(): T[]; +>reverse : Symbol(reverse, Decl(genericClassPropertyInheritanceSpecialization.ts, 19, 35)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) + + sort(compareFunction?: (a: T, b: T) => number): void; +>sort : Symbol(sort, Decl(genericClassPropertyInheritanceSpecialization.ts, 20, 19)) +>compareFunction : Symbol(compareFunction, Decl(genericClassPropertyInheritanceSpecialization.ts, 21, 9)) +>a : Symbol(a, Decl(genericClassPropertyInheritanceSpecialization.ts, 21, 28)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) +>b : Symbol(b, Decl(genericClassPropertyInheritanceSpecialization.ts, 21, 33)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) + + replace(oldItem: T, newItem: T): void; +>replace : Symbol(replace, Decl(genericClassPropertyInheritanceSpecialization.ts, 21, 57)) +>oldItem : Symbol(oldItem, Decl(genericClassPropertyInheritanceSpecialization.ts, 22, 12)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) +>newItem : Symbol(newItem, Decl(genericClassPropertyInheritanceSpecialization.ts, 22, 23)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) + + remove(item: T): T[]; +>remove : Symbol(remove, Decl(genericClassPropertyInheritanceSpecialization.ts, 22, 42)) +>item : Symbol(item, Decl(genericClassPropertyInheritanceSpecialization.ts, 23, 11)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) + + removeAll(items?: T[]): T[]; +>removeAll : Symbol(removeAll, Decl(genericClassPropertyInheritanceSpecialization.ts, 23, 25)) +>items : Symbol(items, Decl(genericClassPropertyInheritanceSpecialization.ts, 24, 14)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) + + destroy(item: T): void; +>destroy : Symbol(destroy, Decl(genericClassPropertyInheritanceSpecialization.ts, 24, 32)) +>item : Symbol(item, Decl(genericClassPropertyInheritanceSpecialization.ts, 25, 12)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) + + destroyAll(items?: T[]): void; +>destroyAll : Symbol(destroyAll, Decl(genericClassPropertyInheritanceSpecialization.ts, 25, 27)) +>items : Symbol(items, Decl(genericClassPropertyInheritanceSpecialization.ts, 26, 15)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) +} + +interface KnockoutObservableArrayStatic { +>KnockoutObservableArrayStatic : Symbol(KnockoutObservableArrayStatic, Decl(genericClassPropertyInheritanceSpecialization.ts, 27, 1)) + + fn: KnockoutObservableArray; +>fn : Symbol(fn, Decl(genericClassPropertyInheritanceSpecialization.ts, 29, 41)) +>KnockoutObservableArray : Symbol(KnockoutObservableArray, Decl(genericClassPropertyInheritanceSpecialization.ts, 10, 1)) + + (value?: T[]): KnockoutObservableArray; +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 32, 5)) +>value : Symbol(value, Decl(genericClassPropertyInheritanceSpecialization.ts, 32, 8)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 32, 5)) +>KnockoutObservableArray : Symbol(KnockoutObservableArray, Decl(genericClassPropertyInheritanceSpecialization.ts, 10, 1)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 32, 5)) +} + +declare module ko { +>ko : Symbol(ko, Decl(genericClassPropertyInheritanceSpecialization.ts, 33, 1)) + + export var observableArray: KnockoutObservableArrayStatic; +>observableArray : Symbol(observableArray, Decl(genericClassPropertyInheritanceSpecialization.ts, 36, 14)) +>KnockoutObservableArrayStatic : Symbol(KnockoutObservableArrayStatic, Decl(genericClassPropertyInheritanceSpecialization.ts, 27, 1)) +} + +module Portal.Controls.Validators { +>Portal : Symbol(Portal, Decl(genericClassPropertyInheritanceSpecialization.ts, 37, 1)) +>Controls : Symbol(Controls, Decl(genericClassPropertyInheritanceSpecialization.ts, 39, 14)) +>Validators : Symbol(Validators, Decl(genericClassPropertyInheritanceSpecialization.ts, 39, 23)) + + export class Validator { +>Validator : Symbol(Validator, Decl(genericClassPropertyInheritanceSpecialization.ts, 39, 35)) +>TValue : Symbol(TValue, Decl(genericClassPropertyInheritanceSpecialization.ts, 41, 27)) + + private _subscription; +>_subscription : Symbol(_subscription, Decl(genericClassPropertyInheritanceSpecialization.ts, 41, 36)) + + public message: KnockoutObservable; +>message : Symbol(message, Decl(genericClassPropertyInheritanceSpecialization.ts, 42, 30)) +>KnockoutObservable : Symbol(KnockoutObservable, Decl(genericClassPropertyInheritanceSpecialization.ts, 4, 1)) + + public validationState: KnockoutObservable; +>validationState : Symbol(validationState, Decl(genericClassPropertyInheritanceSpecialization.ts, 43, 51)) +>KnockoutObservable : Symbol(KnockoutObservable, Decl(genericClassPropertyInheritanceSpecialization.ts, 4, 1)) + + public validate: KnockoutObservable; +>validate : Symbol(validate, Decl(genericClassPropertyInheritanceSpecialization.ts, 44, 59)) +>KnockoutObservable : Symbol(KnockoutObservable, Decl(genericClassPropertyInheritanceSpecialization.ts, 4, 1)) +>TValue : Symbol(TValue, Decl(genericClassPropertyInheritanceSpecialization.ts, 41, 27)) + + constructor(message?: string) { } +>message : Symbol(message, Decl(genericClassPropertyInheritanceSpecialization.ts, 46, 20)) + + public destroy(): void { } +>destroy : Symbol(destroy, Decl(genericClassPropertyInheritanceSpecialization.ts, 46, 41)) + + public _validate(value: TValue): number {return 0 } +>_validate : Symbol(_validate, Decl(genericClassPropertyInheritanceSpecialization.ts, 47, 34)) +>value : Symbol(value, Decl(genericClassPropertyInheritanceSpecialization.ts, 48, 25)) +>TValue : Symbol(TValue, Decl(genericClassPropertyInheritanceSpecialization.ts, 41, 27)) + } +} + +module PortalFx.ViewModels.Controls.Validators { +>PortalFx : Symbol(PortalFx, Decl(genericClassPropertyInheritanceSpecialization.ts, 50, 1)) +>ViewModels : Symbol(ViewModels, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 16)) +>Controls : Symbol(Controls, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 27)) +>Validators : Symbol(Validators, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 36)) + + export class Validator extends Portal.Controls.Validators.Validator { +>Validator : Symbol(Validator, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 48)) +>TValue : Symbol(TValue, Decl(genericClassPropertyInheritanceSpecialization.ts, 54, 27)) +>Portal.Controls.Validators.Validator : Symbol(Portal.Controls.Validators.Validator, Decl(genericClassPropertyInheritanceSpecialization.ts, 39, 35)) +>Portal.Controls.Validators : Symbol(Portal.Controls.Validators, Decl(genericClassPropertyInheritanceSpecialization.ts, 39, 23)) +>Portal.Controls : Symbol(Portal.Controls, Decl(genericClassPropertyInheritanceSpecialization.ts, 39, 14)) +>Portal : Symbol(Portal, Decl(genericClassPropertyInheritanceSpecialization.ts, 37, 1)) +>Controls : Symbol(Portal.Controls, Decl(genericClassPropertyInheritanceSpecialization.ts, 39, 14)) +>Validators : Symbol(Portal.Controls.Validators, Decl(genericClassPropertyInheritanceSpecialization.ts, 39, 23)) +>Validator : Symbol(Portal.Controls.Validators.Validator, Decl(genericClassPropertyInheritanceSpecialization.ts, 39, 35)) +>TValue : Symbol(TValue, Decl(genericClassPropertyInheritanceSpecialization.ts, 54, 27)) + + constructor(message?: string) { +>message : Symbol(message, Decl(genericClassPropertyInheritanceSpecialization.ts, 56, 20)) + + super(message); +>super : Symbol(Portal.Controls.Validators.Validator, Decl(genericClassPropertyInheritanceSpecialization.ts, 39, 35)) +>message : Symbol(message, Decl(genericClassPropertyInheritanceSpecialization.ts, 56, 20)) + } + } + +} + +interface Contract { +>Contract : Symbol(Contract, Decl(genericClassPropertyInheritanceSpecialization.ts, 61, 1)) +>TValue : Symbol(TValue, Decl(genericClassPropertyInheritanceSpecialization.ts, 63, 19)) + + validators: KnockoutObservableArray>; +>validators : Symbol(validators, Decl(genericClassPropertyInheritanceSpecialization.ts, 63, 28)) +>KnockoutObservableArray : Symbol(KnockoutObservableArray, Decl(genericClassPropertyInheritanceSpecialization.ts, 10, 1)) +>PortalFx : Symbol(PortalFx, Decl(genericClassPropertyInheritanceSpecialization.ts, 50, 1)) +>ViewModels : Symbol(PortalFx.ViewModels, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 16)) +>Controls : Symbol(PortalFx.ViewModels.Controls, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 27)) +>Validators : Symbol(PortalFx.ViewModels.Controls.Validators, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 36)) +>Validator : Symbol(PortalFx.ViewModels.Controls.Validators.Validator, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 48)) +>TValue : Symbol(TValue, Decl(genericClassPropertyInheritanceSpecialization.ts, 63, 19)) +} + + +class ViewModel implements Contract { +>ViewModel : Symbol(ViewModel, Decl(genericClassPropertyInheritanceSpecialization.ts, 66, 1)) +>TValue : Symbol(TValue, Decl(genericClassPropertyInheritanceSpecialization.ts, 69, 16)) +>Contract : Symbol(Contract, Decl(genericClassPropertyInheritanceSpecialization.ts, 61, 1)) +>TValue : Symbol(TValue, Decl(genericClassPropertyInheritanceSpecialization.ts, 69, 16)) + + public validators: KnockoutObservableArray> = ko.observableArray>(); +>validators : Symbol(validators, Decl(genericClassPropertyInheritanceSpecialization.ts, 69, 53)) +>KnockoutObservableArray : Symbol(KnockoutObservableArray, Decl(genericClassPropertyInheritanceSpecialization.ts, 10, 1)) +>PortalFx : Symbol(PortalFx, Decl(genericClassPropertyInheritanceSpecialization.ts, 50, 1)) +>ViewModels : Symbol(PortalFx.ViewModels, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 16)) +>Controls : Symbol(PortalFx.ViewModels.Controls, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 27)) +>Validators : Symbol(PortalFx.ViewModels.Controls.Validators, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 36)) +>Validator : Symbol(PortalFx.ViewModels.Controls.Validators.Validator, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 48)) +>TValue : Symbol(TValue, Decl(genericClassPropertyInheritanceSpecialization.ts, 69, 16)) +>ko.observableArray : Symbol(ko.observableArray, Decl(genericClassPropertyInheritanceSpecialization.ts, 36, 14)) +>ko : Symbol(ko, Decl(genericClassPropertyInheritanceSpecialization.ts, 33, 1)) +>observableArray : Symbol(ko.observableArray, Decl(genericClassPropertyInheritanceSpecialization.ts, 36, 14)) +>PortalFx : Symbol(PortalFx, Decl(genericClassPropertyInheritanceSpecialization.ts, 50, 1)) +>ViewModels : Symbol(PortalFx.ViewModels, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 16)) +>Controls : Symbol(PortalFx.ViewModels.Controls, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 27)) +>Validators : Symbol(PortalFx.ViewModels.Controls.Validators, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 36)) +>Validator : Symbol(PortalFx.ViewModels.Controls.Validators.Validator, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 48)) +>TValue : Symbol(TValue, Decl(genericClassPropertyInheritanceSpecialization.ts, 69, 16)) +} + + diff --git a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types index 1867d390703..6ba27a66399 100644 --- a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types +++ b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types @@ -179,6 +179,7 @@ module Portal.Controls.Validators { >_validate : (value: TValue) => number >value : TValue >TValue : TValue +>0 : number } } @@ -191,6 +192,9 @@ module PortalFx.ViewModels.Controls.Validators { export class Validator extends Portal.Controls.Validators.Validator { >Validator : Validator >TValue : TValue +>Portal.Controls.Validators.Validator : any +>Portal.Controls.Validators : typeof Portal.Controls.Validators +>Portal.Controls : typeof Portal.Controls >Portal : typeof Portal >Controls : typeof Portal.Controls >Validators : typeof Portal.Controls.Validators @@ -216,10 +220,10 @@ interface Contract { validators: KnockoutObservableArray>; >validators : KnockoutObservableArray> >KnockoutObservableArray : KnockoutObservableArray ->PortalFx : unknown ->ViewModels : unknown ->Controls : unknown ->Validators : unknown +>PortalFx : any +>ViewModels : any +>Controls : any +>Validators : any >Validator : PortalFx.ViewModels.Controls.Validators.Validator >TValue : TValue } @@ -234,20 +238,20 @@ class ViewModel implements Contract { public validators: KnockoutObservableArray> = ko.observableArray>(); >validators : KnockoutObservableArray> >KnockoutObservableArray : KnockoutObservableArray ->PortalFx : unknown ->ViewModels : unknown ->Controls : unknown ->Validators : unknown +>PortalFx : any +>ViewModels : any +>Controls : any +>Validators : any >Validator : PortalFx.ViewModels.Controls.Validators.Validator >TValue : TValue >ko.observableArray>() : KnockoutObservableArray> >ko.observableArray : KnockoutObservableArrayStatic >ko : typeof ko >observableArray : KnockoutObservableArrayStatic ->PortalFx : unknown ->ViewModels : unknown ->Controls : unknown ->Validators : unknown +>PortalFx : any +>ViewModels : any +>Controls : any +>Validators : any >Validator : PortalFx.ViewModels.Controls.Validators.Validator >TValue : TValue } diff --git a/tests/baselines/reference/genericClassStaticMethod.symbols b/tests/baselines/reference/genericClassStaticMethod.symbols new file mode 100644 index 00000000000..b4ebd9d2ce9 --- /dev/null +++ b/tests/baselines/reference/genericClassStaticMethod.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/genericClassStaticMethod.ts === +class Foo { +>Foo : Symbol(Foo, Decl(genericClassStaticMethod.ts, 0, 0)) +>T : Symbol(T, Decl(genericClassStaticMethod.ts, 0, 10)) + + static getFoo() { +>getFoo : Symbol(Foo.getFoo, Decl(genericClassStaticMethod.ts, 0, 14)) + } +} + +class Bar extends Foo { +>Bar : Symbol(Bar, Decl(genericClassStaticMethod.ts, 3, 1)) +>T : Symbol(T, Decl(genericClassStaticMethod.ts, 5, 10)) +>Foo : Symbol(Foo, Decl(genericClassStaticMethod.ts, 0, 0)) +>T : Symbol(T, Decl(genericClassStaticMethod.ts, 5, 10)) + + static getFoo() { +>getFoo : Symbol(Bar.getFoo, Decl(genericClassStaticMethod.ts, 5, 29)) + } +} + diff --git a/tests/baselines/reference/genericClassWithObjectTypeArgsAndConstraints.symbols b/tests/baselines/reference/genericClassWithObjectTypeArgsAndConstraints.symbols new file mode 100644 index 00000000000..a178f5b97e8 --- /dev/null +++ b/tests/baselines/reference/genericClassWithObjectTypeArgsAndConstraints.symbols @@ -0,0 +1,228 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithObjectTypeArgsAndConstraints.ts === +// Generic call with constraints infering type parameter from object member properties +// No errors expected + +class C { +>C : Symbol(C, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 0, 0)) + + x: string; +>x : Symbol(x, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 3, 9)) +} + +class D { +>D : Symbol(D, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 5, 1)) + + x: string; +>x : Symbol(x, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 7, 9)) + + y: string; +>y : Symbol(y, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 8, 14)) +} + +class X { +>X : Symbol(X, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 12, 8)) + + x: T; +>x : Symbol(x, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 12, 12)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 12, 8)) +} + +module Class { +>Class : Symbol(Class, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 14, 1)) + + class G { +>G : Symbol(G, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 16, 14)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 17, 12)) +>x : Symbol(x, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 17, 23)) + + foo(t: X, t2: X) { +>foo : Symbol(foo, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 17, 38)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 18, 12)) +>x : Symbol(x, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 18, 23)) +>t : Symbol(t, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 18, 37)) +>X : Symbol(X, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 18, 12)) +>t2 : Symbol(t2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 18, 45)) +>X : Symbol(X, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 18, 12)) + + var x: T; +>x : Symbol(x, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 19, 15)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 18, 12)) + + return x; +>x : Symbol(x, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 19, 15)) + } + } + + var c1 = new X(); +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 24, 7)) +>X : Symbol(X, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>C : Symbol(C, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 0, 0)) + + var d1 = new X(); +>d1 : Symbol(d1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 25, 7)) +>X : Symbol(X, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>D : Symbol(D, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 5, 1)) + + var g: G<{ x: string; y: string }>; +>g : Symbol(g, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 26, 7)) +>G : Symbol(G, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 16, 14)) +>x : Symbol(x, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 26, 14)) +>y : Symbol(y, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 26, 25)) + + var r = g.foo(c1, d1); +>r : Symbol(r, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 27, 7), Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 37, 7)) +>g.foo : Symbol(G.foo, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 17, 38)) +>g : Symbol(g, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 26, 7)) +>foo : Symbol(G.foo, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 17, 38)) +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 24, 7)) +>d1 : Symbol(d1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 25, 7)) + + var r2 = g.foo(c1, c1); +>r2 : Symbol(r2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 28, 7), Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 38, 7)) +>g.foo : Symbol(G.foo, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 17, 38)) +>g : Symbol(g, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 26, 7)) +>foo : Symbol(G.foo, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 17, 38)) +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 24, 7)) +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 24, 7)) + + class G2 { +>G2 : Symbol(G2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 28, 27)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 30, 13)) +>C : Symbol(C, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 0, 0)) + + foo2(t: X, t2: X) { +>foo2 : Symbol(foo2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 30, 27)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 31, 13)) +>C : Symbol(C, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 0, 0)) +>t : Symbol(t, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 31, 26)) +>X : Symbol(X, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 31, 13)) +>t2 : Symbol(t2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 31, 34)) +>X : Symbol(X, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 31, 13)) + + var x: T; +>x : Symbol(x, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 32, 15)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 31, 13)) + + return x; +>x : Symbol(x, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 32, 15)) + } + } + var g2: G2; +>g2 : Symbol(g2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 36, 7)) +>G2 : Symbol(G2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 28, 27)) +>D : Symbol(D, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 5, 1)) + + var r = g2.foo2(c1, d1); +>r : Symbol(r, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 27, 7), Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 37, 7)) +>g2.foo2 : Symbol(G2.foo2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 30, 27)) +>g2 : Symbol(g2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 36, 7)) +>foo2 : Symbol(G2.foo2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 30, 27)) +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 24, 7)) +>d1 : Symbol(d1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 25, 7)) + + var r2 = g2.foo2(c1, c1); +>r2 : Symbol(r2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 28, 7), Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 38, 7)) +>g2.foo2 : Symbol(G2.foo2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 30, 27)) +>g2 : Symbol(g2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 36, 7)) +>foo2 : Symbol(G2.foo2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 30, 27)) +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 24, 7)) +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 24, 7)) +} + +module Interface { +>Interface : Symbol(Interface, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 39, 1)) + + interface G { +>G : Symbol(G, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 41, 18)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 42, 16)) +>x : Symbol(x, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 42, 27)) + + foo(t: X, t2: X): T; +>foo : Symbol(foo, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 42, 42)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 43, 12)) +>x : Symbol(x, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 43, 23)) +>t : Symbol(t, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 43, 37)) +>X : Symbol(X, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 43, 12)) +>t2 : Symbol(t2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 43, 45)) +>X : Symbol(X, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 43, 12)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 43, 12)) + } + + var c1 = new X(); +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 46, 7)) +>X : Symbol(X, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>C : Symbol(C, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 0, 0)) + + var d1 = new X(); +>d1 : Symbol(d1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 47, 7)) +>X : Symbol(X, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>D : Symbol(D, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 5, 1)) + + var g: G<{ x: string; y: string }>; +>g : Symbol(g, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 48, 7)) +>G : Symbol(G, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 41, 18)) +>x : Symbol(x, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 48, 14)) +>y : Symbol(y, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 48, 25)) + + var r = g.foo(c1, d1); +>r : Symbol(r, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 49, 7), Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 57, 7)) +>g.foo : Symbol(G.foo, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 42, 42)) +>g : Symbol(g, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 48, 7)) +>foo : Symbol(G.foo, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 42, 42)) +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 46, 7)) +>d1 : Symbol(d1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 47, 7)) + + var r2 = g.foo(c1, c1); +>r2 : Symbol(r2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 50, 7), Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 58, 7)) +>g.foo : Symbol(G.foo, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 42, 42)) +>g : Symbol(g, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 48, 7)) +>foo : Symbol(G.foo, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 42, 42)) +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 46, 7)) +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 46, 7)) + + interface G2 { +>G2 : Symbol(G2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 50, 27)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 52, 17)) +>C : Symbol(C, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 0, 0)) + + foo2(t: X, t2: X): T; +>foo2 : Symbol(foo2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 52, 31)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 53, 13)) +>C : Symbol(C, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 0, 0)) +>t : Symbol(t, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 53, 26)) +>X : Symbol(X, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 53, 13)) +>t2 : Symbol(t2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 53, 34)) +>X : Symbol(X, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 53, 13)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 53, 13)) + } + + var g2: G2; +>g2 : Symbol(g2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 56, 7)) +>G2 : Symbol(G2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 50, 27)) +>D : Symbol(D, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 5, 1)) + + var r = g2.foo2(c1, d1); +>r : Symbol(r, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 49, 7), Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 57, 7)) +>g2.foo2 : Symbol(G2.foo2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 52, 31)) +>g2 : Symbol(g2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 56, 7)) +>foo2 : Symbol(G2.foo2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 52, 31)) +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 46, 7)) +>d1 : Symbol(d1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 47, 7)) + + var r2 = g2.foo2(c1, c1); +>r2 : Symbol(r2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 50, 7), Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 58, 7)) +>g2.foo2 : Symbol(G2.foo2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 52, 31)) +>g2 : Symbol(g2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 56, 7)) +>foo2 : Symbol(G2.foo2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 52, 31)) +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 46, 7)) +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 46, 7)) +} diff --git a/tests/baselines/reference/genericClassWithStaticFactory.symbols b/tests/baselines/reference/genericClassWithStaticFactory.symbols new file mode 100644 index 00000000000..37ee9c638e9 --- /dev/null +++ b/tests/baselines/reference/genericClassWithStaticFactory.symbols @@ -0,0 +1,548 @@ +=== tests/cases/compiler/genericClassWithStaticFactory.ts === +module Editor { +>Editor : Symbol(Editor, Decl(genericClassWithStaticFactory.ts, 0, 0)) + + export class List { +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + public next: List; +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + public prev: List; +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + private listFactory: ListFactory; +>listFactory : Symbol(listFactory, Decl(genericClassWithStaticFactory.ts, 4, 29)) +>ListFactory : Symbol(ListFactory, Decl(genericClassWithStaticFactory.ts, 106, 5)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + constructor(public isHead: boolean, public data: T) { +>isHead : Symbol(isHead, Decl(genericClassWithStaticFactory.ts, 7, 20)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 7, 43)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + this.listFactory = new ListFactory(); +>this.listFactory : Symbol(listFactory, Decl(genericClassWithStaticFactory.ts, 4, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>listFactory : Symbol(listFactory, Decl(genericClassWithStaticFactory.ts, 4, 29)) +>ListFactory : Symbol(ListFactory, Decl(genericClassWithStaticFactory.ts, 106, 5)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + } + + public add(data: T): List { +>add : Symbol(add, Decl(genericClassWithStaticFactory.ts, 10, 9)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 12, 19)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + var entry = this.listFactory.MakeEntry(data); +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 13, 15)) +>this.listFactory.MakeEntry : Symbol(ListFactory.MakeEntry, Decl(genericClassWithStaticFactory.ts, 115, 9)) +>this.listFactory : Symbol(listFactory, Decl(genericClassWithStaticFactory.ts, 4, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>listFactory : Symbol(listFactory, Decl(genericClassWithStaticFactory.ts, 4, 29)) +>MakeEntry : Symbol(ListFactory.MakeEntry, Decl(genericClassWithStaticFactory.ts, 115, 9)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 12, 19)) + + this.prev.next = entry; +>this.prev.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 13, 15)) + + entry.next = this; +>entry.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 13, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) + + entry.prev = this.prev; +>entry.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 13, 15)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) + + this.prev = entry; +>this.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 13, 15)) + + return entry; +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 13, 15)) + } + + public count(): number { +>count : Symbol(count, Decl(genericClassWithStaticFactory.ts, 20, 9)) + + var entry: List; +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 23, 15)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + var i: number; +>i : Symbol(i, Decl(genericClassWithStaticFactory.ts, 24, 15)) + + entry = this.next; +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 23, 15)) +>this.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) + + for (i = 0; !(entry.isHead); i++) { +>i : Symbol(i, Decl(genericClassWithStaticFactory.ts, 24, 15)) +>entry.isHead : Symbol(isHead, Decl(genericClassWithStaticFactory.ts, 7, 20)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 23, 15)) +>isHead : Symbol(isHead, Decl(genericClassWithStaticFactory.ts, 7, 20)) +>i : Symbol(i, Decl(genericClassWithStaticFactory.ts, 24, 15)) + + entry = entry.next; +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 23, 15)) +>entry.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 23, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) + } + + return (i); +>i : Symbol(i, Decl(genericClassWithStaticFactory.ts, 24, 15)) + } + + public isEmpty(): boolean { +>isEmpty : Symbol(isEmpty, Decl(genericClassWithStaticFactory.ts, 32, 9)) + + return (this.next == this); +>this.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) + } + + public first(): T { +>first : Symbol(first, Decl(genericClassWithStaticFactory.ts, 36, 9)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + if (this.isEmpty()) +>this.isEmpty : Symbol(isEmpty, Decl(genericClassWithStaticFactory.ts, 32, 9)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>isEmpty : Symbol(isEmpty, Decl(genericClassWithStaticFactory.ts, 32, 9)) + { + return this.next.data; +>this.next.data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 7, 43)) +>this.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 7, 43)) + } + else { + return null; + } + } + + public pushEntry(entry: List): void { +>pushEntry : Symbol(pushEntry, Decl(genericClassWithStaticFactory.ts, 46, 9)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 48, 25)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + entry.isHead = false; +>entry.isHead : Symbol(isHead, Decl(genericClassWithStaticFactory.ts, 7, 20)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 48, 25)) +>isHead : Symbol(isHead, Decl(genericClassWithStaticFactory.ts, 7, 20)) + + entry.next = this.next; +>entry.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 48, 25)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) + + entry.prev = this; +>entry.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 48, 25)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) + + this.next = entry; +>this.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 48, 25)) + + entry.next.prev = entry; // entry.next.prev does not show intellisense, but entry.prev.prev does +>entry.next.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 48, 25)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 48, 25)) + } + + public push(data: T): void { +>push : Symbol(push, Decl(genericClassWithStaticFactory.ts, 54, 9)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 56, 20)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + var entry = this.listFactory.MakeEntry(data); +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 57, 15)) +>this.listFactory.MakeEntry : Symbol(ListFactory.MakeEntry, Decl(genericClassWithStaticFactory.ts, 115, 9)) +>this.listFactory : Symbol(listFactory, Decl(genericClassWithStaticFactory.ts, 4, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>listFactory : Symbol(listFactory, Decl(genericClassWithStaticFactory.ts, 4, 29)) +>MakeEntry : Symbol(ListFactory.MakeEntry, Decl(genericClassWithStaticFactory.ts, 115, 9)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 56, 20)) + + entry.data = data; +>entry.data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 7, 43)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 57, 15)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 7, 43)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 56, 20)) + + entry.isHead = false; +>entry.isHead : Symbol(isHead, Decl(genericClassWithStaticFactory.ts, 7, 20)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 57, 15)) +>isHead : Symbol(isHead, Decl(genericClassWithStaticFactory.ts, 7, 20)) + + entry.next = this.next; +>entry.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 57, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) + + entry.prev = this; +>entry.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 57, 15)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) + + this.next = entry; +>this.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 57, 15)) + + entry.next.prev = entry; // entry.next.prev does not show intellisense, but entry.prev.prev does +>entry.next.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 57, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 57, 15)) + } + + public popEntry(head: List): List { +>popEntry : Symbol(popEntry, Decl(genericClassWithStaticFactory.ts, 64, 9)) +>head : Symbol(head, Decl(genericClassWithStaticFactory.ts, 66, 24)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + if (this.next.isHead) { +>this.next.isHead : Symbol(isHead, Decl(genericClassWithStaticFactory.ts, 7, 20)) +>this.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>isHead : Symbol(isHead, Decl(genericClassWithStaticFactory.ts, 7, 20)) + + return null; + } + else { + return this.listFactory.RemoveEntry(this.next); +>this.listFactory.RemoveEntry : Symbol(ListFactory.RemoveEntry, Decl(genericClassWithStaticFactory.ts, 122, 9)) +>this.listFactory : Symbol(listFactory, Decl(genericClassWithStaticFactory.ts, 4, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>listFactory : Symbol(listFactory, Decl(genericClassWithStaticFactory.ts, 4, 29)) +>RemoveEntry : Symbol(ListFactory.RemoveEntry, Decl(genericClassWithStaticFactory.ts, 122, 9)) +>this.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) + } + } + + public insertEntry(entry: List): List { +>insertEntry : Symbol(insertEntry, Decl(genericClassWithStaticFactory.ts, 73, 9)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 75, 27)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + entry.isHead = false; +>entry.isHead : Symbol(isHead, Decl(genericClassWithStaticFactory.ts, 7, 20)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 75, 27)) +>isHead : Symbol(isHead, Decl(genericClassWithStaticFactory.ts, 7, 20)) + + this.prev.next = entry; +>this.prev.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 75, 27)) + + entry.next = this; +>entry.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 75, 27)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) + + entry.prev = this.prev; +>entry.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 75, 27)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) + + this.prev = entry; +>this.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 75, 27)) + + return entry; +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 75, 27)) + } + + public insertAfter(data: T): List { +>insertAfter : Symbol(insertAfter, Decl(genericClassWithStaticFactory.ts, 82, 9)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 84, 27)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + var entry: List = this.listFactory.MakeEntry(data); +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 85, 15)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) +>this.listFactory.MakeEntry : Symbol(ListFactory.MakeEntry, Decl(genericClassWithStaticFactory.ts, 115, 9)) +>this.listFactory : Symbol(listFactory, Decl(genericClassWithStaticFactory.ts, 4, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>listFactory : Symbol(listFactory, Decl(genericClassWithStaticFactory.ts, 4, 29)) +>MakeEntry : Symbol(ListFactory.MakeEntry, Decl(genericClassWithStaticFactory.ts, 115, 9)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 84, 27)) + + entry.next = this.next; +>entry.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 85, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) + + entry.prev = this; +>entry.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 85, 15)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) + + this.next = entry; +>this.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 85, 15)) + + entry.next.prev = entry;// entry.next.prev does not show intellisense, but entry.prev.prev does +>entry.next.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 85, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 85, 15)) + + return entry; +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 85, 15)) + } + + public insertEntryBefore(entry: List): List { +>insertEntryBefore : Symbol(insertEntryBefore, Decl(genericClassWithStaticFactory.ts, 91, 9)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 93, 33)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + this.prev.next = entry; +>this.prev.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 93, 33)) + + entry.next = this; +>entry.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 93, 33)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) + + entry.prev = this.prev; +>entry.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 93, 33)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) + + this.prev = entry; +>this.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 93, 33)) + + return entry; +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 93, 33)) + } + + public insertBefore(data: T): List { +>insertBefore : Symbol(insertBefore, Decl(genericClassWithStaticFactory.ts, 100, 9)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 102, 28)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + var entry = this.listFactory.MakeEntry(data); +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 103, 15)) +>this.listFactory.MakeEntry : Symbol(ListFactory.MakeEntry, Decl(genericClassWithStaticFactory.ts, 115, 9)) +>this.listFactory : Symbol(listFactory, Decl(genericClassWithStaticFactory.ts, 4, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>listFactory : Symbol(listFactory, Decl(genericClassWithStaticFactory.ts, 4, 29)) +>MakeEntry : Symbol(ListFactory.MakeEntry, Decl(genericClassWithStaticFactory.ts, 115, 9)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 102, 28)) + + return this.insertEntryBefore(entry); +>this.insertEntryBefore : Symbol(insertEntryBefore, Decl(genericClassWithStaticFactory.ts, 91, 9)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>insertEntryBefore : Symbol(insertEntryBefore, Decl(genericClassWithStaticFactory.ts, 91, 9)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 103, 15)) + } + } + + export class ListFactory { +>ListFactory : Symbol(ListFactory, Decl(genericClassWithStaticFactory.ts, 106, 5)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 108, 29)) + + public MakeHead(): List { +>MakeHead : Symbol(MakeHead, Decl(genericClassWithStaticFactory.ts, 108, 33)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 110, 24)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 110, 24)) + + var entry: List = new List(true, null); +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 111, 15)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 110, 24)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 110, 24)) + + entry.prev = entry; +>entry.prev : Symbol(List.prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 111, 15)) +>prev : Symbol(List.prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 111, 15)) + + entry.next = entry; +>entry.next : Symbol(List.next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 111, 15)) +>next : Symbol(List.next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 111, 15)) + + return entry; +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 111, 15)) + } + + public MakeEntry(data: T): List { +>MakeEntry : Symbol(MakeEntry, Decl(genericClassWithStaticFactory.ts, 115, 9)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 117, 25)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 117, 28)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 117, 25)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 117, 25)) + + var entry: List = new List(false, data); +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 118, 15)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 117, 25)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 117, 25)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 117, 28)) + + entry.prev = entry; +>entry.prev : Symbol(List.prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 118, 15)) +>prev : Symbol(List.prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 118, 15)) + + entry.next = entry; +>entry.next : Symbol(List.next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 118, 15)) +>next : Symbol(List.next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 118, 15)) + + return entry; +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 118, 15)) + } + + public RemoveEntry(entry: List): List { +>RemoveEntry : Symbol(RemoveEntry, Decl(genericClassWithStaticFactory.ts, 122, 9)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 124, 27)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 124, 30)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 124, 27)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 124, 27)) + + if (entry == null) { +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 124, 30)) + + return null; + } + else if (entry.isHead) { +>entry.isHead : Symbol(List.isHead, Decl(genericClassWithStaticFactory.ts, 7, 20)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 124, 30)) +>isHead : Symbol(List.isHead, Decl(genericClassWithStaticFactory.ts, 7, 20)) + + // Can't remove the head of a list! + return null; + } + else { + entry.next.prev = entry.prev; +>entry.next.prev : Symbol(List.prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry.next : Symbol(List.next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 124, 30)) +>next : Symbol(List.next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>prev : Symbol(List.prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry.prev : Symbol(List.prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 124, 30)) +>prev : Symbol(List.prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) + + entry.prev.next = entry.next; +>entry.prev.next : Symbol(List.next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry.prev : Symbol(List.prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 124, 30)) +>prev : Symbol(List.prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>next : Symbol(List.next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry.next : Symbol(List.next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 124, 30)) +>next : Symbol(List.next, Decl(genericClassWithStaticFactory.ts, 2, 26)) + + return entry; +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 124, 30)) + } + } + } +} diff --git a/tests/baselines/reference/genericClassWithStaticFactory.types b/tests/baselines/reference/genericClassWithStaticFactory.types index b0df737ee68..34d0c4aeaae 100644 --- a/tests/baselines/reference/genericClassWithStaticFactory.types +++ b/tests/baselines/reference/genericClassWithStaticFactory.types @@ -111,6 +111,7 @@ module Editor { for (i = 0; !(entry.isHead); i++) { >i = 0 : number >i : number +>0 : number >!(entry.isHead) : boolean >(entry.isHead) : boolean >entry.isHead : boolean @@ -163,6 +164,7 @@ module Editor { } else { return null; +>null : null } } @@ -177,6 +179,7 @@ module Editor { >entry.isHead : boolean >entry : List >isHead : boolean +>false : boolean entry.next = this.next; >entry.next = this.next : List @@ -238,6 +241,7 @@ module Editor { >entry.isHead : boolean >entry : List >isHead : boolean +>false : boolean entry.next = this.next; >entry.next = this.next : List @@ -288,6 +292,7 @@ module Editor { >isHead : boolean return null; +>null : null } else { return this.listFactory.RemoveEntry(this.next); @@ -316,6 +321,7 @@ module Editor { >entry.isHead : boolean >entry : List >isHead : boolean +>false : boolean this.prev.next = entry; >this.prev.next = entry : List @@ -495,6 +501,8 @@ module Editor { >new List(true, null) : List >List : typeof List >T : T +>true : boolean +>null : null entry.prev = entry; >entry.prev = entry : List @@ -529,6 +537,7 @@ module Editor { >new List(false, data) : List >List : typeof List >T : T +>false : boolean >data : T entry.prev = entry; @@ -561,8 +570,10 @@ module Editor { if (entry == null) { >entry == null : boolean >entry : List +>null : null return null; +>null : null } else if (entry.isHead) { >entry.isHead : boolean @@ -571,6 +582,7 @@ module Editor { // Can't remove the head of a list! return null; +>null : null } else { entry.next.prev = entry.prev; diff --git a/tests/baselines/reference/genericClasses0.symbols b/tests/baselines/reference/genericClasses0.symbols new file mode 100644 index 00000000000..764cd04c962 --- /dev/null +++ b/tests/baselines/reference/genericClasses0.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/genericClasses0.ts === +class C { +>C : Symbol(C, Decl(genericClasses0.ts, 0, 0)) +>T : Symbol(T, Decl(genericClasses0.ts, 0, 8)) + + public x: T; +>x : Symbol(x, Decl(genericClasses0.ts, 0, 12)) +>T : Symbol(T, Decl(genericClasses0.ts, 0, 8)) +} + +var v1 : C; +>v1 : Symbol(v1, Decl(genericClasses0.ts, 4, 3)) +>C : Symbol(C, Decl(genericClasses0.ts, 0, 0)) + +var y = v1.x; // should be 'string' +>y : Symbol(y, Decl(genericClasses0.ts, 6, 3)) +>v1.x : Symbol(C.x, Decl(genericClasses0.ts, 0, 12)) +>v1 : Symbol(v1, Decl(genericClasses0.ts, 4, 3)) +>x : Symbol(C.x, Decl(genericClasses0.ts, 0, 12)) + diff --git a/tests/baselines/reference/genericClasses1.symbols b/tests/baselines/reference/genericClasses1.symbols new file mode 100644 index 00000000000..d2100b5e3b3 --- /dev/null +++ b/tests/baselines/reference/genericClasses1.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/genericClasses1.ts === +class C { +>C : Symbol(C, Decl(genericClasses1.ts, 0, 0)) +>T : Symbol(T, Decl(genericClasses1.ts, 0, 8)) + + public x: T; +>x : Symbol(x, Decl(genericClasses1.ts, 0, 12)) +>T : Symbol(T, Decl(genericClasses1.ts, 0, 8)) +} + +var v1 = new C(); +>v1 : Symbol(v1, Decl(genericClasses1.ts, 4, 3)) +>C : Symbol(C, Decl(genericClasses1.ts, 0, 0)) + +var y = v1.x; // should be 'string' +>y : Symbol(y, Decl(genericClasses1.ts, 6, 3)) +>v1.x : Symbol(C.x, Decl(genericClasses1.ts, 0, 12)) +>v1 : Symbol(v1, Decl(genericClasses1.ts, 4, 3)) +>x : Symbol(C.x, Decl(genericClasses1.ts, 0, 12)) + diff --git a/tests/baselines/reference/genericClasses2.symbols b/tests/baselines/reference/genericClasses2.symbols new file mode 100644 index 00000000000..e9af0c44941 --- /dev/null +++ b/tests/baselines/reference/genericClasses2.symbols @@ -0,0 +1,54 @@ +=== tests/cases/compiler/genericClasses2.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(genericClasses2.ts, 0, 0)) +>T : Symbol(T, Decl(genericClasses2.ts, 0, 14)) + + a: T; +>a : Symbol(a, Decl(genericClasses2.ts, 0, 18)) +>T : Symbol(T, Decl(genericClasses2.ts, 0, 14)) +} + +class C { +>C : Symbol(C, Decl(genericClasses2.ts, 2, 1)) +>T : Symbol(T, Decl(genericClasses2.ts, 4, 8)) + + public x: T; +>x : Symbol(x, Decl(genericClasses2.ts, 4, 12)) +>T : Symbol(T, Decl(genericClasses2.ts, 4, 8)) + + public y: Foo; +>y : Symbol(y, Decl(genericClasses2.ts, 5, 13)) +>Foo : Symbol(Foo, Decl(genericClasses2.ts, 0, 0)) +>T : Symbol(T, Decl(genericClasses2.ts, 4, 8)) + + public z: Foo; +>z : Symbol(z, Decl(genericClasses2.ts, 6, 18)) +>Foo : Symbol(Foo, Decl(genericClasses2.ts, 0, 0)) +} + +var v1 : C; +>v1 : Symbol(v1, Decl(genericClasses2.ts, 10, 3)) +>C : Symbol(C, Decl(genericClasses2.ts, 2, 1)) + +var y = v1.x; // should be 'string' +>y : Symbol(y, Decl(genericClasses2.ts, 12, 3)) +>v1.x : Symbol(C.x, Decl(genericClasses2.ts, 4, 12)) +>v1 : Symbol(v1, Decl(genericClasses2.ts, 10, 3)) +>x : Symbol(C.x, Decl(genericClasses2.ts, 4, 12)) + +var w = v1.y.a; // should be 'string' +>w : Symbol(w, Decl(genericClasses2.ts, 13, 3)) +>v1.y.a : Symbol(Foo.a, Decl(genericClasses2.ts, 0, 18)) +>v1.y : Symbol(C.y, Decl(genericClasses2.ts, 5, 13)) +>v1 : Symbol(v1, Decl(genericClasses2.ts, 10, 3)) +>y : Symbol(C.y, Decl(genericClasses2.ts, 5, 13)) +>a : Symbol(Foo.a, Decl(genericClasses2.ts, 0, 18)) + +var z = v1.z.a; // should be 'number' +>z : Symbol(z, Decl(genericClasses2.ts, 14, 3)) +>v1.z.a : Symbol(Foo.a, Decl(genericClasses2.ts, 0, 18)) +>v1.z : Symbol(C.z, Decl(genericClasses2.ts, 6, 18)) +>v1 : Symbol(v1, Decl(genericClasses2.ts, 10, 3)) +>z : Symbol(C.z, Decl(genericClasses2.ts, 6, 18)) +>a : Symbol(Foo.a, Decl(genericClasses2.ts, 0, 18)) + diff --git a/tests/baselines/reference/genericClasses3.symbols b/tests/baselines/reference/genericClasses3.symbols new file mode 100644 index 00000000000..06b0d8437d5 --- /dev/null +++ b/tests/baselines/reference/genericClasses3.symbols @@ -0,0 +1,48 @@ +=== tests/cases/compiler/genericClasses3.ts === +class B { +>B : Symbol(B, Decl(genericClasses3.ts, 0, 0)) +>T : Symbol(T, Decl(genericClasses3.ts, 0, 8)) + + a: T; +>a : Symbol(a, Decl(genericClasses3.ts, 0, 12)) +>T : Symbol(T, Decl(genericClasses3.ts, 0, 8)) + + b: T; +>b : Symbol(b, Decl(genericClasses3.ts, 1, 9)) +>T : Symbol(T, Decl(genericClasses3.ts, 0, 8)) +} + +class C extends B { +>C : Symbol(C, Decl(genericClasses3.ts, 3, 1)) +>T : Symbol(T, Decl(genericClasses3.ts, 5, 8)) +>B : Symbol(B, Decl(genericClasses3.ts, 0, 0)) +>T : Symbol(T, Decl(genericClasses3.ts, 5, 8)) + + public x: T; +>x : Symbol(x, Decl(genericClasses3.ts, 5, 25)) +>T : Symbol(T, Decl(genericClasses3.ts, 5, 8)) +} + +var v2: C ; +>v2 : Symbol(v2, Decl(genericClasses3.ts, 9, 3)) +>C : Symbol(C, Decl(genericClasses3.ts, 3, 1)) + +var y = v2.x; // should be 'string' +>y : Symbol(y, Decl(genericClasses3.ts, 11, 3)) +>v2.x : Symbol(C.x, Decl(genericClasses3.ts, 5, 25)) +>v2 : Symbol(v2, Decl(genericClasses3.ts, 9, 3)) +>x : Symbol(C.x, Decl(genericClasses3.ts, 5, 25)) + +var u = v2.a; // should be 'string' +>u : Symbol(u, Decl(genericClasses3.ts, 12, 3)) +>v2.a : Symbol(B.a, Decl(genericClasses3.ts, 0, 12)) +>v2 : Symbol(v2, Decl(genericClasses3.ts, 9, 3)) +>a : Symbol(B.a, Decl(genericClasses3.ts, 0, 12)) + +var z = v2.b; +>z : Symbol(z, Decl(genericClasses3.ts, 14, 3)) +>v2.b : Symbol(B.b, Decl(genericClasses3.ts, 1, 9)) +>v2 : Symbol(v2, Decl(genericClasses3.ts, 9, 3)) +>b : Symbol(B.b, Decl(genericClasses3.ts, 1, 9)) + + diff --git a/tests/baselines/reference/genericClasses4.symbols b/tests/baselines/reference/genericClasses4.symbols new file mode 100644 index 00000000000..d910cbc152d --- /dev/null +++ b/tests/baselines/reference/genericClasses4.symbols @@ -0,0 +1,92 @@ +=== tests/cases/compiler/genericClasses4.ts === +// once caused stack overflow +class Vec2_T +>Vec2_T : Symbol(Vec2_T, Decl(genericClasses4.ts, 0, 0)) +>A : Symbol(A, Decl(genericClasses4.ts, 1, 13)) +{ + constructor(public x: A, public y: A) { } +>x : Symbol(x, Decl(genericClasses4.ts, 3, 16)) +>A : Symbol(A, Decl(genericClasses4.ts, 1, 13)) +>y : Symbol(y, Decl(genericClasses4.ts, 3, 28)) +>A : Symbol(A, Decl(genericClasses4.ts, 1, 13)) + + fmap(f: (a: A) => B): Vec2_T { +>fmap : Symbol(fmap, Decl(genericClasses4.ts, 3, 45)) +>B : Symbol(B, Decl(genericClasses4.ts, 4, 9)) +>f : Symbol(f, Decl(genericClasses4.ts, 4, 12)) +>a : Symbol(a, Decl(genericClasses4.ts, 4, 16)) +>A : Symbol(A, Decl(genericClasses4.ts, 1, 13)) +>B : Symbol(B, Decl(genericClasses4.ts, 4, 9)) +>Vec2_T : Symbol(Vec2_T, Decl(genericClasses4.ts, 0, 0)) +>B : Symbol(B, Decl(genericClasses4.ts, 4, 9)) + + var x:B = f(this.x); +>x : Symbol(x, Decl(genericClasses4.ts, 5, 11)) +>B : Symbol(B, Decl(genericClasses4.ts, 4, 9)) +>f : Symbol(f, Decl(genericClasses4.ts, 4, 12)) +>this.x : Symbol(x, Decl(genericClasses4.ts, 3, 16)) +>this : Symbol(Vec2_T, Decl(genericClasses4.ts, 0, 0)) +>x : Symbol(x, Decl(genericClasses4.ts, 3, 16)) + + var y:B = f(this.y); +>y : Symbol(y, Decl(genericClasses4.ts, 6, 11)) +>B : Symbol(B, Decl(genericClasses4.ts, 4, 9)) +>f : Symbol(f, Decl(genericClasses4.ts, 4, 12)) +>this.y : Symbol(y, Decl(genericClasses4.ts, 3, 28)) +>this : Symbol(Vec2_T, Decl(genericClasses4.ts, 0, 0)) +>y : Symbol(y, Decl(genericClasses4.ts, 3, 28)) + + var retval: Vec2_T = new Vec2_T(x, y); +>retval : Symbol(retval, Decl(genericClasses4.ts, 7, 11)) +>Vec2_T : Symbol(Vec2_T, Decl(genericClasses4.ts, 0, 0)) +>B : Symbol(B, Decl(genericClasses4.ts, 4, 9)) +>Vec2_T : Symbol(Vec2_T, Decl(genericClasses4.ts, 0, 0)) +>x : Symbol(x, Decl(genericClasses4.ts, 5, 11)) +>y : Symbol(y, Decl(genericClasses4.ts, 6, 11)) + + return retval; +>retval : Symbol(retval, Decl(genericClasses4.ts, 7, 11)) + } + apply(f: Vec2_T<(a: A) => B>): Vec2_T { +>apply : Symbol(apply, Decl(genericClasses4.ts, 9, 5)) +>B : Symbol(B, Decl(genericClasses4.ts, 10, 10)) +>f : Symbol(f, Decl(genericClasses4.ts, 10, 13)) +>Vec2_T : Symbol(Vec2_T, Decl(genericClasses4.ts, 0, 0)) +>a : Symbol(a, Decl(genericClasses4.ts, 10, 24)) +>A : Symbol(A, Decl(genericClasses4.ts, 1, 13)) +>B : Symbol(B, Decl(genericClasses4.ts, 10, 10)) +>Vec2_T : Symbol(Vec2_T, Decl(genericClasses4.ts, 0, 0)) +>B : Symbol(B, Decl(genericClasses4.ts, 10, 10)) + + var x:B = f.x(this.x); +>x : Symbol(x, Decl(genericClasses4.ts, 11, 11)) +>B : Symbol(B, Decl(genericClasses4.ts, 10, 10)) +>f.x : Symbol(Vec2_T.x, Decl(genericClasses4.ts, 3, 16)) +>f : Symbol(f, Decl(genericClasses4.ts, 10, 13)) +>x : Symbol(Vec2_T.x, Decl(genericClasses4.ts, 3, 16)) +>this.x : Symbol(x, Decl(genericClasses4.ts, 3, 16)) +>this : Symbol(Vec2_T, Decl(genericClasses4.ts, 0, 0)) +>x : Symbol(x, Decl(genericClasses4.ts, 3, 16)) + + var y:B = f.y(this.y); +>y : Symbol(y, Decl(genericClasses4.ts, 12, 11)) +>B : Symbol(B, Decl(genericClasses4.ts, 10, 10)) +>f.y : Symbol(Vec2_T.y, Decl(genericClasses4.ts, 3, 28)) +>f : Symbol(f, Decl(genericClasses4.ts, 10, 13)) +>y : Symbol(Vec2_T.y, Decl(genericClasses4.ts, 3, 28)) +>this.y : Symbol(y, Decl(genericClasses4.ts, 3, 28)) +>this : Symbol(Vec2_T, Decl(genericClasses4.ts, 0, 0)) +>y : Symbol(y, Decl(genericClasses4.ts, 3, 28)) + + var retval: Vec2_T = new Vec2_T(x, y); +>retval : Symbol(retval, Decl(genericClasses4.ts, 13, 11)) +>Vec2_T : Symbol(Vec2_T, Decl(genericClasses4.ts, 0, 0)) +>B : Symbol(B, Decl(genericClasses4.ts, 10, 10)) +>Vec2_T : Symbol(Vec2_T, Decl(genericClasses4.ts, 0, 0)) +>x : Symbol(x, Decl(genericClasses4.ts, 11, 11)) +>y : Symbol(y, Decl(genericClasses4.ts, 12, 11)) + + return retval; +>retval : Symbol(retval, Decl(genericClasses4.ts, 13, 11)) + } +} diff --git a/tests/baselines/reference/genericClassesInModule.symbols b/tests/baselines/reference/genericClassesInModule.symbols new file mode 100644 index 00000000000..f097eac36f1 --- /dev/null +++ b/tests/baselines/reference/genericClassesInModule.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/genericClassesInModule.ts === + +module Foo { +>Foo : Symbol(Foo, Decl(genericClassesInModule.ts, 0, 0)) + + export class B{ } +>B : Symbol(B, Decl(genericClassesInModule.ts, 1, 12)) +>T : Symbol(T, Decl(genericClassesInModule.ts, 3, 19)) + + export class A { } +>A : Symbol(A, Decl(genericClassesInModule.ts, 3, 24)) +} + +var a = new Foo.B(); +>a : Symbol(a, Decl(genericClassesInModule.ts, 8, 3)) +>Foo.B : Symbol(Foo.B, Decl(genericClassesInModule.ts, 1, 12)) +>Foo : Symbol(Foo, Decl(genericClassesInModule.ts, 0, 0)) +>B : Symbol(Foo.B, Decl(genericClassesInModule.ts, 1, 12)) +>Foo : Symbol(Foo, Decl(genericClassesInModule.ts, 0, 0)) +>A : Symbol(Foo.A, Decl(genericClassesInModule.ts, 3, 24)) + diff --git a/tests/baselines/reference/genericClassesInModule.types b/tests/baselines/reference/genericClassesInModule.types index 8c25523803c..128decac570 100644 --- a/tests/baselines/reference/genericClassesInModule.types +++ b/tests/baselines/reference/genericClassesInModule.types @@ -17,6 +17,6 @@ var a = new Foo.B(); >Foo.B : typeof Foo.B >Foo : typeof Foo >B : typeof Foo.B ->Foo : unknown +>Foo : any >A : Foo.A diff --git a/tests/baselines/reference/genericClassesInModule2.symbols b/tests/baselines/reference/genericClassesInModule2.symbols new file mode 100644 index 00000000000..a767d64de07 --- /dev/null +++ b/tests/baselines/reference/genericClassesInModule2.symbols @@ -0,0 +1,61 @@ +=== tests/cases/compiler/genericClassesInModule2.ts === +export class A{ +>A : Symbol(A, Decl(genericClassesInModule2.ts, 0, 0)) +>T1 : Symbol(T1, Decl(genericClassesInModule2.ts, 0, 15)) + + constructor( public callback: (self: A) => void) { +>callback : Symbol(callback, Decl(genericClassesInModule2.ts, 1, 16)) +>self : Symbol(self, Decl(genericClassesInModule2.ts, 1, 35)) +>A : Symbol(A, Decl(genericClassesInModule2.ts, 0, 0)) +>T1 : Symbol(T1, Decl(genericClassesInModule2.ts, 0, 15)) + + var child = new B(this); +>child : Symbol(child, Decl(genericClassesInModule2.ts, 2, 11)) +>B : Symbol(B, Decl(genericClassesInModule2.ts, 13, 1)) +>this : Symbol(A, Decl(genericClassesInModule2.ts, 0, 0)) + } + AAA( callback: (self: A) => void) { +>AAA : Symbol(AAA, Decl(genericClassesInModule2.ts, 3, 5)) +>callback : Symbol(callback, Decl(genericClassesInModule2.ts, 4, 8)) +>self : Symbol(self, Decl(genericClassesInModule2.ts, 4, 20)) +>A : Symbol(A, Decl(genericClassesInModule2.ts, 0, 0)) +>T1 : Symbol(T1, Decl(genericClassesInModule2.ts, 0, 15)) + + var child = new B(this); +>child : Symbol(child, Decl(genericClassesInModule2.ts, 5, 11)) +>B : Symbol(B, Decl(genericClassesInModule2.ts, 13, 1)) +>this : Symbol(A, Decl(genericClassesInModule2.ts, 0, 0)) + } +} + +export interface C{ +>C : Symbol(C, Decl(genericClassesInModule2.ts, 7, 1)) +>T1 : Symbol(T1, Decl(genericClassesInModule2.ts, 9, 19)) + + child: B; +>child : Symbol(child, Decl(genericClassesInModule2.ts, 9, 23)) +>B : Symbol(B, Decl(genericClassesInModule2.ts, 13, 1)) +>T1 : Symbol(T1, Decl(genericClassesInModule2.ts, 9, 19)) + + (self: C): void; +>self : Symbol(self, Decl(genericClassesInModule2.ts, 11, 5)) +>C : Symbol(C, Decl(genericClassesInModule2.ts, 7, 1)) +>T1 : Symbol(T1, Decl(genericClassesInModule2.ts, 9, 19)) + + new(callback: (self: C) => void) +>callback : Symbol(callback, Decl(genericClassesInModule2.ts, 12, 8)) +>self : Symbol(self, Decl(genericClassesInModule2.ts, 12, 19)) +>C : Symbol(C, Decl(genericClassesInModule2.ts, 7, 1)) +>T1 : Symbol(T1, Decl(genericClassesInModule2.ts, 9, 19)) +} + +export class B { +>B : Symbol(B, Decl(genericClassesInModule2.ts, 13, 1)) +>T2 : Symbol(T2, Decl(genericClassesInModule2.ts, 15, 15)) + + constructor(public parent: T2) { } +>parent : Symbol(parent, Decl(genericClassesInModule2.ts, 16, 16)) +>T2 : Symbol(T2, Decl(genericClassesInModule2.ts, 15, 15)) +} + + diff --git a/tests/baselines/reference/genericCloduleInModule.symbols b/tests/baselines/reference/genericCloduleInModule.symbols new file mode 100644 index 00000000000..0becc7469a1 --- /dev/null +++ b/tests/baselines/reference/genericCloduleInModule.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/genericCloduleInModule.ts === +module A { +>A : Symbol(A, Decl(genericCloduleInModule.ts, 0, 0)) + + export class B { +>B : Symbol(B, Decl(genericCloduleInModule.ts, 0, 10), Decl(genericCloduleInModule.ts, 4, 5)) +>T : Symbol(T, Decl(genericCloduleInModule.ts, 1, 19)) + + foo() { } +>foo : Symbol(foo, Decl(genericCloduleInModule.ts, 1, 23)) + + static bar() { } +>bar : Symbol(B.bar, Decl(genericCloduleInModule.ts, 2, 17)) + } + export module B { +>B : Symbol(B, Decl(genericCloduleInModule.ts, 0, 10), Decl(genericCloduleInModule.ts, 4, 5)) + + export var x = 1; +>x : Symbol(x, Decl(genericCloduleInModule.ts, 6, 18)) + } +} + +var b: A.B; +>b : Symbol(b, Decl(genericCloduleInModule.ts, 10, 3)) +>A : Symbol(A, Decl(genericCloduleInModule.ts, 0, 0)) +>B : Symbol(A.B, Decl(genericCloduleInModule.ts, 0, 10), Decl(genericCloduleInModule.ts, 4, 5)) + +b.foo(); +>b.foo : Symbol(A.B.foo, Decl(genericCloduleInModule.ts, 1, 23)) +>b : Symbol(b, Decl(genericCloduleInModule.ts, 10, 3)) +>foo : Symbol(A.B.foo, Decl(genericCloduleInModule.ts, 1, 23)) + diff --git a/tests/baselines/reference/genericCloduleInModule.types b/tests/baselines/reference/genericCloduleInModule.types index 108dc34c2f7..3ae3a8cf06d 100644 --- a/tests/baselines/reference/genericCloduleInModule.types +++ b/tests/baselines/reference/genericCloduleInModule.types @@ -17,12 +17,13 @@ module A { export var x = 1; >x : number +>1 : number } } var b: A.B; >b : A.B ->A : unknown +>A : any >B : A.B b.foo(); diff --git a/tests/baselines/reference/genericConstraintDeclaration.symbols b/tests/baselines/reference/genericConstraintDeclaration.symbols new file mode 100644 index 00000000000..0b962f08b70 --- /dev/null +++ b/tests/baselines/reference/genericConstraintDeclaration.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/genericConstraintDeclaration.ts === +class List{ +>List : Symbol(List, Decl(genericConstraintDeclaration.ts, 0, 0)) +>T : Symbol(T, Decl(genericConstraintDeclaration.ts, 0, 11)) + + static empty(): List{return null;} +>empty : Symbol(List.empty, Decl(genericConstraintDeclaration.ts, 0, 25)) +>T : Symbol(T, Decl(genericConstraintDeclaration.ts, 1, 17)) +>List : Symbol(List, Decl(genericConstraintDeclaration.ts, 0, 0)) +>T : Symbol(T, Decl(genericConstraintDeclaration.ts, 1, 17)) +} + + + + + diff --git a/tests/baselines/reference/genericConstraintDeclaration.types b/tests/baselines/reference/genericConstraintDeclaration.types index 126da138d4e..aaa7d1de77a 100644 --- a/tests/baselines/reference/genericConstraintDeclaration.types +++ b/tests/baselines/reference/genericConstraintDeclaration.types @@ -8,6 +8,7 @@ class List{ >T : T >List : List >T : T +>null : null } diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.symbols b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.symbols new file mode 100644 index 00000000000..3ce4f709b7d --- /dev/null +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.symbols @@ -0,0 +1,64 @@ +=== tests/cases/compiler/genericConstraintOnExtendedBuiltinTypes.ts === +declare module EndGate { +>EndGate : Symbol(EndGate, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 0, 0), Decl(genericConstraintOnExtendedBuiltinTypes.ts, 6, 47), Decl(genericConstraintOnExtendedBuiltinTypes.ts, 17, 1)) + + export interface ICloneable { +>ICloneable : Symbol(ICloneable, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 0, 24)) + + Clone(): any; +>Clone : Symbol(Clone, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 1, 33)) + } +} + +interface Number extends EndGate.ICloneable { } +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11), Decl(genericConstraintOnExtendedBuiltinTypes.ts, 4, 1)) +>EndGate.ICloneable : Symbol(EndGate.ICloneable, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 0, 24)) +>EndGate : Symbol(EndGate, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 0, 0), Decl(genericConstraintOnExtendedBuiltinTypes.ts, 6, 47), Decl(genericConstraintOnExtendedBuiltinTypes.ts, 17, 1)) +>ICloneable : Symbol(EndGate.ICloneable, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 0, 24)) + +module EndGate.Tweening { +>EndGate : Symbol(EndGate, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 0, 0), Decl(genericConstraintOnExtendedBuiltinTypes.ts, 6, 47), Decl(genericConstraintOnExtendedBuiltinTypes.ts, 17, 1)) +>Tweening : Symbol(Tweening, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 8, 15), Decl(genericConstraintOnExtendedBuiltinTypes.ts, 19, 15)) + + export class Tween{ +>Tween : Symbol(Tween, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 8, 25)) +>T : Symbol(T, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 9, 23)) +>ICloneable : Symbol(ICloneable, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 0, 24)) + + private _from: T; +>_from : Symbol(_from, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 9, 45)) +>T : Symbol(T, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 9, 23)) + + + constructor(from: T) { +>from : Symbol(from, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 13, 20)) +>T : Symbol(T, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 9, 23)) + + this._from = from.Clone(); +>this._from : Symbol(_from, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 9, 45)) +>this : Symbol(Tween, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 8, 25)) +>_from : Symbol(_from, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 9, 45)) +>from.Clone : Symbol(ICloneable.Clone, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 1, 33)) +>from : Symbol(from, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 13, 20)) +>Clone : Symbol(ICloneable.Clone, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 1, 33)) + } + } +} + +module EndGate.Tweening { +>EndGate : Symbol(EndGate, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 0, 0), Decl(genericConstraintOnExtendedBuiltinTypes.ts, 6, 47), Decl(genericConstraintOnExtendedBuiltinTypes.ts, 17, 1)) +>Tweening : Symbol(Tweening, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 8, 15), Decl(genericConstraintOnExtendedBuiltinTypes.ts, 19, 15)) + + export class NumberTween extends Tween{ +>NumberTween : Symbol(NumberTween, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 19, 25)) +>Tween : Symbol(Tween, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 8, 25)) + + constructor(from: number) { +>from : Symbol(from, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 21, 20)) + + super(from); +>super : Symbol(Tween, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 8, 25)) +>from : Symbol(from, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 21, 20)) + } + } +} diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.types b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.types index eadf43d226a..f1041cfa80f 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.types +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.types @@ -12,6 +12,7 @@ declare module EndGate { interface Number extends EndGate.ICloneable { } >Number : Number +>EndGate.ICloneable : any >EndGate : typeof EndGate >ICloneable : EndGate.ICloneable diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.symbols b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.symbols new file mode 100644 index 00000000000..be96d92c357 --- /dev/null +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.symbols @@ -0,0 +1,64 @@ +=== tests/cases/compiler/genericConstraintOnExtendedBuiltinTypes2.ts === +module EndGate { +>EndGate : Symbol(EndGate, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 0, 0), Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 6, 47), Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 16, 1)) + + export interface ICloneable { +>ICloneable : Symbol(ICloneable, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 0, 16)) + + Clone(): any; +>Clone : Symbol(Clone, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 1, 33)) + } +} + +interface Number extends EndGate.ICloneable { } +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11), Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 4, 1)) +>EndGate.ICloneable : Symbol(EndGate.ICloneable, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 0, 16)) +>EndGate : Symbol(EndGate, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 0, 0), Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 6, 47), Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 16, 1)) +>ICloneable : Symbol(EndGate.ICloneable, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 0, 16)) + +module EndGate.Tweening { +>EndGate : Symbol(EndGate, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 0, 0), Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 6, 47), Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 16, 1)) +>Tweening : Symbol(Tweening, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 8, 15), Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 18, 15)) + + export class Tween{ +>Tween : Symbol(Tween, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 8, 25)) +>T : Symbol(T, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 9, 23)) +>ICloneable : Symbol(ICloneable, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 0, 16)) + + private _from: T; +>_from : Symbol(_from, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 9, 45)) +>T : Symbol(T, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 9, 23)) + + constructor(from: T) { +>from : Symbol(from, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 12, 20)) +>T : Symbol(T, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 9, 23)) + + this._from = from.Clone(); +>this._from : Symbol(_from, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 9, 45)) +>this : Symbol(Tween, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 8, 25)) +>_from : Symbol(_from, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 9, 45)) +>from.Clone : Symbol(ICloneable.Clone, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 1, 33)) +>from : Symbol(from, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 12, 20)) +>Clone : Symbol(ICloneable.Clone, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 1, 33)) + } + } +} + +module EndGate.Tweening { +>EndGate : Symbol(EndGate, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 0, 0), Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 6, 47), Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 16, 1)) +>Tweening : Symbol(Tweening, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 8, 15), Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 18, 15)) + + export class NumberTween extends Tween{ +>NumberTween : Symbol(NumberTween, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 18, 25)) +>Tween : Symbol(Tween, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 8, 25)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11), Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 4, 1)) + + constructor(from: number) { +>from : Symbol(from, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 20, 20)) + + super(from); +>super : Symbol(Tween, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 8, 25)) +>from : Symbol(from, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 20, 20)) + } + } +} diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.types b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.types index 80e1a963d5f..92ffa7c5c03 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.types +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.types @@ -12,6 +12,7 @@ module EndGate { interface Number extends EndGate.ICloneable { } >Number : Number +>EndGate.ICloneable : any >EndGate : typeof EndGate >ICloneable : EndGate.ICloneable diff --git a/tests/baselines/reference/genericConstructSignatureInInterface.symbols b/tests/baselines/reference/genericConstructSignatureInInterface.symbols new file mode 100644 index 00000000000..18b5feee6ff --- /dev/null +++ b/tests/baselines/reference/genericConstructSignatureInInterface.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/genericConstructSignatureInInterface.ts === +interface C { +>C : Symbol(C, Decl(genericConstructSignatureInInterface.ts, 0, 0)) + + new (x: T); +>T : Symbol(T, Decl(genericConstructSignatureInInterface.ts, 1, 9)) +>x : Symbol(x, Decl(genericConstructSignatureInInterface.ts, 1, 12)) +>T : Symbol(T, Decl(genericConstructSignatureInInterface.ts, 1, 9)) +} + +var v: C; +>v : Symbol(v, Decl(genericConstructSignatureInInterface.ts, 4, 3)) +>C : Symbol(C, Decl(genericConstructSignatureInInterface.ts, 0, 0)) + +var r = new v(1); +>r : Symbol(r, Decl(genericConstructSignatureInInterface.ts, 5, 3)) +>v : Symbol(v, Decl(genericConstructSignatureInInterface.ts, 4, 3)) + diff --git a/tests/baselines/reference/genericConstructSignatureInInterface.types b/tests/baselines/reference/genericConstructSignatureInInterface.types index 5318edb5bf1..c6653a0d90d 100644 --- a/tests/baselines/reference/genericConstructSignatureInInterface.types +++ b/tests/baselines/reference/genericConstructSignatureInInterface.types @@ -16,4 +16,5 @@ var r = new v(1); >r : any >new v(1) : any >v : C +>1 : number diff --git a/tests/baselines/reference/genericContextualTypingSpecialization.symbols b/tests/baselines/reference/genericContextualTypingSpecialization.symbols new file mode 100644 index 00000000000..05312d889c9 --- /dev/null +++ b/tests/baselines/reference/genericContextualTypingSpecialization.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/genericContextualTypingSpecialization.ts === +var b: number[]; +>b : Symbol(b, Decl(genericContextualTypingSpecialization.ts, 0, 3)) + +b.reduce((c, d) => c + d, 0); // should not error on '+' +>b.reduce : Symbol(Array.reduce, Decl(lib.d.ts, 1129, 93), Decl(lib.d.ts, 1136, 120)) +>b : Symbol(b, Decl(genericContextualTypingSpecialization.ts, 0, 3)) +>reduce : Symbol(Array.reduce, Decl(lib.d.ts, 1129, 93), Decl(lib.d.ts, 1136, 120)) +>c : Symbol(c, Decl(genericContextualTypingSpecialization.ts, 1, 18)) +>d : Symbol(d, Decl(genericContextualTypingSpecialization.ts, 1, 20)) +>c : Symbol(c, Decl(genericContextualTypingSpecialization.ts, 1, 18)) +>d : Symbol(d, Decl(genericContextualTypingSpecialization.ts, 1, 20)) + diff --git a/tests/baselines/reference/genericContextualTypingSpecialization.types b/tests/baselines/reference/genericContextualTypingSpecialization.types index 890da96c260..561370a6a32 100644 --- a/tests/baselines/reference/genericContextualTypingSpecialization.types +++ b/tests/baselines/reference/genericContextualTypingSpecialization.types @@ -13,4 +13,5 @@ b.reduce((c, d) => c + d, 0); // should not error on '+' >c + d : number >c : number >d : number +>0 : number diff --git a/tests/baselines/reference/genericFunctionHasFreshTypeArgs.symbols b/tests/baselines/reference/genericFunctionHasFreshTypeArgs.symbols new file mode 100644 index 00000000000..0baf9eda80f --- /dev/null +++ b/tests/baselines/reference/genericFunctionHasFreshTypeArgs.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/genericFunctionHasFreshTypeArgs.ts === +function f(p: (x: T) => void) { }; +>f : Symbol(f, Decl(genericFunctionHasFreshTypeArgs.ts, 0, 0)) +>p : Symbol(p, Decl(genericFunctionHasFreshTypeArgs.ts, 0, 11)) +>T : Symbol(T, Decl(genericFunctionHasFreshTypeArgs.ts, 0, 15)) +>x : Symbol(x, Decl(genericFunctionHasFreshTypeArgs.ts, 0, 18)) +>T : Symbol(T, Decl(genericFunctionHasFreshTypeArgs.ts, 0, 15)) + +f(x => f(y => x = y)); +>f : Symbol(f, Decl(genericFunctionHasFreshTypeArgs.ts, 0, 0)) +>x : Symbol(x, Decl(genericFunctionHasFreshTypeArgs.ts, 1, 2)) +>f : Symbol(f, Decl(genericFunctionHasFreshTypeArgs.ts, 0, 0)) +>y : Symbol(y, Decl(genericFunctionHasFreshTypeArgs.ts, 1, 9)) +>x : Symbol(x, Decl(genericFunctionHasFreshTypeArgs.ts, 1, 2)) +>y : Symbol(y, Decl(genericFunctionHasFreshTypeArgs.ts, 1, 9)) + diff --git a/tests/baselines/reference/genericFunctionSpecializations1.symbols b/tests/baselines/reference/genericFunctionSpecializations1.symbols new file mode 100644 index 00000000000..e3c21ea418b --- /dev/null +++ b/tests/baselines/reference/genericFunctionSpecializations1.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/genericFunctionSpecializations1.ts === +function foo3(test: string); // error +>foo3 : Symbol(foo3, Decl(genericFunctionSpecializations1.ts, 0, 0), Decl(genericFunctionSpecializations1.ts, 0, 31)) +>T : Symbol(T, Decl(genericFunctionSpecializations1.ts, 0, 14)) +>test : Symbol(test, Decl(genericFunctionSpecializations1.ts, 0, 17)) + +function foo3(test: T) { } +>foo3 : Symbol(foo3, Decl(genericFunctionSpecializations1.ts, 0, 0), Decl(genericFunctionSpecializations1.ts, 0, 31)) +>T : Symbol(T, Decl(genericFunctionSpecializations1.ts, 1, 14)) +>test : Symbol(test, Decl(genericFunctionSpecializations1.ts, 1, 17)) +>T : Symbol(T, Decl(genericFunctionSpecializations1.ts, 1, 14)) + +function foo4(test: string); // valid +>foo4 : Symbol(foo4, Decl(genericFunctionSpecializations1.ts, 1, 29), Decl(genericFunctionSpecializations1.ts, 3, 31)) +>T : Symbol(T, Decl(genericFunctionSpecializations1.ts, 3, 14)) +>test : Symbol(test, Decl(genericFunctionSpecializations1.ts, 3, 17)) + +function foo4(test: T) { } +>foo4 : Symbol(foo4, Decl(genericFunctionSpecializations1.ts, 1, 29), Decl(genericFunctionSpecializations1.ts, 3, 31)) +>T : Symbol(T, Decl(genericFunctionSpecializations1.ts, 4, 14)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) +>test : Symbol(test, Decl(genericFunctionSpecializations1.ts, 4, 32)) +>T : Symbol(T, Decl(genericFunctionSpecializations1.ts, 4, 14)) + diff --git a/tests/baselines/reference/genericFunctions0.symbols b/tests/baselines/reference/genericFunctions0.symbols new file mode 100644 index 00000000000..50eab4fe7d3 --- /dev/null +++ b/tests/baselines/reference/genericFunctions0.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/genericFunctions0.ts === +function foo (x: T) { return x; } +>foo : Symbol(foo, Decl(genericFunctions0.ts, 0, 0)) +>T : Symbol(T, Decl(genericFunctions0.ts, 0, 13)) +>x : Symbol(x, Decl(genericFunctions0.ts, 0, 18)) +>T : Symbol(T, Decl(genericFunctions0.ts, 0, 13)) +>x : Symbol(x, Decl(genericFunctions0.ts, 0, 18)) + +var x = foo(5); // 'x' should be number +>x : Symbol(x, Decl(genericFunctions0.ts, 2, 3)) +>foo : Symbol(foo, Decl(genericFunctions0.ts, 0, 0)) + diff --git a/tests/baselines/reference/genericFunctions0.types b/tests/baselines/reference/genericFunctions0.types index 045224a7aaa..aac759af092 100644 --- a/tests/baselines/reference/genericFunctions0.types +++ b/tests/baselines/reference/genericFunctions0.types @@ -10,4 +10,5 @@ var x = foo(5); // 'x' should be number >x : number >foo(5) : number >foo : (x: T) => T +>5 : number diff --git a/tests/baselines/reference/genericFunctions1.symbols b/tests/baselines/reference/genericFunctions1.symbols new file mode 100644 index 00000000000..6f4470492cd --- /dev/null +++ b/tests/baselines/reference/genericFunctions1.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/genericFunctions1.ts === +function foo (x: T) { return x; } +>foo : Symbol(foo, Decl(genericFunctions1.ts, 0, 0)) +>T : Symbol(T, Decl(genericFunctions1.ts, 0, 13)) +>x : Symbol(x, Decl(genericFunctions1.ts, 0, 18)) +>T : Symbol(T, Decl(genericFunctions1.ts, 0, 13)) +>x : Symbol(x, Decl(genericFunctions1.ts, 0, 18)) + +var x = foo(5); // 'x' should be number +>x : Symbol(x, Decl(genericFunctions1.ts, 2, 3)) +>foo : Symbol(foo, Decl(genericFunctions1.ts, 0, 0)) + diff --git a/tests/baselines/reference/genericFunctions1.types b/tests/baselines/reference/genericFunctions1.types index aed264c78e1..602ee6b81a4 100644 --- a/tests/baselines/reference/genericFunctions1.types +++ b/tests/baselines/reference/genericFunctions1.types @@ -10,4 +10,5 @@ var x = foo(5); // 'x' should be number >x : number >foo(5) : number >foo : (x: T) => T +>5 : number diff --git a/tests/baselines/reference/genericFunctions2.symbols b/tests/baselines/reference/genericFunctions2.symbols new file mode 100644 index 00000000000..59068cbd8dd --- /dev/null +++ b/tests/baselines/reference/genericFunctions2.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/genericFunctions2.ts === +declare function map (items: T[], f: (x: T) => U): U[]; +>map : Symbol(map, Decl(genericFunctions2.ts, 0, 0)) +>T : Symbol(T, Decl(genericFunctions2.ts, 0, 22)) +>U : Symbol(U, Decl(genericFunctions2.ts, 0, 24)) +>items : Symbol(items, Decl(genericFunctions2.ts, 0, 30)) +>T : Symbol(T, Decl(genericFunctions2.ts, 0, 22)) +>f : Symbol(f, Decl(genericFunctions2.ts, 0, 41)) +>x : Symbol(x, Decl(genericFunctions2.ts, 0, 46)) +>T : Symbol(T, Decl(genericFunctions2.ts, 0, 22)) +>U : Symbol(U, Decl(genericFunctions2.ts, 0, 24)) +>U : Symbol(U, Decl(genericFunctions2.ts, 0, 24)) + +var myItems: string[]; +>myItems : Symbol(myItems, Decl(genericFunctions2.ts, 2, 3)) + +var lengths = map(myItems, x => x.length); +>lengths : Symbol(lengths, Decl(genericFunctions2.ts, 3, 3)) +>map : Symbol(map, Decl(genericFunctions2.ts, 0, 0)) +>myItems : Symbol(myItems, Decl(genericFunctions2.ts, 2, 3)) +>x : Symbol(x, Decl(genericFunctions2.ts, 3, 26)) +>x.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>x : Symbol(x, Decl(genericFunctions2.ts, 3, 26)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + + diff --git a/tests/baselines/reference/genericFunctions3.symbols b/tests/baselines/reference/genericFunctions3.symbols new file mode 100644 index 00000000000..8b257500325 --- /dev/null +++ b/tests/baselines/reference/genericFunctions3.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/genericFunctions3.ts === +interface Query { +>Query : Symbol(Query, Decl(genericFunctions3.ts, 0, 0)) +>T : Symbol(T, Decl(genericFunctions3.ts, 0, 16)) + + foo(x: string): Query; +>foo : Symbol(foo, Decl(genericFunctions3.ts, 0, 20)) +>x : Symbol(x, Decl(genericFunctions3.ts, 1, 8)) +>Query : Symbol(Query, Decl(genericFunctions3.ts, 0, 0)) +>T : Symbol(T, Decl(genericFunctions3.ts, 0, 16)) +} + +function from(arg: boolean): Query; // was Error: Overload signature is not compatible with function definition. +>from : Symbol(from, Decl(genericFunctions3.ts, 2, 1), Decl(genericFunctions3.ts, 4, 41)) +>T : Symbol(T, Decl(genericFunctions3.ts, 4, 14)) +>arg : Symbol(arg, Decl(genericFunctions3.ts, 4, 17)) +>Query : Symbol(Query, Decl(genericFunctions3.ts, 0, 0)) +>T : Symbol(T, Decl(genericFunctions3.ts, 4, 14)) + +function from(arg: any): Query { +>from : Symbol(from, Decl(genericFunctions3.ts, 2, 1), Decl(genericFunctions3.ts, 4, 41)) +>T : Symbol(T, Decl(genericFunctions3.ts, 5, 14)) +>arg : Symbol(arg, Decl(genericFunctions3.ts, 5, 17)) +>Query : Symbol(Query, Decl(genericFunctions3.ts, 0, 0)) +>T : Symbol(T, Decl(genericFunctions3.ts, 5, 14)) + + return undefined; +>undefined : Symbol(undefined) +} + diff --git a/tests/baselines/reference/genericFunctionsWithOptionalParameters1.symbols b/tests/baselines/reference/genericFunctionsWithOptionalParameters1.symbols new file mode 100644 index 00000000000..fa04763f2ab --- /dev/null +++ b/tests/baselines/reference/genericFunctionsWithOptionalParameters1.symbols @@ -0,0 +1,46 @@ +=== tests/cases/compiler/genericFunctionsWithOptionalParameters1.ts === +interface Utils { +>Utils : Symbol(Utils, Decl(genericFunctionsWithOptionalParameters1.ts, 0, 0)) + + fold(c?: Array, folder?: (s: S, t: T) => T, init?: S): T; +>fold : Symbol(fold, Decl(genericFunctionsWithOptionalParameters1.ts, 0, 17)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters1.ts, 1, 8)) +>S : Symbol(S, Decl(genericFunctionsWithOptionalParameters1.ts, 1, 10)) +>c : Symbol(c, Decl(genericFunctionsWithOptionalParameters1.ts, 1, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters1.ts, 1, 8)) +>folder : Symbol(folder, Decl(genericFunctionsWithOptionalParameters1.ts, 1, 27)) +>s : Symbol(s, Decl(genericFunctionsWithOptionalParameters1.ts, 1, 38)) +>S : Symbol(S, Decl(genericFunctionsWithOptionalParameters1.ts, 1, 10)) +>t : Symbol(t, Decl(genericFunctionsWithOptionalParameters1.ts, 1, 43)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters1.ts, 1, 8)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters1.ts, 1, 8)) +>init : Symbol(init, Decl(genericFunctionsWithOptionalParameters1.ts, 1, 55)) +>S : Symbol(S, Decl(genericFunctionsWithOptionalParameters1.ts, 1, 10)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters1.ts, 1, 8)) +} + +var utils: Utils; +>utils : Symbol(utils, Decl(genericFunctionsWithOptionalParameters1.ts, 4, 3)) +>Utils : Symbol(Utils, Decl(genericFunctionsWithOptionalParameters1.ts, 0, 0)) + +utils.fold(); // no error +>utils.fold : Symbol(Utils.fold, Decl(genericFunctionsWithOptionalParameters1.ts, 0, 17)) +>utils : Symbol(utils, Decl(genericFunctionsWithOptionalParameters1.ts, 4, 3)) +>fold : Symbol(Utils.fold, Decl(genericFunctionsWithOptionalParameters1.ts, 0, 17)) + +utils.fold(null); // no error +>utils.fold : Symbol(Utils.fold, Decl(genericFunctionsWithOptionalParameters1.ts, 0, 17)) +>utils : Symbol(utils, Decl(genericFunctionsWithOptionalParameters1.ts, 4, 3)) +>fold : Symbol(Utils.fold, Decl(genericFunctionsWithOptionalParameters1.ts, 0, 17)) + +utils.fold(null, null); // no error +>utils.fold : Symbol(Utils.fold, Decl(genericFunctionsWithOptionalParameters1.ts, 0, 17)) +>utils : Symbol(utils, Decl(genericFunctionsWithOptionalParameters1.ts, 4, 3)) +>fold : Symbol(Utils.fold, Decl(genericFunctionsWithOptionalParameters1.ts, 0, 17)) + +utils.fold(null, null, null); // no error +>utils.fold : Symbol(Utils.fold, Decl(genericFunctionsWithOptionalParameters1.ts, 0, 17)) +>utils : Symbol(utils, Decl(genericFunctionsWithOptionalParameters1.ts, 4, 3)) +>fold : Symbol(Utils.fold, Decl(genericFunctionsWithOptionalParameters1.ts, 0, 17)) + diff --git a/tests/baselines/reference/genericFunctionsWithOptionalParameters1.types b/tests/baselines/reference/genericFunctionsWithOptionalParameters1.types index 74b8b5e6858..3d5257812ae 100644 --- a/tests/baselines/reference/genericFunctionsWithOptionalParameters1.types +++ b/tests/baselines/reference/genericFunctionsWithOptionalParameters1.types @@ -35,16 +35,22 @@ utils.fold(null); // no error >utils.fold : (c?: T[], folder?: (s: S, t: T) => T, init?: S) => T >utils : Utils >fold : (c?: T[], folder?: (s: S, t: T) => T, init?: S) => T +>null : null utils.fold(null, null); // no error >utils.fold(null, null) : {} >utils.fold : (c?: T[], folder?: (s: S, t: T) => T, init?: S) => T >utils : Utils >fold : (c?: T[], folder?: (s: S, t: T) => T, init?: S) => T +>null : null +>null : null utils.fold(null, null, null); // no error >utils.fold(null, null, null) : {} >utils.fold : (c?: T[], folder?: (s: S, t: T) => T, init?: S) => T >utils : Utils >fold : (c?: T[], folder?: (s: S, t: T) => T, init?: S) => T +>null : null +>null : null +>null : null diff --git a/tests/baselines/reference/genericFunctionsWithOptionalParameters3.symbols b/tests/baselines/reference/genericFunctionsWithOptionalParameters3.symbols new file mode 100644 index 00000000000..2fe7e295a0d --- /dev/null +++ b/tests/baselines/reference/genericFunctionsWithOptionalParameters3.symbols @@ -0,0 +1,95 @@ +=== tests/cases/compiler/genericFunctionsWithOptionalParameters3.ts === +class Collection { +>Collection : Symbol(Collection, Decl(genericFunctionsWithOptionalParameters3.ts, 0, 0)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters3.ts, 0, 17)) + + public add(x: T) { } +>add : Symbol(add, Decl(genericFunctionsWithOptionalParameters3.ts, 0, 21)) +>x : Symbol(x, Decl(genericFunctionsWithOptionalParameters3.ts, 1, 15)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters3.ts, 0, 17)) +} +interface Utils { +>Utils : Symbol(Utils, Decl(genericFunctionsWithOptionalParameters3.ts, 2, 1)) + + fold(c?: Collection, folder?: (s: S, t: T) => T, init?: S): T; +>fold : Symbol(fold, Decl(genericFunctionsWithOptionalParameters3.ts, 3, 17)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 9)) +>S : Symbol(S, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 11)) +>c : Symbol(c, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 15)) +>Collection : Symbol(Collection, Decl(genericFunctionsWithOptionalParameters3.ts, 0, 0)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 9)) +>folder : Symbol(folder, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 33)) +>s : Symbol(s, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 44)) +>S : Symbol(S, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 11)) +>t : Symbol(t, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 49)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 9)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 9)) +>init : Symbol(init, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 61)) +>S : Symbol(S, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 11)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 9)) + + mapReduce(c: Collection, mapper: (x: T) => U, reducer: (y: U) => V): Collection; +>mapReduce : Symbol(mapReduce, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 75)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 14)) +>U : Symbol(U, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 16)) +>V : Symbol(V, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 19)) +>c : Symbol(c, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 23)) +>Collection : Symbol(Collection, Decl(genericFunctionsWithOptionalParameters3.ts, 0, 0)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 14)) +>mapper : Symbol(mapper, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 40)) +>x : Symbol(x, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 50)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 14)) +>U : Symbol(U, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 16)) +>reducer : Symbol(reducer, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 61)) +>y : Symbol(y, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 72)) +>U : Symbol(U, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 16)) +>V : Symbol(V, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 19)) +>Collection : Symbol(Collection, Decl(genericFunctionsWithOptionalParameters3.ts, 0, 0)) +>V : Symbol(V, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 19)) +} +var utils: Utils; +>utils : Symbol(utils, Decl(genericFunctionsWithOptionalParameters3.ts, 7, 3)) +>Utils : Symbol(Utils, Decl(genericFunctionsWithOptionalParameters3.ts, 2, 1)) + +var c = new Collection(); +>c : Symbol(c, Decl(genericFunctionsWithOptionalParameters3.ts, 8, 3)) +>Collection : Symbol(Collection, Decl(genericFunctionsWithOptionalParameters3.ts, 0, 0)) + +var r3 = utils.mapReduce(c, (x) => { return 1 }, (y) => { return new Date() }); +>r3 : Symbol(r3, Decl(genericFunctionsWithOptionalParameters3.ts, 9, 3)) +>utils.mapReduce : Symbol(Utils.mapReduce, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 75)) +>utils : Symbol(utils, Decl(genericFunctionsWithOptionalParameters3.ts, 7, 3)) +>mapReduce : Symbol(Utils.mapReduce, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 75)) +>c : Symbol(c, Decl(genericFunctionsWithOptionalParameters3.ts, 8, 3)) +>x : Symbol(x, Decl(genericFunctionsWithOptionalParameters3.ts, 9, 29)) +>y : Symbol(y, Decl(genericFunctionsWithOptionalParameters3.ts, 9, 50)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var r4 = utils.mapReduce(c, (x: string) => { return 1 }, (y: number) => { return new Date() }); +>r4 : Symbol(r4, Decl(genericFunctionsWithOptionalParameters3.ts, 10, 3)) +>utils.mapReduce : Symbol(Utils.mapReduce, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 75)) +>utils : Symbol(utils, Decl(genericFunctionsWithOptionalParameters3.ts, 7, 3)) +>mapReduce : Symbol(Utils.mapReduce, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 75)) +>c : Symbol(c, Decl(genericFunctionsWithOptionalParameters3.ts, 8, 3)) +>x : Symbol(x, Decl(genericFunctionsWithOptionalParameters3.ts, 10, 29)) +>y : Symbol(y, Decl(genericFunctionsWithOptionalParameters3.ts, 10, 58)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var f1 = (x: string) => { return 1 }; +>f1 : Symbol(f1, Decl(genericFunctionsWithOptionalParameters3.ts, 11, 3)) +>x : Symbol(x, Decl(genericFunctionsWithOptionalParameters3.ts, 11, 10)) + +var f2 = (y: number) => { return new Date() }; +>f2 : Symbol(f2, Decl(genericFunctionsWithOptionalParameters3.ts, 12, 3)) +>y : Symbol(y, Decl(genericFunctionsWithOptionalParameters3.ts, 12, 10)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var r5 = utils.mapReduce(c, f1, f2); +>r5 : Symbol(r5, Decl(genericFunctionsWithOptionalParameters3.ts, 13, 3)) +>utils.mapReduce : Symbol(Utils.mapReduce, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 75)) +>utils : Symbol(utils, Decl(genericFunctionsWithOptionalParameters3.ts, 7, 3)) +>mapReduce : Symbol(Utils.mapReduce, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 75)) +>c : Symbol(c, Decl(genericFunctionsWithOptionalParameters3.ts, 8, 3)) +>f1 : Symbol(f1, Decl(genericFunctionsWithOptionalParameters3.ts, 11, 3)) +>f2 : Symbol(f2, Decl(genericFunctionsWithOptionalParameters3.ts, 12, 3)) + diff --git a/tests/baselines/reference/genericFunctionsWithOptionalParameters3.types b/tests/baselines/reference/genericFunctionsWithOptionalParameters3.types index fbb4780274f..627181e5d05 100644 --- a/tests/baselines/reference/genericFunctionsWithOptionalParameters3.types +++ b/tests/baselines/reference/genericFunctionsWithOptionalParameters3.types @@ -65,6 +65,7 @@ var r3 = utils.mapReduce(c, (x) => { return 1 }, (y) => { return new Date() }); >c : Collection >(x) => { return 1 } : (x: string) => number >x : string +>1 : number >(y) => { return new Date() } : (y: number) => Date >y : number >new Date() : Date @@ -79,6 +80,7 @@ var r4 = utils.mapReduce(c, (x: string) => { return 1 }, (y: number) => { return >c : Collection >(x: string) => { return 1 } : (x: string) => number >x : string +>1 : number >(y: number) => { return new Date() } : (y: number) => Date >y : number >new Date() : Date @@ -88,6 +90,7 @@ var f1 = (x: string) => { return 1 }; >f1 : (x: string) => number >(x: string) => { return 1 } : (x: string) => number >x : string +>1 : number var f2 = (y: number) => { return new Date() }; >f2 : (y: number) => Date diff --git a/tests/baselines/reference/genericImplements.symbols b/tests/baselines/reference/genericImplements.symbols new file mode 100644 index 00000000000..b3bffdc1b6d --- /dev/null +++ b/tests/baselines/reference/genericImplements.symbols @@ -0,0 +1,60 @@ +=== tests/cases/compiler/genericImplements.ts === +class A { a; }; +>A : Symbol(A, Decl(genericImplements.ts, 0, 0)) +>a : Symbol(a, Decl(genericImplements.ts, 0, 9)) + +class B { b; }; +>B : Symbol(B, Decl(genericImplements.ts, 0, 15)) +>b : Symbol(b, Decl(genericImplements.ts, 1, 9)) + +interface I { +>I : Symbol(I, Decl(genericImplements.ts, 1, 15)) + + f(): T; +>f : Symbol(f, Decl(genericImplements.ts, 2, 13)) +>T : Symbol(T, Decl(genericImplements.ts, 3, 6)) +>A : Symbol(A, Decl(genericImplements.ts, 0, 0)) +>T : Symbol(T, Decl(genericImplements.ts, 3, 6)) + +} // { f: () => { a; } } + +// OK +class X implements I { +>X : Symbol(X, Decl(genericImplements.ts, 4, 1)) +>I : Symbol(I, Decl(genericImplements.ts, 1, 15)) + + f(): T { return undefined; } +>f : Symbol(f, Decl(genericImplements.ts, 7, 22)) +>T : Symbol(T, Decl(genericImplements.ts, 8, 6)) +>B : Symbol(B, Decl(genericImplements.ts, 0, 15)) +>T : Symbol(T, Decl(genericImplements.ts, 8, 6)) +>undefined : Symbol(undefined) + +} // { f: () => { b; } } + +// OK +class Y implements I { +>Y : Symbol(Y, Decl(genericImplements.ts, 9, 1)) +>I : Symbol(I, Decl(genericImplements.ts, 1, 15)) + + f(): T { return undefined; } +>f : Symbol(f, Decl(genericImplements.ts, 12, 22)) +>T : Symbol(T, Decl(genericImplements.ts, 13, 6)) +>A : Symbol(A, Decl(genericImplements.ts, 0, 0)) +>T : Symbol(T, Decl(genericImplements.ts, 13, 6)) +>undefined : Symbol(undefined) + +} // { f: () => { a; } } + +// OK +class Z implements I { +>Z : Symbol(Z, Decl(genericImplements.ts, 14, 1)) +>I : Symbol(I, Decl(genericImplements.ts, 1, 15)) + + f(): T { return undefined; } +>f : Symbol(f, Decl(genericImplements.ts, 17, 22)) +>T : Symbol(T, Decl(genericImplements.ts, 18, 6)) +>T : Symbol(T, Decl(genericImplements.ts, 18, 6)) +>undefined : Symbol(undefined) + +} // { f: () => T } diff --git a/tests/baselines/reference/genericInference1.symbols b/tests/baselines/reference/genericInference1.symbols new file mode 100644 index 00000000000..6980668c6eb --- /dev/null +++ b/tests/baselines/reference/genericInference1.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/genericInference1.ts === +['a', 'b', 'c'].map(x => x.length); +>['a', 'b', 'c'].map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>x : Symbol(x, Decl(genericInference1.ts, 0, 20)) +>x.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>x : Symbol(x, Decl(genericInference1.ts, 0, 20)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + diff --git a/tests/baselines/reference/genericInference1.types b/tests/baselines/reference/genericInference1.types index f83a1dcd361..eeed8aa9f3e 100644 --- a/tests/baselines/reference/genericInference1.types +++ b/tests/baselines/reference/genericInference1.types @@ -3,6 +3,9 @@ >['a', 'b', 'c'].map(x => x.length) : number[] >['a', 'b', 'c'].map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] >['a', 'b', 'c'] : string[] +>'a' : string +>'b' : string +>'c' : string >map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] >x => x.length : (x: string) => number >x : string diff --git a/tests/baselines/reference/genericInference2.symbols b/tests/baselines/reference/genericInference2.symbols new file mode 100644 index 00000000000..83b371005f7 --- /dev/null +++ b/tests/baselines/reference/genericInference2.symbols @@ -0,0 +1,93 @@ +=== tests/cases/compiler/genericInference2.ts === + declare module ko { +>ko : Symbol(ko, Decl(genericInference2.ts, 0, 0)) + + export interface Observable { +>Observable : Symbol(Observable, Decl(genericInference2.ts, 0, 23)) +>T : Symbol(T, Decl(genericInference2.ts, 1, 35)) + + (): T; +>T : Symbol(T, Decl(genericInference2.ts, 1, 35)) + + (value: T): any; +>value : Symbol(value, Decl(genericInference2.ts, 3, 12)) +>T : Symbol(T, Decl(genericInference2.ts, 1, 35)) + + N: number; +>N : Symbol(N, Decl(genericInference2.ts, 3, 27)) + + g: boolean; +>g : Symbol(g, Decl(genericInference2.ts, 4, 21)) + + r: T; +>r : Symbol(r, Decl(genericInference2.ts, 5, 22)) +>T : Symbol(T, Decl(genericInference2.ts, 1, 35)) + } + export function observable(value: T): Observable; +>observable : Symbol(observable, Decl(genericInference2.ts, 7, 8)) +>T : Symbol(T, Decl(genericInference2.ts, 8, 34)) +>value : Symbol(value, Decl(genericInference2.ts, 8, 37)) +>T : Symbol(T, Decl(genericInference2.ts, 8, 34)) +>Observable : Symbol(Observable, Decl(genericInference2.ts, 0, 23)) +>T : Symbol(T, Decl(genericInference2.ts, 8, 34)) + } + var o = { +>o : Symbol(o, Decl(genericInference2.ts, 10, 7)) + + name: ko.observable("Bob"), +>name : Symbol(name, Decl(genericInference2.ts, 10, 13)) +>ko.observable : Symbol(ko.observable, Decl(genericInference2.ts, 7, 8)) +>ko : Symbol(ko, Decl(genericInference2.ts, 0, 0)) +>observable : Symbol(ko.observable, Decl(genericInference2.ts, 7, 8)) + + age: ko.observable(37) +>age : Symbol(age, Decl(genericInference2.ts, 11, 34)) +>ko.observable : Symbol(ko.observable, Decl(genericInference2.ts, 7, 8)) +>ko : Symbol(ko, Decl(genericInference2.ts, 0, 0)) +>observable : Symbol(ko.observable, Decl(genericInference2.ts, 7, 8)) + + }; + var x_v = o.name().length; // should be 'number' +>x_v : Symbol(x_v, Decl(genericInference2.ts, 14, 7)) +>o.name().length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>o.name : Symbol(name, Decl(genericInference2.ts, 10, 13)) +>o : Symbol(o, Decl(genericInference2.ts, 10, 7)) +>name : Symbol(name, Decl(genericInference2.ts, 10, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + + var age_v = o.age(); // should be 'number' +>age_v : Symbol(age_v, Decl(genericInference2.ts, 15, 7)) +>o.age : Symbol(age, Decl(genericInference2.ts, 11, 34)) +>o : Symbol(o, Decl(genericInference2.ts, 10, 7)) +>age : Symbol(age, Decl(genericInference2.ts, 11, 34)) + + var name_v = o.name("Robert"); // should be 'any' +>name_v : Symbol(name_v, Decl(genericInference2.ts, 16, 7)) +>o.name : Symbol(name, Decl(genericInference2.ts, 10, 13)) +>o : Symbol(o, Decl(genericInference2.ts, 10, 7)) +>name : Symbol(name, Decl(genericInference2.ts, 10, 13)) + + var zz_v = o.name.N; // should be 'number' +>zz_v : Symbol(zz_v, Decl(genericInference2.ts, 17, 7)) +>o.name.N : Symbol(ko.Observable.N, Decl(genericInference2.ts, 3, 27)) +>o.name : Symbol(name, Decl(genericInference2.ts, 10, 13)) +>o : Symbol(o, Decl(genericInference2.ts, 10, 7)) +>name : Symbol(name, Decl(genericInference2.ts, 10, 13)) +>N : Symbol(ko.Observable.N, Decl(genericInference2.ts, 3, 27)) + + var yy_v = o.name.g; // should be 'boolean' +>yy_v : Symbol(yy_v, Decl(genericInference2.ts, 18, 7)) +>o.name.g : Symbol(ko.Observable.g, Decl(genericInference2.ts, 4, 21)) +>o.name : Symbol(name, Decl(genericInference2.ts, 10, 13)) +>o : Symbol(o, Decl(genericInference2.ts, 10, 7)) +>name : Symbol(name, Decl(genericInference2.ts, 10, 13)) +>g : Symbol(ko.Observable.g, Decl(genericInference2.ts, 4, 21)) + + var rr_v = o.name.r; // should be 'string' +>rr_v : Symbol(rr_v, Decl(genericInference2.ts, 19, 7)) +>o.name.r : Symbol(ko.Observable.r, Decl(genericInference2.ts, 5, 22)) +>o.name : Symbol(name, Decl(genericInference2.ts, 10, 13)) +>o : Symbol(o, Decl(genericInference2.ts, 10, 7)) +>name : Symbol(name, Decl(genericInference2.ts, 10, 13)) +>r : Symbol(ko.Observable.r, Decl(genericInference2.ts, 5, 22)) + diff --git a/tests/baselines/reference/genericInference2.types b/tests/baselines/reference/genericInference2.types index 2616c0de2c4..e5c7052b0db 100644 --- a/tests/baselines/reference/genericInference2.types +++ b/tests/baselines/reference/genericInference2.types @@ -41,6 +41,7 @@ >ko.observable : (value: T) => ko.Observable >ko : typeof ko >observable : (value: T) => ko.Observable +>"Bob" : string age: ko.observable(37) >age : ko.Observable @@ -48,6 +49,7 @@ >ko.observable : (value: T) => ko.Observable >ko : typeof ko >observable : (value: T) => ko.Observable +>37 : number }; var x_v = o.name().length; // should be 'number' @@ -72,6 +74,7 @@ >o.name : ko.Observable >o : { name: ko.Observable; age: ko.Observable; } >name : ko.Observable +>"Robert" : string var zz_v = o.name.N; // should be 'number' >zz_v : number diff --git a/tests/baselines/reference/genericInstanceOf.symbols b/tests/baselines/reference/genericInstanceOf.symbols new file mode 100644 index 00000000000..c1636724892 --- /dev/null +++ b/tests/baselines/reference/genericInstanceOf.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/genericInstanceOf.ts === +interface F { +>F : Symbol(F, Decl(genericInstanceOf.ts, 0, 0)) + + (): number; +} + +class C { +>C : Symbol(C, Decl(genericInstanceOf.ts, 2, 1)) +>T : Symbol(T, Decl(genericInstanceOf.ts, 4, 8)) + + constructor(public a: T, public b: F) {} +>a : Symbol(a, Decl(genericInstanceOf.ts, 5, 16)) +>T : Symbol(T, Decl(genericInstanceOf.ts, 4, 8)) +>b : Symbol(b, Decl(genericInstanceOf.ts, 5, 28)) +>F : Symbol(F, Decl(genericInstanceOf.ts, 0, 0)) + + foo() { +>foo : Symbol(foo, Decl(genericInstanceOf.ts, 5, 44)) + + if (this.a instanceof this.b) { +>this.a : Symbol(a, Decl(genericInstanceOf.ts, 5, 16)) +>this : Symbol(C, Decl(genericInstanceOf.ts, 2, 1)) +>a : Symbol(a, Decl(genericInstanceOf.ts, 5, 16)) +>this.b : Symbol(b, Decl(genericInstanceOf.ts, 5, 28)) +>this : Symbol(C, Decl(genericInstanceOf.ts, 2, 1)) +>b : Symbol(b, Decl(genericInstanceOf.ts, 5, 28)) + } + } +} diff --git a/tests/baselines/reference/genericInstantiationEquivalentToObjectLiteral.symbols b/tests/baselines/reference/genericInstantiationEquivalentToObjectLiteral.symbols new file mode 100644 index 00000000000..51579bad2d5 --- /dev/null +++ b/tests/baselines/reference/genericInstantiationEquivalentToObjectLiteral.symbols @@ -0,0 +1,62 @@ +=== tests/cases/conformance/types/namedTypes/genericInstantiationEquivalentToObjectLiteral.ts === +interface Pair { first: T1; second: T2; } +>Pair : Symbol(Pair, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 0, 0)) +>T1 : Symbol(T1, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 0, 15)) +>T2 : Symbol(T2, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 0, 18)) +>first : Symbol(first, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 0, 24)) +>T1 : Symbol(T1, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 0, 15)) +>second : Symbol(second, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 0, 35)) +>T2 : Symbol(T2, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 0, 18)) + +var x: Pair +>x : Symbol(x, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 1, 3)) +>Pair : Symbol(Pair, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 0, 0)) + +var y: { first: string; second: number; } +>y : Symbol(y, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 2, 3)) +>first : Symbol(first, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 2, 8)) +>second : Symbol(second, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 2, 23)) + +x = y; +>x : Symbol(x, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 1, 3)) +>y : Symbol(y, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 2, 3)) + +y = x; +>y : Symbol(y, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 2, 3)) +>x : Symbol(x, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 1, 3)) + +declare function f(x: Pair); +>f : Symbol(f, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 5, 6)) +>T : Symbol(T, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 7, 19)) +>U : Symbol(U, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 7, 21)) +>x : Symbol(x, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 7, 25)) +>Pair : Symbol(Pair, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 0, 0)) +>T : Symbol(T, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 7, 19)) +>U : Symbol(U, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 7, 21)) + +declare function f2(x: { first: T; second: U; }); +>f2 : Symbol(f2, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 7, 40)) +>T : Symbol(T, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 8, 20)) +>U : Symbol(U, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 8, 22)) +>x : Symbol(x, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 8, 26)) +>first : Symbol(first, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 8, 30)) +>T : Symbol(T, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 8, 20)) +>second : Symbol(second, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 8, 40)) +>U : Symbol(U, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 8, 22)) + +f(x); +>f : Symbol(f, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 5, 6)) +>x : Symbol(x, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 1, 3)) + +f(y); +>f : Symbol(f, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 5, 6)) +>y : Symbol(y, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 2, 3)) + +f2(x); +>f2 : Symbol(f2, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 7, 40)) +>x : Symbol(x, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 1, 3)) + +f2(y); +>f2 : Symbol(f2, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 7, 40)) +>y : Symbol(y, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 2, 3)) + diff --git a/tests/baselines/reference/genericInterfaceFunctionTypeParameter.symbols b/tests/baselines/reference/genericInterfaceFunctionTypeParameter.symbols new file mode 100644 index 00000000000..b204a252a10 --- /dev/null +++ b/tests/baselines/reference/genericInterfaceFunctionTypeParameter.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/genericInterfaceFunctionTypeParameter.ts === +export interface IFoo { } +>IFoo : Symbol(IFoo, Decl(genericInterfaceFunctionTypeParameter.ts, 0, 0)) +>A : Symbol(A, Decl(genericInterfaceFunctionTypeParameter.ts, 0, 22)) + +export function foo(fn: (ifoo: IFoo) => void) { +>foo : Symbol(foo, Decl(genericInterfaceFunctionTypeParameter.ts, 0, 28)) +>A : Symbol(A, Decl(genericInterfaceFunctionTypeParameter.ts, 1, 20)) +>fn : Symbol(fn, Decl(genericInterfaceFunctionTypeParameter.ts, 1, 23)) +>ifoo : Symbol(ifoo, Decl(genericInterfaceFunctionTypeParameter.ts, 1, 28)) +>IFoo : Symbol(IFoo, Decl(genericInterfaceFunctionTypeParameter.ts, 0, 0)) +>A : Symbol(A, Decl(genericInterfaceFunctionTypeParameter.ts, 1, 20)) + + foo(fn); // Invocation is necessary to repro (!) +>foo : Symbol(foo, Decl(genericInterfaceFunctionTypeParameter.ts, 0, 28)) +>fn : Symbol(fn, Decl(genericInterfaceFunctionTypeParameter.ts, 1, 23)) +} + + + diff --git a/tests/baselines/reference/genericInterfaceImplementation.symbols b/tests/baselines/reference/genericInterfaceImplementation.symbols new file mode 100644 index 00000000000..5816396081f --- /dev/null +++ b/tests/baselines/reference/genericInterfaceImplementation.symbols @@ -0,0 +1,41 @@ +=== tests/cases/compiler/genericInterfaceImplementation.ts === +interface IOption { +>IOption : Symbol(IOption, Decl(genericInterfaceImplementation.ts, 0, 0)) +>A : Symbol(A, Decl(genericInterfaceImplementation.ts, 0, 18)) + + get(): A; +>get : Symbol(get, Decl(genericInterfaceImplementation.ts, 0, 22)) +>A : Symbol(A, Decl(genericInterfaceImplementation.ts, 0, 18)) + + flatten(): IOption; +>flatten : Symbol(flatten, Decl(genericInterfaceImplementation.ts, 1, 13)) +>B : Symbol(B, Decl(genericInterfaceImplementation.ts, 3, 12)) +>IOption : Symbol(IOption, Decl(genericInterfaceImplementation.ts, 0, 0)) +>B : Symbol(B, Decl(genericInterfaceImplementation.ts, 3, 12)) +} + +class None implements IOption{ +>None : Symbol(None, Decl(genericInterfaceImplementation.ts, 4, 1)) +>T : Symbol(T, Decl(genericInterfaceImplementation.ts, 6, 11)) +>IOption : Symbol(IOption, Decl(genericInterfaceImplementation.ts, 0, 0)) +>T : Symbol(T, Decl(genericInterfaceImplementation.ts, 6, 11)) + + get(): T { +>get : Symbol(get, Decl(genericInterfaceImplementation.ts, 6, 36)) +>T : Symbol(T, Decl(genericInterfaceImplementation.ts, 6, 11)) + + throw null; + } + + flatten() : IOption { +>flatten : Symbol(flatten, Decl(genericInterfaceImplementation.ts, 9, 5)) +>U : Symbol(U, Decl(genericInterfaceImplementation.ts, 11, 12)) +>IOption : Symbol(IOption, Decl(genericInterfaceImplementation.ts, 0, 0)) +>U : Symbol(U, Decl(genericInterfaceImplementation.ts, 11, 12)) + + return new None(); +>None : Symbol(None, Decl(genericInterfaceImplementation.ts, 4, 1)) +>U : Symbol(U, Decl(genericInterfaceImplementation.ts, 11, 12)) + } +} + diff --git a/tests/baselines/reference/genericInterfaceImplementation.types b/tests/baselines/reference/genericInterfaceImplementation.types index b075864634c..d7ca48c36c0 100644 --- a/tests/baselines/reference/genericInterfaceImplementation.types +++ b/tests/baselines/reference/genericInterfaceImplementation.types @@ -25,6 +25,7 @@ class None implements IOption{ >T : T throw null; +>null : null } flatten() : IOption { diff --git a/tests/baselines/reference/genericInterfaceTypeCall.symbols b/tests/baselines/reference/genericInterfaceTypeCall.symbols new file mode 100644 index 00000000000..e28ce8f8d80 --- /dev/null +++ b/tests/baselines/reference/genericInterfaceTypeCall.symbols @@ -0,0 +1,54 @@ +=== tests/cases/compiler/genericInterfaceTypeCall.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(genericInterfaceTypeCall.ts, 0, 0)) +>T : Symbol(T, Decl(genericInterfaceTypeCall.ts, 0, 14)) + + reject(arg: T): void; +>reject : Symbol(reject, Decl(genericInterfaceTypeCall.ts, 0, 18)) +>arg : Symbol(arg, Decl(genericInterfaceTypeCall.ts, 1, 11)) +>T : Symbol(T, Decl(genericInterfaceTypeCall.ts, 0, 14)) +} +var foo: Foo +>foo : Symbol(foo, Decl(genericInterfaceTypeCall.ts, 3, 3)) +>Foo : Symbol(Foo, Decl(genericInterfaceTypeCall.ts, 0, 0)) + +interface bar { +>bar : Symbol(bar, Decl(genericInterfaceTypeCall.ts, 3, 20)) +>T : Symbol(T, Decl(genericInterfaceTypeCall.ts, 5, 14)) + + fail(func: (arg: T) => void ): void; +>fail : Symbol(fail, Decl(genericInterfaceTypeCall.ts, 5, 18)) +>func : Symbol(func, Decl(genericInterfaceTypeCall.ts, 6, 9)) +>arg : Symbol(arg, Decl(genericInterfaceTypeCall.ts, 6, 16)) +>T : Symbol(T, Decl(genericInterfaceTypeCall.ts, 5, 14)) + + fail2(func2: { (arg: T): void; }): void; +>fail2 : Symbol(fail2, Decl(genericInterfaceTypeCall.ts, 6, 40)) +>func2 : Symbol(func2, Decl(genericInterfaceTypeCall.ts, 7, 10)) +>arg : Symbol(arg, Decl(genericInterfaceTypeCall.ts, 7, 20)) +>T : Symbol(T, Decl(genericInterfaceTypeCall.ts, 5, 14)) +} +var test: bar; +>test : Symbol(test, Decl(genericInterfaceTypeCall.ts, 9, 3)) +>bar : Symbol(bar, Decl(genericInterfaceTypeCall.ts, 3, 20)) + +test.fail(arg => foo.reject(arg)); +>test.fail : Symbol(bar.fail, Decl(genericInterfaceTypeCall.ts, 5, 18)) +>test : Symbol(test, Decl(genericInterfaceTypeCall.ts, 9, 3)) +>fail : Symbol(bar.fail, Decl(genericInterfaceTypeCall.ts, 5, 18)) +>arg : Symbol(arg, Decl(genericInterfaceTypeCall.ts, 11, 10)) +>foo.reject : Symbol(Foo.reject, Decl(genericInterfaceTypeCall.ts, 0, 18)) +>foo : Symbol(foo, Decl(genericInterfaceTypeCall.ts, 3, 3)) +>reject : Symbol(Foo.reject, Decl(genericInterfaceTypeCall.ts, 0, 18)) +>arg : Symbol(arg, Decl(genericInterfaceTypeCall.ts, 11, 10)) + +test.fail2(arg => foo.reject(arg)); // Error: Supplied parameters do not match any signature of call target +>test.fail2 : Symbol(bar.fail2, Decl(genericInterfaceTypeCall.ts, 6, 40)) +>test : Symbol(test, Decl(genericInterfaceTypeCall.ts, 9, 3)) +>fail2 : Symbol(bar.fail2, Decl(genericInterfaceTypeCall.ts, 6, 40)) +>arg : Symbol(arg, Decl(genericInterfaceTypeCall.ts, 12, 11)) +>foo.reject : Symbol(Foo.reject, Decl(genericInterfaceTypeCall.ts, 0, 18)) +>foo : Symbol(foo, Decl(genericInterfaceTypeCall.ts, 3, 3)) +>reject : Symbol(Foo.reject, Decl(genericInterfaceTypeCall.ts, 0, 18)) +>arg : Symbol(arg, Decl(genericInterfaceTypeCall.ts, 12, 11)) + diff --git a/tests/baselines/reference/genericMethodOverspecialization.symbols b/tests/baselines/reference/genericMethodOverspecialization.symbols new file mode 100644 index 00000000000..651aced0fcd --- /dev/null +++ b/tests/baselines/reference/genericMethodOverspecialization.symbols @@ -0,0 +1,72 @@ +=== tests/cases/compiler/genericMethodOverspecialization.ts === +var names = ["list", "table1", "table2", "table3", "summary"]; +>names : Symbol(names, Decl(genericMethodOverspecialization.ts, 0, 3)) + +interface HTMLElement { +>HTMLElement : Symbol(HTMLElement, Decl(genericMethodOverspecialization.ts, 0, 62)) + + clientWidth: number; +>clientWidth : Symbol(clientWidth, Decl(genericMethodOverspecialization.ts, 2, 23)) + + isDisabled: boolean; +>isDisabled : Symbol(isDisabled, Decl(genericMethodOverspecialization.ts, 3, 24)) +} + +declare var document: Document; +>document : Symbol(document, Decl(genericMethodOverspecialization.ts, 7, 11)) +>Document : Symbol(Document, Decl(genericMethodOverspecialization.ts, 7, 31)) + +interface Document { +>Document : Symbol(Document, Decl(genericMethodOverspecialization.ts, 7, 31)) + + getElementById(elementId: string): HTMLElement; +>getElementById : Symbol(getElementById, Decl(genericMethodOverspecialization.ts, 8, 20)) +>elementId : Symbol(elementId, Decl(genericMethodOverspecialization.ts, 9, 19)) +>HTMLElement : Symbol(HTMLElement, Decl(genericMethodOverspecialization.ts, 0, 62)) +} + +var elements = names.map(function (name) { +>elements : Symbol(elements, Decl(genericMethodOverspecialization.ts, 12, 3)) +>names.map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>names : Symbol(names, Decl(genericMethodOverspecialization.ts, 0, 3)) +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>name : Symbol(name, Decl(genericMethodOverspecialization.ts, 12, 35)) + + return document.getElementById(name); +>document.getElementById : Symbol(Document.getElementById, Decl(genericMethodOverspecialization.ts, 8, 20)) +>document : Symbol(document, Decl(genericMethodOverspecialization.ts, 7, 11)) +>getElementById : Symbol(Document.getElementById, Decl(genericMethodOverspecialization.ts, 8, 20)) +>name : Symbol(name, Decl(genericMethodOverspecialization.ts, 12, 35)) + +}); + + +var xxx = elements.filter(function (e) { +>xxx : Symbol(xxx, Decl(genericMethodOverspecialization.ts, 17, 3)) +>elements.filter : Symbol(Array.filter, Decl(lib.d.ts, 1122, 87)) +>elements : Symbol(elements, Decl(genericMethodOverspecialization.ts, 12, 3)) +>filter : Symbol(Array.filter, Decl(lib.d.ts, 1122, 87)) +>e : Symbol(e, Decl(genericMethodOverspecialization.ts, 17, 36)) + + return !e.isDisabled; +>e.isDisabled : Symbol(HTMLElement.isDisabled, Decl(genericMethodOverspecialization.ts, 3, 24)) +>e : Symbol(e, Decl(genericMethodOverspecialization.ts, 17, 36)) +>isDisabled : Symbol(HTMLElement.isDisabled, Decl(genericMethodOverspecialization.ts, 3, 24)) + +}); + +var widths:number[] = elements.map(function (e) { // should not error +>widths : Symbol(widths, Decl(genericMethodOverspecialization.ts, 21, 3)) +>elements.map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>elements : Symbol(elements, Decl(genericMethodOverspecialization.ts, 12, 3)) +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>e : Symbol(e, Decl(genericMethodOverspecialization.ts, 21, 45)) + + return e.clientWidth; +>e.clientWidth : Symbol(HTMLElement.clientWidth, Decl(genericMethodOverspecialization.ts, 2, 23)) +>e : Symbol(e, Decl(genericMethodOverspecialization.ts, 21, 45)) +>clientWidth : Symbol(HTMLElement.clientWidth, Decl(genericMethodOverspecialization.ts, 2, 23)) + +}); + + diff --git a/tests/baselines/reference/genericMethodOverspecialization.types b/tests/baselines/reference/genericMethodOverspecialization.types index 145a7b33381..0ad302da94e 100644 --- a/tests/baselines/reference/genericMethodOverspecialization.types +++ b/tests/baselines/reference/genericMethodOverspecialization.types @@ -2,6 +2,11 @@ var names = ["list", "table1", "table2", "table3", "summary"]; >names : string[] >["list", "table1", "table2", "table3", "summary"] : string[] +>"list" : string +>"table1" : string +>"table2" : string +>"table3" : string +>"summary" : string interface HTMLElement { >HTMLElement : HTMLElement diff --git a/tests/baselines/reference/genericObjectLitReturnType.symbols b/tests/baselines/reference/genericObjectLitReturnType.symbols new file mode 100644 index 00000000000..f3253bdf810 --- /dev/null +++ b/tests/baselines/reference/genericObjectLitReturnType.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/genericObjectLitReturnType.ts === +class X +>X : Symbol(X, Decl(genericObjectLitReturnType.ts, 0, 0)) +>T : Symbol(T, Decl(genericObjectLitReturnType.ts, 0, 8)) +{ + f(t: T) { return { a: t }; } +>f : Symbol(f, Decl(genericObjectLitReturnType.ts, 1, 1)) +>t : Symbol(t, Decl(genericObjectLitReturnType.ts, 2, 6)) +>T : Symbol(T, Decl(genericObjectLitReturnType.ts, 0, 8)) +>a : Symbol(a, Decl(genericObjectLitReturnType.ts, 2, 22)) +>t : Symbol(t, Decl(genericObjectLitReturnType.ts, 2, 6)) +} + + +var x: X; +>x : Symbol(x, Decl(genericObjectLitReturnType.ts, 6, 3)) +>X : Symbol(X, Decl(genericObjectLitReturnType.ts, 0, 0)) + +var t1 = x.f(5); +>t1 : Symbol(t1, Decl(genericObjectLitReturnType.ts, 7, 3)) +>x.f : Symbol(X.f, Decl(genericObjectLitReturnType.ts, 1, 1)) +>x : Symbol(x, Decl(genericObjectLitReturnType.ts, 6, 3)) +>f : Symbol(X.f, Decl(genericObjectLitReturnType.ts, 1, 1)) + +t1.a = 5; // Should not error: t1 should have type {a: number}, instead has type {a: T} +>t1.a : Symbol(a, Decl(genericObjectLitReturnType.ts, 2, 22)) +>t1 : Symbol(t1, Decl(genericObjectLitReturnType.ts, 7, 3)) +>a : Symbol(a, Decl(genericObjectLitReturnType.ts, 2, 22)) + + diff --git a/tests/baselines/reference/genericObjectLitReturnType.types b/tests/baselines/reference/genericObjectLitReturnType.types index 3ecb5706689..6bdc352cbc7 100644 --- a/tests/baselines/reference/genericObjectLitReturnType.types +++ b/tests/baselines/reference/genericObjectLitReturnType.types @@ -23,11 +23,13 @@ var t1 = x.f(5); >x.f : (t: number) => { a: number; } >x : X >f : (t: number) => { a: number; } +>5 : number t1.a = 5; // Should not error: t1 should have type {a: number}, instead has type {a: T} >t1.a = 5 : number >t1.a : number >t1 : { a: number; } >a : number +>5 : number diff --git a/tests/baselines/reference/genericOfACloduleType1.symbols b/tests/baselines/reference/genericOfACloduleType1.symbols new file mode 100644 index 00000000000..b2bb95a8ef1 --- /dev/null +++ b/tests/baselines/reference/genericOfACloduleType1.symbols @@ -0,0 +1,42 @@ +=== tests/cases/compiler/genericOfACloduleType1.ts === +class G{ bar(x: T) { return x; } } +>G : Symbol(G, Decl(genericOfACloduleType1.ts, 0, 0)) +>T : Symbol(T, Decl(genericOfACloduleType1.ts, 0, 8)) +>bar : Symbol(bar, Decl(genericOfACloduleType1.ts, 0, 11)) +>x : Symbol(x, Decl(genericOfACloduleType1.ts, 0, 16)) +>T : Symbol(T, Decl(genericOfACloduleType1.ts, 0, 8)) +>x : Symbol(x, Decl(genericOfACloduleType1.ts, 0, 16)) + +module M { +>M : Symbol(M, Decl(genericOfACloduleType1.ts, 0, 37)) + + export class C { foo() { } } +>C : Symbol(C, Decl(genericOfACloduleType1.ts, 1, 10), Decl(genericOfACloduleType1.ts, 2, 32)) +>foo : Symbol(foo, Decl(genericOfACloduleType1.ts, 2, 20)) + + export module C { +>C : Symbol(C, Decl(genericOfACloduleType1.ts, 1, 10), Decl(genericOfACloduleType1.ts, 2, 32)) + + export class X { +>X : Symbol(X, Decl(genericOfACloduleType1.ts, 3, 21)) + } + } + + var g1 = new G(); +>g1 : Symbol(g1, Decl(genericOfACloduleType1.ts, 8, 7)) +>G : Symbol(G, Decl(genericOfACloduleType1.ts, 0, 0)) +>C : Symbol(C, Decl(genericOfACloduleType1.ts, 1, 10), Decl(genericOfACloduleType1.ts, 2, 32)) + + g1.bar(null).foo(); +>g1.bar(null).foo : Symbol(C.foo, Decl(genericOfACloduleType1.ts, 2, 20)) +>g1.bar : Symbol(G.bar, Decl(genericOfACloduleType1.ts, 0, 11)) +>g1 : Symbol(g1, Decl(genericOfACloduleType1.ts, 8, 7)) +>bar : Symbol(G.bar, Decl(genericOfACloduleType1.ts, 0, 11)) +>foo : Symbol(C.foo, Decl(genericOfACloduleType1.ts, 2, 20)) +} +var g2 = new G() // was: error Type reference cannot refer to container 'M.C'. +>g2 : Symbol(g2, Decl(genericOfACloduleType1.ts, 11, 3)) +>G : Symbol(G, Decl(genericOfACloduleType1.ts, 0, 0)) +>M : Symbol(M, Decl(genericOfACloduleType1.ts, 0, 37)) +>C : Symbol(M.C, Decl(genericOfACloduleType1.ts, 1, 10), Decl(genericOfACloduleType1.ts, 2, 32)) + diff --git a/tests/baselines/reference/genericOfACloduleType1.types b/tests/baselines/reference/genericOfACloduleType1.types index afbef2f4180..5c19b5f9569 100644 --- a/tests/baselines/reference/genericOfACloduleType1.types +++ b/tests/baselines/reference/genericOfACloduleType1.types @@ -35,12 +35,13 @@ module M { >g1.bar : (x: C) => C >g1 : G >bar : (x: C) => C +>null : null >foo : () => void } var g2 = new G() // was: error Type reference cannot refer to container 'M.C'. >g2 : G >new G() : G >G : typeof G ->M : unknown +>M : any >C : M.C diff --git a/tests/baselines/reference/genericOfACloduleType2.symbols b/tests/baselines/reference/genericOfACloduleType2.symbols new file mode 100644 index 00000000000..2f4fe34818c --- /dev/null +++ b/tests/baselines/reference/genericOfACloduleType2.symbols @@ -0,0 +1,46 @@ +=== tests/cases/compiler/genericOfACloduleType2.ts === +class G{ bar(x: T) { return x; } } +>G : Symbol(G, Decl(genericOfACloduleType2.ts, 0, 0)) +>T : Symbol(T, Decl(genericOfACloduleType2.ts, 0, 8)) +>bar : Symbol(bar, Decl(genericOfACloduleType2.ts, 0, 11)) +>x : Symbol(x, Decl(genericOfACloduleType2.ts, 0, 16)) +>T : Symbol(T, Decl(genericOfACloduleType2.ts, 0, 8)) +>x : Symbol(x, Decl(genericOfACloduleType2.ts, 0, 16)) + +module M { +>M : Symbol(M, Decl(genericOfACloduleType2.ts, 0, 37)) + + export class C { foo() { } } +>C : Symbol(C, Decl(genericOfACloduleType2.ts, 1, 10), Decl(genericOfACloduleType2.ts, 2, 32)) +>foo : Symbol(foo, Decl(genericOfACloduleType2.ts, 2, 20)) + + export module C { +>C : Symbol(C, Decl(genericOfACloduleType2.ts, 1, 10), Decl(genericOfACloduleType2.ts, 2, 32)) + + export class X { +>X : Symbol(X, Decl(genericOfACloduleType2.ts, 3, 21)) + } + } + + var g1 = new G(); +>g1 : Symbol(g1, Decl(genericOfACloduleType2.ts, 8, 7)) +>G : Symbol(G, Decl(genericOfACloduleType2.ts, 0, 0)) +>C : Symbol(C, Decl(genericOfACloduleType2.ts, 1, 10), Decl(genericOfACloduleType2.ts, 2, 32)) + + g1.bar(null).foo(); // no error +>g1.bar(null).foo : Symbol(C.foo, Decl(genericOfACloduleType2.ts, 2, 20)) +>g1.bar : Symbol(G.bar, Decl(genericOfACloduleType2.ts, 0, 11)) +>g1 : Symbol(g1, Decl(genericOfACloduleType2.ts, 8, 7)) +>bar : Symbol(G.bar, Decl(genericOfACloduleType2.ts, 0, 11)) +>foo : Symbol(C.foo, Decl(genericOfACloduleType2.ts, 2, 20)) +} + +module N { +>N : Symbol(N, Decl(genericOfACloduleType2.ts, 10, 1)) + + var g2 = new G() +>g2 : Symbol(g2, Decl(genericOfACloduleType2.ts, 13, 7)) +>G : Symbol(G, Decl(genericOfACloduleType2.ts, 0, 0)) +>M : Symbol(M, Decl(genericOfACloduleType2.ts, 0, 37)) +>C : Symbol(M.C, Decl(genericOfACloduleType2.ts, 1, 10), Decl(genericOfACloduleType2.ts, 2, 32)) +} diff --git a/tests/baselines/reference/genericOfACloduleType2.types b/tests/baselines/reference/genericOfACloduleType2.types index 275af8c913b..2e857b26eda 100644 --- a/tests/baselines/reference/genericOfACloduleType2.types +++ b/tests/baselines/reference/genericOfACloduleType2.types @@ -35,6 +35,7 @@ module M { >g1.bar : (x: C) => C >g1 : G >bar : (x: C) => C +>null : null >foo : () => void } @@ -45,6 +46,6 @@ module N { >g2 : G >new G() : G >G : typeof G ->M : unknown +>M : any >C : M.C } diff --git a/tests/baselines/reference/genericOverloadSignatures.symbols b/tests/baselines/reference/genericOverloadSignatures.symbols new file mode 100644 index 00000000000..76343fb1898 --- /dev/null +++ b/tests/baselines/reference/genericOverloadSignatures.symbols @@ -0,0 +1,101 @@ +=== tests/cases/compiler/genericOverloadSignatures.ts === +interface A { +>A : Symbol(A, Decl(genericOverloadSignatures.ts, 0, 0)) + + (x: T): void; +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 1, 5)) +>x : Symbol(x, Decl(genericOverloadSignatures.ts, 1, 8)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 1, 5)) + + (x: T): void; +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 2, 5)) +>x : Symbol(x, Decl(genericOverloadSignatures.ts, 2, 8)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 2, 5)) +} + +function f(a: T); +>f : Symbol(f, Decl(genericOverloadSignatures.ts, 3, 1), Decl(genericOverloadSignatures.ts, 5, 20), Decl(genericOverloadSignatures.ts, 6, 20)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 5, 11)) +>a : Symbol(a, Decl(genericOverloadSignatures.ts, 5, 14)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 5, 11)) + +function f(a: T); +>f : Symbol(f, Decl(genericOverloadSignatures.ts, 3, 1), Decl(genericOverloadSignatures.ts, 5, 20), Decl(genericOverloadSignatures.ts, 6, 20)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 6, 11)) +>a : Symbol(a, Decl(genericOverloadSignatures.ts, 6, 14)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 6, 11)) + +function f(a) { } +>f : Symbol(f, Decl(genericOverloadSignatures.ts, 3, 1), Decl(genericOverloadSignatures.ts, 5, 20), Decl(genericOverloadSignatures.ts, 6, 20)) +>a : Symbol(a, Decl(genericOverloadSignatures.ts, 7, 11)) + +interface I2 { +>I2 : Symbol(I2, Decl(genericOverloadSignatures.ts, 7, 17)) + + f(x: T): number; +>f : Symbol(f, Decl(genericOverloadSignatures.ts, 9, 14), Decl(genericOverloadSignatures.ts, 10, 23)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 10, 6)) +>x : Symbol(x, Decl(genericOverloadSignatures.ts, 10, 9)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 10, 6)) + + f(x: T): string; +>f : Symbol(f, Decl(genericOverloadSignatures.ts, 9, 14), Decl(genericOverloadSignatures.ts, 10, 23)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 11, 6)) +>x : Symbol(x, Decl(genericOverloadSignatures.ts, 11, 9)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 11, 6)) +} + +interface I3 { +>I3 : Symbol(I3, Decl(genericOverloadSignatures.ts, 12, 1)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 14, 13)) + + f(x: T): number; +>f : Symbol(f, Decl(genericOverloadSignatures.ts, 14, 17), Decl(genericOverloadSignatures.ts, 15, 20)) +>x : Symbol(x, Decl(genericOverloadSignatures.ts, 15, 6)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 14, 13)) + + f(x: T): string; +>f : Symbol(f, Decl(genericOverloadSignatures.ts, 14, 17), Decl(genericOverloadSignatures.ts, 15, 20)) +>x : Symbol(x, Decl(genericOverloadSignatures.ts, 16, 6)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 14, 13)) +} + +class C2 { +>C2 : Symbol(C2, Decl(genericOverloadSignatures.ts, 17, 1)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 19, 9)) +} +var b: { +>b : Symbol(b, Decl(genericOverloadSignatures.ts, 21, 3)) + + new (x: T, y: string): C2; +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 22, 9)) +>x : Symbol(x, Decl(genericOverloadSignatures.ts, 22, 12)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 22, 9)) +>y : Symbol(y, Decl(genericOverloadSignatures.ts, 22, 17)) +>C2 : Symbol(C2, Decl(genericOverloadSignatures.ts, 17, 1)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 22, 9)) + + new (x: T, y: string): C2; +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 23, 9)) +>x : Symbol(x, Decl(genericOverloadSignatures.ts, 23, 12)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 23, 9)) +>y : Symbol(y, Decl(genericOverloadSignatures.ts, 23, 17)) +>C2 : Symbol(C2, Decl(genericOverloadSignatures.ts, 17, 1)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 23, 9)) +} + +interface D { +>D : Symbol(D, Decl(genericOverloadSignatures.ts, 24, 1)) + + (x: T): T; +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 27, 5)) +>x : Symbol(x, Decl(genericOverloadSignatures.ts, 27, 8)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 27, 5)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 27, 5)) + + (x: T): T; +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 28, 5)) +>x : Symbol(x, Decl(genericOverloadSignatures.ts, 28, 8)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 28, 5)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 28, 5)) +} diff --git a/tests/baselines/reference/genericParameterAssignability1.symbols b/tests/baselines/reference/genericParameterAssignability1.symbols new file mode 100644 index 00000000000..766190aecab --- /dev/null +++ b/tests/baselines/reference/genericParameterAssignability1.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/genericParameterAssignability1.ts === +function f(x: T): T { return null; } +>f : Symbol(f, Decl(genericParameterAssignability1.ts, 0, 0)) +>T : Symbol(T, Decl(genericParameterAssignability1.ts, 0, 11)) +>x : Symbol(x, Decl(genericParameterAssignability1.ts, 0, 14)) +>T : Symbol(T, Decl(genericParameterAssignability1.ts, 0, 11)) +>T : Symbol(T, Decl(genericParameterAssignability1.ts, 0, 11)) + +var r = (x: T) => x; +>r : Symbol(r, Decl(genericParameterAssignability1.ts, 1, 3)) +>T : Symbol(T, Decl(genericParameterAssignability1.ts, 1, 9)) +>x : Symbol(x, Decl(genericParameterAssignability1.ts, 1, 12)) +>T : Symbol(T, Decl(genericParameterAssignability1.ts, 1, 9)) +>x : Symbol(x, Decl(genericParameterAssignability1.ts, 1, 12)) + +r = f; // should be allowed +>r : Symbol(r, Decl(genericParameterAssignability1.ts, 1, 3)) +>f : Symbol(f, Decl(genericParameterAssignability1.ts, 0, 0)) + diff --git a/tests/baselines/reference/genericParameterAssignability1.types b/tests/baselines/reference/genericParameterAssignability1.types index b7888014dea..50917e5db45 100644 --- a/tests/baselines/reference/genericParameterAssignability1.types +++ b/tests/baselines/reference/genericParameterAssignability1.types @@ -5,6 +5,7 @@ function f(x: T): T { return null; } >x : T >T : T >T : T +>null : null var r = (x: T) => x; >r : (x: T) => T diff --git a/tests/baselines/reference/genericPrototypeProperty.symbols b/tests/baselines/reference/genericPrototypeProperty.symbols new file mode 100644 index 00000000000..ca2fe000dce --- /dev/null +++ b/tests/baselines/reference/genericPrototypeProperty.symbols @@ -0,0 +1,35 @@ +=== tests/cases/compiler/genericPrototypeProperty.ts === +class C { +>C : Symbol(C, Decl(genericPrototypeProperty.ts, 0, 0)) +>T : Symbol(T, Decl(genericPrototypeProperty.ts, 0, 8)) + + x: T; +>x : Symbol(x, Decl(genericPrototypeProperty.ts, 0, 12)) +>T : Symbol(T, Decl(genericPrototypeProperty.ts, 0, 8)) + + foo(x: T): T { return null; } +>foo : Symbol(foo, Decl(genericPrototypeProperty.ts, 1, 9)) +>x : Symbol(x, Decl(genericPrototypeProperty.ts, 2, 8)) +>T : Symbol(T, Decl(genericPrototypeProperty.ts, 0, 8)) +>T : Symbol(T, Decl(genericPrototypeProperty.ts, 0, 8)) +} + +var r = C.prototype; +>r : Symbol(r, Decl(genericPrototypeProperty.ts, 5, 3)) +>C.prototype : Symbol(C.prototype) +>C : Symbol(C, Decl(genericPrototypeProperty.ts, 0, 0)) +>prototype : Symbol(C.prototype) + +// should be any +var r2 = r.x +>r2 : Symbol(r2, Decl(genericPrototypeProperty.ts, 7, 3)) +>r.x : Symbol(C.x, Decl(genericPrototypeProperty.ts, 0, 12)) +>r : Symbol(r, Decl(genericPrototypeProperty.ts, 5, 3)) +>x : Symbol(C.x, Decl(genericPrototypeProperty.ts, 0, 12)) + +var r3 = r.foo(null); +>r3 : Symbol(r3, Decl(genericPrototypeProperty.ts, 8, 3)) +>r.foo : Symbol(C.foo, Decl(genericPrototypeProperty.ts, 1, 9)) +>r : Symbol(r, Decl(genericPrototypeProperty.ts, 5, 3)) +>foo : Symbol(C.foo, Decl(genericPrototypeProperty.ts, 1, 9)) + diff --git a/tests/baselines/reference/genericPrototypeProperty.types b/tests/baselines/reference/genericPrototypeProperty.types index a25914229b0..447f5e74890 100644 --- a/tests/baselines/reference/genericPrototypeProperty.types +++ b/tests/baselines/reference/genericPrototypeProperty.types @@ -12,6 +12,7 @@ class C { >x : T >T : T >T : T +>null : null } var r = C.prototype; @@ -33,4 +34,5 @@ var r3 = r.foo(null); >r.foo : (x: any) => any >r : C >foo : (x: any) => any +>null : null diff --git a/tests/baselines/reference/genericPrototypeProperty2.symbols b/tests/baselines/reference/genericPrototypeProperty2.symbols new file mode 100644 index 00000000000..f7d55162154 --- /dev/null +++ b/tests/baselines/reference/genericPrototypeProperty2.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/genericPrototypeProperty2.ts === +interface EventTarget { x } +>EventTarget : Symbol(EventTarget, Decl(genericPrototypeProperty2.ts, 0, 0)) +>x : Symbol(x, Decl(genericPrototypeProperty2.ts, 0, 23)) + +class BaseEvent { +>BaseEvent : Symbol(BaseEvent, Decl(genericPrototypeProperty2.ts, 0, 27)) + + target: EventTarget; +>target : Symbol(target, Decl(genericPrototypeProperty2.ts, 1, 17)) +>EventTarget : Symbol(EventTarget, Decl(genericPrototypeProperty2.ts, 0, 0)) +} + +class MyEvent extends BaseEvent { +>MyEvent : Symbol(MyEvent, Decl(genericPrototypeProperty2.ts, 3, 1)) +>T : Symbol(T, Decl(genericPrototypeProperty2.ts, 5, 14)) +>EventTarget : Symbol(EventTarget, Decl(genericPrototypeProperty2.ts, 0, 0)) +>BaseEvent : Symbol(BaseEvent, Decl(genericPrototypeProperty2.ts, 0, 27)) + + target: T; +>target : Symbol(target, Decl(genericPrototypeProperty2.ts, 5, 56)) +>T : Symbol(T, Decl(genericPrototypeProperty2.ts, 5, 14)) +} +class BaseEventWrapper { +>BaseEventWrapper : Symbol(BaseEventWrapper, Decl(genericPrototypeProperty2.ts, 7, 1)) + + t: BaseEvent; +>t : Symbol(t, Decl(genericPrototypeProperty2.ts, 8, 24)) +>BaseEvent : Symbol(BaseEvent, Decl(genericPrototypeProperty2.ts, 0, 27)) +} + +class MyEventWrapper extends BaseEventWrapper { +>MyEventWrapper : Symbol(MyEventWrapper, Decl(genericPrototypeProperty2.ts, 10, 1)) +>BaseEventWrapper : Symbol(BaseEventWrapper, Decl(genericPrototypeProperty2.ts, 7, 1)) + + t: MyEvent; // any satisfies constraint and passes assignability check between 'target' properties +>t : Symbol(t, Decl(genericPrototypeProperty2.ts, 12, 47)) +>MyEvent : Symbol(MyEvent, Decl(genericPrototypeProperty2.ts, 3, 1)) +} diff --git a/tests/baselines/reference/genericPrototypeProperty3.symbols b/tests/baselines/reference/genericPrototypeProperty3.symbols new file mode 100644 index 00000000000..fb28fbcc89d --- /dev/null +++ b/tests/baselines/reference/genericPrototypeProperty3.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/genericPrototypeProperty3.ts === +class BaseEvent { +>BaseEvent : Symbol(BaseEvent, Decl(genericPrototypeProperty3.ts, 0, 0)) + + target: {}; +>target : Symbol(target, Decl(genericPrototypeProperty3.ts, 0, 17)) +} + +class MyEvent extends BaseEvent { // T is instantiated to any in the prototype, which is assignable to {} +>MyEvent : Symbol(MyEvent, Decl(genericPrototypeProperty3.ts, 2, 1)) +>T : Symbol(T, Decl(genericPrototypeProperty3.ts, 4, 14)) +>BaseEvent : Symbol(BaseEvent, Decl(genericPrototypeProperty3.ts, 0, 0)) + + target: T; +>target : Symbol(target, Decl(genericPrototypeProperty3.ts, 4, 36)) +>T : Symbol(T, Decl(genericPrototypeProperty3.ts, 4, 14)) +} +class BaseEventWrapper { +>BaseEventWrapper : Symbol(BaseEventWrapper, Decl(genericPrototypeProperty3.ts, 6, 1)) + + t: BaseEvent; +>t : Symbol(t, Decl(genericPrototypeProperty3.ts, 7, 24)) +>BaseEvent : Symbol(BaseEvent, Decl(genericPrototypeProperty3.ts, 0, 0)) +} + +class MyEventWrapper extends BaseEventWrapper { +>MyEventWrapper : Symbol(MyEventWrapper, Decl(genericPrototypeProperty3.ts, 9, 1)) +>BaseEventWrapper : Symbol(BaseEventWrapper, Decl(genericPrototypeProperty3.ts, 6, 1)) + + t: MyEvent; +>t : Symbol(t, Decl(genericPrototypeProperty3.ts, 11, 47)) +>MyEvent : Symbol(MyEvent, Decl(genericPrototypeProperty3.ts, 2, 1)) +} diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.symbols b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.symbols new file mode 100644 index 00000000000..ff8d19ff6e6 --- /dev/null +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.symbols @@ -0,0 +1,68 @@ +=== tests/cases/compiler/genericRecursiveImplicitConstructorErrors2.ts === +module TypeScript2 { +>TypeScript2 : Symbol(TypeScript2, Decl(genericRecursiveImplicitConstructorErrors2.ts, 0, 0)) + + export interface DeclKind { }; +>DeclKind : Symbol(DeclKind, Decl(genericRecursiveImplicitConstructorErrors2.ts, 0, 20)) + + export interface PullTypesymbol { }; +>PullTypesymbol : Symbol(PullTypesymbol, Decl(genericRecursiveImplicitConstructorErrors2.ts, 1, 32)) + + export interface SymbolLinkKind { }; +>SymbolLinkKind : Symbol(SymbolLinkKind, Decl(genericRecursiveImplicitConstructorErrors2.ts, 2, 38)) + + export enum PullSymbolVisibility { +>PullSymbolVisibility : Symbol(PullSymbolVisibility, Decl(genericRecursiveImplicitConstructorErrors2.ts, 3, 38)) + + Private, +>Private : Symbol(PullSymbolVisibility.Private, Decl(genericRecursiveImplicitConstructorErrors2.ts, 4, 36)) + + Public +>Public : Symbol(PullSymbolVisibility.Public, Decl(genericRecursiveImplicitConstructorErrors2.ts, 5, 12)) + } +  + export class PullSymbol { +>PullSymbol : Symbol(PullSymbol, Decl(genericRecursiveImplicitConstructorErrors2.ts, 7, 3)) + + constructor (name: string, declKind: DeclKind) { +>name : Symbol(name, Decl(genericRecursiveImplicitConstructorErrors2.ts, 10, 17)) +>declKind : Symbol(declKind, Decl(genericRecursiveImplicitConstructorErrors2.ts, 10, 30)) +>DeclKind : Symbol(DeclKind, Decl(genericRecursiveImplicitConstructorErrors2.ts, 0, 20)) + + } + // link methods + public addOutgoingLink(linkTo: PullSymbol, kind: SymbolLinkKind) { +>addOutgoingLink : Symbol(addOutgoingLink, Decl(genericRecursiveImplicitConstructorErrors2.ts, 12, 5)) +>A : Symbol(A, Decl(genericRecursiveImplicitConstructorErrors2.ts, 14, 27)) +>B : Symbol(B, Decl(genericRecursiveImplicitConstructorErrors2.ts, 14, 29)) +>C : Symbol(C, Decl(genericRecursiveImplicitConstructorErrors2.ts, 14, 31)) +>linkTo : Symbol(linkTo, Decl(genericRecursiveImplicitConstructorErrors2.ts, 14, 34)) +>PullSymbol : Symbol(PullSymbol, Decl(genericRecursiveImplicitConstructorErrors2.ts, 7, 3)) +>kind : Symbol(kind, Decl(genericRecursiveImplicitConstructorErrors2.ts, 14, 53)) +>SymbolLinkKind : Symbol(SymbolLinkKind, Decl(genericRecursiveImplicitConstructorErrors2.ts, 2, 38)) + + } + + public getType(): PullTypeSymbol { +>getType : Symbol(getType, Decl(genericRecursiveImplicitConstructorErrors2.ts, 16, 5)) +>A : Symbol(A, Decl(genericRecursiveImplicitConstructorErrors2.ts, 18, 19)) +>B : Symbol(B, Decl(genericRecursiveImplicitConstructorErrors2.ts, 18, 21)) +>C : Symbol(C, Decl(genericRecursiveImplicitConstructorErrors2.ts, 18, 23)) +>PullTypeSymbol : Symbol(PullTypeSymbol, Decl(genericRecursiveImplicitConstructorErrors2.ts, 21, 3)) +>A : Symbol(A, Decl(genericRecursiveImplicitConstructorErrors2.ts, 18, 19)) +>B : Symbol(B, Decl(genericRecursiveImplicitConstructorErrors2.ts, 18, 21)) +>C : Symbol(C, Decl(genericRecursiveImplicitConstructorErrors2.ts, 18, 23)) + + return undefined; +>undefined : Symbol(undefined) + } + } + export class PullTypeSymbol extends PullSymbol { +>PullTypeSymbol : Symbol(PullTypeSymbol, Decl(genericRecursiveImplicitConstructorErrors2.ts, 21, 3)) +>A : Symbol(A, Decl(genericRecursiveImplicitConstructorErrors2.ts, 22, 31)) +>B : Symbol(B, Decl(genericRecursiveImplicitConstructorErrors2.ts, 22, 33)) +>C : Symbol(C, Decl(genericRecursiveImplicitConstructorErrors2.ts, 22, 35)) +>PullSymbol : Symbol(PullSymbol, Decl(genericRecursiveImplicitConstructorErrors2.ts, 7, 3)) + } +} + diff --git a/tests/baselines/reference/genericReversingTypeParameters.symbols b/tests/baselines/reference/genericReversingTypeParameters.symbols new file mode 100644 index 00000000000..05eb102f36b --- /dev/null +++ b/tests/baselines/reference/genericReversingTypeParameters.symbols @@ -0,0 +1,47 @@ +=== tests/cases/compiler/genericReversingTypeParameters.ts === +class BiMap { +>BiMap : Symbol(BiMap, Decl(genericReversingTypeParameters.ts, 0, 0)) +>K : Symbol(K, Decl(genericReversingTypeParameters.ts, 0, 12)) +>V : Symbol(V, Decl(genericReversingTypeParameters.ts, 0, 14)) + + private inverseBiMap: BiMap; +>inverseBiMap : Symbol(inverseBiMap, Decl(genericReversingTypeParameters.ts, 0, 19)) +>BiMap : Symbol(BiMap, Decl(genericReversingTypeParameters.ts, 0, 0)) +>V : Symbol(V, Decl(genericReversingTypeParameters.ts, 0, 14)) +>K : Symbol(K, Decl(genericReversingTypeParameters.ts, 0, 12)) + + public get(key: K): V { return null; } +>get : Symbol(get, Decl(genericReversingTypeParameters.ts, 1, 38)) +>key : Symbol(key, Decl(genericReversingTypeParameters.ts, 2, 15)) +>K : Symbol(K, Decl(genericReversingTypeParameters.ts, 0, 12)) +>V : Symbol(V, Decl(genericReversingTypeParameters.ts, 0, 14)) + + public inverse(): BiMap { return null; } +>inverse : Symbol(inverse, Decl(genericReversingTypeParameters.ts, 2, 42)) +>BiMap : Symbol(BiMap, Decl(genericReversingTypeParameters.ts, 0, 0)) +>V : Symbol(V, Decl(genericReversingTypeParameters.ts, 0, 14)) +>K : Symbol(K, Decl(genericReversingTypeParameters.ts, 0, 12)) +} + +var b = new BiMap(); +>b : Symbol(b, Decl(genericReversingTypeParameters.ts, 6, 3)) +>BiMap : Symbol(BiMap, Decl(genericReversingTypeParameters.ts, 0, 0)) + +var r1 = b.get(''); +>r1 : Symbol(r1, Decl(genericReversingTypeParameters.ts, 7, 3)) +>b.get : Symbol(BiMap.get, Decl(genericReversingTypeParameters.ts, 1, 38)) +>b : Symbol(b, Decl(genericReversingTypeParameters.ts, 6, 3)) +>get : Symbol(BiMap.get, Decl(genericReversingTypeParameters.ts, 1, 38)) + +var i = b.inverse(); // used to get the type wrong here. +>i : Symbol(i, Decl(genericReversingTypeParameters.ts, 8, 3)) +>b.inverse : Symbol(BiMap.inverse, Decl(genericReversingTypeParameters.ts, 2, 42)) +>b : Symbol(b, Decl(genericReversingTypeParameters.ts, 6, 3)) +>inverse : Symbol(BiMap.inverse, Decl(genericReversingTypeParameters.ts, 2, 42)) + +var r2b = i.get(1); +>r2b : Symbol(r2b, Decl(genericReversingTypeParameters.ts, 9, 3)) +>i.get : Symbol(BiMap.get, Decl(genericReversingTypeParameters.ts, 1, 38)) +>i : Symbol(i, Decl(genericReversingTypeParameters.ts, 8, 3)) +>get : Symbol(BiMap.get, Decl(genericReversingTypeParameters.ts, 1, 38)) + diff --git a/tests/baselines/reference/genericReversingTypeParameters.types b/tests/baselines/reference/genericReversingTypeParameters.types index a95f6620082..524a2ebba03 100644 --- a/tests/baselines/reference/genericReversingTypeParameters.types +++ b/tests/baselines/reference/genericReversingTypeParameters.types @@ -15,12 +15,14 @@ class BiMap { >key : K >K : K >V : V +>null : null public inverse(): BiMap { return null; } >inverse : () => BiMap >BiMap : BiMap >V : V >K : K +>null : null } var b = new BiMap(); @@ -34,6 +36,7 @@ var r1 = b.get(''); >b.get : (key: string) => number >b : BiMap >get : (key: string) => number +>'' : string var i = b.inverse(); // used to get the type wrong here. >i : BiMap @@ -48,4 +51,5 @@ var r2b = i.get(1); >i.get : (key: number) => string >i : BiMap >get : (key: number) => string +>1 : number diff --git a/tests/baselines/reference/genericReversingTypeParameters2.symbols b/tests/baselines/reference/genericReversingTypeParameters2.symbols new file mode 100644 index 00000000000..d33dbd3a64b --- /dev/null +++ b/tests/baselines/reference/genericReversingTypeParameters2.symbols @@ -0,0 +1,41 @@ +=== tests/cases/compiler/genericReversingTypeParameters2.ts === +class BiMap { +>BiMap : Symbol(BiMap, Decl(genericReversingTypeParameters2.ts, 0, 0)) +>K : Symbol(K, Decl(genericReversingTypeParameters2.ts, 0, 12)) +>V : Symbol(V, Decl(genericReversingTypeParameters2.ts, 0, 14)) + + private inverseBiMap: BiMap; +>inverseBiMap : Symbol(inverseBiMap, Decl(genericReversingTypeParameters2.ts, 0, 19)) +>BiMap : Symbol(BiMap, Decl(genericReversingTypeParameters2.ts, 0, 0)) +>V : Symbol(V, Decl(genericReversingTypeParameters2.ts, 0, 14)) +>K : Symbol(K, Decl(genericReversingTypeParameters2.ts, 0, 12)) + + public get(key: K): V { return null; } +>get : Symbol(get, Decl(genericReversingTypeParameters2.ts, 1, 38)) +>key : Symbol(key, Decl(genericReversingTypeParameters2.ts, 2, 15)) +>K : Symbol(K, Decl(genericReversingTypeParameters2.ts, 0, 12)) +>V : Symbol(V, Decl(genericReversingTypeParameters2.ts, 0, 14)) + + public inverse(): BiMap { return null; } +>inverse : Symbol(inverse, Decl(genericReversingTypeParameters2.ts, 2, 42)) +>BiMap : Symbol(BiMap, Decl(genericReversingTypeParameters2.ts, 0, 0)) +>V : Symbol(V, Decl(genericReversingTypeParameters2.ts, 0, 14)) +>K : Symbol(K, Decl(genericReversingTypeParameters2.ts, 0, 12)) +} + +var b = new BiMap(); +>b : Symbol(b, Decl(genericReversingTypeParameters2.ts, 6, 3)) +>BiMap : Symbol(BiMap, Decl(genericReversingTypeParameters2.ts, 0, 0)) + +var i = b.inverse(); // used to get the type wrong here. +>i : Symbol(i, Decl(genericReversingTypeParameters2.ts, 7, 3)) +>b.inverse : Symbol(BiMap.inverse, Decl(genericReversingTypeParameters2.ts, 2, 42)) +>b : Symbol(b, Decl(genericReversingTypeParameters2.ts, 6, 3)) +>inverse : Symbol(BiMap.inverse, Decl(genericReversingTypeParameters2.ts, 2, 42)) + +var r2b = i.get(1); +>r2b : Symbol(r2b, Decl(genericReversingTypeParameters2.ts, 8, 3)) +>i.get : Symbol(BiMap.get, Decl(genericReversingTypeParameters2.ts, 1, 38)) +>i : Symbol(i, Decl(genericReversingTypeParameters2.ts, 7, 3)) +>get : Symbol(BiMap.get, Decl(genericReversingTypeParameters2.ts, 1, 38)) + diff --git a/tests/baselines/reference/genericReversingTypeParameters2.types b/tests/baselines/reference/genericReversingTypeParameters2.types index 4356280f4d3..28c1f40ce9f 100644 --- a/tests/baselines/reference/genericReversingTypeParameters2.types +++ b/tests/baselines/reference/genericReversingTypeParameters2.types @@ -15,12 +15,14 @@ class BiMap { >key : K >K : K >V : V +>null : null public inverse(): BiMap { return null; } >inverse : () => BiMap >BiMap : BiMap >V : V >K : K +>null : null } var b = new BiMap(); @@ -41,4 +43,5 @@ var r2b = i.get(1); >i.get : (key: number) => string >i : BiMap >get : (key: number) => string +>1 : number diff --git a/tests/baselines/reference/genericSignatureInheritance.symbols b/tests/baselines/reference/genericSignatureInheritance.symbols new file mode 100644 index 00000000000..7157d7b9346 --- /dev/null +++ b/tests/baselines/reference/genericSignatureInheritance.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/genericSignatureInheritance.ts === +interface I { +>I : Symbol(I, Decl(genericSignatureInheritance.ts, 0, 0)) + + (x: T): string; +>T : Symbol(T, Decl(genericSignatureInheritance.ts, 1, 5)) +>x : Symbol(x, Decl(genericSignatureInheritance.ts, 1, 8)) +>T : Symbol(T, Decl(genericSignatureInheritance.ts, 1, 5)) +} + +interface I2 extends I { } +>I2 : Symbol(I2, Decl(genericSignatureInheritance.ts, 2, 1)) +>I : Symbol(I, Decl(genericSignatureInheritance.ts, 0, 0)) + diff --git a/tests/baselines/reference/genericSignatureInheritance2.symbols b/tests/baselines/reference/genericSignatureInheritance2.symbols new file mode 100644 index 00000000000..3c0e5e2603c --- /dev/null +++ b/tests/baselines/reference/genericSignatureInheritance2.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/genericSignatureInheritance2.ts === +interface I { +>I : Symbol(I, Decl(genericSignatureInheritance2.ts, 0, 0)) + + (x: T): string; +>T : Symbol(T, Decl(genericSignatureInheritance2.ts, 1, 5)) +>x : Symbol(x, Decl(genericSignatureInheritance2.ts, 1, 8)) +>T : Symbol(T, Decl(genericSignatureInheritance2.ts, 1, 5)) +} + +interface I2 extends I { +>I2 : Symbol(I2, Decl(genericSignatureInheritance2.ts, 2, 1)) +>I : Symbol(I, Decl(genericSignatureInheritance2.ts, 0, 0)) + + (x: T): void; +>T : Symbol(T, Decl(genericSignatureInheritance2.ts, 5, 5)) +>x : Symbol(x, Decl(genericSignatureInheritance2.ts, 5, 8)) +>T : Symbol(T, Decl(genericSignatureInheritance2.ts, 5, 5)) +} + diff --git a/tests/baselines/reference/genericSpecializationToTypeLiteral1.symbols b/tests/baselines/reference/genericSpecializationToTypeLiteral1.symbols new file mode 100644 index 00000000000..78203ddacf6 --- /dev/null +++ b/tests/baselines/reference/genericSpecializationToTypeLiteral1.symbols @@ -0,0 +1,178 @@ +=== tests/cases/compiler/genericSpecializationToTypeLiteral1.ts === +interface IEnumerable { +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) + + zip(second: IEnumerable, resultSelector: (first: T, second: T, index: number) => TResult): IEnumerable; +>zip : Symbol(zip, Decl(genericSpecializationToTypeLiteral1.ts, 0, 26), Decl(genericSpecializationToTypeLiteral1.ts, 2, 128), Decl(genericSpecializationToTypeLiteral1.ts, 3, 117)) +>TResult : Symbol(TResult, Decl(genericSpecializationToTypeLiteral1.ts, 2, 8)) +>second : Symbol(second, Decl(genericSpecializationToTypeLiteral1.ts, 2, 17)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>resultSelector : Symbol(resultSelector, Decl(genericSpecializationToTypeLiteral1.ts, 2, 40)) +>first : Symbol(first, Decl(genericSpecializationToTypeLiteral1.ts, 2, 58)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>second : Symbol(second, Decl(genericSpecializationToTypeLiteral1.ts, 2, 67)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>index : Symbol(index, Decl(genericSpecializationToTypeLiteral1.ts, 2, 78)) +>TResult : Symbol(TResult, Decl(genericSpecializationToTypeLiteral1.ts, 2, 8)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>TResult : Symbol(TResult, Decl(genericSpecializationToTypeLiteral1.ts, 2, 8)) + + zip(second: T[], resultSelector: (first: T, second: T, index: number) => TResult): IEnumerable; +>zip : Symbol(zip, Decl(genericSpecializationToTypeLiteral1.ts, 0, 26), Decl(genericSpecializationToTypeLiteral1.ts, 2, 128), Decl(genericSpecializationToTypeLiteral1.ts, 3, 117)) +>TResult : Symbol(TResult, Decl(genericSpecializationToTypeLiteral1.ts, 3, 8)) +>second : Symbol(second, Decl(genericSpecializationToTypeLiteral1.ts, 3, 17)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>resultSelector : Symbol(resultSelector, Decl(genericSpecializationToTypeLiteral1.ts, 3, 29)) +>first : Symbol(first, Decl(genericSpecializationToTypeLiteral1.ts, 3, 47)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>second : Symbol(second, Decl(genericSpecializationToTypeLiteral1.ts, 3, 56)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>index : Symbol(index, Decl(genericSpecializationToTypeLiteral1.ts, 3, 67)) +>TResult : Symbol(TResult, Decl(genericSpecializationToTypeLiteral1.ts, 3, 8)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>TResult : Symbol(TResult, Decl(genericSpecializationToTypeLiteral1.ts, 3, 8)) + + zip(...params: any[]): IEnumerable; // last one is selector +>zip : Symbol(zip, Decl(genericSpecializationToTypeLiteral1.ts, 0, 26), Decl(genericSpecializationToTypeLiteral1.ts, 2, 128), Decl(genericSpecializationToTypeLiteral1.ts, 3, 117)) +>TResult : Symbol(TResult, Decl(genericSpecializationToTypeLiteral1.ts, 4, 8)) +>params : Symbol(params, Decl(genericSpecializationToTypeLiteral1.ts, 4, 17)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>TResult : Symbol(TResult, Decl(genericSpecializationToTypeLiteral1.ts, 4, 8)) + + merge(...params: IEnumerable[]): IEnumerable; +>merge : Symbol(merge, Decl(genericSpecializationToTypeLiteral1.ts, 4, 57), Decl(genericSpecializationToTypeLiteral1.ts, 6, 64)) +>TResult : Symbol(TResult, Decl(genericSpecializationToTypeLiteral1.ts, 6, 10)) +>params : Symbol(params, Decl(genericSpecializationToTypeLiteral1.ts, 6, 19)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) + + merge(...params: T[][]): IEnumerable; +>merge : Symbol(merge, Decl(genericSpecializationToTypeLiteral1.ts, 4, 57), Decl(genericSpecializationToTypeLiteral1.ts, 6, 64)) +>TResult : Symbol(TResult, Decl(genericSpecializationToTypeLiteral1.ts, 7, 10)) +>params : Symbol(params, Decl(genericSpecializationToTypeLiteral1.ts, 7, 19)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) + + + concat(...sequences: IEnumerable[]): IEnumerable; +>concat : Symbol(concat, Decl(genericSpecializationToTypeLiteral1.ts, 7, 53), Decl(genericSpecializationToTypeLiteral1.ts, 10, 59)) +>sequences : Symbol(sequences, Decl(genericSpecializationToTypeLiteral1.ts, 10, 11)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) + + concat(...sequences: T[]): IEnumerable; +>concat : Symbol(concat, Decl(genericSpecializationToTypeLiteral1.ts, 7, 53), Decl(genericSpecializationToTypeLiteral1.ts, 10, 59)) +>sequences : Symbol(sequences, Decl(genericSpecializationToTypeLiteral1.ts, 11, 11)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) + + insert(index: number, second: IEnumerable): IEnumerable; +>insert : Symbol(insert, Decl(genericSpecializationToTypeLiteral1.ts, 11, 46)) +>index : Symbol(index, Decl(genericSpecializationToTypeLiteral1.ts, 13, 11)) +>second : Symbol(second, Decl(genericSpecializationToTypeLiteral1.ts, 13, 25)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) + + sequenceEqual(second: IEnumerable): boolean; +>sequenceEqual : Symbol(sequenceEqual, Decl(genericSpecializationToTypeLiteral1.ts, 13, 66), Decl(genericSpecializationToTypeLiteral1.ts, 15, 51), Decl(genericSpecializationToTypeLiteral1.ts, 16, 104), Decl(genericSpecializationToTypeLiteral1.ts, 17, 40)) +>second : Symbol(second, Decl(genericSpecializationToTypeLiteral1.ts, 15, 18)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) + + sequenceEqual(second: IEnumerable, compareSelector: (element: T) => TCompare): boolean; +>sequenceEqual : Symbol(sequenceEqual, Decl(genericSpecializationToTypeLiteral1.ts, 13, 66), Decl(genericSpecializationToTypeLiteral1.ts, 15, 51), Decl(genericSpecializationToTypeLiteral1.ts, 16, 104), Decl(genericSpecializationToTypeLiteral1.ts, 17, 40)) +>TCompare : Symbol(TCompare, Decl(genericSpecializationToTypeLiteral1.ts, 16, 18)) +>second : Symbol(second, Decl(genericSpecializationToTypeLiteral1.ts, 16, 28)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>compareSelector : Symbol(compareSelector, Decl(genericSpecializationToTypeLiteral1.ts, 16, 51)) +>element : Symbol(element, Decl(genericSpecializationToTypeLiteral1.ts, 16, 70)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>TCompare : Symbol(TCompare, Decl(genericSpecializationToTypeLiteral1.ts, 16, 18)) + + sequenceEqual(second: T[]): boolean; +>sequenceEqual : Symbol(sequenceEqual, Decl(genericSpecializationToTypeLiteral1.ts, 13, 66), Decl(genericSpecializationToTypeLiteral1.ts, 15, 51), Decl(genericSpecializationToTypeLiteral1.ts, 16, 104), Decl(genericSpecializationToTypeLiteral1.ts, 17, 40)) +>second : Symbol(second, Decl(genericSpecializationToTypeLiteral1.ts, 17, 18)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) + + sequenceEqual(second: T[], compareSelector: (element: T) => TCompare): boolean; +>sequenceEqual : Symbol(sequenceEqual, Decl(genericSpecializationToTypeLiteral1.ts, 13, 66), Decl(genericSpecializationToTypeLiteral1.ts, 15, 51), Decl(genericSpecializationToTypeLiteral1.ts, 16, 104), Decl(genericSpecializationToTypeLiteral1.ts, 17, 40)) +>TCompare : Symbol(TCompare, Decl(genericSpecializationToTypeLiteral1.ts, 18, 18)) +>second : Symbol(second, Decl(genericSpecializationToTypeLiteral1.ts, 18, 28)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>compareSelector : Symbol(compareSelector, Decl(genericSpecializationToTypeLiteral1.ts, 18, 40)) +>element : Symbol(element, Decl(genericSpecializationToTypeLiteral1.ts, 18, 59)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>TCompare : Symbol(TCompare, Decl(genericSpecializationToTypeLiteral1.ts, 18, 18)) + + toDictionary(keySelector: (element: T) => TKey): IDictionary; +>toDictionary : Symbol(toDictionary, Decl(genericSpecializationToTypeLiteral1.ts, 18, 93), Decl(genericSpecializationToTypeLiteral1.ts, 20, 82), Decl(genericSpecializationToTypeLiteral1.ts, 21, 134)) +>TKey : Symbol(TKey, Decl(genericSpecializationToTypeLiteral1.ts, 20, 17)) +>keySelector : Symbol(keySelector, Decl(genericSpecializationToTypeLiteral1.ts, 20, 23)) +>element : Symbol(element, Decl(genericSpecializationToTypeLiteral1.ts, 20, 37)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>TKey : Symbol(TKey, Decl(genericSpecializationToTypeLiteral1.ts, 20, 17)) +>IDictionary : Symbol(IDictionary, Decl(genericSpecializationToTypeLiteral1.ts, 23, 1)) +>TKey : Symbol(TKey, Decl(genericSpecializationToTypeLiteral1.ts, 20, 17)) + + toDictionary(keySelector: (element: T) => TKey, elementSelector: (element: T) => TValue): IDictionary; +>toDictionary : Symbol(toDictionary, Decl(genericSpecializationToTypeLiteral1.ts, 18, 93), Decl(genericSpecializationToTypeLiteral1.ts, 20, 82), Decl(genericSpecializationToTypeLiteral1.ts, 21, 134)) +>TKey : Symbol(TKey, Decl(genericSpecializationToTypeLiteral1.ts, 21, 17)) +>TValue : Symbol(TValue, Decl(genericSpecializationToTypeLiteral1.ts, 21, 22)) +>keySelector : Symbol(keySelector, Decl(genericSpecializationToTypeLiteral1.ts, 21, 31)) +>element : Symbol(element, Decl(genericSpecializationToTypeLiteral1.ts, 21, 45)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>TKey : Symbol(TKey, Decl(genericSpecializationToTypeLiteral1.ts, 21, 17)) +>elementSelector : Symbol(elementSelector, Decl(genericSpecializationToTypeLiteral1.ts, 21, 65)) +>element : Symbol(element, Decl(genericSpecializationToTypeLiteral1.ts, 21, 84)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>TValue : Symbol(TValue, Decl(genericSpecializationToTypeLiteral1.ts, 21, 22)) +>IDictionary : Symbol(IDictionary, Decl(genericSpecializationToTypeLiteral1.ts, 23, 1)) +>TKey : Symbol(TKey, Decl(genericSpecializationToTypeLiteral1.ts, 21, 17)) +>TValue : Symbol(TValue, Decl(genericSpecializationToTypeLiteral1.ts, 21, 22)) + + toDictionary(keySelector: (element: T) => TKey, elementSelector: (element: T) => TValue, compareSelector: (key: TKey) => TCompare): IDictionary; +>toDictionary : Symbol(toDictionary, Decl(genericSpecializationToTypeLiteral1.ts, 18, 93), Decl(genericSpecializationToTypeLiteral1.ts, 20, 82), Decl(genericSpecializationToTypeLiteral1.ts, 21, 134)) +>TKey : Symbol(TKey, Decl(genericSpecializationToTypeLiteral1.ts, 22, 17)) +>TValue : Symbol(TValue, Decl(genericSpecializationToTypeLiteral1.ts, 22, 22)) +>TCompare : Symbol(TCompare, Decl(genericSpecializationToTypeLiteral1.ts, 22, 30)) +>keySelector : Symbol(keySelector, Decl(genericSpecializationToTypeLiteral1.ts, 22, 41)) +>element : Symbol(element, Decl(genericSpecializationToTypeLiteral1.ts, 22, 55)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>TKey : Symbol(TKey, Decl(genericSpecializationToTypeLiteral1.ts, 22, 17)) +>elementSelector : Symbol(elementSelector, Decl(genericSpecializationToTypeLiteral1.ts, 22, 75)) +>element : Symbol(element, Decl(genericSpecializationToTypeLiteral1.ts, 22, 94)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>TValue : Symbol(TValue, Decl(genericSpecializationToTypeLiteral1.ts, 22, 22)) +>compareSelector : Symbol(compareSelector, Decl(genericSpecializationToTypeLiteral1.ts, 22, 116)) +>key : Symbol(key, Decl(genericSpecializationToTypeLiteral1.ts, 22, 135)) +>TKey : Symbol(TKey, Decl(genericSpecializationToTypeLiteral1.ts, 22, 17)) +>TCompare : Symbol(TCompare, Decl(genericSpecializationToTypeLiteral1.ts, 22, 30)) +>IDictionary : Symbol(IDictionary, Decl(genericSpecializationToTypeLiteral1.ts, 23, 1)) +>TKey : Symbol(TKey, Decl(genericSpecializationToTypeLiteral1.ts, 22, 17)) +>TValue : Symbol(TValue, Decl(genericSpecializationToTypeLiteral1.ts, 22, 22)) +} + +interface IDictionary { +>IDictionary : Symbol(IDictionary, Decl(genericSpecializationToTypeLiteral1.ts, 23, 1)) +>TKey : Symbol(TKey, Decl(genericSpecializationToTypeLiteral1.ts, 25, 22)) +>TValue : Symbol(TValue, Decl(genericSpecializationToTypeLiteral1.ts, 25, 27)) + + toEnumerable(): IEnumerable<{ key: TKey; value: TValue }>; +>toEnumerable : Symbol(toEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 25, 37)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>key : Symbol(key, Decl(genericSpecializationToTypeLiteral1.ts, 26, 33)) +>TKey : Symbol(TKey, Decl(genericSpecializationToTypeLiteral1.ts, 25, 22)) +>value : Symbol(value, Decl(genericSpecializationToTypeLiteral1.ts, 26, 44)) +>TValue : Symbol(TValue, Decl(genericSpecializationToTypeLiteral1.ts, 25, 27)) +} diff --git a/tests/baselines/reference/genericSpecializations1.symbols b/tests/baselines/reference/genericSpecializations1.symbols new file mode 100644 index 00000000000..87f31276b3f --- /dev/null +++ b/tests/baselines/reference/genericSpecializations1.symbols @@ -0,0 +1,42 @@ +=== tests/cases/compiler/genericSpecializations1.ts === +interface IFoo { +>IFoo : Symbol(IFoo, Decl(genericSpecializations1.ts, 0, 0)) +>T : Symbol(T, Decl(genericSpecializations1.ts, 0, 15)) + + foo(x: T): T; // no error on implementors because IFoo's T is different from foo's T +>foo : Symbol(foo, Decl(genericSpecializations1.ts, 0, 19)) +>T : Symbol(T, Decl(genericSpecializations1.ts, 1, 8)) +>x : Symbol(x, Decl(genericSpecializations1.ts, 1, 11)) +>T : Symbol(T, Decl(genericSpecializations1.ts, 1, 8)) +>T : Symbol(T, Decl(genericSpecializations1.ts, 1, 8)) +} + +class IntFooBad implements IFoo { +>IntFooBad : Symbol(IntFooBad, Decl(genericSpecializations1.ts, 2, 1)) +>IFoo : Symbol(IFoo, Decl(genericSpecializations1.ts, 0, 0)) + + foo(x: string): string { return null; } +>foo : Symbol(foo, Decl(genericSpecializations1.ts, 4, 41)) +>x : Symbol(x, Decl(genericSpecializations1.ts, 5, 8)) +} + +class StringFoo2 implements IFoo { +>StringFoo2 : Symbol(StringFoo2, Decl(genericSpecializations1.ts, 6, 1)) +>IFoo : Symbol(IFoo, Decl(genericSpecializations1.ts, 0, 0)) + + foo(x: string): string { return null; } +>foo : Symbol(foo, Decl(genericSpecializations1.ts, 8, 42)) +>x : Symbol(x, Decl(genericSpecializations1.ts, 9, 8)) +} + +class StringFoo3 implements IFoo { +>StringFoo3 : Symbol(StringFoo3, Decl(genericSpecializations1.ts, 10, 1)) +>IFoo : Symbol(IFoo, Decl(genericSpecializations1.ts, 0, 0)) + + foo(x: T): T { return null; } +>foo : Symbol(foo, Decl(genericSpecializations1.ts, 12, 42)) +>T : Symbol(T, Decl(genericSpecializations1.ts, 13, 8)) +>x : Symbol(x, Decl(genericSpecializations1.ts, 13, 11)) +>T : Symbol(T, Decl(genericSpecializations1.ts, 13, 8)) +>T : Symbol(T, Decl(genericSpecializations1.ts, 13, 8)) +} diff --git a/tests/baselines/reference/genericSpecializations1.types b/tests/baselines/reference/genericSpecializations1.types index 3b60a3b9987..87f32d86d52 100644 --- a/tests/baselines/reference/genericSpecializations1.types +++ b/tests/baselines/reference/genericSpecializations1.types @@ -18,6 +18,7 @@ class IntFooBad implements IFoo { foo(x: string): string { return null; } >foo : (x: string) => string >x : string +>null : null } class StringFoo2 implements IFoo { @@ -27,6 +28,7 @@ class StringFoo2 implements IFoo { foo(x: string): string { return null; } >foo : (x: string) => string >x : string +>null : null } class StringFoo3 implements IFoo { @@ -39,4 +41,5 @@ class StringFoo3 implements IFoo { >x : T >T : T >T : T +>null : null } diff --git a/tests/baselines/reference/genericStaticAnyTypeFunction.symbols b/tests/baselines/reference/genericStaticAnyTypeFunction.symbols new file mode 100644 index 00000000000..21008a38698 --- /dev/null +++ b/tests/baselines/reference/genericStaticAnyTypeFunction.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/genericStaticAnyTypeFunction.ts === +class A { +>A : Symbol(A, Decl(genericStaticAnyTypeFunction.ts, 0, 0)) + + static one(source: T, value: number): T { +>one : Symbol(A.one, Decl(genericStaticAnyTypeFunction.ts, 0, 9)) +>T : Symbol(T, Decl(genericStaticAnyTypeFunction.ts, 2, 15)) +>source : Symbol(source, Decl(genericStaticAnyTypeFunction.ts, 2, 18)) +>T : Symbol(T, Decl(genericStaticAnyTypeFunction.ts, 2, 15)) +>value : Symbol(value, Decl(genericStaticAnyTypeFunction.ts, 2, 28)) +>T : Symbol(T, Decl(genericStaticAnyTypeFunction.ts, 2, 15)) + + return source; +>source : Symbol(source, Decl(genericStaticAnyTypeFunction.ts, 2, 18)) + + } + static goo() { return 0; } +>goo : Symbol(A.goo, Decl(genericStaticAnyTypeFunction.ts, 6, 5)) + + static two(source: T): T { +>two : Symbol(A.two, Decl(genericStaticAnyTypeFunction.ts, 7, 30)) +>T : Symbol(T, Decl(genericStaticAnyTypeFunction.ts, 9, 15)) +>source : Symbol(source, Decl(genericStaticAnyTypeFunction.ts, 9, 18)) +>T : Symbol(T, Decl(genericStaticAnyTypeFunction.ts, 9, 15)) +>T : Symbol(T, Decl(genericStaticAnyTypeFunction.ts, 9, 15)) + + return this.one(source, 42); // should not error +>this.one : Symbol(A.one, Decl(genericStaticAnyTypeFunction.ts, 0, 9)) +>this : Symbol(A, Decl(genericStaticAnyTypeFunction.ts, 0, 0)) +>one : Symbol(A.one, Decl(genericStaticAnyTypeFunction.ts, 0, 9)) +>T : Symbol(T, Decl(genericStaticAnyTypeFunction.ts, 9, 15)) +>source : Symbol(source, Decl(genericStaticAnyTypeFunction.ts, 9, 18)) + + } + +} + + + diff --git a/tests/baselines/reference/genericStaticAnyTypeFunction.types b/tests/baselines/reference/genericStaticAnyTypeFunction.types index 9cf511ca0d9..38b3c3708e7 100644 --- a/tests/baselines/reference/genericStaticAnyTypeFunction.types +++ b/tests/baselines/reference/genericStaticAnyTypeFunction.types @@ -16,6 +16,7 @@ class A { } static goo() { return 0; } >goo : () => number +>0 : number static two(source: T): T { >two : (source: T) => T @@ -31,6 +32,7 @@ class A { >one : (source: T, value: number) => T >T : T >source : T +>42 : number } diff --git a/tests/baselines/reference/genericTypeArgumentInference1.symbols b/tests/baselines/reference/genericTypeArgumentInference1.symbols new file mode 100644 index 00000000000..7b88a84337e --- /dev/null +++ b/tests/baselines/reference/genericTypeArgumentInference1.symbols @@ -0,0 +1,79 @@ +=== tests/cases/compiler/genericTypeArgumentInference1.ts === +module Underscore { +>Underscore : Symbol(Underscore, Decl(genericTypeArgumentInference1.ts, 0, 0)) + + export interface Iterator { +>Iterator : Symbol(Iterator, Decl(genericTypeArgumentInference1.ts, 0, 19)) +>T : Symbol(T, Decl(genericTypeArgumentInference1.ts, 1, 30)) +>U : Symbol(U, Decl(genericTypeArgumentInference1.ts, 1, 32)) + + (value: T, index: any, list: any): U; +>value : Symbol(value, Decl(genericTypeArgumentInference1.ts, 2, 9)) +>T : Symbol(T, Decl(genericTypeArgumentInference1.ts, 1, 30)) +>index : Symbol(index, Decl(genericTypeArgumentInference1.ts, 2, 18)) +>list : Symbol(list, Decl(genericTypeArgumentInference1.ts, 2, 30)) +>U : Symbol(U, Decl(genericTypeArgumentInference1.ts, 1, 32)) + } + export interface Static { +>Static : Symbol(Static, Decl(genericTypeArgumentInference1.ts, 3, 5)) + + all(list: T[], iterator?: Iterator, context?: any): T; +>all : Symbol(all, Decl(genericTypeArgumentInference1.ts, 4, 29)) +>T : Symbol(T, Decl(genericTypeArgumentInference1.ts, 5, 12)) +>list : Symbol(list, Decl(genericTypeArgumentInference1.ts, 5, 15)) +>T : Symbol(T, Decl(genericTypeArgumentInference1.ts, 5, 12)) +>iterator : Symbol(iterator, Decl(genericTypeArgumentInference1.ts, 5, 25)) +>Iterator : Symbol(Iterator, Decl(genericTypeArgumentInference1.ts, 0, 19)) +>T : Symbol(T, Decl(genericTypeArgumentInference1.ts, 5, 12)) +>context : Symbol(context, Decl(genericTypeArgumentInference1.ts, 5, 58)) +>T : Symbol(T, Decl(genericTypeArgumentInference1.ts, 5, 12)) + + identity(value: T): T; +>identity : Symbol(identity, Decl(genericTypeArgumentInference1.ts, 5, 77)) +>T : Symbol(T, Decl(genericTypeArgumentInference1.ts, 6, 17)) +>value : Symbol(value, Decl(genericTypeArgumentInference1.ts, 6, 20)) +>T : Symbol(T, Decl(genericTypeArgumentInference1.ts, 6, 17)) +>T : Symbol(T, Decl(genericTypeArgumentInference1.ts, 6, 17)) + } +} +declare var _: Underscore.Static; +>_ : Symbol(_, Decl(genericTypeArgumentInference1.ts, 9, 11)) +>Underscore : Symbol(Underscore, Decl(genericTypeArgumentInference1.ts, 0, 0)) +>Static : Symbol(Underscore.Static, Decl(genericTypeArgumentInference1.ts, 3, 5)) + +var r = _.all([true, 1, null, 'yes'], _.identity); +>r : Symbol(r, Decl(genericTypeArgumentInference1.ts, 11, 3)) +>_.all : Symbol(Underscore.Static.all, Decl(genericTypeArgumentInference1.ts, 4, 29)) +>_ : Symbol(_, Decl(genericTypeArgumentInference1.ts, 9, 11)) +>all : Symbol(Underscore.Static.all, Decl(genericTypeArgumentInference1.ts, 4, 29)) +>_.identity : Symbol(Underscore.Static.identity, Decl(genericTypeArgumentInference1.ts, 5, 77)) +>_ : Symbol(_, Decl(genericTypeArgumentInference1.ts, 9, 11)) +>identity : Symbol(Underscore.Static.identity, Decl(genericTypeArgumentInference1.ts, 5, 77)) + +var r2 = _.all([true], _.identity); +>r2 : Symbol(r2, Decl(genericTypeArgumentInference1.ts, 12, 3)) +>_.all : Symbol(Underscore.Static.all, Decl(genericTypeArgumentInference1.ts, 4, 29)) +>_ : Symbol(_, Decl(genericTypeArgumentInference1.ts, 9, 11)) +>all : Symbol(Underscore.Static.all, Decl(genericTypeArgumentInference1.ts, 4, 29)) +>_.identity : Symbol(Underscore.Static.identity, Decl(genericTypeArgumentInference1.ts, 5, 77)) +>_ : Symbol(_, Decl(genericTypeArgumentInference1.ts, 9, 11)) +>identity : Symbol(Underscore.Static.identity, Decl(genericTypeArgumentInference1.ts, 5, 77)) + +var r3 = _.all([], _.identity); +>r3 : Symbol(r3, Decl(genericTypeArgumentInference1.ts, 13, 3)) +>_.all : Symbol(Underscore.Static.all, Decl(genericTypeArgumentInference1.ts, 4, 29)) +>_ : Symbol(_, Decl(genericTypeArgumentInference1.ts, 9, 11)) +>all : Symbol(Underscore.Static.all, Decl(genericTypeArgumentInference1.ts, 4, 29)) +>_.identity : Symbol(Underscore.Static.identity, Decl(genericTypeArgumentInference1.ts, 5, 77)) +>_ : Symbol(_, Decl(genericTypeArgumentInference1.ts, 9, 11)) +>identity : Symbol(Underscore.Static.identity, Decl(genericTypeArgumentInference1.ts, 5, 77)) + +var r4 = _.all([true], _.identity); +>r4 : Symbol(r4, Decl(genericTypeArgumentInference1.ts, 14, 3)) +>_.all : Symbol(Underscore.Static.all, Decl(genericTypeArgumentInference1.ts, 4, 29)) +>_ : Symbol(_, Decl(genericTypeArgumentInference1.ts, 9, 11)) +>all : Symbol(Underscore.Static.all, Decl(genericTypeArgumentInference1.ts, 4, 29)) +>_.identity : Symbol(Underscore.Static.identity, Decl(genericTypeArgumentInference1.ts, 5, 77)) +>_ : Symbol(_, Decl(genericTypeArgumentInference1.ts, 9, 11)) +>identity : Symbol(Underscore.Static.identity, Decl(genericTypeArgumentInference1.ts, 5, 77)) + diff --git a/tests/baselines/reference/genericTypeArgumentInference1.types b/tests/baselines/reference/genericTypeArgumentInference1.types index c718ccca620..2d64c8f5c58 100644 --- a/tests/baselines/reference/genericTypeArgumentInference1.types +++ b/tests/baselines/reference/genericTypeArgumentInference1.types @@ -1,6 +1,6 @@ === tests/cases/compiler/genericTypeArgumentInference1.ts === module Underscore { ->Underscore : unknown +>Underscore : any export interface Iterator { >Iterator : Iterator @@ -38,7 +38,7 @@ module Underscore { } declare var _: Underscore.Static; >_ : Underscore.Static ->Underscore : unknown +>Underscore : any >Static : Underscore.Static var r = _.all([true, 1, null, 'yes'], _.identity); @@ -48,6 +48,10 @@ var r = _.all([true, 1, null, 'yes'], _.identity); >_ : Underscore.Static >all : (list: T[], iterator?: Underscore.Iterator, context?: any) => T >[true, 1, null, 'yes'] : (string | number | boolean)[] +>true : boolean +>1 : number +>null : null +>'yes' : string >_.identity : (value: T) => T >_ : Underscore.Static >identity : (value: T) => T @@ -59,6 +63,7 @@ var r2 = _.all([true], _.identity); >_ : Underscore.Static >all : (list: T[], iterator?: Underscore.Iterator, context?: any) => T >[true] : boolean[] +>true : boolean >_.identity : (value: T) => T >_ : Underscore.Static >identity : (value: T) => T @@ -82,6 +87,7 @@ var r4 = _.all([true], _.identity); >all : (list: T[], iterator?: Underscore.Iterator, context?: any) => T >[true] : any[] >true : any +>true : boolean >_.identity : (value: T) => T >_ : Underscore.Static >identity : (value: T) => T diff --git a/tests/baselines/reference/genericTypeAssertions3.symbols b/tests/baselines/reference/genericTypeAssertions3.symbols new file mode 100644 index 00000000000..4d19f156200 --- /dev/null +++ b/tests/baselines/reference/genericTypeAssertions3.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/genericTypeAssertions3.ts === +var r = < (x: T) => T > ((x) => { return null; }); // bug was 'could not find dotted symbol T' on x's annotation in the type assertion instead of no error +>r : Symbol(r, Decl(genericTypeAssertions3.ts, 0, 3)) +>T : Symbol(T, Decl(genericTypeAssertions3.ts, 0, 11)) +>x : Symbol(x, Decl(genericTypeAssertions3.ts, 0, 14)) +>T : Symbol(T, Decl(genericTypeAssertions3.ts, 0, 11)) +>T : Symbol(T, Decl(genericTypeAssertions3.ts, 0, 11)) +>x : Symbol(x, Decl(genericTypeAssertions3.ts, 0, 29)) + +var s = < (x: T) => T > ((x: any) => { return null; }); // no error +>s : Symbol(s, Decl(genericTypeAssertions3.ts, 1, 3)) +>T : Symbol(T, Decl(genericTypeAssertions3.ts, 1, 11)) +>x : Symbol(x, Decl(genericTypeAssertions3.ts, 1, 14)) +>T : Symbol(T, Decl(genericTypeAssertions3.ts, 1, 11)) +>T : Symbol(T, Decl(genericTypeAssertions3.ts, 1, 11)) +>x : Symbol(x, Decl(genericTypeAssertions3.ts, 1, 29)) + diff --git a/tests/baselines/reference/genericTypeAssertions3.types b/tests/baselines/reference/genericTypeAssertions3.types index 53435145939..9f7facc8d47 100644 --- a/tests/baselines/reference/genericTypeAssertions3.types +++ b/tests/baselines/reference/genericTypeAssertions3.types @@ -9,6 +9,7 @@ var r = < (x: T) => T > ((x) => { return null; }); // bug was 'could not find >((x) => { return null; }) : (x: any) => any >(x) => { return null; } : (x: any) => any >x : any +>null : null var s = < (x: T) => T > ((x: any) => { return null; }); // no error >s : (x: T) => T @@ -20,4 +21,5 @@ var s = < (x: T) => T > ((x: any) => { return null; }); // no error >((x: any) => { return null; }) : (x: any) => any >(x: any) => { return null; } : (x: any) => any >x : any +>null : null diff --git a/tests/baselines/reference/genericTypeParameterEquivalence2.symbols b/tests/baselines/reference/genericTypeParameterEquivalence2.symbols new file mode 100644 index 00000000000..056b4ce96ab --- /dev/null +++ b/tests/baselines/reference/genericTypeParameterEquivalence2.symbols @@ -0,0 +1,192 @@ +=== tests/cases/compiler/genericTypeParameterEquivalence2.ts === +// compose :: (b->c) -> (a->b) -> (a->c) +function compose(f: (b: B) => C, g: (a:A) => B): (a:A) => C { +>compose : Symbol(compose, Decl(genericTypeParameterEquivalence2.ts, 0, 0)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 1, 17)) +>B : Symbol(B, Decl(genericTypeParameterEquivalence2.ts, 1, 19)) +>C : Symbol(C, Decl(genericTypeParameterEquivalence2.ts, 1, 22)) +>f : Symbol(f, Decl(genericTypeParameterEquivalence2.ts, 1, 26)) +>b : Symbol(b, Decl(genericTypeParameterEquivalence2.ts, 1, 30)) +>B : Symbol(B, Decl(genericTypeParameterEquivalence2.ts, 1, 19)) +>C : Symbol(C, Decl(genericTypeParameterEquivalence2.ts, 1, 22)) +>g : Symbol(g, Decl(genericTypeParameterEquivalence2.ts, 1, 41)) +>a : Symbol(a, Decl(genericTypeParameterEquivalence2.ts, 1, 46)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 1, 17)) +>B : Symbol(B, Decl(genericTypeParameterEquivalence2.ts, 1, 19)) +>a : Symbol(a, Decl(genericTypeParameterEquivalence2.ts, 1, 59)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 1, 17)) +>C : Symbol(C, Decl(genericTypeParameterEquivalence2.ts, 1, 22)) + + return function (a:A) : C { +>a : Symbol(a, Decl(genericTypeParameterEquivalence2.ts, 2, 21)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 1, 17)) +>C : Symbol(C, Decl(genericTypeParameterEquivalence2.ts, 1, 22)) + + return f(g.apply(null, a)); +>f : Symbol(f, Decl(genericTypeParameterEquivalence2.ts, 1, 26)) +>g.apply : Symbol(Function.apply, Decl(lib.d.ts, 228, 20)) +>g : Symbol(g, Decl(genericTypeParameterEquivalence2.ts, 1, 41)) +>apply : Symbol(Function.apply, Decl(lib.d.ts, 228, 20)) +>a : Symbol(a, Decl(genericTypeParameterEquivalence2.ts, 2, 21)) + + }; +} + +// forEach :: [a] -> (a -> ()) -> () +function forEach(list: A[], f: (a: A, n?: number) => void ): void { +>forEach : Symbol(forEach, Decl(genericTypeParameterEquivalence2.ts, 5, 1)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 8, 17)) +>list : Symbol(list, Decl(genericTypeParameterEquivalence2.ts, 8, 20)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 8, 17)) +>f : Symbol(f, Decl(genericTypeParameterEquivalence2.ts, 8, 30)) +>a : Symbol(a, Decl(genericTypeParameterEquivalence2.ts, 8, 35)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 8, 17)) +>n : Symbol(n, Decl(genericTypeParameterEquivalence2.ts, 8, 40)) + + for (var i = 0; i < list.length; ++i) { +>i : Symbol(i, Decl(genericTypeParameterEquivalence2.ts, 9, 12)) +>i : Symbol(i, Decl(genericTypeParameterEquivalence2.ts, 9, 12)) +>list.length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>list : Symbol(list, Decl(genericTypeParameterEquivalence2.ts, 8, 20)) +>length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>i : Symbol(i, Decl(genericTypeParameterEquivalence2.ts, 9, 12)) + + f(list[i], i); +>f : Symbol(f, Decl(genericTypeParameterEquivalence2.ts, 8, 30)) +>list : Symbol(list, Decl(genericTypeParameterEquivalence2.ts, 8, 20)) +>i : Symbol(i, Decl(genericTypeParameterEquivalence2.ts, 9, 12)) +>i : Symbol(i, Decl(genericTypeParameterEquivalence2.ts, 9, 12)) + } +} + +// filter :: (a->bool) -> [a] -> [a] +function filter(f: (a: A) => boolean, ar: A[]): A[] { +>filter : Symbol(filter, Decl(genericTypeParameterEquivalence2.ts, 12, 1)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 15, 16)) +>f : Symbol(f, Decl(genericTypeParameterEquivalence2.ts, 15, 19)) +>a : Symbol(a, Decl(genericTypeParameterEquivalence2.ts, 15, 23)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 15, 16)) +>ar : Symbol(ar, Decl(genericTypeParameterEquivalence2.ts, 15, 40)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 15, 16)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 15, 16)) + + var ret = []; +>ret : Symbol(ret, Decl(genericTypeParameterEquivalence2.ts, 16, 7)) + + forEach(ar, (el) => { +>forEach : Symbol(forEach, Decl(genericTypeParameterEquivalence2.ts, 5, 1)) +>ar : Symbol(ar, Decl(genericTypeParameterEquivalence2.ts, 15, 40)) +>el : Symbol(el, Decl(genericTypeParameterEquivalence2.ts, 17, 17)) + + if (f(el)) { +>f : Symbol(f, Decl(genericTypeParameterEquivalence2.ts, 15, 19)) +>el : Symbol(el, Decl(genericTypeParameterEquivalence2.ts, 17, 17)) + + ret.push(el); +>ret.push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29)) +>ret : Symbol(ret, Decl(genericTypeParameterEquivalence2.ts, 16, 7)) +>push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29)) +>el : Symbol(el, Decl(genericTypeParameterEquivalence2.ts, 17, 17)) + } + } ); + + return ret; +>ret : Symbol(ret, Decl(genericTypeParameterEquivalence2.ts, 16, 7)) +} + +// length :: [a] -> Num +function length2(ar: A[]): number { +>length2 : Symbol(length2, Decl(genericTypeParameterEquivalence2.ts, 24, 1)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 27, 17)) +>ar : Symbol(ar, Decl(genericTypeParameterEquivalence2.ts, 27, 20)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 27, 17)) + + return ar.length; +>ar.length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>ar : Symbol(ar, Decl(genericTypeParameterEquivalence2.ts, 27, 20)) +>length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +} + +// curry1 :: ((a,b)->c) -> (a->(b->c)) +function curry1(f: (a: A, b: B) => C): (ax: A) => (bx: B) => C { +>curry1 : Symbol(curry1, Decl(genericTypeParameterEquivalence2.ts, 29, 1)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 32, 16)) +>B : Symbol(B, Decl(genericTypeParameterEquivalence2.ts, 32, 18)) +>C : Symbol(C, Decl(genericTypeParameterEquivalence2.ts, 32, 21)) +>f : Symbol(f, Decl(genericTypeParameterEquivalence2.ts, 32, 25)) +>a : Symbol(a, Decl(genericTypeParameterEquivalence2.ts, 32, 29)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 32, 16)) +>b : Symbol(b, Decl(genericTypeParameterEquivalence2.ts, 32, 34)) +>B : Symbol(B, Decl(genericTypeParameterEquivalence2.ts, 32, 18)) +>C : Symbol(C, Decl(genericTypeParameterEquivalence2.ts, 32, 21)) +>ax : Symbol(ax, Decl(genericTypeParameterEquivalence2.ts, 32, 49)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 32, 16)) +>bx : Symbol(bx, Decl(genericTypeParameterEquivalence2.ts, 32, 60)) +>B : Symbol(B, Decl(genericTypeParameterEquivalence2.ts, 32, 18)) +>C : Symbol(C, Decl(genericTypeParameterEquivalence2.ts, 32, 21)) + + return function (ay: A) { +>ay : Symbol(ay, Decl(genericTypeParameterEquivalence2.ts, 33, 21)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 32, 16)) + + return function (by: B) { +>by : Symbol(by, Decl(genericTypeParameterEquivalence2.ts, 34, 25)) +>B : Symbol(B, Decl(genericTypeParameterEquivalence2.ts, 32, 18)) + + return f(ay, by); +>f : Symbol(f, Decl(genericTypeParameterEquivalence2.ts, 32, 25)) +>ay : Symbol(ay, Decl(genericTypeParameterEquivalence2.ts, 33, 21)) +>by : Symbol(by, Decl(genericTypeParameterEquivalence2.ts, 34, 25)) + + }; + }; +} + +var cfilter = curry1(filter); +>cfilter : Symbol(cfilter, Decl(genericTypeParameterEquivalence2.ts, 40, 3)) +>curry1 : Symbol(curry1, Decl(genericTypeParameterEquivalence2.ts, 29, 1)) +>filter : Symbol(filter, Decl(genericTypeParameterEquivalence2.ts, 12, 1)) + +// compose :: (b->c) -> (a->b) -> (a->c) +// length :: [a] -> Num +// cfilter :: {} -> {} -> [{}] +// pred :: a -> Bool +// cfilter(pred) :: {} -> [{}] +// length2 :: [a] -> Num +// countWhere :: (a -> Bool) -> [a] -> Num + +function countWhere_1(pred: (a: A) => boolean): (a: A[]) => number { +>countWhere_1 : Symbol(countWhere_1, Decl(genericTypeParameterEquivalence2.ts, 40, 29)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 50, 22)) +>pred : Symbol(pred, Decl(genericTypeParameterEquivalence2.ts, 50, 25)) +>a : Symbol(a, Decl(genericTypeParameterEquivalence2.ts, 50, 32)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 50, 22)) +>a : Symbol(a, Decl(genericTypeParameterEquivalence2.ts, 50, 52)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 50, 22)) + + return compose(length2, cfilter(pred)); +>compose : Symbol(compose, Decl(genericTypeParameterEquivalence2.ts, 0, 0)) +>length2 : Symbol(length2, Decl(genericTypeParameterEquivalence2.ts, 24, 1)) +>cfilter : Symbol(cfilter, Decl(genericTypeParameterEquivalence2.ts, 40, 3)) +>pred : Symbol(pred, Decl(genericTypeParameterEquivalence2.ts, 50, 25)) +} + +function countWhere_2(pred: (a: A) => boolean): (a: A[]) => number { +>countWhere_2 : Symbol(countWhere_2, Decl(genericTypeParameterEquivalence2.ts, 52, 1)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 54, 22)) +>pred : Symbol(pred, Decl(genericTypeParameterEquivalence2.ts, 54, 25)) +>a : Symbol(a, Decl(genericTypeParameterEquivalence2.ts, 54, 32)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 54, 22)) +>a : Symbol(a, Decl(genericTypeParameterEquivalence2.ts, 54, 52)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 54, 22)) + + var where = cfilter(pred); +>where : Symbol(where, Decl(genericTypeParameterEquivalence2.ts, 55, 7)) +>cfilter : Symbol(cfilter, Decl(genericTypeParameterEquivalence2.ts, 40, 3)) +>pred : Symbol(pred, Decl(genericTypeParameterEquivalence2.ts, 54, 25)) + + return compose(length2, where); +>compose : Symbol(compose, Decl(genericTypeParameterEquivalence2.ts, 0, 0)) +>length2 : Symbol(length2, Decl(genericTypeParameterEquivalence2.ts, 24, 1)) +>where : Symbol(where, Decl(genericTypeParameterEquivalence2.ts, 55, 7)) +} diff --git a/tests/baselines/reference/genericTypeParameterEquivalence2.types b/tests/baselines/reference/genericTypeParameterEquivalence2.types index 09e13b12f7b..3b2c533543d 100644 --- a/tests/baselines/reference/genericTypeParameterEquivalence2.types +++ b/tests/baselines/reference/genericTypeParameterEquivalence2.types @@ -30,6 +30,7 @@ function compose(f: (b: B) => C, g: (a:A) => B): (a:A) => C { >g.apply : (thisArg: any, argArray?: any) => any >g : (a: A) => B >apply : (thisArg: any, argArray?: any) => any +>null : null >a : A }; @@ -48,6 +49,7 @@ function forEach(list: A[], f: (a: A, n?: number) => void ): void { for (var i = 0; i < list.length; ++i) { >i : number +>0 : number >i < list.length : boolean >i : number >list.length : number diff --git a/tests/baselines/reference/genericTypeWithCallableMembers.symbols b/tests/baselines/reference/genericTypeWithCallableMembers.symbols new file mode 100644 index 00000000000..f162ddf64cc --- /dev/null +++ b/tests/baselines/reference/genericTypeWithCallableMembers.symbols @@ -0,0 +1,36 @@ +=== tests/cases/compiler/genericTypeWithCallableMembers.ts === +interface Constructable { +>Constructable : Symbol(Constructable, Decl(genericTypeWithCallableMembers.ts, 0, 0)) + + new (): Constructable; +>Constructable : Symbol(Constructable, Decl(genericTypeWithCallableMembers.ts, 0, 0)) +} + +class C { +>C : Symbol(C, Decl(genericTypeWithCallableMembers.ts, 2, 1)) +>T : Symbol(T, Decl(genericTypeWithCallableMembers.ts, 4, 8)) +>Constructable : Symbol(Constructable, Decl(genericTypeWithCallableMembers.ts, 0, 0)) + + constructor(public data: T, public data2: Constructable) { } +>data : Symbol(data, Decl(genericTypeWithCallableMembers.ts, 5, 16)) +>T : Symbol(T, Decl(genericTypeWithCallableMembers.ts, 4, 8)) +>data2 : Symbol(data2, Decl(genericTypeWithCallableMembers.ts, 5, 31)) +>Constructable : Symbol(Constructable, Decl(genericTypeWithCallableMembers.ts, 0, 0)) + + create() { +>create : Symbol(create, Decl(genericTypeWithCallableMembers.ts, 5, 64)) + + var x = new this.data(); // no error +>x : Symbol(x, Decl(genericTypeWithCallableMembers.ts, 7, 11)) +>this.data : Symbol(data, Decl(genericTypeWithCallableMembers.ts, 5, 16)) +>this : Symbol(C, Decl(genericTypeWithCallableMembers.ts, 2, 1)) +>data : Symbol(data, Decl(genericTypeWithCallableMembers.ts, 5, 16)) + + var x2 = new this.data2(); // was error, shouldn't be +>x2 : Symbol(x2, Decl(genericTypeWithCallableMembers.ts, 8, 11)) +>this.data2 : Symbol(data2, Decl(genericTypeWithCallableMembers.ts, 5, 31)) +>this : Symbol(C, Decl(genericTypeWithCallableMembers.ts, 2, 1)) +>data2 : Symbol(data2, Decl(genericTypeWithCallableMembers.ts, 5, 31)) + } +} + diff --git a/tests/baselines/reference/genericTypeWithCallableMembers2.symbols b/tests/baselines/reference/genericTypeWithCallableMembers2.symbols new file mode 100644 index 00000000000..746e5d77be2 --- /dev/null +++ b/tests/baselines/reference/genericTypeWithCallableMembers2.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/genericTypeWithCallableMembers2.ts === +function foo1(f: T) { +>foo1 : Symbol(foo1, Decl(genericTypeWithCallableMembers2.ts, 0, 0)) +>T : Symbol(T, Decl(genericTypeWithCallableMembers2.ts, 0, 14)) +>f : Symbol(f, Decl(genericTypeWithCallableMembers2.ts, 0, 41)) +>T : Symbol(T, Decl(genericTypeWithCallableMembers2.ts, 0, 14)) + + return f(); // should return 'string', once returned 'any' +>f : Symbol(f, Decl(genericTypeWithCallableMembers2.ts, 0, 41)) +} + +function foo2(f: T) { +>foo2 : Symbol(foo2, Decl(genericTypeWithCallableMembers2.ts, 2, 1)) +>T : Symbol(T, Decl(genericTypeWithCallableMembers2.ts, 4, 14)) +>f : Symbol(f, Decl(genericTypeWithCallableMembers2.ts, 4, 45)) +>T : Symbol(T, Decl(genericTypeWithCallableMembers2.ts, 4, 14)) + + return new f(); // should be legal, once was an error +>f : Symbol(f, Decl(genericTypeWithCallableMembers2.ts, 4, 45)) +} diff --git a/tests/baselines/reference/genericTypeWithMultipleBases1.symbols b/tests/baselines/reference/genericTypeWithMultipleBases1.symbols new file mode 100644 index 00000000000..f38f47e9038 --- /dev/null +++ b/tests/baselines/reference/genericTypeWithMultipleBases1.symbols @@ -0,0 +1,47 @@ +=== tests/cases/compiler/genericTypeWithMultipleBases1.ts === +export interface I1 { +>I1 : Symbol(I1, Decl(genericTypeWithMultipleBases1.ts, 0, 0)) + + m1: () => void; +>m1 : Symbol(m1, Decl(genericTypeWithMultipleBases1.ts, 0, 21)) +} + +export interface I2 { +>I2 : Symbol(I2, Decl(genericTypeWithMultipleBases1.ts, 2, 1)) + + m2: () => void; +>m2 : Symbol(m2, Decl(genericTypeWithMultipleBases1.ts, 4, 21)) +} + +export interface I3 extends I1, I2 { +>I3 : Symbol(I3, Decl(genericTypeWithMultipleBases1.ts, 6, 1)) +>T : Symbol(T, Decl(genericTypeWithMultipleBases1.ts, 8, 20)) +>I1 : Symbol(I1, Decl(genericTypeWithMultipleBases1.ts, 0, 0)) +>I2 : Symbol(I2, Decl(genericTypeWithMultipleBases1.ts, 2, 1)) + +//export interface I3 extends I2, I1 { + p1: T; +>p1 : Symbol(p1, Decl(genericTypeWithMultipleBases1.ts, 8, 39)) +>T : Symbol(T, Decl(genericTypeWithMultipleBases1.ts, 8, 20)) +} + +var x: I3; +>x : Symbol(x, Decl(genericTypeWithMultipleBases1.ts, 13, 3)) +>I3 : Symbol(I3, Decl(genericTypeWithMultipleBases1.ts, 6, 1)) + +x.p1; +>x.p1 : Symbol(I3.p1, Decl(genericTypeWithMultipleBases1.ts, 8, 39)) +>x : Symbol(x, Decl(genericTypeWithMultipleBases1.ts, 13, 3)) +>p1 : Symbol(I3.p1, Decl(genericTypeWithMultipleBases1.ts, 8, 39)) + +x.m1(); +>x.m1 : Symbol(I1.m1, Decl(genericTypeWithMultipleBases1.ts, 0, 21)) +>x : Symbol(x, Decl(genericTypeWithMultipleBases1.ts, 13, 3)) +>m1 : Symbol(I1.m1, Decl(genericTypeWithMultipleBases1.ts, 0, 21)) + +x.m2(); +>x.m2 : Symbol(I2.m2, Decl(genericTypeWithMultipleBases1.ts, 4, 21)) +>x : Symbol(x, Decl(genericTypeWithMultipleBases1.ts, 13, 3)) +>m2 : Symbol(I2.m2, Decl(genericTypeWithMultipleBases1.ts, 4, 21)) + + diff --git a/tests/baselines/reference/genericTypeWithMultipleBases2.symbols b/tests/baselines/reference/genericTypeWithMultipleBases2.symbols new file mode 100644 index 00000000000..e5b97ce73fa --- /dev/null +++ b/tests/baselines/reference/genericTypeWithMultipleBases2.symbols @@ -0,0 +1,46 @@ +=== tests/cases/compiler/genericTypeWithMultipleBases2.ts === +export interface I1 { +>I1 : Symbol(I1, Decl(genericTypeWithMultipleBases2.ts, 0, 0)) + + m1: () => void; +>m1 : Symbol(m1, Decl(genericTypeWithMultipleBases2.ts, 0, 21)) +} + +export interface I2 { +>I2 : Symbol(I2, Decl(genericTypeWithMultipleBases2.ts, 2, 1)) + + m2: () => void; +>m2 : Symbol(m2, Decl(genericTypeWithMultipleBases2.ts, 4, 21)) +} + +export interface I3 extends I2, I1 { +>I3 : Symbol(I3, Decl(genericTypeWithMultipleBases2.ts, 6, 1)) +>T : Symbol(T, Decl(genericTypeWithMultipleBases2.ts, 8, 20)) +>I2 : Symbol(I2, Decl(genericTypeWithMultipleBases2.ts, 2, 1)) +>I1 : Symbol(I1, Decl(genericTypeWithMultipleBases2.ts, 0, 0)) + + p1: T; +>p1 : Symbol(p1, Decl(genericTypeWithMultipleBases2.ts, 8, 39)) +>T : Symbol(T, Decl(genericTypeWithMultipleBases2.ts, 8, 20)) +} + +var x: I3; +>x : Symbol(x, Decl(genericTypeWithMultipleBases2.ts, 12, 3)) +>I3 : Symbol(I3, Decl(genericTypeWithMultipleBases2.ts, 6, 1)) + +x.p1; +>x.p1 : Symbol(I3.p1, Decl(genericTypeWithMultipleBases2.ts, 8, 39)) +>x : Symbol(x, Decl(genericTypeWithMultipleBases2.ts, 12, 3)) +>p1 : Symbol(I3.p1, Decl(genericTypeWithMultipleBases2.ts, 8, 39)) + +x.m1(); +>x.m1 : Symbol(I1.m1, Decl(genericTypeWithMultipleBases2.ts, 0, 21)) +>x : Symbol(x, Decl(genericTypeWithMultipleBases2.ts, 12, 3)) +>m1 : Symbol(I1.m1, Decl(genericTypeWithMultipleBases2.ts, 0, 21)) + +x.m2(); +>x.m2 : Symbol(I2.m2, Decl(genericTypeWithMultipleBases2.ts, 4, 21)) +>x : Symbol(x, Decl(genericTypeWithMultipleBases2.ts, 12, 3)) +>m2 : Symbol(I2.m2, Decl(genericTypeWithMultipleBases2.ts, 4, 21)) + + diff --git a/tests/baselines/reference/genericTypeWithMultipleBases3.symbols b/tests/baselines/reference/genericTypeWithMultipleBases3.symbols new file mode 100644 index 00000000000..024ddcdf374 --- /dev/null +++ b/tests/baselines/reference/genericTypeWithMultipleBases3.symbols @@ -0,0 +1,49 @@ +=== tests/cases/compiler/genericTypeWithMultipleBases3.ts === +interface IA { +>IA : Symbol(IA, Decl(genericTypeWithMultipleBases3.ts, 0, 0)) +>T : Symbol(T, Decl(genericTypeWithMultipleBases3.ts, 0, 13)) + +foo(x: T): T; +>foo : Symbol(foo, Decl(genericTypeWithMultipleBases3.ts, 0, 17)) +>x : Symbol(x, Decl(genericTypeWithMultipleBases3.ts, 2, 4)) +>T : Symbol(T, Decl(genericTypeWithMultipleBases3.ts, 0, 13)) +>T : Symbol(T, Decl(genericTypeWithMultipleBases3.ts, 0, 13)) + +} + +interface IB { +>IB : Symbol(IB, Decl(genericTypeWithMultipleBases3.ts, 4, 1)) +>T : Symbol(T, Decl(genericTypeWithMultipleBases3.ts, 6, 13)) + +bar(x: T): T; +>bar : Symbol(bar, Decl(genericTypeWithMultipleBases3.ts, 6, 17)) +>x : Symbol(x, Decl(genericTypeWithMultipleBases3.ts, 8, 4)) +>T : Symbol(T, Decl(genericTypeWithMultipleBases3.ts, 6, 13)) +>T : Symbol(T, Decl(genericTypeWithMultipleBases3.ts, 6, 13)) + +} + +interface IC extends IA, IB { } +>IC : Symbol(IC, Decl(genericTypeWithMultipleBases3.ts, 10, 1)) +>T : Symbol(T, Decl(genericTypeWithMultipleBases3.ts, 12, 13)) +>IA : Symbol(IA, Decl(genericTypeWithMultipleBases3.ts, 0, 0)) +>T : Symbol(T, Decl(genericTypeWithMultipleBases3.ts, 12, 13)) +>IB : Symbol(IB, Decl(genericTypeWithMultipleBases3.ts, 4, 1)) +>T : Symbol(T, Decl(genericTypeWithMultipleBases3.ts, 12, 13)) + +var c: IC; +>c : Symbol(c, Decl(genericTypeWithMultipleBases3.ts, 14, 3)) +>IC : Symbol(IC, Decl(genericTypeWithMultipleBases3.ts, 10, 1)) + +var x = c.foo; +>x : Symbol(x, Decl(genericTypeWithMultipleBases3.ts, 16, 3)) +>c.foo : Symbol(IA.foo, Decl(genericTypeWithMultipleBases3.ts, 0, 17)) +>c : Symbol(c, Decl(genericTypeWithMultipleBases3.ts, 14, 3)) +>foo : Symbol(IA.foo, Decl(genericTypeWithMultipleBases3.ts, 0, 17)) + +var y = c.bar; +>y : Symbol(y, Decl(genericTypeWithMultipleBases3.ts, 18, 3)) +>c.bar : Symbol(IB.bar, Decl(genericTypeWithMultipleBases3.ts, 6, 17)) +>c : Symbol(c, Decl(genericTypeWithMultipleBases3.ts, 14, 3)) +>bar : Symbol(IB.bar, Decl(genericTypeWithMultipleBases3.ts, 6, 17)) + diff --git a/tests/baselines/reference/genericWithCallSignatureReturningSpecialization.symbols b/tests/baselines/reference/genericWithCallSignatureReturningSpecialization.symbols new file mode 100644 index 00000000000..02e73f4819e --- /dev/null +++ b/tests/baselines/reference/genericWithCallSignatureReturningSpecialization.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/genericWithCallSignatureReturningSpecialization.ts === +interface B { +>B : Symbol(B, Decl(genericWithCallSignatureReturningSpecialization.ts, 0, 0)) +>T : Symbol(T, Decl(genericWithCallSignatureReturningSpecialization.ts, 0, 12)) + + f(): B; +>f : Symbol(f, Decl(genericWithCallSignatureReturningSpecialization.ts, 0, 16)) +>B : Symbol(B, Decl(genericWithCallSignatureReturningSpecialization.ts, 0, 0)) + + (value: T): void; +>value : Symbol(value, Decl(genericWithCallSignatureReturningSpecialization.ts, 2, 5)) +>T : Symbol(T, Decl(genericWithCallSignatureReturningSpecialization.ts, 0, 12)) +} +var x: B; +>x : Symbol(x, Decl(genericWithCallSignatureReturningSpecialization.ts, 4, 3)) +>B : Symbol(B, Decl(genericWithCallSignatureReturningSpecialization.ts, 0, 0)) + +x(true); // was error +>x : Symbol(x, Decl(genericWithCallSignatureReturningSpecialization.ts, 4, 3)) + diff --git a/tests/baselines/reference/genericWithCallSignatureReturningSpecialization.types b/tests/baselines/reference/genericWithCallSignatureReturningSpecialization.types index 824ada50b89..c58d56e3a75 100644 --- a/tests/baselines/reference/genericWithCallSignatureReturningSpecialization.types +++ b/tests/baselines/reference/genericWithCallSignatureReturningSpecialization.types @@ -18,4 +18,5 @@ var x: B; x(true); // was error >x(true) : void >x : B +>true : boolean diff --git a/tests/baselines/reference/genericWithCallSignatures1.symbols b/tests/baselines/reference/genericWithCallSignatures1.symbols new file mode 100644 index 00000000000..d791308b46e --- /dev/null +++ b/tests/baselines/reference/genericWithCallSignatures1.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/genericWithCallSignatures_1.ts === +/// +class MyClass { +>MyClass : Symbol(MyClass, Decl(genericWithCallSignatures_1.ts, 0, 0)) + + public callableThing: CallableExtention; +>callableThing : Symbol(callableThing, Decl(genericWithCallSignatures_1.ts, 1, 15)) +>CallableExtention : Symbol(CallableExtention, Decl(genericWithCallSignatures_0.ts, 3, 1)) + + public myMethod() { +>myMethod : Symbol(myMethod, Decl(genericWithCallSignatures_1.ts, 2, 52)) + + var x = this.callableThing(); +>x : Symbol(x, Decl(genericWithCallSignatures_1.ts, 5, 11)) +>this.callableThing : Symbol(callableThing, Decl(genericWithCallSignatures_1.ts, 1, 15)) +>this : Symbol(MyClass, Decl(genericWithCallSignatures_1.ts, 0, 0)) +>callableThing : Symbol(callableThing, Decl(genericWithCallSignatures_1.ts, 1, 15)) + } +} +=== tests/cases/compiler/genericWithCallSignatures_0.ts === +interface Callable { +>Callable : Symbol(Callable, Decl(genericWithCallSignatures_0.ts, 0, 0)) +>T : Symbol(T, Decl(genericWithCallSignatures_0.ts, 0, 19)) + + (): T; +>T : Symbol(T, Decl(genericWithCallSignatures_0.ts, 0, 19)) + + (value: T): void; +>value : Symbol(value, Decl(genericWithCallSignatures_0.ts, 2, 5)) +>T : Symbol(T, Decl(genericWithCallSignatures_0.ts, 0, 19)) +} + +interface CallableExtention extends Callable { } +>CallableExtention : Symbol(CallableExtention, Decl(genericWithCallSignatures_0.ts, 3, 1)) +>T : Symbol(T, Decl(genericWithCallSignatures_0.ts, 5, 28)) +>Callable : Symbol(Callable, Decl(genericWithCallSignatures_0.ts, 0, 0)) +>T : Symbol(T, Decl(genericWithCallSignatures_0.ts, 5, 28)) + diff --git a/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.symbols b/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.symbols new file mode 100644 index 00000000000..26918e9ebfb --- /dev/null +++ b/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/genericWithIndexerOfTypeParameterType1.ts === +class LazyArray { +>LazyArray : Symbol(LazyArray, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 0)) +>T : Symbol(T, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 16)) + + private objects = <{ [objectId: string]: T; }>{}; +>objects : Symbol(objects, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 20)) +>objectId : Symbol(objectId, Decl(genericWithIndexerOfTypeParameterType1.ts, 1, 26)) +>T : Symbol(T, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 16)) + + array() { +>array : Symbol(array, Decl(genericWithIndexerOfTypeParameterType1.ts, 1, 53)) + + return this.objects; +>this.objects : Symbol(objects, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 20)) +>this : Symbol(LazyArray, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 0)) +>objects : Symbol(objects, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 20)) + } +} +var lazyArray = new LazyArray(); +>lazyArray : Symbol(lazyArray, Decl(genericWithIndexerOfTypeParameterType1.ts, 6, 3)) +>LazyArray : Symbol(LazyArray, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 0)) + +var value: string = lazyArray.array()["test"]; // used to be an error +>value : Symbol(value, Decl(genericWithIndexerOfTypeParameterType1.ts, 7, 3)) +>lazyArray.array : Symbol(LazyArray.array, Decl(genericWithIndexerOfTypeParameterType1.ts, 1, 53)) +>lazyArray : Symbol(lazyArray, Decl(genericWithIndexerOfTypeParameterType1.ts, 6, 3)) +>array : Symbol(LazyArray.array, Decl(genericWithIndexerOfTypeParameterType1.ts, 1, 53)) + diff --git a/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.types b/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.types index ef42c1c6029..3e281f6072a 100644 --- a/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.types +++ b/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.types @@ -31,4 +31,5 @@ var value: string = lazyArray.array()["test"]; // used to be an error >lazyArray.array : () => { [objectId: string]: string; } >lazyArray : LazyArray >array : () => { [objectId: string]: string; } +>"test" : string diff --git a/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.symbols b/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.symbols new file mode 100644 index 00000000000..d09abef57be --- /dev/null +++ b/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/genericWithIndexerOfTypeParameterType2.ts === +export class Collection { +>Collection : Symbol(Collection, Decl(genericWithIndexerOfTypeParameterType2.ts, 0, 0)) +>TItem : Symbol(TItem, Decl(genericWithIndexerOfTypeParameterType2.ts, 0, 24)) +>CollectionItem : Symbol(CollectionItem, Decl(genericWithIndexerOfTypeParameterType2.ts, 6, 1)) + + _itemsByKey: { [key: string]: TItem; }; +>_itemsByKey : Symbol(_itemsByKey, Decl(genericWithIndexerOfTypeParameterType2.ts, 0, 55)) +>key : Symbol(key, Decl(genericWithIndexerOfTypeParameterType2.ts, 1, 20)) +>TItem : Symbol(TItem, Decl(genericWithIndexerOfTypeParameterType2.ts, 0, 24)) +} + +export class List extends Collection{ +>List : Symbol(List, Decl(genericWithIndexerOfTypeParameterType2.ts, 2, 1)) +>Collection : Symbol(Collection, Decl(genericWithIndexerOfTypeParameterType2.ts, 0, 0)) +>ListItem : Symbol(ListItem, Decl(genericWithIndexerOfTypeParameterType2.ts, 8, 30)) + + Bar() {} +>Bar : Symbol(Bar, Decl(genericWithIndexerOfTypeParameterType2.ts, 4, 47)) +} + +export class CollectionItem {} +>CollectionItem : Symbol(CollectionItem, Decl(genericWithIndexerOfTypeParameterType2.ts, 6, 1)) + +export class ListItem extends CollectionItem { +>ListItem : Symbol(ListItem, Decl(genericWithIndexerOfTypeParameterType2.ts, 8, 30)) +>CollectionItem : Symbol(CollectionItem, Decl(genericWithIndexerOfTypeParameterType2.ts, 6, 1)) + + __isNew: boolean; +>__isNew : Symbol(__isNew, Decl(genericWithIndexerOfTypeParameterType2.ts, 10, 46)) +} + diff --git a/tests/baselines/reference/generics0.symbols b/tests/baselines/reference/generics0.symbols new file mode 100644 index 00000000000..801b56fe718 --- /dev/null +++ b/tests/baselines/reference/generics0.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/generics0.ts === +interface G { +>G : Symbol(G, Decl(generics0.ts, 0, 0)) +>T : Symbol(T, Decl(generics0.ts, 0, 12)) + + x: T; +>x : Symbol(x, Decl(generics0.ts, 0, 16)) +>T : Symbol(T, Decl(generics0.ts, 0, 12)) +} + +var v2: G; +>v2 : Symbol(v2, Decl(generics0.ts, 4, 3)) +>G : Symbol(G, Decl(generics0.ts, 0, 0)) + +var z = v2.x; // 'y' should be of type 'string' +>z : Symbol(z, Decl(generics0.ts, 6, 3)) +>v2.x : Symbol(G.x, Decl(generics0.ts, 0, 16)) +>v2 : Symbol(v2, Decl(generics0.ts, 4, 3)) +>x : Symbol(G.x, Decl(generics0.ts, 0, 16)) + diff --git a/tests/baselines/reference/generics1NoError.symbols b/tests/baselines/reference/generics1NoError.symbols new file mode 100644 index 00000000000..fcf820f79c4 --- /dev/null +++ b/tests/baselines/reference/generics1NoError.symbols @@ -0,0 +1,49 @@ +=== tests/cases/compiler/generics1NoError.ts === +interface A { a: string; } +>A : Symbol(A, Decl(generics1NoError.ts, 0, 0)) +>a : Symbol(a, Decl(generics1NoError.ts, 0, 13)) + +interface B extends A { b: string; } +>B : Symbol(B, Decl(generics1NoError.ts, 0, 26)) +>A : Symbol(A, Decl(generics1NoError.ts, 0, 0)) +>b : Symbol(b, Decl(generics1NoError.ts, 1, 23)) + +interface C extends B { c: string; } +>C : Symbol(C, Decl(generics1NoError.ts, 1, 36)) +>B : Symbol(B, Decl(generics1NoError.ts, 0, 26)) +>c : Symbol(c, Decl(generics1NoError.ts, 2, 23)) + +interface G { +>G : Symbol(G, Decl(generics1NoError.ts, 2, 36)) +>T : Symbol(T, Decl(generics1NoError.ts, 3, 12)) +>U : Symbol(U, Decl(generics1NoError.ts, 3, 14)) +>B : Symbol(B, Decl(generics1NoError.ts, 0, 26)) + + x: T; +>x : Symbol(x, Decl(generics1NoError.ts, 3, 29)) +>T : Symbol(T, Decl(generics1NoError.ts, 3, 12)) + + y: U; +>y : Symbol(y, Decl(generics1NoError.ts, 4, 9)) +>U : Symbol(U, Decl(generics1NoError.ts, 3, 14)) +} +var v1: G; // Ok +>v1 : Symbol(v1, Decl(generics1NoError.ts, 7, 3)) +>G : Symbol(G, Decl(generics1NoError.ts, 2, 36)) +>A : Symbol(A, Decl(generics1NoError.ts, 0, 0)) +>C : Symbol(C, Decl(generics1NoError.ts, 1, 36)) + +var v2: G<{ a: string }, C>; // Ok, equivalent to G +>v2 : Symbol(v2, Decl(generics1NoError.ts, 8, 3)) +>G : Symbol(G, Decl(generics1NoError.ts, 2, 36)) +>a : Symbol(a, Decl(generics1NoError.ts, 8, 11)) +>C : Symbol(C, Decl(generics1NoError.ts, 1, 36)) + +var v4: G, C>; // Ok +>v4 : Symbol(v4, Decl(generics1NoError.ts, 9, 3)) +>G : Symbol(G, Decl(generics1NoError.ts, 2, 36)) +>G : Symbol(G, Decl(generics1NoError.ts, 2, 36)) +>A : Symbol(A, Decl(generics1NoError.ts, 0, 0)) +>B : Symbol(B, Decl(generics1NoError.ts, 0, 26)) +>C : Symbol(C, Decl(generics1NoError.ts, 1, 36)) + diff --git a/tests/baselines/reference/generics2NoError.symbols b/tests/baselines/reference/generics2NoError.symbols new file mode 100644 index 00000000000..165eb435a50 --- /dev/null +++ b/tests/baselines/reference/generics2NoError.symbols @@ -0,0 +1,61 @@ +=== tests/cases/compiler/generics2NoError.ts === +interface A { a: string; } +>A : Symbol(A, Decl(generics2NoError.ts, 0, 0)) +>a : Symbol(a, Decl(generics2NoError.ts, 0, 13)) + +interface B extends A { b: string; } +>B : Symbol(B, Decl(generics2NoError.ts, 0, 26)) +>A : Symbol(A, Decl(generics2NoError.ts, 0, 0)) +>b : Symbol(b, Decl(generics2NoError.ts, 1, 23)) + +interface C extends B { c: string; } +>C : Symbol(C, Decl(generics2NoError.ts, 1, 36)) +>B : Symbol(B, Decl(generics2NoError.ts, 0, 26)) +>c : Symbol(c, Decl(generics2NoError.ts, 2, 23)) + +interface G { +>G : Symbol(G, Decl(generics2NoError.ts, 2, 36)) +>T : Symbol(T, Decl(generics2NoError.ts, 3, 12)) +>U : Symbol(U, Decl(generics2NoError.ts, 3, 14)) +>B : Symbol(B, Decl(generics2NoError.ts, 0, 26)) + + x: T; +>x : Symbol(x, Decl(generics2NoError.ts, 3, 29)) +>T : Symbol(T, Decl(generics2NoError.ts, 3, 12)) + + y: U; +>y : Symbol(y, Decl(generics2NoError.ts, 4, 9)) +>U : Symbol(U, Decl(generics2NoError.ts, 3, 14)) +} + + +var v1: { +>v1 : Symbol(v1, Decl(generics2NoError.ts, 9, 3)) + + x: { a: string; } +>x : Symbol(x, Decl(generics2NoError.ts, 9, 9)) +>a : Symbol(a, Decl(generics2NoError.ts, 10, 8)) + + y: { a: string; b: string; c: string }; +>y : Symbol(y, Decl(generics2NoError.ts, 10, 21)) +>a : Symbol(a, Decl(generics2NoError.ts, 11, 8)) +>b : Symbol(b, Decl(generics2NoError.ts, 11, 19)) +>c : Symbol(c, Decl(generics2NoError.ts, 11, 30)) + +}; // Ok + + +var v2: G<{ a: string }, C>; // Ok, equivalent to G +>v2 : Symbol(v2, Decl(generics2NoError.ts, 15, 3)) +>G : Symbol(G, Decl(generics2NoError.ts, 2, 36)) +>a : Symbol(a, Decl(generics2NoError.ts, 15, 11)) +>C : Symbol(C, Decl(generics2NoError.ts, 1, 36)) + +var v4: G, C>; // Ok +>v4 : Symbol(v4, Decl(generics2NoError.ts, 16, 3)) +>G : Symbol(G, Decl(generics2NoError.ts, 2, 36)) +>G : Symbol(G, Decl(generics2NoError.ts, 2, 36)) +>A : Symbol(A, Decl(generics2NoError.ts, 0, 0)) +>B : Symbol(B, Decl(generics2NoError.ts, 0, 26)) +>C : Symbol(C, Decl(generics2NoError.ts, 1, 36)) + diff --git a/tests/baselines/reference/generics3.symbols b/tests/baselines/reference/generics3.symbols new file mode 100644 index 00000000000..be9c583ff5f --- /dev/null +++ b/tests/baselines/reference/generics3.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/generics3.ts === +class C { private x: T; } +>C : Symbol(C, Decl(generics3.ts, 0, 0)) +>T : Symbol(T, Decl(generics3.ts, 0, 8)) +>x : Symbol(x, Decl(generics3.ts, 0, 12)) +>T : Symbol(T, Decl(generics3.ts, 0, 8)) + +interface X { f(): string; } +>X : Symbol(X, Decl(generics3.ts, 0, 28)) +>f : Symbol(f, Decl(generics3.ts, 1, 13)) + +interface Y { f(): string; } +>Y : Symbol(Y, Decl(generics3.ts, 1, 28)) +>f : Symbol(f, Decl(generics3.ts, 2, 13)) + +var a: C; +>a : Symbol(a, Decl(generics3.ts, 3, 3)) +>C : Symbol(C, Decl(generics3.ts, 0, 0)) +>X : Symbol(X, Decl(generics3.ts, 0, 28)) + +var b: C; +>b : Symbol(b, Decl(generics3.ts, 4, 3)) +>C : Symbol(C, Decl(generics3.ts, 0, 0)) +>Y : Symbol(Y, Decl(generics3.ts, 1, 28)) + +a = b; // Ok - should be identical +>a : Symbol(a, Decl(generics3.ts, 3, 3)) +>b : Symbol(b, Decl(generics3.ts, 4, 3)) + diff --git a/tests/baselines/reference/generics4NoError.symbols b/tests/baselines/reference/generics4NoError.symbols new file mode 100644 index 00000000000..9ea547d4db9 --- /dev/null +++ b/tests/baselines/reference/generics4NoError.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/generics4NoError.ts === +class C { private x: T; } +>C : Symbol(C, Decl(generics4NoError.ts, 0, 0)) +>T : Symbol(T, Decl(generics4NoError.ts, 0, 8)) +>x : Symbol(x, Decl(generics4NoError.ts, 0, 12)) +>T : Symbol(T, Decl(generics4NoError.ts, 0, 8)) + +interface X { f(): string; } +>X : Symbol(X, Decl(generics4NoError.ts, 0, 28)) +>f : Symbol(f, Decl(generics4NoError.ts, 1, 13)) + +interface Y { f(): boolean; } +>Y : Symbol(Y, Decl(generics4NoError.ts, 1, 28)) +>f : Symbol(f, Decl(generics4NoError.ts, 2, 13)) + +var a: C; +>a : Symbol(a, Decl(generics4NoError.ts, 3, 3)) +>C : Symbol(C, Decl(generics4NoError.ts, 0, 0)) +>X : Symbol(X, Decl(generics4NoError.ts, 0, 28)) + +var b: C; +>b : Symbol(b, Decl(generics4NoError.ts, 4, 3)) +>C : Symbol(C, Decl(generics4NoError.ts, 0, 0)) +>Y : Symbol(Y, Decl(generics4NoError.ts, 1, 28)) + diff --git a/tests/baselines/reference/genericsAndHigherOrderFunctions.symbols b/tests/baselines/reference/genericsAndHigherOrderFunctions.symbols new file mode 100644 index 00000000000..a9f324278d6 --- /dev/null +++ b/tests/baselines/reference/genericsAndHigherOrderFunctions.symbols @@ -0,0 +1,114 @@ +=== tests/cases/compiler/genericsAndHigherOrderFunctions.ts === +// no errors expected + +var combine: (f: (_: T) => S) => +>combine : Symbol(combine, Decl(genericsAndHigherOrderFunctions.ts, 2, 3)) +>T : Symbol(T, Decl(genericsAndHigherOrderFunctions.ts, 2, 14)) +>S : Symbol(S, Decl(genericsAndHigherOrderFunctions.ts, 2, 16)) +>f : Symbol(f, Decl(genericsAndHigherOrderFunctions.ts, 2, 20)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 2, 24)) +>T : Symbol(T, Decl(genericsAndHigherOrderFunctions.ts, 2, 14)) +>S : Symbol(S, Decl(genericsAndHigherOrderFunctions.ts, 2, 16)) + + (g: (_: U) => T) => +>U : Symbol(U, Decl(genericsAndHigherOrderFunctions.ts, 3, 5)) +>g : Symbol(g, Decl(genericsAndHigherOrderFunctions.ts, 3, 8)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 3, 12)) +>U : Symbol(U, Decl(genericsAndHigherOrderFunctions.ts, 3, 5)) +>T : Symbol(T, Decl(genericsAndHigherOrderFunctions.ts, 2, 14)) + + (x: U) => S +>x : Symbol(x, Decl(genericsAndHigherOrderFunctions.ts, 4, 5)) +>U : Symbol(U, Decl(genericsAndHigherOrderFunctions.ts, 3, 5)) +>S : Symbol(S, Decl(genericsAndHigherOrderFunctions.ts, 2, 16)) + + = (f: (_: T) => S) => +>T : Symbol(T, Decl(genericsAndHigherOrderFunctions.ts, 6, 7)) +>S : Symbol(S, Decl(genericsAndHigherOrderFunctions.ts, 6, 9)) +>f : Symbol(f, Decl(genericsAndHigherOrderFunctions.ts, 6, 13)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 6, 17)) +>T : Symbol(T, Decl(genericsAndHigherOrderFunctions.ts, 6, 7)) +>S : Symbol(S, Decl(genericsAndHigherOrderFunctions.ts, 6, 9)) + + (g: (_: U) => T) => +>U : Symbol(U, Decl(genericsAndHigherOrderFunctions.ts, 7, 9)) +>g : Symbol(g, Decl(genericsAndHigherOrderFunctions.ts, 7, 12)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 7, 16)) +>U : Symbol(U, Decl(genericsAndHigherOrderFunctions.ts, 7, 9)) +>T : Symbol(T, Decl(genericsAndHigherOrderFunctions.ts, 6, 7)) + + (x: U) => f(g(x)) +>x : Symbol(x, Decl(genericsAndHigherOrderFunctions.ts, 8, 13)) +>U : Symbol(U, Decl(genericsAndHigherOrderFunctions.ts, 7, 9)) +>f : Symbol(f, Decl(genericsAndHigherOrderFunctions.ts, 6, 13)) +>g : Symbol(g, Decl(genericsAndHigherOrderFunctions.ts, 7, 12)) +>x : Symbol(x, Decl(genericsAndHigherOrderFunctions.ts, 8, 13)) + +var foo: (g: (x: K) => N) => +>foo : Symbol(foo, Decl(genericsAndHigherOrderFunctions.ts, 10, 3)) +>K : Symbol(K, Decl(genericsAndHigherOrderFunctions.ts, 10, 10)) +>N : Symbol(N, Decl(genericsAndHigherOrderFunctions.ts, 10, 12)) +>g : Symbol(g, Decl(genericsAndHigherOrderFunctions.ts, 10, 16)) +>x : Symbol(x, Decl(genericsAndHigherOrderFunctions.ts, 10, 20)) +>K : Symbol(K, Decl(genericsAndHigherOrderFunctions.ts, 10, 10)) +>N : Symbol(N, Decl(genericsAndHigherOrderFunctions.ts, 10, 12)) + + (h: (_: (_: K) => (_: M) => M) => (_: M) => M) => +>h : Symbol(h, Decl(genericsAndHigherOrderFunctions.ts, 11, 5)) +>M : Symbol(M, Decl(genericsAndHigherOrderFunctions.ts, 11, 9)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 11, 12)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 11, 16)) +>K : Symbol(K, Decl(genericsAndHigherOrderFunctions.ts, 10, 10)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 11, 26)) +>M : Symbol(M, Decl(genericsAndHigherOrderFunctions.ts, 11, 9)) +>M : Symbol(M, Decl(genericsAndHigherOrderFunctions.ts, 11, 9)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 11, 42)) +>M : Symbol(M, Decl(genericsAndHigherOrderFunctions.ts, 11, 9)) +>M : Symbol(M, Decl(genericsAndHigherOrderFunctions.ts, 11, 9)) + + (f: (_: N) => (_: R) => R) => (_: R) => R +>R : Symbol(R, Decl(genericsAndHigherOrderFunctions.ts, 12, 5)) +>f : Symbol(f, Decl(genericsAndHigherOrderFunctions.ts, 12, 8)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 12, 12)) +>N : Symbol(N, Decl(genericsAndHigherOrderFunctions.ts, 10, 12)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 12, 22)) +>R : Symbol(R, Decl(genericsAndHigherOrderFunctions.ts, 12, 5)) +>R : Symbol(R, Decl(genericsAndHigherOrderFunctions.ts, 12, 5)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 12, 38)) +>R : Symbol(R, Decl(genericsAndHigherOrderFunctions.ts, 12, 5)) +>R : Symbol(R, Decl(genericsAndHigherOrderFunctions.ts, 12, 5)) + + = (g: (x: K) => N) => +>K : Symbol(K, Decl(genericsAndHigherOrderFunctions.ts, 14, 7)) +>N : Symbol(N, Decl(genericsAndHigherOrderFunctions.ts, 14, 9)) +>g : Symbol(g, Decl(genericsAndHigherOrderFunctions.ts, 14, 13)) +>x : Symbol(x, Decl(genericsAndHigherOrderFunctions.ts, 14, 17)) +>K : Symbol(K, Decl(genericsAndHigherOrderFunctions.ts, 14, 7)) +>N : Symbol(N, Decl(genericsAndHigherOrderFunctions.ts, 14, 9)) + + (h: (_: (_: K) => (_: M) => M) => (_: M) => M) => +>h : Symbol(h, Decl(genericsAndHigherOrderFunctions.ts, 15, 9)) +>M : Symbol(M, Decl(genericsAndHigherOrderFunctions.ts, 15, 13)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 15, 16)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 15, 20)) +>K : Symbol(K, Decl(genericsAndHigherOrderFunctions.ts, 14, 7)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 15, 30)) +>M : Symbol(M, Decl(genericsAndHigherOrderFunctions.ts, 15, 13)) +>M : Symbol(M, Decl(genericsAndHigherOrderFunctions.ts, 15, 13)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 15, 46)) +>M : Symbol(M, Decl(genericsAndHigherOrderFunctions.ts, 15, 13)) +>M : Symbol(M, Decl(genericsAndHigherOrderFunctions.ts, 15, 13)) + + (f: (_: N) => (_: R) => R) => h(combine(f)(g)) +>R : Symbol(R, Decl(genericsAndHigherOrderFunctions.ts, 16, 13)) +>f : Symbol(f, Decl(genericsAndHigherOrderFunctions.ts, 16, 16)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 16, 20)) +>N : Symbol(N, Decl(genericsAndHigherOrderFunctions.ts, 14, 9)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 16, 30)) +>R : Symbol(R, Decl(genericsAndHigherOrderFunctions.ts, 16, 13)) +>R : Symbol(R, Decl(genericsAndHigherOrderFunctions.ts, 16, 13)) +>h : Symbol(h, Decl(genericsAndHigherOrderFunctions.ts, 15, 9)) +>combine : Symbol(combine, Decl(genericsAndHigherOrderFunctions.ts, 2, 3)) +>f : Symbol(f, Decl(genericsAndHigherOrderFunctions.ts, 16, 16)) +>g : Symbol(g, Decl(genericsAndHigherOrderFunctions.ts, 14, 13)) + diff --git a/tests/baselines/reference/genericsManyTypeParameters.symbols b/tests/baselines/reference/genericsManyTypeParameters.symbols new file mode 100644 index 00000000000..ef80bf62da1 --- /dev/null +++ b/tests/baselines/reference/genericsManyTypeParameters.symbols @@ -0,0 +1,547 @@ +=== tests/cases/compiler/genericsManyTypeParameters.ts === +function Foo< +>Foo : Symbol(Foo, Decl(genericsManyTypeParameters.ts, 0, 0)) + + a1, a21, a31, a41, a51, a61, +>a1 : Symbol(a1, Decl(genericsManyTypeParameters.ts, 0, 13), Decl(genericsManyTypeParameters.ts, 20, 33)) +>a21 : Symbol(a21, Decl(genericsManyTypeParameters.ts, 1, 7)) +>a31 : Symbol(a31, Decl(genericsManyTypeParameters.ts, 1, 12)) +>a41 : Symbol(a41, Decl(genericsManyTypeParameters.ts, 1, 17)) +>a51 : Symbol(a51, Decl(genericsManyTypeParameters.ts, 1, 22)) +>a61 : Symbol(a61, Decl(genericsManyTypeParameters.ts, 1, 27)) + + a119, a22, a32, a42, a52, a62, +>a119 : Symbol(a119, Decl(genericsManyTypeParameters.ts, 1, 32)) +>a22 : Symbol(a22, Decl(genericsManyTypeParameters.ts, 2, 9)) +>a32 : Symbol(a32, Decl(genericsManyTypeParameters.ts, 2, 14)) +>a42 : Symbol(a42, Decl(genericsManyTypeParameters.ts, 2, 19)) +>a52 : Symbol(a52, Decl(genericsManyTypeParameters.ts, 2, 24)) +>a62 : Symbol(a62, Decl(genericsManyTypeParameters.ts, 2, 29)) + + a219, a23, a33, a43, a53, a63, +>a219 : Symbol(a219, Decl(genericsManyTypeParameters.ts, 2, 34)) +>a23 : Symbol(a23, Decl(genericsManyTypeParameters.ts, 3, 9)) +>a33 : Symbol(a33, Decl(genericsManyTypeParameters.ts, 3, 14)) +>a43 : Symbol(a43, Decl(genericsManyTypeParameters.ts, 3, 19)) +>a53 : Symbol(a53, Decl(genericsManyTypeParameters.ts, 3, 24)) +>a63 : Symbol(a63, Decl(genericsManyTypeParameters.ts, 3, 29)) + + a319, a24, a34, a44, a54, a64, +>a319 : Symbol(a319, Decl(genericsManyTypeParameters.ts, 3, 34)) +>a24 : Symbol(a24, Decl(genericsManyTypeParameters.ts, 4, 9)) +>a34 : Symbol(a34, Decl(genericsManyTypeParameters.ts, 4, 14)) +>a44 : Symbol(a44, Decl(genericsManyTypeParameters.ts, 4, 19)) +>a54 : Symbol(a54, Decl(genericsManyTypeParameters.ts, 4, 24)) +>a64 : Symbol(a64, Decl(genericsManyTypeParameters.ts, 4, 29)) + + a419, a25, a35, a45, a55, a65, +>a419 : Symbol(a419, Decl(genericsManyTypeParameters.ts, 4, 34)) +>a25 : Symbol(a25, Decl(genericsManyTypeParameters.ts, 5, 9)) +>a35 : Symbol(a35, Decl(genericsManyTypeParameters.ts, 5, 14)) +>a45 : Symbol(a45, Decl(genericsManyTypeParameters.ts, 5, 19)) +>a55 : Symbol(a55, Decl(genericsManyTypeParameters.ts, 5, 24)) +>a65 : Symbol(a65, Decl(genericsManyTypeParameters.ts, 5, 29)) + + a519, a26, a36, a46, a56, a66, +>a519 : Symbol(a519, Decl(genericsManyTypeParameters.ts, 5, 34)) +>a26 : Symbol(a26, Decl(genericsManyTypeParameters.ts, 6, 9)) +>a36 : Symbol(a36, Decl(genericsManyTypeParameters.ts, 6, 14)) +>a46 : Symbol(a46, Decl(genericsManyTypeParameters.ts, 6, 19)) +>a56 : Symbol(a56, Decl(genericsManyTypeParameters.ts, 6, 24)) +>a66 : Symbol(a66, Decl(genericsManyTypeParameters.ts, 6, 29)) + + a619, a27, a37, a47, a57, a67, +>a619 : Symbol(a619, Decl(genericsManyTypeParameters.ts, 6, 34)) +>a27 : Symbol(a27, Decl(genericsManyTypeParameters.ts, 7, 9)) +>a37 : Symbol(a37, Decl(genericsManyTypeParameters.ts, 7, 14)) +>a47 : Symbol(a47, Decl(genericsManyTypeParameters.ts, 7, 19)) +>a57 : Symbol(a57, Decl(genericsManyTypeParameters.ts, 7, 24)) +>a67 : Symbol(a67, Decl(genericsManyTypeParameters.ts, 7, 29)) + + a71, a28, a38, a48, a58, a68, +>a71 : Symbol(a71, Decl(genericsManyTypeParameters.ts, 7, 34)) +>a28 : Symbol(a28, Decl(genericsManyTypeParameters.ts, 8, 8)) +>a38 : Symbol(a38, Decl(genericsManyTypeParameters.ts, 8, 13)) +>a48 : Symbol(a48, Decl(genericsManyTypeParameters.ts, 8, 18)) +>a58 : Symbol(a58, Decl(genericsManyTypeParameters.ts, 8, 23)) +>a68 : Symbol(a68, Decl(genericsManyTypeParameters.ts, 8, 28)) + + a81, a29, a39, a49, a59, a69, +>a81 : Symbol(a81, Decl(genericsManyTypeParameters.ts, 8, 33)) +>a29 : Symbol(a29, Decl(genericsManyTypeParameters.ts, 9, 8)) +>a39 : Symbol(a39, Decl(genericsManyTypeParameters.ts, 9, 13)) +>a49 : Symbol(a49, Decl(genericsManyTypeParameters.ts, 9, 18)) +>a59 : Symbol(a59, Decl(genericsManyTypeParameters.ts, 9, 23)) +>a69 : Symbol(a69, Decl(genericsManyTypeParameters.ts, 9, 28)) + + a91, a210, a310, a410, a510, a610, +>a91 : Symbol(a91, Decl(genericsManyTypeParameters.ts, 9, 33)) +>a210 : Symbol(a210, Decl(genericsManyTypeParameters.ts, 10, 8)) +>a310 : Symbol(a310, Decl(genericsManyTypeParameters.ts, 10, 14)) +>a410 : Symbol(a410, Decl(genericsManyTypeParameters.ts, 10, 20)) +>a510 : Symbol(a510, Decl(genericsManyTypeParameters.ts, 10, 26)) +>a610 : Symbol(a610, Decl(genericsManyTypeParameters.ts, 10, 32)) + + a111, a211, a311, a411, a511, a611, +>a111 : Symbol(a111, Decl(genericsManyTypeParameters.ts, 10, 38)) +>a211 : Symbol(a211, Decl(genericsManyTypeParameters.ts, 11, 9)) +>a311 : Symbol(a311, Decl(genericsManyTypeParameters.ts, 11, 15)) +>a411 : Symbol(a411, Decl(genericsManyTypeParameters.ts, 11, 21)) +>a511 : Symbol(a511, Decl(genericsManyTypeParameters.ts, 11, 27)) +>a611 : Symbol(a611, Decl(genericsManyTypeParameters.ts, 11, 33)) + + a112, a212, a312, a412, a512, a612, +>a112 : Symbol(a112, Decl(genericsManyTypeParameters.ts, 11, 39)) +>a212 : Symbol(a212, Decl(genericsManyTypeParameters.ts, 12, 9)) +>a312 : Symbol(a312, Decl(genericsManyTypeParameters.ts, 12, 15)) +>a412 : Symbol(a412, Decl(genericsManyTypeParameters.ts, 12, 21)) +>a512 : Symbol(a512, Decl(genericsManyTypeParameters.ts, 12, 27)) +>a612 : Symbol(a612, Decl(genericsManyTypeParameters.ts, 12, 33)) + + a113, a213, a313, a413, a513, a613, +>a113 : Symbol(a113, Decl(genericsManyTypeParameters.ts, 12, 39)) +>a213 : Symbol(a213, Decl(genericsManyTypeParameters.ts, 13, 9)) +>a313 : Symbol(a313, Decl(genericsManyTypeParameters.ts, 13, 15)) +>a413 : Symbol(a413, Decl(genericsManyTypeParameters.ts, 13, 21)) +>a513 : Symbol(a513, Decl(genericsManyTypeParameters.ts, 13, 27)) +>a613 : Symbol(a613, Decl(genericsManyTypeParameters.ts, 13, 33)) + + a114, a214, a314, a414, a514, a614, +>a114 : Symbol(a114, Decl(genericsManyTypeParameters.ts, 13, 39)) +>a214 : Symbol(a214, Decl(genericsManyTypeParameters.ts, 14, 9)) +>a314 : Symbol(a314, Decl(genericsManyTypeParameters.ts, 14, 15)) +>a414 : Symbol(a414, Decl(genericsManyTypeParameters.ts, 14, 21)) +>a514 : Symbol(a514, Decl(genericsManyTypeParameters.ts, 14, 27)) +>a614 : Symbol(a614, Decl(genericsManyTypeParameters.ts, 14, 33)) + + a115, a215, a315, a415, a515, a615, +>a115 : Symbol(a115, Decl(genericsManyTypeParameters.ts, 14, 39)) +>a215 : Symbol(a215, Decl(genericsManyTypeParameters.ts, 15, 9)) +>a315 : Symbol(a315, Decl(genericsManyTypeParameters.ts, 15, 15)) +>a415 : Symbol(a415, Decl(genericsManyTypeParameters.ts, 15, 21)) +>a515 : Symbol(a515, Decl(genericsManyTypeParameters.ts, 15, 27)) +>a615 : Symbol(a615, Decl(genericsManyTypeParameters.ts, 15, 33)) + + a116, a216, a316, a416, a516, a616, +>a116 : Symbol(a116, Decl(genericsManyTypeParameters.ts, 15, 39)) +>a216 : Symbol(a216, Decl(genericsManyTypeParameters.ts, 16, 9)) +>a316 : Symbol(a316, Decl(genericsManyTypeParameters.ts, 16, 15)) +>a416 : Symbol(a416, Decl(genericsManyTypeParameters.ts, 16, 21)) +>a516 : Symbol(a516, Decl(genericsManyTypeParameters.ts, 16, 27)) +>a616 : Symbol(a616, Decl(genericsManyTypeParameters.ts, 16, 33)) + + a117, a217, a317, a417, a517, a617, +>a117 : Symbol(a117, Decl(genericsManyTypeParameters.ts, 16, 39)) +>a217 : Symbol(a217, Decl(genericsManyTypeParameters.ts, 17, 9)) +>a317 : Symbol(a317, Decl(genericsManyTypeParameters.ts, 17, 15)) +>a417 : Symbol(a417, Decl(genericsManyTypeParameters.ts, 17, 21)) +>a517 : Symbol(a517, Decl(genericsManyTypeParameters.ts, 17, 27)) +>a617 : Symbol(a617, Decl(genericsManyTypeParameters.ts, 17, 33)) + + a118, a218, a318, a418, a518, a618> +>a118 : Symbol(a118, Decl(genericsManyTypeParameters.ts, 17, 39)) +>a218 : Symbol(a218, Decl(genericsManyTypeParameters.ts, 18, 9)) +>a318 : Symbol(a318, Decl(genericsManyTypeParameters.ts, 18, 15)) +>a418 : Symbol(a418, Decl(genericsManyTypeParameters.ts, 18, 21)) +>a518 : Symbol(a518, Decl(genericsManyTypeParameters.ts, 18, 27)) +>a618 : Symbol(a618, Decl(genericsManyTypeParameters.ts, 18, 33)) + + ( + x1: a1, y1: a21, z1: a31, a1: a41, b1: a51, c1: a61, +>x1 : Symbol(x1, Decl(genericsManyTypeParameters.ts, 19, 5)) +>a1 : Symbol(a1, Decl(genericsManyTypeParameters.ts, 0, 13), Decl(genericsManyTypeParameters.ts, 20, 33)) +>y1 : Symbol(y1, Decl(genericsManyTypeParameters.ts, 20, 15)) +>a21 : Symbol(a21, Decl(genericsManyTypeParameters.ts, 1, 7)) +>z1 : Symbol(z1, Decl(genericsManyTypeParameters.ts, 20, 24)) +>a31 : Symbol(a31, Decl(genericsManyTypeParameters.ts, 1, 12)) +>a1 : Symbol(a1, Decl(genericsManyTypeParameters.ts, 0, 13), Decl(genericsManyTypeParameters.ts, 20, 33)) +>a41 : Symbol(a41, Decl(genericsManyTypeParameters.ts, 1, 17)) +>b1 : Symbol(b1, Decl(genericsManyTypeParameters.ts, 20, 42)) +>a51 : Symbol(a51, Decl(genericsManyTypeParameters.ts, 1, 22)) +>c1 : Symbol(c1, Decl(genericsManyTypeParameters.ts, 20, 51)) +>a61 : Symbol(a61, Decl(genericsManyTypeParameters.ts, 1, 27)) + + x2: a119, y2: a22, z2: a32, a2: a42, b2: a52, c2: a62, +>x2 : Symbol(x2, Decl(genericsManyTypeParameters.ts, 20, 60)) +>a119 : Symbol(a119, Decl(genericsManyTypeParameters.ts, 1, 32)) +>y2 : Symbol(y2, Decl(genericsManyTypeParameters.ts, 21, 17)) +>a22 : Symbol(a22, Decl(genericsManyTypeParameters.ts, 2, 9)) +>z2 : Symbol(z2, Decl(genericsManyTypeParameters.ts, 21, 26)) +>a32 : Symbol(a32, Decl(genericsManyTypeParameters.ts, 2, 14)) +>a2 : Symbol(a2, Decl(genericsManyTypeParameters.ts, 21, 35)) +>a42 : Symbol(a42, Decl(genericsManyTypeParameters.ts, 2, 19)) +>b2 : Symbol(b2, Decl(genericsManyTypeParameters.ts, 21, 44)) +>a52 : Symbol(a52, Decl(genericsManyTypeParameters.ts, 2, 24)) +>c2 : Symbol(c2, Decl(genericsManyTypeParameters.ts, 21, 53)) +>a62 : Symbol(a62, Decl(genericsManyTypeParameters.ts, 2, 29)) + + x3: a219, y3: a23, z3: a33, a3: a43, b3: a53, c3: a63, +>x3 : Symbol(x3, Decl(genericsManyTypeParameters.ts, 21, 62)) +>a219 : Symbol(a219, Decl(genericsManyTypeParameters.ts, 2, 34)) +>y3 : Symbol(y3, Decl(genericsManyTypeParameters.ts, 22, 17)) +>a23 : Symbol(a23, Decl(genericsManyTypeParameters.ts, 3, 9)) +>z3 : Symbol(z3, Decl(genericsManyTypeParameters.ts, 22, 26)) +>a33 : Symbol(a33, Decl(genericsManyTypeParameters.ts, 3, 14)) +>a3 : Symbol(a3, Decl(genericsManyTypeParameters.ts, 22, 35)) +>a43 : Symbol(a43, Decl(genericsManyTypeParameters.ts, 3, 19)) +>b3 : Symbol(b3, Decl(genericsManyTypeParameters.ts, 22, 44)) +>a53 : Symbol(a53, Decl(genericsManyTypeParameters.ts, 3, 24)) +>c3 : Symbol(c3, Decl(genericsManyTypeParameters.ts, 22, 53)) +>a63 : Symbol(a63, Decl(genericsManyTypeParameters.ts, 3, 29)) + + x4: a319, y4: a24, z4: a34, a4: a44, b4: a54, c4: a64, +>x4 : Symbol(x4, Decl(genericsManyTypeParameters.ts, 22, 62)) +>a319 : Symbol(a319, Decl(genericsManyTypeParameters.ts, 3, 34)) +>y4 : Symbol(y4, Decl(genericsManyTypeParameters.ts, 23, 17)) +>a24 : Symbol(a24, Decl(genericsManyTypeParameters.ts, 4, 9)) +>z4 : Symbol(z4, Decl(genericsManyTypeParameters.ts, 23, 26)) +>a34 : Symbol(a34, Decl(genericsManyTypeParameters.ts, 4, 14)) +>a4 : Symbol(a4, Decl(genericsManyTypeParameters.ts, 23, 35)) +>a44 : Symbol(a44, Decl(genericsManyTypeParameters.ts, 4, 19)) +>b4 : Symbol(b4, Decl(genericsManyTypeParameters.ts, 23, 44)) +>a54 : Symbol(a54, Decl(genericsManyTypeParameters.ts, 4, 24)) +>c4 : Symbol(c4, Decl(genericsManyTypeParameters.ts, 23, 53)) +>a64 : Symbol(a64, Decl(genericsManyTypeParameters.ts, 4, 29)) + + x5: a419, y5: a25, z5: a35, a5: a45, b5: a55, c5: a65, +>x5 : Symbol(x5, Decl(genericsManyTypeParameters.ts, 23, 62)) +>a419 : Symbol(a419, Decl(genericsManyTypeParameters.ts, 4, 34)) +>y5 : Symbol(y5, Decl(genericsManyTypeParameters.ts, 24, 17)) +>a25 : Symbol(a25, Decl(genericsManyTypeParameters.ts, 5, 9)) +>z5 : Symbol(z5, Decl(genericsManyTypeParameters.ts, 24, 26)) +>a35 : Symbol(a35, Decl(genericsManyTypeParameters.ts, 5, 14)) +>a5 : Symbol(a5, Decl(genericsManyTypeParameters.ts, 24, 35)) +>a45 : Symbol(a45, Decl(genericsManyTypeParameters.ts, 5, 19)) +>b5 : Symbol(b5, Decl(genericsManyTypeParameters.ts, 24, 44)) +>a55 : Symbol(a55, Decl(genericsManyTypeParameters.ts, 5, 24)) +>c5 : Symbol(c5, Decl(genericsManyTypeParameters.ts, 24, 53)) +>a65 : Symbol(a65, Decl(genericsManyTypeParameters.ts, 5, 29)) + + x6: a519, y6: a26, z6: a36, a6: a46, b6: a56, c6: a66, +>x6 : Symbol(x6, Decl(genericsManyTypeParameters.ts, 24, 62)) +>a519 : Symbol(a519, Decl(genericsManyTypeParameters.ts, 5, 34)) +>y6 : Symbol(y6, Decl(genericsManyTypeParameters.ts, 25, 17)) +>a26 : Symbol(a26, Decl(genericsManyTypeParameters.ts, 6, 9)) +>z6 : Symbol(z6, Decl(genericsManyTypeParameters.ts, 25, 26)) +>a36 : Symbol(a36, Decl(genericsManyTypeParameters.ts, 6, 14)) +>a6 : Symbol(a6, Decl(genericsManyTypeParameters.ts, 25, 35)) +>a46 : Symbol(a46, Decl(genericsManyTypeParameters.ts, 6, 19)) +>b6 : Symbol(b6, Decl(genericsManyTypeParameters.ts, 25, 44)) +>a56 : Symbol(a56, Decl(genericsManyTypeParameters.ts, 6, 24)) +>c6 : Symbol(c6, Decl(genericsManyTypeParameters.ts, 25, 53)) +>a66 : Symbol(a66, Decl(genericsManyTypeParameters.ts, 6, 29)) + + x7: a619, y7: a27, z7: a37, a7: a47, b7: a57, c7: a67, +>x7 : Symbol(x7, Decl(genericsManyTypeParameters.ts, 25, 62)) +>a619 : Symbol(a619, Decl(genericsManyTypeParameters.ts, 6, 34)) +>y7 : Symbol(y7, Decl(genericsManyTypeParameters.ts, 26, 17)) +>a27 : Symbol(a27, Decl(genericsManyTypeParameters.ts, 7, 9)) +>z7 : Symbol(z7, Decl(genericsManyTypeParameters.ts, 26, 26)) +>a37 : Symbol(a37, Decl(genericsManyTypeParameters.ts, 7, 14)) +>a7 : Symbol(a7, Decl(genericsManyTypeParameters.ts, 26, 35)) +>a47 : Symbol(a47, Decl(genericsManyTypeParameters.ts, 7, 19)) +>b7 : Symbol(b7, Decl(genericsManyTypeParameters.ts, 26, 44)) +>a57 : Symbol(a57, Decl(genericsManyTypeParameters.ts, 7, 24)) +>c7 : Symbol(c7, Decl(genericsManyTypeParameters.ts, 26, 53)) +>a67 : Symbol(a67, Decl(genericsManyTypeParameters.ts, 7, 29)) + + x8: a71, y8: a28, z8: a38, a8: a48, b8: a58, c8: a68, +>x8 : Symbol(x8, Decl(genericsManyTypeParameters.ts, 26, 62)) +>a71 : Symbol(a71, Decl(genericsManyTypeParameters.ts, 7, 34)) +>y8 : Symbol(y8, Decl(genericsManyTypeParameters.ts, 27, 16)) +>a28 : Symbol(a28, Decl(genericsManyTypeParameters.ts, 8, 8)) +>z8 : Symbol(z8, Decl(genericsManyTypeParameters.ts, 27, 25)) +>a38 : Symbol(a38, Decl(genericsManyTypeParameters.ts, 8, 13)) +>a8 : Symbol(a8, Decl(genericsManyTypeParameters.ts, 27, 34)) +>a48 : Symbol(a48, Decl(genericsManyTypeParameters.ts, 8, 18)) +>b8 : Symbol(b8, Decl(genericsManyTypeParameters.ts, 27, 43)) +>a58 : Symbol(a58, Decl(genericsManyTypeParameters.ts, 8, 23)) +>c8 : Symbol(c8, Decl(genericsManyTypeParameters.ts, 27, 52)) +>a68 : Symbol(a68, Decl(genericsManyTypeParameters.ts, 8, 28)) + + x9: a81, y9: a29, z9: a39, a9: a49, b9: a59, c9: a69, +>x9 : Symbol(x9, Decl(genericsManyTypeParameters.ts, 27, 61)) +>a81 : Symbol(a81, Decl(genericsManyTypeParameters.ts, 8, 33)) +>y9 : Symbol(y9, Decl(genericsManyTypeParameters.ts, 28, 16)) +>a29 : Symbol(a29, Decl(genericsManyTypeParameters.ts, 9, 8)) +>z9 : Symbol(z9, Decl(genericsManyTypeParameters.ts, 28, 25)) +>a39 : Symbol(a39, Decl(genericsManyTypeParameters.ts, 9, 13)) +>a9 : Symbol(a9, Decl(genericsManyTypeParameters.ts, 28, 34)) +>a49 : Symbol(a49, Decl(genericsManyTypeParameters.ts, 9, 18)) +>b9 : Symbol(b9, Decl(genericsManyTypeParameters.ts, 28, 43)) +>a59 : Symbol(a59, Decl(genericsManyTypeParameters.ts, 9, 23)) +>c9 : Symbol(c9, Decl(genericsManyTypeParameters.ts, 28, 52)) +>a69 : Symbol(a69, Decl(genericsManyTypeParameters.ts, 9, 28)) + + x10: a91, y12: a210, z10: a310, a10: a410, b10: a510, c10: a610, +>x10 : Symbol(x10, Decl(genericsManyTypeParameters.ts, 28, 61)) +>a91 : Symbol(a91, Decl(genericsManyTypeParameters.ts, 9, 33)) +>y12 : Symbol(y12, Decl(genericsManyTypeParameters.ts, 29, 17)) +>a210 : Symbol(a210, Decl(genericsManyTypeParameters.ts, 10, 8)) +>z10 : Symbol(z10, Decl(genericsManyTypeParameters.ts, 29, 28)) +>a310 : Symbol(a310, Decl(genericsManyTypeParameters.ts, 10, 14)) +>a10 : Symbol(a10, Decl(genericsManyTypeParameters.ts, 29, 39)) +>a410 : Symbol(a410, Decl(genericsManyTypeParameters.ts, 10, 20)) +>b10 : Symbol(b10, Decl(genericsManyTypeParameters.ts, 29, 50)) +>a510 : Symbol(a510, Decl(genericsManyTypeParameters.ts, 10, 26)) +>c10 : Symbol(c10, Decl(genericsManyTypeParameters.ts, 29, 61)) +>a610 : Symbol(a610, Decl(genericsManyTypeParameters.ts, 10, 32)) + + x11: a111, y13: a211, z11: a311, a11: a411, b11: a511, c11: a611, +>x11 : Symbol(x11, Decl(genericsManyTypeParameters.ts, 29, 72)) +>a111 : Symbol(a111, Decl(genericsManyTypeParameters.ts, 10, 38)) +>y13 : Symbol(y13, Decl(genericsManyTypeParameters.ts, 30, 18)) +>a211 : Symbol(a211, Decl(genericsManyTypeParameters.ts, 11, 9)) +>z11 : Symbol(z11, Decl(genericsManyTypeParameters.ts, 30, 29)) +>a311 : Symbol(a311, Decl(genericsManyTypeParameters.ts, 11, 15)) +>a11 : Symbol(a11, Decl(genericsManyTypeParameters.ts, 30, 40)) +>a411 : Symbol(a411, Decl(genericsManyTypeParameters.ts, 11, 21)) +>b11 : Symbol(b11, Decl(genericsManyTypeParameters.ts, 30, 51)) +>a511 : Symbol(a511, Decl(genericsManyTypeParameters.ts, 11, 27)) +>c11 : Symbol(c11, Decl(genericsManyTypeParameters.ts, 30, 62)) +>a611 : Symbol(a611, Decl(genericsManyTypeParameters.ts, 11, 33)) + + x12: a112, y14: a212, z12: a312, a12: a412, b12: a512, c12: a612, +>x12 : Symbol(x12, Decl(genericsManyTypeParameters.ts, 30, 73)) +>a112 : Symbol(a112, Decl(genericsManyTypeParameters.ts, 11, 39)) +>y14 : Symbol(y14, Decl(genericsManyTypeParameters.ts, 31, 18)) +>a212 : Symbol(a212, Decl(genericsManyTypeParameters.ts, 12, 9)) +>z12 : Symbol(z12, Decl(genericsManyTypeParameters.ts, 31, 29)) +>a312 : Symbol(a312, Decl(genericsManyTypeParameters.ts, 12, 15)) +>a12 : Symbol(a12, Decl(genericsManyTypeParameters.ts, 31, 40)) +>a412 : Symbol(a412, Decl(genericsManyTypeParameters.ts, 12, 21)) +>b12 : Symbol(b12, Decl(genericsManyTypeParameters.ts, 31, 51)) +>a512 : Symbol(a512, Decl(genericsManyTypeParameters.ts, 12, 27)) +>c12 : Symbol(c12, Decl(genericsManyTypeParameters.ts, 31, 62)) +>a612 : Symbol(a612, Decl(genericsManyTypeParameters.ts, 12, 33)) + + x13: a113, y15: a213, z13: a313, a13: a413, b13: a513, c13: a613, +>x13 : Symbol(x13, Decl(genericsManyTypeParameters.ts, 31, 73)) +>a113 : Symbol(a113, Decl(genericsManyTypeParameters.ts, 12, 39)) +>y15 : Symbol(y15, Decl(genericsManyTypeParameters.ts, 32, 18)) +>a213 : Symbol(a213, Decl(genericsManyTypeParameters.ts, 13, 9)) +>z13 : Symbol(z13, Decl(genericsManyTypeParameters.ts, 32, 29)) +>a313 : Symbol(a313, Decl(genericsManyTypeParameters.ts, 13, 15)) +>a13 : Symbol(a13, Decl(genericsManyTypeParameters.ts, 32, 40)) +>a413 : Symbol(a413, Decl(genericsManyTypeParameters.ts, 13, 21)) +>b13 : Symbol(b13, Decl(genericsManyTypeParameters.ts, 32, 51)) +>a513 : Symbol(a513, Decl(genericsManyTypeParameters.ts, 13, 27)) +>c13 : Symbol(c13, Decl(genericsManyTypeParameters.ts, 32, 62)) +>a613 : Symbol(a613, Decl(genericsManyTypeParameters.ts, 13, 33)) + + x14: a114, y16: a214, z14: a314, a14: a414, b14: a514, c14: a614, +>x14 : Symbol(x14, Decl(genericsManyTypeParameters.ts, 32, 73)) +>a114 : Symbol(a114, Decl(genericsManyTypeParameters.ts, 13, 39)) +>y16 : Symbol(y16, Decl(genericsManyTypeParameters.ts, 33, 18)) +>a214 : Symbol(a214, Decl(genericsManyTypeParameters.ts, 14, 9)) +>z14 : Symbol(z14, Decl(genericsManyTypeParameters.ts, 33, 29)) +>a314 : Symbol(a314, Decl(genericsManyTypeParameters.ts, 14, 15)) +>a14 : Symbol(a14, Decl(genericsManyTypeParameters.ts, 33, 40)) +>a414 : Symbol(a414, Decl(genericsManyTypeParameters.ts, 14, 21)) +>b14 : Symbol(b14, Decl(genericsManyTypeParameters.ts, 33, 51)) +>a514 : Symbol(a514, Decl(genericsManyTypeParameters.ts, 14, 27)) +>c14 : Symbol(c14, Decl(genericsManyTypeParameters.ts, 33, 62)) +>a614 : Symbol(a614, Decl(genericsManyTypeParameters.ts, 14, 33)) + + x15: a115, y17: a215, z15: a315, a15: a415, b15: a515, c15: a615, +>x15 : Symbol(x15, Decl(genericsManyTypeParameters.ts, 33, 73)) +>a115 : Symbol(a115, Decl(genericsManyTypeParameters.ts, 14, 39)) +>y17 : Symbol(y17, Decl(genericsManyTypeParameters.ts, 34, 18)) +>a215 : Symbol(a215, Decl(genericsManyTypeParameters.ts, 15, 9)) +>z15 : Symbol(z15, Decl(genericsManyTypeParameters.ts, 34, 29)) +>a315 : Symbol(a315, Decl(genericsManyTypeParameters.ts, 15, 15)) +>a15 : Symbol(a15, Decl(genericsManyTypeParameters.ts, 34, 40)) +>a415 : Symbol(a415, Decl(genericsManyTypeParameters.ts, 15, 21)) +>b15 : Symbol(b15, Decl(genericsManyTypeParameters.ts, 34, 51)) +>a515 : Symbol(a515, Decl(genericsManyTypeParameters.ts, 15, 27)) +>c15 : Symbol(c15, Decl(genericsManyTypeParameters.ts, 34, 62)) +>a615 : Symbol(a615, Decl(genericsManyTypeParameters.ts, 15, 33)) + + x16: a116, y18: a216, z16: a316, a16: a416, b16: a516, c16: a616, +>x16 : Symbol(x16, Decl(genericsManyTypeParameters.ts, 34, 73)) +>a116 : Symbol(a116, Decl(genericsManyTypeParameters.ts, 15, 39)) +>y18 : Symbol(y18, Decl(genericsManyTypeParameters.ts, 35, 18)) +>a216 : Symbol(a216, Decl(genericsManyTypeParameters.ts, 16, 9)) +>z16 : Symbol(z16, Decl(genericsManyTypeParameters.ts, 35, 29)) +>a316 : Symbol(a316, Decl(genericsManyTypeParameters.ts, 16, 15)) +>a16 : Symbol(a16, Decl(genericsManyTypeParameters.ts, 35, 40)) +>a416 : Symbol(a416, Decl(genericsManyTypeParameters.ts, 16, 21)) +>b16 : Symbol(b16, Decl(genericsManyTypeParameters.ts, 35, 51)) +>a516 : Symbol(a516, Decl(genericsManyTypeParameters.ts, 16, 27)) +>c16 : Symbol(c16, Decl(genericsManyTypeParameters.ts, 35, 62)) +>a616 : Symbol(a616, Decl(genericsManyTypeParameters.ts, 16, 33)) + + x17: a117, y19: a217, z17: a317, a17: a417, b17: a517, c17: a617, +>x17 : Symbol(x17, Decl(genericsManyTypeParameters.ts, 35, 73)) +>a117 : Symbol(a117, Decl(genericsManyTypeParameters.ts, 16, 39)) +>y19 : Symbol(y19, Decl(genericsManyTypeParameters.ts, 36, 18)) +>a217 : Symbol(a217, Decl(genericsManyTypeParameters.ts, 17, 9)) +>z17 : Symbol(z17, Decl(genericsManyTypeParameters.ts, 36, 29)) +>a317 : Symbol(a317, Decl(genericsManyTypeParameters.ts, 17, 15)) +>a17 : Symbol(a17, Decl(genericsManyTypeParameters.ts, 36, 40)) +>a417 : Symbol(a417, Decl(genericsManyTypeParameters.ts, 17, 21)) +>b17 : Symbol(b17, Decl(genericsManyTypeParameters.ts, 36, 51)) +>a517 : Symbol(a517, Decl(genericsManyTypeParameters.ts, 17, 27)) +>c17 : Symbol(c17, Decl(genericsManyTypeParameters.ts, 36, 62)) +>a617 : Symbol(a617, Decl(genericsManyTypeParameters.ts, 17, 33)) + + x18: a118, y10: a218, z18: a318, a18: a418, b18: a518, c18: a618 +>x18 : Symbol(x18, Decl(genericsManyTypeParameters.ts, 36, 73)) +>a118 : Symbol(a118, Decl(genericsManyTypeParameters.ts, 17, 39)) +>y10 : Symbol(y10, Decl(genericsManyTypeParameters.ts, 37, 18)) +>a218 : Symbol(a218, Decl(genericsManyTypeParameters.ts, 18, 9)) +>z18 : Symbol(z18, Decl(genericsManyTypeParameters.ts, 37, 29)) +>a318 : Symbol(a318, Decl(genericsManyTypeParameters.ts, 18, 15)) +>a18 : Symbol(a18, Decl(genericsManyTypeParameters.ts, 37, 40)) +>a418 : Symbol(a418, Decl(genericsManyTypeParameters.ts, 18, 21)) +>b18 : Symbol(b18, Decl(genericsManyTypeParameters.ts, 37, 51)) +>a518 : Symbol(a518, Decl(genericsManyTypeParameters.ts, 18, 27)) +>c18 : Symbol(c18, Decl(genericsManyTypeParameters.ts, 37, 62)) +>a618 : Symbol(a618, Decl(genericsManyTypeParameters.ts, 18, 33)) + + ) + { + return [x1 , y1 , z1 , a1 , b1 , c1, +>x1 : Symbol(x1, Decl(genericsManyTypeParameters.ts, 19, 5)) +>y1 : Symbol(y1, Decl(genericsManyTypeParameters.ts, 20, 15)) +>z1 : Symbol(z1, Decl(genericsManyTypeParameters.ts, 20, 24)) +>a1 : Symbol(a1, Decl(genericsManyTypeParameters.ts, 0, 13), Decl(genericsManyTypeParameters.ts, 20, 33)) +>b1 : Symbol(b1, Decl(genericsManyTypeParameters.ts, 20, 42)) +>c1 : Symbol(c1, Decl(genericsManyTypeParameters.ts, 20, 51)) + + x2 , y2 , z2 , a2 , b2 , c2, +>x2 : Symbol(x2, Decl(genericsManyTypeParameters.ts, 20, 60)) +>y2 : Symbol(y2, Decl(genericsManyTypeParameters.ts, 21, 17)) +>z2 : Symbol(z2, Decl(genericsManyTypeParameters.ts, 21, 26)) +>a2 : Symbol(a2, Decl(genericsManyTypeParameters.ts, 21, 35)) +>b2 : Symbol(b2, Decl(genericsManyTypeParameters.ts, 21, 44)) +>c2 : Symbol(c2, Decl(genericsManyTypeParameters.ts, 21, 53)) + + x3 , y3 , z3 , a3 , b3 , c3, +>x3 : Symbol(x3, Decl(genericsManyTypeParameters.ts, 21, 62)) +>y3 : Symbol(y3, Decl(genericsManyTypeParameters.ts, 22, 17)) +>z3 : Symbol(z3, Decl(genericsManyTypeParameters.ts, 22, 26)) +>a3 : Symbol(a3, Decl(genericsManyTypeParameters.ts, 22, 35)) +>b3 : Symbol(b3, Decl(genericsManyTypeParameters.ts, 22, 44)) +>c3 : Symbol(c3, Decl(genericsManyTypeParameters.ts, 22, 53)) + + x4 , y4 , z4 , a4 , b4 , c4, +>x4 : Symbol(x4, Decl(genericsManyTypeParameters.ts, 22, 62)) +>y4 : Symbol(y4, Decl(genericsManyTypeParameters.ts, 23, 17)) +>z4 : Symbol(z4, Decl(genericsManyTypeParameters.ts, 23, 26)) +>a4 : Symbol(a4, Decl(genericsManyTypeParameters.ts, 23, 35)) +>b4 : Symbol(b4, Decl(genericsManyTypeParameters.ts, 23, 44)) +>c4 : Symbol(c4, Decl(genericsManyTypeParameters.ts, 23, 53)) + + x5 , y5 , z5 , a5 , b5 , c5, +>x5 : Symbol(x5, Decl(genericsManyTypeParameters.ts, 23, 62)) +>y5 : Symbol(y5, Decl(genericsManyTypeParameters.ts, 24, 17)) +>z5 : Symbol(z5, Decl(genericsManyTypeParameters.ts, 24, 26)) +>a5 : Symbol(a5, Decl(genericsManyTypeParameters.ts, 24, 35)) +>b5 : Symbol(b5, Decl(genericsManyTypeParameters.ts, 24, 44)) +>c5 : Symbol(c5, Decl(genericsManyTypeParameters.ts, 24, 53)) + + x6 , y6 , z6 , a6 , b6 , c6, +>x6 : Symbol(x6, Decl(genericsManyTypeParameters.ts, 24, 62)) +>y6 : Symbol(y6, Decl(genericsManyTypeParameters.ts, 25, 17)) +>z6 : Symbol(z6, Decl(genericsManyTypeParameters.ts, 25, 26)) +>a6 : Symbol(a6, Decl(genericsManyTypeParameters.ts, 25, 35)) +>b6 : Symbol(b6, Decl(genericsManyTypeParameters.ts, 25, 44)) +>c6 : Symbol(c6, Decl(genericsManyTypeParameters.ts, 25, 53)) + + x7 , y7 , z7 , a7 , b7 , c7, +>x7 : Symbol(x7, Decl(genericsManyTypeParameters.ts, 25, 62)) +>y7 : Symbol(y7, Decl(genericsManyTypeParameters.ts, 26, 17)) +>z7 : Symbol(z7, Decl(genericsManyTypeParameters.ts, 26, 26)) +>a7 : Symbol(a7, Decl(genericsManyTypeParameters.ts, 26, 35)) +>b7 : Symbol(b7, Decl(genericsManyTypeParameters.ts, 26, 44)) +>c7 : Symbol(c7, Decl(genericsManyTypeParameters.ts, 26, 53)) + + x8 , y8 , z8 , a8 , b8 , c8, +>x8 : Symbol(x8, Decl(genericsManyTypeParameters.ts, 26, 62)) +>y8 : Symbol(y8, Decl(genericsManyTypeParameters.ts, 27, 16)) +>z8 : Symbol(z8, Decl(genericsManyTypeParameters.ts, 27, 25)) +>a8 : Symbol(a8, Decl(genericsManyTypeParameters.ts, 27, 34)) +>b8 : Symbol(b8, Decl(genericsManyTypeParameters.ts, 27, 43)) +>c8 : Symbol(c8, Decl(genericsManyTypeParameters.ts, 27, 52)) + + x9 , y9 , z9 , a9 , b9 , c9, +>x9 : Symbol(x9, Decl(genericsManyTypeParameters.ts, 27, 61)) +>y9 : Symbol(y9, Decl(genericsManyTypeParameters.ts, 28, 16)) +>z9 : Symbol(z9, Decl(genericsManyTypeParameters.ts, 28, 25)) +>a9 : Symbol(a9, Decl(genericsManyTypeParameters.ts, 28, 34)) +>b9 : Symbol(b9, Decl(genericsManyTypeParameters.ts, 28, 43)) +>c9 : Symbol(c9, Decl(genericsManyTypeParameters.ts, 28, 52)) + + x10 , y12 , z10 , a10 , b10 , c10, +>x10 : Symbol(x10, Decl(genericsManyTypeParameters.ts, 28, 61)) +>y12 : Symbol(y12, Decl(genericsManyTypeParameters.ts, 29, 17)) +>z10 : Symbol(z10, Decl(genericsManyTypeParameters.ts, 29, 28)) +>a10 : Symbol(a10, Decl(genericsManyTypeParameters.ts, 29, 39)) +>b10 : Symbol(b10, Decl(genericsManyTypeParameters.ts, 29, 50)) +>c10 : Symbol(c10, Decl(genericsManyTypeParameters.ts, 29, 61)) + + x11 , y13 , z11 , a11 , b11 , c11, +>x11 : Symbol(x11, Decl(genericsManyTypeParameters.ts, 29, 72)) +>y13 : Symbol(y13, Decl(genericsManyTypeParameters.ts, 30, 18)) +>z11 : Symbol(z11, Decl(genericsManyTypeParameters.ts, 30, 29)) +>a11 : Symbol(a11, Decl(genericsManyTypeParameters.ts, 30, 40)) +>b11 : Symbol(b11, Decl(genericsManyTypeParameters.ts, 30, 51)) +>c11 : Symbol(c11, Decl(genericsManyTypeParameters.ts, 30, 62)) + + x12 , y14 , z12 , a12 , b12 , c12, +>x12 : Symbol(x12, Decl(genericsManyTypeParameters.ts, 30, 73)) +>y14 : Symbol(y14, Decl(genericsManyTypeParameters.ts, 31, 18)) +>z12 : Symbol(z12, Decl(genericsManyTypeParameters.ts, 31, 29)) +>a12 : Symbol(a12, Decl(genericsManyTypeParameters.ts, 31, 40)) +>b12 : Symbol(b12, Decl(genericsManyTypeParameters.ts, 31, 51)) +>c12 : Symbol(c12, Decl(genericsManyTypeParameters.ts, 31, 62)) + + x13 , y15 , z13 , a13 , b13 , c13, +>x13 : Symbol(x13, Decl(genericsManyTypeParameters.ts, 31, 73)) +>y15 : Symbol(y15, Decl(genericsManyTypeParameters.ts, 32, 18)) +>z13 : Symbol(z13, Decl(genericsManyTypeParameters.ts, 32, 29)) +>a13 : Symbol(a13, Decl(genericsManyTypeParameters.ts, 32, 40)) +>b13 : Symbol(b13, Decl(genericsManyTypeParameters.ts, 32, 51)) +>c13 : Symbol(c13, Decl(genericsManyTypeParameters.ts, 32, 62)) + + x14 , y16 , z14 , a14 , b14 , c14, +>x14 : Symbol(x14, Decl(genericsManyTypeParameters.ts, 32, 73)) +>y16 : Symbol(y16, Decl(genericsManyTypeParameters.ts, 33, 18)) +>z14 : Symbol(z14, Decl(genericsManyTypeParameters.ts, 33, 29)) +>a14 : Symbol(a14, Decl(genericsManyTypeParameters.ts, 33, 40)) +>b14 : Symbol(b14, Decl(genericsManyTypeParameters.ts, 33, 51)) +>c14 : Symbol(c14, Decl(genericsManyTypeParameters.ts, 33, 62)) + + x15 , y17 , z15 , a15 , b15 , c15, +>x15 : Symbol(x15, Decl(genericsManyTypeParameters.ts, 33, 73)) +>y17 : Symbol(y17, Decl(genericsManyTypeParameters.ts, 34, 18)) +>z15 : Symbol(z15, Decl(genericsManyTypeParameters.ts, 34, 29)) +>a15 : Symbol(a15, Decl(genericsManyTypeParameters.ts, 34, 40)) +>b15 : Symbol(b15, Decl(genericsManyTypeParameters.ts, 34, 51)) +>c15 : Symbol(c15, Decl(genericsManyTypeParameters.ts, 34, 62)) + + x16 , y18 , z16 , a16 , b16 , c16, +>x16 : Symbol(x16, Decl(genericsManyTypeParameters.ts, 34, 73)) +>y18 : Symbol(y18, Decl(genericsManyTypeParameters.ts, 35, 18)) +>z16 : Symbol(z16, Decl(genericsManyTypeParameters.ts, 35, 29)) +>a16 : Symbol(a16, Decl(genericsManyTypeParameters.ts, 35, 40)) +>b16 : Symbol(b16, Decl(genericsManyTypeParameters.ts, 35, 51)) +>c16 : Symbol(c16, Decl(genericsManyTypeParameters.ts, 35, 62)) + + x17 , y19 , z17 , a17 , b17 , c17, +>x17 : Symbol(x17, Decl(genericsManyTypeParameters.ts, 35, 73)) +>y19 : Symbol(y19, Decl(genericsManyTypeParameters.ts, 36, 18)) +>z17 : Symbol(z17, Decl(genericsManyTypeParameters.ts, 36, 29)) +>a17 : Symbol(a17, Decl(genericsManyTypeParameters.ts, 36, 40)) +>b17 : Symbol(b17, Decl(genericsManyTypeParameters.ts, 36, 51)) +>c17 : Symbol(c17, Decl(genericsManyTypeParameters.ts, 36, 62)) + + x18 , y10 , z18 , a18 , b18 , c18]; +>x18 : Symbol(x18, Decl(genericsManyTypeParameters.ts, 36, 73)) +>y10 : Symbol(y10, Decl(genericsManyTypeParameters.ts, 37, 18)) +>z18 : Symbol(z18, Decl(genericsManyTypeParameters.ts, 37, 29)) +>a18 : Symbol(a18, Decl(genericsManyTypeParameters.ts, 37, 40)) +>b18 : Symbol(b18, Decl(genericsManyTypeParameters.ts, 37, 51)) +>c18 : Symbol(c18, Decl(genericsManyTypeParameters.ts, 37, 62)) + } diff --git a/tests/baselines/reference/getterSetterNonAccessor.symbols b/tests/baselines/reference/getterSetterNonAccessor.symbols new file mode 100644 index 00000000000..10ffc55480c --- /dev/null +++ b/tests/baselines/reference/getterSetterNonAccessor.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/getterSetterNonAccessor.ts === +function getFunc():any{return 0;} +>getFunc : Symbol(getFunc, Decl(getterSetterNonAccessor.ts, 0, 0)) + +function setFunc(v){} +>setFunc : Symbol(setFunc, Decl(getterSetterNonAccessor.ts, 0, 33)) +>v : Symbol(v, Decl(getterSetterNonAccessor.ts, 1, 17)) + +Object.defineProperty({}, "0", ({ +>Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.d.ts, 160, 60)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.d.ts, 160, 60)) +>PropertyDescriptor : Symbol(PropertyDescriptor, Decl(lib.d.ts, 79, 66)) + + get: getFunc, +>get : Symbol(get, Decl(getterSetterNonAccessor.ts, 3, 53)) +>getFunc : Symbol(getFunc, Decl(getterSetterNonAccessor.ts, 0, 0)) + + set: setFunc, +>set : Symbol(set, Decl(getterSetterNonAccessor.ts, 4, 23)) +>setFunc : Symbol(setFunc, Decl(getterSetterNonAccessor.ts, 0, 33)) + + configurable: true +>configurable : Symbol(configurable, Decl(getterSetterNonAccessor.ts, 5, 23)) + + })); + diff --git a/tests/baselines/reference/getterSetterNonAccessor.types b/tests/baselines/reference/getterSetterNonAccessor.types index f3e5d549cff..48d9f9c85e0 100644 --- a/tests/baselines/reference/getterSetterNonAccessor.types +++ b/tests/baselines/reference/getterSetterNonAccessor.types @@ -1,6 +1,7 @@ === tests/cases/compiler/getterSetterNonAccessor.ts === function getFunc():any{return 0;} >getFunc : () => any +>0 : number function setFunc(v){} >setFunc : (v: any) => void @@ -12,6 +13,7 @@ Object.defineProperty({}, "0", ({ >Object : ObjectConstructor >defineProperty : (o: any, p: string, attributes: PropertyDescriptor) => any >{} : {} +>"0" : string >({ get: getFunc, set: setFunc, configurable: true }) : PropertyDescriptor >PropertyDescriptor : PropertyDescriptor >({ get: getFunc, set: setFunc, configurable: true }) : { get: () => any; set: (v: any) => void; configurable: boolean; } @@ -27,6 +29,7 @@ Object.defineProperty({}, "0", ({ configurable: true >configurable : boolean +>true : boolean })); diff --git a/tests/baselines/reference/global.symbols b/tests/baselines/reference/global.symbols new file mode 100644 index 00000000000..ec7ab7d0ef2 --- /dev/null +++ b/tests/baselines/reference/global.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/global.ts === +module M { +>M : Symbol(M, Decl(global.ts, 0, 0)) + + export function f(y:number) { +>f : Symbol(f, Decl(global.ts, 0, 10)) +>y : Symbol(y, Decl(global.ts, 1, 22)) + + return x+y; +>x : Symbol(x, Decl(global.ts, 6, 3)) +>y : Symbol(y, Decl(global.ts, 1, 22)) + } +} + +var x=10; +>x : Symbol(x, Decl(global.ts, 6, 3)) + +M.f(3); +>M.f : Symbol(M.f, Decl(global.ts, 0, 10)) +>M : Symbol(M, Decl(global.ts, 0, 0)) +>f : Symbol(M.f, Decl(global.ts, 0, 10)) + + diff --git a/tests/baselines/reference/global.types b/tests/baselines/reference/global.types index 86d5dd3c986..f866f062068 100644 --- a/tests/baselines/reference/global.types +++ b/tests/baselines/reference/global.types @@ -15,11 +15,13 @@ module M { var x=10; >x : number +>10 : number M.f(3); >M.f(3) : number >M.f : (y: number) => number >M : typeof M >f : (y: number) => number +>3 : number diff --git a/tests/baselines/reference/globalThis.symbols b/tests/baselines/reference/globalThis.symbols new file mode 100644 index 00000000000..77b65bbfa2b --- /dev/null +++ b/tests/baselines/reference/globalThis.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/globalThis.ts === +var __e = Math.E; // should not generate 'this.Math.E' +>__e : Symbol(__e, Decl(globalThis.ts, 0, 3)) +>Math.E : Symbol(Math.E, Decl(lib.d.ts, 524, 16)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>E : Symbol(Math.E, Decl(lib.d.ts, 524, 16)) + diff --git a/tests/baselines/reference/globalThisCapture.symbols b/tests/baselines/reference/globalThisCapture.symbols new file mode 100644 index 00000000000..bfb7bf147c0 --- /dev/null +++ b/tests/baselines/reference/globalThisCapture.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/globalThisCapture.ts === +// Add a lambda to ensure global 'this' capture is triggered +(()=>this.window); + +var parts = []; +>parts : Symbol(parts, Decl(globalThisCapture.ts, 3, 3)) + +// Ensure that the generated code is correct +parts[0]; +>parts : Symbol(parts, Decl(globalThisCapture.ts, 3, 3)) + diff --git a/tests/baselines/reference/globalThisCapture.types b/tests/baselines/reference/globalThisCapture.types index 71bb4e99853..b8ed146d8c4 100644 --- a/tests/baselines/reference/globalThisCapture.types +++ b/tests/baselines/reference/globalThisCapture.types @@ -15,4 +15,5 @@ var parts = []; parts[0]; >parts[0] : any >parts : any[] +>0 : number diff --git a/tests/baselines/reference/heterogeneousArrayLiterals.symbols b/tests/baselines/reference/heterogeneousArrayLiterals.symbols new file mode 100644 index 00000000000..c7a73d56414 --- /dev/null +++ b/tests/baselines/reference/heterogeneousArrayLiterals.symbols @@ -0,0 +1,417 @@ +=== tests/cases/conformance/types/typeRelationships/bestCommonType/heterogeneousArrayLiterals.ts === +// type of an array is the best common type of its elements (plus its contextual type if it exists) + +var a = [1, '']; // {}[] +>a : Symbol(a, Decl(heterogeneousArrayLiterals.ts, 2, 3)) + +var b = [1, null]; // number[] +>b : Symbol(b, Decl(heterogeneousArrayLiterals.ts, 3, 3)) + +var c = [1, '', null]; // {}[] +>c : Symbol(c, Decl(heterogeneousArrayLiterals.ts, 4, 3)) + +var d = [{}, 1]; // {}[] +>d : Symbol(d, Decl(heterogeneousArrayLiterals.ts, 5, 3)) + +var e = [{}, Object]; // {}[] +>e : Symbol(e, Decl(heterogeneousArrayLiterals.ts, 6, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var f = [[], [1]]; // number[][] +>f : Symbol(f, Decl(heterogeneousArrayLiterals.ts, 8, 3)) + +var g = [[1], ['']]; // {}[] +>g : Symbol(g, Decl(heterogeneousArrayLiterals.ts, 9, 3)) + +var h = [{ foo: 1, bar: '' }, { foo: 2 }]; // {foo: number}[] +>h : Symbol(h, Decl(heterogeneousArrayLiterals.ts, 11, 3)) +>foo : Symbol(foo, Decl(heterogeneousArrayLiterals.ts, 11, 10)) +>bar : Symbol(bar, Decl(heterogeneousArrayLiterals.ts, 11, 18)) +>foo : Symbol(foo, Decl(heterogeneousArrayLiterals.ts, 11, 31)) + +var i = [{ foo: 1, bar: '' }, { foo: '' }]; // {}[] +>i : Symbol(i, Decl(heterogeneousArrayLiterals.ts, 12, 3)) +>foo : Symbol(foo, Decl(heterogeneousArrayLiterals.ts, 12, 10)) +>bar : Symbol(bar, Decl(heterogeneousArrayLiterals.ts, 12, 18)) +>foo : Symbol(foo, Decl(heterogeneousArrayLiterals.ts, 12, 31)) + +var j = [() => 1, () => '']; // {}[] +>j : Symbol(j, Decl(heterogeneousArrayLiterals.ts, 14, 3)) + +var k = [() => 1, () => 1]; // { (): number }[] +>k : Symbol(k, Decl(heterogeneousArrayLiterals.ts, 15, 3)) + +var l = [() => 1, () => null]; // { (): any }[] +>l : Symbol(l, Decl(heterogeneousArrayLiterals.ts, 16, 3)) + +var m = [() => 1, () => '', () => null]; // { (): any }[] +>m : Symbol(m, Decl(heterogeneousArrayLiterals.ts, 17, 3)) + +var n = [[() => 1], [() => '']]; // {}[] +>n : Symbol(n, Decl(heterogeneousArrayLiterals.ts, 18, 3)) + +class Base { foo: string; } +>Base : Symbol(Base, Decl(heterogeneousArrayLiterals.ts, 18, 32)) +>foo : Symbol(foo, Decl(heterogeneousArrayLiterals.ts, 20, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(heterogeneousArrayLiterals.ts, 20, 27), Decl(heterogeneousArrayLiterals.ts, 25, 23)) +>Base : Symbol(Base, Decl(heterogeneousArrayLiterals.ts, 18, 32)) +>bar : Symbol(bar, Decl(heterogeneousArrayLiterals.ts, 21, 28)) + +class Derived2 extends Base { baz: string; } +>Derived2 : Symbol(Derived2, Decl(heterogeneousArrayLiterals.ts, 21, 43)) +>Base : Symbol(Base, Decl(heterogeneousArrayLiterals.ts, 18, 32)) +>baz : Symbol(baz, Decl(heterogeneousArrayLiterals.ts, 22, 29)) + +var base: Base; +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) +>Base : Symbol(Base, Decl(heterogeneousArrayLiterals.ts, 18, 32)) + +var derived: Derived; +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) +>Derived : Symbol(Derived, Decl(heterogeneousArrayLiterals.ts, 20, 27), Decl(heterogeneousArrayLiterals.ts, 25, 23)) + +var derived2: Derived2; +>derived2 : Symbol(derived2, Decl(heterogeneousArrayLiterals.ts, 25, 3)) +>Derived2 : Symbol(Derived2, Decl(heterogeneousArrayLiterals.ts, 21, 43)) + +module Derived { +>Derived : Symbol(Derived, Decl(heterogeneousArrayLiterals.ts, 20, 27), Decl(heterogeneousArrayLiterals.ts, 25, 23)) + + var h = [{ foo: base, basear: derived }, { foo: base }]; // {foo: Base}[] +>h : Symbol(h, Decl(heterogeneousArrayLiterals.ts, 28, 7)) +>foo : Symbol(foo, Decl(heterogeneousArrayLiterals.ts, 28, 14)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) +>basear : Symbol(basear, Decl(heterogeneousArrayLiterals.ts, 28, 25)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) +>foo : Symbol(foo, Decl(heterogeneousArrayLiterals.ts, 28, 46)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) + + var i = [{ foo: base, basear: derived }, { foo: derived }]; // {foo: Derived}[] +>i : Symbol(i, Decl(heterogeneousArrayLiterals.ts, 29, 7)) +>foo : Symbol(foo, Decl(heterogeneousArrayLiterals.ts, 29, 14)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) +>basear : Symbol(basear, Decl(heterogeneousArrayLiterals.ts, 29, 25)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) +>foo : Symbol(foo, Decl(heterogeneousArrayLiterals.ts, 29, 46)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) + + var j = [() => base, () => derived]; // { {}: Base } +>j : Symbol(j, Decl(heterogeneousArrayLiterals.ts, 31, 7)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) + + var k = [() => base, () => 1]; // {}[]~ +>k : Symbol(k, Decl(heterogeneousArrayLiterals.ts, 32, 7)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) + + var l = [() => base, () => null]; // { (): any }[] +>l : Symbol(l, Decl(heterogeneousArrayLiterals.ts, 33, 7)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) + + var m = [() => base, () => derived, () => null]; // { (): any }[] +>m : Symbol(m, Decl(heterogeneousArrayLiterals.ts, 34, 7)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) + + var n = [[() => base], [() => derived]]; // { (): Base }[] +>n : Symbol(n, Decl(heterogeneousArrayLiterals.ts, 35, 7)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) + + var o = [derived, derived2]; // {}[] +>o : Symbol(o, Decl(heterogeneousArrayLiterals.ts, 36, 7)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) +>derived2 : Symbol(derived2, Decl(heterogeneousArrayLiterals.ts, 25, 3)) + + var p = [derived, derived2, base]; // Base[] +>p : Symbol(p, Decl(heterogeneousArrayLiterals.ts, 37, 7)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) +>derived2 : Symbol(derived2, Decl(heterogeneousArrayLiterals.ts, 25, 3)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) + + var q = [[() => derived2], [() => derived]]; // {}[] +>q : Symbol(q, Decl(heterogeneousArrayLiterals.ts, 38, 7)) +>derived2 : Symbol(derived2, Decl(heterogeneousArrayLiterals.ts, 25, 3)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) +} + +module WithContextualType { +>WithContextualType : Symbol(WithContextualType, Decl(heterogeneousArrayLiterals.ts, 39, 1)) + + // no errors + var a: Base[] = [derived, derived2]; +>a : Symbol(a, Decl(heterogeneousArrayLiterals.ts, 43, 7)) +>Base : Symbol(Base, Decl(heterogeneousArrayLiterals.ts, 18, 32)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) +>derived2 : Symbol(derived2, Decl(heterogeneousArrayLiterals.ts, 25, 3)) + + var b: Derived[] = [null]; +>b : Symbol(b, Decl(heterogeneousArrayLiterals.ts, 44, 7)) +>Derived : Symbol(Derived, Decl(heterogeneousArrayLiterals.ts, 20, 27), Decl(heterogeneousArrayLiterals.ts, 25, 23)) + + var c: Derived[] = []; +>c : Symbol(c, Decl(heterogeneousArrayLiterals.ts, 45, 7)) +>Derived : Symbol(Derived, Decl(heterogeneousArrayLiterals.ts, 20, 27), Decl(heterogeneousArrayLiterals.ts, 25, 23)) + + var d: { (): Base }[] = [() => derived, () => derived2]; +>d : Symbol(d, Decl(heterogeneousArrayLiterals.ts, 46, 7)) +>Base : Symbol(Base, Decl(heterogeneousArrayLiterals.ts, 18, 32)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) +>derived2 : Symbol(derived2, Decl(heterogeneousArrayLiterals.ts, 25, 3)) +} + +function foo(t: T, u: U) { +>foo : Symbol(foo, Decl(heterogeneousArrayLiterals.ts, 47, 1)) +>T : Symbol(T, Decl(heterogeneousArrayLiterals.ts, 49, 13)) +>U : Symbol(U, Decl(heterogeneousArrayLiterals.ts, 49, 15)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 49, 19)) +>T : Symbol(T, Decl(heterogeneousArrayLiterals.ts, 49, 13)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 49, 24)) +>U : Symbol(U, Decl(heterogeneousArrayLiterals.ts, 49, 15)) + + var a = [t, t]; // T[] +>a : Symbol(a, Decl(heterogeneousArrayLiterals.ts, 50, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 49, 19)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 49, 19)) + + var b = [t, null]; // T[] +>b : Symbol(b, Decl(heterogeneousArrayLiterals.ts, 51, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 49, 19)) + + var c = [t, u]; // {}[] +>c : Symbol(c, Decl(heterogeneousArrayLiterals.ts, 52, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 49, 19)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 49, 24)) + + var d = [t, 1]; // {}[] +>d : Symbol(d, Decl(heterogeneousArrayLiterals.ts, 53, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 49, 19)) + + var e = [() => t, () => u]; // {}[] +>e : Symbol(e, Decl(heterogeneousArrayLiterals.ts, 54, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 49, 19)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 49, 24)) + + var f = [() => t, () => u, () => null]; // { (): any }[] +>f : Symbol(f, Decl(heterogeneousArrayLiterals.ts, 55, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 49, 19)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 49, 24)) +} + +function foo2(t: T, u: U) { +>foo2 : Symbol(foo2, Decl(heterogeneousArrayLiterals.ts, 56, 1)) +>T : Symbol(T, Decl(heterogeneousArrayLiterals.ts, 58, 14)) +>Base : Symbol(Base, Decl(heterogeneousArrayLiterals.ts, 18, 32)) +>U : Symbol(U, Decl(heterogeneousArrayLiterals.ts, 58, 29)) +>Derived : Symbol(Derived, Decl(heterogeneousArrayLiterals.ts, 20, 27), Decl(heterogeneousArrayLiterals.ts, 25, 23)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 58, 49)) +>T : Symbol(T, Decl(heterogeneousArrayLiterals.ts, 58, 14)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 58, 54)) +>U : Symbol(U, Decl(heterogeneousArrayLiterals.ts, 58, 29)) + + var a = [t, t]; // T[] +>a : Symbol(a, Decl(heterogeneousArrayLiterals.ts, 59, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 58, 49)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 58, 49)) + + var b = [t, null]; // T[] +>b : Symbol(b, Decl(heterogeneousArrayLiterals.ts, 60, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 58, 49)) + + var c = [t, u]; // {}[] +>c : Symbol(c, Decl(heterogeneousArrayLiterals.ts, 61, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 58, 49)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 58, 54)) + + var d = [t, 1]; // {}[] +>d : Symbol(d, Decl(heterogeneousArrayLiterals.ts, 62, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 58, 49)) + + var e = [() => t, () => u]; // {}[] +>e : Symbol(e, Decl(heterogeneousArrayLiterals.ts, 63, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 58, 49)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 58, 54)) + + var f = [() => t, () => u, () => null]; // { (): any }[] +>f : Symbol(f, Decl(heterogeneousArrayLiterals.ts, 64, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 58, 49)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 58, 54)) + + var g = [t, base]; // Base[] +>g : Symbol(g, Decl(heterogeneousArrayLiterals.ts, 66, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 58, 49)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) + + var h = [t, derived]; // Derived[] +>h : Symbol(h, Decl(heterogeneousArrayLiterals.ts, 67, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 58, 49)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) + + var i = [u, base]; // Base[] +>i : Symbol(i, Decl(heterogeneousArrayLiterals.ts, 68, 7)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 58, 54)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) + + var j = [u, derived]; // Derived[] +>j : Symbol(j, Decl(heterogeneousArrayLiterals.ts, 69, 7)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 58, 54)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) +} + +function foo3(t: T, u: U) { +>foo3 : Symbol(foo3, Decl(heterogeneousArrayLiterals.ts, 70, 1)) +>T : Symbol(T, Decl(heterogeneousArrayLiterals.ts, 72, 14)) +>Derived : Symbol(Derived, Decl(heterogeneousArrayLiterals.ts, 20, 27), Decl(heterogeneousArrayLiterals.ts, 25, 23)) +>U : Symbol(U, Decl(heterogeneousArrayLiterals.ts, 72, 32)) +>Derived : Symbol(Derived, Decl(heterogeneousArrayLiterals.ts, 20, 27), Decl(heterogeneousArrayLiterals.ts, 25, 23)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 72, 52)) +>T : Symbol(T, Decl(heterogeneousArrayLiterals.ts, 72, 14)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 72, 57)) +>U : Symbol(U, Decl(heterogeneousArrayLiterals.ts, 72, 32)) + + var a = [t, t]; // T[] +>a : Symbol(a, Decl(heterogeneousArrayLiterals.ts, 73, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 72, 52)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 72, 52)) + + var b = [t, null]; // T[] +>b : Symbol(b, Decl(heterogeneousArrayLiterals.ts, 74, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 72, 52)) + + var c = [t, u]; // {}[] +>c : Symbol(c, Decl(heterogeneousArrayLiterals.ts, 75, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 72, 52)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 72, 57)) + + var d = [t, 1]; // {}[] +>d : Symbol(d, Decl(heterogeneousArrayLiterals.ts, 76, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 72, 52)) + + var e = [() => t, () => u]; // {}[] +>e : Symbol(e, Decl(heterogeneousArrayLiterals.ts, 77, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 72, 52)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 72, 57)) + + var f = [() => t, () => u, () => null]; // { (): any }[] +>f : Symbol(f, Decl(heterogeneousArrayLiterals.ts, 78, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 72, 52)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 72, 57)) + + var g = [t, base]; // Base[] +>g : Symbol(g, Decl(heterogeneousArrayLiterals.ts, 80, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 72, 52)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) + + var h = [t, derived]; // Derived[] +>h : Symbol(h, Decl(heterogeneousArrayLiterals.ts, 81, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 72, 52)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) + + var i = [u, base]; // Base[] +>i : Symbol(i, Decl(heterogeneousArrayLiterals.ts, 82, 7)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 72, 57)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) + + var j = [u, derived]; // Derived[] +>j : Symbol(j, Decl(heterogeneousArrayLiterals.ts, 83, 7)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 72, 57)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) +} + +function foo4(t: T, u: U) { +>foo4 : Symbol(foo4, Decl(heterogeneousArrayLiterals.ts, 84, 1)) +>T : Symbol(T, Decl(heterogeneousArrayLiterals.ts, 86, 14)) +>Base : Symbol(Base, Decl(heterogeneousArrayLiterals.ts, 18, 32)) +>U : Symbol(U, Decl(heterogeneousArrayLiterals.ts, 86, 29)) +>Base : Symbol(Base, Decl(heterogeneousArrayLiterals.ts, 18, 32)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 86, 46)) +>T : Symbol(T, Decl(heterogeneousArrayLiterals.ts, 86, 14)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 86, 51)) +>U : Symbol(U, Decl(heterogeneousArrayLiterals.ts, 86, 29)) + + var a = [t, t]; // T[] +>a : Symbol(a, Decl(heterogeneousArrayLiterals.ts, 87, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 86, 46)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 86, 46)) + + var b = [t, null]; // T[] +>b : Symbol(b, Decl(heterogeneousArrayLiterals.ts, 88, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 86, 46)) + + var c = [t, u]; // BUG 821629 +>c : Symbol(c, Decl(heterogeneousArrayLiterals.ts, 89, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 86, 46)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 86, 51)) + + var d = [t, 1]; // {}[] +>d : Symbol(d, Decl(heterogeneousArrayLiterals.ts, 90, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 86, 46)) + + var e = [() => t, () => u]; // {}[] +>e : Symbol(e, Decl(heterogeneousArrayLiterals.ts, 91, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 86, 46)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 86, 51)) + + var f = [() => t, () => u, () => null]; // { (): any }[] +>f : Symbol(f, Decl(heterogeneousArrayLiterals.ts, 92, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 86, 46)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 86, 51)) + + var g = [t, base]; // Base[] +>g : Symbol(g, Decl(heterogeneousArrayLiterals.ts, 94, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 86, 46)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) + + var h = [t, derived]; // Derived[] +>h : Symbol(h, Decl(heterogeneousArrayLiterals.ts, 95, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 86, 46)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) + + var i = [u, base]; // Base[] +>i : Symbol(i, Decl(heterogeneousArrayLiterals.ts, 96, 7)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 86, 51)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) + + var j = [u, derived]; // Derived[] +>j : Symbol(j, Decl(heterogeneousArrayLiterals.ts, 97, 7)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 86, 51)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) + + var k: Base[] = [t, u]; +>k : Symbol(k, Decl(heterogeneousArrayLiterals.ts, 99, 7)) +>Base : Symbol(Base, Decl(heterogeneousArrayLiterals.ts, 18, 32)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 86, 46)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 86, 51)) +} + +//function foo3(t: T, u: U) { +// var a = [t, t]; // T[] +// var b = [t, null]; // T[] +// var c = [t, u]; // {}[] +// var d = [t, 1]; // {}[] +// var e = [() => t, () => u]; // {}[] +// var f = [() => t, () => u, () => 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: T, u: U) { +// var a = [t, t]; // T[] +// var b = [t, null]; // T[] +// var c = [t, u]; // BUG 821629 +// var d = [t, 1]; // {}[] +// var e = [() => t, () => u]; // {}[] +// var f = [() => t, () => u, () => null]; // { (): any }[] + +// var g = [t, base]; // Base[] +// var h = [t, derived]; // Derived[] +// var i = [u, base]; // Base[] +// var j = [u, derived]; // Derived[] + +// var k: Base[] = [t, u]; +//} diff --git a/tests/baselines/reference/heterogeneousArrayLiterals.types b/tests/baselines/reference/heterogeneousArrayLiterals.types index dc4e21d85ee..81fa915ab03 100644 --- a/tests/baselines/reference/heterogeneousArrayLiterals.types +++ b/tests/baselines/reference/heterogeneousArrayLiterals.types @@ -4,19 +4,27 @@ var a = [1, '']; // {}[] >a : (string | number)[] >[1, ''] : (string | number)[] +>1 : number +>'' : string var b = [1, null]; // number[] >b : number[] >[1, null] : number[] +>1 : number +>null : null var c = [1, '', null]; // {}[] >c : (string | number)[] >[1, '', null] : (string | number)[] +>1 : number +>'' : string +>null : null var d = [{}, 1]; // {}[] >d : {}[] >[{}, 1] : {}[] >{} : {} +>1 : number var e = [{}, Object]; // {}[] >e : {}[] @@ -29,63 +37,83 @@ var f = [[], [1]]; // number[][] >[[], [1]] : number[][] >[] : undefined[] >[1] : number[] +>1 : number var g = [[1], ['']]; // {}[] >g : (string[] | number[])[] >[[1], ['']] : (string[] | number[])[] >[1] : number[] +>1 : number >[''] : string[] +>'' : string var h = [{ foo: 1, bar: '' }, { foo: 2 }]; // {foo: number}[] >h : { foo: number; }[] >[{ foo: 1, bar: '' }, { foo: 2 }] : { foo: number; }[] >{ foo: 1, bar: '' } : { foo: number; bar: string; } >foo : number +>1 : number >bar : string +>'' : string >{ foo: 2 } : { foo: number; } >foo : number +>2 : number var i = [{ foo: 1, bar: '' }, { foo: '' }]; // {}[] >i : ({ foo: number; bar: string; } | { foo: string; })[] >[{ foo: 1, bar: '' }, { foo: '' }] : ({ foo: number; bar: string; } | { foo: string; })[] >{ foo: 1, bar: '' } : { foo: number; bar: string; } >foo : number +>1 : number >bar : string +>'' : string >{ foo: '' } : { foo: string; } >foo : string +>'' : string var j = [() => 1, () => '']; // {}[] >j : ((() => number) | (() => string))[] >[() => 1, () => ''] : ((() => number) | (() => string))[] >() => 1 : () => number +>1 : number >() => '' : () => string +>'' : string var k = [() => 1, () => 1]; // { (): number }[] >k : (() => number)[] >[() => 1, () => 1] : (() => number)[] >() => 1 : () => number +>1 : number >() => 1 : () => number +>1 : number var l = [() => 1, () => null]; // { (): any }[] >l : (() => any)[] >[() => 1, () => null] : (() => any)[] >() => 1 : () => number +>1 : number >() => null : () => any +>null : null var m = [() => 1, () => '', () => null]; // { (): any }[] >m : (() => any)[] >[() => 1, () => '', () => null] : (() => any)[] >() => 1 : () => number +>1 : number >() => '' : () => string +>'' : string >() => null : () => any +>null : null var n = [[() => 1], [() => '']]; // {}[] >n : ((() => number)[] | (() => string)[])[] >[[() => 1], [() => '']] : ((() => number)[] | (() => string)[])[] >[() => 1] : (() => number)[] >() => 1 : () => number +>1 : number >[() => ''] : (() => string)[] >() => '' : () => string +>'' : string class Base { foo: string; } >Base : Base @@ -154,6 +182,7 @@ module Derived { >() => base : () => Base >base : Base >() => 1 : () => number +>1 : number var l = [() => base, () => null]; // { (): any }[] >l : (() => any)[] @@ -161,6 +190,7 @@ module Derived { >() => base : () => Base >base : Base >() => null : () => any +>null : null var m = [() => base, () => derived, () => null]; // { (): any }[] >m : (() => any)[] @@ -170,6 +200,7 @@ module Derived { >() => derived : () => Derived >derived : Derived >() => null : () => any +>null : null var n = [[() => base], [() => derived]]; // { (): Base }[] >n : (() => Base)[][] @@ -220,6 +251,7 @@ module WithContextualType { >b : Derived[] >Derived : Derived >[null] : null[] +>null : null var c: Derived[] = []; >c : Derived[] @@ -255,6 +287,7 @@ function foo(t: T, u: U) { >b : T[] >[t, null] : T[] >t : T +>null : null var c = [t, u]; // {}[] >c : (T | U)[] @@ -266,6 +299,7 @@ function foo(t: T, u: U) { >d : (number | T)[] >[t, 1] : (number | T)[] >t : T +>1 : number var e = [() => t, () => u]; // {}[] >e : ((() => T) | (() => U))[] @@ -283,6 +317,7 @@ function foo(t: T, u: U) { >() => u : () => U >u : U >() => null : () => any +>null : null } function foo2(t: T, u: U) { @@ -306,6 +341,7 @@ function foo2(t: T, u: U) { >b : T[] >[t, null] : T[] >t : T +>null : null var c = [t, u]; // {}[] >c : (T | U)[] @@ -317,6 +353,7 @@ function foo2(t: T, u: U) { >d : (number | T)[] >[t, 1] : (number | T)[] >t : T +>1 : number var e = [() => t, () => u]; // {}[] >e : ((() => T) | (() => U))[] @@ -334,6 +371,7 @@ function foo2(t: T, u: U) { >() => u : () => U >u : U >() => null : () => any +>null : null var g = [t, base]; // Base[] >g : Base[] @@ -381,6 +419,7 @@ function foo3(t: T, u: U) { >b : T[] >[t, null] : T[] >t : T +>null : null var c = [t, u]; // {}[] >c : (T | U)[] @@ -392,6 +431,7 @@ function foo3(t: T, u: U) { >d : (number | T)[] >[t, 1] : (number | T)[] >t : T +>1 : number var e = [() => t, () => u]; // {}[] >e : ((() => T) | (() => U))[] @@ -409,6 +449,7 @@ function foo3(t: T, u: U) { >() => u : () => U >u : U >() => null : () => any +>null : null var g = [t, base]; // Base[] >g : Base[] @@ -456,6 +497,7 @@ function foo4(t: T, u: U) { >b : T[] >[t, null] : T[] >t : T +>null : null var c = [t, u]; // BUG 821629 >c : (T | U)[] @@ -467,6 +509,7 @@ function foo4(t: T, u: U) { >d : (number | T)[] >[t, 1] : (number | T)[] >t : T +>1 : number var e = [() => t, () => u]; // {}[] >e : ((() => T) | (() => U))[] @@ -484,6 +527,7 @@ function foo4(t: T, u: U) { >() => u : () => U >u : U >() => null : () => any +>null : null var g = [t, base]; // Base[] >g : Base[] diff --git a/tests/baselines/reference/heterogeneousArrayLiterals.types.pull b/tests/baselines/reference/heterogeneousArrayLiterals.types.pull deleted file mode 100644 index e35caeed74a..00000000000 --- a/tests/baselines/reference/heterogeneousArrayLiterals.types.pull +++ /dev/null @@ -1,548 +0,0 @@ -=== tests/cases/conformance/types/typeRelationships/bestCommonType/heterogeneousArrayLiterals.ts === -// type of an array is the best common type of its elements (plus its contextual type if it exists) - -var a = [1, '']; // {}[] ->a : (string | number)[] ->[1, ''] : (string | number)[] - -var b = [1, null]; // number[] ->b : number[] ->[1, null] : number[] - -var c = [1, '', null]; // {}[] ->c : (string | number)[] ->[1, '', null] : (string | number)[] - -var d = [{}, 1]; // {}[] ->d : {}[] ->[{}, 1] : {}[] ->{} : {} - -var e = [{}, Object]; // {}[] ->e : {}[] ->[{}, Object] : {}[] ->{} : {} ->Object : ObjectConstructor - -var f = [[], [1]]; // number[][] ->f : number[][] ->[[], [1]] : number[][] ->[] : undefined[] ->[1] : number[] - -var g = [[1], ['']]; // {}[] ->g : (number[] | string[])[] ->[[1], ['']] : (number[] | string[])[] ->[1] : number[] ->[''] : string[] - -var h = [{ foo: 1, bar: '' }, { foo: 2 }]; // {foo: number}[] ->h : { foo: number; }[] ->[{ foo: 1, bar: '' }, { foo: 2 }] : { foo: number; }[] ->{ foo: 1, bar: '' } : { foo: number; bar: string; } ->foo : number ->bar : string ->{ foo: 2 } : { foo: number; } ->foo : number - -var i = [{ foo: 1, bar: '' }, { foo: '' }]; // {}[] ->i : ({ foo: number; bar: string; } | { foo: string; })[] ->[{ foo: 1, bar: '' }, { foo: '' }] : ({ foo: number; bar: string; } | { foo: string; })[] ->{ foo: 1, bar: '' } : { foo: number; bar: string; } ->foo : number ->bar : string ->{ foo: '' } : { foo: string; } ->foo : string - -var j = [() => 1, () => '']; // {}[] ->j : ((() => number) | (() => string))[] ->[() => 1, () => ''] : ((() => number) | (() => string))[] ->() => 1 : () => number ->() => '' : () => string - -var k = [() => 1, () => 1]; // { (): number }[] ->k : (() => number)[] ->[() => 1, () => 1] : (() => number)[] ->() => 1 : () => number ->() => 1 : () => number - -var l = [() => 1, () => null]; // { (): any }[] ->l : (() => any)[] ->[() => 1, () => null] : (() => any)[] ->() => 1 : () => number ->() => null : () => any - -var m = [() => 1, () => '', () => null]; // { (): any }[] ->m : (() => any)[] ->[() => 1, () => '', () => null] : (() => any)[] ->() => 1 : () => number ->() => '' : () => string ->() => null : () => any - -var n = [[() => 1], [() => '']]; // {}[] ->n : ((() => number)[] | (() => string)[])[] ->[[() => 1], [() => '']] : ((() => number)[] | (() => string)[])[] ->[() => 1] : (() => number)[] ->() => 1 : () => number ->[() => ''] : (() => string)[] ->() => '' : () => string - -class Base { foo: string; } ->Base : Base ->foo : string - -class Derived extends Base { bar: string; } ->Derived : Derived ->Base : Base ->bar : string - -class Derived2 extends Base { baz: string; } ->Derived2 : Derived2 ->Base : Base ->baz : string - -var base: Base; ->base : Base ->Base : Base - -var derived: Derived; ->derived : Derived ->Derived : Derived - -var derived2: Derived2; ->derived2 : Derived2 ->Derived2 : Derived2 - -module Derived { ->Derived : typeof Derived - - var h = [{ foo: base, basear: derived }, { foo: base }]; // {foo: Base}[] ->h : { foo: Base; }[] ->[{ foo: base, basear: derived }, { foo: base }] : { foo: Base; }[] ->{ foo: base, basear: derived } : { foo: Base; basear: Derived; } ->foo : Base ->base : Base ->basear : Derived ->derived : Derived ->{ foo: base } : { foo: Base; } ->foo : Base ->base : Base - - var i = [{ foo: base, basear: derived }, { foo: derived }]; // {foo: Derived}[] ->i : ({ foo: Base; basear: Derived; } | { foo: Derived; })[] ->[{ foo: base, basear: derived }, { foo: derived }] : ({ foo: Base; basear: Derived; } | { foo: Derived; })[] ->{ foo: base, basear: derived } : { foo: Base; basear: Derived; } ->foo : Base ->base : Base ->basear : Derived ->derived : Derived ->{ foo: derived } : { foo: Derived; } ->foo : Derived ->derived : Derived - - var j = [() => base, () => derived]; // { {}: Base } ->j : (() => Base)[] ->[() => base, () => derived] : (() => Base)[] ->() => base : () => Base ->base : Base ->() => derived : () => Derived ->derived : Derived - - var k = [() => base, () => 1]; // {}[]~ ->k : ((() => Base) | (() => number))[] ->[() => base, () => 1] : ((() => Base) | (() => number))[] ->() => base : () => Base ->base : Base ->() => 1 : () => number - - var l = [() => base, () => null]; // { (): any }[] ->l : (() => any)[] ->[() => base, () => null] : (() => any)[] ->() => base : () => Base ->base : Base ->() => null : () => any - - var m = [() => base, () => derived, () => null]; // { (): any }[] ->m : (() => any)[] ->[() => base, () => derived, () => null] : (() => any)[] ->() => base : () => Base ->base : Base ->() => derived : () => Derived ->derived : Derived ->() => null : () => any - - var n = [[() => base], [() => derived]]; // { (): Base }[] ->n : (() => Base)[][] ->[[() => base], [() => derived]] : (() => Base)[][] ->[() => base] : (() => Base)[] ->() => base : () => Base ->base : Base ->[() => derived] : (() => Derived)[] ->() => derived : () => Derived ->derived : Derived - - var o = [derived, derived2]; // {}[] ->o : (Derived | Derived2)[] ->[derived, derived2] : (Derived | Derived2)[] ->derived : Derived ->derived2 : Derived2 - - var p = [derived, derived2, base]; // Base[] ->p : Base[] ->[derived, derived2, base] : Base[] ->derived : Derived ->derived2 : Derived2 ->base : Base - - var q = [[() => derived2], [() => derived]]; // {}[] ->q : ((() => Derived2)[] | (() => Derived)[])[] ->[[() => derived2], [() => derived]] : ((() => Derived2)[] | (() => Derived)[])[] ->[() => derived2] : (() => Derived2)[] ->() => derived2 : () => Derived2 ->derived2 : Derived2 ->[() => derived] : (() => Derived)[] ->() => derived : () => Derived ->derived : Derived -} - -module WithContextualType { ->WithContextualType : typeof WithContextualType - - // no errors - var a: Base[] = [derived, derived2]; ->a : Base[] ->Base : Base ->[derived, derived2] : (Derived | Derived2)[] ->derived : Derived ->derived2 : Derived2 - - var b: Derived[] = [null]; ->b : Derived[] ->Derived : Derived ->[null] : null[] - - var c: Derived[] = []; ->c : Derived[] ->Derived : Derived ->[] : undefined[] - - var d: { (): Base }[] = [() => derived, () => derived2]; ->d : (() => Base)[] ->Base : Base ->[() => derived, () => derived2] : ((() => Derived) | (() => Derived2))[] ->() => derived : () => Derived ->derived : Derived ->() => derived2 : () => Derived2 ->derived2 : Derived2 -} - -function foo(t: T, u: U) { ->foo : (t: T, u: U) => void ->T : T ->U : U ->t : T ->T : T ->u : U ->U : U - - var a = [t, t]; // T[] ->a : T[] ->[t, t] : T[] ->t : T ->t : T - - var b = [t, null]; // T[] ->b : T[] ->[t, null] : T[] ->t : T - - var c = [t, u]; // {}[] ->c : (T | U)[] ->[t, u] : (T | U)[] ->t : T ->u : U - - var d = [t, 1]; // {}[] ->d : (number | T)[] ->[t, 1] : (number | T)[] ->t : T - - var e = [() => t, () => u]; // {}[] ->e : ((() => T) | (() => U))[] ->[() => t, () => u] : ((() => T) | (() => U))[] ->() => t : () => T ->t : T ->() => u : () => U ->u : U - - var f = [() => t, () => u, () => null]; // { (): any }[] ->f : (() => any)[] ->[() => t, () => u, () => null] : (() => any)[] ->() => t : () => T ->t : T ->() => u : () => U ->u : U ->() => null : () => any -} - -function foo2(t: T, u: U) { ->foo2 : (t: T, u: U) => void ->T : T ->Base : Base ->U : U ->Derived : Derived ->t : T ->T : T ->u : U ->U : U - - var a = [t, t]; // T[] ->a : T[] ->[t, t] : T[] ->t : T ->t : T - - var b = [t, null]; // T[] ->b : T[] ->[t, null] : T[] ->t : T - - var c = [t, u]; // {}[] ->c : (T | U)[] ->[t, u] : (T | U)[] ->t : T ->u : U - - var d = [t, 1]; // {}[] ->d : (number | T)[] ->[t, 1] : (number | T)[] ->t : T - - var e = [() => t, () => u]; // {}[] ->e : ((() => T) | (() => U))[] ->[() => t, () => u] : ((() => T) | (() => U))[] ->() => t : () => T ->t : T ->() => u : () => U ->u : U - - var f = [() => t, () => u, () => null]; // { (): any }[] ->f : (() => any)[] ->[() => t, () => u, () => null] : (() => any)[] ->() => t : () => T ->t : T ->() => u : () => U ->u : U ->() => null : () => any - - var g = [t, base]; // Base[] ->g : Base[] ->[t, base] : Base[] ->t : T ->base : Base - - var h = [t, derived]; // Derived[] ->h : (Derived | T)[] ->[t, derived] : (Derived | T)[] ->t : T ->derived : Derived - - var i = [u, base]; // Base[] ->i : Base[] ->[u, base] : Base[] ->u : U ->base : Base - - var j = [u, derived]; // Derived[] ->j : Derived[] ->[u, derived] : Derived[] ->u : U ->derived : Derived -} - -function foo3(t: T, u: U) { ->foo3 : (t: T, u: U) => void ->T : T ->Derived : Derived ->U : U ->Derived : Derived ->t : T ->T : T ->u : U ->U : U - - var a = [t, t]; // T[] ->a : T[] ->[t, t] : T[] ->t : T ->t : T - - var b = [t, null]; // T[] ->b : T[] ->[t, null] : T[] ->t : T - - var c = [t, u]; // {}[] ->c : (T | U)[] ->[t, u] : (T | U)[] ->t : T ->u : U - - var d = [t, 1]; // {}[] ->d : (number | T)[] ->[t, 1] : (number | T)[] ->t : T - - var e = [() => t, () => u]; // {}[] ->e : ((() => T) | (() => U))[] ->[() => t, () => u] : ((() => T) | (() => U))[] ->() => t : () => T ->t : T ->() => u : () => U ->u : U - - var f = [() => t, () => u, () => null]; // { (): any }[] ->f : (() => any)[] ->[() => t, () => u, () => null] : (() => any)[] ->() => t : () => T ->t : T ->() => u : () => U ->u : U ->() => null : () => any - - var g = [t, base]; // Base[] ->g : Base[] ->[t, base] : Base[] ->t : T ->base : Base - - var h = [t, derived]; // Derived[] ->h : Derived[] ->[t, derived] : Derived[] ->t : T ->derived : Derived - - var i = [u, base]; // Base[] ->i : Base[] ->[u, base] : Base[] ->u : U ->base : Base - - var j = [u, derived]; // Derived[] ->j : Derived[] ->[u, derived] : Derived[] ->u : U ->derived : Derived -} - -function foo4(t: T, u: U) { ->foo4 : (t: T, u: U) => void ->T : T ->Base : Base ->U : U ->Base : Base ->t : T ->T : T ->u : U ->U : U - - var a = [t, t]; // T[] ->a : T[] ->[t, t] : T[] ->t : T ->t : T - - var b = [t, null]; // T[] ->b : T[] ->[t, null] : T[] ->t : T - - var c = [t, u]; // BUG 821629 ->c : (T | U)[] ->[t, u] : (T | U)[] ->t : T ->u : U - - var d = [t, 1]; // {}[] ->d : (number | T)[] ->[t, 1] : (number | T)[] ->t : T - - var e = [() => t, () => u]; // {}[] ->e : ((() => T) | (() => U))[] ->[() => t, () => u] : ((() => T) | (() => U))[] ->() => t : () => T ->t : T ->() => u : () => U ->u : U - - var f = [() => t, () => u, () => null]; // { (): any }[] ->f : (() => any)[] ->[() => t, () => u, () => null] : (() => any)[] ->() => t : () => T ->t : T ->() => u : () => U ->u : U ->() => null : () => any - - var g = [t, base]; // Base[] ->g : Base[] ->[t, base] : Base[] ->t : T ->base : Base - - var h = [t, derived]; // Derived[] ->h : (Derived | T)[] ->[t, derived] : (Derived | T)[] ->t : T ->derived : Derived - - var i = [u, base]; // Base[] ->i : Base[] ->[u, base] : Base[] ->u : U ->base : Base - - var j = [u, derived]; // Derived[] ->j : (Derived | U)[] ->[u, derived] : (Derived | U)[] ->u : U ->derived : Derived - - var k: Base[] = [t, u]; ->k : Base[] ->Base : Base ->[t, u] : (T | U)[] ->t : T ->u : U -} - -//function foo3(t: T, u: U) { -// var a = [t, t]; // T[] -// var b = [t, null]; // T[] -// var c = [t, u]; // {}[] -// var d = [t, 1]; // {}[] -// var e = [() => t, () => u]; // {}[] -// var f = [() => t, () => u, () => 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: T, u: U) { -// var a = [t, t]; // T[] -// var b = [t, null]; // T[] -// var c = [t, u]; // BUG 821629 -// var d = [t, 1]; // {}[] -// var e = [() => t, () => u]; // {}[] -// var f = [() => t, () => u, () => null]; // { (): any }[] - -// var g = [t, base]; // Base[] -// var h = [t, derived]; // Derived[] -// var i = [u, base]; // Base[] -// var j = [u, derived]; // Derived[] - -// var k: Base[] = [t, u]; -//} diff --git a/tests/baselines/reference/hidingCallSignatures.symbols b/tests/baselines/reference/hidingCallSignatures.symbols new file mode 100644 index 00000000000..5f6f057f6cd --- /dev/null +++ b/tests/baselines/reference/hidingCallSignatures.symbols @@ -0,0 +1,55 @@ +=== tests/cases/compiler/hidingCallSignatures.ts === +interface C { +>C : Symbol(C, Decl(hidingCallSignatures.ts, 0, 0)) + + new (a: string): string; +>a : Symbol(a, Decl(hidingCallSignatures.ts, 1, 9)) +} + +interface D extends C { +>D : Symbol(D, Decl(hidingCallSignatures.ts, 2, 1)) +>C : Symbol(C, Decl(hidingCallSignatures.ts, 0, 0)) + + (a: string): number; // Should be ok +>a : Symbol(a, Decl(hidingCallSignatures.ts, 5, 5)) +} + +interface E { +>E : Symbol(E, Decl(hidingCallSignatures.ts, 6, 1)) + + (a: string): {}; +>a : Symbol(a, Decl(hidingCallSignatures.ts, 9, 5)) +} + +interface F extends E { +>F : Symbol(F, Decl(hidingCallSignatures.ts, 10, 1)) +>E : Symbol(E, Decl(hidingCallSignatures.ts, 6, 1)) + + (a: string): string; +>a : Symbol(a, Decl(hidingCallSignatures.ts, 13, 5)) +} + +var d: D; +>d : Symbol(d, Decl(hidingCallSignatures.ts, 16, 3)) +>D : Symbol(D, Decl(hidingCallSignatures.ts, 2, 1)) + +d(""); // number +>d : Symbol(d, Decl(hidingCallSignatures.ts, 16, 3)) + +new d(""); // should be string +>d : Symbol(d, Decl(hidingCallSignatures.ts, 16, 3)) + +var f: F; +>f : Symbol(f, Decl(hidingCallSignatures.ts, 20, 3)) +>F : Symbol(F, Decl(hidingCallSignatures.ts, 10, 1)) + +f(""); // string +>f : Symbol(f, Decl(hidingCallSignatures.ts, 20, 3)) + +var e: E; +>e : Symbol(e, Decl(hidingCallSignatures.ts, 23, 3)) +>E : Symbol(E, Decl(hidingCallSignatures.ts, 6, 1)) + +e(""); // {} +>e : Symbol(e, Decl(hidingCallSignatures.ts, 23, 3)) + diff --git a/tests/baselines/reference/hidingCallSignatures.types b/tests/baselines/reference/hidingCallSignatures.types index 90428b8db76..c45cab69d8a 100644 --- a/tests/baselines/reference/hidingCallSignatures.types +++ b/tests/baselines/reference/hidingCallSignatures.types @@ -36,10 +36,12 @@ var d: D; d(""); // number >d("") : number >d : D +>"" : string new d(""); // should be string >new d("") : string >d : D +>"" : string var f: F; >f : F @@ -48,6 +50,7 @@ var f: F; f(""); // string >f("") : string >f : F +>"" : string var e: E; >e : E @@ -56,4 +59,5 @@ var e: E; e(""); // {} >e("") : {} >e : E +>"" : string diff --git a/tests/baselines/reference/hidingConstructSignatures.symbols b/tests/baselines/reference/hidingConstructSignatures.symbols new file mode 100644 index 00000000000..d398c79ef85 --- /dev/null +++ b/tests/baselines/reference/hidingConstructSignatures.symbols @@ -0,0 +1,55 @@ +=== tests/cases/compiler/hidingConstructSignatures.ts === +interface C { +>C : Symbol(C, Decl(hidingConstructSignatures.ts, 0, 0)) + + (a: string): string; +>a : Symbol(a, Decl(hidingConstructSignatures.ts, 1, 5)) +} + +interface D extends C { +>D : Symbol(D, Decl(hidingConstructSignatures.ts, 2, 1)) +>C : Symbol(C, Decl(hidingConstructSignatures.ts, 0, 0)) + + new (a: string): number; // Should be ok +>a : Symbol(a, Decl(hidingConstructSignatures.ts, 5, 9)) +} + +interface E { +>E : Symbol(E, Decl(hidingConstructSignatures.ts, 6, 1)) + + new (a: string): {}; +>a : Symbol(a, Decl(hidingConstructSignatures.ts, 9, 9)) +} + +interface F extends E { +>F : Symbol(F, Decl(hidingConstructSignatures.ts, 10, 1)) +>E : Symbol(E, Decl(hidingConstructSignatures.ts, 6, 1)) + + new (a: string): string; +>a : Symbol(a, Decl(hidingConstructSignatures.ts, 13, 9)) +} + +var d: D; +>d : Symbol(d, Decl(hidingConstructSignatures.ts, 16, 3)) +>D : Symbol(D, Decl(hidingConstructSignatures.ts, 2, 1)) + +d(""); // string +>d : Symbol(d, Decl(hidingConstructSignatures.ts, 16, 3)) + +new d(""); // should be number +>d : Symbol(d, Decl(hidingConstructSignatures.ts, 16, 3)) + +var f: F; +>f : Symbol(f, Decl(hidingConstructSignatures.ts, 20, 3)) +>F : Symbol(F, Decl(hidingConstructSignatures.ts, 10, 1)) + +new f(""); // string +>f : Symbol(f, Decl(hidingConstructSignatures.ts, 20, 3)) + +var e: E; +>e : Symbol(e, Decl(hidingConstructSignatures.ts, 23, 3)) +>E : Symbol(E, Decl(hidingConstructSignatures.ts, 6, 1)) + +new e(""); // {} +>e : Symbol(e, Decl(hidingConstructSignatures.ts, 23, 3)) + diff --git a/tests/baselines/reference/hidingConstructSignatures.types b/tests/baselines/reference/hidingConstructSignatures.types index 99781535b5d..0fd9860de25 100644 --- a/tests/baselines/reference/hidingConstructSignatures.types +++ b/tests/baselines/reference/hidingConstructSignatures.types @@ -36,10 +36,12 @@ var d: D; d(""); // string >d("") : string >d : D +>"" : string new d(""); // should be number >new d("") : number >d : D +>"" : string var f: F; >f : F @@ -48,6 +50,7 @@ var f: F; new f(""); // string >new f("") : string >f : F +>"" : string var e: E; >e : E @@ -56,4 +59,5 @@ var e: E; new e(""); // {} >new e("") : {} >e : E +>"" : string diff --git a/tests/baselines/reference/hidingIndexSignatures.symbols b/tests/baselines/reference/hidingIndexSignatures.symbols new file mode 100644 index 00000000000..0450a1c0e4b --- /dev/null +++ b/tests/baselines/reference/hidingIndexSignatures.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/hidingIndexSignatures.ts === +interface A { +>A : Symbol(A, Decl(hidingIndexSignatures.ts, 0, 0)) + + [a: string]: {}; +>a : Symbol(a, Decl(hidingIndexSignatures.ts, 1, 5)) +} + +interface B extends A { +>B : Symbol(B, Decl(hidingIndexSignatures.ts, 2, 1)) +>A : Symbol(A, Decl(hidingIndexSignatures.ts, 0, 0)) + + [a: string]: number; // Number is not a subtype of string. Should error. +>a : Symbol(a, Decl(hidingIndexSignatures.ts, 5, 5)) +} + +var b: B; +>b : Symbol(b, Decl(hidingIndexSignatures.ts, 8, 3)) +>B : Symbol(B, Decl(hidingIndexSignatures.ts, 2, 1)) + +b[""]; // Should be number +>b : Symbol(b, Decl(hidingIndexSignatures.ts, 8, 3)) + +var a: A; +>a : Symbol(a, Decl(hidingIndexSignatures.ts, 10, 3)) +>A : Symbol(A, Decl(hidingIndexSignatures.ts, 0, 0)) + +a[""]; // Should be {} +>a : Symbol(a, Decl(hidingIndexSignatures.ts, 10, 3)) + diff --git a/tests/baselines/reference/hidingIndexSignatures.types b/tests/baselines/reference/hidingIndexSignatures.types index fe1363d1598..9a6346ace7b 100644 --- a/tests/baselines/reference/hidingIndexSignatures.types +++ b/tests/baselines/reference/hidingIndexSignatures.types @@ -21,6 +21,7 @@ var b: B; b[""]; // Should be number >b[""] : number >b : B +>"" : string var a: A; >a : A @@ -29,4 +30,5 @@ var a: A; a[""]; // Should be {} >a[""] : {} >a : A +>"" : string diff --git a/tests/baselines/reference/icomparable.symbols b/tests/baselines/reference/icomparable.symbols new file mode 100644 index 00000000000..03eac6b5bec --- /dev/null +++ b/tests/baselines/reference/icomparable.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/icomparable.ts === + interface IComparable { +>IComparable : Symbol(IComparable, Decl(icomparable.ts, 0, 0)) +>T : Symbol(T, Decl(icomparable.ts, 0, 26)) + + compareTo(other: T); +>compareTo : Symbol(compareTo, Decl(icomparable.ts, 0, 30)) +>other : Symbol(other, Decl(icomparable.ts, 1, 17)) +>T : Symbol(T, Decl(icomparable.ts, 0, 26)) + } + + declare function sort>(items: U[]): U[]; +>sort : Symbol(sort, Decl(icomparable.ts, 2, 5)) +>U : Symbol(U, Decl(icomparable.ts, 4, 26)) +>IComparable : Symbol(IComparable, Decl(icomparable.ts, 0, 0)) +>items : Symbol(items, Decl(icomparable.ts, 4, 54)) +>U : Symbol(U, Decl(icomparable.ts, 4, 26)) +>U : Symbol(U, Decl(icomparable.ts, 4, 26)) + + interface StringComparable extends IComparable { +>StringComparable : Symbol(StringComparable, Decl(icomparable.ts, 4, 71)) +>IComparable : Symbol(IComparable, Decl(icomparable.ts, 0, 0)) + } + + var sc: StringComparable[]; +>sc : Symbol(sc, Decl(icomparable.ts, 9, 7)) +>StringComparable : Symbol(StringComparable, Decl(icomparable.ts, 4, 71)) + + var x = sort(sc); +>x : Symbol(x, Decl(icomparable.ts, 11, 7)) +>sort : Symbol(sort, Decl(icomparable.ts, 2, 5)) +>sc : Symbol(sc, Decl(icomparable.ts, 9, 7)) + diff --git a/tests/baselines/reference/idInProp.symbols b/tests/baselines/reference/idInProp.symbols new file mode 100644 index 00000000000..56d7318ab19 --- /dev/null +++ b/tests/baselines/reference/idInProp.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/idInProp.ts === +function f() { +>f : Symbol(f, Decl(idInProp.ts, 0, 0)) + +var t: { (f: any) : any; }; +>t : Symbol(t, Decl(idInProp.ts, 2, 3)) +>f : Symbol(f, Decl(idInProp.ts, 2, 10)) + +} + diff --git a/tests/baselines/reference/identicalCallSignatures.symbols b/tests/baselines/reference/identicalCallSignatures.symbols new file mode 100644 index 00000000000..ede05ffed1d --- /dev/null +++ b/tests/baselines/reference/identicalCallSignatures.symbols @@ -0,0 +1,61 @@ +=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/identicalCallSignatures.ts === +// Each pair of call signatures in these types have a duplicate signature error. +// Identical call signatures should generate an error. +interface I { +>I : Symbol(I, Decl(identicalCallSignatures.ts, 0, 0)) + + (x): number; +>x : Symbol(x, Decl(identicalCallSignatures.ts, 3, 5)) + + (x: any): number; +>x : Symbol(x, Decl(identicalCallSignatures.ts, 4, 5)) + + (x: T): T; +>T : Symbol(T, Decl(identicalCallSignatures.ts, 5, 5)) +>x : Symbol(x, Decl(identicalCallSignatures.ts, 5, 8)) +>T : Symbol(T, Decl(identicalCallSignatures.ts, 5, 5)) +>T : Symbol(T, Decl(identicalCallSignatures.ts, 5, 5)) + + (x: U): U; // error +>U : Symbol(U, Decl(identicalCallSignatures.ts, 6, 5)) +>x : Symbol(x, Decl(identicalCallSignatures.ts, 6, 8)) +>U : Symbol(U, Decl(identicalCallSignatures.ts, 6, 5)) +>U : Symbol(U, Decl(identicalCallSignatures.ts, 6, 5)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(identicalCallSignatures.ts, 7, 1)) +>T : Symbol(T, Decl(identicalCallSignatures.ts, 9, 13)) + + (x: T): T; +>x : Symbol(x, Decl(identicalCallSignatures.ts, 10, 5)) +>T : Symbol(T, Decl(identicalCallSignatures.ts, 9, 13)) +>T : Symbol(T, Decl(identicalCallSignatures.ts, 9, 13)) + + (x: T): T; // error +>x : Symbol(x, Decl(identicalCallSignatures.ts, 11, 5)) +>T : Symbol(T, Decl(identicalCallSignatures.ts, 9, 13)) +>T : Symbol(T, Decl(identicalCallSignatures.ts, 9, 13)) +} + +var a: { +>a : Symbol(a, Decl(identicalCallSignatures.ts, 14, 3)) + + (x): number; +>x : Symbol(x, Decl(identicalCallSignatures.ts, 15, 5)) + + (x: any): number; +>x : Symbol(x, Decl(identicalCallSignatures.ts, 16, 5)) + + (x: T): T; +>T : Symbol(T, Decl(identicalCallSignatures.ts, 17, 5)) +>x : Symbol(x, Decl(identicalCallSignatures.ts, 17, 8)) +>T : Symbol(T, Decl(identicalCallSignatures.ts, 17, 5)) +>T : Symbol(T, Decl(identicalCallSignatures.ts, 17, 5)) + + (x: T): T; // error +>T : Symbol(T, Decl(identicalCallSignatures.ts, 18, 5)) +>x : Symbol(x, Decl(identicalCallSignatures.ts, 18, 8)) +>T : Symbol(T, Decl(identicalCallSignatures.ts, 18, 5)) +>T : Symbol(T, Decl(identicalCallSignatures.ts, 18, 5)) +} diff --git a/tests/baselines/reference/identicalCallSignatures2.symbols b/tests/baselines/reference/identicalCallSignatures2.symbols new file mode 100644 index 00000000000..ad7dbcd3812 --- /dev/null +++ b/tests/baselines/reference/identicalCallSignatures2.symbols @@ -0,0 +1,23 @@ +=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/identicalCallSignatures2.ts === +// Normally it is an error to have multiple overloads with identical signatures in a single type declaration. +// Here the multiple overloads come from multiple bases. + +interface Base { +>Base : Symbol(Base, Decl(identicalCallSignatures2.ts, 0, 0)) +>T : Symbol(T, Decl(identicalCallSignatures2.ts, 3, 15)) + + (x: number): string; +>x : Symbol(x, Decl(identicalCallSignatures2.ts, 4, 5)) +} + +interface I extends Base, Base { } +>I : Symbol(I, Decl(identicalCallSignatures2.ts, 5, 1)) +>Base : Symbol(Base, Decl(identicalCallSignatures2.ts, 0, 0)) +>Base : Symbol(Base, Decl(identicalCallSignatures2.ts, 0, 0)) + +interface I2 extends Base, Base { } +>I2 : Symbol(I2, Decl(identicalCallSignatures2.ts, 7, 50)) +>T : Symbol(T, Decl(identicalCallSignatures2.ts, 9, 13)) +>Base : Symbol(Base, Decl(identicalCallSignatures2.ts, 0, 0)) +>Base : Symbol(Base, Decl(identicalCallSignatures2.ts, 0, 0)) + diff --git a/tests/baselines/reference/identicalCallSignatures3.symbols b/tests/baselines/reference/identicalCallSignatures3.symbols new file mode 100644 index 00000000000..dc2749c4e0f --- /dev/null +++ b/tests/baselines/reference/identicalCallSignatures3.symbols @@ -0,0 +1,33 @@ +=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/identicalCallSignatures3.ts === +// Normally it is an error to have multiple overloads with identical signatures in a single type declaration. +// Here the multiple overloads come from multiple merged declarations, so we do not report errors. + +interface I { +>I : Symbol(I, Decl(identicalCallSignatures3.ts, 0, 0), Decl(identicalCallSignatures3.ts, 5, 1)) + + (x: number): string; +>x : Symbol(x, Decl(identicalCallSignatures3.ts, 4, 5)) +} + +interface I { +>I : Symbol(I, Decl(identicalCallSignatures3.ts, 0, 0), Decl(identicalCallSignatures3.ts, 5, 1)) + + (x: number): string; +>x : Symbol(x, Decl(identicalCallSignatures3.ts, 8, 5)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(identicalCallSignatures3.ts, 9, 1), Decl(identicalCallSignatures3.ts, 13, 1)) +>T : Symbol(T, Decl(identicalCallSignatures3.ts, 11, 13), Decl(identicalCallSignatures3.ts, 15, 13)) + + (x: number): string; +>x : Symbol(x, Decl(identicalCallSignatures3.ts, 12, 5)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(identicalCallSignatures3.ts, 9, 1), Decl(identicalCallSignatures3.ts, 13, 1)) +>T : Symbol(T, Decl(identicalCallSignatures3.ts, 11, 13), Decl(identicalCallSignatures3.ts, 15, 13)) + + (x: number): string; +>x : Symbol(x, Decl(identicalCallSignatures3.ts, 16, 5)) +} diff --git a/tests/baselines/reference/identityForSignaturesWithTypeParametersSwitched.symbols b/tests/baselines/reference/identityForSignaturesWithTypeParametersSwitched.symbols new file mode 100644 index 00000000000..268e5d276b1 --- /dev/null +++ b/tests/baselines/reference/identityForSignaturesWithTypeParametersSwitched.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/identityForSignaturesWithTypeParametersSwitched.ts === +var f: (x: T, y: U) => T; +>f : Symbol(f, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 0, 3), Decl(identityForSignaturesWithTypeParametersSwitched.ts, 1, 3)) +>T : Symbol(T, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 0, 8)) +>U : Symbol(U, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 0, 10)) +>x : Symbol(x, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 0, 14)) +>T : Symbol(T, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 0, 8)) +>y : Symbol(y, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 0, 19)) +>U : Symbol(U, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 0, 10)) +>T : Symbol(T, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 0, 8)) + +var f: (x: U, y: T) => U; +>f : Symbol(f, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 0, 3), Decl(identityForSignaturesWithTypeParametersSwitched.ts, 1, 3)) +>T : Symbol(T, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 1, 8)) +>U : Symbol(U, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 1, 10)) +>x : Symbol(x, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 1, 14)) +>U : Symbol(U, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 1, 10)) +>y : Symbol(y, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 1, 19)) +>T : Symbol(T, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 1, 8)) +>U : Symbol(U, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 1, 10)) + diff --git a/tests/baselines/reference/ifDoWhileStatements.symbols b/tests/baselines/reference/ifDoWhileStatements.symbols new file mode 100644 index 00000000000..36a990010ef --- /dev/null +++ b/tests/baselines/reference/ifDoWhileStatements.symbols @@ -0,0 +1,336 @@ +=== tests/cases/conformance/statements/ifDoWhileStatements/ifDoWhileStatements.ts === +interface I { +>I : Symbol(I, Decl(ifDoWhileStatements.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(ifDoWhileStatements.ts, 0, 13)) +} + +class C implements I { +>C : Symbol(C, Decl(ifDoWhileStatements.ts, 2, 1)) +>I : Symbol(I, Decl(ifDoWhileStatements.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(ifDoWhileStatements.ts, 4, 22)) + + name: string; +>name : Symbol(name, Decl(ifDoWhileStatements.ts, 5, 15)) +} + +class C2 extends C { +>C2 : Symbol(C2, Decl(ifDoWhileStatements.ts, 7, 1)) +>C : Symbol(C, Decl(ifDoWhileStatements.ts, 2, 1)) + + valid: boolean; +>valid : Symbol(valid, Decl(ifDoWhileStatements.ts, 9, 20)) +} + +class D{ +>D : Symbol(D, Decl(ifDoWhileStatements.ts, 11, 1)) +>T : Symbol(T, Decl(ifDoWhileStatements.ts, 13, 8)) + + source: T; +>source : Symbol(source, Decl(ifDoWhileStatements.ts, 13, 11)) +>T : Symbol(T, Decl(ifDoWhileStatements.ts, 13, 8)) + + recurse: D; +>recurse : Symbol(recurse, Decl(ifDoWhileStatements.ts, 14, 14)) +>D : Symbol(D, Decl(ifDoWhileStatements.ts, 11, 1)) +>T : Symbol(T, Decl(ifDoWhileStatements.ts, 13, 8)) + + wrapped: D> +>wrapped : Symbol(wrapped, Decl(ifDoWhileStatements.ts, 15, 18)) +>D : Symbol(D, Decl(ifDoWhileStatements.ts, 11, 1)) +>D : Symbol(D, Decl(ifDoWhileStatements.ts, 11, 1)) +>T : Symbol(T, Decl(ifDoWhileStatements.ts, 13, 8)) +} + +function F(x: string): number { return 42; } +>F : Symbol(F, Decl(ifDoWhileStatements.ts, 17, 1)) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 19, 11)) + +function F2(x: number): boolean { return x < 42; } +>F2 : Symbol(F2, Decl(ifDoWhileStatements.ts, 19, 44)) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 20, 12)) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 20, 12)) + +module M { +>M : Symbol(M, Decl(ifDoWhileStatements.ts, 20, 50)) + + export class A { +>A : Symbol(A, Decl(ifDoWhileStatements.ts, 22, 10)) + + name: string; +>name : Symbol(name, Decl(ifDoWhileStatements.ts, 23, 20)) + } + + export function F2(x: number): string { return x.toString(); } +>F2 : Symbol(F2, Decl(ifDoWhileStatements.ts, 25, 5)) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 27, 23)) +>x.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 27, 23)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +} + +module N { +>N : Symbol(N, Decl(ifDoWhileStatements.ts, 28, 1)) + + export class A { +>A : Symbol(A, Decl(ifDoWhileStatements.ts, 30, 10)) + + id: number; +>id : Symbol(id, Decl(ifDoWhileStatements.ts, 31, 20)) + } + + export function F2(x: number): string { return x.toString(); } +>F2 : Symbol(F2, Decl(ifDoWhileStatements.ts, 33, 5)) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 35, 23)) +>x.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 35, 23)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +} + +// literals +if (true) { } +while (true) { } +do { }while(true) + +if (null) { } +while (null) { } +do { }while(null) + +if (undefined) { } +>undefined : Symbol(undefined) + +while (undefined) { } +>undefined : Symbol(undefined) + +do { }while(undefined) +>undefined : Symbol(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' }) { } +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 79, 5)) +>y : Symbol(y, Decl(ifDoWhileStatements.ts, 79, 11)) + +while ({ x: 1, y: 'a' }) { } +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 80, 8)) +>y : Symbol(y, Decl(ifDoWhileStatements.ts, 80, 14)) + +do { }while({ x: 1, y: 'a' }) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 81, 13)) +>y : Symbol(y, Decl(ifDoWhileStatements.ts, 81, 19)) + +if (() => 43) { } +while (() => 43) { } +do { }while(() => 43) + +if (new C()) { } +>C : Symbol(C, Decl(ifDoWhileStatements.ts, 2, 1)) + +while (new C()) { } +>C : Symbol(C, Decl(ifDoWhileStatements.ts, 2, 1)) + +do { }while(new C()) +>C : Symbol(C, Decl(ifDoWhileStatements.ts, 2, 1)) + +if (new D()) { } +>D : Symbol(D, Decl(ifDoWhileStatements.ts, 11, 1)) +>C : Symbol(C, Decl(ifDoWhileStatements.ts, 2, 1)) + +while (new D()) { } +>D : Symbol(D, Decl(ifDoWhileStatements.ts, 11, 1)) +>C : Symbol(C, Decl(ifDoWhileStatements.ts, 2, 1)) + +do { }while(new D()) +>D : Symbol(D, Decl(ifDoWhileStatements.ts, 11, 1)) +>C : Symbol(C, Decl(ifDoWhileStatements.ts, 2, 1)) + +// references +var a = true; +>a : Symbol(a, Decl(ifDoWhileStatements.ts, 96, 3)) + +if (a) { } +>a : Symbol(a, Decl(ifDoWhileStatements.ts, 96, 3)) + +while (a) { } +>a : Symbol(a, Decl(ifDoWhileStatements.ts, 96, 3)) + +do { }while(a) +>a : Symbol(a, Decl(ifDoWhileStatements.ts, 96, 3)) + +var b = null; +>b : Symbol(b, Decl(ifDoWhileStatements.ts, 101, 3)) + +if (b) { } +>b : Symbol(b, Decl(ifDoWhileStatements.ts, 101, 3)) + +while (b) { } +>b : Symbol(b, Decl(ifDoWhileStatements.ts, 101, 3)) + +do { }while(b) +>b : Symbol(b, Decl(ifDoWhileStatements.ts, 101, 3)) + +var c = undefined; +>c : Symbol(c, Decl(ifDoWhileStatements.ts, 106, 3)) +>undefined : Symbol(undefined) + +if (c) { } +>c : Symbol(c, Decl(ifDoWhileStatements.ts, 106, 3)) + +while (c) { } +>c : Symbol(c, Decl(ifDoWhileStatements.ts, 106, 3)) + +do { }while(c) +>c : Symbol(c, Decl(ifDoWhileStatements.ts, 106, 3)) + +var d = 0.0; +>d : Symbol(d, Decl(ifDoWhileStatements.ts, 111, 3)) + +if (d) { } +>d : Symbol(d, Decl(ifDoWhileStatements.ts, 111, 3)) + +while (d) { } +>d : Symbol(d, Decl(ifDoWhileStatements.ts, 111, 3)) + +do { }while(d) +>d : Symbol(d, Decl(ifDoWhileStatements.ts, 111, 3)) + +var e = 'a string'; +>e : Symbol(e, Decl(ifDoWhileStatements.ts, 116, 3)) + +if (e) { } +>e : Symbol(e, Decl(ifDoWhileStatements.ts, 116, 3)) + +while (e) { } +>e : Symbol(e, Decl(ifDoWhileStatements.ts, 116, 3)) + +do { }while(e) +>e : Symbol(e, Decl(ifDoWhileStatements.ts, 116, 3)) + +var f = ''; +>f : Symbol(f, Decl(ifDoWhileStatements.ts, 121, 3)) + +if (f) { } +>f : Symbol(f, Decl(ifDoWhileStatements.ts, 121, 3)) + +while (f) { } +>f : Symbol(f, Decl(ifDoWhileStatements.ts, 121, 3)) + +do { }while(f) +>f : Symbol(f, Decl(ifDoWhileStatements.ts, 121, 3)) + +var g = /[a-z]/ +>g : Symbol(g, Decl(ifDoWhileStatements.ts, 126, 3)) + +if (g) { } +>g : Symbol(g, Decl(ifDoWhileStatements.ts, 126, 3)) + +while (g) { } +>g : Symbol(g, Decl(ifDoWhileStatements.ts, 126, 3)) + +do { }while(g) +>g : Symbol(g, Decl(ifDoWhileStatements.ts, 126, 3)) + +var h = []; +>h : Symbol(h, Decl(ifDoWhileStatements.ts, 131, 3)) + +if (h) { } +>h : Symbol(h, Decl(ifDoWhileStatements.ts, 131, 3)) + +while (h) { } +>h : Symbol(h, Decl(ifDoWhileStatements.ts, 131, 3)) + +do { }while(h) +>h : Symbol(h, Decl(ifDoWhileStatements.ts, 131, 3)) + +var i = [1, 2]; +>i : Symbol(i, Decl(ifDoWhileStatements.ts, 136, 3)) + +if (i) { } +>i : Symbol(i, Decl(ifDoWhileStatements.ts, 136, 3)) + +while (i) { } +>i : Symbol(i, Decl(ifDoWhileStatements.ts, 136, 3)) + +do { }while(i) +>i : Symbol(i, Decl(ifDoWhileStatements.ts, 136, 3)) + +var j = {}; +>j : Symbol(j, Decl(ifDoWhileStatements.ts, 141, 3)) + +if (j) { } +>j : Symbol(j, Decl(ifDoWhileStatements.ts, 141, 3)) + +while (j) { } +>j : Symbol(j, Decl(ifDoWhileStatements.ts, 141, 3)) + +do { }while(j) +>j : Symbol(j, Decl(ifDoWhileStatements.ts, 141, 3)) + +var k = { x: 1, y: 'a' }; +>k : Symbol(k, Decl(ifDoWhileStatements.ts, 146, 3)) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 146, 9)) +>y : Symbol(y, Decl(ifDoWhileStatements.ts, 146, 15)) + +if (k) { } +>k : Symbol(k, Decl(ifDoWhileStatements.ts, 146, 3)) + +while (k) { } +>k : Symbol(k, Decl(ifDoWhileStatements.ts, 146, 3)) + +do { }while(k) +>k : Symbol(k, Decl(ifDoWhileStatements.ts, 146, 3)) + +function fn(x?: string): I { return null; } +>fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 149, 14)) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 151, 12)) +>I : Symbol(I, Decl(ifDoWhileStatements.ts, 0, 0)) + +if (fn()) { } +>fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 149, 14)) + +while (fn()) { } +>fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 149, 14)) + +do { }while(fn()) +>fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 149, 14)) + +if (fn) { } +>fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 149, 14)) + +while (fn) { } +>fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 149, 14)) + +do { }while(fn) +>fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 149, 14)) + + + diff --git a/tests/baselines/reference/ifDoWhileStatements.types b/tests/baselines/reference/ifDoWhileStatements.types index b4a3f7a70af..92a9df6a4dd 100644 --- a/tests/baselines/reference/ifDoWhileStatements.types +++ b/tests/baselines/reference/ifDoWhileStatements.types @@ -48,12 +48,14 @@ class D{ function F(x: string): number { return 42; } >F : (x: string) => number >x : string +>42 : number function F2(x: number): boolean { return x < 42; } >F2 : (x: number) => boolean >x : number >x < 42 : boolean >x : number +>42 : number module M { >M : typeof M @@ -95,12 +97,22 @@ module N { // literals if (true) { } +>true : boolean + while (true) { } +>true : boolean + do { }while(true) +>true : boolean if (null) { } +>null : null + while (null) { } +>null : null + do { }while(null) +>null : null if (undefined) { } >undefined : undefined @@ -112,20 +124,40 @@ do { }while(undefined) >undefined : undefined if (0.0) { } +>0.0 : number + while (0.0) { } +>0.0 : number + do { }while(0.0) +>0.0 : number if ('a string') { } +>'a string' : string + while ('a string') { } +>'a string' : string + do { }while('a string') +>'a string' : string if ('') { } +>'' : string + while ('') { } +>'' : string + do { }while('') +>'' : string if (/[a-z]/) { } +>/[a-z]/ : RegExp + while (/[a-z]/) { } +>/[a-z]/ : RegExp + do { }while(/[a-z]/) +>/[a-z]/ : RegExp if ([]) { } >[] : undefined[] @@ -138,12 +170,18 @@ do { }while([]) if ([1, 2]) { } >[1, 2] : number[] +>1 : number +>2 : number while ([1, 2]) { } >[1, 2] : number[] +>1 : number +>2 : number do { }while([1, 2]) >[1, 2] : number[] +>1 : number +>2 : number if ({}) { } >{} : {} @@ -157,26 +195,35 @@ do { }while({}) if ({ x: 1, y: 'a' }) { } >{ x: 1, y: 'a' } : { x: number; y: string; } >x : number +>1 : number >y : string +>'a' : string while ({ x: 1, y: 'a' }) { } >{ x: 1, y: 'a' } : { x: number; y: string; } >x : number +>1 : number >y : string +>'a' : string do { }while({ x: 1, y: 'a' }) >{ x: 1, y: 'a' } : { x: number; y: string; } >x : number +>1 : number >y : string +>'a' : string if (() => 43) { } >() => 43 : () => number +>43 : number while (() => 43) { } >() => 43 : () => number +>43 : number do { }while(() => 43) >() => 43 : () => number +>43 : number if (new C()) { } >new C() : C @@ -208,6 +255,7 @@ do { }while(new D()) // references var a = true; >a : boolean +>true : boolean if (a) { } >a : boolean @@ -220,6 +268,7 @@ do { }while(a) var b = null; >b : any +>null : null if (b) { } >b : any @@ -245,6 +294,7 @@ do { }while(c) var d = 0.0; >d : number +>0.0 : number if (d) { } >d : number @@ -257,6 +307,7 @@ do { }while(d) var e = 'a string'; >e : string +>'a string' : string if (e) { } >e : string @@ -269,6 +320,7 @@ do { }while(e) var f = ''; >f : string +>'' : string if (f) { } >f : string @@ -281,6 +333,7 @@ do { }while(f) var g = /[a-z]/ >g : RegExp +>/[a-z]/ : RegExp if (g) { } >g : RegExp @@ -307,6 +360,8 @@ do { }while(h) var i = [1, 2]; >i : number[] >[1, 2] : number[] +>1 : number +>2 : number if (i) { } >i : number[] @@ -334,7 +389,9 @@ var k = { x: 1, y: 'a' }; >k : { x: number; y: string; } >{ x: 1, y: 'a' } : { x: number; y: string; } >x : number +>1 : number >y : string +>'a' : string if (k) { } >k : { x: number; y: string; } @@ -349,6 +406,7 @@ function fn(x?: string): I { return null; } >fn : (x?: string) => I >x : string >I : I +>null : null if (fn()) { } >fn() : I diff --git a/tests/baselines/reference/illegalGenericWrapping1.symbols b/tests/baselines/reference/illegalGenericWrapping1.symbols new file mode 100644 index 00000000000..f4ab78ceb69 --- /dev/null +++ b/tests/baselines/reference/illegalGenericWrapping1.symbols @@ -0,0 +1,44 @@ +=== tests/cases/compiler/illegalGenericWrapping1.ts === +interface Sequence { +>Sequence : Symbol(Sequence, Decl(illegalGenericWrapping1.ts, 0, 0)) +>T : Symbol(T, Decl(illegalGenericWrapping1.ts, 0, 19)) + + each(iterator: (value: T) => void ): void; +>each : Symbol(each, Decl(illegalGenericWrapping1.ts, 0, 23)) +>iterator : Symbol(iterator, Decl(illegalGenericWrapping1.ts, 1, 9)) +>value : Symbol(value, Decl(illegalGenericWrapping1.ts, 1, 20)) +>T : Symbol(T, Decl(illegalGenericWrapping1.ts, 0, 19)) + + map(iterator: (value: T) => U): Sequence; +>map : Symbol(map, Decl(illegalGenericWrapping1.ts, 1, 46)) +>U : Symbol(U, Decl(illegalGenericWrapping1.ts, 2, 8)) +>iterator : Symbol(iterator, Decl(illegalGenericWrapping1.ts, 2, 11)) +>value : Symbol(value, Decl(illegalGenericWrapping1.ts, 2, 22)) +>T : Symbol(T, Decl(illegalGenericWrapping1.ts, 0, 19)) +>U : Symbol(U, Decl(illegalGenericWrapping1.ts, 2, 8)) +>Sequence : Symbol(Sequence, Decl(illegalGenericWrapping1.ts, 0, 0)) +>U : Symbol(U, Decl(illegalGenericWrapping1.ts, 2, 8)) + + filter(iterator: (value: T) => boolean): Sequence; +>filter : Symbol(filter, Decl(illegalGenericWrapping1.ts, 2, 51)) +>iterator : Symbol(iterator, Decl(illegalGenericWrapping1.ts, 3, 11)) +>value : Symbol(value, Decl(illegalGenericWrapping1.ts, 3, 22)) +>T : Symbol(T, Decl(illegalGenericWrapping1.ts, 0, 19)) +>Sequence : Symbol(Sequence, Decl(illegalGenericWrapping1.ts, 0, 0)) +>T : Symbol(T, Decl(illegalGenericWrapping1.ts, 0, 19)) + + groupBy(keySelector: (value: T) => K): Sequence<{ key: K; items: Sequence; }>; +>groupBy : Symbol(groupBy, Decl(illegalGenericWrapping1.ts, 3, 57)) +>K : Symbol(K, Decl(illegalGenericWrapping1.ts, 4, 12)) +>keySelector : Symbol(keySelector, Decl(illegalGenericWrapping1.ts, 4, 15)) +>value : Symbol(value, Decl(illegalGenericWrapping1.ts, 4, 29)) +>T : Symbol(T, Decl(illegalGenericWrapping1.ts, 0, 19)) +>K : Symbol(K, Decl(illegalGenericWrapping1.ts, 4, 12)) +>Sequence : Symbol(Sequence, Decl(illegalGenericWrapping1.ts, 0, 0)) +>key : Symbol(key, Decl(illegalGenericWrapping1.ts, 4, 56)) +>K : Symbol(K, Decl(illegalGenericWrapping1.ts, 4, 12)) +>items : Symbol(items, Decl(illegalGenericWrapping1.ts, 4, 64)) +>Sequence : Symbol(Sequence, Decl(illegalGenericWrapping1.ts, 0, 0)) +>T : Symbol(T, Decl(illegalGenericWrapping1.ts, 0, 19)) +} + diff --git a/tests/baselines/reference/implementArrayInterface.symbols b/tests/baselines/reference/implementArrayInterface.symbols new file mode 100644 index 00000000000..97d106157fe --- /dev/null +++ b/tests/baselines/reference/implementArrayInterface.symbols @@ -0,0 +1,217 @@ +=== tests/cases/compiler/implementArrayInterface.ts === +declare class MyArray implements Array { +>MyArray : Symbol(MyArray, Decl(implementArrayInterface.ts, 0, 0)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + toString(): string; +>toString : Symbol(toString, Decl(implementArrayInterface.ts, 0, 46)) + + toLocaleString(): string; +>toLocaleString : Symbol(toLocaleString, Decl(implementArrayInterface.ts, 1, 23)) + + concat(...items: U[]): T[]; +>concat : Symbol(concat, Decl(implementArrayInterface.ts, 2, 29), Decl(implementArrayInterface.ts, 3, 46)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 3, 11)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>items : Symbol(items, Decl(implementArrayInterface.ts, 3, 26)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 3, 11)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + concat(...items: T[]): T[]; +>concat : Symbol(concat, Decl(implementArrayInterface.ts, 2, 29), Decl(implementArrayInterface.ts, 3, 46)) +>items : Symbol(items, Decl(implementArrayInterface.ts, 4, 11)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + join(separator?: string): string; +>join : Symbol(join, Decl(implementArrayInterface.ts, 4, 31)) +>separator : Symbol(separator, Decl(implementArrayInterface.ts, 5, 9)) + + pop(): T; +>pop : Symbol(pop, Decl(implementArrayInterface.ts, 5, 37)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + push(...items: T[]): number; +>push : Symbol(push, Decl(implementArrayInterface.ts, 6, 13)) +>items : Symbol(items, Decl(implementArrayInterface.ts, 7, 9)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + reverse(): T[]; +>reverse : Symbol(reverse, Decl(implementArrayInterface.ts, 7, 32)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + shift(): T; +>shift : Symbol(shift, Decl(implementArrayInterface.ts, 8, 19)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + slice(start?: number, end?: number): T[]; +>slice : Symbol(slice, Decl(implementArrayInterface.ts, 9, 15)) +>start : Symbol(start, Decl(implementArrayInterface.ts, 10, 10)) +>end : Symbol(end, Decl(implementArrayInterface.ts, 10, 25)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + sort(compareFn?: (a: T, b: T) => number): T[]; +>sort : Symbol(sort, Decl(implementArrayInterface.ts, 10, 45)) +>compareFn : Symbol(compareFn, Decl(implementArrayInterface.ts, 11, 9)) +>a : Symbol(a, Decl(implementArrayInterface.ts, 11, 22)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>b : Symbol(b, Decl(implementArrayInterface.ts, 11, 27)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + splice(start: number): T[]; +>splice : Symbol(splice, Decl(implementArrayInterface.ts, 11, 50), Decl(implementArrayInterface.ts, 12, 31)) +>start : Symbol(start, Decl(implementArrayInterface.ts, 12, 11)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + splice(start: number, deleteCount: number, ...items: T[]): T[]; +>splice : Symbol(splice, Decl(implementArrayInterface.ts, 11, 50), Decl(implementArrayInterface.ts, 12, 31)) +>start : Symbol(start, Decl(implementArrayInterface.ts, 13, 11)) +>deleteCount : Symbol(deleteCount, Decl(implementArrayInterface.ts, 13, 25)) +>items : Symbol(items, Decl(implementArrayInterface.ts, 13, 46)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + unshift(...items: T[]): number; +>unshift : Symbol(unshift, Decl(implementArrayInterface.ts, 13, 67)) +>items : Symbol(items, Decl(implementArrayInterface.ts, 14, 12)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + indexOf(searchElement: T, fromIndex?: number): number; +>indexOf : Symbol(indexOf, Decl(implementArrayInterface.ts, 14, 35)) +>searchElement : Symbol(searchElement, Decl(implementArrayInterface.ts, 16, 12)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>fromIndex : Symbol(fromIndex, Decl(implementArrayInterface.ts, 16, 29)) + + lastIndexOf(searchElement: T, fromIndex?: number): number; +>lastIndexOf : Symbol(lastIndexOf, Decl(implementArrayInterface.ts, 16, 58)) +>searchElement : Symbol(searchElement, Decl(implementArrayInterface.ts, 17, 16)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>fromIndex : Symbol(fromIndex, Decl(implementArrayInterface.ts, 17, 33)) + + every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; +>every : Symbol(every, Decl(implementArrayInterface.ts, 17, 62)) +>callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 18, 10)) +>value : Symbol(value, Decl(implementArrayInterface.ts, 18, 23)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>index : Symbol(index, Decl(implementArrayInterface.ts, 18, 32)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 18, 47)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>thisArg : Symbol(thisArg, Decl(implementArrayInterface.ts, 18, 71)) + + some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; +>some : Symbol(some, Decl(implementArrayInterface.ts, 18, 96)) +>callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 19, 9)) +>value : Symbol(value, Decl(implementArrayInterface.ts, 19, 22)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>index : Symbol(index, Decl(implementArrayInterface.ts, 19, 31)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 19, 46)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>thisArg : Symbol(thisArg, Decl(implementArrayInterface.ts, 19, 70)) + + forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; +>forEach : Symbol(forEach, Decl(implementArrayInterface.ts, 19, 95)) +>callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 20, 12)) +>value : Symbol(value, Decl(implementArrayInterface.ts, 20, 25)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>index : Symbol(index, Decl(implementArrayInterface.ts, 20, 34)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 20, 49)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>thisArg : Symbol(thisArg, Decl(implementArrayInterface.ts, 20, 70)) + + map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; +>map : Symbol(map, Decl(implementArrayInterface.ts, 20, 92)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 21, 8)) +>callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 21, 11)) +>value : Symbol(value, Decl(implementArrayInterface.ts, 21, 24)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>index : Symbol(index, Decl(implementArrayInterface.ts, 21, 33)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 21, 48)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 21, 8)) +>thisArg : Symbol(thisArg, Decl(implementArrayInterface.ts, 21, 66)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 21, 8)) + + filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; +>filter : Symbol(filter, Decl(implementArrayInterface.ts, 21, 87)) +>callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 22, 11)) +>value : Symbol(value, Decl(implementArrayInterface.ts, 22, 24)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>index : Symbol(index, Decl(implementArrayInterface.ts, 22, 33)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 22, 48)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>thisArg : Symbol(thisArg, Decl(implementArrayInterface.ts, 22, 72)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; +>reduce : Symbol(reduce, Decl(implementArrayInterface.ts, 22, 93), Decl(implementArrayInterface.ts, 23, 120)) +>callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 23, 11)) +>previousValue : Symbol(previousValue, Decl(implementArrayInterface.ts, 23, 24)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>currentValue : Symbol(currentValue, Decl(implementArrayInterface.ts, 23, 41)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>currentIndex : Symbol(currentIndex, Decl(implementArrayInterface.ts, 23, 58)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 23, 80)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>initialValue : Symbol(initialValue, Decl(implementArrayInterface.ts, 23, 98)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; +>reduce : Symbol(reduce, Decl(implementArrayInterface.ts, 22, 93), Decl(implementArrayInterface.ts, 23, 120)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 24, 11)) +>callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 24, 14)) +>previousValue : Symbol(previousValue, Decl(implementArrayInterface.ts, 24, 27)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 24, 11)) +>currentValue : Symbol(currentValue, Decl(implementArrayInterface.ts, 24, 44)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>currentIndex : Symbol(currentIndex, Decl(implementArrayInterface.ts, 24, 61)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 24, 83)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 24, 11)) +>initialValue : Symbol(initialValue, Decl(implementArrayInterface.ts, 24, 101)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 24, 11)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 24, 11)) + + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; +>reduceRight : Symbol(reduceRight, Decl(implementArrayInterface.ts, 24, 122), Decl(implementArrayInterface.ts, 25, 125)) +>callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 25, 16)) +>previousValue : Symbol(previousValue, Decl(implementArrayInterface.ts, 25, 29)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>currentValue : Symbol(currentValue, Decl(implementArrayInterface.ts, 25, 46)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>currentIndex : Symbol(currentIndex, Decl(implementArrayInterface.ts, 25, 63)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 25, 85)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>initialValue : Symbol(initialValue, Decl(implementArrayInterface.ts, 25, 103)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; +>reduceRight : Symbol(reduceRight, Decl(implementArrayInterface.ts, 24, 122), Decl(implementArrayInterface.ts, 25, 125)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 26, 16)) +>callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 26, 19)) +>previousValue : Symbol(previousValue, Decl(implementArrayInterface.ts, 26, 32)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 26, 16)) +>currentValue : Symbol(currentValue, Decl(implementArrayInterface.ts, 26, 49)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>currentIndex : Symbol(currentIndex, Decl(implementArrayInterface.ts, 26, 66)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 26, 88)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 26, 16)) +>initialValue : Symbol(initialValue, Decl(implementArrayInterface.ts, 26, 106)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 26, 16)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 26, 16)) + + length: number; +>length : Symbol(length, Decl(implementArrayInterface.ts, 26, 127)) + + [n: number]: T; +>n : Symbol(n, Decl(implementArrayInterface.ts, 30, 5)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +} + diff --git a/tests/baselines/reference/implementInterfaceAnyMemberWithVoid.symbols b/tests/baselines/reference/implementInterfaceAnyMemberWithVoid.symbols new file mode 100644 index 00000000000..bf53a92dcd3 --- /dev/null +++ b/tests/baselines/reference/implementInterfaceAnyMemberWithVoid.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/implementInterfaceAnyMemberWithVoid.ts === +interface I { +>I : Symbol(I, Decl(implementInterfaceAnyMemberWithVoid.ts, 0, 0)) + + foo(value: number); +>foo : Symbol(foo, Decl(implementInterfaceAnyMemberWithVoid.ts, 0, 13)) +>value : Symbol(value, Decl(implementInterfaceAnyMemberWithVoid.ts, 1, 8)) +} + +class Bug implements I { +>Bug : Symbol(Bug, Decl(implementInterfaceAnyMemberWithVoid.ts, 2, 1)) +>I : Symbol(I, Decl(implementInterfaceAnyMemberWithVoid.ts, 0, 0)) + + public foo(value: number) { +>foo : Symbol(foo, Decl(implementInterfaceAnyMemberWithVoid.ts, 4, 24)) +>value : Symbol(value, Decl(implementInterfaceAnyMemberWithVoid.ts, 5, 15)) + } +} + diff --git a/tests/baselines/reference/implicitAnyAnyReturningFunction.symbols b/tests/baselines/reference/implicitAnyAnyReturningFunction.symbols new file mode 100644 index 00000000000..73e91853255 --- /dev/null +++ b/tests/baselines/reference/implicitAnyAnyReturningFunction.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/implicitAnyAnyReturningFunction.ts === +function A() { +>A : Symbol(A, Decl(implicitAnyAnyReturningFunction.ts, 0, 0)) + + return ""; +} + +function B() { +>B : Symbol(B, Decl(implicitAnyAnyReturningFunction.ts, 2, 1)) + + var someLocal: any = {}; +>someLocal : Symbol(someLocal, Decl(implicitAnyAnyReturningFunction.ts, 5, 7)) + + return someLocal; +>someLocal : Symbol(someLocal, Decl(implicitAnyAnyReturningFunction.ts, 5, 7)) +} + +class C { +>C : Symbol(C, Decl(implicitAnyAnyReturningFunction.ts, 7, 1)) + + public A() { +>A : Symbol(A, Decl(implicitAnyAnyReturningFunction.ts, 9, 9)) + + return ""; + } + + public B() { +>B : Symbol(B, Decl(implicitAnyAnyReturningFunction.ts, 12, 5)) + + var someLocal: any = {}; +>someLocal : Symbol(someLocal, Decl(implicitAnyAnyReturningFunction.ts, 15, 11)) + + return someLocal; +>someLocal : Symbol(someLocal, Decl(implicitAnyAnyReturningFunction.ts, 15, 11)) + } +} + diff --git a/tests/baselines/reference/implicitAnyAnyReturningFunction.types b/tests/baselines/reference/implicitAnyAnyReturningFunction.types index 1f0b81c724f..66f9cf49cb0 100644 --- a/tests/baselines/reference/implicitAnyAnyReturningFunction.types +++ b/tests/baselines/reference/implicitAnyAnyReturningFunction.types @@ -4,6 +4,7 @@ function A() { return ""; >"" : any +>"" : string } function B() { @@ -25,6 +26,7 @@ class C { return ""; >"" : any +>"" : string } public B() { diff --git a/tests/baselines/reference/implicitAnyDeclareFunctionWithoutFormalType2.symbols b/tests/baselines/reference/implicitAnyDeclareFunctionWithoutFormalType2.symbols new file mode 100644 index 00000000000..09d3a4a9430 --- /dev/null +++ b/tests/baselines/reference/implicitAnyDeclareFunctionWithoutFormalType2.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/implicitAnyDeclareFunctionWithoutFormalType2.ts === +// generates function fn1(): number; +function fn1() { +>fn1 : Symbol(fn1, Decl(implicitAnyDeclareFunctionWithoutFormalType2.ts, 0, 0)) + + var x: number; +>x : Symbol(x, Decl(implicitAnyDeclareFunctionWithoutFormalType2.ts, 2, 7)) + + return x; +>x : Symbol(x, Decl(implicitAnyDeclareFunctionWithoutFormalType2.ts, 2, 7)) +} +// generates function fn2(): any; +function fn2(): any { +>fn2 : Symbol(fn2, Decl(implicitAnyDeclareFunctionWithoutFormalType2.ts, 4, 1)) + + var x: any; +>x : Symbol(x, Decl(implicitAnyDeclareFunctionWithoutFormalType2.ts, 7, 7)) + + return x; +>x : Symbol(x, Decl(implicitAnyDeclareFunctionWithoutFormalType2.ts, 7, 7)) +} +// generates function fn3(); +function fn3() { +>fn3 : Symbol(fn3, Decl(implicitAnyDeclareFunctionWithoutFormalType2.ts, 9, 1)) + + var x: any; +>x : Symbol(x, Decl(implicitAnyDeclareFunctionWithoutFormalType2.ts, 12, 7)) + + return x; +>x : Symbol(x, Decl(implicitAnyDeclareFunctionWithoutFormalType2.ts, 12, 7)) +} + diff --git a/tests/baselines/reference/implicitAnyGenerics.symbols b/tests/baselines/reference/implicitAnyGenerics.symbols new file mode 100644 index 00000000000..865f48fdd59 --- /dev/null +++ b/tests/baselines/reference/implicitAnyGenerics.symbols @@ -0,0 +1,71 @@ +=== tests/cases/compiler/implicitAnyGenerics.ts === + +class C { +>C : Symbol(C, Decl(implicitAnyGenerics.ts, 0, 0)) +>T : Symbol(T, Decl(implicitAnyGenerics.ts, 1, 8)) + + x: T; +>x : Symbol(x, Decl(implicitAnyGenerics.ts, 1, 12)) +>T : Symbol(T, Decl(implicitAnyGenerics.ts, 1, 8)) +} + +var c = new C(); +>c : Symbol(c, Decl(implicitAnyGenerics.ts, 5, 3)) +>C : Symbol(C, Decl(implicitAnyGenerics.ts, 0, 0)) + +var c2 = new C(); +>c2 : Symbol(c2, Decl(implicitAnyGenerics.ts, 6, 3)) +>C : Symbol(C, Decl(implicitAnyGenerics.ts, 0, 0)) + +var c3 = new C(); +>c3 : Symbol(c3, Decl(implicitAnyGenerics.ts, 7, 3)) +>C : Symbol(C, Decl(implicitAnyGenerics.ts, 0, 0)) + +var c4: C = new C(); +>c4 : Symbol(c4, Decl(implicitAnyGenerics.ts, 8, 3)) +>C : Symbol(C, Decl(implicitAnyGenerics.ts, 0, 0)) +>C : Symbol(C, Decl(implicitAnyGenerics.ts, 0, 0)) + +class D { +>D : Symbol(D, Decl(implicitAnyGenerics.ts, 8, 25)) +>T : Symbol(T, Decl(implicitAnyGenerics.ts, 10, 8)) + + constructor(x: T) { } +>x : Symbol(x, Decl(implicitAnyGenerics.ts, 11, 16)) +>T : Symbol(T, Decl(implicitAnyGenerics.ts, 10, 8)) +} + +var d = new D(null); +>d : Symbol(d, Decl(implicitAnyGenerics.ts, 14, 3)) +>D : Symbol(D, Decl(implicitAnyGenerics.ts, 8, 25)) + +var d2 = new D(1); +>d2 : Symbol(d2, Decl(implicitAnyGenerics.ts, 15, 3)) +>D : Symbol(D, Decl(implicitAnyGenerics.ts, 8, 25)) + +var d3 = new D(1); +>d3 : Symbol(d3, Decl(implicitAnyGenerics.ts, 16, 3)) +>D : Symbol(D, Decl(implicitAnyGenerics.ts, 8, 25)) + +var d4 = new D(1); +>d4 : Symbol(d4, Decl(implicitAnyGenerics.ts, 17, 3)) +>D : Symbol(D, Decl(implicitAnyGenerics.ts, 8, 25)) + +var d5: D = new D(null); +>d5 : Symbol(d5, Decl(implicitAnyGenerics.ts, 18, 3)) +>D : Symbol(D, Decl(implicitAnyGenerics.ts, 8, 25)) +>D : Symbol(D, Decl(implicitAnyGenerics.ts, 8, 25)) + +function foo(): T { return null; }; +>foo : Symbol(foo, Decl(implicitAnyGenerics.ts, 18, 29)) +>T : Symbol(T, Decl(implicitAnyGenerics.ts, 20, 13)) +>T : Symbol(T, Decl(implicitAnyGenerics.ts, 20, 13)) + +foo() +>foo : Symbol(foo, Decl(implicitAnyGenerics.ts, 18, 29)) + +foo(); +>foo : Symbol(foo, Decl(implicitAnyGenerics.ts, 18, 29)) + + + diff --git a/tests/baselines/reference/implicitAnyGenerics.types b/tests/baselines/reference/implicitAnyGenerics.types index 91a231e3f12..e335c958fe9 100644 --- a/tests/baselines/reference/implicitAnyGenerics.types +++ b/tests/baselines/reference/implicitAnyGenerics.types @@ -43,33 +43,39 @@ var d = new D(null); >d : D >new D(null) : D >D : typeof D +>null : null var d2 = new D(1); >d2 : D >new D(1) : D >D : typeof D +>1 : number var d3 = new D(1); >d3 : D >new D(1) : D >D : typeof D +>1 : number var d4 = new D(1); >d4 : D >new D(1) : D >D : typeof D >1 : any +>1 : number var d5: D = new D(null); >d5 : D >D : D >new D(null) : D >D : typeof D +>null : null function foo(): T { return null; }; >foo : () => T >T : T >T : T +>null : null foo() >foo() : {} diff --git a/tests/baselines/reference/implicitAnyInCatch.symbols b/tests/baselines/reference/implicitAnyInCatch.symbols new file mode 100644 index 00000000000..e576593da82 --- /dev/null +++ b/tests/baselines/reference/implicitAnyInCatch.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/implicitAnyInCatch.ts === +// this should not be an error +try { } catch (error) { +>error : Symbol(error, Decl(implicitAnyInCatch.ts, 1, 15)) + + if (error.number === -2147024809) { } +>error : Symbol(error, Decl(implicitAnyInCatch.ts, 1, 15)) +} +for (var key in this) { } +>key : Symbol(key, Decl(implicitAnyInCatch.ts, 4, 8)) + +class C { +>C : Symbol(C, Decl(implicitAnyInCatch.ts, 4, 25)) + + public temp() { +>temp : Symbol(temp, Decl(implicitAnyInCatch.ts, 6, 9)) + + for (var x in this) { +>x : Symbol(x, Decl(implicitAnyInCatch.ts, 8, 16)) +>this : Symbol(C, Decl(implicitAnyInCatch.ts, 4, 25)) + } + } +} + + diff --git a/tests/baselines/reference/implicitAnyInCatch.types b/tests/baselines/reference/implicitAnyInCatch.types index b5a5821eacc..b0fbd4e7f12 100644 --- a/tests/baselines/reference/implicitAnyInCatch.types +++ b/tests/baselines/reference/implicitAnyInCatch.types @@ -9,6 +9,7 @@ try { } catch (error) { >error : any >number : any >-2147024809 : number +>2147024809 : number } for (var key in this) { } >key : any diff --git a/tests/baselines/reference/importAliasIdentifiers.symbols b/tests/baselines/reference/importAliasIdentifiers.symbols new file mode 100644 index 00000000000..3b2ba0ea46a --- /dev/null +++ b/tests/baselines/reference/importAliasIdentifiers.symbols @@ -0,0 +1,120 @@ +=== tests/cases/conformance/internalModules/importDeclarations/importAliasIdentifiers.ts === +module moduleA { +>moduleA : Symbol(moduleA, Decl(importAliasIdentifiers.ts, 0, 0)) + + export class Point { +>Point : Symbol(Point, Decl(importAliasIdentifiers.ts, 0, 16)) + + constructor(public x: number, public y: number) { } +>x : Symbol(x, Decl(importAliasIdentifiers.ts, 2, 20)) +>y : Symbol(y, Decl(importAliasIdentifiers.ts, 2, 37)) + } +} + +import alias = moduleA; +>alias : Symbol(alias, Decl(importAliasIdentifiers.ts, 4, 1)) +>moduleA : Symbol(moduleA, Decl(importAliasIdentifiers.ts, 0, 0)) + +var p: alias.Point; +>p : Symbol(p, Decl(importAliasIdentifiers.ts, 8, 3), Decl(importAliasIdentifiers.ts, 9, 3), Decl(importAliasIdentifiers.ts, 10, 3), Decl(importAliasIdentifiers.ts, 25, 3), Decl(importAliasIdentifiers.ts, 26, 3), Decl(importAliasIdentifiers.ts, 27, 3), Decl(importAliasIdentifiers.ts, 43, 3), Decl(importAliasIdentifiers.ts, 44, 3), Decl(importAliasIdentifiers.ts, 45, 3)) +>alias : Symbol(alias, Decl(importAliasIdentifiers.ts, 4, 1)) +>Point : Symbol(alias.Point, Decl(importAliasIdentifiers.ts, 0, 16)) + +var p: moduleA.Point; +>p : Symbol(p, Decl(importAliasIdentifiers.ts, 8, 3), Decl(importAliasIdentifiers.ts, 9, 3), Decl(importAliasIdentifiers.ts, 10, 3), Decl(importAliasIdentifiers.ts, 25, 3), Decl(importAliasIdentifiers.ts, 26, 3), Decl(importAliasIdentifiers.ts, 27, 3), Decl(importAliasIdentifiers.ts, 43, 3), Decl(importAliasIdentifiers.ts, 44, 3), Decl(importAliasIdentifiers.ts, 45, 3)) +>moduleA : Symbol(moduleA, Decl(importAliasIdentifiers.ts, 0, 0)) +>Point : Symbol(alias.Point, Decl(importAliasIdentifiers.ts, 0, 16)) + +var p: { x: number; y: number; }; +>p : Symbol(p, Decl(importAliasIdentifiers.ts, 8, 3), Decl(importAliasIdentifiers.ts, 9, 3), Decl(importAliasIdentifiers.ts, 10, 3), Decl(importAliasIdentifiers.ts, 25, 3), Decl(importAliasIdentifiers.ts, 26, 3), Decl(importAliasIdentifiers.ts, 27, 3), Decl(importAliasIdentifiers.ts, 43, 3), Decl(importAliasIdentifiers.ts, 44, 3), Decl(importAliasIdentifiers.ts, 45, 3)) +>x : Symbol(x, Decl(importAliasIdentifiers.ts, 10, 8)) +>y : Symbol(y, Decl(importAliasIdentifiers.ts, 10, 19)) + +class clodule { +>clodule : Symbol(clodule, Decl(importAliasIdentifiers.ts, 10, 33), Decl(importAliasIdentifiers.ts, 14, 1)) + + name: string; +>name : Symbol(name, Decl(importAliasIdentifiers.ts, 12, 15)) +} + +module clodule { +>clodule : Symbol(clodule, Decl(importAliasIdentifiers.ts, 10, 33), Decl(importAliasIdentifiers.ts, 14, 1)) + + export interface Point { +>Point : Symbol(Point, Decl(importAliasIdentifiers.ts, 16, 16)) + + x: number; y: number; +>x : Symbol(x, Decl(importAliasIdentifiers.ts, 17, 28)) +>y : Symbol(y, Decl(importAliasIdentifiers.ts, 18, 18)) + } + var Point: Point = { x: 0, y: 0 }; +>Point : Symbol(Point, Decl(importAliasIdentifiers.ts, 16, 16), Decl(importAliasIdentifiers.ts, 20, 7)) +>Point : Symbol(Point, Decl(importAliasIdentifiers.ts, 16, 16)) +>x : Symbol(x, Decl(importAliasIdentifiers.ts, 20, 24)) +>y : Symbol(y, Decl(importAliasIdentifiers.ts, 20, 30)) +} + +import clolias = clodule; +>clolias : Symbol(clolias, Decl(importAliasIdentifiers.ts, 21, 1)) +>clodule : Symbol(clodule, Decl(importAliasIdentifiers.ts, 10, 33), Decl(importAliasIdentifiers.ts, 14, 1)) + +var p: clolias.Point; +>p : Symbol(p, Decl(importAliasIdentifiers.ts, 8, 3), Decl(importAliasIdentifiers.ts, 9, 3), Decl(importAliasIdentifiers.ts, 10, 3), Decl(importAliasIdentifiers.ts, 25, 3), Decl(importAliasIdentifiers.ts, 26, 3), Decl(importAliasIdentifiers.ts, 27, 3), Decl(importAliasIdentifiers.ts, 43, 3), Decl(importAliasIdentifiers.ts, 44, 3), Decl(importAliasIdentifiers.ts, 45, 3)) +>clolias : Symbol(clolias, Decl(importAliasIdentifiers.ts, 21, 1)) +>Point : Symbol(clolias.Point, Decl(importAliasIdentifiers.ts, 16, 16)) + +var p: clodule.Point; +>p : Symbol(p, Decl(importAliasIdentifiers.ts, 8, 3), Decl(importAliasIdentifiers.ts, 9, 3), Decl(importAliasIdentifiers.ts, 10, 3), Decl(importAliasIdentifiers.ts, 25, 3), Decl(importAliasIdentifiers.ts, 26, 3), Decl(importAliasIdentifiers.ts, 27, 3), Decl(importAliasIdentifiers.ts, 43, 3), Decl(importAliasIdentifiers.ts, 44, 3), Decl(importAliasIdentifiers.ts, 45, 3)) +>clodule : Symbol(clodule, Decl(importAliasIdentifiers.ts, 10, 33), Decl(importAliasIdentifiers.ts, 14, 1)) +>Point : Symbol(clolias.Point, Decl(importAliasIdentifiers.ts, 16, 16)) + +var p: { x: number; y: number; }; +>p : Symbol(p, Decl(importAliasIdentifiers.ts, 8, 3), Decl(importAliasIdentifiers.ts, 9, 3), Decl(importAliasIdentifiers.ts, 10, 3), Decl(importAliasIdentifiers.ts, 25, 3), Decl(importAliasIdentifiers.ts, 26, 3), Decl(importAliasIdentifiers.ts, 27, 3), Decl(importAliasIdentifiers.ts, 43, 3), Decl(importAliasIdentifiers.ts, 44, 3), Decl(importAliasIdentifiers.ts, 45, 3)) +>x : Symbol(x, Decl(importAliasIdentifiers.ts, 27, 8)) +>y : Symbol(y, Decl(importAliasIdentifiers.ts, 27, 19)) + + +function fundule() { +>fundule : Symbol(fundule, Decl(importAliasIdentifiers.ts, 27, 33), Decl(importAliasIdentifiers.ts, 32, 1)) + + return { x: 0, y: 0 }; +>x : Symbol(x, Decl(importAliasIdentifiers.ts, 31, 12)) +>y : Symbol(y, Decl(importAliasIdentifiers.ts, 31, 18)) +} + +module fundule { +>fundule : Symbol(fundule, Decl(importAliasIdentifiers.ts, 27, 33), Decl(importAliasIdentifiers.ts, 32, 1)) + + export interface Point { +>Point : Symbol(Point, Decl(importAliasIdentifiers.ts, 34, 16)) + + x: number; y: number; +>x : Symbol(x, Decl(importAliasIdentifiers.ts, 35, 28)) +>y : Symbol(y, Decl(importAliasIdentifiers.ts, 36, 18)) + } + var Point: Point = { x: 0, y: 0 }; +>Point : Symbol(Point, Decl(importAliasIdentifiers.ts, 34, 16), Decl(importAliasIdentifiers.ts, 38, 7)) +>Point : Symbol(Point, Decl(importAliasIdentifiers.ts, 34, 16)) +>x : Symbol(x, Decl(importAliasIdentifiers.ts, 38, 24)) +>y : Symbol(y, Decl(importAliasIdentifiers.ts, 38, 30)) +} + +import funlias = fundule; +>funlias : Symbol(funlias, Decl(importAliasIdentifiers.ts, 39, 1)) +>fundule : Symbol(fundule, Decl(importAliasIdentifiers.ts, 27, 33), Decl(importAliasIdentifiers.ts, 32, 1)) + +var p: funlias.Point; +>p : Symbol(p, Decl(importAliasIdentifiers.ts, 8, 3), Decl(importAliasIdentifiers.ts, 9, 3), Decl(importAliasIdentifiers.ts, 10, 3), Decl(importAliasIdentifiers.ts, 25, 3), Decl(importAliasIdentifiers.ts, 26, 3), Decl(importAliasIdentifiers.ts, 27, 3), Decl(importAliasIdentifiers.ts, 43, 3), Decl(importAliasIdentifiers.ts, 44, 3), Decl(importAliasIdentifiers.ts, 45, 3)) +>funlias : Symbol(funlias, Decl(importAliasIdentifiers.ts, 39, 1)) +>Point : Symbol(funlias.Point, Decl(importAliasIdentifiers.ts, 34, 16)) + +var p: fundule.Point; +>p : Symbol(p, Decl(importAliasIdentifiers.ts, 8, 3), Decl(importAliasIdentifiers.ts, 9, 3), Decl(importAliasIdentifiers.ts, 10, 3), Decl(importAliasIdentifiers.ts, 25, 3), Decl(importAliasIdentifiers.ts, 26, 3), Decl(importAliasIdentifiers.ts, 27, 3), Decl(importAliasIdentifiers.ts, 43, 3), Decl(importAliasIdentifiers.ts, 44, 3), Decl(importAliasIdentifiers.ts, 45, 3)) +>fundule : Symbol(fundule, Decl(importAliasIdentifiers.ts, 27, 33), Decl(importAliasIdentifiers.ts, 32, 1)) +>Point : Symbol(funlias.Point, Decl(importAliasIdentifiers.ts, 34, 16)) + +var p: { x: number; y: number; }; +>p : Symbol(p, Decl(importAliasIdentifiers.ts, 8, 3), Decl(importAliasIdentifiers.ts, 9, 3), Decl(importAliasIdentifiers.ts, 10, 3), Decl(importAliasIdentifiers.ts, 25, 3), Decl(importAliasIdentifiers.ts, 26, 3), Decl(importAliasIdentifiers.ts, 27, 3), Decl(importAliasIdentifiers.ts, 43, 3), Decl(importAliasIdentifiers.ts, 44, 3), Decl(importAliasIdentifiers.ts, 45, 3)) +>x : Symbol(x, Decl(importAliasIdentifiers.ts, 45, 8)) +>y : Symbol(y, Decl(importAliasIdentifiers.ts, 45, 19)) + diff --git a/tests/baselines/reference/importAliasIdentifiers.types b/tests/baselines/reference/importAliasIdentifiers.types index 7401c3e7518..6746a5b3af7 100644 --- a/tests/baselines/reference/importAliasIdentifiers.types +++ b/tests/baselines/reference/importAliasIdentifiers.types @@ -17,12 +17,12 @@ import alias = moduleA; var p: alias.Point; >p : alias.Point ->alias : unknown +>alias : any >Point : alias.Point var p: moduleA.Point; >p : alias.Point ->moduleA : unknown +>moduleA : any >Point : alias.Point var p: { x: number; y: number; }; @@ -52,7 +52,9 @@ module clodule { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } import clolias = clodule; @@ -61,12 +63,12 @@ import clolias = clodule; var p: clolias.Point; >p : alias.Point ->clolias : unknown +>clolias : any >Point : clolias.Point var p: clodule.Point; >p : alias.Point ->clodule : unknown +>clodule : any >Point : clolias.Point var p: { x: number; y: number; }; @@ -81,7 +83,9 @@ function fundule() { return { x: 0, y: 0 }; >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } module fundule { @@ -99,7 +103,9 @@ module fundule { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } import funlias = fundule; @@ -108,12 +114,12 @@ import funlias = fundule; var p: funlias.Point; >p : alias.Point ->funlias : unknown +>funlias : any >Point : funlias.Point var p: fundule.Point; >p : alias.Point ->fundule : unknown +>fundule : any >Point : funlias.Point var p: { x: number; y: number; }; diff --git a/tests/baselines/reference/importAliasWithDottedName.symbols b/tests/baselines/reference/importAliasWithDottedName.symbols new file mode 100644 index 00000000000..886bfdf2fce --- /dev/null +++ b/tests/baselines/reference/importAliasWithDottedName.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/importAliasWithDottedName.ts === +module M { +>M : Symbol(M, Decl(importAliasWithDottedName.ts, 0, 0)) + + export var x = 1; +>x : Symbol(x, Decl(importAliasWithDottedName.ts, 1, 14)) + + export module N { +>N : Symbol(N, Decl(importAliasWithDottedName.ts, 1, 21)) + + export var y = 2; +>y : Symbol(y, Decl(importAliasWithDottedName.ts, 3, 18)) + } +} + +module A { +>A : Symbol(A, Decl(importAliasWithDottedName.ts, 5, 1)) + + import N = M.N; +>N : Symbol(N, Decl(importAliasWithDottedName.ts, 7, 10)) +>M : Symbol(M, Decl(importAliasWithDottedName.ts, 0, 0)) +>N : Symbol(N, Decl(importAliasWithDottedName.ts, 1, 21)) + + var r = N.y; +>r : Symbol(r, Decl(importAliasWithDottedName.ts, 9, 7)) +>N.y : Symbol(N.y, Decl(importAliasWithDottedName.ts, 3, 18)) +>N : Symbol(N, Decl(importAliasWithDottedName.ts, 7, 10)) +>y : Symbol(N.y, Decl(importAliasWithDottedName.ts, 3, 18)) + + var r2 = M.N.y; +>r2 : Symbol(r2, Decl(importAliasWithDottedName.ts, 10, 7)) +>M.N.y : Symbol(N.y, Decl(importAliasWithDottedName.ts, 3, 18)) +>M.N : Symbol(N, Decl(importAliasWithDottedName.ts, 1, 21)) +>M : Symbol(M, Decl(importAliasWithDottedName.ts, 0, 0)) +>N : Symbol(N, Decl(importAliasWithDottedName.ts, 1, 21)) +>y : Symbol(N.y, Decl(importAliasWithDottedName.ts, 3, 18)) +} diff --git a/tests/baselines/reference/importAliasWithDottedName.types b/tests/baselines/reference/importAliasWithDottedName.types index ab316fade5c..24ec5d1b0bb 100644 --- a/tests/baselines/reference/importAliasWithDottedName.types +++ b/tests/baselines/reference/importAliasWithDottedName.types @@ -4,12 +4,14 @@ module M { export var x = 1; >x : number +>1 : number export module N { >N : typeof N export var y = 2; >y : number +>2 : number } } diff --git a/tests/baselines/reference/importAndVariableDeclarationConflict2.symbols b/tests/baselines/reference/importAndVariableDeclarationConflict2.symbols new file mode 100644 index 00000000000..570bb5e2b98 --- /dev/null +++ b/tests/baselines/reference/importAndVariableDeclarationConflict2.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/importAndVariableDeclarationConflict2.ts === +module m { +>m : Symbol(m, Decl(importAndVariableDeclarationConflict2.ts, 0, 0)) + + export var m = ''; +>m : Symbol(m, Decl(importAndVariableDeclarationConflict2.ts, 1, 12)) +} + +import x = m.m; +>x : Symbol(x, Decl(importAndVariableDeclarationConflict2.ts, 2, 1)) +>m : Symbol(m, Decl(importAndVariableDeclarationConflict2.ts, 0, 0)) +>m : Symbol(x, Decl(importAndVariableDeclarationConflict2.ts, 1, 12)) + +class C { +>C : Symbol(C, Decl(importAndVariableDeclarationConflict2.ts, 4, 15)) + + public foo() { +>foo : Symbol(foo, Decl(importAndVariableDeclarationConflict2.ts, 6, 9)) + + var x = ''; +>x : Symbol(x, Decl(importAndVariableDeclarationConflict2.ts, 8, 7)) + } +} diff --git a/tests/baselines/reference/importAndVariableDeclarationConflict2.types b/tests/baselines/reference/importAndVariableDeclarationConflict2.types index eb4f354a4dc..eafc7be6deb 100644 --- a/tests/baselines/reference/importAndVariableDeclarationConflict2.types +++ b/tests/baselines/reference/importAndVariableDeclarationConflict2.types @@ -4,6 +4,7 @@ module m { export var m = ''; >m : string +>'' : string } import x = m.m; @@ -19,5 +20,6 @@ class C { var x = ''; >x : string +>'' : string } } diff --git a/tests/baselines/reference/importDecl.symbols b/tests/baselines/reference/importDecl.symbols new file mode 100644 index 00000000000..2341101b672 --- /dev/null +++ b/tests/baselines/reference/importDecl.symbols @@ -0,0 +1,220 @@ +=== tests/cases/compiler/importDecl_1.ts === +/// +/// +/// +/// +/// +import m4 = require("importDecl_require"); // Emit used +>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0)) + +export var x4 = m4.x; +>x4 : Symbol(x4, Decl(importDecl_1.ts, 6, 10)) +>m4.x : Symbol(m4.x, Decl(importDecl_require.ts, 3, 10)) +>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0)) +>x : Symbol(m4.x, Decl(importDecl_require.ts, 3, 10)) + +export var d4 = m4.d; +>d4 : Symbol(d4, Decl(importDecl_1.ts, 7, 10)) +>m4.d : Symbol(m4.d, Decl(importDecl_require.ts, 0, 0)) +>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0)) +>d : Symbol(m4.d, Decl(importDecl_require.ts, 0, 0)) + +export var f4 = m4.foo(); +>f4 : Symbol(f4, Decl(importDecl_1.ts, 8, 10)) +>m4.foo : Symbol(m4.foo, Decl(importDecl_require.ts, 3, 16)) +>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0)) +>foo : Symbol(m4.foo, Decl(importDecl_require.ts, 3, 16)) + +export module m1 { +>m1 : Symbol(m1, Decl(importDecl_1.ts, 8, 25)) + + export var x2 = m4.x; +>x2 : Symbol(x2, Decl(importDecl_1.ts, 11, 14)) +>m4.x : Symbol(m4.x, Decl(importDecl_require.ts, 3, 10)) +>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0)) +>x : Symbol(m4.x, Decl(importDecl_require.ts, 3, 10)) + + export var d2 = m4.d; +>d2 : Symbol(d2, Decl(importDecl_1.ts, 12, 14)) +>m4.d : Symbol(m4.d, Decl(importDecl_require.ts, 0, 0)) +>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0)) +>d : Symbol(m4.d, Decl(importDecl_require.ts, 0, 0)) + + export var f2 = m4.foo(); +>f2 : Symbol(f2, Decl(importDecl_1.ts, 13, 14)) +>m4.foo : Symbol(m4.foo, Decl(importDecl_require.ts, 3, 16)) +>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0)) +>foo : Symbol(m4.foo, Decl(importDecl_require.ts, 3, 16)) + + var x3 = m4.x; +>x3 : Symbol(x3, Decl(importDecl_1.ts, 15, 7)) +>m4.x : Symbol(m4.x, Decl(importDecl_require.ts, 3, 10)) +>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0)) +>x : Symbol(m4.x, Decl(importDecl_require.ts, 3, 10)) + + var d3 = m4.d; +>d3 : Symbol(d3, Decl(importDecl_1.ts, 16, 7)) +>m4.d : Symbol(m4.d, Decl(importDecl_require.ts, 0, 0)) +>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0)) +>d : Symbol(m4.d, Decl(importDecl_require.ts, 0, 0)) + + var f3 = m4.foo(); +>f3 : Symbol(f3, Decl(importDecl_1.ts, 17, 7)) +>m4.foo : Symbol(m4.foo, Decl(importDecl_require.ts, 3, 16)) +>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0)) +>foo : Symbol(m4.foo, Decl(importDecl_require.ts, 3, 16)) +} + +//Emit global only usage +import glo_m4 = require("importDecl_require1"); +>glo_m4 : Symbol(glo_m4, Decl(importDecl_1.ts, 18, 1)) + +export var useGlo_m4_d4 = glo_m4.d; +>useGlo_m4_d4 : Symbol(useGlo_m4_d4, Decl(importDecl_1.ts, 22, 10)) +>glo_m4.d : Symbol(glo_m4.d, Decl(importDecl_require1.ts, 0, 0)) +>glo_m4 : Symbol(glo_m4, Decl(importDecl_1.ts, 18, 1)) +>d : Symbol(glo_m4.d, Decl(importDecl_require1.ts, 0, 0)) + +export var useGlo_m4_f4 = glo_m4.foo(); +>useGlo_m4_f4 : Symbol(useGlo_m4_f4, Decl(importDecl_1.ts, 23, 10)) +>glo_m4.foo : Symbol(glo_m4.foo, Decl(importDecl_require1.ts, 3, 9)) +>glo_m4 : Symbol(glo_m4, Decl(importDecl_1.ts, 18, 1)) +>foo : Symbol(glo_m4.foo, Decl(importDecl_require1.ts, 3, 9)) + +//Emit even when used just in function type +import fncOnly_m4 = require("importDecl_require2"); +>fncOnly_m4 : Symbol(fncOnly_m4, Decl(importDecl_1.ts, 23, 39)) + +export var useFncOnly_m4_f4 = fncOnly_m4.foo(); +>useFncOnly_m4_f4 : Symbol(useFncOnly_m4_f4, Decl(importDecl_1.ts, 27, 10)) +>fncOnly_m4.foo : Symbol(fncOnly_m4.foo, Decl(importDecl_require2.ts, 3, 16)) +>fncOnly_m4 : Symbol(fncOnly_m4, Decl(importDecl_1.ts, 23, 39)) +>foo : Symbol(fncOnly_m4.foo, Decl(importDecl_require2.ts, 3, 16)) + +// only used privately no need to emit +import private_m4 = require("importDecl_require3"); +>private_m4 : Symbol(private_m4, Decl(importDecl_1.ts, 27, 47)) + +export module usePrivate_m4_m1 { +>usePrivate_m4_m1 : Symbol(usePrivate_m4_m1, Decl(importDecl_1.ts, 30, 51)) + + var x3 = private_m4.x; +>x3 : Symbol(x3, Decl(importDecl_1.ts, 32, 7)) +>private_m4.x : Symbol(private_m4.x, Decl(importDecl_require3.ts, 3, 10)) +>private_m4 : Symbol(private_m4, Decl(importDecl_1.ts, 27, 47)) +>x : Symbol(private_m4.x, Decl(importDecl_require3.ts, 3, 10)) + + var d3 = private_m4.d; +>d3 : Symbol(d3, Decl(importDecl_1.ts, 33, 7)) +>private_m4.d : Symbol(private_m4.d, Decl(importDecl_require3.ts, 0, 0)) +>private_m4 : Symbol(private_m4, Decl(importDecl_1.ts, 27, 47)) +>d : Symbol(private_m4.d, Decl(importDecl_require3.ts, 0, 0)) + + var f3 = private_m4.foo(); +>f3 : Symbol(f3, Decl(importDecl_1.ts, 34, 7)) +>private_m4.foo : Symbol(private_m4.foo, Decl(importDecl_require3.ts, 3, 16)) +>private_m4 : Symbol(private_m4, Decl(importDecl_1.ts, 27, 47)) +>foo : Symbol(private_m4.foo, Decl(importDecl_require3.ts, 3, 16)) +} + +// Do not emit unused import +import m5 = require("importDecl_require4"); +>m5 : Symbol(m5, Decl(importDecl_1.ts, 35, 1)) + +export var d = m5.foo2(); +>d : Symbol(d, Decl(importDecl_1.ts, 39, 10)) +>m5.foo2 : Symbol(m5.foo2, Decl(importDecl_require4.ts, 0, 42)) +>m5 : Symbol(m5, Decl(importDecl_1.ts, 35, 1)) +>foo2 : Symbol(m5.foo2, Decl(importDecl_require4.ts, 0, 42)) + +// Do not emit multiple used import statements +import multiImport_m4 = require("importDecl_require"); // Emit used +>multiImport_m4 : Symbol(multiImport_m4, Decl(importDecl_1.ts, 39, 25)) + +export var useMultiImport_m4_x4 = multiImport_m4.x; +>useMultiImport_m4_x4 : Symbol(useMultiImport_m4_x4, Decl(importDecl_1.ts, 43, 10)) +>multiImport_m4.x : Symbol(m4.x, Decl(importDecl_require.ts, 3, 10)) +>multiImport_m4 : Symbol(multiImport_m4, Decl(importDecl_1.ts, 39, 25)) +>x : Symbol(m4.x, Decl(importDecl_require.ts, 3, 10)) + +export var useMultiImport_m4_d4 = multiImport_m4.d; +>useMultiImport_m4_d4 : Symbol(useMultiImport_m4_d4, Decl(importDecl_1.ts, 44, 10)) +>multiImport_m4.d : Symbol(m4.d, Decl(importDecl_require.ts, 0, 0)) +>multiImport_m4 : Symbol(multiImport_m4, Decl(importDecl_1.ts, 39, 25)) +>d : Symbol(m4.d, Decl(importDecl_require.ts, 0, 0)) + +export var useMultiImport_m4_f4 = multiImport_m4.foo(); +>useMultiImport_m4_f4 : Symbol(useMultiImport_m4_f4, Decl(importDecl_1.ts, 45, 10)) +>multiImport_m4.foo : Symbol(m4.foo, Decl(importDecl_require.ts, 3, 16)) +>multiImport_m4 : Symbol(multiImport_m4, Decl(importDecl_1.ts, 39, 25)) +>foo : Symbol(m4.foo, Decl(importDecl_require.ts, 3, 16)) + +=== tests/cases/compiler/importDecl_require.ts === +export class d { +>d : Symbol(d, Decl(importDecl_require.ts, 0, 0)) + + foo: string; +>foo : Symbol(foo, Decl(importDecl_require.ts, 0, 16)) +} +export var x: d; +>x : Symbol(x, Decl(importDecl_require.ts, 3, 10)) +>d : Symbol(d, Decl(importDecl_require.ts, 0, 0)) + +export function foo(): d { return null; } +>foo : Symbol(foo, Decl(importDecl_require.ts, 3, 16)) +>d : Symbol(d, Decl(importDecl_require.ts, 0, 0)) + +=== tests/cases/compiler/importDecl_require1.ts === +export class d { +>d : Symbol(d, Decl(importDecl_require1.ts, 0, 0)) + + bar: string; +>bar : Symbol(bar, Decl(importDecl_require1.ts, 0, 16)) +} +var x: d; +>x : Symbol(x, Decl(importDecl_require1.ts, 3, 3)) +>d : Symbol(d, Decl(importDecl_require1.ts, 0, 0)) + +export function foo(): d { return null; } +>foo : Symbol(foo, Decl(importDecl_require1.ts, 3, 9)) +>d : Symbol(d, Decl(importDecl_require1.ts, 0, 0)) + +=== tests/cases/compiler/importDecl_require2.ts === +export class d { +>d : Symbol(d, Decl(importDecl_require2.ts, 0, 0)) + + baz: string; +>baz : Symbol(baz, Decl(importDecl_require2.ts, 0, 16)) +} +export var x: d; +>x : Symbol(x, Decl(importDecl_require2.ts, 3, 10)) +>d : Symbol(d, Decl(importDecl_require2.ts, 0, 0)) + +export function foo(): d { return null; } +>foo : Symbol(foo, Decl(importDecl_require2.ts, 3, 16)) +>d : Symbol(d, Decl(importDecl_require2.ts, 0, 0)) + +=== tests/cases/compiler/importDecl_require3.ts === +export class d { +>d : Symbol(d, Decl(importDecl_require3.ts, 0, 0)) + + bing: string; +>bing : Symbol(bing, Decl(importDecl_require3.ts, 0, 16)) +} +export var x: d; +>x : Symbol(x, Decl(importDecl_require3.ts, 3, 10)) +>d : Symbol(d, Decl(importDecl_require3.ts, 0, 0)) + +export function foo(): d { return null; } +>foo : Symbol(foo, Decl(importDecl_require3.ts, 3, 16)) +>d : Symbol(d, Decl(importDecl_require3.ts, 0, 0)) + +=== tests/cases/compiler/importDecl_require4.ts === +import m4 = require("importDecl_require"); +>m4 : Symbol(m4, Decl(importDecl_require4.ts, 0, 0)) + +export function foo2(): m4.d { return null; } +>foo2 : Symbol(foo2, Decl(importDecl_require4.ts, 0, 42)) +>m4 : Symbol(m4, Decl(importDecl_require4.ts, 0, 0)) +>d : Symbol(m4.d, Decl(importDecl_require.ts, 0, 0)) + diff --git a/tests/baselines/reference/importDecl.types b/tests/baselines/reference/importDecl.types index 973729ae050..58a56281bae 100644 --- a/tests/baselines/reference/importDecl.types +++ b/tests/baselines/reference/importDecl.types @@ -171,6 +171,7 @@ export var x: d; export function foo(): d { return null; } >foo : () => d >d : d +>null : null === tests/cases/compiler/importDecl_require1.ts === export class d { @@ -186,6 +187,7 @@ var x: d; export function foo(): d { return null; } >foo : () => d >d : d +>null : null === tests/cases/compiler/importDecl_require2.ts === export class d { @@ -201,6 +203,7 @@ export var x: d; export function foo(): d { return null; } >foo : () => d >d : d +>null : null === tests/cases/compiler/importDecl_require3.ts === export class d { @@ -216,6 +219,7 @@ export var x: d; export function foo(): d { return null; } >foo : () => d >d : d +>null : null === tests/cases/compiler/importDecl_require4.ts === import m4 = require("importDecl_require"); @@ -223,6 +227,7 @@ import m4 = require("importDecl_require"); export function foo2(): m4.d { return null; } >foo2 : () => m4.d ->m4 : unknown +>m4 : any >d : m4.d +>null : null diff --git a/tests/baselines/reference/importDeclWithExportModifierInAmbientContext.symbols b/tests/baselines/reference/importDeclWithExportModifierInAmbientContext.symbols new file mode 100644 index 00000000000..892cbf7464e --- /dev/null +++ b/tests/baselines/reference/importDeclWithExportModifierInAmbientContext.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/importDeclWithExportModifierInAmbientContext.ts === +declare module "m" { + module x { +>x : Symbol(x, Decl(importDeclWithExportModifierInAmbientContext.ts, 0, 20)) + + interface c { +>c : Symbol(c, Decl(importDeclWithExportModifierInAmbientContext.ts, 1, 14)) + } + } + export import a = x.c; +>a : Symbol(a, Decl(importDeclWithExportModifierInAmbientContext.ts, 4, 5)) +>x : Symbol(x, Decl(importDeclWithExportModifierInAmbientContext.ts, 0, 20)) +>c : Symbol(a, Decl(importDeclWithExportModifierInAmbientContext.ts, 1, 14)) + + var b: a; +>b : Symbol(b, Decl(importDeclWithExportModifierInAmbientContext.ts, 6, 7)) +>a : Symbol(a, Decl(importDeclWithExportModifierInAmbientContext.ts, 4, 5)) +} + diff --git a/tests/baselines/reference/importDeclWithExportModifierInAmbientContext.types b/tests/baselines/reference/importDeclWithExportModifierInAmbientContext.types index 6649b33bfe0..617c133aeee 100644 --- a/tests/baselines/reference/importDeclWithExportModifierInAmbientContext.types +++ b/tests/baselines/reference/importDeclWithExportModifierInAmbientContext.types @@ -1,15 +1,15 @@ === tests/cases/compiler/importDeclWithExportModifierInAmbientContext.ts === declare module "m" { module x { ->x : unknown +>x : any interface c { >c : c } } export import a = x.c; ->a : unknown ->x : unknown +>a : any +>x : any >c : a var b: a; diff --git a/tests/baselines/reference/importDeclarationUsedAsTypeQuery.symbols b/tests/baselines/reference/importDeclarationUsedAsTypeQuery.symbols new file mode 100644 index 00000000000..2664691972f --- /dev/null +++ b/tests/baselines/reference/importDeclarationUsedAsTypeQuery.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/importDeclarationUsedAsTypeQuery_1.ts === +/// +import a = require('importDeclarationUsedAsTypeQuery_require'); +>a : Symbol(a, Decl(importDeclarationUsedAsTypeQuery_1.ts, 0, 0)) + +export var x: typeof a; +>x : Symbol(x, Decl(importDeclarationUsedAsTypeQuery_1.ts, 2, 10)) +>a : Symbol(a, Decl(importDeclarationUsedAsTypeQuery_1.ts, 0, 0)) + +=== tests/cases/compiler/importDeclarationUsedAsTypeQuery_require.ts === +export class B { +>B : Symbol(B, Decl(importDeclarationUsedAsTypeQuery_require.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(importDeclarationUsedAsTypeQuery_require.ts, 0, 16)) +} + diff --git a/tests/baselines/reference/importImportOnlyModule.symbols b/tests/baselines/reference/importImportOnlyModule.symbols new file mode 100644 index 00000000000..902f1b45a68 --- /dev/null +++ b/tests/baselines/reference/importImportOnlyModule.symbols @@ -0,0 +1,26 @@ +=== tests/cases/conformance/externalModules/foo_2.ts === +import foo = require("./foo_1"); +>foo : Symbol(foo, Decl(foo_2.ts, 0, 0)) + +var x = foo; // Cause a runtime dependency +>x : Symbol(x, Decl(foo_2.ts, 1, 3)) +>foo : Symbol(foo, Decl(foo_2.ts, 0, 0)) + +=== tests/cases/conformance/externalModules/foo_0.ts === +export class C1 { +>C1 : Symbol(C1, Decl(foo_0.ts, 0, 0)) + + m1 = 42; +>m1 : Symbol(m1, Decl(foo_0.ts, 0, 17)) + + static s1 = true; +>s1 : Symbol(C1.s1, Decl(foo_0.ts, 1, 9)) +} + +=== tests/cases/conformance/externalModules/foo_1.ts === +import c1 = require('./foo_0'); // Makes this an external module +>c1 : Symbol(c1, Decl(foo_1.ts, 0, 0)) + +var answer = 42; // No exports +>answer : Symbol(answer, Decl(foo_1.ts, 1, 3)) + diff --git a/tests/baselines/reference/importImportOnlyModule.types b/tests/baselines/reference/importImportOnlyModule.types index 741d1b24859..c1275bed511 100644 --- a/tests/baselines/reference/importImportOnlyModule.types +++ b/tests/baselines/reference/importImportOnlyModule.types @@ -12,9 +12,11 @@ export class C1 { m1 = 42; >m1 : number +>42 : number static s1 = true; >s1 : boolean +>true : boolean } === tests/cases/conformance/externalModules/foo_1.ts === @@ -23,4 +25,5 @@ import c1 = require('./foo_0'); // Makes this an external module var answer = 42; // No exports >answer : number +>42 : number diff --git a/tests/baselines/reference/importInTypePosition.symbols b/tests/baselines/reference/importInTypePosition.symbols new file mode 100644 index 00000000000..08f55093c50 --- /dev/null +++ b/tests/baselines/reference/importInTypePosition.symbols @@ -0,0 +1,47 @@ +=== tests/cases/compiler/importInTypePosition.ts === +module A { +>A : Symbol(A, Decl(importInTypePosition.ts, 0, 0)) + + export class Point { +>Point : Symbol(Point, Decl(importInTypePosition.ts, 0, 10)) + + constructor(public x: number, public y: number) { } +>x : Symbol(x, Decl(importInTypePosition.ts, 2, 20)) +>y : Symbol(y, Decl(importInTypePosition.ts, 2, 37)) + } + export var Origin = new Point(0, 0); +>Origin : Symbol(Origin, Decl(importInTypePosition.ts, 4, 14)) +>Point : Symbol(Point, Decl(importInTypePosition.ts, 0, 10)) +} + +// no code gen expected +module B { +>B : Symbol(B, Decl(importInTypePosition.ts, 5, 1)) + + import a = A; //Error generates 'var = ;' +>a : Symbol(a, Decl(importInTypePosition.ts, 8, 10)) +>A : Symbol(a, Decl(importInTypePosition.ts, 0, 0)) +} +// no code gen expected +module C { +>C : Symbol(C, Decl(importInTypePosition.ts, 11, 1)) + + import a = A; //Error generates 'var = ;' +>a : Symbol(a, Decl(importInTypePosition.ts, 13, 10)) +>A : Symbol(a, Decl(importInTypePosition.ts, 0, 0)) + + var m: typeof a; +>m : Symbol(m, Decl(importInTypePosition.ts, 16, 7)) +>a : Symbol(a, Decl(importInTypePosition.ts, 13, 10)) + + var p: a.Point; +>p : Symbol(p, Decl(importInTypePosition.ts, 17, 7), Decl(importInTypePosition.ts, 18, 7)) +>a : Symbol(a, Decl(importInTypePosition.ts, 13, 10)) +>Point : Symbol(a.Point, Decl(importInTypePosition.ts, 0, 10)) + + var p = { x: 0, y: 0 }; +>p : Symbol(p, Decl(importInTypePosition.ts, 17, 7), Decl(importInTypePosition.ts, 18, 7)) +>x : Symbol(x, Decl(importInTypePosition.ts, 18, 13)) +>y : Symbol(y, Decl(importInTypePosition.ts, 18, 19)) +} + diff --git a/tests/baselines/reference/importInTypePosition.types b/tests/baselines/reference/importInTypePosition.types index 163ae1d3a62..7360416e4b3 100644 --- a/tests/baselines/reference/importInTypePosition.types +++ b/tests/baselines/reference/importInTypePosition.types @@ -13,11 +13,13 @@ module A { >Origin : Point >new Point(0, 0) : Point >Point : typeof Point +>0 : number +>0 : number } // no code gen expected module B { ->B : unknown +>B : any import a = A; //Error generates 'var = ;' >a : typeof a @@ -37,13 +39,15 @@ module C { var p: a.Point; >p : a.Point ->a : unknown +>a : any >Point : a.Point var p = { x: 0, y: 0 }; >p : a.Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } diff --git a/tests/baselines/reference/importOnAliasedIdentifiers.symbols b/tests/baselines/reference/importOnAliasedIdentifiers.symbols new file mode 100644 index 00000000000..7717799d4db --- /dev/null +++ b/tests/baselines/reference/importOnAliasedIdentifiers.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/importOnAliasedIdentifiers.ts === +module A { +>A : Symbol(A, Decl(importOnAliasedIdentifiers.ts, 0, 0)) + + export interface X { s: string } +>X : Symbol(X, Decl(importOnAliasedIdentifiers.ts, 0, 10), Decl(importOnAliasedIdentifiers.ts, 2, 14)) +>s : Symbol(s, Decl(importOnAliasedIdentifiers.ts, 1, 24)) + + export var X: X; +>X : Symbol(X, Decl(importOnAliasedIdentifiers.ts, 0, 10), Decl(importOnAliasedIdentifiers.ts, 2, 14)) +>X : Symbol(X, Decl(importOnAliasedIdentifiers.ts, 0, 10), Decl(importOnAliasedIdentifiers.ts, 2, 14)) +} +module B { +>B : Symbol(B, Decl(importOnAliasedIdentifiers.ts, 3, 1)) + + interface A { n: number } +>A : Symbol(A, Decl(importOnAliasedIdentifiers.ts, 4, 10)) +>n : Symbol(n, Decl(importOnAliasedIdentifiers.ts, 5, 17)) + + import Y = A; // Alias only for module A +>Y : Symbol(Y, Decl(importOnAliasedIdentifiers.ts, 5, 29)) +>A : Symbol(Y, Decl(importOnAliasedIdentifiers.ts, 0, 0)) + + import Z = A.X; // Alias for both type and member A.X +>Z : Symbol(Z, Decl(importOnAliasedIdentifiers.ts, 6, 17)) +>A : Symbol(Y, Decl(importOnAliasedIdentifiers.ts, 0, 0)) +>X : Symbol(Y.X, Decl(importOnAliasedIdentifiers.ts, 0, 10), Decl(importOnAliasedIdentifiers.ts, 2, 14)) + + var v: Z = Z; +>v : Symbol(v, Decl(importOnAliasedIdentifiers.ts, 8, 7)) +>Z : Symbol(Z, Decl(importOnAliasedIdentifiers.ts, 6, 17)) +>Z : Symbol(Z, Decl(importOnAliasedIdentifiers.ts, 6, 17)) +} diff --git a/tests/baselines/reference/importShadowsGlobalName.symbols b/tests/baselines/reference/importShadowsGlobalName.symbols new file mode 100644 index 00000000000..f308572737b --- /dev/null +++ b/tests/baselines/reference/importShadowsGlobalName.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/Bar.ts === +import Error = require('Foo'); +>Error : Symbol(Error, Decl(Bar.ts, 0, 0)) + +class Bar extends Error {} +>Bar : Symbol(Bar, Decl(Bar.ts, 0, 30)) +>Error : Symbol(Error, Decl(Bar.ts, 0, 0)) + +export = Bar; +>Bar : Symbol(Bar, Decl(Bar.ts, 0, 30)) + +=== tests/cases/compiler/Foo.ts === + +class Foo {} +>Foo : Symbol(Foo, Decl(Foo.ts, 0, 0)) + +export = Foo; +>Foo : Symbol(Foo, Decl(Foo.ts, 0, 0)) + diff --git a/tests/baselines/reference/importStatements.symbols b/tests/baselines/reference/importStatements.symbols new file mode 100644 index 00000000000..b160dcf2888 --- /dev/null +++ b/tests/baselines/reference/importStatements.symbols @@ -0,0 +1,88 @@ +=== tests/cases/conformance/internalModules/codeGeneration/importStatements.ts === +module A { +>A : Symbol(A, Decl(importStatements.ts, 0, 0)) + + export class Point { +>Point : Symbol(Point, Decl(importStatements.ts, 0, 10)) + + constructor(public x: number, public y: number) { } +>x : Symbol(x, Decl(importStatements.ts, 2, 20)) +>y : Symbol(y, Decl(importStatements.ts, 2, 37)) + } + + export var Origin = new Point(0, 0); +>Origin : Symbol(Origin, Decl(importStatements.ts, 5, 14)) +>Point : Symbol(Point, Decl(importStatements.ts, 0, 10)) +} + +// no code gen expected +module B { +>B : Symbol(B, Decl(importStatements.ts, 6, 1)) + + import a = A; //Error generates 'var = ;' +>a : Symbol(a, Decl(importStatements.ts, 9, 10)) +>A : Symbol(a, Decl(importStatements.ts, 0, 0)) +} + +// no code gen expected +module C { +>C : Symbol(C, Decl(importStatements.ts, 11, 1)) + + import a = A; //Error generates 'var = ;' +>a : Symbol(a, Decl(importStatements.ts, 14, 10)) +>A : Symbol(a, Decl(importStatements.ts, 0, 0)) + + var m: typeof a; +>m : Symbol(m, Decl(importStatements.ts, 16, 7)) +>a : Symbol(a, Decl(importStatements.ts, 14, 10)) + + var p: a.Point; +>p : Symbol(p, Decl(importStatements.ts, 17, 7), Decl(importStatements.ts, 18, 7)) +>a : Symbol(a, Decl(importStatements.ts, 14, 10)) +>Point : Symbol(a.Point, Decl(importStatements.ts, 0, 10)) + + var p = {x:0, y:0 }; +>p : Symbol(p, Decl(importStatements.ts, 17, 7), Decl(importStatements.ts, 18, 7)) +>x : Symbol(x, Decl(importStatements.ts, 18, 13)) +>y : Symbol(y, Decl(importStatements.ts, 18, 17)) +} + +// code gen expected +module D { +>D : Symbol(D, Decl(importStatements.ts, 19, 1)) + + import a = A; +>a : Symbol(a, Decl(importStatements.ts, 22, 10)) +>A : Symbol(a, Decl(importStatements.ts, 0, 0)) + + var p = new a.Point(1, 1); +>p : Symbol(p, Decl(importStatements.ts, 25, 7)) +>a.Point : Symbol(a.Point, Decl(importStatements.ts, 0, 10)) +>a : Symbol(a, Decl(importStatements.ts, 22, 10)) +>Point : Symbol(a.Point, Decl(importStatements.ts, 0, 10)) +} + +module E { +>E : Symbol(E, Decl(importStatements.ts, 26, 1)) + + import a = A; +>a : Symbol(a, Decl(importStatements.ts, 28, 10)) +>A : Symbol(a, Decl(importStatements.ts, 0, 0)) + + export function xDist(x: a.Point) { +>xDist : Symbol(xDist, Decl(importStatements.ts, 29, 17)) +>x : Symbol(x, Decl(importStatements.ts, 30, 26)) +>a : Symbol(a, Decl(importStatements.ts, 28, 10)) +>Point : Symbol(a.Point, Decl(importStatements.ts, 0, 10)) + + return (a.Origin.x - x.x); +>a.Origin.x : Symbol(a.Point.x, Decl(importStatements.ts, 2, 20)) +>a.Origin : Symbol(a.Origin, Decl(importStatements.ts, 5, 14)) +>a : Symbol(a, Decl(importStatements.ts, 28, 10)) +>Origin : Symbol(a.Origin, Decl(importStatements.ts, 5, 14)) +>x : Symbol(a.Point.x, Decl(importStatements.ts, 2, 20)) +>x.x : Symbol(a.Point.x, Decl(importStatements.ts, 2, 20)) +>x : Symbol(x, Decl(importStatements.ts, 30, 26)) +>x : Symbol(a.Point.x, Decl(importStatements.ts, 2, 20)) + } +} diff --git a/tests/baselines/reference/importStatements.types b/tests/baselines/reference/importStatements.types index 5980a142f34..ecf4453b360 100644 --- a/tests/baselines/reference/importStatements.types +++ b/tests/baselines/reference/importStatements.types @@ -14,11 +14,13 @@ module A { >Origin : Point >new Point(0, 0) : Point >Point : typeof Point +>0 : number +>0 : number } // no code gen expected module B { ->B : unknown +>B : any import a = A; //Error generates 'var = ;' >a : typeof a @@ -39,14 +41,16 @@ module C { var p: a.Point; >p : a.Point ->a : unknown +>a : any >Point : a.Point var p = {x:0, y:0 }; >p : a.Point >{x:0, y:0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } // code gen expected @@ -63,6 +67,8 @@ module D { >a.Point : typeof a.Point >a : typeof a >Point : typeof a.Point +>1 : number +>1 : number } module E { @@ -75,7 +81,7 @@ module E { export function xDist(x: a.Point) { >xDist : (x: a.Point) => number >x : a.Point ->a : unknown +>a : any >Point : a.Point return (a.Origin.x - x.x); diff --git a/tests/baselines/reference/importUsedInExtendsList1.symbols b/tests/baselines/reference/importUsedInExtendsList1.symbols new file mode 100644 index 00000000000..1b3ac99ee9d --- /dev/null +++ b/tests/baselines/reference/importUsedInExtendsList1.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/importUsedInExtendsList1_1.ts === +/// +import foo = require('importUsedInExtendsList1_require'); +>foo : Symbol(foo, Decl(importUsedInExtendsList1_1.ts, 0, 0)) + +class Sub extends foo.Super { } +>Sub : Symbol(Sub, Decl(importUsedInExtendsList1_1.ts, 1, 57)) +>foo.Super : Symbol(foo.Super, Decl(importUsedInExtendsList1_require.ts, 0, 0)) +>foo : Symbol(foo, Decl(importUsedInExtendsList1_1.ts, 0, 0)) +>Super : Symbol(foo.Super, Decl(importUsedInExtendsList1_require.ts, 0, 0)) + +var s: Sub; +>s : Symbol(s, Decl(importUsedInExtendsList1_1.ts, 3, 3)) +>Sub : Symbol(Sub, Decl(importUsedInExtendsList1_1.ts, 1, 57)) + +var r: string = s.foo; +>r : Symbol(r, Decl(importUsedInExtendsList1_1.ts, 4, 3)) +>s.foo : Symbol(foo.Super.foo, Decl(importUsedInExtendsList1_require.ts, 0, 20)) +>s : Symbol(s, Decl(importUsedInExtendsList1_1.ts, 3, 3)) +>foo : Symbol(foo.Super.foo, Decl(importUsedInExtendsList1_require.ts, 0, 20)) + +=== tests/cases/compiler/importUsedInExtendsList1_require.ts === +export class Super { foo: string; } +>Super : Symbol(Super, Decl(importUsedInExtendsList1_require.ts, 0, 0)) +>foo : Symbol(foo, Decl(importUsedInExtendsList1_require.ts, 0, 20)) + diff --git a/tests/baselines/reference/importUsedInExtendsList1.types b/tests/baselines/reference/importUsedInExtendsList1.types index 623b14e36aa..74737c4db96 100644 --- a/tests/baselines/reference/importUsedInExtendsList1.types +++ b/tests/baselines/reference/importUsedInExtendsList1.types @@ -5,6 +5,7 @@ import foo = require('importUsedInExtendsList1_require'); class Sub extends foo.Super { } >Sub : Sub +>foo.Super : any >foo : typeof foo >Super : foo.Super diff --git a/tests/baselines/reference/import_reference-exported-alias.symbols b/tests/baselines/reference/import_reference-exported-alias.symbols new file mode 100644 index 00000000000..424bb4bc8b4 --- /dev/null +++ b/tests/baselines/reference/import_reference-exported-alias.symbols @@ -0,0 +1,46 @@ +=== tests/cases/compiler/file2.ts === +import appJs = require("file1"); +>appJs : Symbol(appJs, Decl(file2.ts, 0, 0)) + +import Services = appJs.Services; +>Services : Symbol(Services, Decl(file2.ts, 0, 32)) +>appJs : Symbol(appJs, Decl(file1.ts, 0, 0)) +>Services : Symbol(appJs.Services, Decl(file1.ts, 0, 12)) + +import UserServices = Services.UserServices; +>UserServices : Symbol(UserServices, Decl(file2.ts, 1, 33)) +>Services : Symbol(appJs.Services, Decl(file1.ts, 0, 12)) +>UserServices : Symbol(Services.UserServices, Decl(file1.ts, 1, 28)) + +var x = new UserServices().getUserName(); +>x : Symbol(x, Decl(file2.ts, 3, 3)) +>new UserServices().getUserName : Symbol(Services.UserServices.getUserName, Decl(file1.ts, 2, 35)) +>UserServices : Symbol(UserServices, Decl(file2.ts, 1, 33)) +>getUserName : Symbol(Services.UserServices.getUserName, Decl(file1.ts, 2, 35)) + +=== tests/cases/compiler/file1.ts === +module App { +>App : Symbol(App, Decl(file1.ts, 0, 0)) + + export module Services { +>Services : Symbol(Services, Decl(file1.ts, 0, 12)) + + export class UserServices { +>UserServices : Symbol(UserServices, Decl(file1.ts, 1, 28)) + + public getUserName(): string { +>getUserName : Symbol(getUserName, Decl(file1.ts, 2, 35)) + + return "Bill Gates"; + } + } + } +} + +import Mod = App; +>Mod : Symbol(Mod, Decl(file1.ts, 8, 1)) +>App : Symbol(App, Decl(file1.ts, 0, 0)) + +export = Mod; +>Mod : Symbol(Mod, Decl(file1.ts, 8, 1)) + diff --git a/tests/baselines/reference/import_reference-exported-alias.types b/tests/baselines/reference/import_reference-exported-alias.types index b935fb16cf2..3f9c34f62dc 100644 --- a/tests/baselines/reference/import_reference-exported-alias.types +++ b/tests/baselines/reference/import_reference-exported-alias.types @@ -34,6 +34,7 @@ module App { >getUserName : () => string return "Bill Gates"; +>"Bill Gates" : string } } } diff --git a/tests/baselines/reference/import_reference-to-type-alias.symbols b/tests/baselines/reference/import_reference-to-type-alias.symbols new file mode 100644 index 00000000000..2fef0714a3a --- /dev/null +++ b/tests/baselines/reference/import_reference-to-type-alias.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/file2.ts === +import appJs = require("file1"); +>appJs : Symbol(appJs, Decl(file2.ts, 0, 0)) + +import Services = appJs.App.Services; +>Services : Symbol(Services, Decl(file2.ts, 0, 32)) +>appJs : Symbol(appJs, Decl(file1.ts, 0, 0)) +>App : Symbol(appJs.App, Decl(file1.ts, 0, 0)) +>Services : Symbol(Services, Decl(file1.ts, 0, 19)) + +var x = new Services.UserServices().getUserName(); +>x : Symbol(x, Decl(file2.ts, 2, 3)) +>new Services.UserServices().getUserName : Symbol(Services.UserServices.getUserName, Decl(file1.ts, 2, 35)) +>Services.UserServices : Symbol(Services.UserServices, Decl(file1.ts, 1, 28)) +>Services : Symbol(Services, Decl(file2.ts, 0, 32)) +>UserServices : Symbol(Services.UserServices, Decl(file1.ts, 1, 28)) +>getUserName : Symbol(Services.UserServices.getUserName, Decl(file1.ts, 2, 35)) + +=== tests/cases/compiler/file1.ts === +export module App { +>App : Symbol(App, Decl(file1.ts, 0, 0)) + + export module Services { +>Services : Symbol(Services, Decl(file1.ts, 0, 19)) + + export class UserServices { +>UserServices : Symbol(UserServices, Decl(file1.ts, 1, 28)) + + public getUserName(): string { +>getUserName : Symbol(getUserName, Decl(file1.ts, 2, 35)) + + return "Bill Gates"; + } + } + } +} + diff --git a/tests/baselines/reference/import_reference-to-type-alias.types b/tests/baselines/reference/import_reference-to-type-alias.types index e1da40b5bb4..53c7dabcd5f 100644 --- a/tests/baselines/reference/import_reference-to-type-alias.types +++ b/tests/baselines/reference/import_reference-to-type-alias.types @@ -32,6 +32,7 @@ export module App { >getUserName : () => string return "Bill Gates"; +>"Bill Gates" : string } } } diff --git a/tests/baselines/reference/import_unneeded-require-when-referenecing-aliased-type-throug-array.symbols b/tests/baselines/reference/import_unneeded-require-when-referenecing-aliased-type-throug-array.symbols new file mode 100644 index 00000000000..bfc29cd8032 --- /dev/null +++ b/tests/baselines/reference/import_unneeded-require-when-referenecing-aliased-type-throug-array.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/a.ts === +/// +import ITest = require('ITest'); +>ITest : Symbol(ITest, Decl(a.ts, 0, 0)) + +var testData: ITest[]; +>testData : Symbol(testData, Decl(a.ts, 2, 3)) +>ITest : Symbol(ITest, Decl(a.ts, 0, 0)) + +var p = testData[0].name; +>p : Symbol(p, Decl(a.ts, 3, 3)) +>testData[0].name : Symbol(ITest.name, Decl(b.ts, 1, 20)) +>testData : Symbol(testData, Decl(a.ts, 2, 3)) +>name : Symbol(ITest.name, Decl(b.ts, 1, 20)) + +=== tests/cases/compiler/b.ts === +declare module "ITest" { + interface Name { +>Name : Symbol(Name, Decl(b.ts, 0, 24)) + + name: string; +>name : Symbol(name, Decl(b.ts, 1, 20)) + } + export = Name; +>Name : Symbol(Name, Decl(b.ts, 0, 24)) +} + diff --git a/tests/baselines/reference/import_unneeded-require-when-referenecing-aliased-type-throug-array.types b/tests/baselines/reference/import_unneeded-require-when-referenecing-aliased-type-throug-array.types index 0dfe8ca336b..2fda99dc064 100644 --- a/tests/baselines/reference/import_unneeded-require-when-referenecing-aliased-type-throug-array.types +++ b/tests/baselines/reference/import_unneeded-require-when-referenecing-aliased-type-throug-array.types @@ -1,7 +1,7 @@ === tests/cases/compiler/a.ts === /// import ITest = require('ITest'); ->ITest : unknown +>ITest : any var testData: ITest[]; >testData : ITest[] @@ -12,6 +12,7 @@ var p = testData[0].name; >testData[0].name : string >testData[0] : ITest >testData : ITest[] +>0 : number >name : string === tests/cases/compiler/b.ts === diff --git a/tests/baselines/reference/import_var-referencing-an-imported-module-alias.symbols b/tests/baselines/reference/import_var-referencing-an-imported-module-alias.symbols new file mode 100644 index 00000000000..0cc6d0aa9a1 --- /dev/null +++ b/tests/baselines/reference/import_var-referencing-an-imported-module-alias.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/consumer.ts === + +import host = require("host"); +>host : Symbol(host, Decl(consumer.ts, 0, 0)) + +var hostVar = host; +>hostVar : Symbol(hostVar, Decl(consumer.ts, 2, 3)) +>host : Symbol(host, Decl(consumer.ts, 0, 0)) + +var v = new hostVar.Host(); +>v : Symbol(v, Decl(consumer.ts, 3, 3)) +>hostVar.Host : Symbol(host.Host, Decl(host.ts, 0, 0)) +>hostVar : Symbol(hostVar, Decl(consumer.ts, 2, 3)) +>Host : Symbol(host.Host, Decl(host.ts, 0, 0)) + +=== tests/cases/compiler/host.ts === +export class Host { } +>Host : Symbol(Host, Decl(host.ts, 0, 0)) + diff --git a/tests/baselines/reference/importedAliasesInTypePositions.symbols b/tests/baselines/reference/importedAliasesInTypePositions.symbols new file mode 100644 index 00000000000..50a6b582655 --- /dev/null +++ b/tests/baselines/reference/importedAliasesInTypePositions.symbols @@ -0,0 +1,40 @@ +=== tests/cases/compiler/file2.ts === +import RT_ALIAS = require("file1"); +>RT_ALIAS : Symbol(RT_ALIAS, Decl(file2.ts, 0, 0)) + +import ReferredTo = RT_ALIAS.elaborate.nested.mod.name.ReferredTo; +>ReferredTo : Symbol(ReferredTo, Decl(file2.ts, 0, 35)) +>RT_ALIAS : Symbol(RT_ALIAS, Decl(file1.ts, 0, 0)) +>elaborate : Symbol(RT_ALIAS.elaborate, Decl(file1.ts, 0, 0)) +>nested : Symbol(RT_ALIAS.elaborate.nested, Decl(file1.ts, 0, 24)) +>mod : Symbol(RT_ALIAS.elaborate.nested.mod, Decl(file1.ts, 0, 31)) +>name : Symbol(RT_ALIAS.elaborate.nested.mod.name, Decl(file1.ts, 0, 35)) +>ReferredTo : Symbol(ReferredTo, Decl(file1.ts, 0, 41)) + +export module ImportingModule { +>ImportingModule : Symbol(ImportingModule, Decl(file2.ts, 1, 66)) + + class UsesReferredType { +>UsesReferredType : Symbol(UsesReferredType, Decl(file2.ts, 3, 31)) + + constructor(private referred: ReferredTo) { } +>referred : Symbol(referred, Decl(file2.ts, 5, 20)) +>ReferredTo : Symbol(ReferredTo, Decl(file2.ts, 0, 35)) + } +} +=== tests/cases/compiler/file1.ts === +export module elaborate.nested.mod.name { +>elaborate : Symbol(elaborate, Decl(file1.ts, 0, 0)) +>nested : Symbol(nested, Decl(file1.ts, 0, 24)) +>mod : Symbol(mod, Decl(file1.ts, 0, 31)) +>name : Symbol(name, Decl(file1.ts, 0, 35)) + + export class ReferredTo { +>ReferredTo : Symbol(ReferredTo, Decl(file1.ts, 0, 41)) + + doSomething(): void { +>doSomething : Symbol(doSomething, Decl(file1.ts, 1, 29)) + } + } +} + diff --git a/tests/baselines/reference/importedModuleClassNameClash.symbols b/tests/baselines/reference/importedModuleClassNameClash.symbols new file mode 100644 index 00000000000..f394c48dde4 --- /dev/null +++ b/tests/baselines/reference/importedModuleClassNameClash.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/importedModuleClassNameClash.ts === +import foo = m1; +>foo : Symbol(foo, Decl(importedModuleClassNameClash.ts, 0, 0), Decl(importedModuleClassNameClash.ts, 2, 20)) +>m1 : Symbol(foo, Decl(importedModuleClassNameClash.ts, 0, 16)) + +export module m1 { } +>m1 : Symbol(foo, Decl(importedModuleClassNameClash.ts, 0, 16)) + +class foo { } +>foo : Symbol(foo, Decl(importedModuleClassNameClash.ts, 0, 0), Decl(importedModuleClassNameClash.ts, 2, 20)) + diff --git a/tests/baselines/reference/importedModuleClassNameClash.types b/tests/baselines/reference/importedModuleClassNameClash.types index 28cdee34167..6720403e127 100644 --- a/tests/baselines/reference/importedModuleClassNameClash.types +++ b/tests/baselines/reference/importedModuleClassNameClash.types @@ -1,10 +1,10 @@ === tests/cases/compiler/importedModuleClassNameClash.ts === import foo = m1; >foo : typeof foo ->m1 : unknown +>m1 : any export module m1 { } ->m1 : unknown +>m1 : any class foo { } >foo : foo diff --git a/tests/baselines/reference/inOperatorWithFunction.symbols b/tests/baselines/reference/inOperatorWithFunction.symbols new file mode 100644 index 00000000000..1e915ba107d --- /dev/null +++ b/tests/baselines/reference/inOperatorWithFunction.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/inOperatorWithFunction.ts === +var fn = function (val: boolean) { return val; } +>fn : Symbol(fn, Decl(inOperatorWithFunction.ts, 0, 3)) +>val : Symbol(val, Decl(inOperatorWithFunction.ts, 0, 19)) +>val : Symbol(val, Decl(inOperatorWithFunction.ts, 0, 19)) + +fn("a" in { "a": true }); +>fn : Symbol(fn, Decl(inOperatorWithFunction.ts, 0, 3)) + diff --git a/tests/baselines/reference/inOperatorWithFunction.types b/tests/baselines/reference/inOperatorWithFunction.types index 9de7663011d..e85a86632c7 100644 --- a/tests/baselines/reference/inOperatorWithFunction.types +++ b/tests/baselines/reference/inOperatorWithFunction.types @@ -9,5 +9,7 @@ fn("a" in { "a": true }); >fn("a" in { "a": true }) : boolean >fn : (val: boolean) => boolean >"a" in { "a": true } : boolean +>"a" : string >{ "a": true } : { "a": boolean; } +>true : boolean diff --git a/tests/baselines/reference/inOperatorWithGeneric.symbols b/tests/baselines/reference/inOperatorWithGeneric.symbols new file mode 100644 index 00000000000..7a84d7dce6b --- /dev/null +++ b/tests/baselines/reference/inOperatorWithGeneric.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/inOperatorWithGeneric.ts === +class C { +>C : Symbol(C, Decl(inOperatorWithGeneric.ts, 0, 0)) +>T : Symbol(T, Decl(inOperatorWithGeneric.ts, 0, 8)) + + foo(x:T) { +>foo : Symbol(foo, Decl(inOperatorWithGeneric.ts, 0, 12)) +>x : Symbol(x, Decl(inOperatorWithGeneric.ts, 1, 8)) +>T : Symbol(T, Decl(inOperatorWithGeneric.ts, 0, 8)) + + for (var p in x) { +>p : Symbol(p, Decl(inOperatorWithGeneric.ts, 2, 16)) +>x : Symbol(x, Decl(inOperatorWithGeneric.ts, 1, 8)) + } + } +} diff --git a/tests/baselines/reference/inOperatorWithValidOperands.symbols b/tests/baselines/reference/inOperatorWithValidOperands.symbols new file mode 100644 index 00000000000..07e0bd4f6de --- /dev/null +++ b/tests/baselines/reference/inOperatorWithValidOperands.symbols @@ -0,0 +1,93 @@ +=== tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithValidOperands.ts === +var x: any; +>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3)) + +// valid left operands +// the left operand is required to be of type Any, the String primitive type, or the Number primitive type +var a1: string; +>a1 : Symbol(a1, Decl(inOperatorWithValidOperands.ts, 4, 3)) + +var a2: number; +>a2 : Symbol(a2, Decl(inOperatorWithValidOperands.ts, 5, 3)) + +var ra1 = x in x; +>ra1 : Symbol(ra1, Decl(inOperatorWithValidOperands.ts, 7, 3)) +>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3)) +>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3)) + +var ra2 = a1 in x; +>ra2 : Symbol(ra2, Decl(inOperatorWithValidOperands.ts, 8, 3)) +>a1 : Symbol(a1, Decl(inOperatorWithValidOperands.ts, 4, 3)) +>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3)) + +var ra3 = a2 in x; +>ra3 : Symbol(ra3, Decl(inOperatorWithValidOperands.ts, 9, 3)) +>a2 : Symbol(a2, Decl(inOperatorWithValidOperands.ts, 5, 3)) +>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3)) + +var ra4 = '' in x; +>ra4 : Symbol(ra4, Decl(inOperatorWithValidOperands.ts, 10, 3)) +>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3)) + +var ra5 = 0 in x; +>ra5 : Symbol(ra5, Decl(inOperatorWithValidOperands.ts, 11, 3)) +>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3)) + +// valid right operands +// the right operand is required to be of type Any, an object type, or a type parameter type +var b1: {}; +>b1 : Symbol(b1, Decl(inOperatorWithValidOperands.ts, 15, 3)) + +var rb1 = x in b1; +>rb1 : Symbol(rb1, Decl(inOperatorWithValidOperands.ts, 17, 3)) +>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3)) +>b1 : Symbol(b1, Decl(inOperatorWithValidOperands.ts, 15, 3)) + +var rb2 = x in {}; +>rb2 : Symbol(rb2, Decl(inOperatorWithValidOperands.ts, 18, 3)) +>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3)) + +function foo(t: T) { +>foo : Symbol(foo, Decl(inOperatorWithValidOperands.ts, 18, 18)) +>T : Symbol(T, Decl(inOperatorWithValidOperands.ts, 20, 13)) +>t : Symbol(t, Decl(inOperatorWithValidOperands.ts, 20, 16)) +>T : Symbol(T, Decl(inOperatorWithValidOperands.ts, 20, 13)) + + var rb3 = x in t; +>rb3 : Symbol(rb3, Decl(inOperatorWithValidOperands.ts, 21, 7)) +>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3)) +>t : Symbol(t, Decl(inOperatorWithValidOperands.ts, 20, 16)) +} + +interface X { x: number } +>X : Symbol(X, Decl(inOperatorWithValidOperands.ts, 22, 1)) +>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 24, 13)) + +interface Y { y: number } +>Y : Symbol(Y, Decl(inOperatorWithValidOperands.ts, 24, 25)) +>y : Symbol(y, Decl(inOperatorWithValidOperands.ts, 25, 13)) + +var c1: X | Y; +>c1 : Symbol(c1, Decl(inOperatorWithValidOperands.ts, 27, 3)) +>X : Symbol(X, Decl(inOperatorWithValidOperands.ts, 22, 1)) +>Y : Symbol(Y, Decl(inOperatorWithValidOperands.ts, 24, 25)) + +var c2: X; +>c2 : Symbol(c2, Decl(inOperatorWithValidOperands.ts, 28, 3)) +>X : Symbol(X, Decl(inOperatorWithValidOperands.ts, 22, 1)) + +var c3: Y; +>c3 : Symbol(c3, Decl(inOperatorWithValidOperands.ts, 29, 3)) +>Y : Symbol(Y, Decl(inOperatorWithValidOperands.ts, 24, 25)) + +var rc1 = x in c1; +>rc1 : Symbol(rc1, Decl(inOperatorWithValidOperands.ts, 31, 3)) +>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3)) +>c1 : Symbol(c1, Decl(inOperatorWithValidOperands.ts, 27, 3)) + +var rc2 = x in (c2 || c3); +>rc2 : Symbol(rc2, Decl(inOperatorWithValidOperands.ts, 32, 3)) +>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3)) +>c2 : Symbol(c2, Decl(inOperatorWithValidOperands.ts, 28, 3)) +>c3 : Symbol(c3, Decl(inOperatorWithValidOperands.ts, 29, 3)) + diff --git a/tests/baselines/reference/inOperatorWithValidOperands.types b/tests/baselines/reference/inOperatorWithValidOperands.types index 27ba22055bf..0cca583e683 100644 --- a/tests/baselines/reference/inOperatorWithValidOperands.types +++ b/tests/baselines/reference/inOperatorWithValidOperands.types @@ -31,11 +31,13 @@ var ra3 = a2 in x; var ra4 = '' in x; >ra4 : boolean >'' in x : boolean +>'' : string >x : any var ra5 = 0 in x; >ra5 : boolean >0 in x : boolean +>0 : number >x : any // valid right operands diff --git a/tests/baselines/reference/incrementOperatorWithAnyOtherType.symbols b/tests/baselines/reference/incrementOperatorWithAnyOtherType.symbols new file mode 100644 index 00000000000..d0af700ea8e --- /dev/null +++ b/tests/baselines/reference/incrementOperatorWithAnyOtherType.symbols @@ -0,0 +1,154 @@ +=== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherType.ts === +// ++ operator on any type + +var ANY: any; +>ANY : Symbol(ANY, Decl(incrementOperatorWithAnyOtherType.ts, 2, 3)) + +var ANY1; +>ANY1 : Symbol(ANY1, Decl(incrementOperatorWithAnyOtherType.ts, 3, 3)) + +var ANY2: any[] = ["", ""]; +>ANY2 : Symbol(ANY2, Decl(incrementOperatorWithAnyOtherType.ts, 4, 3)) + +var obj = {x:1,y:null}; +>obj : Symbol(obj, Decl(incrementOperatorWithAnyOtherType.ts, 5, 3)) +>x : Symbol(x, Decl(incrementOperatorWithAnyOtherType.ts, 5, 11)) +>y : Symbol(y, Decl(incrementOperatorWithAnyOtherType.ts, 5, 15)) + +class A { +>A : Symbol(A, Decl(incrementOperatorWithAnyOtherType.ts, 5, 23)) + + public a: any; +>a : Symbol(a, Decl(incrementOperatorWithAnyOtherType.ts, 6, 9)) +} +module M { +>M : Symbol(M, Decl(incrementOperatorWithAnyOtherType.ts, 8, 1)) + + export var n: any; +>n : Symbol(n, Decl(incrementOperatorWithAnyOtherType.ts, 10, 14)) +} +var objA = new A(); +>objA : Symbol(objA, Decl(incrementOperatorWithAnyOtherType.ts, 12, 3)) +>A : Symbol(A, Decl(incrementOperatorWithAnyOtherType.ts, 5, 23)) + +// any type var +var ResultIsNumber1 = ++ANY; +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(incrementOperatorWithAnyOtherType.ts, 15, 3)) +>ANY : Symbol(ANY, Decl(incrementOperatorWithAnyOtherType.ts, 2, 3)) + +var ResultIsNumber2 = ++ANY1; +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(incrementOperatorWithAnyOtherType.ts, 16, 3)) +>ANY1 : Symbol(ANY1, Decl(incrementOperatorWithAnyOtherType.ts, 3, 3)) + +var ResultIsNumber3 = ANY1++; +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(incrementOperatorWithAnyOtherType.ts, 18, 3)) +>ANY1 : Symbol(ANY1, Decl(incrementOperatorWithAnyOtherType.ts, 3, 3)) + +var ResultIsNumber4 = ANY1++; +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(incrementOperatorWithAnyOtherType.ts, 19, 3)) +>ANY1 : Symbol(ANY1, Decl(incrementOperatorWithAnyOtherType.ts, 3, 3)) + +// expressions +var ResultIsNumber5 = ++ANY2[0]; +>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(incrementOperatorWithAnyOtherType.ts, 22, 3)) +>ANY2 : Symbol(ANY2, Decl(incrementOperatorWithAnyOtherType.ts, 4, 3)) + +var ResultIsNumber6 = ++obj.x; +>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(incrementOperatorWithAnyOtherType.ts, 23, 3)) +>obj.x : Symbol(x, Decl(incrementOperatorWithAnyOtherType.ts, 5, 11)) +>obj : Symbol(obj, Decl(incrementOperatorWithAnyOtherType.ts, 5, 3)) +>x : Symbol(x, Decl(incrementOperatorWithAnyOtherType.ts, 5, 11)) + +var ResultIsNumber7 = ++obj.y; +>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(incrementOperatorWithAnyOtherType.ts, 24, 3)) +>obj.y : Symbol(y, Decl(incrementOperatorWithAnyOtherType.ts, 5, 15)) +>obj : Symbol(obj, Decl(incrementOperatorWithAnyOtherType.ts, 5, 3)) +>y : Symbol(y, Decl(incrementOperatorWithAnyOtherType.ts, 5, 15)) + +var ResultIsNumber8 = ++objA.a; +>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(incrementOperatorWithAnyOtherType.ts, 25, 3)) +>objA.a : Symbol(A.a, Decl(incrementOperatorWithAnyOtherType.ts, 6, 9)) +>objA : Symbol(objA, Decl(incrementOperatorWithAnyOtherType.ts, 12, 3)) +>a : Symbol(A.a, Decl(incrementOperatorWithAnyOtherType.ts, 6, 9)) + +var ResultIsNumber = ++M.n; +>ResultIsNumber : Symbol(ResultIsNumber, Decl(incrementOperatorWithAnyOtherType.ts, 26, 3)) +>M.n : Symbol(M.n, Decl(incrementOperatorWithAnyOtherType.ts, 10, 14)) +>M : Symbol(M, Decl(incrementOperatorWithAnyOtherType.ts, 8, 1)) +>n : Symbol(M.n, Decl(incrementOperatorWithAnyOtherType.ts, 10, 14)) + +var ResultIsNumber9 = ANY2[0]++; +>ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(incrementOperatorWithAnyOtherType.ts, 28, 3)) +>ANY2 : Symbol(ANY2, Decl(incrementOperatorWithAnyOtherType.ts, 4, 3)) + +var ResultIsNumber10 = obj.x++; +>ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(incrementOperatorWithAnyOtherType.ts, 29, 3)) +>obj.x : Symbol(x, Decl(incrementOperatorWithAnyOtherType.ts, 5, 11)) +>obj : Symbol(obj, Decl(incrementOperatorWithAnyOtherType.ts, 5, 3)) +>x : Symbol(x, Decl(incrementOperatorWithAnyOtherType.ts, 5, 11)) + +var ResultIsNumber11 = obj.y++; +>ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(incrementOperatorWithAnyOtherType.ts, 30, 3)) +>obj.y : Symbol(y, Decl(incrementOperatorWithAnyOtherType.ts, 5, 15)) +>obj : Symbol(obj, Decl(incrementOperatorWithAnyOtherType.ts, 5, 3)) +>y : Symbol(y, Decl(incrementOperatorWithAnyOtherType.ts, 5, 15)) + +var ResultIsNumber12 = objA.a++; +>ResultIsNumber12 : Symbol(ResultIsNumber12, Decl(incrementOperatorWithAnyOtherType.ts, 31, 3)) +>objA.a : Symbol(A.a, Decl(incrementOperatorWithAnyOtherType.ts, 6, 9)) +>objA : Symbol(objA, Decl(incrementOperatorWithAnyOtherType.ts, 12, 3)) +>a : Symbol(A.a, Decl(incrementOperatorWithAnyOtherType.ts, 6, 9)) + +var ResultIsNumber13 = M.n++; +>ResultIsNumber13 : Symbol(ResultIsNumber13, Decl(incrementOperatorWithAnyOtherType.ts, 32, 3)) +>M.n : Symbol(M.n, Decl(incrementOperatorWithAnyOtherType.ts, 10, 14)) +>M : Symbol(M, Decl(incrementOperatorWithAnyOtherType.ts, 8, 1)) +>n : Symbol(M.n, Decl(incrementOperatorWithAnyOtherType.ts, 10, 14)) + +// miss assignment opertors +++ANY; +>ANY : Symbol(ANY, Decl(incrementOperatorWithAnyOtherType.ts, 2, 3)) + +++ANY1; +>ANY1 : Symbol(ANY1, Decl(incrementOperatorWithAnyOtherType.ts, 3, 3)) + +++ANY2[0]; +>ANY2 : Symbol(ANY2, Decl(incrementOperatorWithAnyOtherType.ts, 4, 3)) + +++ANY, ++ANY1; +>ANY : Symbol(ANY, Decl(incrementOperatorWithAnyOtherType.ts, 2, 3)) +>ANY1 : Symbol(ANY1, Decl(incrementOperatorWithAnyOtherType.ts, 3, 3)) + +++objA.a; +>objA.a : Symbol(A.a, Decl(incrementOperatorWithAnyOtherType.ts, 6, 9)) +>objA : Symbol(objA, Decl(incrementOperatorWithAnyOtherType.ts, 12, 3)) +>a : Symbol(A.a, Decl(incrementOperatorWithAnyOtherType.ts, 6, 9)) + +++M.n; +>M.n : Symbol(M.n, Decl(incrementOperatorWithAnyOtherType.ts, 10, 14)) +>M : Symbol(M, Decl(incrementOperatorWithAnyOtherType.ts, 8, 1)) +>n : Symbol(M.n, Decl(incrementOperatorWithAnyOtherType.ts, 10, 14)) + +ANY++; +>ANY : Symbol(ANY, Decl(incrementOperatorWithAnyOtherType.ts, 2, 3)) + +ANY1++; +>ANY1 : Symbol(ANY1, Decl(incrementOperatorWithAnyOtherType.ts, 3, 3)) + +ANY2[0]++; +>ANY2 : Symbol(ANY2, Decl(incrementOperatorWithAnyOtherType.ts, 4, 3)) + +ANY++, ANY1++; +>ANY : Symbol(ANY, Decl(incrementOperatorWithAnyOtherType.ts, 2, 3)) +>ANY1 : Symbol(ANY1, Decl(incrementOperatorWithAnyOtherType.ts, 3, 3)) + +objA.a++; +>objA.a : Symbol(A.a, Decl(incrementOperatorWithAnyOtherType.ts, 6, 9)) +>objA : Symbol(objA, Decl(incrementOperatorWithAnyOtherType.ts, 12, 3)) +>a : Symbol(A.a, Decl(incrementOperatorWithAnyOtherType.ts, 6, 9)) + +M.n++; +>M.n : Symbol(M.n, Decl(incrementOperatorWithAnyOtherType.ts, 10, 14)) +>M : Symbol(M, Decl(incrementOperatorWithAnyOtherType.ts, 8, 1)) +>n : Symbol(M.n, Decl(incrementOperatorWithAnyOtherType.ts, 10, 14)) + diff --git a/tests/baselines/reference/incrementOperatorWithAnyOtherType.types b/tests/baselines/reference/incrementOperatorWithAnyOtherType.types index 930c87274d0..3643b646ace 100644 --- a/tests/baselines/reference/incrementOperatorWithAnyOtherType.types +++ b/tests/baselines/reference/incrementOperatorWithAnyOtherType.types @@ -10,12 +10,16 @@ var ANY1; var ANY2: any[] = ["", ""]; >ANY2 : any[] >["", ""] : string[] +>"" : string +>"" : string var obj = {x:1,y:null}; >obj : { x: number; y: any; } >{x:1,y:null} : { x: number; y: null; } >x : number +>1 : number >y : null +>null : null class A { >A : A @@ -61,6 +65,7 @@ var ResultIsNumber5 = ++ANY2[0]; >++ANY2[0] : number >ANY2[0] : any >ANY2 : any[] +>0 : number var ResultIsNumber6 = ++obj.x; >ResultIsNumber6 : number @@ -95,6 +100,7 @@ var ResultIsNumber9 = ANY2[0]++; >ANY2[0]++ : number >ANY2[0] : any >ANY2 : any[] +>0 : number var ResultIsNumber10 = obj.x++; >ResultIsNumber10 : number @@ -137,6 +143,7 @@ var ResultIsNumber13 = M.n++; >++ANY2[0] : number >ANY2[0] : any >ANY2 : any[] +>0 : number ++ANY, ++ANY1; >++ANY, ++ANY1 : number @@ -169,6 +176,7 @@ ANY2[0]++; >ANY2[0]++ : number >ANY2[0] : any >ANY2 : any[] +>0 : number ANY++, ANY1++; >ANY++, ANY1++ : number diff --git a/tests/baselines/reference/incrementOperatorWithNumberType.symbols b/tests/baselines/reference/incrementOperatorWithNumberType.symbols new file mode 100644 index 00000000000..3523e15135c --- /dev/null +++ b/tests/baselines/reference/incrementOperatorWithNumberType.symbols @@ -0,0 +1,112 @@ +=== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithNumberType.ts === +// ++ operator on number type +var NUMBER: number; +>NUMBER : Symbol(NUMBER, Decl(incrementOperatorWithNumberType.ts, 1, 3)) + +var NUMBER1: number[] = [1, 2]; +>NUMBER1 : Symbol(NUMBER1, Decl(incrementOperatorWithNumberType.ts, 2, 3)) + +class A { +>A : Symbol(A, Decl(incrementOperatorWithNumberType.ts, 2, 31)) + + public a: number; +>a : Symbol(a, Decl(incrementOperatorWithNumberType.ts, 4, 9)) +} +module M { +>M : Symbol(M, Decl(incrementOperatorWithNumberType.ts, 6, 1)) + + export var n: number; +>n : Symbol(n, Decl(incrementOperatorWithNumberType.ts, 8, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(incrementOperatorWithNumberType.ts, 11, 3)) +>A : Symbol(A, Decl(incrementOperatorWithNumberType.ts, 2, 31)) + +// number type var +var ResultIsNumber1 = ++NUMBER; +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(incrementOperatorWithNumberType.ts, 14, 3)) +>NUMBER : Symbol(NUMBER, Decl(incrementOperatorWithNumberType.ts, 1, 3)) + +var ResultIsNumber2 = NUMBER++; +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(incrementOperatorWithNumberType.ts, 16, 3)) +>NUMBER : Symbol(NUMBER, Decl(incrementOperatorWithNumberType.ts, 1, 3)) + +// expressions +var ResultIsNumber3 = ++objA.a; +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(incrementOperatorWithNumberType.ts, 19, 3)) +>objA.a : Symbol(A.a, Decl(incrementOperatorWithNumberType.ts, 4, 9)) +>objA : Symbol(objA, Decl(incrementOperatorWithNumberType.ts, 11, 3)) +>a : Symbol(A.a, Decl(incrementOperatorWithNumberType.ts, 4, 9)) + +var ResultIsNumber4 = ++M.n; +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(incrementOperatorWithNumberType.ts, 20, 3)) +>M.n : Symbol(M.n, Decl(incrementOperatorWithNumberType.ts, 8, 14)) +>M : Symbol(M, Decl(incrementOperatorWithNumberType.ts, 6, 1)) +>n : Symbol(M.n, Decl(incrementOperatorWithNumberType.ts, 8, 14)) + +var ResultIsNumber5 = objA.a++; +>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(incrementOperatorWithNumberType.ts, 22, 3)) +>objA.a : Symbol(A.a, Decl(incrementOperatorWithNumberType.ts, 4, 9)) +>objA : Symbol(objA, Decl(incrementOperatorWithNumberType.ts, 11, 3)) +>a : Symbol(A.a, Decl(incrementOperatorWithNumberType.ts, 4, 9)) + +var ResultIsNumber6 = M.n++; +>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(incrementOperatorWithNumberType.ts, 23, 3)) +>M.n : Symbol(M.n, Decl(incrementOperatorWithNumberType.ts, 8, 14)) +>M : Symbol(M, Decl(incrementOperatorWithNumberType.ts, 6, 1)) +>n : Symbol(M.n, Decl(incrementOperatorWithNumberType.ts, 8, 14)) + +var ResultIsNumber7 = NUMBER1[0]++; +>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(incrementOperatorWithNumberType.ts, 24, 3)) +>NUMBER1 : Symbol(NUMBER1, Decl(incrementOperatorWithNumberType.ts, 2, 3)) + +// miss assignment operators +++NUMBER; +>NUMBER : Symbol(NUMBER, Decl(incrementOperatorWithNumberType.ts, 1, 3)) + +++NUMBER1[0]; +>NUMBER1 : Symbol(NUMBER1, Decl(incrementOperatorWithNumberType.ts, 2, 3)) + +++objA.a; +>objA.a : Symbol(A.a, Decl(incrementOperatorWithNumberType.ts, 4, 9)) +>objA : Symbol(objA, Decl(incrementOperatorWithNumberType.ts, 11, 3)) +>a : Symbol(A.a, Decl(incrementOperatorWithNumberType.ts, 4, 9)) + +++M.n; +>M.n : Symbol(M.n, Decl(incrementOperatorWithNumberType.ts, 8, 14)) +>M : Symbol(M, Decl(incrementOperatorWithNumberType.ts, 6, 1)) +>n : Symbol(M.n, Decl(incrementOperatorWithNumberType.ts, 8, 14)) + +++objA.a, M.n; +>objA.a : Symbol(A.a, Decl(incrementOperatorWithNumberType.ts, 4, 9)) +>objA : Symbol(objA, Decl(incrementOperatorWithNumberType.ts, 11, 3)) +>a : Symbol(A.a, Decl(incrementOperatorWithNumberType.ts, 4, 9)) +>M.n : Symbol(M.n, Decl(incrementOperatorWithNumberType.ts, 8, 14)) +>M : Symbol(M, Decl(incrementOperatorWithNumberType.ts, 6, 1)) +>n : Symbol(M.n, Decl(incrementOperatorWithNumberType.ts, 8, 14)) + +NUMBER++; +>NUMBER : Symbol(NUMBER, Decl(incrementOperatorWithNumberType.ts, 1, 3)) + +NUMBER1[0]++; +>NUMBER1 : Symbol(NUMBER1, Decl(incrementOperatorWithNumberType.ts, 2, 3)) + +objA.a++; +>objA.a : Symbol(A.a, Decl(incrementOperatorWithNumberType.ts, 4, 9)) +>objA : Symbol(objA, Decl(incrementOperatorWithNumberType.ts, 11, 3)) +>a : Symbol(A.a, Decl(incrementOperatorWithNumberType.ts, 4, 9)) + +M.n++; +>M.n : Symbol(M.n, Decl(incrementOperatorWithNumberType.ts, 8, 14)) +>M : Symbol(M, Decl(incrementOperatorWithNumberType.ts, 6, 1)) +>n : Symbol(M.n, Decl(incrementOperatorWithNumberType.ts, 8, 14)) + +objA.a++, M.n++; +>objA.a : Symbol(A.a, Decl(incrementOperatorWithNumberType.ts, 4, 9)) +>objA : Symbol(objA, Decl(incrementOperatorWithNumberType.ts, 11, 3)) +>a : Symbol(A.a, Decl(incrementOperatorWithNumberType.ts, 4, 9)) +>M.n : Symbol(M.n, Decl(incrementOperatorWithNumberType.ts, 8, 14)) +>M : Symbol(M, Decl(incrementOperatorWithNumberType.ts, 6, 1)) +>n : Symbol(M.n, Decl(incrementOperatorWithNumberType.ts, 8, 14)) + diff --git a/tests/baselines/reference/incrementOperatorWithNumberType.types b/tests/baselines/reference/incrementOperatorWithNumberType.types index ad6ea172ae3..21211a3848c 100644 --- a/tests/baselines/reference/incrementOperatorWithNumberType.types +++ b/tests/baselines/reference/incrementOperatorWithNumberType.types @@ -6,6 +6,8 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] +>1 : number +>2 : number class A { >A : A @@ -70,6 +72,7 @@ var ResultIsNumber7 = NUMBER1[0]++; >NUMBER1[0]++ : number >NUMBER1[0] : number >NUMBER1 : number[] +>0 : number // miss assignment operators ++NUMBER; @@ -80,6 +83,7 @@ var ResultIsNumber7 = NUMBER1[0]++; >++NUMBER1[0] : number >NUMBER1[0] : number >NUMBER1 : number[] +>0 : number ++objA.a; >++objA.a : number @@ -111,6 +115,7 @@ NUMBER1[0]++; >NUMBER1[0]++ : number >NUMBER1[0] : number >NUMBER1 : number[] +>0 : number objA.a++; >objA.a++ : number diff --git a/tests/baselines/reference/indexClassByNumber.symbols b/tests/baselines/reference/indexClassByNumber.symbols new file mode 100644 index 00000000000..068ec9484e3 --- /dev/null +++ b/tests/baselines/reference/indexClassByNumber.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/indexClassByNumber.ts === +// Shouldn't be able to index a class instance by a number (unless it has declared a number index signature) + +class foo { } +>foo : Symbol(foo, Decl(indexClassByNumber.ts, 0, 0)) + +var f = new foo(); +>f : Symbol(f, Decl(indexClassByNumber.ts, 4, 3)) +>foo : Symbol(foo, Decl(indexClassByNumber.ts, 0, 0)) + +f[0] = 4; // Shouldn't be allowed +>f : Symbol(f, Decl(indexClassByNumber.ts, 4, 3)) + diff --git a/tests/baselines/reference/indexClassByNumber.types b/tests/baselines/reference/indexClassByNumber.types index c58771d3256..b1fb79f256a 100644 --- a/tests/baselines/reference/indexClassByNumber.types +++ b/tests/baselines/reference/indexClassByNumber.types @@ -13,4 +13,6 @@ f[0] = 4; // Shouldn't be allowed >f[0] = 4 : number >f[0] : any >f : foo +>0 : number +>4 : number diff --git a/tests/baselines/reference/indexIntoEnum.symbols b/tests/baselines/reference/indexIntoEnum.symbols new file mode 100644 index 00000000000..9b6a4a7427a --- /dev/null +++ b/tests/baselines/reference/indexIntoEnum.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/indexIntoEnum.ts === +module M { +>M : Symbol(M, Decl(indexIntoEnum.ts, 0, 0)) + + enum E { } +>E : Symbol(E, Decl(indexIntoEnum.ts, 0, 10)) + + var x = E[0]; +>x : Symbol(x, Decl(indexIntoEnum.ts, 4, 7)) +>E : Symbol(E, Decl(indexIntoEnum.ts, 0, 10)) +} diff --git a/tests/baselines/reference/indexIntoEnum.types b/tests/baselines/reference/indexIntoEnum.types index 39849566409..3c0d91cd240 100644 --- a/tests/baselines/reference/indexIntoEnum.types +++ b/tests/baselines/reference/indexIntoEnum.types @@ -9,4 +9,5 @@ module M { >x : string >E[0] : string >E : typeof E +>0 : number } diff --git a/tests/baselines/reference/indexSignatureWithoutTypeAnnotation1..symbols b/tests/baselines/reference/indexSignatureWithoutTypeAnnotation1..symbols new file mode 100644 index 00000000000..7ab1bd72cd7 --- /dev/null +++ b/tests/baselines/reference/indexSignatureWithoutTypeAnnotation1..symbols @@ -0,0 +1,3 @@ +=== tests/cases/compiler/indexSignatureWithoutTypeAnnotation1..ts === + +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/indexSignaturesInferentialTyping.symbols b/tests/baselines/reference/indexSignaturesInferentialTyping.symbols new file mode 100644 index 00000000000..a34aa7a5cd1 --- /dev/null +++ b/tests/baselines/reference/indexSignaturesInferentialTyping.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/indexSignaturesInferentialTyping.ts === +function foo(items: { [index: number]: T }): T { return undefined; } +>foo : Symbol(foo, Decl(indexSignaturesInferentialTyping.ts, 0, 0)) +>T : Symbol(T, Decl(indexSignaturesInferentialTyping.ts, 0, 13)) +>items : Symbol(items, Decl(indexSignaturesInferentialTyping.ts, 0, 16)) +>index : Symbol(index, Decl(indexSignaturesInferentialTyping.ts, 0, 26)) +>T : Symbol(T, Decl(indexSignaturesInferentialTyping.ts, 0, 13)) +>T : Symbol(T, Decl(indexSignaturesInferentialTyping.ts, 0, 13)) +>undefined : Symbol(undefined) + +function bar(items: { [index: string]: T }): T { return undefined; } +>bar : Symbol(bar, Decl(indexSignaturesInferentialTyping.ts, 0, 71)) +>T : Symbol(T, Decl(indexSignaturesInferentialTyping.ts, 1, 13)) +>items : Symbol(items, Decl(indexSignaturesInferentialTyping.ts, 1, 16)) +>index : Symbol(index, Decl(indexSignaturesInferentialTyping.ts, 1, 26)) +>T : Symbol(T, Decl(indexSignaturesInferentialTyping.ts, 1, 13)) +>T : Symbol(T, Decl(indexSignaturesInferentialTyping.ts, 1, 13)) +>undefined : Symbol(undefined) + +var x1 = foo({ 0: 0, 1: 1 }); // type should be number +>x1 : Symbol(x1, Decl(indexSignaturesInferentialTyping.ts, 3, 3)) +>foo : Symbol(foo, Decl(indexSignaturesInferentialTyping.ts, 0, 0)) + +var x2 = foo({ zero: 0, one: 1 }); +>x2 : Symbol(x2, Decl(indexSignaturesInferentialTyping.ts, 4, 3)) +>foo : Symbol(foo, Decl(indexSignaturesInferentialTyping.ts, 0, 0)) +>zero : Symbol(zero, Decl(indexSignaturesInferentialTyping.ts, 4, 14)) +>one : Symbol(one, Decl(indexSignaturesInferentialTyping.ts, 4, 23)) + +var x3 = bar({ 0: 0, 1: 1 }); +>x3 : Symbol(x3, Decl(indexSignaturesInferentialTyping.ts, 5, 3)) +>bar : Symbol(bar, Decl(indexSignaturesInferentialTyping.ts, 0, 71)) + +var x4 = bar({ zero: 0, one: 1 }); // type should be number +>x4 : Symbol(x4, Decl(indexSignaturesInferentialTyping.ts, 6, 3)) +>bar : Symbol(bar, Decl(indexSignaturesInferentialTyping.ts, 0, 71)) +>zero : Symbol(zero, Decl(indexSignaturesInferentialTyping.ts, 6, 14)) +>one : Symbol(one, Decl(indexSignaturesInferentialTyping.ts, 6, 23)) + diff --git a/tests/baselines/reference/indexSignaturesInferentialTyping.types b/tests/baselines/reference/indexSignaturesInferentialTyping.types index 9ea5a390498..328dbc18e4f 100644 --- a/tests/baselines/reference/indexSignaturesInferentialTyping.types +++ b/tests/baselines/reference/indexSignaturesInferentialTyping.types @@ -22,6 +22,8 @@ var x1 = foo({ 0: 0, 1: 1 }); // type should be number >foo({ 0: 0, 1: 1 }) : number >foo : (items: { [index: number]: T; }) => T >{ 0: 0, 1: 1 } : { [x: number]: number; 0: number; 1: number; } +>0 : number +>1 : number var x2 = foo({ zero: 0, one: 1 }); >x2 : any @@ -29,13 +31,17 @@ var x2 = foo({ zero: 0, one: 1 }); >foo : (items: { [index: number]: T; }) => T >{ zero: 0, one: 1 } : { [x: number]: undefined; zero: number; one: number; } >zero : number +>0 : number >one : number +>1 : number var x3 = bar({ 0: 0, 1: 1 }); >x3 : number >bar({ 0: 0, 1: 1 }) : number >bar : (items: { [index: string]: T; }) => T >{ 0: 0, 1: 1 } : { [x: string]: number; 0: number; 1: number; } +>0 : number +>1 : number var x4 = bar({ zero: 0, one: 1 }); // type should be number >x4 : number @@ -43,5 +49,7 @@ var x4 = bar({ zero: 0, one: 1 }); // type should be number >bar : (items: { [index: string]: T; }) => T >{ zero: 0, one: 1 } : { [x: string]: number; zero: number; one: number; } >zero : number +>0 : number >one : number +>1 : number diff --git a/tests/baselines/reference/indexer.symbols b/tests/baselines/reference/indexer.symbols new file mode 100644 index 00000000000..409bd8092d6 --- /dev/null +++ b/tests/baselines/reference/indexer.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/indexer.ts === +interface JQueryElement { +>JQueryElement : Symbol(JQueryElement, Decl(indexer.ts, 0, 0)) + + id:string; +>id : Symbol(id, Decl(indexer.ts, 0, 25)) +} + +interface JQuery { +>JQuery : Symbol(JQuery, Decl(indexer.ts, 2, 1)) + + [n:number]:JQueryElement; +>n : Symbol(n, Decl(indexer.ts, 5, 5)) +>JQueryElement : Symbol(JQueryElement, Decl(indexer.ts, 0, 0)) +} + +var jq:JQuery={ 0: { id : "a" }, 1: { id : "b" } }; +>jq : Symbol(jq, Decl(indexer.ts, 8, 3)) +>JQuery : Symbol(JQuery, Decl(indexer.ts, 2, 1)) +>id : Symbol(id, Decl(indexer.ts, 8, 20)) +>id : Symbol(id, Decl(indexer.ts, 8, 37)) + +jq[0].id; +>jq[0].id : Symbol(JQueryElement.id, Decl(indexer.ts, 0, 25)) +>jq : Symbol(jq, Decl(indexer.ts, 8, 3)) +>id : Symbol(JQueryElement.id, Decl(indexer.ts, 0, 25)) + diff --git a/tests/baselines/reference/indexer.types b/tests/baselines/reference/indexer.types index 9987fdde0b1..a0142bb9383 100644 --- a/tests/baselines/reference/indexer.types +++ b/tests/baselines/reference/indexer.types @@ -20,12 +20,15 @@ var jq:JQuery={ 0: { id : "a" }, 1: { id : "b" } }; >{ 0: { id : "a" }, 1: { id : "b" } } : { [x: number]: { id: string; }; 0: { id: string; }; 1: { id: string; }; } >{ id : "a" } : { id: string; } >id : string +>"a" : string >{ id : "b" } : { id: string; } >id : string +>"b" : string jq[0].id; >jq[0].id : string >jq[0] : JQueryElement >jq : JQuery +>0 : number >id : string diff --git a/tests/baselines/reference/indexer2.symbols b/tests/baselines/reference/indexer2.symbols new file mode 100644 index 00000000000..c23debb925c --- /dev/null +++ b/tests/baselines/reference/indexer2.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/indexer2.ts === +interface IHeapObjectProperty {} +>IHeapObjectProperty : Symbol(IHeapObjectProperty, Decl(indexer2.ts, 0, 0)) + +interface IDirectChildrenMap { +>IDirectChildrenMap : Symbol(IDirectChildrenMap, Decl(indexer2.ts, 0, 32)) + + hasOwnProperty(objectId: number) : boolean; +>hasOwnProperty : Symbol(hasOwnProperty, Decl(indexer2.ts, 1, 30)) +>objectId : Symbol(objectId, Decl(indexer2.ts, 2, 23)) + + [objectId: number] : IHeapObjectProperty[]; +>objectId : Symbol(objectId, Decl(indexer2.ts, 3, 9)) +>IHeapObjectProperty : Symbol(IHeapObjectProperty, Decl(indexer2.ts, 0, 0)) +} +var directChildrenMap = {}; +>directChildrenMap : Symbol(directChildrenMap, Decl(indexer2.ts, 5, 3)) +>IDirectChildrenMap : Symbol(IDirectChildrenMap, Decl(indexer2.ts, 0, 32)) + diff --git a/tests/baselines/reference/indexer3.symbols b/tests/baselines/reference/indexer3.symbols new file mode 100644 index 00000000000..1de91806faa --- /dev/null +++ b/tests/baselines/reference/indexer3.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/indexer3.ts === +var dateMap: { [x: string]: Date; } = {} +>dateMap : Symbol(dateMap, Decl(indexer3.ts, 0, 3)) +>x : Symbol(x, Decl(indexer3.ts, 0, 16)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var r: Date = dateMap["hello"] // result type includes indexer using BCT +>r : Symbol(r, Decl(indexer3.ts, 1, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>dateMap : Symbol(dateMap, Decl(indexer3.ts, 0, 3)) + diff --git a/tests/baselines/reference/indexer3.types b/tests/baselines/reference/indexer3.types index 7f660ab6aa9..8f0582f782a 100644 --- a/tests/baselines/reference/indexer3.types +++ b/tests/baselines/reference/indexer3.types @@ -10,4 +10,5 @@ var r: Date = dateMap["hello"] // result type includes indexer using BCT >Date : Date >dateMap["hello"] : Date >dateMap : { [x: string]: Date; } +>"hello" : string diff --git a/tests/baselines/reference/indexerA.symbols b/tests/baselines/reference/indexerA.symbols new file mode 100644 index 00000000000..d549c3359d9 --- /dev/null +++ b/tests/baselines/reference/indexerA.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/indexerA.ts === +class JQueryElement { +>JQueryElement : Symbol(JQueryElement, Decl(indexerA.ts, 0, 0)) + + id:string; +>id : Symbol(id, Decl(indexerA.ts, 0, 21)) +} + +class JQuery { +>JQuery : Symbol(JQuery, Decl(indexerA.ts, 2, 1)) + + [n:number]:JQueryElement +>n : Symbol(n, Decl(indexerA.ts, 5, 5)) +>JQueryElement : Symbol(JQueryElement, Decl(indexerA.ts, 0, 0)) +} + +var jq:JQuery={ 0: { id : "a" }, 1: { id : "b" } }; +>jq : Symbol(jq, Decl(indexerA.ts, 8, 3)) +>JQuery : Symbol(JQuery, Decl(indexerA.ts, 2, 1)) +>id : Symbol(id, Decl(indexerA.ts, 8, 20)) +>id : Symbol(id, Decl(indexerA.ts, 8, 37)) + +jq[0].id; +>jq[0].id : Symbol(JQueryElement.id, Decl(indexerA.ts, 0, 21)) +>jq : Symbol(jq, Decl(indexerA.ts, 8, 3)) +>id : Symbol(JQueryElement.id, Decl(indexerA.ts, 0, 21)) + diff --git a/tests/baselines/reference/indexerA.types b/tests/baselines/reference/indexerA.types index 39f7372c839..c6ff81b3a26 100644 --- a/tests/baselines/reference/indexerA.types +++ b/tests/baselines/reference/indexerA.types @@ -20,12 +20,15 @@ var jq:JQuery={ 0: { id : "a" }, 1: { id : "b" } }; >{ 0: { id : "a" }, 1: { id : "b" } } : { [x: number]: { id: string; }; 0: { id: string; }; 1: { id: string; }; } >{ id : "a" } : { id: string; } >id : string +>"a" : string >{ id : "b" } : { id: string; } >id : string +>"b" : string jq[0].id; >jq[0].id : string >jq[0] : JQueryElement >jq : JQuery +>0 : number >id : string diff --git a/tests/baselines/reference/indexerReturningTypeParameter1.symbols b/tests/baselines/reference/indexerReturningTypeParameter1.symbols new file mode 100644 index 00000000000..0bb1e305c80 --- /dev/null +++ b/tests/baselines/reference/indexerReturningTypeParameter1.symbols @@ -0,0 +1,42 @@ +=== tests/cases/compiler/indexerReturningTypeParameter1.ts === +interface f { +>f : Symbol(f, Decl(indexerReturningTypeParameter1.ts, 0, 0)) + + groupBy(): { [key: string]: T[]; }; +>groupBy : Symbol(groupBy, Decl(indexerReturningTypeParameter1.ts, 0, 13)) +>T : Symbol(T, Decl(indexerReturningTypeParameter1.ts, 1, 12)) +>key : Symbol(key, Decl(indexerReturningTypeParameter1.ts, 1, 21)) +>T : Symbol(T, Decl(indexerReturningTypeParameter1.ts, 1, 12)) +} +var a: f; +>a : Symbol(a, Decl(indexerReturningTypeParameter1.ts, 3, 3)) +>f : Symbol(f, Decl(indexerReturningTypeParameter1.ts, 0, 0)) + +var r = a.groupBy(); +>r : Symbol(r, Decl(indexerReturningTypeParameter1.ts, 4, 3)) +>a.groupBy : Symbol(f.groupBy, Decl(indexerReturningTypeParameter1.ts, 0, 13)) +>a : Symbol(a, Decl(indexerReturningTypeParameter1.ts, 3, 3)) +>groupBy : Symbol(f.groupBy, Decl(indexerReturningTypeParameter1.ts, 0, 13)) + +class c { +>c : Symbol(c, Decl(indexerReturningTypeParameter1.ts, 4, 20)) + + groupBy(): { [key: string]: T[]; } { +>groupBy : Symbol(groupBy, Decl(indexerReturningTypeParameter1.ts, 6, 9)) +>T : Symbol(T, Decl(indexerReturningTypeParameter1.ts, 7, 12)) +>key : Symbol(key, Decl(indexerReturningTypeParameter1.ts, 7, 21)) +>T : Symbol(T, Decl(indexerReturningTypeParameter1.ts, 7, 12)) + + return null; + } +} +var a2: c; +>a2 : Symbol(a2, Decl(indexerReturningTypeParameter1.ts, 11, 3)) +>c : Symbol(c, Decl(indexerReturningTypeParameter1.ts, 4, 20)) + +var r2 = a2.groupBy(); +>r2 : Symbol(r2, Decl(indexerReturningTypeParameter1.ts, 12, 3)) +>a2.groupBy : Symbol(c.groupBy, Decl(indexerReturningTypeParameter1.ts, 6, 9)) +>a2 : Symbol(a2, Decl(indexerReturningTypeParameter1.ts, 11, 3)) +>groupBy : Symbol(c.groupBy, Decl(indexerReturningTypeParameter1.ts, 6, 9)) + diff --git a/tests/baselines/reference/indexerReturningTypeParameter1.types b/tests/baselines/reference/indexerReturningTypeParameter1.types index a0a70f95331..83028bef93f 100644 --- a/tests/baselines/reference/indexerReturningTypeParameter1.types +++ b/tests/baselines/reference/indexerReturningTypeParameter1.types @@ -29,6 +29,7 @@ class c { >T : T return null; +>null : null } } var a2: c; diff --git a/tests/baselines/reference/indexerWithTuple.symbols b/tests/baselines/reference/indexerWithTuple.symbols new file mode 100644 index 00000000000..1ce5afbefac --- /dev/null +++ b/tests/baselines/reference/indexerWithTuple.symbols @@ -0,0 +1,131 @@ +=== tests/cases/conformance/types/tuple/indexerWithTuple.ts === +var strNumTuple: [string, number] = ["foo", 10]; +>strNumTuple : Symbol(strNumTuple, Decl(indexerWithTuple.ts, 0, 3)) + +var numTupleTuple: [number, [string, number]] = [10, ["bar", 20]]; +>numTupleTuple : Symbol(numTupleTuple, Decl(indexerWithTuple.ts, 1, 3)) + +var unionTuple1: [number, string| number] = [10, "foo"]; +>unionTuple1 : Symbol(unionTuple1, Decl(indexerWithTuple.ts, 2, 3)) + +var unionTuple2: [boolean, string| number] = [true, "foo"]; +>unionTuple2 : Symbol(unionTuple2, Decl(indexerWithTuple.ts, 3, 3)) + +// no error +var idx0 = 0; +>idx0 : Symbol(idx0, Decl(indexerWithTuple.ts, 6, 3)) + +var idx1 = 1; +>idx1 : Symbol(idx1, Decl(indexerWithTuple.ts, 7, 3)) + +var ele10 = strNumTuple[0]; // string +>ele10 : Symbol(ele10, Decl(indexerWithTuple.ts, 8, 3)) +>strNumTuple : Symbol(strNumTuple, Decl(indexerWithTuple.ts, 0, 3)) +>0 : Symbol(0) + +var ele11 = strNumTuple[1]; // number +>ele11 : Symbol(ele11, Decl(indexerWithTuple.ts, 9, 3)) +>strNumTuple : Symbol(strNumTuple, Decl(indexerWithTuple.ts, 0, 3)) +>1 : Symbol(1) + +var ele12 = strNumTuple[2]; // string | number +>ele12 : Symbol(ele12, Decl(indexerWithTuple.ts, 10, 3)) +>strNumTuple : Symbol(strNumTuple, Decl(indexerWithTuple.ts, 0, 3)) + +var ele13 = strNumTuple[idx0]; // string | number +>ele13 : Symbol(ele13, Decl(indexerWithTuple.ts, 11, 3)) +>strNumTuple : Symbol(strNumTuple, Decl(indexerWithTuple.ts, 0, 3)) +>idx0 : Symbol(idx0, Decl(indexerWithTuple.ts, 6, 3)) + +var ele14 = strNumTuple[idx1]; // string | number +>ele14 : Symbol(ele14, Decl(indexerWithTuple.ts, 12, 3)) +>strNumTuple : Symbol(strNumTuple, Decl(indexerWithTuple.ts, 0, 3)) +>idx1 : Symbol(idx1, Decl(indexerWithTuple.ts, 7, 3)) + +var ele15 = strNumTuple["0"]; // string +>ele15 : Symbol(ele15, Decl(indexerWithTuple.ts, 13, 3)) +>strNumTuple : Symbol(strNumTuple, Decl(indexerWithTuple.ts, 0, 3)) +>"0" : Symbol(0) + +var ele16 = strNumTuple["1"]; // number +>ele16 : Symbol(ele16, Decl(indexerWithTuple.ts, 14, 3)) +>strNumTuple : Symbol(strNumTuple, Decl(indexerWithTuple.ts, 0, 3)) +>"1" : Symbol(1) + +var strNumTuple1 = numTupleTuple[1]; //[string, number]; +>strNumTuple1 : Symbol(strNumTuple1, Decl(indexerWithTuple.ts, 15, 3)) +>numTupleTuple : Symbol(numTupleTuple, Decl(indexerWithTuple.ts, 1, 3)) +>1 : Symbol(1) + +var ele17 = numTupleTuple[2]; // number | [string, number] +>ele17 : Symbol(ele17, Decl(indexerWithTuple.ts, 16, 3)) +>numTupleTuple : Symbol(numTupleTuple, Decl(indexerWithTuple.ts, 1, 3)) + +var eleUnion10 = unionTuple1[0]; // number +>eleUnion10 : Symbol(eleUnion10, Decl(indexerWithTuple.ts, 17, 3)) +>unionTuple1 : Symbol(unionTuple1, Decl(indexerWithTuple.ts, 2, 3)) +>0 : Symbol(0) + +var eleUnion11 = unionTuple1[1]; // string | number +>eleUnion11 : Symbol(eleUnion11, Decl(indexerWithTuple.ts, 18, 3)) +>unionTuple1 : Symbol(unionTuple1, Decl(indexerWithTuple.ts, 2, 3)) +>1 : Symbol(1) + +var eleUnion12 = unionTuple1[2]; // string | number +>eleUnion12 : Symbol(eleUnion12, Decl(indexerWithTuple.ts, 19, 3)) +>unionTuple1 : Symbol(unionTuple1, Decl(indexerWithTuple.ts, 2, 3)) + +var eleUnion13 = unionTuple1[idx0]; // string | number +>eleUnion13 : Symbol(eleUnion13, Decl(indexerWithTuple.ts, 20, 3)) +>unionTuple1 : Symbol(unionTuple1, Decl(indexerWithTuple.ts, 2, 3)) +>idx0 : Symbol(idx0, Decl(indexerWithTuple.ts, 6, 3)) + +var eleUnion14 = unionTuple1[idx1]; // string | number +>eleUnion14 : Symbol(eleUnion14, Decl(indexerWithTuple.ts, 21, 3)) +>unionTuple1 : Symbol(unionTuple1, Decl(indexerWithTuple.ts, 2, 3)) +>idx1 : Symbol(idx1, Decl(indexerWithTuple.ts, 7, 3)) + +var eleUnion15 = unionTuple1["0"]; // number +>eleUnion15 : Symbol(eleUnion15, Decl(indexerWithTuple.ts, 22, 3)) +>unionTuple1 : Symbol(unionTuple1, Decl(indexerWithTuple.ts, 2, 3)) +>"0" : Symbol(0) + +var eleUnion16 = unionTuple1["1"]; // string | number +>eleUnion16 : Symbol(eleUnion16, Decl(indexerWithTuple.ts, 23, 3)) +>unionTuple1 : Symbol(unionTuple1, Decl(indexerWithTuple.ts, 2, 3)) +>"1" : Symbol(1) + +var eleUnion20 = unionTuple2[0]; // boolean +>eleUnion20 : Symbol(eleUnion20, Decl(indexerWithTuple.ts, 25, 3)) +>unionTuple2 : Symbol(unionTuple2, Decl(indexerWithTuple.ts, 3, 3)) +>0 : Symbol(0) + +var eleUnion21 = unionTuple2[1]; // string | number +>eleUnion21 : Symbol(eleUnion21, Decl(indexerWithTuple.ts, 26, 3)) +>unionTuple2 : Symbol(unionTuple2, Decl(indexerWithTuple.ts, 3, 3)) +>1 : Symbol(1) + +var eleUnion22 = unionTuple2[2]; // string | number | boolean +>eleUnion22 : Symbol(eleUnion22, Decl(indexerWithTuple.ts, 27, 3)) +>unionTuple2 : Symbol(unionTuple2, Decl(indexerWithTuple.ts, 3, 3)) + +var eleUnion23 = unionTuple2[idx0]; // string | number | boolean +>eleUnion23 : Symbol(eleUnion23, Decl(indexerWithTuple.ts, 28, 3)) +>unionTuple2 : Symbol(unionTuple2, Decl(indexerWithTuple.ts, 3, 3)) +>idx0 : Symbol(idx0, Decl(indexerWithTuple.ts, 6, 3)) + +var eleUnion24 = unionTuple2[idx1]; // string | number | boolean +>eleUnion24 : Symbol(eleUnion24, Decl(indexerWithTuple.ts, 29, 3)) +>unionTuple2 : Symbol(unionTuple2, Decl(indexerWithTuple.ts, 3, 3)) +>idx1 : Symbol(idx1, Decl(indexerWithTuple.ts, 7, 3)) + +var eleUnion25 = unionTuple2["0"]; // boolean +>eleUnion25 : Symbol(eleUnion25, Decl(indexerWithTuple.ts, 30, 3)) +>unionTuple2 : Symbol(unionTuple2, Decl(indexerWithTuple.ts, 3, 3)) +>"0" : Symbol(0) + +var eleUnion26 = unionTuple2["1"]; // string | number +>eleUnion26 : Symbol(eleUnion26, Decl(indexerWithTuple.ts, 31, 3)) +>unionTuple2 : Symbol(unionTuple2, Decl(indexerWithTuple.ts, 3, 3)) +>"1" : Symbol(1) + diff --git a/tests/baselines/reference/indexerWithTuple.types b/tests/baselines/reference/indexerWithTuple.types index 75b89ca6088..4faae2cda29 100644 --- a/tests/baselines/reference/indexerWithTuple.types +++ b/tests/baselines/reference/indexerWithTuple.types @@ -2,41 +2,55 @@ var strNumTuple: [string, number] = ["foo", 10]; >strNumTuple : [string, number] >["foo", 10] : [string, number] +>"foo" : string +>10 : number var numTupleTuple: [number, [string, number]] = [10, ["bar", 20]]; >numTupleTuple : [number, [string, number]] >[10, ["bar", 20]] : [number, [string, number]] +>10 : number >["bar", 20] : [string, number] +>"bar" : string +>20 : number var unionTuple1: [number, string| number] = [10, "foo"]; >unionTuple1 : [number, string | number] >[10, "foo"] : [number, string] +>10 : number +>"foo" : string var unionTuple2: [boolean, string| number] = [true, "foo"]; >unionTuple2 : [boolean, string | number] >[true, "foo"] : [boolean, string] +>true : boolean +>"foo" : string // no error var idx0 = 0; >idx0 : number +>0 : number var idx1 = 1; >idx1 : number +>1 : number var ele10 = strNumTuple[0]; // string >ele10 : string >strNumTuple[0] : string >strNumTuple : [string, number] +>0 : number var ele11 = strNumTuple[1]; // number >ele11 : number >strNumTuple[1] : number >strNumTuple : [string, number] +>1 : number var ele12 = strNumTuple[2]; // string | number >ele12 : string | number >strNumTuple[2] : string | number >strNumTuple : [string, number] +>2 : number var ele13 = strNumTuple[idx0]; // string | number >ele13 : string | number @@ -54,36 +68,43 @@ var ele15 = strNumTuple["0"]; // string >ele15 : string >strNumTuple["0"] : string >strNumTuple : [string, number] +>"0" : string var ele16 = strNumTuple["1"]; // number >ele16 : number >strNumTuple["1"] : number >strNumTuple : [string, number] +>"1" : string var strNumTuple1 = numTupleTuple[1]; //[string, number]; >strNumTuple1 : [string, number] >numTupleTuple[1] : [string, number] >numTupleTuple : [number, [string, number]] +>1 : number var ele17 = numTupleTuple[2]; // number | [string, number] >ele17 : number | [string, number] >numTupleTuple[2] : number | [string, number] >numTupleTuple : [number, [string, number]] +>2 : number var eleUnion10 = unionTuple1[0]; // number >eleUnion10 : number >unionTuple1[0] : number >unionTuple1 : [number, string | number] +>0 : number var eleUnion11 = unionTuple1[1]; // string | number >eleUnion11 : string | number >unionTuple1[1] : string | number >unionTuple1 : [number, string | number] +>1 : number var eleUnion12 = unionTuple1[2]; // string | number >eleUnion12 : string | number >unionTuple1[2] : string | number >unionTuple1 : [number, string | number] +>2 : number var eleUnion13 = unionTuple1[idx0]; // string | number >eleUnion13 : string | number @@ -101,26 +122,31 @@ var eleUnion15 = unionTuple1["0"]; // number >eleUnion15 : number >unionTuple1["0"] : number >unionTuple1 : [number, string | number] +>"0" : string var eleUnion16 = unionTuple1["1"]; // string | number >eleUnion16 : string | number >unionTuple1["1"] : string | number >unionTuple1 : [number, string | number] +>"1" : string var eleUnion20 = unionTuple2[0]; // boolean >eleUnion20 : boolean >unionTuple2[0] : boolean >unionTuple2 : [boolean, string | number] +>0 : number var eleUnion21 = unionTuple2[1]; // string | number >eleUnion21 : string | number >unionTuple2[1] : string | number >unionTuple2 : [boolean, string | number] +>1 : number var eleUnion22 = unionTuple2[2]; // string | number | boolean >eleUnion22 : string | number | boolean >unionTuple2[2] : string | number | boolean >unionTuple2 : [boolean, string | number] +>2 : number var eleUnion23 = unionTuple2[idx0]; // string | number | boolean >eleUnion23 : string | number | boolean @@ -138,9 +164,11 @@ var eleUnion25 = unionTuple2["0"]; // boolean >eleUnion25 : boolean >unionTuple2["0"] : boolean >unionTuple2 : [boolean, string | number] +>"0" : string var eleUnion26 = unionTuple2["1"]; // string | number >eleUnion26 : string | number >unionTuple2["1"] : string | number >unionTuple2 : [boolean, string | number] +>"1" : string diff --git a/tests/baselines/reference/indexersInClassType.symbols b/tests/baselines/reference/indexersInClassType.symbols new file mode 100644 index 00000000000..e459888cc0d --- /dev/null +++ b/tests/baselines/reference/indexersInClassType.symbols @@ -0,0 +1,47 @@ +=== tests/cases/conformance/classes/members/classTypes/indexersInClassType.ts === +class C { +>C : Symbol(C, Decl(indexersInClassType.ts, 0, 0)) + + [x: number]: Date; +>x : Symbol(x, Decl(indexersInClassType.ts, 1, 5)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + [x: string]: Object; +>x : Symbol(x, Decl(indexersInClassType.ts, 2, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + 1: Date; +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + 'a': {} + + fn() { +>fn : Symbol(fn, Decl(indexersInClassType.ts, 4, 11)) + + return this; +>this : Symbol(C, Decl(indexersInClassType.ts, 0, 0)) + } +} + +var c = new C(); +>c : Symbol(c, Decl(indexersInClassType.ts, 11, 3)) +>C : Symbol(C, Decl(indexersInClassType.ts, 0, 0)) + +var r = c.fn(); +>r : Symbol(r, Decl(indexersInClassType.ts, 12, 3)) +>c.fn : Symbol(C.fn, Decl(indexersInClassType.ts, 4, 11)) +>c : Symbol(c, Decl(indexersInClassType.ts, 11, 3)) +>fn : Symbol(C.fn, Decl(indexersInClassType.ts, 4, 11)) + +var r2 = r[1]; +>r2 : Symbol(r2, Decl(indexersInClassType.ts, 13, 3)) +>r : Symbol(r, Decl(indexersInClassType.ts, 12, 3)) +>1 : Symbol(C.1, Decl(indexersInClassType.ts, 2, 24)) + +var r3 = r.a +>r3 : Symbol(r3, Decl(indexersInClassType.ts, 14, 3)) +>r.a : Symbol(C.'a', Decl(indexersInClassType.ts, 3, 12)) +>r : Symbol(r, Decl(indexersInClassType.ts, 12, 3)) +>a : Symbol(C.'a', Decl(indexersInClassType.ts, 3, 12)) + + diff --git a/tests/baselines/reference/indexersInClassType.types b/tests/baselines/reference/indexersInClassType.types index afc21b9ce8a..8e06bdfbfd3 100644 --- a/tests/baselines/reference/indexersInClassType.types +++ b/tests/baselines/reference/indexersInClassType.types @@ -39,6 +39,7 @@ var r2 = r[1]; >r2 : Date >r[1] : Date >r : C +>1 : number var r3 = r.a >r3 : {} diff --git a/tests/baselines/reference/inferSecondaryParameter.symbols b/tests/baselines/reference/inferSecondaryParameter.symbols new file mode 100644 index 00000000000..c2527ed14b3 --- /dev/null +++ b/tests/baselines/reference/inferSecondaryParameter.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/inferSecondaryParameter.ts === +// type inference on 'bug' should give 'any' + +interface Ib { m(test: string, fn: Function); } +>Ib : Symbol(Ib, Decl(inferSecondaryParameter.ts, 0, 0)) +>m : Symbol(m, Decl(inferSecondaryParameter.ts, 2, 14)) +>test : Symbol(test, Decl(inferSecondaryParameter.ts, 2, 17)) +>fn : Symbol(fn, Decl(inferSecondaryParameter.ts, 2, 30)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) + +var b: Ib = { m: function (test: string, fn: Function) { } }; +>b : Symbol(b, Decl(inferSecondaryParameter.ts, 4, 3)) +>Ib : Symbol(Ib, Decl(inferSecondaryParameter.ts, 0, 0)) +>m : Symbol(m, Decl(inferSecondaryParameter.ts, 4, 13)) +>test : Symbol(test, Decl(inferSecondaryParameter.ts, 4, 27)) +>fn : Symbol(fn, Decl(inferSecondaryParameter.ts, 4, 40)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) + +b.m("test", function (bug) { +>b.m : Symbol(Ib.m, Decl(inferSecondaryParameter.ts, 2, 14)) +>b : Symbol(b, Decl(inferSecondaryParameter.ts, 4, 3)) +>m : Symbol(Ib.m, Decl(inferSecondaryParameter.ts, 2, 14)) +>bug : Symbol(bug, Decl(inferSecondaryParameter.ts, 6, 22)) + + var a: number = bug; +>a : Symbol(a, Decl(inferSecondaryParameter.ts, 7, 7)) +>bug : Symbol(bug, Decl(inferSecondaryParameter.ts, 6, 22)) + +}); diff --git a/tests/baselines/reference/inferSecondaryParameter.types b/tests/baselines/reference/inferSecondaryParameter.types index e416cface90..34dbb14ea66 100644 --- a/tests/baselines/reference/inferSecondaryParameter.types +++ b/tests/baselines/reference/inferSecondaryParameter.types @@ -23,6 +23,7 @@ b.m("test", function (bug) { >b.m : (test: string, fn: Function) => any >b : Ib >m : (test: string, fn: Function) => any +>"test" : string >function (bug) { var a: number = bug;} : (bug: any) => void >bug : any diff --git a/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.symbols b/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.symbols new file mode 100644 index 00000000000..22ab5fa4118 --- /dev/null +++ b/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.symbols @@ -0,0 +1,46 @@ +=== tests/cases/compiler/inferTypeArgumentsInSignatureWithRestParameters.ts === +function f(array: T[], ...args) { } +>f : Symbol(f, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 0, 0)) +>T : Symbol(T, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 0, 11)) +>array : Symbol(array, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 0, 14)) +>T : Symbol(T, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 0, 11)) +>args : Symbol(args, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 0, 25)) + +function g(array: number[], ...args) { } +>g : Symbol(g, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 0, 38)) +>array : Symbol(array, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 1, 11)) +>args : Symbol(args, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 1, 27)) + +function h(nonarray: T, ...args) { } +>h : Symbol(h, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 1, 40)) +>T : Symbol(T, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 2, 11)) +>nonarray : Symbol(nonarray, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 2, 14)) +>T : Symbol(T, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 2, 11)) +>args : Symbol(args, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 2, 26)) + +function i(array: T[], opt?: any[]) { } +>i : Symbol(i, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 2, 39)) +>T : Symbol(T, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 3, 11)) +>array : Symbol(array, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 3, 14)) +>T : Symbol(T, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 3, 11)) +>opt : Symbol(opt, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 3, 25)) + +var a = [1, 2, 3, 4, 5]; +>a : Symbol(a, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 4, 3)) + +f(a); // OK +>f : Symbol(f, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 0, 0)) +>a : Symbol(a, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 4, 3)) + +g(a); // OK +>g : Symbol(g, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 0, 38)) +>a : Symbol(a, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 4, 3)) + +h(a); // OK +>h : Symbol(h, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 1, 40)) +>a : Symbol(a, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 4, 3)) + +i(a); // OK +>i : Symbol(i, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 2, 39)) +>a : Symbol(a, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 4, 3)) + diff --git a/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.types b/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.types index 5bf41c64b24..f4d94388f42 100644 --- a/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.types +++ b/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.types @@ -28,6 +28,11 @@ function i(array: T[], opt?: any[]) { } var a = [1, 2, 3, 4, 5]; >a : number[] >[1, 2, 3, 4, 5] : number[] +>1 : number +>2 : number +>3 : number +>4 : number +>5 : number f(a); // OK >f(a) : void diff --git a/tests/baselines/reference/inferenceFromParameterlessLambda.symbols b/tests/baselines/reference/inferenceFromParameterlessLambda.symbols new file mode 100644 index 00000000000..6170a4d1149 --- /dev/null +++ b/tests/baselines/reference/inferenceFromParameterlessLambda.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/inferenceFromParameterlessLambda.ts === +function foo(o: Take, i: Make) { } +>foo : Symbol(foo, Decl(inferenceFromParameterlessLambda.ts, 0, 0)) +>T : Symbol(T, Decl(inferenceFromParameterlessLambda.ts, 0, 13)) +>o : Symbol(o, Decl(inferenceFromParameterlessLambda.ts, 0, 16)) +>Take : Symbol(Take, Decl(inferenceFromParameterlessLambda.ts, 3, 1)) +>T : Symbol(T, Decl(inferenceFromParameterlessLambda.ts, 0, 13)) +>i : Symbol(i, Decl(inferenceFromParameterlessLambda.ts, 0, 27)) +>Make : Symbol(Make, Decl(inferenceFromParameterlessLambda.ts, 0, 43)) +>T : Symbol(T, Decl(inferenceFromParameterlessLambda.ts, 0, 13)) + +interface Make { +>Make : Symbol(Make, Decl(inferenceFromParameterlessLambda.ts, 0, 43)) +>T : Symbol(T, Decl(inferenceFromParameterlessLambda.ts, 1, 15)) + + (): T; +>T : Symbol(T, Decl(inferenceFromParameterlessLambda.ts, 1, 15)) +} +interface Take { +>Take : Symbol(Take, Decl(inferenceFromParameterlessLambda.ts, 3, 1)) +>T : Symbol(T, Decl(inferenceFromParameterlessLambda.ts, 4, 15)) + + (n: T): void; +>n : Symbol(n, Decl(inferenceFromParameterlessLambda.ts, 5, 5)) +>T : Symbol(T, Decl(inferenceFromParameterlessLambda.ts, 4, 15)) +} +// Infer string from second argument because it isn't context sensitive +foo(n => n.length, () => 'hi'); +>foo : Symbol(foo, Decl(inferenceFromParameterlessLambda.ts, 0, 0)) +>n : Symbol(n, Decl(inferenceFromParameterlessLambda.ts, 8, 4)) +>n.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>n : Symbol(n, Decl(inferenceFromParameterlessLambda.ts, 8, 4)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + diff --git a/tests/baselines/reference/inferenceFromParameterlessLambda.types b/tests/baselines/reference/inferenceFromParameterlessLambda.types index 8dbb8c5967c..57747d881f6 100644 --- a/tests/baselines/reference/inferenceFromParameterlessLambda.types +++ b/tests/baselines/reference/inferenceFromParameterlessLambda.types @@ -34,4 +34,5 @@ foo(n => n.length, () => 'hi'); >n : string >length : number >() => 'hi' : () => string +>'hi' : string diff --git a/tests/baselines/reference/inferentialTypingWithFunctionType.symbols b/tests/baselines/reference/inferentialTypingWithFunctionType.symbols new file mode 100644 index 00000000000..6b5eac3e5b7 --- /dev/null +++ b/tests/baselines/reference/inferentialTypingWithFunctionType.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/inferentialTypingWithFunctionType.ts === +declare function map(x: T, f: (s: T) => U): U; +>map : Symbol(map, Decl(inferentialTypingWithFunctionType.ts, 0, 0)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionType.ts, 0, 21)) +>U : Symbol(U, Decl(inferentialTypingWithFunctionType.ts, 0, 23)) +>x : Symbol(x, Decl(inferentialTypingWithFunctionType.ts, 0, 27)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionType.ts, 0, 21)) +>f : Symbol(f, Decl(inferentialTypingWithFunctionType.ts, 0, 32)) +>s : Symbol(s, Decl(inferentialTypingWithFunctionType.ts, 0, 37)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionType.ts, 0, 21)) +>U : Symbol(U, Decl(inferentialTypingWithFunctionType.ts, 0, 23)) +>U : Symbol(U, Decl(inferentialTypingWithFunctionType.ts, 0, 23)) + +declare function identity(y: V): V; +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionType.ts, 0, 52)) +>V : Symbol(V, Decl(inferentialTypingWithFunctionType.ts, 1, 26)) +>y : Symbol(y, Decl(inferentialTypingWithFunctionType.ts, 1, 29)) +>V : Symbol(V, Decl(inferentialTypingWithFunctionType.ts, 1, 26)) +>V : Symbol(V, Decl(inferentialTypingWithFunctionType.ts, 1, 26)) + +var s = map("", identity); +>s : Symbol(s, Decl(inferentialTypingWithFunctionType.ts, 3, 3)) +>map : Symbol(map, Decl(inferentialTypingWithFunctionType.ts, 0, 0)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionType.ts, 0, 52)) + diff --git a/tests/baselines/reference/inferentialTypingWithFunctionType.types b/tests/baselines/reference/inferentialTypingWithFunctionType.types index 9f1986c49ea..460156c91ea 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionType.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionType.types @@ -22,5 +22,6 @@ var s = map("", identity); >s : string >map("", identity) : string >map : (x: T, f: (s: T) => U) => U +>"" : string >identity : (y: V) => V diff --git a/tests/baselines/reference/inferentialTypingWithFunctionType2.symbols b/tests/baselines/reference/inferentialTypingWithFunctionType2.symbols new file mode 100644 index 00000000000..5fcc91d816e --- /dev/null +++ b/tests/baselines/reference/inferentialTypingWithFunctionType2.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/inferentialTypingWithFunctionType2.ts === +function identity(a: A): A { +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionType2.ts, 0, 0)) +>A : Symbol(A, Decl(inferentialTypingWithFunctionType2.ts, 0, 18)) +>a : Symbol(a, Decl(inferentialTypingWithFunctionType2.ts, 0, 21)) +>A : Symbol(A, Decl(inferentialTypingWithFunctionType2.ts, 0, 18)) +>A : Symbol(A, Decl(inferentialTypingWithFunctionType2.ts, 0, 18)) + + return a; +>a : Symbol(a, Decl(inferentialTypingWithFunctionType2.ts, 0, 21)) +} +var x = [1, 2, 3].map(identity)[0]; +>x : Symbol(x, Decl(inferentialTypingWithFunctionType2.ts, 3, 3)) +>[1, 2, 3].map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionType2.ts, 0, 0)) + diff --git a/tests/baselines/reference/inferentialTypingWithFunctionType2.types b/tests/baselines/reference/inferentialTypingWithFunctionType2.types index a97bf2ab36c..6dc4cda3b68 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionType2.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionType2.types @@ -15,6 +15,10 @@ var x = [1, 2, 3].map(identity)[0]; >[1, 2, 3].map(identity) : number[] >[1, 2, 3].map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number >map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] >identity : (a: A) => A +>0 : number diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.symbols b/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.symbols new file mode 100644 index 00000000000..ae72021b31b --- /dev/null +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/inferentialTypingWithFunctionTypeNested.ts === +declare function map(x: T, f: () => { x: (s: T) => U }): U; +>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 0)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 21)) +>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 23)) +>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 27)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 21)) +>f : Symbol(f, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 32)) +>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 43)) +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 48)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 21)) +>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 23)) +>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 23)) + +declare function identity(y: V): V; +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 65)) +>V : Symbol(V, Decl(inferentialTypingWithFunctionTypeNested.ts, 1, 26)) +>y : Symbol(y, Decl(inferentialTypingWithFunctionTypeNested.ts, 1, 29)) +>V : Symbol(V, Decl(inferentialTypingWithFunctionTypeNested.ts, 1, 26)) +>V : Symbol(V, Decl(inferentialTypingWithFunctionTypeNested.ts, 1, 26)) + +var s = map("", () => { return { x: identity }; }); +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeNested.ts, 3, 3)) +>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 0)) +>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeNested.ts, 3, 32)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 65)) + diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.types b/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.types index c411dd00514..a83379b4c73 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.types @@ -23,6 +23,7 @@ var s = map("", () => { return { x: identity }; }); >s : string >map("", () => { return { x: identity }; }) : string >map : (x: T, f: () => { x: (s: T) => U; }) => U +>"" : string >() => { return { x: identity }; } : () => { x: (y: string) => string; } >{ x: identity } : { x: (y: V) => V; } >x : (y: V) => V diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.symbols b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.symbols new file mode 100644 index 00000000000..a9571bc8a38 --- /dev/null +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.symbols @@ -0,0 +1,94 @@ +=== tests/cases/compiler/inferentialTypingWithFunctionTypeSyntacticScenarios.ts === +declare function map(array: T, func: (x: T) => U): U; +>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 21)) +>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 23)) +>array : Symbol(array, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 27)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 21)) +>func : Symbol(func, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 36)) +>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 44)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 21)) +>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 23)) +>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 23)) + +declare function identity(y: V): V; +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59)) +>V : Symbol(V, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 26)) +>y : Symbol(y, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 29)) +>V : Symbol(V, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 26)) +>V : Symbol(V, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 26)) + +var s: string; +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3)) + +// dotted name +var dottedIdentity = { x: identity }; +>dottedIdentity : Symbol(dottedIdentity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 3)) +>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 22)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59)) + +s = map("", dottedIdentity.x); +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3)) +>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0)) +>dottedIdentity.x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 22)) +>dottedIdentity : Symbol(dottedIdentity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 3)) +>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 22)) + +// index expression +s = map("", dottedIdentity['x']); +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3)) +>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0)) +>dottedIdentity : Symbol(dottedIdentity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 3)) +>'x' : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 22)) + +// function call +s = map("", (() => identity)()); +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3)) +>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59)) + +// construct +interface IdentityConstructor { +>IdentityConstructor : Symbol(IdentityConstructor, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 12, 32)) + + new (): typeof identity; +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59)) +} +var ic: IdentityConstructor; +>ic : Symbol(ic, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 18, 3)) +>IdentityConstructor : Symbol(IdentityConstructor, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 12, 32)) + +s = map("", new ic()); +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3)) +>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0)) +>ic : Symbol(ic, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 18, 3)) + +// assignment +var t; +>t : Symbol(t, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 22, 3)) + +s = map("", t = identity); +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3)) +>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0)) +>t : Symbol(t, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 22, 3)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59)) + +// type assertion +s = map("", identity); +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3)) +>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59)) + +// parenthesized expression +s = map("", (identity)); +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3)) +>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59)) + +// comma +s = map("", ("", identity)); +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3)) +>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59)) + diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.types b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.types index 115da50176f..5a4decef4dc 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.types @@ -33,6 +33,7 @@ s = map("", dottedIdentity.x); >s : string >map("", dottedIdentity.x) : string >map : (array: T, func: (x: T) => U) => U +>"" : string >dottedIdentity.x : (y: V) => V >dottedIdentity : { x: (y: V) => V; } >x : (y: V) => V @@ -43,8 +44,10 @@ s = map("", dottedIdentity['x']); >s : string >map("", dottedIdentity['x']) : string >map : (array: T, func: (x: T) => U) => U +>"" : string >dottedIdentity['x'] : (y: V) => V >dottedIdentity : { x: (y: V) => V; } +>'x' : string // function call s = map("", (() => identity)()); @@ -52,6 +55,7 @@ s = map("", (() => identity)()); >s : string >map("", (() => identity)()) : string >map : (array: T, func: (x: T) => U) => U +>"" : string >(() => identity)() : (y: V) => V >(() => identity) : () => (y: V) => V >() => identity : () => (y: V) => V @@ -73,6 +77,7 @@ s = map("", new ic()); >s : string >map("", new ic()) : string >map : (array: T, func: (x: T) => U) => U +>"" : string >new ic() : (y: V) => V >ic : IdentityConstructor @@ -85,6 +90,7 @@ s = map("", t = identity); >s : string >map("", t = identity) : string >map : (array: T, func: (x: T) => U) => U +>"" : string >t = identity : (y: V) => V >t : any >identity : (y: V) => V @@ -95,6 +101,7 @@ s = map("", identity); >s : string >map("", identity) : string >map : (array: T, func: (x: T) => U) => U +>"" : string >identity : (y: V) => V >identity : (y: V) => V >identity : (y: V) => V @@ -105,6 +112,7 @@ s = map("", (identity)); >s : string >map("", (identity)) : string >map : (array: T, func: (x: T) => U) => U +>"" : string >(identity) : (y: V) => V >identity : (y: V) => V @@ -114,7 +122,9 @@ s = map("", ("", identity)); >s : string >map("", ("", identity)) : string >map : (array: T, func: (x: T) => U) => U +>"" : string >("", identity) : (y: V) => V >"", identity : (y: V) => V +>"" : string >identity : (y: V) => V diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.symbols b/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.symbols new file mode 100644 index 00000000000..144d3426f7a --- /dev/null +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.symbols @@ -0,0 +1,42 @@ +=== tests/cases/compiler/inferentialTypingWithFunctionTypeZip.ts === +var pair: (x: T) => (y: S) => { x: T; y: S; } +>pair : Symbol(pair, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 3)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 11)) +>S : Symbol(S, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 13)) +>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 17)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 11)) +>y : Symbol(y, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 27)) +>S : Symbol(S, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 13)) +>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 37)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 11)) +>y : Symbol(y, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 43)) +>S : Symbol(S, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 13)) + +var zipWith: (a: T[], b: S[], f: (x: T) => (y: S) => U) => U[]; +>zipWith : Symbol(zipWith, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 3)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 14)) +>S : Symbol(S, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 16)) +>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 19)) +>a : Symbol(a, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 23)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 14)) +>b : Symbol(b, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 30)) +>S : Symbol(S, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 16)) +>f : Symbol(f, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 38)) +>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 43)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 14)) +>y : Symbol(y, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 53)) +>S : Symbol(S, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 16)) +>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 19)) +>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 19)) + +var result = zipWith([1, 2], ['a', 'b'], pair); +>result : Symbol(result, Decl(inferentialTypingWithFunctionTypeZip.ts, 2, 3)) +>zipWith : Symbol(zipWith, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 3)) +>pair : Symbol(pair, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 3)) + +var i = result[0].x; // number +>i : Symbol(i, Decl(inferentialTypingWithFunctionTypeZip.ts, 3, 3)) +>result[0].x : Symbol(x, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 37)) +>result : Symbol(result, Decl(inferentialTypingWithFunctionTypeZip.ts, 2, 3)) +>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 37)) + diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types b/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types index 53a9dff0b48..cc9d8790bd4 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types @@ -34,7 +34,11 @@ var result = zipWith([1, 2], ['a', 'b'], pair); >zipWith([1, 2], ['a', 'b'], pair) : { x: number; y: {}; }[] >zipWith : (a: T[], b: S[], f: (x: T) => (y: S) => U) => U[] >[1, 2] : number[] +>1 : number +>2 : number >['a', 'b'] : string[] +>'a' : string +>'b' : string >pair : (x: T) => (y: S) => { x: T; y: S; } var i = result[0].x; // number @@ -42,5 +46,6 @@ var i = result[0].x; // number >result[0].x : number >result[0] : { x: number; y: {}; } >result : { x: number; y: {}; }[] +>0 : number >x : number diff --git a/tests/baselines/reference/inferentiallyTypingAnEmptyArray.symbols b/tests/baselines/reference/inferentiallyTypingAnEmptyArray.symbols new file mode 100644 index 00000000000..b53f21579da --- /dev/null +++ b/tests/baselines/reference/inferentiallyTypingAnEmptyArray.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/inferentiallyTypingAnEmptyArray.ts === +// April 2014, Section 4.6: +// In the absence of a contextual type, the type of an array literal is C[], where C is the +// Undefined type(section 3.2.6) if the array literal is empty, or the best common type of +// the element expressions if the array literal is not empty. +// When an array literal is contextually typed(section 4.19) by an object type containing a +// numeric index signature of type T, each element expression is contextually typed by T and +// the type of the array literal is the best common type of T and the types of the element +// expressions. +// +// While the spec does not say it, an inferential type causes an empty array literal to have +// the undefined[] type. In other words, the first clause from the excerpt above applies even +// though there is a "contextual type" present. This is the intention, even though the spec +// seems to imply the contrary. +// Therefore, the following access to bar should not cause an error because we infer +// the undefined[] type. +declare function foo(arr: T[]): T; +>foo : Symbol(foo, Decl(inferentiallyTypingAnEmptyArray.ts, 0, 0)) +>T : Symbol(T, Decl(inferentiallyTypingAnEmptyArray.ts, 15, 21)) +>arr : Symbol(arr, Decl(inferentiallyTypingAnEmptyArray.ts, 15, 24)) +>T : Symbol(T, Decl(inferentiallyTypingAnEmptyArray.ts, 15, 21)) +>T : Symbol(T, Decl(inferentiallyTypingAnEmptyArray.ts, 15, 21)) + +foo([]).bar; +>foo : Symbol(foo, Decl(inferentiallyTypingAnEmptyArray.ts, 0, 0)) + diff --git a/tests/baselines/reference/infiniteExpandingTypeThroughInheritanceInstantiation.symbols b/tests/baselines/reference/infiniteExpandingTypeThroughInheritanceInstantiation.symbols new file mode 100644 index 00000000000..2640ec367dc --- /dev/null +++ b/tests/baselines/reference/infiniteExpandingTypeThroughInheritanceInstantiation.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/infiniteExpandingTypeThroughInheritanceInstantiation.ts === +interface A +>A : Symbol(A, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 0, 0)) +>T : Symbol(T, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 0, 12)) +{ + x: A> +>x : Symbol(x, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 1, 1)) +>A : Symbol(A, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 0, 0)) +>B : Symbol(B, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 3, 1)) +>T : Symbol(T, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 0, 12)) +} + +interface B extends A // error +>B : Symbol(B, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 3, 1)) +>T : Symbol(T, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 5, 12)) +>A : Symbol(A, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 0, 0)) +>T : Symbol(T, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 5, 12)) +{ + x: B> +>x : Symbol(x, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 6, 1)) +>B : Symbol(B, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 3, 1)) +>A : Symbol(A, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 0, 0)) +>T : Symbol(T, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 5, 12)) +} + diff --git a/tests/baselines/reference/infiniteExpansionThroughTypeInference.symbols b/tests/baselines/reference/infiniteExpansionThroughTypeInference.symbols new file mode 100644 index 00000000000..ba90d5c74a8 --- /dev/null +++ b/tests/baselines/reference/infiniteExpansionThroughTypeInference.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansionThroughTypeInference.ts === +interface G { +>G : Symbol(G, Decl(infiniteExpansionThroughTypeInference.ts, 0, 0)) +>T : Symbol(T, Decl(infiniteExpansionThroughTypeInference.ts, 0, 12)) + + x: G> // infinitely expanding type reference +>x : Symbol(x, Decl(infiniteExpansionThroughTypeInference.ts, 0, 16)) +>G : Symbol(G, Decl(infiniteExpansionThroughTypeInference.ts, 0, 0)) +>G : Symbol(G, Decl(infiniteExpansionThroughTypeInference.ts, 0, 0)) +>T : Symbol(T, Decl(infiniteExpansionThroughTypeInference.ts, 0, 12)) + + y: T +>y : Symbol(y, Decl(infiniteExpansionThroughTypeInference.ts, 1, 14)) +>T : Symbol(T, Decl(infiniteExpansionThroughTypeInference.ts, 0, 12)) +} + +function ff(g: G): void { +>ff : Symbol(ff, Decl(infiniteExpansionThroughTypeInference.ts, 3, 1)) +>T : Symbol(T, Decl(infiniteExpansionThroughTypeInference.ts, 5, 12)) +>g : Symbol(g, Decl(infiniteExpansionThroughTypeInference.ts, 5, 15)) +>G : Symbol(G, Decl(infiniteExpansionThroughTypeInference.ts, 0, 0)) +>T : Symbol(T, Decl(infiniteExpansionThroughTypeInference.ts, 5, 12)) + + ff(g) // when infering T here we need to make sure to not descend into the structure of G infinitely +>ff : Symbol(ff, Decl(infiniteExpansionThroughTypeInference.ts, 3, 1)) +>g : Symbol(g, Decl(infiniteExpansionThroughTypeInference.ts, 5, 15)) +} + + diff --git a/tests/baselines/reference/infinitelyExpandingBaseTypes1.symbols b/tests/baselines/reference/infinitelyExpandingBaseTypes1.symbols new file mode 100644 index 00000000000..dc3456602bb --- /dev/null +++ b/tests/baselines/reference/infinitelyExpandingBaseTypes1.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/infinitelyExpandingBaseTypes1.ts === +interface A +>A : Symbol(A, Decl(infinitelyExpandingBaseTypes1.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingBaseTypes1.ts, 0, 12)) +{ + x : A> +>x : Symbol(x, Decl(infinitelyExpandingBaseTypes1.ts, 1, 1)) +>A : Symbol(A, Decl(infinitelyExpandingBaseTypes1.ts, 0, 0)) +>A : Symbol(A, Decl(infinitelyExpandingBaseTypes1.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingBaseTypes1.ts, 0, 12)) +} + +interface B +>B : Symbol(B, Decl(infinitelyExpandingBaseTypes1.ts, 3, 1)) +>T : Symbol(T, Decl(infinitelyExpandingBaseTypes1.ts, 5, 12)) +{ + x : B +>x : Symbol(x, Decl(infinitelyExpandingBaseTypes1.ts, 6, 1)) +>B : Symbol(B, Decl(infinitelyExpandingBaseTypes1.ts, 3, 1)) +>T : Symbol(T, Decl(infinitelyExpandingBaseTypes1.ts, 5, 12)) +} + +interface C extends A, B { } +>C : Symbol(C, Decl(infinitelyExpandingBaseTypes1.ts, 8, 1)) +>T : Symbol(T, Decl(infinitelyExpandingBaseTypes1.ts, 10, 12)) +>A : Symbol(A, Decl(infinitelyExpandingBaseTypes1.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingBaseTypes1.ts, 10, 12)) +>B : Symbol(B, Decl(infinitelyExpandingBaseTypes1.ts, 3, 1)) +>T : Symbol(T, Decl(infinitelyExpandingBaseTypes1.ts, 10, 12)) + + + diff --git a/tests/baselines/reference/infinitelyExpandingBaseTypes2.symbols b/tests/baselines/reference/infinitelyExpandingBaseTypes2.symbols new file mode 100644 index 00000000000..8379ea16878 --- /dev/null +++ b/tests/baselines/reference/infinitelyExpandingBaseTypes2.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/infinitelyExpandingBaseTypes2.ts === +interface A +>A : Symbol(A, Decl(infinitelyExpandingBaseTypes2.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingBaseTypes2.ts, 0, 12)) +{ + x : A<()=>T> +>x : Symbol(x, Decl(infinitelyExpandingBaseTypes2.ts, 1, 1)) +>A : Symbol(A, Decl(infinitelyExpandingBaseTypes2.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingBaseTypes2.ts, 0, 12)) +} + +interface B +>B : Symbol(B, Decl(infinitelyExpandingBaseTypes2.ts, 3, 1)) +>T : Symbol(T, Decl(infinitelyExpandingBaseTypes2.ts, 5, 12)) +{ + x : B<()=>T> +>x : Symbol(x, Decl(infinitelyExpandingBaseTypes2.ts, 6, 1)) +>B : Symbol(B, Decl(infinitelyExpandingBaseTypes2.ts, 3, 1)) +>T : Symbol(T, Decl(infinitelyExpandingBaseTypes2.ts, 5, 12)) +} + +var a: A +>a : Symbol(a, Decl(infinitelyExpandingBaseTypes2.ts, 10, 3)) +>A : Symbol(A, Decl(infinitelyExpandingBaseTypes2.ts, 0, 0)) + +var b: B = a +>b : Symbol(b, Decl(infinitelyExpandingBaseTypes2.ts, 11, 3)) +>B : Symbol(B, Decl(infinitelyExpandingBaseTypes2.ts, 3, 1)) +>a : Symbol(a, Decl(infinitelyExpandingBaseTypes2.ts, 10, 3)) + diff --git a/tests/baselines/reference/infinitelyExpandingTypeAssignability.symbols b/tests/baselines/reference/infinitelyExpandingTypeAssignability.symbols new file mode 100644 index 00000000000..1907ff33cf6 --- /dev/null +++ b/tests/baselines/reference/infinitelyExpandingTypeAssignability.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/infinitelyExpandingTypeAssignability.ts === +interface A { +>A : Symbol(A, Decl(infinitelyExpandingTypeAssignability.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingTypeAssignability.ts, 0, 12)) + + x : T +>x : Symbol(x, Decl(infinitelyExpandingTypeAssignability.ts, 0, 16)) +>T : Symbol(T, Decl(infinitelyExpandingTypeAssignability.ts, 0, 12)) +} + +interface B extends A>>> { } +>B : Symbol(B, Decl(infinitelyExpandingTypeAssignability.ts, 2, 1)) +>T : Symbol(T, Decl(infinitelyExpandingTypeAssignability.ts, 4, 12)) +>A : Symbol(A, Decl(infinitelyExpandingTypeAssignability.ts, 0, 0)) +>B : Symbol(B, Decl(infinitelyExpandingTypeAssignability.ts, 2, 1)) +>B : Symbol(B, Decl(infinitelyExpandingTypeAssignability.ts, 2, 1)) +>B : Symbol(B, Decl(infinitelyExpandingTypeAssignability.ts, 2, 1)) +>T : Symbol(T, Decl(infinitelyExpandingTypeAssignability.ts, 4, 12)) + +interface C extends A>>> { } +>C : Symbol(C, Decl(infinitelyExpandingTypeAssignability.ts, 4, 40)) +>T : Symbol(T, Decl(infinitelyExpandingTypeAssignability.ts, 6, 12)) +>A : Symbol(A, Decl(infinitelyExpandingTypeAssignability.ts, 0, 0)) +>C : Symbol(C, Decl(infinitelyExpandingTypeAssignability.ts, 4, 40)) +>C : Symbol(C, Decl(infinitelyExpandingTypeAssignability.ts, 4, 40)) +>C : Symbol(C, Decl(infinitelyExpandingTypeAssignability.ts, 4, 40)) +>T : Symbol(T, Decl(infinitelyExpandingTypeAssignability.ts, 6, 12)) + +var x : B +>x : Symbol(x, Decl(infinitelyExpandingTypeAssignability.ts, 8, 3)) +>B : Symbol(B, Decl(infinitelyExpandingTypeAssignability.ts, 2, 1)) + +var y : C = x +>y : Symbol(y, Decl(infinitelyExpandingTypeAssignability.ts, 9, 3)) +>C : Symbol(C, Decl(infinitelyExpandingTypeAssignability.ts, 4, 40)) +>x : Symbol(x, Decl(infinitelyExpandingTypeAssignability.ts, 8, 3)) + diff --git a/tests/baselines/reference/infinitelyExpandingTypes3.symbols b/tests/baselines/reference/infinitelyExpandingTypes3.symbols new file mode 100644 index 00000000000..fbc14afc80f --- /dev/null +++ b/tests/baselines/reference/infinitelyExpandingTypes3.symbols @@ -0,0 +1,54 @@ +=== tests/cases/compiler/infinitelyExpandingTypes3.ts === +interface List { +>List : Symbol(List, Decl(infinitelyExpandingTypes3.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingTypes3.ts, 0, 15)) + + data: T; +>data : Symbol(data, Decl(infinitelyExpandingTypes3.ts, 0, 19)) +>T : Symbol(T, Decl(infinitelyExpandingTypes3.ts, 0, 15)) + + next: List; // will be recursive reference when OwnerList is expanded +>next : Symbol(next, Decl(infinitelyExpandingTypes3.ts, 1, 12)) +>List : Symbol(List, Decl(infinitelyExpandingTypes3.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingTypes3.ts, 0, 15)) + + owner: OwnerList; +>owner : Symbol(owner, Decl(infinitelyExpandingTypes3.ts, 2, 18)) +>OwnerList : Symbol(OwnerList, Decl(infinitelyExpandingTypes3.ts, 4, 1)) +>T : Symbol(T, Decl(infinitelyExpandingTypes3.ts, 0, 15)) +} + +interface OwnerList extends List> { +>OwnerList : Symbol(OwnerList, Decl(infinitelyExpandingTypes3.ts, 4, 1)) +>U : Symbol(U, Decl(infinitelyExpandingTypes3.ts, 6, 20)) +>List : Symbol(List, Decl(infinitelyExpandingTypes3.ts, 0, 0)) +>List : Symbol(List, Decl(infinitelyExpandingTypes3.ts, 0, 0)) +>U : Symbol(U, Decl(infinitelyExpandingTypes3.ts, 6, 20)) + + name: string; +>name : Symbol(name, Decl(infinitelyExpandingTypes3.ts, 6, 46)) +} + +interface OwnerList2 extends List> { +>OwnerList2 : Symbol(OwnerList2, Decl(infinitelyExpandingTypes3.ts, 8, 1)) +>U : Symbol(U, Decl(infinitelyExpandingTypes3.ts, 10, 21)) +>List : Symbol(List, Decl(infinitelyExpandingTypes3.ts, 0, 0)) +>List : Symbol(List, Decl(infinitelyExpandingTypes3.ts, 0, 0)) +>U : Symbol(U, Decl(infinitelyExpandingTypes3.ts, 10, 21)) + + name: string; +>name : Symbol(name, Decl(infinitelyExpandingTypes3.ts, 10, 47)) +} + +var o1: OwnerList; +>o1 : Symbol(o1, Decl(infinitelyExpandingTypes3.ts, 14, 3)) +>OwnerList : Symbol(OwnerList, Decl(infinitelyExpandingTypes3.ts, 4, 1)) + +var o2: OwnerList2; +>o2 : Symbol(o2, Decl(infinitelyExpandingTypes3.ts, 15, 3)) +>OwnerList2 : Symbol(OwnerList2, Decl(infinitelyExpandingTypes3.ts, 8, 1)) + +o1 = o2; // should not error +>o1 : Symbol(o1, Decl(infinitelyExpandingTypes3.ts, 14, 3)) +>o2 : Symbol(o2, Decl(infinitelyExpandingTypes3.ts, 15, 3)) + diff --git a/tests/baselines/reference/infinitelyExpandingTypes4.symbols b/tests/baselines/reference/infinitelyExpandingTypes4.symbols new file mode 100644 index 00000000000..af0aee01216 --- /dev/null +++ b/tests/baselines/reference/infinitelyExpandingTypes4.symbols @@ -0,0 +1,73 @@ +=== tests/cases/compiler/infinitelyExpandingTypes4.ts === +interface Query { +>Query : Symbol(Query, Decl(infinitelyExpandingTypes4.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingTypes4.ts, 0, 16)) + + // ... + groupBy(keySelector: (item: T) => K): Query>; +>groupBy : Symbol(groupBy, Decl(infinitelyExpandingTypes4.ts, 0, 20)) +>K : Symbol(K, Decl(infinitelyExpandingTypes4.ts, 2, 12)) +>keySelector : Symbol(keySelector, Decl(infinitelyExpandingTypes4.ts, 2, 15)) +>item : Symbol(item, Decl(infinitelyExpandingTypes4.ts, 2, 29)) +>T : Symbol(T, Decl(infinitelyExpandingTypes4.ts, 0, 16)) +>K : Symbol(K, Decl(infinitelyExpandingTypes4.ts, 2, 12)) +>Query : Symbol(Query, Decl(infinitelyExpandingTypes4.ts, 0, 0)) +>Grouping : Symbol(Grouping, Decl(infinitelyExpandingTypes4.ts, 10, 1)) +>K : Symbol(K, Decl(infinitelyExpandingTypes4.ts, 2, 12)) +>T : Symbol(T, Decl(infinitelyExpandingTypes4.ts, 0, 16)) + + // ... +} + +interface QueryEnumerator { +>QueryEnumerator : Symbol(QueryEnumerator, Decl(infinitelyExpandingTypes4.ts, 4, 1)) +>T : Symbol(T, Decl(infinitelyExpandingTypes4.ts, 6, 26)) + + // ... + groupBy(keySelector: (item: T) => K): QueryEnumerator>; +>groupBy : Symbol(groupBy, Decl(infinitelyExpandingTypes4.ts, 6, 30)) +>K : Symbol(K, Decl(infinitelyExpandingTypes4.ts, 8, 12)) +>keySelector : Symbol(keySelector, Decl(infinitelyExpandingTypes4.ts, 8, 15)) +>item : Symbol(item, Decl(infinitelyExpandingTypes4.ts, 8, 29)) +>T : Symbol(T, Decl(infinitelyExpandingTypes4.ts, 6, 26)) +>K : Symbol(K, Decl(infinitelyExpandingTypes4.ts, 8, 12)) +>QueryEnumerator : Symbol(QueryEnumerator, Decl(infinitelyExpandingTypes4.ts, 4, 1)) +>Grouping : Symbol(Grouping, Decl(infinitelyExpandingTypes4.ts, 10, 1)) +>K : Symbol(K, Decl(infinitelyExpandingTypes4.ts, 8, 12)) +>T : Symbol(T, Decl(infinitelyExpandingTypes4.ts, 6, 26)) + + // ... +} + +interface Grouping extends Query { +>Grouping : Symbol(Grouping, Decl(infinitelyExpandingTypes4.ts, 10, 1)) +>K : Symbol(K, Decl(infinitelyExpandingTypes4.ts, 12, 19)) +>T : Symbol(T, Decl(infinitelyExpandingTypes4.ts, 12, 21)) +>Query : Symbol(Query, Decl(infinitelyExpandingTypes4.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingTypes4.ts, 12, 21)) + + key(): K; +>key : Symbol(key, Decl(infinitelyExpandingTypes4.ts, 12, 43)) +>K : Symbol(K, Decl(infinitelyExpandingTypes4.ts, 12, 19)) +} + +var q1: Query; +>q1 : Symbol(q1, Decl(infinitelyExpandingTypes4.ts, 16, 3)) +>Query : Symbol(Query, Decl(infinitelyExpandingTypes4.ts, 0, 0)) + +var q2: QueryEnumerator; +>q2 : Symbol(q2, Decl(infinitelyExpandingTypes4.ts, 17, 3)) +>QueryEnumerator : Symbol(QueryEnumerator, Decl(infinitelyExpandingTypes4.ts, 4, 1)) + +var q3: Query; +>q3 : Symbol(q3, Decl(infinitelyExpandingTypes4.ts, 18, 3)) +>Query : Symbol(Query, Decl(infinitelyExpandingTypes4.ts, 0, 0)) + +q1 = q2; // should error +>q1 : Symbol(q1, Decl(infinitelyExpandingTypes4.ts, 16, 3)) +>q2 : Symbol(q2, Decl(infinitelyExpandingTypes4.ts, 17, 3)) + +q1 = q3; // should not error +>q1 : Symbol(q1, Decl(infinitelyExpandingTypes4.ts, 16, 3)) +>q3 : Symbol(q3, Decl(infinitelyExpandingTypes4.ts, 18, 3)) + diff --git a/tests/baselines/reference/infinitelyExpandingTypes5.symbols b/tests/baselines/reference/infinitelyExpandingTypes5.symbols new file mode 100644 index 00000000000..d67d605559e --- /dev/null +++ b/tests/baselines/reference/infinitelyExpandingTypes5.symbols @@ -0,0 +1,49 @@ +=== tests/cases/compiler/infinitelyExpandingTypes5.ts === +interface Query { +>Query : Symbol(Query, Decl(infinitelyExpandingTypes5.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingTypes5.ts, 0, 16)) + + foo(x: T): Query; +>foo : Symbol(foo, Decl(infinitelyExpandingTypes5.ts, 0, 20)) +>x : Symbol(x, Decl(infinitelyExpandingTypes5.ts, 1, 8)) +>T : Symbol(T, Decl(infinitelyExpandingTypes5.ts, 0, 16)) +>Query : Symbol(Query, Decl(infinitelyExpandingTypes5.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingTypes5.ts, 0, 16)) +} + +interface Enumerator { +>Enumerator : Symbol(Enumerator, Decl(infinitelyExpandingTypes5.ts, 2, 1)) +>T : Symbol(T, Decl(infinitelyExpandingTypes5.ts, 4, 21)) + + (action: (item: T, index: number) => boolean): boolean; +>action : Symbol(action, Decl(infinitelyExpandingTypes5.ts, 5, 5)) +>item : Symbol(item, Decl(infinitelyExpandingTypes5.ts, 5, 14)) +>T : Symbol(T, Decl(infinitelyExpandingTypes5.ts, 4, 21)) +>index : Symbol(index, Decl(infinitelyExpandingTypes5.ts, 5, 22)) +} + +function from(array: T[]): Query; +>from : Symbol(from, Decl(infinitelyExpandingTypes5.ts, 6, 1), Decl(infinitelyExpandingTypes5.ts, 8, 39), Decl(infinitelyExpandingTypes5.ts, 9, 54)) +>T : Symbol(T, Decl(infinitelyExpandingTypes5.ts, 8, 14)) +>array : Symbol(array, Decl(infinitelyExpandingTypes5.ts, 8, 17)) +>T : Symbol(T, Decl(infinitelyExpandingTypes5.ts, 8, 14)) +>Query : Symbol(Query, Decl(infinitelyExpandingTypes5.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingTypes5.ts, 8, 14)) + +function from(enumerator: Enumerator): Query; +>from : Symbol(from, Decl(infinitelyExpandingTypes5.ts, 6, 1), Decl(infinitelyExpandingTypes5.ts, 8, 39), Decl(infinitelyExpandingTypes5.ts, 9, 54)) +>T : Symbol(T, Decl(infinitelyExpandingTypes5.ts, 9, 14)) +>enumerator : Symbol(enumerator, Decl(infinitelyExpandingTypes5.ts, 9, 17)) +>Enumerator : Symbol(Enumerator, Decl(infinitelyExpandingTypes5.ts, 2, 1)) +>T : Symbol(T, Decl(infinitelyExpandingTypes5.ts, 9, 14)) +>Query : Symbol(Query, Decl(infinitelyExpandingTypes5.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingTypes5.ts, 9, 14)) + +function from(arg: any): any { +>from : Symbol(from, Decl(infinitelyExpandingTypes5.ts, 6, 1), Decl(infinitelyExpandingTypes5.ts, 8, 39), Decl(infinitelyExpandingTypes5.ts, 9, 54)) +>arg : Symbol(arg, Decl(infinitelyExpandingTypes5.ts, 10, 14)) + + return undefined; +>undefined : Symbol(undefined) +} + diff --git a/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.symbols b/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.symbols new file mode 100644 index 00000000000..dfa5d6e03ed --- /dev/null +++ b/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.symbols @@ -0,0 +1,55 @@ +=== tests/cases/compiler/infinitelyExpandingTypesNonGenericBase.ts === +class Functionality { +>Functionality : Symbol(Functionality, Decl(infinitelyExpandingTypesNonGenericBase.ts, 0, 0)) +>V : Symbol(V, Decl(infinitelyExpandingTypesNonGenericBase.ts, 0, 20)) + + property: Options; +>property : Symbol(property, Decl(infinitelyExpandingTypesNonGenericBase.ts, 0, 24)) +>Options : Symbol(Options, Decl(infinitelyExpandingTypesNonGenericBase.ts, 13, 1)) +>V : Symbol(V, Decl(infinitelyExpandingTypesNonGenericBase.ts, 0, 20)) +} + +class Base { +>Base : Symbol(Base, Decl(infinitelyExpandingTypesNonGenericBase.ts, 2, 1)) +} + +class A extends Base { +>A : Symbol(A, Decl(infinitelyExpandingTypesNonGenericBase.ts, 5, 1)) +>T : Symbol(T, Decl(infinitelyExpandingTypesNonGenericBase.ts, 7, 8)) +>Base : Symbol(Base, Decl(infinitelyExpandingTypesNonGenericBase.ts, 2, 1)) + + options: Options[]>; +>options : Symbol(options, Decl(infinitelyExpandingTypesNonGenericBase.ts, 7, 25)) +>Options : Symbol(Options, Decl(infinitelyExpandingTypesNonGenericBase.ts, 13, 1)) +>Functionality : Symbol(Functionality, Decl(infinitelyExpandingTypesNonGenericBase.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingTypesNonGenericBase.ts, 7, 8)) +} + +interface OptionsBase { +>OptionsBase : Symbol(OptionsBase, Decl(infinitelyExpandingTypesNonGenericBase.ts, 9, 1)) +>T : Symbol(T, Decl(infinitelyExpandingTypesNonGenericBase.ts, 11, 22)) + + Options: Options; +>Options : Symbol(Options, Decl(infinitelyExpandingTypesNonGenericBase.ts, 11, 26)) +>Options : Symbol(Options, Decl(infinitelyExpandingTypesNonGenericBase.ts, 13, 1)) +>T : Symbol(T, Decl(infinitelyExpandingTypesNonGenericBase.ts, 11, 22)) +} + +interface Options extends OptionsBase { +>Options : Symbol(Options, Decl(infinitelyExpandingTypesNonGenericBase.ts, 13, 1)) +>T : Symbol(T, Decl(infinitelyExpandingTypesNonGenericBase.ts, 15, 18)) +>OptionsBase : Symbol(OptionsBase, Decl(infinitelyExpandingTypesNonGenericBase.ts, 9, 1)) +>T : Symbol(T, Decl(infinitelyExpandingTypesNonGenericBase.ts, 15, 18)) +} + + +function o(type: new () => Base) { +>o : Symbol(o, Decl(infinitelyExpandingTypesNonGenericBase.ts, 16, 1)) +>type : Symbol(type, Decl(infinitelyExpandingTypesNonGenericBase.ts, 19, 11)) +>Base : Symbol(Base, Decl(infinitelyExpandingTypesNonGenericBase.ts, 2, 1)) +} + +o(A); +>o : Symbol(o, Decl(infinitelyExpandingTypesNonGenericBase.ts, 16, 1)) +>A : Symbol(A, Decl(infinitelyExpandingTypesNonGenericBase.ts, 5, 1)) + diff --git a/tests/baselines/reference/infinitelyGenerativeInheritance1.symbols b/tests/baselines/reference/infinitelyGenerativeInheritance1.symbols new file mode 100644 index 00000000000..54ecd9c965b --- /dev/null +++ b/tests/baselines/reference/infinitelyGenerativeInheritance1.symbols @@ -0,0 +1,41 @@ +=== tests/cases/compiler/infinitelyGenerativeInheritance1.ts === +interface Stack { +>Stack : Symbol(Stack, Decl(infinitelyGenerativeInheritance1.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyGenerativeInheritance1.ts, 0, 16)) + + pop(): T +>pop : Symbol(pop, Decl(infinitelyGenerativeInheritance1.ts, 0, 20)) +>T : Symbol(T, Decl(infinitelyGenerativeInheritance1.ts, 0, 16)) + + zip(a: Stack): Stack<{ x: T; y: S }> +>zip : Symbol(zip, Decl(infinitelyGenerativeInheritance1.ts, 1, 14)) +>S : Symbol(S, Decl(infinitelyGenerativeInheritance1.ts, 2, 10)) +>a : Symbol(a, Decl(infinitelyGenerativeInheritance1.ts, 2, 13)) +>Stack : Symbol(Stack, Decl(infinitelyGenerativeInheritance1.ts, 0, 0)) +>S : Symbol(S, Decl(infinitelyGenerativeInheritance1.ts, 2, 10)) +>Stack : Symbol(Stack, Decl(infinitelyGenerativeInheritance1.ts, 0, 0)) +>x : Symbol(x, Decl(infinitelyGenerativeInheritance1.ts, 2, 34)) +>T : Symbol(T, Decl(infinitelyGenerativeInheritance1.ts, 0, 16)) +>y : Symbol(y, Decl(infinitelyGenerativeInheritance1.ts, 2, 40)) +>S : Symbol(S, Decl(infinitelyGenerativeInheritance1.ts, 2, 10)) +} + +interface MyStack extends Stack { +>MyStack : Symbol(MyStack, Decl(infinitelyGenerativeInheritance1.ts, 3, 1)) +>T : Symbol(T, Decl(infinitelyGenerativeInheritance1.ts, 5, 18)) +>Stack : Symbol(Stack, Decl(infinitelyGenerativeInheritance1.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyGenerativeInheritance1.ts, 5, 18)) + + zip(a: Stack): Stack<{ x: T; y: S }> +>zip : Symbol(zip, Decl(infinitelyGenerativeInheritance1.ts, 5, 39)) +>S : Symbol(S, Decl(infinitelyGenerativeInheritance1.ts, 6, 10)) +>a : Symbol(a, Decl(infinitelyGenerativeInheritance1.ts, 6, 13)) +>Stack : Symbol(Stack, Decl(infinitelyGenerativeInheritance1.ts, 0, 0)) +>S : Symbol(S, Decl(infinitelyGenerativeInheritance1.ts, 6, 10)) +>Stack : Symbol(Stack, Decl(infinitelyGenerativeInheritance1.ts, 0, 0)) +>x : Symbol(x, Decl(infinitelyGenerativeInheritance1.ts, 6, 34)) +>T : Symbol(T, Decl(infinitelyGenerativeInheritance1.ts, 5, 18)) +>y : Symbol(y, Decl(infinitelyGenerativeInheritance1.ts, 6, 40)) +>S : Symbol(S, Decl(infinitelyGenerativeInheritance1.ts, 6, 10)) +} + diff --git a/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.symbols b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.symbols new file mode 100644 index 00000000000..55655889ca4 --- /dev/null +++ b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/inheritSameNamePrivatePropertiesFromSameOrigin.ts === +class B { +>B : Symbol(B, Decl(inheritSameNamePrivatePropertiesFromSameOrigin.ts, 0, 0)) + + private x: number; +>x : Symbol(x, Decl(inheritSameNamePrivatePropertiesFromSameOrigin.ts, 0, 9)) +} +class C extends B { } +>C : Symbol(C, Decl(inheritSameNamePrivatePropertiesFromSameOrigin.ts, 2, 1)) +>B : Symbol(B, Decl(inheritSameNamePrivatePropertiesFromSameOrigin.ts, 0, 0)) + +class C2 extends B { } +>C2 : Symbol(C2, Decl(inheritSameNamePrivatePropertiesFromSameOrigin.ts, 3, 21)) +>B : Symbol(B, Decl(inheritSameNamePrivatePropertiesFromSameOrigin.ts, 0, 0)) + +interface A extends C, C2 { // ok +>A : Symbol(A, Decl(inheritSameNamePrivatePropertiesFromSameOrigin.ts, 5, 22)) +>C : Symbol(C, Decl(inheritSameNamePrivatePropertiesFromSameOrigin.ts, 2, 1)) +>C2 : Symbol(C2, Decl(inheritSameNamePrivatePropertiesFromSameOrigin.ts, 3, 21)) + + y: string; +>y : Symbol(y, Decl(inheritSameNamePrivatePropertiesFromSameOrigin.ts, 7, 27)) +} diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.symbols b/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.symbols new file mode 100644 index 00000000000..4c496fcc240 --- /dev/null +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/inheritanceMemberFuncOverridingMethod.ts === +class a { +>a : Symbol(a, Decl(inheritanceMemberFuncOverridingMethod.ts, 0, 0)) + + x() { +>x : Symbol(x, Decl(inheritanceMemberFuncOverridingMethod.ts, 0, 9)) + + return "10"; + } +} + +class b extends a { +>b : Symbol(b, Decl(inheritanceMemberFuncOverridingMethod.ts, 4, 1)) +>a : Symbol(a, Decl(inheritanceMemberFuncOverridingMethod.ts, 0, 0)) + + x() { +>x : Symbol(x, Decl(inheritanceMemberFuncOverridingMethod.ts, 6, 19)) + + return "20"; + } +} diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.types b/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.types index e30d307e943..3f170d1a6ec 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.types +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.types @@ -6,6 +6,7 @@ class a { >x : () => string return "10"; +>"10" : string } } @@ -17,5 +18,6 @@ class b extends a { >x : () => string return "20"; +>"20" : string } } diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.symbols b/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.symbols new file mode 100644 index 00000000000..bf755882165 --- /dev/null +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/inheritanceMemberPropertyOverridingProperty.ts === +class a { +>a : Symbol(a, Decl(inheritanceMemberPropertyOverridingProperty.ts, 0, 0)) + + x: () => string; +>x : Symbol(x, Decl(inheritanceMemberPropertyOverridingProperty.ts, 0, 9)) +} + +class b extends a { +>b : Symbol(b, Decl(inheritanceMemberPropertyOverridingProperty.ts, 2, 1)) +>a : Symbol(a, Decl(inheritanceMemberPropertyOverridingProperty.ts, 0, 0)) + + x: () => string; +>x : Symbol(x, Decl(inheritanceMemberPropertyOverridingProperty.ts, 4, 19)) +} diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.symbols b/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.symbols new file mode 100644 index 00000000000..9c65c2e3655 --- /dev/null +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/inheritanceOfGenericConstructorMethod1.ts === +class A { } +>A : Symbol(A, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 0)) +>T : Symbol(T, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 8)) + +class B extends A {} +>B : Symbol(B, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 14)) +>T : Symbol(T, Decl(inheritanceOfGenericConstructorMethod1.ts, 1, 8)) +>A : Symbol(A, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 0)) +>T : Symbol(T, Decl(inheritanceOfGenericConstructorMethod1.ts, 1, 8)) + +var a = new A(); +>a : Symbol(a, Decl(inheritanceOfGenericConstructorMethod1.ts, 2, 3)) +>A : Symbol(A, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 0)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var b1 = new B(); // no error +>b1 : Symbol(b1, Decl(inheritanceOfGenericConstructorMethod1.ts, 3, 3)) +>B : Symbol(B, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 14)) + +var b2: B = new B(); // no error +>b2 : Symbol(b2, Decl(inheritanceOfGenericConstructorMethod1.ts, 4, 3)) +>B : Symbol(B, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 14)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>B : Symbol(B, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 14)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var b3 = new B(); // error, could not select overload for 'new' expression +>b3 : Symbol(b3, Decl(inheritanceOfGenericConstructorMethod1.ts, 5, 3)) +>B : Symbol(B, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 14)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.symbols b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.symbols new file mode 100644 index 00000000000..8fe59ed1927 --- /dev/null +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.symbols @@ -0,0 +1,53 @@ +=== tests/cases/compiler/inheritanceOfGenericConstructorMethod2.ts === +module M { +>M : Symbol(M, Decl(inheritanceOfGenericConstructorMethod2.ts, 0, 0)) + + export class C1 { } +>C1 : Symbol(C1, Decl(inheritanceOfGenericConstructorMethod2.ts, 0, 10)) + + export class C2 { } +>C2 : Symbol(C2, Decl(inheritanceOfGenericConstructorMethod2.ts, 1, 22)) +>T : Symbol(T, Decl(inheritanceOfGenericConstructorMethod2.ts, 2, 19)) +} +module N { +>N : Symbol(N, Decl(inheritanceOfGenericConstructorMethod2.ts, 3, 1)) + + export class D1 extends M.C1 { } +>D1 : Symbol(D1, Decl(inheritanceOfGenericConstructorMethod2.ts, 4, 10)) +>M.C1 : Symbol(M.C1, Decl(inheritanceOfGenericConstructorMethod2.ts, 0, 10)) +>M : Symbol(M, Decl(inheritanceOfGenericConstructorMethod2.ts, 0, 0)) +>C1 : Symbol(M.C1, Decl(inheritanceOfGenericConstructorMethod2.ts, 0, 10)) + + export class D2 extends M.C2 { } +>D2 : Symbol(D2, Decl(inheritanceOfGenericConstructorMethod2.ts, 5, 35)) +>T : Symbol(T, Decl(inheritanceOfGenericConstructorMethod2.ts, 6, 19)) +>M.C2 : Symbol(M.C2, Decl(inheritanceOfGenericConstructorMethod2.ts, 1, 22)) +>M : Symbol(M, Decl(inheritanceOfGenericConstructorMethod2.ts, 0, 0)) +>C2 : Symbol(M.C2, Decl(inheritanceOfGenericConstructorMethod2.ts, 1, 22)) +>T : Symbol(T, Decl(inheritanceOfGenericConstructorMethod2.ts, 6, 19)) +} + +var c = new M.C2(); // no error +>c : Symbol(c, Decl(inheritanceOfGenericConstructorMethod2.ts, 9, 3)) +>M.C2 : Symbol(M.C2, Decl(inheritanceOfGenericConstructorMethod2.ts, 1, 22)) +>M : Symbol(M, Decl(inheritanceOfGenericConstructorMethod2.ts, 0, 0)) +>C2 : Symbol(M.C2, Decl(inheritanceOfGenericConstructorMethod2.ts, 1, 22)) + +var n = new N.D1(); // no error +>n : Symbol(n, Decl(inheritanceOfGenericConstructorMethod2.ts, 10, 3)) +>N.D1 : Symbol(N.D1, Decl(inheritanceOfGenericConstructorMethod2.ts, 4, 10)) +>N : Symbol(N, Decl(inheritanceOfGenericConstructorMethod2.ts, 3, 1)) +>D1 : Symbol(N.D1, Decl(inheritanceOfGenericConstructorMethod2.ts, 4, 10)) + +var n2 = new N.D2(); // error +>n2 : Symbol(n2, Decl(inheritanceOfGenericConstructorMethod2.ts, 11, 3)) +>N.D2 : Symbol(N.D2, Decl(inheritanceOfGenericConstructorMethod2.ts, 5, 35)) +>N : Symbol(N, Decl(inheritanceOfGenericConstructorMethod2.ts, 3, 1)) +>D2 : Symbol(N.D2, Decl(inheritanceOfGenericConstructorMethod2.ts, 5, 35)) + +var n3 = new N.D2(); // no error, D2 +>n3 : Symbol(n3, Decl(inheritanceOfGenericConstructorMethod2.ts, 12, 3)) +>N.D2 : Symbol(N.D2, Decl(inheritanceOfGenericConstructorMethod2.ts, 5, 35)) +>N : Symbol(N, Decl(inheritanceOfGenericConstructorMethod2.ts, 3, 1)) +>D2 : Symbol(N.D2, Decl(inheritanceOfGenericConstructorMethod2.ts, 5, 35)) + diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.types b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.types index 69b2ebb608d..119b6a19046 100644 --- a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.types +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.types @@ -14,12 +14,14 @@ module N { export class D1 extends M.C1 { } >D1 : D1 +>M.C1 : any >M : typeof M >C1 : M.C1 export class D2 extends M.C2 { } >D2 : D2 >T : T +>M.C2 : any >M : typeof M >C2 : M.C2 >T : T diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.symbols b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.symbols new file mode 100644 index 00000000000..55e595e89be --- /dev/null +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/inheritanceStaticFuncOverridingMethod.ts === +class a { +>a : Symbol(a, Decl(inheritanceStaticFuncOverridingMethod.ts, 0, 0)) + + static x() { +>x : Symbol(a.x, Decl(inheritanceStaticFuncOverridingMethod.ts, 0, 9)) + + return "10"; + } +} + +class b extends a { +>b : Symbol(b, Decl(inheritanceStaticFuncOverridingMethod.ts, 4, 1)) +>a : Symbol(a, Decl(inheritanceStaticFuncOverridingMethod.ts, 0, 0)) + + static x() { +>x : Symbol(b.x, Decl(inheritanceStaticFuncOverridingMethod.ts, 6, 19)) + + return "20"; + } +} diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.types b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.types index ec7b3f5bbf9..22fa0a6660f 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.types +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.types @@ -6,6 +6,7 @@ class a { >x : () => string return "10"; +>"10" : string } } @@ -17,5 +18,6 @@ class b extends a { >x : () => string return "20"; +>"20" : string } } diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.symbols b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.symbols new file mode 100644 index 00000000000..50a8db2e792 --- /dev/null +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/inheritanceStaticFuncOverridingPropertyOfFuncType.ts === +class a { +>a : Symbol(a, Decl(inheritanceStaticFuncOverridingPropertyOfFuncType.ts, 0, 0)) + + static x: () => string; +>x : Symbol(a.x, Decl(inheritanceStaticFuncOverridingPropertyOfFuncType.ts, 0, 9)) +} + +class b extends a { +>b : Symbol(b, Decl(inheritanceStaticFuncOverridingPropertyOfFuncType.ts, 2, 1)) +>a : Symbol(a, Decl(inheritanceStaticFuncOverridingPropertyOfFuncType.ts, 0, 0)) + + static x() { +>x : Symbol(b.x, Decl(inheritanceStaticFuncOverridingPropertyOfFuncType.ts, 4, 19)) + + return "20"; + } +} diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.types b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.types index 842f9ffddf9..a7df20382ec 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.types +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.types @@ -14,5 +14,6 @@ class b extends a { >x : () => string return "20"; +>"20" : string } } diff --git a/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.symbols b/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.symbols new file mode 100644 index 00000000000..bf2f3d3aa15 --- /dev/null +++ b/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/inheritanceStaticFunctionOverridingInstanceProperty.ts === +class a { +>a : Symbol(a, Decl(inheritanceStaticFunctionOverridingInstanceProperty.ts, 0, 0)) + + x: string; +>x : Symbol(x, Decl(inheritanceStaticFunctionOverridingInstanceProperty.ts, 0, 9)) +} + +class b extends a { +>b : Symbol(b, Decl(inheritanceStaticFunctionOverridingInstanceProperty.ts, 2, 1)) +>a : Symbol(a, Decl(inheritanceStaticFunctionOverridingInstanceProperty.ts, 0, 0)) + + static x() { +>x : Symbol(b.x, Decl(inheritanceStaticFunctionOverridingInstanceProperty.ts, 4, 19)) + + return new b().x; +>new b().x : Symbol(a.x, Decl(inheritanceStaticFunctionOverridingInstanceProperty.ts, 0, 9)) +>b : Symbol(b, Decl(inheritanceStaticFunctionOverridingInstanceProperty.ts, 2, 1)) +>x : Symbol(a.x, Decl(inheritanceStaticFunctionOverridingInstanceProperty.ts, 0, 9)) + } +} diff --git a/tests/baselines/reference/inheritanceStaticMembersCompatible.symbols b/tests/baselines/reference/inheritanceStaticMembersCompatible.symbols new file mode 100644 index 00000000000..da502ae6428 --- /dev/null +++ b/tests/baselines/reference/inheritanceStaticMembersCompatible.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/inheritanceStaticMembersCompatible.ts === +class a { +>a : Symbol(a, Decl(inheritanceStaticMembersCompatible.ts, 0, 0)) + + static x: a; +>x : Symbol(a.x, Decl(inheritanceStaticMembersCompatible.ts, 0, 9)) +>a : Symbol(a, Decl(inheritanceStaticMembersCompatible.ts, 0, 0)) +} + +class b extends a { +>b : Symbol(b, Decl(inheritanceStaticMembersCompatible.ts, 2, 1)) +>a : Symbol(a, Decl(inheritanceStaticMembersCompatible.ts, 0, 0)) + + static x: b; +>x : Symbol(b.x, Decl(inheritanceStaticMembersCompatible.ts, 4, 19)) +>b : Symbol(b, Decl(inheritanceStaticMembersCompatible.ts, 2, 1)) +} diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.symbols b/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.symbols new file mode 100644 index 00000000000..a084b245815 --- /dev/null +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/inheritanceStaticPropertyOverridingProperty.ts === +class a { +>a : Symbol(a, Decl(inheritanceStaticPropertyOverridingProperty.ts, 0, 0)) + + static x: () => string; +>x : Symbol(a.x, Decl(inheritanceStaticPropertyOverridingProperty.ts, 0, 9)) +} + +class b extends a { +>b : Symbol(b, Decl(inheritanceStaticPropertyOverridingProperty.ts, 2, 1)) +>a : Symbol(a, Decl(inheritanceStaticPropertyOverridingProperty.ts, 0, 0)) + + static x: () => string; +>x : Symbol(b.x, Decl(inheritanceStaticPropertyOverridingProperty.ts, 4, 19)) +} diff --git a/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.symbols b/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.symbols new file mode 100644 index 00000000000..a76a4aad7fa --- /dev/null +++ b/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/inheritedFunctionAssignmentCompatibility.ts === +interface IResultCallback extends Function { } +>IResultCallback : Symbol(IResultCallback, Decl(inheritedFunctionAssignmentCompatibility.ts, 0, 0)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) + +function fn(cb: IResultCallback) { } +>fn : Symbol(fn, Decl(inheritedFunctionAssignmentCompatibility.ts, 0, 46)) +>cb : Symbol(cb, Decl(inheritedFunctionAssignmentCompatibility.ts, 2, 12)) +>IResultCallback : Symbol(IResultCallback, Decl(inheritedFunctionAssignmentCompatibility.ts, 0, 0)) + +fn((a, b) => true); +>fn : Symbol(fn, Decl(inheritedFunctionAssignmentCompatibility.ts, 0, 46)) +>a : Symbol(a, Decl(inheritedFunctionAssignmentCompatibility.ts, 4, 4)) +>b : Symbol(b, Decl(inheritedFunctionAssignmentCompatibility.ts, 4, 6)) + +fn(function (a, b) { return true; }) +>fn : Symbol(fn, Decl(inheritedFunctionAssignmentCompatibility.ts, 0, 46)) +>a : Symbol(a, Decl(inheritedFunctionAssignmentCompatibility.ts, 5, 13)) +>b : Symbol(b, Decl(inheritedFunctionAssignmentCompatibility.ts, 5, 15)) + + diff --git a/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.types b/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.types index c24c0545c3e..b13fde1189a 100644 --- a/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.types +++ b/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.types @@ -14,6 +14,7 @@ fn((a, b) => true); >(a, b) => true : (a: any, b: any) => boolean >a : any >b : any +>true : boolean fn(function (a, b) { return true; }) >fn(function (a, b) { return true; }) : void @@ -21,5 +22,6 @@ fn(function (a, b) { return true; }) >function (a, b) { return true; } : (a: any, b: any) => boolean >a : any >b : any +>true : boolean diff --git a/tests/baselines/reference/inheritedGenericCallSignature.symbols b/tests/baselines/reference/inheritedGenericCallSignature.symbols new file mode 100644 index 00000000000..49170401165 --- /dev/null +++ b/tests/baselines/reference/inheritedGenericCallSignature.symbols @@ -0,0 +1,50 @@ +=== tests/cases/compiler/inheritedGenericCallSignature.ts === + +interface I1 { +>I1 : Symbol(I1, Decl(inheritedGenericCallSignature.ts, 0, 0)) +>T : Symbol(T, Decl(inheritedGenericCallSignature.ts, 1, 13)) + + (a: T): T; +>a : Symbol(a, Decl(inheritedGenericCallSignature.ts, 3, 5)) +>T : Symbol(T, Decl(inheritedGenericCallSignature.ts, 1, 13)) +>T : Symbol(T, Decl(inheritedGenericCallSignature.ts, 1, 13)) + +} + + +interface Object {} +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11), Decl(inheritedGenericCallSignature.ts, 5, 1)) + + + +interface I2 extends I1 { +>I2 : Symbol(I2, Decl(inheritedGenericCallSignature.ts, 8, 19)) +>T : Symbol(T, Decl(inheritedGenericCallSignature.ts, 12, 13)) +>I1 : Symbol(I1, Decl(inheritedGenericCallSignature.ts, 0, 0)) +>T : Symbol(T, Decl(inheritedGenericCallSignature.ts, 12, 13)) + + b: T; +>b : Symbol(b, Decl(inheritedGenericCallSignature.ts, 12, 33)) +>T : Symbol(T, Decl(inheritedGenericCallSignature.ts, 12, 13)) + +} + + + +var x: I2; +>x : Symbol(x, Decl(inheritedGenericCallSignature.ts, 20, 3)) +>I2 : Symbol(I2, Decl(inheritedGenericCallSignature.ts, 8, 19)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + + +var y = x(undefined); +>y : Symbol(y, Decl(inheritedGenericCallSignature.ts, 24, 3)) +>x : Symbol(x, Decl(inheritedGenericCallSignature.ts, 20, 3)) +>undefined : Symbol(undefined) + +y.length; // should not error +>y.length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>y : Symbol(y, Decl(inheritedGenericCallSignature.ts, 24, 3)) +>length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) + diff --git a/tests/baselines/reference/inheritedMembersAndIndexSignaturesFromDifferentBases2.symbols b/tests/baselines/reference/inheritedMembersAndIndexSignaturesFromDifferentBases2.symbols new file mode 100644 index 00000000000..2cc31a14f7f --- /dev/null +++ b/tests/baselines/reference/inheritedMembersAndIndexSignaturesFromDifferentBases2.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/inheritedMembersAndIndexSignaturesFromDifferentBases2.ts === +interface A { +>A : Symbol(A, Decl(inheritedMembersAndIndexSignaturesFromDifferentBases2.ts, 0, 0)) +>T : Symbol(T, Decl(inheritedMembersAndIndexSignaturesFromDifferentBases2.ts, 0, 12)) + + [n: number]: T; +>n : Symbol(n, Decl(inheritedMembersAndIndexSignaturesFromDifferentBases2.ts, 1, 5)) +>T : Symbol(T, Decl(inheritedMembersAndIndexSignaturesFromDifferentBases2.ts, 0, 12)) +} + +interface B { +>B : Symbol(B, Decl(inheritedMembersAndIndexSignaturesFromDifferentBases2.ts, 2, 1)) + + foo: number; +>foo : Symbol(foo, Decl(inheritedMembersAndIndexSignaturesFromDifferentBases2.ts, 4, 13)) +} + +interface C extends B, A { } // Should succeed +>C : Symbol(C, Decl(inheritedMembersAndIndexSignaturesFromDifferentBases2.ts, 6, 1)) +>B : Symbol(B, Decl(inheritedMembersAndIndexSignaturesFromDifferentBases2.ts, 2, 1)) +>A : Symbol(A, Decl(inheritedMembersAndIndexSignaturesFromDifferentBases2.ts, 0, 0)) + diff --git a/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.symbols b/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.symbols new file mode 100644 index 00000000000..1b1c6b21beb --- /dev/null +++ b/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.symbols @@ -0,0 +1,124 @@ +=== tests/cases/compiler/inheritedOverloadedSpecializedSignatures.ts === +interface A { +>A : Symbol(A, Decl(inheritedOverloadedSpecializedSignatures.ts, 0, 0), Decl(inheritedOverloadedSpecializedSignatures.ts, 10, 19), Decl(inheritedOverloadedSpecializedSignatures.ts, 19, 1)) + + (key:string):void; +>key : Symbol(key, Decl(inheritedOverloadedSpecializedSignatures.ts, 1, 3)) +} + +interface B extends A { +>B : Symbol(B, Decl(inheritedOverloadedSpecializedSignatures.ts, 2, 1), Decl(inheritedOverloadedSpecializedSignatures.ts, 15, 1), Decl(inheritedOverloadedSpecializedSignatures.ts, 23, 1)) +>A : Symbol(A, Decl(inheritedOverloadedSpecializedSignatures.ts, 0, 0), Decl(inheritedOverloadedSpecializedSignatures.ts, 10, 19), Decl(inheritedOverloadedSpecializedSignatures.ts, 19, 1)) + + (key:'foo'):string; +>key : Symbol(key, Decl(inheritedOverloadedSpecializedSignatures.ts, 5, 3)) +} + +var b:B; +>b : Symbol(b, Decl(inheritedOverloadedSpecializedSignatures.ts, 8, 3)) +>B : Symbol(B, Decl(inheritedOverloadedSpecializedSignatures.ts, 2, 1), Decl(inheritedOverloadedSpecializedSignatures.ts, 15, 1), Decl(inheritedOverloadedSpecializedSignatures.ts, 23, 1)) + +// Should not error +b('foo').charAt(0); +>b('foo').charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>b : Symbol(b, Decl(inheritedOverloadedSpecializedSignatures.ts, 8, 3)) +>charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) + +interface A { +>A : Symbol(A, Decl(inheritedOverloadedSpecializedSignatures.ts, 0, 0), Decl(inheritedOverloadedSpecializedSignatures.ts, 10, 19), Decl(inheritedOverloadedSpecializedSignatures.ts, 19, 1)) + + (x: 'A1'): string; +>x : Symbol(x, Decl(inheritedOverloadedSpecializedSignatures.ts, 13, 5)) + + (x: string): void; +>x : Symbol(x, Decl(inheritedOverloadedSpecializedSignatures.ts, 14, 5)) +} + +interface B extends A { +>B : Symbol(B, Decl(inheritedOverloadedSpecializedSignatures.ts, 2, 1), Decl(inheritedOverloadedSpecializedSignatures.ts, 15, 1), Decl(inheritedOverloadedSpecializedSignatures.ts, 23, 1)) +>A : Symbol(A, Decl(inheritedOverloadedSpecializedSignatures.ts, 0, 0), Decl(inheritedOverloadedSpecializedSignatures.ts, 10, 19), Decl(inheritedOverloadedSpecializedSignatures.ts, 19, 1)) + + (x: 'B1'): number; +>x : Symbol(x, Decl(inheritedOverloadedSpecializedSignatures.ts, 18, 5)) +} + +interface A { +>A : Symbol(A, Decl(inheritedOverloadedSpecializedSignatures.ts, 0, 0), Decl(inheritedOverloadedSpecializedSignatures.ts, 10, 19), Decl(inheritedOverloadedSpecializedSignatures.ts, 19, 1)) + + (x: 'A2'): boolean; +>x : Symbol(x, Decl(inheritedOverloadedSpecializedSignatures.ts, 22, 5)) +} + +interface B { +>B : Symbol(B, Decl(inheritedOverloadedSpecializedSignatures.ts, 2, 1), Decl(inheritedOverloadedSpecializedSignatures.ts, 15, 1), Decl(inheritedOverloadedSpecializedSignatures.ts, 23, 1)) + + (x: 'B2'): string[]; +>x : Symbol(x, Decl(inheritedOverloadedSpecializedSignatures.ts, 26, 5)) +} + +interface C1 extends B { +>C1 : Symbol(C1, Decl(inheritedOverloadedSpecializedSignatures.ts, 27, 1)) +>B : Symbol(B, Decl(inheritedOverloadedSpecializedSignatures.ts, 2, 1), Decl(inheritedOverloadedSpecializedSignatures.ts, 15, 1), Decl(inheritedOverloadedSpecializedSignatures.ts, 23, 1)) + + (x: 'C1'): number[]; +>x : Symbol(x, Decl(inheritedOverloadedSpecializedSignatures.ts, 30, 2)) +} + +interface C2 extends B { +>C2 : Symbol(C2, Decl(inheritedOverloadedSpecializedSignatures.ts, 31, 1)) +>B : Symbol(B, Decl(inheritedOverloadedSpecializedSignatures.ts, 2, 1), Decl(inheritedOverloadedSpecializedSignatures.ts, 15, 1), Decl(inheritedOverloadedSpecializedSignatures.ts, 23, 1)) + + (x: 'C2'): boolean[]; +>x : Symbol(x, Decl(inheritedOverloadedSpecializedSignatures.ts, 34, 2)) +} + +interface C extends C1, C2 { +>C : Symbol(C, Decl(inheritedOverloadedSpecializedSignatures.ts, 35, 1)) +>C1 : Symbol(C1, Decl(inheritedOverloadedSpecializedSignatures.ts, 27, 1)) +>C2 : Symbol(C2, Decl(inheritedOverloadedSpecializedSignatures.ts, 31, 1)) + + (x: 'C'): string; +>x : Symbol(x, Decl(inheritedOverloadedSpecializedSignatures.ts, 38, 2)) +} + +var c: C; +>c : Symbol(c, Decl(inheritedOverloadedSpecializedSignatures.ts, 41, 3)) +>C : Symbol(C, Decl(inheritedOverloadedSpecializedSignatures.ts, 35, 1)) + +// none of these lines should error +var x1: string[] = c('B2'); +>x1 : Symbol(x1, Decl(inheritedOverloadedSpecializedSignatures.ts, 43, 3)) +>c : Symbol(c, Decl(inheritedOverloadedSpecializedSignatures.ts, 41, 3)) + +var x2: number = c('B1'); +>x2 : Symbol(x2, Decl(inheritedOverloadedSpecializedSignatures.ts, 44, 3)) +>c : Symbol(c, Decl(inheritedOverloadedSpecializedSignatures.ts, 41, 3)) + +var x3: boolean = c('A2'); +>x3 : Symbol(x3, Decl(inheritedOverloadedSpecializedSignatures.ts, 45, 3)) +>c : Symbol(c, Decl(inheritedOverloadedSpecializedSignatures.ts, 41, 3)) + +var x4: string = c('A1'); +>x4 : Symbol(x4, Decl(inheritedOverloadedSpecializedSignatures.ts, 46, 3)) +>c : Symbol(c, Decl(inheritedOverloadedSpecializedSignatures.ts, 41, 3)) + +var x5: void = c('A0'); +>x5 : Symbol(x5, Decl(inheritedOverloadedSpecializedSignatures.ts, 47, 3)) +>c : Symbol(c, Decl(inheritedOverloadedSpecializedSignatures.ts, 41, 3)) + +var x6: number[] = c('C1'); +>x6 : Symbol(x6, Decl(inheritedOverloadedSpecializedSignatures.ts, 48, 3)) +>c : Symbol(c, Decl(inheritedOverloadedSpecializedSignatures.ts, 41, 3)) + +var x7: boolean[] = c('C2'); +>x7 : Symbol(x7, Decl(inheritedOverloadedSpecializedSignatures.ts, 49, 3)) +>c : Symbol(c, Decl(inheritedOverloadedSpecializedSignatures.ts, 41, 3)) + +var x8: string = c('C'); +>x8 : Symbol(x8, Decl(inheritedOverloadedSpecializedSignatures.ts, 50, 3)) +>c : Symbol(c, Decl(inheritedOverloadedSpecializedSignatures.ts, 41, 3)) + +var x9: void = c('generic'); +>x9 : Symbol(x9, Decl(inheritedOverloadedSpecializedSignatures.ts, 51, 3)) +>c : Symbol(c, Decl(inheritedOverloadedSpecializedSignatures.ts, 41, 3)) + diff --git a/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.types b/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.types index dcbab74b681..dc8b9b465d8 100644 --- a/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.types +++ b/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.types @@ -24,7 +24,9 @@ b('foo').charAt(0); >b('foo').charAt : (pos: number) => string >b('foo') : string >b : B +>'foo' : string >charAt : (pos: number) => string +>0 : number interface A { >A : A @@ -92,44 +94,53 @@ var x1: string[] = c('B2'); >x1 : string[] >c('B2') : string[] >c : C +>'B2' : string var x2: number = c('B1'); >x2 : number >c('B1') : number >c : C +>'B1' : string var x3: boolean = c('A2'); >x3 : boolean >c('A2') : boolean >c : C +>'A2' : string var x4: string = c('A1'); >x4 : string >c('A1') : string >c : C +>'A1' : string var x5: void = c('A0'); >x5 : void >c('A0') : void >c : C +>'A0' : string var x6: number[] = c('C1'); >x6 : number[] >c('C1') : number[] >c : C +>'C1' : string var x7: boolean[] = c('C2'); >x7 : boolean[] >c('C2') : boolean[] >c : C +>'C2' : string var x8: string = c('C'); >x8 : string >c('C') : string >c : C +>'C' : string var x9: void = c('generic'); >x9 : void >c('generic') : void >c : C +>'generic' : string diff --git a/tests/baselines/reference/initializePropertiesWithRenamedLet.js b/tests/baselines/reference/initializePropertiesWithRenamedLet.js index d4f985bea56..d53fed8c0f7 100644 --- a/tests/baselines/reference/initializePropertiesWithRenamedLet.js +++ b/tests/baselines/reference/initializePropertiesWithRenamedLet.js @@ -25,8 +25,8 @@ if (true) { } 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); diff --git a/tests/baselines/reference/initializePropertiesWithRenamedLet.symbols b/tests/baselines/reference/initializePropertiesWithRenamedLet.symbols new file mode 100644 index 00000000000..203508ddf98 --- /dev/null +++ b/tests/baselines/reference/initializePropertiesWithRenamedLet.symbols @@ -0,0 +1,45 @@ +=== tests/cases/compiler/initializePropertiesWithRenamedLet.ts === + +var x0; +>x0 : Symbol(x0, Decl(initializePropertiesWithRenamedLet.ts, 1, 3)) + +if (true) { + let x0; +>x0 : Symbol(x0, Decl(initializePropertiesWithRenamedLet.ts, 3, 7)) + + var obj1 = { x0: x0 }; +>obj1 : Symbol(obj1, Decl(initializePropertiesWithRenamedLet.ts, 4, 7)) +>x0 : Symbol(x0, Decl(initializePropertiesWithRenamedLet.ts, 4, 16)) +>x0 : Symbol(x0, Decl(initializePropertiesWithRenamedLet.ts, 3, 7)) + + var obj2 = { x0 }; +>obj2 : Symbol(obj2, Decl(initializePropertiesWithRenamedLet.ts, 5, 7)) +>x0 : Symbol(x0, Decl(initializePropertiesWithRenamedLet.ts, 5, 16)) +} + +var x, y, z; +>x : Symbol(x, Decl(initializePropertiesWithRenamedLet.ts, 8, 3)) +>y : Symbol(y, Decl(initializePropertiesWithRenamedLet.ts, 8, 6)) +>z : Symbol(z, Decl(initializePropertiesWithRenamedLet.ts, 8, 9)) + +if (true) { + let { x: x } = { x: 0 }; +>x : Symbol(x, Decl(initializePropertiesWithRenamedLet.ts, 10, 9)) +>x : Symbol(x, Decl(initializePropertiesWithRenamedLet.ts, 10, 20)) + + let { y } = { y: 0 }; +>y : Symbol(y, Decl(initializePropertiesWithRenamedLet.ts, 11, 9)) +>y : Symbol(y, Decl(initializePropertiesWithRenamedLet.ts, 11, 17)) + + let z; +>z : Symbol(z, Decl(initializePropertiesWithRenamedLet.ts, 12, 7)) + + ({ z: z } = { z: 0 }); +>z : Symbol(z, Decl(initializePropertiesWithRenamedLet.ts, 13, 6)) +>z : Symbol(z, Decl(initializePropertiesWithRenamedLet.ts, 12, 7)) +>z : Symbol(z, Decl(initializePropertiesWithRenamedLet.ts, 13, 17)) + + ({ z } = { z: 0 }); +>z : Symbol(z, Decl(initializePropertiesWithRenamedLet.ts, 14, 6)) +>z : Symbol(z, Decl(initializePropertiesWithRenamedLet.ts, 14, 14)) +} diff --git a/tests/baselines/reference/initializePropertiesWithRenamedLet.types b/tests/baselines/reference/initializePropertiesWithRenamedLet.types index 77f16756fdb..3c6938cd643 100644 --- a/tests/baselines/reference/initializePropertiesWithRenamedLet.types +++ b/tests/baselines/reference/initializePropertiesWithRenamedLet.types @@ -4,6 +4,8 @@ var x0; >x0 : any if (true) { +>true : boolean + let x0; >x0 : any @@ -25,16 +27,20 @@ var x, y, z; >z : any if (true) { +>true : boolean + let { x: x } = { x: 0 }; ->x : unknown +>x : any >x : number >{ x: 0 } : { x: number; } >x : number +>0 : number let { y } = { y: 0 }; >y : number >{ y: 0 } : { y: number; } >y : number +>0 : number let z; >z : any @@ -47,6 +53,7 @@ if (true) { >z : any >{ z: 0 } : { z: number; } >z : number +>0 : number ({ z } = { z: 0 }); >({ z } = { z: 0 }) : { z: number; } @@ -55,4 +62,5 @@ if (true) { >z : any >{ z: 0 } : { z: number; } >z : number +>0 : number } diff --git a/tests/baselines/reference/initializersWidened.symbols b/tests/baselines/reference/initializersWidened.symbols new file mode 100644 index 00000000000..625c066a058 --- /dev/null +++ b/tests/baselines/reference/initializersWidened.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/types/typeRelationships/widenedTypes/initializersWidened.ts === +// these are widened to any at the point of assignment + +var x = null; +>x : Symbol(x, Decl(initializersWidened.ts, 2, 3)) + +var y = undefined; +>y : Symbol(y, Decl(initializersWidened.ts, 3, 3)) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/initializersWidened.types b/tests/baselines/reference/initializersWidened.types index f09d43115c5..15705589246 100644 --- a/tests/baselines/reference/initializersWidened.types +++ b/tests/baselines/reference/initializersWidened.types @@ -3,6 +3,7 @@ var x = null; >x : any +>null : null var y = undefined; >y : any diff --git a/tests/baselines/reference/innerAliases2.symbols b/tests/baselines/reference/innerAliases2.symbols new file mode 100644 index 00000000000..541fc03ffbd --- /dev/null +++ b/tests/baselines/reference/innerAliases2.symbols @@ -0,0 +1,44 @@ +=== tests/cases/compiler/innerAliases2.ts === +module _provider { +>_provider : Symbol(_provider, Decl(innerAliases2.ts, 0, 0)) + + export class UsefulClass { +>UsefulClass : Symbol(UsefulClass, Decl(innerAliases2.ts, 0, 18)) + + public foo() { +>foo : Symbol(foo, Decl(innerAliases2.ts, 1, 42)) + } + } +} + +module consumer { +>consumer : Symbol(consumer, Decl(innerAliases2.ts, 5, 1)) + + import provider = _provider; +>provider : Symbol(provider, Decl(innerAliases2.ts, 7, 17)) +>_provider : Symbol(provider, Decl(innerAliases2.ts, 0, 0)) + + var g:provider.UsefulClass= null; +>g : Symbol(g, Decl(innerAliases2.ts, 10, 19)) +>provider : Symbol(provider, Decl(innerAliases2.ts, 7, 17)) +>UsefulClass : Symbol(provider.UsefulClass, Decl(innerAliases2.ts, 0, 18)) + + function use():provider.UsefulClass { +>use : Symbol(use, Decl(innerAliases2.ts, 10, 49)) +>provider : Symbol(provider, Decl(innerAliases2.ts, 7, 17)) +>UsefulClass : Symbol(provider.UsefulClass, Decl(innerAliases2.ts, 0, 18)) + + var p2:provider.UsefulClass= new provider.UsefulClass(); +>p2 : Symbol(p2, Decl(innerAliases2.ts, 13, 35)) +>provider : Symbol(provider, Decl(innerAliases2.ts, 7, 17)) +>UsefulClass : Symbol(provider.UsefulClass, Decl(innerAliases2.ts, 0, 18)) +>provider.UsefulClass : Symbol(provider.UsefulClass, Decl(innerAliases2.ts, 0, 18)) +>provider : Symbol(provider, Decl(innerAliases2.ts, 7, 17)) +>UsefulClass : Symbol(provider.UsefulClass, Decl(innerAliases2.ts, 0, 18)) + + return p2; +>p2 : Symbol(p2, Decl(innerAliases2.ts, 13, 35)) + } +} + + diff --git a/tests/baselines/reference/innerAliases2.types b/tests/baselines/reference/innerAliases2.types index ee8c18f93b4..127497e3869 100644 --- a/tests/baselines/reference/innerAliases2.types +++ b/tests/baselines/reference/innerAliases2.types @@ -20,17 +20,18 @@ module consumer { var g:provider.UsefulClass= null; >g : provider.UsefulClass ->provider : unknown +>provider : any >UsefulClass : provider.UsefulClass +>null : null function use():provider.UsefulClass { >use : () => provider.UsefulClass ->provider : unknown +>provider : any >UsefulClass : provider.UsefulClass var p2:provider.UsefulClass= new provider.UsefulClass(); >p2 : provider.UsefulClass ->provider : unknown +>provider : any >UsefulClass : provider.UsefulClass >new provider.UsefulClass() : provider.UsefulClass >provider.UsefulClass : typeof provider.UsefulClass diff --git a/tests/baselines/reference/innerBoundLambdaEmit.symbols b/tests/baselines/reference/innerBoundLambdaEmit.symbols new file mode 100644 index 00000000000..689aa7d075b --- /dev/null +++ b/tests/baselines/reference/innerBoundLambdaEmit.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/innerBoundLambdaEmit.ts === +module M { +>M : Symbol(M, Decl(innerBoundLambdaEmit.ts, 0, 0)) + + export class Foo { +>Foo : Symbol(Foo, Decl(innerBoundLambdaEmit.ts, 0, 10)) + } + var bar = () => { }; +>bar : Symbol(bar, Decl(innerBoundLambdaEmit.ts, 3, 7)) +} +interface Array { +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(innerBoundLambdaEmit.ts, 4, 1)) +>T : Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(innerBoundLambdaEmit.ts, 5, 16)) + + toFoo(): M.Foo +>toFoo : Symbol(toFoo, Decl(innerBoundLambdaEmit.ts, 5, 20)) +>M : Symbol(M, Decl(innerBoundLambdaEmit.ts, 0, 0)) +>Foo : Symbol(M.Foo, Decl(innerBoundLambdaEmit.ts, 0, 10)) +} + diff --git a/tests/baselines/reference/innerBoundLambdaEmit.types b/tests/baselines/reference/innerBoundLambdaEmit.types index d68e6e81cb6..d4cc16ede16 100644 --- a/tests/baselines/reference/innerBoundLambdaEmit.types +++ b/tests/baselines/reference/innerBoundLambdaEmit.types @@ -15,7 +15,7 @@ interface Array { toFoo(): M.Foo >toFoo : () => M.Foo ->M : unknown +>M : any >Foo : M.Foo } diff --git a/tests/baselines/reference/innerExtern.symbols b/tests/baselines/reference/innerExtern.symbols new file mode 100644 index 00000000000..142af91a46f --- /dev/null +++ b/tests/baselines/reference/innerExtern.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/innerExtern.ts === +module A { +>A : Symbol(A, Decl(innerExtern.ts, 0, 0)) + + export declare module BB { +>BB : Symbol(BB, Decl(innerExtern.ts, 0, 10)) + + export var Elephant; +>Elephant : Symbol(Elephant, Decl(innerExtern.ts, 2, 18)) + } + export module B { +>B : Symbol(B, Decl(innerExtern.ts, 3, 5)) + + export class C { +>C : Symbol(C, Decl(innerExtern.ts, 4, 21)) + + x = BB.Elephant.X; +>x : Symbol(x, Decl(innerExtern.ts, 5, 24)) +>BB.Elephant : Symbol(BB.Elephant, Decl(innerExtern.ts, 2, 18)) +>BB : Symbol(BB, Decl(innerExtern.ts, 0, 10)) +>Elephant : Symbol(BB.Elephant, Decl(innerExtern.ts, 2, 18)) + } + } +} + + + diff --git a/tests/baselines/reference/innerFunc.symbols b/tests/baselines/reference/innerFunc.symbols new file mode 100644 index 00000000000..459e1268f5f --- /dev/null +++ b/tests/baselines/reference/innerFunc.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/innerFunc.ts === +function salt() { +>salt : Symbol(salt, Decl(innerFunc.ts, 0, 0)) + + function pepper() { return 5;} +>pepper : Symbol(pepper, Decl(innerFunc.ts, 0, 17)) + + return pepper(); +>pepper : Symbol(pepper, Decl(innerFunc.ts, 0, 17)) +} + +module M { +>M : Symbol(M, Decl(innerFunc.ts, 3, 1)) + + export function tungsten() { +>tungsten : Symbol(tungsten, Decl(innerFunc.ts, 5, 10)) + + function oxygen() { return 6; }; +>oxygen : Symbol(oxygen, Decl(innerFunc.ts, 6, 32)) + + return oxygen(); +>oxygen : Symbol(oxygen, Decl(innerFunc.ts, 6, 32)) + } +} + diff --git a/tests/baselines/reference/innerFunc.types b/tests/baselines/reference/innerFunc.types index 8ca9e9d0a0b..48d98ae42e1 100644 --- a/tests/baselines/reference/innerFunc.types +++ b/tests/baselines/reference/innerFunc.types @@ -4,6 +4,7 @@ function salt() { function pepper() { return 5;} >pepper : () => number +>5 : number return pepper(); >pepper() : number @@ -18,6 +19,7 @@ module M { function oxygen() { return 6; }; >oxygen : () => number +>6 : number return oxygen(); >oxygen() : number diff --git a/tests/baselines/reference/innerOverloads.symbols b/tests/baselines/reference/innerOverloads.symbols new file mode 100644 index 00000000000..d87a60b26e8 --- /dev/null +++ b/tests/baselines/reference/innerOverloads.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/innerOverloads.ts === + +function outer() { +>outer : Symbol(outer, Decl(innerOverloads.ts, 0, 0)) + + function inner(x:number); // should work +>inner : Symbol(inner, Decl(innerOverloads.ts, 1, 18), Decl(innerOverloads.ts, 2, 29), Decl(innerOverloads.ts, 3, 29)) +>x : Symbol(x, Decl(innerOverloads.ts, 2, 19)) + + function inner(x:string); +>inner : Symbol(inner, Decl(innerOverloads.ts, 1, 18), Decl(innerOverloads.ts, 2, 29), Decl(innerOverloads.ts, 3, 29)) +>x : Symbol(x, Decl(innerOverloads.ts, 3, 19)) + + function inner(a:any) { return a; } +>inner : Symbol(inner, Decl(innerOverloads.ts, 1, 18), Decl(innerOverloads.ts, 2, 29), Decl(innerOverloads.ts, 3, 29)) +>a : Symbol(a, Decl(innerOverloads.ts, 4, 19)) +>a : Symbol(a, Decl(innerOverloads.ts, 4, 19)) + + return inner(0); +>inner : Symbol(inner, Decl(innerOverloads.ts, 1, 18), Decl(innerOverloads.ts, 2, 29), Decl(innerOverloads.ts, 3, 29)) +} + +var x = outer(); // should work +>x : Symbol(x, Decl(innerOverloads.ts, 9, 3)) +>outer : Symbol(outer, Decl(innerOverloads.ts, 0, 0)) + + diff --git a/tests/baselines/reference/innerOverloads.types b/tests/baselines/reference/innerOverloads.types index 7168f6161f3..68af57b3bea 100644 --- a/tests/baselines/reference/innerOverloads.types +++ b/tests/baselines/reference/innerOverloads.types @@ -19,6 +19,7 @@ function outer() { return inner(0); >inner(0) : any >inner : { (x: number): any; (x: string): any; } +>0 : number } var x = outer(); // should work diff --git a/tests/baselines/reference/innerTypeArgumentInference.symbols b/tests/baselines/reference/innerTypeArgumentInference.symbols new file mode 100644 index 00000000000..441ce4986ef --- /dev/null +++ b/tests/baselines/reference/innerTypeArgumentInference.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/innerTypeArgumentInference.ts === +interface Generator { (): T; } +>Generator : Symbol(Generator, Decl(innerTypeArgumentInference.ts, 0, 0)) +>T : Symbol(T, Decl(innerTypeArgumentInference.ts, 0, 20)) +>T : Symbol(T, Decl(innerTypeArgumentInference.ts, 0, 20)) + +function Generate(func: Generator): U { +>Generate : Symbol(Generate, Decl(innerTypeArgumentInference.ts, 0, 33)) +>U : Symbol(U, Decl(innerTypeArgumentInference.ts, 1, 18)) +>func : Symbol(func, Decl(innerTypeArgumentInference.ts, 1, 21)) +>Generator : Symbol(Generator, Decl(innerTypeArgumentInference.ts, 0, 0)) +>U : Symbol(U, Decl(innerTypeArgumentInference.ts, 1, 18)) +>U : Symbol(U, Decl(innerTypeArgumentInference.ts, 1, 18)) + + return Generate(func); +>Generate : Symbol(Generate, Decl(innerTypeArgumentInference.ts, 0, 33)) +>func : Symbol(func, Decl(innerTypeArgumentInference.ts, 1, 21)) +} diff --git a/tests/baselines/reference/innerTypeParameterShadowingOuterOne.symbols b/tests/baselines/reference/innerTypeParameterShadowingOuterOne.symbols new file mode 100644 index 00000000000..b890c6c9ecf --- /dev/null +++ b/tests/baselines/reference/innerTypeParameterShadowingOuterOne.symbols @@ -0,0 +1,73 @@ +=== tests/cases/conformance/types/typeParameters/typeParameterLists/innerTypeParameterShadowingOuterOne.ts === +// inner type parameters shadow outer ones of the same name +// no errors expected + +function f() { +>f : Symbol(f, Decl(innerTypeParameterShadowingOuterOne.ts, 0, 0)) +>T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne.ts, 3, 11)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + function g() { +>g : Symbol(g, Decl(innerTypeParameterShadowingOuterOne.ts, 3, 30)) +>T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne.ts, 4, 15)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + + var x: T; +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne.ts, 5, 11)) +>T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne.ts, 4, 15)) + + x.toFixed(); +>x.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne.ts, 5, 11)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) + } + var x: T; +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne.ts, 8, 7)) +>T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne.ts, 3, 11)) + + x.getDate(); +>x.getDate : Symbol(Date.getDate, Decl(lib.d.ts, 660, 26)) +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne.ts, 8, 7)) +>getDate : Symbol(Date.getDate, Decl(lib.d.ts, 660, 26)) +} + +function f2() { +>f2 : Symbol(f2, Decl(innerTypeParameterShadowingOuterOne.ts, 10, 1)) +>T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne.ts, 12, 12)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>U : Symbol(U, Decl(innerTypeParameterShadowingOuterOne.ts, 12, 27)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + function g() { +>g : Symbol(g, Decl(innerTypeParameterShadowingOuterOne.ts, 12, 47)) +>T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne.ts, 13, 15)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) +>U : Symbol(U, Decl(innerTypeParameterShadowingOuterOne.ts, 13, 32)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + + var x: U; +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne.ts, 14, 11)) +>U : Symbol(U, Decl(innerTypeParameterShadowingOuterOne.ts, 13, 32)) + + x.toFixed(); +>x.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne.ts, 14, 11)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) + } + var x: U; +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne.ts, 17, 7)) +>U : Symbol(U, Decl(innerTypeParameterShadowingOuterOne.ts, 12, 27)) + + x.getDate(); +>x.getDate : Symbol(Date.getDate, Decl(lib.d.ts, 660, 26)) +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne.ts, 17, 7)) +>getDate : Symbol(Date.getDate, Decl(lib.d.ts, 660, 26)) +} +//function f2() { +// function g() { +// var x: U; +// x.toFixed(); +// } +// var x: U; +// x.getDate(); +//} diff --git a/tests/baselines/reference/innerTypeParameterShadowingOuterOne2.symbols b/tests/baselines/reference/innerTypeParameterShadowingOuterOne2.symbols new file mode 100644 index 00000000000..13afcb3e123 --- /dev/null +++ b/tests/baselines/reference/innerTypeParameterShadowingOuterOne2.symbols @@ -0,0 +1,86 @@ +=== tests/cases/conformance/types/typeParameters/typeParameterLists/innerTypeParameterShadowingOuterOne2.ts === +// inner type parameters shadow outer ones of the same name +// no errors expected + +class C { +>C : Symbol(C, Decl(innerTypeParameterShadowingOuterOne2.ts, 0, 0)) +>T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne2.ts, 3, 8)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + g() { +>g : Symbol(g, Decl(innerTypeParameterShadowingOuterOne2.ts, 3, 25)) +>T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne2.ts, 4, 6)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + + var x: T; +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne2.ts, 5, 11)) +>T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne2.ts, 4, 6)) + + x.toFixed(); +>x.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne2.ts, 5, 11)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) + } + + h() { +>h : Symbol(h, Decl(innerTypeParameterShadowingOuterOne2.ts, 7, 5)) + + var x: T; +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne2.ts, 10, 11)) +>T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne2.ts, 3, 8)) + + x.getDate(); +>x.getDate : Symbol(Date.getDate, Decl(lib.d.ts, 660, 26)) +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne2.ts, 10, 11)) +>getDate : Symbol(Date.getDate, Decl(lib.d.ts, 660, 26)) + } +} + +class C2 { +>C2 : Symbol(C2, Decl(innerTypeParameterShadowingOuterOne2.ts, 13, 1)) +>T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne2.ts, 15, 9)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>U : Symbol(U, Decl(innerTypeParameterShadowingOuterOne2.ts, 15, 24)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + g() { +>g : Symbol(g, Decl(innerTypeParameterShadowingOuterOne2.ts, 15, 42)) +>T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne2.ts, 16, 6)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) +>U : Symbol(U, Decl(innerTypeParameterShadowingOuterOne2.ts, 16, 23)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + + var x: U; +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne2.ts, 17, 11)) +>U : Symbol(U, Decl(innerTypeParameterShadowingOuterOne2.ts, 16, 23)) + + x.toFixed(); +>x.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne2.ts, 17, 11)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) + } + + h() { +>h : Symbol(h, Decl(innerTypeParameterShadowingOuterOne2.ts, 19, 5)) + + var x: U; +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne2.ts, 22, 11)) +>U : Symbol(U, Decl(innerTypeParameterShadowingOuterOne2.ts, 15, 24)) + + x.getDate(); +>x.getDate : Symbol(Date.getDate, Decl(lib.d.ts, 660, 26)) +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne2.ts, 22, 11)) +>getDate : Symbol(Date.getDate, Decl(lib.d.ts, 660, 26)) + } +} +//class C2 { +// g() { +// var x: U; +// x.toFixed(); +// } + +// h() { +// var x: U; +// x.getDate(); +// } +//} diff --git a/tests/baselines/reference/instanceAndStaticDeclarations1.symbols b/tests/baselines/reference/instanceAndStaticDeclarations1.symbols new file mode 100644 index 00000000000..518d899eabf --- /dev/null +++ b/tests/baselines/reference/instanceAndStaticDeclarations1.symbols @@ -0,0 +1,57 @@ +=== tests/cases/compiler/instanceAndStaticDeclarations1.ts === +// from spec + +class Point { +>Point : Symbol(Point, Decl(instanceAndStaticDeclarations1.ts, 0, 0)) + + constructor(public x: number, public y: number) { } +>x : Symbol(x, Decl(instanceAndStaticDeclarations1.ts, 3, 16)) +>y : Symbol(y, Decl(instanceAndStaticDeclarations1.ts, 3, 33)) + + public distance(p: Point) { +>distance : Symbol(distance, Decl(instanceAndStaticDeclarations1.ts, 3, 55)) +>p : Symbol(p, Decl(instanceAndStaticDeclarations1.ts, 4, 20)) +>Point : Symbol(Point, Decl(instanceAndStaticDeclarations1.ts, 0, 0)) + + var dx = this.x - p.x; +>dx : Symbol(dx, Decl(instanceAndStaticDeclarations1.ts, 5, 11)) +>this.x : Symbol(x, Decl(instanceAndStaticDeclarations1.ts, 3, 16)) +>this : Symbol(Point, Decl(instanceAndStaticDeclarations1.ts, 0, 0)) +>x : Symbol(x, Decl(instanceAndStaticDeclarations1.ts, 3, 16)) +>p.x : Symbol(x, Decl(instanceAndStaticDeclarations1.ts, 3, 16)) +>p : Symbol(p, Decl(instanceAndStaticDeclarations1.ts, 4, 20)) +>x : Symbol(x, Decl(instanceAndStaticDeclarations1.ts, 3, 16)) + + var dy = this.y - p.y; +>dy : Symbol(dy, Decl(instanceAndStaticDeclarations1.ts, 6, 11)) +>this.y : Symbol(y, Decl(instanceAndStaticDeclarations1.ts, 3, 33)) +>this : Symbol(Point, Decl(instanceAndStaticDeclarations1.ts, 0, 0)) +>y : Symbol(y, Decl(instanceAndStaticDeclarations1.ts, 3, 33)) +>p.y : Symbol(y, Decl(instanceAndStaticDeclarations1.ts, 3, 33)) +>p : Symbol(p, Decl(instanceAndStaticDeclarations1.ts, 4, 20)) +>y : Symbol(y, Decl(instanceAndStaticDeclarations1.ts, 3, 33)) + + return Math.sqrt(dx * dx + dy * dy); +>Math.sqrt : Symbol(Math.sqrt, Decl(lib.d.ts, 620, 27)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>sqrt : Symbol(Math.sqrt, Decl(lib.d.ts, 620, 27)) +>dx : Symbol(dx, Decl(instanceAndStaticDeclarations1.ts, 5, 11)) +>dx : Symbol(dx, Decl(instanceAndStaticDeclarations1.ts, 5, 11)) +>dy : Symbol(dy, Decl(instanceAndStaticDeclarations1.ts, 6, 11)) +>dy : Symbol(dy, Decl(instanceAndStaticDeclarations1.ts, 6, 11)) + } + static origin = new Point(0, 0); +>origin : Symbol(Point.origin, Decl(instanceAndStaticDeclarations1.ts, 8, 5)) +>Point : Symbol(Point, Decl(instanceAndStaticDeclarations1.ts, 0, 0)) + + static distance(p1: Point, p2: Point) { return p1.distance(p2); } +>distance : Symbol(Point.distance, Decl(instanceAndStaticDeclarations1.ts, 9, 36)) +>p1 : Symbol(p1, Decl(instanceAndStaticDeclarations1.ts, 10, 20)) +>Point : Symbol(Point, Decl(instanceAndStaticDeclarations1.ts, 0, 0)) +>p2 : Symbol(p2, Decl(instanceAndStaticDeclarations1.ts, 10, 30)) +>Point : Symbol(Point, Decl(instanceAndStaticDeclarations1.ts, 0, 0)) +>p1.distance : Symbol(distance, Decl(instanceAndStaticDeclarations1.ts, 3, 55)) +>p1 : Symbol(p1, Decl(instanceAndStaticDeclarations1.ts, 10, 20)) +>distance : Symbol(distance, Decl(instanceAndStaticDeclarations1.ts, 3, 55)) +>p2 : Symbol(p2, Decl(instanceAndStaticDeclarations1.ts, 10, 30)) +} diff --git a/tests/baselines/reference/instanceAndStaticDeclarations1.types b/tests/baselines/reference/instanceAndStaticDeclarations1.types index c80cf78e37a..9d6ba692735 100644 --- a/tests/baselines/reference/instanceAndStaticDeclarations1.types +++ b/tests/baselines/reference/instanceAndStaticDeclarations1.types @@ -50,6 +50,8 @@ class Point { >origin : Point >new Point(0, 0) : Point >Point : typeof Point +>0 : number +>0 : number static distance(p1: Point, p2: Point) { return p1.distance(p2); } >distance : (p1: Point, p2: Point) => number diff --git a/tests/baselines/reference/instanceMemberInitialization.symbols b/tests/baselines/reference/instanceMemberInitialization.symbols new file mode 100644 index 00000000000..adc192208ca --- /dev/null +++ b/tests/baselines/reference/instanceMemberInitialization.symbols @@ -0,0 +1,30 @@ +=== tests/cases/conformance/classes/propertyMemberDeclarations/instanceMemberInitialization.ts === +class C { +>C : Symbol(C, Decl(instanceMemberInitialization.ts, 0, 0)) + + x = 1; +>x : Symbol(x, Decl(instanceMemberInitialization.ts, 0, 9)) +} + +var c = new C(); +>c : Symbol(c, Decl(instanceMemberInitialization.ts, 4, 3)) +>C : Symbol(C, Decl(instanceMemberInitialization.ts, 0, 0)) + +c.x = 3; +>c.x : Symbol(C.x, Decl(instanceMemberInitialization.ts, 0, 9)) +>c : Symbol(c, Decl(instanceMemberInitialization.ts, 4, 3)) +>x : Symbol(C.x, Decl(instanceMemberInitialization.ts, 0, 9)) + +var c2 = new C(); +>c2 : Symbol(c2, Decl(instanceMemberInitialization.ts, 6, 3)) +>C : Symbol(C, Decl(instanceMemberInitialization.ts, 0, 0)) + +var r = c.x === c2.x; +>r : Symbol(r, Decl(instanceMemberInitialization.ts, 7, 3)) +>c.x : Symbol(C.x, Decl(instanceMemberInitialization.ts, 0, 9)) +>c : Symbol(c, Decl(instanceMemberInitialization.ts, 4, 3)) +>x : Symbol(C.x, Decl(instanceMemberInitialization.ts, 0, 9)) +>c2.x : Symbol(C.x, Decl(instanceMemberInitialization.ts, 0, 9)) +>c2 : Symbol(c2, Decl(instanceMemberInitialization.ts, 6, 3)) +>x : Symbol(C.x, Decl(instanceMemberInitialization.ts, 0, 9)) + diff --git a/tests/baselines/reference/instanceMemberInitialization.types b/tests/baselines/reference/instanceMemberInitialization.types index 5e9d7df3706..4d65c62aa49 100644 --- a/tests/baselines/reference/instanceMemberInitialization.types +++ b/tests/baselines/reference/instanceMemberInitialization.types @@ -4,6 +4,7 @@ class C { x = 1; >x : number +>1 : number } var c = new C(); @@ -16,6 +17,7 @@ c.x = 3; >c.x : number >c : C >x : number +>3 : number var c2 = new C(); >c2 : C diff --git a/tests/baselines/reference/instanceOfInExternalModules.symbols b/tests/baselines/reference/instanceOfInExternalModules.symbols new file mode 100644 index 00000000000..45d158fc62e --- /dev/null +++ b/tests/baselines/reference/instanceOfInExternalModules.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/instanceOfInExternalModules_1.ts === +/// +import Bar = require("instanceOfInExternalModules_require"); +>Bar : Symbol(Bar, Decl(instanceOfInExternalModules_1.ts, 0, 0)) + +function IsFoo(value: any): boolean { +>IsFoo : Symbol(IsFoo, Decl(instanceOfInExternalModules_1.ts, 1, 60)) +>value : Symbol(value, Decl(instanceOfInExternalModules_1.ts, 2, 15)) + + return value instanceof Bar.Foo; +>value : Symbol(value, Decl(instanceOfInExternalModules_1.ts, 2, 15)) +>Bar.Foo : Symbol(Bar.Foo, Decl(instanceOfInExternalModules_require.ts, 0, 0)) +>Bar : Symbol(Bar, Decl(instanceOfInExternalModules_1.ts, 0, 0)) +>Foo : Symbol(Bar.Foo, Decl(instanceOfInExternalModules_require.ts, 0, 0)) +} + +=== tests/cases/compiler/instanceOfInExternalModules_require.ts === +export class Foo { foo: string; } +>Foo : Symbol(Foo, Decl(instanceOfInExternalModules_require.ts, 0, 0)) +>foo : Symbol(foo, Decl(instanceOfInExternalModules_require.ts, 0, 18)) + diff --git a/tests/baselines/reference/instanceSubtypeCheck1.symbols b/tests/baselines/reference/instanceSubtypeCheck1.symbols new file mode 100644 index 00000000000..c7f4bb4152d --- /dev/null +++ b/tests/baselines/reference/instanceSubtypeCheck1.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/instanceSubtypeCheck1.ts === +interface A +>A : Symbol(A, Decl(instanceSubtypeCheck1.ts, 0, 0)) +>T : Symbol(T, Decl(instanceSubtypeCheck1.ts, 0, 12)) +{ + x: A> +>x : Symbol(x, Decl(instanceSubtypeCheck1.ts, 1, 1)) +>A : Symbol(A, Decl(instanceSubtypeCheck1.ts, 0, 0)) +>B : Symbol(B, Decl(instanceSubtypeCheck1.ts, 3, 1)) +>T : Symbol(T, Decl(instanceSubtypeCheck1.ts, 0, 12)) +} + +interface B extends A +>B : Symbol(B, Decl(instanceSubtypeCheck1.ts, 3, 1)) +>T : Symbol(T, Decl(instanceSubtypeCheck1.ts, 5, 12)) +>A : Symbol(A, Decl(instanceSubtypeCheck1.ts, 0, 0)) +>T : Symbol(T, Decl(instanceSubtypeCheck1.ts, 5, 12)) +{ + x: B> +>x : Symbol(x, Decl(instanceSubtypeCheck1.ts, 6, 1)) +>B : Symbol(B, Decl(instanceSubtypeCheck1.ts, 3, 1)) +>A : Symbol(A, Decl(instanceSubtypeCheck1.ts, 0, 0)) +>T : Symbol(T, Decl(instanceSubtypeCheck1.ts, 5, 12)) +} diff --git a/tests/baselines/reference/instanceofOperatorWithAny.symbols b/tests/baselines/reference/instanceofOperatorWithAny.symbols new file mode 100644 index 00000000000..71e08c948e3 --- /dev/null +++ b/tests/baselines/reference/instanceofOperatorWithAny.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithAny.ts === +var a: any; +>a : Symbol(a, Decl(instanceofOperatorWithAny.ts, 0, 3)) + +var r: boolean = a instanceof a; +>r : Symbol(r, Decl(instanceofOperatorWithAny.ts, 2, 3)) +>a : Symbol(a, Decl(instanceofOperatorWithAny.ts, 0, 3)) +>a : Symbol(a, Decl(instanceofOperatorWithAny.ts, 0, 3)) + diff --git a/tests/baselines/reference/instanceofOperatorWithLHSIsObject.symbols b/tests/baselines/reference/instanceofOperatorWithLHSIsObject.symbols new file mode 100644 index 00000000000..44859d83f72 --- /dev/null +++ b/tests/baselines/reference/instanceofOperatorWithLHSIsObject.symbols @@ -0,0 +1,46 @@ +=== tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithLHSIsObject.ts === +class C { } +>C : Symbol(C, Decl(instanceofOperatorWithLHSIsObject.ts, 0, 0)) + +var x1: any; +>x1 : Symbol(x1, Decl(instanceofOperatorWithLHSIsObject.ts, 2, 3)) + +var x2: Function; +>x2 : Symbol(x2, Decl(instanceofOperatorWithLHSIsObject.ts, 3, 3)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) + +var a: {}; +>a : Symbol(a, Decl(instanceofOperatorWithLHSIsObject.ts, 5, 3)) + +var b: Object; +>b : Symbol(b, Decl(instanceofOperatorWithLHSIsObject.ts, 6, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var c: C; +>c : Symbol(c, Decl(instanceofOperatorWithLHSIsObject.ts, 7, 3)) +>C : Symbol(C, Decl(instanceofOperatorWithLHSIsObject.ts, 0, 0)) + +var d: string | C; +>d : Symbol(d, Decl(instanceofOperatorWithLHSIsObject.ts, 8, 3)) +>C : Symbol(C, Decl(instanceofOperatorWithLHSIsObject.ts, 0, 0)) + +var r1 = a instanceof x1; +>r1 : Symbol(r1, Decl(instanceofOperatorWithLHSIsObject.ts, 10, 3)) +>a : Symbol(a, Decl(instanceofOperatorWithLHSIsObject.ts, 5, 3)) +>x1 : Symbol(x1, Decl(instanceofOperatorWithLHSIsObject.ts, 2, 3)) + +var r2 = b instanceof x2; +>r2 : Symbol(r2, Decl(instanceofOperatorWithLHSIsObject.ts, 11, 3)) +>b : Symbol(b, Decl(instanceofOperatorWithLHSIsObject.ts, 6, 3)) +>x2 : Symbol(x2, Decl(instanceofOperatorWithLHSIsObject.ts, 3, 3)) + +var r3 = c instanceof x1; +>r3 : Symbol(r3, Decl(instanceofOperatorWithLHSIsObject.ts, 12, 3)) +>c : Symbol(c, Decl(instanceofOperatorWithLHSIsObject.ts, 7, 3)) +>x1 : Symbol(x1, Decl(instanceofOperatorWithLHSIsObject.ts, 2, 3)) + +var r4 = d instanceof x1; +>r4 : Symbol(r4, Decl(instanceofOperatorWithLHSIsObject.ts, 13, 3)) +>d : Symbol(d, Decl(instanceofOperatorWithLHSIsObject.ts, 8, 3)) +>x1 : Symbol(x1, Decl(instanceofOperatorWithLHSIsObject.ts, 2, 3)) + diff --git a/tests/baselines/reference/instanceofOperatorWithLHSIsTypeParameter.symbols b/tests/baselines/reference/instanceofOperatorWithLHSIsTypeParameter.symbols new file mode 100644 index 00000000000..a46802ac144 --- /dev/null +++ b/tests/baselines/reference/instanceofOperatorWithLHSIsTypeParameter.symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithLHSIsTypeParameter.ts === +function foo(t: T) { +>foo : Symbol(foo, Decl(instanceofOperatorWithLHSIsTypeParameter.ts, 0, 0)) +>T : Symbol(T, Decl(instanceofOperatorWithLHSIsTypeParameter.ts, 0, 13)) +>t : Symbol(t, Decl(instanceofOperatorWithLHSIsTypeParameter.ts, 0, 16)) +>T : Symbol(T, Decl(instanceofOperatorWithLHSIsTypeParameter.ts, 0, 13)) + + var x: any; +>x : Symbol(x, Decl(instanceofOperatorWithLHSIsTypeParameter.ts, 1, 7)) + + var r = t instanceof x; +>r : Symbol(r, Decl(instanceofOperatorWithLHSIsTypeParameter.ts, 2, 7)) +>t : Symbol(t, Decl(instanceofOperatorWithLHSIsTypeParameter.ts, 0, 16)) +>x : Symbol(x, Decl(instanceofOperatorWithLHSIsTypeParameter.ts, 1, 7)) +} diff --git a/tests/baselines/reference/instanceofOperatorWithRHSIsSubtypeOfFunction.symbols b/tests/baselines/reference/instanceofOperatorWithRHSIsSubtypeOfFunction.symbols new file mode 100644 index 00000000000..e15f4b7ea45 --- /dev/null +++ b/tests/baselines/reference/instanceofOperatorWithRHSIsSubtypeOfFunction.symbols @@ -0,0 +1,51 @@ +=== tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithRHSIsSubtypeOfFunction.ts === +interface I extends Function { } +>I : Symbol(I, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 0, 0)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) + +var x: any; +>x : Symbol(x, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 2, 3)) + +var f1: Function; +>f1 : Symbol(f1, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 3, 3)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) + +var f2: I; +>f2 : Symbol(f2, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 4, 3)) +>I : Symbol(I, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 0, 0)) + +var f3: { (): void }; +>f3 : Symbol(f3, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 5, 3)) + +var f4: { new (): number }; +>f4 : Symbol(f4, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 6, 3)) + +var r1 = x instanceof f1; +>r1 : Symbol(r1, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 8, 3)) +>x : Symbol(x, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 2, 3)) +>f1 : Symbol(f1, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 3, 3)) + +var r2 = x instanceof f2; +>r2 : Symbol(r2, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 9, 3)) +>x : Symbol(x, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 2, 3)) +>f2 : Symbol(f2, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 4, 3)) + +var r3 = x instanceof f3; +>r3 : Symbol(r3, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 10, 3)) +>x : Symbol(x, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 2, 3)) +>f3 : Symbol(f3, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 5, 3)) + +var r4 = x instanceof f4; +>r4 : Symbol(r4, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 11, 3)) +>x : Symbol(x, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 2, 3)) +>f4 : Symbol(f4, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 6, 3)) + +var r5 = x instanceof null; +>r5 : Symbol(r5, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 12, 3)) +>x : Symbol(x, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 2, 3)) + +var r6 = x instanceof undefined; +>r6 : Symbol(r6, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 13, 3)) +>x : Symbol(x, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 2, 3)) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/instanceofOperatorWithRHSIsSubtypeOfFunction.types b/tests/baselines/reference/instanceofOperatorWithRHSIsSubtypeOfFunction.types index 2bcf91bb1ab..256f26f8fc9 100644 --- a/tests/baselines/reference/instanceofOperatorWithRHSIsSubtypeOfFunction.types +++ b/tests/baselines/reference/instanceofOperatorWithRHSIsSubtypeOfFunction.types @@ -48,6 +48,7 @@ var r5 = x instanceof null; >r5 : boolean >x instanceof null : boolean >x : any +>null : null var r6 = x instanceof undefined; >r6 : boolean diff --git a/tests/baselines/reference/instantiateGenericClassWithZeroTypeArguments.symbols b/tests/baselines/reference/instantiateGenericClassWithZeroTypeArguments.symbols new file mode 100644 index 00000000000..b20387d9b80 --- /dev/null +++ b/tests/baselines/reference/instantiateGenericClassWithZeroTypeArguments.symbols @@ -0,0 +1,34 @@ +=== tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGenericClassWithZeroTypeArguments.ts === +// no errors expected when instantiating a generic type with no type arguments provided + +class C { +>C : Symbol(C, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 0, 0)) +>T : Symbol(T, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 2, 8)) + + x: T; +>x : Symbol(x, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 2, 12)) +>T : Symbol(T, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 2, 8)) +} + +var c = new C(); +>c : Symbol(c, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 6, 3)) +>C : Symbol(C, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 0, 0)) + +class D { +>D : Symbol(D, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 6, 16)) +>T : Symbol(T, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 8, 8)) +>U : Symbol(U, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 8, 10)) + + x: T +>x : Symbol(x, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 8, 15)) +>T : Symbol(T, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 8, 8)) + + y: U +>y : Symbol(y, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 9, 8)) +>U : Symbol(U, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 8, 10)) +} + +var d = new D(); +>d : Symbol(d, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 13, 3)) +>D : Symbol(D, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 6, 16)) + diff --git a/tests/baselines/reference/instantiatedModule.symbols b/tests/baselines/reference/instantiatedModule.symbols new file mode 100644 index 00000000000..42e0edcd221 --- /dev/null +++ b/tests/baselines/reference/instantiatedModule.symbols @@ -0,0 +1,195 @@ +=== tests/cases/conformance/internalModules/moduleDeclarations/instantiatedModule.ts === +// adding the var makes this an instantiated module + +module M { +>M : Symbol(M, Decl(instantiatedModule.ts, 0, 0)) + + export interface Point { x: number; y: number } +>Point : Symbol(Point, Decl(instantiatedModule.ts, 2, 10), Decl(instantiatedModule.ts, 4, 14)) +>x : Symbol(x, Decl(instantiatedModule.ts, 3, 28)) +>y : Symbol(y, Decl(instantiatedModule.ts, 3, 39)) + + export var Point = 1; +>Point : Symbol(Point, Decl(instantiatedModule.ts, 2, 10), Decl(instantiatedModule.ts, 4, 14)) +} + +// primary expression +var m: typeof M; +>m : Symbol(m, Decl(instantiatedModule.ts, 8, 3), Decl(instantiatedModule.ts, 9, 3)) +>M : Symbol(M, Decl(instantiatedModule.ts, 0, 0)) + +var m = M; +>m : Symbol(m, Decl(instantiatedModule.ts, 8, 3), Decl(instantiatedModule.ts, 9, 3)) +>M : Symbol(M, Decl(instantiatedModule.ts, 0, 0)) + +var a1: number; +>a1 : Symbol(a1, Decl(instantiatedModule.ts, 11, 3), Decl(instantiatedModule.ts, 12, 3), Decl(instantiatedModule.ts, 13, 3)) + +var a1 = M.Point; +>a1 : Symbol(a1, Decl(instantiatedModule.ts, 11, 3), Decl(instantiatedModule.ts, 12, 3), Decl(instantiatedModule.ts, 13, 3)) +>M.Point : Symbol(M.Point, Decl(instantiatedModule.ts, 2, 10), Decl(instantiatedModule.ts, 4, 14)) +>M : Symbol(M, Decl(instantiatedModule.ts, 0, 0)) +>Point : Symbol(M.Point, Decl(instantiatedModule.ts, 2, 10), Decl(instantiatedModule.ts, 4, 14)) + +var a1 = m.Point; +>a1 : Symbol(a1, Decl(instantiatedModule.ts, 11, 3), Decl(instantiatedModule.ts, 12, 3), Decl(instantiatedModule.ts, 13, 3)) +>m.Point : Symbol(M.Point, Decl(instantiatedModule.ts, 2, 10), Decl(instantiatedModule.ts, 4, 14)) +>m : Symbol(m, Decl(instantiatedModule.ts, 8, 3), Decl(instantiatedModule.ts, 9, 3)) +>Point : Symbol(M.Point, Decl(instantiatedModule.ts, 2, 10), Decl(instantiatedModule.ts, 4, 14)) + +var p1: { x: number; y: number; } +>p1 : Symbol(p1, Decl(instantiatedModule.ts, 15, 3), Decl(instantiatedModule.ts, 16, 3)) +>x : Symbol(x, Decl(instantiatedModule.ts, 15, 9)) +>y : Symbol(y, Decl(instantiatedModule.ts, 15, 20)) + +var p1: M.Point; +>p1 : Symbol(p1, Decl(instantiatedModule.ts, 15, 3), Decl(instantiatedModule.ts, 16, 3)) +>M : Symbol(M, Decl(instantiatedModule.ts, 0, 0)) +>Point : Symbol(M.Point, Decl(instantiatedModule.ts, 2, 10), Decl(instantiatedModule.ts, 4, 14)) + +// making the point a class instead of an interface +// makes this an instantiated mmodule +module M2 { +>M2 : Symbol(M2, Decl(instantiatedModule.ts, 16, 16)) + + export class Point { +>Point : Symbol(Point, Decl(instantiatedModule.ts, 20, 11)) + + x: number; +>x : Symbol(x, Decl(instantiatedModule.ts, 21, 24)) + + y: number; +>y : Symbol(y, Decl(instantiatedModule.ts, 22, 18)) + + static Origin(): Point { +>Origin : Symbol(Point.Origin, Decl(instantiatedModule.ts, 23, 18)) +>Point : Symbol(Point, Decl(instantiatedModule.ts, 20, 11)) + + return { x: 0, y: 0 }; +>x : Symbol(x, Decl(instantiatedModule.ts, 25, 20)) +>y : Symbol(y, Decl(instantiatedModule.ts, 25, 26)) + } + } +} + +var m2: typeof M2; +>m2 : Symbol(m2, Decl(instantiatedModule.ts, 30, 3), Decl(instantiatedModule.ts, 31, 3)) +>M2 : Symbol(M2, Decl(instantiatedModule.ts, 16, 16)) + +var m2 = M2; +>m2 : Symbol(m2, Decl(instantiatedModule.ts, 30, 3), Decl(instantiatedModule.ts, 31, 3)) +>M2 : Symbol(M2, Decl(instantiatedModule.ts, 16, 16)) + +// static side of the class +var a2: typeof M2.Point; +>a2 : Symbol(a2, Decl(instantiatedModule.ts, 34, 3), Decl(instantiatedModule.ts, 35, 3), Decl(instantiatedModule.ts, 36, 3)) +>M2.Point : Symbol(M2.Point, Decl(instantiatedModule.ts, 20, 11)) +>M2 : Symbol(M2, Decl(instantiatedModule.ts, 16, 16)) +>Point : Symbol(M2.Point, Decl(instantiatedModule.ts, 20, 11)) + +var a2 = m2.Point; +>a2 : Symbol(a2, Decl(instantiatedModule.ts, 34, 3), Decl(instantiatedModule.ts, 35, 3), Decl(instantiatedModule.ts, 36, 3)) +>m2.Point : Symbol(M2.Point, Decl(instantiatedModule.ts, 20, 11)) +>m2 : Symbol(m2, Decl(instantiatedModule.ts, 30, 3), Decl(instantiatedModule.ts, 31, 3)) +>Point : Symbol(M2.Point, Decl(instantiatedModule.ts, 20, 11)) + +var a2 = M2.Point; +>a2 : Symbol(a2, Decl(instantiatedModule.ts, 34, 3), Decl(instantiatedModule.ts, 35, 3), Decl(instantiatedModule.ts, 36, 3)) +>M2.Point : Symbol(M2.Point, Decl(instantiatedModule.ts, 20, 11)) +>M2 : Symbol(M2, Decl(instantiatedModule.ts, 16, 16)) +>Point : Symbol(M2.Point, Decl(instantiatedModule.ts, 20, 11)) + +var o: M2.Point = a2.Origin(); +>o : Symbol(o, Decl(instantiatedModule.ts, 37, 3)) +>M2 : Symbol(M2, Decl(instantiatedModule.ts, 16, 16)) +>Point : Symbol(M2.Point, Decl(instantiatedModule.ts, 20, 11)) +>a2.Origin : Symbol(M2.Point.Origin, Decl(instantiatedModule.ts, 23, 18)) +>a2 : Symbol(a2, Decl(instantiatedModule.ts, 34, 3), Decl(instantiatedModule.ts, 35, 3), Decl(instantiatedModule.ts, 36, 3)) +>Origin : Symbol(M2.Point.Origin, Decl(instantiatedModule.ts, 23, 18)) + +var p2: { x: number; y: number } +>p2 : Symbol(p2, Decl(instantiatedModule.ts, 39, 3), Decl(instantiatedModule.ts, 40, 3), Decl(instantiatedModule.ts, 41, 3), Decl(instantiatedModule.ts, 42, 3)) +>x : Symbol(x, Decl(instantiatedModule.ts, 39, 9)) +>y : Symbol(y, Decl(instantiatedModule.ts, 39, 20)) + +var p2: M2.Point; +>p2 : Symbol(p2, Decl(instantiatedModule.ts, 39, 3), Decl(instantiatedModule.ts, 40, 3), Decl(instantiatedModule.ts, 41, 3), Decl(instantiatedModule.ts, 42, 3)) +>M2 : Symbol(M2, Decl(instantiatedModule.ts, 16, 16)) +>Point : Symbol(M2.Point, Decl(instantiatedModule.ts, 20, 11)) + +var p2 = new m2.Point(); +>p2 : Symbol(p2, Decl(instantiatedModule.ts, 39, 3), Decl(instantiatedModule.ts, 40, 3), Decl(instantiatedModule.ts, 41, 3), Decl(instantiatedModule.ts, 42, 3)) +>m2.Point : Symbol(M2.Point, Decl(instantiatedModule.ts, 20, 11)) +>m2 : Symbol(m2, Decl(instantiatedModule.ts, 30, 3), Decl(instantiatedModule.ts, 31, 3)) +>Point : Symbol(M2.Point, Decl(instantiatedModule.ts, 20, 11)) + +var p2 = new M2.Point(); +>p2 : Symbol(p2, Decl(instantiatedModule.ts, 39, 3), Decl(instantiatedModule.ts, 40, 3), Decl(instantiatedModule.ts, 41, 3), Decl(instantiatedModule.ts, 42, 3)) +>M2.Point : Symbol(M2.Point, Decl(instantiatedModule.ts, 20, 11)) +>M2 : Symbol(M2, Decl(instantiatedModule.ts, 16, 16)) +>Point : Symbol(M2.Point, Decl(instantiatedModule.ts, 20, 11)) + +module M3 { +>M3 : Symbol(M3, Decl(instantiatedModule.ts, 42, 24)) + + export enum Color { Blue, Red } +>Color : Symbol(Color, Decl(instantiatedModule.ts, 44, 11)) +>Blue : Symbol(Color.Blue, Decl(instantiatedModule.ts, 45, 23)) +>Red : Symbol(Color.Red, Decl(instantiatedModule.ts, 45, 29)) +} + +var m3: typeof M3; +>m3 : Symbol(m3, Decl(instantiatedModule.ts, 48, 3), Decl(instantiatedModule.ts, 49, 3)) +>M3 : Symbol(M3, Decl(instantiatedModule.ts, 42, 24)) + +var m3 = M3; +>m3 : Symbol(m3, Decl(instantiatedModule.ts, 48, 3), Decl(instantiatedModule.ts, 49, 3)) +>M3 : Symbol(M3, Decl(instantiatedModule.ts, 42, 24)) + +var a3: typeof M3.Color; +>a3 : Symbol(a3, Decl(instantiatedModule.ts, 51, 3), Decl(instantiatedModule.ts, 52, 3), Decl(instantiatedModule.ts, 53, 3)) +>M3.Color : Symbol(M3.Color, Decl(instantiatedModule.ts, 44, 11)) +>M3 : Symbol(M3, Decl(instantiatedModule.ts, 42, 24)) +>Color : Symbol(M3.Color, Decl(instantiatedModule.ts, 44, 11)) + +var a3 = m3.Color; +>a3 : Symbol(a3, Decl(instantiatedModule.ts, 51, 3), Decl(instantiatedModule.ts, 52, 3), Decl(instantiatedModule.ts, 53, 3)) +>m3.Color : Symbol(M3.Color, Decl(instantiatedModule.ts, 44, 11)) +>m3 : Symbol(m3, Decl(instantiatedModule.ts, 48, 3), Decl(instantiatedModule.ts, 49, 3)) +>Color : Symbol(M3.Color, Decl(instantiatedModule.ts, 44, 11)) + +var a3 = M3.Color; +>a3 : Symbol(a3, Decl(instantiatedModule.ts, 51, 3), Decl(instantiatedModule.ts, 52, 3), Decl(instantiatedModule.ts, 53, 3)) +>M3.Color : Symbol(M3.Color, Decl(instantiatedModule.ts, 44, 11)) +>M3 : Symbol(M3, Decl(instantiatedModule.ts, 42, 24)) +>Color : Symbol(M3.Color, Decl(instantiatedModule.ts, 44, 11)) + +var blue: M3.Color = a3.Blue; +>blue : Symbol(blue, Decl(instantiatedModule.ts, 54, 3)) +>M3 : Symbol(M3, Decl(instantiatedModule.ts, 42, 24)) +>Color : Symbol(M3.Color, Decl(instantiatedModule.ts, 44, 11)) +>a3.Blue : Symbol(M3.Color.Blue, Decl(instantiatedModule.ts, 45, 23)) +>a3 : Symbol(a3, Decl(instantiatedModule.ts, 51, 3), Decl(instantiatedModule.ts, 52, 3), Decl(instantiatedModule.ts, 53, 3)) +>Blue : Symbol(M3.Color.Blue, Decl(instantiatedModule.ts, 45, 23)) + +var p3: M3.Color; +>p3 : Symbol(p3, Decl(instantiatedModule.ts, 56, 3), Decl(instantiatedModule.ts, 57, 3), Decl(instantiatedModule.ts, 58, 3)) +>M3 : Symbol(M3, Decl(instantiatedModule.ts, 42, 24)) +>Color : Symbol(M3.Color, Decl(instantiatedModule.ts, 44, 11)) + +var p3 = M3.Color.Red; +>p3 : Symbol(p3, Decl(instantiatedModule.ts, 56, 3), Decl(instantiatedModule.ts, 57, 3), Decl(instantiatedModule.ts, 58, 3)) +>M3.Color.Red : Symbol(M3.Color.Red, Decl(instantiatedModule.ts, 45, 29)) +>M3.Color : Symbol(M3.Color, Decl(instantiatedModule.ts, 44, 11)) +>M3 : Symbol(M3, Decl(instantiatedModule.ts, 42, 24)) +>Color : Symbol(M3.Color, Decl(instantiatedModule.ts, 44, 11)) +>Red : Symbol(M3.Color.Red, Decl(instantiatedModule.ts, 45, 29)) + +var p3 = m3.Color.Blue; +>p3 : Symbol(p3, Decl(instantiatedModule.ts, 56, 3), Decl(instantiatedModule.ts, 57, 3), Decl(instantiatedModule.ts, 58, 3)) +>m3.Color.Blue : Symbol(M3.Color.Blue, Decl(instantiatedModule.ts, 45, 23)) +>m3.Color : Symbol(M3.Color, Decl(instantiatedModule.ts, 44, 11)) +>m3 : Symbol(m3, Decl(instantiatedModule.ts, 48, 3), Decl(instantiatedModule.ts, 49, 3)) +>Color : Symbol(M3.Color, Decl(instantiatedModule.ts, 44, 11)) +>Blue : Symbol(M3.Color.Blue, Decl(instantiatedModule.ts, 45, 23)) + diff --git a/tests/baselines/reference/instantiatedModule.types b/tests/baselines/reference/instantiatedModule.types index b3f4dc0d5a1..e9933eea804 100644 --- a/tests/baselines/reference/instantiatedModule.types +++ b/tests/baselines/reference/instantiatedModule.types @@ -11,6 +11,7 @@ module M { export var Point = 1; >Point : number +>1 : number } // primary expression @@ -44,7 +45,7 @@ var p1: { x: number; y: number; } var p1: M.Point; >p1 : { x: number; y: number; } ->M : unknown +>M : any >Point : M.Point // making the point a class instead of an interface @@ -68,7 +69,9 @@ module M2 { return { x: 0, y: 0 }; >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } } } @@ -84,6 +87,7 @@ var m2 = M2; // static side of the class var a2: typeof M2.Point; >a2 : typeof M2.Point +>M2.Point : typeof M2.Point >M2 : typeof M2 >Point : typeof M2.Point @@ -101,7 +105,7 @@ var a2 = M2.Point; var o: M2.Point = a2.Origin(); >o : M2.Point ->M2 : unknown +>M2 : any >Point : M2.Point >a2.Origin() : M2.Point >a2.Origin : () => M2.Point @@ -115,7 +119,7 @@ var p2: { x: number; y: number } var p2: M2.Point; >p2 : { x: number; y: number; } ->M2 : unknown +>M2 : any >Point : M2.Point var p2 = new m2.Point(); @@ -151,6 +155,7 @@ var m3 = M3; var a3: typeof M3.Color; >a3 : typeof M3.Color +>M3.Color : typeof M3.Color >M3 : typeof M3 >Color : typeof M3.Color @@ -168,7 +173,7 @@ var a3 = M3.Color; var blue: M3.Color = a3.Blue; >blue : M3.Color ->M3 : unknown +>M3 : any >Color : M3.Color >a3.Blue : M3.Color >a3 : typeof M3.Color @@ -176,7 +181,7 @@ var blue: M3.Color = a3.Blue; var p3: M3.Color; >p3 : M3.Color ->M3 : unknown +>M3 : any >Color : M3.Color var p3 = M3.Color.Red; diff --git a/tests/baselines/reference/instantiatedReturnTypeContravariance.symbols b/tests/baselines/reference/instantiatedReturnTypeContravariance.symbols new file mode 100644 index 00000000000..f64ebfdce21 --- /dev/null +++ b/tests/baselines/reference/instantiatedReturnTypeContravariance.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/instantiatedReturnTypeContravariance.ts === +interface B { +>B : Symbol(B, Decl(instantiatedReturnTypeContravariance.ts, 0, 0)) +>T : Symbol(T, Decl(instantiatedReturnTypeContravariance.ts, 0, 12)) + +name: string; +>name : Symbol(name, Decl(instantiatedReturnTypeContravariance.ts, 0, 16)) + +x(): T; +>x : Symbol(x, Decl(instantiatedReturnTypeContravariance.ts, 2, 13)) +>T : Symbol(T, Decl(instantiatedReturnTypeContravariance.ts, 0, 12)) + +} + +class c { +>c : Symbol(c, Decl(instantiatedReturnTypeContravariance.ts, 6, 1)) + +foo(): B { +>foo : Symbol(foo, Decl(instantiatedReturnTypeContravariance.ts, 8, 9)) +>B : Symbol(B, Decl(instantiatedReturnTypeContravariance.ts, 0, 0)) + +return null; + +} + +} + +class d extends c { +>d : Symbol(d, Decl(instantiatedReturnTypeContravariance.ts, 16, 1)) +>c : Symbol(c, Decl(instantiatedReturnTypeContravariance.ts, 6, 1)) + +foo(): B { +>foo : Symbol(foo, Decl(instantiatedReturnTypeContravariance.ts, 18, 19)) +>B : Symbol(B, Decl(instantiatedReturnTypeContravariance.ts, 0, 0)) + +return null; + +} + +} + + + diff --git a/tests/baselines/reference/instantiatedReturnTypeContravariance.types b/tests/baselines/reference/instantiatedReturnTypeContravariance.types index 8b7cb7b609e..1de1b8b7151 100644 --- a/tests/baselines/reference/instantiatedReturnTypeContravariance.types +++ b/tests/baselines/reference/instantiatedReturnTypeContravariance.types @@ -20,6 +20,7 @@ foo(): B { >B : B return null; +>null : null } @@ -34,6 +35,7 @@ foo(): B { >B : B return null; +>null : null } diff --git a/tests/baselines/reference/interMixingModulesInterfaces0.symbols b/tests/baselines/reference/interMixingModulesInterfaces0.symbols new file mode 100644 index 00000000000..6b482053b2e --- /dev/null +++ b/tests/baselines/reference/interMixingModulesInterfaces0.symbols @@ -0,0 +1,36 @@ +=== tests/cases/compiler/interMixingModulesInterfaces0.ts === +module A { +>A : Symbol(A, Decl(interMixingModulesInterfaces0.ts, 0, 0)) + + export module B { +>B : Symbol(B, Decl(interMixingModulesInterfaces0.ts, 0, 10), Decl(interMixingModulesInterfaces0.ts, 6, 5)) + + export function createB(): B { +>createB : Symbol(createB, Decl(interMixingModulesInterfaces0.ts, 2, 21)) +>B : Symbol(B, Decl(interMixingModulesInterfaces0.ts, 0, 10), Decl(interMixingModulesInterfaces0.ts, 6, 5)) + + return null; + } + } + + export interface B { +>B : Symbol(B, Decl(interMixingModulesInterfaces0.ts, 0, 10), Decl(interMixingModulesInterfaces0.ts, 6, 5)) + + name: string; +>name : Symbol(name, Decl(interMixingModulesInterfaces0.ts, 8, 24)) + + value: number; +>value : Symbol(value, Decl(interMixingModulesInterfaces0.ts, 9, 21)) + } +} + +var x: A.B = A.B.createB(); +>x : Symbol(x, Decl(interMixingModulesInterfaces0.ts, 14, 3)) +>A : Symbol(A, Decl(interMixingModulesInterfaces0.ts, 0, 0)) +>B : Symbol(A.B, Decl(interMixingModulesInterfaces0.ts, 0, 10), Decl(interMixingModulesInterfaces0.ts, 6, 5)) +>A.B.createB : Symbol(A.B.createB, Decl(interMixingModulesInterfaces0.ts, 2, 21)) +>A.B : Symbol(A.B, Decl(interMixingModulesInterfaces0.ts, 0, 10), Decl(interMixingModulesInterfaces0.ts, 6, 5)) +>A : Symbol(A, Decl(interMixingModulesInterfaces0.ts, 0, 0)) +>B : Symbol(A.B, Decl(interMixingModulesInterfaces0.ts, 0, 10), Decl(interMixingModulesInterfaces0.ts, 6, 5)) +>createB : Symbol(A.B.createB, Decl(interMixingModulesInterfaces0.ts, 2, 21)) + diff --git a/tests/baselines/reference/interMixingModulesInterfaces0.types b/tests/baselines/reference/interMixingModulesInterfaces0.types index 977b02e15e8..bc78303ba74 100644 --- a/tests/baselines/reference/interMixingModulesInterfaces0.types +++ b/tests/baselines/reference/interMixingModulesInterfaces0.types @@ -10,6 +10,7 @@ module A { >B : B return null; +>null : null } } @@ -26,7 +27,7 @@ module A { var x: A.B = A.B.createB(); >x : A.B ->A : unknown +>A : any >B : A.B >A.B.createB() : A.B >A.B.createB : () => A.B diff --git a/tests/baselines/reference/interMixingModulesInterfaces1.symbols b/tests/baselines/reference/interMixingModulesInterfaces1.symbols new file mode 100644 index 00000000000..39162cf5a42 --- /dev/null +++ b/tests/baselines/reference/interMixingModulesInterfaces1.symbols @@ -0,0 +1,36 @@ +=== tests/cases/compiler/interMixingModulesInterfaces1.ts === +module A { +>A : Symbol(A, Decl(interMixingModulesInterfaces1.ts, 0, 0)) + + export interface B { +>B : Symbol(B, Decl(interMixingModulesInterfaces1.ts, 0, 10), Decl(interMixingModulesInterfaces1.ts, 5, 5)) + + name: string; +>name : Symbol(name, Decl(interMixingModulesInterfaces1.ts, 2, 24)) + + value: number; +>value : Symbol(value, Decl(interMixingModulesInterfaces1.ts, 3, 21)) + } + + export module B { +>B : Symbol(B, Decl(interMixingModulesInterfaces1.ts, 0, 10), Decl(interMixingModulesInterfaces1.ts, 5, 5)) + + export function createB(): B { +>createB : Symbol(createB, Decl(interMixingModulesInterfaces1.ts, 7, 21)) +>B : Symbol(B, Decl(interMixingModulesInterfaces1.ts, 0, 10), Decl(interMixingModulesInterfaces1.ts, 5, 5)) + + return null; + } + } +} + +var x: A.B = A.B.createB(); +>x : Symbol(x, Decl(interMixingModulesInterfaces1.ts, 14, 3)) +>A : Symbol(A, Decl(interMixingModulesInterfaces1.ts, 0, 0)) +>B : Symbol(A.B, Decl(interMixingModulesInterfaces1.ts, 0, 10), Decl(interMixingModulesInterfaces1.ts, 5, 5)) +>A.B.createB : Symbol(A.B.createB, Decl(interMixingModulesInterfaces1.ts, 7, 21)) +>A.B : Symbol(A.B, Decl(interMixingModulesInterfaces1.ts, 0, 10), Decl(interMixingModulesInterfaces1.ts, 5, 5)) +>A : Symbol(A, Decl(interMixingModulesInterfaces1.ts, 0, 0)) +>B : Symbol(A.B, Decl(interMixingModulesInterfaces1.ts, 0, 10), Decl(interMixingModulesInterfaces1.ts, 5, 5)) +>createB : Symbol(A.B.createB, Decl(interMixingModulesInterfaces1.ts, 7, 21)) + diff --git a/tests/baselines/reference/interMixingModulesInterfaces1.types b/tests/baselines/reference/interMixingModulesInterfaces1.types index c94cc80e5bf..37401e3a788 100644 --- a/tests/baselines/reference/interMixingModulesInterfaces1.types +++ b/tests/baselines/reference/interMixingModulesInterfaces1.types @@ -20,13 +20,14 @@ module A { >B : B return null; +>null : null } } } var x: A.B = A.B.createB(); >x : A.B ->A : unknown +>A : any >B : A.B >A.B.createB() : A.B >A.B.createB : () => A.B diff --git a/tests/baselines/reference/interMixingModulesInterfaces2.symbols b/tests/baselines/reference/interMixingModulesInterfaces2.symbols new file mode 100644 index 00000000000..0362909047a --- /dev/null +++ b/tests/baselines/reference/interMixingModulesInterfaces2.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/interMixingModulesInterfaces2.ts === +module A { +>A : Symbol(A, Decl(interMixingModulesInterfaces2.ts, 0, 0)) + + export interface B { +>B : Symbol(B, Decl(interMixingModulesInterfaces2.ts, 0, 10)) + + name: string; +>name : Symbol(name, Decl(interMixingModulesInterfaces2.ts, 2, 24)) + + value: number; +>value : Symbol(value, Decl(interMixingModulesInterfaces2.ts, 3, 21)) + } + + module B { +>B : Symbol(B, Decl(interMixingModulesInterfaces2.ts, 0, 10), Decl(interMixingModulesInterfaces2.ts, 5, 5)) + + export function createB(): B { +>createB : Symbol(createB, Decl(interMixingModulesInterfaces2.ts, 7, 14)) +>B : Symbol(B, Decl(interMixingModulesInterfaces2.ts, 0, 10)) + + return null; + } + } +} + +var x: A.B = null; +>x : Symbol(x, Decl(interMixingModulesInterfaces2.ts, 14, 3)) +>A : Symbol(A, Decl(interMixingModulesInterfaces2.ts, 0, 0)) +>B : Symbol(A.B, Decl(interMixingModulesInterfaces2.ts, 0, 10)) + diff --git a/tests/baselines/reference/interMixingModulesInterfaces2.types b/tests/baselines/reference/interMixingModulesInterfaces2.types index ff21c25358b..6780a34dc7e 100644 --- a/tests/baselines/reference/interMixingModulesInterfaces2.types +++ b/tests/baselines/reference/interMixingModulesInterfaces2.types @@ -20,12 +20,14 @@ module A { >B : B return null; +>null : null } } } var x: A.B = null; >x : A.B ->A : unknown +>A : any >B : A.B +>null : null diff --git a/tests/baselines/reference/interMixingModulesInterfaces3.symbols b/tests/baselines/reference/interMixingModulesInterfaces3.symbols new file mode 100644 index 00000000000..482cc883930 --- /dev/null +++ b/tests/baselines/reference/interMixingModulesInterfaces3.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/interMixingModulesInterfaces3.ts === +module A { +>A : Symbol(A, Decl(interMixingModulesInterfaces3.ts, 0, 0)) + + module B { +>B : Symbol(B, Decl(interMixingModulesInterfaces3.ts, 0, 10), Decl(interMixingModulesInterfaces3.ts, 6, 5)) + + export function createB(): B { +>createB : Symbol(createB, Decl(interMixingModulesInterfaces3.ts, 2, 14)) +>B : Symbol(B, Decl(interMixingModulesInterfaces3.ts, 6, 5)) + + return null; + } + } + + export interface B { +>B : Symbol(B, Decl(interMixingModulesInterfaces3.ts, 6, 5)) + + name: string; +>name : Symbol(name, Decl(interMixingModulesInterfaces3.ts, 8, 24)) + + value: number; +>value : Symbol(value, Decl(interMixingModulesInterfaces3.ts, 9, 21)) + } +} + +var x: A.B = null; +>x : Symbol(x, Decl(interMixingModulesInterfaces3.ts, 14, 3)) +>A : Symbol(A, Decl(interMixingModulesInterfaces3.ts, 0, 0)) +>B : Symbol(A.B, Decl(interMixingModulesInterfaces3.ts, 6, 5)) + diff --git a/tests/baselines/reference/interMixingModulesInterfaces3.types b/tests/baselines/reference/interMixingModulesInterfaces3.types index 123d609c365..416ac215227 100644 --- a/tests/baselines/reference/interMixingModulesInterfaces3.types +++ b/tests/baselines/reference/interMixingModulesInterfaces3.types @@ -10,6 +10,7 @@ module A { >B : B return null; +>null : null } } @@ -26,6 +27,7 @@ module A { var x: A.B = null; >x : A.B ->A : unknown +>A : any >B : A.B +>null : null diff --git a/tests/baselines/reference/interMixingModulesInterfaces4.symbols b/tests/baselines/reference/interMixingModulesInterfaces4.symbols new file mode 100644 index 00000000000..498b34c721f --- /dev/null +++ b/tests/baselines/reference/interMixingModulesInterfaces4.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/interMixingModulesInterfaces4.ts === +module A { +>A : Symbol(A, Decl(interMixingModulesInterfaces4.ts, 0, 0)) + + export module B { +>B : Symbol(B, Decl(interMixingModulesInterfaces4.ts, 0, 10)) + + export function createB(): number { +>createB : Symbol(createB, Decl(interMixingModulesInterfaces4.ts, 2, 21)) + + return null; + } + } + + interface B { +>B : Symbol(B, Decl(interMixingModulesInterfaces4.ts, 0, 10), Decl(interMixingModulesInterfaces4.ts, 6, 5)) + + name: string; +>name : Symbol(name, Decl(interMixingModulesInterfaces4.ts, 8, 17)) + + value: number; +>value : Symbol(value, Decl(interMixingModulesInterfaces4.ts, 9, 21)) + } +} + +var x : number = A.B.createB(); +>x : Symbol(x, Decl(interMixingModulesInterfaces4.ts, 14, 3)) +>A.B.createB : Symbol(A.B.createB, Decl(interMixingModulesInterfaces4.ts, 2, 21)) +>A.B : Symbol(A.B, Decl(interMixingModulesInterfaces4.ts, 0, 10)) +>A : Symbol(A, Decl(interMixingModulesInterfaces4.ts, 0, 0)) +>B : Symbol(A.B, Decl(interMixingModulesInterfaces4.ts, 0, 10)) +>createB : Symbol(A.B.createB, Decl(interMixingModulesInterfaces4.ts, 2, 21)) + diff --git a/tests/baselines/reference/interMixingModulesInterfaces4.types b/tests/baselines/reference/interMixingModulesInterfaces4.types index e4e9bf385ac..456f7fc2202 100644 --- a/tests/baselines/reference/interMixingModulesInterfaces4.types +++ b/tests/baselines/reference/interMixingModulesInterfaces4.types @@ -9,6 +9,7 @@ module A { >createB : () => number return null; +>null : null } } diff --git a/tests/baselines/reference/interMixingModulesInterfaces5.symbols b/tests/baselines/reference/interMixingModulesInterfaces5.symbols new file mode 100644 index 00000000000..7f45a62c858 --- /dev/null +++ b/tests/baselines/reference/interMixingModulesInterfaces5.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/interMixingModulesInterfaces5.ts === +module A { +>A : Symbol(A, Decl(interMixingModulesInterfaces5.ts, 0, 0)) + + interface B { +>B : Symbol(B, Decl(interMixingModulesInterfaces5.ts, 0, 10), Decl(interMixingModulesInterfaces5.ts, 5, 5)) + + name: string; +>name : Symbol(name, Decl(interMixingModulesInterfaces5.ts, 2, 17)) + + value: number; +>value : Symbol(value, Decl(interMixingModulesInterfaces5.ts, 3, 21)) + } + + export module B { +>B : Symbol(B, Decl(interMixingModulesInterfaces5.ts, 5, 5)) + + export function createB(): number { +>createB : Symbol(createB, Decl(interMixingModulesInterfaces5.ts, 7, 21)) + + return null; + } + } +} + +var x: number = A.B.createB(); +>x : Symbol(x, Decl(interMixingModulesInterfaces5.ts, 14, 3)) +>A.B.createB : Symbol(A.B.createB, Decl(interMixingModulesInterfaces5.ts, 7, 21)) +>A.B : Symbol(A.B, Decl(interMixingModulesInterfaces5.ts, 5, 5)) +>A : Symbol(A, Decl(interMixingModulesInterfaces5.ts, 0, 0)) +>B : Symbol(A.B, Decl(interMixingModulesInterfaces5.ts, 5, 5)) +>createB : Symbol(A.B.createB, Decl(interMixingModulesInterfaces5.ts, 7, 21)) + diff --git a/tests/baselines/reference/interMixingModulesInterfaces5.types b/tests/baselines/reference/interMixingModulesInterfaces5.types index 199b37b16eb..977ecc39668 100644 --- a/tests/baselines/reference/interMixingModulesInterfaces5.types +++ b/tests/baselines/reference/interMixingModulesInterfaces5.types @@ -19,6 +19,7 @@ module A { >createB : () => number return null; +>null : null } } } diff --git a/tests/baselines/reference/interface0.symbols b/tests/baselines/reference/interface0.symbols new file mode 100644 index 00000000000..25e12370916 --- /dev/null +++ b/tests/baselines/reference/interface0.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/interface0.ts === +interface Generic { +>Generic : Symbol(Generic, Decl(interface0.ts, 0, 0)) +>T : Symbol(T, Decl(interface0.ts, 0, 18)) + + x: T; +>x : Symbol(x, Decl(interface0.ts, 0, 22)) +>T : Symbol(T, Decl(interface0.ts, 0, 18)) +} + +var y: Generic = { x: 3 }; +>y : Symbol(y, Decl(interface0.ts, 4, 3)) +>Generic : Symbol(Generic, Decl(interface0.ts, 0, 0)) +>x : Symbol(x, Decl(interface0.ts, 4, 26)) + diff --git a/tests/baselines/reference/interface0.types b/tests/baselines/reference/interface0.types index ecbd2d212ed..8fd04eea83c 100644 --- a/tests/baselines/reference/interface0.types +++ b/tests/baselines/reference/interface0.types @@ -13,4 +13,5 @@ var y: Generic = { x: 3 }; >Generic : Generic >{ x: 3 } : { x: number; } >x : number +>3 : number diff --git a/tests/baselines/reference/interfaceContextualType.symbols b/tests/baselines/reference/interfaceContextualType.symbols new file mode 100644 index 00000000000..34831880431 --- /dev/null +++ b/tests/baselines/reference/interfaceContextualType.symbols @@ -0,0 +1,55 @@ +=== tests/cases/compiler/interfaceContextualType.ts === +export interface IOptions { +>IOptions : Symbol(IOptions, Decl(interfaceContextualType.ts, 0, 0)) + + italic?: boolean; +>italic : Symbol(italic, Decl(interfaceContextualType.ts, 0, 27)) + + bold?: boolean; +>bold : Symbol(bold, Decl(interfaceContextualType.ts, 1, 21)) +} +export interface IMap { +>IMap : Symbol(IMap, Decl(interfaceContextualType.ts, 3, 1)) + + [s: string]: IOptions; +>s : Symbol(s, Decl(interfaceContextualType.ts, 5, 5)) +>IOptions : Symbol(IOptions, Decl(interfaceContextualType.ts, 0, 0)) +} + +class Bug { +>Bug : Symbol(Bug, Decl(interfaceContextualType.ts, 6, 1)) + + public values: IMap; +>values : Symbol(values, Decl(interfaceContextualType.ts, 8, 11)) +>IMap : Symbol(IMap, Decl(interfaceContextualType.ts, 3, 1)) + + ok() { +>ok : Symbol(ok, Decl(interfaceContextualType.ts, 9, 24)) + + this.values = {}; +>this.values : Symbol(values, Decl(interfaceContextualType.ts, 8, 11)) +>this : Symbol(Bug, Decl(interfaceContextualType.ts, 6, 1)) +>values : Symbol(values, Decl(interfaceContextualType.ts, 8, 11)) + + this.values['comments'] = { italic: true }; +>this.values : Symbol(values, Decl(interfaceContextualType.ts, 8, 11)) +>this : Symbol(Bug, Decl(interfaceContextualType.ts, 6, 1)) +>values : Symbol(values, Decl(interfaceContextualType.ts, 8, 11)) +>italic : Symbol(italic, Decl(interfaceContextualType.ts, 12, 35)) + } + shouldBeOK() { +>shouldBeOK : Symbol(shouldBeOK, Decl(interfaceContextualType.ts, 13, 5)) + + this.values = { +>this.values : Symbol(values, Decl(interfaceContextualType.ts, 8, 11)) +>this : Symbol(Bug, Decl(interfaceContextualType.ts, 6, 1)) +>values : Symbol(values, Decl(interfaceContextualType.ts, 8, 11)) + + comments: { italic: true } +>comments : Symbol(comments, Decl(interfaceContextualType.ts, 15, 23)) +>italic : Symbol(italic, Decl(interfaceContextualType.ts, 16, 23)) + + }; + } +} + diff --git a/tests/baselines/reference/interfaceContextualType.types b/tests/baselines/reference/interfaceContextualType.types index 3078ecfdfa4..4b932a71538 100644 --- a/tests/baselines/reference/interfaceContextualType.types +++ b/tests/baselines/reference/interfaceContextualType.types @@ -39,8 +39,10 @@ class Bug { >this.values : IMap >this : Bug >values : IMap +>'comments' : string >{ italic: true } : { italic: boolean; } >italic : boolean +>true : boolean } shouldBeOK() { >shouldBeOK : () => void @@ -56,6 +58,7 @@ class Bug { >comments : { italic: boolean; } >{ italic: true } : { italic: boolean; } >italic : boolean +>true : boolean }; } diff --git a/tests/baselines/reference/interfaceDeclaration5.symbols b/tests/baselines/reference/interfaceDeclaration5.symbols new file mode 100644 index 00000000000..3478a56693a --- /dev/null +++ b/tests/baselines/reference/interfaceDeclaration5.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/interfaceDeclaration5.ts === +export interface I1 { item:string; } +>I1 : Symbol(I1, Decl(interfaceDeclaration5.ts, 0, 0)) +>item : Symbol(item, Decl(interfaceDeclaration5.ts, 0, 21)) + +export class C1 { } +>C1 : Symbol(C1, Decl(interfaceDeclaration5.ts, 0, 36)) + diff --git a/tests/baselines/reference/interfaceDoesNotDependOnBaseTypes.js b/tests/baselines/reference/interfaceDoesNotDependOnBaseTypes.js new file mode 100644 index 00000000000..4d8a23ddd25 --- /dev/null +++ b/tests/baselines/reference/interfaceDoesNotDependOnBaseTypes.js @@ -0,0 +1,16 @@ +//// [interfaceDoesNotDependOnBaseTypes.ts] +var x: StringTree; +if (typeof x !== "string") { + x.push(""); + x.push([""]); +} + +type StringTree = string | StringTreeArray; +interface StringTreeArray extends Array { } + +//// [interfaceDoesNotDependOnBaseTypes.js] +var x; +if (typeof x !== "string") { + x.push(""); + x.push([""]); +} diff --git a/tests/baselines/reference/interfaceDoesNotDependOnBaseTypes.symbols b/tests/baselines/reference/interfaceDoesNotDependOnBaseTypes.symbols new file mode 100644 index 00000000000..6b45cd1daad --- /dev/null +++ b/tests/baselines/reference/interfaceDoesNotDependOnBaseTypes.symbols @@ -0,0 +1,28 @@ +=== tests/cases/conformance/types/typeAliases/interfaceDoesNotDependOnBaseTypes.ts === +var x: StringTree; +>x : Symbol(x, Decl(interfaceDoesNotDependOnBaseTypes.ts, 0, 3)) +>StringTree : Symbol(StringTree, Decl(interfaceDoesNotDependOnBaseTypes.ts, 4, 1)) + +if (typeof x !== "string") { +>x : Symbol(x, Decl(interfaceDoesNotDependOnBaseTypes.ts, 0, 3)) + + x.push(""); +>x.push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29)) +>x : Symbol(x, Decl(interfaceDoesNotDependOnBaseTypes.ts, 0, 3)) +>push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29)) + + x.push([""]); +>x.push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29)) +>x : Symbol(x, Decl(interfaceDoesNotDependOnBaseTypes.ts, 0, 3)) +>push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29)) +} + +type StringTree = string | StringTreeArray; +>StringTree : Symbol(StringTree, Decl(interfaceDoesNotDependOnBaseTypes.ts, 4, 1)) +>StringTreeArray : Symbol(StringTreeArray, Decl(interfaceDoesNotDependOnBaseTypes.ts, 6, 43)) + +interface StringTreeArray extends Array { } +>StringTreeArray : Symbol(StringTreeArray, Decl(interfaceDoesNotDependOnBaseTypes.ts, 6, 43)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>StringTree : Symbol(StringTree, Decl(interfaceDoesNotDependOnBaseTypes.ts, 4, 1)) + diff --git a/tests/baselines/reference/interfaceDoesNotDependOnBaseTypes.types b/tests/baselines/reference/interfaceDoesNotDependOnBaseTypes.types new file mode 100644 index 00000000000..7b5d60a5261 --- /dev/null +++ b/tests/baselines/reference/interfaceDoesNotDependOnBaseTypes.types @@ -0,0 +1,36 @@ +=== tests/cases/conformance/types/typeAliases/interfaceDoesNotDependOnBaseTypes.ts === +var x: StringTree; +>x : string | StringTreeArray +>StringTree : string | StringTreeArray + +if (typeof x !== "string") { +>typeof x !== "string" : boolean +>typeof x : string +>x : string | StringTreeArray +>"string" : string + + x.push(""); +>x.push("") : number +>x.push : (...items: (string | StringTreeArray)[]) => number +>x : StringTreeArray +>push : (...items: (string | StringTreeArray)[]) => number +>"" : string + + x.push([""]); +>x.push([""]) : number +>x.push : (...items: (string | StringTreeArray)[]) => number +>x : StringTreeArray +>push : (...items: (string | StringTreeArray)[]) => number +>[""] : string[] +>"" : string +} + +type StringTree = string | StringTreeArray; +>StringTree : string | StringTreeArray +>StringTreeArray : StringTreeArray + +interface StringTreeArray extends Array { } +>StringTreeArray : StringTreeArray +>Array : T[] +>StringTree : string | StringTreeArray + diff --git a/tests/baselines/reference/interfaceExtendsClass1.symbols b/tests/baselines/reference/interfaceExtendsClass1.symbols new file mode 100644 index 00000000000..6caa2013a25 --- /dev/null +++ b/tests/baselines/reference/interfaceExtendsClass1.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/interfaceExtendsClass1.ts === +class Control { +>Control : Symbol(Control, Decl(interfaceExtendsClass1.ts, 0, 0)) + + private state: any; +>state : Symbol(state, Decl(interfaceExtendsClass1.ts, 0, 15)) +} +interface SelectableControl extends Control { +>SelectableControl : Symbol(SelectableControl, Decl(interfaceExtendsClass1.ts, 2, 1)) +>Control : Symbol(Control, Decl(interfaceExtendsClass1.ts, 0, 0)) + + select(): void; +>select : Symbol(select, Decl(interfaceExtendsClass1.ts, 3, 45)) +} +class Button extends Control { +>Button : Symbol(Button, Decl(interfaceExtendsClass1.ts, 5, 1)) +>Control : Symbol(Control, Decl(interfaceExtendsClass1.ts, 0, 0)) + + select() { } +>select : Symbol(select, Decl(interfaceExtendsClass1.ts, 6, 30)) +} +class TextBox extends Control { +>TextBox : Symbol(TextBox, Decl(interfaceExtendsClass1.ts, 8, 1)) +>Control : Symbol(Control, Decl(interfaceExtendsClass1.ts, 0, 0)) + + select() { } +>select : Symbol(select, Decl(interfaceExtendsClass1.ts, 9, 31)) +} +class Image extends Control { +>Image : Symbol(Image, Decl(interfaceExtendsClass1.ts, 11, 1)) +>Control : Symbol(Control, Decl(interfaceExtendsClass1.ts, 0, 0)) +} +class Location { +>Location : Symbol(Location, Decl(interfaceExtendsClass1.ts, 13, 1)) + + select() { } +>select : Symbol(select, Decl(interfaceExtendsClass1.ts, 14, 16)) +} + diff --git a/tests/baselines/reference/interfaceInReopenedModule.symbols b/tests/baselines/reference/interfaceInReopenedModule.symbols new file mode 100644 index 00000000000..3cde824b451 --- /dev/null +++ b/tests/baselines/reference/interfaceInReopenedModule.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/interfaceInReopenedModule.ts === +module m { +>m : Symbol(m, Decl(interfaceInReopenedModule.ts, 0, 0), Decl(interfaceInReopenedModule.ts, 1, 1)) +} + +// In second instance of same module, exported interface is not visible +module m { +>m : Symbol(m, Decl(interfaceInReopenedModule.ts, 0, 0), Decl(interfaceInReopenedModule.ts, 1, 1)) + + interface f {} +>f : Symbol(f, Decl(interfaceInReopenedModule.ts, 4, 10)) + + export class n { +>n : Symbol(n, Decl(interfaceInReopenedModule.ts, 5, 18)) + + private n: f; +>n : Symbol(n, Decl(interfaceInReopenedModule.ts, 6, 20)) +>f : Symbol(f, Decl(interfaceInReopenedModule.ts, 4, 10)) + } +} + diff --git a/tests/baselines/reference/interfaceInheritance2.symbols b/tests/baselines/reference/interfaceInheritance2.symbols new file mode 100644 index 00000000000..4e72717f6d8 --- /dev/null +++ b/tests/baselines/reference/interfaceInheritance2.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/interfaceInheritance2.ts === +interface I6 { +>I6 : Symbol(I6, Decl(interfaceInheritance2.ts, 0, 0)) + + ():void; +} + +interface I7 extends I6 { } +>I7 : Symbol(I7, Decl(interfaceInheritance2.ts, 2, 1)) +>I6 : Symbol(I6, Decl(interfaceInheritance2.ts, 0, 0)) + +var v1:I7; +>v1 : Symbol(v1, Decl(interfaceInheritance2.ts, 6, 3)) +>I7 : Symbol(I7, Decl(interfaceInheritance2.ts, 2, 1)) + +v1(); +>v1 : Symbol(v1, Decl(interfaceInheritance2.ts, 6, 3)) + diff --git a/tests/baselines/reference/interfaceOnly.symbols b/tests/baselines/reference/interfaceOnly.symbols new file mode 100644 index 00000000000..70473ff3139 --- /dev/null +++ b/tests/baselines/reference/interfaceOnly.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/interfaceOnly.ts === +interface foo { +>foo : Symbol(foo, Decl(interfaceOnly.ts, 0, 0)) + + foo(); +>foo : Symbol(foo, Decl(interfaceOnly.ts, 0, 15)) + + f2 (f: ()=> void); +>f2 : Symbol(f2, Decl(interfaceOnly.ts, 1, 10)) +>f : Symbol(f, Decl(interfaceOnly.ts, 2, 8)) +} diff --git a/tests/baselines/reference/interfacePropertiesWithSameName1.symbols b/tests/baselines/reference/interfacePropertiesWithSameName1.symbols new file mode 100644 index 00000000000..aa002fa4af2 --- /dev/null +++ b/tests/baselines/reference/interfacePropertiesWithSameName1.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/interfacePropertiesWithSameName1.ts === +interface Mover { +>Mover : Symbol(Mover, Decl(interfacePropertiesWithSameName1.ts, 0, 0)) + + move(): void; +>move : Symbol(move, Decl(interfacePropertiesWithSameName1.ts, 0, 17)) + + getStatus(): { speed: number; }; +>getStatus : Symbol(getStatus, Decl(interfacePropertiesWithSameName1.ts, 1, 17)) +>speed : Symbol(speed, Decl(interfacePropertiesWithSameName1.ts, 2, 18)) +} +interface Shaker { +>Shaker : Symbol(Shaker, Decl(interfacePropertiesWithSameName1.ts, 3, 1)) + + shake(): void; +>shake : Symbol(shake, Decl(interfacePropertiesWithSameName1.ts, 4, 18)) + + getStatus(): { frequency: number; }; +>getStatus : Symbol(getStatus, Decl(interfacePropertiesWithSameName1.ts, 5, 18)) +>frequency : Symbol(frequency, Decl(interfacePropertiesWithSameName1.ts, 6, 18)) +} + +interface MoverShaker extends Mover, Shaker { +>MoverShaker : Symbol(MoverShaker, Decl(interfacePropertiesWithSameName1.ts, 7, 1)) +>Mover : Symbol(Mover, Decl(interfacePropertiesWithSameName1.ts, 0, 0)) +>Shaker : Symbol(Shaker, Decl(interfacePropertiesWithSameName1.ts, 3, 1)) + + getStatus(): { speed: number; frequency: number; }; +>getStatus : Symbol(getStatus, Decl(interfacePropertiesWithSameName1.ts, 9, 45)) +>speed : Symbol(speed, Decl(interfacePropertiesWithSameName1.ts, 10, 18)) +>frequency : Symbol(frequency, Decl(interfacePropertiesWithSameName1.ts, 10, 33)) +} + diff --git a/tests/baselines/reference/interfaceSubtyping.symbols b/tests/baselines/reference/interfaceSubtyping.symbols new file mode 100644 index 00000000000..6f77110885f --- /dev/null +++ b/tests/baselines/reference/interfaceSubtyping.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/interfaceSubtyping.ts === +interface iface { +>iface : Symbol(iface, Decl(interfaceSubtyping.ts, 0, 0)) + + foo(): void; +>foo : Symbol(foo, Decl(interfaceSubtyping.ts, 0, 17)) +} +class Camera implements iface{ +>Camera : Symbol(Camera, Decl(interfaceSubtyping.ts, 2, 1)) +>iface : Symbol(iface, Decl(interfaceSubtyping.ts, 0, 0)) + + constructor (public str: string) { +>str : Symbol(str, Decl(interfaceSubtyping.ts, 4, 17)) + } + foo() { return "s"; } +>foo : Symbol(foo, Decl(interfaceSubtyping.ts, 5, 5)) +} + diff --git a/tests/baselines/reference/interfaceSubtyping.types b/tests/baselines/reference/interfaceSubtyping.types index d9b31a50df9..26a900a56b2 100644 --- a/tests/baselines/reference/interfaceSubtyping.types +++ b/tests/baselines/reference/interfaceSubtyping.types @@ -14,5 +14,6 @@ class Camera implements iface{ } foo() { return "s"; } >foo : () => string +>"s" : string } diff --git a/tests/baselines/reference/interfaceThatHidesBaseProperty.symbols b/tests/baselines/reference/interfaceThatHidesBaseProperty.symbols new file mode 100644 index 00000000000..2705aef2b27 --- /dev/null +++ b/tests/baselines/reference/interfaceThatHidesBaseProperty.symbols @@ -0,0 +1,22 @@ +=== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatHidesBaseProperty.ts === +interface Base { +>Base : Symbol(Base, Decl(interfaceThatHidesBaseProperty.ts, 0, 0)) + + x: { a: number }; +>x : Symbol(x, Decl(interfaceThatHidesBaseProperty.ts, 0, 16)) +>a : Symbol(a, Decl(interfaceThatHidesBaseProperty.ts, 1, 8)) +} + +interface Derived extends Base { +>Derived : Symbol(Derived, Decl(interfaceThatHidesBaseProperty.ts, 2, 1)) +>Base : Symbol(Base, Decl(interfaceThatHidesBaseProperty.ts, 0, 0)) + + x: { +>x : Symbol(x, Decl(interfaceThatHidesBaseProperty.ts, 4, 32)) + + a: number; b: number; +>a : Symbol(a, Decl(interfaceThatHidesBaseProperty.ts, 5, 8)) +>b : Symbol(b, Decl(interfaceThatHidesBaseProperty.ts, 6, 18)) + + }; +} diff --git a/tests/baselines/reference/interfaceWithCallAndConstructSignature.symbols b/tests/baselines/reference/interfaceWithCallAndConstructSignature.symbols new file mode 100644 index 00000000000..d9811466659 --- /dev/null +++ b/tests/baselines/reference/interfaceWithCallAndConstructSignature.symbols @@ -0,0 +1,20 @@ +=== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithCallAndConstructSignature.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(interfaceWithCallAndConstructSignature.ts, 0, 0)) + + (): number; + new (): any; +} + +var f: Foo; +>f : Symbol(f, Decl(interfaceWithCallAndConstructSignature.ts, 5, 3)) +>Foo : Symbol(Foo, Decl(interfaceWithCallAndConstructSignature.ts, 0, 0)) + +var r = f(); +>r : Symbol(r, Decl(interfaceWithCallAndConstructSignature.ts, 6, 3)) +>f : Symbol(f, Decl(interfaceWithCallAndConstructSignature.ts, 5, 3)) + +var r2 = new f(); +>r2 : Symbol(r2, Decl(interfaceWithCallAndConstructSignature.ts, 7, 3)) +>f : Symbol(f, Decl(interfaceWithCallAndConstructSignature.ts, 5, 3)) + diff --git a/tests/baselines/reference/interfaceWithCallSignaturesThatHidesBaseSignature.symbols b/tests/baselines/reference/interfaceWithCallSignaturesThatHidesBaseSignature.symbols new file mode 100644 index 00000000000..8557f8e61b9 --- /dev/null +++ b/tests/baselines/reference/interfaceWithCallSignaturesThatHidesBaseSignature.symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithCallSignaturesThatHidesBaseSignature.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(interfaceWithCallSignaturesThatHidesBaseSignature.ts, 0, 0)) + + (): { a: number }; +>a : Symbol(a, Decl(interfaceWithCallSignaturesThatHidesBaseSignature.ts, 1, 9)) +} + +interface Derived extends Foo { +>Derived : Symbol(Derived, Decl(interfaceWithCallSignaturesThatHidesBaseSignature.ts, 2, 1)) +>Foo : Symbol(Foo, Decl(interfaceWithCallSignaturesThatHidesBaseSignature.ts, 0, 0)) + + (): { a: number; b: number }; +>a : Symbol(a, Decl(interfaceWithCallSignaturesThatHidesBaseSignature.ts, 5, 9)) +>b : Symbol(b, Decl(interfaceWithCallSignaturesThatHidesBaseSignature.ts, 5, 20)) +} + +var d: Derived; +>d : Symbol(d, Decl(interfaceWithCallSignaturesThatHidesBaseSignature.ts, 8, 3)) +>Derived : Symbol(Derived, Decl(interfaceWithCallSignaturesThatHidesBaseSignature.ts, 2, 1)) + +var r = d(); +>r : Symbol(r, Decl(interfaceWithCallSignaturesThatHidesBaseSignature.ts, 9, 3)) +>d : Symbol(d, Decl(interfaceWithCallSignaturesThatHidesBaseSignature.ts, 8, 3)) + diff --git a/tests/baselines/reference/interfaceWithCallSignaturesThatHidesBaseSignature2.symbols b/tests/baselines/reference/interfaceWithCallSignaturesThatHidesBaseSignature2.symbols new file mode 100644 index 00000000000..0636b2dbaff --- /dev/null +++ b/tests/baselines/reference/interfaceWithCallSignaturesThatHidesBaseSignature2.symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithCallSignaturesThatHidesBaseSignature2.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(interfaceWithCallSignaturesThatHidesBaseSignature2.ts, 0, 0)) + + (): { a: number; b: number }; +>a : Symbol(a, Decl(interfaceWithCallSignaturesThatHidesBaseSignature2.ts, 1, 9)) +>b : Symbol(b, Decl(interfaceWithCallSignaturesThatHidesBaseSignature2.ts, 1, 20)) +} + +interface Derived extends Foo { // error +>Derived : Symbol(Derived, Decl(interfaceWithCallSignaturesThatHidesBaseSignature2.ts, 2, 1)) +>Foo : Symbol(Foo, Decl(interfaceWithCallSignaturesThatHidesBaseSignature2.ts, 0, 0)) + + (): { a: number }; +>a : Symbol(a, Decl(interfaceWithCallSignaturesThatHidesBaseSignature2.ts, 5, 9)) +} + +var d: Derived; +>d : Symbol(d, Decl(interfaceWithCallSignaturesThatHidesBaseSignature2.ts, 8, 3)) +>Derived : Symbol(Derived, Decl(interfaceWithCallSignaturesThatHidesBaseSignature2.ts, 2, 1)) + +var r = d(); +>r : Symbol(r, Decl(interfaceWithCallSignaturesThatHidesBaseSignature2.ts, 9, 3)) +>d : Symbol(d, Decl(interfaceWithCallSignaturesThatHidesBaseSignature2.ts, 8, 3)) + diff --git a/tests/baselines/reference/interfaceWithCommaSeparators.symbols b/tests/baselines/reference/interfaceWithCommaSeparators.symbols new file mode 100644 index 00000000000..e96a8852d56 --- /dev/null +++ b/tests/baselines/reference/interfaceWithCommaSeparators.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/interfaceWithCommaSeparators.ts === +var v: { bar(): void, baz } +>v : Symbol(v, Decl(interfaceWithCommaSeparators.ts, 0, 3)) +>bar : Symbol(bar, Decl(interfaceWithCommaSeparators.ts, 0, 8)) +>baz : Symbol(baz, Decl(interfaceWithCommaSeparators.ts, 0, 21)) + +interface Foo { bar(): void, baz } +>Foo : Symbol(Foo, Decl(interfaceWithCommaSeparators.ts, 0, 27)) +>bar : Symbol(bar, Decl(interfaceWithCommaSeparators.ts, 1, 15)) +>baz : Symbol(baz, Decl(interfaceWithCommaSeparators.ts, 1, 28)) + diff --git a/tests/baselines/reference/interfaceWithConstructSignaturesThatHidesBaseSignature.symbols b/tests/baselines/reference/interfaceWithConstructSignaturesThatHidesBaseSignature.symbols new file mode 100644 index 00000000000..377d8053414 --- /dev/null +++ b/tests/baselines/reference/interfaceWithConstructSignaturesThatHidesBaseSignature.symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithConstructSignaturesThatHidesBaseSignature.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature.ts, 0, 0)) + + new (): { a: number }; +>a : Symbol(a, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature.ts, 1, 13)) +} + +interface Derived extends Foo { +>Derived : Symbol(Derived, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature.ts, 2, 1)) +>Foo : Symbol(Foo, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature.ts, 0, 0)) + + new (): { a: number; b: number }; +>a : Symbol(a, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature.ts, 5, 13)) +>b : Symbol(b, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature.ts, 5, 24)) +} + +var d: Derived; +>d : Symbol(d, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature.ts, 8, 3)) +>Derived : Symbol(Derived, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature.ts, 2, 1)) + +var r = new d(); +>r : Symbol(r, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature.ts, 9, 3)) +>d : Symbol(d, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature.ts, 8, 3)) + diff --git a/tests/baselines/reference/interfaceWithConstructSignaturesThatHidesBaseSignature2.symbols b/tests/baselines/reference/interfaceWithConstructSignaturesThatHidesBaseSignature2.symbols new file mode 100644 index 00000000000..b15dcd632e7 --- /dev/null +++ b/tests/baselines/reference/interfaceWithConstructSignaturesThatHidesBaseSignature2.symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithConstructSignaturesThatHidesBaseSignature2.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature2.ts, 0, 0)) + + new (): { a: number; b: number }; +>a : Symbol(a, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature2.ts, 1, 13)) +>b : Symbol(b, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature2.ts, 1, 24)) +} + +interface Derived extends Foo { +>Derived : Symbol(Derived, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature2.ts, 2, 1)) +>Foo : Symbol(Foo, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature2.ts, 0, 0)) + + new (): { a: number }; // constructors not checked for conformance like a call signature is +>a : Symbol(a, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature2.ts, 5, 13)) +} + +var d: Derived; +>d : Symbol(d, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature2.ts, 8, 3)) +>Derived : Symbol(Derived, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature2.ts, 2, 1)) + +var r = new d(); +>r : Symbol(r, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature2.ts, 9, 3)) +>d : Symbol(d, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature2.ts, 8, 3)) + diff --git a/tests/baselines/reference/interfaceWithOptionalProperty.symbols b/tests/baselines/reference/interfaceWithOptionalProperty.symbols new file mode 100644 index 00000000000..262b3f01ccc --- /dev/null +++ b/tests/baselines/reference/interfaceWithOptionalProperty.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/interfaceWithOptionalProperty.ts === + +interface I { +>I : Symbol(I, Decl(interfaceWithOptionalProperty.ts, 0, 0)) + + x?: number; +>x : Symbol(x, Decl(interfaceWithOptionalProperty.ts, 1, 13)) +} diff --git a/tests/baselines/reference/interfaceWithOverloadedCallAndConstructSignatures.symbols b/tests/baselines/reference/interfaceWithOverloadedCallAndConstructSignatures.symbols new file mode 100644 index 00000000000..28dcb55238b --- /dev/null +++ b/tests/baselines/reference/interfaceWithOverloadedCallAndConstructSignatures.symbols @@ -0,0 +1,34 @@ +=== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithOverloadedCallAndConstructSignatures.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(interfaceWithOverloadedCallAndConstructSignatures.ts, 0, 0)) + + (): number; + (x: string): number; +>x : Symbol(x, Decl(interfaceWithOverloadedCallAndConstructSignatures.ts, 2, 5)) + + new (): any; + new (x: string): Object; +>x : Symbol(x, Decl(interfaceWithOverloadedCallAndConstructSignatures.ts, 5, 9)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +} + +var f: Foo; +>f : Symbol(f, Decl(interfaceWithOverloadedCallAndConstructSignatures.ts, 8, 3)) +>Foo : Symbol(Foo, Decl(interfaceWithOverloadedCallAndConstructSignatures.ts, 0, 0)) + +var r1 = f(); +>r1 : Symbol(r1, Decl(interfaceWithOverloadedCallAndConstructSignatures.ts, 9, 3)) +>f : Symbol(f, Decl(interfaceWithOverloadedCallAndConstructSignatures.ts, 8, 3)) + +var r2 = f(''); +>r2 : Symbol(r2, Decl(interfaceWithOverloadedCallAndConstructSignatures.ts, 10, 3)) +>f : Symbol(f, Decl(interfaceWithOverloadedCallAndConstructSignatures.ts, 8, 3)) + +var r3 = new f(); +>r3 : Symbol(r3, Decl(interfaceWithOverloadedCallAndConstructSignatures.ts, 11, 3)) +>f : Symbol(f, Decl(interfaceWithOverloadedCallAndConstructSignatures.ts, 8, 3)) + +var r4 = new f(''); +>r4 : Symbol(r4, Decl(interfaceWithOverloadedCallAndConstructSignatures.ts, 12, 3)) +>f : Symbol(f, Decl(interfaceWithOverloadedCallAndConstructSignatures.ts, 8, 3)) + diff --git a/tests/baselines/reference/interfaceWithOverloadedCallAndConstructSignatures.types b/tests/baselines/reference/interfaceWithOverloadedCallAndConstructSignatures.types index 1172f10a3dd..1110992fd52 100644 --- a/tests/baselines/reference/interfaceWithOverloadedCallAndConstructSignatures.types +++ b/tests/baselines/reference/interfaceWithOverloadedCallAndConstructSignatures.types @@ -25,6 +25,7 @@ var r2 = f(''); >r2 : number >f('') : number >f : Foo +>'' : string var r3 = new f(); >r3 : any @@ -35,4 +36,5 @@ var r4 = new f(''); >r4 : Object >new f('') : Object >f : Foo +>'' : string diff --git a/tests/baselines/reference/interfaceWithPropertyOfEveryType.symbols b/tests/baselines/reference/interfaceWithPropertyOfEveryType.symbols new file mode 100644 index 00000000000..46c8e92261f --- /dev/null +++ b/tests/baselines/reference/interfaceWithPropertyOfEveryType.symbols @@ -0,0 +1,139 @@ +=== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyOfEveryType.ts === +class C { foo: string; } +>C : Symbol(C, Decl(interfaceWithPropertyOfEveryType.ts, 0, 0)) +>foo : Symbol(foo, Decl(interfaceWithPropertyOfEveryType.ts, 0, 9)) + +function f1() { } +>f1 : Symbol(f1, Decl(interfaceWithPropertyOfEveryType.ts, 0, 24)) + +module M { +>M : Symbol(M, Decl(interfaceWithPropertyOfEveryType.ts, 1, 17)) + + export var y = 1; +>y : Symbol(y, Decl(interfaceWithPropertyOfEveryType.ts, 3, 14)) +} +enum E { A } +>E : Symbol(E, Decl(interfaceWithPropertyOfEveryType.ts, 4, 1)) +>A : Symbol(E.A, Decl(interfaceWithPropertyOfEveryType.ts, 5, 8)) + +interface Foo { +>Foo : Symbol(Foo, Decl(interfaceWithPropertyOfEveryType.ts, 5, 12)) + + a: number; +>a : Symbol(a, Decl(interfaceWithPropertyOfEveryType.ts, 7, 15)) + + b: string; +>b : Symbol(b, Decl(interfaceWithPropertyOfEveryType.ts, 8, 14)) + + c: boolean; +>c : Symbol(c, Decl(interfaceWithPropertyOfEveryType.ts, 9, 14)) + + d: any; +>d : Symbol(d, Decl(interfaceWithPropertyOfEveryType.ts, 10, 15)) + + e: void; +>e : Symbol(e, Decl(interfaceWithPropertyOfEveryType.ts, 11, 11)) + + f: number[]; +>f : Symbol(f, Decl(interfaceWithPropertyOfEveryType.ts, 12, 12)) + + g: Object; +>g : Symbol(g, Decl(interfaceWithPropertyOfEveryType.ts, 13, 16)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + h: (x: number) => number; +>h : Symbol(h, Decl(interfaceWithPropertyOfEveryType.ts, 14, 14)) +>x : Symbol(x, Decl(interfaceWithPropertyOfEveryType.ts, 15, 8)) + + i: (x: T) => T; +>i : Symbol(i, Decl(interfaceWithPropertyOfEveryType.ts, 15, 29)) +>T : Symbol(T, Decl(interfaceWithPropertyOfEveryType.ts, 16, 8)) +>x : Symbol(x, Decl(interfaceWithPropertyOfEveryType.ts, 16, 11)) +>T : Symbol(T, Decl(interfaceWithPropertyOfEveryType.ts, 16, 8)) +>T : Symbol(T, Decl(interfaceWithPropertyOfEveryType.ts, 16, 8)) + + j: Foo; +>j : Symbol(j, Decl(interfaceWithPropertyOfEveryType.ts, 16, 22)) +>Foo : Symbol(Foo, Decl(interfaceWithPropertyOfEveryType.ts, 5, 12)) + + k: C; +>k : Symbol(k, Decl(interfaceWithPropertyOfEveryType.ts, 17, 11)) +>C : Symbol(C, Decl(interfaceWithPropertyOfEveryType.ts, 0, 0)) + + l: typeof f1; +>l : Symbol(l, Decl(interfaceWithPropertyOfEveryType.ts, 18, 9)) +>f1 : Symbol(f1, Decl(interfaceWithPropertyOfEveryType.ts, 0, 24)) + + m: typeof M; +>m : Symbol(m, Decl(interfaceWithPropertyOfEveryType.ts, 19, 17)) +>M : Symbol(M, Decl(interfaceWithPropertyOfEveryType.ts, 1, 17)) + + n: {}; +>n : Symbol(n, Decl(interfaceWithPropertyOfEveryType.ts, 20, 16)) + + o: E; +>o : Symbol(o, Decl(interfaceWithPropertyOfEveryType.ts, 21, 10)) +>E : Symbol(E, Decl(interfaceWithPropertyOfEveryType.ts, 4, 1)) +} + +var a: Foo = { +>a : Symbol(a, Decl(interfaceWithPropertyOfEveryType.ts, 25, 3)) +>Foo : Symbol(Foo, Decl(interfaceWithPropertyOfEveryType.ts, 5, 12)) + + a: 1, +>a : Symbol(a, Decl(interfaceWithPropertyOfEveryType.ts, 25, 14)) + + b: '', +>b : Symbol(b, Decl(interfaceWithPropertyOfEveryType.ts, 26, 9)) + + c: true, +>c : Symbol(c, Decl(interfaceWithPropertyOfEveryType.ts, 27, 10)) + + d: {}, +>d : Symbol(d, Decl(interfaceWithPropertyOfEveryType.ts, 28, 12)) + + e: null , +>e : Symbol(e, Decl(interfaceWithPropertyOfEveryType.ts, 29, 10)) + + f: [1], +>f : Symbol(f, Decl(interfaceWithPropertyOfEveryType.ts, 30, 13)) + + g: {}, +>g : Symbol(g, Decl(interfaceWithPropertyOfEveryType.ts, 31, 11)) + + h: (x: number) => 1, +>h : Symbol(h, Decl(interfaceWithPropertyOfEveryType.ts, 32, 10)) +>x : Symbol(x, Decl(interfaceWithPropertyOfEveryType.ts, 33, 8)) + + i: (x: T) => x, +>i : Symbol(i, Decl(interfaceWithPropertyOfEveryType.ts, 33, 24)) +>T : Symbol(T, Decl(interfaceWithPropertyOfEveryType.ts, 34, 8)) +>x : Symbol(x, Decl(interfaceWithPropertyOfEveryType.ts, 34, 11)) +>T : Symbol(T, Decl(interfaceWithPropertyOfEveryType.ts, 34, 8)) +>x : Symbol(x, Decl(interfaceWithPropertyOfEveryType.ts, 34, 11)) + + j: null, +>j : Symbol(j, Decl(interfaceWithPropertyOfEveryType.ts, 34, 22)) +>Foo : Symbol(Foo, Decl(interfaceWithPropertyOfEveryType.ts, 5, 12)) + + k: new C(), +>k : Symbol(k, Decl(interfaceWithPropertyOfEveryType.ts, 35, 17)) +>C : Symbol(C, Decl(interfaceWithPropertyOfEveryType.ts, 0, 0)) + + l: f1, +>l : Symbol(l, Decl(interfaceWithPropertyOfEveryType.ts, 36, 15)) +>f1 : Symbol(f1, Decl(interfaceWithPropertyOfEveryType.ts, 0, 24)) + + m: M, +>m : Symbol(m, Decl(interfaceWithPropertyOfEveryType.ts, 37, 10)) +>M : Symbol(M, Decl(interfaceWithPropertyOfEveryType.ts, 1, 17)) + + n: {}, +>n : Symbol(n, Decl(interfaceWithPropertyOfEveryType.ts, 38, 9)) + + o: E.A +>o : Symbol(o, Decl(interfaceWithPropertyOfEveryType.ts, 39, 10)) +>E.A : Symbol(E.A, Decl(interfaceWithPropertyOfEveryType.ts, 5, 8)) +>E : Symbol(E, Decl(interfaceWithPropertyOfEveryType.ts, 4, 1)) +>A : Symbol(E.A, Decl(interfaceWithPropertyOfEveryType.ts, 5, 8)) +} diff --git a/tests/baselines/reference/interfaceWithPropertyOfEveryType.types b/tests/baselines/reference/interfaceWithPropertyOfEveryType.types index 21d4359b6fb..7428ee73aa1 100644 --- a/tests/baselines/reference/interfaceWithPropertyOfEveryType.types +++ b/tests/baselines/reference/interfaceWithPropertyOfEveryType.types @@ -11,6 +11,7 @@ module M { export var y = 1; >y : number +>1 : number } enum E { A } >E : E @@ -83,12 +84,15 @@ var a: Foo = { a: 1, >a : number +>1 : number b: '', >b : string +>'' : string c: true, >c : boolean +>true : boolean d: {}, >d : {} @@ -96,10 +100,12 @@ var a: Foo = { e: null , >e : null +>null : null f: [1], >f : number[] >[1] : number[] +>1 : number g: {}, >g : {} @@ -109,6 +115,7 @@ var a: Foo = { >h : (x: number) => number >(x: number) => 1 : (x: number) => number >x : number +>1 : number i: (x: T) => x, >i : (x: T) => T @@ -122,6 +129,7 @@ var a: Foo = { >j : Foo >null : Foo >Foo : Foo +>null : null k: new C(), >k : C diff --git a/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.symbols b/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.symbols new file mode 100644 index 00000000000..40ec7863a04 --- /dev/null +++ b/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.symbols @@ -0,0 +1,38 @@ +=== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithSpecializedCallAndConstructSignatures.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 0, 0)) + + (x: 'a'): number; +>x : Symbol(x, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 1, 5)) + + (x: string): any; +>x : Symbol(x, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 2, 5)) + + new (x: 'a'): any; +>x : Symbol(x, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 4, 9)) + + new (x: string): Object; +>x : Symbol(x, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 5, 9)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +} + +var f: Foo; +>f : Symbol(f, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 8, 3)) +>Foo : Symbol(Foo, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 0, 0)) + +var r = f('a'); +>r : Symbol(r, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 9, 3)) +>f : Symbol(f, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 8, 3)) + +var r2 = f('A'); +>r2 : Symbol(r2, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 10, 3)) +>f : Symbol(f, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 8, 3)) + +var r3 = new f('a'); +>r3 : Symbol(r3, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 11, 3)) +>f : Symbol(f, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 8, 3)) + +var r4 = new f('A'); +>r4 : Symbol(r4, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 12, 3)) +>f : Symbol(f, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 8, 3)) + diff --git a/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.types b/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.types index e9bc0cd2889..971b5e56907 100644 --- a/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.types +++ b/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.types @@ -24,19 +24,23 @@ var r = f('a'); >r : number >f('a') : number >f : Foo +>'a' : string var r2 = f('A'); >r2 : any >f('A') : any >f : Foo +>'A' : string var r3 = new f('a'); >r3 : any >new f('a') : any >f : Foo +>'a' : string var r4 = new f('A'); >r4 : Object >new f('A') : Object >f : Foo +>'A' : string diff --git a/tests/baselines/reference/interfacedecl.symbols b/tests/baselines/reference/interfacedecl.symbols new file mode 100644 index 00000000000..eb9cce5f1fd --- /dev/null +++ b/tests/baselines/reference/interfacedecl.symbols @@ -0,0 +1,94 @@ +=== tests/cases/compiler/interfacedecl.ts === +interface a0 { +>a0 : Symbol(a0, Decl(interfacedecl.ts, 0, 0)) + + (): string; + (a, b, c?: string): number; +>a : Symbol(a, Decl(interfacedecl.ts, 2, 5)) +>b : Symbol(b, Decl(interfacedecl.ts, 2, 7)) +>c : Symbol(c, Decl(interfacedecl.ts, 2, 10)) + + new (): string; + new (s: string); +>s : Symbol(s, Decl(interfacedecl.ts, 5, 9)) + + [n: number]: ()=>string; +>n : Symbol(n, Decl(interfacedecl.ts, 7, 5)) + + [s: string]: any; +>s : Symbol(s, Decl(interfacedecl.ts, 8, 5)) + + p1; +>p1 : Symbol(p1, Decl(interfacedecl.ts, 8, 21)) + + p2: string; +>p2 : Symbol(p2, Decl(interfacedecl.ts, 10, 7)) + + p3?; +>p3 : Symbol(p3, Decl(interfacedecl.ts, 11, 15)) + + p4?: number; +>p4 : Symbol(p4, Decl(interfacedecl.ts, 12, 8)) + + p5: (s: number) =>string; +>p5 : Symbol(p5, Decl(interfacedecl.ts, 13, 16)) +>s : Symbol(s, Decl(interfacedecl.ts, 14, 9)) + + f1(); +>f1 : Symbol(f1, Decl(interfacedecl.ts, 14, 29)) + + f2? (); +>f2 : Symbol(f2, Decl(interfacedecl.ts, 16, 9)) + + f3(a: string): number; +>f3 : Symbol(f3, Decl(interfacedecl.ts, 17, 11)) +>a : Symbol(a, Decl(interfacedecl.ts, 18, 7)) + + f4? (s: number): string; +>f4 : Symbol(f4, Decl(interfacedecl.ts, 18, 26)) +>s : Symbol(s, Decl(interfacedecl.ts, 19, 9)) +} + + +interface a1 { +>a1 : Symbol(a1, Decl(interfacedecl.ts, 20, 1)) + + [n: number]: number; +>n : Symbol(n, Decl(interfacedecl.ts, 24, 5)) +} + +interface a2 { +>a2 : Symbol(a2, Decl(interfacedecl.ts, 25, 1)) + + [s: string]: number; +>s : Symbol(s, Decl(interfacedecl.ts, 28, 5)) +} + +interface a { +>a : Symbol(a, Decl(interfacedecl.ts, 29, 1)) +} + +interface b extends a { +>b : Symbol(b, Decl(interfacedecl.ts, 32, 1)) +>a : Symbol(a, Decl(interfacedecl.ts, 29, 1)) +} + +interface c extends a, b { +>c : Symbol(c, Decl(interfacedecl.ts, 35, 1)) +>a : Symbol(a, Decl(interfacedecl.ts, 29, 1)) +>b : Symbol(b, Decl(interfacedecl.ts, 32, 1)) +} + +interface d extends a { +>d : Symbol(d, Decl(interfacedecl.ts, 38, 1)) +>a : Symbol(a, Decl(interfacedecl.ts, 29, 1)) +} + +class c1 implements a { +>c1 : Symbol(c1, Decl(interfacedecl.ts, 41, 1)) +>a : Symbol(a, Decl(interfacedecl.ts, 29, 1)) +} +var instance2 = new c1(); +>instance2 : Symbol(instance2, Decl(interfacedecl.ts, 45, 3)) +>c1 : Symbol(c1, Decl(interfacedecl.ts, 41, 1)) + diff --git a/tests/baselines/reference/internalAliasClass.symbols b/tests/baselines/reference/internalAliasClass.symbols new file mode 100644 index 00000000000..4695367cf6e --- /dev/null +++ b/tests/baselines/reference/internalAliasClass.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/internalAliasClass.ts === +module a { +>a : Symbol(a, Decl(internalAliasClass.ts, 0, 0)) + + export class c { +>c : Symbol(c, Decl(internalAliasClass.ts, 0, 10)) + } +} + +module c { +>c : Symbol(c, Decl(internalAliasClass.ts, 3, 1)) + + import b = a.c; +>b : Symbol(b, Decl(internalAliasClass.ts, 5, 10)) +>a : Symbol(a, Decl(internalAliasClass.ts, 0, 0)) +>c : Symbol(b, Decl(internalAliasClass.ts, 0, 10)) + + export var x: b = new b(); +>x : Symbol(x, Decl(internalAliasClass.ts, 7, 14)) +>b : Symbol(b, Decl(internalAliasClass.ts, 5, 10)) +>b : Symbol(b, Decl(internalAliasClass.ts, 5, 10)) +} diff --git a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.symbols b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.symbols new file mode 100644 index 00000000000..f3a796cf66c --- /dev/null +++ b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.symbols @@ -0,0 +1,48 @@ +=== tests/cases/compiler/internalAliasClassInsideLocalModuleWithExport.ts === +export module x { +>x : Symbol(x, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 0, 0)) + + export class c { +>c : Symbol(c, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 0, 17)) + + foo(a: number) { +>foo : Symbol(foo, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 1, 20)) +>a : Symbol(a, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 2, 12)) + + return a; +>a : Symbol(a, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 2, 12)) + } + } +} + +export module m2 { +>m2 : Symbol(m2, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 6, 1)) + + export module m3 { +>m3 : Symbol(m3, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 8, 18)) + + export import c = x.c; +>c : Symbol(c, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 9, 22)) +>x : Symbol(x, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 0, 0)) +>c : Symbol(c, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 0, 17)) + + export var cProp = new c(); +>cProp : Symbol(cProp, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 11, 18)) +>c : Symbol(c, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 9, 22)) + + var cReturnVal = cProp.foo(10); +>cReturnVal : Symbol(cReturnVal, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 12, 11)) +>cProp.foo : Symbol(c.foo, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 1, 20)) +>cProp : Symbol(cProp, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 11, 18)) +>foo : Symbol(c.foo, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 1, 20)) + } +} + +export var d = new m2.m3.c(); +>d : Symbol(d, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 16, 10)) +>m2.m3.c : Symbol(m2.m3.c, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 9, 22)) +>m2.m3 : Symbol(m2.m3, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 8, 18)) +>m2 : Symbol(m2, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 6, 1)) +>m3 : Symbol(m2.m3, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 8, 18)) +>c : Symbol(m2.m3.c, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 9, 22)) + diff --git a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.types b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.types index 3f6f5845fda..58afd2071fe 100644 --- a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.types +++ b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.types @@ -37,6 +37,7 @@ export module m2 { >cProp.foo : (a: number) => number >cProp : c >foo : (a: number) => number +>10 : number } } diff --git a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.symbols new file mode 100644 index 00000000000..5c1d8b16afc --- /dev/null +++ b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/internalAliasClassInsideLocalModuleWithoutExport.ts === +export module x { +>x : Symbol(x, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 0, 0)) + + export class c { +>c : Symbol(c, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 0, 17)) + + foo(a: number) { +>foo : Symbol(foo, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 1, 20)) +>a : Symbol(a, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 2, 12)) + + return a; +>a : Symbol(a, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 2, 12)) + } + } +} + +export module m2 { +>m2 : Symbol(m2, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 6, 1)) + + export module m3 { +>m3 : Symbol(m3, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 8, 18)) + + import c = x.c; +>c : Symbol(c, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 9, 22)) +>x : Symbol(x, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 0, 0)) +>c : Symbol(c, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 0, 17)) + + export var cProp = new c(); +>cProp : Symbol(cProp, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 11, 18)) +>c : Symbol(c, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 9, 22)) + + var cReturnVal = cProp.foo(10); +>cReturnVal : Symbol(cReturnVal, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 12, 11)) +>cProp.foo : Symbol(c.foo, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 1, 20)) +>cProp : Symbol(cProp, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 11, 18)) +>foo : Symbol(c.foo, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 1, 20)) + } +} diff --git a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.types b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.types index 4f916d5689c..43f612d3f44 100644 --- a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.types @@ -37,5 +37,6 @@ export module m2 { >cProp.foo : (a: number) => number >cProp : c >foo : (a: number) => number +>10 : number } } diff --git a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.symbols b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.symbols new file mode 100644 index 00000000000..1b4d44307e3 --- /dev/null +++ b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/internalAliasClassInsideTopLevelModuleWithExport.ts === +export module x { +>x : Symbol(x, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 0, 0)) + + export class c { +>c : Symbol(c, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 0, 17)) + + foo(a: number) { +>foo : Symbol(foo, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 1, 20)) +>a : Symbol(a, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 2, 12)) + + return a; +>a : Symbol(a, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 2, 12)) + } + } +} + +export import xc = x.c; +>xc : Symbol(xc, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 6, 1)) +>x : Symbol(x, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 0, 0)) +>c : Symbol(xc, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 0, 17)) + +export var cProp = new xc(); +>cProp : Symbol(cProp, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 9, 10)) +>xc : Symbol(xc, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 6, 1)) + +var cReturnVal = cProp.foo(10); +>cReturnVal : Symbol(cReturnVal, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 10, 3)) +>cProp.foo : Symbol(xc.foo, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 1, 20)) +>cProp : Symbol(cProp, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 9, 10)) +>foo : Symbol(xc.foo, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 1, 20)) + diff --git a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.types b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.types index 6a25f03c2e9..3d72c04aad6 100644 --- a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.types +++ b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.types @@ -31,4 +31,5 @@ var cReturnVal = cProp.foo(10); >cProp.foo : (a: number) => number >cProp : xc >foo : (a: number) => number +>10 : number diff --git a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.symbols new file mode 100644 index 00000000000..b4e720cec94 --- /dev/null +++ b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/internalAliasClassInsideTopLevelModuleWithoutExport.ts === +export module x { +>x : Symbol(x, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 0, 0)) + + export class c { +>c : Symbol(c, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 0, 17)) + + foo(a: number) { +>foo : Symbol(foo, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 1, 20)) +>a : Symbol(a, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 2, 12)) + + return a; +>a : Symbol(a, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 2, 12)) + } + } +} + +import xc = x.c; +>xc : Symbol(xc, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 6, 1)) +>x : Symbol(x, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 0, 0)) +>c : Symbol(xc, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 0, 17)) + +export var cProp = new xc(); +>cProp : Symbol(cProp, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 9, 10)) +>xc : Symbol(xc, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 6, 1)) + +var cReturnVal = cProp.foo(10); +>cReturnVal : Symbol(cReturnVal, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 10, 3)) +>cProp.foo : Symbol(xc.foo, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 1, 20)) +>cProp : Symbol(cProp, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 9, 10)) +>foo : Symbol(xc.foo, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 1, 20)) + diff --git a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.types b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.types index 4e086f86054..f816fdce7af 100644 --- a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.types @@ -31,4 +31,5 @@ var cReturnVal = cProp.foo(10); >cProp.foo : (a: number) => number >cProp : xc >foo : (a: number) => number +>10 : number diff --git a/tests/baselines/reference/internalAliasEnum.symbols b/tests/baselines/reference/internalAliasEnum.symbols new file mode 100644 index 00000000000..d08317ae9a7 --- /dev/null +++ b/tests/baselines/reference/internalAliasEnum.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/internalAliasEnum.ts === +module a { +>a : Symbol(a, Decl(internalAliasEnum.ts, 0, 0)) + + export enum weekend { +>weekend : Symbol(weekend, Decl(internalAliasEnum.ts, 0, 10)) + + Friday, +>Friday : Symbol(weekend.Friday, Decl(internalAliasEnum.ts, 1, 25)) + + Saturday, +>Saturday : Symbol(weekend.Saturday, Decl(internalAliasEnum.ts, 2, 15)) + + Sunday +>Sunday : Symbol(weekend.Sunday, Decl(internalAliasEnum.ts, 3, 17)) + } +} + +module c { +>c : Symbol(c, Decl(internalAliasEnum.ts, 6, 1)) + + import b = a.weekend; +>b : Symbol(b, Decl(internalAliasEnum.ts, 8, 10)) +>a : Symbol(a, Decl(internalAliasEnum.ts, 0, 0)) +>weekend : Symbol(b, Decl(internalAliasEnum.ts, 0, 10)) + + export var bVal: b = b.Sunday; +>bVal : Symbol(bVal, Decl(internalAliasEnum.ts, 10, 14)) +>b : Symbol(b, Decl(internalAliasEnum.ts, 8, 10)) +>b.Sunday : Symbol(b.Sunday, Decl(internalAliasEnum.ts, 3, 17)) +>b : Symbol(b, Decl(internalAliasEnum.ts, 8, 10)) +>Sunday : Symbol(b.Sunday, Decl(internalAliasEnum.ts, 3, 17)) +} + diff --git a/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithExport.symbols b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithExport.symbols new file mode 100644 index 00000000000..84b7cb44f48 --- /dev/null +++ b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithExport.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/internalAliasEnumInsideLocalModuleWithExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 0, 0)) + + export enum weekend { +>weekend : Symbol(weekend, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 0, 17)) + + Friday, +>Friday : Symbol(weekend.Friday, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 1, 25)) + + Saturday, +>Saturday : Symbol(weekend.Saturday, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 2, 15)) + + Sunday +>Sunday : Symbol(weekend.Sunday, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 3, 17)) + } +} + +export module c { +>c : Symbol(c, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 6, 1)) + + export import b = a.weekend; +>b : Symbol(b, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 8, 17)) +>a : Symbol(a, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 0, 0)) +>weekend : Symbol(b, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 0, 17)) + + export var bVal: b = b.Sunday; +>bVal : Symbol(bVal, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 10, 14)) +>b : Symbol(b, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 8, 17)) +>b.Sunday : Symbol(b.Sunday, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 3, 17)) +>b : Symbol(b, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 8, 17)) +>Sunday : Symbol(b.Sunday, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 3, 17)) +} + diff --git a/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExport.symbols new file mode 100644 index 00000000000..c9e77221b6c --- /dev/null +++ b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExport.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/internalAliasEnumInsideLocalModuleWithoutExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 0, 0)) + + export enum weekend { +>weekend : Symbol(weekend, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 0, 17)) + + Friday, +>Friday : Symbol(weekend.Friday, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 1, 25)) + + Saturday, +>Saturday : Symbol(weekend.Saturday, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 2, 15)) + + Sunday +>Sunday : Symbol(weekend.Sunday, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 3, 17)) + } +} + +export module c { +>c : Symbol(c, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 6, 1)) + + import b = a.weekend; +>b : Symbol(b, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 8, 17)) +>a : Symbol(a, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 0, 0)) +>weekend : Symbol(b, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 0, 17)) + + export var bVal: b = b.Sunday; +>bVal : Symbol(bVal, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 10, 14)) +>b : Symbol(b, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 8, 17)) +>b.Sunday : Symbol(b.Sunday, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 3, 17)) +>b : Symbol(b, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 8, 17)) +>Sunday : Symbol(b.Sunday, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 3, 17)) +} + diff --git a/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithExport.symbols b/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithExport.symbols new file mode 100644 index 00000000000..404dceb8507 --- /dev/null +++ b/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithExport.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/internalAliasEnumInsideTopLevelModuleWithExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasEnumInsideTopLevelModuleWithExport.ts, 0, 0)) + + export enum weekend { +>weekend : Symbol(weekend, Decl(internalAliasEnumInsideTopLevelModuleWithExport.ts, 0, 17)) + + Friday, +>Friday : Symbol(b.Friday, Decl(internalAliasEnumInsideTopLevelModuleWithExport.ts, 1, 25)) + + Saturday, +>Saturday : Symbol(b.Saturday, Decl(internalAliasEnumInsideTopLevelModuleWithExport.ts, 2, 15)) + + Sunday +>Sunday : Symbol(b.Sunday, Decl(internalAliasEnumInsideTopLevelModuleWithExport.ts, 3, 17)) + } +} + +export import b = a.weekend; +>b : Symbol(b, Decl(internalAliasEnumInsideTopLevelModuleWithExport.ts, 6, 1)) +>a : Symbol(a, Decl(internalAliasEnumInsideTopLevelModuleWithExport.ts, 0, 0)) +>weekend : Symbol(b, Decl(internalAliasEnumInsideTopLevelModuleWithExport.ts, 0, 17)) + +export var bVal: b = b.Sunday; +>bVal : Symbol(bVal, Decl(internalAliasEnumInsideTopLevelModuleWithExport.ts, 9, 10)) +>b : Symbol(b, Decl(internalAliasEnumInsideTopLevelModuleWithExport.ts, 6, 1)) +>b.Sunday : Symbol(b.Sunday, Decl(internalAliasEnumInsideTopLevelModuleWithExport.ts, 3, 17)) +>b : Symbol(b, Decl(internalAliasEnumInsideTopLevelModuleWithExport.ts, 6, 1)) +>Sunday : Symbol(b.Sunday, Decl(internalAliasEnumInsideTopLevelModuleWithExport.ts, 3, 17)) + diff --git a/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithoutExport.symbols new file mode 100644 index 00000000000..ca69a0f3181 --- /dev/null +++ b/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithoutExport.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/internalAliasEnumInsideTopLevelModuleWithoutExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasEnumInsideTopLevelModuleWithoutExport.ts, 0, 0)) + + export enum weekend { +>weekend : Symbol(weekend, Decl(internalAliasEnumInsideTopLevelModuleWithoutExport.ts, 0, 17)) + + Friday, +>Friday : Symbol(b.Friday, Decl(internalAliasEnumInsideTopLevelModuleWithoutExport.ts, 1, 25)) + + Saturday, +>Saturday : Symbol(b.Saturday, Decl(internalAliasEnumInsideTopLevelModuleWithoutExport.ts, 2, 15)) + + Sunday +>Sunday : Symbol(b.Sunday, Decl(internalAliasEnumInsideTopLevelModuleWithoutExport.ts, 3, 17)) + } +} + +import b = a.weekend; +>b : Symbol(b, Decl(internalAliasEnumInsideTopLevelModuleWithoutExport.ts, 6, 1)) +>a : Symbol(a, Decl(internalAliasEnumInsideTopLevelModuleWithoutExport.ts, 0, 0)) +>weekend : Symbol(b, Decl(internalAliasEnumInsideTopLevelModuleWithoutExport.ts, 0, 17)) + +export var bVal: b = b.Sunday; +>bVal : Symbol(bVal, Decl(internalAliasEnumInsideTopLevelModuleWithoutExport.ts, 9, 10)) +>b : Symbol(b, Decl(internalAliasEnumInsideTopLevelModuleWithoutExport.ts, 6, 1)) +>b.Sunday : Symbol(b.Sunday, Decl(internalAliasEnumInsideTopLevelModuleWithoutExport.ts, 3, 17)) +>b : Symbol(b, Decl(internalAliasEnumInsideTopLevelModuleWithoutExport.ts, 6, 1)) +>Sunday : Symbol(b.Sunday, Decl(internalAliasEnumInsideTopLevelModuleWithoutExport.ts, 3, 17)) + diff --git a/tests/baselines/reference/internalAliasFunction.symbols b/tests/baselines/reference/internalAliasFunction.symbols new file mode 100644 index 00000000000..cae4be7d574 --- /dev/null +++ b/tests/baselines/reference/internalAliasFunction.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/internalAliasFunction.ts === +module a { +>a : Symbol(a, Decl(internalAliasFunction.ts, 0, 0)) + + export function foo(x: number) { +>foo : Symbol(foo, Decl(internalAliasFunction.ts, 0, 10)) +>x : Symbol(x, Decl(internalAliasFunction.ts, 1, 24)) + + return x; +>x : Symbol(x, Decl(internalAliasFunction.ts, 1, 24)) + } +} + +module c { +>c : Symbol(c, Decl(internalAliasFunction.ts, 4, 1)) + + import b = a.foo; +>b : Symbol(b, Decl(internalAliasFunction.ts, 6, 10)) +>a : Symbol(a, Decl(internalAliasFunction.ts, 0, 0)) +>foo : Symbol(b, Decl(internalAliasFunction.ts, 0, 10)) + + export var bVal = b(10); +>bVal : Symbol(bVal, Decl(internalAliasFunction.ts, 8, 14)) +>b : Symbol(b, Decl(internalAliasFunction.ts, 6, 10)) + + export var bVal2 = b; +>bVal2 : Symbol(bVal2, Decl(internalAliasFunction.ts, 9, 14)) +>b : Symbol(b, Decl(internalAliasFunction.ts, 6, 10)) +} + diff --git a/tests/baselines/reference/internalAliasFunction.types b/tests/baselines/reference/internalAliasFunction.types index ed297ce1b4e..d67535c76f7 100644 --- a/tests/baselines/reference/internalAliasFunction.types +++ b/tests/baselines/reference/internalAliasFunction.types @@ -23,6 +23,7 @@ module c { >bVal : number >b(10) : number >b : (x: number) => number +>10 : number export var bVal2 = b; >bVal2 : (x: number) => number diff --git a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.symbols b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.symbols new file mode 100644 index 00000000000..82fa9b118e0 --- /dev/null +++ b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/internalAliasFunctionInsideLocalModuleWithExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasFunctionInsideLocalModuleWithExport.ts, 0, 0)) + + export function foo(x: number) { +>foo : Symbol(foo, Decl(internalAliasFunctionInsideLocalModuleWithExport.ts, 0, 17)) +>x : Symbol(x, Decl(internalAliasFunctionInsideLocalModuleWithExport.ts, 1, 24)) + + return x; +>x : Symbol(x, Decl(internalAliasFunctionInsideLocalModuleWithExport.ts, 1, 24)) + } +} + +export module c { +>c : Symbol(c, Decl(internalAliasFunctionInsideLocalModuleWithExport.ts, 4, 1)) + + export import b = a.foo; +>b : Symbol(b, Decl(internalAliasFunctionInsideLocalModuleWithExport.ts, 6, 17)) +>a : Symbol(a, Decl(internalAliasFunctionInsideLocalModuleWithExport.ts, 0, 0)) +>foo : Symbol(b, Decl(internalAliasFunctionInsideLocalModuleWithExport.ts, 0, 17)) + + export var bVal = b(10); +>bVal : Symbol(bVal, Decl(internalAliasFunctionInsideLocalModuleWithExport.ts, 8, 14)) +>b : Symbol(b, Decl(internalAliasFunctionInsideLocalModuleWithExport.ts, 6, 17)) + + export var bVal2 = b; +>bVal2 : Symbol(bVal2, Decl(internalAliasFunctionInsideLocalModuleWithExport.ts, 9, 14)) +>b : Symbol(b, Decl(internalAliasFunctionInsideLocalModuleWithExport.ts, 6, 17)) +} + diff --git a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.types b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.types index b3140e7b09a..928d8530228 100644 --- a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.types +++ b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.types @@ -23,6 +23,7 @@ export module c { >bVal : number >b(10) : number >b : (x: number) => number +>10 : number export var bVal2 = b; >bVal2 : (x: number) => number diff --git a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.symbols new file mode 100644 index 00000000000..4fe034d91a6 --- /dev/null +++ b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/internalAliasFunctionInsideLocalModuleWithoutExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasFunctionInsideLocalModuleWithoutExport.ts, 0, 0)) + + export function foo(x: number) { +>foo : Symbol(foo, Decl(internalAliasFunctionInsideLocalModuleWithoutExport.ts, 0, 17)) +>x : Symbol(x, Decl(internalAliasFunctionInsideLocalModuleWithoutExport.ts, 1, 24)) + + return x; +>x : Symbol(x, Decl(internalAliasFunctionInsideLocalModuleWithoutExport.ts, 1, 24)) + } +} + +export module c { +>c : Symbol(c, Decl(internalAliasFunctionInsideLocalModuleWithoutExport.ts, 4, 1)) + + import b = a.foo; +>b : Symbol(b, Decl(internalAliasFunctionInsideLocalModuleWithoutExport.ts, 6, 17)) +>a : Symbol(a, Decl(internalAliasFunctionInsideLocalModuleWithoutExport.ts, 0, 0)) +>foo : Symbol(b, Decl(internalAliasFunctionInsideLocalModuleWithoutExport.ts, 0, 17)) + + var bVal = b(10); +>bVal : Symbol(bVal, Decl(internalAliasFunctionInsideLocalModuleWithoutExport.ts, 8, 7)) +>b : Symbol(b, Decl(internalAliasFunctionInsideLocalModuleWithoutExport.ts, 6, 17)) + + export var bVal2 = b; +>bVal2 : Symbol(bVal2, Decl(internalAliasFunctionInsideLocalModuleWithoutExport.ts, 9, 14)) +>b : Symbol(b, Decl(internalAliasFunctionInsideLocalModuleWithoutExport.ts, 6, 17)) +} + diff --git a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.types b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.types index c78b5040495..630be11c71e 100644 --- a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.types @@ -23,6 +23,7 @@ export module c { >bVal : number >b(10) : number >b : (x: number) => number +>10 : number export var bVal2 = b; >bVal2 : (x: number) => number diff --git a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.symbols b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.symbols new file mode 100644 index 00000000000..9281660ddd5 --- /dev/null +++ b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/internalAliasFunctionInsideTopLevelModuleWithExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasFunctionInsideTopLevelModuleWithExport.ts, 0, 0)) + + export function foo(x: number) { +>foo : Symbol(foo, Decl(internalAliasFunctionInsideTopLevelModuleWithExport.ts, 0, 17)) +>x : Symbol(x, Decl(internalAliasFunctionInsideTopLevelModuleWithExport.ts, 1, 24)) + + return x; +>x : Symbol(x, Decl(internalAliasFunctionInsideTopLevelModuleWithExport.ts, 1, 24)) + } +} + +export import b = a.foo; +>b : Symbol(b, Decl(internalAliasFunctionInsideTopLevelModuleWithExport.ts, 4, 1)) +>a : Symbol(a, Decl(internalAliasFunctionInsideTopLevelModuleWithExport.ts, 0, 0)) +>foo : Symbol(b, Decl(internalAliasFunctionInsideTopLevelModuleWithExport.ts, 0, 17)) + +export var bVal = b(10); +>bVal : Symbol(bVal, Decl(internalAliasFunctionInsideTopLevelModuleWithExport.ts, 7, 10)) +>b : Symbol(b, Decl(internalAliasFunctionInsideTopLevelModuleWithExport.ts, 4, 1)) + +export var bVal2 = b; +>bVal2 : Symbol(bVal2, Decl(internalAliasFunctionInsideTopLevelModuleWithExport.ts, 8, 10)) +>b : Symbol(b, Decl(internalAliasFunctionInsideTopLevelModuleWithExport.ts, 4, 1)) + diff --git a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.types b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.types index 365f0edeb27..c1e9f9af3d7 100644 --- a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.types +++ b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.types @@ -20,6 +20,7 @@ export var bVal = b(10); >bVal : number >b(10) : number >b : (x: number) => number +>10 : number export var bVal2 = b; >bVal2 : (x: number) => number diff --git a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.symbols new file mode 100644 index 00000000000..ff079a34920 --- /dev/null +++ b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/internalAliasFunctionInsideTopLevelModuleWithoutExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasFunctionInsideTopLevelModuleWithoutExport.ts, 0, 0)) + + export function foo(x: number) { +>foo : Symbol(foo, Decl(internalAliasFunctionInsideTopLevelModuleWithoutExport.ts, 0, 17)) +>x : Symbol(x, Decl(internalAliasFunctionInsideTopLevelModuleWithoutExport.ts, 1, 24)) + + return x; +>x : Symbol(x, Decl(internalAliasFunctionInsideTopLevelModuleWithoutExport.ts, 1, 24)) + } +} + +import b = a.foo; +>b : Symbol(b, Decl(internalAliasFunctionInsideTopLevelModuleWithoutExport.ts, 4, 1)) +>a : Symbol(a, Decl(internalAliasFunctionInsideTopLevelModuleWithoutExport.ts, 0, 0)) +>foo : Symbol(b, Decl(internalAliasFunctionInsideTopLevelModuleWithoutExport.ts, 0, 17)) + +export var bVal = b(10); +>bVal : Symbol(bVal, Decl(internalAliasFunctionInsideTopLevelModuleWithoutExport.ts, 7, 10)) +>b : Symbol(b, Decl(internalAliasFunctionInsideTopLevelModuleWithoutExport.ts, 4, 1)) + +export var bVal2 = b; +>bVal2 : Symbol(bVal2, Decl(internalAliasFunctionInsideTopLevelModuleWithoutExport.ts, 8, 10)) +>b : Symbol(b, Decl(internalAliasFunctionInsideTopLevelModuleWithoutExport.ts, 4, 1)) + diff --git a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.types b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.types index c2f06c66f76..bca35e33dec 100644 --- a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.types @@ -20,6 +20,7 @@ export var bVal = b(10); >bVal : number >b(10) : number >b : (x: number) => number +>10 : number export var bVal2 = b; >bVal2 : (x: number) => number diff --git a/tests/baselines/reference/internalAliasInitializedModule.symbols b/tests/baselines/reference/internalAliasInitializedModule.symbols new file mode 100644 index 00000000000..0487879019e --- /dev/null +++ b/tests/baselines/reference/internalAliasInitializedModule.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/internalAliasInitializedModule.ts === +module a { +>a : Symbol(a, Decl(internalAliasInitializedModule.ts, 0, 0)) + + export module b { +>b : Symbol(b, Decl(internalAliasInitializedModule.ts, 0, 10)) + + export class c { +>c : Symbol(c, Decl(internalAliasInitializedModule.ts, 1, 21)) + } + } +} + +module c { +>c : Symbol(c, Decl(internalAliasInitializedModule.ts, 5, 1)) + + import b = a.b; +>b : Symbol(b, Decl(internalAliasInitializedModule.ts, 7, 10)) +>a : Symbol(a, Decl(internalAliasInitializedModule.ts, 0, 0)) +>b : Symbol(b, Decl(internalAliasInitializedModule.ts, 0, 10)) + + export var x: b.c = new b.c(); +>x : Symbol(x, Decl(internalAliasInitializedModule.ts, 9, 14)) +>b : Symbol(b, Decl(internalAliasInitializedModule.ts, 7, 10)) +>c : Symbol(b.c, Decl(internalAliasInitializedModule.ts, 1, 21)) +>b.c : Symbol(b.c, Decl(internalAliasInitializedModule.ts, 1, 21)) +>b : Symbol(b, Decl(internalAliasInitializedModule.ts, 7, 10)) +>c : Symbol(b.c, Decl(internalAliasInitializedModule.ts, 1, 21)) +} diff --git a/tests/baselines/reference/internalAliasInitializedModule.types b/tests/baselines/reference/internalAliasInitializedModule.types index dacc2f148bd..0e7c9650182 100644 --- a/tests/baselines/reference/internalAliasInitializedModule.types +++ b/tests/baselines/reference/internalAliasInitializedModule.types @@ -21,7 +21,7 @@ module c { export var x: b.c = new b.c(); >x : b.c ->b : unknown +>b : any >c : b.c >new b.c() : b.c >b.c : typeof b.c diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithExport.symbols b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithExport.symbols new file mode 100644 index 00000000000..35b121410e4 --- /dev/null +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithExport.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/internalAliasInitializedModuleInsideLocalModuleWithExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasInitializedModuleInsideLocalModuleWithExport.ts, 0, 0)) + + export module b { +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideLocalModuleWithExport.ts, 0, 17)) + + export class c { +>c : Symbol(c, Decl(internalAliasInitializedModuleInsideLocalModuleWithExport.ts, 1, 21)) + } + } +} + +export module c { +>c : Symbol(c, Decl(internalAliasInitializedModuleInsideLocalModuleWithExport.ts, 5, 1)) + + export import b = a.b; +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideLocalModuleWithExport.ts, 7, 17)) +>a : Symbol(a, Decl(internalAliasInitializedModuleInsideLocalModuleWithExport.ts, 0, 0)) +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideLocalModuleWithExport.ts, 0, 17)) + + export var x: b.c = new b.c(); +>x : Symbol(x, Decl(internalAliasInitializedModuleInsideLocalModuleWithExport.ts, 9, 14)) +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideLocalModuleWithExport.ts, 7, 17)) +>c : Symbol(b.c, Decl(internalAliasInitializedModuleInsideLocalModuleWithExport.ts, 1, 21)) +>b.c : Symbol(b.c, Decl(internalAliasInitializedModuleInsideLocalModuleWithExport.ts, 1, 21)) +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideLocalModuleWithExport.ts, 7, 17)) +>c : Symbol(b.c, Decl(internalAliasInitializedModuleInsideLocalModuleWithExport.ts, 1, 21)) +} diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithExport.types b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithExport.types index 973003d2c49..302ac5ada43 100644 --- a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithExport.types +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithExport.types @@ -21,7 +21,7 @@ export module c { export var x: b.c = new b.c(); >x : b.c ->b : unknown +>b : any >c : b.c >new b.c() : b.c >b.c : typeof b.c diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExport.symbols new file mode 100644 index 00000000000..539874f4534 --- /dev/null +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExport.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts, 0, 0)) + + export module b { +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts, 0, 17)) + + export class c { +>c : Symbol(c, Decl(internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts, 1, 21)) + } + } +} + +export module c { +>c : Symbol(c, Decl(internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts, 5, 1)) + + import b = a.b; +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts, 7, 17)) +>a : Symbol(a, Decl(internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts, 0, 0)) +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts, 0, 17)) + + export var x: b.c = new b.c(); +>x : Symbol(x, Decl(internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts, 9, 14)) +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts, 7, 17)) +>c : Symbol(b.c, Decl(internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts, 1, 21)) +>b.c : Symbol(b.c, Decl(internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts, 1, 21)) +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts, 7, 17)) +>c : Symbol(b.c, Decl(internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts, 1, 21)) +} diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExport.types b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExport.types index 540883209de..f5ea07fb744 100644 --- a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExport.types @@ -21,7 +21,7 @@ export module c { export var x: b.c = new b.c(); >x : b.c ->b : unknown +>b : any >c : b.c >new b.c() : b.c >b.c : typeof b.c diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithExport.symbols b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithExport.symbols new file mode 100644 index 00000000000..78b6ee28589 --- /dev/null +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithExport.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts, 0, 0)) + + export module b { +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts, 0, 17)) + + export class c { +>c : Symbol(c, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts, 1, 21)) + } + } +} + +export import b = a.b; +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts, 5, 1)) +>a : Symbol(a, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts, 0, 0)) +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts, 0, 17)) + +export var x: b.c = new b.c(); +>x : Symbol(x, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts, 8, 10)) +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts, 5, 1)) +>c : Symbol(b.c, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts, 1, 21)) +>b.c : Symbol(b.c, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts, 1, 21)) +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts, 5, 1)) +>c : Symbol(b.c, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts, 1, 21)) + diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithExport.types b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithExport.types index aa9944787d6..f6ba838f3d7 100644 --- a/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithExport.types +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithExport.types @@ -18,7 +18,7 @@ export import b = a.b; export var x: b.c = new b.c(); >x : b.c ->b : unknown +>b : any >c : b.c >new b.c() : b.c >b.c : typeof b.c diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.symbols new file mode 100644 index 00000000000..ec49c87d617 --- /dev/null +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts, 0, 0)) + + export module b { +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts, 0, 17)) + + export class c { +>c : Symbol(c, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts, 1, 21)) + } + } +} + +import b = a.b; +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts, 5, 1)) +>a : Symbol(a, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts, 0, 0)) +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts, 0, 17)) + +export var x: b.c = new b.c(); +>x : Symbol(x, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts, 8, 10)) +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts, 5, 1)) +>c : Symbol(b.c, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts, 1, 21)) +>b.c : Symbol(b.c, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts, 1, 21)) +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts, 5, 1)) +>c : Symbol(b.c, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts, 1, 21)) + diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.types b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.types index e17fcdba2a7..b15bb6dc8ec 100644 --- a/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.types @@ -18,7 +18,7 @@ import b = a.b; export var x: b.c = new b.c(); >x : b.c ->b : unknown +>b : any >c : b.c >new b.c() : b.c >b.c : typeof b.c diff --git a/tests/baselines/reference/internalAliasInterface.symbols b/tests/baselines/reference/internalAliasInterface.symbols new file mode 100644 index 00000000000..f4c3d493c6f --- /dev/null +++ b/tests/baselines/reference/internalAliasInterface.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/internalAliasInterface.ts === +module a { +>a : Symbol(a, Decl(internalAliasInterface.ts, 0, 0)) + + export interface I { +>I : Symbol(I, Decl(internalAliasInterface.ts, 0, 10)) + } +} + +module c { +>c : Symbol(c, Decl(internalAliasInterface.ts, 3, 1)) + + import b = a.I; +>b : Symbol(b, Decl(internalAliasInterface.ts, 5, 10)) +>a : Symbol(a, Decl(internalAliasInterface.ts, 0, 0)) +>I : Symbol(b, Decl(internalAliasInterface.ts, 0, 10)) + + export var x: b; +>x : Symbol(x, Decl(internalAliasInterface.ts, 7, 14)) +>b : Symbol(b, Decl(internalAliasInterface.ts, 5, 10)) +} + diff --git a/tests/baselines/reference/internalAliasInterface.types b/tests/baselines/reference/internalAliasInterface.types index 310c568104d..fdb60eee7ce 100644 --- a/tests/baselines/reference/internalAliasInterface.types +++ b/tests/baselines/reference/internalAliasInterface.types @@ -1,6 +1,6 @@ === tests/cases/compiler/internalAliasInterface.ts === module a { ->a : unknown +>a : any export interface I { >I : I @@ -11,8 +11,8 @@ module c { >c : typeof c import b = a.I; ->b : unknown ->a : unknown +>b : any +>a : any >I : b export var x: b; diff --git a/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithExport.symbols b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithExport.symbols new file mode 100644 index 00000000000..d2455d82343 --- /dev/null +++ b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithExport.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasInterfaceInsideLocalModuleWithExport.ts, 0, 0)) + + export interface I { +>I : Symbol(I, Decl(internalAliasInterfaceInsideLocalModuleWithExport.ts, 0, 17)) + } +} + +export module c { +>c : Symbol(c, Decl(internalAliasInterfaceInsideLocalModuleWithExport.ts, 3, 1)) + + export import b = a.I; +>b : Symbol(b, Decl(internalAliasInterfaceInsideLocalModuleWithExport.ts, 5, 17)) +>a : Symbol(a, Decl(internalAliasInterfaceInsideLocalModuleWithExport.ts, 0, 0)) +>I : Symbol(b, Decl(internalAliasInterfaceInsideLocalModuleWithExport.ts, 0, 17)) + + export var x: b; +>x : Symbol(x, Decl(internalAliasInterfaceInsideLocalModuleWithExport.ts, 7, 14)) +>b : Symbol(b, Decl(internalAliasInterfaceInsideLocalModuleWithExport.ts, 5, 17)) +} + diff --git a/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithExport.types b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithExport.types index 9667fd125d5..84dae24aeb6 100644 --- a/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithExport.types +++ b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithExport.types @@ -1,6 +1,6 @@ === tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithExport.ts === export module a { ->a : unknown +>a : any export interface I { >I : I @@ -11,8 +11,8 @@ export module c { >c : typeof c export import b = a.I; ->b : unknown ->a : unknown +>b : any +>a : any >I : b export var x: b; diff --git a/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExport.symbols new file mode 100644 index 00000000000..00aa21e52fa --- /dev/null +++ b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExport.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithoutExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasInterfaceInsideLocalModuleWithoutExport.ts, 0, 0)) + + export interface I { +>I : Symbol(I, Decl(internalAliasInterfaceInsideLocalModuleWithoutExport.ts, 0, 17)) + } +} + +export module c { +>c : Symbol(c, Decl(internalAliasInterfaceInsideLocalModuleWithoutExport.ts, 3, 1)) + + import b = a.I; +>b : Symbol(b, Decl(internalAliasInterfaceInsideLocalModuleWithoutExport.ts, 5, 17)) +>a : Symbol(a, Decl(internalAliasInterfaceInsideLocalModuleWithoutExport.ts, 0, 0)) +>I : Symbol(b, Decl(internalAliasInterfaceInsideLocalModuleWithoutExport.ts, 0, 17)) + + export var x: b; +>x : Symbol(x, Decl(internalAliasInterfaceInsideLocalModuleWithoutExport.ts, 7, 14)) +>b : Symbol(b, Decl(internalAliasInterfaceInsideLocalModuleWithoutExport.ts, 5, 17)) +} + diff --git a/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExport.types b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExport.types index 2f9368bc6a9..f236f9b49a8 100644 --- a/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExport.types @@ -1,6 +1,6 @@ === tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithoutExport.ts === export module a { ->a : unknown +>a : any export interface I { >I : I @@ -11,8 +11,8 @@ export module c { >c : typeof c import b = a.I; ->b : unknown ->a : unknown +>b : any +>a : any >I : b export var x: b; diff --git a/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithExport.symbols b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithExport.symbols new file mode 100644 index 00000000000..3947509fad3 --- /dev/null +++ b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithExport.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/internalAliasInterfaceInsideTopLevelModuleWithExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasInterfaceInsideTopLevelModuleWithExport.ts, 0, 0)) + + export interface I { +>I : Symbol(I, Decl(internalAliasInterfaceInsideTopLevelModuleWithExport.ts, 0, 17)) + } +} + +export import b = a.I; +>b : Symbol(b, Decl(internalAliasInterfaceInsideTopLevelModuleWithExport.ts, 3, 1)) +>a : Symbol(a, Decl(internalAliasInterfaceInsideTopLevelModuleWithExport.ts, 0, 0)) +>I : Symbol(b, Decl(internalAliasInterfaceInsideTopLevelModuleWithExport.ts, 0, 17)) + +export var x: b; +>x : Symbol(x, Decl(internalAliasInterfaceInsideTopLevelModuleWithExport.ts, 6, 10)) +>b : Symbol(b, Decl(internalAliasInterfaceInsideTopLevelModuleWithExport.ts, 3, 1)) + diff --git a/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithExport.types b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithExport.types index 9197d1e0215..365c526383c 100644 --- a/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithExport.types +++ b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithExport.types @@ -1,6 +1,6 @@ === tests/cases/compiler/internalAliasInterfaceInsideTopLevelModuleWithExport.ts === export module a { ->a : unknown +>a : any export interface I { >I : I @@ -8,8 +8,8 @@ export module a { } export import b = a.I; ->b : unknown ->a : unknown +>b : any +>a : any >I : b export var x: b; diff --git a/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithoutExport.symbols new file mode 100644 index 00000000000..9561b861731 --- /dev/null +++ b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithoutExport.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/internalAliasInterfaceInsideTopLevelModuleWithoutExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasInterfaceInsideTopLevelModuleWithoutExport.ts, 0, 0)) + + export interface I { +>I : Symbol(I, Decl(internalAliasInterfaceInsideTopLevelModuleWithoutExport.ts, 0, 17)) + } +} + +import b = a.I; +>b : Symbol(b, Decl(internalAliasInterfaceInsideTopLevelModuleWithoutExport.ts, 3, 1)) +>a : Symbol(a, Decl(internalAliasInterfaceInsideTopLevelModuleWithoutExport.ts, 0, 0)) +>I : Symbol(b, Decl(internalAliasInterfaceInsideTopLevelModuleWithoutExport.ts, 0, 17)) + +export var x: b; +>x : Symbol(x, Decl(internalAliasInterfaceInsideTopLevelModuleWithoutExport.ts, 6, 10)) +>b : Symbol(b, Decl(internalAliasInterfaceInsideTopLevelModuleWithoutExport.ts, 3, 1)) + diff --git a/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithoutExport.types b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithoutExport.types index 58be03b6a3c..2a8ee86a7f7 100644 --- a/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithoutExport.types @@ -1,6 +1,6 @@ === tests/cases/compiler/internalAliasInterfaceInsideTopLevelModuleWithoutExport.ts === export module a { ->a : unknown +>a : any export interface I { >I : I @@ -8,8 +8,8 @@ export module a { } import b = a.I; ->b : unknown ->a : unknown +>b : any +>a : any >I : b export var x: b; diff --git a/tests/baselines/reference/internalAliasUninitializedModule.symbols b/tests/baselines/reference/internalAliasUninitializedModule.symbols new file mode 100644 index 00000000000..95af5c5699d --- /dev/null +++ b/tests/baselines/reference/internalAliasUninitializedModule.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/internalAliasUninitializedModule.ts === +module a { +>a : Symbol(a, Decl(internalAliasUninitializedModule.ts, 0, 0)) + + export module b { +>b : Symbol(b, Decl(internalAliasUninitializedModule.ts, 0, 10)) + + export interface I { +>I : Symbol(I, Decl(internalAliasUninitializedModule.ts, 1, 21)) + + foo(); +>foo : Symbol(foo, Decl(internalAliasUninitializedModule.ts, 2, 28)) + } + } +} + +module c { +>c : Symbol(c, Decl(internalAliasUninitializedModule.ts, 6, 1)) + + import b = a.b; +>b : Symbol(b, Decl(internalAliasUninitializedModule.ts, 8, 10)) +>a : Symbol(a, Decl(internalAliasUninitializedModule.ts, 0, 0)) +>b : Symbol(b, Decl(internalAliasUninitializedModule.ts, 0, 10)) + + export var x: b.I; +>x : Symbol(x, Decl(internalAliasUninitializedModule.ts, 10, 14)) +>b : Symbol(b, Decl(internalAliasUninitializedModule.ts, 8, 10)) +>I : Symbol(b.I, Decl(internalAliasUninitializedModule.ts, 1, 21)) + + x.foo(); +>x.foo : Symbol(b.I.foo, Decl(internalAliasUninitializedModule.ts, 2, 28)) +>x : Symbol(x, Decl(internalAliasUninitializedModule.ts, 10, 14)) +>foo : Symbol(b.I.foo, Decl(internalAliasUninitializedModule.ts, 2, 28)) +} diff --git a/tests/baselines/reference/internalAliasUninitializedModule.types b/tests/baselines/reference/internalAliasUninitializedModule.types index 408a2467e03..6599fd0fda0 100644 --- a/tests/baselines/reference/internalAliasUninitializedModule.types +++ b/tests/baselines/reference/internalAliasUninitializedModule.types @@ -1,9 +1,9 @@ === tests/cases/compiler/internalAliasUninitializedModule.ts === module a { ->a : unknown +>a : any export module b { ->b : unknown +>b : any export interface I { >I : I @@ -18,13 +18,13 @@ module c { >c : typeof c import b = a.b; ->b : unknown ->a : unknown ->b : unknown +>b : any +>a : any +>b : any export var x: b.I; >x : b.I ->b : unknown +>b : any >I : b.I x.foo(); diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithExport.symbols b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithExport.symbols new file mode 100644 index 00000000000..861859ce2ea --- /dev/null +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithExport.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 0, 0)) + + export module b { +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 0, 17)) + + export interface I { +>I : Symbol(I, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 1, 21)) + + foo(); +>foo : Symbol(foo, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 2, 28)) + } + } +} + +export module c { +>c : Symbol(c, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 6, 1)) + + export import b = a.b; +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 8, 17)) +>a : Symbol(a, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 0, 0)) +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 0, 17)) + + export var x: b.I; +>x : Symbol(x, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 10, 14)) +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 8, 17)) +>I : Symbol(b.I, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 1, 21)) + + x.foo(); +>x.foo : Symbol(b.I.foo, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 2, 28)) +>x : Symbol(x, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 10, 14)) +>foo : Symbol(b.I.foo, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 2, 28)) +} diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithExport.types b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithExport.types index f7bbc68dac0..d54620658e6 100644 --- a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithExport.types +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithExport.types @@ -1,9 +1,9 @@ === tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithExport.ts === export module a { ->a : unknown +>a : any export module b { ->b : unknown +>b : any export interface I { >I : I @@ -18,13 +18,13 @@ export module c { >c : typeof c export import b = a.b; ->b : unknown ->a : unknown ->b : unknown +>b : any +>a : any +>b : any export var x: b.I; >x : b.I ->b : unknown +>b : any >I : b.I x.foo(); diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.symbols new file mode 100644 index 00000000000..433426c9fd9 --- /dev/null +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 0, 0)) + + export module b { +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 0, 17)) + + export interface I { +>I : Symbol(I, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 1, 21)) + + foo(); +>foo : Symbol(foo, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 2, 28)) + } + } +} + +export module c { +>c : Symbol(c, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 6, 1)) + + import b = a.b; +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 8, 17)) +>a : Symbol(a, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 0, 0)) +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 0, 17)) + + export var x: b.I; +>x : Symbol(x, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 10, 14)) +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 8, 17)) +>I : Symbol(b.I, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 1, 21)) + + x.foo(); +>x.foo : Symbol(b.I.foo, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 2, 28)) +>x : Symbol(x, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 10, 14)) +>foo : Symbol(b.I.foo, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 2, 28)) +} diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.types b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.types index cf9a85a712f..9bb409b22e1 100644 --- a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.types @@ -1,9 +1,9 @@ === tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts === export module a { ->a : unknown +>a : any export module b { ->b : unknown +>b : any export interface I { >I : I @@ -18,13 +18,13 @@ export module c { >c : typeof c import b = a.b; ->b : unknown ->a : unknown ->b : unknown +>b : any +>a : any +>b : any export var x: b.I; >x : b.I ->b : unknown +>b : any >I : b.I x.foo(); diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.symbols b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.symbols new file mode 100644 index 00000000000..14428deac43 --- /dev/null +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts, 0, 0)) + + export module b { +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts, 0, 17)) + + export interface I { +>I : Symbol(I, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts, 1, 21)) + + foo(); +>foo : Symbol(foo, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts, 2, 28)) + } + } +} + +export import b = a.b; +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts, 6, 1)) +>a : Symbol(a, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts, 0, 0)) +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts, 0, 17)) + +export var x: b.I; +>x : Symbol(x, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts, 9, 10)) +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts, 6, 1)) +>I : Symbol(b.I, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts, 1, 21)) + +x.foo(); +>x.foo : Symbol(b.I.foo, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts, 2, 28)) +>x : Symbol(x, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts, 9, 10)) +>foo : Symbol(b.I.foo, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts, 2, 28)) + diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.types b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.types index 015ec48fe6a..dbca81bf40b 100644 --- a/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.types +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.types @@ -1,9 +1,9 @@ === tests/cases/compiler/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts === export module a { ->a : unknown +>a : any export module b { ->b : unknown +>b : any export interface I { >I : I @@ -15,13 +15,13 @@ export module a { } export import b = a.b; ->b : unknown ->a : unknown ->b : unknown +>b : any +>a : any +>b : any export var x: b.I; >x : b.I ->b : unknown +>b : any >I : b.I x.foo(); diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.symbols new file mode 100644 index 00000000000..cd17daeb023 --- /dev/null +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts, 0, 0)) + + export module b { +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts, 0, 17)) + + export interface I { +>I : Symbol(I, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts, 1, 21)) + + foo(); +>foo : Symbol(foo, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts, 2, 28)) + } + } +} + +import b = a.b; +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts, 6, 1)) +>a : Symbol(a, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts, 0, 0)) +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts, 0, 17)) + +export var x: b.I; +>x : Symbol(x, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts, 9, 10)) +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts, 6, 1)) +>I : Symbol(b.I, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts, 1, 21)) + +x.foo(); +>x.foo : Symbol(b.I.foo, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts, 2, 28)) +>x : Symbol(x, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts, 9, 10)) +>foo : Symbol(b.I.foo, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts, 2, 28)) + diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.types b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.types index 71a2f535816..a2b07049295 100644 --- a/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.types @@ -1,9 +1,9 @@ === tests/cases/compiler/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts === export module a { ->a : unknown +>a : any export module b { ->b : unknown +>b : any export interface I { >I : I @@ -15,13 +15,13 @@ export module a { } import b = a.b; ->b : unknown ->a : unknown ->b : unknown +>b : any +>a : any +>b : any export var x: b.I; >x : b.I ->b : unknown +>b : any >I : b.I x.foo(); diff --git a/tests/baselines/reference/internalAliasVar.symbols b/tests/baselines/reference/internalAliasVar.symbols new file mode 100644 index 00000000000..52b1d3233f5 --- /dev/null +++ b/tests/baselines/reference/internalAliasVar.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/internalAliasVar.ts === +module a { +>a : Symbol(a, Decl(internalAliasVar.ts, 0, 0)) + + export var x = 10; +>x : Symbol(x, Decl(internalAliasVar.ts, 1, 14)) +} + +module c { +>c : Symbol(c, Decl(internalAliasVar.ts, 2, 1)) + + import b = a.x; +>b : Symbol(b, Decl(internalAliasVar.ts, 4, 10)) +>a : Symbol(a, Decl(internalAliasVar.ts, 0, 0)) +>x : Symbol(b, Decl(internalAliasVar.ts, 1, 14)) + + export var bVal = b; +>bVal : Symbol(bVal, Decl(internalAliasVar.ts, 6, 14)) +>b : Symbol(b, Decl(internalAliasVar.ts, 4, 10)) +} + diff --git a/tests/baselines/reference/internalAliasVar.types b/tests/baselines/reference/internalAliasVar.types index d284b064d83..59da851b569 100644 --- a/tests/baselines/reference/internalAliasVar.types +++ b/tests/baselines/reference/internalAliasVar.types @@ -4,6 +4,7 @@ module a { export var x = 10; >x : number +>10 : number } module c { diff --git a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.symbols b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.symbols new file mode 100644 index 00000000000..099d257ec71 --- /dev/null +++ b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/internalAliasVarInsideLocalModuleWithExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasVarInsideLocalModuleWithExport.ts, 0, 0)) + + export var x = 10; +>x : Symbol(x, Decl(internalAliasVarInsideLocalModuleWithExport.ts, 1, 14)) +} + +export module c { +>c : Symbol(c, Decl(internalAliasVarInsideLocalModuleWithExport.ts, 2, 1)) + + export import b = a.x; +>b : Symbol(b, Decl(internalAliasVarInsideLocalModuleWithExport.ts, 4, 17)) +>a : Symbol(a, Decl(internalAliasVarInsideLocalModuleWithExport.ts, 0, 0)) +>x : Symbol(b, Decl(internalAliasVarInsideLocalModuleWithExport.ts, 1, 14)) + + export var bVal = b; +>bVal : Symbol(bVal, Decl(internalAliasVarInsideLocalModuleWithExport.ts, 6, 14)) +>b : Symbol(b, Decl(internalAliasVarInsideLocalModuleWithExport.ts, 4, 17)) +} + diff --git a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.types b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.types index b8d94c9ebbd..995c24bc382 100644 --- a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.types +++ b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.types @@ -4,6 +4,7 @@ export module a { export var x = 10; >x : number +>10 : number } export module c { diff --git a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.symbols new file mode 100644 index 00000000000..9a32adb4069 --- /dev/null +++ b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/internalAliasVarInsideLocalModuleWithoutExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasVarInsideLocalModuleWithoutExport.ts, 0, 0)) + + export var x = 10; +>x : Symbol(x, Decl(internalAliasVarInsideLocalModuleWithoutExport.ts, 1, 14)) +} + +export module c { +>c : Symbol(c, Decl(internalAliasVarInsideLocalModuleWithoutExport.ts, 2, 1)) + + import b = a.x; +>b : Symbol(b, Decl(internalAliasVarInsideLocalModuleWithoutExport.ts, 4, 17)) +>a : Symbol(a, Decl(internalAliasVarInsideLocalModuleWithoutExport.ts, 0, 0)) +>x : Symbol(b, Decl(internalAliasVarInsideLocalModuleWithoutExport.ts, 1, 14)) + + export var bVal = b; +>bVal : Symbol(bVal, Decl(internalAliasVarInsideLocalModuleWithoutExport.ts, 6, 14)) +>b : Symbol(b, Decl(internalAliasVarInsideLocalModuleWithoutExport.ts, 4, 17)) +} + diff --git a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.types b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.types index c9e2897befb..5e322f8483c 100644 --- a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.types @@ -4,6 +4,7 @@ export module a { export var x = 10; >x : number +>10 : number } export module c { diff --git a/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.symbols b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.symbols new file mode 100644 index 00000000000..1fa0bf59d50 --- /dev/null +++ b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/internalAliasVarInsideTopLevelModuleWithExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasVarInsideTopLevelModuleWithExport.ts, 0, 0)) + + export var x = 10; +>x : Symbol(x, Decl(internalAliasVarInsideTopLevelModuleWithExport.ts, 1, 14)) +} + +export import b = a.x; +>b : Symbol(b, Decl(internalAliasVarInsideTopLevelModuleWithExport.ts, 2, 1)) +>a : Symbol(a, Decl(internalAliasVarInsideTopLevelModuleWithExport.ts, 0, 0)) +>x : Symbol(b, Decl(internalAliasVarInsideTopLevelModuleWithExport.ts, 1, 14)) + +export var bVal = b; +>bVal : Symbol(bVal, Decl(internalAliasVarInsideTopLevelModuleWithExport.ts, 5, 10)) +>b : Symbol(b, Decl(internalAliasVarInsideTopLevelModuleWithExport.ts, 2, 1)) + + diff --git a/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.types b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.types index 22335c7d8c0..199de9cae51 100644 --- a/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.types +++ b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.types @@ -4,6 +4,7 @@ export module a { export var x = 10; >x : number +>10 : number } export import b = a.x; diff --git a/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.symbols new file mode 100644 index 00000000000..a1d9ab3cc45 --- /dev/null +++ b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/internalAliasVarInsideTopLevelModuleWithoutExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasVarInsideTopLevelModuleWithoutExport.ts, 0, 0)) + + export var x = 10; +>x : Symbol(x, Decl(internalAliasVarInsideTopLevelModuleWithoutExport.ts, 1, 14)) +} + +import b = a.x; +>b : Symbol(b, Decl(internalAliasVarInsideTopLevelModuleWithoutExport.ts, 2, 1)) +>a : Symbol(a, Decl(internalAliasVarInsideTopLevelModuleWithoutExport.ts, 0, 0)) +>x : Symbol(b, Decl(internalAliasVarInsideTopLevelModuleWithoutExport.ts, 1, 14)) + +export var bVal = b; +>bVal : Symbol(bVal, Decl(internalAliasVarInsideTopLevelModuleWithoutExport.ts, 5, 10)) +>b : Symbol(b, Decl(internalAliasVarInsideTopLevelModuleWithoutExport.ts, 2, 1)) + + diff --git a/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.types b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.types index 1474735c62d..d7a7309ccb4 100644 --- a/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.types @@ -4,6 +4,7 @@ export module a { export var x = 10; >x : number +>10 : number } import b = a.x; diff --git a/tests/baselines/reference/internalAliasWithDottedNameEmit.symbols b/tests/baselines/reference/internalAliasWithDottedNameEmit.symbols new file mode 100644 index 00000000000..d4fe1ff9d58 --- /dev/null +++ b/tests/baselines/reference/internalAliasWithDottedNameEmit.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/internalAliasWithDottedNameEmit.ts === +module a.b.c { +>a : Symbol(a, Decl(internalAliasWithDottedNameEmit.ts, 0, 0), Decl(internalAliasWithDottedNameEmit.ts, 2, 1)) +>b : Symbol(b, Decl(internalAliasWithDottedNameEmit.ts, 0, 9)) +>c : Symbol(c, Decl(internalAliasWithDottedNameEmit.ts, 0, 11)) + + export var d; +>d : Symbol(d, Decl(internalAliasWithDottedNameEmit.ts, 1, 16)) +} +module a.e.f { +>a : Symbol(a, Decl(internalAliasWithDottedNameEmit.ts, 0, 0), Decl(internalAliasWithDottedNameEmit.ts, 2, 1)) +>e : Symbol(e, Decl(internalAliasWithDottedNameEmit.ts, 3, 9)) +>f : Symbol(f, Decl(internalAliasWithDottedNameEmit.ts, 3, 11)) + + import g = b.c; +>g : Symbol(g, Decl(internalAliasWithDottedNameEmit.ts, 3, 14)) +>b : Symbol(b, Decl(internalAliasWithDottedNameEmit.ts, 0, 9)) +>c : Symbol(g, Decl(internalAliasWithDottedNameEmit.ts, 0, 11)) +} + diff --git a/tests/baselines/reference/internalAliasWithDottedNameEmit.types b/tests/baselines/reference/internalAliasWithDottedNameEmit.types index 2b66ec9541b..60cae3c887a 100644 --- a/tests/baselines/reference/internalAliasWithDottedNameEmit.types +++ b/tests/baselines/reference/internalAliasWithDottedNameEmit.types @@ -9,8 +9,8 @@ module a.b.c { } module a.e.f { >a : typeof a ->e : unknown ->f : unknown +>e : any +>f : any import g = b.c; >g : typeof g diff --git a/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.symbols b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.symbols new file mode 100644 index 00000000000..e1098948fd6 --- /dev/null +++ b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts === +class A { +>A : Symbol(A, Decl(internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 0, 0), Decl(internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 2, 1)) + + aProp: string; +>aProp : Symbol(aProp, Decl(internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 0, 9)) +} +module A { +>A : Symbol(A, Decl(internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 0, 0), Decl(internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 2, 1)) + + export interface X { s: string } +>X : Symbol(X, Decl(internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 3, 10)) +>s : Symbol(s, Decl(internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 4, 24)) + + export var a = 10; +>a : Symbol(a, Decl(internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 5, 14)) +} + +module B { +>B : Symbol(B, Decl(internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 6, 1)) + + import Y = A; +>Y : Symbol(Y, Decl(internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 8, 10)) +>A : Symbol(Y, Decl(internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 0, 0), Decl(internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 2, 1)) +} + diff --git a/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.types b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.types index 3ec8770f17c..e0548f1f867 100644 --- a/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.types +++ b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.types @@ -14,10 +14,11 @@ module A { export var a = 10; >a : number +>10 : number } module B { ->B : unknown +>B : any import Y = A; >Y : typeof Y diff --git a/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.symbols b/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.symbols new file mode 100644 index 00000000000..5852777fe1c --- /dev/null +++ b/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts === +class A { +>A : Symbol(A, Decl(internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 0, 0), Decl(internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 2, 1)) + + aProp: string; +>aProp : Symbol(aProp, Decl(internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 0, 9)) +} +module A { +>A : Symbol(A, Decl(internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 0, 0), Decl(internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 2, 1)) + + export interface X { s: string } +>X : Symbol(X, Decl(internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 3, 10)) +>s : Symbol(s, Decl(internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 4, 24)) +} + +module B { +>B : Symbol(B, Decl(internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 5, 1)) + + import Y = A; +>Y : Symbol(Y, Decl(internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 7, 10)) +>A : Symbol(Y, Decl(internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 0, 0), Decl(internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 2, 1)) +} + diff --git a/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.types b/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.types index c07fc1c4955..8a6b8b1215f 100644 --- a/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.types +++ b/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.types @@ -14,7 +14,7 @@ module A { } module B { ->B : unknown +>B : any import Y = A; >Y : typeof Y diff --git a/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.symbols b/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.symbols new file mode 100644 index 00000000000..06df9fbfa3f --- /dev/null +++ b/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.ts === +module A { +>A : Symbol(A, Decl(internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.ts, 0, 0)) + + export interface X { s: string } +>X : Symbol(X, Decl(internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.ts, 0, 10)) +>s : Symbol(s, Decl(internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.ts, 1, 24)) +} + +module B { +>B : Symbol(B, Decl(internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.ts, 2, 1)) + + var A = 1; +>A : Symbol(A, Decl(internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.ts, 5, 7)) + + import Y = A; +>Y : Symbol(Y, Decl(internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.ts, 5, 14)) +>A : Symbol(Y, Decl(internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.ts, 0, 0)) +} + diff --git a/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.types b/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.types index 0bff332846a..1226ca3cbc4 100644 --- a/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.types +++ b/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.types @@ -1,6 +1,6 @@ === tests/cases/compiler/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.ts === module A { ->A : unknown +>A : any export interface X { s: string } >X : X @@ -12,9 +12,10 @@ module B { var A = 1; >A : number +>1 : number import Y = A; ->Y : unknown ->A : unknown +>Y : any +>A : any } diff --git a/tests/baselines/reference/invalidSplice.symbols b/tests/baselines/reference/invalidSplice.symbols new file mode 100644 index 00000000000..dc028776cb3 --- /dev/null +++ b/tests/baselines/reference/invalidSplice.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/invalidSplice.ts === +var arr = [].splice(0,3,4,5); +>arr : Symbol(arr, Decl(invalidSplice.ts, 0, 3)) +>[].splice : Symbol(Array.splice, Decl(lib.d.ts, 1060, 50), Decl(lib.d.ts, 1066, 31)) +>splice : Symbol(Array.splice, Decl(lib.d.ts, 1060, 50), Decl(lib.d.ts, 1066, 31)) + diff --git a/tests/baselines/reference/invalidSplice.types b/tests/baselines/reference/invalidSplice.types index ab4ad85d61f..1e3b42ff551 100644 --- a/tests/baselines/reference/invalidSplice.types +++ b/tests/baselines/reference/invalidSplice.types @@ -5,4 +5,8 @@ var arr = [].splice(0,3,4,5); >[].splice : { (start: number): any[]; (start: number, deleteCount: number, ...items: any[]): any[]; } >[] : undefined[] >splice : { (start: number): any[]; (start: number, deleteCount: number, ...items: any[]): any[]; } +>0 : number +>3 : number +>4 : number +>5 : number diff --git a/tests/baselines/reference/invalidSwitchBreakStatement.symbols b/tests/baselines/reference/invalidSwitchBreakStatement.symbols new file mode 100644 index 00000000000..a17a2a7dee2 --- /dev/null +++ b/tests/baselines/reference/invalidSwitchBreakStatement.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/statements/breakStatements/invalidSwitchBreakStatement.ts === +// break is not allowed in a switch statement +No type information for this code. +No type information for this code.switch (12) { +No type information for this code. case 5: +No type information for this code. break; +No type information for this code.} +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/invalidSwitchBreakStatement.types b/tests/baselines/reference/invalidSwitchBreakStatement.types index a17a2a7dee2..3544da72489 100644 --- a/tests/baselines/reference/invalidSwitchBreakStatement.types +++ b/tests/baselines/reference/invalidSwitchBreakStatement.types @@ -1,9 +1,12 @@ === tests/cases/conformance/statements/breakStatements/invalidSwitchBreakStatement.ts === // break is not allowed in a switch statement -No type information for this code. -No type information for this code.switch (12) { -No type information for this code. case 5: -No type information for this code. break; -No type information for this code.} -No type information for this code. -No type information for this code. \ No newline at end of file + +switch (12) { +>12 : number + + case 5: +>5 : number + + break; +} + diff --git a/tests/baselines/reference/invalidTypeNames.symbols b/tests/baselines/reference/invalidTypeNames.symbols new file mode 100644 index 00000000000..c91de26233f --- /dev/null +++ b/tests/baselines/reference/invalidTypeNames.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/invalidTypeNames.ts === +// Refer to calling code - a real illegal name is subbed in here +class illegal_name_here { +>illegal_name_here : Symbol(illegal_name_here, Decl(invalidTypeNames.ts, 0, 0)) +} + diff --git a/tests/baselines/reference/invalidUndefinedValues.symbols b/tests/baselines/reference/invalidUndefinedValues.symbols new file mode 100644 index 00000000000..5a9b81fde31 --- /dev/null +++ b/tests/baselines/reference/invalidUndefinedValues.symbols @@ -0,0 +1,92 @@ +=== tests/cases/conformance/types/primitives/undefined/invalidUndefinedValues.ts === +var x: typeof undefined; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) +>undefined : Symbol(undefined) + +x = 1; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) + +x = ''; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) + +x = true; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) + +var a: void; +>a : Symbol(a, Decl(invalidUndefinedValues.ts, 5, 3)) + +x = a; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) +>a : Symbol(a, Decl(invalidUndefinedValues.ts, 5, 3)) + +x = null; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) + +class C { foo: string } +>C : Symbol(C, Decl(invalidUndefinedValues.ts, 7, 9)) +>foo : Symbol(foo, Decl(invalidUndefinedValues.ts, 9, 9)) + +var b: C; +>b : Symbol(b, Decl(invalidUndefinedValues.ts, 10, 3)) +>C : Symbol(C, Decl(invalidUndefinedValues.ts, 7, 9)) + +x = C; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) +>C : Symbol(C, Decl(invalidUndefinedValues.ts, 7, 9)) + +x = b; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) +>b : Symbol(b, Decl(invalidUndefinedValues.ts, 10, 3)) + +interface I { foo: string } +>I : Symbol(I, Decl(invalidUndefinedValues.ts, 12, 6)) +>foo : Symbol(foo, Decl(invalidUndefinedValues.ts, 14, 13)) + +var c: I; +>c : Symbol(c, Decl(invalidUndefinedValues.ts, 15, 3)) +>I : Symbol(I, Decl(invalidUndefinedValues.ts, 12, 6)) + +x = c; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) +>c : Symbol(c, Decl(invalidUndefinedValues.ts, 15, 3)) + +module M { export var x = 1; } +>M : Symbol(M, Decl(invalidUndefinedValues.ts, 16, 6)) +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 18, 21)) + +x = M; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) +>M : Symbol(M, Decl(invalidUndefinedValues.ts, 16, 6)) + +x = { f() { } } +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) +>f : Symbol(f, Decl(invalidUndefinedValues.ts, 21, 5)) + +function f(a: T) { +>f : Symbol(f, Decl(invalidUndefinedValues.ts, 21, 15)) +>T : Symbol(T, Decl(invalidUndefinedValues.ts, 23, 11)) +>a : Symbol(a, Decl(invalidUndefinedValues.ts, 23, 14)) +>T : Symbol(T, Decl(invalidUndefinedValues.ts, 23, 11)) + + x = a; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) +>a : Symbol(a, Decl(invalidUndefinedValues.ts, 23, 14)) +} +x = f; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) +>f : Symbol(f, Decl(invalidUndefinedValues.ts, 21, 15)) + +enum E { A } +>E : Symbol(E, Decl(invalidUndefinedValues.ts, 26, 6)) +>A : Symbol(E.A, Decl(invalidUndefinedValues.ts, 28, 8)) + +x = E; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) +>E : Symbol(E, Decl(invalidUndefinedValues.ts, 26, 6)) + +x = E.A; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) +>E.A : Symbol(E.A, Decl(invalidUndefinedValues.ts, 28, 8)) +>E : Symbol(E, Decl(invalidUndefinedValues.ts, 26, 6)) +>A : Symbol(E.A, Decl(invalidUndefinedValues.ts, 28, 8)) + diff --git a/tests/baselines/reference/invalidUndefinedValues.types b/tests/baselines/reference/invalidUndefinedValues.types index 3f17deede37..b88c2021618 100644 --- a/tests/baselines/reference/invalidUndefinedValues.types +++ b/tests/baselines/reference/invalidUndefinedValues.types @@ -6,14 +6,17 @@ var x: typeof undefined; x = 1; >x = 1 : number >x : any +>1 : number x = ''; >x = '' : string >x : any +>'' : string x = true; >x = true : boolean >x : any +>true : boolean var a: void; >a : void @@ -26,6 +29,7 @@ x = a; x = null; >x = null : null >x : any +>null : null class C { foo: string } >C : C @@ -61,6 +65,7 @@ x = c; module M { export var x = 1; } >M : typeof M >x : number +>1 : number x = M; >x = M : typeof M diff --git a/tests/baselines/reference/ipromise2.symbols b/tests/baselines/reference/ipromise2.symbols new file mode 100644 index 00000000000..be936f4512a --- /dev/null +++ b/tests/baselines/reference/ipromise2.symbols @@ -0,0 +1,122 @@ +=== tests/cases/compiler/ipromise2.ts === +declare module Windows.Foundation { +>Windows : Symbol(Windows, Decl(ipromise2.ts, 0, 0)) +>Foundation : Symbol(Foundation, Decl(ipromise2.ts, 0, 23)) + + export interface IPromise { +>IPromise : Symbol(IPromise, Decl(ipromise2.ts, 0, 35)) +>T : Symbol(T, Decl(ipromise2.ts, 1, 30)) + + then(success?: (value: T) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; +>then : Symbol(then, Decl(ipromise2.ts, 1, 34), Decl(ipromise2.ts, 2, 159), Decl(ipromise2.ts, 3, 149), Decl(ipromise2.ts, 4, 149)) +>U : Symbol(U, Decl(ipromise2.ts, 2, 13)) +>success : Symbol(success, Decl(ipromise2.ts, 2, 16)) +>value : Symbol(value, Decl(ipromise2.ts, 2, 27)) +>T : Symbol(T, Decl(ipromise2.ts, 1, 30)) +>IPromise : Symbol(IPromise, Decl(ipromise2.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise2.ts, 2, 13)) +>error : Symbol(error, Decl(ipromise2.ts, 2, 52)) +>error : Symbol(error, Decl(ipromise2.ts, 2, 62)) +>IPromise : Symbol(IPromise, Decl(ipromise2.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise2.ts, 2, 13)) +>progress : Symbol(progress, Decl(ipromise2.ts, 2, 89)) +>progress : Symbol(progress, Decl(ipromise2.ts, 2, 102)) +>Windows : Symbol(Windows, Decl(ipromise2.ts, 0, 0)) +>Foundation : Symbol(Foundation, Decl(ipromise2.ts, 0, 23)) +>IPromise : Symbol(IPromise, Decl(ipromise2.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise2.ts, 2, 13)) + + then(success?: (value: T) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; +>then : Symbol(then, Decl(ipromise2.ts, 1, 34), Decl(ipromise2.ts, 2, 159), Decl(ipromise2.ts, 3, 149), Decl(ipromise2.ts, 4, 149)) +>U : Symbol(U, Decl(ipromise2.ts, 3, 13)) +>success : Symbol(success, Decl(ipromise2.ts, 3, 16)) +>value : Symbol(value, Decl(ipromise2.ts, 3, 27)) +>T : Symbol(T, Decl(ipromise2.ts, 1, 30)) +>IPromise : Symbol(IPromise, Decl(ipromise2.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise2.ts, 3, 13)) +>error : Symbol(error, Decl(ipromise2.ts, 3, 52)) +>error : Symbol(error, Decl(ipromise2.ts, 3, 62)) +>U : Symbol(U, Decl(ipromise2.ts, 3, 13)) +>progress : Symbol(progress, Decl(ipromise2.ts, 3, 79)) +>progress : Symbol(progress, Decl(ipromise2.ts, 3, 92)) +>Windows : Symbol(Windows, Decl(ipromise2.ts, 0, 0)) +>Foundation : Symbol(Foundation, Decl(ipromise2.ts, 0, 23)) +>IPromise : Symbol(IPromise, Decl(ipromise2.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise2.ts, 3, 13)) + + then(success?: (value: T) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; +>then : Symbol(then, Decl(ipromise2.ts, 1, 34), Decl(ipromise2.ts, 2, 159), Decl(ipromise2.ts, 3, 149), Decl(ipromise2.ts, 4, 149)) +>U : Symbol(U, Decl(ipromise2.ts, 4, 13)) +>success : Symbol(success, Decl(ipromise2.ts, 4, 16)) +>value : Symbol(value, Decl(ipromise2.ts, 4, 27)) +>T : Symbol(T, Decl(ipromise2.ts, 1, 30)) +>U : Symbol(U, Decl(ipromise2.ts, 4, 13)) +>error : Symbol(error, Decl(ipromise2.ts, 4, 42)) +>error : Symbol(error, Decl(ipromise2.ts, 4, 52)) +>IPromise : Symbol(IPromise, Decl(ipromise2.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise2.ts, 4, 13)) +>progress : Symbol(progress, Decl(ipromise2.ts, 4, 79)) +>progress : Symbol(progress, Decl(ipromise2.ts, 4, 92)) +>Windows : Symbol(Windows, Decl(ipromise2.ts, 0, 0)) +>Foundation : Symbol(Foundation, Decl(ipromise2.ts, 0, 23)) +>IPromise : Symbol(IPromise, Decl(ipromise2.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise2.ts, 4, 13)) + + then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; +>then : Symbol(then, Decl(ipromise2.ts, 1, 34), Decl(ipromise2.ts, 2, 159), Decl(ipromise2.ts, 3, 149), Decl(ipromise2.ts, 4, 149)) +>U : Symbol(U, Decl(ipromise2.ts, 5, 13)) +>success : Symbol(success, Decl(ipromise2.ts, 5, 16)) +>value : Symbol(value, Decl(ipromise2.ts, 5, 27)) +>T : Symbol(T, Decl(ipromise2.ts, 1, 30)) +>U : Symbol(U, Decl(ipromise2.ts, 5, 13)) +>error : Symbol(error, Decl(ipromise2.ts, 5, 42)) +>error : Symbol(error, Decl(ipromise2.ts, 5, 52)) +>U : Symbol(U, Decl(ipromise2.ts, 5, 13)) +>progress : Symbol(progress, Decl(ipromise2.ts, 5, 69)) +>progress : Symbol(progress, Decl(ipromise2.ts, 5, 82)) +>Windows : Symbol(Windows, Decl(ipromise2.ts, 0, 0)) +>Foundation : Symbol(Foundation, Decl(ipromise2.ts, 0, 23)) +>IPromise : Symbol(IPromise, Decl(ipromise2.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise2.ts, 5, 13)) + + done(success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; +>done : Symbol(done, Decl(ipromise2.ts, 5, 139)) +>U : Symbol(U, Decl(ipromise2.ts, 6, 13)) +>success : Symbol(success, Decl(ipromise2.ts, 6, 16)) +>value : Symbol(value, Decl(ipromise2.ts, 6, 27)) +>T : Symbol(T, Decl(ipromise2.ts, 1, 30)) +>error : Symbol(error, Decl(ipromise2.ts, 6, 44)) +>error : Symbol(error, Decl(ipromise2.ts, 6, 54)) +>progress : Symbol(progress, Decl(ipromise2.ts, 6, 73)) +>progress : Symbol(progress, Decl(ipromise2.ts, 6, 86)) + + value: T; +>value : Symbol(value, Decl(ipromise2.ts, 6, 117)) +>T : Symbol(T, Decl(ipromise2.ts, 1, 30)) + } +} + +var p: Windows.Foundation.IPromise; +>p : Symbol(p, Decl(ipromise2.ts, 11, 3)) +>Windows : Symbol(Windows, Decl(ipromise2.ts, 0, 0)) +>Foundation : Symbol(Windows.Foundation, Decl(ipromise2.ts, 0, 23)) +>IPromise : Symbol(Windows.Foundation.IPromise, Decl(ipromise2.ts, 0, 35)) + +var p2 = p.then(function (s) { +>p2 : Symbol(p2, Decl(ipromise2.ts, 13, 3)) +>p.then : Symbol(Windows.Foundation.IPromise.then, Decl(ipromise2.ts, 1, 34), Decl(ipromise2.ts, 2, 159), Decl(ipromise2.ts, 3, 149), Decl(ipromise2.ts, 4, 149)) +>p : Symbol(p, Decl(ipromise2.ts, 11, 3)) +>then : Symbol(Windows.Foundation.IPromise.then, Decl(ipromise2.ts, 1, 34), Decl(ipromise2.ts, 2, 159), Decl(ipromise2.ts, 3, 149), Decl(ipromise2.ts, 4, 149)) +>s : Symbol(s, Decl(ipromise2.ts, 13, 26)) + + return 34; +} ); + + +var x: number = p2.value; +>x : Symbol(x, Decl(ipromise2.ts, 18, 3)) +>p2.value : Symbol(Windows.Foundation.IPromise.value, Decl(ipromise2.ts, 6, 117)) +>p2 : Symbol(p2, Decl(ipromise2.ts, 13, 3)) +>value : Symbol(Windows.Foundation.IPromise.value, Decl(ipromise2.ts, 6, 117)) + + diff --git a/tests/baselines/reference/ipromise2.types b/tests/baselines/reference/ipromise2.types index 72c7b44f146..b52c3460dd4 100644 --- a/tests/baselines/reference/ipromise2.types +++ b/tests/baselines/reference/ipromise2.types @@ -1,7 +1,7 @@ === tests/cases/compiler/ipromise2.ts === declare module Windows.Foundation { ->Windows : unknown ->Foundation : unknown +>Windows : any +>Foundation : any export interface IPromise { >IPromise : IPromise @@ -21,8 +21,8 @@ declare module Windows.Foundation { >U : U >progress : (progress: any) => void >progress : any ->Windows : unknown ->Foundation : unknown +>Windows : any +>Foundation : any >IPromise : IPromise >U : U @@ -39,8 +39,8 @@ declare module Windows.Foundation { >U : U >progress : (progress: any) => void >progress : any ->Windows : unknown ->Foundation : unknown +>Windows : any +>Foundation : any >IPromise : IPromise >U : U @@ -57,8 +57,8 @@ declare module Windows.Foundation { >U : U >progress : (progress: any) => void >progress : any ->Windows : unknown ->Foundation : unknown +>Windows : any +>Foundation : any >IPromise : IPromise >U : U @@ -74,8 +74,8 @@ declare module Windows.Foundation { >U : U >progress : (progress: any) => void >progress : any ->Windows : unknown ->Foundation : unknown +>Windows : any +>Foundation : any >IPromise : IPromise >U : U @@ -98,8 +98,8 @@ declare module Windows.Foundation { var p: Windows.Foundation.IPromise; >p : Windows.Foundation.IPromise ->Windows : unknown ->Foundation : unknown +>Windows : any +>Foundation : any >IPromise : Windows.Foundation.IPromise var p2 = p.then(function (s) { @@ -112,6 +112,8 @@ var p2 = p.then(function (s) { >s : string return 34; +>34 : number + } ); diff --git a/tests/baselines/reference/ipromise3.symbols b/tests/baselines/reference/ipromise3.symbols new file mode 100644 index 00000000000..3605a94fc88 --- /dev/null +++ b/tests/baselines/reference/ipromise3.symbols @@ -0,0 +1,97 @@ +=== tests/cases/compiler/ipromise3.ts === +interface IPromise3 { +>IPromise3 : Symbol(IPromise3, Decl(ipromise3.ts, 0, 0)) +>T : Symbol(T, Decl(ipromise3.ts, 0, 20)) + + then(success?: (value: T) => IPromise3, error?: (error: any) => IPromise3, progress?: (progress: any) => void ): IPromise3; +>then : Symbol(then, Decl(ipromise3.ts, 0, 24), Decl(ipromise3.ts, 1, 139), Decl(ipromise3.ts, 2, 128), Decl(ipromise3.ts, 3, 128)) +>U : Symbol(U, Decl(ipromise3.ts, 1, 9)) +>success : Symbol(success, Decl(ipromise3.ts, 1, 12)) +>value : Symbol(value, Decl(ipromise3.ts, 1, 23)) +>T : Symbol(T, Decl(ipromise3.ts, 0, 20)) +>IPromise3 : Symbol(IPromise3, Decl(ipromise3.ts, 0, 0)) +>U : Symbol(U, Decl(ipromise3.ts, 1, 9)) +>error : Symbol(error, Decl(ipromise3.ts, 1, 49)) +>error : Symbol(error, Decl(ipromise3.ts, 1, 59)) +>IPromise3 : Symbol(IPromise3, Decl(ipromise3.ts, 0, 0)) +>U : Symbol(U, Decl(ipromise3.ts, 1, 9)) +>progress : Symbol(progress, Decl(ipromise3.ts, 1, 87)) +>progress : Symbol(progress, Decl(ipromise3.ts, 1, 100)) +>IPromise3 : Symbol(IPromise3, Decl(ipromise3.ts, 0, 0)) +>U : Symbol(U, Decl(ipromise3.ts, 1, 9)) + + then(success?: (value: T) => IPromise3, error?: (error: any) => U, progress?: (progress: any) => void ): IPromise3; +>then : Symbol(then, Decl(ipromise3.ts, 0, 24), Decl(ipromise3.ts, 1, 139), Decl(ipromise3.ts, 2, 128), Decl(ipromise3.ts, 3, 128)) +>U : Symbol(U, Decl(ipromise3.ts, 2, 9)) +>success : Symbol(success, Decl(ipromise3.ts, 2, 12)) +>value : Symbol(value, Decl(ipromise3.ts, 2, 23)) +>T : Symbol(T, Decl(ipromise3.ts, 0, 20)) +>IPromise3 : Symbol(IPromise3, Decl(ipromise3.ts, 0, 0)) +>U : Symbol(U, Decl(ipromise3.ts, 2, 9)) +>error : Symbol(error, Decl(ipromise3.ts, 2, 49)) +>error : Symbol(error, Decl(ipromise3.ts, 2, 59)) +>U : Symbol(U, Decl(ipromise3.ts, 2, 9)) +>progress : Symbol(progress, Decl(ipromise3.ts, 2, 76)) +>progress : Symbol(progress, Decl(ipromise3.ts, 2, 89)) +>IPromise3 : Symbol(IPromise3, Decl(ipromise3.ts, 0, 0)) +>U : Symbol(U, Decl(ipromise3.ts, 2, 9)) + + then(success?: (value: T) => U, error?: (error: any) => IPromise3, progress?: (progress: any) => void ): IPromise3; +>then : Symbol(then, Decl(ipromise3.ts, 0, 24), Decl(ipromise3.ts, 1, 139), Decl(ipromise3.ts, 2, 128), Decl(ipromise3.ts, 3, 128)) +>U : Symbol(U, Decl(ipromise3.ts, 3, 9)) +>success : Symbol(success, Decl(ipromise3.ts, 3, 12)) +>value : Symbol(value, Decl(ipromise3.ts, 3, 23)) +>T : Symbol(T, Decl(ipromise3.ts, 0, 20)) +>U : Symbol(U, Decl(ipromise3.ts, 3, 9)) +>error : Symbol(error, Decl(ipromise3.ts, 3, 38)) +>error : Symbol(error, Decl(ipromise3.ts, 3, 48)) +>IPromise3 : Symbol(IPromise3, Decl(ipromise3.ts, 0, 0)) +>U : Symbol(U, Decl(ipromise3.ts, 3, 9)) +>progress : Symbol(progress, Decl(ipromise3.ts, 3, 76)) +>progress : Symbol(progress, Decl(ipromise3.ts, 3, 89)) +>IPromise3 : Symbol(IPromise3, Decl(ipromise3.ts, 0, 0)) +>U : Symbol(U, Decl(ipromise3.ts, 3, 9)) + + then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void ): IPromise3; +>then : Symbol(then, Decl(ipromise3.ts, 0, 24), Decl(ipromise3.ts, 1, 139), Decl(ipromise3.ts, 2, 128), Decl(ipromise3.ts, 3, 128)) +>U : Symbol(U, Decl(ipromise3.ts, 4, 9)) +>success : Symbol(success, Decl(ipromise3.ts, 4, 12)) +>value : Symbol(value, Decl(ipromise3.ts, 4, 23)) +>T : Symbol(T, Decl(ipromise3.ts, 0, 20)) +>U : Symbol(U, Decl(ipromise3.ts, 4, 9)) +>error : Symbol(error, Decl(ipromise3.ts, 4, 38)) +>error : Symbol(error, Decl(ipromise3.ts, 4, 48)) +>U : Symbol(U, Decl(ipromise3.ts, 4, 9)) +>progress : Symbol(progress, Decl(ipromise3.ts, 4, 65)) +>progress : Symbol(progress, Decl(ipromise3.ts, 4, 78)) +>IPromise3 : Symbol(IPromise3, Decl(ipromise3.ts, 0, 0)) +>U : Symbol(U, Decl(ipromise3.ts, 4, 9)) + + done? (success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; +>done : Symbol(done, Decl(ipromise3.ts, 4, 117)) +>U : Symbol(U, Decl(ipromise3.ts, 5, 11)) +>success : Symbol(success, Decl(ipromise3.ts, 5, 14)) +>value : Symbol(value, Decl(ipromise3.ts, 5, 25)) +>T : Symbol(T, Decl(ipromise3.ts, 0, 20)) +>error : Symbol(error, Decl(ipromise3.ts, 5, 42)) +>error : Symbol(error, Decl(ipromise3.ts, 5, 52)) +>progress : Symbol(progress, Decl(ipromise3.ts, 5, 71)) +>progress : Symbol(progress, Decl(ipromise3.ts, 5, 84)) +} +var p1: IPromise3; +>p1 : Symbol(p1, Decl(ipromise3.ts, 7, 3)) +>IPromise3 : Symbol(IPromise3, Decl(ipromise3.ts, 0, 0)) + +var p2: IPromise3 = p1.then(function (x) { +>p2 : Symbol(p2, Decl(ipromise3.ts, 8, 3)) +>IPromise3 : Symbol(IPromise3, Decl(ipromise3.ts, 0, 0)) +>p1.then : Symbol(IPromise3.then, Decl(ipromise3.ts, 0, 24), Decl(ipromise3.ts, 1, 139), Decl(ipromise3.ts, 2, 128), Decl(ipromise3.ts, 3, 128)) +>p1 : Symbol(p1, Decl(ipromise3.ts, 7, 3)) +>then : Symbol(IPromise3.then, Decl(ipromise3.ts, 0, 24), Decl(ipromise3.ts, 1, 139), Decl(ipromise3.ts, 2, 128), Decl(ipromise3.ts, 3, 128)) +>x : Symbol(x, Decl(ipromise3.ts, 8, 46)) + + return x; +>x : Symbol(x, Decl(ipromise3.ts, 8, 46)) + +}); + diff --git a/tests/baselines/reference/ipromise4.symbols b/tests/baselines/reference/ipromise4.symbols new file mode 100644 index 00000000000..65ae5f90cfe --- /dev/null +++ b/tests/baselines/reference/ipromise4.symbols @@ -0,0 +1,117 @@ +=== tests/cases/compiler/ipromise4.ts === +declare module Windows.Foundation { +>Windows : Symbol(Windows, Decl(ipromise4.ts, 0, 0)) +>Foundation : Symbol(Foundation, Decl(ipromise4.ts, 0, 23)) + + export interface IPromise { +>IPromise : Symbol(IPromise, Decl(ipromise4.ts, 0, 35)) +>T : Symbol(T, Decl(ipromise4.ts, 1, 30)) + + then(success?: (value: T) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; +>then : Symbol(then, Decl(ipromise4.ts, 1, 34), Decl(ipromise4.ts, 2, 159), Decl(ipromise4.ts, 3, 149), Decl(ipromise4.ts, 4, 149)) +>U : Symbol(U, Decl(ipromise4.ts, 2, 13)) +>success : Symbol(success, Decl(ipromise4.ts, 2, 16)) +>value : Symbol(value, Decl(ipromise4.ts, 2, 27)) +>T : Symbol(T, Decl(ipromise4.ts, 1, 30)) +>IPromise : Symbol(IPromise, Decl(ipromise4.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise4.ts, 2, 13)) +>error : Symbol(error, Decl(ipromise4.ts, 2, 52)) +>error : Symbol(error, Decl(ipromise4.ts, 2, 62)) +>IPromise : Symbol(IPromise, Decl(ipromise4.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise4.ts, 2, 13)) +>progress : Symbol(progress, Decl(ipromise4.ts, 2, 89)) +>progress : Symbol(progress, Decl(ipromise4.ts, 2, 102)) +>Windows : Symbol(Windows, Decl(ipromise4.ts, 0, 0)) +>Foundation : Symbol(Foundation, Decl(ipromise4.ts, 0, 23)) +>IPromise : Symbol(IPromise, Decl(ipromise4.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise4.ts, 2, 13)) + + then(success?: (value: T) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; +>then : Symbol(then, Decl(ipromise4.ts, 1, 34), Decl(ipromise4.ts, 2, 159), Decl(ipromise4.ts, 3, 149), Decl(ipromise4.ts, 4, 149)) +>U : Symbol(U, Decl(ipromise4.ts, 3, 13)) +>success : Symbol(success, Decl(ipromise4.ts, 3, 16)) +>value : Symbol(value, Decl(ipromise4.ts, 3, 27)) +>T : Symbol(T, Decl(ipromise4.ts, 1, 30)) +>IPromise : Symbol(IPromise, Decl(ipromise4.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise4.ts, 3, 13)) +>error : Symbol(error, Decl(ipromise4.ts, 3, 52)) +>error : Symbol(error, Decl(ipromise4.ts, 3, 62)) +>U : Symbol(U, Decl(ipromise4.ts, 3, 13)) +>progress : Symbol(progress, Decl(ipromise4.ts, 3, 79)) +>progress : Symbol(progress, Decl(ipromise4.ts, 3, 92)) +>Windows : Symbol(Windows, Decl(ipromise4.ts, 0, 0)) +>Foundation : Symbol(Foundation, Decl(ipromise4.ts, 0, 23)) +>IPromise : Symbol(IPromise, Decl(ipromise4.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise4.ts, 3, 13)) + + then(success?: (value: T) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; +>then : Symbol(then, Decl(ipromise4.ts, 1, 34), Decl(ipromise4.ts, 2, 159), Decl(ipromise4.ts, 3, 149), Decl(ipromise4.ts, 4, 149)) +>U : Symbol(U, Decl(ipromise4.ts, 4, 13)) +>success : Symbol(success, Decl(ipromise4.ts, 4, 16)) +>value : Symbol(value, Decl(ipromise4.ts, 4, 27)) +>T : Symbol(T, Decl(ipromise4.ts, 1, 30)) +>U : Symbol(U, Decl(ipromise4.ts, 4, 13)) +>error : Symbol(error, Decl(ipromise4.ts, 4, 42)) +>error : Symbol(error, Decl(ipromise4.ts, 4, 52)) +>IPromise : Symbol(IPromise, Decl(ipromise4.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise4.ts, 4, 13)) +>progress : Symbol(progress, Decl(ipromise4.ts, 4, 79)) +>progress : Symbol(progress, Decl(ipromise4.ts, 4, 92)) +>Windows : Symbol(Windows, Decl(ipromise4.ts, 0, 0)) +>Foundation : Symbol(Foundation, Decl(ipromise4.ts, 0, 23)) +>IPromise : Symbol(IPromise, Decl(ipromise4.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise4.ts, 4, 13)) + + then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; +>then : Symbol(then, Decl(ipromise4.ts, 1, 34), Decl(ipromise4.ts, 2, 159), Decl(ipromise4.ts, 3, 149), Decl(ipromise4.ts, 4, 149)) +>U : Symbol(U, Decl(ipromise4.ts, 5, 13)) +>success : Symbol(success, Decl(ipromise4.ts, 5, 16)) +>value : Symbol(value, Decl(ipromise4.ts, 5, 27)) +>T : Symbol(T, Decl(ipromise4.ts, 1, 30)) +>U : Symbol(U, Decl(ipromise4.ts, 5, 13)) +>error : Symbol(error, Decl(ipromise4.ts, 5, 42)) +>error : Symbol(error, Decl(ipromise4.ts, 5, 52)) +>U : Symbol(U, Decl(ipromise4.ts, 5, 13)) +>progress : Symbol(progress, Decl(ipromise4.ts, 5, 69)) +>progress : Symbol(progress, Decl(ipromise4.ts, 5, 82)) +>Windows : Symbol(Windows, Decl(ipromise4.ts, 0, 0)) +>Foundation : Symbol(Foundation, Decl(ipromise4.ts, 0, 23)) +>IPromise : Symbol(IPromise, Decl(ipromise4.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise4.ts, 5, 13)) + + done? (success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; +>done : Symbol(done, Decl(ipromise4.ts, 5, 139)) +>U : Symbol(U, Decl(ipromise4.ts, 6, 15)) +>success : Symbol(success, Decl(ipromise4.ts, 6, 18)) +>value : Symbol(value, Decl(ipromise4.ts, 6, 29)) +>T : Symbol(T, Decl(ipromise4.ts, 1, 30)) +>error : Symbol(error, Decl(ipromise4.ts, 6, 46)) +>error : Symbol(error, Decl(ipromise4.ts, 6, 56)) +>progress : Symbol(progress, Decl(ipromise4.ts, 6, 75)) +>progress : Symbol(progress, Decl(ipromise4.ts, 6, 88)) + } +} + +var p: Windows.Foundation.IPromise = null; +>p : Symbol(p, Decl(ipromise4.ts, 10, 3)) +>Windows : Symbol(Windows, Decl(ipromise4.ts, 0, 0)) +>Foundation : Symbol(Windows.Foundation, Decl(ipromise4.ts, 0, 23)) +>IPromise : Symbol(Windows.Foundation.IPromise, Decl(ipromise4.ts, 0, 35)) + +p.then(function (x) { } ); // should not error +>p.then : Symbol(Windows.Foundation.IPromise.then, Decl(ipromise4.ts, 1, 34), Decl(ipromise4.ts, 2, 159), Decl(ipromise4.ts, 3, 149), Decl(ipromise4.ts, 4, 149)) +>p : Symbol(p, Decl(ipromise4.ts, 10, 3)) +>then : Symbol(Windows.Foundation.IPromise.then, Decl(ipromise4.ts, 1, 34), Decl(ipromise4.ts, 2, 159), Decl(ipromise4.ts, 3, 149), Decl(ipromise4.ts, 4, 149)) +>x : Symbol(x, Decl(ipromise4.ts, 12, 17)) + +p.then(function (x) { return "hello"; } ).then(function (x) { return x } ); // should not error +>p.then(function (x) { return "hello"; } ).then : Symbol(Windows.Foundation.IPromise.then, Decl(ipromise4.ts, 1, 34), Decl(ipromise4.ts, 2, 159), Decl(ipromise4.ts, 3, 149), Decl(ipromise4.ts, 4, 149)) +>p.then : Symbol(Windows.Foundation.IPromise.then, Decl(ipromise4.ts, 1, 34), Decl(ipromise4.ts, 2, 159), Decl(ipromise4.ts, 3, 149), Decl(ipromise4.ts, 4, 149)) +>p : Symbol(p, Decl(ipromise4.ts, 10, 3)) +>then : Symbol(Windows.Foundation.IPromise.then, Decl(ipromise4.ts, 1, 34), Decl(ipromise4.ts, 2, 159), Decl(ipromise4.ts, 3, 149), Decl(ipromise4.ts, 4, 149)) +>x : Symbol(x, Decl(ipromise4.ts, 13, 17)) +>then : Symbol(Windows.Foundation.IPromise.then, Decl(ipromise4.ts, 1, 34), Decl(ipromise4.ts, 2, 159), Decl(ipromise4.ts, 3, 149), Decl(ipromise4.ts, 4, 149)) +>x : Symbol(x, Decl(ipromise4.ts, 13, 57)) +>x : Symbol(x, Decl(ipromise4.ts, 13, 57)) + + diff --git a/tests/baselines/reference/ipromise4.types b/tests/baselines/reference/ipromise4.types index 0ae6c35f1fd..b12c47c7ed5 100644 --- a/tests/baselines/reference/ipromise4.types +++ b/tests/baselines/reference/ipromise4.types @@ -1,7 +1,7 @@ === tests/cases/compiler/ipromise4.ts === declare module Windows.Foundation { ->Windows : unknown ->Foundation : unknown +>Windows : any +>Foundation : any export interface IPromise { >IPromise : IPromise @@ -21,8 +21,8 @@ declare module Windows.Foundation { >U : U >progress : (progress: any) => void >progress : any ->Windows : unknown ->Foundation : unknown +>Windows : any +>Foundation : any >IPromise : IPromise >U : U @@ -39,8 +39,8 @@ declare module Windows.Foundation { >U : U >progress : (progress: any) => void >progress : any ->Windows : unknown ->Foundation : unknown +>Windows : any +>Foundation : any >IPromise : IPromise >U : U @@ -57,8 +57,8 @@ declare module Windows.Foundation { >U : U >progress : (progress: any) => void >progress : any ->Windows : unknown ->Foundation : unknown +>Windows : any +>Foundation : any >IPromise : IPromise >U : U @@ -74,8 +74,8 @@ declare module Windows.Foundation { >U : U >progress : (progress: any) => void >progress : any ->Windows : unknown ->Foundation : unknown +>Windows : any +>Foundation : any >IPromise : IPromise >U : U @@ -94,9 +94,10 @@ declare module Windows.Foundation { var p: Windows.Foundation.IPromise = null; >p : Windows.Foundation.IPromise ->Windows : unknown ->Foundation : unknown +>Windows : any +>Foundation : any >IPromise : Windows.Foundation.IPromise +>null : null p.then(function (x) { } ); // should not error >p.then(function (x) { } ) : Windows.Foundation.IPromise @@ -115,6 +116,7 @@ p.then(function (x) { return "hello"; } ).then(function (x) { return x } ); // s >then : { (success?: (value: number) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: number) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: number) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; } >function (x) { return "hello"; } : (x: number) => string >x : number +>"hello" : string >then : { (success?: (value: string) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: string) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: string) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; } >function (x) { return x } : (x: string) => string >x : string diff --git a/tests/baselines/reference/isDeclarationVisibleNodeKinds.symbols b/tests/baselines/reference/isDeclarationVisibleNodeKinds.symbols new file mode 100644 index 00000000000..659a1330616 --- /dev/null +++ b/tests/baselines/reference/isDeclarationVisibleNodeKinds.symbols @@ -0,0 +1,168 @@ +=== tests/cases/compiler/isDeclarationVisibleNodeKinds.ts === + +// Function types +module schema { +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 0, 0), Decl(isDeclarationVisibleNodeKinds.ts, 6, 1), Decl(isDeclarationVisibleNodeKinds.ts, 13, 1), Decl(isDeclarationVisibleNodeKinds.ts, 20, 1), Decl(isDeclarationVisibleNodeKinds.ts, 27, 1), Decl(isDeclarationVisibleNodeKinds.ts, 35, 1), Decl(isDeclarationVisibleNodeKinds.ts, 42, 1), Decl(isDeclarationVisibleNodeKinds.ts, 49, 1), Decl(isDeclarationVisibleNodeKinds.ts, 56, 1)) + + export function createValidator1(schema: any): (data: T) => T { +>createValidator1 : Symbol(createValidator1, Decl(isDeclarationVisibleNodeKinds.ts, 2, 15)) +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 3, 37)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 3, 52)) +>data : Symbol(data, Decl(isDeclarationVisibleNodeKinds.ts, 3, 55)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 3, 52)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 3, 52)) + + return undefined; +>undefined : Symbol(undefined) + } +} + +// Constructor types +module schema { +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 0, 0), Decl(isDeclarationVisibleNodeKinds.ts, 6, 1), Decl(isDeclarationVisibleNodeKinds.ts, 13, 1), Decl(isDeclarationVisibleNodeKinds.ts, 20, 1), Decl(isDeclarationVisibleNodeKinds.ts, 27, 1), Decl(isDeclarationVisibleNodeKinds.ts, 35, 1), Decl(isDeclarationVisibleNodeKinds.ts, 42, 1), Decl(isDeclarationVisibleNodeKinds.ts, 49, 1), Decl(isDeclarationVisibleNodeKinds.ts, 56, 1)) + + export function createValidator2(schema: any): new (data: T) => T { +>createValidator2 : Symbol(createValidator2, Decl(isDeclarationVisibleNodeKinds.ts, 9, 15)) +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 10, 37)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 10, 56)) +>data : Symbol(data, Decl(isDeclarationVisibleNodeKinds.ts, 10, 59)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 10, 56)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 10, 56)) + + return undefined; +>undefined : Symbol(undefined) + } +} + +// union types +module schema { +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 0, 0), Decl(isDeclarationVisibleNodeKinds.ts, 6, 1), Decl(isDeclarationVisibleNodeKinds.ts, 13, 1), Decl(isDeclarationVisibleNodeKinds.ts, 20, 1), Decl(isDeclarationVisibleNodeKinds.ts, 27, 1), Decl(isDeclarationVisibleNodeKinds.ts, 35, 1), Decl(isDeclarationVisibleNodeKinds.ts, 42, 1), Decl(isDeclarationVisibleNodeKinds.ts, 49, 1), Decl(isDeclarationVisibleNodeKinds.ts, 56, 1)) + + export function createValidator3(schema: any): number | { new (data: T): T; } { +>createValidator3 : Symbol(createValidator3, Decl(isDeclarationVisibleNodeKinds.ts, 16, 15)) +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 17, 38)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 17, 68)) +>data : Symbol(data, Decl(isDeclarationVisibleNodeKinds.ts, 17, 71)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 17, 68)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 17, 68)) + + return undefined; +>undefined : Symbol(undefined) + } +} + +// Array types +module schema { +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 0, 0), Decl(isDeclarationVisibleNodeKinds.ts, 6, 1), Decl(isDeclarationVisibleNodeKinds.ts, 13, 1), Decl(isDeclarationVisibleNodeKinds.ts, 20, 1), Decl(isDeclarationVisibleNodeKinds.ts, 27, 1), Decl(isDeclarationVisibleNodeKinds.ts, 35, 1), Decl(isDeclarationVisibleNodeKinds.ts, 42, 1), Decl(isDeclarationVisibleNodeKinds.ts, 49, 1), Decl(isDeclarationVisibleNodeKinds.ts, 56, 1)) + + export function createValidator4(schema: any): { new (data: T): T; }[] { +>createValidator4 : Symbol(createValidator4, Decl(isDeclarationVisibleNodeKinds.ts, 23, 15)) +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 24, 38)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 24, 59)) +>data : Symbol(data, Decl(isDeclarationVisibleNodeKinds.ts, 24, 62)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 24, 59)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 24, 59)) + + return undefined; +>undefined : Symbol(undefined) + } +} + + +// TypeLiterals +module schema { +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 0, 0), Decl(isDeclarationVisibleNodeKinds.ts, 6, 1), Decl(isDeclarationVisibleNodeKinds.ts, 13, 1), Decl(isDeclarationVisibleNodeKinds.ts, 20, 1), Decl(isDeclarationVisibleNodeKinds.ts, 27, 1), Decl(isDeclarationVisibleNodeKinds.ts, 35, 1), Decl(isDeclarationVisibleNodeKinds.ts, 42, 1), Decl(isDeclarationVisibleNodeKinds.ts, 49, 1), Decl(isDeclarationVisibleNodeKinds.ts, 56, 1)) + + export function createValidator5(schema: any): { new (data: T): T } { +>createValidator5 : Symbol(createValidator5, Decl(isDeclarationVisibleNodeKinds.ts, 31, 15)) +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 32, 37)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 32, 58)) +>data : Symbol(data, Decl(isDeclarationVisibleNodeKinds.ts, 32, 61)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 32, 58)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 32, 58)) + + return undefined; +>undefined : Symbol(undefined) + } +} + +// Tuple types +module schema { +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 0, 0), Decl(isDeclarationVisibleNodeKinds.ts, 6, 1), Decl(isDeclarationVisibleNodeKinds.ts, 13, 1), Decl(isDeclarationVisibleNodeKinds.ts, 20, 1), Decl(isDeclarationVisibleNodeKinds.ts, 27, 1), Decl(isDeclarationVisibleNodeKinds.ts, 35, 1), Decl(isDeclarationVisibleNodeKinds.ts, 42, 1), Decl(isDeclarationVisibleNodeKinds.ts, 49, 1), Decl(isDeclarationVisibleNodeKinds.ts, 56, 1)) + + export function createValidator6(schema: any): [ new (data: T) => T, number] { +>createValidator6 : Symbol(createValidator6, Decl(isDeclarationVisibleNodeKinds.ts, 38, 15)) +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 39, 37)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 39, 58)) +>data : Symbol(data, Decl(isDeclarationVisibleNodeKinds.ts, 39, 61)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 39, 58)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 39, 58)) + + return undefined; +>undefined : Symbol(undefined) + } +} + +// Paren Types +module schema { +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 0, 0), Decl(isDeclarationVisibleNodeKinds.ts, 6, 1), Decl(isDeclarationVisibleNodeKinds.ts, 13, 1), Decl(isDeclarationVisibleNodeKinds.ts, 20, 1), Decl(isDeclarationVisibleNodeKinds.ts, 27, 1), Decl(isDeclarationVisibleNodeKinds.ts, 35, 1), Decl(isDeclarationVisibleNodeKinds.ts, 42, 1), Decl(isDeclarationVisibleNodeKinds.ts, 49, 1), Decl(isDeclarationVisibleNodeKinds.ts, 56, 1)) + + export function createValidator7(schema: any): (new (data: T)=>T )[] { +>createValidator7 : Symbol(createValidator7, Decl(isDeclarationVisibleNodeKinds.ts, 45, 15)) +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 46, 37)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 46, 57)) +>data : Symbol(data, Decl(isDeclarationVisibleNodeKinds.ts, 46, 60)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 46, 57)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 46, 57)) + + return undefined; +>undefined : Symbol(undefined) + } +} + +// Type reference +module schema { +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 0, 0), Decl(isDeclarationVisibleNodeKinds.ts, 6, 1), Decl(isDeclarationVisibleNodeKinds.ts, 13, 1), Decl(isDeclarationVisibleNodeKinds.ts, 20, 1), Decl(isDeclarationVisibleNodeKinds.ts, 27, 1), Decl(isDeclarationVisibleNodeKinds.ts, 35, 1), Decl(isDeclarationVisibleNodeKinds.ts, 42, 1), Decl(isDeclarationVisibleNodeKinds.ts, 49, 1), Decl(isDeclarationVisibleNodeKinds.ts, 56, 1)) + + export function createValidator8(schema: any): Array<{ (data: T) : T}> { +>createValidator8 : Symbol(createValidator8, Decl(isDeclarationVisibleNodeKinds.ts, 52, 15)) +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 53, 37)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 53, 60)) +>data : Symbol(data, Decl(isDeclarationVisibleNodeKinds.ts, 53, 63)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 53, 60)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 53, 60)) + + return undefined; +>undefined : Symbol(undefined) + } +} + + +module schema { +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 0, 0), Decl(isDeclarationVisibleNodeKinds.ts, 6, 1), Decl(isDeclarationVisibleNodeKinds.ts, 13, 1), Decl(isDeclarationVisibleNodeKinds.ts, 20, 1), Decl(isDeclarationVisibleNodeKinds.ts, 27, 1), Decl(isDeclarationVisibleNodeKinds.ts, 35, 1), Decl(isDeclarationVisibleNodeKinds.ts, 42, 1), Decl(isDeclarationVisibleNodeKinds.ts, 49, 1), Decl(isDeclarationVisibleNodeKinds.ts, 56, 1)) + + export class T { +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 59, 15)) + + get createValidator9(): (data: T) => T { +>createValidator9 : Symbol(createValidator9, Decl(isDeclarationVisibleNodeKinds.ts, 60, 20)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 61, 33)) +>data : Symbol(data, Decl(isDeclarationVisibleNodeKinds.ts, 61, 36)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 61, 33)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 61, 33)) + + return undefined; +>undefined : Symbol(undefined) + } + + set createValidator10(v: (data: T) => T) { +>createValidator10 : Symbol(createValidator10, Decl(isDeclarationVisibleNodeKinds.ts, 63, 9)) +>v : Symbol(v, Decl(isDeclarationVisibleNodeKinds.ts, 65, 30)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 65, 34)) +>data : Symbol(data, Decl(isDeclarationVisibleNodeKinds.ts, 65, 37)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 65, 34)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 65, 34)) + } + } +} diff --git a/tests/baselines/reference/isLiteral1.symbols b/tests/baselines/reference/isLiteral1.symbols new file mode 100644 index 00000000000..62163aabfbb --- /dev/null +++ b/tests/baselines/reference/isLiteral1.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/isLiteral1.ts === +var x: number = 02343; +>x : Symbol(x, Decl(isLiteral1.ts, 0, 3)) + diff --git a/tests/baselines/reference/isLiteral1.types b/tests/baselines/reference/isLiteral1.types index f26eab098b4..7ef84568f86 100644 --- a/tests/baselines/reference/isLiteral1.types +++ b/tests/baselines/reference/isLiteral1.types @@ -1,4 +1,5 @@ === tests/cases/compiler/isLiteral1.ts === var x: number = 02343; >x : number +>02343 : number diff --git a/tests/baselines/reference/isLiteral2.symbols b/tests/baselines/reference/isLiteral2.symbols new file mode 100644 index 00000000000..e1f25bf00a2 --- /dev/null +++ b/tests/baselines/reference/isLiteral2.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/isLiteral2.ts === +var x: number = 02343 +>x : Symbol(x, Decl(isLiteral2.ts, 0, 3)) + diff --git a/tests/baselines/reference/isLiteral2.types b/tests/baselines/reference/isLiteral2.types index 32c1b29f13e..ab62993fab6 100644 --- a/tests/baselines/reference/isLiteral2.types +++ b/tests/baselines/reference/isLiteral2.types @@ -1,4 +1,5 @@ === tests/cases/compiler/isLiteral2.ts === var x: number = 02343 >x : number +>02343 : number diff --git a/tests/baselines/reference/iterableArrayPattern1.symbols b/tests/baselines/reference/iterableArrayPattern1.symbols new file mode 100644 index 00000000000..ae0acb823a0 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern1.symbols @@ -0,0 +1,32 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern1.ts === +var [a, b] = new SymbolIterator; +>a : Symbol(a, Decl(iterableArrayPattern1.ts, 0, 5)) +>b : Symbol(b, Decl(iterableArrayPattern1.ts, 0, 7)) +>SymbolIterator : Symbol(SymbolIterator, Decl(iterableArrayPattern1.ts, 0, 32)) + +class SymbolIterator { +>SymbolIterator : Symbol(SymbolIterator, Decl(iterableArrayPattern1.ts, 0, 32)) + + next() { +>next : Symbol(next, Decl(iterableArrayPattern1.ts, 1, 22)) + + return { + value: Symbol(), +>value : Symbol(value, Decl(iterableArrayPattern1.ts, 3, 16)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) + + done: false +>done : Symbol(done, Decl(iterableArrayPattern1.ts, 4, 28)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(SymbolIterator, Decl(iterableArrayPattern1.ts, 0, 32)) + } +} diff --git a/tests/baselines/reference/iterableArrayPattern1.types b/tests/baselines/reference/iterableArrayPattern1.types index 8be8521c684..2cfd2354f31 100644 --- a/tests/baselines/reference/iterableArrayPattern1.types +++ b/tests/baselines/reference/iterableArrayPattern1.types @@ -21,6 +21,7 @@ class SymbolIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iterableArrayPattern11.symbols b/tests/baselines/reference/iterableArrayPattern11.symbols new file mode 100644 index 00000000000..38a9b18e2d1 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern11.symbols @@ -0,0 +1,46 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern11.ts === +function fun([a, b] = new FooIterator) { } +>fun : Symbol(fun, Decl(iterableArrayPattern11.ts, 0, 0)) +>a : Symbol(a, Decl(iterableArrayPattern11.ts, 0, 14)) +>b : Symbol(b, Decl(iterableArrayPattern11.ts, 0, 16)) +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern11.ts, 3, 27)) + +fun(new FooIterator); +>fun : Symbol(fun, Decl(iterableArrayPattern11.ts, 0, 0)) +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern11.ts, 3, 27)) + +class Bar { x } +>Bar : Symbol(Bar, Decl(iterableArrayPattern11.ts, 1, 21)) +>x : Symbol(x, Decl(iterableArrayPattern11.ts, 2, 11)) + +class Foo extends Bar { y } +>Foo : Symbol(Foo, Decl(iterableArrayPattern11.ts, 2, 15)) +>Bar : Symbol(Bar, Decl(iterableArrayPattern11.ts, 1, 21)) +>y : Symbol(y, Decl(iterableArrayPattern11.ts, 3, 23)) + +class FooIterator { +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern11.ts, 3, 27)) + + next() { +>next : Symbol(next, Decl(iterableArrayPattern11.ts, 4, 19)) + + return { + value: new Foo, +>value : Symbol(value, Decl(iterableArrayPattern11.ts, 6, 16)) +>Foo : Symbol(Foo, Decl(iterableArrayPattern11.ts, 2, 15)) + + done: false +>done : Symbol(done, Decl(iterableArrayPattern11.ts, 7, 27)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(FooIterator, Decl(iterableArrayPattern11.ts, 3, 27)) + } +} diff --git a/tests/baselines/reference/iterableArrayPattern11.types b/tests/baselines/reference/iterableArrayPattern11.types index 2b6f1d67336..3118e748d6f 100644 --- a/tests/baselines/reference/iterableArrayPattern11.types +++ b/tests/baselines/reference/iterableArrayPattern11.types @@ -37,6 +37,7 @@ class FooIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iterableArrayPattern12.symbols b/tests/baselines/reference/iterableArrayPattern12.symbols new file mode 100644 index 00000000000..118bea4d0b4 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern12.symbols @@ -0,0 +1,46 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern12.ts === +function fun([a, ...b] = new FooIterator) { } +>fun : Symbol(fun, Decl(iterableArrayPattern12.ts, 0, 0)) +>a : Symbol(a, Decl(iterableArrayPattern12.ts, 0, 14)) +>b : Symbol(b, Decl(iterableArrayPattern12.ts, 0, 16)) +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern12.ts, 3, 27)) + +fun(new FooIterator); +>fun : Symbol(fun, Decl(iterableArrayPattern12.ts, 0, 0)) +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern12.ts, 3, 27)) + +class Bar { x } +>Bar : Symbol(Bar, Decl(iterableArrayPattern12.ts, 1, 21)) +>x : Symbol(x, Decl(iterableArrayPattern12.ts, 2, 11)) + +class Foo extends Bar { y } +>Foo : Symbol(Foo, Decl(iterableArrayPattern12.ts, 2, 15)) +>Bar : Symbol(Bar, Decl(iterableArrayPattern12.ts, 1, 21)) +>y : Symbol(y, Decl(iterableArrayPattern12.ts, 3, 23)) + +class FooIterator { +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern12.ts, 3, 27)) + + next() { +>next : Symbol(next, Decl(iterableArrayPattern12.ts, 4, 19)) + + return { + value: new Foo, +>value : Symbol(value, Decl(iterableArrayPattern12.ts, 6, 16)) +>Foo : Symbol(Foo, Decl(iterableArrayPattern12.ts, 2, 15)) + + done: false +>done : Symbol(done, Decl(iterableArrayPattern12.ts, 7, 27)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(FooIterator, Decl(iterableArrayPattern12.ts, 3, 27)) + } +} diff --git a/tests/baselines/reference/iterableArrayPattern12.types b/tests/baselines/reference/iterableArrayPattern12.types index a415539b91c..b32c2ff7dc8 100644 --- a/tests/baselines/reference/iterableArrayPattern12.types +++ b/tests/baselines/reference/iterableArrayPattern12.types @@ -37,6 +37,7 @@ class FooIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iterableArrayPattern13.symbols b/tests/baselines/reference/iterableArrayPattern13.symbols new file mode 100644 index 00000000000..832d8ecf69c --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern13.symbols @@ -0,0 +1,45 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern13.ts === +function fun([a, ...b]) { } +>fun : Symbol(fun, Decl(iterableArrayPattern13.ts, 0, 0)) +>a : Symbol(a, Decl(iterableArrayPattern13.ts, 0, 14)) +>b : Symbol(b, Decl(iterableArrayPattern13.ts, 0, 16)) + +fun(new FooIterator); +>fun : Symbol(fun, Decl(iterableArrayPattern13.ts, 0, 0)) +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern13.ts, 3, 27)) + +class Bar { x } +>Bar : Symbol(Bar, Decl(iterableArrayPattern13.ts, 1, 21)) +>x : Symbol(x, Decl(iterableArrayPattern13.ts, 2, 11)) + +class Foo extends Bar { y } +>Foo : Symbol(Foo, Decl(iterableArrayPattern13.ts, 2, 15)) +>Bar : Symbol(Bar, Decl(iterableArrayPattern13.ts, 1, 21)) +>y : Symbol(y, Decl(iterableArrayPattern13.ts, 3, 23)) + +class FooIterator { +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern13.ts, 3, 27)) + + next() { +>next : Symbol(next, Decl(iterableArrayPattern13.ts, 4, 19)) + + return { + value: new Foo, +>value : Symbol(value, Decl(iterableArrayPattern13.ts, 6, 16)) +>Foo : Symbol(Foo, Decl(iterableArrayPattern13.ts, 2, 15)) + + done: false +>done : Symbol(done, Decl(iterableArrayPattern13.ts, 7, 27)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(FooIterator, Decl(iterableArrayPattern13.ts, 3, 27)) + } +} diff --git a/tests/baselines/reference/iterableArrayPattern13.types b/tests/baselines/reference/iterableArrayPattern13.types index dbfbf9a1ebc..556a871f5a8 100644 --- a/tests/baselines/reference/iterableArrayPattern13.types +++ b/tests/baselines/reference/iterableArrayPattern13.types @@ -35,6 +35,7 @@ class FooIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iterableArrayPattern14.errors.txt b/tests/baselines/reference/iterableArrayPattern14.errors.txt new file mode 100644 index 00000000000..a14ddc45022 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern14.errors.txt @@ -0,0 +1,22 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern14.ts(1,17): error TS2501: A rest element cannot contain a binding pattern. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern14.ts (1 errors) ==== + function fun(...[a, ...b]) { } + ~~~~~~~~~ +!!! error TS2501: A rest element cannot contain a binding pattern. + fun(new FooIterator); + class Bar { x } + class Foo extends Bar { y } + class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern14.types b/tests/baselines/reference/iterableArrayPattern14.types deleted file mode 100644 index 3f73f2973d1..00000000000 --- a/tests/baselines/reference/iterableArrayPattern14.types +++ /dev/null @@ -1,50 +0,0 @@ -=== tests/cases/conformance/es6/destructuring/iterableArrayPattern14.ts === -function fun(...[a, ...b]) { } ->fun : (...[a, ...b]: any[]) => void ->a : any ->b : any[] - -fun(new FooIterator); ->fun(new FooIterator) : void ->fun : (...[a, ...b]: any[]) => void ->new FooIterator : FooIterator ->FooIterator : typeof FooIterator - -class Bar { x } ->Bar : Bar ->x : any - -class Foo extends Bar { y } ->Foo : Foo ->Bar : Bar ->y : any - -class FooIterator { ->FooIterator : FooIterator - - next() { ->next : () => { value: Foo; done: boolean; } - - return { ->{ value: new Foo, done: false } : { value: Foo; done: boolean; } - - value: new Foo, ->value : Foo ->new Foo : Foo ->Foo : typeof Foo - - done: false ->done : boolean - - }; - } - - [Symbol.iterator]() { ->Symbol.iterator : symbol ->Symbol : SymbolConstructor ->iterator : symbol - - return this; ->this : FooIterator - } -} diff --git a/tests/baselines/reference/iterableArrayPattern15.errors.txt b/tests/baselines/reference/iterableArrayPattern15.errors.txt new file mode 100644 index 00000000000..bb2d1eb096d --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern15.errors.txt @@ -0,0 +1,22 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern15.ts(1,17): error TS2501: A rest element cannot contain a binding pattern. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern15.ts (1 errors) ==== + function fun(...[a, b]: Bar[]) { } + ~~~~~~ +!!! error TS2501: A rest element cannot contain a binding pattern. + fun(...new FooIterator); + class Bar { x } + class Foo extends Bar { y } + class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern15.types b/tests/baselines/reference/iterableArrayPattern15.types deleted file mode 100644 index de548a91c26..00000000000 --- a/tests/baselines/reference/iterableArrayPattern15.types +++ /dev/null @@ -1,52 +0,0 @@ -=== tests/cases/conformance/es6/destructuring/iterableArrayPattern15.ts === -function fun(...[a, b]: Bar[]) { } ->fun : (...[a, b]: Bar[]) => void ->a : Bar ->b : Bar ->Bar : Bar - -fun(...new FooIterator); ->fun(...new FooIterator) : void ->fun : (...[a, b]: Bar[]) => void ->...new FooIterator : Foo ->new FooIterator : FooIterator ->FooIterator : typeof FooIterator - -class Bar { x } ->Bar : Bar ->x : any - -class Foo extends Bar { y } ->Foo : Foo ->Bar : Bar ->y : any - -class FooIterator { ->FooIterator : FooIterator - - next() { ->next : () => { value: Foo; done: boolean; } - - return { ->{ value: new Foo, done: false } : { value: Foo; done: boolean; } - - value: new Foo, ->value : Foo ->new Foo : Foo ->Foo : typeof Foo - - done: false ->done : boolean - - }; - } - - [Symbol.iterator]() { ->Symbol.iterator : symbol ->Symbol : SymbolConstructor ->iterator : symbol - - return this; ->this : FooIterator - } -} diff --git a/tests/baselines/reference/iterableArrayPattern16.errors.txt b/tests/baselines/reference/iterableArrayPattern16.errors.txt index 42236140be7..e03d0a799da 100644 --- a/tests/baselines/reference/iterableArrayPattern16.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern16.errors.txt @@ -1,9 +1,12 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts(1,17): error TS2501: A rest element cannot contain a binding pattern. tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts(2,5): error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[Bar, Bar]'. Property '0' is missing in type 'FooIterator'. -==== tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts (1 errors) ==== +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts (2 errors) ==== function fun(...[a, b]: [Bar, Bar][]) { } + ~~~~~~ +!!! error TS2501: A rest element cannot contain a binding pattern. fun(...new FooIteratorIterator); ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[Bar, Bar]'. diff --git a/tests/baselines/reference/iterableArrayPattern17.errors.txt b/tests/baselines/reference/iterableArrayPattern17.errors.txt index 306b00ea990..3cc04fadd11 100644 --- a/tests/baselines/reference/iterableArrayPattern17.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern17.errors.txt @@ -1,9 +1,12 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts(1,17): error TS2501: A rest element cannot contain a binding pattern. tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts(2,5): error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type 'Bar'. Property 'x' is missing in type 'FooIterator'. -==== tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts (1 errors) ==== +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts (2 errors) ==== function fun(...[a, b]: Bar[]) { } + ~~~~~~ +!!! error TS2501: A rest element cannot contain a binding pattern. fun(new FooIterator); ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type 'Bar'. diff --git a/tests/baselines/reference/iterableArrayPattern2.symbols b/tests/baselines/reference/iterableArrayPattern2.symbols new file mode 100644 index 00000000000..0f4e7682235 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern2.symbols @@ -0,0 +1,32 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern2.ts === +var [a, ...b] = new SymbolIterator; +>a : Symbol(a, Decl(iterableArrayPattern2.ts, 0, 5)) +>b : Symbol(b, Decl(iterableArrayPattern2.ts, 0, 7)) +>SymbolIterator : Symbol(SymbolIterator, Decl(iterableArrayPattern2.ts, 0, 35)) + +class SymbolIterator { +>SymbolIterator : Symbol(SymbolIterator, Decl(iterableArrayPattern2.ts, 0, 35)) + + next() { +>next : Symbol(next, Decl(iterableArrayPattern2.ts, 1, 22)) + + return { + value: Symbol(), +>value : Symbol(value, Decl(iterableArrayPattern2.ts, 3, 16)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) + + done: false +>done : Symbol(done, Decl(iterableArrayPattern2.ts, 4, 28)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(SymbolIterator, Decl(iterableArrayPattern2.ts, 0, 35)) + } +} diff --git a/tests/baselines/reference/iterableArrayPattern2.types b/tests/baselines/reference/iterableArrayPattern2.types index 819516dfe05..bd58cb86b79 100644 --- a/tests/baselines/reference/iterableArrayPattern2.types +++ b/tests/baselines/reference/iterableArrayPattern2.types @@ -21,6 +21,7 @@ class SymbolIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iterableArrayPattern20.errors.txt b/tests/baselines/reference/iterableArrayPattern20.errors.txt new file mode 100644 index 00000000000..4451a814bd5 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern20.errors.txt @@ -0,0 +1,22 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern20.ts(1,17): error TS2501: A rest element cannot contain a binding pattern. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern20.ts (1 errors) ==== + function fun(...[[a = new Foo], b = [new Foo]]: Bar[][]) { } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2501: A rest element cannot contain a binding pattern. + fun(...new FooArrayIterator); + class Bar { x } + class Foo extends Bar { y } + class FooArrayIterator { + next() { + return { + value: [new Foo], + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern20.types b/tests/baselines/reference/iterableArrayPattern20.types deleted file mode 100644 index 055dfa95859..00000000000 --- a/tests/baselines/reference/iterableArrayPattern20.types +++ /dev/null @@ -1,58 +0,0 @@ -=== tests/cases/conformance/es6/destructuring/iterableArrayPattern20.ts === -function fun(...[[a = new Foo], b = [new Foo]]: Bar[][]) { } ->fun : (...[[a = new Foo], b = [new Foo]]: Bar[][]) => void ->a : Bar ->new Foo : Foo ->Foo : typeof Foo ->b : Bar[] ->[new Foo] : Foo[] ->new Foo : Foo ->Foo : typeof Foo ->Bar : Bar - -fun(...new FooArrayIterator); ->fun(...new FooArrayIterator) : void ->fun : (...[[a = new Foo], b = [new Foo]]: Bar[][]) => void ->...new FooArrayIterator : Foo[] ->new FooArrayIterator : FooArrayIterator ->FooArrayIterator : typeof FooArrayIterator - -class Bar { x } ->Bar : Bar ->x : any - -class Foo extends Bar { y } ->Foo : Foo ->Bar : Bar ->y : any - -class FooArrayIterator { ->FooArrayIterator : FooArrayIterator - - next() { ->next : () => { value: Foo[]; done: boolean; } - - return { ->{ value: [new Foo], done: false } : { value: Foo[]; done: boolean; } - - value: [new Foo], ->value : Foo[] ->[new Foo] : Foo[] ->new Foo : Foo ->Foo : typeof Foo - - done: false ->done : boolean - - }; - } - - [Symbol.iterator]() { ->Symbol.iterator : symbol ->Symbol : SymbolConstructor ->iterator : symbol - - return this; ->this : FooArrayIterator - } -} diff --git a/tests/baselines/reference/iterableArrayPattern25.errors.txt b/tests/baselines/reference/iterableArrayPattern25.errors.txt index cc901523b55..07f46c0d49e 100644 --- a/tests/baselines/reference/iterableArrayPattern25.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern25.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/es6/destructuring/iterableArrayPattern25.ts(1,30): error TS2370: A rest parameter must be of an array type. +tests/cases/conformance/es6/destructuring/iterableArrayPattern25.ts(1,33): error TS2501: A rest element cannot contain a binding pattern. ==== tests/cases/conformance/es6/destructuring/iterableArrayPattern25.ts (1 errors) ==== function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { } - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2370: A rest parameter must be of an array type. + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2501: A rest element cannot contain a binding pattern. takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern26.errors.txt b/tests/baselines/reference/iterableArrayPattern26.errors.txt index 9fb3e688039..a5eff0afb0d 100644 --- a/tests/baselines/reference/iterableArrayPattern26.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern26.errors.txt @@ -1,9 +1,12 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts(1,33): error TS2501: A rest element cannot contain a binding pattern. tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts(2,21): error TS2345: Argument of type 'Map' is not assignable to parameter of type '[string, number]'. Property '0' is missing in type 'Map'. -==== tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts (1 errors) ==== +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts (2 errors) ==== function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2501: A rest element cannot contain a binding pattern. takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type 'Map' is not assignable to parameter of type '[string, number]'. diff --git a/tests/baselines/reference/iterableArrayPattern27.errors.txt b/tests/baselines/reference/iterableArrayPattern27.errors.txt new file mode 100644 index 00000000000..99914ddc508 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern27.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern27.ts(1,33): error TS2501: A rest element cannot contain a binding pattern. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern27.ts (1 errors) ==== + function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2501: A rest element cannot contain a binding pattern. + takeFirstTwoEntries(...new Map([["", 0], ["hello", 1]])); \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern27.types b/tests/baselines/reference/iterableArrayPattern27.types deleted file mode 100644 index 72d13ee0e00..00000000000 --- a/tests/baselines/reference/iterableArrayPattern27.types +++ /dev/null @@ -1,18 +0,0 @@ -=== tests/cases/conformance/es6/destructuring/iterableArrayPattern27.ts === -function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } ->takeFirstTwoEntries : (...[[k1, v1], [k2, v2]]: [string, number][]) => void ->k1 : string ->v1 : number ->k2 : string ->v2 : number - -takeFirstTwoEntries(...new Map([["", 0], ["hello", 1]])); ->takeFirstTwoEntries(...new Map([["", 0], ["hello", 1]])) : void ->takeFirstTwoEntries : (...[[k1, v1], [k2, v2]]: [string, number][]) => void ->...new Map([["", 0], ["hello", 1]]) : [string, number] ->new Map([["", 0], ["hello", 1]]) : Map ->Map : MapConstructor ->[["", 0], ["hello", 1]] : [string, number][] ->["", 0] : [string, number] ->["hello", 1] : [string, number] - diff --git a/tests/baselines/reference/iterableArrayPattern28.errors.txt b/tests/baselines/reference/iterableArrayPattern28.errors.txt index 0190dd939e8..986dfe1d9a2 100644 --- a/tests/baselines/reference/iterableArrayPattern28.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern28.errors.txt @@ -1,9 +1,12 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(1,33): error TS2501: A rest element cannot contain a binding pattern. tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,28): error TS2453: The type argument for type parameter 'V' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'boolean'. -==== tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts (1 errors) ==== +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts (2 errors) ==== function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2501: A rest element cannot contain a binding pattern. takeFirstTwoEntries(...new Map([["", 0], ["hello", true]])); ~~~ !!! error TS2453: The type argument for type parameter 'V' cannot be inferred from the usage. Consider specifying the type arguments explicitly. diff --git a/tests/baselines/reference/iterableArrayPattern29.errors.txt b/tests/baselines/reference/iterableArrayPattern29.errors.txt index 632854ae952..b34d0317d57 100644 --- a/tests/baselines/reference/iterableArrayPattern29.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern29.errors.txt @@ -1,10 +1,13 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern29.ts(1,33): error TS2501: A rest element cannot contain a binding pattern. tests/cases/conformance/es6/destructuring/iterableArrayPattern29.ts(2,21): error TS2345: Argument of type '[string, boolean]' is not assignable to parameter of type '[string, number]'. Types of property '1' are incompatible. Type 'boolean' is not assignable to type 'number'. -==== tests/cases/conformance/es6/destructuring/iterableArrayPattern29.ts (1 errors) ==== +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern29.ts (2 errors) ==== function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2501: A rest element cannot contain a binding pattern. takeFirstTwoEntries(...new Map([["", true], ["hello", true]])); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '[string, boolean]' is not assignable to parameter of type '[string, number]'. diff --git a/tests/baselines/reference/iterableArrayPattern3.symbols b/tests/baselines/reference/iterableArrayPattern3.symbols new file mode 100644 index 00000000000..32907a90b20 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern3.symbols @@ -0,0 +1,47 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern3.ts === +var a: Bar, b: Bar; +>a : Symbol(a, Decl(iterableArrayPattern3.ts, 0, 3)) +>Bar : Symbol(Bar, Decl(iterableArrayPattern3.ts, 1, 25)) +>b : Symbol(b, Decl(iterableArrayPattern3.ts, 0, 11)) +>Bar : Symbol(Bar, Decl(iterableArrayPattern3.ts, 1, 25)) + +[a, b] = new FooIterator; +>a : Symbol(a, Decl(iterableArrayPattern3.ts, 0, 3)) +>b : Symbol(b, Decl(iterableArrayPattern3.ts, 0, 11)) +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern3.ts, 3, 27)) + +class Bar { x } +>Bar : Symbol(Bar, Decl(iterableArrayPattern3.ts, 1, 25)) +>x : Symbol(x, Decl(iterableArrayPattern3.ts, 2, 11)) + +class Foo extends Bar { y } +>Foo : Symbol(Foo, Decl(iterableArrayPattern3.ts, 2, 15)) +>Bar : Symbol(Bar, Decl(iterableArrayPattern3.ts, 1, 25)) +>y : Symbol(y, Decl(iterableArrayPattern3.ts, 3, 23)) + +class FooIterator { +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern3.ts, 3, 27)) + + next() { +>next : Symbol(next, Decl(iterableArrayPattern3.ts, 4, 19)) + + return { + value: new Foo, +>value : Symbol(value, Decl(iterableArrayPattern3.ts, 6, 16)) +>Foo : Symbol(Foo, Decl(iterableArrayPattern3.ts, 2, 15)) + + done: false +>done : Symbol(done, Decl(iterableArrayPattern3.ts, 7, 27)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(FooIterator, Decl(iterableArrayPattern3.ts, 3, 27)) + } +} diff --git a/tests/baselines/reference/iterableArrayPattern3.types b/tests/baselines/reference/iterableArrayPattern3.types index 291eed9723a..fed5c7f07d3 100644 --- a/tests/baselines/reference/iterableArrayPattern3.types +++ b/tests/baselines/reference/iterableArrayPattern3.types @@ -38,6 +38,7 @@ class FooIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iterableArrayPattern30.symbols b/tests/baselines/reference/iterableArrayPattern30.symbols new file mode 100644 index 00000000000..d291c3b128b --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern30.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern30.ts === +const [[k1, v1], [k2, v2]] = new Map([["", true], ["hello", true]]) +>k1 : Symbol(k1, Decl(iterableArrayPattern30.ts, 0, 8)) +>v1 : Symbol(v1, Decl(iterableArrayPattern30.ts, 0, 11)) +>k2 : Symbol(k2, Decl(iterableArrayPattern30.ts, 0, 18)) +>v2 : Symbol(v2, Decl(iterableArrayPattern30.ts, 0, 21)) +>Map : Symbol(Map, Decl(lib.d.ts, 1837, 1), Decl(lib.d.ts, 1859, 11)) + diff --git a/tests/baselines/reference/iterableArrayPattern30.types b/tests/baselines/reference/iterableArrayPattern30.types index 998da11d651..d27db2e7544 100644 --- a/tests/baselines/reference/iterableArrayPattern30.types +++ b/tests/baselines/reference/iterableArrayPattern30.types @@ -8,5 +8,9 @@ const [[k1, v1], [k2, v2]] = new Map([["", true], ["hello", true]]) >Map : MapConstructor >[["", true], ["hello", true]] : [string, boolean][] >["", true] : [string, boolean] +>"" : string +>true : boolean >["hello", true] : [string, boolean] +>"hello" : string +>true : boolean diff --git a/tests/baselines/reference/iterableArrayPattern4.symbols b/tests/baselines/reference/iterableArrayPattern4.symbols new file mode 100644 index 00000000000..473262707b0 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern4.symbols @@ -0,0 +1,47 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern4.ts === +var a: Bar, b: Bar[]; +>a : Symbol(a, Decl(iterableArrayPattern4.ts, 0, 3)) +>Bar : Symbol(Bar, Decl(iterableArrayPattern4.ts, 1, 28)) +>b : Symbol(b, Decl(iterableArrayPattern4.ts, 0, 11)) +>Bar : Symbol(Bar, Decl(iterableArrayPattern4.ts, 1, 28)) + +[a, ...b] = new FooIterator; +>a : Symbol(a, Decl(iterableArrayPattern4.ts, 0, 3)) +>b : Symbol(b, Decl(iterableArrayPattern4.ts, 0, 11)) +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern4.ts, 3, 27)) + +class Bar { x } +>Bar : Symbol(Bar, Decl(iterableArrayPattern4.ts, 1, 28)) +>x : Symbol(x, Decl(iterableArrayPattern4.ts, 2, 11)) + +class Foo extends Bar { y } +>Foo : Symbol(Foo, Decl(iterableArrayPattern4.ts, 2, 15)) +>Bar : Symbol(Bar, Decl(iterableArrayPattern4.ts, 1, 28)) +>y : Symbol(y, Decl(iterableArrayPattern4.ts, 3, 23)) + +class FooIterator { +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern4.ts, 3, 27)) + + next() { +>next : Symbol(next, Decl(iterableArrayPattern4.ts, 4, 19)) + + return { + value: new Foo, +>value : Symbol(value, Decl(iterableArrayPattern4.ts, 6, 16)) +>Foo : Symbol(Foo, Decl(iterableArrayPattern4.ts, 2, 15)) + + done: false +>done : Symbol(done, Decl(iterableArrayPattern4.ts, 7, 27)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(FooIterator, Decl(iterableArrayPattern4.ts, 3, 27)) + } +} diff --git a/tests/baselines/reference/iterableArrayPattern4.types b/tests/baselines/reference/iterableArrayPattern4.types index 531b2aa8275..8f05a454b53 100644 --- a/tests/baselines/reference/iterableArrayPattern4.types +++ b/tests/baselines/reference/iterableArrayPattern4.types @@ -39,6 +39,7 @@ class FooIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iterableArrayPattern9.symbols b/tests/baselines/reference/iterableArrayPattern9.symbols new file mode 100644 index 00000000000..7e188f1c94e --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern9.symbols @@ -0,0 +1,42 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern9.ts === +function fun([a, b] = new FooIterator) { } +>fun : Symbol(fun, Decl(iterableArrayPattern9.ts, 0, 0)) +>a : Symbol(a, Decl(iterableArrayPattern9.ts, 0, 14)) +>b : Symbol(b, Decl(iterableArrayPattern9.ts, 0, 16)) +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern9.ts, 2, 27)) + +class Bar { x } +>Bar : Symbol(Bar, Decl(iterableArrayPattern9.ts, 0, 42)) +>x : Symbol(x, Decl(iterableArrayPattern9.ts, 1, 11)) + +class Foo extends Bar { y } +>Foo : Symbol(Foo, Decl(iterableArrayPattern9.ts, 1, 15)) +>Bar : Symbol(Bar, Decl(iterableArrayPattern9.ts, 0, 42)) +>y : Symbol(y, Decl(iterableArrayPattern9.ts, 2, 23)) + +class FooIterator { +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern9.ts, 2, 27)) + + next() { +>next : Symbol(next, Decl(iterableArrayPattern9.ts, 3, 19)) + + return { + value: new Foo, +>value : Symbol(value, Decl(iterableArrayPattern9.ts, 5, 16)) +>Foo : Symbol(Foo, Decl(iterableArrayPattern9.ts, 1, 15)) + + done: false +>done : Symbol(done, Decl(iterableArrayPattern9.ts, 6, 27)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(FooIterator, Decl(iterableArrayPattern9.ts, 2, 27)) + } +} diff --git a/tests/baselines/reference/iterableArrayPattern9.types b/tests/baselines/reference/iterableArrayPattern9.types index 67d4bab1a83..03cfa31b621 100644 --- a/tests/baselines/reference/iterableArrayPattern9.types +++ b/tests/baselines/reference/iterableArrayPattern9.types @@ -31,6 +31,7 @@ class FooIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iterableContextualTyping1.symbols b/tests/baselines/reference/iterableContextualTyping1.symbols new file mode 100644 index 00000000000..90b025ddbb0 --- /dev/null +++ b/tests/baselines/reference/iterableContextualTyping1.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/expressions/contextualTyping/iterableContextualTyping1.ts === +var iter: Iterable<(x: string) => number> = [s => s.length]; +>iter : Symbol(iter, Decl(iterableContextualTyping1.ts, 0, 3)) +>Iterable : Symbol(Iterable, Decl(lib.d.ts, 1633, 1)) +>x : Symbol(x, Decl(iterableContextualTyping1.ts, 0, 20)) +>s : Symbol(s, Decl(iterableContextualTyping1.ts, 0, 45)) +>s.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>s : Symbol(s, Decl(iterableContextualTyping1.ts, 0, 45)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + diff --git a/tests/baselines/reference/iteratorSpreadInArray.symbols b/tests/baselines/reference/iteratorSpreadInArray.symbols new file mode 100644 index 00000000000..c535fe5426f --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray.symbols @@ -0,0 +1,31 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInArray.ts === +var array = [...new SymbolIterator]; +>array : Symbol(array, Decl(iteratorSpreadInArray.ts, 0, 3)) +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInArray.ts, 0, 36)) + +class SymbolIterator { +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInArray.ts, 0, 36)) + + next() { +>next : Symbol(next, Decl(iteratorSpreadInArray.ts, 2, 22)) + + return { + value: Symbol(), +>value : Symbol(value, Decl(iteratorSpreadInArray.ts, 4, 16)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) + + done: false +>done : Symbol(done, Decl(iteratorSpreadInArray.ts, 5, 28)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(SymbolIterator, Decl(iteratorSpreadInArray.ts, 0, 36)) + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray.types b/tests/baselines/reference/iteratorSpreadInArray.types index 13b1a458eb9..2c4a1d207ef 100644 --- a/tests/baselines/reference/iteratorSpreadInArray.types +++ b/tests/baselines/reference/iteratorSpreadInArray.types @@ -22,6 +22,7 @@ class SymbolIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iteratorSpreadInArray11.symbols b/tests/baselines/reference/iteratorSpreadInArray11.symbols new file mode 100644 index 00000000000..7df50594c22 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray11.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInArray11.ts === +var iter: Iterable; +>iter : Symbol(iter, Decl(iteratorSpreadInArray11.ts, 0, 3)) +>Iterable : Symbol(Iterable, Decl(lib.d.ts, 1633, 1)) + +var array = [...iter]; +>array : Symbol(array, Decl(iteratorSpreadInArray11.ts, 1, 3)) +>iter : Symbol(iter, Decl(iteratorSpreadInArray11.ts, 0, 3)) + diff --git a/tests/baselines/reference/iteratorSpreadInArray2.symbols b/tests/baselines/reference/iteratorSpreadInArray2.symbols new file mode 100644 index 00000000000..48f2f853db8 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray2.symbols @@ -0,0 +1,58 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInArray2.ts === +var array = [...new NumberIterator, ...new SymbolIterator]; +>array : Symbol(array, Decl(iteratorSpreadInArray2.ts, 0, 3)) +>NumberIterator : Symbol(NumberIterator, Decl(iteratorSpreadInArray2.ts, 13, 1)) +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInArray2.ts, 0, 59)) + +class SymbolIterator { +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInArray2.ts, 0, 59)) + + next() { +>next : Symbol(next, Decl(iteratorSpreadInArray2.ts, 2, 22)) + + return { + value: Symbol(), +>value : Symbol(value, Decl(iteratorSpreadInArray2.ts, 4, 16)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) + + done: false +>done : Symbol(done, Decl(iteratorSpreadInArray2.ts, 5, 28)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(SymbolIterator, Decl(iteratorSpreadInArray2.ts, 0, 59)) + } +} + +class NumberIterator { +>NumberIterator : Symbol(NumberIterator, Decl(iteratorSpreadInArray2.ts, 13, 1)) + + next() { +>next : Symbol(next, Decl(iteratorSpreadInArray2.ts, 15, 22)) + + return { + value: 0, +>value : Symbol(value, Decl(iteratorSpreadInArray2.ts, 17, 16)) + + done: false +>done : Symbol(done, Decl(iteratorSpreadInArray2.ts, 18, 21)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(NumberIterator, Decl(iteratorSpreadInArray2.ts, 13, 1)) + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray2.types b/tests/baselines/reference/iteratorSpreadInArray2.types index 3cb27445f57..a59c2cf6c67 100644 --- a/tests/baselines/reference/iteratorSpreadInArray2.types +++ b/tests/baselines/reference/iteratorSpreadInArray2.types @@ -25,6 +25,7 @@ class SymbolIterator { done: false >done : boolean +>false : boolean }; } @@ -50,9 +51,11 @@ class NumberIterator { value: 0, >value : number +>0 : number done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iteratorSpreadInArray3.symbols b/tests/baselines/reference/iteratorSpreadInArray3.symbols new file mode 100644 index 00000000000..b55f8e415ff --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray3.symbols @@ -0,0 +1,31 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInArray3.ts === +var array = [...[0, 1], ...new SymbolIterator]; +>array : Symbol(array, Decl(iteratorSpreadInArray3.ts, 0, 3)) +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInArray3.ts, 0, 47)) + +class SymbolIterator { +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInArray3.ts, 0, 47)) + + next() { +>next : Symbol(next, Decl(iteratorSpreadInArray3.ts, 2, 22)) + + return { + value: Symbol(), +>value : Symbol(value, Decl(iteratorSpreadInArray3.ts, 4, 16)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) + + done: false +>done : Symbol(done, Decl(iteratorSpreadInArray3.ts, 5, 28)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(SymbolIterator, Decl(iteratorSpreadInArray3.ts, 0, 47)) + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray3.types b/tests/baselines/reference/iteratorSpreadInArray3.types index e5c25daabc7..0374f28b6b9 100644 --- a/tests/baselines/reference/iteratorSpreadInArray3.types +++ b/tests/baselines/reference/iteratorSpreadInArray3.types @@ -4,6 +4,8 @@ var array = [...[0, 1], ...new SymbolIterator]; >[...[0, 1], ...new SymbolIterator] : (number | symbol)[] >...[0, 1] : number >[0, 1] : number[] +>0 : number +>1 : number >...new SymbolIterator : symbol >new SymbolIterator : SymbolIterator >SymbolIterator : typeof SymbolIterator @@ -24,6 +26,7 @@ class SymbolIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iteratorSpreadInArray4.symbols b/tests/baselines/reference/iteratorSpreadInArray4.symbols new file mode 100644 index 00000000000..a1cba88d942 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray4.symbols @@ -0,0 +1,31 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInArray4.ts === +var array = [0, 1, ...new SymbolIterator]; +>array : Symbol(array, Decl(iteratorSpreadInArray4.ts, 0, 3)) +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInArray4.ts, 0, 42)) + +class SymbolIterator { +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInArray4.ts, 0, 42)) + + next() { +>next : Symbol(next, Decl(iteratorSpreadInArray4.ts, 2, 22)) + + return { + value: Symbol(), +>value : Symbol(value, Decl(iteratorSpreadInArray4.ts, 4, 16)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) + + done: false +>done : Symbol(done, Decl(iteratorSpreadInArray4.ts, 5, 28)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(SymbolIterator, Decl(iteratorSpreadInArray4.ts, 0, 42)) + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray4.types b/tests/baselines/reference/iteratorSpreadInArray4.types index 790fc9db1ba..d9a304421ba 100644 --- a/tests/baselines/reference/iteratorSpreadInArray4.types +++ b/tests/baselines/reference/iteratorSpreadInArray4.types @@ -2,6 +2,8 @@ var array = [0, 1, ...new SymbolIterator]; >array : (number | symbol)[] >[0, 1, ...new SymbolIterator] : (number | symbol)[] +>0 : number +>1 : number >...new SymbolIterator : symbol >new SymbolIterator : SymbolIterator >SymbolIterator : typeof SymbolIterator @@ -22,6 +24,7 @@ class SymbolIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iteratorSpreadInArray7.symbols b/tests/baselines/reference/iteratorSpreadInArray7.symbols new file mode 100644 index 00000000000..c9b8bba1090 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray7.symbols @@ -0,0 +1,36 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInArray7.ts === +var array: symbol[]; +>array : Symbol(array, Decl(iteratorSpreadInArray7.ts, 0, 3)) + +array.concat([...new SymbolIterator]); +>array.concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) +>array : Symbol(array, Decl(iteratorSpreadInArray7.ts, 0, 3)) +>concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInArray7.ts, 1, 38)) + +class SymbolIterator { +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInArray7.ts, 1, 38)) + + next() { +>next : Symbol(next, Decl(iteratorSpreadInArray7.ts, 3, 22)) + + return { + value: Symbol(), +>value : Symbol(value, Decl(iteratorSpreadInArray7.ts, 5, 16)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) + + done: false +>done : Symbol(done, Decl(iteratorSpreadInArray7.ts, 6, 28)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(SymbolIterator, Decl(iteratorSpreadInArray7.ts, 1, 38)) + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray7.types b/tests/baselines/reference/iteratorSpreadInArray7.types index c58d01f098b..f207a56f3d5 100644 --- a/tests/baselines/reference/iteratorSpreadInArray7.types +++ b/tests/baselines/reference/iteratorSpreadInArray7.types @@ -28,6 +28,7 @@ class SymbolIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iteratorSpreadInCall11.symbols b/tests/baselines/reference/iteratorSpreadInCall11.symbols new file mode 100644 index 00000000000..fbc31e96020 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall11.symbols @@ -0,0 +1,38 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInCall11.ts === +foo(...new SymbolIterator); +>foo : Symbol(foo, Decl(iteratorSpreadInCall11.ts, 0, 27)) +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInCall11.ts, 2, 42)) + +function foo(...s: T[]) { return s[0] } +>foo : Symbol(foo, Decl(iteratorSpreadInCall11.ts, 0, 27)) +>T : Symbol(T, Decl(iteratorSpreadInCall11.ts, 2, 13)) +>s : Symbol(s, Decl(iteratorSpreadInCall11.ts, 2, 16)) +>T : Symbol(T, Decl(iteratorSpreadInCall11.ts, 2, 13)) +>s : Symbol(s, Decl(iteratorSpreadInCall11.ts, 2, 16)) + +class SymbolIterator { +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInCall11.ts, 2, 42)) + + next() { +>next : Symbol(next, Decl(iteratorSpreadInCall11.ts, 4, 22)) + + return { + value: Symbol(), +>value : Symbol(value, Decl(iteratorSpreadInCall11.ts, 6, 16)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) + + done: false +>done : Symbol(done, Decl(iteratorSpreadInCall11.ts, 7, 28)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(SymbolIterator, Decl(iteratorSpreadInCall11.ts, 2, 42)) + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall11.types b/tests/baselines/reference/iteratorSpreadInCall11.types index a37fc6e2232..edce8b10355 100644 --- a/tests/baselines/reference/iteratorSpreadInCall11.types +++ b/tests/baselines/reference/iteratorSpreadInCall11.types @@ -13,6 +13,7 @@ function foo(...s: T[]) { return s[0] } >T : T >s[0] : T >s : T[] +>0 : number class SymbolIterator { >SymbolIterator : SymbolIterator @@ -30,6 +31,7 @@ class SymbolIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iteratorSpreadInCall12.symbols b/tests/baselines/reference/iteratorSpreadInCall12.symbols new file mode 100644 index 00000000000..66a8fc2f667 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall12.symbols @@ -0,0 +1,67 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInCall12.ts === +new Foo(...[...new SymbolIterator, ...[...new StringIterator]]); +>Foo : Symbol(Foo, Decl(iteratorSpreadInCall12.ts, 0, 64)) +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInCall12.ts, 4, 1)) +>StringIterator : Symbol(StringIterator, Decl(iteratorSpreadInCall12.ts, 17, 1)) + +class Foo { +>Foo : Symbol(Foo, Decl(iteratorSpreadInCall12.ts, 0, 64)) +>T : Symbol(T, Decl(iteratorSpreadInCall12.ts, 2, 10)) + + constructor(...s: T[]) { } +>s : Symbol(s, Decl(iteratorSpreadInCall12.ts, 3, 16)) +>T : Symbol(T, Decl(iteratorSpreadInCall12.ts, 2, 10)) +} + +class SymbolIterator { +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInCall12.ts, 4, 1)) + + next() { +>next : Symbol(next, Decl(iteratorSpreadInCall12.ts, 6, 22)) + + return { + value: Symbol(), +>value : Symbol(value, Decl(iteratorSpreadInCall12.ts, 8, 16)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) + + done: false +>done : Symbol(done, Decl(iteratorSpreadInCall12.ts, 9, 28)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(SymbolIterator, Decl(iteratorSpreadInCall12.ts, 4, 1)) + } +} + +class StringIterator { +>StringIterator : Symbol(StringIterator, Decl(iteratorSpreadInCall12.ts, 17, 1)) + + next() { +>next : Symbol(next, Decl(iteratorSpreadInCall12.ts, 19, 22)) + + return { + value: "", +>value : Symbol(value, Decl(iteratorSpreadInCall12.ts, 21, 16)) + + done: false +>done : Symbol(done, Decl(iteratorSpreadInCall12.ts, 22, 22)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(StringIterator, Decl(iteratorSpreadInCall12.ts, 17, 1)) + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall12.types b/tests/baselines/reference/iteratorSpreadInCall12.types index 78ce973a532..fcc4bbc3d45 100644 --- a/tests/baselines/reference/iteratorSpreadInCall12.types +++ b/tests/baselines/reference/iteratorSpreadInCall12.types @@ -38,6 +38,7 @@ class SymbolIterator { done: false >done : boolean +>false : boolean }; } @@ -63,9 +64,11 @@ class StringIterator { value: "", >value : string +>"" : string done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iteratorSpreadInCall3.symbols b/tests/baselines/reference/iteratorSpreadInCall3.symbols new file mode 100644 index 00000000000..121c10ec977 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall3.symbols @@ -0,0 +1,35 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInCall3.ts === +foo(...new SymbolIterator); +>foo : Symbol(foo, Decl(iteratorSpreadInCall3.ts, 0, 27)) +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInCall3.ts, 2, 32)) + +function foo(...s: symbol[]) { } +>foo : Symbol(foo, Decl(iteratorSpreadInCall3.ts, 0, 27)) +>s : Symbol(s, Decl(iteratorSpreadInCall3.ts, 2, 13)) + +class SymbolIterator { +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInCall3.ts, 2, 32)) + + next() { +>next : Symbol(next, Decl(iteratorSpreadInCall3.ts, 3, 22)) + + return { + value: Symbol(), +>value : Symbol(value, Decl(iteratorSpreadInCall3.ts, 5, 16)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) + + done: false +>done : Symbol(done, Decl(iteratorSpreadInCall3.ts, 6, 28)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(SymbolIterator, Decl(iteratorSpreadInCall3.ts, 2, 32)) + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall3.types b/tests/baselines/reference/iteratorSpreadInCall3.types index 07eb149ba31..b566c3866ff 100644 --- a/tests/baselines/reference/iteratorSpreadInCall3.types +++ b/tests/baselines/reference/iteratorSpreadInCall3.types @@ -26,6 +26,7 @@ class SymbolIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iteratorSpreadInCall5.symbols b/tests/baselines/reference/iteratorSpreadInCall5.symbols new file mode 100644 index 00000000000..5e88a2be8a1 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall5.symbols @@ -0,0 +1,62 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInCall5.ts === +foo(...new SymbolIterator, ...new StringIterator); +>foo : Symbol(foo, Decl(iteratorSpreadInCall5.ts, 0, 50)) +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInCall5.ts, 2, 43)) +>StringIterator : Symbol(StringIterator, Decl(iteratorSpreadInCall5.ts, 14, 1)) + +function foo(...s: (symbol | string)[]) { } +>foo : Symbol(foo, Decl(iteratorSpreadInCall5.ts, 0, 50)) +>s : Symbol(s, Decl(iteratorSpreadInCall5.ts, 2, 13)) + +class SymbolIterator { +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInCall5.ts, 2, 43)) + + next() { +>next : Symbol(next, Decl(iteratorSpreadInCall5.ts, 3, 22)) + + return { + value: Symbol(), +>value : Symbol(value, Decl(iteratorSpreadInCall5.ts, 5, 16)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) + + done: false +>done : Symbol(done, Decl(iteratorSpreadInCall5.ts, 6, 28)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(SymbolIterator, Decl(iteratorSpreadInCall5.ts, 2, 43)) + } +} + +class StringIterator { +>StringIterator : Symbol(StringIterator, Decl(iteratorSpreadInCall5.ts, 14, 1)) + + next() { +>next : Symbol(next, Decl(iteratorSpreadInCall5.ts, 16, 22)) + + return { + value: "", +>value : Symbol(value, Decl(iteratorSpreadInCall5.ts, 18, 16)) + + done: false +>done : Symbol(done, Decl(iteratorSpreadInCall5.ts, 19, 22)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(StringIterator, Decl(iteratorSpreadInCall5.ts, 14, 1)) + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall5.types b/tests/baselines/reference/iteratorSpreadInCall5.types index 6e924a1ef42..2401a41cca8 100644 --- a/tests/baselines/reference/iteratorSpreadInCall5.types +++ b/tests/baselines/reference/iteratorSpreadInCall5.types @@ -29,6 +29,7 @@ class SymbolIterator { done: false >done : boolean +>false : boolean }; } @@ -54,9 +55,11 @@ class StringIterator { value: "", >value : string +>"" : string done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/keywordField.symbols b/tests/baselines/reference/keywordField.symbols new file mode 100644 index 00000000000..7ea3438d985 --- /dev/null +++ b/tests/baselines/reference/keywordField.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/keywordField.ts === +var obj:any = {}; +>obj : Symbol(obj, Decl(keywordField.ts, 0, 3)) + +obj.if = 1; +>obj : Symbol(obj, Decl(keywordField.ts, 0, 3)) + +var a = { if: "test" } +>a : Symbol(a, Decl(keywordField.ts, 4, 3)) +>if : Symbol(if, Decl(keywordField.ts, 4, 9)) + +var n = a.if +>n : Symbol(n, Decl(keywordField.ts, 6, 3)) +>a.if : Symbol(if, Decl(keywordField.ts, 4, 9)) +>a : Symbol(a, Decl(keywordField.ts, 4, 3)) +>if : Symbol(if, Decl(keywordField.ts, 4, 9)) + +var q = a["if"]; +>q : Symbol(q, Decl(keywordField.ts, 8, 3)) +>a : Symbol(a, Decl(keywordField.ts, 4, 3)) +>"if" : Symbol(if, Decl(keywordField.ts, 4, 9)) + diff --git a/tests/baselines/reference/keywordField.types b/tests/baselines/reference/keywordField.types index a5c465ae39c..8bc977edd74 100644 --- a/tests/baselines/reference/keywordField.types +++ b/tests/baselines/reference/keywordField.types @@ -8,11 +8,13 @@ obj.if = 1; >obj.if : any >obj : any >if : any +>1 : number var a = { if: "test" } >a : { if: string; } >{ if: "test" } : { if: string; } >if : string +>"test" : string var n = a.if >n : string @@ -24,4 +26,5 @@ var q = a["if"]; >q : string >a["if"] : string >a : { if: string; } +>"if" : string diff --git a/tests/baselines/reference/lambdaASIEmit.symbols b/tests/baselines/reference/lambdaASIEmit.symbols new file mode 100644 index 00000000000..d33cc16817a --- /dev/null +++ b/tests/baselines/reference/lambdaASIEmit.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/lambdaASIEmit.ts === + +function Foo(x: any) +>Foo : Symbol(Foo, Decl(lambdaASIEmit.ts, 0, 0)) +>x : Symbol(x, Decl(lambdaASIEmit.ts, 1, 13)) +{ +} + +Foo(() => +>Foo : Symbol(Foo, Decl(lambdaASIEmit.ts, 0, 0)) + + // do something + 127); + diff --git a/tests/baselines/reference/lambdaASIEmit.types b/tests/baselines/reference/lambdaASIEmit.types index b72a805cd12..8ea881c4cd5 100644 --- a/tests/baselines/reference/lambdaASIEmit.types +++ b/tests/baselines/reference/lambdaASIEmit.types @@ -13,4 +13,5 @@ Foo(() => // do something 127); +>127 : number diff --git a/tests/baselines/reference/lambdaExpression.symbols b/tests/baselines/reference/lambdaExpression.symbols new file mode 100644 index 00000000000..48bda5ce07f --- /dev/null +++ b/tests/baselines/reference/lambdaExpression.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/lambdaExpression.ts === +() => 0; // Needs to be wrapped in parens to be a valid expression (not declaration) +var y = 0; +>y : Symbol(y, Decl(lambdaExpression.ts, 1, 3)) + +(()=>0); +var x = 0; +>x : Symbol(x, Decl(lambdaExpression.ts, 3, 3)) + diff --git a/tests/baselines/reference/lambdaExpression.types b/tests/baselines/reference/lambdaExpression.types index d550781ebf7..714cd851d63 100644 --- a/tests/baselines/reference/lambdaExpression.types +++ b/tests/baselines/reference/lambdaExpression.types @@ -1,14 +1,18 @@ === tests/cases/compiler/lambdaExpression.ts === () => 0; // Needs to be wrapped in parens to be a valid expression (not declaration) >() => 0 : () => number +>0 : number var y = 0; >y : number +>0 : number (()=>0); >(()=>0) : () => number >()=>0 : () => number +>0 : number var x = 0; >x : number +>0 : number diff --git a/tests/baselines/reference/letAsIdentifier.symbols b/tests/baselines/reference/letAsIdentifier.symbols new file mode 100644 index 00000000000..be5066f5ac7 --- /dev/null +++ b/tests/baselines/reference/letAsIdentifier.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/letAsIdentifier.ts === + +var let = 10; +>let : Symbol(let, Decl(letAsIdentifier.ts, 1, 3)) + +var a = 10; +>a : Symbol(a, Decl(letAsIdentifier.ts, 2, 3)) + +let = 30; +>let : Symbol(let, Decl(letAsIdentifier.ts, 1, 3)) + +let +>let : Symbol(let, Decl(letAsIdentifier.ts, 1, 3)) + +a; +>a : Symbol(a, Decl(letAsIdentifier.ts, 2, 3)) + diff --git a/tests/baselines/reference/letAsIdentifier.types b/tests/baselines/reference/letAsIdentifier.types index 95fe2b11ac9..36c190a92e4 100644 --- a/tests/baselines/reference/letAsIdentifier.types +++ b/tests/baselines/reference/letAsIdentifier.types @@ -2,13 +2,16 @@ var let = 10; >let : number +>10 : number var a = 10; >a : number +>10 : number let = 30; >let = 30 : number >let : number +>30 : number let >let : number diff --git a/tests/baselines/reference/letAsIdentifierInStrictMode.errors.txt b/tests/baselines/reference/letAsIdentifierInStrictMode.errors.txt index 65411f23da9..b59daca008c 100644 --- a/tests/baselines/reference/letAsIdentifierInStrictMode.errors.txt +++ b/tests/baselines/reference/letAsIdentifierInStrictMode.errors.txt @@ -1,21 +1,12 @@ -tests/cases/compiler/letAsIdentifierInStrictMode.ts(2,5): error TS1134: Variable declaration expected. -tests/cases/compiler/letAsIdentifierInStrictMode.ts(2,9): error TS1134: Variable declaration expected. -tests/cases/compiler/letAsIdentifierInStrictMode.ts(2,11): error TS1134: Variable declaration expected. tests/cases/compiler/letAsIdentifierInStrictMode.ts(3,5): error TS2300: Duplicate identifier 'a'. tests/cases/compiler/letAsIdentifierInStrictMode.ts(4,5): error TS1134: Variable declaration expected. tests/cases/compiler/letAsIdentifierInStrictMode.ts(4,7): error TS1134: Variable declaration expected. tests/cases/compiler/letAsIdentifierInStrictMode.ts(6,1): error TS2300: Duplicate identifier 'a'. -==== tests/cases/compiler/letAsIdentifierInStrictMode.ts (7 errors) ==== +==== tests/cases/compiler/letAsIdentifierInStrictMode.ts (4 errors) ==== "use strict"; var let = 10; - ~~~ -!!! error TS1134: Variable declaration expected. - ~ -!!! error TS1134: Variable declaration expected. - ~~ -!!! error TS1134: Variable declaration expected. var a = 10; ~ !!! error TS2300: Duplicate identifier 'a'. diff --git a/tests/baselines/reference/letAsIdentifierInStrictMode.js b/tests/baselines/reference/letAsIdentifierInStrictMode.js index ccf099bcfc4..eb840e1a641 100644 --- a/tests/baselines/reference/letAsIdentifierInStrictMode.js +++ b/tests/baselines/reference/letAsIdentifierInStrictMode.js @@ -8,9 +8,7 @@ a; //// [letAsIdentifierInStrictMode.js] "use strict"; -var ; -var ; -10; +var let = 10; var a = 10; var ; 30; diff --git a/tests/baselines/reference/letConstMatchingParameterNames.symbols b/tests/baselines/reference/letConstMatchingParameterNames.symbols new file mode 100644 index 00000000000..b0a2f9c3810 --- /dev/null +++ b/tests/baselines/reference/letConstMatchingParameterNames.symbols @@ -0,0 +1,35 @@ +=== tests/cases/compiler/letConstMatchingParameterNames.ts === +let parent = true; +>parent : Symbol(parent, Decl(letConstMatchingParameterNames.ts, 0, 3)) + +const parent2 = true; +>parent2 : Symbol(parent2, Decl(letConstMatchingParameterNames.ts, 1, 5)) + +declare function use(a: any); +>use : Symbol(use, Decl(letConstMatchingParameterNames.ts, 1, 21)) +>a : Symbol(a, Decl(letConstMatchingParameterNames.ts, 2, 21)) + +function a() { +>a : Symbol(a, Decl(letConstMatchingParameterNames.ts, 2, 29)) + + let parent = 1; +>parent : Symbol(parent, Decl(letConstMatchingParameterNames.ts, 6, 7)) + + const parent2 = 2; +>parent2 : Symbol(parent2, Decl(letConstMatchingParameterNames.ts, 7, 9)) + + function b(parent: string, parent2: number) { +>b : Symbol(b, Decl(letConstMatchingParameterNames.ts, 7, 22)) +>parent : Symbol(parent, Decl(letConstMatchingParameterNames.ts, 9, 15)) +>parent2 : Symbol(parent2, Decl(letConstMatchingParameterNames.ts, 9, 30)) + + use(parent); +>use : Symbol(use, Decl(letConstMatchingParameterNames.ts, 1, 21)) +>parent : Symbol(parent, Decl(letConstMatchingParameterNames.ts, 9, 15)) + + use(parent2); +>use : Symbol(use, Decl(letConstMatchingParameterNames.ts, 1, 21)) +>parent2 : Symbol(parent2, Decl(letConstMatchingParameterNames.ts, 9, 30)) + } +} + diff --git a/tests/baselines/reference/letConstMatchingParameterNames.types b/tests/baselines/reference/letConstMatchingParameterNames.types index 66fccc637df..2e29dff289b 100644 --- a/tests/baselines/reference/letConstMatchingParameterNames.types +++ b/tests/baselines/reference/letConstMatchingParameterNames.types @@ -1,9 +1,11 @@ === tests/cases/compiler/letConstMatchingParameterNames.ts === let parent = true; >parent : boolean +>true : boolean const parent2 = true; >parent2 : boolean +>true : boolean declare function use(a: any); >use : (a: any) => any @@ -14,9 +16,11 @@ function a() { let parent = 1; >parent : number +>1 : number const parent2 = 2; >parent2 : number +>2 : number function b(parent: string, parent2: number) { >b : (parent: string, parent2: number) => void diff --git a/tests/baselines/reference/letDeclarations-access.symbols b/tests/baselines/reference/letDeclarations-access.symbols new file mode 100644 index 00000000000..dfc9ea4c533 --- /dev/null +++ b/tests/baselines/reference/letDeclarations-access.symbols @@ -0,0 +1,87 @@ +=== tests/cases/compiler/letDeclarations-access.ts === + +let x = 0 +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +// No errors + +x = 1; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x += 2; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x -= 3; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x *= 4; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x /= 5; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x %= 6; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x <<= 7; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x >>= 8; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x >>>= 9; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x &= 10; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x |= 11; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x ^= 12; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x++; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x--; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +++x; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +--x; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +var a = x + 1; +>a : Symbol(a, Decl(letDeclarations-access.ts, 23, 3)) +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +function f(v: number) { } +>f : Symbol(f, Decl(letDeclarations-access.ts, 23, 14)) +>v : Symbol(v, Decl(letDeclarations-access.ts, 25, 11)) + +f(x); +>f : Symbol(f, Decl(letDeclarations-access.ts, 23, 14)) +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +if (x) { } +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +(x); +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +-x; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + ++x; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x.toString(); +>x.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) + diff --git a/tests/baselines/reference/letDeclarations-access.types b/tests/baselines/reference/letDeclarations-access.types index f26d07ca5f8..673fc97f80b 100644 --- a/tests/baselines/reference/letDeclarations-access.types +++ b/tests/baselines/reference/letDeclarations-access.types @@ -2,56 +2,69 @@ let x = 0 >x : number +>0 : number // No errors x = 1; >x = 1 : number >x : number +>1 : number x += 2; >x += 2 : number >x : number +>2 : number x -= 3; >x -= 3 : number >x : number +>3 : number x *= 4; >x *= 4 : number >x : number +>4 : number x /= 5; >x /= 5 : number >x : number +>5 : number x %= 6; >x %= 6 : number >x : number +>6 : number x <<= 7; >x <<= 7 : number >x : number +>7 : number x >>= 8; >x >>= 8 : number >x : number +>8 : number x >>>= 9; >x >>>= 9 : number >x : number +>9 : number x &= 10; >x &= 10 : number >x : number +>10 : number x |= 11; >x |= 11 : number >x : number +>11 : number x ^= 12; >x ^= 12 : number >x : number +>12 : number x++; >x++ : number @@ -73,6 +86,7 @@ var a = x + 1; >a : number >x + 1 : number >x : number +>1 : number function f(v: number) { } >f : (v: number) => void diff --git a/tests/baselines/reference/letDeclarations-es5-1.symbols b/tests/baselines/reference/letDeclarations-es5-1.symbols new file mode 100644 index 00000000000..22ae7bd6c18 --- /dev/null +++ b/tests/baselines/reference/letDeclarations-es5-1.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/letDeclarations-es5-1.ts === + let l1; +>l1 : Symbol(l1, Decl(letDeclarations-es5-1.ts, 0, 7)) + + let l2: number; +>l2 : Symbol(l2, Decl(letDeclarations-es5-1.ts, 1, 7)) + + let l3, l4, l5 :string, l6; +>l3 : Symbol(l3, Decl(letDeclarations-es5-1.ts, 2, 7)) +>l4 : Symbol(l4, Decl(letDeclarations-es5-1.ts, 2, 11)) +>l5 : Symbol(l5, Decl(letDeclarations-es5-1.ts, 2, 15)) +>l6 : Symbol(l6, Decl(letDeclarations-es5-1.ts, 2, 27)) + + let l7 = false; +>l7 : Symbol(l7, Decl(letDeclarations-es5-1.ts, 3, 7)) + + let l8: number = 23; +>l8 : Symbol(l8, Decl(letDeclarations-es5-1.ts, 4, 7)) + + let l9 = 0, l10 :string = "", l11 = null; +>l9 : Symbol(l9, Decl(letDeclarations-es5-1.ts, 5, 7)) +>l10 : Symbol(l10, Decl(letDeclarations-es5-1.ts, 5, 15)) +>l11 : Symbol(l11, Decl(letDeclarations-es5-1.ts, 5, 33)) + diff --git a/tests/baselines/reference/letDeclarations-es5-1.types b/tests/baselines/reference/letDeclarations-es5-1.types index fb45d521bd3..b088677cd0a 100644 --- a/tests/baselines/reference/letDeclarations-es5-1.types +++ b/tests/baselines/reference/letDeclarations-es5-1.types @@ -13,12 +13,17 @@ let l7 = false; >l7 : boolean +>false : boolean let l8: number = 23; >l8 : number +>23 : number let l9 = 0, l10 :string = "", l11 = null; >l9 : number +>0 : number >l10 : string +>"" : string >l11 : any +>null : null diff --git a/tests/baselines/reference/letDeclarations-es5.symbols b/tests/baselines/reference/letDeclarations-es5.symbols new file mode 100644 index 00000000000..ac2daaaac89 --- /dev/null +++ b/tests/baselines/reference/letDeclarations-es5.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/letDeclarations-es5.ts === + +let l1; +>l1 : Symbol(l1, Decl(letDeclarations-es5.ts, 1, 3)) + +let l2: number; +>l2 : Symbol(l2, Decl(letDeclarations-es5.ts, 2, 3)) + +let l3, l4, l5 :string, l6; +>l3 : Symbol(l3, Decl(letDeclarations-es5.ts, 3, 3)) +>l4 : Symbol(l4, Decl(letDeclarations-es5.ts, 3, 7)) +>l5 : Symbol(l5, Decl(letDeclarations-es5.ts, 3, 11)) +>l6 : Symbol(l6, Decl(letDeclarations-es5.ts, 3, 23)) + +let l7 = false; +>l7 : Symbol(l7, Decl(letDeclarations-es5.ts, 5, 3)) + +let l8: number = 23; +>l8 : Symbol(l8, Decl(letDeclarations-es5.ts, 6, 3)) + +let l9 = 0, l10 :string = "", l11 = null; +>l9 : Symbol(l9, Decl(letDeclarations-es5.ts, 7, 3)) +>l10 : Symbol(l10, Decl(letDeclarations-es5.ts, 7, 11)) +>l11 : Symbol(l11, Decl(letDeclarations-es5.ts, 7, 29)) + +for(let l11 in {}) { } +>l11 : Symbol(l11, Decl(letDeclarations-es5.ts, 9, 7)) + +for(let l12 = 0; l12 < 9; l12++) { } +>l12 : Symbol(l12, Decl(letDeclarations-es5.ts, 11, 7)) +>l12 : Symbol(l12, Decl(letDeclarations-es5.ts, 11, 7)) +>l12 : Symbol(l12, Decl(letDeclarations-es5.ts, 11, 7)) + diff --git a/tests/baselines/reference/letDeclarations-es5.types b/tests/baselines/reference/letDeclarations-es5.types index 0d6e9928868..005e0b26155 100644 --- a/tests/baselines/reference/letDeclarations-es5.types +++ b/tests/baselines/reference/letDeclarations-es5.types @@ -14,14 +14,19 @@ let l3, l4, l5 :string, l6; let l7 = false; >l7 : boolean +>false : boolean let l8: number = 23; >l8 : number +>23 : number let l9 = 0, l10 :string = "", l11 = null; >l9 : number +>0 : number >l10 : string +>"" : string >l11 : any +>null : null for(let l11 in {}) { } >l11 : any @@ -29,8 +34,10 @@ for(let l11 in {}) { } for(let l12 = 0; l12 < 9; l12++) { } >l12 : number +>0 : number >l12 < 9 : boolean >l12 : number +>9 : number >l12++ : number >l12 : number diff --git a/tests/baselines/reference/letDeclarations.symbols b/tests/baselines/reference/letDeclarations.symbols new file mode 100644 index 00000000000..dbbaac211ac --- /dev/null +++ b/tests/baselines/reference/letDeclarations.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/letDeclarations.ts === + +let l1; +>l1 : Symbol(l1, Decl(letDeclarations.ts, 1, 3)) + +let l2: number; +>l2 : Symbol(l2, Decl(letDeclarations.ts, 2, 3)) + +let l3, l4, l5 :string, l6; +>l3 : Symbol(l3, Decl(letDeclarations.ts, 3, 3)) +>l4 : Symbol(l4, Decl(letDeclarations.ts, 3, 7)) +>l5 : Symbol(l5, Decl(letDeclarations.ts, 3, 11)) +>l6 : Symbol(l6, Decl(letDeclarations.ts, 3, 23)) + +let l7 = false; +>l7 : Symbol(l7, Decl(letDeclarations.ts, 5, 3)) + +let l8: number = 23; +>l8 : Symbol(l8, Decl(letDeclarations.ts, 6, 3)) + +let l9 = 0, l10 :string = "", l11 = null; +>l9 : Symbol(l9, Decl(letDeclarations.ts, 7, 3)) +>l10 : Symbol(l10, Decl(letDeclarations.ts, 7, 11)) +>l11 : Symbol(l11, Decl(letDeclarations.ts, 7, 29)) + +for(let l11 in {}) { } +>l11 : Symbol(l11, Decl(letDeclarations.ts, 9, 7)) + +for(let l12 = 0; l12 < 9; l12++) { } +>l12 : Symbol(l12, Decl(letDeclarations.ts, 11, 7)) +>l12 : Symbol(l12, Decl(letDeclarations.ts, 11, 7)) +>l12 : Symbol(l12, Decl(letDeclarations.ts, 11, 7)) + diff --git a/tests/baselines/reference/letDeclarations.types b/tests/baselines/reference/letDeclarations.types index aa47a7f0006..55be4326b19 100644 --- a/tests/baselines/reference/letDeclarations.types +++ b/tests/baselines/reference/letDeclarations.types @@ -14,14 +14,19 @@ let l3, l4, l5 :string, l6; let l7 = false; >l7 : boolean +>false : boolean let l8: number = 23; >l8 : number +>23 : number let l9 = 0, l10 :string = "", l11 = null; >l9 : number +>0 : number >l10 : string +>"" : string >l11 : any +>null : null for(let l11 in {}) { } >l11 : any @@ -29,8 +34,10 @@ for(let l11 in {}) { } for(let l12 = 0; l12 < 9; l12++) { } >l12 : number +>0 : number >l12 < 9 : boolean >l12 : number +>9 : number >l12++ : number >l12 : number diff --git a/tests/baselines/reference/letDeclarations2.symbols b/tests/baselines/reference/letDeclarations2.symbols new file mode 100644 index 00000000000..1f4bcb12420 --- /dev/null +++ b/tests/baselines/reference/letDeclarations2.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/letDeclarations2.ts === + +module M { +>M : Symbol(M, Decl(letDeclarations2.ts, 0, 0)) + + let l1 = "s"; +>l1 : Symbol(l1, Decl(letDeclarations2.ts, 2, 7)) + + export let l2 = 0; +>l2 : Symbol(l2, Decl(letDeclarations2.ts, 3, 14)) +} diff --git a/tests/baselines/reference/letDeclarations2.types b/tests/baselines/reference/letDeclarations2.types index 2fa08b6d940..eeb66838a6a 100644 --- a/tests/baselines/reference/letDeclarations2.types +++ b/tests/baselines/reference/letDeclarations2.types @@ -5,7 +5,9 @@ module M { let l1 = "s"; >l1 : string +>"s" : string export let l2 = 0; >l2 : number +>0 : number } diff --git a/tests/baselines/reference/letInNonStrictMode.js b/tests/baselines/reference/letInNonStrictMode.js index 8a431535ae2..8e4920cc220 100644 --- a/tests/baselines/reference/letInNonStrictMode.js +++ b/tests/baselines/reference/letInNonStrictMode.js @@ -3,5 +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/letInNonStrictMode.symbols b/tests/baselines/reference/letInNonStrictMode.symbols new file mode 100644 index 00000000000..2b854a8c03f --- /dev/null +++ b/tests/baselines/reference/letInNonStrictMode.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/letInNonStrictMode.ts === +let [x] = [1]; +>x : Symbol(x, Decl(letInNonStrictMode.ts, 0, 5)) + +let {a: y} = {a: 1}; +>y : Symbol(y, Decl(letInNonStrictMode.ts, 1, 5)) +>a : Symbol(a, Decl(letInNonStrictMode.ts, 1, 14)) + diff --git a/tests/baselines/reference/letInNonStrictMode.types b/tests/baselines/reference/letInNonStrictMode.types index 4f2cbe4a703..ceb59dba6a3 100644 --- a/tests/baselines/reference/letInNonStrictMode.types +++ b/tests/baselines/reference/letInNonStrictMode.types @@ -2,10 +2,12 @@ let [x] = [1]; >x : number >[1] : [number] +>1 : number let {a: y} = {a: 1}; ->a : unknown +>a : any >y : number >{a: 1} : { a: number; } >a : number +>1 : number diff --git a/tests/baselines/reference/letKeepNamesOfTopLevelItems.symbols b/tests/baselines/reference/letKeepNamesOfTopLevelItems.symbols new file mode 100644 index 00000000000..dc6e579a73f --- /dev/null +++ b/tests/baselines/reference/letKeepNamesOfTopLevelItems.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/letKeepNamesOfTopLevelItems.ts === +let x; +>x : Symbol(x, Decl(letKeepNamesOfTopLevelItems.ts, 0, 3)) + +function foo() { +>foo : Symbol(foo, Decl(letKeepNamesOfTopLevelItems.ts, 0, 6)) + + let x; +>x : Symbol(x, Decl(letKeepNamesOfTopLevelItems.ts, 2, 7)) +} + +module A { +>A : Symbol(A, Decl(letKeepNamesOfTopLevelItems.ts, 3, 1)) + + let x; +>x : Symbol(x, Decl(letKeepNamesOfTopLevelItems.ts, 6, 7)) +} diff --git a/tests/baselines/reference/libdtsFix.symbols b/tests/baselines/reference/libdtsFix.symbols new file mode 100644 index 00000000000..158b0587ec6 --- /dev/null +++ b/tests/baselines/reference/libdtsFix.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/libdtsFix.ts === +interface HTMLElement { +>HTMLElement : Symbol(HTMLElement, Decl(libdtsFix.ts, 0, 0)) + + type: string; +>type : Symbol(type, Decl(libdtsFix.ts, 0, 23)) +} + diff --git a/tests/baselines/reference/library_ArraySlice.symbols b/tests/baselines/reference/library_ArraySlice.symbols new file mode 100644 index 00000000000..25e6fbd5b5b --- /dev/null +++ b/tests/baselines/reference/library_ArraySlice.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/library_ArraySlice.ts === +// Array.prototype.slice can have zero, one, or two arguments +Array.prototype.slice(); +>Array.prototype.slice : Symbol(Array.slice, Decl(lib.d.ts, 1048, 15)) +>Array.prototype : Symbol(ArrayConstructor.prototype, Decl(lib.d.ts, 1167, 31)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>prototype : Symbol(ArrayConstructor.prototype, Decl(lib.d.ts, 1167, 31)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, 1048, 15)) + +Array.prototype.slice(0); +>Array.prototype.slice : Symbol(Array.slice, Decl(lib.d.ts, 1048, 15)) +>Array.prototype : Symbol(ArrayConstructor.prototype, Decl(lib.d.ts, 1167, 31)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>prototype : Symbol(ArrayConstructor.prototype, Decl(lib.d.ts, 1167, 31)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, 1048, 15)) + +Array.prototype.slice(0, 1); +>Array.prototype.slice : Symbol(Array.slice, Decl(lib.d.ts, 1048, 15)) +>Array.prototype : Symbol(ArrayConstructor.prototype, Decl(lib.d.ts, 1167, 31)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>prototype : Symbol(ArrayConstructor.prototype, Decl(lib.d.ts, 1167, 31)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, 1048, 15)) + diff --git a/tests/baselines/reference/library_ArraySlice.types b/tests/baselines/reference/library_ArraySlice.types index 378724c74e4..b92d9254390 100644 --- a/tests/baselines/reference/library_ArraySlice.types +++ b/tests/baselines/reference/library_ArraySlice.types @@ -15,6 +15,7 @@ Array.prototype.slice(0); >Array : ArrayConstructor >prototype : any[] >slice : (start?: number, end?: number) => any[] +>0 : number Array.prototype.slice(0, 1); >Array.prototype.slice(0, 1) : any[] @@ -23,4 +24,6 @@ Array.prototype.slice(0, 1); >Array : ArrayConstructor >prototype : any[] >slice : (start?: number, end?: number) => any[] +>0 : number +>1 : number diff --git a/tests/baselines/reference/library_DatePrototypeProperties.symbols b/tests/baselines/reference/library_DatePrototypeProperties.symbols new file mode 100644 index 00000000000..c6d0b7e87fb --- /dev/null +++ b/tests/baselines/reference/library_DatePrototypeProperties.symbols @@ -0,0 +1,311 @@ +=== tests/cases/compiler/library_DatePrototypeProperties.ts === +// Properties of the Date prototype object as per ES5 spec +// http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.5 +Date.prototype.constructor; +>Date.prototype.constructor : Symbol(Object.constructor, Decl(lib.d.ts, 94, 18)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>constructor : Symbol(Object.constructor, Decl(lib.d.ts, 94, 18)) + +Date.prototype.toString(); +>Date.prototype.toString : Symbol(Date.toString, Decl(lib.d.ts, 636, 16)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>toString : Symbol(Date.toString, Decl(lib.d.ts, 636, 16)) + +Date.prototype.toDateString(); +>Date.prototype.toDateString : Symbol(Date.toDateString, Decl(lib.d.ts, 638, 23)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>toDateString : Symbol(Date.toDateString, Decl(lib.d.ts, 638, 23)) + +Date.prototype.toTimeString(); +>Date.prototype.toTimeString : Symbol(Date.toTimeString, Decl(lib.d.ts, 640, 27)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>toTimeString : Symbol(Date.toTimeString, Decl(lib.d.ts, 640, 27)) + +Date.prototype.toLocaleString(); +>Date.prototype.toLocaleString : Symbol(Date.toLocaleString, Decl(lib.d.ts, 642, 27)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>toLocaleString : Symbol(Date.toLocaleString, Decl(lib.d.ts, 642, 27)) + +Date.prototype.toLocaleDateString(); +>Date.prototype.toLocaleDateString : Symbol(Date.toLocaleDateString, Decl(lib.d.ts, 644, 29)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>toLocaleDateString : Symbol(Date.toLocaleDateString, Decl(lib.d.ts, 644, 29)) + +Date.prototype.toLocaleTimeString(); +>Date.prototype.toLocaleTimeString : Symbol(Date.toLocaleTimeString, Decl(lib.d.ts, 646, 33)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>toLocaleTimeString : Symbol(Date.toLocaleTimeString, Decl(lib.d.ts, 646, 33)) + +Date.prototype.valueOf(); +>Date.prototype.valueOf : Symbol(Date.valueOf, Decl(lib.d.ts, 648, 33)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>valueOf : Symbol(Date.valueOf, Decl(lib.d.ts, 648, 33)) + +Date.prototype.getTime(); +>Date.prototype.getTime : Symbol(Date.getTime, Decl(lib.d.ts, 650, 22)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getTime : Symbol(Date.getTime, Decl(lib.d.ts, 650, 22)) + +Date.prototype.getFullYear(); +>Date.prototype.getFullYear : Symbol(Date.getFullYear, Decl(lib.d.ts, 652, 22)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getFullYear : Symbol(Date.getFullYear, Decl(lib.d.ts, 652, 22)) + +Date.prototype.getUTCFullYear(); +>Date.prototype.getUTCFullYear : Symbol(Date.getUTCFullYear, Decl(lib.d.ts, 654, 26)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getUTCFullYear : Symbol(Date.getUTCFullYear, Decl(lib.d.ts, 654, 26)) + +Date.prototype.getMonth(); +>Date.prototype.getMonth : Symbol(Date.getMonth, Decl(lib.d.ts, 656, 29)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getMonth : Symbol(Date.getMonth, Decl(lib.d.ts, 656, 29)) + +Date.prototype.getUTCMonth(); +>Date.prototype.getUTCMonth : Symbol(Date.getUTCMonth, Decl(lib.d.ts, 658, 23)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getUTCMonth : Symbol(Date.getUTCMonth, Decl(lib.d.ts, 658, 23)) + +Date.prototype.getDate(); +>Date.prototype.getDate : Symbol(Date.getDate, Decl(lib.d.ts, 660, 26)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getDate : Symbol(Date.getDate, Decl(lib.d.ts, 660, 26)) + +Date.prototype.getUTCDate(); +>Date.prototype.getUTCDate : Symbol(Date.getUTCDate, Decl(lib.d.ts, 662, 22)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getUTCDate : Symbol(Date.getUTCDate, Decl(lib.d.ts, 662, 22)) + +Date.prototype.getDay(); +>Date.prototype.getDay : Symbol(Date.getDay, Decl(lib.d.ts, 664, 25)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getDay : Symbol(Date.getDay, Decl(lib.d.ts, 664, 25)) + +Date.prototype.getUTCDay(); +>Date.prototype.getUTCDay : Symbol(Date.getUTCDay, Decl(lib.d.ts, 666, 21)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getUTCDay : Symbol(Date.getUTCDay, Decl(lib.d.ts, 666, 21)) + +Date.prototype.getHours(); +>Date.prototype.getHours : Symbol(Date.getHours, Decl(lib.d.ts, 668, 24)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getHours : Symbol(Date.getHours, Decl(lib.d.ts, 668, 24)) + +Date.prototype.getUTCHours(); +>Date.prototype.getUTCHours : Symbol(Date.getUTCHours, Decl(lib.d.ts, 670, 23)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getUTCHours : Symbol(Date.getUTCHours, Decl(lib.d.ts, 670, 23)) + +Date.prototype.getMinutes(); +>Date.prototype.getMinutes : Symbol(Date.getMinutes, Decl(lib.d.ts, 672, 26)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getMinutes : Symbol(Date.getMinutes, Decl(lib.d.ts, 672, 26)) + +Date.prototype.getUTCMinutes(); +>Date.prototype.getUTCMinutes : Symbol(Date.getUTCMinutes, Decl(lib.d.ts, 674, 25)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getUTCMinutes : Symbol(Date.getUTCMinutes, Decl(lib.d.ts, 674, 25)) + +Date.prototype.getSeconds(); +>Date.prototype.getSeconds : Symbol(Date.getSeconds, Decl(lib.d.ts, 676, 28)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getSeconds : Symbol(Date.getSeconds, Decl(lib.d.ts, 676, 28)) + +Date.prototype.getUTCSeconds(); +>Date.prototype.getUTCSeconds : Symbol(Date.getUTCSeconds, Decl(lib.d.ts, 678, 25)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getUTCSeconds : Symbol(Date.getUTCSeconds, Decl(lib.d.ts, 678, 25)) + +Date.prototype.getMilliseconds(); +>Date.prototype.getMilliseconds : Symbol(Date.getMilliseconds, Decl(lib.d.ts, 680, 28)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getMilliseconds : Symbol(Date.getMilliseconds, Decl(lib.d.ts, 680, 28)) + +Date.prototype.getUTCMilliseconds(); +>Date.prototype.getUTCMilliseconds : Symbol(Date.getUTCMilliseconds, Decl(lib.d.ts, 682, 30)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getUTCMilliseconds : Symbol(Date.getUTCMilliseconds, Decl(lib.d.ts, 682, 30)) + +Date.prototype.getTimezoneOffset(); +>Date.prototype.getTimezoneOffset : Symbol(Date.getTimezoneOffset, Decl(lib.d.ts, 684, 33)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getTimezoneOffset : Symbol(Date.getTimezoneOffset, Decl(lib.d.ts, 684, 33)) + +Date.prototype.setTime(0); +>Date.prototype.setTime : Symbol(Date.setTime, Decl(lib.d.ts, 686, 32)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setTime : Symbol(Date.setTime, Decl(lib.d.ts, 686, 32)) + +Date.prototype.setMilliseconds(0); +>Date.prototype.setMilliseconds : Symbol(Date.setMilliseconds, Decl(lib.d.ts, 691, 34)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setMilliseconds : Symbol(Date.setMilliseconds, Decl(lib.d.ts, 691, 34)) + +Date.prototype.setUTCMilliseconds(0); +>Date.prototype.setUTCMilliseconds : Symbol(Date.setUTCMilliseconds, Decl(lib.d.ts, 696, 40)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setUTCMilliseconds : Symbol(Date.setUTCMilliseconds, Decl(lib.d.ts, 696, 40)) + +Date.prototype.setSeconds(0); +>Date.prototype.setSeconds : Symbol(Date.setSeconds, Decl(lib.d.ts, 701, 43)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setSeconds : Symbol(Date.setSeconds, Decl(lib.d.ts, 701, 43)) + +Date.prototype.setUTCSeconds(0); +>Date.prototype.setUTCSeconds : Symbol(Date.setUTCSeconds, Decl(lib.d.ts, 708, 49)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setUTCSeconds : Symbol(Date.setUTCSeconds, Decl(lib.d.ts, 708, 49)) + +Date.prototype.setMinutes(0); +>Date.prototype.setMinutes : Symbol(Date.setMinutes, Decl(lib.d.ts, 714, 52)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setMinutes : Symbol(Date.setMinutes, Decl(lib.d.ts, 714, 52)) + +Date.prototype.setUTCMinutes(0); +>Date.prototype.setUTCMinutes : Symbol(Date.setUTCMinutes, Decl(lib.d.ts, 721, 63)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setUTCMinutes : Symbol(Date.setUTCMinutes, Decl(lib.d.ts, 721, 63)) + +Date.prototype.setHours(0); +>Date.prototype.setHours : Symbol(Date.setHours, Decl(lib.d.ts, 728, 66)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setHours : Symbol(Date.setHours, Decl(lib.d.ts, 728, 66)) + +Date.prototype.setUTCHours(0); +>Date.prototype.setUTCHours : Symbol(Date.setUTCHours, Decl(lib.d.ts, 736, 77)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setUTCHours : Symbol(Date.setUTCHours, Decl(lib.d.ts, 736, 77)) + +Date.prototype.setDate(0); +>Date.prototype.setDate : Symbol(Date.setDate, Decl(lib.d.ts, 744, 80)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setDate : Symbol(Date.setDate, Decl(lib.d.ts, 744, 80)) + +Date.prototype.setUTCDate(0); +>Date.prototype.setUTCDate : Symbol(Date.setUTCDate, Decl(lib.d.ts, 749, 34)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setUTCDate : Symbol(Date.setUTCDate, Decl(lib.d.ts, 749, 34)) + +Date.prototype.setMonth(0); +>Date.prototype.setMonth : Symbol(Date.setMonth, Decl(lib.d.ts, 754, 37)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setMonth : Symbol(Date.setMonth, Decl(lib.d.ts, 754, 37)) + +Date.prototype.setUTCMonth(0); +>Date.prototype.setUTCMonth : Symbol(Date.setUTCMonth, Decl(lib.d.ts, 760, 51)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setUTCMonth : Symbol(Date.setUTCMonth, Decl(lib.d.ts, 760, 51)) + +Date.prototype.setFullYear(0); +>Date.prototype.setFullYear : Symbol(Date.setFullYear, Decl(lib.d.ts, 766, 54)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setFullYear : Symbol(Date.setFullYear, Decl(lib.d.ts, 766, 54)) + +Date.prototype.setUTCFullYear(0); +>Date.prototype.setUTCFullYear : Symbol(Date.setUTCFullYear, Decl(lib.d.ts, 773, 69)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setUTCFullYear : Symbol(Date.setUTCFullYear, Decl(lib.d.ts, 773, 69)) + +Date.prototype.toUTCString(); +>Date.prototype.toUTCString : Symbol(Date.toUTCString, Decl(lib.d.ts, 780, 72)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>toUTCString : Symbol(Date.toUTCString, Decl(lib.d.ts, 780, 72)) + +Date.prototype.toISOString(); +>Date.prototype.toISOString : Symbol(Date.toISOString, Decl(lib.d.ts, 782, 26)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>toISOString : Symbol(Date.toISOString, Decl(lib.d.ts, 782, 26)) + +Date.prototype.toJSON(null); +>Date.prototype.toJSON : Symbol(Date.toJSON, Decl(lib.d.ts, 784, 26)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>toJSON : Symbol(Date.toJSON, Decl(lib.d.ts, 784, 26)) + diff --git a/tests/baselines/reference/library_DatePrototypeProperties.types b/tests/baselines/reference/library_DatePrototypeProperties.types index 35dcea318be..79aad91245b 100644 --- a/tests/baselines/reference/library_DatePrototypeProperties.types +++ b/tests/baselines/reference/library_DatePrototypeProperties.types @@ -215,6 +215,7 @@ Date.prototype.setTime(0); >Date : DateConstructor >prototype : Date >setTime : (time: number) => number +>0 : number Date.prototype.setMilliseconds(0); >Date.prototype.setMilliseconds(0) : number @@ -223,6 +224,7 @@ Date.prototype.setMilliseconds(0); >Date : DateConstructor >prototype : Date >setMilliseconds : (ms: number) => number +>0 : number Date.prototype.setUTCMilliseconds(0); >Date.prototype.setUTCMilliseconds(0) : number @@ -231,6 +233,7 @@ Date.prototype.setUTCMilliseconds(0); >Date : DateConstructor >prototype : Date >setUTCMilliseconds : (ms: number) => number +>0 : number Date.prototype.setSeconds(0); >Date.prototype.setSeconds(0) : number @@ -239,6 +242,7 @@ Date.prototype.setSeconds(0); >Date : DateConstructor >prototype : Date >setSeconds : (sec: number, ms?: number) => number +>0 : number Date.prototype.setUTCSeconds(0); >Date.prototype.setUTCSeconds(0) : number @@ -247,6 +251,7 @@ Date.prototype.setUTCSeconds(0); >Date : DateConstructor >prototype : Date >setUTCSeconds : (sec: number, ms?: number) => number +>0 : number Date.prototype.setMinutes(0); >Date.prototype.setMinutes(0) : number @@ -255,6 +260,7 @@ Date.prototype.setMinutes(0); >Date : DateConstructor >prototype : Date >setMinutes : (min: number, sec?: number, ms?: number) => number +>0 : number Date.prototype.setUTCMinutes(0); >Date.prototype.setUTCMinutes(0) : number @@ -263,6 +269,7 @@ Date.prototype.setUTCMinutes(0); >Date : DateConstructor >prototype : Date >setUTCMinutes : (min: number, sec?: number, ms?: number) => number +>0 : number Date.prototype.setHours(0); >Date.prototype.setHours(0) : number @@ -271,6 +278,7 @@ Date.prototype.setHours(0); >Date : DateConstructor >prototype : Date >setHours : (hours: number, min?: number, sec?: number, ms?: number) => number +>0 : number Date.prototype.setUTCHours(0); >Date.prototype.setUTCHours(0) : number @@ -279,6 +287,7 @@ Date.prototype.setUTCHours(0); >Date : DateConstructor >prototype : Date >setUTCHours : (hours: number, min?: number, sec?: number, ms?: number) => number +>0 : number Date.prototype.setDate(0); >Date.prototype.setDate(0) : number @@ -287,6 +296,7 @@ Date.prototype.setDate(0); >Date : DateConstructor >prototype : Date >setDate : (date: number) => number +>0 : number Date.prototype.setUTCDate(0); >Date.prototype.setUTCDate(0) : number @@ -295,6 +305,7 @@ Date.prototype.setUTCDate(0); >Date : DateConstructor >prototype : Date >setUTCDate : (date: number) => number +>0 : number Date.prototype.setMonth(0); >Date.prototype.setMonth(0) : number @@ -303,6 +314,7 @@ Date.prototype.setMonth(0); >Date : DateConstructor >prototype : Date >setMonth : (month: number, date?: number) => number +>0 : number Date.prototype.setUTCMonth(0); >Date.prototype.setUTCMonth(0) : number @@ -311,6 +323,7 @@ Date.prototype.setUTCMonth(0); >Date : DateConstructor >prototype : Date >setUTCMonth : (month: number, date?: number) => number +>0 : number Date.prototype.setFullYear(0); >Date.prototype.setFullYear(0) : number @@ -319,6 +332,7 @@ Date.prototype.setFullYear(0); >Date : DateConstructor >prototype : Date >setFullYear : (year: number, month?: number, date?: number) => number +>0 : number Date.prototype.setUTCFullYear(0); >Date.prototype.setUTCFullYear(0) : number @@ -327,6 +341,7 @@ Date.prototype.setUTCFullYear(0); >Date : DateConstructor >prototype : Date >setUTCFullYear : (year: number, month?: number, date?: number) => number +>0 : number Date.prototype.toUTCString(); >Date.prototype.toUTCString() : string @@ -351,4 +366,5 @@ Date.prototype.toJSON(null); >Date : DateConstructor >prototype : Date >toJSON : (key?: any) => string +>null : null diff --git a/tests/baselines/reference/library_ObjectPrototypeProperties.symbols b/tests/baselines/reference/library_ObjectPrototypeProperties.symbols new file mode 100644 index 00000000000..eb24374af2a --- /dev/null +++ b/tests/baselines/reference/library_ObjectPrototypeProperties.symbols @@ -0,0 +1,53 @@ +=== tests/cases/compiler/library_ObjectPrototypeProperties.ts === +// Properties of the Object Prototype Object as per ES5 spec +// http://www.ecma-international.org/ecma-262/5.1/#sec-15.2.4 +Object.prototype.constructor; +>Object.prototype.constructor : Symbol(Object.constructor, Decl(lib.d.ts, 94, 18)) +>Object.prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>constructor : Symbol(Object.constructor, Decl(lib.d.ts, 94, 18)) + +Object.prototype.toString(); +>Object.prototype.toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) +>Object.prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) + +Object.prototype.toLocaleString(); +>Object.prototype.toLocaleString : Symbol(Object.toLocaleString, Decl(lib.d.ts, 99, 23)) +>Object.prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>toLocaleString : Symbol(Object.toLocaleString, Decl(lib.d.ts, 99, 23)) + +Object.prototype.valueOf(); +>Object.prototype.valueOf : Symbol(Object.valueOf, Decl(lib.d.ts, 102, 29)) +>Object.prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>valueOf : Symbol(Object.valueOf, Decl(lib.d.ts, 102, 29)) + +Object.prototype.hasOwnProperty("string"); +>Object.prototype.hasOwnProperty : Symbol(Object.hasOwnProperty, Decl(lib.d.ts, 105, 22)) +>Object.prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>hasOwnProperty : Symbol(Object.hasOwnProperty, Decl(lib.d.ts, 105, 22)) + +Object.prototype.isPrototypeOf(Object); +>Object.prototype.isPrototypeOf : Symbol(Object.isPrototypeOf, Decl(lib.d.ts, 111, 39)) +>Object.prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>isPrototypeOf : Symbol(Object.isPrototypeOf, Decl(lib.d.ts, 111, 39)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +Object.prototype.propertyIsEnumerable("string"); +>Object.prototype.propertyIsEnumerable : Symbol(Object.propertyIsEnumerable, Decl(lib.d.ts, 117, 38)) +>Object.prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>propertyIsEnumerable : Symbol(Object.propertyIsEnumerable, Decl(lib.d.ts, 117, 38)) + diff --git a/tests/baselines/reference/library_ObjectPrototypeProperties.types b/tests/baselines/reference/library_ObjectPrototypeProperties.types index c848ccbe512..616a9da633b 100644 --- a/tests/baselines/reference/library_ObjectPrototypeProperties.types +++ b/tests/baselines/reference/library_ObjectPrototypeProperties.types @@ -39,6 +39,7 @@ Object.prototype.hasOwnProperty("string"); >Object : ObjectConstructor >prototype : Object >hasOwnProperty : (v: string) => boolean +>"string" : string Object.prototype.isPrototypeOf(Object); >Object.prototype.isPrototypeOf(Object) : boolean @@ -56,4 +57,5 @@ Object.prototype.propertyIsEnumerable("string"); >Object : ObjectConstructor >prototype : Object >propertyIsEnumerable : (v: string) => boolean +>"string" : string diff --git a/tests/baselines/reference/library_RegExpExecArraySlice.symbols b/tests/baselines/reference/library_RegExpExecArraySlice.symbols new file mode 100644 index 00000000000..bc460801fe8 --- /dev/null +++ b/tests/baselines/reference/library_RegExpExecArraySlice.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/library_RegExpExecArraySlice.ts === +// RegExpExecArray.slice can have zero, one, or two arguments +var regExpExecArrayValue: RegExpExecArray; +>regExpExecArrayValue : Symbol(regExpExecArrayValue, Decl(library_RegExpExecArraySlice.ts, 1, 3)) +>RegExpExecArray : Symbol(RegExpExecArray, Decl(lib.d.ts, 820, 1)) + +regExpExecArrayValue.slice(); +>regExpExecArrayValue.slice : Symbol(Array.slice, Decl(lib.d.ts, 1048, 15)) +>regExpExecArrayValue : Symbol(regExpExecArrayValue, Decl(library_RegExpExecArraySlice.ts, 1, 3)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, 1048, 15)) + +regExpExecArrayValue.slice(0); +>regExpExecArrayValue.slice : Symbol(Array.slice, Decl(lib.d.ts, 1048, 15)) +>regExpExecArrayValue : Symbol(regExpExecArrayValue, Decl(library_RegExpExecArraySlice.ts, 1, 3)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, 1048, 15)) + +regExpExecArrayValue.slice(0,1); +>regExpExecArrayValue.slice : Symbol(Array.slice, Decl(lib.d.ts, 1048, 15)) +>regExpExecArrayValue : Symbol(regExpExecArrayValue, Decl(library_RegExpExecArraySlice.ts, 1, 3)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, 1048, 15)) + diff --git a/tests/baselines/reference/library_RegExpExecArraySlice.types b/tests/baselines/reference/library_RegExpExecArraySlice.types index ba5c3ccfb21..b4673adb988 100644 --- a/tests/baselines/reference/library_RegExpExecArraySlice.types +++ b/tests/baselines/reference/library_RegExpExecArraySlice.types @@ -15,10 +15,13 @@ regExpExecArrayValue.slice(0); >regExpExecArrayValue.slice : (start?: number, end?: number) => string[] >regExpExecArrayValue : RegExpExecArray >slice : (start?: number, end?: number) => string[] +>0 : number regExpExecArrayValue.slice(0,1); >regExpExecArrayValue.slice(0,1) : string[] >regExpExecArrayValue.slice : (start?: number, end?: number) => string[] >regExpExecArrayValue : RegExpExecArray >slice : (start?: number, end?: number) => string[] +>0 : number +>1 : number diff --git a/tests/baselines/reference/library_StringSlice.symbols b/tests/baselines/reference/library_StringSlice.symbols new file mode 100644 index 00000000000..92c80089511 --- /dev/null +++ b/tests/baselines/reference/library_StringSlice.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/library_StringSlice.ts === +// String.prototype.slice can have zero, one, or two arguments +String.prototype.slice(); +>String.prototype.slice : Symbol(String.slice, Decl(lib.d.ts, 369, 35)) +>String.prototype : Symbol(StringConstructor.prototype, Decl(lib.d.ts, 435, 26)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) +>prototype : Symbol(StringConstructor.prototype, Decl(lib.d.ts, 435, 26)) +>slice : Symbol(String.slice, Decl(lib.d.ts, 369, 35)) + +String.prototype.slice(0); +>String.prototype.slice : Symbol(String.slice, Decl(lib.d.ts, 369, 35)) +>String.prototype : Symbol(StringConstructor.prototype, Decl(lib.d.ts, 435, 26)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) +>prototype : Symbol(StringConstructor.prototype, Decl(lib.d.ts, 435, 26)) +>slice : Symbol(String.slice, Decl(lib.d.ts, 369, 35)) + +String.prototype.slice(0,1); +>String.prototype.slice : Symbol(String.slice, Decl(lib.d.ts, 369, 35)) +>String.prototype : Symbol(StringConstructor.prototype, Decl(lib.d.ts, 435, 26)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) +>prototype : Symbol(StringConstructor.prototype, Decl(lib.d.ts, 435, 26)) +>slice : Symbol(String.slice, Decl(lib.d.ts, 369, 35)) + diff --git a/tests/baselines/reference/library_StringSlice.types b/tests/baselines/reference/library_StringSlice.types index c40c4d744e0..09b2a0b3995 100644 --- a/tests/baselines/reference/library_StringSlice.types +++ b/tests/baselines/reference/library_StringSlice.types @@ -15,6 +15,7 @@ String.prototype.slice(0); >String : StringConstructor >prototype : String >slice : (start?: number, end?: number) => string +>0 : number String.prototype.slice(0,1); >String.prototype.slice(0,1) : string @@ -23,4 +24,6 @@ String.prototype.slice(0,1); >String : StringConstructor >prototype : String >slice : (start?: number, end?: number) => string +>0 : number +>1 : number diff --git a/tests/baselines/reference/listFailure.symbols b/tests/baselines/reference/listFailure.symbols new file mode 100644 index 00000000000..53b1acf09ee --- /dev/null +++ b/tests/baselines/reference/listFailure.symbols @@ -0,0 +1,120 @@ +=== tests/cases/compiler/listFailure.ts === +module Editor { +>Editor : Symbol(Editor, Decl(listFailure.ts, 0, 0)) + + export class Buffer { +>Buffer : Symbol(Buffer, Decl(listFailure.ts, 0, 15)) + + lines: List = ListMakeHead(); +>lines : Symbol(lines, Decl(listFailure.ts, 2, 25)) +>List : Symbol(List, Decl(listFailure.ts, 24, 5)) +>Line : Symbol(Line, Decl(listFailure.ts, 37, 5)) +>ListMakeHead : Symbol(ListMakeHead, Decl(listFailure.ts, 16, 5)) +>Line : Symbol(Line, Decl(listFailure.ts, 37, 5)) + + addLine(lineText: string): List { +>addLine : Symbol(addLine, Decl(listFailure.ts, 3, 46)) +>lineText : Symbol(lineText, Decl(listFailure.ts, 5, 16)) +>List : Symbol(List, Decl(listFailure.ts, 24, 5)) +>Line : Symbol(Line, Decl(listFailure.ts, 37, 5)) + + var line: Line = new Line(); +>line : Symbol(line, Decl(listFailure.ts, 7, 15)) +>Line : Symbol(Line, Decl(listFailure.ts, 37, 5)) +>Line : Symbol(Line, Decl(listFailure.ts, 37, 5)) + + var lineEntry = this.lines.add(line); +>lineEntry : Symbol(lineEntry, Decl(listFailure.ts, 8, 15)) +>this.lines.add : Symbol(List.add, Decl(listFailure.ts, 27, 29)) +>this.lines : Symbol(lines, Decl(listFailure.ts, 2, 25)) +>this : Symbol(Buffer, Decl(listFailure.ts, 0, 15)) +>lines : Symbol(lines, Decl(listFailure.ts, 2, 25)) +>add : Symbol(List.add, Decl(listFailure.ts, 27, 29)) +>line : Symbol(line, Decl(listFailure.ts, 7, 15)) + + return lineEntry; +>lineEntry : Symbol(lineEntry, Decl(listFailure.ts, 8, 15)) + } + } + + export function ListRemoveEntry(entry: List): List { +>ListRemoveEntry : Symbol(ListRemoveEntry, Decl(listFailure.ts, 12, 5)) +>U : Symbol(U, Decl(listFailure.ts, 14, 36)) +>entry : Symbol(entry, Decl(listFailure.ts, 14, 39)) +>List : Symbol(List, Decl(listFailure.ts, 24, 5)) +>U : Symbol(U, Decl(listFailure.ts, 14, 36)) +>List : Symbol(List, Decl(listFailure.ts, 24, 5)) +>U : Symbol(U, Decl(listFailure.ts, 14, 36)) + + return entry; +>entry : Symbol(entry, Decl(listFailure.ts, 14, 39)) + } + + export function ListMakeHead(): List { +>ListMakeHead : Symbol(ListMakeHead, Decl(listFailure.ts, 16, 5)) +>U : Symbol(U, Decl(listFailure.ts, 18, 33)) +>List : Symbol(List, Decl(listFailure.ts, 24, 5)) +>U : Symbol(U, Decl(listFailure.ts, 18, 33)) + + return null; + } + + export function ListMakeEntry(data: U): List { +>ListMakeEntry : Symbol(ListMakeEntry, Decl(listFailure.ts, 20, 5)) +>U : Symbol(U, Decl(listFailure.ts, 22, 34)) +>data : Symbol(data, Decl(listFailure.ts, 22, 37)) +>U : Symbol(U, Decl(listFailure.ts, 22, 34)) +>List : Symbol(List, Decl(listFailure.ts, 24, 5)) +>U : Symbol(U, Decl(listFailure.ts, 22, 34)) + + return null; + } + + class List { +>List : Symbol(List, Decl(listFailure.ts, 24, 5)) +>T : Symbol(T, Decl(listFailure.ts, 26, 15)) + + public next: List; +>next : Symbol(next, Decl(listFailure.ts, 26, 19)) +>List : Symbol(List, Decl(listFailure.ts, 24, 5)) +>T : Symbol(T, Decl(listFailure.ts, 26, 15)) + + add(data: T): List { +>add : Symbol(add, Decl(listFailure.ts, 27, 29)) +>data : Symbol(data, Decl(listFailure.ts, 29, 12)) +>T : Symbol(T, Decl(listFailure.ts, 26, 15)) +>List : Symbol(List, Decl(listFailure.ts, 24, 5)) +>T : Symbol(T, Decl(listFailure.ts, 26, 15)) + + this.next = ListMakeEntry(data); +>this.next : Symbol(next, Decl(listFailure.ts, 26, 19)) +>this : Symbol(List, Decl(listFailure.ts, 24, 5)) +>next : Symbol(next, Decl(listFailure.ts, 26, 19)) +>ListMakeEntry : Symbol(ListMakeEntry, Decl(listFailure.ts, 20, 5)) +>data : Symbol(data, Decl(listFailure.ts, 29, 12)) + + return this.next; +>this.next : Symbol(next, Decl(listFailure.ts, 26, 19)) +>this : Symbol(List, Decl(listFailure.ts, 24, 5)) +>next : Symbol(next, Decl(listFailure.ts, 26, 19)) + } + + popEntry(head: List): List { +>popEntry : Symbol(popEntry, Decl(listFailure.ts, 32, 9)) +>head : Symbol(head, Decl(listFailure.ts, 34, 17)) +>List : Symbol(List, Decl(listFailure.ts, 24, 5)) +>T : Symbol(T, Decl(listFailure.ts, 26, 15)) +>List : Symbol(List, Decl(listFailure.ts, 24, 5)) +>T : Symbol(T, Decl(listFailure.ts, 26, 15)) + + return (ListRemoveEntry(this.next)); +>ListRemoveEntry : Symbol(ListRemoveEntry, Decl(listFailure.ts, 12, 5)) +>this.next : Symbol(next, Decl(listFailure.ts, 26, 19)) +>this : Symbol(List, Decl(listFailure.ts, 24, 5)) +>next : Symbol(next, Decl(listFailure.ts, 26, 19)) + } + } + + export class Line {} +>Line : Symbol(Line, Decl(listFailure.ts, 37, 5)) +} diff --git a/tests/baselines/reference/listFailure.types b/tests/baselines/reference/listFailure.types index de3c33bbfad..05c3cb5dfad 100644 --- a/tests/baselines/reference/listFailure.types +++ b/tests/baselines/reference/listFailure.types @@ -60,6 +60,7 @@ module Editor { >U : U return null; +>null : null } export function ListMakeEntry(data: U): List { @@ -71,6 +72,7 @@ module Editor { >U : U return null; +>null : null } class List { diff --git a/tests/baselines/reference/literals1.symbols b/tests/baselines/reference/literals1.symbols new file mode 100644 index 00000000000..067e49a2717 --- /dev/null +++ b/tests/baselines/reference/literals1.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/literals1.ts === +var a = 42; +>a : Symbol(a, Decl(literals1.ts, 0, 3)) + +var b = 0xFA34; +>b : Symbol(b, Decl(literals1.ts, 1, 3)) + +var c = 0.1715; +>c : Symbol(c, Decl(literals1.ts, 2, 3)) + +var d = 3.14E5; +>d : Symbol(d, Decl(literals1.ts, 3, 3)) + +var e = 8.14e-5; +>e : Symbol(e, Decl(literals1.ts, 4, 3)) + +var f = true; +>f : Symbol(f, Decl(literals1.ts, 6, 3)) + +var g = false; +>g : Symbol(g, Decl(literals1.ts, 7, 3)) + +var h = ""; +>h : Symbol(h, Decl(literals1.ts, 9, 3)) + +var i = "hi"; +>i : Symbol(i, Decl(literals1.ts, 10, 3)) + +var j = ''; +>j : Symbol(j, Decl(literals1.ts, 11, 3)) + +var k = 'q\tq'; +>k : Symbol(k, Decl(literals1.ts, 12, 3)) + +var m = /q/; +>m : Symbol(m, Decl(literals1.ts, 14, 3)) + +var n = /\d+/g; +>n : Symbol(n, Decl(literals1.ts, 15, 3)) + +var o = /[3-5]+/i; +>o : Symbol(o, Decl(literals1.ts, 16, 3)) + diff --git a/tests/baselines/reference/literals1.types b/tests/baselines/reference/literals1.types index f1d6736fdca..69e50c22f4a 100644 --- a/tests/baselines/reference/literals1.types +++ b/tests/baselines/reference/literals1.types @@ -1,43 +1,57 @@ === tests/cases/compiler/literals1.ts === var a = 42; >a : number +>42 : number var b = 0xFA34; >b : number +>0xFA34 : number var c = 0.1715; >c : number +>0.1715 : number var d = 3.14E5; >d : number +>3.14E5 : number var e = 8.14e-5; >e : number +>8.14e-5 : number var f = true; >f : boolean +>true : boolean var g = false; >g : boolean +>false : boolean var h = ""; >h : string +>"" : string var i = "hi"; >i : string +>"hi" : string var j = ''; >j : string +>'' : string var k = 'q\tq'; >k : string +>'q\tq' : string var m = /q/; >m : RegExp +>/q/ : RegExp var n = /\d+/g; >n : RegExp +>/\d+/g : RegExp var o = /[3-5]+/i; >o : RegExp +>/[3-5]+/i : RegExp diff --git a/tests/baselines/reference/localAliasExportAssignment.symbols b/tests/baselines/reference/localAliasExportAssignment.symbols new file mode 100644 index 00000000000..43c99941384 --- /dev/null +++ b/tests/baselines/reference/localAliasExportAssignment.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/localAliasExportAssignment_1.ts === +/// +import connect = require('localAliasExportAssignment_0'); +>connect : Symbol(connect, Decl(localAliasExportAssignment_1.ts, 0, 0)) + +connect(); +>connect : Symbol(connect, Decl(localAliasExportAssignment_1.ts, 0, 0)) + + + +=== tests/cases/compiler/localAliasExportAssignment_0.ts === +var server: { +>server : Symbol(server, Decl(localAliasExportAssignment_0.ts, 0, 3)) + + (): any; +}; + +export = server; +>server : Symbol(server, Decl(localAliasExportAssignment_0.ts, 0, 3)) + diff --git a/tests/baselines/reference/localImportNameVsGlobalName.symbols b/tests/baselines/reference/localImportNameVsGlobalName.symbols new file mode 100644 index 00000000000..d1f00d79078 --- /dev/null +++ b/tests/baselines/reference/localImportNameVsGlobalName.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/localImportNameVsGlobalName.ts === +module Keyboard { +>Keyboard : Symbol(Keyboard, Decl(localImportNameVsGlobalName.ts, 0, 0)) + + export enum Key { UP, DOWN, LEFT, RIGHT } +>Key : Symbol(Key, Decl(localImportNameVsGlobalName.ts, 0, 17)) +>UP : Symbol(Key.UP, Decl(localImportNameVsGlobalName.ts, 1, 19)) +>DOWN : Symbol(Key.DOWN, Decl(localImportNameVsGlobalName.ts, 1, 23)) +>LEFT : Symbol(Key.LEFT, Decl(localImportNameVsGlobalName.ts, 1, 29)) +>RIGHT : Symbol(Key.RIGHT, Decl(localImportNameVsGlobalName.ts, 1, 35)) +} + +module App { +>App : Symbol(App, Decl(localImportNameVsGlobalName.ts, 2, 1)) + + import Key = Keyboard.Key; +>Key : Symbol(Key, Decl(localImportNameVsGlobalName.ts, 4, 12)) +>Keyboard : Symbol(Keyboard, Decl(localImportNameVsGlobalName.ts, 0, 0)) +>Key : Symbol(Key, Decl(localImportNameVsGlobalName.ts, 0, 17)) + + export function foo(key: Key): void {} +>foo : Symbol(foo, Decl(localImportNameVsGlobalName.ts, 5, 28)) +>key : Symbol(key, Decl(localImportNameVsGlobalName.ts, 7, 22)) +>Key : Symbol(Key, Decl(localImportNameVsGlobalName.ts, 4, 12)) + + foo(Key.UP); +>foo : Symbol(foo, Decl(localImportNameVsGlobalName.ts, 5, 28)) +>Key.UP : Symbol(Key.UP, Decl(localImportNameVsGlobalName.ts, 1, 19)) +>Key : Symbol(Key, Decl(localImportNameVsGlobalName.ts, 4, 12)) +>UP : Symbol(Key.UP, Decl(localImportNameVsGlobalName.ts, 1, 19)) + + foo(Key.DOWN); +>foo : Symbol(foo, Decl(localImportNameVsGlobalName.ts, 5, 28)) +>Key.DOWN : Symbol(Key.DOWN, Decl(localImportNameVsGlobalName.ts, 1, 23)) +>Key : Symbol(Key, Decl(localImportNameVsGlobalName.ts, 4, 12)) +>DOWN : Symbol(Key.DOWN, Decl(localImportNameVsGlobalName.ts, 1, 23)) + + foo(Key.LEFT); +>foo : Symbol(foo, Decl(localImportNameVsGlobalName.ts, 5, 28)) +>Key.LEFT : Symbol(Key.LEFT, Decl(localImportNameVsGlobalName.ts, 1, 29)) +>Key : Symbol(Key, Decl(localImportNameVsGlobalName.ts, 4, 12)) +>LEFT : Symbol(Key.LEFT, Decl(localImportNameVsGlobalName.ts, 1, 29)) +} diff --git a/tests/baselines/reference/localVariablesReturnedFromCatchBlocks.symbols b/tests/baselines/reference/localVariablesReturnedFromCatchBlocks.symbols new file mode 100644 index 00000000000..b97ac7163d5 --- /dev/null +++ b/tests/baselines/reference/localVariablesReturnedFromCatchBlocks.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/localVariablesReturnedFromCatchBlocks.ts === +function f() { +>f : Symbol(f, Decl(localVariablesReturnedFromCatchBlocks.ts, 0, 0)) + + try { + } catch (e) { +>e : Symbol(e, Decl(localVariablesReturnedFromCatchBlocks.ts, 2, 13)) + + var stack2 = e.stack; +>stack2 : Symbol(stack2, Decl(localVariablesReturnedFromCatchBlocks.ts, 3, 11)) +>e : Symbol(e, Decl(localVariablesReturnedFromCatchBlocks.ts, 2, 13)) + + return stack2; //error TS2095: Could not find symbol 'stack2'. +>stack2 : Symbol(stack2, Decl(localVariablesReturnedFromCatchBlocks.ts, 3, 11)) + } +} diff --git a/tests/baselines/reference/logicalAndOperatorWithEveryType.symbols b/tests/baselines/reference/logicalAndOperatorWithEveryType.symbols new file mode 100644 index 00000000000..440bfbf5651 --- /dev/null +++ b/tests/baselines/reference/logicalAndOperatorWithEveryType.symbols @@ -0,0 +1,515 @@ +=== tests/cases/conformance/expressions/binaryOperators/logicalAndOperator/logicalAndOperatorWithEveryType.ts === +// The && operator permits the operands to be of any type and produces a result of the same +// type as the second operand. + +enum E { a, b, c } +>E : Symbol(E, Decl(logicalAndOperatorWithEveryType.ts, 0, 0)) +>a : Symbol(E.a, Decl(logicalAndOperatorWithEveryType.ts, 3, 8)) +>b : Symbol(E.b, Decl(logicalAndOperatorWithEveryType.ts, 3, 11)) +>c : Symbol(E.c, Decl(logicalAndOperatorWithEveryType.ts, 3, 14)) + +var a1: any; +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) + +var a2: boolean; +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) + +var a3: number +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) + +var a4: string; +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) + +var a5: void; +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) + +var a6: E; +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) +>E : Symbol(E, Decl(logicalAndOperatorWithEveryType.ts, 0, 0)) + +var a7: {}; +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) + +var a8: string[]; +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) + +var ra1 = a1 && a1; +>ra1 : Symbol(ra1, Decl(logicalAndOperatorWithEveryType.ts, 14, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) + +var ra2 = a2 && a1; +>ra2 : Symbol(ra2, Decl(logicalAndOperatorWithEveryType.ts, 15, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) + +var ra3 = a3 && a1; +>ra3 : Symbol(ra3, Decl(logicalAndOperatorWithEveryType.ts, 16, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) + +var ra4 = a4 && a1; +>ra4 : Symbol(ra4, Decl(logicalAndOperatorWithEveryType.ts, 17, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) + +var ra5 = a5 && a1; +>ra5 : Symbol(ra5, Decl(logicalAndOperatorWithEveryType.ts, 18, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) + +var ra6 = a6 && a1; +>ra6 : Symbol(ra6, Decl(logicalAndOperatorWithEveryType.ts, 19, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) + +var ra7 = a7 && a1; +>ra7 : Symbol(ra7, Decl(logicalAndOperatorWithEveryType.ts, 20, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) + +var ra8 = a8 && a1; +>ra8 : Symbol(ra8, Decl(logicalAndOperatorWithEveryType.ts, 21, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) + +var ra9 = null && a1; +>ra9 : Symbol(ra9, Decl(logicalAndOperatorWithEveryType.ts, 22, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) + +var ra10 = undefined && a1; +>ra10 : Symbol(ra10, Decl(logicalAndOperatorWithEveryType.ts, 23, 3)) +>undefined : Symbol(undefined) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) + +var rb1 = a1 && a2; +>rb1 : Symbol(rb1, Decl(logicalAndOperatorWithEveryType.ts, 25, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) + +var rb2 = a2 && a2; +>rb2 : Symbol(rb2, Decl(logicalAndOperatorWithEveryType.ts, 26, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) + +var rb3 = a3 && a2; +>rb3 : Symbol(rb3, Decl(logicalAndOperatorWithEveryType.ts, 27, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) + +var rb4 = a4 && a2; +>rb4 : Symbol(rb4, Decl(logicalAndOperatorWithEveryType.ts, 28, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) + +var rb5 = a5 && a2; +>rb5 : Symbol(rb5, Decl(logicalAndOperatorWithEveryType.ts, 29, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) + +var rb6 = a6 && a2; +>rb6 : Symbol(rb6, Decl(logicalAndOperatorWithEveryType.ts, 30, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) + +var rb7 = a7 && a2; +>rb7 : Symbol(rb7, Decl(logicalAndOperatorWithEveryType.ts, 31, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) + +var rb8 = a8 && a2; +>rb8 : Symbol(rb8, Decl(logicalAndOperatorWithEveryType.ts, 32, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) + +var rb9 = null && a2; +>rb9 : Symbol(rb9, Decl(logicalAndOperatorWithEveryType.ts, 33, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) + +var rb10 = undefined && a2; +>rb10 : Symbol(rb10, Decl(logicalAndOperatorWithEveryType.ts, 34, 3)) +>undefined : Symbol(undefined) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) + +var rc1 = a1 && a3; +>rc1 : Symbol(rc1, Decl(logicalAndOperatorWithEveryType.ts, 36, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) + +var rc2 = a2 && a3; +>rc2 : Symbol(rc2, Decl(logicalAndOperatorWithEveryType.ts, 37, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) + +var rc3 = a3 && a3; +>rc3 : Symbol(rc3, Decl(logicalAndOperatorWithEveryType.ts, 38, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) + +var rc4 = a4 && a3; +>rc4 : Symbol(rc4, Decl(logicalAndOperatorWithEveryType.ts, 39, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) + +var rc5 = a5 && a3; +>rc5 : Symbol(rc5, Decl(logicalAndOperatorWithEveryType.ts, 40, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) + +var rc6 = a6 && a3; +>rc6 : Symbol(rc6, Decl(logicalAndOperatorWithEveryType.ts, 41, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) + +var rc7 = a7 && a3; +>rc7 : Symbol(rc7, Decl(logicalAndOperatorWithEveryType.ts, 42, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) + +var rc8 = a8 && a3; +>rc8 : Symbol(rc8, Decl(logicalAndOperatorWithEveryType.ts, 43, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) + +var rc9 = null && a3; +>rc9 : Symbol(rc9, Decl(logicalAndOperatorWithEveryType.ts, 44, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) + +var rc10 = undefined && a3; +>rc10 : Symbol(rc10, Decl(logicalAndOperatorWithEveryType.ts, 45, 3)) +>undefined : Symbol(undefined) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) + +var rd1 = a1 && a4; +>rd1 : Symbol(rd1, Decl(logicalAndOperatorWithEveryType.ts, 47, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) + +var rd2 = a2 && a4; +>rd2 : Symbol(rd2, Decl(logicalAndOperatorWithEveryType.ts, 48, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) + +var rd3 = a3 && a4; +>rd3 : Symbol(rd3, Decl(logicalAndOperatorWithEveryType.ts, 49, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) + +var rd4 = a4 && a4; +>rd4 : Symbol(rd4, Decl(logicalAndOperatorWithEveryType.ts, 50, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) + +var rd5 = a5 && a4; +>rd5 : Symbol(rd5, Decl(logicalAndOperatorWithEveryType.ts, 51, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) + +var rd6 = a6 && a4; +>rd6 : Symbol(rd6, Decl(logicalAndOperatorWithEveryType.ts, 52, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) + +var rd7 = a7 && a4; +>rd7 : Symbol(rd7, Decl(logicalAndOperatorWithEveryType.ts, 53, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) + +var rd8 = a8 && a4; +>rd8 : Symbol(rd8, Decl(logicalAndOperatorWithEveryType.ts, 54, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) + +var rd9 = null && a4; +>rd9 : Symbol(rd9, Decl(logicalAndOperatorWithEveryType.ts, 55, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) + +var rd10 = undefined && a4; +>rd10 : Symbol(rd10, Decl(logicalAndOperatorWithEveryType.ts, 56, 3)) +>undefined : Symbol(undefined) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) + +var re1 = a1 && a5; +>re1 : Symbol(re1, Decl(logicalAndOperatorWithEveryType.ts, 58, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) + +var re2 = a2 && a5; +>re2 : Symbol(re2, Decl(logicalAndOperatorWithEveryType.ts, 59, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) + +var re3 = a3 && a5; +>re3 : Symbol(re3, Decl(logicalAndOperatorWithEveryType.ts, 60, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) + +var re4 = a4 && a5; +>re4 : Symbol(re4, Decl(logicalAndOperatorWithEveryType.ts, 61, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) + +var re5 = a5 && a5; +>re5 : Symbol(re5, Decl(logicalAndOperatorWithEveryType.ts, 62, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) + +var re6 = a6 && a5; +>re6 : Symbol(re6, Decl(logicalAndOperatorWithEveryType.ts, 63, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) + +var re7 = a7 && a5; +>re7 : Symbol(re7, Decl(logicalAndOperatorWithEveryType.ts, 64, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) + +var re8 = a8 && a5; +>re8 : Symbol(re8, Decl(logicalAndOperatorWithEveryType.ts, 65, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) + +var re9 = null && a5; +>re9 : Symbol(re9, Decl(logicalAndOperatorWithEveryType.ts, 66, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) + +var re10 = undefined && a5; +>re10 : Symbol(re10, Decl(logicalAndOperatorWithEveryType.ts, 67, 3)) +>undefined : Symbol(undefined) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) + +var rf1 = a1 && a6; +>rf1 : Symbol(rf1, Decl(logicalAndOperatorWithEveryType.ts, 69, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) + +var rf2 = a2 && a6; +>rf2 : Symbol(rf2, Decl(logicalAndOperatorWithEveryType.ts, 70, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) + +var rf3 = a3 && a6; +>rf3 : Symbol(rf3, Decl(logicalAndOperatorWithEveryType.ts, 71, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) + +var rf4 = a4 && a6; +>rf4 : Symbol(rf4, Decl(logicalAndOperatorWithEveryType.ts, 72, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) + +var rf5 = a5 && a6; +>rf5 : Symbol(rf5, Decl(logicalAndOperatorWithEveryType.ts, 73, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) + +var rf6 = a6 && a6; +>rf6 : Symbol(rf6, Decl(logicalAndOperatorWithEveryType.ts, 74, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) + +var rf7 = a7 && a6; +>rf7 : Symbol(rf7, Decl(logicalAndOperatorWithEveryType.ts, 75, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) + +var rf8 = a8 && a6; +>rf8 : Symbol(rf8, Decl(logicalAndOperatorWithEveryType.ts, 76, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) + +var rf9 = null && a6; +>rf9 : Symbol(rf9, Decl(logicalAndOperatorWithEveryType.ts, 77, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) + +var rf10 = undefined && a6; +>rf10 : Symbol(rf10, Decl(logicalAndOperatorWithEveryType.ts, 78, 3)) +>undefined : Symbol(undefined) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) + +var rg1 = a1 && a7; +>rg1 : Symbol(rg1, Decl(logicalAndOperatorWithEveryType.ts, 80, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) + +var rg2 = a2 && a7; +>rg2 : Symbol(rg2, Decl(logicalAndOperatorWithEveryType.ts, 81, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) + +var rg3 = a3 && a7; +>rg3 : Symbol(rg3, Decl(logicalAndOperatorWithEveryType.ts, 82, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) + +var rg4 = a4 && a7; +>rg4 : Symbol(rg4, Decl(logicalAndOperatorWithEveryType.ts, 83, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) + +var rg5 = a5 && a7; +>rg5 : Symbol(rg5, Decl(logicalAndOperatorWithEveryType.ts, 84, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) + +var rg6 = a6 && a7; +>rg6 : Symbol(rg6, Decl(logicalAndOperatorWithEveryType.ts, 85, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) + +var rg7 = a7 && a7; +>rg7 : Symbol(rg7, Decl(logicalAndOperatorWithEveryType.ts, 86, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) + +var rg8 = a8 && a7; +>rg8 : Symbol(rg8, Decl(logicalAndOperatorWithEveryType.ts, 87, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) + +var rg9 = null && a7; +>rg9 : Symbol(rg9, Decl(logicalAndOperatorWithEveryType.ts, 88, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) + +var rg10 = undefined && a7; +>rg10 : Symbol(rg10, Decl(logicalAndOperatorWithEveryType.ts, 89, 3)) +>undefined : Symbol(undefined) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) + +var rh1 = a1 && a8; +>rh1 : Symbol(rh1, Decl(logicalAndOperatorWithEveryType.ts, 91, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) + +var rh2 = a2 && a8; +>rh2 : Symbol(rh2, Decl(logicalAndOperatorWithEveryType.ts, 92, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) + +var rh3 = a3 && a8; +>rh3 : Symbol(rh3, Decl(logicalAndOperatorWithEveryType.ts, 93, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) + +var rh4 = a4 && a8; +>rh4 : Symbol(rh4, Decl(logicalAndOperatorWithEveryType.ts, 94, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) + +var rh5 = a5 && a8; +>rh5 : Symbol(rh5, Decl(logicalAndOperatorWithEveryType.ts, 95, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) + +var rh6 = a6 && a8; +>rh6 : Symbol(rh6, Decl(logicalAndOperatorWithEveryType.ts, 96, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) + +var rh7 = a7 && a8; +>rh7 : Symbol(rh7, Decl(logicalAndOperatorWithEveryType.ts, 97, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) + +var rh8 = a8 && a8; +>rh8 : Symbol(rh8, Decl(logicalAndOperatorWithEveryType.ts, 98, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) + +var rh9 = null && a8; +>rh9 : Symbol(rh9, Decl(logicalAndOperatorWithEveryType.ts, 99, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) + +var rh10 = undefined && a8; +>rh10 : Symbol(rh10, Decl(logicalAndOperatorWithEveryType.ts, 100, 3)) +>undefined : Symbol(undefined) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) + +var ri1 = a1 && null; +>ri1 : Symbol(ri1, Decl(logicalAndOperatorWithEveryType.ts, 102, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) + +var ri2 = a2 && null; +>ri2 : Symbol(ri2, Decl(logicalAndOperatorWithEveryType.ts, 103, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) + +var ri3 = a3 && null; +>ri3 : Symbol(ri3, Decl(logicalAndOperatorWithEveryType.ts, 104, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) + +var ri4 = a4 && null; +>ri4 : Symbol(ri4, Decl(logicalAndOperatorWithEveryType.ts, 105, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) + +var ri5 = a5 && null; +>ri5 : Symbol(ri5, Decl(logicalAndOperatorWithEveryType.ts, 106, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) + +var ri6 = a6 && null; +>ri6 : Symbol(ri6, Decl(logicalAndOperatorWithEveryType.ts, 107, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) + +var ri7 = a7 && null; +>ri7 : Symbol(ri7, Decl(logicalAndOperatorWithEveryType.ts, 108, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) + +var ri8 = a8 && null; +>ri8 : Symbol(ri8, Decl(logicalAndOperatorWithEveryType.ts, 109, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) + +var ri9 = null && null; +>ri9 : Symbol(ri9, Decl(logicalAndOperatorWithEveryType.ts, 110, 3)) + +var ri10 = undefined && null; +>ri10 : Symbol(ri10, Decl(logicalAndOperatorWithEveryType.ts, 111, 3)) +>undefined : Symbol(undefined) + +var rj1 = a1 && undefined; +>rj1 : Symbol(rj1, Decl(logicalAndOperatorWithEveryType.ts, 113, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) +>undefined : Symbol(undefined) + +var rj2 = a2 && undefined; +>rj2 : Symbol(rj2, Decl(logicalAndOperatorWithEveryType.ts, 114, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) +>undefined : Symbol(undefined) + +var rj3 = a3 && undefined; +>rj3 : Symbol(rj3, Decl(logicalAndOperatorWithEveryType.ts, 115, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) +>undefined : Symbol(undefined) + +var rj4 = a4 && undefined; +>rj4 : Symbol(rj4, Decl(logicalAndOperatorWithEveryType.ts, 116, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) +>undefined : Symbol(undefined) + +var rj5 = a5 && undefined; +>rj5 : Symbol(rj5, Decl(logicalAndOperatorWithEveryType.ts, 117, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) +>undefined : Symbol(undefined) + +var rj6 = a6 && undefined; +>rj6 : Symbol(rj6, Decl(logicalAndOperatorWithEveryType.ts, 118, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) +>undefined : Symbol(undefined) + +var rj7 = a7 && undefined; +>rj7 : Symbol(rj7, Decl(logicalAndOperatorWithEveryType.ts, 119, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) +>undefined : Symbol(undefined) + +var rj8 = a8 && undefined; +>rj8 : Symbol(rj8, Decl(logicalAndOperatorWithEveryType.ts, 120, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) +>undefined : Symbol(undefined) + +var rj9 = null && undefined; +>rj9 : Symbol(rj9, Decl(logicalAndOperatorWithEveryType.ts, 121, 3)) +>undefined : Symbol(undefined) + +var rj10 = undefined && undefined; +>rj10 : Symbol(rj10, Decl(logicalAndOperatorWithEveryType.ts, 122, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/logicalAndOperatorWithEveryType.types b/tests/baselines/reference/logicalAndOperatorWithEveryType.types index 54f04926e98..bd913e94da5 100644 --- a/tests/baselines/reference/logicalAndOperatorWithEveryType.types +++ b/tests/baselines/reference/logicalAndOperatorWithEveryType.types @@ -84,6 +84,7 @@ var ra8 = a8 && a1; var ra9 = null && a1; >ra9 : any >null && a1 : any +>null : null >a1 : any var ra10 = undefined && a1; @@ -143,6 +144,7 @@ var rb8 = a8 && a2; var rb9 = null && a2; >rb9 : boolean >null && a2 : boolean +>null : null >a2 : boolean var rb10 = undefined && a2; @@ -202,6 +204,7 @@ var rc8 = a8 && a3; var rc9 = null && a3; >rc9 : number >null && a3 : number +>null : null >a3 : number var rc10 = undefined && a3; @@ -261,6 +264,7 @@ var rd8 = a8 && a4; var rd9 = null && a4; >rd9 : string >null && a4 : string +>null : null >a4 : string var rd10 = undefined && a4; @@ -320,6 +324,7 @@ var re8 = a8 && a5; var re9 = null && a5; >re9 : void >null && a5 : void +>null : null >a5 : void var re10 = undefined && a5; @@ -379,6 +384,7 @@ var rf8 = a8 && a6; var rf9 = null && a6; >rf9 : E >null && a6 : E +>null : null >a6 : E var rf10 = undefined && a6; @@ -438,6 +444,7 @@ var rg8 = a8 && a7; var rg9 = null && a7; >rg9 : {} >null && a7 : {} +>null : null >a7 : {} var rg10 = undefined && a7; @@ -497,6 +504,7 @@ var rh8 = a8 && a8; var rh9 = null && a8; >rh9 : string[] >null && a8 : string[] +>null : null >a8 : string[] var rh10 = undefined && a8; @@ -509,50 +517,61 @@ var ri1 = a1 && null; >ri1 : any >a1 && null : null >a1 : any +>null : null var ri2 = a2 && null; >ri2 : any >a2 && null : null >a2 : boolean +>null : null var ri3 = a3 && null; >ri3 : any >a3 && null : null >a3 : number +>null : null var ri4 = a4 && null; >ri4 : any >a4 && null : null >a4 : string +>null : null var ri5 = a5 && null; >ri5 : any >a5 && null : null >a5 : void +>null : null var ri6 = a6 && null; >ri6 : any >a6 && null : null >a6 : E +>null : null var ri7 = a7 && null; >ri7 : any >a7 && null : null >a7 : {} +>null : null var ri8 = a8 && null; >ri8 : any >a8 && null : null >a8 : string[] +>null : null var ri9 = null && null; >ri9 : any >null && null : null +>null : null +>null : null var ri10 = undefined && null; >ri10 : any >undefined && null : null >undefined : undefined +>null : null var rj1 = a1 && undefined; >rj1 : any @@ -605,6 +624,7 @@ var rj8 = a8 && undefined; var rj9 = null && undefined; >rj9 : any >null && undefined : undefined +>null : null >undefined : undefined var rj10 = undefined && undefined; diff --git a/tests/baselines/reference/logicalAndOperatorWithTypeParameters.symbols b/tests/baselines/reference/logicalAndOperatorWithTypeParameters.symbols new file mode 100644 index 00000000000..c64544ffe15 --- /dev/null +++ b/tests/baselines/reference/logicalAndOperatorWithTypeParameters.symbols @@ -0,0 +1,69 @@ +=== tests/cases/conformance/expressions/binaryOperators/logicalAndOperator/logicalAndOperatorWithTypeParameters.ts === +// The && operator permits the operands to be of any type and produces a result of the same +// type as the second operand. + +function foo(t: T, u: U, v: V) { +>foo : Symbol(foo, Decl(logicalAndOperatorWithTypeParameters.ts, 0, 0)) +>T : Symbol(T, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 13)) +>U : Symbol(U, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 15)) +>V : Symbol(V, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 18)) +>t : Symbol(t, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 36)) +>T : Symbol(T, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 13)) +>u : Symbol(u, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 41)) +>U : Symbol(U, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 15)) +>v : Symbol(v, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 47)) +>V : Symbol(V, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 18)) + + var r1 = t && t; +>r1 : Symbol(r1, Decl(logicalAndOperatorWithTypeParameters.ts, 4, 7)) +>t : Symbol(t, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 36)) +>t : Symbol(t, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 36)) + + var r2 = u && t; +>r2 : Symbol(r2, Decl(logicalAndOperatorWithTypeParameters.ts, 5, 7)) +>u : Symbol(u, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 41)) +>t : Symbol(t, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 36)) + + var r3 = v && t; +>r3 : Symbol(r3, Decl(logicalAndOperatorWithTypeParameters.ts, 6, 7)) +>v : Symbol(v, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 47)) +>t : Symbol(t, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 36)) + + var r4 = t && u; +>r4 : Symbol(r4, Decl(logicalAndOperatorWithTypeParameters.ts, 8, 7)) +>t : Symbol(t, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 36)) +>u : Symbol(u, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 41)) + + var r5 = u && u; +>r5 : Symbol(r5, Decl(logicalAndOperatorWithTypeParameters.ts, 9, 7)) +>u : Symbol(u, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 41)) +>u : Symbol(u, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 41)) + + var r6 = v && u; +>r6 : Symbol(r6, Decl(logicalAndOperatorWithTypeParameters.ts, 10, 7)) +>v : Symbol(v, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 47)) +>u : Symbol(u, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 41)) + + var r7 = t && v; +>r7 : Symbol(r7, Decl(logicalAndOperatorWithTypeParameters.ts, 12, 7)) +>t : Symbol(t, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 36)) +>v : Symbol(v, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 47)) + + var r8 = u && v; +>r8 : Symbol(r8, Decl(logicalAndOperatorWithTypeParameters.ts, 13, 7)) +>u : Symbol(u, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 41)) +>v : Symbol(v, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 47)) + + var r9 = v && v; +>r9 : Symbol(r9, Decl(logicalAndOperatorWithTypeParameters.ts, 14, 7)) +>v : Symbol(v, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 47)) +>v : Symbol(v, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 47)) + + var a: number; +>a : Symbol(a, Decl(logicalAndOperatorWithTypeParameters.ts, 16, 7)) + + var r10 = t && a; +>r10 : Symbol(r10, Decl(logicalAndOperatorWithTypeParameters.ts, 17, 7)) +>t : Symbol(t, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 36)) +>a : Symbol(a, Decl(logicalAndOperatorWithTypeParameters.ts, 16, 7)) +} diff --git a/tests/baselines/reference/logicalNotOperatorWithBooleanType.symbols b/tests/baselines/reference/logicalNotOperatorWithBooleanType.symbols new file mode 100644 index 00000000000..b42b9d7922e --- /dev/null +++ b/tests/baselines/reference/logicalNotOperatorWithBooleanType.symbols @@ -0,0 +1,89 @@ +=== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithBooleanType.ts === +// ! operator on boolean type +var BOOLEAN: boolean; +>BOOLEAN : Symbol(BOOLEAN, Decl(logicalNotOperatorWithBooleanType.ts, 1, 3)) + +function foo(): boolean { return true; } +>foo : Symbol(foo, Decl(logicalNotOperatorWithBooleanType.ts, 1, 21)) + +class A { +>A : Symbol(A, Decl(logicalNotOperatorWithBooleanType.ts, 3, 40)) + + public a: boolean; +>a : Symbol(a, Decl(logicalNotOperatorWithBooleanType.ts, 5, 9)) + + static foo() { return false; } +>foo : Symbol(A.foo, Decl(logicalNotOperatorWithBooleanType.ts, 6, 22)) +} +module M { +>M : Symbol(M, Decl(logicalNotOperatorWithBooleanType.ts, 8, 1)) + + export var n: boolean; +>n : Symbol(n, Decl(logicalNotOperatorWithBooleanType.ts, 10, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(logicalNotOperatorWithBooleanType.ts, 13, 3)) +>A : Symbol(A, Decl(logicalNotOperatorWithBooleanType.ts, 3, 40)) + +// boolean type var +var ResultIsBoolean1 = !BOOLEAN; +>ResultIsBoolean1 : Symbol(ResultIsBoolean1, Decl(logicalNotOperatorWithBooleanType.ts, 16, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(logicalNotOperatorWithBooleanType.ts, 1, 3)) + +// boolean type literal +var ResultIsBoolean2 = !true; +>ResultIsBoolean2 : Symbol(ResultIsBoolean2, Decl(logicalNotOperatorWithBooleanType.ts, 19, 3)) + +var ResultIsBoolean3 = !{ x: true, y: false }; +>ResultIsBoolean3 : Symbol(ResultIsBoolean3, Decl(logicalNotOperatorWithBooleanType.ts, 20, 3)) +>x : Symbol(x, Decl(logicalNotOperatorWithBooleanType.ts, 20, 25)) +>y : Symbol(y, Decl(logicalNotOperatorWithBooleanType.ts, 20, 34)) + +// boolean type expressions +var ResultIsBoolean4 = !objA.a; +>ResultIsBoolean4 : Symbol(ResultIsBoolean4, Decl(logicalNotOperatorWithBooleanType.ts, 23, 3)) +>objA.a : Symbol(A.a, Decl(logicalNotOperatorWithBooleanType.ts, 5, 9)) +>objA : Symbol(objA, Decl(logicalNotOperatorWithBooleanType.ts, 13, 3)) +>a : Symbol(A.a, Decl(logicalNotOperatorWithBooleanType.ts, 5, 9)) + +var ResultIsBoolean5 = !M.n; +>ResultIsBoolean5 : Symbol(ResultIsBoolean5, Decl(logicalNotOperatorWithBooleanType.ts, 24, 3)) +>M.n : Symbol(M.n, Decl(logicalNotOperatorWithBooleanType.ts, 10, 14)) +>M : Symbol(M, Decl(logicalNotOperatorWithBooleanType.ts, 8, 1)) +>n : Symbol(M.n, Decl(logicalNotOperatorWithBooleanType.ts, 10, 14)) + +var ResultIsBoolean6 = !foo(); +>ResultIsBoolean6 : Symbol(ResultIsBoolean6, Decl(logicalNotOperatorWithBooleanType.ts, 25, 3)) +>foo : Symbol(foo, Decl(logicalNotOperatorWithBooleanType.ts, 1, 21)) + +var ResultIsBoolean7 = !A.foo(); +>ResultIsBoolean7 : Symbol(ResultIsBoolean7, Decl(logicalNotOperatorWithBooleanType.ts, 26, 3)) +>A.foo : Symbol(A.foo, Decl(logicalNotOperatorWithBooleanType.ts, 6, 22)) +>A : Symbol(A, Decl(logicalNotOperatorWithBooleanType.ts, 3, 40)) +>foo : Symbol(A.foo, Decl(logicalNotOperatorWithBooleanType.ts, 6, 22)) + +// multiple ! operators +var ResultIsBoolean = !!BOOLEAN; +>ResultIsBoolean : Symbol(ResultIsBoolean, Decl(logicalNotOperatorWithBooleanType.ts, 29, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(logicalNotOperatorWithBooleanType.ts, 1, 3)) + +// miss assignment operators +!true; +!BOOLEAN; +>BOOLEAN : Symbol(BOOLEAN, Decl(logicalNotOperatorWithBooleanType.ts, 1, 3)) + +!foo(); +>foo : Symbol(foo, Decl(logicalNotOperatorWithBooleanType.ts, 1, 21)) + +!true, false; +!objA.a; +>objA.a : Symbol(A.a, Decl(logicalNotOperatorWithBooleanType.ts, 5, 9)) +>objA : Symbol(objA, Decl(logicalNotOperatorWithBooleanType.ts, 13, 3)) +>a : Symbol(A.a, Decl(logicalNotOperatorWithBooleanType.ts, 5, 9)) + +!M.n; +>M.n : Symbol(M.n, Decl(logicalNotOperatorWithBooleanType.ts, 10, 14)) +>M : Symbol(M, Decl(logicalNotOperatorWithBooleanType.ts, 8, 1)) +>n : Symbol(M.n, Decl(logicalNotOperatorWithBooleanType.ts, 10, 14)) + diff --git a/tests/baselines/reference/logicalNotOperatorWithBooleanType.types b/tests/baselines/reference/logicalNotOperatorWithBooleanType.types index e232ae2af80..b8aa6feac4c 100644 --- a/tests/baselines/reference/logicalNotOperatorWithBooleanType.types +++ b/tests/baselines/reference/logicalNotOperatorWithBooleanType.types @@ -5,6 +5,7 @@ var BOOLEAN: boolean; function foo(): boolean { return true; } >foo : () => boolean +>true : boolean class A { >A : A @@ -14,6 +15,7 @@ class A { static foo() { return false; } >foo : () => boolean +>false : boolean } module M { >M : typeof M @@ -37,13 +39,16 @@ var ResultIsBoolean1 = !BOOLEAN; var ResultIsBoolean2 = !true; >ResultIsBoolean2 : boolean >!true : boolean +>true : boolean var ResultIsBoolean3 = !{ x: true, y: false }; >ResultIsBoolean3 : boolean >!{ x: true, y: false } : boolean >{ x: true, y: false } : { x: boolean; y: boolean; } >x : boolean +>true : boolean >y : boolean +>false : boolean // boolean type expressions var ResultIsBoolean4 = !objA.a; @@ -84,6 +89,7 @@ var ResultIsBoolean = !!BOOLEAN; // miss assignment operators !true; >!true : boolean +>true : boolean !BOOLEAN; >!BOOLEAN : boolean @@ -97,6 +103,8 @@ var ResultIsBoolean = !!BOOLEAN; !true, false; >!true, false : boolean >!true : boolean +>true : boolean +>false : boolean !objA.a; >!objA.a : boolean diff --git a/tests/baselines/reference/logicalNotOperatorWithEnumType.symbols b/tests/baselines/reference/logicalNotOperatorWithEnumType.symbols new file mode 100644 index 00000000000..5f4dee7a3ea --- /dev/null +++ b/tests/baselines/reference/logicalNotOperatorWithEnumType.symbols @@ -0,0 +1,60 @@ +=== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithEnumType.ts === +// ! operator on enum type + +enum ENUM { A, B, C }; +>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0)) +>A : Symbol(ENUM.A, Decl(logicalNotOperatorWithEnumType.ts, 2, 11)) +>B : Symbol(ENUM.B, Decl(logicalNotOperatorWithEnumType.ts, 2, 14)) +>C : Symbol(ENUM.C, Decl(logicalNotOperatorWithEnumType.ts, 2, 17)) + +enum ENUM1 { }; +>ENUM1 : Symbol(ENUM1, Decl(logicalNotOperatorWithEnumType.ts, 2, 22)) + +// enum type var +var ResultIsBoolean1 = !ENUM; +>ResultIsBoolean1 : Symbol(ResultIsBoolean1, Decl(logicalNotOperatorWithEnumType.ts, 6, 3)) +>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0)) + +// enum type expressions +var ResultIsBoolean2 = !ENUM["B"]; +>ResultIsBoolean2 : Symbol(ResultIsBoolean2, Decl(logicalNotOperatorWithEnumType.ts, 9, 3)) +>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0)) +>"B" : Symbol(ENUM.B, Decl(logicalNotOperatorWithEnumType.ts, 2, 14)) + +var ResultIsBoolean3 = !(ENUM.B + ENUM["C"]); +>ResultIsBoolean3 : Symbol(ResultIsBoolean3, Decl(logicalNotOperatorWithEnumType.ts, 10, 3)) +>ENUM.B : Symbol(ENUM.B, Decl(logicalNotOperatorWithEnumType.ts, 2, 14)) +>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0)) +>B : Symbol(ENUM.B, Decl(logicalNotOperatorWithEnumType.ts, 2, 14)) +>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0)) +>"C" : Symbol(ENUM.C, Decl(logicalNotOperatorWithEnumType.ts, 2, 17)) + +// multiple ! operators +var ResultIsBoolean4 = !!ENUM; +>ResultIsBoolean4 : Symbol(ResultIsBoolean4, Decl(logicalNotOperatorWithEnumType.ts, 13, 3)) +>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0)) + +var ResultIsBoolean5 = !!!(ENUM["B"] + ENUM.C); +>ResultIsBoolean5 : Symbol(ResultIsBoolean5, Decl(logicalNotOperatorWithEnumType.ts, 14, 3)) +>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0)) +>"B" : Symbol(ENUM.B, Decl(logicalNotOperatorWithEnumType.ts, 2, 14)) +>ENUM.C : Symbol(ENUM.C, Decl(logicalNotOperatorWithEnumType.ts, 2, 17)) +>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0)) +>C : Symbol(ENUM.C, Decl(logicalNotOperatorWithEnumType.ts, 2, 17)) + +// miss assignment operators +!ENUM; +>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0)) + +!ENUM1; +>ENUM1 : Symbol(ENUM1, Decl(logicalNotOperatorWithEnumType.ts, 2, 22)) + +!ENUM.B; +>ENUM.B : Symbol(ENUM.B, Decl(logicalNotOperatorWithEnumType.ts, 2, 14)) +>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0)) +>B : Symbol(ENUM.B, Decl(logicalNotOperatorWithEnumType.ts, 2, 14)) + +!ENUM, ENUM1; +>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0)) +>ENUM1 : Symbol(ENUM1, Decl(logicalNotOperatorWithEnumType.ts, 2, 22)) + diff --git a/tests/baselines/reference/logicalNotOperatorWithEnumType.types b/tests/baselines/reference/logicalNotOperatorWithEnumType.types index f3c9d98c95b..5d57916ceaa 100644 --- a/tests/baselines/reference/logicalNotOperatorWithEnumType.types +++ b/tests/baselines/reference/logicalNotOperatorWithEnumType.types @@ -22,6 +22,7 @@ var ResultIsBoolean2 = !ENUM["B"]; >!ENUM["B"] : boolean >ENUM["B"] : ENUM >ENUM : typeof ENUM +>"B" : string var ResultIsBoolean3 = !(ENUM.B + ENUM["C"]); >ResultIsBoolean3 : boolean @@ -33,6 +34,7 @@ var ResultIsBoolean3 = !(ENUM.B + ENUM["C"]); >B : ENUM >ENUM["C"] : ENUM >ENUM : typeof ENUM +>"C" : string // multiple ! operators var ResultIsBoolean4 = !!ENUM; @@ -50,6 +52,7 @@ var ResultIsBoolean5 = !!!(ENUM["B"] + ENUM.C); >ENUM["B"] + ENUM.C : number >ENUM["B"] : ENUM >ENUM : typeof ENUM +>"B" : string >ENUM.C : ENUM >ENUM : typeof ENUM >C : ENUM diff --git a/tests/baselines/reference/logicalNotOperatorWithNumberType.symbols b/tests/baselines/reference/logicalNotOperatorWithNumberType.symbols new file mode 100644 index 00000000000..4f277a8db54 --- /dev/null +++ b/tests/baselines/reference/logicalNotOperatorWithNumberType.symbols @@ -0,0 +1,127 @@ +=== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithNumberType.ts === +// ! operator on number type +var NUMBER: number; +>NUMBER : Symbol(NUMBER, Decl(logicalNotOperatorWithNumberType.ts, 1, 3)) + +var NUMBER1: number[] = [1, 2]; +>NUMBER1 : Symbol(NUMBER1, Decl(logicalNotOperatorWithNumberType.ts, 2, 3)) + +function foo(): number { return 1; } +>foo : Symbol(foo, Decl(logicalNotOperatorWithNumberType.ts, 2, 31)) + +class A { +>A : Symbol(A, Decl(logicalNotOperatorWithNumberType.ts, 4, 36)) + + public a: number; +>a : Symbol(a, Decl(logicalNotOperatorWithNumberType.ts, 6, 9)) + + static foo() { return 1; } +>foo : Symbol(A.foo, Decl(logicalNotOperatorWithNumberType.ts, 7, 21)) +} +module M { +>M : Symbol(M, Decl(logicalNotOperatorWithNumberType.ts, 9, 1)) + + export var n: number; +>n : Symbol(n, Decl(logicalNotOperatorWithNumberType.ts, 11, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(logicalNotOperatorWithNumberType.ts, 14, 3)) +>A : Symbol(A, Decl(logicalNotOperatorWithNumberType.ts, 4, 36)) + +// number type var +var ResultIsBoolean1 = !NUMBER; +>ResultIsBoolean1 : Symbol(ResultIsBoolean1, Decl(logicalNotOperatorWithNumberType.ts, 17, 3)) +>NUMBER : Symbol(NUMBER, Decl(logicalNotOperatorWithNumberType.ts, 1, 3)) + +var ResultIsBoolean2 = !NUMBER1; +>ResultIsBoolean2 : Symbol(ResultIsBoolean2, Decl(logicalNotOperatorWithNumberType.ts, 18, 3)) +>NUMBER1 : Symbol(NUMBER1, Decl(logicalNotOperatorWithNumberType.ts, 2, 3)) + +// number type literal +var ResultIsBoolean3 = !1; +>ResultIsBoolean3 : Symbol(ResultIsBoolean3, Decl(logicalNotOperatorWithNumberType.ts, 21, 3)) + +var ResultIsBoolean4 = !{ x: 1, y: 2}; +>ResultIsBoolean4 : Symbol(ResultIsBoolean4, Decl(logicalNotOperatorWithNumberType.ts, 22, 3)) +>x : Symbol(x, Decl(logicalNotOperatorWithNumberType.ts, 22, 25)) +>y : Symbol(y, Decl(logicalNotOperatorWithNumberType.ts, 22, 31)) + +var ResultIsBoolean5 = !{ x: 1, y: (n: number) => { return n; } }; +>ResultIsBoolean5 : Symbol(ResultIsBoolean5, Decl(logicalNotOperatorWithNumberType.ts, 23, 3)) +>x : Symbol(x, Decl(logicalNotOperatorWithNumberType.ts, 23, 25)) +>y : Symbol(y, Decl(logicalNotOperatorWithNumberType.ts, 23, 31)) +>n : Symbol(n, Decl(logicalNotOperatorWithNumberType.ts, 23, 36)) +>n : Symbol(n, Decl(logicalNotOperatorWithNumberType.ts, 23, 36)) + +// number type expressions +var ResultIsBoolean6 = !objA.a; +>ResultIsBoolean6 : Symbol(ResultIsBoolean6, Decl(logicalNotOperatorWithNumberType.ts, 26, 3)) +>objA.a : Symbol(A.a, Decl(logicalNotOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(logicalNotOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(logicalNotOperatorWithNumberType.ts, 6, 9)) + +var ResultIsBoolean7 = !M.n; +>ResultIsBoolean7 : Symbol(ResultIsBoolean7, Decl(logicalNotOperatorWithNumberType.ts, 27, 3)) +>M.n : Symbol(M.n, Decl(logicalNotOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(logicalNotOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(logicalNotOperatorWithNumberType.ts, 11, 14)) + +var ResultIsBoolean8 = !NUMBER1[0]; +>ResultIsBoolean8 : Symbol(ResultIsBoolean8, Decl(logicalNotOperatorWithNumberType.ts, 28, 3)) +>NUMBER1 : Symbol(NUMBER1, Decl(logicalNotOperatorWithNumberType.ts, 2, 3)) + +var ResultIsBoolean9 = !foo(); +>ResultIsBoolean9 : Symbol(ResultIsBoolean9, Decl(logicalNotOperatorWithNumberType.ts, 29, 3)) +>foo : Symbol(foo, Decl(logicalNotOperatorWithNumberType.ts, 2, 31)) + +var ResultIsBoolean10 = !A.foo(); +>ResultIsBoolean10 : Symbol(ResultIsBoolean10, Decl(logicalNotOperatorWithNumberType.ts, 30, 3)) +>A.foo : Symbol(A.foo, Decl(logicalNotOperatorWithNumberType.ts, 7, 21)) +>A : Symbol(A, Decl(logicalNotOperatorWithNumberType.ts, 4, 36)) +>foo : Symbol(A.foo, Decl(logicalNotOperatorWithNumberType.ts, 7, 21)) + +var ResultIsBoolean11 = !(NUMBER + NUMBER); +>ResultIsBoolean11 : Symbol(ResultIsBoolean11, Decl(logicalNotOperatorWithNumberType.ts, 31, 3)) +>NUMBER : Symbol(NUMBER, Decl(logicalNotOperatorWithNumberType.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(logicalNotOperatorWithNumberType.ts, 1, 3)) + +// multiple ! operator +var ResultIsBoolean12 = !!NUMBER; +>ResultIsBoolean12 : Symbol(ResultIsBoolean12, Decl(logicalNotOperatorWithNumberType.ts, 34, 3)) +>NUMBER : Symbol(NUMBER, Decl(logicalNotOperatorWithNumberType.ts, 1, 3)) + +var ResultIsBoolean13 = !!!(NUMBER + NUMBER); +>ResultIsBoolean13 : Symbol(ResultIsBoolean13, Decl(logicalNotOperatorWithNumberType.ts, 35, 3)) +>NUMBER : Symbol(NUMBER, Decl(logicalNotOperatorWithNumberType.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(logicalNotOperatorWithNumberType.ts, 1, 3)) + +// miss assignment operators +!1; +!NUMBER; +>NUMBER : Symbol(NUMBER, Decl(logicalNotOperatorWithNumberType.ts, 1, 3)) + +!NUMBER1; +>NUMBER1 : Symbol(NUMBER1, Decl(logicalNotOperatorWithNumberType.ts, 2, 3)) + +!foo(); +>foo : Symbol(foo, Decl(logicalNotOperatorWithNumberType.ts, 2, 31)) + +!objA.a; +>objA.a : Symbol(A.a, Decl(logicalNotOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(logicalNotOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(logicalNotOperatorWithNumberType.ts, 6, 9)) + +!M.n; +>M.n : Symbol(M.n, Decl(logicalNotOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(logicalNotOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(logicalNotOperatorWithNumberType.ts, 11, 14)) + +!objA.a, M.n; +>objA.a : Symbol(A.a, Decl(logicalNotOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(logicalNotOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(logicalNotOperatorWithNumberType.ts, 6, 9)) +>M.n : Symbol(M.n, Decl(logicalNotOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(logicalNotOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(logicalNotOperatorWithNumberType.ts, 11, 14)) + diff --git a/tests/baselines/reference/logicalNotOperatorWithNumberType.types b/tests/baselines/reference/logicalNotOperatorWithNumberType.types index 4bcc8a14041..6b7ce5b6088 100644 --- a/tests/baselines/reference/logicalNotOperatorWithNumberType.types +++ b/tests/baselines/reference/logicalNotOperatorWithNumberType.types @@ -6,9 +6,12 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] +>1 : number +>2 : number function foo(): number { return 1; } >foo : () => number +>1 : number class A { >A : A @@ -18,6 +21,7 @@ class A { static foo() { return 1; } >foo : () => number +>1 : number } module M { >M : typeof M @@ -46,19 +50,23 @@ var ResultIsBoolean2 = !NUMBER1; var ResultIsBoolean3 = !1; >ResultIsBoolean3 : boolean >!1 : boolean +>1 : number var ResultIsBoolean4 = !{ x: 1, y: 2}; >ResultIsBoolean4 : boolean >!{ x: 1, y: 2} : boolean >{ x: 1, y: 2} : { x: number; y: number; } >x : number +>1 : number >y : number +>2 : number var ResultIsBoolean5 = !{ x: 1, y: (n: number) => { return n; } }; >ResultIsBoolean5 : boolean >!{ x: 1, y: (n: number) => { return n; } } : boolean >{ x: 1, y: (n: number) => { return n; } } : { x: number; y: (n: number) => number; } >x : number +>1 : number >y : (n: number) => number >(n: number) => { return n; } : (n: number) => number >n : number @@ -84,6 +92,7 @@ var ResultIsBoolean8 = !NUMBER1[0]; >!NUMBER1[0] : boolean >NUMBER1[0] : number >NUMBER1 : number[] +>0 : number var ResultIsBoolean9 = !foo(); >ResultIsBoolean9 : boolean @@ -127,6 +136,7 @@ var ResultIsBoolean13 = !!!(NUMBER + NUMBER); // miss assignment operators !1; >!1 : boolean +>1 : number !NUMBER; >!NUMBER : boolean diff --git a/tests/baselines/reference/logicalNotOperatorWithStringType.symbols b/tests/baselines/reference/logicalNotOperatorWithStringType.symbols new file mode 100644 index 00000000000..ff266361321 --- /dev/null +++ b/tests/baselines/reference/logicalNotOperatorWithStringType.symbols @@ -0,0 +1,123 @@ +=== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithStringType.ts === +// ! operator on string type +var STRING: string; +>STRING : Symbol(STRING, Decl(logicalNotOperatorWithStringType.ts, 1, 3)) + +var STRING1: string[] = ["", "abc"]; +>STRING1 : Symbol(STRING1, Decl(logicalNotOperatorWithStringType.ts, 2, 3)) + +function foo(): string { return "abc"; } +>foo : Symbol(foo, Decl(logicalNotOperatorWithStringType.ts, 2, 36)) + +class A { +>A : Symbol(A, Decl(logicalNotOperatorWithStringType.ts, 4, 40)) + + public a: string; +>a : Symbol(a, Decl(logicalNotOperatorWithStringType.ts, 6, 9)) + + static foo() { return ""; } +>foo : Symbol(A.foo, Decl(logicalNotOperatorWithStringType.ts, 7, 21)) +} +module M { +>M : Symbol(M, Decl(logicalNotOperatorWithStringType.ts, 9, 1)) + + export var n: string; +>n : Symbol(n, Decl(logicalNotOperatorWithStringType.ts, 11, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(logicalNotOperatorWithStringType.ts, 14, 3)) +>A : Symbol(A, Decl(logicalNotOperatorWithStringType.ts, 4, 40)) + +// string type var +var ResultIsBoolean1 = !STRING; +>ResultIsBoolean1 : Symbol(ResultIsBoolean1, Decl(logicalNotOperatorWithStringType.ts, 17, 3)) +>STRING : Symbol(STRING, Decl(logicalNotOperatorWithStringType.ts, 1, 3)) + +var ResultIsBoolean2 = !STRING1; +>ResultIsBoolean2 : Symbol(ResultIsBoolean2, Decl(logicalNotOperatorWithStringType.ts, 18, 3)) +>STRING1 : Symbol(STRING1, Decl(logicalNotOperatorWithStringType.ts, 2, 3)) + +// string type literal +var ResultIsBoolean3 = !""; +>ResultIsBoolean3 : Symbol(ResultIsBoolean3, Decl(logicalNotOperatorWithStringType.ts, 21, 3)) + +var ResultIsBoolean4 = !{ x: "", y: "" }; +>ResultIsBoolean4 : Symbol(ResultIsBoolean4, Decl(logicalNotOperatorWithStringType.ts, 22, 3)) +>x : Symbol(x, Decl(logicalNotOperatorWithStringType.ts, 22, 25)) +>y : Symbol(y, Decl(logicalNotOperatorWithStringType.ts, 22, 32)) + +var ResultIsBoolean5 = !{ x: "", y: (s: string) => { return s; } }; +>ResultIsBoolean5 : Symbol(ResultIsBoolean5, Decl(logicalNotOperatorWithStringType.ts, 23, 3)) +>x : Symbol(x, Decl(logicalNotOperatorWithStringType.ts, 23, 25)) +>y : Symbol(y, Decl(logicalNotOperatorWithStringType.ts, 23, 32)) +>s : Symbol(s, Decl(logicalNotOperatorWithStringType.ts, 23, 37)) +>s : Symbol(s, Decl(logicalNotOperatorWithStringType.ts, 23, 37)) + +// string type expressions +var ResultIsBoolean6 = !objA.a; +>ResultIsBoolean6 : Symbol(ResultIsBoolean6, Decl(logicalNotOperatorWithStringType.ts, 26, 3)) +>objA.a : Symbol(A.a, Decl(logicalNotOperatorWithStringType.ts, 6, 9)) +>objA : Symbol(objA, Decl(logicalNotOperatorWithStringType.ts, 14, 3)) +>a : Symbol(A.a, Decl(logicalNotOperatorWithStringType.ts, 6, 9)) + +var ResultIsBoolean7 = !M.n; +>ResultIsBoolean7 : Symbol(ResultIsBoolean7, Decl(logicalNotOperatorWithStringType.ts, 27, 3)) +>M.n : Symbol(M.n, Decl(logicalNotOperatorWithStringType.ts, 11, 14)) +>M : Symbol(M, Decl(logicalNotOperatorWithStringType.ts, 9, 1)) +>n : Symbol(M.n, Decl(logicalNotOperatorWithStringType.ts, 11, 14)) + +var ResultIsBoolean8 = !STRING1[0]; +>ResultIsBoolean8 : Symbol(ResultIsBoolean8, Decl(logicalNotOperatorWithStringType.ts, 28, 3)) +>STRING1 : Symbol(STRING1, Decl(logicalNotOperatorWithStringType.ts, 2, 3)) + +var ResultIsBoolean9 = !foo(); +>ResultIsBoolean9 : Symbol(ResultIsBoolean9, Decl(logicalNotOperatorWithStringType.ts, 29, 3)) +>foo : Symbol(foo, Decl(logicalNotOperatorWithStringType.ts, 2, 36)) + +var ResultIsBoolean10 = !A.foo(); +>ResultIsBoolean10 : Symbol(ResultIsBoolean10, Decl(logicalNotOperatorWithStringType.ts, 30, 3)) +>A.foo : Symbol(A.foo, Decl(logicalNotOperatorWithStringType.ts, 7, 21)) +>A : Symbol(A, Decl(logicalNotOperatorWithStringType.ts, 4, 40)) +>foo : Symbol(A.foo, Decl(logicalNotOperatorWithStringType.ts, 7, 21)) + +var ResultIsBoolean11 = !(STRING + STRING); +>ResultIsBoolean11 : Symbol(ResultIsBoolean11, Decl(logicalNotOperatorWithStringType.ts, 31, 3)) +>STRING : Symbol(STRING, Decl(logicalNotOperatorWithStringType.ts, 1, 3)) +>STRING : Symbol(STRING, Decl(logicalNotOperatorWithStringType.ts, 1, 3)) + +var ResultIsBoolean12 = !STRING.charAt(0); +>ResultIsBoolean12 : Symbol(ResultIsBoolean12, Decl(logicalNotOperatorWithStringType.ts, 32, 3)) +>STRING.charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>STRING : Symbol(STRING, Decl(logicalNotOperatorWithStringType.ts, 1, 3)) +>charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) + +// multiple ! operator +var ResultIsBoolean13 = !!STRING; +>ResultIsBoolean13 : Symbol(ResultIsBoolean13, Decl(logicalNotOperatorWithStringType.ts, 35, 3)) +>STRING : Symbol(STRING, Decl(logicalNotOperatorWithStringType.ts, 1, 3)) + +var ResultIsBoolean14 = !!!(STRING + STRING); +>ResultIsBoolean14 : Symbol(ResultIsBoolean14, Decl(logicalNotOperatorWithStringType.ts, 36, 3)) +>STRING : Symbol(STRING, Decl(logicalNotOperatorWithStringType.ts, 1, 3)) +>STRING : Symbol(STRING, Decl(logicalNotOperatorWithStringType.ts, 1, 3)) + +// miss assignment operators +!""; +!STRING; +>STRING : Symbol(STRING, Decl(logicalNotOperatorWithStringType.ts, 1, 3)) + +!STRING1; +>STRING1 : Symbol(STRING1, Decl(logicalNotOperatorWithStringType.ts, 2, 3)) + +!foo(); +>foo : Symbol(foo, Decl(logicalNotOperatorWithStringType.ts, 2, 36)) + +!objA.a,M.n; +>objA.a : Symbol(A.a, Decl(logicalNotOperatorWithStringType.ts, 6, 9)) +>objA : Symbol(objA, Decl(logicalNotOperatorWithStringType.ts, 14, 3)) +>a : Symbol(A.a, Decl(logicalNotOperatorWithStringType.ts, 6, 9)) +>M.n : Symbol(M.n, Decl(logicalNotOperatorWithStringType.ts, 11, 14)) +>M : Symbol(M, Decl(logicalNotOperatorWithStringType.ts, 9, 1)) +>n : Symbol(M.n, Decl(logicalNotOperatorWithStringType.ts, 11, 14)) + diff --git a/tests/baselines/reference/logicalNotOperatorWithStringType.types b/tests/baselines/reference/logicalNotOperatorWithStringType.types index 2decb1ade18..5ca820ea6d0 100644 --- a/tests/baselines/reference/logicalNotOperatorWithStringType.types +++ b/tests/baselines/reference/logicalNotOperatorWithStringType.types @@ -6,9 +6,12 @@ var STRING: string; var STRING1: string[] = ["", "abc"]; >STRING1 : string[] >["", "abc"] : string[] +>"" : string +>"abc" : string function foo(): string { return "abc"; } >foo : () => string +>"abc" : string class A { >A : A @@ -18,6 +21,7 @@ class A { static foo() { return ""; } >foo : () => string +>"" : string } module M { >M : typeof M @@ -46,19 +50,23 @@ var ResultIsBoolean2 = !STRING1; var ResultIsBoolean3 = !""; >ResultIsBoolean3 : boolean >!"" : boolean +>"" : string var ResultIsBoolean4 = !{ x: "", y: "" }; >ResultIsBoolean4 : boolean >!{ x: "", y: "" } : boolean >{ x: "", y: "" } : { x: string; y: string; } >x : string +>"" : string >y : string +>"" : string var ResultIsBoolean5 = !{ x: "", y: (s: string) => { return s; } }; >ResultIsBoolean5 : boolean >!{ x: "", y: (s: string) => { return s; } } : boolean >{ x: "", y: (s: string) => { return s; } } : { x: string; y: (s: string) => string; } >x : string +>"" : string >y : (s: string) => string >(s: string) => { return s; } : (s: string) => string >s : string @@ -84,6 +92,7 @@ var ResultIsBoolean8 = !STRING1[0]; >!STRING1[0] : boolean >STRING1[0] : string >STRING1 : string[] +>0 : number var ResultIsBoolean9 = !foo(); >ResultIsBoolean9 : boolean @@ -114,6 +123,7 @@ var ResultIsBoolean12 = !STRING.charAt(0); >STRING.charAt : (pos: number) => string >STRING : string >charAt : (pos: number) => string +>0 : number // multiple ! operator var ResultIsBoolean13 = !!STRING; @@ -135,6 +145,7 @@ var ResultIsBoolean14 = !!!(STRING + STRING); // miss assignment operators !""; >!"" : boolean +>"" : string !STRING; >!STRING : boolean diff --git a/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.symbols b/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.symbols new file mode 100644 index 00000000000..90fc4ac163c --- /dev/null +++ b/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/expressions/binaryOperators/logicalOrOperator/logicalOrExpressionIsContextuallyTyped.ts === +// The || operator permits the operands to be of any type. +// 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: string } = { a: '', b: 123 } || { a: '', b: true }; +>r : Symbol(r, Decl(logicalOrExpressionIsContextuallyTyped.ts, 5, 3)) +>a : Symbol(a, Decl(logicalOrExpressionIsContextuallyTyped.ts, 5, 8)) +>a : Symbol(a, Decl(logicalOrExpressionIsContextuallyTyped.ts, 5, 24)) +>b : Symbol(b, Decl(logicalOrExpressionIsContextuallyTyped.ts, 5, 31)) +>a : Symbol(a, Decl(logicalOrExpressionIsContextuallyTyped.ts, 5, 45)) +>b : Symbol(b, Decl(logicalOrExpressionIsContextuallyTyped.ts, 5, 52)) + diff --git a/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.types b/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.types index 95c9643c29a..52315226bb6 100644 --- a/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.types +++ b/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.types @@ -10,8 +10,12 @@ var r: { a: string } = { a: '', b: 123 } || { a: '', b: true }; >{ a: '', b: 123 } || { a: '', b: true } : { a: string; b: number; } | { a: string; b: boolean; } >{ a: '', b: 123 } : { a: string; b: number; } >a : string +>'' : string >b : number +>123 : number >{ a: '', b: true } : { a: string; b: boolean; } >a : string +>'' : string >b : boolean +>true : boolean diff --git a/tests/baselines/reference/logicalOrExpressionIsNotContextuallyTyped.symbols b/tests/baselines/reference/logicalOrExpressionIsNotContextuallyTyped.symbols new file mode 100644 index 00000000000..6cfbf7ea6b6 --- /dev/null +++ b/tests/baselines/reference/logicalOrExpressionIsNotContextuallyTyped.symbols @@ -0,0 +1,20 @@ +=== tests/cases/conformance/expressions/binaryOperators/logicalOrOperator/logicalOrExpressionIsNotContextuallyTyped.ts === +// The || operator permits the operands to be of any type. +// If the || expression is not contextually typed, the right operand is contextually typed +// by the type of the left operand and the result is of the best common type of the two +// operand types. + + +var a: (a: string) => string; +>a : Symbol(a, Decl(logicalOrExpressionIsNotContextuallyTyped.ts, 6, 3)) +>a : Symbol(a, Decl(logicalOrExpressionIsNotContextuallyTyped.ts, 6, 8)) + +// bug 786110 +var r = a || ((a) => a.toLowerCase()); +>r : Symbol(r, Decl(logicalOrExpressionIsNotContextuallyTyped.ts, 9, 3)) +>a : Symbol(a, Decl(logicalOrExpressionIsNotContextuallyTyped.ts, 6, 3)) +>a : Symbol(a, Decl(logicalOrExpressionIsNotContextuallyTyped.ts, 9, 15)) +>a.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, 399, 51)) +>a : Symbol(a, Decl(logicalOrExpressionIsNotContextuallyTyped.ts, 9, 15)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, 399, 51)) + diff --git a/tests/baselines/reference/logicalOrOperatorWithEveryType.symbols b/tests/baselines/reference/logicalOrOperatorWithEveryType.symbols new file mode 100644 index 00000000000..df2084351df --- /dev/null +++ b/tests/baselines/reference/logicalOrOperatorWithEveryType.symbols @@ -0,0 +1,518 @@ +=== tests/cases/conformance/expressions/binaryOperators/logicalOrOperator/logicalOrOperatorWithEveryType.ts === +// The || operator permits the operands to be of any type. +// If the || expression is not contextually typed, the right operand is contextually typed +// by the type of the left operand and the result is of the best common type of the two +// operand types. + +enum E { a, b, c } +>E : Symbol(E, Decl(logicalOrOperatorWithEveryType.ts, 0, 0)) +>a : Symbol(E.a, Decl(logicalOrOperatorWithEveryType.ts, 5, 8)) +>b : Symbol(E.b, Decl(logicalOrOperatorWithEveryType.ts, 5, 11)) +>c : Symbol(E.c, Decl(logicalOrOperatorWithEveryType.ts, 5, 14)) + +var a1: any; +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) + +var a2: boolean; +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) + +var a3: number +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) + +var a4: string; +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) + +var a5: void; +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) + +var a6: E; +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) +>E : Symbol(E, Decl(logicalOrOperatorWithEveryType.ts, 0, 0)) + +var a7: {a: string}; +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) +>a : Symbol(a, Decl(logicalOrOperatorWithEveryType.ts, 13, 9)) + +var a8: string[]; +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) + +var ra1 = a1 || a1; // any || any is any +>ra1 : Symbol(ra1, Decl(logicalOrOperatorWithEveryType.ts, 16, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) + +var ra2 = a2 || a1; // boolean || any is any +>ra2 : Symbol(ra2, Decl(logicalOrOperatorWithEveryType.ts, 17, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) + +var ra3 = a3 || a1; // number || any is any +>ra3 : Symbol(ra3, Decl(logicalOrOperatorWithEveryType.ts, 18, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) + +var ra4 = a4 || a1; // string || any is any +>ra4 : Symbol(ra4, Decl(logicalOrOperatorWithEveryType.ts, 19, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) + +var ra5 = a5 || a1; // void || any is any +>ra5 : Symbol(ra5, Decl(logicalOrOperatorWithEveryType.ts, 20, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) + +var ra6 = a6 || a1; // enum || any is any +>ra6 : Symbol(ra6, Decl(logicalOrOperatorWithEveryType.ts, 21, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) + +var ra7 = a7 || a1; // object || any is any +>ra7 : Symbol(ra7, Decl(logicalOrOperatorWithEveryType.ts, 22, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) + +var ra8 = a8 || a1; // array || any is any +>ra8 : Symbol(ra8, Decl(logicalOrOperatorWithEveryType.ts, 23, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) + +var ra9 = null || a1; // null || any is any +>ra9 : Symbol(ra9, Decl(logicalOrOperatorWithEveryType.ts, 24, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) + +var ra10 = undefined || a1; // undefined || any is any +>ra10 : Symbol(ra10, Decl(logicalOrOperatorWithEveryType.ts, 25, 3)) +>undefined : Symbol(undefined) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) + +var rb1 = a1 || a2; // any || boolean is any +>rb1 : Symbol(rb1, Decl(logicalOrOperatorWithEveryType.ts, 27, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) + +var rb2 = a2 || a2; // boolean || boolean is boolean +>rb2 : Symbol(rb2, Decl(logicalOrOperatorWithEveryType.ts, 28, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) + +var rb3 = a3 || a2; // number || boolean is number | boolean +>rb3 : Symbol(rb3, Decl(logicalOrOperatorWithEveryType.ts, 29, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) + +var rb4 = a4 || a2; // string || boolean is string | boolean +>rb4 : Symbol(rb4, Decl(logicalOrOperatorWithEveryType.ts, 30, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) + +var rb5 = a5 || a2; // void || boolean is void | boolean +>rb5 : Symbol(rb5, Decl(logicalOrOperatorWithEveryType.ts, 31, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) + +var rb6 = a6 || a2; // enum || boolean is E | boolean +>rb6 : Symbol(rb6, Decl(logicalOrOperatorWithEveryType.ts, 32, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) + +var rb7 = a7 || a2; // object || boolean is object | boolean +>rb7 : Symbol(rb7, Decl(logicalOrOperatorWithEveryType.ts, 33, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) + +var rb8 = a8 || a2; // array || boolean is array | boolean +>rb8 : Symbol(rb8, Decl(logicalOrOperatorWithEveryType.ts, 34, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) + +var rb9 = null || a2; // null || boolean is boolean +>rb9 : Symbol(rb9, Decl(logicalOrOperatorWithEveryType.ts, 35, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) + +var rb10= undefined || a2; // undefined || boolean is boolean +>rb10 : Symbol(rb10, Decl(logicalOrOperatorWithEveryType.ts, 36, 3)) +>undefined : Symbol(undefined) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) + +var rc1 = a1 || a3; // any || number is any +>rc1 : Symbol(rc1, Decl(logicalOrOperatorWithEveryType.ts, 38, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) + +var rc2 = a2 || a3; // boolean || number is boolean | number +>rc2 : Symbol(rc2, Decl(logicalOrOperatorWithEveryType.ts, 39, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) + +var rc3 = a3 || a3; // number || number is number +>rc3 : Symbol(rc3, Decl(logicalOrOperatorWithEveryType.ts, 40, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) + +var rc4 = a4 || a3; // string || number is string | number +>rc4 : Symbol(rc4, Decl(logicalOrOperatorWithEveryType.ts, 41, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) + +var rc5 = a5 || a3; // void || number is void | number +>rc5 : Symbol(rc5, Decl(logicalOrOperatorWithEveryType.ts, 42, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) + +var rc6 = a6 || a3; // enum || number is number +>rc6 : Symbol(rc6, Decl(logicalOrOperatorWithEveryType.ts, 43, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) + +var rc7 = a7 || a3; // object || number is object | number +>rc7 : Symbol(rc7, Decl(logicalOrOperatorWithEveryType.ts, 44, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) + +var rc8 = a8 || a3; // array || number is array | number +>rc8 : Symbol(rc8, Decl(logicalOrOperatorWithEveryType.ts, 45, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) + +var rc9 = null || a3; // null || number is number +>rc9 : Symbol(rc9, Decl(logicalOrOperatorWithEveryType.ts, 46, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) + +var rc10 = undefined || a3; // undefined || number is number +>rc10 : Symbol(rc10, Decl(logicalOrOperatorWithEveryType.ts, 47, 3)) +>undefined : Symbol(undefined) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) + +var rd1 = a1 || a4; // any || string is any +>rd1 : Symbol(rd1, Decl(logicalOrOperatorWithEveryType.ts, 49, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) + +var rd2 = a2 || a4; // boolean || string is boolean | string +>rd2 : Symbol(rd2, Decl(logicalOrOperatorWithEveryType.ts, 50, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) + +var rd3 = a3 || a4; // number || string is number | string +>rd3 : Symbol(rd3, Decl(logicalOrOperatorWithEveryType.ts, 51, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) + +var rd4 = a4 || a4; // string || string is string +>rd4 : Symbol(rd4, Decl(logicalOrOperatorWithEveryType.ts, 52, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) + +var rd5 = a5 || a4; // void || string is void | string +>rd5 : Symbol(rd5, Decl(logicalOrOperatorWithEveryType.ts, 53, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) + +var rd6 = a6 || a4; // enum || string is enum | string +>rd6 : Symbol(rd6, Decl(logicalOrOperatorWithEveryType.ts, 54, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) + +var rd7 = a7 || a4; // object || string is object | string +>rd7 : Symbol(rd7, Decl(logicalOrOperatorWithEveryType.ts, 55, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) + +var rd8 = a8 || a4; // array || string is array | string +>rd8 : Symbol(rd8, Decl(logicalOrOperatorWithEveryType.ts, 56, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) + +var rd9 = null || a4; // null || string is string +>rd9 : Symbol(rd9, Decl(logicalOrOperatorWithEveryType.ts, 57, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) + +var rd10 = undefined || a4; // undefined || string is string +>rd10 : Symbol(rd10, Decl(logicalOrOperatorWithEveryType.ts, 58, 3)) +>undefined : Symbol(undefined) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) + +var re1 = a1 || a5; // any || void is any +>re1 : Symbol(re1, Decl(logicalOrOperatorWithEveryType.ts, 60, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) + +var re2 = a2 || a5; // boolean || void is boolean | void +>re2 : Symbol(re2, Decl(logicalOrOperatorWithEveryType.ts, 61, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) + +var re3 = a3 || a5; // number || void is number | void +>re3 : Symbol(re3, Decl(logicalOrOperatorWithEveryType.ts, 62, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) + +var re4 = a4 || a5; // string || void is string | void +>re4 : Symbol(re4, Decl(logicalOrOperatorWithEveryType.ts, 63, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) + +var re5 = a5 || a5; // void || void is void +>re5 : Symbol(re5, Decl(logicalOrOperatorWithEveryType.ts, 64, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) + +var re6 = a6 || a5; // enum || void is enum | void +>re6 : Symbol(re6, Decl(logicalOrOperatorWithEveryType.ts, 65, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) + +var re7 = a7 || a5; // object || void is object | void +>re7 : Symbol(re7, Decl(logicalOrOperatorWithEveryType.ts, 66, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) + +var re8 = a8 || a5; // array || void is array | void +>re8 : Symbol(re8, Decl(logicalOrOperatorWithEveryType.ts, 67, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) + +var re9 = null || a5; // null || void is void +>re9 : Symbol(re9, Decl(logicalOrOperatorWithEveryType.ts, 68, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) + +var re10 = undefined || a5; // undefined || void is void +>re10 : Symbol(re10, Decl(logicalOrOperatorWithEveryType.ts, 69, 3)) +>undefined : Symbol(undefined) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) + +var rg1 = a1 || a6; // any || enum is any +>rg1 : Symbol(rg1, Decl(logicalOrOperatorWithEveryType.ts, 71, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) + +var rg2 = a2 || a6; // boolean || enum is boolean | enum +>rg2 : Symbol(rg2, Decl(logicalOrOperatorWithEveryType.ts, 72, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) + +var rg3 = a3 || a6; // number || enum is number +>rg3 : Symbol(rg3, Decl(logicalOrOperatorWithEveryType.ts, 73, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) + +var rg4 = a4 || a6; // string || enum is string | enum +>rg4 : Symbol(rg4, Decl(logicalOrOperatorWithEveryType.ts, 74, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) + +var rg5 = a5 || a6; // void || enum is void | enum +>rg5 : Symbol(rg5, Decl(logicalOrOperatorWithEveryType.ts, 75, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) + +var rg6 = a6 || a6; // enum || enum is E +>rg6 : Symbol(rg6, Decl(logicalOrOperatorWithEveryType.ts, 76, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) + +var rg7 = a7 || a6; // object || enum is object | enum +>rg7 : Symbol(rg7, Decl(logicalOrOperatorWithEveryType.ts, 77, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) + +var rg8 = a8 || a6; // array || enum is array | enum +>rg8 : Symbol(rg8, Decl(logicalOrOperatorWithEveryType.ts, 78, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) + +var rg9 = null || a6; // null || enum is E +>rg9 : Symbol(rg9, Decl(logicalOrOperatorWithEveryType.ts, 79, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) + +var rg10 = undefined || a6; // undefined || enum is E +>rg10 : Symbol(rg10, Decl(logicalOrOperatorWithEveryType.ts, 80, 3)) +>undefined : Symbol(undefined) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) + +var rh1 = a1 || a7; // any || object is any +>rh1 : Symbol(rh1, Decl(logicalOrOperatorWithEveryType.ts, 82, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) + +var rh2 = a2 || a7; // boolean || object is boolean | object +>rh2 : Symbol(rh2, Decl(logicalOrOperatorWithEveryType.ts, 83, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) + +var rh3 = a3 || a7; // number || object is number | object +>rh3 : Symbol(rh3, Decl(logicalOrOperatorWithEveryType.ts, 84, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) + +var rh4 = a4 || a7; // string || object is string | object +>rh4 : Symbol(rh4, Decl(logicalOrOperatorWithEveryType.ts, 85, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) + +var rh5 = a5 || a7; // void || object is void | object +>rh5 : Symbol(rh5, Decl(logicalOrOperatorWithEveryType.ts, 86, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) + +var rh6 = a6 || a7; // enum || object is enum | object +>rh6 : Symbol(rh6, Decl(logicalOrOperatorWithEveryType.ts, 87, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) + +var rh7 = a7 || a7; // object || object is object +>rh7 : Symbol(rh7, Decl(logicalOrOperatorWithEveryType.ts, 88, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) + +var rh8 = a8 || a7; // array || object is array | object +>rh8 : Symbol(rh8, Decl(logicalOrOperatorWithEveryType.ts, 89, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) + +var rh9 = null || a7; // null || object is object +>rh9 : Symbol(rh9, Decl(logicalOrOperatorWithEveryType.ts, 90, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) + +var rh10 = undefined || a7; // undefined || object is object +>rh10 : Symbol(rh10, Decl(logicalOrOperatorWithEveryType.ts, 91, 3)) +>undefined : Symbol(undefined) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) + +var ri1 = a1 || a8; // any || array is any +>ri1 : Symbol(ri1, Decl(logicalOrOperatorWithEveryType.ts, 93, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) + +var ri2 = a2 || a8; // boolean || array is boolean | array +>ri2 : Symbol(ri2, Decl(logicalOrOperatorWithEveryType.ts, 94, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) + +var ri3 = a3 || a8; // number || array is number | array +>ri3 : Symbol(ri3, Decl(logicalOrOperatorWithEveryType.ts, 95, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) + +var ri4 = a4 || a8; // string || array is string | array +>ri4 : Symbol(ri4, Decl(logicalOrOperatorWithEveryType.ts, 96, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) + +var ri5 = a5 || a8; // void || array is void | array +>ri5 : Symbol(ri5, Decl(logicalOrOperatorWithEveryType.ts, 97, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) + +var ri6 = a6 || a8; // enum || array is enum | array +>ri6 : Symbol(ri6, Decl(logicalOrOperatorWithEveryType.ts, 98, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) + +var ri7 = a7 || a8; // object || array is object | array +>ri7 : Symbol(ri7, Decl(logicalOrOperatorWithEveryType.ts, 99, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) + +var ri8 = a8 || a8; // array || array is array +>ri8 : Symbol(ri8, Decl(logicalOrOperatorWithEveryType.ts, 100, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) + +var ri9 = null || a8; // null || array is array +>ri9 : Symbol(ri9, Decl(logicalOrOperatorWithEveryType.ts, 101, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) + +var ri10 = undefined || a8; // undefined || array is array +>ri10 : Symbol(ri10, Decl(logicalOrOperatorWithEveryType.ts, 102, 3)) +>undefined : Symbol(undefined) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) + +var rj1 = a1 || null; // any || null is any +>rj1 : Symbol(rj1, Decl(logicalOrOperatorWithEveryType.ts, 104, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) + +var rj2 = a2 || null; // boolean || null is boolean +>rj2 : Symbol(rj2, Decl(logicalOrOperatorWithEveryType.ts, 105, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) + +var rj3 = a3 || null; // number || null is number +>rj3 : Symbol(rj3, Decl(logicalOrOperatorWithEveryType.ts, 106, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) + +var rj4 = a4 || null; // string || null is string +>rj4 : Symbol(rj4, Decl(logicalOrOperatorWithEveryType.ts, 107, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) + +var rj5 = a5 || null; // void || null is void +>rj5 : Symbol(rj5, Decl(logicalOrOperatorWithEveryType.ts, 108, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) + +var rj6 = a6 || null; // enum || null is E +>rj6 : Symbol(rj6, Decl(logicalOrOperatorWithEveryType.ts, 109, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) + +var rj7 = a7 || null; // object || null is object +>rj7 : Symbol(rj7, Decl(logicalOrOperatorWithEveryType.ts, 110, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) + +var rj8 = a8 || null; // array || null is array +>rj8 : Symbol(rj8, Decl(logicalOrOperatorWithEveryType.ts, 111, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) + +var rj9 = null || null; // null || null is any +>rj9 : Symbol(rj9, Decl(logicalOrOperatorWithEveryType.ts, 112, 3)) + +var rj10 = undefined || null; // undefined || null is any +>rj10 : Symbol(rj10, Decl(logicalOrOperatorWithEveryType.ts, 113, 3)) +>undefined : Symbol(undefined) + +var rf1 = a1 || undefined; // any || undefined is any +>rf1 : Symbol(rf1, Decl(logicalOrOperatorWithEveryType.ts, 115, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) +>undefined : Symbol(undefined) + +var rf2 = a2 || undefined; // boolean || undefined is boolean +>rf2 : Symbol(rf2, Decl(logicalOrOperatorWithEveryType.ts, 116, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) +>undefined : Symbol(undefined) + +var rf3 = a3 || undefined; // number || undefined is number +>rf3 : Symbol(rf3, Decl(logicalOrOperatorWithEveryType.ts, 117, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) +>undefined : Symbol(undefined) + +var rf4 = a4 || undefined; // string || undefined is string +>rf4 : Symbol(rf4, Decl(logicalOrOperatorWithEveryType.ts, 118, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) +>undefined : Symbol(undefined) + +var rf5 = a5 || undefined; // void || undefined is void +>rf5 : Symbol(rf5, Decl(logicalOrOperatorWithEveryType.ts, 119, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) +>undefined : Symbol(undefined) + +var rf6 = a6 || undefined; // enum || undefined is E +>rf6 : Symbol(rf6, Decl(logicalOrOperatorWithEveryType.ts, 120, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) +>undefined : Symbol(undefined) + +var rf7 = a7 || undefined; // object || undefined is object +>rf7 : Symbol(rf7, Decl(logicalOrOperatorWithEveryType.ts, 121, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) +>undefined : Symbol(undefined) + +var rf8 = a8 || undefined; // array || undefined is array +>rf8 : Symbol(rf8, Decl(logicalOrOperatorWithEveryType.ts, 122, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) +>undefined : Symbol(undefined) + +var rf9 = null || undefined; // null || undefined is any +>rf9 : Symbol(rf9, Decl(logicalOrOperatorWithEveryType.ts, 123, 3)) +>undefined : Symbol(undefined) + +var rf10 = undefined || undefined; // undefined || undefined is any +>rf10 : Symbol(rf10, Decl(logicalOrOperatorWithEveryType.ts, 124, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/logicalOrOperatorWithEveryType.types b/tests/baselines/reference/logicalOrOperatorWithEveryType.types index ae8dab8c71c..c98966acb98 100644 --- a/tests/baselines/reference/logicalOrOperatorWithEveryType.types +++ b/tests/baselines/reference/logicalOrOperatorWithEveryType.types @@ -87,6 +87,7 @@ var ra8 = a8 || a1; // array || any is any var ra9 = null || a1; // null || any is any >ra9 : any >null || a1 : any +>null : null >a1 : any var ra10 = undefined || a1; // undefined || any is any @@ -146,6 +147,7 @@ var rb8 = a8 || a2; // array || boolean is array | boolean var rb9 = null || a2; // null || boolean is boolean >rb9 : boolean >null || a2 : boolean +>null : null >a2 : boolean var rb10= undefined || a2; // undefined || boolean is boolean @@ -205,6 +207,7 @@ var rc8 = a8 || a3; // array || number is array | number var rc9 = null || a3; // null || number is number >rc9 : number >null || a3 : number +>null : null >a3 : number var rc10 = undefined || a3; // undefined || number is number @@ -264,6 +267,7 @@ var rd8 = a8 || a4; // array || string is array | string var rd9 = null || a4; // null || string is string >rd9 : string >null || a4 : string +>null : null >a4 : string var rd10 = undefined || a4; // undefined || string is string @@ -323,6 +327,7 @@ var re8 = a8 || a5; // array || void is array | void var re9 = null || a5; // null || void is void >re9 : void >null || a5 : void +>null : null >a5 : void var re10 = undefined || a5; // undefined || void is void @@ -382,6 +387,7 @@ var rg8 = a8 || a6; // array || enum is array | enum var rg9 = null || a6; // null || enum is E >rg9 : E >null || a6 : E +>null : null >a6 : E var rg10 = undefined || a6; // undefined || enum is E @@ -441,6 +447,7 @@ var rh8 = a8 || a7; // array || object is array | object var rh9 = null || a7; // null || object is object >rh9 : { a: string; } >null || a7 : { a: string; } +>null : null >a7 : { a: string; } var rh10 = undefined || a7; // undefined || object is object @@ -500,6 +507,7 @@ var ri8 = a8 || a8; // array || array is array var ri9 = null || a8; // null || array is array >ri9 : string[] >null || a8 : string[] +>null : null >a8 : string[] var ri10 = undefined || a8; // undefined || array is array @@ -512,50 +520,61 @@ var rj1 = a1 || null; // any || null is any >rj1 : any >a1 || null : any >a1 : any +>null : null var rj2 = a2 || null; // boolean || null is boolean >rj2 : boolean >a2 || null : boolean >a2 : boolean +>null : null var rj3 = a3 || null; // number || null is number >rj3 : number >a3 || null : number >a3 : number +>null : null var rj4 = a4 || null; // string || null is string >rj4 : string >a4 || null : string >a4 : string +>null : null var rj5 = a5 || null; // void || null is void >rj5 : void >a5 || null : void >a5 : void +>null : null var rj6 = a6 || null; // enum || null is E >rj6 : E >a6 || null : E >a6 : E +>null : null var rj7 = a7 || null; // object || null is object >rj7 : { a: string; } >a7 || null : { a: string; } >a7 : { a: string; } +>null : null var rj8 = a8 || null; // array || null is array >rj8 : string[] >a8 || null : string[] >a8 : string[] +>null : null var rj9 = null || null; // null || null is any >rj9 : any >null || null : null +>null : null +>null : null var rj10 = undefined || null; // undefined || null is any >rj10 : any >undefined || null : null >undefined : undefined +>null : null var rf1 = a1 || undefined; // any || undefined is any >rf1 : any @@ -608,6 +627,7 @@ var rf8 = a8 || undefined; // array || undefined is array var rf9 = null || undefined; // null || undefined is any >rf9 : any >null || undefined : null +>null : null >undefined : undefined var rf10 = undefined || undefined; // undefined || undefined is any diff --git a/tests/baselines/reference/logicalOrOperatorWithEveryType.types.pull b/tests/baselines/reference/logicalOrOperatorWithEveryType.types.pull deleted file mode 100644 index e0d75463414..00000000000 --- a/tests/baselines/reference/logicalOrOperatorWithEveryType.types.pull +++ /dev/null @@ -1,618 +0,0 @@ -=== tests/cases/conformance/expressions/binaryOperators/logicalOrOperator/logicalOrOperatorWithEveryType.ts === -// The || operator permits the operands to be of any type. -// If the || expression is not contextually typed, the right operand is contextually typed -// by the type of the left operand and the result is of the best common type of the two -// operand types. - -enum E { a, b, c } ->E : E ->a : E ->b : E ->c : E - -var a1: any; ->a1 : any - -var a2: boolean; ->a2 : boolean - -var a3: number ->a3 : number - -var a4: string; ->a4 : string - -var a5: void; ->a5 : void - -var a6: E; ->a6 : E ->E : E - -var a7: {a: string}; ->a7 : { a: string; } ->a : string - -var a8: string[]; ->a8 : string[] - -var ra1 = a1 || a1; // any || any is any ->ra1 : any ->a1 || a1 : any ->a1 : any ->a1 : any - -var ra2 = a2 || a1; // boolean || any is any ->ra2 : any ->a2 || a1 : any ->a2 : boolean ->a1 : any - -var ra3 = a3 || a1; // number || any is any ->ra3 : any ->a3 || a1 : any ->a3 : number ->a1 : any - -var ra4 = a4 || a1; // string || any is any ->ra4 : any ->a4 || a1 : any ->a4 : string ->a1 : any - -var ra5 = a5 || a1; // void || any is any ->ra5 : any ->a5 || a1 : any ->a5 : void ->a1 : any - -var ra6 = a6 || a1; // enum || any is any ->ra6 : any ->a6 || a1 : any ->a6 : E ->a1 : any - -var ra7 = a7 || a1; // object || any is any ->ra7 : any ->a7 || a1 : any ->a7 : { a: string; } ->a1 : any - -var ra8 = a8 || a1; // array || any is any ->ra8 : any ->a8 || a1 : any ->a8 : string[] ->a1 : any - -var ra9 = null || a1; // null || any is any ->ra9 : any ->null || a1 : any ->a1 : any - -var ra10 = undefined || a1; // undefined || any is any ->ra10 : any ->undefined || a1 : any ->undefined : undefined ->a1 : any - -var rb1 = a1 || a2; // any || boolean is any ->rb1 : any ->a1 || a2 : any ->a1 : any ->a2 : boolean - -var rb2 = a2 || a2; // boolean || boolean is boolean ->rb2 : boolean ->a2 || a2 : boolean ->a2 : boolean ->a2 : boolean - -var rb3 = a3 || a2; // number || boolean is number | boolean ->rb3 : number | boolean ->a3 || a2 : number | boolean ->a3 : number ->a2 : boolean - -var rb4 = a4 || a2; // string || boolean is string | boolean ->rb4 : string | boolean ->a4 || a2 : string | boolean ->a4 : string ->a2 : boolean - -var rb5 = a5 || a2; // void || boolean is void | boolean ->rb5 : boolean | void ->a5 || a2 : boolean | void ->a5 : void ->a2 : boolean - -var rb6 = a6 || a2; // enum || boolean is E | boolean ->rb6 : boolean | E ->a6 || a2 : boolean | E ->a6 : E ->a2 : boolean - -var rb7 = a7 || a2; // object || boolean is object | boolean ->rb7 : boolean | { a: string; } ->a7 || a2 : boolean | { a: string; } ->a7 : { a: string; } ->a2 : boolean - -var rb8 = a8 || a2; // array || boolean is array | boolean ->rb8 : boolean | string[] ->a8 || a2 : boolean | string[] ->a8 : string[] ->a2 : boolean - -var rb9 = null || a2; // null || boolean is boolean ->rb9 : boolean ->null || a2 : boolean ->a2 : boolean - -var rb10= undefined || a2; // undefined || boolean is boolean ->rb10 : boolean ->undefined || a2 : boolean ->undefined : undefined ->a2 : boolean - -var rc1 = a1 || a3; // any || number is any ->rc1 : any ->a1 || a3 : any ->a1 : any ->a3 : number - -var rc2 = a2 || a3; // boolean || number is boolean | number ->rc2 : number | boolean ->a2 || a3 : number | boolean ->a2 : boolean ->a3 : number - -var rc3 = a3 || a3; // number || number is number ->rc3 : number ->a3 || a3 : number ->a3 : number ->a3 : number - -var rc4 = a4 || a3; // string || number is string | number ->rc4 : string | number ->a4 || a3 : string | number ->a4 : string ->a3 : number - -var rc5 = a5 || a3; // void || number is void | number ->rc5 : number | void ->a5 || a3 : number | void ->a5 : void ->a3 : number - -var rc6 = a6 || a3; // enum || number is number ->rc6 : number ->a6 || a3 : number ->a6 : E ->a3 : number - -var rc7 = a7 || a3; // object || number is object | number ->rc7 : number | { a: string; } ->a7 || a3 : number | { a: string; } ->a7 : { a: string; } ->a3 : number - -var rc8 = a8 || a3; // array || number is array | number ->rc8 : number | string[] ->a8 || a3 : number | string[] ->a8 : string[] ->a3 : number - -var rc9 = null || a3; // null || number is number ->rc9 : number ->null || a3 : number ->a3 : number - -var rc10 = undefined || a3; // undefined || number is number ->rc10 : number ->undefined || a3 : number ->undefined : undefined ->a3 : number - -var rd1 = a1 || a4; // any || string is any ->rd1 : any ->a1 || a4 : any ->a1 : any ->a4 : string - -var rd2 = a2 || a4; // boolean || string is boolean | string ->rd2 : string | boolean ->a2 || a4 : string | boolean ->a2 : boolean ->a4 : string - -var rd3 = a3 || a4; // number || string is number | string ->rd3 : string | number ->a3 || a4 : string | number ->a3 : number ->a4 : string - -var rd4 = a4 || a4; // string || string is string ->rd4 : string ->a4 || a4 : string ->a4 : string ->a4 : string - -var rd5 = a5 || a4; // void || string is void | string ->rd5 : string | void ->a5 || a4 : string | void ->a5 : void ->a4 : string - -var rd6 = a6 || a4; // enum || string is enum | string ->rd6 : string | E ->a6 || a4 : string | E ->a6 : E ->a4 : string - -var rd7 = a7 || a4; // object || string is object | string ->rd7 : string | { a: string; } ->a7 || a4 : string | { a: string; } ->a7 : { a: string; } ->a4 : string - -var rd8 = a8 || a4; // array || string is array | string ->rd8 : string | string[] ->a8 || a4 : string | string[] ->a8 : string[] ->a4 : string - -var rd9 = null || a4; // null || string is string ->rd9 : string ->null || a4 : string ->a4 : string - -var rd10 = undefined || a4; // undefined || string is string ->rd10 : string ->undefined || a4 : string ->undefined : undefined ->a4 : string - -var re1 = a1 || a5; // any || void is any ->re1 : any ->a1 || a5 : any ->a1 : any ->a5 : void - -var re2 = a2 || a5; // boolean || void is boolean | void ->re2 : boolean | void ->a2 || a5 : boolean | void ->a2 : boolean ->a5 : void - -var re3 = a3 || a5; // number || void is number | void ->re3 : number | void ->a3 || a5 : number | void ->a3 : number ->a5 : void - -var re4 = a4 || a5; // string || void is string | void ->re4 : string | void ->a4 || a5 : string | void ->a4 : string ->a5 : void - -var re5 = a5 || a5; // void || void is void ->re5 : void ->a5 || a5 : void ->a5 : void ->a5 : void - -var re6 = a6 || a5; // enum || void is enum | void ->re6 : void | E ->a6 || a5 : void | E ->a6 : E ->a5 : void - -var re7 = a7 || a5; // object || void is object | void ->re7 : void | { a: string; } ->a7 || a5 : void | { a: string; } ->a7 : { a: string; } ->a5 : void - -var re8 = a8 || a5; // array || void is array | void ->re8 : void | string[] ->a8 || a5 : void | string[] ->a8 : string[] ->a5 : void - -var re9 = null || a5; // null || void is void ->re9 : void ->null || a5 : void ->a5 : void - -var re10 = undefined || a5; // undefined || void is void ->re10 : void ->undefined || a5 : void ->undefined : undefined ->a5 : void - -var rg1 = a1 || a6; // any || enum is any ->rg1 : any ->a1 || a6 : any ->a1 : any ->a6 : E - -var rg2 = a2 || a6; // boolean || enum is boolean | enum ->rg2 : boolean | E ->a2 || a6 : boolean | E ->a2 : boolean ->a6 : E - -var rg3 = a3 || a6; // number || enum is number ->rg3 : number ->a3 || a6 : number ->a3 : number ->a6 : E - -var rg4 = a4 || a6; // string || enum is string | enum ->rg4 : string | E ->a4 || a6 : string | E ->a4 : string ->a6 : E - -var rg5 = a5 || a6; // void || enum is void | enum ->rg5 : void | E ->a5 || a6 : void | E ->a5 : void ->a6 : E - -var rg6 = a6 || a6; // enum || enum is E ->rg6 : E ->a6 || a6 : E ->a6 : E ->a6 : E - -var rg7 = a7 || a6; // object || enum is object | enum ->rg7 : E | { a: string; } ->a7 || a6 : E | { a: string; } ->a7 : { a: string; } ->a6 : E - -var rg8 = a8 || a6; // array || enum is array | enum ->rg8 : E | string[] ->a8 || a6 : E | string[] ->a8 : string[] ->a6 : E - -var rg9 = null || a6; // null || enum is E ->rg9 : E ->null || a6 : E ->a6 : E - -var rg10 = undefined || a6; // undefined || enum is E ->rg10 : E ->undefined || a6 : E ->undefined : undefined ->a6 : E - -var rh1 = a1 || a7; // any || object is any ->rh1 : any ->a1 || a7 : any ->a1 : any ->a7 : { a: string; } - -var rh2 = a2 || a7; // boolean || object is boolean | object ->rh2 : boolean | { a: string; } ->a2 || a7 : boolean | { a: string; } ->a2 : boolean ->a7 : { a: string; } - -var rh3 = a3 || a7; // number || object is number | object ->rh3 : number | { a: string; } ->a3 || a7 : number | { a: string; } ->a3 : number ->a7 : { a: string; } - -var rh4 = a4 || a7; // string || object is string | object ->rh4 : string | { a: string; } ->a4 || a7 : string | { a: string; } ->a4 : string ->a7 : { a: string; } - -var rh5 = a5 || a7; // void || object is void | object ->rh5 : void | { a: string; } ->a5 || a7 : void | { a: string; } ->a5 : void ->a7 : { a: string; } - -var rh6 = a6 || a7; // enum || object is enum | object ->rh6 : E | { a: string; } ->a6 || a7 : E | { a: string; } ->a6 : E ->a7 : { a: string; } - -var rh7 = a7 || a7; // object || object is object ->rh7 : { a: string; } ->a7 || a7 : { a: string; } ->a7 : { a: string; } ->a7 : { a: string; } - -var rh8 = a8 || a7; // array || object is array | object ->rh8 : { a: string; } | string[] ->a8 || a7 : { a: string; } | string[] ->a8 : string[] ->a7 : { a: string; } - -var rh9 = null || a7; // null || object is object ->rh9 : { a: string; } ->null || a7 : { a: string; } ->a7 : { a: string; } - -var rh10 = undefined || a7; // undefined || object is object ->rh10 : { a: string; } ->undefined || a7 : { a: string; } ->undefined : undefined ->a7 : { a: string; } - -var ri1 = a1 || a8; // any || array is any ->ri1 : any ->a1 || a8 : any ->a1 : any ->a8 : string[] - -var ri2 = a2 || a8; // boolean || array is boolean | array ->ri2 : boolean | string[] ->a2 || a8 : boolean | string[] ->a2 : boolean ->a8 : string[] - -var ri3 = a3 || a8; // number || array is number | array ->ri3 : number | string[] ->a3 || a8 : number | string[] ->a3 : number ->a8 : string[] - -var ri4 = a4 || a8; // string || array is string | array ->ri4 : string | string[] ->a4 || a8 : string | string[] ->a4 : string ->a8 : string[] - -var ri5 = a5 || a8; // void || array is void | array ->ri5 : void | string[] ->a5 || a8 : void | string[] ->a5 : void ->a8 : string[] - -var ri6 = a6 || a8; // enum || array is enum | array ->ri6 : E | string[] ->a6 || a8 : E | string[] ->a6 : E ->a8 : string[] - -var ri7 = a7 || a8; // object || array is object | array ->ri7 : { a: string; } | string[] ->a7 || a8 : { a: string; } | string[] ->a7 : { a: string; } ->a8 : string[] - -var ri8 = a8 || a8; // array || array is array ->ri8 : string[] ->a8 || a8 : string[] ->a8 : string[] ->a8 : string[] - -var ri9 = null || a8; // null || array is array ->ri9 : string[] ->null || a8 : string[] ->a8 : string[] - -var ri10 = undefined || a8; // undefined || array is array ->ri10 : string[] ->undefined || a8 : string[] ->undefined : undefined ->a8 : string[] - -var rj1 = a1 || null; // any || null is any ->rj1 : any ->a1 || null : any ->a1 : any - -var rj2 = a2 || null; // boolean || null is boolean ->rj2 : boolean ->a2 || null : boolean ->a2 : boolean - -var rj3 = a3 || null; // number || null is number ->rj3 : number ->a3 || null : number ->a3 : number - -var rj4 = a4 || null; // string || null is string ->rj4 : string ->a4 || null : string ->a4 : string - -var rj5 = a5 || null; // void || null is void ->rj5 : void ->a5 || null : void ->a5 : void - -var rj6 = a6 || null; // enum || null is E ->rj6 : E ->a6 || null : E ->a6 : E - -var rj7 = a7 || null; // object || null is object ->rj7 : { a: string; } ->a7 || null : { a: string; } ->a7 : { a: string; } - -var rj8 = a8 || null; // array || null is array ->rj8 : string[] ->a8 || null : string[] ->a8 : string[] - -var rj9 = null || null; // null || null is any ->rj9 : any ->null || null : null - -var rj10 = undefined || null; // undefined || null is any ->rj10 : any ->undefined || null : null ->undefined : undefined - -var rf1 = a1 || undefined; // any || undefined is any ->rf1 : any ->a1 || undefined : any ->a1 : any ->undefined : undefined - -var rf2 = a2 || undefined; // boolean || undefined is boolean ->rf2 : boolean ->a2 || undefined : boolean ->a2 : boolean ->undefined : undefined - -var rf3 = a3 || undefined; // number || undefined is number ->rf3 : number ->a3 || undefined : number ->a3 : number ->undefined : undefined - -var rf4 = a4 || undefined; // string || undefined is string ->rf4 : string ->a4 || undefined : string ->a4 : string ->undefined : undefined - -var rf5 = a5 || undefined; // void || undefined is void ->rf5 : void ->a5 || undefined : void ->a5 : void ->undefined : undefined - -var rf6 = a6 || undefined; // enum || undefined is E ->rf6 : E ->a6 || undefined : E ->a6 : E ->undefined : undefined - -var rf7 = a7 || undefined; // object || undefined is object ->rf7 : { a: string; } ->a7 || undefined : { a: string; } ->a7 : { a: string; } ->undefined : undefined - -var rf8 = a8 || undefined; // array || undefined is array ->rf8 : string[] ->a8 || undefined : string[] ->a8 : string[] ->undefined : undefined - -var rf9 = null || undefined; // null || undefined is any ->rf9 : any ->null || undefined : null ->undefined : undefined - -var rf10 = undefined || undefined; // undefined || undefined is any ->rf10 : any ->undefined || undefined : undefined ->undefined : undefined ->undefined : undefined - diff --git a/tests/baselines/reference/logicalOrOperatorWithTypeParameters.symbols b/tests/baselines/reference/logicalOrOperatorWithTypeParameters.symbols new file mode 100644 index 00000000000..05b33a2b185 --- /dev/null +++ b/tests/baselines/reference/logicalOrOperatorWithTypeParameters.symbols @@ -0,0 +1,108 @@ +=== tests/cases/conformance/expressions/binaryOperators/logicalOrOperator/logicalOrOperatorWithTypeParameters.ts === +function fn1(t: T, u: U) { +>fn1 : Symbol(fn1, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 0)) +>T : Symbol(T, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 13)) +>U : Symbol(U, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 15)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 19)) +>T : Symbol(T, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 13)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 24)) +>U : Symbol(U, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 15)) + + var r1 = t || t; +>r1 : Symbol(r1, Decl(logicalOrOperatorWithTypeParameters.ts, 1, 7)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 19)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 19)) + + var r2: T = t || t; +>r2 : Symbol(r2, Decl(logicalOrOperatorWithTypeParameters.ts, 2, 7)) +>T : Symbol(T, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 13)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 19)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 19)) + + var r3 = t || u; +>r3 : Symbol(r3, Decl(logicalOrOperatorWithTypeParameters.ts, 3, 7)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 19)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 24)) + + var r4: {} = t || u; +>r4 : Symbol(r4, Decl(logicalOrOperatorWithTypeParameters.ts, 4, 7)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 19)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 24)) +} + +function fn2(t: T, u: U, v: V) { +>fn2 : Symbol(fn2, Decl(logicalOrOperatorWithTypeParameters.ts, 5, 1)) +>T : Symbol(T, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 13)) +>U : Symbol(U, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 15)) +>V : Symbol(V, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 32)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 50)) +>T : Symbol(T, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 13)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 55)) +>U : Symbol(U, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 15)) +>v : Symbol(v, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 61)) +>V : Symbol(V, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 32)) + + var r1 = t || u; +>r1 : Symbol(r1, Decl(logicalOrOperatorWithTypeParameters.ts, 8, 7)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 50)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 55)) + + //var r2: T = t || u; + var r3 = u || u; +>r3 : Symbol(r3, Decl(logicalOrOperatorWithTypeParameters.ts, 10, 7)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 55)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 55)) + + var r4: U = u || u; +>r4 : Symbol(r4, Decl(logicalOrOperatorWithTypeParameters.ts, 11, 7)) +>U : Symbol(U, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 15)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 55)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 55)) + + var r5 = u || v; +>r5 : Symbol(r5, Decl(logicalOrOperatorWithTypeParameters.ts, 12, 7)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 55)) +>v : Symbol(v, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 61)) + + var r6: {} = u || v; +>r6 : Symbol(r6, Decl(logicalOrOperatorWithTypeParameters.ts, 13, 7)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 55)) +>v : Symbol(v, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 61)) + + //var r7: T = u || v; +} + +function fn3(t: T, u: U) { +>fn3 : Symbol(fn3, Decl(logicalOrOperatorWithTypeParameters.ts, 15, 1)) +>T : Symbol(T, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 13)) +>a : Symbol(a, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 24)) +>b : Symbol(b, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 35)) +>U : Symbol(U, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 48)) +>a : Symbol(a, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 60)) +>b : Symbol(b, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 71)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 85)) +>T : Symbol(T, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 13)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 90)) +>U : Symbol(U, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 48)) + + var r1 = t || u; +>r1 : Symbol(r1, Decl(logicalOrOperatorWithTypeParameters.ts, 18, 7)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 85)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 90)) + + var r2: {} = t || u; +>r2 : Symbol(r2, Decl(logicalOrOperatorWithTypeParameters.ts, 19, 7)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 85)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 90)) + + var r3 = t || { a: '' }; +>r3 : Symbol(r3, Decl(logicalOrOperatorWithTypeParameters.ts, 20, 7)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 85)) +>a : Symbol(a, Decl(logicalOrOperatorWithTypeParameters.ts, 20, 19)) + + var r4: { a: string } = t || u; +>r4 : Symbol(r4, Decl(logicalOrOperatorWithTypeParameters.ts, 21, 7)) +>a : Symbol(a, Decl(logicalOrOperatorWithTypeParameters.ts, 21, 13)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 85)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 90)) +} diff --git a/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types b/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types index 4008fbbff50..f887ad7ae14 100644 --- a/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types +++ b/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types @@ -112,6 +112,7 @@ function fn3t : T >{ a: '' } : { a: string; } >a : string +>'' : string var r4: { a: string } = t || u; >r4 : { a: string; } diff --git a/tests/baselines/reference/m7Bugs.symbols b/tests/baselines/reference/m7Bugs.symbols new file mode 100644 index 00000000000..be6d798a8a5 --- /dev/null +++ b/tests/baselines/reference/m7Bugs.symbols @@ -0,0 +1,57 @@ +=== tests/cases/compiler/m7Bugs.ts === +// scenario 1 +interface ISomething { +>ISomething : Symbol(ISomething, Decl(m7Bugs.ts, 0, 0)) + + something: number; +>something : Symbol(something, Decl(m7Bugs.ts, 1, 22)) +} + +var s: ISomething = ({ }); +>s : Symbol(s, Decl(m7Bugs.ts, 5, 3)) +>ISomething : Symbol(ISomething, Decl(m7Bugs.ts, 0, 0)) +>ISomething : Symbol(ISomething, Decl(m7Bugs.ts, 0, 0)) + + +// scenario 2 +interface A { x: string; } +>A : Symbol(A, Decl(m7Bugs.ts, 5, 38)) +>x : Symbol(x, Decl(m7Bugs.ts, 9, 13)) + +interface B extends A { } +>B : Symbol(B, Decl(m7Bugs.ts, 9, 26)) +>A : Symbol(A, Decl(m7Bugs.ts, 5, 38)) + +var x: B = { }; +>x : Symbol(x, Decl(m7Bugs.ts, 13, 3)) +>B : Symbol(B, Decl(m7Bugs.ts, 9, 26)) +>B : Symbol(B, Decl(m7Bugs.ts, 9, 26)) + +class C1 { +>C1 : Symbol(C1, Decl(m7Bugs.ts, 13, 18)) + + public x: string; +>x : Symbol(x, Decl(m7Bugs.ts, 15, 10)) +} + +class C2 extends C1 {} +>C2 : Symbol(C2, Decl(m7Bugs.ts, 17, 1)) +>C1 : Symbol(C1, Decl(m7Bugs.ts, 13, 18)) + +var y1: C1 = new C2(); +>y1 : Symbol(y1, Decl(m7Bugs.ts, 21, 3)) +>C1 : Symbol(C1, Decl(m7Bugs.ts, 13, 18)) +>C2 : Symbol(C2, Decl(m7Bugs.ts, 17, 1)) + +var y2: C1 = new C2(); +>y2 : Symbol(y2, Decl(m7Bugs.ts, 22, 3)) +>C1 : Symbol(C1, Decl(m7Bugs.ts, 13, 18)) +>C1 : Symbol(C1, Decl(m7Bugs.ts, 13, 18)) +>C2 : Symbol(C2, Decl(m7Bugs.ts, 17, 1)) + +var y3: C1 = {}; +>y3 : Symbol(y3, Decl(m7Bugs.ts, 23, 3)) +>C1 : Symbol(C1, Decl(m7Bugs.ts, 13, 18)) +>C1 : Symbol(C1, Decl(m7Bugs.ts, 13, 18)) + + diff --git a/tests/baselines/reference/memberAccessMustUseModuleInstances.symbols b/tests/baselines/reference/memberAccessMustUseModuleInstances.symbols new file mode 100644 index 00000000000..434a2370520 --- /dev/null +++ b/tests/baselines/reference/memberAccessMustUseModuleInstances.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/memberAccessMustUseModuleInstances_1.ts === +/// +import WinJS = require('memberAccessMustUseModuleInstances_0'); +>WinJS : Symbol(WinJS, Decl(memberAccessMustUseModuleInstances_1.ts, 0, 0)) + +WinJS.Promise.timeout(10); +>WinJS.Promise.timeout : Symbol(WinJS.Promise.timeout, Decl(memberAccessMustUseModuleInstances_0.ts, 0, 22)) +>WinJS.Promise : Symbol(WinJS.Promise, Decl(memberAccessMustUseModuleInstances_0.ts, 0, 0)) +>WinJS : Symbol(WinJS, Decl(memberAccessMustUseModuleInstances_1.ts, 0, 0)) +>Promise : Symbol(WinJS.Promise, Decl(memberAccessMustUseModuleInstances_0.ts, 0, 0)) +>timeout : Symbol(WinJS.Promise.timeout, Decl(memberAccessMustUseModuleInstances_0.ts, 0, 22)) + +=== tests/cases/compiler/memberAccessMustUseModuleInstances_0.ts === +export class Promise { +>Promise : Symbol(Promise, Decl(memberAccessMustUseModuleInstances_0.ts, 0, 0)) + + static timeout(delay: number): Promise { +>timeout : Symbol(Promise.timeout, Decl(memberAccessMustUseModuleInstances_0.ts, 0, 22)) +>delay : Symbol(delay, Decl(memberAccessMustUseModuleInstances_0.ts, 1, 19)) +>Promise : Symbol(Promise, Decl(memberAccessMustUseModuleInstances_0.ts, 0, 0)) + + return null; + } +} + diff --git a/tests/baselines/reference/memberAccessMustUseModuleInstances.types b/tests/baselines/reference/memberAccessMustUseModuleInstances.types index 4e95362f782..b1848660dac 100644 --- a/tests/baselines/reference/memberAccessMustUseModuleInstances.types +++ b/tests/baselines/reference/memberAccessMustUseModuleInstances.types @@ -10,6 +10,7 @@ WinJS.Promise.timeout(10); >WinJS : typeof WinJS >Promise : typeof WinJS.Promise >timeout : (delay: number) => WinJS.Promise +>10 : number === tests/cases/compiler/memberAccessMustUseModuleInstances_0.ts === export class Promise { @@ -21,6 +22,7 @@ export class Promise { >Promise : Promise return null; +>null : null } } diff --git a/tests/baselines/reference/memberAccessOnConstructorType.symbols b/tests/baselines/reference/memberAccessOnConstructorType.symbols new file mode 100644 index 00000000000..0e3c707c4f9 --- /dev/null +++ b/tests/baselines/reference/memberAccessOnConstructorType.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/memberAccessOnConstructorType.ts === +var f: new () => void; +>f : Symbol(f, Decl(memberAccessOnConstructorType.ts, 0, 3)) + +f.arguments == 0; +>f.arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) +>f : Symbol(f, Decl(memberAccessOnConstructorType.ts, 0, 3)) +>arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) + diff --git a/tests/baselines/reference/memberAccessOnConstructorType.types b/tests/baselines/reference/memberAccessOnConstructorType.types index d4d722619d4..a767336ec12 100644 --- a/tests/baselines/reference/memberAccessOnConstructorType.types +++ b/tests/baselines/reference/memberAccessOnConstructorType.types @@ -7,4 +7,5 @@ f.arguments == 0; >f.arguments : any >f : new () => void >arguments : any +>0 : number diff --git a/tests/baselines/reference/memberFunctionsWithPublicOverloads.symbols b/tests/baselines/reference/memberFunctionsWithPublicOverloads.symbols new file mode 100644 index 00000000000..435af50a5f7 --- /dev/null +++ b/tests/baselines/reference/memberFunctionsWithPublicOverloads.symbols @@ -0,0 +1,142 @@ +=== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicOverloads.ts === +class C { +>C : Symbol(C, Decl(memberFunctionsWithPublicOverloads.ts, 0, 0)) + + public foo(x: number); +>foo : Symbol(foo, Decl(memberFunctionsWithPublicOverloads.ts, 0, 9), Decl(memberFunctionsWithPublicOverloads.ts, 1, 26), Decl(memberFunctionsWithPublicOverloads.ts, 2, 37)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 1, 15)) + + public foo(x: number, y: string); +>foo : Symbol(foo, Decl(memberFunctionsWithPublicOverloads.ts, 0, 9), Decl(memberFunctionsWithPublicOverloads.ts, 1, 26), Decl(memberFunctionsWithPublicOverloads.ts, 2, 37)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 2, 15)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 2, 25)) + + public foo(x: any, y?: any) { } +>foo : Symbol(foo, Decl(memberFunctionsWithPublicOverloads.ts, 0, 9), Decl(memberFunctionsWithPublicOverloads.ts, 1, 26), Decl(memberFunctionsWithPublicOverloads.ts, 2, 37)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 3, 15)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 3, 22)) + + public bar(x: 'hi'); +>bar : Symbol(bar, Decl(memberFunctionsWithPublicOverloads.ts, 3, 35), Decl(memberFunctionsWithPublicOverloads.ts, 5, 24), Decl(memberFunctionsWithPublicOverloads.ts, 6, 26), Decl(memberFunctionsWithPublicOverloads.ts, 7, 37)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 5, 15)) + + public bar(x: string); +>bar : Symbol(bar, Decl(memberFunctionsWithPublicOverloads.ts, 3, 35), Decl(memberFunctionsWithPublicOverloads.ts, 5, 24), Decl(memberFunctionsWithPublicOverloads.ts, 6, 26), Decl(memberFunctionsWithPublicOverloads.ts, 7, 37)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 6, 15)) + + public bar(x: number, y: string); +>bar : Symbol(bar, Decl(memberFunctionsWithPublicOverloads.ts, 3, 35), Decl(memberFunctionsWithPublicOverloads.ts, 5, 24), Decl(memberFunctionsWithPublicOverloads.ts, 6, 26), Decl(memberFunctionsWithPublicOverloads.ts, 7, 37)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 7, 15)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 7, 25)) + + public bar(x: any, y?: any) { } +>bar : Symbol(bar, Decl(memberFunctionsWithPublicOverloads.ts, 3, 35), Decl(memberFunctionsWithPublicOverloads.ts, 5, 24), Decl(memberFunctionsWithPublicOverloads.ts, 6, 26), Decl(memberFunctionsWithPublicOverloads.ts, 7, 37)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 8, 15)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 8, 22)) + + public static foo(x: number); +>foo : Symbol(C.foo, Decl(memberFunctionsWithPublicOverloads.ts, 8, 35), Decl(memberFunctionsWithPublicOverloads.ts, 10, 33), Decl(memberFunctionsWithPublicOverloads.ts, 11, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 10, 22)) + + public static foo(x: number, y: string); +>foo : Symbol(C.foo, Decl(memberFunctionsWithPublicOverloads.ts, 8, 35), Decl(memberFunctionsWithPublicOverloads.ts, 10, 33), Decl(memberFunctionsWithPublicOverloads.ts, 11, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 11, 22)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 11, 32)) + + public static foo(x: any, y?: any) { } +>foo : Symbol(C.foo, Decl(memberFunctionsWithPublicOverloads.ts, 8, 35), Decl(memberFunctionsWithPublicOverloads.ts, 10, 33), Decl(memberFunctionsWithPublicOverloads.ts, 11, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 12, 22)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 12, 29)) + + public static bar(x: 'hi'); +>bar : Symbol(C.bar, Decl(memberFunctionsWithPublicOverloads.ts, 12, 42), Decl(memberFunctionsWithPublicOverloads.ts, 14, 31), Decl(memberFunctionsWithPublicOverloads.ts, 15, 33), Decl(memberFunctionsWithPublicOverloads.ts, 16, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 14, 22)) + + public static bar(x: string); +>bar : Symbol(C.bar, Decl(memberFunctionsWithPublicOverloads.ts, 12, 42), Decl(memberFunctionsWithPublicOverloads.ts, 14, 31), Decl(memberFunctionsWithPublicOverloads.ts, 15, 33), Decl(memberFunctionsWithPublicOverloads.ts, 16, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 15, 22)) + + public static bar(x: number, y: string); +>bar : Symbol(C.bar, Decl(memberFunctionsWithPublicOverloads.ts, 12, 42), Decl(memberFunctionsWithPublicOverloads.ts, 14, 31), Decl(memberFunctionsWithPublicOverloads.ts, 15, 33), Decl(memberFunctionsWithPublicOverloads.ts, 16, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 16, 22)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 16, 32)) + + public static bar(x: any, y?: any) { } +>bar : Symbol(C.bar, Decl(memberFunctionsWithPublicOverloads.ts, 12, 42), Decl(memberFunctionsWithPublicOverloads.ts, 14, 31), Decl(memberFunctionsWithPublicOverloads.ts, 15, 33), Decl(memberFunctionsWithPublicOverloads.ts, 16, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 17, 22)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 17, 29)) +} + +class D { +>D : Symbol(D, Decl(memberFunctionsWithPublicOverloads.ts, 18, 1)) +>T : Symbol(T, Decl(memberFunctionsWithPublicOverloads.ts, 20, 8)) + + public foo(x: number); +>foo : Symbol(foo, Decl(memberFunctionsWithPublicOverloads.ts, 20, 12), Decl(memberFunctionsWithPublicOverloads.ts, 21, 26), Decl(memberFunctionsWithPublicOverloads.ts, 22, 27)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 21, 15)) + + public foo(x: T, y: T); +>foo : Symbol(foo, Decl(memberFunctionsWithPublicOverloads.ts, 20, 12), Decl(memberFunctionsWithPublicOverloads.ts, 21, 26), Decl(memberFunctionsWithPublicOverloads.ts, 22, 27)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 22, 15)) +>T : Symbol(T, Decl(memberFunctionsWithPublicOverloads.ts, 20, 8)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 22, 20)) +>T : Symbol(T, Decl(memberFunctionsWithPublicOverloads.ts, 20, 8)) + + public foo(x: any, y?: any) { } +>foo : Symbol(foo, Decl(memberFunctionsWithPublicOverloads.ts, 20, 12), Decl(memberFunctionsWithPublicOverloads.ts, 21, 26), Decl(memberFunctionsWithPublicOverloads.ts, 22, 27)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 23, 15)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 23, 22)) + + public bar(x: 'hi'); +>bar : Symbol(bar, Decl(memberFunctionsWithPublicOverloads.ts, 23, 35), Decl(memberFunctionsWithPublicOverloads.ts, 25, 24), Decl(memberFunctionsWithPublicOverloads.ts, 26, 26), Decl(memberFunctionsWithPublicOverloads.ts, 27, 27)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 25, 15)) + + public bar(x: string); +>bar : Symbol(bar, Decl(memberFunctionsWithPublicOverloads.ts, 23, 35), Decl(memberFunctionsWithPublicOverloads.ts, 25, 24), Decl(memberFunctionsWithPublicOverloads.ts, 26, 26), Decl(memberFunctionsWithPublicOverloads.ts, 27, 27)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 26, 15)) + + public bar(x: T, y: T); +>bar : Symbol(bar, Decl(memberFunctionsWithPublicOverloads.ts, 23, 35), Decl(memberFunctionsWithPublicOverloads.ts, 25, 24), Decl(memberFunctionsWithPublicOverloads.ts, 26, 26), Decl(memberFunctionsWithPublicOverloads.ts, 27, 27)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 27, 15)) +>T : Symbol(T, Decl(memberFunctionsWithPublicOverloads.ts, 20, 8)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 27, 20)) +>T : Symbol(T, Decl(memberFunctionsWithPublicOverloads.ts, 20, 8)) + + public bar(x: any, y?: any) { } +>bar : Symbol(bar, Decl(memberFunctionsWithPublicOverloads.ts, 23, 35), Decl(memberFunctionsWithPublicOverloads.ts, 25, 24), Decl(memberFunctionsWithPublicOverloads.ts, 26, 26), Decl(memberFunctionsWithPublicOverloads.ts, 27, 27)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 28, 15)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 28, 22)) + + public static foo(x: number); +>foo : Symbol(D.foo, Decl(memberFunctionsWithPublicOverloads.ts, 28, 35), Decl(memberFunctionsWithPublicOverloads.ts, 30, 33), Decl(memberFunctionsWithPublicOverloads.ts, 31, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 30, 22)) + + public static foo(x: number, y: string); +>foo : Symbol(D.foo, Decl(memberFunctionsWithPublicOverloads.ts, 28, 35), Decl(memberFunctionsWithPublicOverloads.ts, 30, 33), Decl(memberFunctionsWithPublicOverloads.ts, 31, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 31, 22)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 31, 32)) + + public static foo(x: any, y?: any) { } +>foo : Symbol(D.foo, Decl(memberFunctionsWithPublicOverloads.ts, 28, 35), Decl(memberFunctionsWithPublicOverloads.ts, 30, 33), Decl(memberFunctionsWithPublicOverloads.ts, 31, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 32, 22)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 32, 29)) + + public static bar(x: 'hi'); +>bar : Symbol(D.bar, Decl(memberFunctionsWithPublicOverloads.ts, 32, 42), Decl(memberFunctionsWithPublicOverloads.ts, 34, 31), Decl(memberFunctionsWithPublicOverloads.ts, 35, 33), Decl(memberFunctionsWithPublicOverloads.ts, 36, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 34, 22)) + + public static bar(x: string); +>bar : Symbol(D.bar, Decl(memberFunctionsWithPublicOverloads.ts, 32, 42), Decl(memberFunctionsWithPublicOverloads.ts, 34, 31), Decl(memberFunctionsWithPublicOverloads.ts, 35, 33), Decl(memberFunctionsWithPublicOverloads.ts, 36, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 35, 22)) + + public static bar(x: number, y: string); +>bar : Symbol(D.bar, Decl(memberFunctionsWithPublicOverloads.ts, 32, 42), Decl(memberFunctionsWithPublicOverloads.ts, 34, 31), Decl(memberFunctionsWithPublicOverloads.ts, 35, 33), Decl(memberFunctionsWithPublicOverloads.ts, 36, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 36, 22)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 36, 32)) + + public static bar(x: any, y?: any) { } +>bar : Symbol(D.bar, Decl(memberFunctionsWithPublicOverloads.ts, 32, 42), Decl(memberFunctionsWithPublicOverloads.ts, 34, 31), Decl(memberFunctionsWithPublicOverloads.ts, 35, 33), Decl(memberFunctionsWithPublicOverloads.ts, 36, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 37, 22)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 37, 29)) + +} diff --git a/tests/baselines/reference/memberVariableDeclarations1.symbols b/tests/baselines/reference/memberVariableDeclarations1.symbols new file mode 100644 index 00000000000..fbd3529262b --- /dev/null +++ b/tests/baselines/reference/memberVariableDeclarations1.symbols @@ -0,0 +1,78 @@ +=== tests/cases/compiler/memberVariableDeclarations1.ts === +// from spec + +class Employee { +>Employee : Symbol(Employee, Decl(memberVariableDeclarations1.ts, 0, 0)) + + public name: string; +>name : Symbol(name, Decl(memberVariableDeclarations1.ts, 2, 16)) + + public address: string; +>address : Symbol(address, Decl(memberVariableDeclarations1.ts, 3, 24)) + + public retired = false; +>retired : Symbol(retired, Decl(memberVariableDeclarations1.ts, 4, 27)) + + public manager: Employee = null; +>manager : Symbol(manager, Decl(memberVariableDeclarations1.ts, 5, 27)) +>Employee : Symbol(Employee, Decl(memberVariableDeclarations1.ts, 0, 0)) + + public reports: Employee[] = []; +>reports : Symbol(reports, Decl(memberVariableDeclarations1.ts, 6, 36)) +>Employee : Symbol(Employee, Decl(memberVariableDeclarations1.ts, 0, 0)) +} + +class Employee2 { +>Employee2 : Symbol(Employee2, Decl(memberVariableDeclarations1.ts, 8, 1)) + + public name: string; +>name : Symbol(name, Decl(memberVariableDeclarations1.ts, 10, 17)) + + public address: string; +>address : Symbol(address, Decl(memberVariableDeclarations1.ts, 11, 24)) + + public retired: boolean; +>retired : Symbol(retired, Decl(memberVariableDeclarations1.ts, 12, 27)) + + public manager: Employee; +>manager : Symbol(manager, Decl(memberVariableDeclarations1.ts, 13, 28)) +>Employee : Symbol(Employee, Decl(memberVariableDeclarations1.ts, 0, 0)) + + public reports: Employee[]; +>reports : Symbol(reports, Decl(memberVariableDeclarations1.ts, 14, 29)) +>Employee : Symbol(Employee, Decl(memberVariableDeclarations1.ts, 0, 0)) + + constructor() { + this.retired = false; +>this.retired : Symbol(retired, Decl(memberVariableDeclarations1.ts, 12, 27)) +>this : Symbol(Employee2, Decl(memberVariableDeclarations1.ts, 8, 1)) +>retired : Symbol(retired, Decl(memberVariableDeclarations1.ts, 12, 27)) + + this.manager = null; +>this.manager : Symbol(manager, Decl(memberVariableDeclarations1.ts, 13, 28)) +>this : Symbol(Employee2, Decl(memberVariableDeclarations1.ts, 8, 1)) +>manager : Symbol(manager, Decl(memberVariableDeclarations1.ts, 13, 28)) + + this.reports = []; +>this.reports : Symbol(reports, Decl(memberVariableDeclarations1.ts, 14, 29)) +>this : Symbol(Employee2, Decl(memberVariableDeclarations1.ts, 8, 1)) +>reports : Symbol(reports, Decl(memberVariableDeclarations1.ts, 14, 29)) + } +} + +var e1: Employee; +>e1 : Symbol(e1, Decl(memberVariableDeclarations1.ts, 23, 3)) +>Employee : Symbol(Employee, Decl(memberVariableDeclarations1.ts, 0, 0)) + +var e2: Employee2; +>e2 : Symbol(e2, Decl(memberVariableDeclarations1.ts, 24, 3)) +>Employee2 : Symbol(Employee2, Decl(memberVariableDeclarations1.ts, 8, 1)) + +e1 = e2; +>e1 : Symbol(e1, Decl(memberVariableDeclarations1.ts, 23, 3)) +>e2 : Symbol(e2, Decl(memberVariableDeclarations1.ts, 24, 3)) + +e2 = e1; +>e2 : Symbol(e2, Decl(memberVariableDeclarations1.ts, 24, 3)) +>e1 : Symbol(e1, Decl(memberVariableDeclarations1.ts, 23, 3)) + diff --git a/tests/baselines/reference/memberVariableDeclarations1.types b/tests/baselines/reference/memberVariableDeclarations1.types index 4dd68cdeb35..9aec8aa12aa 100644 --- a/tests/baselines/reference/memberVariableDeclarations1.types +++ b/tests/baselines/reference/memberVariableDeclarations1.types @@ -12,10 +12,12 @@ class Employee { public retired = false; >retired : boolean +>false : boolean public manager: Employee = null; >manager : Employee >Employee : Employee +>null : null public reports: Employee[] = []; >reports : Employee[] @@ -49,12 +51,14 @@ class Employee2 { >this.retired : boolean >this : Employee2 >retired : boolean +>false : boolean this.manager = null; >this.manager = null : null >this.manager : Employee >this : Employee2 >manager : Employee +>null : null this.reports = []; >this.reports = [] : undefined[] diff --git a/tests/baselines/reference/mergeThreeInterfaces.symbols b/tests/baselines/reference/mergeThreeInterfaces.symbols new file mode 100644 index 00000000000..24bebf49de6 --- /dev/null +++ b/tests/baselines/reference/mergeThreeInterfaces.symbols @@ -0,0 +1,197 @@ +=== tests/cases/conformance/interfaces/declarationMerging/mergeThreeInterfaces.ts === +// interfaces with the same root module should merge + +// basic case +interface A { +>A : Symbol(A, Decl(mergeThreeInterfaces.ts, 0, 0), Decl(mergeThreeInterfaces.ts, 5, 1), Decl(mergeThreeInterfaces.ts, 9, 1)) + + foo: string; +>foo : Symbol(foo, Decl(mergeThreeInterfaces.ts, 3, 13)) +} + +interface A { +>A : Symbol(A, Decl(mergeThreeInterfaces.ts, 0, 0), Decl(mergeThreeInterfaces.ts, 5, 1), Decl(mergeThreeInterfaces.ts, 9, 1)) + + bar: number; +>bar : Symbol(bar, Decl(mergeThreeInterfaces.ts, 7, 13)) +} + +interface A { +>A : Symbol(A, Decl(mergeThreeInterfaces.ts, 0, 0), Decl(mergeThreeInterfaces.ts, 5, 1), Decl(mergeThreeInterfaces.ts, 9, 1)) + + baz: boolean; +>baz : Symbol(baz, Decl(mergeThreeInterfaces.ts, 11, 13)) +} + +var a: A; +>a : Symbol(a, Decl(mergeThreeInterfaces.ts, 15, 3)) +>A : Symbol(A, Decl(mergeThreeInterfaces.ts, 0, 0), Decl(mergeThreeInterfaces.ts, 5, 1), Decl(mergeThreeInterfaces.ts, 9, 1)) + +var r1 = a.foo +>r1 : Symbol(r1, Decl(mergeThreeInterfaces.ts, 16, 3)) +>a.foo : Symbol(A.foo, Decl(mergeThreeInterfaces.ts, 3, 13)) +>a : Symbol(a, Decl(mergeThreeInterfaces.ts, 15, 3)) +>foo : Symbol(A.foo, Decl(mergeThreeInterfaces.ts, 3, 13)) + +var r2 = a.bar; +>r2 : Symbol(r2, Decl(mergeThreeInterfaces.ts, 17, 3)) +>a.bar : Symbol(A.bar, Decl(mergeThreeInterfaces.ts, 7, 13)) +>a : Symbol(a, Decl(mergeThreeInterfaces.ts, 15, 3)) +>bar : Symbol(A.bar, Decl(mergeThreeInterfaces.ts, 7, 13)) + +var r3 = a.baz; +>r3 : Symbol(r3, Decl(mergeThreeInterfaces.ts, 18, 3)) +>a.baz : Symbol(A.baz, Decl(mergeThreeInterfaces.ts, 11, 13)) +>a : Symbol(a, Decl(mergeThreeInterfaces.ts, 15, 3)) +>baz : Symbol(A.baz, Decl(mergeThreeInterfaces.ts, 11, 13)) + +// basic generic case +interface B { +>B : Symbol(B, Decl(mergeThreeInterfaces.ts, 18, 15), Decl(mergeThreeInterfaces.ts, 23, 1), Decl(mergeThreeInterfaces.ts, 27, 1)) +>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 21, 12), Decl(mergeThreeInterfaces.ts, 25, 12), Decl(mergeThreeInterfaces.ts, 29, 12)) + + foo: T; +>foo : Symbol(foo, Decl(mergeThreeInterfaces.ts, 21, 16)) +>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 21, 12), Decl(mergeThreeInterfaces.ts, 25, 12), Decl(mergeThreeInterfaces.ts, 29, 12)) +} + +interface B { +>B : Symbol(B, Decl(mergeThreeInterfaces.ts, 18, 15), Decl(mergeThreeInterfaces.ts, 23, 1), Decl(mergeThreeInterfaces.ts, 27, 1)) +>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 21, 12), Decl(mergeThreeInterfaces.ts, 25, 12), Decl(mergeThreeInterfaces.ts, 29, 12)) + + bar: T; +>bar : Symbol(bar, Decl(mergeThreeInterfaces.ts, 25, 16)) +>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 21, 12), Decl(mergeThreeInterfaces.ts, 25, 12), Decl(mergeThreeInterfaces.ts, 29, 12)) +} + +interface B { +>B : Symbol(B, Decl(mergeThreeInterfaces.ts, 18, 15), Decl(mergeThreeInterfaces.ts, 23, 1), Decl(mergeThreeInterfaces.ts, 27, 1)) +>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 21, 12), Decl(mergeThreeInterfaces.ts, 25, 12), Decl(mergeThreeInterfaces.ts, 29, 12)) + + baz: T; +>baz : Symbol(baz, Decl(mergeThreeInterfaces.ts, 29, 16)) +>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 21, 12), Decl(mergeThreeInterfaces.ts, 25, 12), Decl(mergeThreeInterfaces.ts, 29, 12)) +} + +var b: B; +>b : Symbol(b, Decl(mergeThreeInterfaces.ts, 33, 3)) +>B : Symbol(B, Decl(mergeThreeInterfaces.ts, 18, 15), Decl(mergeThreeInterfaces.ts, 23, 1), Decl(mergeThreeInterfaces.ts, 27, 1)) + +var r4 = b.foo +>r4 : Symbol(r4, Decl(mergeThreeInterfaces.ts, 34, 3)) +>b.foo : Symbol(B.foo, Decl(mergeThreeInterfaces.ts, 21, 16)) +>b : Symbol(b, Decl(mergeThreeInterfaces.ts, 33, 3)) +>foo : Symbol(B.foo, Decl(mergeThreeInterfaces.ts, 21, 16)) + +var r5 = b.bar; +>r5 : Symbol(r5, Decl(mergeThreeInterfaces.ts, 35, 3)) +>b.bar : Symbol(B.bar, Decl(mergeThreeInterfaces.ts, 25, 16)) +>b : Symbol(b, Decl(mergeThreeInterfaces.ts, 33, 3)) +>bar : Symbol(B.bar, Decl(mergeThreeInterfaces.ts, 25, 16)) + +var r6 = b.baz; +>r6 : Symbol(r6, Decl(mergeThreeInterfaces.ts, 36, 3)) +>b.baz : Symbol(B.baz, Decl(mergeThreeInterfaces.ts, 29, 16)) +>b : Symbol(b, Decl(mergeThreeInterfaces.ts, 33, 3)) +>baz : Symbol(B.baz, Decl(mergeThreeInterfaces.ts, 29, 16)) + +// basic non-generic and generic case inside a module +module M { +>M : Symbol(M, Decl(mergeThreeInterfaces.ts, 36, 15)) + + interface A { +>A : Symbol(A, Decl(mergeThreeInterfaces.ts, 39, 10), Decl(mergeThreeInterfaces.ts, 42, 5), Decl(mergeThreeInterfaces.ts, 46, 5)) + + foo: string; +>foo : Symbol(foo, Decl(mergeThreeInterfaces.ts, 40, 17)) + } + + interface A { +>A : Symbol(A, Decl(mergeThreeInterfaces.ts, 39, 10), Decl(mergeThreeInterfaces.ts, 42, 5), Decl(mergeThreeInterfaces.ts, 46, 5)) + + bar: number; +>bar : Symbol(bar, Decl(mergeThreeInterfaces.ts, 44, 17)) + } + + interface A { +>A : Symbol(A, Decl(mergeThreeInterfaces.ts, 39, 10), Decl(mergeThreeInterfaces.ts, 42, 5), Decl(mergeThreeInterfaces.ts, 46, 5)) + + baz: boolean; +>baz : Symbol(baz, Decl(mergeThreeInterfaces.ts, 48, 17)) + } + + var a: A; +>a : Symbol(a, Decl(mergeThreeInterfaces.ts, 52, 7)) +>A : Symbol(A, Decl(mergeThreeInterfaces.ts, 39, 10), Decl(mergeThreeInterfaces.ts, 42, 5), Decl(mergeThreeInterfaces.ts, 46, 5)) + + var r1 = a.foo; +>r1 : Symbol(r1, Decl(mergeThreeInterfaces.ts, 53, 7)) +>a.foo : Symbol(A.foo, Decl(mergeThreeInterfaces.ts, 40, 17)) +>a : Symbol(a, Decl(mergeThreeInterfaces.ts, 52, 7)) +>foo : Symbol(A.foo, Decl(mergeThreeInterfaces.ts, 40, 17)) + + // BUG 856491 + var r2 = a.bar; // any, should be number +>r2 : Symbol(r2, Decl(mergeThreeInterfaces.ts, 55, 7)) +>a.bar : Symbol(A.bar, Decl(mergeThreeInterfaces.ts, 44, 17)) +>a : Symbol(a, Decl(mergeThreeInterfaces.ts, 52, 7)) +>bar : Symbol(A.bar, Decl(mergeThreeInterfaces.ts, 44, 17)) + + // BUG 856491 + var r3 = a.baz; // any, should be boolean +>r3 : Symbol(r3, Decl(mergeThreeInterfaces.ts, 57, 7)) +>a.baz : Symbol(A.baz, Decl(mergeThreeInterfaces.ts, 48, 17)) +>a : Symbol(a, Decl(mergeThreeInterfaces.ts, 52, 7)) +>baz : Symbol(A.baz, Decl(mergeThreeInterfaces.ts, 48, 17)) + + interface B { +>B : Symbol(B, Decl(mergeThreeInterfaces.ts, 57, 19), Decl(mergeThreeInterfaces.ts, 61, 5), Decl(mergeThreeInterfaces.ts, 65, 5)) +>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 59, 16), Decl(mergeThreeInterfaces.ts, 63, 16), Decl(mergeThreeInterfaces.ts, 67, 16)) + + foo: T; +>foo : Symbol(foo, Decl(mergeThreeInterfaces.ts, 59, 20)) +>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 59, 16), Decl(mergeThreeInterfaces.ts, 63, 16), Decl(mergeThreeInterfaces.ts, 67, 16)) + } + + interface B { +>B : Symbol(B, Decl(mergeThreeInterfaces.ts, 57, 19), Decl(mergeThreeInterfaces.ts, 61, 5), Decl(mergeThreeInterfaces.ts, 65, 5)) +>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 59, 16), Decl(mergeThreeInterfaces.ts, 63, 16), Decl(mergeThreeInterfaces.ts, 67, 16)) + + bar: T; +>bar : Symbol(bar, Decl(mergeThreeInterfaces.ts, 63, 20)) +>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 59, 16), Decl(mergeThreeInterfaces.ts, 63, 16), Decl(mergeThreeInterfaces.ts, 67, 16)) + } + + interface B { +>B : Symbol(B, Decl(mergeThreeInterfaces.ts, 57, 19), Decl(mergeThreeInterfaces.ts, 61, 5), Decl(mergeThreeInterfaces.ts, 65, 5)) +>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 59, 16), Decl(mergeThreeInterfaces.ts, 63, 16), Decl(mergeThreeInterfaces.ts, 67, 16)) + + baz: T; +>baz : Symbol(baz, Decl(mergeThreeInterfaces.ts, 67, 20)) +>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 59, 16), Decl(mergeThreeInterfaces.ts, 63, 16), Decl(mergeThreeInterfaces.ts, 67, 16)) + } + + var b: B; +>b : Symbol(b, Decl(mergeThreeInterfaces.ts, 71, 7)) +>B : Symbol(B, Decl(mergeThreeInterfaces.ts, 57, 19), Decl(mergeThreeInterfaces.ts, 61, 5), Decl(mergeThreeInterfaces.ts, 65, 5)) + + var r4 = b.foo +>r4 : Symbol(r4, Decl(mergeThreeInterfaces.ts, 72, 7)) +>b.foo : Symbol(B.foo, Decl(mergeThreeInterfaces.ts, 59, 20)) +>b : Symbol(b, Decl(mergeThreeInterfaces.ts, 71, 7)) +>foo : Symbol(B.foo, Decl(mergeThreeInterfaces.ts, 59, 20)) + + // BUG 856491 + var r5 = b.bar; // any, should be number +>r5 : Symbol(r5, Decl(mergeThreeInterfaces.ts, 74, 7)) +>b.bar : Symbol(B.bar, Decl(mergeThreeInterfaces.ts, 63, 20)) +>b : Symbol(b, Decl(mergeThreeInterfaces.ts, 71, 7)) +>bar : Symbol(B.bar, Decl(mergeThreeInterfaces.ts, 63, 20)) + + // BUG 856491 + var r6 = b.baz; // any, should be boolean +>r6 : Symbol(r6, Decl(mergeThreeInterfaces.ts, 76, 7)) +>b.baz : Symbol(B.baz, Decl(mergeThreeInterfaces.ts, 67, 20)) +>b : Symbol(b, Decl(mergeThreeInterfaces.ts, 71, 7)) +>baz : Symbol(B.baz, Decl(mergeThreeInterfaces.ts, 67, 20)) +} diff --git a/tests/baselines/reference/mergeThreeInterfaces2.symbols b/tests/baselines/reference/mergeThreeInterfaces2.symbols new file mode 100644 index 00000000000..66942fd660d --- /dev/null +++ b/tests/baselines/reference/mergeThreeInterfaces2.symbols @@ -0,0 +1,176 @@ +=== tests/cases/conformance/interfaces/declarationMerging/mergeThreeInterfaces2.ts === +// two interfaces with the same root module should merge + +// root module now multiple module declarations +module M2 { +>M2 : Symbol(M2, Decl(mergeThreeInterfaces2.ts, 0, 0), Decl(mergeThreeInterfaces2.ts, 11, 1), Decl(mergeThreeInterfaces2.ts, 26, 1), Decl(mergeThreeInterfaces2.ts, 39, 1), Decl(mergeThreeInterfaces2.ts, 53, 1)) + + export interface A { +>A : Symbol(A, Decl(mergeThreeInterfaces2.ts, 3, 11), Decl(mergeThreeInterfaces2.ts, 13, 11), Decl(mergeThreeInterfaces2.ts, 16, 5)) + + foo: string; +>foo : Symbol(foo, Decl(mergeThreeInterfaces2.ts, 4, 24)) + } + + var a: A; +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 8, 7)) +>A : Symbol(A, Decl(mergeThreeInterfaces2.ts, 3, 11), Decl(mergeThreeInterfaces2.ts, 13, 11), Decl(mergeThreeInterfaces2.ts, 16, 5)) + + var r1 = a.foo; +>r1 : Symbol(r1, Decl(mergeThreeInterfaces2.ts, 9, 7)) +>a.foo : Symbol(A.foo, Decl(mergeThreeInterfaces2.ts, 4, 24)) +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 8, 7)) +>foo : Symbol(A.foo, Decl(mergeThreeInterfaces2.ts, 4, 24)) + + var r2 = a.bar; +>r2 : Symbol(r2, Decl(mergeThreeInterfaces2.ts, 10, 7)) +>a.bar : Symbol(A.bar, Decl(mergeThreeInterfaces2.ts, 14, 24)) +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 8, 7)) +>bar : Symbol(A.bar, Decl(mergeThreeInterfaces2.ts, 14, 24)) +} + +module M2 { +>M2 : Symbol(M2, Decl(mergeThreeInterfaces2.ts, 0, 0), Decl(mergeThreeInterfaces2.ts, 11, 1), Decl(mergeThreeInterfaces2.ts, 26, 1), Decl(mergeThreeInterfaces2.ts, 39, 1), Decl(mergeThreeInterfaces2.ts, 53, 1)) + + export interface A { +>A : Symbol(A, Decl(mergeThreeInterfaces2.ts, 3, 11), Decl(mergeThreeInterfaces2.ts, 13, 11), Decl(mergeThreeInterfaces2.ts, 16, 5)) + + bar: number; +>bar : Symbol(bar, Decl(mergeThreeInterfaces2.ts, 14, 24)) + } + + export interface A { +>A : Symbol(A, Decl(mergeThreeInterfaces2.ts, 3, 11), Decl(mergeThreeInterfaces2.ts, 13, 11), Decl(mergeThreeInterfaces2.ts, 16, 5)) + + baz: boolean; +>baz : Symbol(baz, Decl(mergeThreeInterfaces2.ts, 18, 24)) + } + + var a: A; +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 22, 7)) +>A : Symbol(A, Decl(mergeThreeInterfaces2.ts, 3, 11), Decl(mergeThreeInterfaces2.ts, 13, 11), Decl(mergeThreeInterfaces2.ts, 16, 5)) + + var r1 = a.foo; +>r1 : Symbol(r1, Decl(mergeThreeInterfaces2.ts, 23, 7)) +>a.foo : Symbol(A.foo, Decl(mergeThreeInterfaces2.ts, 4, 24)) +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 22, 7)) +>foo : Symbol(A.foo, Decl(mergeThreeInterfaces2.ts, 4, 24)) + + var r2 = a.bar; +>r2 : Symbol(r2, Decl(mergeThreeInterfaces2.ts, 24, 7)) +>a.bar : Symbol(A.bar, Decl(mergeThreeInterfaces2.ts, 14, 24)) +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 22, 7)) +>bar : Symbol(A.bar, Decl(mergeThreeInterfaces2.ts, 14, 24)) + + var r3 = a.baz; +>r3 : Symbol(r3, Decl(mergeThreeInterfaces2.ts, 25, 7)) +>a.baz : Symbol(A.baz, Decl(mergeThreeInterfaces2.ts, 18, 24)) +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 22, 7)) +>baz : Symbol(A.baz, Decl(mergeThreeInterfaces2.ts, 18, 24)) +} + +// same as above but with an additional level of nesting and third module declaration +module M2 { +>M2 : Symbol(M2, Decl(mergeThreeInterfaces2.ts, 0, 0), Decl(mergeThreeInterfaces2.ts, 11, 1), Decl(mergeThreeInterfaces2.ts, 26, 1), Decl(mergeThreeInterfaces2.ts, 39, 1), Decl(mergeThreeInterfaces2.ts, 53, 1)) + + export module M3 { +>M3 : Symbol(M3, Decl(mergeThreeInterfaces2.ts, 29, 11), Decl(mergeThreeInterfaces2.ts, 41, 11), Decl(mergeThreeInterfaces2.ts, 55, 11)) + + export interface A { +>A : Symbol(A, Decl(mergeThreeInterfaces2.ts, 30, 22), Decl(mergeThreeInterfaces2.ts, 42, 22), Decl(mergeThreeInterfaces2.ts, 56, 22)) + + foo: string; +>foo : Symbol(foo, Decl(mergeThreeInterfaces2.ts, 31, 28)) + } + + var a: A; +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 35, 11)) +>A : Symbol(A, Decl(mergeThreeInterfaces2.ts, 30, 22), Decl(mergeThreeInterfaces2.ts, 42, 22), Decl(mergeThreeInterfaces2.ts, 56, 22)) + + var r1 = a.foo; +>r1 : Symbol(r1, Decl(mergeThreeInterfaces2.ts, 36, 11)) +>a.foo : Symbol(A.foo, Decl(mergeThreeInterfaces2.ts, 31, 28)) +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 35, 11)) +>foo : Symbol(A.foo, Decl(mergeThreeInterfaces2.ts, 31, 28)) + + var r2 = a.bar; +>r2 : Symbol(r2, Decl(mergeThreeInterfaces2.ts, 37, 11)) +>a.bar : Symbol(A.bar, Decl(mergeThreeInterfaces2.ts, 43, 28)) +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 35, 11)) +>bar : Symbol(A.bar, Decl(mergeThreeInterfaces2.ts, 43, 28)) + } +} + +module M2 { +>M2 : Symbol(M2, Decl(mergeThreeInterfaces2.ts, 0, 0), Decl(mergeThreeInterfaces2.ts, 11, 1), Decl(mergeThreeInterfaces2.ts, 26, 1), Decl(mergeThreeInterfaces2.ts, 39, 1), Decl(mergeThreeInterfaces2.ts, 53, 1)) + + export module M3 { +>M3 : Symbol(M3, Decl(mergeThreeInterfaces2.ts, 29, 11), Decl(mergeThreeInterfaces2.ts, 41, 11), Decl(mergeThreeInterfaces2.ts, 55, 11)) + + export interface A { +>A : Symbol(A, Decl(mergeThreeInterfaces2.ts, 30, 22), Decl(mergeThreeInterfaces2.ts, 42, 22), Decl(mergeThreeInterfaces2.ts, 56, 22)) + + bar: number; +>bar : Symbol(bar, Decl(mergeThreeInterfaces2.ts, 43, 28)) + } + + var a: A; +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 47, 11)) +>A : Symbol(A, Decl(mergeThreeInterfaces2.ts, 30, 22), Decl(mergeThreeInterfaces2.ts, 42, 22), Decl(mergeThreeInterfaces2.ts, 56, 22)) + + var r1 = a.foo +>r1 : Symbol(r1, Decl(mergeThreeInterfaces2.ts, 49, 11)) +>a.foo : Symbol(A.foo, Decl(mergeThreeInterfaces2.ts, 31, 28)) +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 47, 11)) +>foo : Symbol(A.foo, Decl(mergeThreeInterfaces2.ts, 31, 28)) + + var r2 = a.bar; +>r2 : Symbol(r2, Decl(mergeThreeInterfaces2.ts, 50, 11)) +>a.bar : Symbol(A.bar, Decl(mergeThreeInterfaces2.ts, 43, 28)) +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 47, 11)) +>bar : Symbol(A.bar, Decl(mergeThreeInterfaces2.ts, 43, 28)) + + var r3 = a.baz; +>r3 : Symbol(r3, Decl(mergeThreeInterfaces2.ts, 51, 11)) +>a.baz : Symbol(A.baz, Decl(mergeThreeInterfaces2.ts, 57, 28)) +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 47, 11)) +>baz : Symbol(A.baz, Decl(mergeThreeInterfaces2.ts, 57, 28)) + } +} + +module M2 { +>M2 : Symbol(M2, Decl(mergeThreeInterfaces2.ts, 0, 0), Decl(mergeThreeInterfaces2.ts, 11, 1), Decl(mergeThreeInterfaces2.ts, 26, 1), Decl(mergeThreeInterfaces2.ts, 39, 1), Decl(mergeThreeInterfaces2.ts, 53, 1)) + + export module M3 { +>M3 : Symbol(M3, Decl(mergeThreeInterfaces2.ts, 29, 11), Decl(mergeThreeInterfaces2.ts, 41, 11), Decl(mergeThreeInterfaces2.ts, 55, 11)) + + export interface A { +>A : Symbol(A, Decl(mergeThreeInterfaces2.ts, 30, 22), Decl(mergeThreeInterfaces2.ts, 42, 22), Decl(mergeThreeInterfaces2.ts, 56, 22)) + + baz: boolean; +>baz : Symbol(baz, Decl(mergeThreeInterfaces2.ts, 57, 28)) + } + + var a: A; +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 61, 11)) +>A : Symbol(A, Decl(mergeThreeInterfaces2.ts, 30, 22), Decl(mergeThreeInterfaces2.ts, 42, 22), Decl(mergeThreeInterfaces2.ts, 56, 22)) + + var r1 = a.foo +>r1 : Symbol(r1, Decl(mergeThreeInterfaces2.ts, 62, 11)) +>a.foo : Symbol(A.foo, Decl(mergeThreeInterfaces2.ts, 31, 28)) +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 61, 11)) +>foo : Symbol(A.foo, Decl(mergeThreeInterfaces2.ts, 31, 28)) + + var r2 = a.bar; +>r2 : Symbol(r2, Decl(mergeThreeInterfaces2.ts, 63, 11)) +>a.bar : Symbol(A.bar, Decl(mergeThreeInterfaces2.ts, 43, 28)) +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 61, 11)) +>bar : Symbol(A.bar, Decl(mergeThreeInterfaces2.ts, 43, 28)) + + var r3 = a.baz; +>r3 : Symbol(r3, Decl(mergeThreeInterfaces2.ts, 64, 11)) +>a.baz : Symbol(A.baz, Decl(mergeThreeInterfaces2.ts, 57, 28)) +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 61, 11)) +>baz : Symbol(A.baz, Decl(mergeThreeInterfaces2.ts, 57, 28)) + } +} diff --git a/tests/baselines/reference/mergeTwoInterfaces.symbols b/tests/baselines/reference/mergeTwoInterfaces.symbols new file mode 100644 index 00000000000..d34ad6ec9a2 --- /dev/null +++ b/tests/baselines/reference/mergeTwoInterfaces.symbols @@ -0,0 +1,142 @@ +=== tests/cases/conformance/interfaces/declarationMerging/mergeTwoInterfaces.ts === +// two interfaces with the same root module should merge + +// basic case +interface A { +>A : Symbol(A, Decl(mergeTwoInterfaces.ts, 0, 0), Decl(mergeTwoInterfaces.ts, 5, 1)) + + foo: string; +>foo : Symbol(foo, Decl(mergeTwoInterfaces.ts, 3, 13)) +} + +interface A { +>A : Symbol(A, Decl(mergeTwoInterfaces.ts, 0, 0), Decl(mergeTwoInterfaces.ts, 5, 1)) + + bar: number; +>bar : Symbol(bar, Decl(mergeTwoInterfaces.ts, 7, 13)) +} + +var a: A; +>a : Symbol(a, Decl(mergeTwoInterfaces.ts, 11, 3)) +>A : Symbol(A, Decl(mergeTwoInterfaces.ts, 0, 0), Decl(mergeTwoInterfaces.ts, 5, 1)) + +var r1 = a.foo +>r1 : Symbol(r1, Decl(mergeTwoInterfaces.ts, 12, 3)) +>a.foo : Symbol(A.foo, Decl(mergeTwoInterfaces.ts, 3, 13)) +>a : Symbol(a, Decl(mergeTwoInterfaces.ts, 11, 3)) +>foo : Symbol(A.foo, Decl(mergeTwoInterfaces.ts, 3, 13)) + +var r2 = a.bar; +>r2 : Symbol(r2, Decl(mergeTwoInterfaces.ts, 13, 3)) +>a.bar : Symbol(A.bar, Decl(mergeTwoInterfaces.ts, 7, 13)) +>a : Symbol(a, Decl(mergeTwoInterfaces.ts, 11, 3)) +>bar : Symbol(A.bar, Decl(mergeTwoInterfaces.ts, 7, 13)) + +// basic generic case +interface B { +>B : Symbol(B, Decl(mergeTwoInterfaces.ts, 13, 15), Decl(mergeTwoInterfaces.ts, 19, 1)) +>T : Symbol(T, Decl(mergeTwoInterfaces.ts, 16, 12), Decl(mergeTwoInterfaces.ts, 21, 12)) + + baz: string; +>baz : Symbol(baz, Decl(mergeTwoInterfaces.ts, 16, 16)) + + foo: T; +>foo : Symbol(foo, Decl(mergeTwoInterfaces.ts, 17, 16)) +>T : Symbol(T, Decl(mergeTwoInterfaces.ts, 16, 12), Decl(mergeTwoInterfaces.ts, 21, 12)) +} + +interface B { +>B : Symbol(B, Decl(mergeTwoInterfaces.ts, 13, 15), Decl(mergeTwoInterfaces.ts, 19, 1)) +>T : Symbol(T, Decl(mergeTwoInterfaces.ts, 16, 12), Decl(mergeTwoInterfaces.ts, 21, 12)) + + bar: T; +>bar : Symbol(bar, Decl(mergeTwoInterfaces.ts, 21, 16)) +>T : Symbol(T, Decl(mergeTwoInterfaces.ts, 16, 12), Decl(mergeTwoInterfaces.ts, 21, 12)) +} + +var b: B; +>b : Symbol(b, Decl(mergeTwoInterfaces.ts, 25, 3)) +>B : Symbol(B, Decl(mergeTwoInterfaces.ts, 13, 15), Decl(mergeTwoInterfaces.ts, 19, 1)) + +var r3 = b.foo +>r3 : Symbol(r3, Decl(mergeTwoInterfaces.ts, 26, 3)) +>b.foo : Symbol(B.foo, Decl(mergeTwoInterfaces.ts, 17, 16)) +>b : Symbol(b, Decl(mergeTwoInterfaces.ts, 25, 3)) +>foo : Symbol(B.foo, Decl(mergeTwoInterfaces.ts, 17, 16)) + +var r4 = b.bar; +>r4 : Symbol(r4, Decl(mergeTwoInterfaces.ts, 27, 3)) +>b.bar : Symbol(B.bar, Decl(mergeTwoInterfaces.ts, 21, 16)) +>b : Symbol(b, Decl(mergeTwoInterfaces.ts, 25, 3)) +>bar : Symbol(B.bar, Decl(mergeTwoInterfaces.ts, 21, 16)) + +// basic non-generic and generic case inside a module +module M { +>M : Symbol(M, Decl(mergeTwoInterfaces.ts, 27, 15)) + + interface A { +>A : Symbol(A, Decl(mergeTwoInterfaces.ts, 30, 10), Decl(mergeTwoInterfaces.ts, 33, 5)) + + foo: string; +>foo : Symbol(foo, Decl(mergeTwoInterfaces.ts, 31, 17)) + } + + interface A { +>A : Symbol(A, Decl(mergeTwoInterfaces.ts, 30, 10), Decl(mergeTwoInterfaces.ts, 33, 5)) + + bar: number; +>bar : Symbol(bar, Decl(mergeTwoInterfaces.ts, 35, 17)) + } + + var a: A; +>a : Symbol(a, Decl(mergeTwoInterfaces.ts, 39, 7)) +>A : Symbol(A, Decl(mergeTwoInterfaces.ts, 30, 10), Decl(mergeTwoInterfaces.ts, 33, 5)) + + var r1 = a.foo; +>r1 : Symbol(r1, Decl(mergeTwoInterfaces.ts, 40, 7)) +>a.foo : Symbol(A.foo, Decl(mergeTwoInterfaces.ts, 31, 17)) +>a : Symbol(a, Decl(mergeTwoInterfaces.ts, 39, 7)) +>foo : Symbol(A.foo, Decl(mergeTwoInterfaces.ts, 31, 17)) + + // BUG 856491 + var r2 = a.bar; // any, should be number +>r2 : Symbol(r2, Decl(mergeTwoInterfaces.ts, 42, 7)) +>a.bar : Symbol(A.bar, Decl(mergeTwoInterfaces.ts, 35, 17)) +>a : Symbol(a, Decl(mergeTwoInterfaces.ts, 39, 7)) +>bar : Symbol(A.bar, Decl(mergeTwoInterfaces.ts, 35, 17)) + + interface B { +>B : Symbol(B, Decl(mergeTwoInterfaces.ts, 42, 19), Decl(mergeTwoInterfaces.ts, 46, 5)) +>T : Symbol(T, Decl(mergeTwoInterfaces.ts, 44, 16), Decl(mergeTwoInterfaces.ts, 48, 16)) + + foo: T; +>foo : Symbol(foo, Decl(mergeTwoInterfaces.ts, 44, 20)) +>T : Symbol(T, Decl(mergeTwoInterfaces.ts, 44, 16), Decl(mergeTwoInterfaces.ts, 48, 16)) + } + + interface B { +>B : Symbol(B, Decl(mergeTwoInterfaces.ts, 42, 19), Decl(mergeTwoInterfaces.ts, 46, 5)) +>T : Symbol(T, Decl(mergeTwoInterfaces.ts, 44, 16), Decl(mergeTwoInterfaces.ts, 48, 16)) + + bar: T; +>bar : Symbol(bar, Decl(mergeTwoInterfaces.ts, 48, 20)) +>T : Symbol(T, Decl(mergeTwoInterfaces.ts, 44, 16), Decl(mergeTwoInterfaces.ts, 48, 16)) + } + + var b: B; +>b : Symbol(b, Decl(mergeTwoInterfaces.ts, 52, 7)) +>B : Symbol(B, Decl(mergeTwoInterfaces.ts, 42, 19), Decl(mergeTwoInterfaces.ts, 46, 5)) + + var r3 = b.foo +>r3 : Symbol(r3, Decl(mergeTwoInterfaces.ts, 53, 7)) +>b.foo : Symbol(B.foo, Decl(mergeTwoInterfaces.ts, 44, 20)) +>b : Symbol(b, Decl(mergeTwoInterfaces.ts, 52, 7)) +>foo : Symbol(B.foo, Decl(mergeTwoInterfaces.ts, 44, 20)) + + // BUG 856491 + var r4 = b.bar; // any, should be string +>r4 : Symbol(r4, Decl(mergeTwoInterfaces.ts, 55, 7)) +>b.bar : Symbol(B.bar, Decl(mergeTwoInterfaces.ts, 48, 20)) +>b : Symbol(b, Decl(mergeTwoInterfaces.ts, 52, 7)) +>bar : Symbol(B.bar, Decl(mergeTwoInterfaces.ts, 48, 20)) +} diff --git a/tests/baselines/reference/mergeTwoInterfaces2.symbols b/tests/baselines/reference/mergeTwoInterfaces2.symbols new file mode 100644 index 00000000000..661fbdc14d4 --- /dev/null +++ b/tests/baselines/reference/mergeTwoInterfaces2.symbols @@ -0,0 +1,120 @@ +=== tests/cases/conformance/interfaces/declarationMerging/mergeTwoInterfaces2.ts === +// two interfaces with the same root module should merge + +// root module now multiple module declarations +module M2 { +>M2 : Symbol(M2, Decl(mergeTwoInterfaces2.ts, 0, 0), Decl(mergeTwoInterfaces2.ts, 11, 1), Decl(mergeTwoInterfaces2.ts, 21, 1), Decl(mergeTwoInterfaces2.ts, 34, 1)) + + export interface A { +>A : Symbol(A, Decl(mergeTwoInterfaces2.ts, 3, 11), Decl(mergeTwoInterfaces2.ts, 13, 11)) + + foo: string; +>foo : Symbol(foo, Decl(mergeTwoInterfaces2.ts, 4, 24)) + } + + var a: A; +>a : Symbol(a, Decl(mergeTwoInterfaces2.ts, 8, 7)) +>A : Symbol(A, Decl(mergeTwoInterfaces2.ts, 3, 11), Decl(mergeTwoInterfaces2.ts, 13, 11)) + + var r1 = a.foo +>r1 : Symbol(r1, Decl(mergeTwoInterfaces2.ts, 9, 7)) +>a.foo : Symbol(A.foo, Decl(mergeTwoInterfaces2.ts, 4, 24)) +>a : Symbol(a, Decl(mergeTwoInterfaces2.ts, 8, 7)) +>foo : Symbol(A.foo, Decl(mergeTwoInterfaces2.ts, 4, 24)) + + var r2 = a.bar; +>r2 : Symbol(r2, Decl(mergeTwoInterfaces2.ts, 10, 7)) +>a.bar : Symbol(A.bar, Decl(mergeTwoInterfaces2.ts, 14, 24)) +>a : Symbol(a, Decl(mergeTwoInterfaces2.ts, 8, 7)) +>bar : Symbol(A.bar, Decl(mergeTwoInterfaces2.ts, 14, 24)) +} + +module M2 { +>M2 : Symbol(M2, Decl(mergeTwoInterfaces2.ts, 0, 0), Decl(mergeTwoInterfaces2.ts, 11, 1), Decl(mergeTwoInterfaces2.ts, 21, 1), Decl(mergeTwoInterfaces2.ts, 34, 1)) + + export interface A { +>A : Symbol(A, Decl(mergeTwoInterfaces2.ts, 3, 11), Decl(mergeTwoInterfaces2.ts, 13, 11)) + + bar: number; +>bar : Symbol(bar, Decl(mergeTwoInterfaces2.ts, 14, 24)) + } + + var a: A; +>a : Symbol(a, Decl(mergeTwoInterfaces2.ts, 18, 7)) +>A : Symbol(A, Decl(mergeTwoInterfaces2.ts, 3, 11), Decl(mergeTwoInterfaces2.ts, 13, 11)) + + var r1 = a.foo +>r1 : Symbol(r1, Decl(mergeTwoInterfaces2.ts, 19, 7)) +>a.foo : Symbol(A.foo, Decl(mergeTwoInterfaces2.ts, 4, 24)) +>a : Symbol(a, Decl(mergeTwoInterfaces2.ts, 18, 7)) +>foo : Symbol(A.foo, Decl(mergeTwoInterfaces2.ts, 4, 24)) + + var r2 = a.bar; +>r2 : Symbol(r2, Decl(mergeTwoInterfaces2.ts, 20, 7)) +>a.bar : Symbol(A.bar, Decl(mergeTwoInterfaces2.ts, 14, 24)) +>a : Symbol(a, Decl(mergeTwoInterfaces2.ts, 18, 7)) +>bar : Symbol(A.bar, Decl(mergeTwoInterfaces2.ts, 14, 24)) +} + +// same as above but with an additional level of nesting +module M2 { +>M2 : Symbol(M2, Decl(mergeTwoInterfaces2.ts, 0, 0), Decl(mergeTwoInterfaces2.ts, 11, 1), Decl(mergeTwoInterfaces2.ts, 21, 1), Decl(mergeTwoInterfaces2.ts, 34, 1)) + + export module M3 { +>M3 : Symbol(M3, Decl(mergeTwoInterfaces2.ts, 24, 11), Decl(mergeTwoInterfaces2.ts, 36, 11)) + + export interface A { +>A : Symbol(A, Decl(mergeTwoInterfaces2.ts, 25, 22), Decl(mergeTwoInterfaces2.ts, 37, 22)) + + foo: string; +>foo : Symbol(foo, Decl(mergeTwoInterfaces2.ts, 26, 28)) + } + + var a: A; +>a : Symbol(a, Decl(mergeTwoInterfaces2.ts, 30, 11)) +>A : Symbol(A, Decl(mergeTwoInterfaces2.ts, 25, 22), Decl(mergeTwoInterfaces2.ts, 37, 22)) + + var r1 = a.foo +>r1 : Symbol(r1, Decl(mergeTwoInterfaces2.ts, 31, 11)) +>a.foo : Symbol(A.foo, Decl(mergeTwoInterfaces2.ts, 26, 28)) +>a : Symbol(a, Decl(mergeTwoInterfaces2.ts, 30, 11)) +>foo : Symbol(A.foo, Decl(mergeTwoInterfaces2.ts, 26, 28)) + + var r2 = a.bar; +>r2 : Symbol(r2, Decl(mergeTwoInterfaces2.ts, 32, 11)) +>a.bar : Symbol(A.bar, Decl(mergeTwoInterfaces2.ts, 38, 28)) +>a : Symbol(a, Decl(mergeTwoInterfaces2.ts, 30, 11)) +>bar : Symbol(A.bar, Decl(mergeTwoInterfaces2.ts, 38, 28)) + } +} + +module M2 { +>M2 : Symbol(M2, Decl(mergeTwoInterfaces2.ts, 0, 0), Decl(mergeTwoInterfaces2.ts, 11, 1), Decl(mergeTwoInterfaces2.ts, 21, 1), Decl(mergeTwoInterfaces2.ts, 34, 1)) + + export module M3 { +>M3 : Symbol(M3, Decl(mergeTwoInterfaces2.ts, 24, 11), Decl(mergeTwoInterfaces2.ts, 36, 11)) + + export interface A { +>A : Symbol(A, Decl(mergeTwoInterfaces2.ts, 25, 22), Decl(mergeTwoInterfaces2.ts, 37, 22)) + + bar: number; +>bar : Symbol(bar, Decl(mergeTwoInterfaces2.ts, 38, 28)) + } + + var a: A; +>a : Symbol(a, Decl(mergeTwoInterfaces2.ts, 42, 11)) +>A : Symbol(A, Decl(mergeTwoInterfaces2.ts, 25, 22), Decl(mergeTwoInterfaces2.ts, 37, 22)) + + var r1 = a.foo +>r1 : Symbol(r1, Decl(mergeTwoInterfaces2.ts, 43, 11)) +>a.foo : Symbol(A.foo, Decl(mergeTwoInterfaces2.ts, 26, 28)) +>a : Symbol(a, Decl(mergeTwoInterfaces2.ts, 42, 11)) +>foo : Symbol(A.foo, Decl(mergeTwoInterfaces2.ts, 26, 28)) + + var r2 = a.bar; +>r2 : Symbol(r2, Decl(mergeTwoInterfaces2.ts, 44, 11)) +>a.bar : Symbol(A.bar, Decl(mergeTwoInterfaces2.ts, 38, 28)) +>a : Symbol(a, Decl(mergeTwoInterfaces2.ts, 42, 11)) +>bar : Symbol(A.bar, Decl(mergeTwoInterfaces2.ts, 38, 28)) + } +} diff --git a/tests/baselines/reference/mergedDeclarations1.symbols b/tests/baselines/reference/mergedDeclarations1.symbols new file mode 100644 index 00000000000..733b9c4ee32 --- /dev/null +++ b/tests/baselines/reference/mergedDeclarations1.symbols @@ -0,0 +1,69 @@ +=== tests/cases/compiler/mergedDeclarations1.ts === +interface Point { +>Point : Symbol(Point, Decl(mergedDeclarations1.ts, 0, 0)) + + x: number; +>x : Symbol(x, Decl(mergedDeclarations1.ts, 0, 17)) + + y: number; +>y : Symbol(y, Decl(mergedDeclarations1.ts, 1, 14)) +} +function point(x: number, y: number): Point { +>point : Symbol(point, Decl(mergedDeclarations1.ts, 3, 1), Decl(mergedDeclarations1.ts, 6, 1)) +>x : Symbol(x, Decl(mergedDeclarations1.ts, 4, 15)) +>y : Symbol(y, Decl(mergedDeclarations1.ts, 4, 25)) +>Point : Symbol(Point, Decl(mergedDeclarations1.ts, 0, 0)) + + return { x: x, y: y }; +>x : Symbol(x, Decl(mergedDeclarations1.ts, 5, 12)) +>x : Symbol(x, Decl(mergedDeclarations1.ts, 4, 15)) +>y : Symbol(y, Decl(mergedDeclarations1.ts, 5, 18)) +>y : Symbol(y, Decl(mergedDeclarations1.ts, 4, 25)) +} +module point { +>point : Symbol(point, Decl(mergedDeclarations1.ts, 3, 1), Decl(mergedDeclarations1.ts, 6, 1)) + + export var origin = point(0, 0); +>origin : Symbol(origin, Decl(mergedDeclarations1.ts, 8, 14)) +>point : Symbol(point, Decl(mergedDeclarations1.ts, 3, 1), Decl(mergedDeclarations1.ts, 6, 1)) + + export function equals(p1: Point, p2: Point) { +>equals : Symbol(equals, Decl(mergedDeclarations1.ts, 8, 36)) +>p1 : Symbol(p1, Decl(mergedDeclarations1.ts, 9, 27)) +>Point : Symbol(Point, Decl(mergedDeclarations1.ts, 0, 0)) +>p2 : Symbol(p2, Decl(mergedDeclarations1.ts, 9, 37)) +>Point : Symbol(Point, Decl(mergedDeclarations1.ts, 0, 0)) + + return p1.x == p2.x && p1.y == p2.y; +>p1.x : Symbol(Point.x, Decl(mergedDeclarations1.ts, 0, 17)) +>p1 : Symbol(p1, Decl(mergedDeclarations1.ts, 9, 27)) +>x : Symbol(Point.x, Decl(mergedDeclarations1.ts, 0, 17)) +>p2.x : Symbol(Point.x, Decl(mergedDeclarations1.ts, 0, 17)) +>p2 : Symbol(p2, Decl(mergedDeclarations1.ts, 9, 37)) +>x : Symbol(Point.x, Decl(mergedDeclarations1.ts, 0, 17)) +>p1.y : Symbol(Point.y, Decl(mergedDeclarations1.ts, 1, 14)) +>p1 : Symbol(p1, Decl(mergedDeclarations1.ts, 9, 27)) +>y : Symbol(Point.y, Decl(mergedDeclarations1.ts, 1, 14)) +>p2.y : Symbol(Point.y, Decl(mergedDeclarations1.ts, 1, 14)) +>p2 : Symbol(p2, Decl(mergedDeclarations1.ts, 9, 37)) +>y : Symbol(Point.y, Decl(mergedDeclarations1.ts, 1, 14)) + } +} +var p1 = point(0, 0); +>p1 : Symbol(p1, Decl(mergedDeclarations1.ts, 13, 3)) +>point : Symbol(point, Decl(mergedDeclarations1.ts, 3, 1), Decl(mergedDeclarations1.ts, 6, 1)) + +var p2 = point.origin; +>p2 : Symbol(p2, Decl(mergedDeclarations1.ts, 14, 3)) +>point.origin : Symbol(point.origin, Decl(mergedDeclarations1.ts, 8, 14)) +>point : Symbol(point, Decl(mergedDeclarations1.ts, 3, 1), Decl(mergedDeclarations1.ts, 6, 1)) +>origin : Symbol(point.origin, Decl(mergedDeclarations1.ts, 8, 14)) + +var b = point.equals(p1, p2); +>b : Symbol(b, Decl(mergedDeclarations1.ts, 15, 3)) +>point.equals : Symbol(point.equals, Decl(mergedDeclarations1.ts, 8, 36)) +>point : Symbol(point, Decl(mergedDeclarations1.ts, 3, 1), Decl(mergedDeclarations1.ts, 6, 1)) +>equals : Symbol(point.equals, Decl(mergedDeclarations1.ts, 8, 36)) +>p1 : Symbol(p1, Decl(mergedDeclarations1.ts, 13, 3)) +>p2 : Symbol(p2, Decl(mergedDeclarations1.ts, 14, 3)) + diff --git a/tests/baselines/reference/mergedDeclarations1.types b/tests/baselines/reference/mergedDeclarations1.types index 20249ab94e1..2a4f18947ce 100644 --- a/tests/baselines/reference/mergedDeclarations1.types +++ b/tests/baselines/reference/mergedDeclarations1.types @@ -28,6 +28,8 @@ module point { >origin : Point >point(0, 0) : Point >point : typeof point +>0 : number +>0 : number export function equals(p1: Point, p2: Point) { >equals : (p1: Point, p2: Point) => boolean @@ -58,6 +60,8 @@ var p1 = point(0, 0); >p1 : Point >point(0, 0) : Point >point : typeof point +>0 : number +>0 : number var p2 = point.origin; >p2 : Point diff --git a/tests/baselines/reference/mergedDeclarations4.symbols b/tests/baselines/reference/mergedDeclarations4.symbols new file mode 100644 index 00000000000..7cd2728843a --- /dev/null +++ b/tests/baselines/reference/mergedDeclarations4.symbols @@ -0,0 +1,58 @@ +=== tests/cases/compiler/mergedDeclarations4.ts === +module M { +>M : Symbol(M, Decl(mergedDeclarations4.ts, 0, 0), Decl(mergedDeclarations4.ts, 5, 1)) + + export function f() { } +>f : Symbol(f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) + + f(); +>f : Symbol(f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) + + M.f(); +>M.f : Symbol(f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) +>M : Symbol(M, Decl(mergedDeclarations4.ts, 0, 0), Decl(mergedDeclarations4.ts, 5, 1)) +>f : Symbol(f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) + + var r = f.hello; +>r : Symbol(r, Decl(mergedDeclarations4.ts, 4, 7)) +>f.hello : Symbol(f.hello, Decl(mergedDeclarations4.ts, 9, 18)) +>f : Symbol(f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) +>hello : Symbol(f.hello, Decl(mergedDeclarations4.ts, 9, 18)) +} + +module M { +>M : Symbol(M, Decl(mergedDeclarations4.ts, 0, 0), Decl(mergedDeclarations4.ts, 5, 1)) + + export module f { +>f : Symbol(f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) + + export var hello = 1; +>hello : Symbol(hello, Decl(mergedDeclarations4.ts, 9, 18)) + } + f(); +>f : Symbol(f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) + + M.f(); +>M.f : Symbol(f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) +>M : Symbol(M, Decl(mergedDeclarations4.ts, 0, 0), Decl(mergedDeclarations4.ts, 5, 1)) +>f : Symbol(f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) + + var r = f.hello; +>r : Symbol(r, Decl(mergedDeclarations4.ts, 13, 7)) +>f.hello : Symbol(f.hello, Decl(mergedDeclarations4.ts, 9, 18)) +>f : Symbol(f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) +>hello : Symbol(f.hello, Decl(mergedDeclarations4.ts, 9, 18)) +} + +M.f(); +>M.f : Symbol(M.f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) +>M : Symbol(M, Decl(mergedDeclarations4.ts, 0, 0), Decl(mergedDeclarations4.ts, 5, 1)) +>f : Symbol(M.f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) + +M.f.hello; +>M.f.hello : Symbol(M.f.hello, Decl(mergedDeclarations4.ts, 9, 18)) +>M.f : Symbol(M.f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) +>M : Symbol(M, Decl(mergedDeclarations4.ts, 0, 0), Decl(mergedDeclarations4.ts, 5, 1)) +>f : Symbol(M.f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) +>hello : Symbol(M.f.hello, Decl(mergedDeclarations4.ts, 9, 18)) + diff --git a/tests/baselines/reference/mergedDeclarations4.types b/tests/baselines/reference/mergedDeclarations4.types index 068a08d35f5..9c55747c6f6 100644 --- a/tests/baselines/reference/mergedDeclarations4.types +++ b/tests/baselines/reference/mergedDeclarations4.types @@ -30,6 +30,7 @@ module M { export var hello = 1; >hello : number +>1 : number } f(); >f() : void diff --git a/tests/baselines/reference/mergedEnumDeclarationCodeGen.symbols b/tests/baselines/reference/mergedEnumDeclarationCodeGen.symbols new file mode 100644 index 00000000000..7a15860d490 --- /dev/null +++ b/tests/baselines/reference/mergedEnumDeclarationCodeGen.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/mergedEnumDeclarationCodeGen.ts === +enum E { +>E : Symbol(E, Decl(mergedEnumDeclarationCodeGen.ts, 0, 0), Decl(mergedEnumDeclarationCodeGen.ts, 3, 1)) + + a, +>a : Symbol(E.a, Decl(mergedEnumDeclarationCodeGen.ts, 0, 8)) + + b = a +>b : Symbol(E.b, Decl(mergedEnumDeclarationCodeGen.ts, 1, 6)) +>a : Symbol(E.a, Decl(mergedEnumDeclarationCodeGen.ts, 0, 8)) +} +enum E { +>E : Symbol(E, Decl(mergedEnumDeclarationCodeGen.ts, 0, 0), Decl(mergedEnumDeclarationCodeGen.ts, 3, 1)) + + c = a +>c : Symbol(E.c, Decl(mergedEnumDeclarationCodeGen.ts, 4, 8)) +>a : Symbol(E.a, Decl(mergedEnumDeclarationCodeGen.ts, 0, 8)) +} diff --git a/tests/baselines/reference/mergedInterfaceFromMultipleFiles1.symbols b/tests/baselines/reference/mergedInterfaceFromMultipleFiles1.symbols new file mode 100644 index 00000000000..f34501f025b --- /dev/null +++ b/tests/baselines/reference/mergedInterfaceFromMultipleFiles1.symbols @@ -0,0 +1,59 @@ +=== tests/cases/compiler/mergedInterfaceFromMultipleFiles1_1.ts === +/// + +interface D { bar(): number; } +>D : Symbol(D, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 0, 0)) +>bar : Symbol(bar, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 2, 13)) + +interface C extends D { +>C : Symbol(C, Decl(mergedInterfaceFromMultipleFiles1_0.ts, 1, 30), Decl(mergedInterfaceFromMultipleFiles1_1.ts, 2, 30)) +>D : Symbol(D, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 0, 0)) + + b(): Date; +>b : Symbol(b, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 4, 23)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +} + +var c:C; +>c : Symbol(c, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 8, 3)) +>C : Symbol(C, Decl(mergedInterfaceFromMultipleFiles1_0.ts, 1, 30), Decl(mergedInterfaceFromMultipleFiles1_1.ts, 2, 30)) + +var a: string = c.foo(); +>a : Symbol(a, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 9, 3)) +>c.foo : Symbol(I.foo, Decl(mergedInterfaceFromMultipleFiles1_0.ts, 1, 13)) +>c : Symbol(c, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 8, 3)) +>foo : Symbol(I.foo, Decl(mergedInterfaceFromMultipleFiles1_0.ts, 1, 13)) + +var b: number = c.bar(); +>b : Symbol(b, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 10, 3)) +>c.bar : Symbol(D.bar, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 2, 13)) +>c : Symbol(c, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 8, 3)) +>bar : Symbol(D.bar, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 2, 13)) + +var d: number = c.a(); +>d : Symbol(d, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 11, 3)) +>c.a : Symbol(C.a, Decl(mergedInterfaceFromMultipleFiles1_0.ts, 3, 23)) +>c : Symbol(c, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 8, 3)) +>a : Symbol(C.a, Decl(mergedInterfaceFromMultipleFiles1_0.ts, 3, 23)) + +var e: Date = c.b(); +>e : Symbol(e, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 12, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>c.b : Symbol(C.b, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 4, 23)) +>c : Symbol(c, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 8, 3)) +>b : Symbol(C.b, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 4, 23)) + +=== tests/cases/compiler/mergedInterfaceFromMultipleFiles1_0.ts === + +interface I { foo(): string; } +>I : Symbol(I, Decl(mergedInterfaceFromMultipleFiles1_0.ts, 0, 0)) +>foo : Symbol(foo, Decl(mergedInterfaceFromMultipleFiles1_0.ts, 1, 13)) + +interface C extends I { +>C : Symbol(C, Decl(mergedInterfaceFromMultipleFiles1_0.ts, 1, 30), Decl(mergedInterfaceFromMultipleFiles1_1.ts, 2, 30)) +>I : Symbol(I, Decl(mergedInterfaceFromMultipleFiles1_0.ts, 0, 0)) + + a(): number; +>a : Symbol(a, Decl(mergedInterfaceFromMultipleFiles1_0.ts, 3, 23)) +} + diff --git a/tests/baselines/reference/mergedInterfacesWithIndexers.symbols b/tests/baselines/reference/mergedInterfacesWithIndexers.symbols new file mode 100644 index 00000000000..b4e47c58878 --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithIndexers.symbols @@ -0,0 +1,35 @@ +=== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithIndexers.ts === +// indexers should behave like other members when merging interface declarations + +interface A { +>A : Symbol(A, Decl(mergedInterfacesWithIndexers.ts, 0, 0), Decl(mergedInterfacesWithIndexers.ts, 4, 1)) + + [x: number]: string; +>x : Symbol(x, Decl(mergedInterfacesWithIndexers.ts, 3, 5)) +} + + +interface A { +>A : Symbol(A, Decl(mergedInterfacesWithIndexers.ts, 0, 0), Decl(mergedInterfacesWithIndexers.ts, 4, 1)) + + [x: string]: { length: number }; +>x : Symbol(x, Decl(mergedInterfacesWithIndexers.ts, 8, 5)) +>length : Symbol(length, Decl(mergedInterfacesWithIndexers.ts, 8, 18)) +} + +var a: A; +>a : Symbol(a, Decl(mergedInterfacesWithIndexers.ts, 11, 3)) +>A : Symbol(A, Decl(mergedInterfacesWithIndexers.ts, 0, 0), Decl(mergedInterfacesWithIndexers.ts, 4, 1)) + +var r = a[1]; +>r : Symbol(r, Decl(mergedInterfacesWithIndexers.ts, 12, 3)) +>a : Symbol(a, Decl(mergedInterfacesWithIndexers.ts, 11, 3)) + +var r2 = a['1']; +>r2 : Symbol(r2, Decl(mergedInterfacesWithIndexers.ts, 13, 3)) +>a : Symbol(a, Decl(mergedInterfacesWithIndexers.ts, 11, 3)) + +var r3 = a['hi']; +>r3 : Symbol(r3, Decl(mergedInterfacesWithIndexers.ts, 14, 3)) +>a : Symbol(a, Decl(mergedInterfacesWithIndexers.ts, 11, 3)) + diff --git a/tests/baselines/reference/mergedInterfacesWithIndexers.types b/tests/baselines/reference/mergedInterfacesWithIndexers.types index cd082153626..b228931660a 100644 --- a/tests/baselines/reference/mergedInterfacesWithIndexers.types +++ b/tests/baselines/reference/mergedInterfacesWithIndexers.types @@ -25,14 +25,17 @@ var r = a[1]; >r : string >a[1] : string >a : A +>1 : number var r2 = a['1']; >r2 : { length: number; } >a['1'] : { length: number; } >a : A +>'1' : string var r3 = a['hi']; >r3 : { length: number; } >a['hi'] : { length: number; } >a : A +>'hi' : string diff --git a/tests/baselines/reference/mergedInterfacesWithMultipleBases.symbols b/tests/baselines/reference/mergedInterfacesWithMultipleBases.symbols new file mode 100644 index 00000000000..b3fe87bca29 --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithMultipleBases.symbols @@ -0,0 +1,121 @@ +=== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithMultipleBases.ts === +// merged interfaces behave as if all extends clauses from each declaration are merged together +// no errors expected + +class C { +>C : Symbol(C, Decl(mergedInterfacesWithMultipleBases.ts, 0, 0)) + + a: number; +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases.ts, 3, 9)) +} + +class C2 { +>C2 : Symbol(C2, Decl(mergedInterfacesWithMultipleBases.ts, 5, 1)) + + b: number; +>b : Symbol(b, Decl(mergedInterfacesWithMultipleBases.ts, 7, 10)) +} + +interface A extends C { +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases.ts, 9, 1), Decl(mergedInterfacesWithMultipleBases.ts, 13, 1)) +>C : Symbol(C, Decl(mergedInterfacesWithMultipleBases.ts, 0, 0)) + + y: string; +>y : Symbol(y, Decl(mergedInterfacesWithMultipleBases.ts, 11, 23)) +} + +interface A extends C2 { +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases.ts, 9, 1), Decl(mergedInterfacesWithMultipleBases.ts, 13, 1)) +>C2 : Symbol(C2, Decl(mergedInterfacesWithMultipleBases.ts, 5, 1)) + + z: string; +>z : Symbol(z, Decl(mergedInterfacesWithMultipleBases.ts, 15, 24)) +} + +class D implements A { +>D : Symbol(D, Decl(mergedInterfacesWithMultipleBases.ts, 17, 1)) +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases.ts, 9, 1), Decl(mergedInterfacesWithMultipleBases.ts, 13, 1)) + + a: number; +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases.ts, 19, 22)) + + b: number; +>b : Symbol(b, Decl(mergedInterfacesWithMultipleBases.ts, 20, 14)) + + y: string; +>y : Symbol(y, Decl(mergedInterfacesWithMultipleBases.ts, 21, 14)) + + z: string; +>z : Symbol(z, Decl(mergedInterfacesWithMultipleBases.ts, 22, 14)) +} + +var a: A; +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases.ts, 26, 3)) +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases.ts, 9, 1), Decl(mergedInterfacesWithMultipleBases.ts, 13, 1)) + +var r = a.a; +>r : Symbol(r, Decl(mergedInterfacesWithMultipleBases.ts, 27, 3)) +>a.a : Symbol(C.a, Decl(mergedInterfacesWithMultipleBases.ts, 3, 9)) +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases.ts, 26, 3)) +>a : Symbol(C.a, Decl(mergedInterfacesWithMultipleBases.ts, 3, 9)) + +// generic interfaces in a module +module M { +>M : Symbol(M, Decl(mergedInterfacesWithMultipleBases.ts, 27, 12)) + + class C { +>C : Symbol(C, Decl(mergedInterfacesWithMultipleBases.ts, 30, 10)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases.ts, 31, 12)) + + a: T; +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases.ts, 31, 16)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases.ts, 31, 12)) + } + + class C2 { +>C2 : Symbol(C2, Decl(mergedInterfacesWithMultipleBases.ts, 33, 5)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases.ts, 35, 13)) + + b: T; +>b : Symbol(b, Decl(mergedInterfacesWithMultipleBases.ts, 35, 17)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases.ts, 35, 13)) + } + + interface A extends C { +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases.ts, 37, 5), Decl(mergedInterfacesWithMultipleBases.ts, 41, 5)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases.ts, 39, 16), Decl(mergedInterfacesWithMultipleBases.ts, 43, 16)) +>C : Symbol(C, Decl(mergedInterfacesWithMultipleBases.ts, 30, 10)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases.ts, 39, 16), Decl(mergedInterfacesWithMultipleBases.ts, 43, 16)) + + y: T; +>y : Symbol(y, Decl(mergedInterfacesWithMultipleBases.ts, 39, 33)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases.ts, 39, 16), Decl(mergedInterfacesWithMultipleBases.ts, 43, 16)) + } + + interface A extends C2 { +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases.ts, 37, 5), Decl(mergedInterfacesWithMultipleBases.ts, 41, 5)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases.ts, 39, 16), Decl(mergedInterfacesWithMultipleBases.ts, 43, 16)) +>C2 : Symbol(C2, Decl(mergedInterfacesWithMultipleBases.ts, 33, 5)) + + z: T; +>z : Symbol(z, Decl(mergedInterfacesWithMultipleBases.ts, 43, 39)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases.ts, 39, 16), Decl(mergedInterfacesWithMultipleBases.ts, 43, 16)) + } + + class D implements A { +>D : Symbol(D, Decl(mergedInterfacesWithMultipleBases.ts, 45, 5)) +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases.ts, 37, 5), Decl(mergedInterfacesWithMultipleBases.ts, 41, 5)) + + a: boolean; +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases.ts, 47, 35)) + + b: string; +>b : Symbol(b, Decl(mergedInterfacesWithMultipleBases.ts, 48, 19)) + + y: boolean; +>y : Symbol(y, Decl(mergedInterfacesWithMultipleBases.ts, 49, 18)) + + z: boolean; +>z : Symbol(z, Decl(mergedInterfacesWithMultipleBases.ts, 50, 19)) + } +} diff --git a/tests/baselines/reference/mergedInterfacesWithMultipleBases2.symbols b/tests/baselines/reference/mergedInterfacesWithMultipleBases2.symbols new file mode 100644 index 00000000000..7424e0d110b --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithMultipleBases2.symbols @@ -0,0 +1,171 @@ +=== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithMultipleBases2.ts === +// merged interfaces behave as if all extends clauses from each declaration are merged together +// no errors expected + +class C { +>C : Symbol(C, Decl(mergedInterfacesWithMultipleBases2.ts, 0, 0)) + + a: number; +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases2.ts, 3, 9)) +} + +class C2 { +>C2 : Symbol(C2, Decl(mergedInterfacesWithMultipleBases2.ts, 5, 1)) + + b: number; +>b : Symbol(b, Decl(mergedInterfacesWithMultipleBases2.ts, 7, 10)) +} + +class C3 { +>C3 : Symbol(C3, Decl(mergedInterfacesWithMultipleBases2.ts, 9, 1)) + + c: string; +>c : Symbol(c, Decl(mergedInterfacesWithMultipleBases2.ts, 11, 10)) +} + +class C4 { +>C4 : Symbol(C4, Decl(mergedInterfacesWithMultipleBases2.ts, 13, 1)) + + d: string; +>d : Symbol(d, Decl(mergedInterfacesWithMultipleBases2.ts, 15, 10)) +} + + +interface A extends C, C3 { +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases2.ts, 17, 1), Decl(mergedInterfacesWithMultipleBases2.ts, 22, 1)) +>C : Symbol(C, Decl(mergedInterfacesWithMultipleBases2.ts, 0, 0)) +>C3 : Symbol(C3, Decl(mergedInterfacesWithMultipleBases2.ts, 9, 1)) + + y: string; +>y : Symbol(y, Decl(mergedInterfacesWithMultipleBases2.ts, 20, 27)) +} + +interface A extends C2, C4 { +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases2.ts, 17, 1), Decl(mergedInterfacesWithMultipleBases2.ts, 22, 1)) +>C2 : Symbol(C2, Decl(mergedInterfacesWithMultipleBases2.ts, 5, 1)) +>C4 : Symbol(C4, Decl(mergedInterfacesWithMultipleBases2.ts, 13, 1)) + + z: string; +>z : Symbol(z, Decl(mergedInterfacesWithMultipleBases2.ts, 24, 28)) +} + +class D implements A { +>D : Symbol(D, Decl(mergedInterfacesWithMultipleBases2.ts, 26, 1)) +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases2.ts, 17, 1), Decl(mergedInterfacesWithMultipleBases2.ts, 22, 1)) + + a: number; +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases2.ts, 28, 22)) + + b: number; +>b : Symbol(b, Decl(mergedInterfacesWithMultipleBases2.ts, 29, 14)) + + c: string; +>c : Symbol(c, Decl(mergedInterfacesWithMultipleBases2.ts, 30, 14)) + + d: string; +>d : Symbol(d, Decl(mergedInterfacesWithMultipleBases2.ts, 31, 14)) + + y: string; +>y : Symbol(y, Decl(mergedInterfacesWithMultipleBases2.ts, 32, 14)) + + z: string; +>z : Symbol(z, Decl(mergedInterfacesWithMultipleBases2.ts, 33, 14)) +} + +var a: A; +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases2.ts, 37, 3)) +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases2.ts, 17, 1), Decl(mergedInterfacesWithMultipleBases2.ts, 22, 1)) + +var r = a.a; +>r : Symbol(r, Decl(mergedInterfacesWithMultipleBases2.ts, 38, 3)) +>a.a : Symbol(C.a, Decl(mergedInterfacesWithMultipleBases2.ts, 3, 9)) +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases2.ts, 37, 3)) +>a : Symbol(C.a, Decl(mergedInterfacesWithMultipleBases2.ts, 3, 9)) + +// generic interfaces in a module +module M { +>M : Symbol(M, Decl(mergedInterfacesWithMultipleBases2.ts, 38, 12)) + + class C { +>C : Symbol(C, Decl(mergedInterfacesWithMultipleBases2.ts, 41, 10)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 42, 12)) + + a: T; +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases2.ts, 42, 16)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 42, 12)) + } + + class C2 { +>C2 : Symbol(C2, Decl(mergedInterfacesWithMultipleBases2.ts, 44, 5)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 46, 13)) + + b: T; +>b : Symbol(b, Decl(mergedInterfacesWithMultipleBases2.ts, 46, 17)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 46, 13)) + } + + class C3 { +>C3 : Symbol(C3, Decl(mergedInterfacesWithMultipleBases2.ts, 48, 5)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 50, 13)) + + c: T; +>c : Symbol(c, Decl(mergedInterfacesWithMultipleBases2.ts, 50, 17)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 50, 13)) + } + + class C4 { +>C4 : Symbol(C4, Decl(mergedInterfacesWithMultipleBases2.ts, 52, 5)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 54, 13)) + + d: T; +>d : Symbol(d, Decl(mergedInterfacesWithMultipleBases2.ts, 54, 17)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 54, 13)) + } + + interface A extends C, C3 { +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases2.ts, 56, 5), Decl(mergedInterfacesWithMultipleBases2.ts, 60, 5)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 58, 16), Decl(mergedInterfacesWithMultipleBases2.ts, 62, 16)) +>C : Symbol(C, Decl(mergedInterfacesWithMultipleBases2.ts, 41, 10)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 58, 16), Decl(mergedInterfacesWithMultipleBases2.ts, 62, 16)) +>C3 : Symbol(C3, Decl(mergedInterfacesWithMultipleBases2.ts, 48, 5)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 58, 16), Decl(mergedInterfacesWithMultipleBases2.ts, 62, 16)) + + y: T; +>y : Symbol(y, Decl(mergedInterfacesWithMultipleBases2.ts, 58, 40)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 58, 16), Decl(mergedInterfacesWithMultipleBases2.ts, 62, 16)) + } + + interface A extends C2, C4 { +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases2.ts, 56, 5), Decl(mergedInterfacesWithMultipleBases2.ts, 60, 5)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 58, 16), Decl(mergedInterfacesWithMultipleBases2.ts, 62, 16)) +>C2 : Symbol(C2, Decl(mergedInterfacesWithMultipleBases2.ts, 44, 5)) +>C4 : Symbol(C4, Decl(mergedInterfacesWithMultipleBases2.ts, 52, 5)) + + z: T; +>z : Symbol(z, Decl(mergedInterfacesWithMultipleBases2.ts, 62, 51)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 58, 16), Decl(mergedInterfacesWithMultipleBases2.ts, 62, 16)) + } + + class D implements A { +>D : Symbol(D, Decl(mergedInterfacesWithMultipleBases2.ts, 64, 5)) +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases2.ts, 56, 5), Decl(mergedInterfacesWithMultipleBases2.ts, 60, 5)) + + a: boolean; +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases2.ts, 66, 35)) + + b: string; +>b : Symbol(b, Decl(mergedInterfacesWithMultipleBases2.ts, 67, 19)) + + c: boolean; +>c : Symbol(c, Decl(mergedInterfacesWithMultipleBases2.ts, 68, 18)) + + d: string; +>d : Symbol(d, Decl(mergedInterfacesWithMultipleBases2.ts, 69, 19)) + + y: boolean; +>y : Symbol(y, Decl(mergedInterfacesWithMultipleBases2.ts, 70, 18)) + + z: boolean; +>z : Symbol(z, Decl(mergedInterfacesWithMultipleBases2.ts, 71, 19)) + } +} diff --git a/tests/baselines/reference/mergedInterfacesWithMultipleBases3.symbols b/tests/baselines/reference/mergedInterfacesWithMultipleBases3.symbols new file mode 100644 index 00000000000..337ef1dbb1c --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithMultipleBases3.symbols @@ -0,0 +1,85 @@ +=== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithMultipleBases3.ts === +// merged interfaces behave as if all extends clauses from each declaration are merged together +// no errors expected + +class C { +>C : Symbol(C, Decl(mergedInterfacesWithMultipleBases3.ts, 0, 0)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases3.ts, 3, 8)) + + a: T; +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases3.ts, 3, 12)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases3.ts, 3, 8)) +} + +class C2 { +>C2 : Symbol(C2, Decl(mergedInterfacesWithMultipleBases3.ts, 5, 1)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases3.ts, 7, 9)) + + b: T; +>b : Symbol(b, Decl(mergedInterfacesWithMultipleBases3.ts, 7, 13)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases3.ts, 7, 9)) +} + +class C3 { +>C3 : Symbol(C3, Decl(mergedInterfacesWithMultipleBases3.ts, 9, 1)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases3.ts, 11, 9)) + + c: T; +>c : Symbol(c, Decl(mergedInterfacesWithMultipleBases3.ts, 11, 13)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases3.ts, 11, 9)) +} + +class C4 { +>C4 : Symbol(C4, Decl(mergedInterfacesWithMultipleBases3.ts, 13, 1)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases3.ts, 15, 9)) + + d: T; +>d : Symbol(d, Decl(mergedInterfacesWithMultipleBases3.ts, 15, 13)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases3.ts, 15, 9)) +} + +interface A extends C, C3 { +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases3.ts, 17, 1), Decl(mergedInterfacesWithMultipleBases3.ts, 21, 1)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases3.ts, 19, 12), Decl(mergedInterfacesWithMultipleBases3.ts, 23, 12)) +>C : Symbol(C, Decl(mergedInterfacesWithMultipleBases3.ts, 0, 0)) +>C3 : Symbol(C3, Decl(mergedInterfacesWithMultipleBases3.ts, 9, 1)) + + y: T; +>y : Symbol(y, Decl(mergedInterfacesWithMultipleBases3.ts, 19, 46)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases3.ts, 19, 12), Decl(mergedInterfacesWithMultipleBases3.ts, 23, 12)) +} + +interface A extends C, C4 { +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases3.ts, 17, 1), Decl(mergedInterfacesWithMultipleBases3.ts, 21, 1)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases3.ts, 19, 12), Decl(mergedInterfacesWithMultipleBases3.ts, 23, 12)) +>C : Symbol(C, Decl(mergedInterfacesWithMultipleBases3.ts, 0, 0)) +>C4 : Symbol(C4, Decl(mergedInterfacesWithMultipleBases3.ts, 13, 1)) + + z: T; +>z : Symbol(z, Decl(mergedInterfacesWithMultipleBases3.ts, 23, 46)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases3.ts, 19, 12), Decl(mergedInterfacesWithMultipleBases3.ts, 23, 12)) +} + +class D implements A { +>D : Symbol(D, Decl(mergedInterfacesWithMultipleBases3.ts, 25, 1)) +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases3.ts, 17, 1), Decl(mergedInterfacesWithMultipleBases3.ts, 21, 1)) + + a: string; +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases3.ts, 27, 31)) + + b: Date; +>b : Symbol(b, Decl(mergedInterfacesWithMultipleBases3.ts, 28, 14)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + c: string; +>c : Symbol(c, Decl(mergedInterfacesWithMultipleBases3.ts, 29, 12)) + + d: string; +>d : Symbol(d, Decl(mergedInterfacesWithMultipleBases3.ts, 30, 14)) + + y: boolean; +>y : Symbol(y, Decl(mergedInterfacesWithMultipleBases3.ts, 31, 14)) + + z: boolean; +>z : Symbol(z, Decl(mergedInterfacesWithMultipleBases3.ts, 32, 15)) +} diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen2.symbols b/tests/baselines/reference/mergedModuleDeclarationCodeGen2.symbols new file mode 100644 index 00000000000..a58a2443ff9 --- /dev/null +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen2.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/mergedModuleDeclarationCodeGen2.ts === +module my.data.foo { +>my : Symbol(my, Decl(mergedModuleDeclarationCodeGen2.ts, 0, 0), Decl(mergedModuleDeclarationCodeGen2.ts, 2, 1)) +>data : Symbol(data, Decl(mergedModuleDeclarationCodeGen2.ts, 0, 10), Decl(mergedModuleDeclarationCodeGen2.ts, 3, 10)) +>foo : Symbol(foo, Decl(mergedModuleDeclarationCodeGen2.ts, 0, 15)) + + export function buz() { } +>buz : Symbol(buz, Decl(mergedModuleDeclarationCodeGen2.ts, 0, 20)) +} +module my.data { +>my : Symbol(my, Decl(mergedModuleDeclarationCodeGen2.ts, 0, 0), Decl(mergedModuleDeclarationCodeGen2.ts, 2, 1)) +>data : Symbol(data, Decl(mergedModuleDeclarationCodeGen2.ts, 0, 10), Decl(mergedModuleDeclarationCodeGen2.ts, 3, 10)) + + function data(my) { +>data : Symbol(data, Decl(mergedModuleDeclarationCodeGen2.ts, 3, 16)) +>my : Symbol(my, Decl(mergedModuleDeclarationCodeGen2.ts, 4, 18)) + + foo.buz(); +>foo.buz : Symbol(foo.buz, Decl(mergedModuleDeclarationCodeGen2.ts, 0, 20)) +>foo : Symbol(foo, Decl(mergedModuleDeclarationCodeGen2.ts, 0, 15)) +>buz : Symbol(foo.buz, Decl(mergedModuleDeclarationCodeGen2.ts, 0, 20)) + } +} diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen3.symbols b/tests/baselines/reference/mergedModuleDeclarationCodeGen3.symbols new file mode 100644 index 00000000000..f991b90f869 --- /dev/null +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen3.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/mergedModuleDeclarationCodeGen3.ts === +module my.data { +>my : Symbol(my, Decl(mergedModuleDeclarationCodeGen3.ts, 0, 0), Decl(mergedModuleDeclarationCodeGen3.ts, 2, 1)) +>data : Symbol(data, Decl(mergedModuleDeclarationCodeGen3.ts, 0, 10), Decl(mergedModuleDeclarationCodeGen3.ts, 3, 10)) + + export function buz() { } +>buz : Symbol(buz, Decl(mergedModuleDeclarationCodeGen3.ts, 0, 16)) +} +module my.data.foo { +>my : Symbol(my, Decl(mergedModuleDeclarationCodeGen3.ts, 0, 0), Decl(mergedModuleDeclarationCodeGen3.ts, 2, 1)) +>data : Symbol(data, Decl(mergedModuleDeclarationCodeGen3.ts, 0, 10), Decl(mergedModuleDeclarationCodeGen3.ts, 3, 10)) +>foo : Symbol(foo, Decl(mergedModuleDeclarationCodeGen3.ts, 3, 15)) + + function data(my, foo) { +>data : Symbol(data, Decl(mergedModuleDeclarationCodeGen3.ts, 3, 20)) +>my : Symbol(my, Decl(mergedModuleDeclarationCodeGen3.ts, 4, 18)) +>foo : Symbol(foo, Decl(mergedModuleDeclarationCodeGen3.ts, 4, 21)) + + buz(); +>buz : Symbol(buz, Decl(mergedModuleDeclarationCodeGen3.ts, 0, 16)) + } +} diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen4.symbols b/tests/baselines/reference/mergedModuleDeclarationCodeGen4.symbols new file mode 100644 index 00000000000..86e6b979881 --- /dev/null +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen4.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/mergedModuleDeclarationCodeGen4.ts === +module superContain { +>superContain : Symbol(superContain, Decl(mergedModuleDeclarationCodeGen4.ts, 0, 0)) + + export module contain { +>contain : Symbol(contain, Decl(mergedModuleDeclarationCodeGen4.ts, 0, 21)) + + export module my.buz { +>my : Symbol(my, Decl(mergedModuleDeclarationCodeGen4.ts, 1, 27), Decl(mergedModuleDeclarationCodeGen4.ts, 6, 9)) +>buz : Symbol(buz, Decl(mergedModuleDeclarationCodeGen4.ts, 2, 25), Decl(mergedModuleDeclarationCodeGen4.ts, 7, 25)) + + export module data { +>data : Symbol(data, Decl(mergedModuleDeclarationCodeGen4.ts, 2, 30), Decl(mergedModuleDeclarationCodeGen4.ts, 7, 30)) + + export function foo() { } +>foo : Symbol(foo, Decl(mergedModuleDeclarationCodeGen4.ts, 3, 32)) + } + } + export module my.buz { +>my : Symbol(my, Decl(mergedModuleDeclarationCodeGen4.ts, 1, 27), Decl(mergedModuleDeclarationCodeGen4.ts, 6, 9)) +>buz : Symbol(buz, Decl(mergedModuleDeclarationCodeGen4.ts, 2, 25), Decl(mergedModuleDeclarationCodeGen4.ts, 7, 25)) + + export module data { +>data : Symbol(data, Decl(mergedModuleDeclarationCodeGen4.ts, 2, 30), Decl(mergedModuleDeclarationCodeGen4.ts, 7, 30)) + + export function bar(contain, my, buz, data) { +>bar : Symbol(bar, Decl(mergedModuleDeclarationCodeGen4.ts, 8, 32)) +>contain : Symbol(contain, Decl(mergedModuleDeclarationCodeGen4.ts, 9, 36)) +>my : Symbol(my, Decl(mergedModuleDeclarationCodeGen4.ts, 9, 44)) +>buz : Symbol(buz, Decl(mergedModuleDeclarationCodeGen4.ts, 9, 48)) +>data : Symbol(data, Decl(mergedModuleDeclarationCodeGen4.ts, 9, 53)) + + foo(); +>foo : Symbol(foo, Decl(mergedModuleDeclarationCodeGen4.ts, 3, 32)) + } + } + } + } +} diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen5.symbols b/tests/baselines/reference/mergedModuleDeclarationCodeGen5.symbols new file mode 100644 index 00000000000..6f4cc0ef3e5 --- /dev/null +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen5.symbols @@ -0,0 +1,54 @@ +=== tests/cases/compiler/mergedModuleDeclarationCodeGen5.ts === +module M.buz.plop { +>M : Symbol(M, Decl(mergedModuleDeclarationCodeGen5.ts, 0, 0), Decl(mergedModuleDeclarationCodeGen5.ts, 3, 1)) +>buz : Symbol(buz, Decl(mergedModuleDeclarationCodeGen5.ts, 0, 9), Decl(mergedModuleDeclarationCodeGen5.ts, 4, 9)) +>plop : Symbol(plop, Decl(mergedModuleDeclarationCodeGen5.ts, 0, 13), Decl(mergedModuleDeclarationCodeGen5.ts, 4, 13)) + + export function doom() { } +>doom : Symbol(doom, Decl(mergedModuleDeclarationCodeGen5.ts, 0, 19)) + + export function M() { } +>M : Symbol(M, Decl(mergedModuleDeclarationCodeGen5.ts, 1, 30)) +} +module M.buz.plop { +>M : Symbol(M, Decl(mergedModuleDeclarationCodeGen5.ts, 0, 0), Decl(mergedModuleDeclarationCodeGen5.ts, 3, 1)) +>buz : Symbol(buz, Decl(mergedModuleDeclarationCodeGen5.ts, 0, 9), Decl(mergedModuleDeclarationCodeGen5.ts, 4, 9)) +>plop : Symbol(plop, Decl(mergedModuleDeclarationCodeGen5.ts, 0, 13), Decl(mergedModuleDeclarationCodeGen5.ts, 4, 13)) + + function gunk() { } +>gunk : Symbol(gunk, Decl(mergedModuleDeclarationCodeGen5.ts, 4, 19)) + + function buz() { } +>buz : Symbol(buz, Decl(mergedModuleDeclarationCodeGen5.ts, 5, 23)) + + export class fudge { } +>fudge : Symbol(fudge, Decl(mergedModuleDeclarationCodeGen5.ts, 6, 22)) + + export enum plop { } +>plop : Symbol(plop, Decl(mergedModuleDeclarationCodeGen5.ts, 7, 26)) + + // Emit these references as follows + var v1 = gunk; // gunk +>v1 : Symbol(v1, Decl(mergedModuleDeclarationCodeGen5.ts, 11, 7)) +>gunk : Symbol(gunk, Decl(mergedModuleDeclarationCodeGen5.ts, 4, 19)) + + var v2 = buz; // buz +>v2 : Symbol(v2, Decl(mergedModuleDeclarationCodeGen5.ts, 12, 7)) +>buz : Symbol(buz, Decl(mergedModuleDeclarationCodeGen5.ts, 5, 23)) + + export var v3 = doom; // _plop.doom +>v3 : Symbol(v3, Decl(mergedModuleDeclarationCodeGen5.ts, 13, 14)) +>doom : Symbol(doom, Decl(mergedModuleDeclarationCodeGen5.ts, 0, 19)) + + export var v4 = M; // _plop.M +>v4 : Symbol(v4, Decl(mergedModuleDeclarationCodeGen5.ts, 14, 14)) +>M : Symbol(M, Decl(mergedModuleDeclarationCodeGen5.ts, 1, 30)) + + export var v5 = fudge; // fudge +>v5 : Symbol(v5, Decl(mergedModuleDeclarationCodeGen5.ts, 15, 14)) +>fudge : Symbol(fudge, Decl(mergedModuleDeclarationCodeGen5.ts, 6, 22)) + + export var v6 = plop; // plop +>v6 : Symbol(v6, Decl(mergedModuleDeclarationCodeGen5.ts, 16, 14)) +>plop : Symbol(plop, Decl(mergedModuleDeclarationCodeGen5.ts, 7, 26)) +} diff --git a/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.symbols b/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.symbols new file mode 100644 index 00000000000..a7f074023a6 --- /dev/null +++ b/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/mergedModuleDeclarationWithSharedExportedVar.ts === +module M { +>M : Symbol(M, Decl(mergedModuleDeclarationWithSharedExportedVar.ts, 0, 0), Decl(mergedModuleDeclarationWithSharedExportedVar.ts, 3, 1)) + + export var v = 10; +>v : Symbol(v, Decl(mergedModuleDeclarationWithSharedExportedVar.ts, 1, 14)) + + v; +>v : Symbol(v, Decl(mergedModuleDeclarationWithSharedExportedVar.ts, 1, 14)) +} +module M { +>M : Symbol(M, Decl(mergedModuleDeclarationWithSharedExportedVar.ts, 0, 0), Decl(mergedModuleDeclarationWithSharedExportedVar.ts, 3, 1)) + + v; +>v : Symbol(v, Decl(mergedModuleDeclarationWithSharedExportedVar.ts, 1, 14)) +} diff --git a/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.types b/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.types index 89d155861a5..484cee0b0af 100644 --- a/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.types +++ b/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.types @@ -4,6 +4,7 @@ module M { export var v = 10; >v : number +>10 : number v; >v : number diff --git a/tests/baselines/reference/methodContainingLocalFunction.symbols b/tests/baselines/reference/methodContainingLocalFunction.symbols new file mode 100644 index 00000000000..e449d68562f --- /dev/null +++ b/tests/baselines/reference/methodContainingLocalFunction.symbols @@ -0,0 +1,122 @@ +=== tests/cases/compiler/methodContainingLocalFunction.ts === +// The first case here (BugExhibition) caused a crash. Try with different permutations of features. +class BugExhibition { +>BugExhibition : Symbol(BugExhibition, Decl(methodContainingLocalFunction.ts, 0, 0)) +>T : Symbol(T, Decl(methodContainingLocalFunction.ts, 1, 20)) + + public exhibitBug() { +>exhibitBug : Symbol(exhibitBug, Decl(methodContainingLocalFunction.ts, 1, 24)) + + function localFunction() { } +>localFunction : Symbol(localFunction, Decl(methodContainingLocalFunction.ts, 2, 25)) + + var x: { (): void; }; +>x : Symbol(x, Decl(methodContainingLocalFunction.ts, 4, 11)) + + x = localFunction; +>x : Symbol(x, Decl(methodContainingLocalFunction.ts, 4, 11)) +>localFunction : Symbol(localFunction, Decl(methodContainingLocalFunction.ts, 2, 25)) + } +} + +class BugExhibition2 { +>BugExhibition2 : Symbol(BugExhibition2, Decl(methodContainingLocalFunction.ts, 7, 1)) +>T : Symbol(T, Decl(methodContainingLocalFunction.ts, 9, 21)) + + private static get exhibitBug() { +>exhibitBug : Symbol(BugExhibition2.exhibitBug, Decl(methodContainingLocalFunction.ts, 9, 25)) + + function localFunction() { } +>localFunction : Symbol(localFunction, Decl(methodContainingLocalFunction.ts, 10, 37)) + + var x: { (): void; }; +>x : Symbol(x, Decl(methodContainingLocalFunction.ts, 12, 11)) + + x = localFunction; +>x : Symbol(x, Decl(methodContainingLocalFunction.ts, 12, 11)) +>localFunction : Symbol(localFunction, Decl(methodContainingLocalFunction.ts, 10, 37)) + + return null; + } +} + +class BugExhibition3 { +>BugExhibition3 : Symbol(BugExhibition3, Decl(methodContainingLocalFunction.ts, 16, 1)) +>T : Symbol(T, Decl(methodContainingLocalFunction.ts, 18, 21)) + + public exhibitBug() { +>exhibitBug : Symbol(exhibitBug, Decl(methodContainingLocalFunction.ts, 18, 25)) + + function localGenericFunction(u?: U) { } +>localGenericFunction : Symbol(localGenericFunction, Decl(methodContainingLocalFunction.ts, 19, 25)) +>U : Symbol(U, Decl(methodContainingLocalFunction.ts, 20, 38)) +>u : Symbol(u, Decl(methodContainingLocalFunction.ts, 20, 41)) +>U : Symbol(U, Decl(methodContainingLocalFunction.ts, 20, 38)) + + var x: { (): void; }; +>x : Symbol(x, Decl(methodContainingLocalFunction.ts, 21, 11)) + + x = localGenericFunction; +>x : Symbol(x, Decl(methodContainingLocalFunction.ts, 21, 11)) +>localGenericFunction : Symbol(localGenericFunction, Decl(methodContainingLocalFunction.ts, 19, 25)) + } +} + +class C { +>C : Symbol(C, Decl(methodContainingLocalFunction.ts, 24, 1)) + + exhibit() { +>exhibit : Symbol(exhibit, Decl(methodContainingLocalFunction.ts, 26, 9)) + + var funcExpr = (u?: U) => { }; +>funcExpr : Symbol(funcExpr, Decl(methodContainingLocalFunction.ts, 28, 11)) +>U : Symbol(U, Decl(methodContainingLocalFunction.ts, 28, 24)) +>u : Symbol(u, Decl(methodContainingLocalFunction.ts, 28, 27)) +>U : Symbol(U, Decl(methodContainingLocalFunction.ts, 28, 24)) + + var x: { (): void; }; +>x : Symbol(x, Decl(methodContainingLocalFunction.ts, 29, 11)) + + x = funcExpr; +>x : Symbol(x, Decl(methodContainingLocalFunction.ts, 29, 11)) +>funcExpr : Symbol(funcExpr, Decl(methodContainingLocalFunction.ts, 28, 11)) + } +} + +module M { +>M : Symbol(M, Decl(methodContainingLocalFunction.ts, 32, 1)) + + export function exhibitBug() { +>exhibitBug : Symbol(exhibitBug, Decl(methodContainingLocalFunction.ts, 34, 10)) + + function localFunction() { } +>localFunction : Symbol(localFunction, Decl(methodContainingLocalFunction.ts, 35, 34)) + + var x: { (): void; }; +>x : Symbol(x, Decl(methodContainingLocalFunction.ts, 37, 11)) + + x = localFunction; +>x : Symbol(x, Decl(methodContainingLocalFunction.ts, 37, 11)) +>localFunction : Symbol(localFunction, Decl(methodContainingLocalFunction.ts, 35, 34)) + } +} + +enum E { +>E : Symbol(E, Decl(methodContainingLocalFunction.ts, 40, 1)) + + A = (() => { +>A : Symbol(E.A, Decl(methodContainingLocalFunction.ts, 42, 8)) + + function localFunction() { } +>localFunction : Symbol(localFunction, Decl(methodContainingLocalFunction.ts, 43, 16)) + + var x: { (): void; }; +>x : Symbol(x, Decl(methodContainingLocalFunction.ts, 45, 11)) + + x = localFunction; +>x : Symbol(x, Decl(methodContainingLocalFunction.ts, 45, 11)) +>localFunction : Symbol(localFunction, Decl(methodContainingLocalFunction.ts, 43, 16)) + + return 0; + })() +} diff --git a/tests/baselines/reference/methodContainingLocalFunction.types b/tests/baselines/reference/methodContainingLocalFunction.types index 48c4be12631..8b6d102ade8 100644 --- a/tests/baselines/reference/methodContainingLocalFunction.types +++ b/tests/baselines/reference/methodContainingLocalFunction.types @@ -39,6 +39,7 @@ class BugExhibition2 { >localFunction : () => void return null; +>null : null } } @@ -128,5 +129,7 @@ enum E { >localFunction : () => void return 0; +>0 : number + })() } diff --git a/tests/baselines/reference/methodSignatureDeclarationEmit1.symbols b/tests/baselines/reference/methodSignatureDeclarationEmit1.symbols new file mode 100644 index 00000000000..80e0d2e1e6c --- /dev/null +++ b/tests/baselines/reference/methodSignatureDeclarationEmit1.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/methodSignatureDeclarationEmit1.ts === +class C { +>C : Symbol(C, Decl(methodSignatureDeclarationEmit1.ts, 0, 0)) + + public foo(n: number): void; +>foo : Symbol(foo, Decl(methodSignatureDeclarationEmit1.ts, 0, 9), Decl(methodSignatureDeclarationEmit1.ts, 1, 30), Decl(methodSignatureDeclarationEmit1.ts, 2, 30)) +>n : Symbol(n, Decl(methodSignatureDeclarationEmit1.ts, 1, 13)) + + public foo(s: string): void; +>foo : Symbol(foo, Decl(methodSignatureDeclarationEmit1.ts, 0, 9), Decl(methodSignatureDeclarationEmit1.ts, 1, 30), Decl(methodSignatureDeclarationEmit1.ts, 2, 30)) +>s : Symbol(s, Decl(methodSignatureDeclarationEmit1.ts, 2, 13)) + + public foo(a: any): void { +>foo : Symbol(foo, Decl(methodSignatureDeclarationEmit1.ts, 0, 9), Decl(methodSignatureDeclarationEmit1.ts, 1, 30), Decl(methodSignatureDeclarationEmit1.ts, 2, 30)) +>a : Symbol(a, Decl(methodSignatureDeclarationEmit1.ts, 3, 13)) + } +} diff --git a/tests/baselines/reference/methodSignaturesWithOverloads2.symbols b/tests/baselines/reference/methodSignaturesWithOverloads2.symbols new file mode 100644 index 00000000000..6446c128405 --- /dev/null +++ b/tests/baselines/reference/methodSignaturesWithOverloads2.symbols @@ -0,0 +1,92 @@ +=== tests/cases/conformance/types/objectTypeLiteral/methodSignatures/methodSignaturesWithOverloads2.ts === +// Object type literals permit overloads with optionality but they must match + +var c: { +>c : Symbol(c, Decl(methodSignaturesWithOverloads2.ts, 2, 3)) + + func4?(x: number): number; +>func4 : Symbol(func4, Decl(methodSignaturesWithOverloads2.ts, 2, 8), Decl(methodSignaturesWithOverloads2.ts, 3, 30)) +>x : Symbol(x, Decl(methodSignaturesWithOverloads2.ts, 3, 11)) + + func4?(s: string): string; +>func4 : Symbol(func4, Decl(methodSignaturesWithOverloads2.ts, 2, 8), Decl(methodSignaturesWithOverloads2.ts, 3, 30)) +>s : Symbol(s, Decl(methodSignaturesWithOverloads2.ts, 4, 11)) + + func5?: { +>func5 : Symbol(func5, Decl(methodSignaturesWithOverloads2.ts, 4, 30)) + + (x: number): number; +>x : Symbol(x, Decl(methodSignaturesWithOverloads2.ts, 6, 9)) + + (s: string): string; +>s : Symbol(s, Decl(methodSignaturesWithOverloads2.ts, 7, 9)) + + }; +}; + +// no errors +c.func4 = c.func5; +>c.func4 : Symbol(func4, Decl(methodSignaturesWithOverloads2.ts, 2, 8), Decl(methodSignaturesWithOverloads2.ts, 3, 30)) +>c : Symbol(c, Decl(methodSignaturesWithOverloads2.ts, 2, 3)) +>func4 : Symbol(func4, Decl(methodSignaturesWithOverloads2.ts, 2, 8), Decl(methodSignaturesWithOverloads2.ts, 3, 30)) +>c.func5 : Symbol(func5, Decl(methodSignaturesWithOverloads2.ts, 4, 30)) +>c : Symbol(c, Decl(methodSignaturesWithOverloads2.ts, 2, 3)) +>func5 : Symbol(func5, Decl(methodSignaturesWithOverloads2.ts, 4, 30)) + +c.func5 = c.func4; +>c.func5 : Symbol(func5, Decl(methodSignaturesWithOverloads2.ts, 4, 30)) +>c : Symbol(c, Decl(methodSignaturesWithOverloads2.ts, 2, 3)) +>func5 : Symbol(func5, Decl(methodSignaturesWithOverloads2.ts, 4, 30)) +>c.func4 : Symbol(func4, Decl(methodSignaturesWithOverloads2.ts, 2, 8), Decl(methodSignaturesWithOverloads2.ts, 3, 30)) +>c : Symbol(c, Decl(methodSignaturesWithOverloads2.ts, 2, 3)) +>func4 : Symbol(func4, Decl(methodSignaturesWithOverloads2.ts, 2, 8), Decl(methodSignaturesWithOverloads2.ts, 3, 30)) + + +var c2: { +>c2 : Symbol(c2, Decl(methodSignaturesWithOverloads2.ts, 16, 3)) + + func4?(x: T): number; +>func4 : Symbol(func4, Decl(methodSignaturesWithOverloads2.ts, 16, 9), Decl(methodSignaturesWithOverloads2.ts, 17, 28)) +>T : Symbol(T, Decl(methodSignaturesWithOverloads2.ts, 17, 11)) +>x : Symbol(x, Decl(methodSignaturesWithOverloads2.ts, 17, 14)) +>T : Symbol(T, Decl(methodSignaturesWithOverloads2.ts, 17, 11)) + + func4? (s: T): string; +>func4 : Symbol(func4, Decl(methodSignaturesWithOverloads2.ts, 16, 9), Decl(methodSignaturesWithOverloads2.ts, 17, 28)) +>T : Symbol(T, Decl(methodSignaturesWithOverloads2.ts, 18, 12)) +>s : Symbol(s, Decl(methodSignaturesWithOverloads2.ts, 18, 15)) +>T : Symbol(T, Decl(methodSignaturesWithOverloads2.ts, 18, 12)) + + func5?: { +>func5 : Symbol(func5, Decl(methodSignaturesWithOverloads2.ts, 18, 29)) + + (x: T): number; +>T : Symbol(T, Decl(methodSignaturesWithOverloads2.ts, 20, 9)) +>x : Symbol(x, Decl(methodSignaturesWithOverloads2.ts, 20, 12)) +>T : Symbol(T, Decl(methodSignaturesWithOverloads2.ts, 20, 9)) + + (s: T): string; +>T : Symbol(T, Decl(methodSignaturesWithOverloads2.ts, 21, 9)) +>s : Symbol(s, Decl(methodSignaturesWithOverloads2.ts, 21, 12)) +>T : Symbol(T, Decl(methodSignaturesWithOverloads2.ts, 21, 9)) + + }; +}; + +// no errors +c2.func4 = c2.func5; +>c2.func4 : Symbol(func4, Decl(methodSignaturesWithOverloads2.ts, 16, 9), Decl(methodSignaturesWithOverloads2.ts, 17, 28)) +>c2 : Symbol(c2, Decl(methodSignaturesWithOverloads2.ts, 16, 3)) +>func4 : Symbol(func4, Decl(methodSignaturesWithOverloads2.ts, 16, 9), Decl(methodSignaturesWithOverloads2.ts, 17, 28)) +>c2.func5 : Symbol(func5, Decl(methodSignaturesWithOverloads2.ts, 18, 29)) +>c2 : Symbol(c2, Decl(methodSignaturesWithOverloads2.ts, 16, 3)) +>func5 : Symbol(func5, Decl(methodSignaturesWithOverloads2.ts, 18, 29)) + +c2.func5 = c2.func4; +>c2.func5 : Symbol(func5, Decl(methodSignaturesWithOverloads2.ts, 18, 29)) +>c2 : Symbol(c2, Decl(methodSignaturesWithOverloads2.ts, 16, 3)) +>func5 : Symbol(func5, Decl(methodSignaturesWithOverloads2.ts, 18, 29)) +>c2.func4 : Symbol(func4, Decl(methodSignaturesWithOverloads2.ts, 16, 9), Decl(methodSignaturesWithOverloads2.ts, 17, 28)) +>c2 : Symbol(c2, Decl(methodSignaturesWithOverloads2.ts, 16, 3)) +>func4 : Symbol(func4, Decl(methodSignaturesWithOverloads2.ts, 16, 9), Decl(methodSignaturesWithOverloads2.ts, 17, 28)) + diff --git a/tests/baselines/reference/mismatchedGenericArguments1.symbols b/tests/baselines/reference/mismatchedGenericArguments1.symbols new file mode 100644 index 00000000000..f540c3d7ccb --- /dev/null +++ b/tests/baselines/reference/mismatchedGenericArguments1.symbols @@ -0,0 +1,41 @@ +=== tests/cases/compiler/mismatchedGenericArguments1.ts === +interface IFoo { +>IFoo : Symbol(IFoo, Decl(mismatchedGenericArguments1.ts, 0, 0)) +>T : Symbol(T, Decl(mismatchedGenericArguments1.ts, 0, 15)) + + foo(x: T): T; +>foo : Symbol(foo, Decl(mismatchedGenericArguments1.ts, 0, 19)) +>T : Symbol(T, Decl(mismatchedGenericArguments1.ts, 1, 7)) +>x : Symbol(x, Decl(mismatchedGenericArguments1.ts, 1, 10)) +>T : Symbol(T, Decl(mismatchedGenericArguments1.ts, 1, 7)) +>T : Symbol(T, Decl(mismatchedGenericArguments1.ts, 1, 7)) +} +class C implements IFoo { +>C : Symbol(C, Decl(mismatchedGenericArguments1.ts, 2, 1)) +>T : Symbol(T, Decl(mismatchedGenericArguments1.ts, 3, 8)) +>IFoo : Symbol(IFoo, Decl(mismatchedGenericArguments1.ts, 0, 0)) +>T : Symbol(T, Decl(mismatchedGenericArguments1.ts, 3, 8)) + + foo(x: string): number { +>foo : Symbol(foo, Decl(mismatchedGenericArguments1.ts, 3, 31)) +>x : Symbol(x, Decl(mismatchedGenericArguments1.ts, 4, 7)) + + return null; + } +} + +class C2 implements IFoo { +>C2 : Symbol(C2, Decl(mismatchedGenericArguments1.ts, 7, 1)) +>T : Symbol(T, Decl(mismatchedGenericArguments1.ts, 9, 9)) +>IFoo : Symbol(IFoo, Decl(mismatchedGenericArguments1.ts, 0, 0)) +>T : Symbol(T, Decl(mismatchedGenericArguments1.ts, 9, 9)) + + foo(x: string): number { +>foo : Symbol(foo, Decl(mismatchedGenericArguments1.ts, 9, 32)) +>U : Symbol(U, Decl(mismatchedGenericArguments1.ts, 10, 7)) +>x : Symbol(x, Decl(mismatchedGenericArguments1.ts, 10, 10)) + + return null; + } +} + diff --git a/tests/baselines/reference/mismatchedGenericArguments1.types b/tests/baselines/reference/mismatchedGenericArguments1.types index 4d4d216bef1..c681445ab16 100644 --- a/tests/baselines/reference/mismatchedGenericArguments1.types +++ b/tests/baselines/reference/mismatchedGenericArguments1.types @@ -21,6 +21,7 @@ class C implements IFoo { >x : string return null; +>null : null } } @@ -36,6 +37,7 @@ class C2 implements IFoo { >x : string return null; +>null : null } } diff --git a/tests/baselines/reference/missingImportAfterModuleImport.symbols b/tests/baselines/reference/missingImportAfterModuleImport.symbols new file mode 100644 index 00000000000..3ed1d93431c --- /dev/null +++ b/tests/baselines/reference/missingImportAfterModuleImport.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/missingImportAfterModuleImport_1.ts === +/// +import SubModule = require('SubModule'); +>SubModule : Symbol(SubModule, Decl(missingImportAfterModuleImport_1.ts, 0, 0)) + +class MainModule { +>MainModule : Symbol(MainModule, Decl(missingImportAfterModuleImport_1.ts, 1, 40)) + + // public static SubModule: SubModule; + public SubModule: SubModule; +>SubModule : Symbol(SubModule, Decl(missingImportAfterModuleImport_1.ts, 2, 18)) +>SubModule : Symbol(SubModule, Decl(missingImportAfterModuleImport_1.ts, 0, 0)) + + constructor() { } +} +export = MainModule; +>MainModule : Symbol(MainModule, Decl(missingImportAfterModuleImport_1.ts, 1, 40)) + + +=== tests/cases/compiler/missingImportAfterModuleImport_0.ts === + +declare module "SubModule" { + class SubModule { +>SubModule : Symbol(SubModule, Decl(missingImportAfterModuleImport_0.ts, 1, 28)) + + public static StaticVar: number; +>StaticVar : Symbol(SubModule.StaticVar, Decl(missingImportAfterModuleImport_0.ts, 2, 21)) + + public InstanceVar: number; +>InstanceVar : Symbol(InstanceVar, Decl(missingImportAfterModuleImport_0.ts, 3, 40)) + + constructor(); + } + export = SubModule; +>SubModule : Symbol(SubModule, Decl(missingImportAfterModuleImport_0.ts, 1, 28)) +} + diff --git a/tests/baselines/reference/missingSelf.symbols b/tests/baselines/reference/missingSelf.symbols new file mode 100644 index 00000000000..b4b5bd0b905 --- /dev/null +++ b/tests/baselines/reference/missingSelf.symbols @@ -0,0 +1,46 @@ +=== tests/cases/compiler/missingSelf.ts === +class CalcButton +>CalcButton : Symbol(CalcButton, Decl(missingSelf.ts, 0, 0)) +{ + public a() { this.onClick(); } +>a : Symbol(a, Decl(missingSelf.ts, 1, 1)) +>this.onClick : Symbol(onClick, Decl(missingSelf.ts, 2, 34)) +>this : Symbol(CalcButton, Decl(missingSelf.ts, 0, 0)) +>onClick : Symbol(onClick, Decl(missingSelf.ts, 2, 34)) + + public onClick() { } +>onClick : Symbol(onClick, Decl(missingSelf.ts, 2, 34)) +} + +class CalcButton2 +>CalcButton2 : Symbol(CalcButton2, Decl(missingSelf.ts, 4, 1)) +{ + public b() { () => this.onClick(); } +>b : Symbol(b, Decl(missingSelf.ts, 7, 1)) +>this.onClick : Symbol(onClick, Decl(missingSelf.ts, 8, 40)) +>this : Symbol(CalcButton2, Decl(missingSelf.ts, 4, 1)) +>onClick : Symbol(onClick, Decl(missingSelf.ts, 8, 40)) + + public onClick() { } +>onClick : Symbol(onClick, Decl(missingSelf.ts, 8, 40)) +} + +var c = new CalcButton(); +>c : Symbol(c, Decl(missingSelf.ts, 12, 3)) +>CalcButton : Symbol(CalcButton, Decl(missingSelf.ts, 0, 0)) + +c.a(); +>c.a : Symbol(CalcButton.a, Decl(missingSelf.ts, 1, 1)) +>c : Symbol(c, Decl(missingSelf.ts, 12, 3)) +>a : Symbol(CalcButton.a, Decl(missingSelf.ts, 1, 1)) + +var c2 = new CalcButton2(); +>c2 : Symbol(c2, Decl(missingSelf.ts, 14, 3)) +>CalcButton2 : Symbol(CalcButton2, Decl(missingSelf.ts, 4, 1)) + +c2.b(); +>c2.b : Symbol(CalcButton2.b, Decl(missingSelf.ts, 7, 1)) +>c2 : Symbol(c2, Decl(missingSelf.ts, 14, 3)) +>b : Symbol(CalcButton2.b, Decl(missingSelf.ts, 7, 1)) + + diff --git a/tests/baselines/reference/missingTypeArguments3.symbols b/tests/baselines/reference/missingTypeArguments3.symbols new file mode 100644 index 00000000000..4bd7943eace --- /dev/null +++ b/tests/baselines/reference/missingTypeArguments3.symbols @@ -0,0 +1,172 @@ +=== tests/cases/compiler/missingTypeArguments3.ts === +declare module linq { +>linq : Symbol(linq, Decl(missingTypeArguments3.ts, 0, 0)) + + interface Enumerable { +>Enumerable : Symbol(Enumerable, Decl(missingTypeArguments3.ts, 0, 21)) +>T : Symbol(T, Decl(missingTypeArguments3.ts, 2, 25)) + + OrderByDescending(keySelector?: string): OrderedEnumerable; +>OrderByDescending : Symbol(OrderByDescending, Decl(missingTypeArguments3.ts, 2, 29)) +>keySelector : Symbol(keySelector, Decl(missingTypeArguments3.ts, 3, 26)) +>OrderedEnumerable : Symbol(OrderedEnumerable, Decl(missingTypeArguments3.ts, 7, 5)) +>T : Symbol(T, Decl(missingTypeArguments3.ts, 2, 25)) + + GroupBy(keySelector: (element: T) => TKey): Enumerable>; +>GroupBy : Symbol(GroupBy, Decl(missingTypeArguments3.ts, 3, 70), Decl(missingTypeArguments3.ts, 4, 88)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 4, 16)) +>keySelector : Symbol(keySelector, Decl(missingTypeArguments3.ts, 4, 22)) +>element : Symbol(element, Decl(missingTypeArguments3.ts, 4, 36)) +>T : Symbol(T, Decl(missingTypeArguments3.ts, 2, 25)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 4, 16)) +>Enumerable : Symbol(Enumerable, Decl(missingTypeArguments3.ts, 0, 21)) +>Grouping : Symbol(Grouping, Decl(missingTypeArguments3.ts, 11, 5)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 4, 16)) +>T : Symbol(T, Decl(missingTypeArguments3.ts, 2, 25)) + + GroupBy(keySelector: (element: T) => TKey, elementSelector: (element: T) => TElement): Enumerable>; +>GroupBy : Symbol(GroupBy, Decl(missingTypeArguments3.ts, 3, 70), Decl(missingTypeArguments3.ts, 4, 88)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 5, 16)) +>TElement : Symbol(TElement, Decl(missingTypeArguments3.ts, 5, 21)) +>keySelector : Symbol(keySelector, Decl(missingTypeArguments3.ts, 5, 32)) +>element : Symbol(element, Decl(missingTypeArguments3.ts, 5, 46)) +>T : Symbol(T, Decl(missingTypeArguments3.ts, 2, 25)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 5, 16)) +>elementSelector : Symbol(elementSelector, Decl(missingTypeArguments3.ts, 5, 66)) +>element : Symbol(element, Decl(missingTypeArguments3.ts, 5, 85)) +>T : Symbol(T, Decl(missingTypeArguments3.ts, 2, 25)) +>TElement : Symbol(TElement, Decl(missingTypeArguments3.ts, 5, 21)) +>Enumerable : Symbol(Enumerable, Decl(missingTypeArguments3.ts, 0, 21)) +>Grouping : Symbol(Grouping, Decl(missingTypeArguments3.ts, 11, 5)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 5, 16)) +>TElement : Symbol(TElement, Decl(missingTypeArguments3.ts, 5, 21)) + + ToDictionary(keySelector: (element: T) => TKey): Dictionary; +>ToDictionary : Symbol(ToDictionary, Decl(missingTypeArguments3.ts, 5, 148)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 6, 21)) +>keySelector : Symbol(keySelector, Decl(missingTypeArguments3.ts, 6, 27)) +>element : Symbol(element, Decl(missingTypeArguments3.ts, 6, 41)) +>T : Symbol(T, Decl(missingTypeArguments3.ts, 2, 25)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 6, 21)) +>Dictionary : Symbol(Dictionary, Decl(missingTypeArguments3.ts, 22, 5)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 6, 21)) +>T : Symbol(T, Decl(missingTypeArguments3.ts, 2, 25)) + } + + interface OrderedEnumerable extends Enumerable { +>OrderedEnumerable : Symbol(OrderedEnumerable, Decl(missingTypeArguments3.ts, 7, 5)) +>T : Symbol(T, Decl(missingTypeArguments3.ts, 9, 32)) +>Enumerable : Symbol(Enumerable, Decl(missingTypeArguments3.ts, 0, 21)) +>T : Symbol(T, Decl(missingTypeArguments3.ts, 9, 32)) + + ThenBy(keySelector: (element: T) => TCompare): OrderedEnumerable; // used to incorrectly think this was missing a type argument +>ThenBy : Symbol(ThenBy, Decl(missingTypeArguments3.ts, 9, 58)) +>TCompare : Symbol(TCompare, Decl(missingTypeArguments3.ts, 10, 15)) +>keySelector : Symbol(keySelector, Decl(missingTypeArguments3.ts, 10, 25)) +>element : Symbol(element, Decl(missingTypeArguments3.ts, 10, 39)) +>T : Symbol(T, Decl(missingTypeArguments3.ts, 9, 32)) +>TCompare : Symbol(TCompare, Decl(missingTypeArguments3.ts, 10, 15)) +>OrderedEnumerable : Symbol(OrderedEnumerable, Decl(missingTypeArguments3.ts, 7, 5)) +>T : Symbol(T, Decl(missingTypeArguments3.ts, 9, 32)) + } + + interface Grouping extends Enumerable { +>Grouping : Symbol(Grouping, Decl(missingTypeArguments3.ts, 11, 5)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 13, 23)) +>TElement : Symbol(TElement, Decl(missingTypeArguments3.ts, 13, 28)) +>Enumerable : Symbol(Enumerable, Decl(missingTypeArguments3.ts, 0, 21)) +>TElement : Symbol(TElement, Decl(missingTypeArguments3.ts, 13, 28)) + + Key(): TKey; +>Key : Symbol(Key, Decl(missingTypeArguments3.ts, 13, 69)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 13, 23)) + } + + interface Lookup { +>Lookup : Symbol(Lookup, Decl(missingTypeArguments3.ts, 15, 5)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 17, 21)) +>TElement : Symbol(TElement, Decl(missingTypeArguments3.ts, 17, 26)) + + Count(): number; +>Count : Symbol(Count, Decl(missingTypeArguments3.ts, 17, 38)) + + Get(key): Enumerable; +>Get : Symbol(Get, Decl(missingTypeArguments3.ts, 18, 24)) +>key : Symbol(key, Decl(missingTypeArguments3.ts, 19, 12)) +>Enumerable : Symbol(Enumerable, Decl(missingTypeArguments3.ts, 0, 21)) + + Contains(key): boolean; +>Contains : Symbol(Contains, Decl(missingTypeArguments3.ts, 19, 34)) +>key : Symbol(key, Decl(missingTypeArguments3.ts, 20, 17)) + + ToEnumerable(): Enumerable>; +>ToEnumerable : Symbol(ToEnumerable, Decl(missingTypeArguments3.ts, 20, 31)) +>Enumerable : Symbol(Enumerable, Decl(missingTypeArguments3.ts, 0, 21)) +>Grouping : Symbol(Grouping, Decl(missingTypeArguments3.ts, 11, 5)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 17, 21)) + } + + interface Dictionary { +>Dictionary : Symbol(Dictionary, Decl(missingTypeArguments3.ts, 22, 5)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 24, 25)) +>TValue : Symbol(TValue, Decl(missingTypeArguments3.ts, 24, 30)) + + Add(key: TKey, value: TValue): void; +>Add : Symbol(Add, Decl(missingTypeArguments3.ts, 24, 40)) +>key : Symbol(key, Decl(missingTypeArguments3.ts, 25, 12)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 24, 25)) +>value : Symbol(value, Decl(missingTypeArguments3.ts, 25, 22)) +>TValue : Symbol(TValue, Decl(missingTypeArguments3.ts, 24, 30)) + + Get(ke: TKey): TValue; +>Get : Symbol(Get, Decl(missingTypeArguments3.ts, 25, 44)) +>ke : Symbol(ke, Decl(missingTypeArguments3.ts, 26, 12)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 24, 25)) +>TValue : Symbol(TValue, Decl(missingTypeArguments3.ts, 24, 30)) + + Set(key: TKey, value: TValue): boolean; +>Set : Symbol(Set, Decl(missingTypeArguments3.ts, 26, 30)) +>key : Symbol(key, Decl(missingTypeArguments3.ts, 27, 12)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 24, 25)) +>value : Symbol(value, Decl(missingTypeArguments3.ts, 27, 22)) +>TValue : Symbol(TValue, Decl(missingTypeArguments3.ts, 24, 30)) + + Contains(key: TKey): boolean; +>Contains : Symbol(Contains, Decl(missingTypeArguments3.ts, 27, 47)) +>key : Symbol(key, Decl(missingTypeArguments3.ts, 28, 17)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 24, 25)) + + Clear(): void; +>Clear : Symbol(Clear, Decl(missingTypeArguments3.ts, 28, 37)) + + Remove(key: TKey): void; +>Remove : Symbol(Remove, Decl(missingTypeArguments3.ts, 29, 22)) +>key : Symbol(key, Decl(missingTypeArguments3.ts, 30, 15)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 24, 25)) + + Count(): number; +>Count : Symbol(Count, Decl(missingTypeArguments3.ts, 30, 32)) + + ToEnumerable(): Enumerable>; +>ToEnumerable : Symbol(ToEnumerable, Decl(missingTypeArguments3.ts, 31, 24)) +>Enumerable : Symbol(Enumerable, Decl(missingTypeArguments3.ts, 0, 21)) +>KeyValuePair : Symbol(KeyValuePair, Decl(missingTypeArguments3.ts, 33, 5)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 24, 25)) +>TValue : Symbol(TValue, Decl(missingTypeArguments3.ts, 24, 30)) + } + + interface KeyValuePair { +>KeyValuePair : Symbol(KeyValuePair, Decl(missingTypeArguments3.ts, 33, 5)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 35, 27)) +>TValue : Symbol(TValue, Decl(missingTypeArguments3.ts, 35, 32)) + + Key: TKey; +>Key : Symbol(Key, Decl(missingTypeArguments3.ts, 35, 42)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 35, 27)) + + Value: TValue; +>Value : Symbol(Value, Decl(missingTypeArguments3.ts, 36, 18)) +>TValue : Symbol(TValue, Decl(missingTypeArguments3.ts, 35, 32)) + } +} + diff --git a/tests/baselines/reference/missingTypeArguments3.types b/tests/baselines/reference/missingTypeArguments3.types index ec6d9944924..d7f850916f9 100644 --- a/tests/baselines/reference/missingTypeArguments3.types +++ b/tests/baselines/reference/missingTypeArguments3.types @@ -1,6 +1,6 @@ === tests/cases/compiler/missingTypeArguments3.ts === declare module linq { ->linq : unknown +>linq : any interface Enumerable { >Enumerable : Enumerable diff --git a/tests/baselines/reference/mixedExports.symbols b/tests/baselines/reference/mixedExports.symbols new file mode 100644 index 00000000000..317b60e0a8c --- /dev/null +++ b/tests/baselines/reference/mixedExports.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/mixedExports.ts === +declare module M { +>M : Symbol(M, Decl(mixedExports.ts, 0, 0)) + + function foo(); +>foo : Symbol(foo, Decl(mixedExports.ts, 0, 18), Decl(mixedExports.ts, 1, 20), Decl(mixedExports.ts, 2, 27)) + + export function foo(); +>foo : Symbol(foo, Decl(mixedExports.ts, 0, 18), Decl(mixedExports.ts, 1, 20), Decl(mixedExports.ts, 2, 27)) + + function foo(); +>foo : Symbol(foo, Decl(mixedExports.ts, 0, 18), Decl(mixedExports.ts, 1, 20), Decl(mixedExports.ts, 2, 27)) +} + +declare module M1 { +>M1 : Symbol(M1, Decl(mixedExports.ts, 4, 1)) + + export interface Foo {} +>Foo : Symbol(Foo, Decl(mixedExports.ts, 6, 19), Decl(mixedExports.ts, 7, 28)) + + interface Foo {} +>Foo : Symbol(Foo, Decl(mixedExports.ts, 6, 19), Decl(mixedExports.ts, 7, 28)) +} + +module A { +>A : Symbol(A, Decl(mixedExports.ts, 9, 1)) + + interface X {x} +>X : Symbol(X, Decl(mixedExports.ts, 11, 10), Decl(mixedExports.ts, 12, 20), Decl(mixedExports.ts, 13, 23)) +>x : Symbol(x, Decl(mixedExports.ts, 12, 18)) + + export module X {} +>X : Symbol(X, Decl(mixedExports.ts, 12, 20)) + + interface X {y} +>X : Symbol(X, Decl(mixedExports.ts, 11, 10), Decl(mixedExports.ts, 12, 20), Decl(mixedExports.ts, 13, 23)) +>y : Symbol(y, Decl(mixedExports.ts, 14, 18)) +} diff --git a/tests/baselines/reference/mixedExports.types b/tests/baselines/reference/mixedExports.types index f7ff0a13c34..fd0d24391e5 100644 --- a/tests/baselines/reference/mixedExports.types +++ b/tests/baselines/reference/mixedExports.types @@ -13,7 +13,7 @@ declare module M { } declare module M1 { ->M1 : unknown +>M1 : any export interface Foo {} >Foo : Foo @@ -23,14 +23,14 @@ declare module M1 { } module A { ->A : unknown +>A : any interface X {x} >X : X >x : any export module X {} ->X : unknown +>X : any interface X {y} >X : X diff --git a/tests/baselines/reference/mixingFunctionAndAmbientModule1.symbols b/tests/baselines/reference/mixingFunctionAndAmbientModule1.symbols new file mode 100644 index 00000000000..9fc43fd4ac0 --- /dev/null +++ b/tests/baselines/reference/mixingFunctionAndAmbientModule1.symbols @@ -0,0 +1,90 @@ +=== tests/cases/compiler/mixingFunctionAndAmbientModule1.ts === +module A { +>A : Symbol(A, Decl(mixingFunctionAndAmbientModule1.ts, 0, 0)) + + declare module My { +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 0, 10), Decl(mixingFunctionAndAmbientModule1.ts, 3, 5)) + + export var x: number; +>x : Symbol(x, Decl(mixingFunctionAndAmbientModule1.ts, 2, 18)) + } + function My(s: string) { } +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 0, 10), Decl(mixingFunctionAndAmbientModule1.ts, 3, 5)) +>s : Symbol(s, Decl(mixingFunctionAndAmbientModule1.ts, 4, 16)) +} + +module B { +>B : Symbol(B, Decl(mixingFunctionAndAmbientModule1.ts, 5, 1)) + + declare module My { +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 7, 10), Decl(mixingFunctionAndAmbientModule1.ts, 10, 5), Decl(mixingFunctionAndAmbientModule1.ts, 11, 28)) + + export var x: number; +>x : Symbol(x, Decl(mixingFunctionAndAmbientModule1.ts, 9, 18)) + } + function My(s: boolean); +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 7, 10), Decl(mixingFunctionAndAmbientModule1.ts, 10, 5), Decl(mixingFunctionAndAmbientModule1.ts, 11, 28)) +>s : Symbol(s, Decl(mixingFunctionAndAmbientModule1.ts, 11, 16)) + + function My(s: any) { } +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 7, 10), Decl(mixingFunctionAndAmbientModule1.ts, 10, 5), Decl(mixingFunctionAndAmbientModule1.ts, 11, 28)) +>s : Symbol(s, Decl(mixingFunctionAndAmbientModule1.ts, 12, 16)) +} + +module C { +>C : Symbol(C, Decl(mixingFunctionAndAmbientModule1.ts, 13, 1)) + + declare module My { +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 15, 10), Decl(mixingFunctionAndAmbientModule1.ts, 18, 5)) + + export var x: number; +>x : Symbol(x, Decl(mixingFunctionAndAmbientModule1.ts, 17, 18)) + } + declare function My(s: boolean); +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 15, 10), Decl(mixingFunctionAndAmbientModule1.ts, 18, 5)) +>s : Symbol(s, Decl(mixingFunctionAndAmbientModule1.ts, 19, 24)) +} + +module D { +>D : Symbol(D, Decl(mixingFunctionAndAmbientModule1.ts, 20, 1)) + + declare module My { +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 22, 10), Decl(mixingFunctionAndAmbientModule1.ts, 25, 5), Decl(mixingFunctionAndAmbientModule1.ts, 26, 36)) + + export var x: number; +>x : Symbol(x, Decl(mixingFunctionAndAmbientModule1.ts, 24, 18)) + } + declare function My(s: boolean); +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 22, 10), Decl(mixingFunctionAndAmbientModule1.ts, 25, 5), Decl(mixingFunctionAndAmbientModule1.ts, 26, 36)) +>s : Symbol(s, Decl(mixingFunctionAndAmbientModule1.ts, 26, 24)) + + declare function My(s: any); +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 22, 10), Decl(mixingFunctionAndAmbientModule1.ts, 25, 5), Decl(mixingFunctionAndAmbientModule1.ts, 26, 36)) +>s : Symbol(s, Decl(mixingFunctionAndAmbientModule1.ts, 27, 24)) +} + + +module E { +>E : Symbol(E, Decl(mixingFunctionAndAmbientModule1.ts, 28, 1)) + + declare module My { +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 31, 10), Decl(mixingFunctionAndAmbientModule1.ts, 34, 5), Decl(mixingFunctionAndAmbientModule1.ts, 35, 36), Decl(mixingFunctionAndAmbientModule1.ts, 38, 5)) + + export var x: number; +>x : Symbol(x, Decl(mixingFunctionAndAmbientModule1.ts, 33, 18)) + } + declare function My(s: boolean); +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 31, 10), Decl(mixingFunctionAndAmbientModule1.ts, 34, 5), Decl(mixingFunctionAndAmbientModule1.ts, 35, 36), Decl(mixingFunctionAndAmbientModule1.ts, 38, 5)) +>s : Symbol(s, Decl(mixingFunctionAndAmbientModule1.ts, 35, 24)) + + declare module My { +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 31, 10), Decl(mixingFunctionAndAmbientModule1.ts, 34, 5), Decl(mixingFunctionAndAmbientModule1.ts, 35, 36), Decl(mixingFunctionAndAmbientModule1.ts, 38, 5)) + + export var y: number; +>y : Symbol(y, Decl(mixingFunctionAndAmbientModule1.ts, 37, 18)) + } + declare function My(s: any); +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 31, 10), Decl(mixingFunctionAndAmbientModule1.ts, 34, 5), Decl(mixingFunctionAndAmbientModule1.ts, 35, 36), Decl(mixingFunctionAndAmbientModule1.ts, 38, 5)) +>s : Symbol(s, Decl(mixingFunctionAndAmbientModule1.ts, 39, 24)) +} + diff --git a/tests/baselines/reference/modFunctionCrash.symbols b/tests/baselines/reference/modFunctionCrash.symbols new file mode 100644 index 00000000000..b1063a40cd5 --- /dev/null +++ b/tests/baselines/reference/modFunctionCrash.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/modFunctionCrash.ts === +declare module Q { +>Q : Symbol(Q, Decl(modFunctionCrash.ts, 0, 0)) + + function f(fn:()=>void); // typechecking the function type shouldnot crash the compiler +>f : Symbol(f, Decl(modFunctionCrash.ts, 0, 18)) +>fn : Symbol(fn, Decl(modFunctionCrash.ts, 1, 15)) +} + + +Q.f(function() {this;}); +>Q.f : Symbol(Q.f, Decl(modFunctionCrash.ts, 0, 18)) +>Q : Symbol(Q, Decl(modFunctionCrash.ts, 0, 0)) +>f : Symbol(Q.f, Decl(modFunctionCrash.ts, 0, 18)) + diff --git a/tests/baselines/reference/modKeyword.symbols b/tests/baselines/reference/modKeyword.symbols new file mode 100644 index 00000000000..e308cb0a46c --- /dev/null +++ b/tests/baselines/reference/modKeyword.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/modKeyword.ts === +var module:any; +>module : Symbol(module, Decl(modKeyword.ts, 0, 3)) + +var foo:any; +>foo : Symbol(foo, Decl(modKeyword.ts, 1, 3)) + +var _ = module.exports = foo +>_ : Symbol(_, Decl(modKeyword.ts, 3, 3)) +>module : Symbol(module, Decl(modKeyword.ts, 0, 3)) +>foo : Symbol(foo, Decl(modKeyword.ts, 1, 3)) + diff --git a/tests/baselines/reference/moduleAliasAsFunctionArgument.symbols b/tests/baselines/reference/moduleAliasAsFunctionArgument.symbols new file mode 100644 index 00000000000..520dba18d06 --- /dev/null +++ b/tests/baselines/reference/moduleAliasAsFunctionArgument.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/moduleAliasAsFunctionArgument_1.ts === +/// +import a = require('moduleAliasAsFunctionArgument_0'); +>a : Symbol(a, Decl(moduleAliasAsFunctionArgument_1.ts, 0, 0)) + +function fn(arg: { x: number }) { +>fn : Symbol(fn, Decl(moduleAliasAsFunctionArgument_1.ts, 1, 54)) +>arg : Symbol(arg, Decl(moduleAliasAsFunctionArgument_1.ts, 3, 12)) +>x : Symbol(x, Decl(moduleAliasAsFunctionArgument_1.ts, 3, 18)) +} + +a.x; // OK +>a.x : Symbol(a.x, Decl(moduleAliasAsFunctionArgument_0.ts, 0, 10)) +>a : Symbol(a, Decl(moduleAliasAsFunctionArgument_1.ts, 0, 0)) +>x : Symbol(a.x, Decl(moduleAliasAsFunctionArgument_0.ts, 0, 10)) + +fn(a); // Error: property 'x' is missing from 'a' +>fn : Symbol(fn, Decl(moduleAliasAsFunctionArgument_1.ts, 1, 54)) +>a : Symbol(a, Decl(moduleAliasAsFunctionArgument_1.ts, 0, 0)) + +=== tests/cases/compiler/moduleAliasAsFunctionArgument_0.ts === +export var x: number; +>x : Symbol(x, Decl(moduleAliasAsFunctionArgument_0.ts, 0, 10)) + diff --git a/tests/baselines/reference/moduleAliasInterface.symbols b/tests/baselines/reference/moduleAliasInterface.symbols new file mode 100644 index 00000000000..9c4cfdf9b14 --- /dev/null +++ b/tests/baselines/reference/moduleAliasInterface.symbols @@ -0,0 +1,121 @@ +=== tests/cases/compiler/moduleAliasInterface.ts === +module _modes { +>_modes : Symbol(_modes, Decl(moduleAliasInterface.ts, 0, 0)) + + export interface IMode { +>IMode : Symbol(IMode, Decl(moduleAliasInterface.ts, 0, 15)) + + } + + export class Mode { +>Mode : Symbol(Mode, Decl(moduleAliasInterface.ts, 3, 2)) + + } +} + +// _modes. // produces an internal error - please implement in derived class + +module editor { +>editor : Symbol(editor, Decl(moduleAliasInterface.ts, 8, 1)) + + import modes = _modes; +>modes : Symbol(modes, Decl(moduleAliasInterface.ts, 12, 15)) +>_modes : Symbol(modes, Decl(moduleAliasInterface.ts, 0, 0)) + + var i : modes.IMode; +>i : Symbol(i, Decl(moduleAliasInterface.ts, 15, 4)) +>modes : Symbol(modes, Decl(moduleAliasInterface.ts, 12, 15)) +>IMode : Symbol(modes.IMode, Decl(moduleAliasInterface.ts, 0, 15)) + + // If you just use p1:modes, the compiler accepts it - should be an error + class Bug { +>Bug : Symbol(Bug, Decl(moduleAliasInterface.ts, 15, 21)) + + constructor(p1: modes.IMode, p2: modes.Mode) { }// should be an error on p2 - it's not exported +>p1 : Symbol(p1, Decl(moduleAliasInterface.ts, 19, 14)) +>modes : Symbol(modes, Decl(moduleAliasInterface.ts, 12, 15)) +>IMode : Symbol(modes.IMode, Decl(moduleAliasInterface.ts, 0, 15)) +>p2 : Symbol(p2, Decl(moduleAliasInterface.ts, 19, 30)) +>modes : Symbol(modes, Decl(moduleAliasInterface.ts, 12, 15)) +>Mode : Symbol(modes.Mode, Decl(moduleAliasInterface.ts, 3, 2)) + + public foo(p1:modes.IMode) { +>foo : Symbol(foo, Decl(moduleAliasInterface.ts, 19, 50)) +>p1 : Symbol(p1, Decl(moduleAliasInterface.ts, 20, 13)) +>modes : Symbol(modes, Decl(moduleAliasInterface.ts, 12, 15)) +>IMode : Symbol(modes.IMode, Decl(moduleAliasInterface.ts, 0, 15)) + + } + } +} + +import modesOuter = _modes; +>modesOuter : Symbol(modesOuter, Decl(moduleAliasInterface.ts, 24, 1)) +>_modes : Symbol(_modes, Decl(moduleAliasInterface.ts, 0, 0)) + +module editor2 { +>editor2 : Symbol(editor2, Decl(moduleAliasInterface.ts, 26, 27)) + + var i : modesOuter.IMode; +>i : Symbol(i, Decl(moduleAliasInterface.ts, 29, 4)) +>modesOuter : Symbol(modesOuter, Decl(moduleAliasInterface.ts, 24, 1)) +>IMode : Symbol(modesOuter.IMode, Decl(moduleAliasInterface.ts, 0, 15)) + + class Bug { +>Bug : Symbol(Bug, Decl(moduleAliasInterface.ts, 29, 26)) + + constructor(p1: modesOuter.IMode, p2: modesOuter.Mode) { }// no error here, since modesOuter is declared externally +>p1 : Symbol(p1, Decl(moduleAliasInterface.ts, 32, 17)) +>modesOuter : Symbol(modesOuter, Decl(moduleAliasInterface.ts, 24, 1)) +>IMode : Symbol(modesOuter.IMode, Decl(moduleAliasInterface.ts, 0, 15)) +>p2 : Symbol(p2, Decl(moduleAliasInterface.ts, 32, 38)) +>modesOuter : Symbol(modesOuter, Decl(moduleAliasInterface.ts, 24, 1)) +>Mode : Symbol(modesOuter.Mode, Decl(moduleAliasInterface.ts, 3, 2)) + + } + + module Foo { export class Bar{} } +>Foo : Symbol(Foo, Decl(moduleAliasInterface.ts, 34, 2)) +>Bar : Symbol(Bar, Decl(moduleAliasInterface.ts, 36, 14)) + + class Bug2 { +>Bug2 : Symbol(Bug2, Decl(moduleAliasInterface.ts, 36, 35)) + + constructor(p1: Foo.Bar, p2: modesOuter.Mode) { } +>p1 : Symbol(p1, Decl(moduleAliasInterface.ts, 39, 18)) +>Foo : Symbol(Foo, Decl(moduleAliasInterface.ts, 34, 2)) +>Bar : Symbol(Foo.Bar, Decl(moduleAliasInterface.ts, 36, 14)) +>p2 : Symbol(p2, Decl(moduleAliasInterface.ts, 39, 30)) +>modesOuter : Symbol(modesOuter, Decl(moduleAliasInterface.ts, 24, 1)) +>Mode : Symbol(modesOuter.Mode, Decl(moduleAliasInterface.ts, 3, 2)) + } +} + +module A1 { +>A1 : Symbol(A1, Decl(moduleAliasInterface.ts, 41, 1)) + + export interface A1I1 {} +>A1I1 : Symbol(A1I1, Decl(moduleAliasInterface.ts, 43, 11)) + + export class A1C1 {} +>A1C1 : Symbol(A1C1, Decl(moduleAliasInterface.ts, 44, 28)) +} + +module B1 { +>B1 : Symbol(B1, Decl(moduleAliasInterface.ts, 46, 1)) + + import A1Alias1 = A1; +>A1Alias1 : Symbol(A1Alias1, Decl(moduleAliasInterface.ts, 48, 11)) +>A1 : Symbol(A1Alias1, Decl(moduleAliasInterface.ts, 41, 1)) + + var i : A1Alias1.A1I1; +>i : Symbol(i, Decl(moduleAliasInterface.ts, 51, 7)) +>A1Alias1 : Symbol(A1Alias1, Decl(moduleAliasInterface.ts, 48, 11)) +>A1I1 : Symbol(A1Alias1.A1I1, Decl(moduleAliasInterface.ts, 43, 11)) + + var c : A1Alias1.A1C1; +>c : Symbol(c, Decl(moduleAliasInterface.ts, 52, 7)) +>A1Alias1 : Symbol(A1Alias1, Decl(moduleAliasInterface.ts, 48, 11)) +>A1C1 : Symbol(A1Alias1.A1C1, Decl(moduleAliasInterface.ts, 44, 28)) +} + diff --git a/tests/baselines/reference/moduleAliasInterface.types b/tests/baselines/reference/moduleAliasInterface.types index 6d3b11197cb..8e1dd1ec82c 100644 --- a/tests/baselines/reference/moduleAliasInterface.types +++ b/tests/baselines/reference/moduleAliasInterface.types @@ -24,7 +24,7 @@ module editor { var i : modes.IMode; >i : modes.IMode ->modes : unknown +>modes : any >IMode : modes.IMode // If you just use p1:modes, the compiler accepts it - should be an error @@ -33,16 +33,16 @@ module editor { constructor(p1: modes.IMode, p2: modes.Mode) { }// should be an error on p2 - it's not exported >p1 : modes.IMode ->modes : unknown +>modes : any >IMode : modes.IMode >p2 : modes.Mode ->modes : unknown +>modes : any >Mode : modes.Mode public foo(p1:modes.IMode) { >foo : (p1: modes.IMode) => void >p1 : modes.IMode ->modes : unknown +>modes : any >IMode : modes.IMode } @@ -58,7 +58,7 @@ module editor2 { var i : modesOuter.IMode; >i : modesOuter.IMode ->modesOuter : unknown +>modesOuter : any >IMode : modesOuter.IMode class Bug { @@ -66,10 +66,10 @@ module editor2 { constructor(p1: modesOuter.IMode, p2: modesOuter.Mode) { }// no error here, since modesOuter is declared externally >p1 : modesOuter.IMode ->modesOuter : unknown +>modesOuter : any >IMode : modesOuter.IMode >p2 : modesOuter.Mode ->modesOuter : unknown +>modesOuter : any >Mode : modesOuter.Mode } @@ -83,10 +83,10 @@ module editor2 { constructor(p1: Foo.Bar, p2: modesOuter.Mode) { } >p1 : Foo.Bar ->Foo : unknown +>Foo : any >Bar : Foo.Bar >p2 : modesOuter.Mode ->modesOuter : unknown +>modesOuter : any >Mode : modesOuter.Mode } } @@ -110,12 +110,12 @@ module B1 { var i : A1Alias1.A1I1; >i : A1Alias1.A1I1 ->A1Alias1 : unknown +>A1Alias1 : any >A1I1 : A1Alias1.A1I1 var c : A1Alias1.A1C1; >c : A1Alias1.A1C1 ->A1Alias1 : unknown +>A1Alias1 : any >A1C1 : A1Alias1.A1C1 } diff --git a/tests/baselines/reference/moduleAndInterfaceSharingName.symbols b/tests/baselines/reference/moduleAndInterfaceSharingName.symbols new file mode 100644 index 00000000000..8a3a3621e1b --- /dev/null +++ b/tests/baselines/reference/moduleAndInterfaceSharingName.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/moduleAndInterfaceSharingName.ts === +module X { +>X : Symbol(X, Decl(moduleAndInterfaceSharingName.ts, 0, 0)) + + export module Y { +>Y : Symbol(Y, Decl(moduleAndInterfaceSharingName.ts, 0, 10), Decl(moduleAndInterfaceSharingName.ts, 3, 5)) + + export interface Z { } +>Z : Symbol(Z, Decl(moduleAndInterfaceSharingName.ts, 1, 21)) + } + export interface Y { } +>Y : Symbol(Y, Decl(moduleAndInterfaceSharingName.ts, 0, 10), Decl(moduleAndInterfaceSharingName.ts, 3, 5)) +} +var z: X.Y.Z = null; +>z : Symbol(z, Decl(moduleAndInterfaceSharingName.ts, 6, 3)) +>X : Symbol(X, Decl(moduleAndInterfaceSharingName.ts, 0, 0)) +>Y : Symbol(X.Y, Decl(moduleAndInterfaceSharingName.ts, 0, 10), Decl(moduleAndInterfaceSharingName.ts, 3, 5)) +>Z : Symbol(X.Y.Z, Decl(moduleAndInterfaceSharingName.ts, 1, 21)) + +var z2: X.Y; +>z2 : Symbol(z2, Decl(moduleAndInterfaceSharingName.ts, 7, 3)) +>X : Symbol(X, Decl(moduleAndInterfaceSharingName.ts, 0, 0)) +>Y : Symbol(X.Y, Decl(moduleAndInterfaceSharingName.ts, 0, 10), Decl(moduleAndInterfaceSharingName.ts, 3, 5)) + diff --git a/tests/baselines/reference/moduleAndInterfaceSharingName.types b/tests/baselines/reference/moduleAndInterfaceSharingName.types index 6a4f8998fe6..e5b537f856e 100644 --- a/tests/baselines/reference/moduleAndInterfaceSharingName.types +++ b/tests/baselines/reference/moduleAndInterfaceSharingName.types @@ -1,9 +1,9 @@ === tests/cases/compiler/moduleAndInterfaceSharingName.ts === module X { ->X : unknown +>X : any export module Y { ->Y : unknown +>Y : any export interface Z { } >Z : Z @@ -13,12 +13,13 @@ module X { } var z: X.Y.Z = null; >z : X.Y.Z ->X : unknown ->Y : unknown +>X : any +>Y : any >Z : X.Y.Z +>null : null var z2: X.Y; >z2 : X.Y ->X : unknown +>X : any >Y : X.Y diff --git a/tests/baselines/reference/moduleAndInterfaceSharingName3.symbols b/tests/baselines/reference/moduleAndInterfaceSharingName3.symbols new file mode 100644 index 00000000000..6b57995347b --- /dev/null +++ b/tests/baselines/reference/moduleAndInterfaceSharingName3.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/moduleAndInterfaceSharingName3.ts === +module X { +>X : Symbol(X, Decl(moduleAndInterfaceSharingName3.ts, 0, 0)) + + export module Y { +>Y : Symbol(Y, Decl(moduleAndInterfaceSharingName3.ts, 0, 10), Decl(moduleAndInterfaceSharingName3.ts, 3, 5)) + + export interface Z { } +>Z : Symbol(Z, Decl(moduleAndInterfaceSharingName3.ts, 1, 21)) + } + export interface Y { } +>Y : Symbol(Y, Decl(moduleAndInterfaceSharingName3.ts, 0, 10), Decl(moduleAndInterfaceSharingName3.ts, 3, 5)) +>T : Symbol(T, Decl(moduleAndInterfaceSharingName3.ts, 4, 23)) +} +var z: X.Y.Z = null; +>z : Symbol(z, Decl(moduleAndInterfaceSharingName3.ts, 6, 3)) +>X : Symbol(X, Decl(moduleAndInterfaceSharingName3.ts, 0, 0)) +>Y : Symbol(X.Y, Decl(moduleAndInterfaceSharingName3.ts, 0, 10), Decl(moduleAndInterfaceSharingName3.ts, 3, 5)) +>Z : Symbol(X.Y.Z, Decl(moduleAndInterfaceSharingName3.ts, 1, 21)) + +var z2: X.Y; +>z2 : Symbol(z2, Decl(moduleAndInterfaceSharingName3.ts, 7, 3)) +>X : Symbol(X, Decl(moduleAndInterfaceSharingName3.ts, 0, 0)) +>Y : Symbol(X.Y, Decl(moduleAndInterfaceSharingName3.ts, 0, 10), Decl(moduleAndInterfaceSharingName3.ts, 3, 5)) + diff --git a/tests/baselines/reference/moduleAndInterfaceSharingName3.types b/tests/baselines/reference/moduleAndInterfaceSharingName3.types index 1b9aabea630..690256bcf08 100644 --- a/tests/baselines/reference/moduleAndInterfaceSharingName3.types +++ b/tests/baselines/reference/moduleAndInterfaceSharingName3.types @@ -1,9 +1,9 @@ === tests/cases/compiler/moduleAndInterfaceSharingName3.ts === module X { ->X : unknown +>X : any export module Y { ->Y : unknown +>Y : any export interface Z { } >Z : Z @@ -14,12 +14,13 @@ module X { } var z: X.Y.Z = null; >z : X.Y.Z ->X : unknown ->Y : unknown +>X : any +>Y : any >Z : X.Y.Z +>null : null var z2: X.Y; >z2 : X.Y ->X : unknown +>X : any >Y : X.Y diff --git a/tests/baselines/reference/moduleAndInterfaceSharingName4.symbols b/tests/baselines/reference/moduleAndInterfaceSharingName4.symbols new file mode 100644 index 00000000000..383b1801b2d --- /dev/null +++ b/tests/baselines/reference/moduleAndInterfaceSharingName4.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/moduleAndInterfaceSharingName4.ts === +declare module D3 { +>D3 : Symbol(D3, Decl(moduleAndInterfaceSharingName4.ts, 0, 0)) + + var x: D3.Color.Color; +>x : Symbol(x, Decl(moduleAndInterfaceSharingName4.ts, 1, 7)) +>D3 : Symbol(D3, Decl(moduleAndInterfaceSharingName4.ts, 0, 0)) +>Color : Symbol(Color, Decl(moduleAndInterfaceSharingName4.ts, 1, 26)) +>Color : Symbol(Color.Color, Decl(moduleAndInterfaceSharingName4.ts, 3, 18)) + + module Color { +>Color : Symbol(Color, Decl(moduleAndInterfaceSharingName4.ts, 1, 26)) + + export interface Color { +>Color : Symbol(Color, Decl(moduleAndInterfaceSharingName4.ts, 3, 18)) + + darker: Color; +>darker : Symbol(darker, Decl(moduleAndInterfaceSharingName4.ts, 4, 32)) +>Color : Symbol(Color, Decl(moduleAndInterfaceSharingName4.ts, 3, 18)) + } + } +} diff --git a/tests/baselines/reference/moduleAndInterfaceSharingName4.types b/tests/baselines/reference/moduleAndInterfaceSharingName4.types index 8ad5a15a4ff..1b96fce2406 100644 --- a/tests/baselines/reference/moduleAndInterfaceSharingName4.types +++ b/tests/baselines/reference/moduleAndInterfaceSharingName4.types @@ -4,12 +4,12 @@ declare module D3 { var x: D3.Color.Color; >x : Color.Color ->D3 : unknown ->Color : unknown +>D3 : any +>Color : any >Color : Color.Color module Color { ->Color : unknown +>Color : any export interface Color { >Color : Color diff --git a/tests/baselines/reference/moduleCodeGenTest3.symbols b/tests/baselines/reference/moduleCodeGenTest3.symbols new file mode 100644 index 00000000000..3a14deedcbd --- /dev/null +++ b/tests/baselines/reference/moduleCodeGenTest3.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/moduleCodeGenTest3.ts === +module Baz { export var x = "hello"; } +>Baz : Symbol(Baz, Decl(moduleCodeGenTest3.ts, 0, 0)) +>x : Symbol(x, Decl(moduleCodeGenTest3.ts, 0, 23)) + +Baz.x = "goodbye"; +>Baz.x : Symbol(Baz.x, Decl(moduleCodeGenTest3.ts, 0, 23)) +>Baz : Symbol(Baz, Decl(moduleCodeGenTest3.ts, 0, 0)) +>x : Symbol(Baz.x, Decl(moduleCodeGenTest3.ts, 0, 23)) + diff --git a/tests/baselines/reference/moduleCodeGenTest3.types b/tests/baselines/reference/moduleCodeGenTest3.types index d5e10130c0d..288b794326f 100644 --- a/tests/baselines/reference/moduleCodeGenTest3.types +++ b/tests/baselines/reference/moduleCodeGenTest3.types @@ -2,10 +2,12 @@ module Baz { export var x = "hello"; } >Baz : typeof Baz >x : string +>"hello" : string Baz.x = "goodbye"; >Baz.x = "goodbye" : string >Baz.x : string >Baz : typeof Baz >x : string +>"goodbye" : string diff --git a/tests/baselines/reference/moduleCodeGenTest5.symbols b/tests/baselines/reference/moduleCodeGenTest5.symbols new file mode 100644 index 00000000000..1e68d449665 --- /dev/null +++ b/tests/baselines/reference/moduleCodeGenTest5.symbols @@ -0,0 +1,53 @@ +=== tests/cases/compiler/moduleCodeGenTest5.ts === +export var x = 0; +>x : Symbol(x, Decl(moduleCodeGenTest5.ts, 0, 10)) + +var y = 0; +>y : Symbol(y, Decl(moduleCodeGenTest5.ts, 1, 3)) + +export function f1() {} +>f1 : Symbol(f1, Decl(moduleCodeGenTest5.ts, 1, 10)) + +function f2() {} +>f2 : Symbol(f2, Decl(moduleCodeGenTest5.ts, 3, 23)) + +export class C1 { +>C1 : Symbol(C1, Decl(moduleCodeGenTest5.ts, 4, 16)) + + public p1 = 0; +>p1 : Symbol(p1, Decl(moduleCodeGenTest5.ts, 6, 17)) + + public p2() {} +>p2 : Symbol(p2, Decl(moduleCodeGenTest5.ts, 7, 15)) +} +class C2{ +>C2 : Symbol(C2, Decl(moduleCodeGenTest5.ts, 9, 1)) + + public p1 = 0; +>p1 : Symbol(p1, Decl(moduleCodeGenTest5.ts, 10, 9)) + + public p2() {} +>p2 : Symbol(p2, Decl(moduleCodeGenTest5.ts, 11, 15)) +} + +export enum E1 {A=0} +>E1 : Symbol(E1, Decl(moduleCodeGenTest5.ts, 13, 1)) +>A : Symbol(E1.A, Decl(moduleCodeGenTest5.ts, 15, 16)) + +var u = E1.A; +>u : Symbol(u, Decl(moduleCodeGenTest5.ts, 16, 3)) +>E1.A : Symbol(E1.A, Decl(moduleCodeGenTest5.ts, 15, 16)) +>E1 : Symbol(E1, Decl(moduleCodeGenTest5.ts, 13, 1)) +>A : Symbol(E1.A, Decl(moduleCodeGenTest5.ts, 15, 16)) + +enum E2 {B=0} +>E2 : Symbol(E2, Decl(moduleCodeGenTest5.ts, 16, 13)) +>B : Symbol(E2.B, Decl(moduleCodeGenTest5.ts, 17, 9)) + +var v = E2.B; +>v : Symbol(v, Decl(moduleCodeGenTest5.ts, 18, 3)) +>E2.B : Symbol(E2.B, Decl(moduleCodeGenTest5.ts, 17, 9)) +>E2 : Symbol(E2, Decl(moduleCodeGenTest5.ts, 16, 13)) +>B : Symbol(E2.B, Decl(moduleCodeGenTest5.ts, 17, 9)) + + diff --git a/tests/baselines/reference/moduleCodeGenTest5.types b/tests/baselines/reference/moduleCodeGenTest5.types index 40161509aff..c2e4ccf6d65 100644 --- a/tests/baselines/reference/moduleCodeGenTest5.types +++ b/tests/baselines/reference/moduleCodeGenTest5.types @@ -1,9 +1,11 @@ === tests/cases/compiler/moduleCodeGenTest5.ts === export var x = 0; >x : number +>0 : number var y = 0; >y : number +>0 : number export function f1() {} >f1 : () => void @@ -16,6 +18,7 @@ export class C1 { public p1 = 0; >p1 : number +>0 : number public p2() {} >p2 : () => void @@ -25,6 +28,7 @@ class C2{ public p1 = 0; >p1 : number +>0 : number public p2() {} >p2 : () => void @@ -33,6 +37,7 @@ class C2{ export enum E1 {A=0} >E1 : E1 >A : E1 +>0 : number var u = E1.A; >u : E1 @@ -43,6 +48,7 @@ var u = E1.A; enum E2 {B=0} >E2 : E2 >B : E2 +>0 : number var v = E2.B; >v : E2 diff --git a/tests/baselines/reference/moduleCodegenTest4.symbols b/tests/baselines/reference/moduleCodegenTest4.symbols new file mode 100644 index 00000000000..166ab3a8eb1 --- /dev/null +++ b/tests/baselines/reference/moduleCodegenTest4.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/moduleCodegenTest4.ts === +export module Baz { export var x = "hello"; } +>Baz : Symbol(Baz, Decl(moduleCodegenTest4.ts, 0, 0)) +>x : Symbol(x, Decl(moduleCodegenTest4.ts, 0, 30)) + +Baz.x = "goodbye"; +>Baz.x : Symbol(Baz.x, Decl(moduleCodegenTest4.ts, 0, 30)) +>Baz : Symbol(Baz, Decl(moduleCodegenTest4.ts, 0, 0)) +>x : Symbol(Baz.x, Decl(moduleCodegenTest4.ts, 0, 30)) + +void 0; diff --git a/tests/baselines/reference/moduleCodegenTest4.types b/tests/baselines/reference/moduleCodegenTest4.types index 7b9229a46c1..919432c938f 100644 --- a/tests/baselines/reference/moduleCodegenTest4.types +++ b/tests/baselines/reference/moduleCodegenTest4.types @@ -2,13 +2,16 @@ export module Baz { export var x = "hello"; } >Baz : typeof Baz >x : string +>"hello" : string Baz.x = "goodbye"; >Baz.x = "goodbye" : string >Baz.x : string >Baz : typeof Baz >x : string +>"goodbye" : string void 0; >void 0 : undefined +>0 : number diff --git a/tests/baselines/reference/moduleIdentifiers.symbols b/tests/baselines/reference/moduleIdentifiers.symbols new file mode 100644 index 00000000000..ffb3ffa7335 --- /dev/null +++ b/tests/baselines/reference/moduleIdentifiers.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/moduleIdentifiers.ts === +module M { +>M : Symbol(M, Decl(moduleIdentifiers.ts, 0, 0)) + + interface P { x: number; y: number; } +>P : Symbol(P, Decl(moduleIdentifiers.ts, 0, 10)) +>x : Symbol(x, Decl(moduleIdentifiers.ts, 1, 17)) +>y : Symbol(y, Decl(moduleIdentifiers.ts, 1, 28)) + + export var a = 1 +>a : Symbol(a, Decl(moduleIdentifiers.ts, 2, 14)) +} + +//var p: M.P; +//var m: M = M; +var x1 = M.a; +>x1 : Symbol(x1, Decl(moduleIdentifiers.ts, 7, 3)) +>M.a : Symbol(M.a, Decl(moduleIdentifiers.ts, 2, 14)) +>M : Symbol(M, Decl(moduleIdentifiers.ts, 0, 0)) +>a : Symbol(M.a, Decl(moduleIdentifiers.ts, 2, 14)) + +//var x2 = m.a; +//var q: m.P; diff --git a/tests/baselines/reference/moduleIdentifiers.types b/tests/baselines/reference/moduleIdentifiers.types index db8b1c3f720..dc540823815 100644 --- a/tests/baselines/reference/moduleIdentifiers.types +++ b/tests/baselines/reference/moduleIdentifiers.types @@ -9,6 +9,7 @@ module M { export var a = 1 >a : number +>1 : number } //var p: M.P; diff --git a/tests/baselines/reference/moduleImportedForTypeArgumentPosition.symbols b/tests/baselines/reference/moduleImportedForTypeArgumentPosition.symbols new file mode 100644 index 00000000000..3d443f3413b --- /dev/null +++ b/tests/baselines/reference/moduleImportedForTypeArgumentPosition.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/moduleImportedForTypeArgumentPosition_1.ts === +/**This is on import declaration*/ +import M2 = require("moduleImportedForTypeArgumentPosition_0"); +>M2 : Symbol(M2, Decl(moduleImportedForTypeArgumentPosition_1.ts, 0, 0)) + +class C1{ } +>C1 : Symbol(C1, Decl(moduleImportedForTypeArgumentPosition_1.ts, 1, 63)) +>T : Symbol(T, Decl(moduleImportedForTypeArgumentPosition_1.ts, 2, 9)) + +class Test1 extends C1 { +>Test1 : Symbol(Test1, Decl(moduleImportedForTypeArgumentPosition_1.ts, 2, 14)) +>C1 : Symbol(C1, Decl(moduleImportedForTypeArgumentPosition_1.ts, 1, 63)) +>M2 : Symbol(M2, Decl(moduleImportedForTypeArgumentPosition_1.ts, 0, 0)) +>M2C : Symbol(M2.M2C, Decl(moduleImportedForTypeArgumentPosition_0.ts, 0, 0)) +} + +=== tests/cases/compiler/moduleImportedForTypeArgumentPosition_0.ts === +export interface M2C { } +>M2C : Symbol(M2C, Decl(moduleImportedForTypeArgumentPosition_0.ts, 0, 0)) + diff --git a/tests/baselines/reference/moduleImportedForTypeArgumentPosition.types b/tests/baselines/reference/moduleImportedForTypeArgumentPosition.types index c5c3f427377..0a85e6e0002 100644 --- a/tests/baselines/reference/moduleImportedForTypeArgumentPosition.types +++ b/tests/baselines/reference/moduleImportedForTypeArgumentPosition.types @@ -10,7 +10,7 @@ class C1{ } class Test1 extends C1 { >Test1 : Test1 >C1 : C1 ->M2 : unknown +>M2 : any >M2C : M2.M2C } diff --git a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.symbols b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.symbols new file mode 100644 index 00000000000..fb743ea4f57 --- /dev/null +++ b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.symbols @@ -0,0 +1,113 @@ +=== tests/cases/compiler/moduleMemberWithoutTypeAnnotation1.ts === +module TypeScript.Parser { +>TypeScript : Symbol(TypeScript, Decl(moduleMemberWithoutTypeAnnotation1.ts, 0, 0), Decl(moduleMemberWithoutTypeAnnotation1.ts, 6, 1), Decl(moduleMemberWithoutTypeAnnotation1.ts, 22, 1), Decl(moduleMemberWithoutTypeAnnotation1.ts, 34, 1)) +>Parser : Symbol(Parser, Decl(moduleMemberWithoutTypeAnnotation1.ts, 0, 18)) + + class SyntaxCursor { +>SyntaxCursor : Symbol(SyntaxCursor, Decl(moduleMemberWithoutTypeAnnotation1.ts, 0, 26)) + + public currentNode(): SyntaxNode { +>currentNode : Symbol(currentNode, Decl(moduleMemberWithoutTypeAnnotation1.ts, 1, 24)) +>SyntaxNode : Symbol(SyntaxNode, Decl(moduleMemberWithoutTypeAnnotation1.ts, 24, 19)) + + return null; + } + } +} + +module TypeScript { +>TypeScript : Symbol(TypeScript, Decl(moduleMemberWithoutTypeAnnotation1.ts, 0, 0), Decl(moduleMemberWithoutTypeAnnotation1.ts, 6, 1), Decl(moduleMemberWithoutTypeAnnotation1.ts, 22, 1), Decl(moduleMemberWithoutTypeAnnotation1.ts, 34, 1)) + + export interface ISyntaxElement { }; +>ISyntaxElement : Symbol(ISyntaxElement, Decl(moduleMemberWithoutTypeAnnotation1.ts, 8, 19)) + + export interface ISyntaxToken { }; +>ISyntaxToken : Symbol(ISyntaxToken, Decl(moduleMemberWithoutTypeAnnotation1.ts, 9, 40)) + + export class PositionedElement { +>PositionedElement : Symbol(PositionedElement, Decl(moduleMemberWithoutTypeAnnotation1.ts, 10, 38)) + + public childIndex(child: ISyntaxElement) { +>childIndex : Symbol(childIndex, Decl(moduleMemberWithoutTypeAnnotation1.ts, 12, 36)) +>child : Symbol(child, Decl(moduleMemberWithoutTypeAnnotation1.ts, 13, 26)) +>ISyntaxElement : Symbol(ISyntaxElement, Decl(moduleMemberWithoutTypeAnnotation1.ts, 8, 19)) + + return Syntax.childIndex(); +>Syntax.childIndex : Symbol(Syntax.childIndex, Decl(moduleMemberWithoutTypeAnnotation1.ts, 36, 26)) +>Syntax : Symbol(Syntax, Decl(moduleMemberWithoutTypeAnnotation1.ts, 36, 18)) +>childIndex : Symbol(Syntax.childIndex, Decl(moduleMemberWithoutTypeAnnotation1.ts, 36, 26)) + } + } + + export class PositionedToken { +>PositionedToken : Symbol(PositionedToken, Decl(moduleMemberWithoutTypeAnnotation1.ts, 16, 5)) + + constructor(parent: PositionedElement, token: ISyntaxToken, fullStart: number) { +>parent : Symbol(parent, Decl(moduleMemberWithoutTypeAnnotation1.ts, 19, 20)) +>PositionedElement : Symbol(PositionedElement, Decl(moduleMemberWithoutTypeAnnotation1.ts, 10, 38)) +>token : Symbol(token, Decl(moduleMemberWithoutTypeAnnotation1.ts, 19, 46)) +>ISyntaxToken : Symbol(ISyntaxToken, Decl(moduleMemberWithoutTypeAnnotation1.ts, 9, 40)) +>fullStart : Symbol(fullStart, Decl(moduleMemberWithoutTypeAnnotation1.ts, 19, 67)) + } + } +} + +module TypeScript { +>TypeScript : Symbol(TypeScript, Decl(moduleMemberWithoutTypeAnnotation1.ts, 0, 0), Decl(moduleMemberWithoutTypeAnnotation1.ts, 6, 1), Decl(moduleMemberWithoutTypeAnnotation1.ts, 22, 1), Decl(moduleMemberWithoutTypeAnnotation1.ts, 34, 1)) + + export class SyntaxNode { +>SyntaxNode : Symbol(SyntaxNode, Decl(moduleMemberWithoutTypeAnnotation1.ts, 24, 19)) + + public findToken(position: number, includeSkippedTokens: boolean = false): PositionedToken { +>findToken : Symbol(findToken, Decl(moduleMemberWithoutTypeAnnotation1.ts, 25, 29)) +>position : Symbol(position, Decl(moduleMemberWithoutTypeAnnotation1.ts, 26, 25)) +>includeSkippedTokens : Symbol(includeSkippedTokens, Decl(moduleMemberWithoutTypeAnnotation1.ts, 26, 42)) +>PositionedToken : Symbol(PositionedToken, Decl(moduleMemberWithoutTypeAnnotation1.ts, 16, 5)) + + var positionedToken = this.findTokenInternal(null, position, 0); +>positionedToken : Symbol(positionedToken, Decl(moduleMemberWithoutTypeAnnotation1.ts, 27, 15)) +>this.findTokenInternal : Symbol(findTokenInternal, Decl(moduleMemberWithoutTypeAnnotation1.ts, 29, 9)) +>this : Symbol(SyntaxNode, Decl(moduleMemberWithoutTypeAnnotation1.ts, 24, 19)) +>findTokenInternal : Symbol(findTokenInternal, Decl(moduleMemberWithoutTypeAnnotation1.ts, 29, 9)) +>position : Symbol(position, Decl(moduleMemberWithoutTypeAnnotation1.ts, 26, 25)) + + return null; + } + findTokenInternal(x, y, z) { +>findTokenInternal : Symbol(findTokenInternal, Decl(moduleMemberWithoutTypeAnnotation1.ts, 29, 9)) +>x : Symbol(x, Decl(moduleMemberWithoutTypeAnnotation1.ts, 30, 26)) +>y : Symbol(y, Decl(moduleMemberWithoutTypeAnnotation1.ts, 30, 28)) +>z : Symbol(z, Decl(moduleMemberWithoutTypeAnnotation1.ts, 30, 31)) + + return null; + } + } +} + +module TypeScript.Syntax { +>TypeScript : Symbol(TypeScript, Decl(moduleMemberWithoutTypeAnnotation1.ts, 0, 0), Decl(moduleMemberWithoutTypeAnnotation1.ts, 6, 1), Decl(moduleMemberWithoutTypeAnnotation1.ts, 22, 1), Decl(moduleMemberWithoutTypeAnnotation1.ts, 34, 1)) +>Syntax : Symbol(Syntax, Decl(moduleMemberWithoutTypeAnnotation1.ts, 36, 18)) + + export function childIndex() { } +>childIndex : Symbol(childIndex, Decl(moduleMemberWithoutTypeAnnotation1.ts, 36, 26)) + + export class VariableWidthTokenWithTrailingTrivia implements ISyntaxToken { +>VariableWidthTokenWithTrailingTrivia : Symbol(VariableWidthTokenWithTrailingTrivia, Decl(moduleMemberWithoutTypeAnnotation1.ts, 37, 36)) +>ISyntaxToken : Symbol(ISyntaxToken, Decl(moduleMemberWithoutTypeAnnotation1.ts, 9, 40)) + + private findTokenInternal(parent: PositionedElement, position: number, fullStart: number) { +>findTokenInternal : Symbol(findTokenInternal, Decl(moduleMemberWithoutTypeAnnotation1.ts, 39, 79)) +>parent : Symbol(parent, Decl(moduleMemberWithoutTypeAnnotation1.ts, 40, 34)) +>PositionedElement : Symbol(PositionedElement, Decl(moduleMemberWithoutTypeAnnotation1.ts, 10, 38)) +>position : Symbol(position, Decl(moduleMemberWithoutTypeAnnotation1.ts, 40, 60)) +>fullStart : Symbol(fullStart, Decl(moduleMemberWithoutTypeAnnotation1.ts, 40, 78)) + + return new PositionedToken(parent, this, fullStart); +>PositionedToken : Symbol(PositionedToken, Decl(moduleMemberWithoutTypeAnnotation1.ts, 16, 5)) +>parent : Symbol(parent, Decl(moduleMemberWithoutTypeAnnotation1.ts, 40, 34)) +>this : Symbol(VariableWidthTokenWithTrailingTrivia, Decl(moduleMemberWithoutTypeAnnotation1.ts, 37, 36)) +>fullStart : Symbol(fullStart, Decl(moduleMemberWithoutTypeAnnotation1.ts, 40, 78)) + } + } +} + diff --git a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types index d8f6083b2c9..ebe70d8e6fb 100644 --- a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types +++ b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types @@ -11,6 +11,7 @@ module TypeScript.Parser { >SyntaxNode : SyntaxNode return null; +>null : null } } } @@ -63,6 +64,7 @@ module TypeScript { >findToken : (position: number, includeSkippedTokens?: boolean) => PositionedToken >position : number >includeSkippedTokens : boolean +>false : boolean >PositionedToken : PositionedToken var positionedToken = this.findTokenInternal(null, position, 0); @@ -71,9 +73,12 @@ module TypeScript { >this.findTokenInternal : (x: any, y: any, z: any) => any >this : SyntaxNode >findTokenInternal : (x: any, y: any, z: any) => any +>null : null >position : number +>0 : number return null; +>null : null } findTokenInternal(x, y, z) { >findTokenInternal : (x: any, y: any, z: any) => any @@ -82,6 +87,7 @@ module TypeScript { >z : any return null; +>null : null } } } diff --git a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.symbols b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.symbols new file mode 100644 index 00000000000..e69b8c37458 --- /dev/null +++ b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/moduleMemberWithoutTypeAnnotation2.ts === +module TypeScript { +>TypeScript : Symbol(TypeScript, Decl(moduleMemberWithoutTypeAnnotation2.ts, 0, 0)) + + export module CompilerDiagnostics { +>CompilerDiagnostics : Symbol(CompilerDiagnostics, Decl(moduleMemberWithoutTypeAnnotation2.ts, 0, 19)) + + export interface IDiagnosticWriter { +>IDiagnosticWriter : Symbol(IDiagnosticWriter, Decl(moduleMemberWithoutTypeAnnotation2.ts, 1, 39)) + + Alert(output: string): void; +>Alert : Symbol(Alert, Decl(moduleMemberWithoutTypeAnnotation2.ts, 3, 44)) +>output : Symbol(output, Decl(moduleMemberWithoutTypeAnnotation2.ts, 4, 18)) + } + + export var diagnosticWriter = null; +>diagnosticWriter : Symbol(diagnosticWriter, Decl(moduleMemberWithoutTypeAnnotation2.ts, 7, 18)) + + export function Alert(output: string) { +>Alert : Symbol(Alert, Decl(moduleMemberWithoutTypeAnnotation2.ts, 7, 43)) +>output : Symbol(output, Decl(moduleMemberWithoutTypeAnnotation2.ts, 9, 30)) + + if (diagnosticWriter) { +>diagnosticWriter : Symbol(diagnosticWriter, Decl(moduleMemberWithoutTypeAnnotation2.ts, 7, 18)) + + diagnosticWriter.Alert(output); +>diagnosticWriter : Symbol(diagnosticWriter, Decl(moduleMemberWithoutTypeAnnotation2.ts, 7, 18)) +>output : Symbol(output, Decl(moduleMemberWithoutTypeAnnotation2.ts, 9, 30)) + } + } + } +} + diff --git a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.types b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.types index 2a5d2c76e76..8a06502f1fc 100644 --- a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.types +++ b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.types @@ -15,6 +15,7 @@ module TypeScript { export var diagnosticWriter = null; >diagnosticWriter : any +>null : null export function Alert(output: string) { >Alert : (output: string) => void diff --git a/tests/baselines/reference/moduleMerge.symbols b/tests/baselines/reference/moduleMerge.symbols new file mode 100644 index 00000000000..2c288be6ff6 --- /dev/null +++ b/tests/baselines/reference/moduleMerge.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/moduleMerge.ts === +// This should not compile both B classes are in the same module this should be a collission + +module A +>A : Symbol(A, Decl(moduleMerge.ts, 0, 0), Decl(moduleMerge.ts, 11, 1)) +{ + class B +>B : Symbol(B, Decl(moduleMerge.ts, 3, 1)) + { + public Hello(): string +>Hello : Symbol(Hello, Decl(moduleMerge.ts, 5, 5)) + { + return "from private B"; + } + } +} + +module A +>A : Symbol(A, Decl(moduleMerge.ts, 0, 0), Decl(moduleMerge.ts, 11, 1)) +{ + export class B +>B : Symbol(B, Decl(moduleMerge.ts, 14, 1)) + { + public Hello(): string +>Hello : Symbol(Hello, Decl(moduleMerge.ts, 16, 5)) + { + return "from export B"; + } + } +} diff --git a/tests/baselines/reference/moduleMerge.types b/tests/baselines/reference/moduleMerge.types index b70f786b7a2..06d532673ed 100644 --- a/tests/baselines/reference/moduleMerge.types +++ b/tests/baselines/reference/moduleMerge.types @@ -11,6 +11,7 @@ module A >Hello : () => string { return "from private B"; +>"from private B" : string } } } @@ -25,6 +26,7 @@ module A >Hello : () => string { return "from export B"; +>"from export B" : string } } } diff --git a/tests/baselines/reference/moduleNoEmit.symbols b/tests/baselines/reference/moduleNoEmit.symbols new file mode 100644 index 00000000000..3bc3467dc6d --- /dev/null +++ b/tests/baselines/reference/moduleNoEmit.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/moduleNoEmit.ts === +module Foo { +>Foo : Symbol(Foo, Decl(moduleNoEmit.ts, 0, 0)) + + 1+1; +} diff --git a/tests/baselines/reference/moduleNoEmit.types b/tests/baselines/reference/moduleNoEmit.types index 7fb6b6164d6..1097bea5a4c 100644 --- a/tests/baselines/reference/moduleNoEmit.types +++ b/tests/baselines/reference/moduleNoEmit.types @@ -4,4 +4,6 @@ module Foo { 1+1; >1+1 : number +>1 : number +>1 : number } diff --git a/tests/baselines/reference/moduleOuterQualification.symbols b/tests/baselines/reference/moduleOuterQualification.symbols new file mode 100644 index 00000000000..32791347258 --- /dev/null +++ b/tests/baselines/reference/moduleOuterQualification.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/moduleOuterQualification.ts === + +declare module outer { +>outer : Symbol(outer, Decl(moduleOuterQualification.ts, 0, 0)) + + interface Beta { } +>Beta : Symbol(Beta, Decl(moduleOuterQualification.ts, 1, 22)) + + module inner { +>inner : Symbol(inner, Decl(moduleOuterQualification.ts, 2, 20)) + + // .d.ts emit: should be 'extends outer.Beta' + export interface Beta extends outer.Beta { } +>Beta : Symbol(Beta, Decl(moduleOuterQualification.ts, 3, 16)) +>outer.Beta : Symbol(Beta, Decl(moduleOuterQualification.ts, 1, 22)) +>outer : Symbol(outer, Decl(moduleOuterQualification.ts, 0, 0)) +>Beta : Symbol(Beta, Decl(moduleOuterQualification.ts, 1, 22)) + } +} + diff --git a/tests/baselines/reference/moduleOuterQualification.types b/tests/baselines/reference/moduleOuterQualification.types index 95a18f58bcd..7cfab635023 100644 --- a/tests/baselines/reference/moduleOuterQualification.types +++ b/tests/baselines/reference/moduleOuterQualification.types @@ -1,18 +1,19 @@ === tests/cases/compiler/moduleOuterQualification.ts === declare module outer { ->outer : unknown +>outer : any interface Beta { } >Beta : Beta module inner { ->inner : unknown +>inner : any // .d.ts emit: should be 'extends outer.Beta' export interface Beta extends outer.Beta { } >Beta : Beta ->outer : unknown +>outer.Beta : any +>outer : any >Beta : outer.Beta } } diff --git a/tests/baselines/reference/moduleRedifinitionErrors.symbols b/tests/baselines/reference/moduleRedifinitionErrors.symbols new file mode 100644 index 00000000000..ad4c07ff7f3 --- /dev/null +++ b/tests/baselines/reference/moduleRedifinitionErrors.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/moduleRedifinitionErrors.ts === +class A { +>A : Symbol(A, Decl(moduleRedifinitionErrors.ts, 0, 0), Decl(moduleRedifinitionErrors.ts, 1, 1)) +} +module A { +>A : Symbol(A, Decl(moduleRedifinitionErrors.ts, 0, 0), Decl(moduleRedifinitionErrors.ts, 1, 1)) +} + diff --git a/tests/baselines/reference/moduleReopenedTypeOtherBlock.symbols b/tests/baselines/reference/moduleReopenedTypeOtherBlock.symbols new file mode 100644 index 00000000000..1a5017b89c7 --- /dev/null +++ b/tests/baselines/reference/moduleReopenedTypeOtherBlock.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/moduleReopenedTypeOtherBlock.ts === +module M { +>M : Symbol(M, Decl(moduleReopenedTypeOtherBlock.ts, 0, 0), Decl(moduleReopenedTypeOtherBlock.ts, 3, 1)) + + export class C1 { } +>C1 : Symbol(C1, Decl(moduleReopenedTypeOtherBlock.ts, 0, 10)) + + export interface I { n: number; } +>I : Symbol(I, Decl(moduleReopenedTypeOtherBlock.ts, 1, 23)) +>n : Symbol(n, Decl(moduleReopenedTypeOtherBlock.ts, 2, 24)) +} +module M { +>M : Symbol(M, Decl(moduleReopenedTypeOtherBlock.ts, 0, 0), Decl(moduleReopenedTypeOtherBlock.ts, 3, 1)) + + export class C2 { f(): I { return null; } } +>C2 : Symbol(C2, Decl(moduleReopenedTypeOtherBlock.ts, 4, 10)) +>f : Symbol(f, Decl(moduleReopenedTypeOtherBlock.ts, 5, 21)) +>I : Symbol(I, Decl(moduleReopenedTypeOtherBlock.ts, 1, 23)) +} + diff --git a/tests/baselines/reference/moduleReopenedTypeOtherBlock.types b/tests/baselines/reference/moduleReopenedTypeOtherBlock.types index f98c069c338..c48c43ffd9a 100644 --- a/tests/baselines/reference/moduleReopenedTypeOtherBlock.types +++ b/tests/baselines/reference/moduleReopenedTypeOtherBlock.types @@ -16,5 +16,6 @@ module M { >C2 : C2 >f : () => I >I : I +>null : null } diff --git a/tests/baselines/reference/moduleReopenedTypeSameBlock.symbols b/tests/baselines/reference/moduleReopenedTypeSameBlock.symbols new file mode 100644 index 00000000000..a593b63cd01 --- /dev/null +++ b/tests/baselines/reference/moduleReopenedTypeSameBlock.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/moduleReopenedTypeSameBlock.ts === +module M { export class C1 { } } +>M : Symbol(M, Decl(moduleReopenedTypeSameBlock.ts, 0, 0), Decl(moduleReopenedTypeSameBlock.ts, 0, 32)) +>C1 : Symbol(C1, Decl(moduleReopenedTypeSameBlock.ts, 0, 10)) + +module M { +>M : Symbol(M, Decl(moduleReopenedTypeSameBlock.ts, 0, 0), Decl(moduleReopenedTypeSameBlock.ts, 0, 32)) + + export interface I { n: number; } +>I : Symbol(I, Decl(moduleReopenedTypeSameBlock.ts, 1, 10)) +>n : Symbol(n, Decl(moduleReopenedTypeSameBlock.ts, 2, 24)) + + export class C2 { f(): I { return null; } } +>C2 : Symbol(C2, Decl(moduleReopenedTypeSameBlock.ts, 2, 37)) +>f : Symbol(f, Decl(moduleReopenedTypeSameBlock.ts, 3, 21)) +>I : Symbol(I, Decl(moduleReopenedTypeSameBlock.ts, 1, 10)) +} + diff --git a/tests/baselines/reference/moduleReopenedTypeSameBlock.types b/tests/baselines/reference/moduleReopenedTypeSameBlock.types index 8f119fff60c..7dec66f6c7b 100644 --- a/tests/baselines/reference/moduleReopenedTypeSameBlock.types +++ b/tests/baselines/reference/moduleReopenedTypeSameBlock.types @@ -14,5 +14,6 @@ module M { >C2 : C2 >f : () => I >I : I +>null : null } diff --git a/tests/baselines/reference/moduleScopingBug.symbols b/tests/baselines/reference/moduleScopingBug.symbols new file mode 100644 index 00000000000..277f1a48f7b --- /dev/null +++ b/tests/baselines/reference/moduleScopingBug.symbols @@ -0,0 +1,41 @@ +=== tests/cases/compiler/moduleScopingBug.ts === +module M +>M : Symbol(M, Decl(moduleScopingBug.ts, 0, 0)) + +{ + + var outer: number; +>outer : Symbol(outer, Decl(moduleScopingBug.ts, 4, 7)) + + function f() { +>f : Symbol(f, Decl(moduleScopingBug.ts, 4, 22)) + + var inner = outer; // Ok +>inner : Symbol(inner, Decl(moduleScopingBug.ts, 8, 11)) +>outer : Symbol(outer, Decl(moduleScopingBug.ts, 4, 7)) + + } + + class C { +>C : Symbol(C, Decl(moduleScopingBug.ts, 10, 5)) + + constructor() { + var inner = outer; // Ok +>inner : Symbol(inner, Decl(moduleScopingBug.ts, 15, 15)) +>outer : Symbol(outer, Decl(moduleScopingBug.ts, 4, 7)) + } + + } + + module X { +>X : Symbol(X, Decl(moduleScopingBug.ts, 18, 5)) + + var inner = outer; // Error: outer not visible +>inner : Symbol(inner, Decl(moduleScopingBug.ts, 22, 11)) +>outer : Symbol(outer, Decl(moduleScopingBug.ts, 4, 7)) + + } + +} + + diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt.symbols b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt.symbols new file mode 100644 index 00000000000..6dcd97aa0dc --- /dev/null +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/moduleSharesNameWithImportDeclarationInsideIt.ts === +module Z.M { +>Z : Symbol(Z, Decl(moduleSharesNameWithImportDeclarationInsideIt.ts, 0, 0)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt.ts, 0, 9)) + + export function bar() { +>bar : Symbol(bar, Decl(moduleSharesNameWithImportDeclarationInsideIt.ts, 0, 12)) + + return ""; + } +} +module A.M { +>A : Symbol(A, Decl(moduleSharesNameWithImportDeclarationInsideIt.ts, 4, 1)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt.ts, 5, 9)) + + import M = Z.M; +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt.ts, 5, 12)) +>Z : Symbol(Z, Decl(moduleSharesNameWithImportDeclarationInsideIt.ts, 0, 0)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt.ts, 0, 9)) + + export function bar() { +>bar : Symbol(bar, Decl(moduleSharesNameWithImportDeclarationInsideIt.ts, 6, 19)) + } + M.bar(); // Should call Z.M.bar +>M.bar : Symbol(M.bar, Decl(moduleSharesNameWithImportDeclarationInsideIt.ts, 0, 12)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt.ts, 5, 12)) +>bar : Symbol(M.bar, Decl(moduleSharesNameWithImportDeclarationInsideIt.ts, 0, 12)) +} diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt.types b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt.types index 5a29a01cec7..b473adf2aa4 100644 --- a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt.types +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt.types @@ -7,6 +7,7 @@ module Z.M { >bar : () => string return ""; +>"" : string } } module A.M { diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt2.symbols b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt2.symbols new file mode 100644 index 00000000000..c5185cbda0a --- /dev/null +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt2.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/moduleSharesNameWithImportDeclarationInsideIt2.ts === +module Z.M { +>Z : Symbol(Z, Decl(moduleSharesNameWithImportDeclarationInsideIt2.ts, 0, 0)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt2.ts, 0, 9)) + + export function bar() { +>bar : Symbol(bar, Decl(moduleSharesNameWithImportDeclarationInsideIt2.ts, 0, 12)) + + return ""; + } +} +module A.M { +>A : Symbol(A, Decl(moduleSharesNameWithImportDeclarationInsideIt2.ts, 4, 1)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt2.ts, 5, 9)) + + export import M = Z.M; +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt2.ts, 5, 12)) +>Z : Symbol(Z, Decl(moduleSharesNameWithImportDeclarationInsideIt2.ts, 0, 0)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt2.ts, 0, 9)) + + export function bar() { +>bar : Symbol(bar, Decl(moduleSharesNameWithImportDeclarationInsideIt2.ts, 6, 26)) + } + M.bar(); // Should call Z.M.bar +>M.bar : Symbol(M.bar, Decl(moduleSharesNameWithImportDeclarationInsideIt2.ts, 0, 12)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt2.ts, 5, 12)) +>bar : Symbol(M.bar, Decl(moduleSharesNameWithImportDeclarationInsideIt2.ts, 0, 12)) +} diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt2.types b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt2.types index 75aba0e2d0e..56160637e0f 100644 --- a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt2.types +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt2.types @@ -7,6 +7,7 @@ module Z.M { >bar : () => string return ""; +>"" : string } } module A.M { diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt4.symbols b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt4.symbols new file mode 100644 index 00000000000..8ef55c23d9f --- /dev/null +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt4.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/moduleSharesNameWithImportDeclarationInsideIt4.ts === +module Z.M { +>Z : Symbol(Z, Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 0, 0)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 0, 9)) + + export function bar() { +>bar : Symbol(bar, Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 0, 12)) + + return ""; + } +} +module A.M { +>A : Symbol(A, Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 4, 1)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 5, 9)) + + interface M { } +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 5, 12), Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 6, 19)) + + import M = Z.M; +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 5, 12), Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 6, 19)) +>Z : Symbol(Z, Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 0, 0)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 0, 9)) + + export function bar() { +>bar : Symbol(bar, Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 7, 19)) + } + M.bar(); // Should call Z.M.bar +>M.bar : Symbol(M.bar, Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 0, 12)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 5, 12), Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 6, 19)) +>bar : Symbol(M.bar, Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 0, 12)) +} diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt4.types b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt4.types index b4df2e0ae08..b8574a2c71f 100644 --- a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt4.types +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt4.types @@ -7,6 +7,7 @@ module Z.M { >bar : () => string return ""; +>"" : string } } module A.M { diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt6.symbols b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt6.symbols new file mode 100644 index 00000000000..47761f66028 --- /dev/null +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt6.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/moduleSharesNameWithImportDeclarationInsideIt6.ts === +module Z.M { +>Z : Symbol(Z, Decl(moduleSharesNameWithImportDeclarationInsideIt6.ts, 0, 0)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt6.ts, 0, 9)) + + export function bar() { +>bar : Symbol(bar, Decl(moduleSharesNameWithImportDeclarationInsideIt6.ts, 0, 12)) + + return ""; + } +} +module A.M { +>A : Symbol(A, Decl(moduleSharesNameWithImportDeclarationInsideIt6.ts, 4, 1)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt6.ts, 5, 9)) + + import M = Z.M; +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt6.ts, 5, 12)) +>Z : Symbol(Z, Decl(moduleSharesNameWithImportDeclarationInsideIt6.ts, 0, 0)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt6.ts, 0, 9)) + + export function bar() { +>bar : Symbol(bar, Decl(moduleSharesNameWithImportDeclarationInsideIt6.ts, 6, 19)) + } +} diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt6.types b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt6.types index 01879d2db11..65f820e0606 100644 --- a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt6.types +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt6.types @@ -7,6 +7,7 @@ module Z.M { >bar : () => string return ""; +>"" : string } } module A.M { diff --git a/tests/baselines/reference/moduleSymbolMerging.symbols b/tests/baselines/reference/moduleSymbolMerging.symbols new file mode 100644 index 00000000000..4e8ca8a1526 --- /dev/null +++ b/tests/baselines/reference/moduleSymbolMerging.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/B.ts === +/// +module A { ; } +>A : Symbol(A, Decl(A.ts, 0, 0), Decl(B.ts, 0, 0)) + +module B { +>B : Symbol(B, Decl(B.ts, 1, 14)) + + export function f(): A.I { return null; } +>f : Symbol(f, Decl(B.ts, 2, 10)) +>A : Symbol(A, Decl(A.ts, 0, 0), Decl(B.ts, 0, 0)) +>I : Symbol(A.I, Decl(A.ts, 1, 10)) +} + + +=== tests/cases/compiler/A.ts === + +module A { export interface I {} } +>A : Symbol(A, Decl(A.ts, 0, 0), Decl(B.ts, 0, 0)) +>I : Symbol(I, Decl(A.ts, 1, 10)) + diff --git a/tests/baselines/reference/moduleSymbolMerging.types b/tests/baselines/reference/moduleSymbolMerging.types index c6b0f58ef46..0f5dfae5c3d 100644 --- a/tests/baselines/reference/moduleSymbolMerging.types +++ b/tests/baselines/reference/moduleSymbolMerging.types @@ -8,8 +8,9 @@ module B { export function f(): A.I { return null; } >f : () => A.I ->A : unknown +>A : any >I : A.I +>null : null } diff --git a/tests/baselines/reference/moduleUnassignedVariable.symbols b/tests/baselines/reference/moduleUnassignedVariable.symbols new file mode 100644 index 00000000000..fe17767dcf2 --- /dev/null +++ b/tests/baselines/reference/moduleUnassignedVariable.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/moduleUnassignedVariable.ts === +module Bar { +>Bar : Symbol(Bar, Decl(moduleUnassignedVariable.ts, 0, 0)) + + export var a = 1; +>a : Symbol(a, Decl(moduleUnassignedVariable.ts, 1, 14)) + + function fooA() { return a; } // Correct: return Bar.a +>fooA : Symbol(fooA, Decl(moduleUnassignedVariable.ts, 1, 21)) +>a : Symbol(a, Decl(moduleUnassignedVariable.ts, 1, 14)) + + export var b; +>b : Symbol(b, Decl(moduleUnassignedVariable.ts, 4, 14)) + + function fooB() { return b; } // Incorrect: return b +>fooB : Symbol(fooB, Decl(moduleUnassignedVariable.ts, 4, 17)) +>b : Symbol(b, Decl(moduleUnassignedVariable.ts, 4, 14)) +} + diff --git a/tests/baselines/reference/moduleUnassignedVariable.types b/tests/baselines/reference/moduleUnassignedVariable.types index 7d1dd8600cf..3e5ab538ad5 100644 --- a/tests/baselines/reference/moduleUnassignedVariable.types +++ b/tests/baselines/reference/moduleUnassignedVariable.types @@ -4,6 +4,7 @@ module Bar { export var a = 1; >a : number +>1 : number function fooA() { return a; } // Correct: return Bar.a >fooA : () => number diff --git a/tests/baselines/reference/moduleVariableArrayIndexer.symbols b/tests/baselines/reference/moduleVariableArrayIndexer.symbols new file mode 100644 index 00000000000..9a60da7bd6b --- /dev/null +++ b/tests/baselines/reference/moduleVariableArrayIndexer.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/moduleVariableArrayIndexer.ts === +module Bar { +>Bar : Symbol(Bar, Decl(moduleVariableArrayIndexer.ts, 0, 0)) + + export var a = 1; +>a : Symbol(a, Decl(moduleVariableArrayIndexer.ts, 1, 14)) + + var t = undefined[a][a]; // CG: var t = undefined[Bar.a][a]; +>t : Symbol(t, Decl(moduleVariableArrayIndexer.ts, 2, 7)) +>undefined : Symbol(undefined) +>a : Symbol(a, Decl(moduleVariableArrayIndexer.ts, 1, 14)) +>a : Symbol(a, Decl(moduleVariableArrayIndexer.ts, 1, 14)) +} + diff --git a/tests/baselines/reference/moduleVariableArrayIndexer.types b/tests/baselines/reference/moduleVariableArrayIndexer.types index 564de3ff972..4c8e73b9478 100644 --- a/tests/baselines/reference/moduleVariableArrayIndexer.types +++ b/tests/baselines/reference/moduleVariableArrayIndexer.types @@ -4,6 +4,7 @@ module Bar { export var a = 1; >a : number +>1 : number var t = undefined[a][a]; // CG: var t = undefined[Bar.a][a]; >t : any diff --git a/tests/baselines/reference/moduleVariables.symbols b/tests/baselines/reference/moduleVariables.symbols new file mode 100644 index 00000000000..7b4ac8e0c5c --- /dev/null +++ b/tests/baselines/reference/moduleVariables.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/moduleVariables.ts === +declare var console: any; +>console : Symbol(console, Decl(moduleVariables.ts, 0, 11)) + +var x = 1; +>x : Symbol(x, Decl(moduleVariables.ts, 2, 3)) + +module M { +>M : Symbol(M, Decl(moduleVariables.ts, 2, 10), Decl(moduleVariables.ts, 6, 1), Decl(moduleVariables.ts, 10, 1)) + + export var x = 2; +>x : Symbol(x, Decl(moduleVariables.ts, 4, 14)) + + console.log(x); // 2 +>console : Symbol(console, Decl(moduleVariables.ts, 0, 11)) +>x : Symbol(x, Decl(moduleVariables.ts, 4, 14)) +} + +module M { +>M : Symbol(M, Decl(moduleVariables.ts, 2, 10), Decl(moduleVariables.ts, 6, 1), Decl(moduleVariables.ts, 10, 1)) + + console.log(x); // 2 +>console : Symbol(console, Decl(moduleVariables.ts, 0, 11)) +>x : Symbol(x, Decl(moduleVariables.ts, 4, 14)) +} + +module M { +>M : Symbol(M, Decl(moduleVariables.ts, 2, 10), Decl(moduleVariables.ts, 6, 1), Decl(moduleVariables.ts, 10, 1)) + + var x = 3; +>x : Symbol(x, Decl(moduleVariables.ts, 13, 7)) + + console.log(x); // 3 +>console : Symbol(console, Decl(moduleVariables.ts, 0, 11)) +>x : Symbol(x, Decl(moduleVariables.ts, 13, 7)) +} + diff --git a/tests/baselines/reference/moduleVariables.types b/tests/baselines/reference/moduleVariables.types index 2c00df87f56..5bdf8490aed 100644 --- a/tests/baselines/reference/moduleVariables.types +++ b/tests/baselines/reference/moduleVariables.types @@ -4,12 +4,14 @@ declare var console: any; var x = 1; >x : number +>1 : number module M { >M : typeof M export var x = 2; >x : number +>2 : number console.log(x); // 2 >console.log(x) : any @@ -35,6 +37,7 @@ module M { var x = 3; >x : number +>3 : number console.log(x); // 3 >console.log(x) : any diff --git a/tests/baselines/reference/moduleVisibilityTest1.symbols b/tests/baselines/reference/moduleVisibilityTest1.symbols new file mode 100644 index 00000000000..9879d8a0151 --- /dev/null +++ b/tests/baselines/reference/moduleVisibilityTest1.symbols @@ -0,0 +1,166 @@ +=== tests/cases/compiler/moduleVisibilityTest1.ts === + + +module OuterMod { +>OuterMod : Symbol(OuterMod, Decl(moduleVisibilityTest1.ts, 0, 0)) + + export function someExportedOuterFunc() { return -1; } +>someExportedOuterFunc : Symbol(someExportedOuterFunc, Decl(moduleVisibilityTest1.ts, 2, 17)) + + export module OuterInnerMod { +>OuterInnerMod : Symbol(OuterInnerMod, Decl(moduleVisibilityTest1.ts, 3, 55)) + + export function someExportedOuterInnerFunc() { return "foo"; } +>someExportedOuterInnerFunc : Symbol(someExportedOuterInnerFunc, Decl(moduleVisibilityTest1.ts, 5, 30)) + } +} + +import OuterInnerAlias = OuterMod.OuterInnerMod; +>OuterInnerAlias : Symbol(OuterInnerAlias, Decl(moduleVisibilityTest1.ts, 8, 1)) +>OuterMod : Symbol(OuterMod, Decl(moduleVisibilityTest1.ts, 0, 0)) +>OuterInnerMod : Symbol(OuterInnerAlias, Decl(moduleVisibilityTest1.ts, 3, 55)) + +module M { +>M : Symbol(M, Decl(moduleVisibilityTest1.ts, 10, 48), Decl(moduleVisibilityTest1.ts, 52, 1)) + + export module InnerMod { +>InnerMod : Symbol(InnerMod, Decl(moduleVisibilityTest1.ts, 12, 10)) + + export function someExportedInnerFunc() { return -2; } +>someExportedInnerFunc : Symbol(someExportedInnerFunc, Decl(moduleVisibilityTest1.ts, 14, 25)) + } + + export enum E { +>E : Symbol(E, Decl(moduleVisibilityTest1.ts, 16, 2)) + + A, +>A : Symbol(E.A, Decl(moduleVisibilityTest1.ts, 18, 16)) + + B, +>B : Symbol(E.B, Decl(moduleVisibilityTest1.ts, 19, 4)) + + C, +>C : Symbol(E.C, Decl(moduleVisibilityTest1.ts, 20, 4)) + } + + export var x = 5; +>x : Symbol(x, Decl(moduleVisibilityTest1.ts, 24, 11)) + + export declare var exported_var; +>exported_var : Symbol(exported_var, Decl(moduleVisibilityTest1.ts, 25, 19)) + + var y = x + x; +>y : Symbol(y, Decl(moduleVisibilityTest1.ts, 27, 4)) +>x : Symbol(x, Decl(moduleVisibilityTest1.ts, 24, 11)) +>x : Symbol(x, Decl(moduleVisibilityTest1.ts, 24, 11)) + + + export interface I { +>I : Symbol(I, Decl(moduleVisibilityTest1.ts, 27, 15)) + + someMethod():number; +>someMethod : Symbol(someMethod, Decl(moduleVisibilityTest1.ts, 30, 21)) + } + + class B {public b = 0;} +>B : Symbol(B, Decl(moduleVisibilityTest1.ts, 32, 2)) +>b : Symbol(b, Decl(moduleVisibilityTest1.ts, 34, 11)) + + export class C implements I { +>C : Symbol(C, Decl(moduleVisibilityTest1.ts, 34, 25)) +>I : Symbol(I, Decl(moduleVisibilityTest1.ts, 27, 15)) + + public someMethodThatCallsAnOuterMethod() {return OuterInnerAlias.someExportedOuterInnerFunc();} +>someMethodThatCallsAnOuterMethod : Symbol(someMethodThatCallsAnOuterMethod, Decl(moduleVisibilityTest1.ts, 36, 31)) +>OuterInnerAlias.someExportedOuterInnerFunc : Symbol(OuterInnerAlias.someExportedOuterInnerFunc, Decl(moduleVisibilityTest1.ts, 5, 30)) +>OuterInnerAlias : Symbol(OuterInnerAlias, Decl(moduleVisibilityTest1.ts, 8, 1)) +>someExportedOuterInnerFunc : Symbol(OuterInnerAlias.someExportedOuterInnerFunc, Decl(moduleVisibilityTest1.ts, 5, 30)) + + public someMethodThatCallsAnInnerMethod() {return InnerMod.someExportedInnerFunc();} +>someMethodThatCallsAnInnerMethod : Symbol(someMethodThatCallsAnInnerMethod, Decl(moduleVisibilityTest1.ts, 37, 98)) +>InnerMod.someExportedInnerFunc : Symbol(InnerMod.someExportedInnerFunc, Decl(moduleVisibilityTest1.ts, 14, 25)) +>InnerMod : Symbol(InnerMod, Decl(moduleVisibilityTest1.ts, 12, 10)) +>someExportedInnerFunc : Symbol(InnerMod.someExportedInnerFunc, Decl(moduleVisibilityTest1.ts, 14, 25)) + + public someMethodThatCallsAnOuterInnerMethod() {return OuterMod.someExportedOuterFunc();} +>someMethodThatCallsAnOuterInnerMethod : Symbol(someMethodThatCallsAnOuterInnerMethod, Decl(moduleVisibilityTest1.ts, 38, 86)) +>OuterMod.someExportedOuterFunc : Symbol(OuterMod.someExportedOuterFunc, Decl(moduleVisibilityTest1.ts, 2, 17)) +>OuterMod : Symbol(OuterMod, Decl(moduleVisibilityTest1.ts, 0, 0)) +>someExportedOuterFunc : Symbol(OuterMod.someExportedOuterFunc, Decl(moduleVisibilityTest1.ts, 2, 17)) + + public someMethod() { return 0; } +>someMethod : Symbol(someMethod, Decl(moduleVisibilityTest1.ts, 39, 91)) + + public someProp = 1; +>someProp : Symbol(someProp, Decl(moduleVisibilityTest1.ts, 40, 35)) + + constructor() { + function someInnerFunc() { return 2; } +>someInnerFunc : Symbol(someInnerFunc, Decl(moduleVisibilityTest1.ts, 43, 17)) + + var someInnerVar = 3; +>someInnerVar : Symbol(someInnerVar, Decl(moduleVisibilityTest1.ts, 45, 15)) + } + } + + var someModuleVar = 4; +>someModuleVar : Symbol(someModuleVar, Decl(moduleVisibilityTest1.ts, 49, 4)) + + function someModuleFunction() { return 5;} +>someModuleFunction : Symbol(someModuleFunction, Decl(moduleVisibilityTest1.ts, 49, 23)) +} + +module M { +>M : Symbol(M, Decl(moduleVisibilityTest1.ts, 10, 48), Decl(moduleVisibilityTest1.ts, 52, 1)) + + export var c = x; +>c : Symbol(c, Decl(moduleVisibilityTest1.ts, 55, 11)) +>x : Symbol(x, Decl(moduleVisibilityTest1.ts, 24, 11)) + + export var meb = M.E.B; +>meb : Symbol(meb, Decl(moduleVisibilityTest1.ts, 56, 11)) +>M.E.B : Symbol(E.B, Decl(moduleVisibilityTest1.ts, 19, 4)) +>M.E : Symbol(E, Decl(moduleVisibilityTest1.ts, 16, 2)) +>M : Symbol(M, Decl(moduleVisibilityTest1.ts, 10, 48), Decl(moduleVisibilityTest1.ts, 52, 1)) +>E : Symbol(E, Decl(moduleVisibilityTest1.ts, 16, 2)) +>B : Symbol(E.B, Decl(moduleVisibilityTest1.ts, 19, 4)) +} + +var cprime : M.I = null; +>cprime : Symbol(cprime, Decl(moduleVisibilityTest1.ts, 59, 3)) +>M : Symbol(M, Decl(moduleVisibilityTest1.ts, 10, 48), Decl(moduleVisibilityTest1.ts, 52, 1)) +>I : Symbol(M.I, Decl(moduleVisibilityTest1.ts, 27, 15)) +>M : Symbol(M, Decl(moduleVisibilityTest1.ts, 10, 48), Decl(moduleVisibilityTest1.ts, 52, 1)) +>I : Symbol(M.I, Decl(moduleVisibilityTest1.ts, 27, 15)) + +var c = new M.C(); +>c : Symbol(c, Decl(moduleVisibilityTest1.ts, 61, 3)) +>M.C : Symbol(M.C, Decl(moduleVisibilityTest1.ts, 34, 25)) +>M : Symbol(M, Decl(moduleVisibilityTest1.ts, 10, 48), Decl(moduleVisibilityTest1.ts, 52, 1)) +>C : Symbol(M.C, Decl(moduleVisibilityTest1.ts, 34, 25)) + +var z = M.x; +>z : Symbol(z, Decl(moduleVisibilityTest1.ts, 62, 3)) +>M.x : Symbol(M.x, Decl(moduleVisibilityTest1.ts, 24, 11)) +>M : Symbol(M, Decl(moduleVisibilityTest1.ts, 10, 48), Decl(moduleVisibilityTest1.ts, 52, 1)) +>x : Symbol(M.x, Decl(moduleVisibilityTest1.ts, 24, 11)) + +var alpha = M.E.A; +>alpha : Symbol(alpha, Decl(moduleVisibilityTest1.ts, 63, 3)) +>M.E.A : Symbol(M.E.A, Decl(moduleVisibilityTest1.ts, 18, 16)) +>M.E : Symbol(M.E, Decl(moduleVisibilityTest1.ts, 16, 2)) +>M : Symbol(M, Decl(moduleVisibilityTest1.ts, 10, 48), Decl(moduleVisibilityTest1.ts, 52, 1)) +>E : Symbol(M.E, Decl(moduleVisibilityTest1.ts, 16, 2)) +>A : Symbol(M.E.A, Decl(moduleVisibilityTest1.ts, 18, 16)) + +var omega = M.exported_var; +>omega : Symbol(omega, Decl(moduleVisibilityTest1.ts, 64, 3)) +>M.exported_var : Symbol(M.exported_var, Decl(moduleVisibilityTest1.ts, 25, 19)) +>M : Symbol(M, Decl(moduleVisibilityTest1.ts, 10, 48), Decl(moduleVisibilityTest1.ts, 52, 1)) +>exported_var : Symbol(M.exported_var, Decl(moduleVisibilityTest1.ts, 25, 19)) + +c.someMethodThatCallsAnOuterMethod(); +>c.someMethodThatCallsAnOuterMethod : Symbol(M.C.someMethodThatCallsAnOuterMethod, Decl(moduleVisibilityTest1.ts, 36, 31)) +>c : Symbol(c, Decl(moduleVisibilityTest1.ts, 61, 3)) +>someMethodThatCallsAnOuterMethod : Symbol(M.C.someMethodThatCallsAnOuterMethod, Decl(moduleVisibilityTest1.ts, 36, 31)) + diff --git a/tests/baselines/reference/moduleVisibilityTest1.types b/tests/baselines/reference/moduleVisibilityTest1.types index 8c22f792049..b54f897d014 100644 --- a/tests/baselines/reference/moduleVisibilityTest1.types +++ b/tests/baselines/reference/moduleVisibilityTest1.types @@ -7,12 +7,14 @@ module OuterMod { export function someExportedOuterFunc() { return -1; } >someExportedOuterFunc : () => number >-1 : number +>1 : number export module OuterInnerMod { >OuterInnerMod : typeof OuterInnerMod export function someExportedOuterInnerFunc() { return "foo"; } >someExportedOuterInnerFunc : () => string +>"foo" : string } } @@ -30,6 +32,7 @@ module M { export function someExportedInnerFunc() { return -2; } >someExportedInnerFunc : () => number >-2 : number +>2 : number } export enum E { @@ -47,6 +50,7 @@ module M { export var x = 5; >x : number +>5 : number export declare var exported_var; >exported_var : any @@ -68,6 +72,7 @@ module M { class B {public b = 0;} >B : B >b : number +>0 : number export class C implements I { >C : C @@ -96,24 +101,30 @@ module M { public someMethod() { return 0; } >someMethod : () => number +>0 : number public someProp = 1; >someProp : number +>1 : number constructor() { function someInnerFunc() { return 2; } >someInnerFunc : () => number +>2 : number var someInnerVar = 3; >someInnerVar : number +>3 : number } } var someModuleVar = 4; >someModuleVar : number +>4 : number function someModuleFunction() { return 5;} >someModuleFunction : () => number +>5 : number } module M { @@ -134,11 +145,12 @@ module M { var cprime : M.I = null; >cprime : M.I ->M : unknown +>M : any >I : M.I >null : M.I ->M : unknown +>M : any >I : M.I +>null : null var c = new M.C(); >c : M.C diff --git a/tests/baselines/reference/moduleWithStatementsOfEveryKind.symbols b/tests/baselines/reference/moduleWithStatementsOfEveryKind.symbols new file mode 100644 index 00000000000..d121e6b5367 --- /dev/null +++ b/tests/baselines/reference/moduleWithStatementsOfEveryKind.symbols @@ -0,0 +1,157 @@ +=== tests/cases/conformance/internalModules/moduleBody/moduleWithStatementsOfEveryKind.ts === +module A { +>A : Symbol(A, Decl(moduleWithStatementsOfEveryKind.ts, 0, 0)) + + class A { s: string } +>A : Symbol(A, Decl(moduleWithStatementsOfEveryKind.ts, 0, 10)) +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 1, 13)) + + class AA { s: T } +>AA : Symbol(AA, Decl(moduleWithStatementsOfEveryKind.ts, 1, 25)) +>T : Symbol(T, Decl(moduleWithStatementsOfEveryKind.ts, 2, 13)) +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 2, 17)) +>T : Symbol(T, Decl(moduleWithStatementsOfEveryKind.ts, 2, 13)) + + interface I { id: number } +>I : Symbol(I, Decl(moduleWithStatementsOfEveryKind.ts, 2, 24)) +>id : Symbol(id, Decl(moduleWithStatementsOfEveryKind.ts, 3, 17)) + + class B extends AA implements I { id: number } +>B : Symbol(B, Decl(moduleWithStatementsOfEveryKind.ts, 3, 30)) +>AA : Symbol(AA, Decl(moduleWithStatementsOfEveryKind.ts, 1, 25)) +>I : Symbol(I, Decl(moduleWithStatementsOfEveryKind.ts, 2, 24)) +>id : Symbol(id, Decl(moduleWithStatementsOfEveryKind.ts, 5, 45)) + + class BB extends A { +>BB : Symbol(BB, Decl(moduleWithStatementsOfEveryKind.ts, 5, 58)) +>T : Symbol(T, Decl(moduleWithStatementsOfEveryKind.ts, 6, 13)) +>A : Symbol(A, Decl(moduleWithStatementsOfEveryKind.ts, 0, 10)) + + id: number; +>id : Symbol(id, Decl(moduleWithStatementsOfEveryKind.ts, 6, 27)) + } + + module Module { +>Module : Symbol(Module, Decl(moduleWithStatementsOfEveryKind.ts, 8, 5)) + + class A { s: string } +>A : Symbol(A, Decl(moduleWithStatementsOfEveryKind.ts, 10, 19)) +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 11, 17)) + } + enum Color { Blue, Red } +>Color : Symbol(Color, Decl(moduleWithStatementsOfEveryKind.ts, 12, 5)) +>Blue : Symbol(Color.Blue, Decl(moduleWithStatementsOfEveryKind.ts, 13, 16)) +>Red : Symbol(Color.Red, Decl(moduleWithStatementsOfEveryKind.ts, 13, 22)) + + var x = 12; +>x : Symbol(x, Decl(moduleWithStatementsOfEveryKind.ts, 14, 7)) + + function F(s: string): number { +>F : Symbol(F, Decl(moduleWithStatementsOfEveryKind.ts, 14, 15)) +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 15, 15)) + + return 2; + } + var array: I[] = null; +>array : Symbol(array, Decl(moduleWithStatementsOfEveryKind.ts, 18, 7)) +>I : Symbol(I, Decl(moduleWithStatementsOfEveryKind.ts, 2, 24)) + + var fn = (s: string) => { +>fn : Symbol(fn, Decl(moduleWithStatementsOfEveryKind.ts, 19, 7)) +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 19, 14)) + + return 'hello ' + s; +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 19, 14)) + } + var ol = { s: 'hello', id: 2, isvalid: true }; +>ol : Symbol(ol, Decl(moduleWithStatementsOfEveryKind.ts, 22, 7)) +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 22, 14)) +>id : Symbol(id, Decl(moduleWithStatementsOfEveryKind.ts, 22, 26)) +>isvalid : Symbol(isvalid, Decl(moduleWithStatementsOfEveryKind.ts, 22, 33)) + + declare class DC { +>DC : Symbol(DC, Decl(moduleWithStatementsOfEveryKind.ts, 22, 50)) + + static x: number; +>x : Symbol(DC.x, Decl(moduleWithStatementsOfEveryKind.ts, 24, 22)) + } +} + +module Y { +>Y : Symbol(Y, Decl(moduleWithStatementsOfEveryKind.ts, 27, 1)) + + export class A { s: string } +>A : Symbol(A, Decl(moduleWithStatementsOfEveryKind.ts, 29, 10)) +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 30, 20)) + + export class AA { s: T } +>AA : Symbol(AA, Decl(moduleWithStatementsOfEveryKind.ts, 30, 32)) +>T : Symbol(T, Decl(moduleWithStatementsOfEveryKind.ts, 31, 20)) +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 31, 24)) +>T : Symbol(T, Decl(moduleWithStatementsOfEveryKind.ts, 31, 20)) + + export interface I { id: number } +>I : Symbol(I, Decl(moduleWithStatementsOfEveryKind.ts, 31, 31)) +>id : Symbol(id, Decl(moduleWithStatementsOfEveryKind.ts, 32, 24)) + + export class B extends AA implements I { id: number } +>B : Symbol(B, Decl(moduleWithStatementsOfEveryKind.ts, 32, 37)) +>AA : Symbol(AA, Decl(moduleWithStatementsOfEveryKind.ts, 30, 32)) +>I : Symbol(I, Decl(moduleWithStatementsOfEveryKind.ts, 31, 31)) +>id : Symbol(id, Decl(moduleWithStatementsOfEveryKind.ts, 34, 52)) + + export class BB extends A { +>BB : Symbol(BB, Decl(moduleWithStatementsOfEveryKind.ts, 34, 65)) +>T : Symbol(T, Decl(moduleWithStatementsOfEveryKind.ts, 35, 20)) +>A : Symbol(A, Decl(moduleWithStatementsOfEveryKind.ts, 29, 10)) + + id: number; +>id : Symbol(id, Decl(moduleWithStatementsOfEveryKind.ts, 35, 34)) + } + + export module Module { +>Module : Symbol(Module, Decl(moduleWithStatementsOfEveryKind.ts, 37, 5)) + + class A { s: string } +>A : Symbol(A, Decl(moduleWithStatementsOfEveryKind.ts, 39, 26)) +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 40, 17)) + } + export enum Color { Blue, Red } +>Color : Symbol(Color, Decl(moduleWithStatementsOfEveryKind.ts, 41, 5)) +>Blue : Symbol(Color.Blue, Decl(moduleWithStatementsOfEveryKind.ts, 42, 23)) +>Red : Symbol(Color.Red, Decl(moduleWithStatementsOfEveryKind.ts, 42, 29)) + + export var x = 12; +>x : Symbol(x, Decl(moduleWithStatementsOfEveryKind.ts, 43, 14)) + + export function F(s: string): number { +>F : Symbol(F, Decl(moduleWithStatementsOfEveryKind.ts, 43, 22)) +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 44, 22)) + + return 2; + } + export var array: I[] = null; +>array : Symbol(array, Decl(moduleWithStatementsOfEveryKind.ts, 47, 14)) +>I : Symbol(I, Decl(moduleWithStatementsOfEveryKind.ts, 31, 31)) + + export var fn = (s: string) => { +>fn : Symbol(fn, Decl(moduleWithStatementsOfEveryKind.ts, 48, 14)) +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 48, 21)) + + return 'hello ' + s; +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 48, 21)) + } + export var ol = { s: 'hello', id: 2, isvalid: true }; +>ol : Symbol(ol, Decl(moduleWithStatementsOfEveryKind.ts, 51, 14)) +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 51, 21)) +>id : Symbol(id, Decl(moduleWithStatementsOfEveryKind.ts, 51, 33)) +>isvalid : Symbol(isvalid, Decl(moduleWithStatementsOfEveryKind.ts, 51, 40)) + + export declare class DC { +>DC : Symbol(DC, Decl(moduleWithStatementsOfEveryKind.ts, 51, 57)) + + static x: number; +>x : Symbol(DC.x, Decl(moduleWithStatementsOfEveryKind.ts, 53, 29)) + } +} + diff --git a/tests/baselines/reference/moduleWithStatementsOfEveryKind.types b/tests/baselines/reference/moduleWithStatementsOfEveryKind.types index 0bade1f2d8e..9475d9cfdcb 100644 --- a/tests/baselines/reference/moduleWithStatementsOfEveryKind.types +++ b/tests/baselines/reference/moduleWithStatementsOfEveryKind.types @@ -45,16 +45,19 @@ module A { var x = 12; >x : number +>12 : number function F(s: string): number { >F : (s: string) => number >s : string return 2; +>2 : number } var array: I[] = null; >array : I[] >I : I +>null : null var fn = (s: string) => { >fn : (s: string) => string @@ -63,14 +66,18 @@ module A { return 'hello ' + s; >'hello ' + s : string +>'hello ' : string >s : string } var ol = { s: 'hello', id: 2, isvalid: true }; >ol : { s: string; id: number; isvalid: boolean; } >{ s: 'hello', id: 2, isvalid: true } : { s: string; id: number; isvalid: boolean; } >s : string +>'hello' : string >id : number +>2 : number >isvalid : boolean +>true : boolean declare class DC { >DC : DC @@ -126,16 +133,19 @@ module Y { export var x = 12; >x : number +>12 : number export function F(s: string): number { >F : (s: string) => number >s : string return 2; +>2 : number } export var array: I[] = null; >array : I[] >I : I +>null : null export var fn = (s: string) => { >fn : (s: string) => string @@ -144,14 +154,18 @@ module Y { return 'hello ' + s; >'hello ' + s : string +>'hello ' : string >s : string } export var ol = { s: 'hello', id: 2, isvalid: true }; >ol : { s: string; id: number; isvalid: boolean; } >{ s: 'hello', id: 2, isvalid: true } : { s: string; id: number; isvalid: boolean; } >s : string +>'hello' : string >id : number +>2 : number >isvalid : boolean +>true : boolean export declare class DC { >DC : DC diff --git a/tests/baselines/reference/moduleWithTryStatement1.symbols b/tests/baselines/reference/moduleWithTryStatement1.symbols new file mode 100644 index 00000000000..236c1034182 --- /dev/null +++ b/tests/baselines/reference/moduleWithTryStatement1.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/moduleWithTryStatement1.ts === +module M { +>M : Symbol(M, Decl(moduleWithTryStatement1.ts, 0, 0)) + + try { + } + catch (e) { +>e : Symbol(e, Decl(moduleWithTryStatement1.ts, 3, 9)) + } +} +var v = M; +>v : Symbol(v, Decl(moduleWithTryStatement1.ts, 6, 3)) +>M : Symbol(M, Decl(moduleWithTryStatement1.ts, 0, 0)) + diff --git a/tests/baselines/reference/multiCallOverloads.symbols b/tests/baselines/reference/multiCallOverloads.symbols new file mode 100644 index 00000000000..26b414b463f --- /dev/null +++ b/tests/baselines/reference/multiCallOverloads.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/multiCallOverloads.ts === +interface ICallback { +>ICallback : Symbol(ICallback, Decl(multiCallOverloads.ts, 0, 0)) + + (x?: string):void; +>x : Symbol(x, Decl(multiCallOverloads.ts, 1, 5)) +} + +function load(f: ICallback) {} +>load : Symbol(load, Decl(multiCallOverloads.ts, 2, 1)) +>f : Symbol(f, Decl(multiCallOverloads.ts, 4, 14)) +>ICallback : Symbol(ICallback, Decl(multiCallOverloads.ts, 0, 0)) + +var f1: ICallback = function(z?) {} +>f1 : Symbol(f1, Decl(multiCallOverloads.ts, 6, 3)) +>ICallback : Symbol(ICallback, Decl(multiCallOverloads.ts, 0, 0)) +>z : Symbol(z, Decl(multiCallOverloads.ts, 6, 29)) + +var f2: ICallback = function(z?) {} +>f2 : Symbol(f2, Decl(multiCallOverloads.ts, 7, 3)) +>ICallback : Symbol(ICallback, Decl(multiCallOverloads.ts, 0, 0)) +>z : Symbol(z, Decl(multiCallOverloads.ts, 7, 29)) + +load(f1) // ok +>load : Symbol(load, Decl(multiCallOverloads.ts, 2, 1)) +>f1 : Symbol(f1, Decl(multiCallOverloads.ts, 6, 3)) + +load(f2) // ok +>load : Symbol(load, Decl(multiCallOverloads.ts, 2, 1)) +>f2 : Symbol(f2, Decl(multiCallOverloads.ts, 7, 3)) + +load(function() {}) // this shouldn’t be an error +>load : Symbol(load, Decl(multiCallOverloads.ts, 2, 1)) + +load(function(z?) {}) // this shouldn't be an error +>load : Symbol(load, Decl(multiCallOverloads.ts, 2, 1)) +>z : Symbol(z, Decl(multiCallOverloads.ts, 11, 14)) + diff --git a/tests/baselines/reference/multiExtendsSplitInterfaces2.symbols b/tests/baselines/reference/multiExtendsSplitInterfaces2.symbols new file mode 100644 index 00000000000..c9f390f1621 --- /dev/null +++ b/tests/baselines/reference/multiExtendsSplitInterfaces2.symbols @@ -0,0 +1,59 @@ +=== tests/cases/compiler/multiExtendsSplitInterfaces2.ts === +interface A { +>A : Symbol(A, Decl(multiExtendsSplitInterfaces2.ts, 0, 0)) + + a: number; +>a : Symbol(a, Decl(multiExtendsSplitInterfaces2.ts, 0, 13)) +} + +interface I extends A { +>I : Symbol(I, Decl(multiExtendsSplitInterfaces2.ts, 2, 1), Decl(multiExtendsSplitInterfaces2.ts, 10, 1)) +>A : Symbol(A, Decl(multiExtendsSplitInterfaces2.ts, 0, 0)) + + i1: number; +>i1 : Symbol(i1, Decl(multiExtendsSplitInterfaces2.ts, 4, 23)) +} + +interface B { +>B : Symbol(B, Decl(multiExtendsSplitInterfaces2.ts, 6, 1)) + + b: number; +>b : Symbol(b, Decl(multiExtendsSplitInterfaces2.ts, 8, 13)) +} + +interface I extends B { +>I : Symbol(I, Decl(multiExtendsSplitInterfaces2.ts, 2, 1), Decl(multiExtendsSplitInterfaces2.ts, 10, 1)) +>B : Symbol(B, Decl(multiExtendsSplitInterfaces2.ts, 6, 1)) + + i2: number; +>i2 : Symbol(i2, Decl(multiExtendsSplitInterfaces2.ts, 12, 23)) +} + +var i: I; +>i : Symbol(i, Decl(multiExtendsSplitInterfaces2.ts, 16, 3)) +>I : Symbol(I, Decl(multiExtendsSplitInterfaces2.ts, 2, 1), Decl(multiExtendsSplitInterfaces2.ts, 10, 1)) + +var a = i.a; +>a : Symbol(a, Decl(multiExtendsSplitInterfaces2.ts, 18, 3)) +>i.a : Symbol(A.a, Decl(multiExtendsSplitInterfaces2.ts, 0, 13)) +>i : Symbol(i, Decl(multiExtendsSplitInterfaces2.ts, 16, 3)) +>a : Symbol(A.a, Decl(multiExtendsSplitInterfaces2.ts, 0, 13)) + +var i1 = i.i1; +>i1 : Symbol(i1, Decl(multiExtendsSplitInterfaces2.ts, 19, 3)) +>i.i1 : Symbol(I.i1, Decl(multiExtendsSplitInterfaces2.ts, 4, 23)) +>i : Symbol(i, Decl(multiExtendsSplitInterfaces2.ts, 16, 3)) +>i1 : Symbol(I.i1, Decl(multiExtendsSplitInterfaces2.ts, 4, 23)) + +var b = i.b; +>b : Symbol(b, Decl(multiExtendsSplitInterfaces2.ts, 20, 3)) +>i.b : Symbol(B.b, Decl(multiExtendsSplitInterfaces2.ts, 8, 13)) +>i : Symbol(i, Decl(multiExtendsSplitInterfaces2.ts, 16, 3)) +>b : Symbol(B.b, Decl(multiExtendsSplitInterfaces2.ts, 8, 13)) + +var i2 = i.i2; +>i2 : Symbol(i2, Decl(multiExtendsSplitInterfaces2.ts, 21, 3)) +>i.i2 : Symbol(I.i2, Decl(multiExtendsSplitInterfaces2.ts, 12, 23)) +>i : Symbol(i, Decl(multiExtendsSplitInterfaces2.ts, 16, 3)) +>i2 : Symbol(I.i2, Decl(multiExtendsSplitInterfaces2.ts, 12, 23)) + diff --git a/tests/baselines/reference/multiImportExport.symbols b/tests/baselines/reference/multiImportExport.symbols new file mode 100644 index 00000000000..6601571aabc --- /dev/null +++ b/tests/baselines/reference/multiImportExport.symbols @@ -0,0 +1,47 @@ +=== tests/cases/compiler/consumer.ts === +import Drawing = require('./Drawing'); +>Drawing : Symbol(Drawing, Decl(consumer.ts, 0, 0)) + +var addr = new Drawing.Math.Adder(); +>addr : Symbol(addr, Decl(consumer.ts, 1, 3)) +>Drawing.Math.Adder : Symbol(Adder, Decl(Math.ts, 2, 12)) +>Drawing.Math : Symbol(Drawing.Math, Decl(Drawing.ts, 0, 0)) +>Drawing : Symbol(Drawing, Decl(consumer.ts, 0, 0)) +>Math : Symbol(Drawing.Math, Decl(Drawing.ts, 0, 0)) +>Adder : Symbol(Adder, Decl(Math.ts, 2, 12)) + +=== tests/cases/compiler/Drawing.ts === +export import Math = require('Math/Math') +>Math : Symbol(Math, Decl(Drawing.ts, 0, 0)) + +=== tests/cases/compiler/Math/Math.ts === +import Adder = require('Math/Adder'); +>Adder : Symbol(Adder, Decl(Math.ts, 0, 0)) + +var Math = { +>Math : Symbol(Math, Decl(Math.ts, 2, 3)) + + Adder:Adder +>Adder : Symbol(Adder, Decl(Math.ts, 2, 12)) +>Adder : Symbol(Adder, Decl(Math.ts, 0, 0)) + +}; + +export = Math +>Math : Symbol(Math, Decl(Math.ts, 2, 3)) + +=== tests/cases/compiler/Math/Adder.ts === +class Adder { +>Adder : Symbol(Adder, Decl(Adder.ts, 0, 0)) + + add(a: number, b: number) { +>add : Symbol(add, Decl(Adder.ts, 0, 13)) +>a : Symbol(a, Decl(Adder.ts, 1, 8)) +>b : Symbol(b, Decl(Adder.ts, 1, 18)) + + } +} + +export = Adder; +>Adder : Symbol(Adder, Decl(Adder.ts, 0, 0)) + diff --git a/tests/baselines/reference/multiModuleClodule1.symbols b/tests/baselines/reference/multiModuleClodule1.symbols new file mode 100644 index 00000000000..8f83e58ed26 --- /dev/null +++ b/tests/baselines/reference/multiModuleClodule1.symbols @@ -0,0 +1,51 @@ +=== tests/cases/compiler/multiModuleClodule1.ts === +class C { +>C : Symbol(C, Decl(multiModuleClodule1.ts, 0, 0), Decl(multiModuleClodule1.ts, 5, 1), Decl(multiModuleClodule1.ts, 10, 1)) + + constructor(x: number) { } +>x : Symbol(x, Decl(multiModuleClodule1.ts, 1, 16)) + + foo() { } +>foo : Symbol(foo, Decl(multiModuleClodule1.ts, 1, 30)) + + bar() { } +>bar : Symbol(bar, Decl(multiModuleClodule1.ts, 2, 13)) + + static boo() { } +>boo : Symbol(C.boo, Decl(multiModuleClodule1.ts, 3, 13)) +} + +module C { +>C : Symbol(C, Decl(multiModuleClodule1.ts, 0, 0), Decl(multiModuleClodule1.ts, 5, 1), Decl(multiModuleClodule1.ts, 10, 1)) + + export var x = 1; +>x : Symbol(x, Decl(multiModuleClodule1.ts, 8, 14)) + + var y = 2; +>y : Symbol(y, Decl(multiModuleClodule1.ts, 9, 7)) +} +module C { +>C : Symbol(C, Decl(multiModuleClodule1.ts, 0, 0), Decl(multiModuleClodule1.ts, 5, 1), Decl(multiModuleClodule1.ts, 10, 1)) + + export function foo() { } +>foo : Symbol(foo, Decl(multiModuleClodule1.ts, 11, 10)) + + function baz() { return ''; } +>baz : Symbol(baz, Decl(multiModuleClodule1.ts, 12, 29)) +} + +var c = new C(C.x); +>c : Symbol(c, Decl(multiModuleClodule1.ts, 16, 3)) +>C : Symbol(C, Decl(multiModuleClodule1.ts, 0, 0), Decl(multiModuleClodule1.ts, 5, 1), Decl(multiModuleClodule1.ts, 10, 1)) +>C.x : Symbol(C.x, Decl(multiModuleClodule1.ts, 8, 14)) +>C : Symbol(C, Decl(multiModuleClodule1.ts, 0, 0), Decl(multiModuleClodule1.ts, 5, 1), Decl(multiModuleClodule1.ts, 10, 1)) +>x : Symbol(C.x, Decl(multiModuleClodule1.ts, 8, 14)) + +c.foo = C.foo; +>c.foo : Symbol(C.foo, Decl(multiModuleClodule1.ts, 1, 30)) +>c : Symbol(c, Decl(multiModuleClodule1.ts, 16, 3)) +>foo : Symbol(C.foo, Decl(multiModuleClodule1.ts, 1, 30)) +>C.foo : Symbol(C.foo, Decl(multiModuleClodule1.ts, 11, 10)) +>C : Symbol(C, Decl(multiModuleClodule1.ts, 0, 0), Decl(multiModuleClodule1.ts, 5, 1), Decl(multiModuleClodule1.ts, 10, 1)) +>foo : Symbol(C.foo, Decl(multiModuleClodule1.ts, 11, 10)) + diff --git a/tests/baselines/reference/multiModuleClodule1.types b/tests/baselines/reference/multiModuleClodule1.types index f7379e33173..b958d18f984 100644 --- a/tests/baselines/reference/multiModuleClodule1.types +++ b/tests/baselines/reference/multiModuleClodule1.types @@ -20,9 +20,11 @@ module C { export var x = 1; >x : number +>1 : number var y = 2; >y : number +>2 : number } module C { >C : typeof C @@ -32,6 +34,7 @@ module C { function baz() { return ''; } >baz : () => string +>'' : string } var c = new C(C.x); diff --git a/tests/baselines/reference/multiModuleFundule1.symbols b/tests/baselines/reference/multiModuleFundule1.symbols new file mode 100644 index 00000000000..39b2e7e6be0 --- /dev/null +++ b/tests/baselines/reference/multiModuleFundule1.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/multiModuleFundule1.ts === +function C(x: number) { } +>C : Symbol(C, Decl(multiModuleFundule1.ts, 0, 0), Decl(multiModuleFundule1.ts, 0, 25), Decl(multiModuleFundule1.ts, 4, 1)) +>x : Symbol(x, Decl(multiModuleFundule1.ts, 0, 11)) + +module C { +>C : Symbol(C, Decl(multiModuleFundule1.ts, 0, 0), Decl(multiModuleFundule1.ts, 0, 25), Decl(multiModuleFundule1.ts, 4, 1)) + + export var x = 1; +>x : Symbol(x, Decl(multiModuleFundule1.ts, 3, 14)) +} +module C { +>C : Symbol(C, Decl(multiModuleFundule1.ts, 0, 0), Decl(multiModuleFundule1.ts, 0, 25), Decl(multiModuleFundule1.ts, 4, 1)) + + export function foo() { } +>foo : Symbol(foo, Decl(multiModuleFundule1.ts, 5, 10)) +} + +var r = C(2); +>r : Symbol(r, Decl(multiModuleFundule1.ts, 9, 3)) +>C : Symbol(C, Decl(multiModuleFundule1.ts, 0, 0), Decl(multiModuleFundule1.ts, 0, 25), Decl(multiModuleFundule1.ts, 4, 1)) + +var r2 = new C(2); // using void returning function as constructor +>r2 : Symbol(r2, Decl(multiModuleFundule1.ts, 10, 3)) +>C : Symbol(C, Decl(multiModuleFundule1.ts, 0, 0), Decl(multiModuleFundule1.ts, 0, 25), Decl(multiModuleFundule1.ts, 4, 1)) + +var r3 = C.foo(); +>r3 : Symbol(r3, Decl(multiModuleFundule1.ts, 11, 3)) +>C.foo : Symbol(C.foo, Decl(multiModuleFundule1.ts, 5, 10)) +>C : Symbol(C, Decl(multiModuleFundule1.ts, 0, 0), Decl(multiModuleFundule1.ts, 0, 25), Decl(multiModuleFundule1.ts, 4, 1)) +>foo : Symbol(C.foo, Decl(multiModuleFundule1.ts, 5, 10)) + diff --git a/tests/baselines/reference/multiModuleFundule1.types b/tests/baselines/reference/multiModuleFundule1.types index c78a195f4b1..7eed100c199 100644 --- a/tests/baselines/reference/multiModuleFundule1.types +++ b/tests/baselines/reference/multiModuleFundule1.types @@ -8,6 +8,7 @@ module C { export var x = 1; >x : number +>1 : number } module C { >C : typeof C @@ -20,11 +21,13 @@ var r = C(2); >r : void >C(2) : void >C : typeof C +>2 : number var r2 = new C(2); // using void returning function as constructor >r2 : any >new C(2) : any >C : typeof C +>2 : number var r3 = C.foo(); >r3 : void diff --git a/tests/baselines/reference/mutrec.symbols b/tests/baselines/reference/mutrec.symbols new file mode 100644 index 00000000000..2a24cc4c65e --- /dev/null +++ b/tests/baselines/reference/mutrec.symbols @@ -0,0 +1,102 @@ +=== tests/cases/compiler/mutrec.ts === +interface A { +>A : Symbol(A, Decl(mutrec.ts, 0, 0)) + + x:B[]; +>x : Symbol(x, Decl(mutrec.ts, 0, 13)) +>B : Symbol(B, Decl(mutrec.ts, 2, 1)) +} + +interface B { +>B : Symbol(B, Decl(mutrec.ts, 2, 1)) + + x:A[]; +>x : Symbol(x, Decl(mutrec.ts, 4, 13)) +>A : Symbol(A, Decl(mutrec.ts, 0, 0)) +} + +function f(p: A) { return p }; +>f : Symbol(f, Decl(mutrec.ts, 6, 1)) +>p : Symbol(p, Decl(mutrec.ts, 8, 11)) +>A : Symbol(A, Decl(mutrec.ts, 0, 0)) +>p : Symbol(p, Decl(mutrec.ts, 8, 11)) + +var b:B; +>b : Symbol(b, Decl(mutrec.ts, 9, 3)) +>B : Symbol(B, Decl(mutrec.ts, 2, 1)) + +f(b); +>f : Symbol(f, Decl(mutrec.ts, 6, 1)) +>b : Symbol(b, Decl(mutrec.ts, 9, 3)) + +interface I1 { +>I1 : Symbol(I1, Decl(mutrec.ts, 10, 5)) + + y:I2; +>y : Symbol(y, Decl(mutrec.ts, 12, 14)) +>I2 : Symbol(I2, Decl(mutrec.ts, 14, 1)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(mutrec.ts, 14, 1)) + + y:I3; +>y : Symbol(y, Decl(mutrec.ts, 16, 14)) +>I3 : Symbol(I3, Decl(mutrec.ts, 18, 1)) +} + +interface I3 { +>I3 : Symbol(I3, Decl(mutrec.ts, 18, 1)) + + y:I1; +>y : Symbol(y, Decl(mutrec.ts, 20, 14)) +>I1 : Symbol(I1, Decl(mutrec.ts, 10, 5)) +} + +function g(p: I1) { return p }; +>g : Symbol(g, Decl(mutrec.ts, 22, 1)) +>p : Symbol(p, Decl(mutrec.ts, 24, 11)) +>I1 : Symbol(I1, Decl(mutrec.ts, 10, 5)) +>p : Symbol(p, Decl(mutrec.ts, 24, 11)) + +var i2:I2; +>i2 : Symbol(i2, Decl(mutrec.ts, 25, 3)) +>I2 : Symbol(I2, Decl(mutrec.ts, 14, 1)) + +g(i2); +>g : Symbol(g, Decl(mutrec.ts, 22, 1)) +>i2 : Symbol(i2, Decl(mutrec.ts, 25, 3)) + +var i3:I3; +>i3 : Symbol(i3, Decl(mutrec.ts, 27, 3)) +>I3 : Symbol(I3, Decl(mutrec.ts, 18, 1)) + +g(i3); +>g : Symbol(g, Decl(mutrec.ts, 22, 1)) +>i3 : Symbol(i3, Decl(mutrec.ts, 27, 3)) + +interface I4 { +>I4 : Symbol(I4, Decl(mutrec.ts, 28, 6)) + + y:I5; +>y : Symbol(y, Decl(mutrec.ts, 30, 14)) +>I5 : Symbol(I5, Decl(mutrec.ts, 32, 1)) +} + +interface I5 { +>I5 : Symbol(I5, Decl(mutrec.ts, 32, 1)) + + y:I4; +>y : Symbol(y, Decl(mutrec.ts, 34, 14)) +>I4 : Symbol(I4, Decl(mutrec.ts, 28, 6)) +} + +var i4:I4; +>i4 : Symbol(i4, Decl(mutrec.ts, 38, 3)) +>I4 : Symbol(I4, Decl(mutrec.ts, 28, 6)) + +g(i4); +>g : Symbol(g, Decl(mutrec.ts, 22, 1)) +>i4 : Symbol(i4, Decl(mutrec.ts, 38, 3)) + + diff --git a/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes1.symbols b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes1.symbols new file mode 100644 index 00000000000..67871a590cb --- /dev/null +++ b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes1.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/mutuallyRecursiveGenericBaseTypes1.ts === +interface A { +>A : Symbol(A, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 0, 0)) +>T : Symbol(T, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 0, 12)) + + foo(): B; // instead of B does see this +>foo : Symbol(foo, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 0, 16), Decl(mutuallyRecursiveGenericBaseTypes1.ts, 1, 16)) +>B : Symbol(B, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 5, 1)) +>T : Symbol(T, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 0, 12)) + + foo(): void; // instead of B does see this +>foo : Symbol(foo, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 0, 16), Decl(mutuallyRecursiveGenericBaseTypes1.ts, 1, 16)) + + foo2(): B; +>foo2 : Symbol(foo2, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 2, 16)) +>B : Symbol(B, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 5, 1)) +} + +interface B extends A { +>B : Symbol(B, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 5, 1)) +>T : Symbol(T, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 7, 12)) +>A : Symbol(A, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 0, 0)) +>T : Symbol(T, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 7, 12)) + + bar(): void; +>bar : Symbol(bar, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 7, 29)) +} + +var b: B; +>b : Symbol(b, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 11, 3)) +>B : Symbol(B, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 5, 1)) + +b.foo(); // should not error +>b.foo : Symbol(A.foo, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 0, 16), Decl(mutuallyRecursiveGenericBaseTypes1.ts, 1, 16)) +>b : Symbol(b, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 11, 3)) +>foo : Symbol(A.foo, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 0, 16), Decl(mutuallyRecursiveGenericBaseTypes1.ts, 1, 16)) + + + diff --git a/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.symbols b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.symbols new file mode 100644 index 00000000000..d66f6a0c66f --- /dev/null +++ b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/mutuallyRecursiveGenericBaseTypes2.ts === +class foo +>foo : Symbol(foo, Decl(mutuallyRecursiveGenericBaseTypes2.ts, 0, 0)) +>T : Symbol(T, Decl(mutuallyRecursiveGenericBaseTypes2.ts, 0, 10)) +{ + bar(): foo2 { return null; } +>bar : Symbol(bar, Decl(mutuallyRecursiveGenericBaseTypes2.ts, 1, 1)) +>foo2 : Symbol(foo2, Decl(mutuallyRecursiveGenericBaseTypes2.ts, 3, 1)) +>T : Symbol(T, Decl(mutuallyRecursiveGenericBaseTypes2.ts, 0, 10)) +} + +class foo2 extends foo { +>foo2 : Symbol(foo2, Decl(mutuallyRecursiveGenericBaseTypes2.ts, 3, 1)) +>T : Symbol(T, Decl(mutuallyRecursiveGenericBaseTypes2.ts, 5, 11)) +>foo : Symbol(foo, Decl(mutuallyRecursiveGenericBaseTypes2.ts, 0, 0)) +>T : Symbol(T, Decl(mutuallyRecursiveGenericBaseTypes2.ts, 5, 11)) +} + +var test = new foo(); +>test : Symbol(test, Decl(mutuallyRecursiveGenericBaseTypes2.ts, 8, 3)) +>foo : Symbol(foo, Decl(mutuallyRecursiveGenericBaseTypes2.ts, 0, 0)) + diff --git a/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.types b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.types index 5cadfa780fe..ac722f8a063 100644 --- a/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.types +++ b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.types @@ -7,6 +7,7 @@ class foo >bar : () => foo2 >foo2 : foo2 >T : T +>null : null } class foo2 extends foo { diff --git a/tests/baselines/reference/nameCollision.symbols b/tests/baselines/reference/nameCollision.symbols new file mode 100644 index 00000000000..064726e21fa --- /dev/null +++ b/tests/baselines/reference/nameCollision.symbols @@ -0,0 +1,88 @@ +=== tests/cases/conformance/internalModules/codeGeneration/nameCollision.ts === +module A { +>A : Symbol(A, Decl(nameCollision.ts, 0, 0)) + + // these 2 statements force an underscore before the 'A' + // in the generated function call. + var A = 12; +>A : Symbol(A, Decl(nameCollision.ts, 3, 7)) + + var _A = ''; +>_A : Symbol(_A, Decl(nameCollision.ts, 4, 7)) +} + +module B { +>B : Symbol(B, Decl(nameCollision.ts, 5, 1), Decl(nameCollision.ts, 9, 1)) + + var A = 12; +>A : Symbol(A, Decl(nameCollision.ts, 8, 7)) +} + +module B { +>B : Symbol(B, Decl(nameCollision.ts, 5, 1), Decl(nameCollision.ts, 9, 1)) + + // re-opened module with colliding name + // this should add an underscore. + class B { +>B : Symbol(B, Decl(nameCollision.ts, 11, 10)) + + name: string; +>name : Symbol(name, Decl(nameCollision.ts, 14, 13)) + } +} + +module X { +>X : Symbol(X, Decl(nameCollision.ts, 17, 1)) + + var X = 13; +>X : Symbol(X, Decl(nameCollision.ts, 20, 7)) + + export module Y { +>Y : Symbol(Y, Decl(nameCollision.ts, 20, 15)) + + var Y = 13; +>Y : Symbol(Y, Decl(nameCollision.ts, 22, 11)) + + export module Z { +>Z : Symbol(Z, Decl(nameCollision.ts, 22, 19)) + + var X = 12; +>X : Symbol(X, Decl(nameCollision.ts, 24, 15)) + + var Y = 12; +>Y : Symbol(Y, Decl(nameCollision.ts, 25, 15)) + + var Z = 12; +>Z : Symbol(Z, Decl(nameCollision.ts, 26, 15)) + } + } +} + +module Y.Y { +>Y : Symbol(Y, Decl(nameCollision.ts, 29, 1)) +>Y : Symbol(Y, Decl(nameCollision.ts, 31, 9)) + + export enum Y { +>Y : Symbol(Y, Decl(nameCollision.ts, 31, 12)) + + Red, Blue +>Red : Symbol(Y.Red, Decl(nameCollision.ts, 32, 19)) +>Blue : Symbol(Y.Blue, Decl(nameCollision.ts, 33, 12)) + } +} + +// no collision, since interface doesn't +// generate code. +module D { +>D : Symbol(D, Decl(nameCollision.ts, 35, 1)) + + export interface D { +>D : Symbol(D, Decl(nameCollision.ts, 39, 10)) + + id: number; +>id : Symbol(id, Decl(nameCollision.ts, 40, 24)) + } + + export var E = 'hello'; +>E : Symbol(E, Decl(nameCollision.ts, 44, 14)) +} diff --git a/tests/baselines/reference/nameCollision.types b/tests/baselines/reference/nameCollision.types index be14150308b..e8badb7ab92 100644 --- a/tests/baselines/reference/nameCollision.types +++ b/tests/baselines/reference/nameCollision.types @@ -6,9 +6,11 @@ module A { // in the generated function call. var A = 12; >A : number +>12 : number var _A = ''; >_A : string +>'' : string } module B { @@ -16,6 +18,7 @@ module B { var A = 12; >A : number +>12 : number } module B { @@ -36,24 +39,29 @@ module X { var X = 13; >X : number +>13 : number export module Y { >Y : typeof X.Y var Y = 13; >Y : number +>13 : number export module Z { >Z : typeof X.Y.Z var X = 12; >X : number +>12 : number var Y = 12; >Y : number +>12 : number var Z = 12; >Z : number +>12 : number } } } @@ -85,4 +93,5 @@ module D { export var E = 'hello'; >E : string +>'hello' : string } diff --git a/tests/baselines/reference/nameCollisionsInPropertyAssignments.symbols b/tests/baselines/reference/nameCollisionsInPropertyAssignments.symbols new file mode 100644 index 00000000000..2e40d0f8bc5 --- /dev/null +++ b/tests/baselines/reference/nameCollisionsInPropertyAssignments.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/nameCollisionsInPropertyAssignments.ts === +var x = 1 +>x : Symbol(x, Decl(nameCollisionsInPropertyAssignments.ts, 0, 3)) + +var y = { x() { x++; } }; +>y : Symbol(y, Decl(nameCollisionsInPropertyAssignments.ts, 1, 3)) +>x : Symbol(x, Decl(nameCollisionsInPropertyAssignments.ts, 1, 9)) +>x : Symbol(x, Decl(nameCollisionsInPropertyAssignments.ts, 0, 3)) + diff --git a/tests/baselines/reference/nameCollisionsInPropertyAssignments.types b/tests/baselines/reference/nameCollisionsInPropertyAssignments.types index 41bcdd99a71..bffe75896c4 100644 --- a/tests/baselines/reference/nameCollisionsInPropertyAssignments.types +++ b/tests/baselines/reference/nameCollisionsInPropertyAssignments.types @@ -1,6 +1,7 @@ === tests/cases/compiler/nameCollisionsInPropertyAssignments.ts === var x = 1 >x : number +>1 : number var y = { x() { x++; } }; >y : { x(): void; } diff --git a/tests/baselines/reference/nameDelimitedBySlashes.symbols b/tests/baselines/reference/nameDelimitedBySlashes.symbols new file mode 100644 index 00000000000..d09ce913419 --- /dev/null +++ b/tests/baselines/reference/nameDelimitedBySlashes.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/externalModules/foo_1.ts === +import foo = require('./test/foo_0'); +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) + +var x = foo.foo + 42; +>x : Symbol(x, Decl(foo_1.ts, 1, 3)) +>foo.foo : Symbol(foo.foo, Decl(foo_0.ts, 0, 10)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>foo : Symbol(foo.foo, Decl(foo_0.ts, 0, 10)) + +=== tests/cases/conformance/externalModules/test/foo_0.ts === +export var foo = 42; +>foo : Symbol(foo, Decl(foo_0.ts, 0, 10)) + diff --git a/tests/baselines/reference/nameDelimitedBySlashes.types b/tests/baselines/reference/nameDelimitedBySlashes.types index cea87ff2241..4987a52196f 100644 --- a/tests/baselines/reference/nameDelimitedBySlashes.types +++ b/tests/baselines/reference/nameDelimitedBySlashes.types @@ -8,8 +8,10 @@ var x = foo.foo + 42; >foo.foo : number >foo : typeof foo >foo : number +>42 : number === tests/cases/conformance/externalModules/test/foo_0.ts === export var foo = 42; >foo : number +>42 : number diff --git a/tests/baselines/reference/nameWithRelativePaths.symbols b/tests/baselines/reference/nameWithRelativePaths.symbols new file mode 100644 index 00000000000..d86eb64bff2 --- /dev/null +++ b/tests/baselines/reference/nameWithRelativePaths.symbols @@ -0,0 +1,46 @@ +=== tests/cases/conformance/externalModules/test/foo_3.ts === +import foo0 = require('../foo_0'); +>foo0 : Symbol(foo0, Decl(foo_3.ts, 0, 0)) + +import foo1 = require('./test/foo_1'); +>foo1 : Symbol(foo1, Decl(foo_3.ts, 0, 34)) + +import foo2 = require('./.././test/foo_2'); +>foo2 : Symbol(foo2, Decl(foo_3.ts, 1, 38)) + +if(foo2.M2.x){ +>foo2.M2.x : Symbol(foo2.M2.x, Decl(foo_2.ts, 1, 11)) +>foo2.M2 : Symbol(foo2.M2, Decl(foo_2.ts, 0, 0)) +>foo2 : Symbol(foo2, Decl(foo_3.ts, 1, 38)) +>M2 : Symbol(foo2.M2, Decl(foo_2.ts, 0, 0)) +>x : Symbol(foo2.M2.x, Decl(foo_2.ts, 1, 11)) + + var x = foo0.foo + foo1.f(); +>x : Symbol(x, Decl(foo_3.ts, 5, 4)) +>foo0.foo : Symbol(foo0.foo, Decl(foo_0.ts, 0, 10)) +>foo0 : Symbol(foo0, Decl(foo_3.ts, 0, 0)) +>foo : Symbol(foo0.foo, Decl(foo_0.ts, 0, 10)) +>foo1.f : Symbol(foo1.f, Decl(foo_1.ts, 0, 0)) +>foo1 : Symbol(foo1, Decl(foo_3.ts, 0, 34)) +>f : Symbol(foo1.f, Decl(foo_1.ts, 0, 0)) +} + +=== tests/cases/conformance/externalModules/foo_0.ts === +export var foo = 42; +>foo : Symbol(foo, Decl(foo_0.ts, 0, 10)) + +=== tests/cases/conformance/externalModules/test/test/foo_1.ts === +export function f(){ +>f : Symbol(f, Decl(foo_1.ts, 0, 0)) + + return 42; +} + +=== tests/cases/conformance/externalModules/test/foo_2.ts === +export module M2 { +>M2 : Symbol(M2, Decl(foo_2.ts, 0, 0)) + + export var x = true; +>x : Symbol(x, Decl(foo_2.ts, 1, 11)) +} + diff --git a/tests/baselines/reference/nameWithRelativePaths.types b/tests/baselines/reference/nameWithRelativePaths.types index 2dc303b2583..ea552cfa531 100644 --- a/tests/baselines/reference/nameWithRelativePaths.types +++ b/tests/baselines/reference/nameWithRelativePaths.types @@ -30,12 +30,14 @@ if(foo2.M2.x){ === tests/cases/conformance/externalModules/foo_0.ts === export var foo = 42; >foo : number +>42 : number === tests/cases/conformance/externalModules/test/test/foo_1.ts === export function f(){ >f : () => number return 42; +>42 : number } === tests/cases/conformance/externalModules/test/foo_2.ts === @@ -44,5 +46,6 @@ export module M2 { export var x = true; >x : boolean +>true : boolean } diff --git a/tests/baselines/reference/namedFunctionExpressionAssignedToClassProperty.symbols b/tests/baselines/reference/namedFunctionExpressionAssignedToClassProperty.symbols new file mode 100644 index 00000000000..707bc64571f --- /dev/null +++ b/tests/baselines/reference/namedFunctionExpressionAssignedToClassProperty.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/namedFunctionExpressionAssignedToClassProperty.ts === +class Foo{ +>Foo : Symbol(Foo, Decl(namedFunctionExpressionAssignedToClassProperty.ts, 0, 0)) + + a = function bar(){ +>a : Symbol(a, Decl(namedFunctionExpressionAssignedToClassProperty.ts, 0, 10)) +>bar : Symbol(bar, Decl(namedFunctionExpressionAssignedToClassProperty.ts, 2, 10)) + + }; // this shouldn't crash the compiler... + + + + constructor(){ + + } + +} + diff --git a/tests/baselines/reference/namedFunctionExpressionCall.symbols b/tests/baselines/reference/namedFunctionExpressionCall.symbols new file mode 100644 index 00000000000..c4ee0d3db4b --- /dev/null +++ b/tests/baselines/reference/namedFunctionExpressionCall.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/namedFunctionExpressionCall.ts === +var recurser = function foo() { +>recurser : Symbol(recurser, Decl(namedFunctionExpressionCall.ts, 0, 3)) +>foo : Symbol(foo, Decl(namedFunctionExpressionCall.ts, 0, 14)) + + // using the local name + foo(); +>foo : Symbol(foo, Decl(namedFunctionExpressionCall.ts, 0, 14)) + + // using the globally visible name + recurser(); +>recurser : Symbol(recurser, Decl(namedFunctionExpressionCall.ts, 0, 3)) + +}; + + +(function bar() { +>bar : Symbol(bar, Decl(namedFunctionExpressionCall.ts, 9, 1)) + + bar(); +>bar : Symbol(bar, Decl(namedFunctionExpressionCall.ts, 9, 1)) + +}); diff --git a/tests/baselines/reference/namedFunctionExpressionInModule.symbols b/tests/baselines/reference/namedFunctionExpressionInModule.symbols new file mode 100644 index 00000000000..703cce7bf14 --- /dev/null +++ b/tests/baselines/reference/namedFunctionExpressionInModule.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/namedFunctionExpressionInModule.ts === +module Variables{ +>Variables : Symbol(Variables, Decl(namedFunctionExpressionInModule.ts, 0, 0)) + + var x = function bar(a, b, c) { +>x : Symbol(x, Decl(namedFunctionExpressionInModule.ts, 1, 7)) +>bar : Symbol(bar, Decl(namedFunctionExpressionInModule.ts, 1, 11)) +>a : Symbol(a, Decl(namedFunctionExpressionInModule.ts, 1, 25)) +>b : Symbol(b, Decl(namedFunctionExpressionInModule.ts, 1, 27)) +>c : Symbol(c, Decl(namedFunctionExpressionInModule.ts, 1, 30)) + } + x(1, 2, 3); +>x : Symbol(x, Decl(namedFunctionExpressionInModule.ts, 1, 7)) +} + diff --git a/tests/baselines/reference/namedFunctionExpressionInModule.types b/tests/baselines/reference/namedFunctionExpressionInModule.types index 9643d9ca069..8202cfbaf1b 100644 --- a/tests/baselines/reference/namedFunctionExpressionInModule.types +++ b/tests/baselines/reference/namedFunctionExpressionInModule.types @@ -13,5 +13,8 @@ module Variables{ x(1, 2, 3); >x(1, 2, 3) : void >x : (a: any, b: any, c: any) => void +>1 : number +>2 : number +>3 : number } diff --git a/tests/baselines/reference/namespaces1.symbols b/tests/baselines/reference/namespaces1.symbols new file mode 100644 index 00000000000..f31860b5a27 --- /dev/null +++ b/tests/baselines/reference/namespaces1.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/namespaces1.ts === +module X { +>X : Symbol(X, Decl(namespaces1.ts, 0, 0)) + + export module Y { +>Y : Symbol(Y, Decl(namespaces1.ts, 0, 10), Decl(namespaces1.ts, 3, 5)) + + export interface Z { } +>Z : Symbol(Z, Decl(namespaces1.ts, 1, 21)) + } + export interface Y { } +>Y : Symbol(Y, Decl(namespaces1.ts, 0, 10), Decl(namespaces1.ts, 3, 5)) +} + +var x: X.Y.Z; +>x : Symbol(x, Decl(namespaces1.ts, 7, 3)) +>X : Symbol(X, Decl(namespaces1.ts, 0, 0)) +>Y : Symbol(X.Y, Decl(namespaces1.ts, 0, 10), Decl(namespaces1.ts, 3, 5)) +>Z : Symbol(X.Y.Z, Decl(namespaces1.ts, 1, 21)) + +var x2: X.Y; +>x2 : Symbol(x2, Decl(namespaces1.ts, 8, 3)) +>X : Symbol(X, Decl(namespaces1.ts, 0, 0)) +>Y : Symbol(X.Y, Decl(namespaces1.ts, 0, 10), Decl(namespaces1.ts, 3, 5)) + diff --git a/tests/baselines/reference/namespaces1.types b/tests/baselines/reference/namespaces1.types index b4b41fbeda9..9aa0f8f4dfa 100644 --- a/tests/baselines/reference/namespaces1.types +++ b/tests/baselines/reference/namespaces1.types @@ -1,9 +1,9 @@ === tests/cases/compiler/namespaces1.ts === module X { ->X : unknown +>X : any export module Y { ->Y : unknown +>Y : any export interface Z { } >Z : Z @@ -14,12 +14,12 @@ module X { var x: X.Y.Z; >x : X.Y.Z ->X : unknown ->Y : unknown +>X : any +>Y : any >Z : X.Y.Z var x2: X.Y; >x2 : X.Y ->X : unknown +>X : any >Y : X.Y diff --git a/tests/baselines/reference/namespaces2.symbols b/tests/baselines/reference/namespaces2.symbols new file mode 100644 index 00000000000..a02d9e1c1cc --- /dev/null +++ b/tests/baselines/reference/namespaces2.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/namespaces2.ts === +module A { +>A : Symbol(A, Decl(namespaces2.ts, 0, 0)) + + export module B { +>B : Symbol(B, Decl(namespaces2.ts, 0, 10)) + + export class C { } +>C : Symbol(C, Decl(namespaces2.ts, 1, 21)) + } +} + +var c: A.B.C = new A.B.C(); +>c : Symbol(c, Decl(namespaces2.ts, 6, 3)) +>A : Symbol(A, Decl(namespaces2.ts, 0, 0)) +>B : Symbol(A.B, Decl(namespaces2.ts, 0, 10)) +>C : Symbol(A.B.C, Decl(namespaces2.ts, 1, 21)) +>A.B.C : Symbol(A.B.C, Decl(namespaces2.ts, 1, 21)) +>A.B : Symbol(A.B, Decl(namespaces2.ts, 0, 10)) +>A : Symbol(A, Decl(namespaces2.ts, 0, 0)) +>B : Symbol(A.B, Decl(namespaces2.ts, 0, 10)) +>C : Symbol(A.B.C, Decl(namespaces2.ts, 1, 21)) + diff --git a/tests/baselines/reference/namespaces2.types b/tests/baselines/reference/namespaces2.types index 909f56f561a..cc175a93d54 100644 --- a/tests/baselines/reference/namespaces2.types +++ b/tests/baselines/reference/namespaces2.types @@ -12,8 +12,8 @@ module A { var c: A.B.C = new A.B.C(); >c : A.B.C ->A : unknown ->B : unknown +>A : any +>B : any >C : A.B.C >new A.B.C() : A.B.C >A.B.C : typeof A.B.C diff --git a/tests/baselines/reference/negateOperatorWithAnyOtherType.symbols b/tests/baselines/reference/negateOperatorWithAnyOtherType.symbols new file mode 100644 index 00000000000..891fc363dbd --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithAnyOtherType.symbols @@ -0,0 +1,156 @@ +=== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithAnyOtherType.ts === +// - operator on any type + +var ANY: any; +>ANY : Symbol(ANY, Decl(negateOperatorWithAnyOtherType.ts, 2, 3)) + +var ANY1; +>ANY1 : Symbol(ANY1, Decl(negateOperatorWithAnyOtherType.ts, 3, 3)) + +var ANY2: any[] = ["", ""]; +>ANY2 : Symbol(ANY2, Decl(negateOperatorWithAnyOtherType.ts, 4, 3)) + +var obj: () => {} +>obj : Symbol(obj, Decl(negateOperatorWithAnyOtherType.ts, 5, 3)) + +var obj1 = { x: "", y: () => { }}; +>obj1 : Symbol(obj1, Decl(negateOperatorWithAnyOtherType.ts, 6, 3)) +>x : Symbol(x, Decl(negateOperatorWithAnyOtherType.ts, 6, 12)) +>y : Symbol(y, Decl(negateOperatorWithAnyOtherType.ts, 6, 19)) + +function foo(): any { +>foo : Symbol(foo, Decl(negateOperatorWithAnyOtherType.ts, 6, 34)) + + var a; +>a : Symbol(a, Decl(negateOperatorWithAnyOtherType.ts, 9, 7)) + + return a; +>a : Symbol(a, Decl(negateOperatorWithAnyOtherType.ts, 9, 7)) +} +class A { +>A : Symbol(A, Decl(negateOperatorWithAnyOtherType.ts, 11, 1)) + + public a: any; +>a : Symbol(a, Decl(negateOperatorWithAnyOtherType.ts, 12, 9)) + + static foo() { +>foo : Symbol(A.foo, Decl(negateOperatorWithAnyOtherType.ts, 13, 18)) + + var a; +>a : Symbol(a, Decl(negateOperatorWithAnyOtherType.ts, 15, 11)) + + return a; +>a : Symbol(a, Decl(negateOperatorWithAnyOtherType.ts, 15, 11)) + } +} +module M { +>M : Symbol(M, Decl(negateOperatorWithAnyOtherType.ts, 18, 1)) + + export var n: any; +>n : Symbol(n, Decl(negateOperatorWithAnyOtherType.ts, 20, 14)) +} +var objA = new A(); +>objA : Symbol(objA, Decl(negateOperatorWithAnyOtherType.ts, 22, 3)) +>A : Symbol(A, Decl(negateOperatorWithAnyOtherType.ts, 11, 1)) + +// any type var +var ResultIsNumber1 = -ANY1; +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(negateOperatorWithAnyOtherType.ts, 25, 3)) +>ANY1 : Symbol(ANY1, Decl(negateOperatorWithAnyOtherType.ts, 3, 3)) + +var ResultIsNumber2 = -ANY2; +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(negateOperatorWithAnyOtherType.ts, 26, 3)) +>ANY2 : Symbol(ANY2, Decl(negateOperatorWithAnyOtherType.ts, 4, 3)) + +var ResultIsNumber3 = -A; +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(negateOperatorWithAnyOtherType.ts, 27, 3)) +>A : Symbol(A, Decl(negateOperatorWithAnyOtherType.ts, 11, 1)) + +var ResultIsNumber4 = -M; +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(negateOperatorWithAnyOtherType.ts, 28, 3)) +>M : Symbol(M, Decl(negateOperatorWithAnyOtherType.ts, 18, 1)) + +var ResultIsNumber5 = -obj; +>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(negateOperatorWithAnyOtherType.ts, 29, 3)) +>obj : Symbol(obj, Decl(negateOperatorWithAnyOtherType.ts, 5, 3)) + +var ResultIsNumber6 = -obj1; +>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(negateOperatorWithAnyOtherType.ts, 30, 3)) +>obj1 : Symbol(obj1, Decl(negateOperatorWithAnyOtherType.ts, 6, 3)) + +// any type literal +var ResultIsNumber7 = -undefined; +>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(negateOperatorWithAnyOtherType.ts, 33, 3)) +>undefined : Symbol(undefined) + +var ResultIsNumber = -null; +>ResultIsNumber : Symbol(ResultIsNumber, Decl(negateOperatorWithAnyOtherType.ts, 34, 3)) + +// any type expressions +var ResultIsNumber8 = -ANY2[0]; +>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(negateOperatorWithAnyOtherType.ts, 37, 3)) +>ANY2 : Symbol(ANY2, Decl(negateOperatorWithAnyOtherType.ts, 4, 3)) + +var ResultIsNumber9 = -obj1.x; +>ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(negateOperatorWithAnyOtherType.ts, 38, 3)) +>obj1.x : Symbol(x, Decl(negateOperatorWithAnyOtherType.ts, 6, 12)) +>obj1 : Symbol(obj1, Decl(negateOperatorWithAnyOtherType.ts, 6, 3)) +>x : Symbol(x, Decl(negateOperatorWithAnyOtherType.ts, 6, 12)) + +var ResultIsNumber10 = -obj1.y; +>ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(negateOperatorWithAnyOtherType.ts, 39, 3)) +>obj1.y : Symbol(y, Decl(negateOperatorWithAnyOtherType.ts, 6, 19)) +>obj1 : Symbol(obj1, Decl(negateOperatorWithAnyOtherType.ts, 6, 3)) +>y : Symbol(y, Decl(negateOperatorWithAnyOtherType.ts, 6, 19)) + +var ResultIsNumber11 = -objA.a; +>ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(negateOperatorWithAnyOtherType.ts, 40, 3)) +>objA.a : Symbol(A.a, Decl(negateOperatorWithAnyOtherType.ts, 12, 9)) +>objA : Symbol(objA, Decl(negateOperatorWithAnyOtherType.ts, 22, 3)) +>a : Symbol(A.a, Decl(negateOperatorWithAnyOtherType.ts, 12, 9)) + +var ResultIsNumber12 = -M.n; +>ResultIsNumber12 : Symbol(ResultIsNumber12, Decl(negateOperatorWithAnyOtherType.ts, 41, 3)) +>M.n : Symbol(M.n, Decl(negateOperatorWithAnyOtherType.ts, 20, 14)) +>M : Symbol(M, Decl(negateOperatorWithAnyOtherType.ts, 18, 1)) +>n : Symbol(M.n, Decl(negateOperatorWithAnyOtherType.ts, 20, 14)) + +var ResultIsNumber13 = -foo(); +>ResultIsNumber13 : Symbol(ResultIsNumber13, Decl(negateOperatorWithAnyOtherType.ts, 42, 3)) +>foo : Symbol(foo, Decl(negateOperatorWithAnyOtherType.ts, 6, 34)) + +var ResultIsNumber14 = -A.foo(); +>ResultIsNumber14 : Symbol(ResultIsNumber14, Decl(negateOperatorWithAnyOtherType.ts, 43, 3)) +>A.foo : Symbol(A.foo, Decl(negateOperatorWithAnyOtherType.ts, 13, 18)) +>A : Symbol(A, Decl(negateOperatorWithAnyOtherType.ts, 11, 1)) +>foo : Symbol(A.foo, Decl(negateOperatorWithAnyOtherType.ts, 13, 18)) + +var ResultIsNumber15 = -(ANY - ANY1); +>ResultIsNumber15 : Symbol(ResultIsNumber15, Decl(negateOperatorWithAnyOtherType.ts, 44, 3)) +>ANY : Symbol(ANY, Decl(negateOperatorWithAnyOtherType.ts, 2, 3)) +>ANY1 : Symbol(ANY1, Decl(negateOperatorWithAnyOtherType.ts, 3, 3)) + +// miss assignment operators +-ANY; +>ANY : Symbol(ANY, Decl(negateOperatorWithAnyOtherType.ts, 2, 3)) + +-ANY1; +>ANY1 : Symbol(ANY1, Decl(negateOperatorWithAnyOtherType.ts, 3, 3)) + +-ANY2[0]; +>ANY2 : Symbol(ANY2, Decl(negateOperatorWithAnyOtherType.ts, 4, 3)) + +-ANY, ANY1; +>ANY : Symbol(ANY, Decl(negateOperatorWithAnyOtherType.ts, 2, 3)) +>ANY1 : Symbol(ANY1, Decl(negateOperatorWithAnyOtherType.ts, 3, 3)) + +-objA.a; +>objA.a : Symbol(A.a, Decl(negateOperatorWithAnyOtherType.ts, 12, 9)) +>objA : Symbol(objA, Decl(negateOperatorWithAnyOtherType.ts, 22, 3)) +>a : Symbol(A.a, Decl(negateOperatorWithAnyOtherType.ts, 12, 9)) + +-M.n; +>M.n : Symbol(M.n, Decl(negateOperatorWithAnyOtherType.ts, 20, 14)) +>M : Symbol(M, Decl(negateOperatorWithAnyOtherType.ts, 18, 1)) +>n : Symbol(M.n, Decl(negateOperatorWithAnyOtherType.ts, 20, 14)) + diff --git a/tests/baselines/reference/negateOperatorWithAnyOtherType.types b/tests/baselines/reference/negateOperatorWithAnyOtherType.types index 85a2d9c9233..f864c9d166c 100644 --- a/tests/baselines/reference/negateOperatorWithAnyOtherType.types +++ b/tests/baselines/reference/negateOperatorWithAnyOtherType.types @@ -10,6 +10,8 @@ var ANY1; var ANY2: any[] = ["", ""]; >ANY2 : any[] >["", ""] : string[] +>"" : string +>"" : string var obj: () => {} >obj : () => {} @@ -18,6 +20,7 @@ var obj1 = { x: "", y: () => { }}; >obj1 : { x: string; y: () => void; } >{ x: "", y: () => { }} : { x: string; y: () => void; } >x : string +>"" : string >y : () => void >() => { } : () => void @@ -97,6 +100,7 @@ var ResultIsNumber7 = -undefined; var ResultIsNumber = -null; >ResultIsNumber : number >-null : number +>null : null // any type expressions var ResultIsNumber8 = -ANY2[0]; @@ -104,6 +108,7 @@ var ResultIsNumber8 = -ANY2[0]; >-ANY2[0] : number >ANY2[0] : any >ANY2 : any[] +>0 : number var ResultIsNumber9 = -obj1.x; >ResultIsNumber9 : number @@ -168,6 +173,7 @@ var ResultIsNumber15 = -(ANY - ANY1); >-ANY2[0] : number >ANY2[0] : any >ANY2 : any[] +>0 : number -ANY, ANY1; >-ANY, ANY1 : any diff --git a/tests/baselines/reference/negateOperatorWithBooleanType.symbols b/tests/baselines/reference/negateOperatorWithBooleanType.symbols new file mode 100644 index 00000000000..55b35026b97 --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithBooleanType.symbols @@ -0,0 +1,84 @@ +=== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithBooleanType.ts === +// - operator on boolean type +var BOOLEAN: boolean; +>BOOLEAN : Symbol(BOOLEAN, Decl(negateOperatorWithBooleanType.ts, 1, 3)) + +function foo(): boolean { return true; } +>foo : Symbol(foo, Decl(negateOperatorWithBooleanType.ts, 1, 21)) + +class A { +>A : Symbol(A, Decl(negateOperatorWithBooleanType.ts, 3, 40)) + + public a: boolean; +>a : Symbol(a, Decl(negateOperatorWithBooleanType.ts, 5, 9)) + + static foo() { return false; } +>foo : Symbol(A.foo, Decl(negateOperatorWithBooleanType.ts, 6, 22)) +} +module M { +>M : Symbol(M, Decl(negateOperatorWithBooleanType.ts, 8, 1)) + + export var n: boolean; +>n : Symbol(n, Decl(negateOperatorWithBooleanType.ts, 10, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(negateOperatorWithBooleanType.ts, 13, 3)) +>A : Symbol(A, Decl(negateOperatorWithBooleanType.ts, 3, 40)) + +// boolean type var +var ResultIsNumber1 = -BOOLEAN; +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(negateOperatorWithBooleanType.ts, 16, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(negateOperatorWithBooleanType.ts, 1, 3)) + +// boolean type literal +var ResultIsNumber2 = -true; +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(negateOperatorWithBooleanType.ts, 19, 3)) + +var ResultIsNumber3 = -{ x: true, y: false }; +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(negateOperatorWithBooleanType.ts, 20, 3)) +>x : Symbol(x, Decl(negateOperatorWithBooleanType.ts, 20, 24)) +>y : Symbol(y, Decl(negateOperatorWithBooleanType.ts, 20, 33)) + +// boolean type expressions +var ResultIsNumber4 = -objA.a; +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(negateOperatorWithBooleanType.ts, 23, 3)) +>objA.a : Symbol(A.a, Decl(negateOperatorWithBooleanType.ts, 5, 9)) +>objA : Symbol(objA, Decl(negateOperatorWithBooleanType.ts, 13, 3)) +>a : Symbol(A.a, Decl(negateOperatorWithBooleanType.ts, 5, 9)) + +var ResultIsNumber5 = -M.n; +>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(negateOperatorWithBooleanType.ts, 24, 3)) +>M.n : Symbol(M.n, Decl(negateOperatorWithBooleanType.ts, 10, 14)) +>M : Symbol(M, Decl(negateOperatorWithBooleanType.ts, 8, 1)) +>n : Symbol(M.n, Decl(negateOperatorWithBooleanType.ts, 10, 14)) + +var ResultIsNumber6 = -foo(); +>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(negateOperatorWithBooleanType.ts, 25, 3)) +>foo : Symbol(foo, Decl(negateOperatorWithBooleanType.ts, 1, 21)) + +var ResultIsNumber7 = -A.foo(); +>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(negateOperatorWithBooleanType.ts, 26, 3)) +>A.foo : Symbol(A.foo, Decl(negateOperatorWithBooleanType.ts, 6, 22)) +>A : Symbol(A, Decl(negateOperatorWithBooleanType.ts, 3, 40)) +>foo : Symbol(A.foo, Decl(negateOperatorWithBooleanType.ts, 6, 22)) + +// miss assignment operators +-true; +-BOOLEAN; +>BOOLEAN : Symbol(BOOLEAN, Decl(negateOperatorWithBooleanType.ts, 1, 3)) + +-foo(); +>foo : Symbol(foo, Decl(negateOperatorWithBooleanType.ts, 1, 21)) + +-true, false; +-objA.a; +>objA.a : Symbol(A.a, Decl(negateOperatorWithBooleanType.ts, 5, 9)) +>objA : Symbol(objA, Decl(negateOperatorWithBooleanType.ts, 13, 3)) +>a : Symbol(A.a, Decl(negateOperatorWithBooleanType.ts, 5, 9)) + +-M.n; +>M.n : Symbol(M.n, Decl(negateOperatorWithBooleanType.ts, 10, 14)) +>M : Symbol(M, Decl(negateOperatorWithBooleanType.ts, 8, 1)) +>n : Symbol(M.n, Decl(negateOperatorWithBooleanType.ts, 10, 14)) + diff --git a/tests/baselines/reference/negateOperatorWithBooleanType.types b/tests/baselines/reference/negateOperatorWithBooleanType.types index 49467d87845..89f5afc1c2b 100644 --- a/tests/baselines/reference/negateOperatorWithBooleanType.types +++ b/tests/baselines/reference/negateOperatorWithBooleanType.types @@ -5,6 +5,7 @@ var BOOLEAN: boolean; function foo(): boolean { return true; } >foo : () => boolean +>true : boolean class A { >A : A @@ -14,6 +15,7 @@ class A { static foo() { return false; } >foo : () => boolean +>false : boolean } module M { >M : typeof M @@ -37,13 +39,16 @@ var ResultIsNumber1 = -BOOLEAN; var ResultIsNumber2 = -true; >ResultIsNumber2 : number >-true : number +>true : boolean var ResultIsNumber3 = -{ x: true, y: false }; >ResultIsNumber3 : number >-{ x: true, y: false } : number >{ x: true, y: false } : { x: boolean; y: boolean; } >x : boolean +>true : boolean >y : boolean +>false : boolean // boolean type expressions var ResultIsNumber4 = -objA.a; @@ -77,6 +82,7 @@ var ResultIsNumber7 = -A.foo(); // miss assignment operators -true; >-true : number +>true : boolean -BOOLEAN; >-BOOLEAN : number @@ -90,6 +96,8 @@ var ResultIsNumber7 = -A.foo(); -true, false; >-true, false : boolean >-true : number +>true : boolean +>false : boolean -objA.a; >-objA.a : number diff --git a/tests/baselines/reference/negateOperatorWithEnumType.symbols b/tests/baselines/reference/negateOperatorWithEnumType.symbols new file mode 100644 index 00000000000..9d97cda0466 --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithEnumType.symbols @@ -0,0 +1,45 @@ +=== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithEnumType.ts === +// - operator on enum type + +enum ENUM { }; +>ENUM : Symbol(ENUM, Decl(negateOperatorWithEnumType.ts, 0, 0)) + +enum ENUM1 { A, B, "" }; +>ENUM1 : Symbol(ENUM1, Decl(negateOperatorWithEnumType.ts, 2, 14)) +>A : Symbol(ENUM1.A, Decl(negateOperatorWithEnumType.ts, 3, 12)) +>B : Symbol(ENUM1.B, Decl(negateOperatorWithEnumType.ts, 3, 15)) + +// enum type var +var ResultIsNumber1 = -ENUM; +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(negateOperatorWithEnumType.ts, 6, 3)) +>ENUM : Symbol(ENUM, Decl(negateOperatorWithEnumType.ts, 0, 0)) + +// expressions +var ResultIsNumber2 = -ENUM1["B"]; +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(negateOperatorWithEnumType.ts, 9, 3)) +>ENUM1 : Symbol(ENUM1, Decl(negateOperatorWithEnumType.ts, 2, 14)) +>"B" : Symbol(ENUM1.B, Decl(negateOperatorWithEnumType.ts, 3, 15)) + +var ResultIsNumber3 = -(ENUM1.B + ENUM1[""]); +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(negateOperatorWithEnumType.ts, 10, 3)) +>ENUM1.B : Symbol(ENUM1.B, Decl(negateOperatorWithEnumType.ts, 3, 15)) +>ENUM1 : Symbol(ENUM1, Decl(negateOperatorWithEnumType.ts, 2, 14)) +>B : Symbol(ENUM1.B, Decl(negateOperatorWithEnumType.ts, 3, 15)) +>ENUM1 : Symbol(ENUM1, Decl(negateOperatorWithEnumType.ts, 2, 14)) +>"" : Symbol(ENUM1."", Decl(negateOperatorWithEnumType.ts, 3, 18)) + +// miss assignment operators +-ENUM; +>ENUM : Symbol(ENUM, Decl(negateOperatorWithEnumType.ts, 0, 0)) + +-ENUM1; +>ENUM1 : Symbol(ENUM1, Decl(negateOperatorWithEnumType.ts, 2, 14)) + +-ENUM1["B"]; +>ENUM1 : Symbol(ENUM1, Decl(negateOperatorWithEnumType.ts, 2, 14)) +>"B" : Symbol(ENUM1.B, Decl(negateOperatorWithEnumType.ts, 3, 15)) + +-ENUM, ENUM1; +>ENUM : Symbol(ENUM, Decl(negateOperatorWithEnumType.ts, 0, 0)) +>ENUM1 : Symbol(ENUM1, Decl(negateOperatorWithEnumType.ts, 2, 14)) + diff --git a/tests/baselines/reference/negateOperatorWithEnumType.types b/tests/baselines/reference/negateOperatorWithEnumType.types index 96a33ff4c6e..2f39a581ef8 100644 --- a/tests/baselines/reference/negateOperatorWithEnumType.types +++ b/tests/baselines/reference/negateOperatorWithEnumType.types @@ -21,6 +21,7 @@ var ResultIsNumber2 = -ENUM1["B"]; >-ENUM1["B"] : number >ENUM1["B"] : ENUM1 >ENUM1 : typeof ENUM1 +>"B" : string var ResultIsNumber3 = -(ENUM1.B + ENUM1[""]); >ResultIsNumber3 : number @@ -32,6 +33,7 @@ var ResultIsNumber3 = -(ENUM1.B + ENUM1[""]); >B : ENUM1 >ENUM1[""] : ENUM1 >ENUM1 : typeof ENUM1 +>"" : string // miss assignment operators -ENUM; @@ -46,6 +48,7 @@ var ResultIsNumber3 = -(ENUM1.B + ENUM1[""]); >-ENUM1["B"] : number >ENUM1["B"] : ENUM1 >ENUM1 : typeof ENUM1 +>"B" : string -ENUM, ENUM1; >-ENUM, ENUM1 : typeof ENUM1 diff --git a/tests/baselines/reference/negateOperatorWithNumberType.symbols b/tests/baselines/reference/negateOperatorWithNumberType.symbols new file mode 100644 index 00000000000..1f75d922b09 --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithNumberType.symbols @@ -0,0 +1,117 @@ +=== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithNumberType.ts === +// - operator on number type +var NUMBER: number; +>NUMBER : Symbol(NUMBER, Decl(negateOperatorWithNumberType.ts, 1, 3)) + +var NUMBER1: number[] = [1, 2]; +>NUMBER1 : Symbol(NUMBER1, Decl(negateOperatorWithNumberType.ts, 2, 3)) + +function foo(): number { return 1; } +>foo : Symbol(foo, Decl(negateOperatorWithNumberType.ts, 2, 31)) + +class A { +>A : Symbol(A, Decl(negateOperatorWithNumberType.ts, 4, 36)) + + public a: number; +>a : Symbol(a, Decl(negateOperatorWithNumberType.ts, 6, 9)) + + static foo() { return 1; } +>foo : Symbol(A.foo, Decl(negateOperatorWithNumberType.ts, 7, 21)) +} +module M { +>M : Symbol(M, Decl(negateOperatorWithNumberType.ts, 9, 1)) + + export var n: number; +>n : Symbol(n, Decl(negateOperatorWithNumberType.ts, 11, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(negateOperatorWithNumberType.ts, 14, 3)) +>A : Symbol(A, Decl(negateOperatorWithNumberType.ts, 4, 36)) + +// number type var +var ResultIsNumber1 = -NUMBER; +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(negateOperatorWithNumberType.ts, 17, 3)) +>NUMBER : Symbol(NUMBER, Decl(negateOperatorWithNumberType.ts, 1, 3)) + +var ResultIsNumber2 = -NUMBER1; +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(negateOperatorWithNumberType.ts, 18, 3)) +>NUMBER1 : Symbol(NUMBER1, Decl(negateOperatorWithNumberType.ts, 2, 3)) + +// number type literal +var ResultIsNumber3 = -1; +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(negateOperatorWithNumberType.ts, 21, 3)) + +var ResultIsNumber4 = -{ x: 1, y: 2}; +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(negateOperatorWithNumberType.ts, 22, 3)) +>x : Symbol(x, Decl(negateOperatorWithNumberType.ts, 22, 24)) +>y : Symbol(y, Decl(negateOperatorWithNumberType.ts, 22, 30)) + +var ResultIsNumber5 = -{ x: 1, y: (n: number) => { return n; } }; +>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(negateOperatorWithNumberType.ts, 23, 3)) +>x : Symbol(x, Decl(negateOperatorWithNumberType.ts, 23, 24)) +>y : Symbol(y, Decl(negateOperatorWithNumberType.ts, 23, 30)) +>n : Symbol(n, Decl(negateOperatorWithNumberType.ts, 23, 35)) +>n : Symbol(n, Decl(negateOperatorWithNumberType.ts, 23, 35)) + +// number type expressions +var ResultIsNumber6 = -objA.a; +>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(negateOperatorWithNumberType.ts, 26, 3)) +>objA.a : Symbol(A.a, Decl(negateOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(negateOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(negateOperatorWithNumberType.ts, 6, 9)) + +var ResultIsNumber7 = -M.n; +>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(negateOperatorWithNumberType.ts, 27, 3)) +>M.n : Symbol(M.n, Decl(negateOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(negateOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(negateOperatorWithNumberType.ts, 11, 14)) + +var ResultIsNumber8 = -NUMBER1[0]; +>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(negateOperatorWithNumberType.ts, 28, 3)) +>NUMBER1 : Symbol(NUMBER1, Decl(negateOperatorWithNumberType.ts, 2, 3)) + +var ResultIsNumber9 = -foo(); +>ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(negateOperatorWithNumberType.ts, 29, 3)) +>foo : Symbol(foo, Decl(negateOperatorWithNumberType.ts, 2, 31)) + +var ResultIsNumber10 = -A.foo(); +>ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(negateOperatorWithNumberType.ts, 30, 3)) +>A.foo : Symbol(A.foo, Decl(negateOperatorWithNumberType.ts, 7, 21)) +>A : Symbol(A, Decl(negateOperatorWithNumberType.ts, 4, 36)) +>foo : Symbol(A.foo, Decl(negateOperatorWithNumberType.ts, 7, 21)) + +var ResultIsNumber11 = -(NUMBER - NUMBER); +>ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(negateOperatorWithNumberType.ts, 31, 3)) +>NUMBER : Symbol(NUMBER, Decl(negateOperatorWithNumberType.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(negateOperatorWithNumberType.ts, 1, 3)) + +// miss assignment operators +-1; +-NUMBER; +>NUMBER : Symbol(NUMBER, Decl(negateOperatorWithNumberType.ts, 1, 3)) + +-NUMBER1; +>NUMBER1 : Symbol(NUMBER1, Decl(negateOperatorWithNumberType.ts, 2, 3)) + +-foo(); +>foo : Symbol(foo, Decl(negateOperatorWithNumberType.ts, 2, 31)) + +-objA.a; +>objA.a : Symbol(A.a, Decl(negateOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(negateOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(negateOperatorWithNumberType.ts, 6, 9)) + +-M.n; +>M.n : Symbol(M.n, Decl(negateOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(negateOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(negateOperatorWithNumberType.ts, 11, 14)) + +-objA.a, M.n; +>objA.a : Symbol(A.a, Decl(negateOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(negateOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(negateOperatorWithNumberType.ts, 6, 9)) +>M.n : Symbol(M.n, Decl(negateOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(negateOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(negateOperatorWithNumberType.ts, 11, 14)) + diff --git a/tests/baselines/reference/negateOperatorWithNumberType.types b/tests/baselines/reference/negateOperatorWithNumberType.types index f6cee89f6df..e53a4e54444 100644 --- a/tests/baselines/reference/negateOperatorWithNumberType.types +++ b/tests/baselines/reference/negateOperatorWithNumberType.types @@ -6,9 +6,12 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] +>1 : number +>2 : number function foo(): number { return 1; } >foo : () => number +>1 : number class A { >A : A @@ -18,6 +21,7 @@ class A { static foo() { return 1; } >foo : () => number +>1 : number } module M { >M : typeof M @@ -46,19 +50,23 @@ var ResultIsNumber2 = -NUMBER1; var ResultIsNumber3 = -1; >ResultIsNumber3 : number >-1 : number +>1 : number var ResultIsNumber4 = -{ x: 1, y: 2}; >ResultIsNumber4 : number >-{ x: 1, y: 2} : number >{ x: 1, y: 2} : { x: number; y: number; } >x : number +>1 : number >y : number +>2 : number var ResultIsNumber5 = -{ x: 1, y: (n: number) => { return n; } }; >ResultIsNumber5 : number >-{ x: 1, y: (n: number) => { return n; } } : number >{ x: 1, y: (n: number) => { return n; } } : { x: number; y: (n: number) => number; } >x : number +>1 : number >y : (n: number) => number >(n: number) => { return n; } : (n: number) => number >n : number @@ -84,6 +92,7 @@ var ResultIsNumber8 = -NUMBER1[0]; >-NUMBER1[0] : number >NUMBER1[0] : number >NUMBER1 : number[] +>0 : number var ResultIsNumber9 = -foo(); >ResultIsNumber9 : number @@ -110,6 +119,7 @@ var ResultIsNumber11 = -(NUMBER - NUMBER); // miss assignment operators -1; >-1 : number +>1 : number -NUMBER; >-NUMBER : number diff --git a/tests/baselines/reference/negateOperatorWithStringType.symbols b/tests/baselines/reference/negateOperatorWithStringType.symbols new file mode 100644 index 00000000000..00a90bdf743 --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithStringType.symbols @@ -0,0 +1,113 @@ +=== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithStringType.ts === +// - operator on string type +var STRING: string; +>STRING : Symbol(STRING, Decl(negateOperatorWithStringType.ts, 1, 3)) + +var STRING1: string[] = ["", "abc"]; +>STRING1 : Symbol(STRING1, Decl(negateOperatorWithStringType.ts, 2, 3)) + +function foo(): string { return "abc"; } +>foo : Symbol(foo, Decl(negateOperatorWithStringType.ts, 2, 36)) + +class A { +>A : Symbol(A, Decl(negateOperatorWithStringType.ts, 4, 40)) + + public a: string; +>a : Symbol(a, Decl(negateOperatorWithStringType.ts, 6, 9)) + + static foo() { return ""; } +>foo : Symbol(A.foo, Decl(negateOperatorWithStringType.ts, 7, 21)) +} +module M { +>M : Symbol(M, Decl(negateOperatorWithStringType.ts, 9, 1)) + + export var n: string; +>n : Symbol(n, Decl(negateOperatorWithStringType.ts, 11, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(negateOperatorWithStringType.ts, 14, 3)) +>A : Symbol(A, Decl(negateOperatorWithStringType.ts, 4, 40)) + +// string type var +var ResultIsNumber1 = -STRING; +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(negateOperatorWithStringType.ts, 17, 3)) +>STRING : Symbol(STRING, Decl(negateOperatorWithStringType.ts, 1, 3)) + +var ResultIsNumber2 = -STRING1; +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(negateOperatorWithStringType.ts, 18, 3)) +>STRING1 : Symbol(STRING1, Decl(negateOperatorWithStringType.ts, 2, 3)) + +// string type literal +var ResultIsNumber3 = -""; +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(negateOperatorWithStringType.ts, 21, 3)) + +var ResultIsNumber4 = -{ x: "", y: "" }; +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(negateOperatorWithStringType.ts, 22, 3)) +>x : Symbol(x, Decl(negateOperatorWithStringType.ts, 22, 24)) +>y : Symbol(y, Decl(negateOperatorWithStringType.ts, 22, 31)) + +var ResultIsNumber5 = -{ x: "", y: (s: string) => { return s; } }; +>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(negateOperatorWithStringType.ts, 23, 3)) +>x : Symbol(x, Decl(negateOperatorWithStringType.ts, 23, 24)) +>y : Symbol(y, Decl(negateOperatorWithStringType.ts, 23, 31)) +>s : Symbol(s, Decl(negateOperatorWithStringType.ts, 23, 36)) +>s : Symbol(s, Decl(negateOperatorWithStringType.ts, 23, 36)) + +// string type expressions +var ResultIsNumber6 = -objA.a; +>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(negateOperatorWithStringType.ts, 26, 3)) +>objA.a : Symbol(A.a, Decl(negateOperatorWithStringType.ts, 6, 9)) +>objA : Symbol(objA, Decl(negateOperatorWithStringType.ts, 14, 3)) +>a : Symbol(A.a, Decl(negateOperatorWithStringType.ts, 6, 9)) + +var ResultIsNumber7 = -M.n; +>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(negateOperatorWithStringType.ts, 27, 3)) +>M.n : Symbol(M.n, Decl(negateOperatorWithStringType.ts, 11, 14)) +>M : Symbol(M, Decl(negateOperatorWithStringType.ts, 9, 1)) +>n : Symbol(M.n, Decl(negateOperatorWithStringType.ts, 11, 14)) + +var ResultIsNumber8 = -STRING1[0]; +>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(negateOperatorWithStringType.ts, 28, 3)) +>STRING1 : Symbol(STRING1, Decl(negateOperatorWithStringType.ts, 2, 3)) + +var ResultIsNumber9 = -foo(); +>ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(negateOperatorWithStringType.ts, 29, 3)) +>foo : Symbol(foo, Decl(negateOperatorWithStringType.ts, 2, 36)) + +var ResultIsNumber10 = -A.foo(); +>ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(negateOperatorWithStringType.ts, 30, 3)) +>A.foo : Symbol(A.foo, Decl(negateOperatorWithStringType.ts, 7, 21)) +>A : Symbol(A, Decl(negateOperatorWithStringType.ts, 4, 40)) +>foo : Symbol(A.foo, Decl(negateOperatorWithStringType.ts, 7, 21)) + +var ResultIsNumber11 = -(STRING + STRING); +>ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(negateOperatorWithStringType.ts, 31, 3)) +>STRING : Symbol(STRING, Decl(negateOperatorWithStringType.ts, 1, 3)) +>STRING : Symbol(STRING, Decl(negateOperatorWithStringType.ts, 1, 3)) + +var ResultIsNumber12 = -STRING.charAt(0); +>ResultIsNumber12 : Symbol(ResultIsNumber12, Decl(negateOperatorWithStringType.ts, 32, 3)) +>STRING.charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>STRING : Symbol(STRING, Decl(negateOperatorWithStringType.ts, 1, 3)) +>charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) + +// miss assignment operators +-""; +-STRING; +>STRING : Symbol(STRING, Decl(negateOperatorWithStringType.ts, 1, 3)) + +-STRING1; +>STRING1 : Symbol(STRING1, Decl(negateOperatorWithStringType.ts, 2, 3)) + +-foo(); +>foo : Symbol(foo, Decl(negateOperatorWithStringType.ts, 2, 36)) + +-objA.a,M.n; +>objA.a : Symbol(A.a, Decl(negateOperatorWithStringType.ts, 6, 9)) +>objA : Symbol(objA, Decl(negateOperatorWithStringType.ts, 14, 3)) +>a : Symbol(A.a, Decl(negateOperatorWithStringType.ts, 6, 9)) +>M.n : Symbol(M.n, Decl(negateOperatorWithStringType.ts, 11, 14)) +>M : Symbol(M, Decl(negateOperatorWithStringType.ts, 9, 1)) +>n : Symbol(M.n, Decl(negateOperatorWithStringType.ts, 11, 14)) + diff --git a/tests/baselines/reference/negateOperatorWithStringType.types b/tests/baselines/reference/negateOperatorWithStringType.types index 43a9f05cc5b..6ef570557fe 100644 --- a/tests/baselines/reference/negateOperatorWithStringType.types +++ b/tests/baselines/reference/negateOperatorWithStringType.types @@ -6,9 +6,12 @@ var STRING: string; var STRING1: string[] = ["", "abc"]; >STRING1 : string[] >["", "abc"] : string[] +>"" : string +>"abc" : string function foo(): string { return "abc"; } >foo : () => string +>"abc" : string class A { >A : A @@ -18,6 +21,7 @@ class A { static foo() { return ""; } >foo : () => string +>"" : string } module M { >M : typeof M @@ -46,19 +50,23 @@ var ResultIsNumber2 = -STRING1; var ResultIsNumber3 = -""; >ResultIsNumber3 : number >-"" : number +>"" : string var ResultIsNumber4 = -{ x: "", y: "" }; >ResultIsNumber4 : number >-{ x: "", y: "" } : number >{ x: "", y: "" } : { x: string; y: string; } >x : string +>"" : string >y : string +>"" : string var ResultIsNumber5 = -{ x: "", y: (s: string) => { return s; } }; >ResultIsNumber5 : number >-{ x: "", y: (s: string) => { return s; } } : number >{ x: "", y: (s: string) => { return s; } } : { x: string; y: (s: string) => string; } >x : string +>"" : string >y : (s: string) => string >(s: string) => { return s; } : (s: string) => string >s : string @@ -84,6 +92,7 @@ var ResultIsNumber8 = -STRING1[0]; >-STRING1[0] : number >STRING1[0] : string >STRING1 : string[] +>0 : number var ResultIsNumber9 = -foo(); >ResultIsNumber9 : number @@ -114,10 +123,12 @@ var ResultIsNumber12 = -STRING.charAt(0); >STRING.charAt : (pos: number) => string >STRING : string >charAt : (pos: number) => string +>0 : number // miss assignment operators -""; >-"" : number +>"" : string -STRING; >-STRING : number diff --git a/tests/baselines/reference/negativeZero.symbols b/tests/baselines/reference/negativeZero.symbols new file mode 100644 index 00000000000..cdd6880a86f --- /dev/null +++ b/tests/baselines/reference/negativeZero.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/negativeZero.ts === +var x = -0 +>x : Symbol(x, Decl(negativeZero.ts, 0, 3)) + diff --git a/tests/baselines/reference/negativeZero.types b/tests/baselines/reference/negativeZero.types index 97ba45a741a..3468e22fdb2 100644 --- a/tests/baselines/reference/negativeZero.types +++ b/tests/baselines/reference/negativeZero.types @@ -2,4 +2,5 @@ var x = -0 >x : number >-0 : number +>0 : number diff --git a/tests/baselines/reference/nestedGenerics.symbols b/tests/baselines/reference/nestedGenerics.symbols new file mode 100644 index 00000000000..24b3e1eb89d --- /dev/null +++ b/tests/baselines/reference/nestedGenerics.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/nestedGenerics.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(nestedGenerics.ts, 0, 0)) +>T : Symbol(T, Decl(nestedGenerics.ts, 0, 14)) + + t: T; +>t : Symbol(t, Decl(nestedGenerics.ts, 0, 18)) +>T : Symbol(T, Decl(nestedGenerics.ts, 0, 14)) +} + +var f: Foo>; +>f : Symbol(f, Decl(nestedGenerics.ts, 4, 3)) +>Foo : Symbol(Foo, Decl(nestedGenerics.ts, 0, 0)) +>Foo : Symbol(Foo, Decl(nestedGenerics.ts, 0, 0)) + diff --git a/tests/baselines/reference/nestedIfStatement.symbols b/tests/baselines/reference/nestedIfStatement.symbols new file mode 100644 index 00000000000..4dddcd75925 --- /dev/null +++ b/tests/baselines/reference/nestedIfStatement.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/nestedIfStatement.ts === +if (0) { +No type information for this code.} else if (1) { +No type information for this code.} else if (2) { +No type information for this code.} else if (3) { +No type information for this code.} else { +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/nestedIfStatement.types b/tests/baselines/reference/nestedIfStatement.types index 4dddcd75925..19799d25172 100644 --- a/tests/baselines/reference/nestedIfStatement.types +++ b/tests/baselines/reference/nestedIfStatement.types @@ -1,8 +1,15 @@ === tests/cases/compiler/nestedIfStatement.ts === if (0) { -No type information for this code.} else if (1) { -No type information for this code.} else if (2) { -No type information for this code.} else if (3) { -No type information for this code.} else { -No type information for this code.} -No type information for this code. \ No newline at end of file +>0 : number + +} else if (1) { +>1 : number + +} else if (2) { +>2 : number + +} else if (3) { +>3 : number + +} else { +} diff --git a/tests/baselines/reference/nestedIndexer.symbols b/tests/baselines/reference/nestedIndexer.symbols new file mode 100644 index 00000000000..cbe729277e0 --- /dev/null +++ b/tests/baselines/reference/nestedIndexer.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/nestedIndexer.ts === +function then(x) { +>then : Symbol(then, Decl(nestedIndexer.ts, 0, 0)) +>x : Symbol(x, Decl(nestedIndexer.ts, 0, 14)) + +var match: { [index: number]: string; } +>match : Symbol(match, Decl(nestedIndexer.ts, 2, 3)) +>index : Symbol(index, Decl(nestedIndexer.ts, 2, 14)) + +} + diff --git a/tests/baselines/reference/nestedInfinitelyExpandedRecursiveTypes.symbols b/tests/baselines/reference/nestedInfinitelyExpandedRecursiveTypes.symbols new file mode 100644 index 00000000000..28206f8dec2 --- /dev/null +++ b/tests/baselines/reference/nestedInfinitelyExpandedRecursiveTypes.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/nestedInfinitelyExpandedRecursiveTypes.ts === +interface F { +>F : Symbol(F, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 0, 0)) +>T : Symbol(T, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 0, 12)) + + t: G T>>; +>t : Symbol(t, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 0, 16)) +>G : Symbol(G, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 2, 1)) +>F : Symbol(F, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 0, 0)) +>T : Symbol(T, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 0, 12)) +} +interface G { +>G : Symbol(G, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 2, 1)) +>U : Symbol(U, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 3, 12)) + + t: G U>>; +>t : Symbol(t, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 3, 16)) +>G : Symbol(G, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 2, 1)) +>G : Symbol(G, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 2, 1)) +>U : Symbol(U, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 3, 12)) +} + +var f: F; +>f : Symbol(f, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 7, 3)) +>F : Symbol(F, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 0, 0)) + +var g: G; +>g : Symbol(g, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 8, 3)) +>G : Symbol(G, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 2, 1)) + +f = g; +>f : Symbol(f, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 7, 3)) +>g : Symbol(g, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 8, 3)) + +g = f; +>g : Symbol(g, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 8, 3)) +>f : Symbol(f, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 7, 3)) + diff --git a/tests/baselines/reference/nestedModulePrivateAccess.symbols b/tests/baselines/reference/nestedModulePrivateAccess.symbols new file mode 100644 index 00000000000..23ae0b080e8 --- /dev/null +++ b/tests/baselines/reference/nestedModulePrivateAccess.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/nestedModulePrivateAccess.ts === +module a{ +>a : Symbol(a, Decl(nestedModulePrivateAccess.ts, 0, 0)) + + var x:number; +>x : Symbol(x, Decl(nestedModulePrivateAccess.ts, 1, 10)) + + module b{ +>b : Symbol(b, Decl(nestedModulePrivateAccess.ts, 1, 20)) + + var y = x; // should not be an error +>y : Symbol(y, Decl(nestedModulePrivateAccess.ts, 3, 18)) +>x : Symbol(x, Decl(nestedModulePrivateAccess.ts, 1, 10)) + } +} diff --git a/tests/baselines/reference/nestedModules.symbols b/tests/baselines/reference/nestedModules.symbols new file mode 100644 index 00000000000..7ff4efd30f6 --- /dev/null +++ b/tests/baselines/reference/nestedModules.symbols @@ -0,0 +1,82 @@ +=== tests/cases/conformance/internalModules/moduleDeclarations/nestedModules.ts === +module A.B.C { +>A : Symbol(A, Decl(nestedModules.ts, 0, 0), Decl(nestedModules.ts, 5, 1)) +>B : Symbol(B, Decl(nestedModules.ts, 0, 9), Decl(nestedModules.ts, 7, 10)) +>C : Symbol(C, Decl(nestedModules.ts, 0, 11)) + + export interface Point { +>Point : Symbol(Point, Decl(nestedModules.ts, 0, 14)) + + x: number; +>x : Symbol(x, Decl(nestedModules.ts, 1, 28)) + + y: number; +>y : Symbol(y, Decl(nestedModules.ts, 2, 18)) + } +} + +module A { +>A : Symbol(A, Decl(nestedModules.ts, 0, 0), Decl(nestedModules.ts, 5, 1)) + + export module B { +>B : Symbol(B, Decl(nestedModules.ts, 0, 9), Decl(nestedModules.ts, 7, 10)) + + var Point: C.Point = { x: 0, y: 0 }; // bug 832088: could not find module 'C' +>Point : Symbol(Point, Decl(nestedModules.ts, 9, 11)) +>C : Symbol(C, Decl(nestedModules.ts, 0, 11)) +>Point : Symbol(C.Point, Decl(nestedModules.ts, 0, 14)) +>x : Symbol(x, Decl(nestedModules.ts, 9, 30)) +>y : Symbol(y, Decl(nestedModules.ts, 9, 36)) + } +} + +module M2.X { +>M2 : Symbol(M2, Decl(nestedModules.ts, 11, 1), Decl(nestedModules.ts, 17, 1)) +>X : Symbol(X, Decl(nestedModules.ts, 13, 10), Decl(nestedModules.ts, 19, 11)) + + export interface Point { +>Point : Symbol(Point, Decl(nestedModules.ts, 13, 13), Decl(nestedModules.ts, 21, 18)) + + x: number; y: number; +>x : Symbol(x, Decl(nestedModules.ts, 14, 28)) +>y : Symbol(y, Decl(nestedModules.ts, 15, 18)) + } +} + +module M2 { +>M2 : Symbol(M2, Decl(nestedModules.ts, 11, 1), Decl(nestedModules.ts, 17, 1)) + + export module X { +>X : Symbol(X, Decl(nestedModules.ts, 13, 10), Decl(nestedModules.ts, 19, 11)) + + export var Point: number; +>Point : Symbol(Point, Decl(nestedModules.ts, 13, 13), Decl(nestedModules.ts, 21, 18)) + } +} + +var m = M2.X; +>m : Symbol(m, Decl(nestedModules.ts, 25, 3)) +>M2.X : Symbol(M2.X, Decl(nestedModules.ts, 13, 10), Decl(nestedModules.ts, 19, 11)) +>M2 : Symbol(M2, Decl(nestedModules.ts, 11, 1), Decl(nestedModules.ts, 17, 1)) +>X : Symbol(M2.X, Decl(nestedModules.ts, 13, 10), Decl(nestedModules.ts, 19, 11)) + +var point: number; +>point : Symbol(point, Decl(nestedModules.ts, 26, 3), Decl(nestedModules.ts, 27, 3)) + +var point = m.Point; +>point : Symbol(point, Decl(nestedModules.ts, 26, 3), Decl(nestedModules.ts, 27, 3)) +>m.Point : Symbol(M2.X.Point, Decl(nestedModules.ts, 13, 13), Decl(nestedModules.ts, 21, 18)) +>m : Symbol(m, Decl(nestedModules.ts, 25, 3)) +>Point : Symbol(M2.X.Point, Decl(nestedModules.ts, 13, 13), Decl(nestedModules.ts, 21, 18)) + +var p: { x: number; y: number; } +>p : Symbol(p, Decl(nestedModules.ts, 29, 3), Decl(nestedModules.ts, 30, 3)) +>x : Symbol(x, Decl(nestedModules.ts, 29, 8)) +>y : Symbol(y, Decl(nestedModules.ts, 29, 19)) + +var p: M2.X.Point; +>p : Symbol(p, Decl(nestedModules.ts, 29, 3), Decl(nestedModules.ts, 30, 3)) +>M2 : Symbol(M2, Decl(nestedModules.ts, 11, 1), Decl(nestedModules.ts, 17, 1)) +>X : Symbol(M2.X, Decl(nestedModules.ts, 13, 10), Decl(nestedModules.ts, 19, 11)) +>Point : Symbol(M2.X.Point, Decl(nestedModules.ts, 13, 13), Decl(nestedModules.ts, 21, 18)) + diff --git a/tests/baselines/reference/nestedModules.types b/tests/baselines/reference/nestedModules.types index 863e57ef859..eee3ee3968a 100644 --- a/tests/baselines/reference/nestedModules.types +++ b/tests/baselines/reference/nestedModules.types @@ -2,7 +2,7 @@ module A.B.C { >A : typeof A >B : typeof B ->C : unknown +>C : any export interface Point { >Point : Point @@ -23,11 +23,13 @@ module A { var Point: C.Point = { x: 0, y: 0 }; // bug 832088: could not find module 'C' >Point : C.Point ->C : unknown +>C : any >Point : C.Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } } @@ -77,7 +79,7 @@ var p: { x: number; y: number; } var p: M2.X.Point; >p : { x: number; y: number; } ->M2 : unknown ->X : unknown +>M2 : any +>X : any >Point : M2.X.Point diff --git a/tests/baselines/reference/nestedRecursiveLambda.symbols b/tests/baselines/reference/nestedRecursiveLambda.symbols new file mode 100644 index 00000000000..b91c1d84ebb --- /dev/null +++ b/tests/baselines/reference/nestedRecursiveLambda.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/nestedRecursiveLambda.ts === +function f(a:any) { +>f : Symbol(f, Decl(nestedRecursiveLambda.ts, 0, 0)) +>a : Symbol(a, Decl(nestedRecursiveLambda.ts, 0, 11)) + +void (r =>(r => r)); +>r : Symbol(r, Decl(nestedRecursiveLambda.ts, 1, 6)) +>r : Symbol(r, Decl(nestedRecursiveLambda.ts, 1, 11)) +>r : Symbol(r, Decl(nestedRecursiveLambda.ts, 1, 11)) +} +f((r =>(r => r))); +>f : Symbol(f, Decl(nestedRecursiveLambda.ts, 0, 0)) +>r : Symbol(r, Decl(nestedRecursiveLambda.ts, 3, 3)) +>r : Symbol(r, Decl(nestedRecursiveLambda.ts, 3, 8)) +>r : Symbol(r, Decl(nestedRecursiveLambda.ts, 3, 8)) + +void(r =>(r => r)); +>r : Symbol(r, Decl(nestedRecursiveLambda.ts, 4, 5)) +>r : Symbol(r, Decl(nestedRecursiveLambda.ts, 4, 10)) +>r : Symbol(r, Decl(nestedRecursiveLambda.ts, 4, 10)) + +[(r =>(r => r))] +>r : Symbol(r, Decl(nestedRecursiveLambda.ts, 5, 2)) +>r : Symbol(r, Decl(nestedRecursiveLambda.ts, 5, 7)) +>r : Symbol(r, Decl(nestedRecursiveLambda.ts, 5, 7)) + diff --git a/tests/baselines/reference/nestedSelf.symbols b/tests/baselines/reference/nestedSelf.symbols new file mode 100644 index 00000000000..08f41f155d6 --- /dev/null +++ b/tests/baselines/reference/nestedSelf.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/nestedSelf.ts === +module M { +>M : Symbol(M, Decl(nestedSelf.ts, 0, 0)) + + export class C { +>C : Symbol(C, Decl(nestedSelf.ts, 0, 10)) + + public n = 42; +>n : Symbol(n, Decl(nestedSelf.ts, 1, 17)) + + public foo() { [1,2,3].map((x) => { return this.n * x; })} +>foo : Symbol(foo, Decl(nestedSelf.ts, 2, 17)) +>[1,2,3].map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>x : Symbol(x, Decl(nestedSelf.ts, 3, 31)) +>this.n : Symbol(n, Decl(nestedSelf.ts, 1, 17)) +>this : Symbol(C, Decl(nestedSelf.ts, 0, 10)) +>n : Symbol(n, Decl(nestedSelf.ts, 1, 17)) +>x : Symbol(x, Decl(nestedSelf.ts, 3, 31)) + } +} + + diff --git a/tests/baselines/reference/nestedSelf.types b/tests/baselines/reference/nestedSelf.types index 56280bffb2f..2c8f3f41dd6 100644 --- a/tests/baselines/reference/nestedSelf.types +++ b/tests/baselines/reference/nestedSelf.types @@ -7,12 +7,16 @@ module M { public n = 42; >n : number +>42 : number public foo() { [1,2,3].map((x) => { return this.n * x; })} >foo : () => void >[1,2,3].map((x) => { return this.n * x; }) : number[] >[1,2,3].map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] >[1,2,3] : number[] +>1 : number +>2 : number +>3 : number >map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] >(x) => { return this.n * x; } : (x: number) => number >x : number diff --git a/tests/baselines/reference/newArrays.symbols b/tests/baselines/reference/newArrays.symbols new file mode 100644 index 00000000000..fd30b2fe25e --- /dev/null +++ b/tests/baselines/reference/newArrays.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/newArrays.ts === +module M { +>M : Symbol(M, Decl(newArrays.ts, 0, 0)) + + class Foo {} +>Foo : Symbol(Foo, Decl(newArrays.ts, 0, 10)) + + class Gar { +>Gar : Symbol(Gar, Decl(newArrays.ts, 1, 13)) + + public fa: Foo[]; +>fa : Symbol(fa, Decl(newArrays.ts, 2, 12)) +>Foo : Symbol(Foo, Decl(newArrays.ts, 0, 10)) + + public x = 10; +>x : Symbol(x, Decl(newArrays.ts, 3, 19)) + + public y = 10; +>y : Symbol(y, Decl(newArrays.ts, 4, 16)) + + public m () { +>m : Symbol(m, Decl(newArrays.ts, 5, 16)) + + this.fa = new Array(this.x * this.y); +>this.fa : Symbol(fa, Decl(newArrays.ts, 2, 12)) +>this : Symbol(Gar, Decl(newArrays.ts, 1, 13)) +>fa : Symbol(fa, Decl(newArrays.ts, 2, 12)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Foo : Symbol(Foo, Decl(newArrays.ts, 0, 10)) +>this.x : Symbol(x, Decl(newArrays.ts, 3, 19)) +>this : Symbol(Gar, Decl(newArrays.ts, 1, 13)) +>x : Symbol(x, Decl(newArrays.ts, 3, 19)) +>this.y : Symbol(y, Decl(newArrays.ts, 4, 16)) +>this : Symbol(Gar, Decl(newArrays.ts, 1, 13)) +>y : Symbol(y, Decl(newArrays.ts, 4, 16)) + } + } +} diff --git a/tests/baselines/reference/newArrays.types b/tests/baselines/reference/newArrays.types index 463525cb04c..4600f5efaf8 100644 --- a/tests/baselines/reference/newArrays.types +++ b/tests/baselines/reference/newArrays.types @@ -14,9 +14,11 @@ module M { public x = 10; >x : number +>10 : number public y = 10; >y : number +>10 : number public m () { >m : () => void diff --git a/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.symbols b/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.symbols new file mode 100644 index 00000000000..4c22ec94c85 --- /dev/null +++ b/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts === +interface I { +>I : Symbol(I, Decl(newExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 0)) +>T : Symbol(T, Decl(newExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 12)) + + new (u: U): U; +>U : Symbol(U, Decl(newExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 9)) +>T : Symbol(T, Decl(newExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 12)) +>u : Symbol(u, Decl(newExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 22)) +>U : Symbol(U, Decl(newExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 9)) +>U : Symbol(U, Decl(newExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 9)) +} +var i: I; +>i : Symbol(i, Decl(newExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 3, 3)) +>I : Symbol(I, Decl(newExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 0)) + +var y = new i(""); // y should be string +>y : Symbol(y, Decl(newExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 3)) +>i : Symbol(i, Decl(newExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 3, 3)) + diff --git a/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.types b/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.types index 8629c3cce0a..e07fa21fafe 100644 --- a/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.types +++ b/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.types @@ -18,4 +18,5 @@ var y = new i(""); // y should be string >y : string >new i("") : string >i : I +>"" : string diff --git a/tests/baselines/reference/newOperatorConformance.symbols b/tests/baselines/reference/newOperatorConformance.symbols new file mode 100644 index 00000000000..8467e1741fc --- /dev/null +++ b/tests/baselines/reference/newOperatorConformance.symbols @@ -0,0 +1,135 @@ +=== tests/cases/conformance/expressions/newOperator/newOperatorConformance.ts === + +class C0 { +>C0 : Symbol(C0, Decl(newOperatorConformance.ts, 0, 0)) + +} +class C1 { +>C1 : Symbol(C1, Decl(newOperatorConformance.ts, 3, 1)) + + constructor(n: number, s: string) { } +>n : Symbol(n, Decl(newOperatorConformance.ts, 5, 16)) +>s : Symbol(s, Decl(newOperatorConformance.ts, 5, 26)) +} + +class T { +>T : Symbol(T, Decl(newOperatorConformance.ts, 6, 1)) +>T : Symbol(T, Decl(newOperatorConformance.ts, 8, 8)) + + constructor(n?: T) { } +>n : Symbol(n, Decl(newOperatorConformance.ts, 9, 16)) +>T : Symbol(T, Decl(newOperatorConformance.ts, 8, 8)) +} + +var anyCtor: { +>anyCtor : Symbol(anyCtor, Decl(newOperatorConformance.ts, 12, 3)) + + new (): any; +}; + +var anyCtor1: { +>anyCtor1 : Symbol(anyCtor1, Decl(newOperatorConformance.ts, 16, 3)) + + new (n): any; +>n : Symbol(n, Decl(newOperatorConformance.ts, 17, 9)) + +}; + +interface nestedCtor { +>nestedCtor : Symbol(nestedCtor, Decl(newOperatorConformance.ts, 18, 2), Decl(newOperatorConformance.ts, 23, 3)) + + new (): nestedCtor; +>nestedCtor : Symbol(nestedCtor, Decl(newOperatorConformance.ts, 18, 2), Decl(newOperatorConformance.ts, 23, 3)) +} +var nestedCtor: nestedCtor; +>nestedCtor : Symbol(nestedCtor, Decl(newOperatorConformance.ts, 18, 2), Decl(newOperatorConformance.ts, 23, 3)) +>nestedCtor : Symbol(nestedCtor, Decl(newOperatorConformance.ts, 18, 2), Decl(newOperatorConformance.ts, 23, 3)) + +// Construct expression with no parentheses for construct signature with 0 parameters +var a = new C0; +>a : Symbol(a, Decl(newOperatorConformance.ts, 26, 3), Decl(newOperatorConformance.ts, 27, 3)) +>C0 : Symbol(C0, Decl(newOperatorConformance.ts, 0, 0)) + +var a: C0; +>a : Symbol(a, Decl(newOperatorConformance.ts, 26, 3), Decl(newOperatorConformance.ts, 27, 3)) +>C0 : Symbol(C0, Decl(newOperatorConformance.ts, 0, 0)) + + +// Generic construct expression with no parentheses +var c1 = new T; +>c1 : Symbol(c1, Decl(newOperatorConformance.ts, 31, 3), Decl(newOperatorConformance.ts, 32, 3)) +>T : Symbol(T, Decl(newOperatorConformance.ts, 6, 1)) + +var c1: T<{}>; +>c1 : Symbol(c1, Decl(newOperatorConformance.ts, 31, 3), Decl(newOperatorConformance.ts, 32, 3)) +>T : Symbol(T, Decl(newOperatorConformance.ts, 6, 1)) + +// Construct expression where constructor is of type 'any' with no parentheses +var d = new anyCtor; +>d : Symbol(d, Decl(newOperatorConformance.ts, 35, 3), Decl(newOperatorConformance.ts, 36, 3), Decl(newOperatorConformance.ts, 39, 3)) +>anyCtor : Symbol(anyCtor, Decl(newOperatorConformance.ts, 12, 3)) + +var d: any; +>d : Symbol(d, Decl(newOperatorConformance.ts, 35, 3), Decl(newOperatorConformance.ts, 36, 3), Decl(newOperatorConformance.ts, 39, 3)) + +// Construct expression where constructor is of type 'any' with > 1 arg +var d = new anyCtor1(undefined); +>d : Symbol(d, Decl(newOperatorConformance.ts, 35, 3), Decl(newOperatorConformance.ts, 36, 3), Decl(newOperatorConformance.ts, 39, 3)) +>anyCtor1 : Symbol(anyCtor1, Decl(newOperatorConformance.ts, 16, 3)) +>undefined : Symbol(undefined) + +// Construct expression of type where apparent type has a construct signature with 0 arguments +function newFn1(s: T) { +>newFn1 : Symbol(newFn1, Decl(newOperatorConformance.ts, 39, 32)) +>T : Symbol(T, Decl(newOperatorConformance.ts, 42, 16)) +>s : Symbol(s, Decl(newOperatorConformance.ts, 42, 46)) +>T : Symbol(T, Decl(newOperatorConformance.ts, 42, 16)) + + var p = new s; +>p : Symbol(p, Decl(newOperatorConformance.ts, 43, 7), Decl(newOperatorConformance.ts, 44, 7)) +>s : Symbol(s, Decl(newOperatorConformance.ts, 42, 46)) + + var p: number; +>p : Symbol(p, Decl(newOperatorConformance.ts, 43, 7), Decl(newOperatorConformance.ts, 44, 7)) +} + +// Construct expression of type where apparent type has a construct signature with 1 arguments +function newFn2(s: T) { +>newFn2 : Symbol(newFn2, Decl(newOperatorConformance.ts, 45, 1)) +>T : Symbol(T, Decl(newOperatorConformance.ts, 48, 16)) +>s : Symbol(s, Decl(newOperatorConformance.ts, 48, 33)) +>s : Symbol(s, Decl(newOperatorConformance.ts, 48, 54)) +>T : Symbol(T, Decl(newOperatorConformance.ts, 48, 16)) + + var p = new s(32); +>p : Symbol(p, Decl(newOperatorConformance.ts, 49, 7), Decl(newOperatorConformance.ts, 50, 7)) +>s : Symbol(s, Decl(newOperatorConformance.ts, 48, 54)) + + var p: string; +>p : Symbol(p, Decl(newOperatorConformance.ts, 49, 7), Decl(newOperatorConformance.ts, 50, 7)) +} + +// Construct expression of void returning function +function fnVoid(): void { } +>fnVoid : Symbol(fnVoid, Decl(newOperatorConformance.ts, 51, 1)) + +var t = new fnVoid(); +>t : Symbol(t, Decl(newOperatorConformance.ts, 55, 3), Decl(newOperatorConformance.ts, 56, 3)) +>fnVoid : Symbol(fnVoid, Decl(newOperatorConformance.ts, 51, 1)) + +var t: any; +>t : Symbol(t, Decl(newOperatorConformance.ts, 55, 3), Decl(newOperatorConformance.ts, 56, 3)) + +// Chained new expressions +var nested = new (new (new nestedCtor())())(); +>nested : Symbol(nested, Decl(newOperatorConformance.ts, 59, 3)) +>nestedCtor : Symbol(nestedCtor, Decl(newOperatorConformance.ts, 18, 2), Decl(newOperatorConformance.ts, 23, 3)) + +var n = new nested(); +>n : Symbol(n, Decl(newOperatorConformance.ts, 60, 3), Decl(newOperatorConformance.ts, 61, 3)) +>nested : Symbol(nested, Decl(newOperatorConformance.ts, 59, 3)) + +var n = new nested(); +>n : Symbol(n, Decl(newOperatorConformance.ts, 60, 3), Decl(newOperatorConformance.ts, 61, 3)) +>nested : Symbol(nested, Decl(newOperatorConformance.ts, 59, 3)) + diff --git a/tests/baselines/reference/newOperatorConformance.types b/tests/baselines/reference/newOperatorConformance.types index 37205bd6177..912c0a5c81a 100644 --- a/tests/baselines/reference/newOperatorConformance.types +++ b/tests/baselines/reference/newOperatorConformance.types @@ -110,6 +110,7 @@ function newFn2(s: T) { >p : string >new s(32) : string >s : T +>32 : number var p: string; >p : string diff --git a/tests/baselines/reference/noCatchBlock.symbols b/tests/baselines/reference/noCatchBlock.symbols new file mode 100644 index 00000000000..cf7689660a3 --- /dev/null +++ b/tests/baselines/reference/noCatchBlock.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/noCatchBlock.ts === + +No type information for this code.try { +No type information for this code. // ... +No type information for this code.} finally { +No type information for this code. // N.B. No 'catch' block +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/noCollisionThisExpressionAndClassInGlobal.symbols b/tests/baselines/reference/noCollisionThisExpressionAndClassInGlobal.symbols new file mode 100644 index 00000000000..e288a42fae0 --- /dev/null +++ b/tests/baselines/reference/noCollisionThisExpressionAndClassInGlobal.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/noCollisionThisExpressionAndClassInGlobal.ts === +class _this { +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndClassInGlobal.ts, 0, 0)) +} +var f = () => _this; +>f : Symbol(f, Decl(noCollisionThisExpressionAndClassInGlobal.ts, 2, 3)) +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndClassInGlobal.ts, 0, 0)) + diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.symbols b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.symbols new file mode 100644 index 00000000000..298e6f9acc1 --- /dev/null +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.symbols @@ -0,0 +1,44 @@ +=== tests/cases/compiler/noCollisionThisExpressionAndLocalVarInConstructor.ts === +class class1 { +>class1 : Symbol(class1, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 0, 0)) + + constructor() { + var x2 = { +>x2 : Symbol(x2, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 2, 11)) + + doStuff: (callback) => () => { +>doStuff : Symbol(doStuff, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 2, 18)) +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 3, 22)) + + var _this = 2; +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 4, 19)) + + return callback(_this); +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 3, 22)) +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 4, 19)) + } + } + } +} + +class class2 { +>class2 : Symbol(class2, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 9, 1)) + + constructor() { + var _this = 2; +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 13, 11)) + + var x2 = { +>x2 : Symbol(x2, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 14, 11)) + + doStuff: (callback) => () => { +>doStuff : Symbol(doStuff, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 14, 18)) +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 15, 22)) + + return callback(_this); +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 15, 22)) +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 13, 11)) + } + } + } +} diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.types b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.types index f9537974161..8c3cc633c10 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.types @@ -15,6 +15,7 @@ class class1 { var _this = 2; >_this : number +>2 : number return callback(_this); >callback(_this) : any @@ -31,6 +32,7 @@ class class2 { constructor() { var _this = 2; >_this : number +>2 : number var x2 = { >x2 : { doStuff: (callback: any) => () => any; } diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.symbols b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.symbols new file mode 100644 index 00000000000..09c99810fea --- /dev/null +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/noCollisionThisExpressionAndLocalVarInFunction.ts === +var console: { +>console : Symbol(console, Decl(noCollisionThisExpressionAndLocalVarInFunction.ts, 0, 3)) + + log(val: any); +>log : Symbol(log, Decl(noCollisionThisExpressionAndLocalVarInFunction.ts, 0, 14)) +>val : Symbol(val, Decl(noCollisionThisExpressionAndLocalVarInFunction.ts, 1, 8)) +} +function x() { +>x : Symbol(x, Decl(noCollisionThisExpressionAndLocalVarInFunction.ts, 2, 1)) + + var _this = 5; +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInFunction.ts, 4, 7)) + + x => { console.log(_this); }; +>x : Symbol(x, Decl(noCollisionThisExpressionAndLocalVarInFunction.ts, 4, 18)) +>console.log : Symbol(log, Decl(noCollisionThisExpressionAndLocalVarInFunction.ts, 0, 14)) +>console : Symbol(console, Decl(noCollisionThisExpressionAndLocalVarInFunction.ts, 0, 3)) +>log : Symbol(log, Decl(noCollisionThisExpressionAndLocalVarInFunction.ts, 0, 14)) +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInFunction.ts, 4, 7)) +} diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.types b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.types index 56f5701e912..3edf54a594f 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.types @@ -11,6 +11,7 @@ function x() { var _this = 5; >_this : number +>5 : number x => { console.log(_this); }; >x => { console.log(_this); } : (x: any) => void diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.symbols b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.symbols new file mode 100644 index 00000000000..45115b278ad --- /dev/null +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/noCollisionThisExpressionAndLocalVarInLambda.ts === +declare function alert(message?: any): void; +>alert : Symbol(alert, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 0, 0)) +>message : Symbol(message, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 0, 23)) + +var x = { +>x : Symbol(x, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 1, 3)) + + doStuff: (callback) => () => { +>doStuff : Symbol(doStuff, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 1, 9)) +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 2, 14)) + + var _this = 2; +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 3, 11)) + + return callback(_this); +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 2, 14)) +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 3, 11)) + } +} +alert(x.doStuff(x => alert(x))); +>alert : Symbol(alert, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 0, 0)) +>x.doStuff : Symbol(doStuff, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 1, 9)) +>x : Symbol(x, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 1, 3)) +>doStuff : Symbol(doStuff, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 1, 9)) +>x : Symbol(x, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 7, 16)) +>alert : Symbol(alert, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 0, 0)) +>x : Symbol(x, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 7, 16)) + diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.types b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.types index 6cf4428bcc5..83732f9c350 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.types @@ -15,6 +15,7 @@ var x = { var _this = 2; >_this : number +>2 : number return callback(_this); >callback(_this) : any diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.symbols b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.symbols new file mode 100644 index 00000000000..72e0d20a9b2 --- /dev/null +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.symbols @@ -0,0 +1,42 @@ +=== tests/cases/compiler/noCollisionThisExpressionAndLocalVarInMethod.ts === +var _this = 2; +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 0, 3)) + +class a { +>a : Symbol(a, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 0, 14)) + + method1() { +>method1 : Symbol(method1, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 1, 9)) + + return { + doStuff: (callback) => () => { +>doStuff : Symbol(doStuff, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 3, 16)) +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 4, 22)) + + var _this = 2; +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 5, 19)) + + return callback(_this); +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 4, 22)) +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 5, 19)) + } + } + } + method2() { +>method2 : Symbol(method2, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 9, 5)) + + var _this = 2; +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 11, 11)) + + return { + doStuff: (callback) => () => { +>doStuff : Symbol(doStuff, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 12, 16)) +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 13, 22)) + + return callback(_this); +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 13, 22)) +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 11, 11)) + } + } + } +} diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.types b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.types index cb543b33ad4..49d0e3ed93a 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.types @@ -1,6 +1,7 @@ === tests/cases/compiler/noCollisionThisExpressionAndLocalVarInMethod.ts === var _this = 2; >_this : number +>2 : number class a { >a : a @@ -19,6 +20,7 @@ class a { var _this = 2; >_this : number +>2 : number return callback(_this); >callback(_this) : any @@ -32,6 +34,7 @@ class a { var _this = 2; >_this : number +>2 : number return { >{ doStuff: (callback) => () => { return callback(_this); } } : { doStuff: (callback: any) => () => any; } diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.symbols b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.symbols new file mode 100644 index 00000000000..0dc4cf1d84e --- /dev/null +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.symbols @@ -0,0 +1,40 @@ +=== tests/cases/compiler/noCollisionThisExpressionAndLocalVarInProperty.ts === +class class1 { +>class1 : Symbol(class1, Decl(noCollisionThisExpressionAndLocalVarInProperty.ts, 0, 0)) + + public prop1 = { +>prop1 : Symbol(prop1, Decl(noCollisionThisExpressionAndLocalVarInProperty.ts, 0, 14)) + + doStuff: (callback) => () => { +>doStuff : Symbol(doStuff, Decl(noCollisionThisExpressionAndLocalVarInProperty.ts, 1, 20)) +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInProperty.ts, 2, 18)) + + var _this = 2; +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInProperty.ts, 3, 15)) + + return callback(_this); +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInProperty.ts, 2, 18)) +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInProperty.ts, 3, 15)) + } + } +} + +class class2 { +>class2 : Symbol(class2, Decl(noCollisionThisExpressionAndLocalVarInProperty.ts, 7, 1)) + + constructor() { + var _this = 2; +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInProperty.ts, 11, 11)) + } + public prop1 = { +>prop1 : Symbol(prop1, Decl(noCollisionThisExpressionAndLocalVarInProperty.ts, 12, 5)) + + doStuff: (callback) => () => { +>doStuff : Symbol(doStuff, Decl(noCollisionThisExpressionAndLocalVarInProperty.ts, 13, 20)) +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInProperty.ts, 14, 18)) + + return callback(10); +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInProperty.ts, 14, 18)) + } + } +} diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.types b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.types index df4ad5113f2..8918ccc825c 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.types @@ -14,6 +14,7 @@ class class1 { var _this = 2; >_this : number +>2 : number return callback(_this); >callback(_this) : any @@ -29,6 +30,7 @@ class class2 { constructor() { var _this = 2; >_this : number +>2 : number } public prop1 = { >prop1 : { doStuff: (callback: any) => () => any; } @@ -43,6 +45,7 @@ class class2 { return callback(10); >callback(10) : any >callback : any +>10 : number } } } diff --git a/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.symbols b/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.symbols new file mode 100644 index 00000000000..c3746cbcb8f --- /dev/null +++ b/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/noCollisionThisExpressionAndVarInGlobal.ts === +var _this = 1; +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndVarInGlobal.ts, 0, 3)) + +var f = () => _this; +>f : Symbol(f, Decl(noCollisionThisExpressionAndVarInGlobal.ts, 1, 3)) +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndVarInGlobal.ts, 0, 3)) + diff --git a/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.types b/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.types index 138062d58e5..c5943ef5c14 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.types @@ -1,6 +1,7 @@ === tests/cases/compiler/noCollisionThisExpressionAndVarInGlobal.ts === var _this = 1; >_this : number +>1 : number var f = () => _this; >f : () => number diff --git a/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.symbols b/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.symbols new file mode 100644 index 00000000000..b2f2adbbbb6 --- /dev/null +++ b/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/noCollisionThisExpressionInFunctionAndVarInGlobal.ts === +var console: { +>console : Symbol(console, Decl(noCollisionThisExpressionInFunctionAndVarInGlobal.ts, 0, 3)) + + log(val: any); +>log : Symbol(log, Decl(noCollisionThisExpressionInFunctionAndVarInGlobal.ts, 0, 14)) +>val : Symbol(val, Decl(noCollisionThisExpressionInFunctionAndVarInGlobal.ts, 1, 8)) +} +var _this = 5; +>_this : Symbol(_this, Decl(noCollisionThisExpressionInFunctionAndVarInGlobal.ts, 3, 3)) + +function x() { +>x : Symbol(x, Decl(noCollisionThisExpressionInFunctionAndVarInGlobal.ts, 3, 14)) + + x => { console.log(this); }; +>x : Symbol(x, Decl(noCollisionThisExpressionInFunctionAndVarInGlobal.ts, 4, 14)) +>console.log : Symbol(log, Decl(noCollisionThisExpressionInFunctionAndVarInGlobal.ts, 0, 14)) +>console : Symbol(console, Decl(noCollisionThisExpressionInFunctionAndVarInGlobal.ts, 0, 3)) +>log : Symbol(log, Decl(noCollisionThisExpressionInFunctionAndVarInGlobal.ts, 0, 14)) +} diff --git a/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.types b/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.types index 35a62c6f671..ba65e03ba59 100644 --- a/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.types +++ b/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.types @@ -8,6 +8,7 @@ var console: { } var _this = 5; >_this : number +>5 : number function x() { >x : () => void diff --git a/tests/baselines/reference/noConstraintInReturnType1.symbols b/tests/baselines/reference/noConstraintInReturnType1.symbols new file mode 100644 index 00000000000..86d9283ca37 --- /dev/null +++ b/tests/baselines/reference/noConstraintInReturnType1.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/noConstraintInReturnType1.ts === +class List { +>List : Symbol(List, Decl(noConstraintInReturnType1.ts, 0, 0)) +>T : Symbol(T, Decl(noConstraintInReturnType1.ts, 0, 11)) + + static empty(): List { return null; } +>empty : Symbol(List.empty, Decl(noConstraintInReturnType1.ts, 0, 26)) +>T : Symbol(T, Decl(noConstraintInReturnType1.ts, 1, 17)) +>List : Symbol(List, Decl(noConstraintInReturnType1.ts, 0, 0)) +>T : Symbol(T, Decl(noConstraintInReturnType1.ts, 1, 17)) +} + diff --git a/tests/baselines/reference/noConstraintInReturnType1.types b/tests/baselines/reference/noConstraintInReturnType1.types index 19a7529ac79..a4c754371eb 100644 --- a/tests/baselines/reference/noConstraintInReturnType1.types +++ b/tests/baselines/reference/noConstraintInReturnType1.types @@ -8,5 +8,6 @@ class List { >T : T >List : List >T : T +>null : null } diff --git a/tests/baselines/reference/noImplicitAnyAndPrivateMembersWithoutTypeAnnotations.symbols b/tests/baselines/reference/noImplicitAnyAndPrivateMembersWithoutTypeAnnotations.symbols new file mode 100644 index 00000000000..1673c50f69f --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyAndPrivateMembersWithoutTypeAnnotations.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/app.ts === +/// +var x = new Something(); +>x : Symbol(x, Decl(app.ts, 1, 3)) +>Something : Symbol(Something, Decl(test.d.ts, 0, 0)) + +=== tests/cases/compiler/test.d.ts === +declare class Something +>Something : Symbol(Something, Decl(test.d.ts, 0, 0)) +{ + private static someStaticVar; +>someStaticVar : Symbol(Something.someStaticVar, Decl(test.d.ts, 1, 1)) + + private someVar; +>someVar : Symbol(someVar, Decl(test.d.ts, 2, 33)) +} + diff --git a/tests/baselines/reference/noImplicitAnyFunctionExpressionAssignment.symbols b/tests/baselines/reference/noImplicitAnyFunctionExpressionAssignment.symbols new file mode 100644 index 00000000000..8e9a331a205 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyFunctionExpressionAssignment.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/noImplicitAnyFunctionExpressionAssignment.ts === + +var x: (a: any) => void = function (x: T) { +>x : Symbol(x, Decl(noImplicitAnyFunctionExpressionAssignment.ts, 1, 3)) +>a : Symbol(a, Decl(noImplicitAnyFunctionExpressionAssignment.ts, 1, 8)) +>T : Symbol(T, Decl(noImplicitAnyFunctionExpressionAssignment.ts, 1, 36)) +>x : Symbol(x, Decl(noImplicitAnyFunctionExpressionAssignment.ts, 1, 39)) +>T : Symbol(T, Decl(noImplicitAnyFunctionExpressionAssignment.ts, 1, 36)) + + return null; +}; + +var x2: (a: any) => void = function f(x: T) { +>x2 : Symbol(x2, Decl(noImplicitAnyFunctionExpressionAssignment.ts, 5, 3)) +>a : Symbol(a, Decl(noImplicitAnyFunctionExpressionAssignment.ts, 5, 9)) +>f : Symbol(f, Decl(noImplicitAnyFunctionExpressionAssignment.ts, 5, 26)) +>T : Symbol(T, Decl(noImplicitAnyFunctionExpressionAssignment.ts, 5, 38)) +>x : Symbol(x, Decl(noImplicitAnyFunctionExpressionAssignment.ts, 5, 41)) +>T : Symbol(T, Decl(noImplicitAnyFunctionExpressionAssignment.ts, 5, 38)) + + return null; +}; diff --git a/tests/baselines/reference/noImplicitAnyFunctionExpressionAssignment.types b/tests/baselines/reference/noImplicitAnyFunctionExpressionAssignment.types index b07252dac6d..9d8e216b656 100644 --- a/tests/baselines/reference/noImplicitAnyFunctionExpressionAssignment.types +++ b/tests/baselines/reference/noImplicitAnyFunctionExpressionAssignment.types @@ -9,6 +9,8 @@ var x: (a: any) => void = function (x: T) { >T : T return null; +>null : null + }; var x2: (a: any) => void = function f(x: T) { @@ -21,4 +23,6 @@ var x2: (a: any) => void = function f(x: T) { >T : T return null; +>null : null + }; diff --git a/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.symbols b/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.symbols new file mode 100644 index 00000000000..4bddb6a1f71 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/noImplicitAnyInContextuallyTypesFunctionParamter.ts === + +var regexMatchList = ['', '']; +>regexMatchList : Symbol(regexMatchList, Decl(noImplicitAnyInContextuallyTypesFunctionParamter.ts, 1, 3)) + +regexMatchList.forEach(match => ''.replace(match, '')); +>regexMatchList.forEach : Symbol(Array.forEach, Decl(lib.d.ts, 1108, 95)) +>regexMatchList : Symbol(regexMatchList, Decl(noImplicitAnyInContextuallyTypesFunctionParamter.ts, 1, 3)) +>forEach : Symbol(Array.forEach, Decl(lib.d.ts, 1108, 95)) +>match : Symbol(match, Decl(noImplicitAnyInContextuallyTypesFunctionParamter.ts, 2, 23)) +>''.replace : Symbol(String.replace, Decl(lib.d.ts, 329, 44), Decl(lib.d.ts, 336, 63), Decl(lib.d.ts, 343, 102), Decl(lib.d.ts, 350, 63)) +>replace : Symbol(String.replace, Decl(lib.d.ts, 329, 44), Decl(lib.d.ts, 336, 63), Decl(lib.d.ts, 343, 102), Decl(lib.d.ts, 350, 63)) +>match : Symbol(match, Decl(noImplicitAnyInContextuallyTypesFunctionParamter.ts, 2, 23)) + diff --git a/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.types b/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.types index 9ac1bcbbe8d..81fd614cb0e 100644 --- a/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.types +++ b/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.types @@ -3,6 +3,8 @@ var regexMatchList = ['', '']; >regexMatchList : string[] >['', ''] : string[] +>'' : string +>'' : string regexMatchList.forEach(match => ''.replace(match, '')); >regexMatchList.forEach(match => ''.replace(match, '')) : void @@ -13,6 +15,8 @@ regexMatchList.forEach(match => ''.replace(match, '')); >match : string >''.replace(match, '') : string >''.replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; } +>'' : string >replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; } >match : string +>'' : string diff --git a/tests/baselines/reference/noImplicitAnyIndexingSuppressed.symbols b/tests/baselines/reference/noImplicitAnyIndexingSuppressed.symbols new file mode 100644 index 00000000000..7c8f57795b4 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyIndexingSuppressed.symbols @@ -0,0 +1,101 @@ +=== tests/cases/compiler/noImplicitAnyIndexingSuppressed.ts === + +enum MyEmusEnum { +>MyEmusEnum : Symbol(MyEmusEnum, Decl(noImplicitAnyIndexingSuppressed.ts, 0, 0)) + + emu +>emu : Symbol(MyEmusEnum.emu, Decl(noImplicitAnyIndexingSuppressed.ts, 1, 17)) +} + +// Should be okay; should be a string. +var strRepresentation1 = MyEmusEnum[0] +>strRepresentation1 : Symbol(strRepresentation1, Decl(noImplicitAnyIndexingSuppressed.ts, 6, 3)) +>MyEmusEnum : Symbol(MyEmusEnum, Decl(noImplicitAnyIndexingSuppressed.ts, 0, 0)) + +// Should be okay; should be a string. +var strRepresentation2 = MyEmusEnum[MyEmusEnum.emu] +>strRepresentation2 : Symbol(strRepresentation2, Decl(noImplicitAnyIndexingSuppressed.ts, 9, 3)) +>MyEmusEnum : Symbol(MyEmusEnum, Decl(noImplicitAnyIndexingSuppressed.ts, 0, 0)) +>MyEmusEnum.emu : Symbol(MyEmusEnum.emu, Decl(noImplicitAnyIndexingSuppressed.ts, 1, 17)) +>MyEmusEnum : Symbol(MyEmusEnum, Decl(noImplicitAnyIndexingSuppressed.ts, 0, 0)) +>emu : Symbol(MyEmusEnum.emu, Decl(noImplicitAnyIndexingSuppressed.ts, 1, 17)) + +// Should be okay, as we suppress implicit 'any' property access checks +var strRepresentation3 = MyEmusEnum["monehh"]; +>strRepresentation3 : Symbol(strRepresentation3, Decl(noImplicitAnyIndexingSuppressed.ts, 12, 3)) +>MyEmusEnum : Symbol(MyEmusEnum, Decl(noImplicitAnyIndexingSuppressed.ts, 0, 0)) + +// Should be okay; should be a MyEmusEnum +var strRepresentation4 = MyEmusEnum["emu"]; +>strRepresentation4 : Symbol(strRepresentation4, Decl(noImplicitAnyIndexingSuppressed.ts, 15, 3)) +>MyEmusEnum : Symbol(MyEmusEnum, Decl(noImplicitAnyIndexingSuppressed.ts, 0, 0)) +>"emu" : Symbol(MyEmusEnum.emu, Decl(noImplicitAnyIndexingSuppressed.ts, 1, 17)) + + +// Should be okay, as we suppress implicit 'any' property access checks +var x = {}["hi"]; +>x : Symbol(x, Decl(noImplicitAnyIndexingSuppressed.ts, 19, 3)) + +// Should be okay, as we suppress implicit 'any' property access checks +var y = {}[10]; +>y : Symbol(y, Decl(noImplicitAnyIndexingSuppressed.ts, 22, 3)) + +var hi: any = "hi"; +>hi : Symbol(hi, Decl(noImplicitAnyIndexingSuppressed.ts, 24, 3)) + +var emptyObj = {}; +>emptyObj : Symbol(emptyObj, Decl(noImplicitAnyIndexingSuppressed.ts, 26, 3)) + +// Should be okay, as we suppress implicit 'any' property access checks +var z1 = emptyObj[hi]; +>z1 : Symbol(z1, Decl(noImplicitAnyIndexingSuppressed.ts, 29, 3)) +>emptyObj : Symbol(emptyObj, Decl(noImplicitAnyIndexingSuppressed.ts, 26, 3)) +>hi : Symbol(hi, Decl(noImplicitAnyIndexingSuppressed.ts, 24, 3)) + +var z2 = (emptyObj)[hi]; +>z2 : Symbol(z2, Decl(noImplicitAnyIndexingSuppressed.ts, 30, 3)) +>emptyObj : Symbol(emptyObj, Decl(noImplicitAnyIndexingSuppressed.ts, 26, 3)) +>hi : Symbol(hi, Decl(noImplicitAnyIndexingSuppressed.ts, 24, 3)) + +interface MyMap { +>MyMap : Symbol(MyMap, Decl(noImplicitAnyIndexingSuppressed.ts, 30, 29)) +>T : Symbol(T, Decl(noImplicitAnyIndexingSuppressed.ts, 32, 16)) + + [key: string]: T; +>key : Symbol(key, Decl(noImplicitAnyIndexingSuppressed.ts, 33, 5)) +>T : Symbol(T, Decl(noImplicitAnyIndexingSuppressed.ts, 32, 16)) +} + +var m: MyMap = { +>m : Symbol(m, Decl(noImplicitAnyIndexingSuppressed.ts, 36, 3)) +>MyMap : Symbol(MyMap, Decl(noImplicitAnyIndexingSuppressed.ts, 30, 29)) + + "0": 0, + "1": 1, + "2": 2, + "Okay that's enough for today.": NaN +>NaN : Symbol(NaN, Decl(lib.d.ts, 21, 11)) + +}; + +var mResult1 = m[MyEmusEnum.emu]; +>mResult1 : Symbol(mResult1, Decl(noImplicitAnyIndexingSuppressed.ts, 43, 3)) +>m : Symbol(m, Decl(noImplicitAnyIndexingSuppressed.ts, 36, 3)) +>MyEmusEnum.emu : Symbol(MyEmusEnum.emu, Decl(noImplicitAnyIndexingSuppressed.ts, 1, 17)) +>MyEmusEnum : Symbol(MyEmusEnum, Decl(noImplicitAnyIndexingSuppressed.ts, 0, 0)) +>emu : Symbol(MyEmusEnum.emu, Decl(noImplicitAnyIndexingSuppressed.ts, 1, 17)) + +var mResult2 = m[MyEmusEnum[MyEmusEnum.emu]]; +>mResult2 : Symbol(mResult2, Decl(noImplicitAnyIndexingSuppressed.ts, 44, 3)) +>m : Symbol(m, Decl(noImplicitAnyIndexingSuppressed.ts, 36, 3)) +>MyEmusEnum : Symbol(MyEmusEnum, Decl(noImplicitAnyIndexingSuppressed.ts, 0, 0)) +>MyEmusEnum.emu : Symbol(MyEmusEnum.emu, Decl(noImplicitAnyIndexingSuppressed.ts, 1, 17)) +>MyEmusEnum : Symbol(MyEmusEnum, Decl(noImplicitAnyIndexingSuppressed.ts, 0, 0)) +>emu : Symbol(MyEmusEnum.emu, Decl(noImplicitAnyIndexingSuppressed.ts, 1, 17)) + +var mResult3 = m[hi]; +>mResult3 : Symbol(mResult3, Decl(noImplicitAnyIndexingSuppressed.ts, 45, 3)) +>m : Symbol(m, Decl(noImplicitAnyIndexingSuppressed.ts, 36, 3)) +>hi : Symbol(hi, Decl(noImplicitAnyIndexingSuppressed.ts, 24, 3)) + + diff --git a/tests/baselines/reference/noImplicitAnyIndexingSuppressed.types b/tests/baselines/reference/noImplicitAnyIndexingSuppressed.types index 20be75dc29e..b7b21bf8f92 100644 --- a/tests/baselines/reference/noImplicitAnyIndexingSuppressed.types +++ b/tests/baselines/reference/noImplicitAnyIndexingSuppressed.types @@ -12,6 +12,7 @@ var strRepresentation1 = MyEmusEnum[0] >strRepresentation1 : string >MyEmusEnum[0] : string >MyEmusEnum : typeof MyEmusEnum +>0 : number // Should be okay; should be a string. var strRepresentation2 = MyEmusEnum[MyEmusEnum.emu] @@ -27,12 +28,14 @@ var strRepresentation3 = MyEmusEnum["monehh"]; >strRepresentation3 : any >MyEmusEnum["monehh"] : any >MyEmusEnum : typeof MyEmusEnum +>"monehh" : string // Should be okay; should be a MyEmusEnum var strRepresentation4 = MyEmusEnum["emu"]; >strRepresentation4 : MyEmusEnum >MyEmusEnum["emu"] : MyEmusEnum >MyEmusEnum : typeof MyEmusEnum +>"emu" : string // Should be okay, as we suppress implicit 'any' property access checks @@ -40,15 +43,18 @@ var x = {}["hi"]; >x : any >{}["hi"] : any >{} : {} +>"hi" : string // Should be okay, as we suppress implicit 'any' property access checks var y = {}[10]; >y : any >{}[10] : any >{} : {} +>10 : number var hi: any = "hi"; >hi : any +>"hi" : string var emptyObj = {}; >emptyObj : {} @@ -84,8 +90,14 @@ var m: MyMap = { >{ "0": 0, "1": 1, "2": 2, "Okay that's enough for today.": NaN} : { [x: string]: number; "0": number; "1": number; "2": number; "Okay that's enough for today.": number; } "0": 0, +>0 : number + "1": 1, +>1 : number + "2": 2, +>2 : number + "Okay that's enough for today.": NaN >NaN : number diff --git a/tests/baselines/reference/noSelfOnVars.symbols b/tests/baselines/reference/noSelfOnVars.symbols new file mode 100644 index 00000000000..dd01736436a --- /dev/null +++ b/tests/baselines/reference/noSelfOnVars.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/noSelfOnVars.ts === +function foo() { +>foo : Symbol(foo, Decl(noSelfOnVars.ts, 0, 0)) + + function bar() { } +>bar : Symbol(bar, Decl(noSelfOnVars.ts, 0, 16)) + + var x = bar; +>x : Symbol(x, Decl(noSelfOnVars.ts, 2, 7)) +>bar : Symbol(bar, Decl(noSelfOnVars.ts, 0, 16)) +} + + + diff --git a/tests/baselines/reference/nominalSubtypeCheckOfTypeParameter.symbols b/tests/baselines/reference/nominalSubtypeCheckOfTypeParameter.symbols new file mode 100644 index 00000000000..f25acc772a6 --- /dev/null +++ b/tests/baselines/reference/nominalSubtypeCheckOfTypeParameter.symbols @@ -0,0 +1,61 @@ +=== tests/cases/conformance/types/typeRelationships/recursiveTypes/nominalSubtypeCheckOfTypeParameter.ts === +interface Tuple { +>Tuple : Symbol(Tuple, Decl(nominalSubtypeCheckOfTypeParameter.ts, 0, 0)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter.ts, 0, 16)) +>S : Symbol(S, Decl(nominalSubtypeCheckOfTypeParameter.ts, 0, 18)) + + first: T +>first : Symbol(first, Decl(nominalSubtypeCheckOfTypeParameter.ts, 0, 23)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter.ts, 0, 16)) + + second: S +>second : Symbol(second, Decl(nominalSubtypeCheckOfTypeParameter.ts, 1, 12)) +>S : Symbol(S, Decl(nominalSubtypeCheckOfTypeParameter.ts, 0, 18)) +} + +interface Sequence { +>Sequence : Symbol(Sequence, Decl(nominalSubtypeCheckOfTypeParameter.ts, 3, 1)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter.ts, 5, 19)) + + hasNext(): boolean +>hasNext : Symbol(hasNext, Decl(nominalSubtypeCheckOfTypeParameter.ts, 5, 23)) + + pop(): T +>pop : Symbol(pop, Decl(nominalSubtypeCheckOfTypeParameter.ts, 6, 22)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter.ts, 5, 19)) + + zip(seq: Sequence): Sequence> +>zip : Symbol(zip, Decl(nominalSubtypeCheckOfTypeParameter.ts, 7, 14)) +>S : Symbol(S, Decl(nominalSubtypeCheckOfTypeParameter.ts, 8, 10)) +>seq : Symbol(seq, Decl(nominalSubtypeCheckOfTypeParameter.ts, 8, 13)) +>Sequence : Symbol(Sequence, Decl(nominalSubtypeCheckOfTypeParameter.ts, 3, 1)) +>S : Symbol(S, Decl(nominalSubtypeCheckOfTypeParameter.ts, 8, 10)) +>Sequence : Symbol(Sequence, Decl(nominalSubtypeCheckOfTypeParameter.ts, 3, 1)) +>Tuple : Symbol(Tuple, Decl(nominalSubtypeCheckOfTypeParameter.ts, 0, 0)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter.ts, 5, 19)) +>S : Symbol(S, Decl(nominalSubtypeCheckOfTypeParameter.ts, 8, 10)) +} + +// error, despite the fact that the code explicitly says List extends Sequence, the current rules for infinitely expanding type references +// perform nominal subtyping checks that allow variance for type arguments, but not nominal subtyping for the generic type itself +interface List extends Sequence { +>List : Symbol(List, Decl(nominalSubtypeCheckOfTypeParameter.ts, 9, 1)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter.ts, 13, 15)) +>Sequence : Symbol(Sequence, Decl(nominalSubtypeCheckOfTypeParameter.ts, 3, 1)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter.ts, 13, 15)) + + getLength(): number +>getLength : Symbol(getLength, Decl(nominalSubtypeCheckOfTypeParameter.ts, 13, 39)) + + zip(seq: Sequence): List> +>zip : Symbol(zip, Decl(nominalSubtypeCheckOfTypeParameter.ts, 14, 23)) +>S : Symbol(S, Decl(nominalSubtypeCheckOfTypeParameter.ts, 15, 10)) +>seq : Symbol(seq, Decl(nominalSubtypeCheckOfTypeParameter.ts, 15, 13)) +>Sequence : Symbol(Sequence, Decl(nominalSubtypeCheckOfTypeParameter.ts, 3, 1)) +>S : Symbol(S, Decl(nominalSubtypeCheckOfTypeParameter.ts, 15, 10)) +>List : Symbol(List, Decl(nominalSubtypeCheckOfTypeParameter.ts, 9, 1)) +>Tuple : Symbol(Tuple, Decl(nominalSubtypeCheckOfTypeParameter.ts, 0, 0)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter.ts, 13, 15)) +>S : Symbol(S, Decl(nominalSubtypeCheckOfTypeParameter.ts, 15, 10)) +} + diff --git a/tests/baselines/reference/nominalSubtypeCheckOfTypeParameter2.symbols b/tests/baselines/reference/nominalSubtypeCheckOfTypeParameter2.symbols new file mode 100644 index 00000000000..3249c465a98 --- /dev/null +++ b/tests/baselines/reference/nominalSubtypeCheckOfTypeParameter2.symbols @@ -0,0 +1,55 @@ +=== tests/cases/conformance/types/typeRelationships/recursiveTypes/nominalSubtypeCheckOfTypeParameter2.ts === +interface B { +>B : Symbol(B, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 0, 0)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 0, 12)) + + bar: T; +>bar : Symbol(bar, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 0, 16)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 0, 12)) +} + +// ok +interface A extends B { +>A : Symbol(A, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 2, 1)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 5, 12)) +>B : Symbol(B, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 0, 0)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 5, 12)) + + foo: T; +>foo : Symbol(foo, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 5, 29)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 5, 12)) +} + +// ok +interface A2 extends B> { +>A2 : Symbol(A2, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 7, 1)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 10, 13)) +>B : Symbol(B, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 0, 0)) +>B : Symbol(B, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 0, 0)) + + baz: T; +>baz : Symbol(baz, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 10, 38)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 10, 13)) +} + +interface C { +>C : Symbol(C, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 12, 1)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 14, 12)) + + bam: T; +>bam : Symbol(bam, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 14, 16)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 14, 12)) +} + +// ok +interface A3 extends B> { +>A3 : Symbol(A3, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 16, 1)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 19, 13)) +>B : Symbol(B, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 0, 0)) +>C : Symbol(C, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 12, 1)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 19, 13)) + + bing: T; +>bing : Symbol(bing, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 19, 33)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 19, 13)) +} diff --git a/tests/baselines/reference/nonConflictingRecursiveBaseTypeMembers.symbols b/tests/baselines/reference/nonConflictingRecursiveBaseTypeMembers.symbols new file mode 100644 index 00000000000..f3ff334931c --- /dev/null +++ b/tests/baselines/reference/nonConflictingRecursiveBaseTypeMembers.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/nonConflictingRecursiveBaseTypeMembers.ts === +interface A { +>A : Symbol(A, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 0, 0)) +>T : Symbol(T, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 0, 12)) + + x: C +>x : Symbol(x, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 0, 16)) +>C : Symbol(C, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 6, 1)) +>T : Symbol(T, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 0, 12)) +} + +interface B { +>B : Symbol(B, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 2, 1)) +>T : Symbol(T, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 4, 12)) + + x: C +>x : Symbol(x, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 4, 16)) +>C : Symbol(C, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 6, 1)) +>T : Symbol(T, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 4, 12)) +} + +interface C extends A, B { } // Should not be an error +>C : Symbol(C, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 6, 1)) +>T : Symbol(T, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 8, 12)) +>A : Symbol(A, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 0, 0)) +>T : Symbol(T, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 8, 12)) +>B : Symbol(B, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 2, 1)) +>T : Symbol(T, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 8, 12)) + diff --git a/tests/baselines/reference/nonContextuallyTypedLogicalOr.symbols b/tests/baselines/reference/nonContextuallyTypedLogicalOr.symbols new file mode 100644 index 00000000000..738f4fed916 --- /dev/null +++ b/tests/baselines/reference/nonContextuallyTypedLogicalOr.symbols @@ -0,0 +1,35 @@ +=== tests/cases/compiler/nonContextuallyTypedLogicalOr.ts === +interface Contextual { +>Contextual : Symbol(Contextual, Decl(nonContextuallyTypedLogicalOr.ts, 0, 0)) + + dummy; +>dummy : Symbol(dummy, Decl(nonContextuallyTypedLogicalOr.ts, 0, 22)) + + p?: number; +>p : Symbol(p, Decl(nonContextuallyTypedLogicalOr.ts, 1, 10)) +} + +interface Ellement { +>Ellement : Symbol(Ellement, Decl(nonContextuallyTypedLogicalOr.ts, 3, 1)) + + dummy; +>dummy : Symbol(dummy, Decl(nonContextuallyTypedLogicalOr.ts, 5, 20)) + + p: any; +>p : Symbol(p, Decl(nonContextuallyTypedLogicalOr.ts, 6, 10)) +} + +var c: Contextual; +>c : Symbol(c, Decl(nonContextuallyTypedLogicalOr.ts, 10, 3)) +>Contextual : Symbol(Contextual, Decl(nonContextuallyTypedLogicalOr.ts, 0, 0)) + +var e: Ellement; +>e : Symbol(e, Decl(nonContextuallyTypedLogicalOr.ts, 11, 3)) +>Ellement : Symbol(Ellement, Decl(nonContextuallyTypedLogicalOr.ts, 3, 1)) + +(c || e).dummy; +>(c || e).dummy : Symbol(dummy, Decl(nonContextuallyTypedLogicalOr.ts, 0, 22), Decl(nonContextuallyTypedLogicalOr.ts, 5, 20)) +>c : Symbol(c, Decl(nonContextuallyTypedLogicalOr.ts, 10, 3)) +>e : Symbol(e, Decl(nonContextuallyTypedLogicalOr.ts, 11, 3)) +>dummy : Symbol(dummy, Decl(nonContextuallyTypedLogicalOr.ts, 0, 22), Decl(nonContextuallyTypedLogicalOr.ts, 5, 20)) + diff --git a/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.symbols b/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.symbols new file mode 100644 index 00000000000..47daa69239a --- /dev/null +++ b/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/nonGenericClassExtendingGenericClassWithAny.ts === +class Foo { +>Foo : Symbol(Foo, Decl(nonGenericClassExtendingGenericClassWithAny.ts, 0, 0)) +>T : Symbol(T, Decl(nonGenericClassExtendingGenericClassWithAny.ts, 0, 10)) + + t: T; +>t : Symbol(t, Decl(nonGenericClassExtendingGenericClassWithAny.ts, 0, 14)) +>T : Symbol(T, Decl(nonGenericClassExtendingGenericClassWithAny.ts, 0, 10)) +} + +class Bar extends Foo { } // Valid +>Bar : Symbol(Bar, Decl(nonGenericClassExtendingGenericClassWithAny.ts, 2, 1)) +>Foo : Symbol(Foo, Decl(nonGenericClassExtendingGenericClassWithAny.ts, 0, 0)) + diff --git a/tests/baselines/reference/nonInstantiatedModule.symbols b/tests/baselines/reference/nonInstantiatedModule.symbols new file mode 100644 index 00000000000..0d67b0318f8 --- /dev/null +++ b/tests/baselines/reference/nonInstantiatedModule.symbols @@ -0,0 +1,111 @@ +=== tests/cases/conformance/internalModules/moduleDeclarations/nonInstantiatedModule.ts === +module M { +>M : Symbol(M, Decl(nonInstantiatedModule.ts, 0, 0)) + + export interface Point { x: number; y: number } +>Point : Symbol(Point, Decl(nonInstantiatedModule.ts, 0, 10)) +>x : Symbol(x, Decl(nonInstantiatedModule.ts, 1, 28)) +>y : Symbol(y, Decl(nonInstantiatedModule.ts, 1, 39)) + + export var a = 1; +>a : Symbol(a, Decl(nonInstantiatedModule.ts, 2, 14)) +} + +// primary expression +var m : typeof M; +>m : Symbol(m, Decl(nonInstantiatedModule.ts, 6, 3), Decl(nonInstantiatedModule.ts, 7, 3)) +>M : Symbol(M, Decl(nonInstantiatedModule.ts, 0, 0)) + +var m = M; +>m : Symbol(m, Decl(nonInstantiatedModule.ts, 6, 3), Decl(nonInstantiatedModule.ts, 7, 3)) +>M : Symbol(M, Decl(nonInstantiatedModule.ts, 0, 0)) + +var a1: number; +>a1 : Symbol(a1, Decl(nonInstantiatedModule.ts, 9, 3), Decl(nonInstantiatedModule.ts, 10, 3)) + +var a1 = M.a; +>a1 : Symbol(a1, Decl(nonInstantiatedModule.ts, 9, 3), Decl(nonInstantiatedModule.ts, 10, 3)) +>M.a : Symbol(M.a, Decl(nonInstantiatedModule.ts, 2, 14)) +>M : Symbol(M, Decl(nonInstantiatedModule.ts, 0, 0)) +>a : Symbol(M.a, Decl(nonInstantiatedModule.ts, 2, 14)) + +var a2: number; +>a2 : Symbol(a2, Decl(nonInstantiatedModule.ts, 12, 3), Decl(nonInstantiatedModule.ts, 13, 3)) + +var a2 = m.a; +>a2 : Symbol(a2, Decl(nonInstantiatedModule.ts, 12, 3), Decl(nonInstantiatedModule.ts, 13, 3)) +>m.a : Symbol(M.a, Decl(nonInstantiatedModule.ts, 2, 14)) +>m : Symbol(m, Decl(nonInstantiatedModule.ts, 6, 3), Decl(nonInstantiatedModule.ts, 7, 3)) +>a : Symbol(M.a, Decl(nonInstantiatedModule.ts, 2, 14)) + +module M2 { +>M2 : Symbol(M2, Decl(nonInstantiatedModule.ts, 13, 13)) + + export module Point { +>Point : Symbol(Point, Decl(nonInstantiatedModule.ts, 15, 11), Decl(nonInstantiatedModule.ts, 20, 5)) + + export function Origin(): Point { +>Origin : Symbol(Origin, Decl(nonInstantiatedModule.ts, 16, 25)) +>Point : Symbol(Point, Decl(nonInstantiatedModule.ts, 15, 11), Decl(nonInstantiatedModule.ts, 20, 5)) + + return { x: 0, y: 0 }; +>x : Symbol(x, Decl(nonInstantiatedModule.ts, 18, 20)) +>y : Symbol(y, Decl(nonInstantiatedModule.ts, 18, 26)) + } + } + + export interface Point { +>Point : Symbol(Point, Decl(nonInstantiatedModule.ts, 15, 11), Decl(nonInstantiatedModule.ts, 20, 5)) + + x: number; +>x : Symbol(x, Decl(nonInstantiatedModule.ts, 22, 28)) + + y: number; +>y : Symbol(y, Decl(nonInstantiatedModule.ts, 23, 18)) + } +} + +var p: { x: number; y: number; }; +>p : Symbol(p, Decl(nonInstantiatedModule.ts, 28, 3), Decl(nonInstantiatedModule.ts, 29, 3)) +>x : Symbol(x, Decl(nonInstantiatedModule.ts, 28, 8)) +>y : Symbol(y, Decl(nonInstantiatedModule.ts, 28, 19)) + +var p: M2.Point; +>p : Symbol(p, Decl(nonInstantiatedModule.ts, 28, 3), Decl(nonInstantiatedModule.ts, 29, 3)) +>M2 : Symbol(M2, Decl(nonInstantiatedModule.ts, 13, 13)) +>Point : Symbol(M2.Point, Decl(nonInstantiatedModule.ts, 15, 11), Decl(nonInstantiatedModule.ts, 20, 5)) + +var p2: { Origin() : { x: number; y: number; } }; +>p2 : Symbol(p2, Decl(nonInstantiatedModule.ts, 31, 3), Decl(nonInstantiatedModule.ts, 32, 3)) +>Origin : Symbol(Origin, Decl(nonInstantiatedModule.ts, 31, 9)) +>x : Symbol(x, Decl(nonInstantiatedModule.ts, 31, 22)) +>y : Symbol(y, Decl(nonInstantiatedModule.ts, 31, 33)) + +var p2: typeof M2.Point; +>p2 : Symbol(p2, Decl(nonInstantiatedModule.ts, 31, 3), Decl(nonInstantiatedModule.ts, 32, 3)) +>M2.Point : Symbol(M2.Point, Decl(nonInstantiatedModule.ts, 15, 11), Decl(nonInstantiatedModule.ts, 20, 5)) +>M2 : Symbol(M2, Decl(nonInstantiatedModule.ts, 13, 13)) +>Point : Symbol(M2.Point, Decl(nonInstantiatedModule.ts, 15, 11), Decl(nonInstantiatedModule.ts, 20, 5)) + +module M3 { +>M3 : Symbol(M3, Decl(nonInstantiatedModule.ts, 32, 24)) + + export module Utils { +>Utils : Symbol(Utils, Decl(nonInstantiatedModule.ts, 34, 11), Decl(nonInstantiatedModule.ts, 39, 5)) + + export interface Point { +>Point : Symbol(Point, Decl(nonInstantiatedModule.ts, 35, 25)) + + x: number; y: number; +>x : Symbol(x, Decl(nonInstantiatedModule.ts, 36, 32)) +>y : Symbol(y, Decl(nonInstantiatedModule.ts, 37, 22)) + } + } + + export class Utils { +>Utils : Symbol(Utils, Decl(nonInstantiatedModule.ts, 34, 11), Decl(nonInstantiatedModule.ts, 39, 5)) + + name: string; +>name : Symbol(name, Decl(nonInstantiatedModule.ts, 41, 24)) + } +} diff --git a/tests/baselines/reference/nonInstantiatedModule.types b/tests/baselines/reference/nonInstantiatedModule.types index 1093fbd0653..c1aac2824dc 100644 --- a/tests/baselines/reference/nonInstantiatedModule.types +++ b/tests/baselines/reference/nonInstantiatedModule.types @@ -9,6 +9,7 @@ module M { export var a = 1; >a : number +>1 : number } // primary expression @@ -51,7 +52,9 @@ module M2 { return { x: 0, y: 0 }; >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } } @@ -73,7 +76,7 @@ var p: { x: number; y: number; }; var p: M2.Point; >p : { x: number; y: number; } ->M2 : unknown +>M2 : any >Point : M2.Point var p2: { Origin() : { x: number; y: number; } }; @@ -84,6 +87,7 @@ var p2: { Origin() : { x: number; y: number; } }; var p2: typeof M2.Point; >p2 : { Origin(): { x: number; y: number; }; } +>M2.Point : typeof M2.Point >M2 : typeof M2 >Point : typeof M2.Point diff --git a/tests/baselines/reference/nonIterableRestElement1.js b/tests/baselines/reference/nonIterableRestElement1.js new file mode 100644 index 00000000000..6852ad503cf --- /dev/null +++ b/tests/baselines/reference/nonIterableRestElement1.js @@ -0,0 +1,7 @@ +//// [nonIterableRestElement1.ts] +var c = {}; +[...c] = ["", 0]; + +//// [nonIterableRestElement1.js] +var c = {}; +c = ["", 0].slice(0); diff --git a/tests/baselines/reference/nonIterableRestElement1.symbols b/tests/baselines/reference/nonIterableRestElement1.symbols new file mode 100644 index 00000000000..352d0c87da4 --- /dev/null +++ b/tests/baselines/reference/nonIterableRestElement1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/destructuring/nonIterableRestElement1.ts === +var c = {}; +>c : Symbol(c, Decl(nonIterableRestElement1.ts, 0, 3)) + +[...c] = ["", 0]; +>c : Symbol(c, Decl(nonIterableRestElement1.ts, 0, 3)) + diff --git a/tests/baselines/reference/nonIterableRestElement1.types b/tests/baselines/reference/nonIterableRestElement1.types new file mode 100644 index 00000000000..4973b67d4ae --- /dev/null +++ b/tests/baselines/reference/nonIterableRestElement1.types @@ -0,0 +1,14 @@ +=== tests/cases/conformance/es6/destructuring/nonIterableRestElement1.ts === +var c = {}; +>c : {} +>{} : {} + +[...c] = ["", 0]; +>[...c] = ["", 0] : (string | number)[] +>[...c] : {}[] +>...c : any +>c : {} +>["", 0] : (string | number)[] +>"" : string +>0 : number + diff --git a/tests/baselines/reference/nonIterableRestElement2.js b/tests/baselines/reference/nonIterableRestElement2.js new file mode 100644 index 00000000000..edeef32e188 --- /dev/null +++ b/tests/baselines/reference/nonIterableRestElement2.js @@ -0,0 +1,7 @@ +//// [nonIterableRestElement2.ts] +var c = {}; +[...c] = ["", 0]; + +//// [nonIterableRestElement2.js] +var c = {}; +[...c] = ["", 0]; diff --git a/tests/baselines/reference/nonIterableRestElement2.symbols b/tests/baselines/reference/nonIterableRestElement2.symbols new file mode 100644 index 00000000000..766524a408b --- /dev/null +++ b/tests/baselines/reference/nonIterableRestElement2.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/destructuring/nonIterableRestElement2.ts === +var c = {}; +>c : Symbol(c, Decl(nonIterableRestElement2.ts, 0, 3)) + +[...c] = ["", 0]; +>c : Symbol(c, Decl(nonIterableRestElement2.ts, 0, 3)) + diff --git a/tests/baselines/reference/nonIterableRestElement2.types b/tests/baselines/reference/nonIterableRestElement2.types new file mode 100644 index 00000000000..e6d84d5297e --- /dev/null +++ b/tests/baselines/reference/nonIterableRestElement2.types @@ -0,0 +1,14 @@ +=== tests/cases/conformance/es6/destructuring/nonIterableRestElement2.ts === +var c = {}; +>c : {} +>{} : {} + +[...c] = ["", 0]; +>[...c] = ["", 0] : (string | number)[] +>[...c] : {}[] +>...c : any +>c : {} +>["", 0] : (string | number)[] +>"" : string +>0 : number + diff --git a/tests/baselines/reference/nonIterableRestElement3.errors.txt b/tests/baselines/reference/nonIterableRestElement3.errors.txt new file mode 100644 index 00000000000..2c44aba661e --- /dev/null +++ b/tests/baselines/reference/nonIterableRestElement3.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/destructuring/nonIterableRestElement3.ts(2,5): error TS2322: Type '(string | number)[]' is not assignable to type '{ bogus: number; }'. + Property 'bogus' is missing in type '(string | number)[]'. + + +==== tests/cases/conformance/es6/destructuring/nonIterableRestElement3.ts (1 errors) ==== + var c = { bogus: 0 }; + [...c] = ["", 0]; + ~ +!!! error TS2322: Type '(string | number)[]' is not assignable to type '{ bogus: number; }'. +!!! error TS2322: Property 'bogus' is missing in type '(string | number)[]'. \ No newline at end of file diff --git a/tests/baselines/reference/nonIterableRestElement3.js b/tests/baselines/reference/nonIterableRestElement3.js new file mode 100644 index 00000000000..0f7edfe98f4 --- /dev/null +++ b/tests/baselines/reference/nonIterableRestElement3.js @@ -0,0 +1,7 @@ +//// [nonIterableRestElement3.ts] +var c = { bogus: 0 }; +[...c] = ["", 0]; + +//// [nonIterableRestElement3.js] +var c = { bogus: 0 }; +c = ["", 0].slice(0); diff --git a/tests/baselines/reference/null.symbols b/tests/baselines/reference/null.symbols new file mode 100644 index 00000000000..148cd1586b2 --- /dev/null +++ b/tests/baselines/reference/null.symbols @@ -0,0 +1,44 @@ +=== tests/cases/compiler/null.ts === +var x=null; +>x : Symbol(x, Decl(null.ts, 0, 3)) + +var y=3+x; +>y : Symbol(y, Decl(null.ts, 1, 3)) +>x : Symbol(x, Decl(null.ts, 0, 3)) + +var z=3+null; +>z : Symbol(z, Decl(null.ts, 2, 3)) + +class C { +>C : Symbol(C, Decl(null.ts, 2, 13)) +} +function f() { +>f : Symbol(f, Decl(null.ts, 4, 1)) + + return null; + return new C(); +>C : Symbol(C, Decl(null.ts, 2, 13)) +} +function g() { +>g : Symbol(g, Decl(null.ts, 8, 1)) + + return null; + return 3; +} +interface I { +>I : Symbol(I, Decl(null.ts, 12, 1)) + + x:any; +>x : Symbol(x, Decl(null.ts, 13, 13)) + + y:number; +>y : Symbol(y, Decl(null.ts, 14, 10)) +} +var w:I={x:null,y:3}; +>w : Symbol(w, Decl(null.ts, 17, 3)) +>I : Symbol(I, Decl(null.ts, 12, 1)) +>x : Symbol(x, Decl(null.ts, 17, 9)) +>y : Symbol(y, Decl(null.ts, 17, 16)) + + + diff --git a/tests/baselines/reference/null.types b/tests/baselines/reference/null.types index 7a5232efb0b..7df551b1bde 100644 --- a/tests/baselines/reference/null.types +++ b/tests/baselines/reference/null.types @@ -1,15 +1,19 @@ === tests/cases/compiler/null.ts === var x=null; >x : any +>null : null var y=3+x; >y : any >3+x : any +>3 : number >x : any var z=3+null; >z : number >3+null : number +>3 : number +>null : null class C { >C : C @@ -18,6 +22,8 @@ function f() { >f : () => C return null; +>null : null + return new C(); >new C() : C >C : typeof C @@ -26,7 +32,10 @@ function g() { >g : () => number return null; +>null : null + return 3; +>3 : number } interface I { >I : I @@ -42,7 +51,9 @@ var w:I={x:null,y:3}; >I : I >{x:null,y:3} : { x: null; y: number; } >x : null +>null : null >y : number +>3 : number diff --git a/tests/baselines/reference/nullAssignableToEveryType.symbols b/tests/baselines/reference/nullAssignableToEveryType.symbols new file mode 100644 index 00000000000..7179a02c0bc --- /dev/null +++ b/tests/baselines/reference/nullAssignableToEveryType.symbols @@ -0,0 +1,125 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/nullAssignableToEveryType.ts === +class C { +>C : Symbol(C, Decl(nullAssignableToEveryType.ts, 0, 0)) + + foo: string; +>foo : Symbol(foo, Decl(nullAssignableToEveryType.ts, 0, 9)) +} +var ac: C; +>ac : Symbol(ac, Decl(nullAssignableToEveryType.ts, 3, 3)) +>C : Symbol(C, Decl(nullAssignableToEveryType.ts, 0, 0)) + +interface I { +>I : Symbol(I, Decl(nullAssignableToEveryType.ts, 3, 10)) + + foo: string; +>foo : Symbol(foo, Decl(nullAssignableToEveryType.ts, 4, 13)) +} +var ai: I; +>ai : Symbol(ai, Decl(nullAssignableToEveryType.ts, 7, 3)) +>I : Symbol(I, Decl(nullAssignableToEveryType.ts, 3, 10)) + +enum E { A } +>E : Symbol(E, Decl(nullAssignableToEveryType.ts, 7, 10)) +>A : Symbol(E.A, Decl(nullAssignableToEveryType.ts, 9, 8)) + +var ae: E; +>ae : Symbol(ae, Decl(nullAssignableToEveryType.ts, 10, 3)) +>E : Symbol(E, Decl(nullAssignableToEveryType.ts, 7, 10)) + +var b: number = null; +>b : Symbol(b, Decl(nullAssignableToEveryType.ts, 12, 3)) + +var c: string = null; +>c : Symbol(c, Decl(nullAssignableToEveryType.ts, 13, 3)) + +var d: boolean = null; +>d : Symbol(d, Decl(nullAssignableToEveryType.ts, 14, 3)) + +var e: Date = null; +>e : Symbol(e, Decl(nullAssignableToEveryType.ts, 15, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var f: any = null; +>f : Symbol(f, Decl(nullAssignableToEveryType.ts, 16, 3)) + +var g: void = null; +>g : Symbol(g, Decl(nullAssignableToEveryType.ts, 17, 3)) + +var h: Object = null; +>h : Symbol(h, Decl(nullAssignableToEveryType.ts, 18, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var i: {} = null; +>i : Symbol(i, Decl(nullAssignableToEveryType.ts, 19, 3)) + +var j: () => {} = null; +>j : Symbol(j, Decl(nullAssignableToEveryType.ts, 20, 3)) + +var k: Function = null; +>k : Symbol(k, Decl(nullAssignableToEveryType.ts, 21, 3)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) + +var l: (x: number) => string = null; +>l : Symbol(l, Decl(nullAssignableToEveryType.ts, 22, 3)) +>x : Symbol(x, Decl(nullAssignableToEveryType.ts, 22, 8)) + +ac = null; +>ac : Symbol(ac, Decl(nullAssignableToEveryType.ts, 3, 3)) + +ai = null; +>ai : Symbol(ai, Decl(nullAssignableToEveryType.ts, 7, 3)) + +ae = null; +>ae : Symbol(ae, Decl(nullAssignableToEveryType.ts, 10, 3)) + +var m: number[] = null; +>m : Symbol(m, Decl(nullAssignableToEveryType.ts, 26, 3)) + +var n: { foo: string } = null; +>n : Symbol(n, Decl(nullAssignableToEveryType.ts, 27, 3)) +>foo : Symbol(foo, Decl(nullAssignableToEveryType.ts, 27, 8)) + +var o: (x: T) => T = null; +>o : Symbol(o, Decl(nullAssignableToEveryType.ts, 28, 3)) +>T : Symbol(T, Decl(nullAssignableToEveryType.ts, 28, 8)) +>x : Symbol(x, Decl(nullAssignableToEveryType.ts, 28, 11)) +>T : Symbol(T, Decl(nullAssignableToEveryType.ts, 28, 8)) +>T : Symbol(T, Decl(nullAssignableToEveryType.ts, 28, 8)) + +var p: Number = null; +>p : Symbol(p, Decl(nullAssignableToEveryType.ts, 29, 3)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +var q: String = null; +>q : Symbol(q, Decl(nullAssignableToEveryType.ts, 30, 3)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +function foo(x: T, y: U, z: V) { +>foo : Symbol(foo, Decl(nullAssignableToEveryType.ts, 30, 21)) +>T : Symbol(T, Decl(nullAssignableToEveryType.ts, 32, 13)) +>U : Symbol(U, Decl(nullAssignableToEveryType.ts, 32, 15)) +>V : Symbol(V, Decl(nullAssignableToEveryType.ts, 32, 18)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>x : Symbol(x, Decl(nullAssignableToEveryType.ts, 32, 35)) +>T : Symbol(T, Decl(nullAssignableToEveryType.ts, 32, 13)) +>y : Symbol(y, Decl(nullAssignableToEveryType.ts, 32, 40)) +>U : Symbol(U, Decl(nullAssignableToEveryType.ts, 32, 15)) +>z : Symbol(z, Decl(nullAssignableToEveryType.ts, 32, 46)) +>V : Symbol(V, Decl(nullAssignableToEveryType.ts, 32, 18)) + + x = null; +>x : Symbol(x, Decl(nullAssignableToEveryType.ts, 32, 35)) + + y = null; +>y : Symbol(y, Decl(nullAssignableToEveryType.ts, 32, 40)) + + z = null; +>z : Symbol(z, Decl(nullAssignableToEveryType.ts, 32, 46)) +} + +//function foo(x: T, y: U, z: V) { +// x = null; +// y = null; +// z = null; +//} diff --git a/tests/baselines/reference/nullAssignableToEveryType.types b/tests/baselines/reference/nullAssignableToEveryType.types index aaf3b3bd8c5..5120a48b896 100644 --- a/tests/baselines/reference/nullAssignableToEveryType.types +++ b/tests/baselines/reference/nullAssignableToEveryType.types @@ -29,59 +29,75 @@ var ae: E; var b: number = null; >b : number +>null : null var c: string = null; >c : string +>null : null var d: boolean = null; >d : boolean +>null : null var e: Date = null; >e : Date >Date : Date +>null : null var f: any = null; >f : any +>null : null var g: void = null; >g : void +>null : null var h: Object = null; >h : Object >Object : Object +>null : null var i: {} = null; >i : {} +>null : null var j: () => {} = null; >j : () => {} +>null : null var k: Function = null; >k : Function >Function : Function +>null : null var l: (x: number) => string = null; >l : (x: number) => string >x : number +>null : null ac = null; >ac = null : null >ac : C +>null : null ai = null; >ai = null : null >ai : I +>null : null ae = null; >ae = null : null >ae : E +>null : null var m: number[] = null; >m : number[] +>null : null var n: { foo: string } = null; >n : { foo: string; } >foo : string +>null : null var o: (x: T) => T = null; >o : (x: T) => T @@ -89,14 +105,17 @@ var o: (x: T) => T = null; >x : T >T : T >T : T +>null : null var p: Number = null; >p : Number >Number : Number +>null : null var q: String = null; >q : String >String : String +>null : null function foo(x: T, y: U, z: V) { >foo : (x: T, y: U, z: V) => void @@ -114,14 +133,17 @@ function foo(x: T, y: U, z: V) { x = null; >x = null : null >x : T +>null : null y = null; >y = null : null >y : U +>null : null z = null; >z = null : null >z : V +>null : null } //function foo(x: T, y: U, z: V) { diff --git a/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.symbols b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.symbols new file mode 100644 index 00000000000..7f81995c9be --- /dev/null +++ b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.symbols @@ -0,0 +1,247 @@ +=== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/nullIsSubtypeOfEverythingButUndefined.ts === +// null is a subtype of any other types except undefined + +var r0 = true ? null : null; +>r0 : Symbol(r0, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 2, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 3, 3)) + +var r0 = true ? null : null; +>r0 : Symbol(r0, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 2, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 3, 3)) + +var u: typeof undefined; +>u : Symbol(u, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 5, 3)) +>undefined : Symbol(undefined) + +var r0b = true ? u : null; +>r0b : Symbol(r0b, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 6, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 7, 3)) +>u : Symbol(u, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 5, 3)) + +var r0b = true ? null : u; +>r0b : Symbol(r0b, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 6, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 7, 3)) +>u : Symbol(u, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 5, 3)) + +var r1 = true ? 1 : null; +>r1 : Symbol(r1, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 9, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 10, 3)) + +var r1 = true ? null : 1; +>r1 : Symbol(r1, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 9, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 10, 3)) + +var r2 = true ? '' : null; +>r2 : Symbol(r2, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 12, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 13, 3)) + +var r2 = true ? null : ''; +>r2 : Symbol(r2, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 12, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 13, 3)) + +var r3 = true ? true : null; +>r3 : Symbol(r3, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 15, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 16, 3)) + +var r3 = true ? null : true; +>r3 : Symbol(r3, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 15, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 16, 3)) + +var r4 = true ? new Date() : null; +>r4 : Symbol(r4, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 18, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 19, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var r4 = true ? null : new Date(); +>r4 : Symbol(r4, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 18, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 19, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var r5 = true ? /1/ : null; +>r5 : Symbol(r5, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 21, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 22, 3)) + +var r5 = true ? null : /1/; +>r5 : Symbol(r5, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 21, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 22, 3)) + +var r6 = true ? { foo: 1 } : null; +>r6 : Symbol(r6, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 24, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 25, 3)) +>foo : Symbol(foo, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 24, 17)) + +var r6 = true ? null : { foo: 1 }; +>r6 : Symbol(r6, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 24, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 25, 3)) +>foo : Symbol(foo, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 25, 24)) + +var r7 = true ? () => { } : null; +>r7 : Symbol(r7, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 27, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 28, 3)) + +var r7 = true ? null : () => { }; +>r7 : Symbol(r7, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 27, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 28, 3)) + +var r8 = true ? (x: T) => { return x } : null; +>r8 : Symbol(r8, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 30, 3)) +>T : Symbol(T, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 30, 17)) +>x : Symbol(x, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 30, 20)) +>T : Symbol(T, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 30, 17)) +>x : Symbol(x, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 30, 20)) + +var r8b = true ? null : (x: T) => { return x }; // type parameters not identical across declarations +>r8b : Symbol(r8b, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 31, 3)) +>T : Symbol(T, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 31, 25)) +>x : Symbol(x, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 31, 28)) +>T : Symbol(T, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 31, 25)) +>x : Symbol(x, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 31, 28)) + +interface I1 { foo: number; } +>I1 : Symbol(I1, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 31, 50)) +>foo : Symbol(foo, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 33, 14)) + +var i1: I1; +>i1 : Symbol(i1, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 34, 3)) +>I1 : Symbol(I1, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 31, 50)) + +var r9 = true ? i1 : null; +>r9 : Symbol(r9, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 35, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 36, 3)) +>i1 : Symbol(i1, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 34, 3)) + +var r9 = true ? null : i1; +>r9 : Symbol(r9, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 35, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 36, 3)) +>i1 : Symbol(i1, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 34, 3)) + +class C1 { foo: number; } +>C1 : Symbol(C1, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 36, 26)) +>foo : Symbol(foo, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 38, 10)) + +var c1: C1; +>c1 : Symbol(c1, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 39, 3)) +>C1 : Symbol(C1, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 36, 26)) + +var r10 = true ? c1 : null; +>r10 : Symbol(r10, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 40, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 41, 3)) +>c1 : Symbol(c1, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 39, 3)) + +var r10 = true ? null : c1; +>r10 : Symbol(r10, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 40, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 41, 3)) +>c1 : Symbol(c1, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 39, 3)) + +class C2 { foo: T; } +>C2 : Symbol(C2, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 41, 27)) +>T : Symbol(T, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 43, 9)) +>foo : Symbol(foo, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 43, 13)) +>T : Symbol(T, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 43, 9)) + +var c2: C2; +>c2 : Symbol(c2, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 44, 3)) +>C2 : Symbol(C2, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 41, 27)) + +var r12 = true ? c2 : null; +>r12 : Symbol(r12, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 45, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 46, 3)) +>c2 : Symbol(c2, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 44, 3)) + +var r12 = true ? null : c2; +>r12 : Symbol(r12, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 45, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 46, 3)) +>c2 : Symbol(c2, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 44, 3)) + +enum E { A } +>E : Symbol(E, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 46, 27)) +>A : Symbol(E.A, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 48, 8)) + +var r13 = true ? E : null; +>r13 : Symbol(r13, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 49, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 50, 3)) +>E : Symbol(E, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 46, 27)) + +var r13 = true ? null : E; +>r13 : Symbol(r13, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 49, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 50, 3)) +>E : Symbol(E, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 46, 27)) + +var r14 = true ? E.A : null; +>r14 : Symbol(r14, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 52, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 53, 3)) +>E.A : Symbol(E.A, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 48, 8)) +>E : Symbol(E, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 46, 27)) +>A : Symbol(E.A, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 48, 8)) + +var r14 = true ? null : E.A; +>r14 : Symbol(r14, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 52, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 53, 3)) +>E.A : Symbol(E.A, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 48, 8)) +>E : Symbol(E, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 46, 27)) +>A : Symbol(E.A, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 48, 8)) + +function f() { } +>f : Symbol(f, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 53, 28), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 55, 16)) + +module f { +>f : Symbol(f, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 53, 28), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 55, 16)) + + export var bar = 1; +>bar : Symbol(bar, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 57, 14)) +} +var af: typeof f; +>af : Symbol(af, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 59, 3)) +>f : Symbol(f, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 53, 28), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 55, 16)) + +var r15 = true ? af : null; +>r15 : Symbol(r15, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 60, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 61, 3)) +>af : Symbol(af, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 59, 3)) + +var r15 = true ? null : af; +>r15 : Symbol(r15, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 60, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 61, 3)) +>af : Symbol(af, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 59, 3)) + +class c { baz: string } +>c : Symbol(c, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 61, 27), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 63, 23)) +>baz : Symbol(baz, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 63, 9)) + +module c { +>c : Symbol(c, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 61, 27), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 63, 23)) + + export var bar = 1; +>bar : Symbol(bar, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 65, 14)) +} +var ac: typeof c; +>ac : Symbol(ac, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 67, 3)) +>c : Symbol(c, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 61, 27), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 63, 23)) + +var r16 = true ? ac : null; +>r16 : Symbol(r16, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 68, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 69, 3)) +>ac : Symbol(ac, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 67, 3)) + +var r16 = true ? null : ac; +>r16 : Symbol(r16, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 68, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 69, 3)) +>ac : Symbol(ac, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 67, 3)) + +function f17(x: T) { +>f17 : Symbol(f17, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 69, 27)) +>T : Symbol(T, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 71, 13)) +>x : Symbol(x, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 71, 16)) +>T : Symbol(T, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 71, 13)) + + var r17 = true ? x : null; +>r17 : Symbol(r17, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 72, 7), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 73, 7)) +>x : Symbol(x, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 71, 16)) + + var r17 = true ? null : x; +>r17 : Symbol(r17, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 72, 7), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 73, 7)) +>x : Symbol(x, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 71, 16)) +} + +function f18(x: U) { +>f18 : Symbol(f18, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 74, 1)) +>T : Symbol(T, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 76, 13)) +>U : Symbol(U, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 76, 15)) +>x : Symbol(x, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 76, 19)) +>U : Symbol(U, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 76, 15)) + + var r18 = true ? x : null; +>r18 : Symbol(r18, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 77, 7), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 78, 7)) +>x : Symbol(x, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 76, 19)) + + var r18 = true ? null : x; +>r18 : Symbol(r18, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 77, 7), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 78, 7)) +>x : Symbol(x, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 76, 19)) +} +//function f18(x: U) { +// var r18 = true ? x : null; +// var r18 = true ? null : x; +//} + +var r19 = true ? new Object() : null; +>r19 : Symbol(r19, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 85, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 86, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var r19 = true ? null : new Object(); +>r19 : Symbol(r19, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 85, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 86, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var r20 = true ? {} : null; +>r20 : Symbol(r20, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 88, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 89, 3)) + +var r20 = true ? null : {}; +>r20 : Symbol(r20, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 88, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 89, 3)) + diff --git a/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.types b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.types index 066f5eadef4..42243076e9f 100644 --- a/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.types +++ b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.types @@ -4,10 +4,16 @@ var r0 = true ? null : null; >r0 : any >true ? null : null : null +>true : boolean +>null : null +>null : null var r0 = true ? null : null; >r0 : any >true ? null : null : null +>true : boolean +>null : null +>null : null var u: typeof undefined; >u : any @@ -16,91 +22,137 @@ var u: typeof undefined; var r0b = true ? u : null; >r0b : any >true ? u : null : any +>true : boolean >u : any +>null : null var r0b = true ? null : u; >r0b : any >true ? null : u : any +>true : boolean +>null : null >u : any var r1 = true ? 1 : null; >r1 : number >true ? 1 : null : number +>true : boolean +>1 : number +>null : null var r1 = true ? null : 1; >r1 : number >true ? null : 1 : number +>true : boolean +>null : null +>1 : number var r2 = true ? '' : null; >r2 : string >true ? '' : null : string +>true : boolean +>'' : string +>null : null var r2 = true ? null : ''; >r2 : string >true ? null : '' : string +>true : boolean +>null : null +>'' : string var r3 = true ? true : null; >r3 : boolean >true ? true : null : boolean +>true : boolean +>true : boolean +>null : null var r3 = true ? null : true; >r3 : boolean >true ? null : true : boolean +>true : boolean +>null : null +>true : boolean var r4 = true ? new Date() : null; >r4 : Date >true ? new Date() : null : Date +>true : boolean >new Date() : Date >Date : DateConstructor +>null : null var r4 = true ? null : new Date(); >r4 : Date >true ? null : new Date() : Date +>true : boolean +>null : null >new Date() : Date >Date : DateConstructor var r5 = true ? /1/ : null; >r5 : RegExp >true ? /1/ : null : RegExp +>true : boolean +>/1/ : RegExp +>null : null var r5 = true ? null : /1/; >r5 : RegExp >true ? null : /1/ : RegExp +>true : boolean +>null : null +>/1/ : RegExp var r6 = true ? { foo: 1 } : null; >r6 : { foo: number; } >true ? { foo: 1 } : null : { foo: number; } +>true : boolean >{ foo: 1 } : { foo: number; } >foo : number +>1 : number +>null : null var r6 = true ? null : { foo: 1 }; >r6 : { foo: number; } >true ? null : { foo: 1 } : { foo: number; } +>true : boolean +>null : null >{ foo: 1 } : { foo: number; } >foo : number +>1 : number var r7 = true ? () => { } : null; >r7 : () => void >true ? () => { } : null : () => void +>true : boolean >() => { } : () => void +>null : null var r7 = true ? null : () => { }; >r7 : () => void >true ? null : () => { } : () => void +>true : boolean +>null : null >() => { } : () => void var r8 = true ? (x: T) => { return x } : null; >r8 : (x: T) => T >true ? (x: T) => { return x } : null : (x: T) => T +>true : boolean >(x: T) => { return x } : (x: T) => T >T : T >x : T >T : T >x : T +>null : null var r8b = true ? null : (x: T) => { return x }; // type parameters not identical across declarations >r8b : (x: T) => T >true ? null : (x: T) => { return x } : (x: T) => T +>true : boolean +>null : null >(x: T) => { return x } : (x: T) => T >T : T >x : T @@ -118,11 +170,15 @@ var i1: I1; var r9 = true ? i1 : null; >r9 : I1 >true ? i1 : null : I1 +>true : boolean >i1 : I1 +>null : null var r9 = true ? null : i1; >r9 : I1 >true ? null : i1 : I1 +>true : boolean +>null : null >i1 : I1 class C1 { foo: number; } @@ -136,11 +192,15 @@ var c1: C1; var r10 = true ? c1 : null; >r10 : C1 >true ? c1 : null : C1 +>true : boolean >c1 : C1 +>null : null var r10 = true ? null : c1; >r10 : C1 >true ? null : c1 : C1 +>true : boolean +>null : null >c1 : C1 class C2 { foo: T; } @@ -156,11 +216,15 @@ var c2: C2; var r12 = true ? c2 : null; >r12 : C2 >true ? c2 : null : C2 +>true : boolean >c2 : C2 +>null : null var r12 = true ? null : c2; >r12 : C2 >true ? null : c2 : C2 +>true : boolean +>null : null >c2 : C2 enum E { A } @@ -170,23 +234,31 @@ enum E { A } var r13 = true ? E : null; >r13 : typeof E >true ? E : null : typeof E +>true : boolean >E : typeof E +>null : null var r13 = true ? null : E; >r13 : typeof E >true ? null : E : typeof E +>true : boolean +>null : null >E : typeof E var r14 = true ? E.A : null; >r14 : E >true ? E.A : null : E +>true : boolean >E.A : E >E : typeof E >A : E +>null : null var r14 = true ? null : E.A; >r14 : E >true ? null : E.A : E +>true : boolean +>null : null >E.A : E >E : typeof E >A : E @@ -199,6 +271,7 @@ module f { export var bar = 1; >bar : number +>1 : number } var af: typeof f; >af : typeof f @@ -207,11 +280,15 @@ var af: typeof f; var r15 = true ? af : null; >r15 : typeof f >true ? af : null : typeof f +>true : boolean >af : typeof f +>null : null var r15 = true ? null : af; >r15 : typeof f >true ? null : af : typeof f +>true : boolean +>null : null >af : typeof f class c { baz: string } @@ -223,6 +300,7 @@ module c { export var bar = 1; >bar : number +>1 : number } var ac: typeof c; >ac : typeof c @@ -231,11 +309,15 @@ var ac: typeof c; var r16 = true ? ac : null; >r16 : typeof c >true ? ac : null : typeof c +>true : boolean >ac : typeof c +>null : null var r16 = true ? null : ac; >r16 : typeof c >true ? null : ac : typeof c +>true : boolean +>null : null >ac : typeof c function f17(x: T) { @@ -247,11 +329,15 @@ function f17(x: T) { var r17 = true ? x : null; >r17 : T >true ? x : null : T +>true : boolean >x : T +>null : null var r17 = true ? null : x; >r17 : T >true ? null : x : T +>true : boolean +>null : null >x : T } @@ -265,11 +351,15 @@ function f18(x: U) { var r18 = true ? x : null; >r18 : U >true ? x : null : U +>true : boolean >x : U +>null : null var r18 = true ? null : x; >r18 : U >true ? null : x : U +>true : boolean +>null : null >x : U } //function f18(x: U) { @@ -280,22 +370,30 @@ function f18(x: U) { var r19 = true ? new Object() : null; >r19 : Object >true ? new Object() : null : Object +>true : boolean >new Object() : Object >Object : ObjectConstructor +>null : null var r19 = true ? null : new Object(); >r19 : Object >true ? null : new Object() : Object +>true : boolean +>null : null >new Object() : Object >Object : ObjectConstructor var r20 = true ? {} : null; >r20 : {} >true ? {} : null : {} +>true : boolean >{} : {} +>null : null var r20 = true ? null : {}; >r20 : {} >true ? null : {} : {} +>true : boolean +>null : null >{} : {} diff --git a/tests/baselines/reference/numberAsInLHS.symbols b/tests/baselines/reference/numberAsInLHS.symbols new file mode 100644 index 00000000000..4e9f68545cd --- /dev/null +++ b/tests/baselines/reference/numberAsInLHS.symbols @@ -0,0 +1,3 @@ +=== tests/cases/compiler/numberAsInLHS.ts === +3 in [0, 1] +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/numberAsInLHS.types b/tests/baselines/reference/numberAsInLHS.types index 823e3e0354d..848f937c618 100644 --- a/tests/baselines/reference/numberAsInLHS.types +++ b/tests/baselines/reference/numberAsInLHS.types @@ -1,5 +1,8 @@ === tests/cases/compiler/numberAsInLHS.ts === 3 in [0, 1] >3 in [0, 1] : boolean +>3 : number >[0, 1] : number[] +>0 : number +>1 : number diff --git a/tests/baselines/reference/numberAssignableToEnum.symbols b/tests/baselines/reference/numberAssignableToEnum.symbols new file mode 100644 index 00000000000..294ccccb9a2 --- /dev/null +++ b/tests/baselines/reference/numberAssignableToEnum.symbols @@ -0,0 +1,20 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/numberAssignableToEnum.ts === +enum E { A } +>E : Symbol(E, Decl(numberAssignableToEnum.ts, 0, 0)) +>A : Symbol(E.A, Decl(numberAssignableToEnum.ts, 0, 8)) + +var n: number; +>n : Symbol(n, Decl(numberAssignableToEnum.ts, 1, 3)) + +var e: E; +>e : Symbol(e, Decl(numberAssignableToEnum.ts, 2, 3)) +>E : Symbol(E, Decl(numberAssignableToEnum.ts, 0, 0)) + +e = n; +>e : Symbol(e, Decl(numberAssignableToEnum.ts, 2, 3)) +>n : Symbol(n, Decl(numberAssignableToEnum.ts, 1, 3)) + +n = e; +>n : Symbol(n, Decl(numberAssignableToEnum.ts, 1, 3)) +>e : Symbol(e, Decl(numberAssignableToEnum.ts, 2, 3)) + diff --git a/tests/baselines/reference/numberOnLeftSideOfInExpression.symbols b/tests/baselines/reference/numberOnLeftSideOfInExpression.symbols new file mode 100644 index 00000000000..8f3e997acd8 --- /dev/null +++ b/tests/baselines/reference/numberOnLeftSideOfInExpression.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/numberOnLeftSideOfInExpression.ts === +var left: number; +>left : Symbol(left, Decl(numberOnLeftSideOfInExpression.ts, 0, 3)) + +var right: any; +>right : Symbol(right, Decl(numberOnLeftSideOfInExpression.ts, 1, 3)) + +left in right; +>left : Symbol(left, Decl(numberOnLeftSideOfInExpression.ts, 0, 3)) +>right : Symbol(right, Decl(numberOnLeftSideOfInExpression.ts, 1, 3)) + diff --git a/tests/baselines/reference/numberPropertyAccess.symbols b/tests/baselines/reference/numberPropertyAccess.symbols new file mode 100644 index 00000000000..fdfd4c404de --- /dev/null +++ b/tests/baselines/reference/numberPropertyAccess.symbols @@ -0,0 +1,26 @@ +=== tests/cases/conformance/types/primitives/number/numberPropertyAccess.ts === +var x = 1; +>x : Symbol(x, Decl(numberPropertyAccess.ts, 0, 3)) + +var a = x.toExponential(); +>a : Symbol(a, Decl(numberPropertyAccess.ts, 1, 3)) +>x.toExponential : Symbol(Number.toExponential, Decl(lib.d.ts, 469, 45)) +>x : Symbol(x, Decl(numberPropertyAccess.ts, 0, 3)) +>toExponential : Symbol(Number.toExponential, Decl(lib.d.ts, 469, 45)) + +var b = x.hasOwnProperty('toFixed'); +>b : Symbol(b, Decl(numberPropertyAccess.ts, 2, 3)) +>x.hasOwnProperty : Symbol(Object.hasOwnProperty, Decl(lib.d.ts, 105, 22)) +>x : Symbol(x, Decl(numberPropertyAccess.ts, 0, 3)) +>hasOwnProperty : Symbol(Object.hasOwnProperty, Decl(lib.d.ts, 105, 22)) + +var c = x['toExponential'](); +>c : Symbol(c, Decl(numberPropertyAccess.ts, 4, 3)) +>x : Symbol(x, Decl(numberPropertyAccess.ts, 0, 3)) +>'toExponential' : Symbol(Number.toExponential, Decl(lib.d.ts, 469, 45)) + +var d = x['hasOwnProperty']('toFixed'); +>d : Symbol(d, Decl(numberPropertyAccess.ts, 5, 3)) +>x : Symbol(x, Decl(numberPropertyAccess.ts, 0, 3)) +>'hasOwnProperty' : Symbol(Object.hasOwnProperty, Decl(lib.d.ts, 105, 22)) + diff --git a/tests/baselines/reference/numberPropertyAccess.types b/tests/baselines/reference/numberPropertyAccess.types index fd554e95ace..b7f5479ed79 100644 --- a/tests/baselines/reference/numberPropertyAccess.types +++ b/tests/baselines/reference/numberPropertyAccess.types @@ -1,6 +1,7 @@ === tests/cases/conformance/types/primitives/number/numberPropertyAccess.ts === var x = 1; >x : number +>1 : number var a = x.toExponential(); >a : string @@ -15,16 +16,20 @@ var b = x.hasOwnProperty('toFixed'); >x.hasOwnProperty : (v: string) => boolean >x : number >hasOwnProperty : (v: string) => boolean +>'toFixed' : string var c = x['toExponential'](); >c : string >x['toExponential']() : string >x['toExponential'] : (fractionDigits?: number) => string >x : number +>'toExponential' : string var d = x['hasOwnProperty']('toFixed'); >d : boolean >x['hasOwnProperty']('toFixed') : boolean >x['hasOwnProperty'] : (v: string) => boolean >x : number +>'hasOwnProperty' : string +>'toFixed' : string diff --git a/tests/baselines/reference/numericIndexerConstraint3.symbols b/tests/baselines/reference/numericIndexerConstraint3.symbols new file mode 100644 index 00000000000..bdf58cb1372 --- /dev/null +++ b/tests/baselines/reference/numericIndexerConstraint3.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/numericIndexerConstraint3.ts === +class A { +>A : Symbol(A, Decl(numericIndexerConstraint3.ts, 0, 0)) + + foo: number; +>foo : Symbol(foo, Decl(numericIndexerConstraint3.ts, 0, 9)) +} + +class B extends A { +>B : Symbol(B, Decl(numericIndexerConstraint3.ts, 2, 1)) +>A : Symbol(A, Decl(numericIndexerConstraint3.ts, 0, 0)) + + bar: string; +>bar : Symbol(bar, Decl(numericIndexerConstraint3.ts, 4, 19)) +} + +class C { +>C : Symbol(C, Decl(numericIndexerConstraint3.ts, 6, 1)) + + 0: B; +>B : Symbol(B, Decl(numericIndexerConstraint3.ts, 2, 1)) + + [x: number]: A; +>x : Symbol(x, Decl(numericIndexerConstraint3.ts, 10, 5)) +>A : Symbol(A, Decl(numericIndexerConstraint3.ts, 0, 0)) +} diff --git a/tests/baselines/reference/numericIndexerConstraint4.symbols b/tests/baselines/reference/numericIndexerConstraint4.symbols new file mode 100644 index 00000000000..63d976ea1b1 --- /dev/null +++ b/tests/baselines/reference/numericIndexerConstraint4.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/numericIndexerConstraint4.ts === +class A { +>A : Symbol(A, Decl(numericIndexerConstraint4.ts, 0, 0)) + + foo: number; +>foo : Symbol(foo, Decl(numericIndexerConstraint4.ts, 0, 9)) +} + +class B extends A { +>B : Symbol(B, Decl(numericIndexerConstraint4.ts, 2, 1)) +>A : Symbol(A, Decl(numericIndexerConstraint4.ts, 0, 0)) + + bar: string; +>bar : Symbol(bar, Decl(numericIndexerConstraint4.ts, 4, 19)) +} + +var x: { +>x : Symbol(x, Decl(numericIndexerConstraint4.ts, 8, 3)) + + [idx: number]: A; +>idx : Symbol(idx, Decl(numericIndexerConstraint4.ts, 9, 5)) +>A : Symbol(A, Decl(numericIndexerConstraint4.ts, 0, 0)) + +} = { data: new B() } +>data : Symbol(data, Decl(numericIndexerConstraint4.ts, 10, 5)) +>B : Symbol(B, Decl(numericIndexerConstraint4.ts, 2, 1)) + diff --git a/tests/baselines/reference/numericIndexingResults.symbols b/tests/baselines/reference/numericIndexingResults.symbols new file mode 100644 index 00000000000..16a6e9386da --- /dev/null +++ b/tests/baselines/reference/numericIndexingResults.symbols @@ -0,0 +1,183 @@ +=== tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexingResults.ts === +class C { +>C : Symbol(C, Decl(numericIndexingResults.ts, 0, 0)) + + [x: number]: string; +>x : Symbol(x, Decl(numericIndexingResults.ts, 1, 5)) + + 1 = ''; + "2" = '' +} + +var c: C; +>c : Symbol(c, Decl(numericIndexingResults.ts, 6, 3)) +>C : Symbol(C, Decl(numericIndexingResults.ts, 0, 0)) + +var r1 = c['1']; +>r1 : Symbol(r1, Decl(numericIndexingResults.ts, 7, 3), Decl(numericIndexingResults.ts, 21, 3), Decl(numericIndexingResults.ts, 34, 3)) +>c : Symbol(c, Decl(numericIndexingResults.ts, 6, 3)) +>'1' : Symbol(C.1, Decl(numericIndexingResults.ts, 1, 24)) + +var r2 = c['2']; +>r2 : Symbol(r2, Decl(numericIndexingResults.ts, 8, 3), Decl(numericIndexingResults.ts, 22, 3), Decl(numericIndexingResults.ts, 35, 3)) +>c : Symbol(c, Decl(numericIndexingResults.ts, 6, 3)) +>'2' : Symbol(C."2", Decl(numericIndexingResults.ts, 2, 11)) + +var r3 = c['3']; +>r3 : Symbol(r3, Decl(numericIndexingResults.ts, 9, 3), Decl(numericIndexingResults.ts, 23, 3), Decl(numericIndexingResults.ts, 36, 3), Decl(numericIndexingResults.ts, 44, 3), Decl(numericIndexingResults.ts, 52, 3)) +>c : Symbol(c, Decl(numericIndexingResults.ts, 6, 3)) + +var r4 = c[1]; +>r4 : Symbol(r4, Decl(numericIndexingResults.ts, 10, 3), Decl(numericIndexingResults.ts, 24, 3), Decl(numericIndexingResults.ts, 37, 3), Decl(numericIndexingResults.ts, 45, 3), Decl(numericIndexingResults.ts, 53, 3)) +>c : Symbol(c, Decl(numericIndexingResults.ts, 6, 3)) +>1 : Symbol(C.1, Decl(numericIndexingResults.ts, 1, 24)) + +var r5 = c[2]; +>r5 : Symbol(r5, Decl(numericIndexingResults.ts, 11, 3), Decl(numericIndexingResults.ts, 25, 3), Decl(numericIndexingResults.ts, 38, 3), Decl(numericIndexingResults.ts, 46, 3), Decl(numericIndexingResults.ts, 54, 3)) +>c : Symbol(c, Decl(numericIndexingResults.ts, 6, 3)) +>2 : Symbol(C."2", Decl(numericIndexingResults.ts, 2, 11)) + +var r6 = c[3]; +>r6 : Symbol(r6, Decl(numericIndexingResults.ts, 12, 3), Decl(numericIndexingResults.ts, 26, 3), Decl(numericIndexingResults.ts, 39, 3), Decl(numericIndexingResults.ts, 47, 3), Decl(numericIndexingResults.ts, 55, 3)) +>c : Symbol(c, Decl(numericIndexingResults.ts, 6, 3)) + +interface I { +>I : Symbol(I, Decl(numericIndexingResults.ts, 12, 14)) + + [x: number]: string; +>x : Symbol(x, Decl(numericIndexingResults.ts, 15, 5)) + + 1: string; + "2": string; +} + +var i: I +>i : Symbol(i, Decl(numericIndexingResults.ts, 20, 3)) +>I : Symbol(I, Decl(numericIndexingResults.ts, 12, 14)) + +var r1 = i['1']; +>r1 : Symbol(r1, Decl(numericIndexingResults.ts, 7, 3), Decl(numericIndexingResults.ts, 21, 3), Decl(numericIndexingResults.ts, 34, 3)) +>i : Symbol(i, Decl(numericIndexingResults.ts, 20, 3)) +>'1' : Symbol(I.1, Decl(numericIndexingResults.ts, 15, 24)) + +var r2 = i['2']; +>r2 : Symbol(r2, Decl(numericIndexingResults.ts, 8, 3), Decl(numericIndexingResults.ts, 22, 3), Decl(numericIndexingResults.ts, 35, 3)) +>i : Symbol(i, Decl(numericIndexingResults.ts, 20, 3)) +>'2' : Symbol(I."2", Decl(numericIndexingResults.ts, 16, 14)) + +var r3 = i['3']; +>r3 : Symbol(r3, Decl(numericIndexingResults.ts, 9, 3), Decl(numericIndexingResults.ts, 23, 3), Decl(numericIndexingResults.ts, 36, 3), Decl(numericIndexingResults.ts, 44, 3), Decl(numericIndexingResults.ts, 52, 3)) +>i : Symbol(i, Decl(numericIndexingResults.ts, 20, 3)) + +var r4 = i[1]; +>r4 : Symbol(r4, Decl(numericIndexingResults.ts, 10, 3), Decl(numericIndexingResults.ts, 24, 3), Decl(numericIndexingResults.ts, 37, 3), Decl(numericIndexingResults.ts, 45, 3), Decl(numericIndexingResults.ts, 53, 3)) +>i : Symbol(i, Decl(numericIndexingResults.ts, 20, 3)) +>1 : Symbol(I.1, Decl(numericIndexingResults.ts, 15, 24)) + +var r5 = i[2]; +>r5 : Symbol(r5, Decl(numericIndexingResults.ts, 11, 3), Decl(numericIndexingResults.ts, 25, 3), Decl(numericIndexingResults.ts, 38, 3), Decl(numericIndexingResults.ts, 46, 3), Decl(numericIndexingResults.ts, 54, 3)) +>i : Symbol(i, Decl(numericIndexingResults.ts, 20, 3)) +>2 : Symbol(I."2", Decl(numericIndexingResults.ts, 16, 14)) + +var r6 = i[3]; +>r6 : Symbol(r6, Decl(numericIndexingResults.ts, 12, 3), Decl(numericIndexingResults.ts, 26, 3), Decl(numericIndexingResults.ts, 39, 3), Decl(numericIndexingResults.ts, 47, 3), Decl(numericIndexingResults.ts, 55, 3)) +>i : Symbol(i, Decl(numericIndexingResults.ts, 20, 3)) + +var a: { +>a : Symbol(a, Decl(numericIndexingResults.ts, 28, 3)) + + [x: number]: string; +>x : Symbol(x, Decl(numericIndexingResults.ts, 29, 5)) + + 1: string; + "2": string; +} + +var r1 = a['1']; +>r1 : Symbol(r1, Decl(numericIndexingResults.ts, 7, 3), Decl(numericIndexingResults.ts, 21, 3), Decl(numericIndexingResults.ts, 34, 3)) +>a : Symbol(a, Decl(numericIndexingResults.ts, 28, 3)) +>'1' : Symbol(1, Decl(numericIndexingResults.ts, 29, 24)) + +var r2 = a['2']; +>r2 : Symbol(r2, Decl(numericIndexingResults.ts, 8, 3), Decl(numericIndexingResults.ts, 22, 3), Decl(numericIndexingResults.ts, 35, 3)) +>a : Symbol(a, Decl(numericIndexingResults.ts, 28, 3)) +>'2' : Symbol("2", Decl(numericIndexingResults.ts, 30, 14)) + +var r3 = a['3']; +>r3 : Symbol(r3, Decl(numericIndexingResults.ts, 9, 3), Decl(numericIndexingResults.ts, 23, 3), Decl(numericIndexingResults.ts, 36, 3), Decl(numericIndexingResults.ts, 44, 3), Decl(numericIndexingResults.ts, 52, 3)) +>a : Symbol(a, Decl(numericIndexingResults.ts, 28, 3)) + +var r4 = a[1]; +>r4 : Symbol(r4, Decl(numericIndexingResults.ts, 10, 3), Decl(numericIndexingResults.ts, 24, 3), Decl(numericIndexingResults.ts, 37, 3), Decl(numericIndexingResults.ts, 45, 3), Decl(numericIndexingResults.ts, 53, 3)) +>a : Symbol(a, Decl(numericIndexingResults.ts, 28, 3)) +>1 : Symbol(1, Decl(numericIndexingResults.ts, 29, 24)) + +var r5 = a[2]; +>r5 : Symbol(r5, Decl(numericIndexingResults.ts, 11, 3), Decl(numericIndexingResults.ts, 25, 3), Decl(numericIndexingResults.ts, 38, 3), Decl(numericIndexingResults.ts, 46, 3), Decl(numericIndexingResults.ts, 54, 3)) +>a : Symbol(a, Decl(numericIndexingResults.ts, 28, 3)) +>2 : Symbol("2", Decl(numericIndexingResults.ts, 30, 14)) + +var r6 = a[3]; +>r6 : Symbol(r6, Decl(numericIndexingResults.ts, 12, 3), Decl(numericIndexingResults.ts, 26, 3), Decl(numericIndexingResults.ts, 39, 3), Decl(numericIndexingResults.ts, 47, 3), Decl(numericIndexingResults.ts, 55, 3)) +>a : Symbol(a, Decl(numericIndexingResults.ts, 28, 3)) + +var b: { [x: number]: string } = { 1: '', "2": '' } +>b : Symbol(b, Decl(numericIndexingResults.ts, 41, 3)) +>x : Symbol(x, Decl(numericIndexingResults.ts, 41, 10)) + +var r1a = b['1']; +>r1a : Symbol(r1a, Decl(numericIndexingResults.ts, 42, 3)) +>b : Symbol(b, Decl(numericIndexingResults.ts, 41, 3)) + +var r2a = b['2']; +>r2a : Symbol(r2a, Decl(numericIndexingResults.ts, 43, 3)) +>b : Symbol(b, Decl(numericIndexingResults.ts, 41, 3)) + +var r3 = b['3']; +>r3 : Symbol(r3, Decl(numericIndexingResults.ts, 9, 3), Decl(numericIndexingResults.ts, 23, 3), Decl(numericIndexingResults.ts, 36, 3), Decl(numericIndexingResults.ts, 44, 3), Decl(numericIndexingResults.ts, 52, 3)) +>b : Symbol(b, Decl(numericIndexingResults.ts, 41, 3)) + +var r4 = b[1]; +>r4 : Symbol(r4, Decl(numericIndexingResults.ts, 10, 3), Decl(numericIndexingResults.ts, 24, 3), Decl(numericIndexingResults.ts, 37, 3), Decl(numericIndexingResults.ts, 45, 3), Decl(numericIndexingResults.ts, 53, 3)) +>b : Symbol(b, Decl(numericIndexingResults.ts, 41, 3)) + +var r5 = b[2]; +>r5 : Symbol(r5, Decl(numericIndexingResults.ts, 11, 3), Decl(numericIndexingResults.ts, 25, 3), Decl(numericIndexingResults.ts, 38, 3), Decl(numericIndexingResults.ts, 46, 3), Decl(numericIndexingResults.ts, 54, 3)) +>b : Symbol(b, Decl(numericIndexingResults.ts, 41, 3)) + +var r6 = b[3]; +>r6 : Symbol(r6, Decl(numericIndexingResults.ts, 12, 3), Decl(numericIndexingResults.ts, 26, 3), Decl(numericIndexingResults.ts, 39, 3), Decl(numericIndexingResults.ts, 47, 3), Decl(numericIndexingResults.ts, 55, 3)) +>b : Symbol(b, Decl(numericIndexingResults.ts, 41, 3)) + +var b2: { [x: number]: string; 1: string; "2": string; } = { 1: '', "2": '' } +>b2 : Symbol(b2, Decl(numericIndexingResults.ts, 49, 3)) +>x : Symbol(x, Decl(numericIndexingResults.ts, 49, 11)) + +var r1b = b2['1']; +>r1b : Symbol(r1b, Decl(numericIndexingResults.ts, 50, 3)) +>b2 : Symbol(b2, Decl(numericIndexingResults.ts, 49, 3)) +>'1' : Symbol(1, Decl(numericIndexingResults.ts, 49, 30)) + +var r2b = b2['2']; +>r2b : Symbol(r2b, Decl(numericIndexingResults.ts, 51, 3)) +>b2 : Symbol(b2, Decl(numericIndexingResults.ts, 49, 3)) +>'2' : Symbol("2", Decl(numericIndexingResults.ts, 49, 41)) + +var r3 = b2['3']; +>r3 : Symbol(r3, Decl(numericIndexingResults.ts, 9, 3), Decl(numericIndexingResults.ts, 23, 3), Decl(numericIndexingResults.ts, 36, 3), Decl(numericIndexingResults.ts, 44, 3), Decl(numericIndexingResults.ts, 52, 3)) +>b2 : Symbol(b2, Decl(numericIndexingResults.ts, 49, 3)) + +var r4 = b2[1]; +>r4 : Symbol(r4, Decl(numericIndexingResults.ts, 10, 3), Decl(numericIndexingResults.ts, 24, 3), Decl(numericIndexingResults.ts, 37, 3), Decl(numericIndexingResults.ts, 45, 3), Decl(numericIndexingResults.ts, 53, 3)) +>b2 : Symbol(b2, Decl(numericIndexingResults.ts, 49, 3)) +>1 : Symbol(1, Decl(numericIndexingResults.ts, 49, 30)) + +var r5 = b2[2]; +>r5 : Symbol(r5, Decl(numericIndexingResults.ts, 11, 3), Decl(numericIndexingResults.ts, 25, 3), Decl(numericIndexingResults.ts, 38, 3), Decl(numericIndexingResults.ts, 46, 3), Decl(numericIndexingResults.ts, 54, 3)) +>b2 : Symbol(b2, Decl(numericIndexingResults.ts, 49, 3)) +>2 : Symbol("2", Decl(numericIndexingResults.ts, 49, 41)) + +var r6 = b2[3]; +>r6 : Symbol(r6, Decl(numericIndexingResults.ts, 12, 3), Decl(numericIndexingResults.ts, 26, 3), Decl(numericIndexingResults.ts, 39, 3), Decl(numericIndexingResults.ts, 47, 3), Decl(numericIndexingResults.ts, 55, 3)) +>b2 : Symbol(b2, Decl(numericIndexingResults.ts, 49, 3)) + diff --git a/tests/baselines/reference/numericIndexingResults.types b/tests/baselines/reference/numericIndexingResults.types index e68a083bb74..560bbdc74a8 100644 --- a/tests/baselines/reference/numericIndexingResults.types +++ b/tests/baselines/reference/numericIndexingResults.types @@ -6,7 +6,10 @@ class C { >x : number 1 = ''; +>'' : string + "2" = '' +>'' : string } var c: C; @@ -17,31 +20,37 @@ var r1 = c['1']; >r1 : string >c['1'] : string >c : C +>'1' : string var r2 = c['2']; >r2 : string >c['2'] : string >c : C +>'2' : string var r3 = c['3']; >r3 : any >c['3'] : any >c : C +>'3' : string var r4 = c[1]; >r4 : string >c[1] : string >c : C +>1 : number var r5 = c[2]; >r5 : string >c[2] : string >c : C +>2 : number var r6 = c[3]; >r6 : string >c[3] : string >c : C +>3 : number interface I { >I : I @@ -61,31 +70,37 @@ var r1 = i['1']; >r1 : string >i['1'] : string >i : I +>'1' : string var r2 = i['2']; >r2 : string >i['2'] : string >i : I +>'2' : string var r3 = i['3']; >r3 : any >i['3'] : any >i : I +>'3' : string var r4 = i[1]; >r4 : string >i[1] : string >i : I +>1 : number var r5 = i[2]; >r5 : string >i[2] : string >i : I +>2 : number var r6 = i[3]; >r6 : string >i[3] : string >i : I +>3 : number var a: { >a : { [x: number]: string; 1: string; "2": string; } @@ -101,99 +116,121 @@ var r1 = a['1']; >r1 : string >a['1'] : string >a : { [x: number]: string; 1: string; "2": string; } +>'1' : string var r2 = a['2']; >r2 : string >a['2'] : string >a : { [x: number]: string; 1: string; "2": string; } +>'2' : string var r3 = a['3']; >r3 : any >a['3'] : any >a : { [x: number]: string; 1: string; "2": string; } +>'3' : string var r4 = a[1]; >r4 : string >a[1] : string >a : { [x: number]: string; 1: string; "2": string; } +>1 : number var r5 = a[2]; >r5 : string >a[2] : string >a : { [x: number]: string; 1: string; "2": string; } +>2 : number var r6 = a[3]; >r6 : string >a[3] : string >a : { [x: number]: string; 1: string; "2": string; } +>3 : number var b: { [x: number]: string } = { 1: '', "2": '' } >b : { [x: number]: string; } >x : number >{ 1: '', "2": '' } : { [x: number]: string; 1: string; "2": string; } +>'' : string +>'' : string var r1a = b['1']; >r1a : any >b['1'] : any >b : { [x: number]: string; } +>'1' : string var r2a = b['2']; >r2a : any >b['2'] : any >b : { [x: number]: string; } +>'2' : string var r3 = b['3']; >r3 : any >b['3'] : any >b : { [x: number]: string; } +>'3' : string var r4 = b[1]; >r4 : string >b[1] : string >b : { [x: number]: string; } +>1 : number var r5 = b[2]; >r5 : string >b[2] : string >b : { [x: number]: string; } +>2 : number var r6 = b[3]; >r6 : string >b[3] : string >b : { [x: number]: string; } +>3 : number var b2: { [x: number]: string; 1: string; "2": string; } = { 1: '', "2": '' } >b2 : { [x: number]: string; 1: string; "2": string; } >x : number >{ 1: '', "2": '' } : { [x: number]: string; 1: string; "2": string; } +>'' : string +>'' : string var r1b = b2['1']; >r1b : string >b2['1'] : string >b2 : { [x: number]: string; 1: string; "2": string; } +>'1' : string var r2b = b2['2']; >r2b : string >b2['2'] : string >b2 : { [x: number]: string; 1: string; "2": string; } +>'2' : string var r3 = b2['3']; >r3 : any >b2['3'] : any >b2 : { [x: number]: string; 1: string; "2": string; } +>'3' : string var r4 = b2[1]; >r4 : string >b2[1] : string >b2 : { [x: number]: string; 1: string; "2": string; } +>1 : number var r5 = b2[2]; >r5 : string >b2[2] : string >b2 : { [x: number]: string; 1: string; "2": string; } +>2 : number var r6 = b2[3]; >r6 : string >b2[3] : string >b2 : { [x: number]: string; 1: string; "2": string; } +>3 : number diff --git a/tests/baselines/reference/numericMethodName1.symbols b/tests/baselines/reference/numericMethodName1.symbols new file mode 100644 index 00000000000..a2ecd29e8e7 --- /dev/null +++ b/tests/baselines/reference/numericMethodName1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/numericMethodName1.ts === +class C { +>C : Symbol(C, Decl(numericMethodName1.ts, 0, 0)) + + 1 = 2; +} + diff --git a/tests/baselines/reference/numericMethodName1.types b/tests/baselines/reference/numericMethodName1.types index 09d63f04e13..e6e631fc705 100644 --- a/tests/baselines/reference/numericMethodName1.types +++ b/tests/baselines/reference/numericMethodName1.types @@ -3,5 +3,6 @@ class C { >C : C 1 = 2; +>2 : number } diff --git a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers01.errors.txt b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers01.errors.txt new file mode 100644 index 00000000000..b5dc0ac3c4b --- /dev/null +++ b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers01.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/es6/destructuring/objectBindingPatternKeywordIdentifiers01.ts(2,13): error TS1005: ':' expected. + + +==== tests/cases/conformance/es6/destructuring/objectBindingPatternKeywordIdentifiers01.ts (1 errors) ==== + + var { while } = { while: 1 } + ~ +!!! error TS1005: ':' expected. \ No newline at end of file diff --git a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers01.js b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers01.js new file mode 100644 index 00000000000..cd339bb5907 --- /dev/null +++ b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers01.js @@ -0,0 +1,6 @@ +//// [objectBindingPatternKeywordIdentifiers01.ts] + +var { while } = { while: 1 } + +//// [objectBindingPatternKeywordIdentifiers01.js] +var = { while: 1 }.while; diff --git a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers02.errors.txt b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers02.errors.txt new file mode 100644 index 00000000000..7ac72469d08 --- /dev/null +++ b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers02.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/destructuring/objectBindingPatternKeywordIdentifiers02.ts(2,14): error TS1003: Identifier expected. +tests/cases/conformance/es6/destructuring/objectBindingPatternKeywordIdentifiers02.ts(2,20): error TS1005: ':' expected. + + +==== tests/cases/conformance/es6/destructuring/objectBindingPatternKeywordIdentifiers02.ts (2 errors) ==== + + var { while: while } = { while: 1 } + ~~~~~ +!!! error TS1003: Identifier expected. + ~ +!!! error TS1005: ':' expected. \ No newline at end of file diff --git a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers02.js b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers02.js new file mode 100644 index 00000000000..0286a78ba82 --- /dev/null +++ b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers02.js @@ -0,0 +1,6 @@ +//// [objectBindingPatternKeywordIdentifiers02.ts] + +var { while: while } = { while: 1 } + +//// [objectBindingPatternKeywordIdentifiers02.js] +var _a = { while: 1 }, = _a.while, = _a.while; diff --git a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers03.errors.txt b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers03.errors.txt new file mode 100644 index 00000000000..6ffad2c0345 --- /dev/null +++ b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers03.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/es6/destructuring/objectBindingPatternKeywordIdentifiers03.ts(2,15): error TS1005: ':' expected. + + +==== tests/cases/conformance/es6/destructuring/objectBindingPatternKeywordIdentifiers03.ts (1 errors) ==== + + var { "while" } = { while: 1 } + ~ +!!! error TS1005: ':' expected. \ No newline at end of file diff --git a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers03.js b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers03.js new file mode 100644 index 00000000000..4bbb1afb4cb --- /dev/null +++ b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers03.js @@ -0,0 +1,6 @@ +//// [objectBindingPatternKeywordIdentifiers03.ts] + +var { "while" } = { while: 1 } + +//// [objectBindingPatternKeywordIdentifiers03.js] +var = { while: 1 }["while"]; diff --git a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers04.errors.txt b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers04.errors.txt new file mode 100644 index 00000000000..69a8b48b2f1 --- /dev/null +++ b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers04.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/destructuring/objectBindingPatternKeywordIdentifiers04.ts(2,16): error TS1003: Identifier expected. +tests/cases/conformance/es6/destructuring/objectBindingPatternKeywordIdentifiers04.ts(2,22): error TS1005: ':' expected. + + +==== tests/cases/conformance/es6/destructuring/objectBindingPatternKeywordIdentifiers04.ts (2 errors) ==== + + var { "while": while } = { while: 1 } + ~~~~~ +!!! error TS1003: Identifier expected. + ~ +!!! error TS1005: ':' expected. \ No newline at end of file diff --git a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers04.js b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers04.js new file mode 100644 index 00000000000..4e53b13c0a6 --- /dev/null +++ b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers04.js @@ -0,0 +1,6 @@ +//// [objectBindingPatternKeywordIdentifiers04.ts] + +var { "while": while } = { while: 1 } + +//// [objectBindingPatternKeywordIdentifiers04.js] +var _a = { while: 1 }, = _a["while"], = _a.while; diff --git a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers05.js b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers05.js new file mode 100644 index 00000000000..41c46c46506 --- /dev/null +++ b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers05.js @@ -0,0 +1,6 @@ +//// [objectBindingPatternKeywordIdentifiers05.ts] + +var { as } = { as: 1 } + +//// [objectBindingPatternKeywordIdentifiers05.js] +var as = { as: 1 }.as; diff --git a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers05.symbols b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers05.symbols new file mode 100644 index 00000000000..5ac9bb815f8 --- /dev/null +++ b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers05.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/destructuring/objectBindingPatternKeywordIdentifiers05.ts === + +var { as } = { as: 1 } +>as : Symbol(as, Decl(objectBindingPatternKeywordIdentifiers05.ts, 1, 5)) +>as : Symbol(as, Decl(objectBindingPatternKeywordIdentifiers05.ts, 1, 14)) + diff --git a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers05.types b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers05.types new file mode 100644 index 00000000000..d736121a3b7 --- /dev/null +++ b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers05.types @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/destructuring/objectBindingPatternKeywordIdentifiers05.ts === + +var { as } = { as: 1 } +>as : number +>{ as: 1 } : { as: number; } +>as : number +>1 : number + diff --git a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers06.js b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers06.js new file mode 100644 index 00000000000..d24c468e891 --- /dev/null +++ b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers06.js @@ -0,0 +1,6 @@ +//// [objectBindingPatternKeywordIdentifiers06.ts] + +var { as: as } = { as: 1 } + +//// [objectBindingPatternKeywordIdentifiers06.js] +var as = { as: 1 }.as; diff --git a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers06.symbols b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers06.symbols new file mode 100644 index 00000000000..7cee5f3009b --- /dev/null +++ b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers06.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/destructuring/objectBindingPatternKeywordIdentifiers06.ts === + +var { as: as } = { as: 1 } +>as : Symbol(as, Decl(objectBindingPatternKeywordIdentifiers06.ts, 1, 5)) +>as : Symbol(as, Decl(objectBindingPatternKeywordIdentifiers06.ts, 1, 18)) + diff --git a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers06.types b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers06.types new file mode 100644 index 00000000000..739771385b2 --- /dev/null +++ b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers06.types @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/destructuring/objectBindingPatternKeywordIdentifiers06.ts === + +var { as: as } = { as: 1 } +>as : any +>as : number +>{ as: 1 } : { as: number; } +>as : number +>1 : number + diff --git a/tests/baselines/reference/objectIndexer.symbols b/tests/baselines/reference/objectIndexer.symbols new file mode 100644 index 00000000000..33885a40e27 --- /dev/null +++ b/tests/baselines/reference/objectIndexer.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/objectIndexer.ts === +export interface Callback { +>Callback : Symbol(Callback, Decl(objectIndexer.ts, 0, 0)) + + (value: any): void; +>value : Symbol(value, Decl(objectIndexer.ts, 1, 5)) +} + +interface IMap { +>IMap : Symbol(IMap, Decl(objectIndexer.ts, 2, 1)) + + [s: string]: Callback; +>s : Symbol(s, Decl(objectIndexer.ts, 5, 5)) +>Callback : Symbol(Callback, Decl(objectIndexer.ts, 0, 0)) +} + +class Emitter { +>Emitter : Symbol(Emitter, Decl(objectIndexer.ts, 6, 1)) + + private listeners: IMap; +>listeners : Symbol(listeners, Decl(objectIndexer.ts, 8, 15)) +>IMap : Symbol(IMap, Decl(objectIndexer.ts, 2, 1)) + + constructor () { + this.listeners = {}; +>this.listeners : Symbol(listeners, Decl(objectIndexer.ts, 8, 15)) +>this : Symbol(Emitter, Decl(objectIndexer.ts, 6, 1)) +>listeners : Symbol(listeners, Decl(objectIndexer.ts, 8, 15)) + } +} + diff --git a/tests/baselines/reference/objectLitGetterSetter.symbols b/tests/baselines/reference/objectLitGetterSetter.symbols new file mode 100644 index 00000000000..512e459c8c0 --- /dev/null +++ b/tests/baselines/reference/objectLitGetterSetter.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/objectLitGetterSetter.ts === + var obj = {}; +>obj : Symbol(obj, Decl(objectLitGetterSetter.ts, 0, 15)) + + Object.defineProperty(obj, "accProperty", ({ +>Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.d.ts, 160, 60)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.d.ts, 160, 60)) +>obj : Symbol(obj, Decl(objectLitGetterSetter.ts, 0, 15)) +>PropertyDescriptor : Symbol(PropertyDescriptor, Decl(lib.d.ts, 79, 66)) + + get: function () { +>get : Symbol(get, Decl(objectLitGetterSetter.ts, 1, 76)) + + eval("public = 1;"); +>eval : Symbol(eval, Decl(lib.d.ts, 22, 29)) + + return 11; + }, + set: function (v) { +>set : Symbol(set, Decl(objectLitGetterSetter.ts, 5, 18)) +>v : Symbol(v, Decl(objectLitGetterSetter.ts, 6, 31)) + } + })) + diff --git a/tests/baselines/reference/objectLitGetterSetter.types b/tests/baselines/reference/objectLitGetterSetter.types index 92decfd4068..4f7865374e2 100644 --- a/tests/baselines/reference/objectLitGetterSetter.types +++ b/tests/baselines/reference/objectLitGetterSetter.types @@ -9,6 +9,7 @@ >Object : ObjectConstructor >defineProperty : (o: any, p: string, attributes: PropertyDescriptor) => any >obj : {} +>"accProperty" : string >({ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } }) : PropertyDescriptor >PropertyDescriptor : PropertyDescriptor >({ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } }) : { get: () => number; set: (v: any) => void; } @@ -21,8 +22,11 @@ eval("public = 1;"); >eval("public = 1;") : any >eval : (x: string) => any +>"public = 1;" : string return 11; +>11 : number + }, set: function (v) { >set : (v: any) => void diff --git a/tests/baselines/reference/objectLiteral1.symbols b/tests/baselines/reference/objectLiteral1.symbols new file mode 100644 index 00000000000..76acb6623bc --- /dev/null +++ b/tests/baselines/reference/objectLiteral1.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/objectLiteral1.ts === +var v30 = {a:1, b:2}; +>v30 : Symbol(v30, Decl(objectLiteral1.ts, 0, 3)) +>a : Symbol(a, Decl(objectLiteral1.ts, 0, 11)) +>b : Symbol(b, Decl(objectLiteral1.ts, 0, 15)) + diff --git a/tests/baselines/reference/objectLiteral1.types b/tests/baselines/reference/objectLiteral1.types index 6371d285f63..491b4ce365b 100644 --- a/tests/baselines/reference/objectLiteral1.types +++ b/tests/baselines/reference/objectLiteral1.types @@ -3,5 +3,7 @@ var v30 = {a:1, b:2}; >v30 : { a: number; b: number; } >{a:1, b:2} : { a: number; b: number; } >a : number +>1 : number >b : number +>2 : number diff --git a/tests/baselines/reference/objectLiteral2.symbols b/tests/baselines/reference/objectLiteral2.symbols new file mode 100644 index 00000000000..6e953fa2c12 --- /dev/null +++ b/tests/baselines/reference/objectLiteral2.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/objectLiteral2.ts === +var v30 = {a:1, b:2}, v31; +>v30 : Symbol(v30, Decl(objectLiteral2.ts, 0, 3)) +>a : Symbol(a, Decl(objectLiteral2.ts, 0, 11)) +>b : Symbol(b, Decl(objectLiteral2.ts, 0, 15)) +>v31 : Symbol(v31, Decl(objectLiteral2.ts, 0, 21)) + diff --git a/tests/baselines/reference/objectLiteral2.types b/tests/baselines/reference/objectLiteral2.types index c6853bdbd88..387bd0ba90f 100644 --- a/tests/baselines/reference/objectLiteral2.types +++ b/tests/baselines/reference/objectLiteral2.types @@ -3,6 +3,8 @@ var v30 = {a:1, b:2}, v31; >v30 : { a: number; b: number; } >{a:1, b:2} : { a: number; b: number; } >a : number +>1 : number >b : number +>2 : number >v31 : any diff --git a/tests/baselines/reference/objectLiteralArraySpecialization.symbols b/tests/baselines/reference/objectLiteralArraySpecialization.symbols new file mode 100644 index 00000000000..4cc1188dcc4 --- /dev/null +++ b/tests/baselines/reference/objectLiteralArraySpecialization.symbols @@ -0,0 +1,44 @@ +=== tests/cases/compiler/objectLiteralArraySpecialization.ts === +declare function create(initialValues?: T[]): MyArrayWrapper; +>create : Symbol(create, Decl(objectLiteralArraySpecialization.ts, 0, 0)) +>T : Symbol(T, Decl(objectLiteralArraySpecialization.ts, 0, 24)) +>initialValues : Symbol(initialValues, Decl(objectLiteralArraySpecialization.ts, 0, 27)) +>T : Symbol(T, Decl(objectLiteralArraySpecialization.ts, 0, 24)) +>MyArrayWrapper : Symbol(MyArrayWrapper, Decl(objectLiteralArraySpecialization.ts, 0, 67)) +>T : Symbol(T, Decl(objectLiteralArraySpecialization.ts, 0, 24)) + +interface MyArrayWrapper { +>MyArrayWrapper : Symbol(MyArrayWrapper, Decl(objectLiteralArraySpecialization.ts, 0, 67)) +>T : Symbol(T, Decl(objectLiteralArraySpecialization.ts, 1, 25)) + + constructor(initialItems?: T[]); +>constructor : Symbol(constructor, Decl(objectLiteralArraySpecialization.ts, 1, 29)) +>initialItems : Symbol(initialItems, Decl(objectLiteralArraySpecialization.ts, 2, 13)) +>T : Symbol(T, Decl(objectLiteralArraySpecialization.ts, 1, 25)) + + doSomething(predicate: (x: T, y: T) => boolean): void; +>doSomething : Symbol(doSomething, Decl(objectLiteralArraySpecialization.ts, 2, 33)) +>predicate : Symbol(predicate, Decl(objectLiteralArraySpecialization.ts, 3, 13)) +>x : Symbol(x, Decl(objectLiteralArraySpecialization.ts, 3, 25)) +>T : Symbol(T, Decl(objectLiteralArraySpecialization.ts, 1, 25)) +>y : Symbol(y, Decl(objectLiteralArraySpecialization.ts, 3, 30)) +>T : Symbol(T, Decl(objectLiteralArraySpecialization.ts, 1, 25)) +} +var thing = create([ { name: "bob", id: 24 }, { name: "doug", id: 32 } ]); // should not error +>thing : Symbol(thing, Decl(objectLiteralArraySpecialization.ts, 5, 3)) +>create : Symbol(create, Decl(objectLiteralArraySpecialization.ts, 0, 0)) +>name : Symbol(name, Decl(objectLiteralArraySpecialization.ts, 5, 22)) +>id : Symbol(id, Decl(objectLiteralArraySpecialization.ts, 5, 35)) +>name : Symbol(name, Decl(objectLiteralArraySpecialization.ts, 5, 47)) +>id : Symbol(id, Decl(objectLiteralArraySpecialization.ts, 5, 61)) + +thing.doSomething((x, y) => x.name === "bob"); // should not error +>thing.doSomething : Symbol(MyArrayWrapper.doSomething, Decl(objectLiteralArraySpecialization.ts, 2, 33)) +>thing : Symbol(thing, Decl(objectLiteralArraySpecialization.ts, 5, 3)) +>doSomething : Symbol(MyArrayWrapper.doSomething, Decl(objectLiteralArraySpecialization.ts, 2, 33)) +>x : Symbol(x, Decl(objectLiteralArraySpecialization.ts, 6, 19)) +>y : Symbol(y, Decl(objectLiteralArraySpecialization.ts, 6, 21)) +>x.name : Symbol(name, Decl(objectLiteralArraySpecialization.ts, 5, 22)) +>x : Symbol(x, Decl(objectLiteralArraySpecialization.ts, 6, 19)) +>name : Symbol(name, Decl(objectLiteralArraySpecialization.ts, 5, 22)) + diff --git a/tests/baselines/reference/objectLiteralArraySpecialization.types b/tests/baselines/reference/objectLiteralArraySpecialization.types index d077354728b..b32eaa0441e 100644 --- a/tests/baselines/reference/objectLiteralArraySpecialization.types +++ b/tests/baselines/reference/objectLiteralArraySpecialization.types @@ -31,10 +31,14 @@ var thing = create([ { name: "bob", id: 24 }, { name: "doug", id: 32 } ]); // sh >[ { name: "bob", id: 24 }, { name: "doug", id: 32 } ] : { name: string; id: number; }[] >{ name: "bob", id: 24 } : { name: string; id: number; } >name : string +>"bob" : string >id : number +>24 : number >{ name: "doug", id: 32 } : { name: string; id: number; } >name : string +>"doug" : string >id : number +>32 : number thing.doSomething((x, y) => x.name === "bob"); // should not error >thing.doSomething((x, y) => x.name === "bob") : void @@ -48,4 +52,5 @@ thing.doSomething((x, y) => x.name === "bob"); // should not error >x.name : string >x : { name: string; id: number; } >name : string +>"bob" : string diff --git a/tests/baselines/reference/objectLiteralContextualTyping.symbols b/tests/baselines/reference/objectLiteralContextualTyping.symbols new file mode 100644 index 00000000000..6e8f2e5f333 --- /dev/null +++ b/tests/baselines/reference/objectLiteralContextualTyping.symbols @@ -0,0 +1,71 @@ +=== tests/cases/conformance/expressions/contextualTyping/objectLiteralContextualTyping.ts === +// Tests related to #1774 + +interface Item { +>Item : Symbol(Item, Decl(objectLiteralContextualTyping.ts, 0, 0)) + + name: string; +>name : Symbol(name, Decl(objectLiteralContextualTyping.ts, 2, 16)) + + description?: string; +>description : Symbol(description, Decl(objectLiteralContextualTyping.ts, 3, 17)) +} + +declare function foo(item: Item): string; +>foo : Symbol(foo, Decl(objectLiteralContextualTyping.ts, 5, 1), Decl(objectLiteralContextualTyping.ts, 7, 41)) +>item : Symbol(item, Decl(objectLiteralContextualTyping.ts, 7, 21)) +>Item : Symbol(Item, Decl(objectLiteralContextualTyping.ts, 0, 0)) + +declare function foo(item: any): number; +>foo : Symbol(foo, Decl(objectLiteralContextualTyping.ts, 5, 1), Decl(objectLiteralContextualTyping.ts, 7, 41)) +>item : Symbol(item, Decl(objectLiteralContextualTyping.ts, 8, 21)) + +var x = foo({ name: "Sprocket" }); +>x : Symbol(x, Decl(objectLiteralContextualTyping.ts, 10, 3), Decl(objectLiteralContextualTyping.ts, 11, 3)) +>foo : Symbol(foo, Decl(objectLiteralContextualTyping.ts, 5, 1), Decl(objectLiteralContextualTyping.ts, 7, 41)) +>name : Symbol(name, Decl(objectLiteralContextualTyping.ts, 10, 13)) + +var x: string; +>x : Symbol(x, Decl(objectLiteralContextualTyping.ts, 10, 3), Decl(objectLiteralContextualTyping.ts, 11, 3)) + +var y = foo({ name: "Sprocket", description: "Bumpy wheel" }); +>y : Symbol(y, Decl(objectLiteralContextualTyping.ts, 13, 3), Decl(objectLiteralContextualTyping.ts, 14, 3)) +>foo : Symbol(foo, Decl(objectLiteralContextualTyping.ts, 5, 1), Decl(objectLiteralContextualTyping.ts, 7, 41)) +>name : Symbol(name, Decl(objectLiteralContextualTyping.ts, 13, 13)) +>description : Symbol(description, Decl(objectLiteralContextualTyping.ts, 13, 31)) + +var y: string; +>y : Symbol(y, Decl(objectLiteralContextualTyping.ts, 13, 3), Decl(objectLiteralContextualTyping.ts, 14, 3)) + +var z = foo({ name: "Sprocket", description: false }); +>z : Symbol(z, Decl(objectLiteralContextualTyping.ts, 16, 3), Decl(objectLiteralContextualTyping.ts, 17, 3)) +>foo : Symbol(foo, Decl(objectLiteralContextualTyping.ts, 5, 1), Decl(objectLiteralContextualTyping.ts, 7, 41)) +>name : Symbol(name, Decl(objectLiteralContextualTyping.ts, 16, 13)) +>description : Symbol(description, Decl(objectLiteralContextualTyping.ts, 16, 31)) + +var z: number; +>z : Symbol(z, Decl(objectLiteralContextualTyping.ts, 16, 3), Decl(objectLiteralContextualTyping.ts, 17, 3)) + +var w = foo({ a: 10 }); +>w : Symbol(w, Decl(objectLiteralContextualTyping.ts, 19, 3), Decl(objectLiteralContextualTyping.ts, 20, 3)) +>foo : Symbol(foo, Decl(objectLiteralContextualTyping.ts, 5, 1), Decl(objectLiteralContextualTyping.ts, 7, 41)) +>a : Symbol(a, Decl(objectLiteralContextualTyping.ts, 19, 13)) + +var w: number; +>w : Symbol(w, Decl(objectLiteralContextualTyping.ts, 19, 3), Decl(objectLiteralContextualTyping.ts, 20, 3)) + +declare function bar(param: { x?: T }): T; +>bar : Symbol(bar, Decl(objectLiteralContextualTyping.ts, 20, 14)) +>T : Symbol(T, Decl(objectLiteralContextualTyping.ts, 22, 21)) +>param : Symbol(param, Decl(objectLiteralContextualTyping.ts, 22, 24)) +>x : Symbol(x, Decl(objectLiteralContextualTyping.ts, 22, 32)) +>T : Symbol(T, Decl(objectLiteralContextualTyping.ts, 22, 21)) +>T : Symbol(T, Decl(objectLiteralContextualTyping.ts, 22, 21)) + +var b = bar({}); +>b : Symbol(b, Decl(objectLiteralContextualTyping.ts, 24, 3), Decl(objectLiteralContextualTyping.ts, 25, 3)) +>bar : Symbol(bar, Decl(objectLiteralContextualTyping.ts, 20, 14)) + +var b: {}; +>b : Symbol(b, Decl(objectLiteralContextualTyping.ts, 24, 3), Decl(objectLiteralContextualTyping.ts, 25, 3)) + diff --git a/tests/baselines/reference/objectLiteralContextualTyping.types b/tests/baselines/reference/objectLiteralContextualTyping.types index 32c9e91b2c7..7668b01d32c 100644 --- a/tests/baselines/reference/objectLiteralContextualTyping.types +++ b/tests/baselines/reference/objectLiteralContextualTyping.types @@ -26,6 +26,7 @@ var x = foo({ name: "Sprocket" }); >foo : { (item: Item): string; (item: any): number; } >{ name: "Sprocket" } : { name: string; } >name : string +>"Sprocket" : string var x: string; >x : string @@ -36,7 +37,9 @@ var y = foo({ name: "Sprocket", description: "Bumpy wheel" }); >foo : { (item: Item): string; (item: any): number; } >{ name: "Sprocket", description: "Bumpy wheel" } : { name: string; description: string; } >name : string +>"Sprocket" : string >description : string +>"Bumpy wheel" : string var y: string; >y : string @@ -47,7 +50,9 @@ var z = foo({ name: "Sprocket", description: false }); >foo : { (item: Item): string; (item: any): number; } >{ name: "Sprocket", description: false } : { name: string; description: boolean; } >name : string +>"Sprocket" : string >description : boolean +>false : boolean var z: number; >z : number @@ -58,6 +63,7 @@ var w = foo({ a: 10 }); >foo : { (item: Item): string; (item: any): number; } >{ a: 10 } : { a: number; } >a : number +>10 : number var w: number; >w : number diff --git a/tests/baselines/reference/objectLiteralDeclarationGeneration1.symbols b/tests/baselines/reference/objectLiteralDeclarationGeneration1.symbols new file mode 100644 index 00000000000..fb03260183c --- /dev/null +++ b/tests/baselines/reference/objectLiteralDeclarationGeneration1.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/objectLiteralDeclarationGeneration1.ts === +class y{ } +>y : Symbol(y, Decl(objectLiteralDeclarationGeneration1.ts, 0, 0)) +>T : Symbol(T, Decl(objectLiteralDeclarationGeneration1.ts, 0, 8)) + diff --git a/tests/baselines/reference/objectLiteralIndexerNoImplicitAny.symbols b/tests/baselines/reference/objectLiteralIndexerNoImplicitAny.symbols new file mode 100644 index 00000000000..2a5545f2264 --- /dev/null +++ b/tests/baselines/reference/objectLiteralIndexerNoImplicitAny.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/objectLiteralIndexerNoImplicitAny.ts === +interface I { +>I : Symbol(I, Decl(objectLiteralIndexerNoImplicitAny.ts, 0, 0)) + + [s: string]: any; +>s : Symbol(s, Decl(objectLiteralIndexerNoImplicitAny.ts, 1, 5)) +} + +var x: I = { +>x : Symbol(x, Decl(objectLiteralIndexerNoImplicitAny.ts, 4, 3)) +>I : Symbol(I, Decl(objectLiteralIndexerNoImplicitAny.ts, 0, 0)) + + p: null +>p : Symbol(p, Decl(objectLiteralIndexerNoImplicitAny.ts, 4, 12)) +} diff --git a/tests/baselines/reference/objectLiteralIndexerNoImplicitAny.types b/tests/baselines/reference/objectLiteralIndexerNoImplicitAny.types index 14bcc6f5b62..a49f76d02e9 100644 --- a/tests/baselines/reference/objectLiteralIndexerNoImplicitAny.types +++ b/tests/baselines/reference/objectLiteralIndexerNoImplicitAny.types @@ -13,4 +13,5 @@ var x: I = { p: null >p : null +>null : null } diff --git a/tests/baselines/reference/objectLiteralIndexers.symbols b/tests/baselines/reference/objectLiteralIndexers.symbols new file mode 100644 index 00000000000..424e95be0fa --- /dev/null +++ b/tests/baselines/reference/objectLiteralIndexers.symbols @@ -0,0 +1,49 @@ +=== tests/cases/compiler/objectLiteralIndexers.ts === +interface A { +>A : Symbol(A, Decl(objectLiteralIndexers.ts, 0, 0)) + + x: number; +>x : Symbol(x, Decl(objectLiteralIndexers.ts, 0, 13)) +} + +interface B extends A { +>B : Symbol(B, Decl(objectLiteralIndexers.ts, 2, 1)) +>A : Symbol(A, Decl(objectLiteralIndexers.ts, 0, 0)) + + y: string; +>y : Symbol(y, Decl(objectLiteralIndexers.ts, 4, 23)) +} + +var a: A; +>a : Symbol(a, Decl(objectLiteralIndexers.ts, 8, 3)) +>A : Symbol(A, Decl(objectLiteralIndexers.ts, 0, 0)) + +var b: B; +>b : Symbol(b, Decl(objectLiteralIndexers.ts, 9, 3)) +>B : Symbol(B, Decl(objectLiteralIndexers.ts, 2, 1)) + +var c: any; +>c : Symbol(c, Decl(objectLiteralIndexers.ts, 10, 3)) + +var o1: { [s: string]: A;[n: number]: B; } = { x: a, 0: b }; // string indexer is A, number indexer is B +>o1 : Symbol(o1, Decl(objectLiteralIndexers.ts, 12, 3)) +>s : Symbol(s, Decl(objectLiteralIndexers.ts, 12, 11)) +>A : Symbol(A, Decl(objectLiteralIndexers.ts, 0, 0)) +>n : Symbol(n, Decl(objectLiteralIndexers.ts, 12, 26)) +>B : Symbol(B, Decl(objectLiteralIndexers.ts, 2, 1)) +>x : Symbol(x, Decl(objectLiteralIndexers.ts, 12, 46)) +>a : Symbol(a, Decl(objectLiteralIndexers.ts, 8, 3)) +>b : Symbol(b, Decl(objectLiteralIndexers.ts, 9, 3)) + +o1 = { x: b, 0: c }; // both indexers are any +>o1 : Symbol(o1, Decl(objectLiteralIndexers.ts, 12, 3)) +>x : Symbol(x, Decl(objectLiteralIndexers.ts, 13, 6)) +>b : Symbol(b, Decl(objectLiteralIndexers.ts, 9, 3)) +>c : Symbol(c, Decl(objectLiteralIndexers.ts, 10, 3)) + +o1 = { x: c, 0: b }; // string indexer is any, number indexer is B +>o1 : Symbol(o1, Decl(objectLiteralIndexers.ts, 12, 3)) +>x : Symbol(x, Decl(objectLiteralIndexers.ts, 14, 6)) +>c : Symbol(c, Decl(objectLiteralIndexers.ts, 10, 3)) +>b : Symbol(b, Decl(objectLiteralIndexers.ts, 9, 3)) + diff --git a/tests/baselines/reference/objectLiteralShorthandProperties.symbols b/tests/baselines/reference/objectLiteralShorthandProperties.symbols new file mode 100644 index 00000000000..e75b1d70a11 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandProperties.symbols @@ -0,0 +1,46 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandProperties.ts === +var a, b, c; +>a : Symbol(a, Decl(objectLiteralShorthandProperties.ts, 0, 3)) +>b : Symbol(b, Decl(objectLiteralShorthandProperties.ts, 0, 6)) +>c : Symbol(c, Decl(objectLiteralShorthandProperties.ts, 0, 9)) + +var x1 = { +>x1 : Symbol(x1, Decl(objectLiteralShorthandProperties.ts, 2, 3)) + + a +>a : Symbol(a, Decl(objectLiteralShorthandProperties.ts, 2, 10)) + +}; + +var x2 = { +>x2 : Symbol(x2, Decl(objectLiteralShorthandProperties.ts, 6, 3)) + + a, +>a : Symbol(a, Decl(objectLiteralShorthandProperties.ts, 6, 10)) +} + +var x3 = { +>x3 : Symbol(x3, Decl(objectLiteralShorthandProperties.ts, 10, 3)) + + a: 0, +>a : Symbol(a, Decl(objectLiteralShorthandProperties.ts, 10, 10)) + + b, +>b : Symbol(b, Decl(objectLiteralShorthandProperties.ts, 11, 9)) + + c, +>c : Symbol(c, Decl(objectLiteralShorthandProperties.ts, 12, 6)) + + d() { }, +>d : Symbol(d, Decl(objectLiteralShorthandProperties.ts, 13, 6)) + + x3, +>x3 : Symbol(x3, Decl(objectLiteralShorthandProperties.ts, 14, 12)) + + parent: x3 +>parent : Symbol(parent, Decl(objectLiteralShorthandProperties.ts, 15, 7)) +>x3 : Symbol(x3, Decl(objectLiteralShorthandProperties.ts, 10, 3)) + +}; + + diff --git a/tests/baselines/reference/objectLiteralShorthandProperties.types b/tests/baselines/reference/objectLiteralShorthandProperties.types index c34b2ab79b7..9d537173d49 100644 --- a/tests/baselines/reference/objectLiteralShorthandProperties.types +++ b/tests/baselines/reference/objectLiteralShorthandProperties.types @@ -27,6 +27,7 @@ var x3 = { a: 0, >a : number +>0 : number b, >b : any diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.symbols b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.symbols new file mode 100644 index 00000000000..6afb48aac49 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.symbols @@ -0,0 +1,60 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignment.ts === +var id: number = 10000; +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignment.ts, 0, 3)) + +var name: string = "my name"; +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignment.ts, 1, 3)) + +var person: { name: string; id: number } = { name, id }; +>person : Symbol(person, Decl(objectLiteralShorthandPropertiesAssignment.ts, 3, 3)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignment.ts, 3, 13)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignment.ts, 3, 27)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignment.ts, 3, 44)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignment.ts, 3, 50)) + +function foo( obj:{ name: string }): void { }; +>foo : Symbol(foo, Decl(objectLiteralShorthandPropertiesAssignment.ts, 3, 56)) +>obj : Symbol(obj, Decl(objectLiteralShorthandPropertiesAssignment.ts, 4, 13)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignment.ts, 4, 19)) + +function bar(name: string, id: number) { return { name, id }; } +>bar : Symbol(bar, Decl(objectLiteralShorthandPropertiesAssignment.ts, 4, 46)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignment.ts, 5, 13)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignment.ts, 5, 26)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignment.ts, 5, 49)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignment.ts, 5, 55)) + +function bar1(name: string, id: number) { return { name }; } +>bar1 : Symbol(bar1, Decl(objectLiteralShorthandPropertiesAssignment.ts, 5, 63)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignment.ts, 6, 14)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignment.ts, 6, 27)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignment.ts, 6, 50)) + +function baz(name: string, id: number): { name: string; id: number } { return { name, id }; } +>baz : Symbol(baz, Decl(objectLiteralShorthandPropertiesAssignment.ts, 6, 60)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignment.ts, 7, 13)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignment.ts, 7, 26)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignment.ts, 7, 41)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignment.ts, 7, 55)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignment.ts, 7, 79)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignment.ts, 7, 85)) + +foo(person); +>foo : Symbol(foo, Decl(objectLiteralShorthandPropertiesAssignment.ts, 3, 56)) +>person : Symbol(person, Decl(objectLiteralShorthandPropertiesAssignment.ts, 3, 3)) + +var person1 = bar("Hello", 5); +>person1 : Symbol(person1, Decl(objectLiteralShorthandPropertiesAssignment.ts, 10, 3)) +>bar : Symbol(bar, Decl(objectLiteralShorthandPropertiesAssignment.ts, 4, 46)) + +var person2: { name: string } = bar("Hello", 5); +>person2 : Symbol(person2, Decl(objectLiteralShorthandPropertiesAssignment.ts, 11, 3)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignment.ts, 11, 14)) +>bar : Symbol(bar, Decl(objectLiteralShorthandPropertiesAssignment.ts, 4, 46)) + +var person3: { name: string; id:number } = bar("Hello", 5); +>person3 : Symbol(person3, Decl(objectLiteralShorthandPropertiesAssignment.ts, 12, 3)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignment.ts, 12, 14)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignment.ts, 12, 28)) +>bar : Symbol(bar, Decl(objectLiteralShorthandPropertiesAssignment.ts, 4, 46)) + diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.types b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.types index 91d9e528d63..869a67fb22f 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.types +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.types @@ -1,9 +1,11 @@ === tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignment.ts === var id: number = 10000; >id : number +>10000 : number var name: string = "my name"; >name : string +>"my name" : string var person: { name: string; id: number } = { name, id }; >person : { name: string; id: number; } @@ -52,12 +54,16 @@ var person1 = bar("Hello", 5); >person1 : { name: string; id: number; } >bar("Hello", 5) : { name: string; id: number; } >bar : (name: string, id: number) => { name: string; id: number; } +>"Hello" : string +>5 : number var person2: { name: string } = bar("Hello", 5); >person2 : { name: string; } >name : string >bar("Hello", 5) : { name: string; id: number; } >bar : (name: string, id: number) => { name: string; id: number; } +>"Hello" : string +>5 : number var person3: { name: string; id:number } = bar("Hello", 5); >person3 : { name: string; id: number; } @@ -65,4 +71,6 @@ var person3: { name: string; id:number } = bar("Hello", 5); >id : number >bar("Hello", 5) : { name: string; id: number; } >bar : (name: string, id: number) => { name: string; id: number; } +>"Hello" : string +>5 : number diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.symbols b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.symbols new file mode 100644 index 00000000000..e444d177a79 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.symbols @@ -0,0 +1,60 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentES6.ts === +var id: number = 10000; +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 0, 3)) + +var name: string = "my name"; +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 1, 3)) + +var person: { name: string; id: number } = { name, id }; +>person : Symbol(person, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 3, 3)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 3, 13)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 3, 27)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 3, 44)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 3, 50)) + +function foo(obj: { name: string }): void { }; +>foo : Symbol(foo, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 3, 56)) +>obj : Symbol(obj, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 4, 13)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 4, 19)) + +function bar(name: string, id: number) { return { name, id }; } +>bar : Symbol(bar, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 4, 46)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 5, 13)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 5, 26)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 5, 49)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 5, 55)) + +function bar1(name: string, id: number) { return { name }; } +>bar1 : Symbol(bar1, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 5, 63)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 6, 14)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 6, 27)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 6, 50)) + +function baz(name: string, id: number): { name: string; id: number } { return { name, id }; } +>baz : Symbol(baz, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 6, 60)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 7, 13)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 7, 26)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 7, 41)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 7, 55)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 7, 79)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 7, 85)) + +foo(person); +>foo : Symbol(foo, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 3, 56)) +>person : Symbol(person, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 3, 3)) + +var person1 = bar("Hello", 5); +>person1 : Symbol(person1, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 10, 3)) +>bar : Symbol(bar, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 4, 46)) + +var person2: { name: string } = bar("Hello", 5); +>person2 : Symbol(person2, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 11, 3)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 11, 14)) +>bar : Symbol(bar, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 4, 46)) + +var person3: { name: string; id: number } = bar("Hello", 5); +>person3 : Symbol(person3, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 12, 3)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 12, 14)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 12, 28)) +>bar : Symbol(bar, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 4, 46)) + diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.types b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.types index 38791fc1beb..710fc430339 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.types +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.types @@ -1,9 +1,11 @@ === tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentES6.ts === var id: number = 10000; >id : number +>10000 : number var name: string = "my name"; >name : string +>"my name" : string var person: { name: string; id: number } = { name, id }; >person : { name: string; id: number; } @@ -52,12 +54,16 @@ var person1 = bar("Hello", 5); >person1 : { name: string; id: number; } >bar("Hello", 5) : { name: string; id: number; } >bar : (name: string, id: number) => { name: string; id: number; } +>"Hello" : string +>5 : number var person2: { name: string } = bar("Hello", 5); >person2 : { name: string; } >name : string >bar("Hello", 5) : { name: string; id: number; } >bar : (name: string, id: number) => { name: string; id: number; } +>"Hello" : string +>5 : number var person3: { name: string; id: number } = bar("Hello", 5); >person3 : { name: string; id: number; } @@ -65,4 +71,6 @@ var person3: { name: string; id: number } = bar("Hello", 5); >id : number >bar("Hello", 5) : { name: string; id: number; } >bar : (name: string, id: number) => { name: string; id: number; } +>"Hello" : string +>5 : number diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesES6.symbols b/tests/baselines/reference/objectLiteralShorthandPropertiesES6.symbols new file mode 100644 index 00000000000..2f9b50168c1 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesES6.symbols @@ -0,0 +1,46 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesES6.ts === +var a, b, c; +>a : Symbol(a, Decl(objectLiteralShorthandPropertiesES6.ts, 0, 3)) +>b : Symbol(b, Decl(objectLiteralShorthandPropertiesES6.ts, 0, 6)) +>c : Symbol(c, Decl(objectLiteralShorthandPropertiesES6.ts, 0, 9)) + +var x1 = { +>x1 : Symbol(x1, Decl(objectLiteralShorthandPropertiesES6.ts, 2, 3)) + + a +>a : Symbol(a, Decl(objectLiteralShorthandPropertiesES6.ts, 2, 10)) + +}; + +var x2 = { +>x2 : Symbol(x2, Decl(objectLiteralShorthandPropertiesES6.ts, 6, 3)) + + a, +>a : Symbol(a, Decl(objectLiteralShorthandPropertiesES6.ts, 6, 10)) +} + +var x3 = { +>x3 : Symbol(x3, Decl(objectLiteralShorthandPropertiesES6.ts, 10, 3)) + + a: 0, +>a : Symbol(a, Decl(objectLiteralShorthandPropertiesES6.ts, 10, 10)) + + b, +>b : Symbol(b, Decl(objectLiteralShorthandPropertiesES6.ts, 11, 9)) + + c, +>c : Symbol(c, Decl(objectLiteralShorthandPropertiesES6.ts, 12, 6)) + + d() { }, +>d : Symbol(d, Decl(objectLiteralShorthandPropertiesES6.ts, 13, 6)) + + x3, +>x3 : Symbol(x3, Decl(objectLiteralShorthandPropertiesES6.ts, 14, 12)) + + parent: x3 +>parent : Symbol(parent, Decl(objectLiteralShorthandPropertiesES6.ts, 15, 7)) +>x3 : Symbol(x3, Decl(objectLiteralShorthandPropertiesES6.ts, 10, 3)) + +}; + + diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesES6.types b/tests/baselines/reference/objectLiteralShorthandPropertiesES6.types index 5d5acc279a5..5c36262f695 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesES6.types +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesES6.types @@ -27,6 +27,7 @@ var x3 = { a: 0, >a : number +>0 : number b, >b : any diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.symbols b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.symbols new file mode 100644 index 00000000000..ba8b0eeb6a9 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.symbols @@ -0,0 +1,30 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument.ts === +var id: number = 10000; +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 0, 3)) + +var name: string = "my name"; +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 1, 3)) + +var person = { name, id }; +>person : Symbol(person, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 3, 3)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 3, 14)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 3, 20)) + +function foo(p: { name: string; id: number }) { } +>foo : Symbol(foo, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 3, 26)) +>p : Symbol(p, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 5, 13)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 5, 17)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 5, 31)) + +foo(person); +>foo : Symbol(foo, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 3, 26)) +>person : Symbol(person, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 3, 3)) + + +var obj = { name: name, id: id }; +>obj : Symbol(obj, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 9, 3)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 9, 11)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 1, 3)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 9, 23)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 0, 3)) + diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.types b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.types index 9b4261a74be..083d4118128 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.types +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.types @@ -1,9 +1,11 @@ === tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument.ts === var id: number = 10000; >id : number +>10000 : number var name: string = "my name"; >name : string +>"my name" : string var person = { name, id }; >person : { name: string; id: number; } diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.symbols b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.symbols new file mode 100644 index 00000000000..681036e2aef --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.symbols @@ -0,0 +1,30 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesWithModule.ts === +// module export + +module m { +>m : Symbol(m, Decl(objectLiteralShorthandPropertiesWithModule.ts, 0, 0), Decl(objectLiteralShorthandPropertiesWithModule.ts, 4, 1)) + + export var x; +>x : Symbol(x, Decl(objectLiteralShorthandPropertiesWithModule.ts, 3, 14)) +} + +module m { +>m : Symbol(m, Decl(objectLiteralShorthandPropertiesWithModule.ts, 0, 0), Decl(objectLiteralShorthandPropertiesWithModule.ts, 4, 1)) + + var z = x; +>z : Symbol(z, Decl(objectLiteralShorthandPropertiesWithModule.ts, 7, 7)) +>x : Symbol(x, Decl(objectLiteralShorthandPropertiesWithModule.ts, 3, 14)) + + var y = { +>y : Symbol(y, Decl(objectLiteralShorthandPropertiesWithModule.ts, 8, 7)) + + a: x, +>a : Symbol(a, Decl(objectLiteralShorthandPropertiesWithModule.ts, 8, 13)) +>x : Symbol(x, Decl(objectLiteralShorthandPropertiesWithModule.ts, 3, 14)) + + x +>x : Symbol(x, Decl(objectLiteralShorthandPropertiesWithModule.ts, 9, 13)) + + }; +} + diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.symbols b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.symbols new file mode 100644 index 00000000000..bcb69cc9a97 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesWithModuleES6.ts === + +module m { +>m : Symbol(m, Decl(objectLiteralShorthandPropertiesWithModuleES6.ts, 0, 0), Decl(objectLiteralShorthandPropertiesWithModuleES6.ts, 3, 1)) + + export var x; +>x : Symbol(x, Decl(objectLiteralShorthandPropertiesWithModuleES6.ts, 2, 14)) +} + +module m { +>m : Symbol(m, Decl(objectLiteralShorthandPropertiesWithModuleES6.ts, 0, 0), Decl(objectLiteralShorthandPropertiesWithModuleES6.ts, 3, 1)) + + var z = x; +>z : Symbol(z, Decl(objectLiteralShorthandPropertiesWithModuleES6.ts, 6, 7)) +>x : Symbol(x, Decl(objectLiteralShorthandPropertiesWithModuleES6.ts, 2, 14)) + + var y = { +>y : Symbol(y, Decl(objectLiteralShorthandPropertiesWithModuleES6.ts, 7, 7)) + + a: x, +>a : Symbol(a, Decl(objectLiteralShorthandPropertiesWithModuleES6.ts, 7, 13)) +>x : Symbol(x, Decl(objectLiteralShorthandPropertiesWithModuleES6.ts, 2, 14)) + + x +>x : Symbol(x, Decl(objectLiteralShorthandPropertiesWithModuleES6.ts, 8, 13)) + + }; +} + diff --git a/tests/baselines/reference/objectLiteralWidened.symbols b/tests/baselines/reference/objectLiteralWidened.symbols new file mode 100644 index 00000000000..0bf077cd9d8 --- /dev/null +++ b/tests/baselines/reference/objectLiteralWidened.symbols @@ -0,0 +1,31 @@ +=== tests/cases/conformance/types/typeRelationships/widenedTypes/objectLiteralWidened.ts === +// object literal properties are widened to any + +var x = { +>x : Symbol(x, Decl(objectLiteralWidened.ts, 2, 3)) + + foo: null, +>foo : Symbol(foo, Decl(objectLiteralWidened.ts, 2, 9)) + + bar: undefined +>bar : Symbol(bar, Decl(objectLiteralWidened.ts, 3, 14)) +>undefined : Symbol(undefined) +} + +var y = { +>y : Symbol(y, Decl(objectLiteralWidened.ts, 7, 3)) + + foo: null, +>foo : Symbol(foo, Decl(objectLiteralWidened.ts, 7, 9)) + + bar: { +>bar : Symbol(bar, Decl(objectLiteralWidened.ts, 8, 14)) + + baz: null, +>baz : Symbol(baz, Decl(objectLiteralWidened.ts, 9, 10)) + + boo: undefined +>boo : Symbol(boo, Decl(objectLiteralWidened.ts, 10, 18)) +>undefined : Symbol(undefined) + } +} diff --git a/tests/baselines/reference/objectLiteralWidened.types b/tests/baselines/reference/objectLiteralWidened.types index 3f9163e77ef..9f47e47795d 100644 --- a/tests/baselines/reference/objectLiteralWidened.types +++ b/tests/baselines/reference/objectLiteralWidened.types @@ -7,6 +7,7 @@ var x = { foo: null, >foo : null +>null : null bar: undefined >bar : undefined @@ -19,6 +20,7 @@ var y = { foo: null, >foo : null +>null : null bar: { >bar : { baz: null; boo: undefined; } @@ -26,6 +28,7 @@ var y = { baz: null, >baz : null +>null : null boo: undefined >boo : undefined diff --git a/tests/baselines/reference/objectMembersOnTypes.symbols b/tests/baselines/reference/objectMembersOnTypes.symbols new file mode 100644 index 00000000000..12cc909dcd9 --- /dev/null +++ b/tests/baselines/reference/objectMembersOnTypes.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/objectMembersOnTypes.ts === +interface I {} +>I : Symbol(I, Decl(objectMembersOnTypes.ts, 0, 0)) + +class AAA implements I { } +>AAA : Symbol(AAA, Decl(objectMembersOnTypes.ts, 0, 14)) +>I : Symbol(I, Decl(objectMembersOnTypes.ts, 0, 0)) + +var x: number; +>x : Symbol(x, Decl(objectMembersOnTypes.ts, 2, 3)) + +x.toString(); +>x.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>x : Symbol(x, Decl(objectMembersOnTypes.ts, 2, 3)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) + +var i: I; +>i : Symbol(i, Decl(objectMembersOnTypes.ts, 4, 3)) +>I : Symbol(I, Decl(objectMembersOnTypes.ts, 0, 0)) + +i.toString(); // used to be an error +>i.toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) +>i : Symbol(i, Decl(objectMembersOnTypes.ts, 4, 3)) +>toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) + +var c: AAA; +>c : Symbol(c, Decl(objectMembersOnTypes.ts, 6, 3)) +>AAA : Symbol(AAA, Decl(objectMembersOnTypes.ts, 0, 14)) + +c.toString(); // used to be an error +>c.toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) +>c : Symbol(c, Decl(objectMembersOnTypes.ts, 6, 3)) +>toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) + diff --git a/tests/baselines/reference/objectTypeHidingMembersOfObject.symbols b/tests/baselines/reference/objectTypeHidingMembersOfObject.symbols new file mode 100644 index 00000000000..5c88d538fdb --- /dev/null +++ b/tests/baselines/reference/objectTypeHidingMembersOfObject.symbols @@ -0,0 +1,63 @@ +=== tests/cases/conformance/types/members/objectTypeHidingMembersOfObject.ts === +// all of these valueOf calls should return the type shown in the overriding signatures here + +class C { +>C : Symbol(C, Decl(objectTypeHidingMembersOfObject.ts, 0, 0)) + + valueOf() { } +>valueOf : Symbol(valueOf, Decl(objectTypeHidingMembersOfObject.ts, 2, 9)) +} + +var c: C; +>c : Symbol(c, Decl(objectTypeHidingMembersOfObject.ts, 6, 3)) +>C : Symbol(C, Decl(objectTypeHidingMembersOfObject.ts, 0, 0)) + +var r1: void = c.valueOf(); +>r1 : Symbol(r1, Decl(objectTypeHidingMembersOfObject.ts, 7, 3)) +>c.valueOf : Symbol(C.valueOf, Decl(objectTypeHidingMembersOfObject.ts, 2, 9)) +>c : Symbol(c, Decl(objectTypeHidingMembersOfObject.ts, 6, 3)) +>valueOf : Symbol(C.valueOf, Decl(objectTypeHidingMembersOfObject.ts, 2, 9)) + +interface I { +>I : Symbol(I, Decl(objectTypeHidingMembersOfObject.ts, 7, 27)) + + valueOf(): void; +>valueOf : Symbol(valueOf, Decl(objectTypeHidingMembersOfObject.ts, 9, 13)) +} + +var i: I; +>i : Symbol(i, Decl(objectTypeHidingMembersOfObject.ts, 13, 3)) +>I : Symbol(I, Decl(objectTypeHidingMembersOfObject.ts, 7, 27)) + +var r2: void = i.valueOf(); +>r2 : Symbol(r2, Decl(objectTypeHidingMembersOfObject.ts, 14, 3)) +>i.valueOf : Symbol(I.valueOf, Decl(objectTypeHidingMembersOfObject.ts, 9, 13)) +>i : Symbol(i, Decl(objectTypeHidingMembersOfObject.ts, 13, 3)) +>valueOf : Symbol(I.valueOf, Decl(objectTypeHidingMembersOfObject.ts, 9, 13)) + +var a = { +>a : Symbol(a, Decl(objectTypeHidingMembersOfObject.ts, 16, 3)) + + valueOf: () => { } +>valueOf : Symbol(valueOf, Decl(objectTypeHidingMembersOfObject.ts, 16, 9)) +} + +var r3: void = a.valueOf(); +>r3 : Symbol(r3, Decl(objectTypeHidingMembersOfObject.ts, 20, 3)) +>a.valueOf : Symbol(valueOf, Decl(objectTypeHidingMembersOfObject.ts, 16, 9)) +>a : Symbol(a, Decl(objectTypeHidingMembersOfObject.ts, 16, 3)) +>valueOf : Symbol(valueOf, Decl(objectTypeHidingMembersOfObject.ts, 16, 9)) + +var b: { +>b : Symbol(b, Decl(objectTypeHidingMembersOfObject.ts, 22, 3)) + + valueOf(): void; +>valueOf : Symbol(valueOf, Decl(objectTypeHidingMembersOfObject.ts, 22, 8)) +} + +var r4: void = b.valueOf(); +>r4 : Symbol(r4, Decl(objectTypeHidingMembersOfObject.ts, 26, 3)) +>b.valueOf : Symbol(valueOf, Decl(objectTypeHidingMembersOfObject.ts, 22, 8)) +>b : Symbol(b, Decl(objectTypeHidingMembersOfObject.ts, 22, 3)) +>valueOf : Symbol(valueOf, Decl(objectTypeHidingMembersOfObject.ts, 22, 8)) + diff --git a/tests/baselines/reference/objectTypeLiteralSyntax.symbols b/tests/baselines/reference/objectTypeLiteralSyntax.symbols new file mode 100644 index 00000000000..da49cb22fd0 --- /dev/null +++ b/tests/baselines/reference/objectTypeLiteralSyntax.symbols @@ -0,0 +1,20 @@ +=== tests/cases/conformance/types/objectTypeLiteral/objectTypeLiteralSyntax.ts === +var x: { +>x : Symbol(x, Decl(objectTypeLiteralSyntax.ts, 0, 3)) + + foo: string; +>foo : Symbol(foo, Decl(objectTypeLiteralSyntax.ts, 0, 8)) + + bar: string; +>bar : Symbol(bar, Decl(objectTypeLiteralSyntax.ts, 1, 16)) +} + +var y: { +>y : Symbol(y, Decl(objectTypeLiteralSyntax.ts, 5, 3)) + + foo: string; +>foo : Symbol(foo, Decl(objectTypeLiteralSyntax.ts, 5, 8)) + + bar: string +>bar : Symbol(bar, Decl(objectTypeLiteralSyntax.ts, 6, 16)) +} diff --git a/tests/baselines/reference/objectTypePropertyAccess.symbols b/tests/baselines/reference/objectTypePropertyAccess.symbols new file mode 100644 index 00000000000..519bf589260 --- /dev/null +++ b/tests/baselines/reference/objectTypePropertyAccess.symbols @@ -0,0 +1,96 @@ +=== tests/cases/conformance/types/members/objectTypePropertyAccess.ts === +// Index notation should resolve to the type of a declared property with that same name +class C { +>C : Symbol(C, Decl(objectTypePropertyAccess.ts, 0, 0)) + + foo: string; +>foo : Symbol(foo, Decl(objectTypePropertyAccess.ts, 1, 9)) +} + +var c: C; +>c : Symbol(c, Decl(objectTypePropertyAccess.ts, 5, 3)) +>C : Symbol(C, Decl(objectTypePropertyAccess.ts, 0, 0)) + +var r1 = c.toString(); +>r1 : Symbol(r1, Decl(objectTypePropertyAccess.ts, 6, 3)) +>c.toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) +>c : Symbol(c, Decl(objectTypePropertyAccess.ts, 5, 3)) +>toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) + +var r2 = c['toString'](); +>r2 : Symbol(r2, Decl(objectTypePropertyAccess.ts, 7, 3)) +>c : Symbol(c, Decl(objectTypePropertyAccess.ts, 5, 3)) +>'toString' : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) + +var r3 = c.foo; +>r3 : Symbol(r3, Decl(objectTypePropertyAccess.ts, 8, 3)) +>c.foo : Symbol(C.foo, Decl(objectTypePropertyAccess.ts, 1, 9)) +>c : Symbol(c, Decl(objectTypePropertyAccess.ts, 5, 3)) +>foo : Symbol(C.foo, Decl(objectTypePropertyAccess.ts, 1, 9)) + +var r4 = c['foo']; +>r4 : Symbol(r4, Decl(objectTypePropertyAccess.ts, 9, 3), Decl(objectTypePropertyAccess.ts, 15, 3)) +>c : Symbol(c, Decl(objectTypePropertyAccess.ts, 5, 3)) +>'foo' : Symbol(C.foo, Decl(objectTypePropertyAccess.ts, 1, 9)) + +interface I { +>I : Symbol(I, Decl(objectTypePropertyAccess.ts, 9, 18)) + + bar: string; +>bar : Symbol(bar, Decl(objectTypePropertyAccess.ts, 11, 13)) +} +var i: I; +>i : Symbol(i, Decl(objectTypePropertyAccess.ts, 14, 3)) +>I : Symbol(I, Decl(objectTypePropertyAccess.ts, 9, 18)) + +var r4 = i.toString(); +>r4 : Symbol(r4, Decl(objectTypePropertyAccess.ts, 9, 3), Decl(objectTypePropertyAccess.ts, 15, 3)) +>i.toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) +>i : Symbol(i, Decl(objectTypePropertyAccess.ts, 14, 3)) +>toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) + +var r5 = i['toString'](); +>r5 : Symbol(r5, Decl(objectTypePropertyAccess.ts, 16, 3)) +>i : Symbol(i, Decl(objectTypePropertyAccess.ts, 14, 3)) +>'toString' : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) + +var r6 = i.bar; +>r6 : Symbol(r6, Decl(objectTypePropertyAccess.ts, 17, 3)) +>i.bar : Symbol(I.bar, Decl(objectTypePropertyAccess.ts, 11, 13)) +>i : Symbol(i, Decl(objectTypePropertyAccess.ts, 14, 3)) +>bar : Symbol(I.bar, Decl(objectTypePropertyAccess.ts, 11, 13)) + +var r7 = i['bar']; +>r7 : Symbol(r7, Decl(objectTypePropertyAccess.ts, 18, 3)) +>i : Symbol(i, Decl(objectTypePropertyAccess.ts, 14, 3)) +>'bar' : Symbol(I.bar, Decl(objectTypePropertyAccess.ts, 11, 13)) + +var a = { +>a : Symbol(a, Decl(objectTypePropertyAccess.ts, 20, 3)) + + foo: '' +>foo : Symbol(foo, Decl(objectTypePropertyAccess.ts, 20, 9)) +} + +var r8 = a.toString(); +>r8 : Symbol(r8, Decl(objectTypePropertyAccess.ts, 24, 3)) +>a.toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) +>a : Symbol(a, Decl(objectTypePropertyAccess.ts, 20, 3)) +>toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) + +var r9 = a['toString'](); +>r9 : Symbol(r9, Decl(objectTypePropertyAccess.ts, 25, 3)) +>a : Symbol(a, Decl(objectTypePropertyAccess.ts, 20, 3)) +>'toString' : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) + +var r10 = a.foo; +>r10 : Symbol(r10, Decl(objectTypePropertyAccess.ts, 26, 3)) +>a.foo : Symbol(foo, Decl(objectTypePropertyAccess.ts, 20, 9)) +>a : Symbol(a, Decl(objectTypePropertyAccess.ts, 20, 3)) +>foo : Symbol(foo, Decl(objectTypePropertyAccess.ts, 20, 9)) + +var r11 = a['foo']; +>r11 : Symbol(r11, Decl(objectTypePropertyAccess.ts, 27, 3)) +>a : Symbol(a, Decl(objectTypePropertyAccess.ts, 20, 3)) +>'foo' : Symbol(foo, Decl(objectTypePropertyAccess.ts, 20, 9)) + diff --git a/tests/baselines/reference/objectTypePropertyAccess.types b/tests/baselines/reference/objectTypePropertyAccess.types index 56e45f1bae0..5fc03bd86ed 100644 --- a/tests/baselines/reference/objectTypePropertyAccess.types +++ b/tests/baselines/reference/objectTypePropertyAccess.types @@ -23,6 +23,7 @@ var r2 = c['toString'](); >c['toString']() : string >c['toString'] : () => string >c : C +>'toString' : string var r3 = c.foo; >r3 : string @@ -34,6 +35,7 @@ var r4 = c['foo']; >r4 : string >c['foo'] : string >c : C +>'foo' : string interface I { >I : I @@ -57,6 +59,7 @@ var r5 = i['toString'](); >i['toString']() : string >i['toString'] : () => string >i : I +>'toString' : string var r6 = i.bar; >r6 : string @@ -68,6 +71,7 @@ var r7 = i['bar']; >r7 : string >i['bar'] : string >i : I +>'bar' : string var a = { >a : { foo: string; } @@ -75,6 +79,7 @@ var a = { foo: '' >foo : string +>'' : string } var r8 = a.toString(); @@ -89,6 +94,7 @@ var r9 = a['toString'](); >a['toString']() : string >a['toString'] : () => string >a : { foo: string; } +>'toString' : string var r10 = a.foo; >r10 : string @@ -100,4 +106,5 @@ var r11 = a['foo']; >r11 : string >a['foo'] : string >a : { foo: string; } +>'foo' : string diff --git a/tests/baselines/reference/objectTypeWithCallSignatureAppearsToBeFunctionType.symbols b/tests/baselines/reference/objectTypeWithCallSignatureAppearsToBeFunctionType.symbols new file mode 100644 index 00000000000..36127117f43 --- /dev/null +++ b/tests/baselines/reference/objectTypeWithCallSignatureAppearsToBeFunctionType.symbols @@ -0,0 +1,44 @@ +=== tests/cases/conformance/types/members/objectTypeWithCallSignatureAppearsToBeFunctionType.ts === +// objects with call signatures should be permitted where function types are expected +// no errors expected below + +interface I { +>I : Symbol(I, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 0, 0)) + + (): void; +} + +var i: I; +>i : Symbol(i, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 7, 3)) +>I : Symbol(I, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 0, 0)) + +var r2: void = i(); +>r2 : Symbol(r2, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 8, 3)) +>i : Symbol(i, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 7, 3)) + +var r2b: (x: any, y?: any) => any = i.apply; +>r2b : Symbol(r2b, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 9, 3)) +>x : Symbol(x, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 9, 10)) +>y : Symbol(y, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 9, 17)) +>i.apply : Symbol(Function.apply, Decl(lib.d.ts, 228, 20)) +>i : Symbol(i, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 7, 3)) +>apply : Symbol(Function.apply, Decl(lib.d.ts, 228, 20)) + +var b: { +>b : Symbol(b, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 11, 3)) + + (): void; +} + +var r4: void = b(); +>r4 : Symbol(r4, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 15, 3)) +>b : Symbol(b, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 11, 3)) + +var rb4: (x: any, y?: any) => any = b.apply; +>rb4 : Symbol(rb4, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 16, 3)) +>x : Symbol(x, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 16, 10)) +>y : Symbol(y, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 16, 17)) +>b.apply : Symbol(Function.apply, Decl(lib.d.ts, 228, 20)) +>b : Symbol(b, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 11, 3)) +>apply : Symbol(Function.apply, Decl(lib.d.ts, 228, 20)) + diff --git a/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.symbols b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.symbols new file mode 100644 index 00000000000..de1f2abc5aa --- /dev/null +++ b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.symbols @@ -0,0 +1,113 @@ +=== tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts === +// object types with call signatures can override members of Function +// no errors expected below + +interface Function { +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11), Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 0, 0)) + + data: number; +>data : Symbol(data, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 3, 20)) + + [x: string]: Object; +>x : Symbol(x, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 5, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +} + +interface I { +>I : Symbol(I, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 6, 1)) + + (): void; + apply(a: any, b?: any): void; +>apply : Symbol(apply, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 9, 13)) +>a : Symbol(a, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 10, 10)) +>b : Symbol(b, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 10, 17)) + + call(thisArg: number, ...argArray: number[]): any; +>call : Symbol(call, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 10, 33)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 11, 9)) +>argArray : Symbol(argArray, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 11, 25)) +} + +var i: I; +>i : Symbol(i, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 14, 3)) +>I : Symbol(I, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 6, 1)) + +var r1: (a: any, b?: any) => void = i.apply; +>r1 : Symbol(r1, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 15, 3)) +>a : Symbol(a, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 15, 9)) +>b : Symbol(b, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 15, 16)) +>i.apply : Symbol(I.apply, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 9, 13)) +>i : Symbol(i, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 14, 3)) +>apply : Symbol(I.apply, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 9, 13)) + +var r1b: (thisArg: number, ...argArray: number[]) => void = i.call; +>r1b : Symbol(r1b, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 16, 3)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 16, 10)) +>argArray : Symbol(argArray, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 16, 26)) +>i.call : Symbol(I.call, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 10, 33)) +>i : Symbol(i, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 14, 3)) +>call : Symbol(I.call, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 10, 33)) + +var r1c = i.arguments; +>r1c : Symbol(r1c, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 17, 3)) +>i.arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) +>i : Symbol(i, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 14, 3)) +>arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) + +var r1d = i.data; +>r1d : Symbol(r1d, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 18, 3)) +>i.data : Symbol(Function.data, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 3, 20)) +>i : Symbol(i, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 14, 3)) +>data : Symbol(Function.data, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 3, 20)) + +var r1e = i['hm']; // should be Object +>r1e : Symbol(r1e, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 19, 3)) +>i : Symbol(i, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 14, 3)) + +var x: { +>x : Symbol(x, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 21, 3)) + + (): void; + apply(a: any, b?: any): void; +>apply : Symbol(apply, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 22, 13)) +>a : Symbol(a, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 23, 10)) +>b : Symbol(b, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 23, 17)) + + call(thisArg: number, ...argArray: number[]): any; +>call : Symbol(call, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 23, 33)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 24, 9)) +>argArray : Symbol(argArray, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 24, 25)) +} + +var r2: (a: any, b?: any) => void = x.apply; +>r2 : Symbol(r2, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 27, 3)) +>a : Symbol(a, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 27, 9)) +>b : Symbol(b, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 27, 16)) +>x.apply : Symbol(apply, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 22, 13)) +>x : Symbol(x, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 21, 3)) +>apply : Symbol(apply, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 22, 13)) + +var r2b: (thisArg: number, ...argArray: number[]) => void = x.call; +>r2b : Symbol(r2b, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 28, 3)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 28, 10)) +>argArray : Symbol(argArray, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 28, 26)) +>x.call : Symbol(call, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 23, 33)) +>x : Symbol(x, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 21, 3)) +>call : Symbol(call, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 23, 33)) + +var r2c = x.arguments; +>r2c : Symbol(r2c, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 29, 3)) +>x.arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) +>x : Symbol(x, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 21, 3)) +>arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) + +var r2d = x.data; +>r2d : Symbol(r2d, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 30, 3)) +>x.data : Symbol(Function.data, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 3, 20)) +>x : Symbol(x, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 21, 3)) +>data : Symbol(Function.data, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 3, 20)) + +var r2e = x['hm']; // should be Object +>r2e : Symbol(r2e, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 31, 3)) +>x : Symbol(x, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 21, 3)) + diff --git a/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.types b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.types index 56635a8e399..93caca61bfa 100644 --- a/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.types +++ b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.types @@ -64,6 +64,7 @@ var r1e = i['hm']; // should be Object >r1e : any >i['hm'] : any >i : I +>'hm' : string var x: { >x : { (): void; apply(a: any, b?: any): void; call(thisArg: number, ...argArray: number[]): any; } @@ -112,4 +113,5 @@ var r2e = x['hm']; // should be Object >r2e : any >x['hm'] : any >x : { (): void; apply(a: any, b?: any): void; call(thisArg: number, ...argArray: number[]): any; } +>'hm' : string diff --git a/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunction.symbols b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunction.symbols new file mode 100644 index 00000000000..0ddebe0e68c --- /dev/null +++ b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunction.symbols @@ -0,0 +1,82 @@ +=== tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunction.ts === +// object types with call signatures can override members of Function +// no errors expected below + +interface I { +>I : Symbol(I, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 0, 0)) + + (): void; + apply(a: any, b?: any): void; +>apply : Symbol(apply, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 4, 13)) +>a : Symbol(a, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 5, 10)) +>b : Symbol(b, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 5, 17)) + + call(thisArg: number, ...argArray: number[]): any; +>call : Symbol(call, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 5, 33)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 6, 9)) +>argArray : Symbol(argArray, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 6, 25)) +} + +var i: I; +>i : Symbol(i, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 9, 3)) +>I : Symbol(I, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 0, 0)) + +var r1: (a: any, b?: any) => void = i.apply; +>r1 : Symbol(r1, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 10, 3)) +>a : Symbol(a, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 10, 9)) +>b : Symbol(b, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 10, 16)) +>i.apply : Symbol(I.apply, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 4, 13)) +>i : Symbol(i, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 9, 3)) +>apply : Symbol(I.apply, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 4, 13)) + +var r1b: (thisArg: number, ...argArray: number[]) => void = i.call; +>r1b : Symbol(r1b, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 11, 3)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 11, 10)) +>argArray : Symbol(argArray, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 11, 26)) +>i.call : Symbol(I.call, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 5, 33)) +>i : Symbol(i, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 9, 3)) +>call : Symbol(I.call, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 5, 33)) + +var r1c = i.arguments; +>r1c : Symbol(r1c, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 12, 3)) +>i.arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) +>i : Symbol(i, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 9, 3)) +>arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) + +var x: { +>x : Symbol(x, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 14, 3)) + + (): void; + apply(a: any, b?: any): void; +>apply : Symbol(apply, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 15, 13)) +>a : Symbol(a, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 16, 10)) +>b : Symbol(b, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 16, 17)) + + call(thisArg: number, ...argArray: number[]): any; +>call : Symbol(call, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 16, 33)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 17, 9)) +>argArray : Symbol(argArray, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 17, 25)) +} + +var r2: (a: any, b?: any) => void = x.apply; +>r2 : Symbol(r2, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 20, 3)) +>a : Symbol(a, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 20, 9)) +>b : Symbol(b, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 20, 16)) +>x.apply : Symbol(apply, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 15, 13)) +>x : Symbol(x, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 14, 3)) +>apply : Symbol(apply, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 15, 13)) + +var r2b: (thisArg: number, ...argArray: number[]) => void = x.call; +>r2b : Symbol(r2b, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 21, 3)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 21, 10)) +>argArray : Symbol(argArray, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 21, 26)) +>x.call : Symbol(call, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 16, 33)) +>x : Symbol(x, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 14, 3)) +>call : Symbol(call, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 16, 33)) + +var r2c = x.arguments; +>r2c : Symbol(r2c, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 22, 3)) +>x.arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) +>x : Symbol(x, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 14, 3)) +>arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) + diff --git a/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.symbols b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.symbols new file mode 100644 index 00000000000..57479c548ee --- /dev/null +++ b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.symbols @@ -0,0 +1,110 @@ +=== tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts === +interface Function { +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11), Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 0, 0)) + + data: number; +>data : Symbol(data, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 0, 20)) + + [x: string]: Object; +>x : Symbol(x, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 2, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +} + +interface I { +>I : Symbol(I, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 3, 1)) + + new(): number; + apply(a: any, b?: any): void; +>apply : Symbol(apply, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 6, 18)) +>a : Symbol(a, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 7, 10)) +>b : Symbol(b, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 7, 17)) + + call(thisArg: number, ...argArray: number[]): any; +>call : Symbol(call, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 7, 33)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 8, 9)) +>argArray : Symbol(argArray, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 8, 25)) +} + +var i: I; +>i : Symbol(i, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 11, 3)) +>I : Symbol(I, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 3, 1)) + +var r1: (a: any, b?: any) => void = i.apply; +>r1 : Symbol(r1, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 12, 3)) +>a : Symbol(a, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 12, 9)) +>b : Symbol(b, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 12, 16)) +>i.apply : Symbol(I.apply, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 6, 18)) +>i : Symbol(i, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 11, 3)) +>apply : Symbol(I.apply, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 6, 18)) + +var r1b: (thisArg: number, ...argArray: number[]) => void = i.call; +>r1b : Symbol(r1b, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 13, 3)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 13, 10)) +>argArray : Symbol(argArray, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 13, 26)) +>i.call : Symbol(I.call, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 7, 33)) +>i : Symbol(i, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 11, 3)) +>call : Symbol(I.call, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 7, 33)) + +var r1c = i.arguments; +>r1c : Symbol(r1c, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 14, 3)) +>i.arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) +>i : Symbol(i, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 11, 3)) +>arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) + +var r1d = i.data; +>r1d : Symbol(r1d, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 15, 3)) +>i.data : Symbol(Function.data, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 0, 20)) +>i : Symbol(i, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 11, 3)) +>data : Symbol(Function.data, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 0, 20)) + +var r1e = i['hm']; // should be Object +>r1e : Symbol(r1e, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 16, 3)) +>i : Symbol(i, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 11, 3)) + +var x: { +>x : Symbol(x, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 18, 3)) + + new(): number; + apply(a: any, b?: any): void; +>apply : Symbol(apply, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 19, 18)) +>a : Symbol(a, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 20, 10)) +>b : Symbol(b, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 20, 17)) + + call(thisArg: number, ...argArray: number[]): any; +>call : Symbol(call, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 20, 33)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 21, 9)) +>argArray : Symbol(argArray, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 21, 25)) +} + +var r2: (a: any, b?: any) => void = x.apply; +>r2 : Symbol(r2, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 24, 3)) +>a : Symbol(a, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 24, 9)) +>b : Symbol(b, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 24, 16)) +>x.apply : Symbol(apply, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 19, 18)) +>x : Symbol(x, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 18, 3)) +>apply : Symbol(apply, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 19, 18)) + +var r2b: (thisArg: number, ...argArray: number[]) => void = x.call; +>r2b : Symbol(r2b, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 25, 3)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 25, 10)) +>argArray : Symbol(argArray, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 25, 26)) +>x.call : Symbol(call, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 20, 33)) +>x : Symbol(x, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 18, 3)) +>call : Symbol(call, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 20, 33)) + +var r2c = x.arguments; +>r2c : Symbol(r2c, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 26, 3)) +>x.arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) +>x : Symbol(x, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 18, 3)) +>arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) + +var r2d = x.data; +>r2d : Symbol(r2d, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 27, 3)) +>x.data : Symbol(Function.data, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 0, 20)) +>x : Symbol(x, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 18, 3)) +>data : Symbol(Function.data, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 0, 20)) + +var r2e = x['hm']; // should be Object +>r2e : Symbol(r2e, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 28, 3)) +>x : Symbol(x, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 18, 3)) + diff --git a/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.types b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.types index b7d8294dd96..427b700fb59 100644 --- a/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.types +++ b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.types @@ -61,6 +61,7 @@ var r1e = i['hm']; // should be Object >r1e : any >i['hm'] : any >i : I +>'hm' : string var x: { >x : { new (): number; apply(a: any, b?: any): void; call(thisArg: number, ...argArray: number[]): any; } @@ -109,4 +110,5 @@ var r2e = x['hm']; // should be Object >r2e : any >x['hm'] : any >x : { new (): number; apply(a: any, b?: any): void; call(thisArg: number, ...argArray: number[]): any; } +>'hm' : string diff --git a/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunction.symbols b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunction.symbols new file mode 100644 index 00000000000..8478fd1d37c --- /dev/null +++ b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunction.symbols @@ -0,0 +1,79 @@ +=== tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMembersOfFunction.ts === +interface I { +>I : Symbol(I, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 0, 0)) + + new(): number; + apply(a: any, b?: any): void; +>apply : Symbol(apply, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 1, 18)) +>a : Symbol(a, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 2, 10)) +>b : Symbol(b, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 2, 17)) + + call(thisArg: number, ...argArray: number[]): any; +>call : Symbol(call, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 2, 33)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 3, 9)) +>argArray : Symbol(argArray, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 3, 25)) +} + +var i: I; +>i : Symbol(i, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 6, 3)) +>I : Symbol(I, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 0, 0)) + +var r1: (a: any, b?: any) => void = i.apply; +>r1 : Symbol(r1, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 7, 3)) +>a : Symbol(a, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 7, 9)) +>b : Symbol(b, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 7, 16)) +>i.apply : Symbol(I.apply, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 1, 18)) +>i : Symbol(i, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 6, 3)) +>apply : Symbol(I.apply, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 1, 18)) + +var r1b: (thisArg: number, ...argArray: number[]) => void = i.call; +>r1b : Symbol(r1b, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 8, 3)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 8, 10)) +>argArray : Symbol(argArray, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 8, 26)) +>i.call : Symbol(I.call, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 2, 33)) +>i : Symbol(i, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 6, 3)) +>call : Symbol(I.call, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 2, 33)) + +var r1c = i.arguments; +>r1c : Symbol(r1c, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 9, 3)) +>i.arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) +>i : Symbol(i, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 6, 3)) +>arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) + +var x: { +>x : Symbol(x, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 11, 3)) + + new(): number; + apply(a: any, b?: any): void; +>apply : Symbol(apply, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 12, 18)) +>a : Symbol(a, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 13, 10)) +>b : Symbol(b, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 13, 17)) + + call(thisArg: number, ...argArray: number[]): any; +>call : Symbol(call, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 13, 33)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 14, 9)) +>argArray : Symbol(argArray, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 14, 25)) +} + +var r2: (a: any, b?: any) => void = x.apply; +>r2 : Symbol(r2, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 17, 3)) +>a : Symbol(a, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 17, 9)) +>b : Symbol(b, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 17, 16)) +>x.apply : Symbol(apply, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 12, 18)) +>x : Symbol(x, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 11, 3)) +>apply : Symbol(apply, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 12, 18)) + +var r2b: (thisArg: number, ...argArray: number[]) => void = x.call; +>r2b : Symbol(r2b, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 18, 3)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 18, 10)) +>argArray : Symbol(argArray, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 18, 26)) +>x.call : Symbol(call, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 13, 33)) +>x : Symbol(x, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 11, 3)) +>call : Symbol(call, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 13, 33)) + +var r2c = x.arguments; +>r2c : Symbol(r2c, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 19, 3)) +>x.arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) +>x : Symbol(x, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 11, 3)) +>arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) + diff --git a/tests/baselines/reference/objectTypeWithNumericProperty.symbols b/tests/baselines/reference/objectTypeWithNumericProperty.symbols new file mode 100644 index 00000000000..20e54fe1c64 --- /dev/null +++ b/tests/baselines/reference/objectTypeWithNumericProperty.symbols @@ -0,0 +1,119 @@ +=== tests/cases/conformance/types/members/objectTypeWithNumericProperty.ts === +// no errors here + +class C { +>C : Symbol(C, Decl(objectTypeWithNumericProperty.ts, 0, 0)) + + 1: number; + 1.1: string; +} + +var c: C; +>c : Symbol(c, Decl(objectTypeWithNumericProperty.ts, 7, 3)) +>C : Symbol(C, Decl(objectTypeWithNumericProperty.ts, 0, 0)) + +var r1 = c[1]; +>r1 : Symbol(r1, Decl(objectTypeWithNumericProperty.ts, 8, 3), Decl(objectTypeWithNumericProperty.ts, 19, 3), Decl(objectTypeWithNumericProperty.ts, 29, 3), Decl(objectTypeWithNumericProperty.ts, 39, 3)) +>c : Symbol(c, Decl(objectTypeWithNumericProperty.ts, 7, 3)) +>1 : Symbol(C.1, Decl(objectTypeWithNumericProperty.ts, 2, 9)) + +var r2 = c[1.1]; +>r2 : Symbol(r2, Decl(objectTypeWithNumericProperty.ts, 9, 3), Decl(objectTypeWithNumericProperty.ts, 20, 3), Decl(objectTypeWithNumericProperty.ts, 30, 3), Decl(objectTypeWithNumericProperty.ts, 40, 3)) +>c : Symbol(c, Decl(objectTypeWithNumericProperty.ts, 7, 3)) +>1.1 : Symbol(C.1.1, Decl(objectTypeWithNumericProperty.ts, 3, 14)) + +var r3 = c['1']; +>r3 : Symbol(r3, Decl(objectTypeWithNumericProperty.ts, 10, 3), Decl(objectTypeWithNumericProperty.ts, 21, 3), Decl(objectTypeWithNumericProperty.ts, 31, 3), Decl(objectTypeWithNumericProperty.ts, 41, 3)) +>c : Symbol(c, Decl(objectTypeWithNumericProperty.ts, 7, 3)) +>'1' : Symbol(C.1, Decl(objectTypeWithNumericProperty.ts, 2, 9)) + +var r4 = c['1.1']; +>r4 : Symbol(r4, Decl(objectTypeWithNumericProperty.ts, 11, 3), Decl(objectTypeWithNumericProperty.ts, 22, 3), Decl(objectTypeWithNumericProperty.ts, 32, 3), Decl(objectTypeWithNumericProperty.ts, 42, 3)) +>c : Symbol(c, Decl(objectTypeWithNumericProperty.ts, 7, 3)) +>'1.1' : Symbol(C.1.1, Decl(objectTypeWithNumericProperty.ts, 3, 14)) + +interface I { +>I : Symbol(I, Decl(objectTypeWithNumericProperty.ts, 11, 18)) + + 1: number; + 1.1: string; +} + +var i: I; +>i : Symbol(i, Decl(objectTypeWithNumericProperty.ts, 18, 3)) +>I : Symbol(I, Decl(objectTypeWithNumericProperty.ts, 11, 18)) + +var r1 = i[1]; +>r1 : Symbol(r1, Decl(objectTypeWithNumericProperty.ts, 8, 3), Decl(objectTypeWithNumericProperty.ts, 19, 3), Decl(objectTypeWithNumericProperty.ts, 29, 3), Decl(objectTypeWithNumericProperty.ts, 39, 3)) +>i : Symbol(i, Decl(objectTypeWithNumericProperty.ts, 18, 3)) +>1 : Symbol(I.1, Decl(objectTypeWithNumericProperty.ts, 13, 13)) + +var r2 = i[1.1]; +>r2 : Symbol(r2, Decl(objectTypeWithNumericProperty.ts, 9, 3), Decl(objectTypeWithNumericProperty.ts, 20, 3), Decl(objectTypeWithNumericProperty.ts, 30, 3), Decl(objectTypeWithNumericProperty.ts, 40, 3)) +>i : Symbol(i, Decl(objectTypeWithNumericProperty.ts, 18, 3)) +>1.1 : Symbol(I.1.1, Decl(objectTypeWithNumericProperty.ts, 14, 14)) + +var r3 = i['1']; +>r3 : Symbol(r3, Decl(objectTypeWithNumericProperty.ts, 10, 3), Decl(objectTypeWithNumericProperty.ts, 21, 3), Decl(objectTypeWithNumericProperty.ts, 31, 3), Decl(objectTypeWithNumericProperty.ts, 41, 3)) +>i : Symbol(i, Decl(objectTypeWithNumericProperty.ts, 18, 3)) +>'1' : Symbol(I.1, Decl(objectTypeWithNumericProperty.ts, 13, 13)) + +var r4 = i['1.1']; +>r4 : Symbol(r4, Decl(objectTypeWithNumericProperty.ts, 11, 3), Decl(objectTypeWithNumericProperty.ts, 22, 3), Decl(objectTypeWithNumericProperty.ts, 32, 3), Decl(objectTypeWithNumericProperty.ts, 42, 3)) +>i : Symbol(i, Decl(objectTypeWithNumericProperty.ts, 18, 3)) +>'1.1' : Symbol(I.1.1, Decl(objectTypeWithNumericProperty.ts, 14, 14)) + +var a: { +>a : Symbol(a, Decl(objectTypeWithNumericProperty.ts, 24, 3)) + + 1: number; + 1.1: string; +} + +var r1 = a[1]; +>r1 : Symbol(r1, Decl(objectTypeWithNumericProperty.ts, 8, 3), Decl(objectTypeWithNumericProperty.ts, 19, 3), Decl(objectTypeWithNumericProperty.ts, 29, 3), Decl(objectTypeWithNumericProperty.ts, 39, 3)) +>a : Symbol(a, Decl(objectTypeWithNumericProperty.ts, 24, 3)) +>1 : Symbol(1, Decl(objectTypeWithNumericProperty.ts, 24, 8)) + +var r2 = a[1.1]; +>r2 : Symbol(r2, Decl(objectTypeWithNumericProperty.ts, 9, 3), Decl(objectTypeWithNumericProperty.ts, 20, 3), Decl(objectTypeWithNumericProperty.ts, 30, 3), Decl(objectTypeWithNumericProperty.ts, 40, 3)) +>a : Symbol(a, Decl(objectTypeWithNumericProperty.ts, 24, 3)) +>1.1 : Symbol(1.1, Decl(objectTypeWithNumericProperty.ts, 25, 14)) + +var r3 = a['1']; +>r3 : Symbol(r3, Decl(objectTypeWithNumericProperty.ts, 10, 3), Decl(objectTypeWithNumericProperty.ts, 21, 3), Decl(objectTypeWithNumericProperty.ts, 31, 3), Decl(objectTypeWithNumericProperty.ts, 41, 3)) +>a : Symbol(a, Decl(objectTypeWithNumericProperty.ts, 24, 3)) +>'1' : Symbol(1, Decl(objectTypeWithNumericProperty.ts, 24, 8)) + +var r4 = a['1.1']; +>r4 : Symbol(r4, Decl(objectTypeWithNumericProperty.ts, 11, 3), Decl(objectTypeWithNumericProperty.ts, 22, 3), Decl(objectTypeWithNumericProperty.ts, 32, 3), Decl(objectTypeWithNumericProperty.ts, 42, 3)) +>a : Symbol(a, Decl(objectTypeWithNumericProperty.ts, 24, 3)) +>'1.1' : Symbol(1.1, Decl(objectTypeWithNumericProperty.ts, 25, 14)) + +var b = { +>b : Symbol(b, Decl(objectTypeWithNumericProperty.ts, 34, 3)) + + 1: 1, + 1.1: "" +} + +var r1 = b[1]; +>r1 : Symbol(r1, Decl(objectTypeWithNumericProperty.ts, 8, 3), Decl(objectTypeWithNumericProperty.ts, 19, 3), Decl(objectTypeWithNumericProperty.ts, 29, 3), Decl(objectTypeWithNumericProperty.ts, 39, 3)) +>b : Symbol(b, Decl(objectTypeWithNumericProperty.ts, 34, 3)) +>1 : Symbol(1, Decl(objectTypeWithNumericProperty.ts, 34, 9)) + +var r2 = b[1.1]; +>r2 : Symbol(r2, Decl(objectTypeWithNumericProperty.ts, 9, 3), Decl(objectTypeWithNumericProperty.ts, 20, 3), Decl(objectTypeWithNumericProperty.ts, 30, 3), Decl(objectTypeWithNumericProperty.ts, 40, 3)) +>b : Symbol(b, Decl(objectTypeWithNumericProperty.ts, 34, 3)) +>1.1 : Symbol(1.1, Decl(objectTypeWithNumericProperty.ts, 35, 9)) + +var r3 = b['1']; +>r3 : Symbol(r3, Decl(objectTypeWithNumericProperty.ts, 10, 3), Decl(objectTypeWithNumericProperty.ts, 21, 3), Decl(objectTypeWithNumericProperty.ts, 31, 3), Decl(objectTypeWithNumericProperty.ts, 41, 3)) +>b : Symbol(b, Decl(objectTypeWithNumericProperty.ts, 34, 3)) +>'1' : Symbol(1, Decl(objectTypeWithNumericProperty.ts, 34, 9)) + +var r4 = b['1.1']; +>r4 : Symbol(r4, Decl(objectTypeWithNumericProperty.ts, 11, 3), Decl(objectTypeWithNumericProperty.ts, 22, 3), Decl(objectTypeWithNumericProperty.ts, 32, 3), Decl(objectTypeWithNumericProperty.ts, 42, 3)) +>b : Symbol(b, Decl(objectTypeWithNumericProperty.ts, 34, 3)) +>'1.1' : Symbol(1.1, Decl(objectTypeWithNumericProperty.ts, 35, 9)) + diff --git a/tests/baselines/reference/objectTypeWithNumericProperty.types b/tests/baselines/reference/objectTypeWithNumericProperty.types index 7c507cd4f64..32efd3398fb 100644 --- a/tests/baselines/reference/objectTypeWithNumericProperty.types +++ b/tests/baselines/reference/objectTypeWithNumericProperty.types @@ -16,21 +16,25 @@ var r1 = c[1]; >r1 : number >c[1] : number >c : C +>1 : number var r2 = c[1.1]; >r2 : string >c[1.1] : string >c : C +>1.1 : number var r3 = c['1']; >r3 : number >c['1'] : number >c : C +>'1' : string var r4 = c['1.1']; >r4 : string >c['1.1'] : string >c : C +>'1.1' : string interface I { >I : I @@ -47,21 +51,25 @@ var r1 = i[1]; >r1 : number >i[1] : number >i : I +>1 : number var r2 = i[1.1]; >r2 : string >i[1.1] : string >i : I +>1.1 : number var r3 = i['1']; >r3 : number >i['1'] : number >i : I +>'1' : string var r4 = i['1.1']; >r4 : string >i['1.1'] : string >i : I +>'1.1' : string var a: { >a : { 1: number; 1.1: string; } @@ -74,47 +82,58 @@ var r1 = a[1]; >r1 : number >a[1] : number >a : { 1: number; 1.1: string; } +>1 : number var r2 = a[1.1]; >r2 : string >a[1.1] : string >a : { 1: number; 1.1: string; } +>1.1 : number var r3 = a['1']; >r3 : number >a['1'] : number >a : { 1: number; 1.1: string; } +>'1' : string var r4 = a['1.1']; >r4 : string >a['1.1'] : string >a : { 1: number; 1.1: string; } +>'1.1' : string var b = { >b : { 1: number; 1.1: string; } >{ 1: 1, 1.1: ""} : { 1: number; 1.1: string; } 1: 1, +>1 : number + 1.1: "" +>"" : string } var r1 = b[1]; >r1 : number >b[1] : number >b : { 1: number; 1.1: string; } +>1 : number var r2 = b[1.1]; >r2 : string >b[1.1] : string >b : { 1: number; 1.1: string; } +>1.1 : number var r3 = b['1']; >r3 : number >b['1'] : number >b : { 1: number; 1.1: string; } +>'1' : string var r4 = b['1.1']; >r4 : string >b['1.1'] : string >b : { 1: number; 1.1: string; } +>'1.1' : string diff --git a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.symbols b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.symbols new file mode 100644 index 00000000000..c95105a8626 --- /dev/null +++ b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.symbols @@ -0,0 +1,421 @@ +=== tests/cases/conformance/types/members/objectTypeWithStringNamedNumericProperty.ts === + +// string named numeric properties are legal and distinct when indexed by string values +// indexed numerically the value is converted to a number +// no errors expected below + +class C { +>C : Symbol(C, Decl(objectTypeWithStringNamedNumericProperty.ts, 0, 0)) + + "0.1": void; + ".1": Object; +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + "1": number; + "1.": string; + "1..": boolean; + "1.0": Date; +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + "-1.0": RegExp; +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) + + "-1": Date; +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +} + +var c: C; +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>C : Symbol(C, Decl(objectTypeWithStringNamedNumericProperty.ts, 0, 0)) + +var r1 = c['0.1']; +>r1 : Symbol(r1, Decl(objectTypeWithStringNamedNumericProperty.ts, 17, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 48, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 78, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 108, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>'0.1' : Symbol(C."0.1", Decl(objectTypeWithStringNamedNumericProperty.ts, 5, 9)) + +var r2 = c['.1']; +>r2 : Symbol(r2, Decl(objectTypeWithStringNamedNumericProperty.ts, 18, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 49, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 79, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 109, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>'.1' : Symbol(C.".1", Decl(objectTypeWithStringNamedNumericProperty.ts, 6, 16)) + +var r3 = c['1']; +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>'1' : Symbol(C."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 7, 17)) + +var r3 = c[1]; +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>1 : Symbol(C."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 7, 17)) + +var r4 = c['1.']; +>r4 : Symbol(r4, Decl(objectTypeWithStringNamedNumericProperty.ts, 21, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 52, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 82, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 112, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>'1.' : Symbol(C."1.", Decl(objectTypeWithStringNamedNumericProperty.ts, 8, 16)) + +var r3 = c[1.]; // same as indexing by 1 when done numerically +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>1. : Symbol(C."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 7, 17)) + +var r5 = c['1..']; +>r5 : Symbol(r5, Decl(objectTypeWithStringNamedNumericProperty.ts, 23, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 54, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 84, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 114, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>'1..' : Symbol(C."1..", Decl(objectTypeWithStringNamedNumericProperty.ts, 9, 17)) + +var r6 = c['1.0']; +>r6 : Symbol(r6, Decl(objectTypeWithStringNamedNumericProperty.ts, 24, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 55, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 85, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 115, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>'1.0' : Symbol(C."1.0", Decl(objectTypeWithStringNamedNumericProperty.ts, 10, 19)) + +var r3 = c[1.0]; // same as indexing by 1 when done numerically +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>1.0 : Symbol(C."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 7, 17)) + +// BUG 823822 +var r7 = i[-1]; +>r7 : Symbol(r7, Decl(objectTypeWithStringNamedNumericProperty.ts, 27, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 28, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 58, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 59, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 88, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 89, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 118, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 119, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var r7 = i[-1.0]; +>r7 : Symbol(r7, Decl(objectTypeWithStringNamedNumericProperty.ts, 27, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 28, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 58, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 59, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 88, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 89, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 118, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 119, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var r8 = i["-1.0"]; +>r8 : Symbol(r8, Decl(objectTypeWithStringNamedNumericProperty.ts, 29, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 60, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 90, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 120, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>"-1.0" : Symbol(I."-1.0", Decl(objectTypeWithStringNamedNumericProperty.ts, 42, 16)) + +var r9 = i["-1"]; +>r9 : Symbol(r9, Decl(objectTypeWithStringNamedNumericProperty.ts, 30, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 61, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 91, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 121, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>"-1" : Symbol(I."-1", Decl(objectTypeWithStringNamedNumericProperty.ts, 43, 19)) + +var r10 = i[0x1] +>r10 : Symbol(r10, Decl(objectTypeWithStringNamedNumericProperty.ts, 31, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 62, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 92, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 122, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>0x1 : Symbol(I."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 38, 17)) + +var r11 = i[-0x1] +>r11 : Symbol(r11, Decl(objectTypeWithStringNamedNumericProperty.ts, 32, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 63, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 93, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 123, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var r12 = i[01] +>r12 : Symbol(r12, Decl(objectTypeWithStringNamedNumericProperty.ts, 33, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 64, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 94, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 124, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>01 : Symbol(I."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 38, 17)) + +var r13 = i[-01] +>r13 : Symbol(r13, Decl(objectTypeWithStringNamedNumericProperty.ts, 34, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 65, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 95, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 125, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +interface I { +>I : Symbol(I, Decl(objectTypeWithStringNamedNumericProperty.ts, 34, 16)) + + "0.1": void; + ".1": Object; +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + "1": number; + "1.": string; + "1..": boolean; + "1.0": Date; +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + "-1.0": RegExp; +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) + + "-1": Date; +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +} + +var i: I; +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>I : Symbol(I, Decl(objectTypeWithStringNamedNumericProperty.ts, 34, 16)) + +var r1 = i['0.1']; +>r1 : Symbol(r1, Decl(objectTypeWithStringNamedNumericProperty.ts, 17, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 48, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 78, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 108, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>'0.1' : Symbol(I."0.1", Decl(objectTypeWithStringNamedNumericProperty.ts, 36, 13)) + +var r2 = i['.1']; +>r2 : Symbol(r2, Decl(objectTypeWithStringNamedNumericProperty.ts, 18, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 49, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 79, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 109, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>'.1' : Symbol(I.".1", Decl(objectTypeWithStringNamedNumericProperty.ts, 37, 16)) + +var r3 = i['1']; +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>'1' : Symbol(I."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 38, 17)) + +var r3 = c[1]; +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>1 : Symbol(C."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 7, 17)) + +var r4 = i['1.']; +>r4 : Symbol(r4, Decl(objectTypeWithStringNamedNumericProperty.ts, 21, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 52, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 82, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 112, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>'1.' : Symbol(I."1.", Decl(objectTypeWithStringNamedNumericProperty.ts, 39, 16)) + +var r3 = c[1.]; // same as indexing by 1 when done numerically +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>1. : Symbol(C."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 7, 17)) + +var r5 = i['1..']; +>r5 : Symbol(r5, Decl(objectTypeWithStringNamedNumericProperty.ts, 23, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 54, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 84, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 114, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>'1..' : Symbol(I."1..", Decl(objectTypeWithStringNamedNumericProperty.ts, 40, 17)) + +var r6 = i['1.0']; +>r6 : Symbol(r6, Decl(objectTypeWithStringNamedNumericProperty.ts, 24, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 55, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 85, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 115, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>'1.0' : Symbol(I."1.0", Decl(objectTypeWithStringNamedNumericProperty.ts, 41, 19)) + +var r3 = c[1.0]; // same as indexing by 1 when done numerically +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>1.0 : Symbol(C."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 7, 17)) + +// BUG 823822 +var r7 = i[-1]; +>r7 : Symbol(r7, Decl(objectTypeWithStringNamedNumericProperty.ts, 27, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 28, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 58, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 59, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 88, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 89, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 118, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 119, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var r7 = i[-1.0]; +>r7 : Symbol(r7, Decl(objectTypeWithStringNamedNumericProperty.ts, 27, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 28, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 58, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 59, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 88, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 89, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 118, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 119, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var r8 = i["-1.0"]; +>r8 : Symbol(r8, Decl(objectTypeWithStringNamedNumericProperty.ts, 29, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 60, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 90, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 120, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>"-1.0" : Symbol(I."-1.0", Decl(objectTypeWithStringNamedNumericProperty.ts, 42, 16)) + +var r9 = i["-1"]; +>r9 : Symbol(r9, Decl(objectTypeWithStringNamedNumericProperty.ts, 30, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 61, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 91, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 121, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>"-1" : Symbol(I."-1", Decl(objectTypeWithStringNamedNumericProperty.ts, 43, 19)) + +var r10 = i[0x1] +>r10 : Symbol(r10, Decl(objectTypeWithStringNamedNumericProperty.ts, 31, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 62, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 92, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 122, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>0x1 : Symbol(I."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 38, 17)) + +var r11 = i[-0x1] +>r11 : Symbol(r11, Decl(objectTypeWithStringNamedNumericProperty.ts, 32, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 63, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 93, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 123, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var r12 = i[01] +>r12 : Symbol(r12, Decl(objectTypeWithStringNamedNumericProperty.ts, 33, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 64, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 94, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 124, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>01 : Symbol(I."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 38, 17)) + +var r13 = i[-01] +>r13 : Symbol(r13, Decl(objectTypeWithStringNamedNumericProperty.ts, 34, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 65, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 95, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 125, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var a: { +>a : Symbol(a, Decl(objectTypeWithStringNamedNumericProperty.ts, 67, 3)) + + "0.1": void; + ".1": Object; +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + "1": number; + "1.": string; + "1..": boolean; + "1.0": Date; +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + "-1.0": RegExp; +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) + + "-1": Date; +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +} + +var r1 = a['0.1']; +>r1 : Symbol(r1, Decl(objectTypeWithStringNamedNumericProperty.ts, 17, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 48, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 78, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 108, 3)) +>a : Symbol(a, Decl(objectTypeWithStringNamedNumericProperty.ts, 67, 3)) +>'0.1' : Symbol("0.1", Decl(objectTypeWithStringNamedNumericProperty.ts, 67, 8)) + +var r2 = a['.1']; +>r2 : Symbol(r2, Decl(objectTypeWithStringNamedNumericProperty.ts, 18, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 49, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 79, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 109, 3)) +>a : Symbol(a, Decl(objectTypeWithStringNamedNumericProperty.ts, 67, 3)) +>'.1' : Symbol(".1", Decl(objectTypeWithStringNamedNumericProperty.ts, 68, 16)) + +var r3 = a['1']; +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>a : Symbol(a, Decl(objectTypeWithStringNamedNumericProperty.ts, 67, 3)) +>'1' : Symbol("1", Decl(objectTypeWithStringNamedNumericProperty.ts, 69, 17)) + +var r3 = c[1]; +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>1 : Symbol(C."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 7, 17)) + +var r4 = a['1.']; +>r4 : Symbol(r4, Decl(objectTypeWithStringNamedNumericProperty.ts, 21, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 52, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 82, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 112, 3)) +>a : Symbol(a, Decl(objectTypeWithStringNamedNumericProperty.ts, 67, 3)) +>'1.' : Symbol("1.", Decl(objectTypeWithStringNamedNumericProperty.ts, 70, 16)) + +var r3 = c[1.]; // same as indexing by 1 when done numerically +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>1. : Symbol(C."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 7, 17)) + +var r5 = a['1..']; +>r5 : Symbol(r5, Decl(objectTypeWithStringNamedNumericProperty.ts, 23, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 54, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 84, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 114, 3)) +>a : Symbol(a, Decl(objectTypeWithStringNamedNumericProperty.ts, 67, 3)) +>'1..' : Symbol("1..", Decl(objectTypeWithStringNamedNumericProperty.ts, 71, 17)) + +var r6 = a['1.0']; +>r6 : Symbol(r6, Decl(objectTypeWithStringNamedNumericProperty.ts, 24, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 55, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 85, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 115, 3)) +>a : Symbol(a, Decl(objectTypeWithStringNamedNumericProperty.ts, 67, 3)) +>'1.0' : Symbol("1.0", Decl(objectTypeWithStringNamedNumericProperty.ts, 72, 19)) + +var r3 = c[1.0]; // same as indexing by 1 when done numerically +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>1.0 : Symbol(C."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 7, 17)) + +// BUG 823822 +var r7 = i[-1]; +>r7 : Symbol(r7, Decl(objectTypeWithStringNamedNumericProperty.ts, 27, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 28, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 58, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 59, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 88, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 89, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 118, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 119, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var r7 = i[-1.0]; +>r7 : Symbol(r7, Decl(objectTypeWithStringNamedNumericProperty.ts, 27, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 28, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 58, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 59, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 88, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 89, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 118, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 119, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var r8 = i["-1.0"]; +>r8 : Symbol(r8, Decl(objectTypeWithStringNamedNumericProperty.ts, 29, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 60, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 90, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 120, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>"-1.0" : Symbol(I."-1.0", Decl(objectTypeWithStringNamedNumericProperty.ts, 42, 16)) + +var r9 = i["-1"]; +>r9 : Symbol(r9, Decl(objectTypeWithStringNamedNumericProperty.ts, 30, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 61, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 91, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 121, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>"-1" : Symbol(I."-1", Decl(objectTypeWithStringNamedNumericProperty.ts, 43, 19)) + +var r10 = i[0x1] +>r10 : Symbol(r10, Decl(objectTypeWithStringNamedNumericProperty.ts, 31, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 62, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 92, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 122, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>0x1 : Symbol(I."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 38, 17)) + +var r11 = i[-0x1] +>r11 : Symbol(r11, Decl(objectTypeWithStringNamedNumericProperty.ts, 32, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 63, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 93, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 123, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var r12 = i[01] +>r12 : Symbol(r12, Decl(objectTypeWithStringNamedNumericProperty.ts, 33, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 64, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 94, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 124, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>01 : Symbol(I."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 38, 17)) + +var r13 = i[-01] +>r13 : Symbol(r13, Decl(objectTypeWithStringNamedNumericProperty.ts, 34, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 65, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 95, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 125, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var b = { +>b : Symbol(b, Decl(objectTypeWithStringNamedNumericProperty.ts, 97, 3)) + + "0.1": null, + ".1": new Object(), +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + "1": 1, + "1.": "", + "1..": true, + "1.0": new Date(), +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + "-1.0": /123/, + "-1": Date +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +}; + +var r1 = b['0.1']; +>r1 : Symbol(r1, Decl(objectTypeWithStringNamedNumericProperty.ts, 17, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 48, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 78, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 108, 3)) +>b : Symbol(b, Decl(objectTypeWithStringNamedNumericProperty.ts, 97, 3)) +>'0.1' : Symbol("0.1", Decl(objectTypeWithStringNamedNumericProperty.ts, 97, 9)) + +var r2 = b['.1']; +>r2 : Symbol(r2, Decl(objectTypeWithStringNamedNumericProperty.ts, 18, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 49, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 79, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 109, 3)) +>b : Symbol(b, Decl(objectTypeWithStringNamedNumericProperty.ts, 97, 3)) +>'.1' : Symbol(".1", Decl(objectTypeWithStringNamedNumericProperty.ts, 98, 22)) + +var r3 = b['1']; +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>b : Symbol(b, Decl(objectTypeWithStringNamedNumericProperty.ts, 97, 3)) +>'1' : Symbol("1", Decl(objectTypeWithStringNamedNumericProperty.ts, 99, 23)) + +var r3 = c[1]; +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>1 : Symbol(C."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 7, 17)) + +var r4 = b['1.']; +>r4 : Symbol(r4, Decl(objectTypeWithStringNamedNumericProperty.ts, 21, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 52, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 82, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 112, 3)) +>b : Symbol(b, Decl(objectTypeWithStringNamedNumericProperty.ts, 97, 3)) +>'1.' : Symbol("1.", Decl(objectTypeWithStringNamedNumericProperty.ts, 100, 11)) + +var r3 = c[1.]; // same as indexing by 1 when done numerically +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>1. : Symbol(C."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 7, 17)) + +var r5 = b['1..']; +>r5 : Symbol(r5, Decl(objectTypeWithStringNamedNumericProperty.ts, 23, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 54, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 84, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 114, 3)) +>b : Symbol(b, Decl(objectTypeWithStringNamedNumericProperty.ts, 97, 3)) +>'1..' : Symbol("1..", Decl(objectTypeWithStringNamedNumericProperty.ts, 101, 13)) + +var r6 = b['1.0']; +>r6 : Symbol(r6, Decl(objectTypeWithStringNamedNumericProperty.ts, 24, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 55, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 85, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 115, 3)) +>b : Symbol(b, Decl(objectTypeWithStringNamedNumericProperty.ts, 97, 3)) +>'1.0' : Symbol("1.0", Decl(objectTypeWithStringNamedNumericProperty.ts, 102, 16)) + +var r3 = c[1.0]; // same as indexing by 1 when done numerically +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>1.0 : Symbol(C."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 7, 17)) + +// BUG 823822 +var r7 = i[-1]; +>r7 : Symbol(r7, Decl(objectTypeWithStringNamedNumericProperty.ts, 27, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 28, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 58, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 59, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 88, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 89, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 118, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 119, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var r7 = i[-1.0]; +>r7 : Symbol(r7, Decl(objectTypeWithStringNamedNumericProperty.ts, 27, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 28, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 58, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 59, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 88, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 89, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 118, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 119, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var r8 = i["-1.0"]; +>r8 : Symbol(r8, Decl(objectTypeWithStringNamedNumericProperty.ts, 29, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 60, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 90, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 120, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>"-1.0" : Symbol(I."-1.0", Decl(objectTypeWithStringNamedNumericProperty.ts, 42, 16)) + +var r9 = i["-1"]; +>r9 : Symbol(r9, Decl(objectTypeWithStringNamedNumericProperty.ts, 30, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 61, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 91, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 121, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>"-1" : Symbol(I."-1", Decl(objectTypeWithStringNamedNumericProperty.ts, 43, 19)) + +var r10 = i[0x1] +>r10 : Symbol(r10, Decl(objectTypeWithStringNamedNumericProperty.ts, 31, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 62, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 92, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 122, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>0x1 : Symbol(I."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 38, 17)) + +var r11 = i[-0x1] +>r11 : Symbol(r11, Decl(objectTypeWithStringNamedNumericProperty.ts, 32, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 63, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 93, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 123, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var r12 = i[01] +>r12 : Symbol(r12, Decl(objectTypeWithStringNamedNumericProperty.ts, 33, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 64, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 94, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 124, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>01 : Symbol(I."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 38, 17)) + +var r13 = i[-01] +>r13 : Symbol(r13, Decl(objectTypeWithStringNamedNumericProperty.ts, 34, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 65, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 95, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 125, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + diff --git a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.types b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.types index 74b5550fecb..490f3101751 100644 --- a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.types +++ b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.types @@ -32,46 +32,55 @@ var r1 = c['0.1']; >r1 : void >c['0.1'] : void >c : C +>'0.1' : string var r2 = c['.1']; >r2 : Object >c['.1'] : Object >c : C +>'.1' : string var r3 = c['1']; >r3 : number >c['1'] : number >c : C +>'1' : string var r3 = c[1]; >r3 : number >c[1] : number >c : C +>1 : number var r4 = c['1.']; >r4 : string >c['1.'] : string >c : C +>'1.' : string var r3 = c[1.]; // same as indexing by 1 when done numerically >r3 : number >c[1.] : number >c : C +>1. : number var r5 = c['1..']; >r5 : boolean >c['1..'] : boolean >c : C +>'1..' : string var r6 = c['1.0']; >r6 : Date >c['1.0'] : Date >c : C +>'1.0' : string var r3 = c[1.0]; // same as indexing by 1 when done numerically >r3 : number >c[1.0] : number >c : C +>1.0 : number // BUG 823822 var r7 = i[-1]; @@ -79,44 +88,52 @@ var r7 = i[-1]; >i[-1] : any >i : I >-1 : number +>1 : number var r7 = i[-1.0]; >r7 : any >i[-1.0] : any >i : I >-1.0 : number +>1.0 : number var r8 = i["-1.0"]; >r8 : RegExp >i["-1.0"] : RegExp >i : I +>"-1.0" : string var r9 = i["-1"]; >r9 : Date >i["-1"] : Date >i : I +>"-1" : string var r10 = i[0x1] >r10 : number >i[0x1] : number >i : I +>0x1 : number var r11 = i[-0x1] >r11 : any >i[-0x1] : any >i : I >-0x1 : number +>0x1 : number var r12 = i[01] >r12 : number >i[01] : number >i : I +>01 : number var r13 = i[-01] >r13 : any >i[-01] : any >i : I >-01 : number +>01 : number interface I { >I : I @@ -146,46 +163,55 @@ var r1 = i['0.1']; >r1 : void >i['0.1'] : void >i : I +>'0.1' : string var r2 = i['.1']; >r2 : Object >i['.1'] : Object >i : I +>'.1' : string var r3 = i['1']; >r3 : number >i['1'] : number >i : I +>'1' : string var r3 = c[1]; >r3 : number >c[1] : number >c : C +>1 : number var r4 = i['1.']; >r4 : string >i['1.'] : string >i : I +>'1.' : string var r3 = c[1.]; // same as indexing by 1 when done numerically >r3 : number >c[1.] : number >c : C +>1. : number var r5 = i['1..']; >r5 : boolean >i['1..'] : boolean >i : I +>'1..' : string var r6 = i['1.0']; >r6 : Date >i['1.0'] : Date >i : I +>'1.0' : string var r3 = c[1.0]; // same as indexing by 1 when done numerically >r3 : number >c[1.0] : number >c : C +>1.0 : number // BUG 823822 var r7 = i[-1]; @@ -193,44 +219,52 @@ var r7 = i[-1]; >i[-1] : any >i : I >-1 : number +>1 : number var r7 = i[-1.0]; >r7 : any >i[-1.0] : any >i : I >-1.0 : number +>1.0 : number var r8 = i["-1.0"]; >r8 : RegExp >i["-1.0"] : RegExp >i : I +>"-1.0" : string var r9 = i["-1"]; >r9 : Date >i["-1"] : Date >i : I +>"-1" : string var r10 = i[0x1] >r10 : number >i[0x1] : number >i : I +>0x1 : number var r11 = i[-0x1] >r11 : any >i[-0x1] : any >i : I >-0x1 : number +>0x1 : number var r12 = i[01] >r12 : number >i[01] : number >i : I +>01 : number var r13 = i[-01] >r13 : any >i[-01] : any >i : I >-01 : number +>01 : number var a: { >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } @@ -256,46 +290,55 @@ var r1 = a['0.1']; >r1 : void >a['0.1'] : void >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } +>'0.1' : string var r2 = a['.1']; >r2 : Object >a['.1'] : Object >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } +>'.1' : string var r3 = a['1']; >r3 : number >a['1'] : number >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } +>'1' : string var r3 = c[1]; >r3 : number >c[1] : number >c : C +>1 : number var r4 = a['1.']; >r4 : string >a['1.'] : string >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } +>'1.' : string var r3 = c[1.]; // same as indexing by 1 when done numerically >r3 : number >c[1.] : number >c : C +>1. : number var r5 = a['1..']; >r5 : boolean >a['1..'] : boolean >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } +>'1..' : string var r6 = a['1.0']; >r6 : Date >a['1.0'] : Date >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } +>'1.0' : string var r3 = c[1.0]; // same as indexing by 1 when done numerically >r3 : number >c[1.0] : number >c : C +>1.0 : number // BUG 823822 var r7 = i[-1]; @@ -303,44 +346,52 @@ var r7 = i[-1]; >i[-1] : any >i : I >-1 : number +>1 : number var r7 = i[-1.0]; >r7 : any >i[-1.0] : any >i : I >-1.0 : number +>1.0 : number var r8 = i["-1.0"]; >r8 : RegExp >i["-1.0"] : RegExp >i : I +>"-1.0" : string var r9 = i["-1"]; >r9 : Date >i["-1"] : Date >i : I +>"-1" : string var r10 = i[0x1] >r10 : number >i[0x1] : number >i : I +>0x1 : number var r11 = i[-0x1] >r11 : any >i[-0x1] : any >i : I >-0x1 : number +>0x1 : number var r12 = i[01] >r12 : number >i[01] : number >i : I +>01 : number var r13 = i[-01] >r13 : any >i[-01] : any >i : I >-01 : number +>01 : number var b = { >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } @@ -348,19 +399,28 @@ var b = { "0.1": null, >null : void +>null : null ".1": new Object(), >new Object() : Object >Object : ObjectConstructor "1": 1, +>1 : number + "1.": "", +>"" : string + "1..": true, +>true : boolean + "1.0": new Date(), >new Date() : Date >Date : DateConstructor "-1.0": /123/, +>/123/ : RegExp + "-1": Date >Date : DateConstructor @@ -370,46 +430,55 @@ var r1 = b['0.1']; >r1 : void >b['0.1'] : void >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } +>'0.1' : string var r2 = b['.1']; >r2 : Object >b['.1'] : Object >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } +>'.1' : string var r3 = b['1']; >r3 : number >b['1'] : number >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } +>'1' : string var r3 = c[1]; >r3 : number >c[1] : number >c : C +>1 : number var r4 = b['1.']; >r4 : string >b['1.'] : string >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } +>'1.' : string var r3 = c[1.]; // same as indexing by 1 when done numerically >r3 : number >c[1.] : number >c : C +>1. : number var r5 = b['1..']; >r5 : boolean >b['1..'] : boolean >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } +>'1..' : string var r6 = b['1.0']; >r6 : Date >b['1.0'] : Date >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } +>'1.0' : string var r3 = c[1.0]; // same as indexing by 1 when done numerically >r3 : number >c[1.0] : number >c : C +>1.0 : number // BUG 823822 var r7 = i[-1]; @@ -417,42 +486,50 @@ var r7 = i[-1]; >i[-1] : any >i : I >-1 : number +>1 : number var r7 = i[-1.0]; >r7 : any >i[-1.0] : any >i : I >-1.0 : number +>1.0 : number var r8 = i["-1.0"]; >r8 : RegExp >i["-1.0"] : RegExp >i : I +>"-1.0" : string var r9 = i["-1"]; >r9 : Date >i["-1"] : Date >i : I +>"-1" : string var r10 = i[0x1] >r10 : number >i[0x1] : number >i : I +>0x1 : number var r11 = i[-0x1] >r11 : any >i[-0x1] : any >i : I >-0x1 : number +>0x1 : number var r12 = i[01] >r12 : number >i[01] : number >i : I +>01 : number var r13 = i[-01] >r13 : any >i[-01] : any >i : I >-01 : number +>01 : number diff --git a/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.symbols b/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.symbols new file mode 100644 index 00000000000..aa76e7e92c8 --- /dev/null +++ b/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.symbols @@ -0,0 +1,124 @@ +=== tests/cases/conformance/types/members/objectTypeWithStringNamedPropertyOfIllegalCharacters.ts === +class C { +>C : Symbol(C, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 0, 0)) + + " ": number; + "a b": string; + "~!@#$%^&*()_+{}|:'<>?\/.,`": number; + "a\a": number; + static "a ": number +} + +var c: C; +>c : Symbol(c, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 8, 3)) +>C : Symbol(C, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 0, 0)) + +var r = c[" "]; +>r : Symbol(r, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 9, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 22, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 35, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 47, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 8, 3)) +>" " : Symbol(C." ", Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 0, 9)) + +var r2 = c[" "]; +>r2 : Symbol(r2, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 10, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 23, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 36, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 48, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 8, 3)) + +var r3 = c["a b"]; +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 11, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 24, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 37, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 49, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 8, 3)) +>"a b" : Symbol(C."a b", Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 1, 18)) + +// BUG 817263 +var r4 = c["~!@#$%^&*()_+{}|:'<>?\/.,`"]; +>r4 : Symbol(r4, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 13, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 26, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 39, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 51, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 8, 3)) +>"~!@#$%^&*()_+{}|:'<>?\/.,`" : Symbol(C."~!@#$%^&*()_+{}|:'<>?\/.,`", Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 2, 20)) + +interface I { +>I : Symbol(I, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 13, 41)) + + " ": number; + "a b": string; + "~!@#$%^&*()_+{}|:'<>?\/.,`": number; +} + +var i: I; +>i : Symbol(i, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 21, 3)) +>I : Symbol(I, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 13, 41)) + +var r = i[" "]; +>r : Symbol(r, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 9, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 22, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 35, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 47, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 21, 3)) +>" " : Symbol(I." ", Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 15, 13)) + +var r2 = i[" "]; +>r2 : Symbol(r2, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 10, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 23, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 36, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 48, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 21, 3)) + +var r3 = i["a b"]; +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 11, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 24, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 37, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 49, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 21, 3)) +>"a b" : Symbol(I."a b", Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 16, 18)) + +// BUG 817263 +var r4 = i["~!@#$%^&*()_+{}|:'<>?\/.,`"]; +>r4 : Symbol(r4, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 13, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 26, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 39, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 51, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 21, 3)) +>"~!@#$%^&*()_+{}|:'<>?\/.,`" : Symbol(I."~!@#$%^&*()_+{}|:'<>?\/.,`", Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 17, 20)) + + +var a: { +>a : Symbol(a, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 29, 3)) + + " ": number; + "a b": string; + "~!@#$%^&*()_+{}|:'<>?\/.,`": number; +} + +var r = a[" "]; +>r : Symbol(r, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 9, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 22, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 35, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 47, 3)) +>a : Symbol(a, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 29, 3)) +>" " : Symbol(" ", Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 29, 8)) + +var r2 = a[" "]; +>r2 : Symbol(r2, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 10, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 23, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 36, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 48, 3)) +>a : Symbol(a, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 29, 3)) + +var r3 = a["a b"]; +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 11, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 24, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 37, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 49, 3)) +>a : Symbol(a, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 29, 3)) +>"a b" : Symbol("a b", Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 30, 18)) + +// BUG 817263 +var r4 = a["~!@#$%^&*()_+{}|:'<>?\/.,`"]; +>r4 : Symbol(r4, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 13, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 26, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 39, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 51, 3)) +>a : Symbol(a, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 29, 3)) +>"~!@#$%^&*()_+{}|:'<>?\/.,`" : Symbol("~!@#$%^&*()_+{}|:'<>?\/.,`", Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 31, 20)) + +var b = { +>b : Symbol(b, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 41, 3)) + + " ": 1, + "a b": "", + "~!@#$%^&*()_+{}|:'<>?\/.,`": 1, +} + +var r = b[" "]; +>r : Symbol(r, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 9, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 22, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 35, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 47, 3)) +>b : Symbol(b, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 41, 3)) +>" " : Symbol(" ", Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 41, 9)) + +var r2 = b[" "]; +>r2 : Symbol(r2, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 10, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 23, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 36, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 48, 3)) +>b : Symbol(b, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 41, 3)) + +var r3 = b["a b"]; +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 11, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 24, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 37, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 49, 3)) +>b : Symbol(b, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 41, 3)) +>"a b" : Symbol("a b", Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 42, 13)) + +// BUG 817263 +var r4 = b["~!@#$%^&*()_+{}|:'<>?\/.,`"]; +>r4 : Symbol(r4, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 13, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 26, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 39, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 51, 3)) +>b : Symbol(b, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 41, 3)) +>"~!@#$%^&*()_+{}|:'<>?\/.,`" : Symbol("~!@#$%^&*()_+{}|:'<>?\/.,`", Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 43, 16)) + diff --git a/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.types b/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.types index fce2b03f53f..b676d284e70 100644 --- a/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.types +++ b/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.types @@ -17,22 +17,26 @@ var r = c[" "]; >r : number >c[" "] : number >c : C +>" " : string var r2 = c[" "]; >r2 : any >c[" "] : any >c : C +>" " : string var r3 = c["a b"]; >r3 : string >c["a b"] : string >c : C +>"a b" : string // BUG 817263 var r4 = c["~!@#$%^&*()_+{}|:'<>?\/.,`"]; >r4 : number >c["~!@#$%^&*()_+{}|:'<>?\/.,`"] : number >c : C +>"~!@#$%^&*()_+{}|:'<>?\/.,`" : string interface I { >I : I @@ -50,22 +54,26 @@ var r = i[" "]; >r : number >i[" "] : number >i : I +>" " : string var r2 = i[" "]; >r2 : any >i[" "] : any >i : I +>" " : string var r3 = i["a b"]; >r3 : string >i["a b"] : string >i : I +>"a b" : string // BUG 817263 var r4 = i["~!@#$%^&*()_+{}|:'<>?\/.,`"]; >r4 : number >i["~!@#$%^&*()_+{}|:'<>?\/.,`"] : number >i : I +>"~!@#$%^&*()_+{}|:'<>?\/.,`" : string var a: { @@ -80,50 +88,63 @@ var r = a[" "]; >r : number >a[" "] : number >a : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } +>" " : string var r2 = a[" "]; >r2 : any >a[" "] : any >a : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } +>" " : string var r3 = a["a b"]; >r3 : string >a["a b"] : string >a : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } +>"a b" : string // BUG 817263 var r4 = a["~!@#$%^&*()_+{}|:'<>?\/.,`"]; >r4 : number >a["~!@#$%^&*()_+{}|:'<>?\/.,`"] : number >a : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } +>"~!@#$%^&*()_+{}|:'<>?\/.,`" : string var b = { >b : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } >{ " ": 1, "a b": "", "~!@#$%^&*()_+{}|:'<>?\/.,`": 1,} : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } " ": 1, +>1 : number + "a b": "", +>"" : string + "~!@#$%^&*()_+{}|:'<>?\/.,`": 1, +>1 : number } var r = b[" "]; >r : number >b[" "] : number >b : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } +>" " : string var r2 = b[" "]; >r2 : any >b[" "] : any >b : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } +>" " : string var r3 = b["a b"]; >r3 : string >b["a b"] : string >b : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } +>"a b" : string // BUG 817263 var r4 = b["~!@#$%^&*()_+{}|:'<>?\/.,`"]; >r4 : number >b["~!@#$%^&*()_+{}|:'<>?\/.,`"] : number >b : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } +>"~!@#$%^&*()_+{}|:'<>?\/.,`" : string diff --git a/tests/baselines/reference/objectTypesIdentity.symbols b/tests/baselines/reference/objectTypesIdentity.symbols new file mode 100644 index 00000000000..a39b47acf55 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentity.symbols @@ -0,0 +1,279 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentity.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentity.ts, 0, 0)) + + foo: string; +>foo : Symbol(foo, Decl(objectTypesIdentity.ts, 2, 9)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentity.ts, 4, 1)) + + foo: string; +>foo : Symbol(foo, Decl(objectTypesIdentity.ts, 6, 9)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentity.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentity.ts, 10, 8)) + + foo: T; +>foo : Symbol(foo, Decl(objectTypesIdentity.ts, 10, 12)) +>T : Symbol(T, Decl(objectTypesIdentity.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentity.ts, 12, 1)) + + foo: string; +>foo : Symbol(foo, Decl(objectTypesIdentity.ts, 14, 13)) +} + +var a: { foo: string; } +>a : Symbol(a, Decl(objectTypesIdentity.ts, 18, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentity.ts, 18, 8)) + +var b = { foo: '' }; +>b : Symbol(b, Decl(objectTypesIdentity.ts, 19, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentity.ts, 19, 9)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentity.ts, 19, 20), Decl(objectTypesIdentity.ts, 21, 20), Decl(objectTypesIdentity.ts, 22, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 21, 14)) +>A : Symbol(A, Decl(objectTypesIdentity.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentity.ts, 19, 20), Decl(objectTypesIdentity.ts, 21, 20), Decl(objectTypesIdentity.ts, 22, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 22, 14)) +>A : Symbol(A, Decl(objectTypesIdentity.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentity.ts, 19, 20), Decl(objectTypesIdentity.ts, 21, 20), Decl(objectTypesIdentity.ts, 22, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 23, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentity.ts, 23, 25), Decl(objectTypesIdentity.ts, 25, 21), Decl(objectTypesIdentity.ts, 26, 21)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 25, 15)) +>B : Symbol(B, Decl(objectTypesIdentity.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentity.ts, 23, 25), Decl(objectTypesIdentity.ts, 25, 21), Decl(objectTypesIdentity.ts, 26, 21)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 26, 15)) +>B : Symbol(B, Decl(objectTypesIdentity.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentity.ts, 23, 25), Decl(objectTypesIdentity.ts, 25, 21), Decl(objectTypesIdentity.ts, 26, 21)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 27, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentity.ts, 27, 26), Decl(objectTypesIdentity.ts, 29, 29), Decl(objectTypesIdentity.ts, 30, 29)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 29, 15)) +>C : Symbol(C, Decl(objectTypesIdentity.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentity.ts, 27, 26), Decl(objectTypesIdentity.ts, 29, 29), Decl(objectTypesIdentity.ts, 30, 29)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 30, 15)) +>C : Symbol(C, Decl(objectTypesIdentity.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentity.ts, 27, 26), Decl(objectTypesIdentity.ts, 29, 29), Decl(objectTypesIdentity.ts, 30, 29)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 31, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentity.ts, 31, 26), Decl(objectTypesIdentity.ts, 33, 20), Decl(objectTypesIdentity.ts, 34, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 33, 14)) +>I : Symbol(I, Decl(objectTypesIdentity.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentity.ts, 31, 26), Decl(objectTypesIdentity.ts, 33, 20), Decl(objectTypesIdentity.ts, 34, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 34, 14)) +>I : Symbol(I, Decl(objectTypesIdentity.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentity.ts, 31, 26), Decl(objectTypesIdentity.ts, 33, 20), Decl(objectTypesIdentity.ts, 34, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 35, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentity.ts, 35, 25), Decl(objectTypesIdentity.ts, 37, 27), Decl(objectTypesIdentity.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 37, 14)) +>a : Symbol(a, Decl(objectTypesIdentity.ts, 18, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentity.ts, 35, 25), Decl(objectTypesIdentity.ts, 37, 27), Decl(objectTypesIdentity.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 38, 14)) +>a : Symbol(a, Decl(objectTypesIdentity.ts, 18, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentity.ts, 35, 25), Decl(objectTypesIdentity.ts, 37, 27), Decl(objectTypesIdentity.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 39, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentity.ts, 39, 25), Decl(objectTypesIdentity.ts, 41, 27), Decl(objectTypesIdentity.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 41, 14)) +>b : Symbol(b, Decl(objectTypesIdentity.ts, 19, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentity.ts, 39, 25), Decl(objectTypesIdentity.ts, 41, 27), Decl(objectTypesIdentity.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 42, 14)) +>b : Symbol(b, Decl(objectTypesIdentity.ts, 19, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentity.ts, 39, 25), Decl(objectTypesIdentity.ts, 41, 27), Decl(objectTypesIdentity.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 43, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentity.ts, 43, 25), Decl(objectTypesIdentity.ts, 45, 20), Decl(objectTypesIdentity.ts, 46, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 45, 14)) +>A : Symbol(A, Decl(objectTypesIdentity.ts, 0, 0)) + +function foo5(x: B); // error +>foo5 : Symbol(foo5, Decl(objectTypesIdentity.ts, 43, 25), Decl(objectTypesIdentity.ts, 45, 20), Decl(objectTypesIdentity.ts, 46, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 46, 14)) +>B : Symbol(B, Decl(objectTypesIdentity.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentity.ts, 43, 25), Decl(objectTypesIdentity.ts, 45, 20), Decl(objectTypesIdentity.ts, 46, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 47, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentity.ts, 47, 25), Decl(objectTypesIdentity.ts, 49, 21), Decl(objectTypesIdentity.ts, 50, 29)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 49, 15)) +>A : Symbol(A, Decl(objectTypesIdentity.ts, 0, 0)) + +function foo5b(x: C); // error +>foo5b : Symbol(foo5b, Decl(objectTypesIdentity.ts, 47, 25), Decl(objectTypesIdentity.ts, 49, 21), Decl(objectTypesIdentity.ts, 50, 29)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 50, 15)) +>C : Symbol(C, Decl(objectTypesIdentity.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentity.ts, 47, 25), Decl(objectTypesIdentity.ts, 49, 21), Decl(objectTypesIdentity.ts, 50, 29)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 51, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentity.ts, 51, 26), Decl(objectTypesIdentity.ts, 53, 20), Decl(objectTypesIdentity.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 53, 14)) +>A : Symbol(A, Decl(objectTypesIdentity.ts, 0, 0)) + +function foo6(x: I); // error +>foo6 : Symbol(foo6, Decl(objectTypesIdentity.ts, 51, 26), Decl(objectTypesIdentity.ts, 53, 20), Decl(objectTypesIdentity.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 54, 14)) +>I : Symbol(I, Decl(objectTypesIdentity.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentity.ts, 51, 26), Decl(objectTypesIdentity.ts, 53, 20), Decl(objectTypesIdentity.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 55, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentity.ts, 55, 25), Decl(objectTypesIdentity.ts, 57, 20), Decl(objectTypesIdentity.ts, 58, 27)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 57, 14)) +>A : Symbol(A, Decl(objectTypesIdentity.ts, 0, 0)) + +function foo7(x: typeof a); // error +>foo7 : Symbol(foo7, Decl(objectTypesIdentity.ts, 55, 25), Decl(objectTypesIdentity.ts, 57, 20), Decl(objectTypesIdentity.ts, 58, 27)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 58, 14)) +>a : Symbol(a, Decl(objectTypesIdentity.ts, 18, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentity.ts, 55, 25), Decl(objectTypesIdentity.ts, 57, 20), Decl(objectTypesIdentity.ts, 58, 27)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 59, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentity.ts, 59, 25), Decl(objectTypesIdentity.ts, 61, 20), Decl(objectTypesIdentity.ts, 62, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 61, 14)) +>B : Symbol(B, Decl(objectTypesIdentity.ts, 4, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentity.ts, 59, 25), Decl(objectTypesIdentity.ts, 61, 20), Decl(objectTypesIdentity.ts, 62, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 62, 14)) +>I : Symbol(I, Decl(objectTypesIdentity.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentity.ts, 59, 25), Decl(objectTypesIdentity.ts, 61, 20), Decl(objectTypesIdentity.ts, 62, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 63, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentity.ts, 63, 25), Decl(objectTypesIdentity.ts, 65, 20), Decl(objectTypesIdentity.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 65, 14)) +>B : Symbol(B, Decl(objectTypesIdentity.ts, 4, 1)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentity.ts, 63, 25), Decl(objectTypesIdentity.ts, 65, 20), Decl(objectTypesIdentity.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 66, 14)) +>C : Symbol(C, Decl(objectTypesIdentity.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentity.ts, 63, 25), Decl(objectTypesIdentity.ts, 65, 20), Decl(objectTypesIdentity.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 67, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentity.ts, 67, 25), Decl(objectTypesIdentity.ts, 69, 21), Decl(objectTypesIdentity.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 69, 15)) +>B : Symbol(B, Decl(objectTypesIdentity.ts, 4, 1)) + +function foo10(x: typeof a); // error +>foo10 : Symbol(foo10, Decl(objectTypesIdentity.ts, 67, 25), Decl(objectTypesIdentity.ts, 69, 21), Decl(objectTypesIdentity.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 70, 15)) +>a : Symbol(a, Decl(objectTypesIdentity.ts, 18, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentity.ts, 67, 25), Decl(objectTypesIdentity.ts, 69, 21), Decl(objectTypesIdentity.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 71, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentity.ts, 71, 26), Decl(objectTypesIdentity.ts, 73, 21), Decl(objectTypesIdentity.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 73, 15)) +>B : Symbol(B, Decl(objectTypesIdentity.ts, 4, 1)) + +function foo11(x: typeof b); // error +>foo11 : Symbol(foo11, Decl(objectTypesIdentity.ts, 71, 26), Decl(objectTypesIdentity.ts, 73, 21), Decl(objectTypesIdentity.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 74, 15)) +>b : Symbol(b, Decl(objectTypesIdentity.ts, 19, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentity.ts, 71, 26), Decl(objectTypesIdentity.ts, 73, 21), Decl(objectTypesIdentity.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 75, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentity.ts, 75, 26), Decl(objectTypesIdentity.ts, 77, 21), Decl(objectTypesIdentity.ts, 78, 29)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 77, 15)) +>I : Symbol(I, Decl(objectTypesIdentity.ts, 12, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentity.ts, 75, 26), Decl(objectTypesIdentity.ts, 77, 21), Decl(objectTypesIdentity.ts, 78, 29)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 78, 15)) +>C : Symbol(C, Decl(objectTypesIdentity.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentity.ts, 75, 26), Decl(objectTypesIdentity.ts, 77, 21), Decl(objectTypesIdentity.ts, 78, 29)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 79, 15)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentity.ts, 79, 26), Decl(objectTypesIdentity.ts, 81, 21), Decl(objectTypesIdentity.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 81, 15)) +>I : Symbol(I, Decl(objectTypesIdentity.ts, 12, 1)) + +function foo13(x: typeof a); // error +>foo13 : Symbol(foo13, Decl(objectTypesIdentity.ts, 79, 26), Decl(objectTypesIdentity.ts, 81, 21), Decl(objectTypesIdentity.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 82, 15)) +>a : Symbol(a, Decl(objectTypesIdentity.ts, 18, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentity.ts, 79, 26), Decl(objectTypesIdentity.ts, 81, 21), Decl(objectTypesIdentity.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 83, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentity.ts, 83, 26), Decl(objectTypesIdentity.ts, 85, 21), Decl(objectTypesIdentity.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 85, 15)) +>I : Symbol(I, Decl(objectTypesIdentity.ts, 12, 1)) + +function foo14(x: typeof b); // error +>foo14 : Symbol(foo14, Decl(objectTypesIdentity.ts, 83, 26), Decl(objectTypesIdentity.ts, 85, 21), Decl(objectTypesIdentity.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 86, 15)) +>b : Symbol(b, Decl(objectTypesIdentity.ts, 19, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentity.ts, 83, 26), Decl(objectTypesIdentity.ts, 85, 21), Decl(objectTypesIdentity.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 87, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentity.types b/tests/baselines/reference/objectTypesIdentity.types index c148c4223ed..3491682954a 100644 --- a/tests/baselines/reference/objectTypesIdentity.types +++ b/tests/baselines/reference/objectTypesIdentity.types @@ -39,6 +39,7 @@ var b = { foo: '' }; >b : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string +>'' : string function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentity2.symbols b/tests/baselines/reference/objectTypesIdentity2.symbols new file mode 100644 index 00000000000..e78def5ca00 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentity2.symbols @@ -0,0 +1,204 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentity2.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentity2.ts, 0, 0)) + + foo: number; +>foo : Symbol(foo, Decl(objectTypesIdentity2.ts, 2, 9)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentity2.ts, 4, 1)) + + foo: boolean; +>foo : Symbol(foo, Decl(objectTypesIdentity2.ts, 6, 9)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentity2.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentity2.ts, 10, 8)) + + foo: T; +>foo : Symbol(foo, Decl(objectTypesIdentity2.ts, 10, 12)) +>T : Symbol(T, Decl(objectTypesIdentity2.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentity2.ts, 12, 1)) + + foo: Date; +>foo : Symbol(foo, Decl(objectTypesIdentity2.ts, 14, 13)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +} + +var a: { foo: RegExp; } +>a : Symbol(a, Decl(objectTypesIdentity2.ts, 18, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentity2.ts, 18, 8)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) + +enum E { A } +>E : Symbol(E, Decl(objectTypesIdentity2.ts, 18, 23)) +>A : Symbol(E.A, Decl(objectTypesIdentity2.ts, 19, 8)) + +var b = { foo: E.A }; +>b : Symbol(b, Decl(objectTypesIdentity2.ts, 20, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentity2.ts, 20, 9)) +>E.A : Symbol(E.A, Decl(objectTypesIdentity2.ts, 19, 8)) +>E : Symbol(E, Decl(objectTypesIdentity2.ts, 18, 23)) +>A : Symbol(E.A, Decl(objectTypesIdentity2.ts, 19, 8)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentity2.ts, 20, 21), Decl(objectTypesIdentity2.ts, 22, 20), Decl(objectTypesIdentity2.ts, 23, 20)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 22, 14)) +>A : Symbol(A, Decl(objectTypesIdentity2.ts, 0, 0)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentity2.ts, 20, 21), Decl(objectTypesIdentity2.ts, 22, 20), Decl(objectTypesIdentity2.ts, 23, 20)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 23, 14)) +>B : Symbol(B, Decl(objectTypesIdentity2.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentity2.ts, 20, 21), Decl(objectTypesIdentity2.ts, 22, 20), Decl(objectTypesIdentity2.ts, 23, 20)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 24, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentity2.ts, 24, 25), Decl(objectTypesIdentity2.ts, 26, 21), Decl(objectTypesIdentity2.ts, 27, 29)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 26, 15)) +>A : Symbol(A, Decl(objectTypesIdentity2.ts, 0, 0)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentity2.ts, 24, 25), Decl(objectTypesIdentity2.ts, 26, 21), Decl(objectTypesIdentity2.ts, 27, 29)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 27, 15)) +>C : Symbol(C, Decl(objectTypesIdentity2.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentity2.ts, 24, 25), Decl(objectTypesIdentity2.ts, 26, 21), Decl(objectTypesIdentity2.ts, 27, 29)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 28, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentity2.ts, 28, 26), Decl(objectTypesIdentity2.ts, 30, 20), Decl(objectTypesIdentity2.ts, 31, 20)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 30, 14)) +>A : Symbol(A, Decl(objectTypesIdentity2.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentity2.ts, 28, 26), Decl(objectTypesIdentity2.ts, 30, 20), Decl(objectTypesIdentity2.ts, 31, 20)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 31, 14)) +>I : Symbol(I, Decl(objectTypesIdentity2.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentity2.ts, 28, 26), Decl(objectTypesIdentity2.ts, 30, 20), Decl(objectTypesIdentity2.ts, 31, 20)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 32, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentity2.ts, 32, 25), Decl(objectTypesIdentity2.ts, 34, 20), Decl(objectTypesIdentity2.ts, 35, 27)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 34, 14)) +>A : Symbol(A, Decl(objectTypesIdentity2.ts, 0, 0)) + +function foo7(x: typeof a); // ok +>foo7 : Symbol(foo7, Decl(objectTypesIdentity2.ts, 32, 25), Decl(objectTypesIdentity2.ts, 34, 20), Decl(objectTypesIdentity2.ts, 35, 27)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 35, 14)) +>a : Symbol(a, Decl(objectTypesIdentity2.ts, 18, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentity2.ts, 32, 25), Decl(objectTypesIdentity2.ts, 34, 20), Decl(objectTypesIdentity2.ts, 35, 27)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 36, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentity2.ts, 36, 25), Decl(objectTypesIdentity2.ts, 38, 20), Decl(objectTypesIdentity2.ts, 39, 20)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 38, 14)) +>B : Symbol(B, Decl(objectTypesIdentity2.ts, 4, 1)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentity2.ts, 36, 25), Decl(objectTypesIdentity2.ts, 38, 20), Decl(objectTypesIdentity2.ts, 39, 20)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 39, 14)) +>I : Symbol(I, Decl(objectTypesIdentity2.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentity2.ts, 36, 25), Decl(objectTypesIdentity2.ts, 38, 20), Decl(objectTypesIdentity2.ts, 39, 20)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 40, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentity2.ts, 40, 25), Decl(objectTypesIdentity2.ts, 42, 20), Decl(objectTypesIdentity2.ts, 43, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 42, 14)) +>B : Symbol(B, Decl(objectTypesIdentity2.ts, 4, 1)) + +function foo9(x: C); // ok +>foo9 : Symbol(foo9, Decl(objectTypesIdentity2.ts, 40, 25), Decl(objectTypesIdentity2.ts, 42, 20), Decl(objectTypesIdentity2.ts, 43, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 43, 14)) +>C : Symbol(C, Decl(objectTypesIdentity2.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentity2.ts, 40, 25), Decl(objectTypesIdentity2.ts, 42, 20), Decl(objectTypesIdentity2.ts, 43, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 44, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentity2.ts, 44, 25), Decl(objectTypesIdentity2.ts, 46, 21), Decl(objectTypesIdentity2.ts, 47, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 46, 15)) +>B : Symbol(B, Decl(objectTypesIdentity2.ts, 4, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentity2.ts, 44, 25), Decl(objectTypesIdentity2.ts, 46, 21), Decl(objectTypesIdentity2.ts, 47, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 47, 15)) +>a : Symbol(a, Decl(objectTypesIdentity2.ts, 18, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentity2.ts, 44, 25), Decl(objectTypesIdentity2.ts, 46, 21), Decl(objectTypesIdentity2.ts, 47, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 48, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentity2.ts, 48, 26), Decl(objectTypesIdentity2.ts, 50, 21), Decl(objectTypesIdentity2.ts, 51, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 50, 15)) +>B : Symbol(B, Decl(objectTypesIdentity2.ts, 4, 1)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentity2.ts, 48, 26), Decl(objectTypesIdentity2.ts, 50, 21), Decl(objectTypesIdentity2.ts, 51, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 51, 15)) +>b : Symbol(b, Decl(objectTypesIdentity2.ts, 20, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentity2.ts, 48, 26), Decl(objectTypesIdentity2.ts, 50, 21), Decl(objectTypesIdentity2.ts, 51, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 52, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentity2.ts, 52, 26), Decl(objectTypesIdentity2.ts, 54, 21), Decl(objectTypesIdentity2.ts, 55, 29)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 54, 15)) +>I : Symbol(I, Decl(objectTypesIdentity2.ts, 12, 1)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentity2.ts, 52, 26), Decl(objectTypesIdentity2.ts, 54, 21), Decl(objectTypesIdentity2.ts, 55, 29)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 55, 15)) +>C : Symbol(C, Decl(objectTypesIdentity2.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentity2.ts, 52, 26), Decl(objectTypesIdentity2.ts, 54, 21), Decl(objectTypesIdentity2.ts, 55, 29)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 56, 15)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentity2.ts, 56, 26), Decl(objectTypesIdentity2.ts, 58, 21), Decl(objectTypesIdentity2.ts, 59, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 58, 15)) +>I : Symbol(I, Decl(objectTypesIdentity2.ts, 12, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentity2.ts, 56, 26), Decl(objectTypesIdentity2.ts, 58, 21), Decl(objectTypesIdentity2.ts, 59, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 59, 15)) +>a : Symbol(a, Decl(objectTypesIdentity2.ts, 18, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentity2.ts, 56, 26), Decl(objectTypesIdentity2.ts, 58, 21), Decl(objectTypesIdentity2.ts, 59, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 60, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentity2.ts, 60, 26), Decl(objectTypesIdentity2.ts, 62, 21), Decl(objectTypesIdentity2.ts, 63, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 62, 15)) +>I : Symbol(I, Decl(objectTypesIdentity2.ts, 12, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentity2.ts, 60, 26), Decl(objectTypesIdentity2.ts, 62, 21), Decl(objectTypesIdentity2.ts, 63, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 63, 15)) +>b : Symbol(b, Decl(objectTypesIdentity2.ts, 20, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentity2.ts, 60, 26), Decl(objectTypesIdentity2.ts, 62, 21), Decl(objectTypesIdentity2.ts, 63, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 64, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignatures.symbols b/tests/baselines/reference/objectTypesIdentityWithCallSignatures.symbols new file mode 100644 index 00000000000..e1131a019c0 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignatures.symbols @@ -0,0 +1,325 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignatures.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures.ts, 0, 0)) + + foo(x: string): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures.ts, 2, 9)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 3, 8)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures.ts, 4, 1)) + + foo(x: string): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures.ts, 6, 9)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 7, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignatures.ts, 10, 8)) + + foo(x: T): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures.ts, 10, 12)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 11, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignatures.ts, 10, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignatures.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures.ts, 12, 1)) + + foo(x: string): string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures.ts, 14, 13)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 15, 8)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignatures.ts, 16, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignatures.ts, 18, 13)) + + foo(x: T): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures.ts, 18, 17)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 19, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignatures.ts, 18, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignatures.ts, 18, 13)) +} + +var a: { foo(x: string): string } +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignatures.ts, 22, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures.ts, 22, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 22, 13)) + +var b = { foo(x: string) { return ''; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignatures.ts, 23, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures.ts, 23, 9)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 23, 14)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithCallSignatures.ts, 23, 42), Decl(objectTypesIdentityWithCallSignatures.ts, 25, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 25, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithCallSignatures.ts, 23, 42), Decl(objectTypesIdentityWithCallSignatures.ts, 25, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 26, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithCallSignatures.ts, 23, 42), Decl(objectTypesIdentityWithCallSignatures.ts, 25, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 27, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithCallSignatures.ts, 27, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 29, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 30, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 29, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithCallSignatures.ts, 27, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 29, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 30, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 30, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithCallSignatures.ts, 27, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 29, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 30, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 31, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithCallSignatures.ts, 31, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 33, 29), Decl(objectTypesIdentityWithCallSignatures.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 33, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithCallSignatures.ts, 31, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 33, 29), Decl(objectTypesIdentityWithCallSignatures.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 34, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithCallSignatures.ts, 31, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 33, 29), Decl(objectTypesIdentityWithCallSignatures.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 35, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignatures.ts, 35, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 37, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 38, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 37, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignatures.ts, 35, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 37, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 38, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 38, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignatures.ts, 35, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 37, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 38, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 39, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignatures.ts, 39, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 41, 27), Decl(objectTypesIdentityWithCallSignatures.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 41, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignatures.ts, 22, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignatures.ts, 39, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 41, 27), Decl(objectTypesIdentityWithCallSignatures.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 42, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignatures.ts, 22, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignatures.ts, 39, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 41, 27), Decl(objectTypesIdentityWithCallSignatures.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 43, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignatures.ts, 43, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 45, 27), Decl(objectTypesIdentityWithCallSignatures.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 45, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignatures.ts, 23, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignatures.ts, 43, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 45, 27), Decl(objectTypesIdentityWithCallSignatures.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 46, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignatures.ts, 23, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignatures.ts, 43, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 45, 27), Decl(objectTypesIdentityWithCallSignatures.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 47, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignatures.ts, 47, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 49, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 50, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 49, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures.ts, 0, 0)) + +function foo5(x: B); // error +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignatures.ts, 47, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 49, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 50, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 50, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignatures.ts, 47, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 49, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 50, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 51, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithCallSignatures.ts, 51, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 53, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 53, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures.ts, 0, 0)) + +function foo5b(x: C); // error +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithCallSignatures.ts, 51, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 53, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 54, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithCallSignatures.ts, 51, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 53, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 55, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithCallSignatures.ts, 55, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 57, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 58, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 57, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures.ts, 0, 0)) + +function foo6(x: I); // error +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithCallSignatures.ts, 55, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 57, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 58, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 58, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithCallSignatures.ts, 55, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 57, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 58, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 59, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithCallSignatures.ts, 59, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 61, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 61, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures.ts, 0, 0)) + +function foo7(x: typeof a); // error +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithCallSignatures.ts, 59, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 61, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 62, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignatures.ts, 22, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithCallSignatures.ts, 59, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 61, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 63, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithCallSignatures.ts, 63, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 65, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 66, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 65, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures.ts, 4, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithCallSignatures.ts, 63, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 65, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 66, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 66, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithCallSignatures.ts, 63, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 65, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 66, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 67, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithCallSignatures.ts, 67, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 69, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 69, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures.ts, 4, 1)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithCallSignatures.ts, 67, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 69, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 70, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithCallSignatures.ts, 67, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 69, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 71, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithCallSignatures.ts, 71, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 73, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 73, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures.ts, 4, 1)) + +function foo10(x: typeof a); // error +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithCallSignatures.ts, 71, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 73, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 74, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignatures.ts, 22, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithCallSignatures.ts, 71, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 73, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 75, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithCallSignatures.ts, 75, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 77, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 77, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures.ts, 4, 1)) + +function foo11(x: typeof b); // error +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithCallSignatures.ts, 75, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 77, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 78, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignatures.ts, 23, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithCallSignatures.ts, 75, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 77, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 79, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithCallSignatures.ts, 79, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 81, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 81, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures.ts, 12, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithCallSignatures.ts, 79, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 81, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 82, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithCallSignatures.ts, 79, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 81, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 83, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithCallSignatures.ts, 83, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 85, 31), Decl(objectTypesIdentityWithCallSignatures.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 85, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignatures.ts, 16, 1)) + +function foo12b(x: C); // error +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithCallSignatures.ts, 83, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 85, 31), Decl(objectTypesIdentityWithCallSignatures.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 86, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures.ts, 8, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithCallSignatures.ts, 83, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 85, 31), Decl(objectTypesIdentityWithCallSignatures.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 87, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignatures.ts, 87, 27), Decl(objectTypesIdentityWithCallSignatures.ts, 89, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 89, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures.ts, 12, 1)) + +function foo13(x: typeof a); // error +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignatures.ts, 87, 27), Decl(objectTypesIdentityWithCallSignatures.ts, 89, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 90, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignatures.ts, 22, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignatures.ts, 87, 27), Decl(objectTypesIdentityWithCallSignatures.ts, 89, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 91, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignatures.ts, 91, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 93, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 93, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures.ts, 12, 1)) + +function foo14(x: typeof b); // error +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignatures.ts, 91, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 93, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 94, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignatures.ts, 23, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignatures.ts, 91, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 93, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 95, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignatures.ts, 95, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 97, 30), Decl(objectTypesIdentityWithCallSignatures.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 97, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignatures.ts, 16, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignatures.ts, 95, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 97, 30), Decl(objectTypesIdentityWithCallSignatures.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 98, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures.ts, 8, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignatures.ts, 95, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 97, 30), Decl(objectTypesIdentityWithCallSignatures.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 99, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignatures.types b/tests/baselines/reference/objectTypesIdentityWithCallSignatures.types index efe7e32f5d7..545e2376bb3 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignatures.types +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignatures.types @@ -7,6 +7,7 @@ class A { foo(x: string): string { return null; } >foo : (x: string) => string >x : string +>null : null } class B { @@ -15,6 +16,7 @@ class B { foo(x: string): string { return null; } >foo : (x: string) => string >x : string +>null : null } class C { @@ -26,6 +28,7 @@ class C { >x : T >T : T >T : T +>null : null } interface I { @@ -57,6 +60,7 @@ var b = { foo(x: string) { return ''; } }; >{ foo(x: string) { return ''; } } : { foo(x: string): string; } >foo : (x: string) => string >x : string +>'' : string function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.symbols b/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.symbols new file mode 100644 index 00000000000..85c138a8c34 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.symbols @@ -0,0 +1,327 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignatures2.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures2.ts, 0, 0)) + + foo(x: string): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures2.ts, 2, 9)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 3, 8)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures2.ts, 4, 1)) + + foo(x: number): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures2.ts, 6, 9)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 7, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures2.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignatures2.ts, 10, 8)) + + foo(x: T): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures2.ts, 10, 12)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 11, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignatures2.ts, 10, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignatures2.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures2.ts, 12, 1)) + + foo(x: boolean): string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures2.ts, 14, 13)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 15, 8)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignatures2.ts, 16, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignatures2.ts, 18, 13)) + + foo(x: T): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures2.ts, 18, 17)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 19, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignatures2.ts, 18, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignatures2.ts, 18, 13)) +} + +var a: { foo(x: Date): string } +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignatures2.ts, 22, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures2.ts, 22, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 22, 13)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var b = { foo(x: RegExp) { return ''; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignatures2.ts, 23, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures2.ts, 23, 9)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 23, 14)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithCallSignatures2.ts, 23, 42), Decl(objectTypesIdentityWithCallSignatures2.ts, 25, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 25, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures2.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithCallSignatures2.ts, 23, 42), Decl(objectTypesIdentityWithCallSignatures2.ts, 25, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 26, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures2.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithCallSignatures2.ts, 23, 42), Decl(objectTypesIdentityWithCallSignatures2.ts, 25, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 27, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithCallSignatures2.ts, 27, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 29, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 30, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 29, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures2.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithCallSignatures2.ts, 27, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 29, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 30, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 30, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures2.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithCallSignatures2.ts, 27, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 29, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 30, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 31, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithCallSignatures2.ts, 31, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 33, 29), Decl(objectTypesIdentityWithCallSignatures2.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 33, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures2.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithCallSignatures2.ts, 31, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 33, 29), Decl(objectTypesIdentityWithCallSignatures2.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 34, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures2.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithCallSignatures2.ts, 31, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 33, 29), Decl(objectTypesIdentityWithCallSignatures2.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 35, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignatures2.ts, 35, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 37, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 38, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 37, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures2.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignatures2.ts, 35, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 37, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 38, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 38, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures2.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignatures2.ts, 35, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 37, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 38, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 39, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignatures2.ts, 39, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 41, 27), Decl(objectTypesIdentityWithCallSignatures2.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 41, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignatures2.ts, 22, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignatures2.ts, 39, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 41, 27), Decl(objectTypesIdentityWithCallSignatures2.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 42, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignatures2.ts, 22, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignatures2.ts, 39, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 41, 27), Decl(objectTypesIdentityWithCallSignatures2.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 43, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignatures2.ts, 43, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 45, 27), Decl(objectTypesIdentityWithCallSignatures2.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 45, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignatures2.ts, 23, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignatures2.ts, 43, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 45, 27), Decl(objectTypesIdentityWithCallSignatures2.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 46, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignatures2.ts, 23, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignatures2.ts, 43, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 45, 27), Decl(objectTypesIdentityWithCallSignatures2.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 47, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignatures2.ts, 47, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 49, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 50, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 49, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures2.ts, 0, 0)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignatures2.ts, 47, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 49, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 50, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 50, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures2.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignatures2.ts, 47, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 49, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 50, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 51, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithCallSignatures2.ts, 51, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 53, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 53, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures2.ts, 0, 0)) + +function foo5b(x: C); // error +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithCallSignatures2.ts, 51, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 53, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 54, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures2.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithCallSignatures2.ts, 51, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 53, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 55, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithCallSignatures2.ts, 55, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 57, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 58, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 57, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures2.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithCallSignatures2.ts, 55, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 57, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 58, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 58, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures2.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithCallSignatures2.ts, 55, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 57, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 58, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 59, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithCallSignatures2.ts, 59, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 61, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 61, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures2.ts, 0, 0)) + +function foo7(x: typeof a); // ok +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithCallSignatures2.ts, 59, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 61, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 62, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignatures2.ts, 22, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithCallSignatures2.ts, 59, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 61, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 63, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithCallSignatures2.ts, 63, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 65, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 66, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 65, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures2.ts, 4, 1)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithCallSignatures2.ts, 63, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 65, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 66, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 66, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures2.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithCallSignatures2.ts, 63, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 65, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 66, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 67, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithCallSignatures2.ts, 67, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 69, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 69, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures2.ts, 4, 1)) + +function foo9(x: C); // ok +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithCallSignatures2.ts, 67, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 69, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 70, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures2.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithCallSignatures2.ts, 67, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 69, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 71, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithCallSignatures2.ts, 71, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 73, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 73, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures2.ts, 4, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithCallSignatures2.ts, 71, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 73, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 74, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignatures2.ts, 22, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithCallSignatures2.ts, 71, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 73, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 75, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithCallSignatures2.ts, 75, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 77, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 77, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures2.ts, 4, 1)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithCallSignatures2.ts, 75, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 77, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 78, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignatures2.ts, 23, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithCallSignatures2.ts, 75, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 77, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 79, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithCallSignatures2.ts, 79, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 81, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 81, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures2.ts, 12, 1)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithCallSignatures2.ts, 79, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 81, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 82, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures2.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithCallSignatures2.ts, 79, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 81, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 83, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithCallSignatures2.ts, 83, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 85, 31), Decl(objectTypesIdentityWithCallSignatures2.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 85, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignatures2.ts, 16, 1)) + +function foo12b(x: C); // error +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithCallSignatures2.ts, 83, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 85, 31), Decl(objectTypesIdentityWithCallSignatures2.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 86, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures2.ts, 8, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithCallSignatures2.ts, 83, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 85, 31), Decl(objectTypesIdentityWithCallSignatures2.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 87, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignatures2.ts, 87, 27), Decl(objectTypesIdentityWithCallSignatures2.ts, 89, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 89, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures2.ts, 12, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignatures2.ts, 87, 27), Decl(objectTypesIdentityWithCallSignatures2.ts, 89, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 90, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignatures2.ts, 22, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignatures2.ts, 87, 27), Decl(objectTypesIdentityWithCallSignatures2.ts, 89, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 91, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignatures2.ts, 91, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 93, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 93, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures2.ts, 12, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignatures2.ts, 91, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 93, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 94, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignatures2.ts, 23, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignatures2.ts, 91, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 93, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 95, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignatures2.ts, 95, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 97, 30), Decl(objectTypesIdentityWithCallSignatures2.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 97, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignatures2.ts, 16, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignatures2.ts, 95, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 97, 30), Decl(objectTypesIdentityWithCallSignatures2.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 98, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures2.ts, 8, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignatures2.ts, 95, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 97, 30), Decl(objectTypesIdentityWithCallSignatures2.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 99, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.types b/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.types index 9004a267691..378c5c4fa0c 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.types +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.types @@ -7,6 +7,7 @@ class A { foo(x: string): string { return null; } >foo : (x: string) => string >x : string +>null : null } class B { @@ -15,6 +16,7 @@ class B { foo(x: number): string { return null; } >foo : (x: number) => string >x : number +>null : null } class C { @@ -26,6 +28,7 @@ class C { >x : T >T : T >T : T +>null : null } interface I { @@ -59,6 +62,7 @@ var b = { foo(x: RegExp) { return ''; } }; >foo : (x: RegExp) => string >x : RegExp >RegExp : RegExp +>'' : string function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.symbols b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.symbols new file mode 100644 index 00000000000..9341ba35c42 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.symbols @@ -0,0 +1,329 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 0, 0)) + + foo(x: string): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 2, 9)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 3, 8)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 4, 1)) + + foo(x: string, y: string): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 6, 9)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 7, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 7, 18)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 10, 8)) + + foo(x: T, y: T): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 10, 12)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 11, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 10, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 11, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 10, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 12, 1)) + + foo(x: string): string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 14, 13)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 15, 8)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 16, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 18, 13)) + + foo(x: T): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 18, 17)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 19, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 18, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 18, 13)) +} + +var a: { foo(x: string, y: string): string } +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 22, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 22, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 22, 13)) +>y : Symbol(y, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 22, 23)) + +var b = { foo(x: string) { return ''; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 23, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 23, 9)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 23, 14)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 23, 42), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 25, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 25, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 23, 42), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 25, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 26, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 23, 42), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 25, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 27, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 27, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 29, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 30, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 29, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 27, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 29, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 30, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 30, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 27, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 29, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 30, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 31, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 31, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 33, 29), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 33, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 31, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 33, 29), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 34, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 31, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 33, 29), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 35, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 35, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 37, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 38, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 37, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 35, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 37, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 38, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 38, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 35, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 37, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 38, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 39, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 39, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 41, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 41, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 22, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 39, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 41, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 42, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 22, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 39, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 41, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 43, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 43, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 45, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 45, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 23, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 43, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 45, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 46, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 23, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 43, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 45, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 47, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 47, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 49, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 50, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 49, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 0, 0)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 47, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 49, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 50, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 50, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 47, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 49, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 50, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 51, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 51, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 53, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 53, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 0, 0)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 51, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 53, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 54, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 51, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 53, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 55, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 55, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 57, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 58, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 57, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 0, 0)) + +function foo6(x: I); // error +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 55, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 57, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 58, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 58, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 55, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 57, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 58, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 59, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 59, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 61, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 61, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 0, 0)) + +function foo7(x: typeof a); // ok +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 59, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 61, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 62, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 22, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 59, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 61, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 63, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 63, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 65, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 66, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 65, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 4, 1)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 63, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 65, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 66, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 66, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 63, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 65, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 66, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 67, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 67, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 69, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 69, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 4, 1)) + +function foo9(x: C); // ok +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 67, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 69, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 70, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 67, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 69, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 71, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 71, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 73, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 73, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 4, 1)) + +function foo10(x: typeof a); // error +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 71, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 73, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 74, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 22, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 71, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 73, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 75, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 75, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 77, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 77, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 4, 1)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 75, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 77, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 78, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 23, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 75, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 77, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 79, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 79, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 81, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 81, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 12, 1)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 79, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 81, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 82, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 79, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 81, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 83, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 83, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 85, 31), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 85, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 16, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 83, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 85, 31), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 86, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 8, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 83, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 85, 31), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 87, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 87, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 89, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 89, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 12, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 87, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 89, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 90, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 22, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 87, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 89, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 91, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 91, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 93, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 93, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 12, 1)) + +function foo14(x: typeof b); // error +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 91, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 93, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 94, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 23, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 91, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 93, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 95, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 95, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 97, 30), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 97, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 16, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 95, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 97, 30), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 98, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 8, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 95, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 97, 30), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 99, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.types b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.types index 2f97c721637..62426cb0333 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.types +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.types @@ -7,6 +7,7 @@ class A { foo(x: string): string { return null; } >foo : (x: string) => string >x : string +>null : null } class B { @@ -16,6 +17,7 @@ class B { >foo : (x: string, y: string) => string >x : string >y : string +>null : null } class C { @@ -29,6 +31,7 @@ class C { >y : T >T : T >T : T +>null : null } interface I { @@ -61,6 +64,7 @@ var b = { foo(x: string) { return ''; } }; >{ foo(x: string) { return ''; } } : { foo(x: string): string; } >foo : (x: string) => string >x : string +>'' : string function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts2.symbols b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts2.symbols new file mode 100644 index 00000000000..6f37ae8eef9 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts2.symbols @@ -0,0 +1,137 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts === +// object types are identical structurally + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 0, 0)) + + (x: string): string; +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 3, 5)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 4, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 6, 13)) + + (x: T): T; +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 7, 5)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 6, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 6, 13)) +} + +var a: { (x: string, y: string): string } +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 10, 3)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 10, 10)) +>y : Symbol(y, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 10, 20)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 10, 41), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 12, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 13, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 12, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 0, 0)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 10, 41), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 12, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 13, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 13, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 0, 0)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 10, 41), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 12, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 13, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 14, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 14, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 16, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 17, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 16, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 10, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 14, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 16, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 17, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 17, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 10, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 14, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 16, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 17, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 18, 14)) + +function foo4(x: I2); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 18, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 20, 29), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 21, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 20, 14)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 4, 1)) + +function foo4(x: I2); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 18, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 20, 29), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 21, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 21, 14)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 4, 1)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 18, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 20, 29), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 21, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 22, 14)) + +function foo5(x: I2); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 22, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 24, 29), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 25, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 24, 14)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 4, 1)) + +function foo5(x: I2); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 22, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 24, 29), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 25, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 25, 14)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 22, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 24, 29), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 25, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 26, 14)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 26, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 28, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 29, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 28, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 0, 0)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 26, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 28, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 29, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 29, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 10, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 26, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 28, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 29, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 30, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 30, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 32, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 33, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 32, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 0, 0)) + +function foo14(x: I2); // error +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 30, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 32, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 33, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 33, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 4, 1)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 30, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 32, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 33, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 34, 15)) + +function foo14b(x: typeof a); +>foo14b : Symbol(foo14b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 34, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 36, 29), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 37, 31)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 36, 16)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 10, 3)) + +function foo14b(x: I2); // ok +>foo14b : Symbol(foo14b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 34, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 36, 29), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 37, 31)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 37, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 4, 1)) + +function foo14b(x: any) { } +>foo14b : Symbol(foo14b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 34, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 36, 29), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 37, 31)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 38, 16)) + +function foo15(x: I); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 38, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 40, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 41, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 40, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 0, 0)) + +function foo15(x: I2); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 38, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 40, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 41, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 41, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 4, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 38, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 40, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 41, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 42, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.symbols b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.symbols new file mode 100644 index 00000000000..6575c6787fd --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.symbols @@ -0,0 +1,376 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignaturesWithOverloads.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 0, 0)) + + foo(x: number): number; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 2, 9), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 3, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 4, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 3, 8)) + + foo(x: string): string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 2, 9), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 3, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 4, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 4, 8)) + + foo(x: any): any { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 2, 9), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 3, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 4, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 5, 8)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 6, 1)) + + foo(x: number): number; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 8, 9), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 9, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 10, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 9, 8)) + + foo(x: string): string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 8, 9), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 9, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 10, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 10, 8)) + + foo(x: any): any { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 8, 9), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 9, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 10, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 11, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 12, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 14, 8)) + + foo(x: number): number; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 14, 12), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 15, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 16, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 17, 17)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 15, 8)) + + foo(x: string): string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 14, 12), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 15, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 16, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 17, 17)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 16, 8)) + + foo(x: T): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 14, 12), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 15, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 16, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 17, 17)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 17, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 14, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 14, 8)) + + foo(x: any): any { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 14, 12), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 15, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 16, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 17, 17)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 18, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 19, 1)) + + foo(x: number): number; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 21, 13), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 22, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 22, 8)) + + foo(x: string): string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 21, 13), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 22, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 23, 8)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 24, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 26, 13)) + + foo(x: number): number; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 26, 17), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 27, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 28, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 27, 8)) + + foo(x: string): string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 26, 17), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 27, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 28, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 28, 8)) + + foo(x: T): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 26, 17), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 27, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 28, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 29, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 26, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 26, 13)) +} + +var a: { +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 32, 3)) + + foo(x: number): number +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 32, 8), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 33, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 33, 8)) + + foo(x: string): string +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 32, 8), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 33, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 34, 8)) +} + +var b = { +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 37, 3)) + + foo(x: any) { return ''; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 37, 9)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 38, 8)) + +}; + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 39, 2), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 41, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 41, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 39, 2), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 41, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 42, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 39, 2), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 41, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 43, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 43, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 45, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 46, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 45, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 6, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 43, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 45, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 46, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 46, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 6, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 43, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 45, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 46, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 47, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 47, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 49, 29), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 50, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 49, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 12, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 47, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 49, 29), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 50, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 50, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 12, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 47, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 49, 29), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 50, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 51, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 51, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 53, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 53, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 19, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 51, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 53, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 54, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 19, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 51, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 53, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 55, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 55, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 57, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 58, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 57, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 32, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 55, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 57, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 58, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 58, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 32, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 55, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 57, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 58, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 59, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 59, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 61, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 61, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 37, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 59, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 61, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 62, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 37, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 59, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 61, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 63, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 63, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 65, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 66, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 65, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 0, 0)) + +function foo5(x: B); // error +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 63, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 65, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 66, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 66, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 6, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 63, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 65, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 66, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 67, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 67, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 69, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 70, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 69, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 0, 0)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 67, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 69, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 70, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 70, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 12, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 67, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 69, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 70, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 71, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 71, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 73, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 74, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 73, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 0, 0)) + +function foo6(x: I); // BUG 831930 +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 71, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 73, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 74, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 74, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 19, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 71, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 73, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 74, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 75, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 75, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 77, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 78, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 77, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 0, 0)) + +function foo7(x: typeof a); // BUG 831930 +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 75, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 77, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 78, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 78, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 32, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 75, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 77, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 78, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 79, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 79, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 81, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 82, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 81, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 6, 1)) + +function foo8(x: I); // BUG 831930 +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 79, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 81, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 82, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 82, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 19, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 79, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 81, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 82, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 83, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 83, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 85, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 85, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 6, 1)) + +function foo9(x: C); // ok +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 83, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 85, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 86, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 12, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 83, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 85, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 87, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 87, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 89, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 89, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 6, 1)) + +function foo10(x: typeof a); // BUG 831930 +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 87, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 89, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 90, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 32, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 87, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 89, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 91, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 91, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 93, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 93, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 6, 1)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 91, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 93, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 94, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 37, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 91, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 93, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 95, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 95, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 97, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 97, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 19, 1)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 95, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 97, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 98, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 12, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 95, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 97, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 99, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 99, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 101, 31), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 102, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 101, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 24, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 99, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 101, 31), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 102, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 102, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 12, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 99, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 101, 31), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 102, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 103, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 103, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 105, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 106, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 105, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 19, 1)) + +function foo13(x: typeof a); // error +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 103, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 105, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 106, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 106, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 32, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 103, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 105, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 106, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 107, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 107, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 109, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 110, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 109, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 19, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 107, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 109, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 110, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 110, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 37, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 107, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 109, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 110, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 111, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 111, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 113, 30), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 114, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 113, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 24, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 111, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 113, 30), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 114, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 114, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 12, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 111, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 113, 30), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 114, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 115, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.types b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.types index c3ab4ffb837..edaad51b32e 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.types +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.types @@ -15,6 +15,7 @@ class A { foo(x: any): any { return null; } >foo : { (x: number): number; (x: string): string; } >x : any +>null : null } class B { @@ -31,6 +32,7 @@ class B { foo(x: any): any { return null; } >foo : { (x: number): number; (x: string): string; } >x : any +>null : null } class C { @@ -54,6 +56,7 @@ class C { foo(x: any): any { return null; } >foo : { (x: number): number; (x: string): string; (x: T): T; } >x : any +>null : null } interface I { @@ -107,6 +110,7 @@ var b = { >foo : (x: any) => any >x : any >'' : any +>'' : string }; diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures.symbols b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures.symbols new file mode 100644 index 00000000000..4441100b7ac --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures.symbols @@ -0,0 +1,271 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithConstructSignatures.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithConstructSignatures.ts, 0, 0)) + + constructor(x: string) { } +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 3, 16)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures.ts, 4, 1)) + + constructor(x: string) { } +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 7, 16)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignatures.ts, 10, 8)) + + constructor(x: T) { } +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 11, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignatures.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures.ts, 12, 1)) + + new(x: string); +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 15, 8)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithConstructSignatures.ts, 16, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignatures.ts, 18, 13)) + + new(x: T): T; +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 19, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignatures.ts, 18, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignatures.ts, 18, 13)) +} + +var a: { new(x: string) } +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignatures.ts, 22, 3)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 22, 13)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithConstructSignatures.ts, 22, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 24, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 25, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 24, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithConstructSignatures.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithConstructSignatures.ts, 22, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 24, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 25, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 25, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithConstructSignatures.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithConstructSignatures.ts, 22, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 24, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 25, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 26, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithConstructSignatures.ts, 26, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 28, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 29, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 28, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithConstructSignatures.ts, 26, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 28, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 29, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 29, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithConstructSignatures.ts, 26, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 28, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 29, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 30, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithConstructSignatures.ts, 30, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 32, 29), Decl(objectTypesIdentityWithConstructSignatures.ts, 33, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 32, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithConstructSignatures.ts, 30, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 32, 29), Decl(objectTypesIdentityWithConstructSignatures.ts, 33, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 33, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithConstructSignatures.ts, 30, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 32, 29), Decl(objectTypesIdentityWithConstructSignatures.ts, 33, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 34, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithConstructSignatures.ts, 34, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 36, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 37, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 36, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithConstructSignatures.ts, 34, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 36, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 37, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 37, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithConstructSignatures.ts, 34, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 36, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 37, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 38, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithConstructSignatures.ts, 38, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 40, 27), Decl(objectTypesIdentityWithConstructSignatures.ts, 41, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 40, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignatures.ts, 22, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithConstructSignatures.ts, 38, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 40, 27), Decl(objectTypesIdentityWithConstructSignatures.ts, 41, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 41, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignatures.ts, 22, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithConstructSignatures.ts, 38, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 40, 27), Decl(objectTypesIdentityWithConstructSignatures.ts, 41, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 42, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithConstructSignatures.ts, 42, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 44, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 45, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 44, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithConstructSignatures.ts, 0, 0)) + +function foo5(x: B); // error +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithConstructSignatures.ts, 42, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 44, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 45, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 45, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithConstructSignatures.ts, 42, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 44, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 45, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 46, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithConstructSignatures.ts, 46, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 48, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 49, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 48, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithConstructSignatures.ts, 0, 0)) + +function foo5b(x: C); // error +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithConstructSignatures.ts, 46, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 48, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 49, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 49, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithConstructSignatures.ts, 46, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 48, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 49, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 50, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithConstructSignatures.ts, 50, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 52, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 53, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 52, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithConstructSignatures.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithConstructSignatures.ts, 50, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 52, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 53, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 53, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithConstructSignatures.ts, 50, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 52, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 53, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 54, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithConstructSignatures.ts, 54, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 56, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 57, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 56, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithConstructSignatures.ts, 0, 0)) + +function foo7(x: typeof a); // ok +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithConstructSignatures.ts, 54, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 56, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 57, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 57, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignatures.ts, 22, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithConstructSignatures.ts, 54, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 56, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 57, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 58, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithConstructSignatures.ts, 58, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 60, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 61, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 60, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures.ts, 4, 1)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithConstructSignatures.ts, 58, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 60, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 61, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 61, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithConstructSignatures.ts, 58, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 60, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 61, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 62, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithConstructSignatures.ts, 62, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 64, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 65, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 64, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures.ts, 4, 1)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithConstructSignatures.ts, 62, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 64, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 65, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 65, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithConstructSignatures.ts, 62, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 64, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 65, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 66, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithConstructSignatures.ts, 66, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 68, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 69, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 68, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures.ts, 4, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithConstructSignatures.ts, 66, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 68, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 69, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 69, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignatures.ts, 22, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithConstructSignatures.ts, 66, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 68, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 69, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 70, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithConstructSignatures.ts, 70, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 72, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 73, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 72, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures.ts, 12, 1)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithConstructSignatures.ts, 70, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 72, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 73, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 73, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithConstructSignatures.ts, 70, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 72, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 73, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 74, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithConstructSignatures.ts, 74, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 76, 31), Decl(objectTypesIdentityWithConstructSignatures.ts, 77, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 76, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithConstructSignatures.ts, 16, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithConstructSignatures.ts, 74, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 76, 31), Decl(objectTypesIdentityWithConstructSignatures.ts, 77, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 77, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures.ts, 8, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithConstructSignatures.ts, 74, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 76, 31), Decl(objectTypesIdentityWithConstructSignatures.ts, 77, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 78, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithConstructSignatures.ts, 78, 27), Decl(objectTypesIdentityWithConstructSignatures.ts, 80, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 81, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 80, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures.ts, 12, 1)) + +function foo13(x: typeof a); // error +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithConstructSignatures.ts, 78, 27), Decl(objectTypesIdentityWithConstructSignatures.ts, 80, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 81, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 81, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignatures.ts, 22, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithConstructSignatures.ts, 78, 27), Decl(objectTypesIdentityWithConstructSignatures.ts, 80, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 81, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 82, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithConstructSignatures.ts, 82, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 84, 30), Decl(objectTypesIdentityWithConstructSignatures.ts, 85, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 84, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithConstructSignatures.ts, 16, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithConstructSignatures.ts, 82, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 84, 30), Decl(objectTypesIdentityWithConstructSignatures.ts, 85, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 85, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures.ts, 8, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithConstructSignatures.ts, 82, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 84, 30), Decl(objectTypesIdentityWithConstructSignatures.ts, 85, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 86, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.symbols b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.symbols new file mode 100644 index 00000000000..0d37d7fc97b --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.symbols @@ -0,0 +1,243 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithConstructSignatures2.ts === +// object types are identical structurally + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures2.ts, 0, 0)) + + constructor(x: number) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 3, 16)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures2.ts, 4, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignatures2.ts, 6, 8)) + + constructor(x: T) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 7, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignatures2.ts, 6, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures2.ts, 8, 1)) + + new(x: boolean): string; +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 11, 8)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithConstructSignatures2.ts, 12, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignatures2.ts, 14, 13)) + + new(x: T): T; +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 15, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignatures2.ts, 14, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignatures2.ts, 14, 13)) +} + +var a: { new(x: Date): string } +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignatures2.ts, 18, 3)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 18, 13)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var b = { new(x: RegExp) { return ''; } }; // not a construct signature, function called new +>b : Symbol(b, Decl(objectTypesIdentityWithConstructSignatures2.ts, 19, 3)) +>new : Symbol(new, Decl(objectTypesIdentityWithConstructSignatures2.ts, 19, 9)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 19, 14)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithConstructSignatures2.ts, 19, 42), Decl(objectTypesIdentityWithConstructSignatures2.ts, 21, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 22, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 21, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures2.ts, 0, 0)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithConstructSignatures2.ts, 19, 42), Decl(objectTypesIdentityWithConstructSignatures2.ts, 21, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 22, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 22, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures2.ts, 0, 0)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithConstructSignatures2.ts, 19, 42), Decl(objectTypesIdentityWithConstructSignatures2.ts, 21, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 22, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 23, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithConstructSignatures2.ts, 23, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 25, 29), Decl(objectTypesIdentityWithConstructSignatures2.ts, 26, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 25, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures2.ts, 4, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithConstructSignatures2.ts, 23, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 25, 29), Decl(objectTypesIdentityWithConstructSignatures2.ts, 26, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 26, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures2.ts, 4, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithConstructSignatures2.ts, 23, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 25, 29), Decl(objectTypesIdentityWithConstructSignatures2.ts, 26, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 27, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithConstructSignatures2.ts, 27, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 29, 20), Decl(objectTypesIdentityWithConstructSignatures2.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 29, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures2.ts, 8, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithConstructSignatures2.ts, 27, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 29, 20), Decl(objectTypesIdentityWithConstructSignatures2.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 30, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures2.ts, 8, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithConstructSignatures2.ts, 27, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 29, 20), Decl(objectTypesIdentityWithConstructSignatures2.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 31, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithConstructSignatures2.ts, 31, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 33, 27), Decl(objectTypesIdentityWithConstructSignatures2.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 33, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignatures2.ts, 18, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithConstructSignatures2.ts, 31, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 33, 27), Decl(objectTypesIdentityWithConstructSignatures2.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 34, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignatures2.ts, 18, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithConstructSignatures2.ts, 31, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 33, 27), Decl(objectTypesIdentityWithConstructSignatures2.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 35, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithConstructSignatures2.ts, 35, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 37, 27), Decl(objectTypesIdentityWithConstructSignatures2.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 37, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithConstructSignatures2.ts, 19, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithConstructSignatures2.ts, 35, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 37, 27), Decl(objectTypesIdentityWithConstructSignatures2.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 38, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithConstructSignatures2.ts, 19, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithConstructSignatures2.ts, 35, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 37, 27), Decl(objectTypesIdentityWithConstructSignatures2.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 39, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithConstructSignatures2.ts, 39, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 41, 20), Decl(objectTypesIdentityWithConstructSignatures2.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 41, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures2.ts, 0, 0)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithConstructSignatures2.ts, 39, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 41, 20), Decl(objectTypesIdentityWithConstructSignatures2.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 42, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures2.ts, 8, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithConstructSignatures2.ts, 39, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 41, 20), Decl(objectTypesIdentityWithConstructSignatures2.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 43, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithConstructSignatures2.ts, 43, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 45, 20), Decl(objectTypesIdentityWithConstructSignatures2.ts, 46, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 45, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures2.ts, 0, 0)) + +function foo9(x: C); // error, types are structurally equal +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithConstructSignatures2.ts, 43, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 45, 20), Decl(objectTypesIdentityWithConstructSignatures2.ts, 46, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 46, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures2.ts, 4, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithConstructSignatures2.ts, 43, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 45, 20), Decl(objectTypesIdentityWithConstructSignatures2.ts, 46, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 47, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithConstructSignatures2.ts, 47, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 49, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 49, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures2.ts, 0, 0)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithConstructSignatures2.ts, 47, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 49, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 50, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignatures2.ts, 18, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithConstructSignatures2.ts, 47, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 49, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 51, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithConstructSignatures2.ts, 51, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 53, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 53, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures2.ts, 0, 0)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithConstructSignatures2.ts, 51, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 53, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 54, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithConstructSignatures2.ts, 19, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithConstructSignatures2.ts, 51, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 53, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 55, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithConstructSignatures2.ts, 55, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 57, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 57, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures2.ts, 8, 1)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithConstructSignatures2.ts, 55, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 57, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 58, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures2.ts, 4, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithConstructSignatures2.ts, 55, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 57, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 59, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithConstructSignatures2.ts, 59, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 61, 31), Decl(objectTypesIdentityWithConstructSignatures2.ts, 62, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 61, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithConstructSignatures2.ts, 12, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithConstructSignatures2.ts, 59, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 61, 31), Decl(objectTypesIdentityWithConstructSignatures2.ts, 62, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 62, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures2.ts, 4, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithConstructSignatures2.ts, 59, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 61, 31), Decl(objectTypesIdentityWithConstructSignatures2.ts, 62, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 63, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithConstructSignatures2.ts, 63, 27), Decl(objectTypesIdentityWithConstructSignatures2.ts, 65, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 65, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures2.ts, 8, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithConstructSignatures2.ts, 63, 27), Decl(objectTypesIdentityWithConstructSignatures2.ts, 65, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 66, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignatures2.ts, 18, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithConstructSignatures2.ts, 63, 27), Decl(objectTypesIdentityWithConstructSignatures2.ts, 65, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 67, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithConstructSignatures2.ts, 67, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 69, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 69, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures2.ts, 8, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithConstructSignatures2.ts, 67, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 69, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 70, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithConstructSignatures2.ts, 19, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithConstructSignatures2.ts, 67, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 69, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 71, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithConstructSignatures2.ts, 71, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 73, 30), Decl(objectTypesIdentityWithConstructSignatures2.ts, 74, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 73, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithConstructSignatures2.ts, 12, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithConstructSignatures2.ts, 71, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 73, 30), Decl(objectTypesIdentityWithConstructSignatures2.ts, 74, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 74, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures2.ts, 4, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithConstructSignatures2.ts, 71, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 73, 30), Decl(objectTypesIdentityWithConstructSignatures2.ts, 74, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 75, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.types b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.types index 769682c826a..2e5e7231721 100644 --- a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.types +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.types @@ -6,6 +6,7 @@ class B { constructor(x: number) { return null; } >x : number +>null : null } class C { @@ -15,6 +16,7 @@ class C { constructor(x: T) { return null; } >x : T >T : T +>null : null } interface I { @@ -45,6 +47,7 @@ var b = { new(x: RegExp) { return ''; } }; // not a construct signature, functio >new : (x: RegExp) => string >x : RegExp >RegExp : RegExp +>'' : string function foo1b(x: B); >foo1b : { (x: B): any; (x: B): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.symbols b/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.symbols new file mode 100644 index 00000000000..0563fe7a2fc --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.symbols @@ -0,0 +1,245 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts === +// object types are identical structurally + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 0, 0)) + + constructor(x: string, y: string) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 3, 16)) +>y : Symbol(y, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 3, 26)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 4, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 6, 8)) + + constructor(x: T, y: T) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 7, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 6, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 7, 21)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 6, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 8, 1)) + + new(x: string): string; +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 11, 8)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 12, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 14, 13)) + + new(x: T): T; +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 15, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 14, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 14, 13)) +} + +var a: { new(x: string, y: string): string } +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 18, 3)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 18, 13)) +>y : Symbol(y, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 18, 23)) + +var b = { new(x: string) { return ''; } }; // not a construct signature, function called new +>b : Symbol(b, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 19, 3)) +>new : Symbol(new, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 19, 9)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 19, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 19, 42), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 21, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 22, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 21, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 0, 0)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 19, 42), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 21, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 22, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 22, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 0, 0)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 19, 42), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 21, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 22, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 23, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 23, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 25, 29), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 26, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 25, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 4, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 23, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 25, 29), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 26, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 26, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 4, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 23, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 25, 29), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 26, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 27, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 27, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 29, 20), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 29, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 8, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 27, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 29, 20), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 30, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 8, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 27, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 29, 20), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 31, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 31, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 33, 27), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 33, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 18, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 31, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 33, 27), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 34, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 18, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 31, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 33, 27), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 35, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 35, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 37, 27), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 37, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 19, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 35, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 37, 27), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 38, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 19, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 35, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 37, 27), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 39, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 39, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 41, 20), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 41, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 0, 0)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 39, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 41, 20), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 42, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 8, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 39, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 41, 20), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 43, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 43, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 45, 20), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 46, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 45, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 0, 0)) + +function foo9(x: C); // error, types are structurally equal +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 43, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 45, 20), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 46, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 46, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 4, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 43, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 45, 20), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 46, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 47, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 47, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 49, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 49, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 0, 0)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 47, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 49, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 50, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 18, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 47, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 49, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 51, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 51, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 53, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 53, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 0, 0)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 51, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 53, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 54, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 19, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 51, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 53, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 55, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 55, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 57, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 57, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 8, 1)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 55, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 57, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 58, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 4, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 55, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 57, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 59, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 59, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 61, 31), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 62, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 61, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 12, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 59, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 61, 31), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 62, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 62, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 4, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 59, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 61, 31), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 62, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 63, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 63, 27), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 65, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 65, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 8, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 63, 27), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 65, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 66, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 18, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 63, 27), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 65, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 67, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 67, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 69, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 69, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 8, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 67, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 69, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 70, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 19, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 67, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 69, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 71, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 71, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 73, 30), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 74, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 73, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 12, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 71, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 73, 30), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 74, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 74, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 4, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 71, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 73, 30), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 74, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 75, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.types b/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.types index a2779e3bd35..b7f59953959 100644 --- a/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.types +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.types @@ -7,6 +7,7 @@ class B { constructor(x: string, y: string) { return null; } >x : string >y : string +>null : null } class C { @@ -18,6 +19,7 @@ class C { >T : T >y : T >T : T +>null : null } interface I { @@ -47,6 +49,7 @@ var b = { new(x: string) { return ''; } }; // not a construct signature, functio >{ new(x: string) { return ''; } } : { new(x: string): string; } >new : (x: string) => string >x : string +>'' : string function foo1b(x: B); >foo1b : { (x: B): any; (x: B): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.symbols new file mode 100644 index 00000000000..8fdebdcccbe --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.symbols @@ -0,0 +1,340 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignatures.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 0, 0)) + + foo(x: T): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 2, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 3, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 3, 11)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 3, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 3, 8)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 4, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 6, 8)) + + foo(x: T): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 6, 12)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 7, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 6, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 6, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 10, 8)) + + foo(x: T): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 10, 12)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 11, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 10, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 12, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 14, 12)) + + foo(x: T): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 14, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 15, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 14, 12)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 14, 12)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 16, 1)) + + foo(x: T): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 18, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 19, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 19, 11)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 19, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 19, 8)) +} + +var a: { foo(x: T): T } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 22, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 22, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 22, 13)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 22, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 22, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 22, 13)) + +var b = { foo(x: T) { return x; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 23, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 23, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 23, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 23, 17)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 23, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 23, 17)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 23, 39), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 25, 20), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 25, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 23, 39), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 25, 20), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 26, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 23, 39), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 25, 20), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 27, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 27, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 29, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 30, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 29, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 27, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 29, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 30, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 30, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 27, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 29, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 30, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 31, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 33, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 33, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 33, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 34, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 33, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 35, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 35, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 37, 28), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 38, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 37, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 35, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 37, 28), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 38, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 38, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 35, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 37, 28), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 38, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 39, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 39, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 41, 27), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 41, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 22, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 39, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 41, 27), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 42, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 22, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 39, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 41, 27), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 43, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 43, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 45, 27), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 45, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 23, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 43, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 45, 27), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 46, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 23, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 43, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 45, 27), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 47, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 47, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 49, 20), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 49, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 0, 0)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 47, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 49, 20), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 50, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 47, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 49, 20), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 51, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 51, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 53, 21), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 53, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 0, 0)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 51, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 53, 21), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 54, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 51, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 53, 21), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 55, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 55, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 57, 20), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 58, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 57, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 55, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 57, 20), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 58, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 58, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 55, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 57, 20), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 58, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 59, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 59, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 61, 20), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 61, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 0, 0)) + +function foo7(x: typeof a); // error +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 59, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 61, 20), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 62, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 22, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 59, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 61, 20), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 63, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 63, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 65, 28), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 65, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 4, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 63, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 65, 28), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 66, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 63, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 65, 28), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 67, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 67, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 69, 28), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 69, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 4, 1)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 67, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 69, 28), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 70, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 67, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 69, 28), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 71, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 71, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 73, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 73, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 4, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 71, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 73, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 74, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 22, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 71, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 73, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 75, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 75, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 77, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 77, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 4, 1)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 75, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 77, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 78, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 23, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 75, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 77, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 79, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 79, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 81, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 81, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 12, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 79, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 81, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 82, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 79, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 81, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 83, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 83, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 85, 23), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 85, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 16, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 83, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 85, 23), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 86, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 8, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 83, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 85, 23), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 87, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 87, 27), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 89, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 89, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 12, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 87, 27), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 89, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 90, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 22, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 87, 27), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 89, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 91, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 91, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 93, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 93, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 12, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 91, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 93, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 94, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 23, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 91, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 93, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 95, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 95, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 97, 22), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 97, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 16, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 95, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 97, 22), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 98, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 8, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 95, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 97, 22), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 99, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.types index d3cf9bc0063..d871c3c4cb5 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.types @@ -10,6 +10,7 @@ class A { >x : T >T : T >T : T +>null : null } class B { @@ -21,6 +22,7 @@ class B { >x : T >T : T >T : T +>null : null } class C { @@ -32,6 +34,7 @@ class C { >x : T >T : T >T : T +>null : null } interface I { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.symbols new file mode 100644 index 00000000000..2ca97948a99 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.symbols @@ -0,0 +1,361 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignatures2.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 0, 0)) + + foo(x: T, y: U): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 2, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 3, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 3, 10)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 3, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 3, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 3, 19)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 3, 10)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 3, 8)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 4, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 6, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 6, 10)) + + foo(x: T, y: U): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 6, 15)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 7, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 6, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 7, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 6, 10)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 6, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 10, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 10, 10)) + + foo(x: T, y: U): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 10, 15)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 11, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 10, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 11, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 10, 10)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 12, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 14, 12)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 14, 14)) + + foo(x: T, y: U): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 14, 19)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 15, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 14, 12)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 15, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 14, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 14, 12)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 16, 1)) + + foo(x: T, y: U): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 18, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 19, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 19, 10)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 19, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 19, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 19, 19)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 19, 10)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 19, 8)) +} + +var a: { foo(x: T, y: U): T } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 15)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 19)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 13)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 24)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 15)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 13)) + +var b = { foo(x: T, y: U) { return x; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 14)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 20)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 14)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 25)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 20)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 48), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 25, 20), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 25, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 48), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 25, 20), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 26, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 48), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 25, 20), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 27, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 27, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 29, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 30, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 29, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 27, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 29, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 30, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 30, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 27, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 29, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 30, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 31, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 33, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 34, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 33, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 33, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 34, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 34, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 33, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 34, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 35, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 35, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 37, 36), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 38, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 37, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 35, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 37, 36), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 38, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 38, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 35, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 37, 36), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 38, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 39, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 39, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 41, 27), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 41, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 39, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 41, 27), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 42, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 39, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 41, 27), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 43, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 43, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 45, 27), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 45, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 43, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 45, 27), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 46, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 43, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 45, 27), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 47, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 47, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 49, 20), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 50, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 49, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 0, 0)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 47, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 49, 20), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 50, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 50, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 47, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 49, 20), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 50, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 51, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 51, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 53, 21), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 54, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 53, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 0, 0)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 51, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 53, 21), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 54, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 54, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 51, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 53, 21), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 54, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 55, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 55, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 57, 20), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 58, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 57, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 55, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 57, 20), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 58, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 58, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 55, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 57, 20), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 58, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 59, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 59, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 61, 20), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 61, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 0, 0)) + +function foo7(x: typeof a); // no error, bug? +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 59, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 61, 20), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 62, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 59, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 61, 20), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 63, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 63, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 65, 36), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 66, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 65, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 4, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 63, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 65, 36), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 66, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 66, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 63, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 65, 36), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 66, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 67, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 67, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 69, 36), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 70, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 69, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 4, 1)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 67, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 69, 36), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 70, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 70, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 67, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 69, 36), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 70, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 71, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 71, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 73, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 73, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 4, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 71, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 73, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 74, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 71, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 73, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 75, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 75, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 77, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 77, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 4, 1)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 75, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 77, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 78, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 75, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 77, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 79, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 79, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 81, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 82, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 81, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 12, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 79, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 81, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 82, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 82, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 79, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 81, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 82, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 83, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 83, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 85, 23), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 86, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 85, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 16, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 83, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 85, 23), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 86, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 86, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 8, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 83, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 85, 23), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 86, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 87, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 87, 27), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 89, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 89, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 12, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 87, 27), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 89, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 90, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 87, 27), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 89, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 91, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 91, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 93, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 93, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 12, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 91, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 93, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 94, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 91, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 93, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 95, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 95, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 97, 22), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 98, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 97, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 16, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 95, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 97, 22), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 98, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 98, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 8, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 95, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 97, 22), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 98, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 99, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.types index 0c00e587b78..c7ca543aead 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.types @@ -13,6 +13,7 @@ class A { >y : U >U : U >T : T +>null : null } class B { @@ -27,6 +28,7 @@ class B { >y : U >U : U >T : T +>null : null } class C { @@ -41,6 +43,7 @@ class C { >y : U >U : U >T : T +>null : null } interface I { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.symbols new file mode 100644 index 00000000000..3b681c55c13 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.symbols @@ -0,0 +1,363 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 0, 0)) + + foo(x: T): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 4, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 5, 8)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 5, 24)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 5, 8)) +} + +class B> { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 8, 8)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + + foo(x: T): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 8, 34)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 9, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 8, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 12, 8)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + + foo(x: T): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 12, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 13, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 12, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 14, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 16, 12)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + + foo(x: T): string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 16, 31)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 17, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 16, 12)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 18, 1)) + + foo(x: T): string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 20, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 21, 8)) +>Boolean : Symbol(Boolean, Decl(lib.d.ts, 443, 38), Decl(lib.d.ts, 456, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 21, 27)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 21, 8)) +} + +var a: { foo>(x: T): string } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 24, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 24, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 24, 13)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 24, 38)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 24, 13)) + +var b = { foo(x: T) { return ''; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 25, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 25, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 25, 14)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 25, 32)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 25, 14)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 25, 55), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 27, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 25, 55), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 28, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 25, 55), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 29, 14)) + +function foo1b(x: B>); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 31, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 32, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 31, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 6, 1)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +function foo1b(x: B>); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 31, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 32, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 32, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 6, 1)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 31, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 32, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 33, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 35, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 36, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 35, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 10, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 35, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 36, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 36, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 10, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 35, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 36, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 37, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 39, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 40, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 39, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 14, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 39, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 40, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 40, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 14, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 39, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 40, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 41, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 43, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 24, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 44, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 24, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 45, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 47, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 25, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 48, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 25, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 49, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 52, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 51, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 0, 0)) + +function foo5(x: B>); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 52, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 52, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 6, 1)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 52, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 53, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 56, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 55, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 0, 0)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 56, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 56, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 10, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 56, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 57, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 60, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 59, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 60, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 60, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 14, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 60, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 61, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 63, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 0, 0)) + +function foo7(x: typeof a); // ok +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 64, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 24, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 65, 14)) + +function foo8(x: B>); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 67, 35), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 67, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 6, 1)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 67, 35), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 68, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 14, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 67, 35), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 69, 14)) + +function foo9(x: B>); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 71, 35), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 71, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 6, 1)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +function foo9(x: C); // ok +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 71, 35), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 72, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 10, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 71, 35), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 73, 14)) + +function foo10(x: B>); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 75, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 75, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 6, 1)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 75, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 76, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 24, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 75, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 77, 15)) + +function foo11(x: B>); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 79, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 79, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 6, 1)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 79, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 80, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 25, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 79, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 81, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 83, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 84, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 83, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 14, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 83, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 84, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 84, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 10, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 83, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 84, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 85, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 88, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 87, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 18, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 88, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 88, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 10, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 88, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 89, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 91, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 91, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 14, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 91, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 92, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 24, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 91, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 93, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 95, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 95, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 14, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 95, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 96, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 25, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 95, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 97, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 100, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 99, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 18, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 100, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 100, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 10, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 100, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 101, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.types index 432a618c4e2..90ed7fd0945 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.types @@ -12,6 +12,7 @@ class A { >Date : Date >x : T >T : T +>null : null } class B> { @@ -23,6 +24,7 @@ class B> { >foo : (x: T) => string >x : T >T : T +>null : null } class C { @@ -34,6 +36,7 @@ class C { >foo : (x: T) => string >x : T >T : T +>null : null } interface I { @@ -74,6 +77,7 @@ var b = { foo(x: T) { return ''; } }; >RegExp : RegExp >x : T >T : T +>'' : string function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.symbols new file mode 100644 index 00000000000..a9210b20f32 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.symbols @@ -0,0 +1,338 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 0, 0)) + + foo(x: T): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 4, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 5, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 5, 11)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 5, 8)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 8, 8)) + + foo(x: T): number { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 8, 12)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 9, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 8, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 10, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 12, 8)) + + foo(x: T): boolean { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 12, 12)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 13, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 12, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 14, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 16, 12)) + + foo(x: T): Date; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 16, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 17, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 16, 12)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 18, 1)) + + foo(x: T): RegExp; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 20, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 21, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 21, 11)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 21, 8)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) +} + +var a: { foo(x: T): T } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 24, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 24, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 24, 13)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 24, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 24, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 24, 13)) + +var b = { foo(x: T) { return null; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 25, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 25, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 25, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 25, 17)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 25, 14)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 25, 42), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 27, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 25, 42), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 28, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 25, 42), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 29, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 31, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 32, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 31, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 6, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 31, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 32, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 32, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 6, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 31, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 32, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 33, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 35, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 36, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 35, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 10, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 35, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 36, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 36, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 10, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 35, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 36, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 37, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 39, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 40, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 39, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 14, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 39, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 40, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 40, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 14, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 39, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 40, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 41, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 43, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 24, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 44, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 24, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 45, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 47, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 25, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 48, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 25, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 49, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 51, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 0, 0)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 52, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 6, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 53, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 56, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 55, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 0, 0)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 56, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 56, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 10, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 56, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 57, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 60, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 59, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 60, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 60, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 14, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 60, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 61, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 63, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 0, 0)) + +function foo7(x: typeof a); // ok +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 64, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 24, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 65, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 67, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 67, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 6, 1)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 67, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 68, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 14, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 67, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 69, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 71, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 71, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 6, 1)) + +function foo9(x: C); // ok +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 71, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 72, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 10, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 71, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 73, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 75, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 75, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 6, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 75, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 76, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 24, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 75, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 77, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 79, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 79, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 6, 1)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 79, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 80, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 25, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 79, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 81, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 83, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 84, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 83, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 14, 1)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 83, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 84, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 84, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 10, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 83, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 84, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 85, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 88, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 87, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 18, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 88, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 88, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 10, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 88, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 89, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 91, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 91, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 14, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 91, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 92, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 24, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 91, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 93, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 95, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 95, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 14, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 95, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 96, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 25, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 95, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 97, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 100, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 99, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 18, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 100, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 100, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 10, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 100, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 101, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.types index 8b5a042c1e2..ef6799b6ab9 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.types @@ -11,6 +11,7 @@ class A { >T : T >x : T >T : T +>null : null } class B { @@ -21,6 +22,7 @@ class B { >foo : (x: T) => number >x : T >T : T +>null : null } class C { @@ -31,6 +33,7 @@ class C { >foo : (x: T) => boolean >x : T >T : T +>null : null } interface I { @@ -70,6 +73,7 @@ var b = { foo(x: T) { return null; } }; >T : T >x : T >T : T +>null : null function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.symbols new file mode 100644 index 00000000000..e1c4e120370 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.symbols @@ -0,0 +1,366 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 0, 0)) + + foo(x: T): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 4, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 5, 8)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 5, 24)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 5, 8)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 8, 8)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + foo(x: T): number { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 8, 25)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 9, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 8, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 10, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 12, 8)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + foo(x: T): boolean { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 12, 25)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 13, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 12, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 14, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 16, 12)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + foo(x: T): Date; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 16, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 17, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 16, 12)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 18, 1)) + + foo(x: T): RegExp; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 20, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 21, 8)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 21, 24)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 21, 8)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) +} + +var a: { foo(x: T): T } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 13)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 29)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 13)) + +var b = { foo(x: T) { return null; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 14)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 30)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 14)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 55), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 27, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 55), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 28, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 55), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 29, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 31, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 32, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 31, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 6, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 31, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 32, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 32, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 6, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 31, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 32, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 33, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 35, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 35, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 10, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 35, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 36, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 10, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 35, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 37, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 39, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 40, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 39, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 14, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 39, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 40, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 40, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 14, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 39, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 40, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 41, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 43, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 44, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 45, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 47, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 48, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 49, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 52, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 51, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 0, 0)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 52, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 52, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 6, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 52, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 53, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 56, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 55, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 0, 0)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 56, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 56, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 10, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 56, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 57, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 60, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 59, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 60, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 60, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 14, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 60, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 61, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 63, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 0, 0)) + +function foo7(x: typeof a); // ok +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 64, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 65, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 67, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 68, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 67, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 6, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 67, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 68, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 68, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 14, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 67, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 68, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 69, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 71, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 72, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 71, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 6, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo9(x: C); // ok +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 71, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 72, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 72, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 10, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 71, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 72, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 73, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 75, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 75, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 6, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 75, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 76, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 75, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 77, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 79, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 79, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 6, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 79, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 80, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 79, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 81, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 83, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 84, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 83, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 14, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 83, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 84, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 84, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 10, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 83, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 84, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 85, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 88, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 87, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 18, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 88, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 88, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 10, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 88, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 89, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 91, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 91, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 14, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 91, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 92, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 91, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 93, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 95, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 95, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 14, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 95, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 96, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 95, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 97, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 100, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 99, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 18, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 100, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 100, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 10, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 100, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 101, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.types index 2863cafa885..c964cc46cad 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.types @@ -12,6 +12,7 @@ class A { >Date : Date >x : T >T : T +>null : null } class B { @@ -23,6 +24,7 @@ class B { >foo : (x: T) => number >x : T >T : T +>null : null } class C { @@ -34,6 +36,7 @@ class C { >foo : (x: T) => boolean >x : T >T : T +>null : null } interface I { @@ -77,6 +80,7 @@ var b = { foo(x: T) { return null; } }; >Date : Date >x : T >T : T +>null : null function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.symbols new file mode 100644 index 00000000000..9b801aa2c6f --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.symbols @@ -0,0 +1,372 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + + foo(x: T): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 2, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 3, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 3, 11)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 3, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 3, 8)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 6, 8)) +>V : Symbol(V, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 6, 10)) + + foo(x: U): U { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 6, 15)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 7, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 6, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 6, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 8, 1)) +>V : Symbol(V, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 10, 8)) +>W : Symbol(W, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 10, 10)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 10, 13)) + + foo(x: V): V { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 10, 18)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 11, 8)) +>V : Symbol(V, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 10, 8)) +>V : Symbol(V, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 12, 1)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 14, 12)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 14, 14)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 14, 17)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 14, 20)) + + foo(x: X): X; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 14, 25)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 15, 8)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 14, 12)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 14, 12)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 16, 1)) + + foo(x: Y): Y; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 18, 14)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 19, 8)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 19, 10)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 19, 13)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 19, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 19, 20)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 19, 8)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 19, 8)) +} + +var a: { foo(x: Z): Z } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 8)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 13)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 18)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 21)) +>D : Symbol(D, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 24)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 28)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 13)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 13)) + +var b = { foo(x: A) { return x; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 9)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 19)) +>D : Symbol(D, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 22)) +>E : Symbol(E, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 25)) +>F : Symbol(F, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 32)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 32)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 54), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 25, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 25, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 54), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 25, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 26, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 54), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 25, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 27, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 27, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 29, 37), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 30, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 29, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 27, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 29, 37), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 30, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 30, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 27, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 29, 37), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 30, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 31, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 33, 46), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 34, 46)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 33, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 33, 46), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 34, 46)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 34, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 33, 46), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 34, 46)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 35, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 35, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 37, 53), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 38, 53)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 37, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 35, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 37, 53), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 38, 53)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 38, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 35, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 37, 53), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 38, 53)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 39, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 39, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 41, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 41, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 39, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 41, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 42, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 39, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 41, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 43, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 43, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 45, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 45, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 43, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 45, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 46, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 43, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 45, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 47, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 47, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 49, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 50, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 49, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 47, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 49, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 50, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 50, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 47, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 49, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 50, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 51, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 51, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 53, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 54, 46)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 53, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 51, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 53, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 54, 46)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 54, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 51, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 53, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 54, 46)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 55, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 55, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 57, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 58, 51)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 57, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 55, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 57, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 58, 51)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 58, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 12, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 55, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 57, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 58, 51)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 59, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 59, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 61, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 61, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + +function foo7(x: typeof a); // no error, bug? +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 59, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 61, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 62, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 59, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 61, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 63, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 63, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 65, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 66, 51)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 65, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 63, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 65, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 66, 51)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 66, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 12, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 63, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 65, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 66, 51)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 67, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 67, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 69, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 70, 55)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 69, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) + +function foo9(x: C>); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 67, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 69, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 70, 55)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 70, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 8, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 67, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 69, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 70, 55)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 71, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 71, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 73, 38), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 73, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 71, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 73, 38), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 74, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 71, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 73, 38), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 75, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 75, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 77, 38), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 77, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 75, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 77, 38), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 78, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 75, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 77, 38), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 79, 15)) + +function foo12(x: I, number, Date, string>); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 79, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 81, 62), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 82, 54)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 81, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 12, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo12(x: C, number, Date>); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 79, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 81, 62), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 82, 54)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 82, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 8, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 79, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 81, 62), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 82, 54)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 83, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 83, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 85, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 86, 47)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 85, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 16, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 83, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 85, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 86, 47)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 86, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 8, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 83, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 85, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 86, 47)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 87, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 87, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 89, 49), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 89, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 12, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 87, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 89, 49), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 90, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 87, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 89, 49), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 91, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 91, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 93, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 93, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 12, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 91, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 93, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 94, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 91, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 93, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 95, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 95, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 97, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 98, 67)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 97, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 16, 1)) + +function foo15(x: C, B>); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 95, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 97, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 98, 67)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 98, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 8, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 95, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 97, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 98, 67)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 99, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.types index 125b82c9915..afc2e9ae6ce 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.types @@ -10,6 +10,7 @@ class A { >x : T >T : T >T : T +>null : null } class B { @@ -22,6 +23,7 @@ class B { >x : U >U : U >U : U +>null : null } class C { @@ -35,6 +37,7 @@ class C { >x : V >V : V >V : V +>null : null } interface I { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.symbols new file mode 100644 index 00000000000..7e9f1a97f69 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.symbols @@ -0,0 +1,142 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts === +// object types are identical structurally + + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 0, 0)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 3, 12)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 3, 14)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 3, 17)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 3, 20)) + + (x: X): X; +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 4, 5)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 3, 12)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 3, 12)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 5, 1)) + + (x: Y): Y; +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 8, 5)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 8, 7)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 8, 10)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 8, 13)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 8, 17)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 8, 5)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 8, 5)) +} + +var a: { (x: Z): Z } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 3)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 10)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 12)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 18)) +>D : Symbol(D, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 25)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 10)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 10)) + +function foo1(x: I); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 35), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 13, 53), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 14, 53)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 13, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 0, 0)) + +function foo1(x: I); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 35), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 13, 53), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 14, 53)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 14, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 35), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 13, 53), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 14, 53)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 15, 14)) + +function foo2(x: I2); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 15, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 17, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 18, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 17, 14)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 5, 1)) + +function foo2(x: I2); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 15, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 17, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 18, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 18, 14)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 5, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 15, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 17, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 18, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 19, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 19, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 21, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 22, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 21, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 19, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 21, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 22, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 22, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 19, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 21, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 22, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 23, 14)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 23, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 25, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 26, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 25, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 0, 0)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 23, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 25, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 26, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 26, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 23, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 25, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 26, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 27, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 27, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 29, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 30, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 29, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 0, 0)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo14(x: I2); // error +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 27, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 29, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 30, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 30, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 5, 1)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 27, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 29, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 30, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 31, 15)) + +function foo14b(x: typeof a); +>foo14b : Symbol(foo14b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 33, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 34, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 33, 16)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 3)) + +function foo14b(x: I2); // ok +>foo14b : Symbol(foo14b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 33, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 34, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 34, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 5, 1)) + +function foo14b(x: any) { } +>foo14b : Symbol(foo14b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 33, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 34, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 35, 16)) + +function foo15(x: I); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 35, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 37, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 38, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 37, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 0, 0)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo15(x: I2); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 35, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 37, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 38, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 38, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 5, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 35, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 37, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 38, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 39, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.symbols new file mode 100644 index 00000000000..94e6aaf0139 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.symbols @@ -0,0 +1,340 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 0, 0)) + + foo(x: T): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 2, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 3, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 3, 11)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 3, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 3, 8)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 4, 1)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 6, 8)) + + foo(x: U): U { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 6, 12)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 7, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 6, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 6, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 8, 1)) +>V : Symbol(V, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 10, 8)) + + foo(x: V): V { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 10, 12)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 11, 8)) +>V : Symbol(V, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 10, 8)) +>V : Symbol(V, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 12, 1)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 14, 12)) + + foo(x: X): X; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 14, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 15, 8)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 14, 12)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 14, 12)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 16, 1)) + + foo(x: Y): Y; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 18, 14)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 19, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 19, 11)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 19, 8)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 19, 8)) +} + +var a: { foo(x: Z): Z } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 22, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 22, 8)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 22, 13)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 22, 16)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 22, 13)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 22, 13)) + +var b = { foo(x: A) { return x; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 23, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 23, 9)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 23, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 23, 17)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 23, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 23, 17)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 23, 39), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 25, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 25, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 23, 39), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 25, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 26, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 23, 39), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 25, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 27, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 27, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 29, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 30, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 29, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 27, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 29, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 30, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 30, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 27, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 29, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 30, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 31, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 33, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 33, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 33, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 34, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 33, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 35, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 35, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 37, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 38, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 37, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 35, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 37, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 38, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 38, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 35, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 37, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 38, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 39, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 39, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 41, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 41, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 22, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 39, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 41, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 42, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 22, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 39, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 41, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 43, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 43, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 45, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 45, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 23, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 43, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 45, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 46, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 23, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 43, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 45, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 47, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 47, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 49, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 49, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 0, 0)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 47, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 49, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 50, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 47, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 49, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 51, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 51, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 53, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 53, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 0, 0)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 51, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 53, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 54, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 51, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 53, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 55, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 55, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 57, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 58, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 57, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 55, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 57, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 58, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 58, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 55, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 57, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 58, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 59, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 59, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 61, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 61, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 0, 0)) + +function foo7(x: typeof a); // error +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 59, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 61, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 62, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 22, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 59, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 61, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 63, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 63, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 65, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 65, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 4, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 63, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 65, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 66, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 63, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 65, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 67, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 67, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 69, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 69, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 4, 1)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 67, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 69, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 70, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 67, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 69, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 71, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 71, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 73, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 73, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 4, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 71, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 73, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 74, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 22, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 71, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 73, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 75, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 75, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 77, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 77, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 4, 1)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 75, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 77, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 78, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 23, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 75, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 77, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 79, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 79, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 81, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 81, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 12, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 79, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 81, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 82, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 79, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 81, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 83, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 83, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 85, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 85, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 16, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 83, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 85, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 86, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 8, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 83, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 85, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 87, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 87, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 89, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 89, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 12, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 87, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 89, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 90, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 22, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 87, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 89, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 91, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 91, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 93, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 93, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 12, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 91, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 93, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 94, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 23, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 91, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 93, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 95, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 95, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 97, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 97, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 16, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 95, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 97, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 98, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 8, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 95, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 97, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 99, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.types index fd0b14a4f79..52acb56dfaf 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.types @@ -10,6 +10,7 @@ class A { >x : T >T : T >T : T +>null : null } class B { @@ -21,6 +22,7 @@ class B { >x : U >U : U >U : U +>null : null } class C { @@ -32,6 +34,7 @@ class C { >x : V >V : V >V : V +>null : null } interface I { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.symbols new file mode 100644 index 00000000000..0bb008d82be --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.symbols @@ -0,0 +1,356 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 0, 0)) + + foo(x: T, y?: T): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 4, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 5, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 5, 11)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 5, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 5, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 5, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 5, 8)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 8, 8)) + + foo(x: T, y?: T): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 8, 12)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 9, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 8, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 9, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 8, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 8, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 10, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 12, 8)) + + foo(x: T, y?: T): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 12, 12)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 13, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 12, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 13, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 12, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 12, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 14, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 16, 12)) + + foo(x: T, y?: T): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 16, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 17, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 16, 12)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 17, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 16, 12)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 16, 12)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 18, 1)) + + foo(x: T, y?: T): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 20, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 21, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 21, 11)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 21, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 21, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 21, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 21, 8)) +} + +var a: { foo(x: T, y?: T): T } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 24, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 24, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 24, 13)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 24, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 24, 13)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 24, 21)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 24, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 24, 13)) + +var b = { foo(x: T, y?: T) { return x; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 17)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 14)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 22)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 17)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 46), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 27, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 46), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 28, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 46), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 29, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 31, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 32, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 31, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 6, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 31, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 32, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 32, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 6, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 31, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 32, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 33, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 35, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 36, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 35, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 10, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 35, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 36, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 36, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 10, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 35, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 36, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 37, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 39, 28), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 40, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 39, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 14, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 39, 28), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 40, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 40, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 14, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 39, 28), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 40, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 41, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 43, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 24, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 44, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 24, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 45, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 47, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 48, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 49, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 51, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 0, 0)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 52, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 6, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 53, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 56, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 55, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 0, 0)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 56, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 56, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 10, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 56, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 57, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 60, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 59, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 60, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 60, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 14, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 60, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 61, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 63, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 0, 0)) + +function foo7(x: typeof a); // no error, bug? +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 64, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 24, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 65, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 67, 28), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 67, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 6, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 67, 28), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 68, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 14, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 67, 28), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 69, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 71, 28), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 71, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 6, 1)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 71, 28), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 72, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 10, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 71, 28), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 73, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 75, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 75, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 6, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 75, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 76, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 24, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 75, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 77, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 79, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 79, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 6, 1)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 79, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 80, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 79, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 81, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 83, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 84, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 83, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 14, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 83, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 84, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 84, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 10, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 83, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 84, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 85, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 88, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 87, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 18, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 88, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 88, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 10, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 88, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 89, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 91, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 91, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 14, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 91, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 92, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 24, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 91, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 93, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 95, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 95, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 14, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 95, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 96, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 95, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 97, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 100, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 99, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 18, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 100, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 100, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 10, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 100, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 101, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.types index 33fce5295a7..da6144b57e2 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.types @@ -14,6 +14,7 @@ class A { >y : T >T : T >T : T +>null : null } class B { @@ -27,6 +28,7 @@ class B { >y : T >T : T >T : T +>null : null } class C { @@ -40,6 +42,7 @@ class C { >y : T >T : T >T : T +>null : null } interface I { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.symbols new file mode 100644 index 00000000000..8878d73f576 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.symbols @@ -0,0 +1,363 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 0, 0)) + + foo(x: T, y?: U): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 4, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 5, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 5, 10)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 5, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 5, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 5, 19)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 5, 10)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 5, 8)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 8, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 8, 10)) + + foo(x: T, y?: U): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 8, 15)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 9, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 8, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 9, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 8, 10)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 8, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 10, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 12, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 12, 10)) + + foo(x: T, y?: U): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 12, 15)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 13, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 12, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 13, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 12, 10)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 12, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 14, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 16, 12)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 16, 14)) + + foo(x: T, y?: U): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 16, 19)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 17, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 16, 12)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 17, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 16, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 16, 12)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 18, 1)) + + foo(x: T, y?: U): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 20, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 21, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 21, 10)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 21, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 21, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 21, 19)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 21, 10)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 21, 8)) +} + +var a: { foo(x: T, y?: U): T } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 15)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 19)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 13)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 24)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 15)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 13)) + +var b = { foo(x: T, y?: U) { return x; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 14)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 20)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 14)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 25)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 20)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 49), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 27, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 49), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 28, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 49), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 29, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 31, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 32, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 31, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 6, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 31, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 32, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 32, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 6, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 31, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 32, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 33, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 35, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 36, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 35, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 10, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 35, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 36, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 36, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 10, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 35, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 36, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 37, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 39, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 40, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 39, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 14, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 39, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 40, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 40, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 14, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 39, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 40, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 41, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 43, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 44, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 45, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 47, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 48, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 49, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 52, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 51, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 0, 0)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 52, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 52, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 6, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 52, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 53, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 56, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 55, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 0, 0)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 56, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 56, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 10, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 56, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 57, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 60, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 59, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 60, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 60, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 14, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 60, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 61, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 63, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 0, 0)) + +function foo7(x: typeof a); // no error, bug? +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 64, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 65, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 67, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 68, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 67, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 6, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 67, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 68, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 68, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 14, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 67, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 68, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 69, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 71, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 72, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 71, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 6, 1)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 71, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 72, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 72, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 10, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 71, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 72, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 73, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 75, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 75, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 6, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 75, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 76, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 75, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 77, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 79, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 79, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 6, 1)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 79, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 80, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 79, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 81, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 83, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 84, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 83, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 14, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 83, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 84, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 84, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 10, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 83, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 84, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 85, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 88, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 87, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 18, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 88, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 88, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 10, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 88, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 89, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 91, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 91, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 14, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 91, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 92, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 91, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 93, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 95, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 95, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 14, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 95, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 96, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 95, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 97, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 100, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 99, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 18, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 100, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 100, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 10, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 100, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 101, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.types index 2d9eab7c540..09478fc5d35 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.types @@ -15,6 +15,7 @@ class A { >y : U >U : U >T : T +>null : null } class B { @@ -29,6 +30,7 @@ class B { >y : U >U : U >T : T +>null : null } class C { @@ -43,6 +45,7 @@ class C { >y : U >U : U >T : T +>null : null } interface I { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.symbols new file mode 100644 index 00000000000..b1cfab012bf --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.symbols @@ -0,0 +1,363 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 0, 0)) + + foo(x: T, y?: U): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 4, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 5, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 5, 10)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 5, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 5, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 5, 19)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 5, 10)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 5, 8)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 8, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 8, 10)) + + foo(x: T, y: U): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 8, 15)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 9, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 8, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 9, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 8, 10)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 8, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 10, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 12, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 12, 10)) + + foo(x: T, y?: U): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 12, 15)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 13, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 12, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 13, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 12, 10)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 12, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 14, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 16, 12)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 16, 14)) + + foo(x: T, y?: U): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 16, 19)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 17, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 16, 12)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 17, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 16, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 16, 12)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 18, 1)) + + foo(x: T, y: U): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 20, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 21, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 21, 10)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 21, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 21, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 21, 19)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 21, 10)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 21, 8)) +} + +var a: { foo(x: T, y?: U): T } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 15)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 19)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 13)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 24)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 15)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 13)) + +var b = { foo(x: T, y: U) { return x; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 14)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 20)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 14)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 25)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 20)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 48), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 27, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 48), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 28, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 48), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 29, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 31, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 32, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 31, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 6, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 31, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 32, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 32, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 6, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 31, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 32, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 33, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 35, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 36, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 35, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 10, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 35, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 36, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 36, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 10, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 35, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 36, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 37, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 39, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 40, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 39, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 14, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 39, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 40, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 40, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 14, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 39, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 40, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 41, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 43, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 44, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 45, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 47, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 48, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 49, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 52, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 51, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 0, 0)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 52, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 52, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 6, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 52, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 53, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 56, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 55, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 0, 0)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 56, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 56, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 10, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 56, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 57, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 60, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 59, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 60, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 60, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 14, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 60, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 61, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 63, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 0, 0)) + +function foo7(x: typeof a); // no error, bug? +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 64, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 65, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 67, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 68, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 67, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 6, 1)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 67, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 68, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 68, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 14, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 67, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 68, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 69, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 71, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 72, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 71, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 6, 1)) + +function foo9(x: C); // ok +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 71, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 72, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 72, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 10, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 71, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 72, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 73, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 75, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 75, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 6, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 75, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 76, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 75, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 77, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 79, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 79, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 6, 1)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 79, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 80, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 79, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 81, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 83, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 84, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 83, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 14, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 83, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 84, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 84, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 10, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 83, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 84, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 85, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 88, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 87, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 18, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 88, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 88, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 10, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 88, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 89, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 91, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 91, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 14, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 91, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 92, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 91, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 93, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 95, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 95, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 14, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 95, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 96, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 95, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 97, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 100, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 99, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 18, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 100, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 100, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 10, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 100, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 101, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.types index 54ec438104e..d0356784ed6 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.types @@ -15,6 +15,7 @@ class A { >y : U >U : U >T : T +>null : null } class B { @@ -29,6 +30,7 @@ class B { >y : U >U : U >T : T +>null : null } class C { @@ -43,6 +45,7 @@ class C { >y : U >U : U >T : T +>null : null } interface I { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.symbols new file mode 100644 index 00000000000..6f53dcf17b2 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.symbols @@ -0,0 +1,259 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class B> { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 4, 8)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + + constructor(x: T) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 5, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 4, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 8, 8)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + + constructor(x: T) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 9, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 8, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 12, 12)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + + new(x: T): string; +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 13, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 12, 12)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 14, 1)) + + new(x: T): string; +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 17, 8)) +>Boolean : Symbol(Boolean, Decl(lib.d.ts, 443, 38), Decl(lib.d.ts, 456, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 17, 27)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 17, 8)) +} + +var a: { new>(x: T): string } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 20, 3)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 20, 13)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 20, 38)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 20, 13)) + +var b = { new(x: T) { return ''; } }; // not a construct signature, function called new +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 21, 3)) +>new : Symbol(new, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 21, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 21, 14)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 21, 32)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 21, 14)) + +function foo1b(x: B>); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 21, 55), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 23, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 24, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 23, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 0, 0)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +function foo1b(x: B>); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 21, 55), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 23, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 24, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 24, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 0, 0)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 21, 55), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 23, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 24, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 25, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 27, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 28, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 27, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 6, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 27, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 28, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 28, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 6, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 27, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 28, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 29, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 31, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 32, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 31, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 10, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 31, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 32, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 32, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 10, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 31, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 32, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 33, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 35, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 20, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 36, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 20, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 37, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 39, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 21, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 40, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 21, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 41, 14)) + +function foo8(x: B>); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 43, 35), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 44, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 43, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 0, 0)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 43, 35), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 44, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 44, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 10, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 43, 35), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 44, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 45, 14)) + +function foo9(x: B>); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 47, 35), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 48, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 47, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 0, 0)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +function foo9(x: C); // error, types are structurally equal +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 47, 35), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 48, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 48, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 6, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 47, 35), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 48, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 49, 14)) + +function foo10(x: B>); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 51, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 51, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 0, 0)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 51, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 52, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 20, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 51, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 53, 15)) + +function foo11(x: B>); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 55, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 55, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 0, 0)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 55, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 56, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 21, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 55, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 57, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 59, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 60, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 59, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 10, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 59, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 60, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 60, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 6, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 59, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 60, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 61, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 64, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 63, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 14, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 64, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 64, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 6, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 64, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 65, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 67, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 67, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 10, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 67, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 68, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 20, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 67, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 69, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 71, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 71, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 10, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 71, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 72, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 21, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 71, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 73, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.types index 7acc93db124..ef3ec91f479 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.types @@ -11,6 +11,7 @@ class B> { constructor(x: T) { return null; } >x : T >T : T +>null : null } class C { @@ -21,6 +22,7 @@ class C { constructor(x: T) { return null; } >x : T >T : T +>null : null } interface I { @@ -58,6 +60,7 @@ var b = { new(x: T) { return ''; } }; // not a construct signa >RegExp : RegExp >x : T >T : T +>'' : string function foo1b(x: B>); >foo1b : { (x: B): any; (x: B): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.symbols new file mode 100644 index 00000000000..703ee5d3cc4 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.symbols @@ -0,0 +1,268 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 4, 8)) + + constructor(x: T) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 5, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 4, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 8, 8)) + + constructor(x: T) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 9, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 8, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 10, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 12, 12)) + + new(x: T): Date; +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 13, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 12, 12)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 14, 1)) + + new(x: T): RegExp; +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 17, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 17, 11)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 17, 8)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) +} + +var a: { new(x: T): T } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 20, 3)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 20, 13)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 20, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 20, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 20, 13)) + +var b = { new(x: T): T { return null; } }; // not a construct signature, function called new +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 3)) +>new : Symbol(new, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 17)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 45), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 23, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 24, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 23, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 0, 0)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 45), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 23, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 24, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 24, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 0, 0)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 45), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 23, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 24, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 25, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 27, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 28, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 27, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 6, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 27, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 28, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 28, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 6, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 27, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 28, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 29, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 31, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 32, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 31, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 10, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 31, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 32, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 32, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 10, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 31, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 32, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 33, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 35, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 20, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 36, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 20, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 37, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 39, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 40, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 41, 14)) + +function foo5(x: typeof a): number; +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 43, 35), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 44, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 43, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 20, 3)) + +function foo5(x: typeof b): string; // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 43, 35), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 44, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 44, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 3)) + +function foo5(x: any): any { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 43, 35), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 44, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 45, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 45, 30), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 47, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 48, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 47, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 0, 0)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 45, 30), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 47, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 48, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 48, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 10, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 45, 30), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 47, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 48, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 49, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 51, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 51, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 0, 0)) + +function foo9(x: C); // error since types are structurally equal +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 51, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 52, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 6, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 51, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 53, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 53, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 55, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 55, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 0, 0)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 53, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 55, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 56, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 20, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 53, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 55, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 57, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 59, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 60, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 59, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 0, 0)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 59, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 60, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 60, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 59, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 60, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 61, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 63, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 64, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 63, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 10, 1)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 63, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 64, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 64, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 6, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 63, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 64, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 65, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 65, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 67, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 68, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 67, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 14, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 65, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 67, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 68, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 68, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 6, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 65, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 67, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 68, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 69, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 69, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 71, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 71, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 10, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 69, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 71, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 72, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 20, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 69, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 71, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 73, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 73, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 75, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 75, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 10, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 73, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 75, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 76, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 73, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 75, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 77, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 77, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 79, 22), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 80, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 79, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 14, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 77, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 79, 22), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 80, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 80, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 6, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 77, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 79, 22), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 80, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 81, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.types index 4b2e628ad5d..657c38aae9a 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.types @@ -10,6 +10,7 @@ class B { constructor(x: T) { return null; } >x : T >T : T +>null : null } class C { @@ -19,6 +20,7 @@ class C { constructor(x: T) { return null; } >x : T >T : T +>null : null } interface I { @@ -56,6 +58,7 @@ var b = { new(x: T): T { return null; } }; // not a construct signature, func >x : T >T : T >T : T +>null : null function foo1b(x: B); >foo1b : { (x: B): any; (x: B): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.symbols new file mode 100644 index 00000000000..faa0995c2dd --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.symbols @@ -0,0 +1,277 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 4, 8)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + constructor(x: T) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 5, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 4, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 8, 8)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + constructor(x: T) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 9, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 8, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 10, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 12, 12)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + new(x: T): Date; +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 13, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 12, 12)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 14, 1)) + + new(x: T): RegExp; +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 17, 8)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 17, 24)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 17, 8)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) +} + +var a: { new(x: T): T } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 20, 3)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 20, 13)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 20, 29)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 20, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 20, 13)) + +var b = { new(x: T) { return null; } }; // not a construct signature, function called new +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 3)) +>new : Symbol(new, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 14)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 30)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 55), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 23, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 24, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 23, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 0, 0)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 55), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 23, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 24, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 24, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 0, 0)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 55), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 23, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 24, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 25, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 27, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 28, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 27, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 6, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 27, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 28, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 28, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 6, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 27, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 28, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 29, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 31, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 32, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 31, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 10, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 31, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 32, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 32, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 10, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 31, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 32, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 33, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 35, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 20, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 36, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 20, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 37, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 39, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 40, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 41, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 43, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 44, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 43, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 0, 0)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 43, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 44, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 44, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 10, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 43, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 44, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 45, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 47, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 48, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 47, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 0, 0)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo9(x: C); // error since types are structurally equal +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 47, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 48, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 48, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 6, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 47, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 48, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 49, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 51, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 51, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 0, 0)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 51, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 52, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 20, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 51, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 53, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 55, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 55, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 0, 0)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 55, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 56, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 55, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 57, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 59, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 60, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 59, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 10, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 59, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 60, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 60, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 6, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 59, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 60, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 61, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 64, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 63, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 14, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 64, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 64, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 6, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 64, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 65, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 67, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 67, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 10, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 67, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 68, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 20, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 67, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 69, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 71, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 71, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 10, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 71, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 72, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 71, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 73, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 73, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 75, 22), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 76, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 75, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 14, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 73, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 75, 22), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 76, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 76, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 6, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 73, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 75, 22), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 76, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 77, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.types index a25fb5b876a..181acc2ce91 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.types @@ -11,6 +11,7 @@ class B { constructor(x: T) { return null; } >x : T >T : T +>null : null } class C { @@ -21,6 +22,7 @@ class C { constructor(x: T) { return null; } >x : T >T : T +>null : null } interface I { @@ -61,6 +63,7 @@ var b = { new(x: T) { return null; } }; // not a construct signa >Date : Date >x : T >T : T +>null : null function foo1b(x: B); >foo1b : { (x: B): any; (x: B): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.symbols new file mode 100644 index 00000000000..d7797a833c9 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.symbols @@ -0,0 +1,275 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts === +// object types are identical structurally + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 0, 0)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 2, 8)) +>V : Symbol(V, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 2, 10)) + + constructor(x: U) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 3, 16)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 2, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 4, 1)) +>V : Symbol(V, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 6, 8)) +>W : Symbol(W, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 6, 10)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 6, 13)) + + constructor(x: V) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 7, 16)) +>V : Symbol(V, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 6, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 8, 1)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 10, 12)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 10, 14)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 10, 17)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 10, 20)) + + new(x: X): B; +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 11, 8)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 10, 12)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 0, 0)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 10, 12)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 10, 14)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 12, 1)) + + new (x: Y): C; +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 15, 9)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 15, 11)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 15, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 15, 17)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 15, 21)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 15, 9)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 4, 1)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 15, 9)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 15, 11)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 15, 14)) +} + +var a: { new (x: Z): C; } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 3)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 19)) +>CC : Symbol(CC, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 22)) +>D : Symbol(D, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 30)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 4, 1)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 19)) + +var b = { new(x: A) { return x; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 3)) +>new : Symbol(new, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 9)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 19)) +>D : Symbol(D, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 22)) +>E : Symbol(E, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 25)) +>F : Symbol(F, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 32)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 32)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 54), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 21, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 22, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 21, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 54), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 21, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 22, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 22, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 54), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 21, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 22, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 23, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 23, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 25, 46), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 26, 46)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 25, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 4, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 23, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 25, 46), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 26, 46)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 26, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 4, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 23, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 25, 46), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 26, 46)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 27, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 27, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 29, 53), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 30, 53)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 29, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 8, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 27, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 29, 53), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 30, 53)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 30, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 8, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 27, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 29, 53), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 30, 53)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 31, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 31, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 33, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 33, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 31, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 33, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 34, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 31, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 33, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 35, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 35, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 37, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 37, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 35, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 37, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 38, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 35, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 37, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 39, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 39, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 41, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 42, 51)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 41, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + +function foo8(x: I); // BUG 832086 +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 39, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 41, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 42, 51)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 42, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 8, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 39, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 41, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 42, 51)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 43, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 43, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 45, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 46, 55)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 45, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + +function foo9(x: C>); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 43, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 45, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 46, 55)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 46, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 4, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 43, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 45, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 46, 55)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 47, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 47, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 49, 38), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 49, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 47, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 49, 38), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 50, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 47, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 49, 38), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 51, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 51, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 53, 38), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 53, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 51, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 53, 38), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 54, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 51, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 53, 38), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 55, 15)) + +function foo12(x: I, number, Date, string>); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 55, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 57, 62), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 58, 54)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 57, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 8, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 0, 0)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo12(x: C, number, Date>); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 55, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 57, 62), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 58, 54)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 58, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 4, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 0, 0)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 55, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 57, 62), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 58, 54)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 59, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 59, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 61, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 62, 47)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 61, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 12, 1)) + +function foo12b(x: C); // BUG 832086 +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 59, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 61, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 62, 47)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 62, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 4, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 59, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 61, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 62, 47)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 63, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 63, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 65, 49), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 65, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 8, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 63, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 65, 49), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 66, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 63, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 65, 49), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 67, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 67, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 69, 52), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 69, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 8, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 67, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 69, 52), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 70, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 67, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 69, 52), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 71, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.types index 683c3ace9f9..b8e7c15c9b5 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.types @@ -9,6 +9,7 @@ class B { constructor(x: U) { return null; } >x : U >U : U +>null : null } class C { @@ -20,6 +21,7 @@ class C { constructor(x: V) { return null; } >x : V >V : V +>null : null } interface I { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.symbols new file mode 100644 index 00000000000..6e31b7fcc41 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.symbols @@ -0,0 +1,243 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts === +// object types are identical structurally + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 0, 0)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 2, 8)) + + constructor(x: U) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 3, 16)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 2, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 4, 1)) +>V : Symbol(V, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 6, 8)) + + constructor(x: V) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 7, 16)) +>V : Symbol(V, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 6, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 8, 1)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 10, 12)) + + new(x: X): B; +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 11, 8)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 10, 12)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 0, 0)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 10, 12)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 12, 1)) + + new(x: Y): C; +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 15, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 15, 11)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 15, 8)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 4, 1)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 15, 8)) +} + +var a: { new(x: Z): B } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 18, 3)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 18, 13)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 18, 16)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 18, 13)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 0, 0)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 18, 13)) + +var b = { new(x: A) { return new C(x); } }; +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 3)) +>new : Symbol(new, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 9)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 17)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 4, 1)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 17)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 49), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 21, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 22, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 21, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 0, 0)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 49), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 21, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 22, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 22, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 0, 0)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 49), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 21, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 22, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 23, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 23, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 25, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 26, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 25, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 4, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 23, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 25, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 26, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 26, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 4, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 23, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 25, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 26, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 27, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 27, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 29, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 30, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 29, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 8, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 27, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 29, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 30, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 30, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 8, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 27, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 29, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 30, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 31, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 31, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 33, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 33, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 18, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 31, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 33, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 34, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 18, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 31, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 33, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 35, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 35, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 37, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 37, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 35, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 37, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 38, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 35, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 37, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 39, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 39, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 41, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 42, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 41, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 0, 0)) + +function foo8(x: I); // BUG 832086 +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 39, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 41, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 42, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 42, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 8, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 39, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 41, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 42, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 43, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 43, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 45, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 46, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 45, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 0, 0)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 43, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 45, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 46, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 46, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 4, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 43, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 45, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 46, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 47, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 47, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 49, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 49, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 0, 0)) + +function foo10(x: typeof a); // BUG 832086 +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 47, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 49, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 50, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 18, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 47, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 49, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 51, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 51, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 53, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 53, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 0, 0)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 51, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 53, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 54, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 51, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 53, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 55, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 55, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 57, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 57, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 8, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 55, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 57, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 58, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 4, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 55, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 57, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 59, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 59, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 61, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 62, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 61, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 12, 1)) + +function foo12b(x: C); // BUG 832086 +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 59, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 61, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 62, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 62, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 4, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 59, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 61, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 62, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 63, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 63, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 65, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 65, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 8, 1)) + +function foo13(x: typeof a); // BUG 832086 +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 63, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 65, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 66, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 18, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 63, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 65, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 67, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 67, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 69, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 69, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 8, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 67, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 69, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 70, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 67, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 69, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 71, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.types index af65ca5b911..db188b1b358 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.types @@ -8,6 +8,7 @@ class B { constructor(x: U) { return null; } >x : U >U : U +>null : null } class C { @@ -17,6 +18,7 @@ class C { constructor(x: V) { return null; } >x : V >V : V +>null : null } interface I { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.symbols new file mode 100644 index 00000000000..c42a6ae4341 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.symbols @@ -0,0 +1,258 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 4, 8)) + + constructor(x: T, y?: T) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 5, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 4, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 5, 21)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 4, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 8, 8)) + + constructor(x: T, y?: T) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 9, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 8, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 9, 21)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 8, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 10, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 12, 12)) + + new(x: T, y?: T): B; +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 13, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 12, 12)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 13, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 12, 12)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 12, 12)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 14, 1)) + + new(x: T, y?: T): C; +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 17, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 17, 11)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 17, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 17, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 17, 8)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 17, 8)) +} + +var a: { new(x: T, y?: T): B } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 20, 3)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 20, 13)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 20, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 20, 13)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 20, 21)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 20, 13)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 20, 13)) + +var b = { new(x: T, y?: T) { return new C(x, y); } }; // not a construct signature, function called new +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 3)) +>new : Symbol(new, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 17)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 14)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 22)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 17)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 22)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 59), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 23, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 24, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 23, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 0, 0)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 59), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 23, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 24, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 24, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 0, 0)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 59), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 23, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 24, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 25, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 27, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 28, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 27, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 6, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 27, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 28, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 28, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 6, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 27, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 28, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 29, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 31, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 32, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 31, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 10, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 31, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 32, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 32, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 10, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 31, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 32, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 33, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 35, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 20, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 36, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 20, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 37, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 39, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 40, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 41, 14)) + +function foo8(x: B): string; +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 43, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 44, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 43, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 0, 0)) + +function foo8(x: I): number; // BUG 832086 +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 43, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 44, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 44, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 10, 1)) + +function foo8(x: any): any { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 43, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 44, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 45, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 45, 30), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 47, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 48, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 47, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 0, 0)) + +function foo9(x: C); // error, differ only by return type +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 45, 30), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 47, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 48, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 48, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 6, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 45, 30), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 47, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 48, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 49, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 51, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 51, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 0, 0)) + +function foo10(x: typeof a); // BUG 832086 +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 51, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 52, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 20, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 51, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 53, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 55, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 55, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 0, 0)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 55, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 56, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 55, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 57, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 59, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 60, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 59, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 10, 1)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 59, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 60, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 60, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 6, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 59, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 60, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 61, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 64, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 63, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 14, 1)) + +function foo12b(x: C); // BUG 832086 +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 64, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 64, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 6, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 64, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 65, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 67, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 67, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 10, 1)) + +function foo13(x: typeof a); // BUG 832086 +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 67, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 68, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 20, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 67, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 69, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 71, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 71, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 10, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 71, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 72, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 71, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 73, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.types index a6dea7c2518..027fe3b0043 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.types @@ -12,6 +12,7 @@ class B { >T : T >y : T >T : T +>null : null } class C { @@ -23,6 +24,7 @@ class C { >T : T >y : T >T : T +>null : null } interface I { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.symbols new file mode 100644 index 00000000000..44bc153cd8f --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.symbols @@ -0,0 +1,268 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 4, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 4, 10)) + + constructor(x: T, y?: U) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 5, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 4, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 5, 21)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 4, 10)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 8, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 8, 10)) + + constructor(x: T, y?: U) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 9, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 8, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 9, 21)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 8, 10)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 10, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 12, 12)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 12, 14)) + + new (x: T, y?: U): B; +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 13, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 12, 12)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 13, 14)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 12, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 12, 12)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 12, 14)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 14, 1)) + + new (x: T, y?: U): C; +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 17, 9)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 17, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 17, 15)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 17, 9)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 17, 20)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 17, 11)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 17, 9)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 17, 11)) +} + +var a: { new(x: T, y?: U): B } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 20, 3)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 20, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 20, 15)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 20, 19)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 20, 13)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 20, 24)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 20, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 20, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 20, 15)) + +var b = { new(x: T, y?: U) { return new C(x, y); } }; // not a construct signature, function called new +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 3)) +>new : Symbol(new, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 14)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 20)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 14)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 25)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 14)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 20)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 25)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 65), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 23, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 24, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 23, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 0, 0)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 65), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 23, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 24, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 24, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 0, 0)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 65), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 23, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 24, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 25, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 27, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 28, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 27, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 6, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 27, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 28, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 28, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 6, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 27, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 28, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 29, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 31, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 32, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 31, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 10, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 31, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 32, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 32, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 10, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 31, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 32, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 33, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 35, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 20, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 36, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 20, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 37, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 39, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 40, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 41, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 43, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 44, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 43, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 0, 0)) + +function foo8(x: I); // BUG 832086 +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 43, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 44, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 44, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 10, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 43, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 44, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 45, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 47, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 48, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 47, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 0, 0)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 47, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 48, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 48, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 6, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 47, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 48, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 49, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 51, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 51, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 0, 0)) + +function foo10(x: typeof a); // BUG 832086 +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 51, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 52, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 20, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 51, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 53, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 55, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 55, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 0, 0)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 55, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 56, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 55, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 57, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 59, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 60, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 59, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 10, 1)) + +function foo12(x: C); // BUG 832086 +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 59, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 60, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 60, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 6, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 59, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 60, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 61, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 64, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 63, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 14, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 64, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 64, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 6, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 64, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 65, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 67, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 67, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 10, 1)) + +function foo13(x: typeof a); // BUG 832086 +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 67, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 68, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 20, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 67, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 69, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 71, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 71, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 10, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 71, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 72, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 71, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 73, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.types index 3c0f09e61da..9a415f6cbf4 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.types @@ -13,6 +13,7 @@ class B { >T : T >y : U >U : U +>null : null } class C { @@ -25,6 +26,7 @@ class C { >T : T >y : U >U : U +>null : null } interface I { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.symbols new file mode 100644 index 00000000000..3eb24d1b400 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.symbols @@ -0,0 +1,268 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 4, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 4, 10)) + + constructor(x: T, y: U) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 5, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 4, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 5, 21)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 4, 10)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 8, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 8, 10)) + + constructor(x: T, y?: U) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 9, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 8, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 9, 21)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 8, 10)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 10, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 12, 12)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 12, 14)) + + new(x: T, y?: U): B; +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 13, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 12, 12)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 13, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 12, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 12, 12)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 12, 14)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 14, 1)) + + new(x: T, y: U): C; +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 17, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 17, 10)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 17, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 17, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 17, 19)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 17, 10)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 17, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 17, 10)) +} + +var a: { new (x: T, y?: U): B }; +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 20, 3)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 20, 14)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 20, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 20, 20)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 20, 14)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 20, 25)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 20, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 20, 14)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 20, 16)) + +var b = { new(x: T, y: U) { return new C(x, y); } }; // not a construct signature, function called new +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 3)) +>new : Symbol(new, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 14)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 20)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 14)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 25)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 14)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 20)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 25)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 64), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 23, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 24, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 23, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 0, 0)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 64), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 23, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 24, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 24, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 0, 0)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 64), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 23, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 24, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 25, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 27, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 28, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 27, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 6, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 27, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 28, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 28, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 6, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 27, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 28, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 29, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 31, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 32, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 31, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 10, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 31, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 32, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 32, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 10, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 31, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 32, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 33, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 35, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 20, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 36, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 20, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 37, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 39, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 40, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 41, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 43, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 44, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 43, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 0, 0)) + +function foo8(x: I); // BUG 832086 +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 43, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 44, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 44, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 10, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 43, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 44, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 45, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 47, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 48, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 47, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 0, 0)) + +function foo9(x: C); // error, differ only by return type +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 47, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 48, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 48, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 6, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 47, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 48, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 49, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 51, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 51, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 0, 0)) + +function foo10(x: typeof a); // BUG 832086 +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 51, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 52, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 20, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 51, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 53, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 55, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 55, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 0, 0)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 55, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 56, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 55, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 57, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 59, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 60, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 59, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 10, 1)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 59, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 60, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 60, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 6, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 59, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 60, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 61, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 64, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 63, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 14, 1)) + +function foo12b(x: C); // BUG 832086 +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 64, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 64, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 6, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 64, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 65, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 67, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 67, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 10, 1)) + +function foo13(x: typeof a); // BUG 832086 +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 67, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 68, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 20, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 67, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 69, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 71, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 71, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 10, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 71, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 72, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 71, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 73, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.types index f21ccc15abb..c73d45260f9 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.types @@ -13,6 +13,7 @@ class B { >T : T >y : U >U : U +>null : null } class C { @@ -25,6 +26,7 @@ class C { >T : T >y : U >U : U +>null : null } interface I { diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.symbols b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.symbols new file mode 100644 index 00000000000..4a2eb1ab2a1 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.symbols @@ -0,0 +1,377 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithNumericIndexers1.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers1.ts, 0, 0)) + + [x: number]: string; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 3, 5)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers1.ts, 4, 1)) + + [x: number]: string; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 7, 5)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers1.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithNumericIndexers1.ts, 10, 8)) + + [x: number]: T; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 11, 5)) +>T : Symbol(T, Decl(objectTypesIdentityWithNumericIndexers1.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers1.ts, 12, 1)) + + [x: number]: string; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 15, 5)) +} + +class PA extends A { +>PA : Symbol(PA, Decl(objectTypesIdentityWithNumericIndexers1.ts, 16, 1)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers1.ts, 0, 0)) +} + +class PB extends B { +>PB : Symbol(PB, Decl(objectTypesIdentityWithNumericIndexers1.ts, 19, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers1.ts, 4, 1)) +} + +var a: { +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers1.ts, 24, 3)) + + [x: number]: string; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 25, 5)) +} +var b: { [x: number]: string; } = { foo: '' }; +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 27, 3)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 27, 10)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithNumericIndexers1.ts, 27, 35)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithNumericIndexers1.ts, 27, 46), Decl(objectTypesIdentityWithNumericIndexers1.ts, 29, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 29, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers1.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithNumericIndexers1.ts, 27, 46), Decl(objectTypesIdentityWithNumericIndexers1.ts, 29, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 30, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers1.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithNumericIndexers1.ts, 27, 46), Decl(objectTypesIdentityWithNumericIndexers1.ts, 29, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 31, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 31, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 33, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 34, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 33, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers1.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 31, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 33, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 34, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 34, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers1.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 31, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 33, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 34, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 35, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithNumericIndexers1.ts, 35, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 37, 29), Decl(objectTypesIdentityWithNumericIndexers1.ts, 38, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 37, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers1.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithNumericIndexers1.ts, 35, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 37, 29), Decl(objectTypesIdentityWithNumericIndexers1.ts, 38, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 38, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers1.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithNumericIndexers1.ts, 35, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 37, 29), Decl(objectTypesIdentityWithNumericIndexers1.ts, 38, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 39, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithNumericIndexers1.ts, 39, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 41, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 41, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers1.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithNumericIndexers1.ts, 39, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 41, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 42, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers1.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithNumericIndexers1.ts, 39, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 41, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 43, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithNumericIndexers1.ts, 43, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 45, 27), Decl(objectTypesIdentityWithNumericIndexers1.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 45, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers1.ts, 24, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithNumericIndexers1.ts, 43, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 45, 27), Decl(objectTypesIdentityWithNumericIndexers1.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 46, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers1.ts, 24, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithNumericIndexers1.ts, 43, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 45, 27), Decl(objectTypesIdentityWithNumericIndexers1.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 47, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithNumericIndexers1.ts, 47, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 49, 27), Decl(objectTypesIdentityWithNumericIndexers1.ts, 50, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 49, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 27, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithNumericIndexers1.ts, 47, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 49, 27), Decl(objectTypesIdentityWithNumericIndexers1.ts, 50, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 50, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 27, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithNumericIndexers1.ts, 47, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 49, 27), Decl(objectTypesIdentityWithNumericIndexers1.ts, 50, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 51, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithNumericIndexers1.ts, 51, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 53, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 53, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers1.ts, 0, 0)) + +function foo5(x: B); // error +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithNumericIndexers1.ts, 51, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 53, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 54, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers1.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithNumericIndexers1.ts, 51, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 53, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 55, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 55, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 57, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 57, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers1.ts, 0, 0)) + +function foo5b(x: C); // error +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 55, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 57, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 58, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers1.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 55, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 57, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 59, 15)) + +function foo5c(x: A); +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithNumericIndexers1.ts, 59, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 61, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 62, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 61, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers1.ts, 0, 0)) + +function foo5c(x: PA); // error +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithNumericIndexers1.ts, 59, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 61, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 62, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 62, 15)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithNumericIndexers1.ts, 16, 1)) + +function foo5c(x: any) { } +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithNumericIndexers1.ts, 59, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 61, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 62, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 63, 15)) + +function foo5d(x: A); +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithNumericIndexers1.ts, 63, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 65, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 66, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 65, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers1.ts, 0, 0)) + +function foo5d(x: PB); // error +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithNumericIndexers1.ts, 63, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 65, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 66, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 66, 15)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithNumericIndexers1.ts, 19, 1)) + +function foo5d(x: any) { } +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithNumericIndexers1.ts, 63, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 65, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 66, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 67, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithNumericIndexers1.ts, 67, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 69, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 70, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 69, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers1.ts, 0, 0)) + +function foo6(x: I); // error +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithNumericIndexers1.ts, 67, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 69, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 70, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 70, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers1.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithNumericIndexers1.ts, 67, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 69, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 70, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 71, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithNumericIndexers1.ts, 71, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 73, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 74, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 73, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers1.ts, 0, 0)) + +function foo7(x: typeof a); // error +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithNumericIndexers1.ts, 71, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 73, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 74, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 74, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers1.ts, 24, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithNumericIndexers1.ts, 71, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 73, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 74, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 75, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithNumericIndexers1.ts, 75, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 77, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 78, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 77, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers1.ts, 4, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithNumericIndexers1.ts, 75, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 77, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 78, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 78, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers1.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithNumericIndexers1.ts, 75, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 77, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 78, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 79, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithNumericIndexers1.ts, 79, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 81, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 81, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers1.ts, 4, 1)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithNumericIndexers1.ts, 79, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 81, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 82, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers1.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithNumericIndexers1.ts, 79, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 81, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 83, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithNumericIndexers1.ts, 83, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 85, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 85, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers1.ts, 4, 1)) + +function foo10(x: typeof a); // error +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithNumericIndexers1.ts, 83, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 85, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 86, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers1.ts, 24, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithNumericIndexers1.ts, 83, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 85, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 87, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithNumericIndexers1.ts, 87, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 89, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 89, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers1.ts, 4, 1)) + +function foo11(x: typeof b); // error +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithNumericIndexers1.ts, 87, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 89, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 90, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 27, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithNumericIndexers1.ts, 87, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 89, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 91, 15)) + +function foo11b(x: B); +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 91, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 93, 22), Decl(objectTypesIdentityWithNumericIndexers1.ts, 94, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 93, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers1.ts, 4, 1)) + +function foo11b(x: PA); // error +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 91, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 93, 22), Decl(objectTypesIdentityWithNumericIndexers1.ts, 94, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 94, 16)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithNumericIndexers1.ts, 16, 1)) + +function foo11b(x: any) { } +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 91, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 93, 22), Decl(objectTypesIdentityWithNumericIndexers1.ts, 94, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 95, 16)) + +function foo11c(x: B); +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithNumericIndexers1.ts, 95, 27), Decl(objectTypesIdentityWithNumericIndexers1.ts, 97, 22), Decl(objectTypesIdentityWithNumericIndexers1.ts, 98, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 97, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers1.ts, 4, 1)) + +function foo11c(x: PB); // error +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithNumericIndexers1.ts, 95, 27), Decl(objectTypesIdentityWithNumericIndexers1.ts, 97, 22), Decl(objectTypesIdentityWithNumericIndexers1.ts, 98, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 98, 16)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithNumericIndexers1.ts, 19, 1)) + +function foo11c(x: any) { } +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithNumericIndexers1.ts, 95, 27), Decl(objectTypesIdentityWithNumericIndexers1.ts, 97, 22), Decl(objectTypesIdentityWithNumericIndexers1.ts, 98, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 99, 16)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithNumericIndexers1.ts, 99, 27), Decl(objectTypesIdentityWithNumericIndexers1.ts, 101, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 102, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 101, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers1.ts, 12, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithNumericIndexers1.ts, 99, 27), Decl(objectTypesIdentityWithNumericIndexers1.ts, 101, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 102, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 102, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers1.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithNumericIndexers1.ts, 99, 27), Decl(objectTypesIdentityWithNumericIndexers1.ts, 101, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 102, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 103, 15)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithNumericIndexers1.ts, 103, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 105, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 106, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 105, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers1.ts, 12, 1)) + +function foo13(x: typeof a); // error +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithNumericIndexers1.ts, 103, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 105, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 106, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 106, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers1.ts, 24, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithNumericIndexers1.ts, 103, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 105, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 106, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 107, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithNumericIndexers1.ts, 107, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 109, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 110, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 109, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers1.ts, 12, 1)) + +function foo14(x: typeof b); // error +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithNumericIndexers1.ts, 107, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 109, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 110, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 110, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 27, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithNumericIndexers1.ts, 107, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 109, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 110, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 111, 15)) + +function foo15(x: I); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithNumericIndexers1.ts, 111, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 113, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 114, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 113, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers1.ts, 12, 1)) + +function foo15(x: PA); // error +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithNumericIndexers1.ts, 111, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 113, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 114, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 114, 15)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithNumericIndexers1.ts, 16, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithNumericIndexers1.ts, 111, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 113, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 114, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 115, 15)) + +function foo16(x: I); +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithNumericIndexers1.ts, 115, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 117, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 118, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 117, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers1.ts, 12, 1)) + +function foo16(x: PB); // error +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithNumericIndexers1.ts, 115, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 117, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 118, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 118, 15)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithNumericIndexers1.ts, 19, 1)) + +function foo16(x: any) { } +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithNumericIndexers1.ts, 115, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 117, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 118, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 119, 15)) + + diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types index a0603ae0777..2284d06ffbd 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types @@ -52,6 +52,7 @@ var b: { [x: number]: string; } = { foo: '' }; >x : number >{ foo: '' } : { [x: number]: undefined; foo: string; } >foo : string +>'' : string function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.symbols b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.symbols new file mode 100644 index 00000000000..375fff858fb --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.symbols @@ -0,0 +1,395 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithNumericIndexers2.ts === +// object types are identical structurally + +class Base { foo: string; } +>Base : Symbol(Base, Decl(objectTypesIdentityWithNumericIndexers2.ts, 0, 0)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithNumericIndexers2.ts, 2, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithNumericIndexers2.ts, 2, 27)) +>Base : Symbol(Base, Decl(objectTypesIdentityWithNumericIndexers2.ts, 0, 0)) +>bar : Symbol(bar, Decl(objectTypesIdentityWithNumericIndexers2.ts, 3, 28)) + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers2.ts, 3, 43)) + + [x: number]: Base; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 6, 5)) +>Base : Symbol(Base, Decl(objectTypesIdentityWithNumericIndexers2.ts, 0, 0)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers2.ts, 7, 1)) + + [x: number]: Derived; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 10, 5)) +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithNumericIndexers2.ts, 2, 27)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers2.ts, 11, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithNumericIndexers2.ts, 13, 8)) + + [x: number]: T; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 14, 5)) +>T : Symbol(T, Decl(objectTypesIdentityWithNumericIndexers2.ts, 13, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers2.ts, 15, 1)) + + [x: number]: Derived; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 18, 5)) +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithNumericIndexers2.ts, 2, 27)) +} + +class PA extends A { +>PA : Symbol(PA, Decl(objectTypesIdentityWithNumericIndexers2.ts, 19, 1)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers2.ts, 3, 43)) +} + +class PB extends B { +>PB : Symbol(PB, Decl(objectTypesIdentityWithNumericIndexers2.ts, 22, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers2.ts, 7, 1)) +} + +var a: { +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers2.ts, 27, 3)) + + [x: number]: Base; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 28, 5)) +>Base : Symbol(Base, Decl(objectTypesIdentityWithNumericIndexers2.ts, 0, 0)) +} +var b: { [x: number]: Derived; } = { foo: null }; +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 30, 3)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 30, 10)) +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithNumericIndexers2.ts, 2, 27)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithNumericIndexers2.ts, 30, 36)) +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithNumericIndexers2.ts, 2, 27)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithNumericIndexers2.ts, 30, 58), Decl(objectTypesIdentityWithNumericIndexers2.ts, 32, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 33, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 32, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers2.ts, 3, 43)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithNumericIndexers2.ts, 30, 58), Decl(objectTypesIdentityWithNumericIndexers2.ts, 32, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 33, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 33, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers2.ts, 3, 43)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithNumericIndexers2.ts, 30, 58), Decl(objectTypesIdentityWithNumericIndexers2.ts, 32, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 33, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 34, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 34, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 36, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 37, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 36, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers2.ts, 7, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 34, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 36, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 37, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 37, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers2.ts, 7, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 34, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 36, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 37, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 38, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithNumericIndexers2.ts, 38, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 40, 29), Decl(objectTypesIdentityWithNumericIndexers2.ts, 41, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 40, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers2.ts, 11, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithNumericIndexers2.ts, 38, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 40, 29), Decl(objectTypesIdentityWithNumericIndexers2.ts, 41, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 41, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers2.ts, 11, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithNumericIndexers2.ts, 38, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 40, 29), Decl(objectTypesIdentityWithNumericIndexers2.ts, 41, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 42, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithNumericIndexers2.ts, 42, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 44, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 45, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 44, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers2.ts, 15, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithNumericIndexers2.ts, 42, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 44, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 45, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 45, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers2.ts, 15, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithNumericIndexers2.ts, 42, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 44, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 45, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 46, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithNumericIndexers2.ts, 46, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 48, 27), Decl(objectTypesIdentityWithNumericIndexers2.ts, 49, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 48, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers2.ts, 27, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithNumericIndexers2.ts, 46, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 48, 27), Decl(objectTypesIdentityWithNumericIndexers2.ts, 49, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 49, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers2.ts, 27, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithNumericIndexers2.ts, 46, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 48, 27), Decl(objectTypesIdentityWithNumericIndexers2.ts, 49, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 50, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithNumericIndexers2.ts, 50, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 52, 27), Decl(objectTypesIdentityWithNumericIndexers2.ts, 53, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 52, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 30, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithNumericIndexers2.ts, 50, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 52, 27), Decl(objectTypesIdentityWithNumericIndexers2.ts, 53, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 53, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 30, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithNumericIndexers2.ts, 50, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 52, 27), Decl(objectTypesIdentityWithNumericIndexers2.ts, 53, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 54, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithNumericIndexers2.ts, 54, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 56, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 57, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 56, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers2.ts, 3, 43)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithNumericIndexers2.ts, 54, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 56, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 57, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 57, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers2.ts, 7, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithNumericIndexers2.ts, 54, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 56, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 57, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 58, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 58, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 60, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 61, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 60, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers2.ts, 3, 43)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 58, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 60, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 61, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 61, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers2.ts, 11, 1)) +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithNumericIndexers2.ts, 2, 27)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 58, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 60, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 61, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 62, 15)) + +function foo5c(x: A); +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithNumericIndexers2.ts, 62, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 64, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 65, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 64, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers2.ts, 3, 43)) + +function foo5c(x: PA); // error +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithNumericIndexers2.ts, 62, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 64, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 65, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 65, 15)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithNumericIndexers2.ts, 19, 1)) + +function foo5c(x: any) { } +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithNumericIndexers2.ts, 62, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 64, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 65, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 66, 15)) + +function foo5d(x: A); +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithNumericIndexers2.ts, 66, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 68, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 69, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 68, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers2.ts, 3, 43)) + +function foo5d(x: PB); // ok +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithNumericIndexers2.ts, 66, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 68, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 69, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 69, 15)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithNumericIndexers2.ts, 22, 1)) + +function foo5d(x: any) { } +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithNumericIndexers2.ts, 66, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 68, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 69, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 70, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithNumericIndexers2.ts, 70, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 72, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 73, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 72, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers2.ts, 3, 43)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithNumericIndexers2.ts, 70, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 72, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 73, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 73, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers2.ts, 15, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithNumericIndexers2.ts, 70, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 72, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 73, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 74, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithNumericIndexers2.ts, 74, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 76, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 77, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 76, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers2.ts, 3, 43)) + +function foo7(x: typeof a); // error +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithNumericIndexers2.ts, 74, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 76, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 77, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 77, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers2.ts, 27, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithNumericIndexers2.ts, 74, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 76, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 77, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 78, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithNumericIndexers2.ts, 78, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 80, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 81, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 80, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers2.ts, 7, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithNumericIndexers2.ts, 78, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 80, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 81, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 81, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers2.ts, 15, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithNumericIndexers2.ts, 78, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 80, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 81, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 82, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithNumericIndexers2.ts, 82, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 84, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 85, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 84, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers2.ts, 7, 1)) + +function foo9(x: C); // ok +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithNumericIndexers2.ts, 82, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 84, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 85, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 85, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers2.ts, 11, 1)) +>Base : Symbol(Base, Decl(objectTypesIdentityWithNumericIndexers2.ts, 0, 0)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithNumericIndexers2.ts, 82, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 84, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 85, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 86, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithNumericIndexers2.ts, 86, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 88, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 89, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 88, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers2.ts, 7, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithNumericIndexers2.ts, 86, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 88, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 89, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 89, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers2.ts, 27, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithNumericIndexers2.ts, 86, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 88, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 89, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 90, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithNumericIndexers2.ts, 90, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 92, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 93, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 92, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers2.ts, 7, 1)) + +function foo11(x: typeof b); // error +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithNumericIndexers2.ts, 90, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 92, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 93, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 93, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 30, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithNumericIndexers2.ts, 90, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 92, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 93, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 94, 15)) + +function foo11b(x: B); +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 94, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 96, 22), Decl(objectTypesIdentityWithNumericIndexers2.ts, 97, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 96, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers2.ts, 7, 1)) + +function foo11b(x: PA); // ok +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 94, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 96, 22), Decl(objectTypesIdentityWithNumericIndexers2.ts, 97, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 97, 16)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithNumericIndexers2.ts, 19, 1)) + +function foo11b(x: any) { } +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 94, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 96, 22), Decl(objectTypesIdentityWithNumericIndexers2.ts, 97, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 98, 16)) + +function foo11c(x: B); +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithNumericIndexers2.ts, 98, 27), Decl(objectTypesIdentityWithNumericIndexers2.ts, 100, 22), Decl(objectTypesIdentityWithNumericIndexers2.ts, 101, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 100, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers2.ts, 7, 1)) + +function foo11c(x: PB); // error +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithNumericIndexers2.ts, 98, 27), Decl(objectTypesIdentityWithNumericIndexers2.ts, 100, 22), Decl(objectTypesIdentityWithNumericIndexers2.ts, 101, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 101, 16)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithNumericIndexers2.ts, 22, 1)) + +function foo11c(x: any) { } +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithNumericIndexers2.ts, 98, 27), Decl(objectTypesIdentityWithNumericIndexers2.ts, 100, 22), Decl(objectTypesIdentityWithNumericIndexers2.ts, 101, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 102, 16)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithNumericIndexers2.ts, 102, 27), Decl(objectTypesIdentityWithNumericIndexers2.ts, 104, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 105, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 104, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers2.ts, 15, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithNumericIndexers2.ts, 102, 27), Decl(objectTypesIdentityWithNumericIndexers2.ts, 104, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 105, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 105, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers2.ts, 11, 1)) +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithNumericIndexers2.ts, 2, 27)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithNumericIndexers2.ts, 102, 27), Decl(objectTypesIdentityWithNumericIndexers2.ts, 104, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 105, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 106, 15)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithNumericIndexers2.ts, 106, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 108, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 109, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 108, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers2.ts, 15, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithNumericIndexers2.ts, 106, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 108, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 109, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 109, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers2.ts, 27, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithNumericIndexers2.ts, 106, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 108, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 109, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 110, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithNumericIndexers2.ts, 110, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 112, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 113, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 112, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers2.ts, 15, 1)) + +function foo14(x: typeof b); // error +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithNumericIndexers2.ts, 110, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 112, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 113, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 113, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 30, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithNumericIndexers2.ts, 110, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 112, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 113, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 114, 15)) + +function foo15(x: I); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithNumericIndexers2.ts, 114, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 116, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 117, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 116, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers2.ts, 15, 1)) + +function foo15(x: PA); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithNumericIndexers2.ts, 114, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 116, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 117, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 117, 15)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithNumericIndexers2.ts, 19, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithNumericIndexers2.ts, 114, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 116, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 117, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 118, 15)) + +function foo16(x: I); +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithNumericIndexers2.ts, 118, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 120, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 121, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 120, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers2.ts, 15, 1)) + +function foo16(x: PB); // error +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithNumericIndexers2.ts, 118, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 120, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 121, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 121, 15)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithNumericIndexers2.ts, 22, 1)) + +function foo16(x: any) { } +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithNumericIndexers2.ts, 118, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 120, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 121, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 122, 15)) + + diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.types b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.types index 9e4ccb5c43b..1a580297b1b 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.types +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.types @@ -68,6 +68,7 @@ var b: { [x: number]: Derived; } = { foo: null }; >foo : Derived >null : Derived >Derived : Derived +>null : null function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.symbols b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.symbols new file mode 100644 index 00000000000..c0bc1b5cf60 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.symbols @@ -0,0 +1,377 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithNumericIndexers3.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers3.ts, 0, 0)) + + [x: number]: string; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 3, 5)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers3.ts, 4, 1)) + + [x: string]: string; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 7, 5)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers3.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithNumericIndexers3.ts, 10, 8)) + + [x: number]: T; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 11, 5)) +>T : Symbol(T, Decl(objectTypesIdentityWithNumericIndexers3.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers3.ts, 12, 1)) + + [x: string]: string; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 15, 5)) +} + +class PA extends A { +>PA : Symbol(PA, Decl(objectTypesIdentityWithNumericIndexers3.ts, 16, 1)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers3.ts, 0, 0)) +} + +class PB extends B { +>PB : Symbol(PB, Decl(objectTypesIdentityWithNumericIndexers3.ts, 19, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers3.ts, 4, 1)) +} + +var a: { +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers3.ts, 24, 3)) + + [x: string]: string; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 25, 5)) +} +var b: { [x: number]: string; } = { foo: '' }; +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 27, 3)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 27, 10)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithNumericIndexers3.ts, 27, 35)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithNumericIndexers3.ts, 27, 46), Decl(objectTypesIdentityWithNumericIndexers3.ts, 29, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 29, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers3.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithNumericIndexers3.ts, 27, 46), Decl(objectTypesIdentityWithNumericIndexers3.ts, 29, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 30, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers3.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithNumericIndexers3.ts, 27, 46), Decl(objectTypesIdentityWithNumericIndexers3.ts, 29, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 31, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 31, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 33, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 34, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 33, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers3.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 31, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 33, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 34, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 34, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers3.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 31, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 33, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 34, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 35, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithNumericIndexers3.ts, 35, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 37, 29), Decl(objectTypesIdentityWithNumericIndexers3.ts, 38, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 37, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers3.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithNumericIndexers3.ts, 35, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 37, 29), Decl(objectTypesIdentityWithNumericIndexers3.ts, 38, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 38, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers3.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithNumericIndexers3.ts, 35, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 37, 29), Decl(objectTypesIdentityWithNumericIndexers3.ts, 38, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 39, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithNumericIndexers3.ts, 39, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 41, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 41, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers3.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithNumericIndexers3.ts, 39, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 41, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 42, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers3.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithNumericIndexers3.ts, 39, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 41, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 43, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithNumericIndexers3.ts, 43, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 45, 27), Decl(objectTypesIdentityWithNumericIndexers3.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 45, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers3.ts, 24, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithNumericIndexers3.ts, 43, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 45, 27), Decl(objectTypesIdentityWithNumericIndexers3.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 46, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers3.ts, 24, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithNumericIndexers3.ts, 43, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 45, 27), Decl(objectTypesIdentityWithNumericIndexers3.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 47, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithNumericIndexers3.ts, 47, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 49, 27), Decl(objectTypesIdentityWithNumericIndexers3.ts, 50, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 49, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 27, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithNumericIndexers3.ts, 47, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 49, 27), Decl(objectTypesIdentityWithNumericIndexers3.ts, 50, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 50, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 27, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithNumericIndexers3.ts, 47, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 49, 27), Decl(objectTypesIdentityWithNumericIndexers3.ts, 50, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 51, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithNumericIndexers3.ts, 51, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 53, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 53, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers3.ts, 0, 0)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithNumericIndexers3.ts, 51, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 53, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 54, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers3.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithNumericIndexers3.ts, 51, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 53, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 55, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 55, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 57, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 57, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers3.ts, 0, 0)) + +function foo5b(x: C); // error +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 55, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 57, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 58, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers3.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 55, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 57, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 59, 15)) + +function foo5c(x: A); +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithNumericIndexers3.ts, 59, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 61, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 62, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 61, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers3.ts, 0, 0)) + +function foo5c(x: PA); // error +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithNumericIndexers3.ts, 59, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 61, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 62, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 62, 15)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithNumericIndexers3.ts, 16, 1)) + +function foo5c(x: any) { } +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithNumericIndexers3.ts, 59, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 61, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 62, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 63, 15)) + +function foo5d(x: A); +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithNumericIndexers3.ts, 63, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 65, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 66, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 65, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers3.ts, 0, 0)) + +function foo5d(x: PB); // ok +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithNumericIndexers3.ts, 63, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 65, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 66, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 66, 15)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithNumericIndexers3.ts, 19, 1)) + +function foo5d(x: any) { } +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithNumericIndexers3.ts, 63, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 65, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 66, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 67, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithNumericIndexers3.ts, 67, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 69, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 70, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 69, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers3.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithNumericIndexers3.ts, 67, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 69, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 70, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 70, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers3.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithNumericIndexers3.ts, 67, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 69, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 70, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 71, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithNumericIndexers3.ts, 71, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 73, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 74, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 73, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers3.ts, 0, 0)) + +function foo7(x: typeof a); // ok +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithNumericIndexers3.ts, 71, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 73, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 74, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 74, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers3.ts, 24, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithNumericIndexers3.ts, 71, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 73, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 74, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 75, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithNumericIndexers3.ts, 75, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 77, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 78, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 77, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers3.ts, 4, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithNumericIndexers3.ts, 75, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 77, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 78, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 78, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers3.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithNumericIndexers3.ts, 75, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 77, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 78, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 79, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithNumericIndexers3.ts, 79, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 81, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 81, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers3.ts, 4, 1)) + +function foo9(x: C); // ok +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithNumericIndexers3.ts, 79, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 81, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 82, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers3.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithNumericIndexers3.ts, 79, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 81, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 83, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithNumericIndexers3.ts, 83, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 85, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 85, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers3.ts, 4, 1)) + +function foo10(x: typeof a); // error +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithNumericIndexers3.ts, 83, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 85, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 86, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers3.ts, 24, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithNumericIndexers3.ts, 83, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 85, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 87, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithNumericIndexers3.ts, 87, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 89, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 89, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers3.ts, 4, 1)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithNumericIndexers3.ts, 87, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 89, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 90, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 27, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithNumericIndexers3.ts, 87, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 89, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 91, 15)) + +function foo11b(x: B); +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 91, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 93, 22), Decl(objectTypesIdentityWithNumericIndexers3.ts, 94, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 93, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers3.ts, 4, 1)) + +function foo11b(x: PA); // ok +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 91, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 93, 22), Decl(objectTypesIdentityWithNumericIndexers3.ts, 94, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 94, 16)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithNumericIndexers3.ts, 16, 1)) + +function foo11b(x: any) { } +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 91, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 93, 22), Decl(objectTypesIdentityWithNumericIndexers3.ts, 94, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 95, 16)) + +function foo11c(x: B); +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithNumericIndexers3.ts, 95, 27), Decl(objectTypesIdentityWithNumericIndexers3.ts, 97, 22), Decl(objectTypesIdentityWithNumericIndexers3.ts, 98, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 97, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers3.ts, 4, 1)) + +function foo11c(x: PB); // error +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithNumericIndexers3.ts, 95, 27), Decl(objectTypesIdentityWithNumericIndexers3.ts, 97, 22), Decl(objectTypesIdentityWithNumericIndexers3.ts, 98, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 98, 16)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithNumericIndexers3.ts, 19, 1)) + +function foo11c(x: any) { } +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithNumericIndexers3.ts, 95, 27), Decl(objectTypesIdentityWithNumericIndexers3.ts, 97, 22), Decl(objectTypesIdentityWithNumericIndexers3.ts, 98, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 99, 16)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithNumericIndexers3.ts, 99, 27), Decl(objectTypesIdentityWithNumericIndexers3.ts, 101, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 102, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 101, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers3.ts, 12, 1)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithNumericIndexers3.ts, 99, 27), Decl(objectTypesIdentityWithNumericIndexers3.ts, 101, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 102, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 102, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers3.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithNumericIndexers3.ts, 99, 27), Decl(objectTypesIdentityWithNumericIndexers3.ts, 101, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 102, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 103, 15)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithNumericIndexers3.ts, 103, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 105, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 106, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 105, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers3.ts, 12, 1)) + +function foo13(x: typeof a); // error +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithNumericIndexers3.ts, 103, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 105, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 106, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 106, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers3.ts, 24, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithNumericIndexers3.ts, 103, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 105, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 106, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 107, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithNumericIndexers3.ts, 107, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 109, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 110, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 109, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers3.ts, 12, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithNumericIndexers3.ts, 107, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 109, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 110, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 110, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 27, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithNumericIndexers3.ts, 107, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 109, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 110, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 111, 15)) + +function foo15(x: I); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithNumericIndexers3.ts, 111, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 113, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 114, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 113, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers3.ts, 12, 1)) + +function foo15(x: PA); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithNumericIndexers3.ts, 111, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 113, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 114, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 114, 15)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithNumericIndexers3.ts, 16, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithNumericIndexers3.ts, 111, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 113, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 114, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 115, 15)) + +function foo16(x: I); +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithNumericIndexers3.ts, 115, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 117, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 118, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 117, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers3.ts, 12, 1)) + +function foo16(x: PB); // error +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithNumericIndexers3.ts, 115, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 117, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 118, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 118, 15)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithNumericIndexers3.ts, 19, 1)) + +function foo16(x: any) { } +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithNumericIndexers3.ts, 115, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 117, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 118, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 119, 15)) + + diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types index 3553f5f7252..ae384bbb4db 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types @@ -52,6 +52,7 @@ var b: { [x: number]: string; } = { foo: '' }; >x : number >{ foo: '' } : { [x: number]: undefined; foo: string; } >foo : string +>'' : string function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithOptionality.symbols b/tests/baselines/reference/objectTypesIdentityWithOptionality.symbols new file mode 100644 index 00000000000..595295418f5 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithOptionality.symbols @@ -0,0 +1,167 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithOptionality.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithOptionality.ts, 0, 0)) + + foo: string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithOptionality.ts, 2, 9)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithOptionality.ts, 4, 1)) + + foo: string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithOptionality.ts, 6, 9)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithOptionality.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithOptionality.ts, 10, 8)) + + foo: T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithOptionality.ts, 10, 12)) +>T : Symbol(T, Decl(objectTypesIdentityWithOptionality.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithOptionality.ts, 12, 1)) + + foo?: string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithOptionality.ts, 14, 13)) +} + +var a: { foo?: string; } +>a : Symbol(a, Decl(objectTypesIdentityWithOptionality.ts, 18, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithOptionality.ts, 18, 8)) + +var b = { foo: '' }; +>b : Symbol(b, Decl(objectTypesIdentityWithOptionality.ts, 19, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithOptionality.ts, 19, 9)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithOptionality.ts, 19, 20), Decl(objectTypesIdentityWithOptionality.ts, 21, 20), Decl(objectTypesIdentityWithOptionality.ts, 22, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 21, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithOptionality.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithOptionality.ts, 19, 20), Decl(objectTypesIdentityWithOptionality.ts, 21, 20), Decl(objectTypesIdentityWithOptionality.ts, 22, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 22, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithOptionality.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithOptionality.ts, 19, 20), Decl(objectTypesIdentityWithOptionality.ts, 21, 20), Decl(objectTypesIdentityWithOptionality.ts, 22, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 23, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithOptionality.ts, 23, 25), Decl(objectTypesIdentityWithOptionality.ts, 25, 27), Decl(objectTypesIdentityWithOptionality.ts, 26, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 25, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithOptionality.ts, 18, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithOptionality.ts, 23, 25), Decl(objectTypesIdentityWithOptionality.ts, 25, 27), Decl(objectTypesIdentityWithOptionality.ts, 26, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 26, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithOptionality.ts, 18, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithOptionality.ts, 23, 25), Decl(objectTypesIdentityWithOptionality.ts, 25, 27), Decl(objectTypesIdentityWithOptionality.ts, 26, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 27, 14)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithOptionality.ts, 27, 25), Decl(objectTypesIdentityWithOptionality.ts, 29, 20), Decl(objectTypesIdentityWithOptionality.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 29, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithOptionality.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithOptionality.ts, 27, 25), Decl(objectTypesIdentityWithOptionality.ts, 29, 20), Decl(objectTypesIdentityWithOptionality.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 30, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithOptionality.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithOptionality.ts, 27, 25), Decl(objectTypesIdentityWithOptionality.ts, 29, 20), Decl(objectTypesIdentityWithOptionality.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 31, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithOptionality.ts, 31, 25), Decl(objectTypesIdentityWithOptionality.ts, 33, 20), Decl(objectTypesIdentityWithOptionality.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 33, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithOptionality.ts, 0, 0)) + +function foo7(x: typeof a); // ok +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithOptionality.ts, 31, 25), Decl(objectTypesIdentityWithOptionality.ts, 33, 20), Decl(objectTypesIdentityWithOptionality.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 34, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithOptionality.ts, 18, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithOptionality.ts, 31, 25), Decl(objectTypesIdentityWithOptionality.ts, 33, 20), Decl(objectTypesIdentityWithOptionality.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 35, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithOptionality.ts, 35, 25), Decl(objectTypesIdentityWithOptionality.ts, 37, 20), Decl(objectTypesIdentityWithOptionality.ts, 38, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 37, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithOptionality.ts, 4, 1)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithOptionality.ts, 35, 25), Decl(objectTypesIdentityWithOptionality.ts, 37, 20), Decl(objectTypesIdentityWithOptionality.ts, 38, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 38, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithOptionality.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithOptionality.ts, 35, 25), Decl(objectTypesIdentityWithOptionality.ts, 37, 20), Decl(objectTypesIdentityWithOptionality.ts, 38, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 39, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithOptionality.ts, 39, 25), Decl(objectTypesIdentityWithOptionality.ts, 41, 21), Decl(objectTypesIdentityWithOptionality.ts, 42, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 41, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithOptionality.ts, 4, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithOptionality.ts, 39, 25), Decl(objectTypesIdentityWithOptionality.ts, 41, 21), Decl(objectTypesIdentityWithOptionality.ts, 42, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 42, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithOptionality.ts, 18, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithOptionality.ts, 39, 25), Decl(objectTypesIdentityWithOptionality.ts, 41, 21), Decl(objectTypesIdentityWithOptionality.ts, 42, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 43, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithOptionality.ts, 43, 26), Decl(objectTypesIdentityWithOptionality.ts, 45, 21), Decl(objectTypesIdentityWithOptionality.ts, 46, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 45, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithOptionality.ts, 12, 1)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithOptionality.ts, 43, 26), Decl(objectTypesIdentityWithOptionality.ts, 45, 21), Decl(objectTypesIdentityWithOptionality.ts, 46, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 46, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithOptionality.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithOptionality.ts, 43, 26), Decl(objectTypesIdentityWithOptionality.ts, 45, 21), Decl(objectTypesIdentityWithOptionality.ts, 46, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 47, 15)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithOptionality.ts, 47, 26), Decl(objectTypesIdentityWithOptionality.ts, 49, 21), Decl(objectTypesIdentityWithOptionality.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 49, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithOptionality.ts, 12, 1)) + +function foo13(x: typeof a); // error +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithOptionality.ts, 47, 26), Decl(objectTypesIdentityWithOptionality.ts, 49, 21), Decl(objectTypesIdentityWithOptionality.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 50, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithOptionality.ts, 18, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithOptionality.ts, 47, 26), Decl(objectTypesIdentityWithOptionality.ts, 49, 21), Decl(objectTypesIdentityWithOptionality.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 51, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithOptionality.ts, 51, 26), Decl(objectTypesIdentityWithOptionality.ts, 53, 21), Decl(objectTypesIdentityWithOptionality.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 53, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithOptionality.ts, 12, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithOptionality.ts, 51, 26), Decl(objectTypesIdentityWithOptionality.ts, 53, 21), Decl(objectTypesIdentityWithOptionality.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 54, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithOptionality.ts, 19, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithOptionality.ts, 51, 26), Decl(objectTypesIdentityWithOptionality.ts, 53, 21), Decl(objectTypesIdentityWithOptionality.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 55, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithOptionality.types b/tests/baselines/reference/objectTypesIdentityWithOptionality.types index 0ca5b552bf5..bab319f3598 100644 --- a/tests/baselines/reference/objectTypesIdentityWithOptionality.types +++ b/tests/baselines/reference/objectTypesIdentityWithOptionality.types @@ -39,6 +39,7 @@ var b = { foo: '' }; >b : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string +>'' : string function foo2(x: I); >foo2 : { (x: I): any; (x: I): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates.symbols b/tests/baselines/reference/objectTypesIdentityWithPrivates.symbols new file mode 100644 index 00000000000..d7680f7fb91 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates.symbols @@ -0,0 +1,374 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPrivates.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithPrivates.ts, 0, 0)) + + private foo: string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithPrivates.ts, 2, 9)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithPrivates.ts, 4, 1)) + + private foo: string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithPrivates.ts, 6, 9)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithPrivates.ts, 10, 8)) + + private foo: T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithPrivates.ts, 10, 12)) +>T : Symbol(T, Decl(objectTypesIdentityWithPrivates.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithPrivates.ts, 12, 1)) + + foo: string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithPrivates.ts, 14, 13)) +} + +class PA extends A { +>PA : Symbol(PA, Decl(objectTypesIdentityWithPrivates.ts, 16, 1)) +>A : Symbol(A, Decl(objectTypesIdentityWithPrivates.ts, 0, 0)) +} + +class PB extends B { +>PB : Symbol(PB, Decl(objectTypesIdentityWithPrivates.ts, 19, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithPrivates.ts, 4, 1)) +} + +var a: { foo: string; } +>a : Symbol(a, Decl(objectTypesIdentityWithPrivates.ts, 24, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithPrivates.ts, 24, 8)) + +var b = { foo: '' }; +>b : Symbol(b, Decl(objectTypesIdentityWithPrivates.ts, 25, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithPrivates.ts, 25, 9)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithPrivates.ts, 25, 20), Decl(objectTypesIdentityWithPrivates.ts, 27, 20), Decl(objectTypesIdentityWithPrivates.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 27, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithPrivates.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithPrivates.ts, 25, 20), Decl(objectTypesIdentityWithPrivates.ts, 27, 20), Decl(objectTypesIdentityWithPrivates.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 28, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithPrivates.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithPrivates.ts, 25, 20), Decl(objectTypesIdentityWithPrivates.ts, 27, 20), Decl(objectTypesIdentityWithPrivates.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 29, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithPrivates.ts, 29, 25), Decl(objectTypesIdentityWithPrivates.ts, 31, 21), Decl(objectTypesIdentityWithPrivates.ts, 32, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 31, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithPrivates.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithPrivates.ts, 29, 25), Decl(objectTypesIdentityWithPrivates.ts, 31, 21), Decl(objectTypesIdentityWithPrivates.ts, 32, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 32, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithPrivates.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithPrivates.ts, 29, 25), Decl(objectTypesIdentityWithPrivates.ts, 31, 21), Decl(objectTypesIdentityWithPrivates.ts, 32, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 33, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithPrivates.ts, 33, 26), Decl(objectTypesIdentityWithPrivates.ts, 35, 29), Decl(objectTypesIdentityWithPrivates.ts, 36, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 35, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithPrivates.ts, 33, 26), Decl(objectTypesIdentityWithPrivates.ts, 35, 29), Decl(objectTypesIdentityWithPrivates.ts, 36, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 36, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithPrivates.ts, 33, 26), Decl(objectTypesIdentityWithPrivates.ts, 35, 29), Decl(objectTypesIdentityWithPrivates.ts, 36, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 37, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithPrivates.ts, 37, 26), Decl(objectTypesIdentityWithPrivates.ts, 39, 20), Decl(objectTypesIdentityWithPrivates.ts, 40, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 39, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithPrivates.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithPrivates.ts, 37, 26), Decl(objectTypesIdentityWithPrivates.ts, 39, 20), Decl(objectTypesIdentityWithPrivates.ts, 40, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 40, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithPrivates.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithPrivates.ts, 37, 26), Decl(objectTypesIdentityWithPrivates.ts, 39, 20), Decl(objectTypesIdentityWithPrivates.ts, 40, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 41, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithPrivates.ts, 41, 25), Decl(objectTypesIdentityWithPrivates.ts, 43, 27), Decl(objectTypesIdentityWithPrivates.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 43, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithPrivates.ts, 24, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithPrivates.ts, 41, 25), Decl(objectTypesIdentityWithPrivates.ts, 43, 27), Decl(objectTypesIdentityWithPrivates.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 44, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithPrivates.ts, 24, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithPrivates.ts, 41, 25), Decl(objectTypesIdentityWithPrivates.ts, 43, 27), Decl(objectTypesIdentityWithPrivates.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 45, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithPrivates.ts, 45, 25), Decl(objectTypesIdentityWithPrivates.ts, 47, 27), Decl(objectTypesIdentityWithPrivates.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 47, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithPrivates.ts, 25, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithPrivates.ts, 45, 25), Decl(objectTypesIdentityWithPrivates.ts, 47, 27), Decl(objectTypesIdentityWithPrivates.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 48, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithPrivates.ts, 25, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithPrivates.ts, 45, 25), Decl(objectTypesIdentityWithPrivates.ts, 47, 27), Decl(objectTypesIdentityWithPrivates.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 49, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithPrivates.ts, 49, 25), Decl(objectTypesIdentityWithPrivates.ts, 51, 20), Decl(objectTypesIdentityWithPrivates.ts, 52, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 51, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithPrivates.ts, 0, 0)) + +function foo5(x: B); // no error +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithPrivates.ts, 49, 25), Decl(objectTypesIdentityWithPrivates.ts, 51, 20), Decl(objectTypesIdentityWithPrivates.ts, 52, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 52, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithPrivates.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithPrivates.ts, 49, 25), Decl(objectTypesIdentityWithPrivates.ts, 51, 20), Decl(objectTypesIdentityWithPrivates.ts, 52, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 53, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithPrivates.ts, 53, 25), Decl(objectTypesIdentityWithPrivates.ts, 55, 21), Decl(objectTypesIdentityWithPrivates.ts, 56, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 55, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithPrivates.ts, 0, 0)) + +function foo5b(x: C); // no error +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithPrivates.ts, 53, 25), Decl(objectTypesIdentityWithPrivates.ts, 55, 21), Decl(objectTypesIdentityWithPrivates.ts, 56, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 56, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithPrivates.ts, 53, 25), Decl(objectTypesIdentityWithPrivates.ts, 55, 21), Decl(objectTypesIdentityWithPrivates.ts, 56, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 57, 15)) + +function foo5c(x: A); +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithPrivates.ts, 57, 26), Decl(objectTypesIdentityWithPrivates.ts, 59, 21), Decl(objectTypesIdentityWithPrivates.ts, 60, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 59, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithPrivates.ts, 0, 0)) + +function foo5c(x: PA); // error +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithPrivates.ts, 57, 26), Decl(objectTypesIdentityWithPrivates.ts, 59, 21), Decl(objectTypesIdentityWithPrivates.ts, 60, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 60, 15)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithPrivates.ts, 16, 1)) + +function foo5c(x: any) { } +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithPrivates.ts, 57, 26), Decl(objectTypesIdentityWithPrivates.ts, 59, 21), Decl(objectTypesIdentityWithPrivates.ts, 60, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 61, 15)) + +function foo5d(x: A); +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithPrivates.ts, 61, 26), Decl(objectTypesIdentityWithPrivates.ts, 63, 21), Decl(objectTypesIdentityWithPrivates.ts, 64, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 63, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithPrivates.ts, 0, 0)) + +function foo5d(x: PB); // no error +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithPrivates.ts, 61, 26), Decl(objectTypesIdentityWithPrivates.ts, 63, 21), Decl(objectTypesIdentityWithPrivates.ts, 64, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 64, 15)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithPrivates.ts, 19, 1)) + +function foo5d(x: any) { } +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithPrivates.ts, 61, 26), Decl(objectTypesIdentityWithPrivates.ts, 63, 21), Decl(objectTypesIdentityWithPrivates.ts, 64, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 65, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithPrivates.ts, 65, 26), Decl(objectTypesIdentityWithPrivates.ts, 67, 20), Decl(objectTypesIdentityWithPrivates.ts, 68, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 67, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithPrivates.ts, 0, 0)) + +function foo6(x: I); // no error +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithPrivates.ts, 65, 26), Decl(objectTypesIdentityWithPrivates.ts, 67, 20), Decl(objectTypesIdentityWithPrivates.ts, 68, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 68, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithPrivates.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithPrivates.ts, 65, 26), Decl(objectTypesIdentityWithPrivates.ts, 67, 20), Decl(objectTypesIdentityWithPrivates.ts, 68, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 69, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithPrivates.ts, 69, 25), Decl(objectTypesIdentityWithPrivates.ts, 71, 20), Decl(objectTypesIdentityWithPrivates.ts, 72, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 71, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithPrivates.ts, 0, 0)) + +function foo7(x: typeof a); // no error +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithPrivates.ts, 69, 25), Decl(objectTypesIdentityWithPrivates.ts, 71, 20), Decl(objectTypesIdentityWithPrivates.ts, 72, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 72, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithPrivates.ts, 24, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithPrivates.ts, 69, 25), Decl(objectTypesIdentityWithPrivates.ts, 71, 20), Decl(objectTypesIdentityWithPrivates.ts, 72, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 73, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithPrivates.ts, 73, 25), Decl(objectTypesIdentityWithPrivates.ts, 75, 20), Decl(objectTypesIdentityWithPrivates.ts, 76, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 75, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithPrivates.ts, 4, 1)) + +function foo8(x: I); // no error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithPrivates.ts, 73, 25), Decl(objectTypesIdentityWithPrivates.ts, 75, 20), Decl(objectTypesIdentityWithPrivates.ts, 76, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 76, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithPrivates.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithPrivates.ts, 73, 25), Decl(objectTypesIdentityWithPrivates.ts, 75, 20), Decl(objectTypesIdentityWithPrivates.ts, 76, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 77, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithPrivates.ts, 77, 25), Decl(objectTypesIdentityWithPrivates.ts, 79, 20), Decl(objectTypesIdentityWithPrivates.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 79, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithPrivates.ts, 4, 1)) + +function foo9(x: C); // no error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithPrivates.ts, 77, 25), Decl(objectTypesIdentityWithPrivates.ts, 79, 20), Decl(objectTypesIdentityWithPrivates.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 80, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithPrivates.ts, 77, 25), Decl(objectTypesIdentityWithPrivates.ts, 79, 20), Decl(objectTypesIdentityWithPrivates.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 81, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithPrivates.ts, 81, 25), Decl(objectTypesIdentityWithPrivates.ts, 83, 21), Decl(objectTypesIdentityWithPrivates.ts, 84, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 83, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithPrivates.ts, 4, 1)) + +function foo10(x: typeof a); // no error +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithPrivates.ts, 81, 25), Decl(objectTypesIdentityWithPrivates.ts, 83, 21), Decl(objectTypesIdentityWithPrivates.ts, 84, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 84, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithPrivates.ts, 24, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithPrivates.ts, 81, 25), Decl(objectTypesIdentityWithPrivates.ts, 83, 21), Decl(objectTypesIdentityWithPrivates.ts, 84, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 85, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithPrivates.ts, 85, 26), Decl(objectTypesIdentityWithPrivates.ts, 87, 21), Decl(objectTypesIdentityWithPrivates.ts, 88, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 87, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithPrivates.ts, 4, 1)) + +function foo11(x: typeof b); // no error +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithPrivates.ts, 85, 26), Decl(objectTypesIdentityWithPrivates.ts, 87, 21), Decl(objectTypesIdentityWithPrivates.ts, 88, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 88, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithPrivates.ts, 25, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithPrivates.ts, 85, 26), Decl(objectTypesIdentityWithPrivates.ts, 87, 21), Decl(objectTypesIdentityWithPrivates.ts, 88, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 89, 15)) + +function foo11b(x: B); +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithPrivates.ts, 89, 26), Decl(objectTypesIdentityWithPrivates.ts, 91, 22), Decl(objectTypesIdentityWithPrivates.ts, 92, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 91, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithPrivates.ts, 4, 1)) + +function foo11b(x: PA); // no error +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithPrivates.ts, 89, 26), Decl(objectTypesIdentityWithPrivates.ts, 91, 22), Decl(objectTypesIdentityWithPrivates.ts, 92, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 92, 16)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithPrivates.ts, 16, 1)) + +function foo11b(x: any) { } +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithPrivates.ts, 89, 26), Decl(objectTypesIdentityWithPrivates.ts, 91, 22), Decl(objectTypesIdentityWithPrivates.ts, 92, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 93, 16)) + +function foo11c(x: B); +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithPrivates.ts, 93, 27), Decl(objectTypesIdentityWithPrivates.ts, 95, 22), Decl(objectTypesIdentityWithPrivates.ts, 96, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 95, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithPrivates.ts, 4, 1)) + +function foo11c(x: PB); // error +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithPrivates.ts, 93, 27), Decl(objectTypesIdentityWithPrivates.ts, 95, 22), Decl(objectTypesIdentityWithPrivates.ts, 96, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 96, 16)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithPrivates.ts, 19, 1)) + +function foo11c(x: any) { } +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithPrivates.ts, 93, 27), Decl(objectTypesIdentityWithPrivates.ts, 95, 22), Decl(objectTypesIdentityWithPrivates.ts, 96, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 97, 16)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithPrivates.ts, 97, 27), Decl(objectTypesIdentityWithPrivates.ts, 99, 21), Decl(objectTypesIdentityWithPrivates.ts, 100, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 99, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithPrivates.ts, 12, 1)) + +function foo12(x: C); // no error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithPrivates.ts, 97, 27), Decl(objectTypesIdentityWithPrivates.ts, 99, 21), Decl(objectTypesIdentityWithPrivates.ts, 100, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 100, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithPrivates.ts, 97, 27), Decl(objectTypesIdentityWithPrivates.ts, 99, 21), Decl(objectTypesIdentityWithPrivates.ts, 100, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 101, 15)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithPrivates.ts, 101, 26), Decl(objectTypesIdentityWithPrivates.ts, 103, 21), Decl(objectTypesIdentityWithPrivates.ts, 104, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 103, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithPrivates.ts, 12, 1)) + +function foo13(x: typeof a); // error +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithPrivates.ts, 101, 26), Decl(objectTypesIdentityWithPrivates.ts, 103, 21), Decl(objectTypesIdentityWithPrivates.ts, 104, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 104, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithPrivates.ts, 24, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithPrivates.ts, 101, 26), Decl(objectTypesIdentityWithPrivates.ts, 103, 21), Decl(objectTypesIdentityWithPrivates.ts, 104, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 105, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithPrivates.ts, 105, 26), Decl(objectTypesIdentityWithPrivates.ts, 107, 21), Decl(objectTypesIdentityWithPrivates.ts, 108, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 107, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithPrivates.ts, 12, 1)) + +function foo14(x: typeof b); // error +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithPrivates.ts, 105, 26), Decl(objectTypesIdentityWithPrivates.ts, 107, 21), Decl(objectTypesIdentityWithPrivates.ts, 108, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 108, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithPrivates.ts, 25, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithPrivates.ts, 105, 26), Decl(objectTypesIdentityWithPrivates.ts, 107, 21), Decl(objectTypesIdentityWithPrivates.ts, 108, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 109, 15)) + +function foo15(x: I); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithPrivates.ts, 109, 26), Decl(objectTypesIdentityWithPrivates.ts, 111, 21), Decl(objectTypesIdentityWithPrivates.ts, 112, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 111, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithPrivates.ts, 12, 1)) + +function foo15(x: PA); // no error +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithPrivates.ts, 109, 26), Decl(objectTypesIdentityWithPrivates.ts, 111, 21), Decl(objectTypesIdentityWithPrivates.ts, 112, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 112, 15)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithPrivates.ts, 16, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithPrivates.ts, 109, 26), Decl(objectTypesIdentityWithPrivates.ts, 111, 21), Decl(objectTypesIdentityWithPrivates.ts, 112, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 113, 15)) + +function foo16(x: I); +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithPrivates.ts, 113, 26), Decl(objectTypesIdentityWithPrivates.ts, 115, 21), Decl(objectTypesIdentityWithPrivates.ts, 116, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 115, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithPrivates.ts, 12, 1)) + +function foo16(x: PB); // no error +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithPrivates.ts, 113, 26), Decl(objectTypesIdentityWithPrivates.ts, 115, 21), Decl(objectTypesIdentityWithPrivates.ts, 116, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 116, 15)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithPrivates.ts, 19, 1)) + +function foo16(x: any) { } +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithPrivates.ts, 113, 26), Decl(objectTypesIdentityWithPrivates.ts, 115, 21), Decl(objectTypesIdentityWithPrivates.ts, 116, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 117, 15)) + + diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates.types b/tests/baselines/reference/objectTypesIdentityWithPrivates.types index 391f6f1f200..c828f45ac5a 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates.types +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates.types @@ -49,6 +49,7 @@ var b = { foo: '' }; >b : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string +>'' : string function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates2.symbols b/tests/baselines/reference/objectTypesIdentityWithPrivates2.symbols new file mode 100644 index 00000000000..1a33946229e --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates2.symbols @@ -0,0 +1,115 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPrivates2.ts === +// object types are identical structurally + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates2.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithPrivates2.ts, 2, 8)) + + private foo: T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithPrivates2.ts, 2, 12)) +>T : Symbol(T, Decl(objectTypesIdentityWithPrivates2.ts, 2, 8)) +} + +class D extends C { +>D : Symbol(D, Decl(objectTypesIdentityWithPrivates2.ts, 4, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithPrivates2.ts, 6, 8)) +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates2.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithPrivates2.ts, 6, 8)) +} + +function foo1(x: C); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithPrivates2.ts, 7, 1), Decl(objectTypesIdentityWithPrivates2.ts, 9, 28), Decl(objectTypesIdentityWithPrivates2.ts, 10, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 9, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates2.ts, 0, 0)) + +function foo1(x: C); // ok +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithPrivates2.ts, 7, 1), Decl(objectTypesIdentityWithPrivates2.ts, 9, 28), Decl(objectTypesIdentityWithPrivates2.ts, 10, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 10, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates2.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithPrivates2.ts, 7, 1), Decl(objectTypesIdentityWithPrivates2.ts, 9, 28), Decl(objectTypesIdentityWithPrivates2.ts, 10, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 11, 14)) + +function foo2(x: D); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithPrivates2.ts, 11, 25), Decl(objectTypesIdentityWithPrivates2.ts, 13, 28), Decl(objectTypesIdentityWithPrivates2.ts, 14, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 13, 14)) +>D : Symbol(D, Decl(objectTypesIdentityWithPrivates2.ts, 4, 1)) + +function foo2(x: D); // ok +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithPrivates2.ts, 11, 25), Decl(objectTypesIdentityWithPrivates2.ts, 13, 28), Decl(objectTypesIdentityWithPrivates2.ts, 14, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 14, 14)) +>D : Symbol(D, Decl(objectTypesIdentityWithPrivates2.ts, 4, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithPrivates2.ts, 11, 25), Decl(objectTypesIdentityWithPrivates2.ts, 13, 28), Decl(objectTypesIdentityWithPrivates2.ts, 14, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 15, 14)) + +function foo3(x: C); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithPrivates2.ts, 15, 25), Decl(objectTypesIdentityWithPrivates2.ts, 17, 28), Decl(objectTypesIdentityWithPrivates2.ts, 18, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 17, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates2.ts, 0, 0)) + +function foo3(x: D); // ok +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithPrivates2.ts, 15, 25), Decl(objectTypesIdentityWithPrivates2.ts, 17, 28), Decl(objectTypesIdentityWithPrivates2.ts, 18, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 18, 14)) +>D : Symbol(D, Decl(objectTypesIdentityWithPrivates2.ts, 4, 1)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithPrivates2.ts, 15, 25), Decl(objectTypesIdentityWithPrivates2.ts, 17, 28), Decl(objectTypesIdentityWithPrivates2.ts, 18, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 19, 14)) + +function foo4(x: C): number; +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithPrivates2.ts, 19, 25), Decl(objectTypesIdentityWithPrivates2.ts, 21, 36), Decl(objectTypesIdentityWithPrivates2.ts, 22, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 21, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates2.ts, 0, 0)) + +function foo4(x: D): string; // BUG 831926 +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithPrivates2.ts, 19, 25), Decl(objectTypesIdentityWithPrivates2.ts, 21, 36), Decl(objectTypesIdentityWithPrivates2.ts, 22, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 22, 14)) +>D : Symbol(D, Decl(objectTypesIdentityWithPrivates2.ts, 4, 1)) + +function foo4(x: any): any { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithPrivates2.ts, 19, 25), Decl(objectTypesIdentityWithPrivates2.ts, 21, 36), Decl(objectTypesIdentityWithPrivates2.ts, 22, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 23, 14)) + +var r = foo4(new C()); +>r : Symbol(r, Decl(objectTypesIdentityWithPrivates2.ts, 25, 3), Decl(objectTypesIdentityWithPrivates2.ts, 26, 3)) +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithPrivates2.ts, 19, 25), Decl(objectTypesIdentityWithPrivates2.ts, 21, 36), Decl(objectTypesIdentityWithPrivates2.ts, 22, 36)) +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates2.ts, 0, 0)) + +var r = foo4(new D()); +>r : Symbol(r, Decl(objectTypesIdentityWithPrivates2.ts, 25, 3), Decl(objectTypesIdentityWithPrivates2.ts, 26, 3)) +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithPrivates2.ts, 19, 25), Decl(objectTypesIdentityWithPrivates2.ts, 21, 36), Decl(objectTypesIdentityWithPrivates2.ts, 22, 36)) +>D : Symbol(D, Decl(objectTypesIdentityWithPrivates2.ts, 4, 1)) + +function foo5(x: C): number; +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithPrivates2.ts, 26, 30), Decl(objectTypesIdentityWithPrivates2.ts, 28, 36), Decl(objectTypesIdentityWithPrivates2.ts, 29, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 28, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates2.ts, 0, 0)) + +function foo5(x: C): string; // error +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithPrivates2.ts, 26, 30), Decl(objectTypesIdentityWithPrivates2.ts, 28, 36), Decl(objectTypesIdentityWithPrivates2.ts, 29, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 29, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates2.ts, 0, 0)) + +function foo5(x: any): any { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithPrivates2.ts, 26, 30), Decl(objectTypesIdentityWithPrivates2.ts, 28, 36), Decl(objectTypesIdentityWithPrivates2.ts, 29, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 30, 14)) + +function foo6(x: D): number; +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithPrivates2.ts, 30, 30), Decl(objectTypesIdentityWithPrivates2.ts, 32, 36), Decl(objectTypesIdentityWithPrivates2.ts, 33, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 32, 14)) +>D : Symbol(D, Decl(objectTypesIdentityWithPrivates2.ts, 4, 1)) + +function foo6(x: D): string; // error +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithPrivates2.ts, 30, 30), Decl(objectTypesIdentityWithPrivates2.ts, 32, 36), Decl(objectTypesIdentityWithPrivates2.ts, 33, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 33, 14)) +>D : Symbol(D, Decl(objectTypesIdentityWithPrivates2.ts, 4, 1)) + +function foo6(x: any): any { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithPrivates2.ts, 30, 30), Decl(objectTypesIdentityWithPrivates2.ts, 32, 36), Decl(objectTypesIdentityWithPrivates2.ts, 33, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 34, 14)) + + + diff --git a/tests/baselines/reference/objectTypesIdentityWithPublics.symbols b/tests/baselines/reference/objectTypesIdentityWithPublics.symbols new file mode 100644 index 00000000000..ebfb52e3d2e --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithPublics.symbols @@ -0,0 +1,279 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPublics.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithPublics.ts, 0, 0)) + + public foo: string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithPublics.ts, 2, 9)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithPublics.ts, 4, 1)) + + public foo: string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithPublics.ts, 6, 9)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithPublics.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithPublics.ts, 10, 8)) + + public foo: T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithPublics.ts, 10, 12)) +>T : Symbol(T, Decl(objectTypesIdentityWithPublics.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithPublics.ts, 12, 1)) + + foo: string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithPublics.ts, 14, 13)) +} + +var a: { foo: string; } +>a : Symbol(a, Decl(objectTypesIdentityWithPublics.ts, 18, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithPublics.ts, 18, 8)) + +var b = { foo: '' }; +>b : Symbol(b, Decl(objectTypesIdentityWithPublics.ts, 19, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithPublics.ts, 19, 9)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithPublics.ts, 19, 20), Decl(objectTypesIdentityWithPublics.ts, 21, 20), Decl(objectTypesIdentityWithPublics.ts, 22, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 21, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithPublics.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithPublics.ts, 19, 20), Decl(objectTypesIdentityWithPublics.ts, 21, 20), Decl(objectTypesIdentityWithPublics.ts, 22, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 22, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithPublics.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithPublics.ts, 19, 20), Decl(objectTypesIdentityWithPublics.ts, 21, 20), Decl(objectTypesIdentityWithPublics.ts, 22, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 23, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithPublics.ts, 23, 25), Decl(objectTypesIdentityWithPublics.ts, 25, 21), Decl(objectTypesIdentityWithPublics.ts, 26, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 25, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithPublics.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithPublics.ts, 23, 25), Decl(objectTypesIdentityWithPublics.ts, 25, 21), Decl(objectTypesIdentityWithPublics.ts, 26, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 26, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithPublics.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithPublics.ts, 23, 25), Decl(objectTypesIdentityWithPublics.ts, 25, 21), Decl(objectTypesIdentityWithPublics.ts, 26, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 27, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithPublics.ts, 27, 26), Decl(objectTypesIdentityWithPublics.ts, 29, 29), Decl(objectTypesIdentityWithPublics.ts, 30, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 29, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithPublics.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithPublics.ts, 27, 26), Decl(objectTypesIdentityWithPublics.ts, 29, 29), Decl(objectTypesIdentityWithPublics.ts, 30, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 30, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithPublics.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithPublics.ts, 27, 26), Decl(objectTypesIdentityWithPublics.ts, 29, 29), Decl(objectTypesIdentityWithPublics.ts, 30, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 31, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithPublics.ts, 31, 26), Decl(objectTypesIdentityWithPublics.ts, 33, 20), Decl(objectTypesIdentityWithPublics.ts, 34, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 33, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithPublics.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithPublics.ts, 31, 26), Decl(objectTypesIdentityWithPublics.ts, 33, 20), Decl(objectTypesIdentityWithPublics.ts, 34, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 34, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithPublics.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithPublics.ts, 31, 26), Decl(objectTypesIdentityWithPublics.ts, 33, 20), Decl(objectTypesIdentityWithPublics.ts, 34, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 35, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithPublics.ts, 35, 25), Decl(objectTypesIdentityWithPublics.ts, 37, 27), Decl(objectTypesIdentityWithPublics.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 37, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithPublics.ts, 18, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithPublics.ts, 35, 25), Decl(objectTypesIdentityWithPublics.ts, 37, 27), Decl(objectTypesIdentityWithPublics.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 38, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithPublics.ts, 18, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithPublics.ts, 35, 25), Decl(objectTypesIdentityWithPublics.ts, 37, 27), Decl(objectTypesIdentityWithPublics.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 39, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithPublics.ts, 39, 25), Decl(objectTypesIdentityWithPublics.ts, 41, 27), Decl(objectTypesIdentityWithPublics.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 41, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithPublics.ts, 19, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithPublics.ts, 39, 25), Decl(objectTypesIdentityWithPublics.ts, 41, 27), Decl(objectTypesIdentityWithPublics.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 42, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithPublics.ts, 19, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithPublics.ts, 39, 25), Decl(objectTypesIdentityWithPublics.ts, 41, 27), Decl(objectTypesIdentityWithPublics.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 43, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithPublics.ts, 43, 25), Decl(objectTypesIdentityWithPublics.ts, 45, 20), Decl(objectTypesIdentityWithPublics.ts, 46, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 45, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithPublics.ts, 0, 0)) + +function foo5(x: B); // error +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithPublics.ts, 43, 25), Decl(objectTypesIdentityWithPublics.ts, 45, 20), Decl(objectTypesIdentityWithPublics.ts, 46, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 46, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithPublics.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithPublics.ts, 43, 25), Decl(objectTypesIdentityWithPublics.ts, 45, 20), Decl(objectTypesIdentityWithPublics.ts, 46, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 47, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithPublics.ts, 47, 25), Decl(objectTypesIdentityWithPublics.ts, 49, 21), Decl(objectTypesIdentityWithPublics.ts, 50, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 49, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithPublics.ts, 0, 0)) + +function foo5b(x: C); // error +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithPublics.ts, 47, 25), Decl(objectTypesIdentityWithPublics.ts, 49, 21), Decl(objectTypesIdentityWithPublics.ts, 50, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 50, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithPublics.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithPublics.ts, 47, 25), Decl(objectTypesIdentityWithPublics.ts, 49, 21), Decl(objectTypesIdentityWithPublics.ts, 50, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 51, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithPublics.ts, 51, 26), Decl(objectTypesIdentityWithPublics.ts, 53, 20), Decl(objectTypesIdentityWithPublics.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 53, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithPublics.ts, 0, 0)) + +function foo6(x: I); // error +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithPublics.ts, 51, 26), Decl(objectTypesIdentityWithPublics.ts, 53, 20), Decl(objectTypesIdentityWithPublics.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 54, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithPublics.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithPublics.ts, 51, 26), Decl(objectTypesIdentityWithPublics.ts, 53, 20), Decl(objectTypesIdentityWithPublics.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 55, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithPublics.ts, 55, 25), Decl(objectTypesIdentityWithPublics.ts, 57, 20), Decl(objectTypesIdentityWithPublics.ts, 58, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 57, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithPublics.ts, 0, 0)) + +function foo7(x: typeof a); // error +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithPublics.ts, 55, 25), Decl(objectTypesIdentityWithPublics.ts, 57, 20), Decl(objectTypesIdentityWithPublics.ts, 58, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 58, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithPublics.ts, 18, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithPublics.ts, 55, 25), Decl(objectTypesIdentityWithPublics.ts, 57, 20), Decl(objectTypesIdentityWithPublics.ts, 58, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 59, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithPublics.ts, 59, 25), Decl(objectTypesIdentityWithPublics.ts, 61, 20), Decl(objectTypesIdentityWithPublics.ts, 62, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 61, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithPublics.ts, 4, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithPublics.ts, 59, 25), Decl(objectTypesIdentityWithPublics.ts, 61, 20), Decl(objectTypesIdentityWithPublics.ts, 62, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 62, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithPublics.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithPublics.ts, 59, 25), Decl(objectTypesIdentityWithPublics.ts, 61, 20), Decl(objectTypesIdentityWithPublics.ts, 62, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 63, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithPublics.ts, 63, 25), Decl(objectTypesIdentityWithPublics.ts, 65, 20), Decl(objectTypesIdentityWithPublics.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 65, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithPublics.ts, 4, 1)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithPublics.ts, 63, 25), Decl(objectTypesIdentityWithPublics.ts, 65, 20), Decl(objectTypesIdentityWithPublics.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 66, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithPublics.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithPublics.ts, 63, 25), Decl(objectTypesIdentityWithPublics.ts, 65, 20), Decl(objectTypesIdentityWithPublics.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 67, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithPublics.ts, 67, 25), Decl(objectTypesIdentityWithPublics.ts, 69, 21), Decl(objectTypesIdentityWithPublics.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 69, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithPublics.ts, 4, 1)) + +function foo10(x: typeof a); // error +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithPublics.ts, 67, 25), Decl(objectTypesIdentityWithPublics.ts, 69, 21), Decl(objectTypesIdentityWithPublics.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 70, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithPublics.ts, 18, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithPublics.ts, 67, 25), Decl(objectTypesIdentityWithPublics.ts, 69, 21), Decl(objectTypesIdentityWithPublics.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 71, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithPublics.ts, 71, 26), Decl(objectTypesIdentityWithPublics.ts, 73, 21), Decl(objectTypesIdentityWithPublics.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 73, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithPublics.ts, 4, 1)) + +function foo11(x: typeof b); // error +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithPublics.ts, 71, 26), Decl(objectTypesIdentityWithPublics.ts, 73, 21), Decl(objectTypesIdentityWithPublics.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 74, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithPublics.ts, 19, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithPublics.ts, 71, 26), Decl(objectTypesIdentityWithPublics.ts, 73, 21), Decl(objectTypesIdentityWithPublics.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 75, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithPublics.ts, 75, 26), Decl(objectTypesIdentityWithPublics.ts, 77, 21), Decl(objectTypesIdentityWithPublics.ts, 78, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 77, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithPublics.ts, 12, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithPublics.ts, 75, 26), Decl(objectTypesIdentityWithPublics.ts, 77, 21), Decl(objectTypesIdentityWithPublics.ts, 78, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 78, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithPublics.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithPublics.ts, 75, 26), Decl(objectTypesIdentityWithPublics.ts, 77, 21), Decl(objectTypesIdentityWithPublics.ts, 78, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 79, 15)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithPublics.ts, 79, 26), Decl(objectTypesIdentityWithPublics.ts, 81, 21), Decl(objectTypesIdentityWithPublics.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 81, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithPublics.ts, 12, 1)) + +function foo13(x: typeof a); // error +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithPublics.ts, 79, 26), Decl(objectTypesIdentityWithPublics.ts, 81, 21), Decl(objectTypesIdentityWithPublics.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 82, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithPublics.ts, 18, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithPublics.ts, 79, 26), Decl(objectTypesIdentityWithPublics.ts, 81, 21), Decl(objectTypesIdentityWithPublics.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 83, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithPublics.ts, 83, 26), Decl(objectTypesIdentityWithPublics.ts, 85, 21), Decl(objectTypesIdentityWithPublics.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 85, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithPublics.ts, 12, 1)) + +function foo14(x: typeof b); // error +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithPublics.ts, 83, 26), Decl(objectTypesIdentityWithPublics.ts, 85, 21), Decl(objectTypesIdentityWithPublics.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 86, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithPublics.ts, 19, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithPublics.ts, 83, 26), Decl(objectTypesIdentityWithPublics.ts, 85, 21), Decl(objectTypesIdentityWithPublics.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 87, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithPublics.types b/tests/baselines/reference/objectTypesIdentityWithPublics.types index 411fe4fb88e..daae624a7d1 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPublics.types +++ b/tests/baselines/reference/objectTypesIdentityWithPublics.types @@ -39,6 +39,7 @@ var b = { foo: '' }; >b : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string +>'' : string function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.symbols b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.symbols new file mode 100644 index 00000000000..5a51f1bb0a6 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.symbols @@ -0,0 +1,377 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithStringIndexers.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers.ts, 0, 0)) + + [x: string]: string; +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 3, 5)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers.ts, 4, 1)) + + [x: string]: string; +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 7, 5)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithStringIndexers.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithStringIndexers.ts, 10, 8)) + + [x: string]: T; +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 11, 5)) +>T : Symbol(T, Decl(objectTypesIdentityWithStringIndexers.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers.ts, 12, 1)) + + [x: string]: string; +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 15, 5)) +} + +class PA extends A { +>PA : Symbol(PA, Decl(objectTypesIdentityWithStringIndexers.ts, 16, 1)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers.ts, 0, 0)) +} + +class PB extends B { +>PB : Symbol(PB, Decl(objectTypesIdentityWithStringIndexers.ts, 19, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers.ts, 4, 1)) +} + +var a: { +>a : Symbol(a, Decl(objectTypesIdentityWithStringIndexers.ts, 24, 3)) + + [x: string]: string; +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 25, 5)) +} +var b: { [x: string]: string; } = { foo: '' }; +>b : Symbol(b, Decl(objectTypesIdentityWithStringIndexers.ts, 27, 3)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 27, 10)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithStringIndexers.ts, 27, 35)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithStringIndexers.ts, 27, 46), Decl(objectTypesIdentityWithStringIndexers.ts, 29, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 29, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithStringIndexers.ts, 27, 46), Decl(objectTypesIdentityWithStringIndexers.ts, 29, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 30, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithStringIndexers.ts, 27, 46), Decl(objectTypesIdentityWithStringIndexers.ts, 29, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 31, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithStringIndexers.ts, 31, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 33, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 34, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 33, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithStringIndexers.ts, 31, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 33, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 34, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 34, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithStringIndexers.ts, 31, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 33, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 34, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 35, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithStringIndexers.ts, 35, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 37, 29), Decl(objectTypesIdentityWithStringIndexers.ts, 38, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 37, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithStringIndexers.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithStringIndexers.ts, 35, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 37, 29), Decl(objectTypesIdentityWithStringIndexers.ts, 38, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 38, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithStringIndexers.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithStringIndexers.ts, 35, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 37, 29), Decl(objectTypesIdentityWithStringIndexers.ts, 38, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 39, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithStringIndexers.ts, 39, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 41, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 41, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithStringIndexers.ts, 39, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 41, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 42, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithStringIndexers.ts, 39, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 41, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 43, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithStringIndexers.ts, 43, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 45, 27), Decl(objectTypesIdentityWithStringIndexers.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 45, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithStringIndexers.ts, 24, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithStringIndexers.ts, 43, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 45, 27), Decl(objectTypesIdentityWithStringIndexers.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 46, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithStringIndexers.ts, 24, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithStringIndexers.ts, 43, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 45, 27), Decl(objectTypesIdentityWithStringIndexers.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 47, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithStringIndexers.ts, 47, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 49, 27), Decl(objectTypesIdentityWithStringIndexers.ts, 50, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 49, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithStringIndexers.ts, 27, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithStringIndexers.ts, 47, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 49, 27), Decl(objectTypesIdentityWithStringIndexers.ts, 50, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 50, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithStringIndexers.ts, 27, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithStringIndexers.ts, 47, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 49, 27), Decl(objectTypesIdentityWithStringIndexers.ts, 50, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 51, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithStringIndexers.ts, 51, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 53, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 53, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers.ts, 0, 0)) + +function foo5(x: B); // error +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithStringIndexers.ts, 51, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 53, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 54, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithStringIndexers.ts, 51, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 53, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 55, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithStringIndexers.ts, 55, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 57, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 57, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers.ts, 0, 0)) + +function foo5b(x: C); // error +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithStringIndexers.ts, 55, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 57, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 58, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithStringIndexers.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithStringIndexers.ts, 55, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 57, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 59, 15)) + +function foo5c(x: A); +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithStringIndexers.ts, 59, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 61, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 62, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 61, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers.ts, 0, 0)) + +function foo5c(x: PA); // error +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithStringIndexers.ts, 59, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 61, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 62, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 62, 15)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithStringIndexers.ts, 16, 1)) + +function foo5c(x: any) { } +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithStringIndexers.ts, 59, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 61, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 62, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 63, 15)) + +function foo5d(x: A); +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithStringIndexers.ts, 63, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 65, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 66, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 65, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers.ts, 0, 0)) + +function foo5d(x: PB); // error +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithStringIndexers.ts, 63, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 65, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 66, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 66, 15)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithStringIndexers.ts, 19, 1)) + +function foo5d(x: any) { } +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithStringIndexers.ts, 63, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 65, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 66, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 67, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithStringIndexers.ts, 67, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 69, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 70, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 69, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers.ts, 0, 0)) + +function foo6(x: I); // error +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithStringIndexers.ts, 67, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 69, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 70, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 70, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithStringIndexers.ts, 67, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 69, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 70, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 71, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithStringIndexers.ts, 71, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 73, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 74, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 73, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers.ts, 0, 0)) + +function foo7(x: typeof a); // error +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithStringIndexers.ts, 71, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 73, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 74, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 74, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithStringIndexers.ts, 24, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithStringIndexers.ts, 71, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 73, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 74, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 75, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithStringIndexers.ts, 75, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 77, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 78, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 77, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers.ts, 4, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithStringIndexers.ts, 75, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 77, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 78, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 78, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithStringIndexers.ts, 75, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 77, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 78, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 79, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithStringIndexers.ts, 79, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 81, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 81, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers.ts, 4, 1)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithStringIndexers.ts, 79, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 81, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 82, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithStringIndexers.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithStringIndexers.ts, 79, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 81, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 83, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithStringIndexers.ts, 83, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 85, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 85, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers.ts, 4, 1)) + +function foo10(x: typeof a); // error +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithStringIndexers.ts, 83, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 85, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 86, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithStringIndexers.ts, 24, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithStringIndexers.ts, 83, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 85, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 87, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithStringIndexers.ts, 87, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 89, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 89, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers.ts, 4, 1)) + +function foo11(x: typeof b); // error +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithStringIndexers.ts, 87, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 89, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 90, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithStringIndexers.ts, 27, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithStringIndexers.ts, 87, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 89, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 91, 15)) + +function foo11b(x: B); +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithStringIndexers.ts, 91, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 93, 22), Decl(objectTypesIdentityWithStringIndexers.ts, 94, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 93, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers.ts, 4, 1)) + +function foo11b(x: PA); // error +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithStringIndexers.ts, 91, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 93, 22), Decl(objectTypesIdentityWithStringIndexers.ts, 94, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 94, 16)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithStringIndexers.ts, 16, 1)) + +function foo11b(x: any) { } +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithStringIndexers.ts, 91, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 93, 22), Decl(objectTypesIdentityWithStringIndexers.ts, 94, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 95, 16)) + +function foo11c(x: B); +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithStringIndexers.ts, 95, 27), Decl(objectTypesIdentityWithStringIndexers.ts, 97, 22), Decl(objectTypesIdentityWithStringIndexers.ts, 98, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 97, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers.ts, 4, 1)) + +function foo11c(x: PB); // error +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithStringIndexers.ts, 95, 27), Decl(objectTypesIdentityWithStringIndexers.ts, 97, 22), Decl(objectTypesIdentityWithStringIndexers.ts, 98, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 98, 16)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithStringIndexers.ts, 19, 1)) + +function foo11c(x: any) { } +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithStringIndexers.ts, 95, 27), Decl(objectTypesIdentityWithStringIndexers.ts, 97, 22), Decl(objectTypesIdentityWithStringIndexers.ts, 98, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 99, 16)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithStringIndexers.ts, 99, 27), Decl(objectTypesIdentityWithStringIndexers.ts, 101, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 102, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 101, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers.ts, 12, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithStringIndexers.ts, 99, 27), Decl(objectTypesIdentityWithStringIndexers.ts, 101, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 102, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 102, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithStringIndexers.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithStringIndexers.ts, 99, 27), Decl(objectTypesIdentityWithStringIndexers.ts, 101, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 102, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 103, 15)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithStringIndexers.ts, 103, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 105, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 106, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 105, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers.ts, 12, 1)) + +function foo13(x: typeof a); // error +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithStringIndexers.ts, 103, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 105, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 106, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 106, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithStringIndexers.ts, 24, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithStringIndexers.ts, 103, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 105, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 106, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 107, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithStringIndexers.ts, 107, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 109, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 110, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 109, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers.ts, 12, 1)) + +function foo14(x: typeof b); // error +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithStringIndexers.ts, 107, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 109, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 110, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 110, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithStringIndexers.ts, 27, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithStringIndexers.ts, 107, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 109, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 110, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 111, 15)) + +function foo15(x: I); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithStringIndexers.ts, 111, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 113, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 114, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 113, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers.ts, 12, 1)) + +function foo15(x: PA); // error +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithStringIndexers.ts, 111, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 113, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 114, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 114, 15)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithStringIndexers.ts, 16, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithStringIndexers.ts, 111, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 113, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 114, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 115, 15)) + +function foo16(x: I); +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithStringIndexers.ts, 115, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 117, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 118, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 117, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers.ts, 12, 1)) + +function foo16(x: PB); // error +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithStringIndexers.ts, 115, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 117, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 118, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 118, 15)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithStringIndexers.ts, 19, 1)) + +function foo16(x: any) { } +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithStringIndexers.ts, 115, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 117, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 118, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 119, 15)) + + diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.types b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.types index 83a73646874..a7eeb672504 100644 --- a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.types +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.types @@ -52,6 +52,7 @@ var b: { [x: string]: string; } = { foo: '' }; >x : string >{ foo: '' } : { [x: string]: string; foo: string; } >foo : string +>'' : string function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.symbols b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.symbols new file mode 100644 index 00000000000..2df0bf01b1d --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.symbols @@ -0,0 +1,395 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithStringIndexers2.ts === +// object types are identical structurally + +class Base { foo: string; } +>Base : Symbol(Base, Decl(objectTypesIdentityWithStringIndexers2.ts, 0, 0)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithStringIndexers2.ts, 2, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithStringIndexers2.ts, 2, 27)) +>Base : Symbol(Base, Decl(objectTypesIdentityWithStringIndexers2.ts, 0, 0)) +>bar : Symbol(bar, Decl(objectTypesIdentityWithStringIndexers2.ts, 3, 28)) + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers2.ts, 3, 43)) + + [x: string]: Base; +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 6, 5)) +>Base : Symbol(Base, Decl(objectTypesIdentityWithStringIndexers2.ts, 0, 0)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers2.ts, 7, 1)) + + [x: string]: Derived; +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 10, 5)) +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithStringIndexers2.ts, 2, 27)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithStringIndexers2.ts, 11, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithStringIndexers2.ts, 13, 8)) + + [x: string]: T; +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 14, 5)) +>T : Symbol(T, Decl(objectTypesIdentityWithStringIndexers2.ts, 13, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers2.ts, 15, 1)) + + [x: string]: Derived; +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 18, 5)) +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithStringIndexers2.ts, 2, 27)) +} + +class PA extends A { +>PA : Symbol(PA, Decl(objectTypesIdentityWithStringIndexers2.ts, 19, 1)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers2.ts, 3, 43)) +} + +class PB extends B { +>PB : Symbol(PB, Decl(objectTypesIdentityWithStringIndexers2.ts, 22, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers2.ts, 7, 1)) +} + +var a: { +>a : Symbol(a, Decl(objectTypesIdentityWithStringIndexers2.ts, 27, 3)) + + [x: string]: Base; +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 28, 5)) +>Base : Symbol(Base, Decl(objectTypesIdentityWithStringIndexers2.ts, 0, 0)) +} +var b: { [x: string]: Derived; } = { foo: null }; +>b : Symbol(b, Decl(objectTypesIdentityWithStringIndexers2.ts, 30, 3)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 30, 10)) +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithStringIndexers2.ts, 2, 27)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithStringIndexers2.ts, 30, 36)) +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithStringIndexers2.ts, 2, 27)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithStringIndexers2.ts, 30, 58), Decl(objectTypesIdentityWithStringIndexers2.ts, 32, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 33, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 32, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers2.ts, 3, 43)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithStringIndexers2.ts, 30, 58), Decl(objectTypesIdentityWithStringIndexers2.ts, 32, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 33, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 33, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers2.ts, 3, 43)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithStringIndexers2.ts, 30, 58), Decl(objectTypesIdentityWithStringIndexers2.ts, 32, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 33, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 34, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithStringIndexers2.ts, 34, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 36, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 37, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 36, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers2.ts, 7, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithStringIndexers2.ts, 34, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 36, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 37, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 37, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers2.ts, 7, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithStringIndexers2.ts, 34, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 36, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 37, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 38, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithStringIndexers2.ts, 38, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 40, 29), Decl(objectTypesIdentityWithStringIndexers2.ts, 41, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 40, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithStringIndexers2.ts, 11, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithStringIndexers2.ts, 38, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 40, 29), Decl(objectTypesIdentityWithStringIndexers2.ts, 41, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 41, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithStringIndexers2.ts, 11, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithStringIndexers2.ts, 38, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 40, 29), Decl(objectTypesIdentityWithStringIndexers2.ts, 41, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 42, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithStringIndexers2.ts, 42, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 44, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 45, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 44, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers2.ts, 15, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithStringIndexers2.ts, 42, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 44, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 45, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 45, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers2.ts, 15, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithStringIndexers2.ts, 42, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 44, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 45, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 46, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithStringIndexers2.ts, 46, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 48, 27), Decl(objectTypesIdentityWithStringIndexers2.ts, 49, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 48, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithStringIndexers2.ts, 27, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithStringIndexers2.ts, 46, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 48, 27), Decl(objectTypesIdentityWithStringIndexers2.ts, 49, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 49, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithStringIndexers2.ts, 27, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithStringIndexers2.ts, 46, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 48, 27), Decl(objectTypesIdentityWithStringIndexers2.ts, 49, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 50, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithStringIndexers2.ts, 50, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 52, 27), Decl(objectTypesIdentityWithStringIndexers2.ts, 53, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 52, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithStringIndexers2.ts, 30, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithStringIndexers2.ts, 50, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 52, 27), Decl(objectTypesIdentityWithStringIndexers2.ts, 53, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 53, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithStringIndexers2.ts, 30, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithStringIndexers2.ts, 50, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 52, 27), Decl(objectTypesIdentityWithStringIndexers2.ts, 53, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 54, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithStringIndexers2.ts, 54, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 56, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 57, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 56, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers2.ts, 3, 43)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithStringIndexers2.ts, 54, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 56, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 57, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 57, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers2.ts, 7, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithStringIndexers2.ts, 54, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 56, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 57, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 58, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithStringIndexers2.ts, 58, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 60, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 61, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 60, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers2.ts, 3, 43)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithStringIndexers2.ts, 58, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 60, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 61, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 61, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithStringIndexers2.ts, 11, 1)) +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithStringIndexers2.ts, 2, 27)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithStringIndexers2.ts, 58, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 60, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 61, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 62, 15)) + +function foo5c(x: A); +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithStringIndexers2.ts, 62, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 64, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 65, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 64, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers2.ts, 3, 43)) + +function foo5c(x: PA); // error +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithStringIndexers2.ts, 62, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 64, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 65, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 65, 15)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithStringIndexers2.ts, 19, 1)) + +function foo5c(x: any) { } +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithStringIndexers2.ts, 62, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 64, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 65, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 66, 15)) + +function foo5d(x: A); +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithStringIndexers2.ts, 66, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 68, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 69, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 68, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers2.ts, 3, 43)) + +function foo5d(x: PB); // ok +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithStringIndexers2.ts, 66, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 68, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 69, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 69, 15)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithStringIndexers2.ts, 22, 1)) + +function foo5d(x: any) { } +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithStringIndexers2.ts, 66, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 68, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 69, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 70, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithStringIndexers2.ts, 70, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 72, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 73, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 72, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers2.ts, 3, 43)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithStringIndexers2.ts, 70, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 72, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 73, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 73, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers2.ts, 15, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithStringIndexers2.ts, 70, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 72, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 73, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 74, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithStringIndexers2.ts, 74, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 76, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 77, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 76, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers2.ts, 3, 43)) + +function foo7(x: typeof a); // error +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithStringIndexers2.ts, 74, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 76, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 77, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 77, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithStringIndexers2.ts, 27, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithStringIndexers2.ts, 74, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 76, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 77, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 78, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithStringIndexers2.ts, 78, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 80, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 81, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 80, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers2.ts, 7, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithStringIndexers2.ts, 78, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 80, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 81, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 81, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers2.ts, 15, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithStringIndexers2.ts, 78, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 80, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 81, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 82, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithStringIndexers2.ts, 82, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 84, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 85, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 84, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers2.ts, 7, 1)) + +function foo9(x: C); // ok +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithStringIndexers2.ts, 82, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 84, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 85, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 85, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithStringIndexers2.ts, 11, 1)) +>Base : Symbol(Base, Decl(objectTypesIdentityWithStringIndexers2.ts, 0, 0)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithStringIndexers2.ts, 82, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 84, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 85, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 86, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithStringIndexers2.ts, 86, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 88, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 89, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 88, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers2.ts, 7, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithStringIndexers2.ts, 86, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 88, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 89, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 89, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithStringIndexers2.ts, 27, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithStringIndexers2.ts, 86, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 88, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 89, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 90, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithStringIndexers2.ts, 90, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 92, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 93, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 92, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers2.ts, 7, 1)) + +function foo11(x: typeof b); // error +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithStringIndexers2.ts, 90, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 92, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 93, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 93, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithStringIndexers2.ts, 30, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithStringIndexers2.ts, 90, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 92, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 93, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 94, 15)) + +function foo11b(x: B); +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithStringIndexers2.ts, 94, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 96, 22), Decl(objectTypesIdentityWithStringIndexers2.ts, 97, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 96, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers2.ts, 7, 1)) + +function foo11b(x: PA); // ok +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithStringIndexers2.ts, 94, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 96, 22), Decl(objectTypesIdentityWithStringIndexers2.ts, 97, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 97, 16)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithStringIndexers2.ts, 19, 1)) + +function foo11b(x: any) { } +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithStringIndexers2.ts, 94, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 96, 22), Decl(objectTypesIdentityWithStringIndexers2.ts, 97, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 98, 16)) + +function foo11c(x: B); +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithStringIndexers2.ts, 98, 27), Decl(objectTypesIdentityWithStringIndexers2.ts, 100, 22), Decl(objectTypesIdentityWithStringIndexers2.ts, 101, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 100, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers2.ts, 7, 1)) + +function foo11c(x: PB); // error +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithStringIndexers2.ts, 98, 27), Decl(objectTypesIdentityWithStringIndexers2.ts, 100, 22), Decl(objectTypesIdentityWithStringIndexers2.ts, 101, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 101, 16)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithStringIndexers2.ts, 22, 1)) + +function foo11c(x: any) { } +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithStringIndexers2.ts, 98, 27), Decl(objectTypesIdentityWithStringIndexers2.ts, 100, 22), Decl(objectTypesIdentityWithStringIndexers2.ts, 101, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 102, 16)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithStringIndexers2.ts, 102, 27), Decl(objectTypesIdentityWithStringIndexers2.ts, 104, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 105, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 104, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers2.ts, 15, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithStringIndexers2.ts, 102, 27), Decl(objectTypesIdentityWithStringIndexers2.ts, 104, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 105, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 105, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithStringIndexers2.ts, 11, 1)) +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithStringIndexers2.ts, 2, 27)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithStringIndexers2.ts, 102, 27), Decl(objectTypesIdentityWithStringIndexers2.ts, 104, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 105, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 106, 15)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithStringIndexers2.ts, 106, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 108, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 109, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 108, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers2.ts, 15, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithStringIndexers2.ts, 106, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 108, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 109, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 109, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithStringIndexers2.ts, 27, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithStringIndexers2.ts, 106, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 108, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 109, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 110, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithStringIndexers2.ts, 110, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 112, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 113, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 112, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers2.ts, 15, 1)) + +function foo14(x: typeof b); // error +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithStringIndexers2.ts, 110, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 112, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 113, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 113, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithStringIndexers2.ts, 30, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithStringIndexers2.ts, 110, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 112, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 113, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 114, 15)) + +function foo15(x: I); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithStringIndexers2.ts, 114, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 116, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 117, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 116, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers2.ts, 15, 1)) + +function foo15(x: PA); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithStringIndexers2.ts, 114, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 116, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 117, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 117, 15)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithStringIndexers2.ts, 19, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithStringIndexers2.ts, 114, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 116, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 117, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 118, 15)) + +function foo16(x: I); +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithStringIndexers2.ts, 118, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 120, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 121, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 120, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers2.ts, 15, 1)) + +function foo16(x: PB); // error +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithStringIndexers2.ts, 118, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 120, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 121, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 121, 15)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithStringIndexers2.ts, 22, 1)) + +function foo16(x: any) { } +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithStringIndexers2.ts, 118, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 120, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 121, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 122, 15)) + + diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.types b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.types index c621be1e26b..d1394252117 100644 --- a/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.types +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.types @@ -68,6 +68,7 @@ var b: { [x: string]: Derived; } = { foo: null }; >foo : Derived >null : Derived >Derived : Derived +>null : null function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/octalIntegerLiteral.symbols b/tests/baselines/reference/octalIntegerLiteral.symbols new file mode 100644 index 00000000000..6a4839839aa --- /dev/null +++ b/tests/baselines/reference/octalIntegerLiteral.symbols @@ -0,0 +1,116 @@ +=== tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteral.ts === +var oct1 = 0o45436; +>oct1 : Symbol(oct1, Decl(octalIntegerLiteral.ts, 0, 3)) + +var oct2 = 0O45436; +>oct2 : Symbol(oct2, Decl(octalIntegerLiteral.ts, 1, 3)) + +var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777; +>oct3 : Symbol(oct3, Decl(octalIntegerLiteral.ts, 2, 3)) + +var oct4 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777; +>oct4 : Symbol(oct4, Decl(octalIntegerLiteral.ts, 3, 3)) + +var obj1 = { +>obj1 : Symbol(obj1, Decl(octalIntegerLiteral.ts, 5, 3)) + + 0o45436: "Hello", + a: 0o45436, +>a : Symbol(a, Decl(octalIntegerLiteral.ts, 6, 21)) + + b: oct1, +>b : Symbol(b, Decl(octalIntegerLiteral.ts, 7, 15)) +>oct1 : Symbol(oct1, Decl(octalIntegerLiteral.ts, 0, 3)) + + oct1, +>oct1 : Symbol(oct1, Decl(octalIntegerLiteral.ts, 8, 12)) + + 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true +} + +var obj2 = { +>obj2 : Symbol(obj2, Decl(octalIntegerLiteral.ts, 13, 3)) + + 0O45436: "hi", + a: 0O45436, +>a : Symbol(a, Decl(octalIntegerLiteral.ts, 14, 18)) + + b: oct2, +>b : Symbol(b, Decl(octalIntegerLiteral.ts, 15, 15)) +>oct2 : Symbol(oct2, Decl(octalIntegerLiteral.ts, 1, 3)) + + oct2, +>oct2 : Symbol(oct2, Decl(octalIntegerLiteral.ts, 16, 12)) + + 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false, +} + +obj1[0o45436]; // string +>obj1 : Symbol(obj1, Decl(octalIntegerLiteral.ts, 5, 3)) +>0o45436 : Symbol(0o45436, Decl(octalIntegerLiteral.ts, 5, 12)) + +obj1["0o45436"]; // any +>obj1 : Symbol(obj1, Decl(octalIntegerLiteral.ts, 5, 3)) + +obj1["19230"]; // string +>obj1 : Symbol(obj1, Decl(octalIntegerLiteral.ts, 5, 3)) +>"19230" : Symbol(0o45436, Decl(octalIntegerLiteral.ts, 5, 12)) + +obj1[19230]; // string +>obj1 : Symbol(obj1, Decl(octalIntegerLiteral.ts, 5, 3)) +>19230 : Symbol(0o45436, Decl(octalIntegerLiteral.ts, 5, 12)) + +obj1["a"]; // number +>obj1 : Symbol(obj1, Decl(octalIntegerLiteral.ts, 5, 3)) +>"a" : Symbol(a, Decl(octalIntegerLiteral.ts, 6, 21)) + +obj1["b"]; // number +>obj1 : Symbol(obj1, Decl(octalIntegerLiteral.ts, 5, 3)) +>"b" : Symbol(b, Decl(octalIntegerLiteral.ts, 7, 15)) + +obj1["oct1"]; // number +>obj1 : Symbol(obj1, Decl(octalIntegerLiteral.ts, 5, 3)) +>"oct1" : Symbol(oct1, Decl(octalIntegerLiteral.ts, 8, 12)) + +obj1["Infinity"]; // boolean +>obj1 : Symbol(obj1, Decl(octalIntegerLiteral.ts, 5, 3)) +>"Infinity" : Symbol(0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777, Decl(octalIntegerLiteral.ts, 9, 9)) + +obj2[0O45436]; // string +>obj2 : Symbol(obj2, Decl(octalIntegerLiteral.ts, 13, 3)) +>0O45436 : Symbol(0O45436, Decl(octalIntegerLiteral.ts, 13, 12)) + +obj2["0O45436"]; // any +>obj2 : Symbol(obj2, Decl(octalIntegerLiteral.ts, 13, 3)) + +obj2["19230"]; // string +>obj2 : Symbol(obj2, Decl(octalIntegerLiteral.ts, 13, 3)) +>"19230" : Symbol(0O45436, Decl(octalIntegerLiteral.ts, 13, 12)) + +obj2[19230]; // string +>obj2 : Symbol(obj2, Decl(octalIntegerLiteral.ts, 13, 3)) +>19230 : Symbol(0O45436, Decl(octalIntegerLiteral.ts, 13, 12)) + +obj2["a"]; // number +>obj2 : Symbol(obj2, Decl(octalIntegerLiteral.ts, 13, 3)) +>"a" : Symbol(a, Decl(octalIntegerLiteral.ts, 14, 18)) + +obj2["b"]; // number +>obj2 : Symbol(obj2, Decl(octalIntegerLiteral.ts, 13, 3)) +>"b" : Symbol(b, Decl(octalIntegerLiteral.ts, 15, 15)) + +obj2["oct2"]; // number +>obj2 : Symbol(obj2, Decl(octalIntegerLiteral.ts, 13, 3)) +>"oct2" : Symbol(oct2, Decl(octalIntegerLiteral.ts, 16, 12)) + +obj2[5.462437423415177e+244]; // boolean +>obj2 : Symbol(obj2, Decl(octalIntegerLiteral.ts, 13, 3)) +>5.462437423415177e+244 : Symbol(0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777, Decl(octalIntegerLiteral.ts, 17, 9)) + +obj2["5.462437423415177e+244"]; // boolean +>obj2 : Symbol(obj2, Decl(octalIntegerLiteral.ts, 13, 3)) +>"5.462437423415177e+244" : Symbol(0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777, Decl(octalIntegerLiteral.ts, 17, 9)) + +obj2["Infinity"]; // any +>obj2 : Symbol(obj2, Decl(octalIntegerLiteral.ts, 13, 3)) + diff --git a/tests/baselines/reference/octalIntegerLiteral.types b/tests/baselines/reference/octalIntegerLiteral.types index 82f72cf625b..8352e5fac0c 100644 --- a/tests/baselines/reference/octalIntegerLiteral.types +++ b/tests/baselines/reference/octalIntegerLiteral.types @@ -1,23 +1,30 @@ === tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteral.ts === var oct1 = 0o45436; >oct1 : number +>0o45436 : number var oct2 = 0O45436; >oct2 : number +>0O45436 : number var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777; >oct3 : number +>0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 : number var oct4 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777; >oct4 : number +>0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 : number var obj1 = { >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } >{ 0o45436: "Hello", a: 0o45436, b: oct1, oct1, 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true} : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } 0o45436: "Hello", +>"Hello" : string + a: 0o45436, >a : number +>0o45436 : number b: oct1, >b : number @@ -27,6 +34,7 @@ var obj1 = { >oct1 : number 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true +>true : boolean } var obj2 = { @@ -34,8 +42,11 @@ var obj2 = { >{ 0O45436: "hi", a: 0O45436, b: oct2, oct2, 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false,} : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } 0O45436: "hi", +>"hi" : string + a: 0O45436, >a : number +>0O45436 : number b: oct2, >b : number @@ -45,77 +56,96 @@ var obj2 = { >oct2 : number 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false, +>false : boolean } obj1[0o45436]; // string >obj1[0o45436] : string >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>0o45436 : number obj1["0o45436"]; // any >obj1["0o45436"] : any >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"0o45436" : string obj1["19230"]; // string >obj1["19230"] : string >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"19230" : string obj1[19230]; // string >obj1[19230] : string >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>19230 : number obj1["a"]; // number >obj1["a"] : number >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"a" : string obj1["b"]; // number >obj1["b"] : number >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"b" : string obj1["oct1"]; // number >obj1["oct1"] : number >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"oct1" : string obj1["Infinity"]; // boolean >obj1["Infinity"] : boolean >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"Infinity" : string obj2[0O45436]; // string >obj2[0O45436] : string >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>0O45436 : number obj2["0O45436"]; // any >obj2["0O45436"] : any >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"0O45436" : string obj2["19230"]; // string >obj2["19230"] : string >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"19230" : string obj2[19230]; // string >obj2[19230] : string >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>19230 : number obj2["a"]; // number >obj2["a"] : number >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"a" : string obj2["b"]; // number >obj2["b"] : number >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"b" : string obj2["oct2"]; // number >obj2["oct2"] : number >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"oct2" : string obj2[5.462437423415177e+244]; // boolean >obj2[5.462437423415177e+244] : boolean >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>5.462437423415177e+244 : number obj2["5.462437423415177e+244"]; // boolean >obj2["5.462437423415177e+244"] : boolean >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"5.462437423415177e+244" : string obj2["Infinity"]; // any >obj2["Infinity"] : any >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"Infinity" : string diff --git a/tests/baselines/reference/octalIntegerLiteralES6.symbols b/tests/baselines/reference/octalIntegerLiteralES6.symbols new file mode 100644 index 00000000000..ff3f54936cd --- /dev/null +++ b/tests/baselines/reference/octalIntegerLiteralES6.symbols @@ -0,0 +1,116 @@ +=== tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteralES6.ts === +var oct1 = 0o45436; +>oct1 : Symbol(oct1, Decl(octalIntegerLiteralES6.ts, 0, 3)) + +var oct2 = 0O45436; +>oct2 : Symbol(oct2, Decl(octalIntegerLiteralES6.ts, 1, 3)) + +var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777; +>oct3 : Symbol(oct3, Decl(octalIntegerLiteralES6.ts, 2, 3)) + +var oct4 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777; +>oct4 : Symbol(oct4, Decl(octalIntegerLiteralES6.ts, 3, 3)) + +var obj1 = { +>obj1 : Symbol(obj1, Decl(octalIntegerLiteralES6.ts, 5, 3)) + + 0o45436: "Hello", + a: 0o45436, +>a : Symbol(a, Decl(octalIntegerLiteralES6.ts, 6, 21)) + + b: oct1, +>b : Symbol(b, Decl(octalIntegerLiteralES6.ts, 7, 15)) +>oct1 : Symbol(oct1, Decl(octalIntegerLiteralES6.ts, 0, 3)) + + oct1, +>oct1 : Symbol(oct1, Decl(octalIntegerLiteralES6.ts, 8, 12)) + + 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true +} + +var obj2 = { +>obj2 : Symbol(obj2, Decl(octalIntegerLiteralES6.ts, 13, 3)) + + 0O45436: "hi", + a: 0O45436, +>a : Symbol(a, Decl(octalIntegerLiteralES6.ts, 14, 18)) + + b: oct2, +>b : Symbol(b, Decl(octalIntegerLiteralES6.ts, 15, 15)) +>oct2 : Symbol(oct2, Decl(octalIntegerLiteralES6.ts, 1, 3)) + + oct2, +>oct2 : Symbol(oct2, Decl(octalIntegerLiteralES6.ts, 16, 12)) + + 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false, +} + +obj1[0o45436]; // string +>obj1 : Symbol(obj1, Decl(octalIntegerLiteralES6.ts, 5, 3)) +>0o45436 : Symbol(0o45436, Decl(octalIntegerLiteralES6.ts, 5, 12)) + +obj1["0o45436"]; // any +>obj1 : Symbol(obj1, Decl(octalIntegerLiteralES6.ts, 5, 3)) + +obj1["19230"]; // string +>obj1 : Symbol(obj1, Decl(octalIntegerLiteralES6.ts, 5, 3)) +>"19230" : Symbol(0o45436, Decl(octalIntegerLiteralES6.ts, 5, 12)) + +obj1[19230]; // string +>obj1 : Symbol(obj1, Decl(octalIntegerLiteralES6.ts, 5, 3)) +>19230 : Symbol(0o45436, Decl(octalIntegerLiteralES6.ts, 5, 12)) + +obj1["a"]; // number +>obj1 : Symbol(obj1, Decl(octalIntegerLiteralES6.ts, 5, 3)) +>"a" : Symbol(a, Decl(octalIntegerLiteralES6.ts, 6, 21)) + +obj1["b"]; // number +>obj1 : Symbol(obj1, Decl(octalIntegerLiteralES6.ts, 5, 3)) +>"b" : Symbol(b, Decl(octalIntegerLiteralES6.ts, 7, 15)) + +obj1["oct1"]; // number +>obj1 : Symbol(obj1, Decl(octalIntegerLiteralES6.ts, 5, 3)) +>"oct1" : Symbol(oct1, Decl(octalIntegerLiteralES6.ts, 8, 12)) + +obj1["Infinity"]; // boolean +>obj1 : Symbol(obj1, Decl(octalIntegerLiteralES6.ts, 5, 3)) +>"Infinity" : Symbol(0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777, Decl(octalIntegerLiteralES6.ts, 9, 9)) + +obj2[0O45436]; // string +>obj2 : Symbol(obj2, Decl(octalIntegerLiteralES6.ts, 13, 3)) +>0O45436 : Symbol(0O45436, Decl(octalIntegerLiteralES6.ts, 13, 12)) + +obj2["0O45436"]; // any +>obj2 : Symbol(obj2, Decl(octalIntegerLiteralES6.ts, 13, 3)) + +obj2["19230"]; // string +>obj2 : Symbol(obj2, Decl(octalIntegerLiteralES6.ts, 13, 3)) +>"19230" : Symbol(0O45436, Decl(octalIntegerLiteralES6.ts, 13, 12)) + +obj2[19230]; // string +>obj2 : Symbol(obj2, Decl(octalIntegerLiteralES6.ts, 13, 3)) +>19230 : Symbol(0O45436, Decl(octalIntegerLiteralES6.ts, 13, 12)) + +obj2["a"]; // number +>obj2 : Symbol(obj2, Decl(octalIntegerLiteralES6.ts, 13, 3)) +>"a" : Symbol(a, Decl(octalIntegerLiteralES6.ts, 14, 18)) + +obj2["b"]; // number +>obj2 : Symbol(obj2, Decl(octalIntegerLiteralES6.ts, 13, 3)) +>"b" : Symbol(b, Decl(octalIntegerLiteralES6.ts, 15, 15)) + +obj2["oct2"]; // number +>obj2 : Symbol(obj2, Decl(octalIntegerLiteralES6.ts, 13, 3)) +>"oct2" : Symbol(oct2, Decl(octalIntegerLiteralES6.ts, 16, 12)) + +obj2[5.462437423415177e+244]; // boolean +>obj2 : Symbol(obj2, Decl(octalIntegerLiteralES6.ts, 13, 3)) +>5.462437423415177e+244 : Symbol(0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777, Decl(octalIntegerLiteralES6.ts, 17, 9)) + +obj2["5.462437423415177e+244"]; // boolean +>obj2 : Symbol(obj2, Decl(octalIntegerLiteralES6.ts, 13, 3)) +>"5.462437423415177e+244" : Symbol(0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777, Decl(octalIntegerLiteralES6.ts, 17, 9)) + +obj2["Infinity"]; // any +>obj2 : Symbol(obj2, Decl(octalIntegerLiteralES6.ts, 13, 3)) + diff --git a/tests/baselines/reference/octalIntegerLiteralES6.types b/tests/baselines/reference/octalIntegerLiteralES6.types index e0a64f160c3..7ef32b49289 100644 --- a/tests/baselines/reference/octalIntegerLiteralES6.types +++ b/tests/baselines/reference/octalIntegerLiteralES6.types @@ -1,23 +1,30 @@ === tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteralES6.ts === var oct1 = 0o45436; >oct1 : number +>0o45436 : number var oct2 = 0O45436; >oct2 : number +>0O45436 : number var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777; >oct3 : number +>0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 : number var oct4 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777; >oct4 : number +>0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 : number var obj1 = { >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } >{ 0o45436: "Hello", a: 0o45436, b: oct1, oct1, 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true} : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } 0o45436: "Hello", +>"Hello" : string + a: 0o45436, >a : number +>0o45436 : number b: oct1, >b : number @@ -27,6 +34,7 @@ var obj1 = { >oct1 : number 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true +>true : boolean } var obj2 = { @@ -34,8 +42,11 @@ var obj2 = { >{ 0O45436: "hi", a: 0O45436, b: oct2, oct2, 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false,} : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } 0O45436: "hi", +>"hi" : string + a: 0O45436, >a : number +>0O45436 : number b: oct2, >b : number @@ -45,77 +56,96 @@ var obj2 = { >oct2 : number 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false, +>false : boolean } obj1[0o45436]; // string >obj1[0o45436] : string >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>0o45436 : number obj1["0o45436"]; // any >obj1["0o45436"] : any >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"0o45436" : string obj1["19230"]; // string >obj1["19230"] : string >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"19230" : string obj1[19230]; // string >obj1[19230] : string >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>19230 : number obj1["a"]; // number >obj1["a"] : number >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"a" : string obj1["b"]; // number >obj1["b"] : number >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"b" : string obj1["oct1"]; // number >obj1["oct1"] : number >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"oct1" : string obj1["Infinity"]; // boolean >obj1["Infinity"] : boolean >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"Infinity" : string obj2[0O45436]; // string >obj2[0O45436] : string >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>0O45436 : number obj2["0O45436"]; // any >obj2["0O45436"] : any >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"0O45436" : string obj2["19230"]; // string >obj2["19230"] : string >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"19230" : string obj2[19230]; // string >obj2[19230] : string >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>19230 : number obj2["a"]; // number >obj2["a"] : number >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"a" : string obj2["b"]; // number >obj2["b"] : number >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"b" : string obj2["oct2"]; // number >obj2["oct2"] : number >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"oct2" : string obj2[5.462437423415177e+244]; // boolean >obj2[5.462437423415177e+244] : boolean >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>5.462437423415177e+244 : number obj2["5.462437423415177e+244"]; // boolean >obj2["5.462437423415177e+244"] : boolean >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"5.462437423415177e+244" : string obj2["Infinity"]; // any >obj2["Infinity"] : any >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"Infinity" : string diff --git a/tests/baselines/reference/optionalAccessorsInInterface1.symbols b/tests/baselines/reference/optionalAccessorsInInterface1.symbols new file mode 100644 index 00000000000..6c9c8ab1429 --- /dev/null +++ b/tests/baselines/reference/optionalAccessorsInInterface1.symbols @@ -0,0 +1,45 @@ +=== tests/cases/compiler/optionalAccessorsInInterface1.ts === +interface MyPropertyDescriptor { +>MyPropertyDescriptor : Symbol(MyPropertyDescriptor, Decl(optionalAccessorsInInterface1.ts, 0, 0)) + + get? (): any; +>get : Symbol(get, Decl(optionalAccessorsInInterface1.ts, 0, 32)) + + set? (v: any): void; +>set : Symbol(set, Decl(optionalAccessorsInInterface1.ts, 1, 17)) +>v : Symbol(v, Decl(optionalAccessorsInInterface1.ts, 2, 10)) +} + +declare function defineMyProperty(o: any, p: string, attributes: MyPropertyDescriptor): any; +>defineMyProperty : Symbol(defineMyProperty, Decl(optionalAccessorsInInterface1.ts, 3, 1)) +>o : Symbol(o, Decl(optionalAccessorsInInterface1.ts, 5, 34)) +>p : Symbol(p, Decl(optionalAccessorsInInterface1.ts, 5, 41)) +>attributes : Symbol(attributes, Decl(optionalAccessorsInInterface1.ts, 5, 52)) +>MyPropertyDescriptor : Symbol(MyPropertyDescriptor, Decl(optionalAccessorsInInterface1.ts, 0, 0)) + +defineMyProperty({}, "name", { get: function () { return 5; } }); +>defineMyProperty : Symbol(defineMyProperty, Decl(optionalAccessorsInInterface1.ts, 3, 1)) +>get : Symbol(get, Decl(optionalAccessorsInInterface1.ts, 6, 30)) + +interface MyPropertyDescriptor2 { +>MyPropertyDescriptor2 : Symbol(MyPropertyDescriptor2, Decl(optionalAccessorsInInterface1.ts, 6, 65)) + + get?: () => any; +>get : Symbol(get, Decl(optionalAccessorsInInterface1.ts, 8, 33)) + + set?: (v: any) => void; +>set : Symbol(set, Decl(optionalAccessorsInInterface1.ts, 9, 20)) +>v : Symbol(v, Decl(optionalAccessorsInInterface1.ts, 10, 11)) +} + +declare function defineMyProperty2(o: any, p: string, attributes: MyPropertyDescriptor2): any; +>defineMyProperty2 : Symbol(defineMyProperty2, Decl(optionalAccessorsInInterface1.ts, 11, 1)) +>o : Symbol(o, Decl(optionalAccessorsInInterface1.ts, 13, 35)) +>p : Symbol(p, Decl(optionalAccessorsInInterface1.ts, 13, 42)) +>attributes : Symbol(attributes, Decl(optionalAccessorsInInterface1.ts, 13, 53)) +>MyPropertyDescriptor2 : Symbol(MyPropertyDescriptor2, Decl(optionalAccessorsInInterface1.ts, 6, 65)) + +defineMyProperty2({}, "name", { get: function () { return 5; } }); +>defineMyProperty2 : Symbol(defineMyProperty2, Decl(optionalAccessorsInInterface1.ts, 11, 1)) +>get : Symbol(get, Decl(optionalAccessorsInInterface1.ts, 14, 31)) + diff --git a/tests/baselines/reference/optionalAccessorsInInterface1.types b/tests/baselines/reference/optionalAccessorsInInterface1.types index c426cdba178..d030849e554 100644 --- a/tests/baselines/reference/optionalAccessorsInInterface1.types +++ b/tests/baselines/reference/optionalAccessorsInInterface1.types @@ -21,9 +21,11 @@ defineMyProperty({}, "name", { get: function () { return 5; } }); >defineMyProperty({}, "name", { get: function () { return 5; } }) : any >defineMyProperty : (o: any, p: string, attributes: MyPropertyDescriptor) => any >{} : {} +>"name" : string >{ get: function () { return 5; } } : { get: () => number; } >get : () => number >function () { return 5; } : () => number +>5 : number interface MyPropertyDescriptor2 { >MyPropertyDescriptor2 : MyPropertyDescriptor2 @@ -47,7 +49,9 @@ defineMyProperty2({}, "name", { get: function () { return 5; } }); >defineMyProperty2({}, "name", { get: function () { return 5; } }) : any >defineMyProperty2 : (o: any, p: string, attributes: MyPropertyDescriptor2) => any >{} : {} +>"name" : string >{ get: function () { return 5; } } : { get: () => number; } >get : () => number >function () { return 5; } : () => number +>5 : number diff --git a/tests/baselines/reference/optionalConstructorArgInSuper.symbols b/tests/baselines/reference/optionalConstructorArgInSuper.symbols new file mode 100644 index 00000000000..a912d8f62e3 --- /dev/null +++ b/tests/baselines/reference/optionalConstructorArgInSuper.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/optionalConstructorArgInSuper.ts === +class Base { +>Base : Symbol(Base, Decl(optionalConstructorArgInSuper.ts, 0, 0)) + + constructor(opt?) { } +>opt : Symbol(opt, Decl(optionalConstructorArgInSuper.ts, 1, 16)) + + foo(other?) { } +>foo : Symbol(foo, Decl(optionalConstructorArgInSuper.ts, 1, 25)) +>other : Symbol(other, Decl(optionalConstructorArgInSuper.ts, 2, 8)) +} +class Derived extends Base { +>Derived : Symbol(Derived, Decl(optionalConstructorArgInSuper.ts, 3, 1)) +>Base : Symbol(Base, Decl(optionalConstructorArgInSuper.ts, 0, 0)) +} +var d = new Derived(); // bug caused an error here, couldn't select overload +>d : Symbol(d, Decl(optionalConstructorArgInSuper.ts, 6, 3)) +>Derived : Symbol(Derived, Decl(optionalConstructorArgInSuper.ts, 3, 1)) + +var d2: Derived; +>d2 : Symbol(d2, Decl(optionalConstructorArgInSuper.ts, 7, 3)) +>Derived : Symbol(Derived, Decl(optionalConstructorArgInSuper.ts, 3, 1)) + +d2.foo(); +>d2.foo : Symbol(Base.foo, Decl(optionalConstructorArgInSuper.ts, 1, 25)) +>d2 : Symbol(d2, Decl(optionalConstructorArgInSuper.ts, 7, 3)) +>foo : Symbol(Base.foo, Decl(optionalConstructorArgInSuper.ts, 1, 25)) + diff --git a/tests/baselines/reference/optionalParamInOverride.symbols b/tests/baselines/reference/optionalParamInOverride.symbols new file mode 100644 index 00000000000..b15802b7294 --- /dev/null +++ b/tests/baselines/reference/optionalParamInOverride.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/optionalParamInOverride.ts === +class Z { +>Z : Symbol(Z, Decl(optionalParamInOverride.ts, 0, 0)) + + public func(): void { } +>func : Symbol(func, Decl(optionalParamInOverride.ts, 0, 9)) +} +class Y extends Z { +>Y : Symbol(Y, Decl(optionalParamInOverride.ts, 2, 1)) +>Z : Symbol(Z, Decl(optionalParamInOverride.ts, 0, 0)) + + public func(value?: any): void { } +>func : Symbol(func, Decl(optionalParamInOverride.ts, 3, 19)) +>value : Symbol(value, Decl(optionalParamInOverride.ts, 4, 16)) +} + diff --git a/tests/baselines/reference/optionalParamReferencingOtherParams1.symbols b/tests/baselines/reference/optionalParamReferencingOtherParams1.symbols new file mode 100644 index 00000000000..d6bb0955642 --- /dev/null +++ b/tests/baselines/reference/optionalParamReferencingOtherParams1.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/optionalParamReferencingOtherParams1.ts === +function strange(x: number, y = x * 1, z = x + y) { +>strange : Symbol(strange, Decl(optionalParamReferencingOtherParams1.ts, 0, 0)) +>x : Symbol(x, Decl(optionalParamReferencingOtherParams1.ts, 0, 17)) +>y : Symbol(y, Decl(optionalParamReferencingOtherParams1.ts, 0, 27)) +>x : Symbol(x, Decl(optionalParamReferencingOtherParams1.ts, 0, 17)) +>z : Symbol(z, Decl(optionalParamReferencingOtherParams1.ts, 0, 38)) +>x : Symbol(x, Decl(optionalParamReferencingOtherParams1.ts, 0, 17)) +>y : Symbol(y, Decl(optionalParamReferencingOtherParams1.ts, 0, 27)) + + return z; +>z : Symbol(z, Decl(optionalParamReferencingOtherParams1.ts, 0, 38)) +} diff --git a/tests/baselines/reference/optionalParamReferencingOtherParams1.types b/tests/baselines/reference/optionalParamReferencingOtherParams1.types index 3a62d51759c..5a8963b8b33 100644 --- a/tests/baselines/reference/optionalParamReferencingOtherParams1.types +++ b/tests/baselines/reference/optionalParamReferencingOtherParams1.types @@ -5,6 +5,7 @@ function strange(x: number, y = x * 1, z = x + y) { >y : number >x * 1 : number >x : number +>1 : number >z : number >x + y : number >x : number diff --git a/tests/baselines/reference/out-flag.symbols b/tests/baselines/reference/out-flag.symbols new file mode 100644 index 00000000000..8f7e559b8fa --- /dev/null +++ b/tests/baselines/reference/out-flag.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/out-flag.ts === +//// @out: bin\ + +// my class comments +class MyClass +>MyClass : Symbol(MyClass, Decl(out-flag.ts, 0, 0)) +{ + // my function comments + public Count(): number +>Count : Symbol(Count, Decl(out-flag.ts, 4, 1)) + { + return 42; + } + + public SetCount(value: number) +>SetCount : Symbol(SetCount, Decl(out-flag.ts, 9, 5)) +>value : Symbol(value, Decl(out-flag.ts, 11, 20)) + { + // + } +} diff --git a/tests/baselines/reference/out-flag.types b/tests/baselines/reference/out-flag.types index ac1b38b4e2e..b182e4e53d9 100644 --- a/tests/baselines/reference/out-flag.types +++ b/tests/baselines/reference/out-flag.types @@ -10,6 +10,7 @@ class MyClass >Count : () => number { return 42; +>42 : number } public SetCount(value: number) diff --git a/tests/baselines/reference/overload2.symbols b/tests/baselines/reference/overload2.symbols new file mode 100644 index 00000000000..1352ddb2a86 --- /dev/null +++ b/tests/baselines/reference/overload2.symbols @@ -0,0 +1,42 @@ +=== tests/cases/compiler/overload2.ts === +enum A { } +>A : Symbol(A, Decl(overload2.ts, 0, 0)) + +enum B { } +>B : Symbol(B, Decl(overload2.ts, 0, 10)) + +function foo(a: A); +>foo : Symbol(foo, Decl(overload2.ts, 1, 10), Decl(overload2.ts, 3, 19), Decl(overload2.ts, 4, 19)) +>a : Symbol(a, Decl(overload2.ts, 3, 13)) +>A : Symbol(A, Decl(overload2.ts, 0, 0)) + +function foo(b: B); +>foo : Symbol(foo, Decl(overload2.ts, 1, 10), Decl(overload2.ts, 3, 19), Decl(overload2.ts, 4, 19)) +>b : Symbol(b, Decl(overload2.ts, 4, 13)) +>B : Symbol(B, Decl(overload2.ts, 0, 10)) + +// should be ok +function foo(x: number) { +>foo : Symbol(foo, Decl(overload2.ts, 1, 10), Decl(overload2.ts, 3, 19), Decl(overload2.ts, 4, 19)) +>x : Symbol(x, Decl(overload2.ts, 6, 13)) +} + +class C { } +>C : Symbol(C, Decl(overload2.ts, 7, 1)) + +function foo1(a: A); +>foo1 : Symbol(foo1, Decl(overload2.ts, 9, 11), Decl(overload2.ts, 10, 20), Decl(overload2.ts, 11, 20)) +>a : Symbol(a, Decl(overload2.ts, 10, 14)) +>A : Symbol(A, Decl(overload2.ts, 0, 0)) + +function foo1(c: C); +>foo1 : Symbol(foo1, Decl(overload2.ts, 9, 11), Decl(overload2.ts, 10, 20), Decl(overload2.ts, 11, 20)) +>c : Symbol(c, Decl(overload2.ts, 11, 14)) +>C : Symbol(C, Decl(overload2.ts, 7, 1)) + +// should be ok +function foo1(x: number) { +>foo1 : Symbol(foo1, Decl(overload2.ts, 9, 11), Decl(overload2.ts, 10, 20), Decl(overload2.ts, 11, 20)) +>x : Symbol(x, Decl(overload2.ts, 13, 14)) +} + diff --git a/tests/baselines/reference/overloadBindingAcrossDeclarationBoundaries.symbols b/tests/baselines/reference/overloadBindingAcrossDeclarationBoundaries.symbols new file mode 100644 index 00000000000..65f64fa8915 --- /dev/null +++ b/tests/baselines/reference/overloadBindingAcrossDeclarationBoundaries.symbols @@ -0,0 +1,115 @@ +=== tests/cases/compiler/overloadBindingAcrossDeclarationBoundaries.ts === +interface Opt1 { +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 0, 0)) + + p?: any; +>p : Symbol(p, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 0, 16)) +} +interface Opt2 { +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 2, 1)) + + q?: any; +>q : Symbol(q, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 3, 16)) +} +interface Opt3 { +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 5, 1)) + + r?: any; +>r : Symbol(r, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 6, 16)) +} +interface Opt4 { +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 8, 1)) + + s?: any; +>s : Symbol(s, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 9, 16)) +} +interface A { +>A : Symbol(A, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 11, 1), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 19, 1)) + + a(o: Opt1): Opt1; +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 12, 13), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 13, 21), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 20, 13), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 21, 21)) +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 13, 6)) +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 0, 0)) +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 0, 0)) + + a(o: Opt2): Opt2; +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 12, 13), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 13, 21), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 20, 13), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 21, 21)) +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 14, 6)) +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 2, 1)) +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 2, 1)) + + (o: Opt1): Opt1; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 15, 5)) +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 0, 0)) +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 0, 0)) + + (o: Opt2): Opt2; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 16, 5)) +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 2, 1)) +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 2, 1)) + + new (o: Opt1): Opt1; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 17, 9)) +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 0, 0)) +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 0, 0)) + + new (o: Opt2): Opt2; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 18, 9)) +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 2, 1)) +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 2, 1)) +} +interface A { +>A : Symbol(A, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 11, 1), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 19, 1)) + + a(o: Opt3): Opt3; +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 12, 13), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 13, 21), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 20, 13), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 21, 21)) +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 21, 6)) +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 5, 1)) +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 5, 1)) + + a(o: Opt4): Opt4; +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 12, 13), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 13, 21), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 20, 13), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 21, 21)) +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 22, 6)) +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 8, 1)) +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 8, 1)) + + (o: Opt3): Opt3; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 23, 5)) +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 5, 1)) +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 5, 1)) + + (o: Opt4): Opt4; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 24, 5)) +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 8, 1)) +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 8, 1)) + + new (o: Opt3): Opt3; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 25, 9)) +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 5, 1)) +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 5, 1)) + + new (o: Opt4): Opt4; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 26, 9)) +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 8, 1)) +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 8, 1)) +} + +var a: A; +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 29, 3)) +>A : Symbol(A, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 11, 1), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 19, 1)) + +// These should all be Opt3 +var a1 = a.a({}); +>a1 : Symbol(a1, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 31, 3), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 32, 3), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 33, 3)) +>a.a : Symbol(A.a, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 12, 13), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 13, 21), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 20, 13), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 21, 21)) +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 29, 3)) +>a : Symbol(A.a, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 12, 13), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 13, 21), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 20, 13), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 21, 21)) + +var a1 = a({}); +>a1 : Symbol(a1, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 31, 3), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 32, 3), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 33, 3)) +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 29, 3)) + +var a1 = new a({}); +>a1 : Symbol(a1, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 31, 3), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 32, 3), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 33, 3)) +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 29, 3)) + diff --git a/tests/baselines/reference/overloadBindingAcrossDeclarationBoundaries2.symbols b/tests/baselines/reference/overloadBindingAcrossDeclarationBoundaries2.symbols new file mode 100644 index 00000000000..534475bcc30 --- /dev/null +++ b/tests/baselines/reference/overloadBindingAcrossDeclarationBoundaries2.symbols @@ -0,0 +1,118 @@ +=== tests/cases/compiler/overloadBindingAcrossDeclarationBoundaries_file0.ts === +interface Opt1 { +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 0, 0)) + + p?: any; +>p : Symbol(p, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 0, 16)) +} +interface Opt2 { +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 2, 1)) + + q?: any; +>q : Symbol(q, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 3, 16)) +} +interface Opt3 { +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 5, 1)) + + r?: any; +>r : Symbol(r, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 6, 16)) +} +interface Opt4 { +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 8, 1)) + + s?: any; +>s : Symbol(s, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 9, 16)) +} + +interface A { +>A : Symbol(A, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 11, 1), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 0, 0)) + + a(o: Opt1): Opt1; +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 13, 13), Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 14, 21), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 0, 13), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 1, 21)) +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 14, 6)) +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 0, 0)) +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 0, 0)) + + a(o: Opt2): Opt2; +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 13, 13), Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 14, 21), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 0, 13), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 1, 21)) +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 15, 6)) +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 2, 1)) +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 2, 1)) + + (o: Opt1): Opt1; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 16, 5)) +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 0, 0)) +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 0, 0)) + + (o: Opt2): Opt2; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 17, 5)) +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 2, 1)) +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 2, 1)) + + new (o: Opt1): Opt1; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 18, 9)) +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 0, 0)) +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 0, 0)) + + new (o: Opt2): Opt2; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 19, 9)) +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 2, 1)) +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 2, 1)) +} + +=== tests/cases/compiler/overloadBindingAcrossDeclarationBoundaries_file1.ts === +interface A { +>A : Symbol(A, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 11, 1), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 0, 0)) + + a(o: Opt3): Opt3; +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 13, 13), Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 14, 21), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 0, 13), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 1, 21)) +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 1, 6)) +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 5, 1)) +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 5, 1)) + + a(o: Opt4): Opt4; +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 13, 13), Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 14, 21), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 0, 13), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 1, 21)) +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 2, 6)) +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 8, 1)) +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 8, 1)) + + (o: Opt3): Opt3; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 3, 5)) +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 5, 1)) +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 5, 1)) + + (o: Opt4): Opt4; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 4, 5)) +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 8, 1)) +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 8, 1)) + + new (o: Opt3): Opt3; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 5, 9)) +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 5, 1)) +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 5, 1)) + + new (o: Opt4): Opt4; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 6, 9)) +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 8, 1)) +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 8, 1)) +} + +var a: A; +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 9, 3)) +>A : Symbol(A, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 11, 1), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 0, 0)) + +// These should all be Opt3 +var a1 = a.a({}); +>a1 : Symbol(a1, Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 11, 3), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 12, 3), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 13, 3)) +>a.a : Symbol(A.a, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 13, 13), Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 14, 21), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 0, 13), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 1, 21)) +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 9, 3)) +>a : Symbol(A.a, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 13, 13), Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 14, 21), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 0, 13), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 1, 21)) + +var a1 = a({}); +>a1 : Symbol(a1, Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 11, 3), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 12, 3), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 13, 3)) +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 9, 3)) + +var a1 = new a({}); +>a1 : Symbol(a1, Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 11, 3), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 12, 3), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 13, 3)) +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 9, 3)) + diff --git a/tests/baselines/reference/overloadCallTest.symbols b/tests/baselines/reference/overloadCallTest.symbols new file mode 100644 index 00000000000..ae051e79855 --- /dev/null +++ b/tests/baselines/reference/overloadCallTest.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/overloadCallTest.ts === +class foo { +>foo : Symbol(foo, Decl(overloadCallTest.ts, 0, 0)) + + constructor() { + function bar(): string; +>bar : Symbol(bar, Decl(overloadCallTest.ts, 1, 19), Decl(overloadCallTest.ts, 2, 31), Decl(overloadCallTest.ts, 3, 31)) + + function bar(s:string); +>bar : Symbol(bar, Decl(overloadCallTest.ts, 1, 19), Decl(overloadCallTest.ts, 2, 31), Decl(overloadCallTest.ts, 3, 31)) +>s : Symbol(s, Decl(overloadCallTest.ts, 3, 21)) + + function bar(foo?: string) { return "foo" }; +>bar : Symbol(bar, Decl(overloadCallTest.ts, 1, 19), Decl(overloadCallTest.ts, 2, 31), Decl(overloadCallTest.ts, 3, 31)) +>foo : Symbol(foo, Decl(overloadCallTest.ts, 4, 21)) + + var test = bar("test"); +>test : Symbol(test, Decl(overloadCallTest.ts, 6, 11)) +>bar : Symbol(bar, Decl(overloadCallTest.ts, 1, 19), Decl(overloadCallTest.ts, 2, 31), Decl(overloadCallTest.ts, 3, 31)) + + var goo = bar(); +>goo : Symbol(goo, Decl(overloadCallTest.ts, 7, 11)) +>bar : Symbol(bar, Decl(overloadCallTest.ts, 1, 19), Decl(overloadCallTest.ts, 2, 31), Decl(overloadCallTest.ts, 3, 31)) + + goo = bar("test"); +>goo : Symbol(goo, Decl(overloadCallTest.ts, 7, 11)) +>bar : Symbol(bar, Decl(overloadCallTest.ts, 1, 19), Decl(overloadCallTest.ts, 2, 31), Decl(overloadCallTest.ts, 3, 31)) + } + +} + + diff --git a/tests/baselines/reference/overloadCallTest.types b/tests/baselines/reference/overloadCallTest.types index 0ed7ecccdbc..bd719311975 100644 --- a/tests/baselines/reference/overloadCallTest.types +++ b/tests/baselines/reference/overloadCallTest.types @@ -13,11 +13,13 @@ class foo { function bar(foo?: string) { return "foo" }; >bar : { (): string; (s: string): any; } >foo : string +>"foo" : string var test = bar("test"); >test : any >bar("test") : any >bar : { (): string; (s: string): any; } +>"test" : string var goo = bar(); >goo : string @@ -29,6 +31,7 @@ class foo { >goo : string >bar("test") : any >bar : { (): string; (s: string): any; } +>"test" : string } } diff --git a/tests/baselines/reference/overloadCrash.symbols b/tests/baselines/reference/overloadCrash.symbols new file mode 100644 index 00000000000..791411540b3 --- /dev/null +++ b/tests/baselines/reference/overloadCrash.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/overloadCrash.ts === +interface I1 {a:number; b:number;}; +>I1 : Symbol(I1, Decl(overloadCrash.ts, 0, 0)) +>a : Symbol(a, Decl(overloadCrash.ts, 0, 14)) +>b : Symbol(b, Decl(overloadCrash.ts, 0, 23)) + +interface I2 {c:number; d:number;}; +>I2 : Symbol(I2, Decl(overloadCrash.ts, 0, 35)) +>c : Symbol(c, Decl(overloadCrash.ts, 1, 14)) +>d : Symbol(d, Decl(overloadCrash.ts, 1, 23)) + +interface I3 {a:number; b:number; c:number; d:number;}; +>I3 : Symbol(I3, Decl(overloadCrash.ts, 1, 35)) +>a : Symbol(a, Decl(overloadCrash.ts, 2, 14)) +>b : Symbol(b, Decl(overloadCrash.ts, 2, 23)) +>c : Symbol(c, Decl(overloadCrash.ts, 2, 33)) +>d : Symbol(d, Decl(overloadCrash.ts, 2, 43)) + +declare function foo(...n:I1[]); +>foo : Symbol(foo, Decl(overloadCrash.ts, 2, 55), Decl(overloadCrash.ts, 4, 32)) +>n : Symbol(n, Decl(overloadCrash.ts, 4, 21)) +>I1 : Symbol(I1, Decl(overloadCrash.ts, 0, 0)) + +declare function foo(n1:I2, n3:I2); +>foo : Symbol(foo, Decl(overloadCrash.ts, 2, 55), Decl(overloadCrash.ts, 4, 32)) +>n1 : Symbol(n1, Decl(overloadCrash.ts, 5, 21)) +>I2 : Symbol(I2, Decl(overloadCrash.ts, 0, 35)) +>n3 : Symbol(n3, Decl(overloadCrash.ts, 5, 27)) +>I2 : Symbol(I2, Decl(overloadCrash.ts, 0, 35)) + +var i3:I3; +>i3 : Symbol(i3, Decl(overloadCrash.ts, 7, 3)) +>I3 : Symbol(I3, Decl(overloadCrash.ts, 1, 35)) + +foo(i3, i3); // should not crash the compiler :) +>foo : Symbol(foo, Decl(overloadCrash.ts, 2, 55), Decl(overloadCrash.ts, 4, 32)) +>i3 : Symbol(i3, Decl(overloadCrash.ts, 7, 3)) +>i3 : Symbol(i3, Decl(overloadCrash.ts, 7, 3)) + diff --git a/tests/baselines/reference/overloadEquivalenceWithStatics.symbols b/tests/baselines/reference/overloadEquivalenceWithStatics.symbols new file mode 100644 index 00000000000..dc2e5a717a6 --- /dev/null +++ b/tests/baselines/reference/overloadEquivalenceWithStatics.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/overloadEquivalenceWithStatics.ts === +class A1 { +>A1 : Symbol(A1, Decl(overloadEquivalenceWithStatics.ts, 0, 0)) +>T : Symbol(T, Decl(overloadEquivalenceWithStatics.ts, 0, 9)) + +static B(v: A1): A1; // 1 +>B : Symbol(A1.B, Decl(overloadEquivalenceWithStatics.ts, 0, 13), Decl(overloadEquivalenceWithStatics.ts, 1, 29), Decl(overloadEquivalenceWithStatics.ts, 2, 25)) +>S : Symbol(S, Decl(overloadEquivalenceWithStatics.ts, 1, 9)) +>v : Symbol(v, Decl(overloadEquivalenceWithStatics.ts, 1, 12)) +>A1 : Symbol(A1, Decl(overloadEquivalenceWithStatics.ts, 0, 0)) +>S : Symbol(S, Decl(overloadEquivalenceWithStatics.ts, 1, 9)) +>A1 : Symbol(A1, Decl(overloadEquivalenceWithStatics.ts, 0, 0)) +>S : Symbol(S, Decl(overloadEquivalenceWithStatics.ts, 1, 9)) + +static B(v: S): A1; // 2 : Error Duplicate signature +>B : Symbol(A1.B, Decl(overloadEquivalenceWithStatics.ts, 0, 13), Decl(overloadEquivalenceWithStatics.ts, 1, 29), Decl(overloadEquivalenceWithStatics.ts, 2, 25)) +>S : Symbol(S, Decl(overloadEquivalenceWithStatics.ts, 2, 9)) +>v : Symbol(v, Decl(overloadEquivalenceWithStatics.ts, 2, 12)) +>S : Symbol(S, Decl(overloadEquivalenceWithStatics.ts, 2, 9)) +>A1 : Symbol(A1, Decl(overloadEquivalenceWithStatics.ts, 0, 0)) +>S : Symbol(S, Decl(overloadEquivalenceWithStatics.ts, 2, 9)) + +static B(v: any): A1 { +>B : Symbol(A1.B, Decl(overloadEquivalenceWithStatics.ts, 0, 13), Decl(overloadEquivalenceWithStatics.ts, 1, 29), Decl(overloadEquivalenceWithStatics.ts, 2, 25)) +>S : Symbol(S, Decl(overloadEquivalenceWithStatics.ts, 3, 9)) +>v : Symbol(v, Decl(overloadEquivalenceWithStatics.ts, 3, 12)) +>A1 : Symbol(A1, Decl(overloadEquivalenceWithStatics.ts, 0, 0)) +>S : Symbol(S, Decl(overloadEquivalenceWithStatics.ts, 3, 9)) + +return null; +} +} + diff --git a/tests/baselines/reference/overloadEquivalenceWithStatics.types b/tests/baselines/reference/overloadEquivalenceWithStatics.types index 96ad16ae19c..1f59b64572a 100644 --- a/tests/baselines/reference/overloadEquivalenceWithStatics.types +++ b/tests/baselines/reference/overloadEquivalenceWithStatics.types @@ -28,6 +28,7 @@ static B(v: any): A1 { >S : S return null; +>null : null } } diff --git a/tests/baselines/reference/overloadGenericFunctionWithRestArgs.symbols b/tests/baselines/reference/overloadGenericFunctionWithRestArgs.symbols new file mode 100644 index 00000000000..52ee82e5d3c --- /dev/null +++ b/tests/baselines/reference/overloadGenericFunctionWithRestArgs.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/overloadGenericFunctionWithRestArgs.ts === +class B{ +>B : Symbol(B, Decl(overloadGenericFunctionWithRestArgs.ts, 0, 0)) +>V : Symbol(V, Decl(overloadGenericFunctionWithRestArgs.ts, 0, 8)) + + private id: V; +>id : Symbol(id, Decl(overloadGenericFunctionWithRestArgs.ts, 0, 11)) +>V : Symbol(V, Decl(overloadGenericFunctionWithRestArgs.ts, 0, 8)) +} +class A{ +>A : Symbol(A, Decl(overloadGenericFunctionWithRestArgs.ts, 2, 1)) +>U : Symbol(U, Decl(overloadGenericFunctionWithRestArgs.ts, 3, 8)) + + GetEnumerator: () => B; +>GetEnumerator : Symbol(GetEnumerator, Decl(overloadGenericFunctionWithRestArgs.ts, 3, 11)) +>B : Symbol(B, Decl(overloadGenericFunctionWithRestArgs.ts, 0, 0)) +>U : Symbol(U, Decl(overloadGenericFunctionWithRestArgs.ts, 3, 8)) +} +function Choice(...v_args: T[]): A; +>Choice : Symbol(Choice, Decl(overloadGenericFunctionWithRestArgs.ts, 5, 1), Decl(overloadGenericFunctionWithRestArgs.ts, 6, 41)) +>T : Symbol(T, Decl(overloadGenericFunctionWithRestArgs.ts, 6, 16)) +>v_args : Symbol(v_args, Decl(overloadGenericFunctionWithRestArgs.ts, 6, 19)) +>T : Symbol(T, Decl(overloadGenericFunctionWithRestArgs.ts, 6, 16)) +>A : Symbol(A, Decl(overloadGenericFunctionWithRestArgs.ts, 2, 1)) +>T : Symbol(T, Decl(overloadGenericFunctionWithRestArgs.ts, 6, 16)) + +function Choice(...v_args: T[]): A { +>Choice : Symbol(Choice, Decl(overloadGenericFunctionWithRestArgs.ts, 5, 1), Decl(overloadGenericFunctionWithRestArgs.ts, 6, 41)) +>T : Symbol(T, Decl(overloadGenericFunctionWithRestArgs.ts, 7, 16)) +>v_args : Symbol(v_args, Decl(overloadGenericFunctionWithRestArgs.ts, 7, 19)) +>T : Symbol(T, Decl(overloadGenericFunctionWithRestArgs.ts, 7, 16)) +>A : Symbol(A, Decl(overloadGenericFunctionWithRestArgs.ts, 2, 1)) +>T : Symbol(T, Decl(overloadGenericFunctionWithRestArgs.ts, 7, 16)) + + return new A(); +>A : Symbol(A, Decl(overloadGenericFunctionWithRestArgs.ts, 2, 1)) +>T : Symbol(T, Decl(overloadGenericFunctionWithRestArgs.ts, 7, 16)) +} diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks1.symbols b/tests/baselines/reference/overloadOnConstConstraintChecks1.symbols new file mode 100644 index 00000000000..2eedf3254a2 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstConstraintChecks1.symbols @@ -0,0 +1,78 @@ +=== tests/cases/compiler/overloadOnConstConstraintChecks1.ts === +class Base { foo() { } } +>Base : Symbol(Base, Decl(overloadOnConstConstraintChecks1.ts, 0, 0)) +>foo : Symbol(foo, Decl(overloadOnConstConstraintChecks1.ts, 0, 12)) + +class Derived1 extends Base { bar() { } } +>Derived1 : Symbol(Derived1, Decl(overloadOnConstConstraintChecks1.ts, 0, 24)) +>Base : Symbol(Base, Decl(overloadOnConstConstraintChecks1.ts, 0, 0)) +>bar : Symbol(bar, Decl(overloadOnConstConstraintChecks1.ts, 1, 29)) + +class Derived2 extends Base { baz() { } } +>Derived2 : Symbol(Derived2, Decl(overloadOnConstConstraintChecks1.ts, 1, 41)) +>Base : Symbol(Base, Decl(overloadOnConstConstraintChecks1.ts, 0, 0)) +>baz : Symbol(baz, Decl(overloadOnConstConstraintChecks1.ts, 2, 29)) + +class Derived3 extends Base { biz() { } } +>Derived3 : Symbol(Derived3, Decl(overloadOnConstConstraintChecks1.ts, 2, 41)) +>Base : Symbol(Base, Decl(overloadOnConstConstraintChecks1.ts, 0, 0)) +>biz : Symbol(biz, Decl(overloadOnConstConstraintChecks1.ts, 3, 29)) + +interface MyDoc { // Document +>MyDoc : Symbol(MyDoc, Decl(overloadOnConstConstraintChecks1.ts, 3, 41)) + + createElement(tagName: string): Base; +>createElement : Symbol(createElement, Decl(overloadOnConstConstraintChecks1.ts, 5, 17), Decl(overloadOnConstConstraintChecks1.ts, 6, 41), Decl(overloadOnConstConstraintChecks1.ts, 7, 47), Decl(overloadOnConstConstraintChecks1.ts, 8, 44)) +>tagName : Symbol(tagName, Decl(overloadOnConstConstraintChecks1.ts, 6, 18)) +>Base : Symbol(Base, Decl(overloadOnConstConstraintChecks1.ts, 0, 0)) + + createElement(tagName: 'canvas'): Derived1; +>createElement : Symbol(createElement, Decl(overloadOnConstConstraintChecks1.ts, 5, 17), Decl(overloadOnConstConstraintChecks1.ts, 6, 41), Decl(overloadOnConstConstraintChecks1.ts, 7, 47), Decl(overloadOnConstConstraintChecks1.ts, 8, 44)) +>tagName : Symbol(tagName, Decl(overloadOnConstConstraintChecks1.ts, 7, 18)) +>Derived1 : Symbol(Derived1, Decl(overloadOnConstConstraintChecks1.ts, 0, 24)) + + createElement(tagName: 'div'): Derived2; +>createElement : Symbol(createElement, Decl(overloadOnConstConstraintChecks1.ts, 5, 17), Decl(overloadOnConstConstraintChecks1.ts, 6, 41), Decl(overloadOnConstConstraintChecks1.ts, 7, 47), Decl(overloadOnConstConstraintChecks1.ts, 8, 44)) +>tagName : Symbol(tagName, Decl(overloadOnConstConstraintChecks1.ts, 8, 18)) +>Derived2 : Symbol(Derived2, Decl(overloadOnConstConstraintChecks1.ts, 1, 41)) + + createElement(tagName: 'span'): Derived3; +>createElement : Symbol(createElement, Decl(overloadOnConstConstraintChecks1.ts, 5, 17), Decl(overloadOnConstConstraintChecks1.ts, 6, 41), Decl(overloadOnConstConstraintChecks1.ts, 7, 47), Decl(overloadOnConstConstraintChecks1.ts, 8, 44)) +>tagName : Symbol(tagName, Decl(overloadOnConstConstraintChecks1.ts, 9, 18)) +>Derived3 : Symbol(Derived3, Decl(overloadOnConstConstraintChecks1.ts, 2, 41)) + + // + 100 more +} + +class D implements MyDoc { +>D : Symbol(D, Decl(overloadOnConstConstraintChecks1.ts, 11, 1)) +>MyDoc : Symbol(MyDoc, Decl(overloadOnConstConstraintChecks1.ts, 3, 41)) + + createElement(tagName:string): Base; +>createElement : Symbol(createElement, Decl(overloadOnConstConstraintChecks1.ts, 13, 26), Decl(overloadOnConstConstraintChecks1.ts, 14, 40), Decl(overloadOnConstConstraintChecks1.ts, 15, 47), Decl(overloadOnConstConstraintChecks1.ts, 16, 44), Decl(overloadOnConstConstraintChecks1.ts, 17, 45)) +>tagName : Symbol(tagName, Decl(overloadOnConstConstraintChecks1.ts, 14, 18)) +>Base : Symbol(Base, Decl(overloadOnConstConstraintChecks1.ts, 0, 0)) + + createElement(tagName: 'canvas'): Derived1; +>createElement : Symbol(createElement, Decl(overloadOnConstConstraintChecks1.ts, 13, 26), Decl(overloadOnConstConstraintChecks1.ts, 14, 40), Decl(overloadOnConstConstraintChecks1.ts, 15, 47), Decl(overloadOnConstConstraintChecks1.ts, 16, 44), Decl(overloadOnConstConstraintChecks1.ts, 17, 45)) +>tagName : Symbol(tagName, Decl(overloadOnConstConstraintChecks1.ts, 15, 18)) +>Derived1 : Symbol(Derived1, Decl(overloadOnConstConstraintChecks1.ts, 0, 24)) + + createElement(tagName: 'div'): Derived2; +>createElement : Symbol(createElement, Decl(overloadOnConstConstraintChecks1.ts, 13, 26), Decl(overloadOnConstConstraintChecks1.ts, 14, 40), Decl(overloadOnConstConstraintChecks1.ts, 15, 47), Decl(overloadOnConstConstraintChecks1.ts, 16, 44), Decl(overloadOnConstConstraintChecks1.ts, 17, 45)) +>tagName : Symbol(tagName, Decl(overloadOnConstConstraintChecks1.ts, 16, 18)) +>Derived2 : Symbol(Derived2, Decl(overloadOnConstConstraintChecks1.ts, 1, 41)) + + createElement(tagName: 'span'): Derived3; +>createElement : Symbol(createElement, Decl(overloadOnConstConstraintChecks1.ts, 13, 26), Decl(overloadOnConstConstraintChecks1.ts, 14, 40), Decl(overloadOnConstConstraintChecks1.ts, 15, 47), Decl(overloadOnConstConstraintChecks1.ts, 16, 44), Decl(overloadOnConstConstraintChecks1.ts, 17, 45)) +>tagName : Symbol(tagName, Decl(overloadOnConstConstraintChecks1.ts, 17, 18)) +>Derived3 : Symbol(Derived3, Decl(overloadOnConstConstraintChecks1.ts, 2, 41)) + + createElement(tagName:any): Base { +>createElement : Symbol(createElement, Decl(overloadOnConstConstraintChecks1.ts, 13, 26), Decl(overloadOnConstConstraintChecks1.ts, 14, 40), Decl(overloadOnConstConstraintChecks1.ts, 15, 47), Decl(overloadOnConstConstraintChecks1.ts, 16, 44), Decl(overloadOnConstConstraintChecks1.ts, 17, 45)) +>tagName : Symbol(tagName, Decl(overloadOnConstConstraintChecks1.ts, 18, 18)) +>Base : Symbol(Base, Decl(overloadOnConstConstraintChecks1.ts, 0, 0)) + + return null; + } +} diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks1.types b/tests/baselines/reference/overloadOnConstConstraintChecks1.types index 9f92e56c682..cc561eb6e21 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks1.types +++ b/tests/baselines/reference/overloadOnConstConstraintChecks1.types @@ -74,5 +74,6 @@ class D implements MyDoc { >Base : Base return null; +>null : null } } diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks2.symbols b/tests/baselines/reference/overloadOnConstConstraintChecks2.symbols new file mode 100644 index 00000000000..0c5bd49b4f3 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstConstraintChecks2.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/overloadOnConstConstraintChecks2.ts === +class A {} +>A : Symbol(A, Decl(overloadOnConstConstraintChecks2.ts, 0, 0)) + +class B extends A {} +>B : Symbol(B, Decl(overloadOnConstConstraintChecks2.ts, 0, 10)) +>A : Symbol(A, Decl(overloadOnConstConstraintChecks2.ts, 0, 0)) + +class C extends A { +>C : Symbol(C, Decl(overloadOnConstConstraintChecks2.ts, 1, 20)) +>A : Symbol(A, Decl(overloadOnConstConstraintChecks2.ts, 0, 0)) + + public foo() { } +>foo : Symbol(foo, Decl(overloadOnConstConstraintChecks2.ts, 2, 19)) +} +function foo(name: 'hi'): B; +>foo : Symbol(foo, Decl(overloadOnConstConstraintChecks2.ts, 4, 1), Decl(overloadOnConstConstraintChecks2.ts, 5, 28), Decl(overloadOnConstConstraintChecks2.ts, 6, 29), Decl(overloadOnConstConstraintChecks2.ts, 7, 30)) +>name : Symbol(name, Decl(overloadOnConstConstraintChecks2.ts, 5, 13)) +>B : Symbol(B, Decl(overloadOnConstConstraintChecks2.ts, 0, 10)) + +function foo(name: 'bye'): C; +>foo : Symbol(foo, Decl(overloadOnConstConstraintChecks2.ts, 4, 1), Decl(overloadOnConstConstraintChecks2.ts, 5, 28), Decl(overloadOnConstConstraintChecks2.ts, 6, 29), Decl(overloadOnConstConstraintChecks2.ts, 7, 30)) +>name : Symbol(name, Decl(overloadOnConstConstraintChecks2.ts, 6, 13)) +>C : Symbol(C, Decl(overloadOnConstConstraintChecks2.ts, 1, 20)) + +function foo(name: string): A; +>foo : Symbol(foo, Decl(overloadOnConstConstraintChecks2.ts, 4, 1), Decl(overloadOnConstConstraintChecks2.ts, 5, 28), Decl(overloadOnConstConstraintChecks2.ts, 6, 29), Decl(overloadOnConstConstraintChecks2.ts, 7, 30)) +>name : Symbol(name, Decl(overloadOnConstConstraintChecks2.ts, 7, 13)) +>A : Symbol(A, Decl(overloadOnConstConstraintChecks2.ts, 0, 0)) + +function foo(name: any): A { +>foo : Symbol(foo, Decl(overloadOnConstConstraintChecks2.ts, 4, 1), Decl(overloadOnConstConstraintChecks2.ts, 5, 28), Decl(overloadOnConstConstraintChecks2.ts, 6, 29), Decl(overloadOnConstConstraintChecks2.ts, 7, 30)) +>name : Symbol(name, Decl(overloadOnConstConstraintChecks2.ts, 8, 13)) +>A : Symbol(A, Decl(overloadOnConstConstraintChecks2.ts, 0, 0)) + + return null; +} diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks2.types b/tests/baselines/reference/overloadOnConstConstraintChecks2.types index c5af206c6da..36fa89dec4a 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks2.types +++ b/tests/baselines/reference/overloadOnConstConstraintChecks2.types @@ -34,4 +34,5 @@ function foo(name: any): A { >A : A return null; +>null : null } diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks3.symbols b/tests/baselines/reference/overloadOnConstConstraintChecks3.symbols new file mode 100644 index 00000000000..5748fd441a5 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstConstraintChecks3.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/overloadOnConstConstraintChecks3.ts === +class A { private x = 1} +>A : Symbol(A, Decl(overloadOnConstConstraintChecks3.ts, 0, 0)) +>x : Symbol(x, Decl(overloadOnConstConstraintChecks3.ts, 0, 9)) + +class B extends A {} +>B : Symbol(B, Decl(overloadOnConstConstraintChecks3.ts, 0, 24)) +>A : Symbol(A, Decl(overloadOnConstConstraintChecks3.ts, 0, 0)) + +class C extends A { +>C : Symbol(C, Decl(overloadOnConstConstraintChecks3.ts, 1, 20)) +>A : Symbol(A, Decl(overloadOnConstConstraintChecks3.ts, 0, 0)) + + public foo() { } +>foo : Symbol(foo, Decl(overloadOnConstConstraintChecks3.ts, 2, 19)) +} +function foo(name: 'hi'): B; +>foo : Symbol(foo, Decl(overloadOnConstConstraintChecks3.ts, 4, 1), Decl(overloadOnConstConstraintChecks3.ts, 5, 28), Decl(overloadOnConstConstraintChecks3.ts, 6, 29), Decl(overloadOnConstConstraintChecks3.ts, 7, 30)) +>name : Symbol(name, Decl(overloadOnConstConstraintChecks3.ts, 5, 13)) +>B : Symbol(B, Decl(overloadOnConstConstraintChecks3.ts, 0, 24)) + +function foo(name: 'bye'): C; +>foo : Symbol(foo, Decl(overloadOnConstConstraintChecks3.ts, 4, 1), Decl(overloadOnConstConstraintChecks3.ts, 5, 28), Decl(overloadOnConstConstraintChecks3.ts, 6, 29), Decl(overloadOnConstConstraintChecks3.ts, 7, 30)) +>name : Symbol(name, Decl(overloadOnConstConstraintChecks3.ts, 6, 13)) +>C : Symbol(C, Decl(overloadOnConstConstraintChecks3.ts, 1, 20)) + +function foo(name: string): A; +>foo : Symbol(foo, Decl(overloadOnConstConstraintChecks3.ts, 4, 1), Decl(overloadOnConstConstraintChecks3.ts, 5, 28), Decl(overloadOnConstConstraintChecks3.ts, 6, 29), Decl(overloadOnConstConstraintChecks3.ts, 7, 30)) +>name : Symbol(name, Decl(overloadOnConstConstraintChecks3.ts, 7, 13)) +>A : Symbol(A, Decl(overloadOnConstConstraintChecks3.ts, 0, 0)) + +function foo(name: any): A { +>foo : Symbol(foo, Decl(overloadOnConstConstraintChecks3.ts, 4, 1), Decl(overloadOnConstConstraintChecks3.ts, 5, 28), Decl(overloadOnConstConstraintChecks3.ts, 6, 29), Decl(overloadOnConstConstraintChecks3.ts, 7, 30)) +>name : Symbol(name, Decl(overloadOnConstConstraintChecks3.ts, 8, 13)) +>A : Symbol(A, Decl(overloadOnConstConstraintChecks3.ts, 0, 0)) + + return null; +} + diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks3.types b/tests/baselines/reference/overloadOnConstConstraintChecks3.types index adc41ff235c..94a03bb7680 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks3.types +++ b/tests/baselines/reference/overloadOnConstConstraintChecks3.types @@ -2,6 +2,7 @@ class A { private x = 1} >A : A >x : number +>1 : number class B extends A {} >B : B @@ -35,5 +36,6 @@ function foo(name: any): A { >A : A return null; +>null : null } diff --git a/tests/baselines/reference/overloadOnConstInheritance1.symbols b/tests/baselines/reference/overloadOnConstInheritance1.symbols new file mode 100644 index 00000000000..c5cc9b52abc --- /dev/null +++ b/tests/baselines/reference/overloadOnConstInheritance1.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/overloadOnConstInheritance1.ts === +interface Base { +>Base : Symbol(Base, Decl(overloadOnConstInheritance1.ts, 0, 0)) + + addEventListener(x: string): any; +>addEventListener : Symbol(addEventListener, Decl(overloadOnConstInheritance1.ts, 0, 16), Decl(overloadOnConstInheritance1.ts, 1, 37)) +>x : Symbol(x, Decl(overloadOnConstInheritance1.ts, 1, 21)) + + addEventListener(x: 'foo'): string; +>addEventListener : Symbol(addEventListener, Decl(overloadOnConstInheritance1.ts, 0, 16), Decl(overloadOnConstInheritance1.ts, 1, 37)) +>x : Symbol(x, Decl(overloadOnConstInheritance1.ts, 2, 21)) +} +interface Deriver extends Base { +>Deriver : Symbol(Deriver, Decl(overloadOnConstInheritance1.ts, 3, 1)) +>Base : Symbol(Base, Decl(overloadOnConstInheritance1.ts, 0, 0)) + + addEventListener(x: string): any; +>addEventListener : Symbol(addEventListener, Decl(overloadOnConstInheritance1.ts, 4, 32), Decl(overloadOnConstInheritance1.ts, 5, 37)) +>x : Symbol(x, Decl(overloadOnConstInheritance1.ts, 5, 21)) + + addEventListener(x: 'bar'): string; +>addEventListener : Symbol(addEventListener, Decl(overloadOnConstInheritance1.ts, 4, 32), Decl(overloadOnConstInheritance1.ts, 5, 37)) +>x : Symbol(x, Decl(overloadOnConstInheritance1.ts, 6, 21)) +} + diff --git a/tests/baselines/reference/overloadOnGenericArity.symbols b/tests/baselines/reference/overloadOnGenericArity.symbols new file mode 100644 index 00000000000..28f3c74fd2b --- /dev/null +++ b/tests/baselines/reference/overloadOnGenericArity.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/overloadOnGenericArity.ts === +interface Test { +>Test : Symbol(Test, Decl(overloadOnGenericArity.ts, 0, 0)) + + then(p: string): string; +>then : Symbol(then, Decl(overloadOnGenericArity.ts, 0, 16), Decl(overloadOnGenericArity.ts, 1, 31)) +>U : Symbol(U, Decl(overloadOnGenericArity.ts, 1, 9)) +>p : Symbol(p, Decl(overloadOnGenericArity.ts, 1, 12)) + + then(p: string): Date; // Error: Overloads cannot differ only by return type +>then : Symbol(then, Decl(overloadOnGenericArity.ts, 0, 16), Decl(overloadOnGenericArity.ts, 1, 31)) +>p : Symbol(p, Decl(overloadOnGenericArity.ts, 2, 9)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +} + + diff --git a/tests/baselines/reference/overloadOnGenericClassAndNonGenericClass.symbols b/tests/baselines/reference/overloadOnGenericClassAndNonGenericClass.symbols new file mode 100644 index 00000000000..8c4b74f89a2 --- /dev/null +++ b/tests/baselines/reference/overloadOnGenericClassAndNonGenericClass.symbols @@ -0,0 +1,59 @@ +=== tests/cases/compiler/overloadOnGenericClassAndNonGenericClass.ts === +class A { a; } +>A : Symbol(A, Decl(overloadOnGenericClassAndNonGenericClass.ts, 0, 0)) +>a : Symbol(a, Decl(overloadOnGenericClassAndNonGenericClass.ts, 0, 9)) + +class B { b; } +>B : Symbol(B, Decl(overloadOnGenericClassAndNonGenericClass.ts, 0, 14)) +>b : Symbol(b, Decl(overloadOnGenericClassAndNonGenericClass.ts, 1, 9)) + +class C { c; } +>C : Symbol(C, Decl(overloadOnGenericClassAndNonGenericClass.ts, 1, 14)) +>c : Symbol(c, Decl(overloadOnGenericClassAndNonGenericClass.ts, 2, 9)) + +class X { x: T; } +>X : Symbol(X, Decl(overloadOnGenericClassAndNonGenericClass.ts, 2, 14)) +>T : Symbol(T, Decl(overloadOnGenericClassAndNonGenericClass.ts, 3, 8)) +>x : Symbol(x, Decl(overloadOnGenericClassAndNonGenericClass.ts, 3, 12)) +>T : Symbol(T, Decl(overloadOnGenericClassAndNonGenericClass.ts, 3, 8)) + +class X1 { x: string; } +>X1 : Symbol(X1, Decl(overloadOnGenericClassAndNonGenericClass.ts, 3, 20)) +>x : Symbol(x, Decl(overloadOnGenericClassAndNonGenericClass.ts, 4, 10)) + +class X2 { x: string; } +>X2 : Symbol(X2, Decl(overloadOnGenericClassAndNonGenericClass.ts, 4, 23)) +>x : Symbol(x, Decl(overloadOnGenericClassAndNonGenericClass.ts, 5, 10)) + +function f(a: X1): A; +>f : Symbol(f, Decl(overloadOnGenericClassAndNonGenericClass.ts, 5, 23), Decl(overloadOnGenericClassAndNonGenericClass.ts, 6, 21), Decl(overloadOnGenericClassAndNonGenericClass.ts, 7, 26)) +>a : Symbol(a, Decl(overloadOnGenericClassAndNonGenericClass.ts, 6, 11)) +>X1 : Symbol(X1, Decl(overloadOnGenericClassAndNonGenericClass.ts, 3, 20)) +>A : Symbol(A, Decl(overloadOnGenericClassAndNonGenericClass.ts, 0, 0)) + +function f(a: X): B; +>f : Symbol(f, Decl(overloadOnGenericClassAndNonGenericClass.ts, 5, 23), Decl(overloadOnGenericClassAndNonGenericClass.ts, 6, 21), Decl(overloadOnGenericClassAndNonGenericClass.ts, 7, 26)) +>T : Symbol(T, Decl(overloadOnGenericClassAndNonGenericClass.ts, 7, 11)) +>a : Symbol(a, Decl(overloadOnGenericClassAndNonGenericClass.ts, 7, 14)) +>X : Symbol(X, Decl(overloadOnGenericClassAndNonGenericClass.ts, 2, 14)) +>T : Symbol(T, Decl(overloadOnGenericClassAndNonGenericClass.ts, 7, 11)) +>B : Symbol(B, Decl(overloadOnGenericClassAndNonGenericClass.ts, 0, 14)) + +function f(a): any { +>f : Symbol(f, Decl(overloadOnGenericClassAndNonGenericClass.ts, 5, 23), Decl(overloadOnGenericClassAndNonGenericClass.ts, 6, 21), Decl(overloadOnGenericClassAndNonGenericClass.ts, 7, 26)) +>a : Symbol(a, Decl(overloadOnGenericClassAndNonGenericClass.ts, 8, 11)) +} + +var xs: X; +>xs : Symbol(xs, Decl(overloadOnGenericClassAndNonGenericClass.ts, 11, 3)) +>X : Symbol(X, Decl(overloadOnGenericClassAndNonGenericClass.ts, 2, 14)) + +var t3 = f(xs); +>t3 : Symbol(t3, Decl(overloadOnGenericClassAndNonGenericClass.ts, 13, 3), Decl(overloadOnGenericClassAndNonGenericClass.ts, 14, 3)) +>f : Symbol(f, Decl(overloadOnGenericClassAndNonGenericClass.ts, 5, 23), Decl(overloadOnGenericClassAndNonGenericClass.ts, 6, 21), Decl(overloadOnGenericClassAndNonGenericClass.ts, 7, 26)) +>xs : Symbol(xs, Decl(overloadOnGenericClassAndNonGenericClass.ts, 11, 3)) + +var t3: A; // should not error +>t3 : Symbol(t3, Decl(overloadOnGenericClassAndNonGenericClass.ts, 13, 3), Decl(overloadOnGenericClassAndNonGenericClass.ts, 14, 3)) +>A : Symbol(A, Decl(overloadOnGenericClassAndNonGenericClass.ts, 0, 0)) + diff --git a/tests/baselines/reference/overloadResolutionOverNonCTLambdas.symbols b/tests/baselines/reference/overloadResolutionOverNonCTLambdas.symbols new file mode 100644 index 00000000000..815f977d605 --- /dev/null +++ b/tests/baselines/reference/overloadResolutionOverNonCTLambdas.symbols @@ -0,0 +1,63 @@ +=== tests/cases/compiler/overloadResolutionOverNonCTLambdas.ts === +module Bugs { +>Bugs : Symbol(Bugs, Decl(overloadResolutionOverNonCTLambdas.ts, 0, 0)) + + class A { +>A : Symbol(A, Decl(overloadResolutionOverNonCTLambdas.ts, 0, 13)) + } + + // replace(searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; + function bug2(message:string, ...args:any[]):string { +>bug2 : Symbol(bug2, Decl(overloadResolutionOverNonCTLambdas.ts, 2, 3)) +>message : Symbol(message, Decl(overloadResolutionOverNonCTLambdas.ts, 5, 16)) +>args : Symbol(args, Decl(overloadResolutionOverNonCTLambdas.ts, 5, 31)) + + var result= message.replace(/\{(\d+)\}/g, function(match, ...rest) { +>result : Symbol(result, Decl(overloadResolutionOverNonCTLambdas.ts, 6, 7)) +>message.replace : Symbol(String.replace, Decl(lib.d.ts, 329, 44), Decl(lib.d.ts, 336, 63), Decl(lib.d.ts, 343, 102), Decl(lib.d.ts, 350, 63)) +>message : Symbol(message, Decl(overloadResolutionOverNonCTLambdas.ts, 5, 16)) +>replace : Symbol(String.replace, Decl(lib.d.ts, 329, 44), Decl(lib.d.ts, 336, 63), Decl(lib.d.ts, 343, 102), Decl(lib.d.ts, 350, 63)) +>match : Symbol(match, Decl(overloadResolutionOverNonCTLambdas.ts, 6, 55)) +>rest : Symbol(rest, Decl(overloadResolutionOverNonCTLambdas.ts, 6, 61)) + + var index= rest[0]; +>index : Symbol(index, Decl(overloadResolutionOverNonCTLambdas.ts, 7, 9)) +>rest : Symbol(rest, Decl(overloadResolutionOverNonCTLambdas.ts, 6, 61)) + + return typeof args[index] !== 'undefined' +>args : Symbol(args, Decl(overloadResolutionOverNonCTLambdas.ts, 5, 31)) +>index : Symbol(index, Decl(overloadResolutionOverNonCTLambdas.ts, 7, 9)) + + ? args[index] +>args : Symbol(args, Decl(overloadResolutionOverNonCTLambdas.ts, 5, 31)) +>index : Symbol(index, Decl(overloadResolutionOverNonCTLambdas.ts, 7, 9)) + + : match; +>match : Symbol(match, Decl(overloadResolutionOverNonCTLambdas.ts, 6, 55)) + + }); + return result; +>result : Symbol(result, Decl(overloadResolutionOverNonCTLambdas.ts, 6, 7)) + } +} + +function bug3(f:(x:string)=>string) { return f("s") } +>bug3 : Symbol(bug3, Decl(overloadResolutionOverNonCTLambdas.ts, 14, 1)) +>f : Symbol(f, Decl(overloadResolutionOverNonCTLambdas.ts, 16, 14)) +>x : Symbol(x, Decl(overloadResolutionOverNonCTLambdas.ts, 16, 17)) +>f : Symbol(f, Decl(overloadResolutionOverNonCTLambdas.ts, 16, 14)) + +function fprime(x:string):string { return x; } +>fprime : Symbol(fprime, Decl(overloadResolutionOverNonCTLambdas.ts, 16, 53)) +>x : Symbol(x, Decl(overloadResolutionOverNonCTLambdas.ts, 18, 16)) +>x : Symbol(x, Decl(overloadResolutionOverNonCTLambdas.ts, 18, 16)) + +bug3(fprime); +>bug3 : Symbol(bug3, Decl(overloadResolutionOverNonCTLambdas.ts, 14, 1)) +>fprime : Symbol(fprime, Decl(overloadResolutionOverNonCTLambdas.ts, 16, 53)) + +bug3(function(x:string):string { return x; }); +>bug3 : Symbol(bug3, Decl(overloadResolutionOverNonCTLambdas.ts, 14, 1)) +>x : Symbol(x, Decl(overloadResolutionOverNonCTLambdas.ts, 22, 14)) +>x : Symbol(x, Decl(overloadResolutionOverNonCTLambdas.ts, 22, 14)) + diff --git a/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types b/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types index 6e129400736..f62bb4e8373 100644 --- a/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types +++ b/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types @@ -18,6 +18,7 @@ module Bugs { >message.replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; } >message : string >replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; } +>/\{(\d+)\}/g : RegExp >function(match, ...rest) { var index= rest[0]; return typeof args[index] !== 'undefined' ? args[index] : match; } : (match: string, ...rest: any[]) => any >match : string >rest : any[] @@ -26,6 +27,7 @@ module Bugs { >index : any >rest[0] : any >rest : any[] +>0 : number return typeof args[index] !== 'undefined' >typeof args[index] !== 'undefined' ? args[index] : match : any @@ -34,6 +36,7 @@ module Bugs { >args[index] : any >args : any[] >index : any +>'undefined' : string ? args[index] >args[index] : any @@ -55,6 +58,7 @@ function bug3(f:(x:string)=>string) { return f("s") } >x : string >f("s") : string >f : (x: string) => string +>"s" : string function fprime(x:string):string { return x; } >fprime : (x: string) => string diff --git a/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.symbols b/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.symbols new file mode 100644 index 00000000000..850f188a58b --- /dev/null +++ b/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.symbols @@ -0,0 +1,60 @@ +=== tests/cases/compiler/overloadResolutionOverNonCTObjectLit.ts === +module Bugs { +>Bugs : Symbol(Bugs, Decl(overloadResolutionOverNonCTObjectLit.ts, 0, 0)) + + export interface IToken { +>IToken : Symbol(IToken, Decl(overloadResolutionOverNonCTObjectLit.ts, 0, 13)) + + startIndex:number; +>startIndex : Symbol(startIndex, Decl(overloadResolutionOverNonCTObjectLit.ts, 1, 41)) + + type:string; +>type : Symbol(type, Decl(overloadResolutionOverNonCTObjectLit.ts, 2, 50)) + + bracket:number; +>bracket : Symbol(bracket, Decl(overloadResolutionOverNonCTObjectLit.ts, 3, 44)) + } + + export interface IState { +>IState : Symbol(IState, Decl(overloadResolutionOverNonCTObjectLit.ts, 5, 17)) + } + + export interface IStateToken extends IToken { +>IStateToken : Symbol(IStateToken, Decl(overloadResolutionOverNonCTObjectLit.ts, 8, 17)) +>IToken : Symbol(IToken, Decl(overloadResolutionOverNonCTObjectLit.ts, 0, 13)) + + state: IState; +>state : Symbol(state, Decl(overloadResolutionOverNonCTObjectLit.ts, 10, 61)) +>IState : Symbol(IState, Decl(overloadResolutionOverNonCTObjectLit.ts, 5, 17)) + + length: number; +>length : Symbol(length, Decl(overloadResolutionOverNonCTObjectLit.ts, 11, 46)) + } + + function bug3() { +>bug3 : Symbol(bug3, Decl(overloadResolutionOverNonCTObjectLit.ts, 13, 17)) + + var tokens:IToken[]= []; +>tokens : Symbol(tokens, Decl(overloadResolutionOverNonCTObjectLit.ts, 16, 35)) +>IToken : Symbol(IToken, Decl(overloadResolutionOverNonCTObjectLit.ts, 0, 13)) + + tokens.push({ startIndex: 1, type: '', bracket: 3 }); +>tokens.push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29)) +>tokens : Symbol(tokens, Decl(overloadResolutionOverNonCTObjectLit.ts, 16, 35)) +>push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29)) +>startIndex : Symbol(startIndex, Decl(overloadResolutionOverNonCTObjectLit.ts, 17, 45)) +>type : Symbol(type, Decl(overloadResolutionOverNonCTObjectLit.ts, 17, 60)) +>bracket : Symbol(bracket, Decl(overloadResolutionOverNonCTObjectLit.ts, 17, 70)) + + tokens.push(({ startIndex: 1, type: '', bracket: 3, state: null, length: 10 })); +>tokens.push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29)) +>tokens : Symbol(tokens, Decl(overloadResolutionOverNonCTObjectLit.ts, 16, 35)) +>push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29)) +>IToken : Symbol(IToken, Decl(overloadResolutionOverNonCTObjectLit.ts, 0, 13)) +>startIndex : Symbol(startIndex, Decl(overloadResolutionOverNonCTObjectLit.ts, 18, 54)) +>type : Symbol(type, Decl(overloadResolutionOverNonCTObjectLit.ts, 18, 69)) +>bracket : Symbol(bracket, Decl(overloadResolutionOverNonCTObjectLit.ts, 18, 79)) +>state : Symbol(state, Decl(overloadResolutionOverNonCTObjectLit.ts, 18, 91)) +>length : Symbol(length, Decl(overloadResolutionOverNonCTObjectLit.ts, 18, 104)) + } +} diff --git a/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types b/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types index 7ad68cefa4f..e6ff0cda468 100644 --- a/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types +++ b/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types @@ -46,8 +46,11 @@ module Bugs { >push : (...items: IToken[]) => number >{ startIndex: 1, type: '', bracket: 3 } : { startIndex: number; type: string; bracket: number; } >startIndex : number +>1 : number >type : string +>'' : string >bracket : number +>3 : number tokens.push(({ startIndex: 1, type: '', bracket: 3, state: null, length: 10 })); >tokens.push(({ startIndex: 1, type: '', bracket: 3, state: null, length: 10 })) : number @@ -59,9 +62,14 @@ module Bugs { >({ startIndex: 1, type: '', bracket: 3, state: null, length: 10 }) : { startIndex: number; type: string; bracket: number; state: null; length: number; } >{ startIndex: 1, type: '', bracket: 3, state: null, length: 10 } : { startIndex: number; type: string; bracket: number; state: null; length: number; } >startIndex : number +>1 : number >type : string +>'' : string >bracket : number +>3 : number >state : null +>null : null >length : number +>10 : number } } diff --git a/tests/baselines/reference/overloadResolutionWithAny.symbols b/tests/baselines/reference/overloadResolutionWithAny.symbols new file mode 100644 index 00000000000..af998b6b376 --- /dev/null +++ b/tests/baselines/reference/overloadResolutionWithAny.symbols @@ -0,0 +1,62 @@ +=== tests/cases/compiler/overloadResolutionWithAny.ts === +var func: { +>func : Symbol(func, Decl(overloadResolutionWithAny.ts, 0, 3)) + + (s: string): number; +>s : Symbol(s, Decl(overloadResolutionWithAny.ts, 1, 5)) + + (s: any): string; +>s : Symbol(s, Decl(overloadResolutionWithAny.ts, 2, 5)) + +}; + +func(""); // number +>func : Symbol(func, Decl(overloadResolutionWithAny.ts, 0, 3)) + +func(3); // string +>func : Symbol(func, Decl(overloadResolutionWithAny.ts, 0, 3)) + +var x: any; +>x : Symbol(x, Decl(overloadResolutionWithAny.ts, 7, 3)) + +func(x); // string +>func : Symbol(func, Decl(overloadResolutionWithAny.ts, 0, 3)) +>x : Symbol(x, Decl(overloadResolutionWithAny.ts, 7, 3)) + +var func2: { +>func2 : Symbol(func2, Decl(overloadResolutionWithAny.ts, 10, 3)) + + (s: string, t: string): number; +>s : Symbol(s, Decl(overloadResolutionWithAny.ts, 11, 5)) +>t : Symbol(t, Decl(overloadResolutionWithAny.ts, 11, 15)) + + (s: any, t: string): boolean; +>s : Symbol(s, Decl(overloadResolutionWithAny.ts, 12, 5)) +>t : Symbol(t, Decl(overloadResolutionWithAny.ts, 12, 12)) + + (s: string, t: any): RegExp; +>s : Symbol(s, Decl(overloadResolutionWithAny.ts, 13, 5)) +>t : Symbol(t, Decl(overloadResolutionWithAny.ts, 13, 15)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) + + (s: any, t: any): string; +>s : Symbol(s, Decl(overloadResolutionWithAny.ts, 14, 5)) +>t : Symbol(t, Decl(overloadResolutionWithAny.ts, 14, 12)) +} + +func2(x, x); // string +>func2 : Symbol(func2, Decl(overloadResolutionWithAny.ts, 10, 3)) +>x : Symbol(x, Decl(overloadResolutionWithAny.ts, 7, 3)) +>x : Symbol(x, Decl(overloadResolutionWithAny.ts, 7, 3)) + +func2("", ""); // number +>func2 : Symbol(func2, Decl(overloadResolutionWithAny.ts, 10, 3)) + +func2(x, ""); // boolean +>func2 : Symbol(func2, Decl(overloadResolutionWithAny.ts, 10, 3)) +>x : Symbol(x, Decl(overloadResolutionWithAny.ts, 7, 3)) + +func2("", x); // RegExp +>func2 : Symbol(func2, Decl(overloadResolutionWithAny.ts, 10, 3)) +>x : Symbol(x, Decl(overloadResolutionWithAny.ts, 7, 3)) + diff --git a/tests/baselines/reference/overloadResolutionWithAny.types b/tests/baselines/reference/overloadResolutionWithAny.types index 14d378c9fac..e66368d3554 100644 --- a/tests/baselines/reference/overloadResolutionWithAny.types +++ b/tests/baselines/reference/overloadResolutionWithAny.types @@ -13,10 +13,12 @@ var func: { func(""); // number >func("") : number >func : { (s: string): number; (s: any): string; } +>"" : string func(3); // string >func(3) : string >func : { (s: string): number; (s: any): string; } +>3 : number var x: any; >x : any @@ -56,14 +58,18 @@ func2(x, x); // string func2("", ""); // number >func2("", "") : number >func2 : { (s: string, t: string): number; (s: any, t: string): boolean; (s: string, t: any): RegExp; (s: any, t: any): string; } +>"" : string +>"" : string func2(x, ""); // boolean >func2(x, "") : boolean >func2 : { (s: string, t: string): number; (s: any, t: string): boolean; (s: string, t: any): RegExp; (s: any, t: any): string; } >x : any +>"" : string func2("", x); // RegExp >func2("", x) : RegExp >func2 : { (s: string, t: string): number; (s: any, t: string): boolean; (s: string, t: any): RegExp; (s: any, t: any): string; } +>"" : string >x : any diff --git a/tests/baselines/reference/overloadRet.symbols b/tests/baselines/reference/overloadRet.symbols new file mode 100644 index 00000000000..0c645b7c4b8 --- /dev/null +++ b/tests/baselines/reference/overloadRet.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/overloadRet.ts === +interface I { +>I : Symbol(I, Decl(overloadRet.ts, 0, 0)) + + f(s:string):number; +>f : Symbol(f, Decl(overloadRet.ts, 0, 13), Decl(overloadRet.ts, 1, 23)) +>s : Symbol(s, Decl(overloadRet.ts, 1, 6)) + + f(n:number):string; +>f : Symbol(f, Decl(overloadRet.ts, 0, 13), Decl(overloadRet.ts, 1, 23)) +>n : Symbol(n, Decl(overloadRet.ts, 2, 6)) + + g(n:number):any; +>g : Symbol(g, Decl(overloadRet.ts, 2, 23), Decl(overloadRet.ts, 3, 20)) +>n : Symbol(n, Decl(overloadRet.ts, 3, 6)) + + g(n:number,m:number):string; +>g : Symbol(g, Decl(overloadRet.ts, 2, 23), Decl(overloadRet.ts, 3, 20)) +>n : Symbol(n, Decl(overloadRet.ts, 4, 6)) +>m : Symbol(m, Decl(overloadRet.ts, 4, 15)) + + h(n:number):I; +>h : Symbol(h, Decl(overloadRet.ts, 4, 32), Decl(overloadRet.ts, 5, 18)) +>n : Symbol(n, Decl(overloadRet.ts, 5, 6)) +>I : Symbol(I, Decl(overloadRet.ts, 0, 0)) + + h(b:boolean):number; +>h : Symbol(h, Decl(overloadRet.ts, 4, 32), Decl(overloadRet.ts, 5, 18)) +>b : Symbol(b, Decl(overloadRet.ts, 6, 6)) + + i(b:boolean):number; +>i : Symbol(i, Decl(overloadRet.ts, 6, 24), Decl(overloadRet.ts, 7, 24)) +>b : Symbol(b, Decl(overloadRet.ts, 7, 6)) + + i(b:boolean):any; +>i : Symbol(i, Decl(overloadRet.ts, 6, 24), Decl(overloadRet.ts, 7, 24)) +>b : Symbol(b, Decl(overloadRet.ts, 8, 6)) +} diff --git a/tests/baselines/reference/overloadReturnTypes.symbols b/tests/baselines/reference/overloadReturnTypes.symbols new file mode 100644 index 00000000000..b76efb4a0d6 --- /dev/null +++ b/tests/baselines/reference/overloadReturnTypes.symbols @@ -0,0 +1,58 @@ +=== tests/cases/compiler/overloadReturnTypes.ts === +class Accessor {} +>Accessor : Symbol(Accessor, Decl(overloadReturnTypes.ts, 0, 0)) + +function attr(name: string): string; +>attr : Symbol(attr, Decl(overloadReturnTypes.ts, 0, 17), Decl(overloadReturnTypes.ts, 2, 36), Decl(overloadReturnTypes.ts, 3, 53), Decl(overloadReturnTypes.ts, 4, 34)) +>name : Symbol(name, Decl(overloadReturnTypes.ts, 2, 14)) + +function attr(name: string, value: string): Accessor; +>attr : Symbol(attr, Decl(overloadReturnTypes.ts, 0, 17), Decl(overloadReturnTypes.ts, 2, 36), Decl(overloadReturnTypes.ts, 3, 53), Decl(overloadReturnTypes.ts, 4, 34)) +>name : Symbol(name, Decl(overloadReturnTypes.ts, 3, 14)) +>value : Symbol(value, Decl(overloadReturnTypes.ts, 3, 27)) +>Accessor : Symbol(Accessor, Decl(overloadReturnTypes.ts, 0, 0)) + +function attr(map: any): Accessor; +>attr : Symbol(attr, Decl(overloadReturnTypes.ts, 0, 17), Decl(overloadReturnTypes.ts, 2, 36), Decl(overloadReturnTypes.ts, 3, 53), Decl(overloadReturnTypes.ts, 4, 34)) +>map : Symbol(map, Decl(overloadReturnTypes.ts, 4, 14)) +>Accessor : Symbol(Accessor, Decl(overloadReturnTypes.ts, 0, 0)) + +function attr(nameOrMap: any, value?: string): any { +>attr : Symbol(attr, Decl(overloadReturnTypes.ts, 0, 17), Decl(overloadReturnTypes.ts, 2, 36), Decl(overloadReturnTypes.ts, 3, 53), Decl(overloadReturnTypes.ts, 4, 34)) +>nameOrMap : Symbol(nameOrMap, Decl(overloadReturnTypes.ts, 5, 14)) +>value : Symbol(value, Decl(overloadReturnTypes.ts, 5, 29)) + + if (nameOrMap && typeof nameOrMap === "object") { +>nameOrMap : Symbol(nameOrMap, Decl(overloadReturnTypes.ts, 5, 14)) +>nameOrMap : Symbol(nameOrMap, Decl(overloadReturnTypes.ts, 5, 14)) + + // handle map case + return new Accessor; +>Accessor : Symbol(Accessor, Decl(overloadReturnTypes.ts, 0, 0)) + } + else { + // handle string case + return "s"; + } +} + + +interface IFace { +>IFace : Symbol(IFace, Decl(overloadReturnTypes.ts, 14, 1)) + + attr(name:string):string; +>attr : Symbol(attr, Decl(overloadReturnTypes.ts, 17, 17), Decl(overloadReturnTypes.ts, 18, 26), Decl(overloadReturnTypes.ts, 19, 45)) +>name : Symbol(name, Decl(overloadReturnTypes.ts, 18, 6)) + + attr(name: string, value: string): Accessor; +>attr : Symbol(attr, Decl(overloadReturnTypes.ts, 17, 17), Decl(overloadReturnTypes.ts, 18, 26), Decl(overloadReturnTypes.ts, 19, 45)) +>name : Symbol(name, Decl(overloadReturnTypes.ts, 19, 6)) +>value : Symbol(value, Decl(overloadReturnTypes.ts, 19, 19)) +>Accessor : Symbol(Accessor, Decl(overloadReturnTypes.ts, 0, 0)) + + attr(map: any): Accessor; +>attr : Symbol(attr, Decl(overloadReturnTypes.ts, 17, 17), Decl(overloadReturnTypes.ts, 18, 26), Decl(overloadReturnTypes.ts, 19, 45)) +>map : Symbol(map, Decl(overloadReturnTypes.ts, 20, 6)) +>Accessor : Symbol(Accessor, Decl(overloadReturnTypes.ts, 0, 0)) +} + diff --git a/tests/baselines/reference/overloadReturnTypes.types b/tests/baselines/reference/overloadReturnTypes.types index 1823c752ae7..3de1aec1196 100644 --- a/tests/baselines/reference/overloadReturnTypes.types +++ b/tests/baselines/reference/overloadReturnTypes.types @@ -28,6 +28,7 @@ function attr(nameOrMap: any, value?: string): any { >typeof nameOrMap === "object" : boolean >typeof nameOrMap : string >nameOrMap : any +>"object" : string // handle map case return new Accessor; @@ -37,6 +38,7 @@ function attr(nameOrMap: any, value?: string): any { else { // handle string case return "s"; +>"s" : string } } diff --git a/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.symbols b/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.symbols new file mode 100644 index 00000000000..0ae3e488fac --- /dev/null +++ b/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/overloadWithCallbacksWithDifferingOptionalityOnArgs.ts === +function x2(callback: (x?: number) => number); +>x2 : Symbol(x2, Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 0, 0), Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 0, 46), Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 1, 45)) +>callback : Symbol(callback, Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 0, 12)) +>x : Symbol(x, Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 0, 23)) + +function x2(callback: (x: string) => number); +>x2 : Symbol(x2, Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 0, 0), Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 0, 46), Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 1, 45)) +>callback : Symbol(callback, Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 1, 12)) +>x : Symbol(x, Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 1, 23)) + +function x2(callback: (x: any) => number) { } +>x2 : Symbol(x2, Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 0, 0), Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 0, 46), Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 1, 45)) +>callback : Symbol(callback, Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 2, 12)) +>x : Symbol(x, Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 2, 23)) + +x2(() => 1); +>x2 : Symbol(x2, Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 0, 0), Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 0, 46), Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 1, 45)) + +x2((x) => 1 ); +>x2 : Symbol(x2, Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 0, 0), Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 0, 46), Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 1, 45)) +>x : Symbol(x, Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 4, 4)) + diff --git a/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types b/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types index 2ed804ad012..b9ea7d98270 100644 --- a/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types +++ b/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types @@ -18,10 +18,12 @@ x2(() => 1); >x2(() => 1) : any >x2 : { (callback: (x?: number) => number): any; (callback: (x: string) => number): any; } >() => 1 : () => number +>1 : number x2((x) => 1 ); >x2((x) => 1 ) : any >x2 : { (callback: (x?: number) => number): any; (callback: (x: string) => number): any; } >(x) => 1 : (x: number) => number >x : number +>1 : number diff --git a/tests/baselines/reference/overloadedStaticMethodSpecialization.symbols b/tests/baselines/reference/overloadedStaticMethodSpecialization.symbols new file mode 100644 index 00000000000..eddadc8ab03 --- /dev/null +++ b/tests/baselines/reference/overloadedStaticMethodSpecialization.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/overloadedStaticMethodSpecialization.ts === +class A { +>A : Symbol(A, Decl(overloadedStaticMethodSpecialization.ts, 0, 0)) +>T : Symbol(T, Decl(overloadedStaticMethodSpecialization.ts, 0, 8)) + + static B(v: A): A; +>B : Symbol(A.B, Decl(overloadedStaticMethodSpecialization.ts, 0, 12), Decl(overloadedStaticMethodSpecialization.ts, 1, 31), Decl(overloadedStaticMethodSpecialization.ts, 2, 28)) +>S : Symbol(S, Decl(overloadedStaticMethodSpecialization.ts, 1, 13)) +>v : Symbol(v, Decl(overloadedStaticMethodSpecialization.ts, 1, 16)) +>A : Symbol(A, Decl(overloadedStaticMethodSpecialization.ts, 0, 0)) +>S : Symbol(S, Decl(overloadedStaticMethodSpecialization.ts, 1, 13)) +>A : Symbol(A, Decl(overloadedStaticMethodSpecialization.ts, 0, 0)) +>S : Symbol(S, Decl(overloadedStaticMethodSpecialization.ts, 1, 13)) + + static B(v: S): A; +>B : Symbol(A.B, Decl(overloadedStaticMethodSpecialization.ts, 0, 12), Decl(overloadedStaticMethodSpecialization.ts, 1, 31), Decl(overloadedStaticMethodSpecialization.ts, 2, 28)) +>S : Symbol(S, Decl(overloadedStaticMethodSpecialization.ts, 2, 13)) +>v : Symbol(v, Decl(overloadedStaticMethodSpecialization.ts, 2, 16)) +>S : Symbol(S, Decl(overloadedStaticMethodSpecialization.ts, 2, 13)) +>A : Symbol(A, Decl(overloadedStaticMethodSpecialization.ts, 0, 0)) +>S : Symbol(S, Decl(overloadedStaticMethodSpecialization.ts, 2, 13)) + + static B(v: any): A { +>B : Symbol(A.B, Decl(overloadedStaticMethodSpecialization.ts, 0, 12), Decl(overloadedStaticMethodSpecialization.ts, 1, 31), Decl(overloadedStaticMethodSpecialization.ts, 2, 28)) +>S : Symbol(S, Decl(overloadedStaticMethodSpecialization.ts, 3, 13)) +>v : Symbol(v, Decl(overloadedStaticMethodSpecialization.ts, 3, 16)) +>A : Symbol(A, Decl(overloadedStaticMethodSpecialization.ts, 0, 0)) +>S : Symbol(S, Decl(overloadedStaticMethodSpecialization.ts, 3, 13)) + + return null; + } +} + diff --git a/tests/baselines/reference/overloadedStaticMethodSpecialization.types b/tests/baselines/reference/overloadedStaticMethodSpecialization.types index bd60fc16fe0..aac8f645687 100644 --- a/tests/baselines/reference/overloadedStaticMethodSpecialization.types +++ b/tests/baselines/reference/overloadedStaticMethodSpecialization.types @@ -28,6 +28,7 @@ class A { >S : S return null; +>null : null } } diff --git a/tests/baselines/reference/overloadsAndTypeArgumentArity.symbols b/tests/baselines/reference/overloadsAndTypeArgumentArity.symbols new file mode 100644 index 00000000000..76e9ae7d701 --- /dev/null +++ b/tests/baselines/reference/overloadsAndTypeArgumentArity.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/overloadsAndTypeArgumentArity.ts === +declare function Callbacks(flags?: string): void; +>Callbacks : Symbol(Callbacks, Decl(overloadsAndTypeArgumentArity.ts, 0, 0), Decl(overloadsAndTypeArgumentArity.ts, 0, 49), Decl(overloadsAndTypeArgumentArity.ts, 1, 52), Decl(overloadsAndTypeArgumentArity.ts, 2, 57)) +>flags : Symbol(flags, Decl(overloadsAndTypeArgumentArity.ts, 0, 27)) + +declare function Callbacks(flags?: string): void; +>Callbacks : Symbol(Callbacks, Decl(overloadsAndTypeArgumentArity.ts, 0, 0), Decl(overloadsAndTypeArgumentArity.ts, 0, 49), Decl(overloadsAndTypeArgumentArity.ts, 1, 52), Decl(overloadsAndTypeArgumentArity.ts, 2, 57)) +>T : Symbol(T, Decl(overloadsAndTypeArgumentArity.ts, 1, 27)) +>flags : Symbol(flags, Decl(overloadsAndTypeArgumentArity.ts, 1, 30)) + +declare function Callbacks(flags?: string): void; +>Callbacks : Symbol(Callbacks, Decl(overloadsAndTypeArgumentArity.ts, 0, 0), Decl(overloadsAndTypeArgumentArity.ts, 0, 49), Decl(overloadsAndTypeArgumentArity.ts, 1, 52), Decl(overloadsAndTypeArgumentArity.ts, 2, 57)) +>T1 : Symbol(T1, Decl(overloadsAndTypeArgumentArity.ts, 2, 27)) +>T2 : Symbol(T2, Decl(overloadsAndTypeArgumentArity.ts, 2, 30)) +>flags : Symbol(flags, Decl(overloadsAndTypeArgumentArity.ts, 2, 35)) + +declare function Callbacks(flags?: string): void; +>Callbacks : Symbol(Callbacks, Decl(overloadsAndTypeArgumentArity.ts, 0, 0), Decl(overloadsAndTypeArgumentArity.ts, 0, 49), Decl(overloadsAndTypeArgumentArity.ts, 1, 52), Decl(overloadsAndTypeArgumentArity.ts, 2, 57)) +>T1 : Symbol(T1, Decl(overloadsAndTypeArgumentArity.ts, 3, 27)) +>T2 : Symbol(T2, Decl(overloadsAndTypeArgumentArity.ts, 3, 30)) +>T3 : Symbol(T3, Decl(overloadsAndTypeArgumentArity.ts, 3, 34)) +>flags : Symbol(flags, Decl(overloadsAndTypeArgumentArity.ts, 3, 39)) + +Callbacks('s'); // no error +>Callbacks : Symbol(Callbacks, Decl(overloadsAndTypeArgumentArity.ts, 0, 0), Decl(overloadsAndTypeArgumentArity.ts, 0, 49), Decl(overloadsAndTypeArgumentArity.ts, 1, 52), Decl(overloadsAndTypeArgumentArity.ts, 2, 57)) + +new Callbacks('s'); // no error +>Callbacks : Symbol(Callbacks, Decl(overloadsAndTypeArgumentArity.ts, 0, 0), Decl(overloadsAndTypeArgumentArity.ts, 0, 49), Decl(overloadsAndTypeArgumentArity.ts, 1, 52), Decl(overloadsAndTypeArgumentArity.ts, 2, 57)) + diff --git a/tests/baselines/reference/overloadsAndTypeArgumentArity.types b/tests/baselines/reference/overloadsAndTypeArgumentArity.types index 1b76b8e13fe..b69f394e83d 100644 --- a/tests/baselines/reference/overloadsAndTypeArgumentArity.types +++ b/tests/baselines/reference/overloadsAndTypeArgumentArity.types @@ -24,8 +24,10 @@ declare function Callbacks(flags?: string): void; Callbacks('s'); // no error >Callbacks('s') : void >Callbacks : { (flags?: string): void; (flags?: string): void; (flags?: string): void; (flags?: string): void; } +>'s' : string new Callbacks('s'); // no error >new Callbacks('s') : any >Callbacks : { (flags?: string): void; (flags?: string): void; (flags?: string): void; (flags?: string): void; } +>'s' : string diff --git a/tests/baselines/reference/overloadsWithConstraints.symbols b/tests/baselines/reference/overloadsWithConstraints.symbols new file mode 100644 index 00000000000..68b675093bf --- /dev/null +++ b/tests/baselines/reference/overloadsWithConstraints.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/overloadsWithConstraints.ts === +declare function f(x: T): T; +>f : Symbol(f, Decl(overloadsWithConstraints.ts, 0, 0), Decl(overloadsWithConstraints.ts, 0, 46)) +>T : Symbol(T, Decl(overloadsWithConstraints.ts, 0, 19)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) +>x : Symbol(x, Decl(overloadsWithConstraints.ts, 0, 37)) +>T : Symbol(T, Decl(overloadsWithConstraints.ts, 0, 19)) +>T : Symbol(T, Decl(overloadsWithConstraints.ts, 0, 19)) + +declare function f(x: T): T +>f : Symbol(f, Decl(overloadsWithConstraints.ts, 0, 0), Decl(overloadsWithConstraints.ts, 0, 46)) +>T : Symbol(T, Decl(overloadsWithConstraints.ts, 1, 19)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) +>x : Symbol(x, Decl(overloadsWithConstraints.ts, 1, 37)) +>T : Symbol(T, Decl(overloadsWithConstraints.ts, 1, 19)) +>T : Symbol(T, Decl(overloadsWithConstraints.ts, 1, 19)) + +var v = f(""); +>v : Symbol(v, Decl(overloadsWithConstraints.ts, 3, 3)) +>f : Symbol(f, Decl(overloadsWithConstraints.ts, 0, 0), Decl(overloadsWithConstraints.ts, 0, 46)) + diff --git a/tests/baselines/reference/overloadsWithConstraints.types b/tests/baselines/reference/overloadsWithConstraints.types index 1493a0e1a2a..b045904ece5 100644 --- a/tests/baselines/reference/overloadsWithConstraints.types +++ b/tests/baselines/reference/overloadsWithConstraints.types @@ -19,4 +19,5 @@ var v = f(""); >v : string >f("") : string >f : { (x: T): T; (x: T): T; } +>"" : string diff --git a/tests/baselines/reference/parameterPropertyInitializerInInitializers.symbols b/tests/baselines/reference/parameterPropertyInitializerInInitializers.symbols new file mode 100644 index 00000000000..c05adb9e8ca --- /dev/null +++ b/tests/baselines/reference/parameterPropertyInitializerInInitializers.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/parameterPropertyInitializerInInitializers.ts === +class Foo { +>Foo : Symbol(Foo, Decl(parameterPropertyInitializerInInitializers.ts, 0, 0)) + + constructor(public x: number, public y: number = x) { } +>x : Symbol(x, Decl(parameterPropertyInitializerInInitializers.ts, 1, 16)) +>y : Symbol(y, Decl(parameterPropertyInitializerInInitializers.ts, 1, 33)) +>x : Symbol(x, Decl(parameterPropertyInitializerInInitializers.ts, 1, 16)) +} diff --git a/tests/baselines/reference/parameterPropertyReferencingOtherParameter.symbols b/tests/baselines/reference/parameterPropertyReferencingOtherParameter.symbols new file mode 100644 index 00000000000..fb6d289f241 --- /dev/null +++ b/tests/baselines/reference/parameterPropertyReferencingOtherParameter.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/parameterPropertyReferencingOtherParameter.ts === +class Foo { +>Foo : Symbol(Foo, Decl(parameterPropertyReferencingOtherParameter.ts, 0, 0)) + + constructor(public x: number, public y: number = x) { } +>x : Symbol(x, Decl(parameterPropertyReferencingOtherParameter.ts, 1, 16)) +>y : Symbol(y, Decl(parameterPropertyReferencingOtherParameter.ts, 1, 33)) +>x : Symbol(x, Decl(parameterPropertyReferencingOtherParameter.ts, 1, 16)) +} + diff --git a/tests/baselines/reference/parameterReferencesOtherParameter1.symbols b/tests/baselines/reference/parameterReferencesOtherParameter1.symbols new file mode 100644 index 00000000000..7e7eec1a3cb --- /dev/null +++ b/tests/baselines/reference/parameterReferencesOtherParameter1.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/parameterReferencesOtherParameter1.ts === +class Model { +>Model : Symbol(Model, Decl(parameterReferencesOtherParameter1.ts, 0, 0)) + + public name: string; +>name : Symbol(name, Decl(parameterReferencesOtherParameter1.ts, 0, 13)) +} + +class UI { +>UI : Symbol(UI, Decl(parameterReferencesOtherParameter1.ts, 2, 1)) + + constructor(model: Model, foo:string = model.name) +>model : Symbol(model, Decl(parameterReferencesOtherParameter1.ts, 5, 16)) +>Model : Symbol(Model, Decl(parameterReferencesOtherParameter1.ts, 0, 0)) +>foo : Symbol(foo, Decl(parameterReferencesOtherParameter1.ts, 5, 29)) +>model.name : Symbol(Model.name, Decl(parameterReferencesOtherParameter1.ts, 0, 13)) +>model : Symbol(model, Decl(parameterReferencesOtherParameter1.ts, 5, 16)) +>name : Symbol(Model.name, Decl(parameterReferencesOtherParameter1.ts, 0, 13)) + { + } +} diff --git a/tests/baselines/reference/parameterReferencesOtherParameter2.symbols b/tests/baselines/reference/parameterReferencesOtherParameter2.symbols new file mode 100644 index 00000000000..2d63c7a3334 --- /dev/null +++ b/tests/baselines/reference/parameterReferencesOtherParameter2.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/parameterReferencesOtherParameter2.ts === +class Model { +>Model : Symbol(Model, Decl(parameterReferencesOtherParameter2.ts, 0, 0)) + + public name: string; +>name : Symbol(name, Decl(parameterReferencesOtherParameter2.ts, 0, 13)) +} + +class UI { +>UI : Symbol(UI, Decl(parameterReferencesOtherParameter2.ts, 2, 1)) + + constructor(model: Model, foo = model.name) +>model : Symbol(model, Decl(parameterReferencesOtherParameter2.ts, 5, 16)) +>Model : Symbol(Model, Decl(parameterReferencesOtherParameter2.ts, 0, 0)) +>foo : Symbol(foo, Decl(parameterReferencesOtherParameter2.ts, 5, 29)) +>model.name : Symbol(Model.name, Decl(parameterReferencesOtherParameter2.ts, 0, 13)) +>model : Symbol(model, Decl(parameterReferencesOtherParameter2.ts, 5, 16)) +>name : Symbol(Model.name, Decl(parameterReferencesOtherParameter2.ts, 0, 13)) + { + } +} diff --git a/tests/baselines/reference/parametersWithNoAnnotationAreAny.symbols b/tests/baselines/reference/parametersWithNoAnnotationAreAny.symbols new file mode 100644 index 00000000000..9771d7f05ca --- /dev/null +++ b/tests/baselines/reference/parametersWithNoAnnotationAreAny.symbols @@ -0,0 +1,81 @@ +=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/parametersWithNoAnnotationAreAny.ts === +function foo(x) { return x; } +>foo : Symbol(foo, Decl(parametersWithNoAnnotationAreAny.ts, 0, 0)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 0, 13)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 0, 13)) + +var f = function foo(x) { return x; } +>f : Symbol(f, Decl(parametersWithNoAnnotationAreAny.ts, 1, 3)) +>foo : Symbol(foo, Decl(parametersWithNoAnnotationAreAny.ts, 1, 7)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 1, 21)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 1, 21)) + +var f2 = (x) => x; +>f2 : Symbol(f2, Decl(parametersWithNoAnnotationAreAny.ts, 2, 3)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 2, 10)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 2, 10)) + +var f3 = (x) => x; +>f3 : Symbol(f3, Decl(parametersWithNoAnnotationAreAny.ts, 3, 3)) +>T : Symbol(T, Decl(parametersWithNoAnnotationAreAny.ts, 3, 10)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 3, 13)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 3, 13)) + +class C { +>C : Symbol(C, Decl(parametersWithNoAnnotationAreAny.ts, 3, 21)) + + foo(x) { +>foo : Symbol(foo, Decl(parametersWithNoAnnotationAreAny.ts, 5, 9)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 6, 8)) + + return x; +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 6, 8)) + } +} + +interface I { +>I : Symbol(I, Decl(parametersWithNoAnnotationAreAny.ts, 9, 1)) + + foo(x); +>foo : Symbol(foo, Decl(parametersWithNoAnnotationAreAny.ts, 11, 13)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 12, 8)) + + foo2(x, y); +>foo2 : Symbol(foo2, Decl(parametersWithNoAnnotationAreAny.ts, 12, 11)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 13, 9)) +>y : Symbol(y, Decl(parametersWithNoAnnotationAreAny.ts, 13, 11)) +} + +var a: { +>a : Symbol(a, Decl(parametersWithNoAnnotationAreAny.ts, 16, 3)) + + foo(x); +>foo : Symbol(foo, Decl(parametersWithNoAnnotationAreAny.ts, 16, 8)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 17, 8)) +} + +var b = { +>b : Symbol(b, Decl(parametersWithNoAnnotationAreAny.ts, 20, 3)) + + foo(x) { +>foo : Symbol(foo, Decl(parametersWithNoAnnotationAreAny.ts, 20, 9)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 21, 8)) + + return x; +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 21, 8)) + + }, + a: function foo(x) { +>a : Symbol(a, Decl(parametersWithNoAnnotationAreAny.ts, 23, 6)) +>foo : Symbol(foo, Decl(parametersWithNoAnnotationAreAny.ts, 24, 6)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 24, 20)) + + return x; +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 24, 20)) + + }, + b: (x) => x +>b : Symbol(b, Decl(parametersWithNoAnnotationAreAny.ts, 26, 6)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 27, 8)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 27, 8)) +} diff --git a/tests/baselines/reference/parenthesizedContexualTyping1.symbols b/tests/baselines/reference/parenthesizedContexualTyping1.symbols new file mode 100644 index 00000000000..698e26734ad --- /dev/null +++ b/tests/baselines/reference/parenthesizedContexualTyping1.symbols @@ -0,0 +1,192 @@ +=== tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts === + +function fun(g: (x: T) => T, x: T): T; +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 1, 13)) +>g : Symbol(g, Decl(parenthesizedContexualTyping1.ts, 1, 16)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 1, 20)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 1, 13)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 1, 13)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 1, 31)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 1, 13)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 1, 13)) + +function fun(g: (x: T) => T, h: (y: T) => T, x: T): T; +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 2, 13)) +>g : Symbol(g, Decl(parenthesizedContexualTyping1.ts, 2, 16)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 2, 20)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 2, 13)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 2, 13)) +>h : Symbol(h, Decl(parenthesizedContexualTyping1.ts, 2, 31)) +>y : Symbol(y, Decl(parenthesizedContexualTyping1.ts, 2, 36)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 2, 13)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 2, 13)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 2, 47)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 2, 13)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 2, 13)) + +function fun(g: (x: T) => T, x: T): T { +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 3, 13)) +>g : Symbol(g, Decl(parenthesizedContexualTyping1.ts, 3, 16)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 3, 20)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 3, 13)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 3, 13)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 3, 31)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 3, 13)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 3, 13)) + + return g(x); +>g : Symbol(g, Decl(parenthesizedContexualTyping1.ts, 3, 16)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 3, 31)) +} + +var a = fun(x => x, 10); +>a : Symbol(a, Decl(parenthesizedContexualTyping1.ts, 7, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 7, 12)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 7, 12)) + +var b = fun((x => x), 10); +>b : Symbol(b, Decl(parenthesizedContexualTyping1.ts, 8, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 8, 13)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 8, 13)) + +var c = fun(((x => x)), 10); +>c : Symbol(c, Decl(parenthesizedContexualTyping1.ts, 9, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 9, 14)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 9, 14)) + +var d = fun((((x => x))), 10); +>d : Symbol(d, Decl(parenthesizedContexualTyping1.ts, 10, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 10, 15)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 10, 15)) + +var e = fun(x => x, x => x, 10); +>e : Symbol(e, Decl(parenthesizedContexualTyping1.ts, 12, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 12, 12)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 12, 12)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 12, 19)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 12, 19)) + +var f = fun((x => x), (x => x), 10); +>f : Symbol(f, Decl(parenthesizedContexualTyping1.ts, 13, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 13, 13)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 13, 13)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 13, 23)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 13, 23)) + +var g = fun(((x => x)), ((x => x)), 10); +>g : Symbol(g, Decl(parenthesizedContexualTyping1.ts, 14, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 14, 14)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 14, 14)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 14, 26)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 14, 26)) + +var h = fun((((x => x))), ((x => x)), 10); +>h : Symbol(h, Decl(parenthesizedContexualTyping1.ts, 15, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 15, 15)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 15, 15)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 15, 28)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 15, 28)) + +// Ternaries in parens +var i = fun((Math.random() < 0.5 ? x => x : x => undefined), 10); +>i : Symbol(i, Decl(parenthesizedContexualTyping1.ts, 18, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 18, 34)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 18, 34)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 18, 43)) +>undefined : Symbol(undefined) + +var j = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), 10); +>j : Symbol(j, Decl(parenthesizedContexualTyping1.ts, 19, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 19, 36)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 19, 36)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 19, 47)) +>undefined : Symbol(undefined) + +var k = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), x => x, 10); +>k : Symbol(k, Decl(parenthesizedContexualTyping1.ts, 20, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 20, 36)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 20, 36)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 20, 47)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 20, 64)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 20, 64)) + +var l = fun(((Math.random() < 0.5 ? ((x => x)) : ((x => undefined)))), ((x => x)), 10); +>l : Symbol(l, Decl(parenthesizedContexualTyping1.ts, 21, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 21, 38)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 21, 38)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 21, 51)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 21, 73)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 21, 73)) + +var lambda1: (x: number) => number = x => x; +>lambda1 : Symbol(lambda1, Decl(parenthesizedContexualTyping1.ts, 23, 3)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 23, 14)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 23, 36)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 23, 36)) + +var lambda2: (x: number) => number = (x => x); +>lambda2 : Symbol(lambda2, Decl(parenthesizedContexualTyping1.ts, 24, 3)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 24, 14)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 24, 38)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 24, 38)) + +type ObjType = { x: (p: number) => string; y: (p: string) => number }; +>ObjType : Symbol(ObjType, Decl(parenthesizedContexualTyping1.ts, 24, 46)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 26, 16)) +>p : Symbol(p, Decl(parenthesizedContexualTyping1.ts, 26, 21)) +>y : Symbol(y, Decl(parenthesizedContexualTyping1.ts, 26, 42)) +>p : Symbol(p, Decl(parenthesizedContexualTyping1.ts, 26, 47)) + +var obj1: ObjType = { x: x => (x, undefined), y: y => (y, undefined) }; +>obj1 : Symbol(obj1, Decl(parenthesizedContexualTyping1.ts, 27, 3)) +>ObjType : Symbol(ObjType, Decl(parenthesizedContexualTyping1.ts, 24, 46)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 27, 21)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 27, 24)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 27, 24)) +>undefined : Symbol(undefined) +>y : Symbol(y, Decl(parenthesizedContexualTyping1.ts, 27, 45)) +>y : Symbol(y, Decl(parenthesizedContexualTyping1.ts, 27, 48)) +>y : Symbol(y, Decl(parenthesizedContexualTyping1.ts, 27, 48)) +>undefined : Symbol(undefined) + +var obj2: ObjType = ({ x: x => (x, undefined), y: y => (y, undefined) }); +>obj2 : Symbol(obj2, Decl(parenthesizedContexualTyping1.ts, 28, 3)) +>ObjType : Symbol(ObjType, Decl(parenthesizedContexualTyping1.ts, 24, 46)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 28, 22)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 28, 25)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 28, 25)) +>undefined : Symbol(undefined) +>y : Symbol(y, Decl(parenthesizedContexualTyping1.ts, 28, 46)) +>y : Symbol(y, Decl(parenthesizedContexualTyping1.ts, 28, 49)) +>y : Symbol(y, Decl(parenthesizedContexualTyping1.ts, 28, 49)) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/parenthesizedContexualTyping1.types b/tests/baselines/reference/parenthesizedContexualTyping1.types index 925347ed1b3..b7307eaf3e7 100644 --- a/tests/baselines/reference/parenthesizedContexualTyping1.types +++ b/tests/baselines/reference/parenthesizedContexualTyping1.types @@ -50,6 +50,7 @@ var a = fun(x => x, 10); >x => x : (x: number) => number >x : number >x : number +>10 : number var b = fun((x => x), 10); >b : number @@ -59,6 +60,7 @@ var b = fun((x => x), 10); >x => x : (x: number) => number >x : number >x : number +>10 : number var c = fun(((x => x)), 10); >c : number @@ -69,6 +71,7 @@ var c = fun(((x => x)), 10); >x => x : (x: number) => number >x : number >x : number +>10 : number var d = fun((((x => x))), 10); >d : number @@ -80,6 +83,7 @@ var d = fun((((x => x))), 10); >x => x : (x: number) => number >x : number >x : number +>10 : number var e = fun(x => x, x => x, 10); >e : number @@ -91,6 +95,7 @@ var e = fun(x => x, x => x, 10); >x => x : (x: number) => number >x : number >x : number +>10 : number var f = fun((x => x), (x => x), 10); >f : number @@ -104,6 +109,7 @@ var f = fun((x => x), (x => x), 10); >x => x : (x: number) => number >x : number >x : number +>10 : number var g = fun(((x => x)), ((x => x)), 10); >g : number @@ -119,6 +125,7 @@ var g = fun(((x => x)), ((x => x)), 10); >x => x : (x: number) => number >x : number >x : number +>10 : number var h = fun((((x => x))), ((x => x)), 10); >h : number @@ -135,6 +142,7 @@ var h = fun((((x => x))), ((x => x)), 10); >x => x : (x: number) => number >x : number >x : number +>10 : number // Ternaries in parens var i = fun((Math.random() < 0.5 ? x => x : x => undefined), 10); @@ -148,12 +156,14 @@ var i = fun((Math.random() < 0.5 ? x => x : x => undefined), 10); >Math.random : () => number >Math : Math >random : () => number +>0.5 : number >x => x : (x: number) => number >x : number >x : number >x => undefined : (x: number) => any >x : number >undefined : undefined +>10 : number var j = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), 10); >j : any @@ -166,6 +176,7 @@ var j = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), 10); >Math.random : () => number >Math : Math >random : () => number +>0.5 : number >(x => x) : (x: number) => number >x => x : (x: number) => number >x : number @@ -174,6 +185,7 @@ var j = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), 10); >x => undefined : (x: number) => any >x : number >undefined : undefined +>10 : number var k = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), x => x, 10); >k : any @@ -186,6 +198,7 @@ var k = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), x => x, 10); >Math.random : () => number >Math : Math >random : () => number +>0.5 : number >(x => x) : (x: number) => number >x => x : (x: number) => number >x : number @@ -197,6 +210,7 @@ var k = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), x => x, 10); >x => x : (x: any) => any >x : any >x : any +>10 : number var l = fun(((Math.random() < 0.5 ? ((x => x)) : ((x => undefined)))), ((x => x)), 10); >l : any @@ -210,6 +224,7 @@ var l = fun(((Math.random() < 0.5 ? ((x => x)) : ((x => undefined)))), ((x => x) >Math.random : () => number >Math : Math >random : () => number +>0.5 : number >((x => x)) : (x: number) => number >(x => x) : (x: number) => number >x => x : (x: number) => number @@ -225,6 +240,7 @@ var l = fun(((Math.random() < 0.5 ? ((x => x)) : ((x => undefined)))), ((x => x) >x => x : (x: any) => any >x : any >x : any +>10 : number var lambda1: (x: number) => number = x => x; >lambda1 : (x: number) => number diff --git a/tests/baselines/reference/parenthesizedContexualTyping2.symbols b/tests/baselines/reference/parenthesizedContexualTyping2.symbols new file mode 100644 index 00000000000..f7616f07710 --- /dev/null +++ b/tests/baselines/reference/parenthesizedContexualTyping2.symbols @@ -0,0 +1,234 @@ +=== tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts === +// These tests ensure that in cases where it may *appear* that a value has a type, +// they actually are properly being contextually typed. The way we test this is +// that we invoke contextually typed arguments with type arguments. +// Since 'any' cannot be invoked with type arguments, we should get errors +// back if contextual typing is not taking effect. + +type FuncType = (x: (p: T) => T) => typeof x; +>FuncType : Symbol(FuncType, Decl(parenthesizedContexualTyping2.ts, 0, 0)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 6, 17)) +>T : Symbol(T, Decl(parenthesizedContexualTyping2.ts, 6, 21)) +>p : Symbol(p, Decl(parenthesizedContexualTyping2.ts, 6, 24)) +>T : Symbol(T, Decl(parenthesizedContexualTyping2.ts, 6, 21)) +>T : Symbol(T, Decl(parenthesizedContexualTyping2.ts, 6, 21)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 6, 17)) + +function fun(f: FuncType, x: T): T; +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>T : Symbol(T, Decl(parenthesizedContexualTyping2.ts, 8, 13)) +>f : Symbol(f, Decl(parenthesizedContexualTyping2.ts, 8, 16)) +>FuncType : Symbol(FuncType, Decl(parenthesizedContexualTyping2.ts, 0, 0)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 8, 28)) +>T : Symbol(T, Decl(parenthesizedContexualTyping2.ts, 8, 13)) +>T : Symbol(T, Decl(parenthesizedContexualTyping2.ts, 8, 13)) + +function fun(f: FuncType, g: FuncType, x: T): T; +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>T : Symbol(T, Decl(parenthesizedContexualTyping2.ts, 9, 13)) +>f : Symbol(f, Decl(parenthesizedContexualTyping2.ts, 9, 16)) +>FuncType : Symbol(FuncType, Decl(parenthesizedContexualTyping2.ts, 0, 0)) +>g : Symbol(g, Decl(parenthesizedContexualTyping2.ts, 9, 28)) +>FuncType : Symbol(FuncType, Decl(parenthesizedContexualTyping2.ts, 0, 0)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 9, 41)) +>T : Symbol(T, Decl(parenthesizedContexualTyping2.ts, 9, 13)) +>T : Symbol(T, Decl(parenthesizedContexualTyping2.ts, 9, 13)) + +function fun(...rest: any[]): T { +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>T : Symbol(T, Decl(parenthesizedContexualTyping2.ts, 10, 13)) +>rest : Symbol(rest, Decl(parenthesizedContexualTyping2.ts, 10, 16)) +>T : Symbol(T, Decl(parenthesizedContexualTyping2.ts, 10, 13)) + + return undefined; +>undefined : Symbol(undefined) +} + +var a = fun(x => { x(undefined); return x; }, 10); +>a : Symbol(a, Decl(parenthesizedContexualTyping2.ts, 14, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 14, 12)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 14, 12)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 14, 12)) + +var b = fun((x => { x(undefined); return x; }), 10); +>b : Symbol(b, Decl(parenthesizedContexualTyping2.ts, 15, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 15, 13)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 15, 13)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 15, 13)) + +var c = fun(((x => { x(undefined); return x; })), 10); +>c : Symbol(c, Decl(parenthesizedContexualTyping2.ts, 16, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 16, 14)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 16, 14)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 16, 14)) + +var d = fun((((x => { x(undefined); return x; }))), 10); +>d : Symbol(d, Decl(parenthesizedContexualTyping2.ts, 17, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 17, 15)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 17, 15)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 17, 15)) + +var e = fun(x => { x(undefined); return x; }, x => { x(undefined); return x; }, 10); +>e : Symbol(e, Decl(parenthesizedContexualTyping2.ts, 19, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 19, 12)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 19, 12)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 19, 12)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 19, 53)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 19, 53)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 19, 53)) + +var f = fun((x => { x(undefined); return x; }),(x => { x(undefined); return x; }), 10); +>f : Symbol(f, Decl(parenthesizedContexualTyping2.ts, 20, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 20, 13)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 20, 13)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 20, 13)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 20, 56)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 20, 56)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 20, 56)) + +var g = fun(((x => { x(undefined); return x; })),((x => { x(undefined); return x; })), 10); +>g : Symbol(g, Decl(parenthesizedContexualTyping2.ts, 21, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 21, 14)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 21, 14)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 21, 14)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 21, 59)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 21, 59)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 21, 59)) + +var h = fun((((x => { x(undefined); return x; }))),((x => { x(undefined); return x; })), 10); +>h : Symbol(h, Decl(parenthesizedContexualTyping2.ts, 22, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 22, 15)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 22, 15)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 22, 15)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 22, 61)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 22, 61)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 22, 61)) + +// Ternaries in parens +var i = fun((Math.random() < 0.5 ? x => { x(undefined); return x; } : x => undefined), 10); +>i : Symbol(i, Decl(parenthesizedContexualTyping2.ts, 25, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 25, 34)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 25, 34)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 25, 34)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 25, 77)) +>undefined : Symbol(undefined) + +var j = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), 10); +>j : Symbol(j, Decl(parenthesizedContexualTyping2.ts, 26, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 26, 36)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 26, 36)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 26, 36)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 26, 81)) +>undefined : Symbol(undefined) + +var k = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), x => { x(undefined); return x; }, 10); +>k : Symbol(k, Decl(parenthesizedContexualTyping2.ts, 27, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 27, 36)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 27, 36)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 27, 36)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 27, 81)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 27, 98)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 27, 98)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 27, 98)) + +var l = fun(((Math.random() < 0.5 ? ((x => { x(undefined); return x; })) : ((x => undefined)))),((x => { x(undefined); return x; })), 10); +>l : Symbol(l, Decl(parenthesizedContexualTyping2.ts, 28, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 28, 38)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 28, 38)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 28, 38)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 28, 85)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 28, 106)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 28, 106)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 28, 106)) + +var lambda1: FuncType = x => { x(undefined); return x; }; +>lambda1 : Symbol(lambda1, Decl(parenthesizedContexualTyping2.ts, 30, 3)) +>FuncType : Symbol(FuncType, Decl(parenthesizedContexualTyping2.ts, 0, 0)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 30, 23)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 30, 23)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 30, 23)) + +var lambda2: FuncType = (x => { x(undefined); return x; }); +>lambda2 : Symbol(lambda2, Decl(parenthesizedContexualTyping2.ts, 31, 3)) +>FuncType : Symbol(FuncType, Decl(parenthesizedContexualTyping2.ts, 0, 0)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 31, 25)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 31, 25)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 31, 25)) + +type ObjType = { x: (p: number) => string; y: (p: string) => number }; +>ObjType : Symbol(ObjType, Decl(parenthesizedContexualTyping2.ts, 31, 67)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 33, 16)) +>p : Symbol(p, Decl(parenthesizedContexualTyping2.ts, 33, 21)) +>y : Symbol(y, Decl(parenthesizedContexualTyping2.ts, 33, 42)) +>p : Symbol(p, Decl(parenthesizedContexualTyping2.ts, 33, 47)) + +var obj1: ObjType = { x: x => (x, undefined), y: y => (y, undefined) }; +>obj1 : Symbol(obj1, Decl(parenthesizedContexualTyping2.ts, 34, 3)) +>ObjType : Symbol(ObjType, Decl(parenthesizedContexualTyping2.ts, 31, 67)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 34, 21)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 34, 24)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 34, 24)) +>undefined : Symbol(undefined) +>y : Symbol(y, Decl(parenthesizedContexualTyping2.ts, 34, 45)) +>y : Symbol(y, Decl(parenthesizedContexualTyping2.ts, 34, 48)) +>y : Symbol(y, Decl(parenthesizedContexualTyping2.ts, 34, 48)) +>undefined : Symbol(undefined) + +var obj2: ObjType = ({ x: x => (x, undefined), y: y => (y, undefined) }); +>obj2 : Symbol(obj2, Decl(parenthesizedContexualTyping2.ts, 35, 3)) +>ObjType : Symbol(ObjType, Decl(parenthesizedContexualTyping2.ts, 31, 67)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 35, 22)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 35, 25)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 35, 25)) +>undefined : Symbol(undefined) +>y : Symbol(y, Decl(parenthesizedContexualTyping2.ts, 35, 46)) +>y : Symbol(y, Decl(parenthesizedContexualTyping2.ts, 35, 49)) +>y : Symbol(y, Decl(parenthesizedContexualTyping2.ts, 35, 49)) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/parenthesizedContexualTyping2.types b/tests/baselines/reference/parenthesizedContexualTyping2.types index 6824cc0f6e9..a055f2f1bbd 100644 --- a/tests/baselines/reference/parenthesizedContexualTyping2.types +++ b/tests/baselines/reference/parenthesizedContexualTyping2.types @@ -54,6 +54,7 @@ var a = fun(x => { x(undefined); return x; }, 10); >x : (p: T) => T >undefined : undefined >x : (p: T) => T +>10 : number var b = fun((x => { x(undefined); return x; }), 10); >b : number @@ -66,6 +67,7 @@ var b = fun((x => { x(undefined); return x; }), 10); >x : (p: T) => T >undefined : undefined >x : (p: T) => T +>10 : number var c = fun(((x => { x(undefined); return x; })), 10); >c : number @@ -79,6 +81,7 @@ var c = fun(((x => { x(undefined); return x; })), 10); >x : (p: T) => T >undefined : undefined >x : (p: T) => T +>10 : number var d = fun((((x => { x(undefined); return x; }))), 10); >d : number @@ -93,6 +96,7 @@ var d = fun((((x => { x(undefined); return x; }))), 10); >x : (p: T) => T >undefined : undefined >x : (p: T) => T +>10 : number var e = fun(x => { x(undefined); return x; }, x => { x(undefined); return x; }, 10); >e : number @@ -110,6 +114,7 @@ var e = fun(x => { x(undefined); return x; }, x => { x(undefined >x : (p: T) => T >undefined : undefined >x : (p: T) => T +>10 : number var f = fun((x => { x(undefined); return x; }),(x => { x(undefined); return x; }), 10); >f : number @@ -129,6 +134,7 @@ var f = fun((x => { x(undefined); return x; }),(x => { x(undefin >x : (p: T) => T >undefined : undefined >x : (p: T) => T +>10 : number var g = fun(((x => { x(undefined); return x; })),((x => { x(undefined); return x; })), 10); >g : number @@ -150,6 +156,7 @@ var g = fun(((x => { x(undefined); return x; })),((x => { x(unde >x : (p: T) => T >undefined : undefined >x : (p: T) => T +>10 : number var h = fun((((x => { x(undefined); return x; }))),((x => { x(undefined); return x; })), 10); >h : number @@ -172,6 +179,7 @@ var h = fun((((x => { x(undefined); return x; }))),((x => { x(un >x : (p: T) => T >undefined : undefined >x : (p: T) => T +>10 : number // Ternaries in parens var i = fun((Math.random() < 0.5 ? x => { x(undefined); return x; } : x => undefined), 10); @@ -185,6 +193,7 @@ var i = fun((Math.random() < 0.5 ? x => { x(undefined); return x; } : x >Math.random : () => number >Math : Math >random : () => number +>0.5 : number >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T >x : (p: T) => T >x(undefined) : number @@ -194,6 +203,7 @@ var i = fun((Math.random() < 0.5 ? x => { x(undefined); return x; } : x >x => undefined : (x: (p: T) => T) => any >x : (p: T) => T >undefined : undefined +>10 : number var j = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), 10); >j : number @@ -206,6 +216,7 @@ var j = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : >Math.random : () => number >Math : Math >random : () => number +>0.5 : number >(x => { x(undefined); return x; }) : (x: (p: T) => T) => (p: T) => T >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T >x : (p: T) => T @@ -217,6 +228,7 @@ var j = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : >x => undefined : (x: (p: T) => T) => any >x : (p: T) => T >undefined : undefined +>10 : number var k = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), x => { x(undefined); return x; }, 10); >k : number @@ -229,6 +241,7 @@ var k = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : >Math.random : () => number >Math : Math >random : () => number +>0.5 : number >(x => { x(undefined); return x; }) : (x: (p: T) => T) => (p: T) => T >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T >x : (p: T) => T @@ -246,6 +259,7 @@ var k = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : >x : (p: T) => T >undefined : undefined >x : (p: T) => T +>10 : number var l = fun(((Math.random() < 0.5 ? ((x => { x(undefined); return x; })) : ((x => undefined)))),((x => { x(undefined); return x; })), 10); >l : number @@ -259,6 +273,7 @@ var l = fun(((Math.random() < 0.5 ? ((x => { x(undefined); return x; })) >Math.random : () => number >Math : Math >random : () => number +>0.5 : number >((x => { x(undefined); return x; })) : (x: (p: T) => T) => (p: T) => T >(x => { x(undefined); return x; }) : (x: (p: T) => T) => (p: T) => T >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T @@ -280,6 +295,7 @@ var l = fun(((Math.random() < 0.5 ? ((x => { x(undefined); return x; })) >x : (p: T) => T >undefined : undefined >x : (p: T) => T +>10 : number var lambda1: FuncType = x => { x(undefined); return x; }; >lambda1 : (x: (p: T) => T) => (p: T) => T diff --git a/tests/baselines/reference/parenthesizedContexualTyping3.symbols b/tests/baselines/reference/parenthesizedContexualTyping3.symbols new file mode 100644 index 00000000000..b0d696e2d21 --- /dev/null +++ b/tests/baselines/reference/parenthesizedContexualTyping3.symbols @@ -0,0 +1,114 @@ +=== tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping3.ts === + +// Contextual typing for parenthesized substitution expressions in tagged templates. + +/** + * tempFun - Can't have fun for too long. + */ +function tempFun(tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T; +>tempFun : Symbol(tempFun, Decl(parenthesizedContexualTyping3.ts, 0, 0), Decl(parenthesizedContexualTyping3.ts, 6, 77), Decl(parenthesizedContexualTyping3.ts, 7, 93)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 6, 17)) +>tempStrs : Symbol(tempStrs, Decl(parenthesizedContexualTyping3.ts, 6, 20)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.d.ts, 518, 38)) +>g : Symbol(g, Decl(parenthesizedContexualTyping3.ts, 6, 51)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 6, 56)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 6, 17)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 6, 17)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 6, 67)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 6, 17)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 6, 17)) + +function tempFun(tempStrs: TemplateStringsArray, g: (x: T) => T, h: (y: T) => T, x: T): T; +>tempFun : Symbol(tempFun, Decl(parenthesizedContexualTyping3.ts, 0, 0), Decl(parenthesizedContexualTyping3.ts, 6, 77), Decl(parenthesizedContexualTyping3.ts, 7, 93)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 7, 17)) +>tempStrs : Symbol(tempStrs, Decl(parenthesizedContexualTyping3.ts, 7, 20)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.d.ts, 518, 38)) +>g : Symbol(g, Decl(parenthesizedContexualTyping3.ts, 7, 51)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 7, 56)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 7, 17)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 7, 17)) +>h : Symbol(h, Decl(parenthesizedContexualTyping3.ts, 7, 67)) +>y : Symbol(y, Decl(parenthesizedContexualTyping3.ts, 7, 72)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 7, 17)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 7, 17)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 7, 83)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 7, 17)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 7, 17)) + +function tempFun(tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T { +>tempFun : Symbol(tempFun, Decl(parenthesizedContexualTyping3.ts, 0, 0), Decl(parenthesizedContexualTyping3.ts, 6, 77), Decl(parenthesizedContexualTyping3.ts, 7, 93)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 8, 17)) +>tempStrs : Symbol(tempStrs, Decl(parenthesizedContexualTyping3.ts, 8, 20)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.d.ts, 518, 38)) +>g : Symbol(g, Decl(parenthesizedContexualTyping3.ts, 8, 51)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 8, 56)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 8, 17)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 8, 17)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 8, 67)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 8, 17)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 8, 17)) + + return g(x); +>g : Symbol(g, Decl(parenthesizedContexualTyping3.ts, 8, 51)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 8, 67)) +} + +var a = tempFun `${ x => x } ${ 10 }` +>a : Symbol(a, Decl(parenthesizedContexualTyping3.ts, 12, 3)) +>tempFun : Symbol(tempFun, Decl(parenthesizedContexualTyping3.ts, 0, 0), Decl(parenthesizedContexualTyping3.ts, 6, 77), Decl(parenthesizedContexualTyping3.ts, 7, 93)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 12, 19)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 12, 19)) + +var b = tempFun `${ (x => x) } ${ 10 }` +>b : Symbol(b, Decl(parenthesizedContexualTyping3.ts, 13, 3)) +>tempFun : Symbol(tempFun, Decl(parenthesizedContexualTyping3.ts, 0, 0), Decl(parenthesizedContexualTyping3.ts, 6, 77), Decl(parenthesizedContexualTyping3.ts, 7, 93)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 13, 21)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 13, 21)) + +var c = tempFun `${ ((x => x)) } ${ 10 }` +>c : Symbol(c, Decl(parenthesizedContexualTyping3.ts, 14, 3)) +>tempFun : Symbol(tempFun, Decl(parenthesizedContexualTyping3.ts, 0, 0), Decl(parenthesizedContexualTyping3.ts, 6, 77), Decl(parenthesizedContexualTyping3.ts, 7, 93)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 14, 22)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 14, 22)) + +var d = tempFun `${ x => x } ${ x => x } ${ 10 }` +>d : Symbol(d, Decl(parenthesizedContexualTyping3.ts, 15, 3)) +>tempFun : Symbol(tempFun, Decl(parenthesizedContexualTyping3.ts, 0, 0), Decl(parenthesizedContexualTyping3.ts, 6, 77), Decl(parenthesizedContexualTyping3.ts, 7, 93)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 15, 19)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 15, 19)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 15, 31)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 15, 31)) + +var e = tempFun `${ x => x } ${ (x => x) } ${ 10 }` +>e : Symbol(e, Decl(parenthesizedContexualTyping3.ts, 16, 3)) +>tempFun : Symbol(tempFun, Decl(parenthesizedContexualTyping3.ts, 0, 0), Decl(parenthesizedContexualTyping3.ts, 6, 77), Decl(parenthesizedContexualTyping3.ts, 7, 93)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 16, 19)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 16, 19)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 16, 33)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 16, 33)) + +var f = tempFun `${ x => x } ${ ((x => x)) } ${ 10 }` +>f : Symbol(f, Decl(parenthesizedContexualTyping3.ts, 17, 3)) +>tempFun : Symbol(tempFun, Decl(parenthesizedContexualTyping3.ts, 0, 0), Decl(parenthesizedContexualTyping3.ts, 6, 77), Decl(parenthesizedContexualTyping3.ts, 7, 93)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 17, 19)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 17, 19)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 17, 34)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 17, 34)) + +var g = tempFun `${ (x => x) } ${ (((x => x))) } ${ 10 }` +>g : Symbol(g, Decl(parenthesizedContexualTyping3.ts, 18, 3)) +>tempFun : Symbol(tempFun, Decl(parenthesizedContexualTyping3.ts, 0, 0), Decl(parenthesizedContexualTyping3.ts, 6, 77), Decl(parenthesizedContexualTyping3.ts, 7, 93)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 18, 21)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 18, 21)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 18, 37)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 18, 37)) + +var h = tempFun `${ (x => x) } ${ (((x => x))) } ${ undefined }` +>h : Symbol(h, Decl(parenthesizedContexualTyping3.ts, 19, 3)) +>tempFun : Symbol(tempFun, Decl(parenthesizedContexualTyping3.ts, 0, 0), Decl(parenthesizedContexualTyping3.ts, 6, 77), Decl(parenthesizedContexualTyping3.ts, 7, 93)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 19, 21)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 19, 21)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 19, 37)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 19, 37)) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/parenthesizedContexualTyping3.types b/tests/baselines/reference/parenthesizedContexualTyping3.types index 26c0207e523..5d424e5a7b0 100644 --- a/tests/baselines/reference/parenthesizedContexualTyping3.types +++ b/tests/baselines/reference/parenthesizedContexualTyping3.types @@ -56,41 +56,55 @@ function tempFun(tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T { var a = tempFun `${ x => x } ${ 10 }` >a : number +>tempFun `${ x => x } ${ 10 }` : number >tempFun : { (tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T; (tempStrs: TemplateStringsArray, g: (x: T) => T, h: (y: T) => T, x: T): T; } +>`${ x => x } ${ 10 }` : string >x => x : (x: number) => number >x : number >x : number +>10 : number var b = tempFun `${ (x => x) } ${ 10 }` >b : number +>tempFun `${ (x => x) } ${ 10 }` : number >tempFun : { (tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T; (tempStrs: TemplateStringsArray, g: (x: T) => T, h: (y: T) => T, x: T): T; } +>`${ (x => x) } ${ 10 }` : string >(x => x) : (x: number) => number >x => x : (x: number) => number >x : number >x : number +>10 : number var c = tempFun `${ ((x => x)) } ${ 10 }` >c : number +>tempFun `${ ((x => x)) } ${ 10 }` : number >tempFun : { (tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T; (tempStrs: TemplateStringsArray, g: (x: T) => T, h: (y: T) => T, x: T): T; } +>`${ ((x => x)) } ${ 10 }` : string >((x => x)) : (x: number) => number >(x => x) : (x: number) => number >x => x : (x: number) => number >x : number >x : number +>10 : number var d = tempFun `${ x => x } ${ x => x } ${ 10 }` >d : number +>tempFun `${ x => x } ${ x => x } ${ 10 }` : number >tempFun : { (tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T; (tempStrs: TemplateStringsArray, g: (x: T) => T, h: (y: T) => T, x: T): T; } +>`${ x => x } ${ x => x } ${ 10 }` : string >x => x : (x: number) => number >x : number >x : number >x => x : (x: number) => number >x : number >x : number +>10 : number var e = tempFun `${ x => x } ${ (x => x) } ${ 10 }` >e : number +>tempFun `${ x => x } ${ (x => x) } ${ 10 }` : number >tempFun : { (tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T; (tempStrs: TemplateStringsArray, g: (x: T) => T, h: (y: T) => T, x: T): T; } +>`${ x => x } ${ (x => x) } ${ 10 }` : string >x => x : (x: number) => number >x : number >x : number @@ -98,10 +112,13 @@ var e = tempFun `${ x => x } ${ (x => x) } ${ 10 }` >x => x : (x: number) => number >x : number >x : number +>10 : number var f = tempFun `${ x => x } ${ ((x => x)) } ${ 10 }` >f : number +>tempFun `${ x => x } ${ ((x => x)) } ${ 10 }` : number >tempFun : { (tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T; (tempStrs: TemplateStringsArray, g: (x: T) => T, h: (y: T) => T, x: T): T; } +>`${ x => x } ${ ((x => x)) } ${ 10 }` : string >x => x : (x: number) => number >x : number >x : number @@ -110,10 +127,13 @@ var f = tempFun `${ x => x } ${ ((x => x)) } ${ 10 }` >x => x : (x: number) => number >x : number >x : number +>10 : number var g = tempFun `${ (x => x) } ${ (((x => x))) } ${ 10 }` >g : number +>tempFun `${ (x => x) } ${ (((x => x))) } ${ 10 }` : number >tempFun : { (tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T; (tempStrs: TemplateStringsArray, g: (x: T) => T, h: (y: T) => T, x: T): T; } +>`${ (x => x) } ${ (((x => x))) } ${ 10 }` : string >(x => x) : (x: number) => number >x => x : (x: number) => number >x : number @@ -124,10 +144,13 @@ var g = tempFun `${ (x => x) } ${ (((x => x))) } ${ 10 }` >x => x : (x: number) => number >x : number >x : number +>10 : number var h = tempFun `${ (x => x) } ${ (((x => x))) } ${ undefined }` >h : any +>tempFun `${ (x => x) } ${ (((x => x))) } ${ undefined }` : any >tempFun : { (tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T; (tempStrs: TemplateStringsArray, g: (x: T) => T, h: (y: T) => T, x: T): T; } +>`${ (x => x) } ${ (((x => x))) } ${ undefined }` : string >(x => x) : (x: any) => any >x => x : (x: any) => any >x : any diff --git a/tests/baselines/reference/parenthesizedTypes.symbols b/tests/baselines/reference/parenthesizedTypes.symbols new file mode 100644 index 00000000000..ec0ec4e4c6f --- /dev/null +++ b/tests/baselines/reference/parenthesizedTypes.symbols @@ -0,0 +1,84 @@ +=== tests/cases/conformance/types/specifyingTypes/typeLiterals/parenthesizedTypes.ts === +var a: string; +>a : Symbol(a, Decl(parenthesizedTypes.ts, 0, 3), Decl(parenthesizedTypes.ts, 1, 3), Decl(parenthesizedTypes.ts, 2, 3), Decl(parenthesizedTypes.ts, 3, 3)) + +var a: (string); +>a : Symbol(a, Decl(parenthesizedTypes.ts, 0, 3), Decl(parenthesizedTypes.ts, 1, 3), Decl(parenthesizedTypes.ts, 2, 3), Decl(parenthesizedTypes.ts, 3, 3)) + +var a: ((string) | string | (((string)))); +>a : Symbol(a, Decl(parenthesizedTypes.ts, 0, 3), Decl(parenthesizedTypes.ts, 1, 3), Decl(parenthesizedTypes.ts, 2, 3), Decl(parenthesizedTypes.ts, 3, 3)) + +var a: ((((((((((((((((((((((((((((((((((((((((string)))))))))))))))))))))))))))))))))))))))); +>a : Symbol(a, Decl(parenthesizedTypes.ts, 0, 3), Decl(parenthesizedTypes.ts, 1, 3), Decl(parenthesizedTypes.ts, 2, 3), Decl(parenthesizedTypes.ts, 3, 3)) + +var b: (x: string) => string; +>b : Symbol(b, Decl(parenthesizedTypes.ts, 5, 3), Decl(parenthesizedTypes.ts, 6, 3)) +>x : Symbol(x, Decl(parenthesizedTypes.ts, 5, 8)) + +var b: ((x: (string)) => (string)); +>b : Symbol(b, Decl(parenthesizedTypes.ts, 5, 3), Decl(parenthesizedTypes.ts, 6, 3)) +>x : Symbol(x, Decl(parenthesizedTypes.ts, 6, 9)) + +var c: string[] | number[]; +>c : Symbol(c, Decl(parenthesizedTypes.ts, 8, 3), Decl(parenthesizedTypes.ts, 9, 3), Decl(parenthesizedTypes.ts, 10, 3)) + +var c: (string)[] | (number)[]; +>c : Symbol(c, Decl(parenthesizedTypes.ts, 8, 3), Decl(parenthesizedTypes.ts, 9, 3), Decl(parenthesizedTypes.ts, 10, 3)) + +var c: ((string)[]) | ((number)[]); +>c : Symbol(c, Decl(parenthesizedTypes.ts, 8, 3), Decl(parenthesizedTypes.ts, 9, 3), Decl(parenthesizedTypes.ts, 10, 3)) + +var d: (((x: string) => string) | ((x: number) => number))[]; +>d : Symbol(d, Decl(parenthesizedTypes.ts, 12, 3), Decl(parenthesizedTypes.ts, 13, 3), Decl(parenthesizedTypes.ts, 14, 3), Decl(parenthesizedTypes.ts, 15, 3), Decl(parenthesizedTypes.ts, 16, 3)) +>x : Symbol(x, Decl(parenthesizedTypes.ts, 12, 10)) +>x : Symbol(x, Decl(parenthesizedTypes.ts, 12, 36)) + +var d: ({ (x: string): string } | { (x: number): number })[]; +>d : Symbol(d, Decl(parenthesizedTypes.ts, 12, 3), Decl(parenthesizedTypes.ts, 13, 3), Decl(parenthesizedTypes.ts, 14, 3), Decl(parenthesizedTypes.ts, 15, 3), Decl(parenthesizedTypes.ts, 16, 3)) +>x : Symbol(x, Decl(parenthesizedTypes.ts, 13, 11)) +>x : Symbol(x, Decl(parenthesizedTypes.ts, 13, 37)) + +var d: Array<((x: string) => string) | ((x: number) => number)>; +>d : Symbol(d, Decl(parenthesizedTypes.ts, 12, 3), Decl(parenthesizedTypes.ts, 13, 3), Decl(parenthesizedTypes.ts, 14, 3), Decl(parenthesizedTypes.ts, 15, 3), Decl(parenthesizedTypes.ts, 16, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>x : Symbol(x, Decl(parenthesizedTypes.ts, 14, 15)) +>x : Symbol(x, Decl(parenthesizedTypes.ts, 14, 41)) + +var d: Array<{ (x: string): string } | { (x: number): number }>; +>d : Symbol(d, Decl(parenthesizedTypes.ts, 12, 3), Decl(parenthesizedTypes.ts, 13, 3), Decl(parenthesizedTypes.ts, 14, 3), Decl(parenthesizedTypes.ts, 15, 3), Decl(parenthesizedTypes.ts, 16, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>x : Symbol(x, Decl(parenthesizedTypes.ts, 15, 16)) +>x : Symbol(x, Decl(parenthesizedTypes.ts, 15, 42)) + +var d: (Array<{ (x: string): string } | { (x: number): number }>); +>d : Symbol(d, Decl(parenthesizedTypes.ts, 12, 3), Decl(parenthesizedTypes.ts, 13, 3), Decl(parenthesizedTypes.ts, 14, 3), Decl(parenthesizedTypes.ts, 15, 3), Decl(parenthesizedTypes.ts, 16, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>x : Symbol(x, Decl(parenthesizedTypes.ts, 16, 17)) +>x : Symbol(x, Decl(parenthesizedTypes.ts, 16, 43)) + +var e: typeof a[]; +>e : Symbol(e, Decl(parenthesizedTypes.ts, 18, 3), Decl(parenthesizedTypes.ts, 19, 3)) +>a : Symbol(a, Decl(parenthesizedTypes.ts, 0, 3), Decl(parenthesizedTypes.ts, 1, 3), Decl(parenthesizedTypes.ts, 2, 3), Decl(parenthesizedTypes.ts, 3, 3)) + +var e: (typeof a)[]; +>e : Symbol(e, Decl(parenthesizedTypes.ts, 18, 3), Decl(parenthesizedTypes.ts, 19, 3)) +>a : Symbol(a, Decl(parenthesizedTypes.ts, 0, 3), Decl(parenthesizedTypes.ts, 1, 3), Decl(parenthesizedTypes.ts, 2, 3), Decl(parenthesizedTypes.ts, 3, 3)) + +var f: (string) => string; +>f : Symbol(f, Decl(parenthesizedTypes.ts, 21, 3), Decl(parenthesizedTypes.ts, 22, 3)) +>string : Symbol(string, Decl(parenthesizedTypes.ts, 21, 8)) + +var f: (string: any) => string; +>f : Symbol(f, Decl(parenthesizedTypes.ts, 21, 3), Decl(parenthesizedTypes.ts, 22, 3)) +>string : Symbol(string, Decl(parenthesizedTypes.ts, 22, 8)) + +var g: [string, string]; +>g : Symbol(g, Decl(parenthesizedTypes.ts, 24, 3), Decl(parenthesizedTypes.ts, 25, 3), Decl(parenthesizedTypes.ts, 26, 3)) + +var g: [(string), string]; +>g : Symbol(g, Decl(parenthesizedTypes.ts, 24, 3), Decl(parenthesizedTypes.ts, 25, 3), Decl(parenthesizedTypes.ts, 26, 3)) + +var g: [(string), (((typeof a)))]; +>g : Symbol(g, Decl(parenthesizedTypes.ts, 24, 3), Decl(parenthesizedTypes.ts, 25, 3), Decl(parenthesizedTypes.ts, 26, 3)) +>a : Symbol(a, Decl(parenthesizedTypes.ts, 0, 3), Decl(parenthesizedTypes.ts, 1, 3), Decl(parenthesizedTypes.ts, 2, 3), Decl(parenthesizedTypes.ts, 3, 3)) + diff --git a/tests/baselines/reference/parseShortform.symbols b/tests/baselines/reference/parseShortform.symbols new file mode 100644 index 00000000000..31310e7bbb7 --- /dev/null +++ b/tests/baselines/reference/parseShortform.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/parseShortform.ts === +interface I { +>I : Symbol(I, Decl(parseShortform.ts, 0, 0)) + + w: { +>w : Symbol(w, Decl(parseShortform.ts, 0, 13)) + + z: I; +>z : Symbol(z, Decl(parseShortform.ts, 1, 8)) +>I : Symbol(I, Decl(parseShortform.ts, 0, 0)) + + (): boolean; + [s: string]: { x: any; y: any; }; +>s : Symbol(s, Decl(parseShortform.ts, 4, 9)) +>x : Symbol(x, Decl(parseShortform.ts, 4, 22)) +>y : Symbol(y, Decl(parseShortform.ts, 4, 30)) + + [n: number]: { x: any; y: any; }; +>n : Symbol(n, Decl(parseShortform.ts, 5, 9)) +>x : Symbol(x, Decl(parseShortform.ts, 5, 22)) +>y : Symbol(y, Decl(parseShortform.ts, 5, 30)) + + }; + x: boolean; +>x : Symbol(x, Decl(parseShortform.ts, 6, 6)) + + y: (s: string) => boolean; +>y : Symbol(y, Decl(parseShortform.ts, 7, 15)) +>s : Symbol(s, Decl(parseShortform.ts, 8, 8)) + + z: I; +>z : Symbol(z, Decl(parseShortform.ts, 8, 30)) +>I : Symbol(I, Decl(parseShortform.ts, 0, 0)) +} diff --git a/tests/baselines/reference/parser10.1.1-8gs.errors.txt b/tests/baselines/reference/parser10.1.1-8gs.errors.txt index c396c982bb8..185665d23da 100644 --- a/tests/baselines/reference/parser10.1.1-8gs.errors.txt +++ b/tests/baselines/reference/parser10.1.1-8gs.errors.txt @@ -1,10 +1,8 @@ tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts(16,7): error TS2304: Cannot find name 'NotEarlyError'. -tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts(17,5): error TS1134: Variable declaration expected. -tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts(17,12): error TS1134: Variable declaration expected. -tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts(17,14): error TS1134: Variable declaration expected. +tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts(17,5): error TS1212: Identifier expected. 'public' is a reserved word in strict mode -==== tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts (4 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts (2 errors) ==== /// Copyright (c) 2012 Ecma International. All rights reserved. /// Ecma International makes this code available under the terms and conditions set /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the @@ -25,9 +23,5 @@ tests/cases/conformance/parser/ecmascript5/parser10.1.1-8gs.ts(17,14): error TS1 !!! error TS2304: Cannot find name 'NotEarlyError'. var public = 1; ~~~~~~ -!!! error TS1134: Variable declaration expected. - ~ -!!! error TS1134: Variable declaration expected. - ~ -!!! error TS1134: Variable declaration expected. +!!! error TS1212: Identifier expected. 'public' is a reserved word in strict mode \ No newline at end of file diff --git a/tests/baselines/reference/parser10.1.1-8gs.js b/tests/baselines/reference/parser10.1.1-8gs.js index 85227fab116..e7d342cf1f1 100644 --- a/tests/baselines/reference/parser10.1.1-8gs.js +++ b/tests/baselines/reference/parser10.1.1-8gs.js @@ -33,5 +33,4 @@ var public = 1; "use strict"; "use strict"; throw NotEarlyError; -var ; -1; +var public = 1; diff --git a/tests/baselines/reference/parser509668.errors.txt b/tests/baselines/reference/parser509668.errors.txt index 588bda6d91c..5ea380592ef 100644 --- a/tests/baselines/reference/parser509668.errors.txt +++ b/tests/baselines/reference/parser509668.errors.txt @@ -1,13 +1,10 @@ -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 (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509668.ts (1 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 a64c9c7b5b0..63c5d8a1a95 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() { + function Foo3(public) { var args = []; for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i]; diff --git a/tests/baselines/reference/parser509677.symbols b/tests/baselines/reference/parser509677.symbols new file mode 100644 index 00000000000..6d5f81e5c42 --- /dev/null +++ b/tests/baselines/reference/parser509677.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509677.ts === +var n: { y: string }; +>n : Symbol(n, Decl(parser509677.ts, 0, 3)) +>y : Symbol(y, Decl(parser509677.ts, 0, 8)) + diff --git a/tests/baselines/reference/parser537152.symbols b/tests/baselines/reference/parser537152.symbols new file mode 100644 index 00000000000..5aaaadc652a --- /dev/null +++ b/tests/baselines/reference/parser537152.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser537152.ts === +var t; +>t : Symbol(t, Decl(parser537152.ts, 0, 3)) + +var y = t.e1; +>y : Symbol(y, Decl(parser537152.ts, 1, 3)) +>t : Symbol(t, Decl(parser537152.ts, 0, 3)) + diff --git a/tests/baselines/reference/parser553699.errors.txt b/tests/baselines/reference/parser553699.errors.txt index 84bc6e60707..ea7e88cdf36 100644 --- a/tests/baselines/reference/parser553699.errors.txt +++ b/tests/baselines/reference/parser553699.errors.txt @@ -1,12 +1,15 @@ -tests/cases/conformance/parser/ecmascript5/RegressionTests/parser553699.ts(3,21): error TS1110: Type expected. +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser553699.ts(3,21): error TS1216: Type expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode. +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser553699.ts(3,21): error TS2304: Cannot find name 'public'. -==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser553699.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser553699.ts (2 errors) ==== class Foo { constructor() { } public banana (x: public) { } ~~~~~~ -!!! error TS1110: Type expected. +!!! error TS1216: Type expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode. + ~~~~~~ +!!! error TS2304: Cannot find name 'public'. } class Bar { diff --git a/tests/baselines/reference/parser553699.js b/tests/baselines/reference/parser553699.js index c4cc51bf5af..8570780e74a 100644 --- a/tests/baselines/reference/parser553699.js +++ b/tests/baselines/reference/parser553699.js @@ -12,7 +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/parser579071.symbols b/tests/baselines/reference/parser579071.symbols new file mode 100644 index 00000000000..5c14f161641 --- /dev/null +++ b/tests/baselines/reference/parser579071.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser579071.ts === +var x = /fo(o/; +>x : Symbol(x, Decl(parser579071.ts, 0, 3)) + diff --git a/tests/baselines/reference/parser579071.types b/tests/baselines/reference/parser579071.types index 6ae9576c036..bfdece6f787 100644 --- a/tests/baselines/reference/parser579071.types +++ b/tests/baselines/reference/parser579071.types @@ -1,4 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/RegressionTests/parser579071.ts === var x = /fo(o/; >x : RegExp +>/fo(o/ : RegExp diff --git a/tests/baselines/reference/parser596700.symbols b/tests/baselines/reference/parser596700.symbols new file mode 100644 index 00000000000..3109d5e4bed --- /dev/null +++ b/tests/baselines/reference/parser596700.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser596700.ts === +var regex2 = /[a-z/]$/i; +>regex2 : Symbol(regex2, Decl(parser596700.ts, 0, 3)) + diff --git a/tests/baselines/reference/parser596700.types b/tests/baselines/reference/parser596700.types index d92d4b68ef5..b14e28be716 100644 --- a/tests/baselines/reference/parser596700.types +++ b/tests/baselines/reference/parser596700.types @@ -1,4 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/RegressionTests/parser596700.ts === var regex2 = /[a-z/]$/i; >regex2 : RegExp +>/[a-z/]$/i : RegExp diff --git a/tests/baselines/reference/parser630933.symbols b/tests/baselines/reference/parser630933.symbols new file mode 100644 index 00000000000..70a069c3581 --- /dev/null +++ b/tests/baselines/reference/parser630933.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser630933.ts === +var a = "Hello"; +>a : Symbol(a, Decl(parser630933.ts, 0, 3)) + +var b = a.match(/\/ver=([^/]+)/); +>b : Symbol(b, Decl(parser630933.ts, 1, 3)) +>a.match : Symbol(String.match, Decl(lib.d.ts, 317, 40), Decl(lib.d.ts, 323, 44)) +>a : Symbol(a, Decl(parser630933.ts, 0, 3)) +>match : Symbol(String.match, Decl(lib.d.ts, 317, 40), Decl(lib.d.ts, 323, 44)) + diff --git a/tests/baselines/reference/parser630933.types b/tests/baselines/reference/parser630933.types index 4b1686fcbf2..3f991f58d30 100644 --- a/tests/baselines/reference/parser630933.types +++ b/tests/baselines/reference/parser630933.types @@ -1,6 +1,7 @@ === tests/cases/conformance/parser/ecmascript5/RegressionTests/parser630933.ts === var a = "Hello"; >a : string +>"Hello" : string var b = a.match(/\/ver=([^/]+)/); >b : RegExpMatchArray @@ -8,4 +9,5 @@ var b = a.match(/\/ver=([^/]+)/); >a.match : { (regexp: string): RegExpMatchArray; (regexp: RegExp): RegExpMatchArray; } >a : string >match : { (regexp: string): RegExpMatchArray; (regexp: RegExp): RegExpMatchArray; } +>/\/ver=([^/]+)/ : RegExp diff --git a/tests/baselines/reference/parser642331.errors.txt b/tests/baselines/reference/parser642331.errors.txt index fad38e66513..acff017d0ba 100644 --- a/tests/baselines/reference/parser642331.errors.txt +++ b/tests/baselines/reference/parser642331.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/RegressionTests/parser642331.ts(2,18): error TS1003: Identifier expected. +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser642331.ts(2,18): error TS1213: Identifier expected. 'static' is a reserved word in strict mode. Class definitions are automatically in strict mode. ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser642331.ts (1 errors) ==== class test { constructor (static) { } ~~~~~~ -!!! error TS1003: Identifier expected. +!!! error TS1213: Identifier expected. 'static' is a reserved word in strict mode. Class definitions are automatically in strict mode. } \ No newline at end of file diff --git a/tests/baselines/reference/parser642331.js b/tests/baselines/reference/parser642331.js index 3d88c096af3..056ea7dd384 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() { + function test(static) { } return test; })(); diff --git a/tests/baselines/reference/parser642331_1.errors.txt b/tests/baselines/reference/parser642331_1.errors.txt index c31cd9c5653..fe01123f865 100644 --- a/tests/baselines/reference/parser642331_1.errors.txt +++ b/tests/baselines/reference/parser642331_1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/RegressionTests/parser642331_1.ts(4,18): error TS1003: Identifier expected. +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser642331_1.ts(4,18): error TS1213: Identifier expected. 'static' is a reserved word in strict mode. Class definitions are automatically in strict mode. ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser642331_1.ts (1 errors) ==== @@ -7,6 +7,6 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser642331_1.ts(4,1 class test { constructor (static) { } ~~~~~~ -!!! error TS1003: Identifier expected. +!!! error TS1213: Identifier expected. 'static' is a reserved word in strict mode. Class definitions are automatically in strict mode. } \ No newline at end of file diff --git a/tests/baselines/reference/parser642331_1.js b/tests/baselines/reference/parser642331_1.js index d4de3c04d1d..83833ee6612 100644 --- a/tests/baselines/reference/parser642331_1.js +++ b/tests/baselines/reference/parser642331_1.js @@ -9,7 +9,7 @@ class test { //// [parser642331_1.js] "use strict"; var test = (function () { - function test() { + function test(static) { } return test; })(); diff --git a/tests/baselines/reference/parser643728.symbols b/tests/baselines/reference/parser643728.symbols new file mode 100644 index 00000000000..705e4b1ba9d --- /dev/null +++ b/tests/baselines/reference/parser643728.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser643728.ts === +interface C { +>C : Symbol(C, Decl(parser643728.ts, 0, 0)) + + foo; +>foo : Symbol(foo, Decl(parser643728.ts, 0, 13)) + + new; +>new : Symbol(new, Decl(parser643728.ts, 1, 8)) +} + diff --git a/tests/baselines/reference/parser645086_3.symbols b/tests/baselines/reference/parser645086_3.symbols new file mode 100644 index 00000000000..dfde84a9714 --- /dev/null +++ b/tests/baselines/reference/parser645086_3.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_3.ts === +var v = /[\]/]/ +>v : Symbol(v, Decl(parser645086_3.ts, 0, 3)) + diff --git a/tests/baselines/reference/parser645086_3.types b/tests/baselines/reference/parser645086_3.types index 57ca07e1b2a..8cf6c0e73a5 100644 --- a/tests/baselines/reference/parser645086_3.types +++ b/tests/baselines/reference/parser645086_3.types @@ -1,4 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_3.ts === var v = /[\]/]/ >v : RegExp +>/[\]/]/ : RegExp diff --git a/tests/baselines/reference/parser645086_4.symbols b/tests/baselines/reference/parser645086_4.symbols new file mode 100644 index 00000000000..3df8459dc38 --- /dev/null +++ b/tests/baselines/reference/parser645086_4.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_4.ts === +var v = /[^\]/]/ +>v : Symbol(v, Decl(parser645086_4.ts, 0, 3)) + diff --git a/tests/baselines/reference/parser645086_4.types b/tests/baselines/reference/parser645086_4.types index 01a702e2a06..a7c00b04fce 100644 --- a/tests/baselines/reference/parser645086_4.types +++ b/tests/baselines/reference/parser645086_4.types @@ -1,4 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_4.ts === var v = /[^\]/]/ >v : RegExp +>/[^\]/]/ : RegExp diff --git a/tests/baselines/reference/parser645484.symbols b/tests/baselines/reference/parser645484.symbols new file mode 100644 index 00000000000..6c8b71d547e --- /dev/null +++ b/tests/baselines/reference/parser645484.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645484.ts === +var c : { +>c : Symbol(c, Decl(parser645484.ts, 0, 3)) + + new?(): any; +>new : Symbol(new, Decl(parser645484.ts, 0, 9)) +} diff --git a/tests/baselines/reference/parser768531.symbols b/tests/baselines/reference/parser768531.symbols new file mode 100644 index 00000000000..2da2298c8e2 --- /dev/null +++ b/tests/baselines/reference/parser768531.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/Fuzz/parser768531.ts === +{a: 3} +No type information for this code./x/ +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parser768531.types b/tests/baselines/reference/parser768531.types index 2da2298c8e2..f1bcedefae9 100644 --- a/tests/baselines/reference/parser768531.types +++ b/tests/baselines/reference/parser768531.types @@ -1,4 +1,8 @@ === tests/cases/conformance/parser/ecmascript5/Fuzz/parser768531.ts === {a: 3} -No type information for this code./x/ -No type information for this code. \ No newline at end of file +>a : any +>3 : number + +/x/ +>/x/ : RegExp + diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic11.symbols b/tests/baselines/reference/parserAccessibilityAfterStatic11.symbols new file mode 100644 index 00000000000..602c5a01f37 --- /dev/null +++ b/tests/baselines/reference/parserAccessibilityAfterStatic11.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/AccessibilityAfterStatic/parserAccessibilityAfterStatic11.ts === +class Outer +>Outer : Symbol(Outer, Decl(parserAccessibilityAfterStatic11.ts, 0, 0)) +{ +static public() {} +>public : Symbol(Outer.public, Decl(parserAccessibilityAfterStatic11.ts, 1, 1)) +} + diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic14.symbols b/tests/baselines/reference/parserAccessibilityAfterStatic14.symbols new file mode 100644 index 00000000000..4a20a527ef1 --- /dev/null +++ b/tests/baselines/reference/parserAccessibilityAfterStatic14.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/AccessibilityAfterStatic/parserAccessibilityAfterStatic14.ts === +class Outer +>Outer : Symbol(Outer, Decl(parserAccessibilityAfterStatic14.ts, 0, 0)) +{ +static public() {} +>public : Symbol(Outer.public, Decl(parserAccessibilityAfterStatic14.ts, 1, 1)) +>T : Symbol(T, Decl(parserAccessibilityAfterStatic14.ts, 2, 14)) +} + diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic2.symbols b/tests/baselines/reference/parserAccessibilityAfterStatic2.symbols new file mode 100644 index 00000000000..9611c7b4955 --- /dev/null +++ b/tests/baselines/reference/parserAccessibilityAfterStatic2.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/AccessibilityAfterStatic/parserAccessibilityAfterStatic2.ts === +class Outer +>Outer : Symbol(Outer, Decl(parserAccessibilityAfterStatic2.ts, 0, 0)) +{ +static public; +>public : Symbol(Outer.public, Decl(parserAccessibilityAfterStatic2.ts, 1, 1)) +} + diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic3.symbols b/tests/baselines/reference/parserAccessibilityAfterStatic3.symbols new file mode 100644 index 00000000000..9c2027b065f --- /dev/null +++ b/tests/baselines/reference/parserAccessibilityAfterStatic3.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/AccessibilityAfterStatic/parserAccessibilityAfterStatic3.ts === +class Outer +>Outer : Symbol(Outer, Decl(parserAccessibilityAfterStatic3.ts, 0, 0)) +{ +static public = 1; +>public : Symbol(Outer.public, Decl(parserAccessibilityAfterStatic3.ts, 1, 1)) +} + diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic3.types b/tests/baselines/reference/parserAccessibilityAfterStatic3.types index b8eeb416c92..c85c5077392 100644 --- a/tests/baselines/reference/parserAccessibilityAfterStatic3.types +++ b/tests/baselines/reference/parserAccessibilityAfterStatic3.types @@ -4,5 +4,6 @@ class Outer { static public = 1; >public : number +>1 : number } diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic4.symbols b/tests/baselines/reference/parserAccessibilityAfterStatic4.symbols new file mode 100644 index 00000000000..fe872ea3fe3 --- /dev/null +++ b/tests/baselines/reference/parserAccessibilityAfterStatic4.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/AccessibilityAfterStatic/parserAccessibilityAfterStatic4.ts === +class Outer +>Outer : Symbol(Outer, Decl(parserAccessibilityAfterStatic4.ts, 0, 0)) +{ +static public: number; +>public : Symbol(Outer.public, Decl(parserAccessibilityAfterStatic4.ts, 1, 1)) +} + diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic5.symbols b/tests/baselines/reference/parserAccessibilityAfterStatic5.symbols new file mode 100644 index 00000000000..d1d0fd0da9a --- /dev/null +++ b/tests/baselines/reference/parserAccessibilityAfterStatic5.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/AccessibilityAfterStatic/parserAccessibilityAfterStatic5.ts === +class Outer +>Outer : Symbol(Outer, Decl(parserAccessibilityAfterStatic5.ts, 0, 0)) +{ +static public +>public : Symbol(Outer.public, Decl(parserAccessibilityAfterStatic5.ts, 1, 1)) +} + diff --git a/tests/baselines/reference/parserAccessors2.symbols b/tests/baselines/reference/parserAccessors2.symbols new file mode 100644 index 00000000000..d4371695610 --- /dev/null +++ b/tests/baselines/reference/parserAccessors2.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors2.ts === +class C { +>C : Symbol(C, Decl(parserAccessors2.ts, 0, 0)) + + set Foo(a) { } +>Foo : Symbol(Foo, Decl(parserAccessors2.ts, 0, 9)) +>a : Symbol(a, Decl(parserAccessors2.ts, 1, 12)) +} diff --git a/tests/baselines/reference/parserAccessors4.symbols b/tests/baselines/reference/parserAccessors4.symbols new file mode 100644 index 00000000000..e5dc9f1ecc3 --- /dev/null +++ b/tests/baselines/reference/parserAccessors4.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors4.ts === +var v = { set Foo(a) { } }; +>v : Symbol(v, Decl(parserAccessors4.ts, 0, 3)) +>Foo : Symbol(Foo, Decl(parserAccessors4.ts, 0, 9)) +>a : Symbol(a, Decl(parserAccessors4.ts, 0, 18)) + diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.symbols b/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.symbols new file mode 100644 index 00000000000..d5e039e3308 --- /dev/null +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator1.ts === +function f1() { +>f1 : Symbol(f1, Decl(parserAmbiguityWithBinaryOperator1.ts, 0, 0)) + + var a, b, c; +>a : Symbol(a, Decl(parserAmbiguityWithBinaryOperator1.ts, 1, 7)) +>b : Symbol(b, Decl(parserAmbiguityWithBinaryOperator1.ts, 1, 10)) +>c : Symbol(c, Decl(parserAmbiguityWithBinaryOperator1.ts, 1, 13)) + + if (a < b || b > (c + 1)) { } +>a : Symbol(a, Decl(parserAmbiguityWithBinaryOperator1.ts, 1, 7)) +>b : Symbol(b, Decl(parserAmbiguityWithBinaryOperator1.ts, 1, 10)) +>b : Symbol(b, Decl(parserAmbiguityWithBinaryOperator1.ts, 1, 10)) +>c : Symbol(c, Decl(parserAmbiguityWithBinaryOperator1.ts, 1, 13)) +} diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.types b/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.types index 1a087485e26..bdeb5ab7bbc 100644 --- a/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.types +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.types @@ -17,4 +17,5 @@ function f1() { >(c + 1) : any >c + 1 : any >c : any +>1 : number } diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.symbols b/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.symbols new file mode 100644 index 00000000000..4f5c7030dd3 --- /dev/null +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator2.ts === +function f() { +>f : Symbol(f, Decl(parserAmbiguityWithBinaryOperator2.ts, 0, 0)) + + var a, b, c; +>a : Symbol(a, Decl(parserAmbiguityWithBinaryOperator2.ts, 1, 7)) +>b : Symbol(b, Decl(parserAmbiguityWithBinaryOperator2.ts, 1, 10)) +>c : Symbol(c, Decl(parserAmbiguityWithBinaryOperator2.ts, 1, 13)) + + if (a < b && b > (c + 1)) { } +>a : Symbol(a, Decl(parserAmbiguityWithBinaryOperator2.ts, 1, 7)) +>b : Symbol(b, Decl(parserAmbiguityWithBinaryOperator2.ts, 1, 10)) +>b : Symbol(b, Decl(parserAmbiguityWithBinaryOperator2.ts, 1, 10)) +>c : Symbol(c, Decl(parserAmbiguityWithBinaryOperator2.ts, 1, 13)) +} diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.types b/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.types index 05ac7172cff..79eb212163e 100644 --- a/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.types +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.types @@ -17,4 +17,5 @@ function f() { >(c + 1) : any >c + 1 : any >c : any +>1 : number } diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.symbols b/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.symbols new file mode 100644 index 00000000000..0304a217b70 --- /dev/null +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.symbols @@ -0,0 +1,16 @@ +=== tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator3.ts === +function f() { +>f : Symbol(f, Decl(parserAmbiguityWithBinaryOperator3.ts, 0, 0)) + + var a, b, c; +>a : Symbol(a, Decl(parserAmbiguityWithBinaryOperator3.ts, 1, 7)) +>b : Symbol(b, Decl(parserAmbiguityWithBinaryOperator3.ts, 1, 10)) +>c : Symbol(c, Decl(parserAmbiguityWithBinaryOperator3.ts, 1, 13)) + + if (a < b && b < (c + 1)) { } +>a : Symbol(a, Decl(parserAmbiguityWithBinaryOperator3.ts, 1, 7)) +>b : Symbol(b, Decl(parserAmbiguityWithBinaryOperator3.ts, 1, 10)) +>b : Symbol(b, Decl(parserAmbiguityWithBinaryOperator3.ts, 1, 10)) +>c : Symbol(c, Decl(parserAmbiguityWithBinaryOperator3.ts, 1, 13)) +} + diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.types b/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.types index 03283115bf9..aba5f4872d8 100644 --- a/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.types +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.types @@ -17,5 +17,6 @@ function f() { >(c + 1) : any >c + 1 : any >c : any +>1 : number } diff --git a/tests/baselines/reference/parserArrayLiteralExpression1.symbols b/tests/baselines/reference/parserArrayLiteralExpression1.symbols new file mode 100644 index 00000000000..f34a932be80 --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression1.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression1.ts === +var v = []; +>v : Symbol(v, Decl(parserArrayLiteralExpression1.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression10.symbols b/tests/baselines/reference/parserArrayLiteralExpression10.symbols new file mode 100644 index 00000000000..1e29ca350fc --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression10.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression10.ts === +var v = [1,1,]; +>v : Symbol(v, Decl(parserArrayLiteralExpression10.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression10.types b/tests/baselines/reference/parserArrayLiteralExpression10.types index d324d42aa46..370e9fb6c9d 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression10.types +++ b/tests/baselines/reference/parserArrayLiteralExpression10.types @@ -2,4 +2,6 @@ var v = [1,1,]; >v : number[] >[1,1,] : number[] +>1 : number +>1 : number diff --git a/tests/baselines/reference/parserArrayLiteralExpression11.symbols b/tests/baselines/reference/parserArrayLiteralExpression11.symbols new file mode 100644 index 00000000000..eaa65c96295 --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression11.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression11.ts === +var v = [1,,1]; +>v : Symbol(v, Decl(parserArrayLiteralExpression11.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression11.types b/tests/baselines/reference/parserArrayLiteralExpression11.types index 44ac1f6c5aa..aba6e30a291 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression11.types +++ b/tests/baselines/reference/parserArrayLiteralExpression11.types @@ -2,4 +2,7 @@ var v = [1,,1]; >v : number[] >[1,,1] : number[] +>1 : number +> : undefined +>1 : number diff --git a/tests/baselines/reference/parserArrayLiteralExpression12.symbols b/tests/baselines/reference/parserArrayLiteralExpression12.symbols new file mode 100644 index 00000000000..76521e7d99e --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression12.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression12.ts === +var v = [1,,,1]; +>v : Symbol(v, Decl(parserArrayLiteralExpression12.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression12.types b/tests/baselines/reference/parserArrayLiteralExpression12.types index a2ea5f12404..7d9e4c38976 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression12.types +++ b/tests/baselines/reference/parserArrayLiteralExpression12.types @@ -2,4 +2,8 @@ var v = [1,,,1]; >v : number[] >[1,,,1] : number[] +>1 : number +> : undefined +> : undefined +>1 : number diff --git a/tests/baselines/reference/parserArrayLiteralExpression13.symbols b/tests/baselines/reference/parserArrayLiteralExpression13.symbols new file mode 100644 index 00000000000..4adf81f0681 --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression13.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression13.ts === +var v = [1,,1,,1]; +>v : Symbol(v, Decl(parserArrayLiteralExpression13.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression13.types b/tests/baselines/reference/parserArrayLiteralExpression13.types index bf8c15ac6b2..62fb9aea5f7 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression13.types +++ b/tests/baselines/reference/parserArrayLiteralExpression13.types @@ -2,4 +2,9 @@ var v = [1,,1,,1]; >v : number[] >[1,,1,,1] : number[] +>1 : number +> : undefined +>1 : number +> : undefined +>1 : number diff --git a/tests/baselines/reference/parserArrayLiteralExpression14.symbols b/tests/baselines/reference/parserArrayLiteralExpression14.symbols new file mode 100644 index 00000000000..bf9a4216139 --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression14.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression14.ts === +var v = [,,1,1,,1,,1,1,,1]; +>v : Symbol(v, Decl(parserArrayLiteralExpression14.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression14.types b/tests/baselines/reference/parserArrayLiteralExpression14.types index 4de3139c4b8..9d3a029aed2 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression14.types +++ b/tests/baselines/reference/parserArrayLiteralExpression14.types @@ -2,4 +2,15 @@ var v = [,,1,1,,1,,1,1,,1]; >v : number[] >[,,1,1,,1,,1,1,,1] : number[] +> : undefined +> : undefined +>1 : number +>1 : number +> : undefined +>1 : number +> : undefined +>1 : number +>1 : number +> : undefined +>1 : number diff --git a/tests/baselines/reference/parserArrayLiteralExpression15.symbols b/tests/baselines/reference/parserArrayLiteralExpression15.symbols new file mode 100644 index 00000000000..db99c902e06 --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression15.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression15.ts === +var v = [,,1,1,,1,,1,1,,1,]; +>v : Symbol(v, Decl(parserArrayLiteralExpression15.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression15.types b/tests/baselines/reference/parserArrayLiteralExpression15.types index b484c537f70..75afab3731c 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression15.types +++ b/tests/baselines/reference/parserArrayLiteralExpression15.types @@ -2,4 +2,15 @@ var v = [,,1,1,,1,,1,1,,1,]; >v : number[] >[,,1,1,,1,,1,1,,1,] : number[] +> : undefined +> : undefined +>1 : number +>1 : number +> : undefined +>1 : number +> : undefined +>1 : number +>1 : number +> : undefined +>1 : number diff --git a/tests/baselines/reference/parserArrayLiteralExpression2.symbols b/tests/baselines/reference/parserArrayLiteralExpression2.symbols new file mode 100644 index 00000000000..bdd45124e64 --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression2.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression2.ts === +var v = [,]; +>v : Symbol(v, Decl(parserArrayLiteralExpression2.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression2.types b/tests/baselines/reference/parserArrayLiteralExpression2.types index dd16681ab82..b810175ea13 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression2.types +++ b/tests/baselines/reference/parserArrayLiteralExpression2.types @@ -2,4 +2,5 @@ var v = [,]; >v : any[] >[,] : undefined[] +> : undefined diff --git a/tests/baselines/reference/parserArrayLiteralExpression3.symbols b/tests/baselines/reference/parserArrayLiteralExpression3.symbols new file mode 100644 index 00000000000..57c39445168 --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression3.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression3.ts === +var v = [,,]; +>v : Symbol(v, Decl(parserArrayLiteralExpression3.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression3.types b/tests/baselines/reference/parserArrayLiteralExpression3.types index d0fbaa9b67b..68e05498e13 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression3.types +++ b/tests/baselines/reference/parserArrayLiteralExpression3.types @@ -2,4 +2,6 @@ var v = [,,]; >v : any[] >[,,] : undefined[] +> : undefined +> : undefined diff --git a/tests/baselines/reference/parserArrayLiteralExpression4.symbols b/tests/baselines/reference/parserArrayLiteralExpression4.symbols new file mode 100644 index 00000000000..501ca155892 --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression4.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression4.ts === +var v = [,,,]; +>v : Symbol(v, Decl(parserArrayLiteralExpression4.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression4.types b/tests/baselines/reference/parserArrayLiteralExpression4.types index 0ceded3e62a..69f805ed5e2 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression4.types +++ b/tests/baselines/reference/parserArrayLiteralExpression4.types @@ -2,4 +2,7 @@ var v = [,,,]; >v : any[] >[,,,] : undefined[] +> : undefined +> : undefined +> : undefined diff --git a/tests/baselines/reference/parserArrayLiteralExpression5.symbols b/tests/baselines/reference/parserArrayLiteralExpression5.symbols new file mode 100644 index 00000000000..e01df8123ea --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression5.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression5.ts === +var v = [1]; +>v : Symbol(v, Decl(parserArrayLiteralExpression5.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression5.types b/tests/baselines/reference/parserArrayLiteralExpression5.types index b729f7fed86..48fdaa024fc 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression5.types +++ b/tests/baselines/reference/parserArrayLiteralExpression5.types @@ -2,4 +2,5 @@ var v = [1]; >v : number[] >[1] : number[] +>1 : number diff --git a/tests/baselines/reference/parserArrayLiteralExpression6.symbols b/tests/baselines/reference/parserArrayLiteralExpression6.symbols new file mode 100644 index 00000000000..07ab9430d94 --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression6.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression6.ts === +var v = [,1]; +>v : Symbol(v, Decl(parserArrayLiteralExpression6.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression6.types b/tests/baselines/reference/parserArrayLiteralExpression6.types index a72a8eda339..66df1cda219 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression6.types +++ b/tests/baselines/reference/parserArrayLiteralExpression6.types @@ -2,4 +2,6 @@ var v = [,1]; >v : number[] >[,1] : number[] +> : undefined +>1 : number diff --git a/tests/baselines/reference/parserArrayLiteralExpression7.symbols b/tests/baselines/reference/parserArrayLiteralExpression7.symbols new file mode 100644 index 00000000000..e8baf75f1f9 --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression7.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression7.ts === +var v = [1,]; +>v : Symbol(v, Decl(parserArrayLiteralExpression7.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression7.types b/tests/baselines/reference/parserArrayLiteralExpression7.types index ca8c5d6e890..65225500eb2 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression7.types +++ b/tests/baselines/reference/parserArrayLiteralExpression7.types @@ -2,4 +2,5 @@ var v = [1,]; >v : number[] >[1,] : number[] +>1 : number diff --git a/tests/baselines/reference/parserArrayLiteralExpression8.symbols b/tests/baselines/reference/parserArrayLiteralExpression8.symbols new file mode 100644 index 00000000000..a389e4381e7 --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression8.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression8.ts === +var v = [,1,]; +>v : Symbol(v, Decl(parserArrayLiteralExpression8.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression8.types b/tests/baselines/reference/parserArrayLiteralExpression8.types index 06824d77a1a..e14c99f3b57 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression8.types +++ b/tests/baselines/reference/parserArrayLiteralExpression8.types @@ -2,4 +2,6 @@ var v = [,1,]; >v : number[] >[,1,] : number[] +> : undefined +>1 : number diff --git a/tests/baselines/reference/parserArrayLiteralExpression9.symbols b/tests/baselines/reference/parserArrayLiteralExpression9.symbols new file mode 100644 index 00000000000..c5f4d38258a --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression9.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression9.ts === +var v = [1,1]; +>v : Symbol(v, Decl(parserArrayLiteralExpression9.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression9.types b/tests/baselines/reference/parserArrayLiteralExpression9.types index 7107f9e4090..96bb1595326 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression9.types +++ b/tests/baselines/reference/parserArrayLiteralExpression9.types @@ -2,4 +2,6 @@ var v = [1,1]; >v : number[] >[1,1] : number[] +>1 : number +>1 : number diff --git a/tests/baselines/reference/parserClassDeclaration16.symbols b/tests/baselines/reference/parserClassDeclaration16.symbols new file mode 100644 index 00000000000..770793b8ff9 --- /dev/null +++ b/tests/baselines/reference/parserClassDeclaration16.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration16.ts === +class C { +>C : Symbol(C, Decl(parserClassDeclaration16.ts, 0, 0)) + + foo(); +>foo : Symbol(foo, Decl(parserClassDeclaration16.ts, 0, 9), Decl(parserClassDeclaration16.ts, 1, 9)) + + foo() { } +>foo : Symbol(foo, Decl(parserClassDeclaration16.ts, 0, 9), Decl(parserClassDeclaration16.ts, 1, 9)) +} diff --git a/tests/baselines/reference/parserClassDeclaration17.symbols b/tests/baselines/reference/parserClassDeclaration17.symbols new file mode 100644 index 00000000000..7d230821d8a --- /dev/null +++ b/tests/baselines/reference/parserClassDeclaration17.symbols @@ -0,0 +1,17 @@ +=== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration17.ts === +declare class Enumerator { +>Enumerator : Symbol(Enumerator, Decl(parserClassDeclaration17.ts, 0, 0)) + + public atEnd(): boolean; +>atEnd : Symbol(atEnd, Decl(parserClassDeclaration17.ts, 0, 26)) + + public moveNext(); +>moveNext : Symbol(moveNext, Decl(parserClassDeclaration17.ts, 1, 28)) + + public item(): any; +>item : Symbol(item, Decl(parserClassDeclaration17.ts, 2, 22)) + + constructor (o: any); +>o : Symbol(o, Decl(parserClassDeclaration17.ts, 4, 17)) +} + diff --git a/tests/baselines/reference/parserClassDeclaration19.symbols b/tests/baselines/reference/parserClassDeclaration19.symbols new file mode 100644 index 00000000000..e9ac1a666c7 --- /dev/null +++ b/tests/baselines/reference/parserClassDeclaration19.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration19.ts === +class C { +>C : Symbol(C, Decl(parserClassDeclaration19.ts, 0, 0)) + + foo(); +>foo : Symbol(foo, Decl(parserClassDeclaration19.ts, 0, 9), Decl(parserClassDeclaration19.ts, 1, 10)) + + "foo"() { } +} diff --git a/tests/baselines/reference/parserClassDeclaration20.symbols b/tests/baselines/reference/parserClassDeclaration20.symbols new file mode 100644 index 00000000000..52e83a3f10c --- /dev/null +++ b/tests/baselines/reference/parserClassDeclaration20.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration20.ts === +class C { +>C : Symbol(C, Decl(parserClassDeclaration20.ts, 0, 0)) + + 0(); + "0"() { } +} diff --git a/tests/baselines/reference/parserClassDeclaration23.symbols b/tests/baselines/reference/parserClassDeclaration23.symbols new file mode 100644 index 00000000000..17611f0ba1d --- /dev/null +++ b/tests/baselines/reference/parserClassDeclaration23.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration23.ts === +class C\u0032 { +>C\u0032 : Symbol(C\u0032, Decl(parserClassDeclaration23.ts, 0, 0)) +} diff --git a/tests/baselines/reference/parserClassDeclaration26.symbols b/tests/baselines/reference/parserClassDeclaration26.symbols new file mode 100644 index 00000000000..09b9cbfd3a4 --- /dev/null +++ b/tests/baselines/reference/parserClassDeclaration26.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration26.ts === +class C { +>C : Symbol(C, Decl(parserClassDeclaration26.ts, 0, 0)) + + var +>var : Symbol(var, Decl(parserClassDeclaration26.ts, 0, 9)) + + public +>public : Symbol(public, Decl(parserClassDeclaration26.ts, 1, 6)) +} diff --git a/tests/baselines/reference/parserClassDeclaration7.d.symbols b/tests/baselines/reference/parserClassDeclaration7.d.symbols new file mode 100644 index 00000000000..33661b00743 --- /dev/null +++ b/tests/baselines/reference/parserClassDeclaration7.d.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration7.d.ts === +declare class C { +>C : Symbol(C, Decl(parserClassDeclaration7.d.ts, 0, 0)) +} diff --git a/tests/baselines/reference/parserClassDeclarationIndexSignature1.symbols b/tests/baselines/reference/parserClassDeclarationIndexSignature1.symbols new file mode 100644 index 00000000000..bfa75f56ab5 --- /dev/null +++ b/tests/baselines/reference/parserClassDeclarationIndexSignature1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclarationIndexSignature1.ts === +class C { +>C : Symbol(C, Decl(parserClassDeclarationIndexSignature1.ts, 0, 0)) + + [index:number]:number +>index : Symbol(index, Decl(parserClassDeclarationIndexSignature1.ts, 1, 5)) +} diff --git a/tests/baselines/reference/parserCommaInTypeMemberList1.symbols b/tests/baselines/reference/parserCommaInTypeMemberList1.symbols new file mode 100644 index 00000000000..cbfeb6630e8 --- /dev/null +++ b/tests/baselines/reference/parserCommaInTypeMemberList1.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserCommaInTypeMemberList1.ts === +var v: { workItem: any, width: string }; +>v : Symbol(v, Decl(parserCommaInTypeMemberList1.ts, 0, 3)) +>workItem : Symbol(workItem, Decl(parserCommaInTypeMemberList1.ts, 0, 8)) +>width : Symbol(width, Decl(parserCommaInTypeMemberList1.ts, 0, 23)) + diff --git a/tests/baselines/reference/parserComputedPropertyName36.errors.txt b/tests/baselines/reference/parserComputedPropertyName36.errors.txt index 8c647be13c9..6bcb5b52789 100644 --- a/tests/baselines/reference/parserComputedPropertyName36.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName36.errors.txt @@ -1,15 +1,15 @@ -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName36.ts(2,6): error TS1109: Expression expected. -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName36.ts(2,13): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName36.ts(2,14): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName36.ts(2,5): error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName36.ts(2,6): error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName36.ts(2,6): error TS2304: Cannot find name 'public'. ==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName36.ts (3 errors) ==== class C { [public ]: string; + ~~~~~~~~~ +!!! error TS1166: A computed property name in a class property declaration must directly refer to a built-in symbol. ~~~~~~ -!!! error TS1109: Expression expected. - ~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - ~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. +!!! error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode. + ~~~~~~ +!!! error TS2304: Cannot find name 'public'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName38.errors.txt b/tests/baselines/reference/parserComputedPropertyName38.errors.txt index 28daf322748..80589f1fde3 100644 --- a/tests/baselines/reference/parserComputedPropertyName38.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName38.errors.txt @@ -1,21 +1,12 @@ -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName38.ts(2,6): error TS1109: Expression expected. -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName38.ts(2,12): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName38.ts(2,13): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName38.ts(2,16): error TS1005: '=>' expected. -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName38.ts(3,1): error TS1128: Declaration or statement expected. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName38.ts(2,6): error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName38.ts(2,6): error TS2304: Cannot find name 'public'. -==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName38.ts (5 errors) ==== +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName38.ts (2 errors) ==== class C { [public]() { } ~~~~~~ -!!! error TS1109: Expression expected. - ~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - ~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - ~ -!!! error TS1005: '=>' expected. - } - ~ -!!! error TS1128: Declaration or statement expected. \ No newline at end of file +!!! error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode. + ~~~~~~ +!!! error TS2304: Cannot find name 'public'. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName38.js b/tests/baselines/reference/parserComputedPropertyName38.js index e47f5233a77..822695e5cfd 100644 --- a/tests/baselines/reference/parserComputedPropertyName38.js +++ b/tests/baselines/reference/parserComputedPropertyName38.js @@ -5,5 +5,5 @@ class C { //// [parserComputedPropertyName38.js] class C { + [public]() { } } -(() => { }); diff --git a/tests/baselines/reference/parserComputedPropertyName39.errors.txt b/tests/baselines/reference/parserComputedPropertyName39.errors.txt index 32d59ad2403..0213127f6d9 100644 --- a/tests/baselines/reference/parserComputedPropertyName39.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName39.errors.txt @@ -1,22 +1,13 @@ -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName39.ts(3,6): error TS1109: Expression expected. -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName39.ts(3,12): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName39.ts(3,13): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName39.ts(3,16): error TS1005: '=>' expected. -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName39.ts(4,1): error TS1128: Declaration or statement expected. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName39.ts(3,6): error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode. +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName39.ts(3,6): error TS2304: Cannot find name 'public'. -==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName39.ts (5 errors) ==== +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName39.ts (2 errors) ==== "use strict"; class C { [public]() { } ~~~~~~ -!!! error TS1109: Expression expected. - ~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - ~ -!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. - ~ -!!! error TS1005: '=>' expected. - } - ~ -!!! error TS1128: Declaration or statement expected. \ No newline at end of file +!!! error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode. + ~~~~~~ +!!! error TS2304: Cannot find name 'public'. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserComputedPropertyName39.js b/tests/baselines/reference/parserComputedPropertyName39.js index 541d1965385..8e2c4853bd3 100644 --- a/tests/baselines/reference/parserComputedPropertyName39.js +++ b/tests/baselines/reference/parserComputedPropertyName39.js @@ -7,5 +7,5 @@ class C { //// [parserComputedPropertyName39.js] "use strict"; class C { + [public]() { } } -(() => { }); diff --git a/tests/baselines/reference/parserConstructorDeclaration1.symbols b/tests/baselines/reference/parserConstructorDeclaration1.symbols new file mode 100644 index 00000000000..de3fee278a9 --- /dev/null +++ b/tests/baselines/reference/parserConstructorDeclaration1.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/ConstructorDeclarations/parserConstructorDeclaration1.ts === +class C { +>C : Symbol(C, Decl(parserConstructorDeclaration1.ts, 0, 0)) + + public constructor() { } +} diff --git a/tests/baselines/reference/parserDebuggerStatement1.symbols b/tests/baselines/reference/parserDebuggerStatement1.symbols new file mode 100644 index 00000000000..bfc1785f927 --- /dev/null +++ b/tests/baselines/reference/parserDebuggerStatement1.symbols @@ -0,0 +1,3 @@ +=== tests/cases/conformance/parser/ecmascript5/parserDebuggerStatement1.ts === +debugger +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserDebuggerStatement2.symbols b/tests/baselines/reference/parserDebuggerStatement2.symbols new file mode 100644 index 00000000000..9916218897c --- /dev/null +++ b/tests/baselines/reference/parserDebuggerStatement2.symbols @@ -0,0 +1,3 @@ +=== tests/cases/conformance/parser/ecmascript5/parserDebuggerStatement2.ts === +debugger; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserDoStatement2.symbols b/tests/baselines/reference/parserDoStatement2.symbols new file mode 100644 index 00000000000..62790b49103 --- /dev/null +++ b/tests/baselines/reference/parserDoStatement2.symbols @@ -0,0 +1,3 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/parserDoStatement2.ts === +do{;}while(false)false +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserDoStatement2.types b/tests/baselines/reference/parserDoStatement2.types index 62790b49103..5affaa958d6 100644 --- a/tests/baselines/reference/parserDoStatement2.types +++ b/tests/baselines/reference/parserDoStatement2.types @@ -1,3 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/Statements/parserDoStatement2.ts === do{;}while(false)false -No type information for this code. \ No newline at end of file +>false : boolean +>false : boolean + diff --git a/tests/baselines/reference/parserES5ForOfStatement17.symbols b/tests/baselines/reference/parserES5ForOfStatement17.symbols new file mode 100644 index 00000000000..bf38276ebd7 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement17.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement17.ts === +for (var of; ;) { } +>of : Symbol(of, Decl(parserES5ForOfStatement17.ts, 0, 8)) + diff --git a/tests/baselines/reference/parserES5ForOfStatement18.symbols b/tests/baselines/reference/parserES5ForOfStatement18.symbols new file mode 100644 index 00000000000..830c1010a27 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement18.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement18.ts === +for (var of of of) { } +>of : Symbol(of, Decl(parserES5ForOfStatement18.ts, 0, 8)) +>of : Symbol(of, Decl(parserES5ForOfStatement18.ts, 0, 8)) + diff --git a/tests/baselines/reference/parserES5ForOfStatement19.symbols b/tests/baselines/reference/parserES5ForOfStatement19.symbols new file mode 100644 index 00000000000..93ba77e3db9 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement19.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement19.ts === +for (var of in of) { } +>of : Symbol(of, Decl(parserES5ForOfStatement19.ts, 0, 8)) +>of : Symbol(of, Decl(parserES5ForOfStatement19.ts, 0, 8)) + diff --git a/tests/baselines/reference/parserEmptyFile1.symbols b/tests/baselines/reference/parserEmptyFile1.symbols new file mode 100644 index 00000000000..d48ac0a4841 --- /dev/null +++ b/tests/baselines/reference/parserEmptyFile1.symbols @@ -0,0 +1,3 @@ +=== tests/cases/conformance/parser/ecmascript5/parserEmptyFile1.ts === + +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserEmptyStatement1.symbols b/tests/baselines/reference/parserEmptyStatement1.symbols new file mode 100644 index 00000000000..f9d6ed35645 --- /dev/null +++ b/tests/baselines/reference/parserEmptyStatement1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/parserEmptyStatement1.ts === +; ; +var a = 1; +>a : Symbol(a, Decl(parserEmptyStatement1.ts, 1, 3)) + +; + diff --git a/tests/baselines/reference/parserEmptyStatement1.types b/tests/baselines/reference/parserEmptyStatement1.types index 585c87f202b..a581dd6e871 100644 --- a/tests/baselines/reference/parserEmptyStatement1.types +++ b/tests/baselines/reference/parserEmptyStatement1.types @@ -2,6 +2,7 @@ ; ; var a = 1; >a : number +>1 : number ; diff --git a/tests/baselines/reference/parserEnum6.symbols b/tests/baselines/reference/parserEnum6.symbols new file mode 100644 index 00000000000..baee1886f24 --- /dev/null +++ b/tests/baselines/reference/parserEnum6.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum6.ts === +enum E { +>E : Symbol(E, Decl(parserEnum6.ts, 0, 0)) + + "A", "B", "C" +} diff --git a/tests/baselines/reference/parserEnumDeclaration1.symbols b/tests/baselines/reference/parserEnumDeclaration1.symbols new file mode 100644 index 00000000000..e3041443712 --- /dev/null +++ b/tests/baselines/reference/parserEnumDeclaration1.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnumDeclaration1.ts === +enum E { +>E : Symbol(E, Decl(parserEnumDeclaration1.ts, 0, 0)) + + Foo = 1, +>Foo : Symbol(E.Foo, Decl(parserEnumDeclaration1.ts, 0, 8)) + + Bar +>Bar : Symbol(E.Bar, Decl(parserEnumDeclaration1.ts, 1, 10)) +} diff --git a/tests/baselines/reference/parserEnumDeclaration1.types b/tests/baselines/reference/parserEnumDeclaration1.types index 86ac928d20f..de99855b310 100644 --- a/tests/baselines/reference/parserEnumDeclaration1.types +++ b/tests/baselines/reference/parserEnumDeclaration1.types @@ -4,6 +4,7 @@ enum E { Foo = 1, >Foo : E +>1 : number Bar >Bar : E diff --git a/tests/baselines/reference/parserEnumDeclaration2.d.symbols b/tests/baselines/reference/parserEnumDeclaration2.d.symbols new file mode 100644 index 00000000000..0b222a59c7a --- /dev/null +++ b/tests/baselines/reference/parserEnumDeclaration2.d.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnumDeclaration2.d.ts === +declare enum E { +>E : Symbol(E, Decl(parserEnumDeclaration2.d.ts, 0, 0)) +} diff --git a/tests/baselines/reference/parserEnumDeclaration3.symbols b/tests/baselines/reference/parserEnumDeclaration3.symbols new file mode 100644 index 00000000000..f0380b45030 --- /dev/null +++ b/tests/baselines/reference/parserEnumDeclaration3.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnumDeclaration3.ts === +declare enum E { +>E : Symbol(E, Decl(parserEnumDeclaration3.ts, 0, 0)) + + A = 1 +>A : Symbol(E.A, Decl(parserEnumDeclaration3.ts, 0, 16)) +} diff --git a/tests/baselines/reference/parserEnumDeclaration3.types b/tests/baselines/reference/parserEnumDeclaration3.types index a2a5542c060..b427a795eb6 100644 --- a/tests/baselines/reference/parserEnumDeclaration3.types +++ b/tests/baselines/reference/parserEnumDeclaration3.types @@ -4,4 +4,5 @@ declare enum E { A = 1 >A : E +>1 : number } diff --git a/tests/baselines/reference/parserEnumDeclaration5.symbols b/tests/baselines/reference/parserEnumDeclaration5.symbols new file mode 100644 index 00000000000..584f21e5e72 --- /dev/null +++ b/tests/baselines/reference/parserEnumDeclaration5.symbols @@ -0,0 +1,16 @@ +=== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnumDeclaration5.ts === +enum E { +>E : Symbol(E, Decl(parserEnumDeclaration5.ts, 0, 0)) + + A = 1, +>A : Symbol(E.A, Decl(parserEnumDeclaration5.ts, 0, 8)) + + B, +>B : Symbol(E.B, Decl(parserEnumDeclaration5.ts, 1, 10)) + + C = 2, +>C : Symbol(E.C, Decl(parserEnumDeclaration5.ts, 2, 6)) + + D +>D : Symbol(E.D, Decl(parserEnumDeclaration5.ts, 3, 10)) +} diff --git a/tests/baselines/reference/parserEnumDeclaration5.types b/tests/baselines/reference/parserEnumDeclaration5.types index be3559bd2b9..bbb596b7b0f 100644 --- a/tests/baselines/reference/parserEnumDeclaration5.types +++ b/tests/baselines/reference/parserEnumDeclaration5.types @@ -4,12 +4,14 @@ enum E { A = 1, >A : E +>1 : number B, >B : E C = 2, >C : E +>2 : number D >D : E diff --git a/tests/baselines/reference/parserExportAsFunctionIdentifier.symbols b/tests/baselines/reference/parserExportAsFunctionIdentifier.symbols new file mode 100644 index 00000000000..6d81e8fdae3 --- /dev/null +++ b/tests/baselines/reference/parserExportAsFunctionIdentifier.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/parser/ecmascript5/parserExportAsFunctionIdentifier.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(parserExportAsFunctionIdentifier.ts, 0, 0)) + + export(): string; +>export : Symbol(export, Decl(parserExportAsFunctionIdentifier.ts, 0, 15)) +} + +var f: Foo; +>f : Symbol(f, Decl(parserExportAsFunctionIdentifier.ts, 4, 3)) +>Foo : Symbol(Foo, Decl(parserExportAsFunctionIdentifier.ts, 0, 0)) + +var x = f.export(); +>x : Symbol(x, Decl(parserExportAsFunctionIdentifier.ts, 5, 3)) +>f.export : Symbol(Foo.export, Decl(parserExportAsFunctionIdentifier.ts, 0, 15)) +>f : Symbol(f, Decl(parserExportAsFunctionIdentifier.ts, 4, 3)) +>export : Symbol(Foo.export, Decl(parserExportAsFunctionIdentifier.ts, 0, 15)) + diff --git a/tests/baselines/reference/parserForOfStatement17.symbols b/tests/baselines/reference/parserForOfStatement17.symbols new file mode 100644 index 00000000000..d78fe45e237 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement17.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement17.ts === +for (var of; ;) { } +>of : Symbol(of, Decl(parserForOfStatement17.ts, 0, 8)) + diff --git a/tests/baselines/reference/parserForOfStatement18.symbols b/tests/baselines/reference/parserForOfStatement18.symbols new file mode 100644 index 00000000000..db661546219 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement18.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement18.ts === +for (var of of of) { } +>of : Symbol(of, Decl(parserForOfStatement18.ts, 0, 8)) +>of : Symbol(of, Decl(parserForOfStatement18.ts, 0, 8)) + diff --git a/tests/baselines/reference/parserForOfStatement19.symbols b/tests/baselines/reference/parserForOfStatement19.symbols new file mode 100644 index 00000000000..1e123349e13 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement19.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement19.ts === +for (var of in of) { } +>of : Symbol(of, Decl(parserForOfStatement19.ts, 0, 8)) +>of : Symbol(of, Decl(parserForOfStatement19.ts, 0, 8)) + diff --git a/tests/baselines/reference/parserFunctionDeclaration1.d.symbols b/tests/baselines/reference/parserFunctionDeclaration1.d.symbols new file mode 100644 index 00000000000..eaaa03c6bc0 --- /dev/null +++ b/tests/baselines/reference/parserFunctionDeclaration1.d.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration1.d.ts === +declare function F(); +>F : Symbol(F, Decl(parserFunctionDeclaration1.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/parserFunctionDeclaration5.symbols b/tests/baselines/reference/parserFunctionDeclaration5.symbols new file mode 100644 index 00000000000..9606dc35897 --- /dev/null +++ b/tests/baselines/reference/parserFunctionDeclaration5.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration5.ts === +function foo(); +>foo : Symbol(foo, Decl(parserFunctionDeclaration5.ts, 0, 0), Decl(parserFunctionDeclaration5.ts, 0, 15)) + +function foo() { } +>foo : Symbol(foo, Decl(parserFunctionDeclaration5.ts, 0, 0), Decl(parserFunctionDeclaration5.ts, 0, 15)) + diff --git a/tests/baselines/reference/parserFunctionDeclaration8.symbols b/tests/baselines/reference/parserFunctionDeclaration8.symbols new file mode 100644 index 00000000000..feccbdc7c4f --- /dev/null +++ b/tests/baselines/reference/parserFunctionDeclaration8.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration8.ts === +declare module M { +>M : Symbol(M, Decl(parserFunctionDeclaration8.ts, 0, 0)) + + function foo(); +>foo : Symbol(foo, Decl(parserFunctionDeclaration8.ts, 0, 18)) +} diff --git a/tests/baselines/reference/parserFunctionPropertyAssignment1.symbols b/tests/baselines/reference/parserFunctionPropertyAssignment1.symbols new file mode 100644 index 00000000000..01b555c5e85 --- /dev/null +++ b/tests/baselines/reference/parserFunctionPropertyAssignment1.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertyAssignments/parserFunctionPropertyAssignment1.ts === +var v = { foo() { } }; +>v : Symbol(v, Decl(parserFunctionPropertyAssignment1.ts, 0, 3)) +>foo : Symbol(foo, Decl(parserFunctionPropertyAssignment1.ts, 0, 9)) + diff --git a/tests/baselines/reference/parserFunctionPropertyAssignment2.symbols b/tests/baselines/reference/parserFunctionPropertyAssignment2.symbols new file mode 100644 index 00000000000..3cd2d8ab325 --- /dev/null +++ b/tests/baselines/reference/parserFunctionPropertyAssignment2.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertyAssignments/parserFunctionPropertyAssignment2.ts === +var v = { 0() { } }; +>v : Symbol(v, Decl(parserFunctionPropertyAssignment2.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserFunctionPropertyAssignment3.symbols b/tests/baselines/reference/parserFunctionPropertyAssignment3.symbols new file mode 100644 index 00000000000..9b3135c5ed0 --- /dev/null +++ b/tests/baselines/reference/parserFunctionPropertyAssignment3.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertyAssignments/parserFunctionPropertyAssignment3.ts === +var v = { "foo"() { } }; +>v : Symbol(v, Decl(parserFunctionPropertyAssignment3.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserFunctionPropertyAssignment4.symbols b/tests/baselines/reference/parserFunctionPropertyAssignment4.symbols new file mode 100644 index 00000000000..2cb8b652e33 --- /dev/null +++ b/tests/baselines/reference/parserFunctionPropertyAssignment4.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertyAssignments/parserFunctionPropertyAssignment4.ts === +var v = { 0() { } }; +>v : Symbol(v, Decl(parserFunctionPropertyAssignment4.ts, 0, 3)) +>T : Symbol(T, Decl(parserFunctionPropertyAssignment4.ts, 0, 12)) + diff --git a/tests/baselines/reference/parserGenericClass1.symbols b/tests/baselines/reference/parserGenericClass1.symbols new file mode 100644 index 00000000000..68d5f0a20a8 --- /dev/null +++ b/tests/baselines/reference/parserGenericClass1.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript5/Generics/parserGenericClass1.ts === +class C { +>C : Symbol(C, Decl(parserGenericClass1.ts, 0, 0)) +>T : Symbol(T, Decl(parserGenericClass1.ts, 0, 8)) +} diff --git a/tests/baselines/reference/parserGenericClass2.symbols b/tests/baselines/reference/parserGenericClass2.symbols new file mode 100644 index 00000000000..38672494701 --- /dev/null +++ b/tests/baselines/reference/parserGenericClass2.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/Generics/parserGenericClass2.ts === +class C { +>C : Symbol(C, Decl(parserGenericClass2.ts, 0, 0)) +>K : Symbol(K, Decl(parserGenericClass2.ts, 0, 8)) +>V : Symbol(V, Decl(parserGenericClass2.ts, 0, 10)) +} diff --git a/tests/baselines/reference/parserGenericConstraint1.symbols b/tests/baselines/reference/parserGenericConstraint1.symbols new file mode 100644 index 00000000000..ec6edf21257 --- /dev/null +++ b/tests/baselines/reference/parserGenericConstraint1.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript5/Generics/parserGenericConstraint1.ts === +class C { +>C : Symbol(C, Decl(parserGenericConstraint1.ts, 0, 0)) +>T : Symbol(T, Decl(parserGenericConstraint1.ts, 0, 8)) +} diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity1.symbols b/tests/baselines/reference/parserGreaterThanTokenAmbiguity1.symbols new file mode 100644 index 00000000000..62100969e99 --- /dev/null +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity1.symbols @@ -0,0 +1,3 @@ +=== tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity1.ts === +1 >> 2; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity1.types b/tests/baselines/reference/parserGreaterThanTokenAmbiguity1.types index 451ff65cdd9..0449fdda85a 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity1.types +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity1.types @@ -1,4 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity1.ts === 1 >> 2; >1 >> 2 : number +>1 : number +>2 : number diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.symbols b/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.symbols new file mode 100644 index 00000000000..daf18ee868d --- /dev/null +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity10.ts === +1 +No type information for this code.// before +No type information for this code.>>> // after +No type information for this code.2; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.types b/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.types index f58be05c966..8b3d5dd2ba3 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.types +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.types @@ -1,7 +1,10 @@ === tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity10.ts === 1 >1 // before>>> // after2 : number +>1 : number // before >>> // after 2; +>2 : number + diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.symbols b/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.symbols new file mode 100644 index 00000000000..f0ca1bc80c9 --- /dev/null +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity5.ts === +1 +No type information for this code.// before +No type information for this code.>> // after +No type information for this code.2; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.types b/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.types index 770d3fa611f..609901bfdd5 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.types +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.types @@ -1,7 +1,10 @@ === tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity5.ts === 1 >1 // before>> // after2 : number +>1 : number // before >> // after 2; +>2 : number + diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity6.symbols b/tests/baselines/reference/parserGreaterThanTokenAmbiguity6.symbols new file mode 100644 index 00000000000..4ea0d39b965 --- /dev/null +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity6.symbols @@ -0,0 +1,3 @@ +=== tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity6.ts === +1 >>> 2; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity6.types b/tests/baselines/reference/parserGreaterThanTokenAmbiguity6.types index fc7616eef90..e7aa311113c 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity6.types +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity6.types @@ -1,4 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity6.ts === 1 >>> 2; >1 >>> 2 : number +>1 : number +>2 : number diff --git a/tests/baselines/reference/parserIndexMemberDeclaration1.symbols b/tests/baselines/reference/parserIndexMemberDeclaration1.symbols new file mode 100644 index 00000000000..d942f90f17f --- /dev/null +++ b/tests/baselines/reference/parserIndexMemberDeclaration1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/IndexMemberDeclarations/parserIndexMemberDeclaration1.ts === +class C { +>C : Symbol(C, Decl(parserIndexMemberDeclaration1.ts, 0, 0)) + + [a: string]: number +>a : Symbol(a, Decl(parserIndexMemberDeclaration1.ts, 1, 4)) +} diff --git a/tests/baselines/reference/parserIndexMemberDeclaration2.symbols b/tests/baselines/reference/parserIndexMemberDeclaration2.symbols new file mode 100644 index 00000000000..1b42a8f8160 --- /dev/null +++ b/tests/baselines/reference/parserIndexMemberDeclaration2.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/parser/ecmascript5/IndexMemberDeclarations/parserIndexMemberDeclaration2.ts === +class C { +>C : Symbol(C, Decl(parserIndexMemberDeclaration2.ts, 0, 0)) + + [a: string]: number +>a : Symbol(a, Decl(parserIndexMemberDeclaration2.ts, 1, 4)) + + public v: number +>v : Symbol(v, Decl(parserIndexMemberDeclaration2.ts, 1, 22)) +} diff --git a/tests/baselines/reference/parserIndexMemberDeclaration3.symbols b/tests/baselines/reference/parserIndexMemberDeclaration3.symbols new file mode 100644 index 00000000000..6961a37f497 --- /dev/null +++ b/tests/baselines/reference/parserIndexMemberDeclaration3.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/parser/ecmascript5/IndexMemberDeclarations/parserIndexMemberDeclaration3.ts === +class C { +>C : Symbol(C, Decl(parserIndexMemberDeclaration3.ts, 0, 0)) + + [a: string]: number; +>a : Symbol(a, Decl(parserIndexMemberDeclaration3.ts, 1, 4)) + + public v: number +>v : Symbol(v, Decl(parserIndexMemberDeclaration3.ts, 1, 23)) +} diff --git a/tests/baselines/reference/parserIndexMemberDeclaration4.symbols b/tests/baselines/reference/parserIndexMemberDeclaration4.symbols new file mode 100644 index 00000000000..29b101d05d8 --- /dev/null +++ b/tests/baselines/reference/parserIndexMemberDeclaration4.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/IndexMemberDeclarations/parserIndexMemberDeclaration4.ts === +class C { +>C : Symbol(C, Decl(parserIndexMemberDeclaration4.ts, 0, 0)) + + [a: string]: number; public v: number +>a : Symbol(a, Decl(parserIndexMemberDeclaration4.ts, 1, 4)) +>v : Symbol(v, Decl(parserIndexMemberDeclaration4.ts, 1, 23)) +} diff --git a/tests/baselines/reference/parserInterfaceKeywordInEnum.symbols b/tests/baselines/reference/parserInterfaceKeywordInEnum.symbols new file mode 100644 index 00000000000..159d21a96b7 --- /dev/null +++ b/tests/baselines/reference/parserInterfaceKeywordInEnum.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserInterfaceKeywordInEnum.ts === +enum Bar { +>Bar : Symbol(Bar, Decl(parserInterfaceKeywordInEnum.ts, 0, 0)) + + interface, +>interface : Symbol(Bar.interface, Decl(parserInterfaceKeywordInEnum.ts, 0, 10)) +} + diff --git a/tests/baselines/reference/parserInterfaceKeywordInEnum1.symbols b/tests/baselines/reference/parserInterfaceKeywordInEnum1.symbols new file mode 100644 index 00000000000..2bbb8b87ea1 --- /dev/null +++ b/tests/baselines/reference/parserInterfaceKeywordInEnum1.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserInterfaceKeywordInEnum1.ts === +"use strict"; + +enum Bar { +>Bar : Symbol(Bar, Decl(parserInterfaceKeywordInEnum1.ts, 0, 13)) + + interface, +>interface : Symbol(Bar.interface, Decl(parserInterfaceKeywordInEnum1.ts, 2, 10)) +} + diff --git a/tests/baselines/reference/parserInterfaceKeywordInEnum1.types b/tests/baselines/reference/parserInterfaceKeywordInEnum1.types index f17bfeacf88..f6b613f3f60 100644 --- a/tests/baselines/reference/parserInterfaceKeywordInEnum1.types +++ b/tests/baselines/reference/parserInterfaceKeywordInEnum1.types @@ -1,5 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserInterfaceKeywordInEnum1.ts === "use strict"; +>"use strict" : string enum Bar { >Bar : Bar diff --git a/tests/baselines/reference/parserKeywordsAsIdentifierName1.symbols b/tests/baselines/reference/parserKeywordsAsIdentifierName1.symbols new file mode 100644 index 00000000000..67420930aff --- /dev/null +++ b/tests/baselines/reference/parserKeywordsAsIdentifierName1.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/parser/ecmascript5/parserKeywordsAsIdentifierName1.ts === +var big = { +>big : Symbol(big, Decl(parserKeywordsAsIdentifierName1.ts, 0, 3)) + + break : 0, +>break : Symbol(break, Decl(parserKeywordsAsIdentifierName1.ts, 0, 11)) + + super : 0, +>super : Symbol(super, Decl(parserKeywordsAsIdentifierName1.ts, 1, 13)) + + const : 0 +>const : Symbol(const, Decl(parserKeywordsAsIdentifierName1.ts, 2, 13)) +} + diff --git a/tests/baselines/reference/parserKeywordsAsIdentifierName1.types b/tests/baselines/reference/parserKeywordsAsIdentifierName1.types index e917dc76cf0..bc586e8a4bb 100644 --- a/tests/baselines/reference/parserKeywordsAsIdentifierName1.types +++ b/tests/baselines/reference/parserKeywordsAsIdentifierName1.types @@ -5,11 +5,14 @@ var big = { break : 0, >break : number +>0 : number super : 0, >super : number +>0 : number const : 0 >const : number +>0 : number } diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration4.symbols b/tests/baselines/reference/parserMemberAccessorDeclaration4.symbols new file mode 100644 index 00000000000..2750f28943e --- /dev/null +++ b/tests/baselines/reference/parserMemberAccessorDeclaration4.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration4.ts === +class C { +>C : Symbol(C, Decl(parserMemberAccessorDeclaration4.ts, 0, 0)) + + set a(i) { } +>a : Symbol(a, Decl(parserMemberAccessorDeclaration4.ts, 0, 9)) +>i : Symbol(i, Decl(parserMemberAccessorDeclaration4.ts, 1, 8)) +} diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration5.symbols b/tests/baselines/reference/parserMemberAccessorDeclaration5.symbols new file mode 100644 index 00000000000..ac343ff02b1 --- /dev/null +++ b/tests/baselines/reference/parserMemberAccessorDeclaration5.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration5.ts === +class C { +>C : Symbol(C, Decl(parserMemberAccessorDeclaration5.ts, 0, 0)) + + set "a"(i) { } +>i : Symbol(i, Decl(parserMemberAccessorDeclaration5.ts, 1, 10)) +} diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration6.symbols b/tests/baselines/reference/parserMemberAccessorDeclaration6.symbols new file mode 100644 index 00000000000..a4b4558e892 --- /dev/null +++ b/tests/baselines/reference/parserMemberAccessorDeclaration6.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration6.ts === +class C { +>C : Symbol(C, Decl(parserMemberAccessorDeclaration6.ts, 0, 0)) + + set 0(i) { } +>i : Symbol(i, Decl(parserMemberAccessorDeclaration6.ts, 1, 8)) +} diff --git a/tests/baselines/reference/parserMethodSignature1.symbols b/tests/baselines/reference/parserMethodSignature1.symbols new file mode 100644 index 00000000000..2c12a156ef0 --- /dev/null +++ b/tests/baselines/reference/parserMethodSignature1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/MethodSignatures/parserMethodSignature1.ts === +interface I { +>I : Symbol(I, Decl(parserMethodSignature1.ts, 0, 0)) + + A(); +>A : Symbol(A, Decl(parserMethodSignature1.ts, 0, 13)) +} diff --git a/tests/baselines/reference/parserMethodSignature10.symbols b/tests/baselines/reference/parserMethodSignature10.symbols new file mode 100644 index 00000000000..4cefa6c759e --- /dev/null +++ b/tests/baselines/reference/parserMethodSignature10.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/MethodSignatures/parserMethodSignature10.ts === +interface I { +>I : Symbol(I, Decl(parserMethodSignature10.ts, 0, 0)) + + 1?(); +} diff --git a/tests/baselines/reference/parserMethodSignature11.symbols b/tests/baselines/reference/parserMethodSignature11.symbols new file mode 100644 index 00000000000..3217eb47aec --- /dev/null +++ b/tests/baselines/reference/parserMethodSignature11.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/MethodSignatures/parserMethodSignature11.ts === +interface I { +>I : Symbol(I, Decl(parserMethodSignature11.ts, 0, 0)) + + 2(); +>T : Symbol(T, Decl(parserMethodSignature11.ts, 1, 4)) +} diff --git a/tests/baselines/reference/parserMethodSignature12.symbols b/tests/baselines/reference/parserMethodSignature12.symbols new file mode 100644 index 00000000000..364a89eb970 --- /dev/null +++ b/tests/baselines/reference/parserMethodSignature12.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/MethodSignatures/parserMethodSignature12.ts === +interface I { +>I : Symbol(I, Decl(parserMethodSignature12.ts, 0, 0)) + + 3?(); +>T : Symbol(T, Decl(parserMethodSignature12.ts, 1, 5)) +} diff --git a/tests/baselines/reference/parserMethodSignature2.symbols b/tests/baselines/reference/parserMethodSignature2.symbols new file mode 100644 index 00000000000..ba86c20293e --- /dev/null +++ b/tests/baselines/reference/parserMethodSignature2.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/MethodSignatures/parserMethodSignature2.ts === +interface I { +>I : Symbol(I, Decl(parserMethodSignature2.ts, 0, 0)) + + B?(); +>B : Symbol(B, Decl(parserMethodSignature2.ts, 0, 13)) +} diff --git a/tests/baselines/reference/parserMethodSignature3.symbols b/tests/baselines/reference/parserMethodSignature3.symbols new file mode 100644 index 00000000000..ce4c0f05561 --- /dev/null +++ b/tests/baselines/reference/parserMethodSignature3.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/MethodSignatures/parserMethodSignature3.ts === +interface I { +>I : Symbol(I, Decl(parserMethodSignature3.ts, 0, 0)) + + C(); +>C : Symbol(C, Decl(parserMethodSignature3.ts, 0, 13)) +>T : Symbol(T, Decl(parserMethodSignature3.ts, 1, 4)) +} diff --git a/tests/baselines/reference/parserMethodSignature4.symbols b/tests/baselines/reference/parserMethodSignature4.symbols new file mode 100644 index 00000000000..d1612bf2f4f --- /dev/null +++ b/tests/baselines/reference/parserMethodSignature4.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/MethodSignatures/parserMethodSignature4.ts === +interface I { +>I : Symbol(I, Decl(parserMethodSignature4.ts, 0, 0)) + + D?(); +>D : Symbol(D, Decl(parserMethodSignature4.ts, 0, 13)) +>T : Symbol(T, Decl(parserMethodSignature4.ts, 1, 5)) +} diff --git a/tests/baselines/reference/parserMethodSignature5.symbols b/tests/baselines/reference/parserMethodSignature5.symbols new file mode 100644 index 00000000000..8cf748ab50c --- /dev/null +++ b/tests/baselines/reference/parserMethodSignature5.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/MethodSignatures/parserMethodSignature5.ts === +interface I { +>I : Symbol(I, Decl(parserMethodSignature5.ts, 0, 0)) + + "E"(); +} diff --git a/tests/baselines/reference/parserMethodSignature6.symbols b/tests/baselines/reference/parserMethodSignature6.symbols new file mode 100644 index 00000000000..b15a3d9a4e2 --- /dev/null +++ b/tests/baselines/reference/parserMethodSignature6.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/MethodSignatures/parserMethodSignature6.ts === +interface I { +>I : Symbol(I, Decl(parserMethodSignature6.ts, 0, 0)) + + "F"?(); +} diff --git a/tests/baselines/reference/parserMethodSignature7.symbols b/tests/baselines/reference/parserMethodSignature7.symbols new file mode 100644 index 00000000000..3b275fa20cb --- /dev/null +++ b/tests/baselines/reference/parserMethodSignature7.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/MethodSignatures/parserMethodSignature7.ts === +interface I { +>I : Symbol(I, Decl(parserMethodSignature7.ts, 0, 0)) + + "G"(); +>T : Symbol(T, Decl(parserMethodSignature7.ts, 1, 6)) +} diff --git a/tests/baselines/reference/parserMethodSignature8.symbols b/tests/baselines/reference/parserMethodSignature8.symbols new file mode 100644 index 00000000000..9fe0a7d64e8 --- /dev/null +++ b/tests/baselines/reference/parserMethodSignature8.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/MethodSignatures/parserMethodSignature8.ts === +interface I { +>I : Symbol(I, Decl(parserMethodSignature8.ts, 0, 0)) + + "H"?(); +>T : Symbol(T, Decl(parserMethodSignature8.ts, 1, 7)) +} diff --git a/tests/baselines/reference/parserMethodSignature9.symbols b/tests/baselines/reference/parserMethodSignature9.symbols new file mode 100644 index 00000000000..2fb7aa56d3b --- /dev/null +++ b/tests/baselines/reference/parserMethodSignature9.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/MethodSignatures/parserMethodSignature9.ts === +interface I { +>I : Symbol(I, Decl(parserMethodSignature9.ts, 0, 0)) + + 0(); +} diff --git a/tests/baselines/reference/parserModifierOnPropertySignature2.symbols b/tests/baselines/reference/parserModifierOnPropertySignature2.symbols new file mode 100644 index 00000000000..ac17a3810bf --- /dev/null +++ b/tests/baselines/reference/parserModifierOnPropertySignature2.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserModifierOnPropertySignature2.ts === +interface Foo{ +>Foo : Symbol(Foo, Decl(parserModifierOnPropertySignature2.ts, 0, 0)) + + public +>public : Symbol(public, Decl(parserModifierOnPropertySignature2.ts, 0, 14)) + + biz; +>biz : Symbol(biz, Decl(parserModifierOnPropertySignature2.ts, 1, 10)) +} + diff --git a/tests/baselines/reference/parserModuleDeclaration11.symbols b/tests/baselines/reference/parserModuleDeclaration11.symbols new file mode 100644 index 00000000000..370bd4f8f2b --- /dev/null +++ b/tests/baselines/reference/parserModuleDeclaration11.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration11.ts === +declare module string { +>string : Symbol(string, Decl(parserModuleDeclaration11.ts, 0, 0)) + + interface X { } +>X : Symbol(X, Decl(parserModuleDeclaration11.ts, 0, 23)) + + export function foo(s: string); +>foo : Symbol(foo, Decl(parserModuleDeclaration11.ts, 1, 19)) +>s : Symbol(s, Decl(parserModuleDeclaration11.ts, 2, 24)) +} +string.foo("abc"); +>string.foo : Symbol(string.foo, Decl(parserModuleDeclaration11.ts, 1, 19)) +>string : Symbol(string, Decl(parserModuleDeclaration11.ts, 0, 0)) +>foo : Symbol(string.foo, Decl(parserModuleDeclaration11.ts, 1, 19)) + +var x: string.X; +>x : Symbol(x, Decl(parserModuleDeclaration11.ts, 5, 3)) +>string : Symbol(string, Decl(parserModuleDeclaration11.ts, 0, 0)) +>X : Symbol(string.X, Decl(parserModuleDeclaration11.ts, 0, 23)) + diff --git a/tests/baselines/reference/parserModuleDeclaration11.types b/tests/baselines/reference/parserModuleDeclaration11.types index bd66d638ddf..98075a505f7 100644 --- a/tests/baselines/reference/parserModuleDeclaration11.types +++ b/tests/baselines/reference/parserModuleDeclaration11.types @@ -14,9 +14,10 @@ string.foo("abc"); >string.foo : (s: string) => any >string : typeof string >foo : (s: string) => any +>"abc" : string var x: string.X; >x : string.X ->string : unknown +>string : any >X : string.X diff --git a/tests/baselines/reference/parserModuleDeclaration12.symbols b/tests/baselines/reference/parserModuleDeclaration12.symbols new file mode 100644 index 00000000000..7b4944c7442 --- /dev/null +++ b/tests/baselines/reference/parserModuleDeclaration12.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration12.ts === +module A.string { +>A : Symbol(A, Decl(parserModuleDeclaration12.ts, 0, 0)) +>string : Symbol(string, Decl(parserModuleDeclaration12.ts, 0, 9)) +} diff --git a/tests/baselines/reference/parserModuleDeclaration12.types b/tests/baselines/reference/parserModuleDeclaration12.types index cffa3cba358..469cfe867fd 100644 --- a/tests/baselines/reference/parserModuleDeclaration12.types +++ b/tests/baselines/reference/parserModuleDeclaration12.types @@ -1,5 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration12.ts === module A.string { ->A : unknown ->string : unknown +>A : any +>string : any } diff --git a/tests/baselines/reference/parserModuleDeclaration2.symbols b/tests/baselines/reference/parserModuleDeclaration2.symbols new file mode 100644 index 00000000000..340cee697f1 --- /dev/null +++ b/tests/baselines/reference/parserModuleDeclaration2.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration2.ts === +declare module "Foo" { +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserModuleDeclaration3.d.symbols b/tests/baselines/reference/parserModuleDeclaration3.d.symbols new file mode 100644 index 00000000000..2994f85cc68 --- /dev/null +++ b/tests/baselines/reference/parserModuleDeclaration3.d.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration3.d.ts === +declare module M { +>M : Symbol(M, Decl(parserModuleDeclaration3.d.ts, 0, 0)) +} diff --git a/tests/baselines/reference/parserModuleDeclaration3.d.types b/tests/baselines/reference/parserModuleDeclaration3.d.types index 1fbd92c86af..21c6650a033 100644 --- a/tests/baselines/reference/parserModuleDeclaration3.d.types +++ b/tests/baselines/reference/parserModuleDeclaration3.d.types @@ -1,4 +1,4 @@ === tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration3.d.ts === declare module M { ->M : unknown +>M : any } diff --git a/tests/baselines/reference/parserModuleDeclaration4.symbols b/tests/baselines/reference/parserModuleDeclaration4.symbols new file mode 100644 index 00000000000..2ec1d639e72 --- /dev/null +++ b/tests/baselines/reference/parserModuleDeclaration4.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration4.ts === +module M { +>M : Symbol(M, Decl(parserModuleDeclaration4.ts, 0, 0)) + + declare module M1 { +>M1 : Symbol(M1, Decl(parserModuleDeclaration4.ts, 0, 10)) + + module M2 { +>M2 : Symbol(M2, Decl(parserModuleDeclaration4.ts, 1, 21)) + } + } +} diff --git a/tests/baselines/reference/parserModuleDeclaration4.types b/tests/baselines/reference/parserModuleDeclaration4.types index 165378e62fa..29f29a87fe7 100644 --- a/tests/baselines/reference/parserModuleDeclaration4.types +++ b/tests/baselines/reference/parserModuleDeclaration4.types @@ -1,12 +1,12 @@ === tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration4.ts === module M { ->M : unknown +>M : any declare module M1 { ->M1 : unknown +>M1 : any module M2 { ->M2 : unknown +>M2 : any } } } diff --git a/tests/baselines/reference/parserModuleDeclaration6.symbols b/tests/baselines/reference/parserModuleDeclaration6.symbols new file mode 100644 index 00000000000..4c155afe594 --- /dev/null +++ b/tests/baselines/reference/parserModuleDeclaration6.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration6.ts === +module number { +>number : Symbol(number, Decl(parserModuleDeclaration6.ts, 0, 0)) +} diff --git a/tests/baselines/reference/parserModuleDeclaration6.types b/tests/baselines/reference/parserModuleDeclaration6.types index 012ad6f8270..2ac05ec485e 100644 --- a/tests/baselines/reference/parserModuleDeclaration6.types +++ b/tests/baselines/reference/parserModuleDeclaration6.types @@ -1,4 +1,4 @@ === tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration6.ts === module number { ->number : unknown +>number : any } diff --git a/tests/baselines/reference/parserModuleDeclaration7.symbols b/tests/baselines/reference/parserModuleDeclaration7.symbols new file mode 100644 index 00000000000..4f3648b044a --- /dev/null +++ b/tests/baselines/reference/parserModuleDeclaration7.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration7.ts === +module number.a { +>number : Symbol(number, Decl(parserModuleDeclaration7.ts, 0, 0)) +>a : Symbol(a, Decl(parserModuleDeclaration7.ts, 0, 14)) +} diff --git a/tests/baselines/reference/parserModuleDeclaration7.types b/tests/baselines/reference/parserModuleDeclaration7.types index 38f1c29e642..38cf3f89623 100644 --- a/tests/baselines/reference/parserModuleDeclaration7.types +++ b/tests/baselines/reference/parserModuleDeclaration7.types @@ -1,5 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration7.ts === module number.a { ->number : unknown ->a : unknown +>number : any +>a : any } diff --git a/tests/baselines/reference/parserModuleDeclaration8.symbols b/tests/baselines/reference/parserModuleDeclaration8.symbols new file mode 100644 index 00000000000..b4bd45b2889 --- /dev/null +++ b/tests/baselines/reference/parserModuleDeclaration8.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration8.ts === +module a.number { +>a : Symbol(a, Decl(parserModuleDeclaration8.ts, 0, 0)) +>number : Symbol(number, Decl(parserModuleDeclaration8.ts, 0, 9)) +} diff --git a/tests/baselines/reference/parserModuleDeclaration8.types b/tests/baselines/reference/parserModuleDeclaration8.types index 474e81dbda0..1c9a0e26650 100644 --- a/tests/baselines/reference/parserModuleDeclaration8.types +++ b/tests/baselines/reference/parserModuleDeclaration8.types @@ -1,5 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration8.ts === module a.number { ->a : unknown ->number : unknown +>a : any +>number : any } diff --git a/tests/baselines/reference/parserModuleDeclaration9.symbols b/tests/baselines/reference/parserModuleDeclaration9.symbols new file mode 100644 index 00000000000..b092aab41ef --- /dev/null +++ b/tests/baselines/reference/parserModuleDeclaration9.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration9.ts === +module a.number.b { +>a : Symbol(a, Decl(parserModuleDeclaration9.ts, 0, 0)) +>number : Symbol(number, Decl(parserModuleDeclaration9.ts, 0, 9)) +>b : Symbol(b, Decl(parserModuleDeclaration9.ts, 0, 16)) +} diff --git a/tests/baselines/reference/parserModuleDeclaration9.types b/tests/baselines/reference/parserModuleDeclaration9.types index 1898d461290..28a272b4350 100644 --- a/tests/baselines/reference/parserModuleDeclaration9.types +++ b/tests/baselines/reference/parserModuleDeclaration9.types @@ -1,6 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration9.ts === module a.number.b { ->a : unknown ->number : unknown ->b : unknown +>a : any +>number : any +>b : any } diff --git a/tests/baselines/reference/parserObjectLiterals1.symbols b/tests/baselines/reference/parserObjectLiterals1.symbols new file mode 100644 index 00000000000..602c2dd5a3a --- /dev/null +++ b/tests/baselines/reference/parserObjectLiterals1.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/ObjectLiterals/parserObjectLiterals1.ts === +var v = { a: 1, b: 2 }; +>v : Symbol(v, Decl(parserObjectLiterals1.ts, 0, 3)) +>a : Symbol(a, Decl(parserObjectLiterals1.ts, 0, 9)) +>b : Symbol(b, Decl(parserObjectLiterals1.ts, 0, 15)) + diff --git a/tests/baselines/reference/parserObjectLiterals1.types b/tests/baselines/reference/parserObjectLiterals1.types index c38adbf55b6..b6bca18e360 100644 --- a/tests/baselines/reference/parserObjectLiterals1.types +++ b/tests/baselines/reference/parserObjectLiterals1.types @@ -3,5 +3,7 @@ var v = { a: 1, b: 2 }; >v : { a: number; b: number; } >{ a: 1, b: 2 } : { a: number; b: number; } >a : number +>1 : number >b : number +>2 : number diff --git a/tests/baselines/reference/parserObjectType1.symbols b/tests/baselines/reference/parserObjectType1.symbols new file mode 100644 index 00000000000..702cfbe4d87 --- /dev/null +++ b/tests/baselines/reference/parserObjectType1.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ObjectTypes/parserObjectType1.ts === +var v: {}; +>v : Symbol(v, Decl(parserObjectType1.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserObjectType2.symbols b/tests/baselines/reference/parserObjectType2.symbols new file mode 100644 index 00000000000..43728418166 --- /dev/null +++ b/tests/baselines/reference/parserObjectType2.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript5/ObjectTypes/parserObjectType2.ts === +var v: { x: number }; +>v : Symbol(v, Decl(parserObjectType2.ts, 0, 3)) +>x : Symbol(x, Decl(parserObjectType2.ts, 0, 8)) + diff --git a/tests/baselines/reference/parserObjectType3.symbols b/tests/baselines/reference/parserObjectType3.symbols new file mode 100644 index 00000000000..bb4b25d2a69 --- /dev/null +++ b/tests/baselines/reference/parserObjectType3.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/parser/ecmascript5/ObjectTypes/parserObjectType3.ts === +var v: { +>v : Symbol(v, Decl(parserObjectType3.ts, 0, 3)) + + x; +>x : Symbol(x, Decl(parserObjectType3.ts, 0, 8)) + + y +>y : Symbol(y, Decl(parserObjectType3.ts, 1, 4)) + +}; diff --git a/tests/baselines/reference/parserObjectType4.symbols b/tests/baselines/reference/parserObjectType4.symbols new file mode 100644 index 00000000000..f73e22de77c --- /dev/null +++ b/tests/baselines/reference/parserObjectType4.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/parser/ecmascript5/ObjectTypes/parserObjectType4.ts === +var v: { +>v : Symbol(v, Decl(parserObjectType4.ts, 0, 3)) + + x +>x : Symbol(x, Decl(parserObjectType4.ts, 0, 8)) + + y +>y : Symbol(y, Decl(parserObjectType4.ts, 1, 3)) + +}; diff --git a/tests/baselines/reference/parserOptionalTypeMembers1.symbols b/tests/baselines/reference/parserOptionalTypeMembers1.symbols new file mode 100644 index 00000000000..ce12a4ec19b --- /dev/null +++ b/tests/baselines/reference/parserOptionalTypeMembers1.symbols @@ -0,0 +1,23 @@ +=== tests/cases/conformance/parser/ecmascript5/parserOptionalTypeMembers1.ts === +interface PropertyDescriptor2 { +>PropertyDescriptor2 : Symbol(PropertyDescriptor2, Decl(parserOptionalTypeMembers1.ts, 0, 0)) + + configurable?: boolean; +>configurable : Symbol(configurable, Decl(parserOptionalTypeMembers1.ts, 0, 31)) + + enumerable?: boolean; +>enumerable : Symbol(enumerable, Decl(parserOptionalTypeMembers1.ts, 1, 27)) + + value?: any; +>value : Symbol(value, Decl(parserOptionalTypeMembers1.ts, 2, 25)) + + writable?: boolean; +>writable : Symbol(writable, Decl(parserOptionalTypeMembers1.ts, 3, 16)) + + get?(): any; +>get : Symbol(get, Decl(parserOptionalTypeMembers1.ts, 4, 23)) + + set?(v: any): void; +>set : Symbol(set, Decl(parserOptionalTypeMembers1.ts, 5, 16)) +>v : Symbol(v, Decl(parserOptionalTypeMembers1.ts, 6, 9)) +} diff --git a/tests/baselines/reference/parserParameterList10.js b/tests/baselines/reference/parserParameterList10.js index 4f85dec801c..7a4e8132868 100644 --- a/tests/baselines/reference/parserParameterList10.js +++ b/tests/baselines/reference/parserParameterList10.js @@ -8,7 +8,6 @@ var C = (function () { function C() { } C.prototype.foo = function () { - if (bar === void 0) { bar = 0; } var bar = []; for (var _i = 0; _i < arguments.length; _i++) { bar[_i - 0] = arguments[_i]; diff --git a/tests/baselines/reference/parserPropertySignature1.symbols b/tests/baselines/reference/parserPropertySignature1.symbols new file mode 100644 index 00000000000..6b8a26c4164 --- /dev/null +++ b/tests/baselines/reference/parserPropertySignature1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertySignatures/parserPropertySignature1.ts === +interface I { +>I : Symbol(I, Decl(parserPropertySignature1.ts, 0, 0)) + + A; +>A : Symbol(A, Decl(parserPropertySignature1.ts, 0, 13)) +} diff --git a/tests/baselines/reference/parserPropertySignature10.symbols b/tests/baselines/reference/parserPropertySignature10.symbols new file mode 100644 index 00000000000..a6a755a0891 --- /dev/null +++ b/tests/baselines/reference/parserPropertySignature10.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertySignatures/parserPropertySignature10.ts === +interface I { +>I : Symbol(I, Decl(parserPropertySignature10.ts, 0, 0)) + + 1?; +} diff --git a/tests/baselines/reference/parserPropertySignature11.symbols b/tests/baselines/reference/parserPropertySignature11.symbols new file mode 100644 index 00000000000..960f16bf526 --- /dev/null +++ b/tests/baselines/reference/parserPropertySignature11.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertySignatures/parserPropertySignature11.ts === +interface I { +>I : Symbol(I, Decl(parserPropertySignature11.ts, 0, 0)) + + 2:any; +} diff --git a/tests/baselines/reference/parserPropertySignature12.symbols b/tests/baselines/reference/parserPropertySignature12.symbols new file mode 100644 index 00000000000..a6f0eb5faf8 --- /dev/null +++ b/tests/baselines/reference/parserPropertySignature12.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertySignatures/parserPropertySignature12.ts === +interface I { +>I : Symbol(I, Decl(parserPropertySignature12.ts, 0, 0)) + + 3?:any; +} diff --git a/tests/baselines/reference/parserPropertySignature2.symbols b/tests/baselines/reference/parserPropertySignature2.symbols new file mode 100644 index 00000000000..334c0655908 --- /dev/null +++ b/tests/baselines/reference/parserPropertySignature2.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertySignatures/parserPropertySignature2.ts === +interface I { +>I : Symbol(I, Decl(parserPropertySignature2.ts, 0, 0)) + + B?; +>B : Symbol(B, Decl(parserPropertySignature2.ts, 0, 13)) +} diff --git a/tests/baselines/reference/parserPropertySignature3.symbols b/tests/baselines/reference/parserPropertySignature3.symbols new file mode 100644 index 00000000000..c2b70b58be8 --- /dev/null +++ b/tests/baselines/reference/parserPropertySignature3.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertySignatures/parserPropertySignature3.ts === +interface I { +>I : Symbol(I, Decl(parserPropertySignature3.ts, 0, 0)) + + C:any; +>C : Symbol(C, Decl(parserPropertySignature3.ts, 0, 13)) +} diff --git a/tests/baselines/reference/parserPropertySignature4.symbols b/tests/baselines/reference/parserPropertySignature4.symbols new file mode 100644 index 00000000000..cd61b14d34c --- /dev/null +++ b/tests/baselines/reference/parserPropertySignature4.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertySignatures/parserPropertySignature4.ts === +interface I { +>I : Symbol(I, Decl(parserPropertySignature4.ts, 0, 0)) + + D?:any; +>D : Symbol(D, Decl(parserPropertySignature4.ts, 0, 13)) +} diff --git a/tests/baselines/reference/parserPropertySignature5.symbols b/tests/baselines/reference/parserPropertySignature5.symbols new file mode 100644 index 00000000000..fa56ec75871 --- /dev/null +++ b/tests/baselines/reference/parserPropertySignature5.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertySignatures/parserPropertySignature5.ts === +interface I { +>I : Symbol(I, Decl(parserPropertySignature5.ts, 0, 0)) + + "E"; +} diff --git a/tests/baselines/reference/parserPropertySignature6.symbols b/tests/baselines/reference/parserPropertySignature6.symbols new file mode 100644 index 00000000000..1f3831e5610 --- /dev/null +++ b/tests/baselines/reference/parserPropertySignature6.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertySignatures/parserPropertySignature6.ts === +interface I { +>I : Symbol(I, Decl(parserPropertySignature6.ts, 0, 0)) + + "F"?; +} diff --git a/tests/baselines/reference/parserPropertySignature7.symbols b/tests/baselines/reference/parserPropertySignature7.symbols new file mode 100644 index 00000000000..840b302d6ac --- /dev/null +++ b/tests/baselines/reference/parserPropertySignature7.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertySignatures/parserPropertySignature7.ts === +interface I { +>I : Symbol(I, Decl(parserPropertySignature7.ts, 0, 0)) + + "G":any; +} diff --git a/tests/baselines/reference/parserPropertySignature8.symbols b/tests/baselines/reference/parserPropertySignature8.symbols new file mode 100644 index 00000000000..e124b4c770c --- /dev/null +++ b/tests/baselines/reference/parserPropertySignature8.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertySignatures/parserPropertySignature8.ts === +interface I { +>I : Symbol(I, Decl(parserPropertySignature8.ts, 0, 0)) + + "H"?:any; +} diff --git a/tests/baselines/reference/parserPropertySignature9.symbols b/tests/baselines/reference/parserPropertySignature9.symbols new file mode 100644 index 00000000000..3664160fad4 --- /dev/null +++ b/tests/baselines/reference/parserPropertySignature9.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertySignatures/parserPropertySignature9.ts === +interface I { +>I : Symbol(I, Decl(parserPropertySignature9.ts, 0, 0)) + + 0; +} diff --git a/tests/baselines/reference/parserReturnStatement3.symbols b/tests/baselines/reference/parserReturnStatement3.symbols new file mode 100644 index 00000000000..6783ea1ac5c --- /dev/null +++ b/tests/baselines/reference/parserReturnStatement3.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/ReturnStatements/parserReturnStatement3.ts === +function f() { +>f : Symbol(f, Decl(parserReturnStatement3.ts, 0, 0)) + + return; +} diff --git a/tests/baselines/reference/parserS7.6.1.1_A1.10.symbols b/tests/baselines/reference/parserS7.6.1.1_A1.10.symbols new file mode 100644 index 00000000000..28441e36fe6 --- /dev/null +++ b/tests/baselines/reference/parserS7.6.1.1_A1.10.symbols @@ -0,0 +1,16 @@ +=== tests/cases/conformance/parser/ecmascript5/parserS7.6.1.1_A1.10.ts === +// Copyright 2009 the Sputnik authors. All rights reserved. +No type information for this code.// This code is governed by the BSD license found in the LICENSE file. +No type information for this code. +No type information for this code./** +No type information for this code. * The "for" token can not be used as identifier +No type information for this code. * +No type information for this code. * @path ch07/7.6/7.6.1/7.6.1.1/S7.6.1.1_A1.10.js +No type information for this code. * @description Checking if execution of "for=1" fails +No type information for this code. * @negative +No type information for this code. */ +No type information for this code. +No type information for this code.//for = 1; +No type information for this code. +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserSbp_7.9_A9_T3.symbols b/tests/baselines/reference/parserSbp_7.9_A9_T3.symbols new file mode 100644 index 00000000000..0d6df58ed39 --- /dev/null +++ b/tests/baselines/reference/parserSbp_7.9_A9_T3.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/parser/ecmascript5/parserSbp_7.9_A9_T3.ts === +// Copyright 2009 the Sputnik authors. All rights reserved. +No type information for this code.// This code is governed by the BSD license found in the LICENSE file. +No type information for this code. +No type information for this code./** +No type information for this code. * Check Do-While Statement for automatic semicolon insertion +No type information for this code. * +No type information for this code. * @path bestPractice/Sbp_7.9_A9_T3.js +No type information for this code. * @description Execute do { \n ; \n }while(false) true +No type information for this code. */ +No type information for this code. +No type information for this code.//CHECK#1 +No type information for this code.do { +No type information for this code. ; +No type information for this code.} while (false) true +No type information for this code. +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserSbp_7.9_A9_T3.types b/tests/baselines/reference/parserSbp_7.9_A9_T3.types index 0d6df58ed39..5e1eed4dd98 100644 --- a/tests/baselines/reference/parserSbp_7.9_A9_T3.types +++ b/tests/baselines/reference/parserSbp_7.9_A9_T3.types @@ -1,18 +1,19 @@ === tests/cases/conformance/parser/ecmascript5/parserSbp_7.9_A9_T3.ts === // Copyright 2009 the Sputnik authors. All rights reserved. -No type information for this code.// This code is governed by the BSD license found in the LICENSE file. -No type information for this code. -No type information for this code./** -No type information for this code. * Check Do-While Statement for automatic semicolon insertion -No type information for this code. * -No type information for this code. * @path bestPractice/Sbp_7.9_A9_T3.js -No type information for this code. * @description Execute do { \n ; \n }while(false) true -No type information for this code. */ -No type information for this code. -No type information for this code.//CHECK#1 -No type information for this code.do { -No type information for this code. ; -No type information for this code.} while (false) true -No type information for this code. -No type information for this code. -No type information for this code. \ No newline at end of file +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Check Do-While Statement for automatic semicolon insertion + * + * @path bestPractice/Sbp_7.9_A9_T3.js + * @description Execute do { \n ; \n }while(false) true + */ + +//CHECK#1 +do { + ; +} while (false) true +>false : boolean +>true : boolean + + diff --git a/tests/baselines/reference/parserStrictMode16.symbols b/tests/baselines/reference/parserStrictMode16.symbols new file mode 100644 index 00000000000..655201fbea2 --- /dev/null +++ b/tests/baselines/reference/parserStrictMode16.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode16.ts === +"use strict"; +No type information for this code.delete this; +No type information for this code.delete 1; +No type information for this code.delete null; +No type information for this code.delete "a"; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserStrictMode16.types b/tests/baselines/reference/parserStrictMode16.types index 6e68c0cbc6b..a7a68ab7811 100644 --- a/tests/baselines/reference/parserStrictMode16.types +++ b/tests/baselines/reference/parserStrictMode16.types @@ -1,15 +1,20 @@ === tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode16.ts === "use strict"; +>"use strict" : string + delete this; >delete this : boolean >this : any delete 1; >delete 1 : boolean +>1 : number delete null; >delete null : boolean +>null : null delete "a"; >delete "a" : boolean +>"a" : string diff --git a/tests/baselines/reference/parserStrictMode2.errors.txt b/tests/baselines/reference/parserStrictMode2.errors.txt index e920c02bed1..464e8eface8 100644 --- a/tests/baselines/reference/parserStrictMode2.errors.txt +++ b/tests/baselines/reference/parserStrictMode2.errors.txt @@ -1,8 +1,8 @@ tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode2.ts(2,1): error TS2304: Cannot find name 'foo1'. tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode2.ts(3,1): error TS2304: Cannot find name 'foo1'. tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode2.ts(4,1): error TS2304: Cannot find name 'foo1'. -tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode2.ts(5,1): error TS1128: Declaration or statement expected. -tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode2.ts(5,8): error TS1109: Expression expected. +tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode2.ts(5,1): error TS1212: Identifier expected. 'static' is a reserved word in strict mode +tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode2.ts(5,1): error TS2304: Cannot find name 'static'. ==== tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode2.ts (5 errors) ==== @@ -18,6 +18,6 @@ tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode2.ts(5,8): !!! error TS2304: Cannot find name 'foo1'. static(); ~~~~~~ -!!! error TS1128: Declaration or statement expected. - ~ -!!! error TS1109: Expression expected. \ No newline at end of file +!!! error TS1212: Identifier expected. 'static' is a reserved word in strict mode + ~~~~~~ +!!! error TS2304: Cannot find name 'static'. \ No newline at end of file diff --git a/tests/baselines/reference/parserStrictMode2.js b/tests/baselines/reference/parserStrictMode2.js index b8020672241..79b32ed9a58 100644 --- a/tests/baselines/reference/parserStrictMode2.js +++ b/tests/baselines/reference/parserStrictMode2.js @@ -10,4 +10,4 @@ static(); foo1(); foo1(); foo1(); -(); +static(); diff --git a/tests/baselines/reference/parserSymbolProperty1.symbols b/tests/baselines/reference/parserSymbolProperty1.symbols new file mode 100644 index 00000000000..4d7a9b669e4 --- /dev/null +++ b/tests/baselines/reference/parserSymbolProperty1.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolProperty1.ts === +interface I { +>I : Symbol(I, Decl(parserSymbolProperty1.ts, 0, 0)) + + [Symbol.iterator]: string; +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +} diff --git a/tests/baselines/reference/parserSymbolProperty2.symbols b/tests/baselines/reference/parserSymbolProperty2.symbols new file mode 100644 index 00000000000..ff110a6fe03 --- /dev/null +++ b/tests/baselines/reference/parserSymbolProperty2.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolProperty2.ts === +interface I { +>I : Symbol(I, Decl(parserSymbolProperty2.ts, 0, 0)) + + [Symbol.unscopables](): string; +>Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1254, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1254, 24)) +} diff --git a/tests/baselines/reference/parserSymbolProperty3.symbols b/tests/baselines/reference/parserSymbolProperty3.symbols new file mode 100644 index 00000000000..b75a737af0a --- /dev/null +++ b/tests/baselines/reference/parserSymbolProperty3.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolProperty3.ts === +declare class C { +>C : Symbol(C, Decl(parserSymbolProperty3.ts, 0, 0)) + + [Symbol.unscopables](): string; +>Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1254, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1254, 24)) +} diff --git a/tests/baselines/reference/parserSymbolProperty4.js b/tests/baselines/reference/parserSymbolProperty4.js index f79db0b1d79..698798351ac 100644 --- a/tests/baselines/reference/parserSymbolProperty4.js +++ b/tests/baselines/reference/parserSymbolProperty4.js @@ -1,6 +1,6 @@ //// [parserSymbolProperty4.ts] declare class C { - [Symbol.isRegExp]: string; + [Symbol.toPrimitive]: string; } //// [parserSymbolProperty4.js] diff --git a/tests/baselines/reference/parserSymbolProperty4.symbols b/tests/baselines/reference/parserSymbolProperty4.symbols new file mode 100644 index 00000000000..122a46180d2 --- /dev/null +++ b/tests/baselines/reference/parserSymbolProperty4.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolProperty4.ts === +declare class C { +>C : Symbol(C, Decl(parserSymbolProperty4.ts, 0, 0)) + + [Symbol.toPrimitive]: string; +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +} diff --git a/tests/baselines/reference/parserSymbolProperty4.types b/tests/baselines/reference/parserSymbolProperty4.types index a9070897fa8..dbf65454826 100644 --- a/tests/baselines/reference/parserSymbolProperty4.types +++ b/tests/baselines/reference/parserSymbolProperty4.types @@ -2,8 +2,8 @@ declare class C { >C : C - [Symbol.isRegExp]: string; ->Symbol.isRegExp : symbol + [Symbol.toPrimitive]: string; +>Symbol.toPrimitive : symbol >Symbol : SymbolConstructor ->isRegExp : symbol +>toPrimitive : symbol } diff --git a/tests/baselines/reference/parserSymbolProperty5.js b/tests/baselines/reference/parserSymbolProperty5.js index a8b1d564fa8..62a805602d1 100644 --- a/tests/baselines/reference/parserSymbolProperty5.js +++ b/tests/baselines/reference/parserSymbolProperty5.js @@ -1,6 +1,6 @@ //// [parserSymbolProperty5.ts] class C { - [Symbol.isRegExp]: string; + [Symbol.toPrimitive]: string; } //// [parserSymbolProperty5.js] diff --git a/tests/baselines/reference/parserSymbolProperty5.symbols b/tests/baselines/reference/parserSymbolProperty5.symbols new file mode 100644 index 00000000000..f6049c352e9 --- /dev/null +++ b/tests/baselines/reference/parserSymbolProperty5.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolProperty5.ts === +class C { +>C : Symbol(C, Decl(parserSymbolProperty5.ts, 0, 0)) + + [Symbol.toPrimitive]: string; +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +} diff --git a/tests/baselines/reference/parserSymbolProperty5.types b/tests/baselines/reference/parserSymbolProperty5.types index 8a171598e83..c854aa6a26d 100644 --- a/tests/baselines/reference/parserSymbolProperty5.types +++ b/tests/baselines/reference/parserSymbolProperty5.types @@ -2,8 +2,8 @@ class C { >C : C - [Symbol.isRegExp]: string; ->Symbol.isRegExp : symbol + [Symbol.toPrimitive]: string; +>Symbol.toPrimitive : symbol >Symbol : SymbolConstructor ->isRegExp : symbol +>toPrimitive : symbol } diff --git a/tests/baselines/reference/parserSymbolProperty6.symbols b/tests/baselines/reference/parserSymbolProperty6.symbols new file mode 100644 index 00000000000..6f8a8d820be --- /dev/null +++ b/tests/baselines/reference/parserSymbolProperty6.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolProperty6.ts === +class C { +>C : Symbol(C, Decl(parserSymbolProperty6.ts, 0, 0)) + + [Symbol.toStringTag]: string = ""; +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) +} diff --git a/tests/baselines/reference/parserSymbolProperty6.types b/tests/baselines/reference/parserSymbolProperty6.types index 660cbf4e545..a802765cb4f 100644 --- a/tests/baselines/reference/parserSymbolProperty6.types +++ b/tests/baselines/reference/parserSymbolProperty6.types @@ -6,4 +6,5 @@ class C { >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol +>"" : string } diff --git a/tests/baselines/reference/parserSymbolProperty7.symbols b/tests/baselines/reference/parserSymbolProperty7.symbols new file mode 100644 index 00000000000..abcffb9a1fd --- /dev/null +++ b/tests/baselines/reference/parserSymbolProperty7.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolProperty7.ts === +class C { +>C : Symbol(C, Decl(parserSymbolProperty7.ts, 0, 0)) + + [Symbol.toStringTag](): void { } +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) +} diff --git a/tests/baselines/reference/parserSymbolProperty8.symbols b/tests/baselines/reference/parserSymbolProperty8.symbols new file mode 100644 index 00000000000..4b2adf9c750 --- /dev/null +++ b/tests/baselines/reference/parserSymbolProperty8.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolProperty8.ts === +var x: { +>x : Symbol(x, Decl(parserSymbolProperty8.ts, 0, 3)) + + [Symbol.toPrimitive](): string +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +} diff --git a/tests/baselines/reference/parserSymbolProperty9.symbols b/tests/baselines/reference/parserSymbolProperty9.symbols new file mode 100644 index 00000000000..cca16d768e6 --- /dev/null +++ b/tests/baselines/reference/parserSymbolProperty9.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolProperty9.ts === +var x: { +>x : Symbol(x, Decl(parserSymbolProperty9.ts, 0, 3)) + + [Symbol.toPrimitive]: string +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +} diff --git a/tests/baselines/reference/parserSyntaxWalker.generated.symbols b/tests/baselines/reference/parserSyntaxWalker.generated.symbols new file mode 100644 index 00000000000..dde34e06746 --- /dev/null +++ b/tests/baselines/reference/parserSyntaxWalker.generated.symbols @@ -0,0 +1,281 @@ +=== tests/cases/conformance/parser/ecmascript5/parserSyntaxWalker.generated.ts === +//declare module "fs" { +No type information for this code.// export class File { +No type information for this code.// constructor(filename: string); +No type information for this code.// public ReadAllText(): string; +No type information for this code.// } +No type information for this code.// export interface IFile { +No type information for this code.// [index: number]: string; +No type information for this code.// } +No type information for this code.//} +No type information for this code. +No type information for this code.//import fs = module("fs"); +No type information for this code. +No type information for this code. +No type information for this code.//module TypeScriptAllInOne { +No type information for this code.// export class Program { +No type information for this code.// static Main(...args: string[]) { +No type information for this code.// try { +No type information for this code.// var bfs = new BasicFeatures(); +No type information for this code.// var retValue: number = 0; +No type information for this code. +No type information for this code.// retValue = bfs.VARIABLES(); +No type information for this code.// if (retValue != 0) { +No type information for this code. +No type information for this code.// return 1; +No type information for this code.// } +No type information for this code. +No type information for this code.// retValue = bfs.STATEMENTS(4); +No type information for this code.// if (retValue != 0) { +No type information for this code. +No type information for this code.// return 1; +No type information for this code.// } +No type information for this code. +No type information for this code. +No type information for this code.// retValue = bfs.TYPES(); +No type information for this code.// if (retValue != 0) { +No type information for this code. +No type information for this code.// return 1; +No type information for this code.// } +No type information for this code. +No type information for this code.// retValue = bfs.OPERATOR(); +No type information for this code.// if (retValue != 0) { +No type information for this code. +No type information for this code.// return 1; +No type information for this code.// } +No type information for this code.// } +No type information for this code.// catch (e) { +No type information for this code.// console.log(e); +No type information for this code.// } +No type information for this code.// finally { +No type information for this code. +No type information for this code.// } +No type information for this code. +No type information for this code.// console.log('Done'); +No type information for this code. +No type information for this code.// return 0; +No type information for this code. +No type information for this code.// } +No type information for this code.// } +No type information for this code. +No type information for this code.// class BasicFeatures { +No type information for this code.// /// +No type information for this code.// /// Test various of variables. Including nullable,key world as variable,special format +No type information for this code.// /// +No type information for this code.// /// +No type information for this code.// public VARIABLES(): number { +No type information for this code.// var local = Number.MAX_VALUE; +No type information for this code.// var min = Number.MIN_VALUE; +No type information for this code.// var inf = Number.NEGATIVE_INFINITY; +No type information for this code.// var nan = Number.NaN; +No type information for this code.// var undef = undefined; +No type information for this code. +No type information for this code.// var п = local; +No type information for this code.// var м = local; +No type information for this code. +No type information for this code.// var local5 = null; +No type information for this code.// var local6 = local5 instanceof fs.File; +No type information for this code. +No type information for this code.// var hex = 0xBADC0DE, Hex = 0XDEADBEEF; +No type information for this code.// var float = 6.02e23, float2 = 6.02E-23 +No type information for this code.// var char = 'c', \u0066 = '\u0066', hexchar = '\x42'; +No type information for this code.// var quoted = '"', quoted2 = "'"; +No type information for this code.// var reg = /\w*/; +No type information for this code.// var objLit = { "var": number = 42, equals: function (x) { return x["var"] === 42; }, toString: () => 'objLit{42}' }; +No type information for this code.// var weekday = Weekdays.Monday; +No type information for this code. +No type information for this code.// var con = char + f + hexchar + float.toString() + float2.toString() + reg.toString() + objLit + weekday; +No type information for this code. +No type information for this code.// // +No type information for this code.// var any = 0; +No type information for this code.// var boolean = 0; +No type information for this code.// var declare = 0; +No type information for this code.// var constructor = 0; +No type information for this code.// var get = 0; +No type information for this code.// var implements = 0; +No type information for this code.// var interface = 0; +No type information for this code.// var let = 0; +No type information for this code.// var module = 0; +No type information for this code.// var number = 0; +No type information for this code.// var package = 0; +No type information for this code.// var private = 0; +No type information for this code.// var protected = 0; +No type information for this code.// var public = 0; +No type information for this code.// var set = 0; +No type information for this code.// var static = 0; +No type information for this code.// var string = 0; +No type information for this code.// var yield = 0; +No type information for this code. +No type information for this code.// var sum3 = any + boolean + declare + constructor + get + implements + interface + let + module + number + package + private + protected + public + set + static + string + yield; +No type information for this code. +No type information for this code.// return 0; +No type information for this code.// } +No type information for this code. +No type information for this code.// /// +No type information for this code.// /// Test different statements. Including if-else,swith,foreach,(un)checked,lock,using,try-catch-finally +No type information for this code.// /// +No type information for this code.// /// +No type information for this code.// /// +No type information for this code.// STATEMENTS(i: number): number { +No type information for this code.// var retVal = 0; +No type information for this code.// if (i == 1) +No type information for this code.// retVal = 1; +No type information for this code.// else +No type information for this code.// retVal = 0; +No type information for this code.// switch (i) { +No type information for this code.// case 2: +No type information for this code.// retVal = 1; +No type information for this code.// break; +No type information for this code.// case 3: +No type information for this code.// retVal = 1; +No type information for this code.// break; +No type information for this code.// default: +No type information for this code.// break; +No type information for this code.// } +No type information for this code. +No type information for this code.// for (var x in { x: 0, y: 1 }) { +No type information for this code.// } +No type information for this code. +No type information for this code.// try { +No type information for this code.// throw null; +No type information for this code.// } +No type information for this code.// catch (Exception) { +No type information for this code.// } +No type information for this code.// finally { +No type information for this code.// try { } +No type information for this code.// catch (Exception) { } +No type information for this code.// } +No type information for this code. +No type information for this code.// return retVal; +No type information for this code.// } +No type information for this code. +No type information for this code.// /// +No type information for this code.// /// Test types in ts language. Including class,struct,interface,delegate,anonymous type +No type information for this code.// /// +No type information for this code.// /// +No type information for this code.// public TYPES(): number { +No type information for this code.// var retVal = 0; +No type information for this code.// var c = new CLASS(); +No type information for this code.// var xx: IF = c; +No type information for this code.// retVal += c.Property; +No type information for this code.// retVal += c.Member(); +No type information for this code.// retVal += xx ^= Foo() ? 0 : 1; +No type information for this code. +No type information for this code.// //anonymous type +No type information for this code.// var anony = { a: new CLASS() }; +No type information for this code. +No type information for this code.// retVal += anony.a.d(); +No type information for this code. +No type information for this code.// return retVal; +No type information for this code.// } +No type information for this code. +No type information for this code. +No type information for this code.// ///// +No type information for this code.// ///// Test different operators +No type information for this code.// ///// +No type information for this code.// ///// +No type information for this code.// public OPERATOR(): number { +No type information for this code.// var a: number[] = [1, 2, 3, 4, implements , ];/*[] bug*/ // YES [] +No type information for this code.// var i = a[1];/*[]*/ +No type information for this code.// i = i + i - i * i / i % i & i | i ^ i;/*+ - * / % & | ^*/ +No type information for this code.// var b = true && false || true ^ false;/*& | ^*/ +No type information for this code.// b = !b;/*!*/ +No type information for this code.// i = ~i;/*~i*/ +No type information for this code.// b = i < (i - continue ) && (i + 1) > i;/*< && >*/ +No type information for this code.// var f = true ? 1 : 0;/*? :*/ // YES : +No type information for this code.// i++;/*++*/ +No type information for this code.// i--;/*--*/ +No type information for this code.// b = true && false || true;/*&& ||*/ +No type information for this code.// i = i << 5;/*<<*/ +No type information for this code.// i = i >> 5;/*>>*/ +No type information for this code.// var j = i; +No type information for this code.// b = i == j && i != j && i <= j && i >= j;/*= == && != <= >=*/ +No type information for this code.// i += 5.0;/*+=*/ +No type information for this code.// i -= i;/*-=*/ +No type information for this code.// i *= i;/**=*/ +No type information for this code.// if (i == 0) +No type information for this code.// i++; +No type information for this code.// i /= i;/*/=*/ +No type information for this code.// i %= i;/*%=*/ +No type information for this code.// i &= i;/*&=*/ +No type information for this code.// i |= i;/*|=*/ +No type information for this code.// i ^= i;/*^=*/ +No type information for this code.// i <<= i;/*<<=*/ +No type information for this code.// i >>= i;/*>>=*/ +No type information for this code. +No type information for this code.// if (i == 0 && !b && f == 1) +No type information for this code.// return 0; +No type information for this code.// else return 1; +No type information for this code.// } +No type information for this code. +No type information for this code.// } +No type information for this code. +No type information for this code.// interface IF { +No type information for this code.// Foo